@nebula.js/sn-gauge 0.8.3 → 0.8.4

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.
@@ -1,11 +1,11 @@
1
1
  /*
2
- * @nebula.js/sn-gauge v0.8.3
2
+ * @nebula.js/sn-gauge v0.8.4
3
3
  * Copyright (c) 2025 QlikTech International AB
4
4
  * Released under the MIT license.
5
5
  */
6
6
 
7
7
  import{useElement as e,useOptions as t,useState as n,useEffect as i,useStaleLayout as r,useTheme as o,useApp as a,useModel as s,useRect as l,useTranslator as c,useAppLayout as u,useInteractionState as h,usePromise as d,onTakeSnapshot as f}from"@nebula.js/stardust";function p(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,i=Array(t);n<t;n++)i[n]=e[n];return i}function m(e,t,n){return(t=function(e){var t=function(e){if("object"!=typeof e||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function g(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,i)}return n}function y(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?g(Object(n),!0).forEach((function(t){m(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):g(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function x(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var i,r,o,a,s=[],l=!0,c=!1;try{if(o=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;l=!1}else for(;!(l=(i=o.call(n)).done)&&(s.push(i.value),s.length!==t);l=!0);}catch(e){c=!0,r=e}finally{try{if(!l&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(c)throw r}}return s}}(e,t)||w(e,t)||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 v(e){return function(e){if(Array.isArray(e))return p(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||w(e)||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 b(e){return b="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},b(e)}function w(e,t){if(e){if("string"==typeof e)return p(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?p(e,t):void 0}}var M=["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"],k=["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 S=function(e){return{value:e,label:e.charAt(0).toUpperCase()+e.slice(1),groupHeader:!1,disabled:!1,styles:{fontFamily:e}}};function _(e){var t=e.theme,n=e.translator,i=e.defaultValue,r=e.flags,o=[],a=t.getStyle("","","fontFamilies");return Array.isArray(a)&&a.length?o.push.apply(o,v(new Set([i].concat(v(a.map((function(e){return e.split(",").map((function(e){return e.trim()})).map((function(e){return e.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(v(o.map((function(e){return S(e)}))),[{value:"DefaultHeader",label:n.get("properties.allFonts"),metaText:n.get("properties.default"),groupHeader:!0}],v(function(e){return null!=e&&e.isEnabled("PS_20852_WYSIWYG_FONT_SUPPORT")?k:M}(r).map((function(e){return S(e)}))))}function q(e){var t=e.theme,n=e.translator,i=e.id,r=e.path,o=e.flags,a=function(){return t.getStyle(i,r,"fontFamily")};return{getDefaultValue:function(){return a()},getOptions:function(){return _({theme:t,translator:n,defaultValue:a(),flags:o})}}}var D,A,C=["10px","11px","12px","13px","14px","15px","16px","17px","18px","19px","20px","21px","22px","23px","24px"],N=function(e){return{value:e,label:e,groupHeader:!1,disabled:!1}};function E(e){var t=e.theme,n=e.translator,i=e.id,r=e.path,o=function(){return t.getStyle(i,r,"fontSize")};return{getDefaultValue:function(){return o()},getOptions:function(){return function(e){var t=e.translator,n=e.defaultValue,i=[],r=e.theme.getStyle("","","fontSizes");return Array.isArray(r)&&r.length?i.push.apply(i,v(new Set([n].concat(v(r))))):i.push(n),[{value:"ThemeHeader",label:t.get("properties.themeFontSizes"),metaText:t.get("properties.theme"),groupHeader:!0}].concat(v(i.map((function(e){return N(e)}))),[{value:"DefaultHeader",label:t.get("properties.allFontSizes"),metaText:t.get("properties.default"),groupHeader:!0}],v(C.map((function(e){return N(e)}))))}({theme:t,translator:n,defaultValue:o()})}}}function R(e){var t=e.theme,n=e.translator,i=e.id,r=e.path;return{fontFamily:q({theme:t,translator:n,id:i,path:r,flags:e.flags}),fontSize:E({theme:t,translator:n,id:i,path:r})}}var I,O=function(){if(A)return D;A=1;var e=Object.prototype.hasOwnProperty,t=Object.prototype.toString,n=Object.defineProperty,i=Object.getOwnPropertyDescriptor,r=function(e){return"function"==typeof Array.isArray?Array.isArray(e):"[object Array]"===t.call(e)},o=function(n){if(!n||"[object Object]"!==t.call(n))return!1;var i,r=e.call(n,"constructor"),o=n.constructor&&n.constructor.prototype&&e.call(n.constructor.prototype,"isPrototypeOf");if(n.constructor&&!r&&!o)return!1;for(i in n);return void 0===i||e.call(n,i)},a=function(e,t){n&&"__proto__"===t.name?n(e,t.name,{enumerable:!0,configurable:!0,value:t.newValue,writable:!0}):e[t.name]=t.newValue},s=function(t,n){if("__proto__"===n){if(!e.call(t,n))return;if(i)return i(t,n).value}return t[n]};return D=function e(){var t,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!=(t=arguments[d]))for(n in t)i=s(h,n),h!==(l=s(t,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:e(p,u,l)})):void 0!==l&&a(h,{name:n,newValue:l}));return h},D}(),P=(I=O)&&I.__esModule&&Object.prototype.hasOwnProperty.call(I,"default")?I.default:I;function L(e,t){return{range:function(e){var n=e.resources,i=e.data,r=n.theme.palette("categorical",0===t?i.items.length:t);return i.items.map((function(e){return r[e.value%r.length]}))},valueAccessor:e.value}}function T(e,t){return{range:function(e){var n=e.resources,i=e.data,r=n.theme.palette("categorical",0===t?i.items.length:t);return i.items.map((function(e){return r[e.row.value%r.length]}))},valueAccessor:e.value}}function z(e,t,n,i,r){var o,a,s=r.byRow,l=r.byElemNo;if(i&&(t.input.persistent||e.hc.qDimensionInfo.length>1||void 0===n.activeDimensionIndex&&e.hc.qSize.qcy>((null===(a=(o=e.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=t.pic.extract({field:i.key(),trackBy:i.value}).length;return s(i,c)}return{}}function F(e,t){var n=e.hc.qDimensionInfo,i=t.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 j(e,t){var n;return t.activeDimensionIndex>=0?n=e.pic.fields().filter((function(e){return"dimension"===e.type()}))[t.activeDimensionIndex]:"libraryItem"===t.type?!1===(n=t.key?e.pic.field((function(e){return e.raw().colorMapRef===t.key})):void 0)&&(n=e.pic.field((function(e){return"colorByAlternative"===e.raw().id}))):"expression"===t.type&&(n=e.pic.field((function(e){return"colorByAlternative"===e.raw().id}))),n}function V(e,t,n){e.prototype=t.prototype=n,n.constructor=e}function B(e,t){var n=Object.create(e.prototype);for(var i in t)n[i]=t[i];return n}function H(){}var $=1/.7,W="\\s*([+-]?\\d+)\\s*",U="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",Y="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",G=/^#([0-9a-f]{3,8})$/,X=new RegExp(`^rgb\\(${W},${W},${W}\\)$`),K=new RegExp(`^rgb\\(${Y},${Y},${Y}\\)$`),Z=new RegExp(`^rgba\\(${W},${W},${W},${U}\\)$`),J=new RegExp(`^rgba\\(${Y},${Y},${Y},${U}\\)$`),Q=new RegExp(`^hsl\\(${U},${Y},${Y}\\)$`),ee=new RegExp(`^hsla\\(${U},${Y},${Y},${U}\\)$`),te={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 ne(){return this.rgb().formatHex()}function ie(){return this.rgb().formatRgb()}function re(e){var t,n;return e=(e+"").trim().toLowerCase(),(t=G.exec(e))?(n=t[1].length,t=parseInt(t[1],16),6===n?oe(t):3===n?new ce(t>>8&15|t>>4&240,t>>4&15|240&t,(15&t)<<4|15&t,1):8===n?ae(t>>24&255,t>>16&255,t>>8&255,(255&t)/255):4===n?ae(t>>12&15|t>>8&240,t>>8&15|t>>4&240,t>>4&15|240&t,((15&t)<<4|15&t)/255):null):(t=X.exec(e))?new ce(t[1],t[2],t[3],1):(t=K.exec(e))?new ce(255*t[1]/100,255*t[2]/100,255*t[3]/100,1):(t=Z.exec(e))?ae(t[1],t[2],t[3],t[4]):(t=J.exec(e))?ae(255*t[1]/100,255*t[2]/100,255*t[3]/100,t[4]):(t=Q.exec(e))?me(t[1],t[2]/100,t[3]/100,1):(t=ee.exec(e))?me(t[1],t[2]/100,t[3]/100,t[4]):te.hasOwnProperty(e)?oe(te[e]):"transparent"===e?new ce(NaN,NaN,NaN,0):null}function oe(e){return new ce(e>>16&255,e>>8&255,255&e,1)}function ae(e,t,n,i){return i<=0&&(e=t=n=NaN),new ce(e,t,n,i)}function se(e){return e instanceof H||(e=re(e)),e?new ce((e=e.rgb()).r,e.g,e.b,e.opacity):new ce}function le(e,t,n,i){return 1===arguments.length?se(e):new ce(e,t,n,null==i?1:i)}function ce(e,t,n,i){this.r=+e,this.g=+t,this.b=+n,this.opacity=+i}function ue(){return`#${pe(this.r)}${pe(this.g)}${pe(this.b)}`}function he(){const e=de(this.opacity);return`${1===e?"rgb(":"rgba("}${fe(this.r)}, ${fe(this.g)}, ${fe(this.b)}${1===e?")":`, ${e})`}`}function de(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function fe(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function pe(e){return((e=fe(e))<16?"0":"")+e.toString(16)}function me(e,t,n,i){return i<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new ye(e,t,n,i)}function ge(e){if(e instanceof ye)return new ye(e.h,e.s,e.l,e.opacity);if(e instanceof H||(e=re(e)),!e)return new ye;if(e instanceof ye)return e;var t=(e=e.rgb()).r/255,n=e.g/255,i=e.b/255,r=Math.min(t,n,i),o=Math.max(t,n,i),a=NaN,s=o-r,l=(o+r)/2;return s?(a=t===o?(n-i)/s+6*(n<i):n===o?(i-t)/s+2:(t-n)/s+4,s/=l<.5?o+r:2-o-r,a*=60):s=l>0&&l<1?0:a,new ye(a,s,l,e.opacity)}function ye(e,t,n,i){this.h=+e,this.s=+t,this.l=+n,this.opacity=+i}function xe(e){return(e=(e||0)%360)<0?e+360:e}function ve(e){return Math.max(0,Math.min(1,e||0))}function be(e,t,n){return 255*(e<60?t+(n-t)*e/60:e<180?n:e<240?t+(n-t)*(240-e)/60:t)}V(H,re,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:ne,formatHex:ne,formatHex8:function(){return this.rgb().formatHex8()},formatHsl:function(){return ge(this).formatHsl()},formatRgb:ie,toString:ie}),V(ce,le,B(H,{brighter(e){return e=null==e?$:Math.pow($,e),new ce(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=null==e?.7:Math.pow(.7,e),new ce(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new ce(fe(this.r),fe(this.g),fe(this.b),de(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:ue,formatHex:ue,formatHex8:function(){return`#${pe(this.r)}${pe(this.g)}${pe(this.b)}${pe(255*(isNaN(this.opacity)?1:this.opacity))}`},formatRgb:he,toString:he})),V(ye,(function(e,t,n,i){return 1===arguments.length?ge(e):new ye(e,t,n,null==i?1:i)}),B(H,{brighter(e){return e=null==e?$:Math.pow($,e),new ye(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=null==e?.7:Math.pow(.7,e),new ye(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=this.h%360+360*(this.h<0),t=isNaN(e)||isNaN(this.s)?0:this.s,n=this.l,i=n+(n<.5?n:1-n)*t,r=2*n-i;return new ce(be(e>=240?e-240:e+120,r,i),be(e,r,i),be(e<120?e+240:e-120,r,i),this.opacity)},clamp(){return new ye(xe(this.h),ve(this.s),ve(this.l),de(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 e=de(this.opacity);return`${1===e?"hsl(":"hsla("}${xe(this.h)}, ${100*ve(this.s)}%, ${100*ve(this.l)}%${1===e?")":`, ${e})`}`}}));const we=Math.PI/180,Me=180/Math.PI,ke=4/29,Se=6/29,_e=3*Se*Se;function qe(e){if(e instanceof De)return new De(e.l,e.a,e.b,e.opacity);if(e instanceof Re)return Ie(e);e instanceof ce||(e=se(e));var t,n,i=Ee(e.r),r=Ee(e.g),o=Ee(e.b),a=Ae((.2225045*i+.7168786*r+.0606169*o)/1);return i===r&&r===o?t=n=a:(t=Ae((.4360747*i+.3850649*r+.1430804*o)/.96422),n=Ae((.0139322*i+.0971045*r+.7141733*o)/.82521)),new De(116*a-16,500*(t-a),200*(a-n),e.opacity)}function De(e,t,n,i){this.l=+e,this.a=+t,this.b=+n,this.opacity=+i}function Ae(e){return e>.008856451679035631?Math.pow(e,1/3):e/_e+ke}function Ce(e){return e>Se?e*e*e:_e*(e-ke)}function Ne(e){return 255*(e<=.0031308?12.92*e:1.055*Math.pow(e,1/2.4)-.055)}function Ee(e){return(e/=255)<=.04045?e/12.92:Math.pow((e+.055)/1.055,2.4)}function Re(e,t,n,i){this.h=+e,this.c=+t,this.l=+n,this.opacity=+i}function Ie(e){if(isNaN(e.h))return new De(e.l,0,0,e.opacity);var t=e.h*we;return new De(e.l,Math.cos(t)*e.c,Math.sin(t)*e.c,e.opacity)}V(De,(function(e,t,n,i){return 1===arguments.length?qe(e):new De(e,t,n,null==i?1:i)}),B(H,{brighter(e){return new De(this.l+18*(null==e?1:e),this.a,this.b,this.opacity)},darker(e){return new De(this.l-18*(null==e?1:e),this.a,this.b,this.opacity)},rgb(){var e=(this.l+16)/116,t=isNaN(this.a)?e:e+this.a/500,n=isNaN(this.b)?e:e-this.b/200;return new ce(Ne(3.1338561*(t=.96422*Ce(t))-1.6168667*(e=1*Ce(e))-.4906146*(n=.82521*Ce(n))),Ne(-.9787684*t+1.9161415*e+.033454*n),Ne(.0719453*t-.2289914*e+1.4052427*n),this.opacity)}})),V(Re,(function(e,t,n,i){return 1===arguments.length?function(e){if(e instanceof Re)return new Re(e.h,e.c,e.l,e.opacity);if(e instanceof De||(e=qe(e)),0===e.a&&0===e.b)return new Re(NaN,0<e.l&&e.l<100?0:NaN,e.l,e.opacity);var t=Math.atan2(e.b,e.a)*Me;return new Re(t<0?t+360:t,Math.sqrt(e.a*e.a+e.b*e.b),e.l,e.opacity)}(e):new Re(e,t,n,null==i?1:i)}),B(H,{brighter(e){return new Re(this.h,this.c,this.l+18*(null==e?1:e),this.opacity)},darker(e){return new Re(this.h,this.c,this.l-18*(null==e?1:e),this.opacity)},rgb(){return Ie(this).rgb()}}));var Oe=e=>()=>e;function Pe(e,t){var n=t-e;return n?function(e,t){return function(n){return e+n*t}}(e,n):Oe(isNaN(e)?t:e)}var Le=function e(t){var n=function(e){return 1==(e=+e)?Pe:function(t,n){return n-t?function(e,t,n){return e=Math.pow(e,n),t=Math.pow(t,n)-e,n=1/n,function(i){return Math.pow(e+i*t,n)}}(t,n,e):Oe(isNaN(t)?n:t)}}(t);function i(e,t){var i=n((e=le(e)).r,(t=le(t)).r),r=n(e.g,t.g),o=n(e.b,t.b),a=Pe(e.opacity,t.opacity);return function(t){return e.r=i(t),e.g=r(t),e.b=o(t),e.opacity=a(t),e+""}}return i.gamma=e,i}(1),Te=/^class(-pyramid)?/,ze=function(e,t,n,i){var r=void 0!==n.min?n.min:i.min(),o=void 0!==n.max?n.max:i.max(),a=r,s=o,l=t.limits,c={},u="percent"===t.limitType?l.map((function(e){return r+(o-r)*e})):l,h=t.colors.map((function(t){return e.resolveUIColor(t)}));if(r=Math.min.apply(Math,[r].concat(v(u))),o=Math.max.apply(Math,[o].concat(v(u))),c.min=r,c.max=o,t.breakTypes&&-1===t.breakTypes.indexOf(!0))c.type="categorical",Object.assign(c,function(e){var t=e.min,n=e.max,i=e.limits,r=e.range,o=[],a=[];if(i.length)if(i[i.length-1]<t)a.push(t,n),o.push(r[r.length-1],r[r.length-1],r[r.length-1]);else if(i[0]>n)a.push(t,n),o.push(r[0],r[0],r[0]);else{if(i[0]>t)a.push(t),o.push(r[0]);else{a.push(t);for(var s=0;s<i.length;s++)if(t<i[s]){o.push(r[s]);break}}for(var l=0;l<i.length;l++)t<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:t,max:n,range:o,domain:a}}({min:"percent"===t.limitType?r:a,max:"percent"===t.limitType?o:s,range:h,limits:"percent"===t.limitType?u:l}));else if(t.breakTypes){var d=t.breakTypes;c.type="continuous",c.domain=[r],c.range=[h[0]];for(var f=0;f<u.length;f+=1)if(d[f]){var p=h[f],m=h[f+1],g=Le(p,m)(.5);c.range.push(g),c.domain.push(u[f]),f<u.length-1&&d[f+1]&&(c.range.push(h[f+1]),c.domain.push((u[f]+u[f+1])/2))}else c.range.push(h[f]),c.range.push(h[f+1]),c.domain.push(u[f]),c.domain.push(u[f]+Math.min(1e-6,(o-r)/1e6));c.range.push(h[h.length-1]),c.domain.push(o)}else c.domain=u,c.range=h;return c};function Fe(e,t,n,i,r){var o,a,s,l=0,c=[],u=(e-t)/(i+1);if(0===u)return 1;for(o=0;o<n.length;o+=1)a=.99*(n[o]-t),s=n[o]>e?Math.floor(e/u):n[o]<t?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):Fe(e,t,n,i+1,r)}var je=function(e,t,n,i){var r,o,a=t.theme,s=t.hc,l=i.f,c={mode:"field",fieldType:"measure",field:l?l.key():void 0,reverse:n.input.reverseScheme||!1,type:"continuous",range:function(e){return e.resources.theme.palette("quant")}},u=[],h=!0;if(l){if(Number.isNaN(+l.min())||Number.isNaN(+l.max()))return{invalid:!0};(h=!("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))&&(u=n.pic.extract({field:0,props:{num:{field:l.key()},exclude:{fields:s.qDimensionInfo.map((function(e,t){return{field:"qDimensionInfo/".concat(t)}})),value:function(e){return Math.min.apply(Math,v(e))<0}}}}).filter((function(e){return e.value>=0&&!e.exclude.value})).map((function(e){return e.num.value})).filter((function(e){return"number"==typeof e})))}if(!1===n.input.autoMinMax){if(c.min=n.input.measureMin,c.max=n.input.measureMax,c.max<c.min)return{invalid:!0}}else if(l&&!h)c.min=l.min(),c.max=l.max();else if(l){if(!u.length)return{invalid:!0};c.min=Math.min.apply(Math,v(u)),c.max=Math.max.apply(Math,v(u))}if(n.input.measureScheme&&(c.palettes={quant:n.input.measureScheme}),a){var d=a.getDataColorScales().filter((function(e){return e.key===n.input.measureScheme}))[0];c.type=d&&Te.test(d.type)?"categorical":"continuous","categorical"===c.type&&(o=d.colors.some((function(e){return Array.isArray(e)}))?Math.max.apply(Math,v(d.colors.map((function(e){return e?e.length:0})))):d.colors.length)}if("categorical"===c.type){for(var f=h?Fe(c.max,c.min,u,1,o):o,p=(c.max-c.min)/f,m=[],g=0;g<f+1;g+=1)m.push(c.min+p*g);c.domain=m,c.range=function(e){for(var t=e.resources.theme.palette("quant",f),n=Math.max(1,Math.floor(t.length/f)),i=[],r=0;r<f;r+=1)i.push(t[r*n]);return[i[0]].concat(i,[i[i.length-1]])}}return c};function Ve(e,t){var n;return t.activeMeasureIndex>=0?n=e.pic.fields().filter((function(e){return"measure"===e.type()}))[t.activeMeasureIndex]:"libraryItem"===t.type?n=e.pic.field((function(e){return e.raw().colorMapRef===t.key&&void 0!==t.key})):"expression"===t.type&&(n=e.pic.field((function(e){return"colorByAlternative"===e.raw().id}))),n||(n=e.pic.field((function(e){return void 0!==e.raw().matchMeasure})))&&(n=e.pic.fields().filter((function(e){return"measure"===e.type()}))[n.raw().matchMeasure]),n}function Be(e){e.measureOverrides.every((function(e){return!e}))&&(e.measureOverrides=null)}function He(e,t){for(var n=(null==t?void 0:t.domain)||[],i=(null==t?void 0:t.range)||[],r=[],o=0;o<e.length;++o){var a=e[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,e[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 $e(e,t,n,i){var r,o=function(e,t,n,i){if(t.input&&!t.input.auto){if("byMeasure"===t.input.mode)return function(e,t,n){var i=t.theme,r=t.hc,o=(arguments.length>3&&void 0!==arguments[3]?arguments[3]:{}).getCField,a=void 0===o?Ve:o,s=n.input.byMeasureDef||{activeMeasureIndex:0},l=a(n,s),c=je(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(e){return"measure"===e.type()}))[l.raw().matchMeasure]),n.input.useMeasureGradient&&"libraryItem"===s.type)if(u){var h=u.raw().coloring;h&&h.gradient&&P(c,ze(e,h.gradient,c,u))}else c.auxiliary=s;return c}(e,n,t);if("byDimension"===t.input.mode)return function(e,t,n){var i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},r=i.getCDef,o=void 0===r?F:r,a=i.getCByField,s=void 0===a?j:a,l=i.getPersistence,c=void 0===l?z:l,u=o(t,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),P(p,c(t,n,u,h,{byRow:T,byElemNo:L})),p}(e,n,t);if("byExpression"===t.input.mode)return function(e,t,n,i){var r=t.hc,o=t.theme,a=t.translator,s=n.pic.field((function(e){return"colorByExpression"===e.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=je(0,{hc:r,theme:o},n,{f:s});return l.invalid||(l.label=n.input.expressionLabel||a.get("Object.ChartTooltip.ColorExpression")),l}(0,n,t,i);if("byMultiple"===t.input.mode||"primary"===t.input.mode)return function(e,t,n,i){var r=t.hc,o=t.theme,a=t.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(t,n){if(t.baseColor||t.coloring&&t.coloring.baseColor){l.push(n);var r=e.resolveUIColor(t.baseColor||t.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(t,n){if(t.baseColor||t.coloring&&t.coloring.baseColor){d.push(n);var r=e.resolveUIColor(t.baseColor||t.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=e.resolveUIColor(n.input.paletteColor));else{var m=n.input.singleColor;"number"!=typeof m||Number.isNaN(m)||(p=["#b0afae","#7b7a78","#545352","#4477aa","#7db8da","#b6d7ea","#46c646","#f93f17","#ffcf02","#276e27","#ffffff","#000000"][m])}return{mode:"constant",type:"constant",primary:p}}(e,n,t,i)}return{}}(e,t,n,i);return null!==(r=t.input)&&void 0!==r&&r.measureOverrides?(o.measureOverrides=t.input.measureOverrides.map((function(n,r){return function(e){var t,n=e.cm,i=e.defaults,r=e.index,o=e.input,a=e.pic;if(!o||!o.on)return null;var s=null!==(t=o.mode)&&void 0!==t?t:"primary";return"primary"===s?function(e,t,n){var i=n.primary;return void 0!==t.paletteColor&&t.paletteColor&&(i=e.resolveUIColor(t.paletteColor)),y(y({},n),{},{mode:"constant",type:"constant",primary:i})}(n,o,i):"byExpression"===s?function(e,t,n){var i="qMeasureInfo/".concat(e,"/"),r=t.field((function(e){return e.id().startsWith(i)&&"colorByMeasureExpression"===e.raw().id})),o=r;return y(y({},n),{},o?{mode:"field",fieldType:"expression",field:r?r.key():void 0,type:"color"}:{mode:"constant",type:"constant",primary:n.nil})}(r,a,i):null}({cm:e,input:n,defaults:i,index:r,pic:t.pic})})),function(e,t){var n,i,r,o=t.translator;if(Be(e),1===(null===(n=e.measureOverrides)||void 0===n?void 0:n.length))return e.measureOverrides[0];if("measure"===e.mode&&e.measureOverrides&&(e.explicit=He(e.measureOverrides,e.explicit),Be(e)),null!==(i=e.measureOverrides)&&void 0!==i&&i.every((function(e){return"constant"===(null==e?void 0:e.mode)}))){var a={mode:"measure",type:"categorical",label:null==o?void 0:o.get("Common.Measures")};return a.explicit=He(e.measureOverrides),a}return null!==(r=e.measureOverrides)&&void 0!==r&&r.every((function(e){return e}))?{invalid:!0,measureOverrides:e.measureOverrides}:e}(o,n)):o}var We=function(e,t){var n=e.fieldType,i={};if(t)if("measure"===n){var r=t.coloring;r&&(i.measureGradient=r.gradient)}else if("dimension"===n){var o=t[0],a=t[1];o&&(i.legendDataPage=o),a&&(i.dimValsData=a.colorMap)}return i},Ue=function(e){throw e.isHandled=!0,e};function Ye(e){return function(t){return"object"===b(t.datum[e])?t.datum[e].value:void 0}}function Ge(e){return"object"===b(e.datum.isNull)?e.datum.isNull.value:-2===e.datum.value}function Xe(e){return-3===e.datum.value}var Ke={COLOR:void 0,FONT_SIZE:"16px",FONT_FAMILY:"'Source Sans Pro', 'Arial', 'sans-serif'"},Ze={COLOR:void 0,FONT_SIZE:void 0,FONT_FAMILY:"'Source Sans Pro', 'Arial', 'sans-serif'"};function Je(e){var t=e.theme,n=e.key,i=e.styleOverrides,r={title:{color:Ke.COLOR,fontSize:Ke.FONT_SIZE,fontFamily:Ke.FONT_FAMILY},label:{color:Ze.COLOR,fontSize:Ze.FONT_SIZE,fontFamily:Ze.FONT_FAMILY}};if(!t&&!i)return r;var o=i||{},a=o.title,s=o.label,l=function(e){var t=e.theme,n=e.key;return function(e,i,r,o){return void 0!==e?e:t?t.getStyle(n,i,r):o}}({theme:t,key:n});return r.title.color=l(null==a?void 0:a.color,"legend.title","color",Ke.COLOR),r.title.fontSize=l(null==a?void 0:a.fontSize,"legend.title","fontSize",Ke.FONT_SIZE),r.title.fontFamily=l(null==a?void 0:a.fontFamily,"legend.title","fontFamily",Ke.FONT_FAMILY),r.label.color=l(null==s?void 0:s.color,"legend.label","color",Ze.COLOR),r.label.fontSize=l(null==s?void 0:s.fontSize,"legend.label","fontSize",Ze.FONT_SIZE),r.label.fontFamily=l(null==s?void 0:s.fontFamily,"legend.label","fontFamily",Ze.FONT_FAMILY),r}var Qe=function(e,t,n){var i=e&&e.dock||void 0;if("auto"!==i)return i||"right";if(t){var r=t.element.getBoundingClientRect();if(r.height>r.width)return"bottom"}return n?"left":"right"},et=function(e,t,n){return!(n.invalid||"color"===n.type||"measure"===n.mode&&t.qMeasureInfo.length<=1||"dimension"===n.mode)&&("function"==typeof e.show?e.show():!1!==e.show)};function tt(e,t){var n=e.styleReference,i=e.styleOverrides,r=e.chart,o=e.rtl,a=t.legendProps,s=t.coloring,l=t.theme,c=t.hc,u=Je({theme:l,key:n,styleOverrides:i});return{layout:{minimumLayoutMode:"MEDIUM",dock:Qe(a,r,o)},show:"function"==typeof a.show?function(){return et(a,c,s)}:et(a,c,s),renderer:"svg",mounted:function(e){e.childNodes[0].style.pointerEvents="none",e.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 nt(e,t,n){var i=[],r=[],o=function(e,t,n){return"categorical"===t.coloring.type?function(e,t,n){var i=tt(e,t);if(!i.show)return!1;var r,o=e.key,a=e.styleReference,s=e.styleOverrides,l=e.viewState,c=e.rtl,u=e.settings,h=e.style,d=t.scaleKey,f=t.theme,p=t.scales,m=Je({theme:f,key:a,styleOverrides:s}),g=i.layout.dock,x="left"===g||"right"===g?{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"===t.coloring.fieldType&&(r=function(e){return e.datum.value>=0||-3===e.datum.value});var b="".concat(d,"Legend");return P(!0,i,{type:"legend-cat",key:"".concat(o,"-cat"),scale:b in p?b:d,settings:{layout:{scrollOffset:function(){return l?l.get("legendScrollOffset"):void 0},size:-1!==["top","bottom"].indexOf(i.layout.dock)?2:1,direction:c?"rtl":"ltr",horizontal:20},item:{show:r,label:y({fill:m.label.color,fontSize:m.label.fontSize,fontFamily:m.label.fontFamily},x)},navigation:{disabled:n,button:{content:function(e,t){var n=t.direction;return e("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"}},[e("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 16 16",fill:"currentColor"},[e("path",{d:v[n]})])])}}}},brush:{consume:[{context:"selection",data:["",o],style:{inactive:{opacity:.3}}}]}},{settings:u,style:h})}(e,t,n):"continuous"===t.coloring.type&&function(e,t){var n,i=e.key,r=e.styleReference,o=e.styleOverrides,a=e.rtl,s=e.settings,l=e.style,c=t.scaleKey,u=t.theme,h="".concat(c,"Range"),d=tt(e,t);if(!d.show)return!1;var f=Je({theme:u,key:r,styleOverrides:o}),p=d.layout.dock,m="right"===p||"left"===p,g=null===(n=t.scales)||void 0===n?void 0:n[h];return m&&g&&(g.invert=!0),P(!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})}(e,t)}(e,t,n&&n.navigationDisabled);return i.push(o),o&&"legend-cat"===o.type&&(r.push(function(e){var t=e.key,n=e.requireFailure,i=e.recognizeWith,r=(arguments.length>1&&void 0!==arguments[1]?arguments[1]:{}).actions;return{key:"event:tap-".concat(t),type:"Tap",requireFailure:n,recognizeWith:i,options:{event:"legendtap",interval:10,pointers:1,enable:function(e,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(e){return e.key==="".concat(t,"-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(e){e.preventDefault();var t=e.srcEvent.target;t&&t.hasAttribute("data-action")&&t.hasAttribute("data-component-key")&&this.chart.component(t.getAttribute("data-component-key")).emit(t.getAttribute("data-action"))}}}}(e,n)),r.push(function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.eventName,n=e.key,i=e.requireFailure,r=e.recognizeWith,o=(arguments.length>1&&void 0!==arguments[1]?arguments[1]:{}).actions;return{key:"event:pan-".concat(n),type:"Pan",requireFailure:i,recognizeWith:r,options:{event:t,pointers:1,threshold:10,enable:function(e,i){var r;return this.started===t||!i||!(null!=o&&null!==(r=o.interact)&&void 0!==r&&r.enabled&&!o.interact.enabled())&&this.chart.componentsFromPoint({x:i.center.x,y:i.center.y}).some((function(e){return e.key==="".concat(n,"-cat")}))}},events:m(m(m({},"".concat(t,"start"),(function(e){e.preventDefault(),this.started!==t&&(this.started=t,this.chart.component("".concat(n,"-cat")).emit("panstart",e))})),"".concat(t,"move"),(function(e){e.preventDefault(),this.chart.component("".concat(n,"-cat")).emit("panmove",e)})),"".concat(t,"end"),(function(e){e.preventDefault(),this.chart.component("".concat(n,"-cat")).emit("panend",e),this.started=!1}))}}(e,n))),{interactions:r,components:i}}function it(e){var t=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.auto,n=function(e){var t=y({hc:null,colorProps:null,layout:null,theme:null},e),n={},i={auto:function(){return{mode:"primary"}},getDimensionColorMap:function(){return Promise.reject()},getMeasure:function(){return Promise.reject()},getAttributeDimension:function(){return Promise.reject()}},r={auto:function(e){return e?(i.auto=e,r):i.auto},getDimensionColorMap:function(e){return e?(i.getDimensionColorMap=e,r):i.getDimensionColorMap},getAttributeDimension:function(e){return e?(i.getAttributeDimension=e,r):i.getAttributeDimension},getMeasure:function(e){return e?(i.getMeasure=e,r):i.getMeasure},set:function(e){var r;if(!e.colorProps)throw new Error('Missing "colorProps"');if(P(t,e),(n={pic:t.picasso.data("q")({data:t.hc,config:{localeInfo:t.localeInfo}}),input:t.colorProps}).input.auto){var o=i.auto(e.layout);n.input=P(!0,{},n.input,o,{auto:!1});var a=t.theme?t.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),t.hc&&t.hc.qDimensionInfo[s]&&t.hc.qDimensionInfo[s].coloring&&t.hc.qDimensionInfo[s].coloring.colorMapRef&&n.input.byDimDef&&(n.input.byDimDef.type="libraryItem",n.input.byDimDef.key=t.hc.qDimensionInfo[s].coloring.colorMapRef)}null!==(r=n.input.measureOverrides)&&void 0!==r&&r.every((function(e){return!e||!e.on}))&&(n.input=P(!1,{},n.input,{measureOverrides:null}))},palettes:function(){if(!n.palettes){var e=t.theme,i=[];(e&&e.getDataColorPickerPalettes()||[]).forEach((function(e){i.push({key:"ui",colors:e.colors})})),n.palettes=i}return n.palettes},getAuxiliaryData:function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"/qHyperCubeDef";if(!e.auxiliary&&!/qAttrDimInfo/.test(e.field))return Promise.resolve();var r=(e.auxiliary||{}).key;if("measure"===e.fieldType)return i.getMeasure(r,t).catch((function(){}));if("dimension"===e.fieldType){var o="".concat(n,"/").concat(e.field).replace("qDimensionInfo","qDimensions").replace("qAttrDimInfo","qAttributeDimensions");return Promise.all([/qAttrDimInfo/.test(e.field)?i.getAttributeDimension(o,t).catch((function(){})):Promise.resolve(),r?i.getDimensionColorMap(r,t).catch((function(){})):Promise.resolve()])}return Promise.resolve()},getAuxiliarySettings:function(e,i){var r=this;return e.auxiliary||/qAttrDimInfo/.test(e.field)?(this.palettes(),this.getAuxiliaryData(e,i).then((function(i){if(!i)return{};if("measure"===e.fieldType){if(i.coloring&&i.coloring.gradient){var o=n.pic.field(e.field);return ze(r,i.coloring.gradient,e,o)}return{}}if("dimension"===e.fieldType){var a={nil:e.nil,others:e.others},s=i[0],l=i[1]?i[1].colorMap:null;if(s){var c=t.picasso.data("q")({data:{qDimensionInfo:[n.pic.field(e.field).raw(),n.pic.field(e.field).raw()],qMeasureInfo:[],qDataPages:s,qInterColumnSortOrder:[0,1],qMode:"S"}});a.legendDataset=c}return l?function(e,t,n,i){var r=i.external,o=i.field,a=y({},e);P(a,L(o,o.raw().qCardinal));var s=r.theme?r.theme.getDataColorPalettes()[0]:null;return t.nul&&(a.nil=n.resolveUIColor(t.nul)),t.oth&&(a.others=n.resolveUIColor(t.oth)),t.usePal?(a.palettes={categorical:t.pal},s&&!t.pal&&(a.palettes.categorical=s.key,P(a,L(o)))):!1===t.autoFill&&t.single?a.range=[n.resolveUIColor(t.single)]:t.autoFill&&(s&&(a.palettes={categorical:s.key}),P(a,L(o))),t.colors&&t.colors.length&&(a.explicit=function(e,t,n){for(var i={},r=0;r<e.length;r+=1)i[e[r].value]=e[r].baseColor;var o=[];return{domain:function(e){var r=e.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(t.resolveUIColor(i[c])))}return a.push(-3,-2),o.push(n.others),o.push(n.nil),a},range:function(){return o}}}(t.colors,n,a)),a}(a,l,r,{external:t,field:n.pic.field(e.field)}):a}return{}}))):Promise.resolve()},resolveUIColor:function(e){if(e.index<0||void 0===e.index)return e.color;if(void 0===n.uiPalette&&(n.uiPalette=this.palettes().filter((function(e){return"ui"===e.key}))[0]||!1),!n.uiPalette)return e.color;var t="none"===n.uiPalette.colors[0]?e.index:e.index-1;return void 0===n.uiPalette.colors[t]?e.color:n.uiPalette.colors[t]},settings:function(){if(this.palettes(),!n.settings){var e={primary:"steelblue",others:"#aaa",nil:"#ddd"},i=t.theme;i&&(e=y(y({},e),i.getDataColorSpecials())),n.settings=P(e,$e(this,n,t,e))}return n.settings}};return r}(e.resources).auto(t||function(){return{mode:"byDimension",persistent:!1,useDimColVal:!0,byDimDef:{activeDimensionIndex:0,type:"expression",label:""}}}).getDimensionColorMap((function(e,t){return function(e,t){var n=t.layout,i=t.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(e)).then((function(e){return e.getLayout()})):Promise.reject()}(e,{layout:t.layout,app:t.app})})).getMeasure((function(e,t){return function(e,t){var n=t.layout,i=t.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(e).then((function(e){return e.getMeasure()})):Promise.reject()}(e,{layout:t.layout,app:t.app})})).getAttributeDimension((function(e,t){return function(e,t){var n=t.layout,i=t.model,r=t.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(e,[{qHeight:100,qLeft:0,qTop:0,qWidth:2}]).catch(Ue):Promise.reject()}(e,{layout:t.layout,model:t.model,app:t.app})}));return n.getSnapshotData=We,n}({resources:e}),n={},i={},r=function(e){return i.settings||(e||console.warn("settings() called before auxiliarySettings()"),i.settings=t.settings()),i.settings},o={config:function(r){if(n=y({},r),i={},!n.key)throw new Error("Missing key");t.set(y(y({},e),n))},auto:function(e){return e?(t.auto(e),o):t.auto()},getAuxiliarySettings:function(e){return i.auxiliarySettings?Promise.resolve(i.auxiliarySettings):t.getAuxiliarySettings(r(!0),e).then((function(e){return i.auxiliarySettings=e||{},i.settings=y(y({},i.settings),i.auxiliarySettings),i.scales=void 0,i.color=void 0,i.auxiliarySettings}))},getAuxiliaryData:function(){return t.getAuxiliaryData(r())},getSnapshotData:function(e){var n=r();return t.getAuxiliaryData(n,e).then((function(e){return t.getSnapshotData(n,e)}))},resolveUIColor:function(e){return t.resolveUIColor(e)},settings:function(){var e=r();return{mode:e.mode,type:e.type,label:e.label,field:e.field,fieldType:e.fieldType,nil:e.nil,others:e.others,primary:e.primary}},settingsForMeasure:function(e){var t;return(null===(t=r().measureOverrides)||void 0===t?void 0:t[e])||this.settings()},isSelectionLocked:function(e){var t=e.isMeasureSelectionLocked;return function(e,t){var n=t.isMeasureSelectionLocked;return"field"!==e.mode||("dimension"===e.fieldType?e.isFieldLocked:"measure"!==e.fieldType||n)}(r(),{isMeasureSelectionLocked:t})},palettes:function(){return function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.colorProps,n=e.coloring,i=e.theme,r=[];if(n&&n.palettes&&i){var o=n.palettes.categorical||t.dimensionScheme,a=i.getDataColorPalettes().filter((function(e){return e.key===o}))[0]||i.getDataColorPalettes()[0];o&&a&&r.push({key:"categorical",colors:a.colors});var s=n.palettes.metric||t.measureScheme,l=i.getDataColorScales().filter((function(e){return e.key===s}))[0]||i.getDataColorScales()[0];if(l){var c=l.colors[0]?l.colors:[[]].concat(v(l.colors.slice(1)));c=Array.isArray(c[0])?c.map((function(e){return e.slice().reverse()})):c.slice().reverse(),r.push({key:"quant",colors:c})}}return r}({coloring:r(),colorProps:n.colorProps,theme:n.theme})},scales:function(){return i.scales=i.scales||function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.hc,n=e.coloring,i=e.rtl,r=e.key,o=e.source,a=e.picasso,s={},l=r;if(n){var c={override:!0,domain:n.explicit&&"function"==typeof n.explicit.domain?n.explicit.domain:[].concat(v((n.explicit||{}).domain||[]),[-3,-2]),range:n.explicit&&"function"==typeof n.explicit.range?n.explicit.range:[].concat(v((n.explicit||{}).range||[]),[n.others,n.nil])};if("field"===n.mode){if("dimension"===n.fieldType){var u,h=function(e){var t=e.hc,n=e.source,i=e.coloring,r={data:{extract:[{source:"dummy",field:0,filter:function(){return r.expando=t.qDataPages[0]?t.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(e){return e.qText},reduce:"first"}}}]},expando:0};return r}({hc:t,source:o,coloring:n}).data;if(n.legendDataset){var d=0,f={};a.data("q")({data:t}).extract({field:n.field,trackBy:n.valueAccessor,reduce:function(e){var t=e[0];return f[t]=d++,e[0]}}),u={source:"attrDim",extract:{field:"qDimensionInfo/0",filter:function(e){return e.qElemNumber>=0},props:{row:{value:function(e){return f[e.qElemNumber]}}}}}}var p={data:h,range:n.range,domain:n.domain,explicit:c,type:"categorical-color",label:function(e){return e.datum.text&&e.datum.text.value?e.datum.text.value:e.datum.label}};s[l]=p,u&&(s["".concat(l,"Legend")]=y(y({},p),{},{data:u})),t&&t.qHasOtherValues&&u&&((u||p.data).amend=[{label:t.qDimensionInfo[0].othersLabel,source:{key:"qHyperCube",field:"qDimensionInfo/0"},row:{value:-3},value:-3}])}else if("measure"===n.fieldType){var m={data:{field:n.field},min:n.min,max:n.max};s[l]=P({},m,{type:"categorical"===n.type?"threshold-color":"sequential-color",range:n.range,domain:n.domain,invert:n.reverse}),"sequential-color"===s[l].type&&(s["".concat(l,"Range")]=P({},m,{invert:!!i}))}else if("color"!==n.type)throw new Error("UNUSED FIELD")}else if("dimension"===n.mode){var g={data:t.qDimensionInfo.map((function(e,t){return t})),label:function(e){return t.qDimensionInfo[e.datum.value].qFallbackTitle},explicit:c,type:"categorical-color"};s[l]=g}else if("measure"===n.mode){var x={data:t.qMeasureInfo.map((function(e,t){return t})).filter((function(e){var t;return!(null!==(t=n.explicit)&&void 0!==t&&null!==(t=t.exclude)&&void 0!==t&&t.includes(e))})),label:function(e){return t.qMeasureInfo[e.datum.value].qFallbackTitle},explicit:c,type:"categorical-color"};s[l]=x}}return s}({hc:n.hc,coloring:r(),key:n.key,source:n.source,picasso:e.picasso}),i.scales},color:function(){return i.color=i.color||function(e){var t=e.coloring,n=e.scales,i=e.key,r=Ye(i),o=Ye("".concat(i,"IsAnOther")),a=function(e,t){var i=e.fieldType,a=e.invalid,s=e.mode,l=e.nil,c=e.others,u=e.primary,h=e.type;return a?function(e){return Xe(e)||o(e)?c:l}:n[t]?function(e){return Xe(e)?c:Ge(e)||-2===r(e)&&"dimension"===i||"NaN"===r(e)?l:o(e)?c:e.resources.scale(t)(r(e))||c}:"constant"===s?function(e){return Xe(e)||o(e)?c:Ge(e)?l:u}:"color"===h?function(e){return Xe(e)||o(e)?c:Ge(e)?l:r(e)||c}:null},s=a(t,i);if(t.measureOverrides){var l=Ye("".concat(i,"MeasureIdx")),c=t.measureOverrides.map((function(e){return e&&a(e)}));return function(e){var t=l(e);return c[t]?c[t](e):s(e)}}return s}({coloring:r(),scales:this.scales(),key:n.key}),i.color},datumProps:function(e){return function(e){var t,n,i=e.hc,r=e.coloring,o=e.scales,a=e.key,s=e.addMeasureIx,l=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,c=a,u=r.nil;"field"===r.mode&&r.field?t=r.field:o[a]&&"field"===r.mode&&(t=o[a].data.field||r.field),t?(n={field:t,reduce:"first"},"color"===r.type&&(n.value=function(e){return"NaN"!==e.qNum?function(e){return"rgba(".concat([(16711680&e)>>16,(65280&e)>>8,255&e,((4278190080&e)>>>24)/255].join(","),")")}(e.qNum):e.qText&&re(e.qText)?e.qText:u})):"dimension"===r.mode?n=void 0!==r.field?r.field:i.qDimensionInfo.length-1:"measure"===r.mode&&(n=l);var h=m({},c,n);return i.qDimensionInfo.length>1&&(h["".concat(c,"IsAnOther")]={fields:i.qDimensionInfo.map((function(e,t){return{field:"qDimensionInfo/".concat(t)}})),value:function(e){return-1!==e.indexOf(-3)}}),s&&(h["".concat(c,"MeasureIdx")]=l),h}({coloring:this.settingsForMeasure(e),scales:this.scales(),key:n.key,hc:n.hc,addMeasureIx:r().measureOverrides},e)},data:function(){var e=r(),t={key:"dummy",data:[["field"],["a"]]};return e.legendDataset?[t,{type:"q",key:"attrDim",data:e.legendDataset.raw(),config:{localeInfo:n.localeInfo}}]:[t]},legend:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.eventName,i=e.key,o=e.viewState,a=e.chart,s=e.rtl,l=e.styleReference,c=void 0===l?"object.legend":l,u=e.styleOverrides,h=e.settings,d=void 0===h?{}:h,f=e.style,p=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return nt({eventName:t,key:i,rtl:s,viewState:o,chart:a,styleReference:c,styleOverrides:u,settings:d,style:void 0===f?{}:f},{legendProps:n.legendProps,scaleKey:n.key,coloring:r(),theme:n.theme,hc:n.hc,scales:this.scales()},p)}};return o}var rt=function(e){return e.baseColor||e.coloring&&e.coloring.baseColor};function ot(e){var t=e.qHyperCube,n=t.qDimensionInfo,i=t.qMeasureInfo,r=n.some(rt),o=i.some(rt),a=e.color.useBaseColors;return"measure"===a&&!o||"dimension"===a&&!r?"off":a}var at=function(e){return e.baseColor||e.coloring&&e.coloring.baseColor};function st(e){var t,n=e.qHyperCube.qDimensionInfo.some(at),i=e.qHyperCube.qMeasureInfo.some(at),r=n?"dimension":void 0;return{mode:"primary",useBaseColors:null!==(t=null!=r?r:i?"measure":void 0)&&void 0!==t?t:"off",paletteColor:null}}var lt=function(){};function ct(e){var t,n,i,r,o=e.picasso,a=e.model,s=e.app,l=e.translator,c=e.layoutService,u=void 0===c?void 0:c,h=e.createConfig,d=void 0===h?lt:h,f=e.config,p=void 0===f?{}:f,m=e.custom,g=void 0===m?{}:m,x=p.localeInfo,v=p.key,b=p.theme,w=void 0===b?void 0:b,M=p.auto,k=void 0===M?void 0:M,S=p.definitionPath,_=null==u||null===(t=u.getLayout)||void 0===t?void 0:t.call(u),q={theme:w,key:v,localeInfo:x,layout:_,hc:null==u||null===(n=u.getHyperCube)||void 0===n?void 0:n.call(u),legendProps:null==u||null===(i=u.getLayoutValue)||void 0===i?void 0:i.call(u,"legend"),colorProps:y(y({},null==u||null===(r=u.getLayoutValue)||void 0===r?void 0:r.call(u,"color")),{},{useBaseColors:_?ot(_):void 0})},D=it({picasso:o,model:a,app:s,translator:l,auto:k});!1!==k&&D.auto((function(e){return k?k({layout:e,defaultAuto:st}):st(e)}));var A=!1,C={getColor:function(){return D.color()},getPaletteColor:function(e){var t=e.index,n=e.color;return D.resolveUIColor({index:t,color:n})},getData:function(){return D.data()},getDatumProps:function(e){return D.datumProps(e)},getSnapshotData:function(){return D.getSnapshotData(S)},getSettingsForMeasure:function(e){return D.settingsForMeasure(e)},getSettings:function(){return D.settings()},getLegend:function(e,t){return D.legend(e,t)},getScales:function(){return D.scales()},getPalettes:function(){return D.palettes()},isSelectionLocked:function(e){var t=e.isMeasureSelectionLocked;return D.isSelectionLocked({isMeasureSelectionLocked:t})},isInitialized:function(){return A},custom:y({},g),initialize:function(){var e=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}).createConfig,t=(void 0===e?d:e)({getUseBaseColors:ot}),n=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return y(y(y({},e),t),{},{colorProps:y(y({},e.colorProps),t.colorProps||{})})}(q,t);return D.config(n),D.getAuxiliarySettings(S).then((function(){A=!0}))}};return C}var ut="center",ht="bottom";function dt(e){var t=e.chart,n=e.logicalSize;if(n)return n;var i=t?t.element.getBoundingClientRect():{};return{width:i.width,height:i.height}}[{key:"NoDataExist",alignment:ut,condition:function(e){var t=e.layoutService;if(!t)return!1;var n=t.meta.size;return n.x*n.y==0}},{key:"OnlyNanDataMeasure",translationKey:"OnlyNanData",alignment:ut,condition:function(e){var t=e.layoutService;return!!t&&t.getHyperCubeValue("qMeasureInfo").every((function(e){return"NaN"===e.qMin&&"NaN"===e.qMax}))}},{key:"OnlyNanDataDimensionContinuous",translationKey:"OnlyNanData",alignment:ut,condition:function(e){var t=e.layoutService;if(!t)return!1;if(!t.meta.isContinuous)return!1;var n=t.getHyperCubeValue("qDimensionInfo.0");return n&&(n.qMax<n.qMin||"NaN"===n.qMax)}},{key:"OnlyNegativeOrZeroValues",alignment:ut},{key:"DataRangeIncludingZero",alignment:ht},{key:"LimitedData",alignment:ht},{key:"NegativeOrZeroValues",alignment:ht}].reduce((function(e,t){return e[t.key]=t,e}),{});var ft=[{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 pt(e){var t=e.width,n=e.height,i=ft.filter((function(e){return t>=e.size.width&&n>=e.size.height})).shift();return i?i.key:"SPARK"}var mt={left:"right",right:"left",top:"bottom",bottom:"top",near:"far",far:"near"};function gt(e){var t=e.orientation,n=e.dock,i=e.btt,r=e.rtl,o="horizontal"===t?function(e){return"bottom"===e||"near"===e?"bottom":"top"}(n):function(e,t){var n="left"===e||"near"===e?"left":"right";return t?mt[n]:n}(n,r),a=function(e,t,n){return"vertical"===e?t?"bottom":"top":n?"right":"left"}(t,i,r);return{current:o,opposite:mt[o],start:a,end:mt[a]}}function yt(e){var t=e.chart,n=e.layoutService,i=e.config,r=void 0===i?{}:i,o=r.logicalSize,a=void 0!==o&&o,s=r.rtl,l=void 0!==s&&s,c={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}},u={type:"x-y",config:y({},r),meta:c,update:function(e){c.chart.size={width:e.width,height:e.height},c.chart.mode=pt(e);var t=gt({orientation:"horizontal",dock:n.getLayoutValue("xAxis.dock"),btt:!1,rtl:l}),i=t.current,r=t.opposite;c.x.dock=i,c.x.opposite=r,c.x.size=e.width;var o=gt({orientation:"vertical",dock:n.getLayoutValue("yAxis.dock"),btt:!0,rtl:l}),a=o.current,s=o.opposite;c.y.dock=a,c.y.opposite=s,c.y.size=e.height}};return u.update(dt({chart:t,logicalSize:a})),u}var xt="vertical",vt="horizontal";function bt(e){var t=e.chart,n=e.layoutService,i=e.config,r=void 0===i?{}:i,o=e.typeConfig,a=void 0===o?{}:o,s=r.logicalSize,l=void 0!==s&&s,c=r.rtl,u=void 0!==c&&c,h=a.fallback===xt?xt:vt,d=!!a.invert,f=a.measureAxes||[{ref:"measureAxis",name:"minor"}],p={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:y({},r),meta:p,update:function(e){p.chart.orientation=n.getLayoutValue("orientation",h),p.chart.size={width:e.width,height:e.height},p.chart.mode=pt(e),p.major.orientation=function(e){var t=e.chartOrientation,n=e.invert;return e.layoutService.meta.isContinuous?vt:n?t===xt?vt:xt:t}({layoutService:n,chartOrientation:p.chart.orientation,invert:d});var t=gt({orientation:p.major.orientation,dock:n.getLayoutValue("dimensionAxis.dock"),btt:!1,rtl:u}),i=t.current,r=t.opposite;p.major.dock=i,p.major.opposite=r,p.major.size=p.major.orientation===xt?e.height:e.width,f.forEach((function(t){var i={};i.orientation=p.major.orientation===xt?vt:xt;var r=gt({orientation:i.orientation,dock:n.getLayoutValue("".concat(t.ref,".dock")),btt:!0,rtl:u}),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===xt?e.height:e.width,p[t.name]=i}))}};return m.update(dt({chart:t,logicalSize:l})),m}function wt(e){var t=e.chart,n=e.layoutService,i=e.config,r=void 0===i?{}:i,o=e.typeConfig,a=void 0===o?{}:o;return("x-y"===a.type?yt:bt)({chart:t,layoutService:n,config:r,typeConfig:a})}function Mt(e,t,n){if(void 0===e||void 0===t)return n;for(var i=t.split("."),r=e,o=0;o<i.length;++o){var a=i[o];if(void 0===r[a])return n;r=r[a]}return r}var kt=["__proto__","constructor"];function St(e,t,n){if(void 0!==e&&void 0!==t){var i=t.split("."),r=i[i.length-1];if(!kt.some((function(e){return i.includes(e)}))){for(var o=e,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]}}}function _t(){var e={};return{get:function(t){return e[t]},set:function(t,n){return e[t]=n,n},has:function(t){return t in e},remove:function(t){delete e[t]},empty:function(){e={}}}}var qt,Dt={ERROR_CODES:[7005],DIMENSION:"qDimensionInfo",MEASURE:"qMeasureInfo"},At=function(e,t){return e[t].reduce((function(e,t,n){var i;return i=t,Dt.ERROR_CODES.some((function(e){var t;return e===(null===(t=i.qError)||void 0===t?void 0:t.qErrorCode)}))?e.filtered.push(n):e.reduced.push(t),e}),{reduced:[],filtered:[]})};function Ct(e){var t;return((null==e||null===(t=e.qHyperCube)||void 0===t?void 0:t.qDimensionInfo)||[]).map((function(e){var t,n=null===(t=e.qCardinalities)||void 0===t?void 0:t.qHypercubeCardinal;if(n)return n;var i=e.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 Nt(e){switch(e.qHyperCube.qMode){case"S":return function(e){var t=e.qHyperCube.qSize;return{refs:{dataPages:"qHyperCube.qDataPages"},size:{x:t.qcx,y:t.qcy,dimensions:Ct(e)}}}(e);case"K":return function(e){var t=Ct(e);return{refs:{dataPages:"qHyperCube.qStackedDataPages"},size:{x:e.qHyperCube.qSize.qcx,y:t[0],dimensions:t}}}(e);case"T":return function(e){var t=Ct(e);return{refs:{dataPages:"qHyperCube.qTreeDataPages"},size:{x:e.qHyperCube.qSize.qcx,y:t[0],dimensions:t}}}(e);default:throw new Error("Mode not supported")}}function Et(e){var t=0,n=e.children,i=n&&n.length;if(i)for(;--i>=0;)t+=n[i].value;else t=1;e.value=t}function Rt(e,t){e instanceof Map?(e=[void 0,e],void 0===t&&(t=Ot)):void 0===t&&(t=It);for(var n,i,r,o,a,s=new Tt(e),l=[s];n=l.pop();)if((r=t(n.data))&&(a=(r=Array.from(r)).length))for(n.children=r,o=a-1;o>=0;--o)l.push(i=r[o]=new Tt(r[o])),i.parent=n,i.depth=n.depth+1;return s.eachBefore(Lt)}function It(e){return e.children}function Ot(e){return Array.isArray(e)?e[1]:null}function Pt(e){void 0!==e.data.value&&(e.value=e.data.value),e.data=e.data.data}function Lt(e){var t=0;do{e.height=t}while((e=e.parent)&&e.height<++t)}function Tt(e){this.data=e,this.depth=this.height=0,this.parent=null}Tt.prototype=Rt.prototype={constructor:Tt,count:function(){return this.eachAfter(Et)},each:function(e,t){let n=-1;for(const i of this)e.call(t,i,++n,this);return this},eachAfter:function(e,t){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();)e.call(t,o,++l,this);return this},eachBefore:function(e,t){for(var n,i,r=this,o=[r],a=-1;r=o.pop();)if(e.call(t,r,++a,this),n=r.children)for(i=n.length-1;i>=0;--i)o.push(n[i]);return this},find:function(e,t){let n=-1;for(const i of this)if(e.call(t,i,++n,this))return i},sum:function(e){return this.eachAfter((function(t){for(var n=+e(t.data)||0,i=t.children,r=i&&i.length;--r>=0;)n+=i[r].value;t.value=n}))},sort:function(e){return this.eachBefore((function(t){t.children&&t.children.sort(e)}))},path:function(e){for(var t=this,n=function(e,t){if(e===t)return e;var n=e.ancestors(),i=t.ancestors(),r=null;for(e=n.pop(),t=i.pop();e===t;)r=e,e=n.pop(),t=i.pop();return r}(t,e),i=[t];t!==n;)t=t.parent,i.push(t);for(var r=i.length;e!==n;)i.splice(r,0,e),e=e.parent;return i},ancestors:function(){for(var e=this,t=[e];e=e.parent;)t.push(e);return t},descendants:function(){return Array.from(this)},leaves:function(){var e=[];return this.eachBefore((function(t){t.children||e.push(t)})),e},links:function(){var e=this,t=[];return e.each((function(n){n!==e&&t.push({source:n.parent,target:n})})),t},copy:function(){return Rt(this).eachBefore(Pt)},[Symbol.iterator]:function*(){var e,t,n,i,r=this,o=[r];do{for(e=o.reverse(),o=[];r=e.pop();)if(yield r,t=r.children)for(n=0,i=t.length;n<i;++n)o.push(t[n])}while(o.length)}},qt=function(e){
8
8
  /*! javascript-number-formatter - v1.1.11 - http://mottie.github.com/javascript-number-formatter/ * © ecava */
9
- e.exports=function(e,t){if(!e||isNaN(+t))return t;var n,i,r,o,a,s,l,c,u,h,d=e.length,f=e.search(/[0-9\-\+#]/),p=f>0?e.substring(0,f):"",m=e.split("").reverse().join(""),g=m.search(/[0-9\-\+#]/),y=d-g,x=e.substring(y,y+1),v=y+("."===x||","===x?1:0),b=g>0?e.substring(v,d):"";if(n=(t="-"===(e=e.substring(f,v)).charAt(0)?-t:+t)<0?t=-t:0,r=(i=e.match(/[^\d\-\+#]/g))&&i[i.length-1]||".",o=i&&i[1]&&i[0]||",",e=e.split(r),t=+(t=t.toFixed(e[1]&&e[1].length))+"",s=e[1]&&e[1].lastIndexOf("0"),(!(c=t.split("."))[1]||c[1]&&c[1].length<=s)&&(t=(+t).toFixed(s+1)),u=e[0].split(o),e[0]=u.join(""),(a=e[0]&&e[0].indexOf("0"))>-1)for(;c[0].length<e[0].length-a;)c[0]="0"+c[0];else 0==+c[0]&&(c[0]="");if((t=t.split("."))[0]=c[0],l=u[1]&&u[u.length-1].length){for(m="",y=(h=t[0]).length%l,d=h.length,v=0;v<d;v++)m+=h.charAt(v),!((v-y+1)%l)&&v<d-l&&(m+=o);t[0]=m}return t[1]=e[1]&&t[1]?r+t[1]:"","0"!==(i=t.join(""))&&""!==i||(n=!1),p+(n?"-":"")+i+b}},qt({exports:{}});var zt="'Source Sans Pro', 'Arial', 'sans-serif'",Ft="#333333",jt="#595959",Vt="#737373",Bt="#cccccc",Ht="#e6e6e6";function $t(e){var t={};return[].concat(v(e),v([["","","color"],["object","","fontFamily"],["object","axis.label.name","color",jt],["object","axis.label.name","fontFamily",zt],["object","axis.label.name","fontSize","12px"],["object","axis.line.major","color",Bt],["object","axis.line.minor","color",Ht],["object","axis.title","color"],["object","axis.title","fontFamily",zt],["object","axis.title","fontSize","13px"],["object","grid.line.highContrast","color",Ht],["object","grid.line.major","color",Bt],["object","grid.line.minor","color",Ht],["object","label.value","color",jt],["object","label.value","fontFamily",zt],["object","label.value","fontSize","12px"],[!1,"label.value","darkColor",jt],[!1,"label.value","lightColor",Ht],["object","outOfRange","color","#999"],["object","legend.title","color",Ft],["object","legend.title","fontFamily",zt],["object","legend.title","fontSize","15px"],["object","legend.label","color",jt],["object","legend.label","fontFamily",zt],["object","legend.label","fontSize","13px"],["object","referenceLine.label.name","color",Ft],["object","referenceLine.label.name","fontFamily",zt],["object","referenceLine.label.name","fontSize","12px"],["object","referenceLine.outOfBounds","color",Ht],["object","referenceLine.outOfBounds","fontFamily",zt],["object","referenceLine.outOfBounds","fontSize","12px"],["object","referenceLine.outOfBounds","backgroundColor",Vt,function(e){return"transparent"===e?Vt:e}]])).reduce((function(e,n){var i="".concat(n[0],"-").concat(n[1],"-").concat(n[2],"}");return t[i]||(t[i]=!0,e.push(n)),e}),[]).sort((function(e,t){return(e[0].split?e[0].split(".").length:0)-(t[0].split?t[0].split(".").length:0)}))}var Wt=function(e){return e};function Ut(e){var t=e.theme,n=e.id,i=e.transform,r=e.extend,o=e.matrix,a={},s=i.reduce((function(e,t){var n=x(t,2),i=n[0],r=n[1];return e[i]=r,e}),{});return o.forEach((function(e){var i=x(e,5),r=i[0],o=i[1],l=i[2],c=i[3],u=i[4],h=void 0===u?function(e){return e}:u,d=function(e){var t=e.theme,n=e.base,i=e.path,r=e.attribute,o=e.defaultValue,a=void 0===o?void 0:o;if(!t||!1===n)return a;var s=t.getStyle(n,i,r);return void 0===s?a:s}({theme:t,base:"object"===r&&n?"".concat("object",".").concat(n):r,path:o,attribute:l,defaultValue:c}),f=(s["".concat(o,".").concat(l)]||Wt)(h(d));St(a,[o,l].filter(Boolean).join("."),f)})),r.forEach((function(e){var t=x(e,2),n=t[0],i=t[1];St(a,n,i)})),a}function Yt(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Gt,Xt={exports:{}};var Kt=(Gt||(Gt=1,self,Xt.exports=(()=>{var e={229:e=>{var t=Object.prototype.hasOwnProperty,n=Object.prototype.toString,i=Object.defineProperty,r=Object.getOwnPropertyDescriptor,o=function(e){return"function"==typeof Array.isArray?Array.isArray(e):"[object Array]"===n.call(e)},a=function(e){if(!e||"[object Object]"!==n.call(e))return!1;var i,r=t.call(e,"constructor"),o=e.constructor&&e.constructor.prototype&&t.call(e.constructor.prototype,"isPrototypeOf");if(e.constructor&&!r&&!o)return!1;for(i in e);return void 0===i||t.call(e,i)},s=function(e,t){i&&"__proto__"===t.name?i(e,t.name,{enumerable:!0,configurable:!0,value:t.newValue,writable:!0}):e[t.name]=t.newValue},l=function(e,n){if("__proto__"===n){if(!t.call(e,n))return;if(r)return r(e,n).value}return e[n]};e.exports=function e(){var t,n,i,r,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!=(t=arguments[d]))for(n in t)i=l(h,n),h!==(r=l(t,n))&&(p&&r&&(a(r)||(c=o(r)))?(c?(c=!1,u=i&&o(i)?i:[]):u=i&&a(i)?i:{},s(h,{name:n,newValue:e(p,u,r)})):void 0!==r&&s(h,{name:n,newValue:r}));return h}},645:(e,t)=>{(()=>{var e={229:e=>{var t=Object.prototype.hasOwnProperty,n=Object.prototype.toString,i=Object.defineProperty,r=Object.getOwnPropertyDescriptor,o=function(e){return"function"==typeof Array.isArray?Array.isArray(e):"[object Array]"===n.call(e)},a=function(e){if(!e||"[object Object]"!==n.call(e))return!1;var i,r=t.call(e,"constructor"),o=e.constructor&&e.constructor.prototype&&t.call(e.constructor.prototype,"isPrototypeOf");if(e.constructor&&!r&&!o)return!1;for(i in e);return void 0===i||t.call(e,i)},s=function(e,t){i&&"__proto__"===t.name?i(e,t.name,{enumerable:!0,configurable:!0,value:t.newValue,writable:!0}):e[t.name]=t.newValue},l=function(e,n){if("__proto__"===n){if(!t.call(e,n))return;if(r)return r(e,n).value}return e[n]};e.exports=function e(){var t,n,i,r,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!=(t=arguments[d]))for(n in t)i=l(h,n),h!==(r=l(t,n))&&(p&&r&&(a(r)||(c=o(r)))?(c?(c=!1,u=i&&o(i)?i:[]):u=i&&a(i)?i:{},s(h,{name:n,newValue:e(p,u,r)})):void 0!==r&&s(h,{name:n,newValue:r}));return h}}},n={};function i(t){var r=n[t];if(void 0!==r)return r.exports;var o=n[t]={exports:{}};return e[t](o,o.exports,i),o.exports}i.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return i.d(t,{a:t}),t},i.d=(e,t)=>{for(var n in t)i.o(t,n)&&!i.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},i.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),i.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var r={};(()=>{i.r(r),i.d(r,{default:()=>Ee});var e=i(229),t=i.n(e);const n=function(e,t,n){if(!t)return!1;var i,r=t.split("."),o=r[r.length-1],a=e;for(i=0;i<r.length-1;++i)void 0===a[r[i]]&&(a[r[i]]=Number.isNaN(+r[i+1])?{}:[]),a=a[r[i]];if(void 0!==n){var s=a[o];return a[o]=n,{updated:n,previous:s}}return delete a[o],!1},o=function(e,t,n){var i,r=t.split("."),o=e;if(void 0===o)return n;for(i=0;i<r.length;++i){if(void 0===o[r[i]])return n;o=o[r[i]]}return o},a={EXPRESSIONS:{observed:"",trend:"STL_Trend",seasonal:"STL_Seasonal",residual:"STL_Residual"},OPTIONS:[{value:"observed",translation:"cao.trendDecomposition.parameters.decomposition.observed"},{value:"trend",translation:"cao.trendDecomposition.parameters.decomposition.trend"},{value:"seasonal",translation:"cao.trendDecomposition.parameters.decomposition.seasonal"},{value:"residual",translation:"cao.trendDecomposition.parameters.decomposition.residual"}]};var s="".concat(" ","(").concat(" "),l="".concat(" ",")").concat(" ");function c(e){return s+e+l}function u(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(e.qLibraryId){var n=function(e,t){if(!t)return null;var n,i;for(n=0;n<t.length;n++)if((i=t[n]).qInfo.qId===e)return i;return null}(e.qLibraryId,t.dimensionList);return n&&n.qData.info[0].qTags.indexOf("$numeric")>-1}var i=function(e,t){if(!t)return null;var n,i,r=function(e){var t=e.trim();"="===t.charAt(0)&&(t=(t=t.substring(1)).trim());var n=t.length-1;return"["===t.charAt(0)&&"]"===t.charAt(n)&&(t=(t=t.substring(1,n)).trim()),t}(e);for(n=0;n<t.length;n++){if((i=t[n]).qName===r)return i;if(i.qDerivedFieldData)for(var o=0;o<i.qDerivedFieldData.qDerivedFieldLists.length;++o)for(var a=i.qDerivedFieldData.qDerivedFieldLists[o],s=0;s<a.qFieldDefs.length;++s){var l=a.qFieldDefs[s];if(l.qName===r)return l}}return null}(e.qDef.qFieldDefs[0],t.fieldList);return i&&i.qTags.indexOf("$numeric")>-1}function h(e){return!(!e.fullAccumulation&&!e.fullRange)}function d(e,t){var n=e.crossAllDimensions;return 2===t&&n?"RowNo(Total)":"RowNo()"}function f(e){var t=function(e){return e?(e=function(e){return e.replace(/\/\*[^]*?\*\//g,"")}(e=function(e){return e.replace(/\/\/(.*)$/gm,"")}(e))).trim():""}(e),n=t.trim();return"="===n.substring(0,1)?n.substring(1).trim():n}function p(){return"[$(=Replace(GetObjectField(".concat(arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,"),']',']]'))]")}function m(e,t){var n=e.crossAllDimensions;return 2===t&&n?"Above(Total ":"Above("}function g(e){return void 0===e?")":", 0, ".concat(e,")")}function y(e){return"Replace(Replace(".concat(e,",'''',''''''),'$','$''&''')")}function x(e,t){return e?"".concat(t,'={">=$(=Min(').concat(t,"))<=$(=Max(").concat(t,'))"}'):"".concat(t,'={"=Only({1}').concat(t,")>='$(=").concat(y("MinString(".concat(t,")")),")' and Only({1}").concat(t,")<='$(=").concat(y("MaxString(".concat(t,")")),")'\"}")}function v(e){var t=e.modifier,n=void 0===t?{}:t,i=e.dimensions,r=e.dimensionAndFieldList,o=e.funcComp,a=void 0===o?"Sum":o,s=e.valueComp,l=void 0===s?"0":s;if(!n.showExcludedValues)return"";if(i&&1===i.length){var c=x(u(i[0],r),p(0));return"".concat(a,"({1<").concat(c,">}").concat(l,")")}if(i&&2===i.length){var h=u(i[0],r),d=u(i[1],r),f=p(0),m=p(1),g=x(h,f),y=x(d,m);return"".concat(a,"({1<").concat(g,",").concat(y,">}").concat(l,")")}return"".concat(a,"({1}").concat(l,")")}function b(e){return"".concat(e,"(")}function w(e){var t=e.properties,n=e.layout;return o(t,"qHyperCubeDef.qDimensions",o(n,"qHyperCube.qDimensionInfo",[])).length}const M={isFullRange:h,getNumDimensions:w,getExpressionWithExcludedComp:function(e){var t=e.expression,n=e.modifier,i=e.dimensions,r=e.dimensionAndFieldList,o=e.treatMissingAsNull,a=c(f(t));if(!n.showExcludedValues)return a;var s=v({modifier:n,dimensions:i,dimensionAndFieldList:r}),l=o?"":", 0";if(i&&1===i.length){var u=p(0);return"If(Count(".concat(u,") > 0, ").concat(a," + ").concat(s).concat(l,")")}if(i&&2===i.length){var h=p(0),d=p(1);return"If(Count(".concat(h,") * Count(").concat(d,") > 0, ").concat(a," + ").concat(s).concat(l,")")}return a},getRowNoComp:d,getNumStepComp:function(e,t){if(!h(e)){var n=e.steps;return"number"!=typeof n||Number.isNaN(n)?6:n}return d(e,t)},getAboveCompPrefix:m,getAboveCompSuffix:g,getAboveComp:function(e,t,n,i){return m(e,t)+n+g(i)},getFunctionPrefix:b,getFunctionSuffix:function(){return")"},getRangeComp:function(e,t){return b(e)+t+")"},getAggrComp:function(e,t,n){return"Aggr(".concat(e,", ").concat(t,", ").concat(n,")")},getExcludedComp:v,needDimension:function(e){var t=e.modifier,n=e.properties,i=e.layout,r=function(e){return void 0===e.primaryDimension?e.accumulationDimension:e.primaryDimension}(t);return 0===r&&2===w({properties:n,layout:i})},getDimComp:function(e,t){var n=function(e){return e[arguments.length>1&&void 0!==arguments[1]?arguments[1]:0].qDef.qSortCriterias[0]}(e,t),i=p(t);if(!n.qSortByExpression&&!n.qSortByNumeric&&!n.qSortByAscii)return i;var r=["Descending","Ascending"],o=n.qSortByNumeric?"(Numeric, ".concat(r[(n.qSortByNumeric+1)/2],")"):"",a=n.qSortByAscii?"(Text, ".concat(r[(n.qSortByAscii+1)/2],")"):"";return n.qSortByNumeric&&n.qSortByAscii?"(".concat(i,", ").concat(o,", ").concat(a,")"):n.qSortByNumeric?"(".concat(i,", ").concat(o,")"):n.qSortByAscii?"(".concat(i,", ").concat(a,")"):i},simplifyExpression:f,extractInputExpression:function(e){var t=e.outputExpression;if(e.modifier){var n=t.indexOf(s);if(-1!==n){var i=t.indexOf(l);if(-1!==i)return t.substring(n+s.length,i)}}},initModifier:function(e,t){Object.keys(t).forEach((function(n){void 0===e[n]&&(e[n]=t[n])}))},isNumeric:u,isApplicable:function(e){var t=e.properties,n=e.layout,i=e.minDimensions,r=void 0===i?1:i,o=e.maxDimensions,a=void 0===o?2:o;if(!t&&!n)return!0;var s=w({properties:t,layout:n});return s>=r&&s<=a},getExpressionWithMarkers:c,canExtract:function(e){var t=e.indexOf(s),n=e.indexOf(l);return t>-1&&n>-1&&t<n},getDimDefWithWrapper:p,getFieldWithWrapper:function(e){var t=e?e.replace(/]/g,"]]"):e;return"[".concat(t,"]")},generateTSDExpression:function(e,t,n){var i=t||e.outputExpression;if(e.base&&e.base.qDef&&(i=t!==e.base.qDef?t:e.base.qDef),"observed"!==e.decomposition){var r=n.qHyperCubeDef.qMeasures.find((function(t){return t.qDef.base&&t.qDef.base.qLibraryId&&e.base&&e.base.qLibraryId?t.qDef.base.qLibraryId===e.base.qLibraryId:null}));r&&t!==r.qDef.qLabel&&(i=r.qLibraryId||r.qDef.base.qLibraryId?"[".concat(r.qDef.qLabel,"]"):r.qDef.base.qDef);var o=function(e){var t=a.OPTIONS.find((function(t){return t.value===e.decomposition}));return t?a.EXPRESSIONS[t.value]:""}(e);i=i.startsWith("=")?i.substr(1):i,i="".concat(o,"(").concat(i,", ").concat(e.steps,")")}return i},getDecomposition:function(e){var t="observed";return Object.values(a.EXPRESSIONS).find((function(n){var i=e.qDef.base.qDef.toLowerCase()||e.qDef.qDef.toLowerCase();return a.EXPRESSIONS[n]&&i.includes(a.EXPRESSIONS[n].toLowerCase())&&(t=n),n})),t}};function k(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,i=new Array(t);n<t;n++)i[n]=e[n];return i}function S(e){return S="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},S(e)}var _=t().bind(null,!0),q={},D=Array.isArray;function A(e){return null!=e&&!Array.isArray(e)&&"object"===S(e)}function C(e){return void 0===e}function N(e,t){return"function"==typeof e[t]||"$$"===t.substring(0,2)||"_"===t.substring(0,1)}function E(e,t){var n,i=t.substring(1).split("/").slice(0,-1);return i.forEach((function(t,r){if(r!==i.length){n=+t;var o=Number.isNaN(n)?{}:[];e[n||t]=C(e[n||t])?o:e[t],e=e[n||t]}})),e}function R(e,t){var n=!0;if(A(e)&&A(t))return Object.keys(e).length===Object.keys(t).length&&(Object.keys(e).forEach((function(i){R(e[i],t[i])||(n=!1)})),n);if(D(e)&&D(t)){if(e.length!==t.length)return!1;for(var i=0,r=e.length;i<r;i+=1)if(!R(e[i],t[i]))return!1;return!0}return e===t}q.generate=function(e,t,n){n=n||"";var i=[];return Object.keys(t).forEach((function(r){var o=function(e){return e?_({},{val:e}).val:e}(t[r]),a=e[r],s="".concat(n,"/").concat(r);R(o,a)||N(t,r)||(C(a)?i.push({op:"add",path:s,value:o}):A(o)&&A(a)?i=i.concat(q.generate(a,o,s)):D(o)&&D(a)?i=i.concat(function(e,t,n){var i=[],r=e.slice(),o=-1;function a(e,t,n){if(e[n]&&C(e[n].qInfo))return null;if(e[n]&&e[n].qInfo.qId===t)return n;for(var i=0,r=e.length;i<r;i+=1)if(e[i]&&e[i].qInfo.qId===t)return i;return-1}if(R(t,r))return i;if(!C(t[0])&&C(t[0].qInfo))return i.push({op:"replace",path:n,value:t}),i;for(var s=r.length-1;s>=0;s-=1)-1===(o=a(t,r[s].qInfo&&r[s].qInfo.qId,s))?(i.push({op:"remove",path:"".concat(n,"/").concat(s)}),r.splice(s,1)):i=i.concat(q.generate(r[s],t[o],"".concat(n,"/").concat(s)));for(var l=0,c=t.length;l<c;l+=1)-1===(o=a(r,t[l].qInfo&&t[l].qInfo.qId))?(i.push({op:"add",path:"".concat(n,"/").concat(l),value:t[l]}),r.splice(l,0,t[l])):o!==l&&(i.push({op:"move",path:"".concat(n,"/").concat(l),from:"".concat(n,"/").concat(o)}),r.splice(l,0,r.splice(o,1)[0]));return i}(a,o,s)):i.push({op:"replace",path:"".concat(n,"/").concat(r),value:o}))})),Object.keys(e).forEach((function(r){C(t[r])&&!N(e,r)&&i.push({op:"remove",path:"".concat(n,"/").concat(r)})})),i},q.apply=function(e,t){t.forEach((function(t){var n,i,r=E(e,t.path),o=t.path.split("/").splice(-1)[0],a=o&&Number.isNaN(+o)?r[o]:r[+o]||r,s=t.from?t.from.split("/").splice(-1)[0]:null;if("/"===t.path&&(r=null,a=e),"add"===t.op||"replace"===t.op)if(D(r))"-"===o&&(o=r.length),r.splice(+o,"add"===t.op?0:1,t.value);else if(D(a)&&D(t.value)){var l,c=t.value.slice();a.length=0,(l=a).push.apply(l,function(e){if(Array.isArray(e))return k(e)}(i=c)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(i)||function(e,t){if(e){if("string"==typeof e)return k(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?k(e,t):void 0}}(i)||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.")}())}else if(A(a)&&A(t.value))n=a,Object.keys(n).forEach((function(e){Object.getOwnPropertyDescriptor(n,e).configurable&&!N(n,e)&&delete n[e]})),_(a,t.value);else{if(!r)throw new Error("Patchee is not an object we can patch");r[o]=t.value}else if("move"===t.op){var u=E(e,t.from);D(r)?r.splice(+o,0,u.splice(+s,1)[0]):(r[o]=u[s],delete u[s])}else"remove"===t.op&&(D(r)?r.splice(+o,1):delete r[o])}))},q.clone=function(e){return _({},e)},q.createPatch=function(e,t,n){var i={op:e.toLowerCase(),path:n};return"move"===i.op?i.from=t:void 0!==t&&(i.value=t),i},q.updateObject=function(e,t){Object.keys(e).length?q.apply(e,q.generate(e,t)):_(e,t)};const I=q,O=function(e,n,i){if(!e)return Promise.resolve();var r=I.generate(n,i);return t()(!0,n,i),r&&r.length?(r=r.map((function(e){return{qOp:e.op,qValue:JSON.stringify(e.value),qPath:e.path}})),e.applyPatches(r,!0)):Promise.resolve()};var P="accumulation";function L(e,t){var n=o(e,t);if(n)for(var i=0;i<n.length;i++)if(n[i].type===P)return n[i]}function T(e,t){var n=function(e,t){var n=o(e,t);if(!n)return-1;for(var i=0;i<n.length;i++)if(n[i].type===P)return i;return-1}(e,t);return n>-1?"".concat(t,".").concat(n):t}var z={type:"accumulation",disabled:!1,accumulationDimension:0,crossAllDimensions:!1,showExcludedValues:!0,fullAccumulation:!1,steps:6,outputExpression:""};const F={translationKey:"properties.modifier.accumulation",needDimension:M.needDimension,isApplicable:function(e){var t=e.properties,n=e.layout;return M.isApplicable({properties:t,layout:n,minDimensions:1,maxDimensions:2})},generateExpression:function(e){var t=e.expression,n=e.modifier,i=e.properties,r=e.layout,a=e.numDimensions,s=e.dimensionAndFieldList;if(!n)return t;var l=a;void 0===l&&(l=M.getNumDimensions({properties:i,layout:r}));var c=o(i,"qHyperCubeDef.qDimensions",[]),u=M.getExpressionWithExcludedComp({expression:t,modifier:n,dimensions:c,dimensionAndFieldList:s}),h=M.getNumStepComp(n,l),d=M.getAboveComp(n,l,u,h),f=M.getRangeComp("RangeSum",d);if(M.needDimension({modifier:n,properties:i,layout:r})){var p=M.getDimComp(c,1),m=M.getDimComp(c,0),g=M.getAggrComp(f,p,m);f=n.showExcludedValues?M.getExcludedComp({modifier:n,dimensions:c,dimensionAndFieldList:s,valueComp:g}):g}return f},extractInputExpression:M.extractInputExpression,initModifier:function(e){M.initModifier(e,z)},enableTotalsFunction:function(){return!1},propertyPanelDef:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n={type:"items",items:{disclaimer:{component:"text",translation:t.disclaimer||"properties.modifier.accumulation.disclaimer",show:function(e,t){return!M.isApplicable({properties:t.properties})}},settings:{type:"items",items:{primaryDimension:{refFn:function(t){return"".concat(T(t,e),".accumulationDimension")},type:"integer",translation:t.primaryDimension||"properties.modifier.primaryDimension",title:{translation:t.primaryDimensionTooltip||"properties.modifier.accumulation.primaryDimension.tooltip"},component:"dropdown",schemaIgnore:!0,defaultValue:1,options:function(e,t){return t.layout.qHyperCube.qDimensionInfo.map((function(e,t){return{value:t,label:e.qGroupFallbackTitles[0]}}))},show:function(e,t){return t.layout.qHyperCube.qDimensionInfo.length>1}},crossAllDimensions:{refFn:function(t){return"".concat(T(t,e),".crossAllDimensions")},type:"boolean",translation:t.crossAllDimensions||"properties.modifier.crossAllDimensions",title:{translation:t.crossAllDimensionsTooltip||"properties.modifier.accumulation.crossAllDimensions.tooltip"},schemaIgnore:!0,defaultValue:!1,show:function(e,t){return t.layout.qHyperCube.qDimensionInfo.length>1}},fullRange:{refFn:function(t){return"".concat(T(t,e),".fullAccumulation")},type:"boolean",translation:t.range||"properties.modifier.range",component:"dropdown",schemaIgnore:!0,defaultValue:!1,options:[{value:!0,translation:t.rangeFull||"properties.modifier.range.full"},{value:!1,translation:t.rangeCustom||"properties.modifier.range.custom"}]},steps:{refFn:function(t){return"".concat(T(t,e),".steps")},type:"integer",translation:t.rangeSteps||"properties.modifier.range.steps",schemaIgnore:!0,defaultValue:6,change:function(t){var n=L(t,e);if(n){var i=n.steps;n.steps="number"!=typeof i||Number.isNaN(i)?6:Math.abs(i)}},show:function(t){var n=L(t,e);return n&&!n.fullAccumulation}},showExcludedValues:{refFn:function(t){return"".concat(T(t,e),".showExcludedValues")},type:"boolean",translation:t.showExcludedValues||"properties.modifier.showExcludedValues",schemaIgnore:!0,defaultValue:!0}},show:function(e,t){return M.isApplicable({properties:t.properties})}}},show:function(t,n,i){var r=i.ext.support.modifiers;if(!Array.isArray(r)||-1===r.indexOf(P))return!1;var o=L(t,e);return o&&!o.disabled}};return n}};var j="movingAverage";function V(e,t){var n=o(e,t);if(n)for(var i=0;i<n.length;i++)if(n[i].type===j)return n[i]}function B(e,t){var n=function(e,t){var n=o(e,t);if(!n)return-1;for(var i=0;i<n.length;i++)if(n[i].type===j)return i;return-1}(e,t);return n>-1?"".concat(t,".").concat(n):t}var H={type:"movingAverage",disabled:!1,primaryDimension:0,crossAllDimensions:!1,showExcludedValues:!0,fullRange:!1,steps:6,outputExpression:"",nullSuppression:!1};const $={translationKey:"properties.modifier.movingAverage",needDimension:M.needDimension,isApplicable:function(e){var t=e.properties,n=e.layout;return M.isApplicable({properties:t,layout:n,minDimensions:1,maxDimensions:2})},generateExpression:function(e){var t,n=e.expression,i=e.modifier,r=e.properties,a=e.layout,s=e.numDimensions,l=e.dimensionAndFieldList;if(!i)return n;var c=s;void 0===c&&(c=M.getNumDimensions({properties:r,layout:a}));var u=o(r,"qHyperCubeDef.qDimensions",[]),h=i.showExcludedValues&&i.nullSuppression,d=M.getExpressionWithExcludedComp({expression:n,modifier:i,dimensions:u,dimensionAndFieldList:l,treatMissingAsNull:h}),f=M.getNumStepComp(i,c),p=M.getAboveComp(i,c,d,f);if(i.nullSuppression)t=M.getRangeComp("RangeAvg",p);else{var m=M.getRangeComp("RangeSum",p),g=function(e,t){var n=M.getRowNoComp(e,t);if(!M.isFullRange(e)){var i=e.steps,r="number"!=typeof i||Number.isNaN(i)?6:i;return"RangeMin(".concat(r,", ").concat(n,")")}return n}(i,c);t="".concat(m," / ").concat(g)}var y=t;if(M.needDimension({modifier:i,properties:r,layout:a})){var x=M.getDimComp(u,1),v=M.getDimComp(u,0),b=M.getAggrComp(y,x,v);y=i.showExcludedValues?M.getExcludedComp({modifier:i,dimensions:u,dimensionAndFieldList:l,funcComp:"Only",valueComp:b}):b}return y},extractInputExpression:M.extractInputExpression,initModifier:function(e){M.initModifier(e,H)},enableTotalsFunction:function(){return!1},propertyPanelDef:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n={type:"items",items:{disclaimer:{component:"text",translation:t.disclaimer||"properties.modifier.movingAverage.disclaimer",show:function(e,t){return!M.isApplicable({properties:t.properties})}},settings:{type:"items",items:{primaryDimension:{refFn:function(t){return"".concat(B(t,e),".primaryDimension")},type:"integer",translation:t.primaryDimension||"properties.modifier.primaryDimension",title:{translation:t.primaryDimensionTooltip||"properties.modifier.movingAverage.primaryDimension.tooltip"},component:"dropdown",schemaIgnore:!0,defaultValue:1,options:function(e,t){return t.layout.qHyperCube.qDimensionInfo.map((function(e,t){return{value:t,label:e.qGroupFallbackTitles[0]}}))},show:function(e,t){return t.layout.qHyperCube.qDimensionInfo.length>1}},crossAllDimensions:{refFn:function(t){return"".concat(B(t,e),".crossAllDimensions")},type:"boolean",translation:t.crossAllDimensions||"properties.modifier.crossAllDimensions",title:{translation:t.crossAllDimensionsTooltip||"properties.modifier.movingAverage.crossAllDimensions.tooltip"},schemaIgnore:!0,defaultValue:!1,show:function(e,t){return t.layout.qHyperCube.qDimensionInfo.length>1}},fullRange:{refFn:function(t){return"".concat(B(t,e),".fullRange")},type:"boolean",translation:t.range||"properties.modifier.range",component:"dropdown",schemaIgnore:!0,defaultValue:!1,options:[{value:!0,translation:t.rangeFull||"properties.modifier.range.full"},{value:!1,translation:t.rangeCustom||"properties.modifier.range.custom"}]},steps:{refFn:function(t){return"".concat(B(t,e),".steps")},type:"integer",translation:t.rangeSteps||"properties.modifier.range.steps",schemaIgnore:!0,defaultValue:6,change:function(t){var n=V(t,e);if(n){var i=n.steps;n.steps="number"!=typeof i||Number.isNaN(i)?6:Math.abs(i)}},show:function(t){var n=V(t,e);return n&&!n.fullRange}},showExcludedValues:{refFn:function(t){return"".concat(B(t,e),".showExcludedValues")},type:"boolean",translation:t.showExcludedValues||"properties.modifier.showExcludedValues",schemaIgnore:!0,defaultValue:!0},nullSuppression:{refFn:function(t){return"".concat(B(t,e),".nullSuppression")},type:"boolean",translation:t.showNull||"properties.dimensions.showNull",schemaIgnore:!0,defaultValue:!1,inverted:!0}},show:function(e,t){return M.isApplicable({properties:t.properties})}}},show:function(t,n,i){var r=i.ext.support.modifiers;if(!Array.isArray(r)||-1===r.indexOf(j))return!1;var o=V(t,e);return o&&!o.disabled}};return n}};var W="timeSeriesDecomposition";function U(e,t){var n=o(e,t);if(n)for(var i=0;i<n.length;i++)if(n[i].type===W)return n[i]}function Y(e,t){var n=function(e,t){var n=o(e,t);if(!n)return-1;for(var i=0;i<n.length;i++)if(n[i].type===W)return i;return-1}(e,t);return n>-1?"".concat(t,".").concat(n):t}var G={type:"timeSeriesDecomposition",disabled:!1,decomposition:"",steps:2,outputExpression:""};const X={translationKey:"properties.modifier.timeSeriesDecomposition",needDimension:M.needDimension,isApplicable:function(e){var t=e.properties,n=e.layout;return M.isApplicable({properties:t,layout:n,minDimensions:1,maxDimensions:2})},generateExpression:function(e){var t=e.expression,n=e.modifier,i=e.properties;return n?M.generateTSDExpression(n,t,i):t},extractInputExpression:M.extractInputExpression,initModifier:function(e,t){M.initModifier(e,G),""===e.decomposition&&t&&(e.decomposition=M.getDecomposition(t))},propertyPanelDef:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n={type:"items",items:{disclaimer:{component:"text",translation:t.timeSeriesDecomposition||"properties.modifier.timeSeriesDecomposition",show:function(e,t){return!M.isApplicable({properties:t.properties})}},settings:{type:"items",items:{decomposition:{refFn:function(t){return"".concat(Y(t,e),".decomposition")},type:"string",translation:t.modifierTrendDecompositionDecomposition||"properties.modifier.trendDecomposition.decomposition",component:"dropdown",schemaIgnore:!0,defaultValue:t.trendDecompositionParametersDecompositionObserved||"cao.trendDecomposition.parameters.decomposition.observed",options:a.OPTIONS},steps:{refFn:function(t){return"".concat(Y(t,e),".steps")},type:"integer",translation:t.modifierTimeSeriesDecompositionPeriods||"properties.modifier.timeSeriesDecomposition.periods",schemaIgnore:!0,defaultValue:2,change:function(t,n){var i=U(t,e);if(i){var r=i.steps;i.steps="number"!=typeof r||Number.isNaN(r)?2:Math.abs(r),n.properties.qHyperCubeDef.qMeasures=n.properties.qHyperCubeDef.qMeasures.map((function(e){return e.qDef.modifiers.map((function(e){return"timeSeriesDecomposition"===e.type?e.steps=r:e.steps=e.steps,e})),e}))}},show:function(t){var n=U(t,e);return n&&!n.fullRange}}},show:function(e,t){return M.isApplicable({properties:t.properties})}}},show:function(t,n,i){var r=i.ext.support.modifiers;if(!Array.isArray(r)||-1===r.indexOf(W))return!1;var o=U(t,e);return o&&!o.disabled}};return n}};var K="difference";function Z(e,t){var n=o(e,t);if(n)for(var i=0;i<n.length;i++)if(n[i].type===K)return n[i]}function J(e,t){var n=function(e,t){var n=o(e,t);if(!n)return-1;for(var i=0;i<n.length;i++)if(n[i].type===K)return i;return-1}(e,t);return n>-1?"".concat(t,".").concat(n):t}var Q={type:"difference",disabled:!1,primaryDimension:0,crossAllDimensions:!1,showExcludedValues:!0,outputExpression:""};const ee={translationKey:"properties.modifier.difference",needDimension:M.needDimension,isApplicable:function(e){var t=e.properties,n=e.layout;return M.isApplicable({properties:t,layout:n,minDimensions:1,maxDimensions:2})},extractInputExpression:M.extractInputExpression,generateExpression:function(e){var t=e.expression,n=e.modifier,i=e.properties,r=e.layout,a=e.numDimensions,s=e.dimensionAndFieldList;if(!n)return t;var l=a;void 0===l&&(l=M.getNumDimensions({properties:i,layout:r}));var c=o(i,"qHyperCubeDef.qDimensions",[]),u=M.getExpressionWithExcludedComp({expression:t,modifier:n,dimensions:c,dimensionAndFieldList:s}),h=M.getAboveComp(n,l,u),d="".concat(u," - ").concat(h);if(M.needDimension({modifier:n,properties:i,layout:r})){var f=M.getDimComp(c,1),p=M.getDimComp(c,0),m=M.getAggrComp(d,f,p);d=n.showExcludedValues?M.getExcludedComp({modifier:n,dimensions:c,dimensionAndFieldList:s,funcComp:"Only",valueComp:m}):m}return d},initModifier:function(e){Object.keys(Q).forEach((function(t){void 0===e[t]&&(e[t]=Q[t])}))},enableTotalsFunction:function(){return!1},propertyPanelDef:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n={type:"items",items:{disclaimer:{component:"text",translation:t.disclaimer||"properties.modifier.difference.disclaimer",show:function(e,t){return!M.isApplicable({properties:t.properties})}},settings:{type:"items",items:{primaryDimension:{refFn:function(t){return"".concat(J(t,e),".primaryDimension")},type:"integer",translation:t.primaryDimension||"properties.modifier.primaryDimension",title:{translation:t.primaryDimensionTooltip||"properties.modifier.difference.primaryDimension.tooltip"},component:"dropdown",schemaIgnore:!0,defaultValue:1,options:function(e,t){return t.layout.qHyperCube.qDimensionInfo.map((function(e,t){return{value:t,label:e.qGroupFallbackTitles[0]}}))},show:function(e,t){return t.layout.qHyperCube.qDimensionInfo.length>1}},crossAllDimensions:{refFn:function(t){return"".concat(J(t,e),".crossAllDimensions")},type:"boolean",translation:t.crossAllDimensions||"properties.modifier.crossAllDimensions",title:{translation:t.crossAllDimensionsTooltip||"properties.modifier.difference.crossAllDimensions.tooltip"},schemaIgnore:!0,defaultValue:!1,show:function(e,t){return t.layout.qHyperCube.qDimensionInfo.length>1}},showExcludedValues:{refFn:function(t){return"".concat(J(t,e),".showExcludedValues")},type:"boolean",translation:t.showExcludedValues||"properties.modifier.showExcludedValues",schemaIgnore:!0,defaultValue:!0}},show:function(e,t){return M.isApplicable({properties:t.properties})}}},show:function(t,n,i){var r=i.ext.support.modifiers;if(!Array.isArray(r)||-1===r.indexOf(K))return!1;var o=Z(t,e);return o&&!o.disabled}};return n}};var te="normalization";function ne(e,t){var n=o(e,t);if(n)for(var i=0;i<n.length;i++)if(n[i].type===te)return n[i]}function ie(e,t){var n=function(e,t){var n=o(e,t);if(!n)return-1;for(var i=0;i<n.length;i++)if(n[i].type===te)return i;return-1}(e,t);return n>-1?"".concat(t,".").concat(n):t}function re(e,t){for(var n=0;n<e.length;n++)if(e[n].value===t)return n;return-1}var oe={type:"normalization",disabled:!1,primaryDimension:0,outputExpression:"",dimensionalScope:2,selectionScope:2};function ae(e){return 2===e?"{1}":""}function se(e,t,n){return 1===e?"{$<".concat(M.getFieldWithWrapper(t),"={'").concat(n,"'}>}"):""}function le(e,t){return 0===e&&t>1||2===e?"Total":""}function ce(e,t,n){return 0===e&&t>1?"<".concat(M.getDimDefWithWrapper(n),">"):""}const ue={translationKey:"properties.modifier.normalization",needDimension:function(){return!0},isApplicable:function(e){var t=e.properties,n=e.layout;return M.isApplicable({properties:t,layout:n,minDimensions:1,maxDimensions:2})},extractInputExpression:M.extractInputExpression,generateExpression:function(e){var t=e.expression,n=e.modifier,i=e.properties,r=e.layout,a=e.numDimensions,s=e.dimensionAndFieldList;if(!n)return t;var l=a;void 0===l&&(l=M.getNumDimensions({properties:i,layout:r}));var c=o(i,"qHyperCubeDef.qDimensions",[]),u=M.getExpressionWithExcludedComp({expression:t,modifier:n,dimensions:c,dimensionAndFieldList:s}),h=n.selectionScope,d=n.dimensionalScope;return function(e,t,n,i,r,o,a){var s=ae(t),l=se(t,n,i),c=""===s&&""===l?"":s||l,u=le(r,o),h=ce(r,o,a),d=function(e){for(var t=[],n=0;n<e;n++)t[n]=M.getDimDefWithWrapper(n);return t.join(", ")}(o);return"".concat(e,"/ Sum(").concat(c," ").concat(u).concat(h," Aggr(").concat(c," ").concat(e,", ").concat(d,"))")}(u,h,n.field,n.value,d,l,n.primaryDimension)},initModifier:function(e){Object.keys(oe).forEach((function(t){void 0===e[t]&&(e[t]=oe[t])}))},updateModifier:function(e,t){1===(t.qDimensions?t.qDimensions.length:0)&&0===e.dimensionalScope&&(e.dimensionalScope=2)},enableTotalsFunction:function(){return!0},propertyPanelDef:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n={type:"items",items:{disclaimer:{component:"text",translation:t.disclaimer||"properties.modifier.normalization.disclaimer",show:function(e,t){return!M.isApplicable({properties:t.properties})}},settings:{type:"items",items:{selectionScope:{refFn:function(t){return"".concat(ie(t,e),".selectionScope")},type:"string",translation:t.modifierSelectionScope||"properties.modifier.selectionScope",title:{translation:t.modifierSelectionScopeTooltip||"properties.modifier.selectionScope.tooltip"},component:"dropdown",schemaIgnore:!0,defaultValue:2,options:function(n){return function(e,t,n){var i=[{value:0,translation:t.selectionScopeCurrentSelection||"properties.modifier.selectionScope.currentSelection"},{value:1,translation:t.selectionScopeSpecificValue||"properties.modifier.selectionScope.selectAField"},{value:2,translation:t.selectionScopeTotal||"properties.modifier.selectionScope.total"}];return i=function(e,t){if(1===e){var n=re(t,0);t.splice(n,1)}return t}(ne(e,n).dimensionalScope,i),i}(n,t,e)}},field:{refFn:function(t){return"".concat(ie(t,e),".field")},type:"string",component:"expression-with-dropdown",translation:"Common.Field",defaultValue:"",dropdownOnly:!0,options:function(e,t,n){return n.app.getFieldList().then((function(e){return e.map((function(e){return{label:e.qName,value:e.qName}}))}))},show:function(t){return 1===ne(t,e).selectionScope}},value:{refFn:function(t){return"".concat(ie(t,e),".value")},type:"string",ref:"value",component:"string",translation:"properties.value",expression:"optional",show:function(t){return 1===ne(t,e).selectionScope}},dimensionalScope:{refFn:function(t){return"".concat(ie(t,e),".dimensionalScope")},type:"string",translation:t.modifierDimensionalScope||"properties.modifier.dimensionalScope",title:{translation:t.modifierDimensionalScopeTooltip||"properties.modifier.dimensionalScope.tooltip"},component:"dropdown",schemaIgnore:!0,defaultValue:2,supportTooltip:!0,options:function(n,i){return function(e,t,n,i){var r=t.layout.qHyperCube.qDimensionInfo.length,o=[{value:0,translation:n.dimensionalScopeOneDimension||"properties.modifier.dimensionalScope.respectOneDimension",tooltipTranslation:n.dimensionalScopeOneDimensionTooltip||"properties.modifier.dimensionalScope.respectOneDimension.tooltip"},{value:1,translation:n.dimensionalScopeAllDimensions||"properties.modifier.dimensionalScope.".concat(2===r?"respectAllDimensions":"respectDimension"),tooltipTranslation:n.dimensionalScopeAllDimensionsTooltip||"properties.modifier.dimensionalScope.".concat(2===r?"respectAllDimensions":"respectDimension",".tooltip")},{value:2,translation:n.dimensionalScopeDisregardAllDimensions||"properties.modifier.dimensionalScope.".concat(2===r?"disregardAllDimensions":"disregardDimension"),tooltipTranslation:n.dimensionalScopeDisregardAllDimensionsTooltip||"properties.modifier.dimensionalScope.".concat(2===r?"disregardAllDimensions":"disregardDimension",".tooltip")}];return o=function(e,t){if(e<2){var n=re(t,0);t.splice(n,1)}return t}(r,o),o=function(e,t){if(0===e){var n=re(t,1);t.splice(n,1)}return t}(ne(e,i).selectionScope,o),o}(n,i,t,e)}},primaryDimension:{refFn:function(t){return"".concat(ie(t,e),".primaryDimension")},type:"integer",translation:t.primaryDimension||"properties.modifier.primaryDimension",title:{translation:t.primaryDimensionTooltip||"properties.modifier.normalization.primaryDimension.tooltip"},component:"dropdown",schemaIgnore:!0,defaultValue:1,options:function(e,t){return t.layout.qHyperCube.qDimensionInfo.map((function(e,t){return{value:t,label:e.qGroupFallbackTitles[0]}}))},show:function(t,n){return 0===(ne(t,e).dimensionalScope||0)&&n.layout.qHyperCube.qDimensionInfo.length>1}}},show:function(e,t){return M.isApplicable({properties:t.properties})}}},show:function(t,n,i){var r=i.ext.support.modifiers;if(!Array.isArray(r)||-1===r.indexOf(te))return!1;var o=ne(t,e);return o&&!o.disabled}};return n},getDisregardSelectionComp:ae,getFieldSelectionComp:se,getTotalComp:le,getSelectedDimComp:ce};var he="qDef.base",de="qDef.qDef",fe="qDef.base.qDef",pe="qLibraryId",me="qDef.base.qLibraryId";const ge={getExpression:function(e){var t=o(e,fe);return void 0!==t?t:o(e,de)},getExpressionRef:function(e){return void 0!==o(e,fe)?fe:de},getLibraryIdRef:function(e){return o(e,me)?me:pe},getLibraryId:function(e){return o(e,me)||o(e,pe)},getLabelRef:function(e){return o(e,he)?"qDef.base.qLabel":"qDef.qLabel"},getLabelExpressionRef:function(e){return o(e,he)?"qDef.base.qLabelExpression":"qDef.qLabelExpression"}};var ye="qDef.qDef",xe="qDef.base.qDef",ve="qLibraryId",be="qDef.base.qLibraryId",we="qDef.qLabel",Me="qDef.qLabelExpression",ke="qDef.base.qLabel",Se="qDef.base.qLabelExpression",_e="qDef.qAggrFunc",qe="qDef.base.qAggrFunc",De={initBase:function(e,t){(t||De.isValid(e))&&(n(e,xe,o(e,ye)),n(e,be,o(e,ve)),n(e,ke,o(e,we)),n(e,Se,o(e,Me)))},restoreBase:function(e){De.isValid(e)&&(n(e,ye,o(e,xe)),n(e,ve,o(e,be)),n(e,we,o(e,ke)),n(e,Me,o(e,Se)),o(e,_e)&&o(e,qe)&&n(e,_e,o(e,qe)),delete e.qDef.base)},isValid:function(e){var t=o(e,xe),n=o(e,be);return void 0!==t||void 0!==n}};const Ae=De;function Ce(e){return Ce="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Ce(e)}var Ne={accumulation:F,movingAverage:$,difference:ee,normalization:ue,timeSeriesDecomposition:X};const Ee={modifiers:Ne,apply:Ie,applyModifiers:Oe,cleanUpMeasure:Pe,destroy:function(e){e&&Re[e.id]&&Re[e.id].masterItemSubscriber&&(Re[e.id].masterItemSubscriber&&Re[e.id].masterItemSubscriber.unsubscribe(),delete Re[e.id])},hasActiveModifiers:Le,getActiveModifier:Te,initBase:Ae.initBase,isSupportedModifiers:function(e){return Array.isArray(e)&&e.some((function(e){return Ne[e]}))},isApplicableSupportedModifiers:function(e){var t=e.modifierTypes,n=e.properties,i=e.layout;return Array.isArray(t)&&t.some((function(e){return Ne[e]&&Ne[e].isApplicable({properties:n,layout:i})}))},measureBase:ge,limitedSorting:function(e){var t=e.measures,n=e.properties,i=e.layout,r=!1,o=!1;return t.forEach((function(e){var t=je(e);Ye({modifiers:t,properties:n,layout:i})&&(r=!0,o=o||Je({modifiers:t,properties:n,layout:i}))})),r&&!o},ifEnableTotalsFunction:ze};var Re={};function Ie(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=e.model,i=e.properties,r=e.isSnapshot,a=void 0!==r&&r,s=e.masterItem,l=!1;Re[n.id]=Re[n.id]||{isFirstTime:!0};var c=Re[n.id].isFirstTime;if(Re[n.id].isFirstTime=!1,i&&"object"===Ce(i))return Oe({model:n,properties:i});var u=n?n.layout:void 0,h=o(u,"qSelectionInfo.qInSelections");if(a||h)return Promise.resolve(l);var d=o(u,"qHyperCube.qMeasureInfo"),f=Re[n.id].lastReloadTime;if(Re[n.id].lastReloadTime=o(n,"app.layout.qLastReloadTime"),Le({measures:d,layout:u})){var p=function(e){var t=e.measures,n=e.layout,i=e.lastReloadTime;return o(e.model,"app.layout.qLastReloadTime")!==i&&function(e){var t=e.measures,n=e.properties,i=e.layout;return!!Array.isArray(t)&&t.some((function(e){return Ue({measure:e,properties:n,layout:i})}))}({measures:t,layout:n})}({measures:d,layout:u,model:n,lastReloadTime:f});return p||function(e){var t=e.measures,n=e.layout,i=e.masterItem,r=e.isFirstTime;return!!Array.isArray(t)&&(r||i||t.some((function(e){return function(e){var t=e.measure,n=e.layout;return Ye({modifiers:je(t),layout:n})?!t.base:!!t.base}({measure:e,layout:n})})))}({measures:d,layout:u,masterItem:s,isFirstTime:c})?n.getEffectiveProperties().then((function(e){var i=t()(!0,{},e);Be(i);var r=Qe(i);return Ge({model:n}).then((function(t){return Xe({libraryIds:r,model:n}).then((function(r){return p&&function(e){var t=e.properties;Fe(t).forEach((function(e){return function(e){var t=e.measure;if(Ue({measure:t,properties:e.properties})){var n=0,i=t.qDef.modifiers;Array.isArray(i)&&i.forEach((function(e){if("object"===Ce(e)&&!e.disabled){if(n++,"object"!==Ce(Ne[e.type]))throw new Error('Modifier "'.concat(e.type,'" is not available'));if(n>1)throw new Error("More than 1 modifier on a measure! (not yet supported)");var i=Ne[e.type].extractInputExpression({outputExpression:t.qDef.qDef,modifier:e});void 0!==i&&$e(t)&&M.simplifyExpression(t.qDef.base.qDef)!==M.simplifyExpression(i)&&(t.qDef.base.qDef=i)}}))}}({measure:e,properties:t})}))}({properties:i}),Oe({model:n,oldProperties:e,properties:i,runUpdateIfChange:!0,masterItem:s,libraryItemsProps:r,dimensionAndFieldList:t})}))}))})):Promise.resolve(l)}return function(e){return!!Array.isArray(e)&&e.some((function(e){return"object"===Ce(e.base)}))}(d)?n.getEffectiveProperties().then((function(e){return function(e){var n=e.model,i=e.properties,r=Qe(i);return et({model:n,libraryIds:r}).then((function(){var e=t()(!0,{},i);return Fe(i).forEach((function(e){return Pe(e)})),Ze({oldProperties:e,newProperties:i,model:n})}))}({model:n,properties:e})})):Promise.resolve(l)}function Oe(e){var n=e.model,i=e.oldProperties,r=e.properties,a=e.measures,s=e.runUpdateIfChange,l=void 0!==s&&s,c=e.masterItem,u=e.libraryItemsProps,h=e.dimensionAndFieldList;void 0===i&&(i=l?t()(!0,{},r):r),Be(r);var d=Qe(r);return et({model:n,libraryIds:d,masterItem:c}).then((function(){return function(e){var n=e.measures,i=e.properties,r=e.model,a=e.libraryItemsProps,s=e.dimensionAndFieldList;if(n||(n=Fe(i)),!n.length)return Promise.resolve();if(!Le({measures:n,properties:i}))return n.forEach((function(e){return Pe(e)})),Promise.resolve();var l=a?void 0:Qe(i);return Ge({model:r,dimensionAndFieldList:s}).then((function(e){return Xe({libraryIds:l,model:r,libraryItemsProps:a}).then((function(r){n.forEach((function(n){Ye({modifiers:n.qDef.modifiers,properties:i})?(function(e){var n=e.measure,i=e.properties,r=e.libraryItemsProps,a=e.dimensionAndFieldList,s=0;Ae.isValid(n)||Ae.initBase(n,!0);var l=n.qDef,c=l.modifiers,u=l.base;Array.isArray(c)&&c.forEach((function(e){if("object"===Ce(e)&&!e.disabled){if(s++,"object"!==Ce(Ne[e.type]))throw new Error('Modifier "'.concat(e.type,'" is not available'));if(s>1)throw new Error("More than 1 modifier on a measure! (not yet supported)");Ne[e.type].initModifier(e,n);var l=n.qLibraryId||u&&u.qLibraryId;l?function(e){var n=e.measure,i=e.modifier,r=e.properties,o=e.dimensionAndFieldList,a=e.libraryItemsProps[e.libraryId],s=a.qMeasure.qDef,l=""===s?s:Ne[i.type].generateExpression({expression:s,modifier:i,properties:r,dimensionAndFieldList:o});i.outputExpression=l,n.qDef.qDef=i.outputExpression,(n.qDef.qLabel||a.qMeasure.qLabel)&&(n.qDef.qLabel=a.qMeasure.qLabel),(n.qDef.qLabelExpression||a.qMeasure.qLabelExpression)&&(n.qDef.qLabelExpression=a.qMeasure.qLabelExpression),n.qDef.quarantine&&n.qDef.quarantine.qNumFormat&&a.qMeasure.qNumFormat&&(n.qDef.qNumFormat=a.qMeasure.qNumFormat,n.qDef.isCustomFormatted=a.qMeasure.isCustomFormatted),delete n.qLibraryId,n.qDef.coloring=a.qMeasure.coloring,i.base=t()(!0,{},n.qDef.base)}({measure:n,modifier:e,libraryId:l,properties:i,libraryItemsProps:r,dimensionAndFieldList:a}):function(e){var n=e.measure,i=e.modifier,r=e.properties,o=e.dimensionAndFieldList;"function"==typeof Ne[i.type].updateModifier&&Ne[i.type].updateModifier(i,r.qHyperCubeDef);var a=ge.getExpression(n),s=""===a?a:Ne[i.type].generateExpression({expression:a,modifier:i,properties:r,dimensionAndFieldList:o});i.outputExpression=s,n.qDef.qDef=i.outputExpression,n.qDef.base.qLabelExpression?n.qDef.qLabelExpression=n.qDef.base.qLabelExpression:n.qDef.qLabel=n.qDef.base.qLabel||a,i.base=t()(!0,{},n.qDef.base)}({measure:n,modifier:e,properties:i,dimensionAndFieldList:a}),function(e){var t=o(e,"qDef.qAggrFunc");"Expr"!==t||ze(e)?"None"!==t?delete e.qDef.base.qAggrFunc:"None"===t&&ze(e)&&"Expr"===e.qDef.base.qAggrFunc&&(e.qDef.qAggrFunc="Expr",delete e.qDef.base.qAggrFunc):(e.qDef.qAggrFunc="None",e.qDef.base.qAggrFunc="Expr")}(n)}}))}({measure:n,properties:i,libraryItemsProps:r,dimensionAndFieldList:e}),He(n)):Pe(n)}))}))}))}({measures:a,properties:r,model:n,libraryItemsProps:u,dimensionAndFieldList:h}).then((function(){return l?Ze({oldProperties:i,newProperties:r,model:n}):Promise.resolve(!1)}))}))}function Pe(e){!function(e){var t=je(e);return Array.isArray(t)&&t.some((function(e){return"object"===Ce(e)&&!e.disabled&&!Ne[e.type]}))}(e)?Ae.restoreBase(e):delete e.qDef.base,e.qDef.coloring&&delete e.qDef.coloring,He(e)}function Le(e){var t=e.measures,n=e.properties,i=e.layout;return!!Array.isArray(t)&&t.some((function(e){return Ye({modifiers:je(e),properties:n,layout:i})}))}function Te(e){var t=je(e);if(Array.isArray(t))for(var n=0;n<t.length;n++){var i=t[n];if(Ne[i.type]&&!i.disabled)return i}}function ze(e){var t=Te(e);return!t||Ne[t.type].enableTotalsFunction(e)}function Fe(e){return o(e,"qHyperCubeDef.qMeasures",[]).concat(o(e,"qHyperCubeDef.qLayoutExclude.qHyperCubeDef.qMeasures",[]))}function je(e){return e.modifiers||e.qDef&&e.qDef.modifiers}function Ve(e){return o(e,"outputExpression.qValueExpression.qExpr")||o(e,"outputExpression")}function Be(e){Fe(e).forEach((function(e){return function(e){var n=Te(e);n&&(void 0!==n.outputExpression&&Ve(n)!==e.qDef.qDef?delete e.qDef.base:!Ae.isValid(e)&&n.base&&(e.qDef.base=t()(!0,{},n.base)))}(e)}))}function He(e){var t=je(e);Array.isArray(t)&&t.forEach((function(t){"object"===Ce(t)&&(t.disabled||!Ne[t.type]&&Ve(t)!==e.qDef.qDef)&&(t.disabled=!0,delete t.base)}))}function $e(e){return e.base||e.qDef&&e.qDef.base}function We(e){var t=$e(e);return e.qLibraryId||t&&t.qLibraryId}function Ue(e){var t=e.measure,n=e.properties,i=e.layout;return!We(t)&&Ye({modifiers:je(t),properties:n,layout:i})}function Ye(e){var t=e.modifiers,n=e.properties,i=e.layout,r={};return Array.isArray(t)&&t.some((function(e){return!("object"!==Ce(e)||e.disabled||!Ne[e.type])&&(void 0===r[e.type]&&(r[e.type]=Ne[e.type].isApplicable({properties:n,layout:i})),r[e.type])}))}function Ge(e){var t=e.model,n=e.dimensionAndFieldList;if(n)return Promise.resolve(n);var i=[],r={},o=t.app.getDimensionList().then((function(e){r.dimensionList=e}));i.push(o);var a=t.app.getFieldList().then((function(e){r.fieldList=e}));return i.push(a),Promise.all(i).then((function(){return r}))}function Xe(e){var t=e.libraryIds,n=e.model,i=e.libraryItemsProps;if(i)return Promise.resolve(i);var r=t.measureLibraryIds,o=t.dimensionLibraryIds,a={},s=[];return r.forEach((function(e){var t=n.app.getMeasure(e).then((function(t){return t.getProperties().then((function(t){a[e]=t}))}));s.push(t)})),o.forEach((function(e){var t=n.app.getDimension(e).then((function(t){return t.getProperties().then((function(t){a[e]=t}))}));s.push(t)})),Promise.all(s).then((function(){return a}))}function Ke(e,t){if(""!==t||-1===["qFmt","qDec","qThou"].indexOf(e))return t}function Ze(e){var t=e.oldProperties,n=e.newProperties,i=e.model,r=JSON.stringify(o(t,"qHyperCubeDef.qMeasures"),Ke)!==JSON.stringify(o(n,"qHyperCubeDef.qMeasures"),Ke)||JSON.stringify(o(t,"qHyperCubeDef.qLayoutExclude.qHyperCubeDef.qMeasures"),Ke)!==JSON.stringify(o(n,"qHyperCubeDef.qLayoutExclude.qHyperCubeDef.qMeasures"),Ke);return r?function(e){var t=e.model,n=e.oldProperties,i=e.newProperties,r=t.layout;return r&&!r.qHasSoftPatches&&!r.qExtendsId&&o(r,"qMeta.privileges",[]).indexOf("update")>-1?t.setProperties(i):O(t,n,i)}({model:i,oldProperties:t,newProperties:n}).then((function(){return r})):Promise.resolve(r)}function Je(e){var t=e.modifiers,n=e.properties,i=e.layout;return Array.isArray(t)&&t.some((function(e){return"object"===Ce(e)&&!e.disabled&&Ne[e.type]&&Ne[e.type].needDimension({modifier:e,properties:n,layout:i})}))}function Qe(e){var t=Fe(e),n=[],i=[],r=!1;return t.forEach((function(t){var i=je(t);if(Ye({modifiers:i,properties:e})){var o=We(t);o&&n.push(o),r=r||Je({modifiers:i,properties:e})}})),o(e,"qHyperCubeDef.qDimensions",[]).forEach((function(e){var t=e.qLibraryId;t&&i.push(t)})),{measureLibraryIds:n,dimensionLibraryIds:i}}function et(e){var t=e.model,n=e.libraryIds;return!e.masterItem&&n&&(n.measureLibraryIds.length||n.dimensionLibraryIds.length)?(Re[t.id].masterItemSubscriber=Re[t.id].masterItemSubscriber||function(e){var t=e.model,n=e.callback,i={},r={},a={},s={dimension:["qDim.qFieldDefs"],measure:["qMeasure.qDef","qMeasure.qLabel","qMeasure.qLabelExpression","qMeasure.coloring","qMeasure.qNumFormat","qMeasure.isCustomFormatted"]};function l(e){var t={},n=o(e,"qInfo.qType");return n&&s[n]&&s[n].forEach((function(n){t[n]=o(e,n)})),JSON.stringify(t)}function c(e){var t=e.qInfo.qId;if(i[t]){var r=l(e);i[t].properties!==r&&(i[t].properties=r,"function"==typeof n&&i[t].enabled&&n(e)),i[t].enabled=!0}}function u(e,n){return t.app[n](e).then((function(t){i[e]={listener:t.layoutSubscribe(c),enabled:!1,properties:l(t.layout)}}))}return{subscribe:function(e){var n=e.measureLibraryIds,o=e.dimensionLibraryIds,s=[];return function(e){var t=e.dimensionLibraryIds;r={},e.measureLibraryIds.forEach((function(e){r[e]=!0})),a={},t.forEach((function(e){a[e]=!0}))}({measureLibraryIds:n,dimensionLibraryIds:o}),Object.keys(i).forEach((function(e){r[e]||a[e]||(i[e].listener.dispose(),delete i[e])})),t.app&&(Object.keys(r).forEach((function(e){r[e]&&!i[e]&&s.push(u(e,"getMeasure"))})),Object.keys(a).forEach((function(e){a[e]&&!i[e]&&s.push(u(e,"getDimension"))}))),Promise.all(s)},unsubscribe:function(){Object.keys(i).forEach((function(e){i[e].listener.dispose()})),i={}}}}({model:t,callback:function(e){return Ie({model:t,masterItem:e}).then((function(){return t.app.clearUndoBuffer()}))}}),Re[t.id].masterItemSubscriber.subscribe(n)):Promise.resolve()}})(),t.default=r.default,Object.defineProperty(t,"__esModule",{value:!0})})()}},t={};function n(i){var r=t[i];if(void 0!==r)return r.exports;var o=t[i]={exports:{}};return e[i](o,o.exports,n),o.exports}n.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return n.d(t,{a:t}),t},n.d=(e,t)=>{for(var i in t)n.o(t,i)&&!n.o(e,i)&&Object.defineProperty(e,i,{enumerable:!0,get:t[i]})},n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t);var i={};return(()=>{function e(t){var n,i=t;return i>9?(n=65+i-10)>90&&(n+=6):i="".concat(i).charCodeAt(0),[48,111,79,105,73,108].indexOf(n)>-1?e(i+1):String.fromCharCode(n)}function t(n){var i=e(n%62),r=Math.floor(n/62);return r>0?t(r)+i:i}function r(e){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r(e)}n.d(i,{default:()=>Be});const o={getValue:function(e,t,n){if(null==e||null==t)return n;for(var i=t.split("."),r=e,o=0;o<i.length;++o){var a=i[o];if(""!==a){if(void 0===r[a]||null===r[a])return n;r=r[a]}}return r},setValue:function(e,t,n){if(null!=e&&null!=t){for(var i=t.split("."),r=i[i.length-1],o=e,a=0;a<i.length-1;++a){var s=i[a];void 0!==o[s]&&null!==o[s]||(o[s]=Number.isNaN(+i[a+1])?{}:[]),o=o[s]}void 0!==n?o[r]=n:delete o[r]}},isEmpty:function(e){return 0===Object.keys(e).length&&e.constructor===Object},isAtomicValue:function(e){return/boolean|number|string/.test(r(e))},generateId:function(){return t(Math.round(99e11*Math.random()+1e11)).replace(/\W/g,"")}};function a(e){return function(e){if(Array.isArray(e))return s(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(e){if("string"==typeof e)return s(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?s(e,t):void 0}}(e)||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(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,i=new Array(t);n<t;n++)i[n]=e[n];return i}function l(e){return function(e){if(Array.isArray(e))return c(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(e){if("string"==typeof e)return c(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?c(e,t):void 0}}(e)||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 c(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,i=new Array(t);n<t;n++)i[n]=e[n];return i}function u(e,t,n){if(e){for(var i=0;i<e.length;i++)if(e[i][t]===n)return i;return-1}return-1}const h={isOrderedSubset:function(e,t){if(!(e&&t&&e.length&&t.length))return!1;var n=e.indexOf(t[0]);if(-1!==n){for(var i=0;i<t.length;i++){var r=e.indexOf(t[i]);if(n>r)return!1;n=r}return!0}return!1},indexAdded:function(e,t){var n;for(n=0;n<e.length;++n)e[n]>=0&&e[n]>=t&&++e[n];e.push(t)},indexRemoved:function(e,t){var n,i=0;for(n=0;n<e.length;++n)e[n]>t?--e[n]:e[n]===t&&(i=n);return e.splice(i,1),i},findItemByPropertyValue:function(e,t,n){if(e){for(var i=0;i<e.length;i++)if(e[i][t]===n)return e[i];return null}return null},findIndexByPropertyValue:u};var d=n(645),f=n.n(d);const p=function(e){var t,n=e.exportFormat,i=e.qHyperCubeDef,r=n.data[0];(t=r.dimensions).push.apply(t,a(i.qDimensions));var s,l=o.getValue(i,"qLayoutExclude.qHyperCubeDef.qDimensions");l&&(s=r.excludedDimensions).push.apply(s,a(l))},m=function(e){var t,n=e.exportFormat,i=e.qHyperCubeDef,r=n.data[0];(t=r.measures).push.apply(t,l(i.qMeasures));var a,s=o.getValue(i,"qLayoutExclude.qHyperCubeDef.qMeasures");s&&(a=r.excludedMeasures).push.apply(a,l(s))},g=function(e){var t=e.exportFormat,n=e.qHyperCubeDef,i=t.data[0];n.qInterColumnSortOrder||(n.qInterColumnSortOrder=[]),i.interColumnSortOrder=n.qInterColumnSortOrder.concat();var r=o.getValue(n,"qLayoutExclude.qHyperCubeDef.qInterColumnSortOrder");r&&h.isOrderedSubset(r,i.interColumnSortOrder)&&(i.interColumnSortOrder=r.concat())},y=function(e){var t=e.exportFormat,n=e.properties;Object.keys(n).forEach((function(e){t.properties[e]=n[e]}))},x=function(e){var t=e.exportFormat,n=e.properties;n.qLayoutExclude||(n.qLayoutExclude={}),n.qLayoutExclude.disabled&&(Object.keys(n.qLayoutExclude.disabled).forEach((function(e){t.properties.hasOwnProperty(e)||(t.properties[e]=n.qLayoutExclude.disabled[e])})),delete n.qLayoutExclude.disabled),n.qLayoutExclude.changed&&(function(e){Object.keys(e.qLayoutExclude.changed).forEach((function(t){e.qLayoutExclude.changed[t].to===o.getValue(e,t)&&o.setValue(e,t,e.qLayoutExclude.changed[t].from)}))}(n),delete n.qLayoutExclude.changed),n.qLayoutExclude.quarantine&&!o.isEmpty(n.qLayoutExclude.quarantine)||delete n.qLayoutExclude},v=function(e){e.forEach((function(e){f().cleanUpMeasure(e),e.qDef.modifiers&&(e.store={modifiers:e.qDef.modifiers},delete e.qDef.modifiers)}))};function b(e,t,n){var i,r,a=o.getValue(e,t);if(!o.isAtomicValue(a))try{if((r=(r=(i=JSON.stringify(a)).match(/:\{/g))?r.length:0)>2)return;a=JSON.parse(i)}catch(e){return}o.getValue(e,"qLayoutExclude.quarantine")||o.setValue(e,"qLayoutExclude.quarantine",{});var s=o.getValue(e,"qLayoutExclude.quarantine");s[n]||(s[n]={}),s[n][t]=a}var w=n(229),M=n.n(w);function k(e,t){var n=M()(!0,{},t,e);return o.getValue(n,"qOtherTotalSpec.qOtherCounted")||o.setValue(n,"qOtherTotalSpec.qOtherCounted",{qv:"10"}),o.getValue(n,"qOtherTotalSpec.qOtherLimit")||o.setValue(n,"qOtherTotalSpec.qOtherLimit",{qv:"0"}),n.hasOwnProperty("othersLabel")||(n.othersLabel="Others"),n}function S(e,t){return M()(!0,{},t,e)}function _(e,t,n){return"function"==typeof e?e(t):Number.isNaN(+e)?n:e}var q=Math.pow(2,53)-1;function D(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,i=new Array(t);n<t;n++)i[n]=e[n];return i}function A(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,i=new Array(t);n<t;n++)i[n]=e[n];return i}const C=function(e,t,n){var i="masterobject"===o.getValue(t,"properties.qInfo.qType")?"masterobject":o.getValue(n,"qInfo.qType");o.setValue(e,"qInfo.qType",i),e.visualization=n.visualization},N=function(e,t,n){t.hasOwnProperty(e)&&(n[e]=t[e])},E=function(e,t,n,i){t.hasOwnProperty(e)?n[e]=t[e]:n[e]=i},R=function(){return{qDef:{autoSort:!0,cId:"",othersLabel:"Others"},qLibraryId:"",qNullSuppression:!1,qOtherLabel:"Others",qOtherTotalSpec:{qOtherLimitMode:"OTHER_GE_LIMIT",qOtherMode:"OTHER_OFF",qOtherSortMode:"OTHER_SORT_DESCENDING",qSuppressOther:!1}}},I=function(){return{qDef:{autoSort:!0,cId:"",numFormatFromTemplate:!0},qLibraryId:"",qTrendLines:[]}},O=function(e){var t,n=e.exportFormat,i=e.maxDimensions,r=e.minDimensions,o=e.newHyperCubeDef,a=e.defaultDimension,s=n.data[0];for(t=0;t<s.dimensions.length;++t){var l=k(s.dimensions[t],a);o.qDimensions.length<i?o.qDimensions.push(l):o.qLayoutExclude.qHyperCubeDef.qDimensions.push(l)}for(t=0;t<s.excludedDimensions.length;++t){var c=k(s.excludedDimensions[t],a);o.qDimensions.length<r?o.qDimensions.push(c):o.qLayoutExclude.qHyperCubeDef.qDimensions.push(c)}},P=function(e){var t,n=e.exportFormat,i=e.maxMeasures,r=e.minMeasures,o=e.newHyperCubeDef,a=e.defaultMeasure,s=n.data[0];for(t=0;t<s.measures.length;++t){var l=S(s.measures[t],a);o.qMeasures.length<i?o.qMeasures.push(l):o.qLayoutExclude.qHyperCubeDef.qMeasures.push(l)}for(t=0;t<s.excludedMeasures.length;++t){var c=S(s.excludedMeasures[t],a);o.qMeasures.length<r?o.qMeasures.push(c):o.qLayoutExclude.qHyperCubeDef.qMeasures.push(c)}},L=function(e){var t=e.exportFormat,n=e.dataDefinition,i=void 0===n?{}:n,r=t.data[0],o=i.dimensions||{max:0},a=i.measures||{max:0},s=_(a.max,r.dimensions.length,q),l=_(a.min,r.dimensions.length,0);return{maxDimensions:_(o.max,s,q),minDimensions:_(o.min,l,0),maxMeasures:s,minMeasures:l}},T=function(e){var t=e.exportFormat,n=e.newHyperCubeDef,i=t.data[0],r=n.qDimensions.length+n.qMeasures.length;n.qInterColumnSortOrder=i.interColumnSortOrder.concat();var o=n.qInterColumnSortOrder.length;if(o!==r)for(n.qLayoutExclude&&(n.qLayoutExclude.qHyperCubeDef.qInterColumnSortOrder=i.interColumnSortOrder.concat());o!==r;)o<r?(h.indexAdded(n.qInterColumnSortOrder,o),++o):(--o,h.indexRemoved(n.qInterColumnSortOrder,o))},z=function(e){var t=e.exportFormat,n=e.initialProperties,i=e.hypercubePath,r={qLayoutExclude:{disabled:{},quarantine:{}}};return Object.keys(t.properties).forEach((function(e){"qLayoutExclude"===e?t.properties[e].quarantine&&(r.qLayoutExclude.quarantine=M()(!0,{},t.properties[e].quarantine)):"qHyperCubeDef"===e&&i?o.setValue(r,"".concat(i,".qHyperCubeDef"),t.properties.qHyperCubeDef):n.hasOwnProperty(e)||-1!==["qMetaDef","descriptionExpression","labelExpression"].indexOf(e)||function(e,t){return"components"===t&&Array.isArray(e[t])&&e[t].some((function(e){return"general"===e.key}))}(t.properties,e)?r[e]=t.properties[e]:r.qLayoutExclude.disabled[e]=t.properties[e]})),null===(r=M()(!0,{},n,r)).components&&(r.components=[]),r},F=function(e){var t=e.exportFormat,n=e.maxDimensions,i=e.minDimensions,r=e.maxMeasures,o=e.minMeasures,a=t.data[0];return a.dimensions.length>n&&n>0||a.measures.length>r&&r>0||a.excludedDimensions.length>0&&a.dimensions.length+a.excludedDimensions.length>i||a.excludedMeasures.length>0&&a.measures.length+a.excludedMeasures.length>o||!r&&a.measures.length>0||!n&&a.dimensions.length>0},j=function(e){var t=e.exportFormat,n=e.maxDimensions,i=e.minDimensions,r=e.maxMeasures,o=e.minMeasures,a=e.newHyperCubeDef,s=t.data[0];a.qLayoutExclude||(a.qLayoutExclude={}),a.qLayoutExclude.qHyperCubeDef||(a.qLayoutExclude.qHyperCubeDef={}),(s.dimensions.length>n&&n>0||s.excludedDimensions&&s.excludedDimensions.length&&s.dimensions.length+s.excludedDimensions.length>i)&&(a.qLayoutExclude.qHyperCubeDef.qDimensions||(a.qLayoutExclude.qHyperCubeDef.qDimensions=[])),(s.measures.length>r&&r>0||s.excludedMeasures&&s.excludedMeasures.length&&s.measures.length+s.excludedMeasures.length>o)&&(a.qLayoutExclude.qHyperCubeDef.qMeasures||(a.qLayoutExclude.qHyperCubeDef.qMeasures=[])),!r&&s.measures.length&&(a.qLayoutExclude.qHyperCubeDef.qMeasures||(a.qLayoutExclude.qHyperCubeDef.qMeasures=[])),!n&&s.dimensions.length&&(a.qLayoutExclude.qHyperCubeDef.qDimensions||(a.qLayoutExclude.qHyperCubeDef.qDimensions=[]))},V=function(e){var t,n=e.newProperties,i=e.dataDefinition,r=e.hypercubePath;if(i.dimensions&&"function"==typeof i.dimensions.added){var a=o.getValue(n,r||"").qHyperCubeDef,s=function(e){if(Array.isArray(e))return D(e)}(t=a.qDimensions)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(t)||function(e,t){if(e){if("string"==typeof e)return D(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?D(e,t):void 0}}(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.")}();a.qDimensions=[],s.forEach((function(e){a.qDimensions.push(e),i.dimensions.added(e,n)}))}},B=function(e){var t,n=e.newProperties,i=e.dataDefinition,r=e.hypercubePath;if(i.measures&&"function"==typeof i.measures.added){var a=o.getValue(n,r||"").qHyperCubeDef,s=function(e){if(Array.isArray(e))return A(e)}(t=a.qMeasures)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(t)||function(e,t){if(e){if("string"==typeof e)return A(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?A(e,t):void 0}}(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.")}();a.qMeasures=[],s.forEach((function(e){a.qMeasures.push(e),i.measures.added(e,n)}))}},H=function(e){var t=e.measures,n=e.modifierTypes;t&&n&&f().isSupportedModifiers(n)&&t.forEach((function(e){e.store&&e.store.modifiers&&(e.qDef.modifiers=e.store.modifiers),delete e.store}))};function $(e,t){var n=o.getValue(e,"qLayoutExclude.quarantine",{})[t];return!!n&&(Object.keys(n).forEach((function(t){o.setValue(e,t,n[t])})),delete e.qLayoutExclude.quarantine[t],!0)}const W={exportProperties:function(e){var t=e.propertyTree,n=e.hypercubePath,i=e.viewDataMode,r=function(){for(var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1,t={data:[],properties:{}},n=0;n<e;++n)t.data.push({dimensions:[],measures:[],excludedDimensions:[],excludedMeasures:[],interColumnSortOrder:[]});return t}(),a=t.qProperty,s=o.getValue(a,n||""),l=s.qHyperCubeDef;return l.qInterColumnSortOrder||(l.qInterColumnSortOrder=[]),p({exportFormat:r,qHyperCubeDef:l}),m({exportFormat:r,qHyperCubeDef:l}),g({exportFormat:r,qHyperCubeDef:l}),delete l.qLayoutExclude,y({exportFormat:r,properties:a}),n&&(r.properties.qHyperCubeDef=l,delete s.qHyperCubeDef),x({exportFormat:r,properties:a}),i||v(r.properties.qHyperCubeDef.qMeasures),Array.isArray(r.properties.filters)&&(b(r.properties,"filters","storedFilters"),delete r.properties.filters),r.properties.qHyperCubeDef.qContextSetExpression&&(b(r.properties,"qHyperCubeDef.qContextSetExpression","storedFilters"),r.properties.qHyperCubeDef.qContextSetExpression=""),r.properties.qHyperCubeDef.qDynamicScript&&r.properties.qHyperCubeDef.qDynamicScript.length&&(b(r.properties,"qHyperCubeDef.qDynamicScript","dynamicScript"),r.properties.qHyperCubeDef.qDynamicScript=[]),r},importProperties:function(e){var t=e.exportFormat,n=e.initialProperties,i=void 0===n?{}:n,r=e.dataDefinition,a=void 0===r?{}:r,s=e.defaultPropertyValues,l=void 0===s?{}:s,c=e.hypercubePath,u=e.extension,h=e.supportedFilters,d=void 0===h||h,f=e.isHCModifierSupported,p=void 0===f||f,m={qChildren:[]},g=z({exportFormat:t,initialProperties:i,hypercubePath:c}),y=o.getValue(i,c||"").qHyperCubeDef,x=o.getValue(g,c||"").qHyperCubeDef,v=L({exportFormat:t,dataDefinition:a}),b=v.maxDimensions,w=v.minDimensions,M=v.maxMeasures,k=v.minMeasures,S=l.defaultDimension,_=void 0===S?R():S,q=l.defaultMeasure,D=void 0===q?I():q;x.qDimensions.length=0,x.qMeasures.length=0,F({exportFormat:t,maxDimensions:b,minDimensions:w,maxMeasures:M,minMeasures:k})&&j({exportFormat:t,maxDimensions:b,minDimensions:w,maxMeasures:M,minMeasures:k,newHyperCubeDef:x}),O({exportFormat:t,maxDimensions:b,minDimensions:w,newHyperCubeDef:x,defaultDimension:_}),P({exportFormat:t,maxMeasures:M,minMeasures:k,newHyperCubeDef:x,defaultMeasure:D}),V({newProperties:g,dataDefinition:a,hypercubePath:c}),B({newProperties:g,dataDefinition:a,hypercubePath:c}),T({exportFormat:t,newHyperCubeDef:x}),N("qMaxStackedCells",y,x),N("qNoOfLeftDims",y,x),E("qInitialDataFetch",y,x,[{qTop:0,qLeft:0,qWidth:0,qHeight:0}]),E("qMode",y,x,"S"),E("qReductionMode",y,x,"N"),E("qSortbyYValue",y,x),E("qIndentMode",y,x),E("qShowTotalsAbove",y,x),C(g,t,i),m.qProperty=g;var A=o.getValue(u||{},"support.modifiers");return H({measures:x.qMeasures,modifierTypes:A}),d&&$(m.qProperty,"storedFilters"),"S"===x.qMode&&p&&$(m.qProperty,"dynamicScript"),m}};var U={cellBackgroundColor:!0,cellForegroundColor:!0,colorByAlternative:!0,colorByExpression:!0,tooltip:!0,urlLabel:!0,url:!0};function Y(e,t,n,i){t=t||[];var r=u(e,i,n),o=u(t,i,n);if(-1!==r&&-1===o){var a=e.splice(r,1);t.push(a[0])}return t}function G(e,t){return e.length!==t}const X={create:function(e,t){if(!e||!U[e])throw new Error("Attribute Expressions Util: ID required");var n={};return t&&Object.keys(t).forEach((function(e){n[e]=t[e]})),n.id=e,n.qAttribute=!0,n},moveByIdFromGroup:function(e,t,n,i,r){n=n||"qAttributeExpressions",r=r||"id";for(var o=0;o<e.length;o++){var a=e[o][n],s=t.length;if(Y(a,t,i,r),G(t,s))return t}return t},IDMAP:{CELL_BACKGROUND_COLOR:"cellBackgroundColor",CELL_FOREGROUND_COLOR:"cellForegroundColor",COLOR_BY_ALTERNATIVE:"colorByAlternative",COLOR_BY_EXPRESSION:"colorByExpression",TOOLTIP:"tooltip",CELL_LINK_LABEL:"urlLabel",CELL_LINK_URL:"url"}},K={getNumDimensions:function(e){return o.getValue(e,"qHyperCubeDef.qDimensions.length",0)},getNumMeasures:function(e){return o.getValue(e,"qHyperCubeDef.qMeasures.length",0)},wrapFieldName:function(e){return e.split(" ").length>1&&"="!==e[0]&&"["!==e[0]?"[".concat(e,"]"):e},getItemLabel:function(e){return e.label||e.name}},Z={colorModeOptions:{primary:function(){return!0},dimension:function(e){return K.getNumDimensions(e)>0&&K.getNumMeasures(e)<=1},multiColor:function(e){return K.getNumMeasures(e)>1},measure:function(e){return K.getNumDimensions(e)>0},expression:function(e){return K.getNumMeasures(e)>=1}}},J={colorModeOptions:{primary:function(){return!0},dimension:function(){return!0},multiColor:function(){return!1},measure:function(){return!0},expression:function(e){return K.getNumMeasures(e)>=1}}};var Q={scatterplot:J,"sn-scatter-plot":J,piechart:{colorModeOptions:{primary:function(){return!0},dimension:function(){return!0},multiColor:function(){return!1},measure:function(){return!0},expression:function(e){return K.getNumMeasures(e)>=1}}},linechart:{colorModeOptions:{primary:function(){return!0},dimension:function(e){return K.getNumDimensions(e)>1},multiColor:function(e){return K.getNumMeasures(e)>1},measure:function(e){return K.getNumDimensions(e)<=1},expression:function(e){return K.getNumMeasures(e)>=1}}},map:{colorModeOptions:{primary:function(){return!0},dimension:function(e){return K.getNumDimensions(e)>=1},multiColor:function(e){return K.getNumMeasures(e)>1},measure:function(e){return K.getNumDimensions(e)>=1},expression:function(e){return K.getNumDimensions(e)>=1}}},distributionplot:{colorModeOptions:{primary:function(){return!0},dimension:function(){return!0},multiColor:function(){return!1},measure:function(){return!0},expression:function(e){return K.getNumDimensions(e)>=1}}}};function ee(e,t,n){if(Array.isArray(e[t])){var i=h.findIndexByPropertyValue(e[t],"id",n);i>=0&&e[t].splice(i,1)}else e[t]=[]}function te(e,t){var n=X.IDMAP.COLOR_BY_ALTERNATIVE;e.forEach((function(e){ee(e,"qAttributeDimensions",n),ee(e,"qAttributeExpressions",n)})),t.forEach((function(e){ee(e,"qAttributeDimensions",n),ee(e,"qAttributeExpressions",n)}))}function ne(e,t){if(t){var n="="===t.charAt(0);e.color.altLabel=n?{qStringExpression:{qExpr:t.substr(1)}}:t}}function ie(e){var t=e.properties,n=e.isDimension,i=e.dimensions,r=e.excludedDimensions,a=e.measures,s=e.label;te(i,r);var l=i[i.length-1];if(l){var c=n?o.getValue(t,"color.byDimDef"):o.getValue(t,"color.byMeasureDef"),u=o.getValue(t,"color.formatting.qNumFormat"),d=o.getValue(t,"color.formatting.isCustomFormatted");if(c){var f=X.create(X.IDMAP.COLOR_BY_ALTERNATIVE);switch(c.type){case"expression":!function(e){var t=e.attributeExpression,n=e.label,i=e.item,r=e.isDimension,o=e.qNumFormat,a=e.isCustomFormatted;t.label=n||i.label,r?t.qDef=i.key:(t.qExpression=i.key,o&&(t.qNumFormat=o,t.isCustomFormatted=a)),t.matchMeasure=i.activeMeasureIndex,t.label&&"="===t.label.charAt(0)&&(t.labelExpRef="color.altLabel")}({attributeExpression:f,label:s,item:c,isDimension:n,qNumFormat:u,isCustomFormatted:d});break;case"libraryItem":!function(e){var t=e.attributeExpression,n=e.measures,i=e.item,r=e.qNumFormat,o=e.isCustomFormatted;e.isDimension||(t.matchMeasure=h.findIndexByPropertyValue(n,"qLibraryId",i.key),r&&(t.qNumFormat=r,t.isCustomFormatted=o)),void 0!==i.expression?t.qExpression=i.expression:t.qLibraryId=i.key,t.colorMapRef=i.key}({attributeExpression:f,measures:a,item:c,isDimension:n,qNumFormat:u,isCustomFormatted:d})}n?(f.qSortBy={qSortByAscii:1},l.qAttributeDimensions.push(f)):l.qAttributeExpressions.push(f)}}}function re(e,t,n,i){var r,o,a,s={};switch(e){case"dimension":n.qLibraryId?(s.type="dimension",s.name=n.qLibraryId,s.id=n.qLibraryId):(s.type="field",t?(s.name=n.label||n.qDef,s.id=n.qDef):(s.name=n.qDef.qFieldDefs[0],s.label=(a=n.qDef).qLabelExpression?a.qLabelExpression:a.qFieldLabels&&a.qFieldLabels[0]?a.qFieldLabels[0]:a.qFieldDefs[0]));break;case"measure":r=function(e,t){return t?e.qLibraryId:f().measureBase.getLibraryId(e)}(n,t),r?(s.type="measure",s.name=r,s.id=r,o=function(e,t){return f().hasActiveModifiers({measures:[e]})&&t?e.qDef.qDef:void 0}(n,i),o&&(s.expression=o)):(s.type="expression",t?(s.name=n.label||n.qExpression,s.id=n.qExpression):(s.name=n.qDef.qDef,s.label=function(e){var t=e.qDef;return t.qLabelExpression?t.qLabelExpression:t.qLabel?t.qLabel:t.qDef}(n)));break;default:throw new Error('columnType should be "dimension" or "measure"')}return s}const oe={useMasterNumberFormat:function(e){e.quarantine={qNumFormat:e.qNumFormat||{},isCustomFormatted:e.isCustomFormatted||!1},e.qNumFormat=null,e.isCustomFormatted=void 0}};function ae(e,t,n,i){var r=n?"expression":t.type,o=e.color,a=o.mode,s=K.getItemLabel(t);switch(ne(e,s||""),r){case"field":a="byDimension",o.byDimDef={label:t.label||K.wrapFieldName(t.name),key:K.wrapFieldName(t.name),type:"expression",activeDimensionIndex:t.activeDimensionIndex};break;case"expression":a="byMeasure",o.byMeasureDef={label:n||s,key:n||t.name,type:"expression",activeMeasureIndex:t.activeMeasureIndex};break;case"dimension":a="byDimension",o.byDimDef={label:t.name,key:t.id,type:"libraryItem",activeDimensionIndex:t.activeDimensionIndex};break;case"measure":a="byMeasure",o.byMeasureDef={label:t.name,key:t.id,expression:t.expression,type:"libraryItem",activeMeasureIndex:t.activeMeasureIndex},o.formatting&&oe.useMasterNumberFormat(o.formatting)}i||(o.auto=!1,o.mode=a)}function se(e,t){var n=o.getValue(e,"".concat(t,"qDimensions"),[]),i=o.getValue(e,"".concat(t,"qMeasures"),[]),r=o.getValue(e,"".concat(t,"qLayoutExclude.qHyperCubeDef.qDimensions"),[]),a=o.getValue(e,"color.byDimDef");if(a&&ne(e,a.label),function(e){return!!(e&&e.activeDimensionIndex>-1)}(a))!function(e,t){var n=o.getValue(e,"".concat(t,"qDimensions"),[]),i=o.getValue(e,"color.byDimDef");i.activeDimensionIndex=Math.min(i.activeDimensionIndex,n.length-1);var r=re("dimension",!1,n[i.activeDimensionIndex]);r.activeDimensionIndex=i.activeDimensionIndex,ae(e,r)}(e,t);else if(function(e){return!e||!e.key}(a)&&function(e,t){var n=o.getValue(e,"".concat(t,"qDimensions"),[]),i=n[function(e,t,n){var i=o.getValue(t,"visualization"),r=n.split("."),a=Number(r[1]),s=o.getValue(t,"layers.".concat(a,".type"));return 2===e.length&&"map"===i&&"point"===s}(n,e,t)?0:n.length-1],r=X.IDMAP.COLOR_BY_ALTERNATIVE,a=h.findItemByPropertyValue(i.qAttributeDimensions,"id",r);return ae(e,re("dimension",!!a,a||i)),!!a}(e,t))return;ie({properties:e,isDimension:!0,dimensions:n,excludedDimensions:r,measures:i,label:o.getValue(e,"color.byDimDef.label")})}const le=function(e,t,n){o.setValue(e,t,n),o.isAtomicValue(n)&&function(e,t,n){var i=e.qLayoutExclude;i&&(i.changed||(i.changed={}),i.changed[t]={from:o.getValue(e,t),to:n})}(e,t,n)},ce=function(e,t){var n={primary:!0};if(e){var i=(Q[t]||Z).colorModeOptions||Z.colorModeOptions;n.byDimension=i.dimension(e),n.byMeasure=i.measure(e),n.byMultiple=i.multiColor(e),n.byExpression=i.expression(e)}return n},ue=function(e){var t=e.canColorBy,n=e.autoColor,i=e.colorMode,r=e.dimensions;return!(t[i]&&!n&&("byDimension"!==i&&"byMeasure"!==i||!r.length))},he=function(e,t){var n,i=o.getValue(e,"color.mode"),r=o.getValue(e,"color.auto"),a=o.getValue(e,"".concat(t,"qDimensions"),[]),s=o.getValue(e,"".concat(t,"qMeasures"),[]),l=o.getValue(e,"".concat(t,"qLayoutExclude.qHyperCubeDef.qDimensions"),[]);r?te(a,l):!(n={auto:r,colorMode:i,dimensions:a}).auto&&"byDimension"===n.colorMode&&n.dimensions.length>0?se(e,t):function(e){var t=e.auto,n=e.colorMode,i=e.dimensions,r=e.measures,a=e.properties,s=o.getValue(a,"visualization");return!(t||"byMeasure"!==n||!i.length||"map"!==s&&!r.length)}({auto:r,colorMode:i,dimensions:a,measures:s,properties:e})?function(e,t){var n=o.getValue(e,"".concat(t,"qDimensions"),[]),i=o.getValue(e,"".concat(t,"qMeasures"),[]),r=o.getValue(e,"".concat(t,"qLayoutExclude.qHyperCubeDef.qDimensions"),[]),a=o.getValue(e,"color.byMeasureDef");if(a&&ne(e,a.label),function(e){return!!(e&&e.activeMeasureIndex>-1)}(a))!function(e,t){var n=o.getValue(e,"".concat(t,"qMeasures"),[]),i=o.getValue(e,"color.byMeasureDef");if(i.activeMeasureIndex=Math.min(i.activeMeasureIndex,n.length-1),i.activeMeasureIndex>-1){var r=re("measure",!1,n[i.activeMeasureIndex],!0);r.activeMeasureIndex=i.activeMeasureIndex,ae(e,r)}}(e,t);else if(function(e,t){return(!e||!e.key)&&t.length>0}(a,i)&&function(e,t){var n=o.getValue(e,"".concat(t,"qDimensions"),[]),i=o.getValue(e,"".concat(t,"qMeasures"),[]),r=n[n.length-1],a=X.IDMAP.COLOR_BY_ALTERNATIVE,s=h.findItemByPropertyValue(r.qAttributeExpressions,"id",a);return ae(e,re("measure",!!s,s||i[0])),!!s}(e,t))return;ie({properties:e,isDimension:!1,dimensions:n,excludedDimensions:r,measures:i,label:o.getValue(e,"color.byMeasureDef.label")})}(e,t):function(e,t){var n=o.getValue(e,"color.mode"),i=o.getValue(e,"".concat(t,"qDimensions"),[]),r=o.getValue(e,"".concat(t,"qMeasures"),[]),a=o.getValue(e,"".concat(t,"qLayoutExclude.qHyperCubeDef.qDimensions"),[]);"byMultiple"===n&&r.length<2&&o.setValue(e,"color.mode","primary"),te(i,a)}(e,t)},de=function(e){e.forEach((function(e){e.qOtherTotalSpec&&"qTotalMode"in e.qOtherTotalSpec&&delete e.qOtherTotalSpec.qTotalMode}))},fe=function(e){var t=e.shouldUpdateColorBy,n=e.properties,i=o.getValue(n,"qHyperCubeDef.qMeasures",[]),r=o.getValue(n,"color.mode","");return!t&&"byExpression"===r&&i.length>0},pe=function(e){var t=o.getValue(e,"qHyperCubeDef.qMeasures.0.qAttributeExpressions",[]),n=o.getValue(e,"color.colorExpression","");t.splice(0,0,{qExpression:n,id:"colorByExpression"}),o.setValue(e,"qHyperCubeDef.qMeasures.0.qAttributeExpressions",t)},me=function(e){o.setValue(e,"color.mode","primary"),o.setValue(e,"color.auto",!0)},ge=function(e){var t=o.getValue(e,"qHyperCubeDef.qDimensions",[]),n=o.getValue(e,"color.persistent",!1);return t.length>1&&!n},ye={exportProperties:function(e){var t=e.propertyTree,n=e.hypercubePath,i=e.viewDataMode,r=W.exportProperties({propertyTree:t,hypercubePath:n,viewDataMode:i}),o=r.data[0],a=o.dimensions.concat(o.excludedDimensions),s=o.measures.concat(o.excludedMeasures),l=X.IDMAP,c=l.COLOR_BY_ALTERNATIVE,u=l.COLOR_BY_EXPRESSION;return X.moveByIdFromGroup(a,[],"qAttributeDimensions",c),X.moveByIdFromGroup(a,[],"qAttributeExpressions",c),X.moveByIdFromGroup(s,[],"qAttributeExpressions",u),r},importProperties:function(e){var t=e.exportFormat,n=e.initialProperties,i=e.dataDefinition,r=e.defaultPropertyValues,a=e.hypercubePath,s=e.extension,l=e.supportedFilters,c=e.isHCModifierSupported,u=W.importProperties({exportFormat:t,initialProperties:n,dataDefinition:i,defaultPropertyValues:r,hypercubePath:a,extension:s,supportedFilters:l,isHCModifierSupported:c}),h=u.qProperty,d=o.getValue(h,"visualization"),f=o.getValue(h,"qHyperCubeDef.qDimensions",[]),p=o.getValue(h,"color.mode",""),m=o.getValue(h,"color.auto",""),g=ce(h,d),y=ue({canColorBy:g,autoColor:m,colorMode:p,dimensions:f});return g[p]?fe({shouldUpdateColorBy:y,properties:h})&&pe(h):me(h),y&&he(h,"qHyperCubeDef."),ge(h)&&le(h,"color.persistent",!0),de(f),u}};var xe=["bar","marker","line"];const ve=function(e){var t=e.initialProperties,n=e.properties;t.measureAxis&&void 0===t.measureAxis.autoMinMax?$(n,"unsupportedAutoMinMax")||M()(n.measureAxis,t.measureAxis):$(n,"supportedAutoMinMax")||M()(n.measureAxis,t.measureAxis)},be=function(e){var t,n=e.exportFormat,i=e.initialProperties,r=e.properties,o=e.measureType,a=r.qHyperCubeDef,s=r.measureAxis;if(function(e){var t=e.initialProperties;return!(!e.exportFormat.properties.measureAxes||t.measureAxes||!t.measureAxis||void 0===t.measureAxis.autoMinMax)}({exportFormat:n,initialProperties:i})){var l=function(e){var t=[];return e.qMeasures.length>0&&e.qMeasures.forEach((function(e){if(e.qDef.series){var n=e.qDef.series,i=n.type,r=n.axis;t[r]||(t[r]={axis:r,type:{line:0,marker:0,bar:0,total:0}}),xe.includes(i)&&t[r].type[i]++,t[r].type.total++}})),t}(a);l.length?(o&&(t=l.filter((function(e){return e.type[o]>0})).sort((function(e,t){return t.type[o]-e.type[o]}))),t&&t.length||(t=l.sort((function(e,t){return t.type.total-e.type.total}))),t&&t[0]&&M()(s,n.properties.measureAxes[t[0].axis])):M()(s,n.properties.measureAxes[0])}},we=function(e){if(e.qDimensions.length>1){var t=e.qInterColumnSortOrder.indexOf(0);if(0!==t){var n=e.qInterColumnSortOrder[0];e.qInterColumnSortOrder[0]=0,e.qInterColumnSortOrder[t]=n}}},Me={exportProperties:function(e){var t=e.propertyTree,n=e.hypercubePath,i=e.viewDataMode,r=e.supportedAutoMinMax,o=void 0===r||r,a=ye.exportProperties({propertyTree:t,hypercubePath:n,viewDataMode:i}),s=a.properties;return o?(b(s,"measureAxis.min","supportedAutoMinMax"),b(s,"measureAxis.max","supportedAutoMinMax")):(b(s,"measureAxis.min","unsupportedAutoMinMax"),b(s,"measureAxis.max","unsupportedAutoMinMax")),a},importProperties:function(e){var t=e.exportFormat,n=e.initialProperties,i=e.dataDefinition,r=e.defaultPropertyValues,o=e.hypercubePath,a=e.measureType,s=e.extension,l=e.supportedFilters,c=e.isHCModifierSupported,u=ye.importProperties({exportFormat:t,initialProperties:n,dataDefinition:i,defaultPropertyValues:r,hypercubePath:o,extension:s,supportedFilters:l,isHCModifierSupported:c}),h=u.qProperty;return ve({initialProperties:n,properties:h}),be({exportFormat:t,initialProperties:n,properties:h,measureType:a}),we(h.qHyperCubeDef),h.qHyperCubeDef.qColumnOrder=[],h.qHyperCubeDef.columnOrder=[],u}};function ke(e,t,n){return"qLayoutExclude.quarantine.".concat(e,".").concat(t,".").concat(n)}function Se(e){var t=e.properties,n=e.arrayPath,i=e.quarantineName,r=e.arrayName,a=e.itemPath;o.getValue(t,n,[]).forEach((function(e){return function(e){var t=e.properties,n=e.quarantineName,i=e.arrayName,r=e.item,a=e.itemPath,s=o.getValue(r,a);if(void 0!==s){var l=o.getValue(r,"qDef.cId");l||(l=o.generateId(),o.setValue(r,"qDef.cId",l));var c=ke(n,i,l);o.setValue(t,c,s),o.setValue(r,a,void 0)}}({properties:t,quarantineName:i,arrayName:r,item:e,itemPath:a})}))}function _e(e){var t=e.properties,n=e.arrayPath,i=e.quarantineName,r=e.arrayName,a=e.itemPath;o.getValue(t,n,[]).forEach((function(e){return function(e){var t=e.properties,n=e.quarantineName,i=e.arrayName,r=e.item,a=e.itemPath,s=o.getValue(r,"qDef.cId");if(s){var l=ke(n,i,s),c=o.getValue(t,l);void 0!==c&&(o.setValue(r,a,c),o.setValue(t,l,void 0))}}({properties:t,quarantineName:i,arrayName:r,item:e,itemPath:a})}))}var qe="qHyperCubeDef.qMeasures",De="conditionalColoring",Ae="measures",Ce="qDef.conditionalColoring";const Ne={quarantine:function(e){Se({properties:e,arrayPath:qe,quarantineName:De,arrayName:Ae,itemPath:Ce})},unquarantine:function(e){_e({properties:e,arrayPath:qe,itemPath:Ce,arrayName:Ae,quarantineName:De})}};var Ee="qHyperCubeDef.qMeasures",Re="measures",Ie="qHyperCubeDef.qDimensions",Oe="dimensions",Pe="qHyperCubeDef.qLayoutExclude.qHyperCubeDef.qMeasures",Le="alternativeMeasures",Te="qHyperCubeDef.qLayoutExclude.qHyperCubeDef.qDimensions",ze="alternativeDimensions",Fe="qCalcCondition",je="conditionalShowHide";const Ve={quarantine:function(e){Se({properties:e,arrayPath:Ee,quarantineName:je,arrayName:Re,itemPath:Fe}),Se({properties:e,arrayPath:Ie,quarantineName:je,arrayName:Oe,itemPath:Fe})},unquarantine:function(e){_e({properties:e,arrayPath:Ee,quarantineName:je,arrayName:Re,itemPath:Fe}),_e({properties:e,arrayPath:Ie,quarantineName:je,arrayName:Oe,itemPath:Fe})},quarantineAlternative:function(e){Se({properties:e,arrayPath:Pe,quarantineName:je,arrayName:Le,itemPath:Fe}),Se({properties:e,arrayPath:Te,quarantineName:je,arrayName:ze,itemPath:Fe})},unquarantineAlternative:function(e){_e({properties:e,arrayPath:Pe,quarantineName:je,arrayName:Le,itemPath:Fe}),_e({properties:e,arrayPath:Te,quarantineName:je,arrayName:ze,itemPath:Fe})}},Be={hypercube:W,colorChart:ye,axisChart:Me,quarantineProperty:b,unquarantineProperty:$,quarantineArrayProp:Se,unquarantineArrayProp:_e,conditionalColoring:Ne,conditionalShow:Ve}})(),i.default})()),Xt.exports),Zt=Yt(Kt);function Jt(e){return{dimensions:{min:0,max:0},measures:{min:1,max:1,description:()=>e.translator.get("Visualizations.Descriptions.Gauge.Measure")}}}const Qt=(e,t,n)=>{const i=function(e){var t=e.theme,n=e.translator,i=e.config,r=void 0===i?{}:i,o=e.flags,a=function(e){var t=e.config,n=void 0===t?{}:t,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(e){for(var i=e.split("."),r=c,a=0;a<i.length;a++){var l=i[a];a===i.length-1?r[l]=R({theme:t,translator:n,id:s,path:e,flags:o}):void 0===r[l]&&(r[l]={}),r=r[l]}}));var u=function(e){for(var t=e.split("."),n=c,i=0;i<t.length;i++){var r=t[i];if(void 0===n[r])throw new Error("font-resolver: Path '".concat(e,"' could not be resolved."));n=n[r]}return n};return c.getDefaultValue=function(e){return u(e).getDefaultValue()},c.getOptions=function(e){return u(e).getOptions()},c}({theme:n,translator:t,flags:e,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}}}}}}}}}};let en;function tn(e){return"measure"===Mt(e,"color.useBaseColors")}function nn(e){const{flags:t,translator:n,sense:i}=e,r=null==i?void 0:i.theme,o=()=>{var e;if(!r)return-1;const{primary:t}=r.getDataColorSpecials(),n=null===(e=r.getDataColorPickerPalettes()[0])||void 0===e?void 0:e.colors,i=n.indexOf(t);return{index:-1===i?Math.min(6,n.length-1):i}},a={items:{labels:{items:{header:{show(e){var t;return null===(t=e.qHyperCubeDef.qMeasures)||void 0===t?void 0:t.length}},measureTitle:{component:"checkbox",ref:"measureAxis.show",type:"string",translation:"Simple.Label.Measure.Hide",defaultValue:"all",show(e){var t;return null===(t=e.qHyperCubeDef.qMeasures)||void 0===t?void 0:t.length},convertFunctions:{get:(e,t,n,i)=>"labels"===i.measureAxis.show||"none"===i.measureAxis.show,set(e,t,n,i,r){r.measureAxis.show=e?"labels":"all"}}}}}}};return{definition:{type:"items",component:"accordion",items:{data:{uses:"data",items:{measures:{disabledRef:""}}},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:a,presentation:{type:"items",grouped:!0,translation:"properties.presentation",items:{styleEditor:Qt(t,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:e=>e.measureAxis&&e.measureAxis.min>=e.measureAxis.max},max:{ref:"measureAxis.max",translation:"Common.Max",type:"number",expression:"optional",defaultValue:100,invalid:e=>e.measureAxis&&e.measureAxis.min>=e.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"}],change(e){"radial"===e.gaugetype?(en=e.orientation,e.orientation="horizontal"):e.orientation=en}},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:e=>"bar"===e.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:e=>"bar"===e.gaugetype&&!e.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(e){const t=function(e){const{paletteColors:t,colors:n}=e;return t&&t.length?t:n&&n.length?n.map((e=>({index:e.color}))):void 0}(e.segmentInfo);t&&(e.useSegments&&1===t.length?e.segmentInfo.paletteColors=[e.paletteProgressColor||e.progressColor]:e.paletteProgressColor=t[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:e=>(e.color||(e.color={}),e.color.useBaseColors||(e.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:o,show(e){if(!Mt(e,"paletteProgressColor")){let t=function({progressColor:e,theme:t}){var n;const i=null===(n=t.getDataColorPickerPalettes()[0])||void 0===n?void 0:n.colors;return null!=e?void 0!==e.index&&-1!==e.index&&i[e.index]?i[e.index]:void 0!==e.color?e.color?e.color:"none":i[e]?i[e]:e||"none":"none"}({progressColor:Mt(e,"progressColor"),theme:r}),n=-1;t&&"none"!==t||(t=o(),n=t.index),St(e,"paletteProgressColor",{index:n,color:t})}return!tn(e)&&!e.useSegments}},maxSegments:{ref:"maxSegments",type:"number",defaultValue:6,show:!1},segmentInfo:{ref:"segments",type:"items",component:"color-scale-creator",show:e=>!tn(e)&&e.useSegments,items:{limits:{ref:"segmentInfo.limits",type:"array",items:{value:{ref:"value",type:"number",expression:"optional",invalid:(e,t)=>"number"==typeof e.value&&(e.value<t.measureAxis.min||e.value>t.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",label:(t,n)=>(t=>{let n;const i=t.getMeasureLayouts()[0];return n=i&&!i.qError?`${e.translator.get("properties.measureAxis")}: ${i.qFallbackTitle}`:e.translator.get("properties.measureAxis"),n})(n),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:e=>e.measureAxis&&"none"!==e.measureAxis.show&&"title"!==e.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},importProperties:(t,n,i,r)=>Zt.axisChart.importProperties({exportFormat:t,initialProperties:n,hypercubePath:r,extension:i,dataDefinition:Jt(e)}),exportProperties:(e,t,n)=>Zt.axisChart.exportProperties({propertyTree:e,hyperCubePath:t,viewDataMode:n,supportedAutoMinMax:!1})}}function rn(e,t,n){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var i=n.call(e,t||"default");if("object"!=typeof i)return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function on(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,i)}return n}function an(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?on(Object(n),!0).forEach((function(t){rn(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):on(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var sn=Object.prototype.hasOwnProperty,ln=Object.prototype.toString,cn=Object.defineProperty,un=Object.getOwnPropertyDescriptor,hn=function(e){return"function"==typeof Array.isArray?Array.isArray(e):"[object Array]"===ln.call(e)},dn=function(e){if(!e||"[object Object]"!==ln.call(e))return!1;var t,n=sn.call(e,"constructor"),i=e.constructor&&e.constructor.prototype&&sn.call(e.constructor.prototype,"isPrototypeOf");if(e.constructor&&!n&&!i)return!1;for(t in e);return void 0===t||sn.call(e,t)},fn=function(e,t){cn&&"__proto__"===t.name?cn(e,t.name,{enumerable:!0,configurable:!0,value:t.newValue,writable:!0}):e[t.name]=t.newValue},pn=function(e,t){if("__proto__"===t){if(!sn.call(e,t))return;if(un)return un(e,t).value}return e[t]},mn=function e(){var t,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!=(t=arguments[l]))for(n in t)i=pn(s,n),s!==(r=pn(t,n))&&(u&&r&&(dn(r)||(o=hn(r)))?(o?(o=!1,a=i&&hn(i)?i:[]):a=i&&dn(i)?i:{},fn(s,{name:n,newValue:e(u,a,r)})):void 0!==r&&fn(s,{name:n,newValue:r}));return s};function gn(e,t,n,i){if(!e)return-1;const r=n.cache,o=e.origin?e.origin():null;o&&(e=o);let a=r.fields.indexOf(e),s=-1,l=-1;if(-1===a)for(let t=0;t<r.wrappedFields.length;t++)if(l=r.wrappedFields[t].attrDims.map((e=>e.instance)).indexOf(e),s=r.wrappedFields[t].attrExps.map((e=>e.instance)).indexOf(e),-1!==l||-1!==s){a=t;break}if(Array.isArray(i)&&i.some(((e,t)=>e!==t))){const e=i.indexOf(a);-1!==e&&(a=e)}return a-=t.qArea.qLeft,a<0||a>=t.qArea.qWidth?-1:l>=0?e=>e[a].qAttrDims.qValues[l]:s>=0?e=>e[a].qAttrExps.qValues[s]:e=>e[a]}function yn(e,t,n){let{key:i}=n;const r={value:"function"==typeof e.value?e.value(t):void 0!==e.value?e.value:t};return r.label="function"==typeof e.label?e.label(t):void 0!==e.label?String(e.label):String(r.value),e.field&&(r.source={key:i,field:e.field.key()}),r}function xn(e){let{cache:t,f:n,mainCell:i,p:r,prop:o,page:a,rowIdx:s,row:l,sourceKey:c,target:u,targetProp:h,columnOrder:d}=e,f=i;if(r.field&&r.field!==n){const e=gn(r.field,a,{cache:t},d);if(-1===e)return;f=mn({qRow:s},e(l))}u[h]=yn(r,f,{key:c})}function vn(e,t,n,i){const r=Array.isArray(e)?e:[e];let o=[];for(let e=0;e<r.length;e++)if(void 0!==r[e].field){const a=t.raw(),s=t.key(),l="object"==typeof r[e].field?r[e].field:t.field(r[e].field),{props:c,main:u}=i.normalizeConfig(r[e],t),h=Object.keys(c),d=!!r[e].trackBy,f=typeof r[e].trackBy,p={},m=[],g=[];for(let t=0;t<a.qDataPages.length;t++){const o=gn(l,a.qDataPages[t],{cache:n},a.qColumnOrder);if(-1!==o)for(let y=0;y<a.qDataPages[t].qMatrix.length;y++){const x=a.qDataPages[t].qArea.qTop+y,v=mn({qRow:x},o(a.qDataPages[t].qMatrix[y])),b=yn(u,v,{key:s});if(!(u.filter&&!u.filter(v))){for(let e=0;e<h.length;e++){const i=c[h[e]];let r=i.fields||[i];i.fields&&(b[h[e]]=[]);for(let o=0;o<r.length;o++)xn({cache:n,f:l,mainCell:v,p:r[o],prop:h[e],props:c,page:a.qDataPages[t],rowIdx:x,row:a.qDataPages[t].qMatrix[y],sourceKey:s,target:i.fields?b[h[e]]:b,targetProp:i.fields?o:h[e],columnOrder:a.qColumnOrder});if(i.fields){const t=b[h[e]].map((e=>e.value)),n=b[h[e]].map((e=>e.label));b[h[e]]={value:"function"==typeof i.value?i.value(t):void 0!==i.value?i.value:t,label:"function"==typeof i.label?i.label(n):void 0!==i.label?String(i.label):String(b[h[e]].value)}}}d&&i.track({cfg:r[e],itemData:v,obj:b,target:m,tracker:p,trackType:f}),g.push(b)}}}const y=d?i.collect(m,{main:u,propsArr:h,props:c}):g;o=[...o,...y]}return o}function bn(e){var t=0,n=e.children,i=n&&n.length;if(i)for(;--i>=0;)t+=n[i].value;else t=1;e.value=t}function wn(e,t){e instanceof Map?(e=[void 0,e],void 0===t&&(t=kn)):void 0===t&&(t=Mn);for(var n,i,r,o,a,s=new qn(e),l=[s];n=l.pop();)if((r=t(n.data))&&(a=(r=Array.from(r)).length))for(n.children=r,o=a-1;o>=0;--o)l.push(i=r[o]=new qn(r[o])),i.parent=n,i.depth=n.depth+1;return s.eachBefore(_n)}function Mn(e){return e.children}function kn(e){return Array.isArray(e)?e[1]:null}function Sn(e){void 0!==e.data.value&&(e.value=e.data.value),e.data=e.data.data}function _n(e){var t=0;do{e.height=t}while((e=e.parent)&&e.height<++t)}function qn(e){this.data=e,this.depth=this.height=0,this.parent=null}function Dn(e){return null==e?null:function(e){if("function"!=typeof e)throw new Error;return e}(e)}qn.prototype=wn.prototype={constructor:qn,count:function(){return this.eachAfter(bn)},each:function(e,t){let n=-1;for(const i of this)e.call(t,i,++n,this);return this},eachAfter:function(e,t){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();)e.call(t,o,++l,this);return this},eachBefore:function(e,t){for(var n,i,r=this,o=[r],a=-1;r=o.pop();)if(e.call(t,r,++a,this),n=r.children)for(i=n.length-1;i>=0;--i)o.push(n[i]);return this},find:function(e,t){let n=-1;for(const i of this)if(e.call(t,i,++n,this))return i},sum:function(e){return this.eachAfter((function(t){for(var n=+e(t.data)||0,i=t.children,r=i&&i.length;--r>=0;)n+=i[r].value;t.value=n}))},sort:function(e){return this.eachBefore((function(t){t.children&&t.children.sort(e)}))},path:function(e){for(var t=this,n=function(e,t){if(e===t)return e;var n=e.ancestors(),i=t.ancestors(),r=null;e=n.pop(),t=i.pop();for(;e===t;)r=e,e=n.pop(),t=i.pop();return r}(t,e),i=[t];t!==n;)t=t.parent,i.push(t);for(var r=i.length;e!==n;)i.splice(r,0,e),e=e.parent;return i},ancestors:function(){for(var e=this,t=[e];e=e.parent;)t.push(e);return t},descendants:function(){return Array.from(this)},leaves:function(){var e=[];return this.eachBefore((function(t){t.children||e.push(t)})),e},links:function(){var e=this,t=[];return e.each((function(n){n!==e&&t.push({source:n.parent,target:n})})),t},copy:function(){return wn(this).eachBefore(Sn)},[Symbol.iterator]:function*(){var e,t,n,i,r=this,o=[r];do{for(e=o.reverse(),o=[];r=e.pop();)if(yield r,t=r.children)for(n=0,i=t.length;n<i;++n)o.push(t[n])}while(o.length)}};var An={depth:-1},Cn={},Nn={};function En(e){return e.id}function Rn(e){return e.parentId}function In(){var e,t=En,n=Rn;function i(i){var r,o,a,s,l,c,u,h,d=Array.from(i),f=t,p=n,m=new Map;if(null!=e){const t=d.map(((t,n)=>function(e){e=`${e}`;let t=e.length;Pn(e,t-1)&&!Pn(e,t-2)&&(e=e.slice(0,-1));return"/"===e[0]?e:`/${e}`}(e(t,n,i)))),n=t.map(On),r=new Set(t).add("");for(const e of n)r.has(e)||(r.add(e),t.push(e),n.push(On(e)),d.push(Nn));f=(e,n)=>t[n],p=(e,t)=>n[t]}for(a=0,r=d.length;a<r;++a)o=d[a],c=d[a]=new qn(o),null!=(u=f(o,a,i))&&(u+="")&&(h=c.id=u,m.set(h,m.has(h)?Cn: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=m.get(u)))throw new Error("missing: "+u);if(l===Cn)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!=e){for(;s.data===Nn&&1===s.children.length;)s=s.children[0],--r;for(let e=d.length-1;e>=0&&(c=d[e]).data===Nn;--e)c.data=null}if(s.parent=An,s.eachBefore((function(e){e.depth=e.parent.depth+1,--r})).eachBefore(_n),s.parent=null,r>0)throw new Error("cycle");return s}return i.id=function(e){return arguments.length?(t=Dn(e),i):t},i.parentId=function(e){return arguments.length?(n=Dn(e),i):n},i.path=function(t){return arguments.length?(e=Dn(t),i):e},i}function On(e){let t=e.length;if(t<2)return"";for(;--t>1&&!Pn(e,t););return e.slice(0,t)}function Pn(e,t){if("/"===e[t]){let n=0;for(;t>0&&"\\"===e[--t];)++n;if(!(1&n))return!0}return!1}function Ln(e,t){"/"===e.charAt(0)&&(e=e.substring(1));const n=e.split("/");let i,r=t;for(let e=0;e<n.length;e++){if("*"===n[e]&&Array.isArray(r)){const t=[];i=n.slice(e+1).join("/");for(let e=0;e<r.length;e++){let n=Ln(i,r[e]);Array.isArray(n)?t.push(...n):t.push(n)}return t}if(!n[e]&&Array.isArray(r)){const t=new Array(r.length);i=n.slice(e+1).join("/");for(let e=0;e<r.length;e++)t[e]=Ln(i,r[e]);return t}n[e]in r&&(r=r[n[e]])}return r}function Tn(e,t,n){let i=[];if(!e||!e.length)return i;if(t<=0){const t=n>=0?[e[n]]:e;i=[...i,...t]}else for(let r=0;r<e.length;r++)e[r].children&&e[r].children.length&&(i=[...i,...Tn(e[r].children,t-1,n)]);return i}function zn(e,t,n){if(e===t)return e=>e;if(e>t){const n=Math.max(0,Math.min(100,e-t));return e=>{let t=e;for(let e=0;e<n;++e)t=t.parent;return t}}if(t>e){const i=Math.max(0,Math.min(100,t-e));return e=>Tn(e.children,i-1,n)}return!1}const Fn=/^qDimensionInfo(?:\/(\d+))?/,jn=/^\/?qMeasureInfo\/(\d+)/,Vn=/\/qAttrExprInfo\/(\d+)/,Bn=/\/qAttrDimInfo\/(\d+)/;function Hn(e){return(e.qColumnOrder&&e.qColumnOrder.length?e.qColumnOrder:e.qDimensionInfo.map(((e,t)=>t))).filter((t=>t<e.qDimensionInfo.length))}function $n(e,t){let{cube:n}=t;if(!e)return-1;let i=e.origin&&e.origin()?e.origin().key():e.key(),r=!1,o=-1,a=-1,s=-1,l=-1,c=-1,u=-1,h=i;const d=n.qEffectiveInterColumnSortOrder,f=Hn(n);return Fn.test(h)&&(r=!0,o=+Fn.exec(h)[1],h=i.replace(Fn,"")),jn.test(h)&&("K"===n.qMode?c=+jn.exec(h)[1]:d&&-1!==d.indexOf(-1)?(c=+jn.exec(h)[1],u=0):u=+jn.exec(h)[1],h=h.replace(jn,"")),h&&(Bn.exec(h)?s=+Bn.exec(h)[1]:Vn.exec(h)&&(a=+Vn.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 Wn(e,t){let n,i,r=zn(e.fieldDepth,t.fieldDepth,t.pseudoMeasureIndex);return n=t.measureIdx>=0?e=>e.data.qValues[t.measureIdx]:e=>e.data,t.attrDimIdx>=0?i=e=>{var n;return null==e||null===(n=e.qAttrDims)||void 0===n?void 0:n.qValues[t.attrDimIdx]}:t.attrIdx>=0&&(i=e=>{var n;return null==e||null===(n=e.qAttrExps)||void 0===n?void 0:n.qValues[t.attrIdx]}),{nodeFn:r,attrFn:i,valueFn:n}}function Un(e,t,n){let{key:i}=n;const r={value:"function"==typeof e.value?e.value(t):void 0!==e.value?e.value:t};return r.label="function"==typeof e.label?e.label(t):void 0!==e.label?String(e.label):String(r.value),e.field&&(r.source={key:i,field:e.field.key()}),r}function Yn(e){let{propsArr:t,props:n,item:i,itemData:r,ret:o,sourceKey:a}=e;for(let e=0;e<t.length;e++){const s=n[t[e]],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,m,g,y;if("primitive"===h.type?(p=h.value,y=String(h.value)):("function"==typeof h.value&&(d=e=>h.value(e,i)),"function"==typeof h.label&&(f=e=>h.label(e,i)),h.accessor?(m=h.accessor(i),Array.isArray(m)?(g=m.map(h.valueAccessor),h.attrAccessor&&(g=g.map(h.attrAccessor)),d&&(p=g.map(d),d=null),f&&(y=g.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(m)):h.valueAccessor(m),y=p)):(p=r,y=r)),s.fields){const e=d?d(p):p;c.push(e),u.push(f&&null!=y?f(y):null!=y?y:String(e))}else{const n=d?d(p):p;o[t[e]]={value:n,label:f?f(y):null!=y?y:String(n)},h.field&&(o[t[e]].source={field:h.field.key(),key:a})}}c&&(o[t[e]]={value:"function"==typeof s.value?s.value(c,i):c,label:"function"==typeof s.label?s.label(u,i):u})}}const Gn=(e,t,n)=>{const i="K"===e.qMode?"/qStackedDataPages/*/qData":"/qTreeDataPages/*",r="K"===e.qMode?"qSubNodes":"qNodes",o=Ln(i,e);return o&&o[0]?(t.tree=wn(o[0],n.children||(e=>e[r])),t.tree):null};const Xn=e=>{let{propsArr:t,props:n,cube:i,cache:r,itemDepthObject:o,f:a}=e;for(let e=0;e<t.length;e++){const s=n[t[e]],l=s.fields?s.fields:[s];for(let e=0;e<l.length;e++){const t=l[e];if(t.field!==a){const e=Wn(o,$n(t.field,{cube:i,cache:r}));t.accessor=e.nodeFn,t.valueAccessor=e.valueFn,t.attrAccessor=e.attrFn}}}};function Kn(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=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=t.raw(),o=t.key(),a="S"===r.qMode?function(e){const t=e.raw().qDataPages.length?e.raw().qDataPages[0].qMatrix:[],n=function(e){const t=e.raw().qColumnOrder,n=e.fields();return t&&t.length===n.length?t:n.map(((e,t)=>t))}(e),i=e.fields(),r=e.fields().filter((e=>"dimension"===e.type())).map((e=>n.indexOf(i.indexOf(e)))),o=e.fields().filter((e=>"measure"===e.type())).map((e=>n.indexOf(i.indexOf(e)))),a={__root:{__id:"__root",qValues:[]}};for(let e=0;e<t.length;e++){const n=t[e];let i="__root",l=!1;for(let e=0;e<r.length;e++){var s;const t=n[r[e]],o="".concat(i,"__").concat(null!==(s=t.qElemNumber)&&void 0!==s?s:t.qElemNo);a[o]||(a[o]=an({__id:o,__parent:i,qValues:[]},t),l=!0),i=o}if(l)for(let e=0;e<o.length;e++){const t=n[o[e]];a[i].qValues.push(t)}}const l=Object.keys(a).map((e=>a[e]));return In().id((e=>e.__id)).parentId((e=>e.__parent))(l)}(t):Gn(r,n,e);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 e=Hn(r)[o-1];a=n.fields[e]}else{let e=r.qEffectiveInterColumnSortOrder[o-1];o>r.qEffectiveInterColumnSortOrder.length&&(e=r.qDimensionInfo.length),a=n.fields[e]}const{props:s,main:c}=i.normalizeConfig(an(an({},e),{},{field:a?a.key():void 0}),t),u=Object.keys(s);l[o]={propsArr:u,props:s,main:c};const h=a?$n(a,{cube:r,cache:n}):{fieldDepth:0};Xn({propsArr:u,props:s,cube:r,cache:n,itemDepthObject:h,f:a})}const c=a.copy().descendants(),u=a.descendants();for(let e=0;e<u.length;e++){const t=l[u[e].depth].propsArr,n=l[u[e].depth].props,i=l[u[e].depth].main,r=c[e],a=r.data,s=Un(i,a,{key:o});Yn({propsArr:t,props:n,item:r,itemData:a,ret:s,sourceKey:o,isTree:!0}),u[e].data=s}return a}function Zn(e,t,n,i){const r=Array.isArray(e)?e:[e];let o=[];for(let a=0;a<r.length;a++)if(void 0!==r[a].field){const s=t.raw(),l=t.key();if(!Gn(s,n,e))continue;const c="object"==typeof r[a].field?r[a].field:t.field(r[a].field),{props:u,main:h}=i.normalizeConfig(r[a],t),d=Object.keys(u),f=$n(c,{cube:s,cache:n}),{nodeFn:p,attrFn:m,valueFn:g}=Wn({fieldDepth:0},f);Xn({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 e=0;e<w.length;e++){const t=w[e],n=m?m(g(t)):g(t);if(h.filter&&!h.filter(n))continue;const o=Un(h,n,{key:l});Yn({propsArr:d,props:u,item:t,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 Jn=function(e,t){return e(t={exports:{}},t.exports),t.exports}((function(e){
9
+ e.exports=function(e,t){if(!e||isNaN(+t))return t;var n,i,r,o,a,s,l,c,u,h,d=e.length,f=e.search(/[0-9\-\+#]/),p=f>0?e.substring(0,f):"",m=e.split("").reverse().join(""),g=m.search(/[0-9\-\+#]/),y=d-g,x=e.substring(y,y+1),v=y+("."===x||","===x?1:0),b=g>0?e.substring(v,d):"";if(n=(t="-"===(e=e.substring(f,v)).charAt(0)?-t:+t)<0?t=-t:0,r=(i=e.match(/[^\d\-\+#]/g))&&i[i.length-1]||".",o=i&&i[1]&&i[0]||",",e=e.split(r),t=+(t=t.toFixed(e[1]&&e[1].length))+"",s=e[1]&&e[1].lastIndexOf("0"),(!(c=t.split("."))[1]||c[1]&&c[1].length<=s)&&(t=(+t).toFixed(s+1)),u=e[0].split(o),e[0]=u.join(""),(a=e[0]&&e[0].indexOf("0"))>-1)for(;c[0].length<e[0].length-a;)c[0]="0"+c[0];else 0==+c[0]&&(c[0]="");if((t=t.split("."))[0]=c[0],l=u[1]&&u[u.length-1].length){for(m="",y=(h=t[0]).length%l,d=h.length,v=0;v<d;v++)m+=h.charAt(v),!((v-y+1)%l)&&v<d-l&&(m+=o);t[0]=m}return t[1]=e[1]&&t[1]?r+t[1]:"","0"!==(i=t.join(""))&&""!==i||(n=!1),p+(n?"-":"")+i+b}},qt({exports:{}});var zt="'Source Sans Pro', 'Arial', 'sans-serif'",Ft="#333333",jt="#595959",Vt="#737373",Bt="#cccccc",Ht="#e6e6e6";function $t(e){var t={};return[].concat(v(e),v([["","","color"],["object","","fontFamily"],["object","axis.label.name","color",jt],["object","axis.label.name","fontFamily",zt],["object","axis.label.name","fontSize","12px"],["object","axis.line.major","color",Bt],["object","axis.line.minor","color",Ht],["object","axis.title","color"],["object","axis.title","fontFamily",zt],["object","axis.title","fontSize","13px"],["object","grid.line.highContrast","color",Ht],["object","grid.line.major","color",Bt],["object","grid.line.minor","color",Ht],["object","label.value","color",jt],["object","label.value","fontFamily",zt],["object","label.value","fontSize","12px"],[!1,"label.value","darkColor",jt],[!1,"label.value","lightColor",Ht],["object","outOfRange","color","#999"],["object","legend.title","color",Ft],["object","legend.title","fontFamily",zt],["object","legend.title","fontSize","15px"],["object","legend.label","color",jt],["object","legend.label","fontFamily",zt],["object","legend.label","fontSize","13px"],["object","referenceLine.label.name","color",Ft],["object","referenceLine.label.name","fontFamily",zt],["object","referenceLine.label.name","fontSize","12px"],["object","referenceLine.outOfBounds","color",Ht],["object","referenceLine.outOfBounds","fontFamily",zt],["object","referenceLine.outOfBounds","fontSize","12px"],["object","referenceLine.outOfBounds","backgroundColor",Vt,function(e){return"transparent"===e?Vt:e}]])).reduce((function(e,n){var i="".concat(n[0],"-").concat(n[1],"-").concat(n[2],"}");return t[i]||(t[i]=!0,e.push(n)),e}),[]).sort((function(e,t){return(e[0].split?e[0].split(".").length:0)-(t[0].split?t[0].split(".").length:0)}))}var Wt=function(e){return e};function Ut(e){var t=e.theme,n=e.id,i=e.transform,r=e.extend,o=e.matrix,a={},s=i.reduce((function(e,t){var n=x(t,2),i=n[0],r=n[1];return e[i]=r,e}),{});return o.forEach((function(e){var i=x(e,5),r=i[0],o=i[1],l=i[2],c=i[3],u=i[4],h=void 0===u?function(e){return e}:u,d=function(e){var t=e.theme,n=e.base,i=e.path,r=e.attribute,o=e.defaultValue,a=void 0===o?void 0:o;if(!t||!1===n)return a;var s=t.getStyle(n,i,r);return void 0===s?a:s}({theme:t,base:"object"===r&&n?"".concat("object",".").concat(n):r,path:o,attribute:l,defaultValue:c}),f=(s["".concat(o,".").concat(l)]||Wt)(h(d));St(a,[o,l].filter(Boolean).join("."),f)})),r.forEach((function(e){var t=x(e,2),n=t[0],i=t[1];St(a,n,i)})),a}function Yt(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Gt,Xt={exports:{}};var Kt=(Gt||(Gt=1,self,Xt.exports=(()=>{var e={229:e=>{var t=Object.prototype.hasOwnProperty,n=Object.prototype.toString,i=Object.defineProperty,r=Object.getOwnPropertyDescriptor,o=function(e){return"function"==typeof Array.isArray?Array.isArray(e):"[object Array]"===n.call(e)},a=function(e){if(!e||"[object Object]"!==n.call(e))return!1;var i,r=t.call(e,"constructor"),o=e.constructor&&e.constructor.prototype&&t.call(e.constructor.prototype,"isPrototypeOf");if(e.constructor&&!r&&!o)return!1;for(i in e);return void 0===i||t.call(e,i)},s=function(e,t){i&&"__proto__"===t.name?i(e,t.name,{enumerable:!0,configurable:!0,value:t.newValue,writable:!0}):e[t.name]=t.newValue},l=function(e,n){if("__proto__"===n){if(!t.call(e,n))return;if(r)return r(e,n).value}return e[n]};e.exports=function e(){var t,n,i,r,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!=(t=arguments[d]))for(n in t)i=l(h,n),h!==(r=l(t,n))&&(p&&r&&(a(r)||(c=o(r)))?(c?(c=!1,u=i&&o(i)?i:[]):u=i&&a(i)?i:{},s(h,{name:n,newValue:e(p,u,r)})):void 0!==r&&s(h,{name:n,newValue:r}));return h}},645:(e,t)=>{(()=>{var e={229:e=>{var t=Object.prototype.hasOwnProperty,n=Object.prototype.toString,i=Object.defineProperty,r=Object.getOwnPropertyDescriptor,o=function(e){return"function"==typeof Array.isArray?Array.isArray(e):"[object Array]"===n.call(e)},a=function(e){if(!e||"[object Object]"!==n.call(e))return!1;var i,r=t.call(e,"constructor"),o=e.constructor&&e.constructor.prototype&&t.call(e.constructor.prototype,"isPrototypeOf");if(e.constructor&&!r&&!o)return!1;for(i in e);return void 0===i||t.call(e,i)},s=function(e,t){i&&"__proto__"===t.name?i(e,t.name,{enumerable:!0,configurable:!0,value:t.newValue,writable:!0}):e[t.name]=t.newValue},l=function(e,n){if("__proto__"===n){if(!t.call(e,n))return;if(r)return r(e,n).value}return e[n]};e.exports=function e(){var t,n,i,r,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!=(t=arguments[d]))for(n in t)i=l(h,n),h!==(r=l(t,n))&&(p&&r&&(a(r)||(c=o(r)))?(c?(c=!1,u=i&&o(i)?i:[]):u=i&&a(i)?i:{},s(h,{name:n,newValue:e(p,u,r)})):void 0!==r&&s(h,{name:n,newValue:r}));return h}}},n={};function i(t){var r=n[t];if(void 0!==r)return r.exports;var o=n[t]={exports:{}};return e[t](o,o.exports,i),o.exports}i.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return i.d(t,{a:t}),t},i.d=(e,t)=>{for(var n in t)i.o(t,n)&&!i.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},i.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),i.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var r={};(()=>{i.r(r),i.d(r,{default:()=>Ee});var e=i(229),t=i.n(e);const n=function(e,t,n){if(!t)return!1;var i,r=t.split("."),o=r[r.length-1],a=e;for(i=0;i<r.length-1;++i)void 0===a[r[i]]&&(a[r[i]]=Number.isNaN(+r[i+1])?{}:[]),a=a[r[i]];if(void 0!==n){var s=a[o];return a[o]=n,{updated:n,previous:s}}return delete a[o],!1},o=function(e,t,n){var i,r=t.split("."),o=e;if(void 0===o)return n;for(i=0;i<r.length;++i){if(void 0===o[r[i]])return n;o=o[r[i]]}return o},a={EXPRESSIONS:{observed:"",trend:"STL_Trend",seasonal:"STL_Seasonal",residual:"STL_Residual"},OPTIONS:[{value:"observed",translation:"cao.trendDecomposition.parameters.decomposition.observed"},{value:"trend",translation:"cao.trendDecomposition.parameters.decomposition.trend"},{value:"seasonal",translation:"cao.trendDecomposition.parameters.decomposition.seasonal"},{value:"residual",translation:"cao.trendDecomposition.parameters.decomposition.residual"}]};var s="".concat(" ","(").concat(" "),l="".concat(" ",")").concat(" ");function c(e){return s+e+l}function u(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(e.qLibraryId){var n=function(e,t){if(!t)return null;var n,i;for(n=0;n<t.length;n++)if((i=t[n]).qInfo.qId===e)return i;return null}(e.qLibraryId,t.dimensionList);return n&&n.qData.info[0].qTags.indexOf("$numeric")>-1}var i=function(e,t){if(!t)return null;var n,i,r=function(e){var t=e.trim();"="===t.charAt(0)&&(t=(t=t.substring(1)).trim());var n=t.length-1;return"["===t.charAt(0)&&"]"===t.charAt(n)&&(t=(t=t.substring(1,n)).trim()),t}(e);for(n=0;n<t.length;n++){if((i=t[n]).qName===r)return i;if(i.qDerivedFieldData)for(var o=0;o<i.qDerivedFieldData.qDerivedFieldLists.length;++o)for(var a=i.qDerivedFieldData.qDerivedFieldLists[o],s=0;s<a.qFieldDefs.length;++s){var l=a.qFieldDefs[s];if(l.qName===r)return l}}return null}(e.qDef.qFieldDefs[0],t.fieldList);return i&&i.qTags.indexOf("$numeric")>-1}function h(e){return!(!e.fullAccumulation&&!e.fullRange)}function d(e,t){var n=e.crossAllDimensions;return 2===t&&n?"RowNo(Total)":"RowNo()"}function f(e){var t=function(e){return e?(e=function(e){return e.replace(/\/\*[^]*?\*\//g,"")}(e=function(e){return e.replace(/\/\/(.*)$/gm,"")}(e))).trim():""}(e),n=t.trim();return"="===n.substring(0,1)?n.substring(1).trim():n}function p(){return"[$(=Replace(GetObjectField(".concat(arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,"),']',']]'))]")}function m(e,t){var n=e.crossAllDimensions;return 2===t&&n?"Above(Total ":"Above("}function g(e){return void 0===e?")":", 0, ".concat(e,")")}function y(e){return"Replace(Replace(".concat(e,",'''',''''''),'$','$''&''')")}function x(e,t){return e?"".concat(t,'={">=$(=Min(').concat(t,"))<=$(=Max(").concat(t,'))"}'):"".concat(t,'={"=Only({1}').concat(t,")>='$(=").concat(y("MinString(".concat(t,")")),")' and Only({1}").concat(t,")<='$(=").concat(y("MaxString(".concat(t,")")),")'\"}")}function v(e){var t=e.modifier,n=void 0===t?{}:t,i=e.dimensions,r=e.dimensionAndFieldList,o=e.funcComp,a=void 0===o?"Sum":o,s=e.valueComp,l=void 0===s?"0":s;if(!n.showExcludedValues)return"";if(i&&1===i.length){var c=x(u(i[0],r),p(0));return"".concat(a,"({1<").concat(c,">}").concat(l,")")}if(i&&2===i.length){var h=u(i[0],r),d=u(i[1],r),f=p(0),m=p(1),g=x(h,f),y=x(d,m);return"".concat(a,"({1<").concat(g,",").concat(y,">}").concat(l,")")}return"".concat(a,"({1}").concat(l,")")}function b(e){return"".concat(e,"(")}function w(e){var t=e.properties,n=e.layout;return o(t,"qHyperCubeDef.qDimensions",o(n,"qHyperCube.qDimensionInfo",[])).length}const M={isFullRange:h,getNumDimensions:w,getExpressionWithExcludedComp:function(e){var t=e.expression,n=e.modifier,i=e.dimensions,r=e.dimensionAndFieldList,o=e.treatMissingAsNull,a=c(f(t));if(!n.showExcludedValues)return a;var s=v({modifier:n,dimensions:i,dimensionAndFieldList:r}),l=o?"":", 0";if(i&&1===i.length){var u=p(0);return"If(Count(".concat(u,") > 0, ").concat(a," + ").concat(s).concat(l,")")}if(i&&2===i.length){var h=p(0),d=p(1);return"If(Count(".concat(h,") * Count(").concat(d,") > 0, ").concat(a," + ").concat(s).concat(l,")")}return a},getRowNoComp:d,getNumStepComp:function(e,t){if(!h(e)){var n=e.steps;return"number"!=typeof n||Number.isNaN(n)?6:n}return d(e,t)},getAboveCompPrefix:m,getAboveCompSuffix:g,getAboveComp:function(e,t,n,i){return m(e,t)+n+g(i)},getFunctionPrefix:b,getFunctionSuffix:function(){return")"},getRangeComp:function(e,t){return b(e)+t+")"},getAggrComp:function(e,t,n){return"Aggr(".concat(e,", ").concat(t,", ").concat(n,")")},getExcludedComp:v,needDimension:function(e){var t=e.modifier,n=e.properties,i=e.layout,r=function(e){return void 0===e.primaryDimension?e.accumulationDimension:e.primaryDimension}(t);return 0===r&&2===w({properties:n,layout:i})},getDimComp:function(e,t){var n=function(e){return e[arguments.length>1&&void 0!==arguments[1]?arguments[1]:0].qDef.qSortCriterias[0]}(e,t),i=p(t);if(!n.qSortByExpression&&!n.qSortByNumeric&&!n.qSortByAscii)return i;var r=["Descending","Ascending"],o=n.qSortByNumeric?"(Numeric, ".concat(r[(n.qSortByNumeric+1)/2],")"):"",a=n.qSortByAscii?"(Text, ".concat(r[(n.qSortByAscii+1)/2],")"):"";return n.qSortByNumeric&&n.qSortByAscii?"(".concat(i,", ").concat(o,", ").concat(a,")"):n.qSortByNumeric?"(".concat(i,", ").concat(o,")"):n.qSortByAscii?"(".concat(i,", ").concat(a,")"):i},simplifyExpression:f,extractInputExpression:function(e){var t=e.outputExpression;if(e.modifier){var n=t.indexOf(s);if(-1!==n){var i=t.indexOf(l);if(-1!==i)return t.substring(n+s.length,i)}}},initModifier:function(e,t){Object.keys(t).forEach((function(n){void 0===e[n]&&(e[n]=t[n])}))},isNumeric:u,isApplicable:function(e){var t=e.properties,n=e.layout,i=e.minDimensions,r=void 0===i?1:i,o=e.maxDimensions,a=void 0===o?2:o;if(!t&&!n)return!0;var s=w({properties:t,layout:n});return s>=r&&s<=a},getExpressionWithMarkers:c,canExtract:function(e){var t=e.indexOf(s),n=e.indexOf(l);return t>-1&&n>-1&&t<n},getDimDefWithWrapper:p,getFieldWithWrapper:function(e){var t=e?e.replace(/]/g,"]]"):e;return"[".concat(t,"]")},generateTSDExpression:function(e,t,n){var i=t||e.outputExpression;if(e.base&&e.base.qDef&&(i=t!==e.base.qDef?t:e.base.qDef),"observed"!==e.decomposition){var r=n.qHyperCubeDef.qMeasures.find((function(t){return t.qDef.base&&t.qDef.base.qLibraryId&&e.base&&e.base.qLibraryId?t.qDef.base.qLibraryId===e.base.qLibraryId:null}));r&&t!==r.qDef.qLabel&&(i=r.qLibraryId||r.qDef.base.qLibraryId?"[".concat(r.qDef.qLabel,"]"):r.qDef.base.qDef);var o=function(e){var t=a.OPTIONS.find((function(t){return t.value===e.decomposition}));return t?a.EXPRESSIONS[t.value]:""}(e);i=i.startsWith("=")?i.substr(1):i,i="".concat(o,"(").concat(i,", ").concat(e.steps,")")}return i},getDecomposition:function(e){var t="observed";return Object.values(a.EXPRESSIONS).find((function(n){var i=e.qDef.base.qDef.toLowerCase()||e.qDef.qDef.toLowerCase();return a.EXPRESSIONS[n]&&i.includes(a.EXPRESSIONS[n].toLowerCase())&&(t=n),n})),t}};function k(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,i=new Array(t);n<t;n++)i[n]=e[n];return i}function S(e){return S="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},S(e)}var _=t().bind(null,!0),q={},D=Array.isArray;function A(e){return null!=e&&!Array.isArray(e)&&"object"===S(e)}function C(e){return void 0===e}function N(e,t){return"function"==typeof e[t]||"$$"===t.substring(0,2)||"_"===t.substring(0,1)}function E(e,t){var n,i=t.substring(1).split("/").slice(0,-1);return i.forEach((function(t,r){if(r!==i.length){n=+t;var o=Number.isNaN(n)?{}:[];e[n||t]=C(e[n||t])?o:e[t],e=e[n||t]}})),e}function R(e,t){var n=!0;if(A(e)&&A(t))return Object.keys(e).length===Object.keys(t).length&&(Object.keys(e).forEach((function(i){R(e[i],t[i])||(n=!1)})),n);if(D(e)&&D(t)){if(e.length!==t.length)return!1;for(var i=0,r=e.length;i<r;i+=1)if(!R(e[i],t[i]))return!1;return!0}return e===t}q.generate=function(e,t,n){n=n||"";var i=[];return Object.keys(t).forEach((function(r){var o=function(e){return e?_({},{val:e}).val:e}(t[r]),a=e[r],s="".concat(n,"/").concat(r);R(o,a)||N(t,r)||(C(a)?i.push({op:"add",path:s,value:o}):A(o)&&A(a)?i=i.concat(q.generate(a,o,s)):D(o)&&D(a)?i=i.concat(function(e,t,n){var i=[],r=e.slice(),o=-1;function a(e,t,n){if(e[n]&&C(e[n].qInfo))return null;if(e[n]&&e[n].qInfo.qId===t)return n;for(var i=0,r=e.length;i<r;i+=1)if(e[i]&&e[i].qInfo.qId===t)return i;return-1}if(R(t,r))return i;if(!C(t[0])&&C(t[0].qInfo))return i.push({op:"replace",path:n,value:t}),i;for(var s=r.length-1;s>=0;s-=1)-1===(o=a(t,r[s].qInfo&&r[s].qInfo.qId,s))?(i.push({op:"remove",path:"".concat(n,"/").concat(s)}),r.splice(s,1)):i=i.concat(q.generate(r[s],t[o],"".concat(n,"/").concat(s)));for(var l=0,c=t.length;l<c;l+=1)-1===(o=a(r,t[l].qInfo&&t[l].qInfo.qId))?(i.push({op:"add",path:"".concat(n,"/").concat(l),value:t[l]}),r.splice(l,0,t[l])):o!==l&&(i.push({op:"move",path:"".concat(n,"/").concat(l),from:"".concat(n,"/").concat(o)}),r.splice(l,0,r.splice(o,1)[0]));return i}(a,o,s)):i.push({op:"replace",path:"".concat(n,"/").concat(r),value:o}))})),Object.keys(e).forEach((function(r){C(t[r])&&!N(e,r)&&i.push({op:"remove",path:"".concat(n,"/").concat(r)})})),i},q.apply=function(e,t){t.forEach((function(t){var n,i,r=E(e,t.path),o=t.path.split("/").splice(-1)[0],a=o&&Number.isNaN(+o)?r[o]:r[+o]||r,s=t.from?t.from.split("/").splice(-1)[0]:null;if("/"===t.path&&(r=null,a=e),"add"===t.op||"replace"===t.op)if(D(r))"-"===o&&(o=r.length),r.splice(+o,"add"===t.op?0:1,t.value);else if(D(a)&&D(t.value)){var l,c=t.value.slice();a.length=0,(l=a).push.apply(l,function(e){if(Array.isArray(e))return k(e)}(i=c)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(i)||function(e,t){if(e){if("string"==typeof e)return k(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?k(e,t):void 0}}(i)||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.")}())}else if(A(a)&&A(t.value))n=a,Object.keys(n).forEach((function(e){Object.getOwnPropertyDescriptor(n,e).configurable&&!N(n,e)&&delete n[e]})),_(a,t.value);else{if(!r)throw new Error("Patchee is not an object we can patch");r[o]=t.value}else if("move"===t.op){var u=E(e,t.from);D(r)?r.splice(+o,0,u.splice(+s,1)[0]):(r[o]=u[s],delete u[s])}else"remove"===t.op&&(D(r)?r.splice(+o,1):delete r[o])}))},q.clone=function(e){return _({},e)},q.createPatch=function(e,t,n){var i={op:e.toLowerCase(),path:n};return"move"===i.op?i.from=t:void 0!==t&&(i.value=t),i},q.updateObject=function(e,t){Object.keys(e).length?q.apply(e,q.generate(e,t)):_(e,t)};const I=q,O=function(e,n,i){if(!e)return Promise.resolve();var r=I.generate(n,i);return t()(!0,n,i),r&&r.length?(r=r.map((function(e){return{qOp:e.op,qValue:JSON.stringify(e.value),qPath:e.path}})),e.applyPatches(r,!0)):Promise.resolve()};var P="accumulation";function L(e,t){var n=o(e,t);if(n)for(var i=0;i<n.length;i++)if(n[i].type===P)return n[i]}function T(e,t){var n=function(e,t){var n=o(e,t);if(!n)return-1;for(var i=0;i<n.length;i++)if(n[i].type===P)return i;return-1}(e,t);return n>-1?"".concat(t,".").concat(n):t}var z={type:"accumulation",disabled:!1,accumulationDimension:0,crossAllDimensions:!1,showExcludedValues:!0,fullAccumulation:!1,steps:6,outputExpression:""};const F={translationKey:"properties.modifier.accumulation",needDimension:M.needDimension,isApplicable:function(e){var t=e.properties,n=e.layout;return M.isApplicable({properties:t,layout:n,minDimensions:1,maxDimensions:2})},generateExpression:function(e){var t=e.expression,n=e.modifier,i=e.properties,r=e.layout,a=e.numDimensions,s=e.dimensionAndFieldList;if(!n)return t;var l=a;void 0===l&&(l=M.getNumDimensions({properties:i,layout:r}));var c=o(i,"qHyperCubeDef.qDimensions",[]),u=M.getExpressionWithExcludedComp({expression:t,modifier:n,dimensions:c,dimensionAndFieldList:s}),h=M.getNumStepComp(n,l),d=M.getAboveComp(n,l,u,h),f=M.getRangeComp("RangeSum",d);if(M.needDimension({modifier:n,properties:i,layout:r})){var p=M.getDimComp(c,1),m=M.getDimComp(c,0),g=M.getAggrComp(f,p,m);f=n.showExcludedValues?M.getExcludedComp({modifier:n,dimensions:c,dimensionAndFieldList:s,valueComp:g}):g}return f},extractInputExpression:M.extractInputExpression,initModifier:function(e){M.initModifier(e,z)},enableTotalsFunction:function(){return!1},propertyPanelDef:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n={type:"items",items:{disclaimer:{component:"text",translation:t.disclaimer||"properties.modifier.accumulation.disclaimer",show:function(e,t){return!M.isApplicable({properties:t.properties})}},settings:{type:"items",items:{primaryDimension:{refFn:function(t){return"".concat(T(t,e),".accumulationDimension")},type:"integer",translation:t.primaryDimension||"properties.modifier.primaryDimension",title:{translation:t.primaryDimensionTooltip||"properties.modifier.accumulation.primaryDimension.tooltip"},component:"dropdown",schemaIgnore:!0,defaultValue:1,options:function(e,t){return t.layout.qHyperCube.qDimensionInfo.map((function(e,t){return{value:t,label:e.qGroupFallbackTitles[0]}}))},show:function(e,t){return t.layout.qHyperCube.qDimensionInfo.length>1}},crossAllDimensions:{refFn:function(t){return"".concat(T(t,e),".crossAllDimensions")},type:"boolean",translation:t.crossAllDimensions||"properties.modifier.crossAllDimensions",title:{translation:t.crossAllDimensionsTooltip||"properties.modifier.accumulation.crossAllDimensions.tooltip"},schemaIgnore:!0,defaultValue:!1,show:function(e,t){return t.layout.qHyperCube.qDimensionInfo.length>1}},fullRange:{refFn:function(t){return"".concat(T(t,e),".fullAccumulation")},type:"boolean",translation:t.range||"properties.modifier.range",component:"dropdown",schemaIgnore:!0,defaultValue:!1,options:[{value:!0,translation:t.rangeFull||"properties.modifier.range.full"},{value:!1,translation:t.rangeCustom||"properties.modifier.range.custom"}]},steps:{refFn:function(t){return"".concat(T(t,e),".steps")},type:"integer",translation:t.rangeSteps||"properties.modifier.range.steps",schemaIgnore:!0,defaultValue:6,change:function(t){var n=L(t,e);if(n){var i=n.steps;n.steps="number"!=typeof i||Number.isNaN(i)?6:Math.abs(i)}},show:function(t){var n=L(t,e);return n&&!n.fullAccumulation}},showExcludedValues:{refFn:function(t){return"".concat(T(t,e),".showExcludedValues")},type:"boolean",translation:t.showExcludedValues||"properties.modifier.showExcludedValues",schemaIgnore:!0,defaultValue:!0}},show:function(e,t){return M.isApplicable({properties:t.properties})}}},show:function(t,n,i){var r=i.ext.support.modifiers;if(!Array.isArray(r)||-1===r.indexOf(P))return!1;var o=L(t,e);return o&&!o.disabled}};return n}};var j="movingAverage";function V(e,t){var n=o(e,t);if(n)for(var i=0;i<n.length;i++)if(n[i].type===j)return n[i]}function B(e,t){var n=function(e,t){var n=o(e,t);if(!n)return-1;for(var i=0;i<n.length;i++)if(n[i].type===j)return i;return-1}(e,t);return n>-1?"".concat(t,".").concat(n):t}var H={type:"movingAverage",disabled:!1,primaryDimension:0,crossAllDimensions:!1,showExcludedValues:!0,fullRange:!1,steps:6,outputExpression:"",nullSuppression:!1};const $={translationKey:"properties.modifier.movingAverage",needDimension:M.needDimension,isApplicable:function(e){var t=e.properties,n=e.layout;return M.isApplicable({properties:t,layout:n,minDimensions:1,maxDimensions:2})},generateExpression:function(e){var t,n=e.expression,i=e.modifier,r=e.properties,a=e.layout,s=e.numDimensions,l=e.dimensionAndFieldList;if(!i)return n;var c=s;void 0===c&&(c=M.getNumDimensions({properties:r,layout:a}));var u=o(r,"qHyperCubeDef.qDimensions",[]),h=i.showExcludedValues&&i.nullSuppression,d=M.getExpressionWithExcludedComp({expression:n,modifier:i,dimensions:u,dimensionAndFieldList:l,treatMissingAsNull:h}),f=M.getNumStepComp(i,c),p=M.getAboveComp(i,c,d,f);if(i.nullSuppression)t=M.getRangeComp("RangeAvg",p);else{var m=M.getRangeComp("RangeSum",p),g=function(e,t){var n=M.getRowNoComp(e,t);if(!M.isFullRange(e)){var i=e.steps,r="number"!=typeof i||Number.isNaN(i)?6:i;return"RangeMin(".concat(r,", ").concat(n,")")}return n}(i,c);t="".concat(m," / ").concat(g)}var y=t;if(M.needDimension({modifier:i,properties:r,layout:a})){var x=M.getDimComp(u,1),v=M.getDimComp(u,0),b=M.getAggrComp(y,x,v);y=i.showExcludedValues?M.getExcludedComp({modifier:i,dimensions:u,dimensionAndFieldList:l,funcComp:"Only",valueComp:b}):b}return y},extractInputExpression:M.extractInputExpression,initModifier:function(e){M.initModifier(e,H)},enableTotalsFunction:function(){return!1},propertyPanelDef:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n={type:"items",items:{disclaimer:{component:"text",translation:t.disclaimer||"properties.modifier.movingAverage.disclaimer",show:function(e,t){return!M.isApplicable({properties:t.properties})}},settings:{type:"items",items:{primaryDimension:{refFn:function(t){return"".concat(B(t,e),".primaryDimension")},type:"integer",translation:t.primaryDimension||"properties.modifier.primaryDimension",title:{translation:t.primaryDimensionTooltip||"properties.modifier.movingAverage.primaryDimension.tooltip"},component:"dropdown",schemaIgnore:!0,defaultValue:1,options:function(e,t){return t.layout.qHyperCube.qDimensionInfo.map((function(e,t){return{value:t,label:e.qGroupFallbackTitles[0]}}))},show:function(e,t){return t.layout.qHyperCube.qDimensionInfo.length>1}},crossAllDimensions:{refFn:function(t){return"".concat(B(t,e),".crossAllDimensions")},type:"boolean",translation:t.crossAllDimensions||"properties.modifier.crossAllDimensions",title:{translation:t.crossAllDimensionsTooltip||"properties.modifier.movingAverage.crossAllDimensions.tooltip"},schemaIgnore:!0,defaultValue:!1,show:function(e,t){return t.layout.qHyperCube.qDimensionInfo.length>1}},fullRange:{refFn:function(t){return"".concat(B(t,e),".fullRange")},type:"boolean",translation:t.range||"properties.modifier.range",component:"dropdown",schemaIgnore:!0,defaultValue:!1,options:[{value:!0,translation:t.rangeFull||"properties.modifier.range.full"},{value:!1,translation:t.rangeCustom||"properties.modifier.range.custom"}]},steps:{refFn:function(t){return"".concat(B(t,e),".steps")},type:"integer",translation:t.rangeSteps||"properties.modifier.range.steps",schemaIgnore:!0,defaultValue:6,change:function(t){var n=V(t,e);if(n){var i=n.steps;n.steps="number"!=typeof i||Number.isNaN(i)?6:Math.abs(i)}},show:function(t){var n=V(t,e);return n&&!n.fullRange}},showExcludedValues:{refFn:function(t){return"".concat(B(t,e),".showExcludedValues")},type:"boolean",translation:t.showExcludedValues||"properties.modifier.showExcludedValues",schemaIgnore:!0,defaultValue:!0},nullSuppression:{refFn:function(t){return"".concat(B(t,e),".nullSuppression")},type:"boolean",translation:t.showNull||"properties.dimensions.showNull",schemaIgnore:!0,defaultValue:!1,inverted:!0}},show:function(e,t){return M.isApplicable({properties:t.properties})}}},show:function(t,n,i){var r=i.ext.support.modifiers;if(!Array.isArray(r)||-1===r.indexOf(j))return!1;var o=V(t,e);return o&&!o.disabled}};return n}};var W="timeSeriesDecomposition";function U(e,t){var n=o(e,t);if(n)for(var i=0;i<n.length;i++)if(n[i].type===W)return n[i]}function Y(e,t){var n=function(e,t){var n=o(e,t);if(!n)return-1;for(var i=0;i<n.length;i++)if(n[i].type===W)return i;return-1}(e,t);return n>-1?"".concat(t,".").concat(n):t}var G={type:"timeSeriesDecomposition",disabled:!1,decomposition:"",steps:2,outputExpression:""};const X={translationKey:"properties.modifier.timeSeriesDecomposition",needDimension:M.needDimension,isApplicable:function(e){var t=e.properties,n=e.layout;return M.isApplicable({properties:t,layout:n,minDimensions:1,maxDimensions:2})},generateExpression:function(e){var t=e.expression,n=e.modifier,i=e.properties;return n?M.generateTSDExpression(n,t,i):t},extractInputExpression:M.extractInputExpression,initModifier:function(e,t){M.initModifier(e,G),""===e.decomposition&&t&&(e.decomposition=M.getDecomposition(t))},propertyPanelDef:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n={type:"items",items:{disclaimer:{component:"text",translation:t.timeSeriesDecomposition||"properties.modifier.timeSeriesDecomposition",show:function(e,t){return!M.isApplicable({properties:t.properties})}},settings:{type:"items",items:{decomposition:{refFn:function(t){return"".concat(Y(t,e),".decomposition")},type:"string",translation:t.modifierTrendDecompositionDecomposition||"properties.modifier.trendDecomposition.decomposition",component:"dropdown",schemaIgnore:!0,defaultValue:t.trendDecompositionParametersDecompositionObserved||"cao.trendDecomposition.parameters.decomposition.observed",options:a.OPTIONS},steps:{refFn:function(t){return"".concat(Y(t,e),".steps")},type:"integer",translation:t.modifierTimeSeriesDecompositionPeriods||"properties.modifier.timeSeriesDecomposition.periods",schemaIgnore:!0,defaultValue:2,change:function(t,n){var i=U(t,e);if(i){var r=i.steps;i.steps="number"!=typeof r||Number.isNaN(r)?2:Math.abs(r),n.properties.qHyperCubeDef.qMeasures=n.properties.qHyperCubeDef.qMeasures.map((function(e){return e.qDef.modifiers.map((function(e){return"timeSeriesDecomposition"===e.type?e.steps=r:e.steps=e.steps,e})),e}))}},show:function(t){var n=U(t,e);return n&&!n.fullRange}}},show:function(e,t){return M.isApplicable({properties:t.properties})}}},show:function(t,n,i){var r=i.ext.support.modifiers;if(!Array.isArray(r)||-1===r.indexOf(W))return!1;var o=U(t,e);return o&&!o.disabled}};return n}};var K="difference";function Z(e,t){var n=o(e,t);if(n)for(var i=0;i<n.length;i++)if(n[i].type===K)return n[i]}function J(e,t){var n=function(e,t){var n=o(e,t);if(!n)return-1;for(var i=0;i<n.length;i++)if(n[i].type===K)return i;return-1}(e,t);return n>-1?"".concat(t,".").concat(n):t}var Q={type:"difference",disabled:!1,primaryDimension:0,crossAllDimensions:!1,showExcludedValues:!0,outputExpression:""};const ee={translationKey:"properties.modifier.difference",needDimension:M.needDimension,isApplicable:function(e){var t=e.properties,n=e.layout;return M.isApplicable({properties:t,layout:n,minDimensions:1,maxDimensions:2})},extractInputExpression:M.extractInputExpression,generateExpression:function(e){var t=e.expression,n=e.modifier,i=e.properties,r=e.layout,a=e.numDimensions,s=e.dimensionAndFieldList;if(!n)return t;var l=a;void 0===l&&(l=M.getNumDimensions({properties:i,layout:r}));var c=o(i,"qHyperCubeDef.qDimensions",[]),u=M.getExpressionWithExcludedComp({expression:t,modifier:n,dimensions:c,dimensionAndFieldList:s}),h=M.getAboveComp(n,l,u),d="".concat(u," - ").concat(h);if(M.needDimension({modifier:n,properties:i,layout:r})){var f=M.getDimComp(c,1),p=M.getDimComp(c,0),m=M.getAggrComp(d,f,p);d=n.showExcludedValues?M.getExcludedComp({modifier:n,dimensions:c,dimensionAndFieldList:s,funcComp:"Only",valueComp:m}):m}return d},initModifier:function(e){Object.keys(Q).forEach((function(t){void 0===e[t]&&(e[t]=Q[t])}))},enableTotalsFunction:function(){return!1},propertyPanelDef:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n={type:"items",items:{disclaimer:{component:"text",translation:t.disclaimer||"properties.modifier.difference.disclaimer",show:function(e,t){return!M.isApplicable({properties:t.properties})}},settings:{type:"items",items:{primaryDimension:{refFn:function(t){return"".concat(J(t,e),".primaryDimension")},type:"integer",translation:t.primaryDimension||"properties.modifier.primaryDimension",title:{translation:t.primaryDimensionTooltip||"properties.modifier.difference.primaryDimension.tooltip"},component:"dropdown",schemaIgnore:!0,defaultValue:1,options:function(e,t){return t.layout.qHyperCube.qDimensionInfo.map((function(e,t){return{value:t,label:e.qGroupFallbackTitles[0]}}))},show:function(e,t){return t.layout.qHyperCube.qDimensionInfo.length>1}},crossAllDimensions:{refFn:function(t){return"".concat(J(t,e),".crossAllDimensions")},type:"boolean",translation:t.crossAllDimensions||"properties.modifier.crossAllDimensions",title:{translation:t.crossAllDimensionsTooltip||"properties.modifier.difference.crossAllDimensions.tooltip"},schemaIgnore:!0,defaultValue:!1,show:function(e,t){return t.layout.qHyperCube.qDimensionInfo.length>1}},showExcludedValues:{refFn:function(t){return"".concat(J(t,e),".showExcludedValues")},type:"boolean",translation:t.showExcludedValues||"properties.modifier.showExcludedValues",schemaIgnore:!0,defaultValue:!0}},show:function(e,t){return M.isApplicable({properties:t.properties})}}},show:function(t,n,i){var r=i.ext.support.modifiers;if(!Array.isArray(r)||-1===r.indexOf(K))return!1;var o=Z(t,e);return o&&!o.disabled}};return n}};var te="normalization";function ne(e,t){var n=o(e,t);if(n)for(var i=0;i<n.length;i++)if(n[i].type===te)return n[i]}function ie(e,t){var n=function(e,t){var n=o(e,t);if(!n)return-1;for(var i=0;i<n.length;i++)if(n[i].type===te)return i;return-1}(e,t);return n>-1?"".concat(t,".").concat(n):t}function re(e,t){for(var n=0;n<e.length;n++)if(e[n].value===t)return n;return-1}var oe={type:"normalization",disabled:!1,primaryDimension:0,outputExpression:"",dimensionalScope:2,selectionScope:2};function ae(e){return 2===e?"{1}":""}function se(e,t,n){return 1===e?"{$<".concat(M.getFieldWithWrapper(t),"={'").concat(n,"'}>}"):""}function le(e,t){return 0===e&&t>1||2===e?"Total":""}function ce(e,t,n){return 0===e&&t>1?"<".concat(M.getDimDefWithWrapper(n),">"):""}const ue={translationKey:"properties.modifier.normalization",needDimension:function(){return!0},isApplicable:function(e){var t=e.properties,n=e.layout;return M.isApplicable({properties:t,layout:n,minDimensions:1,maxDimensions:2})},extractInputExpression:M.extractInputExpression,generateExpression:function(e){var t=e.expression,n=e.modifier,i=e.properties,r=e.layout,a=e.numDimensions,s=e.dimensionAndFieldList;if(!n)return t;var l=a;void 0===l&&(l=M.getNumDimensions({properties:i,layout:r}));var c=o(i,"qHyperCubeDef.qDimensions",[]),u=M.getExpressionWithExcludedComp({expression:t,modifier:n,dimensions:c,dimensionAndFieldList:s}),h=n.selectionScope,d=n.dimensionalScope;return function(e,t,n,i,r,o,a){var s=ae(t),l=se(t,n,i),c=""===s&&""===l?"":s||l,u=le(r,o),h=ce(r,o,a),d=function(e){for(var t=[],n=0;n<e;n++)t[n]=M.getDimDefWithWrapper(n);return t.join(", ")}(o);return"".concat(e,"/ Sum(").concat(c," ").concat(u).concat(h," Aggr(").concat(c," ").concat(e,", ").concat(d,"))")}(u,h,n.field,n.value,d,l,n.primaryDimension)},initModifier:function(e){Object.keys(oe).forEach((function(t){void 0===e[t]&&(e[t]=oe[t])}))},updateModifier:function(e,t){1===(t.qDimensions?t.qDimensions.length:0)&&0===e.dimensionalScope&&(e.dimensionalScope=2)},enableTotalsFunction:function(){return!0},propertyPanelDef:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n={type:"items",items:{disclaimer:{component:"text",translation:t.disclaimer||"properties.modifier.normalization.disclaimer",show:function(e,t){return!M.isApplicable({properties:t.properties})}},settings:{type:"items",items:{selectionScope:{refFn:function(t){return"".concat(ie(t,e),".selectionScope")},type:"string",translation:t.modifierSelectionScope||"properties.modifier.selectionScope",title:{translation:t.modifierSelectionScopeTooltip||"properties.modifier.selectionScope.tooltip"},component:"dropdown",schemaIgnore:!0,defaultValue:2,options:function(n){return function(e,t,n){var i=[{value:0,translation:t.selectionScopeCurrentSelection||"properties.modifier.selectionScope.currentSelection"},{value:1,translation:t.selectionScopeSpecificValue||"properties.modifier.selectionScope.selectAField"},{value:2,translation:t.selectionScopeTotal||"properties.modifier.selectionScope.total"}];return i=function(e,t){if(1===e){var n=re(t,0);t.splice(n,1)}return t}(ne(e,n).dimensionalScope,i),i}(n,t,e)}},field:{refFn:function(t){return"".concat(ie(t,e),".field")},type:"string",component:"expression-with-dropdown",translation:"Common.Field",defaultValue:"",dropdownOnly:!0,options:function(e,t,n){return n.app.getFieldList().then((function(e){return e.map((function(e){return{label:e.qName,value:e.qName}}))}))},show:function(t){return 1===ne(t,e).selectionScope}},value:{refFn:function(t){return"".concat(ie(t,e),".value")},type:"string",ref:"value",component:"string",translation:"properties.value",expression:"optional",show:function(t){return 1===ne(t,e).selectionScope}},dimensionalScope:{refFn:function(t){return"".concat(ie(t,e),".dimensionalScope")},type:"string",translation:t.modifierDimensionalScope||"properties.modifier.dimensionalScope",title:{translation:t.modifierDimensionalScopeTooltip||"properties.modifier.dimensionalScope.tooltip"},component:"dropdown",schemaIgnore:!0,defaultValue:2,supportTooltip:!0,options:function(n,i){return function(e,t,n,i){var r=t.layout.qHyperCube.qDimensionInfo.length,o=[{value:0,translation:n.dimensionalScopeOneDimension||"properties.modifier.dimensionalScope.respectOneDimension",tooltipTranslation:n.dimensionalScopeOneDimensionTooltip||"properties.modifier.dimensionalScope.respectOneDimension.tooltip"},{value:1,translation:n.dimensionalScopeAllDimensions||"properties.modifier.dimensionalScope.".concat(2===r?"respectAllDimensions":"respectDimension"),tooltipTranslation:n.dimensionalScopeAllDimensionsTooltip||"properties.modifier.dimensionalScope.".concat(2===r?"respectAllDimensions":"respectDimension",".tooltip")},{value:2,translation:n.dimensionalScopeDisregardAllDimensions||"properties.modifier.dimensionalScope.".concat(2===r?"disregardAllDimensions":"disregardDimension"),tooltipTranslation:n.dimensionalScopeDisregardAllDimensionsTooltip||"properties.modifier.dimensionalScope.".concat(2===r?"disregardAllDimensions":"disregardDimension",".tooltip")}];return o=function(e,t){if(e<2){var n=re(t,0);t.splice(n,1)}return t}(r,o),o=function(e,t){if(0===e){var n=re(t,1);t.splice(n,1)}return t}(ne(e,i).selectionScope,o),o}(n,i,t,e)}},primaryDimension:{refFn:function(t){return"".concat(ie(t,e),".primaryDimension")},type:"integer",translation:t.primaryDimension||"properties.modifier.primaryDimension",title:{translation:t.primaryDimensionTooltip||"properties.modifier.normalization.primaryDimension.tooltip"},component:"dropdown",schemaIgnore:!0,defaultValue:1,options:function(e,t){return t.layout.qHyperCube.qDimensionInfo.map((function(e,t){return{value:t,label:e.qGroupFallbackTitles[0]}}))},show:function(t,n){return 0===(ne(t,e).dimensionalScope||0)&&n.layout.qHyperCube.qDimensionInfo.length>1}}},show:function(e,t){return M.isApplicable({properties:t.properties})}}},show:function(t,n,i){var r=i.ext.support.modifiers;if(!Array.isArray(r)||-1===r.indexOf(te))return!1;var o=ne(t,e);return o&&!o.disabled}};return n},getDisregardSelectionComp:ae,getFieldSelectionComp:se,getTotalComp:le,getSelectedDimComp:ce};var he="qDef.base",de="qDef.qDef",fe="qDef.base.qDef",pe="qLibraryId",me="qDef.base.qLibraryId";const ge={getExpression:function(e){var t=o(e,fe);return void 0!==t?t:o(e,de)},getExpressionRef:function(e){return void 0!==o(e,fe)?fe:de},getLibraryIdRef:function(e){return o(e,me)?me:pe},getLibraryId:function(e){return o(e,me)||o(e,pe)},getLabelRef:function(e){return o(e,he)?"qDef.base.qLabel":"qDef.qLabel"},getLabelExpressionRef:function(e){return o(e,he)?"qDef.base.qLabelExpression":"qDef.qLabelExpression"}};var ye="qDef.qDef",xe="qDef.base.qDef",ve="qLibraryId",be="qDef.base.qLibraryId",we="qDef.qLabel",Me="qDef.qLabelExpression",ke="qDef.base.qLabel",Se="qDef.base.qLabelExpression",_e="qDef.qAggrFunc",qe="qDef.base.qAggrFunc",De={initBase:function(e,t){(t||De.isValid(e))&&(n(e,xe,o(e,ye)),n(e,be,o(e,ve)),n(e,ke,o(e,we)),n(e,Se,o(e,Me)))},restoreBase:function(e){De.isValid(e)&&(n(e,ye,o(e,xe)),n(e,ve,o(e,be)),n(e,we,o(e,ke)),n(e,Me,o(e,Se)),o(e,_e)&&o(e,qe)&&n(e,_e,o(e,qe)),delete e.qDef.base)},isValid:function(e){var t=o(e,xe),n=o(e,be);return void 0!==t||void 0!==n}};const Ae=De;function Ce(e){return Ce="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Ce(e)}var Ne={accumulation:F,movingAverage:$,difference:ee,normalization:ue,timeSeriesDecomposition:X};const Ee={modifiers:Ne,apply:Ie,applyModifiers:Oe,cleanUpMeasure:Pe,destroy:function(e){e&&Re[e.id]&&Re[e.id].masterItemSubscriber&&(Re[e.id].masterItemSubscriber&&Re[e.id].masterItemSubscriber.unsubscribe(),delete Re[e.id])},hasActiveModifiers:Le,getActiveModifier:Te,initBase:Ae.initBase,isSupportedModifiers:function(e){return Array.isArray(e)&&e.some((function(e){return Ne[e]}))},isApplicableSupportedModifiers:function(e){var t=e.modifierTypes,n=e.properties,i=e.layout;return Array.isArray(t)&&t.some((function(e){return Ne[e]&&Ne[e].isApplicable({properties:n,layout:i})}))},measureBase:ge,limitedSorting:function(e){var t=e.measures,n=e.properties,i=e.layout,r=!1,o=!1;return t.forEach((function(e){var t=je(e);Ye({modifiers:t,properties:n,layout:i})&&(r=!0,o=o||Je({modifiers:t,properties:n,layout:i}))})),r&&!o},ifEnableTotalsFunction:ze};var Re={};function Ie(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=e.model,i=e.properties,r=e.isSnapshot,a=void 0!==r&&r,s=e.masterItem,l=!1;Re[n.id]=Re[n.id]||{isFirstTime:!0};var c=Re[n.id].isFirstTime;if(Re[n.id].isFirstTime=!1,i&&"object"===Ce(i))return Oe({model:n,properties:i});var u=n?n.layout:void 0,h=o(u,"qSelectionInfo.qInSelections");if(a||h)return Promise.resolve(l);var d=o(u,"qHyperCube.qMeasureInfo"),f=Re[n.id].lastReloadTime;if(Re[n.id].lastReloadTime=o(n,"app.layout.qLastReloadTime"),Le({measures:d,layout:u})){var p=function(e){var t=e.measures,n=e.layout,i=e.lastReloadTime;return o(e.model,"app.layout.qLastReloadTime")!==i&&function(e){var t=e.measures,n=e.properties,i=e.layout;return!!Array.isArray(t)&&t.some((function(e){return Ue({measure:e,properties:n,layout:i})}))}({measures:t,layout:n})}({measures:d,layout:u,model:n,lastReloadTime:f});return p||function(e){var t=e.measures,n=e.layout,i=e.masterItem,r=e.isFirstTime;return!!Array.isArray(t)&&(r||i||t.some((function(e){return function(e){var t=e.measure,n=e.layout;return Ye({modifiers:je(t),layout:n})?!t.base:!!t.base}({measure:e,layout:n})})))}({measures:d,layout:u,masterItem:s,isFirstTime:c})?n.getEffectiveProperties().then((function(e){var i=t()(!0,{},e);Be(i);var r=Qe(i);return Ge({model:n}).then((function(t){return Xe({libraryIds:r,model:n}).then((function(r){return p&&function(e){var t=e.properties;Fe(t).forEach((function(e){return function(e){var t=e.measure;if(Ue({measure:t,properties:e.properties})){var n=0,i=t.qDef.modifiers;Array.isArray(i)&&i.forEach((function(e){if("object"===Ce(e)&&!e.disabled){if(n++,"object"!==Ce(Ne[e.type]))throw new Error('Modifier "'.concat(e.type,'" is not available'));if(n>1)throw new Error("More than 1 modifier on a measure! (not yet supported)");var i=Ne[e.type].extractInputExpression({outputExpression:t.qDef.qDef,modifier:e});void 0!==i&&$e(t)&&M.simplifyExpression(t.qDef.base.qDef)!==M.simplifyExpression(i)&&(t.qDef.base.qDef=i)}}))}}({measure:e,properties:t})}))}({properties:i}),Oe({model:n,oldProperties:e,properties:i,runUpdateIfChange:!0,masterItem:s,libraryItemsProps:r,dimensionAndFieldList:t})}))}))})):Promise.resolve(l)}return function(e){return!!Array.isArray(e)&&e.some((function(e){return"object"===Ce(e.base)}))}(d)?n.getEffectiveProperties().then((function(e){return function(e){var n=e.model,i=e.properties,r=Qe(i);return et({model:n,libraryIds:r}).then((function(){var e=t()(!0,{},i);return Fe(i).forEach((function(e){return Pe(e)})),Ze({oldProperties:e,newProperties:i,model:n})}))}({model:n,properties:e})})):Promise.resolve(l)}function Oe(e){var n=e.model,i=e.oldProperties,r=e.properties,a=e.measures,s=e.runUpdateIfChange,l=void 0!==s&&s,c=e.masterItem,u=e.libraryItemsProps,h=e.dimensionAndFieldList;void 0===i&&(i=l?t()(!0,{},r):r),Be(r);var d=Qe(r);return et({model:n,libraryIds:d,masterItem:c}).then((function(){return function(e){var n=e.measures,i=e.properties,r=e.model,a=e.libraryItemsProps,s=e.dimensionAndFieldList;if(n||(n=Fe(i)),!n.length)return Promise.resolve();if(!Le({measures:n,properties:i}))return n.forEach((function(e){return Pe(e)})),Promise.resolve();var l=a?void 0:Qe(i);return Ge({model:r,dimensionAndFieldList:s}).then((function(e){return Xe({libraryIds:l,model:r,libraryItemsProps:a}).then((function(r){n.forEach((function(n){Ye({modifiers:n.qDef.modifiers,properties:i})?(function(e){var n=e.measure,i=e.properties,r=e.libraryItemsProps,a=e.dimensionAndFieldList,s=0;Ae.isValid(n)||Ae.initBase(n,!0);var l=n.qDef,c=l.modifiers,u=l.base;Array.isArray(c)&&c.forEach((function(e){if("object"===Ce(e)&&!e.disabled){if(s++,"object"!==Ce(Ne[e.type]))throw new Error('Modifier "'.concat(e.type,'" is not available'));if(s>1)throw new Error("More than 1 modifier on a measure! (not yet supported)");Ne[e.type].initModifier(e,n);var l=n.qLibraryId||u&&u.qLibraryId;l?function(e){var n=e.measure,i=e.modifier,r=e.properties,o=e.dimensionAndFieldList,a=e.libraryItemsProps[e.libraryId],s=a.qMeasure.qDef,l=""===s?s:Ne[i.type].generateExpression({expression:s,modifier:i,properties:r,dimensionAndFieldList:o});i.outputExpression=l,n.qDef.qDef=i.outputExpression,(n.qDef.qLabel||a.qMeasure.qLabel)&&(n.qDef.qLabel=a.qMeasure.qLabel),(n.qDef.qLabelExpression||a.qMeasure.qLabelExpression)&&(n.qDef.qLabelExpression=a.qMeasure.qLabelExpression),n.qDef.quarantine&&n.qDef.quarantine.qNumFormat&&a.qMeasure.qNumFormat&&(n.qDef.qNumFormat=a.qMeasure.qNumFormat,n.qDef.isCustomFormatted=a.qMeasure.isCustomFormatted),delete n.qLibraryId,n.qDef.coloring=a.qMeasure.coloring,i.base=t()(!0,{},n.qDef.base)}({measure:n,modifier:e,libraryId:l,properties:i,libraryItemsProps:r,dimensionAndFieldList:a}):function(e){var n=e.measure,i=e.modifier,r=e.properties,o=e.dimensionAndFieldList;"function"==typeof Ne[i.type].updateModifier&&Ne[i.type].updateModifier(i,r.qHyperCubeDef);var a=ge.getExpression(n),s=""===a?a:Ne[i.type].generateExpression({expression:a,modifier:i,properties:r,dimensionAndFieldList:o});i.outputExpression=s,n.qDef.qDef=i.outputExpression,n.qDef.base.qLabelExpression?n.qDef.qLabelExpression=n.qDef.base.qLabelExpression:n.qDef.qLabel=n.qDef.base.qLabel||a,i.base=t()(!0,{},n.qDef.base)}({measure:n,modifier:e,properties:i,dimensionAndFieldList:a}),function(e){var t=o(e,"qDef.qAggrFunc");"Expr"!==t||ze(e)?"None"!==t?delete e.qDef.base.qAggrFunc:"None"===t&&ze(e)&&"Expr"===e.qDef.base.qAggrFunc&&(e.qDef.qAggrFunc="Expr",delete e.qDef.base.qAggrFunc):(e.qDef.qAggrFunc="None",e.qDef.base.qAggrFunc="Expr")}(n)}}))}({measure:n,properties:i,libraryItemsProps:r,dimensionAndFieldList:e}),He(n)):Pe(n)}))}))}))}({measures:a,properties:r,model:n,libraryItemsProps:u,dimensionAndFieldList:h}).then((function(){return l?Ze({oldProperties:i,newProperties:r,model:n}):Promise.resolve(!1)}))}))}function Pe(e){!function(e){var t=je(e);return Array.isArray(t)&&t.some((function(e){return"object"===Ce(e)&&!e.disabled&&!Ne[e.type]}))}(e)?Ae.restoreBase(e):delete e.qDef.base,e.qDef.coloring&&delete e.qDef.coloring,He(e)}function Le(e){var t=e.measures,n=e.properties,i=e.layout;return!!Array.isArray(t)&&t.some((function(e){return Ye({modifiers:je(e),properties:n,layout:i})}))}function Te(e){var t=je(e);if(Array.isArray(t))for(var n=0;n<t.length;n++){var i=t[n];if(Ne[i.type]&&!i.disabled)return i}}function ze(e){var t=Te(e);return!t||Ne[t.type].enableTotalsFunction(e)}function Fe(e){return o(e,"qHyperCubeDef.qMeasures",[]).concat(o(e,"qHyperCubeDef.qLayoutExclude.qHyperCubeDef.qMeasures",[]))}function je(e){return e.modifiers||e.qDef&&e.qDef.modifiers}function Ve(e){return o(e,"outputExpression.qValueExpression.qExpr")||o(e,"outputExpression")}function Be(e){Fe(e).forEach((function(e){return function(e){var n=Te(e);n&&(void 0!==n.outputExpression&&Ve(n)!==e.qDef.qDef?delete e.qDef.base:!Ae.isValid(e)&&n.base&&(e.qDef.base=t()(!0,{},n.base)))}(e)}))}function He(e){var t=je(e);Array.isArray(t)&&t.forEach((function(t){"object"===Ce(t)&&(t.disabled||!Ne[t.type]&&Ve(t)!==e.qDef.qDef)&&(t.disabled=!0,delete t.base)}))}function $e(e){return e.base||e.qDef&&e.qDef.base}function We(e){var t=$e(e);return e.qLibraryId||t&&t.qLibraryId}function Ue(e){var t=e.measure,n=e.properties,i=e.layout;return!We(t)&&Ye({modifiers:je(t),properties:n,layout:i})}function Ye(e){var t=e.modifiers,n=e.properties,i=e.layout,r={};return Array.isArray(t)&&t.some((function(e){return!("object"!==Ce(e)||e.disabled||!Ne[e.type])&&(void 0===r[e.type]&&(r[e.type]=Ne[e.type].isApplicable({properties:n,layout:i})),r[e.type])}))}function Ge(e){var t=e.model,n=e.dimensionAndFieldList;if(n)return Promise.resolve(n);var i=[],r={},o=t.app.getDimensionList().then((function(e){r.dimensionList=e}));i.push(o);var a=t.app.getFieldList().then((function(e){r.fieldList=e}));return i.push(a),Promise.all(i).then((function(){return r}))}function Xe(e){var t=e.libraryIds,n=e.model,i=e.libraryItemsProps;if(i)return Promise.resolve(i);var r=t.measureLibraryIds,o=t.dimensionLibraryIds,a={},s=[];return r.forEach((function(e){var t=n.app.getMeasure(e).then((function(t){return t.getProperties().then((function(t){a[e]=t}))}));s.push(t)})),o.forEach((function(e){var t=n.app.getDimension(e).then((function(t){return t.getProperties().then((function(t){a[e]=t}))}));s.push(t)})),Promise.all(s).then((function(){return a}))}function Ke(e,t){if(""!==t||-1===["qFmt","qDec","qThou"].indexOf(e))return t}function Ze(e){var t=e.oldProperties,n=e.newProperties,i=e.model,r=JSON.stringify(o(t,"qHyperCubeDef.qMeasures"),Ke)!==JSON.stringify(o(n,"qHyperCubeDef.qMeasures"),Ke)||JSON.stringify(o(t,"qHyperCubeDef.qLayoutExclude.qHyperCubeDef.qMeasures"),Ke)!==JSON.stringify(o(n,"qHyperCubeDef.qLayoutExclude.qHyperCubeDef.qMeasures"),Ke);return r?function(e){var t=e.model,n=e.oldProperties,i=e.newProperties,r=t.layout;return r&&!r.qHasSoftPatches&&!r.qExtendsId&&o(r,"qMeta.privileges",[]).indexOf("update")>-1?t.setProperties(i):O(t,n,i)}({model:i,oldProperties:t,newProperties:n}).then((function(){return r})):Promise.resolve(r)}function Je(e){var t=e.modifiers,n=e.properties,i=e.layout;return Array.isArray(t)&&t.some((function(e){return"object"===Ce(e)&&!e.disabled&&Ne[e.type]&&Ne[e.type].needDimension({modifier:e,properties:n,layout:i})}))}function Qe(e){var t=Fe(e),n=[],i=[],r=!1;return t.forEach((function(t){var i=je(t);if(Ye({modifiers:i,properties:e})){var o=We(t);o&&n.push(o),r=r||Je({modifiers:i,properties:e})}})),o(e,"qHyperCubeDef.qDimensions",[]).forEach((function(e){var t=e.qLibraryId;t&&i.push(t)})),{measureLibraryIds:n,dimensionLibraryIds:i}}function et(e){var t=e.model,n=e.libraryIds;return!e.masterItem&&n&&(n.measureLibraryIds.length||n.dimensionLibraryIds.length)?(Re[t.id].masterItemSubscriber=Re[t.id].masterItemSubscriber||function(e){var t=e.model,n=e.callback,i={},r={},a={},s={dimension:["qDim.qFieldDefs"],measure:["qMeasure.qDef","qMeasure.qLabel","qMeasure.qLabelExpression","qMeasure.coloring","qMeasure.qNumFormat","qMeasure.isCustomFormatted"]};function l(e){var t={},n=o(e,"qInfo.qType");return n&&s[n]&&s[n].forEach((function(n){t[n]=o(e,n)})),JSON.stringify(t)}function c(e){var t=e.qInfo.qId;if(i[t]){var r=l(e);i[t].properties!==r&&(i[t].properties=r,"function"==typeof n&&i[t].enabled&&n(e)),i[t].enabled=!0}}function u(e,n){return t.app[n](e).then((function(t){i[e]={listener:t.layoutSubscribe(c),enabled:!1,properties:l(t.layout)}}))}return{subscribe:function(e){var n=e.measureLibraryIds,o=e.dimensionLibraryIds,s=[];return function(e){var t=e.dimensionLibraryIds;r={},e.measureLibraryIds.forEach((function(e){r[e]=!0})),a={},t.forEach((function(e){a[e]=!0}))}({measureLibraryIds:n,dimensionLibraryIds:o}),Object.keys(i).forEach((function(e){r[e]||a[e]||(i[e].listener.dispose(),delete i[e])})),t.app&&(Object.keys(r).forEach((function(e){r[e]&&!i[e]&&s.push(u(e,"getMeasure"))})),Object.keys(a).forEach((function(e){a[e]&&!i[e]&&s.push(u(e,"getDimension"))}))),Promise.all(s)},unsubscribe:function(){Object.keys(i).forEach((function(e){i[e].listener.dispose()})),i={}}}}({model:t,callback:function(e){return Ie({model:t,masterItem:e}).then((function(){return t.app.clearUndoBuffer()}))}}),Re[t.id].masterItemSubscriber.subscribe(n)):Promise.resolve()}})(),t.default=r.default,Object.defineProperty(t,"__esModule",{value:!0})})()}},t={};function n(i){var r=t[i];if(void 0!==r)return r.exports;var o=t[i]={exports:{}};return e[i](o,o.exports,n),o.exports}n.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return n.d(t,{a:t}),t},n.d=(e,t)=>{for(var i in t)n.o(t,i)&&!n.o(e,i)&&Object.defineProperty(e,i,{enumerable:!0,get:t[i]})},n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t);var i={};return(()=>{function e(t){var n,i=t;return i>9?(n=65+i-10)>90&&(n+=6):i="".concat(i).charCodeAt(0),[48,111,79,105,73,108].indexOf(n)>-1?e(i+1):String.fromCharCode(n)}function t(n){var i=e(n%62),r=Math.floor(n/62);return r>0?t(r)+i:i}function r(e){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r(e)}n.d(i,{default:()=>Be});const o={getValue:function(e,t,n){if(null==e||null==t)return n;for(var i=t.split("."),r=e,o=0;o<i.length;++o){var a=i[o];if(""!==a){if(void 0===r[a]||null===r[a])return n;r=r[a]}}return r},setValue:function(e,t,n){if(null!=e&&null!=t){for(var i=t.split("."),r=i[i.length-1],o=e,a=0;a<i.length-1;++a){var s=i[a];void 0!==o[s]&&null!==o[s]||(o[s]=Number.isNaN(+i[a+1])?{}:[]),o=o[s]}void 0!==n?o[r]=n:delete o[r]}},isEmpty:function(e){return 0===Object.keys(e).length&&e.constructor===Object},isAtomicValue:function(e){return/boolean|number|string/.test(r(e))},generateId:function(){return t(Math.round(99e11*Math.random()+1e11)).replace(/\W/g,"")}};function a(e){return function(e){if(Array.isArray(e))return s(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(e){if("string"==typeof e)return s(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?s(e,t):void 0}}(e)||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(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,i=new Array(t);n<t;n++)i[n]=e[n];return i}function l(e){return function(e){if(Array.isArray(e))return c(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(e){if("string"==typeof e)return c(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?c(e,t):void 0}}(e)||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 c(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,i=new Array(t);n<t;n++)i[n]=e[n];return i}function u(e,t,n){if(e){for(var i=0;i<e.length;i++)if(e[i][t]===n)return i;return-1}return-1}const h={isOrderedSubset:function(e,t){if(!(e&&t&&e.length&&t.length))return!1;var n=e.indexOf(t[0]);if(-1!==n){for(var i=0;i<t.length;i++){var r=e.indexOf(t[i]);if(n>r)return!1;n=r}return!0}return!1},indexAdded:function(e,t){var n;for(n=0;n<e.length;++n)e[n]>=0&&e[n]>=t&&++e[n];e.push(t)},indexRemoved:function(e,t){var n,i=0;for(n=0;n<e.length;++n)e[n]>t?--e[n]:e[n]===t&&(i=n);return e.splice(i,1),i},findItemByPropertyValue:function(e,t,n){if(e){for(var i=0;i<e.length;i++)if(e[i][t]===n)return e[i];return null}return null},findIndexByPropertyValue:u};var d=n(645),f=n.n(d);const p=function(e){var t,n=e.exportFormat,i=e.qHyperCubeDef,r=n.data[0];(t=r.dimensions).push.apply(t,a(i.qDimensions));var s,l=o.getValue(i,"qLayoutExclude.qHyperCubeDef.qDimensions");l&&(s=r.excludedDimensions).push.apply(s,a(l))},m=function(e){var t,n=e.exportFormat,i=e.qHyperCubeDef,r=n.data[0];(t=r.measures).push.apply(t,l(i.qMeasures));var a,s=o.getValue(i,"qLayoutExclude.qHyperCubeDef.qMeasures");s&&(a=r.excludedMeasures).push.apply(a,l(s))},g=function(e){var t=e.exportFormat,n=e.qHyperCubeDef,i=t.data[0];n.qInterColumnSortOrder||(n.qInterColumnSortOrder=[]),i.interColumnSortOrder=n.qInterColumnSortOrder.concat();var r=o.getValue(n,"qLayoutExclude.qHyperCubeDef.qInterColumnSortOrder");r&&h.isOrderedSubset(r,i.interColumnSortOrder)&&(i.interColumnSortOrder=r.concat())},y=function(e){var t=e.exportFormat,n=e.properties;Object.keys(n).forEach((function(e){t.properties[e]=n[e]}))},x=function(e){var t=e.exportFormat,n=e.properties;n.qLayoutExclude||(n.qLayoutExclude={}),n.qLayoutExclude.disabled&&(Object.keys(n.qLayoutExclude.disabled).forEach((function(e){t.properties.hasOwnProperty(e)||(t.properties[e]=n.qLayoutExclude.disabled[e])})),delete n.qLayoutExclude.disabled),n.qLayoutExclude.changed&&(function(e){Object.keys(e.qLayoutExclude.changed).forEach((function(t){e.qLayoutExclude.changed[t].to===o.getValue(e,t)&&o.setValue(e,t,e.qLayoutExclude.changed[t].from)}))}(n),delete n.qLayoutExclude.changed),n.qLayoutExclude.quarantine&&!o.isEmpty(n.qLayoutExclude.quarantine)||delete n.qLayoutExclude},v=function(e){e.forEach((function(e){f().cleanUpMeasure(e),e.qDef.modifiers&&(e.store={modifiers:e.qDef.modifiers},delete e.qDef.modifiers)}))};function b(e,t,n){var i,r,a=o.getValue(e,t);if(!o.isAtomicValue(a))try{if((r=(r=(i=JSON.stringify(a)).match(/:\{/g))?r.length:0)>2)return;a=JSON.parse(i)}catch(e){return}o.getValue(e,"qLayoutExclude.quarantine")||o.setValue(e,"qLayoutExclude.quarantine",{});var s=o.getValue(e,"qLayoutExclude.quarantine");s[n]||(s[n]={}),s[n][t]=a}var w=n(229),M=n.n(w);function k(e,t){var n=M()(!0,{},t,e);return o.getValue(n,"qOtherTotalSpec.qOtherCounted")||o.setValue(n,"qOtherTotalSpec.qOtherCounted",{qv:"10"}),o.getValue(n,"qOtherTotalSpec.qOtherLimit")||o.setValue(n,"qOtherTotalSpec.qOtherLimit",{qv:"0"}),n.hasOwnProperty("othersLabel")||(n.othersLabel="Others"),n}function S(e,t){return M()(!0,{},t,e)}function _(e,t,n){return"function"==typeof e?e(t):Number.isNaN(+e)?n:e}var q=Math.pow(2,53)-1;function D(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,i=new Array(t);n<t;n++)i[n]=e[n];return i}function A(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,i=new Array(t);n<t;n++)i[n]=e[n];return i}const C=function(e,t,n){var i="masterobject"===o.getValue(t,"properties.qInfo.qType")?"masterobject":o.getValue(n,"qInfo.qType");o.setValue(e,"qInfo.qType",i),e.visualization=n.visualization},N=function(e,t,n){t.hasOwnProperty(e)&&(n[e]=t[e])},E=function(e,t,n,i){t.hasOwnProperty(e)?n[e]=t[e]:n[e]=i},R=function(){return{qDef:{autoSort:!0,cId:"",othersLabel:"Others"},qLibraryId:"",qNullSuppression:!1,qOtherLabel:"Others",qOtherTotalSpec:{qOtherLimitMode:"OTHER_GE_LIMIT",qOtherMode:"OTHER_OFF",qOtherSortMode:"OTHER_SORT_DESCENDING",qSuppressOther:!1}}},I=function(){return{qDef:{autoSort:!0,cId:"",numFormatFromTemplate:!0},qLibraryId:"",qTrendLines:[]}},O=function(e){var t,n=e.exportFormat,i=e.maxDimensions,r=e.minDimensions,o=e.newHyperCubeDef,a=e.defaultDimension,s=n.data[0];for(t=0;t<s.dimensions.length;++t){var l=k(s.dimensions[t],a);o.qDimensions.length<i?o.qDimensions.push(l):o.qLayoutExclude.qHyperCubeDef.qDimensions.push(l)}for(t=0;t<s.excludedDimensions.length;++t){var c=k(s.excludedDimensions[t],a);o.qDimensions.length<r?o.qDimensions.push(c):o.qLayoutExclude.qHyperCubeDef.qDimensions.push(c)}},P=function(e){var t,n=e.exportFormat,i=e.maxMeasures,r=e.minMeasures,o=e.newHyperCubeDef,a=e.defaultMeasure,s=n.data[0];for(t=0;t<s.measures.length;++t){var l=S(s.measures[t],a);o.qMeasures.length<i?o.qMeasures.push(l):o.qLayoutExclude.qHyperCubeDef.qMeasures.push(l)}for(t=0;t<s.excludedMeasures.length;++t){var c=S(s.excludedMeasures[t],a);o.qMeasures.length<r?o.qMeasures.push(c):o.qLayoutExclude.qHyperCubeDef.qMeasures.push(c)}},L=function(e){var t=e.exportFormat,n=e.dataDefinition,i=void 0===n?{}:n,r=t.data[0],o=i.dimensions||{max:0},a=i.measures||{max:0},s=_(a.max,r.dimensions.length,q),l=_(a.min,r.dimensions.length,0);return{maxDimensions:_(o.max,s,q),minDimensions:_(o.min,l,0),maxMeasures:s,minMeasures:l}},T=function(e){var t=e.exportFormat,n=e.newHyperCubeDef,i=t.data[0],r=n.qDimensions.length+n.qMeasures.length;n.qInterColumnSortOrder=i.interColumnSortOrder.concat();var o=n.qInterColumnSortOrder.length;if(o!==r)for(n.qLayoutExclude&&(n.qLayoutExclude.qHyperCubeDef.qInterColumnSortOrder=i.interColumnSortOrder.concat());o!==r;)o<r?(h.indexAdded(n.qInterColumnSortOrder,o),++o):(--o,h.indexRemoved(n.qInterColumnSortOrder,o))},z=function(e){var t=e.exportFormat,n=e.initialProperties,i=e.hypercubePath,r={qLayoutExclude:{disabled:{},quarantine:{}}};return Object.keys(t.properties).forEach((function(e){"qLayoutExclude"===e?t.properties[e].quarantine&&(r.qLayoutExclude.quarantine=M()(!0,{},t.properties[e].quarantine)):"qHyperCubeDef"===e&&i?o.setValue(r,"".concat(i,".qHyperCubeDef"),t.properties.qHyperCubeDef):n.hasOwnProperty(e)||-1!==["qMetaDef","descriptionExpression","labelExpression"].indexOf(e)||function(e,t){return"components"===t&&Array.isArray(e[t])&&e[t].some((function(e){return"general"===e.key}))}(t.properties,e)?r[e]=t.properties[e]:r.qLayoutExclude.disabled[e]=t.properties[e]})),null===(r=M()(!0,{},n,r)).components&&(r.components=[]),r},F=function(e){var t=e.exportFormat,n=e.maxDimensions,i=e.minDimensions,r=e.maxMeasures,o=e.minMeasures,a=t.data[0];return a.dimensions.length>n&&n>0||a.measures.length>r&&r>0||a.excludedDimensions.length>0&&a.dimensions.length+a.excludedDimensions.length>i||a.excludedMeasures.length>0&&a.measures.length+a.excludedMeasures.length>o||!r&&a.measures.length>0||!n&&a.dimensions.length>0},j=function(e){var t=e.exportFormat,n=e.maxDimensions,i=e.minDimensions,r=e.maxMeasures,o=e.minMeasures,a=e.newHyperCubeDef,s=t.data[0];a.qLayoutExclude||(a.qLayoutExclude={}),a.qLayoutExclude.qHyperCubeDef||(a.qLayoutExclude.qHyperCubeDef={}),(s.dimensions.length>n&&n>0||s.excludedDimensions&&s.excludedDimensions.length&&s.dimensions.length+s.excludedDimensions.length>i)&&(a.qLayoutExclude.qHyperCubeDef.qDimensions||(a.qLayoutExclude.qHyperCubeDef.qDimensions=[])),(s.measures.length>r&&r>0||s.excludedMeasures&&s.excludedMeasures.length&&s.measures.length+s.excludedMeasures.length>o)&&(a.qLayoutExclude.qHyperCubeDef.qMeasures||(a.qLayoutExclude.qHyperCubeDef.qMeasures=[])),!r&&s.measures.length&&(a.qLayoutExclude.qHyperCubeDef.qMeasures||(a.qLayoutExclude.qHyperCubeDef.qMeasures=[])),!n&&s.dimensions.length&&(a.qLayoutExclude.qHyperCubeDef.qDimensions||(a.qLayoutExclude.qHyperCubeDef.qDimensions=[]))},V=function(e){var t,n=e.newProperties,i=e.dataDefinition,r=e.hypercubePath;if(i.dimensions&&"function"==typeof i.dimensions.added){var a=o.getValue(n,r||"").qHyperCubeDef,s=function(e){if(Array.isArray(e))return D(e)}(t=a.qDimensions)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(t)||function(e,t){if(e){if("string"==typeof e)return D(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?D(e,t):void 0}}(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.")}();a.qDimensions=[],s.forEach((function(e){a.qDimensions.push(e),i.dimensions.added(e,n)}))}},B=function(e){var t,n=e.newProperties,i=e.dataDefinition,r=e.hypercubePath;if(i.measures&&"function"==typeof i.measures.added){var a=o.getValue(n,r||"").qHyperCubeDef,s=function(e){if(Array.isArray(e))return A(e)}(t=a.qMeasures)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(t)||function(e,t){if(e){if("string"==typeof e)return A(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?A(e,t):void 0}}(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.")}();a.qMeasures=[],s.forEach((function(e){a.qMeasures.push(e),i.measures.added(e,n)}))}},H=function(e){var t=e.measures,n=e.modifierTypes;t&&n&&f().isSupportedModifiers(n)&&t.forEach((function(e){e.store&&e.store.modifiers&&(e.qDef.modifiers=e.store.modifiers),delete e.store}))};function $(e,t){var n=o.getValue(e,"qLayoutExclude.quarantine",{})[t];return!!n&&(Object.keys(n).forEach((function(t){o.setValue(e,t,n[t])})),delete e.qLayoutExclude.quarantine[t],!0)}const W={exportProperties:function(e){var t=e.propertyTree,n=e.hypercubePath,i=e.viewDataMode,r=function(){for(var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1,t={data:[],properties:{}},n=0;n<e;++n)t.data.push({dimensions:[],measures:[],excludedDimensions:[],excludedMeasures:[],interColumnSortOrder:[]});return t}(),a=t.qProperty,s=o.getValue(a,n||""),l=s.qHyperCubeDef;return l.qInterColumnSortOrder||(l.qInterColumnSortOrder=[]),p({exportFormat:r,qHyperCubeDef:l}),m({exportFormat:r,qHyperCubeDef:l}),g({exportFormat:r,qHyperCubeDef:l}),delete l.qLayoutExclude,y({exportFormat:r,properties:a}),n&&(r.properties.qHyperCubeDef=l,delete s.qHyperCubeDef),x({exportFormat:r,properties:a}),i||v(r.properties.qHyperCubeDef.qMeasures),Array.isArray(r.properties.filters)&&(b(r.properties,"filters","storedFilters"),delete r.properties.filters),r.properties.qHyperCubeDef.qContextSetExpression&&(b(r.properties,"qHyperCubeDef.qContextSetExpression","storedFilters"),r.properties.qHyperCubeDef.qContextSetExpression=""),r.properties.qHyperCubeDef.qDynamicScript&&r.properties.qHyperCubeDef.qDynamicScript.length&&(b(r.properties,"qHyperCubeDef.qDynamicScript","dynamicScript"),r.properties.qHyperCubeDef.qDynamicScript=[]),r},importProperties:function(e){var t=e.exportFormat,n=e.initialProperties,i=void 0===n?{}:n,r=e.dataDefinition,a=void 0===r?{}:r,s=e.defaultPropertyValues,l=void 0===s?{}:s,c=e.hypercubePath,u=e.extension,h=e.supportedFilters,d=void 0===h||h,f=e.isHCModifierSupported,p=void 0===f||f,m={qChildren:[]},g=z({exportFormat:t,initialProperties:i,hypercubePath:c}),y=o.getValue(i,c||"").qHyperCubeDef,x=o.getValue(g,c||"").qHyperCubeDef,v=L({exportFormat:t,dataDefinition:a}),b=v.maxDimensions,w=v.minDimensions,M=v.maxMeasures,k=v.minMeasures,S=l.defaultDimension,_=void 0===S?R():S,q=l.defaultMeasure,D=void 0===q?I():q;x.qDimensions.length=0,x.qMeasures.length=0,F({exportFormat:t,maxDimensions:b,minDimensions:w,maxMeasures:M,minMeasures:k})&&j({exportFormat:t,maxDimensions:b,minDimensions:w,maxMeasures:M,minMeasures:k,newHyperCubeDef:x}),O({exportFormat:t,maxDimensions:b,minDimensions:w,newHyperCubeDef:x,defaultDimension:_}),P({exportFormat:t,maxMeasures:M,minMeasures:k,newHyperCubeDef:x,defaultMeasure:D}),V({newProperties:g,dataDefinition:a,hypercubePath:c}),B({newProperties:g,dataDefinition:a,hypercubePath:c}),T({exportFormat:t,newHyperCubeDef:x}),N("qMaxStackedCells",y,x),N("qNoOfLeftDims",y,x),E("qInitialDataFetch",y,x,[{qTop:0,qLeft:0,qWidth:0,qHeight:0}]),E("qMode",y,x,"S"),E("qReductionMode",y,x,"N"),E("qSortbyYValue",y,x),E("qIndentMode",y,x),E("qShowTotalsAbove",y,x),C(g,t,i),m.qProperty=g;var A=o.getValue(u||{},"support.modifiers");return H({measures:x.qMeasures,modifierTypes:A}),d&&$(m.qProperty,"storedFilters"),"S"===x.qMode&&p&&$(m.qProperty,"dynamicScript"),m}};var U={cellBackgroundColor:!0,cellForegroundColor:!0,colorByAlternative:!0,colorByExpression:!0,tooltip:!0,urlLabel:!0,url:!0};function Y(e,t,n,i){t=t||[];var r=u(e,i,n),o=u(t,i,n);if(-1!==r&&-1===o){var a=e.splice(r,1);t.push(a[0])}return t}function G(e,t){return e.length!==t}const X={create:function(e,t){if(!e||!U[e])throw new Error("Attribute Expressions Util: ID required");var n={};return t&&Object.keys(t).forEach((function(e){n[e]=t[e]})),n.id=e,n.qAttribute=!0,n},moveByIdFromGroup:function(e,t,n,i,r){n=n||"qAttributeExpressions",r=r||"id";for(var o=0;o<e.length;o++){var a=e[o][n],s=t.length;if(Y(a,t,i,r),G(t,s))return t}return t},IDMAP:{CELL_BACKGROUND_COLOR:"cellBackgroundColor",CELL_FOREGROUND_COLOR:"cellForegroundColor",COLOR_BY_ALTERNATIVE:"colorByAlternative",COLOR_BY_EXPRESSION:"colorByExpression",TOOLTIP:"tooltip",CELL_LINK_LABEL:"urlLabel",CELL_LINK_URL:"url"}},K={getNumDimensions:function(e){return o.getValue(e,"qHyperCubeDef.qDimensions.length",0)},getNumMeasures:function(e){return o.getValue(e,"qHyperCubeDef.qMeasures.length",0)},wrapFieldName:function(e){return e.split(" ").length>1&&"="!==e[0]&&"["!==e[0]?"[".concat(e,"]"):e},getItemLabel:function(e){return e.label||e.name}},Z={colorModeOptions:{primary:function(){return!0},dimension:function(e){return K.getNumDimensions(e)>0&&K.getNumMeasures(e)<=1},multiColor:function(e){return K.getNumMeasures(e)>1},measure:function(e){return K.getNumDimensions(e)>0},expression:function(e){return K.getNumMeasures(e)>=1}}},J={colorModeOptions:{primary:function(){return!0},dimension:function(){return!0},multiColor:function(){return!1},measure:function(){return!0},expression:function(e){return K.getNumMeasures(e)>=1}}};var Q={scatterplot:J,"sn-scatter-plot":J,piechart:{colorModeOptions:{primary:function(){return!0},dimension:function(){return!0},multiColor:function(){return!1},measure:function(){return!0},expression:function(e){return K.getNumMeasures(e)>=1}}},linechart:{colorModeOptions:{primary:function(){return!0},dimension:function(e){return K.getNumDimensions(e)>1},multiColor:function(e){return K.getNumMeasures(e)>1},measure:function(e){return K.getNumDimensions(e)<=1},expression:function(e){return K.getNumMeasures(e)>=1}}},map:{colorModeOptions:{primary:function(){return!0},dimension:function(e){return K.getNumDimensions(e)>=1},multiColor:function(e){return K.getNumMeasures(e)>1},measure:function(e){return K.getNumDimensions(e)>=1},expression:function(e){return K.getNumDimensions(e)>=1}}},distributionplot:{colorModeOptions:{primary:function(){return!0},dimension:function(){return!0},multiColor:function(){return!1},measure:function(){return!0},expression:function(e){return K.getNumDimensions(e)>=1}}}};function ee(e,t,n){if(Array.isArray(e[t])){var i=h.findIndexByPropertyValue(e[t],"id",n);i>=0&&e[t].splice(i,1)}else e[t]=[]}function te(e,t){var n=X.IDMAP.COLOR_BY_ALTERNATIVE;e.forEach((function(e){ee(e,"qAttributeDimensions",n),ee(e,"qAttributeExpressions",n)})),t.forEach((function(e){ee(e,"qAttributeDimensions",n),ee(e,"qAttributeExpressions",n)}))}function ne(e,t){if(t){var n="="===t.charAt(0);e.color.altLabel=n?{qStringExpression:{qExpr:t.substr(1)}}:t}}function ie(e){var t=e.properties,n=e.isDimension,i=e.dimensions,r=e.excludedDimensions,a=e.measures,s=e.label;te(i,r);var l=i[i.length-1];if(l){var c=n?o.getValue(t,"color.byDimDef"):o.getValue(t,"color.byMeasureDef"),u=o.getValue(t,"color.formatting.qNumFormat"),d=o.getValue(t,"color.formatting.isCustomFormatted");if(c){var f=X.create(X.IDMAP.COLOR_BY_ALTERNATIVE);switch(c.type){case"expression":!function(e){var t=e.attributeExpression,n=e.label,i=e.item,r=e.isDimension,o=e.qNumFormat,a=e.isCustomFormatted;t.label=n||i.label,r?t.qDef=i.key:(t.qExpression=i.key,o&&(t.qNumFormat=o,t.isCustomFormatted=a)),t.matchMeasure=i.activeMeasureIndex,t.label&&"="===t.label.charAt(0)&&(t.labelExpRef="color.altLabel")}({attributeExpression:f,label:s,item:c,isDimension:n,qNumFormat:u,isCustomFormatted:d});break;case"libraryItem":!function(e){var t=e.attributeExpression,n=e.measures,i=e.item,r=e.qNumFormat,o=e.isCustomFormatted;e.isDimension||(t.matchMeasure=h.findIndexByPropertyValue(n,"qLibraryId",i.key),r&&(t.qNumFormat=r,t.isCustomFormatted=o)),void 0!==i.expression?t.qExpression=i.expression:t.qLibraryId=i.key,t.colorMapRef=i.key}({attributeExpression:f,measures:a,item:c,isDimension:n,qNumFormat:u,isCustomFormatted:d})}n?(f.qSortBy={qSortByAscii:1},l.qAttributeDimensions.push(f)):l.qAttributeExpressions.push(f)}}}function re(e,t,n,i){var r,o,a,s={};switch(e){case"dimension":n.qLibraryId?(s.type="dimension",s.name=n.qLibraryId,s.id=n.qLibraryId):(s.type="field",t?(s.name=n.label||n.qDef,s.id=n.qDef):(s.name=n.qDef.qFieldDefs[0],s.label=(a=n.qDef).qLabelExpression?a.qLabelExpression:a.qFieldLabels&&a.qFieldLabels[0]?a.qFieldLabels[0]:a.qFieldDefs[0]));break;case"measure":r=function(e,t){return t?e.qLibraryId:f().measureBase.getLibraryId(e)}(n,t),r?(s.type="measure",s.name=r,s.id=r,o=function(e,t){return f().hasActiveModifiers({measures:[e]})&&t?e.qDef.qDef:void 0}(n,i),o&&(s.expression=o)):(s.type="expression",t?(s.name=n.label||n.qExpression,s.id=n.qExpression):(s.name=n.qDef.qDef,s.label=function(e){var t=e.qDef;return t.qLabelExpression?t.qLabelExpression:t.qLabel?t.qLabel:t.qDef}(n)));break;default:throw new Error('columnType should be "dimension" or "measure"')}return s}const oe={useMasterNumberFormat:function(e){e.quarantine={qNumFormat:e.qNumFormat||{},isCustomFormatted:e.isCustomFormatted||!1},e.qNumFormat=null,e.isCustomFormatted=void 0}};function ae(e,t,n,i){var r=n?"expression":t.type,o=e.color,a=o.mode,s=K.getItemLabel(t);switch(ne(e,s||""),r){case"field":a="byDimension",o.byDimDef={label:t.label||K.wrapFieldName(t.name),key:K.wrapFieldName(t.name),type:"expression",activeDimensionIndex:t.activeDimensionIndex};break;case"expression":a="byMeasure",o.byMeasureDef={label:n||s,key:n||t.name,type:"expression",activeMeasureIndex:t.activeMeasureIndex};break;case"dimension":a="byDimension",o.byDimDef={label:t.name,key:t.id,type:"libraryItem",activeDimensionIndex:t.activeDimensionIndex};break;case"measure":a="byMeasure",o.byMeasureDef={label:t.name,key:t.id,expression:t.expression,type:"libraryItem",activeMeasureIndex:t.activeMeasureIndex},o.formatting&&oe.useMasterNumberFormat(o.formatting)}i||(o.auto=!1,o.mode=a)}function se(e,t){var n=o.getValue(e,"".concat(t,"qDimensions"),[]),i=o.getValue(e,"".concat(t,"qMeasures"),[]),r=o.getValue(e,"".concat(t,"qLayoutExclude.qHyperCubeDef.qDimensions"),[]),a=o.getValue(e,"color.byDimDef");if(a&&ne(e,a.label),function(e){return!!(e&&e.activeDimensionIndex>-1)}(a))!function(e,t){var n=o.getValue(e,"".concat(t,"qDimensions"),[]),i=o.getValue(e,"color.byDimDef");i.activeDimensionIndex=Math.min(i.activeDimensionIndex,n.length-1);var r=re("dimension",!1,n[i.activeDimensionIndex]);r.activeDimensionIndex=i.activeDimensionIndex,ae(e,r)}(e,t);else if(function(e){return!e||!e.key}(a)&&function(e,t){var n=o.getValue(e,"".concat(t,"qDimensions"),[]),i=n[function(e,t,n){var i=o.getValue(t,"visualization"),r=n.split("."),a=Number(r[1]),s=o.getValue(t,"layers.".concat(a,".type"));return 2===e.length&&"map"===i&&"point"===s}(n,e,t)?0:n.length-1],r=X.IDMAP.COLOR_BY_ALTERNATIVE,a=h.findItemByPropertyValue(i.qAttributeDimensions,"id",r);return ae(e,re("dimension",!!a,a||i)),!!a}(e,t))return;ie({properties:e,isDimension:!0,dimensions:n,excludedDimensions:r,measures:i,label:o.getValue(e,"color.byDimDef.label")})}const le=function(e,t,n){o.setValue(e,t,n),o.isAtomicValue(n)&&function(e,t,n){var i=e.qLayoutExclude;i&&(i.changed||(i.changed={}),i.changed[t]={from:o.getValue(e,t),to:n})}(e,t,n)},ce=function(e,t){var n={primary:!0};if(e){var i=(Q[t]||Z).colorModeOptions||Z.colorModeOptions;n.byDimension=i.dimension(e),n.byMeasure=i.measure(e),n.byMultiple=i.multiColor(e),n.byExpression=i.expression(e)}return n},ue=function(e){var t=e.canColorBy,n=e.autoColor,i=e.colorMode,r=e.dimensions;return!(t[i]&&!n&&("byDimension"!==i&&"byMeasure"!==i||!r.length))},he=function(e,t){var n,i=o.getValue(e,"color.mode"),r=o.getValue(e,"color.auto"),a=o.getValue(e,"".concat(t,"qDimensions"),[]),s=o.getValue(e,"".concat(t,"qMeasures"),[]),l=o.getValue(e,"".concat(t,"qLayoutExclude.qHyperCubeDef.qDimensions"),[]);r?te(a,l):!(n={auto:r,colorMode:i,dimensions:a}).auto&&"byDimension"===n.colorMode&&n.dimensions.length>0?se(e,t):function(e){var t=e.auto,n=e.colorMode,i=e.dimensions,r=e.measures,a=e.properties,s=o.getValue(a,"visualization");return!(t||"byMeasure"!==n||!i.length||"map"!==s&&!r.length)}({auto:r,colorMode:i,dimensions:a,measures:s,properties:e})?function(e,t){var n=o.getValue(e,"".concat(t,"qDimensions"),[]),i=o.getValue(e,"".concat(t,"qMeasures"),[]),r=o.getValue(e,"".concat(t,"qLayoutExclude.qHyperCubeDef.qDimensions"),[]),a=o.getValue(e,"color.byMeasureDef");if(a&&ne(e,a.label),function(e){return!!(e&&e.activeMeasureIndex>-1)}(a))!function(e,t){var n=o.getValue(e,"".concat(t,"qMeasures"),[]),i=o.getValue(e,"color.byMeasureDef");if(i.activeMeasureIndex=Math.min(i.activeMeasureIndex,n.length-1),i.activeMeasureIndex>-1){var r=re("measure",!1,n[i.activeMeasureIndex],!0);r.activeMeasureIndex=i.activeMeasureIndex,ae(e,r)}}(e,t);else if(function(e,t){return(!e||!e.key)&&t.length>0}(a,i)&&function(e,t){var n=o.getValue(e,"".concat(t,"qDimensions"),[]),i=o.getValue(e,"".concat(t,"qMeasures"),[]),r=n[n.length-1],a=X.IDMAP.COLOR_BY_ALTERNATIVE,s=h.findItemByPropertyValue(r.qAttributeExpressions,"id",a);return ae(e,re("measure",!!s,s||i[0])),!!s}(e,t))return;ie({properties:e,isDimension:!1,dimensions:n,excludedDimensions:r,measures:i,label:o.getValue(e,"color.byMeasureDef.label")})}(e,t):function(e,t){var n=o.getValue(e,"color.mode"),i=o.getValue(e,"".concat(t,"qDimensions"),[]),r=o.getValue(e,"".concat(t,"qMeasures"),[]),a=o.getValue(e,"".concat(t,"qLayoutExclude.qHyperCubeDef.qDimensions"),[]);"byMultiple"===n&&r.length<2&&o.setValue(e,"color.mode","primary"),te(i,a)}(e,t)},de=function(e){e.forEach((function(e){e.qOtherTotalSpec&&"qTotalMode"in e.qOtherTotalSpec&&delete e.qOtherTotalSpec.qTotalMode}))},fe=function(e){var t=e.shouldUpdateColorBy,n=e.properties,i=o.getValue(n,"qHyperCubeDef.qMeasures",[]),r=o.getValue(n,"color.mode","");return!t&&"byExpression"===r&&i.length>0},pe=function(e){var t=o.getValue(e,"qHyperCubeDef.qMeasures.0.qAttributeExpressions",[]),n=o.getValue(e,"color.colorExpression","");t.splice(0,0,{qExpression:n,id:"colorByExpression"}),o.setValue(e,"qHyperCubeDef.qMeasures.0.qAttributeExpressions",t)},me=function(e){o.setValue(e,"color.mode","primary"),o.setValue(e,"color.auto",!0)},ge=function(e){var t=o.getValue(e,"qHyperCubeDef.qDimensions",[]),n=o.getValue(e,"color.persistent",!1);return t.length>1&&!n},ye={exportProperties:function(e){var t=e.propertyTree,n=e.hypercubePath,i=e.viewDataMode,r=W.exportProperties({propertyTree:t,hypercubePath:n,viewDataMode:i}),o=r.data[0],a=o.dimensions.concat(o.excludedDimensions),s=o.measures.concat(o.excludedMeasures),l=X.IDMAP,c=l.COLOR_BY_ALTERNATIVE,u=l.COLOR_BY_EXPRESSION;return X.moveByIdFromGroup(a,[],"qAttributeDimensions",c),X.moveByIdFromGroup(a,[],"qAttributeExpressions",c),X.moveByIdFromGroup(s,[],"qAttributeExpressions",u),r},importProperties:function(e){var t=e.exportFormat,n=e.initialProperties,i=e.dataDefinition,r=e.defaultPropertyValues,a=e.hypercubePath,s=e.extension,l=e.supportedFilters,c=e.isHCModifierSupported,u=W.importProperties({exportFormat:t,initialProperties:n,dataDefinition:i,defaultPropertyValues:r,hypercubePath:a,extension:s,supportedFilters:l,isHCModifierSupported:c}),h=u.qProperty,d=o.getValue(h,"visualization"),f=o.getValue(h,"qHyperCubeDef.qDimensions",[]),p=o.getValue(h,"color.mode",""),m=o.getValue(h,"color.auto",""),g=ce(h,d),y=ue({canColorBy:g,autoColor:m,colorMode:p,dimensions:f});return g[p]?fe({shouldUpdateColorBy:y,properties:h})&&pe(h):me(h),y&&he(h,"qHyperCubeDef."),ge(h)&&le(h,"color.persistent",!0),de(f),u}};var xe=["bar","marker","line"];const ve=function(e){var t=e.initialProperties,n=e.properties;t.measureAxis&&void 0===t.measureAxis.autoMinMax?$(n,"unsupportedAutoMinMax")||M()(n.measureAxis,t.measureAxis):$(n,"supportedAutoMinMax")||M()(n.measureAxis,t.measureAxis)},be=function(e){var t,n=e.exportFormat,i=e.initialProperties,r=e.properties,o=e.measureType,a=r.qHyperCubeDef,s=r.measureAxis;if(function(e){var t=e.initialProperties;return!(!e.exportFormat.properties.measureAxes||t.measureAxes||!t.measureAxis||void 0===t.measureAxis.autoMinMax)}({exportFormat:n,initialProperties:i})){var l=function(e){var t=[];return e.qMeasures.length>0&&e.qMeasures.forEach((function(e){if(e.qDef.series){var n=e.qDef.series,i=n.type,r=n.axis;t[r]||(t[r]={axis:r,type:{line:0,marker:0,bar:0,total:0}}),xe.includes(i)&&t[r].type[i]++,t[r].type.total++}})),t}(a);l.length?(o&&(t=l.filter((function(e){return e.type[o]>0})).sort((function(e,t){return t.type[o]-e.type[o]}))),t&&t.length||(t=l.sort((function(e,t){return t.type.total-e.type.total}))),t&&t[0]&&M()(s,n.properties.measureAxes[t[0].axis])):M()(s,n.properties.measureAxes[0])}},we=function(e){if(e.qDimensions.length>1){var t=e.qInterColumnSortOrder.indexOf(0);if(0!==t){var n=e.qInterColumnSortOrder[0];e.qInterColumnSortOrder[0]=0,e.qInterColumnSortOrder[t]=n}}},Me={exportProperties:function(e){var t=e.propertyTree,n=e.hypercubePath,i=e.viewDataMode,r=e.supportedAutoMinMax,o=void 0===r||r,a=ye.exportProperties({propertyTree:t,hypercubePath:n,viewDataMode:i}),s=a.properties;return o?(b(s,"measureAxis.min","supportedAutoMinMax"),b(s,"measureAxis.max","supportedAutoMinMax")):(b(s,"measureAxis.min","unsupportedAutoMinMax"),b(s,"measureAxis.max","unsupportedAutoMinMax")),a},importProperties:function(e){var t=e.exportFormat,n=e.initialProperties,i=e.dataDefinition,r=e.defaultPropertyValues,o=e.hypercubePath,a=e.measureType,s=e.extension,l=e.supportedFilters,c=e.isHCModifierSupported,u=ye.importProperties({exportFormat:t,initialProperties:n,dataDefinition:i,defaultPropertyValues:r,hypercubePath:o,extension:s,supportedFilters:l,isHCModifierSupported:c}),h=u.qProperty;return ve({initialProperties:n,properties:h}),be({exportFormat:t,initialProperties:n,properties:h,measureType:a}),we(h.qHyperCubeDef),h.qHyperCubeDef.qColumnOrder=[],h.qHyperCubeDef.columnOrder=[],u}};function ke(e,t,n){return"qLayoutExclude.quarantine.".concat(e,".").concat(t,".").concat(n)}function Se(e){var t=e.properties,n=e.arrayPath,i=e.quarantineName,r=e.arrayName,a=e.itemPath;o.getValue(t,n,[]).forEach((function(e){return function(e){var t=e.properties,n=e.quarantineName,i=e.arrayName,r=e.item,a=e.itemPath,s=o.getValue(r,a);if(void 0!==s){var l=o.getValue(r,"qDef.cId");l||(l=o.generateId(),o.setValue(r,"qDef.cId",l));var c=ke(n,i,l);o.setValue(t,c,s),o.setValue(r,a,void 0)}}({properties:t,quarantineName:i,arrayName:r,item:e,itemPath:a})}))}function _e(e){var t=e.properties,n=e.arrayPath,i=e.quarantineName,r=e.arrayName,a=e.itemPath;o.getValue(t,n,[]).forEach((function(e){return function(e){var t=e.properties,n=e.quarantineName,i=e.arrayName,r=e.item,a=e.itemPath,s=o.getValue(r,"qDef.cId");if(s){var l=ke(n,i,s),c=o.getValue(t,l);void 0!==c&&(o.setValue(r,a,c),o.setValue(t,l,void 0))}}({properties:t,quarantineName:i,arrayName:r,item:e,itemPath:a})}))}var qe="qHyperCubeDef.qMeasures",De="conditionalColoring",Ae="measures",Ce="qDef.conditionalColoring";const Ne={quarantine:function(e){Se({properties:e,arrayPath:qe,quarantineName:De,arrayName:Ae,itemPath:Ce})},unquarantine:function(e){_e({properties:e,arrayPath:qe,itemPath:Ce,arrayName:Ae,quarantineName:De})}};var Ee="qHyperCubeDef.qMeasures",Re="measures",Ie="qHyperCubeDef.qDimensions",Oe="dimensions",Pe="qHyperCubeDef.qLayoutExclude.qHyperCubeDef.qMeasures",Le="alternativeMeasures",Te="qHyperCubeDef.qLayoutExclude.qHyperCubeDef.qDimensions",ze="alternativeDimensions",Fe="qCalcCondition",je="conditionalShowHide";const Ve={quarantine:function(e){Se({properties:e,arrayPath:Ee,quarantineName:je,arrayName:Re,itemPath:Fe}),Se({properties:e,arrayPath:Ie,quarantineName:je,arrayName:Oe,itemPath:Fe})},unquarantine:function(e){_e({properties:e,arrayPath:Ee,quarantineName:je,arrayName:Re,itemPath:Fe}),_e({properties:e,arrayPath:Ie,quarantineName:je,arrayName:Oe,itemPath:Fe})},quarantineAlternative:function(e){Se({properties:e,arrayPath:Pe,quarantineName:je,arrayName:Le,itemPath:Fe}),Se({properties:e,arrayPath:Te,quarantineName:je,arrayName:ze,itemPath:Fe})},unquarantineAlternative:function(e){_e({properties:e,arrayPath:Pe,quarantineName:je,arrayName:Le,itemPath:Fe}),_e({properties:e,arrayPath:Te,quarantineName:je,arrayName:ze,itemPath:Fe})}},Be={hypercube:W,colorChart:ye,axisChart:Me,quarantineProperty:b,unquarantineProperty:$,quarantineArrayProp:Se,unquarantineArrayProp:_e,conditionalColoring:Ne,conditionalShow:Ve}})(),i.default})()),Xt.exports),Zt=Yt(Kt);function Jt(e){return{dimensions:{min:0,max:0},measures:{min:1,max:1,description:()=>e.translator.get("Visualizations.Descriptions.Gauge.Measure")}}}const Qt=(e,t,n)=>{const i=function(e){var t=e.theme,n=e.translator,i=e.config,r=void 0===i?{}:i,o=e.flags,a=function(e){var t=e.config,n=void 0===t?{}:t,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(e){for(var i=e.split("."),r=c,a=0;a<i.length;a++){var l=i[a];a===i.length-1?r[l]=R({theme:t,translator:n,id:s,path:e,flags:o}):void 0===r[l]&&(r[l]={}),r=r[l]}}));var u=function(e){for(var t=e.split("."),n=c,i=0;i<t.length;i++){var r=t[i];if(void 0===n[r])throw new Error("font-resolver: Path '".concat(e,"' could not be resolved."));n=n[r]}return n};return c.getDefaultValue=function(e){return u(e).getDefaultValue()},c.getOptions=function(e){return u(e).getOptions()},c}({theme:n,translator:t,flags:e,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}}}}}}}}}};let en;function tn(e){return"measure"===Mt(e,"color.useBaseColors")}function nn(e){const{flags:t,translator:n,sense:i}=e,r=null==i?void 0:i.theme,o=()=>{var e;if(!r)return-1;const{primary:t}=r.getDataColorSpecials(),n=null===(e=r.getDataColorPickerPalettes()[0])||void 0===e?void 0:e.colors,i=n.indexOf(t);return{index:-1===i?Math.min(6,n.length-1):i}},a={items:{labels:{items:{header:{show(e){var t;return null===(t=e.qHyperCubeDef.qMeasures)||void 0===t?void 0:t.length}},measureTitle:{component:"checkbox",ref:"measureAxis.show",type:"string",translation:"Simple.Label.Measure.Hide",defaultValue:"all",show(e){var t;return null===(t=e.qHyperCubeDef.qMeasures)||void 0===t?void 0:t.length},convertFunctions:{get:(e,t,n,i)=>"labels"===i.measureAxis.show||"none"===i.measureAxis.show,set(e,t,n,i,r){r.measureAxis.show=e?"labels":"all"}}}}}}};return{definition:{type:"items",component:"accordion",items:{data:{uses:"data",items:{measures:{disabledRef:""}}},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:a,presentation:{type:"items",grouped:!0,translation:"properties.presentation",items:{styleEditor:Qt(t,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:e=>e.measureAxis&&e.measureAxis.min>=e.measureAxis.max,change(e){St(e,"disclaimerClosed",!0)}},max:{ref:"measureAxis.max",translation:"Common.Max",type:"number",expression:"optional",defaultValue:100,invalid:e=>e.measureAxis&&e.measureAxis.min>=e.measureAxis.max,change(e){St(e,"disclaimerClosed",!0)}}}},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"}],change(e){"radial"===e.gaugetype?(en=e.orientation,e.orientation="horizontal"):e.orientation=en}},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:e=>"bar"===e.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:e=>"bar"===e.gaugetype&&!e.autoOrientation},segments:{type:"items",items:{useSegments:{ref:"useSegments",type:"boolean",component:"switch",defaultValue:!1,translation:"properties.gauge.useSegments",change(e){const t=function(e){const{paletteColors:t,colors:n}=e;return t&&t.length?t:n&&n.length?n.map((e=>({index:e.color}))):void 0}(e.segmentInfo);t&&(e.useSegments&&1===t.length?e.segmentInfo.paletteColors=[e.paletteProgressColor||e.progressColor]:e.paletteProgressColor=t[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:e=>(e.color||(e.color={}),e.color.useBaseColors||(e.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:o,show(e){if(!Mt(e,"paletteProgressColor")){let t=function({progressColor:e,theme:t}){var n;const i=null===(n=t.getDataColorPickerPalettes()[0])||void 0===n?void 0:n.colors;return null!=e?void 0!==e.index&&-1!==e.index&&i[e.index]?i[e.index]:void 0!==e.color?e.color?e.color:"none":i[e]?i[e]:e||"none":"none"}({progressColor:Mt(e,"progressColor"),theme:r}),n=-1;t&&"none"!==t||(t=o(),n=t.index),St(e,"paletteProgressColor",{index:n,color:t})}return!tn(e)&&!e.useSegments}},segmentInfo:{ref:"segments",type:"items",component:"color-scale-creator",show:e=>!tn(e)&&e.useSegments,items:{limits:{ref:"segmentInfo.limits",type:"array",items:{value:{ref:"value",type:"number",expression:"optional",invalid:(e,t)=>"number"==typeof e.value&&(e.value<t.measureAxis.min||e.value>t.measureAxis.max),defaultValue: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",label:(t,n)=>(t=>{let n;const i=t.getMeasureLayouts()[0];return n=i&&!i.qError?`${e.translator.get("properties.measureAxis")}: ${i.qFallbackTitle}`:e.translator.get("properties.measureAxis"),n})(n),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:e=>e.measureAxis&&"none"!==e.measureAxis.show&&"title"!==e.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},importProperties:(t,n,i,r)=>Zt.axisChart.importProperties({exportFormat:t,initialProperties:n,hypercubePath:r,extension:i,dataDefinition:Jt(e)}),exportProperties:(e,t,n)=>Zt.axisChart.exportProperties({propertyTree:e,hyperCubePath:t,viewDataMode:n,supportedAutoMinMax:!1})}}function rn(e,t,n){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var i=n.call(e,t||"default");if("object"!=typeof i)return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function on(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,i)}return n}function an(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?on(Object(n),!0).forEach((function(t){rn(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):on(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var sn=Object.prototype.hasOwnProperty,ln=Object.prototype.toString,cn=Object.defineProperty,un=Object.getOwnPropertyDescriptor,hn=function(e){return"function"==typeof Array.isArray?Array.isArray(e):"[object Array]"===ln.call(e)},dn=function(e){if(!e||"[object Object]"!==ln.call(e))return!1;var t,n=sn.call(e,"constructor"),i=e.constructor&&e.constructor.prototype&&sn.call(e.constructor.prototype,"isPrototypeOf");if(e.constructor&&!n&&!i)return!1;for(t in e);return void 0===t||sn.call(e,t)},fn=function(e,t){cn&&"__proto__"===t.name?cn(e,t.name,{enumerable:!0,configurable:!0,value:t.newValue,writable:!0}):e[t.name]=t.newValue},pn=function(e,t){if("__proto__"===t){if(!sn.call(e,t))return;if(un)return un(e,t).value}return e[t]},mn=function e(){var t,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!=(t=arguments[l]))for(n in t)i=pn(s,n),s!==(r=pn(t,n))&&(u&&r&&(dn(r)||(o=hn(r)))?(o?(o=!1,a=i&&hn(i)?i:[]):a=i&&dn(i)?i:{},fn(s,{name:n,newValue:e(u,a,r)})):void 0!==r&&fn(s,{name:n,newValue:r}));return s};function gn(e,t,n,i){if(!e)return-1;const r=n.cache,o=e.origin?e.origin():null;o&&(e=o);let a=r.fields.indexOf(e),s=-1,l=-1;if(-1===a)for(let t=0;t<r.wrappedFields.length;t++)if(l=r.wrappedFields[t].attrDims.map((e=>e.instance)).indexOf(e),s=r.wrappedFields[t].attrExps.map((e=>e.instance)).indexOf(e),-1!==l||-1!==s){a=t;break}if(Array.isArray(i)&&i.some(((e,t)=>e!==t))){const e=i.indexOf(a);-1!==e&&(a=e)}return a-=t.qArea.qLeft,a<0||a>=t.qArea.qWidth?-1:l>=0?e=>e[a].qAttrDims.qValues[l]:s>=0?e=>e[a].qAttrExps.qValues[s]:e=>e[a]}function yn(e,t,n){let{key:i}=n;const r={value:"function"==typeof e.value?e.value(t):void 0!==e.value?e.value:t};return r.label="function"==typeof e.label?e.label(t):void 0!==e.label?String(e.label):String(r.value),e.field&&(r.source={key:i,field:e.field.key()}),r}function xn(e){let{cache:t,f:n,mainCell:i,p:r,prop:o,page:a,rowIdx:s,row:l,sourceKey:c,target:u,targetProp:h,columnOrder:d}=e,f=i;if(r.field&&r.field!==n){const e=gn(r.field,a,{cache:t},d);if(-1===e)return;f=mn({qRow:s},e(l))}u[h]=yn(r,f,{key:c})}function vn(e,t,n,i){const r=Array.isArray(e)?e:[e];let o=[];for(let e=0;e<r.length;e++)if(void 0!==r[e].field){const a=t.raw(),s=t.key(),l="object"==typeof r[e].field?r[e].field:t.field(r[e].field),{props:c,main:u}=i.normalizeConfig(r[e],t),h=Object.keys(c),d=!!r[e].trackBy,f=typeof r[e].trackBy,p={},m=[],g=[];for(let t=0;t<a.qDataPages.length;t++){const o=gn(l,a.qDataPages[t],{cache:n},a.qColumnOrder);if(-1!==o)for(let y=0;y<a.qDataPages[t].qMatrix.length;y++){const x=a.qDataPages[t].qArea.qTop+y,v=mn({qRow:x},o(a.qDataPages[t].qMatrix[y])),b=yn(u,v,{key:s});if(!(u.filter&&!u.filter(v))){for(let e=0;e<h.length;e++){const i=c[h[e]];let r=i.fields||[i];i.fields&&(b[h[e]]=[]);for(let o=0;o<r.length;o++)xn({cache:n,f:l,mainCell:v,p:r[o],prop:h[e],props:c,page:a.qDataPages[t],rowIdx:x,row:a.qDataPages[t].qMatrix[y],sourceKey:s,target:i.fields?b[h[e]]:b,targetProp:i.fields?o:h[e],columnOrder:a.qColumnOrder});if(i.fields){const t=b[h[e]].map((e=>e.value)),n=b[h[e]].map((e=>e.label));b[h[e]]={value:"function"==typeof i.value?i.value(t):void 0!==i.value?i.value:t,label:"function"==typeof i.label?i.label(n):void 0!==i.label?String(i.label):String(b[h[e]].value)}}}d&&i.track({cfg:r[e],itemData:v,obj:b,target:m,tracker:p,trackType:f}),g.push(b)}}}const y=d?i.collect(m,{main:u,propsArr:h,props:c}):g;o=[...o,...y]}return o}function bn(e){var t=0,n=e.children,i=n&&n.length;if(i)for(;--i>=0;)t+=n[i].value;else t=1;e.value=t}function wn(e,t){e instanceof Map?(e=[void 0,e],void 0===t&&(t=kn)):void 0===t&&(t=Mn);for(var n,i,r,o,a,s=new qn(e),l=[s];n=l.pop();)if((r=t(n.data))&&(a=(r=Array.from(r)).length))for(n.children=r,o=a-1;o>=0;--o)l.push(i=r[o]=new qn(r[o])),i.parent=n,i.depth=n.depth+1;return s.eachBefore(_n)}function Mn(e){return e.children}function kn(e){return Array.isArray(e)?e[1]:null}function Sn(e){void 0!==e.data.value&&(e.value=e.data.value),e.data=e.data.data}function _n(e){var t=0;do{e.height=t}while((e=e.parent)&&e.height<++t)}function qn(e){this.data=e,this.depth=this.height=0,this.parent=null}function Dn(e){return null==e?null:function(e){if("function"!=typeof e)throw new Error;return e}(e)}qn.prototype=wn.prototype={constructor:qn,count:function(){return this.eachAfter(bn)},each:function(e,t){let n=-1;for(const i of this)e.call(t,i,++n,this);return this},eachAfter:function(e,t){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();)e.call(t,o,++l,this);return this},eachBefore:function(e,t){for(var n,i,r=this,o=[r],a=-1;r=o.pop();)if(e.call(t,r,++a,this),n=r.children)for(i=n.length-1;i>=0;--i)o.push(n[i]);return this},find:function(e,t){let n=-1;for(const i of this)if(e.call(t,i,++n,this))return i},sum:function(e){return this.eachAfter((function(t){for(var n=+e(t.data)||0,i=t.children,r=i&&i.length;--r>=0;)n+=i[r].value;t.value=n}))},sort:function(e){return this.eachBefore((function(t){t.children&&t.children.sort(e)}))},path:function(e){for(var t=this,n=function(e,t){if(e===t)return e;var n=e.ancestors(),i=t.ancestors(),r=null;e=n.pop(),t=i.pop();for(;e===t;)r=e,e=n.pop(),t=i.pop();return r}(t,e),i=[t];t!==n;)t=t.parent,i.push(t);for(var r=i.length;e!==n;)i.splice(r,0,e),e=e.parent;return i},ancestors:function(){for(var e=this,t=[e];e=e.parent;)t.push(e);return t},descendants:function(){return Array.from(this)},leaves:function(){var e=[];return this.eachBefore((function(t){t.children||e.push(t)})),e},links:function(){var e=this,t=[];return e.each((function(n){n!==e&&t.push({source:n.parent,target:n})})),t},copy:function(){return wn(this).eachBefore(Sn)},[Symbol.iterator]:function*(){var e,t,n,i,r=this,o=[r];do{for(e=o.reverse(),o=[];r=e.pop();)if(yield r,t=r.children)for(n=0,i=t.length;n<i;++n)o.push(t[n])}while(o.length)}};var An={depth:-1},Cn={},Nn={};function En(e){return e.id}function Rn(e){return e.parentId}function In(){var e,t=En,n=Rn;function i(i){var r,o,a,s,l,c,u,h,d=Array.from(i),f=t,p=n,m=new Map;if(null!=e){const t=d.map(((t,n)=>function(e){e=`${e}`;let t=e.length;Pn(e,t-1)&&!Pn(e,t-2)&&(e=e.slice(0,-1));return"/"===e[0]?e:`/${e}`}(e(t,n,i)))),n=t.map(On),r=new Set(t).add("");for(const e of n)r.has(e)||(r.add(e),t.push(e),n.push(On(e)),d.push(Nn));f=(e,n)=>t[n],p=(e,t)=>n[t]}for(a=0,r=d.length;a<r;++a)o=d[a],c=d[a]=new qn(o),null!=(u=f(o,a,i))&&(u+="")&&(h=c.id=u,m.set(h,m.has(h)?Cn: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=m.get(u)))throw new Error("missing: "+u);if(l===Cn)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!=e){for(;s.data===Nn&&1===s.children.length;)s=s.children[0],--r;for(let e=d.length-1;e>=0&&(c=d[e]).data===Nn;--e)c.data=null}if(s.parent=An,s.eachBefore((function(e){e.depth=e.parent.depth+1,--r})).eachBefore(_n),s.parent=null,r>0)throw new Error("cycle");return s}return i.id=function(e){return arguments.length?(t=Dn(e),i):t},i.parentId=function(e){return arguments.length?(n=Dn(e),i):n},i.path=function(t){return arguments.length?(e=Dn(t),i):e},i}function On(e){let t=e.length;if(t<2)return"";for(;--t>1&&!Pn(e,t););return e.slice(0,t)}function Pn(e,t){if("/"===e[t]){let n=0;for(;t>0&&"\\"===e[--t];)++n;if(!(1&n))return!0}return!1}function Ln(e,t){"/"===e.charAt(0)&&(e=e.substring(1));const n=e.split("/");let i,r=t;for(let e=0;e<n.length;e++){if("*"===n[e]&&Array.isArray(r)){const t=[];i=n.slice(e+1).join("/");for(let e=0;e<r.length;e++){let n=Ln(i,r[e]);Array.isArray(n)?t.push(...n):t.push(n)}return t}if(!n[e]&&Array.isArray(r)){const t=new Array(r.length);i=n.slice(e+1).join("/");for(let e=0;e<r.length;e++)t[e]=Ln(i,r[e]);return t}n[e]in r&&(r=r[n[e]])}return r}function Tn(e,t,n){let i=[];if(!e||!e.length)return i;if(t<=0){const t=n>=0?[e[n]]:e;i=[...i,...t]}else for(let r=0;r<e.length;r++)e[r].children&&e[r].children.length&&(i=[...i,...Tn(e[r].children,t-1,n)]);return i}function zn(e,t,n){if(e===t)return e=>e;if(e>t){const n=Math.max(0,Math.min(100,e-t));return e=>{let t=e;for(let e=0;e<n;++e)t=t.parent;return t}}if(t>e){const i=Math.max(0,Math.min(100,t-e));return e=>Tn(e.children,i-1,n)}return!1}const Fn=/^qDimensionInfo(?:\/(\d+))?/,jn=/^\/?qMeasureInfo\/(\d+)/,Vn=/\/qAttrExprInfo\/(\d+)/,Bn=/\/qAttrDimInfo\/(\d+)/;function Hn(e){return(e.qColumnOrder&&e.qColumnOrder.length?e.qColumnOrder:e.qDimensionInfo.map(((e,t)=>t))).filter((t=>t<e.qDimensionInfo.length))}function $n(e,t){let{cube:n}=t;if(!e)return-1;let i=e.origin&&e.origin()?e.origin().key():e.key(),r=!1,o=-1,a=-1,s=-1,l=-1,c=-1,u=-1,h=i;const d=n.qEffectiveInterColumnSortOrder,f=Hn(n);return Fn.test(h)&&(r=!0,o=+Fn.exec(h)[1],h=i.replace(Fn,"")),jn.test(h)&&("K"===n.qMode?c=+jn.exec(h)[1]:d&&-1!==d.indexOf(-1)?(c=+jn.exec(h)[1],u=0):u=+jn.exec(h)[1],h=h.replace(jn,"")),h&&(Bn.exec(h)?s=+Bn.exec(h)[1]:Vn.exec(h)&&(a=+Vn.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 Wn(e,t){let n,i,r=zn(e.fieldDepth,t.fieldDepth,t.pseudoMeasureIndex);return n=t.measureIdx>=0?e=>e.data.qValues[t.measureIdx]:e=>e.data,t.attrDimIdx>=0?i=e=>{var n;return null==e||null===(n=e.qAttrDims)||void 0===n?void 0:n.qValues[t.attrDimIdx]}:t.attrIdx>=0&&(i=e=>{var n;return null==e||null===(n=e.qAttrExps)||void 0===n?void 0:n.qValues[t.attrIdx]}),{nodeFn:r,attrFn:i,valueFn:n}}function Un(e,t,n){let{key:i}=n;const r={value:"function"==typeof e.value?e.value(t):void 0!==e.value?e.value:t};return r.label="function"==typeof e.label?e.label(t):void 0!==e.label?String(e.label):String(r.value),e.field&&(r.source={key:i,field:e.field.key()}),r}function Yn(e){let{propsArr:t,props:n,item:i,itemData:r,ret:o,sourceKey:a}=e;for(let e=0;e<t.length;e++){const s=n[t[e]],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,m,g,y;if("primitive"===h.type?(p=h.value,y=String(h.value)):("function"==typeof h.value&&(d=e=>h.value(e,i)),"function"==typeof h.label&&(f=e=>h.label(e,i)),h.accessor?(m=h.accessor(i),Array.isArray(m)?(g=m.map(h.valueAccessor),h.attrAccessor&&(g=g.map(h.attrAccessor)),d&&(p=g.map(d),d=null),f&&(y=g.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(m)):h.valueAccessor(m),y=p)):(p=r,y=r)),s.fields){const e=d?d(p):p;c.push(e),u.push(f&&null!=y?f(y):null!=y?y:String(e))}else{const n=d?d(p):p;o[t[e]]={value:n,label:f?f(y):null!=y?y:String(n)},h.field&&(o[t[e]].source={field:h.field.key(),key:a})}}c&&(o[t[e]]={value:"function"==typeof s.value?s.value(c,i):c,label:"function"==typeof s.label?s.label(u,i):u})}}const Gn=(e,t,n)=>{const i="K"===e.qMode?"/qStackedDataPages/*/qData":"/qTreeDataPages/*",r="K"===e.qMode?"qSubNodes":"qNodes",o=Ln(i,e);return o&&o[0]?(t.tree=wn(o[0],n.children||(e=>e[r])),t.tree):null};const Xn=e=>{let{propsArr:t,props:n,cube:i,cache:r,itemDepthObject:o,f:a}=e;for(let e=0;e<t.length;e++){const s=n[t[e]],l=s.fields?s.fields:[s];for(let e=0;e<l.length;e++){const t=l[e];if(t.field!==a){const e=Wn(o,$n(t.field,{cube:i,cache:r}));t.accessor=e.nodeFn,t.valueAccessor=e.valueFn,t.attrAccessor=e.attrFn}}}};function Kn(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=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=t.raw(),o=t.key(),a="S"===r.qMode?function(e){const t=e.raw().qDataPages.length?e.raw().qDataPages[0].qMatrix:[],n=function(e){const t=e.raw().qColumnOrder,n=e.fields();return t&&t.length===n.length?t:n.map(((e,t)=>t))}(e),i=e.fields(),r=e.fields().filter((e=>"dimension"===e.type())).map((e=>n.indexOf(i.indexOf(e)))),o=e.fields().filter((e=>"measure"===e.type())).map((e=>n.indexOf(i.indexOf(e)))),a={__root:{__id:"__root",qValues:[]}};for(let e=0;e<t.length;e++){const n=t[e];let i="__root",l=!1;for(let e=0;e<r.length;e++){var s;const t=n[r[e]],o="".concat(i,"__").concat(null!==(s=t.qElemNumber)&&void 0!==s?s:t.qElemNo);a[o]||(a[o]=an({__id:o,__parent:i,qValues:[]},t),l=!0),i=o}if(l)for(let e=0;e<o.length;e++){const t=n[o[e]];a[i].qValues.push(t)}}const l=Object.keys(a).map((e=>a[e]));return In().id((e=>e.__id)).parentId((e=>e.__parent))(l)}(t):Gn(r,n,e);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 e=Hn(r)[o-1];a=n.fields[e]}else{let e=r.qEffectiveInterColumnSortOrder[o-1];o>r.qEffectiveInterColumnSortOrder.length&&(e=r.qDimensionInfo.length),a=n.fields[e]}const{props:s,main:c}=i.normalizeConfig(an(an({},e),{},{field:a?a.key():void 0}),t),u=Object.keys(s);l[o]={propsArr:u,props:s,main:c};const h=a?$n(a,{cube:r,cache:n}):{fieldDepth:0};Xn({propsArr:u,props:s,cube:r,cache:n,itemDepthObject:h,f:a})}const c=a.copy().descendants(),u=a.descendants();for(let e=0;e<u.length;e++){const t=l[u[e].depth].propsArr,n=l[u[e].depth].props,i=l[u[e].depth].main,r=c[e],a=r.data,s=Un(i,a,{key:o});Yn({propsArr:t,props:n,item:r,itemData:a,ret:s,sourceKey:o,isTree:!0}),u[e].data=s}return a}function Zn(e,t,n,i){const r=Array.isArray(e)?e:[e];let o=[];for(let a=0;a<r.length;a++)if(void 0!==r[a].field){const s=t.raw(),l=t.key();if(!Gn(s,n,e))continue;const c="object"==typeof r[a].field?r[a].field:t.field(r[a].field),{props:u,main:h}=i.normalizeConfig(r[a],t),d=Object.keys(u),f=$n(c,{cube:s,cache:n}),{nodeFn:p,attrFn:m,valueFn:g}=Wn({fieldDepth:0},f);Xn({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 e=0;e<w.length;e++){const t=w[e],n=m?m(g(t)):g(t);if(h.filter&&!h.filter(n))continue;const o=Un(h,n,{key:l});Yn({propsArr:d,props:u,item:t,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 Jn=function(e,t){return e(t={exports:{}},t.exports),t.exports}((function(e){
10
10
  /*! javascript-number-formatter - v1.1.11 - http://mottie.github.com/javascript-number-formatter/ * © ecava */
11
- e.exports=function(e,t){if(!e||isNaN(+t))return t;var n,i,r,o,a,s,l,c,u,h,d=e.length,f=e.search(/[0-9\-\+#]/),p=f>0?e.substring(0,f):"",m=e.split("").reverse().join(""),g=m.search(/[0-9\-\+#]/),y=d-g,x=e.substring(y,y+1),v=y+("."===x||","===x?1:0),b=g>0?e.substring(v,d):"";if(n=(t="-"===(e=e.substring(f,v)).charAt(0)?-t:+t)<0?t=-t:0,r=(i=e.match(/[^\d\-\+#]/g))&&i[i.length-1]||".",o=i&&i[1]&&i[0]||",",e=e.split(r),t=+(t=t.toFixed(e[1]&&e[1].length))+"",s=e[1]&&e[1].lastIndexOf("0"),(!(c=t.split("."))[1]||c[1]&&c[1].length<=s)&&(t=(+t).toFixed(s+1)),u=e[0].split(o),e[0]=u.join(""),(a=e[0]&&e[0].indexOf("0"))>-1)for(;c[0].length<e[0].length-a;)c[0]="0"+c[0];else 0==+c[0]&&(c[0]="");if((t=t.split("."))[0]=c[0],l=u[1]&&u[u.length-1].length){for(m="",y=(h=t[0]).length%l,d=h.length,v=0;v<d;v++)m+=h.charAt(v),!((v-y+1)%l)&&v<d-l&&(m+=o);t[0]=m}return t[1]=e[1]&&t[1]?r+t[1]:"","0"!==(i=t.join(""))&&""!==i||(n=!1),p+(n?"-":"")+i+b}}));function Qn(e){return e.replace(/[-[\]/{}()*+?.\\^$|]/g,"\\$&")}const ei={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"},ti=/%\)?$/,ni=/^\(r(0[2-9]|[12]\d|3[0-6])\)/i,ii=/^\(oct\)/i,ri=/^\(dec\)/i,oi=/^\(hex\)/i,ai=/^\(bin\)/i,si=/^\(rom\)/i,li=/^(\(rom\)|\(bin\)|\(hex\)|\(dec\)|\(oct\)|\(r(0[2-9]|[12]\d|3[0-6])\))/i,ci=/#|0/g;function ui(e,t,n,i){return e=e.toString(t),n[1]===n[1].toUpperCase()&&(e=e.toUpperCase()),e.length-e.indexOf(".")>10&&(e=e.slice(0,e.indexOf(".")+11)),e.replace(".",i||".")}function hi(e,t,n){let i;return ni.test(t)?e=ui(e,Number(/\d{2}/.exec(t)[0]),t,n):ii.test(t)?e=ui(e,8,t,n):ri.test(t)?e=ui(e,10,t,n):oi.test(t)?e=ui(e,16,t,n):ai.test(t)?e=ui(e,2,t,n):si.test(t)&&(i="",e<0&&(i="-",e=-e),0===(e=Math.floor(e))?e="0":e<=5e5?(e=function(e,t){let n,i="",r=Number(String(e).slice(-3)),o=(e-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 t[1]!==t[1].toUpperCase()&&(i=i.toLowerCase()),i}(e,t),e=i+e):e=t+i+e.toExponential(0)),e}function di(e,t,n){const i=Qn(e);return n?i:new RegExp(i||"",t)}function fi(e,t,n,i){let r,o,a,s,l,c,u,h,d,f=e.pattern;var p,m;i&&(e.abbreviate=!0),p=t,(m=n)&&(m=Qn(m)),p&&(p=Qn(p)),d=new RegExp("(?:[#0]+".concat(p,")?[#0]+(?:").concat(m,"[#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?"#":"##########"),t&&t===n&&(r=a.split(n),o=r.pop(),a=r.join("")+n+o,t=""),c=t,t=/,/.test(n)?"¤":",",c&&(a=a.replace(di(c,"g"),t)),u=n,n=".",u&&(a=a.replace(di(u,"g"),n)),h=a.match(/#/g),h=h?h.length:0;const g=f.split(u);let y;g[1]&&(y=g[1].match(ci)),e.prefix=s||"",e.postfix=l||"",e.pattern=f,e.maxPrecision=y?y.length:2,e.percentage=ti.test(f),e.numericPattern=a||"",e.numericRegex=new RegExp("".concat(di(t,null,!0),"|").concat(di(n,null,!0)),"g"),e.groupTemp=c,e.decTemp=u,e.t=t,e.d=n,e.temp=h}class pi{constructor(e,t,n,i,r){this.localeInfo=e,this.pattern=t,this.thousandDelimiter=n||",",this.decimalDelimiter=i||".",this.type=r||"numeric",this.patternSeparator=";",this.abbreviations=function(e,t){if(!e||!e.qNumericalAbbreviation)return ei;const n={};return e.qNumericalAbbreviation.split(t).forEach((e=>{let t=e.split(":");2===t.length&&(n[t[0]]=t[1])})),n}(e,this.patternSeparator),this.prepare()}clone(){const e=new pi(this.localeInfo,this.pattern,this.thousandDelimiter,this.decimalDelimiter,this.type);return e.subtype=this.subtype,e}format(e,t,n,i){return this.prepare(t,n,i),this.formatValue(e)}prepare(e,t,n){let i;if(void 0===e&&(e=this.pattern),void 0===t&&(t=this.thousandDelimiter),void 0===n&&(n=this.decimalDelimiter),!e)return void(this._prepared={pattern:!1});this._prepared={positive:{d:n,t:t,abbreviate:!1,isFunctional:!1,prefix:"",postfix:""},negative:{d:n,t:t,abbreviate:!1,isFunctional:!1,prefix:"",postfix:""},zero:{d:n,t:t,abbreviate:!1,isFunctional:!1,prefix:"",postfix:""}},i=this._prepared,e=e.split(this.patternSeparator),i.positive.pattern=e[0],i.negative.pattern=e[1],i.zero.pattern=e[2],li.test(e[0])&&(i.positive.isFunctional=!0),e[1]?li.test(e[1])&&(i.negative.isFunctional=!0):i.negative=!1,e[2]?li.test(e[2])&&(i.zero.isFunctional=!0):i.zero=!1;const r="U"===this.type;i.positive.isFunctional||fi(i.positive,t,n,r),i.negative&&!i.negative.isFunctional&&fi(i.negative,t,n,r),i.zero&&!i.zero.isFunctional&&fi(i.zero,t,n,r)}formatValue(e){let t,n,i,r,o,a,s,l,c,u=this._prepared,h="",d="",f=e;if(isNaN(e))return"".concat(f);if(e=+e,!1===u.pattern)return e.toString();if(0===e&&u.zero)return u=u.zero,u.pattern;if(e<0&&u.negative?(u=u.negative,e=-e):u=u.positive,o=u.d,a=u.t,u.isFunctional)e=hi(e,u.pattern,o);else{if(u.percentage&&(e*=100),u.abbreviate){const t=Object.keys(this.abbreviations).map((e=>parseInt(e,10))).sort(((e,t)=>e-t));let i,r,o=t[0];for(s=0,n=Number(Number(e).toExponential().split("e")[1]);o<=n&&s<t.length;)s++,o=t[s];s>0&&(i=t[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],e/=10**r)}if(i=Math.abs(e),t=u.temp,l=u.numericPattern,c=l.split(o)[1],"I"===this.type&&(e=Math.round(e)),r=e,c||"#"!==l.slice(-1)[0])if(i>=1e15||i>0&&i<=1e-14)e=i?i.toExponential(15).replace(/\.?0+(?=e)/,""):"0";else{const t=Number((e+1e-15*(e<0?-1:1)).toFixed(Math.min(20,c?c.length:0)).split(".")[0]);let n=l.split(o)[0];if(n+=o,e=Jn(n,t)||"0",c){const t=Math.max(0,Math.min(14,c.length)),n=c.replace(/#+$/,"").length;let r=("I"===this.type?0:i%1+1e-15).toFixed(t).slice(2).replace(/0+$/,"");for(s=r.length;s<n;s++)r+="0";r&&(e+=o+r)}else 0===t&&(r=0)}else if(i>=10**t||i<1||i<1e-4)0===e?e="0":i<1e-4||i>=1e20?(e=(e=r.toExponential(Math.max(1,Math.min(14,t))-1)).replace(/\.?0+(?=e)/,""),d=""):(e=e.toPrecision(Math.max(1,Math.min(14,t)))).indexOf(".")>=0&&(e=(e=e.replace(e.indexOf("e")<0?/0+$/:/\.?0+(?=e)/,"")).replace(".",o));else{for(l+=o,t=Math.max(0,Math.min(20,t-Math.ceil(Math.log(i)/Math.log(10)))),s=0;s<t;s++)l+="#";e=Jn(l,e)}e=e.replace(u.numericRegex,(e=>e===a?u.groupTemp:e===o?u.decTemp:"")),r<0&&!/^-/.test(e)&&(e="-".concat(e))}return u.prefix+e+d+h+u.postfix}static getStaticFormatter(){return{prepare(){},formatValue:e=>"".concat(e)}}}function mi(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const{size:n=5e3,multipleArguments:i=!1,toKey:r=e=>e}=t;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,e(...arguments))}:t=>(a=r(t),o.has(a)?o.get(a):o.set(a,e(t))),o.set=(e,t)=>(c>=n&&(delete s[l[u]],delete l[u],c--,u++),s[e]=t,l[c]=e,c++,t),o.get=e=>s[e],o.has=e=>e in s,o.clear=()=>{s=Object.create(null),l=Object.create(null),c=0,u=0},o.size=()=>c,o}function gi(e,t,n,i,r){const o=function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return new pi(...t)}(r,e,t,n,i),a=mi(o.formatValue.bind(o),{toKey:e=>isNaN(e)?e:+e});function s(e){return a(e)}return s.format=function(e,t,n,i){return a.clear(),o.format(t,e,n,i)},s.pattern=function(e){return e&&(a.clear(),o.pattern=e,o.prepare()),o.pattern},s}const yi="D",xi="T",vi="TS",bi="IV",wi=["Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"],Mi=["Mon","Tue","Wed","Thu","Fri","Sat","Sun"],ki=["January","February","March","April","May","June","July","August","September","October","November","December"],Si=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function _i(e,t){for(let n=e.length;n<t;n++)e="0".concat(e);return e}function qi(e){let t=e.toString().split(".");return t[1]?(t=Number("0.".concat(t[1])),t):0}function Di(e,t){let n,i=function(e){const t=e,n=24*qi(t),i=60*qi(n),r=60*qi(i),o=1e3*qi(r);return{d:Math.floor(t),h:Math.floor(n),m:Math.floor(i),s:Math.floor(r),f:Math.round(o)}}(e),r=i.d,o=i.h,a=i.m,s=i.s,l=i.f,c=0;/w+|t+/gi.test(t)&&(n=new Date(Date.UTC(1899,11,30+Math.floor(e),0,0,Math.round(86400*(e-Math.floor(e))))),isNaN(n.getTime())&&(n=null)),/D+/gi.test(t)||(o+=24*r),/h+/gi.test(t)||(a+=60*o),/m+/gi.test(t)||(s+=60*a),/w+/gi.test(t)&&(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 Ai{constructor(e,t,n){const i=e||{};if(i.qCalendarStrings||(i.qCalendarStrings={qLongDayNames:wi,qDayNames:Mi,qLongMonthNames:ki,qMonthNames:Si}),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(),!t){t={[xi]:i.qTimeFmt||"hh:mm:ss",[yi]:i.qDateFmt||"YYYY-MM-DD",[vi]:i.qTimestampFmt||"YYYY-MM-DD hh:mm:ss"}[n]}this.pattern=t}clone(){const e=new Ai(this.localeInfo,this.pattern);return e.subtype=this.subtype,e}format(e,t){t||(t=this.pattern?this.pattern:"YYYY-MM-DD hh:mm:ss"),t=t.replace(/\[.+]|\[|]/g,"");const n=/t+/gi.test(t);let i;e instanceof Date?i=function(e,t){let n=e.getUTCHours(),i=e.getUTCDay()-1;return t&&(n%=12,n||(n=12)),i<0&&(i=6),{year:e.getUTCFullYear(),month:e.getUTCMonth(),day:i,date:e.getUTCDate(),h:n,m:e.getUTCMinutes(),s:e.getUTCSeconds(),f:e.getUTCMilliseconds(),t:e.getUTCHours()>=12?"pm":"am"}}(e,n):(e<0&&(e=-e,t="-".concat(t)),i=Di(e,t));const r=(o=this,a=i,{"Y+|y+":{Y:"".concat(Number("".concat(a.year).slice(-2))),YY:_i("".concat(a.year).slice(-2),2),YYY:_i("".concat(a.year).slice(-3),3),def:e=>_i("".concat(a.year),e.length)},"M+":{M:a.month+1,MM:_i("".concat(a.month+1),2),MMM:o.locale_months_abbr[a.month],def:o.locale_months[a.month]},"W+|w+":{W:a.day,WW:_i("".concat(a.day),2),WWW:o.locale_days_abbr[a.day],def:o.locale_days[a.day]},"D+|d+":{D:a.date,def:e=>_i("".concat(a.date),e.length)},"h+|H+":{h:a.h,def:e=>_i("".concat(a.h),e.length)},"m+":{m:a.m,def:e=>_i("".concat(a.m),e.length)},"s+|S+":{s:a.s,def:e=>_i("".concat(a.s),e.length)},"f+|F+":{def(e){let t="".concat(a.f),n=e.length-t.length;if(n>0)for(let e=0;e<n;e++)t+="0";else n<0&&(t=t.slice(0,e.length));return t}},"t{1,2}|T{1,2}":{def(e){let t=a.t;return e[0].toUpperCase()===e[0]&&(t=t.toUpperCase()),t=t.slice(0,e.length),t}}});var o,a;const s=[];for(const e in r)Object.prototype.hasOwnProperty.call(r,e)&&s.push(e);const l=new RegExp(s.join("|"),"g"),c=t.replace(l,(e=>{let t,n,i;for(n in r)if(Object.prototype.hasOwnProperty.call(r,n)&&(t=new RegExp(n),t.test(e)))break;if(!t)return"";for(const t in r[n])if(t===e||t.toLowerCase()===e){i=r[n][t],void 0===i&&(i=r[n][t.toLowerCase()]);break}return void 0===i&&(i=r[n].def),"function"==typeof i&&(i=i(e)),i}));return c}}function Ci(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return new Ai(...t)}function Ni(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"TS",n=Ci(arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,e,t),i=mi(n.format.bind(n),{toKey:e=>"object"==typeof e&&"function"==typeof e.getTime?e.getTime():e});function r(e){return t!==bi?function(e){return new Date(Date.UTC(1899,11,30+Math.floor(e),0,0,0,Math.round(864e5*(e-Math.floor(e)))))}(e):e}function o(e){return e=r(e),i(e)}return o.format=function(e,t){return i.clear(),t=r(t),n.format(t,e)},o.locale=function(r){return n=Ci(r,e,t),i=mi(n.format.bind(n),{toKey:e=>"object"==typeof e?e.getTime():e}),this},o.qtype=function(e){return void 0!==e&&(t=e,i.clear()),t},o}function Ei(){let e,{meta:t,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?e=>null==e?void 0:e.qElemNo:e=>null==e?void 0:e.qValue),u="dimension"===s?"first":"avg",h=function(e,t){if(e&&e.qNumFormat&&-1!==["D","T","TS","IV"].indexOf(e.qNumFormat.qType))return Ni(e.qNumFormat.qFmt,e.qNumFormat.qType,t);let n="#",i=t&&void 0!==t.qThousandSep?t.qThousandSep:",",r=t&&void 0!==t.qDecimalSep?t.qDecimalSep:".",o="U",a=e&&!!e.qIsAutoFormat;return e&&e.qNumFormat?(n=e.qNumFormat.qFmt||n,i=e.qNumFormat.qThou||i,r=e.qNumFormat.qDec||r,o=e.qNumFormat.qType||o,a=a&&-1===["M"].indexOf(e.qNumFormat.qType)):a=!0,(a||"U"===o)&&(n="#".concat(r,"##"),o="U"),gi(n,i,r,o,t)}(t,r),d="dimension"===s?"first":(e,t)=>h(t),f={id:()=>n,key:()=>i,raw:()=>t,title:()=>t.qFallbackTitle||t.label,type:()=>s,origin:()=>l,items:()=>(e||(e=o(f)),e),min:()=>t.qMin,max:()=>t.qMax,value:c,label:e=>(null==e?void 0:e.qText)||"",reduce:u,reduceLabel:d,formatter:()=>h,tags:()=>t.qTags};return f}function Ri(e,t,n,i,r){return(t[e]||[]).map(((t,o)=>{const a="".concat(i?"".concat(i,"/"):"").concat(e,"/").concat(o),s={instance:Ei(mn({id:"".concat(n?"".concat(n,"/"):"").concat(a),key:a,meta:t},r))};return s.attrDims=Ri("qAttrDimInfo",t,n,a,mn({},r,{value:e=>null==e?void 0:e.qElemNo,type:"dimension"})),s.attrExps=Ri("qAttrExprInfo",t,n,a,mn({},r,{value:e=>null==e?void 0:e.qNum,type:"measure"})),s.measures=Ri("qMeasureInfo",t,n,a,mn({},r,{value:e=>null==e?void 0:e.qValue,type:"measure"})),s}))}function Ii(){let{key:e,data:t,config:n={}}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const i={fields:[],wrappedFields:[],allFields:[],virtualFields:[]},r=t;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=Ii.util,a={cache:i,cube:r,localeInfo:n.localeInfo,fieldExtractor:null,pages:null,hierarchy:()=>null,virtualFields:n.virtualFields},s={key:()=>e,raw:()=>r,field:e=>function(e,t){let{cache:n}=t;if("number"==typeof e)return n.fields[e];const i=n.allFields;if("function"==typeof e){for(let t=0;t<i.length;t++)if(e(i[t]))return i[t];return!1}if("string"==typeof e){for(let t=0;t<i.length;t++)if(i[t].key()===e||i[t].title()===e)return i[t]}else if(e&&-1!==i.indexOf(e))return e;throw Error("Field not found: ".concat(e))}(e,a),fields:()=>i.fields.slice(),extract:e=>a.extractor(e,s,i,o),hierarchy:e=>a.hierarchy(e,s,i,o),_cache:()=>i};"K"===r.qMode||"T"===r.qMode||!r.qMode&&r.qNodesOnDim?(a.extractor=Zn,a.hierarchy=Kn,a.pages="K"===r.qMode?r.qStackedDataPages:r.qTreeDataPages):"S"===r.qMode?(a.extractor=vn,a.pages=r.qDataPages,a.hierarchy=Kn):a.extractor=()=>[],a.fieldExtractor=e=>a.extractor({field:e},s,i,o);const l="S"===r.qMode?e=>e.qElemNumber:void 0,c="S"===r.qMode?e=>e.qNum:void 0;i.wrappedFields.push(...Ri("qDimensionInfo",r,e,"",mn({},a,{value:l,type:"dimension"}))),i.wrappedFields.push(...Ri("qMeasureInfo",r,e,"",mn({},a,{value:c,type:"measure"}))),i.fields=i.wrappedFields.map((e=>e.instance));const u=e=>{e.forEach((e=>{i.allFields.push(e.instance),u(e.measures),u(e.attrDims),u(e.attrExps)}))};return u(i.wrappedFields),(n.virtualFields||[]).forEach((t=>{const n=s.field(t.from),r=Ei(an({meta:n.raw(),id:"".concat(e,"/").concat(t.key),sourceField:n,fieldExtractor:e=>a.extractor({field:e},s,i,o),key:t.key,type:n.type(),localeInfo:a.localeInfo,value:n.value},t.override||{}));i.virtualFields.push(r)})),i.allFields.push(...i.virtualFields),s}const Oi=[["qHyperCube","qHyperCubeDef"],["qTreeData","qTreeDataDef"],["qDimensionInfo","qDimensions"],["qMeasureInfo","qMeasures"],["qAttrDimInfo","qAttributeDimensions"],["qAttrExprInfo","qAttributeExpressions"]],Pi=/\/qDimensionInfo(?:\/(\d+))?/,Li=/\/qMeasureInfo\/(\d+)/,Ti=/\/qAttrDimInfo\/(\d+)(?:\/(\d+))?/,zi=/\/qAttrExprInfo\/(\d+)/,Fi=/\/?qHyperCube/,ji=/\/?qTreeData/,Vi=e=>"".concat(e.substr(0,e.indexOf("/qHyperCubeDef")+14)),Bi=e=>"".concat(e.substr(0,e.indexOf("/qTreeDataDef")+13));function Hi(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2?arguments[2]:void 0;const i=t.byCells,r=t.primarySource,o=[],a={},s=e.isActive();let l=!1;if(e.brushes().forEach((e=>{const t=function(e,t){let n=e,i=-1,r=-1,o="",a=e=>e;Fi.test(e)?(o="".concat(n.substr(0,n.indexOf("qHyperCube")+10)),a=Vi):ji.test(e)&&(o="".concat(n.substr(0,n.indexOf("qTreeData")+9)),a=Bi);let s=!0;if(Pi.test(e)&&(i=+Pi.exec(e)[1]),Li.test(e)&&(r=+Li.exec(e)[1]),Ti.test(e)){r=-1,i=0;const e=+Ti.exec(n)[2];isNaN(e)||(i=e,n=n.replace(/\/\d+$/,"")),s=!1}if(zi.test(e)){const e=r;if(t){r=0;const a=Ln(o,t);r+=(a.qMeasureInfo||[]).length,i>-1?(r=a.qDimensionInfo.slice(0,i).reduce(((e,t)=>e+t.qAttrExprInfo.length),r),i=-1):(r=a.qDimensionInfo.reduce(((e,t)=>e+t.qAttrExprInfo.length),r),r=a.qMeasureInfo.slice(0,e).reduce(((e,t)=>e+t.qAttrExprInfo.length),r)),r+=+zi.exec(n)[1]}else i>-1?(i=-1,r=+zi.exec(n)[1]):r+=+zi.exec(n)[1]+1}return Oi.forEach((e=>{let[t,i]=e;n=n.replace(t,i)})),s&&(n=a(n)),n&&"/"!==n[0]&&(n="/".concat(n)),{measureIdx:r,dimensionIdx:i,path:n}}(e.id,n);if("range"===e.type&&t.measureIdx>-1&&t.dimensionIdx>-1){const n=e.brush.ranges();n.length&&(l=!0,a.multiRangeSelectTreeDataValues||(a.multiRangeSelectTreeDataValues={path:t.path,ranges:[]}),n.forEach((e=>a.multiRangeSelectTreeDataValues.ranges.push({qMeasureIx:t.measureIdx,qDimensionIx:t.dimensionIdx,qRange:{qMin:e.min,qMax:e.max,qMinInclEq:!0,qMaxInclEq:!0}}))))}else{if("range"===e.type&&t.measureIdx>-1){const n=e.brush.ranges();n.length&&(l=!0,a.rangeSelectHyperCubeValues||(a.rangeSelectHyperCubeValues={path:t.path,ranges:[]}),n.forEach((e=>a.rangeSelectHyperCubeValues.ranges.push({qMeasureIx:t.measureIdx,qRange:{qMin:e.min,qMax:e.max,qMinInclEq:!0,qMaxInclEq:!0}}))))}if("range"===e.type&&t.dimensionIdx>-1){const n=e.brush.ranges();n.length&&(l=!0,a.selectHyperCubeContinuousRange||(a.selectHyperCubeContinuousRange={path:t.path,ranges:[]}),n.forEach((e=>a.selectHyperCubeContinuousRange.ranges.push({qDimIx:t.dimensionIdx,qRange:{qMin:e.min,qMax:e.max,qMinInclEq:!0,qMaxInclEq:!1}}))))}if("value"===e.type&&t.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(t.dimensionIdx);if(a.selectPivotCells||(a.selectPivotCells={path:t.path,cells:[]}),e.id===r||!r){const n=e.brush.values().map((e=>+e)).filter((e=>!isNaN(e)));(0===o||s>=o)&&o>-1?n.forEach((e=>{a.selectPivotCells.cells.push({qType:"T",qCol:e,qRow:s-o})})):n.forEach((e=>{a.selectPivotCells.cells.push({qType:"L",qCol:t.dimensionIdx,qRow:e})})),l=!!a.selectPivotCells.cells.length}}else a.selectHyperCubeCells||(a.selectHyperCubeCells={path:t.path,cols:[]}),a.selectHyperCubeCells.cols.push(t.dimensionIdx),e.id!==r&&(r||a.selectHyperCubeCells.values)||(a.selectHyperCubeCells.values=e.brush.values().map((e=>+e)).filter((e=>!isNaN(e))),l=!!a.selectHyperCubeCells.values.length);else{const n=e.brush.values().map((e=>+e)).filter((e=>!isNaN(e)));l=!!n.length,o.push({params:[t.path,t.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=t.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 $i(e){Ii.util=e.data("matrix").util,e.data("q",Ii),e.formatter("q-number",gi),e.formatter("q-time",Ni)}$i.qBrushHelper=Hi,$i.selections=Hi;var Wi=Object.prototype.hasOwnProperty,Ui=Object.prototype.toString,Yi=Object.defineProperty,Gi=Object.getOwnPropertyDescriptor,Xi=function(e){return"function"==typeof Array.isArray?Array.isArray(e):"[object Array]"===Ui.call(e)},Ki=function(e){if(!e||"[object Object]"!==Ui.call(e))return!1;var t,n=Wi.call(e,"constructor"),i=e.constructor&&e.constructor.prototype&&Wi.call(e.constructor.prototype,"isPrototypeOf");if(e.constructor&&!n&&!i)return!1;for(t in e);return void 0===t||Wi.call(e,t)},Zi=function(e,t){Yi&&"__proto__"===t.name?Yi(e,t.name,{enumerable:!0,configurable:!0,value:t.newValue,writable:!0}):e[t.name]=t.newValue},Ji=function(e,t){if("__proto__"===t){if(!Wi.call(e,t))return;if(Gi)return Gi(e,t).value}return e[t]},Qi=function e(){var t,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!=(t=arguments[l]))for(n in t)i=Ji(s,n),s!==(r=Ji(t,n))&&(u&&r&&(Ki(r)||(o=Xi(r)))?(o?(o=!1,a=i&&Xi(i)?i:[]):a=i&&Ki(i)?i:{},Zi(s,{name:n,newValue:e(u,a,r)})):void 0!==r&&Zi(s,{name:n,newValue:r}));return s},er="2.8.0";function tr(e,t,n){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var i=n.call(e,t||"default");if("object"!=typeof i)return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function nr(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,i)}return n}function ir(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?nr(Object(n),!0).forEach((function(t){tr(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):nr(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function rr(e){return!!e.changedTouches}function or(e){return"number"==typeof e&&!isNaN(e)}function ar(e){return"number"!=typeof e||isNaN(e)}function sr(e){const t=e.length;let n=NaN,i=NaN,r=NaN,o=NaN;for(let a=0;a<t;a++)n=isNaN(n)?e[a].x:Math.min(n,e[a].x),i=isNaN(i)?e[a].x:Math.max(i,e[a].x),r=isNaN(r)?e[a].y:Math.min(r,e[a].y),o=isNaN(o)?e[a].y:Math.max(o,e[a].y);return[n,r,i,o]}function lr(e){return[{x:e.x1||0,y:e.y1||0},{x:e.x2||0,y:e.y2||0}]}function cr(e){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}]}function ur(e){const[t,n,i,r]=sr(e);return{x:t,y:n,width:i-t,height:r-n}}function hr(e){return{x1:e[0].x,y1:e[0].y,x2:e[1].x,y2:e[1].y}}function dr(e){const{x:t,y:n,width:i,height:r,x1:o,x2:a,y1:s,y2:l,cx:c,cy:u,r:h,vertices:d}=e||{};return or(c)&&or(u)&&or(h)?"circle":or(o)&&or(a)&&or(s)&&or(l)?"line":or(t)&&or(n)&&or(i)&&or(r)?"rect":or(t)&&or(n)?"point":Array.isArray(d)?d.every((e=>Array.isArray(e)))?"geopolygon":"polygon":null}function fr(e,t){return{x:t.x-e,y:t.y-e,width:t.width+e,height:t.height+e}}var pr=Math.PI,mr=2*pr,gr=1e-6,yr=mr-gr;function xr(){this._x0=this._y0=this._x1=this._y1=null,this._=""}function vr(){return new xr}function br(e){return function(){return e}}xr.prototype=vr.prototype={constructor:xr,moveTo:function(e,t){this._+="M"+(this._x0=this._x1=+e)+","+(this._y0=this._y1=+t)},closePath:function(){null!==this._x1&&(this._x1=this._x0,this._y1=this._y0,this._+="Z")},lineTo:function(e,t){this._+="L"+(this._x1=+e)+","+(this._y1=+t)},quadraticCurveTo:function(e,t,n,i){this._+="Q"+ +e+","+ +t+","+(this._x1=+n)+","+(this._y1=+i)},bezierCurveTo:function(e,t,n,i,r,o){this._+="C"+ +e+","+ +t+","+ +n+","+ +i+","+(this._x1=+r)+","+(this._y1=+o)},arcTo:function(e,t,n,i,r){e=+e,t=+t,n=+n,i=+i,r=+r;var o=this._x1,a=this._y1,s=n-e,l=i-t,c=o-e,u=a-t,h=c*c+u*u;if(r<0)throw new Error("negative radius: "+r);if(null===this._x1)this._+="M"+(this._x1=e)+","+(this._y1=t);else if(h>gr)if(Math.abs(u*s-l*c)>gr&&r){var d=n-o,f=i-a,p=s*s+l*l,m=d*d+f*f,g=Math.sqrt(p),y=Math.sqrt(h),x=r*Math.tan((pr-Math.acos((p+h-m)/(2*g*y)))/2),v=x/y,b=x/g;Math.abs(v-1)>gr&&(this._+="L"+(e+v*c)+","+(t+v*u)),this._+="A"+r+","+r+",0,0,"+ +(u*d>c*f)+","+(this._x1=e+b*s)+","+(this._y1=t+b*l)}else this._+="L"+(this._x1=e)+","+(this._y1=t);else;},arc:function(e,t,n,i,r,o){e=+e,t=+t,o=!!o;var a=(n=+n)*Math.cos(i),s=n*Math.sin(i),l=e+a,c=t+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)>gr||Math.abs(this._y1-c)>gr)&&(this._+="L"+l+","+c),n&&(h<0&&(h=h%mr+mr),h>yr?this._+="A"+n+","+n+",0,1,"+u+","+(e-a)+","+(t-s)+"A"+n+","+n+",0,1,"+u+","+(this._x1=l)+","+(this._y1=c):h>gr&&(this._+="A"+n+","+n+",0,"+ +(h>=pr)+","+u+","+(this._x1=e+n*Math.cos(r))+","+(this._y1=t+n*Math.sin(r))))},rect:function(e,t,n,i){this._+="M"+(this._x0=this._x1=+e)+","+(this._y0=this._y1=+t)+"h"+ +n+"v"+ +i+"h"+-n+"Z"},toString:function(){return this._}};var wr=Math.abs,Mr=Math.atan2,kr=Math.cos,Sr=Math.max,_r=Math.min,qr=Math.sin,Dr=Math.sqrt,Ar=1e-12,Cr=Math.PI,Nr=Cr/2,Er=2*Cr;function Rr(e){return e>=1?Nr:e<=-1?-Nr:Math.asin(e)}function Ir(e){return e.innerRadius}function Or(e){return e.outerRadius}function Pr(e){return e.startAngle}function Lr(e){return e.endAngle}function Tr(e){return e&&e.padAngle}function zr(e,t,n,i,r,o,a){var s=e-n,l=t-i,c=(a?o:-o)/Dr(s*s+l*l),u=c*l,h=-c*s,d=e+u,f=t+h,p=n+u,m=i+h,g=(d+p)/2,y=(f+m)/2,x=p-d,v=m-f,b=x*x+v*v,w=r-o,M=d*m-p*f,k=(v<0?-1:1)*Dr(Sr(0,w*w*b-M*M)),S=(M*v-x*k)/b,_=(-M*x-v*k)/b,q=(M*v+x*k)/b,D=(-M*x+v*k)/b,A=S-g,C=_-y,N=q-g,E=D-y;return A*A+C*C>N*N+E*E&&(S=q,_=D),{cx:S,cy:_,x01:-u,y01:-h,x11:S*(r/w-1),y11:_*(r/w-1)}}function Fr(){var e=Ir,t=Or,n=br(0),i=null,r=Pr,o=Lr,a=Tr,s=null;function l(){var l,c,u=+e.apply(this,arguments),h=+t.apply(this,arguments),d=r.apply(this,arguments)-Nr,f=o.apply(this,arguments)-Nr,p=wr(f-d),m=f>d;if(s||(s=l=vr()),h<u&&(c=h,h=u,u=c),h>Ar)if(p>Er-Ar)s.moveTo(h*kr(d),h*qr(d)),s.arc(0,0,h,d,f,!m),u>Ar&&(s.moveTo(u*kr(f),u*qr(f)),s.arc(0,0,u,f,d,m));else{var g,y,x=d,v=f,b=d,w=f,M=p,k=p,S=a.apply(this,arguments)/2,_=S>Ar&&(i?+i.apply(this,arguments):Dr(u*u+h*h)),q=_r(wr(h-u)/2,+n.apply(this,arguments)),D=q,A=q;if(_>Ar){var C=Rr(_/u*qr(S)),N=Rr(_/h*qr(S));(M-=2*C)>Ar?(b+=C*=m?1:-1,w-=C):(M=0,b=w=(d+f)/2),(k-=2*N)>Ar?(x+=N*=m?1:-1,v-=N):(k=0,x=v=(d+f)/2)}var E=h*kr(x),R=h*qr(x),I=u*kr(w),O=u*qr(w);if(q>Ar){var P,L=h*kr(v),T=h*qr(v),z=u*kr(b),F=u*qr(b);if(p<Cr&&(P=function(e,t,n,i,r,o,a,s){var l=n-e,c=i-t,u=a-r,h=s-o,d=h*l-u*c;if(!(d*d<Ar))return[e+(d=(u*(t-o)-h*(e-r))/d)*l,t+d*c]}(E,R,z,F,L,T,I,O))){var j=E-P[0],V=R-P[1],B=L-P[0],H=T-P[1],$=1/qr(function(e){return e>1?0:e<-1?Cr:Math.acos(e)}((j*B+V*H)/(Dr(j*j+V*V)*Dr(B*B+H*H)))/2),W=Dr(P[0]*P[0]+P[1]*P[1]);D=_r(q,(u-W)/($-1)),A=_r(q,(h-W)/($+1))}}k>Ar?A>Ar?(g=zr(z,F,E,R,h,A,m),y=zr(L,T,I,O,h,A,m),s.moveTo(g.cx+g.x01,g.cy+g.y01),A<q?s.arc(g.cx,g.cy,A,Mr(g.y01,g.x01),Mr(y.y01,y.x01),!m):(s.arc(g.cx,g.cy,A,Mr(g.y01,g.x01),Mr(g.y11,g.x11),!m),s.arc(0,0,h,Mr(g.cy+g.y11,g.cx+g.x11),Mr(y.cy+y.y11,y.cx+y.x11),!m),s.arc(y.cx,y.cy,A,Mr(y.y11,y.x11),Mr(y.y01,y.x01),!m))):(s.moveTo(E,R),s.arc(0,0,h,x,v,!m)):s.moveTo(E,R),u>Ar&&M>Ar?D>Ar?(g=zr(I,O,L,T,u,-D,m),y=zr(E,R,z,F,u,-D,m),s.lineTo(g.cx+g.x01,g.cy+g.y01),D<q?s.arc(g.cx,g.cy,D,Mr(g.y01,g.x01),Mr(y.y01,y.x01),!m):(s.arc(g.cx,g.cy,D,Mr(g.y01,g.x01),Mr(g.y11,g.x11),!m),s.arc(0,0,u,Mr(g.cy+g.y11,g.cx+g.x11),Mr(y.cy+y.y11,y.cx+y.x11),m),s.arc(y.cx,y.cy,D,Mr(y.y11,y.x11),Mr(y.y01,y.x01),!m))):s.arc(0,0,u,w,b,m):s.lineTo(I,O)}else s.moveTo(0,0);if(s.closePath(),l)return s=null,l+""||null}return l.centroid=function(){var n=(+e.apply(this,arguments)+ +t.apply(this,arguments))/2,i=(+r.apply(this,arguments)+ +o.apply(this,arguments))/2-Cr/2;return[kr(i)*n,qr(i)*n]},l.innerRadius=function(t){return arguments.length?(e="function"==typeof t?t:br(+t),l):e},l.outerRadius=function(e){return arguments.length?(t="function"==typeof e?e:br(+e),l):t},l.cornerRadius=function(e){return arguments.length?(n="function"==typeof e?e:br(+e),l):n},l.padRadius=function(e){return arguments.length?(i=null==e?null:"function"==typeof e?e:br(+e),l):i},l.startAngle=function(e){return arguments.length?(r="function"==typeof e?e:br(+e),l):r},l.endAngle=function(e){return arguments.length?(o="function"==typeof e?e:br(+e),l):o},l.padAngle=function(e){return arguments.length?(a="function"==typeof e?e:br(+e),l):a},l.context=function(e){return arguments.length?(s=null==e?null:e,l):s},l}function jr(e){this._context=e}function Vr(e){return new jr(e)}function Br(e){return e[0]}function Hr(e){return e[1]}function $r(){var e=Br,t=null,n=br(0),i=Hr,r=br(!0),o=null,a=Vr,s=null;function l(l){var c,u,h,d,f,p=l.length,m=!1,g=new Array(p),y=new Array(p);for(null==o&&(s=a(f=vr())),c=0;c<=p;++c){if(!(c<p&&r(d=l[c],c,l))===m)if(m=!m)u=c,s.areaStart(),s.lineStart();else{for(s.lineEnd(),s.lineStart(),h=c-1;h>=u;--h)s.point(g[h],y[h]);s.lineEnd(),s.areaEnd()}m&&(g[c]=+e(d,c,l),y[c]=+n(d,c,l),s.point(t?+t(d,c,l):g[c],i?+i(d,c,l):y[c]))}if(f)return s=null,f+""||null}function c(){return function(){var e=Br,t=Hr,n=br(!0),i=null,r=Vr,o=null;function a(a){var s,l,c,u=a.length,h=!1;for(null==i&&(o=r(c=vr())),s=0;s<=u;++s)!(s<u&&n(l=a[s],s,a))===h&&((h=!h)?o.lineStart():o.lineEnd()),h&&o.point(+e(l,s,a),+t(l,s,a));if(c)return o=null,c+""||null}return a.x=function(t){return arguments.length?(e="function"==typeof t?t:br(+t),a):e},a.y=function(e){return arguments.length?(t="function"==typeof e?e:br(+e),a):t},a.defined=function(e){return arguments.length?(n="function"==typeof e?e:br(!!e),a):n},a.curve=function(e){return arguments.length?(r=e,null!=i&&(o=r(i)),a):r},a.context=function(e){return arguments.length?(null==e?i=o=null:o=r(i=e),a):i},a}().defined(r).curve(a).context(o)}return l.x=function(n){return arguments.length?(e="function"==typeof n?n:br(+n),t=null,l):e},l.x0=function(t){return arguments.length?(e="function"==typeof t?t:br(+t),l):e},l.x1=function(e){return arguments.length?(t=null==e?null:"function"==typeof e?e:br(+e),l):t},l.y=function(e){return arguments.length?(n="function"==typeof e?e:br(+e),i=null,l):n},l.y0=function(e){return arguments.length?(n="function"==typeof e?e:br(+e),l):n},l.y1=function(e){return arguments.length?(i=null==e?null:"function"==typeof e?e:br(+e),l):i},l.lineX0=l.lineY0=function(){return c().x(e).y(n)},l.lineY1=function(){return c().x(e).y(i)},l.lineX1=function(){return c().x(t).y(n)},l.defined=function(e){return arguments.length?(r="function"==typeof e?e:br(!!e),l):r},l.curve=function(e){return arguments.length?(a=e,null!=o&&(s=a(o)),l):a},l.context=function(e){return arguments.length?(null==e?o=s=null:s=a(o=e),l):o},l}function Wr(e,t){return t<e?-1:t>e?1:t>=e?0:NaN}function Ur(e){return e}jr.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(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;default:this._context.lineTo(e,t)}}};var Yr=Array.prototype.slice;function Gr(e,t,n){e._context.bezierCurveTo((2*e._x0+e._x1)/3,(2*e._y0+e._y1)/3,(e._x0+2*e._x1)/3,(e._y0+2*e._y1)/3,(e._x0+4*e._x1+t)/6,(e._y0+4*e._y1+n)/6)}function Xr(e){this._context=e}function Kr(e,t,n){e._context.bezierCurveTo(e._x1+e._k*(e._x2-e._x0),e._y1+e._k*(e._y2-e._y0),e._x2+e._k*(e._x1-t),e._y2+e._k*(e._y1-n),e._x2,e._y2)}function Zr(e,t){this._context=e,this._k=(1-t)/6}Xr.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:Gr(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(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);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:Gr(this,e,t)}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}},Zr.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:Kr(this,this._x1,this._y1)}(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2,this._x1=e,this._y1=t;break;case 2:this._point=3;default:Kr(this,e,t)}this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};var Jr=function e(t){function n(e){return new Zr(e,t)}return n.tension=function(t){return e(+t)},n}(0);function Qr(e,t){this._context=e,this._alpha=t}Qr.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(e,t){if(e=+e,t=+t,this._point){var n=this._x2-e,i=this._y2-t;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(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3;default:!function(e,t,n){var i=e._x1,r=e._y1,o=e._x2,a=e._y2;if(e._l01_a>Ar){var s=2*e._l01_2a+3*e._l01_a*e._l12_a+e._l12_2a,l=3*e._l01_a*(e._l01_a+e._l12_a);i=(i*s-e._x0*e._l12_2a+e._x2*e._l01_2a)/l,r=(r*s-e._y0*e._l12_2a+e._y2*e._l01_2a)/l}if(e._l23_a>Ar){var c=2*e._l23_2a+3*e._l23_a*e._l12_a+e._l12_2a,u=3*e._l23_a*(e._l23_a+e._l12_a);o=(o*c+e._x1*e._l23_2a-t*e._l12_2a)/u,a=(a*c+e._y1*e._l23_2a-n*e._l12_2a)/u}e._context.bezierCurveTo(i,r,o,a,e._x2,e._y2)}(this,e,t)}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=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};var eo=function e(t){function n(e){return t?new Qr(e,t):new Zr(e,0)}return n.alpha=function(t){return e(+t)},n}(.5);function to(e){return e<0?-1:1}function no(e,t,n){var i=e._x1-e._x0,r=t-e._x1,o=(e._y1-e._y0)/(i||r<0&&-0),a=(n-e._y1)/(r||i<0&&-0),s=(o*r+a*i)/(i+r);return(to(o)+to(a))*Math.min(Math.abs(o),Math.abs(a),.5*Math.abs(s))||0}function io(e,t){var n=e._x1-e._x0;return n?(3*(e._y1-e._y0)/n-t)/2:t}function ro(e,t,n){var i=e._x0,r=e._y0,o=e._x1,a=e._y1,s=(o-i)/3;e._context.bezierCurveTo(i+s,r+s*t,o-s,a-s*n,o,a)}function oo(e){this._context=e}function ao(e){this._context=new so(e)}function so(e){this._context=e}function lo(e){this._context=e}function co(e){var t,n,i=e.length-1,r=new Array(i),o=new Array(i),a=new Array(i);for(r[0]=0,o[0]=2,a[0]=e[0]+2*e[1],t=1;t<i-1;++t)r[t]=1,o[t]=4,a[t]=4*e[t]+2*e[t+1];for(r[i-1]=2,o[i-1]=7,a[i-1]=8*e[i-1]+e[i],t=1;t<i;++t)n=r[t]/o[t-1],o[t]-=n,a[t]-=n*a[t-1];for(r[i-1]=a[i-1]/o[i-1],t=i-2;t>=0;--t)r[t]=(a[t]-r[t+1])/o[t];for(o[i-1]=(e[i]+r[i-1])/2,t=0;t<i-1;++t)o[t]=2*e[t+1]-r[t+1];return[r,o]}function uo(e,t){this._context=e,this._t=t}function ho(e,t){if((r=e.length)>1)for(var n,i,r,o=1,a=e[t[0]],s=a.length;o<r;++o)for(i=a,a=e[t[o]],n=0;n<s;++n)a[n][1]+=a[n][0]=isNaN(i[n][1])?i[n][0]:i[n][1]}function fo(e){for(var t=e.length,n=new Array(t);--t>=0;)n[t]=t;return n}function po(e,t){return e[t]}function mo(e){for(var t,n=-1,i=0,r=e.length,o=-1/0;++n<r;)(t=+e[n][1])>o&&(o=t,i=n);return i}function go(e){for(var t,n=0,i=-1,r=e.length;++i<r;)(t=+e[i][1])&&(n+=t);return n}function yo(e){let t,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"unspecified",i=arguments.length>2?arguments[2]:void 0;const r={},o=e||{get:()=>{},has:()=>!1,default:()=>{}};function a(e,t){if(!e||"string"!=typeof e)throw new TypeError("Invalid argument: key must be a non-empty string");return!(e in r)&&(r[e]=t,!0)}function s(e){return r[e]||o.get(e)}function l(e,r){if(void 0!==r)return a(e,r);const o=s(e);return i&&void 0===o&&i.warn("".concat(e," does not exist in ").concat(n," registry")),o||s(t)}return t=o.default(),l.add=a,l.get=s,l.has=function(e){return!!r[e]||o.has(e)},l.remove=function(e){const t=r[e];return delete r[e],t},l.getKeys=function(){return Object.keys(r)},l.getValues=function(){return Object.keys(r).map((e=>r[e]))},l.default=function(e){return void 0!==e&&(t=e),t},l.register=a,l}function xo(e,t){if((n=(e=t?e.toExponential(t-1):e.toExponential()).indexOf("e"))<0)return null;var n,i=e.slice(0,n);return[i.length>1?i[0]+i.slice(2):i,+e.slice(n+1)]}function vo(e){return(e=xo(Math.abs(e)))?e[1]:NaN}oo.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:ro(this,this._t0,io(this,this._t0))}(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){var n=NaN;if(t=+t,(e=+e)!==this._x1||t!==this._y1){switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3,ro(this,io(this,n=no(this,e,t)),n);break;default:ro(this,this._t0,n=no(this,e,t))}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t,this._t0=n}}},(ao.prototype=Object.create(oo.prototype)).point=function(e,t){oo.prototype.point.call(this,t,e)},so.prototype={moveTo:function(e,t){this._context.moveTo(t,e)},closePath:function(){this._context.closePath()},lineTo:function(e,t){this._context.lineTo(t,e)},bezierCurveTo:function(e,t,n,i,r,o){this._context.bezierCurveTo(t,e,i,n,o,r)}},lo.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=[],this._y=[]},lineEnd:function(){var e=this._x,t=this._y,n=e.length;if(n)if(this._line?this._context.lineTo(e[0],t[0]):this._context.moveTo(e[0],t[0]),2===n)this._context.lineTo(e[1],t[1]);else for(var i=co(e),r=co(t),o=0,a=1;a<n;++o,++a)this._context.bezierCurveTo(i[0][o],r[0][o],i[1][o],r[1][o],e[a],t[a]);(this._line||0!==this._line&&1===n)&&this._context.closePath(),this._line=1-this._line,this._x=this._y=null},point:function(e,t){this._x.push(+e),this._y.push(+t)}},uo.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(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;default:if(this._t<=0)this._context.lineTo(this._x,t),this._context.lineTo(e,t);else{var n=this._x*(1-this._t)+e*this._t;this._context.lineTo(n,this._y),this._context.lineTo(n,t)}}this._x=e,this._y=t}};var bo,wo=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function Mo(e){if(!(t=wo.exec(e)))throw new Error("invalid format: "+e);var t;return new ko({fill:t[1],align:t[2],sign:t[3],symbol:t[4],zero:t[5],width:t[6],comma:t[7],precision:t[8]&&t[8].slice(1),trim:t[9],type:t[10]})}function ko(e){this.fill=void 0===e.fill?" ":e.fill+"",this.align=void 0===e.align?">":e.align+"",this.sign=void 0===e.sign?"-":e.sign+"",this.symbol=void 0===e.symbol?"":e.symbol+"",this.zero=!!e.zero,this.width=void 0===e.width?void 0:+e.width,this.comma=!!e.comma,this.precision=void 0===e.precision?void 0:+e.precision,this.trim=!!e.trim,this.type=void 0===e.type?"":e.type+""}function So(e,t){var n=xo(e,t);if(!n)return e+"";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")}Mo.prototype=ko.prototype,ko.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 _o={"%":(e,t)=>(100*e).toFixed(t),b:e=>Math.round(e).toString(2),c:e=>e+"",d:function(e){return Math.abs(e=Math.round(e))>=1e21?e.toLocaleString("en").replace(/,/g,""):e.toString(10)},e:(e,t)=>e.toExponential(t),f:(e,t)=>e.toFixed(t),g:(e,t)=>e.toPrecision(t),o:e=>Math.round(e).toString(8),p:(e,t)=>So(100*e,t),r:So,s:function(e,t){var n=xo(e,t);if(!n)return e+"";var i=n[0],r=n[1],o=r-(bo=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")+xo(e,Math.max(0,t+o-1))[0]},X:e=>Math.round(e).toString(16).toUpperCase(),x:e=>Math.round(e).toString(16)};function qo(e){return e}var Do,Ao,Co,No=Array.prototype.map,Eo=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function Ro(e){var t,n,i=void 0===e.grouping||void 0===e.thousands?qo:(t=No.call(e.grouping,Number),n=e.thousands+"",function(e,i){for(var r=e.length,o=[],a=0,s=t[0],l=0;r>0&&s>0&&(l+s+1>i&&(s=Math.max(1,i-l)),o.push(e.substring(r-=s,r+s)),!((l+=s+1)>i));)s=t[a=(a+1)%t.length];return o.reverse().join(n)}),r=void 0===e.currency?"":e.currency[0]+"",o=void 0===e.currency?"":e.currency[1]+"",a=void 0===e.decimal?".":e.decimal+"",s=void 0===e.numerals?qo:function(e){return function(t){return t.replace(/[0-9]/g,(function(t){return e[+t]}))}}(No.call(e.numerals,String)),l=void 0===e.percent?"%":e.percent+"",c=void 0===e.minus?"−":e.minus+"",u=void 0===e.nan?"NaN":e.nan+"";function h(e){var t=(e=Mo(e)).fill,n=e.align,h=e.sign,d=e.symbol,f=e.zero,p=e.width,m=e.comma,g=e.precision,y=e.trim,x=e.type;"n"===x?(m=!0,x="g"):_o[x]||(void 0===g&&(g=12),y=!0,x="g"),(f||"0"===t&&"="===n)&&(f=!0,t="0",n="=");var v="$"===d?r:"#"===d&&/[boxX]/.test(x)?"0"+x.toLowerCase():"",b="$"===d?o:/[%p]/.test(x)?l:"",w=_o[x],M=/[defgprs%]/.test(x);function k(e){var r,o,l,d=v,k=b;if("c"===x)k=w(e)+k,e="";else{var S=(e=+e)<0||1/e<0;if(e=isNaN(e)?u:w(Math.abs(e),g),y&&(e=function(e){e:for(var t,n=e.length,i=1,r=-1;i<n;++i)switch(e[i]){case".":r=t=i;break;case"0":0===r&&(r=i),t=i;break;default:if(!+e[i])break e;r>0&&(r=0)}return r>0?e.slice(0,r)+e.slice(t+1):e}(e)),S&&0==+e&&"+"!==h&&(S=!1),d=(S?"("===h?h:c:"-"===h||"("===h?"":h)+d,k=("s"===x?Eo[8+bo/3]:"")+k+(S&&"("===h?")":""),M)for(r=-1,o=e.length;++r<o;)if(48>(l=e.charCodeAt(r))||l>57){k=(46===l?a+e.slice(r+1):e.slice(r))+k,e=e.slice(0,r);break}}m&&!f&&(e=i(e,1/0));var _=d.length+e.length+k.length,q=_<p?new Array(p-_+1).join(t):"";switch(m&&f&&(e=i(q+e,q.length?p-k.length:1/0),q=""),n){case"<":e=d+e+k+q;break;case"=":e=d+q+e+k;break;case"^":e=q.slice(0,_=q.length>>1)+d+e+k+q.slice(_);break;default:e=q+d+e+k}return s(e)}return g=void 0===g?6:/[gprs]/.test(x)?Math.max(1,Math.min(21,g)):Math.max(0,Math.min(20,g)),k.toString=function(){return e+""},k}return{format:h,formatPrefix:function(e,t){var n=h(((e=Mo(e)).type="f",e)),i=3*Math.max(-8,Math.min(8,Math.floor(vo(t)/3))),r=Math.pow(10,-i),o=Eo[8+i/3];return function(e){return n(r*e)+o}}}}!function(e){Do=Ro(e),Ao=Do.format,Co=Do.formatPrefix}({thousands:",",grouping:[3],currency:["$",""]});const Io=new Date,Oo=new Date;function Po(e,t,n,i){function r(t){return e(t=0===arguments.length?new Date:new Date(+t)),t}return r.floor=t=>(e(t=new Date(+t)),t),r.ceil=n=>(e(n=new Date(n-1)),t(n,1),e(n),n),r.round=e=>{const t=r(e),n=r.ceil(e);return e-t<n-e?t:n},r.offset=(e,n)=>(t(e=new Date(+e),null==n?1:Math.floor(n)),e),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)),t(n,o),e(n)}while(s<n&&n<i);return a},r.filter=n=>Po((t=>{if(t>=t)for(;e(t),!n(t);)t.setTime(t-1)}),((e,i)=>{if(e>=e)if(i<0)for(;++i<=0;)for(;t(e,-1),!n(e););else for(;--i>=0;)for(;t(e,1),!n(e););})),n&&(r.count=(t,i)=>(Io.setTime(+t),Oo.setTime(+i),e(Io),e(Oo),Math.floor(n(Io,Oo))),r.every=e=>(e=Math.floor(e),isFinite(e)&&e>0?e>1?r.filter(i?t=>i(t)%e==0:t=>r.count(0,t)%e==0):r:null)),r}const Lo=6e4,To=864e5,zo=6048e5,Fo=Po((e=>e.setHours(0,0,0,0)),((e,t)=>e.setDate(e.getDate()+t)),((e,t)=>(t-e-(t.getTimezoneOffset()-e.getTimezoneOffset())*Lo)/To),(e=>e.getDate()-1));Fo.range;const jo=Po((e=>{e.setUTCHours(0,0,0,0)}),((e,t)=>{e.setUTCDate(e.getUTCDate()+t)}),((e,t)=>(t-e)/To),(e=>e.getUTCDate()-1));jo.range;const Vo=Po((e=>{e.setUTCHours(0,0,0,0)}),((e,t)=>{e.setUTCDate(e.getUTCDate()+t)}),((e,t)=>(t-e)/To),(e=>Math.floor(e/To)));function Bo(e){return Po((t=>{t.setDate(t.getDate()-(t.getDay()+7-e)%7),t.setHours(0,0,0,0)}),((e,t)=>{e.setDate(e.getDate()+7*t)}),((e,t)=>(t-e-(t.getTimezoneOffset()-e.getTimezoneOffset())*Lo)/zo))}Vo.range;const Ho=Bo(0),$o=Bo(1),Wo=Bo(2),Uo=Bo(3),Yo=Bo(4),Go=Bo(5),Xo=Bo(6);function Ko(e){return Po((t=>{t.setUTCDate(t.getUTCDate()-(t.getUTCDay()+7-e)%7),t.setUTCHours(0,0,0,0)}),((e,t)=>{e.setUTCDate(e.getUTCDate()+7*t)}),((e,t)=>(t-e)/zo))}Ho.range,$o.range,Wo.range,Uo.range,Yo.range,Go.range,Xo.range;const Zo=Ko(0),Jo=Ko(1),Qo=Ko(2),ea=Ko(3),ta=Ko(4),na=Ko(5),ia=Ko(6);Zo.range,Jo.range,Qo.range,ea.range,ta.range,na.range,ia.range;const ra=Po((e=>{e.setMonth(0,1),e.setHours(0,0,0,0)}),((e,t)=>{e.setFullYear(e.getFullYear()+t)}),((e,t)=>t.getFullYear()-e.getFullYear()),(e=>e.getFullYear()));ra.every=e=>isFinite(e=Math.floor(e))&&e>0?Po((t=>{t.setFullYear(Math.floor(t.getFullYear()/e)*e),t.setMonth(0,1),t.setHours(0,0,0,0)}),((t,n)=>{t.setFullYear(t.getFullYear()+n*e)})):null,ra.range;const oa=Po((e=>{e.setUTCMonth(0,1),e.setUTCHours(0,0,0,0)}),((e,t)=>{e.setUTCFullYear(e.getUTCFullYear()+t)}),((e,t)=>t.getUTCFullYear()-e.getUTCFullYear()),(e=>e.getUTCFullYear()));function aa(e,t){return null==e||null==t?NaN:e<t?-1:e>t?1:e>=t?0:NaN}function sa(e,t){return null==e||null==t?NaN:t<e?-1:t>e?1:t>=e?0:NaN}function la(e){let t,n,i;function r(e,i,r=0,o=e.length){if(r<o){if(0!==t(i,i))return o;do{const t=r+o>>>1;n(e[t],i)<0?r=t+1:o=t}while(r<o)}return r}return 2!==e.length?(t=aa,n=(t,n)=>aa(e(t),n),i=(t,n)=>e(t)-n):(t=e===aa||e===sa?e:ca,n=e,i=e),{left:r,center:function(e,t,n=0,o=e.length){const a=r(e,t,n,o-1);return a>n&&i(e[a-1],t)>-i(e[a],t)?a-1:a},right:function(e,i,r=0,o=e.length){if(r<o){if(0!==t(i,i))return o;do{const t=r+o>>>1;n(e[t],i)<=0?r=t+1:o=t}while(r<o)}return r}}}function ca(){return 0}oa.every=e=>isFinite(e=Math.floor(e))&&e>0?Po((t=>{t.setUTCFullYear(Math.floor(t.getUTCFullYear()/e)*e),t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0)}),((t,n)=>{t.setUTCFullYear(t.getUTCFullYear()+n*e)})):null,oa.range;const ua=la(aa).right;la((function(e){return null===e?NaN:+e})).center;var ha=ua;class da extends Map{constructor(e,t=pa){if(super(),Object.defineProperties(this,{_intern:{value:new Map},_key:{value:t}}),null!=e)for(const[t,n]of e)this.set(t,n)}get(e){return super.get(fa(this,e))}has(e){return super.has(fa(this,e))}set(e,t){return super.set(function({_intern:e,_key:t},n){const i=t(n);return e.has(i)?e.get(i):(e.set(i,n),n)}(this,e),t)}delete(e){return super.delete(function({_intern:e,_key:t},n){const i=t(n);e.has(i)&&(n=e.get(i),e.delete(i));return n}(this,e))}}function fa({_intern:e,_key:t},n){const i=t(n);return e.has(i)?e.get(i):n}function pa(e){return null!==e&&"object"==typeof e?e.valueOf():e}const ma=Math.sqrt(50),ga=Math.sqrt(10),ya=Math.sqrt(2);function xa(e,t,n){const i=(t-e)/Math.max(0,n),r=Math.floor(Math.log10(i)),o=i/Math.pow(10,r),a=o>=ma?10:o>=ga?5:o>=ya?2:1;let s,l,c;return r<0?(c=Math.pow(10,-r)/a,s=Math.round(e*c),l=Math.round(t*c),s/c<e&&++s,l/c>t&&--l,c=-c):(c=Math.pow(10,r)*a,s=Math.round(e/c),l=Math.round(t/c),s*c<e&&++s,l*c>t&&--l),l<s&&.5<=n&&n<2?xa(e,t,2*n):[s,l,c]}function va(e,t,n){return xa(e=+e,t=+t,n=+n)[2]}function ba(e){if(0<=e.y&&e.y<100){var t=new Date(-1,e.m,e.d,e.H,e.M,e.S,e.L);return t.setFullYear(e.y),t}return new Date(e.y,e.m,e.d,e.H,e.M,e.S,e.L)}function wa(e){if(0<=e.y&&e.y<100){var t=new Date(Date.UTC(-1,e.m,e.d,e.H,e.M,e.S,e.L));return t.setUTCFullYear(e.y),t}return new Date(Date.UTC(e.y,e.m,e.d,e.H,e.M,e.S,e.L))}function Ma(e,t,n){return{y:e,m:t,d:n,H:0,M:0,S:0,L:0}}function ka(e){var t=e.dateTime,n=e.date,i=e.time,r=e.periods,o=e.days,a=e.shortDays,s=e.months,l=e.shortMonths,c=Na(r),u=Ea(r),h=Na(o),d=Ea(o),f=Na(a),p=Ea(a),m=Na(s),g=Ea(s),y=Na(l),x=Ea(l),v={a:function(e){return a[e.getDay()]},A:function(e){return o[e.getDay()]},b:function(e){return l[e.getMonth()]},B:function(e){return s[e.getMonth()]},c:null,d:Ja,e:Ja,f:is,g:ps,G:gs,H:Qa,I:es,j:ts,L:ns,m:rs,M:os,p:function(e){return r[+(e.getHours()>=12)]},q:function(e){return 1+~~(e.getMonth()/3)},Q:Fs,s:js,S:as,u:ss,U:ls,V:us,w:hs,W:ds,x:null,X:null,y:fs,Y:ms,Z:ys,"%":zs},b={a:function(e){return a[e.getUTCDay()]},A:function(e){return o[e.getUTCDay()]},b:function(e){return l[e.getUTCMonth()]},B:function(e){return s[e.getUTCMonth()]},c:null,d:xs,e:xs,f:ks,g:Os,G:Ls,H:vs,I:bs,j:ws,L:Ms,m:Ss,M:_s,p:function(e){return r[+(e.getUTCHours()>=12)]},q:function(e){return 1+~~(e.getUTCMonth()/3)},Q:Fs,s:js,S:qs,u:Ds,U:As,V:Ns,w:Es,W:Rs,x:null,X:null,y:Is,Y:Ps,Z:Ts,"%":zs},w={a:function(e,t,n){var i=f.exec(t.slice(n));return i?(e.w=p.get(i[0].toLowerCase()),n+i[0].length):-1},A:function(e,t,n){var i=h.exec(t.slice(n));return i?(e.w=d.get(i[0].toLowerCase()),n+i[0].length):-1},b:function(e,t,n){var i=y.exec(t.slice(n));return i?(e.m=x.get(i[0].toLowerCase()),n+i[0].length):-1},B:function(e,t,n){var i=m.exec(t.slice(n));return i?(e.m=g.get(i[0].toLowerCase()),n+i[0].length):-1},c:function(e,n,i){return S(e,t,n,i)},d:Ba,e:Ba,f:Ga,g:za,G:Ta,H:$a,I:$a,j:Ha,L:Ya,m:Va,M:Wa,p:function(e,t,n){var i=c.exec(t.slice(n));return i?(e.p=u.get(i[0].toLowerCase()),n+i[0].length):-1},q:ja,Q:Ka,s:Za,S:Ua,u:Ia,U:Oa,V:Pa,w:Ra,W:La,x:function(e,t,i){return S(e,n,t,i)},X:function(e,t,n){return S(e,i,t,n)},y:za,Y:Ta,Z:Fa,"%":Xa};function M(e,t){return function(n){var i,r,o,a=[],s=-1,l=0,c=e.length;for(n instanceof Date||(n=new Date(+n));++s<c;)37===e.charCodeAt(s)&&(a.push(e.slice(l,s)),null!=(r=Sa[i=e.charAt(++s)])?i=e.charAt(++s):r="e"===i?" ":"0",(o=t[i])&&(i=o(n,r)),a.push(i),l=s+1);return a.push(e.slice(l,s)),a.join("")}}function k(e,t){return function(n){var i,r,o=Ma(1900,void 0,1);if(S(o,e,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(t&&!("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=wa(Ma(o.y,0,1))).getUTCDay(),i=r>4||0===r?Jo.ceil(i):Jo(i),i=jo.offset(i,7*(o.V-1)),o.y=i.getUTCFullYear(),o.m=i.getUTCMonth(),o.d=i.getUTCDate()+(o.w+6)%7):(r=(i=ba(Ma(o.y,0,1))).getDay(),i=r>4||0===r?$o.ceil(i):$o(i),i=Fo.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?wa(Ma(o.y,0,1)).getUTCDay():ba(Ma(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,wa(o)):ba(o)}}function S(e,t,n,i){for(var r,o,a=0,s=t.length,l=n.length;a<s;){if(i>=l)return-1;if(37===(r=t.charCodeAt(a++))){if(r=t.charAt(a++),!(o=w[r in Sa?t.charAt(a++):r])||(i=o(e,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(t,v),b.x=M(n,b),b.X=M(i,b),b.c=M(t,b),{format:function(e){var t=M(e+="",v);return t.toString=function(){return e},t},parse:function(e){var t=k(e+="",!1);return t.toString=function(){return e},t},utcFormat:function(e){var t=M(e+="",b);return t.toString=function(){return e},t},utcParse:function(e){var t=k(e+="",!0);return t.toString=function(){return e},t}}}var Sa={"-":"",_:" ",0:"0"},_a=/^\s*\d+/,qa=/^%/,Da=/[\\^$*+?|[\]().{}]/g;function Aa(e,t,n){var i=e<0?"-":"",r=(i?-e:e)+"",o=r.length;return i+(o<n?new Array(n-o+1).join(t)+r:r)}function Ca(e){return e.replace(Da,"\\$&")}function Na(e){return new RegExp("^(?:"+e.map(Ca).join("|")+")","i")}function Ea(e){return new Map(e.map(((e,t)=>[e.toLowerCase(),t])))}function Ra(e,t,n){var i=_a.exec(t.slice(n,n+1));return i?(e.w=+i[0],n+i[0].length):-1}function Ia(e,t,n){var i=_a.exec(t.slice(n,n+1));return i?(e.u=+i[0],n+i[0].length):-1}function Oa(e,t,n){var i=_a.exec(t.slice(n,n+2));return i?(e.U=+i[0],n+i[0].length):-1}function Pa(e,t,n){var i=_a.exec(t.slice(n,n+2));return i?(e.V=+i[0],n+i[0].length):-1}function La(e,t,n){var i=_a.exec(t.slice(n,n+2));return i?(e.W=+i[0],n+i[0].length):-1}function Ta(e,t,n){var i=_a.exec(t.slice(n,n+4));return i?(e.y=+i[0],n+i[0].length):-1}function za(e,t,n){var i=_a.exec(t.slice(n,n+2));return i?(e.y=+i[0]+(+i[0]>68?1900:2e3),n+i[0].length):-1}function Fa(e,t,n){var i=/^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(t.slice(n,n+6));return i?(e.Z=i[1]?0:-(i[2]+(i[3]||"00")),n+i[0].length):-1}function ja(e,t,n){var i=_a.exec(t.slice(n,n+1));return i?(e.q=3*i[0]-3,n+i[0].length):-1}function Va(e,t,n){var i=_a.exec(t.slice(n,n+2));return i?(e.m=i[0]-1,n+i[0].length):-1}function Ba(e,t,n){var i=_a.exec(t.slice(n,n+2));return i?(e.d=+i[0],n+i[0].length):-1}function Ha(e,t,n){var i=_a.exec(t.slice(n,n+3));return i?(e.m=0,e.d=+i[0],n+i[0].length):-1}function $a(e,t,n){var i=_a.exec(t.slice(n,n+2));return i?(e.H=+i[0],n+i[0].length):-1}function Wa(e,t,n){var i=_a.exec(t.slice(n,n+2));return i?(e.M=+i[0],n+i[0].length):-1}function Ua(e,t,n){var i=_a.exec(t.slice(n,n+2));return i?(e.S=+i[0],n+i[0].length):-1}function Ya(e,t,n){var i=_a.exec(t.slice(n,n+3));return i?(e.L=+i[0],n+i[0].length):-1}function Ga(e,t,n){var i=_a.exec(t.slice(n,n+6));return i?(e.L=Math.floor(i[0]/1e3),n+i[0].length):-1}function Xa(e,t,n){var i=qa.exec(t.slice(n,n+1));return i?n+i[0].length:-1}function Ka(e,t,n){var i=_a.exec(t.slice(n));return i?(e.Q=+i[0],n+i[0].length):-1}function Za(e,t,n){var i=_a.exec(t.slice(n));return i?(e.s=+i[0],n+i[0].length):-1}function Ja(e,t){return Aa(e.getDate(),t,2)}function Qa(e,t){return Aa(e.getHours(),t,2)}function es(e,t){return Aa(e.getHours()%12||12,t,2)}function ts(e,t){return Aa(1+Fo.count(ra(e),e),t,3)}function ns(e,t){return Aa(e.getMilliseconds(),t,3)}function is(e,t){return ns(e,t)+"000"}function rs(e,t){return Aa(e.getMonth()+1,t,2)}function os(e,t){return Aa(e.getMinutes(),t,2)}function as(e,t){return Aa(e.getSeconds(),t,2)}function ss(e){var t=e.getDay();return 0===t?7:t}function ls(e,t){return Aa(Ho.count(ra(e)-1,e),t,2)}function cs(e){var t=e.getDay();return t>=4||0===t?Yo(e):Yo.ceil(e)}function us(e,t){return e=cs(e),Aa(Yo.count(ra(e),e)+(4===ra(e).getDay()),t,2)}function hs(e){return e.getDay()}function ds(e,t){return Aa($o.count(ra(e)-1,e),t,2)}function fs(e,t){return Aa(e.getFullYear()%100,t,2)}function ps(e,t){return Aa((e=cs(e)).getFullYear()%100,t,2)}function ms(e,t){return Aa(e.getFullYear()%1e4,t,4)}function gs(e,t){var n=e.getDay();return Aa((e=n>=4||0===n?Yo(e):Yo.ceil(e)).getFullYear()%1e4,t,4)}function ys(e){var t=e.getTimezoneOffset();return(t>0?"-":(t*=-1,"+"))+Aa(t/60|0,"0",2)+Aa(t%60,"0",2)}function xs(e,t){return Aa(e.getUTCDate(),t,2)}function vs(e,t){return Aa(e.getUTCHours(),t,2)}function bs(e,t){return Aa(e.getUTCHours()%12||12,t,2)}function ws(e,t){return Aa(1+jo.count(oa(e),e),t,3)}function Ms(e,t){return Aa(e.getUTCMilliseconds(),t,3)}function ks(e,t){return Ms(e,t)+"000"}function Ss(e,t){return Aa(e.getUTCMonth()+1,t,2)}function _s(e,t){return Aa(e.getUTCMinutes(),t,2)}function qs(e,t){return Aa(e.getUTCSeconds(),t,2)}function Ds(e){var t=e.getUTCDay();return 0===t?7:t}function As(e,t){return Aa(Zo.count(oa(e)-1,e),t,2)}function Cs(e){var t=e.getUTCDay();return t>=4||0===t?ta(e):ta.ceil(e)}function Ns(e,t){return e=Cs(e),Aa(ta.count(oa(e),e)+(4===oa(e).getUTCDay()),t,2)}function Es(e){return e.getUTCDay()}function Rs(e,t){return Aa(Jo.count(oa(e)-1,e),t,2)}function Is(e,t){return Aa(e.getUTCFullYear()%100,t,2)}function Os(e,t){return Aa((e=Cs(e)).getUTCFullYear()%100,t,2)}function Ps(e,t){return Aa(e.getUTCFullYear()%1e4,t,4)}function Ls(e,t){var n=e.getUTCDay();return Aa((e=n>=4||0===n?ta(e):ta.ceil(e)).getUTCFullYear()%1e4,t,4)}function Ts(){return"+0000"}function zs(){return"%"}function Fs(e){return+e}function js(e){return Math.floor(+e/1e3)}const Vs=yo();Vs("d3-number",(function(e,t,n){let i,r;function o(e){return r(e)}function a(){o.locale({decimal:n||".",thousands:t||",",grouping:[3],currency:["$",""]})}return o.locale=function(t){return i=Ro(t),r=i.format(e),this},a(),o.format=function(e,r,o,s){return(o||s)&&(t=o,n=s,a()),i.format(e)(r)},o.pattern=function(t){return t&&(e=t,r=i.format(t)),e},o})),Vs("d3-time",(function(e){let t=ka({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=t.format(e);function i(e){return n(e)}return i.format=function(e,n){return t.format(e)(n)},i.locale=function(){return t=ka(...arguments),n=t.format(e),this},i.parse=function(e,n){return t.parse(e)(n)},i.parsePattern=function(e){return t.parse(e)},i}));const Bs={id:e=>"".concat(e.source,"/").concat(e.key||e.title),key:e=>String(e.key||e.title),tags:e=>e.tags,min:e=>e.min,max:e=>e.max,type:e=>e.type,title:e=>String(e.title),values:e=>e.values,value:e=>e,label:e=>e,formatter:e=>(e=>{if("function"==typeof e.formatter)return e.formatter();const t=e.formatter||{};return Vs(t.type||"d3-number")(t.format||"")})(e)};function Hs(e){let{id:t=Bs.id,key:n=Bs.key,min:i=Bs.min,max:r=Bs.max,type:o=Bs.type,tags:a=Bs.tags,title:s=Bs.title,values:l=Bs.values,value:c=Bs.value,label:u=Bs.label,formatter:h=Bs.formatter}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return{id:()=>t(e),key:()=>n(e),raw:()=>e,tags:()=>a(e),type:()=>o(e),min:()=>i(e),max:()=>r(e),title:()=>s(e),items:()=>l(e),formatter:()=>h(e),value:c,label:u}}const $s=e=>e.filter((e=>"number"==typeof e&&!isNaN(e))),Ws=e=>e.reduce(((e,t)=>e+t),0),Us={first:e=>e[0],last:e=>e[e.length-1],min:e=>{const t=$s(e);return t.length?Math.min.apply(null,t):NaN},max:e=>{const t=$s(e);return t.length?Math.max.apply(null,t):NaN},sum:e=>{const t=$s(e);return t.length?t.reduce(((e,t)=>e+t),0):NaN},avg:e=>{const t=$s(e),n=t.length;return n?Ws(t)/n:NaN}};function Ys(e,t,n,i){const r={},o=i.field||(void 0!==e.field?t.field(e.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=>Ys(e,t,{main:n},i).main)):void 0!==s.field?(l.type="field",l.field=t.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=Us[s.reduce]:l.field&&l.field.reduce&&(l.reduce="string"==typeof l.field.reduce?Us[l.field.reduce]:l.field.reduce),"function"==typeof s.reduceLabel?l.reduceLabel=s.reduceLabel:s.reduceLabel?l.reduceLabel=Us[s.reduceLabel]:l.field&&l.field.reduceLabel&&(l.reduceLabel="string"==typeof l.field.reduceLabel?Us[l.field.reduceLabel]:l.field.reduceLabel))})),r}function Gs(e,t){const{main:n}=Ys(e,t,{main:{value:e.value,label:e.label,reduce:e.reduce,filter:e.filter}},{});return{props:Ys(e,t,e.props||{},n),main:n}}function Xs(e,t,n,i){const r=Array(e.length),o=Array(e.length);let a;for(let t=0;t<e.length;t++)a=i?e[t][i]:e[t],r[t]=a.value,o[t]=a.label;const s=t.reduce,l=t.reduceLabel,c=s?s(r):r,u={value:c,label:l?l(o,c):n?n(c):String(c)};return i&&e[0][i].source?(u.source=e[0][i].source,u):!i&&e[0].source?(u.source=e[0].source,u):u}function Ks(e,t){let{main:n,propsArr:i,props:r}=t,o=[];const a=n.field.formatter(),s={};return i.forEach((e=>{s[e]=r[e].field?r[e].field.formatter():e=>e})),o.push(...e.map((e=>{const t=Xs(e.items,n,a);return i.forEach((n=>{t[n]=Xs(e.items,r[n],s[n],n)})),t}))),o}function Zs(e){let{cfg:t,itemData:n,obj:i,target:r,tracker:o,trackType:a}=e;const s="function"===a?t.trackBy(n):n[t.trackBy];let l=o[s];l||(l=o[s]={items:[],id:s},r.push(l)),l.items.push(i)}function Js(e){if(e.length<1e4)return Math.max(...e);let t=-1/0;const n=e.length;for(let i=0;i<n;i++)t<e[i]&&(t=e[i]);return t}function Qs(e){if(e.length<1e4)return Math.min(...e);let t=1/0;const n=e.length;for(let i=0;i<n;i++)t>e[i]&&(t=e[i]);return t}const el={diverging:function(e,t){if((s=e.length)>0)for(var n,i,r,o,a,s,l=0,c=e[t[0]].length;l<c;++l)for(o=a=0,n=0;n<s;++n)(r=(i=e[t[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:ho,silhouette:function(e,t){if((n=e.length)>0){for(var n,i=0,r=e[t[0]],o=r.length;i<o;++i){for(var a=0,s=0;a<n;++a)s+=e[a][i][1]||0;r[i][1]+=r[i][0]=-s/2}ho(e,t)}},expand:function(e,t){if((i=e.length)>0){for(var n,i,r,o=0,a=e[0].length;o<a;++o){for(r=n=0;n<i;++n)r+=e[n][o][1]||0;if(r)for(n=0;n<i;++n)e[n][o][1]/=r}ho(e,t)}},wiggle:function(e,t){if((r=e.length)>0&&(i=(n=e[t[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=e[t[s]],h=u[a][1]||0,d=(h-(u[a-1][1]||0))/2,f=0;f<s;++f){var p=e[t[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,ho(e,t)}}},tl={ascending:function(e){var t=e.map(go);return fo(e).sort((function(e,n){return t[e]-t[n]}))},insideout:function(e){var t,n,i=e.length,r=e.map(go),o=function(e){var t=e.map(mo);return fo(e).sort((function(e,n){return t[e]-t[n]}))}(e),a=0,s=0,l=[],c=[];for(t=0;t<i;++t)n=o[t],a<s?(a+=r[n],l.push(n)):(s+=r[n],c.push(n));return c.reverse().concat(l)},none:fo,reverse:function(e){return fo(e).reverse()}};function nl(e,t,n){const i={},r=t.stackKey,o=t.value,a=t.startProp||"start",s=t.endProp||"end",l=t.offset||"none",c=t.order||"none",u=t.valueRef||"";let h=0,d={};for(let t=0;t<e.items.length;t++){let n=e.items[t],o=u?n[u]:null;if(o&&o.source){let e="".concat(o.source.key||"","/").concat(o.source.field);d[e]||(d[e]=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((e=>i[e].items)),m=function(){var e=br([]),t=fo,n=ho,i=po;function r(r){var o,a,s=e.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=t(u);o<c;++o)u[a[o]].index=o;return n(u,a),u}return r.keys=function(t){return arguments.length?(e="function"==typeof t?t:br(Yr.call(t)),r):e},r.value=function(e){return arguments.length?(i="function"==typeof e?e:br(+e),r):i},r.order=function(e){return arguments.length?(t=null==e?fo:"function"==typeof e?e:br(Yr.call(e)),r):t},r.offset=function(e){return arguments.length?(n=null==e?ho:e,r):n},r}().keys(f).value(((e,t)=>e[t]?o(e[t]):0)).order(tl[c]).offset(el[l]);let g=m(p),y=[];for(let e=0;e<g.length;e++){let t=g[e];for(let e=0;e<t.length;e++){let n=t[e],i=t[e].data[t.key];i&&(i[a]={value:n[0]},i[s]={value:n[1]},y.push(n[0],n[1]))}}let x=Object.keys(d).map((e=>{let t=n(d[e].key);return t?t.field(d[e].field):null})).filter((e=>!!e));const v=Hs({title:x.map((e=>e.title())).join(", "),min:Qs(y),max:Js(y),type:"measure",formatter:x[0]?x[0].formatter:void 0});e.fields.push(v)}function il(e){let t=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(e))n.items=e.map((e=>({value:e,label:String(e)})));else if(e){if("collection"in e)n=ir({},t.collection(e.collection));else{const r=t.dataset?t.dataset(e.source):null;let o=e.value||(e=>e),a=e.label||(e=>e);if(e.groupBy||e.mapTo)i.warn('Deprecated "data" configuration',e),n.items=[];else if(e.hierarchy)n.root=r.hierarchy?r.hierarchy(e.hierarchy):null,n.fields=r.fields();else if(e.items)n.items=e.skipNormalize?e.items:e.items.map((e=>({value:o(e),label:String(a(e))})));else if(e.extract){const i=Array.isArray(e.extract)?e.extract:[e.extract];n.items=[];const o=[];i.forEach((e=>{const i=e.source?t.dataset(e.source):r;i&&(n.items=[...n.items,...i.extract(e)],void 0!==e.field&&o.push(i.field(e.field)))})),o.length&&(n.fields=o),e.amend&&Array.isArray(e.amend)&&(n.items=[...n.items,...e.amend])}else if(void 0!==e.field&&r){const t=r.field(e.field);t&&(n.fields||(n.fields=[]),n.fields.push(t),"value"in e||(o=t.value||(e=>e),a=t.label||(e=>e),n.value=o),n.items=t.items().map((t=>({value:o(t),label:String(a(t)),source:{field:e.field}}))))}else e.fields&&e.fields.forEach((e=>{const i="object"==typeof e&&e.source?t.dataset(e.source):r;if(!i)return;let o;o="object"==typeof e&&void 0!==e.field?i.field(e.field):i.field(e),o&&(n.fields||(n.fields=[]),n.fields.push(o))}));n.items&&e.map&&(n.items=n.items.map(e.map))}e&&e.stack&&nl(n,e.stack,t.dataset)}return e&&!Array.isArray(e)&&"function"==typeof e.filter&&n.items&&(n.items=n.items.filter(e.filter)),e&&!Array.isArray(e)&&"function"==typeof e.sort&&n.items&&(n.items=n.items.sort(e.sort)),n}function rl(e,t,n){let i,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:il;if(e.data){const i=r(e.data,t,n);if(i&&i.fields&&i.fields[0])return i.fields[0].formatter()}if(i=e.formatter?"".concat(e.formatter,"-").concat(e.type||"number"):e.type||"d3-number",n.formatter.has(i)){return n.formatter.get(i)(e.format||"")}throw new Error("Formatter of type '".concat(i,"' was not found"))}function ol(e,t){switch(arguments.length){case 0:break;case 1:this.range(e);break;default:this.range(t).domain(e)}return this}const al=Symbol("implicit");function sl(){var e=new da,t=[],n=[],i=al;function r(r){let o=e.get(r);if(void 0===o){if(i!==al)return i;e.set(r,o=t.push(r)-1)}return n[o%n.length]}return r.domain=function(n){if(!arguments.length)return t.slice();t=[],e=new da;for(const i of n)e.has(i)||e.set(i,t.push(i)-1);return r},r.range=function(e){return arguments.length?(n=Array.from(e),r):n.slice()},r.unknown=function(e){return arguments.length?(i=e,r):i},r.copy=function(){return sl(t,n).unknown(i)},ol.apply(r,arguments),r}function ll(){var e,t,n=sl().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;e=(f-d)/Math.max(1,n-l+2*c),s&&(e=Math.floor(e)),d+=(f-d-e*(n-l))*u,t=e*(1-l),s&&(d=Math.round(d),t=Math.round(t));var p=function(e,t,n){e=+e,t=+t,n=(r=arguments.length)<2?(t=e,e=0,1):r<3?1:+n;for(var i=-1,r=0|Math.max(0,Math.ceil((t-e)/n)),o=new Array(r);++i<r;)o[i]=e+i*n;return o}(n).map((function(t){return d+e*t}));return r(h?p.reverse():p)}return delete n.unknown,n.domain=function(e){return arguments.length?(i(e),h()):i()},n.range=function(e){return arguments.length?([o,a]=e,o=+o,a=+a,h()):[o,a]},n.rangeRound=function(e){return[o,a]=e,o=+o,a=+a,s=!0,h()},n.bandwidth=function(){return t},n.step=function(){return e},n.round=function(e){return arguments.length?(s=!!e,h()):s},n.padding=function(e){return arguments.length?(l=Math.min(1,c=+e),h()):l},n.paddingInner=function(e){return arguments.length?(l=Math.min(1,e),h()):l},n.paddingOuter=function(e){return arguments.length?(c=+e,h()):c},n.align=function(e){return arguments.length?(u=Math.max(0,Math.min(1,e)),h()):u},n.copy=function(){return ll(i(),[o,a]).round(s).paddingInner(l).paddingOuter(c).align(u)},ol.apply(h(),arguments)}function cl(e,t,n){e.prototype=t.prototype=n,n.constructor=e}function ul(e,t){var n=Object.create(e.prototype);for(var i in t)n[i]=t[i];return n}function hl(){}var dl=.7,fl=1/dl,pl="\\s*([+-]?\\d+)\\s*",ml="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",gl="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",yl=/^#([0-9a-f]{3,8})$/,xl=new RegExp(`^rgb\\(${pl},${pl},${pl}\\)$`),vl=new RegExp(`^rgb\\(${gl},${gl},${gl}\\)$`),bl=new RegExp(`^rgba\\(${pl},${pl},${pl},${ml}\\)$`),wl=new RegExp(`^rgba\\(${gl},${gl},${gl},${ml}\\)$`),Ml=new RegExp(`^hsl\\(${ml},${gl},${gl}\\)$`),kl=new RegExp(`^hsla\\(${ml},${gl},${gl},${ml}\\)$`),Sl={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 _l(){return this.rgb().formatHex()}function ql(){return this.rgb().formatRgb()}function Dl(e){var t,n;return e=(e+"").trim().toLowerCase(),(t=yl.exec(e))?(n=t[1].length,t=parseInt(t[1],16),6===n?Al(t):3===n?new El(t>>8&15|t>>4&240,t>>4&15|240&t,(15&t)<<4|15&t,1):8===n?Cl(t>>24&255,t>>16&255,t>>8&255,(255&t)/255):4===n?Cl(t>>12&15|t>>8&240,t>>8&15|t>>4&240,t>>4&15|240&t,((15&t)<<4|15&t)/255):null):(t=xl.exec(e))?new El(t[1],t[2],t[3],1):(t=vl.exec(e))?new El(255*t[1]/100,255*t[2]/100,255*t[3]/100,1):(t=bl.exec(e))?Cl(t[1],t[2],t[3],t[4]):(t=wl.exec(e))?Cl(255*t[1]/100,255*t[2]/100,255*t[3]/100,t[4]):(t=Ml.exec(e))?Tl(t[1],t[2]/100,t[3]/100,1):(t=kl.exec(e))?Tl(t[1],t[2]/100,t[3]/100,t[4]):Sl.hasOwnProperty(e)?Al(Sl[e]):"transparent"===e?new El(NaN,NaN,NaN,0):null}function Al(e){return new El(e>>16&255,e>>8&255,255&e,1)}function Cl(e,t,n,i){return i<=0&&(e=t=n=NaN),new El(e,t,n,i)}function Nl(e,t,n,i){return 1===arguments.length?function(e){return e instanceof hl||(e=Dl(e)),e?new El((e=e.rgb()).r,e.g,e.b,e.opacity):new El}(e):new El(e,t,n,null==i?1:i)}function El(e,t,n,i){this.r=+e,this.g=+t,this.b=+n,this.opacity=+i}function Rl(){return`#${Ll(this.r)}${Ll(this.g)}${Ll(this.b)}`}function Il(){const e=Ol(this.opacity);return`${1===e?"rgb(":"rgba("}${Pl(this.r)}, ${Pl(this.g)}, ${Pl(this.b)}${1===e?")":`, ${e})`}`}function Ol(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function Pl(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function Ll(e){return((e=Pl(e))<16?"0":"")+e.toString(16)}function Tl(e,t,n,i){return i<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new Fl(e,t,n,i)}function zl(e){if(e instanceof Fl)return new Fl(e.h,e.s,e.l,e.opacity);if(e instanceof hl||(e=Dl(e)),!e)return new Fl;if(e instanceof Fl)return e;var t=(e=e.rgb()).r/255,n=e.g/255,i=e.b/255,r=Math.min(t,n,i),o=Math.max(t,n,i),a=NaN,s=o-r,l=(o+r)/2;return s?(a=t===o?(n-i)/s+6*(n<i):n===o?(i-t)/s+2:(t-n)/s+4,s/=l<.5?o+r:2-o-r,a*=60):s=l>0&&l<1?0:a,new Fl(a,s,l,e.opacity)}function Fl(e,t,n,i){this.h=+e,this.s=+t,this.l=+n,this.opacity=+i}function jl(e){return(e=(e||0)%360)<0?e+360:e}function Vl(e){return Math.max(0,Math.min(1,e||0))}function Bl(e,t,n){return 255*(e<60?t+(n-t)*e/60:e<180?n:e<240?t+(n-t)*(240-e)/60:t)}cl(hl,Dl,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:_l,formatHex:_l,formatHex8:function(){return this.rgb().formatHex8()},formatHsl:function(){return zl(this).formatHsl()},formatRgb:ql,toString:ql}),cl(El,Nl,ul(hl,{brighter(e){return e=null==e?fl:Math.pow(fl,e),new El(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=null==e?dl:Math.pow(dl,e),new El(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new El(Pl(this.r),Pl(this.g),Pl(this.b),Ol(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:Rl,formatHex:Rl,formatHex8:function(){return`#${Ll(this.r)}${Ll(this.g)}${Ll(this.b)}${Ll(255*(isNaN(this.opacity)?1:this.opacity))}`},formatRgb:Il,toString:Il})),cl(Fl,(function(e,t,n,i){return 1===arguments.length?zl(e):new Fl(e,t,n,null==i?1:i)}),ul(hl,{brighter(e){return e=null==e?fl:Math.pow(fl,e),new Fl(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=null==e?dl:Math.pow(dl,e),new Fl(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=this.h%360+360*(this.h<0),t=isNaN(e)||isNaN(this.s)?0:this.s,n=this.l,i=n+(n<.5?n:1-n)*t,r=2*n-i;return new El(Bl(e>=240?e-240:e+120,r,i),Bl(e,r,i),Bl(e<120?e+240:e-120,r,i),this.opacity)},clamp(){return new Fl(jl(this.h),Vl(this.s),Vl(this.l),Ol(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 e=Ol(this.opacity);return`${1===e?"hsl(":"hsla("}${jl(this.h)}, ${100*Vl(this.s)}%, ${100*Vl(this.l)}%${1===e?")":`, ${e})`}`}}));var Hl=e=>()=>e;function $l(e){return 1==(e=+e)?Wl:function(t,n){return n-t?function(e,t,n){return e=Math.pow(e,n),t=Math.pow(t,n)-e,n=1/n,function(i){return Math.pow(e+i*t,n)}}(t,n,e):Hl(isNaN(t)?n:t)}}function Wl(e,t){var n=t-e;return n?function(e,t){return function(n){return e+n*t}}(e,n):Hl(isNaN(e)?t:e)}var Ul=function e(t){var n=$l(t);function i(e,t){var i=n((e=Nl(e)).r,(t=Nl(t)).r),r=n(e.g,t.g),o=n(e.b,t.b),a=Wl(e.opacity,t.opacity);return function(t){return e.r=i(t),e.g=r(t),e.b=o(t),e.opacity=a(t),e+""}}return i.gamma=e,i}(1);function Yl(e,t){t||(t=[]);var n,i=e?Math.min(t.length,e.length):0,r=t.slice();return function(o){for(n=0;n<i;++n)r[n]=e[n]*(1-o)+t[n]*o;return r}}function Gl(e,t){var n,i=t?t.length:0,r=e?Math.min(i,e.length):0,o=new Array(r),a=new Array(i);for(n=0;n<r;++n)o[n]=tc(e[n],t[n]);for(;n<i;++n)a[n]=t[n];return function(e){for(n=0;n<r;++n)a[n]=o[n](e);return a}}function Xl(e,t){var n=new Date;return e=+e,t=+t,function(i){return n.setTime(e*(1-i)+t*i),n}}function Kl(e,t){return e=+e,t=+t,function(n){return e*(1-n)+t*n}}function Zl(e,t){var n,i={},r={};for(n in null!==e&&"object"==typeof e||(e={}),null!==t&&"object"==typeof t||(t={}),t)n in e?i[n]=tc(e[n],t[n]):r[n]=t[n];return function(e){for(n in i)r[n]=i[n](e);return r}}var Jl=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,Ql=new RegExp(Jl.source,"g");function ec(e,t){var n,i,r,o=Jl.lastIndex=Ql.lastIndex=0,a=-1,s=[],l=[];for(e+="",t+="";(n=Jl.exec(e))&&(i=Ql.exec(t));)(r=i.index)>o&&(r=t.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:Kl(n,i)})),o=Ql.lastIndex;return o<t.length&&(r=t.slice(o),s[a]?s[a]+=r:s[++a]=r),s.length<2?l[0]?function(e){return function(t){return e(t)+""}}(l[0].x):function(e){return function(){return e}}(t):(t=l.length,function(e){for(var n,i=0;i<t;++i)s[(n=l[i]).i]=n.x(e);return s.join("")})}function tc(e,t){var n,i=typeof t;return null==t||"boolean"===i?Hl(t):("number"===i?Kl:"string"===i?(n=Dl(t))?(t=n,Ul):ec:t instanceof Dl?Ul:t instanceof Date?Xl:function(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}(t)?Yl:Array.isArray(t)?Gl:"function"!=typeof t.valueOf&&"function"!=typeof t.toString||isNaN(t)?Zl:Kl)(e,t)}function nc(e,t){return e=+e,t=+t,function(n){return Math.round(e*(1-n)+t*n)}}function ic(e){return+e}var rc=[0,1];function oc(e){return e}function ac(e,t){return(t-=e=+e)?function(n){return(n-e)/t}:function(e){return function(){return e}}(isNaN(t)?NaN:.5)}function sc(e,t,n){var i=e[0],r=e[1],o=t[0],a=t[1];return r<i?(i=ac(r,i),o=n(a,o)):(i=ac(i,r),o=n(o,a)),function(e){return o(i(e))}}function lc(e,t,n){var i=Math.min(e.length,t.length)-1,r=new Array(i),o=new Array(i),a=-1;for(e[i]<e[0]&&(e=e.slice().reverse(),t=t.slice().reverse());++a<i;)r[a]=ac(e[a],e[a+1]),o[a]=n(t[a],t[a+1]);return function(t){var n=ha(e,t,1,i)-1;return o[n](r[n](t))}}function cc(){var e,t,n,i,r,o,a=rc,s=rc,l=tc,c=oc;function u(){var e=Math.min(a.length,s.length);return c!==oc&&(c=function(e,t){var n;return e>t&&(n=e,e=t,t=n),function(n){return Math.max(e,Math.min(t,n))}}(a[0],a[e-1])),i=e>2?lc:sc,r=o=null,h}function h(t){return null==t||isNaN(t=+t)?n:(r||(r=i(a.map(e),s,l)))(e(c(t)))}return h.invert=function(n){return c(t((o||(o=i(s,a.map(e),Kl)))(n)))},h.domain=function(e){return arguments.length?(a=Array.from(e,ic),u()):a.slice()},h.range=function(e){return arguments.length?(s=Array.from(e),u()):s.slice()},h.rangeRound=function(e){return s=Array.from(e),l=nc,u()},h.clamp=function(e){return arguments.length?(c=!!e||oc,u()):c!==oc},h.interpolate=function(e){return arguments.length?(l=e,u()):l},h.unknown=function(e){return arguments.length?(n=e,h):n},function(n,i){return e=n,t=i,u()}}function uc(e,t,n,i){var r,o=function(e,t,n){n=+n;const i=(t=+t)<(e=+e),r=i?va(t,e,n):va(e,t,n);return(i?-1:1)*(r<0?1/-r:r)}(e,t,n);switch((i=Mo(null==i?",f":i)).type){case"s":var a=Math.max(Math.abs(e),Math.abs(t));return null!=i.precision||isNaN(r=function(e,t){return Math.max(0,3*Math.max(-8,Math.min(8,Math.floor(vo(t)/3)))-vo(Math.abs(e)))}(o,a))||(i.precision=r),Co(i,a);case"":case"e":case"g":case"p":case"r":null!=i.precision||isNaN(r=function(e,t){return e=Math.abs(e),t=Math.abs(t)-e,Math.max(0,vo(t)-vo(e))+1}(o,Math.max(Math.abs(e),Math.abs(t))))||(i.precision=r-("e"===i.type));break;case"f":case"%":null!=i.precision||isNaN(r=function(e){return Math.max(0,-vo(Math.abs(e)))}(o))||(i.precision=r-2*("%"===i.type))}return Ao(i)}function hc(e){var t=e.domain;return e.ticks=function(e){var n=t();return function(e,t,n){if(!((n=+n)>0))return[];if((e=+e)==(t=+t))return[e];const i=t<e,[r,o,a]=i?xa(t,e,n):xa(e,t,n);if(!(o>=r))return[];const s=o-r+1,l=new Array(s);if(i)if(a<0)for(let e=0;e<s;++e)l[e]=(o-e)/-a;else for(let e=0;e<s;++e)l[e]=(o-e)*a;else if(a<0)for(let e=0;e<s;++e)l[e]=(r+e)/-a;else for(let e=0;e<s;++e)l[e]=(r+e)*a;return l}(n[0],n[n.length-1],null==e?10:e)},e.tickFormat=function(e,n){var i=t();return uc(i[0],i[i.length-1],null==e?10:e,n)},e.nice=function(n){null==n&&(n=10);var i,r,o=t(),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=va(l,c,n))===i)return o[a]=l,o[s]=c,t(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 e},e}function dc(){var e=cc()(oc,oc);return e.copy=function(){return t=e,dc().domain(t.domain()).range(t.range()).interpolate(t.interpolate()).clamp(t.clamp()).unknown(t.unknown());var t},ol.apply(e,arguments),hc(e)}function fc(){var e,t=[.5],n=[0,1],i=1;function r(r){return null!=r&&r<=r?n[ha(t,r,0,i)]:e}return r.domain=function(e){return arguments.length?(t=Array.from(e),i=Math.min(t.length,n.length-1),r):t.slice()},r.range=function(e){return arguments.length?(n=Array.from(e),i=Math.min(t.length,n.length-1),r):n.slice()},r.invertExtent=function(e){var i=n.indexOf(e);return[t[i-1],t[i]]},r.unknown=function(t){return arguments.length?(e=t,r):e},r.copy=function(){return fc().domain(t).range(n).unknown(e)},ol.apply(r,arguments)}function pc(e){return void 0===e?e=>e:t=>e(t)}function mc(e){return Math.max(0,Math.min(1,e))}function gc(e){return"object"==typeof e}function yc(e,t,n){const i=Math.abs(t-n)/(e+1),r=[];for(let o=1;o<=e;o++){const e=o*i;r.push(t<n?t+e:t-e)}return r}function xc(e,t,n){if(1===e.length)return e;const i=e.concat([]);for(let r=0;r<e.length;r++){let o=e[r],a=e[r+1];0===r&&o!==n.start()?(i.push(...yc(t,o,a)),o-=a-o,a=e[r],i.push(...yc(t,o,a))):r===e.length-1&&a!==n.end()?(a=o+(o-e[r-1]),i.push(...yc(t,o,a))):i.push(...yc(t,o,a))}return i.filter((e=>e>=n.min()&&e<=n.max()))}function vc(e){let{distance:t,scale:n,minorCount:i=0,unitDivider:r=100,formatter:o}=e;const a=ar(r)||ar(t)?2:Math.max(t/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?xc(l,i,n):l;c.sort(((e,t)=>e-t));const u=c.map(pc(o));return c.map(((e,t)=>{const i=n(e);return{position:i,start:i,end:i,label:u[t],value:e,isMinor:-1===l.indexOf(e)}}))}function bc(e){let{distance:t,scale:n,minorCount:i=0,unitDivider:r=100,formatter:o}=e;const a=ar(r)||ar(t)?2:Math.max(t/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?xc(c,i,n):c;u.sort(((e,t)=>e-t));const h=u.map(pc(o));return u.map(((e,t)=>{const i=n(e);return{position:i,start:i,end:i,label:h[t],value:e,isMinor:-1===c.indexOf(e)}}))}function wc(e){let t,{settings:n,scale:i,distance:r,formatter:o=e=>e}=e;const a=n.minorTicks&&!ar(n.minorTicks.count)?Math.min(100,n.minorTicks.count):0;if(Array.isArray(n.ticks.values)){const e=n.ticks.values.filter((e=>"object"==typeof e?!ar(e.value):!ar(e)));t=function(e){let{values:t,scale:n,formatter:i=e=>e}=e;return t.sort(((e,t)=>(gc(e)?e.value:e)-(gc(t)?t.value:t))).filter(((e,t,i)=>{const r=gc(e)?e.value:e;return r<=n.max()&&r>=n.min()&&i.indexOf(e)===t})).map((e=>{const t=gc(e),r=t?e.value:e,o=n(r);return{position:o,value:r,label:t&&void 0!==e.label?e.label:i(r),isMinor:!!t&&!!e.isMinor,start:t&&!isNaN(e.start)?mc(n(e.start)):o,end:t&&!isNaN(e.end)?mc(n(e.end)):o}}))}({values:e,scale:i.copy(),formatter:o})}else if(ar(n.ticks.count)){t=(n.ticks.tight?bc:vc)({distance:r,minorCount:a,unitDivider:n.ticks.distance,scale:i,formatter:o}),n.ticks.forceBounds&&function(e,t,n){const i=e.map((e=>e.position)),r=t.range();-1===i.indexOf(r[0])?e.splice(0,0,{position:r[0],start:r[0],end:r[0],label:n(t.start()),isMinor:!1,value:t.start()}):e[0]&&e[0].isMinor&&(e[0].isMinor=!1);const o=e[e.length-1];-1===i.indexOf(r[1])?e.push({position:r[1],start:r[1],end:r[1],label:n(t.end()),isMinor:!1,value:t.end()}):o&&o.isMinor&&(o.isMinor=!1)}(t,i,o)}else{t=function(e){let{count:t,minorCount:n,scale:i,formatter:r}=e;return i.ticks((t-1)*n+t).map(((e,t)=>{const o=i(e);return{position:o,start:o,end:o,label:r(e),isMinor:t%(n+1)!=0,value:e}}))}({count:Math.min(1e3,n.ticks.count),minorCount:a,scale:i.copy(),formatter:o})}return t}function Mc(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const i={};return Object.keys(t).forEach((r=>{const o=typeof e[r];i[r]="function"===o?e[r](n):"undefined"===o?t[r]:e[r]})),i}const kc={min:NaN,max:NaN,expand:NaN,include:[],invert:!1},Sc={tight:!1,forceBounds:!1,values:void 0,count:NaN,distance:100},_c={count:NaN};function qc(e,t){e.instance||(e.instance=t.copy(),e.instance.domain([t.start(),t.end()]),e.instance.clamp(!0),e.instance.range(e.invert?[1,0]:[0,1]))}function Dc(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const i=dc(),r={instance:null,invert:!1},o={data:t,resources:n},a=Mc(e,kc,o);let s;function l(e){return ar(e)?NaN:i(e)}a.ticks=Mc(e.ticks,Sc,o),a.minorTicks=Mc(e.minorTicks,_c,o),l.data=()=>t,l.invert=function(e){return i.invert(e)},l.rangeRound=function(e){return i.rangeRound(e),l},l.clamp=function(){let e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];return i.clamp(e),l},l.cachedTicks=function(){return s},l.clearTicksCache=function(){return s=void 0,this},l.ticks=function(e){return null!==e&&"object"==typeof e?(e.settings=e.settings||{},e.settings=Qi(!0,{},a,e.settings),e.scale=l,s=wc(e),s):(s=i.ticks(e),s)},l.nice=function(e){return i.nice(e),l},l.tickFormat=function(e,t){return i.tickFormat(e,t)},l.interpolate=function(e){return i.interpolate(e),l},l.domain=function(e){return arguments.length?(i.domain(e),r.instance&&r.instance.domain([l.start(),l.end()]),l):i.domain()},l.range=function(e){return arguments.length?(i.range(e),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(e){let t=(l.start()-l.end())/e,n=[l.end()],i=[],r=t/2;for(let o=0;o<e;o++){let e=n[n.length-1]||0,o=e+t,a=l(e+r);n.push(o,o),i.push(a,a)}return n.pop(),l.domain(n),l.range(i),l},l.copy=function(){const r=Dc(e,t,n);return r.domain(l.domain()),r.range(l.range()),r.clamp(i.clamp()),r},l.norm=function(e){return qc(r,l),r.instance(e)},l.normInvert=function(e){return qc(r,l),r.instance.invert(e)};const{mini:c,maxi:u}=function(e,t){const n=+e.min,i=+e.max;let r=0,o=1;if(t&&t[0]){const n=t.map((e=>e.min())).filter((e=>!isNaN(e))),i=t.map((e=>e.max())).filter((e=>!isNaN(e)));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(e.expand)){const t=o-r;r-=t*e.expand,o+=t*e.expand}if(Array.isArray(e.include)){const t=e.include.filter((e=>!isNaN(e)));r=Math.min(...t,r),o=Math.max(...t,o)}}return{mini:isNaN(n)?r:n,maxi:isNaN(i)?o:i}}(a,t?t.fields:[]);return l.domain([c,u]),l.range(a.invert?[1,0]:[0,1]),r.invert=a.invert,l}const Ac={padding:0,paddingInner:NaN,paddingOuter:NaN,align:.5,invert:!1,maxPxStep:NaN,range:[0,1]};function Cc(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const n={data:t,resources:arguments.length>2&&void 0!==arguments[2]?arguments[2]:{}},i=Mc(e,Ac,n),r=t.items||[],o={},a=[],s=[];function l(e,n){e.data=()=>t,e.datum=e=>r[o[e]],e.start=function(){return e.domain()[0]},e.end=function(){return e.domain()[e.domain().length-1]},e.labels=()=>s,e.ticks=function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return t.scale=e,function(e){let{scale:t}=e;const n=t.domain(),i=t.data().items,r=t.labels?t.labels():n,o=t.bandwidth();return n.map(((e,n)=>{const a=t(e);return{position:a+o/2,label:"".concat(r[n]),data:i?i[n]:void 0,start:a,end:a+o}}))}(t,n.trackBy)}}const c=ll();l(c,e),c.pxScale=function(t){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>=t)return c;const a=c.copy();a.type=c.type,l(a,e);const s=o*n/t,u=(1-s)*c.align();return a.range(i.invert?[s+u,u]:[u,s+u]),a};const u="function"==typeof e.value?e.value:e=>e.datum.value,h="function"==typeof e.label?e.label:e=>e.datum.label;for(let e=0;e<r.length;e++){const t=Qi({datum:r[e]},n),i=u(t,e);-1===a.indexOf(i)&&(a.push(i),s.push(h(t,e)),o[i]=e)}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 Nc={depth:0};function Ec(e,t,n){return e.ancestors().map((e=>t(Qi({datum:e.data},n)))).reverse().slice(1).toString()}const Rc=e=>e.min(),Ic=e=>e.max();function Oc(e,t){const n=e&&!isNaN(e.min),i=e&&!isNaN(e.max);let r=n?+e.min:0,o=i?+e.max:1;if(t&&t.length){if(!n){const e=t.map(Rc).filter(or);r=e.length?Math.min(...e):r}if(!i){const e=t.map(Ic).filter(or);o=e.length?Math.max(...e):o}}return[r,o]}const Pc={domain:[],range:[],invert:!1,min:NaN,max:NaN};function Lc(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const i=Dc(e,t,n).clamp(!0).interpolate(Ul),r=Mc(e,Pc,{data:t,resources:n}),o=Array.isArray(r.domain)&&r.domain.length,a=Array.isArray(r.range)&&r.range.length,s=i;Qi(!0,s,i);const[l,c]=Oc(r,t?t.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(e,t,n){const i=e.length;if(2===i)return[t,n];const r=[],o=(n-t)/(i-1);r.push(t);for(let e=1;e<i-1;e++)r.push(t+o*e);return r.push(n),r}(s.range(),l,c)),s}const Tc={domain:[],range:[],invert:!1,min:NaN,max:NaN,nice:!1};function zc(e){const t=[];for(let n=0;n<e.length-1;n++)t.push((e[n]+e[n+1])/2);return t}const Fc={domain:[],range:[]};const jc={domain:[],range:[],unknown:void 0},Vc={domain:[],range:[],override:!1};const Bc=yo();function Hc(e,t,n){let i=e.data;e.source&&(n.logger.warn("Deprecated: Scale data source configuration"),i={extract:[]},(Array.isArray(e.source)?e.source:[e.source]).forEach((e=>{i.extract.push({field:e})})));const r=il(i,t,n);let o,a=e.type||function(e){return e.root?"h-band":e.fields&&e.fields[0]?function(e){const t=e.map((e=>"dimension"===e.type()?"band":"linear"));return-1!==t.indexOf("linear")?"linear":"band"}(e.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(e,r,{theme:n.theme,logger:n.logger}),o.type=a),o}Bc("linear",Dc),Bc("band",Cc),Bc("h-band",(function e(){let t=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=Mc(t,Ac,r);o.ticks=Mc(t.ticks,Nc,r),o.value="function"==typeof t.value?t.value:e=>e.datum.value,o.label="function"==typeof t.label?t.label:e=>e.datum.value;let a=Cc(o);const{values:s,labels:l,items:c,ticks:u}=function(e,t,n){const i=t.ticks.depth,r=t.value,o=t.label,a=[],s=[],l={},c=[];let u=0;if(!e)return{values:a,labels:s,items:l,ticks:c};e.eachAfter((e=>{if(e.depth>0){const t=Ec(e,r,n),h=e.leaves()||[e],d=r(Qi({datum:e.data},n)),f=o(Qi({datum:e.data},n)),p=Array.isArray(e.children),m={key:t,count:h.length,value:d,label:f,leftEdge:Ec(h[0],r,n),rightEdge:Ec(h[Math.max(h.length-1,0)],r,n),node:e};p?(a.push("SPACER_".concat(u,"_SPACER")),u++):(a.push(t),s.push(f)),(i<=0&&!p||e.depth===i)&&c.push(m),l[t]=m}}));const h=e.height-1;return h>0&&a.splice(-h),{values:a,labels:s,items:l,ticks:c}}(n.root,o,r),h=function(e){const t=String(e),n=c[t];return a(n?o.invert?n.rightEdge:n.leftEdge:t)};Qi(!0,h,a),h.bandwidth=function(e){const t=c[String(e)],n=a.bandwidth();if(t&&!t.isLeaf){const e=h(t.leftEdge),i=h(t.rightEdge);return Math.abs(e-i)+n}return n},h.step=function(e){const t=c[String(e)],n=t?t.count:1;let i=a.step();return i*=n,i},h.data=()=>n,h.datum=e=>{const t=c[String(e)];return t?t.node.data:null},h.copy=()=>e(t,n,i),h.labels=()=>l,h.ticks=()=>u.map((e=>{const t=h(e.key),n=h.bandwidth(e.key);return{position:t+n/2,label:e.label,data:e.node.data,start:t,end:t+n}}));const d=a.pxScale;return h.pxScale=function(e){return a=d(e),h},h.domain(s),h})),Bc("sequential-color",Lc),Bc("threshold-color",(function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const i=fc(),r=Mc(e,Tc,{data:t,resources:n}),o=Array.isArray(r.domain)&&r.domain.length,a=Array.isArray(r.range)&&r.range.length;function s(e){return ar(e)?NaN:i(e)}Object.keys(i).forEach((e=>s[e]=i[e]));const l=t.fields,[c,u]=Oc(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(e,t,n){const i=2===e.length?10:Math.max(1,e.length),r=dc().domain([t,n]).nice(i).ticks(i);if(!e||!e.length)return r;const o=Math.max(0,e.length-1);for(;r.length>o;)r[0]-t<=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(e,t,n){const i=e.length;if(2===i)return[t+(n-t)/2];const r=[],o=(n-t)/i;for(let e=1;e<i;e++)r.push(t+o*e);return r}(f,c,u):f.length<p.length+1&&(f=function(e,t,n,i){n=e[0],i=e&&e.length>=2?e[e.length-1]:i;const r=Lc().domain([n,i]).range(t);return[n,...zc(e),i].map((e=>r(e)))}(p,f,c,u)),s.data=()=>t,s.range(r.invert?f.slice().reverse():f),s.domain(p),s})),Bc("categorical-color",(function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const i=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const i=sl(),r={data:t,resources:n},o=Mc(e,Fc,r),a="function"==typeof e.value?e.value:e=>e.datum.value,s="function"==typeof e.label?e.label:e=>e.datum.label,l=t.items||[],c={},u=[],h=[];for(let e=0;e<l.length;e++){const t=Qi({datum:l[e]},r),n=a(t,e);-1===u.indexOf(n)&&(u.push(n),h.push(s(t,e)),c[n]=e)}return i.data=()=>t,i.labels=()=>h,i.label=e=>h[u.indexOf(e)],i.datum=e=>l[c[e]],i.range(o.range),Array.isArray(o.domain)&&o.domain.length?i.domain(o.domain):i.domain(u),i}(e,t,n),r=n.theme,o=Mc(e,jc,{data:t,resources:n});let a;if(o.explicit=Mc(e.explicit,Vc,{data:t,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 e=r.palette("unknown");i.unknown(e[0])}if(Array.isArray(o.explicit.domain)&&o.explicit.domain.length){const e=i.domain().slice(),t=o.explicit.domain,n=Array.isArray(o.explicit.range)?o.explicit.range:[],r=Math.floor(e.length/a.length);for(let e=1;e<r+1;e*=2)a=a.concat(a);if(o.explicit.override)for(let i=0;i<t.length;i++){const r=e.indexOf(t[i]);r>-1&&(a[r]=n[i])}else{const i=t.map(((t,i)=>[e.indexOf(t),t,n[i]])).sort(((e,t)=>e[0]-t[0]));i.forEach((t=>{const n=e.indexOf(t[1]);-1!==n&&a.splice(n,0,t[2])}))}a.length=e.length}return i.range(a),i}));var $c={};function Wc(){Wc.init.call(this)}$c.isObject=function(e){return"object"==typeof e&&null!==e},$c.isNumber=function(e){return"number"==typeof e},$c.isUndefined=function(e){return void 0===e},$c.isFunction=function(e){return"function"==typeof e};var Uc=Wc;Wc.EventEmitter=Wc,Wc.prototype._events=void 0,Wc.prototype._maxListeners=void 0,Wc.defaultMaxListeners=10,Wc.init=function(){this._events=this._events||{},this._maxListeners=this._maxListeners||void 0},Wc.prototype.setMaxListeners=function(e){if(!$c.isNumber(e)||e<0||isNaN(e))throw TypeError("n must be a positive number");return this._maxListeners=e,this},Wc.prototype.emit=function(e){var t,n,i,r,o,a;if(this._events||(this._events={}),"error"===e&&!this._events.error)throw(t=arguments[1])instanceof Error?t:Error('Uncaught, unspecified "error" event.');if(n=this._events[e],$c.isUndefined(n))return!1;if($c.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($c.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},Wc.prototype.addListener=function(e,t){var n;if(!$c.isFunction(t))throw TypeError("listener must be a function");(this._events||(this._events={}),this._events.newListener&&this.emit("newListener",e,$c.isFunction(t.listener)?t.listener:t),this._events[e]?$c.isObject(this._events[e])?this._events[e].push(t):this._events[e]=[this._events[e],t]:this._events[e]=t,$c.isObject(this._events[e])&&!this._events[e].warned)&&((n=$c.isUndefined(this._maxListeners)?Wc.defaultMaxListeners:this._maxListeners)&&n>0&&this._events[e].length>n&&(this._events[e].warned=!0,$c.isFunction(console.error)&&console.error("(node) warning: possible EventEmitter memory leak detected. %d listeners added. Use emitter.setMaxListeners() to increase limit.",this._events[e].length),$c.isFunction(console.trace)&&console.trace()));return this},Wc.prototype.on=Wc.prototype.addListener,Wc.prototype.once=function(e,t){if(!$c.isFunction(t))throw TypeError("listener must be a function");var n=!1;function i(){this.removeListener(e,i),n||(n=!0,t.apply(this,arguments))}return i.listener=t,this.on(e,i),this},Wc.prototype.removeListener=function(e,t){var n,i,r,o;if(!$c.isFunction(t))throw TypeError("listener must be a function");if(!this._events||!this._events[e])return this;if(r=(n=this._events[e]).length,i=-1,n===t||$c.isFunction(n.listener)&&n.listener===t)delete this._events[e],this._events.removeListener&&this.emit("removeListener",e,t);else if($c.isObject(n)){for(o=r;o-- >0;)if(n[o]===t||n[o].listener&&n[o].listener===t){i=o;break}if(i<0)return this;1===n.length?(n.length=0,delete this._events[e]):n.splice(i,1),this._events.removeListener&&this.emit("removeListener",e,t)}return this},Wc.prototype.removeAllListeners=function(e){var t,n;if(!this._events)return this;if(!this._events.removeListener)return 0===arguments.length?this._events={}:this._events[e]&&delete this._events[e],this;if(0===arguments.length){for(t in this._events)"removeListener"!==t&&this.removeAllListeners(t);return this.removeAllListeners("removeListener"),this._events={},this}if(n=this._events[e],$c.isFunction(n))this.removeListener(e,n);else if(Array.isArray(n))for(;n.length;)this.removeListener(e,n[n.length-1]);return delete this._events[e],this},Wc.prototype.listeners=function(e){return this._events&&this._events[e]?$c.isFunction(this._events[e])?[this._events[e]]:this._events[e].slice():[]},Wc.listenerCount=function(e,t){return e._events&&e._events[t]?$c.isFunction(e._events[t])?1:e._events[t].length:0};var Yc={mixin:e=>(Object.keys(Uc.prototype).forEach((t=>{e[t]=Uc.prototype[t]})),Uc.init(e),e)};function Gc(){let e=0,t=0,n=0,i=0;n=n||e;const r={move(e){this.moveTo(n+e)},moveTo(o){const a=Math.max(e,Math.min(t-i,o));n!==a&&(n=a,r.emit("update"))},update(o){let a=!1;({min:e=e,max:t=t}=o),void 0!==o.viewSize&&o.viewSize!==i&&(i=o.viewSize,a=!0);const s=Math.max(e,Math.min(t-i,n));n!==s&&(n=s,a=!0),a&&r.emit("update")},getState:()=>({min:e,max:t,start:n,viewSize:i})};return Yc.mixin(r),r}function Xc(e,t){const n=e.min||0,i=e.max||0,r=e.viewSize||0,o=t||Gc();return o.update({min:n,max:i,viewSize:r}),o}function Kc(e,t){return e<=t}function Zc(e,t){return e<t}function Jc(e,t,n){let i=0;for(;i<e.length&&t>e[i];)++i;return e[i]===t&&n&&++i,i}function Qc(){let e,t,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;e=i?Kc:Zc,t=r?Kc:Zc},r.add=e=>{let{min:t,max:n}=e;const r=Jc(i,t),o=Jc(i,n,!0),a=[r,o-r];r%2==0&&a.push(t),o%2==0&&a.push(n);const s=i.join(",");i.splice(...a);return s!==i.join(",")},r.remove=e=>{let{min:t,max:n}=e;const r=Jc(i,t),o=Jc(i,n,!0),a=[r,o-r];r%2==1&&a.push(t),o%2==1&&a.push(n);const s=i.join(",");i.splice(...a);return s!==i.join(",")},r.set=e=>{const t=i.join(",");i=[],Array.isArray(e)?e.forEach(r.add):r.add(e);return t!==i.join(",")},r.clear=()=>{const e=i.length>0;return i=[],e},r.containsValue=n=>function(e,t,n,i){const r=e.length;for(let o=1;o<r;o+=2)if(n(e[o-1],t)&&i(t,e[o]))return!0;return!1}(i,n,t,e),r.containsRange=e=>{let{min:t,max:n}=e;const r=Jc(i,t,!0),o=Jc(i,n);return r===o&&o%2==1},r.toggle=e=>r.containsRange(e)?r.remove(e):r.add(e),r.ranges=()=>{const e=[];for(let t=1;t<i.length;t+=2)e.push({min:i[t-1],max:i[t]});return e},r.configure(n),r}function eu(){let e=[];function t(){}return t.add=t=>-1===e.indexOf(t)&&(e.push(t),!0),t.remove=t=>{const n=e.indexOf(t);return-1!==n&&(e.splice(n,1),!0)},t.contains=t=>-1!==e.indexOf(t),t.values=()=>e.slice(),t.clear=()=>e=[],t.toString=()=>e.join(";"),t}const tu={key:void 0,includeMin:!0,includeMax:!0};function nu(e){let{items:t,collection:n,vc:i}=e;const r={},o=[];let a,s;for(let e=0,o=t.length;e<o;e++){a=t[e].key,n[a]||(n[a]=i()),s=t[e].values||[t[e].value];for(let e=0;e<s.length;e++)n[a].add(s[e])&&(r[a]=r[a]||[],r[a].push(s[e]))}const l=Object.keys(r);for(let e=0,t=l.length;e<t;e++)a=l[e],o.push({id:a,values:r[a]});return o}function iu(e){let{items:t,collection:n}=e;const i={},r=[];let o,a;for(let e=0,r=t.length;e<r;e++)if(o=t[e].key,n[o]){a=t[e].values||[t[e].value];for(let e=0;e<a.length;e++)n[o].remove(a[e])&&(i[o]=i[o]||[],i[o].push(a[e]))}const s=Object.keys(i);for(let e=0,t=s.length;e<t;e++)o=s[e],r.push({id:o,values:i[o]});return r}function ru(e){const t={};let n,i;for(let r=0,o=e.length;r<o;r++){n=e[r].key,i=e[r].values||[e[r].value],t[n]||(t[n]=[]);for(let e=0;e<i.length;e++){-1===t[n].indexOf(i[e])&&t[n].push(i[e])}}return t}function ou(e){let{key:t,collection:n,obj:i,fn:r,value:o}=e;n[t]||(n[t]=r()),i[t]=i[t]||[],i[t].push(o),n[t].add(o)}function au(e,t){const n=[],i=Object.keys(e);let r,o;const a=e=>-1===t[r].indexOf(e);for(let s=0,l=i.length;s<l;s++)r=i[s],t[r]?(o=e[r].filter(a),o.length&&n.push({id:r,values:o})):n.push({id:r,values:e[r]});return n}function su(e,t,n){const i=function(e,t){if(!Object.keys(t).length)return e;const n=e.length,i=Array(n);for(let r=0;r<n;r++)i[r]=e[r].key in t?Qi({},e[r],{key:t[e[r].key]}):e[r];return i}(t,n);return e&&e.length?e.reduce(((e,t)=>t(e)),i):i}function lu(e){return e.replace(/(-[a-z])/g,(e=>e.toUpperCase().replace("-","")))}function cu(e){return e.replace(/([A-Z])/g,(e=>"-".concat(e.toLowerCase())))}function uu(e,t,n){let{ranges:i,interceptors:r,rc:o,aliases:a,rangeConfig:s}=n;const l=su(r["".concat(t,"Ranges")],e,a);let c=!1;return l.forEach((e=>{const n=e.key;if(i[n]||(i[n]=o(s.sources[n]||s.default)),"set"===t)c=i[n][t](e.ranges||e.range)||c;else{const r=e.ranges||[e.range];for(let e=0;e<r.length;e++)c=i[n][t](r[e])||c}})),c}function hu(){let{vc:e=eu,rc:t=Qc}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=!1,i={},r={},o={},a={sources:{},default:Qi({},tu)};const s={addValues:[],removeValues:[],toggleValues:[],setValues:[],addRanges:[],setRanges:[],removeRanges:[],toggleRanges:[]},l=()=>{const e={values:{},ranges:{}};return Object.keys(r).forEach((t=>{e.values[t]=r[t].values()})),Object.keys(i).forEach((t=>{e.ranges[t]=i[t].ranges()})),e},c={ls:[],clear(){this.ls.forEach((e=>e.clear()))},start(){this.ls.forEach((e=>e.start()))},end(){this.ls.forEach((e=>e.end()))},update(){const e=l();this.ls.forEach((t=>t._state(e)))},updateValues(){const e=l();this.ls.forEach((t=>t._state({values:e.values})))},updateRanges(){const e=l();this.ls.forEach((t=>t._state({ranges:e.ranges})))}},u={configure:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};Array.isArray(e.ranges)&&e.ranges.length&&(a={sources:{},default:Qi({},tu)},e.ranges.forEach((e=>{const t={};Object.keys(tu).filter((e=>"key"!==e)).forEach((n=>{t[n]=void 0!==e[n]?e[n]:tu[n]})),void 0!==e.key?a.sources[e.key]=t:a.default=t})),Object.keys(i).forEach((e=>i[e].configure(a.sources[e]||a.default))),u.emit("update",[],[]))},link:e=>{if(u===e)throw new Error("Can't link to self");c.ls.push(e),e._state(l())},_state:e=>{if(!e)return l();if(e.values){const t=[];Object.keys(e.values).forEach((n=>{r[n]&&e.values[n].join(";")===r[n].toString()||t.push({key:n,values:e.values[n]})})),Object.keys(r).forEach((n=>{e.values[n]||t.push({key:n,values:[]})})),t.length&&u.setValues(t)}if(e.ranges){const t=[];Object.keys(e.ranges).forEach((n=>{i[n]&&e.ranges[n].join(";")===i[n].toString()||t.push({key:n,ranges:e.ranges[n]})})),Object.keys(i).forEach((n=>{e.ranges[n]||t.push({key:n,ranges:[]})})),t.length&&u.setRanges(t)}},start:function(){if(!n){n=!0;for(var e=arguments.length,t=new Array(e),i=0;i<e;i++)t[i]=arguments[i];u.emit("start",...t),c.start()}},end:function(){if(n){n=!1,i={},r={};for(var e=arguments.length,t=new Array(e),o=0;o<e;o++)t[o]=arguments[o];u.emit("end",...t),c.end()}},isActive:()=>n,clear:()=>{const e=u.brushes().filter((e=>"value"===e.type&&e.brush.values().length)).map((e=>({id:e.id,values:e.brush.values()}))),t=Object.keys(i).length>0||e.length;i={},r={},t&&(u.emit("update",[],e),c.clear())},brushes:()=>{let e=[];return e=e.concat(Object.keys(i).map((e=>({type:"range",id:e,brush:i[e]})))),e=e.concat(Object.keys(r).map((e=>({type:"value",id:e,brush:r[e]})))),e},addValue:(e,t)=>{u.addValues([{key:e,value:t}])},addValues:t=>{const i=su(s.addValues,t,o),a=nu({vc:e,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=t=>{const i=su(s.setValues,t,o),a=function(e){let{items:t,vCollection:n,vc:i}=e;const r={},o=ru(t);let a,s=[],l=[];const c={},u=Object.keys(n);for(let e=0,t=u.length;e<t;e++)a=u[e],c[a]=n[a].values().slice(),delete n[a];const h=e=>{n[a]&&n[a].contains(e)||ou({key:a,value:e,collection:n,obj:r,fn:i})},d=Object.keys(o);for(let e=0,t=d.length;e<t;e++)a=d[e],o[a].forEach(h);return l=au(c,r),s=au(r,c),[s,l]}({items:i,vCollection:r,vc:e});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=(e,t)=>{u.removeValues([{key:e,value:t}])},u.removeValues=e=>{const t=su(s.removeValues,e,o),n=iu({collection:r,items:t});u.emit("remove-values",t),n.length&&(u.emit("update",[],n),c.updateValues())},u.addAndRemoveValues=(t,i)=>{const a=su(s.addValues,t,o),l=su(s.removeValues,i,o),h=nu({vc:e,collection:r,items:a}),d=iu({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=(e,t)=>{u.toggleValues([{key:e,value:t}])},u.toggleValues=t=>{const i=su(s.toggleValues,t,o),a=function(e){let{items:t,values:n,vc:i}=e;const r={},o={},a=[],s=[],l=ru(t);let c,u,h;const d=Object.keys(l);for(let e=0,t=d.length;e<t;e++){c=d[e],h=l[c];for(let e=0,t=h.length;e<t;e++)u=h[e],n[c]&&n[c].contains(u)?n[c]&&n[c].contains(u)&&(o[c]=o[c]||[],o[c].push(u),n[c].remove(u)):ou({key:c,value:u,collection:n,obj:r,fn:i})}const f=Object.keys(r);for(let e=0,t=f.length;e<t;e++)c=f[e],a.push({id:c,values:r[c]});const p=Object.keys(o);for(let e=0,t=p.length;e<t;e++)c=p[e],s.push({id:c,values:o[c]});return[a,s]}({items:i,values:r,vc:e});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=(e,t)=>{let n=o[e]||e;return!!r[n]&&r[n].contains(t)},u.addRange=(e,t)=>{u.addRanges([{key:e,range:t}])},u.addRanges=e=>{uu(e,"add",{ranges:i,rc:t,interceptors:s,aliases:o,rangeConfig:a})&&(n||(n=!0,u.emit("start")),u.emit("update",[],[]),c.updateRanges())},u.removeRange=(e,t)=>{u.removeRanges([{key:e,range:t}])},u.removeRanges=e=>{uu(e,"remove",{ranges:i,rc:t,interceptors:s,aliases:o,rangeConfig:a})&&(n||(n=!0,u.emit("start")),u.emit("update",[],[]),c.updateRanges())},u.setRange=(e,t)=>{u.setRanges([{key:e,range:t}])},u.setRanges=e=>{uu(e,"set",{ranges:i,rc:t,interceptors:s,aliases:o,rangeConfig:a})&&(n||(n=!0,u.emit("start")),u.emit("update",[],[]),c.updateRanges())},u.toggleRange=(e,t)=>{u.toggleRanges([{key:e,range:t}])},u.toggleRanges=e=>{uu(e,"toggle",{ranges:i,rc:t,interceptors:s,aliases:o,rangeConfig:a})&&(n||(n=!0,u.emit("start")),u.emit("update",[],[]),c.updateRanges())},u.containsRangeValue=(e,t)=>{let n=o[e]||e;return!!i[n]&&i[n].containsValue(t)},u.containsRange=(e,t)=>{let n=o[e]||e;return!!i[n]&&i[n].containsRange(t)},u.containsMappedData=(e,t,n)=>{let a=[];const s=Object.keys(e);let l,c,u,h;for(let t=0,n=s.length;t<n;t++){if(l=s[t],"value"===l)c=e,a[t]={key:"",i:t,bool:!1};else{if("source"===l)continue;c=e[l],a[t]={key:l,i:t,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[t].bool=Array.isArray(h)?i[u].containsRange({min:h[0],max:h[1]}):i[u].containsValue(h):r[u]&&r[u].contains(h)&&(a[t].bool=!0))}return t?(a=a.filter((e=>-1!==t.indexOf(e.key))),"and"===n?!!a.length&&!a.some((e=>!1===e.bool)):"xor"===n?!!a.length&&a.some((e=>e.bool))&&a.some((e=>!1===e.bool)):a.some((e=>e.bool))):a.some((e=>e.bool))},u.intercept=(e,t)=>{const n=lu(e);s[n]&&s[n].push(t)},u.removeInterceptor=(e,t)=>{const n=lu(e);if(!s[n])return;const i=s[n].indexOf(t);-1!==i&&s[n].splice(i,1)},u.removeAllInterceptors=e=>{const t=[];if(e){const n=lu(e);s[n]&&s[n].length&&t.push({name:e,handlers:s[n]})}else Object.keys(s).forEach((e=>{s[e].length&&t.push({name:cu(e),handlers:s[e]})}));t.forEach((e=>{e.handlers.slice().forEach((t=>u.removeInterceptor(e.name,t)))}))},u.addKeyAlias=(e,t)=>{o[e]=t},u.removeKeyAlias=e=>{delete o[e]},Yc.mixin(u),u}function du(e){return e*e*e}function fu(e){return--e*e*e+1}function pu(e){return((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2}yo();const mu=["stroke","fill","color","backgroundColor","thumbColor"];function gu(e,t){const n=t?t.length:0,i=e?Math.min(n,e.length):0,r=new Array(i),o=new Array(n);let a;for(a=0;a<i;++a)r[a]=yu(e[a],t[a]);for(;a<n;++a)o[a]=t[a];return function(e){for(a=0;a<i;++a)o[a]=r[a](e);return o}}function yu(e,t,n){const i=typeof t;let r;return null==t||"boolean"===i?function(e){return()=>e}(t):("number"===i?Kl:"string"===i?(r=Dl(t))&&mu.includes(n)?(t=r,Ul):ec:t instanceof Dl?Ul:t instanceof Date?Xl:function(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}(t)?Yl:Array.isArray(t)?gu:"function"!=typeof t.valueOf&&"function"!=typeof t.toString||isNaN(t)?xu:Kl)(e,t)}function xu(e,t){const n={},i={};let r;for(r in null!==e&&"object"==typeof e||(e={}),null!==t&&"object"==typeof t||(t={}),t)r in e?n[r]=yu(e[r],t[r],r):i[r]=t[r];return function(e){for(r in n)i[r]=n[r](e);return i}}function vu(e,t){return e.data?e.data.value:"text"===e.type?e.text:t}const bu={fontFamily:"Arial",fontSize:"13px",color:"#595959",backgroundColor:"#ffffff",stroke:"#000000",strokeWidth:0,$fill:"#333333"},wu=/^\$/;function Mu(e){const t=typeof e;return"object"!==t&&"function"!==t&&"undefined"!==t}function ku(e,t,n){const i=e[t];i&&i.scale&&i.scale.pxScale?i.scale=i.scale.pxScale(n):i&&i.pxScale&&(e[t]=i.pxScale(n))}function Su(e,t){return e.pxScale?e.pxScale(t):e}const _u={normalizeSettings:function(e,t,n){const i=Qi({},e),r=Qi({},t);return Object.keys(i).forEach((e=>{r[e]={};const o=i[e],a=typeof o;if("function"==typeof o)r[e].fn=o;else if(Mu(o)){let n=t[e];"string"==typeof n&&wu.test(n)&&(n=bu[n]);const i=typeof n;r[e]="undefined"===i||i===a?o:n}else o&&"object"==typeof o&&("function"==typeof o.fn&&(r[e].fn=o.fn),void 0!==o.scale&&(r[e].scale=n.scale(o.scale)),"string"==typeof o.ref&&(r[e].ref=o.ref))})),Object.keys(t).forEach((e=>{if(e in i)return;const n=t[e];"string"===typeof n&&wu.test(n)?r[e]=bu[n]:r[e]=n})),r},resolveForItem:function(e,t,n){const i={},r=Object.keys(t),o=r.length,a=e.datum,s=e.datum;for(let l=0;l<o;l++){const o=r[l],c=t[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;Mu(c)?i[o]=c:u&&c.fn?(c.scale&&(e.scale=c.scale),i[o]=c.fn.call(null,e,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,e,n):i[o]=c}return i},updateScaleSize:ku};function qu(){return(arguments.length>0&&void 0!==arguments[0]?arguments[0]:[]).reduce(((e,t)=>Array.isArray(t.children)?(e.push(...qu(t.children)),e):(e.push(t),e)),[])}function Du(e,t){let{context:n,data:i,style:r,filter:o,mode:a}=t;const s=e.chart.brush(n),l=i,c=r.active||{},u=r.inactive||{},h=[];Object.keys(c).forEach((e=>{h.push(e)})),Object.keys(u).forEach((e=>{-1===h.indexOf(e)&&h.push(e)}));const d=[];let f=!1;const p=()=>{let t=qu(e.nodes);return"function"==typeof o&&(t=t.filter(o)),t},m=()=>{const e=p(),t=e.length;let n,i=!1;const r="function"==typeof l?l({brush:s}):l;for(let i=0;i<t;i++){if(n=e[i].data,!n)continue;e[i].__style||(e[i].__style={},h.forEach((t=>{e[i].__style[t]=e[i][t]})));const t=s.containsMappedData(n,r,a),o=d.indexOf(e[i]);let l=!1;t&&-1===o?(d.push(e[i]),l=!0):t||-1===o||(d.splice(o,1),l=!0),e[i].needToUpdate=l||f,e[i].isActive=t}for(let r=0;r<t;r++)if(n=e[r].data,n){if(e[r].needToUpdate){const t=Qi({},e[r],e[r].__style),n=e[r].isActive;h.forEach((i=>{e[r][i]=n&&i in c?"function"==typeof c[i]?c[i].call(null,t,d):c[i]:!n&&i in u?"function"==typeof u[i]?u[i].call(null,t,d):u[i]:e[r].__style[i]})),i=!0}delete e[r].needToUpdate}return f=!1,i},g=function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{suppressRender:!1};const{suppressRender:n}=t,i=p(),r=i.length;for(let e=0;e<r;e++)i[e].data&&(i[e].__style=i[e].__style||{},h.forEach((t=>{i[e].__style[t]=i[e][t],t in u&&(i[e][t]="function"==typeof u[t]?u[t].call(null,i[e]):u[t])})));f=!0,d.length=0,n||e.renderer.render(e.nodes)},y=function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{suppressRender:!1};const{suppressRender:n}=t,i=p(),r=i.length;for(let e=0;e<r;e++)i[e].__style&&(Object.keys(i[e].__style).forEach((t=>{i[e][t]=i[e].__style[t]})),i[e].__style=void 0);d.length=0,n||e.renderer.render(e.nodes)},x=()=>{if(m()){const t="function"==typeof e.config.sortNodes?e.config.sortNodes(e):e.nodes;"function"==typeof e.config.customRender?e.config.customRender({render:e.renderer.render,nodes:t}):e.renderer.render(t)}};return s.on("start",g),s.on("end",y),s.on("update",x),{isActive:()=>s.isActive(),update:()=>{d.length=0,f=!0,m()},cleanUp:function(){s.removeListener("start",g),s.removeListener("end",y),s.removeListener("update",x)}}}function Au(e){let{nodes:t,action:n,chart:i,trigger:r}=e;const o=[];for(let e=0;e<t.length;e++){let n=t[e].data;null!==n&&o.push(n)}!function(e){let{dataPoints:t,action:n,chart:i,trigger:r}=e;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 e=0;e<t.length;e++){const n=t[e];n&&o.forEach((e=>{let t=n&&!e?n:n[e];if(t){let e={key:t.source.field};void 0!==t.source.key&&(e.key="".concat(t.source.key,"/").concat(t.source.field)),Array.isArray(t.value)?(e.range={min:t.value[0],max:t.value[1]},a.items.push(e)):(e.value=t.value,s.items.push(e))}}))}r.contexts.forEach((e=>{a.items.length?i.brush(e)[a.actionFn](a.items):i.brush(e)[s.actionFn](s.items)}))}({dataPoints:o,action:n,chart:i,trigger:r})}function Cu(e){let{collisions:t,t:n,config:i,action:r}=e,o=[],a=!1;t.length>0&&(o=t,a=!0,"stop"===n.propagation&&(o=[t[t.length-1]]));const s=o.map((e=>e.node));return Au({nodes:s,action:r,chart:i.chart,data:i.data,trigger:n}),a}function Nu(e,t,n){const i=n.element().getBoundingClientRect();let r=rr(e)?function(e,t){return 1!==e.changedTouches.length?null:{x:e.changedTouches[0].clientX-t.left,y:e.changedTouches[0].clientY-t.top}}(e,i):function(e,t){return{x:e.clientX-t.left,y:e.clientY-t.top}}(e,i);return null===r||r.x<0||r.y<0||r.x>i.width||r.y>i.height?[]:(t.touchRadius>0&&rr(e)?r={cx:r.x,cy:r.y,r:t.touchRadius}:t.mouseRadius>0&&!rr(e)&&(r={cx:r.x,cy:r.y,r:t.mouseRadius}),n.itemsAt(r))}function Eu(e,t,n){return e?"function"==typeof e?e(t):e:n}const Ru={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 Iu(e){let t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],n="";for(let t=0;t<e.length;t++){const i=e[t];n+=0===t?"M".concat(i.x," ").concat(i.y):"L".concat(i.x," ").concat(i.y),n+=" "}return t&&(n+="Z"),n}function Ou(e,t,n,i){const r=n/2,o=e-i/2,a=t-i/2,s=e-r,l=t-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(e){return-e/180*Math.PI}function Lu(e){return function(e){let t=(.5*(Math.floor(e/Math.PI*2)+2)+.25)*Math.PI,n=Math.cos(Math.abs(t-e))*Math.sqrt(2),i=n*Math.cos(e),r=n*Math.sin(e);return{x1:i<0?1:0,y1:r<0?1:0,x2:i>=0?i:i+1,y2:r>=0?r:r+1}}(Pu(e))}function Tu(e,t){return{x:e.x+t.x,y:e.y+t.y}}function zu(e,t){return{x:e.x-t.x,y:e.y-t.y}}function Fu(e,t){return{x:e.x*t,y:e.y*t}}function ju(e,t){return e.x-t.x}function Vu(e,t){return e.y-t.y}function Bu(e,t){return ju(e,t)**2+Vu(e,t)**2}function Hu(e,t){return Math.sqrt(Bu(e,t))}function $u(e,t){return e.x*t.x+e.y*t.y}function Wu(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{x:0,y:0};const i=Math.cos(t),r=Math.sin(t),o=zu(e,n);return Tu({x:i*o.x-r*o.y,y:r*o.x+i*o.y},n)}const Uu={up:0,down:180,left:90,right:-90};function Yu(e){let{x:t,y:n,size:i}=e;const r=i/2;return{type:"rect",x:t-r,y:n-r,width:i,height:i}}const Gu=yo();Gu.add("circle",(function(e){return{type:"circle",fill:"black",cx:e.x,cy:e.y,r:e.size/2}})),Gu.add("diamond",(function(e){const t=e.size,n=e.x-t/2,i=e.y-t/2;return{type:"path",fill:"black",d:Iu([{x:n,y:i+t/2},{x:n+t/2,y:i},{x:n+t,y:i+t/2},{x:n+t/2,y:i+t},{x:n,y:i+t/2}])}})),Gu.add("saltire",(function(e){const t=Pu(45),n=e.size/2,i=isNaN(e.width)?n/2:e.width,r=Math.min(i,n);let o=e.size;const a=Math.sin(Math.asin(-t))*(r/2);o+=2*(n/Math.sin(-t)-n),o-=2*a;const s={x:e.x,y:e.y},l=Ou(e.x,e.y,o,r).map((e=>Wu(e,t,s)));return{type:"path",fill:"black",d:Iu(l)}})),Gu.add("square",(function(e){const t=e.size;return{type:"rect",fill:"black",x:e.x-t/2,y:e.y-t/2,width:t,height:t}})),Gu.add("triangle",(function(e){const t=e.size,n={x:e.x,y:e.y},i=Uu[e.direction]||0,r=t/2,o=e.x-r,a=e.y-r;let s=[{x:o,y:a+t},{x:o+r,y:a},{x:o+t,y:a+t},{x:o,y:a+t}];const l=Pu(i);return s=s.map((e=>Wu(e,l,n))),{type:"path",fill:"black",d:Iu(s)}})),Gu.add("line",(function(e){const t="vertical"===e.direction,n=e.size/2,i=e.x,r=e.y;return{type:"line",stroke:"black",strokeWidth:1,x1:i-(t?0:n),y1:r-(t?n:0),x2:i+(t?0:n),y2:r+(t?n:0),collider:Yu(e)}})),Gu.add("star",(function(e){const t=e.size,n=[],i=t/2,r=e.points||5,o=Math.min(e.innerRadius||t/2,t)/2,a=isNaN(e.startAngle)?90:e.startAngle,s=360/r;for(let t=1;t<=r;t++){const r=s*t+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:e.x+h*i,y:e.y+u*i}),n.push({x:e.x+f*o,y:e.y+d*o})}return{type:"path",fill:"black",d:Iu(n)}})),Gu.add("n-polygon",(function(e){const t=[],n=e.size/2,i=Math.max(isNaN(e.sides)?6:e.sides,3),r=360/i,o=isNaN(e.startAngle)?0:e.startAngle;for(let a=1;a<=i;a++){const i=Pu(r*a+o),s=Math.sin(i),l=Math.cos(i);t.push({x:e.x+l*n,y:e.y+s*n})}return{type:"path",fill:"black",d:Iu(t)}})),Gu.add("cross",(function(e){const t=e.x,n=e.y,i=e.size/2,r=isNaN(e.width)?i/2:e.width,o=Math.min(r,i);return{type:"path",fill:"black",d:Iu(Ou(t,n,e.size,o))}})),Gu.add("bar",(function(e){const t={x:e.x,y:e.y},n="vertical"===e.direction,i=e.size/2,r=i/2/2;let o=[{x:t.x-i,y:t.y+r},{x:t.x-i,y:t.y-r},{x:t.x+i,y:t.y-r},{x:t.x+i,y:t.y+r}];if(n){const e=Pu(90);o=o.map((n=>Wu(n,e,t)))}const a=ur(o);return a.type="rect",a.fill="black",a})),Gu.add("rect",(function(e){const{x:t,y:n,size:i}=e,r=void 0===e.width?i:e.width,o=void 0===e.height?i:e.height;return{type:"rect",fill:"black",x:t-r/2,y:n-o/2,width:r,height:o}}));const Xu=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Gu;return function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const n=e.get(t.type);if(n){const e=n(t);return function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};Object.keys(t).forEach((n=>{void 0!==Ru[n]&&"transform"!==n&&(e[n]=t[n])}))}(e,t),void 0!==t.data&&(e.data=t.data),e}return n}};function Ku(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=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}=e;n=n||"center";return{computePreferredSize(e){let{inner:n,outer:i,children:r}=e;return"function"==typeof o?o({inner:n,outer:i,children:r,dock:this.dock()},t):o},dock(e){return void 0!==e?(n=e,this):"function"==typeof n?n(t):n},displayOrder(e){return void 0!==e?(i=e,this):"function"==typeof i?i(t):i},prioOrder(e){return void 0!==e?(r=e,this):"function"==typeof r?r(t):r},minimumLayoutMode(e){return void 0!==e?(a=e,this):"function"==typeof a?a(t):a},show(e){return void 0!==e?(s=e,this):"function"==typeof s?s(t):s}}}function Zu(e,t,n){const{require:i=[]}=t,r=t.mediator||{},{settings:o,formatter:a,scale:s,data:l,renderer:c,chart:u,dockConfig:h,mediator:d,instance:f,rect:p,style:m,registries:g,resolver:y,update:x,_DO_NOT_USE_getInfo:v,symbol:b,isVisible:w}=n;e.emit=()=>{},w&&(e.isVisible=w),Object.defineProperty(e,"settings",{get:o}),Object.defineProperty(e,"data",{get:l}),Object.defineProperty(e,"formatter",{get:a}),Object.defineProperty(e,"scale",{get:s}),Object.defineProperty(e,"mediator",{get:d}),Object.defineProperty(e,"style",{get:m}),Object.defineProperty(e,"registries",{get:g}),p&&Object.defineProperty(e,"rect",{get:p}),v&&(e._DO_NOT_USE_getInfo=v),Object.keys(t).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((e=>e===i))||("function"==typeof t[n]?e[n]=t[n].bind(e):e[n]=t[n])})),i.forEach((t=>{"renderer"===t?Object.defineProperty(e,"renderer",{get:c}):"chart"===t?Object.defineProperty(e,"chart",{get:u}):"dockConfig"===t?Object.defineProperty(e,"dockConfig",{get:h}):"instance"===t?Object.defineProperty(e,"instance",{get:f}):"update"===t&&x?Object.defineProperty(e,"update",{get:x}):"resolver"===t?Object.defineProperty(e,"resolver",{get:y}):"symbol"===t&&Object.defineProperty(e,"symbol",{get:b})})),Object.keys(r).forEach((t=>{e.mediator.on(t,r[t].bind(e))}))}function Ju(e,t,n){const i=t=>e[t]?(n.warn("Deprecation Warning the ".concat(t," property should be moved into layout: {} property")),e[t]):e.layout?e.layout[t]:void 0,r={};return r.displayOrder=i("displayOrder"),r.dock=i("dock"),r.prioOrder=i("prioOrder"),r.minimumLayoutMode=i("minimumLayoutMode"),e.layout=e.layout||{},e.layout.displayOrder=void 0!==r.displayOrder?r.displayOrder:e.layout.displayOrder,e.layout.prioOrder=void 0!==r.prioOrder?r.prioOrder:e.layout.prioOrder,e.layout.dock=r.dock||e.layout.dock,e.layout.minimumLayoutMode=r.minimumLayoutMode||e.layout.minimumLayoutMode,r.show=e.show,r.preferredSize=t,r}function Qu(e,t,n){Object.keys(n.on||{}).forEach((i=>{e.eventListeners=e.eventListeners||[];const r=n.on[i].bind(e);e.eventListeners.push({event:i,listener:r}),t.on(i,r)})),e.emit=function(e){for(var n=arguments.length,i=new Array(n>1?n-1:0),r=1;r<n;r++)i[r-1]=arguments[r];return t.emit(e,...i)}}function eh(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const{defaultSettings:n={},_DO_NOT_USE_getInfo:i=()=>({})}=e,{chart:r,container:o,mediator:a,registries:s,theme:l,renderer:c}=t,u=Yc.mixin({});let h,d,f,p,m,g=t.settings||{},y=Qi(!0,{},n,g),x=[],v=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:_u,n={};return{resolve:function(i){let{data:r,settings:o,defaults:a={},scaled:s}=i;const l=n.norm=t.normalizeSettings(o,a,e.chart),c={scale:e.chart.scale,formatter:e.chart.formatter};s&&Object.keys(s).forEach((e=>{l[e]&&t.updateScaleSize(l,e,s[e])}));const u=[];if(!r||!Array.isArray(r.items)){const e={data:r,resources:c};let i=t.resolveForItem(e,n.norm,-1);return{settings:n.norm,item:i}}{let e;for(let i=0,o=r.items.length;i<o;i++){e={datum:r.items[i],data:r,resources:c};let o=t.resolveForItem(e,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={},_=Qi({},g);function q(t){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!==e[t],o=void 0!==g[t];let a;for(var s=arguments.length,l=new Array(s),c=0;c<s;c++)l[c]=arguments[c];return r&&("function"==typeof e[t]?a=e[t].call(S,...l):i&&(a=e[t])),o&&("function"==typeof g[t]?a=g[t].call(_,...l):i&&(a=g[t])),r||o||(a=n.call(S,...l)),a}}const D=q("preferredSize",(()=>0),!0),A=q("resize",(e=>{let{inner:t}=e;return t})),C=q("created"),N=q("beforeMount"),E=q("mounted"),R=q("beforeUnmount"),I=q("beforeUpdate"),O=q("updated"),P=q("beforeRender"),L=q("beforeDestroy"),T=q("destroyed"),z=e.render,F=()=>{y.brush&&(y.brush.consume||[]).forEach((e=>{e.context&&e.style&&k.push(Du(w,e))}))},j=()=>{y.brush&&(y.brush.trigger||[]).forEach((e=>{"over"===e.on?M.over.push(e):M.tap.push(e)}))};Object.defineProperty(w,"data",{get:()=>x});const V=y.renderer||e.renderer,B=V?c||s.renderer(V)():c||s.renderer()();"function"==typeof B.settings&&B.settings(y.rendererSettings),w.renderer=B;const H={resources:r.logger?{logger:r.logger()}:{}};let $=Ku(Ju(y,D,r.logger()),H);const W=e=>{e.key=y.key,e.element=B.element()},U=()=>{};U.dockConfig=()=>$,U.set=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(e.settings&&(g=e.settings,y=Qi(!0,{},n,e.settings),$=Ku(Ju(y,D,r.logger()),H),w.config=y.brush||{}),y.scale&&(h=r.scale(y.scale)),y.data){const{rendererSettings:e}=y,t="function"==typeof(null==e?void 0:e.progressive)&&e.progressive(),n=il(y.data,{dataset:r.dataset,collection:r.dataCollection},{logger:r.logger()},r.dataCollection);t?t.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()),m=l.style(y.style||{})},U.resize=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const n=A({inner:e,outer:t});p=n?B.size(n):B.size(e),_.rect=Qi(!0,{computedPhysical:p.computedPhysical,computedOuter:t.computed||t,computedInner:e.computed||e},e),p=Qi(!0,{computedOuter:t.computed||t,computedInner:e.computed||e},p)},U.getRect=()=>_.rect;const Y=()=>{const e=B.renderArgs?B.renderArgs.slice(0):[],{rendererSettings:t}=y;let n=x;const i="function"==typeof(null==t?void 0:t.progressive)&&t.progressive();return x.items&&i&&(n=ir(ir({},x),{},{items:x.items.slice(i.start,i.end)})),e.push({data:n}),e};let G,X,K;function Z(e){const{rendererSettings:t}=y,n="function"==typeof(null==t?void 0:t.progressive)&&t.progressive();n?n.isFirst?w.nodes=[...e||[]]:w.nodes&&(w.nodes=[...w.nodes,...e||[]]):w.nodes=e}U.beforeMount=N,U.beforeRender=()=>{P({size:p})},U.render=()=>{const e=z.call(S,...Y());Z(e),B.render(e),G=e,X=_.rect.computed},U.hide=()=>{U.unmount(),B.size({x:0,y:0,width:0,height:0}),B.clear()},U.beforeUpdate=()=>{I({settings:y,data:x})},U.update=()=>{K&&K.stop();const{rendererSettings:e,brush:t,animations:n}=y;if("function"==typeof(null==e?void 0:e.transform)&&e.transform())return B.render(),void(G=null);const i=z.call(S,...Y());Z(i),k.forEach((e=>e.cleanUp())),k.length=0,M.tap=[],M.over=[],t&&(F(),j()),k.forEach((e=>{e.isActive()&&e.update()})),G&&n&&("function"==typeof n.enabled?n.enabled():n.enabled)?(n.compensateForLayoutChanges&&n.compensateForLayoutChanges({currentNodes:G,currentRect:_.rect.computed,previousRect:X}),K=function(e,t,n,i){let r,{old:o,current:a}=e,{renderer:s}=t,l=[],c={nodes:[],ips:[]},u={nodes:[],ips:[]},h={nodes:[],ips:[]},d=[],f=null;const p=n.trackBy||vu,m={start(){let e={};if(o.forEach(((t,n)=>{let i=p(t,n);e[i]=t})),a.forEach(((t,n)=>{let i=p(t,n);if(e[i]){if("path"===t.type&&t.points&&t.points.length>0&&"trend"!==t.data.source.key){const n=function(e,t){const n=e.points.filter((e=>!e.dummy)),i=t.points.filter((e=>!e.dummy)),r=i.map((e=>e.data.major.value)),o=n.filter((e=>r.includes(e.data.major.value))).map((e=>e.data.major.value)),a=n.filter((e=>o.includes(e.data.major.value))),s=i.filter((e=>o.includes(e.data.major.value)));return{old:a,current:s}}(e[i],t);h.ips.push(xu(Qi({},e[i],{points:n.old}),Qi({},t,{points:n.current}))),l.push(Qi({},e[i],{commonPoints:n.old}))}else h.ips.push(xu(e[i],t)),l.push(e[i]);h.nodes.push(t),e[i]=!1}else c.nodes.push(t),c.ips.push(xu(Qi({},t,{r:.001,opacity:0}),t))})),Object.keys(e).forEach((t=>{e[t]&&(u.nodes.push(e[t]),u.ips.push(xu(e[t],Qi({},e[t],{r:1e-4,opacity:0}))))})),d.push({name:"exiting",easing:du,duration:200,tweens:u.ips,nodes:[...l]}),d.push({name:"updating",easing:pu,duration:400,tweens:h.ips,nodes:[]}),d.push({name:"entering",easing:fu,duration:200,tweens:c.ips,nodes:[...h.nodes]}),n.isMainComponent){var t;const e=null===(t=n.isMainComponent)||void 0===t?void 0:t.filterFn,r=e?l.filter(e).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(m.tick)))},tick(){let e=d[0];e||m.stop(),e.started||(e.started=Date.now());let t=(Date.now()-e.started)/e.duration,o=[],a=e.tweens.map((n=>n(e.easing(Math.min(1,t)))));const{adjustTweenedNodes:l}=n;if(l&&l(a),o.push(...a),o.push(...e.nodes),s.render(o),t>=1){d.shift();const{isInit:e,shouldBeRemoved:t}=i.getValue("animations.updatingStageMeta");d.length?"updating"===d[0].name&&t&&d.shift():(!0===e&&i.setValue("animations.updatingStageMeta.isInit",!1),m.stop())}r&&(r=window.requestAnimationFrame(m.tick))},stop(){r&&(window.cancelAnimationFrame(r),r=!1)},inProgress:()=>!!r,get targetScene(){return f}};return m}({old:G,current:i},{renderer:B},n,r.storage),K.start()):B.render(i),G=i,X=_.rect.computed,B.setKey&&"string"==typeof g.key&&B.setKey(g.key)},U.updated=O,U.destroy=()=>{U.unmount(),L(f),B.destroy(),T(),f=null};const J=e=>{w.nodes=e,k.forEach((e=>{e.isActive()&&e.update()})),B.render(e)};return Zu(S,e,{settings:()=>y,data:()=>x,scale:()=>h,formatter:()=>d,renderer:()=>B,chart:()=>r,dockConfig:()=>$,mediator:()=>a,instance:()=>_,rect:()=>_.rect,style:()=>m,update:()=>J,registries:()=>s,resolver:()=>v,symbol:()=>Xu(s.symbol)}),Zu(_,g,{settings:()=>y,data:()=>x,scale:()=>h,formatter:()=>d,renderer:()=>B,chart:()=>r,dockConfig:()=>$,mediator:()=>a,style:()=>m,_DO_NOT_USE_getInfo:i.bind(S),isVisible:()=>b}),U.getBrushedShapes=function(e,t,n){const i=[];if(y.brush&&y.brush.consume){const o=r.brush(e),a=B.findShapes("*");y.brush.consume.filter((t=>t.context===e)).forEach((e=>{for(let r=0;r<a.length;r++){const s=a[r];s.data&&o.containsMappedData(s.data,n||e.data,t)&&(W(s),i.push(s),a.splice(r,1),r--)}}))}return i},U.findShapes=e=>{var t;const n=(null!==(t=K)&&void 0!==t&&t.inProgress()?K.targetScene:B).findShapes(e);for(let e=0,t=n.length;e<t;e++)W(n[e]);return n},U.shapesAt=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const n=B.itemsAt(e);let i;i=t&&"stop"===t.propagation&&n.length>0?[n.pop().node]:n.map((e=>e.node));for(let e=0,t=i.length;e<t;e++)W(i[e]);return i},U.brushFromShapes=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};t.contexts=Array.isArray(t.contexts)?t.contexts:[];Au({nodes:e,action:t.action||"toggle",trigger:t,chart:r,data:w.data})},U.mount=()=>{f=B.element&&B.element()?f:B.appendTo(o),B.setKey&&"string"==typeof g.key&&B.setKey(g.key),y.brush&&(F(),j()),Qu(_,u,g),Qu(S,u,e),b=!0},U.mounted=()=>E(f),U.unmount=()=>{[_,S].forEach((e=>{!function(e,t){e.eventListeners&&(e.eventListeners.forEach((e=>{let{event:n,listener:i}=e;t.removeListener(n,i)})),e.eventListeners.length=0),e.emit=()=>{}}(e,u)})),M.tap=[],M.over=[],k.forEach((e=>{e.cleanUp()})),k.length=0,R(),b=!1},U.onBrushTap=e=>{M.tap.forEach((t=>{(function(e){let{e:t,t:n,config:i}=e;return Cu({collisions:Nu(t,n,i.renderer),t:n,config:i,action:Eu(n.action,t,"toggle")})})({e:e,t:t,config:w})&&"stop"===t.globalPropagation&&r.toggleBrushing(!0)}))},U.onBrushOver=e=>{M.over.forEach((t=>{(function(e){let{e:t,t:n,config:i}=e;return Cu({collisions:Nu(t,n,i.renderer),t:n,config:i,action:Eu(n.action,t,"set")})})({e:e,t:t,config:w})&&"stop"===t.globalPropagation&&r.toggleBrushing(!0)}))},U.def=S,U.ctx=_,U.renderer=()=>B,U.set({settings:g}),C(),U}function th(e){const t=Qi(!0,{},e),n={getAll:()=>t,getValue:(e,n)=>function(e,t,n){if(void 0===e||void 0===t)return n;const i=t.split(".");let r=e;for(let e=0;e<i.length;++e){const t=i[e];if(void 0===r[t])return n;r=r[t]}return r}(t,e,n),setValue:(e,n)=>function(e,t,n){if(void 0===e||void 0===t)return;const i=t.split("."),r=i[i.length-1];let o=e;for(let e=0;e<i.length-1;++e){const t=i[e];void 0===o[t]&&(o[t]=Number.isNaN(+i[e+1])?{}:[]),o=o[t]}void 0!==n?o[r]=n:delete o[r]}(t,e,n)};return n}function nh(e,t,n){const i=Tu(function(e,t){const n=$u(e,t)/$u(t,t)||1;return{x:t.x*n,y:t.y*n}}(zu(n,e),zu(t,e)),e);return i}function ih(e,t,n){return Hu(e,n)+Hu(t,n)-Hu(e,t)<1e-12}function rh(e,t){return e.x>=t.x&&e.x+e.width<=t.x+t.width&&e.y>=t.y&&e.y+e.height<=t.y+t.height}function oh(e){return e.x1===e.x2&&e.y1===e.y2}function ah(e){return e.width<=0||e.height<=0}function sh(e){return e.r<=0}function lh(e){return e.edges.length<=2}function ch(e,t){let n=!1;for(let i=0,r=t.edges.length;i<r;i++)if(n=gh(e,hr(t.edges[i])),!0===n)return!0;return!1}function uh(e,t){let n=!1;const{numPolygons:i,polygons:r}=t;for(let t=0;t<i;t++){if(n=_h(e,r[t]),!0===n)return!0}return!1}function hh(e,t){if(sh(e))return!1;return Bu({x:e.cx,y:e.cy},t)<=e.r**2}function dh(e,t){if(ah(t)||sh(e))return!1;const n=t.width/2,i=t.height/2,r=t.x+n,o=t.y+i,a=e.r,s=e.cx,l=e.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 fh(e,t){if(sh(e)||oh(t))return!1;const[n,i]=lr(t);if(hh(e,n)||hh(e,i))return!0;const r={x:e.cx,y:e.cy},o=nh(n,i,r);return Bu(o,r)<=e.r**2&&ih(n,i,o)}function ph(e,t){if(lh(t)||sh(e))return!1;if(mh(t,{x:e.cx,y:e.cy}))return!0;const n=t.edges.length;for(let i=0;i<n;i++){if(fh(e,hr(t.edges[i])))return!0}return!1}function mh(e,t){if(lh(e)||!bh(e.boundingRect(),t))return!1;const{x:n,y:i}=t,r=e.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 gh(e,t){if(lh(e))return!1;for(let n=0,i=e.edges.length;n<i;n++){if(Mh(t,hr(e.edges[n])))return!0}const[n,i]=lr(t);return mh(e,n)||mh(e,i)}function yh(e,t){if(lh(e))return!1;for(let n=0,i=e.edges.length;n<i;n++){if(wh(t,hr(e.edges[n])))return!0}const[n,i,r,o]=cr(t);return mh(e,n)||mh(e,i)||mh(e,r)||mh(e,o)}function xh(e,t){return!ah(e)&&!ah(t)&&(e.x<=t.x+t.width&&t.x<=e.x+e.width&&e.y<=t.y+t.height&&t.y<=e.y+e.height)}function vh(e,t){if(ah(e)||ah(t))return!1;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}].every((t=>bh(e,t)))}function bh(e,t){return!ah(e)&&(t.x>=e.x&&t.x<=e.x+e.width&&t.y>=e.y&&t.y<=e.y+e.height)}function wh(e,t){if(oh(t)||ah(e))return!1;const[n,i]=lr(t);if(bh(e,n)||bh(e,i))return!0;const r=cr(e);let o=r.length;for(let e=0;e<o;e++){if(Mh(hr([r[e],r[3!==e?e+1:0]]),t))return!0}return!1}function Mh(e,t){const[n,i]=lr(e),[r,o]=lr(t),a=ju(i,n),s=Vu(i,n),l=ju(o,r),c=Vu(o,r),u=ju(n,r),h=Vu(n,r);let d=c*a-l*s;const f=l*h-c*u,p=a*h-s*u;let m,g;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;m=Vu(r,n)/s,g=Vu(o,n)/s}else m=(r.x-n.x)/a,g=(o.x-n.x)/a;return!(m<0&&g<0||m>1&&g>1)}return!1}const y=f/d;return d=p/d,y>=0&&y<=1&&d>=0&&d<=1}function kh(e,t){if(oh(e))return!1;const[n,i]=lr(e);return ih(n,i,t)}function Sh(e,t){const n=e.boundingRect(),i=t.boundingRect();return!!xh(n,i)&&(vh(n,i)?ch(e,t):ch(t,e))}function _h(e,t){const n=e.boundingRect(),i=t.boundingRect();return!!xh(n,i)&&(vh(i,n)?function(e,t){let n=!1;const{numPolygons:i,polygons:r}=e;for(let e=0;e<i;e++)if(n=Sh(t,r[e]),!0===n)return!0;return!1}(e,t):function(e,t){let n=!1;for(let i=0,r=t.edges.length;i<r;i++)if(n=Ah(e,hr(t.edges[i])),!0===n)return!0;return!1}(e,t))}function qh(e,t){if(sh(e))return!1;if(Dh(t,{x:e.cx,y:e.cy}))return!0;const{numPolygons:n,polygons:i}=t;for(let t=0;t<n;t++){const n=i[t],r=n.edges.length;for(let t=0;t<r;t++){if(fh(e,hr(n.edges[t])))return!0}}return!1}function Dh(e,t){if(!bh(e.boundingRect(),t))return!1;const{x:n,y:i}=t,r=e.numPolygons;let o,a,s,l,c,u,h=!1;for(a=0;a<r;a++)for(o=e.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 Ah(e,t){const[n,i]=lr(t);if(Dh(e,n)||Dh(e,i))return!0;const{numPolygons:r,polygons:o}=e;for(let e=0;e<r;e++){const n=o[e];for(let e=0,i=n.edges.length;e<i;e++){if(Mh(t,hr(n.edges[e])))return!0}}return!1}function Ch(e,t){const[n,i,r,o]=cr(t);if(Dh(e,n)||Dh(e,i)||Dh(e,r)||Dh(e,o))return!0;const{numPolygons:a,polygons:s}=e;for(let e=0;e<a;e++){const n=s[e];for(let e=0,i=n.edges.length;e<i;e++){if(wh(t,hr(n.edges[e])))return!0}}return!1}const Nh=/^\$/,Eh="@extend";function Rh(e){throw new Error('Cyclical reference for "'.concat(e,'"'))}function Ih(e,t,n){if("string"==typeof e){let i=t[e];return-1!==n.indexOf(e)&&Rh(e),Nh.test(i)?(n.push(e),Ih(i,t,n)):i}let i=e;const r=Qi(!0,{},t,e),o={};if(e[Eh]){const o=e[Eh];-1!==n.indexOf(o)&&Rh(o);let a=n.slice();a.push(o),i=Qi(!0,{},Ih(r[o],t,a),e)}return Object.keys(i).forEach((e=>{let t=n.slice();if(e===Eh||Nh.test(e))return;o[e]=i[e];let a=o[e];Nh.test(a)&&a in r?(-1!==n.indexOf(a)&&Rh(a),t.push(a),a=r[a],"object"==typeof a||Nh.test(a)&&a in r?o[e]=Ih(a,r,t):o[e]=a):"object"==typeof a&&(o[e]=Ih(a,r,t))})),o}function Oh(e,t){return Ih(e,t,[])}function Ph(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t={},n=e;const i=e=>{e.forEach((e=>{const n=Array.isArray(e.colors[0])?e.colors:[e.colors];t[e.key]={colors:n,sizes:n.map((e=>e?e.length:0))}}))},r={palette:(e,n)=>((e,n)=>{const i=t[e];if(!i)return[];const r=i.sizes;for(let e=0;e<r.length;e++)if(n<=r[e])return i.colors[e];return i.colors[r.length-1]})(e,n),setPalettes:i,style:e=>Oh(e,n),setStyle:t=>{n=Qi({},e,t)}};return i(arguments.length>1&&void 0!==arguments[1]?arguments[1]:[]),r}function Lh(e){e.x=Math.floor(e.x),e.y=Math.floor(e.y),e.width=Math.floor(e.width),e.height=Math.floor(e.height)}function Th(e){const t={center:{minWidthRatio:.5,minHeightRatio:.5,minWidth:0,minHeight:0}};return Qi(!0,t,e),t.center.minWidthRatio=Math.min(Math.max(t.center.minWidthRatio,0),1),t.center.minHeightRatio=Math.min(Math.max(t.center.minHeightRatio,0),1),t.center.minWidth=Math.max(t.center.minWidth,0),t.center.minHeight=Math.max(t.center.minHeight,0),t}function zh(e,t,n,i,r){return{x:isNaN(e)?0:e,y:isNaN(e)?0:t,width:isNaN(e)?0:n,height:isNaN(e)?0:i,margin:isNaN(r)?0:r}}function Fh(e,t,n){if(void 0===e.cachedSize){const i=e.config.dock();let r,o=e.comp.preferredSize({inner:t,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),e.cachedSize=Math.ceil(r),e.edgeBleed=o.edgeBleed||0}return e.cachedSize}function jh(e,t){switch(t.config.dock()){case"top":e.y+=t.cachedSize,e.height-=t.cachedSize;break;case"bottom":e.height-=t.cachedSize;break;case"left":e.x+=t.cachedSize,e.width-=t.cachedSize;break;case"right":e.width-=t.cachedSize}}function Vh(e,t){const n=t.edgeBleed;n&&(e.left=Math.max(e.left,n.left||0),e.right=Math.max(e.right,n.right||0),e.top=Math.max(e.top,n.top||0),e.bottom=Math.max(e.bottom,n.bottom||0))}function Bh(e,t,n){t.x<n.left&&(t.width-=n.left-t.x,t.x=n.left);const i=e.width-(t.x+t.width);i<n.right&&(t.width-=n.right-i),t.y<n.top&&(t.height-=n.top-t.y,t.y=n.top);const r=e.height-(t.y+t.height);r<n.bottom&&(t.height-=n.bottom-r)}function Hh(e,t,n,i,r){const o=Qi({},t),a=Qi({},n);jh(o,i),Vh(a,i),Bh(e,o,a);const s=function(e,t,n){const i=Math.min(n.center.minWidth,e.width)||Math.max(e.width*n.center.minWidthRatio,1),r=Math.min(n.center.minHeight,e.height)||Math.max(e.height*n.center.minHeightRatio,1);return t.width>=i&&t.height>=r}(e,o,r);return!!s&&(jh(t,i),Vh(n,i),!0)}function $h(e){return{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}}function Wh(e){return ur([].concat(...e.map(cr)))}function Uh(e){let{visible:t,layoutRect:n,reducedRect:i,containerRect:r,translation:o}=e;const a=zh(i.x,i.y,i.width,i.height),s=zh(i.x,i.y,i.width,i.height),l={},c=t.slice(),u=c.slice().sort(((e,t)=>e.config.displayOrder()-t.config.displayOrder()));return t.sort(((e,t)=>{if(e.referencedDocks.length>0&&t.referencedDocks.length>0)return 0;if(t.referencedDocks.length>0)return-1;if(e.referencedDocks.length>0)return 1;const n=e.config.displayOrder()-t.config.displayOrder();return 0===n?c.indexOf(e)-c.indexOf(t):n})).forEach((e=>{let t={},c={};switch(e.config.dock()){case"top":t.height=c.height=e.cachedSize,t.width=n.width,c.width=a.width,t.x=n.x,c.x=a.x,t.y=c.y=a.y-e.cachedSize,a.y-=e.cachedSize,a.height+=e.cachedSize;break;case"bottom":t.x=n.x,c.x=a.x,t.y=c.y=a.y+a.height,t.width=n.width,c.width=a.width,t.height=c.height=e.cachedSize,a.height+=e.cachedSize;break;case"left":t.x=c.x=s.x-e.cachedSize,t.y=n.y,c.y=s.y,t.width=c.width=e.cachedSize,t.height=n.height,c.height=s.height,s.x-=e.cachedSize,s.width+=e.cachedSize;break;case"right":t.x=c.x=s.x+s.width,t.y=n.y,c.y=s.y,t.width=c.width=e.cachedSize,t.height=n.height,c.height=s.height,s.width+=e.cachedSize;break;case"center":t.x=c.x=i.x,t.y=c.y=i.y,t.width=c.width=i.width,t.height=c.height=i.height;break;default:if(e.referencedDocks.length>0){const n=e.referencedDocks.map((e=>l[e])).filter((e=>!!e));n.length>0&&(t=Wh(n.map((e=>e.outerRect))),c=Wh(n.map((e=>e.r))))}}e.key&&(l[e.key]={r:c,outerRect:t}),function(e,t,n,i){const r={x:i.width/n.width,y:i.height/n.height},o={left:0,top:0};if(n.preserveAspectRatio){const e=r.x<r.y,t=Math.min(r.x,r.y);r.x=t,r.y=t;const a=e?"height":"width",s=(i[a]-n[a]*r.x)*n.align;o.left=e?0:s,o.top=e?s:0}e.scaleRatio=r,e.margin=o,t.scaleRatio=r,t.margin=o,n.scaleRatio=r,n.margin=o}(c,t,n,r),c.edgeBleed=e.edgeBleed,c.computed=$h(c),t.edgeBleed=e.edgeBleed,t.computed=$h(t),c.x+=o.x,c.y+=o.y,t.x+=o.x,t.y+=o.y,e.comp.resize(c,t),e.cachedSize=void 0,e.edgeBleed=void 0})),u}function Yh(e,t,n){const i=e.layoutModes||{},r=t.minimumLayoutMode();let o=t.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 Gh(e){if(!e.resize||"function"!=typeof e.resize)throw new Error("Component is missing resize function");if(!e.dockConfig&&!e.preferredSize)throw new Error("Component is missing preferredSize function")}function Xh(e){let t=Th(e);const n={};return n.layout=function(e){let n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];if(!e||isNaN(e.x)||isNaN(e.y)||isNaN(e.width)||isNaN(e.height))throw new Error("Invalid rect");if(!n.length)return{visible:[],hidden:[],ordered:[]};const{logicalContainerRect:i,containerRect:r}=function(e,t){const n={x:0,y:0,width:0,height:0},i={x:0,y:0,width:0,height:0};return n.width=e.width||0,n.height=e.height||0,void 0!==t.size&&(n.width=isNaN(t.size.width)?n.width:t.size.width,n.height=isNaN(t.size.height)?n.height:t.size.height),void 0!==t.logicalSize?(i.width=isNaN(t.logicalSize.width)?n.width:t.logicalSize.width,i.height=isNaN(t.logicalSize.height)?n.height:t.logicalSize.height,i.align=isNaN(t.logicalSize.align)?.5:Math.min(Math.max(t.logicalSize.align,0),1),i.preserveAspectRatio=t.logicalSize.preserveAspectRatio):(i.width=n.width,i.height=n.height,i.preserveAspectRatio=!1),Lh(i),Lh(n),{logicalContainerRect:i,containerRect:n}}(e,t),[o,a]=function(e,t,n){const i=[],r=[];for(let o=0;o<e.length;++o){const a=e[o];Gh(a);let s=a.dockConfig;const l=a.key,c=s.dock(),u=/@/.test(c)?c.split(",").map((e=>e.replace(/^\s*@/,""))):[];Yh(t,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,t,i),s=function(e){let{layoutRect:t,visible:n,hidden:i,settings:r}=e;const o=zh(t.x,t.y,t.width,t.height),a={left:0,right:0,top:0,bottom:0},s=n.slice();s.sort(((e,t)=>e.config.prioOrder()-t.config.prioOrder()));for(let e=0;e<s.length;++e){const n=s[e];Fh(n,o,t),Hh(t,o,a,n,r)||(i.push(s.splice(e,1)[0]),--e)}!function(e,t){if(0!==t.length)for(let n=0;n<e.length;++n){let i=e[n];if(i.referencedDocks.length){const r=i.referencedDocks.every((e=>t.some((t=>t.key===e))));r&&t.push(e.splice(n,1)[0])}}}(n,i);const l=n.filter((e=>-1!==s.indexOf(e)));return n.length=0,n.push(...l),Bh(t,o,a),o}({layoutRect:i,visible:o,hidden:a,settings:t}),l=Uh({visible:o,layoutRect:i,reducedRect:s,containerRect:r,translation:{x:e.x,y:e.y}});return a.forEach((e=>{e.comp.visible=!1;const t=zh();e.comp.resize(t,t)})),{visible:o.map((e=>e.comp)),hidden:a.map((e=>e.comp)),ordered:l.map((e=>e.comp))}},n.settings=function(e){t=Th(e)},n}const Kh=(e,t)=>{for(let n=0;n<e.length;n++){const i=e[n];if(i.hasKey&&i.key===t)return e[n]}return null},Zh=e=>null==e?void 0:e.map((e=>{const t=e.instance.dockConfig();return{preferredSize:n=>t.computePreferredSize(ir(ir({},n),{},{children:Zh(e.children)}))}})),Jh=(e,t)=>({visible:[],hidden:t,ordered:[]}),Qh=e=>(t,n)=>{var i;const r=n.map(((e,t)=>{const n=e.instance.dockConfig();return{index:t,key:e.key,dockConfig:n,resize:e.instance.resize,preferredSize:t=>n.computePreferredSize(ir(ir({},t),{},{children:Zh(e.children)}))}})),o=e=>n[e.index],{visible:a=r,hidden:s=[],ordered:l=a}=null!==(i=e(t,r))&&void 0!==i?i:{};return{visible:a.map(o),hidden:s.map(o),ordered:l.map(o)}},ed=e=>"function"==typeof e?Qh(e):(e=>{const t=Xh(e);return Qh(((e,n)=>t.layout(e,n)))})(e);function td(e,t,n){const i=t.left-n.left,r=t.top-n.top,o=dr(e),a=Qi(!0,{},e);switch(o){case"circle":a.cx+=i,a.cy+=r;break;case"polygon":for(let e=0,t=a.vertices.length;e<t;e++){const t=a.vertices[e];t.x+=i,t.y+=r}break;case"geopolygon":for(let e=0;e<a.vertices.length;e++){const t=a.vertices[e];for(let e=0,n=t.length;e<n;e++){const n=t[e];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 nd(e,t){const n=[];let i=0;t.forEach((e=>{n.push(i),i++;const t=e.instance.def.additionalElements&&e.instance.def.additionalElements();t&&(i+=t.length)})),t.forEach(((t,i)=>((e,t,n)=>{const i=t.instance.renderer().element();if(isNaN(n)||!i||!e||!e.children)return;const r=e.children[Math.max(0,n)];if(i===r)return;const o=t.instance.def.additionalElements&&t.instance.def.additionalElements().filter(Boolean);e.insertBefore&&void 0!==r?(e.insertBefore(i,r),o&&o.forEach((t=>{e.insertBefore(t,i)}))):(o&&o.forEach((t=>{e.appendChild(t,i)})),e.appendChild(i))})(e,t,n[i])))}function id(e,t){let{element:n,data:i=[],settings:r={},on:o={}}=e;const a=t.registries,s=t.logger,l=Ph(t.style,t.palettes),c=[],u=Qi({},e),h=function(){const e={};return Yc.mixin(e),e}();let d=[],f=null,p=null,m=null,g=[],y=()=>{},x=()=>{};const v={};let b=!1;const w=function(e){let{createComponent:t}=e;const n={};let i=[],r=[];const o=e=>{const n=t(e);return n&&(i.push(n),e.components&&(n.children=e.components.map((e=>o(e))).filter((e=>!!e)))),n},a=e=>{const t=i.indexOf(e);-1!==t&&i.splice(t,1)},s=(e,t)=>{for(let n=e.length-1;n>=0;n--){const i=e[n],r=t.find((e=>i.hasKey&&i.key===e.key));r?i.children&&r.components&&s(i.children,r.components):(e.splice(n,1),a(i),i.children&&s(i.children,[]),i.instance.destroy())}},l=e=>{let{compList:t,data:n,excludeFromUpdate:i,formatters:r,scales:a,settingsList:s}=e;return s.map((e=>{const s=Kh(t,e.key);return i.indexOf(e.key)>-1?(delete s.updateWith,s):s?(e.rendererSettings&&"function"==typeof s.instance.renderer().settings&&s.instance.renderer().settings(e.rendererSettings),e.rendererSettings&&"function"==typeof e.rendererSettings.transform&&e.rendererSettings.transform()?(s.applyTransform=!0,s):(s.updateWith={formatters:r,scales:a,data:n,settings:e},e.components&&(s.children=l({compList:s.children||[],data:n,excludeFromUpdate:i,formatters:r,scales:a,settingsList:e.components})),s)):o(e)})).filter((e=>!!e))},c=e=>{let{components:t,hidden:n,layoutFn:i,ordered:r,rect:o,visible:a}=e;const{visible:s,hidden:l,ordered:u}=i(o,t);a.push(...s),n.push(...l),r.push(...u),s.forEach((e=>{if(e.children){var t,i;const o=ed(null!==(t=null===(i=e.settings)||void 0===i?void 0:i.strategy)&&void 0!==t?t:{});c({components:e.children,hidden:n,layoutFn:o,ordered:r,rect:e.instance.getRect(),visible:a})}})),l.forEach((e=>{e.children&&c({components:e.children,hidden:n,layoutFn:Jh,ordered:r,rect:null,visible:a})}))};return n.destroy=()=>{i.forEach((e=>e.instance.destroy())),i=[],r=[]},n.findComponentByKey=e=>Kh(i,e),n.forEach=e=>{i.forEach(e)},n.layout=e=>{let{layoutSettings:t,rect:n}=e;const i=[],o=[],a=[],s=ed(t);return c({components:r,hidden:o,layoutFn:s,ordered:a,rect:n,visible:i}),{visible:i,hidden:o,ordered:a}},n.set=e=>{let{components:t}=e;r=t.map((e=>o(e))).filter((e=>!!e))},n.update=e=>{let{components:t,data:n,excludeFromUpdate:i,formatters:o,scales:a}=e;s(r,t),r=l({compList:r,data:n,excludeFromUpdate:i,formatters:o,scales:a,settingsList:t})},n}({createComponent:e=>{if(!a.component.has(e.type))return s.warn("Unknown component: ".concat(e.type)),!1;return{instance:eh(a.component(e.type),{settings:e,chart:u,mediator:h,registries:a,theme:l,container:n}),settings:Qi(!0,{},e),key:e.key,hasKey:void 0!==e.key}}});function M(t){let n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:()=>{};return function(){const i="function"==typeof e[t];let r;for(var o=arguments.length,a=new Array(o),s=0;s<o;s++)a[s]=arguments[s];return r=i?e[t].call(u,...a):n.call(u,...a),r}}const k=()=>{let e;r.dockLayout?(s.warn('Deprecation Warning: "dockLayout" property should be renamed to "strategy"'),e=r.dockLayout):e=r.strategy;const t=function(e){if("function"==typeof e.getBoundingClientRect){const{width:t,height:n}=e.getBoundingClientRect();return{x:0,y:0,width:t,height:n}}return{x:0,y:0,width:0,height:0}}(n);return w.layout({layoutSettings:e,rect:t})},S=M("created"),_=M("beforeMount"),q=M("mounted"),D=M("beforeUpdate"),A=M("updated"),C=M("beforeRender"),N=M("beforeDestroy"),E=M("destroyed"),R=function(e,t){let{partialData:n}=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const{formatters:i={},scales:r={},scroll:o={}}=t;y=function(e,t){let{types:n,logger:i}=t;const r={},o=[];return Array.isArray(e)?o.push(...e):(i.warn('Deprecated: "data-source" configuration"'),o.push(e)),o.forEach(((e,t)=>{let o=n(e.type);if(o){let n=e.key;void 0===e.key&&(i.warn("Missing key for dataset. Using index '".concat(t,"' as key.")),n=t);let a=o({key:n,data:e.data,config:e.config});r[n]=a}})),e=>e?r[e]:r[Object.keys(r)[0]]}(e,{logger:s,types:a.data}),n||Object.keys(v).forEach((e=>v[e].clear())),t.palettes&&l.setPalettes(t.palettes),t.style&&l.setStyle(t.style),x=function(e,t,n){let i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:il;const r={};return(e||[]).forEach((e=>{if(!e.key)throw new Error('Data collection is missing "key" property');if("object"==typeof e.data&&"collection"in e.data)throw new Error("Data config for collections may not reference other collections");r[e.key]=()=>i(e.data,t,n)})),e=>{let t,n;if("string"==typeof e?t=e:"object"==typeof e&&(t=e.key,n=e),!(t in r))throw new Error("Unknown data collection: ".concat(t));"function"==typeof r[t]&&(r[t]=r[t]());let i=r[t];if(n&&n.fields&&n.fields.filter){let e=i.fields.filter(n.fields.filter);i.fields.length!==e.length&&(i=Qi(i,{fields:e}))}return i}}(t.collections,{dataset:y},{logger:s});const c={theme:l,logger:s};f=function(e,t,n){let i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:Hc;const r={};return{get(o){let a;return"string"==typeof o&&e[o]?a=o:"object"==typeof o&&"scale"in o&&e[o.scale]&&(a=o.scale),a?(r[a]=r[a]||i(e[a],t,n),r[a]):i(o,t,n)},all(){return Object.keys(e).forEach(this.get),r}}}(r,{dataset:y,collection:x},ir(ir({},c),{},{scale:a.scale})),p=function(e,t,n){let i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:rl;const r={};return{get(o){let a;return"string"==typeof o&&e[o]?a=o:"object"==typeof o&&"formatter"in o&&e[o.formatter]?a=o.formatter:"object"==typeof o&&"type"in o&&e[o.type]&&(a=o.type),a?(r[a]=r[a]||i(e[a],t,n),r[a]):i(o||{},t,n)},all(){return Object.keys(e).forEach(this.get),r}}}(i,{dataset:y,collection:x},ir(ir({},c),{},{formatter:a.formatter})),m=function(e,t){const n={};for(const i in e)Object.prototype.hasOwnProperty.call(e,i)&&(n[i]=Xc(e[i],t?t[i]:null));return n}(o,m)};function I(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];const t={},i=e.filter((e=>!!e.key)).map((e=>e.key));g.forEach((e=>{e.key&&-1!==i.indexOf(e.key)?t[e.key]=e:e.destroy()})),g=e.map((e=>{const i=e.key&&t[e.key]?t[e.key]:a.interaction(e.type)(u,h,n);return i.set(e),i}))}const O=e=>{const t=n.getBoundingClientRect(),i="clientX"in e?e.clientX:e.x,r="clientY"in e?e.clientY:e.y,o={x:i-t.left,y:r-t.top},a=[];return d.forEach((e=>{const t=e.instance.getRect();bh(t.computedPhysical?t.computedPhysical:{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},o)&&a.push(e)})),a},P=()=>{if(c.length||!n)return;Object.keys(o).forEach((e=>{const t=o[e].bind(u);n.addEventListener(e,t),c.push({key:e,listener:t})}));const e={},t=t=>{t.touches?(e.x=t.touches[0].clientX,e.y=t.touches[0].clientY,e.multiTouch=t.touches.length>1):(e.x=t.clientX,e.y=t.clientY,e.multiTouch=!1),e.time=Date.now(),e.comps=O(e)},i=t=>{const n=e.comps||O(t);if(!n.every((e=>e.instance.def.disableTriggers))&&("touchend"===t.type&&t.preventDefault(),function(e,t){const n=rr(e),i=n?e.changedTouches[0]:e,r=Date.now()-t.time,o=isNaN(t.x)?0:Math.abs(i.clientX-t.x),a=isNaN(t.y)?0:Math.abs(i.clientY-t.y);return(0===e.button||n)&&!t.multiTouch&&o<=12&&a<=12&&r<=300}(t,e)))for(let e=n.length-1;e>=0;e--){if(n[e].instance.onBrushTap(t),b){b=!1;break}}},r=[];r.push({key:"mousedown",listener:t}),r.push({key:"mouseup",listener:i}),function(e){return"ontouchstart"in e&&"ontouchend"in e||navigator.maxTouchPoints>1}(n)&&(r.push({key:"touchstart",listener:t}),r.push({key:"touchend",listener:i})),r.push({key:"mousemove",listener:e=>{const t=O(e);for(let n=t.length-1;n>=0;n--){if(t[n].instance.onBrushOver(e),b){b=!1;break}}}}),r.forEach((e=>{n.addEventListener(e.key,e.listener),c.push(e)}))},L=()=>{c.forEach((e=>{let{key:t,listener:i}=e;return n.removeEventListener(t,i)})),c.length=0},T=()=>{n.innerHTML="",(()=>{const{components:e=[]}=r;C(),R(i,r),w.set({components:e});const{visible:t,hidden:o,ordered:a}=k();d=t,o.forEach((e=>{e.instance.hide(),e.visible=!1})),t.forEach((e=>e.instance.beforeMount())),t.forEach((e=>e.instance.mount())),t.forEach((e=>e.instance.beforeRender())),t.forEach((e=>e.instance.render())),t.forEach((e=>e.instance.mounted())),t.forEach((e=>{e.visible=!0})),nd(n,a)})(),P(),I(r.interactions)};return u.layoutComponents=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const{excludeFromUpdate:t=[]}=e;e.data&&(i=e.data),e.settings&&(r=e.settings,I(e.settings.interactions)),D(),R(i,r);const{formatters:n,scales:o,components:a=[]}=r;w.update({components:a,data:i,excludeFromUpdate:t,formatters:n,scales:o}),w.forEach((e=>{e.updateWith&&e.instance.set(e.updateWith)})),w.forEach((e=>{e.updateWith&&e.instance.beforeUpdate()})),k()},u.update=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const{partialData:t,excludeFromUpdate:o=[]}=e;let a;e.data&&(i=e.data),e.settings&&(r=e.settings,I(e.settings.interactions)),D(),R(i,r,{partialData:t});const{formatters:s,scales:l,components:c=[]}=r;w.update({components:c,data:i,excludeFromUpdate:o,formatters:s,scales:l}),w.forEach((e=>{e.updateWith&&e.instance.set(e.updateWith)})),w.forEach((e=>{e.updateWith&&e.instance.beforeUpdate()}));const u=[],h=[];let f;if(t)w.forEach((e=>{(e.updateWith||e.applyTransform)&&e.visible&&u.push(e)})),f=u;else{const{visible:e,hidden:t,ordered:n}=k();d=e,f=e,a=n,e.forEach((e=>{e.updateWith&&e.visible?u.push(e):h.push(e)})),t.forEach((e=>{e.instance.hide(),e.visible=!1,delete e.updateWith,e.applyTransform=!1}))}h.forEach((e=>e.instance.beforeMount())),h.forEach((e=>e.instance.mount())),f.forEach((e=>e.instance.beforeRender())),f.forEach((e=>{(e.updateWith||e.applyTransform)&&e.visible?e.instance.update():e.instance.render()})),t||nd(n,a),h.forEach((e=>e.instance.mounted())),u.forEach((e=>e.instance.updated())),d.forEach((e=>{delete e.updateWith,e.visible=!0,e.applyTransform=!1})),A()},u.destroy=()=>{N(),w.destroy(),L(),I(),delete u.update,delete u.destroy,E()},u.getAffectedShapes=function(e){let t=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((e=>null==i||e.key===i)).forEach((i=>{const o=i.instance.getBrushedShapes(e,t,n);r=[...r,...o]})),r},u.findShapes=e=>{let t=[];return d.forEach((n=>{const i=n.instance.findShapes(e);t=[...t,...i]})),t},u.componentsFromPoint=e=>O(e).map((e=>e.instance.ctx)),u.shapesAt=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=[];const r=n.getBoundingClientRect();let o=d;if(Array.isArray(t.components)&&t.components.length>0){const e=t.components.map((e=>e.key));o=d.filter((t=>-1!==e.indexOf(t.key))).map((n=>({instance:n.instance,opts:t.components[e.indexOf(n.key)]})))}for(let n=o.length-1;n>=0;n--){const a=o[n],s=td(e,r,a.instance.renderer().element().getBoundingClientRect()),l=a.instance.shapesAt(s,a.opts),c=l.length>0&&"stop"===t.propagation;if(i=[...i,...l],i.length>0&&c)return i}return i},u.brushFromShapes=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{components:[]};for(let n=0;n<t.components.length;n++){const i=t.components[n].key;d.filter((e=>i===e.key)).forEach((i=>{let r=e.filter((e=>e.key===i.key));i.instance.brushFromShapes(r,t.components[n])}))}},u.scroll=function(){return function(e,t){return t[e]||(t[e]=Gc()),t[e]}(arguments.length>0&&void 0!==arguments[0]?arguments[0]:"default",m)},u.dataset=e=>y(e),u.dataCollection=e=>x(e),u.scales=function(){return f.all()},u.formatters=function(){return p.all()},u.brush=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"default";return v[e]||(v[e]=hu()),v[e]},u.scale=function(e){return f.get(e)},u.formatter=function(e){return p.get(e)},u.toggleBrushing=function(e){b=void 0!==e?e:!b},u.component=e=>{const t=w.findComponentByKey(e);return null==t?void 0:t.instance.ctx},u.logger=()=>s,u.theme=()=>l,u.storage=th({animations:{updatingStageMeta:{isInit:!1,shouldBeRemoved:!1}}}),Object.defineProperty(u,"interactions",{get:()=>({instances:g,on(){P(),g.forEach((e=>e.on()))},off(){L(),g.forEach((e=>e.off()))}})}),S(),n&&(_(),T(),q(n),u.element=n),u}const rd=e=>{let t=yo(e);return t.prio=e=>e?t.default(e[0]):[t.default()],t.types=()=>t.getKeys(),t};var od=yo();function ad(e,t,n){let{key:i}=n;const r={value:"function"==typeof e.value?e.value(t):void 0!==e.value?e.value:t};return r.label="function"==typeof e.label?e.label(t):void 0!==e.label?String(e.label):String(r.value),e.field&&(r.source={key:i,field:e.field.key()}),r}const sd=e=>e.filter((e=>"number"==typeof e&&!isNaN(e)));const ld=e=>{let{key:t,data:n,cache:i,config:r}=e;if(!n)return;let o=n;"string"==typeof o&&(o=(e=>{let{data:t,config:n}=e;const i=t.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 e=[/,/,/\t/,/;/];for(let t=0;t<e.length;t++){const n=e[t];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((e=>e.split(a)))})({data:n,config:r})),Array.isArray(o)&&function(e){let t,{source:n,data:i,cache:r,config:o}=e,a=i;const s=o&&o.parse;Array.isArray(i[0])?s&&!1===s.headers?t=i[0].map(((e,t)=>t)):(t=i[0],a=i.slice(1)):t=Object.keys(i[0]);const l=!!s&&"function"==typeof s.row&&s.row;let c,u=t;u=s&&"function"==typeof s.fields?s.fields(u.slice()):t.map((e=>({key:e,title:e}))),Array.isArray(i[0])?c=u.map((()=>[])):(c={},u.forEach((e=>{c[e.key]=[]})));for(let e=0;e<a.length;e++){const t=l?l(a[e],e,u):a[e];if(t)if(Array.isArray(t))for(let e=0;e<u.length;e++)c[e].push(t[e]);else for(let e=0;e<u.length;e++)c[u[e].key].push(t[u[e].key])}const h=Array.isArray(c)?e=>c[e]:e=>c[u[e].key];for(let e=0;e<u.length;e++){const t=h(e),i=sd(t),o=i.length>0,a=o?"measure":"dimension",s=o?Math.min(...i):NaN,l=o?Math.max(...i):NaN;r.fields.push(Hs(Qi({source:n,key:e,title:u[e].title,values:t,min:s,max:l,type:a},u[e]),{value:u[e].value,label:u[e].label}))}}({data:o,cache:i,source:t,config:r})};function cd(){let{key:e,data:t,config:n}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const i={fields:[]},r={key:()=>e,raw:()=>t,field:e=>function(e,t){let{cache:n}=t;if("number"==typeof e)return n.fields[e];for(let t=0;t<n.fields.length;t++)if(n.fields[t].key()===e)return n.fields[t];for(let t=0;t<n.fields.length;t++)if(n.fields[t].title()===e)return n.fields[t];return null}(e,{cache:i,matrix:t}),fields:()=>i.fields.slice(),extract:e=>function(e,t){const n=Array.isArray(e)?e:[e];let i=[];return n.forEach((e=>{if(void 0!==e.field){const n=t.field(e.field),r=t.key();if(!n)throw Error("Field '".concat(e.field,"' not found"));const{props:o,main:a}=Gs(e,t),s=Object.keys(o),l=!!e.trackBy,c=typeof e.trackBy,u={},h=[],d=n.items(),f=[];for(let t=0;t<d.length;t++){const n=d[t];if(a.filter&&!a.filter(n))continue;const i=ad(a,n,{key:r});s.forEach((e=>{const a=o[e];let s=a.field?a.field.items()[t]:n;i[e]=ad(a,s,{key:r})})),l&&Zs({cfg:e,itemData:n,obj:i,target:h,tracker:u,trackType:c}),f.push(i)}i=l?[...i,...Ks(h,{main:a,propsArr:s,props:o})]:[...i,...f]}})),i}(e,r),hierarchy:()=>null};return ld({key:e,data:t,config:n,cache:i}),r}cd.util={normalizeConfig:Gs,collect:Ks,track:Zs};const ud=yo();ud.default("matrix"),ud("matrix",cd),ud("default",cd);const hd=yo();function dd(e,t,n){return Math.max(e,Math.min(t,n))}function fd(e){let{item:t,value:n,boxCenter:i,rendWidth:r,rendHeight:o,flipXY:a,symbol:s}=e,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(Qi({},t.oob,{[l]:i*u,[c]:Math.max(t.oob.size/2,Math.min(n*h,h-t.oob.size/2)),startAngle:d}))}function pd(e){let{item:t,boxWidth:n,boxPadding:i,rendWidth:r,rendHeight:o,flipXY:a}=e,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(e){let{start:t,end:n,minPx:i=.1,maxPx:r=1}=e;const o=Math.max(t,n),a=Math.min(t,n),s=dd(-.1,1.2,o),l=dd(-.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:t.start,end:t.end,minPx:t.box.minHeightPx,maxPx:d});return Qi({},t.box,{type:"rect",[s]:(i+t.major)*h,[l]:p,[u]:f,[c]:n*h,data:t.data||{},collider:{type:null}})}function md(e){let{item:t,from:n,to:i,boxCenter:r,rendWidth:o,rendHeight:a,flipXY:s}=e,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),Qi({},t.line,{type:"line",[h]:Math.floor(n*f),[l]:r*d,[c]:Math.floor(i*f),[u]:r*d,data:t.data||{},collider:{type:null}})}function gd(e){let{item:t,key:n,position:i,width:r,boxCenter:o,rendWidth:a,rendHeight:s,flipXY:l}=e,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 m=r/2;return Qi({type:"line"},t[n],{[u]:Math.floor(i*p),[c]:(o-m)*f,[d]:Math.floor(i*p),[h]:(o+m)*f,r:m*f,cx:o*f,cy:i*p,width:r*f,data:t.data||{},collider:{type:null}})}function yd(e,t,n){const{width:i,maxWidthPx:r,minWidthPx:o}=t.box,a=e>=0?1:-1;let s=Math.min(a*e*i,isNaN(r)?n:r/n);return s=isNaN(o)?s:Math.max(o/n,s),s*a}hd("native",(function(e,t,n){let i,r,o={chart:e,mediator:t,element:n},a=[],s=!0;function l(){"function"==typeof i.enable&&(i.enable=i.enable.bind(o)()),i.enable&&Object.keys(i.events).forEach((e=>{const t=i.events[e].bind(o);n.addEventListener(e,t),a.push({key:e,listener:t})}))}function c(){a.forEach((e=>{let{key:t,listener:i}=e;n.removeEventListener(t,i)})),a=[]}return{get key(){return r},set(e){!function(e){r=e.key,i=e,i.events=i.events||[],void 0===i.enable&&(i.enable=!0)}(e),c(),s&&l()},off(){s=!1,c()},on(){s=!0,0===a.length&&l()},destroy(){c(),o=null,i=null}}}));const xd={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}},vd=Object.keys(xd),bd={require:["chart","resolver","symbol"],defaultSettings:{settings:{},data:{},style:{box:"$shape",line:"$shape-guide",whisker:"$shape-guide",median:"$shape-guide--inverted"}},created(){this.state={}},render(e){let{data:t}=e;const{width:n,height:i}=this.rect,r="horizontal"===this.settings.settings.orientation,{style:o,resolver:a,symbol:s}=this,l=vd.filter((e=>!this.settings.settings[e]||!1!==this.settings.settings[e].show)),c={};l.forEach((e=>c[e]=xd[e]));const u=function(e){let{keys:t,data:n,defaultSettings:i,style:r,settings:o,width:a,height:s,resolver:l}=e;const c=Qi(!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:Qi(!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:Qi(!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((e=>{(f[e]||n.items&&n.items.length&&n.items[0][e])&&(p[e]={scale:f.scale,ref:e})}));let m,g={major:d,minor:l.resolve({data:n,defaults:{start:0,end:1},scaled:u,settings:Qi(!0,{},p,f)})};for(let e=0,i=t.length;e<i;e++)o[m]&&!1===o[m].show||(m=t[e],g[m]=l.resolve({data:n,defaults:c[m],settings:o[m],scaled:u}));return g}({keys:l,data:t,defaultSettings:c,style:o,settings:this.settings.settings,width:n,height:i,resolver:a}),{settings:h,items:d}=u,f=function(e){let{width:t,height:n,flipXY:i,resolved:r,keys:o,symbol:a}=e;const s=[],l=r.major.items;if(!l.length)return s;const c=t,u=n,h=i?n:t,d=r.major.settings,f=["start","end","min","max","med"].filter((e=>void 0!==r.minor.settings[e])),p=f.length,m=o.filter((e=>"oob"!==e));let g,y,x,v,b,w,M,k,S;const _=o?o.length:0,q=m?m.length:0,D={box:function(){x.box&&or(x.start)&&or(x.end)&&g.push(pd({item:x,boxWidth:v,boxPadding:b,rendWidth:c,rendHeight:u,flipXY:i}))},line:function(){or(x.min)&&or(x.start)&&g.push(md({item:x,from:x.min,to:x.start,boxCenter:w,rendWidth:c,rendHeight:u,flipXY:i})),or(x.max)&&or(x.end)&&g.push(md({item:x,from:x.max,to:x.end,boxCenter:w,rendWidth:c,rendHeight:u,flipXY:i}))},median:function(){x.median&&or(x.med)&&g.push(gd({item:x,key:"median",position:x.med,width:v,boxCenter:w,rendWidth:c,rendHeight:u,flipXY:i}))},whisker:function(){if(x.whisker){const e=v*x.whisker.width;or(x.min)&&g.push(gd({item:x,key:"whisker",position:x.min,width:e,boxCenter:w,rendWidth:c,rendHeight:u,flipXY:i})),or(x.max)&&g.push(gd({item:x,key:"whisker",position:x.max,width:e,boxCenter:w,rendWidth:c,rendHeight:u,flipXY:i}))}}};function A(){let e,t=-Number.MAX_VALUE,n=Number.MAX_VALUE;for(let i=0;i<p;i++)e=x[f[i]],or(e)&&(t<e&&(t=e),n>e&&(n=e));M=t<0&&t!==-Number.MAX_VALUE,k=n>1&&n!==Number.MAX_VALUE,S=M||k}for(let e=0,t=l.length;e<t;e++){g=[],y=null;const t=l[e],n=t.data;let f=null,p=null;void 0!==d.binStart?(f=t.binStart,p=t.binEnd,y=d.binStart.scale):(y=d.major.scale,f=y?t.major:0);let C=0;y?y.bandwidth?(C=y.bandwidth(),f-=C/2):C=p-f:C=1,x=Qi({},{major:f,majorEnd:p},r.minor.items[e]);for(let t=0;t<_;t++)x[o[t]]=r[o[t]].items[e];if(v=yd(C,x,h),b=(C-v)/2,w=b+x.major+v/2,A(),S)x.oob&&(M?g.push(fd({item:x,value:0,boxCenter:w,rendWidth:c,rendHeight:u,flipXY:i,symbol:a})):k&&g.push(fd({item:x,value:1,boxCenter:w,rendWidth:c,rendHeight:u,flipXY:i,symbol:a})));else for(let e=0;e<q;e++)x[m[e]]&&!1===x[m[e]].show||D[m[e]]();const N={type:"container",data:n,collider:{type:"bounds"},children:g};s.push(N)}return s}({items:d,settings:h,width:n,height:i,flipXY:r,resolved:u,keys:l,symbol:s});return f}};const wd={shape:"saltire",width:2,size:.5,fill:"#333",stroke:"#333",strokeWidth:0},Md=/px$/,kd={shape:"circle",label:"",fill:"#333",stroke:"#ccc",strokeDasharray:"",strokeWidth:0,strokeLinejoin:"miter",opacity:1,x:.5,y:.5,size:1,show:!0},Sd={maxPx:1e4,minPx:1,maxRelExtent:.1,minRelExtent:.01,maxRelDiscrete:1,minRelDiscrete:.1};function _d(e,t){return e&&"function"==typeof e.bandwidth?{isBandwidth:!0,value:Math.max(1,e.bandwidth()*t)}:{isBandwidth:!1,value:Math.max(1,t)}}function qd(e,t,n,i){let{width:r,height:o}=t;return e.filter((e=>!1!==e.show&&!isNaN(e.x+e.y))).map((e=>{let t=e,a=Md.test(e.size)?parseInt(e.size,10):n.min+t.size*(n.max-n.min);ar(a)&&(t=wd,a=n.min+t.size*(n.max-n.min));const[s,l]=function(e){let t=kd.shape,n={};return"object"==typeof e.shape&&"string"==typeof e.shape.type?(t=e.shape.type,n=e.shape):"string"==typeof e.shape&&(t=e.shape),[t,n]}(t),c=ir(ir({},l),{},{type:s,label:e.label,x:e.x*r,y:e.y*o,fill:t.fill,size:Math.min(n.maxGlobal,Math.max(n.minGlobal,a)),stroke:t.stroke,strokeWidth:t.strokeWidth,strokeDasharray:t.strokeDasharray,opacity:t.opacity});t===e.errorShape&&(c.width=t.width);const u=i(c);return u.data=e.data,u}))}const Dd={require:["chart","resolver","symbol"],defaultSettings:{settings:{},data:{},animations:{enabled:!1,trackBy:e=>e.data.value},style:{item:"$shape"}},render(e){let{data:t}=e;const n=this.resolver.resolve({data:t,defaults:Qi({},kd,this.style.item),settings:this.settings.settings,scaled:{x:this.rect.width,y:this.rect.height}}),{width:i,height:r}=this.rect,o=Qi({},Sd,this.settings.settings.sizeLimits),a=n.items,s=function(e,t,n,i,r){const o=_d(e?e.scale:void 0,n),a=_d(t?t.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 qd(a,this.rect,s,this.settings.shapeFn||this.symbol)}};Math.PI;const Ad={label:"",arc:1,show:!0,fill:"#333",stroke:"#ccc",strokeWidth:1,strokeLinejoin:"round",opacity:1,innerRadius:0,outerRadius:.8,cornerRadius:0,offset:0};function Cd(e,t,n,i){let{x:r,y:o,width:a,height:s}=t;const l=Fr(),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 e.map(((e,t)=>{const r=n[t];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=e;const f=l.centroid(e),p=r.offset?function(e,t,n,i){let[r,o]=e;const a=Math.sqrt(r*r+o*o);r/=a,o/=a;const s=n-i;return{x:r*t*s,y:o*t*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:e.value/i,slice:{start:e.startAngle,end:e.endAngle,innerRadius:a,outerRadius:o,cornerRadius:s,offset:{x:c.x+p.x,y:c.y+p.y}}},r}))}function Nd(e,t){return e.slice&&"arc"in e.slice?t.arc:t.data.value}const Ed={require:["chart","resolver"],defaultSettings:{settings:{startAngle:0,endAngle:2*Math.PI,padAngle:0,slice:{}},style:{slice:"$shape"},data:{}},render(e){let{data:t}=e;const n=[],i=[],r=this.settings.settings,{items:o}=this.resolver.resolve({data:t,defaults:Qi({},Ad,this.style.slice),settings:r.slice});let a=0;for(let e=0,t=o.length;e<t;e++){const t=Nd(r,o[e]);t>0&&o[e].outerRadius>=o[e].innerRadius&&(n.push(t),i.push(o[e]),a+=t)}const s=function(){var e=Ur,t=Wr,n=null,i=br(0),r=br(Er),o=br(0);function a(a){var s,l,c,u,h,d=a.length,f=0,p=new Array(d),m=new Array(d),g=+i.apply(this,arguments),y=Math.min(Er,Math.max(-Er,r.apply(this,arguments)-g)),x=Math.min(Math.abs(y)/d,o.apply(this,arguments)),v=x*(y<0?-1:1);for(s=0;s<d;++s)(h=m[p[s]=s]=+e(a[s],s,a))>0&&(f+=h);for(null!=t?p.sort((function(e,n){return t(m[e],m[n])})):null!=n&&p.sort((function(e,t){return n(a[e],a[t])})),s=0,c=f?(y-d*v)/f:0;s<d;++s,g=u)l=p[s],u=g+((h=m[l])>0?h*c:0)+v,m[l]={data:a[l],index:s,value:h,startAngle:g,endAngle:u,padAngle:x};return m}return a.value=function(t){return arguments.length?(e="function"==typeof t?t:br(+t),a):e},a.sortValues=function(e){return arguments.length?(t=e,n=null,a):t},a.sort=function(e){return arguments.length?(n=e,t=null,a):n},a.startAngle=function(e){return arguments.length?(i="function"==typeof e?e:br(+e),a):i},a.endAngle=function(e){return arguments.length?(r="function"==typeof e?e:br(+e),a):r},a.padAngle=function(e){return arguments.length?(o="function"==typeof e?e:br(+e),a):o},a}().sortValues(null);s.startAngle(r.startAngle),s.endAngle(r.endAngle),s.padAngle(r.padAngle);return Cd(s(n),Qi({},this.rect,{x:0,y:0}),i,a)}};const Rd=function(e){function t(t){if(e[t.type]&&e[t.type].condition(t)){const n=e[t.type],i=void 0===n.conditionAppend||n.conditionAppend(t);n.items.forEach((e=>{const n=Math.round(t[e.key]),r=t[e.key]-n;t[e.key]=n,i&&"append"===e.type&&(r>0?t[e.key]+=.5:t[e.key]-=.5)}))}}return void 0===e&&((e={}).line={append:["x1","x2","y1","y2"],round:[],condition:e=>e.x1===e.x2||e.y1===e.y2,conditionAppend:e=>e.strokeWidth%2!=0},e.rect={append:["x","y"],round:["width","height"],condition:()=>!0,conditionAppend:e=>e.strokeWidth%2!=0}),Object.keys(e).forEach((t=>{const n=e[t];n.items=[],n.append.forEach((e=>{n.items.push({key:e,type:"append"})})),n.round.forEach((e=>{n.items.push({key:e,type:"round"})}))})),t.multiple=e=>e.forEach((e=>t(e))),t}();class Id{constructor(){this.reset(),this.push(...arguments)}static evaluateKey(e,t){if(t){const t=e.substring(0,1),n=e.substring(1);if("x"===t)return"y".concat(n);if("y"===t)return"x".concat(n);if("cx"===e)return"cy";if("cy"===e)return"cx";if("width"===e)return"height";if("height"===e)return"width"}return e}transposeCoordinate(e,t,n){if("number"==typeof t&&isFinite(t)){const i=e.substring(0,1);if("x"===i||"cx"===e)return t*this.width;if("width"===e)return t*this.width;if("r"===e)return t*(n?this.height:this.width);if("y"===i||"cy"===e)return t*this.height;if("height"===e)return t*this.height}return t}push(){return this.storage.push(...arguments),this}processItem(e){let t={};const n=void 0!==e.flipXY?e.flipXY:this.flipXY,i=void 0!==e.crisp?e.crisp:this.crisp;if(e.fn&&"function"==typeof e.fn){let i=n?this.height:this.width,r=n?this.width:this.height;e=e.fn({width:i,height:r,flipXY:n});const o=Object.keys(e);for(let i=0,r=o.length;i<r;i++){let r=o[i];t[Id.evaluateKey(r,n)]=e[r]}}else{const i=Object.keys(e);for(let r=0,o=i.length;r<o;r++){let o=i[r];const a=Id.evaluateKey(o,n),s=this.transposeCoordinate(a,e[o],n);t[a]=s}}return i&&Rd(t),t}output(){let e=[];for(let t=0,n=this.storage.length;t<n;t++){let n=this.processItem(this.storage[t]);e.push(n)}return e}reset(){this.storage=[],this.flipXY=!1,this.crisp=!1,this.width=0,this.height=0}}function Od(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return new Id(...t)}function Pd(e,t){return e&&t?e.cachedTicks&&e.cachedTicks()||e.ticks({distance:t}):[]}const Ld={created(){},require:["chart","renderer","resolver"],defaultSettings:{layout:{displayOrder:0},style:{ticks:"$guide-line",minorTicks:"$guide-line--minor"}},beforeRender(){this.blueprint=Od(),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,ku(this,"x",this.rect.width),ku(this,"y",this.rect.height),!this.x&&!this.y)return[];this.settings.ticks=Qi({show:!0},this.style.ticks,this.settings.ticks||{}),this.settings.minorTicks=Qi({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((e=>Qi(e,{flipXY:!0})));let e=e=>{let{dir:t,isMinor:n}=e,i=this.lines[t].filter((e=>!!e.isMinor===n)),r=n?this.settings.minorTicks:this.settings.ticks;this.resolver.resolve({settings:r,data:{items:i,dir:t}}).items.forEach((e=>{let n=e.data;var i,r;e.show&&this.blueprint.push({type:"line",x1:n.position,y1:0,x2:n.position,y2:1,stroke:e.stroke||"black",strokeWidth:void 0!==e.strokeWidth?e.strokeWidth:1,strokeDasharray:void 0!==e.strokeDasharray?e.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:t})}))};return e({dir:"x",isMinor:!1}),e({dir:"x",isMinor:!0}),e({dir:"y",isMinor:!1}),e({dir:"y",isMinor:!0}),this.blueprint.output()}};function Td(e,t,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(e," ").concat(t-n,"\n A ").concat(1.25*n," ").concat(1.25*n,", 0, 1, ").concat(r?0:1,", ").concat(e," ").concat(t+n,"\n L ").concat(r?e+n:e-n," ").concat(t," Z\n ")}let r="bottom"===i;return"\n M ".concat(e-n," ").concat(t,"\n A ").concat(1.25*n," ").concat(1.25*n,", 0, 1, ").concat(r?1:0,", ").concat(e+n," ").concat(t,"\n L ").concat(e," ").concat(r?t+n:t-n," Z\n ")}function zd(e,t,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(e+=r?1.5*n:-1.5*n," ").concat(t-n,"\n L ").concat(e," ").concat(t+n,"\n L ").concat(r?e+n:e-n," ").concat(t," Z\n ")}let r="bottom"===i;return t+=r?1.5*n:-1.5*n,"\n M ".concat(e-n," ").concat(t,"\n L ").concat(e+n," ").concat(t,"\n L ").concat(e," ").concat(r?t+n:t-n," Z\n ")}function Fd(e,t,n){return e<t||e>n}function jd(e,t){if("string"==typeof e.formatter)return t.formatter(e.formatter);if("object"==typeof e.formatter)return t.formatter(e.formatter);if(void 0!==e.scale&&e.scale.data){const t=e.scale.data()&&e.scale.data().fields;return t&&t[0]?t[0].formatter():null}return null}function Vd(e){if(void 0===e)return 0;if("number"==typeof e&&isFinite(e))return e;if("string"==typeof e)switch(e){case"center":case"middle":return.5;case"bottom":case"right":return 1;default:return 0}return 0}function Bd(e){let{chart:t,blueprint:n,renderer:i,p:r,settings:o,items:a,slopeLine:s}=e,l=!0,c=!1,u=!1,h=!1,d=!1,f=Qi(!0,{},o.style.line,r.line||{}),p=Qi(!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 e=Qi(!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=jd(r,t),!1!==r.label.showValue&&(s?p=" (".concat(s(r.value),")"):r.scale&&(p=" (".concat(r.value,")"))),p&&(c=i.measureText({text:p,fontFamily:e.fontFamily,fontSize:e.fontSize}));let m=i.measureText({text:e.text||"",fontFamily:e.fontFamily,fontSize:e.fontSize}),g={width:m.width+c.width,height:Math.max(m.height,c.height)},y=e.padding,x=Vd(r.flipXY?e.vAlign:e.align),v=Vd(r.flipXY?e.align:e.vAlign),b=Math.min(1+g.width+2*y,e.maxWidth*n.width,e.maxWidthPx),w=g.height+2*y,M=r.flipXY?w:b,k=r.flipXY?b:w;if(u=n.processItem({fn:t=>{let{width:i,height:o}=t,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:e.background.stroke,strokeWidth:e.background.strokeWidth,fill:e.background.fill,opacity:e.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:e.text||"",fill:e.fill,opacity:e.opacity,fontFamily:e.fontFamily,fontSize:e.fontSize,x:u.x+y,y:u.y+u.height/2+g.height/3,maxWidth:u.width-2*y-c.width,anchor:"start"},p&&(d={type:"text",text:p||"",fill:e.fill,opacity:e.opacity,fontFamily:e.fontFamily,fontSize:e.fontSize,x:h.x+3+(u.width-(c.width+2*y)),y:h.y});for(let e=0,t=a.length;e<t;e++){let t=a[e];"rect"===t.type?xh(u,t)&&(l=!1):"line"===t.type&&r.flipXY===t.flipXY&&wh(u,t)&&(l=!1)}}}if(c&&a.push(c),0!==(null==s?void 0:s.slope)&&(null!=s&&s.showLabel||null!=s&&s.showValue)){let e,o;const l=120;let u=s.showLabel?s.refLineLabel:"";if(s.showValue){const n=jd(r,t),i=n?n(s.value):s.value;e="(".concat(s.slope,"x + ").concat(i,")"),u+=s.refLineLabel?" ".concat(e):e}if(u.length>1){var m;const e=i.measureText({text:u,fontFamily:p.fontFamily,fontSize:p.fontSize});e.width=e.width>l?l:e.width;const r=function(e,t,n){const i=e.scale({scale:"x"}),r=e.scale({scale:"y"});if(t>0){if(i.max()*t+n>=r.max())return!0}else if(t<0&&i.min()*t+n>=r.max())return!0;return!1}(t,s.slope,s.value)?function(e,t,n){const i=e.scale({scale:"x"}),r=e.scale({scale:"y"});return i((r.max()-n)/t)}(t,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,g=function(e,t,n,i,r,o){let a=0;if(void 0!==n){if(n<.8)return a=e.slope<0||e.isRtl?3*o.padding:2*o.padding,e.isRtl,n*r.width+a;if(1===n)return e.isRtl?n*r.width-(i.width+3*o.padding):n*r.width-(i.width+6*o.padding);if(n>.8)return e.isRtl?n*r.width-(i.width+3*o.padding):n*r.width-(i.width+6*o.padding)}else if(e.slope>0)return t.x2-(i.width+2*o.padding);return e.isRtl?t.x1-(i.width+2*o.padding):t.x1}(s,c,r,e,n,p),y=Math.min(c.y1,c.y2);s.labelStroke&&(o={type:"rect",x:s.isRtl?Math.max(g,h)-2:Math.max(g,h)+2,y:Math.abs(Math.max(y,d)-e.height),rx:3,ry:3,width:e.width+p.padding,height:e.height-2,stroke:f.stroke,fill:f.stroke});const x={type:"text",text:u,fill:null!==(m=s.labelStroke)&&void 0!==m?m:f.stroke,opacity:p.opacity,fontFamily:p.fontFamily,fontSize:p.fontSize,x:o?o.x+2:Math.max(g,h)+2,y:o?o.y+e.height-p.padding:Math.abs(Math.max(y,d)-p.padding/2),anchor:"start",title:u,maxWidth:l,width:e.width};(function(e,t,n,i,r){for(let o=0,a=e.length;o<a;o++){const a=e[o];if("text"===(null==a?void 0:a.type)&&Math.abs(a.x-t.x)<Math.max(a.width+i,t.width+i)&&Math.abs(a.y-t.y)<n.height+r)return!0}return!1})(a,x,e,h,d)||(o&&a.push(o),a.push(x))}}l&&u&&h&&(a.push(u,h),d&&a.push(d))}function Hd(e){const t={value:e.value};return e.label&&(t.label=e.label.text),t}function $d(e){return void 0!==("function"==typeof e.value?e.value():e.value)}function Wd(e,t){const n=e.min();if(n===e.max()){const i=function(e){const t=e.range();return 2===(null==t?void 0:t.length)&&t[0]>t[1]}(e);if(t<n)return i?2:-1;if(t>n)return i?-1:2}return e(t)}function Ud(e,t){return e&&t&&Math.abs(e.x-t.x)<1e-15&&Math.abs(e.y-t.y)<1e-15}const Yd={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=Od(),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 e=this.settings;if(this.lines={x:[],y:[]},this.lines.x=e.lines&&e.lines.x||[],this.lines.y=e.lines&&e.lines.y||[],0===this.lines.x.length&&0===this.lines.y.length)return[];const t={x0:[],x1:[],y0:[],y1:[]};this.lines.x=this.lines.x.filter($d).map((e=>{if("function"==typeof e.value&&(e.value=e.value()),e.scale){let t=this.chart.scale(e.scale);const n=Wd(t,e.value);return Qi(e,{scale:t,position:n})}return Qi(e,{position:e.value})})),this.lines.y=this.lines.y.filter($d).map((e=>{if("function"==typeof e.value&&(e.value=e.value()),e.scale){let t=this.chart.scale(e.scale);const n=Wd(t,e.value);return Qi(e,{scale:t,position:n,flipXY:!0})}return Qi(e,{position:e.value,flipXY:!0})})),this.lines.x=this.lines.x.filter((e=>!(e.position<0||e.position>1)||(t["x".concat(e.position>1?1:0)].push(Hd(e)),!1))),this.lines.y=this.lines.y.filter((e=>!(!e.slope||0===e.slope)||(!(e.position<0||e.position>1)||(t["y".concat(e.position>1?1:0)].push(Hd(e)),!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 e=this.chart.scale({scale:"x"}),n=this.chart.scale({scale:"y"}),o=e.min(),a=e.max(),s=n.min(),l=n.max();r=ir(ir({},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=[];Fd(c,s,l)||(f[0]={x:Wd(e,o),y:Wd(n,c)}),Fd(h,o,a)||(f[1]={x:Wd(e,h),y:1}),Fd(u,s,l)||(f[2]={x:Wd(e,a),y:Wd(n,u)}),Fd(d,o,a)||(f[3]={x:Wd(e,d),y:0});if(f.filter((e=>!!e)).length>2&&function(e){Ud(e[0],e[1])&&(e[1]=void 0),Ud(e[1],e[2])&&(e[2]=void 0),Ud(e[2],e[3])&&(e[3]=void 0),Ud(e[3],e[0])&&(e[3]=void 0)}(f),f=f.filter((e=>!!e)),f.length<2)return void t["y".concat(c>l?0:1)].push(Hd(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;Bd({chart:this.chart,blueprint:this.blueprint,renderer:this.renderer,p:i,settings:e,items:n,slopeLine:r})}})),e.style.oob.show&&function(e){let{blueprint:t,oob:n,settings:i,items:r}=e;const o=Object.keys(n);let a=i.style.oob||{};for(let e=0,i=o.length;e<i;e++){const i=o[e],s=n[i];if(s.length>0){let e=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"===e?"bottom":"top":"1"===e?"right":"left";let u=t.processItem({fn:t=>{let{width:i,height:r}=t,u=e*i+("1"===e?-o:o),h=n?l:r-l;return"arc"===a.type?{type:"path",d:Td(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:zd(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:t,settings:e,items:n}),n}};function Gd(e){const t={type:"line",x1:0,x2:0,y1:0,y2:0,collider:{type:null}};return"top"===e.align||"bottom"===e.align?(t.x1=e.innerRect.x-e.outerRect.x,t.x2=t.x1+e.innerRect.width,t.y1=t.y2="top"===e.align?e.innerRect.height-e.padding:e.padding):(t.x1=t.x2="left"===e.align?e.innerRect.width-e.padding:e.padding,t.y1=e.innerRect.y-e.outerRect.y,t.y2=t.y1+e.innerRect.height),function(e,t){Qi(e,t.style)}(t,e),t}function Xd(e){return"string"==typeof e||"number"==typeof e?e:"-"}function Kd(e,t,n){n.layered||!n.stepSize?function(e,t){t.collider={type:"polygon",vertices:[{x:t.boundingRect.x,y:t.boundingRect.y},{x:t.boundingRect.x+t.boundingRect.width,y:t.boundingRect.y},{x:t.boundingRect.x+t.boundingRect.width,y:t.boundingRect.y+t.boundingRect.height},{x:t.boundingRect.x,y:t.boundingRect.y+t.boundingRect.height}]}}(0,t):n.tilted?function(e,t,n){const i=n.angle*(Math.PI/180),r=Math.max(n.stepSize/2,t.boundingRect.height/2),o="start"===t.anchor,a="end"===t.anchor&&i<0,s="start"===t.anchor&&i>=0,l=t.boundingRect.y+(s||a?t.boundingRect.height:0),c=[{x:t.x-r,y:l},{x:t.x+r,y:l}].map((e=>Wu(e,i,{x:t.x,y:t.y}))),u={x:o?t.boundingRect.x+t.boundingRect.width+10:t.boundingRect.x-10,y:t.boundingRect.y+t.boundingRect.height},h={x:o?t.boundingRect.x+t.boundingRect.width+10:t.boundingRect.x-10,y:t.boundingRect.y},d=i>=0?[u,h]:[h,u];c.push(...d),t.collider={type:"polygon",vertices:c}}(0,t,n):function(e,t,n){if("bottom"===n.align||"top"===n.align){const i=e.position*n.innerRect.width+(n.innerRect.x-n.outerRect.x-n.stepSize/2);t.collider={type:"rect",x:i,y:0,width:i<0?n.stepSize+i:n.stepSize,height:n.innerRect.height}}else{const i=e.position*n.innerRect.height+(n.innerRect.y-n.outerRect.y-n.stepSize/2);t.collider={type:"rect",x:0,y:i,width:n.innerRect.width,height:i<0?n.stepSize+i:n.stepSize}}const i=t.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}(e,t,n)}function Zd(e,t){const n=isNaN(e.style.align)?.5:Math.min(Math.max(e.style.align,0),1);let i=0;if(e.tilted)i=e.stepSize*n;else{const r=t?e.textRect.height:e.textRect.width;i=Math.max(0,e.stepSize-r)*n}return i}function Jd(e,t){var n,i;const r={type:"text",text:Xd(e.label),x:0,y:0,maxWidth:t.maxWidth,maxHeight:t.maxHeight,tickValue:null!==(n=e.value)&&void 0!==n?n:null===(i=e.data)||void 0===i?void 0:i.value};return"top"===t.align||"bottom"===t.align?(r.x=e.start*t.innerRect.width+(t.innerRect.x-t.outerRect.x)+Zd(t,!1),r.y="top"===t.align?t.innerRect.height:0,r.anchor=t.stepSize?"start":"middle",r.x+=isNaN(t.style.offset)?0:+t.style.offset):(r.y=e.start*t.innerRect.height+(t.innerRect.y-t.outerRect.y)+Zd(t,!0),r.x="left"===t.align?t.innerRect.width:0,r.anchor="left"===t.align?"end":"start",r.baseline=t.stepSize?"text-before-edge":"central",r.y+=isNaN(t.style.offset)?0:+t.style.offset),function(e,t){["fill","fontSize","fontFamily"].forEach((n=>{e[n]=t.style[n]}))}(r,t),function(e,t){if(!t.tilted&&!t.stepSize)if("top"===t.align||"bottom"===t.align){const n=0,i=t.outerRect.width,r=Math.min(t.maxWidth/2,t.textRect.width/2),o=e.x-r,a=e.x+r;o<n?(e.anchor="start",e.x=t.innerRect.x-t.outerRect.x):a>i&&(e.anchor="end",e.x=t.innerRect.width+t.innerRect.x)}else{const n=0,i=t.outerRect.height,r=t.maxHeight/2,o=e.y-r,a=e.y+r;o<n?(e.y=t.innerRect.y-t.outerRect.y,e.baseline="text-before-edge"):a>i&&(e.y=t.innerRect.height+(t.innerRect.y-t.outerRect.y),e.baseline="text-after-edge")}}(r,t),function(e,t){"top"===t.align?e.y-=t.padding:"bottom"===t.align?e.y+=t.padding+t.maxHeight:"left"===t.align?e.x-=t.padding:"right"===t.align&&(e.x+=t.padding)}(r,t),function(e,t){if(t.tilted){const n=-t.angle,i=n*(Math.PI/180);"bottom"===t.align?(e.x-=t.maxHeight*Math.sin(i)/2,e.y-=t.maxHeight,e.y+=t.maxHeight*Math.cos(i)/2):e.x-=t.maxHeight*Math.sin(i)/3,e.transform="rotate(".concat(n,", ").concat(e.x,", ").concat(e.y,")"),e.anchor="bottom"===t.align==t.angle<0?"start":"end";const r=Math.cos(i)*t.maxWidth;if("bottom"===t.align==t.angle<0){const n=t.outerRect.width-t.paddingEnd;e.x+r>n&&(e.maxWidth=(n-e.x-10)/Math.cos(i))}else{const n=t.paddingEnd;e.x-r<n&&(e.maxWidth=(e.x-n-10)/Math.cos(i))}}}(r,t),function(e,t){e.boundingRect=t.textBounds(e)}(r,t),Kd(e,r,t),r}function Qd(e,t){const n={type:"line",x1:0,x2:0,y1:0,y2:0,collider:{type:null},tickValue:e.value};return"top"===t.align||"bottom"===t.align?(n.x1=n.x2=e.position*t.innerRect.width+(t.innerRect.x-t.outerRect.x),n.y1="top"===t.align?t.innerRect.height:0,n.y2="top"===t.align?n.y1-t.tickSize:n.y1+t.tickSize):(n.y1=n.y2=e.position*t.innerRect.height+(t.innerRect.y-t.outerRect.y),n.x1="left"===t.align?t.innerRect.width:0,n.x2="left"===t.align?n.x1-t.tickSize:n.x1+t.tickSize),function(e,t){Qi(e,t.style)}(n,t),function(e,t){"top"===t.align?(e.y1-=t.padding,e.y2-=t.padding):"bottom"===t.align?(e.y1+=t.padding,e.y2+=t.padding):"left"===t.align?(e.x1-=t.padding,e.x2-=t.padding):"right"===t.align&&(e.x1+=t.padding,e.x2+=t.padding)}(n,t),function(e,t){const n=e.strokeWidth/2;e.x1===t.innerRect.width?(e.x1-=n,e.x2-=n):0===e.x1?(e.x1+=n,e.x2+=n):e.y1===t.innerRect.height?(e.y1-=n,e.y2-=n):0===e.y1&&(e.y1+=n,e.y2+=n)}(n,t),n}function ef(e){return!e.isMinor&&e.position>=0&&e.position<=1}function tf(e){let{rect:t,state:n,majorTicks:i,measure:r,horizontal:o}=e;return o?function(e){let{majorTicks:t,measureText:n,rect:i,state:r}=e;const o="layered"===r.labels.activeMode?2:1,a=i.width,s=t.map((e=>e.label)).map((e=>"".concat(e.slice(0,1)).concat(e.length>1?"…":""))).map(n).map((e=>e.width));for(let e=0;e<t.length;++e){const n=t[e];if(o*a*Math.abs(n.start-n.end)<s[e])return!0}return!1}({majorTicks:i,measureText:r,rect:t,state:n}):function(e){let{majorTicks:t,measureText:n,rect:i}=e;const r=i.height,o=n("M").height;return!(t.length<2)&&r*Math.abs(t[0].position-t[1].position)<o}({majorTicks:i,measureText:r,rect:t,state:n})}function nf(e){let{value:t,maxValue:n,minValue:i,range:r,modifier:o}=e;return isNaN(r)||isNaN(o)||(t=r*o),t>n&&(t=n),t<i&&(t=i),t}function rf(e){let{isDiscrete:t,rect:n,formatter:i,measureText:r,scale:o,settings:a,state:s}=e,l=0;const c={left:0,top:0,right:0,bottom:0},{maxLengthPx:u,minLengthPx:h}=a.labels;if(a.labels.show){const e=a.align,d="top"===e||"bottom"===e,f=d?n.inner.width:n.inner.height,p=o.ticks({settings:a,distance:f,formatter:i}).filter(ef),m=e=>{const t=r({text:e,fontSize:a.labels.fontSize,fontFamily:a.labels.fontFamily});return t.width=nf({value:t.width,maxValue:u,minValue:h}),t};if(t&&d&&"auto"===a.labels.mode&&(!function(e){let{majorTicks:t,measure:n,rect:i,state:r,settings:o}=e;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 e=0;e<t.length;e++){const i=t[e],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*t.reduce(((e,t)=>Math.min(Math.abs(t.start-t.end),e)),1/0),h=n("M").width*l*a,h+c>d)return!0;return!1}({majorTicks:p,measure:m,rect:n.inner,state:s,settings:a})?s.labels.activeMode="horizontal":s.labels.activeMode="tilted"),!a.labels.filterOverlapping&&"tilted"!==s.labels.activeMode&&tf({rect:n.inner,state:s,majorTicks:p,measure:m,horizontal:d})){return{size:Math.max(n.outer.width,n.outer.height),isToLarge:!0}}let g,y;if("tilted"===s.labels.activeMode){const e=Math.abs(a.labels.tiltAngle)*(Math.PI/180);g=t=>nf({value:t.width,maxValue:u,minValue:h})*Math.sin(e)+t.height*Math.cos(e)}else g=d?e=>e.height:e=>nf({value:e.width,maxValue:u,minValue:h});if(d&&"tilted"!==s.labels.activeMode)y=["M"];else if(isNaN(a.labels.maxGlyphCount))y=p.map((e=>e.label));else{let e="";for(let t=0;t<a.labels.maxGlyphCount;t++)e+="M";y=[e]}const x=y.map(m),v=x.map(g),b=Math.max(...v,0);if(l+=b,l+=a.labels.margin,"layered"===s.labels.activeMode&&(l*=2),"tilted"===s.labels.activeMode){const e="bottom"===a.align==a.labels.tiltAngle>=0,t=Math.abs(a.labels.tiltAngle)*(Math.PI/180),i=(b-m("M").height*Math.cos(t))/Math.sin(t),r=e=>Math.min(i,e.width)*Math.cos(t)+e.height,o=(t,i)=>{const r=p[i]?p[i].position:0;return e?t-r*n.inner.width:t-(1-r)*n.inner.width},s=Math.min(a.labels.maxEdgeBleed,Math.max(...x.map(r).map(o),0))+a.paddingEnd;if(c[e?"left":"right"]=s,!a.labels.filterOverlapping&&function(e){let{majorTicks:t,measureText:n,rect:i,bleedSize:r,angle:o}=e;if(t.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(t[0].position-t[1].position));return n("M").height>Math.sin(a*(Math.PI/180))/s}({majorTicks:p,measureText:m,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 of=(e,t,n)=>e.width*Math.abs(t.position-n.position);function af(e){let{layered:t,major:n,innerRect:i,outerRect:r,tick:o,index:a}=e;const s=t?2:1,l=n[a-s],c=n[a+s],u=l?of(i,o,l)/2-2:1/0,h=c?of(i,o,c)/2-2:1/0;return n.length<2?i.width:l?c?2*Math.min(u,h):(e=>{let{innerRect:t,outerRect:n,tick:i,prevWidth:r}=e;const o=t.x-n.x,a=n.width-t.width-o,s=t.width-t.width*i.position+a,l=2*Math.min(r,s),c=1===i.position?t.width/2-2:0;return Math.max(r,l,c)})({innerRect:i,outerRect:r,tick:o,prevWidth:u}):(e=>{let{innerRect:t,outerRect:n,tick:i,nextWidth:r}=e;const o=t.x-n.x,a=t.width*i.position+o,s=2*Math.min(r,a),l=0===i.position?t.width/2-2:0;return Math.max(r,s,l)})({innerRect:i,outerRect:r,tick:o,nextWidth:h})}function sf(e){const t=e.innerRect,n={cx:t.width/2,cy:t.height/2},i=Math.min(t.height,t.width)/2*e.radius,r=i+e.style.strokeWidth,o={visible:!0,type:"path",arcDatum:{startAngle:e.startAngle,endAngle:e.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(e,t){Qi(e,t.style)}(o,e),o}function lf(e,t,n,i){return{x:e+n*Math.cos(i),y:t+n*Math.sin(i)}}function cf(e,t){const n=t.innerRect,i={cx:n.width/2,cy:n.height/2},r=Math.min(n.height,n.width)/2*t.radius+t.padding,o=t.startAngle,a=t.endAngle,s=t.tickSize,l=a-o;let c=a-e.position*l;c-=Math.PI/2;const u=lf(i.cx,i.cy,r+s,c),h=lf(i.cx,i.cy,r,c),d={type:"line",x1:u.x,y1:u.y,x2:h.x,y2:h.y,value:e.value};return function(e,t){const n=ir({},t.style);Qi(e,n)}(d,t),d}function uf(e){return"string"==typeof e||"number"==typeof e?e:"-"}function hf(e,t,n){let i;return i="left"===t?n.x:"right"===t?e.outerRect.width-n.x:Math.max(n.x,e.outerRect.width-n.x),i}function df(e,t){const n=t.innerRect,i={cx:n.width/2,cy:n.height/2},r=Math.min(n.height,n.width)/2*t.radius+t.padding,o=t.startAngle,a=t.endAngle,s=t.tickSize,l=a-o,c=.2;let u,h;u="top"===t.align||"bottom"===t.align?a-e.position*l:o+e.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(e,t,n,i){return{x:e+n*Math.cos(i),y:t+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:uf(e.label),align:h,x:d.x,y:d.y,maxHeight:t.maxHeight,maxWidth:hf(t,h,d),anchor:f,baseline:"middle"};return function(e,t){["fill","fontSize","fontFamily"].forEach((n=>{e[n]=t.style[n]}))}(p,t),function(e,t){e.boundingRect=t.textBounds(e)}(p,t),function(e,t,n){let i,r;const o=parseFloat(n.fontSize)||0;i=t.y-o/2,r=e.innerRect.height-(t.y+o/2),(i<0||r<0)&&(n.text="")}(t,d,p),p}function ff(e){let t=0;return t+=e.paddingStart,t+=e.line.show?e.line.strokeWidth/2:0,t+=e.ticks.show?e.ticks.margin:0,t}function pf(e){let t=0;return t+=e.line.show?e.line.strokeWidth/2:0,t+=e.ticks.show?e.ticks.margin:0,t}function mf(e){let t=0;return t+=e.ticks.show?e.ticks.tickSize:0,t+=ff(e)+e.labels.margin,t}function gf(e,t){return e.map((e=>Qd(e,t)))}function yf(e,t){return t?Math.abs(t.end-t.start):e.bandwidth()}function xf(e){let{textMetrics:t,settings:n,innerRect:i,scale:r,tilted:o,layered:a,tick:s}=e;const l=t.height,c=yf(r,s),u={width:0,height:l};if("left"===n.align||"right"===n.align)u.width=i.width-mf(n)-n.paddingEnd;else if(a)u.width=c*i.width*2;else if(o){const e=Math.abs(n.labels.tiltAngle)*(Math.PI/180);u.width=(i.height-mf(n)-n.paddingEnd-l*Math.cos(e))/Math.sin(e)}else u.width=c*i.width;return u.width=nf({value:u.width,maxValue:n.labels.maxLengthPx,minValue:n.labels.minLengthPx}),u}function vf(e){let{textMetrics:t,settings:n,innerRect:i,outerRect:r,tilted:o,layered:a,tick:s,index:l,major:c}=e;const u=t.height,h={width:0,height:u};if("left"===n.align||"right"===n.align)h.width=i.width-mf(n)-n.paddingEnd;else if(o){const e=Math.abs(n.labels.tiltAngle)*(Math.PI/180);h.width=(i.height-mf(n)-n.paddingEnd-u*Math.cos(e))/Math.sin(e)}else h.width=af({layered:a,major:c,innerRect:i,outerRect:r,tick:s,index:l});return h.width=nf({value:h.width,maxValue:n.labels.maxLengthPx,minValue:n.labels.minLengthPx}),h}function bf(e){let t;function n(){return t=vf,n}function i(){return t=xf,i}function r(e){let{settings:n,scale:i,innerRect:r,outerRect:o,measureText:a,ticks:s,state:l,textBounds:c}=e;const u=[],h=function(e){return e.filter((e=>!e.isMinor))}(s),d=function(e){return e.filter((e=>e.isMinor))}(s),f={innerRect:r,align:n.align,outerRect:o},p="tilted"===l.labels.activeMode,m="layered"===l.labels.activeMode;let g;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(sf(f)):u.push(Gd(f))),n.ticks.show&&(f.style=n.ticks,f.tickSize=n.ticks.tickSize,f.padding=ff(n),n.arc?(f.padding=pf(n),g=function(e,t){return e.map((e=>cf(e,t)))}(h,f)):g=gf(h,f)),n.labels.show){const e=mf(n);f.style=n.labels,f.padding=e,f.tilted=p,f.layered=m,f.angle=n.labels.tiltAngle,f.paddingEnd=n.paddingEnd,f.textBounds=c;const l=(e,l)=>{f.textRect=function(e){let{style:t,measureText:n,tick:i}=e;return n({text:i.label,fontSize:t.fontSize,fontFamily:t.fontFamily})}({tick:e,measureText:a,style:f.style});const c=t({textMetrics:f.textRect,settings:n,innerRect:r,outerRect:o,scale:i,tilted:p,layered:m,tick:e,major:h,index:l});f.maxWidth=c.width,f.maxHeight=c.height,f.stepSize=function(e){let{innerRect:t,scale:n,settings:i,tick:r}=e;return("top"===i.align||"bottom"===i.align?t.width:t.height)*yf(n,r)}({innerRect:r,scale:i,ticks:s,settings:n,tick:e})};let d=[];n.arc?(f.padding=function(e){let t=0;return t+=e.ticks.show?e.ticks.tickSize:0,t+=pf(e)+e.labels.margin,t}(n),d=function(e,t,n){return e.map(((e,i)=>{n(e,i);const r=df(e,t);return r.data=e.data,r}))}(h,f,l)):d=!m||"top"!==n.align&&"bottom"!==n.align?function(e,t,n){return e.map(((e,i)=>{n(e,i);const r=Jd(e,t);return r.data=e.data,r}))}(h,f,l):function(e,t,n,i){const r=t.padding,o=mf(n);return e.map(((e,a)=>{i(e,a);const s=o+t.maxHeight+n.labels.margin;t.layer=a%2,t.padding=a%2==0?r:s;const l=Jd(e,t);return l.data=e.data,l}))}(h,f,n,l),n.labels.filterOverlapping&&function(e,t,n){let i=(t,n)=>xh(fr(1,e[t].boundingRect),fr(1,e[n].boundingRect));if(n&&n.tilted){const t=Math.abs(n.angle);i=(n,i)=>{const r=1/Math.abs(e[n].x-e[i].x),o=Math.sin(t*(Math.PI/180))/r;return e[n].boundingRect.height>o}}for(let n=0;n<=e.length-1;n++)for(let r=n+1;r<=Math.min(n+5,n+(e.length-1));r++)e[n]&&e[r]&&i(n,r)&&(r===e.length-1?(e.splice(n,1),t&&t.splice(n,1)):(e.splice(r,1),t&&t.splice(r,1)),r--,n--)}(d,g,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(e){return e.line.strokeWidth+e.minorTicks.margin}(n),u.push(...gf(d,f))),g&&u.push(...g),u}return n.build=r,i.build=r,e?i():n()}const wf={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"},Mf={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 kf={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(e){let{state:t,style:n,settings:i}=e;const r=Qi(!0,{},t.isDiscrete?wf:Mf,n),o=Qi(!0,{},r,i.settings),a=i.layout.dock||t.defaultDock;o.dock=a,o.align=function(e,t){const n=["top","bottom"],i=["left","right"];return-1!==n.indexOf(e)&&-1===i.indexOf(t)||-1!==i.indexOf(e)&&-1===n.indexOf(t)?e:t}(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=bf(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(e,t,n){const i=t.labels.mode;return n&&e.isHorizontal?"auto"===i?e.labels.activeMode:-1!==["layered","tilted"].indexOf(t.labels.mode)&&-1!==["top","bottom"].indexOf(t.dock)?i:"horizontal":"horizontal"}(this.state,this.state.settings,this.state.isDiscrete)},preferredSize(e){const{formatter:t,state:n,scale:i}=this,r=this.state.isHorizontal?e.inner.width:e.inner.height;this.state.pxScale=Su(i,r);const o=function(e){let{isDiscrete:t,rect:n,formatter:i,measureText:r,scale:o,settings:a,state:s}=e,l=0;const{size:c,edgeBleed:u,isToLarge:h}=rf({isDiscrete:t,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 e=a.minorTicks.margin+a.minorTicks.tickSize;e>l&&(l=e)}if(a.line.show){const e=a.line.strokeWidth/2;l+=e,u[function(e){switch(e){case"top":return"bottom";case"bottom":return"top";case"left":return"right";case"right":return"left";default:return e}}(a.align)]=Math.ceil(e)}return l+=a.paddingStart,l+=a.paddingEnd,{size:l,edgeBleed:u}}({isDiscrete:this.state.isDiscrete,rect:{inner:e.inner,outer:e.outer},formatter:t,measureText:this.renderer.measureText,scale:this.state.pxScale,settings:this.state.settings,state:n});return o},beforeUpdate(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const{settings:t}=e;this.setState(t)},resize(e){const{inner:t,outer:n}=e,i=Qi({},t,function(e){let{align:t,inner:n}=e;return"left"===t?{x:n.width+n.x}:"right"===t||"bottom"===t?n:{y:n.y+n.height}}({align:this.state.settings.align,inner:t})),r=n||i;return Qi(this.state.innerRect,i),Qi(this.state.outerRect,r),n},beforeRender(){const{scale:e,formatter:t}=this,n=this.state.isHorizontal?this.state.innerRect.width:this.state.innerRect.height;this.state.pxScale=Su(e,n),this.state.ticks=this.state.pxScale.ticks({distance:n,formatter:t}).filter((e=>e.position>=0&&e.position<=1))},render(){const{state:e}=this,t=[];return t.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:e})),Rd.multiple(t),t}};const Sf={render:()=>[]};function _f(e,t,n){let i="";if("function"==typeof e)i=e();else if("string"==typeof e)i=e;else if(n){const e=(n.data().fields||[]).map((e=>e.title()));i=e.join(t)}return i}function qf(e,t){let n="middle";return"left"===e?"top"===t?n="end":"bottom"===t&&(n="start"):"right"===e?"top"===t?n="start":"bottom"===t&&(n="end"):"left"===t?n="start":"right"===t&&(n="end"),n}const Df={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 e=this.settings.text,t=this.definitionSettings.join;this.title=_f(e,t,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:e,definitionSettings:t,rect:n}=this,i=[];return i.push(function(e){let{title:t,definitionSettings:n,dock:i,rect:r,measureText:o,style:a}=e;const s={type:"text",text:t,x:0,y:0,dx:0,dy:0,anchor:qf(i,n.anchor),baseline:"alphabetical",stroke:"transparent",strokeWidth:0,fontWeight:"normal"};Qi(s,a.text);const l=o(s);if("top"===i||"bottom"===i){let e=r.width/2;"left"===n.anchor?e=n.paddingLeft||0:"right"===n.anchor&&(e=r.width-(n.paddingRight||0)),s.x=e,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 e=r.height/2;"top"===n.anchor?e=n.paddingStart:"bottom"===n.anchor&&(e=r.height-n.paddingStart),s.y=e,s.x="left"===i?r.width-n.paddingStart:n.paddingStart,s.dx="left"===i?-l.height/3:l.height/3;const t="left"===i?270:90;s.transform="rotate(".concat(t,", ").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:e,dock:this.settings.layout.dock,definitionSettings:t,rect:n,measureText:this.renderer.measureText,style:this.style})),i},beforeUpdate(e){e.settings&&(Qi(this.settings,e.settings),this.definitionSettings=e.settings.settings);const t=this.settings.text,n=this.definitionSettings.join;this.title=_f(t,n,this.scale)}};function Af(e,t){const n=e.settings.layout.dock,i=e.settings.settings.invert,r="top"===n||"bottom"===n,o=r?"width":"height",a=e.rect[o],s=e.chart.scroll(e.settings.scroll);let l;{let e=t[r?"x":"y"];i&&(e=a-e);const n=s.getState();l={startOffset:e,startScroll:n.start,swipe:!1};const o=e/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:e=>{let t=e[r?"x":"y"];if(i&&(t=a-t),!l.swipe){if(Math.abs(l.startOffset-t)<=1)return;l.swipe=!0}const n=s.getState(),o=(t-l.startOffset)/a*(n.max-n.min),c=l.startScroll+o;s.moveTo(c)},end:e=>{let t=e[r?"x":"y"];i&&(t=a-t);const n=s.getState();if(l.swipe){const e=(t-l.startOffset)/a*(n.max-n.min),i=l.startScroll+e;s.moveTo(i)}else{const e=t/a*(n.max-n.min)+n.min-n.viewSize/2;s.moveTo(e)}}}}function Cf(e,t){const n=t.element().getBoundingClientRect();return{x:e.center.x-n.left,y:e.center.y-n.top}}const Nf={require:["chart","renderer"],on:{panStart(e){const t=Cf(e,this.renderer),n={x:t.x-e.deltaX,y:t.y-e.deltaY};this.currentMove=Af(this,n),this.currentMove.update(t)},panMove(e){if(!this.currentMove)return;const t=Cf(e,this.renderer);this.currentMove.update(t)},panEnd(e){if(!this.currentMove)return;const t=Cf(e,this.renderer);this.currentMove.end(t),this.currentMove=null},panCancel(){this.currentMove=null},tap(e){const t=Cf(e,this.renderer);Af(this,t).end(t)}},defaultSettings:{settings:{backgroundColor:"#eee",thumbColor:"#ccc",width:16}},preferredSize:function(e){const t=this.chart.scroll(this.settings.scroll).getState();if(t.viewSize>=t.max-t.min){return Math.max(e.width,e.height)}return this.settings.settings.width},render:function(e){const t=this.settings.layout.dock,n=this.settings.settings.invert,i="top"===t||"bottom"===t,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),e("div",{style:{position:"relative",width:"100%",height:"100%",background:this.settings.settings.backgroundColor,pointerEvents:"auto"}},[].concat(e("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 Ef(e){let{h:t,isVertical:n,value:i,pos:r,align:o,borderHit:a,state:s,idx:l}=e;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),t("div",{onmouseover(e){e.srcElement.children[0].style.backgroundColor="#000",e.srcElement.children[0].style[n?"height":"width"]="2px"},onmouseout(e){e.srcElement.children[0].style.backgroundColor=s.style.line.stroke,e.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"}},[t("div",{style:Qi({backgroundColor:s.style.line.stroke,position:"absolute",height:n?"".concat(1,"px"):"100%",width:n?"100%":"".concat(1,"px"),pointerEvents:"none"},u)})])}function Rf(e){let{h:t,isVertical:n,label:i,otherValue:r,rangeIdx:o,idx:a,pos:s,align:l,state:c,value:u}=e;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 m=c.edit&&c.edit.rangeIdx===o&&c.edit.bubbleIdx===a;const g={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=m?t("input",{type:"text",value:u,style:ir(ir({},g),{},{textAlign:"start",textOverflow:"",fontSize:"13px"}),onkeyup(e){if("Enter"===e.key){e.preventDefault(),e.stopPropagation();const t=parseFloat(e.target.value);isNaN(t)?(y="rgba(230, 78, 78, 0.6)",e.target.style.border="".concat(c.style.bubble.strokeWidth,"px solid ").concat(y)):c.onEditConfirmed(o,t,r)}else"Escape"===e.key&&(e.preventDefault(),e.stopPropagation(),c.onEditCanceled())}}):t("div",{"data-key":[c.key,"bubble",o,a].join("-"),"data-other-value":r,"data-idx":o,"data-bidx":a,style:g},[i]);return t("div",{style:{position:"absolute",[f]:"0",[n?"top":"left"]:"".concat(s,"px"),transform:p}},[x])}function If(e){let{h:t,isVertical:n,top:i,height:r,color:o,on:a,opacity:s}=e;return t("div",Qi({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 Of(e){let{borderHit:t,els:n,isVertical:i,state:r,vStart:o,vEnd:a,idx:s}=e,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 e=r.targetFillRect||r.targetRect,t=i?e.height:e.width,s=c?r.scale.norm(o)*t:o,l=c?r.scale.norm(a)*t: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(e){e.srcElement.style.opacity=r.style.target.opacity+.1},onmouseout(e){e.srcElement.style.opacity=r.style.target.opacity}}),n.push(r.h("div",{style:{position:"absolute",left:"".concat(e.x,"px"),top:"".concat(e.y,"px"),height:"".concat(e.height,"px"),width:"".concat(e.width,"px")}},[If(d)]))}const m=u<h?o:a,g=u<h?a:o,[y,x]=c?r.scale.domain():[Math.min(o,a),Math.max(o,a)],v=m+1e-5>=y&&m-1e-5<=x,b=g-1e-5<=x&&g+1e-5>=y;v&&n.push(Ef({h:r.h,isVertical:i,borderHit:t,value:m,pos:f,align:"start",state:r,idx:s})),b&&n.push(Ef({h:r.h,isVertical:i,borderHit:t,value:g,pos:p,align:"end",state:r,idx:s}));const w=r.settings.bubbles;if(w&&w.show){const e={fontSize:w.fontSize,fontFamily:w.fontFamily,color:w.fill},t=[o,a];v&&n.push(Rf({h:r.h,isVertical:i,align:w.align,style:e,rangeIdx:s,idx:0,otherValue:g,value:m,label:"".concat(r.format(m,t)),pos:f,state:r})),b&&n.push(Rf({h:r.h,isVertical:i,align:w.align,style:e,rangeIdx:s,idx:1,otherValue:m,value:g,label:"".concat(r.format(g,t)),pos:p,state:r}))}}function Pf(e){const t=e.active.limitHigh-e.active.end,n=e.active.limitLow-e.active.start;let i=e.current-e.start;return i=i<0?Math.max(i,n):Math.min(i,t),i}function Lf(e){let t=[];const n=0===e.direction;if(Array.isArray(e.ranges)&&e.ranges.forEach(((i,r)=>{e.active&&r===e.active.idx||Of({borderHit:5,els:t,isVertical:n,state:e,vStart:Math.min(i.min,i.max),vEnd:Math.max(i.min,i.max),idx:r})})),e.active){let i=e.start,r=e.current;if(-1!==e.active.idx)if("foo"===e.active.mode)i=Math.min(e.active.start,e.active.end),r=Math.max(e.active.start,e.active.end);else if("modify"===e.active.mode)i=Math.min(e.start,e.current),r=Math.max(e.start,e.current);else{const t=Pf(e);i=e.active.start+t,r=e.active.end+t}Of({borderHit:5,els:t,isVertical:n,state:e,vStart:i,vEnd:r,idx:e.active.idx})}return t}function Tf(e){return{min:e.scale.min(),max:e.scale.max()}}function zf(e){return{min:0,max:e.direction?e.rect.width:e.rect.height}}function Ff(e,t,n){let i,r,o=e.ranges,a=-1;for(i=0;i<o.length;i++){if(o[i].min<=t&&t<=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(t<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"}),e.active=r}function jf(e){e.renderer.render(Lf(e))}function Vf(e,t){if(!t||!t.isActive())return[];const n=e.scale.data(),i=(n&&n.fields||[]).map((e=>e.id())),r=t.brushes().filter((e=>"range"===e.type&&-1!==i.indexOf(e.id)))[0];return r?r.brush.ranges():[]}function Bf(e,t){let n,i=1/0;const r=t.domain(),o=t.bandwidth()/2;for(let a=0;a<r.length;++a){const s=Math.abs(e-o-t(r[a]));s<i&&(i=s,n=r[a])}return n}function Hf(e,t){return Math.min(...e)<=Math.max(...t)&&Math.max(...e)>=Math.min(...t)}function $f(e){return ur(e.reduce(((e,t)=>(e.push(...cr(t.bounds)),e)),[]))}const Wf={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(e){this.start(e)},rangeMove(e){this.move(e)},rangeEnd(e){this.end(e)},rangeClear(e){this.clear(e)},bubbleStart(e){this.bubbleStart(e)}},created(){this.state={key:this.settings.key||"brush-range"}},beforeRender(e){this.state.rect=e.size.computedInner},renderRanges(){this.state.started||(this.state.ranges=Vf(this.state,this.state.brushInstance),this.state.active=null,jf(this.state))},render(e){const t=this.settings.settings;this.state.direction="vertical"===t.direction?0:1;const n=this.renderer.element().getBoundingClientRect(),i=this.state.rect[0===this.state.direction?"height":"width"];let r=Su(this.chart.scale(t.scale),i);const o=function(e){const t={targetRect:null,targetFillRect:null,scale:null,size:null},n=e.settings.settings,i=n.target&&(n.target.components||(n.target.component?[n.target.component]:[])).map((t=>e.chart.component(t))).filter((e=>!!e&&!!e.rect)),r=n.target&&n.target.selector?e.chart.findShapes(n.target.selector):[],o=n.target&&n.target.fillSelector?e.chart.findShapes(n.target.fillSelector):[];if(r.length>0){const i=$f(r);if(t.size=i[0===e.state.direction?"height":"width"],t.scale=Su(e.chart.scale(n.scale),t.size),t.targetRect=i,o.length>0){const e=$f(o);t.targetFillRect=e}}else if(i&&i.length>0){const n=i.slice(1).reduce(((e,t)=>({x0:Math.min(e.x0,t.rect.computedInner.x),y0:Math.min(e.y0,t.rect.computedInner.y),x1:Math.max(e.x1,t.rect.computedInner.x+t.rect.computedInner.width),y1:Math.max(e.y1,t.rect.computedInner.y+t.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});t.targetRect={x:n.x0-e.state.rect.x,y:n.y0-e.state.rect.y,width:n.x1-n.x0,height:n.y1-n.y0}}return t}(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=t,this.state.style=this.style,this.state.offset=n,this.state.brush="object"==typeof t.brush?t.brush.context:t.brush,this.state.brushInstance=this.chart.brush(this.state.brush),this.state.renderer=this.renderer,this.state.multi=!!t.multiple,this.state.h=e,this.state.onEditConfirmed=(e,t,n)=>{this.state.edit=null,function(e,t,n,i){let r=e.ranges.map((e=>({min:e.min,max:e.max})));const o=e.scale.min(),a=e.scale.max();r[t]={min:Math.max(o,Math.min(n,i)),max:Math.min(a,Math.max(n,i))},e.ranges[t]=ir({},r[t]);const s=e.scale.data();s&&s.fields&&s.fields.forEach((t=>{e.fauxBrushInstance||e.brushInstance.setRange(t.id(),r)}))}(this.state,e,t,n),this.emit("bubbleEnd"),jf(this.state)},this.state.onEditCanceled=()=>{this.state.edit=null,jf(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 t.bubbles.label&&((e,n)=>t.bubbles.label.call(void 0,{datum:e,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 t.brush&&t.brush.observe,this.state.fauxBrushInstance=null,this.state.findValues=null,this.state.scale=r;const e=this.state.scale.data();!this.state.format&&e&&e.fields&&e.fields[0]&&(this.state.format=e.fields[0].formatter())}else this.state.editable=!1,this.state.scale=Dc(),this.state.scale.data=r.data,this.state.format||(this.state.format=(e,t)=>Hf(r.range(),t)?function(e,t){const n=t.ticks(),i=t.domain().indexOf(Bf(e,t));return-1!==i?n[i].label:"-"}(e,r):"-"),this.state.fauxBrushInstance=hu(),this.state.findValues=e=>function(e,t){const n=t.domain(),i=t.range(),r=[];return e.forEach((e=>{if(!Hf(i,[e.min,e.max]))return;const o=n.indexOf(Bf(e.min,t)),a=n.indexOf(Bf(e.max,t));r.push.apply(r,n.slice(Math.min(o,a),Math.max(o,a)+1))})),r}(e,r);return this.state.ranges=Vf(this.state,this.state.brushInstance),this.state.observeBrush||this.state.sourcedFromThisComponent?[Lf(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(e){!function(e){let{state:t,e:n,renderer:i,ranges:r,targetSize:o}=e;if(t.started)return;t.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};t.offset=Qi({},i.element().getBoundingClientRect());const u=a-t.offset.left,h=s-t.offset.top;t.offset.left+=t.targetRect?t.targetRect.x:0,t.offset.top+=t.targetRect?t.targetRect.y:0,t.ranges=r(t,t.fauxBrushInstance||t.brushInstance);const d=n.center[t.cssCoord.coord]-n[t.cssCoord.pos]-t.offset[t.cssCoord.offset],f=n.center[t.cssCoord.coord]-t.offset[t.cssCoord.offset];c.current=t.scale.normInvert(f/t.size),c.start=t.scale.normInvert(d/t.size);let p=t.ranges;const m=Tf(t);let g,y,x=-1;if(l&&l.hasAttribute("data-idx"))x=parseInt(l.getAttribute("data-idx"),10),m.min=x>0?p[x-1].max:m.min,m.max=x+1<p.length?p[x+1].min:m.max;else{for(g=0;g<p.length;g++){if(p[g].min<=c.start&&c.start<=p[g].max){x=g,m.min=g?p[g-1].max:m.min,m.max=g+1<p.length?p[g+1].min:m.max;break}if(c.start<p[g].min){m.max=p[g].min,m.min=g?p[g-1].max:m.min;break}}-1===x&&p.length&&g>=p.length&&(m.min=p[p.length-1].max)}if(-1!==x||t.multi||(c.ranges=[],m.min=t.scale.min(),m.max=t.scale.max()),-1!==x)if(y={idx:x,start:p[x].min,end:p[x].max,limitLow:m.min,limitHigh:m.max,mode:"move"},l&&l.hasAttribute("data-other-value"))c.start=parseFloat(l.getAttribute("data-other-value")),y.mode="modify";else{let e=t.scale.norm(y.start)*t.size,n=t.scale.norm(y.end)*t.size;Math.abs(d-e)<=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:m.min,limitHigh:m.max,mode:"current"};c.active=y,"modify"!==y.mode&&t.targetRect&&!bh(t.targetRect,{x:u,y:h})||Object.keys(c).forEach((e=>t[e]=c[e]))}({e:e,state:this.state,renderer:this.renderer,ranges:Vf,targetSize:5})},end(){this.state.started&&(!function(e,t){e.started=!1,e.ranges=t(e,e.fauxBrushInstance||e.brushInstance);const n=Tf(e);Ff(e,e.current,n)}(this.state,Vf),jf(this.state),this.state.sourcedFromThisComponent=!0,this.state.active=null)},move(e){this.state.started&&(!function(e,t){const n=(t.center[e.cssCoord.coord]-e.offset[e.cssCoord.offset])/e.size,i=e.scale.normInvert(n);e.current=Math.max(Math.min(i,e.active.limitHigh),e.active.limitLow)}(this.state,e),function(e){let t=e.ranges.map((e=>({min:e.min,max:e.max})));if(-1!==e.active.idx)if("modify"===e.active.mode)t[e.active.idx].min=Math.min(e.start,e.current),t[e.active.idx].max=Math.max(e.start,e.current);else{const n=Pf(e);t[e.active.idx].min+=n,t[e.active.idx].max+=n}else t.push({min:Math.min(e.start,e.current),max:Math.max(e.start,e.current)});const n=e.scale.data();n&&n.fields&&n.fields.forEach((n=>{if(e.fauxBrushInstance){let i=Vf(e,e.fauxBrushInstance),r=e.findValues(i),o=e.findValues(t),a=o.filter((e=>-1===r.indexOf(e))),s=r.filter((e=>-1===o.indexOf(e))),l=a.map((e=>({key:n.id(),value:e}))),c=s.map((e=>({key:n.id(),value:e})));e.brushInstance.addAndRemoveValues(l,c),e.fauxBrushInstance.setRange(n.id(),t)}else e.brushInstance.setRange(n.id(),t)}))}(this.state),jf(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(e){if(!this.state.editable)return;const t=e.srcEvent||e,n=t.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,t.stopPropagation(),t.stopImmediatePropagation(),t.preventDefault();const r=n.parentNode;jf(this.state);const o=r.querySelector("input");o.focus(),o.select()}};function Uf(e){e.renderer.render(Lf(e))}function Yf(e){return e.rc.ranges()}function Gf(e,t){const n={x:e.direction?t.min+e.rect.x:e.rect.x,y:e.direction?e.rect.y:t.min+e.rect.y,width:e.direction?t.max-t.min:e.rect.width+e.rect.x,height:e.direction?e.rect.height+e.rect.y:t.max-t.min};return e.chart.shapesAt(n,e.settings.brush)}const Xf={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(e){this.start(e)},areaMove(e){this.move(e)},areaEnd(e){this.end(e)},areaClear(e){this.clear(e)}},created(){this.state={key:this.settings.key||"brush-area-dir"}},render(e){this.state.rect=this.rect;const t=this.settings.settings,n="vertical"===t.direction?0:1,i=this.state.rect[0===n?"height":"width"],r=this.renderer.element().getBoundingClientRect(),o=(t.target?t.target.components||[t.target.component]:[]).map((e=>this.chart.component(e))).filter((e=>!!e&&!!e.rect)),a=o[0]?o.slice(1).reduce(((e,t)=>({x0:Math.min(e.x0,t.rect.x),y0:Math.min(e.y0,t.rect.y),x1:Math.max(e.x1,t.rect.x+t.rect.width),y1:Math.max(e.y1,t.rect.y+t.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=t,this.state.offset=r,this.state.rc=Qc(),this.state.renderer=this.renderer,this.state.multi=!!t.multiple,this.state.h=e,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(e,t){return function(e,t,n){const i=Math.min(...n),r=Math.max(...n),o={x:e.direction?i+e.rect.x:e.rect.x,y:e.direction?e.rect.y:i+e.rect.y,width:e.direction?r-i:e.rect.width+e.rect.x,height:e.direction?e.rect.height+e.rect.y:r-i},a=e.chart.shapesAt(o,e.settings.brush);if(0===a.length)return"-";const s=a.reduce(((n,r)=>{const o=n.bounds,a=r.bounds;return t===i?o[e.cssCoord.coord]<=a[e.cssCoord.coord]?n:r:o[e.cssCoord.coord]+o[e.cssCoord.area]>=a[e.cssCoord.coord]+a[e.cssCoord.area]?n:r})),l=e.settings.brush.components.reduce(((e,t)=>e.key===s.key?e:t));return"function"==typeof e.settings.bubbles.label?e.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,e,t)},[]},start(e){!function(e){let{state:t,e:n,renderer:i,ranges:r,targetSize:o}=e;if(t.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};t.offset=i.element().getBoundingClientRect(),t.ranges=r(t);const u=a-t.offset.left,h=s-t.offset.top,d=n.center[t.cssCoord.coord]-n[t.cssCoord.pos]-t.offset[t.cssCoord.offset],f=n.center[t.cssCoord.coord]-t.offset[t.cssCoord.offset];let p=f,m=d;c.start=d,c.current=f;let g=t.ranges;const y=zf(t);let x,v,b=-1;if(l&&l.hasAttribute("data-idx"))b=parseInt(l.getAttribute("data-idx"),10),y.min=b>0?g[b-1].max:y.min,y.max=b+1<g.length?g[b+1].min:y.max;else{for(x=0;x<g.length;x++){if(g[x].min<=m&&m<=g[x].max){b=x,y.min=x?g[x-1].max:y.min,y.max=x+1<g.length?g[x+1].min:y.max;break}if(m<g[x].min){y.max=g[x].min,y.min=x?g[x-1].max:y.min;break}}-1===b&&g.length&&x>=g.length&&(y.min=g[g.length-1].max)}if(-1!==b||t.multi||(c.ranges=[],y.min=0,y.max=t.direction?t.rect.width:t.rect.height),-1!==b)if(v={idx:b,start:g[b].min,end:g[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 e=v.start,t=v.end;Math.abs(d-e)<=o?(c.start=v.end,v.mode="modify"):Math.abs(d-t)<=o&&(c.start=v.start,v.mode="modify")}else v={idx:-1,start:m,end:p,limitLow:y.min,limitHigh:y.max,mode:"current"};c.active=v,"modify"!==v.mode&&t.targetRect&&!bh(t.targetRect,{x:u,y:h})||Object.keys(c).forEach((e=>t[e]=c[e]))}({e:e,state:this.state,renderer:this.renderer,ranges:Yf,targetSize:5})},end(){this.state.started&&(!function(e,t){e.started=!1,e.ranges=t(e);const n=zf(e);Ff(e,e.current,n)}(this.state,Yf),Uf(this.state))},move(e){this.state.started&&(!function(e,t){const n=t.center[e.cssCoord.coord]-e.offset[e.cssCoord.offset];e.current=Math.max(Math.min(n,e.active.limitHigh),e.active.limitLow)}(this.state,e),function(e){const t=e.ranges.map((e=>({min:e.min,max:e.max})));if(-1!==e.active.idx)if("modify"===e.active.mode)t[e.active.idx].min=Math.min(e.start,e.current),t[e.active.idx].max=Math.max(e.start,e.current);else{const n=Pf(e);t[e.active.idx].min=e.active.start+n,t[e.active.idx].max=e.active.end+n}else t.push({min:Math.min(e.start,e.current),max:Math.max(e.start,e.current)});e.rc.set(t);let n=[];t.forEach((t=>{n=[...n,...Gf(e,t)]})),function(e,t){e.chart.brushFromShapes(t,e.settings.brush)}(e,n)}(this.state),Uf(this.state))},clear(){this.state.rc&&this.state.rc.clear(),this.state.renderer.render([])}};function Kf(e){const t="vertical"===e.direction,n=e.rect[t?"height":"width"],i=e.rect[t?"width":"height"];return function(e){const t=e.brush;if(!t||!t.isActive())return[];const n=e.scale.data(),i=(n&&n.fields||[]).map((e=>e.id())),r=t.brushes().filter((e=>"range"===e.type&&-1!==i.indexOf(e.id)))[0];return r?r.brush.ranges():[]}(e).map((r=>{const o=e.scale(r.min)*n,a=e.scale(r.max)*n,s=Math.min(o,a),l=Math.abs(o-a);return{type:"rect",fill:e.fill,opacity:e.opacity,x:t?0:s,width:t?i:l,y:t?s:0,height:t?l:i}}))}function Zf(e,t,n,i){function r(){!function(e){e.renderer.render(Kf(e))}(e)}function o(){!function(e){e.renderer.render(Kf(e))}(e)}function a(){!function(e){e.renderer.render(Kf(e))}(e)}e.brush=t,t&&(t.on("start",r),t.on("update",o),t.on("end",a),e.start=r,e.update=o,e.end=a,e.brush=t,e.scale=n,e.renderer=i)}function Jf(e){e.brush&&(e.brush.removeListener("start",e.start),e.brush.removeListener("update",e.update),e.brush.removeListener("end",e.end)),e.start=void 0,e.update=void 0,e.end=void 0,e.brush=void 0,e.scale=void 0,e.renderer=void 0}const Qf={require:["chart","settings","renderer"],defaultSettings:{settings:{}},preferredSize:()=>50,created(){this.state={}},render(){const e=this.settings.settings,t=this.chart.brush(e.brush),n=e.direction||"horizontal",i="horizontal"===n?this.rect.width:this.rect.height,r=Su(this.chart.scale(e.scale),i);return Jf(this.state),Zf(this.state,t,r,this.renderer),this.state.rect=this.rect,this.state.fill=e.fill||"#ccc",this.state.opacity=void 0!==e.opacity?e.opacity:1,this.state.direction=n,Kf(this.state)},beforeDestroy(){Jf(this.state)}};function ep(e,t){const n=t.center.x,i=t.center.y;return{x:n-e.left,y:i-e.top}}function tp(e,t,n){return Bu(e,t.points[0])<n.settings.snapIndicator.threshold**2}function np(e,t){null==e.path.d?e.path.d="M".concat(t.x," ").concat(t.y," "):e.path.d+="L".concat(t.x," ").concat(t.y," "),e.points.push(t)}function ip(e){let{state:t,start:n=null,end:i=null}=e;null!==n&&(t.snapIndicator.x1=n.x,t.snapIndicator.y1=n.y),null!==i&&(t.snapIndicator.x2=i.x,t.snapIndicator.y2=i.y)}function rp(e,t){e.snapIndicator.visible=t}const op={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(e){this.start(e)},lassoEnd(e){this.end(e)},lassoMove(e){this.move(e)},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(e){var t;this.state.active=!0,this.state.path={visible:!0,type:"path",d:null,fill:(t=this.settings.settings.lasso).fill,stroke:t.stroke,strokeWidth:t.strokeWidth,opacity:t.opacity,strokeDasharray:t.strokeDasharray,collider:{type:null}},this.state.snapIndicator=function(e){return{visible:!1,type:"line",x1:0,y1:0,x2:0,y2:0,strokeDasharray:e.strokeDasharray,stroke:e.stroke,strokeWidth:e.strokeWidth,opacity:e.opacity,collider:{type:null}}}(this.settings.settings.snapIndicator),this.state.startPoint=function(e){return{visible:!0,type:"circle",cx:0,cy:0,r:e.r,fill:e.fill,opacity:e.opacity,stroke:e.stroke,strokeWidth:e.strokeWidth,collider:{type:null}}}(this.settings.settings.startPoint),this.state.rendererBounds=this.renderer.element().getBoundingClientRect(),this.state.componentDelta=function(e,t){const n=e.element.getBoundingClientRect();return{x:t.left-n.left,y:t.top-n.top}}(this.chart,this.state.rendererBounds),this.state.brushConfig=this.settings.settings.brush.components.map((e=>({key:e.key,contexts:e.contexts||["lassoBrush"],data:e.data||[""],action:e.action||"add"})));const n=ep(this.state.rendererBounds,e);np(this.state,n),ip({state:this.state,start:n}),function(e,t){e.startPoint.cx=t.x,e.startPoint.cy=t.y}(this.state,n)},move(e){if(!this.state.active)return;const t=ep(this.state.rendererBounds,e);tp(t,this.state,this.settings)?rp(this.state,!0):rp(this.state,!1),np(this.state,t),ip({state:this.state,end:t}),function(e,t){const n=[e.startPoint,e.path,e.snapIndicator].filter((e=>e.visible));t.render(n)}(this.state,this.renderer),function(e,t){if(e.active){const n=e.points[e.points.length-2],i=e.points[e.points.length-1];e.lineBrushShape.x1=n.x+e.componentDelta.x,e.lineBrushShape.y1=n.y+e.componentDelta.y,e.lineBrushShape.x2=i.x+e.componentDelta.x,e.lineBrushShape.y2=i.y+e.componentDelta.y;const r=t.shapesAt(e.lineBrushShape,{components:e.brushConfig});t.brushFromShapes(r,{components:e.brushConfig})}}(this.state,this.chart)},end(e){if(!this.state.active)return;rp(this.state,!1);tp(ep(this.state.rendererBounds,e),this.state,this.settings)&&function(e,t){if(e.active){const n=e.componentDelta.x,i=e.componentDelta.y,r=e.points.map((e=>({x:e.x+n,y:e.y+i}))),o=t.shapesAt({vertices:r},{components:e.brushConfig});t.brushFromShapes(o,{components:e.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 e,t;this.state.active&&(e=this.state,t=this.chart,e.brushConfig.forEach((e=>{e.contexts.forEach((e=>{t.brush(e).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 ap(e,t,n,i,r){let o,a=0,s=t.length-1;for(;a<s;){let l=Math.floor((a+s)/2);o=r(t[l]),o[n]+o[i]<e[n]?a=l+1:s=l}return a}function sp(e){let{orientation:t,targetNodes:n,labels:i,container:r}=e,o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:ap;const a=[],s="v"===t?"x":"y",l="v"===t?"width":"height",c=e=>e.textBounds,u=e=>e.node.localBounds;return(e,t)=>{const{textBounds:h,node:d}=i[t];if(h[s]<r[s]||h[s]+h[l]>r[s]+r[l])return!1;for(let e=o(h,a,s,l,c);e<a.length;e++)if(xh(h,a[e].textBounds))return!1;const f=o(h,n,s,l,u),p=h[s]+h[l];for(let e=f;e<n.length;e++){const t=n[e].node;if(p<t.localBounds[s])break;if(xh(h,t.localBounds)&&d!==t)return!1}return a.push(i[t]),!0}}const lp=4;function cp(e,t){return{node:e,data:e.data,scale:t.scale,formatter:t.formatter,dataset:t.dataset}}function up(e){const t=typeof e;return("string"===t||"number"===t)&&""!==e}function hp(e){return ir(ir({type:"rect",rx:2,ry:2,fill:e.backgroundColor},e.backgroundBounds),{},{data:"".concat(e.data," ").concat(e.text),rotation:e.transform&&e.transform.match(/rotate/gi)?"rotated":"horizontal"})}function dp(e,t,n){return n?e.width>=t.height:e.width>=t.width}function fp(e,t,n){return n?e.height>=t.width:e.height>=t.height}function pp(e,t,n,i,r){let o,a;return"v"===e?(o=i||r||dp(t,n,!0),a=fp(t,n,!i)):(o=dp(t,n),a=r||fp(t,n,!1)),o&&a}function mp(e,t,n,i){return e+.5*t+(i-.5)*(t-n)-.5*n}function gp(e,t,n){const i={type:"text",text:t,maxWidth:n.rotate?e.height:e.width,x:0,y:e.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(e,t,n){return dp(e,t,n.rotate)&&fp(e,t,n.rotate)}(e,r,n))return!1;const o=.5*r.height;return n.rotate?(i.x=mp(e.x,e.width,r.height,n.align)+o,i.y=mp(e.y,e.height,r.width,n.justify),i.transform="rotate(-90, ".concat(i.x+i.dx,", ").concat(i.y+i.dy,")")):(i.x=mp(e.x,e.width,r.width,n.align),i.y=mp(e.y,e.height,r.height,n.justify)+o),i}function yp(e){let{bar:t,view:n,direction:i,position:r,padding:o=lp,measured:a}=e;const s={};if(Qi(s,t),r&&"inside"!==r)if("up"===i||"down"===i){const e=Math.max(0,Math.min(t.y,n.height)),o=Math.max(0,Math.min(t.y+t.height,n.height));"outside"===r&&"up"===i||"opposite"===r&&"down"===i?(s.y=0,s.height=e):("outside"===r&&"down"===i||"opposite"===r&&"up"===i)&&(s.y=o,s.height=n.height-o)}else{const e=Math.max(0,Math.min(t.x,n.width)),o=Math.max(0,Math.min(t.x+t.width,n.width));"outside"===r&&"left"===i||"opposite"===r&&"right"===i?(s.x=0,s.width=e):("outside"===r&&"right"===i||"opposite"===r&&"left"===i)&&(s.x=o,s.width=n.width-o)}else;return function(e,t){const n=Math.max(0,Math.min(e.y,t.height)),i=Math.max(0,Math.min(e.y+e.height,t.height)),r=Math.max(0,Math.min(e.x,t.width)),o=Math.max(0,Math.min(e.x+e.width,t.width));e.x=r,e.width=o-r,e.y=n,e.height=i-n}(s,n),function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const{top:i=lp,bottom:r=lp,left:o=lp,right:a=lp}=n,s="function"==typeof o?o(t):o,l="function"==typeof a?a(t):a,c="function"==typeof i?i(t):i,u="function"==typeof r?r(t):r;e.x+=s,e.width-=s+l,e.y+=c,e.height-=c+u}(s,a,o),s}function xp(e){let t,n,i,r,o,{direction:a,fitsHorizontally:s,measured:l,node:c,orientation:u,placementSettings:h,rect:d}=e,f=arguments.length>1&&void 0!==arguments[1]?arguments[1]:yp;const p=[],m="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),t=!o||r[m]>t[m]?r:t,pp(u,r,l,s,i.overflow)){n=r;break}return n||(n=t,o=p.indexOf(n)),i=h[o],{bounds:n,placement:i}}function vp(e,t,n,i){let r=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{};const{top:o=lp,bottom:a=lp,left:s=lp,right:l=lp}=r,c="function"==typeof s?s(t):s,u="function"==typeof l?l(t):l,h="function"==typeof o?o(t):o,d="function"==typeof a?a(t):a,f=e.x+e.dx,p=e.y+e.dy,m=n?Math.min(t.width,i.height):Math.min(t.height,i.width),g=n?Math.min(t.height,i.height):Math.min(t.width,i.width),y=.5*t.height,x=1e-9;return{x:(n?f-y:f)-c-x,y:(n?p:p-y)-h-x,width:g+(c+u)-x,height:m+(h+d)-x}}function bp(e){let{chart:t,targetNodes:n,rect:i,fitsHorizontally:r,collectiveOrientation:o}=e,a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:xp,s=arguments.length>2&&void 0!==arguments[2]?arguments[2]:gp,l=arguments.length>3&&void 0!==arguments[3]?arguments[3]:sp;const c=[],u={container:i,targetNodes:n,labels:[],orientation:o};let h,d,f,p,m,g,y,x,v,b,w,M,k,S;for(let e=0,l=n.length;e<l;e++){g=null,d=n[e],f=d.node,k=cp(f,t),v=d.direction,S="left"===v||"right"===v?"h":"v";for(let t=0;t<d.texts.length;t++){if(p=d.texts[t],!up(p))continue;b=d.labelSettings[t],x=d.measurements[t],M=b.placements;const n=a({direction:v,fitsHorizontally:r,lblStngs:b,measured:x,node:f,orientation:S,placements:M,placementSettings:d.placementSettings[t],rect:i});if(g=n.bounds,w=n.placement,g&&w){m=w.justify;const t="function"==typeof b.linkData?b.linkData(k,e):void 0,n="function"==typeof w.overflow?w.overflow(k,e):w.overflow;"up"===v&&(m=1-m),"opposite"===w.position&&(m=1-m),"left"===v&&(m=1-m);const i=!("h"===o||r);if(h=s(g,p,{justify:"h"===S?w.align:m,align:"h"===S?m:w.align,fontSize:b.fontSize,fontFamily:b.fontFamily,textMetrics:x,rotate:i,overflow:!!n}),h){const n=vp(h,x,i,g,w.padding);y="function"==typeof w.fill?w.fill(ir(ir({},k),{},{textBounds:n}),e):w.fill,h.fill=y,void 0!==t&&(h.data=t),"object"==typeof w.background&&(h.backgroundColor="function"==typeof w.background.fill?w.background.fill(ir(ir({},k),{},{textBounds:n}),e):w.background.fill,void 0!==h.backgroundColor&&(h.backgroundBounds=vp(h,x,i,g,w.background.padding))),c.push(h),u.labels.push({node:f,textBounds:n})}}}}const _=c.filter(l(u));return[..._.filter((e=>void 0!==e.backgroundBounds)).map(hp),..._]}function wp(e){const t=2*Math.PI;return(e%t+t)%t}function Mp(e,t){e.x+=t,e.width-=2*t,e.y+=t,e.height-=2*t}function kp(e){return{x:e.x,y:e.y-e.height/2,width:e.width,height:e.height}}function Sp(e,t,n){let{x:i,y:r}=t;if(i*i+r*r>e*e)return null;let o=Math.sin(n),a=Math.cos(n),s=i*a-r*o,l=e*e-s*s;if(l<0)return null;let c=Math.sqrt(l);return{x:s*a+o*c,y:-s*o+a*c}}function _p(e){let t,n,{radius:i,size:r,angle:o}=e,{width:a,height:s}=r,l={x:a/2,y:s/2};switch(Math.floor(o/(Math.PI/2))){case 0:if(t=Sp(i,l,o),!t)return null;t.y*=-1,n={x:-a,y:0};break;case 1:if(t=Sp(i,l,Math.PI-o),!t)return null;n={x:-a,y:-s};break;case 2:if(t=Sp(i,l,o-Math.PI),!t)return null;t.x*=-1,n={x:0,y:-s};break;case 3:if(t=Sp(i,l,2*Math.PI-o),!t)return null;t.x*=-1,t.y*=-1,n={x:0,y:0};break;default:throw new Error("invalid angle")}return{x:t.x+n.x,y:t.y+n.y,width:a,height:s}}function qp(e){let{slice:t,measured:n,padding:i}=e,{start:r,end:o,innerRadius:a,outerRadius:s}=t,l=s-a-2*i,c=o-r;if(c<Math.PI){let e=(n.height/2+i)/Math.tan(c/2);e>a&&(l=s-e-2*i)}if(l<0||l<n.minReqWidth)return null;const u=wp((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 Dp(e){let{context:t,node:n,bounds:i}=e;let{start:r,end:o}=n.desc.slice;const a=wp((r+o)/2);switch(Math.floor(a/(Math.PI/2))){case 0:t.q1maxY=i.y-2,void 0===t.q2minY&&(t.q2minY=i.y+i.height+2);break;case 1:t.q2minY=i.y+i.height+2;break;case 2:t.q3minY=i.y+i.height+2;break;case 3:t.q4maxY=i.y-2,void 0===t.q3minY&&(t.q3minY=i.y+i.height+2)}}function Ap(e,t){return{node:e,data:e.data,scale:t.scale,formatter:t.formatter,dataset:t.dataset}}function Cp(e,t,n){const i={type:"text",text:t,maxWidth:e.width,x:e.x,y:e.y+("top"===e.baseline?e.height/2:0),fill:n.fill,anchor:e.anchor||"start",baseline:"middle",fontSize:"".concat(n.fontSize,"px"),fontFamily:n.fontFamily};if(!isNaN(e.angle)){let t=e.angle*(360/(2*Math.PI));i.transform="rotate(".concat(t,", ").concat(i.x,", ").concat(i.y,")")}return i}function Np(e){let t,n,{slice:i,direction:r,position:o,padding:a,measured:s,view:l,context:c,store:u}=e,{start:h,end:d,innerRadius:f,offset:p}=i;switch(o){case"into":t="rotate"===r?qp({slice:i,measured:s,padding:a}):function(e){let{slice:t,padding:n,measured:i}=e,{start:r,end:o,innerRadius:a,outerRadius:s}=t;const l=wp((r+o)/2);let c=_p({radius:s,size:{width:i.width+2*n+1,height:i.height+2*n},angle:l});return c?(c.baseline="top",wh(c,{x1:0,y1:0,x2:Math.sin(r)*s,y2:-Math.cos(r)*s})||wh(c,{x1:0,y1:0,x2:Math.sin(o)*s,y2:-Math.cos(o)*s})||dh({cx:0,cy:0,r:a},c)?null:(Mp(c,n),c)):null}({slice:i,measured:s,padding:a});break;case"inside":n={start:h,end:d,innerRadius:0,outerRadius:f},t="rotate"===r?qp({slice:n,measured:s,padding:a}):function(e){let{slice:t,padding:n,measured:i,store:r}=e;const{start:o,end:a,outerRadius:s}=t,l=wp((o+a)/2);let c=_p({radius:s,size:{width:i.width+2*n+1,height:i.height+2*n},angle:l});return c?(c.baseline="top",Mp(c,n),r.insideLabelBounds.some((e=>xh(e,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":t="rotate"===r?function(e){let{slice:t,measured:n,padding:i,view:r}=e,{start:o,end:a,outerRadius:s,offset:l}=t,c=s+i,u=a-o;if(u<Math.PI&&(n.height/2+i)/Math.tan(u/2)>c)return null;const h=wp((o+a)/2);let d=Math.sin(h)*c,f=-Math.cos(h)*c,p=n.width+1,m=h%Math.PI;if(m>Math.PI/2&&(m=Math.PI-m),Math.cos(m)>.001){let e=f<0?r.y:r.y+r.height,t=Math.abs(e-l.y)/Math.cos(m)-Math.tan(m)*(n.height/2)-2*i-s;t<p&&(p=t)}if(Math.sin(m)>.001){let e=d<0?r.x:r.x+r.width,t=Math.abs(e-l.x)/Math.sin(m)-n.height/2/Math.tan(m)-2*i-s;t<p&&(p=t)}if(p<=0||p<n.minReqWidth)return null;let g={x:d,y:f,width:p,height:n.height};return h<Math.PI?(g.angle=h-Math.PI/2,g.anchor="start"):(g.angle=h+Math.PI/2,g.anchor="end"),g}({slice:i,measured:s,padding:a,view:l}):function(e){let{slice:t,measured:n,padding:i,view:r,context:o}=e,{start:a,end:s,outerRadius:l,offset:c}=t;const u=wp((a+s)/2);if(function(e,t,n){switch(t){case 0:return e.q1maxY<0;case 1:return e.q2minY>n.height;case 2:return e.q3minY>n.height;case 3:return e.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 e=Math.abs(r.x+r.width-(d+c.x));e<p&&(p=e)}else{let e=Math.abs(r.x-(d+c.x));e<p&&(p=e)}if(p<n.minReqWidth)return null;let m={x:d,y:f,width:p,height:n.height};return u<Math.PI?m.anchor="start":m.anchor="end",m}({slice:i,measured:s,padding:a,view:l,context:c});break;default:throw new Error("not implemented")}return t&&(t.x+=p.x,t.y+=p.y,"outside"===o&&"rotate"!==r&&function(e,t,n){const{start:i,end:r,offset:o,outerRadius:a}=n,s=wp((i+r)/2);switch(Math.floor(s/(Math.PI/2))){case 0:if(void 0!==t.q1maxY){let n=Math.min(e.y,t.q1maxY-e.height),i=e.y-n;if(e.y=n,i>1){let t=a+2;e.line={type:"line",x1:e.x-2,y1:e.y+2,x2:o.x+Math.sin(s)*t,y2:o.y-Math.cos(s)*t,strokeWidth:1}}}break;case 1:if(void 0!==t.q2minY){let n=Math.max(e.y,t.q2minY),i=n-e.y;if(e.y=n,i>1){let t=a+2;e.line={type:"line",x1:e.x-2,y1:e.y-2,x2:o.x+Math.sin(s)*t,y2:o.y-Math.cos(s)*t,strokeWidth:1}}}break;case 2:if(void 0!==t.q3minY){let n=Math.max(e.y,t.q3minY),i=n-e.y;if(e.y=n,i>1){let t=a+2;e.line={type:"line",x1:e.x+2,y1:e.y-2,x2:o.x+Math.sin(s)*t,y2:o.y-Math.cos(s)*t,strokeWidth:1}}}break;case 3:if(void 0!==t.q4maxY){let n=Math.min(e.y,t.q4maxY-e.height),i=e.y-n;if(e.y=n,i>1){let t=a+2;e.line={type:"line",x1:e.x+2,y1:e.y+2,x2:o.x+Math.sin(s)*t,y2:o.y-Math.cos(s)*t,strokeWidth:1}}}}}(t,c,i)),t}function Ep(e){let{context:t,direction:n,measured:i,node:r,placementSettings:o,rect:a,store:s}=e,l=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Np;for(let e=0;e<o.length;e++){let c=o[e],u=l({context:t,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 Rp(e,t,n){const i=t.fontFamily,r="".concat(t.fontSize,"px"),o=n.measureText({text:e,fontFamily:i,fontSize:r});return o.minReqWidth=Math.min(o.width,n.measureText({text:"".concat(e[0],"…"),fontFamily:i,fontSize:r}).width),o}const Ip=/\n+|\r+|\r\n/,Op=/\s/,Pp=/[a-zA-Z\u00C0-\u00F6\u00F8-\u00FF\u00AD]/;function Lp(e){return"string"==typeof e?-1!==e.search(Ip):-1!==String(e).search(Ip)}function Tp(e){return-1!==e.search(Op)}function zp(e){return-1!==e.search(Pp)}function Fp(e,t,n){return Math.max(t,Math.min(n,e))}function jp(){let{string:e,separator:t="",reverse:n=!1,measureText:i=e=>({width:e.length,height:1}),mandatoryBreakIdentifiers:r=[Lp],noBreakAllowedIdentifiers:o=[],suppressIdentifier:a=[Tp,Lp,e=>""===e],hyphenationIdentifiers:s=[zp]}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const l=String(e).split(t);!function(e){""===e[0]&&e.shift(),""===e[e.length-1]&&e.pop()}(l);const c=l.length,u=n?e=>e>=0:e=>e<c;let h=n?c:-1;function d(e){const t=Fp(e,0,c-1),n=l[t],u=i(n),h=function(e,t,n,i,r){return i.some((i=>i(e,t,n)))?1:r.some((i=>i(e,t,n)))?0:2}(n,t,l,r,o);return{index:t,value:n,breakOpportunity:h,suppress:a.some((e=>e(n,t,l))),hyphenation:s.some((e=>e(n,t,l))),width:u.width,height:u.height,done:!1}}return{next:function(e){return isNaN(e)?n?h--:h++:h=Fp(e,0,c-1),u(h)?d(h):{done:!0}},peek:d,length:c}}const Vp="…",Bp=/^\s*\d+(\.\d+)?px\s*$/i;function Hp(e){return"string"===typeof e&&Bp.test(e)}function $p(e){const t=e["font-size"]||e.fontSize;return Hp(t)?parseFloat(t)*Math.max(isNaN(e.lineHeight)?1.2:e.lineHeight,0):19.2}function Wp(e){const t=e.maxHeight,n=Math.max(e.maxLines,1)||1/0;if(isNaN(t))return n;const i=$p(e);return Math.max(1,Math.min(Math.floor(t/i),n))}function Up(e,t){return{lines:[],line:"",width:0,maxLines:Wp(e),maxWidth:e.maxWidth,hyphens:{enabled:"auto"===e.hyphens,char:"‐",metrics:t("‐")}}}function Yp(e){e.lines.push(e.line),e.line="",e.width=0}function Gp(e,t){e.line+=t.value,e.width+=t.width}function Xp(e,t,n){if(t.width>e.maxWidth)return t;const i=t.index;for(let r=1;r<5;r++){const o=n.peek(t.index-1);if(!t.hyphenation||!o.hyphenation||0===t.index)return t;if(e.width+e.hyphens.metrics.width<=e.maxWidth)return e.line+=e.hyphens.char,t;if(1===e.line.length)return t;t=n.next(i-r),e.line=e.line.slice(0,-1),e.width-=t.width}return t}function Kp(e,t,n){const i=jp({string:t.value,measureText:n});for(;e.lines.length<e.maxLines;){let t=i.next();if(t.done)break;e.width+t.width>e.maxWidth&&2===t.breakOpportunity&&e.line.length>0?(t=e.hyphens.enabled?Xp(e,t,i):t,Yp(e),Gp(e,t)):Gp(e,t)}}function Zp(e,t){const n=jp({string:e.text,separator:"",measureText:t,noBreakAllowedIdentifiers:[(e,t)=>0===t]}),i=Up(e,t);let r=!0;for(;i.lines.length<i.maxLines;){let e=n.next();if(e.done){Yp(i),r=!1;break}1===e.breakOpportunity?Yp(i):i.width+e.width>i.maxWidth&&2===e.breakOpportunity?e.suppress?i.width+=e.width:(e=i.hyphens.enabled?Xp(i,e,n):e,Yp(i),Gp(i,e)):Gp(i,e)}return{lines:i.lines,reduced:r}}function Jp(e,t){const n=jp({string:e.text,separator:/(\s|-|\u2010)/,measureText:t}),i=Up(e,t);let r=!0;for(;i.lines.length<i.maxLines;){let e=n.next();if(e.done){Yp(i),r=!1;break}1===e.breakOpportunity?Yp(i):i.width+e.width>i.maxWidth&&2===e.breakOpportunity?e.suppress?Yp(i):e.width>i.maxWidth?Kp(i,e,t):(Yp(i),Gp(i,e)):Gp(i,e)}return{lines:i.lines,reduced:r}}function Qp(e){return{"break-all":Zp,"break-word":Jp}[e.wordBreak]}function em(e){return t=>{const n=t.node;if(function(e){return"text"===e.type&&!e._lineBreak}(n)){const i=Qp(n);if(!i)return;const r=e(n);if(r.width>n.maxWidth||Lp(n.text)){const o=($p(n)-r.height)/2,a=i(n,function(e,t){return n=>t({text:n,fontSize:e.fontSize,fontFamily:e.fontFamily})}(n,e));t.node=function(e,t,n,i){const r={type:"container",children:[]};void 0!==t.id&&(r.id=t.id);let o=0;return e.lines.forEach(((a,s)=>{const l=Qi({},t);l.text=a,l._lineBreak=!0,o+=n,e.reduced&&s===e.lines.length-1?l.text+=Vp: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 tm(e,t){const n=e["font-family"]||e.fontFamily,i=e["font-size"]||e.fontSize,r="string"==typeof e.text?e.text:"".concat(e.text),{maxWidth:o}=e;if(void 0===o)return r;let a=t({text:r,fontSize:i,fontFamily:n}).width;if(a<=o)return r;let s=0,l=r.length-1;for(;s<=l;){let e=Math.floor((s+l)/2);a=t({text:r.substr(0,e)+Vp,fontSize:i,fontFamily:n}).width,a<=o?s=e+1:l=e-1}return r.substr(0,l)+Vp}function nm(e){const t=e.baseline||e["dominant-baseline"];let n=0;const i=parseInt(e.fontSize||e["font-size"],10)||0;switch(t){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 im={},rm={},om={fontSize:void 0,fontFamily:void 0};let am;function sm(e,t){return!e&&!t||e===t}function lm(e){let{text:t,fontWeight:n,fontSize:i,fontFamily:r}=e;const o="".concat(t," ").concat(n," ").concat(i," ").concat(r);return"number"!=typeof rm[o]&&(am=am||document.createElement("canvas").getContext("2d"),function(e){let{fontWeight:t,fontSize:n,fontFamily:i}=e;sm(om.fontWeight,t)&&sm(om.fontSize,n)&&sm(om.fontFamily,i)||(am.font=[t,n,i].filter((e=>!!e)).join(" "),om.fontWeight=t,om.fontSize=n,om.fontFamily=i)}({fontWeight:n,fontSize:i,fontFamily:r}),rm[o]=am.measureText(t).width),rm[o]}function cm(e){return"number"!=typeof im[e]&&(im[e]=function(e){if(Hp(e)){const t=parseFloat(e);return t+4*Math.ceil((t+1e-12)/24)}return 16}(e)),im[e]}function um(e){let{text:t,fontWeight:n,fontSize:i,fontFamily:r}=e;return{width:lm({text:t,fontWeight:n,fontSize:i,fontFamily:r}),height:cm(i)}}function hm(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:um;const n=e["font-size"]||e.fontSize,i=e["font-family"]||e.fontFamily,r=t({text:e.text,fontFamily:i,fontSize:n}),o=Math.min(e.maxWidth||r.width,r.width),a=e.x||0,s=e.y||0,l=e.dx||0,c={x:0,y:s+((e.dy||0)+nm(e))-.75*r.height,width:o,height:r.height},u=e["text-anchor"]||e.anchor;return c.x="middle"===u?a+l-o/2:"end"===u?a+l-o:a+l,c}function dm(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:um;const n=Qp(e),i=e["font-size"]||e.fontSize,r=e["font-family"]||e.fontFamily,o=t({text:e.text,fontFamily:r,fontSize:i});if(n&&(o.width>e.maxWidth||Lp(e.text))){const o=n(e,(e=>t({text:e,fontFamily:r,fontSize:i}))),a=Qi({},e);let s=0,l="";for(let e=0,n=o.lines.length;e<n;e++){let a=o.lines[e];a+=e===n-1&&o.reduced?Vp:"";const c=t({text:a,fontSize:i,fontFamily:r}).width;c>=s&&(s=c,l=a)}a.text=l;const c=hm(a,t);return c.height=$p(e)*o.lines.length,c}return hm(e,t)}function fm(e,t){return{node:e,data:e.data,scale:t.scale,formatter:t.formatter,dataset:t.dataset}}function pm(e,t,n){const i={type:"text",text:t,maxWidth:e.width,x:0,y:e.y,dx:0,dy:0,fill:n.fill,anchor:"start",baseline:"alphabetical",fontSize:"".concat(n.fontSize,"px"),fontFamily:n.fontFamily},r=n.textMetrics;if(e.width<n.fontSize)return!1;const o=Math.max(0,e.width-r.width);return i.x=e.x+n.align*o,i.y=e.y+r.height/1.2,i}function mm(e){let{cx:t,cy:n,r:i}=e;return{type:"circle",bounds:{cx:t,cy:n,r:i}}}function gm(e){return e.desc&&e.desc.slice?function(e){let{start:t,end:n,innerRadius:i,outerRadius:r,offset:o}=e;if(Math.abs(t+2*Math.PI-n)>1e-12)return{type:null,bounds:null};let a=0!==i?i:r;return mm({cx:o.x,cy:o.y,r:a})}(e.desc.slice):"circle"===e.type?mm(e.attrs):"rect"===e.type?{type:"rect",bounds:e.bounds}:{type:null,bounds:null}}var ym={bar:function(e){let{settings:t,chart:n,nodes:i,rect:r,renderer:o,style:a}=e,s=arguments.length>1&&void 0!==arguments[1]?arguments[1]:bp;const l=Qi({fontSize:12,fontFamily:"Arial",align:.5,justify:0,fill:"#333"},a.label);l.fontSize=parseInt(l.fontSize,10);const c=t.labels.map((e=>Qi({},l,t,e))),u=t.labels.map((e=>e.placements.map((n=>Qi({},l,t,e,n))))),{fitsHorizontally:h,hasHorizontalDirection:d,targetNodes:f}=function(e){let{nodes:t,rect:n,chart:i,labelSettings:r,placementSettings:o,settings:a,renderer:s}=e;const l={},c=[];let u,h,d,f,p,m,g,y=!0,x=!1;for(let e=0;e<t.length;e++){if(h=t[e],f=h.localBounds,!xh(f,n))continue;let v=cp(h,i);u={node:h,texts:[],measurements:[],labelSettings:[],placementSettings:[]};for(let t=0;t<r.length;t++)m=r[t],d="function"==typeof m.label?m.label(v,e):void 0,up(d)&&(g="function"==typeof a.direction?a.direction(v,e):a.direction||"up",x=x||"left"===g||"right"===g,l.fontFamily=m.fontFamily,l.fontSize="".concat(m.fontSize,"px"),l.text=d,p=s.measureText(l),u.measurements.push(p),u.texts.push(d),u.labelSettings.push(m),u.placementSettings.push(o[t]),u.direction=g,y=y&&p.width<=f.width-2*lp);c.push(u)}return{targetNodes:c,fitsHorizontally:y,hasHorizontalDirection:x}}({nodes:i,chart:n,renderer:o,settings:t,rect:r,labelSettings:c,placementSettings:u}),p=function(e){let{orientation:t="auto",defaultOrientation:n="h"}=e;switch(t.toLocaleLowerCase()){case"vertical":return"v";case"horizontal":return"h";default:return n}}({orientation:t.orientation,defaultOrientation:d?"h":"v"}),m="h"===p?"y":"x",g="h"===p?"height":"width";return f.sort(((e,t)=>e.node.localBounds[m]+e.node.localBounds[g]-(t.node.localBounds[m]+t.node.localBounds[g]))),s({chart:n,targetNodes:f,stngs:t,rect:r,fitsHorizontally:h,collectiveOrientation:p})},slice:function(e){let{settings:t,chart:n,nodes:i,rect:r,renderer:o,style:a}=e,s=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Ep,l=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Cp;const c=Qi({fontSize:12,fontFamily:"Arial",fill:"#333",padding:4,position:"into"},a.label);c.fontSize=parseInt(c.fontSize,10);const u=t.labels.map((e=>Qi({},c,t,e))),h=t.labels.map((e=>e.placements.map((n=>Qi({},c,t,e,n))))),d=[],f={insideLabelBounds:[]};i=function(e){const t=[],n=[],i=[],r=[];for(let o=0;o<e.length;++o){const{start:a,end:s}=e[o].desc.slice,l=wp((a+s)/2);switch(Math.floor(l/(Math.PI/2))){case 0:t.push(e[o]);break;case 1:n.push(e[o]);break;case 2:i.push(e[o]);break;case 3:r.push(e[o])}}const o=(e,t)=>wp((e.desc.slice.start+e.desc.slice.end)/2)-wp((t.desc.slice.start+t.desc.slice.end)/2),a=(e,t)=>o(t,e);return t.sort(a),n.sort(o),i.sort(a),r.sort(o),t.concat(n,r,i)}(i);const p={};for(let e=0,t=i.length;e<t;e++){const t=i[e],a=Ap(t,n);for(let n=0;n<u.length;n++){const i=u[n],c="function"==typeof i.label?i.label(a,e):"";if(!c)continue;const m="function"==typeof i.direction?i.direction(a,e):i.direction||"horizontal",g="function"==typeof i.linkData?i.linkData(a,e):void 0,y=Rp(c,i,o),x=s({context:p,direction:m,lblStngs:i,measured:y,node:t,placementSettings:h[n],rect:r,store:f}),v=x.bounds,b=x.placement;if(v&&b){if("outside"===b.position&&"rotate"!==m){Dp({context:p,node:t,bounds:v});if(!rh(kp(v),r))continue}const n="function"==typeof b.fill?b.fill(a,e):b.fill,o=l(v,c,{fill:n,fontSize:i.fontSize,fontFamily:i.fontFamily,textMetrics:y});o&&(void 0!==g&&(o.data=g),d.push(o),v.line&&(v.line.stroke=n,d.push(v.line)))}}}return d},rows:function(e){let{settings:t,chart:n,nodes:i,renderer:r,style:o}=e,a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:pm;const s=Qi({fontSize:12,fontFamily:"Arial",fill:"#333",padding:4,align:.5,justify:.5},o.label);s.fontSize=parseInt(s.fontSize,10);const l=Qi({},s,t),c=t.labels.map((e=>Qi({},l,e))),u={},h=[];for(let e=0,t=i.length;e<t;e++){let t=i[e],o=fm(t,n),{type:s,bounds:d}=gm(t);if(!d)continue;let f,p=0,m=[],g=[],y="circle"===s?2*d.r*.9:d.height;for(p+=l.padding,f=0;f<c.length;f++){let t=c[f],n="function"==typeof t.label?t.label(o,e):"";u.fontFamily=t.fontFamily,u.fontSize="".concat(t.fontSize,"px"),u.text=n;let i=r.measureText(u);if(p+=i.height+t.padding,p>y)break;g.push(n),m.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 t,n=c[f];if("circle"===s){let e=Math.max(Math.abs(b-d.cy),Math.abs(b+m[f].height-d.cy)),n=Math.sqrt(d.r*d.r-e*e);t={x:d.cx-n+l.padding,y:b,width:2*n-2*l.padding,height:m[f].height}}else t={x:d.x+l.padding,y:b,width:d.width-2*l.padding,height:m[f].height};b+=m[f].height+l.padding;let i="function"==typeof n.fill?n.fill(o,e):n.fill;const u="function"==typeof n.linkData?n.linkData(o,e):void 0;let p=a(t,g[f],{fill:i,align:n.align,fontSize:n.fontSize,fontFamily:n.fontFamily,textMetrics:m[f]});if(p){if(p.text&&p.text!==Vp){const e=tm(p,r.measureText);if(Vp===e)continue;p.ellipsed=e}void 0!==u&&(p.data=u),h.push(p)}}}return h}};const xm={require:["chart","renderer","settings"],defaultSettings:{settings:{},style:{label:"$label"}},render(){const e=this.settings.settings,t=[];return(e.sources||[]).forEach((e=>{e.strategy&&ym[e.strategy.type]&&e.component&&t.push(...function(e,t){let{chart:n,source:i,rect:r,renderer:o,style:a}=e;if(!n.component(i.component))return[];const s=n.findShapes(i.selector).filter((e=>e.key===i.component));return t({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:e,style:this.style},ym[e.strategy.type]))})),t}};const vm={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 bm(e){let{x:t=0,y:n,item:i,globalMetrics:r,createSymbol:o,direction:a="ltr"}=e,s=i.label.displayObject,l=i.label.bounds,c=i.symbol.meta;const u="rtl"===a;let h={x:u?t+r.maxLabelBounds.width:t+r.maxSymbolSize+r.spacing,y:n,width:r.maxLabelBounds.width,height:Math.max(r.maxSymbolSize,r.maxLabelBounds.height)},d=function(e,t,n){const i=Math.max(0,e.width-t),r=Math.max(0,e.height-t);return{x:e.x+t/2+n.align*i,y:e.y+t/2+n.justify*r}}({x:u?t+r.maxLabelBounds.width+r.spacing:t,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(Qi({},c,d));return delete f.collider,s.anchor=u?"end":"start",function(e,t,n){const i=n.textMetrics;if(e.height<i.height)return!1;const r=Math.max(0,e.width-i.width);t.baseline="text-before-edge";const o=Math.max(0,e.height-i.height);t.x=e.x+n.align*r,t.y=e.y+n.justify*o+.175*parseInt(t.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:t,y:n,width:r.maxItemBounds.width,height:r.maxItemBounds.height}},metrics:h}}function wm(e,t){const n=e.items.length,i=Math.ceil(n/t),r="horizontal"===e.layout.orientation?"width":"height",o="width"===r?"horizontal":"vertical";return e.globalMetrics.maxItemBounds[r]*i+(i-1)*e.layout.margin[o]}function Mm(e,t){let n,i,r,o,{onScroll:a=()=>{}}=t,s=null,l=0;const c={itemize:t=>{n=function(e,t){let n,i,{resolved:r,dock:o}=e,a=[],s=r.items.items,l=r.symbols.items,c=r.labels.items,u=0,h=0,d=0;for(let e=0;e<s.length;e++){if(!1===s[e].show)continue;const r=void 0!==c[e].text?c[e].text:c[e].data.label||"";n=Qi({},c[e],{type:"text",fontSize:"".concat(parseInt(c[e].fontSize,10),"px"),text:r,title:r}),i={symbol:{meta:l[e]},label:{displayObject:n,bounds:t.textBounds(n)}},a.push(i),u=Math.max(l[e].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}}}(t,e.renderer),s=isNaN(n.layout.scrollOffset)?s:n.layout.scrollOffset},getItemsToRender:t=>{r=t.viewRect,l=c.getContentOverflow(r);const a=c.extent();s=Math.max(0,Math.min(s,l)),o=Qi({},r);const u="horizontal"===c.orientation()?"x":"y";return o[u]-=s,o["x"===u?"width":"height"]=a,function(e,t,n){let{viewRect:i}=e,{itemized:r,create:o=bm,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,m=c.maxItemBounds.width,g=r.layout.margin.vertical+p,y=r.layout.margin.horizontal+m;let x=t.x,v=t.y,b=i.x-t.x;for(let e=0;e<u.length;e++){let n=o({y:v,x:"rtl"===l?i.x+b+i.width-m-(x-t.x):x,item:u[e],globalMetrics:c,direction:l,createSymbol:s});if((h&&x>=i.x-m||!h&&v>=i.y-p)&&f.push(n.item),d++,d>=a?(d=0,h?(x+=y,v=t.y):(v+=g,x=t.x)):h?v+=g:x+=y,!h&&v>i.y+i.height)break;if(h&&x>i.x+i.width)break}return f}(t,o,{itemized:n,parallels:i,createSymbol:e.symbol})},parallelize:(e,t)=>(i=function(e,t,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/e);if(null!=t){const e="horizontal"===n.layout.orientation?"height":"width",i="width"===e?"horizontal":"vertical",r=n.layout.margin[i]||4,o=Math.floor((t+r)/(r+n.globalMetrics.maxItemBounds[e]));s=Math.min(s,o)}const l=isNaN(n.layout.size)?1:n.layout.size;return Math.max(1,Math.min(s,l))}(e,t,n),i),hasContentOverflow:()=>{const e="horizontal"===n.layout.orientation?"width":"height";return wm(n,i)>r[e]},getContentOverflow:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:r;const t="horizontal"===n.layout.orientation?"width":"height";return Math.max(0,wm(n,i)-e[t])},getNextSize:()=>{const e="horizontal"===n.layout.orientation?"width":"height",t="width"===e?"horizontal":"vertical";return n.globalMetrics.maxItemBounds[e]+n.layout.margin[t]},getPrevSize:()=>{const e="horizontal"===n.layout.orientation?"width":"height",t="width"===e?"horizontal":"vertical";return n.globalMetrics.maxItemBounds[e]+n.layout.margin[t]},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:e=>{const t=Math.max(0,Math.min(l,s-e));t!==s&&(s=t,a())},offset:()=>s,orientation:()=>n.layout.orientation,direction:()=>n.layout.direction,extent:()=>wm(n,i),spread:()=>function(e,t){const n=t,i="horizontal"===e.layout.orientation?"height":"width",r="width"===i?"horizontal":"vertical";return e.globalMetrics.maxItemBounds[i]*n+(n-1)*e.layout.margin[r]}(n,i)};return c}function km(e){return Object.keys(e).filter((t=>e[t])).join(" ")}const Sm={up:"▲",right:"▶",down:"▼",left:"◀"};function _m(e,t){let{size:n,isActive:i,direction:r,nav:o,attrs:a}=t,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(e,{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"),e("button",Qi({class:km(s),style:u},c),[l||e("span",{style:{pointerEvents:"none"}},[Sm[r]])])}function qm(e){let t;const n={itemize:e=>{t=function(e){let{dock:t,navigation:n}=e;return{layout:{orientation:"top"===t||"bottom"===t?"vertical":"horizontal"},navigation:n}}(e)},render:i=>function(e,t,n,i){let{rect:r,itemRenderer:o}=t;if(!e||!e.renderArgs)return;e.size(r);const a=e.renderArgs[0],s="vertical"===n.layout.orientation,l="rtl"===o.direction(),c=o.hasNext(),u=o.hasPrev();if(!u&&!c)return void e.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"},[_m(a,{size:32,isActive:c,direction:h[0],attrs:{"data-action":"next","data-component-key":i.settings.key},nav:n.navigation}),_m(a,{size:32,isActive:u,direction:h[1],attrs:{"data-action":"prev","data-component-key":i.settings.key},nav:n.navigation})])];e.render(d)}(n.renderer,i,t,e),extent:()=>32,spread:()=>64};return n}function Dm(e){let t;const n={itemize:n=>{t=function(e,t){let{resolved:n}=e;if(!1===n.title.item.show)return null;const i=Qi({},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 e=t.scale.data().fields;i.text=e&&e[0]?e[0].title():""}return{displayObject:i,bounds:t.renderer.textBounds(i)}}(n,e)},render:e=>{!function(e,t,n){let{rect:i}=e;if(!t)return;const r=[];if(t.size(i),n){const e={start:0,end:i.width,middle:i.width/2};r.push(Qi({},n.displayObject,{x:e[n.displayObject.anchor]||0,y:0,baseline:"text-before-edge",title:n.displayObject.text}))}t.render(r)}(e,n.renderer,t)},spread:()=>t?t.bounds.height:0,extent:()=>t?t.bounds.width:0};return n}function Am(e,t,n,i){let r,o,a,{itemRenderer:s,navigationRenderer:l,titleRenderer:c,isPreliminary:u=!1}=i,h=0;const d={x:t.spacing,y:t.spacing,width:e.width-2*t.spacing,height:e.height-2*t.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 e=d.width-r.width-(r.width?t.spacing:0),n=d.height;s.parallelize(e,u?void 0:n);const i=s.extent()>e?l.extent():0,f=s.spread(),p=i?l.spread():0;o={x:r.x+r.width+(r.width?t.spacing:0),y:d.y+Math.max(0,(p-f)/2),width:d.width-i-r.width-(i?t.spacing:0)-(r.width?t.spacing:0),height:n},a={x:o.x+o.width+(i?t.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?t.spacing:0),r.x=o.x+o.width+(r.width?t.spacing:0)),h=Math.max(r.height,p,s.spread())}else{const e=d.height-r.height-(r.height?t.spacing:0),n=d.width;s.parallelize(e,u?void 0:n);const i=s.extent()>e?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?t.spacing:0),width:d.width,height:d.height-r.height-(r.height?t.spacing:0)-a.height-(a.height?t.spacing:0)},h=Math.max(c.extent(),i?l.spread():0,s.spread())}return o=Qi({},e,{x:e.x+o.x,y:e.y+o.y,width:o.width,height:o.height}),a.x+=e.x,a.y+=e.y,r.x+=e.x,r.y+=e.y,{title:Qi({},e,r),content:Qi({},e,o),navigation:Qi({},e,a),orientation:n,preferredSize:h}}function Cm(e){e.state.resolved=function(e){const t=e.scale.domain();let n={items:[]};const i=e.settings.layout.dock;if("threshold-color"===e.scale.type){const r=e.scale.data().fields[0];let o=e=>String(e);e.settings.formatter?o=e.chart.formatter(e.settings.formatter):r&&(o=r.formatter());for(let e=0;e<t.length-1;e++){const i={value:t[e],label:"".concat(o(t[e])," - < ").concat(o(t[e+1]))};r&&(i.source={field:r.id()}),n.items.push(i)}"vertical"==("top"===i||"bottom"===i?"horizontal":"vertical")&&n.items.reverse()}else{const i=e.scale.labels?e.scale.labels():null;n.items=t.map(((t,n)=>{const r=e.scale.datum?Qi({},e.scale.datum(t)):{value:t};return r.value=t,e.scale.label?r.label=e.scale.label(t):i&&(r.label=i[n]),r}))}const r=e.resolver.resolve({data:{fields:e.scale.data().fields},defaults:Qi(!0,{},vm.title,e.style.title),settings:e.settings.settings.title}),o=e.resolver.resolve({data:{fields:e.scale.data().fields},defaults:vm.layout,settings:e.settings.settings.layout}),a=e.resolver.resolve({data:n,defaults:Qi(!0,{},vm.item.label,e.style.item.label),settings:(e.settings.settings.item||{}).label}),s=Qi(!0,{},(e.settings.settings.item||{}).shape);void 0===s.fill&&e.settings.scale&&(s.fill={scale:e.settings.scale});const l=e.resolver.resolve({data:n,defaults:Qi(!0,{},vm.item.shape,e.style.item.shape),settings:s}),c=e.resolver.resolve({data:n,defaults:Qi(!0,{},{show:vm.item.show}),settings:{show:(e.settings.settings.item||{}).show}});function u(e,n){let i=e.data.value,r=t[n+1];e.data.value=[i,r]}"threshold-color"===e.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}}(e),e.titleRenderer.itemize({resolved:e.state.resolved,dock:e.settings.layout.dock||"center"}),e.itemRenderer.itemize({resolved:e.state.resolved,dock:e.settings.layout.dock||"center"}),e.navigationRenderer.itemize({resolved:e.state.resolved,dock:e.settings.layout.dock||"center",navigation:e.settings.settings.navigation}),e.state.display={spacing:8}}function Nm(e){const{rect:t,settings:n,state:i,itemRenderer:r,navigationRenderer:o,titleRenderer:a}=e,s=n.layout.dock,l="top"===s||"bottom"===s?"horizontal":"vertical",c=Am(t,i.display,l,{itemRenderer:r,navigationRenderer:o,titleRenderer:a});e.renderer.size(c.content);let u=r.getItemsToRender({viewRect:Qi({},c.content,{x:0,y:0})});return o.render({rect:c.navigation,itemRenderer:r}),a.render({rect:c.title}),e.state.views={layout:c},u}const Em={require:["chart","settings","renderer","update","resolver","registries","symbol"],defaultSettings:{settings:{},style:{item:{label:"$label",shape:"$shape"},title:"$title"}},mounted(e){e&&e.parentNode&&(this.navigationRenderer.renderer.appendTo(e.parentNode),this.titleRenderer.renderer.appendTo(e.parentNode),e.parentNode.insertBefore(this.navigationRenderer.renderer.element(),e),e.parentNode.insertBefore(this.titleRenderer.renderer.element(),e)),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(e){if(!this.state.interaction.started)return;const t="horizontal"===this.itemRenderer.orientation()?("rtl"===this.itemRenderer.direction()?-1:1)*e.deltaX:e.deltaY;this.itemRenderer.scroll(t-this.state.interaction.delta),this.state.interaction.delta=t},panend(){this.state.interaction.started=!1},scroll(e){this.itemRenderer.scroll(-e)},next(){this.itemRenderer.next()},prev(){this.itemRenderer.prev()}},created(){this.state={interaction:{}},this.onScroll=()=>{const e=Nm(this);this.update(e)},this.itemRenderer=Mm(this,{onScroll:this.onScroll}),this.navigationRenderer=qm(this),this.titleRenderer=Dm(this),this.navigationRenderer.renderer=this.registries.renderer("dom")(),this.titleRenderer.renderer=this.registries.renderer(this.settings.renderer)(),Cm(this)},preferredSize(e){return function(e,t){let n=0;const i=e.settings.layout.dock||"center",r="top"===i||"bottom"===i?"horizontal":"vertical",o=e.state.display,a=Am(t.inner,o,r,{itemRenderer:e.itemRenderer,navigationRenderer:e.navigationRenderer,titleRenderer:e.titleRenderer,isPreliminary:!0});return n+=o.spacing,n+=a.preferredSize,n+=o.spacing,n}(this,e)},beforeUpdate(){Cm(this)},render(){return Nm(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 Rm(e,t){let n=0;const i=e.state.isVertical?"justify":"align",r=e.state.isVertical?"y":"x",o=e.state.isVertical?"height":"width",a=e.state.isVertical?"requiredHeight":"requiredWidth";n=e.state.rect[o]-e.state.legend.length()-e.state.title[a](),n*=Math.min(1,Math.max(e.stgns[i],0)),t[r]+=n}function Im(e,t,n){const i=n[e];return"object"==typeof i?-1!==i.valid.indexOf(t)?t:i.default:n.default}function Om(e){return Im(e.layout.dock,e.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 Pm(e,t){const n={x:0,y:0,width:0,height:0},i=e.stgns.padding;return n.x=i.left,n.y=i.top,n.width=t.width-i.left-i.right,n.height=t.height-i.top-i.bottom,n}function Lm(e){const t="top"!==e.settings.layout.dock&&"bottom"!==e.settings.layout.dock,n=e.stgns.title,i=e.chart.scale(e.stgns.fill),r=e.chart.scale(e.stgns.major),o=function(e,t){const n=t.domain();let i=n,r=e.stgns.tick.label;!r&&e.formatter?r=e.formatter:!r&&t.data().fields&&(r=t.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:t.norm(parseFloat(n,10)),textMetrics:e.renderer.measureText({text:o,fontSize:e.stgns.tick.fontSize,fontFamily:e.stgns.tick.fontFamily})}}));return o}(e,r),a=Im((s=e.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 e=r.data().fields;n.text=e&&e[0]?e[0].title():""}const l=e.renderer.measureText({text:n.text,fontSize:n.fontSize,fontFamily:n.fontFamily}),c=e.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:t,nodes:[],title:{anchor:Om(e.settings),textMetrics:l,textBounds:c,requiredWidth:()=>{if(!n.show)return 0;let e=c.width,i=n.maxLengthPx;return t||(e+=n.padding,i+=n.padding),Math.min(e,i,u.rect.width)},requiredHeight:()=>{if(!n.show)return 0;let e=c.height;return t&&(e+=n.padding),Math.min(e,u.rect.height)}},ticks:{values:o,anchor:a,length:Math.min(Math.max(...o.map((e=>e.textMetrics.width))),e.stgns.tick.maxLengthPx),requiredHeight:()=>"top"===a?Math.max(...u.ticks.values.map((e=>e.textMetrics.height)))+e.stgns.tick.padding:0,height:Math.max(...o.map((e=>e.textMetrics.height)))},legend:{fillScale:i,majorScale:r,length:()=>{const n=t?"height":"width",i=t?"requiredHeight":"requiredWidth",r=Math.min(u.rect[n],u.rect[n]*e.stgns.length)-u.title[i]();return Math.max(0,Math.min(r,e.stgns.maxLengthPx))}}};return u}const Tm={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(e){const t=this.state;t.rect=Pm(this,e.inner);let n=this.stgns.size;const i=t.isVertical?this.stgns.padding.left+this.stgns.padding.right:this.stgns.padding.top+this.stgns.padding.bottom;n+=i;const r=Math.max(e.inner.width,e.inner.height);if("left"===t.ticks.anchor||"right"===t.ticks.anchor){const e=t.ticks.values.reduce(((e,t)=>e+t.textMetrics.height),0);if(e>this.state.legend.length())return r;n+=t.ticks.length}else{if(t.ticks.length>this.state.legend.length())return r;n+=Math.max(...t.ticks.values.map((e=>e.textMetrics.height)))}return n+=this.stgns.tick.padding,this.stgns.title.show&&(n="left"===t.title.anchor||"right"===t.title.anchor?Math.max(t.title.textBounds.height+i,n):Math.max(n,t.title.requiredWidth()+i)),this.state.preferredSize=n,n},created(){this.stgns=this.settings.settings,this.state=Lm(this)},beforeUpdate(e){this.stgns=e.settings.settings,this.state=Lm(this)},beforeRender(e){if(this.state.nodes=[],this.state.rect=Pm(this,e.size),this.stgns.title.show){const e=function(e){const t=e.state,n=e.stgns,i="left"===t.ticks.anchor,r="top"===t.ticks.anchor;let o=t.rect.x,a=t.rect.y,s="start";"left"===t.title.anchor?(o+=t.title.requiredWidth()-n.title.padding,a+=t.title.textMetrics.height,a+=r?t.rect.height-t.title.textBounds.height:0,s="end"):"right"===t.title.anchor?(o+=t.legend.length(),o+=n.title.padding,a+=t.title.textMetrics.height,a+=r?t.rect.height-t.title.textBounds.height:0):"top"===t.title.anchor&&(o+=i?t.rect.width:0,a+=t.title.textMetrics.height,s=i?"end":"start");const l={tag:"legend-title",type:"text",x:o,y:Math.min(a,t.rect.y+t.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 Rm(e,l),l}(this);this.state.nodes.push(e)}const t=function(e){const t=e.state.legend.fillScale,n=e.state.legend.majorScale;return t.domain().map((e=>({type:"stop",color:t(e),offset:Math.min(1,Math.max(0,n.norm(e)))}))).sort(((e,t)=>e.offset-t.offset))}(this),n=function(e,t){const n=e.state,i=e.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:t,degree:n.isVertical?90:180}};return Rm(e,c),c}(this,t),i=function(e,t){const n=e.state,i=e.stgns;let r="start";const o={type:"rect",x:t.x,y:t.y,width:n.isVertical?0:t.width,height:n.isVertical?t.height:0,fill:"transparent"},a=n.ticks.values.map((a=>{let s=0,l=0,c=0,u="alphabetical";return n.isVertical?(l=t.y+t.height*a.pos,u=0===a.pos?"text-before-edge":"text-after-edge"):s=t.x+t.width*a.pos,"right"===n.ticks.anchor?(s=t.x+i.size+i.tick.padding,o.x=t.x+t.width):"left"===n.ticks.anchor?(s=t.x-i.tick.padding,r="end"):"top"===n.ticks.anchor?(l=t.y-i.tick.padding,c-=.25*a.textMetrics.height,r=0===a.pos?"start":"end"):"bottom"===n.ticks.anchor&&(l=t.y+t.height+i.tick.padding,c=.8*a.textMetrics.height,r=0===a.pos?"start":"end",o.y=t.y+t.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:e.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 zm={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 Fm(e,t){let{generatorType:n,item:i,data:r,major:o,minor:a,layerObj:s,stngs:l}=t,c=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"";const u={type:"path",points:e,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 jm(e){const{metaLayers:t,coordinates:n,layers:i,lines:r,areas:o}=function(e){let{data:t,stngs:n,rect:i,resolver:r,style:o,domain:a}=e;const{width:s,height:l}=i,c=r.resolve({data:t,defaults:zm.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 e=0;e<c.items.length;e++){let t=c.items[e],n=t.layerId;if(u){const e=h[n]?h[n].items[h[n].items.length-1]:null,i=e?a.indexOf(e.data.major?e.data.major.value:e.data.value):null;e&&a.indexOf(t.data.major?t.data.major.value:t.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(t.data),h[n].items.push(t)}const f=Object.keys(h).map((e=>(h[e].consumableData=ir({points:h[e].dataItems},h[e].dataItems[0]),h[e]))),p={items:f.map((e=>e.consumableData))},m=n.layers||{};return{coordinates:c,metaLayers:f,layers:r.resolve({data:p,defaults:{curve:zm.layers.curve,show:zm.layers.show},settings:{curve:m.curve,show:m.show}}),lines:r.resolve({data:p,defaults:Qi({},zm.layers.line,o.line),settings:m.line}),areas:r.resolve({data:p,defaults:Qi({},zm.layers.area,o.area),settings:m.area})}}(e),a=[];return t.forEach(((t,s)=>{const l=i.items[s];if(!1===l.show)return;l.datum=l.data,l.data=[],l.id=t.id;const c=[],u=[];let h,d;for(let i=0;i<t.items.length;i++){if(h=t.items[i],d=h.data,!h.dummy){if(isNaN(h.major))continue;e.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(((e,t)=>e-t))[Math.floor((c.length-1)/2)];a.push({layerObj:l,lineObj:r.items[s],areaObj:o.items[s],median:f,points:u,consumableData:t.consumableData})})),a}const Vm={require:["chart","resolver"],defaultSettings:{style:{area:"$shape",line:"$shape-outline"}},created(){},render(e){let{data:t}=e;const{width:n,height:i}=this.rect;this.stngs=this.settings.settings||{};const r=!this.stngs.coordinates||void 0===this.stngs.coordinates.minor0,o=jm({data:t,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 e=o.map((e=>({id:e.layerObj.id,data:e.layerObj.data}))).sort(this.stngs.layers.sort).map((e=>e.id));o.sort(((t,n)=>e.indexOf(t.layerObj.id)-e.indexOf(n.layerObj.id)))}else o.sort(((e,t)=>e.median-t.median));return function(e,t){let{width:n,height:i,missingMinor0:r,stngs:o}=t;const a=[],s=o.layers||{};return e.forEach((e=>{const{lineObj:t,layerObj:l,areaObj:c,points:u}=e;let h={size:i,p:"y"},d={size:n,p:"x"};if("vertical"===o.orientation){const e=Qi(!0,{},d);d=Qi(!0,{},h),h=Qi(!0,{},e)}s.area&&!1!==c.show&&a.push(Fm(u,{data:e.consumableData,item:c,generatorType:"area",major:d,minor:h,layerObj:l,stngs:o})),t&&!1!==t.show&&(a.push(Fm(u,{data:e.consumableData,item:t,generatorType:"line".concat(h.p.toUpperCase(),"1"),major:d,minor:h,layerObj:l,stngs:o},"none")),!r&&s.area&&!1!==c.show&&!1!==t.showMinor0&&a.push(Fm(u,{data:e.consumableData,item:t,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 Bm(e,t){let n,i,r=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];"object"==typeof t.center?(n=t.center.x,i=t.center.y):(n=t.clientX,i=t.clientY);const o=n-e.state.boundingRect.left,a=i-e.state.boundingRect.top;return{x:r?Math.max(0,Math.min(o,e.rect.width)):o,y:r?Math.max(0,Math.min(a,e.rect.height)):a}}function Hm(e,t){return{x:t.x+e.rect.x,y:t.y+e.rect.y}}function $m(e,t){const n=Math.min(e.x,t.x),i=Math.min(e.y,t.y);return{x:n,y:i,width:Math.max(e.x,t.x)-n,height:Math.max(e.y,t.y)-i}}const Wm={require:["chart","renderer"],defaultSettings:{layout:{displayOrder:99},settings:{brush:{components:[]}},style:{area:"$selection-area-target"}},on:{areaStart(e){this.start(e)},areaMove(e){this.move(e)},areaEnd(e){this.end(e)},areaCancel(){this.cancel()}},created(){this.state={start:{x:0,y:0},end:{x:0,y:0},active:!1}},preferredSize:()=>0,render(){},start(e){this.state.boundingRect=this.renderer.element().getBoundingClientRect();const t=Bm(this,e,!1);bh({x:0,y:0,width:this.rect.width,height:this.rect.height},t)&&(this.state.brushConfig=this.settings.settings.brush.components.map((e=>({key:e.key,contexts:e.contexts,data:e.data,action:e.action||"set"}))),this.state.start=Bm(this,e),this.state.active=!0)},move(e){var t;this.state.active&&(this.state.end=Bm(this,e),function(e){if(e.state.active){const t=Hm(e,e.state.start),n=Hm(e,e.state.end),i=e.chart.shapesAt($m(t,n),{components:e.state.brushConfig});e.chart.brushFromShapes(i,{components:e.state.brushConfig})}}(this),(t=this).renderer.render([Qi({type:"rect"},$m(t.state.start,t.state.end),t.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 e,t;this.state.active&&(e=this.state,t=this.chart,e.brushConfig.forEach((e=>{Array.isArray(e.contexts)&&e.contexts.forEach((e=>{t.brush(e).end()}))})),this.state={start:{x:0,y:0},end:{x:0,y:0},active:!1},this.renderer.render([]))}};function Um(e,t,n){let{renderer:i,style:r,props:o,h:a}=n;const s=function(e,t){return{tooltip:"function"==typeof e.tooltipClass?e.tooltipClass({dock:t.dock}):e.tooltipClass,content:"function"==typeof e.contentClass?e.contentClass({dock:t.dock}):e.contentClass,arrow:"function"==typeof e.arrowClass?e.arrowClass({dock:t.dock}):e.arrowClass}}(o,t),l=function(e,t,n,i){return i.content({h:e,style:n,data:t})}(a,e,r,o),c=a("div",{dir:o.direction,class:km(Qi({"pic-tooltip":!0},s.tooltip)),style:Qi({position:"relative",display:"inline-block"},t.computedTooltipStyle)},a("div",{style:r.content,class:km(Qi({"pic-tooltip-content":!0},s.content))},l),a("div",{class:km(Qi({"pic-tooltip-arrow":!0},s.arrow)),style:Qi({},r.arrow,r["arrow-".concat(t.dock)],t.computedArrowStyle)}));return i.render(c),i.element().children[0]}function Ym(e){let{defaultDuration:t,defaultDelay:n}=e,i=null,r=null,o=!1;const a=function(){const e=function(){},t={pending:[],debounced:[],active:[],cancelled:[],rejected:[],fulfilled:[]};let n;return e.set=e=>{n=e,t[n].forEach((t=>t(e)))},e.on=(e,n)=>{Array.isArray(e)?e.forEach((e=>t[e].push(n))):t[e].push(n)},e.destroy=()=>{Object.keys(t).forEach((e=>{t[e].length=0}))},e}(),s=function(){},l=()=>{i=null,r=null,o=!1,a.set("fulfilled")};return s.invoke=function(e){let s=arguments.length>1&&void 0!==arguments[1]?arguments[1]:t,c=arguments.length>2&&void 0!==arguments[2]?arguments[2]:n;i&&(clearTimeout(i),a.set("debounced")),a.set("pending"),i=setTimeout((()=>{e(),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=(e,t)=>{a.on(e,t)},s.destroy=()=>{s.clear(),a.destroy()},s}function Gm(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;return{left:"translate(-100%,-50%) translateX(".concat(-e,"px)"),right:"translate(".concat(e,"px, -50%)"),top:"translate(-50%, -100%) translateY(".concat(-e,"px)"),bottom:"translate(-50%, ".concat(e,"px)"),inside:"translate(-50%, -50%)"}}function Xm(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;return{left:{x:-e-n,y:-t/2},right:{x:n,y:-t/2},top:{x:-e/2,y:-t-n},bottom:{x:-e/2,y:n},inside:{x:-e/2,y:-t/2}}}function Km(e,t){const n=e>0?"-":"+";return e=Math.abs(e),void 0===t&&(t=e),{left:{left:"100%",top:"calc(50% ".concat(n," ").concat(e,"px)"),borderWidth:"".concat(t,"px")},right:{left:"".concat(2*-e,"px"),top:"calc(50% ".concat(n," ").concat(e,"px)"),borderWidth:"".concat(t,"px")},top:{left:"calc(50% ".concat(n," ").concat(e,"px)"),top:"100%",borderWidth:"".concat(t,"px")},bottom:{left:"calc(50% ".concat(n," ").concat(e,"px)"),top:"".concat(2*-e,"px"),borderWidth:"".concat(t,"px")},inside:{left:"0px",top:"0px",borderWidth:"0px"}}}function Zm(e,t,n,i,r,o){const a=t+o.x,s=n+o.y,l=r;return!(a<0||s<0)&&!(a+i>e.width||s+l>e.height)}function Jm(e){let{area:t,vx:n,vy:i,width:r,height:o,offset:a}=e;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>t.width?-(s+c-t.width):0,d+=l+u>t.height?-(l+u-t.height):0,{x:h,y:d}}function Qm(e){let{options:t,pointer:n,width:i,height:r,dockOrder:o,x:a,y:s}=e;const{targetBounds:l}=n,c=Gm(t.offset),u=c[t.dock];if(u)return{computedTooltipStyle:{left:"".concat(a,"px"),top:"".concat(s,"px"),transform:u},computedArrowStyle:Km(t.offset)[t.dock],dock:t.dock};const h={width:"target"===t.area?l.width:window.innerWidth,height:"target"===t.area?l.height:window.innerHeight},d=Xm(i,r,t.offset),f=[],p="target"===t.area?a:l.left+a,m="target"===t.area?s:l.top+s;for(let e=0;e<o.length;e+=1){const n=o[e],l=Jm({area:h,vx:p,vy:m,width:i,height:r,offset:d[n]}),u={left:"".concat(a,"px"),top:"".concat(s,"px"),transform:c[n]},g=Km(t.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"),g.left="calc(50% ".concat(l.x>0?"-":"+"," ").concat(Math.abs(l.x),"px)")));const y={computedTooltipStyle:u,computedArrowStyle:g,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(((e,t)=>Math.abs(e.offset.x)-Math.abs(t.offset.x))),f[0]}function eg(e,t,n){const i=e.key?n.component(e.key):n.componentsFromPoint({x:t.clientX,y:t.clientY})[0];if(!i)return{x:0,y:0,width:0,height:0,scaleRatio:{x:1,y:1}};const r=i.rect;return Qi({scaleRatio:r.scaleRatio},r.computedInner)}const tg={bounds:function(e){let{resources:t,nodes:n,pointer:i,width:r,height:o,options:a}=e;const{targetBounds:s}=i,{x:l,y:c,width:u,height:h}=t.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=Gm(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:Km(a.offset)[a.dock],dock:a.dock};const m={width:"target"===a.area?s.width:window.innerWidth,height:"target"===a.area?s.height:window.innerHeight},g=Xm(r,o,a.offset),y=["top","left","right","bottom","inside"];for(let e=0;e<y.length;e+=1){const t=y[e];if(Zm(m,"target"===a.area?d[t].x:s.left+d[t].x,"target"===a.area?d[t].y:s.top+d[t].y,r,o,g[t]))return{computedTooltipStyle:{left:"".concat(d[t].x,"px"),top:"".concat(d[t].y,"px"),transform:f[t]},computedArrowStyle:Km(a.offset)[t],dock:t}}const x=function(e){let{options:t,docks:n,dockOffsets:i,targetBounds:r,area:o,width:a,height:s}=e;const l="top",c="target"===t.area?n[l].x:r.left+n[l].x,u=("target"===t.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:g,targetBounds:s,area:m,width:r,height:o});return{computedTooltipStyle:{left:"".concat(x,"px"),top:"".concat(d.top.y,"px"),transform:f.top},computedArrowStyle:Km(a.offset+x-d.top.x,a.offset).top,dock:"top"}},pointer:function(e){let{options:t,pointer:n,width:i,height:r}=e;const{x:o,y:a}=n;return Qm({x:o,y:a,pointer:n,width:i,height:r,options:t,dockOrder:["top","left","right","bottom"]})},slice:function(e){let{options:t,pointer:n,width:i,height:r,nodes:o,resources:a}=e;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:m}=s.desc.slice,g=(f+p)/2-Math.PI/2,y=2*Math.PI,x=(g%y+y)%y;let v=["top","left","right","bottom"];return"auto"===t.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"]),Qm({x:h+m*u.scaleRatio.x*Math.cos(x),y:d+m*u.scaleRatio.y*Math.sin(x),pointer:n,width:i,height:r,options:t,dockOrder:v})}};function ng(e,t){let{width:n,height:i}=e,{chart:r,state:o,props:a}=t;const s={resources:{formatter:r.formatter,scale:r.scale,component:r.component,getComponentBoundsFromNode:e=>eg(e,o.pointer,r),getNodeBoundsRelativeToTarget:e=>function(e,t,n){const i=eg(e,t,n),r=e.bounds;return{x:i.x+t.dx+r.x,y:i.y+t.dy+r.y,width:r.width,height:r.height}}(e,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=Qi(c,a.placement(s))),"object"===l&&tg[a.placement.type]?c=Qi(c,a.placement):"string"===l&&tg[a.placement]&&(c=Qi(c,{type:a.placement})),s.options=c;const u=tg[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 ig;function rg(){ig=null}const og={duration:8e3,delay:500,filter:e=>e.filter((e=>e.data&&void 0!==e.data.value)),extract:e=>e.node.data.value,content:e=>{let{h:t,data:n}=e;return n.map((e=>t("div",{},e)))},isEqual:(e,t)=>e.length&&e.length===t.length&&e.every(((e,n)=>t[n]&&JSON.stringify(e.data)===JSON.stringify(t[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 ag={require:["chart","renderer"],defaultSettings:{settings:og,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(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this.show(e,t)},prevent(e){this.prevent(e)}},hide(){this.dispatcher.clear(),this.state.activeNodes=[],this.state.pointer={}},show(e){let t,{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(e,t){let{chart:n,state:i}=t,r=0,o=0;e.center?(r+=e.center.x,o+=e.center.y):(r+=e.clientX,o+=e.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}}(e,this),t=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,t)||(this.dispatcher.clear(),this.state.activeNodes=t,this.state.activeNodes.length&&this.dispatcher.invoke((()=>this.invokeRenderer(this.state.activeNodes)),i,r)))},prevent(e){this.state.prevent=!!e},init(e){this.state={activeNodes:[],pointer:{},targetElement:null,prevent:!1},this.props=e.settings,this.dispatcher=Ym({defaultDuration:this.props.duration,defaultDelay:this.props.delay});const t=this.dispatcher.clear;this.dispatcher.on("pending",(()=>{!function(e){ig&&ig!==e&&ig()}(t),ig=t,"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 e={resources:{formatter:this.chart.formatter,scale:this.chart.scale}};"function"==typeof this.props.beforeHide&&this.props.beforeHide.call(void 0,Qi({element:this.state.tooltipElm},e)),"function"==typeof this.props.onHide?this.props.onHide.call(void 0,Qi({element:this.state.tooltipElm},e)):this.renderer.clear([]),"function"==typeof this.props.afterHide&&this.props.afterHide.call(void 0,e),ig===t&&(ig=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(e){let{settings:t}=e;this.dispatcher&&(this.dispatcher.destroy(),rg()),this.init(t)},render(e){return this.h=e,[]},beforeDestroy(){this.dispatcher.destroy(),rg()},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:e,height:t}=this.state.targetElement.getBoundingClientRect();this.renderer.destroy(),this.renderer.size({width:e,height:t}),this.renderer.appendTo(this.state.targetElement)}else this.state.targetElement=this.renderer.element()},mounted(){this.appendTo()},updated(){this.appendTo()},invokeRenderer(e){const t=function(e,t){let{chart:n,scale:i,props:r,h:o}=t;const a={resources:{dataset:n.dataset,scale:n.scale,formatter:n.formatter},scale:i,h:o},s=[];return e.forEach((e=>{if("function"==typeof r.extract){const t=Qi({node:e},a);s.push(r.extract(t))}})),s}(e,this),n=ng(Um(t,{style:{left:"0px",top:"0px",visibility:"hidden"}},this).getBoundingClientRect(),this);this.state.tooltipElm=Um(t,n,this)}};const sg={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 e=this.chart.findShapes(this.props.selector).filter((e=>e.key===this.props.target)),t=e.filter((e=>e.collider)).map((e=>e.collider));t.forEach((e=>{e.fill=this.props.fill,e.stroke=this.props.stroke,e.opacity=this.props.opacity,e.collider={type:null}})),this.renderer.render(t)},created(){this.props=this.settings.settings},resize(e){let{outer:t,inner:n}=e;return this.props.useOuterRect?t:n},render(){},mounted(){this.draw()},updated(){this.props=this.settings.settings,this.draw()}};var lg={a:7,c:6,h:1,l:2,m:2,q:4,s:4,t:2,v:1,z:0},cg=/([astvzqmhlc])([^astvzqmhlc]*)/gi,ug=/-?[0-9]*\.?[0-9]+(?:e[-+]?\d+)?/gi;function hg(e){const t=[],n=String(e).trim();return"M"!==n[0]&&"m"!==n[0]||n.replace(cg,((e,n,i)=>{const r=function(e){const t=e.match(ug);return t?t.map(Number):[]}(i);let o=n.toLowerCase(),a=n;if("m"===o&&r.length>2&&(t.push([a,...r.splice(0,2)]),o="l",a="m"===a?"l":"L"),r.length<lg[o])return"";for(t.push([a,...r.splice(0,lg[o])]);r.length>=lg[o]&&r.length&&lg[o];)t.push([a,...r.splice(0,lg[o])]);return""})),t}const dg=2*Math.PI;function fg(e,t){return{x:.5*(e.x+t.x),y:.5*(e.y+t.y)}}function pg(e,t,n,i,r){const o=1-e;return o**3*t+3*o**2*e*n+3*o*e**2*i+e**3*r}function mg(e,t,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(e,t,n,i){return Math.abs(e.x+n.x-(t.x+t.x))+Math.abs(e.y+n.y-(t.y+t.y))+Math.abs(t.x+i.x-(n.x+n.x))+Math.abs(t.y+i.y-(n.y+n.y))}(e,t,n,i)<=10)return r[r.length-1]!==e&&r.push(e),r.push(i),r;const a=fg(e,t),s=fg(t,n),l=fg(n,i),c={x:pg(.5,e.x,t.x,n.x,i.x),y:pg(.5,e.y,t.y,n.y,i.y)},u=fg(a,s),h=fg(s,l);return mg(e,a,u,c,r,o-1),mg(c,h,l,i,r,o-1),r}function gg(e,t,n){const{cp1:i,cp2:r}=function(e,t,n){return{cp1:{x:e.x+2/3*(t.x-e.x),y:e.y+2/3*(t.y-e.y)},cp2:{x:n.x+2/3*(t.x-n.x),y:n.y+2/3*(t.y-n.y)}}}(e,t,n);return mg(e,i,r,n)}function yg(e,t,n){const i=[],r=!!e[4],o=!!e[5],a=e[3];let s,l,c,u,h=e[6],d=e[7],f=e[1],p=e[2];if("a"===e[0]&&(h+=t,d+=n),t===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(e,t,n,i,r,o,a,s,l){let c,u,h,d,f,p;const m=Pu(n%360),g=Math.cos(m),y=Math.sin(m),x=(s-o)/2,v=(l-a)/2,b=g*x+y*v,w=g*v-y*x;p=b**2/(e=Math.abs(e))**2+w**2/(t=Math.abs(t))**2,p>1&&(p=Math.sqrt(p),e*=p,t*=p);const M=e*w,k=t*b,S=M**2+k**2,_=(e*t)**2-S;let q=Math.sqrt(Math.max(_/S,0));i===r&&(q=-q);const D=q*(M/t),A=q*(-k/e);d=g*D-y*A+(s+o)/2,f=y*D+g*A+(l+a)/2;const C=(b-D)/e,N=(w-A)/t,E=(-b-D)/e,R=(-w-A)/t;return c=Math.atan2(N,C),c+=c<0?dg:0,u=Math.atan2(R,E),u+=u<0?dg:0,h=u-c,!r&&c<u?h-=dg:r&&u<c&&(h+=dg),h%=dg,{startAngle:c,sweepAngle:h,cx:d,cy:f,rx:e,ry:t}}(f,p,a,r,o,h,d,t,n));const m=Math.abs(c*Math.sqrt((f**2+p**2)/2)),g=Math.ceil(m/10),y=c/g;for(let e=1;e<=g;e++){const t=(u+y*e)%dg,n=Math.cos(t),r=Math.sin(t);i.push({x:s+n*f+-r*n,y:l+r*p+n*r})}return i}function xg(e){const t=hg(e),n=[],i=[];let r=0,o=0,a=null,s=null,l=null,c=null;for(let e=0;e<t.length;++e){const u=t[e],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(...yg(u,r,o)),r+=u[6],o+=u[7];break;case"A":i.push(...yg(u,r,o)),r=u[6],o=u[7];break;case"c":i.push(...mg({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(...mg({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(...mg({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(...mg({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(e){for(let t=0;t<e.length-1;t++){const n=e[t],i=e[t+1];Math.abs(n.x-i.x)<1e-12&&Math.abs(n.y-i.y)<1e-12&&(e.splice(t,1),t--)}}(i),n.push(i.splice(0)),n}const vg={require:["renderer","chart"],defaultSettings:{settings:{target:"",fill:"transparent",stroke:"lime",opacity:1,radius:2,useOuterRect:!1}},on:{update(){this.draw()}},draw(){const e=this.chart.findShapes("path").filter((e=>e.key===this.props.target)),t=[];e.forEach((e=>{xg(e.attrs.d).forEach((e=>{e.forEach((e=>{t.push({type:"circle",cx:e.x,cy:e.y,r:this.props.radius,fill:this.props.fill,stroke:this.props.stroke,opacity:this.props.opacity,collider:{type:null}})}))}))})),this.renderer.render(t)},created(){this.props=this.settings.settings},resize(e){let{outer:t,inner:n}=e;return this.props.useOuterRect?t:n},render(){},mounted(){this.draw()},updated(){this.props=this.settings.settings,this.draw()}};var bg=[function(e){e.component("box",bd),e.component("box-marker",bd)},function(e){e.component("point",Dd),e.component("point-marker",Dd)},function(e){e.component("pie",Ed)},function(e){e.component("grid-line",Ld)},function(e){e.component("ref-line",Yd)},function(e){e.component("axis",kf)},function(e){e.component("container",Sf)},function(e){e.component("text",Df)},function(e){e.component("scrollbar",Nf)},function(e){e.component("brush-range",Wf),e.component("brush-area-dir",Xf)},function(e){e.component("range",Qf)},function(e){e.component("brush-lasso",op)},function(e){e.component("labels",xm)},function(e){e.component("legend-cat",Em)},function(e){e.component("legend-seq",Tm)},function(e){e.component("line",Vm)},function(e){e.component("brush-area",Wm)},function(e){e.component("tooltip",ag)},function(e){e.component("debug-collider",sg)},function(e){e.component("debug-path-to-points",vg)}];class wg{constructor(e){this._parent=null,this._children=[],this._ancestors=null,this.type=e,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 e=[];const t=this.children.length;let n,i;for(n=0;n<t;n++)i=this.children[n],e.push(i),i.children.length&&(e=[...e,...i.descendants]);return e}equals(e){const t=this.children,n=e.children;if(t.length!==n.length)return!1;for(let e=0;e<t.length;e++)if(!t[e].equals(n[e]))return!1;return!0}toJSON(){return{type:this.type,children:this.children.map((e=>e.toJSON()))}}}class Mg{constructor(){let{x:e=0,y:t=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:e,y:t,width:n,height:i,minWidth:r,minHeight:o})}set(){let{x:e=0,y:t=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=e,this.width=Math.max(n,r)):(this.x=e+Math.min(n,-r),this.width=-Math.min(n,-r)),i>=0?(this.y=t,this.height=Math.max(i,o)):(this.y=t+Math.min(i,-o),this.height=-Math.min(i,-o))}containsPoint(e){return bh(this,e)}intersectsLine(e){return wh(this,hr(e))}intersectsRect(e){return xh(this,ur(e))}intersectsCircle(e){return dh(e,this)}intersectsPolygon(e){return yh(e,this)}intersectsGeoPolygon(e){return Ch(e,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 kg{constructor(){let{cx:e=0,cy:t=0,r:n=0,minRadius:i=0}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.set({cx:e,cy:t,r:n,minRadius:i})}set(){let{cx:e=0,cy:t=0,r:n=0,minRadius:i=0}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.type="circle",this.cx=e,this.cy=t,this.r=Math.max(n,i),this.vector={x:this.cx,y:this.cy}}containsPoint(e){return hh(this,e)}intersectsLine(e){return fh(this,hr(e))}intersectsRect(e){return dh(this,ur(e))}intersectsCircle(e){return n=e,!sh(t=this)&&!sh(n)&&(t.cx-n.cx)**2+(t.cy-n.cy)**2<=(t.r+n.r)**2;var t,n}intersectsPolygon(e){return ph(this,e)}intersectsGeoPolygon(e){return qh(this,e)}points(){return[{x:this.cx,y:this.cy}]}}class Sg{constructor(){let{x1:e=0,y1:t=0,x2:n=0,y2:i=0,tolerance:r=0}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.set({x1:e,y1:t,x2:n,y2:i,tolerance:r})}set(){let{x1:e=0,y1:t=0,x2:n=0,y2:i=0,tolerance:r=0}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.type="line",this.x1=e,this.y1=t,this.x2=n,this.y2=i,this.tolerance=Math.max(0,Math.round(r)),this.vectors=this.points(),this.zeroSize=e===n&&t===i}containsPoint(e){if(this.tolerance>0){return fh({cx:e.x,cy:e.y,r:this.tolerance},this)}return kh(this,e)}intersectsLine(e){return Mh(this,hr(e))}intersectsRect(e){return wh(ur(e),this)}intersectsCircle(e){return fh(e,this)}intersectsPolygon(e){return gh(e,this)}intersectsGeoPolygon(e){return Ah(e,this)}points(){return[{x:this.x1,y:this.y1},{x:this.x2,y:this.y2}]}}class _g{constructor(){let{vertices:e=[]}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.set({vertices:e})}set(){let{vertices:e=[]}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(this.type="polygon",this.vertices=e.slice(),this.edges=[],function(e){for(let t=0;t<e.length-1;t++){const n=e[t],i=e[t+1];n.x===i.x&&n.y===i.y&&(e.splice(t,1),t--)}}(this.vertices),!(this.vertices.length<=2)){!function(e){const t=e[0],n=e[e.length-1];t.x===n.x&&t.y===n.y||e.push(t)}(this.vertices),this.xMin=NaN,this.yMin=NaN,this.xMax=NaN,this.yMax=NaN;for(let e=0;e<this.vertices.length;e++)e<this.vertices.length-1&&this.edges.push([this.vertices[e],this.vertices[e+1]]),this.xMin=isNaN(this.xMin)?this.vertices[e].x:Math.min(this.xMin,this.vertices[e].x),this.xMax=isNaN(this.xMax)?this.vertices[e].x:Math.max(this.xMax,this.vertices[e].x),this.yMin=isNaN(this.yMin)?this.vertices[e].y:Math.min(this.yMin,this.vertices[e].y),this.yMax=isNaN(this.yMax)?this.vertices[e].y:Math.max(this.yMax,this.vertices[e].y);this._bounds=null,this._boundingRect=null}}containsPoint(e){return mh(this,e)}intersectsCircle(e){return ph(e,this)}intersectsLine(e){return gh(this,hr(e))}intersectsRect(e){return yh(this,ur(e))}intersectsPolygon(e){return Sh(this,e)}intersectsGeoPolygon(e){return _h(e,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 qg(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return new _g(...t)}function Dg(e){const t=e[0],n=e[e.length-1];t.x===n.x&&t.y===n.y||e.push(t)}function Ag(e){for(let t=0;t<e.length-1;t++){const n=e[t],i=e[t+1];n.x===i.x&&n.y===i.y&&(e.splice(t,1),t--)}}class Cg{constructor(){let{vertices:e=[[]]}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.set({vertices:e})}set(){let{vertices:e=[]}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.type="geopolygon",this.vertices=e.slice(),this.numPolygons=this.vertices.length,this.polygons=[],this.xMin=NaN,this.yMin=NaN,this.xMax=NaN,this.yMax=NaN;for(let e=0;e<this.numPolygons;e++)Ag(this.vertices[e]),this.vertices[e].length>2&&Dg(this.vertices[e]),this.polygons[e]=qg({vertices:this.vertices[e]}),this.xMin=isNaN(this.xMin)?this.polygons[e].xMin:Math.min(this.xMin,this.polygons[e].xMin),this.xMax=isNaN(this.xMax)?this.polygons[e].xMax:Math.max(this.xMax,this.polygons[e].xMax),this.yMin=isNaN(this.yMin)?this.polygons[e].yMin:Math.min(this.yMin,this.polygons[e].yMin),this.yMax=isNaN(this.yMax)?this.polygons[e].yMax:Math.max(this.yMax,this.polygons[e].yMax);this._bounds=null,this._boundingRect=null}containsPoint(e){return Dh(this,e)}intersectsCircle(e){return qh(e,this)}intersectsLine(e){return Ah(this,hr(e))}intersectsRect(e){return Ch(this,ur(e))}intersectsPolygon(e){return _h(this,e)}intersectsGeoPolygon(e){return function(e,t){const n=e.boundingRect(),i=t.boundingRect();return!!xh(n,i)&&(vh(i,n)?uh(t,e):uh(e,t))}(this,e)}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 Ng(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return new Cg(...t)}class Eg{constructor(){let{points:e=[]}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.set({points:e})}set(){let{points:e=[]}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(this.type="polyline",this.segments=[],this._points=e.slice(),this._points.length>1)for(let e=0,i=this._points.length-1;e<i;e++)t=this._points[e],n=this._points[e+1],(t.x!==n.x||t.y!==n.y)&&this.segments.push({x1:this._points[e].x,y1:this._points[e].y,x2:this._points[e+1].x,y2:this._points[e+1].y});var t,n}containsPoint(e){return this.segments.some((t=>kh(t,e)))}intersectsCircle(e){return this.segments.some((t=>fh(e,t)))}intersectsLine(e){const t=hr(e);return this.segments.some((e=>Mh(e,t)))}intersectsRect(e){const t=ur(e);return this.segments.some((e=>wh(t,e)))}intersectsPolygon(e){return this.segments.some((t=>gh(e,t)))}intersectsGeoPolygon(e){return this.segments.some((t=>Ah(e,t)))}points(){return this._points}}const Rg=yo();function Ig(e,t){return Rg.get(e)(t)}Rg.add("rect",(function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return new Mg(...t)})),Rg.add("circle",(function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return new kg(...t)})),Rg.add("line",(function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return new Sg(...t)})),Rg.add("polygon",qg),Rg.add("geopolygon",Ng),Rg.add("polyline",(function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return new Eg(...t)}));class Og{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];this.set(e)}set(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];this.geometries=[],e.forEach((e=>{const t=Ig(e.type,e);t&&this.geometries.push(t)}))}containsPoint(e){return this.geometries.some((t=>t.containsPoint(e)))}intersectsLine(e){return this.geometries.some((t=>t.intersectsLine(e)))}intersectsRect(e){return this.geometries.some((t=>t.intersectsRect(e)))}intersectsCircle(e){return this.geometries.some((t=>t.intersectsCircle(e)))}intersectsPolygon(e){return this.geometries.some((t=>t.intersectsPolygon(e)))}intersectsGeoPolygon(e){return this.geometries.some((t=>t.intersectsGeoPolygon(e)))}}class Pg{constructor(){this._elements=[[1,0,0],[0,1,0],[0,0,1]],this._stack=[]}clone(){return(new Pg).multiply(this)}set(e){return this._elements=e,this}save(){return this._stack.push(this.elements),this}restore(){return this._stack.length&&(this._elements=this._stack.pop()),this}add(e){let t,n;for(t=0;t<this._elements.length;t++)for(n=0;n<this._elements[t].length;n++)this._elements[t][n]+=e;return this}translate(e,t){return this.multiply([[1,0,e],[0,1,t],[0,0,1]]),this}rotate(e){let t=Math.cos(-e),n=Math.sin(-e);return this.multiply([[t,n,0],[-n,t,0],[0,0,1]]),this}multiply(e){let t,n,i,r;if(e instanceof Pg&&(e=e._elements),Array.isArray(e)){for(i=[[0,0,0],[0,0,0],[0,0,0]],t=0;t<this._elements.length;t++)for(n=0;n<this._elements[t].length;n++)for(r=0;r<3;r++)i[t][n]+=this._elements[t][r]*e[r][n];this._elements=i}else for(t=0;t<this._elements.length;t++)for(n=0;n<this._elements[t].length;n++)this._elements[t][n]*=e;return this}scale(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:e;return this.multiply([[e,0,0],[0,t,0],[0,0,1]]),this}transform(e,t,n,i,r,o){return this.multiply([[e,n,r],[t,i,o],[0,0,1]]),this}determinant(){let e=this._elements[0][0],t=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=e*r*l+t*o*a+n*i*s-n*r*a-t*i*l-e*o*s,c}invert(){let e=this.determinant(),t=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,t*c-i*s,i*r-t*a],[r*l-o*s,s*n-t*l,t*o-n*r]],this.multiply(1/e),this}transpose(){const e=Object.create(this._elements);return this._elements=[[e[0][0],e[1][0],e[2][0]],[e[0][1],e[1][1],e[2][1]],[e[0][2],e[1][2],e[2][2]]],this}identity(){return this._elements=[[1,0,0],[0,1,0],[0,0,1]],this}toString(){return"".concat(this._elements.map((e=>e.join("\t"))).join("\n"))}isIdentity(){const e=this._elements;return 1===e[0][0]&&0===e[0][1]&&0===e[0][2]&&0===e[1][0]&&1===e[1][1]&&0===e[1][2]&&0===e[2][0]&&0===e[2][1]&&1===e[2][2]}transformPoint(e){let t,n,i=[e.x,e.y,1],r=this._elements,o=[0,0,0];for(t=0;t<this._elements.length;t++)for(n=0;n<this._elements[t].length;n++)o[t]+=i[n]*r[t][n];return{x:o[0],y:o[1]}}transformPoints(e){let t,n,i,r,o,a=this._elements,s=[];for(r=0;r<e.length;r++){for(t=[e[r].x,e[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]+=t[i]*a[n][i];s.push({x:o[0],y:o[1]})}return s}get elements(){const e=this._elements;return[[e[0][0],e[0][1],e[0][2]],[e[1][0],e[1][1],e[1][2]],[e[2][0],e[2][1],e[2][2]]]}}const Lg=/(translate|scale|rotate|matrix)\(([0-9,.eE+-\s]+)(?:,|\s?)+\)/g;function Tg(e,t){const n=t.args[0]*(Math.PI/180);if(t.args.length>2){const i=t.args[1],r=t.args[2];e.translate(i,r),e.rotate(n),e.translate(-i,-r)}else 1===t.args.length&&e.rotate(n)}function zg(e,t){const n=t.args[0],i=isNaN(t.args[1])?t.args[0]:t.args[1];e.scale(n,i)}function Fg(e,t){const n=t.args[0],i=isNaN(t.args[1])?0:t.args[1];e.translate(n,i)}function jg(e,t){t.args.length>=6&&e.transform(...t.args)}function Vg(e,t){const n=function(e){let t,n=[];for(;null!==(t=Lg.exec(e));){const e=t[2].trim(),i=-1===e.indexOf(",")?e.split(" "):e.split(",");n.push({cmd:t[1],args:i.filter((e=>e.trim().length>0)).map((e=>Number(e)))})}return n}(e);let i;for(let e=0,r=n.length;e<r;e++)i=n[e],"rotate"===i.cmd?Tg(t,i):"scale"===i.cmd?zg(t,i):"matrix"===i.cmd?jg(t,i):"translate"===i.cmd&&Fg(t,i)}const Bg={type:/^\w[\w-]+/,attr:/^\[\w(?:[\w\._-]+)?(?:[!]?=['\"][\w\s*#_-]*['\"])?\]/,universal:/^(\*)/,tag:/^\.(\w+)/},Hg={type:(e,t)=>t.filter((t=>{const n=t.type;return!!n&&n.toLowerCase()===e.toLowerCase()})),attr:(e,t,n,i)=>i.filter((i=>{const r=i.attrs[e];if(!t)return void 0!==r;if(void 0===r)return!1;switch(t){case"=":return n===String(r);case"!=":return n!==String(r);default:return!1}})),universal:e=>e,tag:(e,t)=>t.filter((t=>{const n=t.tag;return!!n&&-1!==n.trim().split(/\s+/).indexOf(e.replace(".",""))}))};function $g(e,t){if(!t||!t.length||!e||"function"!=typeof Hg[e.type])return[];switch(e.type){case"type":case"tag":return Hg[e.type](e.value,t);case"attr":return Hg[e.type](e.attribute,e.operator,e.attributeValue,t);case"universal":return Hg[e.type](t);default:return[]}}var Wg={find:function(e,t){const n=[],i=[];let r,o;if(t.isBranch){let a;r=function(e){const t=[];let n,i,r,o;return e.split(/\s*,\s*/).forEach((e=>{e=e.trim(),n=[];const a=t=>{r=e.match(Bg[t]),r&&(o=!0,e=e.slice(r[0].length),i={type:t,value:r[0]},"attr"===t&&(r=r[0].match(/\[(\w[\w\._-]+)?(?:([!]?=)['\"]([\w\s#_-]*)['\"])?\]/),i.attribute=r[1],i.operator=r[2],i.attributeValue=r[3]),n.push(i))};for(;e&&(o=!1,r=e.match(/^\s*([>+~]|\s)\s*/),r&&(o=!0,n.push({type:" ",value:r[0]}),e=e.slice(r[0].length)),Object.keys(Bg).forEach(a),n&&n.length&&t.indexOf(n)<0&&t.push(n),o););})),t}(e),o=t.descendants;for(let e=0,t=r.length;e<t;e++){a=r[e];const t=[];let n=o.slice(),s=!1;a.reverse().forEach((e=>{if(" "===e.type)return t.push(n),n=o.slice(),void(s=!1);n=$g(e,n),s=!0})),s&&t.push(n);const l=t[0].filter((e=>{let n,i=e.parent;for(let e=1;e<t.length;e++){for(n=t[e].indexOf(i);i&&n<0;)i=i.parent,n=t[e].indexOf(i);if(n<0)return!1}return!0}));i.push(l)}for(let e=0,t=i.length;e<t;e++)for(let t=0,r=i[e].length;t<r;t++)n.indexOf(i[e][t])<0&&n.push(i[e][t])}return n||[]}};function Ug(e,t,n){const i=e.type;let r=e.points();n&&(r=r.every((e=>Array.isArray(e)))?r.map((e=>n.transformPoints(e))):n.transformPoints(r)),function(e,t){for(let n=0,i=e.length;n<i;n++)e[n].x/=t,e[n].y/=t}(r,t);let o=null;if("rect"===i||"bounds"===i)o=ur(r),o.type=i;else if("circle"===i)o=function(e,t){return{cx:e[0].x,cy:e[0].y,r:t}}(r,e.r),o.type=i;else if("line"===i)o=hr(r),o.type=i;else if("polygon"===i||"polyline"===i){o={type:"path",d:Iu(r,"polygon"===i)}}else if("geopolygon"===i){let e="";for(let t=0;t<r.length;t++)e+=Iu(r[t],!0);o={type:"path",d:e}}return o}class Yg{constructor(e){this._bounds=function(){let t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];const{x:n,y:i,width:r,height:o}=e.boundingRect?e.boundingRect(t):{x:0,y:0,width:0,height:0};return{x:n,y:i,width:r,height:o}},this._attrs=e.attrs,this._type=e.type,this._data=e.data,this._dpi=e.stage?e.stage.dpi:1,this._collider=()=>function(e,t){if(e.collider){const n=e.modelViewMatrix;return"collection"===e.colliderType?{type:"container",children:e.collider.geometries.map((e=>Ug(e,t,n)))}:Ug(e.collider,t,n)}return null}(e,this._dpi),this._desc=e.desc,this._tag=e.tag,this._children=()=>e.children.map((e=>new Yg(e))),this._parent=()=>e.parent?new Yg(e.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(e){this._cache.elementBoundingRect=null,this._element=e}get element(){return this._element}set key(e){this._key=e}get key(){return this._key}get bounds(){const e=this._bounds();return e.x/=this._dpi,e.y/=this._dpi,e.width/=this._dpi,e.height/=this._dpi,e}get localBounds(){return this._bounds(!1)}boundsRelativeTo(e){const t=typeof e,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"===t&&null!==e&&"function"==typeof e.getBoundingClientRect){const{left:t=0,top:n=0}=e.getBoundingClientRect();r-=t,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 Gg(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return new Yg(...t)}class Xg{constructor(e){this._node=Gg(e),this._parent=null,this._input=null}get node(){return this._node}set parent(e){this._parent=e}get parent(){return this._parent}set input(e){this._input=e}get input(){return this._input}}function Kg(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return new Xg(...t)}function Zg(e,t){const n=e.parent;if(n&&"stage"!==n.type){t.parent=Kg(n);const e=n.parent;e&&"stage"!==e.type&&Zg(e,t.parent)}}function Jg(e,t,n){if(null===e.colliderType)return null;const i=function(e,t){let n={};if(e.modelViewMatrix)if(Array.isArray(t))n=e.inverseModelViewMatrix.transformPoints(t);else if(isNaN(t.r))Array.isArray(t.vertices)?n.vertices=e.inverseModelViewMatrix.transformPoints(t.vertices):n=e.inverseModelViewMatrix.transformPoint(t);else{const i={x:t.cx,y:t.cy};({x:n.cx,y:n.cy}=e.inverseModelViewMatrix.transformPoint(i)),n.r=t.r}else n=t;return Array.isArray(n.vertices)&&(n=n.vertices.every((e=>Array.isArray(e)))?Ng(n):qg(n)),n}(e,n);return"frontChild"===e.colliderType?function(e,t,n){for(let i=e.descendants.length-1;i>=0;i--){const r=e.descendants[i];if(null!==r.collider&&r.collider[t](n)){const e=Kg(r);return Zg(r,e),e}}return null}(e,t,i):function(e,t,n){if(e.collider[t](n)){const t=Kg(e);return Zg(e,t),t}return null}(e,t,i)}function Qg(e,t,n,i){const r=e.length;for(let o=0;o<r;o++){const r=e[o],a=Jg(r,t,i);a&&n.push(a),!r.children||a||r.collider||Qg(r.children,t,n,i)}}function ey(e,t,n){const i=e.length;for(let r=0;r<i;r++){const i=e[r];if(null!==Jg(i,t,n))return!0;if(i.children&&!i.collider)return ey(i.children,t,n)}return!1}function ty(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;let n={};switch(dr(e)){case"circle":return n.cx=e.cx*t,n.cy=e.cy*t,n.r=e.r,["intersectsCircle",n];case"rect":return n=cr(e).map((e=>Fu(e,t))),["intersectsRect",n];case"line":return n=lr(e).map((e=>Fu(e,t))),["intersectsLine",n];case"point":return n=Fu(e,t),["containsPoint",n];case"polygon":return n.vertices=e.vertices.map((e=>Fu(e,t))),["intersectsPolygon",n];case"geopolygon":return n.vertices=e.vertices.map((e=>e.map((e=>Fu(e,t))))),["intersectsGeoPolygon",n];default:return[]}}function ny(e,t){const[n,i]=ty(t,e.dpi),r=[];return n&&(Qg([e],n,r,i),function(e,t){for(let n=0,i=t.length;n<i;n++)t[n].input=e}(t,r)),r}function iy(e,t){const[n,i]=ty(t,e.dpi);return ey([e],n,i)}class ry extends wg{constructor(e){super(e),this._stage=null,this._collider={type:null,definition:null,fn:null},this._attrs={},this._node=null}set(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.node=e;const{data:t,desc:n,tag:i,strokeReference:r,fillReference:o}=e;var a,s;a=this.attrs,s=e,Object.keys(Ru).forEach((e=>{const t=s[e];void 0!==t&&(a[Ru[e]]=t)})),void 0!==t&&(this.data=t),"object"==typeof n&&(this.desc=Qi(!0,{},n)),"string"==typeof i&&(this.tag=i),"string"==typeof r&&(this.strokeReference=r),"string"==typeof o&&(this.fillReference=o)}findShapes(e){return Wg.find(e,this).map((e=>Gg(e)))}getItemsFrom(e){return ny(this,e)}containsPoint(e){return iy(this,e)}intersectsLine(e){return iy(this,e)}intersectsRect(e){return iy(this,e)}intersectsCircle(e){return iy(this,e)}intersectsPolygon(e){return iy(this,e)}intersectsGeoPolygon(e){return iy(this,e)}resolveLocalTransform(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new Pg;void 0!==this.attrs.transform&&Vg(this.attrs.transform,e),this.modelViewMatrix=e.clone()}resolveGlobalTransform(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new Pg;const t=this.ancestors;if(t.length>0)for(let n=t.length-1;n>=0;n--)t[n].resolveLocalTransform(e),e=t[n].modelViewMatrix;this.resolveLocalTransform(e)}attr(e){return this.attrs[e]}equals(e){const t=this.attrs,n=Object.keys(t),i=e.attrs,r=Object.keys(i);if(n.length!==r.length)return!1;for(let e=0;e<n.length;e++){const r=n[e];if(!Object.hasOwnProperty.call(i,r))return!1;if(t[r]!==i[r])return!1}return super.equals(e)}toJSON(){const e=super.toJSON();return e.attrs=this.attrs,e}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(e){this._mvm=e,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(e){this._node=e}get node(){return this._node}set collider(e){const t=Array.isArray(e)?"collection":e&&e.type;return"string"!=typeof t?(this._collider.type=null,this._collider.definition=null,void(this._collider.fn=null)):null!==this._collider&&this._collider.type===t&&null!==this._collider.fn?(this._collider.fn.set(e),void(this._collider.definition=e)):(this._collider.type=t,void(this._collider.definition=e))}get collider(){if(null!==this._collider.fn)return this._collider.fn;switch(this._collider.type){case"collection":this._collider.fn=function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return new Og(...t)}(this._collider.definition);break;case"frontChild":return!0;case"bounds":this._collider.fn=Ig("rect",this.boundingRect());break;case"line":case"rect":case"circle":case"polygon":case"geopolygon":case"polyline":this._collider.fn=Ig(this._collider.type,this._collider.definition);break;default:return null}return this._collider.fn}get colliderType(){return this._collider.type}}class oy extends wg{addChild(e){if(!(e&&e instanceof wg))throw new TypeError("Expecting a Node as argument, but got ".concat(e));if(e===this)throw new Error("Can not add itself as child!");if(e._children&&e._children.length&&this.ancestors.indexOf(e)>=0)throw new Error("Can not add an ancestor as child!");return e._parent&&e._parent!==this&&e._parent.removeChild(e),this._children.push(e),e._parent=this,e._ancestors=null,this}addChildren(e){let t,n=e?e.length:0;for(t=0;t<n;t++)this.addChild(e[t]);return this}removeChild(e){const t=this._children.indexOf(e);return t>=0&&(this._children.splice(t,1),e._parent=null,e._ancestors=null),this}removeChildren(e){let t,n;if(!this._children)return this;if(e)for(n=e.length,t=0;t<n;t++)this.removeChild(e[t]);else for(;this._children.length;)this.removeChild(this._children[0]);return this}}const ay=oy.prototype;class sy extends ry{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const{type:t="container"}=e;super(t),this.set(e)}set(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};super.set(e);const{collider:t}=e,n=Qi({type:null},t);this.collider=n,this.__boundingRect={true:null,false:null},this.__bounds={true:null,false:null}}appendChildRect(e,t){if(void 0!==e.bounds){const n=this.__boundingRect[t]||{},[i,,r]=e.bounds(t),{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[t]=n}}boundingRect(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(null!==this.__boundingRect[e])return this.__boundingRect[e];const t=this.children.length;for(let n=0;n<t;n++)this.appendChildRect(this.children[n],e);return this.__boundingRect[e]=Qi({x:0,y:0,width:0,height:0},this.__boundingRect[e]),this.__boundingRect[e]}bounds(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(null!==this.__bounds[e])return this.__bounds[e];const t=this.boundingRect(e);return this.__bounds[e]=[{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}],this.__bounds[e]}addChild(e){const t=ay.addChild.call(this,e);if(this._collider&&"bounds"===this._collider.type){this.appendChildRect(e,!0);const t=Qi({type:"bounds",x:0,y:0,width:0,height:0},this.__boundingRect.true);this.collider=t}return t}addChildren(e){const t=ay.addChildren.call(this,e),n=e.length;if(this._collider&&"bounds"===this._collider.type&&n>0){for(let t=0;t<n;t++)this.appendChildRect(e[t],!0);const t=Qi({type:"bounds",x:0,y:0,width:0,height:0},this.__boundingRect.true);this.collider=t}return t}removeChild(e){e._stage=null;let t,n=e.descendants,i=n?n.length:0;for(t=0;t<i;t++)n[t]._stage=null;if(ay.removeChild.call(this,e),this._collider&&"bounds"===this._collider.type){this.__boundingRect={true:null,false:null},this.__bounds={true:null,false:null};const e=Qi(this.boundingRect(!0),{type:"bounds"});this.collider=e}return this}removeChildren(e){if(ay.removeChildren.call(this,e),this._collider&&"bounds"===this._collider.type){this.__boundingRect={true:null,false:null},this.__bounds={true:null,false:null};const e=Qi(this.boundingRect(!0),{type:"bounds"});this.collider=e}return this}}function ly(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return new sy(...t)}class cy extends sy{constructor(e){super("stage"),this._stage=this,this._dpiRatio=e||1}get dpi(){return this._dpiRatio}}const uy=oy.prototype,hy=["x1","x2","y1","y2","id","offset","style"];class dy extends ry{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const{type:t="container"}=e;super(t),this.set(e),this._boundingRect={}}set(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};super.set(e);const t=this.attrs;let n="";for(let i=0,r=hy.length;i!==r;i++)n=hy[i],void 0!==e[n]&&(t[n]=e[n])}addChild(e){return uy.addChild.call(this,e)}addChildren(e){return uy.addChildren.call(this,e)}removeChild(e){e._stage=null;let t,n=e.descendants,i=n?n.length:0;for(t=0;t<i;t++)n[t]._stage=null;return uy.removeChild.call(this,e),this}removeChildren(e){return uy.removeChildren.call(this,e),this}}function fy(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return new dy(...t)}const py=oy.prototype,my=["patternUnits","x","y","width","height","id"];class gy extends ry{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const{type:t="container"}=e;super(t),this.set(e),this._boundingRect={}}set(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};super.set(e);const t=this.attrs;let n="";for(let i=0,r=my.length;i!==r;i++)n=my[i],void 0!==e[n]&&(t[n]=e[n])}addChild(e){return py.addChild.call(this,e)}addChildren(e){return py.addChildren.call(this,e)}removeChild(e){e._stage=null;let t,n=e.descendants,i=n?n.length:0;for(t=0;t<i;t++)n[t]._stage=null;return py.removeChild.call(this,e),this}removeChildren(e){return py.removeChildren.call(this,e),this}}class yy extends ry{constructor(){super("rect"),this.set(...arguments)}set(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const{x:t=0,y:n=0,width:i=0,height:r=0,rx:o=0,ry:a=0,collider:s}=e,l=Qi({type:"rect",x:t,y:n,width:i,height:r},s);super.set(e),i>=0?(this.attrs.x=t,this.attrs.width=i):(this.attrs.x=t+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 e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(null!==this.__boundingRect[e])return this.__boundingRect[e];const t=cr(this.attrs),n=e&&this.modelViewMatrix?this.modelViewMatrix.transformPoints(t):t,[i,r,o,a]=sr(n);return this.__boundingRect[e]={x:i,y:r,width:o-i,height:a-r},this.__boundingRect[e]}bounds(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(null!==this.__bounds[e])return this.__bounds[e];const t=this.boundingRect(e);return this.__bounds[e]=[{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}],this.__bounds[e]}}class xy extends ry{constructor(){super("circle"),this.set(...arguments)}set(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const{cx:t=0,cy:n=0,r:i=0,collider:r}=e,o=Qi({type:"circle",cx:t,cy:n,r:i},r);super.set(e),this.attrs.cx=t,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 e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(null!==this.__boundingRect[e])return this.__boundingRect[e];const t=this.bounds(e);return this.__boundingRect[e]={x:t[0].x,y:t[0].y,width:t[2].x-t[0].x,height:t[2].y-t[0].y},this.__boundingRect[e]}bounds(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(null!==this.__bounds[e])return this.__bounds[e];const{cx:t,cy:n,r:i,r:r}=this.attrs,o=t-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(e&&this.modelViewMatrix){c=this.modelViewMatrix.transformPoints(c);const[t,n,i,r]=sr(c);s=i-t,l=r-n,this.__bounds[e]=[{x:t,y:n},{x:t+s,y:n},{x:t+s,y:n+l},{x:t,y:n+l}]}else this.__bounds[e]=c;return this.__bounds[e]}}class vy extends ry{constructor(){super("line"),this.set(...arguments)}set(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const{x1:t=0,y1:n=0,x2:i=0,y2:r=0,collider:o}=e;super.set(e),this.attrs.x1=t,this.attrs.y1=n,this.attrs.x2=i,this.attrs.y2=r;const a={type:"line",x1:t,y1:n,x2:i,y2:r};this.collider=Qi(a,o),this.__boundingRect={true:null,false:null},this.__bounds={true:null,false:null}}boundingRect(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(null!==this.__boundingRect[e])return this.__boundingRect[e];let t=lr(this.attrs);e&&this.modelViewMatrix&&(t=this.modelViewMatrix.transformPoints(t));const[n,i,r,o]=sr(t),a=n!==r||i!==o;return this.__boundingRect[e]={x:n,y:i,width:a?Math.max(1,r-n):0,height:a?Math.max(1,o-i):0},this.__boundingRect[e]}bounds(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(null!==this.__bounds[e])return this.__bounds[e];const t=this.boundingRect(e);return this.__bounds[e]=[{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}],this.__bounds[e]}}const by=Math.PI/2;function wy(e,t){const n=Math.atan2(t.y-e.y,t.x-e.x);return n<0?n+2*Math.PI:n}function My(e,t,n){return{x:e.x+Math.cos(t)*n,y:e.y+Math.sin(t)*n}}const ky={step:function(e){return new uo(e,.5)},stepAfter:function(e){return new uo(e,1)},stepBefore:function(e){return new uo(e,0)},linear:Vr,basis:function(e){return new Xr(e)},cardinal:Jr.tension(0),catmullRom:eo,monotonex:function(e){return new oo(e)},monotoney:function(e){return new ao(e)},natural:function(e){return new lo(e)}};function Sy(e){if(e.length<2)return!1;const t=e[0],n=e[e.length-1];return Math.abs(t.x-n.x)<1e-12&&Math.abs(t.y-n.y)<1e-12}class _y extends ry{constructor(){super("path"),this.set(...arguments)}set(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(super.set(e),this.segments=[],this.points=[],e.arcDatum){const t=Fr();t.innerRadius(e.desc.slice.innerRadius),t.outerRadius(e.desc.slice.outerRadius),t.cornerRadius(e.desc.slice.cornerRadius);const n=t(e.arcDatum);this.attrs.d=n}else if(e.points){const{major:t,minor:n,layerObj:i,points:r,stngs:o,generatorType:a}=e,s=$r(),l=o.coordinates?o.coordinates.defined:null;s[t.p]((e=>e.major*t.size))["".concat(n.p,"1")]((e=>e.minor*n.size))["".concat(n.p,"0")]((e=>e.minor0*n.size)).curve(ky["monotone"===i.curve?"monotone".concat(t.p):i.curve]),l?s.defined((e=>!e.dummy&&"number"==typeof e.minor&&!isNaN(e.minor)&&e.defined)):s.defined((e=>!e.dummy&&"number"==typeof e.minor&&!isNaN(e.minor)));const c=o.connect?r.filter(s.defined()):r,u=("area"===a?s:s[a]())(c);this.attrs.d=u}else e.d&&(this.attrs.d=e.d);if(this.__boundingRect={true:null,false:null},this.__bounds={true:null,false:null},Array.isArray(e.collider)||"object"==typeof e.collider&&void 0!==e.collider.type)this.collider=e.collider;else if(this.attrs.d){if(this.segments=xg(this.attrs.d),this.segments.length>1&&this.segments.every((e=>Sy(e))))return void(this.collider=Qi({type:"geopolygon",vertices:this.segments},e.collider));this.segments.forEach((t=>{if(t.length<=1);else if(Sy(t))this.collider=Qi({type:"polygon",vertices:t},e.collider);else if("object"==typeof e.collider&&e.collider.visual){const n=this.attrs["stroke-width"]/2;this.collider=function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const i=[],r=[];if("h"===n.forceOrientation){const t=e[0].x<e[1].x?-1:1,n=e[e.length-1].x>e[e.length-2].x?1:-1;e.unshift({x:e[0].x+t,y:e[0].y}),e.push({x:e[e.length-1].x+n,y:e[e.length-1].y})}else if("v"===n.forceOrientation){const t=e[0].y<e[1].y?-1:1,n=e[e.length-1].y>e[e.length-2].y?1:-1;e.unshift({x:e[0].x,y:e[0].y+t}),e.push({x:e[e.length-1].x,y:e[e.length-1].y+n})}const o=e.length-1;for(let n=1;n<o;n++){const a=e[n-1],s=e[n],l=e[n+1],c=wy(s,a),u=wy(s,l),h=(c+u)/2,d=h+Math.PI,f=Math.max(h,d),p=Math.min(h,d),m=c>u;if(1===n){const e=wy(a,s);i.push(My(a,e-by,t)),r.unshift(My(a,e+by,t))}const g=m?f:p,y=m?p:f;if(i.push(My(s,g,t)),r.unshift(My(s,y,t)),n===o-1){const e=wy(l,s);i.push(My(l,e+by,t)),r.unshift(My(l,e-by,t))}}return{type:"polygon",vertices:[...i,...r]}}(t,n,e.collider)}else this.collider=Qi({type:"polyline",points:t},e.collider)}))}}boundingRect(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(null!==this.__boundingRect[e])return this.__boundingRect[e];this.points.length||(this.segments=this.segments.length?this.segments:xg(this.attrs.d),this.points=function(e){const t=[];let n,i=e.length;for(let r=0;r<i;r++){n=e[r];for(let e=0;e<n.length;e++)t.push(n[e])}return t}(this.segments));const t=e&&this.modelViewMatrix?this.modelViewMatrix.transformPoints(this.points):this.points,[n,i,r,o]=sr(t);return this.__boundingRect[e]={x:n||0,y:i||0,width:r-n||0,height:o-i||0},this.__boundingRect[e]}bounds(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(null!==this.__bounds[e])return this.__bounds[e];const t=this.boundingRect(e);return this.__bounds[e]=[{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}],this.__bounds[e]}}function qy(e){let{data:t,_boundingRect:n,_textBoundsFn:i}=e;return null!=t&&(n||i)}class Dy extends ry{constructor(){super("text"),this.set(...arguments)}set(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const{x:t=0,y:n=0,dx:i=0,dy:r=0,textBoundsFn:o,text:a,title:s,collider:l,boundingRect:c,ellipsed:u}=e;super.set(e),this.attrs.x=t,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=Qi({type:qy(this)?"bounds":null},l),this.__boundingRect={true:null,false:null},this.__bounds={true:null,false:null}}boundingRect(){let e,t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(null!==this.__boundingRect[t])return this.__boundingRect[t];if("function"!=typeof this._textBoundsFn)return{x:0,y:0,width:0,height:0};e=this._textBoundsFn(this.attrs);const n=cr(e),i=t&&this.modelViewMatrix?this.modelViewMatrix.transformPoints(n):n,[r,o,a,s]=sr(i);return this.__boundingRect[t]={x:r,y:o,width:a-r,height:s-o},this.__boundingRect[t]}bounds(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(null!==this.__bounds[e])return this.__bounds[e];const t=this.boundingRect(e);return this.__bounds[e]=[{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}],this.__bounds[e]}}const Ay=yo();function Cy(e,t){return Ay.get(e)(t)}Ay.add("rect",(function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return new yy(...t)})),Ay.add("circle",(function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return new xy(...t)})),Ay.add("text",(function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return new Dy(...t)})),Ay.add("line",(function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return new vy(...t)})),Ay.add("path",(function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return new _y(...t)})),Ay.add("stage",(function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return new cy(...t)})),Ay.add("container",ly),Ay.add("defs",ly),Ay.add("linearGradient",fy),Ay.add("radialGradient",fy),Ay.add("conicGradient",fy),Ay.add("stop",fy),Ay.add("pattern",(function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return new gy(...t)}));const Ny=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];const t=[{}];function n(){return t[t.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 t=0;t<e.length;t++)a=e[t],void 0!==r[a]&&(o[a]=r[a]);return Qi(o,i),t.push(o),n()},n.restore=function(){t.splice(t.length-1,1)},n}(["stroke","fill","strokeWidth","opacity","fontFamily","fontSize","baseline"]);function Ey(e,t){if(Array.isArray(t))for(let n=0,i=t.length;n<i;n++)t[n](e)}function Ry(e,t,n){e.node=n[t],e.index=t}function Iy(e,t,n,i){let r=!1;const o={siblings:e,node:null,index:0};for(let a=0,s=e.length;a<s;a++){if(Ry(o,a,e),Ey(o,i.create),r="function"==typeof o.node.disabled?o.node.disabled():o.node.disabled,r)continue;o.node=Ny.save(o.node);const s=Cy(o.node.type,o.node);s&&(o.node.transform&&(n.save(),Vg(o.node.transform,n)),n.isIdentity()||(s.modelViewMatrix=n.clone()),t.addChild(s),o.node.children&&Iy(o.node.children,s,n,i),o.node.transform&&n.restore()),Ny.restore()}}function Oy(e){let{items:t,stage:n,dpi:i,on:r={}}=e;return n||(n=Cy("stage",i)),Iy(t,n,new Pg,r),n}function Py(e,t,n){const{orientation:i,degree:r,stops:o=[]}=n;let a=null;if("radial"===i){const n=t.boundingRect();a=e.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 t=n.startAngle||0,i=n.x||0,r=n.y||0;a=e.createConicGradient(t,i,r)}else{const i=Lu(r);["x1","x2","y1","y2"].forEach((e=>{e in n&&(i[e]=n[e])}));const o=t.boundingRect();a=e.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 e=0,t=o.length;e<t;e++){let t=o[e];a.addColorStop(t.offset,t.color)}return a}function Ly(e,t,n){return t.width=e.width,t.height=e.height,n.save(),n.fillStyle=e.fill,e.shapes.forEach((e=>{if("rect"===e.type)n.rect(e.x,e.y,e.width,e.height)})),n.fill(),n.restore(),n.createPattern(t,"repeat")}function Ty(){let{x:e,y:t,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(e)?s.x:e,s.y=isNaN(t)?s.y:t,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((e=>{!isNaN(a[e])&&a[e]>0&&(s.edgeBleed[e]=a[e],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 zy(){const e={element:()=>{},root:()=>{},settings:()=>{},appendTo:()=>{},getScene:()=>[],render:()=>!1,itemsAt:()=>[],findShapes:()=>[],clear:()=>{},destory:()=>{},size:()=>{},measureText:um,textBounds:dm,setKey:t=>{e.element().setAttribute("data-key",t)}};return e}function Fy(e){return t=>{let{node:n}=t;"text"!==n.type||null==n.data||n.textBoundsFn||(n.textBoundsFn=e.textBounds)}}const jy=200,Vy=200;class By{constructor(e){this.targetCanvas=e,this.bufferCanvas=e.cloneNode()}updateSize(e){let t,{rect:n,dpiRatio:i,canvasBufferSize:r}=e;t=r?"function"==typeof r?r(n):r:{width:n.computedPhysical.width+2*jy,height:n.computedPhysical.height+2*Vy},this.bufferCanvas.style.width="".concat(t.width,"px"),this.bufferCanvas.style.height="".concat(t.height,"px"),this.bufferCanvas.width=Math.round(t.width*i),this.bufferCanvas.height=Math.round(t.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 Hy=yo();function $y(e){return Array.isArray(e)?e:"string"==typeof e?-1!==e.indexOf(",")?e.split(","):e.split(" "):[]}function Wy(e){return("undefined"==typeof window?1:window.devicePixelRatio||1)/(e.webkitBackingStorePixelRatio||e.mozBackingStorePixelRatio||e.msBackingStorePixelRatio||e.oBackingStorePixelRatio||e.backingStorePixelRatio||1)}function Uy(e,t){t.setTransform(e[0][0],e[1][0],e[0][1],e[1][1],e[0][2],e[1][2])}function Yy(e,t,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 t.attrs&&!(s in i)&&e[s]!==t.attrs[a]){const n=l?l(t.attrs[a]):t.attrs[a];"function"==typeof e[s]?e[s](n):e[s]=n}}for(let t=0,n=r.length;t<n;t++){const n=r[t];e[n]=i[n]}}function Gy(e,t,n,i){for(let r=0,o=e.length;r<o;r++){let o=e[r],a={};t.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(t,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(t,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))),Yy(t,o,n,a),o.modelViewMatrix&&Uy(o.modelViewMatrix.elements,t),Hy.has(o.type)&&Hy.get(o.type)(o.attrs,{g:t,doFill:"fill"in o.attrs&&"none"!==o.attrs.fill,doStroke:"stroke"in o.attrs&&0!==o.attrs["stroke-width"],ellipsed:o.ellipsed}),o.children&&Gy(o.children,t,n,i),t.restore()}}function Xy(){let e,t,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Oy;const i={transform:void 0,canvasBufferSize:void 0,progressive:void 0};let r,o=!1,a=Ty();const s=[["fill","fillStyle"],["stroke","strokeStyle"],["opacity","globalAlpha"],["globalAlpha","globalAlpha"],["stroke-width","lineWidth"],["stroke-linejoin","lineJoin"],["stroke-dasharray","setLineDash",$y]];let l;const c=zy();return c.element=()=>e,c.root=()=>e,c.settings=e=>(e&&Object.keys(i).forEach((t=>{void 0!==e[t]&&(i[t]=e[t])})),i),c.appendTo=n=>(e||(e=n.ownerDocument.createElement("canvas"),e.style.position="absolute",e.style["-webkit-font-smoothing"]="antialiased",e.style["-moz-osx-font-smoothing"]="antialiased",e.style.pointerEvents="none"),"function"!=typeof i.transform||t||(t=new By(e)),n.appendChild(e),e),c.getScene=i=>{const r=Wy(t&&t.getContext()||e.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:[em(c.measureText),Fy(c)]}})},c.render=n=>{if(!e)return!1;l||(l=function(e){const t=e.createElement("canvas"),n=t.getContext("2d");let i={};return{create(e){const r=e.key;return r?(i[r]=i[r]||Ly(e,t,n),i[r]):Ly(e,t,n)},clear(){i={}}}}(e.ownerDocument));const u=t&&t.getContext()||e.getContext("2d"),h=Wy(u),d=t&&i.transform();if(d)return e.width=e.width,function(e){let{el:t,dpiRatio:n,transform:i}=e;if("object"==typeof i){const e=[i.horizontalScaling,i.horizontalSkewing,i.verticalSkewing,i.verticalScaling,i.horizontalMoving*n,i.verticalMoving*n];t.getContext("2d").setTransform(...e)}}({el:e,dpiRatio:h,transform:d}),t.apply(),!0;o&&(e.style.left="".concat(a.computedPhysical.x,"px"),e.style.top="".concat(a.computedPhysical.y,"px"),e.style.width="".concat(a.computedPhysical.width,"px"),e.style.height="".concat(a.computedPhysical.height,"px"),e.width=Math.round(a.computedPhysical.width*h),e.height=Math.round(a.computedPhysical.height*h),t&&t.updateSize({rect:a,dpiRatio:h,canvasBufferSize:i.canvasBufferSize}));const f=c.getScene(n),p=!r||!f.equals(r);l.clear();const m=o||p,g="function"==typeof i.progressive&&i.progressive();return m&&(g&&!g.isFirst||c.clear(),Gy(f.children,u,s,{patterns:l})),t&&(e.width=e.width,t.apply()),o=!1,g&&!g.isFirst&&f.children.unshift(...r.children),r=f,m},c.itemsAt=e=>r?r.getItemsFrom(e):[],c.findShapes=e=>r?r.findShapes(e):[],c.clear=()=>(e&&(e.width=e.width),t&&t.clear(),r=null,c),c.size=e=>{if(e){const t=Ty(e);JSON.stringify(a)!==JSON.stringify(t)&&(o=!0,a=t)}return a},c.destroy=()=>{e&&(e.parentElement&&e.parentElement.removeChild(e),e=null),t&&(t=null),r=null},c}function Ky(e,t){Hy.add(e,t)}function Zy(e,t){return Math.max(0,Math.min(e,t))}const Jy=new RegExp("[A-Za-zªµºÀ-ÖØ-öø-ʸʻ-ˁː-ˑˠ-ˤˮͰ-ͳͶ-ͽΆΈ-ϵϷ-҂Ҋ-։ः-हऻऽ-ीॉ-ौॎ-ॐक़-ॡ।-ॿং-হঽ-ীে-ৌৎ-ৡ০-ৱ৴-৺ਃ-ਹਾ-ੀਖ਼-੯ੲ-ੴઃ-હઽ-ીૉ-ૌૐ-ૡ૦-૯ଂ-ହଽ-ାୀେ-ୌୗ-ୡ୦-୷ஃ-ிு-ௌௐ-௲ఁ-ఽు-ౄౘ-ౡ౦-౯౿-ಹಽ-ೋೕ-ೡ೦-ീെ-ൌൎ-ൡ൦-ෆා-ෑෘ-ะา-ำเ-ๆ๏-ະາ-ຳຽ-ໆ໐-༗༚-༴༶༸༾-ཬཿ྅ྈ-ྌ྾-࿅࿇-ာေးျ-ြဿ-ၗၚ-ၝၡ-ၰၵ-ႁႃ-ႄႇ-ႌႎ-ႜ႞-ፚ፠-ᎏᎠ-Ᏼᐁ-ᙿᚁ-ᚚᚠ-ᜑᜠ-ᜱ᜵-ᝑᝠ-ᝰក-ាើ-ៅះ-ៈ។-៚ៜ០-៩᠐-ᢨᢪ-ᤜᤣ-ᤦᤩ-ᤱᤳ-ᤸ᥆-᧚ᨀ-ᨖᨙ-ᩕᩗᩡᩣ-ᩤᩭ-ᩲ᪀-᪭ᬄ-ᬳᬵᬻᬽ-ᭁᭃ-᭪᭴-᭼ᮂ-ᮡᮦ-ᮧ᮪-ᯥᯧᯪ-ᯬᯮ᯲-ᰫᰴ-ᰵ᰻-᱿᳓᳡ᳩ-ᳬᳮ-ᶿḀ-ᾼιῂ-ῌῐ-Ίῠ-Ῥῲ-ῼ‎ⁱⁿₐ-ₜℂℇℊ-ℓℕℙ-ℝℤΩℨK-ℭℯ-ℹℼ-ℿⅅ-ⅉⅎ-⅏Ⅰ-ↈ⌶-⍺⎕⒜-ⓩ⚬⠀-⣿Ⰰ-ⳤⳫ-ⳮⴀ-⵰ⶀ-ⷞ々-〇〡-〩〱-〵〸-〼ぁ-ゖゝ-ゟァ-ヺー-ㆺㇰ-㈜㈠-㉏㉠-㉻㉿-㊰㋀-㋋㋐-㍶㍻-㏝㏠-㏾㐀-䶵一-ꒌꓐ-ꘌꘐ-ꙮꚀ-ꛯ꛲-꛷Ꜣ-ꞇ꞉-ꠁꠃ-ꠅꠇ-ꠊꠌ-ꠤꠧ꠰-꠷ꡀ-ꡳꢀ-ꣃ꣎-꣙ꣲ-ꤥ꤮-ꥆꥒ-ꥼꦃ-ꦲꦴ-ꦵꦺ-ꦻꦽ-ꨨꨯ-ꨰꨳ-ꨴꩀ-ꩂꩄ-ꩋꩍ-ꪯꪱꪵ-ꪶꪹ-ꪽꫀꫂ-ꯤꯦ-ꯧꯩ-꯬꯰-ﬗA-Za-zヲ-ᅵ]"),Qy=new RegExp("[־׀׃׆א-״߀-ߪߴ-ߵߺ-ࠕࠚࠤࠨ࠰-ࡘ࡞‏יִײַ-ﬨשׁ-ﭏ]"),ex=new RegExp("[؈؋؍؛-ي٭-ٯٱ-ەۥ-ۦۮ-ۯۺ-܍ܐܒ-ܯݍ-ޥޱﭐ-ﴽﵐ-﷼ﹰ-ﻼ]");function tx(e){return Jy.test(e)}function nx(e){return Qy.test(e)||ex.test(e)}function ix(e){let t,n,i=e?e.length:0;for(t=0;t<i;t++){if(n=e[t],tx(n))return"ltr";if(nx(n))return"rtl"}return"ltr"}const rx={start:"end",end:"start",center:"center",middle:"middle"};function ox(e,t){return"rtl"===t?rx[e]:e}function ax(e,t){const n=[];let i;const r=[],o=[],a=[];let s,l;const c=e=>e.id,u=(e,t)=>{let n;return n="object"==typeof e?"id"in e?e.id:t:e,{content:e,id:"".concat(n,"__").concat(e.type||"")}};e.isTree||(e=e.map(u)),t=t.map(u),s=e.map(c),l=t.map(c);for(let e=0,i=t.length;e<i;e++){-1===s.indexOf(t[e].id)?n.push(t[e]):o.push(t[e])}for(let t=0,n=e.length;t<n;t++){-1===l.indexOf(e[t].id)?r.push(e[t]):a.push(e[t])}for(let e=0,t=n.length;e<t;e++)n[e].content.children&&(n[e].diff=ax([],n[e].content.children),n[e].children=n[e].diff.updatedNew.concat(n[e].diff.added),n[e].children.isTree=!0);for(let e=0,t=o.length;e<t;e++)o[e].diff=ax(a[e].children||[],o[e].content.children||[]),o[e].object=a[e].object,o[e].children=o[e].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 sx(e,t,n){for(let i=0,r=e.length;i<r;i++)e[i].object=n(e[i].content.type,t)}function lx(e,t){for(let n=0,i=e.length;n<i;n++)null!==e[n].object&&void 0!==e[n].object&&(t(e[n].object),e[n].object=null)}function cx(e,t,n,i){let r;for(let o=0,a=e.length;o<a;o++)r=e[o],null!==r.object&&void 0!==r.object&&(n(r.object,r.content),r.diff&&(sx(r.diff.added,r.object,t),lx(r.diff.removed,i),cx(r.diff.items,t,n,i)))}function ux(e,t,n,i,r,o){const a=ax(e,t);return sx(a.added,n,i),lx(a.removed,o),cx(a.items,i,r,o),a.items}Ky("rect",(function(e,t){let{g:n,doFill:i,doStroke:r}=t;n.beginPath(),e.rx>0||e.ry>0?function(e,t,n,i,r,o,a){o=Zy(i/2,o>0?o:a),a=Zy(r/2,a>0?a:o),e.moveTo(t,n+a),e.lineTo(t,n+r-a),e.quadraticCurveTo(t,n+r,t+o,n+r),e.lineTo(t+i-o,n+r),e.quadraticCurveTo(t+i,n+r,t+i,n+r-a),e.lineTo(t+i,n+a),e.quadraticCurveTo(t+i,n,t+i-o,n),e.lineTo(t+o,n),e.quadraticCurveTo(t,n,t,n+a)}(n,e.x,e.y,e.width,e.height,e.rx,e.ry):n.rect(e.x,e.y,e.width,e.height),i&&n.fill(),r&&n.stroke()})),Ky("circle",(function(e,t){let{g:n,doFill:i,doStroke:r}=t;n.beginPath(),n.moveTo(e.cx+e.r,e.cy),n.arc(e.cx,e.cy,e.r,0,2*Math.PI,!1),i&&n.fill(),r&&n.stroke()})),Ky("line",(function(e,t){let{g:n,doStroke:i}=t;n.beginPath(),n.moveTo(e.x1,e.y1),n.lineTo(e.x2,e.y2),i&&n.stroke()})),Ky("path",(function(e,t){let{g:n,doStroke:i,doFill:r}=t;const o=new Path2D(e.d);r&&n.fill(o),i&&n.stroke(o)})),Ky("text",(function(e,t){let{g:n,ellipsed:i,doStroke:r}=t;const o=i||tm(e,um);n.font=[e["font-style"],e["font-weight"],e["font-size"],e["font-family"]].filter((e=>!!e)).join(" ");const a=ix(e.text);n.canvas.dir!==a&&(n.canvas.dir=a);const s=ox("middle"===e["text-anchor"]?"center":e["text-anchor"],n.canvas.dir);s&&n.textAlign!==s&&(n.textAlign=s);const l=nm(e);n.fillText(o,e.x+e.dx,e.y+e.dy+l),r&&n.strokeText(o,e.x+e.dx,e.y+e.dy+l)}));const hx="http://www.w3.org/2000/svg",dx=(e,t)=>{if(!e||"string"!=typeof e)throw new Error("Invalid type: ".concat(e));const n=t.ownerDocument.createElementNS(hx,"container"===e?"g":e);return t.appendChild(n),n},fx=e=>{e.parentNode&&e.parentNode.removeChild(e)},px=(e,t)=>{if((e=>{switch(e.type){case"circle":return!isNaN(e.attrs.cx)&&!isNaN(e.attrs.cy)&&!isNaN(e.attrs.r);case"line":return!(isNaN(e.attrs.x1)||isNaN(e.attrs.y1)||isNaN(e.attrs.x2)||isNaN(e.attrs.y2));case"rect":return!(isNaN(e.attrs.x)||isNaN(e.attrs.y)||isNaN(e.attrs.width)||isNaN(e.attrs.height));case"text":return!isNaN(e.attrs.x)&&!isNaN(e.attrs.y);default:return!0}})(t)){for(const n in t.attrs)if("stroke"===n&&t.strokeReference)e.setAttribute("stroke",t.strokeReference);else if("fill"===n&&t.fillReference)e.setAttribute("fill",t.fillReference);else if("text"===n){e.setAttribute("style","white-space: pre"),e.textContent=t.ellipsed||tm(t.attrs,um);const n=ix(t.attrs.text);"rtl"===n&&(e.setAttribute("direction","rtl"),e.setAttribute("dir","rtl"),e.setAttribute("text-anchor",ox(e.getAttribute("text-anchor"),n)))}else if("text"!==t.type||"dy"!==n&&"dominant-baseline"!==n)if("text"===t.type&&"title"===n&&t.attrs.title){const n=e.ownerDocument.createElementNS(hx,"title");n.textContent=t.attrs.title,e.appendChild(n)}else e.setAttribute(n,t.attrs[n]);else{const i=+e.getAttribute(n)||0;let r=0;r="dominant-baseline"===n?nm(t.attrs):t.attrs[n],e.setAttribute("dy",r+i)}if("string"==typeof t.data||"number"==typeof t.data||"boolean"==typeof t.data)e.setAttribute("data",t.data);else if("object"==typeof t.data&&null!==t.data)for(const n in t.data)"string"!=typeof t.data[n]&&"number"!=typeof t.data[n]&&"boolean"!=typeof t.data[n]||e.setAttribute("data-".concat(n),t.data[n])}};class mx{constructor(e,t,n,i){this.create=e,this.nodeCreator=t,this.nodeMaintainer=n,this.nodeDestroyer=i}render(e,t){return this.create([],e,t,this.nodeCreator,this.nodeMaintainer,this.nodeDestroyer)}}function gx(){return new mx(ux,dx,px,fx)}function yx(e){let t,n,i,r=0;if(0===(e=JSON.stringify(e)).length)return r;for(t=0,i=e.length;t<i;t++)n=e.charCodeAt(t),r=(r<<5)-r+n,r&=r;return r}function xx(){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:hx,t=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Oy;const n=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:gx)();let i,r,o,a=!1,s=Ty();const l={transform:void 0,disableScreenReader:!1},c=zy(),u={type:"defs",children:[]},h=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:yx,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=t(l),u="picasso-pattern-".concat(i,"-").concat(c);if("undefined"!=typeof window&&(s=window.location.href.split("#")[0]),!n[c]){const t={patternUnits:"userSpaceOnUse",x:0,y:0,width:l.width,height:l.height,type:"pattern",id:u,children:[],fill:l.fill};l.shapes.forEach((e=>{t.children.push(e)})),e.push(t),n[c]=!0}r.node["".concat(a,"Reference")]="url('".concat(s,"#").concat(u,"')")}))},clear(){n={}}};return r}(u.children),d=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:yx,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=t(r[o]),l="picasso-gradient-".concat(i,"-").concat(s);if(!n[s]){let{orientation:t,degree:i,stops:a=[]}=r[o],c={};void 0===i&&(i=90),"radial"===t?c.type="radialGradient":(c=Lu(i),["x1","x2","y1","y2"].forEach((e=>{e in r[o]&&(c[e]=r[o][e])})),c.type="linearGradient"),c.id=l,c.children=a.map((e=>{let{offset:t,color:n,opacity:i}=e;return{type:"stop",offset:"".concat(100*t,"%"),style:"stop-color:".concat(n,";stop-opacity:").concat(void 0!==i?i:1)}})),e.push(c),n[s]=l}return"url('".concat(a,"#").concat(l,"')")},onCreate(e){let t="";"undefined"!=typeof window&&(t=window.location.href.split("#")[0]);const n=e.node;n.fill&&"object"==typeof n.fill&&"gradient"===n.fill.type&&(n.fillReference=r.getOrCreateGradient(n,"fill",t)),n.stroke&&"object"==typeof n.stroke&&"gradient"===n.stroke.type&&(n.strokeReference=r.getOrCreateGradient(n,"stroke",t))},clear(){n={}}};return r}(u.children);return c.element=()=>i,c.root=()=>r,c.settings=e=>(e&&Object.keys(l).forEach((t=>{void 0!==e[t]&&(l[t]=e[t])})),l),c.appendTo=t=>(i||(i=t.ownerDocument.createElementNS(e,"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",e),r=t.ownerDocument.createElementNS(e,"g"),r.style.pointerEvents="auto",i.appendChild(r)),t.appendChild(i),i),c.getScene=e=>{const n=s.scaleRatio.x,i=s.scaleRatio.y,r={type:"container",children:Array.isArray(e)?[...e,u]:e,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,")")),t({items:[r],on:{create:[e=>{e.node.fillReference=void 0,e.node.strokeReference=void 0},d.onCreate,h.onCreate,em(c.measureText),Fy(c)]}})},c.render=e=>{if(!i)return!1;const t="function"==typeof l.transform&&l.transform();if(t){const{horizontalScaling:e,horizontalSkewing:n,verticalSkewing:i,verticalScaling:o,horizontalMoving:a,verticalMoving:s}=t;return r.style.transform="matrix(".concat(e,", ").concat(n,", ").concat(i,", ").concat(o,", ").concat(a,", ").concat(s,")"),!0}r.style.transform="";l.disableScreenReader&&i.setAttribute("aria-hidden",!0),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(e),p=!o||!f.equals(o),m=a||p;return m&&(c.clear(),n.render(f.children,r)),a=!1,o=f,m},c.itemsAt=e=>o?o.getItemsFrom(e):[],c.findShapes=e=>o?o.findShapes(e):[],c.clear=()=>{if(!r)return c;o=null;const e=r.cloneNode(!1);return i.replaceChild(e,r),r=e,c},c.destroy=()=>{i&&i.parentNode&&i.parentNode.removeChild(i),i=null,r=null},c.size=e=>{if(e){const t=Ty(e);JSON.stringify(s)!==JSON.stringify(t)&&(a=!0,s=t)}return s},c}var vx,bx,wx,Mx,kx,Sx,_x,qx={},Dx=[],Ax=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i;function Cx(e,t){for(var n in t)e[n]=t[n];return e}function Nx(e){var t=e.parentNode;t&&t.removeChild(e)}function Ex(e,t,n){var i,r,o,a={};for(o in t)"key"==o?i=t[o]:"ref"==o?r=t[o]:a[o]=t[o];if(arguments.length>2&&(a.children=arguments.length>3?vx.call(arguments,2):n),"function"==typeof e&&null!=e.defaultProps)for(o in e.defaultProps)void 0===a[o]&&(a[o]=e.defaultProps[o]);return Rx(e,a,i,r,null)}function Rx(e,t,n,i,r){var o={type:e,props:t,key:n,ref:i,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,__h:null,constructor:void 0,__v:null==r?++wx:r};return null==r&&null!=bx.vnode&&bx.vnode(o),o}function Ix(e){return e.children}function Ox(e,t){this.props=e,this.context=t}function Px(e,t){if(null==t)return e.__?Px(e.__,e.__.__k.indexOf(e)+1):null;for(var n;t<e.__k.length;t++)if(null!=(n=e.__k[t])&&null!=n.__e)return n.__e;return"function"==typeof e.type?Px(e):null}function Lx(e){var t,n;if(null!=(e=e.__)&&null!=e.__c){for(e.__e=e.__c.base=null,t=0;t<e.__k.length;t++)if(null!=(n=e.__k[t])&&null!=n.__e){e.__e=e.__c.base=n.__e;break}return Lx(e)}}function Tx(e){(!e.__d&&(e.__d=!0)&&Mx.push(e)&&!zx.__r++||kx!==bx.debounceRendering)&&((kx=bx.debounceRendering)||Sx)(zx)}function zx(){var e,t,n,i,r,o,a,s;for(Mx.sort(_x);e=Mx.shift();)e.__d&&(t=Mx.length,i=void 0,r=void 0,a=(o=(n=e).__v).__e,(s=n.__P)&&(i=[],(r=Cx({},o)).__v=o.__v+1,Yx(s,o,r,n.__n,void 0!==s.ownerSVGElement,null!=o.__h?[a]:null,i,null==a?Px(o):a,o.__h),Gx(i,o),o.__e!=a&&Lx(o)),Mx.length>t&&Mx.sort(_x));zx.__r=0}function Fx(e,t,n,i,r,o,a,s,l,c){var u,h,d,f,p,m,g,y=i&&i.__k||Dx,x=y.length;for(n.__k=[],u=0;u<t.length;u++)if(null!=(f=n.__k[u]=null==(f=t[u])||"boolean"==typeof f||"function"==typeof f?null:"string"==typeof f||"number"==typeof f||"bigint"==typeof f?Rx(null,f,null,null,f):Array.isArray(f)?Rx(Ix,{children:f},null,null,null):f.__b>0?Rx(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}Yx(e,f,d=d||qx,r,o,a,s,l,c),p=f.__e,(h=f.ref)&&d.ref!=h&&(g||(g=[]),d.ref&&g.push(d.ref,null,f),g.push(h,f.__c||p,f)),null!=p?(null==m&&(m=p),"function"==typeof f.type&&f.__k===d.__k?f.__d=l=jx(f,l,e):l=Vx(e,f,d,y,p,l),"function"==typeof n.type&&(n.__d=l)):l&&d.__e==l&&l.parentNode!=e&&(l=Px(d))}for(n.__e=m,u=x;u--;)null!=y[u]&&("function"==typeof n.type&&null!=y[u].__e&&y[u].__e==n.__d&&(n.__d=Bx(i).nextSibling),Zx(y[u],y[u]));if(g)for(u=0;u<g.length;u++)Kx(g[u],g[++u],g[++u])}function jx(e,t,n){for(var i,r=e.__k,o=0;r&&o<r.length;o++)(i=r[o])&&(i.__=e,t="function"==typeof i.type?jx(i,t,n):Vx(n,i,i,r,i.__e,t));return t}function Vx(e,t,n,i,r,o){var a,s,l;if(void 0!==t.__d)a=t.__d,t.__d=void 0;else if(null==n||r!=o||null==r.parentNode)e:if(null==o||o.parentNode!==e)e.appendChild(r),a=null;else{for(s=o,l=0;(s=s.nextSibling)&&l<i.length;l+=1)if(s==r)break e;e.insertBefore(r,o),a=o}return void 0!==a?a:r.nextSibling}function Bx(e){var t,n,i;if(null==e.type||"string"==typeof e.type)return e.__e;if(e.__k)for(t=e.__k.length-1;t>=0;t--)if((n=e.__k[t])&&(i=Bx(n)))return i;return null}function Hx(e,t,n){"-"===t[0]?e.setProperty(t,null==n?"":n):e[t]=null==n?"":"number"!=typeof n||Ax.test(t)?n:n+"px"}function $x(e,t,n,i,r){var o;e:if("style"===t)if("string"==typeof n)e.style.cssText=n;else{if("string"==typeof i&&(e.style.cssText=i=""),i)for(t in i)n&&t in n||Hx(e.style,t,"");if(n)for(t in n)i&&n[t]===i[t]||Hx(e.style,t,n[t])}else if("o"===t[0]&&"n"===t[1])o=t!==(t=t.replace(/Capture$/,"")),t=t.toLowerCase()in e?t.toLowerCase().slice(2):t.slice(2),e.l||(e.l={}),e.l[t+o]=n,n?i||e.addEventListener(t,o?Ux:Wx,o):e.removeEventListener(t,o?Ux:Wx,o);else if("dangerouslySetInnerHTML"!==t){if(r)t=t.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if("width"!==t&&"height"!==t&&"href"!==t&&"list"!==t&&"form"!==t&&"tabIndex"!==t&&"download"!==t&&t in e)try{e[t]=null==n?"":n;break e}catch(e){}"function"==typeof n||(null==n||!1===n&&"-"!==t[4]?e.removeAttribute(t):e.setAttribute(t,n))}}function Wx(e){return this.l[e.type+!1](bx.event?bx.event(e):e)}function Ux(e){return this.l[e.type+!0](bx.event?bx.event(e):e)}function Yx(e,t,n,i,r,o,a,s,l){var c,u,h,d,f,p,m,g,y,x,v,b,w,M,k,S=t.type;if(void 0!==t.constructor)return null;null!=n.__h&&(l=n.__h,s=t.__e=n.__e,t.__h=null,o=[s]),(c=bx.__b)&&c(t);try{e:if("function"==typeof S){if(g=t.props,y=(c=S.contextType)&&i[c.__c],x=c?y?y.props.value:c.__:i,n.__c?m=(u=t.__c=n.__c).__=u.__E:("prototype"in S&&S.prototype.render?t.__c=u=new S(g,x):(t.__c=u=new Ox(g,x),u.constructor=S,u.render=Jx),y&&y.sub(u),u.props=g,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!=S.getDerivedStateFromProps&&(u.__s==u.state&&(u.__s=Cx({},u.__s)),Cx(u.__s,S.getDerivedStateFromProps(g,u.__s))),d=u.props,f=u.state,u.__v=t,h)null==S.getDerivedStateFromProps&&null!=u.componentWillMount&&u.componentWillMount(),null!=u.componentDidMount&&u.__h.push(u.componentDidMount);else{if(null==S.getDerivedStateFromProps&&g!==d&&null!=u.componentWillReceiveProps&&u.componentWillReceiveProps(g,x),!u.__e&&null!=u.shouldComponentUpdate&&!1===u.shouldComponentUpdate(g,u.__s,x)||t.__v===n.__v){for(t.__v!==n.__v&&(u.props=g,u.state=u.__s,u.__d=!1),u.__e=!1,t.__e=n.__e,t.__k=n.__k,t.__k.forEach((function(e){e&&(e.__=t)})),v=0;v<u._sb.length;v++)u.__h.push(u._sb[v]);u._sb=[],u.__h.length&&a.push(u);break e}null!=u.componentWillUpdate&&u.componentWillUpdate(g,u.__s,x),null!=u.componentDidUpdate&&u.__h.push((function(){u.componentDidUpdate(d,f,p)}))}if(u.context=x,u.props=g,u.__P=e,b=bx.__r,w=0,"prototype"in S&&S.prototype.render){for(u.state=u.__s,u.__d=!1,b&&b(t),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(t),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=Cx(Cx({},i),u.getChildContext())),h||null==u.getSnapshotBeforeUpdate||(p=u.getSnapshotBeforeUpdate(d,f)),k=null!=c&&c.type===Ix&&null==c.key?c.props.children:c,Fx(e,Array.isArray(k)?k:[k],t,n,i,r,o,a,s,l),u.base=t.__e,t.__h=null,u.__h.length&&a.push(u),m&&(u.__E=u.__=null),u.__e=!1}else null==o&&t.__v===n.__v?(t.__k=n.__k,t.__e=n.__e):t.__e=Xx(n.__e,t,n,i,r,o,a,l);(c=bx.diffed)&&c(t)}catch(e){t.__v=null,(l||null!=o)&&(t.__e=s,t.__h=!!l,o[o.indexOf(s)]=null),bx.__e(e,t,n)}}function Gx(e,t){bx.__c&&bx.__c(t,e),e.some((function(t){try{e=t.__h,t.__h=[],e.some((function(e){e.call(t)}))}catch(e){bx.__e(e,t.__v)}}))}function Xx(e,t,n,i,r,o,a,s){var l,c,u,h=n.props,d=t.props,f=t.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)){e=l,o[p]=null;break}if(null==e){if(null===f)return document.createTextNode(d);e=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&&e.data===d||(e.data=d);else{if(o=o&&vx.call(e.childNodes),c=(h=n.props||qx).dangerouslySetInnerHTML,u=d.dangerouslySetInnerHTML,!s){if(null!=o)for(h={},p=0;p<e.attributes.length;p++)h[e.attributes[p].name]=e.attributes[p].value;(u||c)&&(u&&(c&&u.__html==c.__html||u.__html===e.innerHTML)||(e.innerHTML=u&&u.__html||""))}if(function(e,t,n,i,r){var o;for(o in n)"children"===o||"key"===o||o in t||$x(e,o,null,n[o],i);for(o in t)r&&"function"!=typeof t[o]||"children"===o||"key"===o||"value"===o||"checked"===o||n[o]===t[o]||$x(e,o,t[o],n[o],i)}(e,d,h,r,s),u)t.__k=[];else if(p=t.props.children,Fx(e,Array.isArray(p)?p:[p],t,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]&&Nx(o[p]);s||("value"in d&&void 0!==(p=d.value)&&(p!==e.value||"progress"===f&&!p||"option"===f&&p!==h.value)&&$x(e,"value",p,h.value,!1),"checked"in d&&void 0!==(p=d.checked)&&p!==e.checked&&$x(e,"checked",p,h.checked,!1))}return e}function Kx(e,t,n){try{"function"==typeof e?e(t):e.current=t}catch(e){bx.__e(e,n)}}function Zx(e,t,n){var i,r;if(bx.unmount&&bx.unmount(e),(i=e.ref)&&(i.current&&i.current!==e.__e||Kx(i,null,t)),null!=(i=e.__c)){if(i.componentWillUnmount)try{i.componentWillUnmount()}catch(e){bx.__e(e,t)}i.base=i.__P=null,e.__c=void 0}if(i=e.__k)for(r=0;r<i.length;r++)i[r]&&Zx(i[r],t,n||"function"!=typeof e.type);n||null==e.__e||Nx(e.__e),e.__=e.__e=e.__d=void 0}function Jx(e,t,n){return this.constructor(e,n)}function Qx(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const{createElement:t=document.createElement.bind(document)}=e;let n,i,r=Ty();const o={transform:void 0,disableScreenReader:!1},a=zy();return a.element=()=>n,a.root=()=>n,a.settings=e=>(e&&Object.keys(o).forEach((t=>{void 0!==e[t]&&(o[t]=e[t])})),o),a.appendTo=e=>(n||(n=t("div"),n.style.position="absolute",n.style["-webkit-font-smoothing"]="antialiased",n.style["-moz-osx-font-smoothing"]="antialiased",n.style.pointerEvents="none"),e.appendChild(n),n),a.render=e=>{if(!n)return!1;const t="function"==typeof o.transform&&o.transform();if(t){const{horizontalScaling:e,horizontalSkewing:i,verticalSkewing:r,verticalScaling:o,horizontalMoving:a,verticalMoving:s}=t;return n.style.transform="matrix(".concat(e,", ").concat(i,", ").concat(r,", ").concat(o,", ").concat(a,", ").concat(s,")"),!0}n.style.transform="";let a;return o.disableScreenReader&&n.setAttribute("aria-hidden",!0),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(e)?Ex("div",null,e):e,i=function(e,t,n){var i,r,o;bx.__&&bx.__(e,t),r=(i="function"==typeof n)?null:n&&n.__k||t.__k,o=[],Yx(t,e=(!i&&n||t).__k=Ex(Ix,null,[e]),r||qx,qx,void 0!==t.ownerSVGElement,!i&&n?[n]:r?null:t.firstChild?vx.call(t.childNodes):null,o,!i&&n?n:r?r.__e:t.firstChild,i),Gx(o,e)}(a,n,i),!0},a.renderArgs=[Ex],a.clear=()=>{if(n){let e=n.firstChild;for(;e;)n.removeChild(e),e=n.firstChild;i=null}return a},a.destroy=()=>{n&&n.parentElement&&n.parentElement.removeChild(n),n=null,i=null},a.size=e=>(e&&(r=Ty(e)),r),a}vx=Dx.slice,bx={__e:function(e,t,n,i){for(var r,o,a;t=t.__;)if((r=t.__c)&&!r.__)try{if((o=r.constructor)&&null!=o.getDerivedStateFromError&&(r.setState(o.getDerivedStateFromError(e)),a=r.__d),null!=r.componentDidCatch&&(r.componentDidCatch(e,i||{}),a=r.__d),a)return r.__E=r}catch(t){e=t}throw e}},wx=0,Ox.prototype.setState=function(e,t){var n;n=null!=this.__s&&this.__s!==this.state?this.__s:this.__s=Cx({},this.state),"function"==typeof e&&(e=e(Cx({},n),this.props)),e&&Cx(n,e),null!=e&&this.__v&&(t&&this._sb.push(t),Tx(this))},Ox.prototype.forceUpdate=function(e){this.__v&&(this.__e=!0,e&&this.__h.push(e),Tx(this))},Ox.prototype.render=Ix,Mx=[],Sx="function"==typeof Promise?Promise.prototype.then.bind(Promise.resolve()):setTimeout,_x=function(e,t){return e.__v.__b-t.__v.__b},zx.__r=0;var ev=[function(e){e.renderer("svg",xx)},function(e){e.renderer("canvas",Xy)},function(e){e.renderer("dom",Qx)}];const tv={OFF:0,ERROR:1,WARN:2,INFO:3,DEBUG:4};const nv=function e(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const i=function(){let{level:e=tv.OFF,pipe:t=console}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=e;const i={[tv.OFF]:()=>{},[tv.ERROR]:function(){return t.error(...arguments)},[tv.WARN]:function(){return t.warn(...arguments)},[tv.INFO]:function(){return t.info(...arguments)},[tv.DEBUG]:function(){return t.log(...arguments)}},r=function(e){if(e&&!(n<e)){for(var t=arguments.length,r=new Array(t>1?t-1:0),o=1;o<t;o++)r[o-1]=arguments[o];(i[e]||i[tv.DEBUG])(...r)}};return{log:r,error:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return r(tv.ERROR,...t)},warn:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return r(tv.WARN,...t)},info:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return r(tv.INFO,...t)},debug:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return r(tv.DEBUG,...t)},level:e=>("number"==typeof e&&(n=e),n),LOG_LEVEL:tv}}(t.logger),r={component:yo(n.component,"component",i),data:yo(n.data,"data",i),formatter:yo(n.formatter,"formatter",i),interaction:yo(n.interaction,"interaction",i),renderer:rd(n.renderer),scale:yo(n.scale,"scale",i),symbol:yo(n.symbol,"symbol",i),logger:i};function o(){let n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return e({palettes:t.palettes.concat(n.palettes||[]),style:Qi({},t.style,n.style),logger:n.logger||t.logger,renderer:n.renderer||t.renderer},r)}return t.renderer&&t.renderer.prio&&r.renderer.default(t.renderer.prio[0]),o.use=function(e){return function(e){e(arguments.length>2?arguments[2]:void 0,arguments.length>1&&void 0!==arguments[1]?arguments[1]:{})}(e,arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r)},o.chart=e=>id(e,{registries:r,logger:i,style:t.style,palettes:t.palettes}),o.config=()=>t,Object.keys(r).forEach((e=>{o[e]=r[e]})),o.version=er,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:od,data:ud,formatter:Vs,interaction:hd,renderer:rd(),scale:Bc,symbol:Gu});bg.forEach(nv.use),ev.forEach(nv.use),[].forEach(nv.use);const iv={require:["chart","renderer"],renderer:"dom",render(e){var t;return function({chart:e,settings:t,h:n}){if(!e)return[];const i=function({h:e,settings:t}){if(!t)return[];const{isRtl:n,title:i,text:r}=t,o={disclaimer:{borderRadius:"10px",border:"1px solid #404040",position:"absolute",top:"10%",left:"50%",margin:"0 0 0 -150px",width:"298px",cursor:"default",background:"white",direction:n?"rtl":"ltr"},closeIcon:{position:"absolute",[n?"left":"right"]:"5px",top:"3px",cursor:"pointer",color:"#595959",pointerEvents:"auto"},dmHeader:{color:"#575859",fontSize:"18px",paddingLeft:"20px",paddingTop:"10px",paddingRight:"20px",paddingBottom:"0px",maxHeight:"44px",overflow:"hidden"},dmMain:{display:"block",color:"#575859",paddingLeft:"20px",paddingRight:"20px",paddingTop:"10px",paddingBottom:"10px"},dmP:{paddingBottom:"10px"},hidden:{display:"none"}};return[e("div",{style:o.disclaimer},e("div",{style:o.closeIcon,onClick:()=>null==t?void 0:t.close()},e("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 16 16"},e("defs",{},e("path",{id:"remove-a",d:"M9.41421356,8 L11.8890873,5.52512627 C12.065864,5.34834957 12.0305087,4.95944084 11.8183766,4.74730881 L11.2526912,4.18162338 C11.0405592,3.96949135 10.6516504,3.93413601 10.4748737,4.1109127 L8,6.58578644 L5.52512627,4.1109127 C5.34834957,3.93413601 4.95944084,3.96949135 4.74730881,4.18162338 L4.25233406,4.67659813 C3.96949135,4.95944084 3.93413601,5.34834957 4.1109127,5.52512627 L6.58578644,8 L4.1109127,10.4748737 C3.93413601,10.6516504 3.96949135,11.0405592 4.18162338,11.2526912 L4.67659813,11.7476659 C4.95944084,12.0305087 5.34834957,12.065864 5.52512627,11.8890873 L8,9.41421356 L10.4748737,11.8890873 C10.6516504,12.065864 11.0405592,12.0305087 11.2526912,11.8183766 L11.8183766,11.2526912 C12.0305087,11.0405592 12.065864,10.6516504 11.8890873,10.4748737 L9.41421356,8 Z M8,0 C12.4,0 16,3.6 16,8 C16,12.4 12.4,16 8,16 C3.6,16 0,12.4 0,8 C0,3.6 3.6,0 8,0 Z"})),e("use",{xlinkHref:"#remove-a"}))),e("header",{style:o.dmHeader},`${i}`),e("main",{style:o.dmMain},e("p",{style:o.dmP},`${r}`)))]}({settings:t,h:n});return i}({chart:this.chart,settings:null===(t=this.settings)||void 0===t?void 0:t.settings,h:e})}},rv=52,ov=-.7*Math.PI,av=.7*Math.PI,sv="#EEEEEE",lv=2.38,cv={MIN:12,MAX:60},uv={MIN:100,MAX:1e3},hv={LEFT:4,RIGHT:4},dv={VERTICAL_ALIGNMENT_FACTOR:.4},fv={VERTICAL_ALIGNMENT_CONSTANT:10},pv=2,mv=1.2,gv="#595959",yv="#E6E6E6",xv=.4,vv=1,bv=2,wv=.5,Mv=.75,kv=150,Sv=12,_v=8,qv=70,Dv=3,Av={MEASURE:"measure"},Cv={BAR:"bar",SEGMENT_BAR:"segment-bar",LABEL_BAR:"label-bar",BACKGROUND_BAR:"background-bar",MARK:"mark",OOB_INDICATOR:"oob-indicator",BAR_AXIS:"bar-axis",AXIS_TITLE:"axis-title",GAUGE_LABEL:"gauge-label",RADIAL_AXIS:"radial-axis",RADIAL_GAUGE_NEEDLE:"radial-gauge-needle",RADIAL_OOB_INDICATOR_MIN:"radial-oob-indicator-min",RADIAL_OOB_INDICATOR_MAX:"radial-oob-indicator-max",RADIAL_GAUGE:"radial-gauge",CIRCLE_GAUGE:"circle-gauge",REFERENCE_LINES_AND_LABELS:"reference-lines-and-labels",RADIAL_SPARK:"radial-spark",RADIAL_GAUGE_LABEL:"radial-gauge-label",RADIAL_REFERENCE_LINES:"radial-reference-lines",SEGMENT_RADIAL_GAUGE:"segment-radial-gauge",LABEL_RADIAL_GAUGE:"label-radial-gauge"},Nv="color",Ev=1e-4,Rv="XSMALL",Iv="XSMALL_VERTICAL",Ov="XSMALL_HORIZONTAL",Pv="SMALL",Lv="MEDIUM",Tv={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}},zv=600,Fv=200,jv=500;function Vv(e,t,n){e.prototype=t.prototype=n,n.constructor=e}function Bv(e,t){var n=Object.create(e.prototype);for(var i in t)n[i]=t[i];return n}function Hv(){}var $v=.7,Wv=1/$v,Uv="\\s*([+-]?\\d+)\\s*",Yv="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",Gv="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",Xv=/^#([0-9a-f]{3,8})$/,Kv=new RegExp(`^rgb\\(${Uv},${Uv},${Uv}\\)$`),Zv=new RegExp(`^rgb\\(${Gv},${Gv},${Gv}\\)$`),Jv=new RegExp(`^rgba\\(${Uv},${Uv},${Uv},${Yv}\\)$`),Qv=new RegExp(`^rgba\\(${Gv},${Gv},${Gv},${Yv}\\)$`),eb=new RegExp(`^hsl\\(${Yv},${Gv},${Gv}\\)$`),tb=new RegExp(`^hsla\\(${Yv},${Gv},${Gv},${Yv}\\)$`),nb={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 ib(){return this.rgb().formatHex()}function rb(){return this.rgb().formatRgb()}function ob(e){var t,n;return e=(e+"").trim().toLowerCase(),(t=Xv.exec(e))?(n=t[1].length,t=parseInt(t[1],16),6===n?ab(t):3===n?new ub(t>>8&15|t>>4&240,t>>4&15|240&t,(15&t)<<4|15&t,1):8===n?sb(t>>24&255,t>>16&255,t>>8&255,(255&t)/255):4===n?sb(t>>12&15|t>>8&240,t>>8&15|t>>4&240,t>>4&15|240&t,((15&t)<<4|15&t)/255):null):(t=Kv.exec(e))?new ub(t[1],t[2],t[3],1):(t=Zv.exec(e))?new ub(255*t[1]/100,255*t[2]/100,255*t[3]/100,1):(t=Jv.exec(e))?sb(t[1],t[2],t[3],t[4]):(t=Qv.exec(e))?sb(255*t[1]/100,255*t[2]/100,255*t[3]/100,t[4]):(t=eb.exec(e))?gb(t[1],t[2]/100,t[3]/100,1):(t=tb.exec(e))?gb(t[1],t[2]/100,t[3]/100,t[4]):nb.hasOwnProperty(e)?ab(nb[e]):"transparent"===e?new ub(NaN,NaN,NaN,0):null}function ab(e){return new ub(e>>16&255,e>>8&255,255&e,1)}function sb(e,t,n,i){return i<=0&&(e=t=n=NaN),new ub(e,t,n,i)}function lb(e){return e instanceof Hv||(e=ob(e)),e?new ub((e=e.rgb()).r,e.g,e.b,e.opacity):new ub}function cb(e,t,n,i){return 1===arguments.length?lb(e):new ub(e,t,n,null==i?1:i)}function ub(e,t,n,i){this.r=+e,this.g=+t,this.b=+n,this.opacity=+i}function hb(){return`#${mb(this.r)}${mb(this.g)}${mb(this.b)}`}function db(){const e=fb(this.opacity);return`${1===e?"rgb(":"rgba("}${pb(this.r)}, ${pb(this.g)}, ${pb(this.b)}${1===e?")":`, ${e})`}`}function fb(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function pb(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function mb(e){return((e=pb(e))<16?"0":"")+e.toString(16)}function gb(e,t,n,i){return i<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new xb(e,t,n,i)}function yb(e){if(e instanceof xb)return new xb(e.h,e.s,e.l,e.opacity);if(e instanceof Hv||(e=ob(e)),!e)return new xb;if(e instanceof xb)return e;var t=(e=e.rgb()).r/255,n=e.g/255,i=e.b/255,r=Math.min(t,n,i),o=Math.max(t,n,i),a=NaN,s=o-r,l=(o+r)/2;return s?(a=t===o?(n-i)/s+6*(n<i):n===o?(i-t)/s+2:(t-n)/s+4,s/=l<.5?o+r:2-o-r,a*=60):s=l>0&&l<1?0:a,new xb(a,s,l,e.opacity)}function xb(e,t,n,i){this.h=+e,this.s=+t,this.l=+n,this.opacity=+i}function vb(e){return(e=(e||0)%360)<0?e+360:e}function bb(e){return Math.max(0,Math.min(1,e||0))}function wb(e,t,n){return 255*(e<60?t+(n-t)*e/60:e<180?n:e<240?t+(n-t)*(240-e)/60:t)}Vv(Hv,ob,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:ib,formatHex:ib,formatHex8:function(){return this.rgb().formatHex8()},formatHsl:function(){return yb(this).formatHsl()},formatRgb:rb,toString:rb}),Vv(ub,cb,Bv(Hv,{brighter(e){return e=null==e?Wv:Math.pow(Wv,e),new ub(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=null==e?$v:Math.pow($v,e),new ub(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new ub(pb(this.r),pb(this.g),pb(this.b),fb(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:hb,formatHex:hb,formatHex8:function(){return`#${mb(this.r)}${mb(this.g)}${mb(this.b)}${mb(255*(isNaN(this.opacity)?1:this.opacity))}`},formatRgb:db,toString:db})),Vv(xb,(function(e,t,n,i){return 1===arguments.length?yb(e):new xb(e,t,n,null==i?1:i)}),Bv(Hv,{brighter(e){return e=null==e?Wv:Math.pow(Wv,e),new xb(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=null==e?$v:Math.pow($v,e),new xb(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=this.h%360+360*(this.h<0),t=isNaN(e)||isNaN(this.s)?0:this.s,n=this.l,i=n+(n<.5?n:1-n)*t,r=2*n-i;return new ub(wb(e>=240?e-240:e+120,r,i),wb(e,r,i),wb(e<120?e+240:e-120,r,i),this.opacity)},clamp(){return new xb(vb(this.h),bb(this.s),bb(this.l),fb(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 e=fb(this.opacity);return`${1===e?"hsl(":"hsla("}${vb(this.h)}, ${100*bb(this.s)}%, ${100*bb(this.l)}%${1===e?")":`, ${e})`}`}}));const Mb=Math.PI/180,kb=180/Math.PI,Sb=.96422,_b=.82521,qb=4/29,Db=6/29,Ab=3*Db*Db,Cb=Db*Db*Db;function Nb(e){if(e instanceof Eb)return new Eb(e.l,e.a,e.b,e.opacity);if(e instanceof Tb)return zb(e);e instanceof ub||(e=lb(e));var t,n,i=Pb(e.r),r=Pb(e.g),o=Pb(e.b),a=Rb((.2225045*i+.7168786*r+.0606169*o)/1);return i===r&&r===o?t=n=a:(t=Rb((.4360747*i+.3850649*r+.1430804*o)/Sb),n=Rb((.0139322*i+.0971045*r+.7141733*o)/_b)),new Eb(116*a-16,500*(t-a),200*(a-n),e.opacity)}function Eb(e,t,n,i){this.l=+e,this.a=+t,this.b=+n,this.opacity=+i}function Rb(e){return e>Cb?Math.pow(e,1/3):e/Ab+qb}function Ib(e){return e>Db?e*e*e:Ab*(e-qb)}function Ob(e){return 255*(e<=.0031308?12.92*e:1.055*Math.pow(e,1/2.4)-.055)}function Pb(e){return(e/=255)<=.04045?e/12.92:Math.pow((e+.055)/1.055,2.4)}function Lb(e,t,n,i){return 1===arguments.length?function(e){if(e instanceof Tb)return new Tb(e.h,e.c,e.l,e.opacity);if(e instanceof Eb||(e=Nb(e)),0===e.a&&0===e.b)return new Tb(NaN,0<e.l&&e.l<100?0:NaN,e.l,e.opacity);var t=Math.atan2(e.b,e.a)*kb;return new Tb(t<0?t+360:t,Math.sqrt(e.a*e.a+e.b*e.b),e.l,e.opacity)}(e):new Tb(e,t,n,null==i?1:i)}function Tb(e,t,n,i){this.h=+e,this.c=+t,this.l=+n,this.opacity=+i}function zb(e){if(isNaN(e.h))return new Eb(e.l,0,0,e.opacity);var t=e.h*Mb;return new Eb(e.l,Math.cos(t)*e.c,Math.sin(t)*e.c,e.opacity)}function Fb(e){return function(e){return Lb(e).l<70}(e)?yv:gv}function jb(e,t=!0){let n="";for(let t=0;t<e.length;t++){const i=e[t];n+=0===t?`M${i.x} ${i.y}`:`L${i.x} ${i.y}`,n+=" "}return t&&(n+="Z"),n}function Vb(e){const{angle:t,origin:n}=e,i=e.points.map((e=>function(e,t,n={x:0,y:0}){const i=Math.cos(t),r=Math.sin(t),o=(s=n,{x:(a=e).x-s.x,y:a.y-s.y});var a,s;return function(e,t){return{x:e.x+t.x,y:e.y+t.y}}({x:i*o.x-r*o.y,y:r*o.x+i*o.y},n)}(e,t,n)));return{type:"path",fill:e.fill,d:jb(i)}}Vv(Eb,(function(e,t,n,i){return 1===arguments.length?Nb(e):new Eb(e,t,n,null==i?1:i)}),Bv(Hv,{brighter(e){return new Eb(this.l+18*(null==e?1:e),this.a,this.b,this.opacity)},darker(e){return new Eb(this.l-18*(null==e?1:e),this.a,this.b,this.opacity)},rgb(){var e=(this.l+16)/116,t=isNaN(this.a)?e:e+this.a/500,n=isNaN(this.b)?e:e-this.b/200;return new ub(Ob(3.1338561*(t=Sb*Ib(t))-1.6168667*(e=1*Ib(e))-.4906146*(n=_b*Ib(n))),Ob(-.9787684*t+1.9161415*e+.033454*n),Ob(.0719453*t-.2289914*e+1.4052427*n),this.opacity)}})),Vv(Tb,Lb,Bv(Hv,{brighter(e){return new Tb(this.h,this.c,this.l+18*(null==e?1:e),this.opacity)},darker(e){return new Tb(this.h,this.c,this.l-18*(null==e?1:e),this.opacity)},rgb(){return zb(this).rgb()}}));const Bb={require:["chart"],defaultSettings:{settings:{},style:{}},render(){var e;return function({chart:e,settings:t}){if(!e||!t)return[];const{size:n,component:i,selector:r,pointingTo:o,isRtl:a}=t;if(!e.component(t.component))return[];const s=e.findShapes(r).filter((e=>e.key===i));if(null==s||!s.length)return[];const{clientWidth:l,clientHeight:c}=e.element;let u=l/2,h=c/2,d=-Math.PI/2;const f=n/3;switch(o){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 e=0;e<s.length;e+=1){const t=s[e];let r=["top",...a?["left"]:["right"]].includes(o)?t.attrs.fill:sv;if(i===Cv.SEGMENT_BAR){const{stops:e}=t.attrs.fill;if(["top","right"].includes(o)){const t=e.find((e=>1===e.offset));r=(null==t?void 0:t.color)||gv}else{const t=e.toReversed().find((e=>0===e.offset));r=(null==t?void 0:t.color)||gv}}const l=Fb(r),c={x:u,y:h},f=n/6,m=Vb({points:[{x:c.x+2*f,y:c.y},{x:c.x,y:c.y+f},{x:c.x,y:c.y-f}],angle:d,fill:l,origin:c});p.push(m)}return p}({chart:this.chart,settings:null===(e=this.settings)||void 0===e?void 0:e.settings})}};function Hb({services:e}){var t;const{colorService:n,layoutService:i,themeService:r}=e,{useBaseColors:o}=i.getLayout().color||{},{baseColor:a}=(null===(t=i.getLayout().qHyperCube)||void 0===t?void 0:t.qMeasureInfo[0].coloring)||{};if("off"===o)return n.getColor();let s;if(a){var l,c,u;const e=(null===(l=r.getTheme().getDataColorPickerPalettes()[0])||void 0===l?void 0:l.colors)||[];s=null!==(c=a.color)&&void 0!==c?c:gv;const t=null!==(u=a.index)&&void 0!==u?u:-1;e.length>0&&t>-1&&t<e.length&&(s=e[t])}else{var h;s=null!==(h=r.getTheme().getDataColorSpecials().primary)&&void 0!==h?h:gv}return()=>s}function $b(e,t,n,i){const r=Math.floor(Math.min(e,t)),o=Math.abs(i-n),a=.02*Math.tan(-o/4+Math.PI/2),s=2*(.4+a)-2*Gb(e,t)/r;return{innerRadius:s-2*(r>500?50:Math.max(r/jv*50,10))/r,outerRadius:s,radiusIncrease:a,labelGaugeRadius:1.39*(.4+a)}}function Wb(e,t,n,i){const r=i-Math.PI/2;return{x:e+n*Math.cos(r),y:t+n*Math.sin(r)}}function Ub({innerRadius:e,outerRadius:t,width:n,height:i}){return(t-e)*Math.min(n,i)/2}function Yb(e){return!1!==e.show&&0!==e.show&&"0"!==e.show}function Gb(e,t){return Math.min(6,Math.min(e,t)/Fv)}function Xb(e,t){return 4*$b(e,t,ov,av).radiusIncrease*Math.min(e,t)}const Kb={require:["chart","symbol"],defaultSettings:{settings:{},style:{}},render(){var e;return function({chart:e,settings:t,symbol:n}){if(!e||!t||!n)return[];const{valueAngle:i}=t;if(!e.component(t.component))return[];const{clientWidth:r,clientHeight:o}=e.element,{outerRadius:a,innerRadius:s}=$b(r,o,ov,av),l=Ub({innerRadius:s,outerRadius:a,width:r,height:o});let c=r/2,u=o/2,h=a*Math.min(r,o)/2,d=Wb(c,u,h,t.valueAngle),f=d.x,p=d.y;const m=[],g=sv,y=t.fill||Fb(g),x={x:f,y:p},v=l/6;let b=[{x:x.x+.3*v,y:x.y},{x:x.x-7.5*v,y:x.y+v},{x:x.x-7.5*v,y:x.y-v}];const w=i-Math.PI/2,M=Vb({points:b,angle:w,fill:y,origin:x});return M.data={pointerWidth:v,angle:w,radius:h,fill:y},m.push(M),m}({chart:this.chart,settings:null===(e=this.settings)||void 0===e?void 0:e.settings,symbol:this.symbol})}};const Zb={require:["chart","symbol"],defaultSettings:{settings:{},style:{}},render(){var e;return function({chart:e,settings:t,symbol:n}){if(!e||!t||!n)return[];const{size:i,component:r,selector:o,angle:a,radius:s}=t;if(!e.component(t.component))return[];const l=e.findShapes(o).filter((e=>e.key===r));if(null==l||!l.length)return[];const{clientWidth:c,clientHeight:u}=e.element;let h=c/2,d=u/2,{x:f,y:p}=Wb(h,d,s,a);const m=[],g=t.fill,y=a===ov?-1:1,x={x:f,y:p},v=i/6,b=Vb({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:g,origin:x});return m.push(b),m}({chart:this.chart,settings:null===(e=this.settings)||void 0===e?void 0:e.settings,symbol:this.symbol})}};var Jb,Qb;var ew=function(){if(Qb)return Jb;Qb=1;var e=Object.prototype.hasOwnProperty,t=Object.prototype.toString,n=Object.defineProperty,i=Object.getOwnPropertyDescriptor,r=function(e){return"function"==typeof Array.isArray?Array.isArray(e):"[object Array]"===t.call(e)},o=function(n){if(!n||"[object Object]"!==t.call(n))return!1;var i,r=e.call(n,"constructor"),o=n.constructor&&n.constructor.prototype&&e.call(n.constructor.prototype,"isPrototypeOf");if(n.constructor&&!r&&!o)return!1;for(i in n);return void 0===i||e.call(n,i)},a=function(e,t){n&&"__proto__"===t.name?n(e,t.name,{enumerable:!0,configurable:!0,value:t.newValue,writable:!0}):e[t.name]=t.newValue},s=function(t,n){if("__proto__"===n){if(!e.call(t,n))return;if(i)return i(t,n).value}return t[n]};return Jb=function e(){var t,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!=(t=arguments[d]))for(n in t)i=s(h,n),h!==(l=s(t,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:e(p,u,l)})):void 0!==l&&a(h,{name:n,newValue:l}));return h},Jb}(),tw=Yt(ew);let nw;function iw(){nw=nw||document.createElement("canvas").getContext("2d")}const rw={measureTextWidth(e){iw();const{width:t}=nw.measureText(e);return t},lineWrap(e,t,n,i){let r,o;iw();const a=e?e.split(/\n+|\r+|\r\n/):[],s=[];let l,c,u,h,d=e?e.split(/\s+/):[],f=a[0];if("number"!=typeof t||t<=0)return[e];if("number"==typeof i&&a.length>=i)return a.slice(0,i);for(n&&(nw.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=rw.measureTextWidth(l),c>t&&("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(e,t,n,i,r){if(iw(),!e||!e.length)return[];n&&(nw.font=n);let o=[];const a=e.slice();let s,l,c,u="";if(a.filter((e=>!!e)),"number"!=typeof t||t<0)return e.slice();for(c=0;c<a.length;c++){var h;if(l=a[c],u="",l.length<=1||rw.measureTextWidth(l)<=t)o.push(l);else if(s=rw.splitWord(l,t,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]?rw.measureTextWidth(`${u} ${a[c+1]}`)>t&&(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(((e,t,n)=>{n[t]=e.trim()})),void 0!==i&&o.length>i?(o=o.splice(0,i),o[o.length-1]=rw.truncate(o[o.length-1],t,n,r).text):(l=o[o.length-1],l&&l.length>1&&rw.measureTextWidth(l)>t&&(o[o.length-1]=rw.truncate(l,t,n,r).text)),o},truncate(e,t,n,i="…"){iw();let r,o,a,s,l=e;const c=rw.measureTextWidth("i");if(n&&(nw.font=n),e&&t){if(rw.measureTextWidth(l)>t){const e=Math.ceil(t/c);for(r=Math.min(e,l.length);r>0;r--)if(o=l.substring(0,r-1),a=o.trim()+i,rw.measureTextWidth(a)<=t){s=l.substring(r-1),l=a;break}r||(s=l,l="…")}}else s=void 0;return{text:l,rest:s}},isNumber:e=>"number"==typeof e&&Number.isFinite(e),explodeWord(e,t,n,i){let r;iw();let o,a=e,s="",l=[];if(void 0!==n&&rw.isNumber(n)&&n<=1)return[e];const c=Math.ceil(t/i);for(r=Math.min(e.length,c);r>0&&(a=e.substring(0,r),o=e.substring(r-1,r)," "===o?a=e.substring(0,r-1):a+="-",s=e.substring(r),!(rw.measureTextWidth(a)<=t));r--);return(!r&&!a||rw.measureTextWidth(a)>t)&&(a=e.substring(0,1),s=e.substring(1)),l.push(a),s?(rw.measureTextWidth(s)>t?l=l.concat(rw.explodeWord(s,t,void 0===n?void 0:n-1,i)):l.push(s),l.filter((e=>""!==e.trim()))):l},splitWord:(e,t,n,i)=>(iw(),e&&t?(n&&(nw.font=n),rw.explodeWord(e,t,i,Math.max(1,rw.measureTextWidth("i")))):[]),wrapText(e,t,n,i,r="…"){let o;return Number.isNaN(t)||!t?[e]:(o=void 0===i||i>1?rw.lineWrap(e,t,n,i):[e],o=rw.wordWrap(o,t,n,i,r),o)},getFontHeight:e=>(iw(),e&&(nw.font=e),1.5*rw.measureTextWidth("m")),tokenize(e,t,n,i,r,o,a=1){iw(),t&&(nw.font=t);const s=rw.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(e)?e.forEach(((e,n)=>{u.length<h&&(u=u.concat(rw.wrapText(e,r,t,c[n])))})):u=rw.wrapText(e,r,t,c[0],n),u}};function ow({chart:e,renderer:t,refLine:n,settings:i,width:r,height:o,barWidth:a}){if(!e||!t||!i)return{};const{position:s,scale:l,value:c,label:u,line:h,formatter:d,cId:f}=n,p=n.radius?n.radius*(Math.min(r,o)/2):r/2,m=(av-ov)*s+ov-Math.PI/2,g={x:r/2,y:o/2};let y=tw(!0,{},i.style.line,h||{});const x={type:"line",cId:f,...{x1:g.x+Math.cos(m)*p,y1:g.y+Math.sin(m)*p,x2:g.x+Math.cos(m)*(p+a),y2:g.y+Math.sin(m)*(p+a)},data:{angle:m,innerRadius:p},stroke:y.stroke,strokeWidth:y.strokeWidth,strokeDasharray:y.strokeDasharray};let v;if(u){const n=tw(!0,{fill:"#000",fontFamily:"Arial",fontSize:"12px",opacity:1,padding:5,background:{fill:"#fff",stroke:"transparent",strokeWidth:0,opacity:.5}},i.style.label||{},{fill:y.stroke},u),{fontFamily:s,fontSize:h,fill:x,opacity:b}=n,w=u.showLabel?n.text:"";let M,k="";if("string"==typeof d||"object"==typeof d)M=e.formatter(d);else if(void 0!==l&&"string"!=typeof l&&"function"==typeof l.data){const e=l.data()&&l.data().fields;M=e&&e[0]?e[0].formatter():null}!1!==u.showValue&&(M?k=` (${M("function"==typeof c?c():c)})`:l&&(k=` (${c})`));const S=e=>t.measureText({text:e,fontFamily:s,fontSize:h}),_=S("M").height,q=`normal ${h} ${s}`;let D,A=Dv;const C=`${w}${k}`||"",N=Math.min(r,o),E=Math.min(8,N/200),R=Wb(g.x,g.y,p+a+E,m+Math.PI/2),I=S(C).width;D=Math.min(R.x,r-R.x-lv,qv),A=function(e,t,n){const i=Math.min(Math.floor((e+lv)/t),Math.floor((n-e)/t));return Math.min(i,Dv)}(R.y,_,o);let O=rw.tokenize(C,q,`... ${k}`,A,D,void 0);const P=function(e){let t="start";const n=e>-Math.PI&&e<0?"baseline":"hanging";return(e+=Math.PI/2)<0&&e>-Math.PI?t="end":e>0&&e<Math.PI&&(t="start"),{textAnchor:t,baseline:n}}(m);R.y-2*_>0&&R.y+2*_<o&&(R.x-I+lv<0&&"end"===P.textAnchor||R.x+I-lv>r)&&(O=rw.tokenize(C,q,`... ${k}`,A,D,void 0)),v={fill:x,opacity:b,fontFamily:s,fontSize:h,linePosition:R,lineHeight:_,align:"left",baseline:P.baseline,textAnchor:P.textAnchor,lines:O,cId:f}}return{lineNode:x,labelNode:v}}const aw={require:["chart","renderer"],defaultSettings:{style:{line:{stroke:"#000"}}},render(){var e,t;let{settings:n,chart:i,renderer:r,rect:o}=this;if(!(i&&o&&n&&r))return[];const{width:a,height:s}=o,l=null!==(e=null==n||null===(t=n.settings)||void 0===t?void 0:t.barWidth)&&void 0!==e?e:0;let c=(null==n?void 0:n.lines)&&n.lines.radial||[];if(0===c.length)return[];c=c.map((e=>{if("function"==typeof e.value&&(e.value=e.value()),e.scale){let t=null==i?void 0:i.scale("string"==typeof e.scale?e.scale:"");const n=t(e.value);return tw(e,{scale:t,position:n})}return tw(e,{position:e.value})}));const u=[];let h=[];[...c].forEach((e=>{if(e.position>=0&&e.position<=1){const{lineNode:t,labelNode:o}=ow({chart:i,renderer:r,refLine:e,settings:n,width:a,height:s,barWidth:l});t&&u.push(t),o&&h.push(o)}}));const d=[];h.forEach((e=>{const{fill:t,opacity:n,fontFamily:i,fontSize:r,lines:o,lineHeight:a,textAnchor:s,linePosition:l,baseline:c,cId:u}=e,h=l,f=o.length-1,p=o.map(((e,o)=>{let l=h.y;return f>0&&("baseline"===c?l-=(f-o)*a:l+=o*a),{type:"text",text:e,cId:u,baseline:c,anchor:s,fill:t,opacity:n,fontFamily:i,fontSize:r,x:h.x,y:l}}));d.push(...p)}));const{MEDIUM:f,SMALLER:p}=Tv,m=a>=f.width&&s>=f.height;return[...a>=p.width&&s>=p.height?u:[],...m?d:[]]}};const sw={require:["chart","symbol"],defaultSettings:{settings:{},style:{}},render(){var e;return function({chart:e,settings:t,symbol:n}){if(!e||!t||!n)return[];const{valueAngle:i}=t,{clientWidth:r,clientHeight:o}=e.element,a=.4*Math.min(r,o),s=[],l=t.fill,c={x:r/2,y:o/2},u=Vb({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===(e=this.settings)||void 0===e?void 0:e.settings,symbol:this.symbol})}},lw={getGap(e,t){const n=e.position<t.position?e:t,i=e.position<t.position?t:e;return i.position-i.radius-(n.position+n.radius)},findSegmentPositionMeetMaxThenMin(e,t,n){const i=e.position+e.radius,r=e.position-Math.max(0,i-n),o=r-e.radius;return r+Math.max(0,t-o)},layoutPositionFromMin(e,t,n,i=0){const r=e.length-1;let o,a,s,l=t;for(let t=0;t<r;t++)o=e[t],a=e[t+1],s=(o.position+a.position)/2-i/2,o.position=lw.findSegmentPositionMeetMaxThenMin(o,l,s),l=o.position+o.radius+i;a&&(a.position=lw.findSegmentPositionMeetMaxThenMin(a,l,n))},adjustPositionFromMax(e,t,n,i=0){const r=e.length-1,o=Math.max(0,e[r].position+e[r].radius-n);if(0===o)return;let a,s,l,c,u=0;for(a=r;a>0&&(s=e[a],l=e[a-1],c=Math.max(0,lw.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-t),c-=Math.max(0,u+c-o),u+=c,l.move=c),u=0,a=0;a<=r;a++)s=e[a],u+=s.move||0,s.move=u,s.position-=u},createLayout(e,t,n,i=0){const r=e.map((e=>e.segment)),o=r.length-1;if(o<0)return[];if(0===o){const e=r[0];e.position=lw.findSegmentPositionMeetMaxThenMin(e,t,n)}else lw.layoutPositionFromMin(r,t,n,i),lw.adjustPositionFromMax(r,t,n,i);return e.filter((e=>{const i=Math.ceil(e.segment.position-e.segment.radius),r=e.segment.position+e.segment.radius;return i>=t&&r<=n}))}};const cw={require:["chart","renderer"],defaultSettings:{style:{line:{stroke:"#000"}}},render(){var e,t;let{settings:n,chart:i,renderer:r,rect:o}=this;if(!(i&&o&&n&&r))return[];const{width:a,height:s}=o,{barWidth:l,needlePosition:c}=n.settings,u=null!==(e=null===(t=n.settings)||void 0===t?void 0:t.isRtl)&&void 0!==e&&e,h=u?-1:1,d=(null==n?void 0:n.lines)&&n.lines.x||[],f=(null==n?void 0:n.lines)&&n.lines.y||[];let p=d.length>0?d:f;if(0===p.length)return[];const m=d.length>0;p=p.map((e=>{if("function"==typeof e.value&&(e.value=e.value()),e.scale){let t=null==i?void 0:i.scale("string"==typeof e.scale?e.scale:"");const n=t(e.value);return tw(e,{scale:t,position:n})}return tw(e,{position:e.value})}));const g=[];let y=[];[...p].forEach((e=>{if(Yb(e)&&e.position>=0&&e.position<=1){const{lineNode:t,labelNode:o}=function({chart:e,renderer:t,refLine:n,settings:i,width:r,height:o,isVerticalRefLine:a,barWidth:s}){if(!e||!t||!i)return{};const{position:l,scale:c,value:u,label:h,line:d,formatter:f,cId:p}=n;let m=tw(!0,{},i.style.line,d||{});const g={type:"line",cId:p,...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:m.stroke,strokeWidth:m.strokeWidth,strokeDasharray:m.strokeDasharray};let y;if(h){const n=tw(!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},h),{fontFamily:d,fontSize:g,fill:x,opacity:v}=n,b=h.showLabel?n.text:"";let w,M="";if("string"==typeof f||"object"==typeof f)w=e.formatter(f);else if(void 0!==c&&"string"!=typeof c&&"function"==typeof c.data){const e=c.data()&&c.data().fields;w=e&&e[0]?e[0].formatter():null}!1!==h.showValue&&(w?M=` (${w("function"==typeof u?u():u)})`:c&&(M=` (${u})`));const k=e=>t.measureText({text:e,fontFamily:d,fontSize:g}),S=k("M").height,_=`normal ${g} ${d}`,q=a?kv:r/2-s/2-Sv,D=a?2:1,A=`${b}${M}`||"",C=rw.tokenize(A,_,`... ${M}`,D,q,void 0),N=(a?r:o)*l,E=Math.min(q,Math.max(...C.map((e=>k(e).width)))),R=C.length*S;y={fill:x,opacity:v,fontFamily:d,fontSize:g,linePosition:N,lineHeight:S,lines:C,cId:p,segment:{position:N,radius:a?E/2:R/2}}}return{lineNode:g,labelNode:y}}({chart:i,renderer:r,refLine:e,settings:n,width:a,height:s,isVerticalRefLine:m,barWidth:l});t&&g.push(t),o&&y.push(o)}}));const{MEDIUM:x,SMALLER:v}=Tv,b=a>=x.width&&s>=x.height;if(!(a>=v.width&&s>=v.height))return[];const w=[...g];if(!b||0===y.length)return w;let M=[];if(y.sort(((e,t)=>e.segment.position-t.segment.position)),m)M=lw.createLayout(y,0,a,_v);else{const{attrs:e}=i.findShapes("text").filter((e=>e.key===Cv.GAUGE_LABEL))[0],{"font-size":t}=e,n=parseFloat(t);let r=y.filter((e=>e.segment.position<s-c)),o=y.filter((e=>e.segment.position>=s-c)),a=lw.createLayout(r,0,e.y-n/2),l=lw.createLayout(o,e.y+n/2,s);M=0===a.length&&r.length>0?lw.createLayout(y,e.y+n/2,s):0===l.length&&o.length>0?lw.createLayout(y,0,e.y-n/2):[...a,...l]}return M.forEach((e=>{const{fill:t,opacity:n,fontFamily:i,fontSize:r,lines:o,segment:c,linePosition:d,lineHeight:f,cId:p}=e,{position:g}=c;if(d!==g&&""!==e.lines[0]){let e={x1:a/2+h*(l/2),x2:a/2+h*(l/2+.75*Sv),y1:d,y2:g};m&&(e={y1:s/2+l/2,y2:s/2+l/2+Sv,x1:d,x2:g});const n={type:"line",...e,stroke:t,strokeWidth:1,isConnector:!0,cId:p};w.push(n)}const y=o.map(((e,o)=>{let c=m?s/2+l/2+f/2+Sv:g;return c+=o*f,{type:"text",text:e,cId:p,baseline:"central",anchor:m?"middle":u?"end":"start",fill:t,opacity:n,fontFamily:i,fontSize:r,x:m?g:a/2+h*(l/2+Sv),y:c}}));w.push(...y)})),w}};var uw={dataRelatedPropertiesPaths:["filters[].options","qHyperCube.qGrandTotalRow","qHyperCube.qHasOtherValues","qHyperCube.qSize","qHyperCube.qDimensionInfo[].qAttrDimInfo","qHyperCube.qDimensionInfo[].qCardinalities","qHyperCube.qDimensionInfo[].qMax","qHyperCube.qDimensionInfo[].qMin","qHyperCube.qDimensionInfo[].qStateCounts","qHyperCube.qMeasureInfo[].qApprMaxGlyphCount","qHyperCube.qMeasureInfo[].qFallbackTitle","qHyperCube.qMeasureInfo[].qMax","qHyperCube.qMeasureInfo[].qMin","qHyperCube.qMeasureInfo[].qNumFormat","qHyperCube.qMeasureInfo[].qTrendLines","qHyperCube.qTreeNodesOnDim","measureAxis.min","measureAxis.max","refLine.refLines[].refLineExpr"]};function hw(e){const{qHyperCube:t,...n}=e,{qDataPages:i,qStackedDataPages:r,qTreeDataPages:o,...a}=t||{},s=tw(!0,{},{...n,qHyperCube:{...a,qDataPages:null,qStackedDataPages:null,qTreeDataPages:null}}),{dataRelatedPropertiesPaths:l}=uw;return l.forEach((e=>{const t=e.split("[");if(1===t.length)void 0!==Mt(s,e)&&St(s,e,null);else{const e=t[0],n=t[1].split("].")[1];Mt(s,e,[]).forEach((e=>{void 0!==Mt(e,n)&&St(e,n,null)}))}})),s}const dw=({core:t,services:n,settings:r})=>{const o=e();i((()=>{if(!r||!t||!n)return;const{chart:e,cache:i}=t;if(!e)return;const{colorService:a,layoutService:s,dockService:l}=n;if("radial"===s.meta.gaugetype){const{width:e,height:t}=l.meta.chart.size;o.style.transform=`translateY(${Xb(e,t)}px)`}else o.style.transform="";e.update({data:[{type:"q",key:"qHyperCube",data:s.getHyperCube()},...a.getData()],settings:r}),i&&function({cache:e,layout:t}){const n=hw(t);e.set("dataIndependentProperties",JSON.stringify(n))}({cache:i,layout:s.getLayout()})}),[t,r])};function fw({layout:e,options:t}){return e.snapshotData&&!t.freeResize?{width:e.snapshotData.content.size.w,height:e.snapshotData.content.size.h}:void 0}function pw({options:e,cache:t,layoutService:n}){const i={isSizeChanging:!1};return{enabled:()=>!1!==e.chartAnimations&&!i.isSizeChanging&&!function({cache:e,layout:t}){const n=hw(t);return e.get("dataIndependentProperties")!==JSON.stringify(n)}({cache:t,layout:n.getLayout()}),meta:i}}function mw({layout:e,rect:t}){var n;const{measureAxis:i,qHyperCube:r,autoOrientation:o,gaugetype:a,useSegments:s,refLine:l}=e,c=null===(n=e.qHyperCube)||void 0===n?void 0:n.qMeasureInfo[0].qFallbackTitle,{width:u,height:h}=t;let d=e.orientation;o&&(d=u>=h?"horizontal":"vertical");const f="vertical"===d,p=function({measureAxis:e,qHyperCube:t}){if(!e||!t)return{min:0,max:1};let{min:n,max:i}=e;if(n=Number(n),i=Number(i),n!==i)return{min:Math.min(n,i),max:Math.max(n,i)};const r=t.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:i,qHyperCube:r}),m=(null==l?void 0:l.refLines)||[],g=null==i?void 0:i.spacing,y=null==i?void 0:i.show,x=function({layout:e,rangeLimits:t}){var n,i;const{gradient:r}=(null===(n=e.qHyperCube)||void 0===n?void 0:n.qMeasureInfo[0].coloring)||{};if("measure"!==(null===(i=e.color)||void 0===i?void 0:i.useBaseColors)||!r)return e.segmentInfo;const{min:o,max:a}=t,{limits:s,limitType:l,breakTypes:c,colors:u}=r,h=s.map(((e,t)=>({value:"percent"===l?o+e*(a-o):e,gradient:c[t]})));return{limits:h,paletteColors:u}}({layout:e,rangeLimits:p});return{measureAxisTitle:c,measureAxisSpacing:g,measureAxisShow:y,rangeLimits:p,qHyperCube:r,orientation:d,autoOrientation:o,gaugetype:a,isVertical:f,useSegments:s,segmentInfo:x,refLines:m}}function gw({dockService:e,layoutService:t}){const{width:n,height:i}=e.meta.chart.size,{orientation:r,autoOrientation:o}=t.meta;return o?n<i:"vertical"===r}function yw(e,t,n){if(e>=n)return 1;if(e<=t)return 0;const i=Math.min(1,Math.max(0,(e-t)/(n-t)));return Number.isNaN(i)?0:i}function xw(e,t,n){const i="none"===e||"labels"===e,r=t<Tv.SMALL.width||n<Tv.SMALL.height;return!(i||r)}function vw(e){return"none"!==e&&"title"!==e}const bw=({core:e})=>{const d=r(),f=o(),p=a(),m=s(),g=l(),x=c(),{qLocaleInfo:v}=u(),[b,w]=n(null),M=t(),k=h();return i((()=>{if(!d||!e)return;const{picassoInstance:t,chart:n,cache:i}=e;if(!n)return;d.color||(d.color={useBaseColors:"off"});const r=function(e){var t=e.source,n=e.metaAdditionsFn,i=e.experimental,r=void 0===i?{filter:!1}:i,o=P(!0,{},t),a=r.filter?function(e){var t=e.qHyperCube,n=At(t,Dt.DIMENSION),i=n.reduced,r=n.filtered;t[Dt.DIMENSION]=i;var o=At(t,Dt.MEASURE),a=o.reduced,s=o.filtered;return t[Dt.MEASURE]=a,{dimensions:r,measures:s}}(o):{dimensions:[],measures:[]},s=Nt(o),l=function(){var e=function(e){var t=e.layout,n=e.additionsFn,i=void 0===n?function(){return{}}:n,r=e.additionsProps,o=void 0===r?{}:r,a=t.qHyperCube,s=a.qDimensionInfo,l=a.qMeasureInfo,c=a.qMode,u=s.length,h=l.length,d=y({mode:{S:"S"===c,P:"P"===c,K:"K"===c,T:"T"===c},dimensionCount:u,measureCount:h,hasMultipleDimensions:u>1,hasMultipleMeasures:h>1,isOneDimensional:1===u,isTwoDimensional:2===u},o);return y(y({},d),i({layout:t,meta:d}))}({layout:o,additionsFn:n,additionsProps:{size:s.size}});return e.filteredFields=a,e},c={refs:y({},s.refs),meta:l(),getLayout:function(){return o},getLayoutValue:function(e,t){return Mt(o,e,t)},setLayoutValue:function(e,t){St(o,e,t),s=Nt(o),c.meta=l()},getHyperCube:function(){return o.qHyperCube},getHyperCubeValue:function(e,t){return Mt(o.qHyperCube,e,t)},setHyperCubeValue:function(e,t){St(o.qHyperCube,e,t),s=Nt(o),c.meta=l()},getDataPages:function(){return Mt(o,s.refs.dataPages)},setDataPages:function(e){St(o,s.refs.dataPages,e),c.meta=l()}};return c}({source:d,metaAdditionsFn:()=>mw({layout:d,rect:g})}),{direction:o="ltr"}=M,a=fw({layout:r.getLayout(),options:M}),s=wt({chart:n,layoutService:r,config:{rtl:"rtl"===o,logicalSize:a},typeConfig:{type:"major-minor",fallback:"vertical",invert:!0}}),l=ct({app:p,model:m,translator:x,picasso:t,layoutService:r,config:{key:Nv,localeInfo:v,theme:f,auto:()=>({mode:"primary",byMeasureDef:{activeMeasureIndex:0,type:"expression",label:""}})},createConfig:()=>({colorProps:{auto:!0,paletteColor:d.paletteProgressColor||{index:d.progressColor}}})}),c=function(e){var t=e.theme,n=e.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:t,matrix:$t(a),styles:void 0};return h.styles=Ut({theme:t,id:r,transform:l,extend:u,matrix:h.matrix}),{getStyles:function(){return h.styles},getTheme:function(){return h.theme},setTheme:function(e){h.theme=e,h.styles=Ut({theme:e,id:r,transform:l,extend:u,matrix:h.matrix})}}}({theme:f,config:{id:"gauge"}}),u=function({chart:e,layoutService:t,dockService:n}){function i(){const{width:e,height:i}=n.meta.chart.size,r=gw({dockService:n,layoutService:t});return Math.min(rv,r?e/10:i/10)}function r(){const{width:e,height:i}=n.meta.chart.size;return gw({dockService:n,layoutService:t})?i:e}function o(e){const{min:n,max:i}=t.meta.rangeLimits,o=e?i-(t.meta.qHyperCube.qDataPages[0].qMatrix[0][0].qNum-n):t.meta.qHyperCube.qDataPages[0].qMatrix[0][0].qNum;return r()*yw(o,n,i)}const a={getBottomPadding(a){if(gw({dockService:n,layoutService:t})){const e=o(!1)+-a.height*dv.VERTICAL_ALIGNMENT_FACTOR,t=0,n=r()-a.height;return e<t?t:e>n?n:e}const s=i(),{VERTICAL_ALIGNMENT_CONSTANT:l}=fv;let c=.5*s+a.height/2+l;const u=e.findShapes("text").filter((e=>e.key===Cv.REFERENCE_LINES_AND_LABELS)).map((e=>{const{x:t,y:i,"font-size":r}=e.attrs,o=parseFloat(r);return{x:t,y:i-n.meta.chart.size.height/2,height:o,width:kv}}));return c=function({refLabels:e,valueLabel:t}){return e.forEach((e=>{(function(e,t){const n=t.x-t.width/2>=e.x+e.width/2||t.x+t.width/2<=e.x-e.width/2,i=t.y-t.height/2>=e.y+e.height/2;return!(n||i)})(e,t)&&(t.y=e.y+e.height/2+t.height/2)})),t.y}({refLabels:u,valueLabel:{x:o(n.config.rtl),y:c,...a}}),-c},getTopPadding:e=>-a.getBottomPadding(e),getLeftPadding(e){const{width:a}=n.meta.chart.size,s=n.config.rtl,l=i(),c=gw({dockService:n,layoutService:t}),u=Math.min(e.width,a*xv);if(c)return s?a/5-l-u:a/5+l;const h=o(s)-e.width/2,d=hv.RIGHT,f=r()-e.width-hv.LEFT;return h<d?d:h>f?f:h},getRightPadding:e=>-a.getLeftPadding(e)},s={getLeftPadding(r){if(!gw({dockService:n,layoutService:t}))return 0;const o=e.findShapes("container").filter((e=>e.key===Cv.BAR_AXIS));if(1!==o.length)return 0;const a=o[0],s=vw(t.meta.measureAxisShow)?Math.max(...a.children.filter((e=>"text"===e.type)).map((e=>e.bounds.width))):0,l=Math.max(...a.children.filter((e=>"line"===e.type)).map((e=>e.bounds.width))),c=i();let u=c/2+s+l+c*Mv;const{width:h}=n.meta.chart.size;return u>h/2-r.height/4&&(u=h/2-r.height/4),n.config.rtl?u:-u},getRightPadding:e=>-s.getLeftPadding(e),getTopPadding(){if(gw({dockService:n,layoutService:t}))return-4;const r=e.findShapes("container").filter((e=>e.key===Cv.BAR_AXIS));if(1!==r.length)return 0;const o=r[0],a=vw(t.meta.measureAxisShow)?Math.max(...o.children.filter((e=>"text"===e.type)).map((e=>e.bounds.height))):0,s=Math.max(...o.children.filter((e=>"line"===e.type)).map((e=>e.bounds.height))),l=i();return-(l/2+a+s+l*wv)},getBottomPadding:()=>-s.getTopPadding()};return{getBarWidthInPixels:i,getValueLabelFontSize:function(e,t){const{width:i,height:r}=n.meta.chart.size,o=yw(Math.min(r,i),uv.MIN,uv.MAX);return e+Math.round(o*(t-e))},getNeedlePosition:o,barValueLabel:a,barAxisTitle:s}}({chart:n,layoutService:r,dockService:s}),h=function({layoutService:e,themeService:t,colorService:n}){const i=t.getStyles(),r=t=>{var n;const i=null===(n=e.getLayoutValue("components",[]))||void 0===n?void 0:n.find((e=>e.key===t));return i},o=e=>e?n.getPaletteColor(e):void 0;return{query:{axis:{title:{getStyle:()=>{var e,t,n,a;return{fontFamily:null!==(e=null===(t=r("axis"))||void 0===t||null===(t=t.axis)||void 0===t||null===(t=t.title)||void 0===t?void 0:t.fontFamily)&&void 0!==e?e: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 e,t,n,a;return{fontFamily:null!==(e=null===(t=r("axis"))||void 0===t||null===(t=t.axis)||void 0===t||null===(t=t.label)||void 0===t||null===(t=t.name)||void 0===t?void 0:t.fontFamily)&&void 0!==e?e: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 e,t,n,a;return{fontFamily:null!==(e=null===(t=r("value"))||void 0===t||null===(t=t.label)||void 0===t||null===(t=t.value)||void 0===t?void 0:t.fontFamily)&&void 0!==e?e: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:r,themeService:c,colorService:l}),b=pw({options:M,cache:i,layoutService:r}),S=function({layout:e,model:t,translator:n,interactionState:i}){return{isClosed:()=>e.disclaimerClosed,close:()=>{t.getProperties().then((e=>{e.disclaimerClosed=!0,t.setProperties(e)}))},translator:n,isEditMode:i.edit}}({layout:d,model:m,translator:x,interactionState:k});w({layoutService:r,colorService:l,dockService:s,labelService:u,themeService:c,styleService:h,animationsService:b,disclaimerService:S})}),[m,p,d,f.name(),x.language(),e,M.direction,k.edit]),b};function ww({width:e,height:t,fontSize:n}){const{FULL:i}=Tv;if(e>=i.width&&t>=i.height){let e=Number.parseFloat(n);return e=Math.floor(e*mv),`${e}px`}return n}var Mw=e=>()=>e;function kw(e){return 1==(e=+e)?Sw:function(t,n){return n-t?function(e,t,n){return e=Math.pow(e,n),t=Math.pow(t,n)-e,n=1/n,function(i){return Math.pow(e+i*t,n)}}(t,n,e):Mw(isNaN(t)?n:t)}}function Sw(e,t){var n=t-e;return n?function(e,t){return function(n){return e+n*t}}(e,n):Mw(isNaN(e)?t:e)}var _w=function e(t){var n=kw(t);function i(e,t){var i=n((e=cb(e)).r,(t=cb(t)).r),r=n(e.g,t.g),o=n(e.b,t.b),a=Sw(e.opacity,t.opacity);return function(t){return e.r=i(t),e.g=r(t),e.b=o(t),e.opacity=a(t),e+""}}return i.gamma=e,i}(1);function qw({thisColor:e,paletteColors:t,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:t.length-1);const u=o.getTheme().getColorPickerColor(c<t.length&&c>=0?t[c]:t[0]);return{color:l?_w(e,u)(.5):e,offset:a,gradient:l}}function Dw({limits:e,paletteColors:t,paletteIndex:n,themeService:i}){const r=Mt(e,""+(n-1),{}),o=Mt(e,`${n}`,{}),a=[r,o].map((e=>e.gradient)).includes(!0),s=i.getTheme().getColorPickerColor(t[n]);if(!a)return[{offset:0,color:s},{offset:1,color:s}];const l=[qw({thisColor:s,paletteColors:t,paletteIndex:n,limit:r,isLeft:!0,themeService:i}),qw({thisColor:s,paletteColors:t,paletteIndex:n,limit:o,isLeft:!1,themeService:i})],c=2===l.filter((e=>e.gradient)).length;c&&l.splice(1,0,{offset:.5,color:s,gradient:!0});const u=l.map((({offset:e,color:t,gradient:n})=>({offset:e,color:t,gradient:n})));return u}function Aw({themeService:e,segmentInfo:t,rangeLimits:n}){const{limits:i,colors:r}=t;let{paletteColors:o}=t;o&&0!==o.length||!r||(o=r.map((e=>({index:e.color}))));const{min:a,max:s}=n;i.sort(((e,t)=>e.value-t.value));const l=[a,...i.map((e=>e.value)),s],c=[];for(let t=0;t<o.length;t++){const n=Dw({limits:i,paletteColors:o,paletteIndex:t,themeService:e}).map((e=>({offset:yw(l[t]+e.offset*(l[t+1]-l[t]),a,s),color:e.color,gradient:"gradient"in e?e.gradient:void 0})));c.push(...n)}return c}function Cw(e){return e.map((e=>({...e,offset:1-e.offset}))).reverse()}function Nw({themeService:e,isVertical:t,segmentInfo:n,rangeLimits:i,isRtl:r}){return{type:"gradient",x1:0,x2:t?0:1,y1:t?1:0,y2:0,stops:r&&!t?Cw(Aw({themeService:e,segmentInfo:n,rangeLimits:i})):Aw({themeService:e,segmentInfo:n,rangeLimits:i})}}function Ew(e){const t=function(e){if(e=e.replace("#",""),6!==e.length)throw new Error("Invalid hex color");const t=parseInt(e.substring(0,2),16),n=parseInt(e.substring(2,4),16),i=parseInt(e.substring(4,6),16);return{r:t,g:n,b:i}}(e),n=.21*t.r+.72*t.g+.07*t.b>127.5?-50:50;return`rgb(${t.r+n}, ${t.g+n}, ${t.b+n})`}function Rw({services:e}){const{dockService:t,disclaimerService:n}=e,{translator:i,isClosed:r,isEditMode:o}=n;if(r()||!o)return!1;const a=t.config.rtl;return{key:"disclaimer-component",type:"disclaimer-component",layout:{displayOrder:5,minimumLayoutMode:Lv},settings:{isRtl:a,close:e.disclaimerService.close,title:i.get("Object.Gauge.RangeIsDefaultTitle"),text:i.get("Object.Gauge.RangeIsDefault")}}}function Iw({services:e}){const{dockService:t,layoutService:n,themeService:i,animationsService:r}=e,{qHyperCube:o,useSegments:a,segmentInfo:s,rangeLimits:l}=n.meta,c=gw({dockService:t,layoutService:n}),u=c?"vertical":"horizontal";if(!a)return!1;const{min:h,max:d}=l,f=o.qDataPages[0].qMatrix[0][0].qNum,p=Math.max(h,Math.min(d,f)),m={type:"box",key:Cv.MARK,data:{extract:{field:"qMeasureInfo/0",props:{start:p,end:p,measureIndex:0}}},settings:{minor:{scale:"m"},orientation:u,box:{width:.1,maxWidthPx:rv,minHeightPx:pv,fill:()=>function({themeService:e,isVertical:t,segmentInfo:n,rangeLimits:i,value:r}){const o=Nw({themeService:e,isVertical:t,segmentInfo:n,rangeLimits:i,isRtl:!1});let{min:a,max:s}=i;const l=yw(r,a,s),{stops:c}=o;let u="black";for(let e=0;e<c.length;e++){const t=c[e].offset,n=c[e+1].offset;if(l>=t&&l<=n){const i=yw(l,t,n);u=Fb(_w(c[e].color,c[e+1].color)(i));break}}return u}({value:f,themeService:i,isVertical:c,segmentInfo:s,rangeLimits:l}),stroke:"transparent"}},animations:{enabled:r.enabled,trackBy:e=>`${e.data.measureIndex.value}`}};return m}function Ow({services:e}){const{dockService:t,themeService:n,styleService:i,layoutService:r,animationsService:o}=e;if(!vw(r.meta.measureAxisShow))return[];const{width:a,height:s}=t.meta.chart.size,l=$b(a,s,ov,av),{innerRadius:c,outerRadius:u,radiusIncrease:h}=l,d=4*h,f=Math.min(a,s)/2,p=n.getStyles(),m=i.query.axis.label.getStyle(),{tickLength:g,labelPadding:y}=function({width:e,height:t,defaultTickSize:n,defaultLabelPadding:i}){const r=Math.min(Math.min(e,t)/zv,1);return{tickLength:n*r,labelPadding:i*r}}({width:a,height:s,defaultTickSize:8,defaultLabelPadding:20}),x=Gb(a,s),v={key:Cv.RADIAL_AXIS,type:"axis",rendererSettings:{disableScreenReader:!0},dock:"center",layout:{minimumLayoutMode:Pv},scale:"m",settings:{arc:{radius:u,startAngle:ov,endAngle:av,offset:-10*d*(u-c)*f},align:"top",line:{show:!1,stroke:"#cdcdcd"},ticks:{tickSize:g,stroke:p.axis.line.major.color,margin:x},labels:{margin:-6-2*g+y,fontFamily:m.fontFamily,fill:m.fill,fontSize:m.fontSize}},animations:{enabled:o.enabled,trackBy:e=>{const{type:t,text:n,x:i,y:r,x1:o,y1:a,value:s}=e;return"text"===t?`text-${n}-${i}-${r}`:`tick-${s}-${o}-${a}`}}};return[v]}function Pw(e,t,n,i){const r=i?Cw(Aw({themeService:t,segmentInfo:n,rangeLimits:e})):Aw({themeService:t,segmentInfo:n,rangeLimits:e}),o=(av-ov)/(2*Math.PI),a=r.map((e=>{""!==e.color&&void 0!==e.color||(e.color="#000000");return{offset:e.offset*o,color:e.color}}));return{type:"gradient",orientation:"conic",startAngle:ov-Math.PI/2,x:0,y:0,stops:a}}function Lw({services:e}){const{dockService:t,themeService:n,layoutService:i,animationsService:r}=e,{rangeLimits:o,useSegments:a,segmentInfo:s,qHyperCube:l}=i.meta,{width:c,height:u}=t.meta.chart.size,h=t.config.rtl,{outerRadius:d,innerRadius:f,labelGaugeRadius:p}=$b(c,u,ov,av),m=o.max,g=l.qDataPages[0].qMatrix[0][0].qNum,y=m-g,x=[{value:Math.max(Ev,g-o.min),valueLabel:"Measure"},{value:Math.max(Ev,y),valueLabel:"Remaining"}];let v=function({themeService:e,segmentInfo:t,rangeLimits:n}){const i=Aw({themeService:e,segmentInfo:t,rangeLimits:n});let r=0,o=0,a=i.map((e=>(""!==e.color&&void 0!==e.color||(e.color="#000000"),o=0===n.max?e.offset*(n.max-n.min)-r:e.offset*n.max-r,r+=o,{value:o,color:e.color,gradient:e.gradient}))).filter((e=>0!==e.value||!0===e.gradient));return a.forEach((e=>{e.value=Math.abs(e.value)})),a}({themeService:n,segmentInfo:s,rangeLimits:o});h&&(x.reverse(),v.reverse());const b={type:"pie",key:Cv.RADIAL_GAUGE,data:{items:x},settings:{startAngle:ov,endAngle:av,slice:{arc:{ref:"value"},outerRadius:()=>d,innerRadius:()=>f,fill:(t,n)=>{const i=Hb({services:e});return h?1===n?i(t):sv:0===n?i(t):sv},strokeWidth:1,stroke:(t,n)=>{const i=Ew(Hb({services:e})(t));return h?1===n?i:"#0000":0===n?i:"#0000"}}},animations:{enabled:r.enabled,trackBy:e=>e.data.value.valueLabel}},w={type:"pie",key:Cv.SEGMENT_RADIAL_GAUGE,renderer:"canvas",displayOrder:1,data:{items:v},settings:{startAngle:ov,endAngle:av,slice:{arc:{ref:"value"},outerRadius:()=>d,innerRadius:()=>f,strokeWidth:0,fill:(e,t)=>{var i,r;return(h?e.datum.value.gradient||(null===(i=v[t+1])||void 0===i?void 0:i.gradient):e.datum.value.gradient||(null===(r=v[t-1])||void 0===r?void 0:r.gradient))?Pw(o,n,s,h):e.datum.value.color}}},animations:{enabled:r.enabled,trackBy:e=>e.data.value.color}},M={type:"pie",key:Cv.CIRCLE_GAUGE,renderer:"canvas",displayOrder:0,data:{items:[{value:Math.max(g,Ev),valueLabel:"Measure"}]},settings:{startAngle:0,endAngle:2*Math.PI,slice:{arc:{ref:"value"},outerRadius:()=>d,innerRadius:()=>f,fill:()=>function(e,t,n,i){let r=Pw(e,t,n,i);const o={offset:(av-ov)/(2*Math.PI),color:"rgba(0, 0, 0, 0)"};return r.stops.push(o),r.stops.push({offset:1,color:"rgba(0, 0, 0, 0)"}),r}(o,n,s,h),strokeWidth:0,opacity:a?1:0}},animations:{enabled:r.enabled,trackBy:e=>e.data.value.valueLabel,isMainComponent:!0}},k={type:"pie",key:Cv.LABEL_RADIAL_GAUGE,renderer:"canvas",displayOrder:0,data:{items:[{value:Math.max(g,Ev),valueLabel:"Measure"}]},settings:{startAngle:0,endAngle:2*Math.PI,slice:{arc:{ref:"value"},outerRadius:()=>p+.01,innerRadius:()=>p,opacity:0}},animations:{enabled:r.enabled,trackBy:e=>e.data.value.valueLabel,isMainComponent:!0}};return a?[M,k,w]:[k,b]}function Tw({chart:e,services:t}){const{layoutService:n,styleService:i,labelService:r,animationsService:o,dockService:a}=t,{width:s,height:l}=a.meta.chart.size,{getValueLabelFontSize:c}=r,u=i.query.axis.title.getStyle(),h=c(cv.MIN,cv.MAX),d=Number.parseFloat(ww({width:s,height:l,fontSize:u.fontSize})),f=function({width:e,height:t,totalFontHeight:n}){const i=$b(e,t,ov,av).labelGaugeRadius*Math.min(e,t)*.9-n;return(Xb(e,t)-2*Gb(e,t))/i}({width:s,height:l,totalFontHeight:h+d}),p=.5-f,m=xw(n.meta.measureAxisShow,s,l),{qHyperCube:g}=n.meta,y=g.qMeasureInfo[0].qFallbackTitle,x=g.qDataPages[0].qMatrix[0][0].qNum,v=i.query.label.getStyle(),b={type:"labels",key:Cv.RADIAL_GAUGE_LABEL,layout:{displayOrder:4},settings:{sources:[{component:Cv.LABEL_RADIAL_GAUGE,selector:"path",strategy:{type:"rows",settings:{fill:"#000",padding:0,justify:p,labels:[{fontSize:h,fontFamily:v.fontFamily,fill:v.fill,label({data:t}){const n=e.formatter(Av.MEASURE);return t&&n?n(x):""},linkData:({data:e})=>e?{value:e.value.value,formatter:Av.MEASURE}:null},{fontSize:d,fontFamily:u.fontFamily,fill:u.color,label:()=>m?y:""}]}}}]},animations:{enabled:o.enabled,trackBy:e=>"text"+(e.data?"value-label":"axis-title"),adjustTweenedNodes(t){t.forEach((t=>{const{type:n,data:i}=t;if("text"===n&&i&&i.value&&i.formatter&&(t.text=e.formatter(i.formatter)(i.value),t.ellipsed)){const{text:e,fontSize:n,fontFamily:i,maxWidth:r}=t,o=`normal ${n} ${i}`,a="…",s=1;t.ellipsed=rw.tokenize(e,o,a,s,r)[0]}}))}}};return[b]}function zw({services:e}){const{dockService:t,layoutService:n,animationsService:i}=e,{width:r,height:o}=t.meta.chart.size,a=t.config.rtl,{rangeLimits:s,qHyperCube:l}=n.meta,{min:c,max:u}=s;let h,d=l.qDataPages[0].qMatrix[0][0].qNum;(d>u||d<c)&&(h="#00000000"),a&&(d=u-(d-c));const f=ov+yw(d,c,u)*(av-ov);return{type:"radial-gauge-needle",key:Cv.RADIAL_GAUGE_NEEDLE,layout:{displayOrder:2},settings:{component:Cv.SEGMENT_RADIAL_GAUGE,fill:h,valueAngle:f},animations:{enabled:i.enabled,trackBy:e=>e.type,adjustTweenedNodes(e){e.forEach((e=>{const{data:t}=e;if(t){const{pointerWidth:n,angle:i,radius:a,fill:s}=t,l=Wb(r/2,o/2,a,i+Math.PI/2),{x:c,y:u}=l,h=[{x:c+.3*n,y:u},{x:c-7.5*n,y:u+n},{x:c-7.5*n,y:u-n}],{d:d}=Vb({points:h,angle:i,fill:s,origin:l});e.d=d}}))}}}}function Fw({services:e}){const{dockService:t,layoutService:n,colorService:i,animationsService:r}=e,{width:o,height:a}=t.meta.chart.size,s=t.config.rtl,{rangeLimits:l,useSegments:c,qHyperCube:u}=n.meta,{min:h,max:d}=l,f=u.qDataPages[0].qMatrix[0][0].qNum,{outerRadius:p,innerRadius:m}=$b(o,a,ov,av),g=(m+(p-m)/2)*Math.min(o,a)/2,{RADIAL_OOB_INDICATOR_MIN:y,RADIAL_OOB_INDICATOR_MAX:x,SEGMENT_RADIAL_GAUGE:v,RADIAL_GAUGE:b}=Cv;return[y,x].map(((t,n)=>{const i=c?v:b,l=function(e,t){const n=Hb({services:e})({datum:{value:()=>0}});return t?"#595959":n}(e,c);let u=0;(0===n&&f<h||1===n&&f>d)&&(u=Ub({innerRadius:m,outerRadius:p,width:o,height:a}));let y=ov;return(0===n&&s||1===n&&!s)&&(y=av),{type:"radial-oob-indicator",key:t,layout:{displayOrder:2},settings:{component:i,selector:"path",angle:y,radius:g,size:u,fill:l},animations:{enabled:r.enabled,trackBy:e=>e.type}}}))}function jw({core:e,services:t}){const{chart:n}=e;if(!n)return[];const{dockService:i,layoutService:r}=t,{width:o,height:a}=i.meta.chart.size,{useSegments:s}=r.meta,l=gw({dockService:i,layoutService:r});let c=[Rw({services:t})];if("bar"===t.layoutService.meta.gaugetype){c.push(...function({services:e}){const{dockService:t,layoutService:n,styleService:i,themeService:r,animationsService:o}=e;if("none"===n.meta.measureAxisShow)return[];const{width:a,height:s}=t.meta.chart.size,l=t.config.rtl,c=gw({dockService:t,layoutService:n}),u=r.getStyles(),h=i.query.axis.label.getStyle(),{fontFamily:d,fill:f,fontSize:p}=h,m=vw(n.meta.measureAxisShow);return[{type:"axis",rendererSettings:{disableScreenReader:!0},key:Cv.BAR_AXIS,dock:"center",scale:"m",layout:{minimumLayoutMode:Rv},settings:{align:c?l?"right":"left":"top",line:{show:!c,stroke:u.axis.line.major.color},labels:{show:m,minLengthPx:20,fontFamily:d,fill:f,fontSize:ww({width:a,height:s,fontSize:p})},paddingStart:()=>{if(c){const e=Math.min(a/10,rv);return a/2+e/2}const e=Math.min(s/10,rv);return s/2+e/2+bv},ticks:{stroke:u.axis.line.major.color}},animations:{enabled:o.enabled,trackBy:e=>void 0===e.tickValue?"axis":"text"===e.type?`label: ${e.tickValue}`:`mark: ${e.tickValue}`}}]}({services:t}),...function({services:e}){const{themeService:t,dockService:n,layoutService:i,animationsService:r}=e,{rangeLimits:o,segmentInfo:a,useSegments:s}=i.meta,l=n.config.rtl,c=gw({dockService:n,layoutService:i}),u=c?"vertical":"horizontal",{min:h,max:d}=o,f=l&&!c?d:h,p={type:"box",key:Cv.BAR,data:{extract:{field:"qMeasureInfo/0",props:{start:h,end:{field:"qMeasureInfo/0"},measureIndex:0}}},settings:{minor:{scale:"m"},orientation:u,box:{width:.1,maxWidthPx:rv,fill:Hb({services:e}),strokeWidth:1,stroke:t=>Ew(Hb({services:e})(t))}},animations:{enabled:r.enabled,isMainComponent:!0,trackBy:e=>`${e.data.measureIndex.value}`}},m={type:"box",key:Cv.SEGMENT_BAR,data:{extract:{field:"qMeasureInfo/0",props:{start:h,end:d,measureIndex:0}}},settings:{minor:{scale:"m"},orientation:u,box:{width:.1,maxWidthPx:rv,fill:()=>Nw({themeService:t,isVertical:c,segmentInfo:a,rangeLimits:o,isRtl:l}),stroke:"transparent"}},animations:{enabled:r.enabled,trackBy:e=>`${e.data.measureIndex.value}`}},g={type:"box",key:Cv.BACKGROUND_BAR,data:{extract:{field:"qMeasureInfo/0",props:{start:h,end:d}}},settings:{minor:{scale:"m"},orientation:u,box:{width:.1,maxWidthPx:rv,fill:sv}}},y={type:"box",key:Cv.LABEL_BAR,data:{extract:{field:"qMeasureInfo/0",props:{start:f,end:f}}},settings:{minor:{scale:"m"},orientation:u,box:{width:c?xv:vv,opacity:0}}};return s?[y,m]:[y,g,p]}({services:t}),...function({services:e}){const{dockService:t,labelService:n,styleService:i,layoutService:r}=e,{width:o,height:a}=t.meta.chart.size;if(!xw(r.meta.measureAxisShow,o,a))return[];const s=gw({dockService:t,layoutService:r}),{measureAxisTitle:l,useSegments:c}=r.meta,{getTopPadding:u,getBottomPadding:h,getLeftPadding:d,getRightPadding:f}=n.barAxisTitle,p=i.query.axis.title.getStyle(),{fontFamily:m,fontSize:g,color:y}=p;return[{type:"labels",key:Cv.AXIS_TITLE,settings:{sources:[{component:c?Cv.SEGMENT_BAR:Cv.BACKGROUND_BAR,selector:"rect",strategy:{type:"bar",settings:{direction:s?"up":"right",align:.5,justify:.5,labels:[{fontFamily:m,fill:y,fontSize:Number.parseFloat(ww({width:o,height:a,fontSize:g})),label:()=>l,placements:[{position:"inside",padding:{top:u,bottom:h,left:d,right:f},overflow:!0}]}]}}}]}}]}({services:t}),function({services:e}){const{layoutService:t,dockService:n,labelService:i,animationsService:r}=e,{qHyperCube:o,rangeLimits:a,useSegments:s}=t.meta,l=n.config.rtl,c=gw({dockService:n,layoutService:t}),{min:u,max:h}=a,d=o.qDataPages[0].qMatrix[0][0].qNum;let f=i.getBarWidthInPixels();d<=h&&d>=u&&(f=0);let p=c?"bottom":l?"right":"left";return d>h&&(p=c?"top":l?"left":"right"),{type:"oob-indicator",key:Cv.OOB_INDICATOR,layout:{displayOrder:2},settings:{component:s?Cv.SEGMENT_BAR:Cv.BAR,isRtl:l,selector:"rect",pointingTo:p,size:f},animations:{enabled:r.enabled,trackBy:e=>e.type}}}({services:t}),Iw({services:t}));const e=function({chart:e,services:t}){if(!e.formatter)return!1;const{labelService:n,styleService:i,dockService:r,layoutService:o,animationsService:a}=t,s=gw({dockService:r,layoutService:o}),{getValueLabelFontSize:l,barValueLabel:c}=n,{getTopPadding:u,getBottomPadding:h,getLeftPadding:d,getRightPadding:f}=c,p=l(cv.MIN,cv.MAX),m=i.query.label.getStyle(),g={type:"labels",key:Cv.GAUGE_LABEL,layout:{minimumLayoutMode:s?Iv:Ov},settings:{sources:[{component:Cv.LABEL_BAR,selector:"rect",formatter:"measure",strategy:{type:"bar",settings:{direction:s?"up":"right",orientation:"horizontal",fontFamily:m.fontFamily,fill:m.fill,fontSize:p,align:s?0:.5,justify:0,labels:[{label:({data:t})=>t?e.formatter(Av.MEASURE)(t.value):"",linkData:({data:e})=>e?{value:e.value,formatter:Av.MEASURE}:null,placements:[{position:"outside",padding:{top:u,bottom:h,left:d,right:f},overflow:!0}]}]}}}]},animations:{enabled:a.enabled,trackBy:e=>e.type,adjustTweenedNodes(t){t.forEach((t=>{const{type:n,data:i}=t;"text"===n&&i&&i.value&&i.formatter&&(t.text=e.formatter(i.formatter)(i.value))}))}}};return g}({chart:n,services:t}),i=function({services:e}){const{dockService:t,layoutService:n,labelService:i,themeService:r,colorService:o,animationsService:a}=e,{refLines:s}=n.meta,l=t.config.rtl,c=gw({dockService:t,layoutService:n}),u=r.getStyles(),h={type:"custom-ref-line",key:Cv.REFERENCE_LINES_AND_LABELS,settings:{barWidth:i.getBarWidthInPixels(),isRtl:l,needlePosition:i.getNeedlePosition(!1)},lines:{[c?"y":"x"]:s.filter(Yb).map((e=>{var t,n;return{scale:"m",value:e.refLineExpr.value,cId:e.cId,label:{text:e.label,...u.referenceLine.label.name,showValue:e.showValue,showLabel:e.showLabel},line:{stroke:o.getPaletteColor(e.paletteColor||{index:e.color}),strokeWidth:(null===(t=e.style)||void 0===t?void 0:t.lineThickness)||2,strokeDasharray:null===(n=e.style)||void 0===n?void 0:n.lineType}}}))},animations:{enabled:a.enabled,trackBy:e=>{const{type:t,cId:n,text:i,isConnector:r}=e;return"text"===t?`${n}-text-${i}`:"line"===t?r?`${n}-connector`:`${n}-line`:Math.random()}}};return h}({services:t});l?(c.push(e),c.push(i)):(c.push(i),c.push(e))}else o>=Tv.SPARK.width&&a>=Tv.SPARK.height?c.push(...Lw({services:t}),...Tw({chart:n,services:t}),...Ow({services:t}),...s?[zw({services:t})]:[],...Fw({services:t}),function({services:e}){const{dockService:t,themeService:n,colorService:i,layoutService:r,animationsService:o}=e,{width:a,height:s}=t.meta.chart.size,{refLines:l}=r.meta,c=n.getStyles(),u=$b(a,s,ov,av),{innerRadius:h,outerRadius:d}=u,f=Ub({innerRadius:h,outerRadius:d,width:a,height:s}),p={type:"radial-custom-ref-line",key:Cv.RADIAL_REFERENCE_LINES,displayOrder:1,settings:{barWidth:f},lines:{radial:l.filter(Yb).map((e=>{var t,n;return{scale:"r",value:e.refLineExpr.value,cId:e.cId,label:{text:e.label,...c.referenceLine.label.name,showValue:e.showValue,showLabel:e.showLabel},radius:u.innerRadius,line:{stroke:i.getPaletteColor(e.paletteColor||{index:e.color}),strokeWidth:(null===(t=e.style)||void 0===t?void 0:t.lineThickness)||2,strokeDasharray:null===(n=e.style)||void 0===n?void 0:n.lineType}}}))},animations:{enabled:o.enabled,trackBy:e=>{const{type:t,cId:n}=e;return"line"===t?`${n}-line`:Math.random()},adjustTweenedNodes(e){e.forEach((e=>{const{type:t,data:n}=e;if("line"===t){const{angle:t,innerRadius:i}=n;e.x1=a/2+Math.cos(t)*i,e.y1=s/2+Math.sin(t)*i,e.x2=a/2+Math.cos(t)*(i+f),e.y2=s/2+Math.sin(t)*(i+f)}}))}}};return p}({services:t})):c.push(function({services:e}){const{dockService:t,layoutService:n,themeService:i,animationsService:r}=e,{width:o,height:a}=t.meta.chart.size,{rangeLimits:s,useSegments:l,segmentInfo:c,qHyperCube:u}=n.meta,{min:h,max:d}=s,f=u.qDataPages[0].qMatrix[0][0].qNum,p=$b(o,a,ov,av).outerRadius;let m;m=f<h?ov:f>d?av:ov+(f-h)/(d-h)*(av-ov);const g=Hb({services:e}),y=l?function({value:e,segmentInfo:t,themeService:n}){const{paletteColors:i,limits:r}=t,o=n.getTheme();if(!r.length)return o.getColorPickerColor(i[0]);const a=r.findIndex((t=>e<=t.value)),s=-1===a?i.length-1:a;return o.getColorPickerColor(i[s]||i[i.length-1])}({value:f,segmentInfo:c,themeService:i}):g({datum:{value:()=>0}});return{type:"radial-spark",key:Cv.RADIAL_SPARK,layout:{displayOrder:2},settings:{fill:y,radius:p,valueAngle:m},animations:{enabled:r.enabled,trackBy:e=>e.type}}}({services:t}));return c}const Vw=Math.log(10),Bw={log:(e,t)=>e<=0||t<=0?NaN:Math.log(e)/Math.log(t),log10:e=>e<=0?NaN:Math.log(e)/Vw,getNiceNumber(e){let t;if(0===e)return 0;const n=Math.floor(Math.log(Math.abs(e))/Vw),i=e/10**n;return t=i<=1?1:i<=2?2:i<=5?5:10,t*10**n*(e<0?-1:1)},getSmallNiceNumber(e){let t;if(0===e)return 0;let n=Math.floor(Math.log(Math.abs(e))/Vw);const i=e/10**n;return i<1?(t=5,n--):t=i<2?1:i<5?2:5,t*10**n*(e<0?-1:1)},getGoodNumber(e){let t;if(0===e)return 0;const n=Math.floor(Math.log(Math.abs(e))/Vw),i=e/10**n;return t=Math.ceil(i),7!==t&&9!==t||t++,i>1&&i<=1.5?t=1.5:i>2&&i<=2.5&&(t=2.5),t*10**n*(e<0?-1:1)},calculateTicks(e,t,n,i,r,o){return this.plotSize=e,this.explicitPlotMin=t,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===e?(this.plotMin=this.explicitPlotMin,this.plotMax=this.explicitPlotMax,this.tickDataSpacingNN=this.tickDataSpacing,Zw.call(this),Qw.call(this)):(this.maxNumIntervals<1?Uw.call(this):(this.explicitPlotMax>0&&this.explicitPlotMin<0?1===this.maxNumIntervals?Ww.call(this,!0):this.maxNumIntervals>=5?$w.call(this):this.maxNumIntervals<2?Yw.call(this):Gw.call(this):$w.call(this),this.tickMaxIndex<this.tickMinIndex?(this.tickDataSpacing=Math.max(this.usedDataRange/this.maxNumIntervals,this.minTickDataSpacing),Uw.call(this)):Xw.call(this)),Zw.call(this),Qw.call(this))}};function Hw(e,t,n){void 0===e&&(e=null!==this.explicitPlotMin),void 0===t&&(t=null!==this.explicitPlotMax),this.tickDataSpacingNN=n?Bw.getGoodNumber(this.tickDataSpacing):Bw.getNiceNumber(this.tickDataSpacing),Jw.apply(this,[e,t])}function $w(){Hw.call(this);const e=this.tickMaxIndex-this.tickMinIndex;let t=this.plotMax-this.plotMin;this.spaceUseFactor=t/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),Hw.call(this),t=this.plotMax-this.plotMin,this.spaceUseFactor=t/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||e<=2&&this.maxNumIntervals>=2*e)&&Hw.apply(this,[void 0,void 0,!0]),t=this.plotMax-this.plotMin,this.spaceUseFactor=t/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),Hw.apply(this,[void 0,void 0,!0]),t=this.plotMax-this.plotMin,this.spaceUseFactor=t/this.plotRange,n=this.plotSize*this.tickDataSpacingNN/this.plotRange<this.minTickSpacingInPixel}function Ww(e){e?(this.tickDataSpacingNN=Bw.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=Bw.getNiceNumber(this.absMax),this.tickDataSpacingNN===this.absMax&&(this.tickDataSpacingNN=Bw.getNiceNumber(1.1*this.absMax)))}function Uw(){let e;this.tickDataSpacingNN=Bw.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)&&(e=Bw.getSmallNiceNumber(this.plotRange),this.tickBaseValue=Math.ceil(this.plotMin/e)*e)}function Yw(){const e=this.explicitPlotMax>=-this.explicitPlotMin,t=e||null!==this.explicitPlotMin,n=!e||null!==this.explicitPlotMax;Hw.apply(this,[t,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),Hw.apply(this,[t,n,!0]);const r=this.plotMax-this.plotMin;this.spaceUseFactor=r/this.plotRange}function Gw(){$w.call(this);const e=this.plotMax-this.plotMin;this.spaceUseFactor=e/this.plotRange}function Xw(){const e=Bw.getNiceNumber(this.tickDataSpacingNN);if(this.tickDataSpacingNN===e||0!==this.tickBaseValue)return;const t=this.tickDataSpacingNN,n=this.tickMinIndex,i=this.tickMaxIndex,r=i-n,o=this.plotMin,a=this.plotMax;this.tickDataSpacingNN=e,Jw.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=t,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 Zw(){let e,t;if(this.mainTickValues=[],this.secondaryTickValues=[],Kw.call(this),0===this.plotSize)return;e=this.tickBaseValue;const n=this.tickMaxIndex-this.tickMinIndex;if(!(n<1)){for(t=0;t<=n;t++)this.mainTickValues.push(e+(t+this.tickMinIndex)*this.tickDataSpacingNN);for(e=this.tickBaseValue+this.tickDataSpacingNN/2,t=0;t<n;t++)this.secondaryTickValues.push(e+(t+this.tickMinIndex)*this.tickDataSpacingNN)}}function Jw(e,t){this.tickMinIndex=e?Math.ceil(this.explicitPlotMin/this.tickDataSpacingNN):Math.floor(this.explicitPlotMin/this.tickDataSpacingNN),this.tickMaxIndex=t?Math.floor(this.explicitPlotMax/this.tickDataSpacingNN):Math.ceil(this.explicitPlotMax/this.tickDataSpacingNN),this.plotMin=e?this.explicitPlotMin:this.tickMinIndex*this.tickDataSpacingNN,this.plotMax=t?this.explicitPlotMax:this.tickMaxIndex*this.tickDataSpacingNN,this.plotRange=this.plotMax-this.plotMin}function Qw(){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 eM({core:e,dockService:t,rangeLimits:n,measureAxisSpacing:i,isRadial:r,isVertical:o,styleService:a}){const s=n.min,l=n.max,{width:c,height:u}=function(e){return{width:e.meta.chart.size.width,height:e.meta.chart.size.height}}(t);let h,d=96*i;if(r)h=Math.min(u,c);else{h=o?u:c;const{chart:t,picassoInstance:n}=e;if(t&&n){const e=t.formatter(Av.MEASURE),r=n.renderer("svg")(),f=a.query.axis.label.getStyle(),{fontFamily:p,fontSize:m}=f,g=e=>r.measureText({text:e,fontSize:ww({width:c,height:u,fontSize:m}),fontFamily:p}),y=Math.max(96,...[s,l,(l-s)/2].map((t=>g(e(t)).width)));d=o?4*g("M").height:y;d=h/(Math.max(2,h/d/i+1)-1)}}const f=function({plotSize:e,rangeMax:t,rangeMin:n,minTickSpacingInPixel:i}){const r=Bw.calculateTicks(e,n,t,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]=r.plotMax:o.push(r.plotMax),o}({plotSize:h,rangeMin:s,rangeMax:l,minTickSpacingInPixel:d});return{values:f}}function tM({isRadial:e,dockService:t,isVertical:n}){return e?!t.config.rtl:!!n||t.config.rtl}function nM({core:e,services:t,logicalSize:n}){if(!t.layoutService.meta.qHyperCube)throw new Error("Layout is missing a hypercube");const i=jw({core:e,services:t}),r=function({core:e,services:t}){const{dockService:n,styleService:i,colorService:r,layoutService:o}=t,{rangeLimits:a,measureAxisSpacing:s,gaugetype:l}=o.meta,c=gw({dockService:n,layoutService:o}),u="radial"===l,h=eM({core:e,dockService:n,rangeLimits:a,measureAxisSpacing:s,isRadial:u,isVertical:c,styleService:i});return{m:{data:{field:"qMeasureInfo/0"},type:"linear",invert:tM({isRadial:u,dockService:n,isVertical:c}),min:a.min,max:a.max,ticks:{values:h.values}},r:{data:{field:"qMeasureInfo/0"},invert:n.config.rtl,min:a.min,max:a.max},...r.getScales()}}({core:e,services:t});return{scales:r,components:i,formatters:{[Av.MEASURE]:{data:{field:"qMeasureInfo/0"}}},strategy:{layoutModes:Tv,logicalSize:n}}}const iM={Object_Gauge_RangeIsDefault:{id:"Object.Gauge.RangeIsDefault",locale:{"de-DE":"Max. und Min. auf Standardwerte festgelegt. Sie können über das Eigenschaften-Fenster unter Darstellung > Präsentation geändert werden.","en-US":"Max. and Min. set to default values. You can change them via the properties window under Display > Presentation.","es-ES":"Máx y mín se han configurado como valores predefinidos. Puede cambiarlos en el panel de propiedades en Aspecto > Presentación.","fr-FR":"Les valeurs max. et min. par défaut sont définies. Vous pouvez les modifier via le panneau des propriétés sous Aspect > Présentation.","it-IT":"Il massimo e il minimo vengono impostati sui valori predefiniti. È possibile modificarli nel pannello delle proprietà in Aspetto > Presentazione.","ja-JP":"最大値と最小値は規定値に設定されています。これは、スタイル > プレゼンテーションからプロパティ パネルで変更できます。","ko-KR":"최대 및 최소 값이 기본값으로 설정됩니다. 모양 > 프레젠테이션 아래 속성 패널에서 이를 변경할 수 있습니다.","nl-NL":"Max. en min. zijn ingesteld op standaardwaarden. U kunt deze wijzigen in het eigenschappenvenster onder Uiterlijk > Presentatie.","pl-PL":"Maks. i Min. są ustawione na wartości domyślne. Można je zmienić w panelu właściwości, w obszarze Wygląd > Prezentacja.","pr-BR":"Máx. e mín. estão definidos com valores padrão. É possível alterá-los no painel de propriedades, em Aparência > Apresentação.","ru-RU":"Максимальные и минимальные значения установлены по умолчанию. Эти значения можно изменить на панели свойств в меню Вид > Представление.","sv-SE":"Max och min är inställda på standardvärden. Du kan ändra dem i egenskapspanelen under Utseende > Presentation.","tr-TR":"Maks. ve min. değerleri varsayılan değerlere ayarlanmıştır. Görünüş > Sunum altındaki özellikler panelinden bu değerleri değiştirebilirsiniz.","zh-CN":"最大值和最小值已设置为默认值。您可以在“外观”>“显示”下的属性面板中进行更改。","zh-TW":"最大值與最小值均設為預設值。您可以在 [外觀] > [呈現方式] 之下的屬性面板中變更這些值。"}},Object_Gauge_RangeIsDefaultTitle:{id:"Object.Gauge.RangeIsDefaultTitle",locale:{"de-DE":"Bereich auf Standardwerte eingestellt","en-US":"Range set to default values","es-ES":"Rango fijado a valores predeterminados","fr-FR":"Plage définie sur les valeurs par défaut","it-IT":"Scala impostata sui valori predefiniti","ja-JP":"範囲は規定値に設定されています","ko-KR":"범위가 기본값으로 설정됩니다.","nl-NL":"Bereik ingesteld op standaardwaarden","pl-PL":"Zakres ustawiony na wartości domyślne","pt-BR":"Intervalo definido com valores padrão","ru-RU":"Значения диапазона установлены по умолчанию","sv-SE":"Intervallet har standardvärden","tr-TR":"Varsayılan değerlere ayarlı aralık","zh-CN":"范围设置为默认值","zh-TW":"範圍會設為預設值"}}};const rM={version:JSON.stringify("0.8.3"),qHyperCubeDef:{qMeasures:[],qInitialDataFetch:[{qWidth:1,qHeight:1}],qSuppressZero:!1,qSuppressMissing:!0},showTitles:!0,title:"",subtitle:"",footnote:"",measureAxis:{min:0,max:100},orientation:"horizontal",valueMode:"absolute",segmentInfo:{limits:[],colors:[{color:3}]}};function oM(e){return{properties:rM,data:{targets:[{path:"/qHyperCubeDef",...Jt(e)}]}}}function aM(r){return function(e){if(e&&e.get&&e.add){const t="Object.Gauge.RangeIsDefault";if(e.get(t)!==t)return;Object.keys(iM).forEach((t=>{e.add(iM[t])}))}}(r.translator),{qae:oM(r),ext:nn(r),component(){const r=(()=>{const r=e(),o=t(),[a,s]=n({});return i((()=>{r.style.overflow="hidden";const e=nv();e.use($i),e.component("oob-indicator",Bb),e.component("radial-gauge-needle",Kb),e.component("radial-custom-ref-line",aw),e.component("custom-ref-line",cw),e.component("radial-oob-indicator",Zb),e.component("radial-spark",sw),e.component("disclaimer-component",iv);const t=e({renderer:{prio:[o.renderer||"svg"]}}),n=t.chart({element:r,data:[],settings:{}});return s({picassoInstance:t,chart:n,cache:_t()}),()=>{n.destroy()}}),[]),a})(),o=bw({core:r}),a=(({core:e,services:r})=>{const[o,a]=n({}),s=t(),c=l();return d((async()=>{if(!r)return Promise.resolve();const{colorService:t}=r;return t.initialize().then((()=>{const{layoutService:t}=r,n=fw({layout:t.getLayout(),options:s}),i=nM({core:e,services:r,logicalSize:n});a(i)}))}),[r]),i((()=>{if(r&&r.dockService&&r.layoutService){const{dockService:t,layoutService:n,animationsService:i}=r;i.meta.isSizeChanging=!0;const o=fw({layout:n.getLayout(),options:s});t.update(o||c);const l=nM({core:e,services:r,logicalSize:o});a(l)}}),[c]),o})({core:r,services:o});dw({core:r,settings:a,services:o}),(({services:e})=>{f((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:o})}}}export{aM as default};
11
+ e.exports=function(e,t){if(!e||isNaN(+t))return t;var n,i,r,o,a,s,l,c,u,h,d=e.length,f=e.search(/[0-9\-\+#]/),p=f>0?e.substring(0,f):"",m=e.split("").reverse().join(""),g=m.search(/[0-9\-\+#]/),y=d-g,x=e.substring(y,y+1),v=y+("."===x||","===x?1:0),b=g>0?e.substring(v,d):"";if(n=(t="-"===(e=e.substring(f,v)).charAt(0)?-t:+t)<0?t=-t:0,r=(i=e.match(/[^\d\-\+#]/g))&&i[i.length-1]||".",o=i&&i[1]&&i[0]||",",e=e.split(r),t=+(t=t.toFixed(e[1]&&e[1].length))+"",s=e[1]&&e[1].lastIndexOf("0"),(!(c=t.split("."))[1]||c[1]&&c[1].length<=s)&&(t=(+t).toFixed(s+1)),u=e[0].split(o),e[0]=u.join(""),(a=e[0]&&e[0].indexOf("0"))>-1)for(;c[0].length<e[0].length-a;)c[0]="0"+c[0];else 0==+c[0]&&(c[0]="");if((t=t.split("."))[0]=c[0],l=u[1]&&u[u.length-1].length){for(m="",y=(h=t[0]).length%l,d=h.length,v=0;v<d;v++)m+=h.charAt(v),!((v-y+1)%l)&&v<d-l&&(m+=o);t[0]=m}return t[1]=e[1]&&t[1]?r+t[1]:"","0"!==(i=t.join(""))&&""!==i||(n=!1),p+(n?"-":"")+i+b}}));function Qn(e){return e.replace(/[-[\]/{}()*+?.\\^$|]/g,"\\$&")}const ei={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"},ti=/%\)?$/,ni=/^\(r(0[2-9]|[12]\d|3[0-6])\)/i,ii=/^\(oct\)/i,ri=/^\(dec\)/i,oi=/^\(hex\)/i,ai=/^\(bin\)/i,si=/^\(rom\)/i,li=/^(\(rom\)|\(bin\)|\(hex\)|\(dec\)|\(oct\)|\(r(0[2-9]|[12]\d|3[0-6])\))/i,ci=/#|0/g;function ui(e,t,n,i){return e=e.toString(t),n[1]===n[1].toUpperCase()&&(e=e.toUpperCase()),e.length-e.indexOf(".")>10&&(e=e.slice(0,e.indexOf(".")+11)),e.replace(".",i||".")}function hi(e,t,n){let i;return ni.test(t)?e=ui(e,Number(/\d{2}/.exec(t)[0]),t,n):ii.test(t)?e=ui(e,8,t,n):ri.test(t)?e=ui(e,10,t,n):oi.test(t)?e=ui(e,16,t,n):ai.test(t)?e=ui(e,2,t,n):si.test(t)&&(i="",e<0&&(i="-",e=-e),0===(e=Math.floor(e))?e="0":e<=5e5?(e=function(e,t){let n,i="",r=Number(String(e).slice(-3)),o=(e-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 t[1]!==t[1].toUpperCase()&&(i=i.toLowerCase()),i}(e,t),e=i+e):e=t+i+e.toExponential(0)),e}function di(e,t,n){const i=Qn(e);return n?i:new RegExp(i||"",t)}function fi(e,t,n,i){let r,o,a,s,l,c,u,h,d,f=e.pattern;var p,m;i&&(e.abbreviate=!0),p=t,(m=n)&&(m=Qn(m)),p&&(p=Qn(p)),d=new RegExp("(?:[#0]+".concat(p,")?[#0]+(?:").concat(m,"[#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?"#":"##########"),t&&t===n&&(r=a.split(n),o=r.pop(),a=r.join("")+n+o,t=""),c=t,t=/,/.test(n)?"¤":",",c&&(a=a.replace(di(c,"g"),t)),u=n,n=".",u&&(a=a.replace(di(u,"g"),n)),h=a.match(/#/g),h=h?h.length:0;const g=f.split(u);let y;g[1]&&(y=g[1].match(ci)),e.prefix=s||"",e.postfix=l||"",e.pattern=f,e.maxPrecision=y?y.length:2,e.percentage=ti.test(f),e.numericPattern=a||"",e.numericRegex=new RegExp("".concat(di(t,null,!0),"|").concat(di(n,null,!0)),"g"),e.groupTemp=c,e.decTemp=u,e.t=t,e.d=n,e.temp=h}class pi{constructor(e,t,n,i,r){this.localeInfo=e,this.pattern=t,this.thousandDelimiter=n||",",this.decimalDelimiter=i||".",this.type=r||"numeric",this.patternSeparator=";",this.abbreviations=function(e,t){if(!e||!e.qNumericalAbbreviation)return ei;const n={};return e.qNumericalAbbreviation.split(t).forEach((e=>{let t=e.split(":");2===t.length&&(n[t[0]]=t[1])})),n}(e,this.patternSeparator),this.prepare()}clone(){const e=new pi(this.localeInfo,this.pattern,this.thousandDelimiter,this.decimalDelimiter,this.type);return e.subtype=this.subtype,e}format(e,t,n,i){return this.prepare(t,n,i),this.formatValue(e)}prepare(e,t,n){let i;if(void 0===e&&(e=this.pattern),void 0===t&&(t=this.thousandDelimiter),void 0===n&&(n=this.decimalDelimiter),!e)return void(this._prepared={pattern:!1});this._prepared={positive:{d:n,t:t,abbreviate:!1,isFunctional:!1,prefix:"",postfix:""},negative:{d:n,t:t,abbreviate:!1,isFunctional:!1,prefix:"",postfix:""},zero:{d:n,t:t,abbreviate:!1,isFunctional:!1,prefix:"",postfix:""}},i=this._prepared,e=e.split(this.patternSeparator),i.positive.pattern=e[0],i.negative.pattern=e[1],i.zero.pattern=e[2],li.test(e[0])&&(i.positive.isFunctional=!0),e[1]?li.test(e[1])&&(i.negative.isFunctional=!0):i.negative=!1,e[2]?li.test(e[2])&&(i.zero.isFunctional=!0):i.zero=!1;const r="U"===this.type;i.positive.isFunctional||fi(i.positive,t,n,r),i.negative&&!i.negative.isFunctional&&fi(i.negative,t,n,r),i.zero&&!i.zero.isFunctional&&fi(i.zero,t,n,r)}formatValue(e){let t,n,i,r,o,a,s,l,c,u=this._prepared,h="",d="",f=e;if(isNaN(e))return"".concat(f);if(e=+e,!1===u.pattern)return e.toString();if(0===e&&u.zero)return u=u.zero,u.pattern;if(e<0&&u.negative?(u=u.negative,e=-e):u=u.positive,o=u.d,a=u.t,u.isFunctional)e=hi(e,u.pattern,o);else{if(u.percentage&&(e*=100),u.abbreviate){const t=Object.keys(this.abbreviations).map((e=>parseInt(e,10))).sort(((e,t)=>e-t));let i,r,o=t[0];for(s=0,n=Number(Number(e).toExponential().split("e")[1]);o<=n&&s<t.length;)s++,o=t[s];s>0&&(i=t[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],e/=10**r)}if(i=Math.abs(e),t=u.temp,l=u.numericPattern,c=l.split(o)[1],"I"===this.type&&(e=Math.round(e)),r=e,c||"#"!==l.slice(-1)[0])if(i>=1e15||i>0&&i<=1e-14)e=i?i.toExponential(15).replace(/\.?0+(?=e)/,""):"0";else{const t=Number((e+1e-15*(e<0?-1:1)).toFixed(Math.min(20,c?c.length:0)).split(".")[0]);let n=l.split(o)[0];if(n+=o,e=Jn(n,t)||"0",c){const t=Math.max(0,Math.min(14,c.length)),n=c.replace(/#+$/,"").length;let r=("I"===this.type?0:i%1+1e-15).toFixed(t).slice(2).replace(/0+$/,"");for(s=r.length;s<n;s++)r+="0";r&&(e+=o+r)}else 0===t&&(r=0)}else if(i>=10**t||i<1||i<1e-4)0===e?e="0":i<1e-4||i>=1e20?(e=(e=r.toExponential(Math.max(1,Math.min(14,t))-1)).replace(/\.?0+(?=e)/,""),d=""):(e=e.toPrecision(Math.max(1,Math.min(14,t)))).indexOf(".")>=0&&(e=(e=e.replace(e.indexOf("e")<0?/0+$/:/\.?0+(?=e)/,"")).replace(".",o));else{for(l+=o,t=Math.max(0,Math.min(20,t-Math.ceil(Math.log(i)/Math.log(10)))),s=0;s<t;s++)l+="#";e=Jn(l,e)}e=e.replace(u.numericRegex,(e=>e===a?u.groupTemp:e===o?u.decTemp:"")),r<0&&!/^-/.test(e)&&(e="-".concat(e))}return u.prefix+e+d+h+u.postfix}static getStaticFormatter(){return{prepare(){},formatValue:e=>"".concat(e)}}}function mi(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const{size:n=5e3,multipleArguments:i=!1,toKey:r=e=>e}=t;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,e(...arguments))}:t=>(a=r(t),o.has(a)?o.get(a):o.set(a,e(t))),o.set=(e,t)=>(c>=n&&(delete s[l[u]],delete l[u],c--,u++),s[e]=t,l[c]=e,c++,t),o.get=e=>s[e],o.has=e=>e in s,o.clear=()=>{s=Object.create(null),l=Object.create(null),c=0,u=0},o.size=()=>c,o}function gi(e,t,n,i,r){const o=function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return new pi(...t)}(r,e,t,n,i),a=mi(o.formatValue.bind(o),{toKey:e=>isNaN(e)?e:+e});function s(e){return a(e)}return s.format=function(e,t,n,i){return a.clear(),o.format(t,e,n,i)},s.pattern=function(e){return e&&(a.clear(),o.pattern=e,o.prepare()),o.pattern},s}const yi="D",xi="T",vi="TS",bi="IV",wi=["Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"],Mi=["Mon","Tue","Wed","Thu","Fri","Sat","Sun"],ki=["January","February","March","April","May","June","July","August","September","October","November","December"],Si=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function _i(e,t){for(let n=e.length;n<t;n++)e="0".concat(e);return e}function qi(e){let t=e.toString().split(".");return t[1]?(t=Number("0.".concat(t[1])),t):0}function Di(e,t){let n,i=function(e){const t=e,n=24*qi(t),i=60*qi(n),r=60*qi(i),o=1e3*qi(r);return{d:Math.floor(t),h:Math.floor(n),m:Math.floor(i),s:Math.floor(r),f:Math.round(o)}}(e),r=i.d,o=i.h,a=i.m,s=i.s,l=i.f,c=0;/w+|t+/gi.test(t)&&(n=new Date(Date.UTC(1899,11,30+Math.floor(e),0,0,Math.round(86400*(e-Math.floor(e))))),isNaN(n.getTime())&&(n=null)),/D+/gi.test(t)||(o+=24*r),/h+/gi.test(t)||(a+=60*o),/m+/gi.test(t)||(s+=60*a),/w+/gi.test(t)&&(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 Ai{constructor(e,t,n){const i=e||{};if(i.qCalendarStrings||(i.qCalendarStrings={qLongDayNames:wi,qDayNames:Mi,qLongMonthNames:ki,qMonthNames:Si}),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(),!t){t={[xi]:i.qTimeFmt||"hh:mm:ss",[yi]:i.qDateFmt||"YYYY-MM-DD",[vi]:i.qTimestampFmt||"YYYY-MM-DD hh:mm:ss"}[n]}this.pattern=t}clone(){const e=new Ai(this.localeInfo,this.pattern);return e.subtype=this.subtype,e}format(e,t){t||(t=this.pattern?this.pattern:"YYYY-MM-DD hh:mm:ss"),t=t.replace(/\[.+]|\[|]/g,"");const n=/t+/gi.test(t);let i;e instanceof Date?i=function(e,t){let n=e.getUTCHours(),i=e.getUTCDay()-1;return t&&(n%=12,n||(n=12)),i<0&&(i=6),{year:e.getUTCFullYear(),month:e.getUTCMonth(),day:i,date:e.getUTCDate(),h:n,m:e.getUTCMinutes(),s:e.getUTCSeconds(),f:e.getUTCMilliseconds(),t:e.getUTCHours()>=12?"pm":"am"}}(e,n):(e<0&&(e=-e,t="-".concat(t)),i=Di(e,t));const r=(o=this,a=i,{"Y+|y+":{Y:"".concat(Number("".concat(a.year).slice(-2))),YY:_i("".concat(a.year).slice(-2),2),YYY:_i("".concat(a.year).slice(-3),3),def:e=>_i("".concat(a.year),e.length)},"M+":{M:a.month+1,MM:_i("".concat(a.month+1),2),MMM:o.locale_months_abbr[a.month],def:o.locale_months[a.month]},"W+|w+":{W:a.day,WW:_i("".concat(a.day),2),WWW:o.locale_days_abbr[a.day],def:o.locale_days[a.day]},"D+|d+":{D:a.date,def:e=>_i("".concat(a.date),e.length)},"h+|H+":{h:a.h,def:e=>_i("".concat(a.h),e.length)},"m+":{m:a.m,def:e=>_i("".concat(a.m),e.length)},"s+|S+":{s:a.s,def:e=>_i("".concat(a.s),e.length)},"f+|F+":{def(e){let t="".concat(a.f),n=e.length-t.length;if(n>0)for(let e=0;e<n;e++)t+="0";else n<0&&(t=t.slice(0,e.length));return t}},"t{1,2}|T{1,2}":{def(e){let t=a.t;return e[0].toUpperCase()===e[0]&&(t=t.toUpperCase()),t=t.slice(0,e.length),t}}});var o,a;const s=[];for(const e in r)Object.prototype.hasOwnProperty.call(r,e)&&s.push(e);const l=new RegExp(s.join("|"),"g"),c=t.replace(l,(e=>{let t,n,i;for(n in r)if(Object.prototype.hasOwnProperty.call(r,n)&&(t=new RegExp(n),t.test(e)))break;if(!t)return"";for(const t in r[n])if(t===e||t.toLowerCase()===e){i=r[n][t],void 0===i&&(i=r[n][t.toLowerCase()]);break}return void 0===i&&(i=r[n].def),"function"==typeof i&&(i=i(e)),i}));return c}}function Ci(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return new Ai(...t)}function Ni(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"TS",n=Ci(arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,e,t),i=mi(n.format.bind(n),{toKey:e=>"object"==typeof e&&"function"==typeof e.getTime?e.getTime():e});function r(e){return t!==bi?function(e){return new Date(Date.UTC(1899,11,30+Math.floor(e),0,0,0,Math.round(864e5*(e-Math.floor(e)))))}(e):e}function o(e){return e=r(e),i(e)}return o.format=function(e,t){return i.clear(),t=r(t),n.format(t,e)},o.locale=function(r){return n=Ci(r,e,t),i=mi(n.format.bind(n),{toKey:e=>"object"==typeof e?e.getTime():e}),this},o.qtype=function(e){return void 0!==e&&(t=e,i.clear()),t},o}function Ei(){let e,{meta:t,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?e=>null==e?void 0:e.qElemNo:e=>null==e?void 0:e.qValue),u="dimension"===s?"first":"avg",h=function(e,t){if(e&&e.qNumFormat&&-1!==["D","T","TS","IV"].indexOf(e.qNumFormat.qType))return Ni(e.qNumFormat.qFmt,e.qNumFormat.qType,t);let n="#",i=t&&void 0!==t.qThousandSep?t.qThousandSep:",",r=t&&void 0!==t.qDecimalSep?t.qDecimalSep:".",o="U",a=e&&!!e.qIsAutoFormat;return e&&e.qNumFormat?(n=e.qNumFormat.qFmt||n,i=e.qNumFormat.qThou||i,r=e.qNumFormat.qDec||r,o=e.qNumFormat.qType||o,a=a&&-1===["M"].indexOf(e.qNumFormat.qType)):a=!0,(a||"U"===o)&&(n="#".concat(r,"##"),o="U"),gi(n,i,r,o,t)}(t,r),d="dimension"===s?"first":(e,t)=>h(t),f={id:()=>n,key:()=>i,raw:()=>t,title:()=>t.qFallbackTitle||t.label,type:()=>s,origin:()=>l,items:()=>(e||(e=o(f)),e),min:()=>t.qMin,max:()=>t.qMax,value:c,label:e=>(null==e?void 0:e.qText)||"",reduce:u,reduceLabel:d,formatter:()=>h,tags:()=>t.qTags};return f}function Ri(e,t,n,i,r){return(t[e]||[]).map(((t,o)=>{const a="".concat(i?"".concat(i,"/"):"").concat(e,"/").concat(o),s={instance:Ei(mn({id:"".concat(n?"".concat(n,"/"):"").concat(a),key:a,meta:t},r))};return s.attrDims=Ri("qAttrDimInfo",t,n,a,mn({},r,{value:e=>null==e?void 0:e.qElemNo,type:"dimension"})),s.attrExps=Ri("qAttrExprInfo",t,n,a,mn({},r,{value:e=>null==e?void 0:e.qNum,type:"measure"})),s.measures=Ri("qMeasureInfo",t,n,a,mn({},r,{value:e=>null==e?void 0:e.qValue,type:"measure"})),s}))}function Ii(){let{key:e,data:t,config:n={}}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const i={fields:[],wrappedFields:[],allFields:[],virtualFields:[]},r=t;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=Ii.util,a={cache:i,cube:r,localeInfo:n.localeInfo,fieldExtractor:null,pages:null,hierarchy:()=>null,virtualFields:n.virtualFields},s={key:()=>e,raw:()=>r,field:e=>function(e,t){let{cache:n}=t;if("number"==typeof e)return n.fields[e];const i=n.allFields;if("function"==typeof e){for(let t=0;t<i.length;t++)if(e(i[t]))return i[t];return!1}if("string"==typeof e){for(let t=0;t<i.length;t++)if(i[t].key()===e||i[t].title()===e)return i[t]}else if(e&&-1!==i.indexOf(e))return e;throw Error("Field not found: ".concat(e))}(e,a),fields:()=>i.fields.slice(),extract:e=>a.extractor(e,s,i,o),hierarchy:e=>a.hierarchy(e,s,i,o),_cache:()=>i};"K"===r.qMode||"T"===r.qMode||!r.qMode&&r.qNodesOnDim?(a.extractor=Zn,a.hierarchy=Kn,a.pages="K"===r.qMode?r.qStackedDataPages:r.qTreeDataPages):"S"===r.qMode?(a.extractor=vn,a.pages=r.qDataPages,a.hierarchy=Kn):a.extractor=()=>[],a.fieldExtractor=e=>a.extractor({field:e},s,i,o);const l="S"===r.qMode?e=>e.qElemNumber:void 0,c="S"===r.qMode?e=>e.qNum:void 0;i.wrappedFields.push(...Ri("qDimensionInfo",r,e,"",mn({},a,{value:l,type:"dimension"}))),i.wrappedFields.push(...Ri("qMeasureInfo",r,e,"",mn({},a,{value:c,type:"measure"}))),i.fields=i.wrappedFields.map((e=>e.instance));const u=e=>{e.forEach((e=>{i.allFields.push(e.instance),u(e.measures),u(e.attrDims),u(e.attrExps)}))};return u(i.wrappedFields),(n.virtualFields||[]).forEach((t=>{const n=s.field(t.from),r=Ei(an({meta:n.raw(),id:"".concat(e,"/").concat(t.key),sourceField:n,fieldExtractor:e=>a.extractor({field:e},s,i,o),key:t.key,type:n.type(),localeInfo:a.localeInfo,value:n.value},t.override||{}));i.virtualFields.push(r)})),i.allFields.push(...i.virtualFields),s}const Oi=[["qHyperCube","qHyperCubeDef"],["qTreeData","qTreeDataDef"],["qDimensionInfo","qDimensions"],["qMeasureInfo","qMeasures"],["qAttrDimInfo","qAttributeDimensions"],["qAttrExprInfo","qAttributeExpressions"]],Pi=/\/qDimensionInfo(?:\/(\d+))?/,Li=/\/qMeasureInfo\/(\d+)/,Ti=/\/qAttrDimInfo\/(\d+)(?:\/(\d+))?/,zi=/\/qAttrExprInfo\/(\d+)/,Fi=/\/?qHyperCube/,ji=/\/?qTreeData/,Vi=e=>"".concat(e.substr(0,e.indexOf("/qHyperCubeDef")+14)),Bi=e=>"".concat(e.substr(0,e.indexOf("/qTreeDataDef")+13));function Hi(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2?arguments[2]:void 0;const i=t.byCells,r=t.primarySource,o=[],a={},s=e.isActive();let l=!1;if(e.brushes().forEach((e=>{const t=function(e,t){let n=e,i=-1,r=-1,o="",a=e=>e;Fi.test(e)?(o="".concat(n.substr(0,n.indexOf("qHyperCube")+10)),a=Vi):ji.test(e)&&(o="".concat(n.substr(0,n.indexOf("qTreeData")+9)),a=Bi);let s=!0;if(Pi.test(e)&&(i=+Pi.exec(e)[1]),Li.test(e)&&(r=+Li.exec(e)[1]),Ti.test(e)){r=-1,i=0;const e=+Ti.exec(n)[2];isNaN(e)||(i=e,n=n.replace(/\/\d+$/,"")),s=!1}if(zi.test(e)){const e=r;if(t){r=0;const a=Ln(o,t);r+=(a.qMeasureInfo||[]).length,i>-1?(r=a.qDimensionInfo.slice(0,i).reduce(((e,t)=>e+t.qAttrExprInfo.length),r),i=-1):(r=a.qDimensionInfo.reduce(((e,t)=>e+t.qAttrExprInfo.length),r),r=a.qMeasureInfo.slice(0,e).reduce(((e,t)=>e+t.qAttrExprInfo.length),r)),r+=+zi.exec(n)[1]}else i>-1?(i=-1,r=+zi.exec(n)[1]):r+=+zi.exec(n)[1]+1}return Oi.forEach((e=>{let[t,i]=e;n=n.replace(t,i)})),s&&(n=a(n)),n&&"/"!==n[0]&&(n="/".concat(n)),{measureIdx:r,dimensionIdx:i,path:n}}(e.id,n);if("range"===e.type&&t.measureIdx>-1&&t.dimensionIdx>-1){const n=e.brush.ranges();n.length&&(l=!0,a.multiRangeSelectTreeDataValues||(a.multiRangeSelectTreeDataValues={path:t.path,ranges:[]}),n.forEach((e=>a.multiRangeSelectTreeDataValues.ranges.push({qMeasureIx:t.measureIdx,qDimensionIx:t.dimensionIdx,qRange:{qMin:e.min,qMax:e.max,qMinInclEq:!0,qMaxInclEq:!0}}))))}else{if("range"===e.type&&t.measureIdx>-1){const n=e.brush.ranges();n.length&&(l=!0,a.rangeSelectHyperCubeValues||(a.rangeSelectHyperCubeValues={path:t.path,ranges:[]}),n.forEach((e=>a.rangeSelectHyperCubeValues.ranges.push({qMeasureIx:t.measureIdx,qRange:{qMin:e.min,qMax:e.max,qMinInclEq:!0,qMaxInclEq:!0}}))))}if("range"===e.type&&t.dimensionIdx>-1){const n=e.brush.ranges();n.length&&(l=!0,a.selectHyperCubeContinuousRange||(a.selectHyperCubeContinuousRange={path:t.path,ranges:[]}),n.forEach((e=>a.selectHyperCubeContinuousRange.ranges.push({qDimIx:t.dimensionIdx,qRange:{qMin:e.min,qMax:e.max,qMinInclEq:!0,qMaxInclEq:!1}}))))}if("value"===e.type&&t.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(t.dimensionIdx);if(a.selectPivotCells||(a.selectPivotCells={path:t.path,cells:[]}),e.id===r||!r){const n=e.brush.values().map((e=>+e)).filter((e=>!isNaN(e)));(0===o||s>=o)&&o>-1?n.forEach((e=>{a.selectPivotCells.cells.push({qType:"T",qCol:e,qRow:s-o})})):n.forEach((e=>{a.selectPivotCells.cells.push({qType:"L",qCol:t.dimensionIdx,qRow:e})})),l=!!a.selectPivotCells.cells.length}}else a.selectHyperCubeCells||(a.selectHyperCubeCells={path:t.path,cols:[]}),a.selectHyperCubeCells.cols.push(t.dimensionIdx),e.id!==r&&(r||a.selectHyperCubeCells.values)||(a.selectHyperCubeCells.values=e.brush.values().map((e=>+e)).filter((e=>!isNaN(e))),l=!!a.selectHyperCubeCells.values.length);else{const n=e.brush.values().map((e=>+e)).filter((e=>!isNaN(e)));l=!!n.length,o.push({params:[t.path,t.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=t.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 $i(e){Ii.util=e.data("matrix").util,e.data("q",Ii),e.formatter("q-number",gi),e.formatter("q-time",Ni)}$i.qBrushHelper=Hi,$i.selections=Hi;var Wi=Object.prototype.hasOwnProperty,Ui=Object.prototype.toString,Yi=Object.defineProperty,Gi=Object.getOwnPropertyDescriptor,Xi=function(e){return"function"==typeof Array.isArray?Array.isArray(e):"[object Array]"===Ui.call(e)},Ki=function(e){if(!e||"[object Object]"!==Ui.call(e))return!1;var t,n=Wi.call(e,"constructor"),i=e.constructor&&e.constructor.prototype&&Wi.call(e.constructor.prototype,"isPrototypeOf");if(e.constructor&&!n&&!i)return!1;for(t in e);return void 0===t||Wi.call(e,t)},Zi=function(e,t){Yi&&"__proto__"===t.name?Yi(e,t.name,{enumerable:!0,configurable:!0,value:t.newValue,writable:!0}):e[t.name]=t.newValue},Ji=function(e,t){if("__proto__"===t){if(!Wi.call(e,t))return;if(Gi)return Gi(e,t).value}return e[t]},Qi=function e(){var t,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!=(t=arguments[l]))for(n in t)i=Ji(s,n),s!==(r=Ji(t,n))&&(u&&r&&(Ki(r)||(o=Xi(r)))?(o?(o=!1,a=i&&Xi(i)?i:[]):a=i&&Ki(i)?i:{},Zi(s,{name:n,newValue:e(u,a,r)})):void 0!==r&&Zi(s,{name:n,newValue:r}));return s},er="2.8.1";function tr(e,t,n){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var i=n.call(e,t||"default");if("object"!=typeof i)return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function nr(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,i)}return n}function ir(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?nr(Object(n),!0).forEach((function(t){tr(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):nr(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function rr(e){return!!e.changedTouches}function or(e){return"number"==typeof e&&!isNaN(e)}function ar(e){return"number"!=typeof e||isNaN(e)}function sr(e){const t=e.length;let n=NaN,i=NaN,r=NaN,o=NaN;for(let a=0;a<t;a++)n=isNaN(n)?e[a].x:Math.min(n,e[a].x),i=isNaN(i)?e[a].x:Math.max(i,e[a].x),r=isNaN(r)?e[a].y:Math.min(r,e[a].y),o=isNaN(o)?e[a].y:Math.max(o,e[a].y);return[n,r,i,o]}function lr(e){return[{x:e.x1||0,y:e.y1||0},{x:e.x2||0,y:e.y2||0}]}function cr(e){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}]}function ur(e){const[t,n,i,r]=sr(e);return{x:t,y:n,width:i-t,height:r-n}}function hr(e){return{x1:e[0].x,y1:e[0].y,x2:e[1].x,y2:e[1].y}}function dr(e){const{x:t,y:n,width:i,height:r,x1:o,x2:a,y1:s,y2:l,cx:c,cy:u,r:h,vertices:d}=e||{};return or(c)&&or(u)&&or(h)?"circle":or(o)&&or(a)&&or(s)&&or(l)?"line":or(t)&&or(n)&&or(i)&&or(r)?"rect":or(t)&&or(n)?"point":Array.isArray(d)?d.every((e=>Array.isArray(e)))?"geopolygon":"polygon":null}function fr(e,t){return{x:t.x-e,y:t.y-e,width:t.width+e,height:t.height+e}}var pr=Math.PI,mr=2*pr,gr=1e-6,yr=mr-gr;function xr(){this._x0=this._y0=this._x1=this._y1=null,this._=""}function vr(){return new xr}function br(e){return function(){return e}}xr.prototype=vr.prototype={constructor:xr,moveTo:function(e,t){this._+="M"+(this._x0=this._x1=+e)+","+(this._y0=this._y1=+t)},closePath:function(){null!==this._x1&&(this._x1=this._x0,this._y1=this._y0,this._+="Z")},lineTo:function(e,t){this._+="L"+(this._x1=+e)+","+(this._y1=+t)},quadraticCurveTo:function(e,t,n,i){this._+="Q"+ +e+","+ +t+","+(this._x1=+n)+","+(this._y1=+i)},bezierCurveTo:function(e,t,n,i,r,o){this._+="C"+ +e+","+ +t+","+ +n+","+ +i+","+(this._x1=+r)+","+(this._y1=+o)},arcTo:function(e,t,n,i,r){e=+e,t=+t,n=+n,i=+i,r=+r;var o=this._x1,a=this._y1,s=n-e,l=i-t,c=o-e,u=a-t,h=c*c+u*u;if(r<0)throw new Error("negative radius: "+r);if(null===this._x1)this._+="M"+(this._x1=e)+","+(this._y1=t);else if(h>gr)if(Math.abs(u*s-l*c)>gr&&r){var d=n-o,f=i-a,p=s*s+l*l,m=d*d+f*f,g=Math.sqrt(p),y=Math.sqrt(h),x=r*Math.tan((pr-Math.acos((p+h-m)/(2*g*y)))/2),v=x/y,b=x/g;Math.abs(v-1)>gr&&(this._+="L"+(e+v*c)+","+(t+v*u)),this._+="A"+r+","+r+",0,0,"+ +(u*d>c*f)+","+(this._x1=e+b*s)+","+(this._y1=t+b*l)}else this._+="L"+(this._x1=e)+","+(this._y1=t);else;},arc:function(e,t,n,i,r,o){e=+e,t=+t,o=!!o;var a=(n=+n)*Math.cos(i),s=n*Math.sin(i),l=e+a,c=t+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)>gr||Math.abs(this._y1-c)>gr)&&(this._+="L"+l+","+c),n&&(h<0&&(h=h%mr+mr),h>yr?this._+="A"+n+","+n+",0,1,"+u+","+(e-a)+","+(t-s)+"A"+n+","+n+",0,1,"+u+","+(this._x1=l)+","+(this._y1=c):h>gr&&(this._+="A"+n+","+n+",0,"+ +(h>=pr)+","+u+","+(this._x1=e+n*Math.cos(r))+","+(this._y1=t+n*Math.sin(r))))},rect:function(e,t,n,i){this._+="M"+(this._x0=this._x1=+e)+","+(this._y0=this._y1=+t)+"h"+ +n+"v"+ +i+"h"+-n+"Z"},toString:function(){return this._}};var wr=Math.abs,Mr=Math.atan2,kr=Math.cos,Sr=Math.max,_r=Math.min,qr=Math.sin,Dr=Math.sqrt,Ar=1e-12,Cr=Math.PI,Nr=Cr/2,Er=2*Cr;function Rr(e){return e>=1?Nr:e<=-1?-Nr:Math.asin(e)}function Ir(e){return e.innerRadius}function Or(e){return e.outerRadius}function Pr(e){return e.startAngle}function Lr(e){return e.endAngle}function Tr(e){return e&&e.padAngle}function zr(e,t,n,i,r,o,a){var s=e-n,l=t-i,c=(a?o:-o)/Dr(s*s+l*l),u=c*l,h=-c*s,d=e+u,f=t+h,p=n+u,m=i+h,g=(d+p)/2,y=(f+m)/2,x=p-d,v=m-f,b=x*x+v*v,w=r-o,M=d*m-p*f,k=(v<0?-1:1)*Dr(Sr(0,w*w*b-M*M)),S=(M*v-x*k)/b,_=(-M*x-v*k)/b,q=(M*v+x*k)/b,D=(-M*x+v*k)/b,A=S-g,C=_-y,N=q-g,E=D-y;return A*A+C*C>N*N+E*E&&(S=q,_=D),{cx:S,cy:_,x01:-u,y01:-h,x11:S*(r/w-1),y11:_*(r/w-1)}}function Fr(){var e=Ir,t=Or,n=br(0),i=null,r=Pr,o=Lr,a=Tr,s=null;function l(){var l,c,u=+e.apply(this,arguments),h=+t.apply(this,arguments),d=r.apply(this,arguments)-Nr,f=o.apply(this,arguments)-Nr,p=wr(f-d),m=f>d;if(s||(s=l=vr()),h<u&&(c=h,h=u,u=c),h>Ar)if(p>Er-Ar)s.moveTo(h*kr(d),h*qr(d)),s.arc(0,0,h,d,f,!m),u>Ar&&(s.moveTo(u*kr(f),u*qr(f)),s.arc(0,0,u,f,d,m));else{var g,y,x=d,v=f,b=d,w=f,M=p,k=p,S=a.apply(this,arguments)/2,_=S>Ar&&(i?+i.apply(this,arguments):Dr(u*u+h*h)),q=_r(wr(h-u)/2,+n.apply(this,arguments)),D=q,A=q;if(_>Ar){var C=Rr(_/u*qr(S)),N=Rr(_/h*qr(S));(M-=2*C)>Ar?(b+=C*=m?1:-1,w-=C):(M=0,b=w=(d+f)/2),(k-=2*N)>Ar?(x+=N*=m?1:-1,v-=N):(k=0,x=v=(d+f)/2)}var E=h*kr(x),R=h*qr(x),I=u*kr(w),O=u*qr(w);if(q>Ar){var P,L=h*kr(v),T=h*qr(v),z=u*kr(b),F=u*qr(b);if(p<Cr&&(P=function(e,t,n,i,r,o,a,s){var l=n-e,c=i-t,u=a-r,h=s-o,d=h*l-u*c;if(!(d*d<Ar))return[e+(d=(u*(t-o)-h*(e-r))/d)*l,t+d*c]}(E,R,z,F,L,T,I,O))){var j=E-P[0],V=R-P[1],B=L-P[0],H=T-P[1],$=1/qr(function(e){return e>1?0:e<-1?Cr:Math.acos(e)}((j*B+V*H)/(Dr(j*j+V*V)*Dr(B*B+H*H)))/2),W=Dr(P[0]*P[0]+P[1]*P[1]);D=_r(q,(u-W)/($-1)),A=_r(q,(h-W)/($+1))}}k>Ar?A>Ar?(g=zr(z,F,E,R,h,A,m),y=zr(L,T,I,O,h,A,m),s.moveTo(g.cx+g.x01,g.cy+g.y01),A<q?s.arc(g.cx,g.cy,A,Mr(g.y01,g.x01),Mr(y.y01,y.x01),!m):(s.arc(g.cx,g.cy,A,Mr(g.y01,g.x01),Mr(g.y11,g.x11),!m),s.arc(0,0,h,Mr(g.cy+g.y11,g.cx+g.x11),Mr(y.cy+y.y11,y.cx+y.x11),!m),s.arc(y.cx,y.cy,A,Mr(y.y11,y.x11),Mr(y.y01,y.x01),!m))):(s.moveTo(E,R),s.arc(0,0,h,x,v,!m)):s.moveTo(E,R),u>Ar&&M>Ar?D>Ar?(g=zr(I,O,L,T,u,-D,m),y=zr(E,R,z,F,u,-D,m),s.lineTo(g.cx+g.x01,g.cy+g.y01),D<q?s.arc(g.cx,g.cy,D,Mr(g.y01,g.x01),Mr(y.y01,y.x01),!m):(s.arc(g.cx,g.cy,D,Mr(g.y01,g.x01),Mr(g.y11,g.x11),!m),s.arc(0,0,u,Mr(g.cy+g.y11,g.cx+g.x11),Mr(y.cy+y.y11,y.cx+y.x11),m),s.arc(y.cx,y.cy,D,Mr(y.y11,y.x11),Mr(y.y01,y.x01),!m))):s.arc(0,0,u,w,b,m):s.lineTo(I,O)}else s.moveTo(0,0);if(s.closePath(),l)return s=null,l+""||null}return l.centroid=function(){var n=(+e.apply(this,arguments)+ +t.apply(this,arguments))/2,i=(+r.apply(this,arguments)+ +o.apply(this,arguments))/2-Cr/2;return[kr(i)*n,qr(i)*n]},l.innerRadius=function(t){return arguments.length?(e="function"==typeof t?t:br(+t),l):e},l.outerRadius=function(e){return arguments.length?(t="function"==typeof e?e:br(+e),l):t},l.cornerRadius=function(e){return arguments.length?(n="function"==typeof e?e:br(+e),l):n},l.padRadius=function(e){return arguments.length?(i=null==e?null:"function"==typeof e?e:br(+e),l):i},l.startAngle=function(e){return arguments.length?(r="function"==typeof e?e:br(+e),l):r},l.endAngle=function(e){return arguments.length?(o="function"==typeof e?e:br(+e),l):o},l.padAngle=function(e){return arguments.length?(a="function"==typeof e?e:br(+e),l):a},l.context=function(e){return arguments.length?(s=null==e?null:e,l):s},l}function jr(e){this._context=e}function Vr(e){return new jr(e)}function Br(e){return e[0]}function Hr(e){return e[1]}function $r(){var e=Br,t=null,n=br(0),i=Hr,r=br(!0),o=null,a=Vr,s=null;function l(l){var c,u,h,d,f,p=l.length,m=!1,g=new Array(p),y=new Array(p);for(null==o&&(s=a(f=vr())),c=0;c<=p;++c){if(!(c<p&&r(d=l[c],c,l))===m)if(m=!m)u=c,s.areaStart(),s.lineStart();else{for(s.lineEnd(),s.lineStart(),h=c-1;h>=u;--h)s.point(g[h],y[h]);s.lineEnd(),s.areaEnd()}m&&(g[c]=+e(d,c,l),y[c]=+n(d,c,l),s.point(t?+t(d,c,l):g[c],i?+i(d,c,l):y[c]))}if(f)return s=null,f+""||null}function c(){return function(){var e=Br,t=Hr,n=br(!0),i=null,r=Vr,o=null;function a(a){var s,l,c,u=a.length,h=!1;for(null==i&&(o=r(c=vr())),s=0;s<=u;++s)!(s<u&&n(l=a[s],s,a))===h&&((h=!h)?o.lineStart():o.lineEnd()),h&&o.point(+e(l,s,a),+t(l,s,a));if(c)return o=null,c+""||null}return a.x=function(t){return arguments.length?(e="function"==typeof t?t:br(+t),a):e},a.y=function(e){return arguments.length?(t="function"==typeof e?e:br(+e),a):t},a.defined=function(e){return arguments.length?(n="function"==typeof e?e:br(!!e),a):n},a.curve=function(e){return arguments.length?(r=e,null!=i&&(o=r(i)),a):r},a.context=function(e){return arguments.length?(null==e?i=o=null:o=r(i=e),a):i},a}().defined(r).curve(a).context(o)}return l.x=function(n){return arguments.length?(e="function"==typeof n?n:br(+n),t=null,l):e},l.x0=function(t){return arguments.length?(e="function"==typeof t?t:br(+t),l):e},l.x1=function(e){return arguments.length?(t=null==e?null:"function"==typeof e?e:br(+e),l):t},l.y=function(e){return arguments.length?(n="function"==typeof e?e:br(+e),i=null,l):n},l.y0=function(e){return arguments.length?(n="function"==typeof e?e:br(+e),l):n},l.y1=function(e){return arguments.length?(i=null==e?null:"function"==typeof e?e:br(+e),l):i},l.lineX0=l.lineY0=function(){return c().x(e).y(n)},l.lineY1=function(){return c().x(e).y(i)},l.lineX1=function(){return c().x(t).y(n)},l.defined=function(e){return arguments.length?(r="function"==typeof e?e:br(!!e),l):r},l.curve=function(e){return arguments.length?(a=e,null!=o&&(s=a(o)),l):a},l.context=function(e){return arguments.length?(null==e?o=s=null:s=a(o=e),l):o},l}function Wr(e,t){return t<e?-1:t>e?1:t>=e?0:NaN}function Ur(e){return e}jr.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(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;default:this._context.lineTo(e,t)}}};var Yr=Array.prototype.slice;function Gr(e,t,n){e._context.bezierCurveTo((2*e._x0+e._x1)/3,(2*e._y0+e._y1)/3,(e._x0+2*e._x1)/3,(e._y0+2*e._y1)/3,(e._x0+4*e._x1+t)/6,(e._y0+4*e._y1+n)/6)}function Xr(e){this._context=e}function Kr(e,t,n){e._context.bezierCurveTo(e._x1+e._k*(e._x2-e._x0),e._y1+e._k*(e._y2-e._y0),e._x2+e._k*(e._x1-t),e._y2+e._k*(e._y1-n),e._x2,e._y2)}function Zr(e,t){this._context=e,this._k=(1-t)/6}Xr.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:Gr(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(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);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:Gr(this,e,t)}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}},Zr.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:Kr(this,this._x1,this._y1)}(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2,this._x1=e,this._y1=t;break;case 2:this._point=3;default:Kr(this,e,t)}this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};var Jr=function e(t){function n(e){return new Zr(e,t)}return n.tension=function(t){return e(+t)},n}(0);function Qr(e,t){this._context=e,this._alpha=t}Qr.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(e,t){if(e=+e,t=+t,this._point){var n=this._x2-e,i=this._y2-t;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(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3;default:!function(e,t,n){var i=e._x1,r=e._y1,o=e._x2,a=e._y2;if(e._l01_a>Ar){var s=2*e._l01_2a+3*e._l01_a*e._l12_a+e._l12_2a,l=3*e._l01_a*(e._l01_a+e._l12_a);i=(i*s-e._x0*e._l12_2a+e._x2*e._l01_2a)/l,r=(r*s-e._y0*e._l12_2a+e._y2*e._l01_2a)/l}if(e._l23_a>Ar){var c=2*e._l23_2a+3*e._l23_a*e._l12_a+e._l12_2a,u=3*e._l23_a*(e._l23_a+e._l12_a);o=(o*c+e._x1*e._l23_2a-t*e._l12_2a)/u,a=(a*c+e._y1*e._l23_2a-n*e._l12_2a)/u}e._context.bezierCurveTo(i,r,o,a,e._x2,e._y2)}(this,e,t)}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=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};var eo=function e(t){function n(e){return t?new Qr(e,t):new Zr(e,0)}return n.alpha=function(t){return e(+t)},n}(.5);function to(e){return e<0?-1:1}function no(e,t,n){var i=e._x1-e._x0,r=t-e._x1,o=(e._y1-e._y0)/(i||r<0&&-0),a=(n-e._y1)/(r||i<0&&-0),s=(o*r+a*i)/(i+r);return(to(o)+to(a))*Math.min(Math.abs(o),Math.abs(a),.5*Math.abs(s))||0}function io(e,t){var n=e._x1-e._x0;return n?(3*(e._y1-e._y0)/n-t)/2:t}function ro(e,t,n){var i=e._x0,r=e._y0,o=e._x1,a=e._y1,s=(o-i)/3;e._context.bezierCurveTo(i+s,r+s*t,o-s,a-s*n,o,a)}function oo(e){this._context=e}function ao(e){this._context=new so(e)}function so(e){this._context=e}function lo(e){this._context=e}function co(e){var t,n,i=e.length-1,r=new Array(i),o=new Array(i),a=new Array(i);for(r[0]=0,o[0]=2,a[0]=e[0]+2*e[1],t=1;t<i-1;++t)r[t]=1,o[t]=4,a[t]=4*e[t]+2*e[t+1];for(r[i-1]=2,o[i-1]=7,a[i-1]=8*e[i-1]+e[i],t=1;t<i;++t)n=r[t]/o[t-1],o[t]-=n,a[t]-=n*a[t-1];for(r[i-1]=a[i-1]/o[i-1],t=i-2;t>=0;--t)r[t]=(a[t]-r[t+1])/o[t];for(o[i-1]=(e[i]+r[i-1])/2,t=0;t<i-1;++t)o[t]=2*e[t+1]-r[t+1];return[r,o]}function uo(e,t){this._context=e,this._t=t}function ho(e,t){if((r=e.length)>1)for(var n,i,r,o=1,a=e[t[0]],s=a.length;o<r;++o)for(i=a,a=e[t[o]],n=0;n<s;++n)a[n][1]+=a[n][0]=isNaN(i[n][1])?i[n][0]:i[n][1]}function fo(e){for(var t=e.length,n=new Array(t);--t>=0;)n[t]=t;return n}function po(e,t){return e[t]}function mo(e){for(var t,n=-1,i=0,r=e.length,o=-1/0;++n<r;)(t=+e[n][1])>o&&(o=t,i=n);return i}function go(e){for(var t,n=0,i=-1,r=e.length;++i<r;)(t=+e[i][1])&&(n+=t);return n}function yo(e){let t,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"unspecified",i=arguments.length>2?arguments[2]:void 0;const r={},o=e||{get:()=>{},has:()=>!1,default:()=>{}};function a(e,t){if(!e||"string"!=typeof e)throw new TypeError("Invalid argument: key must be a non-empty string");return!(e in r)&&(r[e]=t,!0)}function s(e){return r[e]||o.get(e)}function l(e,r){if(void 0!==r)return a(e,r);const o=s(e);return i&&void 0===o&&i.warn("".concat(e," does not exist in ").concat(n," registry")),o||s(t)}return t=o.default(),l.add=a,l.get=s,l.has=function(e){return!!r[e]||o.has(e)},l.remove=function(e){const t=r[e];return delete r[e],t},l.getKeys=function(){return Object.keys(r)},l.getValues=function(){return Object.keys(r).map((e=>r[e]))},l.default=function(e){return void 0!==e&&(t=e),t},l.register=a,l}function xo(e,t){if((n=(e=t?e.toExponential(t-1):e.toExponential()).indexOf("e"))<0)return null;var n,i=e.slice(0,n);return[i.length>1?i[0]+i.slice(2):i,+e.slice(n+1)]}function vo(e){return(e=xo(Math.abs(e)))?e[1]:NaN}oo.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:ro(this,this._t0,io(this,this._t0))}(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){var n=NaN;if(t=+t,(e=+e)!==this._x1||t!==this._y1){switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3,ro(this,io(this,n=no(this,e,t)),n);break;default:ro(this,this._t0,n=no(this,e,t))}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t,this._t0=n}}},(ao.prototype=Object.create(oo.prototype)).point=function(e,t){oo.prototype.point.call(this,t,e)},so.prototype={moveTo:function(e,t){this._context.moveTo(t,e)},closePath:function(){this._context.closePath()},lineTo:function(e,t){this._context.lineTo(t,e)},bezierCurveTo:function(e,t,n,i,r,o){this._context.bezierCurveTo(t,e,i,n,o,r)}},lo.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=[],this._y=[]},lineEnd:function(){var e=this._x,t=this._y,n=e.length;if(n)if(this._line?this._context.lineTo(e[0],t[0]):this._context.moveTo(e[0],t[0]),2===n)this._context.lineTo(e[1],t[1]);else for(var i=co(e),r=co(t),o=0,a=1;a<n;++o,++a)this._context.bezierCurveTo(i[0][o],r[0][o],i[1][o],r[1][o],e[a],t[a]);(this._line||0!==this._line&&1===n)&&this._context.closePath(),this._line=1-this._line,this._x=this._y=null},point:function(e,t){this._x.push(+e),this._y.push(+t)}},uo.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(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;default:if(this._t<=0)this._context.lineTo(this._x,t),this._context.lineTo(e,t);else{var n=this._x*(1-this._t)+e*this._t;this._context.lineTo(n,this._y),this._context.lineTo(n,t)}}this._x=e,this._y=t}};var bo,wo=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function Mo(e){if(!(t=wo.exec(e)))throw new Error("invalid format: "+e);var t;return new ko({fill:t[1],align:t[2],sign:t[3],symbol:t[4],zero:t[5],width:t[6],comma:t[7],precision:t[8]&&t[8].slice(1),trim:t[9],type:t[10]})}function ko(e){this.fill=void 0===e.fill?" ":e.fill+"",this.align=void 0===e.align?">":e.align+"",this.sign=void 0===e.sign?"-":e.sign+"",this.symbol=void 0===e.symbol?"":e.symbol+"",this.zero=!!e.zero,this.width=void 0===e.width?void 0:+e.width,this.comma=!!e.comma,this.precision=void 0===e.precision?void 0:+e.precision,this.trim=!!e.trim,this.type=void 0===e.type?"":e.type+""}function So(e,t){var n=xo(e,t);if(!n)return e+"";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")}Mo.prototype=ko.prototype,ko.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 _o={"%":(e,t)=>(100*e).toFixed(t),b:e=>Math.round(e).toString(2),c:e=>e+"",d:function(e){return Math.abs(e=Math.round(e))>=1e21?e.toLocaleString("en").replace(/,/g,""):e.toString(10)},e:(e,t)=>e.toExponential(t),f:(e,t)=>e.toFixed(t),g:(e,t)=>e.toPrecision(t),o:e=>Math.round(e).toString(8),p:(e,t)=>So(100*e,t),r:So,s:function(e,t){var n=xo(e,t);if(!n)return e+"";var i=n[0],r=n[1],o=r-(bo=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")+xo(e,Math.max(0,t+o-1))[0]},X:e=>Math.round(e).toString(16).toUpperCase(),x:e=>Math.round(e).toString(16)};function qo(e){return e}var Do,Ao,Co,No=Array.prototype.map,Eo=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function Ro(e){var t,n,i=void 0===e.grouping||void 0===e.thousands?qo:(t=No.call(e.grouping,Number),n=e.thousands+"",function(e,i){for(var r=e.length,o=[],a=0,s=t[0],l=0;r>0&&s>0&&(l+s+1>i&&(s=Math.max(1,i-l)),o.push(e.substring(r-=s,r+s)),!((l+=s+1)>i));)s=t[a=(a+1)%t.length];return o.reverse().join(n)}),r=void 0===e.currency?"":e.currency[0]+"",o=void 0===e.currency?"":e.currency[1]+"",a=void 0===e.decimal?".":e.decimal+"",s=void 0===e.numerals?qo:function(e){return function(t){return t.replace(/[0-9]/g,(function(t){return e[+t]}))}}(No.call(e.numerals,String)),l=void 0===e.percent?"%":e.percent+"",c=void 0===e.minus?"−":e.minus+"",u=void 0===e.nan?"NaN":e.nan+"";function h(e){var t=(e=Mo(e)).fill,n=e.align,h=e.sign,d=e.symbol,f=e.zero,p=e.width,m=e.comma,g=e.precision,y=e.trim,x=e.type;"n"===x?(m=!0,x="g"):_o[x]||(void 0===g&&(g=12),y=!0,x="g"),(f||"0"===t&&"="===n)&&(f=!0,t="0",n="=");var v="$"===d?r:"#"===d&&/[boxX]/.test(x)?"0"+x.toLowerCase():"",b="$"===d?o:/[%p]/.test(x)?l:"",w=_o[x],M=/[defgprs%]/.test(x);function k(e){var r,o,l,d=v,k=b;if("c"===x)k=w(e)+k,e="";else{var S=(e=+e)<0||1/e<0;if(e=isNaN(e)?u:w(Math.abs(e),g),y&&(e=function(e){e:for(var t,n=e.length,i=1,r=-1;i<n;++i)switch(e[i]){case".":r=t=i;break;case"0":0===r&&(r=i),t=i;break;default:if(!+e[i])break e;r>0&&(r=0)}return r>0?e.slice(0,r)+e.slice(t+1):e}(e)),S&&0==+e&&"+"!==h&&(S=!1),d=(S?"("===h?h:c:"-"===h||"("===h?"":h)+d,k=("s"===x?Eo[8+bo/3]:"")+k+(S&&"("===h?")":""),M)for(r=-1,o=e.length;++r<o;)if(48>(l=e.charCodeAt(r))||l>57){k=(46===l?a+e.slice(r+1):e.slice(r))+k,e=e.slice(0,r);break}}m&&!f&&(e=i(e,1/0));var _=d.length+e.length+k.length,q=_<p?new Array(p-_+1).join(t):"";switch(m&&f&&(e=i(q+e,q.length?p-k.length:1/0),q=""),n){case"<":e=d+e+k+q;break;case"=":e=d+q+e+k;break;case"^":e=q.slice(0,_=q.length>>1)+d+e+k+q.slice(_);break;default:e=q+d+e+k}return s(e)}return g=void 0===g?6:/[gprs]/.test(x)?Math.max(1,Math.min(21,g)):Math.max(0,Math.min(20,g)),k.toString=function(){return e+""},k}return{format:h,formatPrefix:function(e,t){var n=h(((e=Mo(e)).type="f",e)),i=3*Math.max(-8,Math.min(8,Math.floor(vo(t)/3))),r=Math.pow(10,-i),o=Eo[8+i/3];return function(e){return n(r*e)+o}}}}!function(e){Do=Ro(e),Ao=Do.format,Co=Do.formatPrefix}({thousands:",",grouping:[3],currency:["$",""]});const Io=new Date,Oo=new Date;function Po(e,t,n,i){function r(t){return e(t=0===arguments.length?new Date:new Date(+t)),t}return r.floor=t=>(e(t=new Date(+t)),t),r.ceil=n=>(e(n=new Date(n-1)),t(n,1),e(n),n),r.round=e=>{const t=r(e),n=r.ceil(e);return e-t<n-e?t:n},r.offset=(e,n)=>(t(e=new Date(+e),null==n?1:Math.floor(n)),e),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)),t(n,o),e(n)}while(s<n&&n<i);return a},r.filter=n=>Po((t=>{if(t>=t)for(;e(t),!n(t);)t.setTime(t-1)}),((e,i)=>{if(e>=e)if(i<0)for(;++i<=0;)for(;t(e,-1),!n(e););else for(;--i>=0;)for(;t(e,1),!n(e););})),n&&(r.count=(t,i)=>(Io.setTime(+t),Oo.setTime(+i),e(Io),e(Oo),Math.floor(n(Io,Oo))),r.every=e=>(e=Math.floor(e),isFinite(e)&&e>0?e>1?r.filter(i?t=>i(t)%e==0:t=>r.count(0,t)%e==0):r:null)),r}const Lo=6e4,To=864e5,zo=6048e5,Fo=Po((e=>e.setHours(0,0,0,0)),((e,t)=>e.setDate(e.getDate()+t)),((e,t)=>(t-e-(t.getTimezoneOffset()-e.getTimezoneOffset())*Lo)/To),(e=>e.getDate()-1));Fo.range;const jo=Po((e=>{e.setUTCHours(0,0,0,0)}),((e,t)=>{e.setUTCDate(e.getUTCDate()+t)}),((e,t)=>(t-e)/To),(e=>e.getUTCDate()-1));jo.range;const Vo=Po((e=>{e.setUTCHours(0,0,0,0)}),((e,t)=>{e.setUTCDate(e.getUTCDate()+t)}),((e,t)=>(t-e)/To),(e=>Math.floor(e/To)));function Bo(e){return Po((t=>{t.setDate(t.getDate()-(t.getDay()+7-e)%7),t.setHours(0,0,0,0)}),((e,t)=>{e.setDate(e.getDate()+7*t)}),((e,t)=>(t-e-(t.getTimezoneOffset()-e.getTimezoneOffset())*Lo)/zo))}Vo.range;const Ho=Bo(0),$o=Bo(1),Wo=Bo(2),Uo=Bo(3),Yo=Bo(4),Go=Bo(5),Xo=Bo(6);function Ko(e){return Po((t=>{t.setUTCDate(t.getUTCDate()-(t.getUTCDay()+7-e)%7),t.setUTCHours(0,0,0,0)}),((e,t)=>{e.setUTCDate(e.getUTCDate()+7*t)}),((e,t)=>(t-e)/zo))}Ho.range,$o.range,Wo.range,Uo.range,Yo.range,Go.range,Xo.range;const Zo=Ko(0),Jo=Ko(1),Qo=Ko(2),ea=Ko(3),ta=Ko(4),na=Ko(5),ia=Ko(6);Zo.range,Jo.range,Qo.range,ea.range,ta.range,na.range,ia.range;const ra=Po((e=>{e.setMonth(0,1),e.setHours(0,0,0,0)}),((e,t)=>{e.setFullYear(e.getFullYear()+t)}),((e,t)=>t.getFullYear()-e.getFullYear()),(e=>e.getFullYear()));ra.every=e=>isFinite(e=Math.floor(e))&&e>0?Po((t=>{t.setFullYear(Math.floor(t.getFullYear()/e)*e),t.setMonth(0,1),t.setHours(0,0,0,0)}),((t,n)=>{t.setFullYear(t.getFullYear()+n*e)})):null,ra.range;const oa=Po((e=>{e.setUTCMonth(0,1),e.setUTCHours(0,0,0,0)}),((e,t)=>{e.setUTCFullYear(e.getUTCFullYear()+t)}),((e,t)=>t.getUTCFullYear()-e.getUTCFullYear()),(e=>e.getUTCFullYear()));function aa(e,t){return null==e||null==t?NaN:e<t?-1:e>t?1:e>=t?0:NaN}function sa(e,t){return null==e||null==t?NaN:t<e?-1:t>e?1:t>=e?0:NaN}function la(e){let t,n,i;function r(e,i,r=0,o=e.length){if(r<o){if(0!==t(i,i))return o;do{const t=r+o>>>1;n(e[t],i)<0?r=t+1:o=t}while(r<o)}return r}return 2!==e.length?(t=aa,n=(t,n)=>aa(e(t),n),i=(t,n)=>e(t)-n):(t=e===aa||e===sa?e:ca,n=e,i=e),{left:r,center:function(e,t,n=0,o=e.length){const a=r(e,t,n,o-1);return a>n&&i(e[a-1],t)>-i(e[a],t)?a-1:a},right:function(e,i,r=0,o=e.length){if(r<o){if(0!==t(i,i))return o;do{const t=r+o>>>1;n(e[t],i)<=0?r=t+1:o=t}while(r<o)}return r}}}function ca(){return 0}oa.every=e=>isFinite(e=Math.floor(e))&&e>0?Po((t=>{t.setUTCFullYear(Math.floor(t.getUTCFullYear()/e)*e),t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0)}),((t,n)=>{t.setUTCFullYear(t.getUTCFullYear()+n*e)})):null,oa.range;const ua=la(aa).right;la((function(e){return null===e?NaN:+e})).center;var ha=ua;class da extends Map{constructor(e,t=pa){if(super(),Object.defineProperties(this,{_intern:{value:new Map},_key:{value:t}}),null!=e)for(const[t,n]of e)this.set(t,n)}get(e){return super.get(fa(this,e))}has(e){return super.has(fa(this,e))}set(e,t){return super.set(function({_intern:e,_key:t},n){const i=t(n);return e.has(i)?e.get(i):(e.set(i,n),n)}(this,e),t)}delete(e){return super.delete(function({_intern:e,_key:t},n){const i=t(n);e.has(i)&&(n=e.get(i),e.delete(i));return n}(this,e))}}function fa({_intern:e,_key:t},n){const i=t(n);return e.has(i)?e.get(i):n}function pa(e){return null!==e&&"object"==typeof e?e.valueOf():e}const ma=Math.sqrt(50),ga=Math.sqrt(10),ya=Math.sqrt(2);function xa(e,t,n){const i=(t-e)/Math.max(0,n),r=Math.floor(Math.log10(i)),o=i/Math.pow(10,r),a=o>=ma?10:o>=ga?5:o>=ya?2:1;let s,l,c;return r<0?(c=Math.pow(10,-r)/a,s=Math.round(e*c),l=Math.round(t*c),s/c<e&&++s,l/c>t&&--l,c=-c):(c=Math.pow(10,r)*a,s=Math.round(e/c),l=Math.round(t/c),s*c<e&&++s,l*c>t&&--l),l<s&&.5<=n&&n<2?xa(e,t,2*n):[s,l,c]}function va(e,t,n){return xa(e=+e,t=+t,n=+n)[2]}function ba(e){if(0<=e.y&&e.y<100){var t=new Date(-1,e.m,e.d,e.H,e.M,e.S,e.L);return t.setFullYear(e.y),t}return new Date(e.y,e.m,e.d,e.H,e.M,e.S,e.L)}function wa(e){if(0<=e.y&&e.y<100){var t=new Date(Date.UTC(-1,e.m,e.d,e.H,e.M,e.S,e.L));return t.setUTCFullYear(e.y),t}return new Date(Date.UTC(e.y,e.m,e.d,e.H,e.M,e.S,e.L))}function Ma(e,t,n){return{y:e,m:t,d:n,H:0,M:0,S:0,L:0}}function ka(e){var t=e.dateTime,n=e.date,i=e.time,r=e.periods,o=e.days,a=e.shortDays,s=e.months,l=e.shortMonths,c=Na(r),u=Ea(r),h=Na(o),d=Ea(o),f=Na(a),p=Ea(a),m=Na(s),g=Ea(s),y=Na(l),x=Ea(l),v={a:function(e){return a[e.getDay()]},A:function(e){return o[e.getDay()]},b:function(e){return l[e.getMonth()]},B:function(e){return s[e.getMonth()]},c:null,d:Ja,e:Ja,f:is,g:ps,G:gs,H:Qa,I:es,j:ts,L:ns,m:rs,M:os,p:function(e){return r[+(e.getHours()>=12)]},q:function(e){return 1+~~(e.getMonth()/3)},Q:Fs,s:js,S:as,u:ss,U:ls,V:us,w:hs,W:ds,x:null,X:null,y:fs,Y:ms,Z:ys,"%":zs},b={a:function(e){return a[e.getUTCDay()]},A:function(e){return o[e.getUTCDay()]},b:function(e){return l[e.getUTCMonth()]},B:function(e){return s[e.getUTCMonth()]},c:null,d:xs,e:xs,f:ks,g:Os,G:Ls,H:vs,I:bs,j:ws,L:Ms,m:Ss,M:_s,p:function(e){return r[+(e.getUTCHours()>=12)]},q:function(e){return 1+~~(e.getUTCMonth()/3)},Q:Fs,s:js,S:qs,u:Ds,U:As,V:Ns,w:Es,W:Rs,x:null,X:null,y:Is,Y:Ps,Z:Ts,"%":zs},w={a:function(e,t,n){var i=f.exec(t.slice(n));return i?(e.w=p.get(i[0].toLowerCase()),n+i[0].length):-1},A:function(e,t,n){var i=h.exec(t.slice(n));return i?(e.w=d.get(i[0].toLowerCase()),n+i[0].length):-1},b:function(e,t,n){var i=y.exec(t.slice(n));return i?(e.m=x.get(i[0].toLowerCase()),n+i[0].length):-1},B:function(e,t,n){var i=m.exec(t.slice(n));return i?(e.m=g.get(i[0].toLowerCase()),n+i[0].length):-1},c:function(e,n,i){return S(e,t,n,i)},d:Ba,e:Ba,f:Ga,g:za,G:Ta,H:$a,I:$a,j:Ha,L:Ya,m:Va,M:Wa,p:function(e,t,n){var i=c.exec(t.slice(n));return i?(e.p=u.get(i[0].toLowerCase()),n+i[0].length):-1},q:ja,Q:Ka,s:Za,S:Ua,u:Ia,U:Oa,V:Pa,w:Ra,W:La,x:function(e,t,i){return S(e,n,t,i)},X:function(e,t,n){return S(e,i,t,n)},y:za,Y:Ta,Z:Fa,"%":Xa};function M(e,t){return function(n){var i,r,o,a=[],s=-1,l=0,c=e.length;for(n instanceof Date||(n=new Date(+n));++s<c;)37===e.charCodeAt(s)&&(a.push(e.slice(l,s)),null!=(r=Sa[i=e.charAt(++s)])?i=e.charAt(++s):r="e"===i?" ":"0",(o=t[i])&&(i=o(n,r)),a.push(i),l=s+1);return a.push(e.slice(l,s)),a.join("")}}function k(e,t){return function(n){var i,r,o=Ma(1900,void 0,1);if(S(o,e,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(t&&!("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=wa(Ma(o.y,0,1))).getUTCDay(),i=r>4||0===r?Jo.ceil(i):Jo(i),i=jo.offset(i,7*(o.V-1)),o.y=i.getUTCFullYear(),o.m=i.getUTCMonth(),o.d=i.getUTCDate()+(o.w+6)%7):(r=(i=ba(Ma(o.y,0,1))).getDay(),i=r>4||0===r?$o.ceil(i):$o(i),i=Fo.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?wa(Ma(o.y,0,1)).getUTCDay():ba(Ma(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,wa(o)):ba(o)}}function S(e,t,n,i){for(var r,o,a=0,s=t.length,l=n.length;a<s;){if(i>=l)return-1;if(37===(r=t.charCodeAt(a++))){if(r=t.charAt(a++),!(o=w[r in Sa?t.charAt(a++):r])||(i=o(e,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(t,v),b.x=M(n,b),b.X=M(i,b),b.c=M(t,b),{format:function(e){var t=M(e+="",v);return t.toString=function(){return e},t},parse:function(e){var t=k(e+="",!1);return t.toString=function(){return e},t},utcFormat:function(e){var t=M(e+="",b);return t.toString=function(){return e},t},utcParse:function(e){var t=k(e+="",!0);return t.toString=function(){return e},t}}}var Sa={"-":"",_:" ",0:"0"},_a=/^\s*\d+/,qa=/^%/,Da=/[\\^$*+?|[\]().{}]/g;function Aa(e,t,n){var i=e<0?"-":"",r=(i?-e:e)+"",o=r.length;return i+(o<n?new Array(n-o+1).join(t)+r:r)}function Ca(e){return e.replace(Da,"\\$&")}function Na(e){return new RegExp("^(?:"+e.map(Ca).join("|")+")","i")}function Ea(e){return new Map(e.map(((e,t)=>[e.toLowerCase(),t])))}function Ra(e,t,n){var i=_a.exec(t.slice(n,n+1));return i?(e.w=+i[0],n+i[0].length):-1}function Ia(e,t,n){var i=_a.exec(t.slice(n,n+1));return i?(e.u=+i[0],n+i[0].length):-1}function Oa(e,t,n){var i=_a.exec(t.slice(n,n+2));return i?(e.U=+i[0],n+i[0].length):-1}function Pa(e,t,n){var i=_a.exec(t.slice(n,n+2));return i?(e.V=+i[0],n+i[0].length):-1}function La(e,t,n){var i=_a.exec(t.slice(n,n+2));return i?(e.W=+i[0],n+i[0].length):-1}function Ta(e,t,n){var i=_a.exec(t.slice(n,n+4));return i?(e.y=+i[0],n+i[0].length):-1}function za(e,t,n){var i=_a.exec(t.slice(n,n+2));return i?(e.y=+i[0]+(+i[0]>68?1900:2e3),n+i[0].length):-1}function Fa(e,t,n){var i=/^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(t.slice(n,n+6));return i?(e.Z=i[1]?0:-(i[2]+(i[3]||"00")),n+i[0].length):-1}function ja(e,t,n){var i=_a.exec(t.slice(n,n+1));return i?(e.q=3*i[0]-3,n+i[0].length):-1}function Va(e,t,n){var i=_a.exec(t.slice(n,n+2));return i?(e.m=i[0]-1,n+i[0].length):-1}function Ba(e,t,n){var i=_a.exec(t.slice(n,n+2));return i?(e.d=+i[0],n+i[0].length):-1}function Ha(e,t,n){var i=_a.exec(t.slice(n,n+3));return i?(e.m=0,e.d=+i[0],n+i[0].length):-1}function $a(e,t,n){var i=_a.exec(t.slice(n,n+2));return i?(e.H=+i[0],n+i[0].length):-1}function Wa(e,t,n){var i=_a.exec(t.slice(n,n+2));return i?(e.M=+i[0],n+i[0].length):-1}function Ua(e,t,n){var i=_a.exec(t.slice(n,n+2));return i?(e.S=+i[0],n+i[0].length):-1}function Ya(e,t,n){var i=_a.exec(t.slice(n,n+3));return i?(e.L=+i[0],n+i[0].length):-1}function Ga(e,t,n){var i=_a.exec(t.slice(n,n+6));return i?(e.L=Math.floor(i[0]/1e3),n+i[0].length):-1}function Xa(e,t,n){var i=qa.exec(t.slice(n,n+1));return i?n+i[0].length:-1}function Ka(e,t,n){var i=_a.exec(t.slice(n));return i?(e.Q=+i[0],n+i[0].length):-1}function Za(e,t,n){var i=_a.exec(t.slice(n));return i?(e.s=+i[0],n+i[0].length):-1}function Ja(e,t){return Aa(e.getDate(),t,2)}function Qa(e,t){return Aa(e.getHours(),t,2)}function es(e,t){return Aa(e.getHours()%12||12,t,2)}function ts(e,t){return Aa(1+Fo.count(ra(e),e),t,3)}function ns(e,t){return Aa(e.getMilliseconds(),t,3)}function is(e,t){return ns(e,t)+"000"}function rs(e,t){return Aa(e.getMonth()+1,t,2)}function os(e,t){return Aa(e.getMinutes(),t,2)}function as(e,t){return Aa(e.getSeconds(),t,2)}function ss(e){var t=e.getDay();return 0===t?7:t}function ls(e,t){return Aa(Ho.count(ra(e)-1,e),t,2)}function cs(e){var t=e.getDay();return t>=4||0===t?Yo(e):Yo.ceil(e)}function us(e,t){return e=cs(e),Aa(Yo.count(ra(e),e)+(4===ra(e).getDay()),t,2)}function hs(e){return e.getDay()}function ds(e,t){return Aa($o.count(ra(e)-1,e),t,2)}function fs(e,t){return Aa(e.getFullYear()%100,t,2)}function ps(e,t){return Aa((e=cs(e)).getFullYear()%100,t,2)}function ms(e,t){return Aa(e.getFullYear()%1e4,t,4)}function gs(e,t){var n=e.getDay();return Aa((e=n>=4||0===n?Yo(e):Yo.ceil(e)).getFullYear()%1e4,t,4)}function ys(e){var t=e.getTimezoneOffset();return(t>0?"-":(t*=-1,"+"))+Aa(t/60|0,"0",2)+Aa(t%60,"0",2)}function xs(e,t){return Aa(e.getUTCDate(),t,2)}function vs(e,t){return Aa(e.getUTCHours(),t,2)}function bs(e,t){return Aa(e.getUTCHours()%12||12,t,2)}function ws(e,t){return Aa(1+jo.count(oa(e),e),t,3)}function Ms(e,t){return Aa(e.getUTCMilliseconds(),t,3)}function ks(e,t){return Ms(e,t)+"000"}function Ss(e,t){return Aa(e.getUTCMonth()+1,t,2)}function _s(e,t){return Aa(e.getUTCMinutes(),t,2)}function qs(e,t){return Aa(e.getUTCSeconds(),t,2)}function Ds(e){var t=e.getUTCDay();return 0===t?7:t}function As(e,t){return Aa(Zo.count(oa(e)-1,e),t,2)}function Cs(e){var t=e.getUTCDay();return t>=4||0===t?ta(e):ta.ceil(e)}function Ns(e,t){return e=Cs(e),Aa(ta.count(oa(e),e)+(4===oa(e).getUTCDay()),t,2)}function Es(e){return e.getUTCDay()}function Rs(e,t){return Aa(Jo.count(oa(e)-1,e),t,2)}function Is(e,t){return Aa(e.getUTCFullYear()%100,t,2)}function Os(e,t){return Aa((e=Cs(e)).getUTCFullYear()%100,t,2)}function Ps(e,t){return Aa(e.getUTCFullYear()%1e4,t,4)}function Ls(e,t){var n=e.getUTCDay();return Aa((e=n>=4||0===n?ta(e):ta.ceil(e)).getUTCFullYear()%1e4,t,4)}function Ts(){return"+0000"}function zs(){return"%"}function Fs(e){return+e}function js(e){return Math.floor(+e/1e3)}const Vs=yo();Vs("d3-number",(function(e,t,n){let i,r;function o(e){return r(e)}function a(){o.locale({decimal:n||".",thousands:t||",",grouping:[3],currency:["$",""]})}return o.locale=function(t){return i=Ro(t),r=i.format(e),this},a(),o.format=function(e,r,o,s){return(o||s)&&(t=o,n=s,a()),i.format(e)(r)},o.pattern=function(t){return t&&(e=t,r=i.format(t)),e},o})),Vs("d3-time",(function(e){let t=ka({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=t.format(e);function i(e){return n(e)}return i.format=function(e,n){return t.format(e)(n)},i.locale=function(){return t=ka(...arguments),n=t.format(e),this},i.parse=function(e,n){return t.parse(e)(n)},i.parsePattern=function(e){return t.parse(e)},i}));const Bs={id:e=>"".concat(e.source,"/").concat(e.key||e.title),key:e=>String(e.key||e.title),tags:e=>e.tags,min:e=>e.min,max:e=>e.max,type:e=>e.type,title:e=>String(e.title),values:e=>e.values,value:e=>e,label:e=>e,formatter:e=>(e=>{if("function"==typeof e.formatter)return e.formatter();const t=e.formatter||{};return Vs(t.type||"d3-number")(t.format||"")})(e)};function Hs(e){let{id:t=Bs.id,key:n=Bs.key,min:i=Bs.min,max:r=Bs.max,type:o=Bs.type,tags:a=Bs.tags,title:s=Bs.title,values:l=Bs.values,value:c=Bs.value,label:u=Bs.label,formatter:h=Bs.formatter}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return{id:()=>t(e),key:()=>n(e),raw:()=>e,tags:()=>a(e),type:()=>o(e),min:()=>i(e),max:()=>r(e),title:()=>s(e),items:()=>l(e),formatter:()=>h(e),value:c,label:u}}const $s=e=>e.filter((e=>"number"==typeof e&&!isNaN(e))),Ws=e=>e.reduce(((e,t)=>e+t),0),Us={first:e=>e[0],last:e=>e[e.length-1],min:e=>{const t=$s(e);return t.length?Math.min.apply(null,t):NaN},max:e=>{const t=$s(e);return t.length?Math.max.apply(null,t):NaN},sum:e=>{const t=$s(e);return t.length?t.reduce(((e,t)=>e+t),0):NaN},avg:e=>{const t=$s(e),n=t.length;return n?Ws(t)/n:NaN}};function Ys(e,t,n,i){const r={},o=i.field||(void 0!==e.field?t.field(e.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=>Ys(e,t,{main:n},i).main)):void 0!==s.field?(l.type="field",l.field=t.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=Us[s.reduce]:l.field&&l.field.reduce&&(l.reduce="string"==typeof l.field.reduce?Us[l.field.reduce]:l.field.reduce),"function"==typeof s.reduceLabel?l.reduceLabel=s.reduceLabel:s.reduceLabel?l.reduceLabel=Us[s.reduceLabel]:l.field&&l.field.reduceLabel&&(l.reduceLabel="string"==typeof l.field.reduceLabel?Us[l.field.reduceLabel]:l.field.reduceLabel))})),r}function Gs(e,t){const{main:n}=Ys(e,t,{main:{value:e.value,label:e.label,reduce:e.reduce,filter:e.filter}},{});return{props:Ys(e,t,e.props||{},n),main:n}}function Xs(e,t,n,i){const r=Array(e.length),o=Array(e.length);let a;for(let t=0;t<e.length;t++)a=i?e[t][i]:e[t],r[t]=a.value,o[t]=a.label;const s=t.reduce,l=t.reduceLabel,c=s?s(r):r,u={value:c,label:l?l(o,c):n?n(c):String(c)};return i&&e[0][i].source?(u.source=e[0][i].source,u):!i&&e[0].source?(u.source=e[0].source,u):u}function Ks(e,t){let{main:n,propsArr:i,props:r}=t,o=[];const a=n.field.formatter(),s={};return i.forEach((e=>{s[e]=r[e].field?r[e].field.formatter():e=>e})),o.push(...e.map((e=>{const t=Xs(e.items,n,a);return i.forEach((n=>{t[n]=Xs(e.items,r[n],s[n],n)})),t}))),o}function Zs(e){let{cfg:t,itemData:n,obj:i,target:r,tracker:o,trackType:a}=e;const s="function"===a?t.trackBy(n):n[t.trackBy];let l=o[s];l||(l=o[s]={items:[],id:s},r.push(l)),l.items.push(i)}function Js(e){if(e.length<1e4)return Math.max(...e);let t=-1/0;const n=e.length;for(let i=0;i<n;i++)t<e[i]&&(t=e[i]);return t}function Qs(e){if(e.length<1e4)return Math.min(...e);let t=1/0;const n=e.length;for(let i=0;i<n;i++)t>e[i]&&(t=e[i]);return t}const el={diverging:function(e,t){if((s=e.length)>0)for(var n,i,r,o,a,s,l=0,c=e[t[0]].length;l<c;++l)for(o=a=0,n=0;n<s;++n)(r=(i=e[t[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:ho,silhouette:function(e,t){if((n=e.length)>0){for(var n,i=0,r=e[t[0]],o=r.length;i<o;++i){for(var a=0,s=0;a<n;++a)s+=e[a][i][1]||0;r[i][1]+=r[i][0]=-s/2}ho(e,t)}},expand:function(e,t){if((i=e.length)>0){for(var n,i,r,o=0,a=e[0].length;o<a;++o){for(r=n=0;n<i;++n)r+=e[n][o][1]||0;if(r)for(n=0;n<i;++n)e[n][o][1]/=r}ho(e,t)}},wiggle:function(e,t){if((r=e.length)>0&&(i=(n=e[t[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=e[t[s]],h=u[a][1]||0,d=(h-(u[a-1][1]||0))/2,f=0;f<s;++f){var p=e[t[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,ho(e,t)}}},tl={ascending:function(e){var t=e.map(go);return fo(e).sort((function(e,n){return t[e]-t[n]}))},insideout:function(e){var t,n,i=e.length,r=e.map(go),o=function(e){var t=e.map(mo);return fo(e).sort((function(e,n){return t[e]-t[n]}))}(e),a=0,s=0,l=[],c=[];for(t=0;t<i;++t)n=o[t],a<s?(a+=r[n],l.push(n)):(s+=r[n],c.push(n));return c.reverse().concat(l)},none:fo,reverse:function(e){return fo(e).reverse()}};function nl(e,t,n){const i={},r=t.stackKey,o=t.value,a=t.startProp||"start",s=t.endProp||"end",l=t.offset||"none",c=t.order||"none",u=t.valueRef||"";let h=0,d={};for(let t=0;t<e.items.length;t++){let n=e.items[t],o=u?n[u]:null;if(o&&o.source){let e="".concat(o.source.key||"","/").concat(o.source.field);d[e]||(d[e]=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((e=>i[e].items)),m=function(){var e=br([]),t=fo,n=ho,i=po;function r(r){var o,a,s=e.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=t(u);o<c;++o)u[a[o]].index=o;return n(u,a),u}return r.keys=function(t){return arguments.length?(e="function"==typeof t?t:br(Yr.call(t)),r):e},r.value=function(e){return arguments.length?(i="function"==typeof e?e:br(+e),r):i},r.order=function(e){return arguments.length?(t=null==e?fo:"function"==typeof e?e:br(Yr.call(e)),r):t},r.offset=function(e){return arguments.length?(n=null==e?ho:e,r):n},r}().keys(f).value(((e,t)=>e[t]?o(e[t]):0)).order(tl[c]).offset(el[l]);let g=m(p),y=[];for(let e=0;e<g.length;e++){let t=g[e];for(let e=0;e<t.length;e++){let n=t[e],i=t[e].data[t.key];i&&(i[a]={value:n[0]},i[s]={value:n[1]},y.push(n[0],n[1]))}}let x=Object.keys(d).map((e=>{let t=n(d[e].key);return t?t.field(d[e].field):null})).filter((e=>!!e));const v=Hs({title:x.map((e=>e.title())).join(", "),min:Qs(y),max:Js(y),type:"measure",formatter:x[0]?x[0].formatter:void 0});e.fields.push(v)}function il(e){let t=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(e))n.items=e.map((e=>({value:e,label:String(e)})));else if(e){if("collection"in e)n=ir({},t.collection(e.collection));else{const r=t.dataset?t.dataset(e.source):null;let o=e.value||(e=>e),a=e.label||(e=>e);if(e.groupBy||e.mapTo)i.warn('Deprecated "data" configuration',e),n.items=[];else if(e.hierarchy)n.root=r.hierarchy?r.hierarchy(e.hierarchy):null,n.fields=r.fields();else if(e.items)n.items=e.skipNormalize?e.items:e.items.map((e=>({value:o(e),label:String(a(e))})));else if(e.extract){const i=Array.isArray(e.extract)?e.extract:[e.extract];n.items=[];const o=[];i.forEach((e=>{const i=e.source?t.dataset(e.source):r;i&&(n.items=[...n.items,...i.extract(e)],void 0!==e.field&&o.push(i.field(e.field)))})),o.length&&(n.fields=o),e.amend&&Array.isArray(e.amend)&&(n.items=[...n.items,...e.amend])}else if(void 0!==e.field&&r){const t=r.field(e.field);t&&(n.fields||(n.fields=[]),n.fields.push(t),"value"in e||(o=t.value||(e=>e),a=t.label||(e=>e),n.value=o),n.items=t.items().map((t=>({value:o(t),label:String(a(t)),source:{field:e.field}}))))}else e.fields&&e.fields.forEach((e=>{const i="object"==typeof e&&e.source?t.dataset(e.source):r;if(!i)return;let o;o="object"==typeof e&&void 0!==e.field?i.field(e.field):i.field(e),o&&(n.fields||(n.fields=[]),n.fields.push(o))}));n.items&&e.map&&(n.items=n.items.map(e.map))}e&&e.stack&&nl(n,e.stack,t.dataset)}return e&&!Array.isArray(e)&&"function"==typeof e.filter&&n.items&&(n.items=n.items.filter(e.filter)),e&&!Array.isArray(e)&&"function"==typeof e.sort&&n.items&&(n.items=n.items.sort(e.sort)),n}function rl(e,t,n){let i,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:il;if(e.data){const i=r(e.data,t,n);if(i&&i.fields&&i.fields[0])return i.fields[0].formatter()}if(i=e.formatter?"".concat(e.formatter,"-").concat(e.type||"number"):e.type||"d3-number",n.formatter.has(i)){return n.formatter.get(i)(e.format||"")}throw new Error("Formatter of type '".concat(i,"' was not found"))}function ol(e,t){switch(arguments.length){case 0:break;case 1:this.range(e);break;default:this.range(t).domain(e)}return this}const al=Symbol("implicit");function sl(){var e=new da,t=[],n=[],i=al;function r(r){let o=e.get(r);if(void 0===o){if(i!==al)return i;e.set(r,o=t.push(r)-1)}return n[o%n.length]}return r.domain=function(n){if(!arguments.length)return t.slice();t=[],e=new da;for(const i of n)e.has(i)||e.set(i,t.push(i)-1);return r},r.range=function(e){return arguments.length?(n=Array.from(e),r):n.slice()},r.unknown=function(e){return arguments.length?(i=e,r):i},r.copy=function(){return sl(t,n).unknown(i)},ol.apply(r,arguments),r}function ll(){var e,t,n=sl().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;e=(f-d)/Math.max(1,n-l+2*c),s&&(e=Math.floor(e)),d+=(f-d-e*(n-l))*u,t=e*(1-l),s&&(d=Math.round(d),t=Math.round(t));var p=function(e,t,n){e=+e,t=+t,n=(r=arguments.length)<2?(t=e,e=0,1):r<3?1:+n;for(var i=-1,r=0|Math.max(0,Math.ceil((t-e)/n)),o=new Array(r);++i<r;)o[i]=e+i*n;return o}(n).map((function(t){return d+e*t}));return r(h?p.reverse():p)}return delete n.unknown,n.domain=function(e){return arguments.length?(i(e),h()):i()},n.range=function(e){return arguments.length?([o,a]=e,o=+o,a=+a,h()):[o,a]},n.rangeRound=function(e){return[o,a]=e,o=+o,a=+a,s=!0,h()},n.bandwidth=function(){return t},n.step=function(){return e},n.round=function(e){return arguments.length?(s=!!e,h()):s},n.padding=function(e){return arguments.length?(l=Math.min(1,c=+e),h()):l},n.paddingInner=function(e){return arguments.length?(l=Math.min(1,e),h()):l},n.paddingOuter=function(e){return arguments.length?(c=+e,h()):c},n.align=function(e){return arguments.length?(u=Math.max(0,Math.min(1,e)),h()):u},n.copy=function(){return ll(i(),[o,a]).round(s).paddingInner(l).paddingOuter(c).align(u)},ol.apply(h(),arguments)}function cl(e,t,n){e.prototype=t.prototype=n,n.constructor=e}function ul(e,t){var n=Object.create(e.prototype);for(var i in t)n[i]=t[i];return n}function hl(){}var dl=.7,fl=1/dl,pl="\\s*([+-]?\\d+)\\s*",ml="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",gl="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",yl=/^#([0-9a-f]{3,8})$/,xl=new RegExp(`^rgb\\(${pl},${pl},${pl}\\)$`),vl=new RegExp(`^rgb\\(${gl},${gl},${gl}\\)$`),bl=new RegExp(`^rgba\\(${pl},${pl},${pl},${ml}\\)$`),wl=new RegExp(`^rgba\\(${gl},${gl},${gl},${ml}\\)$`),Ml=new RegExp(`^hsl\\(${ml},${gl},${gl}\\)$`),kl=new RegExp(`^hsla\\(${ml},${gl},${gl},${ml}\\)$`),Sl={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 _l(){return this.rgb().formatHex()}function ql(){return this.rgb().formatRgb()}function Dl(e){var t,n;return e=(e+"").trim().toLowerCase(),(t=yl.exec(e))?(n=t[1].length,t=parseInt(t[1],16),6===n?Al(t):3===n?new El(t>>8&15|t>>4&240,t>>4&15|240&t,(15&t)<<4|15&t,1):8===n?Cl(t>>24&255,t>>16&255,t>>8&255,(255&t)/255):4===n?Cl(t>>12&15|t>>8&240,t>>8&15|t>>4&240,t>>4&15|240&t,((15&t)<<4|15&t)/255):null):(t=xl.exec(e))?new El(t[1],t[2],t[3],1):(t=vl.exec(e))?new El(255*t[1]/100,255*t[2]/100,255*t[3]/100,1):(t=bl.exec(e))?Cl(t[1],t[2],t[3],t[4]):(t=wl.exec(e))?Cl(255*t[1]/100,255*t[2]/100,255*t[3]/100,t[4]):(t=Ml.exec(e))?Tl(t[1],t[2]/100,t[3]/100,1):(t=kl.exec(e))?Tl(t[1],t[2]/100,t[3]/100,t[4]):Sl.hasOwnProperty(e)?Al(Sl[e]):"transparent"===e?new El(NaN,NaN,NaN,0):null}function Al(e){return new El(e>>16&255,e>>8&255,255&e,1)}function Cl(e,t,n,i){return i<=0&&(e=t=n=NaN),new El(e,t,n,i)}function Nl(e,t,n,i){return 1===arguments.length?function(e){return e instanceof hl||(e=Dl(e)),e?new El((e=e.rgb()).r,e.g,e.b,e.opacity):new El}(e):new El(e,t,n,null==i?1:i)}function El(e,t,n,i){this.r=+e,this.g=+t,this.b=+n,this.opacity=+i}function Rl(){return`#${Ll(this.r)}${Ll(this.g)}${Ll(this.b)}`}function Il(){const e=Ol(this.opacity);return`${1===e?"rgb(":"rgba("}${Pl(this.r)}, ${Pl(this.g)}, ${Pl(this.b)}${1===e?")":`, ${e})`}`}function Ol(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function Pl(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function Ll(e){return((e=Pl(e))<16?"0":"")+e.toString(16)}function Tl(e,t,n,i){return i<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new Fl(e,t,n,i)}function zl(e){if(e instanceof Fl)return new Fl(e.h,e.s,e.l,e.opacity);if(e instanceof hl||(e=Dl(e)),!e)return new Fl;if(e instanceof Fl)return e;var t=(e=e.rgb()).r/255,n=e.g/255,i=e.b/255,r=Math.min(t,n,i),o=Math.max(t,n,i),a=NaN,s=o-r,l=(o+r)/2;return s?(a=t===o?(n-i)/s+6*(n<i):n===o?(i-t)/s+2:(t-n)/s+4,s/=l<.5?o+r:2-o-r,a*=60):s=l>0&&l<1?0:a,new Fl(a,s,l,e.opacity)}function Fl(e,t,n,i){this.h=+e,this.s=+t,this.l=+n,this.opacity=+i}function jl(e){return(e=(e||0)%360)<0?e+360:e}function Vl(e){return Math.max(0,Math.min(1,e||0))}function Bl(e,t,n){return 255*(e<60?t+(n-t)*e/60:e<180?n:e<240?t+(n-t)*(240-e)/60:t)}cl(hl,Dl,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:_l,formatHex:_l,formatHex8:function(){return this.rgb().formatHex8()},formatHsl:function(){return zl(this).formatHsl()},formatRgb:ql,toString:ql}),cl(El,Nl,ul(hl,{brighter(e){return e=null==e?fl:Math.pow(fl,e),new El(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=null==e?dl:Math.pow(dl,e),new El(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new El(Pl(this.r),Pl(this.g),Pl(this.b),Ol(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:Rl,formatHex:Rl,formatHex8:function(){return`#${Ll(this.r)}${Ll(this.g)}${Ll(this.b)}${Ll(255*(isNaN(this.opacity)?1:this.opacity))}`},formatRgb:Il,toString:Il})),cl(Fl,(function(e,t,n,i){return 1===arguments.length?zl(e):new Fl(e,t,n,null==i?1:i)}),ul(hl,{brighter(e){return e=null==e?fl:Math.pow(fl,e),new Fl(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=null==e?dl:Math.pow(dl,e),new Fl(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=this.h%360+360*(this.h<0),t=isNaN(e)||isNaN(this.s)?0:this.s,n=this.l,i=n+(n<.5?n:1-n)*t,r=2*n-i;return new El(Bl(e>=240?e-240:e+120,r,i),Bl(e,r,i),Bl(e<120?e+240:e-120,r,i),this.opacity)},clamp(){return new Fl(jl(this.h),Vl(this.s),Vl(this.l),Ol(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 e=Ol(this.opacity);return`${1===e?"hsl(":"hsla("}${jl(this.h)}, ${100*Vl(this.s)}%, ${100*Vl(this.l)}%${1===e?")":`, ${e})`}`}}));var Hl=e=>()=>e;function $l(e){return 1==(e=+e)?Wl:function(t,n){return n-t?function(e,t,n){return e=Math.pow(e,n),t=Math.pow(t,n)-e,n=1/n,function(i){return Math.pow(e+i*t,n)}}(t,n,e):Hl(isNaN(t)?n:t)}}function Wl(e,t){var n=t-e;return n?function(e,t){return function(n){return e+n*t}}(e,n):Hl(isNaN(e)?t:e)}var Ul=function e(t){var n=$l(t);function i(e,t){var i=n((e=Nl(e)).r,(t=Nl(t)).r),r=n(e.g,t.g),o=n(e.b,t.b),a=Wl(e.opacity,t.opacity);return function(t){return e.r=i(t),e.g=r(t),e.b=o(t),e.opacity=a(t),e+""}}return i.gamma=e,i}(1);function Yl(e,t){t||(t=[]);var n,i=e?Math.min(t.length,e.length):0,r=t.slice();return function(o){for(n=0;n<i;++n)r[n]=e[n]*(1-o)+t[n]*o;return r}}function Gl(e,t){var n,i=t?t.length:0,r=e?Math.min(i,e.length):0,o=new Array(r),a=new Array(i);for(n=0;n<r;++n)o[n]=tc(e[n],t[n]);for(;n<i;++n)a[n]=t[n];return function(e){for(n=0;n<r;++n)a[n]=o[n](e);return a}}function Xl(e,t){var n=new Date;return e=+e,t=+t,function(i){return n.setTime(e*(1-i)+t*i),n}}function Kl(e,t){return e=+e,t=+t,function(n){return e*(1-n)+t*n}}function Zl(e,t){var n,i={},r={};for(n in null!==e&&"object"==typeof e||(e={}),null!==t&&"object"==typeof t||(t={}),t)n in e?i[n]=tc(e[n],t[n]):r[n]=t[n];return function(e){for(n in i)r[n]=i[n](e);return r}}var Jl=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,Ql=new RegExp(Jl.source,"g");function ec(e,t){var n,i,r,o=Jl.lastIndex=Ql.lastIndex=0,a=-1,s=[],l=[];for(e+="",t+="";(n=Jl.exec(e))&&(i=Ql.exec(t));)(r=i.index)>o&&(r=t.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:Kl(n,i)})),o=Ql.lastIndex;return o<t.length&&(r=t.slice(o),s[a]?s[a]+=r:s[++a]=r),s.length<2?l[0]?function(e){return function(t){return e(t)+""}}(l[0].x):function(e){return function(){return e}}(t):(t=l.length,function(e){for(var n,i=0;i<t;++i)s[(n=l[i]).i]=n.x(e);return s.join("")})}function tc(e,t){var n,i=typeof t;return null==t||"boolean"===i?Hl(t):("number"===i?Kl:"string"===i?(n=Dl(t))?(t=n,Ul):ec:t instanceof Dl?Ul:t instanceof Date?Xl:function(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}(t)?Yl:Array.isArray(t)?Gl:"function"!=typeof t.valueOf&&"function"!=typeof t.toString||isNaN(t)?Zl:Kl)(e,t)}function nc(e,t){return e=+e,t=+t,function(n){return Math.round(e*(1-n)+t*n)}}function ic(e){return+e}var rc=[0,1];function oc(e){return e}function ac(e,t){return(t-=e=+e)?function(n){return(n-e)/t}:function(e){return function(){return e}}(isNaN(t)?NaN:.5)}function sc(e,t,n){var i=e[0],r=e[1],o=t[0],a=t[1];return r<i?(i=ac(r,i),o=n(a,o)):(i=ac(i,r),o=n(o,a)),function(e){return o(i(e))}}function lc(e,t,n){var i=Math.min(e.length,t.length)-1,r=new Array(i),o=new Array(i),a=-1;for(e[i]<e[0]&&(e=e.slice().reverse(),t=t.slice().reverse());++a<i;)r[a]=ac(e[a],e[a+1]),o[a]=n(t[a],t[a+1]);return function(t){var n=ha(e,t,1,i)-1;return o[n](r[n](t))}}function cc(){var e,t,n,i,r,o,a=rc,s=rc,l=tc,c=oc;function u(){var e=Math.min(a.length,s.length);return c!==oc&&(c=function(e,t){var n;return e>t&&(n=e,e=t,t=n),function(n){return Math.max(e,Math.min(t,n))}}(a[0],a[e-1])),i=e>2?lc:sc,r=o=null,h}function h(t){return null==t||isNaN(t=+t)?n:(r||(r=i(a.map(e),s,l)))(e(c(t)))}return h.invert=function(n){return c(t((o||(o=i(s,a.map(e),Kl)))(n)))},h.domain=function(e){return arguments.length?(a=Array.from(e,ic),u()):a.slice()},h.range=function(e){return arguments.length?(s=Array.from(e),u()):s.slice()},h.rangeRound=function(e){return s=Array.from(e),l=nc,u()},h.clamp=function(e){return arguments.length?(c=!!e||oc,u()):c!==oc},h.interpolate=function(e){return arguments.length?(l=e,u()):l},h.unknown=function(e){return arguments.length?(n=e,h):n},function(n,i){return e=n,t=i,u()}}function uc(e,t,n,i){var r,o=function(e,t,n){n=+n;const i=(t=+t)<(e=+e),r=i?va(t,e,n):va(e,t,n);return(i?-1:1)*(r<0?1/-r:r)}(e,t,n);switch((i=Mo(null==i?",f":i)).type){case"s":var a=Math.max(Math.abs(e),Math.abs(t));return null!=i.precision||isNaN(r=function(e,t){return Math.max(0,3*Math.max(-8,Math.min(8,Math.floor(vo(t)/3)))-vo(Math.abs(e)))}(o,a))||(i.precision=r),Co(i,a);case"":case"e":case"g":case"p":case"r":null!=i.precision||isNaN(r=function(e,t){return e=Math.abs(e),t=Math.abs(t)-e,Math.max(0,vo(t)-vo(e))+1}(o,Math.max(Math.abs(e),Math.abs(t))))||(i.precision=r-("e"===i.type));break;case"f":case"%":null!=i.precision||isNaN(r=function(e){return Math.max(0,-vo(Math.abs(e)))}(o))||(i.precision=r-2*("%"===i.type))}return Ao(i)}function hc(e){var t=e.domain;return e.ticks=function(e){var n=t();return function(e,t,n){if(!((n=+n)>0))return[];if((e=+e)==(t=+t))return[e];const i=t<e,[r,o,a]=i?xa(t,e,n):xa(e,t,n);if(!(o>=r))return[];const s=o-r+1,l=new Array(s);if(i)if(a<0)for(let e=0;e<s;++e)l[e]=(o-e)/-a;else for(let e=0;e<s;++e)l[e]=(o-e)*a;else if(a<0)for(let e=0;e<s;++e)l[e]=(r+e)/-a;else for(let e=0;e<s;++e)l[e]=(r+e)*a;return l}(n[0],n[n.length-1],null==e?10:e)},e.tickFormat=function(e,n){var i=t();return uc(i[0],i[i.length-1],null==e?10:e,n)},e.nice=function(n){null==n&&(n=10);var i,r,o=t(),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=va(l,c,n))===i)return o[a]=l,o[s]=c,t(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 e},e}function dc(){var e=cc()(oc,oc);return e.copy=function(){return t=e,dc().domain(t.domain()).range(t.range()).interpolate(t.interpolate()).clamp(t.clamp()).unknown(t.unknown());var t},ol.apply(e,arguments),hc(e)}function fc(){var e,t=[.5],n=[0,1],i=1;function r(r){return null!=r&&r<=r?n[ha(t,r,0,i)]:e}return r.domain=function(e){return arguments.length?(t=Array.from(e),i=Math.min(t.length,n.length-1),r):t.slice()},r.range=function(e){return arguments.length?(n=Array.from(e),i=Math.min(t.length,n.length-1),r):n.slice()},r.invertExtent=function(e){var i=n.indexOf(e);return[t[i-1],t[i]]},r.unknown=function(t){return arguments.length?(e=t,r):e},r.copy=function(){return fc().domain(t).range(n).unknown(e)},ol.apply(r,arguments)}function pc(e){return void 0===e?e=>e:t=>e(t)}function mc(e){return Math.max(0,Math.min(1,e))}function gc(e){return"object"==typeof e}function yc(e,t,n){const i=Math.abs(t-n)/(e+1),r=[];for(let o=1;o<=e;o++){const e=o*i;r.push(t<n?t+e:t-e)}return r}function xc(e,t,n){if(1===e.length)return e;const i=e.concat([]);for(let r=0;r<e.length;r++){let o=e[r],a=e[r+1];0===r&&o!==n.start()?(i.push(...yc(t,o,a)),o-=a-o,a=e[r],i.push(...yc(t,o,a))):r===e.length-1&&a!==n.end()?(a=o+(o-e[r-1]),i.push(...yc(t,o,a))):i.push(...yc(t,o,a))}return i.filter((e=>e>=n.min()&&e<=n.max()))}function vc(e){let{distance:t,scale:n,minorCount:i=0,unitDivider:r=100,formatter:o}=e;const a=ar(r)||ar(t)?2:Math.max(t/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?xc(l,i,n):l;c.sort(((e,t)=>e-t));const u=c.map(pc(o));return c.map(((e,t)=>{const i=n(e);return{position:i,start:i,end:i,label:u[t],value:e,isMinor:-1===l.indexOf(e)}}))}function bc(e){let{distance:t,scale:n,minorCount:i=0,unitDivider:r=100,formatter:o}=e;const a=ar(r)||ar(t)?2:Math.max(t/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?xc(c,i,n):c;u.sort(((e,t)=>e-t));const h=u.map(pc(o));return u.map(((e,t)=>{const i=n(e);return{position:i,start:i,end:i,label:h[t],value:e,isMinor:-1===c.indexOf(e)}}))}function wc(e){let t,{settings:n,scale:i,distance:r,formatter:o=e=>e}=e;const a=n.minorTicks&&!ar(n.minorTicks.count)?Math.min(100,n.minorTicks.count):0;if(Array.isArray(n.ticks.values)){const e=n.ticks.values.filter((e=>"object"==typeof e?!ar(e.value):!ar(e)));t=function(e){let{values:t,scale:n,formatter:i=e=>e}=e;return t.sort(((e,t)=>(gc(e)?e.value:e)-(gc(t)?t.value:t))).filter(((e,t,i)=>{const r=gc(e)?e.value:e;return r<=n.max()&&r>=n.min()&&i.indexOf(e)===t})).map((e=>{const t=gc(e),r=t?e.value:e,o=n(r);return{position:o,value:r,label:t&&void 0!==e.label?e.label:i(r),isMinor:!!t&&!!e.isMinor,start:t&&!isNaN(e.start)?mc(n(e.start)):o,end:t&&!isNaN(e.end)?mc(n(e.end)):o}}))}({values:e,scale:i.copy(),formatter:o})}else if(ar(n.ticks.count)){t=(n.ticks.tight?bc:vc)({distance:r,minorCount:a,unitDivider:n.ticks.distance,scale:i,formatter:o}),n.ticks.forceBounds&&function(e,t,n){const i=e.map((e=>e.position)),r=t.range();-1===i.indexOf(r[0])?e.splice(0,0,{position:r[0],start:r[0],end:r[0],label:n(t.start()),isMinor:!1,value:t.start()}):e[0]&&e[0].isMinor&&(e[0].isMinor=!1);const o=e[e.length-1];-1===i.indexOf(r[1])?e.push({position:r[1],start:r[1],end:r[1],label:n(t.end()),isMinor:!1,value:t.end()}):o&&o.isMinor&&(o.isMinor=!1)}(t,i,o)}else{t=function(e){let{count:t,minorCount:n,scale:i,formatter:r}=e;return i.ticks((t-1)*n+t).map(((e,t)=>{const o=i(e);return{position:o,start:o,end:o,label:r(e),isMinor:t%(n+1)!=0,value:e}}))}({count:Math.min(1e3,n.ticks.count),minorCount:a,scale:i.copy(),formatter:o})}return t}function Mc(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const i={};return Object.keys(t).forEach((r=>{const o=typeof e[r];i[r]="function"===o?e[r](n):"undefined"===o?t[r]:e[r]})),i}const kc={min:NaN,max:NaN,expand:NaN,include:[],invert:!1},Sc={tight:!1,forceBounds:!1,values:void 0,count:NaN,distance:100},_c={count:NaN};function qc(e,t){e.instance||(e.instance=t.copy(),e.instance.domain([t.start(),t.end()]),e.instance.clamp(!0),e.instance.range(e.invert?[1,0]:[0,1]))}function Dc(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const i=dc(),r={instance:null,invert:!1},o={data:t,resources:n},a=Mc(e,kc,o);let s;function l(e){return ar(e)?NaN:i(e)}a.ticks=Mc(e.ticks,Sc,o),a.minorTicks=Mc(e.minorTicks,_c,o),l.data=()=>t,l.invert=function(e){return i.invert(e)},l.rangeRound=function(e){return i.rangeRound(e),l},l.clamp=function(){let e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];return i.clamp(e),l},l.cachedTicks=function(){return s},l.clearTicksCache=function(){return s=void 0,this},l.ticks=function(e){return null!==e&&"object"==typeof e?(e.settings=e.settings||{},e.settings=Qi(!0,{},a,e.settings),e.scale=l,s=wc(e),s):(s=i.ticks(e),s)},l.nice=function(e){return i.nice(e),l},l.tickFormat=function(e,t){return i.tickFormat(e,t)},l.interpolate=function(e){return i.interpolate(e),l},l.domain=function(e){return arguments.length?(i.domain(e),r.instance&&r.instance.domain([l.start(),l.end()]),l):i.domain()},l.range=function(e){return arguments.length?(i.range(e),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(e){let t=(l.start()-l.end())/e,n=[l.end()],i=[],r=t/2;for(let o=0;o<e;o++){let e=n[n.length-1]||0,o=e+t,a=l(e+r);n.push(o,o),i.push(a,a)}return n.pop(),l.domain(n),l.range(i),l},l.copy=function(){const r=Dc(e,t,n);return r.domain(l.domain()),r.range(l.range()),r.clamp(i.clamp()),r},l.norm=function(e){return qc(r,l),r.instance(e)},l.normInvert=function(e){return qc(r,l),r.instance.invert(e)};const{mini:c,maxi:u}=function(e,t){const n=+e.min,i=+e.max;let r=0,o=1;if(t&&t[0]){const n=t.map((e=>e.min())).filter((e=>!isNaN(e))),i=t.map((e=>e.max())).filter((e=>!isNaN(e)));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(e.expand)){const t=o-r;r-=t*e.expand,o+=t*e.expand}if(Array.isArray(e.include)){const t=e.include.filter((e=>!isNaN(e)));r=Math.min(...t,r),o=Math.max(...t,o)}}return{mini:isNaN(n)?r:n,maxi:isNaN(i)?o:i}}(a,t?t.fields:[]);return l.domain([c,u]),l.range(a.invert?[1,0]:[0,1]),r.invert=a.invert,l}const Ac={padding:0,paddingInner:NaN,paddingOuter:NaN,align:.5,invert:!1,maxPxStep:NaN,range:[0,1]};function Cc(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const n={data:t,resources:arguments.length>2&&void 0!==arguments[2]?arguments[2]:{}},i=Mc(e,Ac,n),r=t.items||[],o={},a=[],s=[];function l(e,n){e.data=()=>t,e.datum=e=>r[o[e]],e.start=function(){return e.domain()[0]},e.end=function(){return e.domain()[e.domain().length-1]},e.labels=()=>s,e.ticks=function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return t.scale=e,function(e){let{scale:t}=e;const n=t.domain(),i=t.data().items,r=t.labels?t.labels():n,o=t.bandwidth();return n.map(((e,n)=>{const a=t(e);return{position:a+o/2,label:"".concat(r[n]),data:i?i[n]:void 0,start:a,end:a+o}}))}(t,n.trackBy)}}const c=ll();l(c,e),c.pxScale=function(t){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>=t)return c;const a=c.copy();a.type=c.type,l(a,e);const s=o*n/t,u=(1-s)*c.align();return a.range(i.invert?[s+u,u]:[u,s+u]),a};const u="function"==typeof e.value?e.value:e=>e.datum.value,h="function"==typeof e.label?e.label:e=>e.datum.label;for(let e=0;e<r.length;e++){const t=Qi({datum:r[e]},n),i=u(t,e);-1===a.indexOf(i)&&(a.push(i),s.push(h(t,e)),o[i]=e)}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 Nc={depth:0};function Ec(e,t,n){return e.ancestors().map((e=>t(Qi({datum:e.data},n)))).reverse().slice(1).toString()}const Rc=e=>e.min(),Ic=e=>e.max();function Oc(e,t){const n=e&&!isNaN(e.min),i=e&&!isNaN(e.max);let r=n?+e.min:0,o=i?+e.max:1;if(t&&t.length){if(!n){const e=t.map(Rc).filter(or);r=e.length?Math.min(...e):r}if(!i){const e=t.map(Ic).filter(or);o=e.length?Math.max(...e):o}}return[r,o]}const Pc={domain:[],range:[],invert:!1,min:NaN,max:NaN};function Lc(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const i=Dc(e,t,n).clamp(!0).interpolate(Ul),r=Mc(e,Pc,{data:t,resources:n}),o=Array.isArray(r.domain)&&r.domain.length,a=Array.isArray(r.range)&&r.range.length,s=i;Qi(!0,s,i);const[l,c]=Oc(r,t?t.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(e,t,n){const i=e.length;if(2===i)return[t,n];const r=[],o=(n-t)/(i-1);r.push(t);for(let e=1;e<i-1;e++)r.push(t+o*e);return r.push(n),r}(s.range(),l,c)),s}const Tc={domain:[],range:[],invert:!1,min:NaN,max:NaN,nice:!1};function zc(e){const t=[];for(let n=0;n<e.length-1;n++)t.push((e[n]+e[n+1])/2);return t}const Fc={domain:[],range:[]};const jc={domain:[],range:[],unknown:void 0},Vc={domain:[],range:[],override:!1};const Bc=yo();function Hc(e,t,n){let i=e.data;e.source&&(n.logger.warn("Deprecated: Scale data source configuration"),i={extract:[]},(Array.isArray(e.source)?e.source:[e.source]).forEach((e=>{i.extract.push({field:e})})));const r=il(i,t,n);let o,a=e.type||function(e){return e.root?"h-band":e.fields&&e.fields[0]?function(e){const t=e.map((e=>"dimension"===e.type()?"band":"linear"));return-1!==t.indexOf("linear")?"linear":"band"}(e.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(e,r,{theme:n.theme,logger:n.logger}),o.type=a),o}Bc("linear",Dc),Bc("band",Cc),Bc("h-band",(function e(){let t=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=Mc(t,Ac,r);o.ticks=Mc(t.ticks,Nc,r),o.value="function"==typeof t.value?t.value:e=>e.datum.value,o.label="function"==typeof t.label?t.label:e=>e.datum.value;let a=Cc(o);const{values:s,labels:l,items:c,ticks:u}=function(e,t,n){const i=t.ticks.depth,r=t.value,o=t.label,a=[],s=[],l={},c=[];let u=0;if(!e)return{values:a,labels:s,items:l,ticks:c};e.eachAfter((e=>{if(e.depth>0){const t=Ec(e,r,n),h=e.leaves()||[e],d=r(Qi({datum:e.data},n)),f=o(Qi({datum:e.data},n)),p=Array.isArray(e.children),m={key:t,count:h.length,value:d,label:f,leftEdge:Ec(h[0],r,n),rightEdge:Ec(h[Math.max(h.length-1,0)],r,n),node:e};p?(a.push("SPACER_".concat(u,"_SPACER")),u++):(a.push(t),s.push(f)),(i<=0&&!p||e.depth===i)&&c.push(m),l[t]=m}}));const h=e.height-1;return h>0&&a.splice(-h),{values:a,labels:s,items:l,ticks:c}}(n.root,o,r),h=function(e){const t=String(e),n=c[t];return a(n?o.invert?n.rightEdge:n.leftEdge:t)};Qi(!0,h,a),h.bandwidth=function(e){const t=c[String(e)],n=a.bandwidth();if(t&&!t.isLeaf){const e=h(t.leftEdge),i=h(t.rightEdge);return Math.abs(e-i)+n}return n},h.step=function(e){const t=c[String(e)],n=t?t.count:1;let i=a.step();return i*=n,i},h.data=()=>n,h.datum=e=>{const t=c[String(e)];return t?t.node.data:null},h.copy=()=>e(t,n,i),h.labels=()=>l,h.ticks=()=>u.map((e=>{const t=h(e.key),n=h.bandwidth(e.key);return{position:t+n/2,label:e.label,data:e.node.data,start:t,end:t+n}}));const d=a.pxScale;return h.pxScale=function(e){return a=d(e),h},h.domain(s),h})),Bc("sequential-color",Lc),Bc("threshold-color",(function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const i=fc(),r=Mc(e,Tc,{data:t,resources:n}),o=Array.isArray(r.domain)&&r.domain.length,a=Array.isArray(r.range)&&r.range.length;function s(e){return ar(e)?NaN:i(e)}Object.keys(i).forEach((e=>s[e]=i[e]));const l=t.fields,[c,u]=Oc(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(e,t,n){const i=2===e.length?10:Math.max(1,e.length),r=dc().domain([t,n]).nice(i).ticks(i);if(!e||!e.length)return r;const o=Math.max(0,e.length-1);for(;r.length>o;)r[0]-t<=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(e,t,n){const i=e.length;if(2===i)return[t+(n-t)/2];const r=[],o=(n-t)/i;for(let e=1;e<i;e++)r.push(t+o*e);return r}(f,c,u):f.length<p.length+1&&(f=function(e,t,n,i){n=e[0],i=e&&e.length>=2?e[e.length-1]:i;const r=Lc().domain([n,i]).range(t);return[n,...zc(e),i].map((e=>r(e)))}(p,f,c,u)),s.data=()=>t,s.range(r.invert?f.slice().reverse():f),s.domain(p),s})),Bc("categorical-color",(function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const i=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const i=sl(),r={data:t,resources:n},o=Mc(e,Fc,r),a="function"==typeof e.value?e.value:e=>e.datum.value,s="function"==typeof e.label?e.label:e=>e.datum.label,l=t.items||[],c={},u=[],h=[];for(let e=0;e<l.length;e++){const t=Qi({datum:l[e]},r),n=a(t,e);-1===u.indexOf(n)&&(u.push(n),h.push(s(t,e)),c[n]=e)}return i.data=()=>t,i.labels=()=>h,i.label=e=>h[u.indexOf(e)],i.datum=e=>l[c[e]],i.range(o.range),Array.isArray(o.domain)&&o.domain.length?i.domain(o.domain):i.domain(u),i}(e,t,n),r=n.theme,o=Mc(e,jc,{data:t,resources:n});let a;if(o.explicit=Mc(e.explicit,Vc,{data:t,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 e=r.palette("unknown");i.unknown(e[0])}if(Array.isArray(o.explicit.domain)&&o.explicit.domain.length){const e=i.domain().slice(),t=o.explicit.domain,n=Array.isArray(o.explicit.range)?o.explicit.range:[],r=Math.floor(e.length/a.length);for(let e=1;e<r+1;e*=2)a=a.concat(a);if(o.explicit.override)for(let i=0;i<t.length;i++){const r=e.indexOf(t[i]);r>-1&&(a[r]=n[i])}else{const i=t.map(((t,i)=>[e.indexOf(t),t,n[i]])).sort(((e,t)=>e[0]-t[0]));i.forEach((t=>{const n=e.indexOf(t[1]);-1!==n&&a.splice(n,0,t[2])}))}a.length=e.length}return i.range(a),i}));var $c={};function Wc(){Wc.init.call(this)}$c.isObject=function(e){return"object"==typeof e&&null!==e},$c.isNumber=function(e){return"number"==typeof e},$c.isUndefined=function(e){return void 0===e},$c.isFunction=function(e){return"function"==typeof e};var Uc=Wc;Wc.EventEmitter=Wc,Wc.prototype._events=void 0,Wc.prototype._maxListeners=void 0,Wc.defaultMaxListeners=10,Wc.init=function(){this._events=this._events||{},this._maxListeners=this._maxListeners||void 0},Wc.prototype.setMaxListeners=function(e){if(!$c.isNumber(e)||e<0||isNaN(e))throw TypeError("n must be a positive number");return this._maxListeners=e,this},Wc.prototype.emit=function(e){var t,n,i,r,o,a;if(this._events||(this._events={}),"error"===e&&!this._events.error)throw(t=arguments[1])instanceof Error?t:Error('Uncaught, unspecified "error" event.');if(n=this._events[e],$c.isUndefined(n))return!1;if($c.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($c.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},Wc.prototype.addListener=function(e,t){var n;if(!$c.isFunction(t))throw TypeError("listener must be a function");(this._events||(this._events={}),this._events.newListener&&this.emit("newListener",e,$c.isFunction(t.listener)?t.listener:t),this._events[e]?$c.isObject(this._events[e])?this._events[e].push(t):this._events[e]=[this._events[e],t]:this._events[e]=t,$c.isObject(this._events[e])&&!this._events[e].warned)&&((n=$c.isUndefined(this._maxListeners)?Wc.defaultMaxListeners:this._maxListeners)&&n>0&&this._events[e].length>n&&(this._events[e].warned=!0,$c.isFunction(console.error)&&console.error("(node) warning: possible EventEmitter memory leak detected. %d listeners added. Use emitter.setMaxListeners() to increase limit.",this._events[e].length),$c.isFunction(console.trace)&&console.trace()));return this},Wc.prototype.on=Wc.prototype.addListener,Wc.prototype.once=function(e,t){if(!$c.isFunction(t))throw TypeError("listener must be a function");var n=!1;function i(){this.removeListener(e,i),n||(n=!0,t.apply(this,arguments))}return i.listener=t,this.on(e,i),this},Wc.prototype.removeListener=function(e,t){var n,i,r,o;if(!$c.isFunction(t))throw TypeError("listener must be a function");if(!this._events||!this._events[e])return this;if(r=(n=this._events[e]).length,i=-1,n===t||$c.isFunction(n.listener)&&n.listener===t)delete this._events[e],this._events.removeListener&&this.emit("removeListener",e,t);else if($c.isObject(n)){for(o=r;o-- >0;)if(n[o]===t||n[o].listener&&n[o].listener===t){i=o;break}if(i<0)return this;1===n.length?(n.length=0,delete this._events[e]):n.splice(i,1),this._events.removeListener&&this.emit("removeListener",e,t)}return this},Wc.prototype.removeAllListeners=function(e){var t,n;if(!this._events)return this;if(!this._events.removeListener)return 0===arguments.length?this._events={}:this._events[e]&&delete this._events[e],this;if(0===arguments.length){for(t in this._events)"removeListener"!==t&&this.removeAllListeners(t);return this.removeAllListeners("removeListener"),this._events={},this}if(n=this._events[e],$c.isFunction(n))this.removeListener(e,n);else if(Array.isArray(n))for(;n.length;)this.removeListener(e,n[n.length-1]);return delete this._events[e],this},Wc.prototype.listeners=function(e){return this._events&&this._events[e]?$c.isFunction(this._events[e])?[this._events[e]]:this._events[e].slice():[]},Wc.listenerCount=function(e,t){return e._events&&e._events[t]?$c.isFunction(e._events[t])?1:e._events[t].length:0};var Yc={mixin:e=>(Object.keys(Uc.prototype).forEach((t=>{e[t]=Uc.prototype[t]})),Uc.init(e),e)};function Gc(){let e=0,t=0,n=0,i=0;n=n||e;const r={move(e){this.moveTo(n+e)},moveTo(o){const a=Math.max(e,Math.min(t-i,o));n!==a&&(n=a,r.emit("update"))},update(o){let a=!1;({min:e=e,max:t=t}=o),void 0!==o.viewSize&&o.viewSize!==i&&(i=o.viewSize,a=!0);const s=Math.max(e,Math.min(t-i,n));n!==s&&(n=s,a=!0),a&&r.emit("update")},getState:()=>({min:e,max:t,start:n,viewSize:i})};return Yc.mixin(r),r}function Xc(e,t){const n=e.min||0,i=e.max||0,r=e.viewSize||0,o=t||Gc();return o.update({min:n,max:i,viewSize:r}),o}function Kc(e,t){return e<=t}function Zc(e,t){return e<t}function Jc(e,t,n){let i=0;for(;i<e.length&&t>e[i];)++i;return e[i]===t&&n&&++i,i}function Qc(){let e,t,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;e=i?Kc:Zc,t=r?Kc:Zc},r.add=e=>{let{min:t,max:n}=e;const r=Jc(i,t),o=Jc(i,n,!0),a=[r,o-r];r%2==0&&a.push(t),o%2==0&&a.push(n);const s=i.join(",");i.splice(...a);return s!==i.join(",")},r.remove=e=>{let{min:t,max:n}=e;const r=Jc(i,t),o=Jc(i,n,!0),a=[r,o-r];r%2==1&&a.push(t),o%2==1&&a.push(n);const s=i.join(",");i.splice(...a);return s!==i.join(",")},r.set=e=>{const t=i.join(",");i=[],Array.isArray(e)?e.forEach(r.add):r.add(e);return t!==i.join(",")},r.clear=()=>{const e=i.length>0;return i=[],e},r.containsValue=n=>function(e,t,n,i){const r=e.length;for(let o=1;o<r;o+=2)if(n(e[o-1],t)&&i(t,e[o]))return!0;return!1}(i,n,t,e),r.containsRange=e=>{let{min:t,max:n}=e;const r=Jc(i,t,!0),o=Jc(i,n);return r===o&&o%2==1},r.toggle=e=>r.containsRange(e)?r.remove(e):r.add(e),r.ranges=()=>{const e=[];for(let t=1;t<i.length;t+=2)e.push({min:i[t-1],max:i[t]});return e},r.configure(n),r}function eu(){let e=[];function t(){}return t.add=t=>-1===e.indexOf(t)&&(e.push(t),!0),t.remove=t=>{const n=e.indexOf(t);return-1!==n&&(e.splice(n,1),!0)},t.contains=t=>-1!==e.indexOf(t),t.values=()=>e.slice(),t.clear=()=>e=[],t.toString=()=>e.join(";"),t}const tu={key:void 0,includeMin:!0,includeMax:!0};function nu(e){let{items:t,collection:n,vc:i}=e;const r={},o=[];let a,s;for(let e=0,o=t.length;e<o;e++){a=t[e].key,n[a]||(n[a]=i()),s=t[e].values||[t[e].value];for(let e=0;e<s.length;e++)n[a].add(s[e])&&(r[a]=r[a]||[],r[a].push(s[e]))}const l=Object.keys(r);for(let e=0,t=l.length;e<t;e++)a=l[e],o.push({id:a,values:r[a]});return o}function iu(e){let{items:t,collection:n}=e;const i={},r=[];let o,a;for(let e=0,r=t.length;e<r;e++)if(o=t[e].key,n[o]){a=t[e].values||[t[e].value];for(let e=0;e<a.length;e++)n[o].remove(a[e])&&(i[o]=i[o]||[],i[o].push(a[e]))}const s=Object.keys(i);for(let e=0,t=s.length;e<t;e++)o=s[e],r.push({id:o,values:i[o]});return r}function ru(e){const t={};let n,i;for(let r=0,o=e.length;r<o;r++){n=e[r].key,i=e[r].values||[e[r].value],t[n]||(t[n]=[]);for(let e=0;e<i.length;e++){-1===t[n].indexOf(i[e])&&t[n].push(i[e])}}return t}function ou(e){let{key:t,collection:n,obj:i,fn:r,value:o}=e;n[t]||(n[t]=r()),i[t]=i[t]||[],i[t].push(o),n[t].add(o)}function au(e,t){const n=[],i=Object.keys(e);let r,o;const a=e=>-1===t[r].indexOf(e);for(let s=0,l=i.length;s<l;s++)r=i[s],t[r]?(o=e[r].filter(a),o.length&&n.push({id:r,values:o})):n.push({id:r,values:e[r]});return n}function su(e,t,n){const i=function(e,t){if(!Object.keys(t).length)return e;const n=e.length,i=Array(n);for(let r=0;r<n;r++)i[r]=e[r].key in t?Qi({},e[r],{key:t[e[r].key]}):e[r];return i}(t,n);return e&&e.length?e.reduce(((e,t)=>t(e)),i):i}function lu(e){return e.replace(/(-[a-z])/g,(e=>e.toUpperCase().replace("-","")))}function cu(e){return e.replace(/([A-Z])/g,(e=>"-".concat(e.toLowerCase())))}function uu(e,t,n){let{ranges:i,interceptors:r,rc:o,aliases:a,rangeConfig:s}=n;const l=su(r["".concat(t,"Ranges")],e,a);let c=!1;return l.forEach((e=>{const n=e.key;if(i[n]||(i[n]=o(s.sources[n]||s.default)),"set"===t)c=i[n][t](e.ranges||e.range)||c;else{const r=e.ranges||[e.range];for(let e=0;e<r.length;e++)c=i[n][t](r[e])||c}})),c}function hu(){let{vc:e=eu,rc:t=Qc}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=!1,i={},r={},o={},a={sources:{},default:Qi({},tu)};const s={addValues:[],removeValues:[],toggleValues:[],setValues:[],addRanges:[],setRanges:[],removeRanges:[],toggleRanges:[]},l=()=>{const e={values:{},ranges:{}};return Object.keys(r).forEach((t=>{e.values[t]=r[t].values()})),Object.keys(i).forEach((t=>{e.ranges[t]=i[t].ranges()})),e},c={ls:[],clear(){this.ls.forEach((e=>e.clear()))},start(){this.ls.forEach((e=>e.start()))},end(){this.ls.forEach((e=>e.end()))},update(){const e=l();this.ls.forEach((t=>t._state(e)))},updateValues(){const e=l();this.ls.forEach((t=>t._state({values:e.values})))},updateRanges(){const e=l();this.ls.forEach((t=>t._state({ranges:e.ranges})))}},u={configure:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};Array.isArray(e.ranges)&&e.ranges.length&&(a={sources:{},default:Qi({},tu)},e.ranges.forEach((e=>{const t={};Object.keys(tu).filter((e=>"key"!==e)).forEach((n=>{t[n]=void 0!==e[n]?e[n]:tu[n]})),void 0!==e.key?a.sources[e.key]=t:a.default=t})),Object.keys(i).forEach((e=>i[e].configure(a.sources[e]||a.default))),u.emit("update",[],[]))},link:e=>{if(u===e)throw new Error("Can't link to self");c.ls.push(e),e._state(l())},_state:e=>{if(!e)return l();if(e.values){const t=[];Object.keys(e.values).forEach((n=>{r[n]&&e.values[n].join(";")===r[n].toString()||t.push({key:n,values:e.values[n]})})),Object.keys(r).forEach((n=>{e.values[n]||t.push({key:n,values:[]})})),t.length&&u.setValues(t)}if(e.ranges){const t=[];Object.keys(e.ranges).forEach((n=>{i[n]&&e.ranges[n].join(";")===i[n].toString()||t.push({key:n,ranges:e.ranges[n]})})),Object.keys(i).forEach((n=>{e.ranges[n]||t.push({key:n,ranges:[]})})),t.length&&u.setRanges(t)}},start:function(){if(!n){n=!0;for(var e=arguments.length,t=new Array(e),i=0;i<e;i++)t[i]=arguments[i];u.emit("start",...t),c.start()}},end:function(){if(n){n=!1,i={},r={};for(var e=arguments.length,t=new Array(e),o=0;o<e;o++)t[o]=arguments[o];u.emit("end",...t),c.end()}},isActive:()=>n,clear:()=>{const e=u.brushes().filter((e=>"value"===e.type&&e.brush.values().length)).map((e=>({id:e.id,values:e.brush.values()}))),t=Object.keys(i).length>0||e.length;i={},r={},t&&(u.emit("update",[],e),c.clear())},brushes:()=>{let e=[];return e=e.concat(Object.keys(i).map((e=>({type:"range",id:e,brush:i[e]})))),e=e.concat(Object.keys(r).map((e=>({type:"value",id:e,brush:r[e]})))),e},addValue:(e,t)=>{u.addValues([{key:e,value:t}])},addValues:t=>{const i=su(s.addValues,t,o),a=nu({vc:e,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=t=>{const i=su(s.setValues,t,o),a=function(e){let{items:t,vCollection:n,vc:i}=e;const r={},o=ru(t);let a,s=[],l=[];const c={},u=Object.keys(n);for(let e=0,t=u.length;e<t;e++)a=u[e],c[a]=n[a].values().slice(),delete n[a];const h=e=>{n[a]&&n[a].contains(e)||ou({key:a,value:e,collection:n,obj:r,fn:i})},d=Object.keys(o);for(let e=0,t=d.length;e<t;e++)a=d[e],o[a].forEach(h);return l=au(c,r),s=au(r,c),[s,l]}({items:i,vCollection:r,vc:e});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=(e,t)=>{u.removeValues([{key:e,value:t}])},u.removeValues=e=>{const t=su(s.removeValues,e,o),n=iu({collection:r,items:t});u.emit("remove-values",t),n.length&&(u.emit("update",[],n),c.updateValues())},u.addAndRemoveValues=(t,i)=>{const a=su(s.addValues,t,o),l=su(s.removeValues,i,o),h=nu({vc:e,collection:r,items:a}),d=iu({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=(e,t)=>{u.toggleValues([{key:e,value:t}])},u.toggleValues=t=>{const i=su(s.toggleValues,t,o),a=function(e){let{items:t,values:n,vc:i}=e;const r={},o={},a=[],s=[],l=ru(t);let c,u,h;const d=Object.keys(l);for(let e=0,t=d.length;e<t;e++){c=d[e],h=l[c];for(let e=0,t=h.length;e<t;e++)u=h[e],n[c]&&n[c].contains(u)?n[c]&&n[c].contains(u)&&(o[c]=o[c]||[],o[c].push(u),n[c].remove(u)):ou({key:c,value:u,collection:n,obj:r,fn:i})}const f=Object.keys(r);for(let e=0,t=f.length;e<t;e++)c=f[e],a.push({id:c,values:r[c]});const p=Object.keys(o);for(let e=0,t=p.length;e<t;e++)c=p[e],s.push({id:c,values:o[c]});return[a,s]}({items:i,values:r,vc:e});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=(e,t)=>{let n=o[e]||e;return!!r[n]&&r[n].contains(t)},u.addRange=(e,t)=>{u.addRanges([{key:e,range:t}])},u.addRanges=e=>{uu(e,"add",{ranges:i,rc:t,interceptors:s,aliases:o,rangeConfig:a})&&(n||(n=!0,u.emit("start")),u.emit("update",[],[]),c.updateRanges())},u.removeRange=(e,t)=>{u.removeRanges([{key:e,range:t}])},u.removeRanges=e=>{uu(e,"remove",{ranges:i,rc:t,interceptors:s,aliases:o,rangeConfig:a})&&(n||(n=!0,u.emit("start")),u.emit("update",[],[]),c.updateRanges())},u.setRange=(e,t)=>{u.setRanges([{key:e,range:t}])},u.setRanges=e=>{uu(e,"set",{ranges:i,rc:t,interceptors:s,aliases:o,rangeConfig:a})&&(n||(n=!0,u.emit("start")),u.emit("update",[],[]),c.updateRanges())},u.toggleRange=(e,t)=>{u.toggleRanges([{key:e,range:t}])},u.toggleRanges=e=>{uu(e,"toggle",{ranges:i,rc:t,interceptors:s,aliases:o,rangeConfig:a})&&(n||(n=!0,u.emit("start")),u.emit("update",[],[]),c.updateRanges())},u.containsRangeValue=(e,t)=>{let n=o[e]||e;return!!i[n]&&i[n].containsValue(t)},u.containsRange=(e,t)=>{let n=o[e]||e;return!!i[n]&&i[n].containsRange(t)},u.containsMappedData=(e,t,n)=>{let a=[];const s=Object.keys(e);let l,c,u,h;for(let t=0,n=s.length;t<n;t++){if(l=s[t],"value"===l)c=e,a[t]={key:"",i:t,bool:!1};else{if("source"===l)continue;c=e[l],a[t]={key:l,i:t,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[t].bool=Array.isArray(h)?i[u].containsRange({min:h[0],max:h[1]}):i[u].containsValue(h):r[u]&&r[u].contains(h)&&(a[t].bool=!0))}return t?(a=a.filter((e=>-1!==t.indexOf(e.key))),"and"===n?!!a.length&&!a.some((e=>!1===e.bool)):"xor"===n?!!a.length&&a.some((e=>e.bool))&&a.some((e=>!1===e.bool)):a.some((e=>e.bool))):a.some((e=>e.bool))},u.intercept=(e,t)=>{const n=lu(e);s[n]&&s[n].push(t)},u.removeInterceptor=(e,t)=>{const n=lu(e);if(!s[n])return;const i=s[n].indexOf(t);-1!==i&&s[n].splice(i,1)},u.removeAllInterceptors=e=>{const t=[];if(e){const n=lu(e);s[n]&&s[n].length&&t.push({name:e,handlers:s[n]})}else Object.keys(s).forEach((e=>{s[e].length&&t.push({name:cu(e),handlers:s[e]})}));t.forEach((e=>{e.handlers.slice().forEach((t=>u.removeInterceptor(e.name,t)))}))},u.addKeyAlias=(e,t)=>{o[e]=t},u.removeKeyAlias=e=>{delete o[e]},Yc.mixin(u),u}function du(e){return e*e*e}function fu(e){return--e*e*e+1}function pu(e){return((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2}yo();const mu=["stroke","fill","color","backgroundColor","thumbColor"];function gu(e,t){const n=t?t.length:0,i=e?Math.min(n,e.length):0,r=new Array(i),o=new Array(n);let a;for(a=0;a<i;++a)r[a]=yu(e[a],t[a]);for(;a<n;++a)o[a]=t[a];return function(e){for(a=0;a<i;++a)o[a]=r[a](e);return o}}function yu(e,t,n){const i=typeof t;let r;return null==t||"boolean"===i?function(e){return()=>e}(t):("number"===i?Kl:"string"===i?(r=Dl(t))&&mu.includes(n)?(t=r,Ul):ec:t instanceof Dl?Ul:t instanceof Date?Xl:function(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}(t)?Yl:Array.isArray(t)?gu:"function"!=typeof t.valueOf&&"function"!=typeof t.toString||isNaN(t)?xu:Kl)(e,t)}function xu(e,t){const n={},i={};let r;for(r in null!==e&&"object"==typeof e||(e={}),null!==t&&"object"==typeof t||(t={}),t)r in e?n[r]=yu(e[r],t[r],r):i[r]=t[r];return function(e){for(r in n)i[r]=n[r](e);return i}}function vu(e,t){return e.data?e.data.value:"text"===e.type?e.text:t}const bu={fontFamily:"Arial",fontSize:"13px",color:"#595959",backgroundColor:"#ffffff",stroke:"#000000",strokeWidth:0,$fill:"#333333"},wu=/^\$/;function Mu(e){const t=typeof e;return"object"!==t&&"function"!==t&&"undefined"!==t}function ku(e,t,n){const i=e[t];i&&i.scale&&i.scale.pxScale?i.scale=i.scale.pxScale(n):i&&i.pxScale&&(e[t]=i.pxScale(n))}function Su(e,t){return e.pxScale?e.pxScale(t):e}const _u={normalizeSettings:function(e,t,n){const i=Qi({},e),r=Qi({},t);return Object.keys(i).forEach((e=>{r[e]={};const o=i[e],a=typeof o;if("function"==typeof o)r[e].fn=o;else if(Mu(o)){let n=t[e];"string"==typeof n&&wu.test(n)&&(n=bu[n]);const i=typeof n;r[e]="undefined"===i||i===a?o:n}else o&&"object"==typeof o&&("function"==typeof o.fn&&(r[e].fn=o.fn),void 0!==o.scale&&(r[e].scale=n.scale(o.scale)),"string"==typeof o.ref&&(r[e].ref=o.ref))})),Object.keys(t).forEach((e=>{if(e in i)return;const n=t[e];"string"===typeof n&&wu.test(n)?r[e]=bu[n]:r[e]=n})),r},resolveForItem:function(e,t,n){const i={},r=Object.keys(t),o=r.length,a=e.datum,s=e.datum;for(let l=0;l<o;l++){const o=r[l],c=t[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;Mu(c)?i[o]=c:u&&c.fn?(c.scale&&(e.scale=c.scale),i[o]=c.fn.call(null,e,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,e,n):i[o]=c}return i},updateScaleSize:ku};function qu(){return(arguments.length>0&&void 0!==arguments[0]?arguments[0]:[]).reduce(((e,t)=>Array.isArray(t.children)?(e.push(...qu(t.children)),e):(e.push(t),e)),[])}function Du(e,t){let{context:n,data:i,style:r,filter:o,mode:a}=t;const s=e.chart.brush(n),l=i,c=r.active||{},u=r.inactive||{},h=[];Object.keys(c).forEach((e=>{h.push(e)})),Object.keys(u).forEach((e=>{-1===h.indexOf(e)&&h.push(e)}));const d=[];let f=!1;const p=()=>{let t=qu(e.nodes);return"function"==typeof o&&(t=t.filter(o)),t},m=()=>{const e=p(),t=e.length;let n,i=!1;const r="function"==typeof l?l({brush:s}):l;for(let i=0;i<t;i++){if(n=e[i].data,!n)continue;e[i].__style||(e[i].__style={},h.forEach((t=>{e[i].__style[t]=e[i][t]})));const t=s.containsMappedData(n,r,a),o=d.indexOf(e[i]);let l=!1;t&&-1===o?(d.push(e[i]),l=!0):t||-1===o||(d.splice(o,1),l=!0),e[i].needToUpdate=l||f,e[i].isActive=t}for(let r=0;r<t;r++)if(n=e[r].data,n){if(e[r].needToUpdate){const t=Qi({},e[r],e[r].__style),n=e[r].isActive;h.forEach((i=>{e[r][i]=n&&i in c?"function"==typeof c[i]?c[i].call(null,t,d):c[i]:!n&&i in u?"function"==typeof u[i]?u[i].call(null,t,d):u[i]:e[r].__style[i]})),i=!0}delete e[r].needToUpdate}return f=!1,i},g=function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{suppressRender:!1};const{suppressRender:n}=t,i=p(),r=i.length;for(let e=0;e<r;e++)i[e].data&&(i[e].__style=i[e].__style||{},h.forEach((t=>{i[e].__style[t]=i[e][t],t in u&&(i[e][t]="function"==typeof u[t]?u[t].call(null,i[e]):u[t])})));f=!0,d.length=0,n||e.renderer.render(e.nodes)},y=function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{suppressRender:!1};const{suppressRender:n}=t,i=p(),r=i.length;for(let e=0;e<r;e++)i[e].__style&&(Object.keys(i[e].__style).forEach((t=>{i[e][t]=i[e].__style[t]})),i[e].__style=void 0);d.length=0,n||e.renderer.render(e.nodes)},x=()=>{if(m()){const t="function"==typeof e.config.sortNodes?e.config.sortNodes(e):e.nodes;"function"==typeof e.config.customRender?e.config.customRender({render:e.renderer.render,nodes:t}):e.renderer.render(t)}};return s.on("start",g),s.on("end",y),s.on("update",x),{isActive:()=>s.isActive(),update:()=>{d.length=0,f=!0,m()},cleanUp:function(){s.removeListener("start",g),s.removeListener("end",y),s.removeListener("update",x)}}}function Au(e){let{nodes:t,action:n,chart:i,trigger:r}=e;const o=[];for(let e=0;e<t.length;e++){let n=t[e].data;null!==n&&o.push(n)}!function(e){let{dataPoints:t,action:n,chart:i,trigger:r}=e;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 e=0;e<t.length;e++){const n=t[e];n&&o.forEach((e=>{let t=n&&!e?n:n[e];if(t){let e={key:t.source.field};void 0!==t.source.key&&(e.key="".concat(t.source.key,"/").concat(t.source.field)),Array.isArray(t.value)?(e.range={min:t.value[0],max:t.value[1]},a.items.push(e)):(e.value=t.value,s.items.push(e))}}))}r.contexts.forEach((e=>{a.items.length?i.brush(e)[a.actionFn](a.items):i.brush(e)[s.actionFn](s.items)}))}({dataPoints:o,action:n,chart:i,trigger:r})}function Cu(e){let{collisions:t,t:n,config:i,action:r}=e,o=[],a=!1;t.length>0&&(o=t,a=!0,"stop"===n.propagation&&(o=[t[t.length-1]]));const s=o.map((e=>e.node));return Au({nodes:s,action:r,chart:i.chart,data:i.data,trigger:n}),a}function Nu(e,t,n){const i=n.element().getBoundingClientRect();let r=rr(e)?function(e,t){return 1!==e.changedTouches.length?null:{x:e.changedTouches[0].clientX-t.left,y:e.changedTouches[0].clientY-t.top}}(e,i):function(e,t){return{x:e.clientX-t.left,y:e.clientY-t.top}}(e,i);return null===r||r.x<0||r.y<0||r.x>i.width||r.y>i.height?[]:(t.touchRadius>0&&rr(e)?r={cx:r.x,cy:r.y,r:t.touchRadius}:t.mouseRadius>0&&!rr(e)&&(r={cx:r.x,cy:r.y,r:t.mouseRadius}),n.itemsAt(r))}function Eu(e,t,n){return e?"function"==typeof e?e(t):e:n}const Ru={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 Iu(e){let t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],n="";for(let t=0;t<e.length;t++){const i=e[t];n+=0===t?"M".concat(i.x," ").concat(i.y):"L".concat(i.x," ").concat(i.y),n+=" "}return t&&(n+="Z"),n}function Ou(e,t,n,i){const r=n/2,o=e-i/2,a=t-i/2,s=e-r,l=t-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(e){return-e/180*Math.PI}function Lu(e){return function(e){let t=(.5*(Math.floor(e/Math.PI*2)+2)+.25)*Math.PI,n=Math.cos(Math.abs(t-e))*Math.sqrt(2),i=n*Math.cos(e),r=n*Math.sin(e);return{x1:i<0?1:0,y1:r<0?1:0,x2:i>=0?i:i+1,y2:r>=0?r:r+1}}(Pu(e))}function Tu(e,t){return{x:e.x+t.x,y:e.y+t.y}}function zu(e,t){return{x:e.x-t.x,y:e.y-t.y}}function Fu(e,t){return{x:e.x*t,y:e.y*t}}function ju(e,t){return e.x-t.x}function Vu(e,t){return e.y-t.y}function Bu(e,t){return ju(e,t)**2+Vu(e,t)**2}function Hu(e,t){return Math.sqrt(Bu(e,t))}function $u(e,t){return e.x*t.x+e.y*t.y}function Wu(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{x:0,y:0};const i=Math.cos(t),r=Math.sin(t),o=zu(e,n);return Tu({x:i*o.x-r*o.y,y:r*o.x+i*o.y},n)}const Uu={up:0,down:180,left:90,right:-90};function Yu(e){let{x:t,y:n,size:i}=e;const r=i/2;return{type:"rect",x:t-r,y:n-r,width:i,height:i}}const Gu=yo();Gu.add("circle",(function(e){return{type:"circle",fill:"black",cx:e.x,cy:e.y,r:e.size/2}})),Gu.add("diamond",(function(e){const t=e.size,n=e.x-t/2,i=e.y-t/2;return{type:"path",fill:"black",d:Iu([{x:n,y:i+t/2},{x:n+t/2,y:i},{x:n+t,y:i+t/2},{x:n+t/2,y:i+t},{x:n,y:i+t/2}])}})),Gu.add("saltire",(function(e){const t=Pu(45),n=e.size/2,i=isNaN(e.width)?n/2:e.width,r=Math.min(i,n);let o=e.size;const a=Math.sin(Math.asin(-t))*(r/2);o+=2*(n/Math.sin(-t)-n),o-=2*a;const s={x:e.x,y:e.y},l=Ou(e.x,e.y,o,r).map((e=>Wu(e,t,s)));return{type:"path",fill:"black",d:Iu(l)}})),Gu.add("square",(function(e){const t=e.size;return{type:"rect",fill:"black",x:e.x-t/2,y:e.y-t/2,width:t,height:t}})),Gu.add("triangle",(function(e){const t=e.size,n={x:e.x,y:e.y},i=Uu[e.direction]||0,r=t/2,o=e.x-r,a=e.y-r;let s=[{x:o,y:a+t},{x:o+r,y:a},{x:o+t,y:a+t},{x:o,y:a+t}];const l=Pu(i);return s=s.map((e=>Wu(e,l,n))),{type:"path",fill:"black",d:Iu(s)}})),Gu.add("line",(function(e){const t="vertical"===e.direction,n=e.size/2,i=e.x,r=e.y;return{type:"line",stroke:"black",strokeWidth:1,x1:i-(t?0:n),y1:r-(t?n:0),x2:i+(t?0:n),y2:r+(t?n:0),collider:Yu(e)}})),Gu.add("star",(function(e){const t=e.size,n=[],i=t/2,r=e.points||5,o=Math.min(e.innerRadius||t/2,t)/2,a=isNaN(e.startAngle)?90:e.startAngle,s=360/r;for(let t=1;t<=r;t++){const r=s*t+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:e.x+h*i,y:e.y+u*i}),n.push({x:e.x+f*o,y:e.y+d*o})}return{type:"path",fill:"black",d:Iu(n)}})),Gu.add("n-polygon",(function(e){const t=[],n=e.size/2,i=Math.max(isNaN(e.sides)?6:e.sides,3),r=360/i,o=isNaN(e.startAngle)?0:e.startAngle;for(let a=1;a<=i;a++){const i=Pu(r*a+o),s=Math.sin(i),l=Math.cos(i);t.push({x:e.x+l*n,y:e.y+s*n})}return{type:"path",fill:"black",d:Iu(t)}})),Gu.add("cross",(function(e){const t=e.x,n=e.y,i=e.size/2,r=isNaN(e.width)?i/2:e.width,o=Math.min(r,i);return{type:"path",fill:"black",d:Iu(Ou(t,n,e.size,o))}})),Gu.add("bar",(function(e){const t={x:e.x,y:e.y},n="vertical"===e.direction,i=e.size/2,r=i/2/2;let o=[{x:t.x-i,y:t.y+r},{x:t.x-i,y:t.y-r},{x:t.x+i,y:t.y-r},{x:t.x+i,y:t.y+r}];if(n){const e=Pu(90);o=o.map((n=>Wu(n,e,t)))}const a=ur(o);return a.type="rect",a.fill="black",a})),Gu.add("rect",(function(e){const{x:t,y:n,size:i}=e,r=void 0===e.width?i:e.width,o=void 0===e.height?i:e.height;return{type:"rect",fill:"black",x:t-r/2,y:n-o/2,width:r,height:o}}));const Xu=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Gu;return function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const n=e.get(t.type);if(n){const e=n(t);return function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};Object.keys(t).forEach((n=>{void 0!==Ru[n]&&"transform"!==n&&(e[n]=t[n])}))}(e,t),void 0!==t.data&&(e.data=t.data),e}return n}};function Ku(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=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}=e;n=n||"center";return{computePreferredSize(e){let{inner:n,outer:i,children:r}=e;return"function"==typeof o?o({inner:n,outer:i,children:r,dock:this.dock()},t):o},dock(e){return void 0!==e?(n=e,this):"function"==typeof n?n(t):n},displayOrder(e){return void 0!==e?(i=e,this):"function"==typeof i?i(t):i},prioOrder(e){return void 0!==e?(r=e,this):"function"==typeof r?r(t):r},minimumLayoutMode(e){return void 0!==e?(a=e,this):"function"==typeof a?a(t):a},show(e){return void 0!==e?(s=e,this):"function"==typeof s?s(t):s}}}function Zu(e,t,n){const{require:i=[]}=t,r=t.mediator||{},{settings:o,formatter:a,scale:s,data:l,renderer:c,chart:u,dockConfig:h,mediator:d,instance:f,rect:p,style:m,registries:g,resolver:y,update:x,_DO_NOT_USE_getInfo:v,symbol:b,isVisible:w}=n;e.emit=()=>{},w&&(e.isVisible=w),Object.defineProperty(e,"settings",{get:o}),Object.defineProperty(e,"data",{get:l}),Object.defineProperty(e,"formatter",{get:a}),Object.defineProperty(e,"scale",{get:s}),Object.defineProperty(e,"mediator",{get:d}),Object.defineProperty(e,"style",{get:m}),Object.defineProperty(e,"registries",{get:g}),p&&Object.defineProperty(e,"rect",{get:p}),v&&(e._DO_NOT_USE_getInfo=v),Object.keys(t).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((e=>e===i))||("function"==typeof t[n]?e[n]=t[n].bind(e):e[n]=t[n])})),i.forEach((t=>{"renderer"===t?Object.defineProperty(e,"renderer",{get:c}):"chart"===t?Object.defineProperty(e,"chart",{get:u}):"dockConfig"===t?Object.defineProperty(e,"dockConfig",{get:h}):"instance"===t?Object.defineProperty(e,"instance",{get:f}):"update"===t&&x?Object.defineProperty(e,"update",{get:x}):"resolver"===t?Object.defineProperty(e,"resolver",{get:y}):"symbol"===t&&Object.defineProperty(e,"symbol",{get:b})})),Object.keys(r).forEach((t=>{e.mediator.on(t,r[t].bind(e))}))}function Ju(e,t,n){const i=t=>e[t]?(n.warn("Deprecation Warning the ".concat(t," property should be moved into layout: {} property")),e[t]):e.layout?e.layout[t]:void 0,r={};return r.displayOrder=i("displayOrder"),r.dock=i("dock"),r.prioOrder=i("prioOrder"),r.minimumLayoutMode=i("minimumLayoutMode"),e.layout=e.layout||{},e.layout.displayOrder=void 0!==r.displayOrder?r.displayOrder:e.layout.displayOrder,e.layout.prioOrder=void 0!==r.prioOrder?r.prioOrder:e.layout.prioOrder,e.layout.dock=r.dock||e.layout.dock,e.layout.minimumLayoutMode=r.minimumLayoutMode||e.layout.minimumLayoutMode,r.show=e.show,r.preferredSize=t,r}function Qu(e,t,n){Object.keys(n.on||{}).forEach((i=>{e.eventListeners=e.eventListeners||[];const r=n.on[i].bind(e);e.eventListeners.push({event:i,listener:r}),t.on(i,r)})),e.emit=function(e){for(var n=arguments.length,i=new Array(n>1?n-1:0),r=1;r<n;r++)i[r-1]=arguments[r];return t.emit(e,...i)}}function eh(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const{defaultSettings:n={},_DO_NOT_USE_getInfo:i=()=>({})}=e,{chart:r,container:o,mediator:a,registries:s,theme:l,renderer:c}=t,u=Yc.mixin({});let h,d,f,p,m,g=t.settings||{},y=Qi(!0,{},n,g),x=[],v=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:_u,n={};return{resolve:function(i){let{data:r,settings:o,defaults:a={},scaled:s}=i;const l=n.norm=t.normalizeSettings(o,a,e.chart),c={scale:e.chart.scale,formatter:e.chart.formatter};s&&Object.keys(s).forEach((e=>{l[e]&&t.updateScaleSize(l,e,s[e])}));const u=[];if(!r||!Array.isArray(r.items)){const e={data:r,resources:c};let i=t.resolveForItem(e,n.norm,-1);return{settings:n.norm,item:i}}{let e;for(let i=0,o=r.items.length;i<o;i++){e={datum:r.items[i],data:r,resources:c};let o=t.resolveForItem(e,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={},_=Qi({},g);function q(t){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!==e[t],o=void 0!==g[t];let a;for(var s=arguments.length,l=new Array(s),c=0;c<s;c++)l[c]=arguments[c];return r&&("function"==typeof e[t]?a=e[t].call(S,...l):i&&(a=e[t])),o&&("function"==typeof g[t]?a=g[t].call(_,...l):i&&(a=g[t])),r||o||(a=n.call(S,...l)),a}}const D=q("preferredSize",(()=>0),!0),A=q("resize",(e=>{let{inner:t}=e;return t})),C=q("created"),N=q("beforeMount"),E=q("mounted"),R=q("beforeUnmount"),I=q("beforeUpdate"),O=q("updated"),P=q("beforeRender"),L=q("beforeDestroy"),T=q("destroyed"),z=e.render,F=()=>{y.brush&&(y.brush.consume||[]).forEach((e=>{e.context&&e.style&&k.push(Du(w,e))}))},j=()=>{y.brush&&(y.brush.trigger||[]).forEach((e=>{"over"===e.on?M.over.push(e):M.tap.push(e)}))};Object.defineProperty(w,"data",{get:()=>x});const V=y.renderer||e.renderer,B=V?c||s.renderer(V)():c||s.renderer()();"function"==typeof B.settings&&B.settings(y.rendererSettings),w.renderer=B;const H={resources:r.logger?{logger:r.logger()}:{}};let $=Ku(Ju(y,D,r.logger()),H);const W=e=>{e.key=y.key,e.element=B.element()},U=()=>{};U.dockConfig=()=>$,U.set=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(e.settings&&(g=e.settings,y=Qi(!0,{},n,e.settings),$=Ku(Ju(y,D,r.logger()),H),w.config=y.brush||{}),y.scale&&(h=r.scale(y.scale)),y.data){const{rendererSettings:e}=y,t="function"==typeof(null==e?void 0:e.progressive)&&e.progressive(),n=il(y.data,{dataset:r.dataset,collection:r.dataCollection},{logger:r.logger()},r.dataCollection);t?t.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()),m=l.style(y.style||{})},U.resize=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const n=A({inner:e,outer:t});p=n?B.size(n):B.size(e),_.rect=Qi(!0,{computedPhysical:p.computedPhysical,computedOuter:t.computed||t,computedInner:e.computed||e},e),p=Qi(!0,{computedOuter:t.computed||t,computedInner:e.computed||e},p)},U.getRect=()=>_.rect;const Y=()=>{const e=B.renderArgs?B.renderArgs.slice(0):[],{rendererSettings:t}=y;let n=x;const i="function"==typeof(null==t?void 0:t.progressive)&&t.progressive();return x.items&&i&&(n=ir(ir({},x),{},{items:x.items.slice(i.start,i.end)})),e.push({data:n}),e};let G,X,K;function Z(e){const{rendererSettings:t}=y,n="function"==typeof(null==t?void 0:t.progressive)&&t.progressive();n?n.isFirst?w.nodes=[...e||[]]:w.nodes&&(w.nodes=[...w.nodes,...e||[]]):w.nodes=e}U.beforeMount=N,U.beforeRender=()=>{P({size:p})},U.render=()=>{const e=z.call(S,...Y());Z(e),B.render(e),G=e,X=_.rect.computed},U.hide=()=>{U.unmount(),B.size({x:0,y:0,width:0,height:0}),B.clear()},U.beforeUpdate=()=>{I({settings:y,data:x})},U.update=()=>{K&&K.stop();const{rendererSettings:e,brush:t,animations:n}=y;if("function"==typeof(null==e?void 0:e.transform)&&e.transform())return B.render(),void(G=null);const i=z.call(S,...Y());Z(i),k.forEach((e=>e.cleanUp())),k.length=0,M.tap=[],M.over=[],t&&(F(),j()),k.forEach((e=>{e.isActive()&&e.update()})),G&&n&&("function"==typeof n.enabled?n.enabled():n.enabled)?(n.compensateForLayoutChanges&&n.compensateForLayoutChanges({currentNodes:G,currentRect:_.rect.computed,previousRect:X}),K=function(e,t,n,i){let r,{old:o,current:a}=e,{renderer:s}=t,l=[],c={nodes:[],ips:[]},u={nodes:[],ips:[]},h={nodes:[],ips:[]},d=[],f=null;const p=n.trackBy||vu,m={start(){let e={};if(o.forEach(((t,n)=>{let i=p(t,n);e[i]=t})),a.forEach(((t,n)=>{let i=p(t,n);if(e[i]){if("path"===t.type&&t.points&&t.points.length>0&&"trend"!==t.data.source.key){const n=function(e,t){const n=e.points.filter((e=>!e.dummy)),i=t.points.filter((e=>!e.dummy)),r=i.map((e=>e.data.major.value)),o=n.filter((e=>r.includes(e.data.major.value))).map((e=>e.data.major.value)),a=n.filter((e=>o.includes(e.data.major.value))),s=i.filter((e=>o.includes(e.data.major.value)));return{old:a,current:s}}(e[i],t);h.ips.push(xu(Qi({},e[i],{points:n.old}),Qi({},t,{points:n.current}))),l.push(Qi({},e[i],{commonPoints:n.old}))}else h.ips.push(xu(e[i],t)),l.push(e[i]);h.nodes.push(t),e[i]=!1}else c.nodes.push(t),c.ips.push(xu(Qi({},t,{r:.001,opacity:0}),t))})),Object.keys(e).forEach((t=>{e[t]&&(u.nodes.push(e[t]),u.ips.push(xu(e[t],Qi({},e[t],{r:1e-4,opacity:0}))))})),d.push({name:"exiting",easing:du,duration:200,tweens:u.ips,nodes:[...l]}),d.push({name:"updating",easing:pu,duration:400,tweens:h.ips,nodes:[]}),d.push({name:"entering",easing:fu,duration:200,tweens:c.ips,nodes:[...h.nodes]}),n.isMainComponent){var t;const e=null===(t=n.isMainComponent)||void 0===t?void 0:t.filterFn,r=e?l.filter(e).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(m.tick)))},tick(){let e=d[0];e||m.stop(),e.started||(e.started=Date.now());let t=(Date.now()-e.started)/e.duration,o=[],a=e.tweens.map((n=>n(e.easing(Math.min(1,t)))));const{adjustTweenedNodes:l}=n;if(l&&l(a),o.push(...a),o.push(...e.nodes),s.render(o),t>=1){d.shift();const{isInit:e,shouldBeRemoved:t}=i.getValue("animations.updatingStageMeta");d.length?"updating"===d[0].name&&t&&d.shift():(!0===e&&i.setValue("animations.updatingStageMeta.isInit",!1),m.stop())}r&&(r=window.requestAnimationFrame(m.tick))},stop(){r&&(window.cancelAnimationFrame(r),r=!1)},inProgress:()=>!!r,get targetScene(){return f}};return m}({old:G,current:i},{renderer:B},n,r.storage),K.start()):B.render(i),G=i,X=_.rect.computed,B.setKey&&"string"==typeof g.key&&B.setKey(g.key)},U.updated=O,U.destroy=()=>{U.unmount(),L(f),B.destroy(),T(),f=null};const J=e=>{w.nodes=e,k.forEach((e=>{e.isActive()&&e.update()})),B.render(e)};return Zu(S,e,{settings:()=>y,data:()=>x,scale:()=>h,formatter:()=>d,renderer:()=>B,chart:()=>r,dockConfig:()=>$,mediator:()=>a,instance:()=>_,rect:()=>_.rect,style:()=>m,update:()=>J,registries:()=>s,resolver:()=>v,symbol:()=>Xu(s.symbol)}),Zu(_,g,{settings:()=>y,data:()=>x,scale:()=>h,formatter:()=>d,renderer:()=>B,chart:()=>r,dockConfig:()=>$,mediator:()=>a,style:()=>m,_DO_NOT_USE_getInfo:i.bind(S),isVisible:()=>b}),U.getBrushedShapes=function(e,t,n){const i=[];if(y.brush&&y.brush.consume){const o=r.brush(e),a=B.findShapes("*");y.brush.consume.filter((t=>t.context===e)).forEach((e=>{for(let r=0;r<a.length;r++){const s=a[r];s.data&&o.containsMappedData(s.data,n||e.data,t)&&(W(s),i.push(s),a.splice(r,1),r--)}}))}return i},U.findShapes=e=>{var t;const n=(null!==(t=K)&&void 0!==t&&t.inProgress()?K.targetScene:B).findShapes(e);for(let e=0,t=n.length;e<t;e++)W(n[e]);return n},U.shapesAt=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const n=B.itemsAt(e);let i;i=t&&"stop"===t.propagation&&n.length>0?[n.pop().node]:n.map((e=>e.node));for(let e=0,t=i.length;e<t;e++)W(i[e]);return i},U.brushFromShapes=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};t.contexts=Array.isArray(t.contexts)?t.contexts:[];Au({nodes:e,action:t.action||"toggle",trigger:t,chart:r,data:w.data})},U.mount=()=>{f=B.element&&B.element()?f:B.appendTo(o),B.setKey&&"string"==typeof g.key&&B.setKey(g.key),y.brush&&(F(),j()),Qu(_,u,g),Qu(S,u,e),b=!0},U.mounted=()=>E(f),U.unmount=()=>{[_,S].forEach((e=>{!function(e,t){e.eventListeners&&(e.eventListeners.forEach((e=>{let{event:n,listener:i}=e;t.removeListener(n,i)})),e.eventListeners.length=0),e.emit=()=>{}}(e,u)})),M.tap=[],M.over=[],k.forEach((e=>{e.cleanUp()})),k.length=0,R(),b=!1},U.onBrushTap=e=>{M.tap.forEach((t=>{(function(e){let{e:t,t:n,config:i}=e;return Cu({collisions:Nu(t,n,i.renderer),t:n,config:i,action:Eu(n.action,t,"toggle")})})({e:e,t:t,config:w})&&"stop"===t.globalPropagation&&r.toggleBrushing(!0)}))},U.onBrushOver=e=>{M.over.forEach((t=>{(function(e){let{e:t,t:n,config:i}=e;return Cu({collisions:Nu(t,n,i.renderer),t:n,config:i,action:Eu(n.action,t,"set")})})({e:e,t:t,config:w})&&"stop"===t.globalPropagation&&r.toggleBrushing(!0)}))},U.def=S,U.ctx=_,U.renderer=()=>B,U.set({settings:g}),C(),U}function th(e){const t=Qi(!0,{},e),n={getAll:()=>t,getValue:(e,n)=>function(e,t,n){if(void 0===e||void 0===t)return n;const i=t.split(".");let r=e;for(let e=0;e<i.length;++e){const t=i[e];if(void 0===r[t])return n;r=r[t]}return r}(t,e,n),setValue:(e,n)=>function(e,t,n){if(void 0===e||void 0===t)return;const i=t.split("."),r=i[i.length-1];let o=e;for(let e=0;e<i.length-1;++e){const t=i[e];void 0===o[t]&&(o[t]=Number.isNaN(+i[e+1])?{}:[]),o=o[t]}void 0!==n?o[r]=n:delete o[r]}(t,e,n)};return n}function nh(e,t,n){const i=Tu(function(e,t){const n=$u(e,t)/$u(t,t)||1;return{x:t.x*n,y:t.y*n}}(zu(n,e),zu(t,e)),e);return i}function ih(e,t,n){return Hu(e,n)+Hu(t,n)-Hu(e,t)<1e-12}function rh(e,t){return e.x>=t.x&&e.x+e.width<=t.x+t.width&&e.y>=t.y&&e.y+e.height<=t.y+t.height}function oh(e){return e.x1===e.x2&&e.y1===e.y2}function ah(e){return e.width<=0||e.height<=0}function sh(e){return e.r<=0}function lh(e){return e.edges.length<=2}function ch(e,t){let n=!1;for(let i=0,r=t.edges.length;i<r;i++)if(n=gh(e,hr(t.edges[i])),!0===n)return!0;return!1}function uh(e,t){let n=!1;const{numPolygons:i,polygons:r}=t;for(let t=0;t<i;t++){if(n=_h(e,r[t]),!0===n)return!0}return!1}function hh(e,t){if(sh(e))return!1;return Bu({x:e.cx,y:e.cy},t)<=e.r**2}function dh(e,t){if(ah(t)||sh(e))return!1;const n=t.width/2,i=t.height/2,r=t.x+n,o=t.y+i,a=e.r,s=e.cx,l=e.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 fh(e,t){if(sh(e)||oh(t))return!1;const[n,i]=lr(t);if(hh(e,n)||hh(e,i))return!0;const r={x:e.cx,y:e.cy},o=nh(n,i,r);return Bu(o,r)<=e.r**2&&ih(n,i,o)}function ph(e,t){if(lh(t)||sh(e))return!1;if(mh(t,{x:e.cx,y:e.cy}))return!0;const n=t.edges.length;for(let i=0;i<n;i++){if(fh(e,hr(t.edges[i])))return!0}return!1}function mh(e,t){if(lh(e)||!bh(e.boundingRect(),t))return!1;const{x:n,y:i}=t,r=e.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 gh(e,t){if(lh(e))return!1;for(let n=0,i=e.edges.length;n<i;n++){if(Mh(t,hr(e.edges[n])))return!0}const[n,i]=lr(t);return mh(e,n)||mh(e,i)}function yh(e,t){if(lh(e))return!1;for(let n=0,i=e.edges.length;n<i;n++){if(wh(t,hr(e.edges[n])))return!0}const[n,i,r,o]=cr(t);return mh(e,n)||mh(e,i)||mh(e,r)||mh(e,o)}function xh(e,t){return!ah(e)&&!ah(t)&&(e.x<=t.x+t.width&&t.x<=e.x+e.width&&e.y<=t.y+t.height&&t.y<=e.y+e.height)}function vh(e,t){if(ah(e)||ah(t))return!1;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}].every((t=>bh(e,t)))}function bh(e,t){return!ah(e)&&(t.x>=e.x&&t.x<=e.x+e.width&&t.y>=e.y&&t.y<=e.y+e.height)}function wh(e,t){if(oh(t)||ah(e))return!1;const[n,i]=lr(t);if(bh(e,n)||bh(e,i))return!0;const r=cr(e);let o=r.length;for(let e=0;e<o;e++){if(Mh(hr([r[e],r[3!==e?e+1:0]]),t))return!0}return!1}function Mh(e,t){const[n,i]=lr(e),[r,o]=lr(t),a=ju(i,n),s=Vu(i,n),l=ju(o,r),c=Vu(o,r),u=ju(n,r),h=Vu(n,r);let d=c*a-l*s;const f=l*h-c*u,p=a*h-s*u;let m,g;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;m=Vu(r,n)/s,g=Vu(o,n)/s}else m=(r.x-n.x)/a,g=(o.x-n.x)/a;return!(m<0&&g<0||m>1&&g>1)}return!1}const y=f/d;return d=p/d,y>=0&&y<=1&&d>=0&&d<=1}function kh(e,t){if(oh(e))return!1;const[n,i]=lr(e);return ih(n,i,t)}function Sh(e,t){const n=e.boundingRect(),i=t.boundingRect();return!!xh(n,i)&&(vh(n,i)?ch(e,t):ch(t,e))}function _h(e,t){const n=e.boundingRect(),i=t.boundingRect();return!!xh(n,i)&&(vh(i,n)?function(e,t){let n=!1;const{numPolygons:i,polygons:r}=e;for(let e=0;e<i;e++)if(n=Sh(t,r[e]),!0===n)return!0;return!1}(e,t):function(e,t){let n=!1;for(let i=0,r=t.edges.length;i<r;i++)if(n=Ah(e,hr(t.edges[i])),!0===n)return!0;return!1}(e,t))}function qh(e,t){if(sh(e))return!1;if(Dh(t,{x:e.cx,y:e.cy}))return!0;const{numPolygons:n,polygons:i}=t;for(let t=0;t<n;t++){const n=i[t],r=n.edges.length;for(let t=0;t<r;t++){if(fh(e,hr(n.edges[t])))return!0}}return!1}function Dh(e,t){if(!bh(e.boundingRect(),t))return!1;const{x:n,y:i}=t,r=e.numPolygons;let o,a,s,l,c,u,h=!1;for(a=0;a<r;a++)for(o=e.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 Ah(e,t){const[n,i]=lr(t);if(Dh(e,n)||Dh(e,i))return!0;const{numPolygons:r,polygons:o}=e;for(let e=0;e<r;e++){const n=o[e];for(let e=0,i=n.edges.length;e<i;e++){if(Mh(t,hr(n.edges[e])))return!0}}return!1}function Ch(e,t){const[n,i,r,o]=cr(t);if(Dh(e,n)||Dh(e,i)||Dh(e,r)||Dh(e,o))return!0;const{numPolygons:a,polygons:s}=e;for(let e=0;e<a;e++){const n=s[e];for(let e=0,i=n.edges.length;e<i;e++){if(wh(t,hr(n.edges[e])))return!0}}return!1}const Nh=/^\$/,Eh="@extend";function Rh(e){throw new Error('Cyclical reference for "'.concat(e,'"'))}function Ih(e,t,n){if("string"==typeof e){let i=t[e];return-1!==n.indexOf(e)&&Rh(e),Nh.test(i)?(n.push(e),Ih(i,t,n)):i}let i=e;const r=Qi(!0,{},t,e),o={};if(e[Eh]){const o=e[Eh];-1!==n.indexOf(o)&&Rh(o);let a=n.slice();a.push(o),i=Qi(!0,{},Ih(r[o],t,a),e)}return Object.keys(i).forEach((e=>{let t=n.slice();if(e===Eh||Nh.test(e))return;o[e]=i[e];let a=o[e];Nh.test(a)&&a in r?(-1!==n.indexOf(a)&&Rh(a),t.push(a),a=r[a],"object"==typeof a||Nh.test(a)&&a in r?o[e]=Ih(a,r,t):o[e]=a):"object"==typeof a&&(o[e]=Ih(a,r,t))})),o}function Oh(e,t){return Ih(e,t,[])}function Ph(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t={},n=e;const i=e=>{e.forEach((e=>{const n=Array.isArray(e.colors[0])?e.colors:[e.colors];t[e.key]={colors:n,sizes:n.map((e=>e?e.length:0))}}))},r={palette:(e,n)=>((e,n)=>{const i=t[e];if(!i)return[];const r=i.sizes;for(let e=0;e<r.length;e++)if(n<=r[e])return i.colors[e];return i.colors[r.length-1]})(e,n),setPalettes:i,style:e=>Oh(e,n),setStyle:t=>{n=Qi({},e,t)}};return i(arguments.length>1&&void 0!==arguments[1]?arguments[1]:[]),r}function Lh(e){e.x=Math.floor(e.x),e.y=Math.floor(e.y),e.width=Math.floor(e.width),e.height=Math.floor(e.height)}function Th(e){const t={center:{minWidthRatio:.5,minHeightRatio:.5,minWidth:0,minHeight:0}};return Qi(!0,t,e),t.center.minWidthRatio=Math.min(Math.max(t.center.minWidthRatio,0),1),t.center.minHeightRatio=Math.min(Math.max(t.center.minHeightRatio,0),1),t.center.minWidth=Math.max(t.center.minWidth,0),t.center.minHeight=Math.max(t.center.minHeight,0),t}function zh(e,t,n,i,r){return{x:isNaN(e)?0:e,y:isNaN(e)?0:t,width:isNaN(e)?0:n,height:isNaN(e)?0:i,margin:isNaN(r)?0:r}}function Fh(e,t,n){if(void 0===e.cachedSize){const i=e.config.dock();let r,o=e.comp.preferredSize({inner:t,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),e.cachedSize=Math.ceil(r),e.edgeBleed=o.edgeBleed||0}return e.cachedSize}function jh(e,t){switch(t.config.dock()){case"top":e.y+=t.cachedSize,e.height-=t.cachedSize;break;case"bottom":e.height-=t.cachedSize;break;case"left":e.x+=t.cachedSize,e.width-=t.cachedSize;break;case"right":e.width-=t.cachedSize}}function Vh(e,t){const n=t.edgeBleed;n&&(e.left=Math.max(e.left,n.left||0),e.right=Math.max(e.right,n.right||0),e.top=Math.max(e.top,n.top||0),e.bottom=Math.max(e.bottom,n.bottom||0))}function Bh(e,t,n){t.x<n.left&&(t.width-=n.left-t.x,t.x=n.left);const i=e.width-(t.x+t.width);i<n.right&&(t.width-=n.right-i),t.y<n.top&&(t.height-=n.top-t.y,t.y=n.top);const r=e.height-(t.y+t.height);r<n.bottom&&(t.height-=n.bottom-r)}function Hh(e,t,n,i,r){const o=Qi({},t),a=Qi({},n);jh(o,i),Vh(a,i),Bh(e,o,a);const s=function(e,t,n){const i=Math.min(n.center.minWidth,e.width)||Math.max(e.width*n.center.minWidthRatio,1),r=Math.min(n.center.minHeight,e.height)||Math.max(e.height*n.center.minHeightRatio,1);return t.width>=i&&t.height>=r}(e,o,r);return!!s&&(jh(t,i),Vh(n,i),!0)}function $h(e){return{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}}function Wh(e){return ur([].concat(...e.map(cr)))}function Uh(e){let{visible:t,layoutRect:n,reducedRect:i,containerRect:r,translation:o}=e;const a=zh(i.x,i.y,i.width,i.height),s=zh(i.x,i.y,i.width,i.height),l={},c=t.slice(),u=c.slice().sort(((e,t)=>e.config.displayOrder()-t.config.displayOrder()));return t.sort(((e,t)=>{if(e.referencedDocks.length>0&&t.referencedDocks.length>0)return 0;if(t.referencedDocks.length>0)return-1;if(e.referencedDocks.length>0)return 1;const n=e.config.displayOrder()-t.config.displayOrder();return 0===n?c.indexOf(e)-c.indexOf(t):n})).forEach((e=>{let t={},c={};switch(e.config.dock()){case"top":t.height=c.height=e.cachedSize,t.width=n.width,c.width=a.width,t.x=n.x,c.x=a.x,t.y=c.y=a.y-e.cachedSize,a.y-=e.cachedSize,a.height+=e.cachedSize;break;case"bottom":t.x=n.x,c.x=a.x,t.y=c.y=a.y+a.height,t.width=n.width,c.width=a.width,t.height=c.height=e.cachedSize,a.height+=e.cachedSize;break;case"left":t.x=c.x=s.x-e.cachedSize,t.y=n.y,c.y=s.y,t.width=c.width=e.cachedSize,t.height=n.height,c.height=s.height,s.x-=e.cachedSize,s.width+=e.cachedSize;break;case"right":t.x=c.x=s.x+s.width,t.y=n.y,c.y=s.y,t.width=c.width=e.cachedSize,t.height=n.height,c.height=s.height,s.width+=e.cachedSize;break;case"center":t.x=c.x=i.x,t.y=c.y=i.y,t.width=c.width=i.width,t.height=c.height=i.height;break;default:if(e.referencedDocks.length>0){const n=e.referencedDocks.map((e=>l[e])).filter((e=>!!e));n.length>0&&(t=Wh(n.map((e=>e.outerRect))),c=Wh(n.map((e=>e.r))))}}e.key&&(l[e.key]={r:c,outerRect:t}),function(e,t,n,i){const r={x:i.width/n.width,y:i.height/n.height},o={left:0,top:0};if(n.preserveAspectRatio){const e=r.x<r.y,t=Math.min(r.x,r.y);r.x=t,r.y=t;const a=e?"height":"width",s=(i[a]-n[a]*r.x)*n.align;o.left=e?0:s,o.top=e?s:0}e.scaleRatio=r,e.margin=o,t.scaleRatio=r,t.margin=o,n.scaleRatio=r,n.margin=o}(c,t,n,r),c.edgeBleed=e.edgeBleed,c.computed=$h(c),t.edgeBleed=e.edgeBleed,t.computed=$h(t),c.x+=o.x,c.y+=o.y,t.x+=o.x,t.y+=o.y,e.comp.resize(c,t),e.cachedSize=void 0,e.edgeBleed=void 0})),u}function Yh(e,t,n){const i=e.layoutModes||{},r=t.minimumLayoutMode();let o=t.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 Gh(e){if(!e.resize||"function"!=typeof e.resize)throw new Error("Component is missing resize function");if(!e.dockConfig&&!e.preferredSize)throw new Error("Component is missing preferredSize function")}function Xh(e){let t=Th(e);const n={};return n.layout=function(e){let n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];if(!e||isNaN(e.x)||isNaN(e.y)||isNaN(e.width)||isNaN(e.height))throw new Error("Invalid rect");if(!n.length)return{visible:[],hidden:[],ordered:[]};const{logicalContainerRect:i,containerRect:r}=function(e,t){const n={x:0,y:0,width:0,height:0},i={x:0,y:0,width:0,height:0};return n.width=e.width||0,n.height=e.height||0,void 0!==t.size&&(n.width=isNaN(t.size.width)?n.width:t.size.width,n.height=isNaN(t.size.height)?n.height:t.size.height),void 0!==t.logicalSize?(i.width=isNaN(t.logicalSize.width)?n.width:t.logicalSize.width,i.height=isNaN(t.logicalSize.height)?n.height:t.logicalSize.height,i.align=isNaN(t.logicalSize.align)?.5:Math.min(Math.max(t.logicalSize.align,0),1),i.preserveAspectRatio=t.logicalSize.preserveAspectRatio):(i.width=n.width,i.height=n.height,i.preserveAspectRatio=!1),Lh(i),Lh(n),{logicalContainerRect:i,containerRect:n}}(e,t),[o,a]=function(e,t,n){const i=[],r=[];for(let o=0;o<e.length;++o){const a=e[o];Gh(a);let s=a.dockConfig;const l=a.key,c=s.dock(),u=/@/.test(c)?c.split(",").map((e=>e.replace(/^\s*@/,""))):[];Yh(t,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,t,i),s=function(e){let{layoutRect:t,visible:n,hidden:i,settings:r}=e;const o=zh(t.x,t.y,t.width,t.height),a={left:0,right:0,top:0,bottom:0},s=n.slice();s.sort(((e,t)=>e.config.prioOrder()-t.config.prioOrder()));for(let e=0;e<s.length;++e){const n=s[e];Fh(n,o,t),Hh(t,o,a,n,r)||(i.push(s.splice(e,1)[0]),--e)}!function(e,t){if(0!==t.length)for(let n=0;n<e.length;++n){let i=e[n];if(i.referencedDocks.length){const r=i.referencedDocks.every((e=>t.some((t=>t.key===e))));r&&t.push(e.splice(n,1)[0])}}}(n,i);const l=n.filter((e=>-1!==s.indexOf(e)));return n.length=0,n.push(...l),Bh(t,o,a),o}({layoutRect:i,visible:o,hidden:a,settings:t}),l=Uh({visible:o,layoutRect:i,reducedRect:s,containerRect:r,translation:{x:e.x,y:e.y}});return a.forEach((e=>{e.comp.visible=!1;const t=zh();e.comp.resize(t,t)})),{visible:o.map((e=>e.comp)),hidden:a.map((e=>e.comp)),ordered:l.map((e=>e.comp))}},n.settings=function(e){t=Th(e)},n}const Kh=(e,t)=>{for(let n=0;n<e.length;n++){const i=e[n];if(i.hasKey&&i.key===t)return e[n]}return null},Zh=e=>null==e?void 0:e.map((e=>{const t=e.instance.dockConfig();return{preferredSize:n=>t.computePreferredSize(ir(ir({},n),{},{children:Zh(e.children)}))}})),Jh=(e,t)=>({visible:[],hidden:t,ordered:[]}),Qh=e=>(t,n)=>{var i;const r=n.map(((e,t)=>{const n=e.instance.dockConfig();return{index:t,key:e.key,dockConfig:n,resize:e.instance.resize,preferredSize:t=>n.computePreferredSize(ir(ir({},t),{},{children:Zh(e.children)}))}})),o=e=>n[e.index],{visible:a=r,hidden:s=[],ordered:l=a}=null!==(i=e(t,r))&&void 0!==i?i:{};return{visible:a.map(o),hidden:s.map(o),ordered:l.map(o)}},ed=e=>"function"==typeof e?Qh(e):(e=>{const t=Xh(e);return Qh(((e,n)=>t.layout(e,n)))})(e);function td(e,t,n){const i=t.left-n.left,r=t.top-n.top,o=dr(e),a=Qi(!0,{},e);switch(o){case"circle":a.cx+=i,a.cy+=r;break;case"polygon":for(let e=0,t=a.vertices.length;e<t;e++){const t=a.vertices[e];t.x+=i,t.y+=r}break;case"geopolygon":for(let e=0;e<a.vertices.length;e++){const t=a.vertices[e];for(let e=0,n=t.length;e<n;e++){const n=t[e];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 nd(e,t){const n=[];let i=0;t.forEach((e=>{n.push(i),i++;const t=e.instance.def.additionalElements&&e.instance.def.additionalElements();t&&(i+=t.length)})),t.forEach(((t,i)=>((e,t,n)=>{const i=t.instance.renderer().element();if(isNaN(n)||!i||!e||!e.children)return;const r=e.children[Math.max(0,n)];if(i===r)return;const o=t.instance.def.additionalElements&&t.instance.def.additionalElements().filter(Boolean);e.insertBefore&&void 0!==r?(e.insertBefore(i,r),o&&o.forEach((t=>{e.insertBefore(t,i)}))):(o&&o.forEach((t=>{e.appendChild(t,i)})),e.appendChild(i))})(e,t,n[i])))}function id(e,t){let{element:n,data:i=[],settings:r={},on:o={}}=e;const a=t.registries,s=t.logger,l=Ph(t.style,t.palettes),c=[],u=Qi({},e),h=function(){const e={};return Yc.mixin(e),e}();let d=[],f=null,p=null,m=null,g=[],y=()=>{},x=()=>{};const v={};let b=!1;const w=function(e){let{createComponent:t}=e;const n={};let i=[],r=[];const o=e=>{const n=t(e);return n&&(i.push(n),e.components&&(n.children=e.components.map((e=>o(e))).filter((e=>!!e)))),n},a=e=>{const t=i.indexOf(e);-1!==t&&i.splice(t,1)},s=(e,t)=>{for(let n=e.length-1;n>=0;n--){const i=e[n],r=t.find((e=>i.hasKey&&i.key===e.key));r?i.children&&r.components&&s(i.children,r.components):(e.splice(n,1),a(i),i.children&&s(i.children,[]),i.instance.destroy())}},l=e=>{let{compList:t,data:n,excludeFromUpdate:i,formatters:r,scales:a,settingsList:s}=e;return s.map((e=>{const s=Kh(t,e.key);return i.indexOf(e.key)>-1?(delete s.updateWith,s):s?(e.rendererSettings&&"function"==typeof s.instance.renderer().settings&&s.instance.renderer().settings(e.rendererSettings),e.rendererSettings&&"function"==typeof e.rendererSettings.transform&&e.rendererSettings.transform()?(s.applyTransform=!0,s):(s.updateWith={formatters:r,scales:a,data:n,settings:e},e.components&&(s.children=l({compList:s.children||[],data:n,excludeFromUpdate:i,formatters:r,scales:a,settingsList:e.components})),s)):o(e)})).filter((e=>!!e))},c=e=>{let{components:t,hidden:n,layoutFn:i,ordered:r,rect:o,visible:a}=e;const{visible:s,hidden:l,ordered:u}=i(o,t);a.push(...s),n.push(...l),r.push(...u),s.forEach((e=>{if(e.children){var t,i;const o=ed(null!==(t=null===(i=e.settings)||void 0===i?void 0:i.strategy)&&void 0!==t?t:{});c({components:e.children,hidden:n,layoutFn:o,ordered:r,rect:e.instance.getRect(),visible:a})}})),l.forEach((e=>{e.children&&c({components:e.children,hidden:n,layoutFn:Jh,ordered:r,rect:null,visible:a})}))};return n.destroy=()=>{i.forEach((e=>e.instance.destroy())),i=[],r=[]},n.findComponentByKey=e=>Kh(i,e),n.forEach=e=>{i.forEach(e)},n.layout=e=>{let{layoutSettings:t,rect:n}=e;const i=[],o=[],a=[],s=ed(t);return c({components:r,hidden:o,layoutFn:s,ordered:a,rect:n,visible:i}),{visible:i,hidden:o,ordered:a}},n.set=e=>{let{components:t}=e;r=t.map((e=>o(e))).filter((e=>!!e))},n.update=e=>{let{components:t,data:n,excludeFromUpdate:i,formatters:o,scales:a}=e;s(r,t),r=l({compList:r,data:n,excludeFromUpdate:i,formatters:o,scales:a,settingsList:t})},n}({createComponent:e=>{if(!a.component.has(e.type))return s.warn("Unknown component: ".concat(e.type)),!1;return{instance:eh(a.component(e.type),{settings:e,chart:u,mediator:h,registries:a,theme:l,container:n}),settings:Qi(!0,{},e),key:e.key,hasKey:void 0!==e.key}}});function M(t){let n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:()=>{};return function(){const i="function"==typeof e[t];let r;for(var o=arguments.length,a=new Array(o),s=0;s<o;s++)a[s]=arguments[s];return r=i?e[t].call(u,...a):n.call(u,...a),r}}const k=()=>{let e;r.dockLayout?(s.warn('Deprecation Warning: "dockLayout" property should be renamed to "strategy"'),e=r.dockLayout):e=r.strategy;const t=function(e){if("function"==typeof e.getBoundingClientRect){const{width:t,height:n}=e.getBoundingClientRect();return{x:0,y:0,width:t,height:n}}return{x:0,y:0,width:0,height:0}}(n);return w.layout({layoutSettings:e,rect:t})},S=M("created"),_=M("beforeMount"),q=M("mounted"),D=M("beforeUpdate"),A=M("updated"),C=M("beforeRender"),N=M("beforeDestroy"),E=M("destroyed"),R=function(e,t){let{partialData:n}=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const{formatters:i={},scales:r={},scroll:o={}}=t;y=function(e,t){let{types:n,logger:i}=t;const r={},o=[];return Array.isArray(e)?o.push(...e):(i.warn('Deprecated: "data-source" configuration"'),o.push(e)),o.forEach(((e,t)=>{let o=n(e.type);if(o){let n=e.key;void 0===e.key&&(i.warn("Missing key for dataset. Using index '".concat(t,"' as key.")),n=t);let a=o({key:n,data:e.data,config:e.config});r[n]=a}})),e=>e?r[e]:r[Object.keys(r)[0]]}(e,{logger:s,types:a.data}),n||Object.keys(v).forEach((e=>v[e].clear())),t.palettes&&l.setPalettes(t.palettes),t.style&&l.setStyle(t.style),x=function(e,t,n){let i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:il;const r={};return(e||[]).forEach((e=>{if(!e.key)throw new Error('Data collection is missing "key" property');if("object"==typeof e.data&&"collection"in e.data)throw new Error("Data config for collections may not reference other collections");r[e.key]=()=>i(e.data,t,n)})),e=>{let t,n;if("string"==typeof e?t=e:"object"==typeof e&&(t=e.key,n=e),!(t in r))throw new Error("Unknown data collection: ".concat(t));"function"==typeof r[t]&&(r[t]=r[t]());let i=r[t];if(n&&n.fields&&n.fields.filter){let e=i.fields.filter(n.fields.filter);i.fields.length!==e.length&&(i=Qi(i,{fields:e}))}return i}}(t.collections,{dataset:y},{logger:s});const c={theme:l,logger:s};f=function(e,t,n){let i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:Hc;const r={};return{get(o){let a;return"string"==typeof o&&e[o]?a=o:"object"==typeof o&&"scale"in o&&e[o.scale]&&(a=o.scale),a?(r[a]=r[a]||i(e[a],t,n),r[a]):i(o,t,n)},all(){return Object.keys(e).forEach(this.get),r}}}(r,{dataset:y,collection:x},ir(ir({},c),{},{scale:a.scale})),p=function(e,t,n){let i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:rl;const r={};return{get(o){let a;return"string"==typeof o&&e[o]?a=o:"object"==typeof o&&"formatter"in o&&e[o.formatter]?a=o.formatter:"object"==typeof o&&"type"in o&&e[o.type]&&(a=o.type),a?(r[a]=r[a]||i(e[a],t,n),r[a]):i(o||{},t,n)},all(){return Object.keys(e).forEach(this.get),r}}}(i,{dataset:y,collection:x},ir(ir({},c),{},{formatter:a.formatter})),m=function(e,t){const n={};for(const i in e)Object.prototype.hasOwnProperty.call(e,i)&&(n[i]=Xc(e[i],t?t[i]:null));return n}(o,m)};function I(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];const t={},i=e.filter((e=>!!e.key)).map((e=>e.key));g.forEach((e=>{e.key&&-1!==i.indexOf(e.key)?t[e.key]=e:e.destroy()})),g=e.map((e=>{const i=e.key&&t[e.key]?t[e.key]:a.interaction(e.type)(u,h,n);return i.set(e),i}))}const O=e=>{const t=n.getBoundingClientRect(),i="clientX"in e?e.clientX:e.x,r="clientY"in e?e.clientY:e.y,o={x:i-t.left,y:r-t.top},a=[];return d.forEach((e=>{const t=e.instance.getRect();bh(t.computedPhysical?t.computedPhysical:{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},o)&&a.push(e)})),a},P=()=>{if(c.length||!n)return;Object.keys(o).forEach((e=>{const t=o[e].bind(u);n.addEventListener(e,t),c.push({key:e,listener:t})}));const e={},t=t=>{t.touches?(e.x=t.touches[0].clientX,e.y=t.touches[0].clientY,e.multiTouch=t.touches.length>1):(e.x=t.clientX,e.y=t.clientY,e.multiTouch=!1),e.time=Date.now(),e.comps=O(e)},i=t=>{const n=e.comps||O(t);if(!n.every((e=>e.instance.def.disableTriggers))&&("touchend"===t.type&&t.preventDefault(),function(e,t){const n=rr(e),i=n?e.changedTouches[0]:e,r=Date.now()-t.time,o=isNaN(t.x)?0:Math.abs(i.clientX-t.x),a=isNaN(t.y)?0:Math.abs(i.clientY-t.y);return(0===e.button||n)&&!t.multiTouch&&o<=12&&a<=12&&r<=300}(t,e)))for(let e=n.length-1;e>=0;e--){if(n[e].instance.onBrushTap(t),b){b=!1;break}}},r=[];r.push({key:"mousedown",listener:t}),r.push({key:"mouseup",listener:i}),function(e){return"ontouchstart"in e&&"ontouchend"in e||navigator.maxTouchPoints>1}(n)&&(r.push({key:"touchstart",listener:t}),r.push({key:"touchend",listener:i})),r.push({key:"mousemove",listener:e=>{const t=O(e);for(let n=t.length-1;n>=0;n--){if(t[n].instance.onBrushOver(e),b){b=!1;break}}}}),r.forEach((e=>{n.addEventListener(e.key,e.listener),c.push(e)}))},L=()=>{c.forEach((e=>{let{key:t,listener:i}=e;return n.removeEventListener(t,i)})),c.length=0},T=()=>{n.innerHTML="",(()=>{const{components:e=[]}=r;C(),R(i,r),w.set({components:e});const{visible:t,hidden:o,ordered:a}=k();d=t,o.forEach((e=>{e.instance.hide(),e.visible=!1})),t.forEach((e=>e.instance.beforeMount())),t.forEach((e=>e.instance.mount())),t.forEach((e=>e.instance.beforeRender())),t.forEach((e=>e.instance.render())),t.forEach((e=>e.instance.mounted())),t.forEach((e=>{e.visible=!0})),nd(n,a)})(),P(),I(r.interactions)};return u.layoutComponents=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const{excludeFromUpdate:t=[]}=e;e.data&&(i=e.data),e.settings&&(r=e.settings,I(e.settings.interactions)),D(),R(i,r);const{formatters:n,scales:o,components:a=[]}=r;w.update({components:a,data:i,excludeFromUpdate:t,formatters:n,scales:o}),w.forEach((e=>{e.updateWith&&e.instance.set(e.updateWith)})),w.forEach((e=>{e.updateWith&&e.instance.beforeUpdate()})),k()},u.update=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const{partialData:t,excludeFromUpdate:o=[]}=e;let a;e.data&&(i=e.data),e.settings&&(r=e.settings,I(e.settings.interactions)),D(),R(i,r,{partialData:t});const{formatters:s,scales:l,components:c=[]}=r;w.update({components:c,data:i,excludeFromUpdate:o,formatters:s,scales:l}),w.forEach((e=>{e.updateWith&&e.instance.set(e.updateWith)})),w.forEach((e=>{e.updateWith&&e.instance.beforeUpdate()}));const u=[],h=[];let f;if(t)w.forEach((e=>{(e.updateWith||e.applyTransform)&&e.visible&&u.push(e)})),f=u;else{const{visible:e,hidden:t,ordered:n}=k();d=e,f=e,a=n,e.forEach((e=>{e.updateWith&&e.visible?u.push(e):h.push(e)})),t.forEach((e=>{e.instance.hide(),e.visible=!1,delete e.updateWith,e.applyTransform=!1}))}h.forEach((e=>e.instance.beforeMount())),h.forEach((e=>e.instance.mount())),f.forEach((e=>e.instance.beforeRender())),f.forEach((e=>{(e.updateWith||e.applyTransform)&&e.visible?e.instance.update():e.instance.render()})),t||nd(n,a),h.forEach((e=>e.instance.mounted())),u.forEach((e=>e.instance.updated())),d.forEach((e=>{delete e.updateWith,e.visible=!0,e.applyTransform=!1})),A()},u.destroy=()=>{N(),w.destroy(),L(),I(),delete u.update,delete u.destroy,E()},u.getAffectedShapes=function(e){let t=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((e=>null==i||e.key===i)).forEach((i=>{const o=i.instance.getBrushedShapes(e,t,n);r=[...r,...o]})),r},u.findShapes=e=>{let t=[];return d.forEach((n=>{const i=n.instance.findShapes(e);t=[...t,...i]})),t},u.componentsFromPoint=e=>O(e).map((e=>e.instance.ctx)),u.shapesAt=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=[];const r=n.getBoundingClientRect();let o=d;if(Array.isArray(t.components)&&t.components.length>0){const e=t.components.map((e=>e.key));o=d.filter((t=>-1!==e.indexOf(t.key))).map((n=>({instance:n.instance,opts:t.components[e.indexOf(n.key)]})))}for(let n=o.length-1;n>=0;n--){const a=o[n],s=td(e,r,a.instance.renderer().element().getBoundingClientRect()),l=a.instance.shapesAt(s,a.opts),c=l.length>0&&"stop"===t.propagation;if(i=[...i,...l],i.length>0&&c)return i}return i},u.brushFromShapes=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{components:[]};for(let n=0;n<t.components.length;n++){const i=t.components[n].key;d.filter((e=>i===e.key)).forEach((i=>{let r=e.filter((e=>e.key===i.key));i.instance.brushFromShapes(r,t.components[n])}))}},u.scroll=function(){return function(e,t){return t[e]||(t[e]=Gc()),t[e]}(arguments.length>0&&void 0!==arguments[0]?arguments[0]:"default",m)},u.dataset=e=>y(e),u.dataCollection=e=>x(e),u.scales=function(){return f.all()},u.formatters=function(){return p.all()},u.brush=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"default";return v[e]||(v[e]=hu()),v[e]},u.scale=function(e){return f.get(e)},u.formatter=function(e){return p.get(e)},u.toggleBrushing=function(e){b=void 0!==e?e:!b},u.component=e=>{const t=w.findComponentByKey(e);return null==t?void 0:t.instance.ctx},u.logger=()=>s,u.theme=()=>l,u.storage=th({animations:{updatingStageMeta:{isInit:!1,shouldBeRemoved:!1}}}),Object.defineProperty(u,"interactions",{get:()=>({instances:g,on(){P(),g.forEach((e=>e.on()))},off(){L(),g.forEach((e=>e.off()))}})}),S(),n&&(_(),T(),q(n),u.element=n),u}const rd=e=>{let t=yo(e);return t.prio=e=>e?t.default(e[0]):[t.default()],t.types=()=>t.getKeys(),t};var od=yo();function ad(e,t,n){let{key:i}=n;const r={value:"function"==typeof e.value?e.value(t):void 0!==e.value?e.value:t};return r.label="function"==typeof e.label?e.label(t):void 0!==e.label?String(e.label):String(r.value),e.field&&(r.source={key:i,field:e.field.key()}),r}const sd=e=>e.filter((e=>"number"==typeof e&&!isNaN(e)));const ld=e=>{let{key:t,data:n,cache:i,config:r}=e;if(!n)return;let o=n;"string"==typeof o&&(o=(e=>{let{data:t,config:n}=e;const i=t.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 e=[/,/,/\t/,/;/];for(let t=0;t<e.length;t++){const n=e[t];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((e=>e.split(a)))})({data:n,config:r})),Array.isArray(o)&&function(e){let t,{source:n,data:i,cache:r,config:o}=e,a=i;const s=o&&o.parse;Array.isArray(i[0])?s&&!1===s.headers?t=i[0].map(((e,t)=>t)):(t=i[0],a=i.slice(1)):t=Object.keys(i[0]);const l=!!s&&"function"==typeof s.row&&s.row;let c,u=t;u=s&&"function"==typeof s.fields?s.fields(u.slice()):t.map((e=>({key:e,title:e}))),Array.isArray(i[0])?c=u.map((()=>[])):(c={},u.forEach((e=>{c[e.key]=[]})));for(let e=0;e<a.length;e++){const t=l?l(a[e],e,u):a[e];if(t)if(Array.isArray(t))for(let e=0;e<u.length;e++)c[e].push(t[e]);else for(let e=0;e<u.length;e++)c[u[e].key].push(t[u[e].key])}const h=Array.isArray(c)?e=>c[e]:e=>c[u[e].key];for(let e=0;e<u.length;e++){const t=h(e),i=sd(t),o=i.length>0,a=o?"measure":"dimension",s=o?Math.min(...i):NaN,l=o?Math.max(...i):NaN;r.fields.push(Hs(Qi({source:n,key:e,title:u[e].title,values:t,min:s,max:l,type:a},u[e]),{value:u[e].value,label:u[e].label}))}}({data:o,cache:i,source:t,config:r})};function cd(){let{key:e,data:t,config:n}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const i={fields:[]},r={key:()=>e,raw:()=>t,field:e=>function(e,t){let{cache:n}=t;if("number"==typeof e)return n.fields[e];for(let t=0;t<n.fields.length;t++)if(n.fields[t].key()===e)return n.fields[t];for(let t=0;t<n.fields.length;t++)if(n.fields[t].title()===e)return n.fields[t];return null}(e,{cache:i,matrix:t}),fields:()=>i.fields.slice(),extract:e=>function(e,t){const n=Array.isArray(e)?e:[e];let i=[];return n.forEach((e=>{if(void 0!==e.field){const n=t.field(e.field),r=t.key();if(!n)throw Error("Field '".concat(e.field,"' not found"));const{props:o,main:a}=Gs(e,t),s=Object.keys(o),l=!!e.trackBy,c=typeof e.trackBy,u={},h=[],d=n.items(),f=[];for(let t=0;t<d.length;t++){const n=d[t];if(a.filter&&!a.filter(n))continue;const i=ad(a,n,{key:r});s.forEach((e=>{const a=o[e];let s=a.field?a.field.items()[t]:n;i[e]=ad(a,s,{key:r})})),l&&Zs({cfg:e,itemData:n,obj:i,target:h,tracker:u,trackType:c}),f.push(i)}i=l?[...i,...Ks(h,{main:a,propsArr:s,props:o})]:[...i,...f]}})),i}(e,r),hierarchy:()=>null};return ld({key:e,data:t,config:n,cache:i}),r}cd.util={normalizeConfig:Gs,collect:Ks,track:Zs};const ud=yo();ud.default("matrix"),ud("matrix",cd),ud("default",cd);const hd=yo();function dd(e,t,n){return Math.max(e,Math.min(t,n))}function fd(e){let{item:t,value:n,boxCenter:i,rendWidth:r,rendHeight:o,flipXY:a,symbol:s}=e,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(Qi({},t.oob,{[l]:i*u,[c]:Math.max(t.oob.size/2,Math.min(n*h,h-t.oob.size/2)),startAngle:d}))}function pd(e){let{item:t,boxWidth:n,boxPadding:i,rendWidth:r,rendHeight:o,flipXY:a}=e,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(e){let{start:t,end:n,minPx:i=.1,maxPx:r=1}=e;const o=Math.max(t,n),a=Math.min(t,n),s=dd(-.1,1.2,o),l=dd(-.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:t.start,end:t.end,minPx:t.box.minHeightPx,maxPx:d});return Qi({},t.box,{type:"rect",[s]:(i+t.major)*h,[l]:p,[u]:f,[c]:n*h,data:t.data||{},collider:{type:null}})}function md(e){let{item:t,from:n,to:i,boxCenter:r,rendWidth:o,rendHeight:a,flipXY:s}=e,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),Qi({},t.line,{type:"line",[h]:Math.floor(n*f),[l]:r*d,[c]:Math.floor(i*f),[u]:r*d,data:t.data||{},collider:{type:null}})}function gd(e){let{item:t,key:n,position:i,width:r,boxCenter:o,rendWidth:a,rendHeight:s,flipXY:l}=e,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 m=r/2;return Qi({type:"line"},t[n],{[u]:Math.floor(i*p),[c]:(o-m)*f,[d]:Math.floor(i*p),[h]:(o+m)*f,r:m*f,cx:o*f,cy:i*p,width:r*f,data:t.data||{},collider:{type:null}})}function yd(e,t,n){const{width:i,maxWidthPx:r,minWidthPx:o}=t.box,a=e>=0?1:-1;let s=Math.min(a*e*i,isNaN(r)?n:r/n);return s=isNaN(o)?s:Math.max(o/n,s),s*a}hd("native",(function(e,t,n){let i,r,o={chart:e,mediator:t,element:n},a=[],s=!0;function l(){"function"==typeof i.enable&&(i.enable=i.enable.bind(o)()),i.enable&&Object.keys(i.events).forEach((e=>{const t=i.events[e].bind(o);n.addEventListener(e,t),a.push({key:e,listener:t})}))}function c(){a.forEach((e=>{let{key:t,listener:i}=e;n.removeEventListener(t,i)})),a=[]}return{get key(){return r},set(e){!function(e){r=e.key,i=e,i.events=i.events||[],void 0===i.enable&&(i.enable=!0)}(e),c(),s&&l()},off(){s=!1,c()},on(){s=!0,0===a.length&&l()},destroy(){c(),o=null,i=null}}}));const xd={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}},vd=Object.keys(xd),bd={require:["chart","resolver","symbol"],defaultSettings:{settings:{},data:{},style:{box:"$shape",line:"$shape-guide",whisker:"$shape-guide",median:"$shape-guide--inverted"}},created(){this.state={}},render(e){let{data:t}=e;const{width:n,height:i}=this.rect,r="horizontal"===this.settings.settings.orientation,{style:o,resolver:a,symbol:s}=this,l=vd.filter((e=>!this.settings.settings[e]||!1!==this.settings.settings[e].show)),c={};l.forEach((e=>c[e]=xd[e]));const u=function(e){let{keys:t,data:n,defaultSettings:i,style:r,settings:o,width:a,height:s,resolver:l}=e;const c=Qi(!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:Qi(!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:Qi(!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((e=>{(f[e]||n.items&&n.items.length&&n.items[0][e])&&(p[e]={scale:f.scale,ref:e})}));let m,g={major:d,minor:l.resolve({data:n,defaults:{start:0,end:1},scaled:u,settings:Qi(!0,{},p,f)})};for(let e=0,i=t.length;e<i;e++)o[m]&&!1===o[m].show||(m=t[e],g[m]=l.resolve({data:n,defaults:c[m],settings:o[m],scaled:u}));return g}({keys:l,data:t,defaultSettings:c,style:o,settings:this.settings.settings,width:n,height:i,resolver:a}),{settings:h,items:d}=u,f=function(e){let{width:t,height:n,flipXY:i,resolved:r,keys:o,symbol:a}=e;const s=[],l=r.major.items;if(!l.length)return s;const c=t,u=n,h=i?n:t,d=r.major.settings,f=["start","end","min","max","med"].filter((e=>void 0!==r.minor.settings[e])),p=f.length,m=o.filter((e=>"oob"!==e));let g,y,x,v,b,w,M,k,S;const _=o?o.length:0,q=m?m.length:0,D={box:function(){x.box&&or(x.start)&&or(x.end)&&g.push(pd({item:x,boxWidth:v,boxPadding:b,rendWidth:c,rendHeight:u,flipXY:i}))},line:function(){or(x.min)&&or(x.start)&&g.push(md({item:x,from:x.min,to:x.start,boxCenter:w,rendWidth:c,rendHeight:u,flipXY:i})),or(x.max)&&or(x.end)&&g.push(md({item:x,from:x.max,to:x.end,boxCenter:w,rendWidth:c,rendHeight:u,flipXY:i}))},median:function(){x.median&&or(x.med)&&g.push(gd({item:x,key:"median",position:x.med,width:v,boxCenter:w,rendWidth:c,rendHeight:u,flipXY:i}))},whisker:function(){if(x.whisker){const e=v*x.whisker.width;or(x.min)&&g.push(gd({item:x,key:"whisker",position:x.min,width:e,boxCenter:w,rendWidth:c,rendHeight:u,flipXY:i})),or(x.max)&&g.push(gd({item:x,key:"whisker",position:x.max,width:e,boxCenter:w,rendWidth:c,rendHeight:u,flipXY:i}))}}};function A(){let e,t=-Number.MAX_VALUE,n=Number.MAX_VALUE;for(let i=0;i<p;i++)e=x[f[i]],or(e)&&(t<e&&(t=e),n>e&&(n=e));M=t<0&&t!==-Number.MAX_VALUE,k=n>1&&n!==Number.MAX_VALUE,S=M||k}for(let e=0,t=l.length;e<t;e++){g=[],y=null;const t=l[e],n=t.data;let f=null,p=null;void 0!==d.binStart?(f=t.binStart,p=t.binEnd,y=d.binStart.scale):(y=d.major.scale,f=y?t.major:0);let C=0;y?y.bandwidth?(C=y.bandwidth(),f-=C/2):C=p-f:C=1,x=Qi({},{major:f,majorEnd:p},r.minor.items[e]);for(let t=0;t<_;t++)x[o[t]]=r[o[t]].items[e];if(v=yd(C,x,h),b=(C-v)/2,w=b+x.major+v/2,A(),S)x.oob&&(M?g.push(fd({item:x,value:0,boxCenter:w,rendWidth:c,rendHeight:u,flipXY:i,symbol:a})):k&&g.push(fd({item:x,value:1,boxCenter:w,rendWidth:c,rendHeight:u,flipXY:i,symbol:a})));else for(let e=0;e<q;e++)x[m[e]]&&!1===x[m[e]].show||D[m[e]]();const N={type:"container",data:n,collider:{type:"bounds"},children:g};s.push(N)}return s}({items:d,settings:h,width:n,height:i,flipXY:r,resolved:u,keys:l,symbol:s});return f}};const wd={shape:"saltire",width:2,size:.5,fill:"#333",stroke:"#333",strokeWidth:0},Md=/px$/,kd={shape:"circle",label:"",fill:"#333",stroke:"#ccc",strokeDasharray:"",strokeWidth:0,strokeLinejoin:"miter",opacity:1,x:.5,y:.5,size:1,show:!0},Sd={maxPx:1e4,minPx:1,maxRelExtent:.1,minRelExtent:.01,maxRelDiscrete:1,minRelDiscrete:.1};function _d(e,t){return e&&"function"==typeof e.bandwidth?{isBandwidth:!0,value:Math.max(1,e.bandwidth()*t)}:{isBandwidth:!1,value:Math.max(1,t)}}function qd(e,t,n,i){let{width:r,height:o}=t;return e.filter((e=>!1!==e.show&&!isNaN(e.x+e.y))).map((e=>{let t=e,a=Md.test(e.size)?parseInt(e.size,10):n.min+t.size*(n.max-n.min);ar(a)&&(t=wd,a=n.min+t.size*(n.max-n.min));const[s,l]=function(e){let t=kd.shape,n={};return"object"==typeof e.shape&&"string"==typeof e.shape.type?(t=e.shape.type,n=e.shape):"string"==typeof e.shape&&(t=e.shape),[t,n]}(t),c=ir(ir({},l),{},{type:s,label:e.label,x:e.x*r,y:e.y*o,fill:t.fill,size:Math.min(n.maxGlobal,Math.max(n.minGlobal,a)),stroke:t.stroke,strokeWidth:t.strokeWidth,strokeDasharray:t.strokeDasharray,opacity:t.opacity});t===e.errorShape&&(c.width=t.width);const u=i(c);return u.data=e.data,u}))}const Dd={require:["chart","resolver","symbol"],defaultSettings:{settings:{},data:{},animations:{enabled:!1,trackBy:e=>e.data.value},style:{item:"$shape"}},render(e){let{data:t}=e;const n=this.resolver.resolve({data:t,defaults:Qi({},kd,this.style.item),settings:this.settings.settings,scaled:{x:this.rect.width,y:this.rect.height}}),{width:i,height:r}=this.rect,o=Qi({},Sd,this.settings.settings.sizeLimits),a=n.items,s=function(e,t,n,i,r){const o=_d(e?e.scale:void 0,n),a=_d(t?t.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 qd(a,this.rect,s,this.settings.shapeFn||this.symbol)}};Math.PI;const Ad={label:"",arc:1,show:!0,fill:"#333",stroke:"#ccc",strokeWidth:1,strokeLinejoin:"round",opacity:1,innerRadius:0,outerRadius:.8,cornerRadius:0,offset:0};function Cd(e,t,n,i){let{x:r,y:o,width:a,height:s}=t;const l=Fr(),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 e.map(((e,t)=>{const r=n[t];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=e;const f=l.centroid(e),p=r.offset?function(e,t,n,i){let[r,o]=e;const a=Math.sqrt(r*r+o*o);r/=a,o/=a;const s=n-i;return{x:r*t*s,y:o*t*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:e.value/i,slice:{start:e.startAngle,end:e.endAngle,innerRadius:a,outerRadius:o,cornerRadius:s,offset:{x:c.x+p.x,y:c.y+p.y}}},r}))}function Nd(e,t){return e.slice&&"arc"in e.slice?t.arc:t.data.value}const Ed={require:["chart","resolver"],defaultSettings:{settings:{startAngle:0,endAngle:2*Math.PI,padAngle:0,slice:{}},style:{slice:"$shape"},data:{}},render(e){let{data:t}=e;const n=[],i=[],r=this.settings.settings,{items:o}=this.resolver.resolve({data:t,defaults:Qi({},Ad,this.style.slice),settings:r.slice});let a=0;for(let e=0,t=o.length;e<t;e++){const t=Nd(r,o[e]);t>0&&o[e].outerRadius>=o[e].innerRadius&&(n.push(t),i.push(o[e]),a+=t)}const s=function(){var e=Ur,t=Wr,n=null,i=br(0),r=br(Er),o=br(0);function a(a){var s,l,c,u,h,d=a.length,f=0,p=new Array(d),m=new Array(d),g=+i.apply(this,arguments),y=Math.min(Er,Math.max(-Er,r.apply(this,arguments)-g)),x=Math.min(Math.abs(y)/d,o.apply(this,arguments)),v=x*(y<0?-1:1);for(s=0;s<d;++s)(h=m[p[s]=s]=+e(a[s],s,a))>0&&(f+=h);for(null!=t?p.sort((function(e,n){return t(m[e],m[n])})):null!=n&&p.sort((function(e,t){return n(a[e],a[t])})),s=0,c=f?(y-d*v)/f:0;s<d;++s,g=u)l=p[s],u=g+((h=m[l])>0?h*c:0)+v,m[l]={data:a[l],index:s,value:h,startAngle:g,endAngle:u,padAngle:x};return m}return a.value=function(t){return arguments.length?(e="function"==typeof t?t:br(+t),a):e},a.sortValues=function(e){return arguments.length?(t=e,n=null,a):t},a.sort=function(e){return arguments.length?(n=e,t=null,a):n},a.startAngle=function(e){return arguments.length?(i="function"==typeof e?e:br(+e),a):i},a.endAngle=function(e){return arguments.length?(r="function"==typeof e?e:br(+e),a):r},a.padAngle=function(e){return arguments.length?(o="function"==typeof e?e:br(+e),a):o},a}().sortValues(null);s.startAngle(r.startAngle),s.endAngle(r.endAngle),s.padAngle(r.padAngle);return Cd(s(n),Qi({},this.rect,{x:0,y:0}),i,a)}};const Rd=function(e){function t(t){if(e[t.type]&&e[t.type].condition(t)){const n=e[t.type],i=void 0===n.conditionAppend||n.conditionAppend(t);n.items.forEach((e=>{const n=Math.round(t[e.key]),r=t[e.key]-n;t[e.key]=n,i&&"append"===e.type&&(r>0?t[e.key]+=.5:t[e.key]-=.5)}))}}return void 0===e&&((e={}).line={append:["x1","x2","y1","y2"],round:[],condition:e=>e.x1===e.x2||e.y1===e.y2,conditionAppend:e=>e.strokeWidth%2!=0},e.rect={append:["x","y"],round:["width","height"],condition:()=>!0,conditionAppend:e=>e.strokeWidth%2!=0}),Object.keys(e).forEach((t=>{const n=e[t];n.items=[],n.append.forEach((e=>{n.items.push({key:e,type:"append"})})),n.round.forEach((e=>{n.items.push({key:e,type:"round"})}))})),t.multiple=e=>e.forEach((e=>t(e))),t}();class Id{constructor(){this.reset(),this.push(...arguments)}static evaluateKey(e,t){if(t){const t=e.substring(0,1),n=e.substring(1);if("x"===t)return"y".concat(n);if("y"===t)return"x".concat(n);if("cx"===e)return"cy";if("cy"===e)return"cx";if("width"===e)return"height";if("height"===e)return"width"}return e}transposeCoordinate(e,t,n){if("number"==typeof t&&isFinite(t)){const i=e.substring(0,1);if("x"===i||"cx"===e)return t*this.width;if("width"===e)return t*this.width;if("r"===e)return t*(n?this.height:this.width);if("y"===i||"cy"===e)return t*this.height;if("height"===e)return t*this.height}return t}push(){return this.storage.push(...arguments),this}processItem(e){let t={};const n=void 0!==e.flipXY?e.flipXY:this.flipXY,i=void 0!==e.crisp?e.crisp:this.crisp;if(e.fn&&"function"==typeof e.fn){let i=n?this.height:this.width,r=n?this.width:this.height;e=e.fn({width:i,height:r,flipXY:n});const o=Object.keys(e);for(let i=0,r=o.length;i<r;i++){let r=o[i];t[Id.evaluateKey(r,n)]=e[r]}}else{const i=Object.keys(e);for(let r=0,o=i.length;r<o;r++){let o=i[r];const a=Id.evaluateKey(o,n),s=this.transposeCoordinate(a,e[o],n);t[a]=s}}return i&&Rd(t),t}output(){let e=[];for(let t=0,n=this.storage.length;t<n;t++){let n=this.processItem(this.storage[t]);e.push(n)}return e}reset(){this.storage=[],this.flipXY=!1,this.crisp=!1,this.width=0,this.height=0}}function Od(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return new Id(...t)}function Pd(e,t){return e&&t?e.cachedTicks&&e.cachedTicks()||e.ticks({distance:t}):[]}const Ld={created(){},require:["chart","renderer","resolver"],defaultSettings:{layout:{displayOrder:0},style:{ticks:"$guide-line",minorTicks:"$guide-line--minor"}},beforeRender(){this.blueprint=Od(),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,ku(this,"x",this.rect.width),ku(this,"y",this.rect.height),!this.x&&!this.y)return[];this.settings.ticks=Qi({show:!0},this.style.ticks,this.settings.ticks||{}),this.settings.minorTicks=Qi({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((e=>Qi(e,{flipXY:!0})));let e=e=>{let{dir:t,isMinor:n}=e,i=this.lines[t].filter((e=>!!e.isMinor===n)),r=n?this.settings.minorTicks:this.settings.ticks;this.resolver.resolve({settings:r,data:{items:i,dir:t}}).items.forEach((e=>{let n=e.data;var i,r;e.show&&this.blueprint.push({type:"line",x1:n.position,y1:0,x2:n.position,y2:1,stroke:e.stroke||"black",strokeWidth:void 0!==e.strokeWidth?e.strokeWidth:1,strokeDasharray:void 0!==e.strokeDasharray?e.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:t})}))};return e({dir:"x",isMinor:!1}),e({dir:"x",isMinor:!0}),e({dir:"y",isMinor:!1}),e({dir:"y",isMinor:!0}),this.blueprint.output()}};function Td(e,t,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(e," ").concat(t-n,"\n A ").concat(1.25*n," ").concat(1.25*n,", 0, 1, ").concat(r?0:1,", ").concat(e," ").concat(t+n,"\n L ").concat(r?e+n:e-n," ").concat(t," Z\n ")}let r="bottom"===i;return"\n M ".concat(e-n," ").concat(t,"\n A ").concat(1.25*n," ").concat(1.25*n,", 0, 1, ").concat(r?1:0,", ").concat(e+n," ").concat(t,"\n L ").concat(e," ").concat(r?t+n:t-n," Z\n ")}function zd(e,t,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(e+=r?1.5*n:-1.5*n," ").concat(t-n,"\n L ").concat(e," ").concat(t+n,"\n L ").concat(r?e+n:e-n," ").concat(t," Z\n ")}let r="bottom"===i;return t+=r?1.5*n:-1.5*n,"\n M ".concat(e-n," ").concat(t,"\n L ").concat(e+n," ").concat(t,"\n L ").concat(e," ").concat(r?t+n:t-n," Z\n ")}function Fd(e,t,n){return e<t||e>n}function jd(e,t){if("string"==typeof e.formatter)return t.formatter(e.formatter);if("object"==typeof e.formatter)return t.formatter(e.formatter);if(void 0!==e.scale&&e.scale.data){const t=e.scale.data()&&e.scale.data().fields;return t&&t[0]?t[0].formatter():null}return null}function Vd(e){if(void 0===e)return 0;if("number"==typeof e&&isFinite(e))return e;if("string"==typeof e)switch(e){case"center":case"middle":return.5;case"bottom":case"right":return 1;default:return 0}return 0}function Bd(e){var t,n;let{chart:i,blueprint:r,renderer:o,p:a,settings:s,items:l,slopeLine:c}=e,u=!0,h=!1,d=!1,f=!1,p=!1,m=Qi(!0,{},s.style.line,a.line||{}),g=Qi(!0,{fill:"#000",fontFamily:"Arial",fontSize:"12px",opacity:1,maxWidth:1,maxWidthPx:9999,padding:5,background:{fill:"#fff",stroke:"transparent",strokeWidth:0,opacity:.5}},s.style.label||{},{fill:m.stroke});if(h=c?r.processItem({type:"line",x1:c.x1,y1:c.y1,x2:c.x2,y2:c.y2,stroke:m.stroke||"black",strokeWidth:m.strokeWidth||1,strokeDasharray:m.strokeDasharray,flipXY:!1,value:a.valueInfo?a.valueInfo.id:a.value}):r.processItem({type:"line",x1:a.position,y1:0,x2:a.position,y2:1,stroke:m.stroke||"black",strokeWidth:m.strokeWidth||1,strokeDasharray:m.strokeDasharray,flipXY:a.flipXY||!1,value:a.valueInfo?a.valueInfo.id:a.value}),a.label&&!1!==a.label.show&&(null==c||!c.slope||0===c.slope)){const e=Qi(!0,{fill:"#000",fontFamily:"Arial",fontSize:"12px",opacity:1,maxWidth:1,maxWidthPx:9999,padding:5,background:{fill:"#fff",stroke:"transparent",strokeWidth:0,opacity:.5}},s.style.label||{},{fill:m.stroke},a.label);let t,n={width:0,height:0},c="";t=jd(a,i),!1!==a.label.showValue&&(t?c=" (".concat(t(a.value),")"):a.scale&&(c=" (".concat(a.value,")"))),c&&(n=o.measureText({text:c,fontFamily:e.fontFamily,fontSize:e.fontSize}));let h=o.measureText({text:e.text||"",fontFamily:e.fontFamily,fontSize:e.fontSize}),g={width:h.width+n.width,height:Math.max(h.height,n.height)},y=e.padding,x=Vd(a.flipXY?e.vAlign:e.align),v=Vd(a.flipXY?e.align:e.vAlign),b=Math.min(1+g.width+2*y,e.maxWidth*r.width,e.maxWidthPx),w=g.height+2*y,M=a.flipXY?w:b,k=a.flipXY?b:w;if(d=r.processItem({fn:t=>{let{width:n,height:i}=t,o=a.position*n-(a.flipXY?w:b)*(1-x);o=a.flipXY?o:Math.max(o,0);return{type:"rect",x:o,y:Math.max(Math.abs(v*i-k*v),0),width:a.flipXY?M:Math.min(M,r.width-o),height:k,stroke:e.background.stroke,strokeWidth:e.background.strokeWidth,fill:e.background.fill,opacity:e.background.opacity}},flipXY:a.flipXY||!1}),d.x<-1||d.x+d.width>r.width+1||d.y<-1||d.y+d.height>r.height+1)d=void 0;else{f={type:"text",text:e.text||"",fill:e.fill,opacity:e.opacity,fontFamily:e.fontFamily,fontSize:e.fontSize,x:d.x+y,y:d.y+d.height/2+g.height/3,maxWidth:d.width-2*y-n.width,anchor:"start"},c&&(p={type:"text",text:c||"",fill:e.fill,opacity:e.opacity,fontFamily:e.fontFamily,fontSize:e.fontSize,x:f.x+3+(d.width-(n.width+2*y)),y:f.y});for(let e=0,t=l.length;e<t;e++){let t=l[e];"rect"===t.type?xh(d,t)&&(u=!1):"line"===t.type&&a.flipXY===t.flipXY&&wh(d,t)&&(u=!1)}}}if(h&&l.push(h),c&&0!==c.slope&&(!1!==(null===(t=c.label)||void 0===t?void 0:t.show)||!1!==(null===(n=c.label)||void 0===n?void 0:n.showValue))){var y,x,v;let e,t;const n=120;let s=!1!==(null===(y=c.label)||void 0===y?void 0:y.show)?null===(x=c.label)||void 0===x?void 0:x.text:"";if(!1!==(null===(v=c.label)||void 0===v?void 0:v.showValue)){var b;const t=jd(a,i),n=t?t(c.value):c.value;e="(".concat(c.slope,"x + ").concat(n,")"),s+=null!==(b=c.label)&&void 0!==b&&b.text?" ".concat(e):e}if(s.length>1){var w,M,k;const e=o.measureText({text:s,fontFamily:g.fontFamily,fontSize:g.fontSize});e.width=e.width>n?n:e.width;const a=function(e,t,n){const i=e.scale({scale:"x"}),r=e.scale({scale:"y"});if(t>0){if(i.max()*t+n>=r.max())return!0}else if(t<0&&i.min()*t+n>=r.max())return!0;return!1}(i,c.slope,c.value)?function(e,t,n){const i=e.scale({scale:"x"}),r=e.scale({scale:"y"});return i((r.max()-n)/t)}(i,c.slope,c.value):void 0,u=void 0===a||c.isRtl?g.padding:3*g.padding,d=void 0!==a||c.slope>0?3*g.padding:g.padding,f=function(e,t,n,i,r,o){let a=0;if(void 0!==n){if(n<.8)return a=e.slope<0||e.isRtl?3*o.padding:2*o.padding,e.isRtl,n*r.width+a;if(1===n)return e.isRtl?n*r.width-(i.width+3*o.padding):n*r.width-(i.width+6*o.padding);if(n>.8)return e.isRtl?n*r.width-(i.width+3*o.padding):n*r.width-(i.width+6*o.padding)}else if(e.slope>0)return t.x2-(i.width+2*o.padding);return e.isRtl?t.x1-(i.width+2*o.padding):t.x1}(c,h,a,e,r,g),p=Math.min(h.y1,h.y2);null!==(w=c.label)&&void 0!==w&&w.stroke&&(t={type:"rect",x:c.isRtl?Math.max(f,u)-2:Math.max(f,u)+2,y:Math.abs(Math.max(p,d)-e.height),rx:3,ry:3,width:e.width+g.padding,height:e.height-2,stroke:m.stroke,fill:m.stroke});const y={type:"text",text:s,fill:null!==(M=null===(k=c.label)||void 0===k?void 0:k.stroke)&&void 0!==M?M:m.stroke,opacity:g.opacity,fontFamily:g.fontFamily,fontSize:g.fontSize,x:t?t.x+2:Math.max(f,u)+2,y:t?t.y+e.height-g.padding:Math.abs(Math.max(p,d)-g.padding/2),anchor:"start",title:s,maxWidth:n,width:e.width};(function(e,t,n,i,r){for(let o=0,a=e.length;o<a;o++){const a=e[o];if("text"===(null==a?void 0:a.type)&&Math.abs(a.x-t.x)<Math.max(a.width+i,t.width+i)&&Math.abs(a.y-t.y)<n.height+r)return!0}return!1})(l,y,e,u,d)||(t&&l.push(t),l.push(y))}}u&&d&&f&&(l.push(d,f),p&&l.push(p))}function Hd(e){const t={value:e.value};return e.label&&(t.label=e.label.text),t}function $d(e){return void 0!==("function"==typeof e.value?e.value():e.value)}function Wd(e,t){const n=e.min();if(n===e.max()){const i=function(e){const t=e.range();return 2===(null==t?void 0:t.length)&&t[0]>t[1]}(e);if(t<n)return i?2:-1;if(t>n)return i?-1:2}return e(t)}function Ud(e,t){return e&&t&&Math.abs(e.x-t.x)<1e-15&&Math.abs(e.y-t.y)<1e-15}const Yd={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=Od(),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 e=this.settings;if(this.lines={x:[],y:[]},this.lines.x=e.lines&&e.lines.x||[],this.lines.y=e.lines&&e.lines.y||[],0===this.lines.x.length&&0===this.lines.y.length)return[];const t={x0:[],x1:[],y0:[],y1:[]};this.lines.x=this.lines.x.filter($d).map((e=>{if("function"==typeof e.value&&(e.value=e.value()),e.scale){let t=this.chart.scale(e.scale);const n=Wd(t,e.value);return Qi(e,{scale:t,position:n})}return Qi(e,{position:e.value})})),this.lines.y=this.lines.y.filter($d).map((e=>{if("function"==typeof e.value&&(e.value=e.value()),e.scale){let t=this.chart.scale(e.scale);const n=Wd(t,e.value);return Qi(e,{scale:t,position:n,flipXY:!0})}return Qi(e,{position:e.value,flipXY:!0})})),this.lines.x=this.lines.x.filter((e=>!(e.position<0||e.position>1)||(t["x".concat(e.position>1?1:0)].push(Hd(e)),!1))),this.lines.y=this.lines.y.filter((e=>!(!e.slope||0===e.slope)||(!(e.position<0||e.position>1)||(t["y".concat(e.position>1?1:0)].push(Hd(e)),!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 e=this.chart.scale({scale:"x"}),n=this.chart.scale({scale:"y"}),o=e.min(),a=e.max(),s=n.min(),l=n.max();r=ir(ir({},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=[];Fd(c,s,l)||(f[0]={x:Wd(e,o),y:Wd(n,c)}),Fd(h,o,a)||(f[1]={x:Wd(e,h),y:1}),Fd(u,s,l)||(f[2]={x:Wd(e,a),y:Wd(n,u)}),Fd(d,o,a)||(f[3]={x:Wd(e,d),y:0});if(f.filter((e=>!!e)).length>2&&function(e){Ud(e[0],e[1])&&(e[1]=void 0),Ud(e[1],e[2])&&(e[2]=void 0),Ud(e[2],e[3])&&(e[3]=void 0),Ud(e[3],e[0])&&(e[3]=void 0)}(f),f=f.filter((e=>!!e)),f.length<2)return void t["y".concat(c>l?0:1)].push(Hd(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;Bd({chart:this.chart,blueprint:this.blueprint,renderer:this.renderer,p:i,settings:e,items:n,slopeLine:r})}})),e.style.oob.show&&function(e){let{blueprint:t,oob:n,settings:i,items:r}=e;const o=Object.keys(n);let a=i.style.oob||{};for(let e=0,i=o.length;e<i;e++){const i=o[e],s=n[i];if(s.length>0){let e=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"===e?"bottom":"top":"1"===e?"right":"left";let u=t.processItem({fn:t=>{let{width:i,height:r}=t,u=e*i+("1"===e?-o:o),h=n?l:r-l;return"arc"===a.type?{type:"path",d:Td(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;const f=s.map((e=>e.label?"".concat(e.label," (").concat(e.value,")"):"(".concat(e.value,")"))),p=f.reduce(((e,t,n)=>0===n?t:"".concat(e,"\n\n").concat(t)),"");let m={type:"text",text:s.length||"",title:p,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},g={type:"path",d:zd(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,m,g)}}}({blueprint:this.blueprint,oob:t,settings:e,items:n}),n}};function Gd(e){const t={type:"line",x1:0,x2:0,y1:0,y2:0,collider:{type:null}};return"top"===e.align||"bottom"===e.align?(t.x1=e.innerRect.x-e.outerRect.x,t.x2=t.x1+e.innerRect.width,t.y1=t.y2="top"===e.align?e.innerRect.height-e.padding:e.padding):(t.x1=t.x2="left"===e.align?e.innerRect.width-e.padding:e.padding,t.y1=e.innerRect.y-e.outerRect.y,t.y2=t.y1+e.innerRect.height),function(e,t){Qi(e,t.style)}(t,e),t}function Xd(e){return"string"==typeof e||"number"==typeof e?e:"-"}function Kd(e,t,n){n.layered||!n.stepSize?function(e,t){t.collider={type:"polygon",vertices:[{x:t.boundingRect.x,y:t.boundingRect.y},{x:t.boundingRect.x+t.boundingRect.width,y:t.boundingRect.y},{x:t.boundingRect.x+t.boundingRect.width,y:t.boundingRect.y+t.boundingRect.height},{x:t.boundingRect.x,y:t.boundingRect.y+t.boundingRect.height}]}}(0,t):n.tilted?function(e,t,n){const i=n.angle*(Math.PI/180),r=Math.max(n.stepSize/2,t.boundingRect.height/2),o="start"===t.anchor,a="end"===t.anchor&&i<0,s="start"===t.anchor&&i>=0,l=t.boundingRect.y+(s||a?t.boundingRect.height:0),c=[{x:t.x-r,y:l},{x:t.x+r,y:l}].map((e=>Wu(e,i,{x:t.x,y:t.y}))),u={x:o?t.boundingRect.x+t.boundingRect.width+10:t.boundingRect.x-10,y:t.boundingRect.y+t.boundingRect.height},h={x:o?t.boundingRect.x+t.boundingRect.width+10:t.boundingRect.x-10,y:t.boundingRect.y},d=i>=0?[u,h]:[h,u];c.push(...d),t.collider={type:"polygon",vertices:c}}(0,t,n):function(e,t,n){if("bottom"===n.align||"top"===n.align){const i=e.position*n.innerRect.width+(n.innerRect.x-n.outerRect.x-n.stepSize/2);t.collider={type:"rect",x:i,y:0,width:i<0?n.stepSize+i:n.stepSize,height:n.innerRect.height}}else{const i=e.position*n.innerRect.height+(n.innerRect.y-n.outerRect.y-n.stepSize/2);t.collider={type:"rect",x:0,y:i,width:n.innerRect.width,height:i<0?n.stepSize+i:n.stepSize}}const i=t.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}(e,t,n)}function Zd(e,t){const n=isNaN(e.style.align)?.5:Math.min(Math.max(e.style.align,0),1);let i=0;if(e.tilted)i=e.stepSize*n;else{const r=t?e.textRect.height:e.textRect.width;i=Math.max(0,e.stepSize-r)*n}return i}function Jd(e,t){var n,i;const r={type:"text",text:Xd(e.label),x:0,y:0,maxWidth:t.maxWidth,maxHeight:t.maxHeight,tickValue:null!==(n=e.value)&&void 0!==n?n:null===(i=e.data)||void 0===i?void 0:i.value};return"top"===t.align||"bottom"===t.align?(r.x=e.start*t.innerRect.width+(t.innerRect.x-t.outerRect.x)+Zd(t,!1),r.y="top"===t.align?t.innerRect.height:0,r.anchor=t.stepSize?"start":"middle",r.x+=isNaN(t.style.offset)?0:+t.style.offset):(r.y=e.start*t.innerRect.height+(t.innerRect.y-t.outerRect.y)+Zd(t,!0),r.x="left"===t.align?t.innerRect.width:0,r.anchor="left"===t.align?"end":"start",r.baseline=t.stepSize?"text-before-edge":"central",r.y+=isNaN(t.style.offset)?0:+t.style.offset),function(e,t){["fill","fontSize","fontFamily"].forEach((n=>{e[n]=t.style[n]}))}(r,t),function(e,t){if(!t.tilted&&!t.stepSize)if("top"===t.align||"bottom"===t.align){const n=0,i=t.outerRect.width,r=Math.min(t.maxWidth/2,t.textRect.width/2),o=e.x-r,a=e.x+r;o<n?(e.anchor="start",e.x=t.innerRect.x-t.outerRect.x):a>i&&(e.anchor="end",e.x=t.innerRect.width+t.innerRect.x)}else{const n=0,i=t.outerRect.height,r=t.maxHeight/2,o=e.y-r,a=e.y+r;o<n?(e.y=t.innerRect.y-t.outerRect.y,e.baseline="text-before-edge"):a>i&&(e.y=t.innerRect.height+(t.innerRect.y-t.outerRect.y),e.baseline="text-after-edge")}}(r,t),function(e,t){"top"===t.align?e.y-=t.padding:"bottom"===t.align?e.y+=t.padding+t.maxHeight:"left"===t.align?e.x-=t.padding:"right"===t.align&&(e.x+=t.padding)}(r,t),function(e,t){if(t.tilted){const n=-t.angle,i=n*(Math.PI/180);"bottom"===t.align?(e.x-=t.maxHeight*Math.sin(i)/2,e.y-=t.maxHeight,e.y+=t.maxHeight*Math.cos(i)/2):e.x-=t.maxHeight*Math.sin(i)/3,e.transform="rotate(".concat(n,", ").concat(e.x,", ").concat(e.y,")"),e.anchor="bottom"===t.align==t.angle<0?"start":"end";const r=Math.cos(i)*t.maxWidth;if("bottom"===t.align==t.angle<0){const n=t.outerRect.width-t.paddingEnd;e.x+r>n&&(e.maxWidth=(n-e.x-10)/Math.cos(i))}else{const n=t.paddingEnd;e.x-r<n&&(e.maxWidth=(e.x-n-10)/Math.cos(i))}}}(r,t),function(e,t){e.boundingRect=t.textBounds(e)}(r,t),Kd(e,r,t),r}function Qd(e,t){const n={type:"line",x1:0,x2:0,y1:0,y2:0,collider:{type:null},tickValue:e.value};return"top"===t.align||"bottom"===t.align?(n.x1=n.x2=e.position*t.innerRect.width+(t.innerRect.x-t.outerRect.x),n.y1="top"===t.align?t.innerRect.height:0,n.y2="top"===t.align?n.y1-t.tickSize:n.y1+t.tickSize):(n.y1=n.y2=e.position*t.innerRect.height+(t.innerRect.y-t.outerRect.y),n.x1="left"===t.align?t.innerRect.width:0,n.x2="left"===t.align?n.x1-t.tickSize:n.x1+t.tickSize),function(e,t){Qi(e,t.style)}(n,t),function(e,t){"top"===t.align?(e.y1-=t.padding,e.y2-=t.padding):"bottom"===t.align?(e.y1+=t.padding,e.y2+=t.padding):"left"===t.align?(e.x1-=t.padding,e.x2-=t.padding):"right"===t.align&&(e.x1+=t.padding,e.x2+=t.padding)}(n,t),function(e,t){const n=e.strokeWidth/2;e.x1===t.innerRect.width?(e.x1-=n,e.x2-=n):0===e.x1?(e.x1+=n,e.x2+=n):e.y1===t.innerRect.height?(e.y1-=n,e.y2-=n):0===e.y1&&(e.y1+=n,e.y2+=n)}(n,t),n}function ef(e){return!e.isMinor&&e.position>=0&&e.position<=1}function tf(e){let{rect:t,state:n,majorTicks:i,measure:r,horizontal:o}=e;return o?function(e){let{majorTicks:t,measureText:n,rect:i,state:r}=e;const o="layered"===r.labels.activeMode?2:1,a=i.width,s=t.map((e=>e.label)).map((e=>"".concat(e.slice(0,1)).concat(e.length>1?"…":""))).map(n).map((e=>e.width));for(let e=0;e<t.length;++e){const n=t[e];if(o*a*Math.abs(n.start-n.end)<s[e])return!0}return!1}({majorTicks:i,measureText:r,rect:t,state:n}):function(e){let{majorTicks:t,measureText:n,rect:i}=e;const r=i.height,o=n("M").height;return!(t.length<2)&&r*Math.abs(t[0].position-t[1].position)<o}({majorTicks:i,measureText:r,rect:t,state:n})}function nf(e){let{value:t,maxValue:n,minValue:i,range:r,modifier:o}=e;return isNaN(r)||isNaN(o)||(t=r*o),t>n&&(t=n),t<i&&(t=i),t}function rf(e){let{isDiscrete:t,rect:n,formatter:i,measureText:r,scale:o,settings:a,state:s}=e,l=0;const c={left:0,top:0,right:0,bottom:0},{maxLengthPx:u,minLengthPx:h}=a.labels;if(a.labels.show){const e=a.align,d="top"===e||"bottom"===e,f=d?n.inner.width:n.inner.height,p=o.ticks({settings:a,distance:f,formatter:i}).filter(ef),m=e=>{const t=r({text:e,fontSize:a.labels.fontSize,fontFamily:a.labels.fontFamily});return t.width=nf({value:t.width,maxValue:u,minValue:h}),t};if(t&&d&&"auto"===a.labels.mode&&(!function(e){let{majorTicks:t,measure:n,rect:i,state:r,settings:o}=e;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 e=0;e<t.length;e++){const i=t[e],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*t.reduce(((e,t)=>Math.min(Math.abs(t.start-t.end),e)),1/0),h=n("M").width*l*a,h+c>d)return!0;return!1}({majorTicks:p,measure:m,rect:n.inner,state:s,settings:a})?s.labels.activeMode="horizontal":s.labels.activeMode="tilted"),!a.labels.filterOverlapping&&"tilted"!==s.labels.activeMode&&tf({rect:n.inner,state:s,majorTicks:p,measure:m,horizontal:d})){return{size:Math.max(n.outer.width,n.outer.height),isToLarge:!0}}let g,y;if("tilted"===s.labels.activeMode){const e=Math.abs(a.labels.tiltAngle)*(Math.PI/180);g=t=>nf({value:t.width,maxValue:u,minValue:h})*Math.sin(e)+t.height*Math.cos(e)}else g=d?e=>e.height:e=>nf({value:e.width,maxValue:u,minValue:h});if(d&&"tilted"!==s.labels.activeMode)y=["M"];else if(isNaN(a.labels.maxGlyphCount))y=p.map((e=>e.label));else{let e="";for(let t=0;t<a.labels.maxGlyphCount;t++)e+="M";y=[e]}const x=y.map(m),v=x.map(g),b=Math.max(...v,0);if(l+=b,l+=a.labels.margin,"layered"===s.labels.activeMode&&(l*=2),"tilted"===s.labels.activeMode){const e="bottom"===a.align==a.labels.tiltAngle>=0,t=Math.abs(a.labels.tiltAngle)*(Math.PI/180),i=(b-m("M").height*Math.cos(t))/Math.sin(t),r=e=>Math.min(i,e.width)*Math.cos(t)+e.height,o=(t,i)=>{const r=p[i]?p[i].position:0;return e?t-r*n.inner.width:t-(1-r)*n.inner.width},s=Math.min(a.labels.maxEdgeBleed,Math.max(...x.map(r).map(o),0))+a.paddingEnd;if(c[e?"left":"right"]=s,!a.labels.filterOverlapping&&function(e){let{majorTicks:t,measureText:n,rect:i,bleedSize:r,angle:o}=e;if(t.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(t[0].position-t[1].position));return n("M").height>Math.sin(a*(Math.PI/180))/s}({majorTicks:p,measureText:m,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 of=(e,t,n)=>e.width*Math.abs(t.position-n.position);function af(e){let{layered:t,major:n,innerRect:i,outerRect:r,tick:o,index:a}=e;const s=t?2:1,l=n[a-s],c=n[a+s],u=l?of(i,o,l)/2-2:1/0,h=c?of(i,o,c)/2-2:1/0;return n.length<2?i.width:l?c?2*Math.min(u,h):(e=>{let{innerRect:t,outerRect:n,tick:i,prevWidth:r}=e;const o=t.x-n.x,a=n.width-t.width-o,s=t.width-t.width*i.position+a,l=2*Math.min(r,s),c=1===i.position?t.width/2-2:0;return Math.max(r,l,c)})({innerRect:i,outerRect:r,tick:o,prevWidth:u}):(e=>{let{innerRect:t,outerRect:n,tick:i,nextWidth:r}=e;const o=t.x-n.x,a=t.width*i.position+o,s=2*Math.min(r,a),l=0===i.position?t.width/2-2:0;return Math.max(r,s,l)})({innerRect:i,outerRect:r,tick:o,nextWidth:h})}function sf(e){const t=e.innerRect,n={cx:t.width/2,cy:t.height/2},i=Math.min(t.height,t.width)/2*e.radius,r=i+e.style.strokeWidth,o={visible:!0,type:"path",arcDatum:{startAngle:e.startAngle,endAngle:e.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(e,t){Qi(e,t.style)}(o,e),o}function lf(e,t,n,i){return{x:e+n*Math.cos(i),y:t+n*Math.sin(i)}}function cf(e,t){const n=t.innerRect,i={cx:n.width/2,cy:n.height/2},r=Math.min(n.height,n.width)/2*t.radius+t.padding,o=t.startAngle,a=t.endAngle,s=t.tickSize,l=a-o;let c=a-e.position*l;c-=Math.PI/2;const u=lf(i.cx,i.cy,r+s,c),h=lf(i.cx,i.cy,r,c),d={type:"line",x1:u.x,y1:u.y,x2:h.x,y2:h.y,value:e.value};return function(e,t){const n=ir({},t.style);Qi(e,n)}(d,t),d}function uf(e){return"string"==typeof e||"number"==typeof e?e:"-"}function hf(e,t,n){let i;return i="left"===t?n.x:"right"===t?e.outerRect.width-n.x:Math.max(n.x,e.outerRect.width-n.x),i}function df(e,t){const n=t.innerRect,i={cx:n.width/2,cy:n.height/2},r=Math.min(n.height,n.width)/2*t.radius+t.padding,o=t.startAngle,a=t.endAngle,s=t.tickSize,l=a-o,c=.2;let u,h;u="top"===t.align||"bottom"===t.align?a-e.position*l:o+e.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(e,t,n,i){return{x:e+n*Math.cos(i),y:t+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:uf(e.label),align:h,x:d.x,y:d.y,maxHeight:t.maxHeight,maxWidth:hf(t,h,d),anchor:f,baseline:"middle"};return function(e,t){["fill","fontSize","fontFamily"].forEach((n=>{e[n]=t.style[n]}))}(p,t),function(e,t){e.boundingRect=t.textBounds(e)}(p,t),function(e,t,n){let i,r;const o=parseFloat(n.fontSize)||0;i=t.y-o/2,r=e.innerRect.height-(t.y+o/2),(i<0||r<0)&&(n.text="")}(t,d,p),p}function ff(e){let t=0;return t+=e.paddingStart,t+=e.line.show?e.line.strokeWidth/2:0,t+=e.ticks.show?e.ticks.margin:0,t}function pf(e){let t=0;return t+=e.line.show?e.line.strokeWidth/2:0,t+=e.ticks.show?e.ticks.margin:0,t}function mf(e){let t=0;return t+=e.ticks.show?e.ticks.tickSize:0,t+=ff(e)+e.labels.margin,t}function gf(e,t){return e.map((e=>Qd(e,t)))}function yf(e,t){return t?Math.abs(t.end-t.start):e.bandwidth()}function xf(e){let{textMetrics:t,settings:n,innerRect:i,scale:r,tilted:o,layered:a,tick:s}=e;const l=t.height,c=yf(r,s),u={width:0,height:l};if("left"===n.align||"right"===n.align)u.width=i.width-mf(n)-n.paddingEnd;else if(a)u.width=c*i.width*2;else if(o){const e=Math.abs(n.labels.tiltAngle)*(Math.PI/180);u.width=(i.height-mf(n)-n.paddingEnd-l*Math.cos(e))/Math.sin(e)}else u.width=c*i.width;return u.width=nf({value:u.width,maxValue:n.labels.maxLengthPx,minValue:n.labels.minLengthPx}),u}function vf(e){let{textMetrics:t,settings:n,innerRect:i,outerRect:r,tilted:o,layered:a,tick:s,index:l,major:c}=e;const u=t.height,h={width:0,height:u};if("left"===n.align||"right"===n.align)h.width=i.width-mf(n)-n.paddingEnd;else if(o){const e=Math.abs(n.labels.tiltAngle)*(Math.PI/180);h.width=(i.height-mf(n)-n.paddingEnd-u*Math.cos(e))/Math.sin(e)}else h.width=af({layered:a,major:c,innerRect:i,outerRect:r,tick:s,index:l});return h.width=nf({value:h.width,maxValue:n.labels.maxLengthPx,minValue:n.labels.minLengthPx}),h}function bf(e){let t;function n(){return t=vf,n}function i(){return t=xf,i}function r(e){let{settings:n,scale:i,innerRect:r,outerRect:o,measureText:a,ticks:s,state:l,textBounds:c}=e;const u=[],h=function(e){return e.filter((e=>!e.isMinor))}(s),d=function(e){return e.filter((e=>e.isMinor))}(s),f={innerRect:r,align:n.align,outerRect:o},p="tilted"===l.labels.activeMode,m="layered"===l.labels.activeMode;let g;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(sf(f)):u.push(Gd(f))),n.ticks.show&&(f.style=n.ticks,f.tickSize=n.ticks.tickSize,f.padding=ff(n),n.arc?(f.padding=pf(n),g=function(e,t){return e.map((e=>cf(e,t)))}(h,f)):g=gf(h,f)),n.labels.show){const e=mf(n);f.style=n.labels,f.padding=e,f.tilted=p,f.layered=m,f.angle=n.labels.tiltAngle,f.paddingEnd=n.paddingEnd,f.textBounds=c;const l=(e,l)=>{f.textRect=function(e){let{style:t,measureText:n,tick:i}=e;return n({text:i.label,fontSize:t.fontSize,fontFamily:t.fontFamily})}({tick:e,measureText:a,style:f.style});const c=t({textMetrics:f.textRect,settings:n,innerRect:r,outerRect:o,scale:i,tilted:p,layered:m,tick:e,major:h,index:l});f.maxWidth=c.width,f.maxHeight=c.height,f.stepSize=function(e){let{innerRect:t,scale:n,settings:i,tick:r}=e;return("top"===i.align||"bottom"===i.align?t.width:t.height)*yf(n,r)}({innerRect:r,scale:i,ticks:s,settings:n,tick:e})};let d=[];n.arc?(f.padding=function(e){let t=0;return t+=e.ticks.show?e.ticks.tickSize:0,t+=pf(e)+e.labels.margin,t}(n),d=function(e,t,n){return e.map(((e,i)=>{n(e,i);const r=df(e,t);return r.data=e.data,r}))}(h,f,l)):d=!m||"top"!==n.align&&"bottom"!==n.align?function(e,t,n){return e.map(((e,i)=>{n(e,i);const r=Jd(e,t);return r.data=e.data,r}))}(h,f,l):function(e,t,n,i){const r=t.padding,o=mf(n);return e.map(((e,a)=>{i(e,a);const s=o+t.maxHeight+n.labels.margin;t.layer=a%2,t.padding=a%2==0?r:s;const l=Jd(e,t);return l.data=e.data,l}))}(h,f,n,l),n.labels.filterOverlapping&&function(e,t,n){let i=(t,n)=>xh(fr(1,e[t].boundingRect),fr(1,e[n].boundingRect));if(n&&n.tilted){const t=Math.abs(n.angle);i=(n,i)=>{const r=1/Math.abs(e[n].x-e[i].x),o=Math.sin(t*(Math.PI/180))/r;return e[n].boundingRect.height>o}}for(let n=0;n<=e.length-1;n++)for(let r=n+1;r<=Math.min(n+5,n+(e.length-1));r++)e[n]&&e[r]&&i(n,r)&&(r===e.length-1?(e.splice(n,1),t&&t.splice(n,1)):(e.splice(r,1),t&&t.splice(r,1)),r--,n--)}(d,g,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(e){return e.line.strokeWidth+e.minorTicks.margin}(n),u.push(...gf(d,f))),g&&u.push(...g),u}return n.build=r,i.build=r,e?i():n()}const wf={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"},Mf={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 kf={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(e){let{state:t,style:n,settings:i}=e;const r=Qi(!0,{},t.isDiscrete?wf:Mf,n),o=Qi(!0,{},r,i.settings),a=i.layout.dock||t.defaultDock;o.dock=a,o.align=function(e,t){const n=["top","bottom"],i=["left","right"];return-1!==n.indexOf(e)&&-1===i.indexOf(t)||-1!==i.indexOf(e)&&-1===n.indexOf(t)?e:t}(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=bf(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(e,t,n){const i=t.labels.mode;return n&&e.isHorizontal?"auto"===i?e.labels.activeMode:-1!==["layered","tilted"].indexOf(t.labels.mode)&&-1!==["top","bottom"].indexOf(t.dock)?i:"horizontal":"horizontal"}(this.state,this.state.settings,this.state.isDiscrete)},preferredSize(e){const{formatter:t,state:n,scale:i}=this,r=this.state.isHorizontal?e.inner.width:e.inner.height;this.state.pxScale=Su(i,r);const o=function(e){let{isDiscrete:t,rect:n,formatter:i,measureText:r,scale:o,settings:a,state:s}=e,l=0;const{size:c,edgeBleed:u,isToLarge:h}=rf({isDiscrete:t,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 e=a.minorTicks.margin+a.minorTicks.tickSize;e>l&&(l=e)}if(a.line.show){const e=a.line.strokeWidth/2;l+=e,u[function(e){switch(e){case"top":return"bottom";case"bottom":return"top";case"left":return"right";case"right":return"left";default:return e}}(a.align)]=Math.ceil(e)}return l+=a.paddingStart,l+=a.paddingEnd,{size:l,edgeBleed:u}}({isDiscrete:this.state.isDiscrete,rect:{inner:e.inner,outer:e.outer},formatter:t,measureText:this.renderer.measureText,scale:this.state.pxScale,settings:this.state.settings,state:n});return o},beforeUpdate(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const{settings:t}=e;this.setState(t)},resize(e){const{inner:t,outer:n}=e,i=Qi({},t,function(e){let{align:t,inner:n}=e;return"left"===t?{x:n.width+n.x}:"right"===t||"bottom"===t?n:{y:n.y+n.height}}({align:this.state.settings.align,inner:t})),r=n||i;return Qi(this.state.innerRect,i),Qi(this.state.outerRect,r),n},beforeRender(){const{scale:e,formatter:t}=this,n=this.state.isHorizontal?this.state.innerRect.width:this.state.innerRect.height;this.state.pxScale=Su(e,n),this.state.ticks=this.state.pxScale.ticks({distance:n,formatter:t}).filter((e=>e.position>=0&&e.position<=1))},render(){const{state:e}=this,t=[];return t.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:e})),Rd.multiple(t),t}};const Sf={render:()=>[]};function _f(e,t,n){let i="";if("function"==typeof e)i=e();else if("string"==typeof e)i=e;else if(n){const e=(n.data().fields||[]).map((e=>e.title()));i=e.join(t)}return i}function qf(e,t){let n="middle";return"left"===e?"top"===t?n="end":"bottom"===t&&(n="start"):"right"===e?"top"===t?n="start":"bottom"===t&&(n="end"):"left"===t?n="start":"right"===t&&(n="end"),n}const Df={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 e=this.settings.text,t=this.definitionSettings.join;this.title=_f(e,t,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:e,definitionSettings:t,rect:n}=this,i=[];return i.push(function(e){let{title:t,definitionSettings:n,dock:i,rect:r,measureText:o,style:a}=e;const s={type:"text",text:t,x:0,y:0,dx:0,dy:0,anchor:qf(i,n.anchor),baseline:"alphabetical",stroke:"transparent",strokeWidth:0,fontWeight:"normal"};Qi(s,a.text);const l=o(s);if("top"===i||"bottom"===i){let e=r.width/2;"left"===n.anchor?e=n.paddingLeft||0:"right"===n.anchor&&(e=r.width-(n.paddingRight||0)),s.x=e,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 e=r.height/2;"top"===n.anchor?e=n.paddingStart:"bottom"===n.anchor&&(e=r.height-n.paddingStart),s.y=e,s.x="left"===i?r.width-n.paddingStart:n.paddingStart,s.dx="left"===i?-l.height/3:l.height/3;const t="left"===i?270:90;s.transform="rotate(".concat(t,", ").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:e,dock:this.settings.layout.dock,definitionSettings:t,rect:n,measureText:this.renderer.measureText,style:this.style})),i},beforeUpdate(e){e.settings&&(Qi(this.settings,e.settings),this.definitionSettings=e.settings.settings);const t=this.settings.text,n=this.definitionSettings.join;this.title=_f(t,n,this.scale)}};function Af(e,t){const n=e.settings.layout.dock,i=e.settings.settings.invert,r="top"===n||"bottom"===n,o=r?"width":"height",a=e.rect[o],s=e.chart.scroll(e.settings.scroll);let l;{let e=t[r?"x":"y"];i&&(e=a-e);const n=s.getState();l={startOffset:e,startScroll:n.start,swipe:!1};const o=e/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:e=>{let t=e[r?"x":"y"];if(i&&(t=a-t),!l.swipe){if(Math.abs(l.startOffset-t)<=1)return;l.swipe=!0}const n=s.getState(),o=(t-l.startOffset)/a*(n.max-n.min),c=l.startScroll+o;s.moveTo(c)},end:e=>{let t=e[r?"x":"y"];i&&(t=a-t);const n=s.getState();if(l.swipe){const e=(t-l.startOffset)/a*(n.max-n.min),i=l.startScroll+e;s.moveTo(i)}else{const e=t/a*(n.max-n.min)+n.min-n.viewSize/2;s.moveTo(e)}}}}function Cf(e,t){const n=t.element().getBoundingClientRect();return{x:e.center.x-n.left,y:e.center.y-n.top}}const Nf={require:["chart","renderer"],on:{panStart(e){const t=Cf(e,this.renderer),n={x:t.x-e.deltaX,y:t.y-e.deltaY};this.currentMove=Af(this,n),this.currentMove.update(t)},panMove(e){if(!this.currentMove)return;const t=Cf(e,this.renderer);this.currentMove.update(t)},panEnd(e){if(!this.currentMove)return;const t=Cf(e,this.renderer);this.currentMove.end(t),this.currentMove=null},panCancel(){this.currentMove=null},tap(e){const t=Cf(e,this.renderer);Af(this,t).end(t)}},defaultSettings:{settings:{backgroundColor:"#eee",thumbColor:"#ccc",width:16}},preferredSize:function(e){const t=this.chart.scroll(this.settings.scroll).getState();if(t.viewSize>=t.max-t.min){return Math.max(e.width,e.height)}return this.settings.settings.width},render:function(e){const t=this.settings.layout.dock,n=this.settings.settings.invert,i="top"===t||"bottom"===t,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),e("div",{style:{position:"relative",width:"100%",height:"100%",background:this.settings.settings.backgroundColor,pointerEvents:"auto"}},[].concat(e("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 Ef(e){let{h:t,isVertical:n,value:i,pos:r,align:o,borderHit:a,state:s,idx:l}=e;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),t("div",{onmouseover(e){e.srcElement.children[0].style.backgroundColor="#000",e.srcElement.children[0].style[n?"height":"width"]="2px"},onmouseout(e){e.srcElement.children[0].style.backgroundColor=s.style.line.stroke,e.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"}},[t("div",{style:Qi({backgroundColor:s.style.line.stroke,position:"absolute",height:n?"".concat(1,"px"):"100%",width:n?"100%":"".concat(1,"px"),pointerEvents:"none"},u)})])}function Rf(e){let{h:t,isVertical:n,label:i,otherValue:r,rangeIdx:o,idx:a,pos:s,align:l,state:c,value:u}=e;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 m=c.edit&&c.edit.rangeIdx===o&&c.edit.bubbleIdx===a;const g={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=m?t("input",{type:"text",value:u,style:ir(ir({},g),{},{textAlign:"start",textOverflow:"",fontSize:"13px"}),onkeyup(e){if("Enter"===e.key){e.preventDefault(),e.stopPropagation();const t=parseFloat(e.target.value);isNaN(t)?(y="rgba(230, 78, 78, 0.6)",e.target.style.border="".concat(c.style.bubble.strokeWidth,"px solid ").concat(y)):c.onEditConfirmed(o,t,r)}else"Escape"===e.key&&(e.preventDefault(),e.stopPropagation(),c.onEditCanceled())}}):t("div",{"data-key":[c.key,"bubble",o,a].join("-"),"data-other-value":r,"data-idx":o,"data-bidx":a,style:g},[i]);return t("div",{style:{position:"absolute",[f]:"0",[n?"top":"left"]:"".concat(s,"px"),transform:p}},[x])}function If(e){let{h:t,isVertical:n,top:i,height:r,color:o,on:a,opacity:s}=e;return t("div",Qi({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 Of(e){let{borderHit:t,els:n,isVertical:i,state:r,vStart:o,vEnd:a,idx:s}=e,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 e=r.targetFillRect||r.targetRect,t=i?e.height:e.width,s=c?r.scale.norm(o)*t:o,l=c?r.scale.norm(a)*t: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(e){e.srcElement.style.opacity=r.style.target.opacity+.1},onmouseout(e){e.srcElement.style.opacity=r.style.target.opacity}}),n.push(r.h("div",{style:{position:"absolute",left:"".concat(e.x,"px"),top:"".concat(e.y,"px"),height:"".concat(e.height,"px"),width:"".concat(e.width,"px")}},[If(d)]))}const m=u<h?o:a,g=u<h?a:o,[y,x]=c?r.scale.domain():[Math.min(o,a),Math.max(o,a)],v=m+1e-5>=y&&m-1e-5<=x,b=g-1e-5<=x&&g+1e-5>=y;v&&n.push(Ef({h:r.h,isVertical:i,borderHit:t,value:m,pos:f,align:"start",state:r,idx:s})),b&&n.push(Ef({h:r.h,isVertical:i,borderHit:t,value:g,pos:p,align:"end",state:r,idx:s}));const w=r.settings.bubbles;if(w&&w.show){const e={fontSize:w.fontSize,fontFamily:w.fontFamily,color:w.fill},t=[o,a];v&&n.push(Rf({h:r.h,isVertical:i,align:w.align,style:e,rangeIdx:s,idx:0,otherValue:g,value:m,label:"".concat(r.format(m,t)),pos:f,state:r})),b&&n.push(Rf({h:r.h,isVertical:i,align:w.align,style:e,rangeIdx:s,idx:1,otherValue:m,value:g,label:"".concat(r.format(g,t)),pos:p,state:r}))}}function Pf(e){const t=e.active.limitHigh-e.active.end,n=e.active.limitLow-e.active.start;let i=e.current-e.start;return i=i<0?Math.max(i,n):Math.min(i,t),i}function Lf(e){let t=[];const n=0===e.direction;if(Array.isArray(e.ranges)&&e.ranges.forEach(((i,r)=>{e.active&&r===e.active.idx||Of({borderHit:5,els:t,isVertical:n,state:e,vStart:Math.min(i.min,i.max),vEnd:Math.max(i.min,i.max),idx:r})})),e.active){let i=e.start,r=e.current;if(-1!==e.active.idx)if("foo"===e.active.mode)i=Math.min(e.active.start,e.active.end),r=Math.max(e.active.start,e.active.end);else if("modify"===e.active.mode)i=Math.min(e.start,e.current),r=Math.max(e.start,e.current);else{const t=Pf(e);i=e.active.start+t,r=e.active.end+t}Of({borderHit:5,els:t,isVertical:n,state:e,vStart:i,vEnd:r,idx:e.active.idx})}return t}function Tf(e){return{min:e.scale.min(),max:e.scale.max()}}function zf(e){return{min:0,max:e.direction?e.rect.width:e.rect.height}}function Ff(e,t,n){let i,r,o=e.ranges,a=-1;for(i=0;i<o.length;i++){if(o[i].min<=t&&t<=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(t<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"}),e.active=r}function jf(e){e.renderer.render(Lf(e))}function Vf(e,t){if(!t||!t.isActive())return[];const n=e.scale.data(),i=(n&&n.fields||[]).map((e=>e.id())),r=t.brushes().filter((e=>"range"===e.type&&-1!==i.indexOf(e.id)))[0];return r?r.brush.ranges():[]}function Bf(e,t){let n,i=1/0;const r=t.domain(),o=t.bandwidth()/2;for(let a=0;a<r.length;++a){const s=Math.abs(e-o-t(r[a]));s<i&&(i=s,n=r[a])}return n}function Hf(e,t){return Math.min(...e)<=Math.max(...t)&&Math.max(...e)>=Math.min(...t)}function $f(e){return ur(e.reduce(((e,t)=>(e.push(...cr(t.bounds)),e)),[]))}const Wf={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(e){this.start(e)},rangeMove(e){this.move(e)},rangeEnd(e){this.end(e)},rangeClear(e){this.clear(e)},bubbleStart(e){this.bubbleStart(e)}},created(){this.state={key:this.settings.key||"brush-range"}},beforeRender(e){this.state.rect=e.size.computedInner},renderRanges(){this.state.started||(this.state.ranges=Vf(this.state,this.state.brushInstance),this.state.active=null,jf(this.state))},render(e){const t=this.settings.settings;this.state.direction="vertical"===t.direction?0:1;const n=this.renderer.element().getBoundingClientRect(),i=this.state.rect[0===this.state.direction?"height":"width"];let r=Su(this.chart.scale(t.scale),i);const o=function(e){const t={targetRect:null,targetFillRect:null,scale:null,size:null},n=e.settings.settings,i=n.target&&(n.target.components||(n.target.component?[n.target.component]:[])).map((t=>e.chart.component(t))).filter((e=>!!e&&!!e.rect)),r=n.target&&n.target.selector?e.chart.findShapes(n.target.selector):[],o=n.target&&n.target.fillSelector?e.chart.findShapes(n.target.fillSelector):[];if(r.length>0){const i=$f(r);if(t.size=i[0===e.state.direction?"height":"width"],t.scale=Su(e.chart.scale(n.scale),t.size),t.targetRect=i,o.length>0){const e=$f(o);t.targetFillRect=e}}else if(i&&i.length>0){const n=i.slice(1).reduce(((e,t)=>({x0:Math.min(e.x0,t.rect.computedInner.x),y0:Math.min(e.y0,t.rect.computedInner.y),x1:Math.max(e.x1,t.rect.computedInner.x+t.rect.computedInner.width),y1:Math.max(e.y1,t.rect.computedInner.y+t.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});t.targetRect={x:n.x0-e.state.rect.x,y:n.y0-e.state.rect.y,width:n.x1-n.x0,height:n.y1-n.y0}}return t}(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=t,this.state.style=this.style,this.state.offset=n,this.state.brush="object"==typeof t.brush?t.brush.context:t.brush,this.state.brushInstance=this.chart.brush(this.state.brush),this.state.renderer=this.renderer,this.state.multi=!!t.multiple,this.state.h=e,this.state.onEditConfirmed=(e,t,n)=>{this.state.edit=null,function(e,t,n,i){let r=e.ranges.map((e=>({min:e.min,max:e.max})));const o=e.scale.min(),a=e.scale.max();r[t]={min:Math.max(o,Math.min(n,i)),max:Math.min(a,Math.max(n,i))},e.ranges[t]=ir({},r[t]);const s=e.scale.data();s&&s.fields&&s.fields.forEach((t=>{e.fauxBrushInstance||e.brushInstance.setRange(t.id(),r)}))}(this.state,e,t,n),this.emit("bubbleEnd"),jf(this.state)},this.state.onEditCanceled=()=>{this.state.edit=null,jf(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 t.bubbles.label&&((e,n)=>t.bubbles.label.call(void 0,{datum:e,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 t.brush&&t.brush.observe,this.state.fauxBrushInstance=null,this.state.findValues=null,this.state.scale=r;const e=this.state.scale.data();!this.state.format&&e&&e.fields&&e.fields[0]&&(this.state.format=e.fields[0].formatter())}else this.state.editable=!1,this.state.scale=Dc(),this.state.scale.data=r.data,this.state.format||(this.state.format=(e,t)=>Hf(r.range(),t)?function(e,t){const n=t.ticks(),i=t.domain().indexOf(Bf(e,t));return-1!==i?n[i].label:"-"}(e,r):"-"),this.state.fauxBrushInstance=hu(),this.state.findValues=e=>function(e,t){const n=t.domain(),i=t.range(),r=[];return e.forEach((e=>{if(!Hf(i,[e.min,e.max]))return;const o=n.indexOf(Bf(e.min,t)),a=n.indexOf(Bf(e.max,t));r.push.apply(r,n.slice(Math.min(o,a),Math.max(o,a)+1))})),r}(e,r);return this.state.ranges=Vf(this.state,this.state.brushInstance),this.state.observeBrush||this.state.sourcedFromThisComponent?[Lf(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(e){!function(e){let{state:t,e:n,renderer:i,ranges:r,targetSize:o}=e;if(t.started)return;t.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};t.offset=Qi({},i.element().getBoundingClientRect());const u=a-t.offset.left,h=s-t.offset.top;t.offset.left+=t.targetRect?t.targetRect.x:0,t.offset.top+=t.targetRect?t.targetRect.y:0,t.ranges=r(t,t.fauxBrushInstance||t.brushInstance);const d=n.center[t.cssCoord.coord]-n[t.cssCoord.pos]-t.offset[t.cssCoord.offset],f=n.center[t.cssCoord.coord]-t.offset[t.cssCoord.offset];c.current=t.scale.normInvert(f/t.size),c.start=t.scale.normInvert(d/t.size);let p=t.ranges;const m=Tf(t);let g,y,x=-1;if(l&&l.hasAttribute("data-idx"))x=parseInt(l.getAttribute("data-idx"),10),m.min=x>0?p[x-1].max:m.min,m.max=x+1<p.length?p[x+1].min:m.max;else{for(g=0;g<p.length;g++){if(p[g].min<=c.start&&c.start<=p[g].max){x=g,m.min=g?p[g-1].max:m.min,m.max=g+1<p.length?p[g+1].min:m.max;break}if(c.start<p[g].min){m.max=p[g].min,m.min=g?p[g-1].max:m.min;break}}-1===x&&p.length&&g>=p.length&&(m.min=p[p.length-1].max)}if(-1!==x||t.multi||(c.ranges=[],m.min=t.scale.min(),m.max=t.scale.max()),-1!==x)if(y={idx:x,start:p[x].min,end:p[x].max,limitLow:m.min,limitHigh:m.max,mode:"move"},l&&l.hasAttribute("data-other-value"))c.start=parseFloat(l.getAttribute("data-other-value")),y.mode="modify";else{let e=t.scale.norm(y.start)*t.size,n=t.scale.norm(y.end)*t.size;Math.abs(d-e)<=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:m.min,limitHigh:m.max,mode:"current"};c.active=y,"modify"!==y.mode&&t.targetRect&&!bh(t.targetRect,{x:u,y:h})||Object.keys(c).forEach((e=>t[e]=c[e]))}({e:e,state:this.state,renderer:this.renderer,ranges:Vf,targetSize:5})},end(){this.state.started&&(!function(e,t){e.started=!1,e.ranges=t(e,e.fauxBrushInstance||e.brushInstance);const n=Tf(e);Ff(e,e.current,n)}(this.state,Vf),jf(this.state),this.state.sourcedFromThisComponent=!0,this.state.active=null)},move(e){this.state.started&&(!function(e,t){const n=(t.center[e.cssCoord.coord]-e.offset[e.cssCoord.offset])/e.size,i=e.scale.normInvert(n);e.current=Math.max(Math.min(i,e.active.limitHigh),e.active.limitLow)}(this.state,e),function(e){let t=e.ranges.map((e=>({min:e.min,max:e.max})));if(-1!==e.active.idx)if("modify"===e.active.mode)t[e.active.idx].min=Math.min(e.start,e.current),t[e.active.idx].max=Math.max(e.start,e.current);else{const n=Pf(e);t[e.active.idx].min+=n,t[e.active.idx].max+=n}else t.push({min:Math.min(e.start,e.current),max:Math.max(e.start,e.current)});const n=e.scale.data();n&&n.fields&&n.fields.forEach((n=>{if(e.fauxBrushInstance){let i=Vf(e,e.fauxBrushInstance),r=e.findValues(i),o=e.findValues(t),a=o.filter((e=>-1===r.indexOf(e))),s=r.filter((e=>-1===o.indexOf(e))),l=a.map((e=>({key:n.id(),value:e}))),c=s.map((e=>({key:n.id(),value:e})));e.brushInstance.addAndRemoveValues(l,c),e.fauxBrushInstance.setRange(n.id(),t)}else e.brushInstance.setRange(n.id(),t)}))}(this.state),jf(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(e){if(!this.state.editable)return;const t=e.srcEvent||e,n=t.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,t.stopPropagation(),t.stopImmediatePropagation(),t.preventDefault();const r=n.parentNode;jf(this.state);const o=r.querySelector("input");o.focus(),o.select()}};function Uf(e){e.renderer.render(Lf(e))}function Yf(e){return e.rc.ranges()}function Gf(e,t){const n={x:e.direction?t.min+e.rect.x:e.rect.x,y:e.direction?e.rect.y:t.min+e.rect.y,width:e.direction?t.max-t.min:e.rect.width+e.rect.x,height:e.direction?e.rect.height+e.rect.y:t.max-t.min};return e.chart.shapesAt(n,e.settings.brush)}const Xf={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(e){this.start(e)},areaMove(e){this.move(e)},areaEnd(e){this.end(e)},areaClear(e){this.clear(e)}},created(){this.state={key:this.settings.key||"brush-area-dir"}},render(e){this.state.rect=this.rect;const t=this.settings.settings,n="vertical"===t.direction?0:1,i=this.state.rect[0===n?"height":"width"],r=this.renderer.element().getBoundingClientRect(),o=(t.target?t.target.components||[t.target.component]:[]).map((e=>this.chart.component(e))).filter((e=>!!e&&!!e.rect)),a=o[0]?o.slice(1).reduce(((e,t)=>({x0:Math.min(e.x0,t.rect.x),y0:Math.min(e.y0,t.rect.y),x1:Math.max(e.x1,t.rect.x+t.rect.width),y1:Math.max(e.y1,t.rect.y+t.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=t,this.state.offset=r,this.state.rc=Qc(),this.state.renderer=this.renderer,this.state.multi=!!t.multiple,this.state.h=e,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(e,t){return function(e,t,n){const i=Math.min(...n),r=Math.max(...n),o={x:e.direction?i+e.rect.x:e.rect.x,y:e.direction?e.rect.y:i+e.rect.y,width:e.direction?r-i:e.rect.width+e.rect.x,height:e.direction?e.rect.height+e.rect.y:r-i},a=e.chart.shapesAt(o,e.settings.brush);if(0===a.length)return"-";const s=a.reduce(((n,r)=>{const o=n.bounds,a=r.bounds;return t===i?o[e.cssCoord.coord]<=a[e.cssCoord.coord]?n:r:o[e.cssCoord.coord]+o[e.cssCoord.area]>=a[e.cssCoord.coord]+a[e.cssCoord.area]?n:r})),l=e.settings.brush.components.reduce(((e,t)=>e.key===s.key?e:t));return"function"==typeof e.settings.bubbles.label?e.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,e,t)},[]},start(e){!function(e){let{state:t,e:n,renderer:i,ranges:r,targetSize:o}=e;if(t.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};t.offset=i.element().getBoundingClientRect(),t.ranges=r(t);const u=a-t.offset.left,h=s-t.offset.top,d=n.center[t.cssCoord.coord]-n[t.cssCoord.pos]-t.offset[t.cssCoord.offset],f=n.center[t.cssCoord.coord]-t.offset[t.cssCoord.offset];let p=f,m=d;c.start=d,c.current=f;let g=t.ranges;const y=zf(t);let x,v,b=-1;if(l&&l.hasAttribute("data-idx"))b=parseInt(l.getAttribute("data-idx"),10),y.min=b>0?g[b-1].max:y.min,y.max=b+1<g.length?g[b+1].min:y.max;else{for(x=0;x<g.length;x++){if(g[x].min<=m&&m<=g[x].max){b=x,y.min=x?g[x-1].max:y.min,y.max=x+1<g.length?g[x+1].min:y.max;break}if(m<g[x].min){y.max=g[x].min,y.min=x?g[x-1].max:y.min;break}}-1===b&&g.length&&x>=g.length&&(y.min=g[g.length-1].max)}if(-1!==b||t.multi||(c.ranges=[],y.min=0,y.max=t.direction?t.rect.width:t.rect.height),-1!==b)if(v={idx:b,start:g[b].min,end:g[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 e=v.start,t=v.end;Math.abs(d-e)<=o?(c.start=v.end,v.mode="modify"):Math.abs(d-t)<=o&&(c.start=v.start,v.mode="modify")}else v={idx:-1,start:m,end:p,limitLow:y.min,limitHigh:y.max,mode:"current"};c.active=v,"modify"!==v.mode&&t.targetRect&&!bh(t.targetRect,{x:u,y:h})||Object.keys(c).forEach((e=>t[e]=c[e]))}({e:e,state:this.state,renderer:this.renderer,ranges:Yf,targetSize:5})},end(){this.state.started&&(!function(e,t){e.started=!1,e.ranges=t(e);const n=zf(e);Ff(e,e.current,n)}(this.state,Yf),Uf(this.state))},move(e){this.state.started&&(!function(e,t){const n=t.center[e.cssCoord.coord]-e.offset[e.cssCoord.offset];e.current=Math.max(Math.min(n,e.active.limitHigh),e.active.limitLow)}(this.state,e),function(e){const t=e.ranges.map((e=>({min:e.min,max:e.max})));if(-1!==e.active.idx)if("modify"===e.active.mode)t[e.active.idx].min=Math.min(e.start,e.current),t[e.active.idx].max=Math.max(e.start,e.current);else{const n=Pf(e);t[e.active.idx].min=e.active.start+n,t[e.active.idx].max=e.active.end+n}else t.push({min:Math.min(e.start,e.current),max:Math.max(e.start,e.current)});e.rc.set(t);let n=[];t.forEach((t=>{n=[...n,...Gf(e,t)]})),function(e,t){e.chart.brushFromShapes(t,e.settings.brush)}(e,n)}(this.state),Uf(this.state))},clear(){this.state.rc&&this.state.rc.clear(),this.state.renderer.render([])}};function Kf(e){const t="vertical"===e.direction,n=e.rect[t?"height":"width"],i=e.rect[t?"width":"height"];return function(e){const t=e.brush;if(!t||!t.isActive())return[];const n=e.scale.data(),i=(n&&n.fields||[]).map((e=>e.id())),r=t.brushes().filter((e=>"range"===e.type&&-1!==i.indexOf(e.id)))[0];return r?r.brush.ranges():[]}(e).map((r=>{const o=e.scale(r.min)*n,a=e.scale(r.max)*n,s=Math.min(o,a),l=Math.abs(o-a);return{type:"rect",fill:e.fill,opacity:e.opacity,x:t?0:s,width:t?i:l,y:t?s:0,height:t?l:i}}))}function Zf(e,t,n,i){function r(){!function(e){e.renderer.render(Kf(e))}(e)}function o(){!function(e){e.renderer.render(Kf(e))}(e)}function a(){!function(e){e.renderer.render(Kf(e))}(e)}e.brush=t,t&&(t.on("start",r),t.on("update",o),t.on("end",a),e.start=r,e.update=o,e.end=a,e.brush=t,e.scale=n,e.renderer=i)}function Jf(e){e.brush&&(e.brush.removeListener("start",e.start),e.brush.removeListener("update",e.update),e.brush.removeListener("end",e.end)),e.start=void 0,e.update=void 0,e.end=void 0,e.brush=void 0,e.scale=void 0,e.renderer=void 0}const Qf={require:["chart","settings","renderer"],defaultSettings:{settings:{}},preferredSize:()=>50,created(){this.state={}},render(){const e=this.settings.settings,t=this.chart.brush(e.brush),n=e.direction||"horizontal",i="horizontal"===n?this.rect.width:this.rect.height,r=Su(this.chart.scale(e.scale),i);return Jf(this.state),Zf(this.state,t,r,this.renderer),this.state.rect=this.rect,this.state.fill=e.fill||"#ccc",this.state.opacity=void 0!==e.opacity?e.opacity:1,this.state.direction=n,Kf(this.state)},beforeDestroy(){Jf(this.state)}};function ep(e,t){const n=t.center.x,i=t.center.y;return{x:n-e.left,y:i-e.top}}function tp(e,t,n){return Bu(e,t.points[0])<n.settings.snapIndicator.threshold**2}function np(e,t){null==e.path.d?e.path.d="M".concat(t.x," ").concat(t.y," "):e.path.d+="L".concat(t.x," ").concat(t.y," "),e.points.push(t)}function ip(e){let{state:t,start:n=null,end:i=null}=e;null!==n&&(t.snapIndicator.x1=n.x,t.snapIndicator.y1=n.y),null!==i&&(t.snapIndicator.x2=i.x,t.snapIndicator.y2=i.y)}function rp(e,t){e.snapIndicator.visible=t}const op={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(e){this.start(e)},lassoEnd(e){this.end(e)},lassoMove(e){this.move(e)},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(e){var t;this.state.active=!0,this.state.path={visible:!0,type:"path",d:null,fill:(t=this.settings.settings.lasso).fill,stroke:t.stroke,strokeWidth:t.strokeWidth,opacity:t.opacity,strokeDasharray:t.strokeDasharray,collider:{type:null}},this.state.snapIndicator=function(e){return{visible:!1,type:"line",x1:0,y1:0,x2:0,y2:0,strokeDasharray:e.strokeDasharray,stroke:e.stroke,strokeWidth:e.strokeWidth,opacity:e.opacity,collider:{type:null}}}(this.settings.settings.snapIndicator),this.state.startPoint=function(e){return{visible:!0,type:"circle",cx:0,cy:0,r:e.r,fill:e.fill,opacity:e.opacity,stroke:e.stroke,strokeWidth:e.strokeWidth,collider:{type:null}}}(this.settings.settings.startPoint),this.state.rendererBounds=this.renderer.element().getBoundingClientRect(),this.state.componentDelta=function(e,t){const n=e.element.getBoundingClientRect();return{x:t.left-n.left,y:t.top-n.top}}(this.chart,this.state.rendererBounds),this.state.brushConfig=this.settings.settings.brush.components.map((e=>({key:e.key,contexts:e.contexts||["lassoBrush"],data:e.data||[""],action:e.action||"add"})));const n=ep(this.state.rendererBounds,e);np(this.state,n),ip({state:this.state,start:n}),function(e,t){e.startPoint.cx=t.x,e.startPoint.cy=t.y}(this.state,n)},move(e){if(!this.state.active)return;const t=ep(this.state.rendererBounds,e);tp(t,this.state,this.settings)?rp(this.state,!0):rp(this.state,!1),np(this.state,t),ip({state:this.state,end:t}),function(e,t){const n=[e.startPoint,e.path,e.snapIndicator].filter((e=>e.visible));t.render(n)}(this.state,this.renderer),function(e,t){if(e.active){const n=e.points[e.points.length-2],i=e.points[e.points.length-1];e.lineBrushShape.x1=n.x+e.componentDelta.x,e.lineBrushShape.y1=n.y+e.componentDelta.y,e.lineBrushShape.x2=i.x+e.componentDelta.x,e.lineBrushShape.y2=i.y+e.componentDelta.y;const r=t.shapesAt(e.lineBrushShape,{components:e.brushConfig});t.brushFromShapes(r,{components:e.brushConfig})}}(this.state,this.chart)},end(e){if(!this.state.active)return;rp(this.state,!1);tp(ep(this.state.rendererBounds,e),this.state,this.settings)&&function(e,t){if(e.active){const n=e.componentDelta.x,i=e.componentDelta.y,r=e.points.map((e=>({x:e.x+n,y:e.y+i}))),o=t.shapesAt({vertices:r},{components:e.brushConfig});t.brushFromShapes(o,{components:e.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 e,t;this.state.active&&(e=this.state,t=this.chart,e.brushConfig.forEach((e=>{e.contexts.forEach((e=>{t.brush(e).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 ap(e,t,n,i,r){let o,a=0,s=t.length-1;for(;a<s;){let l=Math.floor((a+s)/2);o=r(t[l]),o[n]+o[i]<e[n]?a=l+1:s=l}return a}function sp(e){let{orientation:t,targetNodes:n,labels:i,container:r}=e,o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:ap;const a=[],s="v"===t?"x":"y",l="v"===t?"width":"height",c=e=>e.textBounds,u=e=>e.node.localBounds;return(e,t)=>{const{textBounds:h,node:d}=i[t];if(h[s]<r[s]||h[s]+h[l]>r[s]+r[l])return!1;for(let e=o(h,a,s,l,c);e<a.length;e++)if(xh(h,a[e].textBounds))return!1;const f=o(h,n,s,l,u),p=h[s]+h[l];for(let e=f;e<n.length;e++){const t=n[e].node;if(p<t.localBounds[s])break;if(xh(h,t.localBounds)&&d!==t)return!1}return a.push(i[t]),!0}}const lp=4;function cp(e,t){return{node:e,data:e.data,scale:t.scale,formatter:t.formatter,dataset:t.dataset}}function up(e){const t=typeof e;return("string"===t||"number"===t)&&""!==e}function hp(e){return ir(ir({type:"rect",rx:2,ry:2,fill:e.backgroundColor},e.backgroundBounds),{},{data:"".concat(e.data," ").concat(e.text),rotation:e.transform&&e.transform.match(/rotate/gi)?"rotated":"horizontal"})}function dp(e,t,n){return n?e.width>=t.height:e.width>=t.width}function fp(e,t,n){return n?e.height>=t.width:e.height>=t.height}function pp(e,t,n,i,r){let o,a;return"v"===e?(o=i||r||dp(t,n,!0),a=fp(t,n,!i)):(o=dp(t,n),a=r||fp(t,n,!1)),o&&a}function mp(e,t,n,i){return e+.5*t+(i-.5)*(t-n)-.5*n}function gp(e,t,n){const i={type:"text",text:t,maxWidth:n.rotate?e.height:e.width,x:0,y:e.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(e,t,n){return dp(e,t,n.rotate)&&fp(e,t,n.rotate)}(e,r,n))return!1;const o=.5*r.height;return n.rotate?(i.x=mp(e.x,e.width,r.height,n.align)+o,i.y=mp(e.y,e.height,r.width,n.justify),i.transform="rotate(-90, ".concat(i.x+i.dx,", ").concat(i.y+i.dy,")")):(i.x=mp(e.x,e.width,r.width,n.align),i.y=mp(e.y,e.height,r.height,n.justify)+o),i}function yp(e){let{bar:t,view:n,direction:i,position:r,padding:o=lp,measured:a}=e;const s={};if(Qi(s,t),r&&"inside"!==r)if("up"===i||"down"===i){const e=Math.max(0,Math.min(t.y,n.height)),o=Math.max(0,Math.min(t.y+t.height,n.height));"outside"===r&&"up"===i||"opposite"===r&&"down"===i?(s.y=0,s.height=e):("outside"===r&&"down"===i||"opposite"===r&&"up"===i)&&(s.y=o,s.height=n.height-o)}else{const e=Math.max(0,Math.min(t.x,n.width)),o=Math.max(0,Math.min(t.x+t.width,n.width));"outside"===r&&"left"===i||"opposite"===r&&"right"===i?(s.x=0,s.width=e):("outside"===r&&"right"===i||"opposite"===r&&"left"===i)&&(s.x=o,s.width=n.width-o)}else;return function(e,t){const n=Math.max(0,Math.min(e.y,t.height)),i=Math.max(0,Math.min(e.y+e.height,t.height)),r=Math.max(0,Math.min(e.x,t.width)),o=Math.max(0,Math.min(e.x+e.width,t.width));e.x=r,e.width=o-r,e.y=n,e.height=i-n}(s,n),function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const{top:i=lp,bottom:r=lp,left:o=lp,right:a=lp}=n,s="function"==typeof o?o(t):o,l="function"==typeof a?a(t):a,c="function"==typeof i?i(t):i,u="function"==typeof r?r(t):r;e.x+=s,e.width-=s+l,e.y+=c,e.height-=c+u}(s,a,o),s}function xp(e){let t,n,i,r,o,{direction:a,fitsHorizontally:s,measured:l,node:c,orientation:u,placementSettings:h,rect:d}=e,f=arguments.length>1&&void 0!==arguments[1]?arguments[1]:yp;const p=[],m="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),t=!o||r[m]>t[m]?r:t,pp(u,r,l,s,i.overflow)){n=r;break}return n||(n=t,o=p.indexOf(n)),i=h[o],{bounds:n,placement:i}}function vp(e,t,n,i){let r=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{};const{top:o=lp,bottom:a=lp,left:s=lp,right:l=lp}=r,c="function"==typeof s?s(t):s,u="function"==typeof l?l(t):l,h="function"==typeof o?o(t):o,d="function"==typeof a?a(t):a,f=e.x+e.dx,p=e.y+e.dy,m=n?Math.min(t.width,i.height):Math.min(t.height,i.width),g=n?Math.min(t.height,i.height):Math.min(t.width,i.width),y=.5*t.height,x=1e-9;return{x:(n?f-y:f)-c-x,y:(n?p:p-y)-h-x,width:g+(c+u)-x,height:m+(h+d)-x}}function bp(e){let{chart:t,targetNodes:n,rect:i,fitsHorizontally:r,collectiveOrientation:o}=e,a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:xp,s=arguments.length>2&&void 0!==arguments[2]?arguments[2]:gp,l=arguments.length>3&&void 0!==arguments[3]?arguments[3]:sp;const c=[],u={container:i,targetNodes:n,labels:[],orientation:o};let h,d,f,p,m,g,y,x,v,b,w,M,k,S;for(let e=0,l=n.length;e<l;e++){g=null,d=n[e],f=d.node,k=cp(f,t),v=d.direction,S="left"===v||"right"===v?"h":"v";for(let t=0;t<d.texts.length;t++){if(p=d.texts[t],!up(p))continue;b=d.labelSettings[t],x=d.measurements[t],M=b.placements;const n=a({direction:v,fitsHorizontally:r,lblStngs:b,measured:x,node:f,orientation:S,placements:M,placementSettings:d.placementSettings[t],rect:i});if(g=n.bounds,w=n.placement,g&&w){m=w.justify;const t="function"==typeof b.linkData?b.linkData(k,e):void 0,n="function"==typeof w.overflow?w.overflow(k,e):w.overflow;"up"===v&&(m=1-m),"opposite"===w.position&&(m=1-m),"left"===v&&(m=1-m);const i=!("h"===o||r);if(h=s(g,p,{justify:"h"===S?w.align:m,align:"h"===S?m:w.align,fontSize:b.fontSize,fontFamily:b.fontFamily,textMetrics:x,rotate:i,overflow:!!n}),h){const n=vp(h,x,i,g,w.padding);y="function"==typeof w.fill?w.fill(ir(ir({},k),{},{textBounds:n}),e):w.fill,h.fill=y,void 0!==t&&(h.data=t),"object"==typeof w.background&&(h.backgroundColor="function"==typeof w.background.fill?w.background.fill(ir(ir({},k),{},{textBounds:n}),e):w.background.fill,void 0!==h.backgroundColor&&(h.backgroundBounds=vp(h,x,i,g,w.background.padding))),c.push(h),u.labels.push({node:f,textBounds:n})}}}}const _=c.filter(l(u));return[..._.filter((e=>void 0!==e.backgroundBounds)).map(hp),..._]}function wp(e){const t=2*Math.PI;return(e%t+t)%t}function Mp(e,t){e.x+=t,e.width-=2*t,e.y+=t,e.height-=2*t}function kp(e){return{x:e.x,y:e.y-e.height/2,width:e.width,height:e.height}}function Sp(e,t,n){let{x:i,y:r}=t;if(i*i+r*r>e*e)return null;let o=Math.sin(n),a=Math.cos(n),s=i*a-r*o,l=e*e-s*s;if(l<0)return null;let c=Math.sqrt(l);return{x:s*a+o*c,y:-s*o+a*c}}function _p(e){let t,n,{radius:i,size:r,angle:o}=e,{width:a,height:s}=r,l={x:a/2,y:s/2};switch(Math.floor(o/(Math.PI/2))){case 0:if(t=Sp(i,l,o),!t)return null;t.y*=-1,n={x:-a,y:0};break;case 1:if(t=Sp(i,l,Math.PI-o),!t)return null;n={x:-a,y:-s};break;case 2:if(t=Sp(i,l,o-Math.PI),!t)return null;t.x*=-1,n={x:0,y:-s};break;case 3:if(t=Sp(i,l,2*Math.PI-o),!t)return null;t.x*=-1,t.y*=-1,n={x:0,y:0};break;default:throw new Error("invalid angle")}return{x:t.x+n.x,y:t.y+n.y,width:a,height:s}}function qp(e){let{slice:t,measured:n,padding:i}=e,{start:r,end:o,innerRadius:a,outerRadius:s}=t,l=s-a-2*i,c=o-r;if(c<Math.PI){let e=(n.height/2+i)/Math.tan(c/2);e>a&&(l=s-e-2*i)}if(l<0||l<n.minReqWidth)return null;const u=wp((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 Dp(e){let{context:t,node:n,bounds:i}=e;let{start:r,end:o}=n.desc.slice;const a=wp((r+o)/2);switch(Math.floor(a/(Math.PI/2))){case 0:t.q1maxY=i.y-2,void 0===t.q2minY&&(t.q2minY=i.y+i.height+2);break;case 1:t.q2minY=i.y+i.height+2;break;case 2:t.q3minY=i.y+i.height+2;break;case 3:t.q4maxY=i.y-2,void 0===t.q3minY&&(t.q3minY=i.y+i.height+2)}}function Ap(e,t){return{node:e,data:e.data,scale:t.scale,formatter:t.formatter,dataset:t.dataset}}function Cp(e,t,n){const i={type:"text",text:t,maxWidth:e.width,x:e.x,y:e.y+("top"===e.baseline?e.height/2:0),fill:n.fill,anchor:e.anchor||"start",baseline:"middle",fontSize:"".concat(n.fontSize,"px"),fontFamily:n.fontFamily};if(!isNaN(e.angle)){let t=e.angle*(360/(2*Math.PI));i.transform="rotate(".concat(t,", ").concat(i.x,", ").concat(i.y,")")}return i}function Np(e){let t,n,{slice:i,direction:r,position:o,padding:a,measured:s,view:l,context:c,store:u}=e,{start:h,end:d,innerRadius:f,offset:p}=i;switch(o){case"into":t="rotate"===r?qp({slice:i,measured:s,padding:a}):function(e){let{slice:t,padding:n,measured:i}=e,{start:r,end:o,innerRadius:a,outerRadius:s}=t;const l=wp((r+o)/2);let c=_p({radius:s,size:{width:i.width+2*n+1,height:i.height+2*n},angle:l});return c?(c.baseline="top",wh(c,{x1:0,y1:0,x2:Math.sin(r)*s,y2:-Math.cos(r)*s})||wh(c,{x1:0,y1:0,x2:Math.sin(o)*s,y2:-Math.cos(o)*s})||dh({cx:0,cy:0,r:a},c)?null:(Mp(c,n),c)):null}({slice:i,measured:s,padding:a});break;case"inside":n={start:h,end:d,innerRadius:0,outerRadius:f},t="rotate"===r?qp({slice:n,measured:s,padding:a}):function(e){let{slice:t,padding:n,measured:i,store:r}=e;const{start:o,end:a,outerRadius:s}=t,l=wp((o+a)/2);let c=_p({radius:s,size:{width:i.width+2*n+1,height:i.height+2*n},angle:l});return c?(c.baseline="top",Mp(c,n),r.insideLabelBounds.some((e=>xh(e,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":t="rotate"===r?function(e){let{slice:t,measured:n,padding:i,view:r}=e,{start:o,end:a,outerRadius:s,offset:l}=t,c=s+i,u=a-o;if(u<Math.PI&&(n.height/2+i)/Math.tan(u/2)>c)return null;const h=wp((o+a)/2);let d=Math.sin(h)*c,f=-Math.cos(h)*c,p=n.width+1,m=h%Math.PI;if(m>Math.PI/2&&(m=Math.PI-m),Math.cos(m)>.001){let e=f<0?r.y:r.y+r.height,t=Math.abs(e-l.y)/Math.cos(m)-Math.tan(m)*(n.height/2)-2*i-s;t<p&&(p=t)}if(Math.sin(m)>.001){let e=d<0?r.x:r.x+r.width,t=Math.abs(e-l.x)/Math.sin(m)-n.height/2/Math.tan(m)-2*i-s;t<p&&(p=t)}if(p<=0||p<n.minReqWidth)return null;let g={x:d,y:f,width:p,height:n.height};return h<Math.PI?(g.angle=h-Math.PI/2,g.anchor="start"):(g.angle=h+Math.PI/2,g.anchor="end"),g}({slice:i,measured:s,padding:a,view:l}):function(e){let{slice:t,measured:n,padding:i,view:r,context:o}=e,{start:a,end:s,outerRadius:l,offset:c}=t;const u=wp((a+s)/2);if(function(e,t,n){switch(t){case 0:return e.q1maxY<0;case 1:return e.q2minY>n.height;case 2:return e.q3minY>n.height;case 3:return e.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 e=Math.abs(r.x+r.width-(d+c.x));e<p&&(p=e)}else{let e=Math.abs(r.x-(d+c.x));e<p&&(p=e)}if(p<n.minReqWidth)return null;let m={x:d,y:f,width:p,height:n.height};return u<Math.PI?m.anchor="start":m.anchor="end",m}({slice:i,measured:s,padding:a,view:l,context:c});break;default:throw new Error("not implemented")}return t&&(t.x+=p.x,t.y+=p.y,"outside"===o&&"rotate"!==r&&function(e,t,n){const{start:i,end:r,offset:o,outerRadius:a}=n,s=wp((i+r)/2);switch(Math.floor(s/(Math.PI/2))){case 0:if(void 0!==t.q1maxY){let n=Math.min(e.y,t.q1maxY-e.height),i=e.y-n;if(e.y=n,i>1){let t=a+2;e.line={type:"line",x1:e.x-2,y1:e.y+2,x2:o.x+Math.sin(s)*t,y2:o.y-Math.cos(s)*t,strokeWidth:1}}}break;case 1:if(void 0!==t.q2minY){let n=Math.max(e.y,t.q2minY),i=n-e.y;if(e.y=n,i>1){let t=a+2;e.line={type:"line",x1:e.x-2,y1:e.y-2,x2:o.x+Math.sin(s)*t,y2:o.y-Math.cos(s)*t,strokeWidth:1}}}break;case 2:if(void 0!==t.q3minY){let n=Math.max(e.y,t.q3minY),i=n-e.y;if(e.y=n,i>1){let t=a+2;e.line={type:"line",x1:e.x+2,y1:e.y-2,x2:o.x+Math.sin(s)*t,y2:o.y-Math.cos(s)*t,strokeWidth:1}}}break;case 3:if(void 0!==t.q4maxY){let n=Math.min(e.y,t.q4maxY-e.height),i=e.y-n;if(e.y=n,i>1){let t=a+2;e.line={type:"line",x1:e.x+2,y1:e.y+2,x2:o.x+Math.sin(s)*t,y2:o.y-Math.cos(s)*t,strokeWidth:1}}}}}(t,c,i)),t}function Ep(e){let{context:t,direction:n,measured:i,node:r,placementSettings:o,rect:a,store:s}=e,l=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Np;for(let e=0;e<o.length;e++){let c=o[e],u=l({context:t,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 Rp(e,t,n){const i=t.fontFamily,r="".concat(t.fontSize,"px"),o=n.measureText({text:e,fontFamily:i,fontSize:r});return o.minReqWidth=Math.min(o.width,n.measureText({text:"".concat(e[0],"…"),fontFamily:i,fontSize:r}).width),o}const Ip=/\n+|\r+|\r\n/,Op=/\s/,Pp=/[a-zA-Z\u00C0-\u00F6\u00F8-\u00FF\u00AD]/;function Lp(e){return"string"==typeof e?-1!==e.search(Ip):-1!==String(e).search(Ip)}function Tp(e){return-1!==e.search(Op)}function zp(e){return-1!==e.search(Pp)}function Fp(e,t,n){return Math.max(t,Math.min(n,e))}function jp(){let{string:e,separator:t="",reverse:n=!1,measureText:i=e=>({width:e.length,height:1}),mandatoryBreakIdentifiers:r=[Lp],noBreakAllowedIdentifiers:o=[],suppressIdentifier:a=[Tp,Lp,e=>""===e],hyphenationIdentifiers:s=[zp]}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const l=String(e).split(t);!function(e){""===e[0]&&e.shift(),""===e[e.length-1]&&e.pop()}(l);const c=l.length,u=n?e=>e>=0:e=>e<c;let h=n?c:-1;function d(e){const t=Fp(e,0,c-1),n=l[t],u=i(n),h=function(e,t,n,i,r){return i.some((i=>i(e,t,n)))?1:r.some((i=>i(e,t,n)))?0:2}(n,t,l,r,o);return{index:t,value:n,breakOpportunity:h,suppress:a.some((e=>e(n,t,l))),hyphenation:s.some((e=>e(n,t,l))),width:u.width,height:u.height,done:!1}}return{next:function(e){return isNaN(e)?n?h--:h++:h=Fp(e,0,c-1),u(h)?d(h):{done:!0}},peek:d,length:c}}const Vp="…",Bp=/^\s*\d+(\.\d+)?px\s*$/i;function Hp(e){return"string"===typeof e&&Bp.test(e)}function $p(e){const t=e["font-size"]||e.fontSize;return Hp(t)?parseFloat(t)*Math.max(isNaN(e.lineHeight)?1.2:e.lineHeight,0):19.2}function Wp(e){const t=e.maxHeight,n=Math.max(e.maxLines,1)||1/0;if(isNaN(t))return n;const i=$p(e);return Math.max(1,Math.min(Math.floor(t/i),n))}function Up(e,t){return{lines:[],line:"",width:0,maxLines:Wp(e),maxWidth:e.maxWidth,hyphens:{enabled:"auto"===e.hyphens,char:"‐",metrics:t("‐")}}}function Yp(e){e.lines.push(e.line),e.line="",e.width=0}function Gp(e,t){e.line+=t.value,e.width+=t.width}function Xp(e,t,n){if(t.width>e.maxWidth)return t;const i=t.index;for(let r=1;r<5;r++){const o=n.peek(t.index-1);if(!t.hyphenation||!o.hyphenation||0===t.index)return t;if(e.width+e.hyphens.metrics.width<=e.maxWidth)return e.line+=e.hyphens.char,t;if(1===e.line.length)return t;t=n.next(i-r),e.line=e.line.slice(0,-1),e.width-=t.width}return t}function Kp(e,t,n){const i=jp({string:t.value,measureText:n});for(;e.lines.length<e.maxLines;){let t=i.next();if(t.done)break;e.width+t.width>e.maxWidth&&2===t.breakOpportunity&&e.line.length>0?(t=e.hyphens.enabled?Xp(e,t,i):t,Yp(e),Gp(e,t)):Gp(e,t)}}function Zp(e,t){const n=jp({string:e.text,separator:"",measureText:t,noBreakAllowedIdentifiers:[(e,t)=>0===t]}),i=Up(e,t);let r=!0;for(;i.lines.length<i.maxLines;){let e=n.next();if(e.done){Yp(i),r=!1;break}1===e.breakOpportunity?Yp(i):i.width+e.width>i.maxWidth&&2===e.breakOpportunity?e.suppress?i.width+=e.width:(e=i.hyphens.enabled?Xp(i,e,n):e,Yp(i),Gp(i,e)):Gp(i,e)}return{lines:i.lines,reduced:r}}function Jp(e,t){const n=jp({string:e.text,separator:/(\s|-|\u2010)/,measureText:t}),i=Up(e,t);let r=!0;for(;i.lines.length<i.maxLines;){let e=n.next();if(e.done){Yp(i),r=!1;break}1===e.breakOpportunity?Yp(i):i.width+e.width>i.maxWidth&&2===e.breakOpportunity?e.suppress?Yp(i):e.width>i.maxWidth?Kp(i,e,t):(Yp(i),Gp(i,e)):Gp(i,e)}return{lines:i.lines,reduced:r}}function Qp(e){return{"break-all":Zp,"break-word":Jp}[e.wordBreak]}function em(e){return t=>{const n=t.node;if(function(e){return"text"===e.type&&!e._lineBreak}(n)){const i=Qp(n);if(!i)return;const r=e(n);if(r.width>n.maxWidth||Lp(n.text)){const o=($p(n)-r.height)/2,a=i(n,function(e,t){return n=>t({text:n,fontSize:e.fontSize,fontFamily:e.fontFamily})}(n,e));t.node=function(e,t,n,i){const r={type:"container",children:[]};void 0!==t.id&&(r.id=t.id);let o=0;return e.lines.forEach(((a,s)=>{const l=Qi({},t);l.text=a,l._lineBreak=!0,o+=n,e.reduced&&s===e.lines.length-1?l.text+=Vp: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 tm(e,t){const n=e["font-family"]||e.fontFamily,i=e["font-size"]||e.fontSize,r="string"==typeof e.text?e.text:"".concat(e.text),{maxWidth:o}=e;if(void 0===o)return r;let a=t({text:r,fontSize:i,fontFamily:n}).width;if(a<=o)return r;let s=0,l=r.length-1;for(;s<=l;){let e=Math.floor((s+l)/2);a=t({text:r.substr(0,e)+Vp,fontSize:i,fontFamily:n}).width,a<=o?s=e+1:l=e-1}return r.substr(0,l)+Vp}function nm(e){const t=e.baseline||e["dominant-baseline"];let n=0;const i=parseInt(e.fontSize||e["font-size"],10)||0;switch(t){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 im={},rm={},om={fontSize:void 0,fontFamily:void 0};let am;function sm(e,t){return!e&&!t||e===t}function lm(e){let{text:t,fontWeight:n,fontSize:i,fontFamily:r}=e;const o="".concat(t," ").concat(n," ").concat(i," ").concat(r);return"number"!=typeof rm[o]&&(am=am||document.createElement("canvas").getContext("2d"),function(e){let{fontWeight:t,fontSize:n,fontFamily:i}=e;sm(om.fontWeight,t)&&sm(om.fontSize,n)&&sm(om.fontFamily,i)||(am.font=[t,n,i].filter((e=>!!e)).join(" "),om.fontWeight=t,om.fontSize=n,om.fontFamily=i)}({fontWeight:n,fontSize:i,fontFamily:r}),rm[o]=am.measureText(t).width),rm[o]}function cm(e){return"number"!=typeof im[e]&&(im[e]=function(e){if(Hp(e)){const t=parseFloat(e);return t+4*Math.ceil((t+1e-12)/24)}return 16}(e)),im[e]}function um(e){let{text:t,fontWeight:n,fontSize:i,fontFamily:r}=e;return{width:lm({text:t,fontWeight:n,fontSize:i,fontFamily:r}),height:cm(i)}}function hm(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:um;const n=e["font-size"]||e.fontSize,i=e["font-family"]||e.fontFamily,r=t({text:e.text,fontFamily:i,fontSize:n}),o=Math.min(e.maxWidth||r.width,r.width),a=e.x||0,s=e.y||0,l=e.dx||0,c={x:0,y:s+((e.dy||0)+nm(e))-.75*r.height,width:o,height:r.height},u=e["text-anchor"]||e.anchor;return c.x="middle"===u?a+l-o/2:"end"===u?a+l-o:a+l,c}function dm(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:um;const n=Qp(e),i=e["font-size"]||e.fontSize,r=e["font-family"]||e.fontFamily,o=t({text:e.text,fontFamily:r,fontSize:i});if(n&&(o.width>e.maxWidth||Lp(e.text))){const o=n(e,(e=>t({text:e,fontFamily:r,fontSize:i}))),a=Qi({},e);let s=0,l="";for(let e=0,n=o.lines.length;e<n;e++){let a=o.lines[e];a+=e===n-1&&o.reduced?Vp:"";const c=t({text:a,fontSize:i,fontFamily:r}).width;c>=s&&(s=c,l=a)}a.text=l;const c=hm(a,t);return c.height=$p(e)*o.lines.length,c}return hm(e,t)}function fm(e,t){return{node:e,data:e.data,scale:t.scale,formatter:t.formatter,dataset:t.dataset}}function pm(e,t,n){const i={type:"text",text:t,maxWidth:e.width,x:0,y:e.y,dx:0,dy:0,fill:n.fill,anchor:"start",baseline:"alphabetical",fontSize:"".concat(n.fontSize,"px"),fontFamily:n.fontFamily},r=n.textMetrics;if(e.width<n.fontSize)return!1;const o=Math.max(0,e.width-r.width);return i.x=e.x+n.align*o,i.y=e.y+r.height/1.2,i}function mm(e){let{cx:t,cy:n,r:i}=e;return{type:"circle",bounds:{cx:t,cy:n,r:i}}}function gm(e){return e.desc&&e.desc.slice?function(e){let{start:t,end:n,innerRadius:i,outerRadius:r,offset:o}=e;if(Math.abs(t+2*Math.PI-n)>1e-12)return{type:null,bounds:null};let a=0!==i?i:r;return mm({cx:o.x,cy:o.y,r:a})}(e.desc.slice):"circle"===e.type?mm(e.attrs):"rect"===e.type?{type:"rect",bounds:e.bounds}:{type:null,bounds:null}}var ym={bar:function(e){let{settings:t,chart:n,nodes:i,rect:r,renderer:o,style:a}=e,s=arguments.length>1&&void 0!==arguments[1]?arguments[1]:bp;const l=Qi({fontSize:12,fontFamily:"Arial",align:.5,justify:0,fill:"#333"},a.label);l.fontSize=parseInt(l.fontSize,10);const c=t.labels.map((e=>Qi({},l,t,e))),u=t.labels.map((e=>e.placements.map((n=>Qi({},l,t,e,n))))),{fitsHorizontally:h,hasHorizontalDirection:d,targetNodes:f}=function(e){let{nodes:t,rect:n,chart:i,labelSettings:r,placementSettings:o,settings:a,renderer:s}=e;const l={},c=[];let u,h,d,f,p,m,g,y=!0,x=!1;for(let e=0;e<t.length;e++){if(h=t[e],f=h.localBounds,!xh(f,n))continue;let v=cp(h,i);u={node:h,texts:[],measurements:[],labelSettings:[],placementSettings:[]};for(let t=0;t<r.length;t++)m=r[t],d="function"==typeof m.label?m.label(v,e):void 0,up(d)&&(g="function"==typeof a.direction?a.direction(v,e):a.direction||"up",x=x||"left"===g||"right"===g,l.fontFamily=m.fontFamily,l.fontSize="".concat(m.fontSize,"px"),l.text=d,p=s.measureText(l),u.measurements.push(p),u.texts.push(d),u.labelSettings.push(m),u.placementSettings.push(o[t]),u.direction=g,y=y&&p.width<=f.width-2*lp);c.push(u)}return{targetNodes:c,fitsHorizontally:y,hasHorizontalDirection:x}}({nodes:i,chart:n,renderer:o,settings:t,rect:r,labelSettings:c,placementSettings:u}),p=function(e){let{orientation:t="auto",defaultOrientation:n="h"}=e;switch(t.toLocaleLowerCase()){case"vertical":return"v";case"horizontal":return"h";default:return n}}({orientation:t.orientation,defaultOrientation:d?"h":"v"}),m="h"===p?"y":"x",g="h"===p?"height":"width";return f.sort(((e,t)=>e.node.localBounds[m]+e.node.localBounds[g]-(t.node.localBounds[m]+t.node.localBounds[g]))),s({chart:n,targetNodes:f,stngs:t,rect:r,fitsHorizontally:h,collectiveOrientation:p})},slice:function(e){let{settings:t,chart:n,nodes:i,rect:r,renderer:o,style:a}=e,s=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Ep,l=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Cp;const c=Qi({fontSize:12,fontFamily:"Arial",fill:"#333",padding:4,position:"into"},a.label);c.fontSize=parseInt(c.fontSize,10);const u=t.labels.map((e=>Qi({},c,t,e))),h=t.labels.map((e=>e.placements.map((n=>Qi({},c,t,e,n))))),d=[],f={insideLabelBounds:[]};i=function(e){const t=[],n=[],i=[],r=[];for(let o=0;o<e.length;++o){const{start:a,end:s}=e[o].desc.slice,l=wp((a+s)/2);switch(Math.floor(l/(Math.PI/2))){case 0:t.push(e[o]);break;case 1:n.push(e[o]);break;case 2:i.push(e[o]);break;case 3:r.push(e[o])}}const o=(e,t)=>wp((e.desc.slice.start+e.desc.slice.end)/2)-wp((t.desc.slice.start+t.desc.slice.end)/2),a=(e,t)=>o(t,e);return t.sort(a),n.sort(o),i.sort(a),r.sort(o),t.concat(n,r,i)}(i);const p={};for(let e=0,t=i.length;e<t;e++){const t=i[e],a=Ap(t,n);for(let n=0;n<u.length;n++){const i=u[n],c="function"==typeof i.label?i.label(a,e):"";if(!c)continue;const m="function"==typeof i.direction?i.direction(a,e):i.direction||"horizontal",g="function"==typeof i.linkData?i.linkData(a,e):void 0,y=Rp(c,i,o),x=s({context:p,direction:m,lblStngs:i,measured:y,node:t,placementSettings:h[n],rect:r,store:f}),v=x.bounds,b=x.placement;if(v&&b){if("outside"===b.position&&"rotate"!==m){Dp({context:p,node:t,bounds:v});if(!rh(kp(v),r))continue}const n="function"==typeof b.fill?b.fill(a,e):b.fill,o=l(v,c,{fill:n,fontSize:i.fontSize,fontFamily:i.fontFamily,textMetrics:y});o&&(void 0!==g&&(o.data=g),d.push(o),v.line&&(v.line.stroke=n,d.push(v.line)))}}}return d},rows:function(e){let{settings:t,chart:n,nodes:i,renderer:r,style:o}=e,a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:pm;const s=Qi({fontSize:12,fontFamily:"Arial",fill:"#333",padding:4,align:.5,justify:.5},o.label);s.fontSize=parseInt(s.fontSize,10);const l=Qi({},s,t),c=t.labels.map((e=>Qi({},l,e))),u={},h=[];for(let e=0,t=i.length;e<t;e++){let t=i[e],o=fm(t,n),{type:s,bounds:d}=gm(t);if(!d)continue;let f,p=0,m=[],g=[],y="circle"===s?2*d.r*.9:d.height;for(p+=l.padding,f=0;f<c.length;f++){let t=c[f],n="function"==typeof t.label?t.label(o,e):"";u.fontFamily=t.fontFamily,u.fontSize="".concat(t.fontSize,"px"),u.text=n;let i=r.measureText(u);if(p+=i.height+t.padding,p>y)break;g.push(n),m.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 t,n=c[f];if("circle"===s){let e=Math.max(Math.abs(b-d.cy),Math.abs(b+m[f].height-d.cy)),n=Math.sqrt(d.r*d.r-e*e);t={x:d.cx-n+l.padding,y:b,width:2*n-2*l.padding,height:m[f].height}}else t={x:d.x+l.padding,y:b,width:d.width-2*l.padding,height:m[f].height};b+=m[f].height+l.padding;let i="function"==typeof n.fill?n.fill(o,e):n.fill;const u="function"==typeof n.linkData?n.linkData(o,e):void 0;let p=a(t,g[f],{fill:i,align:n.align,fontSize:n.fontSize,fontFamily:n.fontFamily,textMetrics:m[f]});if(p){if(p.text&&p.text!==Vp){const e=tm(p,r.measureText);if(Vp===e)continue;p.ellipsed=e}void 0!==u&&(p.data=u),h.push(p)}}}return h}};const xm={require:["chart","renderer","settings"],defaultSettings:{settings:{},style:{label:"$label"}},render(){const e=this.settings.settings,t=[];return(e.sources||[]).forEach((e=>{e.strategy&&ym[e.strategy.type]&&e.component&&t.push(...function(e,t){let{chart:n,source:i,rect:r,renderer:o,style:a}=e;if(!n.component(i.component))return[];const s=n.findShapes(i.selector).filter((e=>e.key===i.component));return t({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:e,style:this.style},ym[e.strategy.type]))})),t}};const vm={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 bm(e){let{x:t=0,y:n,item:i,globalMetrics:r,createSymbol:o,direction:a="ltr"}=e,s=i.label.displayObject,l=i.label.bounds,c=i.symbol.meta;const u="rtl"===a;let h={x:u?t+r.maxLabelBounds.width:t+r.maxSymbolSize+r.spacing,y:n,width:r.maxLabelBounds.width,height:Math.max(r.maxSymbolSize,r.maxLabelBounds.height)},d=function(e,t,n){const i=Math.max(0,e.width-t),r=Math.max(0,e.height-t);return{x:e.x+t/2+n.align*i,y:e.y+t/2+n.justify*r}}({x:u?t+r.maxLabelBounds.width+r.spacing:t,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(Qi({},c,d));return delete f.collider,s.anchor=u?"end":"start",function(e,t,n){const i=n.textMetrics;if(e.height<i.height)return!1;const r=Math.max(0,e.width-i.width);t.baseline="text-before-edge";const o=Math.max(0,e.height-i.height);t.x=e.x+n.align*r,t.y=e.y+n.justify*o+.175*parseInt(t.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:t,y:n,width:r.maxItemBounds.width,height:r.maxItemBounds.height}},metrics:h}}function wm(e,t){const n=e.items.length,i=Math.ceil(n/t),r="horizontal"===e.layout.orientation?"width":"height",o="width"===r?"horizontal":"vertical";return e.globalMetrics.maxItemBounds[r]*i+(i-1)*e.layout.margin[o]}function Mm(e,t){let n,i,r,o,{onScroll:a=()=>{}}=t,s=null,l=0;const c={itemize:t=>{n=function(e,t){let n,i,{resolved:r,dock:o}=e,a=[],s=r.items.items,l=r.symbols.items,c=r.labels.items,u=0,h=0,d=0;for(let e=0;e<s.length;e++){if(!1===s[e].show)continue;const r=void 0!==c[e].text?c[e].text:c[e].data.label||"";n=Qi({},c[e],{type:"text",fontSize:"".concat(parseInt(c[e].fontSize,10),"px"),text:r,title:r}),i={symbol:{meta:l[e]},label:{displayObject:n,bounds:t.textBounds(n)}},a.push(i),u=Math.max(l[e].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}}}(t,e.renderer),s=isNaN(n.layout.scrollOffset)?s:n.layout.scrollOffset},getItemsToRender:t=>{r=t.viewRect,l=c.getContentOverflow(r);const a=c.extent();s=Math.max(0,Math.min(s,l)),o=Qi({},r);const u="horizontal"===c.orientation()?"x":"y";return o[u]-=s,o["x"===u?"width":"height"]=a,function(e,t,n){let{viewRect:i}=e,{itemized:r,create:o=bm,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,m=c.maxItemBounds.width,g=r.layout.margin.vertical+p,y=r.layout.margin.horizontal+m;let x=t.x,v=t.y,b=i.x-t.x;for(let e=0;e<u.length;e++){let n=o({y:v,x:"rtl"===l?i.x+b+i.width-m-(x-t.x):x,item:u[e],globalMetrics:c,direction:l,createSymbol:s});if((h&&x>=i.x-m||!h&&v>=i.y-p)&&f.push(n.item),d++,d>=a?(d=0,h?(x+=y,v=t.y):(v+=g,x=t.x)):h?v+=g:x+=y,!h&&v>i.y+i.height)break;if(h&&x>i.x+i.width)break}return f}(t,o,{itemized:n,parallels:i,createSymbol:e.symbol})},parallelize:(e,t)=>(i=function(e,t,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/e);if(null!=t){const e="horizontal"===n.layout.orientation?"height":"width",i="width"===e?"horizontal":"vertical",r=n.layout.margin[i]||4,o=Math.floor((t+r)/(r+n.globalMetrics.maxItemBounds[e]));s=Math.min(s,o)}const l=isNaN(n.layout.size)?1:n.layout.size;return Math.max(1,Math.min(s,l))}(e,t,n),i),hasContentOverflow:()=>{const e="horizontal"===n.layout.orientation?"width":"height";return wm(n,i)>r[e]},getContentOverflow:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:r;const t="horizontal"===n.layout.orientation?"width":"height";return Math.max(0,wm(n,i)-e[t])},getNextSize:()=>{const e="horizontal"===n.layout.orientation?"width":"height",t="width"===e?"horizontal":"vertical";return n.globalMetrics.maxItemBounds[e]+n.layout.margin[t]},getPrevSize:()=>{const e="horizontal"===n.layout.orientation?"width":"height",t="width"===e?"horizontal":"vertical";return n.globalMetrics.maxItemBounds[e]+n.layout.margin[t]},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:e=>{const t=Math.max(0,Math.min(l,s-e));t!==s&&(s=t,a())},offset:()=>s,orientation:()=>n.layout.orientation,direction:()=>n.layout.direction,extent:()=>wm(n,i),spread:()=>function(e,t){const n=t,i="horizontal"===e.layout.orientation?"height":"width",r="width"===i?"horizontal":"vertical";return e.globalMetrics.maxItemBounds[i]*n+(n-1)*e.layout.margin[r]}(n,i)};return c}function km(e){return Object.keys(e).filter((t=>e[t])).join(" ")}const Sm={up:"▲",right:"▶",down:"▼",left:"◀"};function _m(e,t){let{size:n,isActive:i,direction:r,nav:o,attrs:a}=t,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(e,{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"),e("button",Qi({class:km(s),style:u},c),[l||e("span",{style:{pointerEvents:"none"}},[Sm[r]])])}function qm(e){let t;const n={itemize:e=>{t=function(e){let{dock:t,navigation:n}=e;return{layout:{orientation:"top"===t||"bottom"===t?"vertical":"horizontal"},navigation:n}}(e)},render:i=>function(e,t,n,i){let{rect:r,itemRenderer:o}=t;if(!e||!e.renderArgs)return;e.size(r);const a=e.renderArgs[0],s="vertical"===n.layout.orientation,l="rtl"===o.direction(),c=o.hasNext(),u=o.hasPrev();if(!u&&!c)return void e.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"},[_m(a,{size:32,isActive:c,direction:h[0],attrs:{"data-action":"next","data-component-key":i.settings.key},nav:n.navigation}),_m(a,{size:32,isActive:u,direction:h[1],attrs:{"data-action":"prev","data-component-key":i.settings.key},nav:n.navigation})])];e.render(d)}(n.renderer,i,t,e),extent:()=>32,spread:()=>64};return n}function Dm(e){let t;const n={itemize:n=>{t=function(e,t){let{resolved:n}=e;if(!1===n.title.item.show)return null;const i=Qi({},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 e=t.scale.data().fields;i.text=e&&e[0]?e[0].title():""}return{displayObject:i,bounds:t.renderer.textBounds(i)}}(n,e)},render:e=>{!function(e,t,n){let{rect:i}=e;if(!t)return;const r=[];if(t.size(i),n){const e={start:0,end:i.width,middle:i.width/2};r.push(Qi({},n.displayObject,{x:e[n.displayObject.anchor]||0,y:0,baseline:"text-before-edge",title:n.displayObject.text}))}t.render(r)}(e,n.renderer,t)},spread:()=>t?t.bounds.height:0,extent:()=>t?t.bounds.width:0};return n}function Am(e,t,n,i){let r,o,a,{itemRenderer:s,navigationRenderer:l,titleRenderer:c,isPreliminary:u=!1}=i,h=0;const d={x:t.spacing,y:t.spacing,width:e.width-2*t.spacing,height:e.height-2*t.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 e=d.width-r.width-(r.width?t.spacing:0),n=d.height;s.parallelize(e,u?void 0:n);const i=s.extent()>e?l.extent():0,f=s.spread(),p=i?l.spread():0;o={x:r.x+r.width+(r.width?t.spacing:0),y:d.y+Math.max(0,(p-f)/2),width:d.width-i-r.width-(i?t.spacing:0)-(r.width?t.spacing:0),height:n},a={x:o.x+o.width+(i?t.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?t.spacing:0),r.x=o.x+o.width+(r.width?t.spacing:0)),h=Math.max(r.height,p,s.spread())}else{const e=d.height-r.height-(r.height?t.spacing:0),n=d.width;s.parallelize(e,u?void 0:n);const i=s.extent()>e?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?t.spacing:0),width:d.width,height:d.height-r.height-(r.height?t.spacing:0)-a.height-(a.height?t.spacing:0)},h=Math.max(c.extent(),i?l.spread():0,s.spread())}return o=Qi({},e,{x:e.x+o.x,y:e.y+o.y,width:o.width,height:o.height}),a.x+=e.x,a.y+=e.y,r.x+=e.x,r.y+=e.y,{title:Qi({},e,r),content:Qi({},e,o),navigation:Qi({},e,a),orientation:n,preferredSize:h}}function Cm(e){e.state.resolved=function(e){const t=e.scale.domain();let n={items:[]};const i=e.settings.layout.dock;if("threshold-color"===e.scale.type){const r=e.scale.data().fields[0];let o=e=>String(e);e.settings.formatter?o=e.chart.formatter(e.settings.formatter):r&&(o=r.formatter());for(let e=0;e<t.length-1;e++){const i={value:t[e],label:"".concat(o(t[e])," - < ").concat(o(t[e+1]))};r&&(i.source={field:r.id()}),n.items.push(i)}"vertical"==("top"===i||"bottom"===i?"horizontal":"vertical")&&n.items.reverse()}else{const i=e.scale.labels?e.scale.labels():null;n.items=t.map(((t,n)=>{const r=e.scale.datum?Qi({},e.scale.datum(t)):{value:t};return r.value=t,e.scale.label?r.label=e.scale.label(t):i&&(r.label=i[n]),r}))}const r=e.resolver.resolve({data:{fields:e.scale.data().fields},defaults:Qi(!0,{},vm.title,e.style.title),settings:e.settings.settings.title}),o=e.resolver.resolve({data:{fields:e.scale.data().fields},defaults:vm.layout,settings:e.settings.settings.layout}),a=e.resolver.resolve({data:n,defaults:Qi(!0,{},vm.item.label,e.style.item.label),settings:(e.settings.settings.item||{}).label}),s=Qi(!0,{},(e.settings.settings.item||{}).shape);void 0===s.fill&&e.settings.scale&&(s.fill={scale:e.settings.scale});const l=e.resolver.resolve({data:n,defaults:Qi(!0,{},vm.item.shape,e.style.item.shape),settings:s}),c=e.resolver.resolve({data:n,defaults:Qi(!0,{},{show:vm.item.show}),settings:{show:(e.settings.settings.item||{}).show}});function u(e,n){let i=e.data.value,r=t[n+1];e.data.value=[i,r]}"threshold-color"===e.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}}(e),e.titleRenderer.itemize({resolved:e.state.resolved,dock:e.settings.layout.dock||"center"}),e.itemRenderer.itemize({resolved:e.state.resolved,dock:e.settings.layout.dock||"center"}),e.navigationRenderer.itemize({resolved:e.state.resolved,dock:e.settings.layout.dock||"center",navigation:e.settings.settings.navigation}),e.state.display={spacing:8}}function Nm(e){const{rect:t,settings:n,state:i,itemRenderer:r,navigationRenderer:o,titleRenderer:a}=e,s=n.layout.dock,l="top"===s||"bottom"===s?"horizontal":"vertical",c=Am(t,i.display,l,{itemRenderer:r,navigationRenderer:o,titleRenderer:a});e.renderer.size(c.content);let u=r.getItemsToRender({viewRect:Qi({},c.content,{x:0,y:0})});return o.render({rect:c.navigation,itemRenderer:r}),a.render({rect:c.title}),e.state.views={layout:c},u}const Em={require:["chart","settings","renderer","update","resolver","registries","symbol"],defaultSettings:{settings:{},style:{item:{label:"$label",shape:"$shape"},title:"$title"}},mounted(e){e&&e.parentNode&&(this.navigationRenderer.renderer.appendTo(e.parentNode),this.titleRenderer.renderer.appendTo(e.parentNode),e.parentNode.insertBefore(this.navigationRenderer.renderer.element(),e),e.parentNode.insertBefore(this.titleRenderer.renderer.element(),e)),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(e){if(!this.state.interaction.started)return;const t="horizontal"===this.itemRenderer.orientation()?("rtl"===this.itemRenderer.direction()?-1:1)*e.deltaX:e.deltaY;this.itemRenderer.scroll(t-this.state.interaction.delta),this.state.interaction.delta=t},panend(){this.state.interaction.started=!1},scroll(e){this.itemRenderer.scroll(-e)},next(){this.itemRenderer.next()},prev(){this.itemRenderer.prev()}},created(){this.state={interaction:{}},this.onScroll=()=>{const e=Nm(this);this.update(e)},this.itemRenderer=Mm(this,{onScroll:this.onScroll}),this.navigationRenderer=qm(this),this.titleRenderer=Dm(this),this.navigationRenderer.renderer=this.registries.renderer("dom")(),this.titleRenderer.renderer=this.registries.renderer(this.settings.renderer)(),Cm(this)},preferredSize(e){return function(e,t){let n=0;const i=e.settings.layout.dock||"center",r="top"===i||"bottom"===i?"horizontal":"vertical",o=e.state.display,a=Am(t.inner,o,r,{itemRenderer:e.itemRenderer,navigationRenderer:e.navigationRenderer,titleRenderer:e.titleRenderer,isPreliminary:!0});return n+=o.spacing,n+=a.preferredSize,n+=o.spacing,n}(this,e)},beforeUpdate(){Cm(this)},render(){return Nm(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 Rm(e,t){let n=0;const i=e.state.isVertical?"justify":"align",r=e.state.isVertical?"y":"x",o=e.state.isVertical?"height":"width",a=e.state.isVertical?"requiredHeight":"requiredWidth";n=e.state.rect[o]-e.state.legend.length()-e.state.title[a](),n*=Math.min(1,Math.max(e.stgns[i],0)),t[r]+=n}function Im(e,t,n){const i=n[e];return"object"==typeof i?-1!==i.valid.indexOf(t)?t:i.default:n.default}function Om(e){return Im(e.layout.dock,e.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 Pm(e,t){const n={x:0,y:0,width:0,height:0},i=e.stgns.padding;return n.x=i.left,n.y=i.top,n.width=t.width-i.left-i.right,n.height=t.height-i.top-i.bottom,n}function Lm(e){const t="top"!==e.settings.layout.dock&&"bottom"!==e.settings.layout.dock,n=e.stgns.title,i=e.chart.scale(e.stgns.fill),r=e.chart.scale(e.stgns.major),o=function(e,t){const n=t.domain();let i=n,r=e.stgns.tick.label;!r&&e.formatter?r=e.formatter:!r&&t.data().fields&&(r=t.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:t.norm(parseFloat(n,10)),textMetrics:e.renderer.measureText({text:o,fontSize:e.stgns.tick.fontSize,fontFamily:e.stgns.tick.fontFamily})}}));return o}(e,r),a=Im((s=e.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 e=r.data().fields;n.text=e&&e[0]?e[0].title():""}const l=e.renderer.measureText({text:n.text,fontSize:n.fontSize,fontFamily:n.fontFamily}),c=e.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:t,nodes:[],title:{anchor:Om(e.settings),textMetrics:l,textBounds:c,requiredWidth:()=>{if(!n.show)return 0;let e=c.width,i=n.maxLengthPx;return t||(e+=n.padding,i+=n.padding),Math.min(e,i,u.rect.width)},requiredHeight:()=>{if(!n.show)return 0;let e=c.height;return t&&(e+=n.padding),Math.min(e,u.rect.height)}},ticks:{values:o,anchor:a,length:Math.min(Math.max(...o.map((e=>e.textMetrics.width))),e.stgns.tick.maxLengthPx),requiredHeight:()=>"top"===a?Math.max(...u.ticks.values.map((e=>e.textMetrics.height)))+e.stgns.tick.padding:0,height:Math.max(...o.map((e=>e.textMetrics.height)))},legend:{fillScale:i,majorScale:r,length:()=>{const n=t?"height":"width",i=t?"requiredHeight":"requiredWidth",r=Math.min(u.rect[n],u.rect[n]*e.stgns.length)-u.title[i]();return Math.max(0,Math.min(r,e.stgns.maxLengthPx))}}};return u}const Tm={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(e){const t=this.state;t.rect=Pm(this,e.inner);let n=this.stgns.size;const i=t.isVertical?this.stgns.padding.left+this.stgns.padding.right:this.stgns.padding.top+this.stgns.padding.bottom;n+=i;const r=Math.max(e.inner.width,e.inner.height);if("left"===t.ticks.anchor||"right"===t.ticks.anchor){const e=t.ticks.values.reduce(((e,t)=>e+t.textMetrics.height),0);if(e>this.state.legend.length())return r;n+=t.ticks.length}else{if(t.ticks.length>this.state.legend.length())return r;n+=Math.max(...t.ticks.values.map((e=>e.textMetrics.height)))}return n+=this.stgns.tick.padding,this.stgns.title.show&&(n="left"===t.title.anchor||"right"===t.title.anchor?Math.max(t.title.textBounds.height+i,n):Math.max(n,t.title.requiredWidth()+i)),this.state.preferredSize=n,n},created(){this.stgns=this.settings.settings,this.state=Lm(this)},beforeUpdate(e){this.stgns=e.settings.settings,this.state=Lm(this)},beforeRender(e){if(this.state.nodes=[],this.state.rect=Pm(this,e.size),this.stgns.title.show){const e=function(e){const t=e.state,n=e.stgns,i="left"===t.ticks.anchor,r="top"===t.ticks.anchor;let o=t.rect.x,a=t.rect.y,s="start";"left"===t.title.anchor?(o+=t.title.requiredWidth()-n.title.padding,a+=t.title.textMetrics.height,a+=r?t.rect.height-t.title.textBounds.height:0,s="end"):"right"===t.title.anchor?(o+=t.legend.length(),o+=n.title.padding,a+=t.title.textMetrics.height,a+=r?t.rect.height-t.title.textBounds.height:0):"top"===t.title.anchor&&(o+=i?t.rect.width:0,a+=t.title.textMetrics.height,s=i?"end":"start");const l={tag:"legend-title",type:"text",x:o,y:Math.min(a,t.rect.y+t.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 Rm(e,l),l}(this);this.state.nodes.push(e)}const t=function(e){const t=e.state.legend.fillScale,n=e.state.legend.majorScale;return t.domain().map((e=>({type:"stop",color:t(e),offset:Math.min(1,Math.max(0,n.norm(e)))}))).sort(((e,t)=>e.offset-t.offset))}(this),n=function(e,t){const n=e.state,i=e.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:t,degree:n.isVertical?90:180}};return Rm(e,c),c}(this,t),i=function(e,t){const n=e.state,i=e.stgns;let r="start";const o={type:"rect",x:t.x,y:t.y,width:n.isVertical?0:t.width,height:n.isVertical?t.height:0,fill:"transparent"},a=n.ticks.values.map((a=>{let s=0,l=0,c=0,u="alphabetical";return n.isVertical?(l=t.y+t.height*a.pos,u=0===a.pos?"text-before-edge":"text-after-edge"):s=t.x+t.width*a.pos,"right"===n.ticks.anchor?(s=t.x+i.size+i.tick.padding,o.x=t.x+t.width):"left"===n.ticks.anchor?(s=t.x-i.tick.padding,r="end"):"top"===n.ticks.anchor?(l=t.y-i.tick.padding,c-=.25*a.textMetrics.height,r=0===a.pos?"start":"end"):"bottom"===n.ticks.anchor&&(l=t.y+t.height+i.tick.padding,c=.8*a.textMetrics.height,r=0===a.pos?"start":"end",o.y=t.y+t.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:e.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 zm={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 Fm(e,t){let{generatorType:n,item:i,data:r,major:o,minor:a,layerObj:s,stngs:l}=t,c=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"";const u={type:"path",points:e,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 jm(e){const{metaLayers:t,coordinates:n,layers:i,lines:r,areas:o}=function(e){let{data:t,stngs:n,rect:i,resolver:r,style:o,domain:a}=e;const{width:s,height:l}=i,c=r.resolve({data:t,defaults:zm.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 e=0;e<c.items.length;e++){let t=c.items[e],n=t.layerId;if(u){const e=h[n]?h[n].items[h[n].items.length-1]:null,i=e?a.indexOf(e.data.major?e.data.major.value:e.data.value):null;e&&a.indexOf(t.data.major?t.data.major.value:t.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(t.data),h[n].items.push(t)}const f=Object.keys(h).map((e=>(h[e].consumableData=ir({points:h[e].dataItems},h[e].dataItems[0]),h[e]))),p={items:f.map((e=>e.consumableData))},m=n.layers||{};return{coordinates:c,metaLayers:f,layers:r.resolve({data:p,defaults:{curve:zm.layers.curve,show:zm.layers.show},settings:{curve:m.curve,show:m.show}}),lines:r.resolve({data:p,defaults:Qi({},zm.layers.line,o.line),settings:m.line}),areas:r.resolve({data:p,defaults:Qi({},zm.layers.area,o.area),settings:m.area})}}(e),a=[];return t.forEach(((t,s)=>{const l=i.items[s];if(!1===l.show)return;l.datum=l.data,l.data=[],l.id=t.id;const c=[],u=[];let h,d;for(let i=0;i<t.items.length;i++){if(h=t.items[i],d=h.data,!h.dummy){if(isNaN(h.major))continue;e.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(((e,t)=>e-t))[Math.floor((c.length-1)/2)];a.push({layerObj:l,lineObj:r.items[s],areaObj:o.items[s],median:f,points:u,consumableData:t.consumableData})})),a}const Vm={require:["chart","resolver"],defaultSettings:{style:{area:"$shape",line:"$shape-outline"}},created(){},render(e){let{data:t}=e;const{width:n,height:i}=this.rect;this.stngs=this.settings.settings||{};const r=!this.stngs.coordinates||void 0===this.stngs.coordinates.minor0,o=jm({data:t,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 e=o.map((e=>({id:e.layerObj.id,data:e.layerObj.data}))).sort(this.stngs.layers.sort).map((e=>e.id));o.sort(((t,n)=>e.indexOf(t.layerObj.id)-e.indexOf(n.layerObj.id)))}else o.sort(((e,t)=>e.median-t.median));return function(e,t){let{width:n,height:i,missingMinor0:r,stngs:o}=t;const a=[],s=o.layers||{};return e.forEach((e=>{const{lineObj:t,layerObj:l,areaObj:c,points:u}=e;let h={size:i,p:"y"},d={size:n,p:"x"};if("vertical"===o.orientation){const e=Qi(!0,{},d);d=Qi(!0,{},h),h=Qi(!0,{},e)}s.area&&!1!==c.show&&a.push(Fm(u,{data:e.consumableData,item:c,generatorType:"area",major:d,minor:h,layerObj:l,stngs:o})),t&&!1!==t.show&&(a.push(Fm(u,{data:e.consumableData,item:t,generatorType:"line".concat(h.p.toUpperCase(),"1"),major:d,minor:h,layerObj:l,stngs:o},"none")),!r&&s.area&&!1!==c.show&&!1!==t.showMinor0&&a.push(Fm(u,{data:e.consumableData,item:t,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 Bm(e,t){let n,i,r=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];"object"==typeof t.center?(n=t.center.x,i=t.center.y):(n=t.clientX,i=t.clientY);const o=n-e.state.boundingRect.left,a=i-e.state.boundingRect.top;return{x:r?Math.max(0,Math.min(o,e.rect.width)):o,y:r?Math.max(0,Math.min(a,e.rect.height)):a}}function Hm(e,t){return{x:t.x+e.rect.x,y:t.y+e.rect.y}}function $m(e,t){const n=Math.min(e.x,t.x),i=Math.min(e.y,t.y);return{x:n,y:i,width:Math.max(e.x,t.x)-n,height:Math.max(e.y,t.y)-i}}const Wm={require:["chart","renderer"],defaultSettings:{layout:{displayOrder:99},settings:{brush:{components:[]}},style:{area:"$selection-area-target"}},on:{areaStart(e){this.start(e)},areaMove(e){this.move(e)},areaEnd(e){this.end(e)},areaCancel(){this.cancel()}},created(){this.state={start:{x:0,y:0},end:{x:0,y:0},active:!1}},preferredSize:()=>0,render(){},start(e){this.state.boundingRect=this.renderer.element().getBoundingClientRect();const t=Bm(this,e,!1);bh({x:0,y:0,width:this.rect.width,height:this.rect.height},t)&&(this.state.brushConfig=this.settings.settings.brush.components.map((e=>({key:e.key,contexts:e.contexts,data:e.data,action:e.action||"set"}))),this.state.start=Bm(this,e),this.state.active=!0)},move(e){var t;this.state.active&&(this.state.end=Bm(this,e),function(e){if(e.state.active){const t=Hm(e,e.state.start),n=Hm(e,e.state.end),i=e.chart.shapesAt($m(t,n),{components:e.state.brushConfig});e.chart.brushFromShapes(i,{components:e.state.brushConfig})}}(this),(t=this).renderer.render([Qi({type:"rect"},$m(t.state.start,t.state.end),t.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 e,t;this.state.active&&(e=this.state,t=this.chart,e.brushConfig.forEach((e=>{Array.isArray(e.contexts)&&e.contexts.forEach((e=>{t.brush(e).end()}))})),this.state={start:{x:0,y:0},end:{x:0,y:0},active:!1},this.renderer.render([]))}};function Um(e,t,n){let{renderer:i,style:r,props:o,h:a}=n;const s=function(e,t){return{tooltip:"function"==typeof e.tooltipClass?e.tooltipClass({dock:t.dock}):e.tooltipClass,content:"function"==typeof e.contentClass?e.contentClass({dock:t.dock}):e.contentClass,arrow:"function"==typeof e.arrowClass?e.arrowClass({dock:t.dock}):e.arrowClass}}(o,t),l=function(e,t,n,i){return i.content({h:e,style:n,data:t})}(a,e,r,o),c=a("div",{dir:o.direction,class:km(Qi({"pic-tooltip":!0},s.tooltip)),style:Qi({position:"relative",display:"inline-block"},t.computedTooltipStyle)},a("div",{style:r.content,class:km(Qi({"pic-tooltip-content":!0},s.content))},l),a("div",{class:km(Qi({"pic-tooltip-arrow":!0},s.arrow)),style:Qi({},r.arrow,r["arrow-".concat(t.dock)],t.computedArrowStyle)}));return i.render(c),i.element().children[0]}function Ym(e){let{defaultDuration:t,defaultDelay:n}=e,i=null,r=null,o=!1;const a=function(){const e=function(){},t={pending:[],debounced:[],active:[],cancelled:[],rejected:[],fulfilled:[]};let n;return e.set=e=>{n=e,t[n].forEach((t=>t(e)))},e.on=(e,n)=>{Array.isArray(e)?e.forEach((e=>t[e].push(n))):t[e].push(n)},e.destroy=()=>{Object.keys(t).forEach((e=>{t[e].length=0}))},e}(),s=function(){},l=()=>{i=null,r=null,o=!1,a.set("fulfilled")};return s.invoke=function(e){let s=arguments.length>1&&void 0!==arguments[1]?arguments[1]:t,c=arguments.length>2&&void 0!==arguments[2]?arguments[2]:n;i&&(clearTimeout(i),a.set("debounced")),a.set("pending"),i=setTimeout((()=>{e(),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=(e,t)=>{a.on(e,t)},s.destroy=()=>{s.clear(),a.destroy()},s}function Gm(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;return{left:"translate(-100%,-50%) translateX(".concat(-e,"px)"),right:"translate(".concat(e,"px, -50%)"),top:"translate(-50%, -100%) translateY(".concat(-e,"px)"),bottom:"translate(-50%, ".concat(e,"px)"),inside:"translate(-50%, -50%)"}}function Xm(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;return{left:{x:-e-n,y:-t/2},right:{x:n,y:-t/2},top:{x:-e/2,y:-t-n},bottom:{x:-e/2,y:n},inside:{x:-e/2,y:-t/2}}}function Km(e,t){const n=e>0?"-":"+";return e=Math.abs(e),void 0===t&&(t=e),{left:{left:"100%",top:"calc(50% ".concat(n," ").concat(e,"px)"),borderWidth:"".concat(t,"px")},right:{left:"".concat(2*-e,"px"),top:"calc(50% ".concat(n," ").concat(e,"px)"),borderWidth:"".concat(t,"px")},top:{left:"calc(50% ".concat(n," ").concat(e,"px)"),top:"100%",borderWidth:"".concat(t,"px")},bottom:{left:"calc(50% ".concat(n," ").concat(e,"px)"),top:"".concat(2*-e,"px"),borderWidth:"".concat(t,"px")},inside:{left:"0px",top:"0px",borderWidth:"0px"}}}function Zm(e,t,n,i,r,o){const a=t+o.x,s=n+o.y,l=r;return!(a<0||s<0)&&!(a+i>e.width||s+l>e.height)}function Jm(e){let{area:t,vx:n,vy:i,width:r,height:o,offset:a}=e;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>t.width?-(s+c-t.width):0,d+=l+u>t.height?-(l+u-t.height):0,{x:h,y:d}}function Qm(e){let{options:t,pointer:n,width:i,height:r,dockOrder:o,x:a,y:s}=e;const{targetBounds:l}=n,c=Gm(t.offset),u=c[t.dock];if(u)return{computedTooltipStyle:{left:"".concat(a,"px"),top:"".concat(s,"px"),transform:u},computedArrowStyle:Km(t.offset)[t.dock],dock:t.dock};const h={width:"target"===t.area?l.width:window.innerWidth,height:"target"===t.area?l.height:window.innerHeight},d=Xm(i,r,t.offset),f=[],p="target"===t.area?a:l.left+a,m="target"===t.area?s:l.top+s;for(let e=0;e<o.length;e+=1){const n=o[e],l=Jm({area:h,vx:p,vy:m,width:i,height:r,offset:d[n]}),u={left:"".concat(a,"px"),top:"".concat(s,"px"),transform:c[n]},g=Km(t.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"),g.left="calc(50% ".concat(l.x>0?"-":"+"," ").concat(Math.abs(l.x),"px)")));const y={computedTooltipStyle:u,computedArrowStyle:g,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(((e,t)=>Math.abs(e.offset.x)-Math.abs(t.offset.x))),f[0]}function eg(e,t,n){const i=e.key?n.component(e.key):n.componentsFromPoint({x:t.clientX,y:t.clientY})[0];if(!i)return{x:0,y:0,width:0,height:0,scaleRatio:{x:1,y:1}};const r=i.rect;return Qi({scaleRatio:r.scaleRatio},r.computedInner)}const tg={bounds:function(e){let{resources:t,nodes:n,pointer:i,width:r,height:o,options:a}=e;const{targetBounds:s}=i,{x:l,y:c,width:u,height:h}=t.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=Gm(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:Km(a.offset)[a.dock],dock:a.dock};const m={width:"target"===a.area?s.width:window.innerWidth,height:"target"===a.area?s.height:window.innerHeight},g=Xm(r,o,a.offset),y=["top","left","right","bottom","inside"];for(let e=0;e<y.length;e+=1){const t=y[e];if(Zm(m,"target"===a.area?d[t].x:s.left+d[t].x,"target"===a.area?d[t].y:s.top+d[t].y,r,o,g[t]))return{computedTooltipStyle:{left:"".concat(d[t].x,"px"),top:"".concat(d[t].y,"px"),transform:f[t]},computedArrowStyle:Km(a.offset)[t],dock:t}}const x=function(e){let{options:t,docks:n,dockOffsets:i,targetBounds:r,area:o,width:a,height:s}=e;const l="top",c="target"===t.area?n[l].x:r.left+n[l].x,u=("target"===t.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:g,targetBounds:s,area:m,width:r,height:o});return{computedTooltipStyle:{left:"".concat(x,"px"),top:"".concat(d.top.y,"px"),transform:f.top},computedArrowStyle:Km(a.offset+x-d.top.x,a.offset).top,dock:"top"}},pointer:function(e){let{options:t,pointer:n,width:i,height:r}=e;const{x:o,y:a}=n;return Qm({x:o,y:a,pointer:n,width:i,height:r,options:t,dockOrder:["top","left","right","bottom"]})},slice:function(e){let{options:t,pointer:n,width:i,height:r,nodes:o,resources:a}=e;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:m}=s.desc.slice,g=(f+p)/2-Math.PI/2,y=2*Math.PI,x=(g%y+y)%y;let v=["top","left","right","bottom"];return"auto"===t.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"]),Qm({x:h+m*u.scaleRatio.x*Math.cos(x),y:d+m*u.scaleRatio.y*Math.sin(x),pointer:n,width:i,height:r,options:t,dockOrder:v})}};function ng(e,t){let{width:n,height:i}=e,{chart:r,state:o,props:a}=t;const s={resources:{formatter:r.formatter,scale:r.scale,component:r.component,getComponentBoundsFromNode:e=>eg(e,o.pointer,r),getNodeBoundsRelativeToTarget:e=>function(e,t,n){const i=eg(e,t,n),r=e.bounds;return{x:i.x+t.dx+r.x,y:i.y+t.dy+r.y,width:r.width,height:r.height}}(e,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=Qi(c,a.placement(s))),"object"===l&&tg[a.placement.type]?c=Qi(c,a.placement):"string"===l&&tg[a.placement]&&(c=Qi(c,{type:a.placement})),s.options=c;const u=tg[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 ig;function rg(){ig=null}const og={duration:8e3,delay:500,filter:e=>e.filter((e=>e.data&&void 0!==e.data.value)),extract:e=>e.node.data.value,content:e=>{let{h:t,data:n}=e;return n.map((e=>t("div",{},e)))},isEqual:(e,t)=>e.length&&e.length===t.length&&e.every(((e,n)=>t[n]&&JSON.stringify(e.data)===JSON.stringify(t[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 ag={require:["chart","renderer"],defaultSettings:{settings:og,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(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this.show(e,t)},prevent(e){this.prevent(e)}},hide(){this.dispatcher.clear(),this.state.activeNodes=[],this.state.pointer={}},show(e){let t,{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(e,t){let{chart:n,state:i}=t,r=0,o=0;e.center?(r+=e.center.x,o+=e.center.y):(r+=e.clientX,o+=e.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}}(e,this),t=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,t)||(this.dispatcher.clear(),this.state.activeNodes=t,this.state.activeNodes.length&&this.dispatcher.invoke((()=>this.invokeRenderer(this.state.activeNodes)),i,r)))},prevent(e){this.state.prevent=!!e},init(e){this.state={activeNodes:[],pointer:{},targetElement:null,prevent:!1},this.props=e.settings,this.dispatcher=Ym({defaultDuration:this.props.duration,defaultDelay:this.props.delay});const t=this.dispatcher.clear;this.dispatcher.on("pending",(()=>{!function(e){ig&&ig!==e&&ig()}(t),ig=t,"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 e={resources:{formatter:this.chart.formatter,scale:this.chart.scale}};"function"==typeof this.props.beforeHide&&this.props.beforeHide.call(void 0,Qi({element:this.state.tooltipElm},e)),"function"==typeof this.props.onHide?this.props.onHide.call(void 0,Qi({element:this.state.tooltipElm},e)):this.renderer.clear([]),"function"==typeof this.props.afterHide&&this.props.afterHide.call(void 0,e),ig===t&&(ig=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(e){let{settings:t}=e;this.dispatcher&&(this.dispatcher.destroy(),rg()),this.init(t)},render(e){return this.h=e,[]},beforeDestroy(){this.dispatcher.destroy(),rg()},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:e,height:t}=this.state.targetElement.getBoundingClientRect();this.renderer.destroy(),this.renderer.size({width:e,height:t}),this.renderer.appendTo(this.state.targetElement)}else this.state.targetElement=this.renderer.element()},mounted(){this.appendTo()},updated(){this.appendTo()},invokeRenderer(e){const t=function(e,t){let{chart:n,scale:i,props:r,h:o}=t;const a={resources:{dataset:n.dataset,scale:n.scale,formatter:n.formatter},scale:i,h:o},s=[];return e.forEach((e=>{if("function"==typeof r.extract){const t=Qi({node:e},a);s.push(r.extract(t))}})),s}(e,this),n=ng(Um(t,{style:{left:"0px",top:"0px",visibility:"hidden"}},this).getBoundingClientRect(),this);this.state.tooltipElm=Um(t,n,this)}};const sg={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 e=this.chart.findShapes(this.props.selector).filter((e=>e.key===this.props.target)),t=e.filter((e=>e.collider)).map((e=>e.collider));t.forEach((e=>{e.fill=this.props.fill,e.stroke=this.props.stroke,e.opacity=this.props.opacity,e.collider={type:null}})),this.renderer.render(t)},created(){this.props=this.settings.settings},resize(e){let{outer:t,inner:n}=e;return this.props.useOuterRect?t:n},render(){},mounted(){this.draw()},updated(){this.props=this.settings.settings,this.draw()}};var lg={a:7,c:6,h:1,l:2,m:2,q:4,s:4,t:2,v:1,z:0},cg=/([astvzqmhlc])([^astvzqmhlc]*)/gi,ug=/-?[0-9]*\.?[0-9]+(?:e[-+]?\d+)?/gi;function hg(e){const t=[],n=String(e).trim();return"M"!==n[0]&&"m"!==n[0]||n.replace(cg,((e,n,i)=>{const r=function(e){const t=e.match(ug);return t?t.map(Number):[]}(i);let o=n.toLowerCase(),a=n;if("m"===o&&r.length>2&&(t.push([a,...r.splice(0,2)]),o="l",a="m"===a?"l":"L"),r.length<lg[o])return"";for(t.push([a,...r.splice(0,lg[o])]);r.length>=lg[o]&&r.length&&lg[o];)t.push([a,...r.splice(0,lg[o])]);return""})),t}const dg=2*Math.PI;function fg(e,t){return{x:.5*(e.x+t.x),y:.5*(e.y+t.y)}}function pg(e,t,n,i,r){const o=1-e;return o**3*t+3*o**2*e*n+3*o*e**2*i+e**3*r}function mg(e,t,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(e,t,n,i){return Math.abs(e.x+n.x-(t.x+t.x))+Math.abs(e.y+n.y-(t.y+t.y))+Math.abs(t.x+i.x-(n.x+n.x))+Math.abs(t.y+i.y-(n.y+n.y))}(e,t,n,i)<=10)return r[r.length-1]!==e&&r.push(e),r.push(i),r;const a=fg(e,t),s=fg(t,n),l=fg(n,i),c={x:pg(.5,e.x,t.x,n.x,i.x),y:pg(.5,e.y,t.y,n.y,i.y)},u=fg(a,s),h=fg(s,l);return mg(e,a,u,c,r,o-1),mg(c,h,l,i,r,o-1),r}function gg(e,t,n){const{cp1:i,cp2:r}=function(e,t,n){return{cp1:{x:e.x+2/3*(t.x-e.x),y:e.y+2/3*(t.y-e.y)},cp2:{x:n.x+2/3*(t.x-n.x),y:n.y+2/3*(t.y-n.y)}}}(e,t,n);return mg(e,i,r,n)}function yg(e,t,n){const i=[],r=!!e[4],o=!!e[5],a=e[3];let s,l,c,u,h=e[6],d=e[7],f=e[1],p=e[2];if("a"===e[0]&&(h+=t,d+=n),t===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(e,t,n,i,r,o,a,s,l){let c,u,h,d,f,p;const m=Pu(n%360),g=Math.cos(m),y=Math.sin(m),x=(s-o)/2,v=(l-a)/2,b=g*x+y*v,w=g*v-y*x;p=b**2/(e=Math.abs(e))**2+w**2/(t=Math.abs(t))**2,p>1&&(p=Math.sqrt(p),e*=p,t*=p);const M=e*w,k=t*b,S=M**2+k**2,_=(e*t)**2-S;let q=Math.sqrt(Math.max(_/S,0));i===r&&(q=-q);const D=q*(M/t),A=q*(-k/e);d=g*D-y*A+(s+o)/2,f=y*D+g*A+(l+a)/2;const C=(b-D)/e,N=(w-A)/t,E=(-b-D)/e,R=(-w-A)/t;return c=Math.atan2(N,C),c+=c<0?dg:0,u=Math.atan2(R,E),u+=u<0?dg:0,h=u-c,!r&&c<u?h-=dg:r&&u<c&&(h+=dg),h%=dg,{startAngle:c,sweepAngle:h,cx:d,cy:f,rx:e,ry:t}}(f,p,a,r,o,h,d,t,n));const m=Math.abs(c*Math.sqrt((f**2+p**2)/2)),g=Math.ceil(m/10),y=c/g;for(let e=1;e<=g;e++){const t=(u+y*e)%dg,n=Math.cos(t),r=Math.sin(t);i.push({x:s+n*f+-r*n,y:l+r*p+n*r})}return i}function xg(e){const t=hg(e),n=[],i=[];let r=0,o=0,a=null,s=null,l=null,c=null;for(let e=0;e<t.length;++e){const u=t[e],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(...yg(u,r,o)),r+=u[6],o+=u[7];break;case"A":i.push(...yg(u,r,o)),r=u[6],o=u[7];break;case"c":i.push(...mg({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(...mg({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(...mg({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(...mg({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(e){for(let t=0;t<e.length-1;t++){const n=e[t],i=e[t+1];Math.abs(n.x-i.x)<1e-12&&Math.abs(n.y-i.y)<1e-12&&(e.splice(t,1),t--)}}(i),n.push(i.splice(0)),n}const vg={require:["renderer","chart"],defaultSettings:{settings:{target:"",fill:"transparent",stroke:"lime",opacity:1,radius:2,useOuterRect:!1}},on:{update(){this.draw()}},draw(){const e=this.chart.findShapes("path").filter((e=>e.key===this.props.target)),t=[];e.forEach((e=>{xg(e.attrs.d).forEach((e=>{e.forEach((e=>{t.push({type:"circle",cx:e.x,cy:e.y,r:this.props.radius,fill:this.props.fill,stroke:this.props.stroke,opacity:this.props.opacity,collider:{type:null}})}))}))})),this.renderer.render(t)},created(){this.props=this.settings.settings},resize(e){let{outer:t,inner:n}=e;return this.props.useOuterRect?t:n},render(){},mounted(){this.draw()},updated(){this.props=this.settings.settings,this.draw()}};var bg=[function(e){e.component("box",bd),e.component("box-marker",bd)},function(e){e.component("point",Dd),e.component("point-marker",Dd)},function(e){e.component("pie",Ed)},function(e){e.component("grid-line",Ld)},function(e){e.component("ref-line",Yd)},function(e){e.component("axis",kf)},function(e){e.component("container",Sf)},function(e){e.component("text",Df)},function(e){e.component("scrollbar",Nf)},function(e){e.component("brush-range",Wf),e.component("brush-area-dir",Xf)},function(e){e.component("range",Qf)},function(e){e.component("brush-lasso",op)},function(e){e.component("labels",xm)},function(e){e.component("legend-cat",Em)},function(e){e.component("legend-seq",Tm)},function(e){e.component("line",Vm)},function(e){e.component("brush-area",Wm)},function(e){e.component("tooltip",ag)},function(e){e.component("debug-collider",sg)},function(e){e.component("debug-path-to-points",vg)}];class wg{constructor(e){this._parent=null,this._children=[],this._ancestors=null,this.type=e,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 e=[];const t=this.children.length;let n,i;for(n=0;n<t;n++)i=this.children[n],e.push(i),i.children.length&&(e=[...e,...i.descendants]);return e}equals(e){const t=this.children,n=e.children;if(t.length!==n.length)return!1;for(let e=0;e<t.length;e++)if(!t[e].equals(n[e]))return!1;return!0}toJSON(){return{type:this.type,children:this.children.map((e=>e.toJSON()))}}}class Mg{constructor(){let{x:e=0,y:t=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:e,y:t,width:n,height:i,minWidth:r,minHeight:o})}set(){let{x:e=0,y:t=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=e,this.width=Math.max(n,r)):(this.x=e+Math.min(n,-r),this.width=-Math.min(n,-r)),i>=0?(this.y=t,this.height=Math.max(i,o)):(this.y=t+Math.min(i,-o),this.height=-Math.min(i,-o))}containsPoint(e){return bh(this,e)}intersectsLine(e){return wh(this,hr(e))}intersectsRect(e){return xh(this,ur(e))}intersectsCircle(e){return dh(e,this)}intersectsPolygon(e){return yh(e,this)}intersectsGeoPolygon(e){return Ch(e,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 kg{constructor(){let{cx:e=0,cy:t=0,r:n=0,minRadius:i=0}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.set({cx:e,cy:t,r:n,minRadius:i})}set(){let{cx:e=0,cy:t=0,r:n=0,minRadius:i=0}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.type="circle",this.cx=e,this.cy=t,this.r=Math.max(n,i),this.vector={x:this.cx,y:this.cy}}containsPoint(e){return hh(this,e)}intersectsLine(e){return fh(this,hr(e))}intersectsRect(e){return dh(this,ur(e))}intersectsCircle(e){return n=e,!sh(t=this)&&!sh(n)&&(t.cx-n.cx)**2+(t.cy-n.cy)**2<=(t.r+n.r)**2;var t,n}intersectsPolygon(e){return ph(this,e)}intersectsGeoPolygon(e){return qh(this,e)}points(){return[{x:this.cx,y:this.cy}]}}class Sg{constructor(){let{x1:e=0,y1:t=0,x2:n=0,y2:i=0,tolerance:r=0}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.set({x1:e,y1:t,x2:n,y2:i,tolerance:r})}set(){let{x1:e=0,y1:t=0,x2:n=0,y2:i=0,tolerance:r=0}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.type="line",this.x1=e,this.y1=t,this.x2=n,this.y2=i,this.tolerance=Math.max(0,Math.round(r)),this.vectors=this.points(),this.zeroSize=e===n&&t===i}containsPoint(e){if(this.tolerance>0){return fh({cx:e.x,cy:e.y,r:this.tolerance},this)}return kh(this,e)}intersectsLine(e){return Mh(this,hr(e))}intersectsRect(e){return wh(ur(e),this)}intersectsCircle(e){return fh(e,this)}intersectsPolygon(e){return gh(e,this)}intersectsGeoPolygon(e){return Ah(e,this)}points(){return[{x:this.x1,y:this.y1},{x:this.x2,y:this.y2}]}}class _g{constructor(){let{vertices:e=[]}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.set({vertices:e})}set(){let{vertices:e=[]}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(this.type="polygon",this.vertices=e.slice(),this.edges=[],function(e){for(let t=0;t<e.length-1;t++){const n=e[t],i=e[t+1];n.x===i.x&&n.y===i.y&&(e.splice(t,1),t--)}}(this.vertices),!(this.vertices.length<=2)){!function(e){const t=e[0],n=e[e.length-1];t.x===n.x&&t.y===n.y||e.push(t)}(this.vertices),this.xMin=NaN,this.yMin=NaN,this.xMax=NaN,this.yMax=NaN;for(let e=0;e<this.vertices.length;e++)e<this.vertices.length-1&&this.edges.push([this.vertices[e],this.vertices[e+1]]),this.xMin=isNaN(this.xMin)?this.vertices[e].x:Math.min(this.xMin,this.vertices[e].x),this.xMax=isNaN(this.xMax)?this.vertices[e].x:Math.max(this.xMax,this.vertices[e].x),this.yMin=isNaN(this.yMin)?this.vertices[e].y:Math.min(this.yMin,this.vertices[e].y),this.yMax=isNaN(this.yMax)?this.vertices[e].y:Math.max(this.yMax,this.vertices[e].y);this._bounds=null,this._boundingRect=null}}containsPoint(e){return mh(this,e)}intersectsCircle(e){return ph(e,this)}intersectsLine(e){return gh(this,hr(e))}intersectsRect(e){return yh(this,ur(e))}intersectsPolygon(e){return Sh(this,e)}intersectsGeoPolygon(e){return _h(e,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 qg(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return new _g(...t)}function Dg(e){const t=e[0],n=e[e.length-1];t.x===n.x&&t.y===n.y||e.push(t)}function Ag(e){for(let t=0;t<e.length-1;t++){const n=e[t],i=e[t+1];n.x===i.x&&n.y===i.y&&(e.splice(t,1),t--)}}class Cg{constructor(){let{vertices:e=[[]]}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.set({vertices:e})}set(){let{vertices:e=[]}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.type="geopolygon",this.vertices=e.slice(),this.numPolygons=this.vertices.length,this.polygons=[],this.xMin=NaN,this.yMin=NaN,this.xMax=NaN,this.yMax=NaN;for(let e=0;e<this.numPolygons;e++)Ag(this.vertices[e]),this.vertices[e].length>2&&Dg(this.vertices[e]),this.polygons[e]=qg({vertices:this.vertices[e]}),this.xMin=isNaN(this.xMin)?this.polygons[e].xMin:Math.min(this.xMin,this.polygons[e].xMin),this.xMax=isNaN(this.xMax)?this.polygons[e].xMax:Math.max(this.xMax,this.polygons[e].xMax),this.yMin=isNaN(this.yMin)?this.polygons[e].yMin:Math.min(this.yMin,this.polygons[e].yMin),this.yMax=isNaN(this.yMax)?this.polygons[e].yMax:Math.max(this.yMax,this.polygons[e].yMax);this._bounds=null,this._boundingRect=null}containsPoint(e){return Dh(this,e)}intersectsCircle(e){return qh(e,this)}intersectsLine(e){return Ah(this,hr(e))}intersectsRect(e){return Ch(this,ur(e))}intersectsPolygon(e){return _h(this,e)}intersectsGeoPolygon(e){return function(e,t){const n=e.boundingRect(),i=t.boundingRect();return!!xh(n,i)&&(vh(i,n)?uh(t,e):uh(e,t))}(this,e)}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 Ng(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return new Cg(...t)}class Eg{constructor(){let{points:e=[]}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.set({points:e})}set(){let{points:e=[]}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(this.type="polyline",this.segments=[],this._points=e.slice(),this._points.length>1)for(let e=0,i=this._points.length-1;e<i;e++)t=this._points[e],n=this._points[e+1],(t.x!==n.x||t.y!==n.y)&&this.segments.push({x1:this._points[e].x,y1:this._points[e].y,x2:this._points[e+1].x,y2:this._points[e+1].y});var t,n}containsPoint(e){return this.segments.some((t=>kh(t,e)))}intersectsCircle(e){return this.segments.some((t=>fh(e,t)))}intersectsLine(e){const t=hr(e);return this.segments.some((e=>Mh(e,t)))}intersectsRect(e){const t=ur(e);return this.segments.some((e=>wh(t,e)))}intersectsPolygon(e){return this.segments.some((t=>gh(e,t)))}intersectsGeoPolygon(e){return this.segments.some((t=>Ah(e,t)))}points(){return this._points}}const Rg=yo();function Ig(e,t){return Rg.get(e)(t)}Rg.add("rect",(function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return new Mg(...t)})),Rg.add("circle",(function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return new kg(...t)})),Rg.add("line",(function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return new Sg(...t)})),Rg.add("polygon",qg),Rg.add("geopolygon",Ng),Rg.add("polyline",(function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return new Eg(...t)}));class Og{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];this.set(e)}set(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];this.geometries=[],e.forEach((e=>{const t=Ig(e.type,e);t&&this.geometries.push(t)}))}containsPoint(e){return this.geometries.some((t=>t.containsPoint(e)))}intersectsLine(e){return this.geometries.some((t=>t.intersectsLine(e)))}intersectsRect(e){return this.geometries.some((t=>t.intersectsRect(e)))}intersectsCircle(e){return this.geometries.some((t=>t.intersectsCircle(e)))}intersectsPolygon(e){return this.geometries.some((t=>t.intersectsPolygon(e)))}intersectsGeoPolygon(e){return this.geometries.some((t=>t.intersectsGeoPolygon(e)))}}class Pg{constructor(){this._elements=[[1,0,0],[0,1,0],[0,0,1]],this._stack=[]}clone(){return(new Pg).multiply(this)}set(e){return this._elements=e,this}save(){return this._stack.push(this.elements),this}restore(){return this._stack.length&&(this._elements=this._stack.pop()),this}add(e){let t,n;for(t=0;t<this._elements.length;t++)for(n=0;n<this._elements[t].length;n++)this._elements[t][n]+=e;return this}translate(e,t){return this.multiply([[1,0,e],[0,1,t],[0,0,1]]),this}rotate(e){let t=Math.cos(-e),n=Math.sin(-e);return this.multiply([[t,n,0],[-n,t,0],[0,0,1]]),this}multiply(e){let t,n,i,r;if(e instanceof Pg&&(e=e._elements),Array.isArray(e)){for(i=[[0,0,0],[0,0,0],[0,0,0]],t=0;t<this._elements.length;t++)for(n=0;n<this._elements[t].length;n++)for(r=0;r<3;r++)i[t][n]+=this._elements[t][r]*e[r][n];this._elements=i}else for(t=0;t<this._elements.length;t++)for(n=0;n<this._elements[t].length;n++)this._elements[t][n]*=e;return this}scale(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:e;return this.multiply([[e,0,0],[0,t,0],[0,0,1]]),this}transform(e,t,n,i,r,o){return this.multiply([[e,n,r],[t,i,o],[0,0,1]]),this}determinant(){let e=this._elements[0][0],t=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=e*r*l+t*o*a+n*i*s-n*r*a-t*i*l-e*o*s,c}invert(){let e=this.determinant(),t=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,t*c-i*s,i*r-t*a],[r*l-o*s,s*n-t*l,t*o-n*r]],this.multiply(1/e),this}transpose(){const e=Object.create(this._elements);return this._elements=[[e[0][0],e[1][0],e[2][0]],[e[0][1],e[1][1],e[2][1]],[e[0][2],e[1][2],e[2][2]]],this}identity(){return this._elements=[[1,0,0],[0,1,0],[0,0,1]],this}toString(){return"".concat(this._elements.map((e=>e.join("\t"))).join("\n"))}isIdentity(){const e=this._elements;return 1===e[0][0]&&0===e[0][1]&&0===e[0][2]&&0===e[1][0]&&1===e[1][1]&&0===e[1][2]&&0===e[2][0]&&0===e[2][1]&&1===e[2][2]}transformPoint(e){let t,n,i=[e.x,e.y,1],r=this._elements,o=[0,0,0];for(t=0;t<this._elements.length;t++)for(n=0;n<this._elements[t].length;n++)o[t]+=i[n]*r[t][n];return{x:o[0],y:o[1]}}transformPoints(e){let t,n,i,r,o,a=this._elements,s=[];for(r=0;r<e.length;r++){for(t=[e[r].x,e[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]+=t[i]*a[n][i];s.push({x:o[0],y:o[1]})}return s}get elements(){const e=this._elements;return[[e[0][0],e[0][1],e[0][2]],[e[1][0],e[1][1],e[1][2]],[e[2][0],e[2][1],e[2][2]]]}}const Lg=/(translate|scale|rotate|matrix)\(([0-9,.eE+-\s]+)(?:,|\s?)+\)/g;function Tg(e,t){const n=t.args[0]*(Math.PI/180);if(t.args.length>2){const i=t.args[1],r=t.args[2];e.translate(i,r),e.rotate(n),e.translate(-i,-r)}else 1===t.args.length&&e.rotate(n)}function zg(e,t){const n=t.args[0],i=isNaN(t.args[1])?t.args[0]:t.args[1];e.scale(n,i)}function Fg(e,t){const n=t.args[0],i=isNaN(t.args[1])?0:t.args[1];e.translate(n,i)}function jg(e,t){t.args.length>=6&&e.transform(...t.args)}function Vg(e,t){const n=function(e){let t,n=[];for(;null!==(t=Lg.exec(e));){const e=t[2].trim(),i=-1===e.indexOf(",")?e.split(" "):e.split(",");n.push({cmd:t[1],args:i.filter((e=>e.trim().length>0)).map((e=>Number(e)))})}return n}(e);let i;for(let e=0,r=n.length;e<r;e++)i=n[e],"rotate"===i.cmd?Tg(t,i):"scale"===i.cmd?zg(t,i):"matrix"===i.cmd?jg(t,i):"translate"===i.cmd&&Fg(t,i)}const Bg={type:/^\w[\w-]+/,attr:/^\[\w(?:[\w\._-]+)?(?:[!]?=['\"][\w\s*#_-]*['\"])?\]/,universal:/^(\*)/,tag:/^\.(\w+)/},Hg={type:(e,t)=>t.filter((t=>{const n=t.type;return!!n&&n.toLowerCase()===e.toLowerCase()})),attr:(e,t,n,i)=>i.filter((i=>{const r=i.attrs[e];if(!t)return void 0!==r;if(void 0===r)return!1;switch(t){case"=":return n===String(r);case"!=":return n!==String(r);default:return!1}})),universal:e=>e,tag:(e,t)=>t.filter((t=>{const n=t.tag;return!!n&&-1!==n.trim().split(/\s+/).indexOf(e.replace(".",""))}))};function $g(e,t){if(!t||!t.length||!e||"function"!=typeof Hg[e.type])return[];switch(e.type){case"type":case"tag":return Hg[e.type](e.value,t);case"attr":return Hg[e.type](e.attribute,e.operator,e.attributeValue,t);case"universal":return Hg[e.type](t);default:return[]}}var Wg={find:function(e,t){const n=[],i=[];let r,o;if(t.isBranch){let a;r=function(e){const t=[];let n,i,r,o;return e.split(/\s*,\s*/).forEach((e=>{e=e.trim(),n=[];const a=t=>{r=e.match(Bg[t]),r&&(o=!0,e=e.slice(r[0].length),i={type:t,value:r[0]},"attr"===t&&(r=r[0].match(/\[(\w[\w\._-]+)?(?:([!]?=)['\"]([\w\s#_-]*)['\"])?\]/),i.attribute=r[1],i.operator=r[2],i.attributeValue=r[3]),n.push(i))};for(;e&&(o=!1,r=e.match(/^\s*([>+~]|\s)\s*/),r&&(o=!0,n.push({type:" ",value:r[0]}),e=e.slice(r[0].length)),Object.keys(Bg).forEach(a),n&&n.length&&t.indexOf(n)<0&&t.push(n),o););})),t}(e),o=t.descendants;for(let e=0,t=r.length;e<t;e++){a=r[e];const t=[];let n=o.slice(),s=!1;a.reverse().forEach((e=>{if(" "===e.type)return t.push(n),n=o.slice(),void(s=!1);n=$g(e,n),s=!0})),s&&t.push(n);const l=t[0].filter((e=>{let n,i=e.parent;for(let e=1;e<t.length;e++){for(n=t[e].indexOf(i);i&&n<0;)i=i.parent,n=t[e].indexOf(i);if(n<0)return!1}return!0}));i.push(l)}for(let e=0,t=i.length;e<t;e++)for(let t=0,r=i[e].length;t<r;t++)n.indexOf(i[e][t])<0&&n.push(i[e][t])}return n||[]}};function Ug(e,t,n){const i=e.type;let r=e.points();n&&(r=r.every((e=>Array.isArray(e)))?r.map((e=>n.transformPoints(e))):n.transformPoints(r)),function(e,t){for(let n=0,i=e.length;n<i;n++)e[n].x/=t,e[n].y/=t}(r,t);let o=null;if("rect"===i||"bounds"===i)o=ur(r),o.type=i;else if("circle"===i)o=function(e,t){return{cx:e[0].x,cy:e[0].y,r:t}}(r,e.r),o.type=i;else if("line"===i)o=hr(r),o.type=i;else if("polygon"===i||"polyline"===i){o={type:"path",d:Iu(r,"polygon"===i)}}else if("geopolygon"===i){let e="";for(let t=0;t<r.length;t++)e+=Iu(r[t],!0);o={type:"path",d:e}}return o}class Yg{constructor(e){this._bounds=function(){let t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];const{x:n,y:i,width:r,height:o}=e.boundingRect?e.boundingRect(t):{x:0,y:0,width:0,height:0};return{x:n,y:i,width:r,height:o}},this._attrs=e.attrs,this._type=e.type,this._data=e.data,this._dpi=e.stage?e.stage.dpi:1,this._collider=()=>function(e,t){if(e.collider){const n=e.modelViewMatrix;return"collection"===e.colliderType?{type:"container",children:e.collider.geometries.map((e=>Ug(e,t,n)))}:Ug(e.collider,t,n)}return null}(e,this._dpi),this._desc=e.desc,this._tag=e.tag,this._children=()=>e.children.map((e=>new Yg(e))),this._parent=()=>e.parent?new Yg(e.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(e){this._cache.elementBoundingRect=null,this._element=e}get element(){return this._element}set key(e){this._key=e}get key(){return this._key}get bounds(){const e=this._bounds();return e.x/=this._dpi,e.y/=this._dpi,e.width/=this._dpi,e.height/=this._dpi,e}get localBounds(){return this._bounds(!1)}boundsRelativeTo(e){const t=typeof e,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"===t&&null!==e&&"function"==typeof e.getBoundingClientRect){const{left:t=0,top:n=0}=e.getBoundingClientRect();r-=t,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 Gg(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return new Yg(...t)}class Xg{constructor(e){this._node=Gg(e),this._parent=null,this._input=null}get node(){return this._node}set parent(e){this._parent=e}get parent(){return this._parent}set input(e){this._input=e}get input(){return this._input}}function Kg(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return new Xg(...t)}function Zg(e,t){const n=e.parent;if(n&&"stage"!==n.type){t.parent=Kg(n);const e=n.parent;e&&"stage"!==e.type&&Zg(e,t.parent)}}function Jg(e,t,n){if(null===e.colliderType)return null;const i=function(e,t){let n={};if(e.modelViewMatrix)if(Array.isArray(t))n=e.inverseModelViewMatrix.transformPoints(t);else if(isNaN(t.r))Array.isArray(t.vertices)?n.vertices=e.inverseModelViewMatrix.transformPoints(t.vertices):n=e.inverseModelViewMatrix.transformPoint(t);else{const i={x:t.cx,y:t.cy};({x:n.cx,y:n.cy}=e.inverseModelViewMatrix.transformPoint(i)),n.r=t.r}else n=t;return Array.isArray(n.vertices)&&(n=n.vertices.every((e=>Array.isArray(e)))?Ng(n):qg(n)),n}(e,n);return"frontChild"===e.colliderType?function(e,t,n){for(let i=e.descendants.length-1;i>=0;i--){const r=e.descendants[i];if(null!==r.collider&&r.collider[t](n)){const e=Kg(r);return Zg(r,e),e}}return null}(e,t,i):function(e,t,n){if(e.collider[t](n)){const t=Kg(e);return Zg(e,t),t}return null}(e,t,i)}function Qg(e,t,n,i){const r=e.length;for(let o=0;o<r;o++){const r=e[o],a=Jg(r,t,i);a&&n.push(a),!r.children||a||r.collider||Qg(r.children,t,n,i)}}function ey(e,t,n){const i=e.length;for(let r=0;r<i;r++){const i=e[r];if(null!==Jg(i,t,n))return!0;if(i.children&&!i.collider)return ey(i.children,t,n)}return!1}function ty(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;let n={};switch(dr(e)){case"circle":return n.cx=e.cx*t,n.cy=e.cy*t,n.r=e.r,["intersectsCircle",n];case"rect":return n=cr(e).map((e=>Fu(e,t))),["intersectsRect",n];case"line":return n=lr(e).map((e=>Fu(e,t))),["intersectsLine",n];case"point":return n=Fu(e,t),["containsPoint",n];case"polygon":return n.vertices=e.vertices.map((e=>Fu(e,t))),["intersectsPolygon",n];case"geopolygon":return n.vertices=e.vertices.map((e=>e.map((e=>Fu(e,t))))),["intersectsGeoPolygon",n];default:return[]}}function ny(e,t){const[n,i]=ty(t,e.dpi),r=[];return n&&(Qg([e],n,r,i),function(e,t){for(let n=0,i=t.length;n<i;n++)t[n].input=e}(t,r)),r}function iy(e,t){const[n,i]=ty(t,e.dpi);return ey([e],n,i)}class ry extends wg{constructor(e){super(e),this._stage=null,this._collider={type:null,definition:null,fn:null},this._attrs={},this._node=null}set(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.node=e;const{data:t,desc:n,tag:i,strokeReference:r,fillReference:o}=e;var a,s;a=this.attrs,s=e,Object.keys(Ru).forEach((e=>{const t=s[e];void 0!==t&&(a[Ru[e]]=t)})),void 0!==t&&(this.data=t),"object"==typeof n&&(this.desc=Qi(!0,{},n)),"string"==typeof i&&(this.tag=i),"string"==typeof r&&(this.strokeReference=r),"string"==typeof o&&(this.fillReference=o)}findShapes(e){return Wg.find(e,this).map((e=>Gg(e)))}getItemsFrom(e){return ny(this,e)}containsPoint(e){return iy(this,e)}intersectsLine(e){return iy(this,e)}intersectsRect(e){return iy(this,e)}intersectsCircle(e){return iy(this,e)}intersectsPolygon(e){return iy(this,e)}intersectsGeoPolygon(e){return iy(this,e)}resolveLocalTransform(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new Pg;void 0!==this.attrs.transform&&Vg(this.attrs.transform,e),this.modelViewMatrix=e.clone()}resolveGlobalTransform(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new Pg;const t=this.ancestors;if(t.length>0)for(let n=t.length-1;n>=0;n--)t[n].resolveLocalTransform(e),e=t[n].modelViewMatrix;this.resolveLocalTransform(e)}attr(e){return this.attrs[e]}equals(e){const t=this.attrs,n=Object.keys(t),i=e.attrs,r=Object.keys(i);if(n.length!==r.length)return!1;for(let e=0;e<n.length;e++){const r=n[e];if(!Object.hasOwnProperty.call(i,r))return!1;if(t[r]!==i[r])return!1}return super.equals(e)}toJSON(){const e=super.toJSON();return e.attrs=this.attrs,e}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(e){this._mvm=e,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(e){this._node=e}get node(){return this._node}set collider(e){const t=Array.isArray(e)?"collection":e&&e.type;return"string"!=typeof t?(this._collider.type=null,this._collider.definition=null,void(this._collider.fn=null)):null!==this._collider&&this._collider.type===t&&null!==this._collider.fn?(this._collider.fn.set(e),void(this._collider.definition=e)):(this._collider.type=t,void(this._collider.definition=e))}get collider(){if(null!==this._collider.fn)return this._collider.fn;switch(this._collider.type){case"collection":this._collider.fn=function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return new Og(...t)}(this._collider.definition);break;case"frontChild":return!0;case"bounds":this._collider.fn=Ig("rect",this.boundingRect());break;case"line":case"rect":case"circle":case"polygon":case"geopolygon":case"polyline":this._collider.fn=Ig(this._collider.type,this._collider.definition);break;default:return null}return this._collider.fn}get colliderType(){return this._collider.type}}class oy extends wg{addChild(e){if(!(e&&e instanceof wg))throw new TypeError("Expecting a Node as argument, but got ".concat(e));if(e===this)throw new Error("Can not add itself as child!");if(e._children&&e._children.length&&this.ancestors.indexOf(e)>=0)throw new Error("Can not add an ancestor as child!");return e._parent&&e._parent!==this&&e._parent.removeChild(e),this._children.push(e),e._parent=this,e._ancestors=null,this}addChildren(e){let t,n=e?e.length:0;for(t=0;t<n;t++)this.addChild(e[t]);return this}removeChild(e){const t=this._children.indexOf(e);return t>=0&&(this._children.splice(t,1),e._parent=null,e._ancestors=null),this}removeChildren(e){let t,n;if(!this._children)return this;if(e)for(n=e.length,t=0;t<n;t++)this.removeChild(e[t]);else for(;this._children.length;)this.removeChild(this._children[0]);return this}}const ay=oy.prototype;class sy extends ry{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const{type:t="container"}=e;super(t),this.set(e)}set(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};super.set(e);const{collider:t}=e,n=Qi({type:null},t);this.collider=n,this.__boundingRect={true:null,false:null},this.__bounds={true:null,false:null}}appendChildRect(e,t){if(void 0!==e.bounds){const n=this.__boundingRect[t]||{},[i,,r]=e.bounds(t),{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[t]=n}}boundingRect(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(null!==this.__boundingRect[e])return this.__boundingRect[e];const t=this.children.length;for(let n=0;n<t;n++)this.appendChildRect(this.children[n],e);return this.__boundingRect[e]=Qi({x:0,y:0,width:0,height:0},this.__boundingRect[e]),this.__boundingRect[e]}bounds(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(null!==this.__bounds[e])return this.__bounds[e];const t=this.boundingRect(e);return this.__bounds[e]=[{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}],this.__bounds[e]}addChild(e){const t=ay.addChild.call(this,e);if(this._collider&&"bounds"===this._collider.type){this.appendChildRect(e,!0);const t=Qi({type:"bounds",x:0,y:0,width:0,height:0},this.__boundingRect.true);this.collider=t}return t}addChildren(e){const t=ay.addChildren.call(this,e),n=e.length;if(this._collider&&"bounds"===this._collider.type&&n>0){for(let t=0;t<n;t++)this.appendChildRect(e[t],!0);const t=Qi({type:"bounds",x:0,y:0,width:0,height:0},this.__boundingRect.true);this.collider=t}return t}removeChild(e){e._stage=null;let t,n=e.descendants,i=n?n.length:0;for(t=0;t<i;t++)n[t]._stage=null;if(ay.removeChild.call(this,e),this._collider&&"bounds"===this._collider.type){this.__boundingRect={true:null,false:null},this.__bounds={true:null,false:null};const e=Qi(this.boundingRect(!0),{type:"bounds"});this.collider=e}return this}removeChildren(e){if(ay.removeChildren.call(this,e),this._collider&&"bounds"===this._collider.type){this.__boundingRect={true:null,false:null},this.__bounds={true:null,false:null};const e=Qi(this.boundingRect(!0),{type:"bounds"});this.collider=e}return this}}function ly(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return new sy(...t)}class cy extends sy{constructor(e){super("stage"),this._stage=this,this._dpiRatio=e||1}get dpi(){return this._dpiRatio}}const uy=oy.prototype,hy=["x1","x2","y1","y2","id","offset","style"];class dy extends ry{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const{type:t="container"}=e;super(t),this.set(e),this._boundingRect={}}set(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};super.set(e);const t=this.attrs;let n="";for(let i=0,r=hy.length;i!==r;i++)n=hy[i],void 0!==e[n]&&(t[n]=e[n])}addChild(e){return uy.addChild.call(this,e)}addChildren(e){return uy.addChildren.call(this,e)}removeChild(e){e._stage=null;let t,n=e.descendants,i=n?n.length:0;for(t=0;t<i;t++)n[t]._stage=null;return uy.removeChild.call(this,e),this}removeChildren(e){return uy.removeChildren.call(this,e),this}}function fy(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return new dy(...t)}const py=oy.prototype,my=["patternUnits","x","y","width","height","id"];class gy extends ry{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const{type:t="container"}=e;super(t),this.set(e),this._boundingRect={}}set(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};super.set(e);const t=this.attrs;let n="";for(let i=0,r=my.length;i!==r;i++)n=my[i],void 0!==e[n]&&(t[n]=e[n])}addChild(e){return py.addChild.call(this,e)}addChildren(e){return py.addChildren.call(this,e)}removeChild(e){e._stage=null;let t,n=e.descendants,i=n?n.length:0;for(t=0;t<i;t++)n[t]._stage=null;return py.removeChild.call(this,e),this}removeChildren(e){return py.removeChildren.call(this,e),this}}class yy extends ry{constructor(){super("rect"),this.set(...arguments)}set(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const{x:t=0,y:n=0,width:i=0,height:r=0,rx:o=0,ry:a=0,collider:s}=e,l=Qi({type:"rect",x:t,y:n,width:i,height:r},s);super.set(e),i>=0?(this.attrs.x=t,this.attrs.width=i):(this.attrs.x=t+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 e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(null!==this.__boundingRect[e])return this.__boundingRect[e];const t=cr(this.attrs),n=e&&this.modelViewMatrix?this.modelViewMatrix.transformPoints(t):t,[i,r,o,a]=sr(n);return this.__boundingRect[e]={x:i,y:r,width:o-i,height:a-r},this.__boundingRect[e]}bounds(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(null!==this.__bounds[e])return this.__bounds[e];const t=this.boundingRect(e);return this.__bounds[e]=[{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}],this.__bounds[e]}}class xy extends ry{constructor(){super("circle"),this.set(...arguments)}set(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const{cx:t=0,cy:n=0,r:i=0,collider:r}=e,o=Qi({type:"circle",cx:t,cy:n,r:i},r);super.set(e),this.attrs.cx=t,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 e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(null!==this.__boundingRect[e])return this.__boundingRect[e];const t=this.bounds(e);return this.__boundingRect[e]={x:t[0].x,y:t[0].y,width:t[2].x-t[0].x,height:t[2].y-t[0].y},this.__boundingRect[e]}bounds(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(null!==this.__bounds[e])return this.__bounds[e];const{cx:t,cy:n,r:i,r:r}=this.attrs,o=t-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(e&&this.modelViewMatrix){c=this.modelViewMatrix.transformPoints(c);const[t,n,i,r]=sr(c);s=i-t,l=r-n,this.__bounds[e]=[{x:t,y:n},{x:t+s,y:n},{x:t+s,y:n+l},{x:t,y:n+l}]}else this.__bounds[e]=c;return this.__bounds[e]}}class vy extends ry{constructor(){super("line"),this.set(...arguments)}set(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const{x1:t=0,y1:n=0,x2:i=0,y2:r=0,collider:o}=e;super.set(e),this.attrs.x1=t,this.attrs.y1=n,this.attrs.x2=i,this.attrs.y2=r;const a={type:"line",x1:t,y1:n,x2:i,y2:r};this.collider=Qi(a,o),this.__boundingRect={true:null,false:null},this.__bounds={true:null,false:null}}boundingRect(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(null!==this.__boundingRect[e])return this.__boundingRect[e];let t=lr(this.attrs);e&&this.modelViewMatrix&&(t=this.modelViewMatrix.transformPoints(t));const[n,i,r,o]=sr(t),a=n!==r||i!==o;return this.__boundingRect[e]={x:n,y:i,width:a?Math.max(1,r-n):0,height:a?Math.max(1,o-i):0},this.__boundingRect[e]}bounds(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(null!==this.__bounds[e])return this.__bounds[e];const t=this.boundingRect(e);return this.__bounds[e]=[{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}],this.__bounds[e]}}const by=Math.PI/2;function wy(e,t){const n=Math.atan2(t.y-e.y,t.x-e.x);return n<0?n+2*Math.PI:n}function My(e,t,n){return{x:e.x+Math.cos(t)*n,y:e.y+Math.sin(t)*n}}const ky={step:function(e){return new uo(e,.5)},stepAfter:function(e){return new uo(e,1)},stepBefore:function(e){return new uo(e,0)},linear:Vr,basis:function(e){return new Xr(e)},cardinal:Jr.tension(0),catmullRom:eo,monotonex:function(e){return new oo(e)},monotoney:function(e){return new ao(e)},natural:function(e){return new lo(e)}};function Sy(e){if(e.length<2)return!1;const t=e[0],n=e[e.length-1];return Math.abs(t.x-n.x)<1e-12&&Math.abs(t.y-n.y)<1e-12}class _y extends ry{constructor(){super("path"),this.set(...arguments)}set(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(super.set(e),this.segments=[],this.points=[],e.arcDatum){const t=Fr();t.innerRadius(e.desc.slice.innerRadius),t.outerRadius(e.desc.slice.outerRadius),t.cornerRadius(e.desc.slice.cornerRadius);const n=t(e.arcDatum);this.attrs.d=n}else if(e.points){const{major:t,minor:n,layerObj:i,points:r,stngs:o,generatorType:a}=e,s=$r(),l=o.coordinates?o.coordinates.defined:null;s[t.p]((e=>e.major*t.size))["".concat(n.p,"1")]((e=>e.minor*n.size))["".concat(n.p,"0")]((e=>e.minor0*n.size)).curve(ky["monotone"===i.curve?"monotone".concat(t.p):i.curve]),l?s.defined((e=>!e.dummy&&"number"==typeof e.minor&&!isNaN(e.minor)&&e.defined)):s.defined((e=>!e.dummy&&"number"==typeof e.minor&&!isNaN(e.minor)));const c=o.connect?r.filter(s.defined()):r,u=("area"===a?s:s[a]())(c);this.attrs.d=u}else e.d&&(this.attrs.d=e.d);if(this.__boundingRect={true:null,false:null},this.__bounds={true:null,false:null},Array.isArray(e.collider)||"object"==typeof e.collider&&void 0!==e.collider.type)this.collider=e.collider;else if(this.attrs.d){if(this.segments=xg(this.attrs.d),this.segments.length>1&&this.segments.every((e=>Sy(e))))return void(this.collider=Qi({type:"geopolygon",vertices:this.segments},e.collider));this.segments.forEach((t=>{if(t.length<=1);else if(Sy(t))this.collider=Qi({type:"polygon",vertices:t},e.collider);else if("object"==typeof e.collider&&e.collider.visual){const n=this.attrs["stroke-width"]/2;this.collider=function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const i=[],r=[];if("h"===n.forceOrientation){const t=e[0].x<e[1].x?-1:1,n=e[e.length-1].x>e[e.length-2].x?1:-1;e.unshift({x:e[0].x+t,y:e[0].y}),e.push({x:e[e.length-1].x+n,y:e[e.length-1].y})}else if("v"===n.forceOrientation){const t=e[0].y<e[1].y?-1:1,n=e[e.length-1].y>e[e.length-2].y?1:-1;e.unshift({x:e[0].x,y:e[0].y+t}),e.push({x:e[e.length-1].x,y:e[e.length-1].y+n})}const o=e.length-1;for(let n=1;n<o;n++){const a=e[n-1],s=e[n],l=e[n+1],c=wy(s,a),u=wy(s,l),h=(c+u)/2,d=h+Math.PI,f=Math.max(h,d),p=Math.min(h,d),m=c>u;if(1===n){const e=wy(a,s);i.push(My(a,e-by,t)),r.unshift(My(a,e+by,t))}const g=m?f:p,y=m?p:f;if(i.push(My(s,g,t)),r.unshift(My(s,y,t)),n===o-1){const e=wy(l,s);i.push(My(l,e+by,t)),r.unshift(My(l,e-by,t))}}return{type:"polygon",vertices:[...i,...r]}}(t,n,e.collider)}else this.collider=Qi({type:"polyline",points:t},e.collider)}))}}boundingRect(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(null!==this.__boundingRect[e])return this.__boundingRect[e];this.points.length||(this.segments=this.segments.length?this.segments:xg(this.attrs.d),this.points=function(e){const t=[];let n,i=e.length;for(let r=0;r<i;r++){n=e[r];for(let e=0;e<n.length;e++)t.push(n[e])}return t}(this.segments));const t=e&&this.modelViewMatrix?this.modelViewMatrix.transformPoints(this.points):this.points,[n,i,r,o]=sr(t);return this.__boundingRect[e]={x:n||0,y:i||0,width:r-n||0,height:o-i||0},this.__boundingRect[e]}bounds(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(null!==this.__bounds[e])return this.__bounds[e];const t=this.boundingRect(e);return this.__bounds[e]=[{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}],this.__bounds[e]}}function qy(e){let{data:t,_boundingRect:n,_textBoundsFn:i}=e;return null!=t&&(n||i)}class Dy extends ry{constructor(){super("text"),this.set(...arguments)}set(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const{x:t=0,y:n=0,dx:i=0,dy:r=0,textBoundsFn:o,text:a,title:s,collider:l,boundingRect:c,ellipsed:u}=e;super.set(e),this.attrs.x=t,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=Qi({type:qy(this)?"bounds":null},l),this.__boundingRect={true:null,false:null},this.__bounds={true:null,false:null}}boundingRect(){let e,t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(null!==this.__boundingRect[t])return this.__boundingRect[t];if("function"!=typeof this._textBoundsFn)return{x:0,y:0,width:0,height:0};e=this._textBoundsFn(this.attrs);const n=cr(e),i=t&&this.modelViewMatrix?this.modelViewMatrix.transformPoints(n):n,[r,o,a,s]=sr(i);return this.__boundingRect[t]={x:r,y:o,width:a-r,height:s-o},this.__boundingRect[t]}bounds(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(null!==this.__bounds[e])return this.__bounds[e];const t=this.boundingRect(e);return this.__bounds[e]=[{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}],this.__bounds[e]}}const Ay=yo();function Cy(e,t){return Ay.get(e)(t)}Ay.add("rect",(function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return new yy(...t)})),Ay.add("circle",(function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return new xy(...t)})),Ay.add("text",(function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return new Dy(...t)})),Ay.add("line",(function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return new vy(...t)})),Ay.add("path",(function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return new _y(...t)})),Ay.add("stage",(function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return new cy(...t)})),Ay.add("container",ly),Ay.add("defs",ly),Ay.add("linearGradient",fy),Ay.add("radialGradient",fy),Ay.add("conicGradient",fy),Ay.add("stop",fy),Ay.add("pattern",(function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return new gy(...t)}));const Ny=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];const t=[{}];function n(){return t[t.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 t=0;t<e.length;t++)a=e[t],void 0!==r[a]&&(o[a]=r[a]);return Qi(o,i),t.push(o),n()},n.restore=function(){t.splice(t.length-1,1)},n}(["stroke","fill","strokeWidth","opacity","fontFamily","fontSize","baseline"]);function Ey(e,t){if(Array.isArray(t))for(let n=0,i=t.length;n<i;n++)t[n](e)}function Ry(e,t,n){e.node=n[t],e.index=t}function Iy(e,t,n,i){let r=!1;const o={siblings:e,node:null,index:0};for(let a=0,s=e.length;a<s;a++){if(Ry(o,a,e),Ey(o,i.create),r="function"==typeof o.node.disabled?o.node.disabled():o.node.disabled,r)continue;o.node=Ny.save(o.node);const s=Cy(o.node.type,o.node);s&&(o.node.transform&&(n.save(),Vg(o.node.transform,n)),n.isIdentity()||(s.modelViewMatrix=n.clone()),t.addChild(s),o.node.children&&Iy(o.node.children,s,n,i),o.node.transform&&n.restore()),Ny.restore()}}function Oy(e){let{items:t,stage:n,dpi:i,on:r={}}=e;return n||(n=Cy("stage",i)),Iy(t,n,new Pg,r),n}function Py(e,t,n){const{orientation:i,degree:r,stops:o=[]}=n;let a=null;if("radial"===i){const n=t.boundingRect();a=e.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 t=n.startAngle||0,i=n.x||0,r=n.y||0;a=e.createConicGradient(t,i,r)}else{const i=Lu(r);["x1","x2","y1","y2"].forEach((e=>{e in n&&(i[e]=n[e])}));const o=t.boundingRect();a=e.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 e=0,t=o.length;e<t;e++){let t=o[e];a.addColorStop(t.offset,t.color)}return a}function Ly(e,t,n){return t.width=e.width,t.height=e.height,n.save(),n.fillStyle=e.fill,e.shapes.forEach((e=>{if("rect"===e.type)n.rect(e.x,e.y,e.width,e.height)})),n.fill(),n.restore(),n.createPattern(t,"repeat")}function Ty(){let{x:e,y:t,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(e)?s.x:e,s.y=isNaN(t)?s.y:t,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((e=>{!isNaN(a[e])&&a[e]>0&&(s.edgeBleed[e]=a[e],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 zy(){const e={element:()=>{},root:()=>{},settings:()=>{},appendTo:()=>{},getScene:()=>[],render:()=>!1,itemsAt:()=>[],findShapes:()=>[],clear:()=>{},destory:()=>{},size:()=>{},measureText:um,textBounds:dm,setKey:t=>{e.element().setAttribute("data-key",t)}};return e}function Fy(e){return t=>{let{node:n}=t;"text"!==n.type||null==n.data||n.textBoundsFn||(n.textBoundsFn=e.textBounds)}}const jy=200,Vy=200;class By{constructor(e){this.targetCanvas=e,this.bufferCanvas=e.cloneNode()}updateSize(e){let t,{rect:n,dpiRatio:i,canvasBufferSize:r}=e;t=r?"function"==typeof r?r(n):r:{width:n.computedPhysical.width+2*jy,height:n.computedPhysical.height+2*Vy},this.bufferCanvas.style.width="".concat(t.width,"px"),this.bufferCanvas.style.height="".concat(t.height,"px"),this.bufferCanvas.width=Math.round(t.width*i),this.bufferCanvas.height=Math.round(t.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 Hy=yo();function $y(e){return Array.isArray(e)?e:"string"==typeof e?-1!==e.indexOf(",")?e.split(","):e.split(" "):[]}function Wy(e){return("undefined"==typeof window?1:window.devicePixelRatio||1)/(e.webkitBackingStorePixelRatio||e.mozBackingStorePixelRatio||e.msBackingStorePixelRatio||e.oBackingStorePixelRatio||e.backingStorePixelRatio||1)}function Uy(e,t){t.setTransform(e[0][0],e[1][0],e[0][1],e[1][1],e[0][2],e[1][2])}function Yy(e,t,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 t.attrs&&!(s in i)&&e[s]!==t.attrs[a]){const n=l?l(t.attrs[a]):t.attrs[a];"function"==typeof e[s]?e[s](n):e[s]=n}}for(let t=0,n=r.length;t<n;t++){const n=r[t];e[n]=i[n]}}function Gy(e,t,n,i){for(let r=0,o=e.length;r<o;r++){let o=e[r],a={};t.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(t,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(t,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))),Yy(t,o,n,a),o.modelViewMatrix&&Uy(o.modelViewMatrix.elements,t),Hy.has(o.type)&&Hy.get(o.type)(o.attrs,{g:t,doFill:"fill"in o.attrs&&"none"!==o.attrs.fill,doStroke:"stroke"in o.attrs&&0!==o.attrs["stroke-width"],ellipsed:o.ellipsed}),o.children&&Gy(o.children,t,n,i),t.restore()}}function Xy(){let e,t,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Oy;const i={transform:void 0,canvasBufferSize:void 0,progressive:void 0};let r,o=!1,a=Ty();const s=[["fill","fillStyle"],["stroke","strokeStyle"],["opacity","globalAlpha"],["globalAlpha","globalAlpha"],["stroke-width","lineWidth"],["stroke-linejoin","lineJoin"],["stroke-dasharray","setLineDash",$y]];let l;const c=zy();return c.element=()=>e,c.root=()=>e,c.settings=e=>(e&&Object.keys(i).forEach((t=>{void 0!==e[t]&&(i[t]=e[t])})),i),c.appendTo=n=>(e||(e=n.ownerDocument.createElement("canvas"),e.style.position="absolute",e.style["-webkit-font-smoothing"]="antialiased",e.style["-moz-osx-font-smoothing"]="antialiased",e.style.pointerEvents="none"),"function"!=typeof i.transform||t||(t=new By(e)),n.appendChild(e),e),c.getScene=i=>{const r=Wy(t&&t.getContext()||e.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:[em(c.measureText),Fy(c)]}})},c.render=n=>{if(!e)return!1;l||(l=function(e){const t=e.createElement("canvas"),n=t.getContext("2d");let i={};return{create(e){const r=e.key;return r?(i[r]=i[r]||Ly(e,t,n),i[r]):Ly(e,t,n)},clear(){i={}}}}(e.ownerDocument));const u=t&&t.getContext()||e.getContext("2d"),h=Wy(u),d=t&&i.transform();if(d)return e.width=e.width,function(e){let{el:t,dpiRatio:n,transform:i}=e;if("object"==typeof i){const e=[i.horizontalScaling,i.horizontalSkewing,i.verticalSkewing,i.verticalScaling,i.horizontalMoving*n,i.verticalMoving*n];t.getContext("2d").setTransform(...e)}}({el:e,dpiRatio:h,transform:d}),t.apply(),!0;o&&(e.style.left="".concat(a.computedPhysical.x,"px"),e.style.top="".concat(a.computedPhysical.y,"px"),e.style.width="".concat(a.computedPhysical.width,"px"),e.style.height="".concat(a.computedPhysical.height,"px"),e.width=Math.round(a.computedPhysical.width*h),e.height=Math.round(a.computedPhysical.height*h),t&&t.updateSize({rect:a,dpiRatio:h,canvasBufferSize:i.canvasBufferSize}));const f=c.getScene(n),p=!r||!f.equals(r);l.clear();const m=o||p,g="function"==typeof i.progressive&&i.progressive();return m&&(g&&!g.isFirst||c.clear(),Gy(f.children,u,s,{patterns:l})),t&&(e.width=e.width,t.apply()),o=!1,g&&!g.isFirst&&f.children.unshift(...r.children),r=f,m},c.itemsAt=e=>r?r.getItemsFrom(e):[],c.findShapes=e=>r?r.findShapes(e):[],c.clear=()=>(e&&(e.width=e.width),t&&t.clear(),r=null,c),c.size=e=>{if(e){const t=Ty(e);JSON.stringify(a)!==JSON.stringify(t)&&(o=!0,a=t)}return a},c.destroy=()=>{e&&(e.parentElement&&e.parentElement.removeChild(e),e=null),t&&(t=null),r=null},c}function Ky(e,t){Hy.add(e,t)}function Zy(e,t){return Math.max(0,Math.min(e,t))}const Jy=new RegExp("[A-Za-zªµºÀ-ÖØ-öø-ʸʻ-ˁː-ˑˠ-ˤˮͰ-ͳͶ-ͽΆΈ-ϵϷ-҂Ҋ-։ः-हऻऽ-ीॉ-ौॎ-ॐक़-ॡ।-ॿং-হঽ-ীে-ৌৎ-ৡ০-ৱ৴-৺ਃ-ਹਾ-ੀਖ਼-੯ੲ-ੴઃ-હઽ-ીૉ-ૌૐ-ૡ૦-૯ଂ-ହଽ-ାୀେ-ୌୗ-ୡ୦-୷ஃ-ிு-ௌௐ-௲ఁ-ఽు-ౄౘ-ౡ౦-౯౿-ಹಽ-ೋೕ-ೡ೦-ീെ-ൌൎ-ൡ൦-ෆා-ෑෘ-ะา-ำเ-ๆ๏-ະາ-ຳຽ-ໆ໐-༗༚-༴༶༸༾-ཬཿ྅ྈ-ྌ྾-࿅࿇-ာေးျ-ြဿ-ၗၚ-ၝၡ-ၰၵ-ႁႃ-ႄႇ-ႌႎ-ႜ႞-ፚ፠-ᎏᎠ-Ᏼᐁ-ᙿᚁ-ᚚᚠ-ᜑᜠ-ᜱ᜵-ᝑᝠ-ᝰក-ាើ-ៅះ-ៈ។-៚ៜ០-៩᠐-ᢨᢪ-ᤜᤣ-ᤦᤩ-ᤱᤳ-ᤸ᥆-᧚ᨀ-ᨖᨙ-ᩕᩗᩡᩣ-ᩤᩭ-ᩲ᪀-᪭ᬄ-ᬳᬵᬻᬽ-ᭁᭃ-᭪᭴-᭼ᮂ-ᮡᮦ-ᮧ᮪-ᯥᯧᯪ-ᯬᯮ᯲-ᰫᰴ-ᰵ᰻-᱿᳓᳡ᳩ-ᳬᳮ-ᶿḀ-ᾼιῂ-ῌῐ-Ίῠ-Ῥῲ-ῼ‎ⁱⁿₐ-ₜℂℇℊ-ℓℕℙ-ℝℤΩℨK-ℭℯ-ℹℼ-ℿⅅ-ⅉⅎ-⅏Ⅰ-ↈ⌶-⍺⎕⒜-ⓩ⚬⠀-⣿Ⰰ-ⳤⳫ-ⳮⴀ-⵰ⶀ-ⷞ々-〇〡-〩〱-〵〸-〼ぁ-ゖゝ-ゟァ-ヺー-ㆺㇰ-㈜㈠-㉏㉠-㉻㉿-㊰㋀-㋋㋐-㍶㍻-㏝㏠-㏾㐀-䶵一-ꒌꓐ-ꘌꘐ-ꙮꚀ-ꛯ꛲-꛷Ꜣ-ꞇ꞉-ꠁꠃ-ꠅꠇ-ꠊꠌ-ꠤꠧ꠰-꠷ꡀ-ꡳꢀ-ꣃ꣎-꣙ꣲ-ꤥ꤮-ꥆꥒ-ꥼꦃ-ꦲꦴ-ꦵꦺ-ꦻꦽ-ꨨꨯ-ꨰꨳ-ꨴꩀ-ꩂꩄ-ꩋꩍ-ꪯꪱꪵ-ꪶꪹ-ꪽꫀꫂ-ꯤꯦ-ꯧꯩ-꯬꯰-ﬗA-Za-zヲ-ᅵ]"),Qy=new RegExp("[־׀׃׆א-״߀-ߪߴ-ߵߺ-ࠕࠚࠤࠨ࠰-ࡘ࡞‏יִײַ-ﬨשׁ-ﭏ]"),ex=new RegExp("[؈؋؍؛-ي٭-ٯٱ-ەۥ-ۦۮ-ۯۺ-܍ܐܒ-ܯݍ-ޥޱﭐ-ﴽﵐ-﷼ﹰ-ﻼ]");function tx(e){return Jy.test(e)}function nx(e){return Qy.test(e)||ex.test(e)}function ix(e){let t,n,i=e?e.length:0;for(t=0;t<i;t++){if(n=e[t],tx(n))return"ltr";if(nx(n))return"rtl"}return"ltr"}const rx={start:"end",end:"start",center:"center",middle:"middle"};function ox(e,t){return"rtl"===t?rx[e]:e}function ax(e,t){const n=[];let i;const r=[],o=[],a=[];let s,l;const c=e=>e.id,u=(e,t)=>{let n;return n="object"==typeof e?"id"in e?e.id:t:e,{content:e,id:"".concat(n,"__").concat(e.type||"")}};e.isTree||(e=e.map(u)),t=t.map(u),s=e.map(c),l=t.map(c);for(let e=0,i=t.length;e<i;e++){-1===s.indexOf(t[e].id)?n.push(t[e]):o.push(t[e])}for(let t=0,n=e.length;t<n;t++){-1===l.indexOf(e[t].id)?r.push(e[t]):a.push(e[t])}for(let e=0,t=n.length;e<t;e++)n[e].content.children&&(n[e].diff=ax([],n[e].content.children),n[e].children=n[e].diff.updatedNew.concat(n[e].diff.added),n[e].children.isTree=!0);for(let e=0,t=o.length;e<t;e++)o[e].diff=ax(a[e].children||[],o[e].content.children||[]),o[e].object=a[e].object,o[e].children=o[e].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 sx(e,t,n){for(let i=0,r=e.length;i<r;i++)e[i].object=n(e[i].content.type,t)}function lx(e,t){for(let n=0,i=e.length;n<i;n++)null!==e[n].object&&void 0!==e[n].object&&(t(e[n].object),e[n].object=null)}function cx(e,t,n,i){let r;for(let o=0,a=e.length;o<a;o++)r=e[o],null!==r.object&&void 0!==r.object&&(n(r.object,r.content),r.diff&&(sx(r.diff.added,r.object,t),lx(r.diff.removed,i),cx(r.diff.items,t,n,i)))}function ux(e,t,n,i,r,o){const a=ax(e,t);return sx(a.added,n,i),lx(a.removed,o),cx(a.items,i,r,o),a.items}Ky("rect",(function(e,t){let{g:n,doFill:i,doStroke:r}=t;n.beginPath(),e.rx>0||e.ry>0?function(e,t,n,i,r,o,a){o=Zy(i/2,o>0?o:a),a=Zy(r/2,a>0?a:o),e.moveTo(t,n+a),e.lineTo(t,n+r-a),e.quadraticCurveTo(t,n+r,t+o,n+r),e.lineTo(t+i-o,n+r),e.quadraticCurveTo(t+i,n+r,t+i,n+r-a),e.lineTo(t+i,n+a),e.quadraticCurveTo(t+i,n,t+i-o,n),e.lineTo(t+o,n),e.quadraticCurveTo(t,n,t,n+a)}(n,e.x,e.y,e.width,e.height,e.rx,e.ry):n.rect(e.x,e.y,e.width,e.height),i&&n.fill(),r&&n.stroke()})),Ky("circle",(function(e,t){let{g:n,doFill:i,doStroke:r}=t;n.beginPath(),n.moveTo(e.cx+e.r,e.cy),n.arc(e.cx,e.cy,e.r,0,2*Math.PI,!1),i&&n.fill(),r&&n.stroke()})),Ky("line",(function(e,t){let{g:n,doStroke:i}=t;n.beginPath(),n.moveTo(e.x1,e.y1),n.lineTo(e.x2,e.y2),i&&n.stroke()})),Ky("path",(function(e,t){let{g:n,doStroke:i,doFill:r}=t;const o=new Path2D(e.d);r&&n.fill(o),i&&n.stroke(o)})),Ky("text",(function(e,t){let{g:n,ellipsed:i,doStroke:r}=t;const o=i||tm(e,um);n.font=[e["font-style"],e["font-weight"],e["font-size"],e["font-family"]].filter((e=>!!e)).join(" ");const a=ix(e.text);n.canvas.dir!==a&&(n.canvas.dir=a);const s=ox("middle"===e["text-anchor"]?"center":e["text-anchor"],n.canvas.dir);s&&n.textAlign!==s&&(n.textAlign=s);const l=nm(e);n.fillText(o,e.x+e.dx,e.y+e.dy+l),r&&n.strokeText(o,e.x+e.dx,e.y+e.dy+l)}));const hx="http://www.w3.org/2000/svg",dx=(e,t)=>{if(!e||"string"!=typeof e)throw new Error("Invalid type: ".concat(e));const n=t.ownerDocument.createElementNS(hx,"container"===e?"g":e);return t.appendChild(n),n},fx=e=>{e.parentNode&&e.parentNode.removeChild(e)},px=(e,t)=>{if((e=>{switch(e.type){case"circle":return!isNaN(e.attrs.cx)&&!isNaN(e.attrs.cy)&&!isNaN(e.attrs.r);case"line":return!(isNaN(e.attrs.x1)||isNaN(e.attrs.y1)||isNaN(e.attrs.x2)||isNaN(e.attrs.y2));case"rect":return!(isNaN(e.attrs.x)||isNaN(e.attrs.y)||isNaN(e.attrs.width)||isNaN(e.attrs.height));case"text":return!isNaN(e.attrs.x)&&!isNaN(e.attrs.y);default:return!0}})(t)){for(const n in t.attrs)if("stroke"===n&&t.strokeReference)e.setAttribute("stroke",t.strokeReference);else if("fill"===n&&t.fillReference)e.setAttribute("fill",t.fillReference);else if("text"===n){e.setAttribute("style","white-space: pre"),e.textContent=t.ellipsed||tm(t.attrs,um);const n=ix(t.attrs.text);"rtl"===n&&(e.setAttribute("direction","rtl"),e.setAttribute("dir","rtl"),e.setAttribute("text-anchor",ox(e.getAttribute("text-anchor"),n)))}else if("text"!==t.type||"dy"!==n&&"dominant-baseline"!==n)if("text"===t.type&&"title"===n&&t.attrs.title){const n=e.ownerDocument.createElementNS(hx,"title");n.textContent=t.attrs.title,e.appendChild(n)}else e.setAttribute(n,t.attrs[n]);else{const i=+e.getAttribute(n)||0;let r=0;r="dominant-baseline"===n?nm(t.attrs):t.attrs[n],e.setAttribute("dy",r+i)}if("string"==typeof t.data||"number"==typeof t.data||"boolean"==typeof t.data)e.setAttribute("data",t.data);else if("object"==typeof t.data&&null!==t.data)for(const n in t.data)"string"!=typeof t.data[n]&&"number"!=typeof t.data[n]&&"boolean"!=typeof t.data[n]||e.setAttribute("data-".concat(n),t.data[n])}};class mx{constructor(e,t,n,i){this.create=e,this.nodeCreator=t,this.nodeMaintainer=n,this.nodeDestroyer=i}render(e,t){return this.create([],e,t,this.nodeCreator,this.nodeMaintainer,this.nodeDestroyer)}}function gx(){return new mx(ux,dx,px,fx)}function yx(e){let t,n,i,r=0;if(0===(e=JSON.stringify(e)).length)return r;for(t=0,i=e.length;t<i;t++)n=e.charCodeAt(t),r=(r<<5)-r+n,r&=r;return r}function xx(){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:hx,t=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Oy;const n=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:gx)();let i,r,o,a=!1,s=Ty();const l={transform:void 0,disableScreenReader:!1},c=zy(),u={type:"defs",children:[]},h=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:yx,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=t(l),u="picasso-pattern-".concat(i,"-").concat(c);if("undefined"!=typeof window&&(s=window.location.href.split("#")[0]),!n[c]){const t={patternUnits:"userSpaceOnUse",x:0,y:0,width:l.width,height:l.height,type:"pattern",id:u,children:[],fill:l.fill};l.shapes.forEach((e=>{t.children.push(e)})),e.push(t),n[c]=!0}r.node["".concat(a,"Reference")]="url('".concat(s,"#").concat(u,"')")}))},clear(){n={}}};return r}(u.children),d=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:yx,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=t(r[o]),l="picasso-gradient-".concat(i,"-").concat(s);if(!n[s]){let{orientation:t,degree:i,stops:a=[]}=r[o],c={};void 0===i&&(i=90),"radial"===t?c.type="radialGradient":(c=Lu(i),["x1","x2","y1","y2"].forEach((e=>{e in r[o]&&(c[e]=r[o][e])})),c.type="linearGradient"),c.id=l,c.children=a.map((e=>{let{offset:t,color:n,opacity:i}=e;return{type:"stop",offset:"".concat(100*t,"%"),style:"stop-color:".concat(n,";stop-opacity:").concat(void 0!==i?i:1)}})),e.push(c),n[s]=l}return"url('".concat(a,"#").concat(l,"')")},onCreate(e){let t="";"undefined"!=typeof window&&(t=window.location.href.split("#")[0]);const n=e.node;n.fill&&"object"==typeof n.fill&&"gradient"===n.fill.type&&(n.fillReference=r.getOrCreateGradient(n,"fill",t)),n.stroke&&"object"==typeof n.stroke&&"gradient"===n.stroke.type&&(n.strokeReference=r.getOrCreateGradient(n,"stroke",t))},clear(){n={}}};return r}(u.children);return c.element=()=>i,c.root=()=>r,c.settings=e=>(e&&Object.keys(l).forEach((t=>{void 0!==e[t]&&(l[t]=e[t])})),l),c.appendTo=t=>(i||(i=t.ownerDocument.createElementNS(e,"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",e),r=t.ownerDocument.createElementNS(e,"g"),r.style.pointerEvents="auto",i.appendChild(r)),t.appendChild(i),i),c.getScene=e=>{const n=s.scaleRatio.x,i=s.scaleRatio.y,r={type:"container",children:Array.isArray(e)?[...e,u]:e,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,")")),t({items:[r],on:{create:[e=>{e.node.fillReference=void 0,e.node.strokeReference=void 0},d.onCreate,h.onCreate,em(c.measureText),Fy(c)]}})},c.render=e=>{if(!i)return!1;const t="function"==typeof l.transform&&l.transform();if(t){const{horizontalScaling:e,horizontalSkewing:n,verticalSkewing:i,verticalScaling:o,horizontalMoving:a,verticalMoving:s}=t;return r.style.transform="matrix(".concat(e,", ").concat(n,", ").concat(i,", ").concat(o,", ").concat(a,", ").concat(s,")"),!0}r.style.transform="";l.disableScreenReader&&i.setAttribute("aria-hidden",!0),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(e),p=!o||!f.equals(o),m=a||p;return m&&(c.clear(),n.render(f.children,r)),a=!1,o=f,m},c.itemsAt=e=>o?o.getItemsFrom(e):[],c.findShapes=e=>o?o.findShapes(e):[],c.clear=()=>{if(!r)return c;o=null;const e=r.cloneNode(!1);return i.replaceChild(e,r),r=e,c},c.destroy=()=>{i&&i.parentNode&&i.parentNode.removeChild(i),i=null,r=null},c.size=e=>{if(e){const t=Ty(e);JSON.stringify(s)!==JSON.stringify(t)&&(a=!0,s=t)}return s},c}var vx,bx,wx,Mx,kx,Sx,_x,qx={},Dx=[],Ax=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i;function Cx(e,t){for(var n in t)e[n]=t[n];return e}function Nx(e){var t=e.parentNode;t&&t.removeChild(e)}function Ex(e,t,n){var i,r,o,a={};for(o in t)"key"==o?i=t[o]:"ref"==o?r=t[o]:a[o]=t[o];if(arguments.length>2&&(a.children=arguments.length>3?vx.call(arguments,2):n),"function"==typeof e&&null!=e.defaultProps)for(o in e.defaultProps)void 0===a[o]&&(a[o]=e.defaultProps[o]);return Rx(e,a,i,r,null)}function Rx(e,t,n,i,r){var o={type:e,props:t,key:n,ref:i,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,__h:null,constructor:void 0,__v:null==r?++wx:r};return null==r&&null!=bx.vnode&&bx.vnode(o),o}function Ix(e){return e.children}function Ox(e,t){this.props=e,this.context=t}function Px(e,t){if(null==t)return e.__?Px(e.__,e.__.__k.indexOf(e)+1):null;for(var n;t<e.__k.length;t++)if(null!=(n=e.__k[t])&&null!=n.__e)return n.__e;return"function"==typeof e.type?Px(e):null}function Lx(e){var t,n;if(null!=(e=e.__)&&null!=e.__c){for(e.__e=e.__c.base=null,t=0;t<e.__k.length;t++)if(null!=(n=e.__k[t])&&null!=n.__e){e.__e=e.__c.base=n.__e;break}return Lx(e)}}function Tx(e){(!e.__d&&(e.__d=!0)&&Mx.push(e)&&!zx.__r++||kx!==bx.debounceRendering)&&((kx=bx.debounceRendering)||Sx)(zx)}function zx(){var e,t,n,i,r,o,a,s;for(Mx.sort(_x);e=Mx.shift();)e.__d&&(t=Mx.length,i=void 0,r=void 0,a=(o=(n=e).__v).__e,(s=n.__P)&&(i=[],(r=Cx({},o)).__v=o.__v+1,Yx(s,o,r,n.__n,void 0!==s.ownerSVGElement,null!=o.__h?[a]:null,i,null==a?Px(o):a,o.__h),Gx(i,o),o.__e!=a&&Lx(o)),Mx.length>t&&Mx.sort(_x));zx.__r=0}function Fx(e,t,n,i,r,o,a,s,l,c){var u,h,d,f,p,m,g,y=i&&i.__k||Dx,x=y.length;for(n.__k=[],u=0;u<t.length;u++)if(null!=(f=n.__k[u]=null==(f=t[u])||"boolean"==typeof f||"function"==typeof f?null:"string"==typeof f||"number"==typeof f||"bigint"==typeof f?Rx(null,f,null,null,f):Array.isArray(f)?Rx(Ix,{children:f},null,null,null):f.__b>0?Rx(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}Yx(e,f,d=d||qx,r,o,a,s,l,c),p=f.__e,(h=f.ref)&&d.ref!=h&&(g||(g=[]),d.ref&&g.push(d.ref,null,f),g.push(h,f.__c||p,f)),null!=p?(null==m&&(m=p),"function"==typeof f.type&&f.__k===d.__k?f.__d=l=jx(f,l,e):l=Vx(e,f,d,y,p,l),"function"==typeof n.type&&(n.__d=l)):l&&d.__e==l&&l.parentNode!=e&&(l=Px(d))}for(n.__e=m,u=x;u--;)null!=y[u]&&("function"==typeof n.type&&null!=y[u].__e&&y[u].__e==n.__d&&(n.__d=Bx(i).nextSibling),Zx(y[u],y[u]));if(g)for(u=0;u<g.length;u++)Kx(g[u],g[++u],g[++u])}function jx(e,t,n){for(var i,r=e.__k,o=0;r&&o<r.length;o++)(i=r[o])&&(i.__=e,t="function"==typeof i.type?jx(i,t,n):Vx(n,i,i,r,i.__e,t));return t}function Vx(e,t,n,i,r,o){var a,s,l;if(void 0!==t.__d)a=t.__d,t.__d=void 0;else if(null==n||r!=o||null==r.parentNode)e:if(null==o||o.parentNode!==e)e.appendChild(r),a=null;else{for(s=o,l=0;(s=s.nextSibling)&&l<i.length;l+=1)if(s==r)break e;e.insertBefore(r,o),a=o}return void 0!==a?a:r.nextSibling}function Bx(e){var t,n,i;if(null==e.type||"string"==typeof e.type)return e.__e;if(e.__k)for(t=e.__k.length-1;t>=0;t--)if((n=e.__k[t])&&(i=Bx(n)))return i;return null}function Hx(e,t,n){"-"===t[0]?e.setProperty(t,null==n?"":n):e[t]=null==n?"":"number"!=typeof n||Ax.test(t)?n:n+"px"}function $x(e,t,n,i,r){var o;e:if("style"===t)if("string"==typeof n)e.style.cssText=n;else{if("string"==typeof i&&(e.style.cssText=i=""),i)for(t in i)n&&t in n||Hx(e.style,t,"");if(n)for(t in n)i&&n[t]===i[t]||Hx(e.style,t,n[t])}else if("o"===t[0]&&"n"===t[1])o=t!==(t=t.replace(/Capture$/,"")),t=t.toLowerCase()in e?t.toLowerCase().slice(2):t.slice(2),e.l||(e.l={}),e.l[t+o]=n,n?i||e.addEventListener(t,o?Ux:Wx,o):e.removeEventListener(t,o?Ux:Wx,o);else if("dangerouslySetInnerHTML"!==t){if(r)t=t.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if("width"!==t&&"height"!==t&&"href"!==t&&"list"!==t&&"form"!==t&&"tabIndex"!==t&&"download"!==t&&t in e)try{e[t]=null==n?"":n;break e}catch(e){}"function"==typeof n||(null==n||!1===n&&"-"!==t[4]?e.removeAttribute(t):e.setAttribute(t,n))}}function Wx(e){return this.l[e.type+!1](bx.event?bx.event(e):e)}function Ux(e){return this.l[e.type+!0](bx.event?bx.event(e):e)}function Yx(e,t,n,i,r,o,a,s,l){var c,u,h,d,f,p,m,g,y,x,v,b,w,M,k,S=t.type;if(void 0!==t.constructor)return null;null!=n.__h&&(l=n.__h,s=t.__e=n.__e,t.__h=null,o=[s]),(c=bx.__b)&&c(t);try{e:if("function"==typeof S){if(g=t.props,y=(c=S.contextType)&&i[c.__c],x=c?y?y.props.value:c.__:i,n.__c?m=(u=t.__c=n.__c).__=u.__E:("prototype"in S&&S.prototype.render?t.__c=u=new S(g,x):(t.__c=u=new Ox(g,x),u.constructor=S,u.render=Jx),y&&y.sub(u),u.props=g,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!=S.getDerivedStateFromProps&&(u.__s==u.state&&(u.__s=Cx({},u.__s)),Cx(u.__s,S.getDerivedStateFromProps(g,u.__s))),d=u.props,f=u.state,u.__v=t,h)null==S.getDerivedStateFromProps&&null!=u.componentWillMount&&u.componentWillMount(),null!=u.componentDidMount&&u.__h.push(u.componentDidMount);else{if(null==S.getDerivedStateFromProps&&g!==d&&null!=u.componentWillReceiveProps&&u.componentWillReceiveProps(g,x),!u.__e&&null!=u.shouldComponentUpdate&&!1===u.shouldComponentUpdate(g,u.__s,x)||t.__v===n.__v){for(t.__v!==n.__v&&(u.props=g,u.state=u.__s,u.__d=!1),u.__e=!1,t.__e=n.__e,t.__k=n.__k,t.__k.forEach((function(e){e&&(e.__=t)})),v=0;v<u._sb.length;v++)u.__h.push(u._sb[v]);u._sb=[],u.__h.length&&a.push(u);break e}null!=u.componentWillUpdate&&u.componentWillUpdate(g,u.__s,x),null!=u.componentDidUpdate&&u.__h.push((function(){u.componentDidUpdate(d,f,p)}))}if(u.context=x,u.props=g,u.__P=e,b=bx.__r,w=0,"prototype"in S&&S.prototype.render){for(u.state=u.__s,u.__d=!1,b&&b(t),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(t),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=Cx(Cx({},i),u.getChildContext())),h||null==u.getSnapshotBeforeUpdate||(p=u.getSnapshotBeforeUpdate(d,f)),k=null!=c&&c.type===Ix&&null==c.key?c.props.children:c,Fx(e,Array.isArray(k)?k:[k],t,n,i,r,o,a,s,l),u.base=t.__e,t.__h=null,u.__h.length&&a.push(u),m&&(u.__E=u.__=null),u.__e=!1}else null==o&&t.__v===n.__v?(t.__k=n.__k,t.__e=n.__e):t.__e=Xx(n.__e,t,n,i,r,o,a,l);(c=bx.diffed)&&c(t)}catch(e){t.__v=null,(l||null!=o)&&(t.__e=s,t.__h=!!l,o[o.indexOf(s)]=null),bx.__e(e,t,n)}}function Gx(e,t){bx.__c&&bx.__c(t,e),e.some((function(t){try{e=t.__h,t.__h=[],e.some((function(e){e.call(t)}))}catch(e){bx.__e(e,t.__v)}}))}function Xx(e,t,n,i,r,o,a,s){var l,c,u,h=n.props,d=t.props,f=t.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)){e=l,o[p]=null;break}if(null==e){if(null===f)return document.createTextNode(d);e=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&&e.data===d||(e.data=d);else{if(o=o&&vx.call(e.childNodes),c=(h=n.props||qx).dangerouslySetInnerHTML,u=d.dangerouslySetInnerHTML,!s){if(null!=o)for(h={},p=0;p<e.attributes.length;p++)h[e.attributes[p].name]=e.attributes[p].value;(u||c)&&(u&&(c&&u.__html==c.__html||u.__html===e.innerHTML)||(e.innerHTML=u&&u.__html||""))}if(function(e,t,n,i,r){var o;for(o in n)"children"===o||"key"===o||o in t||$x(e,o,null,n[o],i);for(o in t)r&&"function"!=typeof t[o]||"children"===o||"key"===o||"value"===o||"checked"===o||n[o]===t[o]||$x(e,o,t[o],n[o],i)}(e,d,h,r,s),u)t.__k=[];else if(p=t.props.children,Fx(e,Array.isArray(p)?p:[p],t,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]&&Nx(o[p]);s||("value"in d&&void 0!==(p=d.value)&&(p!==e.value||"progress"===f&&!p||"option"===f&&p!==h.value)&&$x(e,"value",p,h.value,!1),"checked"in d&&void 0!==(p=d.checked)&&p!==e.checked&&$x(e,"checked",p,h.checked,!1))}return e}function Kx(e,t,n){try{"function"==typeof e?e(t):e.current=t}catch(e){bx.__e(e,n)}}function Zx(e,t,n){var i,r;if(bx.unmount&&bx.unmount(e),(i=e.ref)&&(i.current&&i.current!==e.__e||Kx(i,null,t)),null!=(i=e.__c)){if(i.componentWillUnmount)try{i.componentWillUnmount()}catch(e){bx.__e(e,t)}i.base=i.__P=null,e.__c=void 0}if(i=e.__k)for(r=0;r<i.length;r++)i[r]&&Zx(i[r],t,n||"function"!=typeof e.type);n||null==e.__e||Nx(e.__e),e.__=e.__e=e.__d=void 0}function Jx(e,t,n){return this.constructor(e,n)}function Qx(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const{createElement:t=document.createElement.bind(document)}=e;let n,i,r=Ty();const o={transform:void 0,disableScreenReader:!1},a=zy();return a.element=()=>n,a.root=()=>n,a.settings=e=>(e&&Object.keys(o).forEach((t=>{void 0!==e[t]&&(o[t]=e[t])})),o),a.appendTo=e=>(n||(n=t("div"),n.style.position="absolute",n.style["-webkit-font-smoothing"]="antialiased",n.style["-moz-osx-font-smoothing"]="antialiased",n.style.pointerEvents="none"),e.appendChild(n),n),a.render=e=>{if(!n)return!1;const t="function"==typeof o.transform&&o.transform();if(t){const{horizontalScaling:e,horizontalSkewing:i,verticalSkewing:r,verticalScaling:o,horizontalMoving:a,verticalMoving:s}=t;return n.style.transform="matrix(".concat(e,", ").concat(i,", ").concat(r,", ").concat(o,", ").concat(a,", ").concat(s,")"),!0}n.style.transform="";let a;return o.disableScreenReader&&n.setAttribute("aria-hidden",!0),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(e)?Ex("div",null,e):e,i=function(e,t,n){var i,r,o;bx.__&&bx.__(e,t),r=(i="function"==typeof n)?null:n&&n.__k||t.__k,o=[],Yx(t,e=(!i&&n||t).__k=Ex(Ix,null,[e]),r||qx,qx,void 0!==t.ownerSVGElement,!i&&n?[n]:r?null:t.firstChild?vx.call(t.childNodes):null,o,!i&&n?n:r?r.__e:t.firstChild,i),Gx(o,e)}(a,n,i),!0},a.renderArgs=[Ex],a.clear=()=>{if(n){let e=n.firstChild;for(;e;)n.removeChild(e),e=n.firstChild;i=null}return a},a.destroy=()=>{n&&n.parentElement&&n.parentElement.removeChild(n),n=null,i=null},a.size=e=>(e&&(r=Ty(e)),r),a}vx=Dx.slice,bx={__e:function(e,t,n,i){for(var r,o,a;t=t.__;)if((r=t.__c)&&!r.__)try{if((o=r.constructor)&&null!=o.getDerivedStateFromError&&(r.setState(o.getDerivedStateFromError(e)),a=r.__d),null!=r.componentDidCatch&&(r.componentDidCatch(e,i||{}),a=r.__d),a)return r.__E=r}catch(t){e=t}throw e}},wx=0,Ox.prototype.setState=function(e,t){var n;n=null!=this.__s&&this.__s!==this.state?this.__s:this.__s=Cx({},this.state),"function"==typeof e&&(e=e(Cx({},n),this.props)),e&&Cx(n,e),null!=e&&this.__v&&(t&&this._sb.push(t),Tx(this))},Ox.prototype.forceUpdate=function(e){this.__v&&(this.__e=!0,e&&this.__h.push(e),Tx(this))},Ox.prototype.render=Ix,Mx=[],Sx="function"==typeof Promise?Promise.prototype.then.bind(Promise.resolve()):setTimeout,_x=function(e,t){return e.__v.__b-t.__v.__b},zx.__r=0;var ev=[function(e){e.renderer("svg",xx)},function(e){e.renderer("canvas",Xy)},function(e){e.renderer("dom",Qx)}];const tv={OFF:0,ERROR:1,WARN:2,INFO:3,DEBUG:4};const nv=function e(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const i=function(){let{level:e=tv.OFF,pipe:t=console}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=e;const i={[tv.OFF]:()=>{},[tv.ERROR]:function(){return t.error(...arguments)},[tv.WARN]:function(){return t.warn(...arguments)},[tv.INFO]:function(){return t.info(...arguments)},[tv.DEBUG]:function(){return t.log(...arguments)}},r=function(e){if(e&&!(n<e)){for(var t=arguments.length,r=new Array(t>1?t-1:0),o=1;o<t;o++)r[o-1]=arguments[o];(i[e]||i[tv.DEBUG])(...r)}};return{log:r,error:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return r(tv.ERROR,...t)},warn:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return r(tv.WARN,...t)},info:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return r(tv.INFO,...t)},debug:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return r(tv.DEBUG,...t)},level:e=>("number"==typeof e&&(n=e),n),LOG_LEVEL:tv}}(t.logger),r={component:yo(n.component,"component",i),data:yo(n.data,"data",i),formatter:yo(n.formatter,"formatter",i),interaction:yo(n.interaction,"interaction",i),renderer:rd(n.renderer),scale:yo(n.scale,"scale",i),symbol:yo(n.symbol,"symbol",i),logger:i};function o(){let n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return e({palettes:t.palettes.concat(n.palettes||[]),style:Qi({},t.style,n.style),logger:n.logger||t.logger,renderer:n.renderer||t.renderer},r)}return t.renderer&&t.renderer.prio&&r.renderer.default(t.renderer.prio[0]),o.use=function(e){return function(e){e(arguments.length>2?arguments[2]:void 0,arguments.length>1&&void 0!==arguments[1]?arguments[1]:{})}(e,arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r)},o.chart=e=>id(e,{registries:r,logger:i,style:t.style,palettes:t.palettes}),o.config=()=>t,Object.keys(r).forEach((e=>{o[e]=r[e]})),o.version=er,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:od,data:ud,formatter:Vs,interaction:hd,renderer:rd(),scale:Bc,symbol:Gu});bg.forEach(nv.use),ev.forEach(nv.use),[].forEach(nv.use);const iv={require:["chart","renderer"],renderer:"dom",render(e){var t;return function({chart:e,settings:t,h:n}){if(!e)return[];const i=function({h:e,settings:t}){if(!t)return[];const{isRtl:n,title:i,text:r}=t,o={disclaimer:{borderRadius:"10px",border:"1px solid #404040",position:"absolute",top:"10%",left:"50%",margin:"0 0 0 -150px",width:"298px",cursor:"default",background:"white",direction:n?"rtl":"ltr"},closeIcon:{position:"absolute",[n?"left":"right"]:"5px",top:"3px",cursor:"pointer",color:"#595959",pointerEvents:"auto"},dmHeader:{color:"#575859",fontSize:"18px",paddingLeft:"20px",paddingTop:"10px",paddingRight:"20px",paddingBottom:"0px",maxHeight:"44px",overflow:"hidden"},dmMain:{display:"block",color:"#575859",paddingLeft:"20px",paddingRight:"20px",paddingTop:"10px",paddingBottom:"10px"},dmP:{paddingBottom:"10px"},hidden:{display:"none"}};return[e("div",{style:o.disclaimer},e("div",{style:o.closeIcon,onClick:()=>null==t?void 0:t.close()},e("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 16 16"},e("defs",{},e("path",{id:"remove-a",d:"M9.41421356,8 L11.8890873,5.52512627 C12.065864,5.34834957 12.0305087,4.95944084 11.8183766,4.74730881 L11.2526912,4.18162338 C11.0405592,3.96949135 10.6516504,3.93413601 10.4748737,4.1109127 L8,6.58578644 L5.52512627,4.1109127 C5.34834957,3.93413601 4.95944084,3.96949135 4.74730881,4.18162338 L4.25233406,4.67659813 C3.96949135,4.95944084 3.93413601,5.34834957 4.1109127,5.52512627 L6.58578644,8 L4.1109127,10.4748737 C3.93413601,10.6516504 3.96949135,11.0405592 4.18162338,11.2526912 L4.67659813,11.7476659 C4.95944084,12.0305087 5.34834957,12.065864 5.52512627,11.8890873 L8,9.41421356 L10.4748737,11.8890873 C10.6516504,12.065864 11.0405592,12.0305087 11.2526912,11.8183766 L11.8183766,11.2526912 C12.0305087,11.0405592 12.065864,10.6516504 11.8890873,10.4748737 L9.41421356,8 Z M8,0 C12.4,0 16,3.6 16,8 C16,12.4 12.4,16 8,16 C3.6,16 0,12.4 0,8 C0,3.6 3.6,0 8,0 Z"})),e("use",{xlinkHref:"#remove-a"}))),e("header",{style:o.dmHeader},`${i}`),e("main",{style:o.dmMain},e("p",{style:o.dmP},`${r}`)))]}({settings:t,h:n});return i}({chart:this.chart,settings:null===(t=this.settings)||void 0===t?void 0:t.settings,h:e})}},rv=52,ov=-.7*Math.PI,av=.7*Math.PI,sv="#EEEEEE",lv=2.38,cv={MIN:12,MAX:60},uv={MIN:100,MAX:1e3},hv={LEFT:4,RIGHT:4},dv={VERTICAL_ALIGNMENT_FACTOR:.4},fv={VERTICAL_ALIGNMENT_FACTOR:.5},pv=2,mv=1.2,gv="#595959",yv="#E6E6E6",xv=.4,vv=1,bv=2,wv=.15,Mv=20,kv=.75,Sv=150,_v=12,qv=8,Dv=70,Av=3,Cv={MEASURE:"measure"},Nv={BAR:"bar",SEGMENT_BAR:"segment-bar",LABEL_BAR:"label-bar",BACKGROUND_BAR:"background-bar",MARK:"mark",OOB_INDICATOR:"oob-indicator",BAR_AXIS:"bar-axis",AXIS_TITLE:"axis-title",GAUGE_LABEL:"gauge-label",RADIAL_AXIS:"radial-axis",RADIAL_GAUGE_NEEDLE:"radial-gauge-needle",RADIAL_OOB_INDICATOR_MIN:"radial-oob-indicator-min",RADIAL_OOB_INDICATOR_MAX:"radial-oob-indicator-max",RADIAL_GAUGE:"radial-gauge",CIRCLE_GAUGE:"circle-gauge",REFERENCE_LINES_AND_LABELS:"reference-lines-and-labels",RADIAL_SPARK:"radial-spark",RADIAL_GAUGE_LABEL:"radial-gauge-label",RADIAL_REFERENCE_LINES:"radial-reference-lines",SEGMENT_RADIAL_GAUGE:"segment-radial-gauge",LABEL_RADIAL_GAUGE:"label-radial-gauge"},Ev="color",Rv=1e-4,Iv="XSMALL",Ov="XSMALL_VERTICAL",Pv="XSMALL_HORIZONTAL",Lv="SMALL",Tv="MEDIUM",zv={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}},Fv=600,jv=200,Vv=500;function Bv(e,t,n){e.prototype=t.prototype=n,n.constructor=e}function Hv(e,t){var n=Object.create(e.prototype);for(var i in t)n[i]=t[i];return n}function $v(){}var Wv=.7,Uv=1/Wv,Yv="\\s*([+-]?\\d+)\\s*",Gv="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",Xv="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",Kv=/^#([0-9a-f]{3,8})$/,Zv=new RegExp(`^rgb\\(${Yv},${Yv},${Yv}\\)$`),Jv=new RegExp(`^rgb\\(${Xv},${Xv},${Xv}\\)$`),Qv=new RegExp(`^rgba\\(${Yv},${Yv},${Yv},${Gv}\\)$`),eb=new RegExp(`^rgba\\(${Xv},${Xv},${Xv},${Gv}\\)$`),tb=new RegExp(`^hsl\\(${Gv},${Xv},${Xv}\\)$`),nb=new RegExp(`^hsla\\(${Gv},${Xv},${Xv},${Gv}\\)$`),ib={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 rb(){return this.rgb().formatHex()}function ob(){return this.rgb().formatRgb()}function ab(e){var t,n;return e=(e+"").trim().toLowerCase(),(t=Kv.exec(e))?(n=t[1].length,t=parseInt(t[1],16),6===n?sb(t):3===n?new hb(t>>8&15|t>>4&240,t>>4&15|240&t,(15&t)<<4|15&t,1):8===n?lb(t>>24&255,t>>16&255,t>>8&255,(255&t)/255):4===n?lb(t>>12&15|t>>8&240,t>>8&15|t>>4&240,t>>4&15|240&t,((15&t)<<4|15&t)/255):null):(t=Zv.exec(e))?new hb(t[1],t[2],t[3],1):(t=Jv.exec(e))?new hb(255*t[1]/100,255*t[2]/100,255*t[3]/100,1):(t=Qv.exec(e))?lb(t[1],t[2],t[3],t[4]):(t=eb.exec(e))?lb(255*t[1]/100,255*t[2]/100,255*t[3]/100,t[4]):(t=tb.exec(e))?yb(t[1],t[2]/100,t[3]/100,1):(t=nb.exec(e))?yb(t[1],t[2]/100,t[3]/100,t[4]):ib.hasOwnProperty(e)?sb(ib[e]):"transparent"===e?new hb(NaN,NaN,NaN,0):null}function sb(e){return new hb(e>>16&255,e>>8&255,255&e,1)}function lb(e,t,n,i){return i<=0&&(e=t=n=NaN),new hb(e,t,n,i)}function cb(e){return e instanceof $v||(e=ab(e)),e?new hb((e=e.rgb()).r,e.g,e.b,e.opacity):new hb}function ub(e,t,n,i){return 1===arguments.length?cb(e):new hb(e,t,n,null==i?1:i)}function hb(e,t,n,i){this.r=+e,this.g=+t,this.b=+n,this.opacity=+i}function db(){return`#${gb(this.r)}${gb(this.g)}${gb(this.b)}`}function fb(){const e=pb(this.opacity);return`${1===e?"rgb(":"rgba("}${mb(this.r)}, ${mb(this.g)}, ${mb(this.b)}${1===e?")":`, ${e})`}`}function pb(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function mb(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function gb(e){return((e=mb(e))<16?"0":"")+e.toString(16)}function yb(e,t,n,i){return i<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new vb(e,t,n,i)}function xb(e){if(e instanceof vb)return new vb(e.h,e.s,e.l,e.opacity);if(e instanceof $v||(e=ab(e)),!e)return new vb;if(e instanceof vb)return e;var t=(e=e.rgb()).r/255,n=e.g/255,i=e.b/255,r=Math.min(t,n,i),o=Math.max(t,n,i),a=NaN,s=o-r,l=(o+r)/2;return s?(a=t===o?(n-i)/s+6*(n<i):n===o?(i-t)/s+2:(t-n)/s+4,s/=l<.5?o+r:2-o-r,a*=60):s=l>0&&l<1?0:a,new vb(a,s,l,e.opacity)}function vb(e,t,n,i){this.h=+e,this.s=+t,this.l=+n,this.opacity=+i}function bb(e){return(e=(e||0)%360)<0?e+360:e}function wb(e){return Math.max(0,Math.min(1,e||0))}function Mb(e,t,n){return 255*(e<60?t+(n-t)*e/60:e<180?n:e<240?t+(n-t)*(240-e)/60:t)}Bv($v,ab,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:rb,formatHex:rb,formatHex8:function(){return this.rgb().formatHex8()},formatHsl:function(){return xb(this).formatHsl()},formatRgb:ob,toString:ob}),Bv(hb,ub,Hv($v,{brighter(e){return e=null==e?Uv:Math.pow(Uv,e),new hb(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=null==e?Wv:Math.pow(Wv,e),new hb(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new hb(mb(this.r),mb(this.g),mb(this.b),pb(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:db,formatHex:db,formatHex8:function(){return`#${gb(this.r)}${gb(this.g)}${gb(this.b)}${gb(255*(isNaN(this.opacity)?1:this.opacity))}`},formatRgb:fb,toString:fb})),Bv(vb,(function(e,t,n,i){return 1===arguments.length?xb(e):new vb(e,t,n,null==i?1:i)}),Hv($v,{brighter(e){return e=null==e?Uv:Math.pow(Uv,e),new vb(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=null==e?Wv:Math.pow(Wv,e),new vb(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=this.h%360+360*(this.h<0),t=isNaN(e)||isNaN(this.s)?0:this.s,n=this.l,i=n+(n<.5?n:1-n)*t,r=2*n-i;return new hb(Mb(e>=240?e-240:e+120,r,i),Mb(e,r,i),Mb(e<120?e+240:e-120,r,i),this.opacity)},clamp(){return new vb(bb(this.h),wb(this.s),wb(this.l),pb(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 e=pb(this.opacity);return`${1===e?"hsl(":"hsla("}${bb(this.h)}, ${100*wb(this.s)}%, ${100*wb(this.l)}%${1===e?")":`, ${e})`}`}}));const kb=Math.PI/180,Sb=180/Math.PI,_b=.96422,qb=.82521,Db=4/29,Ab=6/29,Cb=3*Ab*Ab,Nb=Ab*Ab*Ab;function Eb(e){if(e instanceof Rb)return new Rb(e.l,e.a,e.b,e.opacity);if(e instanceof zb)return Fb(e);e instanceof hb||(e=cb(e));var t,n,i=Lb(e.r),r=Lb(e.g),o=Lb(e.b),a=Ib((.2225045*i+.7168786*r+.0606169*o)/1);return i===r&&r===o?t=n=a:(t=Ib((.4360747*i+.3850649*r+.1430804*o)/_b),n=Ib((.0139322*i+.0971045*r+.7141733*o)/qb)),new Rb(116*a-16,500*(t-a),200*(a-n),e.opacity)}function Rb(e,t,n,i){this.l=+e,this.a=+t,this.b=+n,this.opacity=+i}function Ib(e){return e>Nb?Math.pow(e,1/3):e/Cb+Db}function Ob(e){return e>Ab?e*e*e:Cb*(e-Db)}function Pb(e){return 255*(e<=.0031308?12.92*e:1.055*Math.pow(e,1/2.4)-.055)}function Lb(e){return(e/=255)<=.04045?e/12.92:Math.pow((e+.055)/1.055,2.4)}function Tb(e,t,n,i){return 1===arguments.length?function(e){if(e instanceof zb)return new zb(e.h,e.c,e.l,e.opacity);if(e instanceof Rb||(e=Eb(e)),0===e.a&&0===e.b)return new zb(NaN,0<e.l&&e.l<100?0:NaN,e.l,e.opacity);var t=Math.atan2(e.b,e.a)*Sb;return new zb(t<0?t+360:t,Math.sqrt(e.a*e.a+e.b*e.b),e.l,e.opacity)}(e):new zb(e,t,n,null==i?1:i)}function zb(e,t,n,i){this.h=+e,this.c=+t,this.l=+n,this.opacity=+i}function Fb(e){if(isNaN(e.h))return new Rb(e.l,0,0,e.opacity);var t=e.h*kb;return new Rb(e.l,Math.cos(t)*e.c,Math.sin(t)*e.c,e.opacity)}function jb(e){return function(e){return Tb(e).l<70}(e)?yv:gv}function Vb(e,t=!0){let n="";for(let t=0;t<e.length;t++){const i=e[t];n+=0===t?`M${i.x} ${i.y}`:`L${i.x} ${i.y}`,n+=" "}return t&&(n+="Z"),n}function Bb(e){const{angle:t,origin:n}=e,i=e.points.map((e=>function(e,t,n={x:0,y:0}){const i=Math.cos(t),r=Math.sin(t),o=(s=n,{x:(a=e).x-s.x,y:a.y-s.y});var a,s;return function(e,t){return{x:e.x+t.x,y:e.y+t.y}}({x:i*o.x-r*o.y,y:r*o.x+i*o.y},n)}(e,t,n)));return{type:"path",fill:e.fill,d:Vb(i)}}Bv(Rb,(function(e,t,n,i){return 1===arguments.length?Eb(e):new Rb(e,t,n,null==i?1:i)}),Hv($v,{brighter(e){return new Rb(this.l+18*(null==e?1:e),this.a,this.b,this.opacity)},darker(e){return new Rb(this.l-18*(null==e?1:e),this.a,this.b,this.opacity)},rgb(){var e=(this.l+16)/116,t=isNaN(this.a)?e:e+this.a/500,n=isNaN(this.b)?e:e-this.b/200;return new hb(Pb(3.1338561*(t=_b*Ob(t))-1.6168667*(e=1*Ob(e))-.4906146*(n=qb*Ob(n))),Pb(-.9787684*t+1.9161415*e+.033454*n),Pb(.0719453*t-.2289914*e+1.4052427*n),this.opacity)}})),Bv(zb,Tb,Hv($v,{brighter(e){return new zb(this.h,this.c,this.l+18*(null==e?1:e),this.opacity)},darker(e){return new zb(this.h,this.c,this.l-18*(null==e?1:e),this.opacity)},rgb(){return Fb(this).rgb()}}));const Hb={require:["chart"],defaultSettings:{settings:{},style:{}},render(){var e;return function({chart:e,settings:t}){if(!e||!t)return[];const{size:n,component:i,selector:r,pointingTo:o,isRtl:a,width:s,height:l}=t;if(!e.component(t.component))return[];const c=e.findShapes(r).filter((e=>e.key===i));if(null==c||!c.length)return[];let u=s/2,h=l/2,d=-Math.PI/2;const f=n/3;switch(o){case"top":h=f;break;case"bottom":h=l-f,d=3*Math.PI/2-Math.PI;break;case"right":u=s-f,d=0;break;case"left":u=f,d=Math.PI}const p=[];for(let e=0;e<c.length;e+=1){const t=c[e];let r=["top",...a?["left"]:["right"]].includes(o)?t.attrs.fill:sv;if(i===Nv.SEGMENT_BAR){const{stops:e}=t.attrs.fill;if(["top","right"].includes(o)){const t=e.find((e=>1===e.offset));r=(null==t?void 0:t.color)||gv}else{const t=e.toReversed().find((e=>0===e.offset));r=(null==t?void 0:t.color)||gv}}const s=jb(r),l={x:u,y:h},f=n/6,m=Bb({points:[{x:l.x+2*f,y:l.y},{x:l.x,y:l.y+f},{x:l.x,y:l.y-f}],angle:d,fill:s,origin:l});p.push(m)}return p}({chart:this.chart,settings:null===(e=this.settings)||void 0===e?void 0:e.settings})}};function $b({services:e}){var t;const{colorService:n,layoutService:i,themeService:r}=e,{useBaseColors:o}=i.getLayout().color||{},{baseColor:a}=(null===(t=i.getLayout().qHyperCube)||void 0===t?void 0:t.qMeasureInfo[0].coloring)||{};if("off"===o)return n.getColor();let s;if(a){var l,c,u;const e=(null===(l=r.getTheme().getDataColorPickerPalettes()[0])||void 0===l?void 0:l.colors)||[];s=null!==(c=a.color)&&void 0!==c?c:gv;const t=null!==(u=a.index)&&void 0!==u?u:-1;e.length>0&&t>-1&&t<e.length&&(s=e[t])}else{var h;s=null!==(h=r.getTheme().getDataColorSpecials().primary)&&void 0!==h?h:gv}return()=>s}function Wb(e,t,n,i){const r=Math.floor(Math.min(e,t)),o=Math.abs(i-n),a=.02*Math.tan(-o/4+Math.PI/2),s=2*(.4+a)-2*Xb(e,t)/r;return{innerRadius:s-2*(r>500?50:Math.max(r/Vv*50,10))/r,outerRadius:s,radiusIncrease:a,labelGaugeRadius:1.39*(.4+a)}}function Ub(e,t,n,i){const r=i-Math.PI/2;return{x:e+n*Math.cos(r),y:t+n*Math.sin(r)}}function Yb({innerRadius:e,outerRadius:t,width:n,height:i}){return(t-e)*Math.min(n,i)/2}function Gb(e){return!1!==e.show&&0!==e.show&&"0"!==e.show}function Xb(e,t){return Math.min(6,Math.min(e,t)/jv)}function Kb(e,t){return 4*Wb(e,t,ov,av).radiusIncrease*Math.min(e,t)}const Zb={require:["chart","symbol"],defaultSettings:{settings:{},style:{}},render(){var e;return function({chart:e,settings:t,symbol:n}){if(!e||!t||!n)return[];if(!e.component(t.component))return[];const{valueAngle:i,width:r,height:o}=t,{outerRadius:a,innerRadius:s}=Wb(r,o,ov,av),l=Yb({innerRadius:s,outerRadius:a,width:r,height:o});let c=r/2,u=o/2,h=a*Math.min(r,o)/2,d=Ub(c,u,h,t.valueAngle),f=d.x,p=d.y;const m=[],g=sv,y=t.fill||jb(g),x={x:f,y:p},v=l/6;let b=[{x:x.x+.3*v,y:x.y},{x:x.x-7.5*v,y:x.y+v},{x:x.x-7.5*v,y:x.y-v}];const w=i-Math.PI/2,M=Bb({points:b,angle:w,fill:y,origin:x});return M.data={pointerWidth:v,angle:w,radius:h,fill:y},m.push(M),m}({chart:this.chart,settings:null===(e=this.settings)||void 0===e?void 0:e.settings,symbol:this.symbol})}};const Jb={require:["chart","symbol"],defaultSettings:{settings:{},style:{}},render(){var e;return function({chart:e,settings:t,symbol:n}){if(!e||!t||!n)return[];const{size:i,component:r,selector:o,angle:a,radius:s,width:l,height:c}=t;if(!e.component(t.component))return[];const u=e.findShapes(o).filter((e=>e.key===r));if(null==u||!u.length)return[];let h=l/2,d=c/2,{x:f,y:p}=Ub(h,d,s,a);const m=[],g=t.fill,y=a===ov?-1:1,x={x:f,y:p},v=i/6,b=Bb({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:g,origin:x});return m.push(b),m}({chart:this.chart,settings:null===(e=this.settings)||void 0===e?void 0:e.settings,symbol:this.symbol})}};var Qb,ew;var tw=function(){if(ew)return Qb;ew=1;var e=Object.prototype.hasOwnProperty,t=Object.prototype.toString,n=Object.defineProperty,i=Object.getOwnPropertyDescriptor,r=function(e){return"function"==typeof Array.isArray?Array.isArray(e):"[object Array]"===t.call(e)},o=function(n){if(!n||"[object Object]"!==t.call(n))return!1;var i,r=e.call(n,"constructor"),o=n.constructor&&n.constructor.prototype&&e.call(n.constructor.prototype,"isPrototypeOf");if(n.constructor&&!r&&!o)return!1;for(i in n);return void 0===i||e.call(n,i)},a=function(e,t){n&&"__proto__"===t.name?n(e,t.name,{enumerable:!0,configurable:!0,value:t.newValue,writable:!0}):e[t.name]=t.newValue},s=function(t,n){if("__proto__"===n){if(!e.call(t,n))return;if(i)return i(t,n).value}return t[n]};return Qb=function e(){var t,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!=(t=arguments[d]))for(n in t)i=s(h,n),h!==(l=s(t,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:e(p,u,l)})):void 0!==l&&a(h,{name:n,newValue:l}));return h},Qb}(),nw=Yt(tw);let iw;function rw(){iw=iw||document.createElement("canvas").getContext("2d")}const ow={measureTextWidth(e){rw();const{width:t}=iw.measureText(e);return t},lineWrap(e,t,n,i){let r,o;rw();const a=e?e.split(/\n+|\r+|\r\n/):[],s=[];let l,c,u,h,d=e?e.split(/\s+/):[],f=a[0];if("number"!=typeof t||t<=0)return[e];if("number"==typeof i&&a.length>=i)return a.slice(0,i);for(n&&(iw.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=ow.measureTextWidth(l),c>t&&("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(e,t,n,i,r){if(rw(),!e||!e.length)return[];n&&(iw.font=n);let o=[];const a=e.slice();let s,l,c,u="";if(a.filter((e=>!!e)),"number"!=typeof t||t<0)return e.slice();for(c=0;c<a.length;c++){var h;if(l=a[c],u="",l.length<=1||ow.measureTextWidth(l)<=t)o.push(l);else if(s=ow.splitWord(l,t,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]?ow.measureTextWidth(`${u} ${a[c+1]}`)>t&&(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(((e,t,n)=>{n[t]=e.trim()})),void 0!==i&&o.length>i?(o=o.splice(0,i),o[o.length-1]=ow.truncate(o[o.length-1],t,n,r).text):(l=o[o.length-1],l&&l.length>1&&ow.measureTextWidth(l)>t&&(o[o.length-1]=ow.truncate(l,t,n,r).text)),o},truncate(e,t,n,i="…"){rw();let r,o,a,s,l=e;const c=ow.measureTextWidth("i");if(n&&(iw.font=n),e&&t){if(ow.measureTextWidth(l)>t){const e=Math.ceil(t/c);for(r=Math.min(e,l.length);r>0;r--)if(o=l.substring(0,r-1),a=o.trim()+i,ow.measureTextWidth(a)<=t){s=l.substring(r-1),l=a;break}r||(s=l,l="…")}}else s=void 0;return{text:l,rest:s}},isNumber:e=>"number"==typeof e&&Number.isFinite(e),explodeWord(e,t,n,i){let r;rw();let o,a=e,s="",l=[];if(void 0!==n&&ow.isNumber(n)&&n<=1)return[e];const c=Math.ceil(t/i);for(r=Math.min(e.length,c);r>0&&(a=e.substring(0,r),o=e.substring(r-1,r)," "===o?a=e.substring(0,r-1):a+="-",s=e.substring(r),!(ow.measureTextWidth(a)<=t));r--);return(!r&&!a||ow.measureTextWidth(a)>t)&&(a=e.substring(0,1),s=e.substring(1)),l.push(a),s?(ow.measureTextWidth(s)>t?l=l.concat(ow.explodeWord(s,t,void 0===n?void 0:n-1,i)):l.push(s),l.filter((e=>""!==e.trim()))):l},splitWord:(e,t,n,i)=>(rw(),e&&t?(n&&(iw.font=n),ow.explodeWord(e,t,i,Math.max(1,ow.measureTextWidth("i")))):[]),wrapText(e,t,n,i,r="…"){let o;return Number.isNaN(t)||!t?[e]:(o=void 0===i||i>1?ow.lineWrap(e,t,n,i):[e],o=ow.wordWrap(o,t,n,i,r),o)},getFontHeight:e=>(rw(),e&&(iw.font=e),1.5*ow.measureTextWidth("m")),tokenize(e,t,n,i,r,o,a=1){rw(),t&&(iw.font=t);const s=ow.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(e)?e.forEach(((e,n)=>{u.length<h&&(u=u.concat(ow.wrapText(e,r,t,c[n])))})):u=ow.wrapText(e,r,t,c[0],n),u}};function aw({chart:e,renderer:t,refLine:n,settings:i,width:r,height:o,barWidth:a}){if(!e||!t||!i)return{};const{position:s,scale:l,value:c,label:u,line:h,formatter:d,cId:f}=n,p=n.radius?n.radius*(Math.min(r,o)/2):r/2,m=(av-ov)*s+ov-Math.PI/2,g={x:r/2,y:o/2};let y=nw(!0,{},i.style.line,h||{});const x={type:"line",cId:f,...{x1:g.x+Math.cos(m)*p,y1:g.y+Math.sin(m)*p,x2:g.x+Math.cos(m)*(p+a),y2:g.y+Math.sin(m)*(p+a)},data:{angle:m,innerRadius:p},stroke:y.stroke,strokeWidth:y.strokeWidth,strokeDasharray:y.strokeDasharray};let v;if(u){const n=nw(!0,{fill:"#000",fontFamily:"Arial",fontSize:"12px",opacity:1,padding:5,background:{fill:"#fff",stroke:"transparent",strokeWidth:0,opacity:.5}},i.style.label||{},{fill:y.stroke},u),{fontFamily:s,fontSize:h,fill:x,opacity:b}=n,w=u.showLabel?n.text:"";let M,k="";if("string"==typeof d||"object"==typeof d)M=e.formatter(d);else if(void 0!==l&&"string"!=typeof l&&"function"==typeof l.data){const e=l.data()&&l.data().fields;M=e&&e[0]?e[0].formatter():null}!1!==u.showValue&&(M?k=` (${M("function"==typeof c?c():c)})`:l&&(k=` (${c})`));const S=e=>t.measureText({text:e,fontFamily:s,fontSize:h}),_=S("M").height,q=`normal ${h} ${s}`;let D,A=Av;const C=`${w}${k}`||"",N=Math.min(r,o),E=Math.min(8,N/200),R=Ub(g.x,g.y,p+a+E,m+Math.PI/2),I=S(C).width;D=Math.min(R.x,r-R.x-lv,Dv),A=function(e,t,n){const i=Math.min(Math.floor((e+lv)/t),Math.floor((n-e)/t));return Math.min(i,Av)}(R.y,_,o);let O=ow.tokenize(C,q,`... ${k}`,A,D,void 0);const P=function(e){let t="start";const n=e>-Math.PI&&e<0?"baseline":"hanging";return(e+=Math.PI/2)<0&&e>-Math.PI?t="end":e>0&&e<Math.PI&&(t="start"),{textAnchor:t,baseline:n}}(m);R.y-2*_>0&&R.y+2*_<o&&(R.x-I+lv<0&&"end"===P.textAnchor||R.x+I-lv>r)&&(O=ow.tokenize(C,q,`... ${k}`,A,D,void 0)),v={fill:x,opacity:b,fontFamily:s,fontSize:h,linePosition:R,lineHeight:_,align:"left",baseline:P.baseline,textAnchor:P.textAnchor,lines:O,cId:f}}return{lineNode:x,labelNode:v}}const sw={require:["chart","renderer"],defaultSettings:{style:{line:{stroke:"#000"}}},render(){var e,t;let{settings:n,chart:i,renderer:r,rect:o}=this;if(!(i&&o&&n&&r))return[];const{width:a,height:s}=o,l=null!==(e=null==n||null===(t=n.settings)||void 0===t?void 0:t.barWidth)&&void 0!==e?e:0;let c=(null==n?void 0:n.lines)&&n.lines.radial||[];if(0===c.length)return[];c=c.map((e=>{if("function"==typeof e.value&&(e.value=e.value()),e.scale){let t=null==i?void 0:i.scale("string"==typeof e.scale?e.scale:"");const n=t(e.value);return nw(e,{scale:t,position:n})}return nw(e,{position:e.value})}));const u=[];let h=[];[...c].forEach((e=>{if(e.position>=0&&e.position<=1){const{lineNode:t,labelNode:o}=aw({chart:i,renderer:r,refLine:e,settings:n,width:a,height:s,barWidth:l});t&&u.push(t),o&&h.push(o)}}));const d=[];h.forEach((e=>{const{fill:t,opacity:n,fontFamily:i,fontSize:r,lines:o,lineHeight:a,textAnchor:s,linePosition:l,baseline:c,cId:u}=e,h=l,f=o.length-1,p=o.map(((e,o)=>{let l=h.y;return f>0&&("baseline"===c?l-=(f-o)*a:l+=o*a),{type:"text",text:e,cId:u,baseline:c,anchor:s,fill:t,opacity:n,fontFamily:i,fontSize:r,x:h.x,y:l}}));d.push(...p)}));const{MEDIUM:f,SMALLER:p}=zv,m=a>=f.width&&s>=f.height;return[...a>=p.width&&s>=p.height?u:[],...m?d:[]]}};const lw={require:["chart","symbol"],defaultSettings:{settings:{},style:{}},render(){var e;return function({chart:e,settings:t,symbol:n}){if(!e||!t||!n)return[];const{valueAngle:i,width:r,height:o}=t,a=.4*Math.min(r,o),s=[],l=t.fill,c={x:r/2,y:o/2},u=Bb({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===(e=this.settings)||void 0===e?void 0:e.settings,symbol:this.symbol})}},cw={getGap(e,t){const n=e.position<t.position?e:t,i=e.position<t.position?t:e;return i.position-i.radius-(n.position+n.radius)},findSegmentPositionMeetMaxThenMin(e,t,n){const i=e.position+e.radius,r=e.position-Math.max(0,i-n),o=r-e.radius;return r+Math.max(0,t-o)},layoutPositionFromMin(e,t,n,i=0){const r=e.length-1;let o,a,s,l=t;for(let t=0;t<r;t++)o=e[t],a=e[t+1],s=(o.position+a.position)/2-i/2,o.position=cw.findSegmentPositionMeetMaxThenMin(o,l,s),l=o.position+o.radius+i;a&&(a.position=cw.findSegmentPositionMeetMaxThenMin(a,l,n))},adjustPositionFromMax(e,t,n,i=0){const r=e.length-1,o=Math.max(0,e[r].position+e[r].radius-n);if(0===o)return;let a,s,l,c,u=0;for(a=r;a>0&&(s=e[a],l=e[a-1],c=Math.max(0,cw.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-t),c-=Math.max(0,u+c-o),u+=c,l.move=c),u=0,a=0;a<=r;a++)s=e[a],u+=s.move||0,s.move=u,s.position-=u},createLayout(e,t,n,i=0){const r=e.map((e=>e.segment)),o=r.length-1;if(o<0)return[];if(0===o){const e=r[0];e.position=cw.findSegmentPositionMeetMaxThenMin(e,t,n)}else cw.layoutPositionFromMin(r,t,n,i),cw.adjustPositionFromMax(r,t,n,i);return e.filter((e=>{const i=Math.ceil(e.segment.position-e.segment.radius),r=e.segment.position+e.segment.radius;return i>=t&&r<=n}))}};const uw={require:["chart","renderer"],defaultSettings:{style:{line:{stroke:"#000"}}},render(){var e,t;let{settings:n,chart:i,renderer:r,rect:o}=this;if(!(i&&o&&n&&r))return[];const{width:a,height:s}=o,{barWidth:l,needlePosition:c}=n.settings,u=null!==(e=null===(t=n.settings)||void 0===t?void 0:t.isRtl)&&void 0!==e&&e,h=u?-1:1,d=(null==n?void 0:n.lines)&&n.lines.x||[],f=(null==n?void 0:n.lines)&&n.lines.y||[];let p=d.length>0?d:f;if(0===p.length)return[];const m=d.length>0;p=p.map((e=>{if("function"==typeof e.value&&(e.value=e.value()),e.scale){let t=null==i?void 0:i.scale("string"==typeof e.scale?e.scale:"");const n=t(e.value);return nw(e,{scale:t,position:n})}return nw(e,{position:e.value})}));const g=[];let y=[];[...p].forEach((e=>{if(Gb(e)&&e.position>=0&&e.position<=1){const{lineNode:t,labelNode:o}=function({chart:e,renderer:t,refLine:n,settings:i,width:r,height:o,isVerticalRefLine:a,barWidth:s}){if(!e||!t||!i)return{};const{position:l,scale:c,value:u,label:h,line:d,formatter:f,cId:p}=n;let m=nw(!0,{},i.style.line,d||{});const g={type:"line",cId:p,...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:m.stroke,strokeWidth:m.strokeWidth,strokeDasharray:m.strokeDasharray};let y;if(h){const n=nw(!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},h),{fontFamily:d,fontSize:g,fill:x,opacity:v}=n,b=h.showLabel?n.text:"";let w,M="";if("string"==typeof f||"object"==typeof f)w=e.formatter(f);else if(void 0!==c&&"string"!=typeof c&&"function"==typeof c.data){const e=c.data()&&c.data().fields;w=e&&e[0]?e[0].formatter():null}!1!==h.showValue&&(w?M=` (${w("function"==typeof u?u():u)})`:c&&(M=` (${u})`));const k=e=>t.measureText({text:e,fontFamily:d,fontSize:g}),S=k("M").height,_=`normal ${g} ${d}`,q=a?Sv:r/2-s/2-_v,D=a?2:1,A=`${b}${M}`||"",C=ow.tokenize(A,_,`... ${M}`,D,q,void 0),N=(a?r:o)*l,E=Math.min(q,Math.max(...C.map((e=>k(e).width)))),R=C.length*S;y={fill:x,opacity:v,fontFamily:d,fontSize:g,linePosition:N,lineHeight:S,lines:C,cId:p,segment:{position:N,radius:a?E/2:R/2}}}return{lineNode:g,labelNode:y}}({chart:i,renderer:r,refLine:e,settings:n,width:a,height:s,isVerticalRefLine:m,barWidth:l});t&&g.push(t),o&&y.push(o)}}));const{MEDIUM:x,SMALLER:v}=zv,b=a>=x.width&&s>=x.height;if(!(a>=v.width&&s>=v.height))return[];const w=[...g];if(!b||0===y.length)return w;let M=[];if(y.sort(((e,t)=>e.segment.position-t.segment.position)),m)M=cw.createLayout(y,0,a,qv);else{const{attrs:e}=i.findShapes("text").filter((e=>e.key===Nv.GAUGE_LABEL))[0],{"font-size":t}=e,n=parseFloat(t);let r=y.filter((e=>e.segment.position<s-c)),o=y.filter((e=>e.segment.position>=s-c)),a=cw.createLayout(r,0,e.y-n/2),l=cw.createLayout(o,e.y+n/2,s);M=0===a.length&&r.length>0?cw.createLayout(y,e.y+n/2,s):0===l.length&&o.length>0?cw.createLayout(y,0,e.y-n/2):[...a,...l]}return M.forEach((e=>{const{fill:t,opacity:n,fontFamily:i,fontSize:r,lines:o,segment:c,linePosition:d,lineHeight:f,cId:p}=e,{position:g}=c;if(d!==g&&""!==e.lines[0]){let e={x1:a/2+h*(l/2),x2:a/2+h*(l/2+.75*_v),y1:d,y2:g};m&&(e={y1:s/2+l/2,y2:s/2+l/2+_v,x1:d,x2:g});const n={type:"line",...e,stroke:t,strokeWidth:1,isConnector:!0,cId:p};w.push(n)}const y=o.map(((e,o)=>{let c=m?s/2+l/2+f/2+_v:g;return c+=o*f,{type:"text",text:e,cId:p,baseline:"central",anchor:m?"middle":u?"end":"start",fill:t,opacity:n,fontFamily:i,fontSize:r,x:m?g:a/2+h*(l/2+_v),y:c}}));w.push(...y)})),w}};var hw={dataRelatedPropertiesPaths:["filters[].options","qHyperCube.qGrandTotalRow","qHyperCube.qHasOtherValues","qHyperCube.qSize","qHyperCube.qDimensionInfo[].qAttrDimInfo","qHyperCube.qDimensionInfo[].qCardinalities","qHyperCube.qDimensionInfo[].qMax","qHyperCube.qDimensionInfo[].qMin","qHyperCube.qDimensionInfo[].qStateCounts","qHyperCube.qMeasureInfo[].qApprMaxGlyphCount","qHyperCube.qMeasureInfo[].qFallbackTitle","qHyperCube.qMeasureInfo[].qMax","qHyperCube.qMeasureInfo[].qMin","qHyperCube.qMeasureInfo[].qNumFormat","qHyperCube.qMeasureInfo[].qTrendLines","qHyperCube.qTreeNodesOnDim","measureAxis.min","measureAxis.max","refLine.refLines[].refLineExpr"]};function dw(e){const{qHyperCube:t,...n}=e,{qDataPages:i,qStackedDataPages:r,qTreeDataPages:o,...a}=t||{},s=nw(!0,{},{...n,qHyperCube:{...a,qDataPages:null,qStackedDataPages:null,qTreeDataPages:null}}),{dataRelatedPropertiesPaths:l}=hw;return l.forEach((e=>{const t=e.split("[");if(1===t.length)void 0!==Mt(s,e)&&St(s,e,null);else{const e=t[0],n=t[1].split("].")[1];Mt(s,e,[]).forEach((e=>{void 0!==Mt(e,n)&&St(e,n,null)}))}})),s}const fw=({core:t,services:n,settings:r})=>{const o=e();i((()=>{if(!r||!t||!n)return;const{chart:e,cache:i}=t;if(!e)return;const{colorService:a,layoutService:s,dockService:l}=n;if("radial"===s.meta.gaugetype){const{width:e,height:t}=l.meta.chart.size;o.style.transform=`translateY(${Kb(e,t)}px)`}else o.style.transform="";e.update({data:[{type:"q",key:"qHyperCube",data:s.getHyperCube()},...a.getData()],settings:r}),i&&function({cache:e,layout:t}){const n=dw(t);e.set("dataIndependentProperties",JSON.stringify(n))}({cache:i,layout:s.getLayout()})}),[t,r])};function pw({layout:e,options:t}){return e.snapshotData&&!t.freeResize?{width:e.snapshotData.content.size.w,height:e.snapshotData.content.size.h,preserveAspectRatio:!0,align:.5}:void 0}function mw({options:e,cache:t,layoutService:n}){const i={isSizeChanging:!1};return{enabled:()=>!1!==e.chartAnimations&&!i.isSizeChanging&&!function({cache:e,layout:t}){const n=dw(t);return e.get("dataIndependentProperties")!==JSON.stringify(n)}({cache:t,layout:n.getLayout()}),meta:i}}function gw({layout:e,rect:t}){var n;const{measureAxis:i,qHyperCube:r,autoOrientation:o,gaugetype:a,useSegments:s,refLine:l}=e,c=null===(n=e.qHyperCube)||void 0===n?void 0:n.qMeasureInfo[0].qFallbackTitle,{width:u,height:h}=t;let d=e.orientation;o&&(d=u>=h?"horizontal":"vertical");const f="vertical"===d,p=function({measureAxis:e,qHyperCube:t}){if(!e||!t)return{min:0,max:1};let{min:n,max:i}=e;if(n=Number(n),i=Number(i),n!==i)return{min:Math.min(n,i),max:Math.max(n,i)};const r=t.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:i,qHyperCube:r}),m=(null==l?void 0:l.refLines)||[],g=null==i?void 0:i.spacing,y=null==i?void 0:i.show,x=function({layout:e,rangeLimits:t}){var n,i;const{gradient:r}=(null===(n=e.qHyperCube)||void 0===n?void 0:n.qMeasureInfo[0].coloring)||{};if("measure"!==(null===(i=e.color)||void 0===i?void 0:i.useBaseColors)||!r)return e.segmentInfo;const{min:o,max:a}=t,{limits:s,limitType:l,breakTypes:c,colors:u}=r,h=s.map(((e,t)=>({value:"percent"===l?o+e*(a-o):e,gradient:c[t]})));return{limits:h,paletteColors:u}}({layout:e,rangeLimits:p});return{measureAxisTitle:c,measureAxisSpacing:g,measureAxisShow:y,rangeLimits:p,qHyperCube:r,orientation:d,autoOrientation:o,gaugetype:a,isVertical:f,useSegments:s,segmentInfo:x,refLines:m}}function yw({dockService:e,layoutService:t}){const{width:n,height:i}=e.meta.chart.size,{orientation:r,autoOrientation:o}=t.meta;return o?n<i:"vertical"===r}function xw(e,t,n){if(e>=n)return 1;if(e<=t)return 0;const i=Math.min(1,Math.max(0,(e-t)/(n-t)));return Number.isNaN(i)?0:i}function vw(e,t,n){const i="none"===e||"labels"===e,r=t<zv.SMALL.width||n<zv.SMALL.height;return!(i||r)}function bw(e){return"none"!==e&&"title"!==e}const ww=({core:e})=>{const d=r(),f=o(),p=a(),m=s(),g=l(),x=c(),{qLocaleInfo:v}=u(),[b,w]=n(null),M=t(),k=h();return i((()=>{if(!d||!e)return;const{picassoInstance:t,chart:n,cache:i}=e;if(!n)return;d.color||(d.color={useBaseColors:"off"});const r=function(e){var t=e.source,n=e.metaAdditionsFn,i=e.experimental,r=void 0===i?{filter:!1}:i,o=P(!0,{},t),a=r.filter?function(e){var t=e.qHyperCube,n=At(t,Dt.DIMENSION),i=n.reduced,r=n.filtered;t[Dt.DIMENSION]=i;var o=At(t,Dt.MEASURE),a=o.reduced,s=o.filtered;return t[Dt.MEASURE]=a,{dimensions:r,measures:s}}(o):{dimensions:[],measures:[]},s=Nt(o),l=function(){var e=function(e){var t=e.layout,n=e.additionsFn,i=void 0===n?function(){return{}}:n,r=e.additionsProps,o=void 0===r?{}:r,a=t.qHyperCube,s=a.qDimensionInfo,l=a.qMeasureInfo,c=a.qMode,u=s.length,h=l.length,d=y({mode:{S:"S"===c,P:"P"===c,K:"K"===c,T:"T"===c},dimensionCount:u,measureCount:h,hasMultipleDimensions:u>1,hasMultipleMeasures:h>1,isOneDimensional:1===u,isTwoDimensional:2===u},o);return y(y({},d),i({layout:t,meta:d}))}({layout:o,additionsFn:n,additionsProps:{size:s.size}});return e.filteredFields=a,e},c={refs:y({},s.refs),meta:l(),getLayout:function(){return o},getLayoutValue:function(e,t){return Mt(o,e,t)},setLayoutValue:function(e,t){St(o,e,t),s=Nt(o),c.meta=l()},getHyperCube:function(){return o.qHyperCube},getHyperCubeValue:function(e,t){return Mt(o.qHyperCube,e,t)},setHyperCubeValue:function(e,t){St(o.qHyperCube,e,t),s=Nt(o),c.meta=l()},getDataPages:function(){return Mt(o,s.refs.dataPages)},setDataPages:function(e){St(o,s.refs.dataPages,e),c.meta=l()}};return c}({source:d,metaAdditionsFn:()=>gw({layout:d,rect:g})}),{direction:o="ltr"}=M,a=pw({layout:r.getLayout(),options:M}),s=wt({chart:n,layoutService:r,config:{rtl:"rtl"===o,logicalSize:a},typeConfig:{type:"major-minor",fallback:"vertical",invert:!0}}),l=ct({app:p,model:m,translator:x,picasso:t,layoutService:r,config:{key:Ev,localeInfo:v,theme:f,auto:()=>({mode:"primary",byMeasureDef:{activeMeasureIndex:0,type:"expression",label:""}})},createConfig:()=>({colorProps:{auto:!0,paletteColor:d.paletteProgressColor||{index:d.progressColor}}})}),c=function(e){var t=e.theme,n=e.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:t,matrix:$t(a),styles:void 0};return h.styles=Ut({theme:t,id:r,transform:l,extend:u,matrix:h.matrix}),{getStyles:function(){return h.styles},getTheme:function(){return h.theme},setTheme:function(e){h.theme=e,h.styles=Ut({theme:e,id:r,transform:l,extend:u,matrix:h.matrix})}}}({theme:f,config:{id:"gauge"}}),u=function({chart:e,layoutService:t,dockService:n}){function i(){const{width:e,height:i}=n.meta.chart.size,r=yw({dockService:n,layoutService:t});return Math.min(rv,r?e/10:i/10)}function r(){const{width:e,height:i}=n.meta.chart.size;return yw({dockService:n,layoutService:t})?i:e}function o(e){const{min:n,max:i}=t.meta.rangeLimits,o=e?i-(t.meta.qHyperCube.qDataPages[0].qMatrix[0][0].qNum-n):t.meta.qHyperCube.qDataPages[0].qMatrix[0][0].qNum;return r()*xw(o,n,i)}const a={getBottomPadding(a){if(yw({dockService:n,layoutService:t})){const e=o(!1)+-a.height*dv.VERTICAL_ALIGNMENT_FACTOR,t=0,n=r()-a.height;return e<t?t:e>n?n:e}const s=i(),{VERTICAL_ALIGNMENT_FACTOR:l}=fv;let c=.5*s+a.height/2+s*l;const u=e.findShapes("text").filter((e=>e.key===Nv.REFERENCE_LINES_AND_LABELS)).map((e=>{const{x:t,y:i,"font-size":r}=e.attrs,o=parseFloat(r);return{x:t,y:i-n.meta.chart.size.height/2,height:o,width:Sv}}));return c=function({refLabels:e,valueLabel:t}){return e.forEach((e=>{(function(e,t){const n=t.x-t.width/2>=e.x+e.width/2||t.x+t.width/2<=e.x-e.width/2,i=t.y-t.height/2>=e.y+e.height/2;return!(n||i)})(e,t)&&(t.y=e.y+e.height/2+t.height/2)})),t.y}({refLabels:u,valueLabel:{x:o(n.config.rtl),y:c,...a}}),-c},getTopPadding:e=>-a.getBottomPadding(e),getLeftPadding(e){const{width:a}=n.meta.chart.size,s=n.config.rtl,l=i(),c=yw({dockService:n,layoutService:t}),u=Math.min(e.width,a*xv);if(c)return s?a/5-l-u:a/5+l;const h=o(s)-e.width/2,d=hv.RIGHT,f=r()-e.width-hv.LEFT;return h<d?d:h>f?f:h},getRightPadding:e=>-a.getLeftPadding(e)},s={getLeftPadding(r){if(!yw({dockService:n,layoutService:t}))return 0;const o=e.findShapes("container").filter((e=>e.key===Nv.BAR_AXIS));if(1!==o.length)return 0;const a=o[0],s=bw(t.meta.measureAxisShow)?Math.max(...a.children.filter((e=>"text"===e.type)).map((e=>e.bounds.width))):0,l=Math.max(...a.children.filter((e=>"line"===e.type)).map((e=>e.bounds.width))),c=i();let u=c/2+s+l+c*kv;const{width:h}=n.meta.chart.size;return u>h/2-r.height/4&&(u=h/2-r.height/4),n.config.rtl?u:-u},getRightPadding:e=>-s.getLeftPadding(e),getTopPadding(){if(yw({dockService:n,layoutService:t}))return-4;const r=e.findShapes("container").filter((e=>e.key===Nv.BAR_AXIS));if(1!==r.length)return 0;const o=r[0],a=bw(t.meta.measureAxisShow)?Math.max(...o.children.filter((e=>"text"===e.type)).map((e=>e.bounds.height))):0,s=Math.max(...o.children.filter((e=>"line"===e.type)).map((e=>e.bounds.height))),l=i();return-(l/2+a+s+Mv+l*wv)},getBottomPadding:()=>-s.getTopPadding()};return{getBarWidthInPixels:i,getValueLabelFontSize:function(e,t){const{width:i,height:r}=n.meta.chart.size,o=xw(Math.min(r,i),uv.MIN,uv.MAX);return e+Math.round(o*(t-e))},getNeedlePosition:o,barValueLabel:a,barAxisTitle:s}}({chart:n,layoutService:r,dockService:s}),h=function({layoutService:e,themeService:t,colorService:n}){const i=t.getStyles(),r=t=>{var n;const i=null===(n=e.getLayoutValue("components",[]))||void 0===n?void 0:n.find((e=>e.key===t));return i},o=e=>e?n.getPaletteColor(e):void 0;return{query:{axis:{title:{getStyle:()=>{var e,t,n,a;return{fontFamily:null!==(e=null===(t=r("axis"))||void 0===t||null===(t=t.axis)||void 0===t||null===(t=t.title)||void 0===t?void 0:t.fontFamily)&&void 0!==e?e: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 e,t,n,a;return{fontFamily:null!==(e=null===(t=r("axis"))||void 0===t||null===(t=t.axis)||void 0===t||null===(t=t.label)||void 0===t||null===(t=t.name)||void 0===t?void 0:t.fontFamily)&&void 0!==e?e: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 e,t,n,a;return{fontFamily:null!==(e=null===(t=r("value"))||void 0===t||null===(t=t.label)||void 0===t||null===(t=t.value)||void 0===t?void 0:t.fontFamily)&&void 0!==e?e: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:r,themeService:c,colorService:l}),b=mw({options:M,cache:i,layoutService:r}),S=function({layout:e,model:t,translator:n,interactionState:i}){return{isClosed:()=>e.disclaimerClosed,close:()=>{t.getProperties().then((e=>{e.disclaimerClosed=!0,t.setProperties(e)}))},translator:n,isEditMode:i.edit}}({layout:d,model:m,translator:x,interactionState:k});w({layoutService:r,colorService:l,dockService:s,labelService:u,themeService:c,styleService:h,animationsService:b,disclaimerService:S})}),[m,p,d,f.name(),x.language(),e,M.direction,k.edit]),b};function Mw({width:e,height:t,fontSize:n}){const{FULL:i}=zv;if(e>=i.width&&t>=i.height){let e=Number.parseFloat(n);return e=Math.floor(e*mv),`${e}px`}return n}var kw=e=>()=>e;function Sw(e){return 1==(e=+e)?_w:function(t,n){return n-t?function(e,t,n){return e=Math.pow(e,n),t=Math.pow(t,n)-e,n=1/n,function(i){return Math.pow(e+i*t,n)}}(t,n,e):kw(isNaN(t)?n:t)}}function _w(e,t){var n=t-e;return n?function(e,t){return function(n){return e+n*t}}(e,n):kw(isNaN(e)?t:e)}var qw=function e(t){var n=Sw(t);function i(e,t){var i=n((e=ub(e)).r,(t=ub(t)).r),r=n(e.g,t.g),o=n(e.b,t.b),a=_w(e.opacity,t.opacity);return function(t){return e.r=i(t),e.g=r(t),e.b=o(t),e.opacity=a(t),e+""}}return i.gamma=e,i}(1);function Dw({thisColor:e,paletteColors:t,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:t.length-1);const u=o.getTheme().getColorPickerColor(c<t.length&&c>=0?t[c]:t[0]);return{color:l?qw(e,u)(.5):e,offset:a,gradient:l}}function Aw({limits:e,paletteColors:t,paletteIndex:n,themeService:i}){const r=Mt(e,""+(n-1),{}),o=Mt(e,`${n}`,{}),a=[r,o].map((e=>e.gradient)).includes(!0),s=i.getTheme().getColorPickerColor(t[n]);if(!a)return[{offset:0,color:s},{offset:1,color:s}];const l=[Dw({thisColor:s,paletteColors:t,paletteIndex:n,limit:r,isLeft:!0,themeService:i}),Dw({thisColor:s,paletteColors:t,paletteIndex:n,limit:o,isLeft:!1,themeService:i})],c=2===l.filter((e=>e.gradient)).length;c&&l.splice(1,0,{offset:.5,color:s,gradient:!0});const u=l.map((({offset:e,color:t,gradient:n})=>({offset:e,color:t,gradient:n})));return u}function Cw({themeService:e,segmentInfo:t,rangeLimits:n}){const{limits:i,colors:r}=t;let{paletteColors:o}=t;o&&0!==o.length||!r||(o=r.map((e=>({index:e.color}))));const{min:a,max:s}=n;i.sort(((e,t)=>e.value-t.value));const l=[a,...i.map((e=>e.value)),s],c=[];for(let t=0;t<o.length;t++){const n=Aw({limits:i,paletteColors:o,paletteIndex:t,themeService:e}).map((e=>({offset:xw(l[t]+e.offset*(l[t+1]-l[t]),a,s),color:e.color,gradient:"gradient"in e?e.gradient:void 0})));c.push(...n)}return c}function Nw(e){return e.map((e=>({...e,offset:1-e.offset}))).reverse()}function Ew({themeService:e,isVertical:t,segmentInfo:n,rangeLimits:i,isRtl:r}){return{type:"gradient",x1:0,x2:t?0:1,y1:t?1:0,y2:0,stops:r&&!t?Nw(Cw({themeService:e,segmentInfo:n,rangeLimits:i})):Cw({themeService:e,segmentInfo:n,rangeLimits:i})}}function Rw(e){const t=function(e){if(e=e.replace("#",""),6!==e.length)throw new Error("Invalid hex color");const t=parseInt(e.substring(0,2),16),n=parseInt(e.substring(2,4),16),i=parseInt(e.substring(4,6),16);return{r:t,g:n,b:i}}(e),n=.21*t.r+.72*t.g+.07*t.b>127.5?-50:50;return`rgb(${t.r+n}, ${t.g+n}, ${t.b+n})`}function Iw({services:e}){const{dockService:t,disclaimerService:n}=e,{translator:i,isClosed:r,isEditMode:o}=n;if(r()||!o)return!1;const a=t.config.rtl;return{key:"disclaimer-component",type:"disclaimer-component",layout:{displayOrder:5,minimumLayoutMode:Tv},settings:{isRtl:a,close:e.disclaimerService.close,title:i.get("Object.Gauge.RangeIsDefaultTitle"),text:i.get("Object.Gauge.RangeIsDefault")}}}function Ow({services:e}){const{dockService:t,layoutService:n,themeService:i,animationsService:r}=e,{qHyperCube:o,useSegments:a,segmentInfo:s,rangeLimits:l}=n.meta,c=yw({dockService:t,layoutService:n}),u=c?"vertical":"horizontal";if(!a)return!1;const{min:h,max:d}=l,f=o.qDataPages[0].qMatrix[0][0].qNum,p=Math.max(h,Math.min(d,f)),m={type:"box",key:Nv.MARK,data:{extract:{field:"qMeasureInfo/0",props:{start:p,end:p,measureIndex:0}}},settings:{minor:{scale:"m"},orientation:u,box:{width:.1,maxWidthPx:rv,minHeightPx:pv,fill:()=>function({themeService:e,isVertical:t,segmentInfo:n,rangeLimits:i,value:r}){const o=Ew({themeService:e,isVertical:t,segmentInfo:n,rangeLimits:i,isRtl:!1});let{min:a,max:s}=i;const l=xw(r,a,s),{stops:c}=o;let u="black";for(let e=0;e<c.length;e++){const t=c[e].offset,n=c[e+1].offset;if(l>=t&&l<=n){const i=xw(l,t,n);u=jb(qw(c[e].color,c[e+1].color)(i));break}}return u}({value:f,themeService:i,isVertical:c,segmentInfo:s,rangeLimits:l}),stroke:"transparent"}},animations:{enabled:r.enabled,trackBy:e=>`${e.data.measureIndex.value}`}};return m}function Pw({services:e}){const{dockService:t,themeService:n,styleService:i,layoutService:r,animationsService:o}=e;if(!bw(r.meta.measureAxisShow))return[];const{width:a,height:s}=t.meta.chart.size,l=Wb(a,s,ov,av),{innerRadius:c,outerRadius:u,radiusIncrease:h}=l,d=4*h,f=Math.min(a,s)/2,p=n.getStyles(),m=i.query.axis.label.getStyle(),{tickLength:g,labelPadding:y}=function({width:e,height:t,defaultTickSize:n,defaultLabelPadding:i}){const r=Math.min(Math.min(e,t)/Fv,1);return{tickLength:n*r,labelPadding:i*r}}({width:a,height:s,defaultTickSize:8,defaultLabelPadding:20}),x=Xb(a,s),v={key:Nv.RADIAL_AXIS,type:"axis",rendererSettings:{disableScreenReader:!0},dock:"center",layout:{minimumLayoutMode:Lv},scale:"m",settings:{arc:{radius:u,startAngle:ov,endAngle:av,offset:-10*d*(u-c)*f},align:"top",line:{show:!1,stroke:"#cdcdcd"},ticks:{tickSize:g,stroke:p.axis.line.major.color,margin:x},labels:{margin:-6-2*g+y,fontFamily:m.fontFamily,fill:m.fill,fontSize:m.fontSize}},animations:{enabled:o.enabled,trackBy:e=>{const{type:t,text:n,x:i,y:r,x1:o,y1:a,value:s}=e;return"text"===t?`text-${n}-${i}-${r}`:`tick-${s}-${o}-${a}`}}};return[v]}function Lw(e,t,n,i){const r=i?Nw(Cw({themeService:t,segmentInfo:n,rangeLimits:e})):Cw({themeService:t,segmentInfo:n,rangeLimits:e}),o=(av-ov)/(2*Math.PI),a=r.map((e=>{""!==e.color&&void 0!==e.color||(e.color="#000000");return{offset:e.offset*o,color:e.color}}));return{type:"gradient",orientation:"conic",startAngle:ov-Math.PI/2,x:0,y:0,stops:a}}function Tw({services:e}){const{dockService:t,themeService:n,layoutService:i,animationsService:r}=e,{rangeLimits:o,useSegments:a,segmentInfo:s,qHyperCube:l}=i.meta,{width:c,height:u}=t.meta.chart.size,h=t.config.rtl,{outerRadius:d,innerRadius:f,labelGaugeRadius:p}=Wb(c,u,ov,av),m=o.max,g=l.qDataPages[0].qMatrix[0][0].qNum,y=m-g,x=[{value:Math.max(Rv,g-o.min),valueLabel:"Measure"},{value:Math.max(Rv,y),valueLabel:"Remaining"}];let v=function({themeService:e,segmentInfo:t,rangeLimits:n}){const i=Cw({themeService:e,segmentInfo:t,rangeLimits:n});let r=0,o=0,a=i.map((e=>(""!==e.color&&void 0!==e.color||(e.color="#000000"),o=0===n.max?e.offset*(n.max-n.min)-r:e.offset*n.max-r,r+=o,{value:o,color:e.color,gradient:e.gradient}))).filter((e=>0!==e.value||!0===e.gradient));return a.forEach((e=>{e.value=Math.abs(e.value)})),a}({themeService:n,segmentInfo:s,rangeLimits:o});h&&(x.reverse(),v.reverse());const b={type:"pie",key:Nv.RADIAL_GAUGE,data:{items:x},settings:{startAngle:ov,endAngle:av,slice:{arc:{ref:"value"},outerRadius:()=>d,innerRadius:()=>f,fill:(t,n)=>{const i=$b({services:e});return h?1===n?i(t):sv:0===n?i(t):sv},strokeWidth:e=>e.datum.value.value===Rv?0:1,stroke:(t,n)=>{const i=Rw($b({services:e})(t));return h?1===n?i:"#0000":0===n?i:"#0000"}}},animations:{enabled:r.enabled,trackBy:e=>e.data.value.valueLabel}},w={type:"pie",key:Nv.SEGMENT_RADIAL_GAUGE,renderer:"canvas",displayOrder:1,data:{items:v},settings:{startAngle:ov,endAngle:av,slice:{arc:{ref:"value"},outerRadius:()=>d,innerRadius:()=>f,strokeWidth:0,fill:(e,t)=>{var i,r;return(h?e.datum.value.gradient||(null===(i=v[t+1])||void 0===i?void 0:i.gradient):e.datum.value.gradient||(null===(r=v[t-1])||void 0===r?void 0:r.gradient))?Lw(o,n,s,h):e.datum.value.color}}},animations:{enabled:r.enabled,trackBy:e=>e.data.value.color}},M={type:"pie",key:Nv.CIRCLE_GAUGE,renderer:"canvas",displayOrder:0,data:{items:[{value:Math.max(g,Rv),valueLabel:"Measure"}]},settings:{startAngle:0,endAngle:2*Math.PI,slice:{arc:{ref:"value"},outerRadius:()=>d,innerRadius:()=>f,fill:()=>function(e,t,n,i){let r=Lw(e,t,n,i);const o={offset:(av-ov)/(2*Math.PI),color:"rgba(0, 0, 0, 0)"};return r.stops.push(o),r.stops.push({offset:1,color:"rgba(0, 0, 0, 0)"}),r}(o,n,s,h),strokeWidth:0,opacity:a?1:0}},animations:{enabled:r.enabled,trackBy:e=>e.data.value.valueLabel,isMainComponent:!0}},k={type:"pie",key:Nv.LABEL_RADIAL_GAUGE,renderer:"canvas",displayOrder:0,data:{items:[{value:Math.max(g,Rv),valueLabel:"Measure"}]},settings:{startAngle:0,endAngle:2*Math.PI,slice:{arc:{ref:"value"},outerRadius:()=>p+.01,innerRadius:()=>p,opacity:0}},animations:{enabled:r.enabled,trackBy:e=>e.data.value.valueLabel,isMainComponent:!0}};return a?[M,k,w]:[k,b]}function zw({chart:e,services:t}){const{layoutService:n,styleService:i,labelService:r,animationsService:o,dockService:a}=t,{width:s,height:l}=a.meta.chart.size,{getValueLabelFontSize:c}=r,u=i.query.axis.title.getStyle(),h=c(cv.MIN,cv.MAX),d=Number.parseFloat(Mw({width:s,height:l,fontSize:u.fontSize})),f=function({width:e,height:t,totalFontHeight:n}){const i=Wb(e,t,ov,av).labelGaugeRadius*Math.min(e,t)*.9-n;return(Kb(e,t)-2*Xb(e,t))/i}({width:s,height:l,totalFontHeight:h+d}),p=.5-f,m=vw(n.meta.measureAxisShow,s,l),{qHyperCube:g}=n.meta,y=g.qMeasureInfo[0].qFallbackTitle,x=g.qDataPages[0].qMatrix[0][0].qNum,v=i.query.label.getStyle(),b={type:"labels",key:Nv.RADIAL_GAUGE_LABEL,layout:{displayOrder:4},settings:{sources:[{component:Nv.LABEL_RADIAL_GAUGE,selector:"path",strategy:{type:"rows",settings:{fill:"#000",padding:0,justify:p,labels:[{fontSize:h,fontFamily:v.fontFamily,fill:v.fill,label({data:t}){const n=e.formatter(Cv.MEASURE);return t&&n?n(x):""},linkData:({data:e})=>e?{value:e.value.value,formatter:Cv.MEASURE}:null},{fontSize:d,fontFamily:u.fontFamily,fill:u.color,label:()=>m?y:""}]}}}]},animations:{enabled:o.enabled,trackBy:e=>"text"+(e.data?"value-label":"axis-title"),adjustTweenedNodes(t){t.forEach((t=>{const{type:n,data:i}=t;if("text"===n&&i&&i.value&&i.formatter&&(t.text=e.formatter(i.formatter)(i.value),t.ellipsed)){const{text:e,fontSize:n,fontFamily:i,maxWidth:r}=t,o=`normal ${n} ${i}`,a="…",s=1;t.ellipsed=ow.tokenize(e,o,a,s,r)[0]}}))}}};return[b]}function Fw({services:e}){const{dockService:t,layoutService:n,animationsService:i}=e,{width:r,height:o}=t.meta.chart.size,a=t.config.rtl,{rangeLimits:s,qHyperCube:l}=n.meta,{min:c,max:u}=s;let h,d=l.qDataPages[0].qMatrix[0][0].qNum;(d>u||d<c)&&(h="#00000000"),a&&(d=u-(d-c));const f=ov+xw(d,c,u)*(av-ov);return{type:"radial-gauge-needle",key:Nv.RADIAL_GAUGE_NEEDLE,layout:{displayOrder:2},settings:{component:Nv.SEGMENT_RADIAL_GAUGE,fill:h,valueAngle:f,width:r,height:o},animations:{enabled:i.enabled,trackBy:e=>e.type,adjustTweenedNodes(e){e.forEach((e=>{const{data:t}=e;if(t){const{pointerWidth:n,angle:i,radius:a,fill:s}=t,l=Ub(r/2,o/2,a,i+Math.PI/2),{x:c,y:u}=l,h=[{x:c+.3*n,y:u},{x:c-7.5*n,y:u+n},{x:c-7.5*n,y:u-n}],{d:d}=Bb({points:h,angle:i,fill:s,origin:l});e.d=d}}))}}}}function jw({services:e}){const{dockService:t,layoutService:n,animationsService:i}=e,{width:r,height:o}=t.meta.chart.size,a=t.config.rtl,{rangeLimits:s,useSegments:l,qHyperCube:c}=n.meta,{min:u,max:h}=s,d=c.qDataPages[0].qMatrix[0][0].qNum,{outerRadius:f,innerRadius:p}=Wb(r,o,ov,av),m=(p+(f-p)/2)*Math.min(r,o)/2,{RADIAL_OOB_INDICATOR_MIN:g,RADIAL_OOB_INDICATOR_MAX:y,SEGMENT_RADIAL_GAUGE:x,RADIAL_GAUGE:v}=Nv;return[g,y].map(((t,n)=>{const s=l?x:v,c=function(e,t){const n=$b({services:e})({datum:{value:()=>0}});return t?"#595959":n}(e,l);let g=0;(0===n&&d<u||1===n&&d>h)&&(g=Yb({innerRadius:p,outerRadius:f,width:r,height:o}));let y=ov;return(0===n&&a||1===n&&!a)&&(y=av),{type:"radial-oob-indicator",key:t,layout:{displayOrder:2},settings:{component:s,selector:"path",angle:y,radius:m,size:g,fill:c,width:r,height:o},animations:{enabled:i.enabled,trackBy:e=>e.type}}}))}function Vw({core:e,services:t}){const{chart:n}=e;if(!n)return[];const{dockService:i,layoutService:r}=t,{width:o,height:a}=i.meta.chart.size,{useSegments:s}=r.meta,l=yw({dockService:i,layoutService:r});let c=[Iw({services:t})];if("bar"===t.layoutService.meta.gaugetype){c.push(...function({services:e}){const{dockService:t,layoutService:n,styleService:i,themeService:r,animationsService:o}=e;if("none"===n.meta.measureAxisShow)return[];const{width:a,height:s}=t.meta.chart.size,l=t.config.rtl,c=yw({dockService:t,layoutService:n}),u=r.getStyles(),h=i.query.axis.label.getStyle(),{fontFamily:d,fill:f,fontSize:p}=h,m=bw(n.meta.measureAxisShow);return[{type:"axis",rendererSettings:{disableScreenReader:!0},key:Nv.BAR_AXIS,dock:"center",scale:"m",layout:{minimumLayoutMode:Iv},settings:{align:c?l?"right":"left":"top",line:{show:!c,stroke:u.axis.line.major.color},labels:{show:m,minLengthPx:20,fontFamily:d,fill:f,fontSize:Mw({width:a,height:s,fontSize:p})},paddingStart:()=>{if(c){const e=Math.min(a/10,rv);return a/2+e/2}const e=Math.min(s/10,rv);return s/2+e/2+bv},ticks:{stroke:u.axis.line.major.color}},animations:{enabled:o.enabled,trackBy:e=>void 0===e.tickValue?"axis":"text"===e.type?`label: ${e.tickValue}`:`mark: ${e.tickValue}`}}]}({services:t}),...function({services:e}){const{themeService:t,dockService:n,layoutService:i,animationsService:r}=e,{rangeLimits:o,segmentInfo:a,useSegments:s}=i.meta,l=n.config.rtl,c=yw({dockService:n,layoutService:i}),u=c?"vertical":"horizontal",{min:h,max:d}=o,f=l&&!c?d:h,p={type:"box",key:Nv.BAR,data:{extract:{field:"qMeasureInfo/0",props:{start:h,end:{field:"qMeasureInfo/0"},measureIndex:0}}},settings:{minor:{scale:"m"},orientation:u,box:{width:.1,maxWidthPx:rv,fill:$b({services:e}),strokeWidth:e=>e.datum.value<=h?0:1,stroke:t=>Rw($b({services:e})(t))}},animations:{enabled:r.enabled,isMainComponent:!0,trackBy:e=>`${e.data.measureIndex.value}`}},m={type:"box",key:Nv.SEGMENT_BAR,data:{extract:{field:"qMeasureInfo/0",props:{start:h,end:d,measureIndex:0}}},settings:{minor:{scale:"m"},orientation:u,box:{width:.1,maxWidthPx:rv,fill:()=>Ew({themeService:t,isVertical:c,segmentInfo:a,rangeLimits:o,isRtl:l}),stroke:"transparent"}},animations:{enabled:r.enabled,trackBy:e=>`${e.data.measureIndex.value}`}},g={type:"box",key:Nv.BACKGROUND_BAR,data:{extract:{field:"qMeasureInfo/0",props:{start:h,end:d}}},settings:{minor:{scale:"m"},orientation:u,box:{width:.1,maxWidthPx:rv,fill:sv}}},y={type:"box",key:Nv.LABEL_BAR,data:{extract:{field:"qMeasureInfo/0",props:{start:f,end:f}}},settings:{minor:{scale:"m"},orientation:u,box:{width:c?xv:vv,opacity:0}}};return s?[y,m]:[y,g,p]}({services:t}),...function({services:e}){const{dockService:t,labelService:n,styleService:i,layoutService:r}=e,{width:o,height:a}=t.meta.chart.size;if(!vw(r.meta.measureAxisShow,o,a))return[];const s=yw({dockService:t,layoutService:r}),{measureAxisTitle:l,useSegments:c}=r.meta,{getTopPadding:u,getBottomPadding:h,getLeftPadding:d,getRightPadding:f}=n.barAxisTitle,p=i.query.axis.title.getStyle(),{fontFamily:m,fontSize:g,color:y}=p;return[{type:"labels",key:Nv.AXIS_TITLE,settings:{sources:[{component:c?Nv.SEGMENT_BAR:Nv.BACKGROUND_BAR,selector:"rect",strategy:{type:"bar",settings:{direction:s?"up":"right",align:.5,justify:.5,labels:[{fontFamily:m,fill:y,fontSize:Number.parseFloat(Mw({width:o,height:a,fontSize:g})),label:()=>l,placements:[{position:"inside",padding:{top:u,bottom:h,left:d,right:f},overflow:!0}]}]}}}]}}]}({services:t}),function({services:e}){const{layoutService:t,dockService:n,labelService:i,animationsService:r}=e,{qHyperCube:o,rangeLimits:a,useSegments:s}=t.meta,{width:l,height:c}=n.meta.chart.size,u=n.config.rtl,h=yw({dockService:n,layoutService:t}),{min:d,max:f}=a,p=o.qDataPages[0].qMatrix[0][0].qNum;let m=i.getBarWidthInPixels();p<=f&&p>=d&&(m=0);let g=h?"bottom":u?"right":"left";return p>f&&(g=h?"top":u?"left":"right"),{type:"oob-indicator",key:Nv.OOB_INDICATOR,layout:{displayOrder:2},settings:{component:s?Nv.SEGMENT_BAR:Nv.BAR,isRtl:u,selector:"rect",pointingTo:g,size:m,width:l,height:c},animations:{enabled:r.enabled,trackBy:e=>e.type}}}({services:t}),Ow({services:t}));const e=function({chart:e,services:t}){if(!e.formatter)return!1;const{labelService:n,styleService:i,dockService:r,layoutService:o,animationsService:a}=t,s=yw({dockService:r,layoutService:o}),{getValueLabelFontSize:l,barValueLabel:c}=n,{getTopPadding:u,getBottomPadding:h,getLeftPadding:d,getRightPadding:f}=c,p=l(cv.MIN,cv.MAX),m=i.query.label.getStyle(),g={type:"labels",key:Nv.GAUGE_LABEL,layout:{minimumLayoutMode:s?Ov:Pv},settings:{sources:[{component:Nv.LABEL_BAR,selector:"rect",formatter:"measure",strategy:{type:"bar",settings:{direction:s?"up":"right",orientation:"horizontal",fontFamily:m.fontFamily,fill:m.fill,fontSize:p,align:s?0:.5,justify:0,labels:[{label:({data:t})=>t?e.formatter(Cv.MEASURE)(t.value):"",linkData:({data:e})=>e?{value:e.value,formatter:Cv.MEASURE}:null,placements:[{position:"outside",padding:{top:u,bottom:h,left:d,right:f},overflow:!0}]}]}}}]},animations:{enabled:a.enabled,trackBy:e=>e.type,adjustTweenedNodes(t){t.forEach((t=>{const{type:n,data:i}=t;"text"===n&&i&&i.value&&i.formatter&&(t.text=e.formatter(i.formatter)(i.value))}))}}};return g}({chart:n,services:t}),i=function({services:e}){const{dockService:t,layoutService:n,labelService:i,themeService:r,colorService:o,animationsService:a}=e,{refLines:s}=n.meta,l=t.config.rtl,c=yw({dockService:t,layoutService:n}),u=r.getStyles(),h={type:"custom-ref-line",key:Nv.REFERENCE_LINES_AND_LABELS,settings:{barWidth:i.getBarWidthInPixels(),isRtl:l,needlePosition:i.getNeedlePosition(!1)},lines:{[c?"y":"x"]:s.filter(Gb).map((e=>{var t,n;return{scale:"m",value:e.refLineExpr.value,cId:e.cId,label:{text:e.label,...u.referenceLine.label.name,showValue:e.showValue,showLabel:e.showLabel},line:{stroke:o.getPaletteColor(e.paletteColor||{index:e.color}),strokeWidth:(null===(t=e.style)||void 0===t?void 0:t.lineThickness)||2,strokeDasharray:null===(n=e.style)||void 0===n?void 0:n.lineType}}}))},animations:{enabled:a.enabled,trackBy:e=>{const{type:t,cId:n,text:i,isConnector:r}=e;return"text"===t?`${n}-text-${i}`:"line"===t?r?`${n}-connector`:`${n}-line`:Math.random()}}};return h}({services:t});l?(c.push(e),c.push(i)):(c.push(i),c.push(e))}else o>=zv.SPARK.width&&a>=zv.SPARK.height?c.push(...Tw({services:t}),...zw({chart:n,services:t}),...Pw({services:t}),...s?[Fw({services:t})]:[],...jw({services:t}),function({services:e}){const{dockService:t,themeService:n,colorService:i,layoutService:r,animationsService:o}=e,{width:a,height:s}=t.meta.chart.size,{refLines:l}=r.meta,c=n.getStyles(),u=Wb(a,s,ov,av),{innerRadius:h,outerRadius:d}=u,f=Yb({innerRadius:h,outerRadius:d,width:a,height:s}),p={type:"radial-custom-ref-line",key:Nv.RADIAL_REFERENCE_LINES,displayOrder:1,settings:{barWidth:f},lines:{radial:l.filter(Gb).map((e=>{var t,n;return{scale:"r",value:e.refLineExpr.value,cId:e.cId,label:{text:e.label,...c.referenceLine.label.name,showValue:e.showValue,showLabel:e.showLabel},radius:u.innerRadius,line:{stroke:i.getPaletteColor(e.paletteColor||{index:e.color}),strokeWidth:(null===(t=e.style)||void 0===t?void 0:t.lineThickness)||2,strokeDasharray:null===(n=e.style)||void 0===n?void 0:n.lineType}}}))},animations:{enabled:o.enabled,trackBy:e=>{const{type:t,cId:n}=e;return"line"===t?`${n}-line`:Math.random()},adjustTweenedNodes(e){e.forEach((e=>{const{type:t,data:n}=e;if("line"===t){const{angle:t,innerRadius:i}=n;e.x1=a/2+Math.cos(t)*i,e.y1=s/2+Math.sin(t)*i,e.x2=a/2+Math.cos(t)*(i+f),e.y2=s/2+Math.sin(t)*(i+f)}}))}}};return p}({services:t})):c.push(function({services:e}){const{dockService:t,layoutService:n,themeService:i,animationsService:r}=e,{width:o,height:a}=t.meta.chart.size,{rangeLimits:s,useSegments:l,segmentInfo:c,qHyperCube:u}=n.meta,{min:h,max:d}=s,f=u.qDataPages[0].qMatrix[0][0].qNum,p=Wb(o,a,ov,av).outerRadius;let m;m=f<h?ov:f>d?av:ov+(f-h)/(d-h)*(av-ov);const g=$b({services:e}),y=l?function({value:e,segmentInfo:t,themeService:n}){const{paletteColors:i,limits:r}=t,o=n.getTheme();if(!r.length)return o.getColorPickerColor(i[0]);const a=r.findIndex((t=>e<=t.value)),s=-1===a?i.length-1:a;return o.getColorPickerColor(i[s]||i[i.length-1])}({value:f,segmentInfo:c,themeService:i}):g({datum:{value:()=>0}});return{type:"radial-spark",key:Nv.RADIAL_SPARK,layout:{displayOrder:2},settings:{fill:y,radius:p,valueAngle:m,width:o,height:a},animations:{enabled:r.enabled,trackBy:e=>e.type}}}({services:t}));return c}const Bw=Math.log(10),Hw={log:(e,t)=>e<=0||t<=0?NaN:Math.log(e)/Math.log(t),log10:e=>e<=0?NaN:Math.log(e)/Bw,getNiceNumber(e){let t;if(0===e)return 0;const n=Math.floor(Math.log(Math.abs(e))/Bw),i=e/10**n;return t=i<=1?1:i<=2?2:i<=5?5:10,t*10**n*(e<0?-1:1)},getSmallNiceNumber(e){let t;if(0===e)return 0;let n=Math.floor(Math.log(Math.abs(e))/Bw);const i=e/10**n;return i<1?(t=5,n--):t=i<2?1:i<5?2:5,t*10**n*(e<0?-1:1)},getGoodNumber(e){let t;if(0===e)return 0;const n=Math.floor(Math.log(Math.abs(e))/Bw),i=e/10**n;return t=Math.ceil(i),7!==t&&9!==t||t++,i>1&&i<=1.5?t=1.5:i>2&&i<=2.5&&(t=2.5),t*10**n*(e<0?-1:1)},calculateTicks(e,t,n,i,r,o){return this.plotSize=e,this.explicitPlotMin=t,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===e?(this.plotMin=this.explicitPlotMin,this.plotMax=this.explicitPlotMax,this.tickDataSpacingNN=this.tickDataSpacing,Jw.call(this),eM.call(this)):(this.maxNumIntervals<1?Yw.call(this):(this.explicitPlotMax>0&&this.explicitPlotMin<0?1===this.maxNumIntervals?Uw.call(this,!0):this.maxNumIntervals>=5?Ww.call(this):this.maxNumIntervals<2?Gw.call(this):Xw.call(this):Ww.call(this),this.tickMaxIndex<this.tickMinIndex?(this.tickDataSpacing=Math.max(this.usedDataRange/this.maxNumIntervals,this.minTickDataSpacing),Yw.call(this)):Kw.call(this)),Jw.call(this),eM.call(this))}};function $w(e,t,n){void 0===e&&(e=null!==this.explicitPlotMin),void 0===t&&(t=null!==this.explicitPlotMax),this.tickDataSpacingNN=n?Hw.getGoodNumber(this.tickDataSpacing):Hw.getNiceNumber(this.tickDataSpacing),Qw.apply(this,[e,t])}function Ww(){$w.call(this);const e=this.tickMaxIndex-this.tickMinIndex;let t=this.plotMax-this.plotMin;this.spaceUseFactor=t/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),$w.call(this),t=this.plotMax-this.plotMin,this.spaceUseFactor=t/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||e<=2&&this.maxNumIntervals>=2*e)&&$w.apply(this,[void 0,void 0,!0]),t=this.plotMax-this.plotMin,this.spaceUseFactor=t/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),$w.apply(this,[void 0,void 0,!0]),t=this.plotMax-this.plotMin,this.spaceUseFactor=t/this.plotRange,n=this.plotSize*this.tickDataSpacingNN/this.plotRange<this.minTickSpacingInPixel}function Uw(e){e?(this.tickDataSpacingNN=Hw.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=Hw.getNiceNumber(this.absMax),this.tickDataSpacingNN===this.absMax&&(this.tickDataSpacingNN=Hw.getNiceNumber(1.1*this.absMax)))}function Yw(){let e;this.tickDataSpacingNN=Hw.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)&&(e=Hw.getSmallNiceNumber(this.plotRange),this.tickBaseValue=Math.ceil(this.plotMin/e)*e)}function Gw(){const e=this.explicitPlotMax>=-this.explicitPlotMin,t=e||null!==this.explicitPlotMin,n=!e||null!==this.explicitPlotMax;$w.apply(this,[t,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),$w.apply(this,[t,n,!0]);const r=this.plotMax-this.plotMin;this.spaceUseFactor=r/this.plotRange}function Xw(){Ww.call(this);const e=this.plotMax-this.plotMin;this.spaceUseFactor=e/this.plotRange}function Kw(){const e=Hw.getNiceNumber(this.tickDataSpacingNN);if(this.tickDataSpacingNN===e||0!==this.tickBaseValue)return;const t=this.tickDataSpacingNN,n=this.tickMinIndex,i=this.tickMaxIndex,r=i-n,o=this.plotMin,a=this.plotMax;this.tickDataSpacingNN=e,Qw.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=t,this.tickMinIndex=n,this.tickMaxIndex=i,this.plotMin=o,this.plotMax=a,this.plotRange=this.plotMax-this.plotMin)}function Zw(){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 Jw(){let e,t;if(this.mainTickValues=[],this.secondaryTickValues=[],Zw.call(this),0===this.plotSize)return;e=this.tickBaseValue;const n=this.tickMaxIndex-this.tickMinIndex;if(!(n<1)){for(t=0;t<=n;t++)this.mainTickValues.push(e+(t+this.tickMinIndex)*this.tickDataSpacingNN);for(e=this.tickBaseValue+this.tickDataSpacingNN/2,t=0;t<n;t++)this.secondaryTickValues.push(e+(t+this.tickMinIndex)*this.tickDataSpacingNN)}}function Qw(e,t){this.tickMinIndex=e?Math.ceil(this.explicitPlotMin/this.tickDataSpacingNN):Math.floor(this.explicitPlotMin/this.tickDataSpacingNN),this.tickMaxIndex=t?Math.floor(this.explicitPlotMax/this.tickDataSpacingNN):Math.ceil(this.explicitPlotMax/this.tickDataSpacingNN),this.plotMin=e?this.explicitPlotMin:this.tickMinIndex*this.tickDataSpacingNN,this.plotMax=t?this.explicitPlotMax:this.tickMaxIndex*this.tickDataSpacingNN,this.plotRange=this.plotMax-this.plotMin}function eM(){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 tM({core:e,dockService:t,rangeLimits:n,measureAxisSpacing:i,isRadial:r,isVertical:o,styleService:a}){const s=n.min,l=n.max,{width:c,height:u}=function(e){return{width:e.meta.chart.size.width,height:e.meta.chart.size.height}}(t);let h,d=96*i;if(r)h=Math.min(u,c);else{h=o?u:c;const{chart:t,picassoInstance:n}=e;if(t&&n){const e=t.formatter(Cv.MEASURE),r=n.renderer("svg")(),f=a.query.axis.label.getStyle(),{fontFamily:p,fontSize:m}=f,g=e=>r.measureText({text:e,fontSize:Mw({width:c,height:u,fontSize:m}),fontFamily:p}),y=Math.max(96,...[s,l,(l-s)/2].map((t=>g(e(t)).width)));d=o?4*g("M").height:y;d=h/(Math.max(2,h/d/i+1)-1)}}const f=function({plotSize:e,rangeMax:t,rangeMin:n,minTickSpacingInPixel:i}){const r=Hw.calculateTicks(e,n,t,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]=r.plotMax:o.push(r.plotMax),o}({plotSize:h,rangeMin:s,rangeMax:l,minTickSpacingInPixel:d});return{values:f}}function nM({isRadial:e,dockService:t,isVertical:n}){return e?!t.config.rtl:!!n||t.config.rtl}function iM({core:e,services:t,logicalSize:n}){if(!t.layoutService.meta.qHyperCube)throw new Error("Layout is missing a hypercube");const i=Vw({core:e,services:t}),r=function({core:e,services:t}){const{dockService:n,styleService:i,colorService:r,layoutService:o}=t,{rangeLimits:a,measureAxisSpacing:s,gaugetype:l}=o.meta,c=yw({dockService:n,layoutService:o}),u="radial"===l,h=tM({core:e,dockService:n,rangeLimits:a,measureAxisSpacing:s,isRadial:u,isVertical:c,styleService:i});return{m:{data:{field:"qMeasureInfo/0"},type:"linear",invert:nM({isRadial:u,dockService:n,isVertical:c}),min:a.min,max:a.max,ticks:{values:h.values}},r:{data:{field:"qMeasureInfo/0"},invert:n.config.rtl,min:a.min,max:a.max},...r.getScales()}}({core:e,services:t});return{scales:r,components:i,formatters:{[Cv.MEASURE]:{data:{field:"qMeasureInfo/0"}}},strategy:{layoutModes:zv,logicalSize:n}}}const rM={Object_Gauge_RangeIsDefault:{id:"Object.Gauge.RangeIsDefault",locale:{"de-DE":"Max. und Min. auf Standardwerte festgelegt. Sie können über das Eigenschaften-Fenster unter Darstellung > Präsentation geändert werden.","en-US":"Max. and Min. set to default values. You can change them via the properties window under Display > Presentation.","es-ES":"Máx y mín se han configurado como valores predefinidos. Puede cambiarlos en el panel de propiedades en Aspecto > Presentación.","fr-FR":"Les valeurs max. et min. par défaut sont définies. Vous pouvez les modifier via le panneau des propriétés sous Aspect > Présentation.","it-IT":"Il massimo e il minimo vengono impostati sui valori predefiniti. È possibile modificarli nel pannello delle proprietà in Aspetto > Presentazione.","ja-JP":"最大値と最小値は規定値に設定されています。これは、スタイル > プレゼンテーションからプロパティ パネルで変更できます。","ko-KR":"최대 및 최소 값이 기본값으로 설정됩니다. 모양 > 프레젠테이션 아래 속성 패널에서 이를 변경할 수 있습니다.","nl-NL":"Max. en min. zijn ingesteld op standaardwaarden. U kunt deze wijzigen in het eigenschappenvenster onder Uiterlijk > Presentatie.","pl-PL":"Maks. i Min. są ustawione na wartości domyślne. Można je zmienić w panelu właściwości, w obszarze Wygląd > Prezentacja.","pr-BR":"Máx. e mín. estão definidos com valores padrão. É possível alterá-los no painel de propriedades, em Aparência > Apresentação.","ru-RU":"Максимальные и минимальные значения установлены по умолчанию. Эти значения можно изменить на панели свойств в меню Вид > Представление.","sv-SE":"Max och min är inställda på standardvärden. Du kan ändra dem i egenskapspanelen under Utseende > Presentation.","tr-TR":"Maks. ve min. değerleri varsayılan değerlere ayarlanmıştır. Görünüş > Sunum altındaki özellikler panelinden bu değerleri değiştirebilirsiniz.","zh-CN":"最大值和最小值已设置为默认值。您可以在“外观”>“显示”下的属性面板中进行更改。","zh-TW":"最大值與最小值均設為預設值。您可以在 [外觀] > [呈現方式] 之下的屬性面板中變更這些值。"}},Object_Gauge_RangeIsDefaultTitle:{id:"Object.Gauge.RangeIsDefaultTitle",locale:{"de-DE":"Bereich auf Standardwerte eingestellt","en-US":"Range set to default values","es-ES":"Rango fijado a valores predeterminados","fr-FR":"Plage définie sur les valeurs par défaut","it-IT":"Scala impostata sui valori predefiniti","ja-JP":"範囲は規定値に設定されています","ko-KR":"범위가 기본값으로 설정됩니다.","nl-NL":"Bereik ingesteld op standaardwaarden","pl-PL":"Zakres ustawiony na wartości domyślne","pt-BR":"Intervalo definido com valores padrão","ru-RU":"Значения диапазона установлены по умолчанию","sv-SE":"Intervallet har standardvärden","tr-TR":"Varsayılan değerlere ayarlı aralık","zh-CN":"范围设置为默认值","zh-TW":"範圍會設為預設值"}}};const oM={version:JSON.stringify("0.8.4"),qHyperCubeDef:{qMeasures:[],qInitialDataFetch:[{qWidth:1,qHeight:1}],qSuppressZero:!1,qSuppressMissing:!0},showTitles:!0,title:"",subtitle:"",footnote:"",measureAxis:{min:0,max:100},orientation:"horizontal",segmentInfo:{limits:[],paletteColors:[{index:6}]}};function aM(e){return{properties:oM,data:{targets:[{path:"/qHyperCubeDef",...Jt(e)}]}}}function sM(r){return function(e){if(e&&e.get&&e.add){const t="Object.Gauge.RangeIsDefault";if(e.get(t)!==t)return;Object.keys(rM).forEach((t=>{e.add(rM[t])}))}}(r.translator),{qae:aM(r),ext:nn(r),component(){const r=(()=>{const r=e(),o=t(),[a,s]=n({});return i((()=>{r.style.overflow="hidden";const e=nv();e.use($i),e.component("oob-indicator",Hb),e.component("radial-gauge-needle",Zb),e.component("radial-custom-ref-line",sw),e.component("custom-ref-line",uw),e.component("radial-oob-indicator",Jb),e.component("radial-spark",lw),e.component("disclaimer-component",iv);const t=e({renderer:{prio:[o.renderer||"svg"]}}),n=t.chart({element:r,data:[],settings:{}});return s({picassoInstance:t,chart:n,cache:_t()}),()=>{n.destroy()}}),[]),a})(),o=ww({core:r}),a=(({core:e,services:r})=>{const[o,a]=n({}),s=t(),c=l();return d((async()=>{if(!r)return Promise.resolve();const{colorService:t}=r;return t.initialize().then((()=>{const{layoutService:t}=r,n=pw({layout:t.getLayout(),options:s}),i=iM({core:e,services:r,logicalSize:n});a(i)}))}),[r]),i((()=>{if(r&&r.dockService&&r.layoutService){const{dockService:t,layoutService:n,animationsService:i}=r;i.meta.isSizeChanging=!0;const o=pw({layout:n.getLayout(),options:s});t.update(o||c);const l=iM({core:e,services:r,logicalSize:o});a(l)}}),[c]),o})({core:r,services:o});fw({core:r,settings:a,services:o}),(({services:e})=>{f((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:o})}}}export{sM as default};