@nebula.js/sn-gauge 0.8.0 → 0.8.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.
package/core/esm/index.js CHANGED
@@ -1,9 +1,9 @@
1
1
  /*
2
- * @nebula.js/sn-gauge v0.7.2
2
+ * @nebula.js/sn-gauge v0.8.0
3
3
  * Copyright (c) 2025 QlikTech International AB
4
4
  * Released under the MIT license.
5
5
  */
6
6
 
7
- import{useElement as e,useOptions as t,useState as n,useEffect as i,useStaleLayout as r,useTheme as o,useApp as a,useModel as s,useRect as l,useTranslator as u,useAppLayout as c,useInteractionState as p,usePromise as f,onTakeSnapshot as d}from"@nebula.js/stardust";import m from"picasso-plugin-q";import h from"picasso.js";function g(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,i=Array(t);n<t;n++)i[n]=e[n];return i}function y(e,t,n){return(t=function(e){var t=function(e){if("object"!=typeof e||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function v(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,i)}return n}function b(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?v(Object(n),!0).forEach((function(t){y(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):v(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function x(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var i,r,o,a,s=[],l=!0,u=!1;try{if(o=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;l=!1}else for(;!(l=(i=o.call(n)).done)&&(s.push(i.value),s.length!==t);l=!0);}catch(e){u=!0,r=e}finally{try{if(!l&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(u)throw r}}return s}}(e,t)||S(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 q(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)||S(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 D(e){return D="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},D(e)}function S(e,t){if(e){if("string"==typeof e)return g(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?g(e,t):void 0}}var M=["American Typewriter, serif","Andalé Mono, monospace","Arial Black, sans-serif","Arial, sans-serif","Bradley Hand, cursive","Brush Script MT, cursive","Comic Sans MS, cursive","Courier, monospace","Didot, serif","Georgia, serif","Impact, sans-serif","Lucida Console, monospace","Luminari, fantasy","Monaco, monospace","QlikView Sans, sans-serif","Source Sans Pro, sans-serif","Tahoma, sans-serif","Times New Roman, serif","Trebuchet MS, sans-serif","Verdana, sans-serif"],A=["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 w(e){var t=e.theme,n=e.translator,i=e.defaultValue,r=e.flags,o=[],a=t.getStyle("","","fontFamilies");return Array.isArray(a)&&a.length?o.push.apply(o,q(new Set([i].concat(q(a.map((function(e){return e.split(",").map((function(e){return e.trim()})).map((function(e){return e.replace(/\s+/g," ").trim()})).filter(Boolean).join(", ")}))))))):o.push(i),[{value:"ThemeHeader",label:n.get("properties.themeFonts"),metaText:n.get("properties.theme"),groupHeader:!0}].concat(q(o.map((function(e){return I(e)}))),[{value:"DefaultHeader",label:n.get("properties.allFonts"),metaText:n.get("properties.default"),groupHeader:!0}],q(function(e){return null!=e&&e.isEnabled("PS_20852_WYSIWYG_FONT_SUPPORT")?A:M}(r).map((function(e){return I(e)}))))}function k(e){var t=e.theme,n=e.translator,i=e.id,r=e.path,o=e.flags,a=function(){return t.getStyle(i,r,"fontFamily")};return{getDefaultValue:function(){return a()},getOptions:function(){return w({theme:t,translator:n,defaultValue:a(),flags:o})}}}var C,L,E=["10px","11px","12px","13px","14px","15px","16px","17px","18px","19px","20px","21px","22px","23px","24px"],N=function(e){return{value:e,label:e,groupHeader:!1,disabled:!1}};function P(e){var t=e.theme,n=e.translator,i=e.id,r=e.path,o=function(){return t.getStyle(i,r,"fontSize")};return{getDefaultValue:function(){return o()},getOptions:function(){return function(e){var t=e.translator,n=e.defaultValue,i=[],r=e.theme.getStyle("","","fontSizes");return Array.isArray(r)&&r.length?i.push.apply(i,q(new Set([n].concat(q(r))))):i.push(n),[{value:"ThemeHeader",label:t.get("properties.themeFontSizes"),metaText:t.get("properties.theme"),groupHeader:!0}].concat(q(i.map((function(e){return N(e)}))),[{value:"DefaultHeader",label:t.get("properties.allFontSizes"),metaText:t.get("properties.default"),groupHeader:!0}],q(E.map((function(e){return N(e)}))))}({theme:t,translator:n,defaultValue:o()})}}}function O(e){var t=e.theme,n=e.translator,i=e.id,r=e.path;return{fontFamily:k({theme:t,translator:n,id:i,path:r,flags:e.flags}),fontSize:P({theme:t,translator:n,id:i,path:r})}}var F,T=function(){if(L)return C;L=1;var e=Object.prototype.hasOwnProperty,t=Object.prototype.toString,n=Object.defineProperty,i=Object.getOwnPropertyDescriptor,r=function(e){return"function"==typeof Array.isArray?Array.isArray(e):"[object Array]"===t.call(e)},o=function(n){if(!n||"[object Object]"!==t.call(n))return!1;var i,r=e.call(n,"constructor"),o=n.constructor&&n.constructor.prototype&&e.call(n.constructor.prototype,"isPrototypeOf");if(n.constructor&&!r&&!o)return!1;for(i in n);return void 0===i||e.call(n,i)},a=function(e,t){n&&"__proto__"===t.name?n(e,t.name,{enumerable:!0,configurable:!0,value:t.newValue,writable:!0}):e[t.name]=t.newValue},s=function(t,n){if("__proto__"===n){if(!e.call(t,n))return;if(i)return i(t,n).value}return t[n]};return C=function e(){var t,n,i,l,u,c,p=arguments[0],f=1,d=arguments.length,m=!1;for("boolean"==typeof p&&(m=p,p=arguments[1]||{},f=2),(null==p||"object"!=typeof p&&"function"!=typeof p)&&(p={});f<d;++f)if(null!=(t=arguments[f]))for(n in t)i=s(p,n),p!==(l=s(t,n))&&(m&&l&&(o(l)||(u=r(l)))?(u?(u=!1,c=i&&r(i)?i:[]):c=i&&o(i)?i:{},a(p,{name:n,newValue:e(m,c,l)})):void 0!==l&&a(p,{name:n,newValue:l}));return p},C}(),R=(F=T)&&F.__esModule&&Object.prototype.hasOwnProperty.call(F,"default")?F.default:F;function V(e,t){return{range:function(e){var n=e.resources,i=e.data,r=n.theme.palette("categorical",0===t?i.items.length:t);return i.items.map((function(e){return r[e.value%r.length]}))},valueAccessor:e.value}}function H(e,t){return{range:function(e){var n=e.resources,i=e.data,r=n.theme.palette("categorical",0===t?i.items.length:t);return i.items.map((function(e){return r[e.row.value%r.length]}))},valueAccessor:e.value}}function j(e,t,n,i,r){var o,a,s=r.byRow,l=r.byElemNo;if(i&&(t.input.persistent||e.hc.qDimensionInfo.length>1||void 0===n.activeDimensionIndex&&e.hc.qSize.qcy>((null===(a=(o=e.hc).qDataPages[0]||o.qStackedDataPages[0])||void 0===a?void 0:a.qArea.qHeight)||0)))return l(i,i.raw().qCardinal);if(i){var u=t.pic.extract({field:i.key(),trackBy:i.value}).length;return s(i,u)}return{}}function z(e,t){var n=e.hc.qDimensionInfo,i=t.input.byDimDef||{activeDimensionIndex:n.length-1};if(i.activeDimensionIndex>=0){var r=n[i.activeDimensionIndex];i=r.coloring&&r.coloring.colorMapRef?{type:"libraryItem",key:r.coloring.colorMapRef,activeDimensionIndex:i.activeDimensionIndex}:{activeDimensionIndex:i.activeDimensionIndex}}return i}function _(e,t){var n;return t.activeDimensionIndex>=0?n=e.pic.fields().filter((function(e){return"dimension"===e.type()}))[t.activeDimensionIndex]:"libraryItem"===t.type?!1===(n=t.key?e.pic.field((function(e){return e.raw().colorMapRef===t.key})):void 0)&&(n=e.pic.field((function(e){return"colorByAlternative"===e.raw().id}))):"expression"===t.type&&(n=e.pic.field((function(e){return"colorByAlternative"===e.raw().id}))),n}function B(e,t,n){e.prototype=t.prototype=n,n.constructor=e}function $(e,t){var n=Object.create(e.prototype);for(var i in t)n[i]=t[i];return n}function G(){}var U=1/.7,W="\\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\\(${W},${W},${W}\\)$`),J=new RegExp(`^rgb\\(${K},${K},${K}\\)$`),Q=new RegExp(`^rgba\\(${W},${W},${W},${X}\\)$`),ee=new RegExp(`^rgba\\(${K},${K},${K},${X}\\)$`),te=new RegExp(`^hsl\\(${X},${K},${K}\\)$`),ne=new RegExp(`^hsla\\(${X},${K},${K},${X}\\)$`),ie={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 oe(){return this.rgb().formatRgb()}function ae(e){var t,n;return e=(e+"").trim().toLowerCase(),(t=Z.exec(e))?(n=t[1].length,t=parseInt(t[1],16),6===n?se(t):3===n?new pe(t>>8&15|t>>4&240,t>>4&15|240&t,(15&t)<<4|15&t,1):8===n?le(t>>24&255,t>>16&255,t>>8&255,(255&t)/255):4===n?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 pe(t[1],t[2],t[3],1):(t=J.exec(e))?new pe(255*t[1]/100,255*t[2]/100,255*t[3]/100,1):(t=Q.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=ne.exec(e))?ye(t[1],t[2]/100,t[3]/100,t[4]):ie.hasOwnProperty(e)?se(ie[e]):"transparent"===e?new pe(NaN,NaN,NaN,0):null}function se(e){return new pe(e>>16&255,e>>8&255,255&e,1)}function le(e,t,n,i){return i<=0&&(e=t=n=NaN),new pe(e,t,n,i)}function ue(e){return e instanceof G||(e=ae(e)),e?new pe((e=e.rgb()).r,e.g,e.b,e.opacity):new pe}function ce(e,t,n,i){return 1===arguments.length?ue(e):new pe(e,t,n,null==i?1:i)}function pe(e,t,n,i){this.r=+e,this.g=+t,this.b=+n,this.opacity=+i}function fe(){return`#${ge(this.r)}${ge(this.g)}${ge(this.b)}`}function de(){const e=me(this.opacity);return`${1===e?"rgb(":"rgba("}${he(this.r)}, ${he(this.g)}, ${he(this.b)}${1===e?")":`, ${e})`}`}function me(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function he(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function ge(e){return((e=he(e))<16?"0":"")+e.toString(16)}function ye(e,t,n,i){return i<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new be(e,t,n,i)}function ve(e){if(e instanceof be)return new be(e.h,e.s,e.l,e.opacity);if(e instanceof G||(e=ae(e)),!e)return new be;if(e instanceof be)return e;var t=(e=e.rgb()).r/255,n=e.g/255,i=e.b/255,r=Math.min(t,n,i),o=Math.max(t,n,i),a=NaN,s=o-r,l=(o+r)/2;return s?(a=t===o?(n-i)/s+6*(n<i):n===o?(i-t)/s+2:(t-n)/s+4,s/=l<.5?o+r:2-o-r,a*=60):s=l>0&&l<1?0:a,new be(a,s,l,e.opacity)}function be(e,t,n,i){this.h=+e,this.s=+t,this.l=+n,this.opacity=+i}function xe(e){return(e=(e||0)%360)<0?e+360:e}function qe(e){return Math.max(0,Math.min(1,e||0))}function De(e,t,n){return 255*(e<60?t+(n-t)*e/60:e<180?n:e<240?t+(n-t)*(240-e)/60:t)}B(G,ae,{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:oe,toString:oe}),B(pe,ce,$(G,{brighter(e){return e=null==e?U:Math.pow(U,e),new pe(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=null==e?.7:Math.pow(.7,e),new pe(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new pe(he(this.r),he(this.g),he(this.b),me(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:de,toString:de})),B(be,(function(e,t,n,i){return 1===arguments.length?ve(e):new be(e,t,n,null==i?1:i)}),$(G,{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,n=this.l,i=n+(n<.5?n:1-n)*t,r=2*n-i;return new pe(De(e>=240?e-240:e+120,r,i),De(e,r,i),De(e<120?e+240:e-120,r,i),this.opacity)},clamp(){return new be(xe(this.h),qe(this.s),qe(this.l),me(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=me(this.opacity);return`${1===e?"hsl(":"hsla("}${xe(this.h)}, ${100*qe(this.s)}%, ${100*qe(this.l)}%${1===e?")":`, ${e})`}`}}));const Se=Math.PI/180,Me=180/Math.PI,Ae=4/29,Ie=6/29,we=3*Ie*Ie;function ke(e){if(e instanceof Ce)return new Ce(e.l,e.a,e.b,e.opacity);if(e instanceof Oe)return Fe(e);e instanceof pe||(e=ue(e));var t,n,i=Pe(e.r),r=Pe(e.g),o=Pe(e.b),a=Le((.2225045*i+.7168786*r+.0606169*o)/1);return i===r&&r===o?t=n=a:(t=Le((.4360747*i+.3850649*r+.1430804*o)/.96422),n=Le((.0139322*i+.0971045*r+.7141733*o)/.82521)),new Ce(116*a-16,500*(t-a),200*(a-n),e.opacity)}function Ce(e,t,n,i){this.l=+e,this.a=+t,this.b=+n,this.opacity=+i}function Le(e){return e>.008856451679035631?Math.pow(e,1/3):e/we+Ae}function Ee(e){return e>Ie?e*e*e:we*(e-Ae)}function Ne(e){return 255*(e<=.0031308?12.92*e:1.055*Math.pow(e,1/2.4)-.055)}function Pe(e){return(e/=255)<=.04045?e/12.92:Math.pow((e+.055)/1.055,2.4)}function Oe(e,t,n,i){this.h=+e,this.c=+t,this.l=+n,this.opacity=+i}function Fe(e){if(isNaN(e.h))return new Ce(e.l,0,0,e.opacity);var t=e.h*Se;return new Ce(e.l,Math.cos(t)*e.c,Math.sin(t)*e.c,e.opacity)}B(Ce,(function(e,t,n,i){return 1===arguments.length?ke(e):new Ce(e,t,n,null==i?1:i)}),$(G,{brighter(e){return new Ce(this.l+18*(null==e?1:e),this.a,this.b,this.opacity)},darker(e){return new Ce(this.l-18*(null==e?1:e),this.a,this.b,this.opacity)},rgb(){var e=(this.l+16)/116,t=isNaN(this.a)?e:e+this.a/500,n=isNaN(this.b)?e:e-this.b/200;return new pe(Ne(3.1338561*(t=.96422*Ee(t))-1.6168667*(e=1*Ee(e))-.4906146*(n=.82521*Ee(n))),Ne(-.9787684*t+1.9161415*e+.033454*n),Ne(.0719453*t-.2289914*e+1.4052427*n),this.opacity)}})),B(Oe,(function(e,t,n,i){return 1===arguments.length?function(e){if(e instanceof Oe)return new Oe(e.h,e.c,e.l,e.opacity);if(e instanceof Ce||(e=ke(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)*Me;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,n,null==i?1:i)}),$(G,{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 Fe(this).rgb()}}));var Te=e=>()=>e;function Re(e,t){var n=t-e;return n?function(e,t){return function(n){return e+n*t}}(e,n):Te(isNaN(e)?t:e)}var Ve=function e(t){var n=function(e){return 1==(e=+e)?Re:function(t,n){return n-t?function(e,t,n){return e=Math.pow(e,n),t=Math.pow(t,n)-e,n=1/n,function(i){return Math.pow(e+i*t,n)}}(t,n,e):Te(isNaN(t)?n:t)}}(t);function i(e,t){var i=n((e=ce(e)).r,(t=ce(t)).r),r=n(e.g,t.g),o=n(e.b,t.b),a=Re(e.opacity,t.opacity);return function(t){return e.r=i(t),e.g=r(t),e.b=o(t),e.opacity=a(t),e+""}}return i.gamma=e,i}(1),He=/^class(-pyramid)?/,je=function(e,t,n,i){var r=void 0!==n.min?n.min:i.min(),o=void 0!==n.max?n.max:i.max(),a=r,s=o,l=t.limits,u={},c="percent"===t.limitType?l.map((function(e){return r+(o-r)*e})):l,p=t.colors.map((function(t){return e.resolveUIColor(t)}));if(r=Math.min.apply(Math,[r].concat(q(c))),o=Math.max.apply(Math,[o].concat(q(c))),u.min=r,u.max=o,t.breakTypes&&-1===t.breakTypes.indexOf(!0))u.type="categorical",Object.assign(u,function(e){var t=e.min,n=e.max,i=e.limits,r=e.range,o=[],a=[];if(i.length)if(i[i.length-1]<t)a.push(t,n),o.push(r[r.length-1],r[r.length-1],r[r.length-1]);else if(i[0]>n)a.push(t,n),o.push(r[0],r[0],r[0]);else{if(i[0]>t)a.push(t),o.push(r[0]);else{a.push(t);for(var s=0;s<i.length;s++)if(t<i[s]){o.push(r[s]);break}}for(var l=0;l<i.length;l++)t<i[l]&&i[l]<n&&(a.push(i[l]),o.push(r[l]));if(i[i.length-1]<n)a.push(n),o.push(r[i.length]),o.push(r[i.length]);else{a.push(n);for(var u=0;u<i.length;u++)if(i[u]>n){o.push(r[u]),o.push(r[u]);break}}}else o.push(r[0]);return{min:t,max:n,range:o,domain:a}}({min:"percent"===t.limitType?r:a,max:"percent"===t.limitType?o:s,range:p,limits:"percent"===t.limitType?c:l}));else if(t.breakTypes){var f=t.breakTypes;u.type="continuous",u.domain=[r],u.range=[p[0]];for(var d=0;d<c.length;d+=1)if(f[d]){var m=p[d],h=p[d+1],g=Ve(m,h)(.5);u.range.push(g),u.domain.push(c[d]),d<c.length-1&&f[d+1]&&(u.range.push(p[d+1]),u.domain.push((c[d]+c[d+1])/2))}else u.range.push(p[d]),u.range.push(p[d+1]),u.domain.push(c[d]),u.domain.push(c[d]+Math.min(1e-6,(o-r)/1e6));u.range.push(p[p.length-1]),u.domain.push(o)}else u.domain=c,u.range=p;return u};function ze(e,t,n,i,r){var o,a,s,l=0,u=[],c=(e-t)/(i+1);if(0===c)return 1;for(o=0;o<n.length;o+=1)a=.99*(n[o]-t),s=n[o]>e?Math.floor(e/c):n[o]<t?0:Math.floor(a/c),Number.isNaN(s)||(u[s]?u[s]+=1:u[s]=1);for(o=0;o<u.length;o+=1)u[o]&&(l+=1);return l<=i||l>=r?Math.max(l,i):ze(e,t,n,i+1,r)}var _e=function(e,t,n,i){var r,o,a=t.theme,s=t.hc,l=i.f,u={mode:"field",fieldType:"measure",field:l?l.key():void 0,reverse:n.input.reverseScheme||!1,type:"continuous",range:function(e){return e.resources.theme.palette("quant")}},c=[],p=!0;if(l){if(Number.isNaN(+l.min())||Number.isNaN(+l.max()))return{invalid:!0};(p=!("S"===(r=n.pic.raw()).qMode&&(r.qDataPages[0]&&r.qSize.qcy>r.qDataPages[0].qArea.qHeight||!r.qDataPages.length&&r.qSize.qcy>0)||"K"===r.qMode&&r.qStackedDataPages[0]&&r.qSize.qcy>r.qStackedDataPages[0].qArea.qHeight||"T"===r.qMode&&r.qSize.qcy>r.qTreeDataPages[0].qGroupSize))&&(c=n.pic.extract({field:0,props:{num:{field:l.key()},exclude:{fields:s.qDimensionInfo.map((function(e,t){return{field:"qDimensionInfo/".concat(t)}})),value:function(e){return Math.min.apply(Math,q(e))<0}}}}).filter((function(e){return e.value>=0&&!e.exclude.value})).map((function(e){return e.num.value})).filter((function(e){return"number"==typeof e})))}if(!1===n.input.autoMinMax){if(u.min=n.input.measureMin,u.max=n.input.measureMax,u.max<u.min)return{invalid:!0}}else if(l&&!p)u.min=l.min(),u.max=l.max();else if(l){if(!c.length)return{invalid:!0};u.min=Math.min.apply(Math,q(c)),u.max=Math.max.apply(Math,q(c))}if(n.input.measureScheme&&(u.palettes={quant:n.input.measureScheme}),a){var f=a.getDataColorScales().filter((function(e){return e.key===n.input.measureScheme}))[0];u.type=f&&He.test(f.type)?"categorical":"continuous","categorical"===u.type&&(o=f.colors.some((function(e){return Array.isArray(e)}))?Math.max.apply(Math,q(f.colors.map((function(e){return e?e.length:0})))):f.colors.length)}if("categorical"===u.type){for(var d=p?ze(u.max,u.min,c,1,o):o,m=(u.max-u.min)/d,h=[],g=0;g<d+1;g+=1)h.push(u.min+m*g);u.domain=h,u.range=function(e){for(var t=e.resources.theme.palette("quant",d),n=Math.max(1,Math.floor(t.length/d)),i=[],r=0;r<d;r+=1)i.push(t[r*n]);return[i[0]].concat(i,[i[i.length-1]])}}return u};function Be(e,t){var n;return t.activeMeasureIndex>=0?n=e.pic.fields().filter((function(e){return"measure"===e.type()}))[t.activeMeasureIndex]:"libraryItem"===t.type?n=e.pic.field((function(e){return e.raw().colorMapRef===t.key&&void 0!==t.key})):"expression"===t.type&&(n=e.pic.field((function(e){return"colorByAlternative"===e.raw().id}))),n||(n=e.pic.field((function(e){return void 0!==e.raw().matchMeasure})))&&(n=e.pic.fields().filter((function(e){return"measure"===e.type()}))[n.raw().matchMeasure]),n}function $e(e){e.measureOverrides.every((function(e){return!e}))&&(e.measureOverrides=null)}function Ge(e,t){for(var n=(null==t?void 0:t.domain)||[],i=(null==t?void 0:t.range)||[],r=[],o=0;o<e.length;++o){var a=e[o];if("constant"===(null==a?void 0:a.mode)){var s=n.indexOf(o);-1===s?(n.push(o),i.push(a.primary)):i[s]=a.primary,e[o]=null}else if(a){r.push(o);var l=n.indexOf(o);-1!==l&&(n.splice(l,1),i.splice(l,1))}}return{domain:n,range:i,exclude:r}}function Ue(e,t,n,i){var r,o=function(e,t,n,i){if(t.input&&!t.input.auto){if("byMeasure"===t.input.mode)return function(e,t,n){var i=t.theme,r=t.hc,o=(arguments.length>3&&void 0!==arguments[3]?arguments[3]:{}).getCField,a=void 0===o?Be:o,s=n.input.byMeasureDef||{activeMeasureIndex:0},l=a(n,s),u=_e(0,{theme:i,hc:r},n,{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=n.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=n.pic.fields().filter((function(e){return"measure"===e.type()}))[l.raw().matchMeasure]),n.input.useMeasureGradient&&"libraryItem"===s.type)if(c){var p=c.raw().coloring;p&&p.gradient&&R(u,je(e,p.gradient,u,c))}else u.auxiliary=s;return u}(e,n,t);if("byDimension"===t.input.mode)return function(e,t,n){var i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},r=i.getCDef,o=void 0===r?z:r,a=i.getCByField,s=void 0===a?_:a,l=i.getPersistence,u=void 0===l?j:l,c=o(t,n),p=s(n,c),f=p?p.raw():{},d=n&&n.pic?n.pic.raw():{};if(f.qError||f.qSize&&0===f.qSize.qcy&&!d.qHasOtherValues)return{invalid:!0};var m={mode:"field",fieldType:"dimension",type:"categorical",field:p?p.key():void 0,isFieldLocked:f.qLocked};return("expression"===c.type||c.activeDimensionIndex<0)&&(m.label=c.label,"color.altLabel"===f.labelExpRef&&(m.label=n.input.altLabel)),!m.label&&p&&(m.label=p.title()),n.input.dimensionScheme&&(m.palettes={categorical:n.input.dimensionScheme}),n.input.useDimColVal&&"libraryItem"===c.type&&(m.auxiliary=c),R(m,u(t,n,c,p,{byRow:H,byElemNo:V})),m}(e,n,t);if("byExpression"===t.input.mode)return function(e,t,n,i){var r=t.hc,o=t.theme,a=t.translator,s=n.pic.field((function(e){return"colorByExpression"===e.raw().id}));if(!s||!s.raw().qFallbackTitle&&!n.input.colorExpression||!(Number.isFinite(s.raw().qMin)&&Number.isFinite(s.raw().qMax)||n.input.expressionIsColor))return{mode:"constant",type:"constant",primary:i.nil};if(n.input.expressionIsColor)return{mode:"field",fieldType:"expression",field:s?s.key():void 0,type:"color"};var l=_e(0,{hc:r,theme:o},n,{f:s});return l.invalid||(l.label=n.input.expressionLabel||a.get("Object.ChartTooltip.ColorExpression")),l}(0,n,t,i);if("byMultiple"===t.input.mode||"primary"===t.input.mode)return function(e,t,n,i){var r=t.hc,o=t.theme,a=t.translator,s=n.input.useBaseColors;if(("byMultiple"===n.input.mode||"primary"===n.input.mode&&"measure"===n.input.useBaseColors)&&r.qMeasureInfo.length>1&&(s="measure"),"measure"===s){var l=[],u=[];"measure"===n.input.useBaseColors&&r.qMeasureInfo.forEach((function(t,n){if(t.baseColor||t.coloring&&t.coloring.baseColor){l.push(n);var r=e.resolveUIColor(t.baseColor||t.coloring.baseColor);"none"===r?u.push(i.primary):u.push(r)}}));var c=n.input.dimensionScheme?{categorical:n.input.dimensionScheme}:void 0,p=o?o.getDataColorPalettes()[0]:void 0;return"measure"===n.input.useBaseColors&&p&&(c={categorical:p.key}),{mode:"measure",type:"categorical",palettes:c,label:a?a.get("Common.Measures"):void 0,explicit:l.length?{domain:l,range:u}:void 0}}if("dimension"===s){var f=[],d=[];return r.qDimensionInfo.forEach((function(t,n){if(t.baseColor||t.coloring&&t.coloring.baseColor){f.push(n);var r=e.resolveUIColor(t.baseColor||t.coloring.baseColor);"none"===r?d.push(i.primary):d.push(r)}})),{mode:"dimension",type:"categorical",field:f.length?f[0]:void 0,explicit:f.length?{domain:f,range:d}:void 0}}var m=i.primary;if(void 0!==n.input.paletteColor)n.input.paletteColor&&(m=e.resolveUIColor(n.input.paletteColor));else{var h=n.input.singleColor;"number"!=typeof h||Number.isNaN(h)||(m=["#b0afae","#7b7a78","#545352","#4477aa","#7db8da","#b6d7ea","#46c646","#f93f17","#ffcf02","#276e27","#ffffff","#000000"][h])}return{mode:"constant",type:"constant",primary:m}}(e,n,t,i)}return{}}(e,t,n,i);return null!==(r=t.input)&&void 0!==r&&r.measureOverrides?(o.measureOverrides=t.input.measureOverrides.map((function(n,r){return function(e){var t,n=e.cm,i=e.defaults,r=e.index,o=e.input,a=e.pic;if(!o||!o.on)return null;var s=null!==(t=o.mode)&&void 0!==t?t:"primary";return"primary"===s?function(e,t,n){var i=n.primary;return void 0!==t.paletteColor&&t.paletteColor&&(i=e.resolveUIColor(t.paletteColor)),b(b({},n),{},{mode:"constant",type:"constant",primary:i})}(n,o,i):"byExpression"===s?function(e,t,n){var i="qMeasureInfo/".concat(e,"/"),r=t.field((function(e){return e.id().startsWith(i)&&"colorByMeasureExpression"===e.raw().id})),o=r;return b(b({},n),{},o?{mode:"field",fieldType:"expression",field:r?r.key():void 0,type:"color"}:{mode:"constant",type:"constant",primary:n.nil})}(r,a,i):null}({cm:e,input:n,defaults:i,index:r,pic:t.pic})})),function(e,t){var n,i,r,o=t.translator;if($e(e),1===(null===(n=e.measureOverrides)||void 0===n?void 0:n.length))return e.measureOverrides[0];if("measure"===e.mode&&e.measureOverrides&&(e.explicit=Ge(e.measureOverrides,e.explicit),$e(e)),null!==(i=e.measureOverrides)&&void 0!==i&&i.every((function(e){return"constant"===(null==e?void 0:e.mode)}))){var a={mode:"measure",type:"categorical",label:null==o?void 0:o.get("Common.Measures")};return a.explicit=Ge(e.measureOverrides),a}return null!==(r=e.measureOverrides)&&void 0!==r&&r.every((function(e){return e}))?{invalid:!0,measureOverrides:e.measureOverrides}:e}(o,n)):o}var We=function(e,t){var n=e.fieldType,i={};if(t)if("measure"===n){var r=t.coloring;r&&(i.measureGradient=r.gradient)}else if("dimension"===n){var o=t[0],a=t[1];o&&(i.legendDataPage=o),a&&(i.dimValsData=a.colorMap)}return i},Xe=function(e){throw e.isHandled=!0,e};function Ke(e){return function(t){return"object"===D(t.datum[e])?t.datum[e].value:void 0}}function Ze(e){return"object"===D(e.datum.isNull)?e.datum.isNull.value:-2===e.datum.value}function Ye(e){return-3===e.datum.value}var Je={COLOR:void 0,FONT_SIZE:"16px",FONT_FAMILY:"'Source Sans Pro', 'Arial', 'sans-serif'"},Qe={COLOR:void 0,FONT_SIZE:void 0,FONT_FAMILY:"'Source Sans Pro', 'Arial', 'sans-serif'"};function et(e){var t=e.theme,n=e.key,i=e.styleOverrides,r={title:{color:Je.COLOR,fontSize:Je.FONT_SIZE,fontFamily:Je.FONT_FAMILY},label:{color:Qe.COLOR,fontSize:Qe.FONT_SIZE,fontFamily:Qe.FONT_FAMILY}};if(!t&&!i)return r;var o=i||{},a=o.title,s=o.label,l=function(e){var t=e.theme,n=e.key;return function(e,i,r,o){return void 0!==e?e:t?t.getStyle(n,i,r):o}}({theme:t,key:n});return r.title.color=l(null==a?void 0:a.color,"legend.title","color",Je.COLOR),r.title.fontSize=l(null==a?void 0:a.fontSize,"legend.title","fontSize",Je.FONT_SIZE),r.title.fontFamily=l(null==a?void 0:a.fontFamily,"legend.title","fontFamily",Je.FONT_FAMILY),r.label.color=l(null==s?void 0:s.color,"legend.label","color",Qe.COLOR),r.label.fontSize=l(null==s?void 0:s.fontSize,"legend.label","fontSize",Qe.FONT_SIZE),r.label.fontFamily=l(null==s?void 0:s.fontFamily,"legend.label","fontFamily",Qe.FONT_FAMILY),r}var tt=function(e,t,n){var i=e&&e.dock||void 0;if("auto"!==i)return i||"right";if(t){var r=t.element.getBoundingClientRect();if(r.height>r.width)return"bottom"}return n?"left":"right"},nt=function(e,t,n){return!(n.invalid||"color"===n.type||"measure"===n.mode&&t.qMeasureInfo.length<=1||"dimension"===n.mode)&&("function"==typeof e.show?e.show():!1!==e.show)};function it(e,t){var n=e.styleReference,i=e.styleOverrides,r=e.chart,o=e.rtl,a=t.legendProps,s=t.coloring,l=t.theme,u=t.hc,c=et({theme:l,key:n,styleOverrides:i});return{layout:{minimumLayoutMode:"MEDIUM",dock:tt(a,r,o)},show:"function"==typeof a.show?function(){return nt(a,u,s)}:nt(a,u,s),renderer:"svg",mounted:function(e){e.childNodes[0].style.pointerEvents="none",e.style.overflow="hidden"},settings:{title:{show:!1!==a.showTitle,wordBreak:"break-word",maxLines:2,lineHeight:1.2,text:s.label||"",fill:c.title.color,fontSize:c.title.fontSize,fontFamily:c.title.fontFamily}}}}function rt(e,t,n){var i=[],r=[],o=function(e,t,n){return"categorical"===t.coloring.type?function(e,t,n){var i=it(e,t);if(!i.show)return!1;var r,o=e.key,a=e.styleReference,s=e.styleOverrides,l=e.viewState,u=e.rtl,c=e.settings,p=e.style,f=t.scaleKey,d=t.theme,m=t.scales,h=et({theme:d,key:a,styleOverrides:s}),g=i.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 R(!0,i,{type:"legend-cat",key:"".concat(o,"-cat"),scale:x in m?x:f,settings:{layout:{scrollOffset:function(){return l?l.get("legendScrollOffset"):void 0},size:-1!==["top","bottom"].indexOf(i.layout.dock)?2:1,direction:u?"rtl":"ltr",horizontal:20},item:{show:r,label:b({fill:h.label.color,fontSize:h.label.fontSize,fontFamily:h.label.fontFamily},y)},navigation:{disabled:n,button:{content:function(e,t){var n=t.direction;return e("i",{style:{"pointer-events":"none",fontSize:"12px",display:"inline-block",fontStyle:"normal",lineHeight:"0",textAlign:"center",textTransform:"none",verticalAlign:"-0.125em",textRendering:"optimizelegibility",margin:"0px"}},[e("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 16 16",fill:"currentColor"},[e("path",{d:v[n]})])])}}}},brush:{consume:[{context:"selection",data:["",o],style:{inactive:{opacity:.3}}}]}},{settings:c,style:p})}(e,t,n):"continuous"===t.coloring.type&&function(e,t){var n,i=e.key,r=e.styleReference,o=e.styleOverrides,a=e.rtl,s=e.settings,l=e.style,u=t.scaleKey,c=t.theme,p="".concat(u,"Range"),f=it(e,t);if(!f.show)return!1;var d=et({theme:c,key:r,styleOverrides:o}),m=f.layout.dock,h="right"===m||"left"===m,g=null===(n=t.scales)||void 0===n?void 0:n[p];return h&&g&&(g.invert=!0),R(!0,f,{type:"legend-seq",key:"".concat(i,"-seq"),settings:{fill:u,major:p,length:1,tick:{fill:d.label.color,fontSize:d.label.fontSize,fontFamily:d.label.fontFamily},title:{anchor:!a||"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,n&&n.navigationDisabled);return i.push(o),o&&"legend-cat"===o.type&&(r.push(function(e){var t=e.key,n=e.requireFailure,i=e.recognizeWith,r=(arguments.length>1&&void 0!==arguments[1]?arguments[1]:{}).actions;return{key:"event:tap-".concat(t),type:"Tap",requireFailure:n,recognizeWith:i,options:{event:"legendtap",interval:10,pointers:1,enable:function(e,n){var i;if(!n)return!0;if(null!=r&&null!==(i=r.interact)&&void 0!==i&&i.enabled&&!r.interact.enabled())return!1;if(!this.chart.componentsFromPoint({x:n.center.x,y:n.center.y}).some((function(e){return e.key==="".concat(t,"-cat")})))return!1;var o=n.srcEvent.target;return!!(o&&o.hasAttribute("data-action")&&o.hasAttribute("data-component-key"))||!(!o||!o.childNodes[0]||"BUTTON"!==o.childNodes[0].nodeName)}},events:{legendtap:function(e){e.preventDefault();var t=e.srcEvent.target;t&&t.hasAttribute("data-action")&&t.hasAttribute("data-component-key")&&this.chart.component(t.getAttribute("data-component-key")).emit(t.getAttribute("data-action"))}}}}(e,n)),r.push(function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.eventName,n=e.key,i=e.requireFailure,r=e.recognizeWith,o=(arguments.length>1&&void 0!==arguments[1]?arguments[1]:{}).actions;return{key:"event:pan-".concat(n),type:"Pan",requireFailure:i,recognizeWith:r,options:{event:t,pointers:1,threshold:10,enable:function(e,i){var r;return this.started===t||!i||!(null!=o&&null!==(r=o.interact)&&void 0!==r&&r.enabled&&!o.interact.enabled())&&this.chart.componentsFromPoint({x:i.center.x,y:i.center.y}).some((function(e){return e.key==="".concat(n,"-cat")}))}},events:y(y(y({},"".concat(t,"start"),(function(e){e.preventDefault(),this.started!==t&&(this.started=t,this.chart.component("".concat(n,"-cat")).emit("panstart",e))})),"".concat(t,"move"),(function(e){e.preventDefault(),this.chart.component("".concat(n,"-cat")).emit("panmove",e)})),"".concat(t,"end"),(function(e){e.preventDefault(),this.chart.component("".concat(n,"-cat")).emit("panend",e),this.started=!1}))}}(e,n))),{interactions:r,components:i}}function ot(e){var t=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.auto,n=function(e){var t=b({hc:null,colorProps:null,layout:null,theme:null},e),n={},i={auto:function(){return{mode:"primary"}},getDimensionColorMap:function(){return Promise.reject()},getMeasure:function(){return Promise.reject()},getAttributeDimension:function(){return Promise.reject()}},r={auto:function(e){return e?(i.auto=e,r):i.auto},getDimensionColorMap:function(e){return e?(i.getDimensionColorMap=e,r):i.getDimensionColorMap},getAttributeDimension:function(e){return e?(i.getAttributeDimension=e,r):i.getAttributeDimension},getMeasure:function(e){return e?(i.getMeasure=e,r):i.getMeasure},set:function(e){var r;if(!e.colorProps)throw new Error('Missing "colorProps"');if(R(t,e),(n={pic:t.picasso.data("q")({data:t.hc,config:{localeInfo:t.localeInfo}}),input:t.colorProps}).input.auto){var o=i.auto(e.layout);n.input=R(!0,{},n.input,o,{auto:!1});var a=t.theme?t.theme.getDataColorPalettes():[];a[0]&&(n.input.dimensionScheme=a[0].key);var s=0;n.input.byDimDef&&+n.input.byDimDef.activeDimensionIndex>=0&&(s=+n.input.byDimDef.activeDimensionIndex),t.hc&&t.hc.qDimensionInfo[s]&&t.hc.qDimensionInfo[s].coloring&&t.hc.qDimensionInfo[s].coloring.colorMapRef&&n.input.byDimDef&&(n.input.byDimDef.type="libraryItem",n.input.byDimDef.key=t.hc.qDimensionInfo[s].coloring.colorMapRef)}null!==(r=n.input.measureOverrides)&&void 0!==r&&r.every((function(e){return!e||!e.on}))&&(n.input=R(!1,{},n.input,{measureOverrides:null}))},palettes:function(){if(!n.palettes){var e=t.theme,i=[];(e&&e.getDataColorPickerPalettes()||[]).forEach((function(e){i.push({key:"ui",colors:e.colors})})),n.palettes=i}return n.palettes},getAuxiliaryData:function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"/qHyperCubeDef";if(!e.auxiliary&&!/qAttrDimInfo/.test(e.field))return Promise.resolve();var r=(e.auxiliary||{}).key;if("measure"===e.fieldType)return i.getMeasure(r,t).catch((function(){}));if("dimension"===e.fieldType){var o="".concat(n,"/").concat(e.field).replace("qDimensionInfo","qDimensions").replace("qAttrDimInfo","qAttributeDimensions");return Promise.all([/qAttrDimInfo/.test(e.field)?i.getAttributeDimension(o,t).catch((function(){})):Promise.resolve(),r?i.getDimensionColorMap(r,t).catch((function(){})):Promise.resolve()])}return Promise.resolve()},getAuxiliarySettings:function(e,i){var r=this;return e.auxiliary||/qAttrDimInfo/.test(e.field)?(this.palettes(),this.getAuxiliaryData(e,i).then((function(i){if(!i)return{};if("measure"===e.fieldType){if(i.coloring&&i.coloring.gradient){var o=n.pic.field(e.field);return je(r,i.coloring.gradient,e,o)}return{}}if("dimension"===e.fieldType){var a={nil:e.nil,others:e.others},s=i[0],l=i[1]?i[1].colorMap:null;if(s){var u=t.picasso.data("q")({data:{qDimensionInfo:[n.pic.field(e.field).raw(),n.pic.field(e.field).raw()],qMeasureInfo:[],qDataPages:s,qInterColumnSortOrder:[0,1],qMode:"S"}});a.legendDataset=u}return l?function(e,t,n,i){var r=i.external,o=i.field,a=b({},e);R(a,V(o,o.raw().qCardinal));var s=r.theme?r.theme.getDataColorPalettes()[0]:null;return t.nul&&(a.nil=n.resolveUIColor(t.nul)),t.oth&&(a.others=n.resolveUIColor(t.oth)),t.usePal?(a.palettes={categorical:t.pal},s&&!t.pal&&(a.palettes.categorical=s.key,R(a,V(o)))):!1===t.autoFill&&t.single?a.range=[n.resolveUIColor(t.single)]:t.autoFill&&(s&&(a.palettes={categorical:s.key}),R(a,V(o))),t.colors&&t.colors.length&&(a.explicit=function(e,t,n){for(var i={},r=0;r<e.length;r+=1)i[e[r].value]=e[r].baseColor;var o=[];return{domain:function(e){var r=e.data,a=[];o=[];for(var s=0;s<r.items.length;s++){var l=r.items[s],u=(l.text||l).label;i[u]&&-1===a.indexOf(l.value)&&(a.push(l.value),o.push(t.resolveUIColor(i[u])))}return a.push(-3,-2),o.push(n.others),o.push(n.nil),a},range:function(){return o}}}(t.colors,n,a)),a}(a,l,r,{external:t,field:n.pic.field(e.field)}):a}return{}}))):Promise.resolve()},resolveUIColor:function(e){if(e.index<0||void 0===e.index)return e.color;if(void 0===n.uiPalette&&(n.uiPalette=this.palettes().filter((function(e){return"ui"===e.key}))[0]||!1),!n.uiPalette)return e.color;var t="none"===n.uiPalette.colors[0]?e.index:e.index-1;return void 0===n.uiPalette.colors[t]?e.color:n.uiPalette.colors[t]},settings:function(){if(this.palettes(),!n.settings){var e={primary:"steelblue",others:"#aaa",nil:"#ddd"},i=t.theme;i&&(e=b(b({},e),i.getDataColorSpecials())),n.settings=R(e,Ue(this,n,t,e))}return n.settings}};return r}(e.resources).auto(t||function(){return{mode:"byDimension",persistent:!1,useDimColVal:!0,byDimDef:{activeDimensionIndex:0,type:"expression",label:""}}}).getDimensionColorMap((function(e,t){return function(e,t){var n=t.layout,i=t.app;return n&&n.snapshotData?n.snapshotData.content&&n.snapshotData.content.chartData&&n.snapshotData.content.chartData.dimValsData?Promise.resolve({colorMap:n.snapshotData.content.chartData.dimValsData}):Promise.reject():i&&i.getObject?i.getObject("ColorMapModel_".concat(e)).then((function(e){return e.getLayout()})):Promise.reject()}(e,{layout:t.layout,app:t.app})})).getMeasure((function(e,t){return function(e,t){var n=t.layout,i=t.app;return n&&n.snapshotData?n.snapshotData.content&&n.snapshotData.content.chartData&&n.snapshotData.content.chartData.measureGradient?Promise.resolve({coloring:{gradient:n.snapshotData.content.chartData.measureGradient}}):Promise.reject():i&&i.getMeasure?i.getMeasure(e).then((function(e){return e.getMeasure()})):Promise.reject()}(e,{layout:t.layout,app:t.app})})).getAttributeDimension((function(e,t){return function(e,t){var n=t.layout,i=t.model,r=t.app;return n&&n.snapshotData?n.snapshotData.content&&n.snapshotData.content.chartData&&n.snapshotData.content.chartData.legendDataPage?Promise.resolve(n.snapshotData.content.chartData.legendDataPage):Promise.reject():i&&i.session&&r?i.getHyperCubeData(e,[{qHeight:100,qLeft:0,qTop:0,qWidth:2}]).catch(Xe):Promise.reject()}(e,{layout:t.layout,model:t.model,app:t.app})}));return n.getSnapshotData=We,n}({resources:e}),n={},i={},r=function(e){return i.settings||(e||console.warn("settings() called before auxiliarySettings()"),i.settings=t.settings()),i.settings},o={config:function(r){if(n=b({},r),i={},!n.key)throw new Error("Missing key");t.set(b(b({},e),n))},auto:function(e){return e?(t.auto(e),o):t.auto()},getAuxiliarySettings:function(e){return i.auxiliarySettings?Promise.resolve(i.auxiliarySettings):t.getAuxiliarySettings(r(!0),e).then((function(e){return i.auxiliarySettings=e||{},i.settings=b(b({},i.settings),i.auxiliarySettings),i.scales=void 0,i.color=void 0,i.auxiliarySettings}))},getAuxiliaryData:function(){return t.getAuxiliaryData(r())},getSnapshotData:function(e){var n=r();return t.getAuxiliaryData(n,e).then((function(e){return t.getSnapshotData(n,e)}))},resolveUIColor:function(e){return t.resolveUIColor(e)},settings:function(){var e=r();return{mode:e.mode,type:e.type,label:e.label,field:e.field,fieldType:e.fieldType,nil:e.nil,others:e.others,primary:e.primary}},settingsForMeasure:function(e){var t;return(null===(t=r().measureOverrides)||void 0===t?void 0:t[e])||this.settings()},isSelectionLocked:function(e){var t=e.isMeasureSelectionLocked;return function(e,t){var n=t.isMeasureSelectionLocked;return"field"!==e.mode||("dimension"===e.fieldType?e.isFieldLocked:"measure"!==e.fieldType||n)}(r(),{isMeasureSelectionLocked:t})},palettes:function(){return function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.colorProps,n=e.coloring,i=e.theme,r=[];if(n&&n.palettes&&i){var o=n.palettes.categorical||t.dimensionScheme,a=i.getDataColorPalettes().filter((function(e){return e.key===o}))[0]||i.getDataColorPalettes()[0];o&&a&&r.push({key:"categorical",colors:a.colors});var s=n.palettes.metric||t.measureScheme,l=i.getDataColorScales().filter((function(e){return e.key===s}))[0]||i.getDataColorScales()[0];if(l){var u=l.colors[0]?l.colors:[[]].concat(q(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:n.colorProps,theme:n.theme})},scales:function(){return i.scales=i.scales||function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.hc,n=e.coloring,i=e.rtl,r=e.key,o=e.source,a=e.picasso,s={},l=r;if(n){var u={override:!0,domain:n.explicit&&"function"==typeof n.explicit.domain?n.explicit.domain:[].concat(q((n.explicit||{}).domain||[]),[-3,-2]),range:n.explicit&&"function"==typeof n.explicit.range?n.explicit.range:[].concat(q((n.explicit||{}).range||[]),[n.others,n.nil])};if("field"===n.mode){if("dimension"===n.fieldType){var c,p=function(e){var t=e.hc,n=e.source,i=e.coloring,r={data:{extract:[{source:"dummy",field:0,filter:function(){return r.expando=t.qDataPages[0]?t.qDataPages[0].qArea.qTop:0,!1}},{source:n,field:i.field,trackBy:i.valueAccessor,reduce:"first",props:{row:{reduce:function(){return r.expando++}},text:{value:function(e){return e.qText},reduce:"first"}}}]},expando:0};return r}({hc:t,source:o,coloring:n}).data;if(n.legendDataset){var f=0,d={};a.data("q")({data:t}).extract({field:n.field,trackBy:n.valueAccessor,reduce:function(e){var t=e[0];return d[t]=f++,e[0]}}),c={source:"attrDim",extract:{field:"qDimensionInfo/0",filter:function(e){return e.qElemNumber>=0},props:{row:{value:function(e){return d[e.qElemNumber]}}}}}}var m={data:p,range:n.range,domain:n.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]=m,c&&(s["".concat(l,"Legend")]=b(b({},m),{},{data:c})),t&&t.qHasOtherValues&&c&&((c||m.data).amend=[{label:t.qDimensionInfo[0].othersLabel,source:{key:"qHyperCube",field:"qDimensionInfo/0"},row:{value:-3},value:-3}])}else if("measure"===n.fieldType){var h={data:{field:n.field},min:n.min,max:n.max};s[l]=R({},h,{type:"categorical"===n.type?"threshold-color":"sequential-color",range:n.range,domain:n.domain,invert:n.reverse}),"sequential-color"===s[l].type&&(s["".concat(l,"Range")]=R({},h,{invert:!!i}))}else if("color"!==n.type)throw new Error("UNUSED FIELD")}else if("dimension"===n.mode){var g={data:t.qDimensionInfo.map((function(e,t){return t})),label:function(e){return t.qDimensionInfo[e.datum.value].qFallbackTitle},explicit:u,type:"categorical-color"};s[l]=g}else if("measure"===n.mode){var y={data:t.qMeasureInfo.map((function(e,t){return t})).filter((function(e){var t;return!(null!==(t=n.explicit)&&void 0!==t&&null!==(t=t.exclude)&&void 0!==t&&t.includes(e))})),label:function(e){return t.qMeasureInfo[e.datum.value].qFallbackTitle},explicit:u,type:"categorical-color"};s[l]=y}}return s}({hc:n.hc,coloring:r(),key:n.key,source:n.source,picasso:e.picasso}),i.scales},color:function(){return i.color=i.color||function(e){var t=e.coloring,n=e.scales,i=e.key,r=Ke(i),o=Ke("".concat(i,"IsAnOther")),a=function(e,t){var i=e.fieldType,a=e.invalid,s=e.mode,l=e.nil,u=e.others,c=e.primary,p=e.type;return a?function(e){return Ye(e)||o(e)?u:l}:n[t]?function(e){return Ye(e)?u:Ze(e)||-2===r(e)&&"dimension"===i||"NaN"===r(e)?l:o(e)?u:e.resources.scale(t)(r(e))||u}:"constant"===s?function(e){return Ye(e)||o(e)?u:Ze(e)?l:c}:"color"===p?function(e){return Ye(e)||o(e)?u:Ze(e)?l:r(e)||u}:null},s=a(t,i);if(t.measureOverrides){var l=Ke("".concat(i,"MeasureIdx")),u=t.measureOverrides.map((function(e){return e&&a(e)}));return function(e){var t=l(e);return u[t]?u[t](e):s(e)}}return s}({coloring:r(),scales:this.scales(),key:n.key}),i.color},datumProps:function(e){return function(e){var t,n,i=e.hc,r=e.coloring,o=e.scales,a=e.key,s=e.addMeasureIx,l=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,u=a,c=r.nil;"field"===r.mode&&r.field?t=r.field:o[a]&&"field"===r.mode&&(t=o[a].data.field||r.field),t?(n={field:t,reduce:"first"},"color"===r.type&&(n.value=function(e){return"NaN"!==e.qNum?function(e){return"rgba(".concat([(16711680&e)>>16,(65280&e)>>8,255&e,((4278190080&e)>>>24)/255].join(","),")")}(e.qNum):e.qText&&ae(e.qText)?e.qText:c})):"dimension"===r.mode?n=void 0!==r.field?r.field:i.qDimensionInfo.length-1:"measure"===r.mode&&(n=l);var p=y({},u,n);return i.qDimensionInfo.length>1&&(p["".concat(u,"IsAnOther")]={fields:i.qDimensionInfo.map((function(e,t){return{field:"qDimensionInfo/".concat(t)}})),value:function(e){return-1!==e.indexOf(-3)}}),s&&(p["".concat(u,"MeasureIdx")]=l),p}({coloring:this.settingsForMeasure(e),scales:this.scales(),key:n.key,hc:n.hc,addMeasureIx:r().measureOverrides},e)},data:function(){var e=r(),t={key:"dummy",data:[["field"],["a"]]};return e.legendDataset?[t,{type:"q",key:"attrDim",data:e.legendDataset.raw(),config:{localeInfo:n.localeInfo}}]:[t]},legend:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.eventName,i=e.key,o=e.viewState,a=e.chart,s=e.rtl,l=e.styleReference,u=void 0===l?"object.legend":l,c=e.styleOverrides,p=e.settings,f=void 0===p?{}:p,d=e.style,m=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return rt({eventName:t,key:i,rtl:s,viewState:o,chart:a,styleReference:u,styleOverrides:c,settings:f,style:void 0===d?{}:d},{legendProps:n.legendProps,scaleKey:n.key,coloring:r(),theme:n.theme,hc:n.hc,scales:this.scales()},m)}};return o}var at=function(e){return e.baseColor||e.coloring&&e.coloring.baseColor};function st(e){var t=e.qHyperCube,n=t.qDimensionInfo,i=t.qMeasureInfo,r=n.some(at),o=i.some(at),a=e.color.useBaseColors;return"measure"===a&&!o||"dimension"===a&&!r?"off":a}var lt=function(e){return e.baseColor||e.coloring&&e.coloring.baseColor};function ut(e){var t,n=e.qHyperCube.qDimensionInfo.some(lt),i=e.qHyperCube.qMeasureInfo.some(lt),r=n?"dimension":void 0;return{mode:"primary",useBaseColors:null!==(t=null!=r?r:i?"measure":void 0)&&void 0!==t?t:"off",paletteColor:null}}var ct=function(){};function pt(e){var t,n,i,r,o=e.picasso,a=e.model,s=e.app,l=e.translator,u=e.layoutService,c=void 0===u?void 0:u,p=e.createConfig,f=void 0===p?ct:p,d=e.config,m=void 0===d?{}:d,h=e.custom,g=void 0===h?{}:h,y=m.localeInfo,v=m.key,x=m.theme,q=void 0===x?void 0:x,D=m.auto,S=void 0===D?void 0:D,M=m.definitionPath,A=null==c||null===(t=c.getLayout)||void 0===t?void 0:t.call(c),I={theme:q,key:v,localeInfo:y,layout:A,hc:null==c||null===(n=c.getHyperCube)||void 0===n?void 0:n.call(c),legendProps:null==c||null===(i=c.getLayoutValue)||void 0===i?void 0:i.call(c,"legend"),colorProps:b(b({},null==c||null===(r=c.getLayoutValue)||void 0===r?void 0:r.call(c,"color")),{},{useBaseColors:A?st(A):void 0})},w=ot({picasso:o,model:a,app:s,translator:l,auto:S});!1!==S&&w.auto((function(e){return S?S({layout:e,defaultAuto:ut}):ut(e)}));var k=!1,C={getColor:function(){return w.color()},getPaletteColor:function(e){var t=e.index,n=e.color;return w.resolveUIColor({index:t,color:n})},getData:function(){return w.data()},getDatumProps:function(e){return w.datumProps(e)},getSnapshotData:function(){return w.getSnapshotData(M)},getSettingsForMeasure:function(e){return w.settingsForMeasure(e)},getSettings:function(){return w.settings()},getLegend:function(e,t){return w.legend(e,t)},getScales:function(){return w.scales()},getPalettes:function(){return w.palettes()},isSelectionLocked:function(e){var t=e.isMeasureSelectionLocked;return w.isSelectionLocked({isMeasureSelectionLocked:t})},isInitialized:function(){return k},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}),n=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 w.config(n),w.getAuxiliarySettings(M).then((function(){k=!0}))}};return C}var ft="center",dt="bottom";function mt(e){var t=e.chart,n=e.logicalSize;if(n)return n;var i=t?t.element.getBoundingClientRect():{};return{width:i.width,height:i.height}}[{key:"NoDataExist",alignment:ft,condition:function(e){var t=e.layoutService;if(!t)return!1;var n=t.meta.size;return n.x*n.y==0}},{key:"OnlyNanDataMeasure",translationKey:"OnlyNanData",alignment: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 n=t.getHyperCubeValue("qDimensionInfo.0");return n&&(n.qMax<n.qMin||"NaN"===n.qMax)}},{key:"OnlyNegativeOrZeroValues",alignment:ft},{key:"DataRangeIncludingZero",alignment:dt},{key:"LimitedData",alignment:dt},{key:"NegativeOrZeroValues",alignment:dt}].reduce((function(e,t){return e[t.key]=t,e}),{});var ht=[{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,n=e.height,i=ht.filter((function(e){return t>=e.size.width&&n>=e.size.height})).shift();return i?i.key:"SPARK"}var yt={left:"right",right:"left",top:"bottom",bottom:"top",near:"far",far:"near"};function vt(e){var t=e.orientation,n=e.dock,i=e.btt,r=e.rtl,o="horizontal"===t?function(e){return"bottom"===e||"near"===e?"bottom":"top"}(n):function(e,t){var n="left"===e||"near"===e?"left":"right";return t?yt[n]:n}(n,r),a=function(e,t,n){return"vertical"===e?t?"bottom":"top":n?"right":"left"}(t,i,r);return{current:o,opposite:yt[o],start:a,end:yt[a]}}function bt(e){var t=e.chart,n=e.layoutService,i=e.config,r=void 0===i?{}:i,o=r.logicalSize,a=void 0!==o&&o,s=r.rtl,l=void 0!==s&&s,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:n.getLayoutValue("xAxis.dock"),btt:!1,rtl:l}),i=t.current,r=t.opposite;u.x.dock=i,u.x.opposite=r,u.x.size=e.width;var o=vt({orientation:"vertical",dock:n.getLayoutValue("yAxis.dock"),btt:!0,rtl:l}),a=o.current,s=o.opposite;u.y.dock=a,u.y.opposite=s,u.y.size=e.height}};return c.update(mt({chart:t,logicalSize:a})),c}var xt="vertical",qt="horizontal";function Dt(e){var t=e.chart,n=e.layoutService,i=e.config,r=void 0===i?{}:i,o=e.typeConfig,a=void 0===o?{}:o,s=r.logicalSize,l=void 0!==s&&s,u=r.rtl,c=void 0!==u&&u,p=a.fallback===xt?xt:qt,f=!!a.invert,d=a.measureAxes||[{ref:"measureAxis",name:"minor"}],m={chart:{orientation:void 0,size:void 0,mode:void 0},major:{orientation:void 0,dock:void 0,opposite:void 0,size:void 0}},h={type:"major-minor",config:b({},r),meta:m,update:function(e){m.chart.orientation=n.getLayoutValue("orientation",p),m.chart.size={width:e.width,height:e.height},m.chart.mode=gt(e),m.major.orientation=function(e){var t=e.chartOrientation,n=e.invert;return e.layoutService.meta.isContinuous?qt:n?t===xt?qt:xt:t}({layoutService:n,chartOrientation:m.chart.orientation,invert:f});var t=vt({orientation:m.major.orientation,dock:n.getLayoutValue("dimensionAxis.dock"),btt:!1,rtl:c}),i=t.current,r=t.opposite;m.major.dock=i,m.major.opposite=r,m.major.size=m.major.orientation===xt?e.height:e.width,d.forEach((function(t){var i={};i.orientation=m.major.orientation===xt?qt:xt;var r=vt({orientation:i.orientation,dock:n.getLayoutValue("".concat(t.ref,".dock")),btt:!0,rtl:c}),o=r.current,a=r.opposite,s=r.start,l=r.end;i.dock=o,i.opposite=a,i.start=s,i.end=l,i.size=i.orientation===xt?e.height:e.width,m[t.name]=i}))}};return h.update(mt({chart:t,logicalSize:l})),h}function St(e){var t=e.chart,n=e.layoutService,i=e.config,r=void 0===i?{}:i,o=e.typeConfig,a=void 0===o?{}:o;return("x-y"===a.type?bt:Dt)({chart:t,layoutService:n,config:r,typeConfig:a})}function Mt(e,t,n){if(void 0===e||void 0===t)return n;for(var i=t.split("."),r=e,o=0;o<i.length;++o){var a=i[o];if(void 0===r[a])return n;r=r[a]}return r}var At=["__proto__","constructor"];function It(e,t,n){if(void 0!==e&&void 0!==t){var i=t.split("."),r=i[i.length-1];if(!At.some((function(e){return i.includes(e)}))){for(var o=e,a=0;a<i.length-1;++a){var s=i[a];void 0===o[s]&&(o[s]=Number.isNaN(+i[a+1])?{}:[]),o=o[s]}void 0!==n?o[r]=n:delete o[r]}}}function wt(){var e={};return{get:function(t){return e[t]},set:function(t,n){return e[t]=n,n},has:function(t){return t in e},remove:function(t){delete e[t]},empty:function(){e={}}}}var kt,Ct={ERROR_CODES:[7005],DIMENSION:"qDimensionInfo",MEASURE:"qMeasureInfo"},Lt=function(e,t){return e[t].reduce((function(e,t,n){var i;return i=t,Ct.ERROR_CODES.some((function(e){var t;return e===(null===(t=i.qError)||void 0===t?void 0:t.qErrorCode)}))?e.filtered.push(n):e.reduced.push(t),e}),{reduced:[],filtered:[]})};function Et(e){var t;return((null==e||null===(t=e.qHyperCube)||void 0===t?void 0:t.qDimensionInfo)||[]).map((function(e){var t,n=null===(t=e.qCardinalities)||void 0===t?void 0:t.qHypercubeCardinal;if(n)return n;var i=e.qStateCounts||{},r=i.qLocked,o=void 0===r?0:r,a=i.qOption,s=void 0===a?0:a,l=i.qSelected;return o+s+(void 0===l?0:l)}))}function Nt(e){switch(e.qHyperCube.qMode){case"S":return function(e){var t=e.qHyperCube.qSize;return{refs:{dataPages:"qHyperCube.qDataPages"},size:{x:t.qcx,y:t.qcy,dimensions:Et(e)}}}(e);case"K":return function(e){var t=Et(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=Et(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,n=e.children,i=n&&n.length;if(i)for(;--i>=0;)t+=n[i].value;else t=1;e.value=t}function Ot(e,t){e instanceof Map?(e=[void 0,e],void 0===t&&(t=Tt)):void 0===t&&(t=Ft);for(var n,i,r,o,a,s=new Ht(e),l=[s];n=l.pop();)if((r=t(n.data))&&(a=(r=Array.from(r)).length))for(n.children=r,o=a-1;o>=0;--o)l.push(i=r[o]=new Ht(r[o])),i.parent=n,i.depth=n.depth+1;return s.eachBefore(Vt)}function Ft(e){return e.children}function Tt(e){return Array.isArray(e)?e[1]:null}function Rt(e){void 0!==e.data.value&&(e.value=e.data.value),e.data=e.data.data}function Vt(e){var t=0;do{e.height=t}while((e=e.parent)&&e.height<++t)}function Ht(e){this.data=e,this.depth=this.height=0,this.parent=null}Ht.prototype=Ot.prototype={constructor:Ht,count:function(){return this.eachAfter(Pt)},each:function(e,t){let n=-1;for(const i of this)e.call(t,i,++n,this);return this},eachAfter:function(e,t){for(var n,i,r,o=this,a=[o],s=[],l=-1;o=a.pop();)if(s.push(o),n=o.children)for(i=0,r=n.length;i<r;++i)a.push(n[i]);for(;o=s.pop();)e.call(t,o,++l,this);return this},eachBefore:function(e,t){for(var n,i,r=this,o=[r],a=-1;r=o.pop();)if(e.call(t,r,++a,this),n=r.children)for(i=n.length-1;i>=0;--i)o.push(n[i]);return this},find:function(e,t){let n=-1;for(const i of this)if(e.call(t,i,++n,this))return i},sum:function(e){return this.eachAfter((function(t){for(var n=+e(t.data)||0,i=t.children,r=i&&i.length;--r>=0;)n+=i[r].value;t.value=n}))},sort:function(e){return this.eachBefore((function(t){t.children&&t.children.sort(e)}))},path:function(e){for(var t=this,n=function(e,t){if(e===t)return e;var n=e.ancestors(),i=t.ancestors(),r=null;for(e=n.pop(),t=i.pop();e===t;)r=e,e=n.pop(),t=i.pop();return r}(t,e),i=[t];t!==n;)t=t.parent,i.push(t);for(var r=i.length;e!==n;)i.splice(r,0,e),e=e.parent;return i},ancestors:function(){for(var e=this,t=[e];e=e.parent;)t.push(e);return t},descendants:function(){return Array.from(this)},leaves:function(){var e=[];return this.eachBefore((function(t){t.children||e.push(t)})),e},links:function(){var e=this,t=[];return e.each((function(n){n!==e&&t.push({source:n.parent,target:n})})),t},copy:function(){return Ot(this).eachBefore(Rt)},[Symbol.iterator]:function*(){var e,t,n,i,r=this,o=[r];do{for(e=o.reverse(),o=[];r=e.pop();)if(yield r,t=r.children)for(n=0,i=t.length;n<i;++n)o.push(t[n])}while(o.length)}},kt=function(e){
7
+ import{useElement as e,useOptions as t,useState as n,useEffect as r,useStaleLayout as i,useTheme as o,useApp as a,useModel as s,useRect as l,useTranslator as u,useAppLayout as c,useInteractionState as p,usePromise as f,onTakeSnapshot as d}from"@nebula.js/stardust";import m from"picasso-plugin-q";import h from"picasso.js";function g(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function y(e,t,n){return(t=function(e){var t=function(e){if("object"!=typeof e||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function v(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function b(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?v(Object(n),!0).forEach((function(t){y(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):v(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function x(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,i,o,a,s=[],l=!0,u=!1;try{if(o=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;l=!1}else for(;!(l=(r=o.call(n)).done)&&(s.push(r.value),s.length!==t);l=!0);}catch(e){u=!0,i=e}finally{try{if(!l&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(u)throw i}}return s}}(e,t)||S(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 q(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)||S(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 D(e){return D="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},D(e)}function S(e,t){if(e){if("string"==typeof e)return g(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?g(e,t):void 0}}var M=["American Typewriter, serif","Andalé Mono, monospace","Arial Black, sans-serif","Arial, sans-serif","Bradley Hand, cursive","Brush Script MT, cursive","Comic Sans MS, cursive","Courier, monospace","Didot, serif","Georgia, serif","Impact, sans-serif","Lucida Console, monospace","Luminari, fantasy","Monaco, monospace","QlikView Sans, sans-serif","Source Sans Pro, sans-serif","Tahoma, sans-serif","Times New Roman, serif","Trebuchet MS, sans-serif","Verdana, sans-serif"],A=["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 w(e){var t=e.theme,n=e.translator,r=e.defaultValue,i=e.flags,o=[],a=t.getStyle("","","fontFamilies");return Array.isArray(a)&&a.length?o.push.apply(o,q(new Set([r].concat(q(a.map((function(e){return e.split(",").map((function(e){return e.trim()})).map((function(e){return e.replace(/\s+/g," ").trim()})).filter(Boolean).join(", ")}))))))):o.push(r),[{value:"ThemeHeader",label:n.get("properties.themeFonts"),metaText:n.get("properties.theme"),groupHeader:!0}].concat(q(o.map((function(e){return I(e)}))),[{value:"DefaultHeader",label:n.get("properties.allFonts"),metaText:n.get("properties.default"),groupHeader:!0}],q(function(e){return null!=e&&e.isEnabled("PS_20852_WYSIWYG_FONT_SUPPORT")?A:M}(i).map((function(e){return I(e)}))))}function k(e){var t=e.theme,n=e.translator,r=e.id,i=e.path,o=e.flags,a=function(){return t.getStyle(r,i,"fontFamily")};return{getDefaultValue:function(){return a()},getOptions:function(){return w({theme:t,translator:n,defaultValue:a(),flags:o})}}}var C,L,E=["10px","11px","12px","13px","14px","15px","16px","17px","18px","19px","20px","21px","22px","23px","24px"],N=function(e){return{value:e,label:e,groupHeader:!1,disabled:!1}};function P(e){var t=e.theme,n=e.translator,r=e.id,i=e.path,o=function(){return t.getStyle(r,i,"fontSize")};return{getDefaultValue:function(){return o()},getOptions:function(){return function(e){var t=e.translator,n=e.defaultValue,r=[],i=e.theme.getStyle("","","fontSizes");return Array.isArray(i)&&i.length?r.push.apply(r,q(new Set([n].concat(q(i))))):r.push(n),[{value:"ThemeHeader",label:t.get("properties.themeFontSizes"),metaText:t.get("properties.theme"),groupHeader:!0}].concat(q(r.map((function(e){return N(e)}))),[{value:"DefaultHeader",label:t.get("properties.allFontSizes"),metaText:t.get("properties.default"),groupHeader:!0}],q(E.map((function(e){return N(e)}))))}({theme:t,translator:n,defaultValue:o()})}}}function O(e){var t=e.theme,n=e.translator,r=e.id,i=e.path;return{fontFamily:k({theme:t,translator:n,id:r,path:i,flags:e.flags}),fontSize:P({theme:t,translator:n,id:r,path:i})}}var F,T=function(){if(L)return C;L=1;var e=Object.prototype.hasOwnProperty,t=Object.prototype.toString,n=Object.defineProperty,r=Object.getOwnPropertyDescriptor,i=function(e){return"function"==typeof Array.isArray?Array.isArray(e):"[object Array]"===t.call(e)},o=function(n){if(!n||"[object Object]"!==t.call(n))return!1;var r,i=e.call(n,"constructor"),o=n.constructor&&n.constructor.prototype&&e.call(n.constructor.prototype,"isPrototypeOf");if(n.constructor&&!i&&!o)return!1;for(r in n);return void 0===r||e.call(n,r)},a=function(e,t){n&&"__proto__"===t.name?n(e,t.name,{enumerable:!0,configurable:!0,value:t.newValue,writable:!0}):e[t.name]=t.newValue},s=function(t,n){if("__proto__"===n){if(!e.call(t,n))return;if(r)return r(t,n).value}return t[n]};return C=function e(){var t,n,r,l,u,c,p=arguments[0],f=1,d=arguments.length,m=!1;for("boolean"==typeof p&&(m=p,p=arguments[1]||{},f=2),(null==p||"object"!=typeof p&&"function"!=typeof p)&&(p={});f<d;++f)if(null!=(t=arguments[f]))for(n in t)r=s(p,n),p!==(l=s(t,n))&&(m&&l&&(o(l)||(u=i(l)))?(u?(u=!1,c=r&&i(r)?r:[]):c=r&&o(r)?r:{},a(p,{name:n,newValue:e(m,c,l)})):void 0!==l&&a(p,{name:n,newValue:l}));return p},C}(),R=(F=T)&&F.__esModule&&Object.prototype.hasOwnProperty.call(F,"default")?F.default:F;function V(e,t){return{range:function(e){var n=e.resources,r=e.data,i=n.theme.palette("categorical",0===t?r.items.length:t);return r.items.map((function(e){return i[e.value%i.length]}))},valueAccessor:e.value}}function H(e,t){return{range:function(e){var n=e.resources,r=e.data,i=n.theme.palette("categorical",0===t?r.items.length:t);return r.items.map((function(e){return i[e.row.value%i.length]}))},valueAccessor:e.value}}function j(e,t,n,r,i){var o,a,s=i.byRow,l=i.byElemNo;if(r&&(t.input.persistent||e.hc.qDimensionInfo.length>1||void 0===n.activeDimensionIndex&&e.hc.qSize.qcy>((null===(a=(o=e.hc).qDataPages[0]||o.qStackedDataPages[0])||void 0===a?void 0:a.qArea.qHeight)||0)))return l(r,r.raw().qCardinal);if(r){var u=t.pic.extract({field:r.key(),trackBy:r.value}).length;return s(r,u)}return{}}function z(e,t){var n=e.hc.qDimensionInfo,r=t.input.byDimDef||{activeDimensionIndex:n.length-1};if(r.activeDimensionIndex>=0){var i=n[r.activeDimensionIndex];r=i.coloring&&i.coloring.colorMapRef?{type:"libraryItem",key:i.coloring.colorMapRef,activeDimensionIndex:r.activeDimensionIndex}:{activeDimensionIndex:r.activeDimensionIndex}}return r}function _(e,t){var n;return t.activeDimensionIndex>=0?n=e.pic.fields().filter((function(e){return"dimension"===e.type()}))[t.activeDimensionIndex]:"libraryItem"===t.type?!1===(n=t.key?e.pic.field((function(e){return e.raw().colorMapRef===t.key})):void 0)&&(n=e.pic.field((function(e){return"colorByAlternative"===e.raw().id}))):"expression"===t.type&&(n=e.pic.field((function(e){return"colorByAlternative"===e.raw().id}))),n}function B(e,t,n){e.prototype=t.prototype=n,n.constructor=e}function $(e,t){var n=Object.create(e.prototype);for(var r in t)n[r]=t[r];return n}function G(){}var U=1/.7,W="\\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\\(${W},${W},${W}\\)$`),J=new RegExp(`^rgb\\(${K},${K},${K}\\)$`),Q=new RegExp(`^rgba\\(${W},${W},${W},${X}\\)$`),ee=new RegExp(`^rgba\\(${K},${K},${K},${X}\\)$`),te=new RegExp(`^hsl\\(${X},${K},${K}\\)$`),ne=new RegExp(`^hsla\\(${X},${K},${K},${X}\\)$`),re={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 ie(){return this.rgb().formatHex()}function oe(){return this.rgb().formatRgb()}function ae(e){var t,n;return e=(e+"").trim().toLowerCase(),(t=Z.exec(e))?(n=t[1].length,t=parseInt(t[1],16),6===n?se(t):3===n?new pe(t>>8&15|t>>4&240,t>>4&15|240&t,(15&t)<<4|15&t,1):8===n?le(t>>24&255,t>>16&255,t>>8&255,(255&t)/255):4===n?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 pe(t[1],t[2],t[3],1):(t=J.exec(e))?new pe(255*t[1]/100,255*t[2]/100,255*t[3]/100,1):(t=Q.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=ne.exec(e))?ye(t[1],t[2]/100,t[3]/100,t[4]):re.hasOwnProperty(e)?se(re[e]):"transparent"===e?new pe(NaN,NaN,NaN,0):null}function se(e){return new pe(e>>16&255,e>>8&255,255&e,1)}function le(e,t,n,r){return r<=0&&(e=t=n=NaN),new pe(e,t,n,r)}function ue(e){return e instanceof G||(e=ae(e)),e?new pe((e=e.rgb()).r,e.g,e.b,e.opacity):new pe}function ce(e,t,n,r){return 1===arguments.length?ue(e):new pe(e,t,n,null==r?1:r)}function pe(e,t,n,r){this.r=+e,this.g=+t,this.b=+n,this.opacity=+r}function fe(){return`#${ge(this.r)}${ge(this.g)}${ge(this.b)}`}function de(){const e=me(this.opacity);return`${1===e?"rgb(":"rgba("}${he(this.r)}, ${he(this.g)}, ${he(this.b)}${1===e?")":`, ${e})`}`}function me(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function he(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function ge(e){return((e=he(e))<16?"0":"")+e.toString(16)}function ye(e,t,n,r){return r<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new be(e,t,n,r)}function ve(e){if(e instanceof be)return new be(e.h,e.s,e.l,e.opacity);if(e instanceof G||(e=ae(e)),!e)return new be;if(e instanceof be)return e;var t=(e=e.rgb()).r/255,n=e.g/255,r=e.b/255,i=Math.min(t,n,r),o=Math.max(t,n,r),a=NaN,s=o-i,l=(o+i)/2;return s?(a=t===o?(n-r)/s+6*(n<r):n===o?(r-t)/s+2:(t-n)/s+4,s/=l<.5?o+i:2-o-i,a*=60):s=l>0&&l<1?0:a,new be(a,s,l,e.opacity)}function be(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}function xe(e){return(e=(e||0)%360)<0?e+360:e}function qe(e){return Math.max(0,Math.min(1,e||0))}function De(e,t,n){return 255*(e<60?t+(n-t)*e/60:e<180?n:e<240?t+(n-t)*(240-e)/60:t)}B(G,ae,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:ie,formatHex:ie,formatHex8:function(){return this.rgb().formatHex8()},formatHsl:function(){return ve(this).formatHsl()},formatRgb:oe,toString:oe}),B(pe,ce,$(G,{brighter(e){return e=null==e?U:Math.pow(U,e),new pe(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=null==e?.7:Math.pow(.7,e),new pe(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new pe(he(this.r),he(this.g),he(this.b),me(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:de,toString:de})),B(be,(function(e,t,n,r){return 1===arguments.length?ve(e):new be(e,t,n,null==r?1:r)}),$(G,{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,n=this.l,r=n+(n<.5?n:1-n)*t,i=2*n-r;return new pe(De(e>=240?e-240:e+120,i,r),De(e,i,r),De(e<120?e+240:e-120,i,r),this.opacity)},clamp(){return new be(xe(this.h),qe(this.s),qe(this.l),me(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=me(this.opacity);return`${1===e?"hsl(":"hsla("}${xe(this.h)}, ${100*qe(this.s)}%, ${100*qe(this.l)}%${1===e?")":`, ${e})`}`}}));const Se=Math.PI/180,Me=180/Math.PI,Ae=4/29,Ie=6/29,we=3*Ie*Ie;function ke(e){if(e instanceof Ce)return new Ce(e.l,e.a,e.b,e.opacity);if(e instanceof Oe)return Fe(e);e instanceof pe||(e=ue(e));var t,n,r=Pe(e.r),i=Pe(e.g),o=Pe(e.b),a=Le((.2225045*r+.7168786*i+.0606169*o)/1);return r===i&&i===o?t=n=a:(t=Le((.4360747*r+.3850649*i+.1430804*o)/.96422),n=Le((.0139322*r+.0971045*i+.7141733*o)/.82521)),new Ce(116*a-16,500*(t-a),200*(a-n),e.opacity)}function Ce(e,t,n,r){this.l=+e,this.a=+t,this.b=+n,this.opacity=+r}function Le(e){return e>.008856451679035631?Math.pow(e,1/3):e/we+Ae}function Ee(e){return e>Ie?e*e*e:we*(e-Ae)}function Ne(e){return 255*(e<=.0031308?12.92*e:1.055*Math.pow(e,1/2.4)-.055)}function Pe(e){return(e/=255)<=.04045?e/12.92:Math.pow((e+.055)/1.055,2.4)}function Oe(e,t,n,r){this.h=+e,this.c=+t,this.l=+n,this.opacity=+r}function Fe(e){if(isNaN(e.h))return new Ce(e.l,0,0,e.opacity);var t=e.h*Se;return new Ce(e.l,Math.cos(t)*e.c,Math.sin(t)*e.c,e.opacity)}B(Ce,(function(e,t,n,r){return 1===arguments.length?ke(e):new Ce(e,t,n,null==r?1:r)}),$(G,{brighter(e){return new Ce(this.l+18*(null==e?1:e),this.a,this.b,this.opacity)},darker(e){return new Ce(this.l-18*(null==e?1:e),this.a,this.b,this.opacity)},rgb(){var e=(this.l+16)/116,t=isNaN(this.a)?e:e+this.a/500,n=isNaN(this.b)?e:e-this.b/200;return new pe(Ne(3.1338561*(t=.96422*Ee(t))-1.6168667*(e=1*Ee(e))-.4906146*(n=.82521*Ee(n))),Ne(-.9787684*t+1.9161415*e+.033454*n),Ne(.0719453*t-.2289914*e+1.4052427*n),this.opacity)}})),B(Oe,(function(e,t,n,r){return 1===arguments.length?function(e){if(e instanceof Oe)return new Oe(e.h,e.c,e.l,e.opacity);if(e instanceof Ce||(e=ke(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)*Me;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,n,null==r?1:r)}),$(G,{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 Fe(this).rgb()}}));var Te=e=>()=>e;function Re(e,t){var n=t-e;return n?function(e,t){return function(n){return e+n*t}}(e,n):Te(isNaN(e)?t:e)}var Ve=function e(t){var n=function(e){return 1==(e=+e)?Re:function(t,n){return n-t?function(e,t,n){return e=Math.pow(e,n),t=Math.pow(t,n)-e,n=1/n,function(r){return Math.pow(e+r*t,n)}}(t,n,e):Te(isNaN(t)?n:t)}}(t);function r(e,t){var r=n((e=ce(e)).r,(t=ce(t)).r),i=n(e.g,t.g),o=n(e.b,t.b),a=Re(e.opacity,t.opacity);return function(t){return e.r=r(t),e.g=i(t),e.b=o(t),e.opacity=a(t),e+""}}return r.gamma=e,r}(1),He=/^class(-pyramid)?/,je=function(e,t,n,r){var i=void 0!==n.min?n.min:r.min(),o=void 0!==n.max?n.max:r.max(),a=i,s=o,l=t.limits,u={},c="percent"===t.limitType?l.map((function(e){return i+(o-i)*e})):l,p=t.colors.map((function(t){return e.resolveUIColor(t)}));if(i=Math.min.apply(Math,[i].concat(q(c))),o=Math.max.apply(Math,[o].concat(q(c))),u.min=i,u.max=o,t.breakTypes&&-1===t.breakTypes.indexOf(!0))u.type="categorical",Object.assign(u,function(e){var t=e.min,n=e.max,r=e.limits,i=e.range,o=[],a=[];if(r.length)if(r[r.length-1]<t)a.push(t,n),o.push(i[i.length-1],i[i.length-1],i[i.length-1]);else if(r[0]>n)a.push(t,n),o.push(i[0],i[0],i[0]);else{if(r[0]>t)a.push(t),o.push(i[0]);else{a.push(t);for(var s=0;s<r.length;s++)if(t<r[s]){o.push(i[s]);break}}for(var l=0;l<r.length;l++)t<r[l]&&r[l]<n&&(a.push(r[l]),o.push(i[l]));if(r[r.length-1]<n)a.push(n),o.push(i[r.length]),o.push(i[r.length]);else{a.push(n);for(var u=0;u<r.length;u++)if(r[u]>n){o.push(i[u]),o.push(i[u]);break}}}else o.push(i[0]);return{min:t,max:n,range:o,domain:a}}({min:"percent"===t.limitType?i:a,max:"percent"===t.limitType?o:s,range:p,limits:"percent"===t.limitType?c:l}));else if(t.breakTypes){var f=t.breakTypes;u.type="continuous",u.domain=[i],u.range=[p[0]];for(var d=0;d<c.length;d+=1)if(f[d]){var m=p[d],h=p[d+1],g=Ve(m,h)(.5);u.range.push(g),u.domain.push(c[d]),d<c.length-1&&f[d+1]&&(u.range.push(p[d+1]),u.domain.push((c[d]+c[d+1])/2))}else u.range.push(p[d]),u.range.push(p[d+1]),u.domain.push(c[d]),u.domain.push(c[d]+Math.min(1e-6,(o-i)/1e6));u.range.push(p[p.length-1]),u.domain.push(o)}else u.domain=c,u.range=p;return u};function ze(e,t,n,r,i){var o,a,s,l=0,u=[],c=(e-t)/(r+1);if(0===c)return 1;for(o=0;o<n.length;o+=1)a=.99*(n[o]-t),s=n[o]>e?Math.floor(e/c):n[o]<t?0:Math.floor(a/c),Number.isNaN(s)||(u[s]?u[s]+=1:u[s]=1);for(o=0;o<u.length;o+=1)u[o]&&(l+=1);return l<=r||l>=i?Math.max(l,r):ze(e,t,n,r+1,i)}var _e=function(e,t,n,r){var i,o,a=t.theme,s=t.hc,l=r.f,u={mode:"field",fieldType:"measure",field:l?l.key():void 0,reverse:n.input.reverseScheme||!1,type:"continuous",range:function(e){return e.resources.theme.palette("quant")}},c=[],p=!0;if(l){if(Number.isNaN(+l.min())||Number.isNaN(+l.max()))return{invalid:!0};(p=!("S"===(i=n.pic.raw()).qMode&&(i.qDataPages[0]&&i.qSize.qcy>i.qDataPages[0].qArea.qHeight||!i.qDataPages.length&&i.qSize.qcy>0)||"K"===i.qMode&&i.qStackedDataPages[0]&&i.qSize.qcy>i.qStackedDataPages[0].qArea.qHeight||"T"===i.qMode&&i.qSize.qcy>i.qTreeDataPages[0].qGroupSize))&&(c=n.pic.extract({field:0,props:{num:{field:l.key()},exclude:{fields:s.qDimensionInfo.map((function(e,t){return{field:"qDimensionInfo/".concat(t)}})),value:function(e){return Math.min.apply(Math,q(e))<0}}}}).filter((function(e){return e.value>=0&&!e.exclude.value})).map((function(e){return e.num.value})).filter((function(e){return"number"==typeof e})))}if(!1===n.input.autoMinMax){if(u.min=n.input.measureMin,u.max=n.input.measureMax,u.max<u.min)return{invalid:!0}}else if(l&&!p)u.min=l.min(),u.max=l.max();else if(l){if(!c.length)return{invalid:!0};u.min=Math.min.apply(Math,q(c)),u.max=Math.max.apply(Math,q(c))}if(n.input.measureScheme&&(u.palettes={quant:n.input.measureScheme}),a){var f=a.getDataColorScales().filter((function(e){return e.key===n.input.measureScheme}))[0];u.type=f&&He.test(f.type)?"categorical":"continuous","categorical"===u.type&&(o=f.colors.some((function(e){return Array.isArray(e)}))?Math.max.apply(Math,q(f.colors.map((function(e){return e?e.length:0})))):f.colors.length)}if("categorical"===u.type){for(var d=p?ze(u.max,u.min,c,1,o):o,m=(u.max-u.min)/d,h=[],g=0;g<d+1;g+=1)h.push(u.min+m*g);u.domain=h,u.range=function(e){for(var t=e.resources.theme.palette("quant",d),n=Math.max(1,Math.floor(t.length/d)),r=[],i=0;i<d;i+=1)r.push(t[i*n]);return[r[0]].concat(r,[r[r.length-1]])}}return u};function Be(e,t){var n;return t.activeMeasureIndex>=0?n=e.pic.fields().filter((function(e){return"measure"===e.type()}))[t.activeMeasureIndex]:"libraryItem"===t.type?n=e.pic.field((function(e){return e.raw().colorMapRef===t.key&&void 0!==t.key})):"expression"===t.type&&(n=e.pic.field((function(e){return"colorByAlternative"===e.raw().id}))),n||(n=e.pic.field((function(e){return void 0!==e.raw().matchMeasure})))&&(n=e.pic.fields().filter((function(e){return"measure"===e.type()}))[n.raw().matchMeasure]),n}function $e(e){e.measureOverrides.every((function(e){return!e}))&&(e.measureOverrides=null)}function Ge(e,t){for(var n=(null==t?void 0:t.domain)||[],r=(null==t?void 0:t.range)||[],i=[],o=0;o<e.length;++o){var a=e[o];if("constant"===(null==a?void 0:a.mode)){var s=n.indexOf(o);-1===s?(n.push(o),r.push(a.primary)):r[s]=a.primary,e[o]=null}else if(a){i.push(o);var l=n.indexOf(o);-1!==l&&(n.splice(l,1),r.splice(l,1))}}return{domain:n,range:r,exclude:i}}function Ue(e,t,n,r){var i,o=function(e,t,n,r){if(t.input&&!t.input.auto){if("byMeasure"===t.input.mode)return function(e,t,n){var r=t.theme,i=t.hc,o=(arguments.length>3&&void 0!==arguments[3]?arguments[3]:{}).getCField,a=void 0===o?Be:o,s=n.input.byMeasureDef||{activeMeasureIndex:0},l=a(n,s),u=_e(0,{theme:r,hc:i},n,{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=n.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=n.pic.fields().filter((function(e){return"measure"===e.type()}))[l.raw().matchMeasure]),n.input.useMeasureGradient&&"libraryItem"===s.type)if(c){var p=c.raw().coloring;p&&p.gradient&&R(u,je(e,p.gradient,u,c))}else u.auxiliary=s;return u}(e,n,t);if("byDimension"===t.input.mode)return function(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},i=r.getCDef,o=void 0===i?z:i,a=r.getCByField,s=void 0===a?_:a,l=r.getPersistence,u=void 0===l?j:l,c=o(t,n),p=s(n,c),f=p?p.raw():{},d=n&&n.pic?n.pic.raw():{};if(f.qError||f.qSize&&0===f.qSize.qcy&&!d.qHasOtherValues)return{invalid:!0};var m={mode:"field",fieldType:"dimension",type:"categorical",field:p?p.key():void 0,isFieldLocked:f.qLocked};return("expression"===c.type||c.activeDimensionIndex<0)&&(m.label=c.label,"color.altLabel"===f.labelExpRef&&(m.label=n.input.altLabel)),!m.label&&p&&(m.label=p.title()),n.input.dimensionScheme&&(m.palettes={categorical:n.input.dimensionScheme}),n.input.useDimColVal&&"libraryItem"===c.type&&(m.auxiliary=c),R(m,u(t,n,c,p,{byRow:H,byElemNo:V})),m}(e,n,t);if("byExpression"===t.input.mode)return function(e,t,n,r){var i=t.hc,o=t.theme,a=t.translator,s=n.pic.field((function(e){return"colorByExpression"===e.raw().id}));if(!s||!s.raw().qFallbackTitle&&!n.input.colorExpression||!(Number.isFinite(s.raw().qMin)&&Number.isFinite(s.raw().qMax)||n.input.expressionIsColor))return{mode:"constant",type:"constant",primary:r.nil};if(n.input.expressionIsColor)return{mode:"field",fieldType:"expression",field:s?s.key():void 0,type:"color"};var l=_e(0,{hc:i,theme:o},n,{f:s});return l.invalid||(l.label=n.input.expressionLabel||a.get("Object.ChartTooltip.ColorExpression")),l}(0,n,t,r);if("byMultiple"===t.input.mode||"primary"===t.input.mode)return function(e,t,n,r){var i=t.hc,o=t.theme,a=t.translator,s=n.input.useBaseColors;if(("byMultiple"===n.input.mode||"primary"===n.input.mode&&"measure"===n.input.useBaseColors)&&i.qMeasureInfo.length>1&&(s="measure"),"measure"===s){var l=[],u=[];"measure"===n.input.useBaseColors&&i.qMeasureInfo.forEach((function(t,n){if(t.baseColor||t.coloring&&t.coloring.baseColor){l.push(n);var i=e.resolveUIColor(t.baseColor||t.coloring.baseColor);"none"===i?u.push(r.primary):u.push(i)}}));var c=n.input.dimensionScheme?{categorical:n.input.dimensionScheme}:void 0,p=o?o.getDataColorPalettes()[0]:void 0;return"measure"===n.input.useBaseColors&&p&&(c={categorical:p.key}),{mode:"measure",type:"categorical",palettes:c,label:a?a.get("Common.Measures"):void 0,explicit:l.length?{domain:l,range:u}:void 0}}if("dimension"===s){var f=[],d=[];return i.qDimensionInfo.forEach((function(t,n){if(t.baseColor||t.coloring&&t.coloring.baseColor){f.push(n);var i=e.resolveUIColor(t.baseColor||t.coloring.baseColor);"none"===i?d.push(r.primary):d.push(i)}})),{mode:"dimension",type:"categorical",field:f.length?f[0]:void 0,explicit:f.length?{domain:f,range:d}:void 0}}var m=r.primary;if(void 0!==n.input.paletteColor)n.input.paletteColor&&(m=e.resolveUIColor(n.input.paletteColor));else{var h=n.input.singleColor;"number"!=typeof h||Number.isNaN(h)||(m=["#b0afae","#7b7a78","#545352","#4477aa","#7db8da","#b6d7ea","#46c646","#f93f17","#ffcf02","#276e27","#ffffff","#000000"][h])}return{mode:"constant",type:"constant",primary:m}}(e,n,t,r)}return{}}(e,t,n,r);return null!==(i=t.input)&&void 0!==i&&i.measureOverrides?(o.measureOverrides=t.input.measureOverrides.map((function(n,i){return function(e){var t,n=e.cm,r=e.defaults,i=e.index,o=e.input,a=e.pic;if(!o||!o.on)return null;var s=null!==(t=o.mode)&&void 0!==t?t:"primary";return"primary"===s?function(e,t,n){var r=n.primary;return void 0!==t.paletteColor&&t.paletteColor&&(r=e.resolveUIColor(t.paletteColor)),b(b({},n),{},{mode:"constant",type:"constant",primary:r})}(n,o,r):"byExpression"===s?function(e,t,n){var r="qMeasureInfo/".concat(e,"/"),i=t.field((function(e){return e.id().startsWith(r)&&"colorByMeasureExpression"===e.raw().id})),o=i;return b(b({},n),{},o?{mode:"field",fieldType:"expression",field:i?i.key():void 0,type:"color"}:{mode:"constant",type:"constant",primary:n.nil})}(i,a,r):null}({cm:e,input:n,defaults:r,index:i,pic:t.pic})})),function(e,t){var n,r,i,o=t.translator;if($e(e),1===(null===(n=e.measureOverrides)||void 0===n?void 0:n.length))return e.measureOverrides[0];if("measure"===e.mode&&e.measureOverrides&&(e.explicit=Ge(e.measureOverrides,e.explicit),$e(e)),null!==(r=e.measureOverrides)&&void 0!==r&&r.every((function(e){return"constant"===(null==e?void 0:e.mode)}))){var a={mode:"measure",type:"categorical",label:null==o?void 0:o.get("Common.Measures")};return a.explicit=Ge(e.measureOverrides),a}return null!==(i=e.measureOverrides)&&void 0!==i&&i.every((function(e){return e}))?{invalid:!0,measureOverrides:e.measureOverrides}:e}(o,n)):o}var We=function(e,t){var n=e.fieldType,r={};if(t)if("measure"===n){var i=t.coloring;i&&(r.measureGradient=i.gradient)}else if("dimension"===n){var o=t[0],a=t[1];o&&(r.legendDataPage=o),a&&(r.dimValsData=a.colorMap)}return r},Xe=function(e){throw e.isHandled=!0,e};function Ke(e){return function(t){return"object"===D(t.datum[e])?t.datum[e].value:void 0}}function Ze(e){return"object"===D(e.datum.isNull)?e.datum.isNull.value:-2===e.datum.value}function Ye(e){return-3===e.datum.value}var Je={COLOR:void 0,FONT_SIZE:"16px",FONT_FAMILY:"'Source Sans Pro', 'Arial', 'sans-serif'"},Qe={COLOR:void 0,FONT_SIZE:void 0,FONT_FAMILY:"'Source Sans Pro', 'Arial', 'sans-serif'"};function et(e){var t=e.theme,n=e.key,r=e.styleOverrides,i={title:{color:Je.COLOR,fontSize:Je.FONT_SIZE,fontFamily:Je.FONT_FAMILY},label:{color:Qe.COLOR,fontSize:Qe.FONT_SIZE,fontFamily:Qe.FONT_FAMILY}};if(!t&&!r)return i;var o=r||{},a=o.title,s=o.label,l=function(e){var t=e.theme,n=e.key;return function(e,r,i,o){return void 0!==e?e:t?t.getStyle(n,r,i):o}}({theme:t,key:n});return i.title.color=l(null==a?void 0:a.color,"legend.title","color",Je.COLOR),i.title.fontSize=l(null==a?void 0:a.fontSize,"legend.title","fontSize",Je.FONT_SIZE),i.title.fontFamily=l(null==a?void 0:a.fontFamily,"legend.title","fontFamily",Je.FONT_FAMILY),i.label.color=l(null==s?void 0:s.color,"legend.label","color",Qe.COLOR),i.label.fontSize=l(null==s?void 0:s.fontSize,"legend.label","fontSize",Qe.FONT_SIZE),i.label.fontFamily=l(null==s?void 0:s.fontFamily,"legend.label","fontFamily",Qe.FONT_FAMILY),i}var tt=function(e,t,n){var r=e&&e.dock||void 0;if("auto"!==r)return r||"right";if(t){var i=t.element.getBoundingClientRect();if(i.height>i.width)return"bottom"}return n?"left":"right"},nt=function(e,t,n){return!(n.invalid||"color"===n.type||"measure"===n.mode&&t.qMeasureInfo.length<=1||"dimension"===n.mode)&&("function"==typeof e.show?e.show():!1!==e.show)};function rt(e,t){var n=e.styleReference,r=e.styleOverrides,i=e.chart,o=e.rtl,a=t.legendProps,s=t.coloring,l=t.theme,u=t.hc,c=et({theme:l,key:n,styleOverrides:r});return{layout:{minimumLayoutMode:"MEDIUM",dock:tt(a,i,o)},show:"function"==typeof a.show?function(){return nt(a,u,s)}:nt(a,u,s),renderer:"svg",mounted:function(e){e.childNodes[0].style.pointerEvents="none",e.style.overflow="hidden"},settings:{title:{show:!1!==a.showTitle,wordBreak:"break-word",maxLines:2,lineHeight:1.2,text:s.label||"",fill:c.title.color,fontSize:c.title.fontSize,fontFamily:c.title.fontFamily}}}}function it(e,t,n){var r=[],i=[],o=function(e,t,n){return"categorical"===t.coloring.type?function(e,t,n){var r=rt(e,t);if(!r.show)return!1;var i,o=e.key,a=e.styleReference,s=e.styleOverrides,l=e.viewState,u=e.rtl,c=e.settings,p=e.style,f=t.scaleKey,d=t.theme,m=t.scales,h=et({theme:d,key:a,styleOverrides:s}),g=r.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&&(i=function(e){return e.datum.value>=0||-3===e.datum.value});var x="".concat(f,"Legend");return R(!0,r,{type:"legend-cat",key:"".concat(o,"-cat"),scale:x in m?x:f,settings:{layout:{scrollOffset:function(){return l?l.get("legendScrollOffset"):void 0},size:-1!==["top","bottom"].indexOf(r.layout.dock)?2:1,direction:u?"rtl":"ltr",horizontal:20},item:{show:i,label:b({fill:h.label.color,fontSize:h.label.fontSize,fontFamily:h.label.fontFamily},y)},navigation:{disabled:n,button:{content:function(e,t){var n=t.direction;return e("i",{style:{"pointer-events":"none",fontSize:"12px",display:"inline-block",fontStyle:"normal",lineHeight:"0",textAlign:"center",textTransform:"none",verticalAlign:"-0.125em",textRendering:"optimizelegibility",margin:"0px"}},[e("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 16 16",fill:"currentColor"},[e("path",{d:v[n]})])])}}}},brush:{consume:[{context:"selection",data:["",o],style:{inactive:{opacity:.3}}}]}},{settings:c,style:p})}(e,t,n):"continuous"===t.coloring.type&&function(e,t){var n,r=e.key,i=e.styleReference,o=e.styleOverrides,a=e.rtl,s=e.settings,l=e.style,u=t.scaleKey,c=t.theme,p="".concat(u,"Range"),f=rt(e,t);if(!f.show)return!1;var d=et({theme:c,key:i,styleOverrides:o}),m=f.layout.dock,h="right"===m||"left"===m,g=null===(n=t.scales)||void 0===n?void 0:n[p];return h&&g&&(g.invert=!0),R(!0,f,{type:"legend-seq",key:"".concat(r,"-seq"),settings:{fill:u,major:p,length:1,tick:{fill:d.label.color,fontSize:d.label.fontSize,fontFamily:d.label.fontFamily},title:{anchor:!a||"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,n&&n.navigationDisabled);return r.push(o),o&&"legend-cat"===o.type&&(i.push(function(e){var t=e.key,n=e.requireFailure,r=e.recognizeWith,i=(arguments.length>1&&void 0!==arguments[1]?arguments[1]:{}).actions;return{key:"event:tap-".concat(t),type:"Tap",requireFailure:n,recognizeWith:r,options:{event:"legendtap",interval:10,pointers:1,enable:function(e,n){var r;if(!n)return!0;if(null!=i&&null!==(r=i.interact)&&void 0!==r&&r.enabled&&!i.interact.enabled())return!1;if(!this.chart.componentsFromPoint({x:n.center.x,y:n.center.y}).some((function(e){return e.key==="".concat(t,"-cat")})))return!1;var o=n.srcEvent.target;return!!(o&&o.hasAttribute("data-action")&&o.hasAttribute("data-component-key"))||!(!o||!o.childNodes[0]||"BUTTON"!==o.childNodes[0].nodeName)}},events:{legendtap:function(e){e.preventDefault();var t=e.srcEvent.target;t&&t.hasAttribute("data-action")&&t.hasAttribute("data-component-key")&&this.chart.component(t.getAttribute("data-component-key")).emit(t.getAttribute("data-action"))}}}}(e,n)),i.push(function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.eventName,n=e.key,r=e.requireFailure,i=e.recognizeWith,o=(arguments.length>1&&void 0!==arguments[1]?arguments[1]:{}).actions;return{key:"event:pan-".concat(n),type:"Pan",requireFailure:r,recognizeWith:i,options:{event:t,pointers:1,threshold:10,enable:function(e,r){var i;return this.started===t||!r||!(null!=o&&null!==(i=o.interact)&&void 0!==i&&i.enabled&&!o.interact.enabled())&&this.chart.componentsFromPoint({x:r.center.x,y:r.center.y}).some((function(e){return e.key==="".concat(n,"-cat")}))}},events:y(y(y({},"".concat(t,"start"),(function(e){e.preventDefault(),this.started!==t&&(this.started=t,this.chart.component("".concat(n,"-cat")).emit("panstart",e))})),"".concat(t,"move"),(function(e){e.preventDefault(),this.chart.component("".concat(n,"-cat")).emit("panmove",e)})),"".concat(t,"end"),(function(e){e.preventDefault(),this.chart.component("".concat(n,"-cat")).emit("panend",e),this.started=!1}))}}(e,n))),{interactions:i,components:r}}function ot(e){var t=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.auto,n=function(e){var t=b({hc:null,colorProps:null,layout:null,theme:null},e),n={},r={auto:function(){return{mode:"primary"}},getDimensionColorMap:function(){return Promise.reject()},getMeasure:function(){return Promise.reject()},getAttributeDimension:function(){return Promise.reject()}},i={auto:function(e){return e?(r.auto=e,i):r.auto},getDimensionColorMap:function(e){return e?(r.getDimensionColorMap=e,i):r.getDimensionColorMap},getAttributeDimension:function(e){return e?(r.getAttributeDimension=e,i):r.getAttributeDimension},getMeasure:function(e){return e?(r.getMeasure=e,i):r.getMeasure},set:function(e){var i;if(!e.colorProps)throw new Error('Missing "colorProps"');if(R(t,e),(n={pic:t.picasso.data("q")({data:t.hc,config:{localeInfo:t.localeInfo}}),input:t.colorProps}).input.auto){var o=r.auto(e.layout);n.input=R(!0,{},n.input,o,{auto:!1});var a=t.theme?t.theme.getDataColorPalettes():[];a[0]&&(n.input.dimensionScheme=a[0].key);var s=0;n.input.byDimDef&&+n.input.byDimDef.activeDimensionIndex>=0&&(s=+n.input.byDimDef.activeDimensionIndex),t.hc&&t.hc.qDimensionInfo[s]&&t.hc.qDimensionInfo[s].coloring&&t.hc.qDimensionInfo[s].coloring.colorMapRef&&n.input.byDimDef&&(n.input.byDimDef.type="libraryItem",n.input.byDimDef.key=t.hc.qDimensionInfo[s].coloring.colorMapRef)}null!==(i=n.input.measureOverrides)&&void 0!==i&&i.every((function(e){return!e||!e.on}))&&(n.input=R(!1,{},n.input,{measureOverrides:null}))},palettes:function(){if(!n.palettes){var e=t.theme,r=[];(e&&e.getDataColorPickerPalettes()||[]).forEach((function(e){r.push({key:"ui",colors:e.colors})})),n.palettes=r}return n.palettes},getAuxiliaryData:function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"/qHyperCubeDef";if(!e.auxiliary&&!/qAttrDimInfo/.test(e.field))return Promise.resolve();var i=(e.auxiliary||{}).key;if("measure"===e.fieldType)return r.getMeasure(i,t).catch((function(){}));if("dimension"===e.fieldType){var o="".concat(n,"/").concat(e.field).replace("qDimensionInfo","qDimensions").replace("qAttrDimInfo","qAttributeDimensions");return Promise.all([/qAttrDimInfo/.test(e.field)?r.getAttributeDimension(o,t).catch((function(){})):Promise.resolve(),i?r.getDimensionColorMap(i,t).catch((function(){})):Promise.resolve()])}return Promise.resolve()},getAuxiliarySettings:function(e,r){var i=this;return e.auxiliary||/qAttrDimInfo/.test(e.field)?(this.palettes(),this.getAuxiliaryData(e,r).then((function(r){if(!r)return{};if("measure"===e.fieldType){if(r.coloring&&r.coloring.gradient){var o=n.pic.field(e.field);return je(i,r.coloring.gradient,e,o)}return{}}if("dimension"===e.fieldType){var a={nil:e.nil,others:e.others},s=r[0],l=r[1]?r[1].colorMap:null;if(s){var u=t.picasso.data("q")({data:{qDimensionInfo:[n.pic.field(e.field).raw(),n.pic.field(e.field).raw()],qMeasureInfo:[],qDataPages:s,qInterColumnSortOrder:[0,1],qMode:"S"}});a.legendDataset=u}return l?function(e,t,n,r){var i=r.external,o=r.field,a=b({},e);R(a,V(o,o.raw().qCardinal));var s=i.theme?i.theme.getDataColorPalettes()[0]:null;return t.nul&&(a.nil=n.resolveUIColor(t.nul)),t.oth&&(a.others=n.resolveUIColor(t.oth)),t.usePal?(a.palettes={categorical:t.pal},s&&!t.pal&&(a.palettes.categorical=s.key,R(a,V(o)))):!1===t.autoFill&&t.single?a.range=[n.resolveUIColor(t.single)]:t.autoFill&&(s&&(a.palettes={categorical:s.key}),R(a,V(o))),t.colors&&t.colors.length&&(a.explicit=function(e,t,n){for(var r={},i=0;i<e.length;i+=1)r[e[i].value]=e[i].baseColor;var o=[];return{domain:function(e){var i=e.data,a=[];o=[];for(var s=0;s<i.items.length;s++){var l=i.items[s],u=(l.text||l).label;r[u]&&-1===a.indexOf(l.value)&&(a.push(l.value),o.push(t.resolveUIColor(r[u])))}return a.push(-3,-2),o.push(n.others),o.push(n.nil),a},range:function(){return o}}}(t.colors,n,a)),a}(a,l,i,{external:t,field:n.pic.field(e.field)}):a}return{}}))):Promise.resolve()},resolveUIColor:function(e){if(e.index<0||void 0===e.index)return e.color;if(void 0===n.uiPalette&&(n.uiPalette=this.palettes().filter((function(e){return"ui"===e.key}))[0]||!1),!n.uiPalette)return e.color;var t="none"===n.uiPalette.colors[0]?e.index:e.index-1;return void 0===n.uiPalette.colors[t]?e.color:n.uiPalette.colors[t]},settings:function(){if(this.palettes(),!n.settings){var e={primary:"steelblue",others:"#aaa",nil:"#ddd"},r=t.theme;r&&(e=b(b({},e),r.getDataColorSpecials())),n.settings=R(e,Ue(this,n,t,e))}return n.settings}};return i}(e.resources).auto(t||function(){return{mode:"byDimension",persistent:!1,useDimColVal:!0,byDimDef:{activeDimensionIndex:0,type:"expression",label:""}}}).getDimensionColorMap((function(e,t){return function(e,t){var n=t.layout,r=t.app;return n&&n.snapshotData?n.snapshotData.content&&n.snapshotData.content.chartData&&n.snapshotData.content.chartData.dimValsData?Promise.resolve({colorMap:n.snapshotData.content.chartData.dimValsData}):Promise.reject():r&&r.getObject?r.getObject("ColorMapModel_".concat(e)).then((function(e){return e.getLayout()})):Promise.reject()}(e,{layout:t.layout,app:t.app})})).getMeasure((function(e,t){return function(e,t){var n=t.layout,r=t.app;return n&&n.snapshotData?n.snapshotData.content&&n.snapshotData.content.chartData&&n.snapshotData.content.chartData.measureGradient?Promise.resolve({coloring:{gradient:n.snapshotData.content.chartData.measureGradient}}):Promise.reject():r&&r.getMeasure?r.getMeasure(e).then((function(e){return e.getMeasure()})):Promise.reject()}(e,{layout:t.layout,app:t.app})})).getAttributeDimension((function(e,t){return function(e,t){var n=t.layout,r=t.model,i=t.app;return n&&n.snapshotData?n.snapshotData.content&&n.snapshotData.content.chartData&&n.snapshotData.content.chartData.legendDataPage?Promise.resolve(n.snapshotData.content.chartData.legendDataPage):Promise.reject():r&&r.session&&i?r.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 n.getSnapshotData=We,n}({resources:e}),n={},r={},i=function(e){return r.settings||(e||console.warn("settings() called before auxiliarySettings()"),r.settings=t.settings()),r.settings},o={config:function(i){if(n=b({},i),r={},!n.key)throw new Error("Missing key");t.set(b(b({},e),n))},auto:function(e){return e?(t.auto(e),o):t.auto()},getAuxiliarySettings:function(e){return r.auxiliarySettings?Promise.resolve(r.auxiliarySettings):t.getAuxiliarySettings(i(!0),e).then((function(e){return r.auxiliarySettings=e||{},r.settings=b(b({},r.settings),r.auxiliarySettings),r.scales=void 0,r.color=void 0,r.auxiliarySettings}))},getAuxiliaryData:function(){return t.getAuxiliaryData(i())},getSnapshotData:function(e){var n=i();return t.getAuxiliaryData(n,e).then((function(e){return t.getSnapshotData(n,e)}))},resolveUIColor:function(e){return t.resolveUIColor(e)},settings:function(){var e=i();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=i().measureOverrides)||void 0===t?void 0:t[e])||this.settings()},isSelectionLocked:function(e){var t=e.isMeasureSelectionLocked;return function(e,t){var n=t.isMeasureSelectionLocked;return"field"!==e.mode||("dimension"===e.fieldType?e.isFieldLocked:"measure"!==e.fieldType||n)}(i(),{isMeasureSelectionLocked:t})},palettes:function(){return function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.colorProps,n=e.coloring,r=e.theme,i=[];if(n&&n.palettes&&r){var o=n.palettes.categorical||t.dimensionScheme,a=r.getDataColorPalettes().filter((function(e){return e.key===o}))[0]||r.getDataColorPalettes()[0];o&&a&&i.push({key:"categorical",colors:a.colors});var s=n.palettes.metric||t.measureScheme,l=r.getDataColorScales().filter((function(e){return e.key===s}))[0]||r.getDataColorScales()[0];if(l){var u=l.colors[0]?l.colors:[[]].concat(q(l.colors.slice(1)));u=Array.isArray(u[0])?u.map((function(e){return e.slice().reverse()})):u.slice().reverse(),i.push({key:"quant",colors:u})}}return i}({coloring:i(),colorProps:n.colorProps,theme:n.theme})},scales:function(){return r.scales=r.scales||function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.hc,n=e.coloring,r=e.rtl,i=e.key,o=e.source,a=e.picasso,s={},l=i;if(n){var u={override:!0,domain:n.explicit&&"function"==typeof n.explicit.domain?n.explicit.domain:[].concat(q((n.explicit||{}).domain||[]),[-3,-2]),range:n.explicit&&"function"==typeof n.explicit.range?n.explicit.range:[].concat(q((n.explicit||{}).range||[]),[n.others,n.nil])};if("field"===n.mode){if("dimension"===n.fieldType){var c,p=function(e){var t=e.hc,n=e.source,r=e.coloring,i={data:{extract:[{source:"dummy",field:0,filter:function(){return i.expando=t.qDataPages[0]?t.qDataPages[0].qArea.qTop:0,!1}},{source:n,field:r.field,trackBy:r.valueAccessor,reduce:"first",props:{row:{reduce:function(){return i.expando++}},text:{value:function(e){return e.qText},reduce:"first"}}}]},expando:0};return i}({hc:t,source:o,coloring:n}).data;if(n.legendDataset){var f=0,d={};a.data("q")({data:t}).extract({field:n.field,trackBy:n.valueAccessor,reduce:function(e){var t=e[0];return d[t]=f++,e[0]}}),c={source:"attrDim",extract:{field:"qDimensionInfo/0",filter:function(e){return e.qElemNumber>=0},props:{row:{value:function(e){return d[e.qElemNumber]}}}}}}var m={data:p,range:n.range,domain:n.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]=m,c&&(s["".concat(l,"Legend")]=b(b({},m),{},{data:c})),t&&t.qHasOtherValues&&c&&((c||m.data).amend=[{label:t.qDimensionInfo[0].othersLabel,source:{key:"qHyperCube",field:"qDimensionInfo/0"},row:{value:-3},value:-3}])}else if("measure"===n.fieldType){var h={data:{field:n.field},min:n.min,max:n.max};s[l]=R({},h,{type:"categorical"===n.type?"threshold-color":"sequential-color",range:n.range,domain:n.domain,invert:n.reverse}),"sequential-color"===s[l].type&&(s["".concat(l,"Range")]=R({},h,{invert:!!r}))}else if("color"!==n.type)throw new Error("UNUSED FIELD")}else if("dimension"===n.mode){var g={data:t.qDimensionInfo.map((function(e,t){return t})),label:function(e){return t.qDimensionInfo[e.datum.value].qFallbackTitle},explicit:u,type:"categorical-color"};s[l]=g}else if("measure"===n.mode){var y={data:t.qMeasureInfo.map((function(e,t){return t})).filter((function(e){var t;return!(null!==(t=n.explicit)&&void 0!==t&&null!==(t=t.exclude)&&void 0!==t&&t.includes(e))})),label:function(e){return t.qMeasureInfo[e.datum.value].qFallbackTitle},explicit:u,type:"categorical-color"};s[l]=y}}return s}({hc:n.hc,coloring:i(),key:n.key,source:n.source,picasso:e.picasso}),r.scales},color:function(){return r.color=r.color||function(e){var t=e.coloring,n=e.scales,r=e.key,i=Ke(r),o=Ke("".concat(r,"IsAnOther")),a=function(e,t){var r=e.fieldType,a=e.invalid,s=e.mode,l=e.nil,u=e.others,c=e.primary,p=e.type;return a?function(e){return Ye(e)||o(e)?u:l}:n[t]?function(e){return Ye(e)?u:Ze(e)||-2===i(e)&&"dimension"===r||"NaN"===i(e)?l:o(e)?u:e.resources.scale(t)(i(e))||u}:"constant"===s?function(e){return Ye(e)||o(e)?u:Ze(e)?l:c}:"color"===p?function(e){return Ye(e)||o(e)?u:Ze(e)?l:i(e)||u}:null},s=a(t,r);if(t.measureOverrides){var l=Ke("".concat(r,"MeasureIdx")),u=t.measureOverrides.map((function(e){return e&&a(e)}));return function(e){var t=l(e);return u[t]?u[t](e):s(e)}}return s}({coloring:i(),scales:this.scales(),key:n.key}),r.color},datumProps:function(e){return function(e){var t,n,r=e.hc,i=e.coloring,o=e.scales,a=e.key,s=e.addMeasureIx,l=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,u=a,c=i.nil;"field"===i.mode&&i.field?t=i.field:o[a]&&"field"===i.mode&&(t=o[a].data.field||i.field),t?(n={field:t,reduce:"first"},"color"===i.type&&(n.value=function(e){return"NaN"!==e.qNum?function(e){return"rgba(".concat([(16711680&e)>>16,(65280&e)>>8,255&e,((4278190080&e)>>>24)/255].join(","),")")}(e.qNum):e.qText&&ae(e.qText)?e.qText:c})):"dimension"===i.mode?n=void 0!==i.field?i.field:r.qDimensionInfo.length-1:"measure"===i.mode&&(n=l);var p=y({},u,n);return r.qDimensionInfo.length>1&&(p["".concat(u,"IsAnOther")]={fields:r.qDimensionInfo.map((function(e,t){return{field:"qDimensionInfo/".concat(t)}})),value:function(e){return-1!==e.indexOf(-3)}}),s&&(p["".concat(u,"MeasureIdx")]=l),p}({coloring:this.settingsForMeasure(e),scales:this.scales(),key:n.key,hc:n.hc,addMeasureIx:i().measureOverrides},e)},data:function(){var e=i(),t={key:"dummy",data:[["field"],["a"]]};return e.legendDataset?[t,{type:"q",key:"attrDim",data:e.legendDataset.raw(),config:{localeInfo:n.localeInfo}}]:[t]},legend:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.eventName,r=e.key,o=e.viewState,a=e.chart,s=e.rtl,l=e.styleReference,u=void 0===l?"object.legend":l,c=e.styleOverrides,p=e.settings,f=void 0===p?{}:p,d=e.style,m=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return it({eventName:t,key:r,rtl:s,viewState:o,chart:a,styleReference:u,styleOverrides:c,settings:f,style:void 0===d?{}:d},{legendProps:n.legendProps,scaleKey:n.key,coloring:i(),theme:n.theme,hc:n.hc,scales:this.scales()},m)}};return o}var at=function(e){return e.baseColor||e.coloring&&e.coloring.baseColor};function st(e){var t=e.qHyperCube,n=t.qDimensionInfo,r=t.qMeasureInfo,i=n.some(at),o=r.some(at),a=e.color.useBaseColors;return"measure"===a&&!o||"dimension"===a&&!i?"off":a}var lt=function(e){return e.baseColor||e.coloring&&e.coloring.baseColor};function ut(e){var t,n=e.qHyperCube.qDimensionInfo.some(lt),r=e.qHyperCube.qMeasureInfo.some(lt),i=n?"dimension":void 0;return{mode:"primary",useBaseColors:null!==(t=null!=i?i:r?"measure":void 0)&&void 0!==t?t:"off",paletteColor:null}}var ct=function(){};function pt(e){var t,n,r,i,o=e.picasso,a=e.model,s=e.app,l=e.translator,u=e.layoutService,c=void 0===u?void 0:u,p=e.createConfig,f=void 0===p?ct:p,d=e.config,m=void 0===d?{}:d,h=e.custom,g=void 0===h?{}:h,y=m.localeInfo,v=m.key,x=m.theme,q=void 0===x?void 0:x,D=m.auto,S=void 0===D?void 0:D,M=m.definitionPath,A=null==c||null===(t=c.getLayout)||void 0===t?void 0:t.call(c),I={theme:q,key:v,localeInfo:y,layout:A,hc:null==c||null===(n=c.getHyperCube)||void 0===n?void 0:n.call(c),legendProps:null==c||null===(r=c.getLayoutValue)||void 0===r?void 0:r.call(c,"legend"),colorProps:b(b({},null==c||null===(i=c.getLayoutValue)||void 0===i?void 0:i.call(c,"color")),{},{useBaseColors:A?st(A):void 0})},w=ot({picasso:o,model:a,app:s,translator:l,auto:S});!1!==S&&w.auto((function(e){return S?S({layout:e,defaultAuto:ut}):ut(e)}));var k=!1,C={getColor:function(){return w.color()},getPaletteColor:function(e){var t=e.index,n=e.color;return w.resolveUIColor({index:t,color:n})},getData:function(){return w.data()},getDatumProps:function(e){return w.datumProps(e)},getSnapshotData:function(){return w.getSnapshotData(M)},getSettingsForMeasure:function(e){return w.settingsForMeasure(e)},getSettings:function(){return w.settings()},getLegend:function(e,t){return w.legend(e,t)},getScales:function(){return w.scales()},getPalettes:function(){return w.palettes()},isSelectionLocked:function(e){var t=e.isMeasureSelectionLocked;return w.isSelectionLocked({isMeasureSelectionLocked:t})},isInitialized:function(){return k},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}),n=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 w.config(n),w.getAuxiliarySettings(M).then((function(){k=!0}))}};return C}var ft="center",dt="bottom";function mt(e){var t=e.chart,n=e.logicalSize;if(n)return n;var r=t?t.element.getBoundingClientRect():{};return{width:r.width,height:r.height}}[{key:"NoDataExist",alignment:ft,condition:function(e){var t=e.layoutService;if(!t)return!1;var n=t.meta.size;return n.x*n.y==0}},{key:"OnlyNanDataMeasure",translationKey:"OnlyNanData",alignment: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 n=t.getHyperCubeValue("qDimensionInfo.0");return n&&(n.qMax<n.qMin||"NaN"===n.qMax)}},{key:"OnlyNegativeOrZeroValues",alignment:ft},{key:"DataRangeIncludingZero",alignment:dt},{key:"LimitedData",alignment:dt},{key:"NegativeOrZeroValues",alignment:dt}].reduce((function(e,t){return e[t.key]=t,e}),{});var ht=[{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,n=e.height,r=ht.filter((function(e){return t>=e.size.width&&n>=e.size.height})).shift();return r?r.key:"SPARK"}var yt={left:"right",right:"left",top:"bottom",bottom:"top",near:"far",far:"near"};function vt(e){var t=e.orientation,n=e.dock,r=e.btt,i=e.rtl,o="horizontal"===t?function(e){return"bottom"===e||"near"===e?"bottom":"top"}(n):function(e,t){var n="left"===e||"near"===e?"left":"right";return t?yt[n]:n}(n,i),a=function(e,t,n){return"vertical"===e?t?"bottom":"top":n?"right":"left"}(t,r,i);return{current:o,opposite:yt[o],start:a,end:yt[a]}}function bt(e){var t=e.chart,n=e.layoutService,r=e.config,i=void 0===r?{}:r,o=i.logicalSize,a=void 0!==o&&o,s=i.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({},i),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:n.getLayoutValue("xAxis.dock"),btt:!1,rtl:l}),r=t.current,i=t.opposite;u.x.dock=r,u.x.opposite=i,u.x.size=e.width;var o=vt({orientation:"vertical",dock:n.getLayoutValue("yAxis.dock"),btt:!0,rtl:l}),a=o.current,s=o.opposite;u.y.dock=a,u.y.opposite=s,u.y.size=e.height}};return c.update(mt({chart:t,logicalSize:a})),c}var xt="vertical",qt="horizontal";function Dt(e){var t=e.chart,n=e.layoutService,r=e.config,i=void 0===r?{}:r,o=e.typeConfig,a=void 0===o?{}:o,s=i.logicalSize,l=void 0!==s&&s,u=i.rtl,c=void 0!==u&&u,p=a.fallback===xt?xt:qt,f=!!a.invert,d=a.measureAxes||[{ref:"measureAxis",name:"minor"}],m={chart:{orientation:void 0,size:void 0,mode:void 0},major:{orientation:void 0,dock:void 0,opposite:void 0,size:void 0}},h={type:"major-minor",config:b({},i),meta:m,update:function(e){m.chart.orientation=n.getLayoutValue("orientation",p),m.chart.size={width:e.width,height:e.height},m.chart.mode=gt(e),m.major.orientation=function(e){var t=e.chartOrientation,n=e.invert;return e.layoutService.meta.isContinuous?qt:n?t===xt?qt:xt:t}({layoutService:n,chartOrientation:m.chart.orientation,invert:f});var t=vt({orientation:m.major.orientation,dock:n.getLayoutValue("dimensionAxis.dock"),btt:!1,rtl:c}),r=t.current,i=t.opposite;m.major.dock=r,m.major.opposite=i,m.major.size=m.major.orientation===xt?e.height:e.width,d.forEach((function(t){var r={};r.orientation=m.major.orientation===xt?qt:xt;var i=vt({orientation:r.orientation,dock:n.getLayoutValue("".concat(t.ref,".dock")),btt:!0,rtl:c}),o=i.current,a=i.opposite,s=i.start,l=i.end;r.dock=o,r.opposite=a,r.start=s,r.end=l,r.size=r.orientation===xt?e.height:e.width,m[t.name]=r}))}};return h.update(mt({chart:t,logicalSize:l})),h}function St(e){var t=e.chart,n=e.layoutService,r=e.config,i=void 0===r?{}:r,o=e.typeConfig,a=void 0===o?{}:o;return("x-y"===a.type?bt:Dt)({chart:t,layoutService:n,config:i,typeConfig:a})}function Mt(e,t,n){if(void 0===e||void 0===t)return n;for(var r=t.split("."),i=e,o=0;o<r.length;++o){var a=r[o];if(void 0===i[a])return n;i=i[a]}return i}var At=["__proto__","constructor"];function It(e,t,n){if(void 0!==e&&void 0!==t){var r=t.split("."),i=r[r.length-1];if(!At.some((function(e){return r.includes(e)}))){for(var o=e,a=0;a<r.length-1;++a){var s=r[a];void 0===o[s]&&(o[s]=Number.isNaN(+r[a+1])?{}:[]),o=o[s]}void 0!==n?o[i]=n:delete o[i]}}}function wt(){var e={};return{get:function(t){return e[t]},set:function(t,n){return e[t]=n,n},has:function(t){return t in e},remove:function(t){delete e[t]},empty:function(){e={}}}}var kt,Ct={ERROR_CODES:[7005],DIMENSION:"qDimensionInfo",MEASURE:"qMeasureInfo"},Lt=function(e,t){return e[t].reduce((function(e,t,n){var r;return r=t,Ct.ERROR_CODES.some((function(e){var t;return e===(null===(t=r.qError)||void 0===t?void 0:t.qErrorCode)}))?e.filtered.push(n):e.reduced.push(t),e}),{reduced:[],filtered:[]})};function Et(e){var t;return((null==e||null===(t=e.qHyperCube)||void 0===t?void 0:t.qDimensionInfo)||[]).map((function(e){var t,n=null===(t=e.qCardinalities)||void 0===t?void 0:t.qHypercubeCardinal;if(n)return n;var r=e.qStateCounts||{},i=r.qLocked,o=void 0===i?0:i,a=r.qOption,s=void 0===a?0:a,l=r.qSelected;return o+s+(void 0===l?0:l)}))}function Nt(e){switch(e.qHyperCube.qMode){case"S":return function(e){var t=e.qHyperCube.qSize;return{refs:{dataPages:"qHyperCube.qDataPages"},size:{x:t.qcx,y:t.qcy,dimensions:Et(e)}}}(e);case"K":return function(e){var t=Et(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=Et(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,n=e.children,r=n&&n.length;if(r)for(;--r>=0;)t+=n[r].value;else t=1;e.value=t}function Ot(e,t){e instanceof Map?(e=[void 0,e],void 0===t&&(t=Tt)):void 0===t&&(t=Ft);for(var n,r,i,o,a,s=new Ht(e),l=[s];n=l.pop();)if((i=t(n.data))&&(a=(i=Array.from(i)).length))for(n.children=i,o=a-1;o>=0;--o)l.push(r=i[o]=new Ht(i[o])),r.parent=n,r.depth=n.depth+1;return s.eachBefore(Vt)}function Ft(e){return e.children}function Tt(e){return Array.isArray(e)?e[1]:null}function Rt(e){void 0!==e.data.value&&(e.value=e.data.value),e.data=e.data.data}function Vt(e){var t=0;do{e.height=t}while((e=e.parent)&&e.height<++t)}function Ht(e){this.data=e,this.depth=this.height=0,this.parent=null}Ht.prototype=Ot.prototype={constructor:Ht,count:function(){return this.eachAfter(Pt)},each:function(e,t){let n=-1;for(const r of this)e.call(t,r,++n,this);return this},eachAfter:function(e,t){for(var n,r,i,o=this,a=[o],s=[],l=-1;o=a.pop();)if(s.push(o),n=o.children)for(r=0,i=n.length;r<i;++r)a.push(n[r]);for(;o=s.pop();)e.call(t,o,++l,this);return this},eachBefore:function(e,t){for(var n,r,i=this,o=[i],a=-1;i=o.pop();)if(e.call(t,i,++a,this),n=i.children)for(r=n.length-1;r>=0;--r)o.push(n[r]);return this},find:function(e,t){let n=-1;for(const r of this)if(e.call(t,r,++n,this))return r},sum:function(e){return this.eachAfter((function(t){for(var n=+e(t.data)||0,r=t.children,i=r&&r.length;--i>=0;)n+=r[i].value;t.value=n}))},sort:function(e){return this.eachBefore((function(t){t.children&&t.children.sort(e)}))},path:function(e){for(var t=this,n=function(e,t){if(e===t)return e;var n=e.ancestors(),r=t.ancestors(),i=null;for(e=n.pop(),t=r.pop();e===t;)i=e,e=n.pop(),t=r.pop();return i}(t,e),r=[t];t!==n;)t=t.parent,r.push(t);for(var i=r.length;e!==n;)r.splice(i,0,e),e=e.parent;return r},ancestors:function(){for(var e=this,t=[e];e=e.parent;)t.push(e);return t},descendants:function(){return Array.from(this)},leaves:function(){var e=[];return this.eachBefore((function(t){t.children||e.push(t)})),e},links:function(){var e=this,t=[];return e.each((function(n){n!==e&&t.push({source:n.parent,target:n})})),t},copy:function(){return Ot(this).eachBefore(Rt)},[Symbol.iterator]:function*(){var e,t,n,r,i=this,o=[i];do{for(e=o.reverse(),o=[];i=e.pop();)if(yield i,t=i.children)for(n=0,r=t.length;n<r;++n)o.push(t[n])}while(o.length)}},kt=function(e){
8
8
  /*! javascript-number-formatter - v1.1.11 - http://mottie.github.com/javascript-number-formatter/ * © ecava */
9
- e.exports=function(e,t){if(!e||isNaN(+t))return t;var n,i,r,o,a,s,l,u,c,p,f=e.length,d=e.search(/[0-9\-\+#]/),m=d>0?e.substring(0,d):"",h=e.split("").reverse().join(""),g=h.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(n=(t="-"===(e=e.substring(d,b)).charAt(0)?-t:+t)<0?t=-t:0,r=(i=e.match(/[^\d\-\+#]/g))&&i[i.length-1]||".",o=i&&i[1]&&i[0]||",",e=e.split(r),t=+(t=t.toFixed(e[1]&&e[1].length))+"",s=e[1]&&e[1].lastIndexOf("0"),(!(u=t.split("."))[1]||u[1]&&u[1].length<=s)&&(t=(+t).toFixed(s+1)),c=e[0].split(o),e[0]=c.join(""),(a=e[0]&&e[0].indexOf("0"))>-1)for(;u[0].length<e[0].length-a;)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(h="",y=(p=t[0]).length%l,f=p.length,b=0;b<f;b++)h+=p.charAt(b),!((b-y+1)%l)&&b<f-l&&(h+=o);t[0]=h}return t[1]=e[1]&&t[1]?r+t[1]:"","0"!==(i=t.join(""))&&""!==i||(n=!1),m+(n?"-":"")+i+x}},kt({exports:{}});var jt="'Source Sans Pro', 'Arial', 'sans-serif'",zt="#333333",_t="#595959",Bt="#737373",$t="#cccccc",Gt="#e6e6e6";function Ut(e){var t={};return[].concat(q(e),q([["","","color"],["object","","fontFamily"],["object","axis.label.name","color",_t],["object","axis.label.name","fontFamily",jt],["object","axis.label.name","fontSize","12px"],["object","axis.line.major","color",$t],["object","axis.line.minor","color",Gt],["object","axis.title","color"],["object","axis.title","fontFamily",jt],["object","axis.title","fontSize","13px"],["object","grid.line.highContrast","color",Gt],["object","grid.line.major","color",$t],["object","grid.line.minor","color",Gt],["object","label.value","color",_t],["object","label.value","fontFamily",jt],["object","label.value","fontSize","12px"],[!1,"label.value","darkColor",_t],[!1,"label.value","lightColor",Gt],["object","outOfRange","color","#999"],["object","legend.title","color",zt],["object","legend.title","fontFamily",jt],["object","legend.title","fontSize","15px"],["object","legend.label","color",_t],["object","legend.label","fontFamily",jt],["object","legend.label","fontSize","13px"],["object","referenceLine.label.name","color",zt],["object","referenceLine.label.name","fontFamily",jt],["object","referenceLine.label.name","fontSize","12px"],["object","referenceLine.outOfBounds","color",Gt],["object","referenceLine.outOfBounds","fontFamily",jt],["object","referenceLine.outOfBounds","fontSize","12px"],["object","referenceLine.outOfBounds","backgroundColor",Bt,function(e){return"transparent"===e?Bt:e}]])).reduce((function(e,n){var i="".concat(n[0],"-").concat(n[1],"-").concat(n[2],"}");return t[i]||(t[i]=!0,e.push(n)),e}),[]).sort((function(e,t){return(e[0].split?e[0].split(".").length:0)-(t[0].split?t[0].split(".").length:0)}))}var Wt=function(e){return e};function Xt(e){var t=e.theme,n=e.id,i=e.transform,r=e.extend,o=e.matrix,a={},s=i.reduce((function(e,t){var n=x(t,2),i=n[0],r=n[1];return e[i]=r,e}),{});return o.forEach((function(e){var i=x(e,5),r=i[0],o=i[1],l=i[2],u=i[3],c=i[4],p=void 0===c?function(e){return e}:c,f=function(e){var t=e.theme,n=e.base,i=e.path,r=e.attribute,o=e.defaultValue,a=void 0===o?void 0:o;if(!t||!1===n)return a;var s=t.getStyle(n,i,r);return void 0===s?a:s}({theme:t,base:"object"===r&&n?"".concat("object",".").concat(n):r,path:o,attribute:l,defaultValue:u}),d=(s["".concat(o,".").concat(l)]||Wt)(p(f));It(a,[o,l].filter(Boolean).join("."),d)})),r.forEach((function(e){var t=x(e,2),n=t[0],i=t[1];It(a,n,i)})),a}function Kt(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Zt,Yt={exports:{}};var Jt=(Zt||(Zt=1,self,Yt.exports=(()=>{var e={229:e=>{var t=Object.prototype.hasOwnProperty,n=Object.prototype.toString,i=Object.defineProperty,r=Object.getOwnPropertyDescriptor,o=function(e){return"function"==typeof Array.isArray?Array.isArray(e):"[object Array]"===n.call(e)},a=function(e){if(!e||"[object Object]"!==n.call(e))return!1;var i,r=t.call(e,"constructor"),o=e.constructor&&e.constructor.prototype&&t.call(e.constructor.prototype,"isPrototypeOf");if(e.constructor&&!r&&!o)return!1;for(i in e);return void 0===i||t.call(e,i)},s=function(e,t){i&&"__proto__"===t.name?i(e,t.name,{enumerable:!0,configurable:!0,value:t.newValue,writable:!0}):e[t.name]=t.newValue},l=function(e,n){if("__proto__"===n){if(!t.call(e,n))return;if(r)return r(e,n).value}return e[n]};e.exports=function e(){var t,n,i,r,u,c,p=arguments[0],f=1,d=arguments.length,m=!1;for("boolean"==typeof p&&(m=p,p=arguments[1]||{},f=2),(null==p||"object"!=typeof p&&"function"!=typeof p)&&(p={});f<d;++f)if(null!=(t=arguments[f]))for(n in t)i=l(p,n),p!==(r=l(t,n))&&(m&&r&&(a(r)||(u=o(r)))?(u?(u=!1,c=i&&o(i)?i:[]):c=i&&a(i)?i:{},s(p,{name:n,newValue:e(m,c,r)})):void 0!==r&&s(p,{name:n,newValue:r}));return p}},645:(e,t)=>{(()=>{var e={229:e=>{var t=Object.prototype.hasOwnProperty,n=Object.prototype.toString,i=Object.defineProperty,r=Object.getOwnPropertyDescriptor,o=function(e){return"function"==typeof Array.isArray?Array.isArray(e):"[object Array]"===n.call(e)},a=function(e){if(!e||"[object Object]"!==n.call(e))return!1;var i,r=t.call(e,"constructor"),o=e.constructor&&e.constructor.prototype&&t.call(e.constructor.prototype,"isPrototypeOf");if(e.constructor&&!r&&!o)return!1;for(i in e);return void 0===i||t.call(e,i)},s=function(e,t){i&&"__proto__"===t.name?i(e,t.name,{enumerable:!0,configurable:!0,value:t.newValue,writable:!0}):e[t.name]=t.newValue},l=function(e,n){if("__proto__"===n){if(!t.call(e,n))return;if(r)return r(e,n).value}return e[n]};e.exports=function e(){var t,n,i,r,u,c,p=arguments[0],f=1,d=arguments.length,m=!1;for("boolean"==typeof p&&(m=p,p=arguments[1]||{},f=2),(null==p||"object"!=typeof p&&"function"!=typeof p)&&(p={});f<d;++f)if(null!=(t=arguments[f]))for(n in t)i=l(p,n),p!==(r=l(t,n))&&(m&&r&&(a(r)||(u=o(r)))?(u?(u=!1,c=i&&o(i)?i:[]):c=i&&a(i)?i:{},s(p,{name:n,newValue:e(m,c,r)})):void 0!==r&&s(p,{name:n,newValue:r}));return p}}},n={};function i(t){var r=n[t];if(void 0!==r)return r.exports;var o=n[t]={exports:{}};return e[t](o,o.exports,i),o.exports}i.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return i.d(t,{a:t}),t},i.d=(e,t)=>{for(var n in t)i.o(t,n)&&!i.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},i.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),i.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var r={};(()=>{i.r(r),i.d(r,{default:()=>Ee});var e=i(229),t=i.n(e);const n=function(e,t,n){if(!t)return!1;var i,r=t.split("."),o=r[r.length-1],a=e;for(i=0;i<r.length-1;++i)void 0===a[r[i]]&&(a[r[i]]=Number.isNaN(+r[i+1])?{}:[]),a=a[r[i]];if(void 0!==n){var s=a[o];return a[o]=n,{updated:n,previous:s}}return delete a[o],!1},o=function(e,t,n){var i,r=t.split("."),o=e;if(void 0===o)return n;for(i=0;i<r.length;++i){if(void 0===o[r[i]])return n;o=o[r[i]]}return o},a={EXPRESSIONS:{observed:"",trend:"STL_Trend",seasonal:"STL_Seasonal",residual:"STL_Residual"},OPTIONS:[{value:"observed",translation:"cao.trendDecomposition.parameters.decomposition.observed"},{value:"trend",translation:"cao.trendDecomposition.parameters.decomposition.trend"},{value:"seasonal",translation:"cao.trendDecomposition.parameters.decomposition.seasonal"},{value:"residual",translation:"cao.trendDecomposition.parameters.decomposition.residual"}]};var s="".concat(" ","(").concat(" "),l="".concat(" ",")").concat(" ");function u(e){return s+e+l}function c(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(e.qLibraryId){var n=function(e,t){if(!t)return null;var n,i;for(n=0;n<t.length;n++)if((i=t[n]).qInfo.qId===e)return i;return null}(e.qLibraryId,t.dimensionList);return n&&n.qData.info[0].qTags.indexOf("$numeric")>-1}var i=function(e,t){if(!t)return null;var n,i,r=function(e){var t=e.trim();"="===t.charAt(0)&&(t=(t=t.substring(1)).trim());var n=t.length-1;return"["===t.charAt(0)&&"]"===t.charAt(n)&&(t=(t=t.substring(1,n)).trim()),t}(e);for(n=0;n<t.length;n++){if((i=t[n]).qName===r)return i;if(i.qDerivedFieldData)for(var o=0;o<i.qDerivedFieldData.qDerivedFieldLists.length;++o)for(var a=i.qDerivedFieldData.qDerivedFieldLists[o],s=0;s<a.qFieldDefs.length;++s){var l=a.qFieldDefs[s];if(l.qName===r)return l}}return null}(e.qDef.qFieldDefs[0],t.fieldList);return i&&i.qTags.indexOf("$numeric")>-1}function p(e){return!(!e.fullAccumulation&&!e.fullRange)}function f(e,t){var n=e.crossAllDimensions;return 2===t&&n?"RowNo(Total)":"RowNo()"}function d(e){var t=function(e){return e?(e=function(e){return e.replace(/\/\*[^]*?\*\//g,"")}(e=function(e){return e.replace(/\/\/(.*)$/gm,"")}(e))).trim():""}(e),n=t.trim();return"="===n.substring(0,1)?n.substring(1).trim():n}function m(){return"[$(=Replace(GetObjectField(".concat(arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,"),']',']]'))]")}function h(e,t){var n=e.crossAllDimensions;return 2===t&&n?"Above(Total ":"Above("}function g(e){return void 0===e?")":", 0, ".concat(e,")")}function y(e){return"Replace(Replace(".concat(e,",'''',''''''),'$','$''&''')")}function v(e,t){return e?"".concat(t,'={">=$(=Min(').concat(t,"))<=$(=Max(").concat(t,'))"}'):"".concat(t,'={"=Only({1}').concat(t,")>='$(=").concat(y("MinString(".concat(t,")")),")' and Only({1}").concat(t,")<='$(=").concat(y("MaxString(".concat(t,")")),")'\"}")}function b(e){var t=e.modifier,n=void 0===t?{}:t,i=e.dimensions,r=e.dimensionAndFieldList,o=e.funcComp,a=void 0===o?"Sum":o,s=e.valueComp,l=void 0===s?"0":s;if(!n.showExcludedValues)return"";if(i&&1===i.length){var u=v(c(i[0],r),m(0));return"".concat(a,"({1<").concat(u,">}").concat(l,")")}if(i&&2===i.length){var p=c(i[0],r),f=c(i[1],r),d=m(0),h=m(1),g=v(p,d),y=v(f,h);return"".concat(a,"({1<").concat(g,",").concat(y,">}").concat(l,")")}return"".concat(a,"({1}").concat(l,")")}function x(e){return"".concat(e,"(")}function q(e){var t=e.properties,n=e.layout;return o(t,"qHyperCubeDef.qDimensions",o(n,"qHyperCube.qDimensionInfo",[])).length}const D={isFullRange:p,getNumDimensions:q,getExpressionWithExcludedComp:function(e){var t=e.expression,n=e.modifier,i=e.dimensions,r=e.dimensionAndFieldList,o=e.treatMissingAsNull,a=u(d(t));if(!n.showExcludedValues)return a;var s=b({modifier:n,dimensions:i,dimensionAndFieldList:r}),l=o?"":", 0";if(i&&1===i.length){var c=m(0);return"If(Count(".concat(c,") > 0, ").concat(a," + ").concat(s).concat(l,")")}if(i&&2===i.length){var p=m(0),f=m(1);return"If(Count(".concat(p,") * Count(").concat(f,") > 0, ").concat(a," + ").concat(s).concat(l,")")}return a},getRowNoComp:f,getNumStepComp:function(e,t){if(!p(e)){var n=e.steps;return"number"!=typeof n||Number.isNaN(n)?6:n}return f(e,t)},getAboveCompPrefix:h,getAboveCompSuffix:g,getAboveComp:function(e,t,n,i){return h(e,t)+n+g(i)},getFunctionPrefix:x,getFunctionSuffix:function(){return")"},getRangeComp:function(e,t){return x(e)+t+")"},getAggrComp:function(e,t,n){return"Aggr(".concat(e,", ").concat(t,", ").concat(n,")")},getExcludedComp:b,needDimension:function(e){var t=e.modifier,n=e.properties,i=e.layout,r=function(e){return void 0===e.primaryDimension?e.accumulationDimension:e.primaryDimension}(t);return 0===r&&2===q({properties:n,layout:i})},getDimComp:function(e,t){var n=function(e){return e[arguments.length>1&&void 0!==arguments[1]?arguments[1]:0].qDef.qSortCriterias[0]}(e,t),i=m(t);if(!n.qSortByExpression&&!n.qSortByNumeric&&!n.qSortByAscii)return i;var r=["Descending","Ascending"],o=n.qSortByNumeric?"(Numeric, ".concat(r[(n.qSortByNumeric+1)/2],")"):"",a=n.qSortByAscii?"(Text, ".concat(r[(n.qSortByAscii+1)/2],")"):"";return n.qSortByNumeric&&n.qSortByAscii?"(".concat(i,", ").concat(o,", ").concat(a,")"):n.qSortByNumeric?"(".concat(i,", ").concat(o,")"):n.qSortByAscii?"(".concat(i,", ").concat(a,")"):i},simplifyExpression:d,extractInputExpression:function(e){var t=e.outputExpression;if(e.modifier){var n=t.indexOf(s);if(-1!==n){var i=t.indexOf(l);if(-1!==i)return t.substring(n+s.length,i)}}},initModifier:function(e,t){Object.keys(t).forEach((function(n){void 0===e[n]&&(e[n]=t[n])}))},isNumeric:c,isApplicable:function(e){var t=e.properties,n=e.layout,i=e.minDimensions,r=void 0===i?1:i,o=e.maxDimensions,a=void 0===o?2:o;if(!t&&!n)return!0;var s=q({properties:t,layout:n});return s>=r&&s<=a},getExpressionWithMarkers:u,canExtract:function(e){var t=e.indexOf(s),n=e.indexOf(l);return t>-1&&n>-1&&t<n},getDimDefWithWrapper:m,getFieldWithWrapper:function(e){var t=e?e.replace(/]/g,"]]"):e;return"[".concat(t,"]")},generateTSDExpression:function(e,t,n){var i=t||e.outputExpression;if(e.base&&e.base.qDef&&(i=t!==e.base.qDef?t:e.base.qDef),"observed"!==e.decomposition){var r=n.qHyperCubeDef.qMeasures.find((function(t){return t.qDef.base&&t.qDef.base.qLibraryId&&e.base&&e.base.qLibraryId?t.qDef.base.qLibraryId===e.base.qLibraryId:null}));r&&t!==r.qDef.qLabel&&(i=r.qLibraryId||r.qDef.base.qLibraryId?"[".concat(r.qDef.qLabel,"]"):r.qDef.base.qDef);var o=function(e){var t=a.OPTIONS.find((function(t){return t.value===e.decomposition}));return t?a.EXPRESSIONS[t.value]:""}(e);i=i.startsWith("=")?i.substr(1):i,i="".concat(o,"(").concat(i,", ").concat(e.steps,")")}return i},getDecomposition:function(e){var t="observed";return Object.values(a.EXPRESSIONS).find((function(n){var i=e.qDef.base.qDef.toLowerCase()||e.qDef.qDef.toLowerCase();return a.EXPRESSIONS[n]&&i.includes(a.EXPRESSIONS[n].toLowerCase())&&(t=n),n})),t}};function S(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,i=new Array(t);n<t;n++)i[n]=e[n];return i}function M(e){return M="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},M(e)}var A=t().bind(null,!0),I={},w=Array.isArray;function k(e){return null!=e&&!Array.isArray(e)&&"object"===M(e)}function C(e){return void 0===e}function L(e,t){return"function"==typeof e[t]||"$$"===t.substring(0,2)||"_"===t.substring(0,1)}function E(e,t){var n,i=t.substring(1).split("/").slice(0,-1);return i.forEach((function(t,r){if(r!==i.length){n=+t;var o=Number.isNaN(n)?{}:[];e[n||t]=C(e[n||t])?o:e[t],e=e[n||t]}})),e}function N(e,t){var n=!0;if(k(e)&&k(t))return Object.keys(e).length===Object.keys(t).length&&(Object.keys(e).forEach((function(i){N(e[i],t[i])||(n=!1)})),n);if(w(e)&&w(t)){if(e.length!==t.length)return!1;for(var i=0,r=e.length;i<r;i+=1)if(!N(e[i],t[i]))return!1;return!0}return e===t}I.generate=function(e,t,n){n=n||"";var i=[];return Object.keys(t).forEach((function(r){var o=function(e){return e?A({},{val:e}).val:e}(t[r]),a=e[r],s="".concat(n,"/").concat(r);N(o,a)||L(t,r)||(C(a)?i.push({op:"add",path:s,value:o}):k(o)&&k(a)?i=i.concat(I.generate(a,o,s)):w(o)&&w(a)?i=i.concat(function(e,t,n){var i=[],r=e.slice(),o=-1;function a(e,t,n){if(e[n]&&C(e[n].qInfo))return null;if(e[n]&&e[n].qInfo.qId===t)return n;for(var i=0,r=e.length;i<r;i+=1)if(e[i]&&e[i].qInfo.qId===t)return i;return-1}if(N(t,r))return i;if(!C(t[0])&&C(t[0].qInfo))return i.push({op:"replace",path:n,value:t}),i;for(var s=r.length-1;s>=0;s-=1)-1===(o=a(t,r[s].qInfo&&r[s].qInfo.qId,s))?(i.push({op:"remove",path:"".concat(n,"/").concat(s)}),r.splice(s,1)):i=i.concat(I.generate(r[s],t[o],"".concat(n,"/").concat(s)));for(var l=0,u=t.length;l<u;l+=1)-1===(o=a(r,t[l].qInfo&&t[l].qInfo.qId))?(i.push({op:"add",path:"".concat(n,"/").concat(l),value:t[l]}),r.splice(l,0,t[l])):o!==l&&(i.push({op:"move",path:"".concat(n,"/").concat(l),from:"".concat(n,"/").concat(o)}),r.splice(l,0,r.splice(o,1)[0]));return i}(a,o,s)):i.push({op:"replace",path:"".concat(n,"/").concat(r),value:o}))})),Object.keys(e).forEach((function(r){C(t[r])&&!L(e,r)&&i.push({op:"remove",path:"".concat(n,"/").concat(r)})})),i},I.apply=function(e,t){t.forEach((function(t){var n,i,r=E(e,t.path),o=t.path.split("/").splice(-1)[0],a=o&&Number.isNaN(+o)?r[o]:r[+o]||r,s=t.from?t.from.split("/").splice(-1)[0]:null;if("/"===t.path&&(r=null,a=e),"add"===t.op||"replace"===t.op)if(w(r))"-"===o&&(o=r.length),r.splice(+o,"add"===t.op?0:1,t.value);else if(w(a)&&w(t.value)){var l,u=t.value.slice();a.length=0,(l=a).push.apply(l,function(e){if(Array.isArray(e))return S(e)}(i=u)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(i)||function(e,t){if(e){if("string"==typeof e)return S(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?S(e,t):void 0}}(i)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}())}else if(k(a)&&k(t.value))n=a,Object.keys(n).forEach((function(e){Object.getOwnPropertyDescriptor(n,e).configurable&&!L(n,e)&&delete n[e]})),A(a,t.value);else{if(!r)throw new Error("Patchee is not an object we can patch");r[o]=t.value}else if("move"===t.op){var c=E(e,t.from);w(r)?r.splice(+o,0,c.splice(+s,1)[0]):(r[o]=c[s],delete c[s])}else"remove"===t.op&&(w(r)?r.splice(+o,1):delete r[o])}))},I.clone=function(e){return A({},e)},I.createPatch=function(e,t,n){var i={op:e.toLowerCase(),path:n};return"move"===i.op?i.from=t:void 0!==t&&(i.value=t),i},I.updateObject=function(e,t){Object.keys(e).length?I.apply(e,I.generate(e,t)):A(e,t)};const P=I,O=function(e,n,i){if(!e)return Promise.resolve();var r=P.generate(n,i);return t()(!0,n,i),r&&r.length?(r=r.map((function(e){return{qOp:e.op,qValue:JSON.stringify(e.value),qPath:e.path}})),e.applyPatches(r,!0)):Promise.resolve()};var F="accumulation";function T(e,t){var n=o(e,t);if(n)for(var i=0;i<n.length;i++)if(n[i].type===F)return n[i]}function R(e,t){var n=function(e,t){var n=o(e,t);if(!n)return-1;for(var i=0;i<n.length;i++)if(n[i].type===F)return i;return-1}(e,t);return n>-1?"".concat(t,".").concat(n):t}var V={type:"accumulation",disabled:!1,accumulationDimension:0,crossAllDimensions:!1,showExcludedValues:!0,fullAccumulation:!1,steps:6,outputExpression:""};const H={translationKey:"properties.modifier.accumulation",needDimension:D.needDimension,isApplicable:function(e){var t=e.properties,n=e.layout;return D.isApplicable({properties:t,layout:n,minDimensions:1,maxDimensions:2})},generateExpression:function(e){var t=e.expression,n=e.modifier,i=e.properties,r=e.layout,a=e.numDimensions,s=e.dimensionAndFieldList;if(!n)return t;var l=a;void 0===l&&(l=D.getNumDimensions({properties:i,layout:r}));var u=o(i,"qHyperCubeDef.qDimensions",[]),c=D.getExpressionWithExcludedComp({expression:t,modifier:n,dimensions:u,dimensionAndFieldList:s}),p=D.getNumStepComp(n,l),f=D.getAboveComp(n,l,c,p),d=D.getRangeComp("RangeSum",f);if(D.needDimension({modifier:n,properties:i,layout:r})){var m=D.getDimComp(u,1),h=D.getDimComp(u,0),g=D.getAggrComp(d,m,h);d=n.showExcludedValues?D.getExcludedComp({modifier:n,dimensions:u,dimensionAndFieldList:s,valueComp:g}):g}return d},extractInputExpression:D.extractInputExpression,initModifier:function(e){D.initModifier(e,V)},enableTotalsFunction:function(){return!1},propertyPanelDef:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n={type:"items",items:{disclaimer:{component:"text",translation:t.disclaimer||"properties.modifier.accumulation.disclaimer",show:function(e,t){return!D.isApplicable({properties:t.properties})}},settings:{type:"items",items:{primaryDimension:{refFn:function(t){return"".concat(R(t,e),".accumulationDimension")},type:"integer",translation:t.primaryDimension||"properties.modifier.primaryDimension",title:{translation:t.primaryDimensionTooltip||"properties.modifier.accumulation.primaryDimension.tooltip"},component:"dropdown",schemaIgnore:!0,defaultValue:1,options:function(e,t){return t.layout.qHyperCube.qDimensionInfo.map((function(e,t){return{value:t,label:e.qGroupFallbackTitles[0]}}))},show:function(e,t){return t.layout.qHyperCube.qDimensionInfo.length>1}},crossAllDimensions:{refFn:function(t){return"".concat(R(t,e),".crossAllDimensions")},type:"boolean",translation:t.crossAllDimensions||"properties.modifier.crossAllDimensions",title:{translation:t.crossAllDimensionsTooltip||"properties.modifier.accumulation.crossAllDimensions.tooltip"},schemaIgnore:!0,defaultValue:!1,show:function(e,t){return t.layout.qHyperCube.qDimensionInfo.length>1}},fullRange:{refFn:function(t){return"".concat(R(t,e),".fullAccumulation")},type:"boolean",translation:t.range||"properties.modifier.range",component:"dropdown",schemaIgnore:!0,defaultValue:!1,options:[{value:!0,translation:t.rangeFull||"properties.modifier.range.full"},{value:!1,translation:t.rangeCustom||"properties.modifier.range.custom"}]},steps:{refFn:function(t){return"".concat(R(t,e),".steps")},type:"integer",translation:t.rangeSteps||"properties.modifier.range.steps",schemaIgnore:!0,defaultValue:6,change:function(t){var n=T(t,e);if(n){var i=n.steps;n.steps="number"!=typeof i||Number.isNaN(i)?6:Math.abs(i)}},show:function(t){var n=T(t,e);return n&&!n.fullAccumulation}},showExcludedValues:{refFn:function(t){return"".concat(R(t,e),".showExcludedValues")},type:"boolean",translation:t.showExcludedValues||"properties.modifier.showExcludedValues",schemaIgnore:!0,defaultValue:!0}},show:function(e,t){return D.isApplicable({properties:t.properties})}}},show:function(t,n,i){var r=i.ext.support.modifiers;if(!Array.isArray(r)||-1===r.indexOf(F))return!1;var o=T(t,e);return o&&!o.disabled}};return n}};var j="movingAverage";function z(e,t){var n=o(e,t);if(n)for(var i=0;i<n.length;i++)if(n[i].type===j)return n[i]}function _(e,t){var n=function(e,t){var n=o(e,t);if(!n)return-1;for(var i=0;i<n.length;i++)if(n[i].type===j)return i;return-1}(e,t);return n>-1?"".concat(t,".").concat(n):t}var B={type:"movingAverage",disabled:!1,primaryDimension:0,crossAllDimensions:!1,showExcludedValues:!0,fullRange:!1,steps:6,outputExpression:"",nullSuppression:!1};const $={translationKey:"properties.modifier.movingAverage",needDimension:D.needDimension,isApplicable:function(e){var t=e.properties,n=e.layout;return D.isApplicable({properties:t,layout:n,minDimensions:1,maxDimensions:2})},generateExpression:function(e){var t,n=e.expression,i=e.modifier,r=e.properties,a=e.layout,s=e.numDimensions,l=e.dimensionAndFieldList;if(!i)return n;var u=s;void 0===u&&(u=D.getNumDimensions({properties:r,layout:a}));var c=o(r,"qHyperCubeDef.qDimensions",[]),p=i.showExcludedValues&&i.nullSuppression,f=D.getExpressionWithExcludedComp({expression:n,modifier:i,dimensions:c,dimensionAndFieldList:l,treatMissingAsNull:p}),d=D.getNumStepComp(i,u),m=D.getAboveComp(i,u,f,d);if(i.nullSuppression)t=D.getRangeComp("RangeAvg",m);else{var h=D.getRangeComp("RangeSum",m),g=function(e,t){var n=D.getRowNoComp(e,t);if(!D.isFullRange(e)){var i=e.steps,r="number"!=typeof i||Number.isNaN(i)?6:i;return"RangeMin(".concat(r,", ").concat(n,")")}return n}(i,u);t="".concat(h," / ").concat(g)}var y=t;if(D.needDimension({modifier:i,properties:r,layout:a})){var v=D.getDimComp(c,1),b=D.getDimComp(c,0),x=D.getAggrComp(y,v,b);y=i.showExcludedValues?D.getExcludedComp({modifier:i,dimensions:c,dimensionAndFieldList:l,funcComp:"Only",valueComp:x}):x}return y},extractInputExpression:D.extractInputExpression,initModifier:function(e){D.initModifier(e,B)},enableTotalsFunction:function(){return!1},propertyPanelDef:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n={type:"items",items:{disclaimer:{component:"text",translation:t.disclaimer||"properties.modifier.movingAverage.disclaimer",show:function(e,t){return!D.isApplicable({properties:t.properties})}},settings:{type:"items",items:{primaryDimension:{refFn:function(t){return"".concat(_(t,e),".primaryDimension")},type:"integer",translation:t.primaryDimension||"properties.modifier.primaryDimension",title:{translation:t.primaryDimensionTooltip||"properties.modifier.movingAverage.primaryDimension.tooltip"},component:"dropdown",schemaIgnore:!0,defaultValue:1,options:function(e,t){return t.layout.qHyperCube.qDimensionInfo.map((function(e,t){return{value:t,label:e.qGroupFallbackTitles[0]}}))},show:function(e,t){return t.layout.qHyperCube.qDimensionInfo.length>1}},crossAllDimensions:{refFn:function(t){return"".concat(_(t,e),".crossAllDimensions")},type:"boolean",translation:t.crossAllDimensions||"properties.modifier.crossAllDimensions",title:{translation:t.crossAllDimensionsTooltip||"properties.modifier.movingAverage.crossAllDimensions.tooltip"},schemaIgnore:!0,defaultValue:!1,show:function(e,t){return t.layout.qHyperCube.qDimensionInfo.length>1}},fullRange:{refFn:function(t){return"".concat(_(t,e),".fullRange")},type:"boolean",translation:t.range||"properties.modifier.range",component:"dropdown",schemaIgnore:!0,defaultValue:!1,options:[{value:!0,translation:t.rangeFull||"properties.modifier.range.full"},{value:!1,translation:t.rangeCustom||"properties.modifier.range.custom"}]},steps:{refFn:function(t){return"".concat(_(t,e),".steps")},type:"integer",translation:t.rangeSteps||"properties.modifier.range.steps",schemaIgnore:!0,defaultValue:6,change:function(t){var n=z(t,e);if(n){var i=n.steps;n.steps="number"!=typeof i||Number.isNaN(i)?6:Math.abs(i)}},show:function(t){var n=z(t,e);return n&&!n.fullRange}},showExcludedValues:{refFn:function(t){return"".concat(_(t,e),".showExcludedValues")},type:"boolean",translation:t.showExcludedValues||"properties.modifier.showExcludedValues",schemaIgnore:!0,defaultValue:!0},nullSuppression:{refFn:function(t){return"".concat(_(t,e),".nullSuppression")},type:"boolean",translation:t.showNull||"properties.dimensions.showNull",schemaIgnore:!0,defaultValue:!1,inverted:!0}},show:function(e,t){return D.isApplicable({properties:t.properties})}}},show:function(t,n,i){var r=i.ext.support.modifiers;if(!Array.isArray(r)||-1===r.indexOf(j))return!1;var o=z(t,e);return o&&!o.disabled}};return n}};var G="timeSeriesDecomposition";function U(e,t){var n=o(e,t);if(n)for(var i=0;i<n.length;i++)if(n[i].type===G)return n[i]}function W(e,t){var n=function(e,t){var n=o(e,t);if(!n)return-1;for(var i=0;i<n.length;i++)if(n[i].type===G)return i;return-1}(e,t);return n>-1?"".concat(t,".").concat(n):t}var X={type:"timeSeriesDecomposition",disabled:!1,decomposition:"",steps:2,outputExpression:""};const K={translationKey:"properties.modifier.timeSeriesDecomposition",needDimension:D.needDimension,isApplicable:function(e){var t=e.properties,n=e.layout;return D.isApplicable({properties:t,layout:n,minDimensions:1,maxDimensions:2})},generateExpression:function(e){var t=e.expression,n=e.modifier,i=e.properties;return n?D.generateTSDExpression(n,t,i):t},extractInputExpression:D.extractInputExpression,initModifier:function(e,t){D.initModifier(e,X),""===e.decomposition&&t&&(e.decomposition=D.getDecomposition(t))},propertyPanelDef:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n={type:"items",items:{disclaimer:{component:"text",translation:t.timeSeriesDecomposition||"properties.modifier.timeSeriesDecomposition",show:function(e,t){return!D.isApplicable({properties:t.properties})}},settings:{type:"items",items:{decomposition:{refFn:function(t){return"".concat(W(t,e),".decomposition")},type:"string",translation:t.modifierTrendDecompositionDecomposition||"properties.modifier.trendDecomposition.decomposition",component:"dropdown",schemaIgnore:!0,defaultValue:t.trendDecompositionParametersDecompositionObserved||"cao.trendDecomposition.parameters.decomposition.observed",options:a.OPTIONS},steps:{refFn:function(t){return"".concat(W(t,e),".steps")},type:"integer",translation:t.modifierTimeSeriesDecompositionPeriods||"properties.modifier.timeSeriesDecomposition.periods",schemaIgnore:!0,defaultValue:2,change:function(t,n){var i=U(t,e);if(i){var r=i.steps;i.steps="number"!=typeof r||Number.isNaN(r)?2:Math.abs(r),n.properties.qHyperCubeDef.qMeasures=n.properties.qHyperCubeDef.qMeasures.map((function(e){return e.qDef.modifiers.map((function(e){return"timeSeriesDecomposition"===e.type?e.steps=r:e.steps=e.steps,e})),e}))}},show:function(t){var n=U(t,e);return n&&!n.fullRange}}},show:function(e,t){return D.isApplicable({properties:t.properties})}}},show:function(t,n,i){var r=i.ext.support.modifiers;if(!Array.isArray(r)||-1===r.indexOf(G))return!1;var o=U(t,e);return o&&!o.disabled}};return n}};var Z="difference";function Y(e,t){var n=o(e,t);if(n)for(var i=0;i<n.length;i++)if(n[i].type===Z)return n[i]}function J(e,t){var n=function(e,t){var n=o(e,t);if(!n)return-1;for(var i=0;i<n.length;i++)if(n[i].type===Z)return i;return-1}(e,t);return n>-1?"".concat(t,".").concat(n):t}var Q={type:"difference",disabled:!1,primaryDimension:0,crossAllDimensions:!1,showExcludedValues:!0,outputExpression:""};const ee={translationKey:"properties.modifier.difference",needDimension:D.needDimension,isApplicable:function(e){var t=e.properties,n=e.layout;return D.isApplicable({properties:t,layout:n,minDimensions:1,maxDimensions:2})},extractInputExpression:D.extractInputExpression,generateExpression:function(e){var t=e.expression,n=e.modifier,i=e.properties,r=e.layout,a=e.numDimensions,s=e.dimensionAndFieldList;if(!n)return t;var l=a;void 0===l&&(l=D.getNumDimensions({properties:i,layout:r}));var u=o(i,"qHyperCubeDef.qDimensions",[]),c=D.getExpressionWithExcludedComp({expression:t,modifier:n,dimensions:u,dimensionAndFieldList:s}),p=D.getAboveComp(n,l,c),f="".concat(c," - ").concat(p);if(D.needDimension({modifier:n,properties:i,layout:r})){var d=D.getDimComp(u,1),m=D.getDimComp(u,0),h=D.getAggrComp(f,d,m);f=n.showExcludedValues?D.getExcludedComp({modifier:n,dimensions:u,dimensionAndFieldList:s,funcComp:"Only",valueComp:h}):h}return f},initModifier:function(e){Object.keys(Q).forEach((function(t){void 0===e[t]&&(e[t]=Q[t])}))},enableTotalsFunction:function(){return!1},propertyPanelDef:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n={type:"items",items:{disclaimer:{component:"text",translation:t.disclaimer||"properties.modifier.difference.disclaimer",show:function(e,t){return!D.isApplicable({properties:t.properties})}},settings:{type:"items",items:{primaryDimension:{refFn:function(t){return"".concat(J(t,e),".primaryDimension")},type:"integer",translation:t.primaryDimension||"properties.modifier.primaryDimension",title:{translation:t.primaryDimensionTooltip||"properties.modifier.difference.primaryDimension.tooltip"},component:"dropdown",schemaIgnore:!0,defaultValue:1,options:function(e,t){return t.layout.qHyperCube.qDimensionInfo.map((function(e,t){return{value:t,label:e.qGroupFallbackTitles[0]}}))},show:function(e,t){return t.layout.qHyperCube.qDimensionInfo.length>1}},crossAllDimensions:{refFn:function(t){return"".concat(J(t,e),".crossAllDimensions")},type:"boolean",translation:t.crossAllDimensions||"properties.modifier.crossAllDimensions",title:{translation:t.crossAllDimensionsTooltip||"properties.modifier.difference.crossAllDimensions.tooltip"},schemaIgnore:!0,defaultValue:!1,show:function(e,t){return t.layout.qHyperCube.qDimensionInfo.length>1}},showExcludedValues:{refFn:function(t){return"".concat(J(t,e),".showExcludedValues")},type:"boolean",translation:t.showExcludedValues||"properties.modifier.showExcludedValues",schemaIgnore:!0,defaultValue:!0}},show:function(e,t){return D.isApplicable({properties:t.properties})}}},show:function(t,n,i){var r=i.ext.support.modifiers;if(!Array.isArray(r)||-1===r.indexOf(Z))return!1;var o=Y(t,e);return o&&!o.disabled}};return n}};var te="normalization";function ne(e,t){var n=o(e,t);if(n)for(var i=0;i<n.length;i++)if(n[i].type===te)return n[i]}function ie(e,t){var n=function(e,t){var n=o(e,t);if(!n)return-1;for(var i=0;i<n.length;i++)if(n[i].type===te)return i;return-1}(e,t);return n>-1?"".concat(t,".").concat(n):t}function re(e,t){for(var n=0;n<e.length;n++)if(e[n].value===t)return n;return-1}var oe={type:"normalization",disabled:!1,primaryDimension:0,outputExpression:"",dimensionalScope:2,selectionScope:2};function ae(e){return 2===e?"{1}":""}function se(e,t,n){return 1===e?"{$<".concat(D.getFieldWithWrapper(t),"={'").concat(n,"'}>}"):""}function le(e,t){return 0===e&&t>1||2===e?"Total":""}function ue(e,t,n){return 0===e&&t>1?"<".concat(D.getDimDefWithWrapper(n),">"):""}const ce={translationKey:"properties.modifier.normalization",needDimension:function(){return!0},isApplicable:function(e){var t=e.properties,n=e.layout;return D.isApplicable({properties:t,layout:n,minDimensions:1,maxDimensions:2})},extractInputExpression:D.extractInputExpression,generateExpression:function(e){var t=e.expression,n=e.modifier,i=e.properties,r=e.layout,a=e.numDimensions,s=e.dimensionAndFieldList;if(!n)return t;var l=a;void 0===l&&(l=D.getNumDimensions({properties:i,layout:r}));var u=o(i,"qHyperCubeDef.qDimensions",[]),c=D.getExpressionWithExcludedComp({expression:t,modifier:n,dimensions:u,dimensionAndFieldList:s}),p=n.selectionScope,f=n.dimensionalScope;return function(e,t,n,i,r,o,a){var s=ae(t),l=se(t,n,i),u=""===s&&""===l?"":s||l,c=le(r,o),p=ue(r,o,a),f=function(e){for(var t=[],n=0;n<e;n++)t[n]=D.getDimDefWithWrapper(n);return t.join(", ")}(o);return"".concat(e,"/ Sum(").concat(u," ").concat(c).concat(p," Aggr(").concat(u," ").concat(e,", ").concat(f,"))")}(c,p,n.field,n.value,f,l,n.primaryDimension)},initModifier:function(e){Object.keys(oe).forEach((function(t){void 0===e[t]&&(e[t]=oe[t])}))},updateModifier:function(e,t){1===(t.qDimensions?t.qDimensions.length:0)&&0===e.dimensionalScope&&(e.dimensionalScope=2)},enableTotalsFunction:function(){return!0},propertyPanelDef:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n={type:"items",items:{disclaimer:{component:"text",translation:t.disclaimer||"properties.modifier.normalization.disclaimer",show:function(e,t){return!D.isApplicable({properties:t.properties})}},settings:{type:"items",items:{selectionScope:{refFn:function(t){return"".concat(ie(t,e),".selectionScope")},type:"string",translation:t.modifierSelectionScope||"properties.modifier.selectionScope",title:{translation:t.modifierSelectionScopeTooltip||"properties.modifier.selectionScope.tooltip"},component:"dropdown",schemaIgnore:!0,defaultValue:2,options:function(n){return function(e,t,n){var i=[{value:0,translation:t.selectionScopeCurrentSelection||"properties.modifier.selectionScope.currentSelection"},{value:1,translation:t.selectionScopeSpecificValue||"properties.modifier.selectionScope.selectAField"},{value:2,translation:t.selectionScopeTotal||"properties.modifier.selectionScope.total"}];return i=function(e,t){if(1===e){var n=re(t,0);t.splice(n,1)}return t}(ne(e,n).dimensionalScope,i),i}(n,t,e)}},field:{refFn:function(t){return"".concat(ie(t,e),".field")},type:"string",component:"expression-with-dropdown",translation:"Common.Field",defaultValue:"",dropdownOnly:!0,options:function(e,t,n){return n.app.getFieldList().then((function(e){return e.map((function(e){return{label:e.qName,value:e.qName}}))}))},show:function(t){return 1===ne(t,e).selectionScope}},value:{refFn:function(t){return"".concat(ie(t,e),".value")},type:"string",ref:"value",component:"string",translation:"properties.value",expression:"optional",show:function(t){return 1===ne(t,e).selectionScope}},dimensionalScope:{refFn:function(t){return"".concat(ie(t,e),".dimensionalScope")},type:"string",translation:t.modifierDimensionalScope||"properties.modifier.dimensionalScope",title:{translation:t.modifierDimensionalScopeTooltip||"properties.modifier.dimensionalScope.tooltip"},component:"dropdown",schemaIgnore:!0,defaultValue:2,supportTooltip:!0,options:function(n,i){return function(e,t,n,i){var r=t.layout.qHyperCube.qDimensionInfo.length,o=[{value:0,translation:n.dimensionalScopeOneDimension||"properties.modifier.dimensionalScope.respectOneDimension",tooltipTranslation:n.dimensionalScopeOneDimensionTooltip||"properties.modifier.dimensionalScope.respectOneDimension.tooltip"},{value:1,translation:n.dimensionalScopeAllDimensions||"properties.modifier.dimensionalScope.".concat(2===r?"respectAllDimensions":"respectDimension"),tooltipTranslation:n.dimensionalScopeAllDimensionsTooltip||"properties.modifier.dimensionalScope.".concat(2===r?"respectAllDimensions":"respectDimension",".tooltip")},{value:2,translation:n.dimensionalScopeDisregardAllDimensions||"properties.modifier.dimensionalScope.".concat(2===r?"disregardAllDimensions":"disregardDimension"),tooltipTranslation:n.dimensionalScopeDisregardAllDimensionsTooltip||"properties.modifier.dimensionalScope.".concat(2===r?"disregardAllDimensions":"disregardDimension",".tooltip")}];return o=function(e,t){if(e<2){var n=re(t,0);t.splice(n,1)}return t}(r,o),o=function(e,t){if(0===e){var n=re(t,1);t.splice(n,1)}return t}(ne(e,i).selectionScope,o),o}(n,i,t,e)}},primaryDimension:{refFn:function(t){return"".concat(ie(t,e),".primaryDimension")},type:"integer",translation:t.primaryDimension||"properties.modifier.primaryDimension",title:{translation:t.primaryDimensionTooltip||"properties.modifier.normalization.primaryDimension.tooltip"},component:"dropdown",schemaIgnore:!0,defaultValue:1,options:function(e,t){return t.layout.qHyperCube.qDimensionInfo.map((function(e,t){return{value:t,label:e.qGroupFallbackTitles[0]}}))},show:function(t,n){return 0===(ne(t,e).dimensionalScope||0)&&n.layout.qHyperCube.qDimensionInfo.length>1}}},show:function(e,t){return D.isApplicable({properties:t.properties})}}},show:function(t,n,i){var r=i.ext.support.modifiers;if(!Array.isArray(r)||-1===r.indexOf(te))return!1;var o=ne(t,e);return o&&!o.disabled}};return n},getDisregardSelectionComp:ae,getFieldSelectionComp:se,getTotalComp:le,getSelectedDimComp:ue};var pe="qDef.base",fe="qDef.qDef",de="qDef.base.qDef",me="qLibraryId",he="qDef.base.qLibraryId";const ge={getExpression:function(e){var t=o(e,de);return void 0!==t?t:o(e,fe)},getExpressionRef:function(e){return void 0!==o(e,de)?de:fe},getLibraryIdRef:function(e){return o(e,he)?he:me},getLibraryId:function(e){return o(e,he)||o(e,me)},getLabelRef:function(e){return o(e,pe)?"qDef.base.qLabel":"qDef.qLabel"},getLabelExpressionRef:function(e){return o(e,pe)?"qDef.base.qLabelExpression":"qDef.qLabelExpression"}};var ye="qDef.qDef",ve="qDef.base.qDef",be="qLibraryId",xe="qDef.base.qLibraryId",qe="qDef.qLabel",De="qDef.qLabelExpression",Se="qDef.base.qLabel",Me="qDef.base.qLabelExpression",Ae="qDef.qAggrFunc",Ie="qDef.base.qAggrFunc",we={initBase:function(e,t){(t||we.isValid(e))&&(n(e,ve,o(e,ye)),n(e,xe,o(e,be)),n(e,Se,o(e,qe)),n(e,Me,o(e,De)))},restoreBase:function(e){we.isValid(e)&&(n(e,ye,o(e,ve)),n(e,be,o(e,xe)),n(e,qe,o(e,Se)),n(e,De,o(e,Me)),o(e,Ae)&&o(e,Ie)&&n(e,Ae,o(e,Ie)),delete e.qDef.base)},isValid:function(e){var t=o(e,ve),n=o(e,xe);return void 0!==t||void 0!==n}};const ke=we;function Ce(e){return Ce="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Ce(e)}var Le={accumulation:H,movingAverage:$,difference:ee,normalization:ce,timeSeriesDecomposition:K};const Ee={modifiers:Le,apply:Pe,applyModifiers:Oe,cleanUpMeasure:Fe,destroy:function(e){e&&Ne[e.id]&&Ne[e.id].masterItemSubscriber&&(Ne[e.id].masterItemSubscriber&&Ne[e.id].masterItemSubscriber.unsubscribe(),delete Ne[e.id])},hasActiveModifiers:Te,getActiveModifier:Re,initBase:ke.initBase,isSupportedModifiers:function(e){return Array.isArray(e)&&e.some((function(e){return Le[e]}))},isApplicableSupportedModifiers:function(e){var t=e.modifierTypes,n=e.properties,i=e.layout;return Array.isArray(t)&&t.some((function(e){return Le[e]&&Le[e].isApplicable({properties:n,layout:i})}))},measureBase:ge,limitedSorting:function(e){var t=e.measures,n=e.properties,i=e.layout,r=!1,o=!1;return t.forEach((function(e){var t=je(e);We({modifiers:t,properties:n,layout:i})&&(r=!0,o=o||Je({modifiers:t,properties:n,layout:i}))})),r&&!o},ifEnableTotalsFunction:Ve};var Ne={};function Pe(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=e.model,i=e.properties,r=e.isSnapshot,a=void 0!==r&&r,s=e.masterItem,l=!1;Ne[n.id]=Ne[n.id]||{isFirstTime:!0};var u=Ne[n.id].isFirstTime;if(Ne[n.id].isFirstTime=!1,i&&"object"===Ce(i))return Oe({model:n,properties:i});var c=n?n.layout:void 0,p=o(c,"qSelectionInfo.qInSelections");if(a||p)return Promise.resolve(l);var f=o(c,"qHyperCube.qMeasureInfo"),d=Ne[n.id].lastReloadTime;if(Ne[n.id].lastReloadTime=o(n,"app.layout.qLastReloadTime"),Te({measures:f,layout:c})){var m=function(e){var t=e.measures,n=e.layout,i=e.lastReloadTime;return o(e.model,"app.layout.qLastReloadTime")!==i&&function(e){var t=e.measures,n=e.properties,i=e.layout;return!!Array.isArray(t)&&t.some((function(e){return Ue({measure:e,properties:n,layout:i})}))}({measures:t,layout:n})}({measures:f,layout:c,model:n,lastReloadTime:d});return m||function(e){var t=e.measures,n=e.layout,i=e.masterItem,r=e.isFirstTime;return!!Array.isArray(t)&&(r||i||t.some((function(e){return function(e){var t=e.measure,n=e.layout;return We({modifiers:je(t),layout:n})?!t.base:!!t.base}({measure:e,layout:n})})))}({measures:f,layout:c,masterItem:s,isFirstTime:u})?n.getEffectiveProperties().then((function(e){var i=t()(!0,{},e);_e(i);var r=Qe(i);return Xe({model:n}).then((function(t){return Ke({libraryIds:r,model:n}).then((function(r){return m&&function(e){var t=e.properties;He(t).forEach((function(e){return function(e){var t=e.measure;if(Ue({measure:t,properties:e.properties})){var n=0,i=t.qDef.modifiers;Array.isArray(i)&&i.forEach((function(e){if("object"===Ce(e)&&!e.disabled){if(n++,"object"!==Ce(Le[e.type]))throw new Error('Modifier "'.concat(e.type,'" is not available'));if(n>1)throw new Error("More than 1 modifier on a measure! (not yet supported)");var i=Le[e.type].extractInputExpression({outputExpression:t.qDef.qDef,modifier:e});void 0!==i&&$e(t)&&D.simplifyExpression(t.qDef.base.qDef)!==D.simplifyExpression(i)&&(t.qDef.base.qDef=i)}}))}}({measure:e,properties:t})}))}({properties:i}),Oe({model:n,oldProperties:e,properties:i,runUpdateIfChange:!0,masterItem:s,libraryItemsProps:r,dimensionAndFieldList:t})}))}))})):Promise.resolve(l)}return function(e){return!!Array.isArray(e)&&e.some((function(e){return"object"===Ce(e.base)}))}(f)?n.getEffectiveProperties().then((function(e){return function(e){var n=e.model,i=e.properties,r=Qe(i);return et({model:n,libraryIds:r}).then((function(){var e=t()(!0,{},i);return He(i).forEach((function(e){return Fe(e)})),Ye({oldProperties:e,newProperties:i,model:n})}))}({model:n,properties:e})})):Promise.resolve(l)}function Oe(e){var n=e.model,i=e.oldProperties,r=e.properties,a=e.measures,s=e.runUpdateIfChange,l=void 0!==s&&s,u=e.masterItem,c=e.libraryItemsProps,p=e.dimensionAndFieldList;void 0===i&&(i=l?t()(!0,{},r):r),_e(r);var f=Qe(r);return et({model:n,libraryIds:f,masterItem:u}).then((function(){return function(e){var n=e.measures,i=e.properties,r=e.model,a=e.libraryItemsProps,s=e.dimensionAndFieldList;if(n||(n=He(i)),!n.length)return Promise.resolve();if(!Te({measures:n,properties:i}))return n.forEach((function(e){return Fe(e)})),Promise.resolve();var l=a?void 0:Qe(i);return Xe({model:r,dimensionAndFieldList:s}).then((function(e){return Ke({libraryIds:l,model:r,libraryItemsProps:a}).then((function(r){n.forEach((function(n){We({modifiers:n.qDef.modifiers,properties:i})?(function(e){var n=e.measure,i=e.properties,r=e.libraryItemsProps,a=e.dimensionAndFieldList,s=0;ke.isValid(n)||ke.initBase(n,!0);var l=n.qDef,u=l.modifiers,c=l.base;Array.isArray(u)&&u.forEach((function(e){if("object"===Ce(e)&&!e.disabled){if(s++,"object"!==Ce(Le[e.type]))throw new Error('Modifier "'.concat(e.type,'" is not available'));if(s>1)throw new Error("More than 1 modifier on a measure! (not yet supported)");Le[e.type].initModifier(e,n);var l=n.qLibraryId||c&&c.qLibraryId;l?function(e){var n=e.measure,i=e.modifier,r=e.properties,o=e.dimensionAndFieldList,a=e.libraryItemsProps[e.libraryId],s=a.qMeasure.qDef,l=""===s?s:Le[i.type].generateExpression({expression:s,modifier:i,properties:r,dimensionAndFieldList:o});i.outputExpression=l,n.qDef.qDef=i.outputExpression,(n.qDef.qLabel||a.qMeasure.qLabel)&&(n.qDef.qLabel=a.qMeasure.qLabel),(n.qDef.qLabelExpression||a.qMeasure.qLabelExpression)&&(n.qDef.qLabelExpression=a.qMeasure.qLabelExpression),n.qDef.quarantine&&n.qDef.quarantine.qNumFormat&&a.qMeasure.qNumFormat&&(n.qDef.qNumFormat=a.qMeasure.qNumFormat,n.qDef.isCustomFormatted=a.qMeasure.isCustomFormatted),delete n.qLibraryId,n.qDef.coloring=a.qMeasure.coloring,i.base=t()(!0,{},n.qDef.base)}({measure:n,modifier:e,libraryId:l,properties:i,libraryItemsProps:r,dimensionAndFieldList:a}):function(e){var n=e.measure,i=e.modifier,r=e.properties,o=e.dimensionAndFieldList;"function"==typeof Le[i.type].updateModifier&&Le[i.type].updateModifier(i,r.qHyperCubeDef);var a=ge.getExpression(n),s=""===a?a:Le[i.type].generateExpression({expression:a,modifier:i,properties:r,dimensionAndFieldList:o});i.outputExpression=s,n.qDef.qDef=i.outputExpression,n.qDef.base.qLabelExpression?n.qDef.qLabelExpression=n.qDef.base.qLabelExpression:n.qDef.qLabel=n.qDef.base.qLabel||a,i.base=t()(!0,{},n.qDef.base)}({measure:n,modifier:e,properties:i,dimensionAndFieldList:a}),function(e){var t=o(e,"qDef.qAggrFunc");"Expr"!==t||Ve(e)?"None"!==t?delete e.qDef.base.qAggrFunc:"None"===t&&Ve(e)&&"Expr"===e.qDef.base.qAggrFunc&&(e.qDef.qAggrFunc="Expr",delete e.qDef.base.qAggrFunc):(e.qDef.qAggrFunc="None",e.qDef.base.qAggrFunc="Expr")}(n)}}))}({measure:n,properties:i,libraryItemsProps:r,dimensionAndFieldList:e}),Be(n)):Fe(n)}))}))}))}({measures:a,properties:r,model:n,libraryItemsProps:c,dimensionAndFieldList:p}).then((function(){return l?Ye({oldProperties:i,newProperties:r,model:n}):Promise.resolve(!1)}))}))}function Fe(e){!function(e){var t=je(e);return Array.isArray(t)&&t.some((function(e){return"object"===Ce(e)&&!e.disabled&&!Le[e.type]}))}(e)?ke.restoreBase(e):delete e.qDef.base,e.qDef.coloring&&delete e.qDef.coloring,Be(e)}function Te(e){var t=e.measures,n=e.properties,i=e.layout;return!!Array.isArray(t)&&t.some((function(e){return We({modifiers:je(e),properties:n,layout:i})}))}function Re(e){var t=je(e);if(Array.isArray(t))for(var n=0;n<t.length;n++){var i=t[n];if(Le[i.type]&&!i.disabled)return i}}function Ve(e){var t=Re(e);return!t||Le[t.type].enableTotalsFunction(e)}function He(e){return o(e,"qHyperCubeDef.qMeasures",[]).concat(o(e,"qHyperCubeDef.qLayoutExclude.qHyperCubeDef.qMeasures",[]))}function je(e){return e.modifiers||e.qDef&&e.qDef.modifiers}function ze(e){return o(e,"outputExpression.qValueExpression.qExpr")||o(e,"outputExpression")}function _e(e){He(e).forEach((function(e){return function(e){var n=Re(e);n&&(void 0!==n.outputExpression&&ze(n)!==e.qDef.qDef?delete e.qDef.base:!ke.isValid(e)&&n.base&&(e.qDef.base=t()(!0,{},n.base)))}(e)}))}function Be(e){var t=je(e);Array.isArray(t)&&t.forEach((function(t){"object"===Ce(t)&&(t.disabled||!Le[t.type]&&ze(t)!==e.qDef.qDef)&&(t.disabled=!0,delete t.base)}))}function $e(e){return e.base||e.qDef&&e.qDef.base}function Ge(e){var t=$e(e);return e.qLibraryId||t&&t.qLibraryId}function Ue(e){var t=e.measure,n=e.properties,i=e.layout;return!Ge(t)&&We({modifiers:je(t),properties:n,layout:i})}function We(e){var t=e.modifiers,n=e.properties,i=e.layout,r={};return Array.isArray(t)&&t.some((function(e){return!("object"!==Ce(e)||e.disabled||!Le[e.type])&&(void 0===r[e.type]&&(r[e.type]=Le[e.type].isApplicable({properties:n,layout:i})),r[e.type])}))}function Xe(e){var t=e.model,n=e.dimensionAndFieldList;if(n)return Promise.resolve(n);var i=[],r={},o=t.app.getDimensionList().then((function(e){r.dimensionList=e}));i.push(o);var a=t.app.getFieldList().then((function(e){r.fieldList=e}));return i.push(a),Promise.all(i).then((function(){return r}))}function Ke(e){var t=e.libraryIds,n=e.model,i=e.libraryItemsProps;if(i)return Promise.resolve(i);var r=t.measureLibraryIds,o=t.dimensionLibraryIds,a={},s=[];return r.forEach((function(e){var t=n.app.getMeasure(e).then((function(t){return t.getProperties().then((function(t){a[e]=t}))}));s.push(t)})),o.forEach((function(e){var t=n.app.getDimension(e).then((function(t){return t.getProperties().then((function(t){a[e]=t}))}));s.push(t)})),Promise.all(s).then((function(){return a}))}function Ze(e,t){if(""!==t||-1===["qFmt","qDec","qThou"].indexOf(e))return t}function Ye(e){var t=e.oldProperties,n=e.newProperties,i=e.model,r=JSON.stringify(o(t,"qHyperCubeDef.qMeasures"),Ze)!==JSON.stringify(o(n,"qHyperCubeDef.qMeasures"),Ze)||JSON.stringify(o(t,"qHyperCubeDef.qLayoutExclude.qHyperCubeDef.qMeasures"),Ze)!==JSON.stringify(o(n,"qHyperCubeDef.qLayoutExclude.qHyperCubeDef.qMeasures"),Ze);return r?function(e){var t=e.model,n=e.oldProperties,i=e.newProperties,r=t.layout;return r&&!r.qHasSoftPatches&&!r.qExtendsId&&o(r,"qMeta.privileges",[]).indexOf("update")>-1?t.setProperties(i):O(t,n,i)}({model:i,oldProperties:t,newProperties:n}).then((function(){return r})):Promise.resolve(r)}function Je(e){var t=e.modifiers,n=e.properties,i=e.layout;return Array.isArray(t)&&t.some((function(e){return"object"===Ce(e)&&!e.disabled&&Le[e.type]&&Le[e.type].needDimension({modifier:e,properties:n,layout:i})}))}function Qe(e){var t=He(e),n=[],i=[],r=!1;return t.forEach((function(t){var i=je(t);if(We({modifiers:i,properties:e})){var o=Ge(t);o&&n.push(o),r=r||Je({modifiers:i,properties:e})}})),o(e,"qHyperCubeDef.qDimensions",[]).forEach((function(e){var t=e.qLibraryId;t&&i.push(t)})),{measureLibraryIds:n,dimensionLibraryIds:i}}function et(e){var t=e.model,n=e.libraryIds;return!e.masterItem&&n&&(n.measureLibraryIds.length||n.dimensionLibraryIds.length)?(Ne[t.id].masterItemSubscriber=Ne[t.id].masterItemSubscriber||function(e){var t=e.model,n=e.callback,i={},r={},a={},s={dimension:["qDim.qFieldDefs"],measure:["qMeasure.qDef","qMeasure.qLabel","qMeasure.qLabelExpression","qMeasure.coloring","qMeasure.qNumFormat","qMeasure.isCustomFormatted"]};function l(e){var t={},n=o(e,"qInfo.qType");return n&&s[n]&&s[n].forEach((function(n){t[n]=o(e,n)})),JSON.stringify(t)}function u(e){var t=e.qInfo.qId;if(i[t]){var r=l(e);i[t].properties!==r&&(i[t].properties=r,"function"==typeof n&&i[t].enabled&&n(e)),i[t].enabled=!0}}function c(e,n){return t.app[n](e).then((function(t){i[e]={listener:t.layoutSubscribe(u),enabled:!1,properties:l(t.layout)}}))}return{subscribe:function(e){var n=e.measureLibraryIds,o=e.dimensionLibraryIds,s=[];return function(e){var t=e.dimensionLibraryIds;r={},e.measureLibraryIds.forEach((function(e){r[e]=!0})),a={},t.forEach((function(e){a[e]=!0}))}({measureLibraryIds:n,dimensionLibraryIds:o}),Object.keys(i).forEach((function(e){r[e]||a[e]||(i[e].listener.dispose(),delete i[e])})),t.app&&(Object.keys(r).forEach((function(e){r[e]&&!i[e]&&s.push(c(e,"getMeasure"))})),Object.keys(a).forEach((function(e){a[e]&&!i[e]&&s.push(c(e,"getDimension"))}))),Promise.all(s)},unsubscribe:function(){Object.keys(i).forEach((function(e){i[e].listener.dispose()})),i={}}}}({model:t,callback:function(e){return Pe({model:t,masterItem:e}).then((function(){return t.app.clearUndoBuffer()}))}}),Ne[t.id].masterItemSubscriber.subscribe(n)):Promise.resolve()}})(),t.default=r.default,Object.defineProperty(t,"__esModule",{value:!0})})()}},t={};function n(i){var r=t[i];if(void 0!==r)return r.exports;var o=t[i]={exports:{}};return e[i](o,o.exports,n),o.exports}n.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return n.d(t,{a:t}),t},n.d=(e,t)=>{for(var i in t)n.o(t,i)&&!n.o(e,i)&&Object.defineProperty(e,i,{enumerable:!0,get:t[i]})},n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t);var i={};return(()=>{function e(t){var n,i=t;return i>9?(n=65+i-10)>90&&(n+=6):i="".concat(i).charCodeAt(0),[48,111,79,105,73,108].indexOf(n)>-1?e(i+1):String.fromCharCode(n)}function t(n){var i=e(n%62),r=Math.floor(n/62);return r>0?t(r)+i:i}function r(e){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r(e)}n.d(i,{default:()=>_e});const o={getValue:function(e,t,n){if(null==e||null==t)return n;for(var i=t.split("."),r=e,o=0;o<i.length;++o){var a=i[o];if(""!==a){if(void 0===r[a]||null===r[a])return n;r=r[a]}}return r},setValue:function(e,t,n){if(null!=e&&null!=t){for(var i=t.split("."),r=i[i.length-1],o=e,a=0;a<i.length-1;++a){var s=i[a];void 0!==o[s]&&null!==o[s]||(o[s]=Number.isNaN(+i[a+1])?{}:[]),o=o[s]}void 0!==n?o[r]=n:delete o[r]}},isEmpty:function(e){return 0===Object.keys(e).length&&e.constructor===Object},isAtomicValue:function(e){return/boolean|number|string/.test(r(e))},generateId:function(){return t(Math.round(99e11*Math.random()+1e11)).replace(/\W/g,"")}};function a(e){return function(e){if(Array.isArray(e))return s(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(e){if("string"==typeof e)return s(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?s(e,t):void 0}}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function s(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,i=new Array(t);n<t;n++)i[n]=e[n];return i}function l(e){return function(e){if(Array.isArray(e))return u(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(e){if("string"==typeof e)return u(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?u(e,t):void 0}}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function u(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,i=new Array(t);n<t;n++)i[n]=e[n];return i}function c(e,t,n){if(e){for(var i=0;i<e.length;i++)if(e[i][t]===n)return i;return-1}return-1}const p={isOrderedSubset:function(e,t){if(!(e&&t&&e.length&&t.length))return!1;var n=e.indexOf(t[0]);if(-1!==n){for(var i=0;i<t.length;i++){var r=e.indexOf(t[i]);if(n>r)return!1;n=r}return!0}return!1},indexAdded:function(e,t){var n;for(n=0;n<e.length;++n)e[n]>=0&&e[n]>=t&&++e[n];e.push(t)},indexRemoved:function(e,t){var n,i=0;for(n=0;n<e.length;++n)e[n]>t?--e[n]:e[n]===t&&(i=n);return e.splice(i,1),i},findItemByPropertyValue:function(e,t,n){if(e){for(var i=0;i<e.length;i++)if(e[i][t]===n)return e[i];return null}return null},findIndexByPropertyValue:c};var f=n(645),d=n.n(f);const m=function(e){var t,n=e.exportFormat,i=e.qHyperCubeDef,r=n.data[0];(t=r.dimensions).push.apply(t,a(i.qDimensions));var s,l=o.getValue(i,"qLayoutExclude.qHyperCubeDef.qDimensions");l&&(s=r.excludedDimensions).push.apply(s,a(l))},h=function(e){var t,n=e.exportFormat,i=e.qHyperCubeDef,r=n.data[0];(t=r.measures).push.apply(t,l(i.qMeasures));var a,s=o.getValue(i,"qLayoutExclude.qHyperCubeDef.qMeasures");s&&(a=r.excludedMeasures).push.apply(a,l(s))},g=function(e){var t=e.exportFormat,n=e.qHyperCubeDef,i=t.data[0];n.qInterColumnSortOrder||(n.qInterColumnSortOrder=[]),i.interColumnSortOrder=n.qInterColumnSortOrder.concat();var r=o.getValue(n,"qLayoutExclude.qHyperCubeDef.qInterColumnSortOrder");r&&p.isOrderedSubset(r,i.interColumnSortOrder)&&(i.interColumnSortOrder=r.concat())},y=function(e){var t=e.exportFormat,n=e.properties;Object.keys(n).forEach((function(e){t.properties[e]=n[e]}))},v=function(e){var t=e.exportFormat,n=e.properties;n.qLayoutExclude||(n.qLayoutExclude={}),n.qLayoutExclude.disabled&&(Object.keys(n.qLayoutExclude.disabled).forEach((function(e){t.properties.hasOwnProperty(e)||(t.properties[e]=n.qLayoutExclude.disabled[e])})),delete n.qLayoutExclude.disabled),n.qLayoutExclude.changed&&(function(e){Object.keys(e.qLayoutExclude.changed).forEach((function(t){e.qLayoutExclude.changed[t].to===o.getValue(e,t)&&o.setValue(e,t,e.qLayoutExclude.changed[t].from)}))}(n),delete n.qLayoutExclude.changed),n.qLayoutExclude.quarantine&&!o.isEmpty(n.qLayoutExclude.quarantine)||delete n.qLayoutExclude},b=function(e){e.forEach((function(e){d().cleanUpMeasure(e),e.qDef.modifiers&&(e.store={modifiers:e.qDef.modifiers},delete e.qDef.modifiers)}))};function x(e,t,n){var i,r,a=o.getValue(e,t);if(!o.isAtomicValue(a))try{if((r=(r=(i=JSON.stringify(a)).match(/:\{/g))?r.length:0)>2)return;a=JSON.parse(i)}catch(e){return}o.getValue(e,"qLayoutExclude.quarantine")||o.setValue(e,"qLayoutExclude.quarantine",{});var s=o.getValue(e,"qLayoutExclude.quarantine");s[n]||(s[n]={}),s[n][t]=a}var q=n(229),D=n.n(q);function S(e,t){var n=D()(!0,{},t,e);return o.getValue(n,"qOtherTotalSpec.qOtherCounted")||o.setValue(n,"qOtherTotalSpec.qOtherCounted",{qv:"10"}),o.getValue(n,"qOtherTotalSpec.qOtherLimit")||o.setValue(n,"qOtherTotalSpec.qOtherLimit",{qv:"0"}),n.hasOwnProperty("othersLabel")||(n.othersLabel="Others"),n}function M(e,t){return D()(!0,{},t,e)}function A(e,t,n){return"function"==typeof e?e(t):Number.isNaN(+e)?n:e}var I=Math.pow(2,53)-1;function w(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,i=new Array(t);n<t;n++)i[n]=e[n];return i}function k(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,i=new Array(t);n<t;n++)i[n]=e[n];return i}const C=function(e,t,n){var i="masterobject"===o.getValue(t,"properties.qInfo.qType")?"masterobject":o.getValue(n,"qInfo.qType");o.setValue(e,"qInfo.qType",i),e.visualization=n.visualization},L=function(e,t,n){t.hasOwnProperty(e)&&(n[e]=t[e])},E=function(e,t,n,i){t.hasOwnProperty(e)?n[e]=t[e]:n[e]=i},N=function(){return{qDef:{autoSort:!0,cId:"",othersLabel:"Others"},qLibraryId:"",qNullSuppression:!1,qOtherLabel:"Others",qOtherTotalSpec:{qOtherLimitMode:"OTHER_GE_LIMIT",qOtherMode:"OTHER_OFF",qOtherSortMode:"OTHER_SORT_DESCENDING",qSuppressOther:!1}}},P=function(){return{qDef:{autoSort:!0,cId:"",numFormatFromTemplate:!0},qLibraryId:"",qTrendLines:[]}},O=function(e){var t,n=e.exportFormat,i=e.maxDimensions,r=e.minDimensions,o=e.newHyperCubeDef,a=e.defaultDimension,s=n.data[0];for(t=0;t<s.dimensions.length;++t){var l=S(s.dimensions[t],a);o.qDimensions.length<i?o.qDimensions.push(l):o.qLayoutExclude.qHyperCubeDef.qDimensions.push(l)}for(t=0;t<s.excludedDimensions.length;++t){var u=S(s.excludedDimensions[t],a);o.qDimensions.length<r?o.qDimensions.push(u):o.qLayoutExclude.qHyperCubeDef.qDimensions.push(u)}},F=function(e){var t,n=e.exportFormat,i=e.maxMeasures,r=e.minMeasures,o=e.newHyperCubeDef,a=e.defaultMeasure,s=n.data[0];for(t=0;t<s.measures.length;++t){var l=M(s.measures[t],a);o.qMeasures.length<i?o.qMeasures.push(l):o.qLayoutExclude.qHyperCubeDef.qMeasures.push(l)}for(t=0;t<s.excludedMeasures.length;++t){var u=M(s.excludedMeasures[t],a);o.qMeasures.length<r?o.qMeasures.push(u):o.qLayoutExclude.qHyperCubeDef.qMeasures.push(u)}},T=function(e){var t=e.exportFormat,n=e.dataDefinition,i=void 0===n?{}:n,r=t.data[0],o=i.dimensions||{max:0},a=i.measures||{max:0},s=A(a.max,r.dimensions.length,I),l=A(a.min,r.dimensions.length,0);return{maxDimensions:A(o.max,s,I),minDimensions:A(o.min,l,0),maxMeasures:s,minMeasures:l}},R=function(e){var t=e.exportFormat,n=e.newHyperCubeDef,i=t.data[0],r=n.qDimensions.length+n.qMeasures.length;n.qInterColumnSortOrder=i.interColumnSortOrder.concat();var o=n.qInterColumnSortOrder.length;if(o!==r)for(n.qLayoutExclude&&(n.qLayoutExclude.qHyperCubeDef.qInterColumnSortOrder=i.interColumnSortOrder.concat());o!==r;)o<r?(p.indexAdded(n.qInterColumnSortOrder,o),++o):(--o,p.indexRemoved(n.qInterColumnSortOrder,o))},V=function(e){var t=e.exportFormat,n=e.initialProperties,i=e.hypercubePath,r={qLayoutExclude:{disabled:{},quarantine:{}}};return Object.keys(t.properties).forEach((function(e){"qLayoutExclude"===e?t.properties[e].quarantine&&(r.qLayoutExclude.quarantine=D()(!0,{},t.properties[e].quarantine)):"qHyperCubeDef"===e&&i?o.setValue(r,"".concat(i,".qHyperCubeDef"),t.properties.qHyperCubeDef):n.hasOwnProperty(e)||-1!==["qMetaDef","descriptionExpression","labelExpression"].indexOf(e)||function(e,t){return"components"===t&&Array.isArray(e[t])&&e[t].some((function(e){return"general"===e.key}))}(t.properties,e)?r[e]=t.properties[e]:r.qLayoutExclude.disabled[e]=t.properties[e]})),null===(r=D()(!0,{},n,r)).components&&(r.components=[]),r},H=function(e){var t=e.exportFormat,n=e.maxDimensions,i=e.minDimensions,r=e.maxMeasures,o=e.minMeasures,a=t.data[0];return a.dimensions.length>n&&n>0||a.measures.length>r&&r>0||a.excludedDimensions.length>0&&a.dimensions.length+a.excludedDimensions.length>i||a.excludedMeasures.length>0&&a.measures.length+a.excludedMeasures.length>o||!r&&a.measures.length>0||!n&&a.dimensions.length>0},j=function(e){var t=e.exportFormat,n=e.maxDimensions,i=e.minDimensions,r=e.maxMeasures,o=e.minMeasures,a=e.newHyperCubeDef,s=t.data[0];a.qLayoutExclude||(a.qLayoutExclude={}),a.qLayoutExclude.qHyperCubeDef||(a.qLayoutExclude.qHyperCubeDef={}),(s.dimensions.length>n&&n>0||s.excludedDimensions&&s.excludedDimensions.length&&s.dimensions.length+s.excludedDimensions.length>i)&&(a.qLayoutExclude.qHyperCubeDef.qDimensions||(a.qLayoutExclude.qHyperCubeDef.qDimensions=[])),(s.measures.length>r&&r>0||s.excludedMeasures&&s.excludedMeasures.length&&s.measures.length+s.excludedMeasures.length>o)&&(a.qLayoutExclude.qHyperCubeDef.qMeasures||(a.qLayoutExclude.qHyperCubeDef.qMeasures=[])),!r&&s.measures.length&&(a.qLayoutExclude.qHyperCubeDef.qMeasures||(a.qLayoutExclude.qHyperCubeDef.qMeasures=[])),!n&&s.dimensions.length&&(a.qLayoutExclude.qHyperCubeDef.qDimensions||(a.qLayoutExclude.qHyperCubeDef.qDimensions=[]))},z=function(e){var t,n=e.newProperties,i=e.dataDefinition,r=e.hypercubePath;if(i.dimensions&&"function"==typeof i.dimensions.added){var a=o.getValue(n,r||"").qHyperCubeDef,s=function(e){if(Array.isArray(e))return w(e)}(t=a.qDimensions)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(t)||function(e,t){if(e){if("string"==typeof e)return w(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?w(e,t):void 0}}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}();a.qDimensions=[],s.forEach((function(e){a.qDimensions.push(e),i.dimensions.added(e,n)}))}},_=function(e){var t,n=e.newProperties,i=e.dataDefinition,r=e.hypercubePath;if(i.measures&&"function"==typeof i.measures.added){var a=o.getValue(n,r||"").qHyperCubeDef,s=function(e){if(Array.isArray(e))return k(e)}(t=a.qMeasures)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(t)||function(e,t){if(e){if("string"==typeof e)return k(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?k(e,t):void 0}}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}();a.qMeasures=[],s.forEach((function(e){a.qMeasures.push(e),i.measures.added(e,n)}))}},B=function(e){var t=e.measures,n=e.modifierTypes;t&&n&&d().isSupportedModifiers(n)&&t.forEach((function(e){e.store&&e.store.modifiers&&(e.qDef.modifiers=e.store.modifiers),delete e.store}))};function $(e,t){var n=o.getValue(e,"qLayoutExclude.quarantine",{})[t];return!!n&&(Object.keys(n).forEach((function(t){o.setValue(e,t,n[t])})),delete e.qLayoutExclude.quarantine[t],!0)}const G={exportProperties:function(e){var t=e.propertyTree,n=e.hypercubePath,i=e.viewDataMode,r=function(){for(var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1,t={data:[],properties:{}},n=0;n<e;++n)t.data.push({dimensions:[],measures:[],excludedDimensions:[],excludedMeasures:[],interColumnSortOrder:[]});return t}(),a=t.qProperty,s=o.getValue(a,n||""),l=s.qHyperCubeDef;return l.qInterColumnSortOrder||(l.qInterColumnSortOrder=[]),m({exportFormat:r,qHyperCubeDef:l}),h({exportFormat:r,qHyperCubeDef:l}),g({exportFormat:r,qHyperCubeDef:l}),delete l.qLayoutExclude,y({exportFormat:r,properties:a}),n&&(r.properties.qHyperCubeDef=l,delete s.qHyperCubeDef),v({exportFormat:r,properties:a}),i||b(r.properties.qHyperCubeDef.qMeasures),Array.isArray(r.properties.filters)&&(x(r.properties,"filters","storedFilters"),delete r.properties.filters),r.properties.qHyperCubeDef.qContextSetExpression&&(x(r.properties,"qHyperCubeDef.qContextSetExpression","storedFilters"),r.properties.qHyperCubeDef.qContextSetExpression=""),r.properties.qHyperCubeDef.qDynamicScript&&r.properties.qHyperCubeDef.qDynamicScript.length&&(x(r.properties,"qHyperCubeDef.qDynamicScript","dynamicScript"),r.properties.qHyperCubeDef.qDynamicScript=[]),r},importProperties:function(e){var t=e.exportFormat,n=e.initialProperties,i=void 0===n?{}:n,r=e.dataDefinition,a=void 0===r?{}:r,s=e.defaultPropertyValues,l=void 0===s?{}:s,u=e.hypercubePath,c=e.extension,p=e.supportedFilters,f=void 0===p||p,d=e.isHCModifierSupported,m=void 0===d||d,h={qChildren:[]},g=V({exportFormat:t,initialProperties:i,hypercubePath:u}),y=o.getValue(i,u||"").qHyperCubeDef,v=o.getValue(g,u||"").qHyperCubeDef,b=T({exportFormat:t,dataDefinition:a}),x=b.maxDimensions,q=b.minDimensions,D=b.maxMeasures,S=b.minMeasures,M=l.defaultDimension,A=void 0===M?N():M,I=l.defaultMeasure,w=void 0===I?P():I;v.qDimensions.length=0,v.qMeasures.length=0,H({exportFormat:t,maxDimensions:x,minDimensions:q,maxMeasures:D,minMeasures:S})&&j({exportFormat:t,maxDimensions:x,minDimensions:q,maxMeasures:D,minMeasures:S,newHyperCubeDef:v}),O({exportFormat:t,maxDimensions:x,minDimensions:q,newHyperCubeDef:v,defaultDimension:A}),F({exportFormat:t,maxMeasures:D,minMeasures:S,newHyperCubeDef:v,defaultMeasure:w}),z({newProperties:g,dataDefinition:a,hypercubePath:u}),_({newProperties:g,dataDefinition:a,hypercubePath:u}),R({exportFormat:t,newHyperCubeDef:v}),L("qMaxStackedCells",y,v),L("qNoOfLeftDims",y,v),E("qInitialDataFetch",y,v,[{qTop:0,qLeft:0,qWidth:0,qHeight:0}]),E("qMode",y,v,"S"),E("qReductionMode",y,v,"N"),E("qSortbyYValue",y,v),E("qIndentMode",y,v),E("qShowTotalsAbove",y,v),C(g,t,i),h.qProperty=g;var k=o.getValue(c||{},"support.modifiers");return B({measures:v.qMeasures,modifierTypes:k}),f&&$(h.qProperty,"storedFilters"),"S"===v.qMode&&m&&$(h.qProperty,"dynamicScript"),h}};var U={cellBackgroundColor:!0,cellForegroundColor:!0,colorByAlternative:!0,colorByExpression:!0,tooltip:!0,urlLabel:!0,url:!0};function W(e,t,n,i){t=t||[];var r=c(e,i,n),o=c(t,i,n);if(-1!==r&&-1===o){var a=e.splice(r,1);t.push(a[0])}return t}function X(e,t){return e.length!==t}const K={create:function(e,t){if(!e||!U[e])throw new Error("Attribute Expressions Util: ID required");var n={};return t&&Object.keys(t).forEach((function(e){n[e]=t[e]})),n.id=e,n.qAttribute=!0,n},moveByIdFromGroup:function(e,t,n,i,r){n=n||"qAttributeExpressions",r=r||"id";for(var o=0;o<e.length;o++){var a=e[o][n],s=t.length;if(W(a,t,i,r),X(t,s))return t}return t},IDMAP:{CELL_BACKGROUND_COLOR:"cellBackgroundColor",CELL_FOREGROUND_COLOR:"cellForegroundColor",COLOR_BY_ALTERNATIVE:"colorByAlternative",COLOR_BY_EXPRESSION:"colorByExpression",TOOLTIP:"tooltip",CELL_LINK_LABEL:"urlLabel",CELL_LINK_URL:"url"}},Z={getNumDimensions:function(e){return o.getValue(e,"qHyperCubeDef.qDimensions.length",0)},getNumMeasures:function(e){return o.getValue(e,"qHyperCubeDef.qMeasures.length",0)},wrapFieldName:function(e){return e.split(" ").length>1&&"="!==e[0]&&"["!==e[0]?"[".concat(e,"]"):e},getItemLabel:function(e){return e.label||e.name}},Y={colorModeOptions:{primary:function(){return!0},dimension:function(e){return Z.getNumDimensions(e)>0&&Z.getNumMeasures(e)<=1},multiColor:function(e){return Z.getNumMeasures(e)>1},measure:function(e){return Z.getNumDimensions(e)>0},expression:function(e){return Z.getNumMeasures(e)>=1}}},J={colorModeOptions:{primary:function(){return!0},dimension:function(){return!0},multiColor:function(){return!1},measure:function(){return!0},expression:function(e){return Z.getNumMeasures(e)>=1}}};var Q={scatterplot:J,"sn-scatter-plot":J,piechart:{colorModeOptions:{primary:function(){return!0},dimension:function(){return!0},multiColor:function(){return!1},measure:function(){return!0},expression:function(e){return Z.getNumMeasures(e)>=1}}},linechart:{colorModeOptions:{primary:function(){return!0},dimension:function(e){return Z.getNumDimensions(e)>1},multiColor:function(e){return Z.getNumMeasures(e)>1},measure:function(e){return Z.getNumDimensions(e)<=1},expression:function(e){return Z.getNumMeasures(e)>=1}}},map:{colorModeOptions:{primary:function(){return!0},dimension:function(e){return Z.getNumDimensions(e)>=1},multiColor:function(e){return Z.getNumMeasures(e)>1},measure:function(e){return Z.getNumDimensions(e)>=1},expression:function(e){return Z.getNumDimensions(e)>=1}}},distributionplot:{colorModeOptions:{primary:function(){return!0},dimension:function(){return!0},multiColor:function(){return!1},measure:function(){return!0},expression:function(e){return Z.getNumDimensions(e)>=1}}}};function ee(e,t,n){if(Array.isArray(e[t])){var i=p.findIndexByPropertyValue(e[t],"id",n);i>=0&&e[t].splice(i,1)}else e[t]=[]}function te(e,t){var n=K.IDMAP.COLOR_BY_ALTERNATIVE;e.forEach((function(e){ee(e,"qAttributeDimensions",n),ee(e,"qAttributeExpressions",n)})),t.forEach((function(e){ee(e,"qAttributeDimensions",n),ee(e,"qAttributeExpressions",n)}))}function ne(e,t){if(t){var n="="===t.charAt(0);e.color.altLabel=n?{qStringExpression:{qExpr:t.substr(1)}}:t}}function ie(e){var t=e.properties,n=e.isDimension,i=e.dimensions,r=e.excludedDimensions,a=e.measures,s=e.label;te(i,r);var l=i[i.length-1];if(l){var u=n?o.getValue(t,"color.byDimDef"):o.getValue(t,"color.byMeasureDef"),c=o.getValue(t,"color.formatting.qNumFormat"),f=o.getValue(t,"color.formatting.isCustomFormatted");if(u){var d=K.create(K.IDMAP.COLOR_BY_ALTERNATIVE);switch(u.type){case"expression":!function(e){var t=e.attributeExpression,n=e.label,i=e.item,r=e.isDimension,o=e.qNumFormat,a=e.isCustomFormatted;t.label=n||i.label,r?t.qDef=i.key:(t.qExpression=i.key,o&&(t.qNumFormat=o,t.isCustomFormatted=a)),t.matchMeasure=i.activeMeasureIndex,t.label&&"="===t.label.charAt(0)&&(t.labelExpRef="color.altLabel")}({attributeExpression:d,label:s,item:u,isDimension:n,qNumFormat:c,isCustomFormatted:f});break;case"libraryItem":!function(e){var t=e.attributeExpression,n=e.measures,i=e.item,r=e.qNumFormat,o=e.isCustomFormatted;e.isDimension||(t.matchMeasure=p.findIndexByPropertyValue(n,"qLibraryId",i.key),r&&(t.qNumFormat=r,t.isCustomFormatted=o)),void 0!==i.expression?t.qExpression=i.expression:t.qLibraryId=i.key,t.colorMapRef=i.key}({attributeExpression:d,measures:a,item:u,isDimension:n,qNumFormat:c,isCustomFormatted:f})}n?(d.qSortBy={qSortByAscii:1},l.qAttributeDimensions.push(d)):l.qAttributeExpressions.push(d)}}}function re(e,t,n,i){var r,o,a,s={};switch(e){case"dimension":n.qLibraryId?(s.type="dimension",s.name=n.qLibraryId,s.id=n.qLibraryId):(s.type="field",t?(s.name=n.label||n.qDef,s.id=n.qDef):(s.name=n.qDef.qFieldDefs[0],s.label=(a=n.qDef).qLabelExpression?a.qLabelExpression:a.qFieldLabels&&a.qFieldLabels[0]?a.qFieldLabels[0]:a.qFieldDefs[0]));break;case"measure":r=function(e,t){return t?e.qLibraryId:d().measureBase.getLibraryId(e)}(n,t),r?(s.type="measure",s.name=r,s.id=r,o=function(e,t){return d().hasActiveModifiers({measures:[e]})&&t?e.qDef.qDef:void 0}(n,i),o&&(s.expression=o)):(s.type="expression",t?(s.name=n.label||n.qExpression,s.id=n.qExpression):(s.name=n.qDef.qDef,s.label=function(e){var t=e.qDef;return t.qLabelExpression?t.qLabelExpression:t.qLabel?t.qLabel:t.qDef}(n)));break;default:throw new Error('columnType should be "dimension" or "measure"')}return s}const oe={useMasterNumberFormat:function(e){e.quarantine={qNumFormat:e.qNumFormat||{},isCustomFormatted:e.isCustomFormatted||!1},e.qNumFormat=null,e.isCustomFormatted=void 0}};function ae(e,t,n,i){var r=n?"expression":t.type,o=e.color,a=o.mode,s=Z.getItemLabel(t);switch(ne(e,s||""),r){case"field":a="byDimension",o.byDimDef={label:t.label||Z.wrapFieldName(t.name),key:Z.wrapFieldName(t.name),type:"expression",activeDimensionIndex:t.activeDimensionIndex};break;case"expression":a="byMeasure",o.byMeasureDef={label:n||s,key:n||t.name,type:"expression",activeMeasureIndex:t.activeMeasureIndex};break;case"dimension":a="byDimension",o.byDimDef={label:t.name,key:t.id,type:"libraryItem",activeDimensionIndex:t.activeDimensionIndex};break;case"measure":a="byMeasure",o.byMeasureDef={label:t.name,key:t.id,expression:t.expression,type:"libraryItem",activeMeasureIndex:t.activeMeasureIndex},o.formatting&&oe.useMasterNumberFormat(o.formatting)}i||(o.auto=!1,o.mode=a)}function se(e,t){var n=o.getValue(e,"".concat(t,"qDimensions"),[]),i=o.getValue(e,"".concat(t,"qMeasures"),[]),r=o.getValue(e,"".concat(t,"qLayoutExclude.qHyperCubeDef.qDimensions"),[]),a=o.getValue(e,"color.byDimDef");if(a&&ne(e,a.label),function(e){return!!(e&&e.activeDimensionIndex>-1)}(a))!function(e,t){var n=o.getValue(e,"".concat(t,"qDimensions"),[]),i=o.getValue(e,"color.byDimDef");i.activeDimensionIndex=Math.min(i.activeDimensionIndex,n.length-1);var r=re("dimension",!1,n[i.activeDimensionIndex]);r.activeDimensionIndex=i.activeDimensionIndex,ae(e,r)}(e,t);else if(function(e){return!e||!e.key}(a)&&function(e,t){var n=o.getValue(e,"".concat(t,"qDimensions"),[]),i=n[function(e,t,n){var i=o.getValue(t,"visualization"),r=n.split("."),a=Number(r[1]),s=o.getValue(t,"layers.".concat(a,".type"));return 2===e.length&&"map"===i&&"point"===s}(n,e,t)?0:n.length-1],r=K.IDMAP.COLOR_BY_ALTERNATIVE,a=p.findItemByPropertyValue(i.qAttributeDimensions,"id",r);return ae(e,re("dimension",!!a,a||i)),!!a}(e,t))return;ie({properties:e,isDimension:!0,dimensions:n,excludedDimensions:r,measures:i,label:o.getValue(e,"color.byDimDef.label")})}const le=function(e,t,n){o.setValue(e,t,n),o.isAtomicValue(n)&&function(e,t,n){var i=e.qLayoutExclude;i&&(i.changed||(i.changed={}),i.changed[t]={from:o.getValue(e,t),to:n})}(e,t,n)},ue=function(e,t){var n={primary:!0};if(e){var i=(Q[t]||Y).colorModeOptions||Y.colorModeOptions;n.byDimension=i.dimension(e),n.byMeasure=i.measure(e),n.byMultiple=i.multiColor(e),n.byExpression=i.expression(e)}return n},ce=function(e){var t=e.canColorBy,n=e.autoColor,i=e.colorMode,r=e.dimensions;return!(t[i]&&!n&&("byDimension"!==i&&"byMeasure"!==i||!r.length))},pe=function(e,t){var n,i=o.getValue(e,"color.mode"),r=o.getValue(e,"color.auto"),a=o.getValue(e,"".concat(t,"qDimensions"),[]),s=o.getValue(e,"".concat(t,"qMeasures"),[]),l=o.getValue(e,"".concat(t,"qLayoutExclude.qHyperCubeDef.qDimensions"),[]);r?te(a,l):!(n={auto:r,colorMode:i,dimensions:a}).auto&&"byDimension"===n.colorMode&&n.dimensions.length>0?se(e,t):function(e){var t=e.auto,n=e.colorMode,i=e.dimensions,r=e.measures,a=e.properties,s=o.getValue(a,"visualization");return!(t||"byMeasure"!==n||!i.length||"map"!==s&&!r.length)}({auto:r,colorMode:i,dimensions:a,measures:s,properties:e})?function(e,t){var n=o.getValue(e,"".concat(t,"qDimensions"),[]),i=o.getValue(e,"".concat(t,"qMeasures"),[]),r=o.getValue(e,"".concat(t,"qLayoutExclude.qHyperCubeDef.qDimensions"),[]),a=o.getValue(e,"color.byMeasureDef");if(a&&ne(e,a.label),function(e){return!!(e&&e.activeMeasureIndex>-1)}(a))!function(e,t){var n=o.getValue(e,"".concat(t,"qMeasures"),[]),i=o.getValue(e,"color.byMeasureDef");if(i.activeMeasureIndex=Math.min(i.activeMeasureIndex,n.length-1),i.activeMeasureIndex>-1){var r=re("measure",!1,n[i.activeMeasureIndex],!0);r.activeMeasureIndex=i.activeMeasureIndex,ae(e,r)}}(e,t);else if(function(e,t){return(!e||!e.key)&&t.length>0}(a,i)&&function(e,t){var n=o.getValue(e,"".concat(t,"qDimensions"),[]),i=o.getValue(e,"".concat(t,"qMeasures"),[]),r=n[n.length-1],a=K.IDMAP.COLOR_BY_ALTERNATIVE,s=p.findItemByPropertyValue(r.qAttributeExpressions,"id",a);return ae(e,re("measure",!!s,s||i[0])),!!s}(e,t))return;ie({properties:e,isDimension:!1,dimensions:n,excludedDimensions:r,measures:i,label:o.getValue(e,"color.byMeasureDef.label")})}(e,t):function(e,t){var n=o.getValue(e,"color.mode"),i=o.getValue(e,"".concat(t,"qDimensions"),[]),r=o.getValue(e,"".concat(t,"qMeasures"),[]),a=o.getValue(e,"".concat(t,"qLayoutExclude.qHyperCubeDef.qDimensions"),[]);"byMultiple"===n&&r.length<2&&o.setValue(e,"color.mode","primary"),te(i,a)}(e,t)},fe=function(e){e.forEach((function(e){e.qOtherTotalSpec&&"qTotalMode"in e.qOtherTotalSpec&&delete e.qOtherTotalSpec.qTotalMode}))},de=function(e){var t=e.shouldUpdateColorBy,n=e.properties,i=o.getValue(n,"qHyperCubeDef.qMeasures",[]),r=o.getValue(n,"color.mode","");return!t&&"byExpression"===r&&i.length>0},me=function(e){var t=o.getValue(e,"qHyperCubeDef.qMeasures.0.qAttributeExpressions",[]),n=o.getValue(e,"color.colorExpression","");t.splice(0,0,{qExpression:n,id:"colorByExpression"}),o.setValue(e,"qHyperCubeDef.qMeasures.0.qAttributeExpressions",t)},he=function(e){o.setValue(e,"color.mode","primary"),o.setValue(e,"color.auto",!0)},ge=function(e){var t=o.getValue(e,"qHyperCubeDef.qDimensions",[]),n=o.getValue(e,"color.persistent",!1);return t.length>1&&!n},ye={exportProperties:function(e){var t=e.propertyTree,n=e.hypercubePath,i=e.viewDataMode,r=G.exportProperties({propertyTree:t,hypercubePath:n,viewDataMode:i}),o=r.data[0],a=o.dimensions.concat(o.excludedDimensions),s=o.measures.concat(o.excludedMeasures),l=K.IDMAP,u=l.COLOR_BY_ALTERNATIVE,c=l.COLOR_BY_EXPRESSION;return K.moveByIdFromGroup(a,[],"qAttributeDimensions",u),K.moveByIdFromGroup(a,[],"qAttributeExpressions",u),K.moveByIdFromGroup(s,[],"qAttributeExpressions",c),r},importProperties:function(e){var t=e.exportFormat,n=e.initialProperties,i=e.dataDefinition,r=e.defaultPropertyValues,a=e.hypercubePath,s=e.extension,l=e.supportedFilters,u=e.isHCModifierSupported,c=G.importProperties({exportFormat:t,initialProperties:n,dataDefinition:i,defaultPropertyValues:r,hypercubePath:a,extension:s,supportedFilters:l,isHCModifierSupported:u}),p=c.qProperty,f=o.getValue(p,"visualization"),d=o.getValue(p,"qHyperCubeDef.qDimensions",[]),m=o.getValue(p,"color.mode",""),h=o.getValue(p,"color.auto",""),g=ue(p,f),y=ce({canColorBy:g,autoColor:h,colorMode:m,dimensions:d});return g[m]?de({shouldUpdateColorBy:y,properties:p})&&me(p):he(p),y&&pe(p,"qHyperCubeDef."),ge(p)&&le(p,"color.persistent",!0),fe(d),c}};var ve=["bar","marker","line"];const be=function(e){var t=e.initialProperties,n=e.properties;t.measureAxis&&void 0===t.measureAxis.autoMinMax?$(n,"unsupportedAutoMinMax")||D()(n.measureAxis,t.measureAxis):$(n,"supportedAutoMinMax")||D()(n.measureAxis,t.measureAxis)},xe=function(e){var t,n=e.exportFormat,i=e.initialProperties,r=e.properties,o=e.measureType,a=r.qHyperCubeDef,s=r.measureAxis;if(function(e){var t=e.initialProperties;return!(!e.exportFormat.properties.measureAxes||t.measureAxes||!t.measureAxis||void 0===t.measureAxis.autoMinMax)}({exportFormat:n,initialProperties:i})){var l=function(e){var t=[];return e.qMeasures.length>0&&e.qMeasures.forEach((function(e){if(e.qDef.series){var n=e.qDef.series,i=n.type,r=n.axis;t[r]||(t[r]={axis:r,type:{line:0,marker:0,bar:0,total:0}}),ve.includes(i)&&t[r].type[i]++,t[r].type.total++}})),t}(a);l.length?(o&&(t=l.filter((function(e){return e.type[o]>0})).sort((function(e,t){return t.type[o]-e.type[o]}))),t&&t.length||(t=l.sort((function(e,t){return t.type.total-e.type.total}))),t&&t[0]&&D()(s,n.properties.measureAxes[t[0].axis])):D()(s,n.properties.measureAxes[0])}},qe=function(e){if(e.qDimensions.length>1){var t=e.qInterColumnSortOrder.indexOf(0);if(0!==t){var n=e.qInterColumnSortOrder[0];e.qInterColumnSortOrder[0]=0,e.qInterColumnSortOrder[t]=n}}},De={exportProperties:function(e){var t=e.propertyTree,n=e.hypercubePath,i=e.viewDataMode,r=e.supportedAutoMinMax,o=void 0===r||r,a=ye.exportProperties({propertyTree:t,hypercubePath:n,viewDataMode:i}),s=a.properties;return o?(x(s,"measureAxis.min","supportedAutoMinMax"),x(s,"measureAxis.max","supportedAutoMinMax")):(x(s,"measureAxis.min","unsupportedAutoMinMax"),x(s,"measureAxis.max","unsupportedAutoMinMax")),a},importProperties:function(e){var t=e.exportFormat,n=e.initialProperties,i=e.dataDefinition,r=e.defaultPropertyValues,o=e.hypercubePath,a=e.measureType,s=e.extension,l=e.supportedFilters,u=e.isHCModifierSupported,c=ye.importProperties({exportFormat:t,initialProperties:n,dataDefinition:i,defaultPropertyValues:r,hypercubePath:o,extension:s,supportedFilters:l,isHCModifierSupported:u}),p=c.qProperty;return be({initialProperties:n,properties:p}),xe({exportFormat:t,initialProperties:n,properties:p,measureType:a}),qe(p.qHyperCubeDef),p.qHyperCubeDef.qColumnOrder=[],p.qHyperCubeDef.columnOrder=[],c}};function Se(e,t,n){return"qLayoutExclude.quarantine.".concat(e,".").concat(t,".").concat(n)}function Me(e){var t=e.properties,n=e.arrayPath,i=e.quarantineName,r=e.arrayName,a=e.itemPath;o.getValue(t,n,[]).forEach((function(e){return function(e){var t=e.properties,n=e.quarantineName,i=e.arrayName,r=e.item,a=e.itemPath,s=o.getValue(r,a);if(void 0!==s){var l=o.getValue(r,"qDef.cId");l||(l=o.generateId(),o.setValue(r,"qDef.cId",l));var u=Se(n,i,l);o.setValue(t,u,s),o.setValue(r,a,void 0)}}({properties:t,quarantineName:i,arrayName:r,item:e,itemPath:a})}))}function Ae(e){var t=e.properties,n=e.arrayPath,i=e.quarantineName,r=e.arrayName,a=e.itemPath;o.getValue(t,n,[]).forEach((function(e){return function(e){var t=e.properties,n=e.quarantineName,i=e.arrayName,r=e.item,a=e.itemPath,s=o.getValue(r,"qDef.cId");if(s){var l=Se(n,i,s),u=o.getValue(t,l);void 0!==u&&(o.setValue(r,a,u),o.setValue(t,l,void 0))}}({properties:t,quarantineName:i,arrayName:r,item:e,itemPath:a})}))}var Ie="qHyperCubeDef.qMeasures",we="conditionalColoring",ke="measures",Ce="qDef.conditionalColoring";const Le={quarantine:function(e){Me({properties:e,arrayPath:Ie,quarantineName:we,arrayName:ke,itemPath:Ce})},unquarantine:function(e){Ae({properties:e,arrayPath:Ie,itemPath:Ce,arrayName:ke,quarantineName:we})}};var Ee="qHyperCubeDef.qMeasures",Ne="measures",Pe="qHyperCubeDef.qDimensions",Oe="dimensions",Fe="qHyperCubeDef.qLayoutExclude.qHyperCubeDef.qMeasures",Te="alternativeMeasures",Re="qHyperCubeDef.qLayoutExclude.qHyperCubeDef.qDimensions",Ve="alternativeDimensions",He="qCalcCondition",je="conditionalShowHide";const ze={quarantine:function(e){Me({properties:e,arrayPath:Ee,quarantineName:je,arrayName:Ne,itemPath:He}),Me({properties:e,arrayPath:Pe,quarantineName:je,arrayName:Oe,itemPath:He})},unquarantine:function(e){Ae({properties:e,arrayPath:Ee,quarantineName:je,arrayName:Ne,itemPath:He}),Ae({properties:e,arrayPath:Pe,quarantineName:je,arrayName:Oe,itemPath:He})},quarantineAlternative:function(e){Me({properties:e,arrayPath:Fe,quarantineName:je,arrayName:Te,itemPath:He}),Me({properties:e,arrayPath:Re,quarantineName:je,arrayName:Ve,itemPath:He})},unquarantineAlternative:function(e){Ae({properties:e,arrayPath:Fe,quarantineName:je,arrayName:Te,itemPath:He}),Ae({properties:e,arrayPath:Re,quarantineName:je,arrayName:Ve,itemPath:He})}},_e={hypercube:G,colorChart:ye,axisChart:De,quarantineProperty:x,unquarantineProperty:$,quarantineArrayProp:Me,unquarantineArrayProp:Ae,conditionalColoring:Le,conditionalShow:ze}})(),i.default})()),Yt.exports),Qt=Kt(Jt);function en(e){return{dimensions:{min:0,max:0},measures:{min:1,max:1,description:()=>e.translator.get("Visualizations.Descriptions.Gauge.Measure")}}}const tn=(e,t,n)=>{const i=function(e){var t=e.theme,n=e.translator,i=e.config,r=void 0===i?{}:i,o=e.flags,a=function(e){var t=e.config,n=void 0===t?{}:t,i=n.id,r=n.paths;return{id:void 0===i?"object":"".concat("object",".").concat(i),paths:Array.isArray(r)?r:[]}}({config:r}),s=a.id,l=a.paths,u={};l.forEach((function(e){for(var i=e.split("."),r=u,a=0;a<i.length;a++){var l=i[a];a===i.length-1?r[l]=O({theme:t,translator:n,id:s,path:e,flags:o}):void 0===r[l]&&(r[l]={}),r=r[l]}}));var c=function(e){for(var t=e.split("."),n=u,i=0;i<t.length;i++){var r=t[i];if(void 0===n[r])throw new Error("font-resolver: Path '".concat(e,"' could not be resolved."));n=n[r]}return n};return u.getDefaultValue=function(e){return c(e).getDefaultValue()},u.getOptions=function(e){return c(e).getOptions()},u}({theme:n,translator:t,flags:e,config:{id:"gauge",paths:["axis.title","axis.label.name","label.value"]}});return{component:"styling-panel",chartTitle:"Object.Gauge",translation:"LayerStyleEditor.component.styling",useBackground:!0,subtitle:"LayerStyleEditor.component.styling",ref:"components",useGeneral:!0,items:{axisTitleSection:{translation:"properties.axis.title",component:"panel-section",items:{labelSection:{component:"items",ref:"components",key:"axis",items:{fontWrapper:{component:"inline-wrapper",items:{fontFamily:{ref:"axis.title.fontFamily",component:"dropdown",options:()=>i.getOptions("axis.title.fontFamily"),defaultValue:()=>i.getDefaultValue("axis.title.fontFamily")},fontColor:{ref:"axis.title.color",component:"color-picker",defaultValue:()=>({color:n.getStyle("object.gauge","axis.title","color")}),width:!1}}}}}}},axisLabelSection:{translation:"properties.axis.label",component:"panel-section",items:{labelSection:{component:"items",ref:"components",key:"axis",items:{fontWrapper:{component:"inline-wrapper",items:{fontFamily:{ref:"axis.label.name.fontFamily",component:"dropdown",options:()=>i.getOptions("axis.label.name.fontFamily"),defaultValue:()=>i.getDefaultValue("axis.label.name.fontFamily"),width:!0},fontColor:{ref:"axis.label.name.color",component:"color-picker",defaultValue:()=>({color:n.getStyle("object.gauge","axis.label.name","color")}),width:!1}}}}}}},valueLabelSection:{translation:"properties.value.label",component:"panel-section",items:{labelSection:{component:"items",ref:"components",key:"value",items:{fontWrapper:{component:"inline-wrapper",items:{fontFamily:{ref:"label.value.fontFamily",component:"dropdown",options:()=>i.getOptions("label.value.fontFamily"),defaultValue:()=>i.getDefaultValue("label.value.fontFamily"),width:!0},fontColor:{ref:"label.value.color",component:"color-picker",defaultValue:()=>({color:n.getStyle("object.gauge","label.value","color")}),width:!1}}}}}}}}}};let nn;function rn(e){return"measure"===Mt(e,"color.useBaseColors")}function on(e){const{flags:t,translator:n,sense:i}=e,r=null==i?void 0:i.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,n,i)=>"labels"===i.measureAxis.show||"none"===i.measureAxis.show,set(e,t,n,i,r){r.measureAxis.show=e?"labels":"all"}}}}}}},presentation:{type:"items",grouped:!0,translation:"properties.presentation",items:{styleEditor:tn(t,n,r),rangeLimits:{type:"items",items:{text:{component:"text",translation:"properties.axis.rangeLimits",style:"sHeader"},min:{ref:"measureAxis.min",translation:"properties.axis.min",type:"number",expression:"optional",invalid:e=>e.measureAxis&&e.measureAxis.min>=e.measureAxis.max},max:{ref:"measureAxis.max",translation:"Common.Max",type:"number",expression:"optional",defaultValue:100,invalid:e=>e.measureAxis&&e.measureAxis.min>=e.measureAxis.max}}},type:{ref:"gaugetype",type:"string",component:"item-selection-list",defaultValue:"radial",horizontal:!0,items:[{icon:"gauge_gauge",component:"icon-item",labelPlacement:"bottom",translation:"properties.gauge.radial",value:"radial"},{icon:"gauge_vertical_bar",component:"icon-item",labelPlacement:"bottom",translation:"properties.gauge.bar",value:"bar"}],change(e){"radial"===e.gaugetype?(nn=e.orientation,e.orientation="horizontal"):e.orientation=nn}},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=(n=e.segmentInfo).paletteColors&&n.paletteColors.length?n.paletteColors:n.colors&&n.colors.length?n.colors:void 0;var n;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(),n=null===(e=r.getDataColorPickerPalettes()[0])||void 0===e?void 0:e.colors,i=n.indexOf(t);return{index:-1===i?Math.min(6,n.length-1):i}},show:e=>!rn(e)&&!e.useSegments},maxSegments:{ref:"maxSegments",type:"number",defaultValue:6,show:!1},segmentInfo:{ref:"segments",type:"items",component:"color-scale-creator",show:e=>!rn(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},importProperties:(t,n,i,r)=>Qt.axisChart.importProperties({exportFormat:t,initialProperties:n,hypercubePath:r,extension:i,dataDefinition:en(e)}),exportProperties:(e,t,n)=>Qt.axisChart.exportProperties({propertyTree:e,hyperCubePath:t,viewDataMode:n,supportedAutoMinMax:!1})}}const an={require:["chart","renderer"],renderer:"dom",render(e){var t;return function({chart:e,settings:t,h:n}){if(!e)return[];const i=function({h:e,settings:t}){if(!t)return[];const{isRtl:n,title:i,text:r}=t,o={disclaimer:{borderRadius:"10px",border:"1px solid #404040",position:"absolute",top:"10%",left:"50%",margin:"0 0 0 -150px",width:"298px",cursor:"default",background:"white",direction:n?"rtl":"ltr"},closeIcon:{position:"absolute",[n?"left":"right"]:"5px",top:"3px",cursor:"pointer",color:"#595959",pointerEvents:"auto"},dmHeader:{color:"#575859",fontSize:"18px",paddingLeft:"20px",paddingTop:"10px",paddingRight:"20px",paddingBottom:"0px",maxHeight:"44px",overflow:"hidden"},dmMain:{display:"block",color:"#575859",paddingLeft:"20px",paddingRight:"20px",paddingTop:"10px",paddingBottom:"10px"},dmP:{paddingBottom:"10px"},hidden:{display:"none"}};return[e("div",{style:o.disclaimer},e("div",{style:o.closeIcon,onClick:()=>null==t?void 0:t.close()},e("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 16 16"},e("defs",{},e("path",{id:"remove-a",d:"M9.41421356,8 L11.8890873,5.52512627 C12.065864,5.34834957 12.0305087,4.95944084 11.8183766,4.74730881 L11.2526912,4.18162338 C11.0405592,3.96949135 10.6516504,3.93413601 10.4748737,4.1109127 L8,6.58578644 L5.52512627,4.1109127 C5.34834957,3.93413601 4.95944084,3.96949135 4.74730881,4.18162338 L4.25233406,4.67659813 C3.96949135,4.95944084 3.93413601,5.34834957 4.1109127,5.52512627 L6.58578644,8 L4.1109127,10.4748737 C3.93413601,10.6516504 3.96949135,11.0405592 4.18162338,11.2526912 L4.67659813,11.7476659 C4.95944084,12.0305087 5.34834957,12.065864 5.52512627,11.8890873 L8,9.41421356 L10.4748737,11.8890873 C10.6516504,12.065864 11.0405592,12.0305087 11.2526912,11.8183766 L11.8183766,11.2526912 C12.0305087,11.0405592 12.065864,10.6516504 11.8890873,10.4748737 L9.41421356,8 Z M8,0 C12.4,0 16,3.6 16,8 C16,12.4 12.4,16 8,16 C3.6,16 0,12.4 0,8 C0,3.6 3.6,0 8,0 Z"})),e("use",{xlinkHref:"#remove-a"}))),e("header",{style:o.dmHeader},`${i}`),e("main",{style:o.dmMain},e("p",{style:o.dmP},`${r}`)))]}({settings:t,h:n});return i}({chart:this.chart,settings:null===(t=this.settings)||void 0===t?void 0:t.settings,h:e})}},sn=52,ln=-2*Math.PI/3,un=2*Math.PI/3,cn="#EEEEEE",pn=2.38,fn={MIN:12,MAX:60},dn={MIN:100,MAX:1e3},mn={TOP:-4,BOTTOM:0,LEFT:4,RIGHT:4},hn={VERTICAL_ALIGNMENT_FACTOR:.4},gn={VERTICAL_ALIGNMENT_FACTOR:1.25},yn=2,vn=1.2,bn="#595959",xn="#E6E6E6",qn=.4,Dn=1,Sn=2,Mn=.75,An=.75,In={MAX_WIDTH:150,MAX_LINES:2,CLEARANCE:12,ESTIMATED_LINE_HEIGHT:16,GAP:8},wn=70,kn=3,Cn={MEASURE:"measure"},Ln={BAR:"bar",SEGMENT_BAR:"segment-bar",LABEL_BAR:"label-bar",BACKGROUND_BAR:"background-bar",MARK:"mark",OOB_INDICATOR:"oob-indicator",BAR_AXIS:"bar-axis",AXIS_TITLE:"axis-title",GAUGE_LABEL:"gauge-label",RADIAL_AXIS:"radial-axis",RADIAL_GAUGE_NEEDLE:"radial-gauge-needle",RADIAL_OOB_INDICATOR_MIN:"radial-oob-indicator-min",RADIAL_OOB_INDICATOR_MAX:"radial-oob-indicator-max",RADIAL_GAUGE:"radial-gauge",CIRCLE_GAUGE:"circle-gauge",REFERENCE_LINES_AND_LABELS:"reference-lines-and-labels",RADIAL_SPARK:"radial-spark",RADIAL_GAUGE_LABEL:"radial-gauge-label",RADIAL_REFERENCE_LINES:"radial-reference-lines",SEGMENT_RADIAL_GAUGE:"segment-radial-gauge",LABEL_RADIAL_GAUGE:"label-radial-gauge"},En=1e-4,Nn="XSMALL",Pn="SMALL",On="XSMALL_VERTICAL",Fn="XSMALL_HORIZONTAL",Tn="SMALL",Rn="MEDIUM",Vn={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}},Hn=600,jn=200,zn=500;function _n(e,t,n){e.prototype=t.prototype=n,n.constructor=e}function Bn(e,t){var n=Object.create(e.prototype);for(var i in t)n[i]=t[i];return n}function $n(){}var Gn=.7,Un=1/Gn,Wn="\\s*([+-]?\\d+)\\s*",Xn="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",Kn="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",Zn=/^#([0-9a-f]{3,8})$/,Yn=new RegExp(`^rgb\\(${Wn},${Wn},${Wn}\\)$`),Jn=new RegExp(`^rgb\\(${Kn},${Kn},${Kn}\\)$`),Qn=new RegExp(`^rgba\\(${Wn},${Wn},${Wn},${Xn}\\)$`),ei=new RegExp(`^rgba\\(${Kn},${Kn},${Kn},${Xn}\\)$`),ti=new RegExp(`^hsl\\(${Xn},${Kn},${Kn}\\)$`),ni=new RegExp(`^hsla\\(${Xn},${Kn},${Kn},${Xn}\\)$`),ii={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 ri(){return this.rgb().formatHex()}function oi(){return this.rgb().formatRgb()}function ai(e){var t,n;return e=(e+"").trim().toLowerCase(),(t=Zn.exec(e))?(n=t[1].length,t=parseInt(t[1],16),6===n?si(t):3===n?new pi(t>>8&15|t>>4&240,t>>4&15|240&t,(15&t)<<4|15&t,1):8===n?li(t>>24&255,t>>16&255,t>>8&255,(255&t)/255):4===n?li(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=Yn.exec(e))?new pi(t[1],t[2],t[3],1):(t=Jn.exec(e))?new pi(255*t[1]/100,255*t[2]/100,255*t[3]/100,1):(t=Qn.exec(e))?li(t[1],t[2],t[3],t[4]):(t=ei.exec(e))?li(255*t[1]/100,255*t[2]/100,255*t[3]/100,t[4]):(t=ti.exec(e))?yi(t[1],t[2]/100,t[3]/100,1):(t=ni.exec(e))?yi(t[1],t[2]/100,t[3]/100,t[4]):ii.hasOwnProperty(e)?si(ii[e]):"transparent"===e?new pi(NaN,NaN,NaN,0):null}function si(e){return new pi(e>>16&255,e>>8&255,255&e,1)}function li(e,t,n,i){return i<=0&&(e=t=n=NaN),new pi(e,t,n,i)}function ui(e){return e instanceof $n||(e=ai(e)),e?new pi((e=e.rgb()).r,e.g,e.b,e.opacity):new pi}function ci(e,t,n,i){return 1===arguments.length?ui(e):new pi(e,t,n,null==i?1:i)}function pi(e,t,n,i){this.r=+e,this.g=+t,this.b=+n,this.opacity=+i}function fi(){return`#${gi(this.r)}${gi(this.g)}${gi(this.b)}`}function di(){const e=mi(this.opacity);return`${1===e?"rgb(":"rgba("}${hi(this.r)}, ${hi(this.g)}, ${hi(this.b)}${1===e?")":`, ${e})`}`}function mi(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function hi(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function gi(e){return((e=hi(e))<16?"0":"")+e.toString(16)}function yi(e,t,n,i){return i<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new bi(e,t,n,i)}function vi(e){if(e instanceof bi)return new bi(e.h,e.s,e.l,e.opacity);if(e instanceof $n||(e=ai(e)),!e)return new bi;if(e instanceof bi)return e;var t=(e=e.rgb()).r/255,n=e.g/255,i=e.b/255,r=Math.min(t,n,i),o=Math.max(t,n,i),a=NaN,s=o-r,l=(o+r)/2;return s?(a=t===o?(n-i)/s+6*(n<i):n===o?(i-t)/s+2:(t-n)/s+4,s/=l<.5?o+r:2-o-r,a*=60):s=l>0&&l<1?0:a,new bi(a,s,l,e.opacity)}function bi(e,t,n,i){this.h=+e,this.s=+t,this.l=+n,this.opacity=+i}function xi(e){return(e=(e||0)%360)<0?e+360:e}function qi(e){return Math.max(0,Math.min(1,e||0))}function Di(e,t,n){return 255*(e<60?t+(n-t)*e/60:e<180?n:e<240?t+(n-t)*(240-e)/60:t)}_n($n,ai,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:ri,formatHex:ri,formatHex8:function(){return this.rgb().formatHex8()},formatHsl:function(){return vi(this).formatHsl()},formatRgb:oi,toString:oi}),_n(pi,ci,Bn($n,{brighter(e){return e=null==e?Un:Math.pow(Un,e),new pi(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=null==e?Gn:Math.pow(Gn,e),new pi(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new pi(hi(this.r),hi(this.g),hi(this.b),mi(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:fi,formatHex:fi,formatHex8:function(){return`#${gi(this.r)}${gi(this.g)}${gi(this.b)}${gi(255*(isNaN(this.opacity)?1:this.opacity))}`},formatRgb:di,toString:di})),_n(bi,(function(e,t,n,i){return 1===arguments.length?vi(e):new bi(e,t,n,null==i?1:i)}),Bn($n,{brighter(e){return e=null==e?Un:Math.pow(Un,e),new bi(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=null==e?Gn:Math.pow(Gn,e),new bi(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=this.h%360+360*(this.h<0),t=isNaN(e)||isNaN(this.s)?0:this.s,n=this.l,i=n+(n<.5?n:1-n)*t,r=2*n-i;return new pi(Di(e>=240?e-240:e+120,r,i),Di(e,r,i),Di(e<120?e+240:e-120,r,i),this.opacity)},clamp(){return new bi(xi(this.h),qi(this.s),qi(this.l),mi(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=mi(this.opacity);return`${1===e?"hsl(":"hsla("}${xi(this.h)}, ${100*qi(this.s)}%, ${100*qi(this.l)}%${1===e?")":`, ${e})`}`}}));const Si=Math.PI/180,Mi=180/Math.PI,Ai=.96422,Ii=.82521,wi=4/29,ki=6/29,Ci=3*ki*ki,Li=ki*ki*ki;function Ei(e){if(e instanceof Ni)return new Ni(e.l,e.a,e.b,e.opacity);if(e instanceof Vi)return Hi(e);e instanceof pi||(e=ui(e));var t,n,i=Ti(e.r),r=Ti(e.g),o=Ti(e.b),a=Pi((.2225045*i+.7168786*r+.0606169*o)/1);return i===r&&r===o?t=n=a:(t=Pi((.4360747*i+.3850649*r+.1430804*o)/Ai),n=Pi((.0139322*i+.0971045*r+.7141733*o)/Ii)),new Ni(116*a-16,500*(t-a),200*(a-n),e.opacity)}function Ni(e,t,n,i){this.l=+e,this.a=+t,this.b=+n,this.opacity=+i}function Pi(e){return e>Li?Math.pow(e,1/3):e/Ci+wi}function Oi(e){return e>ki?e*e*e:Ci*(e-wi)}function Fi(e){return 255*(e<=.0031308?12.92*e:1.055*Math.pow(e,1/2.4)-.055)}function Ti(e){return(e/=255)<=.04045?e/12.92:Math.pow((e+.055)/1.055,2.4)}function Ri(e,t,n,i){return 1===arguments.length?function(e){if(e instanceof Vi)return new Vi(e.h,e.c,e.l,e.opacity);if(e instanceof Ni||(e=Ei(e)),0===e.a&&0===e.b)return new Vi(NaN,0<e.l&&e.l<100?0:NaN,e.l,e.opacity);var t=Math.atan2(e.b,e.a)*Mi;return new Vi(t<0?t+360:t,Math.sqrt(e.a*e.a+e.b*e.b),e.l,e.opacity)}(e):new Vi(e,t,n,null==i?1:i)}function Vi(e,t,n,i){this.h=+e,this.c=+t,this.l=+n,this.opacity=+i}function Hi(e){if(isNaN(e.h))return new Ni(e.l,0,0,e.opacity);var t=e.h*Si;return new Ni(e.l,Math.cos(t)*e.c,Math.sin(t)*e.c,e.opacity)}function ji(e){return function(e){return Ri(e).l<70}(e)?xn:bn}function zi(e,t=!0){let n="";for(let t=0;t<e.length;t++){const i=e[t];n+=0===t?`M${i.x} ${i.y}`:`L${i.x} ${i.y}`,n+=" "}return t&&(n+="Z"),n}function _i(e){const{angle:t,origin:n}=e,i=e.points.map((e=>function(e,t,n={x:0,y:0}){const i=Math.cos(t),r=Math.sin(t),o=(s=n,{x:(a=e).x-s.x,y:a.y-s.y});var a,s;return function(e,t){return{x:e.x+t.x,y:e.y+t.y}}({x:i*o.x-r*o.y,y:r*o.x+i*o.y},n)}(e,t,n)));return{type:"path",fill:e.fill,d:zi(i)}}_n(Ni,(function(e,t,n,i){return 1===arguments.length?Ei(e):new Ni(e,t,n,null==i?1:i)}),Bn($n,{brighter(e){return new Ni(this.l+18*(null==e?1:e),this.a,this.b,this.opacity)},darker(e){return new Ni(this.l-18*(null==e?1:e),this.a,this.b,this.opacity)},rgb(){var e=(this.l+16)/116,t=isNaN(this.a)?e:e+this.a/500,n=isNaN(this.b)?e:e-this.b/200;return new pi(Fi(3.1338561*(t=Ai*Oi(t))-1.6168667*(e=1*Oi(e))-.4906146*(n=Ii*Oi(n))),Fi(-.9787684*t+1.9161415*e+.033454*n),Fi(.0719453*t-.2289914*e+1.4052427*n),this.opacity)}})),_n(Vi,Ri,Bn($n,{brighter(e){return new Vi(this.h,this.c,this.l+18*(null==e?1:e),this.opacity)},darker(e){return new Vi(this.h,this.c,this.l-18*(null==e?1:e),this.opacity)},rgb(){return Hi(this).rgb()}}));const Bi={require:["chart"],defaultSettings:{settings:{},style:{}},render(){var e;return function({chart:e,settings:t}){if(!e||!t)return[];const{size:n,component:i,selector:r,pointingTo:o,isRtl:a}=t;if(!e.component(t.component))return[];const s=e.findShapes(r).filter((e=>e.key===i));if(null==s||!s.length)return[];const{clientWidth:l,clientHeight:u}=e.element;let c=l/2,p=u/2,f=-Math.PI/2;const d=n/3;switch(o){case"top":p=d;break;case"bottom":p=u-d,f=3*Math.PI/2-Math.PI;break;case"right":c=l-d,f=0;break;case"left":c=d,f=Math.PI}const m=[];for(let e=0;e<s.length;e+=1){const t=s[e];let r=["top",...a?["left"]:["right"]].includes(o)?t.attrs.fill:cn;if(i===Ln.SEGMENT_BAR){const{stops:e}=t.attrs.fill;if(["top","right"].includes(o)){const t=e.find((e=>1===e.offset));r=(null==t?void 0:t.color)||bn}else{const t=e.toReversed().find((e=>0===e.offset));r=(null==t?void 0:t.color)||bn}}const l=ji(r),u={x:c,y:p},d=n/6,h=_i({points:[{x:u.x+2*d,y:u.y},{x:u.x,y:u.y+d},{x:u.x,y:u.y-d}],angle:f,fill:l,origin:u});m.push(h)}return m}({chart:this.chart,settings:null===(e=this.settings)||void 0===e?void 0:e.settings})}};function $i(e,t,n,i){const r=Math.floor(Math.min(e,t)),o=Math.abs(i-n),a=.02*Math.tan(-o/4+Math.PI/2),s=2*(.4+a)-Xi(e,t)/r;return{innerRadius:s-2*(r>500?50:Math.max(r/zn*50,10))/r,outerRadius:s,radiusIncrease:a,labelGaugeRadius:1.39*(.4+a)}}function Gi(e,t,n,i){const r=i-Math.PI/2;return{x:e+n*Math.cos(r),y:t+n*Math.sin(r)}}function Ui({innerRadius:e,outerRadius:t,width:n,height:i}){return(t-e)*Math.min(n,i)/2}function Wi(e){return!1!==e.show&&0!==e.show&&"0"!==e.show}function Xi(e,t){return Math.min(6,Math.min(e,t)/jn)}const Ki={require:["chart","symbol"],defaultSettings:{settings:{},style:{}},render(){var e;return function({chart:e,settings:t,symbol:n}){if(!e||!t||!n)return[];const{valueAngle:i}=t;if(!e.component(t.component))return[];const{clientWidth:r,clientHeight:o}=e.element,{outerRadius:a,innerRadius:s}=$i(r,o,ln,un),l=Ui({innerRadius:s,outerRadius:a,width:r,height:o});let u=r/2,c=o/2,p=a*Math.min(r,o)/2,f=Gi(u,c,p,t.valueAngle),d=f.x,m=f.y;const h=[],g=cn,y=t.fill||ji(g),v={x:d,y:m},b=l/6;let x=[{x:v.x+.3*b,y:v.y},{x:v.x-7.5*b,y:v.y+b},{x:v.x-7.5*b,y:v.y-b}];const q=i-Math.PI/2,D=_i({points:x,angle:q,fill:y,origin:v});return D.data={pointerWidth:b,angle:q,radius:p,fill:y},h.push(D),h}({chart:this.chart,settings:null===(e=this.settings)||void 0===e?void 0:e.settings,symbol:this.symbol})}};const Zi={require:["chart","symbol"],defaultSettings:{settings:{},style:{}},render(){var e;return function({chart:e,settings:t,symbol:n}){if(!e||!t||!n)return[];const{size:i,component:r,selector:o,angle:a,radius:s}=t;if(!e.component(t.component))return[];const l=e.findShapes(o).filter((e=>e.key===r));if(null==l||!l.length)return[];const{clientWidth:u,clientHeight:c}=e.element;let p=u/2,f=c/2,{x:d,y:m}=Gi(p,f,s,a);const h=[],g=t.fill,y=a===ln?-1:1,v={x:d,y:m},b=i/6,x=_i({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:a,fill:g,origin:v});return h.push(x),h}({chart:this.chart,settings:null===(e=this.settings)||void 0===e?void 0:e.settings,symbol:this.symbol})}};var Yi,Ji;var Qi=function(){if(Ji)return Yi;Ji=1;var e=Object.prototype.hasOwnProperty,t=Object.prototype.toString,n=Object.defineProperty,i=Object.getOwnPropertyDescriptor,r=function(e){return"function"==typeof Array.isArray?Array.isArray(e):"[object Array]"===t.call(e)},o=function(n){if(!n||"[object Object]"!==t.call(n))return!1;var i,r=e.call(n,"constructor"),o=n.constructor&&n.constructor.prototype&&e.call(n.constructor.prototype,"isPrototypeOf");if(n.constructor&&!r&&!o)return!1;for(i in n);return void 0===i||e.call(n,i)},a=function(e,t){n&&"__proto__"===t.name?n(e,t.name,{enumerable:!0,configurable:!0,value:t.newValue,writable:!0}):e[t.name]=t.newValue},s=function(t,n){if("__proto__"===n){if(!e.call(t,n))return;if(i)return i(t,n).value}return t[n]};return Yi=function e(){var t,n,i,l,u,c,p=arguments[0],f=1,d=arguments.length,m=!1;for("boolean"==typeof p&&(m=p,p=arguments[1]||{},f=2),(null==p||"object"!=typeof p&&"function"!=typeof p)&&(p={});f<d;++f)if(null!=(t=arguments[f]))for(n in t)i=s(p,n),p!==(l=s(t,n))&&(m&&l&&(o(l)||(u=r(l)))?(u?(u=!1,c=i&&r(i)?i:[]):c=i&&o(i)?i:{},a(p,{name:n,newValue:e(m,c,l)})):void 0!==l&&a(p,{name:n,newValue:l}));return p},Yi}(),er=Kt(Qi);let tr;function nr(){tr=tr||document.createElement("canvas").getContext("2d")}const ir={measureTextWidth(e){nr();const{width:t}=tr.measureText(e);return t},lineWrap(e,t,n,i){let r,o;nr();const a=e?e.split(/\n+|\r+|\r\n/):[],s=[];let l,u,c,p,f=e?e.split(/\s+/):[],d=a[0];if("number"!=typeof t||t<=0)return[e];if("number"==typeof i&&a.length>=i)return a.slice(0,i);for(n&&(tr.font=n),o=0;o<a.length;o++){for(p=a[o],f=p.split(/\s+/),[d]=f,c="",r=1;r<f.length;r++)if(l=`${d} ${f[r]}`,u=ir.measureTextWidth(l),u>t&&("number"!=typeof i||i>s.length)?(s.push(d),d=f[r]):d=l,"number"==typeof i&&s.length>=i){c=f.slice(r+1).join(" ");break}"number"!=typeof i||s.length<i?s.push(d):s[Math.max(0,s.length-1)]=`${s[Math.max(0,s.length-1)]} ${d} ${c}`}return s},wordWrap(e,t,n,i,r){if(nr(),!e||!e.length)return[];n&&(tr.font=n);let o=[];const a=e.slice();let s,l,u,c="";if(a.filter((e=>!!e)),"number"!=typeof t||t<0)return e.slice();for(u=0;u<a.length;u++){var p;if(l=a[u],c="",l.length<=1||ir.measureTextWidth(l)<=t)o.push(l);else if(s=ir.splitWord(l,t,void 0,void 0===i?void 0:i-o.length),s.length<=1)o.push(s[0]);else c=null!==(p=s.pop())&&void 0!==p?p:"",o=o.concat(s),a[u+1]?ir.measureTextWidth(`${c} ${a[u+1]}`)>t&&(void 0===i||o.length+a.length-u<=i)?a.splice(u+1,0,c):a[u+1]=`${c} ${a[u+1]}`:a.push(c)}return o.forEach(((e,t,n)=>{n[t]=e.trim()})),void 0!==i&&o.length>i?(o=o.splice(0,i),o[o.length-1]=ir.truncate(o[o.length-1],t,n,r).text):(l=o[o.length-1],l&&l.length>1&&ir.measureTextWidth(l)>t&&(o[o.length-1]=ir.truncate(l,t,n,r).text)),o},truncate(e,t,n,i="…"){nr();let r,o,a,s,l=e;const u=ir.measureTextWidth("i");if(n&&(tr.font=n),e&&t){if(ir.measureTextWidth(l)>t){const e=Math.ceil(t/u);for(r=Math.min(e,l.length);r>0;r--)if(o=l.substring(0,r-1),a=o.trim()+i,ir.measureTextWidth(a)<=t){s=l.substring(r-1),l=a;break}r||(s=l,l="…")}}else s=void 0;return{text:l,rest:s}},isNumber:e=>"number"==typeof e&&Number.isFinite(e),explodeWord(e,t,n,i){let r;nr();let o,a=e,s="",l=[];if(void 0!==n&&ir.isNumber(n)&&n<=1)return[e];const u=Math.ceil(t/i);for(r=Math.min(e.length,u);r>0&&(a=e.substring(0,r),o=e.substring(r-1,r)," "===o?a=e.substring(0,r-1):a+="-",s=e.substring(r),!(ir.measureTextWidth(a)<=t));r--);return(!r&&!a||ir.measureTextWidth(a)>t)&&(a=e.substring(0,1),s=e.substring(1)),l.push(a),s?(ir.measureTextWidth(s)>t?l=l.concat(ir.explodeWord(s,t,void 0===n?void 0:n-1,i)):l.push(s),l.filter((e=>""!==e.trim()))):l},splitWord:(e,t,n,i)=>(nr(),e&&t?(n&&(tr.font=n),ir.explodeWord(e,t,i,Math.max(1,ir.measureTextWidth("i")))):[]),wrapText(e,t,n,i,r="…"){let o;return Number.isNaN(t)||!t?[e]:(o=void 0===i||i>1?ir.lineWrap(e,t,n,i):[e],o=ir.wordWrap(o,t,n,i,r),o)},getFontHeight:e=>(nr(),e&&(tr.font=e),1.5*ir.measureTextWidth("m")),tokenize(e,t,n,i,r,o,a=1){nr(),t&&(tr.font=t);const s=ir.getFontHeight(),l=a*s;let u=[],c=[];if(void 0!==o&&o<s)return[];const p=o?Math.max(1,Math.floor(o/l)):i||1;return u=[void 0===i||Number.isNaN(i)||i<=0?p:Math.min(p,i)],Array.isArray(e)?e.forEach(((e,n)=>{c.length<p&&(c=c.concat(ir.wrapText(e,r,t,u[n])))})):c=ir.wrapText(e,r,t,u[0],n),c}};function rr({chart:e,renderer:t,refLine:n,settings:i,width:r,height:o,barWidth:a}){if(!e||!t||!i)return{};const{position:s,scale:l,value:u,label:c,line:p,formatter:f,cId:d}=n,m=n.radius?n.radius*(Math.min(r,o)/2):r/2,h=(un-ln)*s+ln-Math.PI/2,g={x:r/2,y:o/2};let y=er(!0,{},i.style.line,p||{});const v={type:"line",cId:d,...{x1:g.x+Math.cos(h)*m,y1:g.y+Math.sin(h)*m,x2:g.x+Math.cos(h)*(m+a),y2:g.y+Math.sin(h)*(m+a)},data:{angle:h,innerRadius:m},stroke:y.stroke,strokeWidth:y.strokeWidth,strokeDasharray:y.strokeDasharray};let b;if(c){const n=er(!0,{fill:"#000",fontFamily:"Arial",fontSize:"12px",opacity:1,padding:5,background:{fill:"#fff",stroke:"transparent",strokeWidth:0,opacity:.5}},i.style.label||{},{fill:y.stroke},c),{fontFamily:s,fontSize:p,fill:v,opacity:x}=n,q=c.showLabel?n.text:"";let D,S="";if("string"==typeof f||"object"==typeof f)D=e.formatter(f);else if(void 0!==l&&"string"!=typeof l&&"function"==typeof l.data){const e=l.data()&&l.data().fields;D=e&&e[0]?e[0].formatter():null}!1!==c.showValue&&(D?S=` (${D("function"==typeof u?u():u)})`:l&&(S=` (${u})`));const M=e=>t.measureText({text:e,fontFamily:s,fontSize:p}),A=M("M").height,I=`normal ${p} ${s}`;let w,k=kn;const C=`${q}${S}`||"",L=Math.min(r,o),E=Math.min(8,L/200),N=Gi(g.x,g.y,m+a+E,h+Math.PI/2),P=M(C).width;w=Math.min(N.x,r-N.x-pn,wn),k=function(e,t,n){const i=Math.min(Math.floor((e+pn)/t),Math.floor((n-e)/t));return Math.min(i,kn)}(N.y,A,o);let O=ir.tokenize(C,I,`... ${S}`,k,w,void 0);const F=function(e){let t="start";const n=e>-Math.PI&&e<0?"baseline":"hanging";return(e+=Math.PI/2)<0&&e>-Math.PI?t="end":e>0&&e<Math.PI&&(t="start"),{textAnchor:t,baseline:n}}(h);N.y-2*A>0&&N.y+2*A<o&&(N.x-P+pn<0&&"end"===F.textAnchor||N.x+P-pn>r)&&(O=ir.tokenize(C,I,`... ${S}`,k,w,void 0)),b={fill:v,opacity:x,fontFamily:s,fontSize:p,linePosition:N,lineHeight:A,align:"left",baseline:F.baseline,textAnchor:F.textAnchor,lines:O,cId:d}}return{lineNode:v,labelNode:b}}const or={require:["chart","renderer"],defaultSettings:{style:{line:{stroke:"#000"}}},render(){var e,t;let{settings:n,chart:i,renderer:r,rect:o}=this;if(!(i&&o&&n&&r))return[];const{width:a,height:s}=o,l=null!==(e=null==n||null===(t=n.settings)||void 0===t?void 0:t.barWidth)&&void 0!==e?e:0;let u=(null==n?void 0:n.lines)&&n.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==i?void 0:i.scale("string"==typeof e.scale?e.scale:"");const n=t(e.value);return er(e,{scale:t,position:n})}return er(e,{position:e.value})}));const c=[];let p=[];[...u].forEach((e=>{if(e.position>0&&e.position<1){const{lineNode:t,labelNode:o}=rr({chart:i,renderer:r,refLine:e,settings:n,width:a,height:s,barWidth:l});t&&c.push(t),o&&p.push(o)}}));const f=[];p.forEach((e=>{const{fill:t,opacity:n,fontFamily:i,fontSize:r,lines:o,lineHeight:a,textAnchor:s,linePosition:l,baseline:u,cId:c}=e,p=l,d=o.length-1,m=o.map(((e,o)=>{let l=p.y;return d>0&&("baseline"===u?l-=(d-o)*a:l+=o*a),{type:"text",text:e,cId:c,baseline:u,anchor:s,fill:t,opacity:n,fontFamily:i,fontSize:r,x:p.x,y:l}}));f.push(...m)}));const{MEDIUM:d,SMALLER:m}=Vn,h=a>=d.width&&s>=d.height;return[...a>=m.width&&s>=m.height?c:[],...h?f:[]]}};const ar={require:["chart","symbol"],defaultSettings:{settings:{},style:{}},render(){var e;return function({chart:e,settings:t,symbol:n}){if(!e||!t||!n)return[];const{valueAngle:i}=t,{clientWidth:r,clientHeight:o}=e.element,a=.4*Math.min(r,o),s=[],l=t.fill,u={x:r/2,y:o/2},c=_i({points:[{x:u.x-a/2,y:u.y+a/2},{x:u.x,y:u.y-a},{x:u.x+a/2,y:u.y+a/2}],angle:i,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})}},sr={getGap(e,t){const n=e.position<t.position?e:t,i=e.position<t.position?t:e;return i.position-i.radius-(n.position+n.radius)},findSegmentPositionMeetMaxThenMin(e,t,n){const i=e.position+e.radius,r=e.position-Math.max(0,i-n),o=r-e.radius;return r+Math.max(0,t-o)},layoutPositionFromMin(e,t,n,i=0){const r=e.length-1;let o,a,s,l=t;for(let t=0;t<r;t++)o=e[t],a=e[t+1],s=(o.position+a.position)/2-i/2,o.position=sr.findSegmentPositionMeetMaxThenMin(o,l,s),l=o.position+o.radius+i;a&&(a.position=sr.findSegmentPositionMeetMaxThenMin(a,l,n))},adjustPositionFromMax(e,t,n,i=0){const r=e.length-1,o=Math.max(0,e[r].position+e[r].radius-n);if(0===o)return;let a,s,l,u,c=0;for(a=r;a>0&&(s=e[a],l=e[a-1],u=Math.max(0,sr.getGap(l,s)-i),u-=Math.max(0,c+u-o),c+=u,s.move=u,!(c>=o));a--);for(c<o&&l&&(u=Math.max(0,l.position-l.radius-t),u-=Math.max(0,c+u-o),c+=u,l.move=u),c=0,a=0;a<=r;a++)s=e[a],c+=s.move||0,s.move=c,s.position-=c},createLayout(e,t,n,i=0){const r=e.map((e=>e.segment)),o=r.length-1;if(o<0)return[];if(0===o){const e=r[0];e.position=sr.findSegmentPositionMeetMaxThenMin(e,t,n)}else sr.layoutPositionFromMin(r,t,n,i),sr.adjustPositionFromMax(r,t,n,i);return e.filter((e=>{const i=Math.ceil(e.segment.position-e.segment.radius),r=e.segment.position+e.segment.radius;return i>=t&&r<=n}))}};const lr={require:["chart","renderer"],defaultSettings:{style:{line:{stroke:"#000"}}},render(){var e,t,n,i;let{settings:r,chart:o,renderer:a,rect:s}=this;if(!(o&&s&&r&&a))return[];const{width:l,height:u}=s,c=null!==(e=null==r||null===(t=r.settings)||void 0===t?void 0:t.barWidth)&&void 0!==e?e:0,p=null!==(n=null===(i=r.settings)||void 0===i?void 0:i.isRtl)&&void 0!==n&&n,f=p?-1:1,d=(null==r?void 0:r.lines)&&r.lines.x||[],m=(null==r?void 0:r.lines)&&r.lines.y||[];let h=d.length>0?d:m;if(0===h.length)return[];const g=d.length>0;h=h.map((e=>{if("function"==typeof e.value&&(e.value=e.value()),e.scale){let t=null==o?void 0:o.scale("string"==typeof e.scale?e.scale:"");const n=t(e.value);return er(e,{scale:t,position:n})}return er(e,{position:e.value})}));const y=[];let v=[];if([...h].forEach((e=>{if(Wi(e)&&e.position>0&&e.position<1){const{lineNode:t,labelNode:n}=function({chart:e,renderer:t,refLine:n,settings:i,width:r,height:o,isVerticalRefLine:a,barWidth:s}){if(!e||!t||!i)return{};const{position:l,scale:u,value:c,label:p,line:f,formatter:d,cId:m}=n;let h=er(!0,{},i.style.line,f||{});const g={type:"line",cId:m,...a?{x1:l*r,x2:l*r,y1:o/2-s/2,y2:o/2+s/2}:{x1:r/2-s/2,x2:r/2+s/2,y1:l*o,y2:l*o},stroke:h.stroke,strokeWidth:h.strokeWidth,strokeDasharray:h.strokeDasharray};let y;if(p){const n=er(!0,{fill:"#000",fontFamily:"Arial",fontSize:"12px",opacity:1,padding:5,background:{fill:"#fff",stroke:"transparent",strokeWidth:0,opacity:.5}},i.style.label||{},{fill:h.stroke},p),{fontFamily:f,fontSize:g,fill:v,opacity:b}=n,x=p.showLabel?n.text:"";let q,D="";if("string"==typeof d||"object"==typeof d)q=e.formatter(d);else if(void 0!==u&&"string"!=typeof u&&"function"==typeof u.data){const e=u.data()&&u.data().fields;q=e&&e[0]?e[0].formatter():null}!1!==p.showValue&&(q?D=` (${q("function"==typeof c?c():c)})`:u&&(D=` (${c})`));const S=e=>t.measureText({text:e,fontFamily:f,fontSize:g}),M=S("M").height,A=`normal ${g} ${f}`,I=a?In.MAX_WIDTH:r/2-s/2-In.CLEARANCE,w=a?2:1,k=`${x}${D}`||"",C=ir.tokenize(k,A,`... ${D}`,w,I,void 0),L=(a?r:o)*l,E=Math.min(I,Math.max(...C.map((e=>S(e).width)))),N=C.length*M;y={fill:v,opacity:b,fontFamily:f,fontSize:g,linePosition:L,lineHeight:M,lines:C,cId:m,segment:{position:L,radius:a?E/2:N/2}}}return{lineNode:g,labelNode:y}}({chart:o,renderer:a,refLine:e,settings:r,width:l,height:u,isVerticalRefLine:g,barWidth:c});t&&y.push(t),n&&v.push(n)}})),g)v.sort(((e,t)=>e.segment.position-t.segment.position)),v=sr.createLayout(v,0,l,In.GAP);else{const{attrs:e}=o.findShapes("text").filter((e=>e.key===Ln.GAUGE_LABEL))[0],{"font-size":t}=e,n=parseFloat(t);let i=v.filter((t=>t.segment.position<e.y)),r=v.filter((t=>t.segment.position>e.y));i.sort(((e,t)=>e.segment.position-t.segment.position)),r.sort(((e,t)=>e.segment.position-t.segment.position)),i=sr.createLayout(i,0,e.y-n/2),r=sr.createLayout(r,e.y+n/2,u),v=[...i,...r]}const b=[],x=[];v.forEach((e=>{const{fill:t,opacity:n,fontFamily:i,fontSize:r,lines:o,segment:a,linePosition:s,lineHeight:d,cId:m}=e,{position:h}=a;if(s!==h&&""!==e.lines[0]){let e={x1:l/2+f*(c/2),x2:l/2+f*(c/2+.75*In.CLEARANCE),y1:s,y2:h};g&&(e={y1:u/2+c/2,y2:u/2+c/2+In.CLEARANCE,x1:s,x2:h});const n={type:"line",...e,stroke:t,strokeWidth:1,isConnector:!0,cId:m};x.push(n)}const y=o.map(((e,o)=>{let a=g?u/2+c/2+d/2+In.CLEARANCE:h;return a+=o*d,{type:"text",text:e,cId:m,baseline:"central",anchor:g?"middle":p?"end":"start",fill:t,opacity:n,fontFamily:i,fontSize:r,x:g?h:l/2+f*(c/2+In.CLEARANCE),y:a}}));b.push(...y)}));const{MEDIUM:q,SMALLER:D}=Vn,S=l>=q.width&&u>=q.height;return[...l>=D.width&&u>=D.height?y:[],...S?b:[],...S?x:[]]}};var ur={dataRelatedPropertiesPaths:["qHyperCube.qGrandTotalRow","qHyperCube.qHasOtherValues","qHyperCube.qSize","qHyperCube.qDimensionInfo[].qAttrDimInfo","qHyperCube.qDimensionInfo[].qCardinalities","qHyperCube.qDimensionInfo[].qMax","qHyperCube.qDimensionInfo[].qMin","qHyperCube.qDimensionInfo[].qStateCounts","qHyperCube.qMeasureInfo[].qApprMaxGlyphCount","qHyperCube.qMeasureInfo[].qFallbackTitle","qHyperCube.qMeasureInfo[].qMax","qHyperCube.qMeasureInfo[].qMin","qHyperCube.qMeasureInfo[].qNumFormat","qHyperCube.qMeasureInfo[].qTrendLines","qHyperCube.qTreeNodesOnDim","measureAxis.min","measureAxis.max","refLine.refLines[].refLineExpr"]};function cr(e){const{qHyperCube:t,...n}=e,{qDataPages:i,qStackedDataPages:r,qTreeDataPages:o,...a}=t||{},s=er(!0,{},{...n,qHyperCube:{...a,qDataPages:null,qStackedDataPages:null,qTreeDataPages:null}}),{dataRelatedPropertiesPaths:l}=ur;return l.forEach((e=>{const t=e.split("[");if(1===t.length)void 0!==Mt(s,e)&&It(s,e,null);else{const e=t[0],n=t[1].split("].")[1];Mt(s,e,[]).forEach((e=>{void 0!==Mt(e,n)&&It(e,n,null)}))}})),s}const pr=({core:e,services:t,settings:n})=>{i((()=>{if(!n||!e||!t)return;const{chart:i,cache:r}=e;if(!i)return;const{colorService:o,layoutService:a}=t;i.update({data:[{type:"q",key:"qHyperCube",data:a.getHyperCube()},...o.getData()],settings:n}),r&&function({cache:e,layout:t}){const n=cr(t);e.set("dataIndependentProperties",JSON.stringify(n))}({cache:r,layout:a.getLayout()})}),[e,n])};function fr({layout:e,options:t}){return e.snapshotData&&!t.freeResize?{width:e.snapshotData.content.size.w,height:e.snapshotData.content.size.h}:void 0}function dr({options:e,cache:t,layoutService:n}){const i={isSizeChanging:!1};return{enabled:()=>!1!==e.chartAnimations&&!i.isSizeChanging&&!function({cache:e,layout:t}){const n=cr(t);return e.get("dataIndependentProperties")!==JSON.stringify(n)}({cache:t,layout:n.getLayout()}),meta:i}}function mr({layout:e,rect:t}){var n;const{measureAxis:i,qHyperCube:r,autoOrientation:o,gaugetype:a,useSegments:s,segmentInfo:l,refLine:u}=e,c=null===(n=e.qHyperCube)||void 0===n?void 0:n.qMeasureInfo[0].qFallbackTitle,{width:p,height:f}=t;let d=e.orientation;o&&(d=p>=f?"horizontal":"vertical");const m="vertical"===d,h=function({measureAxis:e,qHyperCube:t}){if(!e||!t)return{min:0,max:1};let{min:n,max:i}=e;if(n=Number(n),i=Number(i),n!==i)return{min:Math.min(n,i),max:Math.max(n,i)};const r=t.qDataPages[0].qMatrix[0][0].qNum;let o=Math.abs(r-n)/2;return 0===o&&(o=0!==n?Math.abs(n)/2:Number.MAX_VALUE/2),{min:n-o,max:i+o}}({measureAxis:i,qHyperCube:r}),g=(null==u?void 0:u.refLines)||[];return{measureAxisTitle:c,measureAxisSpacing:null==i?void 0:i.spacing,measureAxisShow:null==i?void 0:i.show,rangeLimits:h,qHyperCube:r,orientation:d,autoOrientation:o,gaugetype:a,isVertical:m,useSegments:s,segmentInfo:l,refLines:g}}function hr({dockService:e,layoutService:t}){const{width:n,height:i}=e.meta.chart.size,{orientation:r,autoOrientation:o}=t.meta;return o?n<i:"vertical"===r}function gr(e,t,n){if(e>=n)return 1;if(e<=t)return 0;const i=Math.min(1,Math.max(0,(e-t)/(n-t)));return Number.isNaN(i)?0:i}function yr(e){return"none"!==e&&"labels"!==e}function vr(e){return"none"!==e&&"title"!==e}function br({chart:e,layoutService:t,dockService:n}){function i(){const{width:e,height:i}=n.meta.chart.size,r=hr({dockService:n,layoutService:t});return Math.min(sn,r?e/10:i/10)}function r(){const{width:e,height:i}=n.meta.chart.size;return hr({dockService:n,layoutService:t})?i:e}function o(e){const{min:n,max:i}=t.meta.rangeLimits,o=e?i-(t.meta.qHyperCube.qDataPages[0].qMatrix[0][0].qNum-n):t.meta.qHyperCube.qDataPages[0].qMatrix[0][0].qNum;return r()*gr(o,n,i)}const a={getBottomPadding(e){if(hr({dockService:n,layoutService:t})){const t=o(!1)+-e.height*hn.VERTICAL_ALIGNMENT_FACTOR,n=mn.BOTTOM,i=r()-e.height-mn.TOP;return t<n?n:t>i?i:t}const{MAX_LINES:a,ESTIMATED_LINE_HEIGHT:s,CLEARANCE:l}=In,u=function({layoutService:e,dockService:t}){const{width:n,height:i}=t.meta.chart.size,{min:r,max:o}=e.meta.rangeLimits,{MEDIUM:a}=Vn,s=n>=a.width&&i>=a.height,{refLines:l}=e.meta;return l&&l.filter(Wi).length>0&&l.filter((e=>e.refLineExpr.value>=r&&e.refLineExpr.value<=o)).length>0&&s}({layoutService:t,dockService:n})?a*s+l:0;return-i()*gn.VERTICAL_ALIGNMENT_FACTOR-u},getTopPadding:e=>-a.getBottomPadding(e),getLeftPadding(e){const{width:a}=n.meta.chart.size,s=n.config.rtl,l=i(),u=hr({dockService:n,layoutService:t}),c=Math.min(e.width,a*qn);if(u)return s?a/5-l-c:a/5+l;const p=o(s)-e.width/2,f=mn.RIGHT,d=r()-e.width-mn.LEFT;return p<f?f:p>d?d:p},getRightPadding:e=>-a.getLeftPadding(e)},s={getLeftPadding(r){if(!hr({dockService:n,layoutService:t}))return 0;const o=e.findShapes("container").filter((e=>e.key===Ln.BAR_AXIS));if(1!==o.length)return 0;const a=o[0],s=vr(t.meta.measureAxisShow)?Math.max(...a.children.filter((e=>"text"===e.type)).map((e=>e.bounds.width))):0,l=Math.max(...a.children.filter((e=>"line"===e.type)).map((e=>e.bounds.width))),u=i();let c=u/2+s+l+u*An;const{width:p}=n.meta.chart.size;c>p/2-r.height/4&&(c=p/2-r.height/4);return n.config.rtl?c:-c},getRightPadding:e=>-s.getLeftPadding(e),getTopPadding(){if(hr({dockService:n,layoutService:t}))return-4;const r=e.findShapes("container").filter((e=>e.key===Ln.BAR_AXIS));if(1!==r.length)return 0;const o=r[0],a=vr(t.meta.measureAxisShow)?Math.max(...o.children.filter((e=>"text"===e.type)).map((e=>e.bounds.height))):0,s=Math.max(...o.children.filter((e=>"line"===e.type)).map((e=>e.bounds.height))),l=i();return-(l/2+a+s+l*Mn)},getBottomPadding:()=>-s.getTopPadding()};return{getBarWidthInPixels:i,getValueLabelFontSize:function(e,t){const{width:i,height:r}=n.meta.chart.size,o=gr(Math.min(r,i),dn.MIN,dn.MAX);return e+Math.round(o*(t-e))},barValueLabel:a,barAxisTitle:s}}const xr=({core:e})=>{const f=r(),d=o(),m=a(),h=s(),g=l(),y=u(),{qLocaleInfo:v}=c(),[x,q]=n(null),D=t(),S=p();return i((()=>{if(!f||!e)return;const{picassoInstance:t,chart:n,cache:i}=e;if(!n)return;const r=function(e){var t=e.source,n=e.metaAdditionsFn,i=e.experimental,r=void 0===i?{filter:!1}:i,o=R(!0,{},t),a=r.filter?function(e){var t=e.qHyperCube,n=Lt(t,Ct.DIMENSION),i=n.reduced,r=n.filtered;t[Ct.DIMENSION]=i;var o=Lt(t,Ct.MEASURE),a=o.reduced,s=o.filtered;return t[Ct.MEASURE]=a,{dimensions:r,measures:s}}(o):{dimensions:[],measures:[]},s=Nt(o),l=function(){var e=function(e){var t=e.layout,n=e.additionsFn,i=void 0===n?function(){return{}}:n,r=e.additionsProps,o=void 0===r?{}:r,a=t.qHyperCube,s=a.qDimensionInfo,l=a.qMeasureInfo,u=a.qMode,c=s.length,p=l.length,f=b({mode:{S:"S"===u,P:"P"===u,K:"K"===u,T:"T"===u},dimensionCount:c,measureCount:p,hasMultipleDimensions:c>1,hasMultipleMeasures:p>1,isOneDimensional:1===c,isTwoDimensional:2===c},o);return b(b({},f),i({layout:t,meta:f}))}({layout:o,additionsFn:n,additionsProps:{size:s.size}});return e.filteredFields=a,e},u={refs:b({},s.refs),meta:l(),getLayout:function(){return o},getLayoutValue:function(e,t){return Mt(o,e,t)},setLayoutValue:function(e,t){It(o,e,t),s=Nt(o),u.meta=l()},getHyperCube:function(){return o.qHyperCube},getHyperCubeValue:function(e,t){return Mt(o.qHyperCube,e,t)},setHyperCubeValue:function(e,t){It(o.qHyperCube,e,t),s=Nt(o),u.meta=l()},getDataPages:function(){return Mt(o,s.refs.dataPages)},setDataPages:function(e){It(o,s.refs.dataPages,e),u.meta=l()}};return u}({source:f,metaAdditionsFn:()=>mr({layout:f,rect:g})}),{direction:o="ltr"}=D,a=fr({layout:r.getLayout(),options:D}),s=St({chart:n,layoutService:r,config:{rtl:"rtl"===o,logicalSize:a},typeConfig:{type:"major-minor",fallback:"vertical",invert:!0}}),l=pt({app:m,model:h,translator:y,picasso:t,layoutService:r,config:{key:"color",localeInfo:v,theme:d,auto:()=>({mode:"primary",byMeasureDef:{activeMeasureIndex:0,type:"expression",label:""}})}}),u=function(e){var t=e.theme,n=e.config,i=void 0===n?{}:n,r=i.id,o=i.resolve,a=void 0===o?[]:o,s=i.transform,l=void 0===s?[]:s,u=i.extend,c=void 0===u?[]:u,p={theme:t,matrix:Ut(a),styles:void 0};return p.styles=Xt({theme:t,id:r,transform:l,extend:c,matrix:p.matrix}),{getStyles:function(){return p.styles},getTheme:function(){return p.theme},setTheme:function(e){p.theme=e,p.styles=Xt({theme:e,id:r,transform:l,extend:c,matrix:p.matrix})}}}({theme:d,config:{id:"gauge"}}),c=br({chart:n,layoutService:r,dockService:s}),p=function({layoutService:e,themeService:t,colorService:n}){const i=t.getStyles(),r=t=>{var n;return null===(n=e.getLayoutValue("components",[]))||void 0===n?void 0:n.find((e=>e.key===t))},o=e=>e?n.getPaletteColor(e):void 0;return{query:{axis:{title:{getStyle:()=>{var e,t,n,a;return{fontFamily:null!==(e=null===(t=r("axis"))||void 0===t||null===(t=t.axis)||void 0===t||null===(t=t.title)||void 0===t?void 0:t.fontFamily)&&void 0!==e?e:i.axis.title.fontFamily,fontSize:i.axis.title.fontSize,color:null!==(n=o(null===(a=r("axis"))||void 0===a||null===(a=a.axis)||void 0===a||null===(a=a.title)||void 0===a?void 0:a.color))&&void 0!==n?n:i.axis.title.color}}},label:{getStyle:()=>{var e,t,n,a;return{fontFamily:null!==(e=null===(t=r("axis"))||void 0===t||null===(t=t.axis)||void 0===t||null===(t=t.label)||void 0===t||null===(t=t.name)||void 0===t?void 0:t.fontFamily)&&void 0!==e?e:i.axis.label.name.fontFamily,fontSize:i.axis.label.name.fontSize,fill:null!==(n=o(null===(a=r("axis"))||void 0===a||null===(a=a.axis)||void 0===a||null===(a=a.label)||void 0===a||null===(a=a.name)||void 0===a?void 0:a.color))&&void 0!==n?n:i.axis.label.name.color}}}},label:{getStyle:()=>{var e,t,n,a;return{fontFamily:null!==(e=null===(t=r("value"))||void 0===t||null===(t=t.label)||void 0===t||null===(t=t.value)||void 0===t?void 0:t.fontFamily)&&void 0!==e?e:i.label.value.fontFamily,fill:null!==(n=o(null===(a=r("value"))||void 0===a||null===(a=a.label)||void 0===a||null===(a=a.value)||void 0===a?void 0:a.color))&&void 0!==n?n:i.label.value.color}}}}}}({layoutService:r,themeService:u,colorService:l}),x=dr({options:D,cache:i,layoutService:r}),M=function({layout:e,model:t,translator:n,interactionState:i}){return{isClosed:()=>e.disclaimerClosed,close:()=>{t.getProperties().then((e=>{e.disclaimerClosed=!0,t.setProperties(e)}))},translator:n,isEditMode:i.edit}}({layout:f,model:h,translator:y,interactionState:S});q({layoutService:r,colorService:l,dockService:s,labelService:c,themeService:u,styleService:p,animationsService:x,disclaimerService:M})}),[h,m,f,d.name(),y.language(),e,D.direction,S.edit]),x};function qr({width:e,height:t,fontSize:n}){const{FULL:i}=Vn;if(e>=i.width&&t>=i.height){let e=Number.parseFloat(n);return e=Math.floor(e*vn),`${e}px`}return n}var Dr=e=>()=>e;function Sr(e){return 1==(e=+e)?Mr:function(t,n){return n-t?function(e,t,n){return e=Math.pow(e,n),t=Math.pow(t,n)-e,n=1/n,function(i){return Math.pow(e+i*t,n)}}(t,n,e):Dr(isNaN(t)?n:t)}}function Mr(e,t){var n=t-e;return n?function(e,t){return function(n){return e+n*t}}(e,n):Dr(isNaN(e)?t:e)}var Ar=function e(t){var n=Sr(t);function i(e,t){var i=n((e=ci(e)).r,(t=ci(t)).r),r=n(e.g,t.g),o=n(e.b,t.b),a=Mr(e.opacity,t.opacity);return function(t){return e.r=i(t),e.g=r(t),e.b=o(t),e.opacity=a(t),e+""}}return i.gamma=e,i}(1);function Ir({thisColor:e,paletteColors:t,paletteIndex:n,limit:i,isLeft:r=!1,themeService:o}){const a=r?0:1,s=0===Object.entries(i).length,l=i.gradient;let u=n+(r?-1:1);s&&(u=r?0:t.length-1);const c=o.getTheme().getColorPickerColor(u<t.length&&u>=0?t[u]:t[0]);return{color:l?Ar(e,c)(.5):e,offset:a,gradient:l}}function wr({limits:e,paletteColors:t,paletteIndex:n,themeService:i}){const r=Mt(e,""+(n-1),{}),o=Mt(e,`${n}`,{}),a=[r,o].map((e=>e.gradient)).includes(!0),s=i.getTheme().getColorPickerColor(t[n]);if(!a)return[{offset:0,color:s},{offset:1,color:s}];const l=[Ir({thisColor:s,paletteColors:t,paletteIndex:n,limit:r,isLeft:!0,themeService:i}),Ir({thisColor:s,paletteColors:t,paletteIndex:n,limit:o,isLeft:!1,themeService:i})];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:n})=>({offset:e,color:t,gradient:n})));return u}function kr({themeService:e,segmentInfo:t,rangeLimits:n}){const{limits:i,paletteColors:r}=t,{min:o,max:a}=n;i.sort(((e,t)=>e.value-t.value));const s=[o,...i.map((e=>e.value)),a],l=[];for(let t=0;t<r.length;t++){const n=wr({limits:i,paletteColors:r,paletteIndex:t,themeService:e}).map((e=>({offset:gr(s[t]+e.offset*(s[t+1]-s[t]),o,a),color:e.color,gradient:"gradient"in e?e.gradient:void 0})));l.push(...n)}return l}function Cr(e){return e.map((e=>({...e,offset:1-e.offset}))).reverse()}function Lr({themeService:e,isVertical:t,segmentInfo:n,rangeLimits:i,isRtl:r}){return{type:"gradient",x1:0,x2:t?0:1,y1:t?1:0,y2:0,stops:r&&!t?Cr(kr({themeService:e,segmentInfo:n,rangeLimits:i})):kr({themeService:e,segmentInfo:n,rangeLimits:i})}}function Er({services:e}){const{dockService:t,disclaimerService:n}=e,{translator:i,isClosed:r,isEditMode:o}=n;if(r()||!o)return!1;const a=t.config.rtl;return{key:"disclaimer-component",type:"disclaimer-component",layout:{displayOrder:5,minimumLayoutMode:Rn},settings:{isRtl:a,close:e.disclaimerService.close,title:i.get("Object.Gauge.RangeIsDefaultTitle"),text:i.get("Object.Gauge.RangeIsDefault")}}}function Nr({services:e}){const{dockService:t,layoutService:n,themeService:i,animationsService:r}=e,{qHyperCube:o,useSegments:a,segmentInfo:s,rangeLimits:l}=n.meta,u=hr({dockService:t,layoutService:n}),c=u?"vertical":"horizontal";if(!a)return!1;const{min:p,max:f}=l,d=o.qDataPages[0].qMatrix[0][0].qNum,m=Math.max(p,Math.min(f,d)),h={type:"box",key:Ln.MARK,data:{extract:{field:"qMeasureInfo/0",props:{start:m,end:m,measureIndex:0}}},settings:{minor:{scale:"m"},orientation:c,box:{width:.1,maxWidthPx:sn,minHeightPx:yn,fill:()=>function({themeService:e,isVertical:t,segmentInfo:n,rangeLimits:i,value:r}){const o=Lr({themeService:e,isVertical:t,segmentInfo:n,rangeLimits:i,isRtl:!1});let{min:a,max:s}=i;const l=gr(r,a,s),{stops:u}=o;let c="black";for(let e=0;e<u.length;e++){const t=u[e].offset,n=u[e+1].offset;if(l>=t&&l<=n){const i=gr(l,t,n);c=ji(Ar(u[e].color,u[e+1].color)(i));break}}return c}({value:d,themeService:i,isVertical:u,segmentInfo:s,rangeLimits:l}),stroke:"transparent"}},animations:{enabled:r.enabled,trackBy:e=>`${e.data.measureIndex.value}`}};return h}function Pr({services:e}){const{dockService:t,themeService:n,styleService:i,layoutService:r,animationsService:o}=e;if(!vr(r.meta.measureAxisShow))return[];const{width:a,height:s}=t.meta.chart.size,l=$i(a,s,ln,un),{innerRadius:u,outerRadius:c,radiusIncrease:p}=l,f=4*p,d=Math.min(a,s)/2,m=n.getStyles(),h=i.query.axis.label.getStyle(),{tickLength:g,labelPadding:y}=function({width:e,height:t,defaultTickSize:n,defaultLabelPadding:i}){const r=Math.min(Math.min(e,t)/Hn,1);return{tickLength:n*r,labelPadding:i*r}}({width:a,height:s,defaultTickSize:8,defaultLabelPadding:20}),v=Xi(a,s);return[{key:Ln.RADIAL_AXIS,type:"axis",rendererSettings:{disableScreenReader:!0},dock:"center",layout:{minimumLayoutMode:Tn},scale:"m",settings:{arc:{radius:c,startAngle:ln,endAngle:un,offset:-10*f*(c-u)*d},align:"top",line:{show:!1,stroke:"#cdcdcd"},ticks:{tickSize:g,stroke:m.axis.line.major.color,margin:v},labels:{margin:-6-2*g+y,fontFamily:h.fontFamily,fill:h.fill,fontSize:h.fontSize}},animations:{enabled:o.enabled,trackBy:e=>{const{type:t,text:n,x:i,y:r,x1:o,y1:a,value:s}=e;return"text"===t?`text-${n}-${i}-${r}`:`tick-${s}-${o}-${a}`}}}]}function Or(e,t,n,i){const r=i?Cr(kr({themeService:t,segmentInfo:n,rangeLimits:e})):kr({themeService:t,segmentInfo:n,rangeLimits:e}),o=(un-ln)/(2*Math.PI),a=r.map((e=>({offset:e.offset*o,color:e.color})));return{type:"gradient",orientation:"conic",startAngle:ln-Math.PI/2,x:0,y:0,stops:a}}function Fr({services:e}){const{dockService:t,themeService:n,layoutService:i,colorService:r,animationsService:o}=e,{rangeLimits:a,useSegments:s,segmentInfo:l,qHyperCube:u}=i.meta,{width:c,height:p}=t.meta.chart.size,f=t.config.rtl,{outerRadius:d,innerRadius:m,labelGaugeRadius:h}=$i(c,p,ln,un),g=a.max,y=u.qDataPages[0].qMatrix[0][0].qNum,v=g-y,b=[{value:Math.max(En,y-a.min),valueLabel:"Measure"},{value:Math.max(En,v),valueLabel:"Remaining"}];let x=function({themeService:e,segmentInfo:t,rangeLimits:n}){const i=kr({themeService:e,segmentInfo:t,rangeLimits:n});let r=0,o=0,a=i.map((e=>(o=0===n.max?e.offset*(n.max-n.min)-r:e.offset*n.max-r,r+=o,{value:o,color:e.color,gradient:e.gradient}))).filter((e=>0!==e.value));return a.forEach((e=>{e.value=Math.abs(e.value)})),a}({themeService:n,segmentInfo:l,rangeLimits:a});f&&(b.reverse(),x.reverse());const q={type:"pie",key:Ln.RADIAL_GAUGE,data:{items:b},settings:{startAngle:ln,endAngle:un,slice:{arc:{ref:"value"},outerRadius:()=>d,innerRadius:()=>m,fill:(e,t)=>{const n=r.getColor();return f?1===t?n(e):cn:0===t?n(e):cn},strokeWidth:0}},animations:{enabled:o.enabled,trackBy:e=>e.data.value.valueLabel}},D={type:"pie",key:Ln.SEGMENT_RADIAL_GAUGE,renderer:"canvas",displayOrder:1,data:{items:x},settings:{startAngle:ln,endAngle:un,slice:{arc:{ref:"value"},outerRadius:()=>d,innerRadius:()=>m,strokeWidth:0,fill:(e,t)=>{var i,r;return(f?e.datum.value.gradient||(null===(i=x[t+1])||void 0===i?void 0:i.gradient):e.datum.value.gradient||(null===(r=x[t-1])||void 0===r?void 0:r.gradient))?Or(a,n,l,f):e.datum.value.color}}},animations:{enabled:o.enabled,trackBy:e=>e.data.value.color}},S={type:"pie",key:Ln.CIRCLE_GAUGE,renderer:"canvas",displayOrder:0,data:{items:[{value:Math.max(y,En),valueLabel:"Measure"}]},settings:{startAngle:0,endAngle:2*Math.PI,slice:{arc:{ref:"value"},outerRadius:()=>d,innerRadius:()=>m,fill:()=>function(e,t,n,i){let r=Or(e,t,n,i);const o={offset:(un-ln)/(2*Math.PI),color:"rgba(0, 0, 0, 0)"};return r.stops.push(o),r.stops.push({offset:1,color:"rgba(0, 0, 0, 0)"}),r}(a,n,l,f),opacity:s?1:0}},animations:{enabled:o.enabled,trackBy:e=>e.data.value.valueLabel,isMainComponent:!0}},M={type:"pie",key:Ln.LABEL_RADIAL_GAUGE,renderer:"canvas",displayOrder:0,data:{items:[{value:Math.max(y,En),valueLabel:"Measure"}]},settings:{startAngle:0,endAngle:2*Math.PI,slice:{arc:{ref:"value"},outerRadius:()=>h+1,innerRadius:()=>h,opacity:0}},animations:{enabled:o.enabled,trackBy:e=>e.data.value.valueLabel,isMainComponent:!0}};return s?[S,M,D]:[M,q]}function Tr({services:e}){const{dockService:t,layoutService:n,animationsService:i}=e,{width:r,height:o}=t.meta.chart.size,a=t.config.rtl,{rangeLimits:s,qHyperCube:l}=n.meta,{min:u,max:c}=s;let p,f=l.qDataPages[0].qMatrix[0][0].qNum;(f>c||f<u)&&(p="#00000000"),a&&(f=c-(f-u));const d=ln+gr(f,u,c)*(un-ln);return{type:"radial-gauge-needle",key:Ln.RADIAL_GAUGE_NEEDLE,layout:{displayOrder:2},settings:{component:Ln.SEGMENT_RADIAL_GAUGE,fill:p,valueAngle:d},animations:{enabled:i.enabled,trackBy:e=>e.type,adjustTweenedNodes(e){e.forEach((e=>{const{data:t}=e;if(t){const{pointerWidth:n,angle:i,radius:a,fill:s}=t,l=Gi(r/2,o/2,a,i+Math.PI/2),{x:u,y:c}=l,p=[{x:u+.3*n,y:c},{x:u-7.5*n,y:c+n},{x:u-7.5*n,y:c-n}],{d:f}=_i({points:p,angle:i,fill:s,origin:l});e.d=f}}))}}}}function Rr({core:e,services:t}){const{chart:n}=e;if(!n)return[];const{width:i,height:r}=t.dockService.meta.chart.size,{useSegments:o}=t.layoutService.meta;let a=[Er({services:t})];return"bar"===t.layoutService.meta.gaugetype?a.push(...function({services:e}){const{dockService:t,layoutService:n,styleService:i,themeService:r,animationsService:o}=e;if("none"===n.meta.measureAxisShow)return[];const{width:a,height:s}=t.meta.chart.size,l=t.config.rtl,u=hr({dockService:t,layoutService:n}),c=r.getStyles(),p=i.query.axis.label.getStyle(),{fontFamily:f,fill:d,fontSize:m}=p,h=vr(n.meta.measureAxisShow);return[{type:"axis",rendererSettings:{disableScreenReader:!0},key:Ln.BAR_AXIS,dock:"center",scale:"m",layout:{minimumLayoutMode:Nn},settings:{align:u?l?"right":"left":"top",line:{show:!u},labels:{show:h,minLengthPx:20,fontFamily:f,fill:d,fontSize:qr({width:a,height:s,fontSize:m})},paddingStart:()=>{if(u){const e=Math.min(a/10,sn);return a/2+e/2}const e=Math.min(s/10,sn);return s/2+e/2+Sn},ticks:{stroke:c.axis.line.major.color}},animations:{enabled:o.enabled,trackBy:e=>void 0===e.tickValue?"axis":"text"===e.type?`label: ${e.tickValue}`:`mark: ${e.tickValue}`}}]}({services:t}),...function({services:e}){const{colorService:t,themeService:n,dockService:i,layoutService:r,animationsService:o}=e,{rangeLimits:a,segmentInfo:s,useSegments:l}=r.meta,u=i.config.rtl,c=hr({dockService:i,layoutService:r}),p=c?"vertical":"horizontal",{min:f,max:d}=a,m=u&&!c?d:f,h={type:"box",key:Ln.BAR,data:{extract:{field:"qMeasureInfo/0",props:{start:f,end:{field:"qMeasureInfo/0"},measureIndex:0}}},settings:{minor:{scale:"m"},orientation:p,box:{width:.1,maxWidthPx:sn,fill:t.getColor()}},animations:{enabled:o.enabled,isMainComponent:!0,trackBy:e=>`${e.data.measureIndex.value}`}},g={type:"box",key:Ln.SEGMENT_BAR,data:{extract:{field:"qMeasureInfo/0",props:{start:f,end:d,measureIndex:0}}},settings:{minor:{scale:"m"},orientation:p,box:{width:.1,maxWidthPx:sn,fill:()=>Lr({themeService:n,isVertical:c,segmentInfo:s,rangeLimits:a,isRtl:u}),stroke:"transparent"}},animations:{enabled:o.enabled,trackBy:e=>`${e.data.measureIndex.value}`}},y={type:"box",key:Ln.BACKGROUND_BAR,data:{extract:{field:"qMeasureInfo/0",props:{start:f,end:d}}},settings:{minor:{scale:"m"},orientation:p,box:{width:.1,maxWidthPx:sn,fill:cn}}},v={type:"box",key:Ln.LABEL_BAR,data:{extract:{field:"qMeasureInfo/0",props:{start:m,end:m}}},settings:{minor:{scale:"m"},orientation:p,box:{width:c?qn:Dn,opacity:0}}};return l?[v,g]:[v,y,h]}({services:t}),...function({services:e}){const{dockService:t,labelService:n,styleService:i,layoutService:r}=e;if(!yr(r.meta.measureAxisShow))return[];const{width:o,height:a}=t.meta.chart.size,s=hr({dockService:t,layoutService:r}),{measureAxisTitle:l,useSegments:u}=r.meta,{getTopPadding:c,getBottomPadding:p,getLeftPadding:f,getRightPadding:d}=n.barAxisTitle,m=i.query.axis.title.getStyle(),{fontFamily:h,fontSize:g,color:y}=m;return[{type:"labels",key:Ln.AXIS_TITLE,layout:{minimumLayoutMode:Pn},settings:{sources:[{component:u?Ln.SEGMENT_BAR:Ln.BACKGROUND_BAR,selector:"rect",strategy:{type:"bar",settings:{direction:s?"up":"right",align:.5,justify:.5,labels:[{fontFamily:h,fill:y,fontSize:Number.parseFloat(qr({width:o,height:a,fontSize:g})),label:()=>l,placements:[{position:"inside",padding:{top:c,bottom:p,left:f,right:d},overflow:!0}]}]}}}]}}]}({services:t}),function({chart:e,services:t}){if(!e.formatter)return!1;const{labelService:n,styleService:i,dockService:r,layoutService:o,animationsService:a}=t,s=hr({dockService:r,layoutService:o}),{getValueLabelFontSize:l,barValueLabel:u}=n,{getTopPadding:c,getBottomPadding:p,getLeftPadding:f,getRightPadding:d}=u,m=l(fn.MIN,fn.MAX),h=i.query.label.getStyle();return{type:"labels",key:Ln.GAUGE_LABEL,layout:{minimumLayoutMode:s?On:Fn},settings:{sources:[{component:Ln.LABEL_BAR,selector:"rect",formatter:"measure",strategy:{type:"bar",settings:{direction:s?"up":"right",orientation:"horizontal",fontFamily:h.fontFamily,fill:h.fill,fontSize:m,align:s?0:.5,justify:0,labels:[{label:({data:t})=>t?e.formatter(Cn.MEASURE)(t.value):"",linkData:({data:e})=>e?{value:e.value,formatter:Cn.MEASURE}:null,placements:[{position:"outside",padding:{top:c,bottom:p,left:f,right:d},overflow:!0}]}]}}}]},animations:{enabled:a.enabled,trackBy:e=>e.type,adjustTweenedNodes(t){t.forEach((t=>{const{type:n,data:i}=t;"text"===n&&i&&i.value&&i.formatter&&(t.text=e.formatter(i.formatter)(i.value))}))}}}}({chart:n,services:t}),function({services:e}){const{layoutService:t,dockService:n,labelService:i,animationsService:r}=e,{qHyperCube:o,rangeLimits:a,useSegments:s}=t.meta,l=n.config.rtl,u=hr({dockService:n,layoutService:t}),{min:c,max:p}=a,f=o.qDataPages[0].qMatrix[0][0].qNum;let d=i.getBarWidthInPixels();f<=p&&f>=c&&(d=0);let m=u?"bottom":l?"right":"left";return f>p&&(m=u?"top":l?"left":"right"),{type:"oob-indicator",key:Ln.OOB_INDICATOR,layout:{displayOrder:2},settings:{component:s?Ln.SEGMENT_BAR:Ln.BAR,isRtl:l,selector:"rect",pointingTo:m,size:d},animations:{enabled:r.enabled,trackBy:e=>e.type}}}({services:t}),function({services:e}){const{dockService:t,layoutService:n,labelService:i,themeService:r,colorService:o,animationsService:a}=e,{refLines:s}=n.meta,l=t.config.rtl,u=hr({dockService:t,layoutService:n}),c=r.getStyles();return{type:"custom-ref-line",key:Ln.REFERENCE_LINES_AND_LABELS,settings:{barWidth:i.getBarWidthInPixels(),isRtl:l},lines:{[u?"y":"x"]:s.filter(Wi).map((e=>{var t,n;return{scale:"m",value:e.refLineExpr.value,cId:e.cId,label:{text:e.label,...c.referenceLine.label.name,showValue:e.showValue,showLabel:e.showLabel},line:{stroke:o.getPaletteColor(e.paletteColor||{index:e.color}),strokeWidth:(null===(t=e.style)||void 0===t?void 0:t.lineThickness)||2,strokeDasharray:null===(n=e.style)||void 0===n?void 0:n.lineType}}}))},animations:{enabled:a.enabled,trackBy:e=>{const{type:t,cId:n,text:i,isConnector:r}=e;return"text"===t?`${n}-text-${i}`:"line"===t?r?`${n}-connector`:`${n}-line`:Math.random()}}}}({services:t}),Nr({services:t})):i>=Vn.SPARK.width&&r>=Vn.SPARK.height?a.push(...Fr({services:t}),...function({chart:e,services:t}){const{layoutService:n,styleService:i,labelService:r,animationsService:o,dockService:a}=t,{width:s,height:l}=a.meta.chart.size,u=yr(n.meta.measureAxisShow),{qHyperCube:c}=n.meta,p=c.qMeasureInfo[0].qFallbackTitle,f=c.qDataPages[0].qMatrix[0][0].qNum,d=i.query.label.getStyle(),m=i.query.axis.title.getStyle(),{getValueLabelFontSize:h}=r,g=h(fn.MIN,fn.MAX);return[{type:"labels",key:Ln.RADIAL_GAUGE_LABEL,layout:{displayOrder:4},settings:{sources:[{component:Ln.LABEL_RADIAL_GAUGE,selector:"path",strategy:{type:"rows",settings:{fill:"#000",padding:0,labels:[{fontSize:g,fontFamily:d.fontFamily,fill:d.fill,label({data:t}){const n=e.formatter(Cn.MEASURE);return t&&n?n(f):""},linkData:({data:e})=>e?{value:e.value.value,formatter:Cn.MEASURE}:null},{fontSize:Number.parseFloat(qr({width:s,height:l,fontSize:m.fontSize})),fontFamily:m.fontFamily,fill:m.color,label:()=>u?p:""}]}}}]},animations:{enabled:o.enabled,trackBy:e=>"text"+(e.data?"value-label":"axis-title"),adjustTweenedNodes(t){t.forEach((t=>{const{type:n,data:i}=t;if("text"===n&&i&&i.value&&i.formatter&&(t.text=e.formatter(i.formatter)(i.value),t.ellipsed)){const{text:e,fontSize:n,fontFamily:i,maxWidth:r}=t,o=`normal ${n} ${i}`,a="…",s=1;t.ellipsed=ir.tokenize(e,o,a,s,r)[0]}}))}}}]}({chart:n,services:t}),...Pr({services:t}),...o?[Tr({services:t})]:[],...function({services:e}){const{dockService:t,layoutService:n,colorService:i,animationsService:r}=e,{width:o,height:a}=t.meta.chart.size,s=t.config.rtl,{rangeLimits:l,useSegments:u,qHyperCube:c}=n.meta,{min:p,max:f}=l,d=c.qDataPages[0].qMatrix[0][0].qNum,{outerRadius:m,innerRadius:h}=$i(o,a,ln,un),g=(h+(m-h)/2)*Math.min(o,a)/2,{RADIAL_OOB_INDICATOR_MIN:y,RADIAL_OOB_INDICATOR_MAX:v,SEGMENT_RADIAL_GAUGE:b,RADIAL_GAUGE:x}=Ln;return[y,v].map(((e,t)=>{const n=u?b:x,l=function(e,t){const n=e.getColor()({datum:{value:()=>0}});return t?"#595959":n}(i,u);let c=0;(0===t&&d<p||1===t&&d>f)&&(c=Ui({innerRadius:h,outerRadius:m,width:o,height:a}));let y=ln;return(0===t&&s||1===t&&!s)&&(y=un),{type:"radial-oob-indicator",key:e,layout:{displayOrder:2},settings:{component:n,selector:"path",angle:y,radius:g,size:c,fill:l},animations:{enabled:r.enabled,trackBy:e=>e.type}}}))}({services:t}),function({services:e}){const{dockService:t,themeService:n,colorService:i,layoutService:r,animationsService:o}=e,{width:a,height:s}=t.meta.chart.size,{refLines:l}=r.meta,u=n.getStyles(),c=$i(a,s,ln,un),{innerRadius:p,outerRadius:f}=c,d=Ui({innerRadius:p,outerRadius:f,width:a,height:s}),m={type:"radial-custom-ref-line",key:Ln.RADIAL_REFERENCE_LINES,displayOrder:1,settings:{barWidth:d},lines:{radial:l.filter(Wi).map((e=>{var t,n;return{scale:"r",value:e.refLineExpr.value,cId:e.cId,label:{text:e.label,...u.referenceLine.label.name,showValue:e.showValue,showLabel:e.showLabel},radius:c.innerRadius,line:{stroke:i.getPaletteColor(e.paletteColor||{index:e.color}),strokeWidth:(null===(t=e.style)||void 0===t?void 0:t.lineThickness)||2,strokeDasharray:null===(n=e.style)||void 0===n?void 0:n.lineType}}}))},animations:{enabled:o.enabled,trackBy:e=>{const{type:t,cId:n}=e;return"line"===t?`${n}-line`:Math.random()},adjustTweenedNodes(e){e.forEach((e=>{const{type:t,data:n}=e;if("line"===t){const{angle:t,innerRadius:i}=n;e.x1=a/2+Math.cos(t)*i,e.y1=s/2+Math.sin(t)*i,e.x2=a/2+Math.cos(t)*(i+d),e.y2=s/2+Math.sin(t)*(i+d)}}))}}};return m}({services:t})):a.push(function({services:e}){var t;const{dockService:n,layoutService:i,colorService:r,animationsService:o}=e,{width:a,height:s}=n.meta.chart.size,{rangeLimits:l,useSegments:u,segmentInfo:c,qHyperCube:p}=i.meta,{min:f,max:d}=l,m=p.qDataPages[0].qMatrix[0][0].qNum,h=$i(a,s,ln,un).outerRadius;let g;g=m<f?ln:m>d?un:ln+(m-f)/(d-f)*(un-ln);const y=r.getColor()({datum:{value:()=>0}}),v=(null===(t=c.paletteColors[0])||void 0===t?void 0:t.color)||y;return{type:"radial-spark",key:Ln.RADIAL_SPARK,layout:{displayOrder:2},settings:{fill:u?v:y,radius:h,valueAngle:g},animations:{enabled:o.enabled,trackBy:e=>e.type}}}({services:t})),a}const Vr=Math.log(10),Hr={log:(e,t)=>e<=0||t<=0?NaN:Math.log(e)/Math.log(t),log10:e=>e<=0?NaN:Math.log(e)/Vr,getNiceNumber(e){let t;if(0===e)return 0;const n=Math.floor(Math.log(Math.abs(e))/Vr),i=e/10**n;return t=i<=1?1:i<=2?2:i<=5?5:10,t*10**n*(e<0?-1:1)},getSmallNiceNumber(e){let t;if(0===e)return 0;let n=Math.floor(Math.log(Math.abs(e))/Vr);const i=e/10**n;return i<1?(t=5,n--):t=i<2?1:i<5?2:5,t*10**n*(e<0?-1:1)},getGoodNumber(e){let t;if(0===e)return 0;const n=Math.floor(Math.log(Math.abs(e))/Vr),i=e/10**n;return t=Math.ceil(i),7!==t&&9!==t||t++,i>1&&i<=1.5?t=1.5:i>2&&i<=2.5&&(t=2.5),t*10**n*(e<0?-1:1)},calculateTicks(e,t,n,i,r,o){return this.plotSize=e,this.explicitPlotMin=t,this.explicitPlotMax=n,this.minTickSpacingInPixel=i,this.absMax=Math.abs(this.explicitPlotMax),this.absMin=Math.abs(this.explicitPlotMin),this.usedDataRange=this.explicitPlotMax-this.explicitPlotMin,this.maxNumIntervals=this.plotSize/this.minTickSpacingInPixel,this.maxNumTicks=this.maxNumIntervals+1,this.minTickDataSpacing=o||0,this.tickDataSpacing=Math.max(this.usedDataRange/this.maxNumIntervals,this.minTickDataSpacing),this.fontHeight=r,this.tickBaseValue=0,this.spaceUseLimit=.6,0===e?(this.plotMin=this.explicitPlotMin,this.plotMax=this.explicitPlotMax,this.tickDataSpacingNN=this.tickDataSpacing,Xr.call(this),Zr.call(this)):(this.maxNumIntervals<1?Br.call(this):(this.explicitPlotMax>0&&this.explicitPlotMin<0?1===this.maxNumIntervals?_r.call(this,!0):this.maxNumIntervals>=5?zr.call(this):this.maxNumIntervals<2?$r.call(this):Gr.call(this):zr.call(this),this.tickMaxIndex<this.tickMinIndex?(this.tickDataSpacing=Math.max(this.usedDataRange/this.maxNumIntervals,this.minTickDataSpacing),Br.call(this)):Ur.call(this)),Xr.call(this),Zr.call(this))}};function jr(e,t,n){void 0===e&&(e=null!==this.explicitPlotMin),void 0===t&&(t=null!==this.explicitPlotMax),this.tickDataSpacingNN=n?Hr.getGoodNumber(this.tickDataSpacing):Hr.getNiceNumber(this.tickDataSpacing),Kr.apply(this,[e,t])}function zr(){jr.call(this);const e=this.tickMaxIndex-this.tickMinIndex;let t=this.plotMax-this.plotMin;this.spaceUseFactor=t/this.plotRange;let n=this.plotSize*this.tickDataSpacingNN/this.plotRange<this.minTickSpacingInPixel;if(n&&this.maxNumIntervals>=5){for(;this.tickDataSpacing<=this.absMax&&n;)this.tickDataSpacing=Math.max(1.1*this.tickDataSpacingNN,this.minTickDataSpacing),jr.call(this),t=this.plotMax-this.plotMin,this.spaceUseFactor=t/this.plotRange,n=this.plotSize*this.tickDataSpacingNN/this.plotRange<this.minTickSpacingInPixel;if(!n)return}for(this.tickDataSpacing=Math.max(this.usedDataRange/this.maxNumIntervals,this.minTickDataSpacing),(n||e<=2&&this.maxNumIntervals>=2*e)&&jr.apply(this,[void 0,void 0,!0]),t=this.plotMax-this.plotMin,this.spaceUseFactor=t/this.plotRange,n=this.plotSize*this.tickDataSpacingNN/this.plotRange<this.minTickSpacingInPixel;this.tickDataSpacing<=this.absMax&&n;)this.tickDataSpacing=Math.max(1.1*this.tickDataSpacingNN,this.minTickDataSpacing),jr.apply(this,[void 0,void 0,!0]),t=this.plotMax-this.plotMin,this.spaceUseFactor=t/this.plotRange,n=this.plotSize*this.tickDataSpacingNN/this.plotRange<this.minTickSpacingInPixel}function _r(e){e?(this.tickDataSpacingNN=Hr.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=Hr.getNiceNumber(this.absMax),this.tickDataSpacingNN===this.absMax&&(this.tickDataSpacingNN=Hr.getNiceNumber(1.1*this.absMax)))}function Br(){let e;this.tickDataSpacingNN=Hr.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=Hr.getSmallNiceNumber(this.plotRange),this.tickBaseValue=Math.ceil(this.plotMin/e)*e)}function $r(){const e=this.explicitPlotMax>=-this.explicitPlotMin,t=e||null!==this.explicitPlotMin,n=!e||null!==this.explicitPlotMax;jr.apply(this,[t,n,!0]);const i=(this.absMax+(1-this.spaceUseLimit)*this.absMin)/this.spaceUseLimit*1.0001;for(;this.tickDataSpacing<=i&&this.plotSize*this.tickDataSpacingNN/this.plotRange<this.minTickSpacingInPixel;)this.tickDataSpacing=Math.max(1.1*this.tickDataSpacingNN,this.minTickDataSpacing),jr.apply(this,[t,n,!0]);const r=this.plotMax-this.plotMin;this.spaceUseFactor=r/this.plotRange}function Gr(){zr.call(this);const e=this.plotMax-this.plotMin;this.spaceUseFactor=e/this.plotRange}function Ur(){const e=Hr.getNiceNumber(this.tickDataSpacingNN);if(this.tickDataSpacingNN===e||0!==this.tickBaseValue)return;const t=this.tickDataSpacingNN,n=this.tickMinIndex,i=this.tickMaxIndex,r=i-n,o=this.plotMin,a=this.plotMax;this.tickDataSpacingNN=e,Kr.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=n,this.tickMaxIndex=i,this.plotMin=o,this.plotMax=a,this.plotRange=this.plotMax-this.plotMin)}function Wr(){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 Xr(){let e,t;if(this.mainTickValues=[],this.secondaryTickValues=[],Wr.call(this),0===this.plotSize)return;e=this.tickBaseValue;const n=this.tickMaxIndex-this.tickMinIndex;if(!(n<1)){for(t=0;t<=n;t++)this.mainTickValues.push(e+(t+this.tickMinIndex)*this.tickDataSpacingNN);for(e=this.tickBaseValue+this.tickDataSpacingNN/2,t=0;t<n;t++)this.secondaryTickValues.push(e+(t+this.tickMinIndex)*this.tickDataSpacingNN)}}function Kr(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 Zr(){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 Yr({core:e,dockService:t,rangeLimits:n,measureAxisSpacing:i,isRadial:r,isVertical:o,styleService:a}){const s=n.min,l=n.max,{width:u,height:c}=function(e){return{width:e.meta.chart.size.width,height:e.meta.chart.size.height}}(t);let p,f=96*i;if(r)p=Math.min(c,u);else{p=o?c:u;const{chart:t,picassoInstance:n}=e;if(t&&n){const e=t.formatter(Cn.MEASURE),r=n.renderer("svg")(),d=a.query.axis.label.getStyle(),{fontFamily:m,fontSize:h}=d,g=e=>r.measureText({text:e,fontSize:qr({width:u,height:c,fontSize:h}),fontFamily:m}),y=Math.max(96,...[s,l,(l-s)/2].map((t=>g(e(t)).width)));f=o?4*g("M").height:y;f=p/(Math.max(2,p/f/i+1)-1)}}const d=function({plotSize:e,rangeMax:t,rangeMin:n,minTickSpacingInPixel:i}){const r=Hr.calculateTicks(e,n,t,i,20,0);r.tickSpacing;let o=r.mainTickValues;0===o.length&&o.push(r.minTickValue);const a=o[0];o[0]=r.plotMin,a-r.plotMin>=r.tickSpacing/2&&o.splice(1,0,a);const s=r.mainTickValues[r.mainTickValues.length-1];return r.plotMax-s<=r.tickSpacing/2?o[r.mainTickValues.length-1]=Math.round(r.plotMax):o.push(Math.round(r.plotMax)),o}({plotSize:p,rangeMin:s,rangeMax:l,minTickSpacingInPixel:f});return{values:d}}function Jr({isRadial:e,dockService:t,isVertical:n}){return e?!t.config.rtl:!!n||t.config.rtl}function Qr({core:e,services:t,logicalSize:n}){if(!t.layoutService.meta.qHyperCube)throw new Error("Layout is missing a hypercube");const i=Rr({core:e,services:t}),r=function({core:e,services:t}){const{dockService:n,styleService:i,colorService:r,layoutService:o}=t,{rangeLimits:a,measureAxisSpacing:s,gaugetype:l}=o.meta,u=hr({dockService:n,layoutService:o}),c="radial"===l,p=Yr({core:e,dockService:n,rangeLimits:a,measureAxisSpacing:s,isRadial:c,isVertical:u,styleService:i});return{m:{data:{field:"qMeasureInfo/0"},type:"linear",invert:Jr({isRadial:c,dockService:n,isVertical:u}),min:a.min,max:a.max,ticks:{values:p.values}},r:{data:{field:"qMeasureInfo/0"},invert:n.config.rtl,min:a.min,max:a.max},...r.getScales()}}({core:e,services:t});return{scales:r,components:i,formatters:{[Cn.MEASURE]:{data:{field:"qMeasureInfo/0"}}},strategy:{layoutModes:Vn,logicalSize:n}}}const eo={Object_Gauge_RangeIsDefault:{id:"Object.Gauge.RangeIsDefault",locale:{"de-DE":"Max. und Min. auf Standardwerte festgelegt. Sie können über das Eigenschaften-Fenster unter Darstellung > Präsentation geändert werden.","en-US":"Max. and Min. set to default values. You can change them via the properties window under Display > Presentation.","es-ES":"Máx y mín se han configurado como valores predefinidos. Puede cambiarlos en el panel de propiedades en Aspecto > Presentación.","fr-FR":"Les valeurs max. et min. par défaut sont définies. Vous pouvez les modifier via le panneau des propriétés sous Aspect > Présentation.","it-IT":"Il massimo e il minimo vengono impostati sui valori predefiniti. È possibile modificarli nel pannello delle proprietà in Aspetto > Presentazione.","ja-JP":"最大値と最小値は規定値に設定されています。これは、スタイル > プレゼンテーションからプロパティ パネルで変更できます。","ko-KR":"최대 및 최소 값이 기본값으로 설정됩니다. 모양 > 프레젠테이션 아래 속성 패널에서 이를 변경할 수 있습니다.","nl-NL":"Max. en min. zijn ingesteld op standaardwaarden. U kunt deze wijzigen in het eigenschappenvenster onder Uiterlijk > Presentatie.","pl-PL":"Maks. i Min. są ustawione na wartości domyślne. Można je zmienić w panelu właściwości, w obszarze Wygląd > Prezentacja.","pr-BR":"Máx. e mín. estão definidos com valores padrão. É possível alterá-los no painel de propriedades, em Aparência > Apresentação.","ru-RU":"Максимальные и минимальные значения установлены по умолчанию. Эти значения можно изменить на панели свойств в меню Вид > Представление.","sv-SE":"Max och min är inställda på standardvärden. Du kan ändra dem i egenskapspanelen under Utseende > Presentation.","tr-TR":"Maks. ve min. değerleri varsayılan değerlere ayarlanmıştır. Görünüş > Sunum altındaki özellikler panelinden bu değerleri değiştirebilirsiniz.","zh-CN":"最大值和最小值已设置为默认值。您可以在“外观”>“显示”下的属性面板中进行更改。","zh-TW":"最大值與最小值均設為預設值。您可以在 [外觀] > [呈現方式] 之下的屬性面板中變更這些值。"}},Object_Gauge_RangeIsDefaultTitle:{id:"Object.Gauge.RangeIsDefaultTitle",locale:{"de-DE":"Bereich auf Standardwerte eingestellt","en-US":"Range set to default values","es-ES":"Rango fijado a valores predeterminados","fr-FR":"Plage définie sur les valeurs par défaut","it-IT":"Scala impostata sui valori predefiniti","ja-JP":"範囲は規定値に設定されています","ko-KR":"범위가 기본값으로 설정됩니다.","nl-NL":"Bereik ingesteld op standaardwaarden","pl-PL":"Zakres ustawiony na wartości domyślne","pt-BR":"Intervalo definido com valores padrão","ru-RU":"Значения диапазона установлены по умолчанию","sv-SE":"Intervallet har standardvärden","tr-TR":"Varsayılan değerlere ayarlı aralık","zh-CN":"范围设置为默认值","zh-TW":"範圍會設為預設值"}}};function to(e){return{properties:{qHyperCubeDef:{qMeasures:[],qInitialDataFetch:[{qWidth:1,qHeight:1}],qSuppressZero:!1,qSuppressMissing:!0},showTitles:!0,title:"",subtitle:"",footnote:"",measureAxis:{min:0,max:100},orientation:"horizontal",valueMode:"absolute",segmentInfo:{limits:[],colors:[{color:3}]}},data:{targets:[{path:"/qHyperCubeDef",...en(e)}]}}}function no(a){return function(e){if(e&&e.get&&e.add){const t="Object.Gauge.RangeIsDefault";if(e.get(t)!==t)return;Object.keys(eo).forEach((t=>{e.add(eo[t])}))}}(a.translator),{qae:to(a),ext:on(a),component(){const a=(()=>{const r=e(),o=t(),[a,s]=n({});return i((()=>{r.style.overflow="hidden";const e=h();e.use(m),e.component("oob-indicator",Bi),e.component("radial-gauge-needle",Ki),e.component("radial-custom-ref-line",or),e.component("custom-ref-line",lr),e.component("radial-oob-indicator",Zi),e.component("radial-spark",ar),e.component("disclaimer-component",an);const t=e({renderer:{prio:[o.renderer||"svg"]}}),n=t.chart({element:r,data:[],settings:{}});return s({picassoInstance:t,chart:n,cache:wt()}),()=>{n.destroy()}}),[]),a})(),s=xr({core:a}),u=(({core:e,services:a})=>{const[s,u]=n({}),p=t(),d=l(),m=o(),h=r(),{qLocaleInfo:g}=c();return f((async()=>{if(!a)return Promise.resolve();const{colorService:t}=a;return t.initialize({createConfig:()=>({theme:m,layout:h,localeInfo:g,hc:h.qHyperCube,colorProps:{...h.color,auto:!0,useBaseColors:"off",paletteColor:h.paletteProgressColor}})}).then((()=>{const{layoutService:t}=a,n=fr({layout:t.getLayout(),options:p}),i=Qr({core:e,services:a,logicalSize:n});u(i)}))}),[a]),i((()=>{if(a&&a.dockService&&a.layoutService){const{dockService:t,layoutService:n,animationsService:i}=a;i.meta.isSizeChanging=!0;const r=fr({layout:n.getLayout(),options:p});t.update(r||d);const o=Qr({core:e,services:a,logicalSize:r});u(o)}}),[d]),s})({core:a,services:s});pr({core:a,settings:u,services:s}),(({services:e})=>{d((t=>{if(e){const{dockService:n}=e,{width:i,height:r}=n.meta.chart.size;t.snapshotData=t.snapshotData||{content:{size:{w:i,h:r}}},t.snapshotData.content={size:{w:i,h:r}}}return Promise.resolve(t)}))})({services:s})}}}export{no as default};
9
+ e.exports=function(e,t){if(!e||isNaN(+t))return t;var n,r,i,o,a,s,l,u,c,p,f=e.length,d=e.search(/[0-9\-\+#]/),m=d>0?e.substring(0,d):"",h=e.split("").reverse().join(""),g=h.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(n=(t="-"===(e=e.substring(d,b)).charAt(0)?-t:+t)<0?t=-t:0,i=(r=e.match(/[^\d\-\+#]/g))&&r[r.length-1]||".",o=r&&r[1]&&r[0]||",",e=e.split(i),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(o),e[0]=c.join(""),(a=e[0]&&e[0].indexOf("0"))>-1)for(;u[0].length<e[0].length-a;)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(h="",y=(p=t[0]).length%l,f=p.length,b=0;b<f;b++)h+=p.charAt(b),!((b-y+1)%l)&&b<f-l&&(h+=o);t[0]=h}return t[1]=e[1]&&t[1]?i+t[1]:"","0"!==(r=t.join(""))&&""!==r||(n=!1),m+(n?"-":"")+r+x}},kt({exports:{}});var jt="'Source Sans Pro', 'Arial', 'sans-serif'",zt="#333333",_t="#595959",Bt="#737373",$t="#cccccc",Gt="#e6e6e6";function Ut(e){var t={};return[].concat(q(e),q([["","","color"],["object","","fontFamily"],["object","axis.label.name","color",_t],["object","axis.label.name","fontFamily",jt],["object","axis.label.name","fontSize","12px"],["object","axis.line.major","color",$t],["object","axis.line.minor","color",Gt],["object","axis.title","color"],["object","axis.title","fontFamily",jt],["object","axis.title","fontSize","13px"],["object","grid.line.highContrast","color",Gt],["object","grid.line.major","color",$t],["object","grid.line.minor","color",Gt],["object","label.value","color",_t],["object","label.value","fontFamily",jt],["object","label.value","fontSize","12px"],[!1,"label.value","darkColor",_t],[!1,"label.value","lightColor",Gt],["object","outOfRange","color","#999"],["object","legend.title","color",zt],["object","legend.title","fontFamily",jt],["object","legend.title","fontSize","15px"],["object","legend.label","color",_t],["object","legend.label","fontFamily",jt],["object","legend.label","fontSize","13px"],["object","referenceLine.label.name","color",zt],["object","referenceLine.label.name","fontFamily",jt],["object","referenceLine.label.name","fontSize","12px"],["object","referenceLine.outOfBounds","color",Gt],["object","referenceLine.outOfBounds","fontFamily",jt],["object","referenceLine.outOfBounds","fontSize","12px"],["object","referenceLine.outOfBounds","backgroundColor",Bt,function(e){return"transparent"===e?Bt:e}]])).reduce((function(e,n){var r="".concat(n[0],"-").concat(n[1],"-").concat(n[2],"}");return t[r]||(t[r]=!0,e.push(n)),e}),[]).sort((function(e,t){return(e[0].split?e[0].split(".").length:0)-(t[0].split?t[0].split(".").length:0)}))}var Wt=function(e){return e};function Xt(e){var t=e.theme,n=e.id,r=e.transform,i=e.extend,o=e.matrix,a={},s=r.reduce((function(e,t){var n=x(t,2),r=n[0],i=n[1];return e[r]=i,e}),{});return o.forEach((function(e){var r=x(e,5),i=r[0],o=r[1],l=r[2],u=r[3],c=r[4],p=void 0===c?function(e){return e}:c,f=function(e){var t=e.theme,n=e.base,r=e.path,i=e.attribute,o=e.defaultValue,a=void 0===o?void 0:o;if(!t||!1===n)return a;var s=t.getStyle(n,r,i);return void 0===s?a:s}({theme:t,base:"object"===i&&n?"".concat("object",".").concat(n):i,path:o,attribute:l,defaultValue:u}),d=(s["".concat(o,".").concat(l)]||Wt)(p(f));It(a,[o,l].filter(Boolean).join("."),d)})),i.forEach((function(e){var t=x(e,2),n=t[0],r=t[1];It(a,n,r)})),a}function Kt(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Zt,Yt={exports:{}};var Jt=(Zt||(Zt=1,self,Yt.exports=(()=>{var e={229:e=>{var t=Object.prototype.hasOwnProperty,n=Object.prototype.toString,r=Object.defineProperty,i=Object.getOwnPropertyDescriptor,o=function(e){return"function"==typeof Array.isArray?Array.isArray(e):"[object Array]"===n.call(e)},a=function(e){if(!e||"[object Object]"!==n.call(e))return!1;var r,i=t.call(e,"constructor"),o=e.constructor&&e.constructor.prototype&&t.call(e.constructor.prototype,"isPrototypeOf");if(e.constructor&&!i&&!o)return!1;for(r in e);return void 0===r||t.call(e,r)},s=function(e,t){r&&"__proto__"===t.name?r(e,t.name,{enumerable:!0,configurable:!0,value:t.newValue,writable:!0}):e[t.name]=t.newValue},l=function(e,n){if("__proto__"===n){if(!t.call(e,n))return;if(i)return i(e,n).value}return e[n]};e.exports=function e(){var t,n,r,i,u,c,p=arguments[0],f=1,d=arguments.length,m=!1;for("boolean"==typeof p&&(m=p,p=arguments[1]||{},f=2),(null==p||"object"!=typeof p&&"function"!=typeof p)&&(p={});f<d;++f)if(null!=(t=arguments[f]))for(n in t)r=l(p,n),p!==(i=l(t,n))&&(m&&i&&(a(i)||(u=o(i)))?(u?(u=!1,c=r&&o(r)?r:[]):c=r&&a(r)?r:{},s(p,{name:n,newValue:e(m,c,i)})):void 0!==i&&s(p,{name:n,newValue:i}));return p}},645:(e,t)=>{(()=>{var e={229:e=>{var t=Object.prototype.hasOwnProperty,n=Object.prototype.toString,r=Object.defineProperty,i=Object.getOwnPropertyDescriptor,o=function(e){return"function"==typeof Array.isArray?Array.isArray(e):"[object Array]"===n.call(e)},a=function(e){if(!e||"[object Object]"!==n.call(e))return!1;var r,i=t.call(e,"constructor"),o=e.constructor&&e.constructor.prototype&&t.call(e.constructor.prototype,"isPrototypeOf");if(e.constructor&&!i&&!o)return!1;for(r in e);return void 0===r||t.call(e,r)},s=function(e,t){r&&"__proto__"===t.name?r(e,t.name,{enumerable:!0,configurable:!0,value:t.newValue,writable:!0}):e[t.name]=t.newValue},l=function(e,n){if("__proto__"===n){if(!t.call(e,n))return;if(i)return i(e,n).value}return e[n]};e.exports=function e(){var t,n,r,i,u,c,p=arguments[0],f=1,d=arguments.length,m=!1;for("boolean"==typeof p&&(m=p,p=arguments[1]||{},f=2),(null==p||"object"!=typeof p&&"function"!=typeof p)&&(p={});f<d;++f)if(null!=(t=arguments[f]))for(n in t)r=l(p,n),p!==(i=l(t,n))&&(m&&i&&(a(i)||(u=o(i)))?(u?(u=!1,c=r&&o(r)?r:[]):c=r&&a(r)?r:{},s(p,{name:n,newValue:e(m,c,i)})):void 0!==i&&s(p,{name:n,newValue:i}));return p}}},n={};function r(t){var i=n[t];if(void 0!==i)return i.exports;var o=n[t]={exports:{}};return e[t](o,o.exports,r),o.exports}r.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return r.d(t,{a:t}),t},r.d=(e,t)=>{for(var n in t)r.o(t,n)&&!r.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},r.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var i={};(()=>{r.r(i),r.d(i,{default:()=>Ee});var e=r(229),t=r.n(e);const n=function(e,t,n){if(!t)return!1;var r,i=t.split("."),o=i[i.length-1],a=e;for(r=0;r<i.length-1;++r)void 0===a[i[r]]&&(a[i[r]]=Number.isNaN(+i[r+1])?{}:[]),a=a[i[r]];if(void 0!==n){var s=a[o];return a[o]=n,{updated:n,previous:s}}return delete a[o],!1},o=function(e,t,n){var r,i=t.split("."),o=e;if(void 0===o)return n;for(r=0;r<i.length;++r){if(void 0===o[i[r]])return n;o=o[i[r]]}return o},a={EXPRESSIONS:{observed:"",trend:"STL_Trend",seasonal:"STL_Seasonal",residual:"STL_Residual"},OPTIONS:[{value:"observed",translation:"cao.trendDecomposition.parameters.decomposition.observed"},{value:"trend",translation:"cao.trendDecomposition.parameters.decomposition.trend"},{value:"seasonal",translation:"cao.trendDecomposition.parameters.decomposition.seasonal"},{value:"residual",translation:"cao.trendDecomposition.parameters.decomposition.residual"}]};var s="".concat(" ","(").concat(" "),l="".concat(" ",")").concat(" ");function u(e){return s+e+l}function c(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(e.qLibraryId){var n=function(e,t){if(!t)return null;var n,r;for(n=0;n<t.length;n++)if((r=t[n]).qInfo.qId===e)return r;return null}(e.qLibraryId,t.dimensionList);return n&&n.qData.info[0].qTags.indexOf("$numeric")>-1}var r=function(e,t){if(!t)return null;var n,r,i=function(e){var t=e.trim();"="===t.charAt(0)&&(t=(t=t.substring(1)).trim());var n=t.length-1;return"["===t.charAt(0)&&"]"===t.charAt(n)&&(t=(t=t.substring(1,n)).trim()),t}(e);for(n=0;n<t.length;n++){if((r=t[n]).qName===i)return r;if(r.qDerivedFieldData)for(var o=0;o<r.qDerivedFieldData.qDerivedFieldLists.length;++o)for(var a=r.qDerivedFieldData.qDerivedFieldLists[o],s=0;s<a.qFieldDefs.length;++s){var l=a.qFieldDefs[s];if(l.qName===i)return l}}return null}(e.qDef.qFieldDefs[0],t.fieldList);return r&&r.qTags.indexOf("$numeric")>-1}function p(e){return!(!e.fullAccumulation&&!e.fullRange)}function f(e,t){var n=e.crossAllDimensions;return 2===t&&n?"RowNo(Total)":"RowNo()"}function d(e){var t=function(e){return e?(e=function(e){return e.replace(/\/\*[^]*?\*\//g,"")}(e=function(e){return e.replace(/\/\/(.*)$/gm,"")}(e))).trim():""}(e),n=t.trim();return"="===n.substring(0,1)?n.substring(1).trim():n}function m(){return"[$(=Replace(GetObjectField(".concat(arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,"),']',']]'))]")}function h(e,t){var n=e.crossAllDimensions;return 2===t&&n?"Above(Total ":"Above("}function g(e){return void 0===e?")":", 0, ".concat(e,")")}function y(e){return"Replace(Replace(".concat(e,",'''',''''''),'$','$''&''')")}function v(e,t){return e?"".concat(t,'={">=$(=Min(').concat(t,"))<=$(=Max(").concat(t,'))"}'):"".concat(t,'={"=Only({1}').concat(t,")>='$(=").concat(y("MinString(".concat(t,")")),")' and Only({1}").concat(t,")<='$(=").concat(y("MaxString(".concat(t,")")),")'\"}")}function b(e){var t=e.modifier,n=void 0===t?{}:t,r=e.dimensions,i=e.dimensionAndFieldList,o=e.funcComp,a=void 0===o?"Sum":o,s=e.valueComp,l=void 0===s?"0":s;if(!n.showExcludedValues)return"";if(r&&1===r.length){var u=v(c(r[0],i),m(0));return"".concat(a,"({1<").concat(u,">}").concat(l,")")}if(r&&2===r.length){var p=c(r[0],i),f=c(r[1],i),d=m(0),h=m(1),g=v(p,d),y=v(f,h);return"".concat(a,"({1<").concat(g,",").concat(y,">}").concat(l,")")}return"".concat(a,"({1}").concat(l,")")}function x(e){return"".concat(e,"(")}function q(e){var t=e.properties,n=e.layout;return o(t,"qHyperCubeDef.qDimensions",o(n,"qHyperCube.qDimensionInfo",[])).length}const D={isFullRange:p,getNumDimensions:q,getExpressionWithExcludedComp:function(e){var t=e.expression,n=e.modifier,r=e.dimensions,i=e.dimensionAndFieldList,o=e.treatMissingAsNull,a=u(d(t));if(!n.showExcludedValues)return a;var s=b({modifier:n,dimensions:r,dimensionAndFieldList:i}),l=o?"":", 0";if(r&&1===r.length){var c=m(0);return"If(Count(".concat(c,") > 0, ").concat(a," + ").concat(s).concat(l,")")}if(r&&2===r.length){var p=m(0),f=m(1);return"If(Count(".concat(p,") * Count(").concat(f,") > 0, ").concat(a," + ").concat(s).concat(l,")")}return a},getRowNoComp:f,getNumStepComp:function(e,t){if(!p(e)){var n=e.steps;return"number"!=typeof n||Number.isNaN(n)?6:n}return f(e,t)},getAboveCompPrefix:h,getAboveCompSuffix:g,getAboveComp:function(e,t,n,r){return h(e,t)+n+g(r)},getFunctionPrefix:x,getFunctionSuffix:function(){return")"},getRangeComp:function(e,t){return x(e)+t+")"},getAggrComp:function(e,t,n){return"Aggr(".concat(e,", ").concat(t,", ").concat(n,")")},getExcludedComp:b,needDimension:function(e){var t=e.modifier,n=e.properties,r=e.layout,i=function(e){return void 0===e.primaryDimension?e.accumulationDimension:e.primaryDimension}(t);return 0===i&&2===q({properties:n,layout:r})},getDimComp:function(e,t){var n=function(e){return e[arguments.length>1&&void 0!==arguments[1]?arguments[1]:0].qDef.qSortCriterias[0]}(e,t),r=m(t);if(!n.qSortByExpression&&!n.qSortByNumeric&&!n.qSortByAscii)return r;var i=["Descending","Ascending"],o=n.qSortByNumeric?"(Numeric, ".concat(i[(n.qSortByNumeric+1)/2],")"):"",a=n.qSortByAscii?"(Text, ".concat(i[(n.qSortByAscii+1)/2],")"):"";return n.qSortByNumeric&&n.qSortByAscii?"(".concat(r,", ").concat(o,", ").concat(a,")"):n.qSortByNumeric?"(".concat(r,", ").concat(o,")"):n.qSortByAscii?"(".concat(r,", ").concat(a,")"):r},simplifyExpression:d,extractInputExpression:function(e){var t=e.outputExpression;if(e.modifier){var n=t.indexOf(s);if(-1!==n){var r=t.indexOf(l);if(-1!==r)return t.substring(n+s.length,r)}}},initModifier:function(e,t){Object.keys(t).forEach((function(n){void 0===e[n]&&(e[n]=t[n])}))},isNumeric:c,isApplicable:function(e){var t=e.properties,n=e.layout,r=e.minDimensions,i=void 0===r?1:r,o=e.maxDimensions,a=void 0===o?2:o;if(!t&&!n)return!0;var s=q({properties:t,layout:n});return s>=i&&s<=a},getExpressionWithMarkers:u,canExtract:function(e){var t=e.indexOf(s),n=e.indexOf(l);return t>-1&&n>-1&&t<n},getDimDefWithWrapper:m,getFieldWithWrapper:function(e){var t=e?e.replace(/]/g,"]]"):e;return"[".concat(t,"]")},generateTSDExpression:function(e,t,n){var r=t||e.outputExpression;if(e.base&&e.base.qDef&&(r=t!==e.base.qDef?t:e.base.qDef),"observed"!==e.decomposition){var i=n.qHyperCubeDef.qMeasures.find((function(t){return t.qDef.base&&t.qDef.base.qLibraryId&&e.base&&e.base.qLibraryId?t.qDef.base.qLibraryId===e.base.qLibraryId:null}));i&&t!==i.qDef.qLabel&&(r=i.qLibraryId||i.qDef.base.qLibraryId?"[".concat(i.qDef.qLabel,"]"):i.qDef.base.qDef);var o=function(e){var t=a.OPTIONS.find((function(t){return t.value===e.decomposition}));return t?a.EXPRESSIONS[t.value]:""}(e);r=r.startsWith("=")?r.substr(1):r,r="".concat(o,"(").concat(r,", ").concat(e.steps,")")}return r},getDecomposition:function(e){var t="observed";return Object.values(a.EXPRESSIONS).find((function(n){var r=e.qDef.base.qDef.toLowerCase()||e.qDef.qDef.toLowerCase();return a.EXPRESSIONS[n]&&r.includes(a.EXPRESSIONS[n].toLowerCase())&&(t=n),n})),t}};function S(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function M(e){return M="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},M(e)}var A=t().bind(null,!0),I={},w=Array.isArray;function k(e){return null!=e&&!Array.isArray(e)&&"object"===M(e)}function C(e){return void 0===e}function L(e,t){return"function"==typeof e[t]||"$$"===t.substring(0,2)||"_"===t.substring(0,1)}function E(e,t){var n,r=t.substring(1).split("/").slice(0,-1);return r.forEach((function(t,i){if(i!==r.length){n=+t;var o=Number.isNaN(n)?{}:[];e[n||t]=C(e[n||t])?o:e[t],e=e[n||t]}})),e}function N(e,t){var n=!0;if(k(e)&&k(t))return Object.keys(e).length===Object.keys(t).length&&(Object.keys(e).forEach((function(r){N(e[r],t[r])||(n=!1)})),n);if(w(e)&&w(t)){if(e.length!==t.length)return!1;for(var r=0,i=e.length;r<i;r+=1)if(!N(e[r],t[r]))return!1;return!0}return e===t}I.generate=function(e,t,n){n=n||"";var r=[];return Object.keys(t).forEach((function(i){var o=function(e){return e?A({},{val:e}).val:e}(t[i]),a=e[i],s="".concat(n,"/").concat(i);N(o,a)||L(t,i)||(C(a)?r.push({op:"add",path:s,value:o}):k(o)&&k(a)?r=r.concat(I.generate(a,o,s)):w(o)&&w(a)?r=r.concat(function(e,t,n){var r=[],i=e.slice(),o=-1;function a(e,t,n){if(e[n]&&C(e[n].qInfo))return null;if(e[n]&&e[n].qInfo.qId===t)return n;for(var r=0,i=e.length;r<i;r+=1)if(e[r]&&e[r].qInfo.qId===t)return r;return-1}if(N(t,i))return r;if(!C(t[0])&&C(t[0].qInfo))return r.push({op:"replace",path:n,value:t}),r;for(var s=i.length-1;s>=0;s-=1)-1===(o=a(t,i[s].qInfo&&i[s].qInfo.qId,s))?(r.push({op:"remove",path:"".concat(n,"/").concat(s)}),i.splice(s,1)):r=r.concat(I.generate(i[s],t[o],"".concat(n,"/").concat(s)));for(var l=0,u=t.length;l<u;l+=1)-1===(o=a(i,t[l].qInfo&&t[l].qInfo.qId))?(r.push({op:"add",path:"".concat(n,"/").concat(l),value:t[l]}),i.splice(l,0,t[l])):o!==l&&(r.push({op:"move",path:"".concat(n,"/").concat(l),from:"".concat(n,"/").concat(o)}),i.splice(l,0,i.splice(o,1)[0]));return r}(a,o,s)):r.push({op:"replace",path:"".concat(n,"/").concat(i),value:o}))})),Object.keys(e).forEach((function(i){C(t[i])&&!L(e,i)&&r.push({op:"remove",path:"".concat(n,"/").concat(i)})})),r},I.apply=function(e,t){t.forEach((function(t){var n,r,i=E(e,t.path),o=t.path.split("/").splice(-1)[0],a=o&&Number.isNaN(+o)?i[o]:i[+o]||i,s=t.from?t.from.split("/").splice(-1)[0]:null;if("/"===t.path&&(i=null,a=e),"add"===t.op||"replace"===t.op)if(w(i))"-"===o&&(o=i.length),i.splice(+o,"add"===t.op?0:1,t.value);else if(w(a)&&w(t.value)){var l,u=t.value.slice();a.length=0,(l=a).push.apply(l,function(e){if(Array.isArray(e))return S(e)}(r=u)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(r)||function(e,t){if(e){if("string"==typeof e)return S(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?S(e,t):void 0}}(r)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}())}else if(k(a)&&k(t.value))n=a,Object.keys(n).forEach((function(e){Object.getOwnPropertyDescriptor(n,e).configurable&&!L(n,e)&&delete n[e]})),A(a,t.value);else{if(!i)throw new Error("Patchee is not an object we can patch");i[o]=t.value}else if("move"===t.op){var c=E(e,t.from);w(i)?i.splice(+o,0,c.splice(+s,1)[0]):(i[o]=c[s],delete c[s])}else"remove"===t.op&&(w(i)?i.splice(+o,1):delete i[o])}))},I.clone=function(e){return A({},e)},I.createPatch=function(e,t,n){var r={op:e.toLowerCase(),path:n};return"move"===r.op?r.from=t:void 0!==t&&(r.value=t),r},I.updateObject=function(e,t){Object.keys(e).length?I.apply(e,I.generate(e,t)):A(e,t)};const P=I,O=function(e,n,r){if(!e)return Promise.resolve();var i=P.generate(n,r);return t()(!0,n,r),i&&i.length?(i=i.map((function(e){return{qOp:e.op,qValue:JSON.stringify(e.value),qPath:e.path}})),e.applyPatches(i,!0)):Promise.resolve()};var F="accumulation";function T(e,t){var n=o(e,t);if(n)for(var r=0;r<n.length;r++)if(n[r].type===F)return n[r]}function R(e,t){var n=function(e,t){var n=o(e,t);if(!n)return-1;for(var r=0;r<n.length;r++)if(n[r].type===F)return r;return-1}(e,t);return n>-1?"".concat(t,".").concat(n):t}var V={type:"accumulation",disabled:!1,accumulationDimension:0,crossAllDimensions:!1,showExcludedValues:!0,fullAccumulation:!1,steps:6,outputExpression:""};const H={translationKey:"properties.modifier.accumulation",needDimension:D.needDimension,isApplicable:function(e){var t=e.properties,n=e.layout;return D.isApplicable({properties:t,layout:n,minDimensions:1,maxDimensions:2})},generateExpression:function(e){var t=e.expression,n=e.modifier,r=e.properties,i=e.layout,a=e.numDimensions,s=e.dimensionAndFieldList;if(!n)return t;var l=a;void 0===l&&(l=D.getNumDimensions({properties:r,layout:i}));var u=o(r,"qHyperCubeDef.qDimensions",[]),c=D.getExpressionWithExcludedComp({expression:t,modifier:n,dimensions:u,dimensionAndFieldList:s}),p=D.getNumStepComp(n,l),f=D.getAboveComp(n,l,c,p),d=D.getRangeComp("RangeSum",f);if(D.needDimension({modifier:n,properties:r,layout:i})){var m=D.getDimComp(u,1),h=D.getDimComp(u,0),g=D.getAggrComp(d,m,h);d=n.showExcludedValues?D.getExcludedComp({modifier:n,dimensions:u,dimensionAndFieldList:s,valueComp:g}):g}return d},extractInputExpression:D.extractInputExpression,initModifier:function(e){D.initModifier(e,V)},enableTotalsFunction:function(){return!1},propertyPanelDef:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n={type:"items",items:{disclaimer:{component:"text",translation:t.disclaimer||"properties.modifier.accumulation.disclaimer",show:function(e,t){return!D.isApplicable({properties:t.properties})}},settings:{type:"items",items:{primaryDimension:{refFn:function(t){return"".concat(R(t,e),".accumulationDimension")},type:"integer",translation:t.primaryDimension||"properties.modifier.primaryDimension",title:{translation:t.primaryDimensionTooltip||"properties.modifier.accumulation.primaryDimension.tooltip"},component:"dropdown",schemaIgnore:!0,defaultValue:1,options:function(e,t){return t.layout.qHyperCube.qDimensionInfo.map((function(e,t){return{value:t,label:e.qGroupFallbackTitles[0]}}))},show:function(e,t){return t.layout.qHyperCube.qDimensionInfo.length>1}},crossAllDimensions:{refFn:function(t){return"".concat(R(t,e),".crossAllDimensions")},type:"boolean",translation:t.crossAllDimensions||"properties.modifier.crossAllDimensions",title:{translation:t.crossAllDimensionsTooltip||"properties.modifier.accumulation.crossAllDimensions.tooltip"},schemaIgnore:!0,defaultValue:!1,show:function(e,t){return t.layout.qHyperCube.qDimensionInfo.length>1}},fullRange:{refFn:function(t){return"".concat(R(t,e),".fullAccumulation")},type:"boolean",translation:t.range||"properties.modifier.range",component:"dropdown",schemaIgnore:!0,defaultValue:!1,options:[{value:!0,translation:t.rangeFull||"properties.modifier.range.full"},{value:!1,translation:t.rangeCustom||"properties.modifier.range.custom"}]},steps:{refFn:function(t){return"".concat(R(t,e),".steps")},type:"integer",translation:t.rangeSteps||"properties.modifier.range.steps",schemaIgnore:!0,defaultValue:6,change:function(t){var n=T(t,e);if(n){var r=n.steps;n.steps="number"!=typeof r||Number.isNaN(r)?6:Math.abs(r)}},show:function(t){var n=T(t,e);return n&&!n.fullAccumulation}},showExcludedValues:{refFn:function(t){return"".concat(R(t,e),".showExcludedValues")},type:"boolean",translation:t.showExcludedValues||"properties.modifier.showExcludedValues",schemaIgnore:!0,defaultValue:!0}},show:function(e,t){return D.isApplicable({properties:t.properties})}}},show:function(t,n,r){var i=r.ext.support.modifiers;if(!Array.isArray(i)||-1===i.indexOf(F))return!1;var o=T(t,e);return o&&!o.disabled}};return n}};var j="movingAverage";function z(e,t){var n=o(e,t);if(n)for(var r=0;r<n.length;r++)if(n[r].type===j)return n[r]}function _(e,t){var n=function(e,t){var n=o(e,t);if(!n)return-1;for(var r=0;r<n.length;r++)if(n[r].type===j)return r;return-1}(e,t);return n>-1?"".concat(t,".").concat(n):t}var B={type:"movingAverage",disabled:!1,primaryDimension:0,crossAllDimensions:!1,showExcludedValues:!0,fullRange:!1,steps:6,outputExpression:"",nullSuppression:!1};const $={translationKey:"properties.modifier.movingAverage",needDimension:D.needDimension,isApplicable:function(e){var t=e.properties,n=e.layout;return D.isApplicable({properties:t,layout:n,minDimensions:1,maxDimensions:2})},generateExpression:function(e){var t,n=e.expression,r=e.modifier,i=e.properties,a=e.layout,s=e.numDimensions,l=e.dimensionAndFieldList;if(!r)return n;var u=s;void 0===u&&(u=D.getNumDimensions({properties:i,layout:a}));var c=o(i,"qHyperCubeDef.qDimensions",[]),p=r.showExcludedValues&&r.nullSuppression,f=D.getExpressionWithExcludedComp({expression:n,modifier:r,dimensions:c,dimensionAndFieldList:l,treatMissingAsNull:p}),d=D.getNumStepComp(r,u),m=D.getAboveComp(r,u,f,d);if(r.nullSuppression)t=D.getRangeComp("RangeAvg",m);else{var h=D.getRangeComp("RangeSum",m),g=function(e,t){var n=D.getRowNoComp(e,t);if(!D.isFullRange(e)){var r=e.steps,i="number"!=typeof r||Number.isNaN(r)?6:r;return"RangeMin(".concat(i,", ").concat(n,")")}return n}(r,u);t="".concat(h," / ").concat(g)}var y=t;if(D.needDimension({modifier:r,properties:i,layout:a})){var v=D.getDimComp(c,1),b=D.getDimComp(c,0),x=D.getAggrComp(y,v,b);y=r.showExcludedValues?D.getExcludedComp({modifier:r,dimensions:c,dimensionAndFieldList:l,funcComp:"Only",valueComp:x}):x}return y},extractInputExpression:D.extractInputExpression,initModifier:function(e){D.initModifier(e,B)},enableTotalsFunction:function(){return!1},propertyPanelDef:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n={type:"items",items:{disclaimer:{component:"text",translation:t.disclaimer||"properties.modifier.movingAverage.disclaimer",show:function(e,t){return!D.isApplicable({properties:t.properties})}},settings:{type:"items",items:{primaryDimension:{refFn:function(t){return"".concat(_(t,e),".primaryDimension")},type:"integer",translation:t.primaryDimension||"properties.modifier.primaryDimension",title:{translation:t.primaryDimensionTooltip||"properties.modifier.movingAverage.primaryDimension.tooltip"},component:"dropdown",schemaIgnore:!0,defaultValue:1,options:function(e,t){return t.layout.qHyperCube.qDimensionInfo.map((function(e,t){return{value:t,label:e.qGroupFallbackTitles[0]}}))},show:function(e,t){return t.layout.qHyperCube.qDimensionInfo.length>1}},crossAllDimensions:{refFn:function(t){return"".concat(_(t,e),".crossAllDimensions")},type:"boolean",translation:t.crossAllDimensions||"properties.modifier.crossAllDimensions",title:{translation:t.crossAllDimensionsTooltip||"properties.modifier.movingAverage.crossAllDimensions.tooltip"},schemaIgnore:!0,defaultValue:!1,show:function(e,t){return t.layout.qHyperCube.qDimensionInfo.length>1}},fullRange:{refFn:function(t){return"".concat(_(t,e),".fullRange")},type:"boolean",translation:t.range||"properties.modifier.range",component:"dropdown",schemaIgnore:!0,defaultValue:!1,options:[{value:!0,translation:t.rangeFull||"properties.modifier.range.full"},{value:!1,translation:t.rangeCustom||"properties.modifier.range.custom"}]},steps:{refFn:function(t){return"".concat(_(t,e),".steps")},type:"integer",translation:t.rangeSteps||"properties.modifier.range.steps",schemaIgnore:!0,defaultValue:6,change:function(t){var n=z(t,e);if(n){var r=n.steps;n.steps="number"!=typeof r||Number.isNaN(r)?6:Math.abs(r)}},show:function(t){var n=z(t,e);return n&&!n.fullRange}},showExcludedValues:{refFn:function(t){return"".concat(_(t,e),".showExcludedValues")},type:"boolean",translation:t.showExcludedValues||"properties.modifier.showExcludedValues",schemaIgnore:!0,defaultValue:!0},nullSuppression:{refFn:function(t){return"".concat(_(t,e),".nullSuppression")},type:"boolean",translation:t.showNull||"properties.dimensions.showNull",schemaIgnore:!0,defaultValue:!1,inverted:!0}},show:function(e,t){return D.isApplicable({properties:t.properties})}}},show:function(t,n,r){var i=r.ext.support.modifiers;if(!Array.isArray(i)||-1===i.indexOf(j))return!1;var o=z(t,e);return o&&!o.disabled}};return n}};var G="timeSeriesDecomposition";function U(e,t){var n=o(e,t);if(n)for(var r=0;r<n.length;r++)if(n[r].type===G)return n[r]}function W(e,t){var n=function(e,t){var n=o(e,t);if(!n)return-1;for(var r=0;r<n.length;r++)if(n[r].type===G)return r;return-1}(e,t);return n>-1?"".concat(t,".").concat(n):t}var X={type:"timeSeriesDecomposition",disabled:!1,decomposition:"",steps:2,outputExpression:""};const K={translationKey:"properties.modifier.timeSeriesDecomposition",needDimension:D.needDimension,isApplicable:function(e){var t=e.properties,n=e.layout;return D.isApplicable({properties:t,layout:n,minDimensions:1,maxDimensions:2})},generateExpression:function(e){var t=e.expression,n=e.modifier,r=e.properties;return n?D.generateTSDExpression(n,t,r):t},extractInputExpression:D.extractInputExpression,initModifier:function(e,t){D.initModifier(e,X),""===e.decomposition&&t&&(e.decomposition=D.getDecomposition(t))},propertyPanelDef:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n={type:"items",items:{disclaimer:{component:"text",translation:t.timeSeriesDecomposition||"properties.modifier.timeSeriesDecomposition",show:function(e,t){return!D.isApplicable({properties:t.properties})}},settings:{type:"items",items:{decomposition:{refFn:function(t){return"".concat(W(t,e),".decomposition")},type:"string",translation:t.modifierTrendDecompositionDecomposition||"properties.modifier.trendDecomposition.decomposition",component:"dropdown",schemaIgnore:!0,defaultValue:t.trendDecompositionParametersDecompositionObserved||"cao.trendDecomposition.parameters.decomposition.observed",options:a.OPTIONS},steps:{refFn:function(t){return"".concat(W(t,e),".steps")},type:"integer",translation:t.modifierTimeSeriesDecompositionPeriods||"properties.modifier.timeSeriesDecomposition.periods",schemaIgnore:!0,defaultValue:2,change:function(t,n){var r=U(t,e);if(r){var i=r.steps;r.steps="number"!=typeof i||Number.isNaN(i)?2:Math.abs(i),n.properties.qHyperCubeDef.qMeasures=n.properties.qHyperCubeDef.qMeasures.map((function(e){return e.qDef.modifiers.map((function(e){return"timeSeriesDecomposition"===e.type?e.steps=i:e.steps=e.steps,e})),e}))}},show:function(t){var n=U(t,e);return n&&!n.fullRange}}},show:function(e,t){return D.isApplicable({properties:t.properties})}}},show:function(t,n,r){var i=r.ext.support.modifiers;if(!Array.isArray(i)||-1===i.indexOf(G))return!1;var o=U(t,e);return o&&!o.disabled}};return n}};var Z="difference";function Y(e,t){var n=o(e,t);if(n)for(var r=0;r<n.length;r++)if(n[r].type===Z)return n[r]}function J(e,t){var n=function(e,t){var n=o(e,t);if(!n)return-1;for(var r=0;r<n.length;r++)if(n[r].type===Z)return r;return-1}(e,t);return n>-1?"".concat(t,".").concat(n):t}var Q={type:"difference",disabled:!1,primaryDimension:0,crossAllDimensions:!1,showExcludedValues:!0,outputExpression:""};const ee={translationKey:"properties.modifier.difference",needDimension:D.needDimension,isApplicable:function(e){var t=e.properties,n=e.layout;return D.isApplicable({properties:t,layout:n,minDimensions:1,maxDimensions:2})},extractInputExpression:D.extractInputExpression,generateExpression:function(e){var t=e.expression,n=e.modifier,r=e.properties,i=e.layout,a=e.numDimensions,s=e.dimensionAndFieldList;if(!n)return t;var l=a;void 0===l&&(l=D.getNumDimensions({properties:r,layout:i}));var u=o(r,"qHyperCubeDef.qDimensions",[]),c=D.getExpressionWithExcludedComp({expression:t,modifier:n,dimensions:u,dimensionAndFieldList:s}),p=D.getAboveComp(n,l,c),f="".concat(c," - ").concat(p);if(D.needDimension({modifier:n,properties:r,layout:i})){var d=D.getDimComp(u,1),m=D.getDimComp(u,0),h=D.getAggrComp(f,d,m);f=n.showExcludedValues?D.getExcludedComp({modifier:n,dimensions:u,dimensionAndFieldList:s,funcComp:"Only",valueComp:h}):h}return f},initModifier:function(e){Object.keys(Q).forEach((function(t){void 0===e[t]&&(e[t]=Q[t])}))},enableTotalsFunction:function(){return!1},propertyPanelDef:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n={type:"items",items:{disclaimer:{component:"text",translation:t.disclaimer||"properties.modifier.difference.disclaimer",show:function(e,t){return!D.isApplicable({properties:t.properties})}},settings:{type:"items",items:{primaryDimension:{refFn:function(t){return"".concat(J(t,e),".primaryDimension")},type:"integer",translation:t.primaryDimension||"properties.modifier.primaryDimension",title:{translation:t.primaryDimensionTooltip||"properties.modifier.difference.primaryDimension.tooltip"},component:"dropdown",schemaIgnore:!0,defaultValue:1,options:function(e,t){return t.layout.qHyperCube.qDimensionInfo.map((function(e,t){return{value:t,label:e.qGroupFallbackTitles[0]}}))},show:function(e,t){return t.layout.qHyperCube.qDimensionInfo.length>1}},crossAllDimensions:{refFn:function(t){return"".concat(J(t,e),".crossAllDimensions")},type:"boolean",translation:t.crossAllDimensions||"properties.modifier.crossAllDimensions",title:{translation:t.crossAllDimensionsTooltip||"properties.modifier.difference.crossAllDimensions.tooltip"},schemaIgnore:!0,defaultValue:!1,show:function(e,t){return t.layout.qHyperCube.qDimensionInfo.length>1}},showExcludedValues:{refFn:function(t){return"".concat(J(t,e),".showExcludedValues")},type:"boolean",translation:t.showExcludedValues||"properties.modifier.showExcludedValues",schemaIgnore:!0,defaultValue:!0}},show:function(e,t){return D.isApplicable({properties:t.properties})}}},show:function(t,n,r){var i=r.ext.support.modifiers;if(!Array.isArray(i)||-1===i.indexOf(Z))return!1;var o=Y(t,e);return o&&!o.disabled}};return n}};var te="normalization";function ne(e,t){var n=o(e,t);if(n)for(var r=0;r<n.length;r++)if(n[r].type===te)return n[r]}function re(e,t){var n=function(e,t){var n=o(e,t);if(!n)return-1;for(var r=0;r<n.length;r++)if(n[r].type===te)return r;return-1}(e,t);return n>-1?"".concat(t,".").concat(n):t}function ie(e,t){for(var n=0;n<e.length;n++)if(e[n].value===t)return n;return-1}var oe={type:"normalization",disabled:!1,primaryDimension:0,outputExpression:"",dimensionalScope:2,selectionScope:2};function ae(e){return 2===e?"{1}":""}function se(e,t,n){return 1===e?"{$<".concat(D.getFieldWithWrapper(t),"={'").concat(n,"'}>}"):""}function le(e,t){return 0===e&&t>1||2===e?"Total":""}function ue(e,t,n){return 0===e&&t>1?"<".concat(D.getDimDefWithWrapper(n),">"):""}const ce={translationKey:"properties.modifier.normalization",needDimension:function(){return!0},isApplicable:function(e){var t=e.properties,n=e.layout;return D.isApplicable({properties:t,layout:n,minDimensions:1,maxDimensions:2})},extractInputExpression:D.extractInputExpression,generateExpression:function(e){var t=e.expression,n=e.modifier,r=e.properties,i=e.layout,a=e.numDimensions,s=e.dimensionAndFieldList;if(!n)return t;var l=a;void 0===l&&(l=D.getNumDimensions({properties:r,layout:i}));var u=o(r,"qHyperCubeDef.qDimensions",[]),c=D.getExpressionWithExcludedComp({expression:t,modifier:n,dimensions:u,dimensionAndFieldList:s}),p=n.selectionScope,f=n.dimensionalScope;return function(e,t,n,r,i,o,a){var s=ae(t),l=se(t,n,r),u=""===s&&""===l?"":s||l,c=le(i,o),p=ue(i,o,a),f=function(e){for(var t=[],n=0;n<e;n++)t[n]=D.getDimDefWithWrapper(n);return t.join(", ")}(o);return"".concat(e,"/ Sum(").concat(u," ").concat(c).concat(p," Aggr(").concat(u," ").concat(e,", ").concat(f,"))")}(c,p,n.field,n.value,f,l,n.primaryDimension)},initModifier:function(e){Object.keys(oe).forEach((function(t){void 0===e[t]&&(e[t]=oe[t])}))},updateModifier:function(e,t){1===(t.qDimensions?t.qDimensions.length:0)&&0===e.dimensionalScope&&(e.dimensionalScope=2)},enableTotalsFunction:function(){return!0},propertyPanelDef:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n={type:"items",items:{disclaimer:{component:"text",translation:t.disclaimer||"properties.modifier.normalization.disclaimer",show:function(e,t){return!D.isApplicable({properties:t.properties})}},settings:{type:"items",items:{selectionScope:{refFn:function(t){return"".concat(re(t,e),".selectionScope")},type:"string",translation:t.modifierSelectionScope||"properties.modifier.selectionScope",title:{translation:t.modifierSelectionScopeTooltip||"properties.modifier.selectionScope.tooltip"},component:"dropdown",schemaIgnore:!0,defaultValue:2,options:function(n){return function(e,t,n){var r=[{value:0,translation:t.selectionScopeCurrentSelection||"properties.modifier.selectionScope.currentSelection"},{value:1,translation:t.selectionScopeSpecificValue||"properties.modifier.selectionScope.selectAField"},{value:2,translation:t.selectionScopeTotal||"properties.modifier.selectionScope.total"}];return r=function(e,t){if(1===e){var n=ie(t,0);t.splice(n,1)}return t}(ne(e,n).dimensionalScope,r),r}(n,t,e)}},field:{refFn:function(t){return"".concat(re(t,e),".field")},type:"string",component:"expression-with-dropdown",translation:"Common.Field",defaultValue:"",dropdownOnly:!0,options:function(e,t,n){return n.app.getFieldList().then((function(e){return e.map((function(e){return{label:e.qName,value:e.qName}}))}))},show:function(t){return 1===ne(t,e).selectionScope}},value:{refFn:function(t){return"".concat(re(t,e),".value")},type:"string",ref:"value",component:"string",translation:"properties.value",expression:"optional",show:function(t){return 1===ne(t,e).selectionScope}},dimensionalScope:{refFn:function(t){return"".concat(re(t,e),".dimensionalScope")},type:"string",translation:t.modifierDimensionalScope||"properties.modifier.dimensionalScope",title:{translation:t.modifierDimensionalScopeTooltip||"properties.modifier.dimensionalScope.tooltip"},component:"dropdown",schemaIgnore:!0,defaultValue:2,supportTooltip:!0,options:function(n,r){return function(e,t,n,r){var i=t.layout.qHyperCube.qDimensionInfo.length,o=[{value:0,translation:n.dimensionalScopeOneDimension||"properties.modifier.dimensionalScope.respectOneDimension",tooltipTranslation:n.dimensionalScopeOneDimensionTooltip||"properties.modifier.dimensionalScope.respectOneDimension.tooltip"},{value:1,translation:n.dimensionalScopeAllDimensions||"properties.modifier.dimensionalScope.".concat(2===i?"respectAllDimensions":"respectDimension"),tooltipTranslation:n.dimensionalScopeAllDimensionsTooltip||"properties.modifier.dimensionalScope.".concat(2===i?"respectAllDimensions":"respectDimension",".tooltip")},{value:2,translation:n.dimensionalScopeDisregardAllDimensions||"properties.modifier.dimensionalScope.".concat(2===i?"disregardAllDimensions":"disregardDimension"),tooltipTranslation:n.dimensionalScopeDisregardAllDimensionsTooltip||"properties.modifier.dimensionalScope.".concat(2===i?"disregardAllDimensions":"disregardDimension",".tooltip")}];return o=function(e,t){if(e<2){var n=ie(t,0);t.splice(n,1)}return t}(i,o),o=function(e,t){if(0===e){var n=ie(t,1);t.splice(n,1)}return t}(ne(e,r).selectionScope,o),o}(n,r,t,e)}},primaryDimension:{refFn:function(t){return"".concat(re(t,e),".primaryDimension")},type:"integer",translation:t.primaryDimension||"properties.modifier.primaryDimension",title:{translation:t.primaryDimensionTooltip||"properties.modifier.normalization.primaryDimension.tooltip"},component:"dropdown",schemaIgnore:!0,defaultValue:1,options:function(e,t){return t.layout.qHyperCube.qDimensionInfo.map((function(e,t){return{value:t,label:e.qGroupFallbackTitles[0]}}))},show:function(t,n){return 0===(ne(t,e).dimensionalScope||0)&&n.layout.qHyperCube.qDimensionInfo.length>1}}},show:function(e,t){return D.isApplicable({properties:t.properties})}}},show:function(t,n,r){var i=r.ext.support.modifiers;if(!Array.isArray(i)||-1===i.indexOf(te))return!1;var o=ne(t,e);return o&&!o.disabled}};return n},getDisregardSelectionComp:ae,getFieldSelectionComp:se,getTotalComp:le,getSelectedDimComp:ue};var pe="qDef.base",fe="qDef.qDef",de="qDef.base.qDef",me="qLibraryId",he="qDef.base.qLibraryId";const ge={getExpression:function(e){var t=o(e,de);return void 0!==t?t:o(e,fe)},getExpressionRef:function(e){return void 0!==o(e,de)?de:fe},getLibraryIdRef:function(e){return o(e,he)?he:me},getLibraryId:function(e){return o(e,he)||o(e,me)},getLabelRef:function(e){return o(e,pe)?"qDef.base.qLabel":"qDef.qLabel"},getLabelExpressionRef:function(e){return o(e,pe)?"qDef.base.qLabelExpression":"qDef.qLabelExpression"}};var ye="qDef.qDef",ve="qDef.base.qDef",be="qLibraryId",xe="qDef.base.qLibraryId",qe="qDef.qLabel",De="qDef.qLabelExpression",Se="qDef.base.qLabel",Me="qDef.base.qLabelExpression",Ae="qDef.qAggrFunc",Ie="qDef.base.qAggrFunc",we={initBase:function(e,t){(t||we.isValid(e))&&(n(e,ve,o(e,ye)),n(e,xe,o(e,be)),n(e,Se,o(e,qe)),n(e,Me,o(e,De)))},restoreBase:function(e){we.isValid(e)&&(n(e,ye,o(e,ve)),n(e,be,o(e,xe)),n(e,qe,o(e,Se)),n(e,De,o(e,Me)),o(e,Ae)&&o(e,Ie)&&n(e,Ae,o(e,Ie)),delete e.qDef.base)},isValid:function(e){var t=o(e,ve),n=o(e,xe);return void 0!==t||void 0!==n}};const ke=we;function Ce(e){return Ce="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Ce(e)}var Le={accumulation:H,movingAverage:$,difference:ee,normalization:ce,timeSeriesDecomposition:K};const Ee={modifiers:Le,apply:Pe,applyModifiers:Oe,cleanUpMeasure:Fe,destroy:function(e){e&&Ne[e.id]&&Ne[e.id].masterItemSubscriber&&(Ne[e.id].masterItemSubscriber&&Ne[e.id].masterItemSubscriber.unsubscribe(),delete Ne[e.id])},hasActiveModifiers:Te,getActiveModifier:Re,initBase:ke.initBase,isSupportedModifiers:function(e){return Array.isArray(e)&&e.some((function(e){return Le[e]}))},isApplicableSupportedModifiers:function(e){var t=e.modifierTypes,n=e.properties,r=e.layout;return Array.isArray(t)&&t.some((function(e){return Le[e]&&Le[e].isApplicable({properties:n,layout:r})}))},measureBase:ge,limitedSorting:function(e){var t=e.measures,n=e.properties,r=e.layout,i=!1,o=!1;return t.forEach((function(e){var t=je(e);We({modifiers:t,properties:n,layout:r})&&(i=!0,o=o||Je({modifiers:t,properties:n,layout:r}))})),i&&!o},ifEnableTotalsFunction:Ve};var Ne={};function Pe(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=e.model,r=e.properties,i=e.isSnapshot,a=void 0!==i&&i,s=e.masterItem,l=!1;Ne[n.id]=Ne[n.id]||{isFirstTime:!0};var u=Ne[n.id].isFirstTime;if(Ne[n.id].isFirstTime=!1,r&&"object"===Ce(r))return Oe({model:n,properties:r});var c=n?n.layout:void 0,p=o(c,"qSelectionInfo.qInSelections");if(a||p)return Promise.resolve(l);var f=o(c,"qHyperCube.qMeasureInfo"),d=Ne[n.id].lastReloadTime;if(Ne[n.id].lastReloadTime=o(n,"app.layout.qLastReloadTime"),Te({measures:f,layout:c})){var m=function(e){var t=e.measures,n=e.layout,r=e.lastReloadTime;return o(e.model,"app.layout.qLastReloadTime")!==r&&function(e){var t=e.measures,n=e.properties,r=e.layout;return!!Array.isArray(t)&&t.some((function(e){return Ue({measure:e,properties:n,layout:r})}))}({measures:t,layout:n})}({measures:f,layout:c,model:n,lastReloadTime:d});return m||function(e){var t=e.measures,n=e.layout,r=e.masterItem,i=e.isFirstTime;return!!Array.isArray(t)&&(i||r||t.some((function(e){return function(e){var t=e.measure,n=e.layout;return We({modifiers:je(t),layout:n})?!t.base:!!t.base}({measure:e,layout:n})})))}({measures:f,layout:c,masterItem:s,isFirstTime:u})?n.getEffectiveProperties().then((function(e){var r=t()(!0,{},e);_e(r);var i=Qe(r);return Xe({model:n}).then((function(t){return Ke({libraryIds:i,model:n}).then((function(i){return m&&function(e){var t=e.properties;He(t).forEach((function(e){return function(e){var t=e.measure;if(Ue({measure:t,properties:e.properties})){var n=0,r=t.qDef.modifiers;Array.isArray(r)&&r.forEach((function(e){if("object"===Ce(e)&&!e.disabled){if(n++,"object"!==Ce(Le[e.type]))throw new Error('Modifier "'.concat(e.type,'" is not available'));if(n>1)throw new Error("More than 1 modifier on a measure! (not yet supported)");var r=Le[e.type].extractInputExpression({outputExpression:t.qDef.qDef,modifier:e});void 0!==r&&$e(t)&&D.simplifyExpression(t.qDef.base.qDef)!==D.simplifyExpression(r)&&(t.qDef.base.qDef=r)}}))}}({measure:e,properties:t})}))}({properties:r}),Oe({model:n,oldProperties:e,properties:r,runUpdateIfChange:!0,masterItem:s,libraryItemsProps:i,dimensionAndFieldList:t})}))}))})):Promise.resolve(l)}return function(e){return!!Array.isArray(e)&&e.some((function(e){return"object"===Ce(e.base)}))}(f)?n.getEffectiveProperties().then((function(e){return function(e){var n=e.model,r=e.properties,i=Qe(r);return et({model:n,libraryIds:i}).then((function(){var e=t()(!0,{},r);return He(r).forEach((function(e){return Fe(e)})),Ye({oldProperties:e,newProperties:r,model:n})}))}({model:n,properties:e})})):Promise.resolve(l)}function Oe(e){var n=e.model,r=e.oldProperties,i=e.properties,a=e.measures,s=e.runUpdateIfChange,l=void 0!==s&&s,u=e.masterItem,c=e.libraryItemsProps,p=e.dimensionAndFieldList;void 0===r&&(r=l?t()(!0,{},i):i),_e(i);var f=Qe(i);return et({model:n,libraryIds:f,masterItem:u}).then((function(){return function(e){var n=e.measures,r=e.properties,i=e.model,a=e.libraryItemsProps,s=e.dimensionAndFieldList;if(n||(n=He(r)),!n.length)return Promise.resolve();if(!Te({measures:n,properties:r}))return n.forEach((function(e){return Fe(e)})),Promise.resolve();var l=a?void 0:Qe(r);return Xe({model:i,dimensionAndFieldList:s}).then((function(e){return Ke({libraryIds:l,model:i,libraryItemsProps:a}).then((function(i){n.forEach((function(n){We({modifiers:n.qDef.modifiers,properties:r})?(function(e){var n=e.measure,r=e.properties,i=e.libraryItemsProps,a=e.dimensionAndFieldList,s=0;ke.isValid(n)||ke.initBase(n,!0);var l=n.qDef,u=l.modifiers,c=l.base;Array.isArray(u)&&u.forEach((function(e){if("object"===Ce(e)&&!e.disabled){if(s++,"object"!==Ce(Le[e.type]))throw new Error('Modifier "'.concat(e.type,'" is not available'));if(s>1)throw new Error("More than 1 modifier on a measure! (not yet supported)");Le[e.type].initModifier(e,n);var l=n.qLibraryId||c&&c.qLibraryId;l?function(e){var n=e.measure,r=e.modifier,i=e.properties,o=e.dimensionAndFieldList,a=e.libraryItemsProps[e.libraryId],s=a.qMeasure.qDef,l=""===s?s:Le[r.type].generateExpression({expression:s,modifier:r,properties:i,dimensionAndFieldList:o});r.outputExpression=l,n.qDef.qDef=r.outputExpression,(n.qDef.qLabel||a.qMeasure.qLabel)&&(n.qDef.qLabel=a.qMeasure.qLabel),(n.qDef.qLabelExpression||a.qMeasure.qLabelExpression)&&(n.qDef.qLabelExpression=a.qMeasure.qLabelExpression),n.qDef.quarantine&&n.qDef.quarantine.qNumFormat&&a.qMeasure.qNumFormat&&(n.qDef.qNumFormat=a.qMeasure.qNumFormat,n.qDef.isCustomFormatted=a.qMeasure.isCustomFormatted),delete n.qLibraryId,n.qDef.coloring=a.qMeasure.coloring,r.base=t()(!0,{},n.qDef.base)}({measure:n,modifier:e,libraryId:l,properties:r,libraryItemsProps:i,dimensionAndFieldList:a}):function(e){var n=e.measure,r=e.modifier,i=e.properties,o=e.dimensionAndFieldList;"function"==typeof Le[r.type].updateModifier&&Le[r.type].updateModifier(r,i.qHyperCubeDef);var a=ge.getExpression(n),s=""===a?a:Le[r.type].generateExpression({expression:a,modifier:r,properties:i,dimensionAndFieldList:o});r.outputExpression=s,n.qDef.qDef=r.outputExpression,n.qDef.base.qLabelExpression?n.qDef.qLabelExpression=n.qDef.base.qLabelExpression:n.qDef.qLabel=n.qDef.base.qLabel||a,r.base=t()(!0,{},n.qDef.base)}({measure:n,modifier:e,properties:r,dimensionAndFieldList:a}),function(e){var t=o(e,"qDef.qAggrFunc");"Expr"!==t||Ve(e)?"None"!==t?delete e.qDef.base.qAggrFunc:"None"===t&&Ve(e)&&"Expr"===e.qDef.base.qAggrFunc&&(e.qDef.qAggrFunc="Expr",delete e.qDef.base.qAggrFunc):(e.qDef.qAggrFunc="None",e.qDef.base.qAggrFunc="Expr")}(n)}}))}({measure:n,properties:r,libraryItemsProps:i,dimensionAndFieldList:e}),Be(n)):Fe(n)}))}))}))}({measures:a,properties:i,model:n,libraryItemsProps:c,dimensionAndFieldList:p}).then((function(){return l?Ye({oldProperties:r,newProperties:i,model:n}):Promise.resolve(!1)}))}))}function Fe(e){!function(e){var t=je(e);return Array.isArray(t)&&t.some((function(e){return"object"===Ce(e)&&!e.disabled&&!Le[e.type]}))}(e)?ke.restoreBase(e):delete e.qDef.base,e.qDef.coloring&&delete e.qDef.coloring,Be(e)}function Te(e){var t=e.measures,n=e.properties,r=e.layout;return!!Array.isArray(t)&&t.some((function(e){return We({modifiers:je(e),properties:n,layout:r})}))}function Re(e){var t=je(e);if(Array.isArray(t))for(var n=0;n<t.length;n++){var r=t[n];if(Le[r.type]&&!r.disabled)return r}}function Ve(e){var t=Re(e);return!t||Le[t.type].enableTotalsFunction(e)}function He(e){return o(e,"qHyperCubeDef.qMeasures",[]).concat(o(e,"qHyperCubeDef.qLayoutExclude.qHyperCubeDef.qMeasures",[]))}function je(e){return e.modifiers||e.qDef&&e.qDef.modifiers}function ze(e){return o(e,"outputExpression.qValueExpression.qExpr")||o(e,"outputExpression")}function _e(e){He(e).forEach((function(e){return function(e){var n=Re(e);n&&(void 0!==n.outputExpression&&ze(n)!==e.qDef.qDef?delete e.qDef.base:!ke.isValid(e)&&n.base&&(e.qDef.base=t()(!0,{},n.base)))}(e)}))}function Be(e){var t=je(e);Array.isArray(t)&&t.forEach((function(t){"object"===Ce(t)&&(t.disabled||!Le[t.type]&&ze(t)!==e.qDef.qDef)&&(t.disabled=!0,delete t.base)}))}function $e(e){return e.base||e.qDef&&e.qDef.base}function Ge(e){var t=$e(e);return e.qLibraryId||t&&t.qLibraryId}function Ue(e){var t=e.measure,n=e.properties,r=e.layout;return!Ge(t)&&We({modifiers:je(t),properties:n,layout:r})}function We(e){var t=e.modifiers,n=e.properties,r=e.layout,i={};return Array.isArray(t)&&t.some((function(e){return!("object"!==Ce(e)||e.disabled||!Le[e.type])&&(void 0===i[e.type]&&(i[e.type]=Le[e.type].isApplicable({properties:n,layout:r})),i[e.type])}))}function Xe(e){var t=e.model,n=e.dimensionAndFieldList;if(n)return Promise.resolve(n);var r=[],i={},o=t.app.getDimensionList().then((function(e){i.dimensionList=e}));r.push(o);var a=t.app.getFieldList().then((function(e){i.fieldList=e}));return r.push(a),Promise.all(r).then((function(){return i}))}function Ke(e){var t=e.libraryIds,n=e.model,r=e.libraryItemsProps;if(r)return Promise.resolve(r);var i=t.measureLibraryIds,o=t.dimensionLibraryIds,a={},s=[];return i.forEach((function(e){var t=n.app.getMeasure(e).then((function(t){return t.getProperties().then((function(t){a[e]=t}))}));s.push(t)})),o.forEach((function(e){var t=n.app.getDimension(e).then((function(t){return t.getProperties().then((function(t){a[e]=t}))}));s.push(t)})),Promise.all(s).then((function(){return a}))}function Ze(e,t){if(""!==t||-1===["qFmt","qDec","qThou"].indexOf(e))return t}function Ye(e){var t=e.oldProperties,n=e.newProperties,r=e.model,i=JSON.stringify(o(t,"qHyperCubeDef.qMeasures"),Ze)!==JSON.stringify(o(n,"qHyperCubeDef.qMeasures"),Ze)||JSON.stringify(o(t,"qHyperCubeDef.qLayoutExclude.qHyperCubeDef.qMeasures"),Ze)!==JSON.stringify(o(n,"qHyperCubeDef.qLayoutExclude.qHyperCubeDef.qMeasures"),Ze);return i?function(e){var t=e.model,n=e.oldProperties,r=e.newProperties,i=t.layout;return i&&!i.qHasSoftPatches&&!i.qExtendsId&&o(i,"qMeta.privileges",[]).indexOf("update")>-1?t.setProperties(r):O(t,n,r)}({model:r,oldProperties:t,newProperties:n}).then((function(){return i})):Promise.resolve(i)}function Je(e){var t=e.modifiers,n=e.properties,r=e.layout;return Array.isArray(t)&&t.some((function(e){return"object"===Ce(e)&&!e.disabled&&Le[e.type]&&Le[e.type].needDimension({modifier:e,properties:n,layout:r})}))}function Qe(e){var t=He(e),n=[],r=[],i=!1;return t.forEach((function(t){var r=je(t);if(We({modifiers:r,properties:e})){var o=Ge(t);o&&n.push(o),i=i||Je({modifiers:r,properties:e})}})),o(e,"qHyperCubeDef.qDimensions",[]).forEach((function(e){var t=e.qLibraryId;t&&r.push(t)})),{measureLibraryIds:n,dimensionLibraryIds:r}}function et(e){var t=e.model,n=e.libraryIds;return!e.masterItem&&n&&(n.measureLibraryIds.length||n.dimensionLibraryIds.length)?(Ne[t.id].masterItemSubscriber=Ne[t.id].masterItemSubscriber||function(e){var t=e.model,n=e.callback,r={},i={},a={},s={dimension:["qDim.qFieldDefs"],measure:["qMeasure.qDef","qMeasure.qLabel","qMeasure.qLabelExpression","qMeasure.coloring","qMeasure.qNumFormat","qMeasure.isCustomFormatted"]};function l(e){var t={},n=o(e,"qInfo.qType");return n&&s[n]&&s[n].forEach((function(n){t[n]=o(e,n)})),JSON.stringify(t)}function u(e){var t=e.qInfo.qId;if(r[t]){var i=l(e);r[t].properties!==i&&(r[t].properties=i,"function"==typeof n&&r[t].enabled&&n(e)),r[t].enabled=!0}}function c(e,n){return t.app[n](e).then((function(t){r[e]={listener:t.layoutSubscribe(u),enabled:!1,properties:l(t.layout)}}))}return{subscribe:function(e){var n=e.measureLibraryIds,o=e.dimensionLibraryIds,s=[];return function(e){var t=e.dimensionLibraryIds;i={},e.measureLibraryIds.forEach((function(e){i[e]=!0})),a={},t.forEach((function(e){a[e]=!0}))}({measureLibraryIds:n,dimensionLibraryIds:o}),Object.keys(r).forEach((function(e){i[e]||a[e]||(r[e].listener.dispose(),delete r[e])})),t.app&&(Object.keys(i).forEach((function(e){i[e]&&!r[e]&&s.push(c(e,"getMeasure"))})),Object.keys(a).forEach((function(e){a[e]&&!r[e]&&s.push(c(e,"getDimension"))}))),Promise.all(s)},unsubscribe:function(){Object.keys(r).forEach((function(e){r[e].listener.dispose()})),r={}}}}({model:t,callback:function(e){return Pe({model:t,masterItem:e}).then((function(){return t.app.clearUndoBuffer()}))}}),Ne[t.id].masterItemSubscriber.subscribe(n)):Promise.resolve()}})(),t.default=i.default,Object.defineProperty(t,"__esModule",{value:!0})})()}},t={};function n(r){var i=t[r];if(void 0!==i)return i.exports;var o=t[r]={exports:{}};return e[r](o,o.exports,n),o.exports}n.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return n.d(t,{a:t}),t},n.d=(e,t)=>{for(var r in t)n.o(t,r)&&!n.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t);var r={};return(()=>{function e(t){var n,r=t;return r>9?(n=65+r-10)>90&&(n+=6):r="".concat(r).charCodeAt(0),[48,111,79,105,73,108].indexOf(n)>-1?e(r+1):String.fromCharCode(n)}function t(n){var r=e(n%62),i=Math.floor(n/62);return i>0?t(i)+r:r}function i(e){return i="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},i(e)}n.d(r,{default:()=>_e});const o={getValue:function(e,t,n){if(null==e||null==t)return n;for(var r=t.split("."),i=e,o=0;o<r.length;++o){var a=r[o];if(""!==a){if(void 0===i[a]||null===i[a])return n;i=i[a]}}return i},setValue:function(e,t,n){if(null!=e&&null!=t){for(var r=t.split("."),i=r[r.length-1],o=e,a=0;a<r.length-1;++a){var s=r[a];void 0!==o[s]&&null!==o[s]||(o[s]=Number.isNaN(+r[a+1])?{}:[]),o=o[s]}void 0!==n?o[i]=n:delete o[i]}},isEmpty:function(e){return 0===Object.keys(e).length&&e.constructor===Object},isAtomicValue:function(e){return/boolean|number|string/.test(i(e))},generateId:function(){return t(Math.round(99e11*Math.random()+1e11)).replace(/\W/g,"")}};function a(e){return function(e){if(Array.isArray(e))return s(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(e){if("string"==typeof e)return s(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?s(e,t):void 0}}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function s(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function l(e){return function(e){if(Array.isArray(e))return u(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(e){if("string"==typeof e)return u(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?u(e,t):void 0}}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function u(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function c(e,t,n){if(e){for(var r=0;r<e.length;r++)if(e[r][t]===n)return r;return-1}return-1}const p={isOrderedSubset:function(e,t){if(!(e&&t&&e.length&&t.length))return!1;var n=e.indexOf(t[0]);if(-1!==n){for(var r=0;r<t.length;r++){var i=e.indexOf(t[r]);if(n>i)return!1;n=i}return!0}return!1},indexAdded:function(e,t){var n;for(n=0;n<e.length;++n)e[n]>=0&&e[n]>=t&&++e[n];e.push(t)},indexRemoved:function(e,t){var n,r=0;for(n=0;n<e.length;++n)e[n]>t?--e[n]:e[n]===t&&(r=n);return e.splice(r,1),r},findItemByPropertyValue:function(e,t,n){if(e){for(var r=0;r<e.length;r++)if(e[r][t]===n)return e[r];return null}return null},findIndexByPropertyValue:c};var f=n(645),d=n.n(f);const m=function(e){var t,n=e.exportFormat,r=e.qHyperCubeDef,i=n.data[0];(t=i.dimensions).push.apply(t,a(r.qDimensions));var s,l=o.getValue(r,"qLayoutExclude.qHyperCubeDef.qDimensions");l&&(s=i.excludedDimensions).push.apply(s,a(l))},h=function(e){var t,n=e.exportFormat,r=e.qHyperCubeDef,i=n.data[0];(t=i.measures).push.apply(t,l(r.qMeasures));var a,s=o.getValue(r,"qLayoutExclude.qHyperCubeDef.qMeasures");s&&(a=i.excludedMeasures).push.apply(a,l(s))},g=function(e){var t=e.exportFormat,n=e.qHyperCubeDef,r=t.data[0];n.qInterColumnSortOrder||(n.qInterColumnSortOrder=[]),r.interColumnSortOrder=n.qInterColumnSortOrder.concat();var i=o.getValue(n,"qLayoutExclude.qHyperCubeDef.qInterColumnSortOrder");i&&p.isOrderedSubset(i,r.interColumnSortOrder)&&(r.interColumnSortOrder=i.concat())},y=function(e){var t=e.exportFormat,n=e.properties;Object.keys(n).forEach((function(e){t.properties[e]=n[e]}))},v=function(e){var t=e.exportFormat,n=e.properties;n.qLayoutExclude||(n.qLayoutExclude={}),n.qLayoutExclude.disabled&&(Object.keys(n.qLayoutExclude.disabled).forEach((function(e){t.properties.hasOwnProperty(e)||(t.properties[e]=n.qLayoutExclude.disabled[e])})),delete n.qLayoutExclude.disabled),n.qLayoutExclude.changed&&(function(e){Object.keys(e.qLayoutExclude.changed).forEach((function(t){e.qLayoutExclude.changed[t].to===o.getValue(e,t)&&o.setValue(e,t,e.qLayoutExclude.changed[t].from)}))}(n),delete n.qLayoutExclude.changed),n.qLayoutExclude.quarantine&&!o.isEmpty(n.qLayoutExclude.quarantine)||delete n.qLayoutExclude},b=function(e){e.forEach((function(e){d().cleanUpMeasure(e),e.qDef.modifiers&&(e.store={modifiers:e.qDef.modifiers},delete e.qDef.modifiers)}))};function x(e,t,n){var r,i,a=o.getValue(e,t);if(!o.isAtomicValue(a))try{if((i=(i=(r=JSON.stringify(a)).match(/:\{/g))?i.length:0)>2)return;a=JSON.parse(r)}catch(e){return}o.getValue(e,"qLayoutExclude.quarantine")||o.setValue(e,"qLayoutExclude.quarantine",{});var s=o.getValue(e,"qLayoutExclude.quarantine");s[n]||(s[n]={}),s[n][t]=a}var q=n(229),D=n.n(q);function S(e,t){var n=D()(!0,{},t,e);return o.getValue(n,"qOtherTotalSpec.qOtherCounted")||o.setValue(n,"qOtherTotalSpec.qOtherCounted",{qv:"10"}),o.getValue(n,"qOtherTotalSpec.qOtherLimit")||o.setValue(n,"qOtherTotalSpec.qOtherLimit",{qv:"0"}),n.hasOwnProperty("othersLabel")||(n.othersLabel="Others"),n}function M(e,t){return D()(!0,{},t,e)}function A(e,t,n){return"function"==typeof e?e(t):Number.isNaN(+e)?n:e}var I=Math.pow(2,53)-1;function w(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function k(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}const C=function(e,t,n){var r="masterobject"===o.getValue(t,"properties.qInfo.qType")?"masterobject":o.getValue(n,"qInfo.qType");o.setValue(e,"qInfo.qType",r),e.visualization=n.visualization},L=function(e,t,n){t.hasOwnProperty(e)&&(n[e]=t[e])},E=function(e,t,n,r){t.hasOwnProperty(e)?n[e]=t[e]:n[e]=r},N=function(){return{qDef:{autoSort:!0,cId:"",othersLabel:"Others"},qLibraryId:"",qNullSuppression:!1,qOtherLabel:"Others",qOtherTotalSpec:{qOtherLimitMode:"OTHER_GE_LIMIT",qOtherMode:"OTHER_OFF",qOtherSortMode:"OTHER_SORT_DESCENDING",qSuppressOther:!1}}},P=function(){return{qDef:{autoSort:!0,cId:"",numFormatFromTemplate:!0},qLibraryId:"",qTrendLines:[]}},O=function(e){var t,n=e.exportFormat,r=e.maxDimensions,i=e.minDimensions,o=e.newHyperCubeDef,a=e.defaultDimension,s=n.data[0];for(t=0;t<s.dimensions.length;++t){var l=S(s.dimensions[t],a);o.qDimensions.length<r?o.qDimensions.push(l):o.qLayoutExclude.qHyperCubeDef.qDimensions.push(l)}for(t=0;t<s.excludedDimensions.length;++t){var u=S(s.excludedDimensions[t],a);o.qDimensions.length<i?o.qDimensions.push(u):o.qLayoutExclude.qHyperCubeDef.qDimensions.push(u)}},F=function(e){var t,n=e.exportFormat,r=e.maxMeasures,i=e.minMeasures,o=e.newHyperCubeDef,a=e.defaultMeasure,s=n.data[0];for(t=0;t<s.measures.length;++t){var l=M(s.measures[t],a);o.qMeasures.length<r?o.qMeasures.push(l):o.qLayoutExclude.qHyperCubeDef.qMeasures.push(l)}for(t=0;t<s.excludedMeasures.length;++t){var u=M(s.excludedMeasures[t],a);o.qMeasures.length<i?o.qMeasures.push(u):o.qLayoutExclude.qHyperCubeDef.qMeasures.push(u)}},T=function(e){var t=e.exportFormat,n=e.dataDefinition,r=void 0===n?{}:n,i=t.data[0],o=r.dimensions||{max:0},a=r.measures||{max:0},s=A(a.max,i.dimensions.length,I),l=A(a.min,i.dimensions.length,0);return{maxDimensions:A(o.max,s,I),minDimensions:A(o.min,l,0),maxMeasures:s,minMeasures:l}},R=function(e){var t=e.exportFormat,n=e.newHyperCubeDef,r=t.data[0],i=n.qDimensions.length+n.qMeasures.length;n.qInterColumnSortOrder=r.interColumnSortOrder.concat();var o=n.qInterColumnSortOrder.length;if(o!==i)for(n.qLayoutExclude&&(n.qLayoutExclude.qHyperCubeDef.qInterColumnSortOrder=r.interColumnSortOrder.concat());o!==i;)o<i?(p.indexAdded(n.qInterColumnSortOrder,o),++o):(--o,p.indexRemoved(n.qInterColumnSortOrder,o))},V=function(e){var t=e.exportFormat,n=e.initialProperties,r=e.hypercubePath,i={qLayoutExclude:{disabled:{},quarantine:{}}};return Object.keys(t.properties).forEach((function(e){"qLayoutExclude"===e?t.properties[e].quarantine&&(i.qLayoutExclude.quarantine=D()(!0,{},t.properties[e].quarantine)):"qHyperCubeDef"===e&&r?o.setValue(i,"".concat(r,".qHyperCubeDef"),t.properties.qHyperCubeDef):n.hasOwnProperty(e)||-1!==["qMetaDef","descriptionExpression","labelExpression"].indexOf(e)||function(e,t){return"components"===t&&Array.isArray(e[t])&&e[t].some((function(e){return"general"===e.key}))}(t.properties,e)?i[e]=t.properties[e]:i.qLayoutExclude.disabled[e]=t.properties[e]})),null===(i=D()(!0,{},n,i)).components&&(i.components=[]),i},H=function(e){var t=e.exportFormat,n=e.maxDimensions,r=e.minDimensions,i=e.maxMeasures,o=e.minMeasures,a=t.data[0];return a.dimensions.length>n&&n>0||a.measures.length>i&&i>0||a.excludedDimensions.length>0&&a.dimensions.length+a.excludedDimensions.length>r||a.excludedMeasures.length>0&&a.measures.length+a.excludedMeasures.length>o||!i&&a.measures.length>0||!n&&a.dimensions.length>0},j=function(e){var t=e.exportFormat,n=e.maxDimensions,r=e.minDimensions,i=e.maxMeasures,o=e.minMeasures,a=e.newHyperCubeDef,s=t.data[0];a.qLayoutExclude||(a.qLayoutExclude={}),a.qLayoutExclude.qHyperCubeDef||(a.qLayoutExclude.qHyperCubeDef={}),(s.dimensions.length>n&&n>0||s.excludedDimensions&&s.excludedDimensions.length&&s.dimensions.length+s.excludedDimensions.length>r)&&(a.qLayoutExclude.qHyperCubeDef.qDimensions||(a.qLayoutExclude.qHyperCubeDef.qDimensions=[])),(s.measures.length>i&&i>0||s.excludedMeasures&&s.excludedMeasures.length&&s.measures.length+s.excludedMeasures.length>o)&&(a.qLayoutExclude.qHyperCubeDef.qMeasures||(a.qLayoutExclude.qHyperCubeDef.qMeasures=[])),!i&&s.measures.length&&(a.qLayoutExclude.qHyperCubeDef.qMeasures||(a.qLayoutExclude.qHyperCubeDef.qMeasures=[])),!n&&s.dimensions.length&&(a.qLayoutExclude.qHyperCubeDef.qDimensions||(a.qLayoutExclude.qHyperCubeDef.qDimensions=[]))},z=function(e){var t,n=e.newProperties,r=e.dataDefinition,i=e.hypercubePath;if(r.dimensions&&"function"==typeof r.dimensions.added){var a=o.getValue(n,i||"").qHyperCubeDef,s=function(e){if(Array.isArray(e))return w(e)}(t=a.qDimensions)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(t)||function(e,t){if(e){if("string"==typeof e)return w(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?w(e,t):void 0}}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}();a.qDimensions=[],s.forEach((function(e){a.qDimensions.push(e),r.dimensions.added(e,n)}))}},_=function(e){var t,n=e.newProperties,r=e.dataDefinition,i=e.hypercubePath;if(r.measures&&"function"==typeof r.measures.added){var a=o.getValue(n,i||"").qHyperCubeDef,s=function(e){if(Array.isArray(e))return k(e)}(t=a.qMeasures)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(t)||function(e,t){if(e){if("string"==typeof e)return k(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?k(e,t):void 0}}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}();a.qMeasures=[],s.forEach((function(e){a.qMeasures.push(e),r.measures.added(e,n)}))}},B=function(e){var t=e.measures,n=e.modifierTypes;t&&n&&d().isSupportedModifiers(n)&&t.forEach((function(e){e.store&&e.store.modifiers&&(e.qDef.modifiers=e.store.modifiers),delete e.store}))};function $(e,t){var n=o.getValue(e,"qLayoutExclude.quarantine",{})[t];return!!n&&(Object.keys(n).forEach((function(t){o.setValue(e,t,n[t])})),delete e.qLayoutExclude.quarantine[t],!0)}const G={exportProperties:function(e){var t=e.propertyTree,n=e.hypercubePath,r=e.viewDataMode,i=function(){for(var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1,t={data:[],properties:{}},n=0;n<e;++n)t.data.push({dimensions:[],measures:[],excludedDimensions:[],excludedMeasures:[],interColumnSortOrder:[]});return t}(),a=t.qProperty,s=o.getValue(a,n||""),l=s.qHyperCubeDef;return l.qInterColumnSortOrder||(l.qInterColumnSortOrder=[]),m({exportFormat:i,qHyperCubeDef:l}),h({exportFormat:i,qHyperCubeDef:l}),g({exportFormat:i,qHyperCubeDef:l}),delete l.qLayoutExclude,y({exportFormat:i,properties:a}),n&&(i.properties.qHyperCubeDef=l,delete s.qHyperCubeDef),v({exportFormat:i,properties:a}),r||b(i.properties.qHyperCubeDef.qMeasures),Array.isArray(i.properties.filters)&&(x(i.properties,"filters","storedFilters"),delete i.properties.filters),i.properties.qHyperCubeDef.qContextSetExpression&&(x(i.properties,"qHyperCubeDef.qContextSetExpression","storedFilters"),i.properties.qHyperCubeDef.qContextSetExpression=""),i.properties.qHyperCubeDef.qDynamicScript&&i.properties.qHyperCubeDef.qDynamicScript.length&&(x(i.properties,"qHyperCubeDef.qDynamicScript","dynamicScript"),i.properties.qHyperCubeDef.qDynamicScript=[]),i},importProperties:function(e){var t=e.exportFormat,n=e.initialProperties,r=void 0===n?{}:n,i=e.dataDefinition,a=void 0===i?{}:i,s=e.defaultPropertyValues,l=void 0===s?{}:s,u=e.hypercubePath,c=e.extension,p=e.supportedFilters,f=void 0===p||p,d=e.isHCModifierSupported,m=void 0===d||d,h={qChildren:[]},g=V({exportFormat:t,initialProperties:r,hypercubePath:u}),y=o.getValue(r,u||"").qHyperCubeDef,v=o.getValue(g,u||"").qHyperCubeDef,b=T({exportFormat:t,dataDefinition:a}),x=b.maxDimensions,q=b.minDimensions,D=b.maxMeasures,S=b.minMeasures,M=l.defaultDimension,A=void 0===M?N():M,I=l.defaultMeasure,w=void 0===I?P():I;v.qDimensions.length=0,v.qMeasures.length=0,H({exportFormat:t,maxDimensions:x,minDimensions:q,maxMeasures:D,minMeasures:S})&&j({exportFormat:t,maxDimensions:x,minDimensions:q,maxMeasures:D,minMeasures:S,newHyperCubeDef:v}),O({exportFormat:t,maxDimensions:x,minDimensions:q,newHyperCubeDef:v,defaultDimension:A}),F({exportFormat:t,maxMeasures:D,minMeasures:S,newHyperCubeDef:v,defaultMeasure:w}),z({newProperties:g,dataDefinition:a,hypercubePath:u}),_({newProperties:g,dataDefinition:a,hypercubePath:u}),R({exportFormat:t,newHyperCubeDef:v}),L("qMaxStackedCells",y,v),L("qNoOfLeftDims",y,v),E("qInitialDataFetch",y,v,[{qTop:0,qLeft:0,qWidth:0,qHeight:0}]),E("qMode",y,v,"S"),E("qReductionMode",y,v,"N"),E("qSortbyYValue",y,v),E("qIndentMode",y,v),E("qShowTotalsAbove",y,v),C(g,t,r),h.qProperty=g;var k=o.getValue(c||{},"support.modifiers");return B({measures:v.qMeasures,modifierTypes:k}),f&&$(h.qProperty,"storedFilters"),"S"===v.qMode&&m&&$(h.qProperty,"dynamicScript"),h}};var U={cellBackgroundColor:!0,cellForegroundColor:!0,colorByAlternative:!0,colorByExpression:!0,tooltip:!0,urlLabel:!0,url:!0};function W(e,t,n,r){t=t||[];var i=c(e,r,n),o=c(t,r,n);if(-1!==i&&-1===o){var a=e.splice(i,1);t.push(a[0])}return t}function X(e,t){return e.length!==t}const K={create:function(e,t){if(!e||!U[e])throw new Error("Attribute Expressions Util: ID required");var n={};return t&&Object.keys(t).forEach((function(e){n[e]=t[e]})),n.id=e,n.qAttribute=!0,n},moveByIdFromGroup:function(e,t,n,r,i){n=n||"qAttributeExpressions",i=i||"id";for(var o=0;o<e.length;o++){var a=e[o][n],s=t.length;if(W(a,t,r,i),X(t,s))return t}return t},IDMAP:{CELL_BACKGROUND_COLOR:"cellBackgroundColor",CELL_FOREGROUND_COLOR:"cellForegroundColor",COLOR_BY_ALTERNATIVE:"colorByAlternative",COLOR_BY_EXPRESSION:"colorByExpression",TOOLTIP:"tooltip",CELL_LINK_LABEL:"urlLabel",CELL_LINK_URL:"url"}},Z={getNumDimensions:function(e){return o.getValue(e,"qHyperCubeDef.qDimensions.length",0)},getNumMeasures:function(e){return o.getValue(e,"qHyperCubeDef.qMeasures.length",0)},wrapFieldName:function(e){return e.split(" ").length>1&&"="!==e[0]&&"["!==e[0]?"[".concat(e,"]"):e},getItemLabel:function(e){return e.label||e.name}},Y={colorModeOptions:{primary:function(){return!0},dimension:function(e){return Z.getNumDimensions(e)>0&&Z.getNumMeasures(e)<=1},multiColor:function(e){return Z.getNumMeasures(e)>1},measure:function(e){return Z.getNumDimensions(e)>0},expression:function(e){return Z.getNumMeasures(e)>=1}}},J={colorModeOptions:{primary:function(){return!0},dimension:function(){return!0},multiColor:function(){return!1},measure:function(){return!0},expression:function(e){return Z.getNumMeasures(e)>=1}}};var Q={scatterplot:J,"sn-scatter-plot":J,piechart:{colorModeOptions:{primary:function(){return!0},dimension:function(){return!0},multiColor:function(){return!1},measure:function(){return!0},expression:function(e){return Z.getNumMeasures(e)>=1}}},linechart:{colorModeOptions:{primary:function(){return!0},dimension:function(e){return Z.getNumDimensions(e)>1},multiColor:function(e){return Z.getNumMeasures(e)>1},measure:function(e){return Z.getNumDimensions(e)<=1},expression:function(e){return Z.getNumMeasures(e)>=1}}},map:{colorModeOptions:{primary:function(){return!0},dimension:function(e){return Z.getNumDimensions(e)>=1},multiColor:function(e){return Z.getNumMeasures(e)>1},measure:function(e){return Z.getNumDimensions(e)>=1},expression:function(e){return Z.getNumDimensions(e)>=1}}},distributionplot:{colorModeOptions:{primary:function(){return!0},dimension:function(){return!0},multiColor:function(){return!1},measure:function(){return!0},expression:function(e){return Z.getNumDimensions(e)>=1}}}};function ee(e,t,n){if(Array.isArray(e[t])){var r=p.findIndexByPropertyValue(e[t],"id",n);r>=0&&e[t].splice(r,1)}else e[t]=[]}function te(e,t){var n=K.IDMAP.COLOR_BY_ALTERNATIVE;e.forEach((function(e){ee(e,"qAttributeDimensions",n),ee(e,"qAttributeExpressions",n)})),t.forEach((function(e){ee(e,"qAttributeDimensions",n),ee(e,"qAttributeExpressions",n)}))}function ne(e,t){if(t){var n="="===t.charAt(0);e.color.altLabel=n?{qStringExpression:{qExpr:t.substr(1)}}:t}}function re(e){var t=e.properties,n=e.isDimension,r=e.dimensions,i=e.excludedDimensions,a=e.measures,s=e.label;te(r,i);var l=r[r.length-1];if(l){var u=n?o.getValue(t,"color.byDimDef"):o.getValue(t,"color.byMeasureDef"),c=o.getValue(t,"color.formatting.qNumFormat"),f=o.getValue(t,"color.formatting.isCustomFormatted");if(u){var d=K.create(K.IDMAP.COLOR_BY_ALTERNATIVE);switch(u.type){case"expression":!function(e){var t=e.attributeExpression,n=e.label,r=e.item,i=e.isDimension,o=e.qNumFormat,a=e.isCustomFormatted;t.label=n||r.label,i?t.qDef=r.key:(t.qExpression=r.key,o&&(t.qNumFormat=o,t.isCustomFormatted=a)),t.matchMeasure=r.activeMeasureIndex,t.label&&"="===t.label.charAt(0)&&(t.labelExpRef="color.altLabel")}({attributeExpression:d,label:s,item:u,isDimension:n,qNumFormat:c,isCustomFormatted:f});break;case"libraryItem":!function(e){var t=e.attributeExpression,n=e.measures,r=e.item,i=e.qNumFormat,o=e.isCustomFormatted;e.isDimension||(t.matchMeasure=p.findIndexByPropertyValue(n,"qLibraryId",r.key),i&&(t.qNumFormat=i,t.isCustomFormatted=o)),void 0!==r.expression?t.qExpression=r.expression:t.qLibraryId=r.key,t.colorMapRef=r.key}({attributeExpression:d,measures:a,item:u,isDimension:n,qNumFormat:c,isCustomFormatted:f})}n?(d.qSortBy={qSortByAscii:1},l.qAttributeDimensions.push(d)):l.qAttributeExpressions.push(d)}}}function ie(e,t,n,r){var i,o,a,s={};switch(e){case"dimension":n.qLibraryId?(s.type="dimension",s.name=n.qLibraryId,s.id=n.qLibraryId):(s.type="field",t?(s.name=n.label||n.qDef,s.id=n.qDef):(s.name=n.qDef.qFieldDefs[0],s.label=(a=n.qDef).qLabelExpression?a.qLabelExpression:a.qFieldLabels&&a.qFieldLabels[0]?a.qFieldLabels[0]:a.qFieldDefs[0]));break;case"measure":i=function(e,t){return t?e.qLibraryId:d().measureBase.getLibraryId(e)}(n,t),i?(s.type="measure",s.name=i,s.id=i,o=function(e,t){return d().hasActiveModifiers({measures:[e]})&&t?e.qDef.qDef:void 0}(n,r),o&&(s.expression=o)):(s.type="expression",t?(s.name=n.label||n.qExpression,s.id=n.qExpression):(s.name=n.qDef.qDef,s.label=function(e){var t=e.qDef;return t.qLabelExpression?t.qLabelExpression:t.qLabel?t.qLabel:t.qDef}(n)));break;default:throw new Error('columnType should be "dimension" or "measure"')}return s}const oe={useMasterNumberFormat:function(e){e.quarantine={qNumFormat:e.qNumFormat||{},isCustomFormatted:e.isCustomFormatted||!1},e.qNumFormat=null,e.isCustomFormatted=void 0}};function ae(e,t,n,r){var i=n?"expression":t.type,o=e.color,a=o.mode,s=Z.getItemLabel(t);switch(ne(e,s||""),i){case"field":a="byDimension",o.byDimDef={label:t.label||Z.wrapFieldName(t.name),key:Z.wrapFieldName(t.name),type:"expression",activeDimensionIndex:t.activeDimensionIndex};break;case"expression":a="byMeasure",o.byMeasureDef={label:n||s,key:n||t.name,type:"expression",activeMeasureIndex:t.activeMeasureIndex};break;case"dimension":a="byDimension",o.byDimDef={label:t.name,key:t.id,type:"libraryItem",activeDimensionIndex:t.activeDimensionIndex};break;case"measure":a="byMeasure",o.byMeasureDef={label:t.name,key:t.id,expression:t.expression,type:"libraryItem",activeMeasureIndex:t.activeMeasureIndex},o.formatting&&oe.useMasterNumberFormat(o.formatting)}r||(o.auto=!1,o.mode=a)}function se(e,t){var n=o.getValue(e,"".concat(t,"qDimensions"),[]),r=o.getValue(e,"".concat(t,"qMeasures"),[]),i=o.getValue(e,"".concat(t,"qLayoutExclude.qHyperCubeDef.qDimensions"),[]),a=o.getValue(e,"color.byDimDef");if(a&&ne(e,a.label),function(e){return!!(e&&e.activeDimensionIndex>-1)}(a))!function(e,t){var n=o.getValue(e,"".concat(t,"qDimensions"),[]),r=o.getValue(e,"color.byDimDef");r.activeDimensionIndex=Math.min(r.activeDimensionIndex,n.length-1);var i=ie("dimension",!1,n[r.activeDimensionIndex]);i.activeDimensionIndex=r.activeDimensionIndex,ae(e,i)}(e,t);else if(function(e){return!e||!e.key}(a)&&function(e,t){var n=o.getValue(e,"".concat(t,"qDimensions"),[]),r=n[function(e,t,n){var r=o.getValue(t,"visualization"),i=n.split("."),a=Number(i[1]),s=o.getValue(t,"layers.".concat(a,".type"));return 2===e.length&&"map"===r&&"point"===s}(n,e,t)?0:n.length-1],i=K.IDMAP.COLOR_BY_ALTERNATIVE,a=p.findItemByPropertyValue(r.qAttributeDimensions,"id",i);return ae(e,ie("dimension",!!a,a||r)),!!a}(e,t))return;re({properties:e,isDimension:!0,dimensions:n,excludedDimensions:i,measures:r,label:o.getValue(e,"color.byDimDef.label")})}const le=function(e,t,n){o.setValue(e,t,n),o.isAtomicValue(n)&&function(e,t,n){var r=e.qLayoutExclude;r&&(r.changed||(r.changed={}),r.changed[t]={from:o.getValue(e,t),to:n})}(e,t,n)},ue=function(e,t){var n={primary:!0};if(e){var r=(Q[t]||Y).colorModeOptions||Y.colorModeOptions;n.byDimension=r.dimension(e),n.byMeasure=r.measure(e),n.byMultiple=r.multiColor(e),n.byExpression=r.expression(e)}return n},ce=function(e){var t=e.canColorBy,n=e.autoColor,r=e.colorMode,i=e.dimensions;return!(t[r]&&!n&&("byDimension"!==r&&"byMeasure"!==r||!i.length))},pe=function(e,t){var n,r=o.getValue(e,"color.mode"),i=o.getValue(e,"color.auto"),a=o.getValue(e,"".concat(t,"qDimensions"),[]),s=o.getValue(e,"".concat(t,"qMeasures"),[]),l=o.getValue(e,"".concat(t,"qLayoutExclude.qHyperCubeDef.qDimensions"),[]);i?te(a,l):!(n={auto:i,colorMode:r,dimensions:a}).auto&&"byDimension"===n.colorMode&&n.dimensions.length>0?se(e,t):function(e){var t=e.auto,n=e.colorMode,r=e.dimensions,i=e.measures,a=e.properties,s=o.getValue(a,"visualization");return!(t||"byMeasure"!==n||!r.length||"map"!==s&&!i.length)}({auto:i,colorMode:r,dimensions:a,measures:s,properties:e})?function(e,t){var n=o.getValue(e,"".concat(t,"qDimensions"),[]),r=o.getValue(e,"".concat(t,"qMeasures"),[]),i=o.getValue(e,"".concat(t,"qLayoutExclude.qHyperCubeDef.qDimensions"),[]),a=o.getValue(e,"color.byMeasureDef");if(a&&ne(e,a.label),function(e){return!!(e&&e.activeMeasureIndex>-1)}(a))!function(e,t){var n=o.getValue(e,"".concat(t,"qMeasures"),[]),r=o.getValue(e,"color.byMeasureDef");if(r.activeMeasureIndex=Math.min(r.activeMeasureIndex,n.length-1),r.activeMeasureIndex>-1){var i=ie("measure",!1,n[r.activeMeasureIndex],!0);i.activeMeasureIndex=r.activeMeasureIndex,ae(e,i)}}(e,t);else if(function(e,t){return(!e||!e.key)&&t.length>0}(a,r)&&function(e,t){var n=o.getValue(e,"".concat(t,"qDimensions"),[]),r=o.getValue(e,"".concat(t,"qMeasures"),[]),i=n[n.length-1],a=K.IDMAP.COLOR_BY_ALTERNATIVE,s=p.findItemByPropertyValue(i.qAttributeExpressions,"id",a);return ae(e,ie("measure",!!s,s||r[0])),!!s}(e,t))return;re({properties:e,isDimension:!1,dimensions:n,excludedDimensions:i,measures:r,label:o.getValue(e,"color.byMeasureDef.label")})}(e,t):function(e,t){var n=o.getValue(e,"color.mode"),r=o.getValue(e,"".concat(t,"qDimensions"),[]),i=o.getValue(e,"".concat(t,"qMeasures"),[]),a=o.getValue(e,"".concat(t,"qLayoutExclude.qHyperCubeDef.qDimensions"),[]);"byMultiple"===n&&i.length<2&&o.setValue(e,"color.mode","primary"),te(r,a)}(e,t)},fe=function(e){e.forEach((function(e){e.qOtherTotalSpec&&"qTotalMode"in e.qOtherTotalSpec&&delete e.qOtherTotalSpec.qTotalMode}))},de=function(e){var t=e.shouldUpdateColorBy,n=e.properties,r=o.getValue(n,"qHyperCubeDef.qMeasures",[]),i=o.getValue(n,"color.mode","");return!t&&"byExpression"===i&&r.length>0},me=function(e){var t=o.getValue(e,"qHyperCubeDef.qMeasures.0.qAttributeExpressions",[]),n=o.getValue(e,"color.colorExpression","");t.splice(0,0,{qExpression:n,id:"colorByExpression"}),o.setValue(e,"qHyperCubeDef.qMeasures.0.qAttributeExpressions",t)},he=function(e){o.setValue(e,"color.mode","primary"),o.setValue(e,"color.auto",!0)},ge=function(e){var t=o.getValue(e,"qHyperCubeDef.qDimensions",[]),n=o.getValue(e,"color.persistent",!1);return t.length>1&&!n},ye={exportProperties:function(e){var t=e.propertyTree,n=e.hypercubePath,r=e.viewDataMode,i=G.exportProperties({propertyTree:t,hypercubePath:n,viewDataMode:r}),o=i.data[0],a=o.dimensions.concat(o.excludedDimensions),s=o.measures.concat(o.excludedMeasures),l=K.IDMAP,u=l.COLOR_BY_ALTERNATIVE,c=l.COLOR_BY_EXPRESSION;return K.moveByIdFromGroup(a,[],"qAttributeDimensions",u),K.moveByIdFromGroup(a,[],"qAttributeExpressions",u),K.moveByIdFromGroup(s,[],"qAttributeExpressions",c),i},importProperties:function(e){var t=e.exportFormat,n=e.initialProperties,r=e.dataDefinition,i=e.defaultPropertyValues,a=e.hypercubePath,s=e.extension,l=e.supportedFilters,u=e.isHCModifierSupported,c=G.importProperties({exportFormat:t,initialProperties:n,dataDefinition:r,defaultPropertyValues:i,hypercubePath:a,extension:s,supportedFilters:l,isHCModifierSupported:u}),p=c.qProperty,f=o.getValue(p,"visualization"),d=o.getValue(p,"qHyperCubeDef.qDimensions",[]),m=o.getValue(p,"color.mode",""),h=o.getValue(p,"color.auto",""),g=ue(p,f),y=ce({canColorBy:g,autoColor:h,colorMode:m,dimensions:d});return g[m]?de({shouldUpdateColorBy:y,properties:p})&&me(p):he(p),y&&pe(p,"qHyperCubeDef."),ge(p)&&le(p,"color.persistent",!0),fe(d),c}};var ve=["bar","marker","line"];const be=function(e){var t=e.initialProperties,n=e.properties;t.measureAxis&&void 0===t.measureAxis.autoMinMax?$(n,"unsupportedAutoMinMax")||D()(n.measureAxis,t.measureAxis):$(n,"supportedAutoMinMax")||D()(n.measureAxis,t.measureAxis)},xe=function(e){var t,n=e.exportFormat,r=e.initialProperties,i=e.properties,o=e.measureType,a=i.qHyperCubeDef,s=i.measureAxis;if(function(e){var t=e.initialProperties;return!(!e.exportFormat.properties.measureAxes||t.measureAxes||!t.measureAxis||void 0===t.measureAxis.autoMinMax)}({exportFormat:n,initialProperties:r})){var l=function(e){var t=[];return e.qMeasures.length>0&&e.qMeasures.forEach((function(e){if(e.qDef.series){var n=e.qDef.series,r=n.type,i=n.axis;t[i]||(t[i]={axis:i,type:{line:0,marker:0,bar:0,total:0}}),ve.includes(r)&&t[i].type[r]++,t[i].type.total++}})),t}(a);l.length?(o&&(t=l.filter((function(e){return e.type[o]>0})).sort((function(e,t){return t.type[o]-e.type[o]}))),t&&t.length||(t=l.sort((function(e,t){return t.type.total-e.type.total}))),t&&t[0]&&D()(s,n.properties.measureAxes[t[0].axis])):D()(s,n.properties.measureAxes[0])}},qe=function(e){if(e.qDimensions.length>1){var t=e.qInterColumnSortOrder.indexOf(0);if(0!==t){var n=e.qInterColumnSortOrder[0];e.qInterColumnSortOrder[0]=0,e.qInterColumnSortOrder[t]=n}}},De={exportProperties:function(e){var t=e.propertyTree,n=e.hypercubePath,r=e.viewDataMode,i=e.supportedAutoMinMax,o=void 0===i||i,a=ye.exportProperties({propertyTree:t,hypercubePath:n,viewDataMode:r}),s=a.properties;return o?(x(s,"measureAxis.min","supportedAutoMinMax"),x(s,"measureAxis.max","supportedAutoMinMax")):(x(s,"measureAxis.min","unsupportedAutoMinMax"),x(s,"measureAxis.max","unsupportedAutoMinMax")),a},importProperties:function(e){var t=e.exportFormat,n=e.initialProperties,r=e.dataDefinition,i=e.defaultPropertyValues,o=e.hypercubePath,a=e.measureType,s=e.extension,l=e.supportedFilters,u=e.isHCModifierSupported,c=ye.importProperties({exportFormat:t,initialProperties:n,dataDefinition:r,defaultPropertyValues:i,hypercubePath:o,extension:s,supportedFilters:l,isHCModifierSupported:u}),p=c.qProperty;return be({initialProperties:n,properties:p}),xe({exportFormat:t,initialProperties:n,properties:p,measureType:a}),qe(p.qHyperCubeDef),p.qHyperCubeDef.qColumnOrder=[],p.qHyperCubeDef.columnOrder=[],c}};function Se(e,t,n){return"qLayoutExclude.quarantine.".concat(e,".").concat(t,".").concat(n)}function Me(e){var t=e.properties,n=e.arrayPath,r=e.quarantineName,i=e.arrayName,a=e.itemPath;o.getValue(t,n,[]).forEach((function(e){return function(e){var t=e.properties,n=e.quarantineName,r=e.arrayName,i=e.item,a=e.itemPath,s=o.getValue(i,a);if(void 0!==s){var l=o.getValue(i,"qDef.cId");l||(l=o.generateId(),o.setValue(i,"qDef.cId",l));var u=Se(n,r,l);o.setValue(t,u,s),o.setValue(i,a,void 0)}}({properties:t,quarantineName:r,arrayName:i,item:e,itemPath:a})}))}function Ae(e){var t=e.properties,n=e.arrayPath,r=e.quarantineName,i=e.arrayName,a=e.itemPath;o.getValue(t,n,[]).forEach((function(e){return function(e){var t=e.properties,n=e.quarantineName,r=e.arrayName,i=e.item,a=e.itemPath,s=o.getValue(i,"qDef.cId");if(s){var l=Se(n,r,s),u=o.getValue(t,l);void 0!==u&&(o.setValue(i,a,u),o.setValue(t,l,void 0))}}({properties:t,quarantineName:r,arrayName:i,item:e,itemPath:a})}))}var Ie="qHyperCubeDef.qMeasures",we="conditionalColoring",ke="measures",Ce="qDef.conditionalColoring";const Le={quarantine:function(e){Me({properties:e,arrayPath:Ie,quarantineName:we,arrayName:ke,itemPath:Ce})},unquarantine:function(e){Ae({properties:e,arrayPath:Ie,itemPath:Ce,arrayName:ke,quarantineName:we})}};var Ee="qHyperCubeDef.qMeasures",Ne="measures",Pe="qHyperCubeDef.qDimensions",Oe="dimensions",Fe="qHyperCubeDef.qLayoutExclude.qHyperCubeDef.qMeasures",Te="alternativeMeasures",Re="qHyperCubeDef.qLayoutExclude.qHyperCubeDef.qDimensions",Ve="alternativeDimensions",He="qCalcCondition",je="conditionalShowHide";const ze={quarantine:function(e){Me({properties:e,arrayPath:Ee,quarantineName:je,arrayName:Ne,itemPath:He}),Me({properties:e,arrayPath:Pe,quarantineName:je,arrayName:Oe,itemPath:He})},unquarantine:function(e){Ae({properties:e,arrayPath:Ee,quarantineName:je,arrayName:Ne,itemPath:He}),Ae({properties:e,arrayPath:Pe,quarantineName:je,arrayName:Oe,itemPath:He})},quarantineAlternative:function(e){Me({properties:e,arrayPath:Fe,quarantineName:je,arrayName:Te,itemPath:He}),Me({properties:e,arrayPath:Re,quarantineName:je,arrayName:Ve,itemPath:He})},unquarantineAlternative:function(e){Ae({properties:e,arrayPath:Fe,quarantineName:je,arrayName:Te,itemPath:He}),Ae({properties:e,arrayPath:Re,quarantineName:je,arrayName:Ve,itemPath:He})}},_e={hypercube:G,colorChart:ye,axisChart:De,quarantineProperty:x,unquarantineProperty:$,quarantineArrayProp:Me,unquarantineArrayProp:Ae,conditionalColoring:Le,conditionalShow:ze}})(),r.default})()),Yt.exports),Qt=Kt(Jt);function en(e){return{dimensions:{min:0,max:0},measures:{min:1,max:1,description:()=>e.translator.get("Visualizations.Descriptions.Gauge.Measure")}}}const tn=(e,t,n)=>{const r=function(e){var t=e.theme,n=e.translator,r=e.config,i=void 0===r?{}:r,o=e.flags,a=function(e){var t=e.config,n=void 0===t?{}:t,r=n.id,i=n.paths;return{id:void 0===r?"object":"".concat("object",".").concat(r),paths:Array.isArray(i)?i:[]}}({config:i}),s=a.id,l=a.paths,u={};l.forEach((function(e){for(var r=e.split("."),i=u,a=0;a<r.length;a++){var l=r[a];a===r.length-1?i[l]=O({theme:t,translator:n,id:s,path:e,flags:o}):void 0===i[l]&&(i[l]={}),i=i[l]}}));var c=function(e){for(var t=e.split("."),n=u,r=0;r<t.length;r++){var i=t[r];if(void 0===n[i])throw new Error("font-resolver: Path '".concat(e,"' could not be resolved."));n=n[i]}return n};return u.getDefaultValue=function(e){return c(e).getDefaultValue()},u.getOptions=function(e){return c(e).getOptions()},u}({theme:n,translator:t,flags:e,config:{id:"gauge",paths:["axis.title","axis.label.name","label.value"]}});return{component:"styling-panel",chartTitle:"Object.Gauge",translation:"LayerStyleEditor.component.styling",useBackground:!0,subtitle:"LayerStyleEditor.component.styling",ref:"components",useGeneral:!0,items:{axisTitleSection:{translation:"properties.axis.title",component:"panel-section",items:{labelSection:{component:"items",ref:"components",key:"axis",items:{fontWrapper:{component:"inline-wrapper",items:{fontFamily:{ref:"axis.title.fontFamily",component:"dropdown",options:()=>r.getOptions("axis.title.fontFamily"),defaultValue:()=>r.getDefaultValue("axis.title.fontFamily")},fontColor:{ref:"axis.title.color",component:"color-picker",defaultValue:()=>({color:n.getStyle("object.gauge","axis.title","color")}),width:!1}}}}}}},axisLabelSection:{translation:"properties.axis.label",component:"panel-section",items:{labelSection:{component:"items",ref:"components",key:"axis",items:{fontWrapper:{component:"inline-wrapper",items:{fontFamily:{ref:"axis.label.name.fontFamily",component:"dropdown",options:()=>r.getOptions("axis.label.name.fontFamily"),defaultValue:()=>r.getDefaultValue("axis.label.name.fontFamily"),width:!0},fontColor:{ref:"axis.label.name.color",component:"color-picker",defaultValue:()=>({color:n.getStyle("object.gauge","axis.label.name","color")}),width:!1}}}}}}},valueLabelSection:{translation:"properties.value.label",component:"panel-section",items:{labelSection:{component:"items",ref:"components",key:"value",items:{fontWrapper:{component:"inline-wrapper",items:{fontFamily:{ref:"label.value.fontFamily",component:"dropdown",options:()=>r.getOptions("label.value.fontFamily"),defaultValue:()=>r.getDefaultValue("label.value.fontFamily"),width:!0},fontColor:{ref:"label.value.color",component:"color-picker",defaultValue:()=>({color:n.getStyle("object.gauge","label.value","color")}),width:!1}}}}}}}}}};let nn;function rn(e){return"measure"===Mt(e,"color.useBaseColors")}function on(e){const{flags:t,translator:n,sense:r}=e,i=null==r?void 0:r.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,n,r)=>"labels"===r.measureAxis.show||"none"===r.measureAxis.show,set(e,t,n,r,i){i.measureAxis.show=e?"labels":"all"}}}}}}},presentation:{type:"items",grouped:!0,translation:"properties.presentation",items:{styleEditor:tn(t,n,i),rangeLimits:{type:"items",items:{text:{component:"text",translation:"properties.axis.rangeLimits",style:"sHeader"},min:{ref:"measureAxis.min",translation:"properties.axis.min",type:"number",expression:"optional",invalid:e=>e.measureAxis&&e.measureAxis.min>=e.measureAxis.max},max:{ref:"measureAxis.max",translation:"Common.Max",type:"number",expression:"optional",defaultValue:100,invalid:e=>e.measureAxis&&e.measureAxis.min>=e.measureAxis.max}}},type:{ref:"gaugetype",type:"string",component:"item-selection-list",defaultValue:"radial",horizontal:!0,items:[{icon:"gauge_gauge",component:"icon-item",labelPlacement:"bottom",translation:"properties.gauge.radial",value:"radial"},{icon:"gauge_vertical_bar",component:"icon-item",labelPlacement:"bottom",translation:"properties.gauge.bar",value:"bar"}],change(e){"radial"===e.gaugetype?(nn=e.orientation,e.orientation="horizontal"):e.orientation=nn}},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=(n=e.segmentInfo).paletteColors&&n.paletteColors.length?n.paletteColors:n.colors&&n.colors.length?n.colors:void 0;var n;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(!i)return-1;const{primary:t}=i.getDataColorSpecials(),n=null===(e=i.getDataColorPickerPalettes()[0])||void 0===e?void 0:e.colors,r=n.indexOf(t);return{index:-1===r?Math.min(6,n.length-1):r}},show:e=>!rn(e)&&!e.useSegments},maxSegments:{ref:"maxSegments",type:"number",defaultValue:6,show:!1},segmentInfo:{ref:"segments",type:"items",component:"color-scale-creator",show:e=>!rn(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},importProperties:(t,n,r,i)=>Qt.axisChart.importProperties({exportFormat:t,initialProperties:n,hypercubePath:i,extension:r,dataDefinition:en(e)}),exportProperties:(e,t,n)=>Qt.axisChart.exportProperties({propertyTree:e,hyperCubePath:t,viewDataMode:n,supportedAutoMinMax:!1})}}const an={require:["chart","renderer"],renderer:"dom",render(e){var t;return function({chart:e,settings:t,h:n}){if(!e)return[];const r=function({h:e,settings:t}){if(!t)return[];const{isRtl:n,title:r,text:i}=t,o={disclaimer:{borderRadius:"10px",border:"1px solid #404040",position:"absolute",top:"10%",left:"50%",margin:"0 0 0 -150px",width:"298px",cursor:"default",background:"white",direction:n?"rtl":"ltr"},closeIcon:{position:"absolute",[n?"left":"right"]:"5px",top:"3px",cursor:"pointer",color:"#595959",pointerEvents:"auto"},dmHeader:{color:"#575859",fontSize:"18px",paddingLeft:"20px",paddingTop:"10px",paddingRight:"20px",paddingBottom:"0px",maxHeight:"44px",overflow:"hidden"},dmMain:{display:"block",color:"#575859",paddingLeft:"20px",paddingRight:"20px",paddingTop:"10px",paddingBottom:"10px"},dmP:{paddingBottom:"10px"},hidden:{display:"none"}};return[e("div",{style:o.disclaimer},e("div",{style:o.closeIcon,onClick:()=>null==t?void 0:t.close()},e("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 16 16"},e("defs",{},e("path",{id:"remove-a",d:"M9.41421356,8 L11.8890873,5.52512627 C12.065864,5.34834957 12.0305087,4.95944084 11.8183766,4.74730881 L11.2526912,4.18162338 C11.0405592,3.96949135 10.6516504,3.93413601 10.4748737,4.1109127 L8,6.58578644 L5.52512627,4.1109127 C5.34834957,3.93413601 4.95944084,3.96949135 4.74730881,4.18162338 L4.25233406,4.67659813 C3.96949135,4.95944084 3.93413601,5.34834957 4.1109127,5.52512627 L6.58578644,8 L4.1109127,10.4748737 C3.93413601,10.6516504 3.96949135,11.0405592 4.18162338,11.2526912 L4.67659813,11.7476659 C4.95944084,12.0305087 5.34834957,12.065864 5.52512627,11.8890873 L8,9.41421356 L10.4748737,11.8890873 C10.6516504,12.065864 11.0405592,12.0305087 11.2526912,11.8183766 L11.8183766,11.2526912 C12.0305087,11.0405592 12.065864,10.6516504 11.8890873,10.4748737 L9.41421356,8 Z M8,0 C12.4,0 16,3.6 16,8 C16,12.4 12.4,16 8,16 C3.6,16 0,12.4 0,8 C0,3.6 3.6,0 8,0 Z"})),e("use",{xlinkHref:"#remove-a"}))),e("header",{style:o.dmHeader},`${r}`),e("main",{style:o.dmMain},e("p",{style:o.dmP},`${i}`)))]}({settings:t,h:n});return r}({chart:this.chart,settings:null===(t=this.settings)||void 0===t?void 0:t.settings,h:e})}},sn=52,ln=-2*Math.PI/3,un=2*Math.PI/3,cn="#EEEEEE",pn=2.38,fn={MIN:12,MAX:60},dn={MIN:100,MAX:1e3},mn={TOP:-4,BOTTOM:0,LEFT:4,RIGHT:4},hn={VERTICAL_ALIGNMENT_FACTOR:.4},gn={VERTICAL_ALIGNMENT_FACTOR:1.25},yn=2,vn=1.2,bn="#595959",xn="#E6E6E6",qn=.4,Dn=1,Sn=2,Mn=.75,An=.75,In={MAX_WIDTH:150,MAX_LINES:2,CLEARANCE:12,ESTIMATED_LINE_HEIGHT:16,GAP:8},wn=70,kn=3,Cn={MEASURE:"measure"},Ln={BAR:"bar",SEGMENT_BAR:"segment-bar",LABEL_BAR:"label-bar",BACKGROUND_BAR:"background-bar",MARK:"mark",OOB_INDICATOR:"oob-indicator",BAR_AXIS:"bar-axis",AXIS_TITLE:"axis-title",GAUGE_LABEL:"gauge-label",RADIAL_AXIS:"radial-axis",RADIAL_GAUGE_NEEDLE:"radial-gauge-needle",RADIAL_OOB_INDICATOR_MIN:"radial-oob-indicator-min",RADIAL_OOB_INDICATOR_MAX:"radial-oob-indicator-max",RADIAL_GAUGE:"radial-gauge",CIRCLE_GAUGE:"circle-gauge",REFERENCE_LINES_AND_LABELS:"reference-lines-and-labels",RADIAL_SPARK:"radial-spark",RADIAL_GAUGE_LABEL:"radial-gauge-label",RADIAL_REFERENCE_LINES:"radial-reference-lines",SEGMENT_RADIAL_GAUGE:"segment-radial-gauge",LABEL_RADIAL_GAUGE:"label-radial-gauge"},En="color",Nn=1e-4,Pn="XSMALL",On="SMALL",Fn="XSMALL_VERTICAL",Tn="XSMALL_HORIZONTAL",Rn="SMALL",Vn="MEDIUM",Hn={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}},jn=600,zn=200,_n=500;function Bn(e,t,n){e.prototype=t.prototype=n,n.constructor=e}function $n(e,t){var n=Object.create(e.prototype);for(var r in t)n[r]=t[r];return n}function Gn(){}var Un=.7,Wn=1/Un,Xn="\\s*([+-]?\\d+)\\s*",Kn="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",Zn="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",Yn=/^#([0-9a-f]{3,8})$/,Jn=new RegExp(`^rgb\\(${Xn},${Xn},${Xn}\\)$`),Qn=new RegExp(`^rgb\\(${Zn},${Zn},${Zn}\\)$`),er=new RegExp(`^rgba\\(${Xn},${Xn},${Xn},${Kn}\\)$`),tr=new RegExp(`^rgba\\(${Zn},${Zn},${Zn},${Kn}\\)$`),nr=new RegExp(`^hsl\\(${Kn},${Zn},${Zn}\\)$`),rr=new RegExp(`^hsla\\(${Kn},${Zn},${Zn},${Kn}\\)$`),ir={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 or(){return this.rgb().formatHex()}function ar(){return this.rgb().formatRgb()}function sr(e){var t,n;return e=(e+"").trim().toLowerCase(),(t=Yn.exec(e))?(n=t[1].length,t=parseInt(t[1],16),6===n?lr(t):3===n?new fr(t>>8&15|t>>4&240,t>>4&15|240&t,(15&t)<<4|15&t,1):8===n?ur(t>>24&255,t>>16&255,t>>8&255,(255&t)/255):4===n?ur(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=Jn.exec(e))?new fr(t[1],t[2],t[3],1):(t=Qn.exec(e))?new fr(255*t[1]/100,255*t[2]/100,255*t[3]/100,1):(t=er.exec(e))?ur(t[1],t[2],t[3],t[4]):(t=tr.exec(e))?ur(255*t[1]/100,255*t[2]/100,255*t[3]/100,t[4]):(t=nr.exec(e))?vr(t[1],t[2]/100,t[3]/100,1):(t=rr.exec(e))?vr(t[1],t[2]/100,t[3]/100,t[4]):ir.hasOwnProperty(e)?lr(ir[e]):"transparent"===e?new fr(NaN,NaN,NaN,0):null}function lr(e){return new fr(e>>16&255,e>>8&255,255&e,1)}function ur(e,t,n,r){return r<=0&&(e=t=n=NaN),new fr(e,t,n,r)}function cr(e){return e instanceof Gn||(e=sr(e)),e?new fr((e=e.rgb()).r,e.g,e.b,e.opacity):new fr}function pr(e,t,n,r){return 1===arguments.length?cr(e):new fr(e,t,n,null==r?1:r)}function fr(e,t,n,r){this.r=+e,this.g=+t,this.b=+n,this.opacity=+r}function dr(){return`#${yr(this.r)}${yr(this.g)}${yr(this.b)}`}function mr(){const e=hr(this.opacity);return`${1===e?"rgb(":"rgba("}${gr(this.r)}, ${gr(this.g)}, ${gr(this.b)}${1===e?")":`, ${e})`}`}function hr(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function gr(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function yr(e){return((e=gr(e))<16?"0":"")+e.toString(16)}function vr(e,t,n,r){return r<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new xr(e,t,n,r)}function br(e){if(e instanceof xr)return new xr(e.h,e.s,e.l,e.opacity);if(e instanceof Gn||(e=sr(e)),!e)return new xr;if(e instanceof xr)return e;var t=(e=e.rgb()).r/255,n=e.g/255,r=e.b/255,i=Math.min(t,n,r),o=Math.max(t,n,r),a=NaN,s=o-i,l=(o+i)/2;return s?(a=t===o?(n-r)/s+6*(n<r):n===o?(r-t)/s+2:(t-n)/s+4,s/=l<.5?o+i:2-o-i,a*=60):s=l>0&&l<1?0:a,new xr(a,s,l,e.opacity)}function xr(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}function qr(e){return(e=(e||0)%360)<0?e+360:e}function Dr(e){return Math.max(0,Math.min(1,e||0))}function Sr(e,t,n){return 255*(e<60?t+(n-t)*e/60:e<180?n:e<240?t+(n-t)*(240-e)/60:t)}Bn(Gn,sr,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:or,formatHex:or,formatHex8:function(){return this.rgb().formatHex8()},formatHsl:function(){return br(this).formatHsl()},formatRgb:ar,toString:ar}),Bn(fr,pr,$n(Gn,{brighter(e){return e=null==e?Wn:Math.pow(Wn,e),new fr(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=null==e?Un:Math.pow(Un,e),new fr(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new fr(gr(this.r),gr(this.g),gr(this.b),hr(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:dr,formatHex:dr,formatHex8:function(){return`#${yr(this.r)}${yr(this.g)}${yr(this.b)}${yr(255*(isNaN(this.opacity)?1:this.opacity))}`},formatRgb:mr,toString:mr})),Bn(xr,(function(e,t,n,r){return 1===arguments.length?br(e):new xr(e,t,n,null==r?1:r)}),$n(Gn,{brighter(e){return e=null==e?Wn:Math.pow(Wn,e),new xr(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=null==e?Un:Math.pow(Un,e),new xr(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=this.h%360+360*(this.h<0),t=isNaN(e)||isNaN(this.s)?0:this.s,n=this.l,r=n+(n<.5?n:1-n)*t,i=2*n-r;return new fr(Sr(e>=240?e-240:e+120,i,r),Sr(e,i,r),Sr(e<120?e+240:e-120,i,r),this.opacity)},clamp(){return new xr(qr(this.h),Dr(this.s),Dr(this.l),hr(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=hr(this.opacity);return`${1===e?"hsl(":"hsla("}${qr(this.h)}, ${100*Dr(this.s)}%, ${100*Dr(this.l)}%${1===e?")":`, ${e})`}`}}));const Mr=Math.PI/180,Ar=180/Math.PI,Ir=.96422,wr=.82521,kr=4/29,Cr=6/29,Lr=3*Cr*Cr,Er=Cr*Cr*Cr;function Nr(e){if(e instanceof Pr)return new Pr(e.l,e.a,e.b,e.opacity);if(e instanceof Hr)return jr(e);e instanceof fr||(e=cr(e));var t,n,r=Rr(e.r),i=Rr(e.g),o=Rr(e.b),a=Or((.2225045*r+.7168786*i+.0606169*o)/1);return r===i&&i===o?t=n=a:(t=Or((.4360747*r+.3850649*i+.1430804*o)/Ir),n=Or((.0139322*r+.0971045*i+.7141733*o)/wr)),new Pr(116*a-16,500*(t-a),200*(a-n),e.opacity)}function Pr(e,t,n,r){this.l=+e,this.a=+t,this.b=+n,this.opacity=+r}function Or(e){return e>Er?Math.pow(e,1/3):e/Lr+kr}function Fr(e){return e>Cr?e*e*e:Lr*(e-kr)}function Tr(e){return 255*(e<=.0031308?12.92*e:1.055*Math.pow(e,1/2.4)-.055)}function Rr(e){return(e/=255)<=.04045?e/12.92:Math.pow((e+.055)/1.055,2.4)}function Vr(e,t,n,r){return 1===arguments.length?function(e){if(e instanceof Hr)return new Hr(e.h,e.c,e.l,e.opacity);if(e instanceof Pr||(e=Nr(e)),0===e.a&&0===e.b)return new Hr(NaN,0<e.l&&e.l<100?0:NaN,e.l,e.opacity);var t=Math.atan2(e.b,e.a)*Ar;return new Hr(t<0?t+360:t,Math.sqrt(e.a*e.a+e.b*e.b),e.l,e.opacity)}(e):new Hr(e,t,n,null==r?1:r)}function Hr(e,t,n,r){this.h=+e,this.c=+t,this.l=+n,this.opacity=+r}function jr(e){if(isNaN(e.h))return new Pr(e.l,0,0,e.opacity);var t=e.h*Mr;return new Pr(e.l,Math.cos(t)*e.c,Math.sin(t)*e.c,e.opacity)}function zr(e){return function(e){return Vr(e).l<70}(e)?xn:bn}function _r(e,t=!0){let n="";for(let t=0;t<e.length;t++){const r=e[t];n+=0===t?`M${r.x} ${r.y}`:`L${r.x} ${r.y}`,n+=" "}return t&&(n+="Z"),n}function Br(e){const{angle:t,origin:n}=e,r=e.points.map((e=>function(e,t,n={x:0,y:0}){const r=Math.cos(t),i=Math.sin(t),o=(s=n,{x:(a=e).x-s.x,y:a.y-s.y});var a,s;return function(e,t){return{x:e.x+t.x,y:e.y+t.y}}({x:r*o.x-i*o.y,y:i*o.x+r*o.y},n)}(e,t,n)));return{type:"path",fill:e.fill,d:_r(r)}}Bn(Pr,(function(e,t,n,r){return 1===arguments.length?Nr(e):new Pr(e,t,n,null==r?1:r)}),$n(Gn,{brighter(e){return new Pr(this.l+18*(null==e?1:e),this.a,this.b,this.opacity)},darker(e){return new Pr(this.l-18*(null==e?1:e),this.a,this.b,this.opacity)},rgb(){var e=(this.l+16)/116,t=isNaN(this.a)?e:e+this.a/500,n=isNaN(this.b)?e:e-this.b/200;return new fr(Tr(3.1338561*(t=Ir*Fr(t))-1.6168667*(e=1*Fr(e))-.4906146*(n=wr*Fr(n))),Tr(-.9787684*t+1.9161415*e+.033454*n),Tr(.0719453*t-.2289914*e+1.4052427*n),this.opacity)}})),Bn(Hr,Vr,$n(Gn,{brighter(e){return new Hr(this.h,this.c,this.l+18*(null==e?1:e),this.opacity)},darker(e){return new Hr(this.h,this.c,this.l-18*(null==e?1:e),this.opacity)},rgb(){return jr(this).rgb()}}));const $r={require:["chart"],defaultSettings:{settings:{},style:{}},render(){var e;return function({chart:e,settings:t}){if(!e||!t)return[];const{size:n,component:r,selector:i,pointingTo:o,isRtl:a}=t;if(!e.component(t.component))return[];const s=e.findShapes(i).filter((e=>e.key===r));if(null==s||!s.length)return[];const{clientWidth:l,clientHeight:u}=e.element;let c=l/2,p=u/2,f=-Math.PI/2;const d=n/3;switch(o){case"top":p=d;break;case"bottom":p=u-d,f=3*Math.PI/2-Math.PI;break;case"right":c=l-d,f=0;break;case"left":c=d,f=Math.PI}const m=[];for(let e=0;e<s.length;e+=1){const t=s[e];let i=["top",...a?["left"]:["right"]].includes(o)?t.attrs.fill:cn;if(r===Ln.SEGMENT_BAR){const{stops:e}=t.attrs.fill;if(["top","right"].includes(o)){const t=e.find((e=>1===e.offset));i=(null==t?void 0:t.color)||bn}else{const t=e.toReversed().find((e=>0===e.offset));i=(null==t?void 0:t.color)||bn}}const l=zr(i),u={x:c,y:p},d=n/6,h=Br({points:[{x:u.x+2*d,y:u.y},{x:u.x,y:u.y+d},{x:u.x,y:u.y-d}],angle:f,fill:l,origin:u});m.push(h)}return m}({chart:this.chart,settings:null===(e=this.settings)||void 0===e?void 0:e.settings})}};function Gr({services:e}){var t,n,r,i;const{colorService:o,layoutService:a,themeService:s}=e,{useBaseColors:l}=a.getLayout().color||{},{baseColor:u}=(null===(t=a.getLayout().qHyperCube)||void 0===t?void 0:t.qMeasureInfo[0].coloring)||{};if("measure"!==l||!u)return o.getColor();const c=(null===(n=s.getTheme().getDataColorPickerPalettes()[0])||void 0===n?void 0:n.colors)||[];let p=null!==(r=u.color)&&void 0!==r?r:bn;const f=null!==(i=u.index)&&void 0!==i?i:-1;return c.length>0&&f>-1&&f<c.length&&(p=c[f]),()=>p}function Ur(e,t,n,r){const i=Math.floor(Math.min(e,t)),o=Math.abs(r-n),a=.02*Math.tan(-o/4+Math.PI/2),s=2*(.4+a)-Zr(e,t)/i;return{innerRadius:s-2*(i>500?50:Math.max(i/_n*50,10))/i,outerRadius:s,radiusIncrease:a,labelGaugeRadius:1.39*(.4+a)}}function Wr(e,t,n,r){const i=r-Math.PI/2;return{x:e+n*Math.cos(i),y:t+n*Math.sin(i)}}function Xr({innerRadius:e,outerRadius:t,width:n,height:r}){return(t-e)*Math.min(n,r)/2}function Kr(e){return!1!==e.show&&0!==e.show&&"0"!==e.show}function Zr(e,t){return Math.min(6,Math.min(e,t)/zn)}const Yr={require:["chart","symbol"],defaultSettings:{settings:{},style:{}},render(){var e;return function({chart:e,settings:t,symbol:n}){if(!e||!t||!n)return[];const{valueAngle:r}=t;if(!e.component(t.component))return[];const{clientWidth:i,clientHeight:o}=e.element,{outerRadius:a,innerRadius:s}=Ur(i,o,ln,un),l=Xr({innerRadius:s,outerRadius:a,width:i,height:o});let u=i/2,c=o/2,p=a*Math.min(i,o)/2,f=Wr(u,c,p,t.valueAngle),d=f.x,m=f.y;const h=[],g=cn,y=t.fill||zr(g),v={x:d,y:m},b=l/6;let x=[{x:v.x+.3*b,y:v.y},{x:v.x-7.5*b,y:v.y+b},{x:v.x-7.5*b,y:v.y-b}];const q=r-Math.PI/2,D=Br({points:x,angle:q,fill:y,origin:v});return D.data={pointerWidth:b,angle:q,radius:p,fill:y},h.push(D),h}({chart:this.chart,settings:null===(e=this.settings)||void 0===e?void 0:e.settings,symbol:this.symbol})}};const Jr={require:["chart","symbol"],defaultSettings:{settings:{},style:{}},render(){var e;return function({chart:e,settings:t,symbol:n}){if(!e||!t||!n)return[];const{size:r,component:i,selector:o,angle:a,radius:s}=t;if(!e.component(t.component))return[];const l=e.findShapes(o).filter((e=>e.key===i));if(null==l||!l.length)return[];const{clientWidth:u,clientHeight:c}=e.element;let p=u/2,f=c/2,{x:d,y:m}=Wr(p,f,s,a);const h=[],g=t.fill,y=a===ln?-1:1,v={x:d,y:m},b=r/6,x=Br({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:a,fill:g,origin:v});return h.push(x),h}({chart:this.chart,settings:null===(e=this.settings)||void 0===e?void 0:e.settings,symbol:this.symbol})}};var Qr,ei;var ti=function(){if(ei)return Qr;ei=1;var e=Object.prototype.hasOwnProperty,t=Object.prototype.toString,n=Object.defineProperty,r=Object.getOwnPropertyDescriptor,i=function(e){return"function"==typeof Array.isArray?Array.isArray(e):"[object Array]"===t.call(e)},o=function(n){if(!n||"[object Object]"!==t.call(n))return!1;var r,i=e.call(n,"constructor"),o=n.constructor&&n.constructor.prototype&&e.call(n.constructor.prototype,"isPrototypeOf");if(n.constructor&&!i&&!o)return!1;for(r in n);return void 0===r||e.call(n,r)},a=function(e,t){n&&"__proto__"===t.name?n(e,t.name,{enumerable:!0,configurable:!0,value:t.newValue,writable:!0}):e[t.name]=t.newValue},s=function(t,n){if("__proto__"===n){if(!e.call(t,n))return;if(r)return r(t,n).value}return t[n]};return Qr=function e(){var t,n,r,l,u,c,p=arguments[0],f=1,d=arguments.length,m=!1;for("boolean"==typeof p&&(m=p,p=arguments[1]||{},f=2),(null==p||"object"!=typeof p&&"function"!=typeof p)&&(p={});f<d;++f)if(null!=(t=arguments[f]))for(n in t)r=s(p,n),p!==(l=s(t,n))&&(m&&l&&(o(l)||(u=i(l)))?(u?(u=!1,c=r&&i(r)?r:[]):c=r&&o(r)?r:{},a(p,{name:n,newValue:e(m,c,l)})):void 0!==l&&a(p,{name:n,newValue:l}));return p},Qr}(),ni=Kt(ti);let ri;function ii(){ri=ri||document.createElement("canvas").getContext("2d")}const oi={measureTextWidth(e){ii();const{width:t}=ri.measureText(e);return t},lineWrap(e,t,n,r){let i,o;ii();const a=e?e.split(/\n+|\r+|\r\n/):[],s=[];let l,u,c,p,f=e?e.split(/\s+/):[],d=a[0];if("number"!=typeof t||t<=0)return[e];if("number"==typeof r&&a.length>=r)return a.slice(0,r);for(n&&(ri.font=n),o=0;o<a.length;o++){for(p=a[o],f=p.split(/\s+/),[d]=f,c="",i=1;i<f.length;i++)if(l=`${d} ${f[i]}`,u=oi.measureTextWidth(l),u>t&&("number"!=typeof r||r>s.length)?(s.push(d),d=f[i]):d=l,"number"==typeof r&&s.length>=r){c=f.slice(i+1).join(" ");break}"number"!=typeof r||s.length<r?s.push(d):s[Math.max(0,s.length-1)]=`${s[Math.max(0,s.length-1)]} ${d} ${c}`}return s},wordWrap(e,t,n,r,i){if(ii(),!e||!e.length)return[];n&&(ri.font=n);let o=[];const a=e.slice();let s,l,u,c="";if(a.filter((e=>!!e)),"number"!=typeof t||t<0)return e.slice();for(u=0;u<a.length;u++){var p;if(l=a[u],c="",l.length<=1||oi.measureTextWidth(l)<=t)o.push(l);else if(s=oi.splitWord(l,t,void 0,void 0===r?void 0:r-o.length),s.length<=1)o.push(s[0]);else c=null!==(p=s.pop())&&void 0!==p?p:"",o=o.concat(s),a[u+1]?oi.measureTextWidth(`${c} ${a[u+1]}`)>t&&(void 0===r||o.length+a.length-u<=r)?a.splice(u+1,0,c):a[u+1]=`${c} ${a[u+1]}`:a.push(c)}return o.forEach(((e,t,n)=>{n[t]=e.trim()})),void 0!==r&&o.length>r?(o=o.splice(0,r),o[o.length-1]=oi.truncate(o[o.length-1],t,n,i).text):(l=o[o.length-1],l&&l.length>1&&oi.measureTextWidth(l)>t&&(o[o.length-1]=oi.truncate(l,t,n,i).text)),o},truncate(e,t,n,r="…"){ii();let i,o,a,s,l=e;const u=oi.measureTextWidth("i");if(n&&(ri.font=n),e&&t){if(oi.measureTextWidth(l)>t){const e=Math.ceil(t/u);for(i=Math.min(e,l.length);i>0;i--)if(o=l.substring(0,i-1),a=o.trim()+r,oi.measureTextWidth(a)<=t){s=l.substring(i-1),l=a;break}i||(s=l,l="…")}}else s=void 0;return{text:l,rest:s}},isNumber:e=>"number"==typeof e&&Number.isFinite(e),explodeWord(e,t,n,r){let i;ii();let o,a=e,s="",l=[];if(void 0!==n&&oi.isNumber(n)&&n<=1)return[e];const u=Math.ceil(t/r);for(i=Math.min(e.length,u);i>0&&(a=e.substring(0,i),o=e.substring(i-1,i)," "===o?a=e.substring(0,i-1):a+="-",s=e.substring(i),!(oi.measureTextWidth(a)<=t));i--);return(!i&&!a||oi.measureTextWidth(a)>t)&&(a=e.substring(0,1),s=e.substring(1)),l.push(a),s?(oi.measureTextWidth(s)>t?l=l.concat(oi.explodeWord(s,t,void 0===n?void 0:n-1,r)):l.push(s),l.filter((e=>""!==e.trim()))):l},splitWord:(e,t,n,r)=>(ii(),e&&t?(n&&(ri.font=n),oi.explodeWord(e,t,r,Math.max(1,oi.measureTextWidth("i")))):[]),wrapText(e,t,n,r,i="…"){let o;return Number.isNaN(t)||!t?[e]:(o=void 0===r||r>1?oi.lineWrap(e,t,n,r):[e],o=oi.wordWrap(o,t,n,r,i),o)},getFontHeight:e=>(ii(),e&&(ri.font=e),1.5*oi.measureTextWidth("m")),tokenize(e,t,n,r,i,o,a=1){ii(),t&&(ri.font=t);const s=oi.getFontHeight(),l=a*s;let u=[],c=[];if(void 0!==o&&o<s)return[];const p=o?Math.max(1,Math.floor(o/l)):r||1;return u=[void 0===r||Number.isNaN(r)||r<=0?p:Math.min(p,r)],Array.isArray(e)?e.forEach(((e,n)=>{c.length<p&&(c=c.concat(oi.wrapText(e,i,t,u[n])))})):c=oi.wrapText(e,i,t,u[0],n),c}};function ai({chart:e,renderer:t,refLine:n,settings:r,width:i,height:o,barWidth:a}){if(!e||!t||!r)return{};const{position:s,scale:l,value:u,label:c,line:p,formatter:f,cId:d}=n,m=n.radius?n.radius*(Math.min(i,o)/2):i/2,h=(un-ln)*s+ln-Math.PI/2,g={x:i/2,y:o/2};let y=ni(!0,{},r.style.line,p||{});const v={type:"line",cId:d,...{x1:g.x+Math.cos(h)*m,y1:g.y+Math.sin(h)*m,x2:g.x+Math.cos(h)*(m+a),y2:g.y+Math.sin(h)*(m+a)},data:{angle:h,innerRadius:m},stroke:y.stroke,strokeWidth:y.strokeWidth,strokeDasharray:y.strokeDasharray};let b;if(c){const n=ni(!0,{fill:"#000",fontFamily:"Arial",fontSize:"12px",opacity:1,padding:5,background:{fill:"#fff",stroke:"transparent",strokeWidth:0,opacity:.5}},r.style.label||{},{fill:y.stroke},c),{fontFamily:s,fontSize:p,fill:v,opacity:x}=n,q=c.showLabel?n.text:"";let D,S="";if("string"==typeof f||"object"==typeof f)D=e.formatter(f);else if(void 0!==l&&"string"!=typeof l&&"function"==typeof l.data){const e=l.data()&&l.data().fields;D=e&&e[0]?e[0].formatter():null}!1!==c.showValue&&(D?S=` (${D("function"==typeof u?u():u)})`:l&&(S=` (${u})`));const M=e=>t.measureText({text:e,fontFamily:s,fontSize:p}),A=M("M").height,I=`normal ${p} ${s}`;let w,k=kn;const C=`${q}${S}`||"",L=Math.min(i,o),E=Math.min(8,L/200),N=Wr(g.x,g.y,m+a+E,h+Math.PI/2),P=M(C).width;w=Math.min(N.x,i-N.x-pn,wn),k=function(e,t,n){const r=Math.min(Math.floor((e+pn)/t),Math.floor((n-e)/t));return Math.min(r,kn)}(N.y,A,o);let O=oi.tokenize(C,I,`... ${S}`,k,w,void 0);const F=function(e){let t="start";const n=e>-Math.PI&&e<0?"baseline":"hanging";return(e+=Math.PI/2)<0&&e>-Math.PI?t="end":e>0&&e<Math.PI&&(t="start"),{textAnchor:t,baseline:n}}(h);N.y-2*A>0&&N.y+2*A<o&&(N.x-P+pn<0&&"end"===F.textAnchor||N.x+P-pn>i)&&(O=oi.tokenize(C,I,`... ${S}`,k,w,void 0)),b={fill:v,opacity:x,fontFamily:s,fontSize:p,linePosition:N,lineHeight:A,align:"left",baseline:F.baseline,textAnchor:F.textAnchor,lines:O,cId:d}}return{lineNode:v,labelNode:b}}const si={require:["chart","renderer"],defaultSettings:{style:{line:{stroke:"#000"}}},render(){var e,t;let{settings:n,chart:r,renderer:i,rect:o}=this;if(!(r&&o&&n&&i))return[];const{width:a,height:s}=o,l=null!==(e=null==n||null===(t=n.settings)||void 0===t?void 0:t.barWidth)&&void 0!==e?e:0;let u=(null==n?void 0:n.lines)&&n.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==r?void 0:r.scale("string"==typeof e.scale?e.scale:"");const n=t(e.value);return ni(e,{scale:t,position:n})}return ni(e,{position:e.value})}));const c=[];let p=[];[...u].forEach((e=>{if(e.position>0&&e.position<1){const{lineNode:t,labelNode:o}=ai({chart:r,renderer:i,refLine:e,settings:n,width:a,height:s,barWidth:l});t&&c.push(t),o&&p.push(o)}}));const f=[];p.forEach((e=>{const{fill:t,opacity:n,fontFamily:r,fontSize:i,lines:o,lineHeight:a,textAnchor:s,linePosition:l,baseline:u,cId:c}=e,p=l,d=o.length-1,m=o.map(((e,o)=>{let l=p.y;return d>0&&("baseline"===u?l-=(d-o)*a:l+=o*a),{type:"text",text:e,cId:c,baseline:u,anchor:s,fill:t,opacity:n,fontFamily:r,fontSize:i,x:p.x,y:l}}));f.push(...m)}));const{MEDIUM:d,SMALLER:m}=Hn,h=a>=d.width&&s>=d.height;return[...a>=m.width&&s>=m.height?c:[],...h?f:[]]}};const li={require:["chart","symbol"],defaultSettings:{settings:{},style:{}},render(){var e;return function({chart:e,settings:t,symbol:n}){if(!e||!t||!n)return[];const{valueAngle:r}=t,{clientWidth:i,clientHeight:o}=e.element,a=.4*Math.min(i,o),s=[],l=t.fill,u={x:i/2,y:o/2},c=Br({points:[{x:u.x-a/2,y:u.y+a/2},{x:u.x,y:u.y-a},{x:u.x+a/2,y:u.y+a/2}],angle:r,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})}},ui={getGap(e,t){const n=e.position<t.position?e:t,r=e.position<t.position?t:e;return r.position-r.radius-(n.position+n.radius)},findSegmentPositionMeetMaxThenMin(e,t,n){const r=e.position+e.radius,i=e.position-Math.max(0,r-n),o=i-e.radius;return i+Math.max(0,t-o)},layoutPositionFromMin(e,t,n,r=0){const i=e.length-1;let o,a,s,l=t;for(let t=0;t<i;t++)o=e[t],a=e[t+1],s=(o.position+a.position)/2-r/2,o.position=ui.findSegmentPositionMeetMaxThenMin(o,l,s),l=o.position+o.radius+r;a&&(a.position=ui.findSegmentPositionMeetMaxThenMin(a,l,n))},adjustPositionFromMax(e,t,n,r=0){const i=e.length-1,o=Math.max(0,e[i].position+e[i].radius-n);if(0===o)return;let a,s,l,u,c=0;for(a=i;a>0&&(s=e[a],l=e[a-1],u=Math.max(0,ui.getGap(l,s)-r),u-=Math.max(0,c+u-o),c+=u,s.move=u,!(c>=o));a--);for(c<o&&l&&(u=Math.max(0,l.position-l.radius-t),u-=Math.max(0,c+u-o),c+=u,l.move=u),c=0,a=0;a<=i;a++)s=e[a],c+=s.move||0,s.move=c,s.position-=c},createLayout(e,t,n,r=0){const i=e.map((e=>e.segment)),o=i.length-1;if(o<0)return[];if(0===o){const e=i[0];e.position=ui.findSegmentPositionMeetMaxThenMin(e,t,n)}else ui.layoutPositionFromMin(i,t,n,r),ui.adjustPositionFromMax(i,t,n,r);return e.filter((e=>{const r=Math.ceil(e.segment.position-e.segment.radius),i=e.segment.position+e.segment.radius;return r>=t&&i<=n}))}};const ci={require:["chart","renderer"],defaultSettings:{style:{line:{stroke:"#000"}}},render(){var e,t,n,r;let{settings:i,chart:o,renderer:a,rect:s}=this;if(!(o&&s&&i&&a))return[];const{width:l,height:u}=s,c=null!==(e=null==i||null===(t=i.settings)||void 0===t?void 0:t.barWidth)&&void 0!==e?e:0,p=null!==(n=null===(r=i.settings)||void 0===r?void 0:r.isRtl)&&void 0!==n&&n,f=p?-1:1,d=(null==i?void 0:i.lines)&&i.lines.x||[],m=(null==i?void 0:i.lines)&&i.lines.y||[];let h=d.length>0?d:m;if(0===h.length)return[];const g=d.length>0;h=h.map((e=>{if("function"==typeof e.value&&(e.value=e.value()),e.scale){let t=null==o?void 0:o.scale("string"==typeof e.scale?e.scale:"");const n=t(e.value);return ni(e,{scale:t,position:n})}return ni(e,{position:e.value})}));const y=[];let v=[];if([...h].forEach((e=>{if(Kr(e)&&e.position>0&&e.position<1){const{lineNode:t,labelNode:n}=function({chart:e,renderer:t,refLine:n,settings:r,width:i,height:o,isVerticalRefLine:a,barWidth:s}){if(!e||!t||!r)return{};const{position:l,scale:u,value:c,label:p,line:f,formatter:d,cId:m}=n;let h=ni(!0,{},r.style.line,f||{});const g={type:"line",cId:m,...a?{x1:l*i,x2:l*i,y1:o/2-s/2,y2:o/2+s/2}:{x1:i/2-s/2,x2:i/2+s/2,y1:l*o,y2:l*o},stroke:h.stroke,strokeWidth:h.strokeWidth,strokeDasharray:h.strokeDasharray};let y;if(p){const n=ni(!0,{fill:"#000",fontFamily:"Arial",fontSize:"12px",opacity:1,padding:5,background:{fill:"#fff",stroke:"transparent",strokeWidth:0,opacity:.5}},r.style.label||{},{fill:h.stroke},p),{fontFamily:f,fontSize:g,fill:v,opacity:b}=n,x=p.showLabel?n.text:"";let q,D="";if("string"==typeof d||"object"==typeof d)q=e.formatter(d);else if(void 0!==u&&"string"!=typeof u&&"function"==typeof u.data){const e=u.data()&&u.data().fields;q=e&&e[0]?e[0].formatter():null}!1!==p.showValue&&(q?D=` (${q("function"==typeof c?c():c)})`:u&&(D=` (${c})`));const S=e=>t.measureText({text:e,fontFamily:f,fontSize:g}),M=S("M").height,A=`normal ${g} ${f}`,I=a?In.MAX_WIDTH:i/2-s/2-In.CLEARANCE,w=a?2:1,k=`${x}${D}`||"",C=oi.tokenize(k,A,`... ${D}`,w,I,void 0),L=(a?i:o)*l,E=Math.min(I,Math.max(...C.map((e=>S(e).width)))),N=C.length*M;y={fill:v,opacity:b,fontFamily:f,fontSize:g,linePosition:L,lineHeight:M,lines:C,cId:m,segment:{position:L,radius:a?E/2:N/2}}}return{lineNode:g,labelNode:y}}({chart:o,renderer:a,refLine:e,settings:i,width:l,height:u,isVerticalRefLine:g,barWidth:c});t&&y.push(t),n&&v.push(n)}})),g)v.sort(((e,t)=>e.segment.position-t.segment.position)),v=ui.createLayout(v,0,l,In.GAP);else{const{attrs:e}=o.findShapes("text").filter((e=>e.key===Ln.GAUGE_LABEL))[0],{"font-size":t}=e,n=parseFloat(t);let r=v.filter((t=>t.segment.position<e.y)),i=v.filter((t=>t.segment.position>e.y));r.sort(((e,t)=>e.segment.position-t.segment.position)),i.sort(((e,t)=>e.segment.position-t.segment.position)),r=ui.createLayout(r,0,e.y-n/2),i=ui.createLayout(i,e.y+n/2,u),v=[...r,...i]}const b=[],x=[];v.forEach((e=>{const{fill:t,opacity:n,fontFamily:r,fontSize:i,lines:o,segment:a,linePosition:s,lineHeight:d,cId:m}=e,{position:h}=a;if(s!==h&&""!==e.lines[0]){let e={x1:l/2+f*(c/2),x2:l/2+f*(c/2+.75*In.CLEARANCE),y1:s,y2:h};g&&(e={y1:u/2+c/2,y2:u/2+c/2+In.CLEARANCE,x1:s,x2:h});const n={type:"line",...e,stroke:t,strokeWidth:1,isConnector:!0,cId:m};x.push(n)}const y=o.map(((e,o)=>{let a=g?u/2+c/2+d/2+In.CLEARANCE:h;return a+=o*d,{type:"text",text:e,cId:m,baseline:"central",anchor:g?"middle":p?"end":"start",fill:t,opacity:n,fontFamily:r,fontSize:i,x:g?h:l/2+f*(c/2+In.CLEARANCE),y:a}}));b.push(...y)}));const{MEDIUM:q,SMALLER:D}=Hn,S=l>=q.width&&u>=q.height;return[...l>=D.width&&u>=D.height?y:[],...S?b:[],...S?x:[]]}};var pi={dataRelatedPropertiesPaths:["qHyperCube.qGrandTotalRow","qHyperCube.qHasOtherValues","qHyperCube.qSize","qHyperCube.qDimensionInfo[].qAttrDimInfo","qHyperCube.qDimensionInfo[].qCardinalities","qHyperCube.qDimensionInfo[].qMax","qHyperCube.qDimensionInfo[].qMin","qHyperCube.qDimensionInfo[].qStateCounts","qHyperCube.qMeasureInfo[].qApprMaxGlyphCount","qHyperCube.qMeasureInfo[].qFallbackTitle","qHyperCube.qMeasureInfo[].qMax","qHyperCube.qMeasureInfo[].qMin","qHyperCube.qMeasureInfo[].qNumFormat","qHyperCube.qMeasureInfo[].qTrendLines","qHyperCube.qTreeNodesOnDim","measureAxis.min","measureAxis.max","refLine.refLines[].refLineExpr"]};function fi(e){const{qHyperCube:t,...n}=e,{qDataPages:r,qStackedDataPages:i,qTreeDataPages:o,...a}=t||{},s=ni(!0,{},{...n,qHyperCube:{...a,qDataPages:null,qStackedDataPages:null,qTreeDataPages:null}}),{dataRelatedPropertiesPaths:l}=pi;return l.forEach((e=>{const t=e.split("[");if(1===t.length)void 0!==Mt(s,e)&&It(s,e,null);else{const e=t[0],n=t[1].split("].")[1];Mt(s,e,[]).forEach((e=>{void 0!==Mt(e,n)&&It(e,n,null)}))}})),s}const di=({core:e,services:t,settings:n})=>{r((()=>{if(!n||!e||!t)return;const{chart:r,cache:i}=e;if(!r)return;const{colorService:o,layoutService:a}=t;r.update({data:[{type:"q",key:"qHyperCube",data:a.getHyperCube()},...o.getData()],settings:n}),i&&function({cache:e,layout:t}){const n=fi(t);e.set("dataIndependentProperties",JSON.stringify(n))}({cache:i,layout:a.getLayout()})}),[e,n])};function mi({layout:e,options:t}){return e.snapshotData&&!t.freeResize?{width:e.snapshotData.content.size.w,height:e.snapshotData.content.size.h}:void 0}function hi({options:e,cache:t,layoutService:n}){const r={isSizeChanging:!1};return{enabled:()=>!1!==e.chartAnimations&&!r.isSizeChanging&&!function({cache:e,layout:t}){const n=fi(t);return e.get("dataIndependentProperties")!==JSON.stringify(n)}({cache:t,layout:n.getLayout()}),meta:r}}function gi({layout:e,rect:t}){var n;const{measureAxis:r,qHyperCube:i,autoOrientation:o,gaugetype:a,useSegments:s,refLine:l}=e,u=null===(n=e.qHyperCube)||void 0===n?void 0:n.qMeasureInfo[0].qFallbackTitle,{width:c,height:p}=t;let f=e.orientation;o&&(f=c>=p?"horizontal":"vertical");const d="vertical"===f,m=function({measureAxis:e,qHyperCube:t}){if(!e||!t)return{min:0,max:1};let{min:n,max:r}=e;if(n=Number(n),r=Number(r),n!==r)return{min:Math.min(n,r),max:Math.max(n,r)};const i=t.qDataPages[0].qMatrix[0][0].qNum;let o=Math.abs(i-n)/2;return 0===o&&(o=0!==n?Math.abs(n)/2:Number.MAX_VALUE/2),{min:n-o,max:r+o}}({measureAxis:r,qHyperCube:i}),h=(null==l?void 0:l.refLines)||[],g=null==r?void 0:r.spacing,y=null==r?void 0:r.show,v=function({layout:e,rangeLimits:t}){var n,r;const{gradient:i}=(null===(n=e.qHyperCube)||void 0===n?void 0:n.qMeasureInfo[0].coloring)||{};if("measure"!==(null===(r=e.color)||void 0===r?void 0:r.useBaseColors)||!i)return e.segmentInfo;const{min:o,max:a}=t,{limits:s,limitType:l,breakTypes:u,colors:c}=i,p=s.map(((e,t)=>({value:"percent"===l?o+e*(a-o):e,gradient:u[t]})));return{limits:p,paletteColors:c}}({layout:e,rangeLimits:m});return{measureAxisTitle:u,measureAxisSpacing:g,measureAxisShow:y,rangeLimits:m,qHyperCube:i,orientation:f,autoOrientation:o,gaugetype:a,isVertical:d,useSegments:s,segmentInfo:v,refLines:h}}function yi({dockService:e,layoutService:t}){const{width:n,height:r}=e.meta.chart.size,{orientation:i,autoOrientation:o}=t.meta;return o?n<r:"vertical"===i}function vi(e,t,n){if(e>=n)return 1;if(e<=t)return 0;const r=Math.min(1,Math.max(0,(e-t)/(n-t)));return Number.isNaN(r)?0:r}function bi(e){return"none"!==e&&"labels"!==e}function xi(e){return"none"!==e&&"title"!==e}function qi({chart:e,layoutService:t,dockService:n}){function r(){const{width:e,height:r}=n.meta.chart.size,i=yi({dockService:n,layoutService:t});return Math.min(sn,i?e/10:r/10)}function i(){const{width:e,height:r}=n.meta.chart.size;return yi({dockService:n,layoutService:t})?r:e}function o(e){const{min:n,max:r}=t.meta.rangeLimits,o=e?r-(t.meta.qHyperCube.qDataPages[0].qMatrix[0][0].qNum-n):t.meta.qHyperCube.qDataPages[0].qMatrix[0][0].qNum;return i()*vi(o,n,r)}const a={getBottomPadding(e){if(yi({dockService:n,layoutService:t})){const t=o(!1)+-e.height*hn.VERTICAL_ALIGNMENT_FACTOR,n=mn.BOTTOM,r=i()-e.height-mn.TOP;return t<n?n:t>r?r:t}const{MAX_LINES:a,ESTIMATED_LINE_HEIGHT:s,CLEARANCE:l}=In,u=function({layoutService:e,dockService:t}){const{width:n,height:r}=t.meta.chart.size,{min:i,max:o}=e.meta.rangeLimits,{MEDIUM:a}=Hn,s=n>=a.width&&r>=a.height,{refLines:l}=e.meta;return l&&l.filter(Kr).length>0&&l.filter((e=>e.refLineExpr.value>=i&&e.refLineExpr.value<=o)).length>0&&s}({layoutService:t,dockService:n})?a*s+l:0;return-r()*gn.VERTICAL_ALIGNMENT_FACTOR-u},getTopPadding:e=>-a.getBottomPadding(e),getLeftPadding(e){const{width:a}=n.meta.chart.size,s=n.config.rtl,l=r(),u=yi({dockService:n,layoutService:t}),c=Math.min(e.width,a*qn);if(u)return s?a/5-l-c:a/5+l;const p=o(s)-e.width/2,f=mn.RIGHT,d=i()-e.width-mn.LEFT;return p<f?f:p>d?d:p},getRightPadding:e=>-a.getLeftPadding(e)},s={getLeftPadding(i){if(!yi({dockService:n,layoutService:t}))return 0;const o=e.findShapes("container").filter((e=>e.key===Ln.BAR_AXIS));if(1!==o.length)return 0;const a=o[0],s=xi(t.meta.measureAxisShow)?Math.max(...a.children.filter((e=>"text"===e.type)).map((e=>e.bounds.width))):0,l=Math.max(...a.children.filter((e=>"line"===e.type)).map((e=>e.bounds.width))),u=r();let c=u/2+s+l+u*An;const{width:p}=n.meta.chart.size;c>p/2-i.height/4&&(c=p/2-i.height/4);return n.config.rtl?c:-c},getRightPadding:e=>-s.getLeftPadding(e),getTopPadding(){if(yi({dockService:n,layoutService:t}))return-4;const i=e.findShapes("container").filter((e=>e.key===Ln.BAR_AXIS));if(1!==i.length)return 0;const o=i[0],a=xi(t.meta.measureAxisShow)?Math.max(...o.children.filter((e=>"text"===e.type)).map((e=>e.bounds.height))):0,s=Math.max(...o.children.filter((e=>"line"===e.type)).map((e=>e.bounds.height))),l=r();return-(l/2+a+s+l*Mn)},getBottomPadding:()=>-s.getTopPadding()};return{getBarWidthInPixels:r,getValueLabelFontSize:function(e,t){const{width:r,height:i}=n.meta.chart.size,o=vi(Math.min(i,r),dn.MIN,dn.MAX);return e+Math.round(o*(t-e))},barValueLabel:a,barAxisTitle:s}}const Di=({core:e})=>{const f=i(),d=o(),m=a(),h=s(),g=l(),y=u(),{qLocaleInfo:v}=c(),[x,q]=n(null),D=t(),S=p();return r((()=>{if(!f||!e)return;const{picassoInstance:t,chart:n,cache:r}=e;if(!n)return;const i=function(e){var t=e.source,n=e.metaAdditionsFn,r=e.experimental,i=void 0===r?{filter:!1}:r,o=R(!0,{},t),a=i.filter?function(e){var t=e.qHyperCube,n=Lt(t,Ct.DIMENSION),r=n.reduced,i=n.filtered;t[Ct.DIMENSION]=r;var o=Lt(t,Ct.MEASURE),a=o.reduced,s=o.filtered;return t[Ct.MEASURE]=a,{dimensions:i,measures:s}}(o):{dimensions:[],measures:[]},s=Nt(o),l=function(){var e=function(e){var t=e.layout,n=e.additionsFn,r=void 0===n?function(){return{}}:n,i=e.additionsProps,o=void 0===i?{}:i,a=t.qHyperCube,s=a.qDimensionInfo,l=a.qMeasureInfo,u=a.qMode,c=s.length,p=l.length,f=b({mode:{S:"S"===u,P:"P"===u,K:"K"===u,T:"T"===u},dimensionCount:c,measureCount:p,hasMultipleDimensions:c>1,hasMultipleMeasures:p>1,isOneDimensional:1===c,isTwoDimensional:2===c},o);return b(b({},f),r({layout:t,meta:f}))}({layout:o,additionsFn:n,additionsProps:{size:s.size}});return e.filteredFields=a,e},u={refs:b({},s.refs),meta:l(),getLayout:function(){return o},getLayoutValue:function(e,t){return Mt(o,e,t)},setLayoutValue:function(e,t){It(o,e,t),s=Nt(o),u.meta=l()},getHyperCube:function(){return o.qHyperCube},getHyperCubeValue:function(e,t){return Mt(o.qHyperCube,e,t)},setHyperCubeValue:function(e,t){It(o.qHyperCube,e,t),s=Nt(o),u.meta=l()},getDataPages:function(){return Mt(o,s.refs.dataPages)},setDataPages:function(e){It(o,s.refs.dataPages,e),u.meta=l()}};return u}({source:f,metaAdditionsFn:()=>gi({layout:f,rect:g})}),{direction:o="ltr"}=D,a=mi({layout:i.getLayout(),options:D}),s=St({chart:n,layoutService:i,config:{rtl:"rtl"===o,logicalSize:a},typeConfig:{type:"major-minor",fallback:"vertical",invert:!0}}),l=pt({app:m,model:h,translator:y,picasso:t,layoutService:i,config:{key:En,localeInfo:v,theme:d,auto:()=>({mode:"primary",byMeasureDef:{activeMeasureIndex:0,type:"expression",label:""}})},createConfig:()=>({colorProps:{auto:!0,paletteColor:f.paletteProgressColor}})}),u=function(e){var t=e.theme,n=e.config,r=void 0===n?{}:n,i=r.id,o=r.resolve,a=void 0===o?[]:o,s=r.transform,l=void 0===s?[]:s,u=r.extend,c=void 0===u?[]:u,p={theme:t,matrix:Ut(a),styles:void 0};return p.styles=Xt({theme:t,id:i,transform:l,extend:c,matrix:p.matrix}),{getStyles:function(){return p.styles},getTheme:function(){return p.theme},setTheme:function(e){p.theme=e,p.styles=Xt({theme:e,id:i,transform:l,extend:c,matrix:p.matrix})}}}({theme:d,config:{id:"gauge"}}),c=qi({chart:n,layoutService:i,dockService:s}),p=function({layoutService:e,themeService:t,colorService:n}){const r=t.getStyles(),i=t=>{var n;return null===(n=e.getLayoutValue("components",[]))||void 0===n?void 0:n.find((e=>e.key===t))},o=e=>e?n.getPaletteColor(e):void 0;return{query:{axis:{title:{getStyle:()=>{var e,t,n,a;return{fontFamily:null!==(e=null===(t=i("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:r.axis.title.fontFamily,fontSize:r.axis.title.fontSize,color:null!==(n=o(null===(a=i("axis"))||void 0===a||null===(a=a.axis)||void 0===a||null===(a=a.title)||void 0===a?void 0:a.color))&&void 0!==n?n:r.axis.title.color}}},label:{getStyle:()=>{var e,t,n,a;return{fontFamily:null!==(e=null===(t=i("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:r.axis.label.name.fontFamily,fontSize:r.axis.label.name.fontSize,fill:null!==(n=o(null===(a=i("axis"))||void 0===a||null===(a=a.axis)||void 0===a||null===(a=a.label)||void 0===a||null===(a=a.name)||void 0===a?void 0:a.color))&&void 0!==n?n:r.axis.label.name.color}}}},label:{getStyle:()=>{var e,t,n,a;return{fontFamily:null!==(e=null===(t=i("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:r.label.value.fontFamily,fill:null!==(n=o(null===(a=i("value"))||void 0===a||null===(a=a.label)||void 0===a||null===(a=a.value)||void 0===a?void 0:a.color))&&void 0!==n?n:r.label.value.color}}}}}}({layoutService:i,themeService:u,colorService:l}),x=hi({options:D,cache:r,layoutService:i}),M=function({layout:e,model:t,translator:n,interactionState:r}){return{isClosed:()=>e.disclaimerClosed,close:()=>{t.getProperties().then((e=>{e.disclaimerClosed=!0,t.setProperties(e)}))},translator:n,isEditMode:r.edit}}({layout:f,model:h,translator:y,interactionState:S});q({layoutService:i,colorService:l,dockService:s,labelService:c,themeService:u,styleService:p,animationsService:x,disclaimerService:M})}),[h,m,f,d.name(),y.language(),e,D.direction,S.edit]),x};function Si({width:e,height:t,fontSize:n}){const{FULL:r}=Hn;if(e>=r.width&&t>=r.height){let e=Number.parseFloat(n);return e=Math.floor(e*vn),`${e}px`}return n}var Mi=e=>()=>e;function Ai(e){return 1==(e=+e)?Ii:function(t,n){return n-t?function(e,t,n){return e=Math.pow(e,n),t=Math.pow(t,n)-e,n=1/n,function(r){return Math.pow(e+r*t,n)}}(t,n,e):Mi(isNaN(t)?n:t)}}function Ii(e,t){var n=t-e;return n?function(e,t){return function(n){return e+n*t}}(e,n):Mi(isNaN(e)?t:e)}var wi=function e(t){var n=Ai(t);function r(e,t){var r=n((e=pr(e)).r,(t=pr(t)).r),i=n(e.g,t.g),o=n(e.b,t.b),a=Ii(e.opacity,t.opacity);return function(t){return e.r=r(t),e.g=i(t),e.b=o(t),e.opacity=a(t),e+""}}return r.gamma=e,r}(1);function ki({thisColor:e,paletteColors:t,paletteIndex:n,limit:r,isLeft:i=!1,themeService:o}){const a=i?0:1,s=0===Object.entries(r).length,l=r.gradient;let u=n+(i?-1:1);s&&(u=i?0:t.length-1);const c=o.getTheme().getColorPickerColor(u<t.length&&u>=0?t[u]:t[0]);return{color:l?wi(e,c)(.5):e,offset:a,gradient:l}}function Ci({limits:e,paletteColors:t,paletteIndex:n,themeService:r}){const i=Mt(e,""+(n-1),{}),o=Mt(e,`${n}`,{}),a=[i,o].map((e=>e.gradient)).includes(!0),s=r.getTheme().getColorPickerColor(t[n]);if(!a)return[{offset:0,color:s},{offset:1,color:s}];const l=[ki({thisColor:s,paletteColors:t,paletteIndex:n,limit:i,isLeft:!0,themeService:r}),ki({thisColor:s,paletteColors:t,paletteIndex:n,limit:o,isLeft:!1,themeService:r})];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:n})=>({offset:e,color:t,gradient:n})));return u}function Li({themeService:e,segmentInfo:t,rangeLimits:n}){const{limits:r,paletteColors:i}=t,{min:o,max:a}=n;r.sort(((e,t)=>e.value-t.value));const s=[o,...r.map((e=>e.value)),a],l=[];for(let t=0;t<i.length;t++){const n=Ci({limits:r,paletteColors:i,paletteIndex:t,themeService:e}).map((e=>({offset:vi(s[t]+e.offset*(s[t+1]-s[t]),o,a),color:e.color,gradient:"gradient"in e?e.gradient:void 0})));l.push(...n)}return l}function Ei(e){return e.map((e=>({...e,offset:1-e.offset}))).reverse()}function Ni({themeService:e,isVertical:t,segmentInfo:n,rangeLimits:r,isRtl:i}){return{type:"gradient",x1:0,x2:t?0:1,y1:t?1:0,y2:0,stops:i&&!t?Ei(Li({themeService:e,segmentInfo:n,rangeLimits:r})):Li({themeService:e,segmentInfo:n,rangeLimits:r})}}function Pi({services:e}){const{dockService:t,disclaimerService:n}=e,{translator:r,isClosed:i,isEditMode:o}=n;if(i()||!o)return!1;const a=t.config.rtl;return{key:"disclaimer-component",type:"disclaimer-component",layout:{displayOrder:5,minimumLayoutMode:Vn},settings:{isRtl:a,close:e.disclaimerService.close,title:r.get("Object.Gauge.RangeIsDefaultTitle"),text:r.get("Object.Gauge.RangeIsDefault")}}}function Oi({services:e}){const{dockService:t,layoutService:n,themeService:r,animationsService:i}=e,{qHyperCube:o,useSegments:a,segmentInfo:s,rangeLimits:l}=n.meta,u=yi({dockService:t,layoutService:n}),c=u?"vertical":"horizontal";if(!a)return!1;const{min:p,max:f}=l,d=o.qDataPages[0].qMatrix[0][0].qNum,m=Math.max(p,Math.min(f,d)),h={type:"box",key:Ln.MARK,data:{extract:{field:"qMeasureInfo/0",props:{start:m,end:m,measureIndex:0}}},settings:{minor:{scale:"m"},orientation:c,box:{width:.1,maxWidthPx:sn,minHeightPx:yn,fill:()=>function({themeService:e,isVertical:t,segmentInfo:n,rangeLimits:r,value:i}){const o=Ni({themeService:e,isVertical:t,segmentInfo:n,rangeLimits:r,isRtl:!1});let{min:a,max:s}=r;const l=vi(i,a,s),{stops:u}=o;let c="black";for(let e=0;e<u.length;e++){const t=u[e].offset,n=u[e+1].offset;if(l>=t&&l<=n){const r=vi(l,t,n);c=zr(wi(u[e].color,u[e+1].color)(r));break}}return c}({value:d,themeService:r,isVertical:u,segmentInfo:s,rangeLimits:l}),stroke:"transparent"}},animations:{enabled:i.enabled,trackBy:e=>`${e.data.measureIndex.value}`}};return h}function Fi({services:e}){const{dockService:t,themeService:n,styleService:r,layoutService:i,animationsService:o}=e;if(!xi(i.meta.measureAxisShow))return[];const{width:a,height:s}=t.meta.chart.size,l=Ur(a,s,ln,un),{innerRadius:u,outerRadius:c,radiusIncrease:p}=l,f=4*p,d=Math.min(a,s)/2,m=n.getStyles(),h=r.query.axis.label.getStyle(),{tickLength:g,labelPadding:y}=function({width:e,height:t,defaultTickSize:n,defaultLabelPadding:r}){const i=Math.min(Math.min(e,t)/jn,1);return{tickLength:n*i,labelPadding:r*i}}({width:a,height:s,defaultTickSize:8,defaultLabelPadding:20}),v=Zr(a,s);return[{key:Ln.RADIAL_AXIS,type:"axis",rendererSettings:{disableScreenReader:!0},dock:"center",layout:{minimumLayoutMode:Rn},scale:"m",settings:{arc:{radius:c,startAngle:ln,endAngle:un,offset:-10*f*(c-u)*d},align:"top",line:{show:!1,stroke:"#cdcdcd"},ticks:{tickSize:g,stroke:m.axis.line.major.color,margin:v},labels:{margin:-6-2*g+y,fontFamily:h.fontFamily,fill:h.fill,fontSize:h.fontSize}},animations:{enabled:o.enabled,trackBy:e=>{const{type:t,text:n,x:r,y:i,x1:o,y1:a,value:s}=e;return"text"===t?`text-${n}-${r}-${i}`:`tick-${s}-${o}-${a}`}}}]}function Ti(e,t,n,r){const i=r?Ei(Li({themeService:t,segmentInfo:n,rangeLimits:e})):Li({themeService:t,segmentInfo:n,rangeLimits:e}),o=(un-ln)/(2*Math.PI),a=i.map((e=>({offset:e.offset*o,color:e.color})));return{type:"gradient",orientation:"conic",startAngle:ln-Math.PI/2,x:0,y:0,stops:a}}function Ri({services:e}){const{dockService:t,themeService:n,layoutService:r,colorService:i,animationsService:o}=e,{rangeLimits:a,useSegments:s,segmentInfo:l,qHyperCube:u}=r.meta,{width:c,height:p}=t.meta.chart.size,f=t.config.rtl,{outerRadius:d,innerRadius:m,labelGaugeRadius:h}=Ur(c,p,ln,un),g=a.max,y=u.qDataPages[0].qMatrix[0][0].qNum,v=g-y,b=[{value:Math.max(Nn,y-a.min),valueLabel:"Measure"},{value:Math.max(Nn,v),valueLabel:"Remaining"}];let x=function({themeService:e,segmentInfo:t,rangeLimits:n}){const r=Li({themeService:e,segmentInfo:t,rangeLimits:n});let i=0,o=0,a=r.map((e=>(o=0===n.max?e.offset*(n.max-n.min)-i:e.offset*n.max-i,i+=o,{value:o,color:e.color,gradient:e.gradient}))).filter((e=>0!==e.value||!0===e.gradient));return a.forEach((e=>{e.value=Math.abs(e.value)})),a}({themeService:n,segmentInfo:l,rangeLimits:a});f&&(b.reverse(),x.reverse());const q={type:"pie",key:Ln.RADIAL_GAUGE,data:{items:b},settings:{startAngle:ln,endAngle:un,slice:{arc:{ref:"value"},outerRadius:()=>d,innerRadius:()=>m,fill:(t,n)=>{const r=Gr({services:e});return f?1===n?r(t):cn:0===n?r(t):cn},strokeWidth:0}},animations:{enabled:o.enabled,trackBy:e=>e.data.value.valueLabel}},D={type:"pie",key:Ln.SEGMENT_RADIAL_GAUGE,renderer:"canvas",displayOrder:1,data:{items:x},settings:{startAngle:ln,endAngle:un,slice:{arc:{ref:"value"},outerRadius:()=>d,innerRadius:()=>m,strokeWidth:0,fill:(e,t)=>{var r,i;return(f?e.datum.value.gradient||(null===(r=x[t+1])||void 0===r?void 0:r.gradient):e.datum.value.gradient||(null===(i=x[t-1])||void 0===i?void 0:i.gradient))?Ti(a,n,l,f):e.datum.value.color}}},animations:{enabled:o.enabled,trackBy:e=>e.data.value.color}},S={type:"pie",key:Ln.CIRCLE_GAUGE,renderer:"canvas",displayOrder:0,data:{items:[{value:Math.max(y,Nn),valueLabel:"Measure"}]},settings:{startAngle:0,endAngle:2*Math.PI,slice:{arc:{ref:"value"},outerRadius:()=>d,innerRadius:()=>m,fill:()=>function(e,t,n,r){let i=Ti(e,t,n,r);const o={offset:(un-ln)/(2*Math.PI),color:"rgba(0, 0, 0, 0)"};return i.stops.push(o),i.stops.push({offset:1,color:"rgba(0, 0, 0, 0)"}),i}(a,n,l,f),strokeWidth:0,opacity:s?1:0}},animations:{enabled:o.enabled,trackBy:e=>e.data.value.valueLabel,isMainComponent:!0}},M={type:"pie",key:Ln.LABEL_RADIAL_GAUGE,renderer:"canvas",displayOrder:0,data:{items:[{value:Math.max(y,Nn),valueLabel:"Measure"}]},settings:{startAngle:0,endAngle:2*Math.PI,slice:{arc:{ref:"value"},outerRadius:()=>h+1,innerRadius:()=>h,opacity:0}},animations:{enabled:o.enabled,trackBy:e=>e.data.value.valueLabel,isMainComponent:!0}};return s?[S,M,D]:[M,q]}function Vi({services:e}){const{dockService:t,layoutService:n,animationsService:r}=e,{width:i,height:o}=t.meta.chart.size,a=t.config.rtl,{rangeLimits:s,qHyperCube:l}=n.meta,{min:u,max:c}=s;let p,f=l.qDataPages[0].qMatrix[0][0].qNum;(f>c||f<u)&&(p="#00000000"),a&&(f=c-(f-u));const d=ln+vi(f,u,c)*(un-ln);return{type:"radial-gauge-needle",key:Ln.RADIAL_GAUGE_NEEDLE,layout:{displayOrder:2},settings:{component:Ln.SEGMENT_RADIAL_GAUGE,fill:p,valueAngle:d},animations:{enabled:r.enabled,trackBy:e=>e.type,adjustTweenedNodes(e){e.forEach((e=>{const{data:t}=e;if(t){const{pointerWidth:n,angle:r,radius:a,fill:s}=t,l=Wr(i/2,o/2,a,r+Math.PI/2),{x:u,y:c}=l,p=[{x:u+.3*n,y:c},{x:u-7.5*n,y:c+n},{x:u-7.5*n,y:c-n}],{d:f}=Br({points:p,angle:r,fill:s,origin:l});e.d=f}}))}}}}function Hi({services:e}){const{dockService:t,layoutService:n,colorService:r,animationsService:i}=e,{width:o,height:a}=t.meta.chart.size,s=t.config.rtl,{rangeLimits:l,useSegments:u,qHyperCube:c}=n.meta,{min:p,max:f}=l,d=c.qDataPages[0].qMatrix[0][0].qNum,{outerRadius:m,innerRadius:h}=Ur(o,a,ln,un),g=(h+(m-h)/2)*Math.min(o,a)/2,{RADIAL_OOB_INDICATOR_MIN:y,RADIAL_OOB_INDICATOR_MAX:v,SEGMENT_RADIAL_GAUGE:b,RADIAL_GAUGE:x}=Ln;return[y,v].map(((t,n)=>{const r=u?b:x,l=function(e,t){const n=Gr({services:e})({datum:{value:()=>0}});return t?"#595959":n}(e,u);let c=0;(0===n&&d<p||1===n&&d>f)&&(c=Xr({innerRadius:h,outerRadius:m,width:o,height:a}));let y=ln;return(0===n&&s||1===n&&!s)&&(y=un),{type:"radial-oob-indicator",key:t,layout:{displayOrder:2},settings:{component:r,selector:"path",angle:y,radius:g,size:c,fill:l},animations:{enabled:i.enabled,trackBy:e=>e.type}}}))}function ji({core:e,services:t}){const{chart:n}=e;if(!n)return[];const{width:r,height:i}=t.dockService.meta.chart.size,{useSegments:o}=t.layoutService.meta;let a=[Pi({services:t})];return"bar"===t.layoutService.meta.gaugetype?a.push(...function({services:e}){const{dockService:t,layoutService:n,styleService:r,themeService:i,animationsService:o}=e;if("none"===n.meta.measureAxisShow)return[];const{width:a,height:s}=t.meta.chart.size,l=t.config.rtl,u=yi({dockService:t,layoutService:n}),c=i.getStyles(),p=r.query.axis.label.getStyle(),{fontFamily:f,fill:d,fontSize:m}=p,h=xi(n.meta.measureAxisShow);return[{type:"axis",rendererSettings:{disableScreenReader:!0},key:Ln.BAR_AXIS,dock:"center",scale:"m",layout:{minimumLayoutMode:Pn},settings:{align:u?l?"right":"left":"top",line:{show:!u,stroke:c.axis.line.major.color},labels:{show:h,minLengthPx:20,fontFamily:f,fill:d,fontSize:Si({width:a,height:s,fontSize:m})},paddingStart:()=>{if(u){const e=Math.min(a/10,sn);return a/2+e/2}const e=Math.min(s/10,sn);return s/2+e/2+Sn},ticks:{stroke:c.axis.line.major.color}},animations:{enabled:o.enabled,trackBy:e=>void 0===e.tickValue?"axis":"text"===e.type?`label: ${e.tickValue}`:`mark: ${e.tickValue}`}}]}({services:t}),...function({services:e}){const{colorService:t,themeService:n,dockService:r,layoutService:i,animationsService:o}=e,{rangeLimits:a,segmentInfo:s,useSegments:l}=i.meta,u=r.config.rtl,c=yi({dockService:r,layoutService:i}),p=c?"vertical":"horizontal",{min:f,max:d}=a,m=u&&!c?d:f,h={type:"box",key:Ln.BAR,data:{extract:{field:"qMeasureInfo/0",props:{start:f,end:{field:"qMeasureInfo/0"},measureIndex:0}}},settings:{minor:{scale:"m"},orientation:p,box:{width:.1,maxWidthPx:sn,fill:Gr({services:e})}},animations:{enabled:o.enabled,isMainComponent:!0,trackBy:e=>`${e.data.measureIndex.value}`}},g={type:"box",key:Ln.SEGMENT_BAR,data:{extract:{field:"qMeasureInfo/0",props:{start:f,end:d,measureIndex:0}}},settings:{minor:{scale:"m"},orientation:p,box:{width:.1,maxWidthPx:sn,fill:()=>Ni({themeService:n,isVertical:c,segmentInfo:s,rangeLimits:a,isRtl:u}),stroke:"transparent"}},animations:{enabled:o.enabled,trackBy:e=>`${e.data.measureIndex.value}`}},y={type:"box",key:Ln.BACKGROUND_BAR,data:{extract:{field:"qMeasureInfo/0",props:{start:f,end:d}}},settings:{minor:{scale:"m"},orientation:p,box:{width:.1,maxWidthPx:sn,fill:cn}}},v={type:"box",key:Ln.LABEL_BAR,data:{extract:{field:"qMeasureInfo/0",props:{start:m,end:m}}},settings:{minor:{scale:"m"},orientation:p,box:{width:c?qn:Dn,opacity:0}}};return l?[v,g]:[v,y,h]}({services:t}),...function({services:e}){const{dockService:t,labelService:n,styleService:r,layoutService:i}=e;if(!bi(i.meta.measureAxisShow))return[];const{width:o,height:a}=t.meta.chart.size,s=yi({dockService:t,layoutService:i}),{measureAxisTitle:l,useSegments:u}=i.meta,{getTopPadding:c,getBottomPadding:p,getLeftPadding:f,getRightPadding:d}=n.barAxisTitle,m=r.query.axis.title.getStyle(),{fontFamily:h,fontSize:g,color:y}=m;return[{type:"labels",key:Ln.AXIS_TITLE,layout:{minimumLayoutMode:On},settings:{sources:[{component:u?Ln.SEGMENT_BAR:Ln.BACKGROUND_BAR,selector:"rect",strategy:{type:"bar",settings:{direction:s?"up":"right",align:.5,justify:.5,labels:[{fontFamily:h,fill:y,fontSize:Number.parseFloat(Si({width:o,height:a,fontSize:g})),label:()=>l,placements:[{position:"inside",padding:{top:c,bottom:p,left:f,right:d},overflow:!0}]}]}}}]}}]}({services:t}),function({chart:e,services:t}){if(!e.formatter)return!1;const{labelService:n,styleService:r,dockService:i,layoutService:o,animationsService:a}=t,s=yi({dockService:i,layoutService:o}),{getValueLabelFontSize:l,barValueLabel:u}=n,{getTopPadding:c,getBottomPadding:p,getLeftPadding:f,getRightPadding:d}=u,m=l(fn.MIN,fn.MAX),h=r.query.label.getStyle();return{type:"labels",key:Ln.GAUGE_LABEL,layout:{minimumLayoutMode:s?Fn:Tn},settings:{sources:[{component:Ln.LABEL_BAR,selector:"rect",formatter:"measure",strategy:{type:"bar",settings:{direction:s?"up":"right",orientation:"horizontal",fontFamily:h.fontFamily,fill:h.fill,fontSize:m,align:s?0:.5,justify:0,labels:[{label:({data:t})=>t?e.formatter(Cn.MEASURE)(t.value):"",linkData:({data:e})=>e?{value:e.value,formatter:Cn.MEASURE}:null,placements:[{position:"outside",padding:{top:c,bottom:p,left:f,right:d},overflow:!0}]}]}}}]},animations:{enabled:a.enabled,trackBy:e=>e.type,adjustTweenedNodes(t){t.forEach((t=>{const{type:n,data:r}=t;"text"===n&&r&&r.value&&r.formatter&&(t.text=e.formatter(r.formatter)(r.value))}))}}}}({chart:n,services:t}),function({services:e}){const{layoutService:t,dockService:n,labelService:r,animationsService:i}=e,{qHyperCube:o,rangeLimits:a,useSegments:s}=t.meta,l=n.config.rtl,u=yi({dockService:n,layoutService:t}),{min:c,max:p}=a,f=o.qDataPages[0].qMatrix[0][0].qNum;let d=r.getBarWidthInPixels();f<=p&&f>=c&&(d=0);let m=u?"bottom":l?"right":"left";return f>p&&(m=u?"top":l?"left":"right"),{type:"oob-indicator",key:Ln.OOB_INDICATOR,layout:{displayOrder:2},settings:{component:s?Ln.SEGMENT_BAR:Ln.BAR,isRtl:l,selector:"rect",pointingTo:m,size:d},animations:{enabled:i.enabled,trackBy:e=>e.type}}}({services:t}),function({services:e}){const{dockService:t,layoutService:n,labelService:r,themeService:i,colorService:o,animationsService:a}=e,{refLines:s}=n.meta,l=t.config.rtl,u=yi({dockService:t,layoutService:n}),c=i.getStyles();return{type:"custom-ref-line",key:Ln.REFERENCE_LINES_AND_LABELS,settings:{barWidth:r.getBarWidthInPixels(),isRtl:l},lines:{[u?"y":"x"]:s.filter(Kr).map((e=>{var t,n;return{scale:"m",value:e.refLineExpr.value,cId:e.cId,label:{text:e.label,...c.referenceLine.label.name,showValue:e.showValue,showLabel:e.showLabel},line:{stroke:o.getPaletteColor(e.paletteColor||{index:e.color}),strokeWidth:(null===(t=e.style)||void 0===t?void 0:t.lineThickness)||2,strokeDasharray:null===(n=e.style)||void 0===n?void 0:n.lineType}}}))},animations:{enabled:a.enabled,trackBy:e=>{const{type:t,cId:n,text:r,isConnector:i}=e;return"text"===t?`${n}-text-${r}`:"line"===t?i?`${n}-connector`:`${n}-line`:Math.random()}}}}({services:t}),Oi({services:t})):r>=Hn.SPARK.width&&i>=Hn.SPARK.height?a.push(...Ri({services:t}),...function({chart:e,services:t}){const{layoutService:n,styleService:r,labelService:i,animationsService:o,dockService:a}=t,{width:s,height:l}=a.meta.chart.size,u=bi(n.meta.measureAxisShow),{qHyperCube:c}=n.meta,p=c.qMeasureInfo[0].qFallbackTitle,f=c.qDataPages[0].qMatrix[0][0].qNum,d=r.query.label.getStyle(),m=r.query.axis.title.getStyle(),{getValueLabelFontSize:h}=i,g=h(fn.MIN,fn.MAX);return[{type:"labels",key:Ln.RADIAL_GAUGE_LABEL,layout:{displayOrder:4},settings:{sources:[{component:Ln.LABEL_RADIAL_GAUGE,selector:"path",strategy:{type:"rows",settings:{fill:"#000",padding:0,labels:[{fontSize:g,fontFamily:d.fontFamily,fill:d.fill,label({data:t}){const n=e.formatter(Cn.MEASURE);return t&&n?n(f):""},linkData:({data:e})=>e?{value:e.value.value,formatter:Cn.MEASURE}:null},{fontSize:Number.parseFloat(Si({width:s,height:l,fontSize:m.fontSize})),fontFamily:m.fontFamily,fill:m.color,label:()=>u?p:""}]}}}]},animations:{enabled:o.enabled,trackBy:e=>"text"+(e.data?"value-label":"axis-title"),adjustTweenedNodes(t){t.forEach((t=>{const{type:n,data:r}=t;if("text"===n&&r&&r.value&&r.formatter&&(t.text=e.formatter(r.formatter)(r.value),t.ellipsed)){const{text:e,fontSize:n,fontFamily:r,maxWidth:i}=t,o=`normal ${n} ${r}`,a="…",s=1;t.ellipsed=oi.tokenize(e,o,a,s,i)[0]}}))}}}]}({chart:n,services:t}),...Fi({services:t}),...o?[Vi({services:t})]:[],...Hi({services:t}),function({services:e}){const{dockService:t,themeService:n,colorService:r,layoutService:i,animationsService:o}=e,{width:a,height:s}=t.meta.chart.size,{refLines:l}=i.meta,u=n.getStyles(),c=Ur(a,s,ln,un),{innerRadius:p,outerRadius:f}=c,d=Xr({innerRadius:p,outerRadius:f,width:a,height:s}),m={type:"radial-custom-ref-line",key:Ln.RADIAL_REFERENCE_LINES,displayOrder:1,settings:{barWidth:d},lines:{radial:l.filter(Kr).map((e=>{var t,n;return{scale:"r",value:e.refLineExpr.value,cId:e.cId,label:{text:e.label,...u.referenceLine.label.name,showValue:e.showValue,showLabel:e.showLabel},radius:c.innerRadius,line:{stroke:r.getPaletteColor(e.paletteColor||{index:e.color}),strokeWidth:(null===(t=e.style)||void 0===t?void 0:t.lineThickness)||2,strokeDasharray:null===(n=e.style)||void 0===n?void 0:n.lineType}}}))},animations:{enabled:o.enabled,trackBy:e=>{const{type:t,cId:n}=e;return"line"===t?`${n}-line`:Math.random()},adjustTweenedNodes(e){e.forEach((e=>{const{type:t,data:n}=e;if("line"===t){const{angle:t,innerRadius:r}=n;e.x1=a/2+Math.cos(t)*r,e.y1=s/2+Math.sin(t)*r,e.x2=a/2+Math.cos(t)*(r+d),e.y2=s/2+Math.sin(t)*(r+d)}}))}}};return m}({services:t})):a.push(function({services:e}){const{dockService:t,layoutService:n,themeService:r,animationsService:i}=e,{width:o,height:a}=t.meta.chart.size,{rangeLimits:s,useSegments:l,segmentInfo:u,qHyperCube:c}=n.meta,{min:p,max:f}=s,d=c.qDataPages[0].qMatrix[0][0].qNum,m=Ur(o,a,ln,un).outerRadius;let h;h=d<p?ln:d>f?un:ln+(d-p)/(f-p)*(un-ln);const g=Gr({services:e}),y=l?function({value:e,segmentInfo:t,themeService:n}){const{paletteColors:r,limits:i}=t,o=n.getTheme();if(e<=i[0].value)return o.getColorPickerColor(r[0]);for(let t=0;t<i.length-1;t++)if(e>=i[t].value&&e<=i[t+1].value)return o.getColorPickerColor(r[t+1]);return o.getColorPickerColor(r[r.length-1])}({value:d,segmentInfo:u,themeService:r}):g({datum:{value:()=>0}});return{type:"radial-spark",key:Ln.RADIAL_SPARK,layout:{displayOrder:2},settings:{fill:y,radius:m,valueAngle:h},animations:{enabled:i.enabled,trackBy:e=>e.type}}}({services:t})),a}const zi=Math.log(10),_i={log:(e,t)=>e<=0||t<=0?NaN:Math.log(e)/Math.log(t),log10:e=>e<=0?NaN:Math.log(e)/zi,getNiceNumber(e){let t;if(0===e)return 0;const n=Math.floor(Math.log(Math.abs(e))/zi),r=e/10**n;return t=r<=1?1:r<=2?2:r<=5?5:10,t*10**n*(e<0?-1:1)},getSmallNiceNumber(e){let t;if(0===e)return 0;let n=Math.floor(Math.log(Math.abs(e))/zi);const r=e/10**n;return r<1?(t=5,n--):t=r<2?1:r<5?2:5,t*10**n*(e<0?-1:1)},getGoodNumber(e){let t;if(0===e)return 0;const n=Math.floor(Math.log(Math.abs(e))/zi),r=e/10**n;return t=Math.ceil(r),7!==t&&9!==t||t++,r>1&&r<=1.5?t=1.5:r>2&&r<=2.5&&(t=2.5),t*10**n*(e<0?-1:1)},calculateTicks(e,t,n,r,i,o){return this.plotSize=e,this.explicitPlotMin=t,this.explicitPlotMax=n,this.minTickSpacingInPixel=r,this.absMax=Math.abs(this.explicitPlotMax),this.absMin=Math.abs(this.explicitPlotMin),this.usedDataRange=this.explicitPlotMax-this.explicitPlotMin,this.maxNumIntervals=this.plotSize/this.minTickSpacingInPixel,this.maxNumTicks=this.maxNumIntervals+1,this.minTickDataSpacing=o||0,this.tickDataSpacing=Math.max(this.usedDataRange/this.maxNumIntervals,this.minTickDataSpacing),this.fontHeight=i,this.tickBaseValue=0,this.spaceUseLimit=.6,0===e?(this.plotMin=this.explicitPlotMin,this.plotMax=this.explicitPlotMax,this.tickDataSpacingNN=this.tickDataSpacing,Yi.call(this),Qi.call(this)):(this.maxNumIntervals<1?Ui.call(this):(this.explicitPlotMax>0&&this.explicitPlotMin<0?1===this.maxNumIntervals?Gi.call(this,!0):this.maxNumIntervals>=5?$i.call(this):this.maxNumIntervals<2?Wi.call(this):Xi.call(this):$i.call(this),this.tickMaxIndex<this.tickMinIndex?(this.tickDataSpacing=Math.max(this.usedDataRange/this.maxNumIntervals,this.minTickDataSpacing),Ui.call(this)):Ki.call(this)),Yi.call(this),Qi.call(this))}};function Bi(e,t,n){void 0===e&&(e=null!==this.explicitPlotMin),void 0===t&&(t=null!==this.explicitPlotMax),this.tickDataSpacingNN=n?_i.getGoodNumber(this.tickDataSpacing):_i.getNiceNumber(this.tickDataSpacing),Ji.apply(this,[e,t])}function $i(){Bi.call(this);const e=this.tickMaxIndex-this.tickMinIndex;let t=this.plotMax-this.plotMin;this.spaceUseFactor=t/this.plotRange;let n=this.plotSize*this.tickDataSpacingNN/this.plotRange<this.minTickSpacingInPixel;if(n&&this.maxNumIntervals>=5){for(;this.tickDataSpacing<=this.absMax&&n;)this.tickDataSpacing=Math.max(1.1*this.tickDataSpacingNN,this.minTickDataSpacing),Bi.call(this),t=this.plotMax-this.plotMin,this.spaceUseFactor=t/this.plotRange,n=this.plotSize*this.tickDataSpacingNN/this.plotRange<this.minTickSpacingInPixel;if(!n)return}for(this.tickDataSpacing=Math.max(this.usedDataRange/this.maxNumIntervals,this.minTickDataSpacing),(n||e<=2&&this.maxNumIntervals>=2*e)&&Bi.apply(this,[void 0,void 0,!0]),t=this.plotMax-this.plotMin,this.spaceUseFactor=t/this.plotRange,n=this.plotSize*this.tickDataSpacingNN/this.plotRange<this.minTickSpacingInPixel;this.tickDataSpacing<=this.absMax&&n;)this.tickDataSpacing=Math.max(1.1*this.tickDataSpacingNN,this.minTickDataSpacing),Bi.apply(this,[void 0,void 0,!0]),t=this.plotMax-this.plotMin,this.spaceUseFactor=t/this.plotRange,n=this.plotSize*this.tickDataSpacingNN/this.plotRange<this.minTickSpacingInPixel}function Gi(e){e?(this.tickDataSpacingNN=_i.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=_i.getNiceNumber(this.absMax),this.tickDataSpacingNN===this.absMax&&(this.tickDataSpacingNN=_i.getNiceNumber(1.1*this.absMax)))}function Ui(){let e;this.tickDataSpacingNN=_i.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=_i.getSmallNiceNumber(this.plotRange),this.tickBaseValue=Math.ceil(this.plotMin/e)*e)}function Wi(){const e=this.explicitPlotMax>=-this.explicitPlotMin,t=e||null!==this.explicitPlotMin,n=!e||null!==this.explicitPlotMax;Bi.apply(this,[t,n,!0]);const r=(this.absMax+(1-this.spaceUseLimit)*this.absMin)/this.spaceUseLimit*1.0001;for(;this.tickDataSpacing<=r&&this.plotSize*this.tickDataSpacingNN/this.plotRange<this.minTickSpacingInPixel;)this.tickDataSpacing=Math.max(1.1*this.tickDataSpacingNN,this.minTickDataSpacing),Bi.apply(this,[t,n,!0]);const i=this.plotMax-this.plotMin;this.spaceUseFactor=i/this.plotRange}function Xi(){$i.call(this);const e=this.plotMax-this.plotMin;this.spaceUseFactor=e/this.plotRange}function Ki(){const e=_i.getNiceNumber(this.tickDataSpacingNN);if(this.tickDataSpacingNN===e||0!==this.tickBaseValue)return;const t=this.tickDataSpacingNN,n=this.tickMinIndex,r=this.tickMaxIndex,i=r-n,o=this.plotMin,a=this.plotMax;this.tickDataSpacingNN=e,Ji.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===i||u>=10||u>=3&&1.5*u>=i)||(this.tickDataSpacingNN=t,this.tickMinIndex=n,this.tickMaxIndex=r,this.plotMin=o,this.plotMax=a,this.plotRange=this.plotMax-this.plotMin)}function Zi(){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 Yi(){let e,t;if(this.mainTickValues=[],this.secondaryTickValues=[],Zi.call(this),0===this.plotSize)return;e=this.tickBaseValue;const n=this.tickMaxIndex-this.tickMinIndex;if(!(n<1)){for(t=0;t<=n;t++)this.mainTickValues.push(e+(t+this.tickMinIndex)*this.tickDataSpacingNN);for(e=this.tickBaseValue+this.tickDataSpacingNN/2,t=0;t<n;t++)this.secondaryTickValues.push(e+(t+this.tickMinIndex)*this.tickDataSpacingNN)}}function Ji(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 Qi(){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 eo({core:e,dockService:t,rangeLimits:n,measureAxisSpacing:r,isRadial:i,isVertical:o,styleService:a}){const s=n.min,l=n.max,{width:u,height:c}=function(e){return{width:e.meta.chart.size.width,height:e.meta.chart.size.height}}(t);let p,f=96*r;if(i)p=Math.min(c,u);else{p=o?c:u;const{chart:t,picassoInstance:n}=e;if(t&&n){const e=t.formatter(Cn.MEASURE),i=n.renderer("svg")(),d=a.query.axis.label.getStyle(),{fontFamily:m,fontSize:h}=d,g=e=>i.measureText({text:e,fontSize:Si({width:u,height:c,fontSize:h}),fontFamily:m}),y=Math.max(96,...[s,l,(l-s)/2].map((t=>g(e(t)).width)));f=o?4*g("M").height:y;f=p/(Math.max(2,p/f/r+1)-1)}}const d=function({plotSize:e,rangeMax:t,rangeMin:n,minTickSpacingInPixel:r}){const i=_i.calculateTicks(e,n,t,r,20,0);i.tickSpacing;let o=i.mainTickValues;0===o.length&&o.push(i.minTickValue);const a=o[0];o[0]=i.plotMin,a-i.plotMin>=i.tickSpacing/2&&o.splice(1,0,a);const s=i.mainTickValues[i.mainTickValues.length-1];return i.plotMax-s<=i.tickSpacing/2?o[i.mainTickValues.length-1]=Math.round(i.plotMax):o.push(Math.round(i.plotMax)),o}({plotSize:p,rangeMin:s,rangeMax:l,minTickSpacingInPixel:f});return{values:d}}function to({isRadial:e,dockService:t,isVertical:n}){return e?!t.config.rtl:!!n||t.config.rtl}function no({core:e,services:t,logicalSize:n}){if(!t.layoutService.meta.qHyperCube)throw new Error("Layout is missing a hypercube");const r=ji({core:e,services:t}),i=function({core:e,services:t}){const{dockService:n,styleService:r,colorService:i,layoutService:o}=t,{rangeLimits:a,measureAxisSpacing:s,gaugetype:l}=o.meta,u=yi({dockService:n,layoutService:o}),c="radial"===l,p=eo({core:e,dockService:n,rangeLimits:a,measureAxisSpacing:s,isRadial:c,isVertical:u,styleService:r});return{m:{data:{field:"qMeasureInfo/0"},type:"linear",invert:to({isRadial:c,dockService:n,isVertical:u}),min:a.min,max:a.max,ticks:{values:p.values}},r:{data:{field:"qMeasureInfo/0"},invert:n.config.rtl,min:a.min,max:a.max},...i.getScales()}}({core:e,services:t});return{scales:i,components:r,formatters:{[Cn.MEASURE]:{data:{field:"qMeasureInfo/0"}}},strategy:{layoutModes:Hn,logicalSize:n}}}const ro={Object_Gauge_RangeIsDefault:{id:"Object.Gauge.RangeIsDefault",locale:{"de-DE":"Max. und Min. auf Standardwerte festgelegt. Sie können über das Eigenschaften-Fenster unter Darstellung > Präsentation geändert werden.","en-US":"Max. and Min. set to default values. You can change them via the properties window under Display > Presentation.","es-ES":"Máx y mín se han configurado como valores predefinidos. Puede cambiarlos en el panel de propiedades en Aspecto > Presentación.","fr-FR":"Les valeurs max. et min. par défaut sont définies. Vous pouvez les modifier via le panneau des propriétés sous Aspect > Présentation.","it-IT":"Il massimo e il minimo vengono impostati sui valori predefiniti. È possibile modificarli nel pannello delle proprietà in Aspetto > Presentazione.","ja-JP":"最大値と最小値は規定値に設定されています。これは、スタイル > プレゼンテーションからプロパティ パネルで変更できます。","ko-KR":"최대 및 최소 값이 기본값으로 설정됩니다. 모양 > 프레젠테이션 아래 속성 패널에서 이를 변경할 수 있습니다.","nl-NL":"Max. en min. zijn ingesteld op standaardwaarden. U kunt deze wijzigen in het eigenschappenvenster onder Uiterlijk > Presentatie.","pl-PL":"Maks. i Min. są ustawione na wartości domyślne. Można je zmienić w panelu właściwości, w obszarze Wygląd > Prezentacja.","pr-BR":"Máx. e mín. estão definidos com valores padrão. É possível alterá-los no painel de propriedades, em Aparência > Apresentação.","ru-RU":"Максимальные и минимальные значения установлены по умолчанию. Эти значения можно изменить на панели свойств в меню Вид > Представление.","sv-SE":"Max och min är inställda på standardvärden. Du kan ändra dem i egenskapspanelen under Utseende > Presentation.","tr-TR":"Maks. ve min. değerleri varsayılan değerlere ayarlanmıştır. Görünüş > Sunum altındaki özellikler panelinden bu değerleri değiştirebilirsiniz.","zh-CN":"最大值和最小值已设置为默认值。您可以在“外观”>“显示”下的属性面板中进行更改。","zh-TW":"最大值與最小值均設為預設值。您可以在 [外觀] > [呈現方式] 之下的屬性面板中變更這些值。"}},Object_Gauge_RangeIsDefaultTitle:{id:"Object.Gauge.RangeIsDefaultTitle",locale:{"de-DE":"Bereich auf Standardwerte eingestellt","en-US":"Range set to default values","es-ES":"Rango fijado a valores predeterminados","fr-FR":"Plage définie sur les valeurs par défaut","it-IT":"Scala impostata sui valori predefiniti","ja-JP":"範囲は規定値に設定されています","ko-KR":"범위가 기본값으로 설정됩니다.","nl-NL":"Bereik ingesteld op standaardwaarden","pl-PL":"Zakres ustawiony na wartości domyślne","pt-BR":"Intervalo definido com valores padrão","ru-RU":"Значения диапазона установлены по умолчанию","sv-SE":"Intervallet har standardvärden","tr-TR":"Varsayılan değerlere ayarlı aralık","zh-CN":"范围设置为默认值","zh-TW":"範圍會設為預設值"}}};function io(e){return{properties:{qHyperCubeDef:{qMeasures:[],qInitialDataFetch:[{qWidth:1,qHeight:1}],qSuppressZero:!1,qSuppressMissing:!0},showTitles:!0,title:"",subtitle:"",footnote:"",measureAxis:{min:0,max:100},orientation:"horizontal",valueMode:"absolute",segmentInfo:{limits:[],colors:[{color:3}]}},data:{targets:[{path:"/qHyperCubeDef",...en(e)}]}}}function oo(i){return function(e){if(e&&e.get&&e.add){const t="Object.Gauge.RangeIsDefault";if(e.get(t)!==t)return;Object.keys(ro).forEach((t=>{e.add(ro[t])}))}}(i.translator),{qae:io(i),ext:on(i),component(){const i=(()=>{const i=e(),o=t(),[a,s]=n({});return r((()=>{i.style.overflow="hidden";const e=h();e.use(m),e.component("oob-indicator",$r),e.component("radial-gauge-needle",Yr),e.component("radial-custom-ref-line",si),e.component("custom-ref-line",ci),e.component("radial-oob-indicator",Jr),e.component("radial-spark",li),e.component("disclaimer-component",an);const t=e({renderer:{prio:[o.renderer||"svg"]}}),n=t.chart({element:i,data:[],settings:{}});return s({picassoInstance:t,chart:n,cache:wt()}),()=>{n.destroy()}}),[]),a})(),o=Di({core:i}),a=(({core:e,services:i})=>{const[o,a]=n({}),s=t(),u=l();return f((async()=>{if(!i)return Promise.resolve();const{colorService:t}=i;return t.initialize().then((()=>{const{layoutService:t}=i,n=mi({layout:t.getLayout(),options:s}),r=no({core:e,services:i,logicalSize:n});a(r)}))}),[i]),r((()=>{if(i&&i.dockService&&i.layoutService){const{dockService:t,layoutService:n,animationsService:r}=i;r.meta.isSizeChanging=!0;const o=mi({layout:n.getLayout(),options:s});t.update(o||u);const l=no({core:e,services:i,logicalSize:o});a(l)}}),[u]),o})({core:i,services:o});di({core:i,settings:a,services:o}),(({services:e})=>{d((t=>{if(e){const{dockService:n}=e,{width:r,height:i}=n.meta.chart.size;t.snapshotData=t.snapshotData||{content:{size:{w:r,h:i}}},t.snapshotData.content={size:{w:r,h:i}}}return Promise.resolve(t)}))})({services:o})}}}export{oo as default};