@nebula.js/sn-gauge 0.7.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,9 @@
1
+ /*
2
+ * @nebula.js/sn-gauge v0.7.0
3
+ * Copyright (c) 2025 QlikTech International AB
4
+ * Released under the MIT license.
5
+ */
6
+
7
+ System.register(["@nebula.js/stardust","picasso-plugin-q","picasso.js"],(function(e){"use strict";var t,i,n,r,a,o,s,l,u,c,h,f,p,d,m;return{setters:[function(e){t=e.useElement,i=e.useOptions,n=e.useState,r=e.useEffect,a=e.useStaleLayout,o=e.useTheme,s=e.useApp,l=e.useModel,u=e.useRect,c=e.useTranslator,h=e.useAppLayout,f=e.usePromise,p=e.onTakeSnapshot},function(e){d=e.default},function(e){m=e.default}],execute:function(){function g(e,t){(null==t||t>e.length)&&(t=e.length);for(var i=0,n=Array(t);i<t;i++)n[i]=e[i];return n}function y(e,t,i){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 i=t.call(e,"string");if("object"!=typeof i)return i;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:i,enumerable:!0,configurable:!0,writable:!0}):e[t]=i,e}function v(e,t){var i=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),i.push.apply(i,n)}return i}function b(e){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};t%2?v(Object(i),!0).forEach((function(t){y(e,t,i[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):v(Object(i)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(i,t))}))}return e}function x(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var i=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=i){var n,r,a,o,s=[],l=!0,u=!1;try{if(a=(i=i.call(e)).next,0===t){if(Object(i)!==i)return;l=!1}else for(;!(l=(n=a.call(i)).done)&&(s.push(n.value),s.length!==t);l=!0);}catch(e){u=!0,r=e}finally{try{if(!l&&null!=i.return&&(o=i.return(),Object(o)!==o))return}finally{if(u)throw r}}return s}}(e,t)||k(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 M(e){return function(e){if(Array.isArray(e))return g(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||k(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){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)}function k(e,t){if(e){if("string"==typeof e)return g(e,t);var i={}.toString.call(e).slice(8,-1);return"Object"===i&&e.constructor&&(i=e.constructor.name),"Map"===i||"Set"===i?Array.from(e):"Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i)?g(e,t):void 0}}e("default",(function(e){return{qae:{properties:Kr(),data:Xr()},ext:Zt(e),component(){const e=rr(),t=ur({core:e}),i=Gr({core:e,services:t});ar({core:e,settings:i,services:t}),Zr({services:t})}}}));var w=["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"],N=["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 I=function(e){return{value:e,label:e.charAt(0).toUpperCase()+e.slice(1),groupHeader:!1,disabled:!1,styles:{fontFamily:e}}};function D(e){var t=e.theme,i=e.translator,n=e.defaultValue,r=e.flags,a=[],o=t.getStyle("","","fontFamilies");return Array.isArray(o)&&o.length?a.push.apply(a,M(new Set([n].concat(M(o.map((function(e){return e.split(",").map((function(e){return e.trim()})).map((function(e){return e.replace(/\s+/g," ").trim()})).filter(Boolean).join(", ")}))))))):a.push(n),[{value:"ThemeHeader",label:i.get("properties.themeFonts"),metaText:i.get("properties.theme"),groupHeader:!0}].concat(M(a.map((function(e){return I(e)}))),[{value:"DefaultHeader",label:i.get("properties.allFonts"),metaText:i.get("properties.default"),groupHeader:!0}],M(function(e){return null!=e&&e.isEnabled("PS_20852_WYSIWYG_FONT_SUPPORT")?N:w}(r).map((function(e){return I(e)}))))}function A(e){var t=e.theme,i=e.translator,n=e.id,r=e.path,a=e.flags,o=function(){return t.getStyle(n,r,"fontFamily")};return{getDefaultValue:function(){return o()},getOptions:function(){return D({theme:t,translator:i,defaultValue:o(),flags:a})}}}var L,C,q=["10px","11px","12px","13px","14px","15px","16px","17px","18px","19px","20px","21px","22px","23px","24px"],P=function(e){return{value:e,label:e,groupHeader:!1,disabled:!1}};function T(e){var t=e.theme,i=e.translator,n=e.id,r=e.path,a=function(){return t.getStyle(n,r,"fontSize")};return{getDefaultValue:function(){return a()},getOptions:function(){return function(e){var t=e.translator,i=e.defaultValue,n=[],r=e.theme.getStyle("","","fontSizes");return Array.isArray(r)&&r.length?n.push.apply(n,M(new Set([i].concat(M(r))))):n.push(i),[{value:"ThemeHeader",label:t.get("properties.themeFontSizes"),metaText:t.get("properties.theme"),groupHeader:!0}].concat(M(n.map((function(e){return P(e)}))),[{value:"DefaultHeader",label:t.get("properties.allFontSizes"),metaText:t.get("properties.default"),groupHeader:!0}],M(q.map((function(e){return P(e)}))))}({theme:t,translator:i,defaultValue:a()})}}}function O(e){var t=e.theme,i=e.translator,n=e.id,r=e.path;return{fontFamily:A({theme:t,translator:i,id:n,path:r,flags:e.flags}),fontSize:T({theme:t,translator:i,id:n,path:r})}}var R,E=function(){if(C)return L;C=1;var e=Object.prototype.hasOwnProperty,t=Object.prototype.toString,i=Object.defineProperty,n=Object.getOwnPropertyDescriptor,r=function(e){return"function"==typeof Array.isArray?Array.isArray(e):"[object Array]"===t.call(e)},a=function(i){if(!i||"[object Object]"!==t.call(i))return!1;var n,r=e.call(i,"constructor"),a=i.constructor&&i.constructor.prototype&&e.call(i.constructor.prototype,"isPrototypeOf");if(i.constructor&&!r&&!a)return!1;for(n in i);return void 0===n||e.call(i,n)},o=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},s=function(t,i){if("__proto__"===i){if(!e.call(t,i))return;if(n)return n(t,i).value}return t[i]};return L=function e(){var t,i,n,l,u,c,h=arguments[0],f=1,p=arguments.length,d=!1;for("boolean"==typeof h&&(d=h,h=arguments[1]||{},f=2),(null==h||"object"!=typeof h&&"function"!=typeof h)&&(h={});f<p;++f)if(null!=(t=arguments[f]))for(i in t)n=s(h,i),h!==(l=s(t,i))&&(d&&l&&(a(l)||(u=r(l)))?(u?(u=!1,c=n&&r(n)?n:[]):c=n&&a(n)?n:{},o(h,{name:i,newValue:e(d,c,l)})):void 0!==l&&o(h,{name:i,newValue:l}));return h},L}(),z=(R=E)&&R.__esModule&&Object.prototype.hasOwnProperty.call(R,"default")?R.default:R;function F(e,t){return{range:function(e){var i=e.resources,n=e.data,r=i.theme.palette("categorical",0===t?n.items.length:t);return n.items.map((function(e){return r[e.value%r.length]}))},valueAccessor:e.value}}function V(e,t){return{range:function(e){var i=e.resources,n=e.data,r=i.theme.palette("categorical",0===t?n.items.length:t);return n.items.map((function(e){return r[e.row.value%r.length]}))},valueAccessor:e.value}}function j(e,t,i,n,r){var a,o,s=r.byRow,l=r.byElemNo;if(n&&(t.input.persistent||e.hc.qDimensionInfo.length>1||void 0===i.activeDimensionIndex&&e.hc.qSize.qcy>((null===(o=(a=e.hc).qDataPages[0]||a.qStackedDataPages[0])||void 0===o?void 0:o.qArea.qHeight)||0)))return l(n,n.raw().qCardinal);if(n){var u=t.pic.extract({field:n.key(),trackBy:n.value}).length;return s(n,u)}return{}}function $(e,t){var i=e.hc.qDimensionInfo,n=t.input.byDimDef||{activeDimensionIndex:i.length-1};if(n.activeDimensionIndex>=0){var r=i[n.activeDimensionIndex];n=r.coloring&&r.coloring.colorMapRef?{type:"libraryItem",key:r.coloring.colorMapRef,activeDimensionIndex:n.activeDimensionIndex}:{activeDimensionIndex:n.activeDimensionIndex}}return n}function H(e,t){var i;return t.activeDimensionIndex>=0?i=e.pic.fields().filter((function(e){return"dimension"===e.type()}))[t.activeDimensionIndex]:"libraryItem"===t.type?!1===(i=t.key?e.pic.field((function(e){return e.raw().colorMapRef===t.key})):void 0)&&(i=e.pic.field((function(e){return"colorByAlternative"===e.raw().id}))):"expression"===t.type&&(i=e.pic.field((function(e){return"colorByAlternative"===e.raw().id}))),i}function _(e,t,i){e.prototype=t.prototype=i,i.constructor=e}function B(e,t){var i=Object.create(e.prototype);for(var n in t)i[n]=t[n];return i}function W(){}var U=1/.7,G="\\s*([+-]?\\d+)\\s*",X="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",K="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",Z=/^#([0-9a-f]{3,8})$/,Y=new RegExp(`^rgb\\(${G},${G},${G}\\)$`),Q=new RegExp(`^rgb\\(${K},${K},${K}\\)$`),J=new RegExp(`^rgba\\(${G},${G},${G},${X}\\)$`),ee=new RegExp(`^rgba\\(${K},${K},${K},${X}\\)$`),te=new RegExp(`^hsl\\(${X},${K},${K}\\)$`),ie=new RegExp(`^hsla\\(${X},${K},${K},${X}\\)$`),ne={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 re(){return this.rgb().formatHex()}function ae(){return this.rgb().formatRgb()}function oe(e){var t,i;return e=(e+"").trim().toLowerCase(),(t=Z.exec(e))?(i=t[1].length,t=parseInt(t[1],16),6===i?se(t):3===i?new he(t>>8&15|t>>4&240,t>>4&15|240&t,(15&t)<<4|15&t,1):8===i?le(t>>24&255,t>>16&255,t>>8&255,(255&t)/255):4===i?le(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=Y.exec(e))?new he(t[1],t[2],t[3],1):(t=Q.exec(e))?new he(255*t[1]/100,255*t[2]/100,255*t[3]/100,1):(t=J.exec(e))?le(t[1],t[2],t[3],t[4]):(t=ee.exec(e))?le(255*t[1]/100,255*t[2]/100,255*t[3]/100,t[4]):(t=te.exec(e))?ye(t[1],t[2]/100,t[3]/100,1):(t=ie.exec(e))?ye(t[1],t[2]/100,t[3]/100,t[4]):ne.hasOwnProperty(e)?se(ne[e]):"transparent"===e?new he(NaN,NaN,NaN,0):null}function se(e){return new he(e>>16&255,e>>8&255,255&e,1)}function le(e,t,i,n){return n<=0&&(e=t=i=NaN),new he(e,t,i,n)}function ue(e){return e instanceof W||(e=oe(e)),e?new he((e=e.rgb()).r,e.g,e.b,e.opacity):new he}function ce(e,t,i,n){return 1===arguments.length?ue(e):new he(e,t,i,null==n?1:n)}function he(e,t,i,n){this.r=+e,this.g=+t,this.b=+i,this.opacity=+n}function fe(){return`#${ge(this.r)}${ge(this.g)}${ge(this.b)}`}function pe(){const e=de(this.opacity);return`${1===e?"rgb(":"rgba("}${me(this.r)}, ${me(this.g)}, ${me(this.b)}${1===e?")":`, ${e})`}`}function de(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function me(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function ge(e){return((e=me(e))<16?"0":"")+e.toString(16)}function ye(e,t,i,n){return n<=0?e=t=i=NaN:i<=0||i>=1?e=t=NaN:t<=0&&(e=NaN),new be(e,t,i,n)}function ve(e){if(e instanceof be)return new be(e.h,e.s,e.l,e.opacity);if(e instanceof W||(e=oe(e)),!e)return new be;if(e instanceof be)return e;var t=(e=e.rgb()).r/255,i=e.g/255,n=e.b/255,r=Math.min(t,i,n),a=Math.max(t,i,n),o=NaN,s=a-r,l=(a+r)/2;return s?(o=t===a?(i-n)/s+6*(i<n):i===a?(n-t)/s+2:(t-i)/s+4,s/=l<.5?a+r:2-a-r,o*=60):s=l>0&&l<1?0:o,new be(o,s,l,e.opacity)}function be(e,t,i,n){this.h=+e,this.s=+t,this.l=+i,this.opacity=+n}function xe(e){return(e=(e||0)%360)<0?e+360:e}function Me(e){return Math.max(0,Math.min(1,e||0))}function Se(e,t,i){return 255*(e<60?t+(i-t)*e/60:e<180?i:e<240?t+(i-t)*(240-e)/60:t)}_(W,oe,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:re,formatHex:re,formatHex8:function(){return this.rgb().formatHex8()},formatHsl:function(){return ve(this).formatHsl()},formatRgb:ae,toString:ae}),_(he,ce,B(W,{brighter(e){return e=null==e?U:Math.pow(U,e),new he(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=null==e?.7:Math.pow(.7,e),new he(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new he(me(this.r),me(this.g),me(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:fe,formatHex:fe,formatHex8:function(){return`#${ge(this.r)}${ge(this.g)}${ge(this.b)}${ge(255*(isNaN(this.opacity)?1:this.opacity))}`},formatRgb:pe,toString:pe})),_(be,(function(e,t,i,n){return 1===arguments.length?ve(e):new be(e,t,i,null==n?1:n)}),B(W,{brighter(e){return e=null==e?U:Math.pow(U,e),new be(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=null==e?.7:Math.pow(.7,e),new be(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,i=this.l,n=i+(i<.5?i:1-i)*t,r=2*i-n;return new he(Se(e>=240?e-240:e+120,r,n),Se(e,r,n),Se(e<120?e+240:e-120,r,n),this.opacity)},clamp(){return new be(xe(this.h),Me(this.s),Me(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*Me(this.s)}%, ${100*Me(this.l)}%${1===e?")":`, ${e})`}`}}));const ke=Math.PI/180,we=180/Math.PI,Ne=4/29,Ie=6/29,De=3*Ie*Ie;function Ae(e){if(e instanceof Le)return new Le(e.l,e.a,e.b,e.opacity);if(e instanceof Oe)return Re(e);e instanceof he||(e=ue(e));var t,i,n=Te(e.r),r=Te(e.g),a=Te(e.b),o=Ce((.2225045*n+.7168786*r+.0606169*a)/1);return n===r&&r===a?t=i=o:(t=Ce((.4360747*n+.3850649*r+.1430804*a)/.96422),i=Ce((.0139322*n+.0971045*r+.7141733*a)/.82521)),new Le(116*o-16,500*(t-o),200*(o-i),e.opacity)}function Le(e,t,i,n){this.l=+e,this.a=+t,this.b=+i,this.opacity=+n}function Ce(e){return e>.008856451679035631?Math.pow(e,1/3):e/De+Ne}function qe(e){return e>Ie?e*e*e:De*(e-Ne)}function Pe(e){return 255*(e<=.0031308?12.92*e:1.055*Math.pow(e,1/2.4)-.055)}function Te(e){return(e/=255)<=.04045?e/12.92:Math.pow((e+.055)/1.055,2.4)}function Oe(e,t,i,n){this.h=+e,this.c=+t,this.l=+i,this.opacity=+n}function Re(e){if(isNaN(e.h))return new Le(e.l,0,0,e.opacity);var t=e.h*ke;return new Le(e.l,Math.cos(t)*e.c,Math.sin(t)*e.c,e.opacity)}_(Le,(function(e,t,i,n){return 1===arguments.length?Ae(e):new Le(e,t,i,null==n?1:n)}),B(W,{brighter(e){return new Le(this.l+18*(null==e?1:e),this.a,this.b,this.opacity)},darker(e){return new Le(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,i=isNaN(this.b)?e:e-this.b/200;return new he(Pe(3.1338561*(t=.96422*qe(t))-1.6168667*(e=1*qe(e))-.4906146*(i=.82521*qe(i))),Pe(-.9787684*t+1.9161415*e+.033454*i),Pe(.0719453*t-.2289914*e+1.4052427*i),this.opacity)}})),_(Oe,(function(e,t,i,n){return 1===arguments.length?function(e){if(e instanceof Oe)return new Oe(e.h,e.c,e.l,e.opacity);if(e instanceof Le||(e=Ae(e)),0===e.a&&0===e.b)return new Oe(NaN,0<e.l&&e.l<100?0:NaN,e.l,e.opacity);var t=Math.atan2(e.b,e.a)*we;return new Oe(t<0?t+360:t,Math.sqrt(e.a*e.a+e.b*e.b),e.l,e.opacity)}(e):new Oe(e,t,i,null==n?1:n)}),B(W,{brighter(e){return new Oe(this.h,this.c,this.l+18*(null==e?1:e),this.opacity)},darker(e){return new Oe(this.h,this.c,this.l-18*(null==e?1:e),this.opacity)},rgb(){return Re(this).rgb()}}));var Ee=e=>()=>e;function ze(e,t){var i=t-e;return i?function(e,t){return function(i){return e+i*t}}(e,i):Ee(isNaN(e)?t:e)}var Fe=function e(t){var i=function(e){return 1==(e=+e)?ze:function(t,i){return i-t?function(e,t,i){return e=Math.pow(e,i),t=Math.pow(t,i)-e,i=1/i,function(n){return Math.pow(e+n*t,i)}}(t,i,e):Ee(isNaN(t)?i:t)}}(t);function n(e,t){var n=i((e=ce(e)).r,(t=ce(t)).r),r=i(e.g,t.g),a=i(e.b,t.b),o=ze(e.opacity,t.opacity);return function(t){return e.r=n(t),e.g=r(t),e.b=a(t),e.opacity=o(t),e+""}}return n.gamma=e,n}(1),Ve=/^class(-pyramid)?/,je=function(e,t,i,n){var r=void 0!==i.min?i.min:n.min(),a=void 0!==i.max?i.max:n.max(),o=r,s=a,l=t.limits,u={},c="percent"===t.limitType?l.map((function(e){return r+(a-r)*e})):l,h=t.colors.map((function(t){return e.resolveUIColor(t)}));if(r=Math.min.apply(Math,[r].concat(M(c))),a=Math.max.apply(Math,[a].concat(M(c))),u.min=r,u.max=a,t.breakTypes&&-1===t.breakTypes.indexOf(!0))u.type="categorical",Object.assign(u,function(e){var t=e.min,i=e.max,n=e.limits,r=e.range,a=[],o=[];if(n.length)if(n[n.length-1]<t)o.push(t,i),a.push(r[r.length-1],r[r.length-1],r[r.length-1]);else if(n[0]>i)o.push(t,i),a.push(r[0],r[0],r[0]);else{if(n[0]>t)o.push(t),a.push(r[0]);else{o.push(t);for(var s=0;s<n.length;s++)if(t<n[s]){a.push(r[s]);break}}for(var l=0;l<n.length;l++)t<n[l]&&n[l]<i&&(o.push(n[l]),a.push(r[l]));if(n[n.length-1]<i)o.push(i),a.push(r[n.length]),a.push(r[n.length]);else{o.push(i);for(var u=0;u<n.length;u++)if(n[u]>i){a.push(r[u]),a.push(r[u]);break}}}else a.push(r[0]);return{min:t,max:i,range:a,domain:o}}({min:"percent"===t.limitType?r:o,max:"percent"===t.limitType?a:s,range:h,limits:"percent"===t.limitType?c:l}));else if(t.breakTypes){var f=t.breakTypes;u.type="continuous",u.domain=[r],u.range=[h[0]];for(var p=0;p<c.length;p+=1)if(f[p]){var d=h[p],m=h[p+1],g=Fe(d,m)(.5);u.range.push(g),u.domain.push(c[p]),p<c.length-1&&f[p+1]&&(u.range.push(h[p+1]),u.domain.push((c[p]+c[p+1])/2))}else u.range.push(h[p]),u.range.push(h[p+1]),u.domain.push(c[p]),u.domain.push(c[p]+Math.min(1e-6,(a-r)/1e6));u.range.push(h[h.length-1]),u.domain.push(a)}else u.domain=c,u.range=h;return u};function $e(e,t,i,n,r){var a,o,s,l=0,u=[],c=(e-t)/(n+1);if(0===c)return 1;for(a=0;a<i.length;a+=1)o=.99*(i[a]-t),s=i[a]>e?Math.floor(e/c):i[a]<t?0:Math.floor(o/c),Number.isNaN(s)||(u[s]?u[s]+=1:u[s]=1);for(a=0;a<u.length;a+=1)u[a]&&(l+=1);return l<=n||l>=r?Math.max(l,n):$e(e,t,i,n+1,r)}var He=function(e,t,i,n){var r,a,o=t.theme,s=t.hc,l=n.f,u={mode:"field",fieldType:"measure",field:l?l.key():void 0,reverse:i.input.reverseScheme||!1,type:"continuous",range:function(e){return e.resources.theme.palette("quant")}},c=[],h=!0;if(l){if(Number.isNaN(+l.min())||Number.isNaN(+l.max()))return{invalid:!0};(h=!("S"===(r=i.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))&&(c=i.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,M(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===i.input.autoMinMax){if(u.min=i.input.measureMin,u.max=i.input.measureMax,u.max<u.min)return{invalid:!0}}else if(l&&!h)u.min=l.min(),u.max=l.max();else if(l){if(!c.length)return{invalid:!0};u.min=Math.min.apply(Math,M(c)),u.max=Math.max.apply(Math,M(c))}if(i.input.measureScheme&&(u.palettes={quant:i.input.measureScheme}),o){var f=o.getDataColorScales().filter((function(e){return e.key===i.input.measureScheme}))[0];u.type=f&&Ve.test(f.type)?"categorical":"continuous","categorical"===u.type&&(a=f.colors.some((function(e){return Array.isArray(e)}))?Math.max.apply(Math,M(f.colors.map((function(e){return e?e.length:0})))):f.colors.length)}if("categorical"===u.type){for(var p=h?$e(u.max,u.min,c,1,a):a,d=(u.max-u.min)/p,m=[],g=0;g<p+1;g+=1)m.push(u.min+d*g);u.domain=m,u.range=function(e){for(var t=e.resources.theme.palette("quant",p),i=Math.max(1,Math.floor(t.length/p)),n=[],r=0;r<p;r+=1)n.push(t[r*i]);return[n[0]].concat(n,[n[n.length-1]])}}return u};function _e(e,t){var i;return t.activeMeasureIndex>=0?i=e.pic.fields().filter((function(e){return"measure"===e.type()}))[t.activeMeasureIndex]:"libraryItem"===t.type?i=e.pic.field((function(e){return e.raw().colorMapRef===t.key&&void 0!==t.key})):"expression"===t.type&&(i=e.pic.field((function(e){return"colorByAlternative"===e.raw().id}))),i||(i=e.pic.field((function(e){return void 0!==e.raw().matchMeasure})))&&(i=e.pic.fields().filter((function(e){return"measure"===e.type()}))[i.raw().matchMeasure]),i}function Be(e){e.measureOverrides.every((function(e){return!e}))&&(e.measureOverrides=null)}function We(e,t){for(var i=(null==t?void 0:t.domain)||[],n=(null==t?void 0:t.range)||[],r=[],a=0;a<e.length;++a){var o=e[a];if("constant"===(null==o?void 0:o.mode)){var s=i.indexOf(a);-1===s?(i.push(a),n.push(o.primary)):n[s]=o.primary,e[a]=null}else if(o){r.push(a);var l=i.indexOf(a);-1!==l&&(i.splice(l,1),n.splice(l,1))}}return{domain:i,range:n,exclude:r}}function Ue(e,t,i,n){var r,a=function(e,t,i,n){if(t.input&&!t.input.auto){if("byMeasure"===t.input.mode)return function(e,t,i){var n=t.theme,r=t.hc,a=(arguments.length>3&&void 0!==arguments[3]?arguments[3]:{}).getCField,o=void 0===a?_e:a,s=i.input.byMeasureDef||{activeMeasureIndex:0},l=o(i,s),u=He(0,{theme:n,hc:r},i,{f:l});if(u.invalid)return u;"expression"===s.type&&(s.activeMeasureIndex<0||void 0===s.activeMeasureIndex)&&(u.label=s.label,l&&"color.altLabel"===l.raw().labelExpRef&&(u.label=i.input.altLabel)),!u.label&&l&&(u.label=l.title());var c=s.activeMeasureIndex>=0?l:null;if(!c&&l&&void 0!==l.raw().matchMeasure&&l.raw().matchMeasure>-1&&(c=i.pic.fields().filter((function(e){return"measure"===e.type()}))[l.raw().matchMeasure]),i.input.useMeasureGradient&&"libraryItem"===s.type)if(c){var h=c.raw().coloring;h&&h.gradient&&z(u,je(e,h.gradient,u,c))}else u.auxiliary=s;return u}(e,i,t);if("byDimension"===t.input.mode)return function(e,t,i){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},r=n.getCDef,a=void 0===r?$:r,o=n.getCByField,s=void 0===o?H:o,l=n.getPersistence,u=void 0===l?j:l,c=a(t,i),h=s(i,c),f=h?h.raw():{},p=i&&i.pic?i.pic.raw():{};if(f.qError||f.qSize&&0===f.qSize.qcy&&!p.qHasOtherValues)return{invalid:!0};var d={mode:"field",fieldType:"dimension",type:"categorical",field:h?h.key():void 0,isFieldLocked:f.qLocked};return("expression"===c.type||c.activeDimensionIndex<0)&&(d.label=c.label,"color.altLabel"===f.labelExpRef&&(d.label=i.input.altLabel)),!d.label&&h&&(d.label=h.title()),i.input.dimensionScheme&&(d.palettes={categorical:i.input.dimensionScheme}),i.input.useDimColVal&&"libraryItem"===c.type&&(d.auxiliary=c),z(d,u(t,i,c,h,{byRow:V,byElemNo:F})),d}(e,i,t);if("byExpression"===t.input.mode)return function(e,t,i,n){var r=t.hc,a=t.theme,o=t.translator,s=i.pic.field((function(e){return"colorByExpression"===e.raw().id}));if(!s||!s.raw().qFallbackTitle&&!i.input.colorExpression||!(Number.isFinite(s.raw().qMin)&&Number.isFinite(s.raw().qMax)||i.input.expressionIsColor))return{mode:"constant",type:"constant",primary:n.nil};if(i.input.expressionIsColor)return{mode:"field",fieldType:"expression",field:s?s.key():void 0,type:"color"};var l=He(0,{hc:r,theme:a},i,{f:s});return l.invalid||(l.label=i.input.expressionLabel||o.get("Object.ChartTooltip.ColorExpression")),l}(0,i,t,n);if("byMultiple"===t.input.mode||"primary"===t.input.mode)return function(e,t,i,n){var r=t.hc,a=t.theme,o=t.translator,s=i.input.useBaseColors;if(("byMultiple"===i.input.mode||"primary"===i.input.mode&&"measure"===i.input.useBaseColors)&&r.qMeasureInfo.length>1&&(s="measure"),"measure"===s){var l=[],u=[];"measure"===i.input.useBaseColors&&r.qMeasureInfo.forEach((function(t,i){if(t.baseColor||t.coloring&&t.coloring.baseColor){l.push(i);var r=e.resolveUIColor(t.baseColor||t.coloring.baseColor);"none"===r?u.push(n.primary):u.push(r)}}));var c=i.input.dimensionScheme?{categorical:i.input.dimensionScheme}:void 0,h=a?a.getDataColorPalettes()[0]:void 0;return"measure"===i.input.useBaseColors&&h&&(c={categorical:h.key}),{mode:"measure",type:"categorical",palettes:c,label:o?o.get("Common.Measures"):void 0,explicit:l.length?{domain:l,range:u}:void 0}}if("dimension"===s){var f=[],p=[];return r.qDimensionInfo.forEach((function(t,i){if(t.baseColor||t.coloring&&t.coloring.baseColor){f.push(i);var r=e.resolveUIColor(t.baseColor||t.coloring.baseColor);"none"===r?p.push(n.primary):p.push(r)}})),{mode:"dimension",type:"categorical",field:f.length?f[0]:void 0,explicit:f.length?{domain:f,range:p}:void 0}}var d=n.primary;if(void 0!==i.input.paletteColor)i.input.paletteColor&&(d=e.resolveUIColor(i.input.paletteColor));else{var m=i.input.singleColor;"number"!=typeof m||Number.isNaN(m)||(d=["#b0afae","#7b7a78","#545352","#4477aa","#7db8da","#b6d7ea","#46c646","#f93f17","#ffcf02","#276e27","#ffffff","#000000"][m])}return{mode:"constant",type:"constant",primary:d}}(e,i,t,n)}return{}}(e,t,i,n);return null!==(r=t.input)&&void 0!==r&&r.measureOverrides?(a.measureOverrides=t.input.measureOverrides.map((function(i,r){return function(e){var t,i=e.cm,n=e.defaults,r=e.index,a=e.input,o=e.pic;if(!a||!a.on)return null;var s=null!==(t=a.mode)&&void 0!==t?t:"primary";return"primary"===s?function(e,t,i){var n=i.primary;return void 0!==t.paletteColor&&t.paletteColor&&(n=e.resolveUIColor(t.paletteColor)),b(b({},i),{},{mode:"constant",type:"constant",primary:n})}(i,a,n):"byExpression"===s?function(e,t,i){var n="qMeasureInfo/".concat(e,"/"),r=t.field((function(e){return e.id().startsWith(n)&&"colorByMeasureExpression"===e.raw().id})),a=r;return b(b({},i),{},a?{mode:"field",fieldType:"expression",field:r?r.key():void 0,type:"color"}:{mode:"constant",type:"constant",primary:i.nil})}(r,o,n):null}({cm:e,input:i,defaults:n,index:r,pic:t.pic})})),function(e,t){var i,n,r,a=t.translator;if(Be(e),1===(null===(i=e.measureOverrides)||void 0===i?void 0:i.length))return e.measureOverrides[0];if("measure"===e.mode&&e.measureOverrides&&(e.explicit=We(e.measureOverrides,e.explicit),Be(e)),null!==(n=e.measureOverrides)&&void 0!==n&&n.every((function(e){return"constant"===(null==e?void 0:e.mode)}))){var o={mode:"measure",type:"categorical",label:null==a?void 0:a.get("Common.Measures")};return o.explicit=We(e.measureOverrides),o}return null!==(r=e.measureOverrides)&&void 0!==r&&r.every((function(e){return e}))?{invalid:!0,measureOverrides:e.measureOverrides}:e}(a,i)):a}var Ge=function(e,t){var i=e.fieldType,n={};if(t)if("measure"===i){var r=t.coloring;r&&(n.measureGradient=r.gradient)}else if("dimension"===i){var a=t[0],o=t[1];a&&(n.legendDataPage=a),o&&(n.dimValsData=o.colorMap)}return n},Xe=function(e){throw e.isHandled=!0,e};function Ke(e){return function(t){return"object"===S(t.datum[e])?t.datum[e].value:void 0}}function Ze(e){return"object"===S(e.datum.isNull)?e.datum.isNull.value:-2===e.datum.value}function Ye(e){return-3===e.datum.value}var Qe={COLOR:void 0,FONT_SIZE:"16px",FONT_FAMILY:"'Source Sans Pro', 'Arial', 'sans-serif'"},Je={COLOR:void 0,FONT_SIZE:void 0,FONT_FAMILY:"'Source Sans Pro', 'Arial', 'sans-serif'"};function et(e){var t=e.theme,i=e.key,n=e.styleOverrides,r={title:{color:Qe.COLOR,fontSize:Qe.FONT_SIZE,fontFamily:Qe.FONT_FAMILY},label:{color:Je.COLOR,fontSize:Je.FONT_SIZE,fontFamily:Je.FONT_FAMILY}};if(!t&&!n)return r;var a=n||{},o=a.title,s=a.label,l=function(e){var t=e.theme,i=e.key;return function(e,n,r,a){return void 0!==e?e:t?t.getStyle(i,n,r):a}}({theme:t,key:i});return r.title.color=l(null==o?void 0:o.color,"legend.title","color",Qe.COLOR),r.title.fontSize=l(null==o?void 0:o.fontSize,"legend.title","fontSize",Qe.FONT_SIZE),r.title.fontFamily=l(null==o?void 0:o.fontFamily,"legend.title","fontFamily",Qe.FONT_FAMILY),r.label.color=l(null==s?void 0:s.color,"legend.label","color",Je.COLOR),r.label.fontSize=l(null==s?void 0:s.fontSize,"legend.label","fontSize",Je.FONT_SIZE),r.label.fontFamily=l(null==s?void 0:s.fontFamily,"legend.label","fontFamily",Je.FONT_FAMILY),r}var tt=function(e,t,i){var n=e&&e.dock||void 0;if("auto"!==n)return n||"right";if(t){var r=t.element.getBoundingClientRect();if(r.height>r.width)return"bottom"}return i?"left":"right"},it=function(e,t,i){return!(i.invalid||"color"===i.type||"measure"===i.mode&&t.qMeasureInfo.length<=1||"dimension"===i.mode)&&("function"==typeof e.show?e.show():!1!==e.show)};function nt(e,t){var i=e.styleReference,n=e.styleOverrides,r=e.chart,a=e.rtl,o=t.legendProps,s=t.coloring,l=t.theme,u=t.hc,c=et({theme:l,key:i,styleOverrides:n});return{layout:{minimumLayoutMode:"MEDIUM",dock:tt(o,r,a)},show:"function"==typeof o.show?function(){return it(o,u,s)}:it(o,u,s),renderer:"svg",mounted:function(e){e.childNodes[0].style.pointerEvents="none",e.style.overflow="hidden"},settings:{title:{show:!1!==o.showTitle,wordBreak:"break-word",maxLines:2,lineHeight:1.2,text:s.label||"",fill:c.title.color,fontSize:c.title.fontSize,fontFamily:c.title.fontFamily}}}}function rt(e,t,i){var n=[],r=[],a=function(e,t,i){return"categorical"===t.coloring.type?function(e,t,i){var n=nt(e,t);if(!n.show)return!1;var r,a=e.key,o=e.styleReference,s=e.styleOverrides,l=e.viewState,u=e.rtl,c=e.settings,h=e.style,f=t.scaleKey,p=t.theme,d=t.scales,m=et({theme:p,key:o,styleOverrides:s}),g=n.layout.dock,y="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 x="".concat(f,"Legend");return z(!0,n,{type:"legend-cat",key:"".concat(a,"-cat"),scale:x in d?x:f,settings:{layout:{scrollOffset:function(){return l?l.get("legendScrollOffset"):void 0},size:-1!==["top","bottom"].indexOf(n.layout.dock)?2:1,direction:u?"rtl":"ltr",horizontal:20},item:{show:r,label:b({fill:m.label.color,fontSize:m.label.fontSize,fontFamily:m.label.fontFamily},y)},navigation:{disabled:i,button:{content:function(e,t){var i=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[i]})])])}}}},brush:{consume:[{context:"selection",data:["",a],style:{inactive:{opacity:.3}}}]}},{settings:c,style:h})}(e,t,i):"continuous"===t.coloring.type&&function(e,t){var i,n=e.key,r=e.styleReference,a=e.styleOverrides,o=e.rtl,s=e.settings,l=e.style,u=t.scaleKey,c=t.theme,h="".concat(u,"Range"),f=nt(e,t);if(!f.show)return!1;var p=et({theme:c,key:r,styleOverrides:a}),d=f.layout.dock,m="right"===d||"left"===d,g=null===(i=t.scales)||void 0===i?void 0:i[h];return m&&g&&(g.invert=!0),z(!0,f,{type:"legend-seq",key:"".concat(n,"-seq"),settings:{fill:u,major:h,length:1,tick:{fill:p.label.color,fontSize:p.label.fontSize,fontFamily:p.label.fontFamily},title:{anchor:!o||"top"!==f.layout.dock&&"bottom"!==f.layout.dock?void 0:"right",padding:parseFloat(f.settings.title.fontSize)||16}}},{settings:s,style:l})}(e,t)}(e,t,i&&i.navigationDisabled);return n.push(a),a&&"legend-cat"===a.type&&(r.push(function(e){var t=e.key,i=e.requireFailure,n=e.recognizeWith,r=(arguments.length>1&&void 0!==arguments[1]?arguments[1]:{}).actions;return{key:"event:tap-".concat(t),type:"Tap",requireFailure:i,recognizeWith:n,options:{event:"legendtap",interval:10,pointers:1,enable:function(e,i){var n;if(!i)return!0;if(null!=r&&null!==(n=r.interact)&&void 0!==n&&n.enabled&&!r.interact.enabled())return!1;if(!this.chart.componentsFromPoint({x:i.center.x,y:i.center.y}).some((function(e){return e.key==="".concat(t,"-cat")})))return!1;var a=i.srcEvent.target;return!!(a&&a.hasAttribute("data-action")&&a.hasAttribute("data-component-key"))||!(!a||!a.childNodes[0]||"BUTTON"!==a.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,i)),r.push(function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.eventName,i=e.key,n=e.requireFailure,r=e.recognizeWith,a=(arguments.length>1&&void 0!==arguments[1]?arguments[1]:{}).actions;return{key:"event:pan-".concat(i),type:"Pan",requireFailure:n,recognizeWith:r,options:{event:t,pointers:1,threshold:10,enable:function(e,n){var r;return this.started===t||!n||!(null!=a&&null!==(r=a.interact)&&void 0!==r&&r.enabled&&!a.interact.enabled())&&this.chart.componentsFromPoint({x:n.center.x,y:n.center.y}).some((function(e){return e.key==="".concat(i,"-cat")}))}},events:y(y(y({},"".concat(t,"start"),(function(e){e.preventDefault(),this.started!==t&&(this.started=t,this.chart.component("".concat(i,"-cat")).emit("panstart",e))})),"".concat(t,"move"),(function(e){e.preventDefault(),this.chart.component("".concat(i,"-cat")).emit("panmove",e)})),"".concat(t,"end"),(function(e){e.preventDefault(),this.chart.component("".concat(i,"-cat")).emit("panend",e),this.started=!1}))}}(e,i))),{interactions:r,components:n}}function at(e){var t=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.auto,i=function(e){var t=b({hc:null,colorProps:null,layout:null,theme:null},e),i={},n={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?(n.auto=e,r):n.auto},getDimensionColorMap:function(e){return e?(n.getDimensionColorMap=e,r):n.getDimensionColorMap},getAttributeDimension:function(e){return e?(n.getAttributeDimension=e,r):n.getAttributeDimension},getMeasure:function(e){return e?(n.getMeasure=e,r):n.getMeasure},set:function(e){var r;if(!e.colorProps)throw new Error('Missing "colorProps"');if(z(t,e),(i={pic:t.picasso.data("q")({data:t.hc,config:{localeInfo:t.localeInfo}}),input:t.colorProps}).input.auto){var a=n.auto(e.layout);i.input=z(!0,{},i.input,a,{auto:!1});var o=t.theme?t.theme.getDataColorPalettes():[];o[0]&&(i.input.dimensionScheme=o[0].key);var s=0;i.input.byDimDef&&+i.input.byDimDef.activeDimensionIndex>=0&&(s=+i.input.byDimDef.activeDimensionIndex),t.hc&&t.hc.qDimensionInfo[s]&&t.hc.qDimensionInfo[s].coloring&&t.hc.qDimensionInfo[s].coloring.colorMapRef&&i.input.byDimDef&&(i.input.byDimDef.type="libraryItem",i.input.byDimDef.key=t.hc.qDimensionInfo[s].coloring.colorMapRef)}null!==(r=i.input.measureOverrides)&&void 0!==r&&r.every((function(e){return!e||!e.on}))&&(i.input=z(!1,{},i.input,{measureOverrides:null}))},palettes:function(){if(!i.palettes){var e=t.theme,n=[];(e&&e.getDataColorPickerPalettes()||[]).forEach((function(e){n.push({key:"ui",colors:e.colors})})),i.palettes=n}return i.palettes},getAuxiliaryData:function(e){var i=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 n.getMeasure(r,t).catch((function(){}));if("dimension"===e.fieldType){var a="".concat(i,"/").concat(e.field).replace("qDimensionInfo","qDimensions").replace("qAttrDimInfo","qAttributeDimensions");return Promise.all([/qAttrDimInfo/.test(e.field)?n.getAttributeDimension(a,t).catch((function(){})):Promise.resolve(),r?n.getDimensionColorMap(r,t).catch((function(){})):Promise.resolve()])}return Promise.resolve()},getAuxiliarySettings:function(e,n){var r=this;return e.auxiliary||/qAttrDimInfo/.test(e.field)?(this.palettes(),this.getAuxiliaryData(e,n).then((function(n){if(!n)return{};if("measure"===e.fieldType){if(n.coloring&&n.coloring.gradient){var a=i.pic.field(e.field);return je(r,n.coloring.gradient,e,a)}return{}}if("dimension"===e.fieldType){var o={nil:e.nil,others:e.others},s=n[0],l=n[1]?n[1].colorMap:null;if(s){var u=t.picasso.data("q")({data:{qDimensionInfo:[i.pic.field(e.field).raw(),i.pic.field(e.field).raw()],qMeasureInfo:[],qDataPages:s,qInterColumnSortOrder:[0,1],qMode:"S"}});o.legendDataset=u}return l?function(e,t,i,n){var r=n.external,a=n.field,o=b({},e);z(o,F(a,a.raw().qCardinal));var s=r.theme?r.theme.getDataColorPalettes()[0]:null;return t.nul&&(o.nil=i.resolveUIColor(t.nul)),t.oth&&(o.others=i.resolveUIColor(t.oth)),t.usePal?(o.palettes={categorical:t.pal},s&&!t.pal&&(o.palettes.categorical=s.key,z(o,F(a)))):!1===t.autoFill&&t.single?o.range=[i.resolveUIColor(t.single)]:t.autoFill&&(s&&(o.palettes={categorical:s.key}),z(o,F(a))),t.colors&&t.colors.length&&(o.explicit=function(e,t,i){for(var n={},r=0;r<e.length;r+=1)n[e[r].value]=e[r].baseColor;var a=[];return{domain:function(e){var r=e.data,o=[];a=[];for(var s=0;s<r.items.length;s++){var l=r.items[s],u=(l.text||l).label;n[u]&&-1===o.indexOf(l.value)&&(o.push(l.value),a.push(t.resolveUIColor(n[u])))}return o.push(-3,-2),a.push(i.others),a.push(i.nil),o},range:function(){return a}}}(t.colors,i,o)),o}(o,l,r,{external:t,field:i.pic.field(e.field)}):o}return{}}))):Promise.resolve()},resolveUIColor:function(e){if(e.index<0||void 0===e.index)return e.color;if(void 0===i.uiPalette&&(i.uiPalette=this.palettes().filter((function(e){return"ui"===e.key}))[0]||!1),!i.uiPalette)return e.color;var t="none"===i.uiPalette.colors[0]?e.index:e.index-1;return void 0===i.uiPalette.colors[t]?e.color:i.uiPalette.colors[t]},settings:function(){if(this.palettes(),!i.settings){var e={primary:"steelblue",others:"#aaa",nil:"#ddd"},n=t.theme;n&&(e=b(b({},e),n.getDataColorSpecials())),i.settings=z(e,Ue(this,i,t,e))}return i.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 i=t.layout,n=t.app;return i&&i.snapshotData?i.snapshotData.content&&i.snapshotData.content.chartData&&i.snapshotData.content.chartData.dimValsData?Promise.resolve({colorMap:i.snapshotData.content.chartData.dimValsData}):Promise.reject():n&&n.getObject?n.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 i=t.layout,n=t.app;return i&&i.snapshotData?i.snapshotData.content&&i.snapshotData.content.chartData&&i.snapshotData.content.chartData.measureGradient?Promise.resolve({coloring:{gradient:i.snapshotData.content.chartData.measureGradient}}):Promise.reject():n&&n.getMeasure?n.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 i=t.layout,n=t.model,r=t.app;return i&&i.snapshotData?i.snapshotData.content&&i.snapshotData.content.chartData&&i.snapshotData.content.chartData.legendDataPage?Promise.resolve(i.snapshotData.content.chartData.legendDataPage):Promise.reject():n&&n.session&&r?n.getHyperCubeData(e,[{qHeight:100,qLeft:0,qTop:0,qWidth:2}]).catch(Xe):Promise.reject()}(e,{layout:t.layout,model:t.model,app:t.app})}));return i.getSnapshotData=Ge,i}({resources:e}),i={},n={},r=function(e){return n.settings||(e||console.warn("settings() called before auxiliarySettings()"),n.settings=t.settings()),n.settings},a={config:function(r){if(i=b({},r),n={},!i.key)throw new Error("Missing key");t.set(b(b({},e),i))},auto:function(e){return e?(t.auto(e),a):t.auto()},getAuxiliarySettings:function(e){return n.auxiliarySettings?Promise.resolve(n.auxiliarySettings):t.getAuxiliarySettings(r(!0),e).then((function(e){return n.auxiliarySettings=e||{},n.settings=b(b({},n.settings),n.auxiliarySettings),n.scales=void 0,n.color=void 0,n.auxiliarySettings}))},getAuxiliaryData:function(){return t.getAuxiliaryData(r())},getSnapshotData:function(e){var i=r();return t.getAuxiliaryData(i,e).then((function(e){return t.getSnapshotData(i,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 i=t.isMeasureSelectionLocked;return"field"!==e.mode||("dimension"===e.fieldType?e.isFieldLocked:"measure"!==e.fieldType||i)}(r(),{isMeasureSelectionLocked:t})},palettes:function(){return function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.colorProps,i=e.coloring,n=e.theme,r=[];if(i&&i.palettes&&n){var a=i.palettes.categorical||t.dimensionScheme,o=n.getDataColorPalettes().filter((function(e){return e.key===a}))[0]||n.getDataColorPalettes()[0];a&&o&&r.push({key:"categorical",colors:o.colors});var s=i.palettes.metric||t.measureScheme,l=n.getDataColorScales().filter((function(e){return e.key===s}))[0]||n.getDataColorScales()[0];if(l){var u=l.colors[0]?l.colors:[[]].concat(M(l.colors.slice(1)));u=Array.isArray(u[0])?u.map((function(e){return e.slice().reverse()})):u.slice().reverse(),r.push({key:"quant",colors:u})}}return r}({coloring:r(),colorProps:i.colorProps,theme:i.theme})},scales:function(){return n.scales=n.scales||function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.hc,i=e.coloring,n=e.rtl,r=e.key,a=e.source,o=e.picasso,s={},l=r;if(i){var u={override:!0,domain:i.explicit&&"function"==typeof i.explicit.domain?i.explicit.domain:[].concat(M((i.explicit||{}).domain||[]),[-3,-2]),range:i.explicit&&"function"==typeof i.explicit.range?i.explicit.range:[].concat(M((i.explicit||{}).range||[]),[i.others,i.nil])};if("field"===i.mode){if("dimension"===i.fieldType){var c,h=function(e){var t=e.hc,i=e.source,n=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:i,field:n.field,trackBy:n.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:a,coloring:i}).data;if(i.legendDataset){var f=0,p={};o.data("q")({data:t}).extract({field:i.field,trackBy:i.valueAccessor,reduce:function(e){var t=e[0];return p[t]=f++,e[0]}}),c={source:"attrDim",extract:{field:"qDimensionInfo/0",filter:function(e){return e.qElemNumber>=0},props:{row:{value:function(e){return p[e.qElemNumber]}}}}}}var d={data:h,range:i.range,domain:i.domain,explicit:u,type:"categorical-color",label:function(e){return e.datum.text&&e.datum.text.value?e.datum.text.value:e.datum.label}};s[l]=d,c&&(s["".concat(l,"Legend")]=b(b({},d),{},{data:c})),t&&t.qHasOtherValues&&c&&((c||d.data).amend=[{label:t.qDimensionInfo[0].othersLabel,source:{key:"qHyperCube",field:"qDimensionInfo/0"},row:{value:-3},value:-3}])}else if("measure"===i.fieldType){var m={data:{field:i.field},min:i.min,max:i.max};s[l]=z({},m,{type:"categorical"===i.type?"threshold-color":"sequential-color",range:i.range,domain:i.domain,invert:i.reverse}),"sequential-color"===s[l].type&&(s["".concat(l,"Range")]=z({},m,{invert:!!n}))}else if("color"!==i.type)throw new Error("UNUSED FIELD")}else if("dimension"===i.mode){var g={data:t.qDimensionInfo.map((function(e,t){return t})),label:function(e){return t.qDimensionInfo[e.datum.value].qFallbackTitle},explicit:u,type:"categorical-color"};s[l]=g}else if("measure"===i.mode){var y={data:t.qMeasureInfo.map((function(e,t){return t})).filter((function(e){var t;return!(null!==(t=i.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:u,type:"categorical-color"};s[l]=y}}return s}({hc:i.hc,coloring:r(),key:i.key,source:i.source,picasso:e.picasso}),n.scales},color:function(){return n.color=n.color||function(e){var t=e.coloring,i=e.scales,n=e.key,r=Ke(n),a=Ke("".concat(n,"IsAnOther")),o=function(e,t){var n=e.fieldType,o=e.invalid,s=e.mode,l=e.nil,u=e.others,c=e.primary,h=e.type;return o?function(e){return Ye(e)||a(e)?u:l}:i[t]?function(e){return Ye(e)?u:Ze(e)||-2===r(e)&&"dimension"===n||"NaN"===r(e)?l:a(e)?u:e.resources.scale(t)(r(e))||u}:"constant"===s?function(e){return Ye(e)||a(e)?u:Ze(e)?l:c}:"color"===h?function(e){return Ye(e)||a(e)?u:Ze(e)?l:r(e)||u}:null},s=o(t,n);if(t.measureOverrides){var l=Ke("".concat(n,"MeasureIdx")),u=t.measureOverrides.map((function(e){return e&&o(e)}));return function(e){var t=l(e);return u[t]?u[t](e):s(e)}}return s}({coloring:r(),scales:this.scales(),key:i.key}),n.color},datumProps:function(e){return function(e){var t,i,n=e.hc,r=e.coloring,a=e.scales,o=e.key,s=e.addMeasureIx,l=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,u=o,c=r.nil;"field"===r.mode&&r.field?t=r.field:a[o]&&"field"===r.mode&&(t=a[o].data.field||r.field),t?(i={field:t,reduce:"first"},"color"===r.type&&(i.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&&oe(e.qText)?e.qText:c})):"dimension"===r.mode?i=void 0!==r.field?r.field:n.qDimensionInfo.length-1:"measure"===r.mode&&(i=l);var h=y({},u,i);return n.qDimensionInfo.length>1&&(h["".concat(u,"IsAnOther")]={fields:n.qDimensionInfo.map((function(e,t){return{field:"qDimensionInfo/".concat(t)}})),value:function(e){return-1!==e.indexOf(-3)}}),s&&(h["".concat(u,"MeasureIdx")]=l),h}({coloring:this.settingsForMeasure(e),scales:this.scales(),key:i.key,hc:i.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:i.localeInfo}}]:[t]},legend:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.eventName,n=e.key,a=e.viewState,o=e.chart,s=e.rtl,l=e.styleReference,u=void 0===l?"object.legend":l,c=e.styleOverrides,h=e.settings,f=void 0===h?{}:h,p=e.style,d=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return rt({eventName:t,key:n,rtl:s,viewState:a,chart:o,styleReference:u,styleOverrides:c,settings:f,style:void 0===p?{}:p},{legendProps:i.legendProps,scaleKey:i.key,coloring:r(),theme:i.theme,hc:i.hc,scales:this.scales()},d)}};return a}var ot=function(e){return e.baseColor||e.coloring&&e.coloring.baseColor};function st(e){var t=e.qHyperCube,i=t.qDimensionInfo,n=t.qMeasureInfo,r=i.some(ot),a=n.some(ot),o=e.color.useBaseColors;return"measure"===o&&!a||"dimension"===o&&!r?"off":o}var lt=function(e){return e.baseColor||e.coloring&&e.coloring.baseColor};function ut(e){var t,i=e.qHyperCube.qDimensionInfo.some(lt),n=e.qHyperCube.qMeasureInfo.some(lt),r=i?"dimension":void 0;return{mode:"primary",useBaseColors:null!==(t=null!=r?r:n?"measure":void 0)&&void 0!==t?t:"off",paletteColor:null}}var ct=function(){};function ht(e){var t,i,n,r,a=e.picasso,o=e.model,s=e.app,l=e.translator,u=e.layoutService,c=void 0===u?void 0:u,h=e.createConfig,f=void 0===h?ct:h,p=e.config,d=void 0===p?{}:p,m=e.custom,g=void 0===m?{}:m,y=d.localeInfo,v=d.key,x=d.theme,M=void 0===x?void 0:x,S=d.auto,k=void 0===S?void 0:S,w=d.definitionPath,N=null==c||null===(t=c.getLayout)||void 0===t?void 0:t.call(c),I={theme:M,key:v,localeInfo:y,layout:N,hc:null==c||null===(i=c.getHyperCube)||void 0===i?void 0:i.call(c),legendProps:null==c||null===(n=c.getLayoutValue)||void 0===n?void 0:n.call(c,"legend"),colorProps:b(b({},null==c||null===(r=c.getLayoutValue)||void 0===r?void 0:r.call(c,"color")),{},{useBaseColors:N?st(N):void 0})},D=at({picasso:a,model:o,app:s,translator:l,auto:k});!1!==k&&D.auto((function(e){return k?k({layout:e,defaultAuto:ut}):ut(e)}));var A=!1,L={getColor:function(){return D.color()},getPaletteColor:function(e){var t=e.index,i=e.color;return D.resolveUIColor({index:t,color:i})},getData:function(){return D.data()},getDatumProps:function(e){return D.datumProps(e)},getSnapshotData:function(){return D.getSnapshotData(w)},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:b({},g),initialize:function(){var e=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}).createConfig,t=(void 0===e?f:e)({getUseBaseColors:st}),i=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return b(b(b({},e),t),{},{colorProps:b(b({},e.colorProps),t.colorProps||{})})}(I,t);return D.config(i),D.getAuxiliarySettings(w).then((function(){A=!0}))}};return L}var ft="center",pt="bottom";function dt(e){var t=e.chart,i=e.logicalSize;if(i)return i;var n=t?t.element.getBoundingClientRect():{};return{width:n.width,height:n.height}}[{key:"NoDataExist",alignment:ft,condition:function(e){var t=e.layoutService;if(!t)return!1;var i=t.meta.size;return i.x*i.y==0}},{key:"OnlyNanDataMeasure",translationKey:"OnlyNanData",alignment:ft,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:ft,condition:function(e){var t=e.layoutService;if(!t)return!1;if(!t.meta.isContinuous)return!1;var i=t.getHyperCubeValue("qDimensionInfo.0");return i&&(i.qMax<i.qMin||"NaN"===i.qMax)}},{key:"OnlyNegativeOrZeroValues",alignment:ft},{key:"DataRangeIncludingZero",alignment:pt},{key:"LimitedData",alignment:pt},{key:"NegativeOrZeroValues",alignment:pt}].reduce((function(e,t){return e[t.key]=t,e}),{});var mt=[{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 gt(e){var t=e.width,i=e.height,n=mt.filter((function(e){return t>=e.size.width&&i>=e.size.height})).shift();return n?n.key:"SPARK"}var yt={left:"right",right:"left",top:"bottom",bottom:"top",near:"far",far:"near"};function vt(e){var t=e.orientation,i=e.dock,n=e.btt,r=e.rtl,a="horizontal"===t?function(e){return"bottom"===e||"near"===e?"bottom":"top"}(i):function(e,t){var i="left"===e||"near"===e?"left":"right";return t?yt[i]:i}(i,r),o=function(e,t,i){return"vertical"===e?t?"bottom":"top":i?"right":"left"}(t,n,r);return{current:a,opposite:yt[a],start:o,end:yt[o]}}function bt(e){var t=e.chart,i=e.layoutService,n=e.config,r=void 0===n?{}:n,a=r.logicalSize,o=void 0!==a&&a,s=r.rtl,l=void 0!==s&&s,u={chart:{size:void 0,mode:void 0},x:{dock:void 0,opposite:void 0,size:void 0},y:{dock:void 0,opposite:void 0,size:void 0}},c={type:"x-y",config:b({},r),meta:u,update:function(e){u.chart.size={width:e.width,height:e.height},u.chart.mode=gt(e);var t=vt({orientation:"horizontal",dock:i.getLayoutValue("xAxis.dock"),btt:!1,rtl:l}),n=t.current,r=t.opposite;u.x.dock=n,u.x.opposite=r,u.x.size=e.width;var a=vt({orientation:"vertical",dock:i.getLayoutValue("yAxis.dock"),btt:!0,rtl:l}),o=a.current,s=a.opposite;u.y.dock=o,u.y.opposite=s,u.y.size=e.height}};return c.update(dt({chart:t,logicalSize:o})),c}var xt="vertical",Mt="horizontal";function St(e){var t=e.chart,i=e.layoutService,n=e.config,r=void 0===n?{}:n,a=e.typeConfig,o=void 0===a?{}:a,s=r.logicalSize,l=void 0!==s&&s,u=r.rtl,c=void 0!==u&&u,h=o.fallback===xt?xt:Mt,f=!!o.invert,p=o.measureAxes||[{ref:"measureAxis",name:"minor"}],d={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:b({},r),meta:d,update:function(e){d.chart.orientation=i.getLayoutValue("orientation",h),d.chart.size={width:e.width,height:e.height},d.chart.mode=gt(e),d.major.orientation=function(e){var t=e.chartOrientation,i=e.invert;return e.layoutService.meta.isContinuous?Mt:i?t===xt?Mt:xt:t}({layoutService:i,chartOrientation:d.chart.orientation,invert:f});var t=vt({orientation:d.major.orientation,dock:i.getLayoutValue("dimensionAxis.dock"),btt:!1,rtl:c}),n=t.current,r=t.opposite;d.major.dock=n,d.major.opposite=r,d.major.size=d.major.orientation===xt?e.height:e.width,p.forEach((function(t){var n={};n.orientation=d.major.orientation===xt?Mt:xt;var r=vt({orientation:n.orientation,dock:i.getLayoutValue("".concat(t.ref,".dock")),btt:!0,rtl:c}),a=r.current,o=r.opposite,s=r.start,l=r.end;n.dock=a,n.opposite=o,n.start=s,n.end=l,n.size=n.orientation===xt?e.height:e.width,d[t.name]=n}))}};return m.update(dt({chart:t,logicalSize:l})),m}function kt(e){var t=e.chart,i=e.layoutService,n=e.config,r=void 0===n?{}:n,a=e.typeConfig,o=void 0===a?{}:a;return("x-y"===o.type?bt:St)({chart:t,layoutService:i,config:r,typeConfig:o})}function wt(e,t,i){if(void 0===e||void 0===t)return i;for(var n=t.split("."),r=e,a=0;a<n.length;++a){var o=n[a];if(void 0===r[o])return i;r=r[o]}return r}var Nt=["__proto__","constructor"];function It(e,t,i){if(void 0!==e&&void 0!==t){var n=t.split("."),r=n[n.length-1];if(!Nt.some((function(e){return n.includes(e)}))){for(var a=e,o=0;o<n.length-1;++o){var s=n[o];void 0===a[s]&&(a[s]=Number.isNaN(+n[o+1])?{}:[]),a=a[s]}void 0!==i?a[r]=i:delete a[r]}}}var Dt,At={ERROR_CODES:[7005],DIMENSION:"qDimensionInfo",MEASURE:"qMeasureInfo"},Lt=function(e,t){return e[t].reduce((function(e,t,i){var n;return n=t,At.ERROR_CODES.some((function(e){var t;return e===(null===(t=n.qError)||void 0===t?void 0:t.qErrorCode)}))?e.filtered.push(i):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,i=null===(t=e.qCardinalities)||void 0===t?void 0:t.qHypercubeCardinal;if(i)return i;var n=e.qStateCounts||{},r=n.qLocked,a=void 0===r?0:r,o=n.qOption,s=void 0===o?0:o,l=n.qSelected;return a+s+(void 0===l?0:l)}))}function qt(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 Pt(e){var t=0,i=e.children,n=i&&i.length;if(n)for(;--n>=0;)t+=i[n].value;else t=1;e.value=t}function Tt(e,t){e instanceof Map?(e=[void 0,e],void 0===t&&(t=Rt)):void 0===t&&(t=Ot);for(var i,n,r,a,o,s=new Ft(e),l=[s];i=l.pop();)if((r=t(i.data))&&(o=(r=Array.from(r)).length))for(i.children=r,a=o-1;a>=0;--a)l.push(n=r[a]=new Ft(r[a])),n.parent=i,n.depth=i.depth+1;return s.eachBefore(zt)}function Ot(e){return e.children}function Rt(e){return Array.isArray(e)?e[1]:null}function Et(e){void 0!==e.data.value&&(e.value=e.data.value),e.data=e.data.data}function zt(e){var t=0;do{e.height=t}while((e=e.parent)&&e.height<++t)}function Ft(e){this.data=e,this.depth=this.height=0,this.parent=null}Ft.prototype=Tt.prototype={constructor:Ft,count:function(){return this.eachAfter(Pt)},each:function(e,t){let i=-1;for(const n of this)e.call(t,n,++i,this);return this},eachAfter:function(e,t){for(var i,n,r,a=this,o=[a],s=[],l=-1;a=o.pop();)if(s.push(a),i=a.children)for(n=0,r=i.length;n<r;++n)o.push(i[n]);for(;a=s.pop();)e.call(t,a,++l,this);return this},eachBefore:function(e,t){for(var i,n,r=this,a=[r],o=-1;r=a.pop();)if(e.call(t,r,++o,this),i=r.children)for(n=i.length-1;n>=0;--n)a.push(i[n]);return this},find:function(e,t){let i=-1;for(const n of this)if(e.call(t,n,++i,this))return n},sum:function(e){return this.eachAfter((function(t){for(var i=+e(t.data)||0,n=t.children,r=n&&n.length;--r>=0;)i+=n[r].value;t.value=i}))},sort:function(e){return this.eachBefore((function(t){t.children&&t.children.sort(e)}))},path:function(e){for(var t=this,i=function(e,t){if(e===t)return e;var i=e.ancestors(),n=t.ancestors(),r=null;for(e=i.pop(),t=n.pop();e===t;)r=e,e=i.pop(),t=n.pop();return r}(t,e),n=[t];t!==i;)t=t.parent,n.push(t);for(var r=n.length;e!==i;)n.splice(r,0,e),e=e.parent;return n},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(i){i!==e&&t.push({source:i.parent,target:i})})),t},copy:function(){return Tt(this).eachBefore(Et)},[Symbol.iterator]:function*(){var e,t,i,n,r=this,a=[r];do{for(e=a.reverse(),a=[];r=e.pop();)if(yield r,t=r.children)for(i=0,n=t.length;i<n;++i)a.push(t[i])}while(a.length)}},Dt=function(e){
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 i,n,r,a,o,s,l,u,c,h,f=e.length,p=e.search(/[0-9\-\+#]/),d=p>0?e.substring(0,p):"",m=e.split("").reverse().join(""),g=m.search(/[0-9\-\+#]/),y=f-g,v=e.substring(y,y+1),b=y+("."===v||","===v?1:0),x=g>0?e.substring(b,f):"";if(i=(t="-"===(e=e.substring(p,b)).charAt(0)?-t:+t)<0?t=-t:0,r=(n=e.match(/[^\d\-\+#]/g))&&n[n.length-1]||".",a=n&&n[1]&&n[0]||",",e=e.split(r),t=+(t=t.toFixed(e[1]&&e[1].length))+"",s=e[1]&&e[1].lastIndexOf("0"),(!(u=t.split("."))[1]||u[1]&&u[1].length<=s)&&(t=(+t).toFixed(s+1)),c=e[0].split(a),e[0]=c.join(""),(o=e[0]&&e[0].indexOf("0"))>-1)for(;u[0].length<e[0].length-o;)u[0]="0"+u[0];else 0==+u[0]&&(u[0]="");if((t=t.split("."))[0]=u[0],l=c[1]&&c[c.length-1].length){for(m="",y=(h=t[0]).length%l,f=h.length,b=0;b<f;b++)m+=h.charAt(b),!((b-y+1)%l)&&b<f-l&&(m+=a);t[0]=m}return t[1]=e[1]&&t[1]?r+t[1]:"","0"!==(n=t.join(""))&&""!==n||(i=!1),d+(i?"-":"")+n+x}},Dt({exports:{}});var Vt="'Source Sans Pro', 'Arial', 'sans-serif'",jt="#333333",$t="#595959",Ht="#737373",_t="#cccccc",Bt="#e6e6e6";function Wt(e){var t={};return[].concat(M(e),M([["","","color"],["object","","fontFamily"],["object","axis.label.name","color",$t],["object","axis.label.name","fontFamily",Vt],["object","axis.label.name","fontSize","12px"],["object","axis.line.major","color",_t],["object","axis.line.minor","color",Bt],["object","axis.title","color"],["object","axis.title","fontFamily",Vt],["object","axis.title","fontSize","13px"],["object","grid.line.highContrast","color",Bt],["object","grid.line.major","color",_t],["object","grid.line.minor","color",Bt],["object","label.value","color",$t],["object","label.value","fontFamily",Vt],["object","label.value","fontSize","12px"],[!1,"label.value","darkColor",$t],[!1,"label.value","lightColor",Bt],["object","outOfRange","color","#999"],["object","legend.title","color",jt],["object","legend.title","fontFamily",Vt],["object","legend.title","fontSize","15px"],["object","legend.label","color",$t],["object","legend.label","fontFamily",Vt],["object","legend.label","fontSize","13px"],["object","referenceLine.label.name","color",jt],["object","referenceLine.label.name","fontFamily",Vt],["object","referenceLine.label.name","fontSize","12px"],["object","referenceLine.outOfBounds","color",Bt],["object","referenceLine.outOfBounds","fontFamily",Vt],["object","referenceLine.outOfBounds","fontSize","12px"],["object","referenceLine.outOfBounds","backgroundColor",Ht,function(e){return"transparent"===e?Ht:e}]])).reduce((function(e,i){var n="".concat(i[0],"-").concat(i[1],"-").concat(i[2],"}");return t[n]||(t[n]=!0,e.push(i)),e}),[]).sort((function(e,t){return(e[0].split?e[0].split(".").length:0)-(t[0].split?t[0].split(".").length:0)}))}var Ut=function(e){return e};function Gt(e){var t=e.theme,i=e.id,n=e.transform,r=e.extend,a=e.matrix,o={},s=n.reduce((function(e,t){var i=x(t,2),n=i[0],r=i[1];return e[n]=r,e}),{});return a.forEach((function(e){var n=x(e,5),r=n[0],a=n[1],l=n[2],u=n[3],c=n[4],h=void 0===c?function(e){return e}:c,f=function(e){var t=e.theme,i=e.base,n=e.path,r=e.attribute,a=e.defaultValue,o=void 0===a?void 0:a;if(!t||!1===i)return o;var s=t.getStyle(i,n,r);return void 0===s?o:s}({theme:t,base:"object"===r&&i?"".concat("object",".").concat(i):r,path:a,attribute:l,defaultValue:u}),p=(s["".concat(a,".").concat(l)]||Ut)(h(f));It(o,[a,l].filter(Boolean).join("."),p)})),r.forEach((function(e){var t=x(e,2),i=t[0],n=t[1];It(o,i,n)})),o}const Xt=(e,t,i)=>{const n=function(e){var t=e.theme,i=e.translator,n=e.config,r=void 0===n?{}:n,a=e.flags,o=function(e){var t=e.config,i=void 0===t?{}:t,n=i.id,r=i.paths;return{id:void 0===n?"object":"".concat("object",".").concat(n),paths:Array.isArray(r)?r:[]}}({config:r}),s=o.id,l=o.paths,u={};l.forEach((function(e){for(var n=e.split("."),r=u,o=0;o<n.length;o++){var l=n[o];o===n.length-1?r[l]=O({theme:t,translator:i,id:s,path:e,flags:a}):void 0===r[l]&&(r[l]={}),r=r[l]}}));var c=function(e){for(var t=e.split("."),i=u,n=0;n<t.length;n++){var r=t[n];if(void 0===i[r])throw new Error("font-resolver: Path '".concat(e,"' could not be resolved."));i=i[r]}return i};return u.getDefaultValue=function(e){return c(e).getDefaultValue()},u.getOptions=function(e){return c(e).getOptions()},u}({theme:i,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:()=>n.getOptions("axis.title.fontFamily"),defaultValue:()=>n.getDefaultValue("axis.title.fontFamily")},fontColor:{ref:"axis.title.color",component:"color-picker",defaultValue:()=>({color:i.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:()=>n.getOptions("axis.label.name.fontFamily"),defaultValue:()=>n.getDefaultValue("axis.label.name.fontFamily"),width:!0},fontColor:{ref:"axis.label.name.color",component:"color-picker",defaultValue:()=>({color:i.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:()=>n.getOptions("label.value.fontFamily"),defaultValue:()=>n.getDefaultValue("label.value.fontFamily"),width:!0},fontColor:{ref:"label.value.color",component:"color-picker",defaultValue:()=>({color:i.getStyle("object.gauge","label.value","color")}),width:!1}}}}}}}}}};function Kt(e){return"measure"===wt(e,"color.useBaseColors")}function Zt(e){const{flags:t,translator:i,sense:n}=e,r=n.theme;return{definition:{type:"items",component:"accordion",items:{data:{uses:"data"},addons:{type:"items",component:"expandable-items",translation:"properties.addons",items:{dataHandling:{uses:"dataHandling",items:{suppressZero:null,calcCond:{uses:"calcCond"}}},refLines:{uses:"reflines",items:{colorBackground:{show:!1}}}}},settings:{type:"items",uses:"settings",component:"expandable-items",translation:"Common.Appearance",items:{simpleLabels:{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,i,n)=>"labels"===n.measureAxis.show||"none"===n.measureAxis.show,set(e,t,i,n,r){r.measureAxis.show=e?"labels":"all"}}}}}}},presentation:{type:"items",grouped:!0,translation:"properties.presentation",items:{styleEditor:Xt(t,i,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"}]},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=(i=e.segmentInfo).paletteColors&&i.paletteColors.length?i.paletteColors:i.colors&&i.colors.length?i.colors:void 0;var i;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:()=>{var e;if(!r)return-1;const{primary:t}=r.getDataColorSpecials(),i=null===(e=r.getDataColorPickerPalettes()[0])||void 0===e?void 0:e.colors,n=i.indexOf(t);return{index:-1===n?Math.min(6,i.length-1):n}},show:e=>!Kt(e)&&!e.useSegments},maxSegments:{ref:"maxSegments",type:"number",defaultValue:6,show:!1},segmentInfo:{ref:"segments",type:"items",component:"color-scale-creator",show:e=>!Kt(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",translation:"properties.measureAxis",grouped:!0,items:{axis:{type:"items",snapshot:{title:"properties.measureAxis",tid:"property-yAxis"},items:{show:{ref:"measureAxis.show",translation:"properties.axis.labelsAndTitle",type:"string",component:"dropdown",options:[{value:"all",translation:"properties.axis.show.all"},{value:"labels",translation:"properties.axis.show.labels"},{value:"title",translation:"properties.axis.show.title"},{value:"none",translation:"Common.None"}],defaultValue:"all"},spacing:{ref:"measureAxis.spacing",translation:"properties.axis.scale",type:"number",component:"dropdown",defaultValue:1,show: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}}}const Yt=52,Qt=-2*Math.PI/3,Jt=2*Math.PI/3,ei="#EEEEEE",ti=2.38,ii={MIN:12,MAX:60},ni={MIN:100,MAX:1e3},ri={TOP:-4,BOTTOM:0,LEFT:4,RIGHT:4},ai={VERTICAL_ALIGNMENT_FACTOR:.4},oi={VERTICAL_ALIGNMENT_FACTOR:1.25},si=1.2,li={DARK:"#595959",LIGHT:"#E6E6E6"},ui=.4,ci=1,hi=2,fi=.75,pi=.75,di={MAX_WIDTH:150,MAX_LINES:2,CLEARANCE:12,ESTIMATED_LINE_HEIGHT:16,GAP:8},mi=70,gi=3,yi={MEASURE:"measure"},vi={BAR:"bar",LABEL_BAR:"label-bar",BACKGROUND_BAR:"background-bar",OOB_INDICATOR:"oob-indicator",BAR_AXIS:"bar-axis",AXIS_TITLE:"axis-title",GAUGE_LABEL:"gauge-label",RADIAL_GAUGE_NEEDLE:"radial-gauge-needle",RADIAL_OOB_INDICATOR:"radial-oob-indicator",RADIAL_GAUGE:"radial-gauge",REFERENCE_LINES_AND_LABELS:"reference-lines-and-labels",RADIAL_SPARK:"radial-spark",RADIAL_GAUGE_LABEL:"radial-gauge-label"},bi="XSMALL",xi="SMALL",Mi="XSMALL_VERTICAL",Si="XSMALL_HORIZONTAL",ki="SMALL",wi={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}},Ni=600,Ii=200,Di=500;function Ai(e,t,i){e.prototype=t.prototype=i,i.constructor=e}function Li(e,t){var i=Object.create(e.prototype);for(var n in t)i[n]=t[n];return i}function Ci(){}var qi=.7,Pi=1/qi,Ti="\\s*([+-]?\\d+)\\s*",Oi="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",Ri="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",Ei=/^#([0-9a-f]{3,8})$/,zi=new RegExp(`^rgb\\(${Ti},${Ti},${Ti}\\)$`),Fi=new RegExp(`^rgb\\(${Ri},${Ri},${Ri}\\)$`),Vi=new RegExp(`^rgba\\(${Ti},${Ti},${Ti},${Oi}\\)$`),ji=new RegExp(`^rgba\\(${Ri},${Ri},${Ri},${Oi}\\)$`),$i=new RegExp(`^hsl\\(${Oi},${Ri},${Ri}\\)$`),Hi=new RegExp(`^hsla\\(${Oi},${Ri},${Ri},${Oi}\\)$`),_i={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 Bi(){return this.rgb().formatHex()}function Wi(){return this.rgb().formatRgb()}function Ui(e){var t,i;return e=(e+"").trim().toLowerCase(),(t=Ei.exec(e))?(i=t[1].length,t=parseInt(t[1],16),6===i?Gi(t):3===i?new Yi(t>>8&15|t>>4&240,t>>4&15|240&t,(15&t)<<4|15&t,1):8===i?Xi(t>>24&255,t>>16&255,t>>8&255,(255&t)/255):4===i?Xi(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=zi.exec(e))?new Yi(t[1],t[2],t[3],1):(t=Fi.exec(e))?new Yi(255*t[1]/100,255*t[2]/100,255*t[3]/100,1):(t=Vi.exec(e))?Xi(t[1],t[2],t[3],t[4]):(t=ji.exec(e))?Xi(255*t[1]/100,255*t[2]/100,255*t[3]/100,t[4]):(t=$i.exec(e))?rn(t[1],t[2]/100,t[3]/100,1):(t=Hi.exec(e))?rn(t[1],t[2]/100,t[3]/100,t[4]):_i.hasOwnProperty(e)?Gi(_i[e]):"transparent"===e?new Yi(NaN,NaN,NaN,0):null}function Gi(e){return new Yi(e>>16&255,e>>8&255,255&e,1)}function Xi(e,t,i,n){return n<=0&&(e=t=i=NaN),new Yi(e,t,i,n)}function Ki(e){return e instanceof Ci||(e=Ui(e)),e?new Yi((e=e.rgb()).r,e.g,e.b,e.opacity):new Yi}function Zi(e,t,i,n){return 1===arguments.length?Ki(e):new Yi(e,t,i,null==n?1:n)}function Yi(e,t,i,n){this.r=+e,this.g=+t,this.b=+i,this.opacity=+n}function Qi(){return`#${nn(this.r)}${nn(this.g)}${nn(this.b)}`}function Ji(){const e=en(this.opacity);return`${1===e?"rgb(":"rgba("}${tn(this.r)}, ${tn(this.g)}, ${tn(this.b)}${1===e?")":`, ${e})`}`}function en(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function tn(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function nn(e){return((e=tn(e))<16?"0":"")+e.toString(16)}function rn(e,t,i,n){return n<=0?e=t=i=NaN:i<=0||i>=1?e=t=NaN:t<=0&&(e=NaN),new on(e,t,i,n)}function an(e){if(e instanceof on)return new on(e.h,e.s,e.l,e.opacity);if(e instanceof Ci||(e=Ui(e)),!e)return new on;if(e instanceof on)return e;var t=(e=e.rgb()).r/255,i=e.g/255,n=e.b/255,r=Math.min(t,i,n),a=Math.max(t,i,n),o=NaN,s=a-r,l=(a+r)/2;return s?(o=t===a?(i-n)/s+6*(i<n):i===a?(n-t)/s+2:(t-i)/s+4,s/=l<.5?a+r:2-a-r,o*=60):s=l>0&&l<1?0:o,new on(o,s,l,e.opacity)}function on(e,t,i,n){this.h=+e,this.s=+t,this.l=+i,this.opacity=+n}function sn(e){return(e=(e||0)%360)<0?e+360:e}function ln(e){return Math.max(0,Math.min(1,e||0))}function un(e,t,i){return 255*(e<60?t+(i-t)*e/60:e<180?i:e<240?t+(i-t)*(240-e)/60:t)}Ai(Ci,Ui,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:Bi,formatHex:Bi,formatHex8:function(){return this.rgb().formatHex8()},formatHsl:function(){return an(this).formatHsl()},formatRgb:Wi,toString:Wi}),Ai(Yi,Zi,Li(Ci,{brighter(e){return e=null==e?Pi:Math.pow(Pi,e),new Yi(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=null==e?qi:Math.pow(qi,e),new Yi(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new Yi(tn(this.r),tn(this.g),tn(this.b),en(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:Qi,formatHex:Qi,formatHex8:function(){return`#${nn(this.r)}${nn(this.g)}${nn(this.b)}${nn(255*(isNaN(this.opacity)?1:this.opacity))}`},formatRgb:Ji,toString:Ji})),Ai(on,(function(e,t,i,n){return 1===arguments.length?an(e):new on(e,t,i,null==n?1:n)}),Li(Ci,{brighter(e){return e=null==e?Pi:Math.pow(Pi,e),new on(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=null==e?qi:Math.pow(qi,e),new on(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,i=this.l,n=i+(i<.5?i:1-i)*t,r=2*i-n;return new Yi(un(e>=240?e-240:e+120,r,n),un(e,r,n),un(e<120?e+240:e-120,r,n),this.opacity)},clamp(){return new on(sn(this.h),ln(this.s),ln(this.l),en(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=en(this.opacity);return`${1===e?"hsl(":"hsla("}${sn(this.h)}, ${100*ln(this.s)}%, ${100*ln(this.l)}%${1===e?")":`, ${e})`}`}}));const cn=Math.PI/180,hn=180/Math.PI,fn=.96422,pn=.82521,dn=4/29,mn=6/29,gn=3*mn*mn,yn=mn*mn*mn;function vn(e){if(e instanceof bn)return new bn(e.l,e.a,e.b,e.opacity);if(e instanceof Nn)return In(e);e instanceof Yi||(e=Ki(e));var t,i,n=kn(e.r),r=kn(e.g),a=kn(e.b),o=xn((.2225045*n+.7168786*r+.0606169*a)/1);return n===r&&r===a?t=i=o:(t=xn((.4360747*n+.3850649*r+.1430804*a)/fn),i=xn((.0139322*n+.0971045*r+.7141733*a)/pn)),new bn(116*o-16,500*(t-o),200*(o-i),e.opacity)}function bn(e,t,i,n){this.l=+e,this.a=+t,this.b=+i,this.opacity=+n}function xn(e){return e>yn?Math.pow(e,1/3):e/gn+dn}function Mn(e){return e>mn?e*e*e:gn*(e-dn)}function Sn(e){return 255*(e<=.0031308?12.92*e:1.055*Math.pow(e,1/2.4)-.055)}function kn(e){return(e/=255)<=.04045?e/12.92:Math.pow((e+.055)/1.055,2.4)}function wn(e,t,i,n){return 1===arguments.length?function(e){if(e instanceof Nn)return new Nn(e.h,e.c,e.l,e.opacity);if(e instanceof bn||(e=vn(e)),0===e.a&&0===e.b)return new Nn(NaN,0<e.l&&e.l<100?0:NaN,e.l,e.opacity);var t=Math.atan2(e.b,e.a)*hn;return new Nn(t<0?t+360:t,Math.sqrt(e.a*e.a+e.b*e.b),e.l,e.opacity)}(e):new Nn(e,t,i,null==n?1:n)}function Nn(e,t,i,n){this.h=+e,this.c=+t,this.l=+i,this.opacity=+n}function In(e){if(isNaN(e.h))return new bn(e.l,0,0,e.opacity);var t=e.h*cn;return new bn(e.l,Math.cos(t)*e.c,Math.sin(t)*e.c,e.opacity)}function Dn(e){return function(e){return wn(e).l<70}(e)?li.LIGHT:li.DARK}function An(e,t=!0){let i="";for(let t=0;t<e.length;t++){const n=e[t];i+=0===t?`M${n.x} ${n.y}`:`L${n.x} ${n.y}`,i+=" "}return t&&(i+="Z"),i}function Ln(e){const{angle:t,origin:i}=e,n=e.points.map((e=>function(e,t,i={x:0,y:0}){const n=Math.cos(t),r=Math.sin(t),a=(s=i,{x:(o=e).x-s.x,y:o.y-s.y});var o,s;return function(e,t){return{x:e.x+t.x,y:e.y+t.y}}({x:n*a.x-r*a.y,y:r*a.x+n*a.y},i)}(e,t,i)));return{type:"path",fill:e.fill,d:An(n)}}Ai(bn,(function(e,t,i,n){return 1===arguments.length?vn(e):new bn(e,t,i,null==n?1:n)}),Li(Ci,{brighter(e){return new bn(this.l+18*(null==e?1:e),this.a,this.b,this.opacity)},darker(e){return new bn(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,i=isNaN(this.b)?e:e-this.b/200;return new Yi(Sn(3.1338561*(t=fn*Mn(t))-1.6168667*(e=1*Mn(e))-.4906146*(i=pn*Mn(i))),Sn(-.9787684*t+1.9161415*e+.033454*i),Sn(.0719453*t-.2289914*e+1.4052427*i),this.opacity)}})),Ai(Nn,wn,Li(Ci,{brighter(e){return new Nn(this.h,this.c,this.l+18*(null==e?1:e),this.opacity)},darker(e){return new Nn(this.h,this.c,this.l-18*(null==e?1:e),this.opacity)},rgb(){return In(this).rgb()}}));const Cn={require:["chart","symbol"],defaultSettings:{settings:{},style:{}},render(){var e;return function({chart:e,settings:t,symbol:i}){if(!e||!t||!i)return[];const{size:n,component:r,selector:a,pointingTo:o}=t;if(!e.component(t.component))return[];const s=e.findShapes(a).filter((e=>e.key===r));if(null==s||!s.length)return[];const{clientWidth:l,clientHeight:u}=e.element;let c=l/2,h=u/2,f=-Math.PI/2;const p=n/3;switch(o){case"top":h=p;break;case"bottom":h=u-p,f=3*Math.PI/2-Math.PI;break;case"right":c=l-p,f=0;break;case"left":c=p,f=Math.PI}const d=[];for(let e=0;e<s.length;e+=1){const t=s[e],i=Dn(["top","right"].includes(o)?t.attrs.fill:ei),r={x:c,y:h},a=n/6,l=Ln({points:[{x:r.x+2*a,y:r.y},{x:r.x,y:r.y+a},{x:r.x,y:r.y-a}],angle:f,fill:i,origin:r});d.push(l)}return d}({chart:this.chart,settings:null===(e=this.settings)||void 0===e?void 0:e.settings,symbol:this.symbol})}};function qn(e,t,i,n){const r=Math.floor(Math.min(e,t)),a=Math.abs(n-i),o=.02*Math.tan(-a/4+Math.PI/2),s=2*(.4+o)-En(e,t)/r;return{innerRadius:s-2*(r>500?50:Math.max(r/Di*50,10))/r,outerRadius:s,radiusIncrease:o}}function Pn(e,t,i,n){const r=n-Math.PI/2;return{x:e+i*Math.cos(r),y:t+i*Math.sin(r)}}function Tn(e,t){const i=e.getColor()({datum:{value:()=>0}});return t?"#595959":i}function On({innerRadius:e,outerRadius:t,width:i,height:n}){return(t-e)*Math.min(i,n)/2}function Rn(e){return!1!==e.show&&0!==e.show&&"0"!==e.show}function En(e,t){return Math.min(6,Math.min(e,t)/Ii)}const zn={require:["chart","symbol"],defaultSettings:{settings:{},style:{}},render(){var e;return function({chart:e,settings:t,symbol:i}){if(!e||!t||!i)return[];const{valueAngle:n}=t;if(!e.component(t.component))return[];const{clientWidth:r,clientHeight:a}=e.element,{outerRadius:o,innerRadius:s}=qn(r,a,Qt,Jt),l=On({innerRadius:s,outerRadius:o,width:r,height:a});let u=Pn(r/2,a/2,o*Math.min(r,a)/2,t.valueAngle),c=u.x,h=u.y;const f=[],p=Dn(ei),d={x:c,y:h},m=l/6,g=Ln({points:[{x:d.x,y:d.y},{x:d.x-8*m,y:d.y+m},{x:d.x-8*m,y:d.y-m}],angle:n-Math.PI/2,fill:p,origin:d});return f.push(g),f}({chart:this.chart,settings:null===(e=this.settings)||void 0===e?void 0:e.settings,symbol:this.symbol})}};const Fn={require:["chart","symbol"],defaultSettings:{settings:{},style:{}},render(){var e;return function({chart:e,settings:t,symbol:i}){if(!e||!t||!i)return[];const{size:n,component:r,selector:a,angle:o,radius:s}=t;if(!e.component(t.component))return[];const l=e.findShapes(a).filter((e=>e.key===r));if(null==l||!l.length)return[];const{clientWidth:u,clientHeight:c}=e.element;let h=u/2,f=c/2,{x:p,y:d}=Pn(h,f,s,o);const m=[],g=t.fill,y=o===Qt?-1:1,v={x:p,y:d},b=n/6,x=Ln({points:[{x:v.x+(2*b+1)*y,y:v.y+.5},{x:v.x+1*y,y:v.y+b+.5},{x:v.x+1*y,y:v.y-b+.5}],angle:o,fill:g,origin:v});return m.push(x),m}({chart:this.chart,settings:null===(e=this.settings)||void 0===e?void 0:e.settings,symbol:this.symbol})}};function Vn(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var jn=Object.prototype.hasOwnProperty,$n=Object.prototype.toString,Hn=Object.defineProperty,_n=Object.getOwnPropertyDescriptor,Bn=function(e){return"function"==typeof Array.isArray?Array.isArray(e):"[object Array]"===$n.call(e)},Wn=function(e){if(!e||"[object Object]"!==$n.call(e))return!1;var t,i=jn.call(e,"constructor"),n=e.constructor&&e.constructor.prototype&&jn.call(e.constructor.prototype,"isPrototypeOf");if(e.constructor&&!i&&!n)return!1;for(t in e);return void 0===t||jn.call(e,t)},Un=function(e,t){Hn&&"__proto__"===t.name?Hn(e,t.name,{enumerable:!0,configurable:!0,value:t.newValue,writable:!0}):e[t.name]=t.newValue},Gn=function(e,t){if("__proto__"===t){if(!jn.call(e,t))return;if(_n)return _n(e,t).value}return e[t]},Xn=function e(){var t,i,n,r,a,o,s=arguments[0],l=1,u=arguments.length,c=!1;for("boolean"==typeof s&&(c=s,s=arguments[1]||{},l=2),(null==s||"object"!=typeof s&&"function"!=typeof s)&&(s={});l<u;++l)if(null!=(t=arguments[l]))for(i in t)n=Gn(s,i),s!==(r=Gn(t,i))&&(c&&r&&(Wn(r)||(a=Bn(r)))?(a?(a=!1,o=n&&Bn(n)?n:[]):o=n&&Wn(n)?n:{},Un(s,{name:i,newValue:e(c,o,r)})):void 0!==r&&Un(s,{name:i,newValue:r}));return s},Kn=Vn(Xn);let Zn;function Yn(){Zn=Zn||document.createElement("canvas").getContext("2d")}const Qn={measureTextWidth(e){Yn();const{width:t}=Zn.measureText(e);return t},lineWrap(e,t,i,n){let r,a;Yn();const o=e?e.split(/\n+|\r+|\r\n/):[],s=[];let l,u,c,h,f=e?e.split(/\s+/):[],p=o[0];if("number"!=typeof t||t<=0)return[e];if("number"==typeof n&&o.length>=n)return o.slice(0,n);for(i&&(Zn.font=i),a=0;a<o.length;a++){for(h=o[a],f=h.split(/\s+/),[p]=f,c="",r=1;r<f.length;r++)if(l=`${p} ${f[r]}`,u=Qn.measureTextWidth(l),u>t&&("number"!=typeof n||n>s.length)?(s.push(p),p=f[r]):p=l,"number"==typeof n&&s.length>=n){c=f.slice(r+1).join(" ");break}"number"!=typeof n||s.length<n?s.push(p):s[Math.max(0,s.length-1)]=`${s[Math.max(0,s.length-1)]} ${p} ${c}`}return s},wordWrap(e,t,i,n,r){if(Yn(),!e||!e.length)return[];i&&(Zn.font=i);let a=[];const o=e.slice();let s,l,u,c="";if(o.filter((e=>!!e)),"number"!=typeof t||t<0)return e.slice();for(u=0;u<o.length;u++){var h;if(l=o[u],c="",l.length<=1||Qn.measureTextWidth(l)<=t)a.push(l);else if(s=Qn.splitWord(l,t,void 0,void 0===n?void 0:n-a.length),s.length<=1)a.push(s[0]);else c=null!==(h=s.pop())&&void 0!==h?h:"",a=a.concat(s),o[u+1]?Qn.measureTextWidth(`${c} ${o[u+1]}`)>t&&(void 0===n||a.length+o.length-u<=n)?o.splice(u+1,0,c):o[u+1]=`${c} ${o[u+1]}`:o.push(c)}return a.forEach(((e,t,i)=>{i[t]=e.trim()})),void 0!==n&&a.length>n?(a=a.splice(0,n),a[a.length-1]=Qn.truncate(a[a.length-1],t,i,r).text):(l=a[a.length-1],l&&l.length>1&&Qn.measureTextWidth(l)>t&&(a[a.length-1]=Qn.truncate(l,t,i,r).text)),a},truncate(e,t,i,n="…"){Yn();let r,a,o,s,l=e;const u=Qn.measureTextWidth("i");if(i&&(Zn.font=i),e&&t){if(Qn.measureTextWidth(l)>t){const e=Math.ceil(t/u);for(r=Math.min(e,l.length);r>0;r--)if(a=l.substring(0,r-1),o=a.trim()+n,Qn.measureTextWidth(o)<=t){s=l.substring(r-1),l=o;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,i,n){let r;Yn();let a,o=e,s="",l=[];if(void 0!==i&&Qn.isNumber(i)&&i<=1)return[e];const u=Math.ceil(t/n);for(r=Math.min(e.length,u);r>0&&(o=e.substring(0,r),a=e.substring(r-1,r)," "===a?o=e.substring(0,r-1):o+="-",s=e.substring(r),!(Qn.measureTextWidth(o)<=t));r--);return(!r&&!o||Qn.measureTextWidth(o)>t)&&(o=e.substring(0,1),s=e.substring(1)),l.push(o),s?(Qn.measureTextWidth(s)>t?l=l.concat(Qn.explodeWord(s,t,void 0===i?void 0:i-1,n)):l.push(s),l.filter((e=>""!==e.trim()))):l},splitWord:(e,t,i,n)=>(Yn(),e&&t?(i&&(Zn.font=i),Qn.explodeWord(e,t,n,Math.max(1,Qn.measureTextWidth("i")))):[]),wrapText(e,t,i,n,r="…"){let a;return Number.isNaN(t)||!t?[e]:(a=void 0===n||n>1?Qn.lineWrap(e,t,i,n):[e],a=Qn.wordWrap(a,t,i,n,r),a)},getFontHeight:e=>(Yn(),e&&(Zn.font=e),1.5*Qn.measureTextWidth("m")),tokenize(e,t,i,n,r,a,o=1){Yn(),t&&(Zn.font=t);const s=Qn.getFontHeight(),l=o*s;let u=[],c=[];if(void 0!==a&&a<s)return[];const h=a?Math.max(1,Math.floor(a/l)):n||1;return u=[void 0===n||Number.isNaN(n)||n<=0?h:Math.min(h,n)],Array.isArray(e)?e.forEach(((e,i)=>{c.length<h&&(c=c.concat(Qn.wrapText(e,r,t,u[i])))})):c=Qn.wrapText(e,r,t,u[0],i),c}};function Jn({chart:e,renderer:t,refLine:i,settings:n,width:r,height:a,barWidth:o}){if(!e||!t||!n)return{};const{position:s,scale:l,value:u,label:c,line:h,formatter:f}=i,p=i.radius?i.radius*(Math.min(r,a)/2):r/2,d=(Jt-Qt)*s+Qt-Math.PI/2,m={x:r/2,y:a/2};let g=Kn(!0,{},n.style.line,h||{});const y={type:"line",...{x1:m.x+Math.cos(d)*p,y1:m.y+Math.sin(d)*p,x2:m.x+Math.cos(d)*(p+o),y2:m.y+Math.sin(d)*(p+o)},stroke:g.stroke,strokeWidth:g.strokeWidth,strokeDasharray:g.strokeDasharray};let v;if(c){const i=Kn(!0,{fill:"#000",fontFamily:"Arial",fontSize:"12px",opacity:1,padding:5,background:{fill:"#fff",stroke:"transparent",strokeWidth:0,opacity:.5}},n.style.label||{},{fill:g.stroke},c),{fontFamily:s,fontSize:h,fill:y,opacity:b}=i,x=c.showLabel?i.text:"";let M,S="";if("string"==typeof f||"object"==typeof f)M=e.formatter(f);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!==c.showValue&&(M?S=` (${M("function"==typeof u?u():u)})`:l&&(S=` (${u})`));const k=e=>t.measureText({text:e,fontFamily:s,fontSize:h}),w=k("M").height,N=`normal ${h} ${s}`;let I,D=gi;const A=`${x}${S}`||"",L=Math.min(r,a),C=Math.min(8,L/200),q=Pn(m.x,m.y,p+o+C,d+Math.PI/2),P=k(A).width;I=Math.min(q.x,r-q.x-ti,mi),D=function(e,t,i){const n=Math.min(Math.floor((e+ti)/t),Math.floor((i-e)/t));return Math.min(n,gi)}(q.y,w,a);let T=Qn.tokenize(A,N,`... ${S}`,D,I,void 0);const O=function(e){let t="start";const i=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:i}}(d);q.y-2*w>0&&q.y+2*w<a&&(q.x-P+ti<0&&"end"===O.textAnchor||q.x+P-ti>r)&&(T=Qn.tokenize(A,N,`... ${S}`,D,I,void 0)),v={fill:y,opacity:b,fontFamily:s,fontSize:h,linePosition:q,lineHeight:w,align:"left",baseline:O.baseline,textAnchor:O.textAnchor,lines:T}}return{lineNode:y,labelNode:v}}const er={require:["chart","renderer"],defaultSettings:{style:{line:{stroke:"#000"}}},render(){var e,t;let{settings:i,chart:n,renderer:r,rect:a}=this;if(!(n&&a&&i&&r))return[];const{width:o,height:s}=a,l=null!==(e=null==i||null===(t=i.settings)||void 0===t?void 0:t.barWidth)&&void 0!==e?e:0;let u=(null==i?void 0:i.lines)&&i.lines.radial||[];if(0===u.length)return[];u=u.map((e=>{if("function"==typeof e.value&&(e.value=e.value()),e.scale){let t=null==n?void 0:n.scale("string"==typeof e.scale?e.scale:"");const i=t(e.value);return Kn(e,{scale:t,position:i})}return Kn(e,{position:e.value})}));const c=[];let h=[];[...u].forEach((e=>{if(e.position>0&&e.position<1){const{lineNode:t,labelNode:a}=Jn({chart:n,renderer:r,refLine:e,settings:i,width:o,height:s,barWidth:l});t&&c.push(t),a&&h.push(a)}}));const f=[];h.forEach((e=>{const{fill:t,opacity:i,fontFamily:n,fontSize:r,lines:a,lineHeight:o,textAnchor:s,linePosition:l,baseline:u}=e,c=l,h=a.length-1,p=a.map(((e,a)=>{let l=c.y;return h>0&&("baseline"===u?l-=(h-a)*o:l+=a*o),{type:"text",text:e,baseline:u,anchor:s,fill:t,opacity:i,fontFamily:n,fontSize:r,x:c.x,y:l}}));f.push(...p)}));const{MEDIUM:p,SMALLER:d}=wi,m=o>=p.width&&s>=p.height;return[...o>=d.width&&s>=d.height?c:[],...m?f:[]]}};const tr={require:["chart","symbol"],defaultSettings:{settings:{},style:{}},render(){var e;return function({chart:e,settings:t,symbol:i}){if(!e||!t||!i)return[];const{valueAngle:n}=t,{clientWidth:r,clientHeight:a}=e.element,o=.4*Math.min(r,a),s=[],l=t.fill,u={x:r/2,y:a/2},c=Ln({points:[{x:u.x-o/2,y:u.y+o/2},{x:u.x,y:u.y-o},{x:u.x+o/2,y:u.y+o/2}],angle:n,fill:l,origin:u});return s.push(c),s}({chart:this.chart,settings:null===(e=this.settings)||void 0===e?void 0:e.settings,symbol:this.symbol})}},ir={getGap(e,t){const i=e.position<t.position?e:t,n=e.position<t.position?t:e;return n.position-n.radius-(i.position+i.radius)},findSegmentPositionMeetMaxThenMin(e,t,i){const n=e.position+e.radius,r=e.position-Math.max(0,n-i),a=r-e.radius;return r+Math.max(0,t-a)},layoutPositionFromMin(e,t,i,n=0){const r=e.length-1;let a,o,s,l=t;for(let t=0;t<r;t++)a=e[t],o=e[t+1],s=(a.position+o.position)/2-n/2,a.position=ir.findSegmentPositionMeetMaxThenMin(a,l,s),l=a.position+a.radius+n;o&&(o.position=ir.findSegmentPositionMeetMaxThenMin(o,l,i))},adjustPositionFromMax(e,t,i,n=0){const r=e.length-1,a=Math.max(0,e[r].position+e[r].radius-i);if(0===a)return;let o,s,l,u,c=0;for(o=r;o>0&&(s=e[o],l=e[o-1],u=Math.max(0,ir.getGap(l,s)-n),u-=Math.max(0,c+u-a),c+=u,s.move=u,!(c>=a));o--);for(c<a&&l&&(u=Math.max(0,l.position-l.radius-t),u-=Math.max(0,c+u-a),c+=u,l.move=u),c=0,o=0;o<=r;o++)s=e[o],c+=s.move||0,s.move=c,s.position-=c},createLayout(e,t,i,n=0){const r=e.map((e=>e.segment)),a=r.length-1;if(a<0)return[];if(0===a){const e=r[0];e.position=ir.findSegmentPositionMeetMaxThenMin(e,t,i)}else ir.layoutPositionFromMin(r,t,i,n),ir.adjustPositionFromMax(r,t,i,n);return e.filter((e=>{const n=Math.ceil(e.segment.position-e.segment.radius),r=e.segment.position+e.segment.radius;return n>=t&&r<=i}))}};const nr={require:["chart","renderer"],defaultSettings:{style:{line:{stroke:"#000"}}},render(){var e,t;let{settings:i,chart:n,renderer:r,rect:a}=this;if(!(n&&a&&i&&r))return[];const{width:o,height:s}=a,l=null!==(e=null==i||null===(t=i.settings)||void 0===t?void 0:t.barWidth)&&void 0!==e?e:0,u=(null==i?void 0:i.lines)&&i.lines.x||[],c=(null==i?void 0:i.lines)&&i.lines.y||[];let h=u.length>0?u:c;if(0===h.length)return[];const f=u.length>0;h=h.map((e=>{if("function"==typeof e.value&&(e.value=e.value()),e.scale){let t=null==n?void 0:n.scale("string"==typeof e.scale?e.scale:"");const i=t(e.value);return Kn(e,{scale:t,position:i})}return Kn(e,{position:e.value})}));const p=[];let d=[];if([...h].forEach((e=>{if(Rn(e)&&e.position>0&&e.position<1){const{lineNode:t,labelNode:a}=function({chart:e,renderer:t,refLine:i,settings:n,width:r,height:a,isVerticalRefLine:o,barWidth:s}){if(!e||!t||!n)return{};const{position:l,scale:u,value:c,label:h,line:f,formatter:p}=i;let d=Kn(!0,{},n.style.line,f||{});const m={type:"line",...o?{x1:l*r,x2:l*r,y1:a/2-s/2,y2:a/2+s/2}:{x1:r/2-s/2,x2:r/2+s/2,y1:l*a,y2:l*a},stroke:d.stroke,strokeWidth:d.strokeWidth,strokeDasharray:d.strokeDasharray};let g;if(h){const i=Kn(!0,{fill:"#000",fontFamily:"Arial",fontSize:"12px",opacity:1,padding:5,background:{fill:"#fff",stroke:"transparent",strokeWidth:0,opacity:.5}},n.style.label||{},{fill:d.stroke},h),{fontFamily:f,fontSize:m,fill:y,opacity:v}=i,b=h.showLabel?i.text:"";let x,M="";if("string"==typeof p||"object"==typeof p)x=e.formatter(p);else if(void 0!==u&&"string"!=typeof u&&"function"==typeof u.data){const e=u.data()&&u.data().fields;x=e&&e[0]?e[0].formatter():null}!1!==h.showValue&&(x?M=` (${x("function"==typeof c?c():c)})`:u&&(M=` (${c})`));const S=e=>t.measureText({text:e,fontFamily:f,fontSize:m}),k=S("M").height,w=`normal ${m} ${f}`,N=o?di.MAX_WIDTH:r/2-s/2-di.CLEARANCE,I=o?2:1,D=`${b}${M}`||"",A=Qn.tokenize(D,w,`... ${M}`,I,N,void 0),L=(o?r:a)*l,C=Math.min(N,Math.max(...A.map((e=>S(e).width)))),q=A.length*k;g={fill:y,opacity:v,fontFamily:f,fontSize:m,linePosition:L,lineHeight:k,lines:A,segment:{position:L,radius:o?C/2:q/2}}}return{lineNode:m,labelNode:g}}({chart:n,renderer:r,refLine:e,settings:i,width:o,height:s,isVerticalRefLine:f,barWidth:l});t&&p.push(t),a&&d.push(a)}})),f)d=ir.createLayout(d,0,o,di.GAP);else{const{attrs:e}=n.findShapes("text").filter((e=>e.key===vi.GAUGE_LABEL))[0],{"font-size":t}=e,i=parseFloat(t);let r=d.filter((t=>t.segment.position<e.y)),a=d.filter((t=>t.segment.position>e.y));r.sort(((e,t)=>e.segment.position-t.segment.position)),a.sort(((e,t)=>e.segment.position-t.segment.position)),r=ir.createLayout(r,0,e.y-i/2),a=ir.createLayout(a,e.y+i/2,s),d=[...r,...a]}const m=[],g=[];d.forEach((e=>{const{fill:t,opacity:i,fontFamily:n,fontSize:r,lines:a,segment:u,linePosition:c,lineHeight:h}=e,{position:p}=u;if(c!==p&&""!==e.lines[0]){let e={x1:o/2+l/2,x2:o/2+l/2+.75*di.CLEARANCE,y1:c,y2:p};f&&(e={y1:s/2+l/2,y2:s/2+l/2+di.CLEARANCE,x1:c,x2:p});const i={type:"line",...e,stroke:t,strokeWidth:1};g.push(i)}const d=a.map(((e,a)=>{let u=f?s/2+l/2+h/2+di.CLEARANCE:p;return u+=a*h,{type:"text",text:e,baseline:"central",anchor:f?"middle":"start",fill:t,opacity:i,fontFamily:n,fontSize:r,x:f?p:o/2+l/2+di.CLEARANCE,y:u}}));m.push(...d)}));const{MEDIUM:y,SMALLER:v}=wi,b=o>=y.width&&s>=y.height;return[...o>=v.width&&s>=v.height?p:[],...b?m:[],...b?g:[]]}},rr=()=>{const e=t(),a=i(),[o,s]=n({});return r((()=>{e.style.overflow="hidden";const t=m();t.use(d),t.component("oob-indicator",Cn),t.component("radial-gauge-needle",zn),t.component("radial-custom-ref-line",er),t.component("custom-ref-line",nr),t.component("radial-oob-indicator",Fn),t.component("radial-spark",tr);const i=t({renderer:{prio:[a.renderer||"svg"]}}),n=i.chart({element:e,data:[],settings:{}});return s({picassoInstance:i,chart:n}),()=>{n.destroy()}}),[]),o},ar=({core:e,services:t,settings:i})=>{r((()=>{if(!i||!e||!t)return;const{chart:n}=e;n&&n.update({data:[{type:"q",key:"qHyperCube",data:t.layoutService.getHyperCube()},...t.colorService.getData()],settings:i})}),[e,i])};function or({layout:e,options:t}){return e.snapshotData&&!t.freeResize?{width:e.snapshotData.content.size.w,height:e.snapshotData.content.size.h}:void 0}function sr(e,t,i){if(e>=i)return 1;if(e<=t)return 0;const n=Math.min(1,Math.max(0,(e-t)/(i-t)));return Number.isNaN(n)?0:n}function lr({chart:e,layoutService:t,dockService:i}){const{width:n,height:r}=i.meta.chart.size,{isVertical:a}=t.meta,o=Math.min(Yt,a?n/10:r/10),s=a?r:n;function l(){const{min:e,max:i}=t.meta.rangeLimits,n=t.meta.qHyperCube.qDataPages[0].qMatrix[0][0].qNum;return s*sr(n,e,i)}const u={getBottomPadding(e){if(a){const t=l()+-e.height*ai.VERTICAL_ALIGNMENT_FACTOR,i=ri.BOTTOM,n=s-e.height-ri.TOP;return t<i?i:t>n?n:t}const{MAX_LINES:i,ESTIMATED_LINE_HEIGHT:u,CLEARANCE:c}=di,h=function(){const{MEDIUM:e}=wi,i=n>=e.width&&r>=e.height,{refLines:a}=t.meta;return a&&a.filter(Rn).length>0&&i}()?i*u+c:0;return-o*oi.VERTICAL_ALIGNMENT_FACTOR-h},getTopPadding:e=>-u.getBottomPadding(e),getLeftPadding(e){if(a)return n/5+o;const t=l()-e.width/2,i=ri.RIGHT,r=s-e.width-ri.LEFT;return t<i?i:t>r?r:t},getRightPadding:e=>-u.getLeftPadding(e)},c={getLeftPadding(t){if(!a)return 0;const i=e.findShapes("container").filter((e=>e.key===vi.BAR_AXIS));if(1!==i.length)return 0;const r=i[0],s=Math.max(...r.children.filter((e=>"text"===e.type)).map((e=>e.bounds.width))),l=Math.max(...r.children.filter((e=>"line"===e.type)).map((e=>e.bounds.width)));let u=o/2+s+l+o*pi;return u>n/2-t.height/4&&(u=n/2-t.height/4),-u},getRightPadding:e=>-c.getLeftPadding(e),getTopPadding(){if(a)return-4;const t=e.findShapes("container").filter((e=>e.key===vi.BAR_AXIS));if(1!==t.length)return 0;const i=t[0],n=Math.max(...i.children.filter((e=>"text"===e.type)).map((e=>e.bounds.height))),r=Math.max(...i.children.filter((e=>"line"===e.type)).map((e=>e.bounds.height)));return-(o/2+n+r+o*fi)},getBottomPadding:()=>-c.getTopPadding()};return{getBarWidthInPixels:()=>o,getValueLabelFontSize:function(e,t){const i=sr(Math.min(r,n),ni.MIN,ni.MAX);return e+Math.round(i*(t-e))},barValueLabel:u,barAxisTitle:c}}const ur=({core:e})=>{const t=a(),f=o(),p=s(),d=l(),m=u(),g=i(),y=c(),{qLocaleInfo:v}=h(),[x,M]=n(null);return r((()=>{if(!t||!e)return;const{picassoInstance:i,chart:n}=e;if(!n)return;const r=function(e){var t=e.source,i=e.metaAdditionsFn,n=e.experimental,r=void 0===n?{filter:!1}:n,a=z(!0,{},t),o=r.filter?function(e){var t=e.qHyperCube,i=Lt(t,At.DIMENSION),n=i.reduced,r=i.filtered;t[At.DIMENSION]=n;var a=Lt(t,At.MEASURE),o=a.reduced,s=a.filtered;return t[At.MEASURE]=o,{dimensions:r,measures:s}}(a):{dimensions:[],measures:[]},s=qt(a),l=function(){var e=function(e){var t=e.layout,i=e.additionsFn,n=void 0===i?function(){return{}}:i,r=e.additionsProps,a=void 0===r?{}:r,o=t.qHyperCube,s=o.qDimensionInfo,l=o.qMeasureInfo,u=o.qMode,c=s.length,h=l.length,f=b({mode:{S:"S"===u,P:"P"===u,K:"K"===u,T:"T"===u},dimensionCount:c,measureCount:h,hasMultipleDimensions:c>1,hasMultipleMeasures:h>1,isOneDimensional:1===c,isTwoDimensional:2===c},a);return b(b({},f),n({layout:t,meta:f}))}({layout:a,additionsFn:i,additionsProps:{size:s.size}});return e.filteredFields=o,e},u={refs:b({},s.refs),meta:l(),getLayout:function(){return a},getLayoutValue:function(e,t){return wt(a,e,t)},setLayoutValue:function(e,t){It(a,e,t),s=qt(a),u.meta=l()},getHyperCube:function(){return a.qHyperCube},getHyperCubeValue:function(e,t){return wt(a.qHyperCube,e,t)},setHyperCubeValue:function(e,t){It(a.qHyperCube,e,t),s=qt(a),u.meta=l()},getDataPages:function(){return wt(a,s.refs.dataPages)},setDataPages:function(e){It(a,s.refs.dataPages,e),u.meta=l()}};return u}({source:t,metaAdditionsFn:function({layout:e}){var t;const{measureAxis:i,qHyperCube:n,autoOrientation:r,gaugetype:a,useSegments:o,segmentInfo:s,refLine:l}=e,u=null===(t=e.qHyperCube)||void 0===t?void 0:t.qMeasureInfo[0].qFallbackTitle,{width:c,height:h}=m;let f=e.orientation;r&&(f=c>=h?"horizontal":"vertical");const p="vertical"===f,d=function({measureAxis:e,qHyperCube:t}){if(!e||!t)return{min:0,max:1};let{min:i,max:n}=e;if(i=Number(i),n=Number(n),i!==n)return{min:Math.min(i,n),max:Math.max(i,n)};const r=t.qDataPages[0].qMatrix[0][0].qNum;let a=Math.abs(r-i)/2;return 0===a&&(a=0!==i?Math.abs(i)/2:Number.MAX_VALUE/2),{min:i-a,max:n+a}}({measureAxis:i,qHyperCube:n}),g=(null==l?void 0:l.refLines)||[];return{measureAxisTitle:u,measureAxisSpacing:null==i?void 0:i.spacing,rangeLimits:d,qHyperCube:n,orientation:f,autoOrientation:r,gaugetype:a,isVertical:p,useSegments:o,segmentInfo:s,refLines:g}}}),a=or({layout:r.getLayout(),options:g}),o=kt({chart:n,layoutService:r,config:{logicalSize:a},typeConfig:{type:"major-minor",fallback:"vertical",invert:!0}}),s=ht({app:p,model:d,translator:y,picasso:i,layoutService:r,config:{key:"color",localeInfo:v,theme:f,auto:()=>({mode:"primary",byMeasureDef:{activeMeasureIndex:0,type:"expression",label:""}})}}),l=function(e){var t=e.theme,i=e.config,n=void 0===i?{}:i,r=n.id,a=n.resolve,o=void 0===a?[]:a,s=n.transform,l=void 0===s?[]:s,u=n.extend,c=void 0===u?[]:u,h={theme:t,matrix:Wt(o),styles:void 0};return h.styles=Gt({theme:t,id:r,transform:l,extend:c,matrix:h.matrix}),{getStyles:function(){return h.styles},getTheme:function(){return h.theme},setTheme:function(e){h.theme=e,h.styles=Gt({theme:e,id:r,transform:l,extend:c,matrix:h.matrix})}}}({theme:f,config:{id:"gauge"}}),u=lr({chart:n,layoutService:r,dockService:o}),c=function({layoutService:e,themeService:t,colorService:i}){const n=t.getStyles(),r=t=>{var i;return null===(i=e.getLayoutValue("components",[]))||void 0===i?void 0:i.find((e=>e.key===t))},a=e=>e?i.getPaletteColor(e):void 0;return{query:{axis:{title:{getStyle:()=>{var e,t,i,o;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:n.axis.title.fontFamily,fontSize:n.axis.title.fontSize,color:null!==(i=a(null===(o=r("axis"))||void 0===o||null===(o=o.axis)||void 0===o||null===(o=o.title)||void 0===o?void 0:o.color))&&void 0!==i?i:n.axis.title.color}}},label:{getStyle:()=>{var e,t,i,o;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:n.axis.label.name.fontFamily,fontSize:n.axis.label.name.fontSize,fill:null!==(i=a(null===(o=r("axis"))||void 0===o||null===(o=o.axis)||void 0===o||null===(o=o.label)||void 0===o||null===(o=o.name)||void 0===o?void 0:o.color))&&void 0!==i?i:n.axis.label.name.color}}}},label:{getStyle:()=>{var e,t,i,o;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:n.label.value.fontFamily,fill:null!==(i=a(null===(o=r("value"))||void 0===o||null===(o=o.label)||void 0===o||null===(o=o.value)||void 0===o?void 0:o.color))&&void 0!==i?i:n.label.value.color}}}}}}({layoutService:r,themeService:l,colorService:s});M({layoutService:r,colorService:s,dockService:o,labelService:u,themeService:l,styleService:c})}),[d,p,t,f.name(),y.language(),e,m]),x};function cr({width:e,height:t,fontSize:i}){const{FULL:n}=wi;if(e>=n.width&&t>=n.height){let e=Number.parseFloat(i);return e=Math.floor(e*si),`${e}px`}return i}function hr({width:e,height:t,isVertical:i,styleService:n,themeService:r}){const a=r.getStyles(),o=n.query.axis.label.getStyle(),{fontFamily:s,fill:l,fontSize:u}=o;return[{type:"axis",key:vi.BAR_AXIS,dock:"center",scale:"m",layout:{minimumLayoutMode:bi},settings:{align:i?"left":"top",line:{show:!i},labels:{minLengthPx:20,fontFamily:s,fill:l,fontSize:cr({width:e,height:t,fontSize:u})},paddingStart:()=>{if(i){const t=Math.min(e/10,Yt);return e/2+t/2}const n=Math.min(t/10,Yt);return t/2+n/2+hi},ticks:{stroke:a.axis.line.major.color}}}]}function fr({width:e,height:t,measureAxisTitle:i,isVertical:n,labelService:r,styleService:a}){const{getTopPadding:o,getBottomPadding:s,getLeftPadding:l,getRightPadding:u}=r.barAxisTitle,c=a.query.axis.title.getStyle(),{fontFamily:h,fontSize:f,color:p}=c;return[{type:"labels",key:vi.AXIS_TITLE,layout:{minimumLayoutMode:xi},settings:{sources:[{component:vi.BACKGROUND_BAR,selector:"rect",strategy:{type:"bar",settings:{direction:n?"up":"right",align:.5,justify:.5,labels:[{fontFamily:h,fill:p,fontSize:Number.parseFloat(cr({width:e,height:t,fontSize:f})),label:()=>i,placements:[{position:"inside",padding:{top:o,bottom:s,left:l,right:u},overflow:!0}]}]}}}]}}]}var pr=e=>()=>e;function dr(e){return 1==(e=+e)?mr:function(t,i){return i-t?function(e,t,i){return e=Math.pow(e,i),t=Math.pow(t,i)-e,i=1/i,function(n){return Math.pow(e+n*t,i)}}(t,i,e):pr(isNaN(t)?i:t)}}function mr(e,t){var i=t-e;return i?function(e,t){return function(i){return e+i*t}}(e,i):pr(isNaN(e)?t:e)}var gr=function e(t){var i=dr(t);function n(e,t){var n=i((e=Zi(e)).r,(t=Zi(t)).r),r=i(e.g,t.g),a=i(e.b,t.b),o=mr(e.opacity,t.opacity);return function(t){return e.r=n(t),e.g=r(t),e.b=a(t),e.opacity=o(t),e+""}}return n.gamma=e,n}(1);function yr({thisColor:e,paletteColors:t,paletteIndex:i,limit:n,isLeft:r=!1,themeService:a}){const o=r?0:1,s=0===Object.entries(n).length,l=n.gradient;let u=i+(r?-1:1);s&&(u=r?0:t.length-1);const c=a.getTheme().getColorPickerColor(u<t.length&&u>=0?t[u]:t[0]);return{color:l?gr(e,c)(.5):e,offset:o,gradient:l}}function vr({limits:e,paletteColors:t,paletteIndex:i,themeService:n}){const r=wt(e,""+(i-1),{}),a=wt(e,`${i}`,{}),o=[r,a].map((e=>e.gradient)).includes(!0),s=n.getTheme().getColorPickerColor(t[i]);if(!o)return[{offset:0,color:s},{offset:1,color:s}];const l=[yr({thisColor:s,paletteColors:t,paletteIndex:i,limit:r,isLeft:!0,themeService:n}),yr({thisColor:s,paletteColors:t,paletteIndex:i,limit:a,isLeft:!1,themeService:n})];2===l.filter((e=>e.gradient)).length&&l.splice(1,0,{offset:.5,color:s,gradient:!0});const u=l.map((({offset:e,color:t,gradient:i})=>({offset:e,color:t,gradient:i})));return u}function br({themeService:e,segmentInfo:t,rangeLimits:i}){const{limits:n,paletteColors:r}=t,{min:a,max:o}=i;n.sort(((e,t)=>e.value-t.value));const s=[a,...n.map((e=>e.value)),o],l=[];for(let t=0;t<r.length;t++){const i=vr({limits:n,paletteColors:r,paletteIndex:t,themeService:e}).map((e=>({offset:sr(s[t]+e.offset*(s[t+1]-s[t]),a,o),color:e.color,gradient:"gradient"in e?e.gradient:void 0})));l.push(...i)}return l}function xr(e,t,i){const n=br({themeService:t,segmentInfo:i,rangeLimits:e}),r=(Jt-Qt)/(2*Math.PI),a=n.map((e=>({offset:e.offset*r,color:e.color})));return{type:"gradient",orientation:"conic",startAngle:Qt-Math.PI/2,x:0,y:0,stops:a}}function Mr({orientation:e,colorService:t,rangeLimits:i,isVertical:n,useSegments:r,themeService:a,segmentInfo:o}){let{min:s,max:l}=i;const u={type:"box",key:vi.BAR,data:{extract:{field:"qMeasureInfo/0",props:{start:s,end:{field:"qMeasureInfo/0"}}}},settings:{minor:{scale:"m"},orientation:e,box:{width:.1,maxWidthPx:Yt,fill:t.getColor()}}},c={type:"box",key:vi.BAR,data:{extract:{field:"qMeasureInfo/0",props:{start:s,end:l}}},settings:{minor:{scale:"m"},orientation:e,box:{width:.1,maxWidthPx:Yt,fill:()=>function({themeService:e,isVertical:t,segmentInfo:i,rangeLimits:n}){return{type:"gradient",x1:0,x2:t?0:1,y1:t?1:0,y2:0,stops:br({themeService:e,segmentInfo:i,rangeLimits:n})}}({themeService:a,isVertical:n,segmentInfo:o,rangeLimits:i})}}},h={type:"box",key:vi.BACKGROUND_BAR,data:{extract:{field:"qMeasureInfo/0",props:{start:s,end:l}}},settings:{minor:{scale:"m"},orientation:e,box:{width:.1,maxWidthPx:Yt,fill:ei}}};return[{type:"box",key:vi.LABEL_BAR,data:{extract:{field:"qMeasureInfo/0",props:{start:s,end:s}}},settings:{minor:{scale:"m"},orientation:e,box:{width:n?ui:ci,opacity:0}}},h,r?c:u]}function Sr({isVertical:e,chart:t,labelService:i,styleService:n}){if(!t.formatter)return[];const{getValueLabelFontSize:r,barValueLabel:a}=i,{getTopPadding:o,getBottomPadding:s,getLeftPadding:l,getRightPadding:u}=a,c=r(ii.MIN,ii.MAX),h=n.query.label.getStyle();return[{type:"labels",key:vi.GAUGE_LABEL,layout:{minimumLayoutMode:e?Mi:Si},settings:{sources:[{component:vi.LABEL_BAR,selector:"rect",formatter:"measure",strategy:{type:"bar",settings:{direction:e?"up":"right",orientation:"horizontal",fontFamily:h.fontFamily,fill:h.fill,fontSize:c,align:e?0:.5,justify:0,labels:[{label:({data:e})=>e?t.formatter(yi.MEASURE)(e.value):"",placements:[{position:"outside",padding:{top:o,bottom:s,left:l,right:u},overflow:!0}]}]}}}]}}]}function kr({labelService:e,rangeLimits:t,qHyperCube:i,isVertical:n}){const{min:r,max:a}=t,o=i.qDataPages[0].qMatrix[0][0].qNum;if(o<=a&&o>=r)return!1;let s=n?"bottom":"left";return o>a&&(s=n?"top":"right"),{type:"oob-indicator",key:vi.OOB_INDICATOR,layout:{displayOrder:2},settings:{component:"bar",selector:"rect",pointingTo:s,size:e.getBarWidthInPixels()}}}function wr({width:e,height:t,styleService:i,themeService:n}){const r=qn(e,t,Qt,Jt),{innerRadius:a,outerRadius:o,radiusIncrease:s}=r,l=4*s,u=Math.min(e,t)/2,c=n.getStyles(),h=i.query.axis.label.getStyle(),{tickLength:f,labelPadding:p}=function({width:e,height:t,defaultTickSize:i,defaultLabelPadding:n}){const r=Math.min(Math.min(e,t)/Ni,1);return{tickLength:i*r,labelPadding:n*r}}({width:e,height:t,defaultTickSize:8,defaultLabelPadding:20}),d=En(e,t);return[{type:"axis",dock:"center",layout:{minimumLayoutMode:ki},scale:"m",settings:{arc:{radius:o,startAngle:Qt,endAngle:Jt,offset:-10*l*(o-a)*u},align:"top",line:{show:!1,stroke:"#cdcdcd"},ticks:{tickSize:f,stroke:c.axis.line.major.color,margin:d},labels:{margin:-6-2*f+p,fontFamily:h.fontFamily,fill:h.fill,fontSize:h.fontSize}}}]}function Nr({qHyperCube:e,rangeLimits:t,width:i,height:n,colorService:r,themeService:a,segmentInfo:o,useSegments:s}){const{outerRadius:l,innerRadius:u}=qn(i,n,Qt,Jt),c=t.max,h=e.qDataPages[0].qMatrix[0][0].qNum,f=c-h,p=[{value:h-t.min,valueLabel:"Measure"},{value:f,valueLabel:"Remaining"}],d=function({themeService:e,segmentInfo:t,rangeLimits:i}){const n=br({themeService:e,segmentInfo:t,rangeLimits:i});let r=0,a=0,o=n.map((e=>(a=0===i.max?e.offset*(i.max-i.min)-r:e.offset*i.max-r,r+=a,{value:a,color:e.color,gradient:e.gradient}))).filter((e=>0!==e.value));return o.forEach((e=>{e.value=Math.abs(e.value)})),o}({themeService:a,segmentInfo:o,rangeLimits:t}),m={type:"pie",key:vi.RADIAL_GAUGE,data:{items:p},settings:{startAngle:Qt,endAngle:Jt,slice:{arc:{ref:"value"},outerRadius:()=>l,innerRadius:()=>u,fill:(e,t)=>{const i=r.getColor();return 0===t?i(e):ei},strokeWidth:0}}},g={type:"pie",key:vi.RADIAL_GAUGE,renderer:"canvas",displayOrder:1,data:{items:d},settings:{startAngle:Qt,endAngle:Jt,slice:{arc:{ref:"value"},outerRadius:()=>l,innerRadius:()=>u,strokeWidth:0,fill:(e,i)=>{var n;return e.datum.value.gradient||null!==(n=d[i-1])&&void 0!==n&&n.gradient?xr(t,a,o):e.datum.value.color}}}},y={type:"pie",key:"circle-gauge",renderer:"canvas",displayOrder:0,data:{items:[{value:h,valueLabel:"Measure"}]},settings:{startAngle:0,endAngle:2*Math.PI,slice:{arc:{ref:"value"},outerRadius:()=>l,innerRadius:()=>u,fill:()=>function(e,t,i){let n=xr(e,t,i);const r={offset:(Jt-Qt)/(2*Math.PI),color:"rgba(0, 0, 0, 0)"};return n.stops.push(r),n.stops.push({offset:1,color:"rgba(0, 0, 0, 0)"}),n}(t,a,o),opacity:s?1:0}}};return[y,s?g:m]}function Ir({qHyperCube:e,chart:t,styleService:i,labelService:n}){const r=e.qMeasureInfo[0].qFallbackTitle,a=i.query.label.getStyle(),o=i.query.axis.title.getStyle(),{getValueLabelFontSize:s}=n,l=s(ii.MIN,ii.MAX);return[{type:"labels",key:vi.RADIAL_GAUGE_LABEL,layout:{displayOrder:4},settings:{sources:[{component:"circle-gauge",selector:"path",strategy:{type:"rows",settings:{fill:"#000",padding:0,labels:[{fontSize:l,fontFamily:a.fontFamily,fill:a.fill,label({data:e}){const i=t.formatter(yi.MEASURE);return e&&i?i(e.value.value):""}},{fontSize:Number.parseFloat(o.fontSize),fontFamily:o.fontFamily,fill:o.color,label:()=>r}]}}}]}}]}function Dr({width:e,height:t,rangeLimits:i,qHyperCube:n}){const{min:r,max:a}=i,o=n.qDataPages[0].qMatrix[0][0].qNum;if(o>a||o<r)return!1;const s=qn(e,t,Qt,Jt).outerRadius,l=Qt+(o-r)/(a-r)*(Jt-Qt);return{type:"radial-gauge-needle",key:vi.RADIAL_GAUGE_NEEDLE,layout:{displayOrder:2},settings:{component:"radial-gauge",selector:"path",radius:s,valueAngle:l}}}function Ar({rangeLimits:e,qHyperCube:t,width:i,height:n,colorService:r,useSegments:a}){const{min:o,max:s}=e,l=t.qDataPages[0].qMatrix[0][0].qNum,{outerRadius:u,innerRadius:c}=qn(i,n,Qt,Jt),h=(c+(u-c)/2)*Math.min(i,n)/2;if(l<=s&&l>=o)return!1;let f=Qt;return l>s&&(f=Jt),{type:"radial-oob-indicator",key:vi.RADIAL_OOB_INDICATOR,layout:{displayOrder:2},settings:{component:"radial-gauge",selector:"path",angle:f,radius:h,size:On({innerRadius:c,outerRadius:u,width:i,height:n}),fill:Tn(r,a)}}}function Lr({refLines:e,colorService:t,themeService:i,width:n,height:r}){const a=i.getStyles(),o=qn(n,r,Qt,Jt);return{type:"radial-custom-ref-line",key:"radial-reference-lines",displayOrder:1,settings:{barWidth:On({innerRadius:o.innerRadius,outerRadius:o.outerRadius,width:n,height:r})},lines:{radial:e.filter(Rn).map((e=>{var i,n;return{scale:"m",value:e.refLineExpr.value,label:{text:e.label,...a.referenceLine.label.name,showValue:e.showValue,showLabel:e.showLabel},radius:o.innerRadius,line:{stroke:t.getPaletteColor(e.paletteColor||{index:e.color}),strokeWidth:(null===(i=e.style)||void 0===i?void 0:i.lineThickness)||2,strokeDasharray:null===(n=e.style)||void 0===n?void 0:n.lineType}}}))}}}function Cr({width:e,height:t,rangeLimits:i,qHyperCube:n,colorService:r,useSegments:a,segmentInfo:o}){const{min:s,max:l}=i,u=n.qDataPages[0].qMatrix[0][0].qNum,c=qn(e,t,Qt,Jt).outerRadius;let h;h=u<s?Qt:u>l?Jt:Qt+(u-s)/(l-s)*(Jt-Qt);const f=r.getColor()({datum:{value:()=>0}}),p=o.paletteColors[0].color||f;return{type:"radial-spark",key:vi.RADIAL_SPARK,layout:{displayOrder:2},settings:{fill:a?p:f,radius:c,valueAngle:h}}}function qr({refLines:e,isVertical:t,labelService:i,colorService:n,themeService:r}){const a=r.getStyles();return{type:"custom-ref-line",key:vi.REFERENCE_LINES_AND_LABELS,settings:{barWidth:i.getBarWidthInPixels()},lines:{[t?"y":"x"]:e.filter(Rn).map((e=>{var t,i;return{scale:"m",value:e.refLineExpr.value,label:{text:e.label,...a.referenceLine.label.name,showValue:e.showValue,showLabel:e.showLabel},line:{stroke:n.getPaletteColor(e.paletteColor||{index:e.color}),strokeWidth:(null===(t=e.style)||void 0===t?void 0:t.lineThickness)||2,strokeDasharray:null===(i=e.style)||void 0===i?void 0:i.lineType}}}))}}}const Pr=Math.log(10),Tr={log:(e,t)=>e<=0||t<=0?NaN:Math.log(e)/Math.log(t),log10:e=>e<=0?NaN:Math.log(e)/Pr,getNiceNumber(e){let t;if(0===e)return 0;const i=Math.floor(Math.log(Math.abs(e))/Pr),n=e/10**i;return t=n<=1?1:n<=2?2:n<=5?5:10,t*10**i*(e<0?-1:1)},getSmallNiceNumber(e){let t;if(0===e)return 0;let i=Math.floor(Math.log(Math.abs(e))/Pr);const n=e/10**i;return n<1?(t=5,i--):t=n<2?1:n<5?2:5,t*10**i*(e<0?-1:1)},getGoodNumber(e){let t;if(0===e)return 0;const i=Math.floor(Math.log(Math.abs(e))/Pr),n=e/10**i;return t=Math.ceil(n),7!==t&&9!==t||t++,n>1&&n<=1.5?t=1.5:n>2&&n<=2.5&&(t=2.5),t*10**i*(e<0?-1:1)},calculateTicks(e,t,i,n,r,a){return this.plotSize=e,this.explicitPlotMin=t,this.explicitPlotMax=i,this.minTickSpacingInPixel=n,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=a||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,Hr.call(this),Br.call(this)):(this.maxNumIntervals<1?zr.call(this):(this.explicitPlotMax>0&&this.explicitPlotMin<0?1===this.maxNumIntervals?Er.call(this,!0):this.maxNumIntervals>=5?Rr.call(this):this.maxNumIntervals<2?Fr.call(this):Vr.call(this):Rr.call(this),this.tickMaxIndex<this.tickMinIndex?(this.tickDataSpacing=Math.max(this.usedDataRange/this.maxNumIntervals,this.minTickDataSpacing),zr.call(this)):jr.call(this)),Hr.call(this),Br.call(this))}};function Or(e,t,i){void 0===e&&(e=null!==this.explicitPlotMin),void 0===t&&(t=null!==this.explicitPlotMax),this.tickDataSpacingNN=i?Tr.getGoodNumber(this.tickDataSpacing):Tr.getNiceNumber(this.tickDataSpacing),_r.apply(this,[e,t])}function Rr(){Or.call(this);const e=this.tickMaxIndex-this.tickMinIndex;let t=this.plotMax-this.plotMin;this.spaceUseFactor=t/this.plotRange;let i=this.plotSize*this.tickDataSpacingNN/this.plotRange<this.minTickSpacingInPixel;if(i&&this.maxNumIntervals>=5){for(;this.tickDataSpacing<=this.absMax&&i;)this.tickDataSpacing=Math.max(1.1*this.tickDataSpacingNN,this.minTickDataSpacing),Or.call(this),t=this.plotMax-this.plotMin,this.spaceUseFactor=t/this.plotRange,i=this.plotSize*this.tickDataSpacingNN/this.plotRange<this.minTickSpacingInPixel;if(!i)return}for(this.tickDataSpacing=Math.max(this.usedDataRange/this.maxNumIntervals,this.minTickDataSpacing),(i||e<=2&&this.maxNumIntervals>=2*e)&&Or.apply(this,[void 0,void 0,!0]),t=this.plotMax-this.plotMin,this.spaceUseFactor=t/this.plotRange,i=this.plotSize*this.tickDataSpacingNN/this.plotRange<this.minTickSpacingInPixel;this.tickDataSpacing<=this.absMax&&i;)this.tickDataSpacing=Math.max(1.1*this.tickDataSpacingNN,this.minTickDataSpacing),Or.apply(this,[void 0,void 0,!0]),t=this.plotMax-this.plotMin,this.spaceUseFactor=t/this.plotRange,i=this.plotSize*this.tickDataSpacingNN/this.plotRange<this.minTickSpacingInPixel}function Er(e){e?(this.tickDataSpacingNN=Tr.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=Tr.getNiceNumber(this.absMax),this.tickDataSpacingNN===this.absMax&&(this.tickDataSpacingNN=Tr.getNiceNumber(1.1*this.absMax)))}function zr(){let e;this.tickDataSpacingNN=Tr.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=Tr.getSmallNiceNumber(this.plotRange),this.tickBaseValue=Math.ceil(this.plotMin/e)*e)}function Fr(){const e=this.explicitPlotMax>=-this.explicitPlotMin,t=e||null!==this.explicitPlotMin,i=!e||null!==this.explicitPlotMax;Or.apply(this,[t,i,!0]);const n=(this.absMax+(1-this.spaceUseLimit)*this.absMin)/this.spaceUseLimit*1.0001;for(;this.tickDataSpacing<=n&&this.plotSize*this.tickDataSpacingNN/this.plotRange<this.minTickSpacingInPixel;)this.tickDataSpacing=Math.max(1.1*this.tickDataSpacingNN,this.minTickDataSpacing),Or.apply(this,[t,i,!0]);const r=this.plotMax-this.plotMin;this.spaceUseFactor=r/this.plotRange}function Vr(){Rr.call(this);const e=this.plotMax-this.plotMin;this.spaceUseFactor=e/this.plotRange}function jr(){const e=Tr.getNiceNumber(this.tickDataSpacingNN);if(this.tickDataSpacingNN===e||0!==this.tickBaseValue)return;const t=this.tickDataSpacingNN,i=this.tickMinIndex,n=this.tickMaxIndex,r=n-i,a=this.plotMin,o=this.plotMax;this.tickDataSpacingNN=e,_r.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,u=this.tickMaxIndex-this.tickMinIndex;!l&&(u===r||u>=10||u>=3&&1.5*u>=r)||(this.tickDataSpacingNN=t,this.tickMinIndex=i,this.tickMaxIndex=n,this.plotMin=a,this.plotMax=o,this.plotRange=this.plotMax-this.plotMin)}function $r(){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 Hr(){let e,t;if(this.mainTickValues=[],this.secondaryTickValues=[],$r.call(this),0===this.plotSize)return;e=this.tickBaseValue;const i=this.tickMaxIndex-this.tickMinIndex;if(!(i<1)){for(t=0;t<=i;t++)this.mainTickValues.push(e+(t+this.tickMinIndex)*this.tickDataSpacingNN);for(e=this.tickBaseValue+this.tickDataSpacingNN/2,t=0;t<i;t++)this.secondaryTickValues.push(e+(t+this.tickMinIndex)*this.tickDataSpacingNN)}}function _r(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 Br(){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 Wr({core:e,dockService:t,rangeLimits:i,measureAxisSpacing:n,isRadial:r,isVertical:a,styleService:o}){const s=i.min,l=i.max,{width:u,height:c}=function(e){return{width:e.meta.chart.size.width,height:e.meta.chart.size.height}}(t);let h,f=96*n;if(r)h=Math.min(c,u);else{h=a?c:u;const{chart:t,picassoInstance:i}=e;if(t&&i){const e=t.formatter(yi.MEASURE),r=i.renderer("svg")(),p=o.query.axis.label.getStyle(),{fontFamily:d,fontSize:m}=p,g=e=>r.measureText({text:e,fontSize:cr({width:u,height:c,fontSize:m}),fontFamily:d}),y=Math.max(96,...[s,l,(l-s)/2].map((t=>g(e(t)).width)));f=a?4*g("M").height:y;f=h/(Math.max(2,h/f/n+1)-1)}}const p=function({plotSize:e,rangeMax:t,rangeMin:i,minTickSpacingInPixel:n}){const r=Tr.calculateTicks(e,i,t,n,20,0);r.tickSpacing;let a=r.mainTickValues;0===a.length&&a.push(r.minTickValue);const o=a[0];a[0]=r.plotMin,o-r.plotMin>=r.tickSpacing/2&&a.splice(1,0,o);const s=r.mainTickValues[r.mainTickValues.length-1];return r.plotMax-s<=r.tickSpacing/2?a[r.mainTickValues.length-1]=Math.round(r.plotMax):a.push(Math.round(r.plotMax)),a}({plotSize:h,rangeMin:s,rangeMax:l,minTickSpacingInPixel:f});return{values:p}}function Ur({core:e,services:t,logicalSize:i}){const{layoutService:n,dockService:r,colorService:a,labelService:o,themeService:s,styleService:l}=t;if(!n.meta.qHyperCube)throw new Error("Layout is missing a hypercube");const{width:u,height:c}=r.meta.chart.size,{autoOrientation:h,gaugetype:f,rangeLimits:p,measureAxisTitle:d,qHyperCube:m,useSegments:g,segmentInfo:y,refLines:v,measureAxisSpacing:b}=n.meta;let x,M;M="radial"===f,x=h?u>=c?"horizontal":"vertical":n.meta.orientation;const S="vertical"===x,k=function({width:e,height:t,isVertical:i,orientation:n,measureAxisTitle:r,qHyperCube:a,rangeLimits:o,gaugetype:s,colorService:l,core:u,labelService:c,useSegments:h,themeService:f,segmentInfo:p,refLines:d,styleService:m}){const{chart:g}=u;if(!g)return[];let y=[];return y="bar"===s?[...hr({width:e,height:t,isVertical:i,styleService:m,themeService:f}),...Mr({orientation:n,colorService:l,rangeLimits:o,isVertical:i,useSegments:h,themeService:f,segmentInfo:p}),...fr({width:e,height:t,labelService:c,measureAxisTitle:r,isVertical:i,styleService:m}),...Sr({isVertical:i,chart:g,labelService:c,styleService:m}),kr({labelService:c,rangeLimits:o,qHyperCube:a,isVertical:i}),qr({refLines:d,isVertical:i,labelService:c,colorService:l,themeService:f})]:e>=wi.SPARK.width&&t>=wi.SPARK.height?[...Nr({qHyperCube:a,rangeLimits:o,width:e,height:t,colorService:l,themeService:f,segmentInfo:p,useSegments:h}),...Ir({qHyperCube:a,chart:g,styleService:m,labelService:c}),...wr({width:e,height:t,styleService:m,themeService:f}),...h?[Dr({width:e,height:t,rangeLimits:o,qHyperCube:a})]:[],Ar({rangeLimits:o,qHyperCube:a,width:e,height:t,colorService:l,useSegments:h}),Lr({refLines:d,isVertical:i,labelService:c,colorService:l,themeService:f,width:e,height:t})]:[Cr({width:e,height:t,rangeLimits:o,qHyperCube:a,colorService:l,useSegments:h,segmentInfo:p})],y}({width:u,height:c,isVertical:S,orientation:x,measureAxisTitle:d,qHyperCube:m,rangeLimits:p,gaugetype:f,colorService:a,core:e,labelService:o,themeService:s,useSegments:g,segmentInfo:y,refLines:v,styleService:l}),w=function({core:e,colorService:t,isVertical:i,isRadial:n,dockService:r,rangeLimits:a,measureAxisSpacing:o,styleService:s}){const l=Wr({core:e,dockService:r,rangeLimits:a,measureAxisSpacing:o,isRadial:n,isVertical:i,styleService:s});return{m:{data:{field:"qMeasureInfo/0"},type:"linear",invert:!!n||i,min:a.min,max:a.max,ticks:{values:l.values}},...t.getScales()}}({core:e,measureAxisSpacing:b,isVertical:S,colorService:a,isRadial:M,dockService:r,rangeLimits:p,styleService:l});return{scales:w,components:k,formatters:{[yi.MEASURE]:{data:{field:"qMeasureInfo/0"}}},strategy:{layoutModes:wi,logicalSize:i}}}const Gr=({core:e,services:t})=>{const[s,l]=n({}),c=i(),p=u(),d=o(),m=a(),{qLocaleInfo:g}=h();return f((async()=>{if(!t)return Promise.resolve();const{colorService:i}=t;return i.initialize({createConfig:()=>({theme:d,layout:m,localeInfo:g,hc:m.qHyperCube,colorProps:{...m.color,auto:!0,useBaseColors:"off",paletteColor:m.paletteProgressColor}})}).then((()=>{const{layoutService:i}=t,n=or({layout:i.getLayout(),options:c}),r=Ur({core:e,services:t,logicalSize:n});l(r)}))}),[t]),r((()=>{if(t&&t.dockService&&t.layoutService){const{dockService:i,layoutService:n}=t,r=or({layout:n.getLayout(),options:c});i.update(r||p);const a=Ur({core:e,services:t,logicalSize:r});l(a)}}),[p]),s};function Xr(){return{targets:[{path:"/qHyperCubeDef",dimensions:{min:0,max:0},measures:{min:1,max:1}}]}}function Kr(){return{qHyperCubeDef:{qMeasures:[],qInitialDataFetch:[{qWidth:2,qHeight:5e3}],qSuppressZero:!1,qSuppressMissing:!0},showTitles:!0,title:"",subtitle:"",footnote:"",measureAxis:{min:0,max:10},orientation:"vertical",segmentInfo:{limits:[],colors:[{color:3}]}}}const Zr=({services:e})=>{p((t=>{if(e){const{dockService:i}=e,{width:n,height:r}=i.meta.chart.size;t.snapshotData=t.snapshotData||{content:{size:{w:n,h:r}}},t.snapshotData.content={size:{w:n,h:r}}}return Promise.resolve(t)}))}}}}));
package/package.json ADDED
@@ -0,0 +1,109 @@
1
+ {
2
+ "name": "@nebula.js/sn-gauge",
3
+ "version": "0.7.1",
4
+ "description": "A gauge chart",
5
+ "keywords": [
6
+ "qlik",
7
+ "nebula",
8
+ "stardust"
9
+ ],
10
+ "license": "MIT",
11
+ "author": "QlikTech International AB",
12
+ "main": "dist/sn-gauge.js",
13
+ "module": "dist/sn-gauge.esm.js",
14
+ "files": [
15
+ "dist",
16
+ "api-specifications",
17
+ "core",
18
+ "sn-gauge-ext"
19
+ ],
20
+ "lint-staged": {
21
+ "*.{js,jsx,ts,tsx,yaml}": [
22
+ "bash -c 'pnpm lint'",
23
+ "bash -c 'pnpm types:check'"
24
+ ],
25
+ "*": "bash -c 'pnpm format:fix'"
26
+ },
27
+ "prettier": "@qlik/prettier-config",
28
+ "jest": {
29
+ "transformIgnorePatterns": [
30
+ "<rootDir>/node_modules/(?!d3)/"
31
+ ]
32
+ },
33
+ "dependencies": {
34
+ "extend": "^3.0.2",
35
+ "jest-environment-jsdom": "^29.7.0",
36
+ "picasso-plugin-q": "^2.6.0",
37
+ "picasso.js": "^2.6.0",
38
+ "qlik-chart-modules": "0.79.0"
39
+ },
40
+ "devDependencies": {
41
+ "@babel/eslint-parser": "^7.25.9",
42
+ "@babel/preset-env": "7.24.0",
43
+ "@babel/preset-react": "7.23.3",
44
+ "@babel/preset-typescript": "7.23.3",
45
+ "@commitlint/config-conventional": "19.0.3",
46
+ "@emotion/react": "11.11.4",
47
+ "@emotion/styled": "11.11.0",
48
+ "@mui/lab": "5.0.0-alpha.166",
49
+ "@mui/material": "5.15.11",
50
+ "@nebula.js/cli": "5.4.0",
51
+ "@nebula.js/cli-build": "5.4.0",
52
+ "@nebula.js/cli-sense": "5.4.0",
53
+ "@nebula.js/cli-serve": "5.4.0",
54
+ "@playwright/test": "^1.35.1",
55
+ "@qlik-trial/sprout": "3.17.0",
56
+ "@qlik/api": "^1.14.0",
57
+ "@qlik/eslint-config": "0.7.11",
58
+ "@qlik/prettier-config": "0.4.10",
59
+ "@rollup/plugin-typescript": "11.1.5",
60
+ "@types/d3-interpolate": "3.0.1",
61
+ "@types/d3-scale": "^4.0.8",
62
+ "@types/extend": "^3.0.4",
63
+ "@types/jest": "29.5.12",
64
+ "@types/react": "18.2.60",
65
+ "@types/react-dom": "18.2.17",
66
+ "commitlint": "19.0.3",
67
+ "d3-color": "3.1.0",
68
+ "d3-interpolate": "3.0.1",
69
+ "eslint": "8.57.0",
70
+ "eslint-config-airbnb-base": "15.0.0",
71
+ "eslint-plugin-import": "2.29.0",
72
+ "husky": "9.0.11",
73
+ "jest": "29.7.0",
74
+ "lint-staged": "15.2.2",
75
+ "prettier": "3.2.5",
76
+ "react": "^18.2.0",
77
+ "react-dom": "^18.2.0",
78
+ "typescript": "5.3.3",
79
+ "yargs": "17.7.2"
80
+ },
81
+ "peerDependencies": {
82
+ "@nebula.js/stardust": ">=5.4.0"
83
+ },
84
+ "engines": {
85
+ "node": ">=18"
86
+ },
87
+ "publishConfig": {
88
+ "access": "public"
89
+ },
90
+ "qext": {
91
+ "name": "Gauge chart",
92
+ "icon": "extension"
93
+ },
94
+ "systemjs": "dist/sn-gauge.systemjs.js",
95
+ "scripts": {
96
+ "build": "node ./scripts/build.mjs --core --ext",
97
+ "build:dev": "node ./scripts/build.mjs --core --ext --mode development",
98
+ "build:watch": "node ./scripts/build.mjs --ext --mode development -w",
99
+ "format:check": "prettier --check . --ignore-unknown",
100
+ "format:fix": "prettier --write . --ignore-unknown",
101
+ "lint": "eslint src --ext .ts,.tsx,.js,.jsx",
102
+ "sense": "nebula sense",
103
+ "start": "nebula serve --type sn-gauge",
104
+ "start:mfe": "nebula serve --mfe --type sn-gauge --watch",
105
+ "test:e2e": "playwright test",
106
+ "test:unit": "jest",
107
+ "types:check": "tsc --noEmit"
108
+ }
109
+ }