@nebula.js/sn-pie-chart 1.28.19 → 2.0.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,5 +1,5 @@
|
|
|
1
1
|
/*
|
|
2
|
-
* @nebula.js/sn-pie-chart
|
|
2
|
+
* @nebula.js/sn-pie-chart v2.0.1
|
|
3
3
|
* Copyright (c) 2025 QlikTech International AB
|
|
4
4
|
* Released under the MIT license.
|
|
5
5
|
*/
|
|
@@ -10,4 +10,4 @@ var e,t,n="function"==typeof Symbol?Symbol:{},r=n.iterator||"@@iterator",i=n.toS
|
|
|
10
10
|
/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */
|
|
11
11
|
var e,t,n="function"==typeof Symbol?Symbol:{},r=n.iterator||"@@iterator",i=n.toStringTag||"@@toStringTag";function o(n,r,i,o){var l=r&&r.prototype instanceof s?r:s,u=Object.create(l.prototype);return Cn(u,"_invoke",function(n,r,i){var o,s,l,u=0,c=i||[],p=!1,d={p:0,n:0,v:e,a:f,f:f.bind(e,4),d:function(t,n){return o=t,s=0,l=e,d.n=n,a}};function f(n,r){for(s=n,l=r,t=0;!p&&u&&!i&&t<c.length;t++){var i,o=c[t],f=d.p,m=o[2];n>3?(i=m===r)&&(l=o[(s=o[4])?5:(s=3,3)],o[4]=o[5]=e):o[0]<=f&&((i=n<2&&f<o[1])?(s=0,d.v=r,d.n=o[1]):f<m&&(i=n<3||o[0]>r||r>m)&&(o[4]=n,o[5]=r,d.n=m,s=0))}if(i||n>1)return a;throw p=!0,r}return function(i,c,m){if(u>1)throw TypeError("Generator is already running");for(p&&1===c&&f(c,m),s=c,l=m;(t=s<2?e:l)||!p;){o||(s?s<3?(s>1&&(d.n=-1),f(s,l)):d.n=l:d.v=l);try{if(u=2,o){if(s||(i="next"),t=o[i]){if(!(t=t.call(o,l)))throw TypeError("iterator result is not an object");if(!t.done)return t;l=t.value,s<2&&(s=0)}else 1===s&&(t=o.return)&&t.call(o),s<2&&(l=TypeError("The iterator does not provide a '"+i+"' method"),s=1);o=e}else if((t=(p=d.n<0)?l:n.call(r,d))!==a)break}catch(t){o=e,s=1,l=t}finally{u=1}}return{value:t,done:p}}}(n,i,o),!0),u}var a={};function s(){}function l(){}function u(){}t=Object.getPrototypeOf;var c=[][r]?t(t([][r]())):(Cn(t={},r,function(){return this}),t),p=u.prototype=s.prototype=Object.create(c);function d(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,u):(e.__proto__=u,Cn(e,i,"GeneratorFunction")),e.prototype=Object.create(p),e}return l.prototype=u,Cn(p,"constructor",u),Cn(u,"constructor",l),l.displayName="GeneratorFunction",Cn(u,i,"GeneratorFunction"),Cn(p),Cn(p,i,"Generator"),Cn(p,r,function(){return this}),Cn(p,"toString",function(){return"[object Generator]"}),(Sn=function(){return{w:o,m:d}})()}function Cn(e,t,n,r){var i=Object.defineProperty;try{i({},"",{})}catch(e){i=0}Cn=function(e,t,n,r){function o(t,n){Cn(e,t,function(e){return this._invoke(t,n,e)})}t?i?i(e,t,{value:n,enumerable:!r,configurable:!r,writable:!r}):e[t]=n:(o("next",0),o("throw",1),o("return",2))},Cn(e,t,n,r)}function wn(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)||An(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 En(e){return function(e){if(Array.isArray(e))return yn(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||An(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 In(e){return In="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},In(e)}function An(e,t){if(e){if("string"==typeof e)return yn(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)?yn(e,t):void 0}}var Mn,kn="top",Ln="top-right",On="right",Tn="bottom-right",Nn="bottom",Pn="bottom-left",Fn="left",Rn="top-left";bn(bn(bn(bn(bn(bn(bn(bn(bn(bn(Mn={},"equal-equal",[kn,Nn]),"equal-higher",[Nn,Tn]),"equal-lower",[kn,Ln]),"equal-void",[kn,Nn]),"higher-equal",[Fn,Pn,kn,Ln]),"higher-higher-acute",[Nn,Pn,Fn,Ln]),"higher-higher-obtuse",[Nn,kn]),"higher-lower-negative",[kn,Ln,On]),"higher-lower-positive",[Nn,Pn,Fn]),"higher-void",[kn]),bn(bn(bn(bn(bn(bn(bn(bn(bn(bn(Mn,"lower-equal",[kn]),"lower-higher-negative",[kn,Rn]),"lower-higher-positive",[Tn]),"lower-lower-acute",[kn,Rn,Fn,Ln,On]),"lower-lower-obtuse",[kn,Nn]),"lower-void",[kn]),"void-equal",[kn]),"void-higher",[kn,Nn]),"void-lower",[kn,Nn,Fn]),"void-void",[kn]),bn(Mn,"unclassified",[kn,Nn,On,Fn,Ln,Tn,Pn,Rn]);var jn=["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"],Hn=["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 Vn=function(e){return{value:e,label:e.charAt(0).toUpperCase()+e.slice(1),groupHeader:!1,disabled:!1,styles:{fontFamily:e}}};function zn(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,En(new Set([r].concat(En(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(En(o.map(function(e){return Vn(e)})),[{value:"DefaultHeader",label:n.get("properties.allFonts"),metaText:n.get("properties.default"),groupHeader:!0}],En(function(e){return null!=e&&e.isEnabled("PS_20852_WYSIWYG_FONT_SUPPORT")?Hn:jn}(i).map(function(e){return Vn(e)})))}function _n(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 zn({theme:t,translator:n,defaultValue:a(),flags:o})}}}var Bn,$n,Un=["10px","11px","12px","13px","14px","15px","16px","17px","18px","19px","20px","21px","22px","23px","24px"],Wn=function(e){return{value:e,label:e,groupHeader:!1,disabled:!1}};function Kn(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,En(new Set([n].concat(En(i))))):r.push(n),[{value:"ThemeHeader",label:t.get("properties.themeFontSizes"),metaText:t.get("properties.theme"),groupHeader:!0}].concat(En(r.map(function(e){return Wn(e)})),[{value:"DefaultHeader",label:t.get("properties.allFontSizes"),metaText:t.get("properties.default"),groupHeader:!0}],En(Un.map(function(e){return Wn(e)})))}({theme:t,translator:n,defaultValue:o()})}}}function Yn(e){var t=e.theme,n=e.translator,r=e.id,i=e.path;return{fontFamily:_n({theme:t,translator:n,id:r,path:i,flags:e.flags}),fontSize:Kn({theme:t,translator:n,id:r,path:i})}}function Gn(e){return Jn.apply(this,arguments)}function Jn(){return(Jn=vn(Sn().m(function e(t){var n,r,i,o;return Sn().w(function(e){for(;;)switch(e.n){case 0:if(n=t.app,r=t.items,n.evaluate){e.n=1;break}return e.a(2,r);case 1:return e.n=2,Promise.all(r.filter(function(e){var t;return!(null===(t=e.qCalcCondition)||void 0===t||null===(t=t.qCond)||void 0===t||!t.qv)}).map(function(e){var t=e.qCalcCondition.qCond.qv;return n.evaluate(t).then(function(t){return"0"===t?e.qDef.cId:void 0}).catch(function(){return e.qDef.cId})}));case 2:return i=e.v,o=i.filter(Boolean),e.a(2,r.filter(function(e){return!o.includes(e.qDef.cId)}))}},e)}))).apply(this,arguments)}function Zn(e){var t=e.app,n=e.translator,r=e.dimension,i={id:r.qDef.cId,text:n.get("Object.ErrorMessage.MissingDimension"),meta:{}},o=r.qLibraryId;if(o)return t.getDimension?t.getDimension(o).then(function(e){return e.getLayout()}).catch(function(){}).then(function(e){if(!e)return i;var t=e.qDim,n=t.qGrouping,o=t.qLabelExpression,a="C"===n,s="H"===n,l="N"===n;return{id:r.qDef.cId,text:o&&l?o:e.qDim.title,meta:{isCyclic:a,isDrillDown:s,isNormal:l}}}):i;var a=r.qDef,s=a.cId,l=a.qLabelExpression,u=a.qFieldLabels,c=a.qFieldDefs,p={isCyclic:!1,isDrillDown:!1,isNormal:!0};return l?t.evaluate?t.evaluate(l).then(function(e){return{id:s,text:e,meta:p}}):i:{id:s,text:u[0]||c[0],meta:p}}function Xn(e){return Qn.apply(this,arguments)}function Qn(){return(Qn=vn(Sn().m(function e(t){var n,r,i,o,a,s,l,u;return Sn().w(function(e){for(;;)switch(e.n){case 0:if(r=t.app,i=t.translator,o=t.properties,a=(null==o||null===(n=o.qHyperCubeDef)||void 0===n||null===(n=n.qLayoutExclude)||void 0===n?void 0:n.qHyperCubeDef)||{},s=a.qDimensions,(l=void 0===s?[]:s).length){e.n=1;break}return e.a(2,Promise.resolve([]));case 1:return e.n=2,Gn({app:r,items:l});case 2:return u=e.v,e.a(2,Promise.all(u.map(function(e){return Zn({app:r,translator:i,dimension:e})})))}},e)}))).apply(this,arguments)}function er(e){var t=e.app,n=e.translator,r=e.measure,i={id:r.qDef.cId,text:n.get("Object.ErrorMessage.MissingMeasure")},o=r.qLibraryId;if(o)return t.getMeasure?t.getMeasure(o).then(function(e){return e.getLayout()}).catch(function(){}).then(function(e){if(!e)return i;var t=e.qMeasure.qLabelExpression;return{id:r.qDef.cId,text:t||e.qMeasure.qLabel||e.qMeasure.qDef}}):i;var a=r.qDef,s=a.cId,l=a.qLabelExpression,u=a.qLabel,c=a.qDef;return l?t.evaluate?t.evaluate(l).then(function(e){return{id:s,text:e}}):i:{id:s,text:u||c}}function tr(e){return nr.apply(this,arguments)}function nr(){return(nr=vn(Sn().m(function e(t){var n,r,i,o,a,s,l,u;return Sn().w(function(e){for(;;)switch(e.n){case 0:if(r=t.app,i=t.translator,o=t.properties,a=(null==o||null===(n=o.qHyperCubeDef)||void 0===n||null===(n=n.qLayoutExclude)||void 0===n?void 0:n.qHyperCubeDef)||{},s=a.qMeasures,(l=void 0===s?[]:s).length){e.n=1;break}return e.a(2,Promise.resolve([]));case 1:return e.n=2,Gn({app:r,items:l});case 2:return u=e.v,e.a(2,Promise.all(u.map(function(e){return er({app:r,translator:i,measure:e})})))}},e)}))).apply(this,arguments)}var rr=function(){if($n)return Bn;$n=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 Bn=function e(){var t,n,r,l,u,c,p=arguments[0],d=1,f=arguments.length,m=!1;for("boolean"==typeof p&&(m=p,p=arguments[1]||{},d=2),(null==p||"object"!=typeof p&&"function"!=typeof p)&&(p={});d<f;++d)if(null!=(t=arguments[d]))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},Bn}(),ir=function(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}(rr);function or(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 ar(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 sr(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 lr(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 ur(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 cr(e,t,n){e.prototype=t.prototype=n,n.constructor=e}function pr(e,t){var n=Object.create(e.prototype);for(var r in t)n[r]=t[r];return n}function dr(){}var fr=1/.7,mr="\\s*([+-]?\\d+)\\s*",hr="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",yr="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",gr=/^#([0-9a-f]{3,8})$/,vr=new RegExp(`^rgb\\(${mr},${mr},${mr}\\)$`),br=new RegExp(`^rgb\\(${yr},${yr},${yr}\\)$`),xr=new RegExp(`^rgba\\(${mr},${mr},${mr},${hr}\\)$`),qr=new RegExp(`^rgba\\(${yr},${yr},${yr},${hr}\\)$`),Dr=new RegExp(`^hsl\\(${hr},${yr},${yr}\\)$`),Sr=new RegExp(`^hsla\\(${hr},${yr},${yr},${hr}\\)$`),Cr={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 wr(){return this.rgb().formatHex()}function Er(){return this.rgb().formatRgb()}function Ir(e){var t,n;return e=(e+"").trim().toLowerCase(),(t=gr.exec(e))?(n=t[1].length,t=parseInt(t[1],16),6===n?Ar(t):3===n?new Or(t>>8&15|t>>4&240,t>>4&15|240&t,(15&t)<<4|15&t,1):8===n?Mr(t>>24&255,t>>16&255,t>>8&255,(255&t)/255):4===n?Mr(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=vr.exec(e))?new Or(t[1],t[2],t[3],1):(t=br.exec(e))?new Or(255*t[1]/100,255*t[2]/100,255*t[3]/100,1):(t=xr.exec(e))?Mr(t[1],t[2],t[3],t[4]):(t=qr.exec(e))?Mr(255*t[1]/100,255*t[2]/100,255*t[3]/100,t[4]):(t=Dr.exec(e))?jr(t[1],t[2]/100,t[3]/100,1):(t=Sr.exec(e))?jr(t[1],t[2]/100,t[3]/100,t[4]):Cr.hasOwnProperty(e)?Ar(Cr[e]):"transparent"===e?new Or(NaN,NaN,NaN,0):null}function Ar(e){return new Or(e>>16&255,e>>8&255,255&e,1)}function Mr(e,t,n,r){return r<=0&&(e=t=n=NaN),new Or(e,t,n,r)}function kr(e){return e instanceof dr||(e=Ir(e)),e?new Or((e=e.rgb()).r,e.g,e.b,e.opacity):new Or}function Lr(e,t,n,r){return 1===arguments.length?kr(e):new Or(e,t,n,null==r?1:r)}function Or(e,t,n,r){this.r=+e,this.g=+t,this.b=+n,this.opacity=+r}function Tr(){return`#${Rr(this.r)}${Rr(this.g)}${Rr(this.b)}`}function Nr(){const e=Pr(this.opacity);return`${1===e?"rgb(":"rgba("}${Fr(this.r)}, ${Fr(this.g)}, ${Fr(this.b)}${1===e?")":`, ${e})`}`}function Pr(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function Fr(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function Rr(e){return((e=Fr(e))<16?"0":"")+e.toString(16)}function jr(e,t,n,r){return r<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new Vr(e,t,n,r)}function Hr(e){if(e instanceof Vr)return new Vr(e.h,e.s,e.l,e.opacity);if(e instanceof dr||(e=Ir(e)),!e)return new Vr;if(e instanceof Vr)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 Vr(a,s,l,e.opacity)}function Vr(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}function zr(e){return(e=(e||0)%360)<0?e+360:e}function _r(e){return Math.max(0,Math.min(1,e||0))}function Br(e,t,n){return 255*(e<60?t+(n-t)*e/60:e<180?n:e<240?t+(n-t)*(240-e)/60:t)}cr(dr,Ir,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:wr,formatHex:wr,formatHex8:function(){return this.rgb().formatHex8()},formatHsl:function(){return Hr(this).formatHsl()},formatRgb:Er,toString:Er}),cr(Or,Lr,pr(dr,{brighter(e){return e=null==e?fr:Math.pow(fr,e),new Or(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=null==e?.7:Math.pow(.7,e),new Or(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new Or(Fr(this.r),Fr(this.g),Fr(this.b),Pr(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:Tr,formatHex:Tr,formatHex8:function(){return`#${Rr(this.r)}${Rr(this.g)}${Rr(this.b)}${Rr(255*(isNaN(this.opacity)?1:this.opacity))}`},formatRgb:Nr,toString:Nr})),cr(Vr,function(e,t,n,r){return 1===arguments.length?Hr(e):new Vr(e,t,n,null==r?1:r)},pr(dr,{brighter(e){return e=null==e?fr:Math.pow(fr,e),new Vr(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=null==e?.7:Math.pow(.7,e),new Vr(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 Or(Br(e>=240?e-240:e+120,i,r),Br(e,i,r),Br(e<120?e+240:e-120,i,r),this.opacity)},clamp(){return new Vr(zr(this.h),_r(this.s),_r(this.l),Pr(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=Pr(this.opacity);return`${1===e?"hsl(":"hsla("}${zr(this.h)}, ${100*_r(this.s)}%, ${100*_r(this.l)}%${1===e?")":`, ${e})`}`}}));const $r=Math.PI/180,Ur=180/Math.PI,Wr=4/29,Kr=6/29,Yr=3*Kr*Kr;function Gr(e){if(e instanceof Jr)return new Jr(e.l,e.a,e.b,e.opacity);if(e instanceof ti)return ni(e);e instanceof Or||(e=kr(e));var t,n,r=ei(e.r),i=ei(e.g),o=ei(e.b),a=Zr((.2225045*r+.7168786*i+.0606169*o)/1);return r===i&&i===o?t=n=a:(t=Zr((.4360747*r+.3850649*i+.1430804*o)/.96422),n=Zr((.0139322*r+.0971045*i+.7141733*o)/.82521)),new Jr(116*a-16,500*(t-a),200*(a-n),e.opacity)}function Jr(e,t,n,r){this.l=+e,this.a=+t,this.b=+n,this.opacity=+r}function Zr(e){return e>.008856451679035631?Math.pow(e,1/3):e/Yr+Wr}function Xr(e){return e>Kr?e*e*e:Yr*(e-Wr)}function Qr(e){return 255*(e<=.0031308?12.92*e:1.055*Math.pow(e,1/2.4)-.055)}function ei(e){return(e/=255)<=.04045?e/12.92:Math.pow((e+.055)/1.055,2.4)}function ti(e,t,n,r){this.h=+e,this.c=+t,this.l=+n,this.opacity=+r}function ni(e){if(isNaN(e.h))return new Jr(e.l,0,0,e.opacity);var t=e.h*$r;return new Jr(e.l,Math.cos(t)*e.c,Math.sin(t)*e.c,e.opacity)}cr(Jr,function(e,t,n,r){return 1===arguments.length?Gr(e):new Jr(e,t,n,null==r?1:r)},pr(dr,{brighter(e){return new Jr(this.l+18*(null==e?1:e),this.a,this.b,this.opacity)},darker(e){return new Jr(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 Or(Qr(3.1338561*(t=.96422*Xr(t))-1.6168667*(e=1*Xr(e))-.4906146*(n=.82521*Xr(n))),Qr(-.9787684*t+1.9161415*e+.033454*n),Qr(.0719453*t-.2289914*e+1.4052427*n),this.opacity)}})),cr(ti,function(e,t,n,r){return 1===arguments.length?function(e){if(e instanceof ti)return new ti(e.h,e.c,e.l,e.opacity);if(e instanceof Jr||(e=Gr(e)),0===e.a&&0===e.b)return new ti(NaN,0<e.l&&e.l<100?0:NaN,e.l,e.opacity);var t=Math.atan2(e.b,e.a)*Ur;return new ti(t<0?t+360:t,Math.sqrt(e.a*e.a+e.b*e.b),e.l,e.opacity)}(e):new ti(e,t,n,null==r?1:r)},pr(dr,{brighter(e){return new ti(this.h,this.c,this.l+18*(null==e?1:e),this.opacity)},darker(e){return new ti(this.h,this.c,this.l-18*(null==e?1:e),this.opacity)},rgb(){return ni(this).rgb()}}));var ri=e=>()=>e;function ii(e,t){var n=t-e;return n?function(e,t){return function(n){return e+n*t}}(e,n):ri(isNaN(e)?t:e)}var oi=function e(t){var n=function(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):ri(isNaN(t)?n:t)}}(t);function r(e,t){var r=n((e=Lr(e)).r,(t=Lr(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),ai=/^class(-pyramid)?/,si=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(En(c))),o=Math.max.apply(Math,[o].concat(En(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 d=t.breakTypes;u.type="continuous",u.domain=[i],u.range=[p[0]];for(var f=0;f<c.length;f+=1)if(d[f]){var m=p[f],h=p[f+1],y=oi(m,h)(.5);u.range.push(y),u.domain.push(c[f]),f<c.length-1&&d[f+1]&&(u.range.push(p[f+1]),u.domain.push((c[f]+c[f+1])/2))}else u.range.push(p[f]),u.range.push(p[f+1]),u.domain.push(c[f]),u.domain.push(c[f]+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 li(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):li(e,t,n,r+1,i)}var ui=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,En(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,En(c)),u.max=Math.max.apply(Math,En(c))}if(n.input.measureScheme&&(u.palettes={quant:n.input.measureScheme}),a){var d=a.getDataColorScales().filter(function(e){return e.key===n.input.measureScheme})[0];u.type=d&&ai.test(d.type)?"categorical":"continuous","categorical"===u.type&&(o=d.colors.some(function(e){return Array.isArray(e)})?Math.max.apply(Math,En(d.colors.map(function(e){return e?e.length:0}))):d.colors.length)}if("categorical"===u.type){for(var f=p?li(u.max,u.min,c,1,o):o,m=(u.max-u.min)/f,h=[],y=0;y<f+1;y+=1)h.push(u.min+m*y);u.domain=h,u.range=function(e){for(var t=e.resources.theme.palette("quant",f),n=Math.max(1,Math.floor(t.length/f)),r=[],i=0;i<f;i+=1)r.push(t[i*n]);return[r[0]].concat(r,[r[r.length-1]])}}return u};function ci(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 pi(e){e.measureOverrides.every(function(e){return!e})&&(e.measureOverrides=null)}function di(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 fi(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?ci:o,s=n.input.byMeasureDef||{activeMeasureIndex:0},l=a(n,s),u=ui(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&&ir(u,si(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?lr:i,a=r.getCByField,s=void 0===a?ur:a,l=r.getPersistence,u=void 0===l?sr:l,c=o(t,n),p=s(n,c),d=p?p.raw():{},f=n&&n.pic?n.pic.raw():{};if(d.qError||d.qSize&&0===d.qSize.qcy&&!f.qHasOtherValues)return{invalid:!0};var m={mode:"field",fieldType:"dimension",type:"categorical",field:p?p.key():void 0,isFieldLocked:d.qLocked};return("expression"===c.type||c.activeDimensionIndex<0)&&(m.label=c.label,"color.altLabel"===d.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),ir(m,u(t,n,c,p,{byRow:ar,byElemNo:or})),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=ui(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 d=[],f=[];return i.qDimensionInfo.forEach(function(t,n){if(t.baseColor||t.coloring&&t.coloring.baseColor){d.push(n);var i=e.resolveUIColor(t.baseColor||t.coloring.baseColor);"none"===i?f.push(r.primary):f.push(i)}}),{mode:"dimension",type:"categorical",field:d.length?d[0]:void 0,explicit:d.length?{domain:d,range:f}: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)),qn(qn({},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 qn(qn({},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(pi(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=di(e.measureOverrides,e.explicit),pi(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=di(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 mi=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},hi=function(e){throw e.isHandled=!0,e};function yi(e){return function(t){return"object"===In(t.datum[e])?t.datum[e].value:void 0}}function gi(e){return"object"===In(e.datum.isNull)?e.datum.isNull.value:-2===e.datum.value}function vi(e){return-3===e.datum.value}var bi={COLOR:void 0,FONT_SIZE:"16px",FONT_FAMILY:"'Source Sans Pro', 'Arial', 'sans-serif'"},xi={COLOR:void 0,FONT_SIZE:void 0,FONT_FAMILY:"'Source Sans Pro', 'Arial', 'sans-serif'"};function qi(e){var t=e.theme,n=e.key,r=e.styleOverrides,i={title:{color:bi.COLOR,fontSize:bi.FONT_SIZE,fontFamily:bi.FONT_FAMILY},label:{color:xi.COLOR,fontSize:xi.FONT_SIZE,fontFamily:xi.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",bi.COLOR),i.title.fontSize=l(null==a?void 0:a.fontSize,"legend.title","fontSize",bi.FONT_SIZE),i.title.fontFamily=l(null==a?void 0:a.fontFamily,"legend.title","fontFamily",bi.FONT_FAMILY),i.label.color=l(null==s?void 0:s.color,"legend.label","color",xi.COLOR),i.label.fontSize=l(null==s?void 0:s.fontSize,"legend.label","fontSize",xi.FONT_SIZE),i.label.fontFamily=l(null==s?void 0:s.fontFamily,"legend.label","fontFamily",xi.FONT_FAMILY),i}var Di=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"},Si=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 Ci(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=qi({theme:l,key:n,styleOverrides:r});return{layout:{minimumLayoutMode:"MEDIUM",dock:Di(a,i,o)},show:"function"==typeof a.show?function(){return Si(a,u,s)}:Si(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 wi(e,t,n){var r=[],i=[],o=function(e,t,n){return"categorical"===t.coloring.type?function(e,t,n){var r=Ci(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,d=t.scaleKey,f=t.theme,m=t.scales,h=qi({theme:f,key:a,styleOverrides:s}),y=r.layout.dock,g="left"===y||"right"===y?{maxLines:2,wordBreak:"break-word"}:{},v={up:"M13.6,11 L2.4,11 C2.28954305,11 2.2,10.9104569 2.2,10.8 C2.2,10.756726 2.21403557,10.7146192 2.24,10.68 L7.84,3.21333333 C7.90627417,3.12496777 8.03163444,3.10705916 8.12,3.17333333 C8.13516113,3.18470418 8.14862915,3.1981722 8.16,3.21333333 L13.76,10.68 C13.8262742,10.7683656 13.8083656,10.8937258 13.72,10.96 C13.6853808,10.9859644 13.643274,11 13.6,11 Z",down:"M2.4,4 L13.6,4 C13.7104569,4 13.8,4.08954305 13.8,4.2 C13.8,4.24327404 13.7859644,4.28538077 13.76,4.32 L8.16,11.7866667 C8.09372583,11.8750322 7.96836556,11.8929408 7.88,11.8266667 C7.86483887,11.8152958 7.85137085,11.8018278 7.84,11.7866667 L2.24,4.32 C2.17372583,4.23163444 2.19163444,4.10627417 2.28,4.04 C2.31461923,4.01403557 2.35672596,4 2.4,4 Z",left:"M11,2.4 L11,13.6 C11,13.7104569 10.9104569,13.8 10.8,13.8 C10.756726,13.8 10.7146192,13.7859644 10.68,13.76 L3.21333333,8.16 C3.12496777,8.09372583 3.10705916,7.96836556 3.17333333,7.88 C3.18470418,7.86483887 3.1981722,7.85137085 3.21333333,7.84 L10.68,2.24 C10.7683656,2.17372583 10.8937258,2.19163444 10.96,2.28 C10.9859644,2.31461923 11,2.35672596 11,2.4 Z",right:"M4,13.6 L4,2.4 C4,2.28954305 4.08954305,2.2 4.2,2.2 C4.24327404,2.2 4.28538077,2.21403557 4.32,2.24 L11.7866667,7.84 C11.8750322,7.90627417 11.8929408,8.03163444 11.8266667,8.12 C11.8152958,8.13516113 11.8018278,8.14862915 11.7866667,8.16 L4.32,13.76 C4.23163444,13.8262742 4.10627417,13.8083656 4.04,13.72 C4.01403557,13.6853808 4,13.643274 4,13.6 Z"};"dimension"===t.coloring.fieldType&&(i=function(e){return e.datum.value>=0||-3===e.datum.value});var b="".concat(d,"Legend");return ir(!0,r,{type:"legend-cat",key:"".concat(o,"-cat"),scale:b in m?b:d,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:qn({fill:h.label.color,fontSize:h.label.fontSize,fontFamily:h.label.fontFamily},g)},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"),d=Ci(e,t);if(!d.show)return!1;var f=qi({theme:c,key:i,styleOverrides:o}),m=d.layout.dock,h="right"===m||"left"===m,y=null===(n=t.scales)||void 0===n?void 0:n[p];return h&&y&&(y.invert=!0),ir(!0,d,{type:"legend-seq",key:"".concat(r,"-seq"),settings:{fill:u,major:p,length:1,tick:{fill:f.label.color,fontSize:f.label.fontSize,fontFamily:f.label.fontFamily},title:{anchor:!a||"top"!==d.layout.dock&&"bottom"!==d.layout.dock?void 0:"right",padding:parseFloat(d.settings.title.fontSize)||16}}},{settings:s,style:l})}(e,t)}(e,t,n&&n.navigationDisabled);return 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:bn(bn(bn({},"".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 Ei(e){var t=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.auto,n=function(e){var t=qn({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(ir(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=ir(!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=ir(!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 si(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=qn({},e);ir(a,or(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,ir(a,or(o)))):!1===t.autoFill&&t.single?a.range=[n.resolveUIColor(t.single)]:t.autoFill&&(s&&(a.palettes={categorical:s.key}),ir(a,or(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=qn(qn({},e),r.getDataColorSpecials())),n.settings=ir(e,fi(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(hi):Promise.reject()}(e,{layout:t.layout,model:t.model,app:t.app})});return n.getSnapshotData=mi,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=qn({},i),r={},!n.key)throw new Error("Missing key");t.set(qn(qn({},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=qn(qn({},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(En(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(En((n.explicit||{}).domain||[]),[-3,-2]),range:n.explicit&&"function"==typeof n.explicit.range?n.explicit.range:[].concat(En((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 d=0,f={};a.data("q")({data:t}).extract({field:n.field,trackBy:n.valueAccessor,reduce:function(e){var t=e[0];return f[t]=d++,e[0]}}),c={source:"attrDim",extract:{field:"qDimensionInfo/0",filter:function(e){return e.qElemNumber>=0},props:{row:{value:function(e){return f[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")]=qn(qn({},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]=ir({},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")]=ir({},h,{invert:!!r}))}else if("color"!==n.type)throw new Error("UNUSED FIELD")}else if("dimension"===n.mode){var y={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]=y}else if("measure"===n.mode){var g={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]=g}}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=yi(r),o=yi("".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 vi(e)||o(e)?u:l}:n[t]?function(e){return vi(e)?u:gi(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 vi(e)||o(e)?u:gi(e)?l:c}:"color"===p?function(e){return vi(e)||o(e)?u:gi(e)?l:i(e)||u}:null},s=a(t,r);if(t.measureOverrides){var l=yi("".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&&Ir(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=bn({},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,d=void 0===p?{}:p,f=e.style,m=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return wi({eventName:t,key:r,rtl:s,viewState:o,chart:a,styleReference:u,styleOverrides:c,settings:d,style:void 0===f?{}:f},{legendProps:n.legendProps,scaleKey:n.key,coloring:i(),theme:n.theme,hc:n.hc,scales:this.scales()},m)}};return o}var Ii=function(e){return e.baseColor||e.coloring&&e.coloring.baseColor};function Ai(e){var t=e.qHyperCube,n=t.qDimensionInfo,r=t.qMeasureInfo,i=n.some(Ii),o=r.some(Ii),a=e.color.useBaseColors;return"measure"===a&&!o||"dimension"===a&&!i?"off":a}var Mi=function(e){return e.baseColor||e.coloring&&e.coloring.baseColor};function ki(e){var t,n=e.qHyperCube.qDimensionInfo.some(Mi),r=e.qHyperCube.qMeasureInfo.some(Mi),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 Li=function(){};function Oi(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,d=void 0===p?Li:p,f=e.config,m=void 0===f?{}:f,h=e.custom,y=void 0===h?{}:h,g=m.localeInfo,v=m.key,b=m.theme,x=void 0===b?void 0:b,q=m.auto,D=void 0===q?void 0:q,S=m.definitionPath,C=null==c||null===(t=c.getLayout)||void 0===t?void 0:t.call(c),w={theme:x,key:v,localeInfo:g,layout:C,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:qn(qn({},null==c||null===(i=c.getLayoutValue)||void 0===i?void 0:i.call(c,"color")),{},{useBaseColors:C?Ai(C):void 0})},E=Ei({picasso:o,model:a,app:s,translator:l,auto:D});!1!==D&&E.auto(function(e){return D?D({layout:e,defaultAuto:ki}):ki(e)});var I=!1,A={getColor:function(){return E.color()},getPaletteColor:function(e){var t=e.index,n=e.color;return E.resolveUIColor({index:t,color:n})},getData:function(){return E.data()},getDatumProps:function(e){return E.datumProps(e)},getSnapshotData:function(){return E.getSnapshotData(S)},getSettingsForMeasure:function(e){return E.settingsForMeasure(e)},getSettings:function(){return E.settings()},getLegend:function(e,t){return E.legend(e,t)},getScales:function(){return E.scales()},getPalettes:function(){return E.palettes()},isSelectionLocked:function(e){var t=e.isMeasureSelectionLocked;return E.isSelectionLocked({isMeasureSelectionLocked:t})},isInitialized:function(){return I},custom:qn({},y),initialize:function(){var e=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}).createConfig,t=(void 0===e?d:e)({getUseBaseColors:Ai}),n=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return qn(qn(qn({},e),t),{},{colorProps:qn(qn({},e.colorProps),t.colorProps||{})})}(w,t);return E.config(n),E.getAuxiliarySettings(S).then(function(){I=!0})}};return A}var Ti="center",Ni="bottom",Pi=[{key:"NoDataExist",alignment:Ti,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:Ti,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:Ti,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:Ti},{key:"DataRangeIncludingZero",alignment:Ni},{key:"LimitedData",alignment:Ni},{key:"NegativeOrZeroValues",alignment:Ni}].reduce(function(e,t){return e[t.key]=t,e},{}),Fi=function(){return!1};function Ri(e){var t,n=e.layout,r=e.config,i=void 0===r?{}:r,o={disclaimer:void 0,isSuppressing:!1,showDisclaimer:null!==(t=i.args)&&void 0!==t&&t.layoutService?i.args.layoutService.getLayoutValue("showDisclaimer"):null==n?void 0:n.showDisclaimer};return{initialize:function(){var e=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}).args;o.disclaimer=function(e){var t=e.args,n=e.disclaimers,r=[];return Object.keys(n).forEach(function(e){var i=Pi[e],o=n[e];o&&(o.condition||(null==i?void 0:i.condition)||Fi)(t)&&r.push({key:(null==i?void 0:i.translationKey)||(null==i?void 0:i.key)||e,alignment:o.alignment||(null==i?void 0:i.alignment)||Ni})}),r.find(function(e){return e.alignment===Ti})||r[0]}({args:qn(qn({layout:n},i.args),e),disclaimers:i.disclaimers||{}}),o.isSuppressing=!(!o.disclaimer||o.disclaimer.alignment!==Ti)},getDisclaimer:function(){return o.isSuppressing?o.disclaimer:!1===o.showDisclaimer?void 0:o.disclaimer},getHasSuppressingDisclaimer:function(){return o.isSuppressing}}}function ji(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 Hi=["__proto__","constructor"];function Vi(e,t,n){if(void 0!==e&&void 0!==t){var r=t.split("."),i=r[r.length-1];if(!Hi.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 zi(){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={}}}}function _i(e){var t,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:50;return function(){for(var r=this,i=arguments.length,o=new Array(i),a=0;a<i;a++)o[a]=arguments[a];clearTimeout(t),t=setTimeout(function(){return e.apply(r,o)},n)}}function Bi(e){var t=e.originalArray,n=e.newArray,r=e.matchKey;return Array.isArray(t)&&t.length?(n.forEach(function(e){var n=-1;t.some(function(t,i){return t[r]&&t[r]===e[r]&&(n=i),n}),n>-1?t[n]=e:t.push(e)}),t):n}function $i(e,t,n){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t);if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Ui(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 Wi(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Ui(Object(n),!0).forEach(function(t){$i(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Ui(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}var Ki=Object.prototype.hasOwnProperty,Yi=Object.prototype.toString,Gi=Object.defineProperty,Ji=Object.getOwnPropertyDescriptor,Zi=function(e){return"function"==typeof Array.isArray?Array.isArray(e):"[object Array]"===Yi.call(e)},Xi=function(e){if(!e||"[object Object]"!==Yi.call(e))return!1;var t,n=Ki.call(e,"constructor"),r=e.constructor&&e.constructor.prototype&&Ki.call(e.constructor.prototype,"isPrototypeOf");if(e.constructor&&!n&&!r)return!1;for(t in e);return void 0===t||Ki.call(e,t)},Qi=function(e,t){Gi&&"__proto__"===t.name?Gi(e,t.name,{enumerable:!0,configurable:!0,value:t.newValue,writable:!0}):e[t.name]=t.newValue},eo=function(e,t){if("__proto__"===t){if(!Ki.call(e,t))return;if(Ji)return Ji(e,t).value}return e[t]},to=function e(){var t,n,r,i,o,a,s=arguments[0],l=1,u=arguments.length,c=!1;for("boolean"==typeof s&&(c=s,s=arguments[1]||{},l=2),(null==s||"object"!=typeof s&&"function"!=typeof s)&&(s={});l<u;++l)if(null!=(t=arguments[l]))for(n in t)r=eo(s,n),s!==(i=eo(t,n))&&(c&&i&&(Xi(i)||(o=Zi(i)))?(o?(o=!1,a=r&&Zi(r)?r:[]):a=r&&Xi(r)?r:{},Qi(s,{name:n,newValue:e(c,a,i)})):void 0!==i&&Qi(s,{name:n,newValue:i}));return s};function no(e,t,n,r){if(!e)return-1;const i=n.cache,o=e.origin?e.origin():null;o&&(e=o);let a=i.fields.indexOf(e),s=-1,l=-1;if(-1===a)for(let t=0;t<i.wrappedFields.length;t++)if(l=i.wrappedFields[t].attrDims.map(e=>e.instance).indexOf(e),s=i.wrappedFields[t].attrExps.map(e=>e.instance).indexOf(e),-1!==l||-1!==s){a=t;break}if(Array.isArray(r)&&r.some((e,t)=>e!==t)){const e=r.indexOf(a);-1!==e&&(a=e)}return a-=t.qArea.qLeft,a<0||a>=t.qArea.qWidth?-1:l>=0?e=>e[a].qAttrDims.qValues[l]:s>=0?e=>e[a].qAttrExps.qValues[s]:e=>e[a]}function ro(e,t,n){let{key:r}=n;const i={value:"function"==typeof e.value?e.value(t):void 0!==e.value?e.value:t};return i.label="function"==typeof e.label?e.label(t):void 0!==e.label?String(e.label):String(i.value),e.field&&(i.source={key:r,field:e.field.key()}),i}function io(e){let{cache:t,f:n,mainCell:r,p:i,page:o,rowIdx:a,row:s,sourceKey:l,target:u,targetProp:c,columnOrder:p}=e,d=r;if(i.field&&i.field!==n){const e=no(i.field,o,{cache:t},p);if(-1===e)return;d=to({qRow:a},e(s))}u[c]=ro(i,d,{key:l})}function oo(e,t,n,r){const i=Array.isArray(e)?e:[e];let o=[];for(let e=0;e<i.length;e++)if(void 0!==i[e].field){const a=t.raw(),s=t.key(),l="object"==typeof i[e].field?i[e].field:t.field(i[e].field),{props:u,main:c}=r.normalizeConfig(i[e],t),p=Object.keys(u),d=!!i[e].trackBy,f=typeof i[e].trackBy,m={},h=[],y=[];for(let t=0;t<a.qDataPages.length;t++){const o=no(l,a.qDataPages[t],{cache:n},a.qColumnOrder);if(-1!==o)for(let g=0;g<a.qDataPages[t].qMatrix.length;g++){const v=a.qDataPages[t].qArea.qTop+g,b=to({qRow:v},o(a.qDataPages[t].qMatrix[g])),x=ro(c,b,{key:s});if(!c.filter||c.filter(b)){for(let e=0;e<p.length;e++){const r=u[p[e]];let i=r.fields||[r];r.fields&&(x[p[e]]=[]);for(let o=0;o<i.length;o++)io({cache:n,f:l,mainCell:b,p:i[o],prop:p[e],page:a.qDataPages[t],rowIdx:v,row:a.qDataPages[t].qMatrix[g],sourceKey:s,target:r.fields?x[p[e]]:x,targetProp:r.fields?o:p[e],columnOrder:a.qColumnOrder});if(r.fields){const t=x[p[e]].map(e=>e.value),n=x[p[e]].map(e=>e.label);x[p[e]]={value:"function"==typeof r.value?r.value(t):void 0!==r.value?r.value:t,label:"function"==typeof r.label?r.label(n):void 0!==r.label?String(r.label):String(x[p[e]].value)}}}d&&r.track({cfg:i[e],itemData:b,obj:x,target:h,tracker:m,trackType:f}),y.push(x)}}}const g=d?r.collect(h,{main:c,propsArr:p,props:u}):y;o=[...o,...g]}return o}function ao(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 so(e,t){e instanceof Map?(e=[void 0,e],void 0===t&&(t=uo)):void 0===t&&(t=lo);for(var n,r,i,o,a,s=new fo(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 fo(i[o])),r.parent=n,r.depth=n.depth+1;return s.eachBefore(po)}function lo(e){return e.children}function uo(e){return Array.isArray(e)?e[1]:null}function co(e){void 0!==e.data.value&&(e.value=e.data.value),e.data=e.data.data}function po(e){var t=0;do{e.height=t}while((e=e.parent)&&e.height<++t)}function fo(e){this.data=e,this.depth=this.height=0,this.parent=null}function mo(e){return null==e?null:function(e){if("function"!=typeof e)throw new Error;return e}(e)}fo.prototype=so.prototype={constructor:fo,count:function(){return this.eachAfter(ao)},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 so(this).eachBefore(co)},[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)}};var ho={depth:-1},yo={},go={};function vo(e){return e.id}function bo(e){return e.parentId}function xo(e){let t=e.length;if(t<2)return"";for(;--t>1&&!qo(e,t););return e.slice(0,t)}function qo(e,t){if("/"===e[t]){let n=0;for(;t>0&&"\\"===e[--t];)++n;if(!(1&n))return!0}return!1}function Do(e,t){"/"===e.charAt(0)&&(e=e.substring(1));const n=e.split("/");let r,i=t;for(let e=0;e<n.length;e++){if("*"===n[e]&&Array.isArray(i)){const t=[];r=n.slice(e+1).join("/");for(let e=0;e<i.length;e++){let n=Do(r,i[e]);Array.isArray(n)?t.push(...n):t.push(n)}return t}if(!n[e]&&Array.isArray(i)){const t=new Array(i.length);r=n.slice(e+1).join("/");for(let e=0;e<i.length;e++)t[e]=Do(r,i[e]);return t}n[e]in i&&(i=i[n[e]])}return i}function So(e,t,n){let r=[];if(!e||!e.length)return r;if(t<=0){const t=n>=0?[e[n]]:e;r=[...r,...t]}else for(let i=0;i<e.length;i++)e[i].children&&e[i].children.length&&(r=[...r,...So(e[i].children,t-1,n)]);return r}function Co(e,t,n){if(e===t)return e=>e;if(e>t){const n=Math.max(0,Math.min(100,e-t));return e=>{let t=e;for(let e=0;e<n;++e)t=t.parent;return t}}if(t>e){const r=Math.max(0,Math.min(100,t-e));return e=>So(e.children,r-1,n)}return!1}const wo=/^qDimensionInfo(?:\/(\d+))?/,Eo=/^\/?qMeasureInfo\/(\d+)/,Io=/\/qAttrExprInfo\/(\d+)/,Ao=/\/qAttrDimInfo\/(\d+)/;function Mo(e){return(e.qColumnOrder&&e.qColumnOrder.length?e.qColumnOrder:e.qDimensionInfo.map((e,t)=>t)).filter(t=>t<e.qDimensionInfo.length)}function ko(e,t){let{cube:n}=t;if(!e)return-1;let r=e.origin&&e.origin()?e.origin().key():e.key(),i=!1,o=-1,a=-1,s=-1,l=-1,u=-1,c=-1,p=r;const d=n.qEffectiveInterColumnSortOrder,f=Mo(n);return wo.test(p)&&(i=!0,o=+wo.exec(p)[1],p=r.replace(wo,"")),Eo.test(p)&&("K"===n.qMode?u=+Eo.exec(p)[1]:d&&-1!==d.indexOf(-1)?(u=+Eo.exec(p)[1],c=0):c=+Eo.exec(p)[1],p=p.replace(Eo,"")),p&&(Ao.exec(p)?s=+Ao.exec(p)[1]:Io.exec(p)&&(a=+Io.exec(p)[1])),l=i?"S"===n.qMode?f[o]:d?d.indexOf(o):o:d&&-1!==d.indexOf(-1)?d.indexOf(-1):n.qDimensionInfo.length-("K"===n.qMode?0:1),{fieldDepth:l+1,pseudoMeasureIndex:u,measureIdx:c,attrDimIdx:s,attrIdx:a}}function Lo(e,t){let n,r,i=Co(e.fieldDepth,t.fieldDepth,t.pseudoMeasureIndex);return n=t.measureIdx>=0?e=>e.data.qValues[t.measureIdx]:e=>e.data,t.attrDimIdx>=0?r=e=>{var n;return null==e||null===(n=e.qAttrDims)||void 0===n?void 0:n.qValues[t.attrDimIdx]}:t.attrIdx>=0&&(r=e=>{var n;return null==e||null===(n=e.qAttrExps)||void 0===n?void 0:n.qValues[t.attrIdx]}),{nodeFn:i,attrFn:r,valueFn:n}}function Oo(e,t,n){let{key:r}=n;const i={value:"function"==typeof e.value?e.value(t):void 0!==e.value?e.value:t};return i.label="function"==typeof e.label?e.label(t):void 0!==e.label?String(e.label):String(i.value),e.field&&(i.source={key:r,field:e.field.key()}),i}function To(e){let{propsArr:t,props:n,item:r,itemData:i,ret:o,sourceKey:a}=e;for(let e=0;e<t.length;e++){const s=n[t[e]],l=s.fields||[s];let u,c;s.fields&&(u=[],c=[]);for(let n=0;n<l.length;n++){const p=l[n];let d,f,m,h,y,g;if("primitive"===p.type?(m=p.value,g=String(p.value)):("function"==typeof p.value&&(d=e=>p.value(e,r)),"function"==typeof p.label&&(f=e=>p.label(e,r)),p.accessor?(h=p.accessor(r),Array.isArray(h)?(y=h.map(p.valueAccessor),p.attrAccessor&&(y=y.map(p.attrAccessor)),d&&(m=y.map(d),d=null),f&&(g=y.map(f),f=null),m=p.reduce?p.reduce(m):m,g=p.reduceLabel?p.reduceLabel(g,m):String(m)):(m=p.attrAccessor?p.attrAccessor(p.valueAccessor(h)):p.valueAccessor(h),g=m)):(m=i,g=i)),s.fields){const e=d?d(m):m;u.push(e),c.push(f&&null!=g?f(g):null!=g?g:String(e))}else{const n=d?d(m):m;o[t[e]]={value:n,label:f?f(g):null!=g?g:String(n)},p.field&&(o[t[e]].source={field:p.field.key(),key:a})}}u&&(o[t[e]]={value:"function"==typeof s.value?s.value(u,r):u,label:"function"==typeof s.label?s.label(c,r):c})}}const No=(e,t,n)=>{const r="K"===e.qMode?"/qStackedDataPages/*/qData":"/qTreeDataPages/*",i="K"===e.qMode?"qSubNodes":"qNodes",o=Do(r,e);return o&&o[0]?(t.tree=so(o[0],n.children||(e=>e[i])),t.tree):null};function Po(e){const t=e.raw().qDataPages.length?e.raw().qDataPages[0].qMatrix:[],n=function(e){const t=e.raw().qColumnOrder,n=e.fields();return t&&t.length===n.length?t:n.map((e,t)=>t)}(e),r=e.fields(),i=e.fields().filter(e=>"dimension"===e.type()).map(e=>n.indexOf(r.indexOf(e))),o=e.fields().filter(e=>"measure"===e.type()).map(e=>n.indexOf(r.indexOf(e))),a={__root:{__id:"__root",qValues:[]}};for(let e=0;e<t.length;e++){const n=t[e];let r="__root",l=!1;for(let e=0;e<i.length;e++){var s;const t=n[i[e]],o="".concat(r,"__").concat(null!==(s=t.qElemNumber)&&void 0!==s?s:t.qElemNo);a[o]||(a[o]=Wi({__id:o,__parent:r,qValues:[]},t),l=!0),r=o}if(l)for(let e=0;e<o.length;e++){const t=n[o[e]];a[r].qValues.push(t)}}const l=Object.keys(a).map(e=>a[e]);return function(){var e,t=vo,n=bo;function r(r){var i,o,a,s,l,u,c,p,d=Array.from(r),f=t,m=n,h=new Map;if(null!=e){const t=d.map((t,n)=>function(e){let t=(e=`${e}`).length;return qo(e,t-1)&&!qo(e,t-2)&&(e=e.slice(0,-1)),"/"===e[0]?e:`/${e}`}(e(t,n,r))),n=t.map(xo),i=new Set(t).add("");for(const e of n)i.has(e)||(i.add(e),t.push(e),n.push(xo(e)),d.push(go));f=(e,n)=>t[n],m=(e,t)=>n[t]}for(a=0,i=d.length;a<i;++a)o=d[a],u=d[a]=new fo(o),null!=(c=f(o,a,r))&&(c+="")&&(p=u.id=c,h.set(p,h.has(p)?yo:u)),null!=(c=m(o,a,r))&&(c+="")&&(u.parent=c);for(a=0;a<i;++a)if(c=(u=d[a]).parent){if(!(l=h.get(c)))throw new Error("missing: "+c);if(l===yo)throw new Error("ambiguous: "+c);l.children?l.children.push(u):l.children=[u],u.parent=l}else{if(s)throw new Error("multiple roots");s=u}if(!s)throw new Error("no root");if(null!=e){for(;s.data===go&&1===s.children.length;)s=s.children[0],--i;for(let e=d.length-1;e>=0&&(u=d[e]).data===go;--e)u.data=null}if(s.parent=ho,s.eachBefore(function(e){e.depth=e.parent.depth+1,--i}).eachBefore(po),s.parent=null,i>0)throw new Error("cycle");return s}return r.id=function(e){return arguments.length?(t=mo(e),r):t},r.parentId=function(e){return arguments.length?(n=mo(e),r):n},r.path=function(t){return arguments.length?(e=mo(t),r):e},r}().id(e=>e.__id).parentId(e=>e.__parent)(l)}const Fo=e=>{let{propsArr:t,props:n,cube:r,cache:i,itemDepthObject:o,f:a}=e;for(let e=0;e<t.length;e++){const i=n[t[e]],s=i.fields?i.fields:[i];for(let e=0;e<s.length;e++){const t=s[e];if(t.field!==a){const e=Lo(o,ko(t.field,{cube:r}));t.accessor=e.nodeFn,t.valueAccessor=e.valueFn,t.attrAccessor=e.attrFn}}}};function Ro(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0,n=arguments.length>2?arguments[2]:void 0,r=arguments.length>3?arguments[3]:void 0;const i=t.raw(),o=t.key(),a="S"===i.qMode?Po(t):No(i,n,e);if(!a)return null;const s=a.height,l=[];for(let o=0;o<=s;o++){let a=null;if(o>0)if("S"===i.qMode){let e=Mo(i)[o-1];a=n.fields[e]}else{let e=i.qEffectiveInterColumnSortOrder[o-1];o>i.qEffectiveInterColumnSortOrder.length&&(e=i.qDimensionInfo.length),a=n.fields[e]}const{props:s,main:u}=r.normalizeConfig(Wi(Wi({},e),{},{field:a?a.key():void 0}),t),c=Object.keys(s);l[o]={propsArr:c,props:s,main:u};const p=a?ko(a,{cube:i}):{fieldDepth:0};Fo({propsArr:c,props:s,cube:i,cache:n,itemDepthObject:p,f:a})}const u=a.copy().descendants(),c=a.descendants();for(let e=0;e<c.length;e++){const t=l[c[e].depth].propsArr,n=l[c[e].depth].props,r=l[c[e].depth].main,i=u[e],a=i.data,s=Oo(r,a,{key:o});To({propsArr:t,props:n,item:i,itemData:a,ret:s,sourceKey:o}),c[e].data=s}return a}function jo(e,t,n,r){const i=Array.isArray(e)?e:[e];let o=[];for(let a=0;a<i.length;a++)if(void 0!==i[a].field){const s=t.raw(),l=t.key();if(!No(s,n,e))continue;const u="object"==typeof i[a].field?i[a].field:t.field(i[a].field),{props:c,main:p}=r.normalizeConfig(i[a],t),d=Object.keys(c),f=ko(u,{cube:s}),{nodeFn:m,attrFn:h,valueFn:y}=Lo({fieldDepth:0},f);Fo({propsArr:d,props:c,cube:s,cache:n,itemDepthObject:f,f:u});const g=!!i[a].trackBy,v=typeof i[a].trackBy,b={},x=[],q=m(n.tree),D=[];for(let e=0;e<q.length;e++){const t=q[e],n=h?h(y(t)):y(t);if(p.filter&&!p.filter(n))continue;const o=Oo(p,n,{key:l});To({propsArr:d,props:c,item:t,itemData:n,ret:o,sourceKey:l}),g&&r.track({cfg:i[a],itemData:n,obj:o,target:x,tracker:b,trackType:v}),D.push(o)}const S=g?r.collect(x,{main:p,propsArr:d,props:c}):D;o=[...o,...S]}return o}var Ho,Vo,zo=(Ho=function(e){
|
|
12
12
|
/*! javascript-number-formatter - v1.1.11 - http://mottie.github.com/javascript-number-formatter/ * © ecava */
|
|
13
|
-
e.exports=function(e,t){if(!e||isNaN(+t))return t;var n,r,i,o,a,s,l,u,c,p,d=e.length,f=e.search(/[0-9\-\+#]/),m=f>0?e.substring(0,f):"",h=e.split("").reverse().join(""),y=h.search(/[0-9\-\+#]/),g=d-y,v=e.substring(g,g+1),b=g+("."===v||","===v?1:0),x=y>0?e.substring(b,d):"";if(n=(t="-"===(e=e.substring(f,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="",g=(p=t[0]).length%l,d=p.length,b=0;b<d;b++)h+=p.charAt(b),!((b-g+1)%l)&&b<d-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}},Ho(Vo={exports:{}}),Vo.exports);function _o(e){return e.replace(/[-[\]/{}()*+?.\\^$|]/g,"\\$&")}const Bo={3:"k",6:"M",9:"G",12:"T",15:"P",18:"E",21:"Z",24:"Y","-3":"m","-6":"μ","-9":"n","-12":"p","-15":"f","-18":"a","-21":"z","-24":"y"},$o=/%\)?$/,Uo=/^\(r(0[2-9]|[12]\d|3[0-6])\)/i,Wo=/^\(oct\)/i,Ko=/^\(dec\)/i,Yo=/^\(hex\)/i,Go=/^\(bin\)/i,Jo=/^\(rom\)/i,Zo=/^(\(rom\)|\(bin\)|\(hex\)|\(dec\)|\(oct\)|\(r(0[2-9]|[12]\d|3[0-6])\))/i,Xo=/#|0/g;function Qo(e,t,n,r){return e=e.toString(t),n[1]===n[1].toUpperCase()&&(e=e.toUpperCase()),e.length-e.indexOf(".")>10&&(e=e.slice(0,e.indexOf(".")+11)),e.replace(".",r||".")}function ea(e,t,n){const r=_o(e);return n?r:new RegExp(r||"",t)}function ta(e,t,n,r){let i,o,a,s,l,u,c,p,d,f=e.pattern;var m,h;r&&(e.abbreviate=!0),m=t,(h=n)&&(h=_o(h)),m&&(m=_o(m)),d=new RegExp("(?:[#0]+".concat(m,")?[#0]+(?:").concat(h,"[#0]+)?")),a=f.match(d),a=a?a[0]:"",s=a?f.substr(0,f.indexOf(a)):f,l=a?f.substring(f.indexOf(a)+a.length):"",a||(a=f?"#":"##########"),t&&t===n&&(i=a.split(n),o=i.pop(),a=i.join("")+n+o,t=""),u=t,t=/,/.test(n)?"¤":",",u&&(a=a.replace(ea(u,"g"),t)),c=n,n=".",c&&(a=a.replace(ea(c,"g"),n)),p=a.match(/#/g),p=p?p.length:0;const y=f.split(c);let g;y[1]&&(g=y[1].match(Xo)),e.prefix=s||"",e.postfix=l||"",e.pattern=f,e.maxPrecision=g?g.length:2,e.percentage=$o.test(f),e.numericPattern=a||"",e.numericRegex=new RegExp("".concat(ea(t,null,!0),"|").concat(ea(n,null,!0)),"g"),e.groupTemp=u,e.decTemp=c,e.t=t,e.d=n,e.temp=p}class na{constructor(e,t,n,r,i){this.localeInfo=e,this.pattern=t,this.thousandDelimiter=n||",",this.decimalDelimiter=r||".",this.type=i||"numeric",this.patternSeparator=";",this.abbreviations=function(e,t){if(!e||!e.qNumericalAbbreviation)return Bo;const n={};return e.qNumericalAbbreviation.split(t).forEach(e=>{let t=e.split(":");2===t.length&&(n[t[0]]=t[1])}),n}(e,this.patternSeparator),this.prepare()}clone(){const e=new na(this.localeInfo,this.pattern,this.thousandDelimiter,this.decimalDelimiter,this.type);return e.subtype=this.subtype,e}format(e,t,n,r){return this.prepare(t,n,r),this.formatValue(e)}prepare(e,t,n){let r;if(void 0===e&&(e=this.pattern),void 0===t&&(t=this.thousandDelimiter),void 0===n&&(n=this.decimalDelimiter),!e)return void(this._prepared={pattern:!1});this._prepared={positive:{d:n,t:t,abbreviate:!1,isFunctional:!1,prefix:"",postfix:""},negative:{d:n,t:t,abbreviate:!1,isFunctional:!1,prefix:"",postfix:""},zero:{d:n,t:t,abbreviate:!1,isFunctional:!1,prefix:"",postfix:""}},r=this._prepared,e=e.split(this.patternSeparator),r.positive.pattern=e[0],r.negative.pattern=e[1],r.zero.pattern=e[2],Zo.test(e[0])&&(r.positive.isFunctional=!0),e[1]?Zo.test(e[1])&&(r.negative.isFunctional=!0):r.negative=!1,e[2]?Zo.test(e[2])&&(r.zero.isFunctional=!0):r.zero=!1;const i="U"===this.type;r.positive.isFunctional||ta(r.positive,t,n,i),r.negative&&!r.negative.isFunctional&&ta(r.negative,t,n,i),r.zero&&!r.zero.isFunctional&&ta(r.zero,t,n,i)}formatValue(e){let t,n,r,i,o,a,s,l,u,c=this._prepared,p="",d="",f=e;if(isNaN(e))return"".concat(f);if(e=+e,!1===c.pattern)return e.toString();if(0===e&&c.zero)return c=c.zero,c.pattern;if(e<0&&c.negative?(c=c.negative,e=-e):c=c.positive,o=c.d,a=c.t,c.isFunctional)e=function(e,t,n){let r;return Uo.test(t)?e=Qo(e,Number(/\d{2}/.exec(t)[0]),t,n):Wo.test(t)?e=Qo(e,8,t,n):Ko.test(t)?e=Qo(e,10,t,n):Yo.test(t)?e=Qo(e,16,t,n):Go.test(t)?e=Qo(e,2,t,n):Jo.test(t)&&(r="",e<0&&(r="-",e=-e),0===(e=Math.floor(e))?e="0":e<=5e5?(e=function(e,t){let n,r="",i=Number(String(e).slice(-3)),o=(e-i)/1e3,a=[0,1,4,5,9,10,40,50,90,100,400,500,900].reverse(),s=["0","I","IV","V","IX","X","XL","L","XC","C","CD","D","CM"].reverse();for(;i>0;)for(n=0;n<a.length;n++)if(a[n]<=i){r+=s[n],i-=a[n];break}for(n=0;n<o;n++)r="M".concat(r);return t[1]!==t[1].toUpperCase()&&(r=r.toLowerCase()),r}(e,t),e=r+e):e=t+r+e.toExponential(0)),e}(e,c.pattern,o);else{if(c.percentage&&(e*=100),c.abbreviate){const t=Object.keys(this.abbreviations).map(e=>parseInt(e,10)).sort((e,t)=>e-t);let r,i,o=t[0];for(s=0,n=Number(Number(e).toExponential().split("e")[1]);o<=n&&s<t.length;)s++,o=t[s];s>0&&(r=t[s-1]),r&&n>0&&r>0?i=r:(n<0&&r<0||!r)&&(o<0&&o-n<=c.maxPrecision?i=o:r<=n&&!(o>0&&-n<=c.maxPrecision)&&(i=r)),i&&(p=this.abbreviations[i],e/=10**i)}if(r=Math.abs(e),t=c.temp,l=c.numericPattern,u=l.split(o)[1],"I"===this.type&&(e=Math.round(e)),i=e,u||"#"!==l.slice(-1)[0])if(r>=1e15||r>0&&r<=1e-14)e=r?r.toExponential(15).replace(/\.?0+(?=e)/,""):"0";else{const t=Number((e+1e-15*(e<0?-1:1)).toFixed(Math.min(20,u?u.length:0)).split(".")[0]);let n=l.split(o)[0];if(n+=o,e=zo(n,t)||"0",u){const t=Math.max(0,Math.min(14,u.length)),n=u.replace(/#+$/,"").length;let i=("I"===this.type?0:r%1+1e-15).toFixed(t).slice(2).replace(/0+$/,"");for(s=i.length;s<n;s++)i+="0";i&&(e+=o+i)}else 0===t&&(i=0)}else if(r>=10**t||r<1||r<1e-4)0===e?e="0":r<1e-4||r>=1e20?(e=(e=i.toExponential(Math.max(1,Math.min(14,t))-1)).replace(/\.?0+(?=e)/,""),d=""):(e=e.toPrecision(Math.max(1,Math.min(14,t)))).indexOf(".")>=0&&(e=(e=e.replace(e.indexOf("e")<0?/0+$/:/\.?0+(?=e)/,"")).replace(".",o));else{for(l+=o,t=Math.max(0,Math.min(20,t-Math.ceil(Math.log(r)/Math.log(10)))),s=0;s<t;s++)l+="#";e=zo(l,e)}e=e.replace(c.numericRegex,e=>e===a?c.groupTemp:e===o?c.decTemp:""),i<0&&!/^-/.test(e)&&(e="-".concat(e))}return c.prefix+e+d+p+c.postfix}static getStaticFormatter(){return{prepare(){},formatValue:e=>"".concat(e)}}}function ra(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const{size:n=5e3,multipleArguments:r=!1,toKey:i=e=>e}=t;let o,a,s=Object.create(null),l=Object.create(null),u=0,c=0;return o=r?function(){return a=i(...arguments),o.has(a)?o.get(a):o.set(a,e(...arguments))}:t=>(a=i(t),o.has(a)?o.get(a):o.set(a,e(t))),o.set=(e,t)=>(u>=n&&(delete s[l[c]],delete l[c],u--,c++),s[e]=t,l[u]=e,u++,t),o.get=e=>s[e],o.has=e=>e in s,o.clear=()=>{s=Object.create(null),l=Object.create(null),u=0,c=0},o.size=()=>u,o}function ia(e,t,n,r,i){const o=function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return new na(...t)}(i,e,t,n,r),a=ra(o.formatValue.bind(o),{toKey:e=>isNaN(e)?e:+e});function s(e){return a(e)}return s.format=function(e,t,n,r){return a.clear(),o.format(t,e,n,r)},s.pattern=function(e){return e&&(a.clear(),o.pattern=e,o.prepare()),o.pattern},s}const oa="D",aa="T",sa="TS",la=["Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"],ua=["Mon","Tue","Wed","Thu","Fri","Sat","Sun"],ca=["January","February","March","April","May","June","July","August","September","October","November","December"],pa=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function da(e,t){for(let n=e.length;n<t;n++)e="0".concat(e);return e}function fa(e){let t=e.toString().split(".");return t[1]?(t=Number("0.".concat(t[1])),t):0}class ma{constructor(e,t,n){const r=e||{};r.qCalendarStrings||(r.qCalendarStrings={qLongDayNames:la,qDayNames:ua,qLongMonthNames:ca,qMonthNames:pa}),this.localeInfo=r,this.locale_days=r.qCalendarStrings.qLongDayNames.slice(),this.locale_days_abbr=r.qCalendarStrings.qDayNames.slice(),this.locale_months=r.qCalendarStrings.qLongMonthNames.slice(),this.locale_months_abbr=r.qCalendarStrings.qMonthNames.slice(),t||(t={[aa]:r.qTimeFmt||"hh:mm:ss",[oa]:r.qDateFmt||"YYYY-MM-DD",[sa]:r.qTimestampFmt||"YYYY-MM-DD hh:mm:ss"}[n]),this.pattern=t}clone(){const e=new ma(this.localeInfo,this.pattern);return e.subtype=this.subtype,e}format(e,t){t||(t=this.pattern?this.pattern:"YYYY-MM-DD hh:mm:ss"),t=t.replace(/\[.+]|\[|]/g,"");const n=/t+/gi.test(t);let r;e instanceof Date?r=function(e,t){let n=e.getUTCHours(),r=e.getUTCDay()-1;return t&&(n%=12,n||(n=12)),r<0&&(r=6),{year:e.getUTCFullYear(),month:e.getUTCMonth(),day:r,date:e.getUTCDate(),h:n,m:e.getUTCMinutes(),s:e.getUTCSeconds(),f:e.getUTCMilliseconds(),t:e.getUTCHours()>=12?"pm":"am"}}(e,n):(e<0&&(e=-e,t="-".concat(t)),r=function(e,t){let n,r=function(e){const t=e,n=24*fa(t),r=60*fa(n),i=60*fa(r),o=1e3*fa(i);return{d:Math.floor(t),h:Math.floor(n),m:Math.floor(r),s:Math.floor(i),f:Math.round(o)}}(e),i=r.d,o=r.h,a=r.m,s=r.s,l=r.f,u=0;/w+|t+/gi.test(t)&&(n=new Date(Date.UTC(1899,11,30+Math.floor(e),0,0,Math.round(86400*(e-Math.floor(e))))),isNaN(n.getTime())&&(n=null)),/D+/gi.test(t)||(o+=24*i),/h+/gi.test(t)||(a+=60*o),/m+/gi.test(t)||(s+=60*a),/w+/gi.test(t)&&(u=n?n.getDay()-1:0,u<0&&(u=6));let c="";return n&&(c=n.getUTCHours()>=12?"pm":"am"),{year:0,month:0,day:u,date:i,h:o,m:a,s:s,f:l,t:c}}(e,t));const i=(o=this,a=r,{"Y+|y+":{Y:"".concat(Number("".concat(a.year).slice(-2))),YY:da("".concat(a.year).slice(-2),2),YYY:da("".concat(a.year).slice(-3),3),def:e=>da("".concat(a.year),e.length)},"M+":{M:a.month+1,MM:da("".concat(a.month+1),2),MMM:o.locale_months_abbr[a.month],def:o.locale_months[a.month]},"W+|w+":{W:a.day,WW:da("".concat(a.day),2),WWW:o.locale_days_abbr[a.day],def:o.locale_days[a.day]},"D+|d+":{D:a.date,def:e=>da("".concat(a.date),e.length)},"h+|H+":{h:a.h,def:e=>da("".concat(a.h),e.length)},"m+":{m:a.m,def:e=>da("".concat(a.m),e.length)},"s+|S+":{s:a.s,def:e=>da("".concat(a.s),e.length)},"f+|F+":{def(e){let t="".concat(a.f),n=e.length-t.length;if(n>0)for(let e=0;e<n;e++)t+="0";else n<0&&(t=t.slice(0,e.length));return t}},"t{1,2}|T{1,2}":{def(e){let t=a.t;return e[0].toUpperCase()===e[0]&&(t=t.toUpperCase()),t=t.slice(0,e.length),t}}});var o,a;const s=[];for(const e in i)Object.prototype.hasOwnProperty.call(i,e)&&s.push(e);const l=new RegExp(s.join("|"),"g");return t.replace(l,e=>{let t,n,r;for(n in i)if(Object.prototype.hasOwnProperty.call(i,n)&&(t=new RegExp(n),t.test(e)))break;if(!t)return"";for(const t in i[n])if(t===e||t.toLowerCase()===e){r=i[n][t],void 0===r&&(r=i[n][t.toLowerCase()]);break}return void 0===r&&(r=i[n].def),"function"==typeof r&&(r=r(e)),r})}}function ha(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return new ma(...t)}function ya(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"TS",n=ha(arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,e,t),r=ra(n.format.bind(n),{toKey:e=>"object"==typeof e&&"function"==typeof e.getTime?e.getTime():e});function i(e){return"IV"!==t?function(e){return new Date(Date.UTC(1899,11,30+Math.floor(e),0,0,0,Math.round(864e5*(e-Math.floor(e)))))}(e):e}function o(e){return e=i(e),r(e)}return o.format=function(e,t){return r.clear(),t=i(t),n.format(t,e)},o.locale=function(i){return n=ha(i,e,t),r=ra(n.format.bind(n),{toKey:e=>"object"==typeof e?e.getTime():e}),this},o.qtype=function(e){return void 0!==e&&(t=e,r.clear()),t},o}function ga(){let e,{meta:t,id:n,key:r,localeInfo:i,fieldExtractor:o,value:a,type:s,sourceField:l}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const u=a||("dimension"===s?e=>null==e?void 0:e.qElemNo:e=>null==e?void 0:e.qValue),c="dimension"===s?"first":"avg",p=function(e,t){if(e&&e.qNumFormat&&-1!==["D","T","TS","IV"].indexOf(e.qNumFormat.qType))return ya(e.qNumFormat.qFmt,e.qNumFormat.qType,t);let n="#",r=t&&void 0!==t.qThousandSep?t.qThousandSep:",",i=t&&void 0!==t.qDecimalSep?t.qDecimalSep:".",o="U",a=e&&!!e.qIsAutoFormat;return e&&e.qNumFormat?(n=e.qNumFormat.qFmt||n,r=e.qNumFormat.qThou||r,i=e.qNumFormat.qDec||i,o=e.qNumFormat.qType||o,a=a&&-1===["M"].indexOf(e.qNumFormat.qType)):a=!0,(a||"U"===o)&&(n="#".concat(i,"##"),o="U"),ia(n,r,i,o,t)}(t,i),d="dimension"===s?"first":(e,t)=>p(t),f={id:()=>n,key:()=>r,raw:()=>t,title:()=>t.qFallbackTitle||t.label,type:()=>s,origin:()=>l,items:()=>(e||(e=o(f)),e),min:()=>t.qMin,max:()=>t.qMax,value:u,label:e=>(null==e?void 0:e.qText)||"",reduce:c,reduceLabel:d,formatter:()=>p,tags:()=>t.qTags};return f}function va(e,t,n,r,i){return(t[e]||[]).map((t,o)=>{const a="".concat(r?"".concat(r,"/"):"").concat(e,"/").concat(o),s={instance:ga(to({id:"".concat(n?"".concat(n,"/"):"").concat(a),key:a,meta:t},i))};return s.attrDims=va("qAttrDimInfo",t,n,a,to({},i,{value:e=>null==e?void 0:e.qElemNo,type:"dimension"})),s.attrExps=va("qAttrExprInfo",t,n,a,to({},i,{value:e=>null==e?void 0:e.qNum,type:"measure"})),s.measures=va("qMeasureInfo",t,n,a,to({},i,{value:e=>null==e?void 0:e.qValue,type:"measure"})),s})}function ba(){let{key:e,data:t,config:n={}}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const r={fields:[],wrappedFields:[],allFields:[],virtualFields:[]},i=t;if(!i)throw new Error('Missing "data" input');if(!i.qDimensionInfo)throw new Error('The "data" input is not recognized as a hypercube');const o=ba.util,a={cache:r,cube:i,localeInfo:n.localeInfo,fieldExtractor:null,pages:null,hierarchy:()=>null,virtualFields:n.virtualFields},s={key:()=>e,raw:()=>i,field:e=>function(e,t){let{cache:n}=t;if("number"==typeof e)return n.fields[e];const r=n.allFields;if("function"==typeof e){for(let t=0;t<r.length;t++)if(e(r[t]))return r[t];return!1}if("string"==typeof e){for(let t=0;t<r.length;t++)if(r[t].key()===e||r[t].title()===e)return r[t]}else if(e&&-1!==r.indexOf(e))return e;throw Error("Field not found: ".concat(e))}(e,a),fields:()=>r.fields.slice(),extract:e=>a.extractor(e,s,r,o),hierarchy:e=>a.hierarchy(e,s,r,o),_cache:()=>r};"K"===i.qMode||"T"===i.qMode||!i.qMode&&i.qNodesOnDim?(a.extractor=jo,a.hierarchy=Ro,a.pages="K"===i.qMode?i.qStackedDataPages:i.qTreeDataPages):"S"===i.qMode?(a.extractor=oo,a.pages=i.qDataPages,a.hierarchy=Ro):a.extractor=()=>[],a.fieldExtractor=e=>a.extractor({field:e},s,r,o);const l="S"===i.qMode?e=>e.qElemNumber:void 0,u="S"===i.qMode?e=>e.qNum:void 0;r.wrappedFields.push(...va("qDimensionInfo",i,e,"",to({},a,{value:l,type:"dimension"}))),r.wrappedFields.push(...va("qMeasureInfo",i,e,"",to({},a,{value:u,type:"measure"}))),r.fields=r.wrappedFields.map(e=>e.instance);const c=e=>{e.forEach(e=>{r.allFields.push(e.instance),c(e.measures),c(e.attrDims),c(e.attrExps)})};return c(r.wrappedFields),(n.virtualFields||[]).forEach(t=>{const n=s.field(t.from),i=ga(Wi({meta:n.raw(),id:"".concat(e,"/").concat(t.key),sourceField:n,fieldExtractor:e=>a.extractor({field:e},s,r,o),key:t.key,type:n.type(),localeInfo:a.localeInfo,value:n.value},t.override||{}));r.virtualFields.push(i)}),r.allFields.push(...r.virtualFields),s}const xa=[["qHyperCube","qHyperCubeDef"],["qTreeData","qTreeDataDef"],["qDimensionInfo","qDimensions"],["qMeasureInfo","qMeasures"],["qAttrDimInfo","qAttributeDimensions"],["qAttrExprInfo","qAttributeExpressions"]],qa=/\/qDimensionInfo(?:\/(\d+))?/,Da=/\/qMeasureInfo\/(\d+)/,Sa=/\/qAttrDimInfo\/(\d+)(?:\/(\d+))?/,Ca=/\/qAttrExprInfo\/(\d+)/,wa=/\/?qHyperCube/,Ea=/\/?qTreeData/,Ia=e=>"".concat(e.substr(0,e.indexOf("/qHyperCubeDef")+14)),Aa=e=>"".concat(e.substr(0,e.indexOf("/qTreeDataDef")+13));function Ma(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2?arguments[2]:void 0;const r=t.byCells,i=t.primarySource,o=[],a={},s=e.isActive();let l=!1;return e.brushes().forEach(e=>{const t=function(e,t){let n=e,r=-1,i=-1,o="",a=e=>e;wa.test(e)?(o="".concat(n.substr(0,n.indexOf("qHyperCube")+10)),a=Ia):Ea.test(e)&&(o="".concat(n.substr(0,n.indexOf("qTreeData")+9)),a=Aa);let s=!0;if(qa.test(e)&&(r=+qa.exec(e)[1]),Da.test(e)&&(i=+Da.exec(e)[1]),Sa.test(e)){i=-1,r=0;const e=+Sa.exec(n)[2];isNaN(e)||(r=e,n=n.replace(/\/\d+$/,"")),s=!1}if(Ca.test(e)){const e=i;if(t){i=0;const a=Do(o,t);i+=(a.qMeasureInfo||[]).length,r>-1?(i=a.qDimensionInfo.slice(0,r).reduce((e,t)=>e+t.qAttrExprInfo.length,i),r=-1):(i=a.qDimensionInfo.reduce((e,t)=>e+t.qAttrExprInfo.length,i),i=a.qMeasureInfo.slice(0,e).reduce((e,t)=>e+t.qAttrExprInfo.length,i)),i+=+Ca.exec(n)[1]}else r>-1?(r=-1,i=+Ca.exec(n)[1]):i+=+Ca.exec(n)[1]+1}return xa.forEach(e=>{let[t,r]=e;n=n.replace(t,r)}),s&&(n=a(n)),n&&"/"!==n[0]&&(n="/".concat(n)),{measureIdx:i,dimensionIdx:r,path:n}}(e.id,n);if("range"===e.type&&t.measureIdx>-1&&t.dimensionIdx>-1){const n=e.brush.ranges();n.length&&(l=!0,a.multiRangeSelectTreeDataValues||(a.multiRangeSelectTreeDataValues={path:t.path,ranges:[]}),n.forEach(e=>a.multiRangeSelectTreeDataValues.ranges.push({qMeasureIx:t.measureIdx,qDimensionIx:t.dimensionIdx,qRange:{qMin:e.min,qMax:e.max,qMinInclEq:!0,qMaxInclEq:!0}})))}else{if("range"===e.type&&t.measureIdx>-1){const n=e.brush.ranges();n.length&&(l=!0,a.rangeSelectHyperCubeValues||(a.rangeSelectHyperCubeValues={path:t.path,ranges:[]}),n.forEach(e=>a.rangeSelectHyperCubeValues.ranges.push({qMeasureIx:t.measureIdx,qRange:{qMin:e.min,qMax:e.max,qMinInclEq:!0,qMaxInclEq:!0}})))}if("range"===e.type&&t.dimensionIdx>-1){const n=e.brush.ranges();n.length&&(l=!0,a.selectHyperCubeContinuousRange||(a.selectHyperCubeContinuousRange={path:t.path,ranges:[]}),n.forEach(e=>a.selectHyperCubeContinuousRange.ranges.push({qDimIx:t.dimensionIdx,qRange:{qMin:e.min,qMax:e.max,qMinInclEq:!0,qMaxInclEq:!1}})))}if("value"===e.type&&t.dimensionIdx>-1)if(r)if(n&&n.qHyperCube&&("P"===n.qHyperCube.qMode||"T"===n.qHyperCube.qMode||"K"===n.qHyperCube.qMode)){const r=n.qHyperCube,o=r.qNoOfLeftDims,s=r.qEffectiveInterColumnSortOrder.indexOf(t.dimensionIdx);if(a.selectPivotCells||(a.selectPivotCells={path:t.path,cells:[]}),e.id===i||!i){const n=e.brush.values().map(e=>+e).filter(e=>!isNaN(e));(0===o||s>=o)&&o>-1?n.forEach(e=>{a.selectPivotCells.cells.push({qType:"T",qCol:e,qRow:s-o})}):n.forEach(e=>{a.selectPivotCells.cells.push({qType:"L",qCol:t.dimensionIdx,qRow:e})}),l=!!a.selectPivotCells.cells.length}}else a.selectHyperCubeCells||(a.selectHyperCubeCells={path:t.path,cols:[]}),a.selectHyperCubeCells.cols.push(t.dimensionIdx),e.id!==i&&(i||a.selectHyperCubeCells.values)||(a.selectHyperCubeCells.values=e.brush.values().map(e=>+e).filter(e=>!isNaN(e)),l=!!a.selectHyperCubeCells.values.length);else{const n=e.brush.values().map(e=>+e).filter(e=>!isNaN(e));l=!!n.length,o.push({params:[t.path,t.dimensionIdx,n,!1],method:"selectHyperCubeValues"})}}}),!l&&s?[{method:"resetMadeSelections",params:[]}]:(a.rangeSelectHyperCubeValues&&o.push({method:"rangeSelectHyperCubeValues",params:[a.rangeSelectHyperCubeValues.path,a.rangeSelectHyperCubeValues.ranges,[],null===(u=t.orMode)||void 0===u||u]}),a.selectHyperCubeContinuousRange&&o.push({method:"selectHyperCubeContinuousRange",params:[a.selectHyperCubeContinuousRange.path,a.selectHyperCubeContinuousRange.ranges]}),a.selectHyperCubeCells&&o.push({method:"selectHyperCubeCells",params:[a.selectHyperCubeCells.path,a.selectHyperCubeCells.values,a.selectHyperCubeCells.cols]}),a.selectPivotCells&&o.push({method:"selectPivotCells",params:[a.selectPivotCells.path,a.selectPivotCells.cells]}),a.multiRangeSelectTreeDataValues&&o.push({method:"multiRangeSelectTreeDataValues",params:[a.multiRangeSelectTreeDataValues.path,a.multiRangeSelectTreeDataValues.ranges]}),o);var u}function ka(e){ba.util=e.data("matrix").util,e.data("q",ba),e.formatter("q-number",ia),e.formatter("q-time",ya)}function La(e){var t=ji(e.layout||{},e.path.split("/").join("."));if(!t)return!1;var n=t.qIsOneAndOnlyOne;return void 0!==n&&n}function Oa(e){var t=e.brush,n=e.colorField,r=e.legendAlias,i=e.useLegendCube,o=void 0!==i&&i;!n||/qAttrDimInfo/.test(n)?(t.removeKeyAlias("attrDim/qDimensionInfo/0"),r&&t.removeKeyAlias(r),t.addKeyAlias("attrDim/qDimensionInfo/0","qHyperCube/".concat(n))):o&&t.addKeyAlias(r,"qHyperCube/".concat(n))}ka.qBrushHelper=Ma,ka.selections=Ma;var Ta="Shift";var Na=function(e,t){return t[e]?Na(e+1,t):e},Pa=function(e,t){var n=t.reduce(function(e,t){return e[t]=!0,e},{});return e.reduce(function(e,t,r){var i=Na(r,n);return n[i]=!0,e[r]=i,e},{})};function Fa(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.layout,n=e.filtered,r=void 0===n?{}:n,i=(null==t?void 0:t.qHyperCube)||{},o=i.qDimensionInfo,a=void 0===o?[]:o,s=i.qMeasureInfo,l=void 0===s?[]:s;return{dimensions:Pa(a,r.dimensions||[]),measures:Pa(l,r.measures||[])}}function Ra(e){var t=e.selection,n=e.fieldMap,r=t.method,i=t.params;if("selectHyperCubeValues"===r){var o=n.dimensions[i[1]];void 0!==o&&(i[1]=o)}return"selectHyperCubeContinuousRange"===r&&i[1].forEach(function(e){var t=n.dimensions[e.qDimIx];void 0!==t&&(e.qDimIx=t)}),t}var ja=[],Ha=0,Va=function(e){var t=ja.filter(function(e){var t;return null===(t=e.selections)||void 0===t?void 0:t.isActive()});t.length&&("Enter"===e.key?t.forEach(function(e){return e.selections.confirm()}):"Escape"!==e.key&&"Esc"!==e.key||t.forEach(function(e){return e.selections.cancel()}))};function za(e){var t=e.chart,n=e.document,r=e.selectionInfo,i=e.eventName,o=e.componentName,a=e.brushName,s=void 0===a?"selection":a,l=e.emit,u=void 0===l?"rangeClear":l,c=r.event===i,p=n.querySelector("[data-key='".concat(o,"-edge-0']"));if(c||!p)return!1;var d=t.component(o);return!!d&&(d.emit(u),"string"==typeof s&&t.brush(s).clear(),d)}var _a=["chart","document","selections","selectionInfo"],Ba=function(e){e.chart,e.document,e.selections,e.selectionInfo;var t=Dn(e,_a);t.clearDiscrete(),t.clearContinuous(),t.clearMinor(),t.clearRange(),t.clearTap(),t.clearLegend()};function $a(e){var t,n=e.lasso;null!=n&&null!==(t=n.active)&&void 0!==t&&t.call(n)&&(null==n||n.action(!1))}function Ua(e){var t,n=e.chart,r=e.selectionInfo,i=e.selectionActions,o=e.actions,a=void 0===o?{}:o,s=e.selections,l=e.selectionEvents;if(!1===i||!1===l)return function(){};var u=i.reset,c=void 0===u?$a:u,p=i.clear,d=!1!==p&&function(e){var t=e.clear,n=void 0===t?Ba:t,r=e.selections,i=e.selectionInfo,o=e.chart;return function(){var e=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}).cleared,t={selections:r,selectionInfo:i,chart:o,document:document,cleared:e};return n(qn({clearDiscrete:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return function(e){var t=e.selectionInfo,n=e.chart,r=e.document,i=e.eventName,o=void 0===i?"discreteRange":i,a=e.componentName,s=void 0===a?"discrete-range-brush":a,l=e.cleared;return za({selectionInfo:t,chart:n,document:r,eventName:void 0!==l&&l?void 0:o,componentName:s,emit:"areaClear",brushName:e.brushName})}(qn(qn({},t),e))},clearContinuous:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return function(e){var t=e.selectionInfo,n=e.chart,r=e.document,i=e.eventName,o=void 0===i?"continuousRange":i,a=e.componentName,s=void 0===a?"continuous-range-brush":a,l=e.cleared;return za({selectionInfo:t,chart:n,document:r,eventName:void 0!==l&&l?void 0:o,componentName:s,brushName:e.brushName})}(qn(qn({},t),e))},clearMinor:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return function(e){var t=e.selectionInfo,n=e.chart,r=e.document,i=e.componentName,o=void 0===i?"minor-range-brush":i,a=e.eventName,s=void 0===a?"minorRange":a,l=e.cleared,u=void 0!==l&&l,c=e.brushName,p=za({selectionInfo:t,chart:n,document:r,eventName:u?void 0:s,componentName:o,brushName:void 0!==c&&c});if(p){var d=p.settings.settings,f=d.scale,m=d.brush,h=n.scale(f).data().fields.map(function(e){return e.id()}),y=n.brush(m),g=y.brushes().filter(function(e){return"range"===e.type&&h.some(function(t){return t===e.id})});y&&g.length&&g.forEach(function(e){y.removeRanges(e.brush.ranges().map(function(t){return{key:e.id,range:t}}))})}}(qn(qn({},t),e))},clearRange:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return function(e){var t=e.selectionInfo,n=e.chart,r=e.document,i=e.selections,o=e.eventName,a=void 0===o?"xAxis":o,s=e.cleared;za({selectionInfo:t,chart:n,document:r,eventName:void 0!==s&&s?void 0:a,componentName:"".concat(a,"-range-brush"),emit:"areaClear",brushName:!1})&&i.clear()}(qn(qn({},t),e))},clearTap:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return function(e){var t=e.chart,n=e.selectionInfo,r=e.selections,i=e.events,o=void 0===i?["tap"]:i,a=e.brushNames,s=void 0===a?[]:a;if(n&&o.includes(n.event)){var l=n.currentComponent;n.previousComponent!==l&&(r.clear(),s.forEach(function(e){return t.brush(e).end()}))}}(qn(qn({},t),e))},clearLegend:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return function(e){var t=e.selectionInfo,n=e.chart,r=e.document,i=e.selections,o=e.eventName,a=void 0===o?"legendRange":o,s=e.componentName,l=void 0===s?"legend-range-brush":s,u=e.cleared,c=void 0!==u&&u,p=e.brushName;za({selectionInfo:t,chart:n,document:r,eventName:c?void 0:a,componentName:l,brushName:void 0!==p&&p})&&i.clear()}(qn(qn({},t),e))}},t))}}({clear:p,selections:s,selectionInfo:r,chart:n}),f=function(e){var t=e.chart,n=e.actions,r=e.reset,i=e.clear,o=!1,a={deactivated:function(e){var t=(n||{}).lasso;r({e:e,lasso:void 0!==t&&t})},canceled:function(e){var o=(n||{}).lasso;r({e:e,lasso:void 0!==o&&o}),i({e:e,chart:t,document:document})},cleared:function(e){o||(o=!0,i({e:e,chart:t,document:document,cleared:!0}),o=!1)}};return!1===r&&delete a.deactivated,!1===i&&delete a.cleared,!1===r&&!1===i&&delete a.canceled,a}({chart:n,clear:d,reset:c,actions:a}),m={};Object.entries(f).forEach(function(e){var t=wn(e,2),n=t[0],r=t[1];m[n]=function(e,t){return t?function(n){return t({event:n,defaultFunc:e})}:e}(r,l[n])});var h=function(e){var t=e.selectionEvents,n=e.selections,r=e.selectionInfo,i=e.clear,o=e.chart,a=e.document,s=t.start,l={selections:n,selectionInfo:r,chart:o,document:a},u=function(e){return Object.assign(r,e||{})},c=function(e){var t=e.event,n=e.components;return function(){return function(e){var t=e.selectionInfo,n=e.clear,r=e.event,i=e.components,o=void 0===i?[]:i;(0,e.setSelectionInfo)(qn(qn({},void 0===t?{}:t),{},{event:r,components:o.map(function(e){return e.key}).filter(Boolean)})),n()}({event:t,components:n,clear:i,selectionInfo:r,setSelectionInfo:u})}};return"function"==typeof s?function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];s(qn(qn({defaultFunc:c({event:e,components:t}),setSelectionInfo:u,clear:i},l),{},{event:e,components:t}))}:function(e){c({event:e,components:arguments.length>1&&void 0!==arguments[1]?arguments[1]:[]})()}}({selectionEvents:l,selections:s,selectionInfo:r,clear:d,chart:n,document:document});return null==a||null===(t=a.select)||void 0===t||t.on("start",h),Object.entries(m).forEach(function(e){var t=wn(e,2),n=t[0],r=t[1];null==s||s.on(n,r)}),function(){var e;null==a||null===(e=a.select)||void 0===e||e.removeListener("start",h),Object.entries(m).forEach(function(e){var t=wn(e,2),n=t[0],r=t[1];null==s||s.removeListener(n,r)})}}var Wa=[{key:"qHyperCube/qDimensionInfo/0:numeric",includeMax:!1}];function Ka(e){var t=e.chart,n=e.actions,r=e.selections,i=e.picassoQ,o=e.config,a=o.allowSimultaneous,s=void 0!==a&&a,l=o.majorScale,u=void 0===l?void 0:l,c=o.selectionActions,p=void 0===c?{}:c,d=p.clear,f=p.reset,m=o.selectionEvents,h=void 0===m?{deactivated:void 0,canceled:void 0,cleared:void 0,start:void 0}:m,y=o.brushEvents,g=void 0===y?{}:y,v=o.brushName,b=void 0===v?"selection":v,x=o.brushMaxListeners,q=void 0===x?20:x,D=o.brushRanges,S=void 0!==D&&D,C=o.interceptors,w=void 0===C?{}:C,E=o.selectionsFn,I=void 0===E?i.selections:E,A=t.brush(b);if("number"==typeof q&&A.setMaxListeners(q),S){var M=!0===S?Wa:S;A.configure({ranges:M})}var k={canSelect:!0,getIsSelectionLocked:!1,isInnerDimensionLocked:!1,lockedDimensions:[],singleSelectIndex:0,selectionInfo:{colorField:void 0,components:[],event:void 0,currentComponent:void 0,previousComponent:void 0}},L=function(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=t.selections,r=t.brush,i=t.majorScale,o=t.actions,a=t.selectionsFn,s=(arguments.length>1&&void 0!==arguments[1]?arguments[1]:{}).path,l=void 0===s?"/qHyperCubeDef":s;if(!n)return{layout:function(){},filteredFields:function(){},allowSimultaneous:function(){},release:function(){}};var u=++Ha,c=null,p={dimensions:[],measures:[]},d=[],f={};n.on=n.on.bind(n),n.isActive=n.isActive.bind(n),n.addListener=n.addListener.bind(n),n.removeListener=n.removeListener.bind(n);var m=function(e){var t=e.brush,n=e.getConfig;return{interceptor:function(e){var r=t.brushes(),i=n(),o=i.allowSimultaneous,a=i.layout,s=void 0===a?{}:a;r.forEach(function(n){var r,i,a;("range"===n.type||null!==(r=e[0])&&void 0!==r&&r.key&&(null===(i=e[0])||void 0===i?void 0:i.key)!==n.id&&0!==o.indexOf(null===(a=e[0])||void 0===a?void 0:a.key))&&t.clear([])});var l=e.filter(function(e){return-2!==e.value});if(l.length>1){var u=function(e){var t=e.layout,n=void 0===t?{}:t,r=e.values,i=void 0===r?[]:r;if(null==i||!i.length)return[];var o=Array.from(new Set(i.map(function(e){return e.key}))),a=[];return o.forEach(function(e){var t=La({layout:n,path:e}),r=i.filter(function(t){return t.key===e}),o=t?[r.pop()]:r;a.push.apply(a,En(o))}),a.filter(Boolean)}({layout:s,values:l});return u}return l},rangeInterceptor:function(e){var r=t.brushes(),i=n().allowSimultaneous;return r.filter(function(e){return"value"===e.type}).length?(t.clear([]),e):(r.forEach(function(n){var r=n.id===e[0].key||i.includes(n.id)&&i.includes(e[0].key);"range"!==n.type||r||t.clear([])}),e)}}}({brush:r,getConfig:function(){return{layout:c,allowSimultaneous:d}}}),h=m.rangeInterceptor,y=m.interceptor;r.intercept("set-ranges",h),r.intercept("toggle-ranges",h),r.intercept("toggle-values",y),r.intercept("set-values",y),r.intercept("add-values",y),r.on("start",function(){return n.begin(l)});var g={activate:function(){},deactivated:function(){return r.end()},cleared:function(){return r.clear()},canceled:function(){return r.end()}};!function(e,t){Object.keys(t).forEach(function(n){e.on(n,t[n])})}(n,g);var v=null==i||null===(e=i.max)||void 0===e?void 0:e.call(i);return null!=o&&o.select?(o.select.on("start",function(){var e;r.start(),"function"==typeof o.select.getBrushOptions&&(f=(e=o.select).getBrushOptions.apply(e,arguments))}),o.select.on("end",function(){var e=a(r,f,c),t=Fa({layout:c,filtered:p});e.forEach(function(e){var r=Ra({selection:e,fieldMap:t});(function(e,t,n){if(t&&void 0!==n&&"selectHyperCubeContinuousRange"===e.method){var r=e.params;if(r&&r[1]&&r[1][0]){var i=r[1][0],o=i.qDimIx,a=i.qRange;"undefined"!==o&&a&&!1===a.qMaxInclEq&&a.qMax>=n&&(a.qMaxInclEq=!0)}}})(r,o.select.brushSelectionIncludeMax,v),n.select(r)})})):r.on("update",function(){var e=a(r,f,c),t=Fa({layout:c,filtered:p});e.forEach(function(e){n.select(Ra({selection:e,fieldMap:t}))})}),0===ja.length&&document.addEventListener("keyup",Va),ja.push({key:u,selections:n}),{layout:function(e){c=e},filteredFields:function(e){p=e},allowSimultaneous:function(e){d=e},release:function(){c=null;var e=ja.indexOf(ja.filter(function(e){return e.key===u})[0]);-1!==e&&ja.splice(e,1),ja.length||document.removeEventListener("keyup",Va),function(e,t){Object.keys(t).forEach(function(n){e.removeListener(n,t[n])})}(n,g)}}}({brush:A,majorScale:u,actions:n,selections:r,picassoQ:i,selectionsFn:I});!function(e){var t=e.brush,n=e.interceptors,r=void 0===n?{}:n;Object.entries(r).forEach(function(e){var n=wn(e,2),r=n[0],i=n[1];(Array.isArray(i)?i:[i]).forEach(function(e){t.intercept(r,e)})})}({brush:A,interceptors:w});var O=function(e){var t=e.chart,n=e.selectionActions,r=e.brush,i=e.actions,o=e.selectionInfo,a=e.selections,s=e.selectionEvents,l=function(e){var t=e.brush,n=e.chart,r=e.selectionInfo,i=e.brushEvents,o=void 0===i?{}:i,a=Object.entries(o).map(function(e){var i=wn(e,2),o=i[0],a=i[1],s=function(){return a({chart:n,selectionInfo:r})};return t.on(o,s),[o,s]});return function(){a.forEach(function(e){var n=wn(e,2),r=n[0],i=n[1];t.removeListener(r,i)})}}({brush:r,chart:t,selectionInfo:o,brushEvents:e.brushEvents}),u=Ua({chart:t,selectionInfo:o,selectionActions:n,actions:i,selections:a,selectionEvents:s}),c=function(e){var t=e.actions;if(null==t||!t.lasso)return function(){};var n=!1,r=function(e){n||e.key!==Ta||(t.lasso.action(!0),n=!0)},i=function(e){e.key===Ta&&(t.lasso.action(!1),n=!1)};return document.addEventListener("keydown",r),document.addEventListener("keyup",i),function(){document.removeEventListener("keydown",r),document.removeEventListener("keyup",i)}}({actions:i});return function(){l(),u(),c()}}({chart:t,brush:A,actions:n,selections:r,selectionInfo:k.selectionInfo,selectionActions:{clear:d,reset:f},selectionEvents:h,brushEvents:g});if(s){var T=!0===s?En(Array(15)).map(function(e,t){return"qHyperCube/qMeasureInfo/".concat(t)}):s;L.allowSimultaneous(T)}return{unbindEvents:O,state:k,picassoSelections:L,brush:A}}var Ya=["colorField","useLegendCube"];function Ga(e){var t=e.chart,n=e.selections,r=e.actions,i=void 0!==r&&r,o=e.config,a=void 0===o?{}:o,s=Ka({chart:t,actions:i,selections:n,picassoQ:ka,config:a}),l=s.unbindEvents,u=s.state,c=s.picassoSelections,p=s.brush,d=a.custom,f=void 0===d?{}:d,m=a.legendAlias,h=void 0===m?void 0:m,y=a.setBrushAliases,g=void 0===y?Oa:y;return{getIsDimensionLocked:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;return u.lockedDimensions[e]},getIsSelectionLocked:function(){var e,t,r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];return null!==(e=null==n||null===(t=n.isLocked)||void 0===t?void 0:t.call(n))&&void 0!==e?e:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];if(null==e||!e.length)return!1;var t=e.filter(function(e){return"object"===In(e.data)&&Array.isArray(e.data.fields)}).every(function(e){return e.data.fields.every(function(e){var t=e.raw();return!(!t.qLocked&&t.qCardinal)})});return t}(r)},getIsSingleSelect:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:u.singleSelectIndex;return u.singleSelectDimensions[e]},getCanSelect:function(){return u.canSelect},getSelectionsObject:function(){return n},getSelectionInfo:function(){return u.selectionInfo},setLayout:function(e){var t=function(e){var t,n,r,i=e.selections,o=e.picassoSelections,a=e.layout,s={lockedDimensions:[],singleSelectDimensions:[]};null!=i&&null!==(t=i.isModal)&&void 0!==t&&t.call(i)&&i.confirm(),o.layout(a);var l=(null!==(n=null==a?void 0:a.qHyperCube)&&void 0!==n?n:{}).qDimensionInfo,u=void 0===l?[]:l;return s.lockedDimensions=u.map(function(e){return!!e.qLocked}),s.singleSelectDimensions=u.map(function(e,t){return La({layout:a,path:"qHyperCube/qDimensionInfo/".concat(t)})}),s.singleSelectIndex=function(e){var t,n=((null==e?void 0:e.qHyperCube)||{}).qDimensionInfo,r=void 0===n?[]:n,i=r.map(function(e,t){var n;return!(e.qLocked||(null===(n=e.qCardinalities)||void 0===n?void 0:n.qHypercubeCardinal)<=1)&&t}).filter(function(e){return"number"==typeof e});return null!==(t=i[0])&&void 0!==t?t:Math.max(r.length-1,0)}(a),s.canSelect=0===u.length||u.some(function(e){return!e.qLocked}),s.dimensionLocked=!(null===(r=u[0])||void 0===r||!r.qLocked),s}({selections:n,picassoSelections:c,layout:e});Object.assign(u,t)},setFilteredFields:function(e){c.filteredFields(e)},setBrushAliases:function(e){var t=e.colorField,n=e.useLegendCube,r=void 0!==n&&n,i=Dn(e,Ya),o=qn({useLegendCube:r,colorField:t,brush:p,legendAlias:h},i);g(qn(qn({},o),{},{defaultFunc:function(){return Oa(o)}}))},destroy:function(){l(),c.release()},custom:qn({},f)}}var Ja="'Source Sans Pro', 'Arial', 'sans-serif'",Za="#333333",Xa="#595959",Qa="#737373",es="#cccccc",ts="#e6e6e6";function ns(e){var t={};return[].concat(En(e),En([["","","color"],["object","","fontFamily"],["object","axis.label.name","color",Xa],["object","axis.label.name","fontFamily",Ja],["object","axis.label.name","fontSize","12px"],["object","axis.line.major","color",es],["object","axis.line.minor","color",ts],["object","axis.title","color"],["object","axis.title","fontFamily",Ja],["object","axis.title","fontSize","13px"],["object","grid.line.highContrast","color",ts],["object","grid.line.major","color",es],["object","grid.line.minor","color",ts],["object","label.value","color",Xa],["object","label.value","fontFamily",Ja],["object","label.value","fontSize","12px"],[!1,"label.value","darkColor",Xa],[!1,"label.value","lightColor",ts],["object","outOfRange","color","#999"],["object","legend.title","color",Za],["object","legend.title","fontFamily",Ja],["object","legend.title","fontSize","15px"],["object","legend.label","color",Xa],["object","legend.label","fontFamily",Ja],["object","legend.label","fontSize","13px"],["object","referenceLine.label.name","color",Za],["object","referenceLine.label.name","fontFamily",Ja],["object","referenceLine.label.name","fontSize","12px"],["object","referenceLine.outOfBounds","color",ts],["object","referenceLine.outOfBounds","fontFamily",Ja],["object","referenceLine.outOfBounds","fontSize","12px"],["object","referenceLine.outOfBounds","backgroundColor",Qa,function(e){return"transparent"===e?Qa: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 rs=function(e){return e};function is(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=wn(t,2),r=n[0],i=n[1];return e[r]=i,e},{});return o.forEach(function(e){var r=wn(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,d=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}),f=(s["".concat(o,".").concat(l)]||rs)(p(d));Vi(a,[o,l].filter(Boolean).join("."),f)}),i.forEach(function(e){var t=wn(e,2),n=t[0],r=t[1];Vi(a,n,r)}),a}var os={NOOP:function(){},FALSE:function(){return!1},ARRAY:function(){return[]},OBJECT:function(){return{}}},as="chart-modules-tooltip",ss="#".concat(as);function ls(){if(!document.querySelector(ss)){var e=document.createElement("div");e.id=as,e.setAttribute("data-qs-css",""),e.style.overflow="hidden",e.style.position="fixed",e.style.pointerEvents="none",e.style.left="0px",e.style.top="0px",e.style.width="100%",e.style.height="100%",e.style.zIndex=1020,document.body.appendChild(e)}}function us(e){return{show:!0,key:e.key,type:"tooltip",layout:{displayOrder:3},beforeMount:function(){ls()},beforeUpdate:function(){ls()},destroyed:function(){var e;null!=(e=document.querySelector(ss))&&e.parentElement&&e.childElementCount<1&&e.parentElement.removeChild(e)},settings:{appendTo:function(){return document.querySelector(ss)},direction:e.rtl?"rtl":"ltr",duration:e.duration},style:{arrow:{color:"#404040"},content:{display:"table","border-spacing":"4px",background:"rgba(64, 64, 64, 0.9)",opacity:"1",fontSize:"13px",fontFamily:"'Source Sans Pro', 'Arial', 'sans-serif'","empty-cells":"show"},cell:{"max-width":"180px","word-break":"break-word","word-wrap":"break-word","overflow-wrap":"break-word",hyphens:"auto"}}}}var cs="position",ps={bar:"rect",diamond:"path",point:"circle",square:"rect",triangle:"path","n-polygon":"path",slice:"path"},ds=function(e){return e.data.value},fs=function(e){var t,n=e.data;return null==n||null===(t=n.major)||void 0===t?void 0:t.value};function ms(e){var t=e.chart,n=e.expando,r=e.nodes,i=e.collectConfig,o=e.collectibles,a=e.meta,s=i.from,l={chart:t,expando:n,nodes:r,collectConfig:i,collectibles:o,meta:a};switch("function"==typeof s?"custom":s){case"single":return function(e){var t=wn(e.nodes,1)[0];if("container"===t.type&&t.children[0]){var n=wn(t.children,1)[0];return n.key=t.key,[n]}return[t]}(l);case"position":return function(e){var t=e.collectibles,n=e.meta;return e.chart.shapesAt(n.position.absolute,{components:t.map(function(e){return{key:e.key}})})}(l);case"dimension":return function(e){var t=e.chart,n=e.nodes,r=e.collectConfig,i=e.collectibles,o=e.meta,a=wn(n,1)[0],s=r.filter,l=r.after,u="function"==typeof s?s:function(){return!0},c="function"==typeof l?l:function(){},p=i.reduce(function(e,n){var i=ps[n.type]||n.type;return e.push.apply(e,En(t.findShapes(i).filter(function(e){return e.key===n.key&&e.data&&function(e){var t=e.meta,n=e.collectible,r=e.nodes,i=e.collectConfig.by,o=void 0===i?ds:i,a=n.major,s=void 0===a?fs:a,l=o({data:r.triggerer.data}),u=s({data:r.candidate.data,meta:t}),c=Array.isArray(l),p=Array.isArray(u);return c&&p?l.length===u.length&&l.every(function(e,t){return e===u[t]}):!c&&!p&&l===u}({collectConfig:r,meta:o,collectible:n,nodes:{triggerer:a,candidate:e}})}))),e},[]).filter(u);return c({collected:p,triggerer:a}),p}(l);case"radius":return function(e){var t=e.chart,n=e.collectConfig,r=e.collectibles,i=e.meta,o=wn(e.nodes,1)[0].localBounds,a=n.distance,s=n.filter,l="function"==typeof s?s:function(){return!0},u=r.map(function(e){return e.key});return t.shapesAt({cx:i.position.absolute.x,cy:i.position.absolute.y,r:a||Math.max(o.width,o.height)},{components:u.map(function(e){return{key:e}})}).filter(l)}(l);case"custom":return function(e){var t=e.chart,n=e.expando,r=e.nodes,i=e.meta;return e.collectConfig.from({chart:t,expando:n,nodes:r,meta:i})}(l);default:return[]}}var hs=Number.MAX_VALUE;function ys(e){var t=e.nodes.filter(function(e){return e.bounds.height+e.bounds.width!==0}).reduce(function(e,t){var n=t.bounds;return e.xMin=Math.min(e.xMin,n.x,n.x+n.width),e.yMin=Math.min(e.yMin,n.y,n.y+n.height),e.xMax=Math.max(e.xMax,n.x,n.x+n.width),e.yMax=Math.max(e.yMax,n.y,n.y+n.height),e},{xMin:hs,xMax:-hs,yMin:hs,yMax:-hs}),n=t.xMin,r=t.xMax,i=t.yMin;return{x:n,y:i,width:r-n,height:t.yMax-i}}function gs(e){var t=e.chart,n=e.config,r=e.expando,i=e.internal,o=e.nodes;if(!o.length)return[];var a=wn(o,1)[0].key,s=n.main.collectibles.filter(function(e){return!e.if||e.if()});if(!s.length)return[];var l=n.main.triggers.find(function(e){return-1!==e.keys.indexOf(a)})||{},u=l.collect,c=l.placement;if(!u||!u.from||!c)return[];var p={triggerer:a,position:i.get(cs)},d=(ms({chart:t,expando:r,nodes:o,collectConfig:u,collectibles:s,meta:p})||[]).map(function(e){return e.children.length?e.children[0]:e});return d.length?function(e){var t=e.chart,n=e.config,r=e.expando,i=e.placementConfig,o=e.hovered,a=e.collected,s=e.meta,l=function(e){for(var t=e.chart,n=e.config,r=e.expando,i=e.placementConfig,o=e.hovered,a=e.collected,s=e.meta,l=wn(o,1)[0],u=Array.isArray(i)?i:[i],c={bounds:l.bounds,key:l.key},p=ys({nodes:a}),d=0;d<u.length;d++){var f=u[d];if("function"==typeof f){var m=f({chart:t,expando:r,hovered:o,collected:En(a),meta:s,collectedBounds:p,combineBounds:ys});if(m)return m}if("trigger"===f)return c;if("collectible"===f){var h=n.main.placements.collectible;return{bounds:"function"==typeof h?h({collected:En(a)}):p,key:a[0].key}}}return c}({chart:t,config:n,expando:r,placementConfig:i,hovered:o,collected:a,meta:s}),u=l.bounds,c=l.key,p=wn(a,1)[0].desc;return[{bounds:u,nodes:a,data:a.map(function(e){return e.data}),key:c,meta:s,desc:p}]}({chart:t,config:n,expando:r,placementConfig:c,hovered:o,collected:d,meta:p}):[]}var vs=new RegExp("[A-Za-zªµºÀ-ÖØ-öø-ʸʻ-ˁː-ˑˠ-ˤˮͰ-ͳͶ-ͽΆΈ-ϵϷ-҂Ҋ-։ः-हऻऽ-ीॉ-ौॎ-ॐक़-ॡ।-ॿং-হঽ-ীে-ৌৎ-ৡ০-ৱ৴-৺ਃ-ਹਾ-ੀਖ਼-੯ੲ-ੴઃ-હઽ-ીૉ-ૌૐ-ૡ૦-૯ଂ-ହଽ-ାୀେ-ୌୗ-ୡ୦-୷ஃ-ிு-ௌௐ-௲ఁ-ఽు-ౄౘ-ౡ౦-౯౿-ಹಽ-ೋೕ-ೡ೦-ീെ-ൌൎ-ൡ൦-ෆා-ෑෘ-ะา-ำเ-ๆ๏-ະາ-ຳຽ-ໆ໐-༗༚-༴༶༸༾-ཬཿ྅ྈ-ྌ྾-࿅࿇-ာေးျ-ြဿ-ၗၚ-ၝၡ-ၰၵ-ႁႃ-ႄႇ-ႌႎ-ႜ႞-ፚ፠-ᎏᎠ-Ᏼᐁ-ᙿᚁ-ᚚᚠ-ᜑᜠ-ᜱ᜵-ᝑᝠ-ᝰក-ាើ-ៅះ-ៈ។-៚ៜ០-៩᠐-ᢨᢪ-ᤜᤣ-ᤦᤩ-ᤱᤳ-ᤸ᥆-᧚ᨀ-ᨖᨙ-ᩕᩗᩡᩣ-ᩤᩭ-ᩲ᪀-᪭ᬄ-ᬳᬵᬻᬽ-ᭁᭃ-᭪᭴-᭼ᮂ-ᮡᮦ-ᮧ᮪-ᯥᯧᯪ-ᯬᯮ᯲-ᰫᰴ-ᰵ᰻-᱿᳓᳡ᳩ-ᳬᳮ-ᶿḀ-ᾼιῂ-ῌῐ-Ίῠ-Ῥῲ-ῼⁱⁿₐ-ₜℂℇℊ-ℓℕℙ-ℝℤΩℨK-ℭℯ-ℹℼ-ℿⅅ-ⅉⅎ-⅏Ⅰ-ↈ⌶-⍺⎕⒜-ⓩ⚬⠀-⣿Ⰰ-ⳤⳫ-ⳮⴀ-⵰ⶀ-ⷞ々-〇〡-〩〱-〵〸-〼ぁ-ゖゝ-ゟァ-ヺー-ㆺㇰ-㈜㈠-㉏㉠-㉻㉿-㊰㋀-㋋㋐-㍶㍻-㏝㏠-㏾㐀-䶵一-ꒌꓐ-ꘌꘐ-ꙮꚀ-ꛯ꛲-꛷Ꜣ-ꞇ꞉-ꠁꠃ-ꠅꠇ-ꠊꠌ-ꠤꠧ꠰-꠷ꡀ-ꡳꢀ-ꣃ꣎-꣙ꣲ-ꤥ꤮-ꥆꥒ-ꥼꦃ-ꦲꦴ-ꦵꦺ-ꦻꦽ-ꨨꨯ-ꨰꨳ-ꨴꩀ-ꩂꩄ-ꩋꩍ-ꪯꪱꪵ-ꪶꪹ-ꪽꫀꫂ-ꯤꯦ-ꯧꯩ-꯬꯰-ﬗA-Za-zヲ-ᅵ]"),bs=new RegExp("[־׀׃׆א-״߀-ߪߴ-ߵߺ-ࠕࠚࠤࠨ࠰-ࡘ࡞יִײַ-ﬨשׁ-ﭏ]"),xs=new RegExp("[؈؋؍؛-ي٭-ٯٱ-ەۥ-ۦۮ-ۯۺ-܍ܐܒ-ܯݍ-ޥޱﭐ-ﴽﵐ-﷼ﹰ-ﻼ]"),qs=function(e){return vs.test(e)},Ds=function(e){return bs.test(e)||xs.test(e)};function Ss(e){for(var t=e?e.length:0,n=0;n<t;n++){var r=e[n];if(qs(r))return"ltr";if(Ds(r))return"rtl"}return"ltr"}function Cs(e){var t=e.config,n=e.h,r=e.context,i={section:function(e){return function(e){return{type:"section",content:e.content}}({content:e.content})},text:function(e){var n=e.value,r=e.style,i=e.visibility;return function(e){var t=e.config,n=e.value,r=e.style,i=void 0===r?{}:r,o=i.bold,a=void 0!==o&&o,s=i.italic,l=e.visibility;return{type:"text",content:[{content:n,style:{"font-weight":a?"bold":"normal","font-style":void 0!==s&&s?"italic":"normal","text-align":t.rtl?"right":"left",direction:Ss(n),"white-space":"pre-wrap"},colspan:2}],visibility:qn(qn({},{count:!0}),l)}}({config:t,value:n,style:r,visibility:i})},measure:function(e){var r=e.label,i=e.value,o=e.color,a=e.style,s=e.survive,l=e.visibility;return function(e){var t,n,r,i,o=e.h,a=e.label,s=e.value,l=e.color,u=e.style,c=e.survive,p=e.visibility,d=e.config.rtl,f=o("div",{style:{display:"inline-block",width:10,height:10,"background-color":l,margin:"0 8px"}});return{type:"measure",label:a,value:s,content:[{content:d?[":",a]:[a,":"],style:{"text-align":d?"right":"left","font-weight":null!=u&&null!==(t=u.label)&&void 0!==t&&t.bold?"bold":"normal","font-style":null!=u&&null!==(n=u.label)&&void 0!==n&&n.italic?"italic":"normal",direction:Ss(a)}},{content:l?d?[s,f]:[f,s]:s,style:{"text-align":d?"left":"right","vertical-align":"middle","font-weight":null!=u&&null!==(r=u.value)&&void 0!==r&&r.bold?"bold":"normal","font-style":null!=u&&null!==(i=u.value)&&void 0!==i&&i.italic?"italic":"normal",direction:Ss(s)}}],survive:qn(qn({},{color:!1,duplicate:!1}),c),visibility:qn(qn({},{count:!0}),p)}}({config:t,h:n,label:r,value:i,color:o,style:a,survive:s,visibility:l})},divider:function(){return function(e){var t=e.visibility;return{type:"divider",content:[{content:"",style:{"background-image":"linear-gradient(transparent 8px, rgba(255, 255, 255, 0.4) 8px, rgba(255, 255, 255, 0.4) 9.2px, transparent 9.2px)",height:"17px"},colspan:2}],visibility:qn(qn({},{count:!1}),t)}}({visibility:(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}).visibility})},row:function(e){return function(e){var t=e.visibility;return{type:"row",content:[{content:e.content,style:e.style,colspan:e.colspan}],visibility:qn(qn({},{count:!0}),t)}}({content:e.content,style:e.style,colspan:e.colspan,visibility:e.visibility})},raw:function(e){return function(e){var t=e.visibility;return{type:"raw",content:e.value,visibility:qn(qn({},{count:!0}),t)}}({value:e.value,visibility:e.visibility})},color:function(e){var i=e.nodes,o=e.property,a=e.filter,s=void 0===a||a,l=e.visibility,u=e.fillColor;return function(e){var t=e.config,n=e.h,r=e.context,i=e.nodes,o=e.property,a=e.filter,s=e.visibility,l=e.fillColor,u=t.rtl,c={type:"color",label:void 0,value:void 0,content:[],filter:a,visibility:qn(qn({},{count:!0}),s)},p=t.getColorSettings();if("color"===p.type||!p.fieldType)return c;var d=wn(i,1)[0];if(c.value=function(e){var t=e.config,n=e.context,r=e.property,i=e.node,o=i.data[r];if(o){if(-3===i.data.value)return i.data.label;var a=n.resources.dataset(o.source.key).field(o.source.field).formatter(),s=o.value,l=o.label,u=t.getColorSettings();if(a&&"measure"===u.fieldType)return Number.isNaN(+s)?"-":a(o.value);var c=l||s;return void 0===c||Number.isNaN(c)||"NaN"===c?"-":c}}({config:t,context:r,property:o,node:d}),void 0===c.value)return c;c.label=function(e){var t=e.context,n=e.property,r=e.node,i=e.config.getColorSettings();if(i.label)return i.label;var o=r.data[n];if(o&&"color"!==i.type){var a=t.resources.dataset,s=o.source,l=s.key,u=s.field;return a(l).field(u).title()}}({config:t,context:r,property:o,node:d});var f=null!=l?l:function(e){var t=e.node.attrs;return(null==t?void 0:t.fill)||"#ddd"}({node:d}),m=n("div",{style:{display:"inline-block",width:10,height:10,"background-color":f,margin:"0 8px"}});return c.content.push({content:u?[":",c.label]:[c.label,":"],style:{"text-align":u?"right":"left",direction:Ss(c.label)}},{content:u?[c.value,m]:[m,c.value],style:{"text-align":u?"left":"right","vertical-align":"middle",direction:Ss(c.value)}}),c}({config:t,h:n,context:r,nodes:i,property:o,filter:s,visibility:l,fillColor:u})}};return i}function ws(e){var t=e.chart,n=e.translator,r=e.config,i=e.expando,o=e.h,a=e.data,s=e.style,l=wn(a,1)[0],u=function(e){var t=e.config,n=e.nodes.reduce(function(e,n){var r=t.main.getGroupByValue({data:n.data});return e[r]||(e[r]={sorting:Object.keys(e).length,items:[]}),e[r].items.push(n),e},{});return Object.keys(n).map(function(e){return n[e]}).sort(function(e,t){return e.sorting-t.sorting}).map(function(e){return e.items})}({config:r,nodes:l.node.nodes}),c=function(e){var t=e.chart,n=e.config,r=e.expando,i=e.h,o=e.context,a=e.groups,s=o.node.meta,l=o.resources,u=l.dataset,c=l.formatter,p=Cs({config:n,h:i,context:o}),d=function(e){var t=e.dataset;return{dataset:{title:function(e,n){return t(e).field(n).title()}}}}({dataset:u}),f=a.map(function(e){var t=p.section({content:En((n.main.section({expando:r,h:i,nodes:e,dataset:u,formatter:c,meta:s,create:p,util:d})||[]).filter(function(e){var t;return null===(t=e.content)||void 0===t?void 0:t.length})).filter(Boolean)});return t.content=function(e){var t=e.config,n=e.content,r=n.find(function(e){return"color"===e.type&&e.filter}),i=r?n.filter(function(e){return"measure"!==e.type||e.survive.color||e.label!==r.label||e.value!==r.value}):n;return t.main.showDuplicateMeasures?i:i.reduce(function(e,t){var n=t.type,r=t.survive;if("measure"!==n||r.duplicate)return e.filtered.push(t),e;var i="".concat(t.label,"-").concat(t.value);return e.memory[i]||(e.memory[i]=!0,e.filtered.push(t)),e},{memory:{},filtered:[]}).filtered}({config:n,content:t.content}),t});return n.main.sections({chart:t,expando:r,h:i,nodes:o.node.nodes,dataset:u,formatter:c,meta:s,create:p,util:d,sections:f}),f.filter(Boolean)}({chart:t,config:r,expando:i,h:o,context:l,groups:u}),p=function(e){var t=e.translator,n=e.config,r=e.context,i=e.templates,o=n.main.layout,a=o.rows,s=o.grouping,l=o.single,u=function(e){var t=e.limit,n=e.grouping,r=e.single,i={count:0,overflow:0,index:{started:void 0,group:void 0}};return{process:function(e){var o=e.visibility,a=e.index;if(r&&0!==a)return n?(i.index.started!==a&&i.index.group!==a&&(i.overflow++,i.index.group=a),!1):(i.overflow++,!1);if(i.count>=t){if(!n)return i.overflow++,!1;if(i.index.started!==a)return i.index.group!==a&&(i.overflow++,i.index.group=a),!1}return o.count&&i.count++,n&&(i.index.started=a),!0},overflow:function(){return i.overflow}}}({limit:a,grouping:s,single:"function"==typeof l?l({meta:r.node.meta,sections:i}):l}),c=i.reduce(function(e,t,n){var r=t.type,o=t.content;"section"===r&&(void 0===o?[]:o).forEach(function(t){u.process({visibility:t.visibility,index:n})&&e.push(t.content)});var a=n===i.length-1;return"divider"!==r||a||u.process({visibility:t.visibility,index:n})&&e.push(t.content),e},[]).filter(function(e){return e.length}),p=u.overflow();return p&&c.push(function(e){var t=e.translator,n=e.config,r=e.count,i=t?t.get("Object.ChartTooltip.NMore",r):"+".concat(r," more"),o=Ss(i);return[{content:i,style:{"font-weight":"bold","text-align":n.rtl?"right":"left",direction:o},colspan:2}]}({translator:t,config:n,count:p})),c}({translator:n,config:r,context:l,templates:c});return p.length?function(e){var t=e.h,n=e.style;return e.rows.map(function(e){return t("tr",{},e.map(function(e){var r={style:qn(qn({},n.cell||{}),e.style||{}),class:e.class};return e.colspan&&(r.colspan=e.colspan),t("td",r,e.content)}))})}({h:o,style:s,rows:p}):function(e){var t=e.h;return t("tr",{},t("td",{style:{fontStyle:"italic",opacity:.75}},"Empty"))}({h:o})}function Es(e){var t=e.chart,n=e.translator,r=e.config,i=e.expando,o=e.internal;if(!r.main.key)return!1;var a=zi(),s=us({key:r.main.key,rtl:r.rtl,duration:r.duration}),l=r.main.events.tooltip,u=l.afterShow,c=l.afterHide,p=function(){var e=a.get("collected");return{expando:i,nodes:e.nodes,meta:e.meta}};return ir(!0,s,{settings:{filter:function(e){return gs({chart:t,config:r,expando:i,internal:o,nodes:e})},extract:function(e){return a.set("collected",e.node),e},content:function(e){var o=e.h,a=e.data,s=e.style;return ws({chart:t,translator:n,config:r,expando:i,h:o,data:a,style:s})},placement:function(e){var t=e.nodes;return r.main.placement({meta:t[0].meta})},afterShow:function(){return u(p())},afterHide:function(){return c(p())}},style:{arrow:{color:r.style.background},content:r.style}})}function Is(e){var t=e.config,n=t.legend.keys;if(!n.tooltip||!n.component)return!1;if("categorical"!==t.getColorSettings().type)return!1;var r=us({key:n.tooltip,rtl:t.rtl,duration:t.duration});return ir(!0,r,{settings:{filter:function(e){return e.filter(function(e){return e.data&&e.key===n.component})},extract:function(e){return e},content:function(e){var t=e.h,n=e.data;return[t("tr",{},[t("td",{style:qn(qn({},e.style.cell||{}),{"font-weight":"bold","text-align":"left"}),colspan:2},n[0].node.data.label)])]},placement:"pointer"},style:{arrow:{color:t.style.background},content:t.style}})}function As(e){var t=e.config.main.triggers.reduce(function(e,t){return t.keys.forEach(function(n){var r=t.distance||0;e.distance[n]=r,e.distances.includes(r)||e.distances.push(r),e.key[n]=!0,e.keys[r]||(e.keys[r]=[]),e.keys[r].push(n)}),e},{distance:{},distances:[],key:{},keys:{}});return function(e){return e.components.filter(function(e){return t.key[e.key]}).reduce(function(e,n){e.any=!0,e.components.push(n.key);var r=t.distance[n.key];return 0===r?e.position.push(n.key):(e.distances.includes(r)||(e.distances.push(r),e.distanceKeys[r]=[]),e.distanceKeys[r].push(n.key)),e},{any:!1,components:[],position:[],distances:[],distanceKeys:{}})}}var Ms,ks,Ls=function(){return!0};function Os(e){var t=e.config.main.triggers.reduce(function(e,t){var n=t.filter;return t.keys.forEach(function(t){e[t]="function"==typeof n?n:Ls}),e},{});return function(e){var n=t[e.key];return!n||n(e)}}function Ts(e){var t=e.chart,n=e.event,r=e.component,i={absolute:{x:0,y:0},relative:{x:0,y:0}},o=t.element.getBoundingClientRect(),a=o.left,s=o.top;i.absolute.x=(void 0===n.clientX?Math.floor(n.srcEvent.clientX):n.clientX)-a,i.absolute.y=(void 0===n.clientY?Math.floor(n.srcEvent.clientY):n.clientY)-s;var l=t.component(r);if(l){var u=l.rect.computedInner;i.relative.x=i.absolute.x-u.x,i.relative.y=i.absolute.y-u.y}return i}function Ns(e){var t=e.chart,n=e.filter,r=e.hits,i=e.position,o=[];if(r.position.length&&o.push.apply(o,En(t.shapesAt(i.absolute,{components:r.position.map(function(e){return{key:e}})}).filter(n))),!o.length&&r.distances.length){var a=[];r.distances.forEach(function(e){a.push.apply(a,En(t.shapesAt({cx:i.absolute.x,cy:i.absolute.y,r:e},{components:r.distanceKeys[e].map(function(e){return{key:e}})}).filter(n)))}),a.length&&o.push(function(e){var t=e.nodes,n=e.origin,r=t.find(function(e){return"path"===e.type});if(r)return r;var i=function(e){var t=Math.abs(n.x-(e.localBounds.x+e.localBounds.width/2)),r=Math.abs(n.y-(e.localBounds.y+e.localBounds.height/2));return Math.sqrt(t*t+r*r)};return t.slice(1).reduce(function(e,t){var n=i(t);return n<e.distance&&(e.distance=n,e.node=t),e},{node:t[0],distance:i(t[0])}).node}({nodes:a,origin:i.relative}))}return o}function Ps(e){var t=e.chart,n=e.config,r=e.expando,i=e.internal,o=e.facade,a=n.delay.tap,s=As({config:n}),l=Os({config:n}),u=n.main.triggers.reduce(function(e,t){return e.push.apply(e,En(t.keys)),e},[]);return{key:"event:".concat("tooltipTap"),type:"Tap",options:{event:"tooltipTap",enable:function(e,r){return!r||!!n.enable({event:r})&&t.componentsFromPoint({x:r.center.x,y:r.center.y}).filter(function(e){return-1!==u.indexOf(e.key)}).length>0}},recognizeWith:"tap",events:bn({},"tooltipTap",function(e){if(e.preventDefault(),"mouse"!==e.pointerType&&!n.main.suppress({event:e})){var u=t.component(n.main.key);if(u&&u.show){var c=t.componentsFromPoint({x:e.center.x,y:e.center.y}),p=s({components:c});if(p.any){var d=wn(p.components,1)[0],f=Ts({chart:t,event:e,component:d});i.set(cs,f);var m=Ns({chart:t,filter:l,hits:p,position:f});if(m.length){var h=m[0].key;n.main.events.tooltip.beforeShow({expando:r,event:e,collectNodes:function(){return o.collectNodes({nodes:m})},meta:{triggerer:h,position:f}}).then(function(){u.emit("show",e,{nodes:m,delay:a})}).catch(function(){})}else u.emit("hide")}else u.emit("hide")}}})}}function Fs(e){var t=e.chart,n=e.config,r=e.expando,i=e.internal,o=e.facade,a=As({config:n}),s=Os({config:n}),l=function(e){var t=e.config,n=e.expando,r=e.internal,i=e.facade,o=t.main.events.tooltip.beforeShow,a=t.delay.hover,s={ongoing:{},latest:void 0};return function(e){var t=e.event,l=e.tooltip,u=e.nodes,c=function(e){var t=e.nodes;return JSON.stringify(t.map(function(e){var t;return{key:e.key,bounds:e.bounds,value:null===(t=e.data)||void 0===t?void 0:t.value}}))}({nodes:u});if(!s.ongoing[c]){s.ongoing[c]=!0,s.latest=c;var p=u[0].key;o({expando:n,event:t,collectNodes:function(){return i.collectNodes({nodes:u})},meta:{triggerer:p,position:r.get(cs)}}).then(function(){c===s.latest&&l.emit("show",t,{nodes:u,delay:a})}).catch(function(){l.emit("show")}).finally(function(){delete s.ongoing[c],c===s.latest&&(s.latest=void 0)})}}}({config:n,expando:r,internal:i,facade:o}),u=[n.main.key,n.legend.keys.tooltip].filter(Boolean),c=function(){u.forEach(function(e){var n=t.component(e);null!=n&&n.show&&n.emit("hide")})};return{type:"native",events:{mousemove:function(e){if(n.enable({event:e})&&!n.main.suppress({event:e})){var r=t.componentsFromPoint({x:e.clientX,y:e.clientY}),o=t.component(n.main.key);if(o&&o.show){var u=a({components:r});if(u.any){var c=wn(u.components,1)[0],p=Ts({chart:t,event:e,component:c});i.set(cs,p);var d=Ns({chart:t,filter:s,hits:u,position:p});if(!d.length)return void o.emit("hide");l({event:e,tooltip:o,nodes:d})}else o.emit("hide")}var f=n.legend;if(f.keys.tooltip&&f.keys.component){var m=t.component(f.keys.tooltip);m&&m.show&&(r.some(function(e){return e.key===f.keys.component})?m.emit("show",e):m.emit("hide"))}}},mouseup:function(e){2===e.button&&c()},mouseleave:function(){n.main.events.interaction.mouseleave({expando:r}),c()},wheel:function(){c()}}}}function Rs(e){var t=e.chart,n=e.translator,r=function(e){var t=e.config;return ir(!0,{},{rtl:!1,enable:os.FALSE,getColorSettings:os.OBJECT,style:{fontSize:void 0,fontFamily:void 0,color:void 0,background:void 0},delay:{hover:500,tap:0},duration:8e3,main:{key:void 0,suppress:os.FALSE,getGroupByValue:os.NOOP,collectibles:[],triggers:[],placement:function(){return{type:"bounds"}},placements:{collectible:"combine"},showDuplicateMeasures:!1,layout:{rows:7,grouping:!1,single:!1},section:os.ARRAY,sections:os.NOOP,events:{tooltip:{beforeShow:function(){return Promise.resolve()},afterShow:os.NOOP,afterHide:os.NOOP},interaction:{mouseleave:os.NOOP}}},legend:{keys:{tooltip:void 0,component:void 0}}},void 0===t?{}:t)}({config:e.config}),i=zi(),o=zi(),a={components:void 0,interactions:void 0};return{getComponents:function(){return a.components||(a.components=function(e){var t=e.config;return[Es({chart:e.chart,translator:e.translator,config:t,expando:e.expando,internal:e.internal}),Is({config:t})].filter(Boolean)}({chart:t,translator:n,config:r,expando:i,internal:o})),a.components},getInteractions:function(){return a.interactions||(a.interactions=function(e){var t=e.chart,n=e.config,r=e.expando,i=e.internal,o=function(e){var t=e.chart,n=e.config,r=e.expando,i=e.internal;return{collectNodes:function(e){var o=e.nodes,a=wn(gs({chart:t,config:n,expando:r,internal:i,nodes:o}),1)[0];return(void 0===a?{nodes:[]}:a).nodes}}}({chart:t,config:n,expando:r,internal:i});return{gestures:[Ps({chart:t,config:n,expando:r,internal:i,facade:o})],native:Fs({chart:t,config:n,expando:r,internal:i,facade:o})}}({chart:t,config:r,expando:i,internal:o})),a.interactions},expando:i}}function js(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Hs=function(){if(ks)return Ms;ks=1;var e={};function t(){t.init.call(this)}return e.isObject=function(e){return"object"==typeof e&&null!==e},e.isNumber=function(e){return"number"==typeof e},e.isUndefined=function(e){return void 0===e},e.isFunction=function(e){return"function"==typeof e},Ms=t,t.EventEmitter=t,t.prototype._events=void 0,t.prototype._maxListeners=void 0,t.defaultMaxListeners=10,t.init=function(){this._events=this._events||{},this._maxListeners=this._maxListeners||void 0},t.prototype.setMaxListeners=function(t){if(!e.isNumber(t)||t<0||isNaN(t))throw TypeError("n must be a positive number");return this._maxListeners=t,this},t.prototype.emit=function(t){var n,r,i,o,a,s;if(this._events||(this._events={}),"error"===t&&!this._events.error)throw(n=arguments[1])instanceof Error?n:Error('Uncaught, unspecified "error" event.');if(r=this._events[t],e.isUndefined(r))return!1;if(e.isFunction(r))switch(arguments.length){case 1:r.call(this);break;case 2:r.call(this,arguments[1]);break;case 3:r.call(this,arguments[1],arguments[2]);break;default:for(i=arguments.length,o=new Array(i-1),a=1;a<i;a++)o[a-1]=arguments[a];r.apply(this,o)}else if(e.isObject(r)){for(i=arguments.length,o=new Array(i-1),a=1;a<i;a++)o[a-1]=arguments[a];for(i=(s=r.slice()).length,a=0;a<i;a++)s[a].apply(this,o)}return!0},t.prototype.addListener=function(n,r){var i;if(!e.isFunction(r))throw TypeError("listener must be a function");(this._events||(this._events={}),this._events.newListener&&this.emit("newListener",n,e.isFunction(r.listener)?r.listener:r),this._events[n]?e.isObject(this._events[n])?this._events[n].push(r):this._events[n]=[this._events[n],r]:this._events[n]=r,e.isObject(this._events[n])&&!this._events[n].warned)&&((i=e.isUndefined(this._maxListeners)?t.defaultMaxListeners:this._maxListeners)&&i>0&&this._events[n].length>i&&(this._events[n].warned=!0,e.isFunction(console.error)&&console.error("(node) warning: possible EventEmitter memory leak detected. %d listeners added. Use emitter.setMaxListeners() to increase limit.",this._events[n].length),e.isFunction(console.trace)&&console.trace()));return this},t.prototype.on=t.prototype.addListener,t.prototype.once=function(t,n){if(!e.isFunction(n))throw TypeError("listener must be a function");var r=!1;function i(){this.removeListener(t,i),r||(r=!0,n.apply(this,arguments))}return i.listener=n,this.on(t,i),this},t.prototype.removeListener=function(t,n){var r,i,o,a;if(!e.isFunction(n))throw TypeError("listener must be a function");if(!this._events||!this._events[t])return this;if(o=(r=this._events[t]).length,i=-1,r===n||e.isFunction(r.listener)&&r.listener===n)delete this._events[t],this._events.removeListener&&this.emit("removeListener",t,n);else if(e.isObject(r)){for(a=o;a-- >0;)if(r[a]===n||r[a].listener&&r[a].listener===n){i=a;break}if(i<0)return this;1===r.length?(r.length=0,delete this._events[t]):r.splice(i,1),this._events.removeListener&&this.emit("removeListener",t,n)}return this},t.prototype.removeAllListeners=function(t){var n,r;if(!this._events)return this;if(!this._events.removeListener)return 0===arguments.length?this._events={}:this._events[t]&&delete this._events[t],this;if(0===arguments.length){for(n in this._events)"removeListener"!==n&&this.removeAllListeners(n);return this.removeAllListeners("removeListener"),this._events={},this}if(r=this._events[t],e.isFunction(r))this.removeListener(t,r);else if(Array.isArray(r))for(;r.length;)this.removeListener(t,r[r.length-1]);return delete this._events[t],this},t.prototype.listeners=function(t){return this._events&&this._events[t]?e.isFunction(this._events[t])?[this._events[t]]:this._events[t].slice():[]},t.listenerCount=function(t,n){return t._events&&t._events[n]?e.isFunction(t._events[n])?1:t._events[n].length:0},Ms}(),Vs=js(Hs);function zs(){const e={};var t;return t=e,Object.keys(Vs.prototype).forEach(e=>{t[e]=Vs.prototype[e]}),Vs.init(t),e.lasso={active:()=>!1},e.select={on:e.on,removeListener:e.removeListener},e}function _s({picasso:e}){const t=x(),n=q(),r=D(),[i,o]=S(),a=zs(),s=C(),l=w(),u=!!s.qSelectionInfo?.qInSelections,[c,p]=S(!1);return a.lasso=function({layout:e,isInSelections:t,isLassoActionActive:n,setIsLassoActionActive:r,translator:i}){return{active:n,label:i.get(n?"Tooltip.ToggleOffLassoSelection":"Tooltip.ToggleOnLassoSelection"),hidden:!t||!!e.qHyperCube?.qDimensionInfo?.[0]?.qIsOneAndOnlyOne,action(e){r("boolean"==typeof e?e:!n)},icon:{shapes:[{type:"path",attrs:{d:"M15.9488039,5.20769129 C16.0487326,6.70662306 15.3492311,8.30548361 14.050157,9.30477145 C12.651154,10.5039169 10.8524359,10.8037032 8.85386017,10.4039881 L7.3549284,10.0042729 L5.75606786,9.70448659 C5.75606786,9.90434416 5.65613907,10.0042729 5.4562815,10.2041305 C5.05656637,10.6038456 4.55692244,10.8037032 4.05727852,10.8037032 C3.75749217,10.8037032 3.45770582,10.7037744 3.15791946,10.6038456 C3.05799068,10.903632 3.15791946,11.2034184 3.45770582,11.7030623 C5.05656637,14.0014243 3.85742095,15.9000712 3.75749217,16 L2.2585604,15.3004985 C2.2585604,15.2005697 2.95806189,14.0014243 1.95877405,12.6024213 C1.6589877,12.0028486 1.15934378,11.0035608 1.55905891,10.0042729 C1.6589877,9.80441537 1.75891648,9.6045578 1.95877405,9.40470024 C1.6589877,8.90505631 1.55905891,8.30548361 1.85884527,7.7059109 C1.55905891,7.40612455 1.25927256,7.1063382 1.15934378,6.70662306 C0.859557424,5.90719279 0.959486209,4.5081898 1.6589877,3.30904439 C1.95877405,2.6095429 2.55834676,2.0099702 3.15791946,1.51032628 C3.95734974,0.91075357 4.95663758,0.610967217 6.15578299,0.311180864 C9.05371774,-0.388320626 11.9516525,0.111323295 13.9502282,1.61025506 C15.1493736,2.50961412 15.8488751,3.80868831 15.9488039,5.20769129 Z M13.0508691,8.10562604 C13.8502994,7.40612455 14.3499433,6.40683671 14.3499433,5.30762008 C14.2500145,4.20840345 13.550513,3.40897318 12.9509403,2.90932926 C12.1515101,2.40968533 11.252151,2.0099702 10.1529344,1.81011263 C8.95378895,1.61025506 7.75464354,1.71018384 6.45556935,1.91004141 C4.75678001,2.30975655 3.65756338,3.00925804 3.05799068,4.10847467 C2.55834676,5.00783373 2.65827554,5.90719279 2.75820433,6.20697914 C2.75820433,6.30690792 2.85813311,6.40683671 3.05799068,6.40683671 C3.15791946,6.40683671 3.25784825,6.40683671 3.35777703,6.40683671 C3.45770582,6.40683671 3.45770582,6.40683671 3.45770582,6.40683671 L3.5576346,6.40683671 L3.65756338,6.40683671 C4.65685123,6.40683671 5.4562815,6.90648063 5.85599664,7.80583969 L5.85599664,8.00569726 C6.35564056,8.10562604 7.05514205,8.30548361 7.75464354,8.50534118 L9.25357531,8.90505631 C10.0530056,9.0049851 10.7525071,9.0049851 11.4520086,8.80512753 C12.0515813,8.70519875 12.5512252,8.40541239 13.0508691,8.10562604 Z"}}]}}}({layout:s,isInSelections:u,isLassoActionActive:c,setIsLassoActionActive:p,translator:l}),E(()=>(i&&(i.interactions.lasso.active=()=>c),{...a.lasso}),[i,c,u,l.language()]),I(()=>{n.style.overflow="hidden";const i=e({renderer:{prio:[t.renderer||"canvas"]}}),l=i.chart({element:n,data:[],settings:{}}),u=Ga({chart:l,actions:a,selections:r,config:{selectionActions:!1}});u.setLayout(s),u.setBrushAliases({colorField:"qDimensionInfo/0/qAttrDimInfo/0"});const c=function(e){var t=qn({},e),n={},r={},i=!1,o={get:function(e){return t[e]},set:function(e,o){var a=t[e];!i&&n[e]?t[e]=n[e](o,a):t[e]=o,!i&&r[e]&&r[e](t[e],a)},preventSet:function(e,t){i=!0,o.set(e,t),i=!1},intercept:function(e,t){n[e]=t},onChanged:function(e,t){r[e]=t}};return o}({legendScrollOffset:0,rotation:0});c.intercept("rotation",e=>(c.get("rotation")+e)%(2*Math.PI)),c.onChanged("rotation",()=>{l.update({partialData:!0})});const p=zi();return a.on("selections-start",()=>{l.brush("selection").start()}),o({picasso:i,chart:l,selectionService:u,viewState:c,viewCache:p,interactions:a}),()=>{u.destroy(),l.destroy(),a.removeAllListeners(),delete a.select,c.intercept("rotation",void 0),c.onChanged("rotation",void 0)}},[]),i}var Bs,$s;var Us=function(){if($s)return Bs;$s=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 Bs=function e(){var t,n,r,l,u,c,p=arguments[0],d=1,f=arguments.length,m=!1;for("boolean"==typeof p&&(m=p,p=arguments[1]||{},d=2),(null==p||"object"!=typeof p&&"function"!=typeof p)&&(p={});d<f;++d)if(null!=(t=arguments[d]))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},Bs}(),Ws=js(Us);const Ks=[["FULL",{width:550,height:450}],["MEDIUM",{width:400,height:220}],["SMALL",{width:300,height:150}],["XSMALL",{width:150,height:75}],["SPARK",{width:0,height:0}]],Ys={};Ks.forEach(([e,{width:t,height:n}])=>{Ys[e]={width:t,height:n}});const Gs={getLayoutModes:()=>Ys,getLayoutMode(e,t){let n;for(n=0;n<Ks.length;++n)if(e>=Ks[n][1].width&&t>=Ks[n][1].height)return Ks[n][0];return"SPARK"}};function Js(e,t){return{layoutModes:Gs.getLayoutModes(),center:void 0!==t.minCenterRatio?{minWidthRatio:t.minCenterRatio,minHeightRatio:t.minCenterRatio}:void 0,logicalSize:t.logicalSize?{align:.5,preserveAspectRatio:!0,...t.logicalSize}:void 0}}const Zs=/^[A-Z][A-z0-9_]*$/i,Xs={getChar(e){let t=e,n=-1;return t>9?(n=65+t-10,n>90&&(n+=6)):t=`${t}`.charCodeAt(0),[48,111,79,105,73,108].indexOf(n)>-1?this.getChar(t+1):String.fromCharCode(n)},base62(e){const t=this.getChar(e%62),n=Math.floor(e/62);return n>0?this.base62(n)+t:t},id(){return this.base62(Math.round(99e11*Math.random()+1e11)).replace(/\W/g,"")}},Qs={setValue:(e,t,n)=>{if(!t)return!1;const r=t.split("."),i=r[r.length-1];let o,a=e;for(o=0;o<r.length-1;++o)void 0===a[r[o]]&&(a[r[o]]=Number.isNaN(+r[o+1])?{}:[]),a=a[r[o]];if(void 0!==n){const e=a[i];return a[i]=n,{updated:n,previous:e}}return delete a[i],!1},getValue:(e,t,n)=>{const r=t.split(".");let i,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},moveArrayElement:(e,t,n)=>{if(n>=e.length){let t=n-e.length;for(;1+t--;)e.push(void 0)}e.splice(n,0,e.splice(t,1)[0])},escapeField:e=>{let t;return t=!e||"]"===e||Zs.test(e)?e:`[${e.replace(/\]/g,"]]")}]`,t},deleteUndefinedProperties:e=>{Object.keys(e).forEach(t=>{void 0===e[t]&&delete e[t]})},generateId:()=>Xs.id(),shouldUseFormat:e=>!e.isCustomFormatted&&(e.qIsAutoFormat||"U"===e.qNumFormat.qType)};function el(e,t){const n=e.component(t);return n&&n._DO_NOT_USE_getInfo&&n._DO_NOT_USE_getInfo().offset}const tl=new RegExp("[A-Za-zªµºÀ-ÖØ-öø-ʸʻ-ˁː-ˑˠ-ˤˮͰ-ͳͶ-ͽΆΈ-ϵϷ-҂Ҋ-։ः-हऻऽ-ीॉ-ौॎ-ॐक़-ॡ।-ॿং-হঽ-ীে-ৌৎ-ৡ০-ৱ৴-৺ਃ-ਹਾ-ੀਖ਼-੯ੲ-ੴઃ-હઽ-ીૉ-ૌૐ-ૡ૦-૯ଂ-ହଽ-ାୀେ-ୌୗ-ୡ୦-୷ஃ-ிு-ௌௐ-௲ఁ-ఽు-ౄౘ-ౡ౦-౯౿-ಹಽ-ೋೕ-ೡ೦-ീെ-ൌൎ-ൡ൦-ෆා-ෑෘ-ะา-ำเ-ๆ๏-ະາ-ຳຽ-ໆ໐-༗༚-༴༶༸༾-ཬཿ྅ྈ-ྌ྾-࿅࿇-ာေးျ-ြဿ-ၗၚ-ၝၡ-ၰၵ-ႁႃ-ႄႇ-ႌႎ-ႜ႞-ፚ፠-ᎏᎠ-Ᏼᐁ-ᙿᚁ-ᚚᚠ-ᜑᜠ-ᜱ᜵-ᝑᝠ-ᝰក-ាើ-ៅះ-ៈ។-៚ៜ០-៩᠐-ᢨᢪ-ᤜᤣ-ᤦᤩ-ᤱᤳ-ᤸ᥆-᧚ᨀ-ᨖᨙ-ᩕᩗᩡᩣ-ᩤᩭ-ᩲ᪀-᪭ᬄ-ᬳᬵᬻᬽ-ᭁᭃ-᭪᭴-᭼ᮂ-ᮡᮦ-ᮧ᮪-ᯥᯧᯪ-ᯬᯮ᯲-ᰫᰴ-ᰵ᰻-᱿᳓᳡ᳩ-ᳬᳮ-ᶿḀ-ᾼιῂ-ῌῐ-Ίῠ-Ῥῲ-ῼⁱⁿₐ-ₜℂℇℊ-ℓℕℙ-ℝℤΩℨK-ℭℯ-ℹℼ-ℿⅅ-ⅉⅎ-⅏Ⅰ-ↈ⌶-⍺⎕⒜-ⓩ⚬⠀-⣿Ⰰ-ⳤⳫ-ⳮⴀ-⵰ⶀ-ⷞ々-〇〡-〩〱-〵〸-〼ぁ-ゖゝ-ゟァ-ヺー-ㆺㇰ-㈜㈠-㉏㉠-㉻㉿-㊰㋀-㋋㋐-㍶㍻-㏝㏠-㏾㐀-䶵一-ꒌꓐ-ꘌꘐ-ꙮꚀ-ꛯ꛲-꛷Ꜣ-ꞇ꞉-ꠁꠃ-ꠅꠇ-ꠊꠌ-ꠤꠧ꠰-꠷ꡀ-ꡳꢀ-ꣃ꣎-꣙ꣲ-ꤥ꤮-ꥆꥒ-ꥼꦃ-ꦲꦴ-ꦵꦺ-ꦻꦽ-ꨨꨯ-ꨰꨳ-ꨴꩀ-ꩂꩄ-ꩋꩍ-ꪯꪱꪵ-ꪶꪹ-ꪽꫀꫂ-ꯤꯦ-ꯧꯩ-꯬꯰-ﬗA-Za-zヲ-ᅵ]"),nl=new RegExp("[־׀׃׆א-״߀-ߪߴ-ߵߺ-ࠕࠚࠤࠨ࠰-ࡘ࡞יִײַ-ﬨשׁ-ﭏ]"),rl=new RegExp("[؈؋؍؛-ي٭-ٯٱ-ەۥ-ۦۮ-ۯۺ-܍ܐܒ-ܯݍ-ޥޱﭐ-ﴽﵐ-﷼ﹰ-ﻼ]"),il={lrm:String.fromCharCode(8206),rlm:String.fromCharCode(8207),isLtrChar:e=>tl.test(e),isRtlChar:e=>nl.test(e)||rl.test(e),detectTextDirection(e){const t=e?e.length:0;let n,r;for(n=0;n<t;n++){if(r=e[n],il.isLtrChar(r))return"ltr";if(il.isRtlChar(r))return"rtl"}return"ltr"}},ol={getColorSymbol:(e,t)=>e.h("div",{style:{display:"inline-block",width:"10px",height:"10px","background-color":t.color.fill,margin:"0 8px"}}),getNodeFillColor:e=>e.attrs&&void 0!==e.attrs.fill?e.attrs.fill:e.children&&e.children[0]&&e.children[0].attrs&&void 0!==e.children[0].attrs.fill?e.children[0].attrs.fill:void 0,getColor(e,t,n){const r=t.data,i=e.resources.formatter,o=e.resources.dataset,a={};if(n.coloring.label&&(a.label=`${n.coloring.label}`),"color"!==n.coloring.type&&r.fillTooltip){const e=i("fill"),t="measure"===n.coloring.fieldType;if(a.value=t&&e?e(r.fillTooltip.value):r.fillTooltip.label?r.fillTooltip.label:r.fillTooltip.value,!n.coloring.label){const e=o(r.fillTooltip.source.key).field(r.fillTooltip.source.field).title();a.label=`${e}`}}return a.fill=void 0===r._fillColor?ol.getNodeFillColor(t):r._fillColor,a},getMeasure:(e,t)=>({label:`${e(t.source.key).field(t.source.field).title()}`,value:""===t.label||"NaN"===t.label?"-":t.label,field:t.source.field}),hideColorRow:(e,t)=>void 0===e.color.value||e.measures.some(e=>e.field===t.coloring.field),getTitleRow(e,t){const n=il.detectTextDirection(e.title);return[{content:e.title,style:{"font-weight":"bold","text-align":t?"right":"left",direction:n,"white-space":"pre-wrap"},colspan:2},{}]},getDescriptionRow(e,t){const n=il.detectTextDirection(e.value);return[{content:e.value,style:{"text-align":t?"right":"left",direction:n,"white-space":"pre-wrap"},colspan:2},{}]},getNMoreRow(e,t,n){const r=t?t.get("Object.ChartTooltip.NMore",e):`+${e} more`;return[{content:r,style:{"font-weight":"bold","text-align":n?"right":"left",direction:il.detectTextDirection(r)},colspan:2},{}]},getSeparatorRow:()=>[{content:"",style:{"background-image":"linear-gradient(transparent 8px, rgba(255, 255, 255, 0.4) 8px, rgba(255, 255, 255, 0.4) 9.2px, transparent 9.2px)",height:"17px"},colspan:2},{}],getColorRow(e,t,n){const r=il.detectTextDirection(t.color.label),i=n?[":",t.color.label]:[t.color.label,":"],o=il.detectTextDirection(t.color.value);return[{content:i,style:{"text-align":n?"right":"left",direction:r}},{content:n?[t.color.value,ol.getColorSymbol(e,t)]:[ol.getColorSymbol(e,t),t.color.value],style:{"text-align":n?"left":"right",direction:o,"vertical-align":"middle"}}]},getMeasureRow(e,t,n,r,i=!1){const o=il.detectTextDirection(e.label),a=r?[":",e.label]:[e.label,":"],s=il.detectTextDirection(e.value);let l;return l=i?r?[e.value,ol.getColorSymbol(t,n)]:[ol.getColorSymbol(t,n),e.value]:[e.value],[{content:a,style:{"text-align":r?"right":"left",direction:o}},{content:l,style:{"text-align":r?"left":"right",direction:s,"vertical-align":"middle"}}]}};function al(e){const t=parseInt(e,10);if(!isNaN(t))return t}const sl=e=>t=>e.getContrastingColorTo(t.node.attrs.fill);function ll(e,t){const n=e.styleService.label.value.getStyle();return{padding:10,placements:e.simplifiedPlacements.map(n=>function(e,t,n){const r=n.themeService.getStyles(),i=n.styleService.label.value.getStyle(),o=i.fill===r.label.value.color;return{position:e.position,justify:e.justify,fill:o&&!e.onBackground?sl(t):i.fill,overflow:e.overflow,padding:e.padding}}(n,t,e)),fontSize:al(n.fontSize),fontFamily:n.fontFamily,label:e.label}}function ul(e,t){return e<t?-1:e>t?1:e>=t?0:NaN}var cl,pl;1===(cl=ul).length&&(pl=cl,cl=function(e,t){return ul(pl(e),t)});var dl="$";function fl(){}function ml(e,t){var n=new fl;if(e instanceof fl)e.each(function(e,t){n.set(t,e)});else if(Array.isArray(e)){var r,i=-1,o=e.length;if(null==t)for(;++i<o;)n.set(i,e[i]);else for(;++i<o;)n.set(t(r=e[i],i,e),r)}else if(e)for(var a in e)n.set(a,e[a]);return n}function hl(){}fl.prototype=ml.prototype={constructor:fl,has:function(e){return dl+e in this},get:function(e){return this[dl+e]},set:function(e,t){return this[dl+e]=t,this},remove:function(e){var t=dl+e;return t in this&&delete this[t]},clear:function(){for(var e in this)e[0]===dl&&delete this[e]},keys:function(){var e=[];for(var t in this)t[0]===dl&&e.push(t.slice(1));return e},values:function(){var e=[];for(var t in this)t[0]===dl&&e.push(this[t]);return e},entries:function(){var e=[];for(var t in this)t[0]===dl&&e.push({key:t.slice(1),value:this[t]});return e},size:function(){var e=0;for(var t in this)t[0]===dl&&++e;return e},empty:function(){for(var e in this)if(e[0]===dl)return!1;return!0},each:function(e){for(var t in this)t[0]===dl&&e(this[t],t.slice(1),this)}};var yl=ml.prototype;hl.prototype={constructor:hl,has:yl.has,add:function(e){return this[dl+(e+="")]=e,this},remove:yl.remove,clear:yl.clear,values:yl.keys,size:yl.size,empty:yl.empty,each:yl.each},Ws.bind(null,!0);const gl=[[2,4,6],[2,4],[3]],vl=[,[,,[[1,2]],[[1,2,3],[1,3]],[[1,2,4],[1,4]],[[1,2,4],[1,5]],[[1,2,4,6],[2,4,6],[1,3,6],[1,6]],[[1,2,4,6],[2,4,6],[1,3,6],[1,7]],[[1,2,4,8],[2,4,8],[1,8]],[[1,2,4,8],[2,4,8],[1,3,9],[1,9]],[[1,2,4,6,10],[1,2,4,10],[1,3,10],[3,10],[1,10]]],[,,,[[2,3]],[[2,3,4],[2,4]],[[2,3,4],[2,4],[2,5]],[[2,4,6],[2,6]],[[2,4,6],[2,6],[2,7]],[[2,4,8],[2,8]],[[2,4,8],[2,8],[2,9]],[[2,4,6,10],[2,4,10],[5,10],[3,10]]],[,,,,[[3,4]],[[3,4,5],[3,5]],[[3,4,5,6],[3,6]],[[3,4,5,6],[3,5,7],[3,7]],[[3,4,5,6,8],[3,5,7],[4,8],[3,8]],[[3,4,5,6,8],[3,4,6,9],[3,4,6,8],[3,6,9],[4,8],[3,9]],[[4,6,10],[5,10],[3,10]]],[,,,,,[[4,5]],[[4,5,6],[4,6]],[[4,5,6,7],[4,5,6],[4,6]],[[4,5,6,7,8],[4,5,6,7],[4,6,8],[4,8]],[[4,5,6,7,8],[4,6,9],[4,6,8],[4,8]],[[4,6,10],[5,7,9],[5,10],[4,10]]],[,,,,,,[[5,6]],[[5,6,7],[5,7]],[[5,6,7,8],[5,6,7],[6,8]],[[5,6,7,8,9],[5,6,7,8],[5,7,9],[5,9]],[[6,8,10],[5,10]]],[,,,,,,,[[6,7]],[[6,7,8],[6,8]],[[6,7,8,9],[6,7,8],[6,9]],[[6,7,8,9,10],[6,8,10],[6,10]]],[,,,,,,,,[[7,8]],[[7,8,9],[7,9]],[[7,8,9,10],[8,10],[7,10],[7,9]]],[,,,,,,,,,[[8,9]],[[8,9,10],[8,10]]],[,,,,,,,,,,[[9,10]]]];function bl(e,t,n){const r=e?e.length:0;let i,o=void 0===t?Number.MAX_VALUE:e[0]/t;for(i=1;i<r;i++)o=Math.min(o,e[i]/e[i-1]);void 0!==n&&(o=Math.min(o,n/e[r-1])),e.splice(0,0,o)}function xl(e,t,n){let r;const i=e?e.length:0;for(r=0;r<i;r++)bl(e[r],t,n)}!function(){let e,t;for(xl(gl,1,10),e=0;e<vl.length;e++)if(vl[e])for(t=0;t<vl[e].length;t++)Array.isArray(vl[e][t])&&xl(vl[e][t])}();var ql={dataRelatedPropertiesPaths:["qHyperCube.qGrandTotalRow","qHyperCube.qHasOtherValues","qHyperCube.qSize","qHyperCube.qDimensionInfo[].qAttrDimInfo","qHyperCube.qDimensionInfo[].qAttrExprInfo","qHyperCube.qDimensionInfo[].qCardinalities","qHyperCube.qDimensionInfo[].qMax","qHyperCube.qDimensionInfo[].qMin","qHyperCube.qDimensionInfo[].qStateCounts","qHyperCube.qMeasureInfo[].qApprMaxGlyphCount","qHyperCube.qMeasureInfo[].qAttrExprInfo","qHyperCube.qMeasureInfo[].qMax","qHyperCube.qMeasureInfo[].qMin","qHyperCube.qMeasureInfo[].qTrendLines","qHyperCube.qTreeNodesOnDim","qSelectionInfo","plugins[].validMeasureValue","plugins[].labelBackgroundColor","plugins[].labelColor","plugins[].hasBackground","plugins[].maxLabelWidth","plugins[].points[].validMeasureValue","plugins[].points[].labelBackgroundColor","plugins[].points[].labelColor","plugins[].points[].hasBackground","plugins[].points[].maxLabelWidth"]};function Dl(e){const{qHyperCube:t,...n}=e,{qAxisData:r,qDataPages:i,qStackedDataPages:o,qTreeDataPages:a,...s}=t,l=Ws(!0,{},{...n,qHyperCube:{...s}}),{dataRelatedPropertiesPaths:u}=ql;function c(e,t){const n=t.indexOf("[]");if(-1===n)return void(void 0!==ji(e,t)&&Vi(e,t,void 0));const r=t.substring(0,n),i=t.substring(n+2),o=i.startsWith(".")?i.substring(1):i;ji(e,r,[]).forEach(e=>{o&&c(e,o)})}return u.forEach(e=>{c(l,e)}),l}var Sl={axes:{trackBy:function({isTime:e,isContinuous:t,isMeasure:n,isMajor:r}){return i=>{if(e||t||n){if("line"===i.type)return i.tickValue??"axis";if("text"===i.type)return`${i.tickValue} ${i.text}`;if("container"===i.type){const e=i.children.filter(e=>"text"===e.type).map(e=>e.text);return`${i.data.value} ${e.join("")}`}return Math.random()}if(r){if("line"===i.type&&void 0===i.tickValue)return"axis";const e=i.transform&&i.transform.match(/rotate/gi)?"rotated":"horizontal";return`${i.data.group?`${i.data.group.value} `:""}${i.data.value} ${i.text} ${e}`}return Math.random()}},compensateForLayoutChanges:function({isMeasure:e,isTime:t,isContinuous:n,isHorizontal:r,dock:i}){return({currentNodes:o,currentRect:a,previousRect:s})=>{const l=a.x-s.x,u=a.y-s.y,c=a.width-s.width,p=a.height-s.height;e?("left"===i&&o.forEach(e=>{"line"===e.type?(e.x1+=c,e.x2+=c):"text"===e.type&&(e.x+=c)}),"left"!==i&&"right"!==i||o.forEach(e=>{"line"===e.type&&(e.x1===e.x2?(e.y1=a.y,e.y2=e.y1+a.height):(Math.round(e.y1)<a.y||e.y1>a.y+a.height)&&(e.strokeWidth=0)),"text"===e.type&&(e.y<a.y||e.y>a.y+a.height)&&(e.fontSize="1px","#"===e.fill?.[0]&&(e.fill=`${e.fill.slice(0,1)}00${e.fill.slice(1)}`))}),"top"!==i&&"bottom"!==i||o.forEach(e=>{"line"===e.type&&(e.y1===e.y2?(e.x1=a.x,e.x2=e.x1+a.width):(Math.round(e.x1)<a.x||e.x1>a.x+a.width)&&(e.strokeWidth=0)),"text"===e.type&&(e.x<a.x||e.x>a.x+a.width)&&(e.fontSize="1px","#"===e.fill?.[0]&&(e.fill=`${e.fill.slice(0,1)}00${e.fill.slice(1)}`))})):t?o.forEach(e=>{"line"===e.type?e.y1===e.y2?e.x2+=c:e.x1===e.x2&&(e.x1-=l,e.x2-=l):"text"===e.type&&(e.x-=l)}):n||r?o.forEach(e=>{"line"===e.type&&e.y1===e.y2&&(e.x1+=l,e.x2+=l+c)}):o.forEach(e=>{"line"===e.type&&e.x1===e.x2&&(e.y1+=u,e.y2+=u+p)})}}},bars:{trackBy:function(e){return e.data.typeIndex?`${e.data.value} ${e.data.typeIndex.value}`:e.data.measureIndex?`${e.data.value} ${e.data.measureIndex.value}`:e.data.group?`${e.data.value} ${e.data.group.value}`:e.data.stack?`${e.data.value} ${e.data.stack.value}`:`${e.data.value}`},compensateForLayoutChanges:function({currentNodes:e,currentRect:t,previousRect:n}){const r=t.x-n.x,i=t.y-n.y;0===r&&0===i||e.forEach(e=>{e.children&&e.children.length>0&&e.children.forEach(e=>{void 0!==e.x&&void 0!==e.y?(e.x-=r,e.y-=i):e.transform=`translate(${-r}, ${-i})`})})}},barOobs:{compensateForLayoutChanges:function({currentNodes:e,currentRect:t,previousRect:n}){const r=t.x-n.x;0===t.y-n.y&&0===r||e.forEach(e=>{e.children&&e.children.length>0&&e.children.forEach(e=>{e.opacity=0})})}},labels:{trackBy:function(e){if("rect"===e.type)return"-3"===e.data?Math.random():`${e.type} ${e.data} ${e.rotation}`;const t=e.transform&&e.transform.match(/rotate/gi)?"rotated":"horizontal";return`${e.type} ${e.data} ${e.text} ${t}`},compensateForLayoutChanges:function({currentNodes:e,currentRect:t,previousRect:n}){const r=t.x-n.x,i=t.y-n.y;0===r&&0===i||e.forEach(e=>{e.transform&&e.transform.match(/rotate\(-90/gi)?(e.x+=i,e.y-=r):(e.x-=r,e.y-=i)})},linkData:function(e){return e.data.measureIndex?`${e.data.value} ${e.data.measureIndex.value}`:e.data.group?`${e.data.value} ${e.data.group.value}`:e.data.stack?`${e.data.value} ${e.data.stack.value}`:`${e.data.value}`}},lines:{trackBy:function(e){return"line"===e.type?e.value??Math.random():"path"===e.type?`${e.generatorType} ${e.layerObj.id} ${e.data.source.key}`:Math.random()},compensateForLayoutChanges:function({currentNodes:e,currentRect:t,previousRect:n}){const r=t.x-n.x,i=t.y-n.y;e.forEach(e=>{if(void 0!==e.x1&&void 0!==e.y1)e.y1===e.y2?(e.x2=e.x1+t.width,e.y1-=i,e.y2-=i):e.x1===e.x2&&(e.y2=e.y1+t.height,e.x1-=r,e.x2-=r);else{const t="x"===e.major.p?r/e.major.size:i/e.major.size,n="y"===e.minor.p?i/e.minor.size:r/e.minor.size;e.points.forEach(e=>{e.modified||(e.major-=t,e.minor-=n,e.minor0-=n,e.modified=!0)})}})}},lineOobs:{compensateForLayoutChanges:function({currentNodes:e,currentRect:t,previousRect:n}){const r=t.x-n.x;0===t.y-n.y&&0===r||e.forEach(e=>{e.opacity=0})}},markers:{trackBy:function(e){return e.data.line?`${e.data.line.value} ${e.data.major.value}`:`${e.data.major.value}`},compensateForLayoutChanges:function({currentNodes:e,currentRect:t,previousRect:n}){const r=t.x-n.x,i=t.y-n.y;0===r&&0===i||e.forEach(e=>{switch(e.type){case"circle":e.cx-=r,e.cy-=i;break;case"rect":e.x-=r,e.y-=i;break;case"path":e.transform=`translate(${-r}, ${-i})`}})}},points:{trackBy:function(e){return e.data.line?`${e.data.line.value} ${e.data.major.value}`:`${e.data.major.value}`},compensateForLayoutChanges:function({currentNodes:e,currentRect:t,previousRect:n}){const r=t.x-n.x,i=t.y-n.y;0===r&&0===i||e.forEach(e=>{"image"===e.type?(e.x-=r,e.y-=i):(e.cx-=r,e.cy-=i)})}},refLineLabels:{trackBy:function(e){if(void 0!==e.value){if("rect"===e.type)return`${e.value}`;if("text"===e.type)return`${e.value} ${e.text}`}return Math.random()},compensateForLayoutChanges:function({currentNodes:e,currentRect:t,previousRect:n}){const r=t.x-n.x,i=t.y-n.y,o=t.width-n.width,a=t.height-n.height;let s=-r,l=-i;e.forEach(e=>{switch(e.dock){case"right":r>0&&(s=t.width);break;case"left":o<0&&(s=-n.width);break;case"top":a<0&&(l=-n.height);break;case"bottom":i>0&&(l=t.height)}switch(e.type){case"text":case"rect":e.x+=s,e.y+=l;break;case"circle":e.cx+=s,e.cy+=l;break;case"path":e.transform=`translate(${s}, ${l})`}})}},shadowBars:{trackBy:function(){return Math.random()}},cacheProperties:function({viewCache:e,layout:t}){const n=Dl(t);e.set("dataIndependentProperties",JSON.stringify(n))},propertiesHaveChanged:function({viewCache:e,layout:t}){const n=Dl(t);return e.get("dataIndependentProperties")!==JSON.stringify(n)},nonUpdatingNode:{trackBy:function(){return Math.random()}}};function Cl(e,t=!1){const n=t?"IM_5791_SVG_LABEL_RENDERING":"IM_4962_SVG_CHART_LABELS";if(e?.isEnabled(n))return/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)?void 0:"svg"}var wl=class e{constructor(e,t){this._key=e,this._value=t}getKey(){return this._key}getValue(){return this._value}equals(t){return t instanceof e&&(this._key===t._key&&this._value===t._value)}static newInstanceIfNeeded(){let t,n,r=arguments[0];return"string"==typeof arguments[1]?(t=arguments[1],n=r.length):(n=arguments[1],t=arguments[2]),t&&r?(r.length>n&&(r=r.substr(0,n)),new e(r,t)):null}},El=class e{setValue(e){this._nextMap=null,this._value=e}getNextNode(e){return this._nextMap?this._nextMap[e]:null}put(t,n,r){let i,o;if(t.length===n)return o=this._value,this.setValue(r),o;const a=t.charAt(n);return this._nextMap?(i=this._nextMap[a],i||(i=new e,this._nextMap[a]=i)):(this._nextMap={},i=new e,this._nextMap[a]=i),i.put(t,n+1,r)}get(e,t){if(e.length<=t)return this._value;const n=this.getNextNode(e.charAt(t));return n?n.get(e,t+1):null}getLongestMatch(e,t){if(e.length<=t)return wl.newInstanceIfNeeded(e,this._value);const n=this.getNextNode(e.charAt(t));if(!n)return wl.newInstanceIfNeeded(e,t,this._value);const r=n.getLongestMatch(e,t+1);return r||wl.newInstanceIfNeeded(e,t,this._value)}},Il=class{constructor(){this.clear()}getLongestMatch(e){return this.root&&e?this.root.getLongestMatch(e,0):null}getMaxKeyLength(){return this.maxKeyLen}clear(){this.root=null,this.maxKeyLen=0,this.size=0}put(e,t){this.root||(this.root=new El);const n=this.root.put(e,0,t);return n||(e.length>this.maxKeyLen&&(this.maxKeyLen=e.length),this.size++,null)}};(()=>{const e=[],t=[],n=new Il;let r,i,o;for(r in e["""]="34",e["&"]="38",e["<"]="60",e[">"]="62",e[" "]="160",e["¡"]="161",e["¢"]="162",e["£"]="163",e["¤"]="164",e["¥"]="165",e["¦"]="166",e["§"]="167",e["¨"]="168",e["©"]="169",e["ª"]="170",e["«"]="171",e["¬"]="172",e["­"]="173",e["®"]="174",e["¯"]="175",e["°"]="176",e["±"]="177",e["²"]="178",e["³"]="179",e["´"]="180",e["µ"]="181",e["¶"]="182",e["·"]="183",e["¸"]="184",e["¹"]="185",e["º"]="186",e["»"]="187",e["¼"]="188",e["½"]="189",e["¾"]="190",e["¿"]="191",e["À"]="192",e["Á"]="193",e["Â"]="194",e["Ã"]="195",e["Ä"]="196",e["Å"]="197",e["Æ"]="198",e["Ç"]="199",e["È"]="200",e["É"]="201",e["Ê"]="202",e["Ë"]="203",e["Ì"]="204",e["Í"]="205",e["Î"]="206",e["Ï"]="207",e["Ð"]="208",e["Ñ"]="209",e["Ò"]="210",e["Ó"]="211",e["Ô"]="212",e["Õ"]="213",e["Ö"]="214",e["×"]="215",e["Ø"]="216",e["Ù"]="217",e["Ú"]="218",e["Û"]="219",e["Ü"]="220",e["Ý"]="221",e["Þ"]="222",e["ß"]="223",e["à"]="224",e["á"]="225",e["â"]="226",e["ã"]="227",e["ä"]="228",e["å"]="229",e["æ"]="230",e["ç"]="231",e["è"]="232",e["é"]="233",e["ê"]="234",e["ë"]="235",e["ì"]="236",e["í"]="237",e["î"]="238",e["ï"]="239",e["ð"]="240",e["ñ"]="241",e["ò"]="242",e["ó"]="243",e["ô"]="244",e["õ"]="245",e["ö"]="246",e["÷"]="247",e["ø"]="248",e["ù"]="249",e["ú"]="250",e["û"]="251",e["ü"]="252",e["ý"]="253",e["þ"]="254",e["ÿ"]="255",e["&OElig"]="338",e["&oelig"]="339",e["&Scaron"]="352",e["&scaron"]="353",e["&Yuml"]="376",e["&fnof"]="402",e["&circ"]="710",e["&tilde"]="732",e["&Alpha"]="913",e["&Beta"]="914",e["&Gamma"]="915",e["&Delta"]="916",e["&Epsilon"]="917",e["&Zeta"]="918",e["&Eta"]="919",e["&Theta"]="920",e["&Iota"]="921",e["&Kappa"]="922",e["&Lambda"]="923",e["&Mu"]="924",e["&Nu"]="925",e["&Xi"]="926",e["&Omicron"]="927",e["&Pi"]="928",e["&Rho"]="929",e["&Sigma"]="931",e["&Tau"]="932",e["&Upsilon"]="933",e["&Phi"]="934",e["&Chi"]="935",e["&Psi"]="936",e["&Omega"]="937",e["&alpha"]="945",e["&beta"]="946",e["&gamma"]="947",e["&delta"]="948",e["&epsilon"]="949",e["&zeta"]="950",e["&eta"]="951",e["&theta"]="952",e["&iota"]="953",e["&kappa"]="954",e["&lambda"]="955",e["&mu"]="956",e["&nu"]="957",e["&xi"]="958",e["&omicron"]="959",e["&pi"]="960",e["&rho"]="961",e["&sigmaf"]="962",e["&sigma"]="963",e["&tau"]="964",e["&upsilon"]="965",e["&phi"]="966",e["&chi"]="967",e["&psi"]="968",e["&omega"]="969",e["&thetasym"]="977",e["&upsih"]="978",e["&piv"]="982",e["&ensp"]="8194",e["&emsp"]="8195",e["&thinsp"]="8201",e["&zwnj"]="8204",e["&zwj"]="8205",e["&lrm"]="8206",e["&rlm"]="8207",e["&ndash"]="8211",e["&mdash"]="8212",e["&lsquo"]="8216",e["&rsquo"]="8217",e["&sbquo"]="8218",e["&ldquo"]="8220",e["&rdquo"]="8221",e["&bdquo"]="8222",e["&dagger"]="8224",e["&Dagger"]="8225",e["&bull"]="8226",e["&hellip"]="8230",e["&permil"]="8240",e["&prime"]="8242",e["&Prime"]="8243",e["&lsaquo"]="8249",e["&rsaquo"]="8250",e["&oline"]="8254",e["&frasl"]="8260",e["&euro"]="8364",e["&image"]="8365",e["&weierp"]="8472",e["&real"]="8476",e["&trade"]="8482",e["&alefsym"]="8501",e["&larr"]="8592",e["&uarr"]="8593",e["&rarr"]="8594",e["&darr"]="8595",e["&harr"]="8596",e["&crarr"]="8629",e["&lArr"]="8656",e["&uArr"]="8657",e["&rArr"]="8658",e["&dArr"]="8659",e["&hArr"]="8660",e["&forall"]="8704",e["&part"]="8706",e["&exist"]="8707",e["&empty"]="8709",e["&nabla"]="8711",e["&isin"]="8712",e["¬in"]="8713",e["&ni"]="8715",e["&prod"]="8719",e["&sum"]="8721",e["&minus"]="8722",e["&lowast"]="8727",e["&radic"]="8730",e["&prop"]="8733",e["&infin"]="8734",e["&ang"]="8736",e["&and"]="8743",e["&or"]="8744",e["&cap"]="8745",e["&cup"]="8746",e["&int"]="8747",e["&there4"]="8756",e["&sim"]="8764",e["&cong"]="8773",e["&asymp"]="8776",e["&ne"]="8800",e["&equiv"]="8801",e["&le"]="8804",e["&ge"]="8805",e["&sub"]="8834",e["&sup"]="8835",e["&nsub"]="8836",e["&sube"]="8838",e["&supe"]="8839",e["&oplus"]="8853",e["&otimes"]="8855",e["&perp"]="8869",e["&sdot"]="8901",e["&lceil"]="8968",e["&rceil"]="8969",e["&lfloor"]="8970",e["&rfloor"]="8971",e["&lang"]="9001",e["&rang"]="9002",e["&loz"]="9674",e["&spades"]="9824",e["&clubs"]="9827",e["&hearts"]="9829",e["&diams"]="9830",e)"function"!=typeof e[r]&&e.hasOwnProperty(r)&&(t[e[r]]=r);for(i in t)"function"!=typeof t[i]&&t.hasOwnProperty(i)&&(o=t[i].toLowerCase().substr(1),n.put(o,String.fromCharCode(i)))})(),"undefined"!=typeof document&&document.createElement("div");for(let e=0;e<255;e++)e>=48&&e<=57||e>=65&&e<=90||e>=97&&e<=122||e.toString(16);const Al={CUSTOM:{EXPRESSION:"customTooltipExpression",TITLE:"customTooltipTitle",DESCRIPTION:"customTooltipDescription",QUARANTINE:"customTooltip",IMAGES:"customTooltipImages"},CHART:{CONTAINER_ID:"tooltipContainerId",STATE:"customTooltipSessionState",CHART_OBJECT_ID:"customTooltipSessionObjectId",CHART_PARENT_TYPE:"TooltipChartParent",CHART_CHILD_TYPE:"TooltipChart",STYLE:{small:"140px",medium:"200px",large:"340px"}}};function Ml(e){const t=e.split("/");return"qmem:"===t[0]&&""===t[1]}const kl={getImageSize(e,t){let n;function r(){n&&(clearTimeout(n),n=null)}function i(e){const t=e;t.onload=null,t.onerror=null,r()}const o={small:50,medium:200,large:340,original:340};return new Promise(a=>{const s=new Image;s.referrerPolicy="no-referrer",s.onload=()=>{let e;const{height:n,width:l}=s,u=o[t]*(n>l?1:n/l),c=o[t]*(l>n?1:l/n);!n||!l||0===n&&0===l?(e={height:20,width:20,imageError:!0},i(s)):"original"===t?(e={height:Math.min(u,n),width:Math.min(c,l)},r()):(e={height:u,width:c},r()),a(e)},s.onerror=()=>{i(s),a({height:20,width:20,imageError:!0})},s.src=e,n=setTimeout(()=>{i(s),a({height:20,width:20,imageError:!0})},3e3)})}};async function Ll(e,t,n){let r=e.ref.qStaticContentUrl.qUrl;const i=function(e){let t,n,r,i,o,a;if(e&&(e.session?.options||e.enigmaModel?.session?.sessionConfig||e.session?.config?.url)){if(t=e.session.options||e.enigmaModel?.session.sessionConfig,!t){t=e.session?.config;const n=new URL(t.url);t.host=n.hostname,t.port=n.port,t.isSecure="wss:"===n.protocol}return a=void 0!==t.secure?t.secure:t.isSecure,n=a?"https://":"http://",r=t.host||"localhost",i=t.port?`:${t.port}`:"",o=t.prefix?t.prefix:"/","/"!==o[o.length-1]&&(o=`${o}/`),n+r+i+o}return""}(n);i&&(!function(e,t){const n=e.replace(t,"").replace(/^\.\.\//i,"/");n[0]}(r,i),r=r.replace(/"/g,'\\"'),r=r.replace(/'/g,"\\'"),r=function(e,t){return t+("/"===e[0]?e.substr(1):e)}(r,i));const{height:o,width:a,imageError:s}=await kl.getImageSize(r,t);return{src:r,size:t,height:o,width:a,imageError:s}}async function Ol(e,t,n,r){const{app:i,flags:o}=t,a=e.layout?.tooltip?.imageComponents;if(!a)return[];const[s]=a,l=s.size||"small",u=s.type||"media";let c=-1;for(let e=0;e<n.length;e++)if(n[e].cId===s.cId){c=e;break}const p=r.data?.customTooltipAttrExps?.value||[];let d;if(-1!==c&&p[c]&&(d=p[c]),"media"===u&&s.ref?.qStaticContentUrl?.qUrl)return Ll(s,l,i);if("url"===u)return async function(e,t,n,r,i){let o,a=n.ref;if(i&&i.label&&(a=i.label),t.isEnabled("IMAGE_BUNDLE_LOAD")&&e?.getImage&&Ml(a))try{const t=`data:image/png;base64, ${await e.getImage(a)}`,{height:n,width:i,imageError:s}=await kl.getImageSize(t,r);o={src:t,size:r,height:n,width:i,imageError:s}}catch(e){}else{const{height:e,width:t,imageError:n}=await kl.getImageSize(a,r);o={src:a,size:r,height:e,width:t,imageError:n}}return o}(i,o,s,l,d);if(o.isEnabled("IMAGE_BUNDLE_LOAD")&&"field"===u&&d&&d.label){return async function(e,t,n,r){let i;const o=r.label,a=`qmem://${t.qFallbackTitle}/${o}`;if(Ml(a))try{const t=await e.getImage(a);if(t){const e=`data:image/png;base64, ${t}`,{height:r,width:o,imageError:a}=await kl.getImageSize(e,n);i={src:e,size:n,height:r,width:o,imageError:a}}}catch(e){}return i}(i,n[c],l,d)}return[]}const Tl={async addImagesToTheNodes({customTooltipModel:e,nodes:t,attrExps:n,opts:r}){const i=t,o=[];for(let t=0;t<i.length;t++)o.push(Ol(e,r,n,i[t]));const a=await Promise.all(o);for(let e=0;e<i.length;e++)i[e].data.customTooltipImages=[a[e]];return i},checkIfPromisesExist({customTooltipModel:e}){const t=e.layout?.tooltip?.imageComponents;return!!t&&t.length>0}},Nl={async handlePromises({customTooltipModel:e,nodes:t,attrExps:n,opts:r}){let i=t;return i=await Tl.addImagesToTheNodes({customTooltipModel:e,nodes:t,attrExps:n,opts:r}),i},checkIfPromisesExist:({customTooltipModel:e})=>Tl.checkIfPromisesExist({customTooltipModel:e})};const Pl=(e,t)=>{const n=e?.qHyperCubeDef?.qDimensions,r=e?.qHyperCubeDef?.qMeasures,i=e?.qHyperCubeDef?.qInterColumnSortOrder,o=t;return{qInfo:{qType:Al.CHART.CHART_PARENT_TYPE,qId:Al.CHART.CHART_OBJECT_ID},qHyperCubeDef:{qDimensions:n,qMeasures:r,qInterColumnSortOrder:i,qInitialDataFetch:[{qWidth:0,qHeight:0}]},qStateName:o}},Fl=e=>{const t=e.tooltip?.chart?.object?.refId;return{qInfo:{qType:Al.CHART.CHART_CHILD_TYPE},qExtendsId:t}};const Rl={createContainer:({ctx:e,layout:t})=>{if(!(t.qHyperCube?.qDimensionInfo?.length<=0))return function(e,t){const n=t.tooltip?.chart?.style?.size??"medium",r=Al.CHART.STYLE[n];return[{content:[e.h("div",{style:{display:"flex",width:r,height:r,backgroundColor:"#FFFFFF",borderRadius:"5px",padding:"2px",color:"#595959"},colspan:2,id:Al.CHART.CONTAINER_ID})],colspan:2,style:{"text-align":e.rtl?"right":"left","max-width":r}},{}]}(e,t)},show:async({app:e,properties:t,selectedNodes:n,dimIndex:r,customTooltipModel:i,rtl:o})=>{const a=i,s=t?.tooltip?.chart?.object?.refId;if(a?.embed&&e.removeSessionAlternateState&&e.addSessionAlternateState&&s&&!(t.qHyperCubeDef.qDimensions.length<=0)){await Rl.hide({app:e,customTooltipModel:i});try{await async function({app:e,properties:t,customTooltipModel:n}){const r=n,i=Al.CHART.STATE,o=t.qStateName;r.miniChartToken.alternateState||(r.miniChartToken.alternateState=i,await e.addSessionAlternateState(i,o),r.miniChartToken.alternateState=i)}({app:e,properties:t,customTooltipModel:i});const s=await async function({app:e,properties:t,customTooltipModel:n}){const r=n;r.miniChartToken.sessionObj?.id&&await e.destroySessionObject(r.miniChartToken.sessionObj.id);const i=Al.CHART.STATE,o=Pl(t,i),a=await e.createSessionObject(o),s=Fl(t);if(a.id!==Al.CHART.CHART_OBJECT_ID)return void e.destroySessionObject(a.id);r.miniChartToken.sessionObj=a;const l=await a.createChild(s);if(r.miniChartToken.sessionObj&&r.miniChartToken.sessionObj.id===a.id)return r.miniChartToken.model=l,l;e.destroySessionObject(a.id)}({app:e,properties:t,customTooltipModel:i});if(a.miniChartToken.alternateState&&a.miniChartToken.sessionObj&&s){const e=n.length>0&&void 0!==n[0].data?.value?[n[0].data?.value]:[],s=void 0!==r?r:t.qHyperCubeDef.qDimensions.length-1;if(2===t.qHyperCubeDef.qDimensions.length&&void 0===r&&n.length>0){const e=n[0].data.selectionOuterDimension??n[0].data.selectionDimension;if(e?.source?.field){const t=e?.source?.field.split("/"),n=t[t.length-1],r=void 0!==e.value?[e.value]:[];r.length>0&&void 0!==n&&a.miniChartToken.sessionObj.selectHyperCubeValues("/qHyperCubeDef",Number(n),r,!1)}}e.length>0&&a.miniChartToken.sessionObj.selectHyperCubeValues("/qHyperCubeDef",s,e,!1);const l=document.getElementById(Al.CHART.CONTAINER_ID),u={direction:o?"rtl":"ltr",isReadonly:!0,isPopover:!0,navigation:!1,selections:!1};a.miniChartToken.vis=await i.embed.render({element:l,model:a.miniChartToken.model,options:u,id:a.miniChartToken.model?.id,type:a.miniChartToken.model?.genericType})}}catch(t){await Rl.hide({app:e,customTooltipModel:i})}}},hide:async({app:e,customTooltipModel:t})=>{const n=t;n?.embed&&(Rl.destroyVisualization({customTooltipModel:t}),await e.destroySessionObject(Al.CHART.CHART_OBJECT_ID),n.miniChartToken.sessionObj=void 0,await async function({app:e,customTooltipModel:t}){const n=t,r=Al.CHART.STATE;n.miniChartToken.alternateState=void 0,await e.removeSessionAlternateState(r)}({app:e,customTooltipModel:t}))},destroyVisualization:({customTooltipModel:e})=>{const t=e;"function"==typeof t.miniChartToken?.vis?.destroy&&(t.miniChartToken.vis.destroy(),t.miniChartToken.vis=void 0)}};function jl(e){const t=e.qHyperCubeDef?e.qHyperCubeDef.qDimensions:e.qHyperCube.qDimensionInfo;if(t&&t.length>0)return t}function Hl(){const{EXPRESSION:e,TITLE:t,DESCRIPTION:n,IMAGES:r}=Al.CUSTOM,i={};return i[e]=!0,i[t]=!0,i[n]=!0,i[r]=!0,i}function Vl(e){const t=Hl();return e.filter(e=>t[e.id])}const zl={getNodes(e,t){const n=function(e,t){let n=0,r=0;e.center?(n+=e.center.x,r+=e.center.y):(n+=e.clientX,r+=e.clientY);const i=t.element.getBoundingClientRect();return{cx:n-i.left,cy:r-i.top}}(e,t);return t.shapesAt({x:n.cx,y:n.cy})},getDataNodes(e,t){let n,r=[];const i={container:{bar:!0,"bullet-axis":!0},circle:{"point-component":!0}};return t.forEach(t=>{const o=t.data?.selectionDimension??t.data;if(!o||t.data?.customTooltipAttrExps||i[t.type]){if(t.data?.customTooltipAttrExps&&!t.data.customTooltipImages){const e=t;e.data.customTooltipImages=[],r.push(e)}}else{n||(n=[],Object.keys(i).forEach(t=>{n=n.concat(e.findShapes(t).filter(e=>e.data&&e.data.customTooltipAttrExps&&!e.data.customTooltipImages&&i[t][e.key]))}));const t=n.filter(e=>{const t=e.data.stack??e.data.selectionOuterDimension??e.data.selectionDimension;return t&&t.value===o.value&&t.label===o.label});t.length>0&&(r=r.concat(t[0]))}}),r},displayTooltip(e,t,{nodes:n,opts:r={},customTooltipModel:i,extractedNodes:o=[],hide:a}){if(i&&!a){const{layout:a,chart:s}=i,{attrExps:l}=zl.getAttrExprData(a);o.length||n.length?Nl.handlePromises({customTooltipModel:i,nodes:zl.getDataNodes(s,o.length>0?o:n),attrExps:l,opts:r}).then(()=>{t.emit("show",e,n.length?{nodes:n}:void 0)}):t.emit("show",e,n.length?{nodes:n}:void 0)}else i?.miniChartToken?.alternateState&&Rl.hide({app:r.app,customTooltipModel:i}),t.emit("hide")},checkIfPromisesExist:({customTooltipModel:e})=>Nl.checkIfPromisesExist({customTooltipModel:e}),getAttrExps(e,t){const n=t,r=e.qHyperCubeDef?.qDimensions?"qAttributeExpressions":"qAttrExprInfo";return n[r]||(n[r]=[]),n[r]},getAttrExprData(e){let t=[],n="";const r=e.qHyperCube?.qDimensionInfo||[];if(r.length>0){const i=r.length-1;t=e.qHyperCube?.qDimensionInfo?.[i]?.qAttrExprInfo||[],n=`qDimensionInfo/${i}/qAttrExprInfo`}return{attrExps:t,fieldPath:n}},quarantineCustomTooltipAttrs(e,t={}){const n=e.qLayoutExclude?.quarantine?.[Al.CUSTOM.QUARANTINE];if(!n){!function(e,t){const n=t;let r=n.qLayoutExclude;r||(n.qLayoutExclude={quarantine:{}},r=n.qLayoutExclude),r.quarantine||(r.quarantine={}),r.quarantine[Al.CUSTOM.QUARANTINE]=[],e.forEach(e=>{r.quarantine[Al.CUSTOM.QUARANTINE].push(e)}),n.qLayoutExclude=r}(Vl(t.qAttributeExpressions||[]),e)}},unquarantineCustomTooltipAttrs(e){const t=e,n=e.qLayoutExclude?.quarantine?.[Al.CUSTOM.QUARANTINE];n&&delete t.qLayoutExclude.quarantine[Al.CUSTOM.QUARANTINE]},setAttrsFromQuarantine(e,t){const n=jl(e);if(!n)return;const r=void 0!==t?t:n.length-1;if(!n[r])return;const i=this.getAttrExps(e,n[r]);if(0===Vl(i).length){const t=e.qLayoutExclude?.quarantine?.customTooltip||[],n=[...i,...t],o=e;o.qHyperCubeDef?o.qHyperCubeDef.qDimensions[r].qAttributeExpressions=n:o.qHyperCube.qDimensionInfo[r].qAttrExprInfo=n}},moveCustomTooltipAttrs(e,t={},n=void 0){let r=[];const i=jl(e)||[];[...i,t].forEach(e=>{const t=Vl(e.qAttributeExpressions||[]);t.length>0&&(r=t)});const o=Hl(),a=i.map(e=>{const t=e,n=e.qAttributeExpressions||[];return t.qAttributeExpressions=n.filter(e=>!o[e.id]),t}),s=void 0!==n?n:a.length-1;a.length>0&&(a[s].qAttributeExpressions=a[s].qAttributeExpressions.concat(r));const l=e;e.qHyperCubeDef?l.qHyperCubeDef.qDimensions=a:l.qHyperCube.qDimensionInfo=a},addCallbackCustomTooltip(e){e.qHyperCubeDef.qDimensions.length>1?this.moveCustomTooltipAttrs(e):(this.setAttrsFromQuarantine(e),this.unquarantineCustomTooltipAttrs(e))},moveCallbackCustomTooltip(e,t){1===e.qHyperCubeDef.qDimensions.length&&(this.setAttrsFromQuarantine(e),this.unquarantineCustomTooltipAttrs(e)),e.qHyperCubeDef.qDimensions.length>1&&this.moveCustomTooltipAttrs(e,t)},removeCallbackCustomTooltip(e,t){e.qHyperCubeDef.qDimensions.length>0?this.moveCustomTooltipAttrs(e,t):this.quarantineCustomTooltipAttrs(e,t)},replaceCallbackCustomTooltip(e,t){e.qHyperCubeDef.qDimensions.length>1?this.moveCustomTooltipAttrs(e,t):(this.quarantineCustomTooltipAttrs(e,t),this.setAttrsFromQuarantine(e),this.unquarantineCustomTooltipAttrs(e))},shouldIgnoreDefaultRows:e=>e.tooltip?.hideBasic||0,DEBOUNCE_THRESHOLD:50,getFooterRow:(e,t)=>[{content:e,style:{"font-style":"italic","font-size":"12px","line-height":"16px",color:"rgba(255, 255, 255, 0.6)","text-align":t?"right":"left",direction:il.detectTextDirection(e)},colspan:2},{}],getImageRow(e,t){const n=il.detectTextDirection(e.src),r=[],i={style:{display:"block","margin-left":"auto","margin-right":"auto",overflow:"hidden",width:e.width,height:e.height}};if("original"===e.size||e.imageError){r.push(t.h("span",{style:{display:"inline-block",height:"100%","vertical-align":"middle"}}));const n=e.imageError?`${e.src}?${Math.random()}`:e.src;r.push(t.h("img",{style:{"max-width":e.width,"max-height":e.height,"vertical-align":"middle"},src:n,referrerpolicy:"no-referrer"})),i.style["text-align"]="center",i.style["white-space"]="nowrap"}else i.style["background-size"]="contain",i.style["background-repeat"]="no-repeat",i.style["background-position"]="center",i.style["background-image"]=`url('${e.src}')`;return[{content:[t.h("div",i,r),""],style:{"text-align":t.rtl?"right":"left",direction:n,"max-width":e.width},colspan:2},{}]}};function _l(e,t,n,r){const i=t.qHyperCube?.[n]?.[r]?.qAttrExprInfo||[],o=[],a=e.qSubNodes&&e.qSubNodes[r]?e.qSubNodes[r].qAttrExps:e.qAttrExps;return a?(i.forEach((e,t)=>{const i=a.qValues&&a.qValues[t]?a.qValues[t]:void 0,s=void 0===i?"NaN":function(e,t){let n;switch(e.id){case Al.CUSTOM.EXPRESSION:n="NaN"===t.qNum||e.isCustomFormatted?void 0===t.qText?"NaN":t.qText:t.qNum;break;case Al.CUSTOM.TITLE:case Al.CUSTOM.DESCRIPTION:case Al.CUSTOM.IMAGES:n=void 0===t.qText?e.qFallbackTitle:t.qText;break;default:n="NaN"}return n}(e,i);o.push({source:{key:"qHyperCube",field:`${n}/${r}/qAttrExprInfo/${t}`},label:s,value:"value"})}),o):o}const Bl={getNode(e,{dimensionCount:t}){if(!t||t<1)return;const n=t-1,r="qDimensionInfo";return{field:`${r}/${n}`,value:t=>_l(t,e,r,n)}}};const $l={getCustomAttrExps(e,t,n){const r={customTooltipAttrExpsArr:[],customTooltipInfoAttrExpsArr:[]},i=t.data?.customTooltipAttrExps?.value||[];if(Number.isNaN(i))return r;return function(e,t,n,r){const i={[Al.CUSTOM.TITLE]:!0,[Al.CUSTOM.DESCRIPTION]:!0},{attrExps:o,fieldPath:a}=zl.getAttrExprData(e);return 0===t.length||0===o.length||""===a||o.forEach((e,o)=>{const s=t[o];if(e.id===Al.CUSTOM.EXPRESSION&&s){const t=e.qFallbackTitle,i="NaN"===s.value||e.isCustomFormatted?s.value:n("qHyperCube").field(`${a}/${o}`).formatter()(s.value);r.customTooltipAttrExpsArr.push({label:t,value:i})}else if(i[e.id]&&s){const t="-"!==s.value&&"NaN"!==s.value?s.value:s.label;t&&"undefined"!==t&&r.customTooltipInfoAttrExpsArr.push({...e.id===Al.CUSTOM.TITLE&&{title:t},value:t,id:e.id})}}),r}(n,i.map(t=>ol.getMeasure(e,t)),e,r)}};function Ul({nodes:e,layout:t,dataset:n}){const r=function(e,t,n){const r=[];return e.forEach(e=>{r.push($l.getCustomAttrExps(n,e,t))}),r}(e,t,n);return r.reduce((e,t)=>({customTooltipAttrExpsArr:e.customTooltipAttrExpsArr.concat(t.customTooltipAttrExpsArr),customTooltipInfoAttrExpsArr:e.customTooltipInfoAttrExpsArr.concat(t.customTooltipInfoAttrExpsArr)}),{customTooltipAttrExpsArr:[],customTooltipInfoAttrExpsArr:[]})}function Wl(e){const t=Al.CUSTOM.EXPRESSION,{qNumFormat:n,qLabel:r,qLabelExpression:i,cId:o}=e.qDef;return e.qLibraryId?{qLibraryId:e.qLibraryId,id:t,qNumFormat:n,qLabel:r,qLabelExpression:i,cId:o}:{qExpression:e.qDef.qDef,id:t,qNumFormat:n,qLabel:r,qLabelExpression:i,cId:o}}function Kl(e){const t=e.qHyperCubeDef?.qDimensions;return t[t.length-1].qAttributeExpressions||[]}var Yl={attrExpr:{migrateProperties(e){const t=Ws(!0,{},e),n=t.tooltip?.data?.qHyperCubeDef?.qMeasures||[];let r=Kl(t);return r=function(e,t){return t.concat(e.map(e=>Wl(e)))}(n,r),function(e,t){const n=t.qHyperCubeDef?.qDimensions;n[n.length-1].qAttributeExpressions=e}(r,t),delete t.tooltip?.data,t},getPatches(e){const t=e.tooltip?.data?.qHyperCubeDef?.qMeasures||[],n=e.qHyperCubeDef?.qDimensions.length-1,r=function(e,t,n){let r=e.length;const i=[];return t.forEach(e=>{const t=Wl(e),o=JSON.stringify(t);i.push({qPath:`/qHyperCubeDef/qDimensions/${n}/qAttributeExpressions/${r}`,qOp:"add",qValue:o}),r++}),i.push({qPath:"/tooltip/data",qOp:"remove"}),i}(Kl(e),t,n);return r},checkForBackwardCompatibility:(e,t)=>(e.qMeasureInfo||[]).length>0&&t.length>0,updateProperties(e,t){return new Promise(n=>{const r=t.qHyperCube?.qDimensionInfo||[],i=t.tooltip?.data?.qHyperCube||{},o=t.qMeta?.privileges?.includes("update");e&&e.getEffectiveProperties&&this.checkForBackwardCompatibility(i,r)&&e.getEffectiveProperties().then(t=>{if(o){const r=this.migrateProperties(t);e.setProperties(r).then(()=>{e.app.clearUndoBuffer(),n(!0)})}else{const r=this.getPatches(t);e.applyPatches(r,!0).then(()=>{e.app.clearUndoBuffer(),n(!0)})}}),n(!1)})}}};const{CUSTOM:Gl}=Al;function Jl({flags:e,layout:t,app:n,model:r,picasso:i,chart:o,translator:a,localeInfo:s,embed:l,options:u}){const c={properties:void 0},p=function({layout:e,app:t,picasso:n,model:r,chart:i,translator:o,localeInfo:a,embed:s}){return{layout:e,app:t,picasso:n,model:r,chart:i,translator:o,localeInfo:a,useCustomTooltip:e.tooltip&&!e.tooltip.auto,utils:zl,miniChartToken:{},embed:s}}({layout:t,app:n,model:r,picasso:i,chart:o,translator:a,localeInfo:s,embed:l}),d="rtl"===u.direction,f=()=>{const e=!!c.properties?.qHyperCubeDef?.qDimensions.some(e=>e.qCalcCondition?.qCond?.qv);return!(!t.tooltip||t.tooltip.auto||e)};return{setProperties:e=>{c.properties=e},isEnabled:()=>f(),hideBasic:()=>f()&&ji(t,"tooltip.hideBasic",!1),getAttributes:({dataset:e,nodes:n})=>{const r=Ul({dataset:e,nodes:n,layout:t});return{title:r.customTooltipInfoAttrExpsArr.find(e=>e.id===Gl.TITLE)?.title,description:r.customTooltipInfoAttrExpsArr.find(e=>e.id===Gl.DESCRIPTION)?.value,measures:r.customTooltipAttrExpsArr}},hasImages:()=>zl.checkIfPromisesExist({customTooltipModel:p}),createImageRow:({value:e,h:t})=>zl.getImageRow(e,{h:t,rtl:d}),addImages:({nodes:r})=>{const i=zl.getDataNodes(o,r),{attrExps:a}=zl.getAttrExprData(t);return Nl.handlePromises({customTooltipModel:p,nodes:i,attrExps:a,opts:{flags:e,app:n}})},chart:{isEnabled:()=>!!(f()&&t.tooltip?.chart?.object?.refId&&l&&"function"==typeof r?.getEffectiveProperties),hasLimitation:()=>!!n?.isInModalSelection?.(),createContainer:({h:e})=>Rl.createContainer({layout:t,ctx:{h:e,rtl:d}}),createLimitationRow:()=>zl.getFooterRow(a.get("properties.tooltip.notselectedmessage"),d),show:({nodes:e,properties:t})=>Rl.show({app:n,properties:t,selectedNodes:e,customTooltipModel:p,rtl:d}),hasAlternateState:()=>!!p.miniChartToken?.alternateState,hide:()=>Rl.hide({app:n,customTooltipModel:p}),destroy:()=>Rl.destroyVisualization({customTooltipModel:p})}}}function Zl(e){return{layout:e,keys:{SCALE:{FILL:"fill"},COMPONENT:{DIMENSION_TITLE:"dimension-title",SLICES:"slices",PIE_LABELS:"pie-labels"}}}}function Xl({flags:e,picasso:t,instance:n}){const r=A(),i=M(),o=w(),a=q(),[s,l]=S(),u=k(),c=L(),p=O(),d=x(),f=T(),{qLocaleInfo:m}=N(),h=P();return I(()=>{if(!n)return;a.style.overflow="hidden";const s=function(e){var t,n=e.app,r=e.translator,i={initialized:!1,dimensions:[],measures:[]};return{initialize:(t=vn(Sn().m(function e(t){var o,a,s,l,u,c,p;return Sn().w(function(e){for(;;)switch(e.n){case 0:if(o=t.properties,!i.initialized){e.n=1;break}return e.a(2);case 1:return s=[Xn(a={app:n,translator:r,properties:o}),tr(a)],e.n=2,Promise.all(s);case 2:l=e.v,u=wn(l,2),c=u[0],p=u[1],i.dimensions=c,i.measures=p,i.initialized=!0;case 3:return e.a(2)}},e)})),function(e){return t.apply(this,arguments)}),getAlternatives:function(){return{dimensions:En(i.dimensions),measures:En(i.measures)}}}}({app:i,translator:o}),y=Oi({picasso:n.picasso,model:r,app:i,translator:o,config:{auto:!1,key:"fill"}}),g=function(e){var t=e.picassoInstance,n=e.plugins,r=e.pluginArgs,i=void 0===r?{}:r,o={initialized:!1,definitions:[]};return{initialize:function(){return vn(Sn().m(function e(){var r,a,s,l;return Sn().w(function(e){for(;;)switch(e.n){case 0:if(!o.initialized){e.n=1;break}return e.a(2);case 1:return a=Promise.all(n.filter(function(e){return"custom-component"===e.info.type}).map(function(){var e=vn(Sn().m(function e(n){var r;return Sn().w(function(e){for(;;)switch(e.n){case 0:if(n.info.componentName){e.n=1;break}throw new Error("plugin-service: Custom component is missing componentName");case 1:return e.n=2,n.fn(qn({},i));case 2:if("object"===In(r=e.v)){e.n=3;break}throw new Error("plugin-service: Custom component needs to be an object");case 3:t.component(n.info.componentName,r);case 4:return e.a(2)}},e)}));return function(t){return e.apply(this,arguments)}}())),s=Promise.all(n.filter(function(e){return"component-definition"===e.info.type}).map(function(e){return e.fn(qn({},i))})),e.n=2,Promise.all([a,s]);case 2:l=e.v,o.initialized=!0,(r=o.definitions).push.apply(r,En(l[1]));case 3:return e.a(2)}},e)}))()},extendComponents:function(e){return o.initialized?(o.definitions.filter(Boolean).forEach(function(t){var n=wn(e.filter(function(e){return e.key&&e.key===t.key}),1)[0];if(n){var r=ir(!0,{},n.brush);ir(!0,n,t),t.brush&&(n.brush=function(e,t){return"object"===In(e)&&Object.keys(e).length?(Array.isArray(t.consume)&&(e.consume=Bi({originalArray:e.consume,newArray:t.consume,matchKey:"context"})),Array.isArray(t.trigger)&&(e.trigger=Bi({originalArray:e.trigger,newArray:t.trigger,matchKey:"on"})),e):t}(r,t.brush))}else e.push(t)}),e):e}}}({picassoInstance:n.picasso,plugins:c,pluginArgs:Zl(u)}),v=Jl({flags:e,layout:u,app:i,model:r,picasso:t,chart:n.chart,translator:o,localeInfo:m,embed:h,options:d}),b=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:ns(a),styles:void 0};return p.styles=is({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=is({theme:e,id:i,transform:l,extend:c,matrix:p.matrix})}}}({theme:f,config:{id:"pieChart",resolve:[["object","label.name","color","#595959"],["object","label.name","fontFamily"],["object","label.name","fontSize","12px"]]}}),x=function({chart:e,translator:t,layout:n,constraints:r,options:i,themeService:o,colorService:a,custom:s}){const l=n.qHyperCube.qMeasureInfo.length>1,u="rtl"===i.direction,{fontFamily:c}=o.getStyles();return Rs({chart:e,translator:t,config:{rtl:u,enable:()=>!r.passive,getColorSettings:()=>a.getSettings(),style:{fontFamily:c},main:{key:"tooltip",getGroupByValue:({data:e})=>e.value,collectibles:[{key:"slices",type:"slice",major:({data:e})=>e.value}],triggers:[{keys:["slices"],collect:{from:"single"},placement:"collectible"},{keys:["pie-labels","negative-indicators"],collect:{from:"dimension",by:({data:e})=>e.value},placement:"trigger"}],placement:({meta:e})=>({type:"slices"===e.triggerer?"slice":"bounds"}),section:({h:e,nodes:n,dataset:r,formatter:i,create:o,util:a})=>{const[u]=n,{title:c,description:p,measures:d}=s.isEnabled()?s.getAttributes({dataset:r,nodes:n}):{},f=[];c&&f.push(o.text({value:c,style:{bold:!0}})),p&&f.push(o.text({value:p}));const m=s.hideBasic();if(m&&!d.length&&(c||p)||f.push(o.text({value:u.data.label,style:{bold:!0}})),!m){f.push(o.color({nodes:n,property:"fill"}));const{num:e}=u.data;if(f.push(o.measure({label:a.dataset.title(e.source.key,e.source.field),value:e.label})),l){const{radius:e}=u.data;f.push(o.measure({label:a.dataset.title(e.source.key,e.source.field),value:e.label}))}f.push(o.measure({label:t?t.get("properties.dataPoints.labelmode.share"):"Share",value:i("share")(u.desc.share)}))}d&&f.push(...d.map(e=>o.measure({label:e.label,value:e.value,survive:{color:!0,duplicate:!0}}))),s.chart.isEnabled()&&(s.chart.hasLimitation()?(s.chart.destroy(),f.push(o.raw({value:s.chart.createLimitationRow()}))):f.push(o.raw({value:s.chart.createContainer({h:e})})));const{customTooltipImages:h}=u.data;return s.isEnabled()&&h&&f.push(...h.map(t=>o.raw({value:s.createImageRow({value:t,h:e})}))),f},layout:{grouping:!0},events:{tooltip:{beforeShow:({collectNodes:e})=>s.isEnabled()&&s.hasImages()?s.addImages({nodes:e()}):Promise.resolve(),afterShow:({expando:e,nodes:t})=>{s.chart.isEnabled()&&!s.chart.hasLimitation()&&s.chart.show({nodes:t,properties:e.get("properties")})}},interaction:{mouseleave:()=>{s.chart.isEnabled()&&s.chart.hasAlternateState()&&s.chart.hide()}}}},legend:{keys:{tooltip:"legend-color-cat",component:"legend-cat"}}}})}({chart:n.chart,translator:o,layout:u,constraints:p,options:d,themeService:b,colorService:y,custom:v}),q=function({layout:e,themeService:t,colorService:n,flags:r}){const i=t.getStyles(),o=t=>r.isEnabled("CLIENT_IM_3050")?e.components?.find(e=>e.key===t):void 0,a=(e,t)=>{const r=n.getPaletteColor;if(e?.color&&r){const n=r(e);return"none"===n&&e.index>0?e?.color??t:n??t}return t};return{axis:{title:{getStyle:()=>{const e=o("axis")?.axis?.title;return{fontFamily:e?.fontFamily??i.axis.title.fontFamily,fontSize:e?.fontSize??i.axis.title.fontSize,color:a(e?.color,i.axis.title.color)}}}},label:{name:{getStyle:()=>{const e=o("label")?.label?.name;return{fill:a(e?.color,i.label.name.color),fontSize:e?.fontSize??i.label.name.fontSize,fontFamily:e?.fontFamily??i.label.name.fontFamily}}},value:{getStyle:()=>{const e=o("label")?.label?.value;return{fill:a(e?.color,i.label.value.color),fontSize:e?.fontSize??i.label.value.fontSize,fontFamily:e?.fontFamily??i.label.value.fontFamily}}}},legend:{title:{getStyle:()=>{const e=o("legend")?.legend?.title;return{fontFamily:e?.fontFamily??i.legend.title.fontFamily,fontSize:e?.fontSize??i.legend.title.fontSize,color:a(e?.color,i.legend.title.color)}}},label:{getStyle:()=>{const e=o("legend")?.legend?.label;return{fontFamily:e?.fontFamily??i.legend.label.fontFamily,fontSize:e?.fontSize??i.legend.label.fontSize,color:a(e?.color,i.legend.label.color)}}}}}}({layout:u,themeService:b,colorService:y,flags:e}),D=function({layout:e}){const t=({ds:e,encodings:t})=>{const n={field:"qDimensionInfo/0",props:{num:{field:t.slice.arc}}};return t.slice.outerRadius&&(n.props.radius={field:t.slice.outerRadius}),e.extract(n)},n=({rows:e,encodings:t})=>t.slice.outerRadius?e.filter(e=>"NaN"!==e.num.value&&"NaN"!==e.radius.value):e.filter(e=>"NaN"!==e.num.value),r=({rows:t,encodings:n})=>n.slice.outerRadius&&!e.donut.showAsDonut?t.filter(e=>e.num.value>0&&e.radius.value>0):t.filter(e=>e.num.value>0);return Ri({layout:e,config:{args:{},disclaimers:{NoDataExist:{condition:({ds:e,encodings:n})=>0===t({ds:e,encodings:n}).length},LimitedData:{condition:()=>{const t=Qs.getValue(e,"qHyperCube.qSize.qcy");return Qs.getValue(e,"qHyperCube.qDataPages.0.qArea.qHeight")<t}},OnlyNanData:{condition:({ds:e,encodings:r})=>{const i=t({ds:e,encodings:r});return 0===n({rows:i,encodings:r}).length}},OnlyNegativeOrZeroValues:{condition:({ds:e,encodings:i})=>{const o=t({ds:e,encodings:i}),a=n({rows:o,encodings:i});return 0===r({rows:a,encodings:i}).length}},NegativeOrZeroValues:{condition:({ds:e,encodings:i})=>{const o=t({ds:e,encodings:i}),a=n({rows:o,encodings:i}),s=a,l=r({rows:a,encodings:i});return s.length!==l.length}}}}})}({layout:u});l({alternativeService:s,colorService:y,disclaimerService:D,pluginService:g,themeService:b,tooltipService:x,styleService:q})},[r,i,n,u,o.language(),p,d.direction,f.name()]),s}const Ql=e=>"[object Object]"===Object.prototype.toString.call(e),eu=e=>Array.isArray(e);function tu(e,t){if(e===t)return!0;if(eu(e)){if(!eu(t))return!1;if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(!tu(e[n],t[n]))return!1;return!0}if(Ql(e)){if(!Ql(t))return!1;const n=Object.keys(e);if(n.length!==Object.keys(t).length)return!1;for(let r=0;r<n.length;r++){if(!Object.hasOwn(t,n[r]))return!1;if(!tu(e[n[r]],t[n[r]]))return!1}return!0}return e===t}function nu({enable:e=!0}={}){const t=A(),n=()=>Date.now().toString()+Math.random(),[r,i]=S(n()),o={properties:void 0};return I(()=>{if(!t||!t.getEffectiveProperties||!e)return()=>{};const r=()=>{t.getEffectiveProperties().then(e=>{const t=Ws(!0,{},e);if(!o.properties)return void(o.properties=t);const r=function(e,t){const n={properties:!1,exclude:!1};if(e===t)return n;const r=Ws(!0,{},e),i=Ws(!0,{},t);return n.exclude=!tu(r.qHyperCubeDef?.qLayoutExclude,i.qHyperCubeDef?.qLayoutExclude),delete r.qHyperCubeDef?.qLayoutExclude,delete i.qHyperCubeDef?.qLayoutExclude,n.properties=!tu(r,i),n}(o.properties,t);o.properties=t,r.exclude&&!r.properties&&i(n())})};return t.on("changed",r),r(),()=>{t.removeListener("changed",r)}},[e]),r}function ru({scaleKey:e,legend:t,onEdited:n}){const{layout:r}=t,{dock:i}=r||{};return{type:"brush-range",key:"legendRangeBrush",layout:{dock:"@legend-seq"},on:n?{bubbleEnd(){n()}}:{},settings:{brush:"selection",scale:`${e}Range`,direction:"left"===i||"right"===i?"vertical":"horizontal",bubbles:{align:"left"===i||"top"===i?"end":"start",placement:"outside"},target:{selector:'[id="legend-seq-target"]',fillSelector:'[id="legend-seq-ticks"]',fill:"rgba(82,204,82,0.2)"}}}}const iu=.8,ou=.55,au={CORNER_RADIUS:0,INNER_RADIUS:ou,STROKE:{COLOR:"#FFFFFF",WIDTH:{NONE:0,SMALL:2,MEDIUM:4,LARGE:6}}},su=({layout:e},t,n)=>t.encodings.slice.outerRadius?{scale:"radius",fn:t=>{let r=iu,i=0;const o=n?.style?.innerRadius??ou;e.donut.showAsDonut&&(r=iu-o,i=o);return t.scale(Math.max(0,t.datum.radius.value))*r+i}}:iu,lu=({layout:e},t,n)=>{if(!e.donut.showAsDonut)return 0;const r=n?.style?.innerRadius??ou;return t.encodings.slice.outerRadius?{scale:"radius",fn:e=>{const t=iu-r,n=r;return e.scale(Math.min(0,e.datum.radius.value))*t+n}}:r},uu=({layout:e},t)=>{const n=t.colorService.getDatumProps(),r=n[Object.keys(n)[0]],i=r&&r.field?r.field:void 0,o="qDimensionInfo/0"===i,a=i?t.ds.field(i).raw():null,s=a&&(a.label||a.title||a.qFallbackTitle)||"",l=t.encodings.slice.outerRadius,{formatter:u}=t.chart,c=Qs.getValue(e,"qHyperCube.qDimensionInfo",[]).length;function p(e,n){const r=t.ds.field(e).raw();return{field:e,label:!r.isCustomFormatted&&(r.qIsAutoFormat||"U"===r.qNumFormat.qType)?e=>u(n)(e.qNum):e=>e.qText}}const d=(e.components||[]).filter(e=>"slices"===e.key)[0];return{type:"pie",key:"slices",data:{extract:{field:"qDimensionInfo/0",props:{...n,num:p(t.encodings.slice.arc,"arc"),fillTooltip:i?{field:i,label:s,value:e=>o?e.qText||"-":void 0!==e.qNum&&"NaN"!==e.qNum?e.qText?e.qText:e.qNum:e.qText||"-"}:void 0,customTooltipAttrExps:0!==c?Bl.getNode(e,{dimensionCount:c}):void 0,radius:l?p(l,"outerRadius"):void 0}}},brush:{consume:[{context:"selection",data:["","fill"],style:{inactive:{opacity:.3},active:{stroke:"rgba(52, 52, 52, 0.7)",strokeWidth:2}}},{context:"highlight",data:[""],style:{inactive:{fill:"#BFDAD9"},active:{fill:"#68B2AF"}}}]},settings:{startAngle:()=>t.viewState.get("rotation"),endAngle:()=>t.viewState.get("rotation")+2*Math.PI,slice:{arc:{ref:"num"},innerRadius:lu({layout:e},t,d),fill:t.colorService.getColor(),strokeWidth:d?.style?.strokeWidth?au.STROKE.WIDTH[d.style.strokeWidth.toUpperCase()]:au.STROKE.WIDTH.NONE,stroke:d?.style?.strokeColor?.color??au.STROKE.COLOR,outerRadius:su({layout:e},t,d),cornerRadius:d?.style?.cornerRadius??0}},animations:{enabled:t.animations.enabled,isMainComponent:!0}}};function cu({layout:e},t){const n=(e.components||[]).filter(e=>"slices"===e.key)[0],r=n?.style?.innerRadius??ou,i=t.encodings.slice.outerRadius,o=t.themeService.getStyles();return!(!e.donut.showAsDonut||!i)&&{type:"pie",key:"zeroLine",data:{items:[1]},settings:{slice:{arc:1,fill:"transparent",innerRadius:0,strokeWidth:1,stroke:o.label.name.color,outerRadius:{scale:"radius",fn:e=>{const t=iu-r,n=r;return e.scale(0)*t+n}}}},animations:{enabled:t.animations.enabled}}}function pu(e){return{type:"pie-dividers",key:"pie-dividers",layout:{displayOrder:2},settings:{component:"slices",selector:"path"},brush:{consume:[{context:"selection",style:{inactive:{opacity:.2}}}]},animations:{enabled:e.animations.enabled,trackBy:()=>Math.random()}}}function du({layout:e},t){if(e.donut.showAsDonut||!t.encodings.slice.outerRadius)return!1;return{type:"negative-indicators",key:"negative-indicators",layout:{displayOrder:2},settings:{component:"slices",selector:"path",offset:5,size:4,fill:t.themeService.getStyles().label.name.color},brush:{consume:[{context:"selection",style:{inactive:{opacity:.2}}}]},animations:{enabled:t.animations.enabled}}}function fu(e){const t=e.node.desc&&e.node.desc.share;return t?e.formatter("share")(t):""}function mu(e){return e.node.data.num.label}function hu(e){return e.node.data.radius.label}function yu(e,t,n){if(e.dataPoint.auto)return n?mu:fu;if("share"===e.dataPoint.labelMode)return fu;if("value"===e.dataPoint.labelMode){return t.encodings.slice.outerRadius&&"radius"===e.dataPoint.labelValueMode?hu:mu}return null}function gu({data:e}){return e?e.label:""}function vu(e){const t=parseInt(e,10);if(!isNaN(t))return t}function bu(e){const t=((e&&e.components?e.components:void 0)||[]).filter(e=>"slices"===e.key)[0];return(t?.style?.innerRadius??ou)>.3}function xu({node:e,data:t}){return Ws({_share:e.desc.share,_fillColor:e.attrs.fill},t)}function qu(e,t,n){const r=t.styleService.label.name.getStyle(),i=[{padding:10,direction:t.encodings.slice.outerRadius?"rotate":"horizontal",placements:[{position:"outside",padding:t.encodings.slice.outerRadius?4:2,fill:r.fill}],fontSize:vu(r.fontSize),fontFamily:r.fontFamily,label:gu,linkData:({node:e,data:t})=>Ws({_share:e.desc.share,_fillColor:e.attrs.fill,_showTooltip:!0},t)}];if(yu(e,t,!1)){const r=function(e,t,n){return{label:yu(e,t,!1),simplifiedPlacements:[{position:e.donut.showAsDonut&&bu(e)?"inside":"into",onBackground:e.donut.showAsDonut&&bu(e),padding:4}],theme:n.theme,themeId:"object.pieChart"}}(e,t,n),o=ll(Ws(t,r),n.theme);o.linkData=xu,i.push(o)}return{key:"pie-labels",type:"labels",renderer:Cl(t.flags),layout:{displayOrder:2,minimumLayoutMode:"XSMALL"},settings:{sources:[{component:"slices",selector:"path",strategy:{type:"slice",settings:{labels:i}}}]},brush:{consume:[{context:"selection",data:["","fill"],style:{inactive:{opacity:.3}}}]},animations:{enabled:t.animations.enabled,trackBy:()=>Math.random()}}}function Du({layout:e,context:t},n){return!1!==e.dataPoint.show&&(1===n.dataRowCount?function(e,t,n){const r=yu(e,t,!0),i=(o=n.theme,e=>o.getContrastingColorTo(e.node.attrs.fill));var o;const a=t.themeService.getStyles(),s=t.styleService.label.name.getStyle(),l=t.styleService.label.value.getStyle(),u=s.fill===a.label.name.color,c=l.fill===a.label.value.color;return{key:"pie-labels",type:"labels",renderer:Cl(t.flags),layout:{displayOrder:2,minimumLayoutMode:"XSMALL"},settings:{sources:[{component:"slices",selector:"path",strategy:{type:"rows",settings:{align:.5,justify:.5,padding:10,labels:[{fontSize:vu(s.fontSize),fontFamily:s.fontFamily,fill:u&&!e.donut.showAsDonut?i:s.fill,label:gu,linkData:({data:e})=>e},{fontSize:vu(l.fontSize),fontFamily:l.fontFamily,fill:c&&!e.donut.showAsDonut?i:l.fill,label:r,linkData:({data:e})=>e}]}}}]},animations:{enabled:t.animations.enabled,trackBy:()=>Math.random()}}}(e,n,t):qu(e,n,t))}const Su=(e,{requireFailure:t,recognizeWith:n}={})=>({type:"Pan",requireFailure:t,recognizeWith:n,options:{event:"legendRange",enable(t,n){if(this.started||!n)return!0;if(e.constraints.select||e.constraints.active)return!1;const r=(this.chart.componentsFromPoint({x:n.center.x,y:n.center.y}).some(e=>"legend-seq"===e.type)||function(e){const{target:t}=e.srcEvent;return!(!t||!(t.hasAttribute("data-other-value")&&t.hasAttribute("data-idx")||"INPUT"===t.nodeName))}(n))&&!e.isLocked([this.chart.component("slices")]);return r||this.chart.component("legendRangeBrush").emit("rangeClear"),r}},events:{legendRangestart(t){t.preventDefault(),e.interactions.emit("selections-start"),this.chart.component("legendRangeBrush").emit("rangeStart",t),this.started=!0},legendRangemove(e){e.preventDefault(),this.chart.component("legendRangeBrush").emit("rangeMove",e)},legendRangeend(t){t.preventDefault(),this.chart.component("legendRangeBrush").emit("rangeEnd",t),e.onSelect(),this.started=!1}}});function Cu(e,t){const n=t.element.getBoundingClientRect();let r,i;return e.center?(({x:r}=e.center),({y:i}=e.center)):(r=e.clientX,i=e.clientY),{x:r-n.left,y:i-n.top}}function wu(e,t){const n=t.component("slices");if(!n)return!1;const{x:r,y:i}=Cu(e,t),o=n.rect.x+n.rect.margin.left+n.rect.width/2,a=n.rect.y+n.rect.margin.top+n.rect.height/2,s=Math.min(n.rect.width,n.rect.height)/2*iu;return(o-r)**2+(a-i)**2<=s**2}const Eu=(e,t,{requireFailure:n,recognizeWith:r}={})=>({type:"Tap",requireFailure:n,recognizeWith:r,options:{event:"tap",interval:10,pointers:1,enable(t,n){return!n||!e.constraints.select&&!e.constraints.active&&(this.components=this.chart.componentsFromPoint({x:n.center.x,y:n.center.y}).filter(e=>"slices"===e.key||"legend-cat"===e.key||"pie-labels"===e.key),this.components.length)}},events:{tap(n){n.preventDefault();const{target:r}=n.srcEvent;if(r&&("INPUT"===r.nodeName||r.hasAttribute("data-other-value")))return void this.chart.component("legendRangeBrush").emit("bubbleStart",n);if(r&&r.hasAttribute("data-action")&&r.hasAttribute("data-component-key"))return void this.chart.component(r.getAttribute("data-component-key")).emit(r.getAttribute("data-action"));if(r&&r.children&&r.children[0]&&"legend-cat"===r.children[0].getAttribute("data-component-key"))return;if(e.isLocked(this.components))return;e.interactions.emit("selections-start");let i=Cu(n,this.chart);this.components.some(e=>"legend-cat"===e.key)&&(i={cx:i.x,cy:i.y,r:5});const o=this.chart.shapesAt(i,{components:[{key:"slices",propagation:"stop"},{key:"legend-cat",propagation:"stop"},{key:"pie-labels",propagation:"stop"}],propagation:"stop"});o.length&&(this.chart.brushFromShapes(o,{components:[{key:o[0].key,action:n.srcEvent.ctrlKey||t?"set":"toggle",contexts:["selection"]}]}),e.onSelect())}}}),Iu=(e,{requireFailure:t,recognizeWith:n}={})=>({type:"Pan",requireFailure:t,recognizeWith:n,options:{event:"lasso",enable(t,n){if(this.isStarted||!n)return!0;if(e.constraints.active||e.constraints.select||!e.interactions.lasso.active())return!1;const r=this.chart.componentsFromPoint({x:n.center.x,y:n.center.y});return!e.isLocked(r)&&r.some(e=>"slices"===e.key)}},events:{lassostart(t){t.preventDefault(),e.constraints.select||e.constraints.active||this.isStarted||(e.interactions.emit("selections-start"),this.chart.component("lasso").emit("lassoStart",t),this.isStarted=!0)},lassomove(e){e.preventDefault(),this.chart.component("lasso").emit("lassoMove",e)},lassoend(t){t.preventDefault(),this.isStarted=!1,this.chart.component("lasso").emit("lassoEnd",t),e.onSelect()}}}),Au=(e,{requireFailure:t,recognizeWith:n}={})=>({type:"Tap",requireFailure:t,recognizeWith:n,options:{event:"areatap",pointers:2,enable(t,n){if(this.started||!n)return!0;if(e.constraints.active||e.constraints.select)return!1;const r=this.chart.componentsFromPoint({x:n.center.x,y:n.center.y});return r.some(e=>"slices"===e.key)&&!e.isLocked(r)}},events:{areatap(t){const n=this.chart.component("area");n&&!this.started&&(e.interactions.emit("selections-start"),n.emit("areaStart",t.pointers[0]),n.emit("areaMove",t.pointers[1]),this.started=!0,setTimeout(()=>{n.emit("areaEnd"),e.onSelect(),this.started=!1},100)),t.preventDefault()}}});function Mu(e){return{type:"native",key:"theusual",events:{wheel(t){let n=!1;if(!e.constraints.active&&wu(t,this.chart)){const r=Math.sign(-t.deltaY);e.viewState.set("rotation",r*(Math.PI/12)),n=!0}else if(!e.constraints.select&&!e.constraints.active){const e=this.chart.componentsFromPoint(t).filter(e=>"legend-cat"===e.key)[0];e&&(n=!0,function(e,t){const n=(Math.abs(e.deltaX)>Math.abs(e.deltaY)?e.deltaX:e.deltaY)>=0?"next":"prev";t.emit(n)}(t,e))}n&&t.preventDefault()}}}}const ku=(e,{requireFailure:t,recognizeWith:n}={})=>({type:"Pan",requireFailure:t,recognizeWith:n,options:{event:"rotate",pointers:1,threshold:10,enable(t,n){return!(!this.started&&n)||!e.constraints.active&&!e.interactions.lasso.active()&&wu(n,this.chart)}},events:{rotatestart(e){e.preventDefault();const t=this.chart.component("slices").rect,n=this.chart.element.getBoundingClientRect();this.pieCenter={x:n.left+t.x+t.width/2,y:n.top+t.y+t.height/2},this.prevAngle=Math.atan2(e.center.y-this.pieCenter.y,e.center.x-this.pieCenter.x),this.started=!0},rotatemove(t){t.preventDefault();const n=Math.atan2(t.center.y-this.pieCenter.y,t.center.x-this.pieCenter.x);e.viewState.set("rotation",n-this.prevAngle),this.prevAngle=n},rotateend(e){e.preventDefault(),this.started=!1},rotatecancel(e){e.preventDefault(),this.started=!1}}}),Lu=(e,{requireFailure:t,recognizeWith:n}={})=>({type:"Pan",requireFailure:t,recognizeWith:n,options:{event:"legendPan",pointers:1,threshold:10,enable(t,n){return!(!this.isStarted&&n)||!e.constraints.active&&this.chart.componentsFromPoint({x:n.center.x,y:n.center.y}).some(e=>"legend-cat"===e.type)}},events:{legendPanstart(e){if(e.preventDefault(),!this.isStarted){this.components=this.chart.componentsFromPoint({x:e.center.x,y:e.center.y}),this.components.forEach(t=>{t.emit("panstart",e)}),this.isStarted=!0;const t=this.chart.component("tooltip");t&&t.show&&t.emit("hide")}},legendPanmove(e){this.components.forEach(t=>{t.emit("panmove",e)}),e.preventDefault()},legendPanend(e){e.preventDefault(),this.components.forEach(t=>{t.emit("panend",e)}),this.isStarted=!1}}}),Ou=(e,t,n)=>({key:"hammered",type:"hammer",enable:!0,gestures:t?[ku(e,{}),Eu(e,t,{}),...n]:[Su(e,{}),Au(e,{}),ku(e,{}),Iu(e,{}),Lu(e,{}),Eu(e,t,{}),...n]});function Tu(e,t,n){const r=e.getIsSingleSelect(0),{constraints:i}=n;if(i.active&&i.passive)return[];const o=t.tooltipService.getInteractions();return[Ou(t,r,o.gestures),Mu(t),o.native]}function Nu({settings:e},t){const n={share:{type:"d3-number",format:".1%"},arc:{data:{field:t.encodings.slice.arc}},fill:e.scales.fill&&e.scales.fill.data&&e.scales.fill.data.field?{data:{field:e.scales.fill.data.field}}:{}};return t.encodings.slice.outerRadius&&(n.outerRadius={data:{field:t.encodings.slice.outerRadius}}),n}function Pu({layout:e},t,n){if(!e.dimensionTitle)return!1;const r=t.alternativeService.getAlternatives(),i=t.styleService.axis.title.getStyle();return{key:"dimension-title",type:"axis-title",renderer:"react-qcm",layout:{dock:"top",minimumLayoutMode:"SMALL"},data:{infos:e.qHyperCube.qDimensionInfo,alternatives:r.dimensions},resources:{app:t.app,cache:t.viewCache,model:t.model,selections:t.selections,translator:t.translator},callbacks:{onChange:()=>{}},settings:{isDisabled:()=>n.constraints.active,isRTL:n.rtl,isSnapshot:!!e.snapshotData,noModelDependencies:t?.flags?.isEnabled("VIZ_252_DATA_TITLE_OUTSIDE_SENSE"),skipAttributeExpressions:!1,type:"dimension"},style:{title:{color:i.color,fontFamily:i.fontFamily,fontSize:i.fontSize}}}}function Fu({layout:e,context:t,selectionService:n},r={}){const i=function({layout:e}={},t={}){const n={};return Ws(n,t.colorService.getScales()),t.encodings.slice.outerRadius&&Ws(n,function({layout:e},t){const n={radius:{type:"linear",include:[0],data:{extract:{field:t.encodings.slice.outerRadius}}}};return e.donut.showAsDonut||(n.radius.min=0),n}({layout:e},t)),n}({layout:e},r),o={scales:i};let a=[];const s=function(e,t){const n=e.disclaimerService.getDisclaimer();if(!n)return!1;const{rtl:r}=t,{translator:i}=e,{fontFamily:o}=e.themeService.getStyles();return{key:"disclaimer",type:"disclaimer",renderer:"react-qcm",layout:{dock:n.alignment},settings:{isRTL:r,label:i.get(`Object.Disclaimer.${n.key}`)},style:{fontFamily:o}}}(r,t);if(r.disclaimerService.getHasSuppressingDisclaimer())return{components:[s]};const l=t.constraints.select||t.constraints.active,u=r.colorService.getLegend({eventName:"legend",key:"legend",viewState:r.viewState,chart:r.chart,styleReference:"object.pieChart",styleOverrides:{title:r.styleService.legend.title.getStyle(),label:r.styleService.legend.label.getStyle()},rtl:t.rtl},{navigationDisabled:l});return i.fillRange&&u.components[0]&&("right"===u.components[0].layout.dock||"left"===u.components[0].layout.dock||t.rtl)&&(i.fillRange.invert=!0),a=[uu({layout:e},r),cu({layout:e},r),pu(r),du({layout:e},r),Pu({layout:e},r,t),...u.components,ru({scaleKey:"fill",legend:u.components[0]||{},onEdited:r.onSelect}),{key:"lasso",type:"brush-lasso",layout:{displayOrder:99},settings:{brush:{components:[{key:"slices",contexts:["selection"]}]},lasso:{fill:"rgba(0, 0, 0, 0)",stroke:"black",strokeWidth:2,opacity:.7,strokeDasharray:[]},snapIndicator:{threshold:75,strokeDasharray:"5, 5",stroke:"black",strokeWidth:2,opacity:.7},startPoint:{r:10,stroke:"rgba(77, 192, 78, 1)",strokeWidth:0,opacity:1}}},{key:"area",type:"brush-area",settings:{brush:{components:[{key:"slices",contexts:["selection"],action:"add"}]}},style:{area:{fill:"transparent",strokeWidth:2,stroke:"black",strokeDasharray:"5 5",opacity:.7}}},Du({layout:{components:e.components,dataPoint:Ws({},e.dataPoint,{show:!(e.effectPath&&e.snapshotData&&!1===e.dataPoint.show)}),donut:e.donut},context:t},r),...r.tooltipService.getComponents(),s],a=a.filter(e=>!1!==e),{interactions:Tu(n,r,t),scales:i,components:r.pluginService.extendComponents(a),palettes:r.colorService.getPalettes(),formatters:Nu({settings:o},r),strategy:Js(0,r)}}function Ru({instance:e,services:t,picasso:r,flags:i}){const o=x(),a=A(),s=M(),l=w(),u=T(),c=k(),p=D(),d=O(),{qLocaleInfo:f}=N(),m=nu({enable:c&&!c.snapshotData}),[h]=F(()=>{if(!t)return Promise.resolve();Yl.attrExpr.updateProperties(a,c);const e=({getUseBaseColors:e})=>({theme:u,legendProps:c.legend,layout:c,localeInfo:f,hc:c.qHyperCube,colorProps:{...c.color,useBaseColors:e(c)}});return Promise.resolve(a&&!c.snapshotData?a.getEffectiveProperties():{}).then(async n=>Promise.all([t.colorService.initialize({createConfig:e}),Promise.resolve(n),t.pluginService.initialize(),t.alternativeService.initialize({properties:n})]))},[t,m]);I(()=>{e?.selectionService&&e.selectionService.setLayout(c)},[c]),I(()=>{if(!e||!h)return;const{chart:m,viewState:y,interactions:g,viewCache:v}=e,{alternativeService:b,colorService:x,disclaimerService:q,pluginService:D,themeService:S,tooltipService:C,styleService:w}=t,E=o.viewState||{};c.snapshotData||(y.preventSet("legendScrollOffset",E.legendScrollOffset||0),y.preventSet("rotation",E.rotation||0)),function(e,t){e&&e.snapshotData&&e.snapshotData.content&&e.snapshotData.content.chartData&&(t.preventSet("legendScrollOffset",e.snapshotData.content.chartData.legendScrollOffset),t.preventSet("rotation",e.snapshotData.content.chartData.rotation))}(c,y),C.expando.set("properties",h[1]);const I=r.data("q")({key:"qHyperCube",data:c.qHyperCube,config:{localeInfo:f}}),A=[{type:"q",key:"qHyperCube",data:c.qHyperCube,config:{localeInfo:f}},...x.getData()],M={slice:{arc:"qMeasureInfo/0"}};c.qHyperCube.qMeasureInfo.length>1&&(M.slice.outerRadius="qMeasureInfo/1"),q.initialize({args:{ds:I,encodings:M}});const k=function(e,t){if(t.slice.outerRadius)return e.extract({field:"qDimensionInfo/0",props:{num:{field:t.slice.arc},radius:{field:t.slice.outerRadius}}}).filter(e=>e.num.value>0&&"NaN"!==e.radius.value).length;return e.extract({field:"qDimensionInfo/0",props:{num:{field:t.slice.arc}}}).filter(e=>e.num.value>0).length}(r.data("q")({data:c.qHyperCube,config:{localeInfo:f}}),M),L=p?()=>{const e=m.brush("selection");n.selections(e,{},c).forEach(e=>{p.select(e)})}:()=>{},O=c.snapshotData&&!o.freeResize?{width:(c.snapshotData.content.size||c.snapshotData.object.size).w,height:(c.snapshotData.content.size||c.snapshotData.object.size).h}:void 0,T=t=>e.selectionService.getIsSelectionLocked(t),N=()=>Fu({layout:c,context:{rtl:"rtl"===o.direction,theme:u,constraints:d},selectionService:e.selectionService},{picasso:r,ds:I,model:a,app:s,chart:m,onSelect:L,isLocked:T,interactions:g,constraints:d,translator:l,viewState:y,dataRowCount:k,encodings:M,alternativeService:b,colorService:x,disclaimerService:q,pluginService:D,themeService:S,styleService:w,tooltipService:C,debouncer:_i,properties:h[1],selections:p,logicalSize:O,flags:i,viewCache:v,animations:{enabled:()=>function({viewState:e,options:t,viewCache:n,layout:r,chart:i}){return!1!==t.chartAnimations&&n.get("chartWidth")===i.element.clientWidth&&n.get("chartHeight")===i.element.clientHeight&&n.get("hasZeroLine")===!!i.component("zeroLine")&&0===e.get("rotation")&&!Sl.propertiesHaveChanged({viewCache:n,layout:r})}({viewState:y,options:o,layout:c,viewCache:v,chart:m})}});e.generateSettings=N;const P=N();m.update({data:A,settings:P}),v.set("chartWidth",m.element.clientWidth),v.set("chartHeight",m.element.clientHeight),v.set("hasZeroLine",P.components.filter(e=>"zeroLine"===e.key).length>0),Sl.cacheProperties({viewCache:v,layout:c}),o.effect&&c.effectProperties?o.effect.update(c,m,{encodings:M}):c.effectPath||m.brush("highlight").end()},[e,h,o.direction,o.effectProperties,d,u.name(),l.language()])}function ju({instance:e,services:t}){const n=q(),r=k();j(i=>{if(!(r.snapshotData&&r.snapshotData.content&&r.snapshotData.content.chartData)&&(function(e,t){const n=t.getBoundingClientRect();e.snapshotData=e.snapshotData||{},e.snapshotData.content=e.snapshotData.content||{},e.snapshotData.content.size=e.snapshotData.content.size||{w:n.width,h:n.height}}(i,n),e&&t))return function({layout:e,chart:t,viewState:n,colorService:r}){return e.snapshotData.content=e.snapshotData.content||{},e.snapshotData.content.chartData={legendScrollOffset:el(t,"legend-cat"),rotation:n.get("rotation")},r.getSnapshotData().then(t=>{e.snapshotData.content.chartData={...e.snapshotData.content.chartData,...t}}).catch(()=>{})}({layout:i,chart:e.chart,colorService:t.colorService,viewState:e.viewState})}),H(()=>({getViewState:()=>({rotation:e.viewState.get("rotation"),legendScrollOffset:el(e.chart,"legend-cat")})}),[e])}var Hu,Vu={exports:{}};var zu=(Hu||(Hu=1,self,Vu.exports=(()=>{var e={909: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],d=1,f=arguments.length,m=!1;for("boolean"==typeof p&&(m=p,p=arguments[1]||{},d=2),(null==p||"object"!=typeof p&&"function"!=typeof p)&&(p={});d<f;++d)if(null!=(t=arguments[d]))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}},8:(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],d=1,f=arguments.length,m=!1;for("boolean"==typeof p&&(m=p,p=arguments[1]||{},d=2),(null==p||"object"!=typeof p&&"function"!=typeof p)&&(p={});d<f;++d)if(null!=(t=arguments[d]))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:()=>Le});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 d(e,t){var n=e.crossAllDimensions;return 2===t&&n?"RowNo(Total)":"RowNo()"}function f(e){var t=function(e){return e?(e=function(e){return e.replace(/\/\*[^]*?\*\//g,"")}(e=function(e){return e.replace(/\/\/(.*)$/gm,"")}(e))).trim():""}(e),n=t.trim();return"="===n.substring(0,1)?n.substring(1).trim():n}function 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 y(e){return void 0===e?")":", 0, ".concat(e,")")}function g(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(g("MinString(".concat(t,")")),")' and Only({1}").concat(t,")<='$(=").concat(g("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),d=c(r[1],i),f=m(0),h=m(1),y=v(p,f),g=v(d,h);return"".concat(a,"({1<").concat(y,",").concat(g,">}").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(f(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),d=m(1);return"If(Count(".concat(p,") * Count(").concat(d,") > 0, ").concat(a," + ").concat(s).concat(l,")")}return a},getRowNoComp:d,getNumStepComp:function(e,t){if(!p(e)){var n=e.steps;return"number"!=typeof n||Number.isNaN(n)?6:n}return d(e,t)},getAboveCompPrefix:h,getAboveCompSuffix:y,getAboveComp:function(e,t,n,r){return h(e,t)+n+y(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:f,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 C(e){return C="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},C(e)}var w=t().bind(null,!0),E={},I=Array.isArray;function A(e){return null!=e&&!Array.isArray(e)&&"object"===C(e)}function M(e){return void 0===e}function k(e,t){return"function"==typeof e[t]||"$$"===t.substring(0,2)||"_"===t.substring(0,1)}function L(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]=M(e[n||t])?o:e[t],e=e[n||t]}}),e}function O(e,t){var n=!0;if(A(e)&&A(t))return Object.keys(e).length===Object.keys(t).length&&(Object.keys(e).forEach(function(r){O(e[r],t[r])||(n=!1)}),n);if(I(e)&&I(t)){if(e.length!==t.length)return!1;for(var r=0,i=e.length;r<i;r+=1)if(!O(e[r],t[r]))return!1;return!0}return e===t}E.generate=function(e,t,n){n=n||"";var r=[];return Object.keys(t).forEach(function(i){var o=function(e){return e?w({},{val:e}).val:e}(t[i]),a=e[i],s="".concat(n,"/").concat(i);O(o,a)||k(t,i)||(M(a)?r.push({op:"add",path:s,value:o}):A(o)&&A(a)?r=r.concat(E.generate(a,o,s)):I(o)&&I(a)?r=r.concat(function(e,t,n){var r=[],i=e.slice(),o=-1;function a(e,t,n){if(e[n]&&M(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(O(t,i))return r;if(!M(t[0])&&M(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(E.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){M(t[i])&&!k(e,i)&&r.push({op:"remove",path:"".concat(n,"/").concat(i)})}),r},E.apply=function(e,t){t.forEach(function(t){var n,r,i=L(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(I(i))"-"===o&&(o=i.length),i.splice(+o,"add"===t.op?0:1,t.value);else if(I(a)&&I(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(A(a)&&A(t.value))n=a,Object.keys(n).forEach(function(e){Object.getOwnPropertyDescriptor(n,e).configurable&&!k(n,e)&&delete n[e]}),w(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=L(e,t.from);I(i)?i.splice(+o,0,c.splice(+s,1)[0]):(i[o]=c[s],delete c[s])}else"remove"===t.op&&(I(i)?i.splice(+o,1):delete i[o])})},E.clone=function(e){return w({},e)},E.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},E.updateObject=function(e,t){Object.keys(e).length?E.apply(e,E.generate(e,t)):w(e,t)};const T=E,N=function(e,n,r){if(!e)return Promise.resolve();var i=T.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 P="accumulation";function F(e,t){var n=o(e,t);if(n)for(var r=0;r<n.length;r++)if(n[r].type===P)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===P)return r;return-1}(e,t);return n>-1?"".concat(t,".").concat(n):t}var j={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),d=D.getAboveComp(n,l,c,p),f=D.getRangeComp("RangeSum",d);if(D.needDimension({modifier:n,properties:r,layout:i})){var m=D.getDimComp(u,1),h=D.getDimComp(u,0),y=D.getAggrComp(f,m,h);f=n.showExcludedValues?D.getExcludedComp({modifier:n,dimensions:u,dimensionAndFieldList:s,valueComp:y}):y}return f},extractInputExpression:D.extractInputExpression,initModifier:function(e){D.initModifier(e,j)},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=F(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=F(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(P))return!1;var o=F(t,e);return o&&!o.disabled}};return n}};var V="movingAverage";function z(e,t){var n=o(e,t);if(n)for(var r=0;r<n.length;r++)if(n[r].type===V)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===V)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,d=D.getExpressionWithExcludedComp({expression:n,modifier:r,dimensions:c,dimensionAndFieldList:l,treatMissingAsNull:p}),f=D.getNumStepComp(r,u),m=D.getAboveComp(r,u,d,f);if(r.nullSuppression)t=D.getRangeComp("RangeAvg",m);else{var h=D.getRangeComp("RangeSum",m),y=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(y)}var g=t;if(D.needDimension({modifier:r,properties:i,layout:a})){var v=D.getDimComp(c,1),b=D.getDimComp(c,0),x=D.getAggrComp(g,v,b);g=r.showExcludedValues?D.getExcludedComp({modifier:r,dimensions:c,dimensionAndFieldList:l,funcComp:"Only",valueComp:x}):x}return g},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(V))return!1;var o=z(t,e);return o&&!o.disabled}};return n}};var U="timeSeriesDecomposition";function W(e,t){var n=o(e,t);if(n)for(var r=0;r<n.length;r++)if(n[r].type===U)return n[r]}function K(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===U)return r;return-1}(e,t);return n>-1?"".concat(t,".").concat(n):t}var Y={type:"timeSeriesDecomposition",disabled:!1,decomposition:"",steps:2,outputExpression:""};const G={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,Y),""===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(K(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(K(t,e),".steps")},type:"integer",translation:t.modifierTimeSeriesDecompositionPeriods||"properties.modifier.timeSeriesDecomposition.periods",schemaIgnore:!0,defaultValue:2,change:function(t,n){var r=W(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=W(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(U))return!1;var o=W(t,e);return o&&!o.disabled}};return n}};var J="difference";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 X(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 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),d="".concat(c," - ").concat(p);if(D.needDimension({modifier:n,properties:r,layout:i})){var f=D.getDimComp(u,1),m=D.getDimComp(u,0),h=D.getAggrComp(d,f,m);d=n.showExcludedValues?D.getExcludedComp({modifier:n,dimensions:u,dimensionAndFieldList:s,funcComp:"Only",valueComp:h}):h}return d},initModifier:function(e){Object.keys(Q).forEach(function(t){void 0===e[t]&&(e[t]=Q[t])})},enableTotalsFunction:function(){return!1},propertyPanelDef:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n={type:"items",items:{disclaimer:{component:"text",translation:t.disclaimer||"properties.modifier.difference.disclaimer",show:function(e,t){return!D.isApplicable({properties:t.properties})}},settings:{type:"items",items:{primaryDimension:{refFn:function(t){return"".concat(X(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(X(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(X(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(J))return!1;var o=Z(t,e);return o&&!o.disabled}};return n}};var te="normalization";function ne(e,t){var n=o(e,t);if(n)for(var 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,d=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),d=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(d,"))")}(c,p,n.field,n.value,d,l,n.primaryDimension)},initModifier:function(e){Object.keys(oe).forEach(function(t){void 0===e[t]&&(e[t]=oe[t])})},updateModifier:function(e,t){1===(t.qDimensions?t.qDimensions.length:0)&&0===e.dimensionalScope&&(e.dimensionalScope=2)},enableTotalsFunction:function(){return!0},propertyPanelDef:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n={type:"items",items:{disclaimer:{component:"text",translation:t.disclaimer||"properties.modifier.normalization.disclaimer",show:function(e,t){return!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",de="qDef.qDef",fe="qDef.base.qDef",me="qLibraryId",he="qDef.base.qLibraryId";const ye={getExpression:function(e){var t=o(e,fe);return void 0!==t?t:o(e,de)},getExpressionRef:function(e){return void 0!==o(e,fe)?fe:de},getLibraryIdRef:function(e){return o(e,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 ge="qDef.qDef",ve="qDef.base.qDef",be="qLibraryId",xe="qDef.base.qLibraryId",qe="qDef.qLabel",De="qDef.qLabelExpression",Se="qDef.base.qLabel",Ce="qDef.base.qLabelExpression",we="qDef.qAggrFunc",Ee="qDef.base.qAggrFunc",Ie={initBase:function(e,t){(t||Ie.isValid(e))&&(n(e,ve,o(e,ge)),n(e,xe,o(e,be)),n(e,Se,o(e,qe)),n(e,Ce,o(e,De)))},restoreBase:function(e){Ie.isValid(e)&&(n(e,ge,o(e,ve)),n(e,be,o(e,xe)),n(e,qe,o(e,Se)),n(e,De,o(e,Ce)),o(e,we)&&o(e,Ee)&&n(e,we,o(e,Ee)),delete e.qDef.base)},isValid:function(e){var t=o(e,ve),n=o(e,xe);return void 0!==t||void 0!==n}};const Ae=Ie;function Me(e){return Me="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},Me(e)}var ke={accumulation:H,movingAverage:$,difference:ee,normalization:ce,timeSeriesDecomposition:G};const Le={modifiers:ke,apply:Te,applyModifiers:Ne,cleanUpMeasure:Pe,destroy:function(e){e&&Oe[e.id]&&Oe[e.id].masterItemSubscriber&&(Oe[e.id].masterItemSubscriber&&Oe[e.id].masterItemSubscriber.unsubscribe(),delete Oe[e.id])},hasActiveModifiers:Fe,getActiveModifier:Re,initBase:Ae.initBase,isSupportedModifiers:function(e){return Array.isArray(e)&&e.some(function(e){return ke[e]})},isApplicableSupportedModifiers:function(e){var t=e.modifierTypes,n=e.properties,r=e.layout;return Array.isArray(t)&&t.some(function(e){return ke[e]&&ke[e].isApplicable({properties:n,layout:r})})},measureBase:ye,limitedSorting:function(e){var t=e.measures,n=e.properties,r=e.layout,i=!1,o=!1;return t.forEach(function(e){var t=Ve(e);Ke({modifiers:t,properties:n,layout:r})&&(i=!0,o=o||Xe({modifiers:t,properties:n,layout:r}))}),i&&!o},ifEnableTotalsFunction:je};var Oe={};function Te(){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;Oe[n.id]=Oe[n.id]||{isFirstTime:!0};var u=Oe[n.id].isFirstTime;if(Oe[n.id].isFirstTime=!1,r&&"object"===Me(r))return Ne({model:n,properties:r});var c=n?n.layout:void 0,p=o(c,"qSelectionInfo.qInSelections");if(a||p)return Promise.resolve(l);var d=o(c,"qHyperCube.qMeasureInfo"),f=Oe[n.id].lastReloadTime;if(Oe[n.id].lastReloadTime=o(n,"app.layout.qLastReloadTime"),Fe({measures:d,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 We({measure:e,properties:n,layout:r})})}({measures:t,layout:n})}({measures:d,layout:c,model:n,lastReloadTime:f});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 Ke({modifiers:Ve(t),layout:n})?!t.base:!!t.base}({measure:e,layout:n})}))}({measures:d,layout:c,masterItem:s,isFirstTime:u})?n.getEffectiveProperties().then(function(e){var r=t()(!0,{},e);_e(r);var i=Qe(r);return Ye({model:n}).then(function(t){return Ge({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(We({measure:t,properties:e.properties})){var n=0,r=t.qDef.modifiers;Array.isArray(r)&&r.forEach(function(e){if("object"===Me(e)&&!e.disabled){if(n++,"object"!==Me(ke[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=ke[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}),Ne({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"===Me(e.base)})}(d)?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 Pe(e)}),Ze({oldProperties:e,newProperties:r,model:n})})}({model:n,properties:e})}):Promise.resolve(l)}function Ne(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 d=Qe(i);return et({model:n,libraryIds:d,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(!Fe({measures:n,properties:r}))return n.forEach(function(e){return Pe(e)}),Promise.resolve();var l=a?void 0:Qe(r);return Ye({model:i,dimensionAndFieldList:s}).then(function(e){return Ge({libraryIds:l,model:i,libraryItemsProps:a}).then(function(i){n.forEach(function(n){Ke({modifiers:n.qDef.modifiers,properties:r})?(function(e){var n=e.measure,r=e.properties,i=e.libraryItemsProps,a=e.dimensionAndFieldList,s=0;Ae.isValid(n)||Ae.initBase(n,!0);var l=n.qDef,u=l.modifiers,c=l.base;Array.isArray(u)&&u.forEach(function(e){if("object"===Me(e)&&!e.disabled){if(s++,"object"!==Me(ke[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)");ke[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:ke[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 ke[r.type].updateModifier&&ke[r.type].updateModifier(r,i.qHyperCubeDef);var a=ye.getExpression(n),s=""===a?a:ke[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||je(e)?"None"!==t?delete e.qDef.base.qAggrFunc:"None"===t&&je(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)):Pe(n)})})})}({measures:a,properties:i,model:n,libraryItemsProps:c,dimensionAndFieldList:p}).then(function(){return l?Ze({oldProperties:r,newProperties:i,model:n}):Promise.resolve(!1)})})}function Pe(e){!function(e){var t=Ve(e);return Array.isArray(t)&&t.some(function(e){return"object"===Me(e)&&!e.disabled&&!ke[e.type]})}(e)?Ae.restoreBase(e):delete e.qDef.base,e.qDef.coloring&&delete e.qDef.coloring,Be(e)}function Fe(e){var t=e.measures,n=e.properties,r=e.layout;return!!Array.isArray(t)&&t.some(function(e){return Ke({modifiers:Ve(e),properties:n,layout:r})})}function Re(e){var t=Ve(e);if(Array.isArray(t))for(var n=0;n<t.length;n++){var r=t[n];if(ke[r.type]&&!r.disabled)return r}}function je(e){var t=Re(e);return!t||ke[t.type].enableTotalsFunction(e)}function He(e){return o(e,"qHyperCubeDef.qMeasures",[]).concat(o(e,"qHyperCubeDef.qLayoutExclude.qHyperCubeDef.qMeasures",[]))}function Ve(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:!Ae.isValid(e)&&n.base&&(e.qDef.base=t()(!0,{},n.base)))}(e)})}function Be(e){var t=Ve(e);Array.isArray(t)&&t.forEach(function(t){"object"===Me(t)&&(t.disabled||!ke[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 Ue(e){var t=$e(e);return e.qLibraryId||t&&t.qLibraryId}function We(e){var t=e.measure,n=e.properties,r=e.layout;return!Ue(t)&&Ke({modifiers:Ve(t),properties:n,layout:r})}function Ke(e){var t=e.modifiers,n=e.properties,r=e.layout,i={};return Array.isArray(t)&&t.some(function(e){return!("object"!==Me(e)||e.disabled||!ke[e.type])&&(void 0===i[e.type]&&(i[e.type]=ke[e.type].isApplicable({properties:n,layout:r})),i[e.type])})}function Ye(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 Ge(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 Je(e,t){if(""!==t||-1===["qFmt","qDec","qThou"].indexOf(e))return t}function Ze(e){var t=e.oldProperties,n=e.newProperties,r=e.model,i=JSON.stringify(o(t,"qHyperCubeDef.qMeasures"),Je)!==JSON.stringify(o(n,"qHyperCubeDef.qMeasures"),Je)||JSON.stringify(o(t,"qHyperCubeDef.qLayoutExclude.qHyperCubeDef.qMeasures"),Je)!==JSON.stringify(o(n,"qHyperCubeDef.qLayoutExclude.qHyperCubeDef.qMeasures"),Je);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):N(t,n,r)}({model:r,oldProperties:t,newProperties:n}).then(function(){return i}):Promise.resolve(i)}function Xe(e){var t=e.modifiers,n=e.properties,r=e.layout;return Array.isArray(t)&&t.some(function(e){return"object"===Me(e)&&!e.disabled&&ke[e.type]&&ke[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=Ve(t);if(Ke({modifiers:r,properties:e})){var o=Ue(t);o&&n.push(o),i=i||Xe({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)?(Oe[t.id].masterItemSubscriber=Oe[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 Te({model:t,masterItem:e}).then(function(){return t.app.clearUndoBuffer()})}}),Oe[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 d=n(8),f=n.n(d);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))},y=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())},g=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){f().cleanUpMeasure(e),e.qDef.modifiers&&(e.store={modifiers:e.qDef.modifiers},delete e.qDef.modifiers)})};function x(e,t,n){var r,i,a=arguments.length>3&&void 0!==arguments[3]&&arguments[3],s=o.getValue(e,t);if(!o.isAtomicValue(s))try{if((i=(i=(r=JSON.stringify(s)).match(/:\{/g))?i.length:0)>2&&!a)return;s=JSON.parse(r)}catch(e){return}o.getValue(e,"qLayoutExclude.quarantine")||o.setValue(e,"qLayoutExclude.quarantine",{});var l=o.getValue(e,"qLayoutExclude.quarantine");l[n]||(l[n]={}),l[n][t]=s}var q=n(909),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 C(e,t){return D()(!0,{},t,e)}function w(e,t,n){return"function"==typeof e?e(t):Number.isNaN(+e)?n:e}var E=Math.pow(2,53)-1;function I(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 A(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 M=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},k=function(e,t,n){t.hasOwnProperty(e)&&(n[e]=t[e])},L=function(e,t,n,r){t.hasOwnProperty(e)?n[e]=t[e]:n[e]=r},O=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}}},T=function(){return{qDef:{autoSort:!0,cId:"",numFormatFromTemplate:!0},qLibraryId:"",qTrendLines:[]}},N=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)}},P=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=C(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=C(s.excludedMeasures[t],a);o.qMeasures.length<i?o.qMeasures.push(u):o.qLayoutExclude.qHyperCubeDef.qMeasures.push(u)}},F=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=w(a.max,i.dimensions.length,E),l=w(a.min,i.dimensions.length,0);return{maxDimensions:w(o.max,s,E),minDimensions:w(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))},j=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},V=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 I(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 I(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)?I(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 A(e)}(t=a.qMeasures)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(t)||function(e,t){if(e){if("string"==typeof e)return A(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?A(e,t):void 0}}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}();a.qMeasures=[],s.forEach(function(e){a.qMeasures.push(e),r.measures.added(e,n)})}},B=function(e){var t=e.measures,n=e.modifierTypes;t&&n&&f().isSupportedModifiers(n)&&t.forEach(function(e){e.store&&e.store.modifiers&&(e.qDef.modifiers=e.store.modifiers),delete e.store})};function $(e,t){var n=o.getValue(e,"qLayoutExclude.quarantine",{})[t];return!!n&&(Object.keys(n).forEach(function(t){o.setValue(e,t,n[t])}),delete e.qLayoutExclude.quarantine[t],!0)}const U={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}),y({exportFormat:i,qHyperCubeDef:l}),delete l.qLayoutExclude,g({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",!0),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,d=void 0===p||p,f=e.isHCModifierSupported,m=void 0===f||f,h={qChildren:[]},y=j({exportFormat:t,initialProperties:r,hypercubePath:u}),g=o.getValue(r,u||"").qHyperCubeDef,v=o.getValue(y,u||"").qHyperCubeDef,b=F({exportFormat:t,dataDefinition:a}),x=b.maxDimensions,q=b.minDimensions,D=b.maxMeasures,S=b.minMeasures,C=l.defaultDimension,w=void 0===C?O():C,E=l.defaultMeasure,I=void 0===E?T():E;v.qDimensions.length=0,v.qMeasures.length=0,H({exportFormat:t,maxDimensions:x,minDimensions:q,maxMeasures:D,minMeasures:S})&&V({exportFormat:t,maxDimensions:x,minDimensions:q,maxMeasures:D,minMeasures:S,newHyperCubeDef:v}),N({exportFormat:t,maxDimensions:x,minDimensions:q,newHyperCubeDef:v,defaultDimension:w}),P({exportFormat:t,maxMeasures:D,minMeasures:S,newHyperCubeDef:v,defaultMeasure:I}),z({newProperties:y,dataDefinition:a,hypercubePath:u}),_({newProperties:y,dataDefinition:a,hypercubePath:u}),R({exportFormat:t,newHyperCubeDef:v}),k("qMaxStackedCells",g,v),k("qNoOfLeftDims",g,v),L("qInitialDataFetch",g,v,[{qTop:0,qLeft:0,qWidth:0,qHeight:0}]),L("qMode",g,v,"S"),L("qReductionMode",g,v,"N"),L("qSortbyYValue",g,v),L("qIndentMode",g,v),L("qShowTotalsAbove",g,v),M(y,t,r),h.qProperty=y;var A=o.getValue(c||{},"support.modifiers");return B({measures:v.qMeasures,modifierTypes:A}),d&&$(h.qProperty,"storedFilters"),"S"===v.qMode&&m&&$(h.qProperty,"dynamicScript"),h}};var W={cellBackgroundColor:!0,cellForegroundColor:!0,colorByAlternative:!0,colorByExpression:!0,tooltip:!0,urlLabel:!0,url:!0};function K(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 Y(e,t){return e.length!==t}const G={create:function(e,t){if(!e||!W[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(K(a,t,r,i),Y(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"}},J={getNumDimensions:function(e){return o.getValue(e,"qHyperCubeDef.qDimensions.length",0)},getNumMeasures:function(e){return o.getValue(e,"qHyperCubeDef.qMeasures.length",0)},wrapFieldName:function(e){return e.split(" ").length>1&&"="!==e[0]&&"["!==e[0]?"[".concat(e,"]"):e},getItemLabel:function(e){return e.label||e.name}},Z={colorModeOptions:{primary:function(){return!0},dimension:function(e){return J.getNumDimensions(e)>0&&J.getNumMeasures(e)<=1},multiColor:function(e){return J.getNumMeasures(e)>1},measure:function(e){return J.getNumDimensions(e)>0},expression:function(e){return J.getNumMeasures(e)>=1}}},X={colorModeOptions:{primary:function(){return!0},dimension:function(){return!0},multiColor:function(){return!1},measure:function(){return!0},expression:function(e){return J.getNumMeasures(e)>=1}}};var Q={scatterplot:X,"sn-scatter-plot":X,piechart:{colorModeOptions:{primary:function(){return!0},dimension:function(){return!0},multiColor:function(){return!1},measure:function(){return!0},expression:function(e){return J.getNumMeasures(e)>=1}}},linechart:{colorModeOptions:{primary:function(){return!0},dimension:function(e){return J.getNumDimensions(e)>1},multiColor:function(e){return J.getNumMeasures(e)>1},measure:function(e){return J.getNumDimensions(e)<=1},expression:function(e){return J.getNumMeasures(e)>=1}}},map:{colorModeOptions:{primary:function(){return!0},dimension:function(e){return J.getNumDimensions(e)>=1},multiColor:function(e){return J.getNumMeasures(e)>1},measure:function(e){return J.getNumDimensions(e)>=1},expression:function(e){return J.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 J.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=G.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"),d=o.getValue(t,"color.formatting.isCustomFormatted");if(u){var f=G.create(G.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:f,label:s,item:u,isDimension:n,qNumFormat:c,isCustomFormatted:d});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:f,measures:a,item:u,isDimension:n,qNumFormat:c,isCustomFormatted:d})}n?(f.qSortBy={qSortByAscii:1},l.qAttributeDimensions.push(f)):l.qAttributeExpressions.push(f)}}}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:f().measureBase.getLibraryId(e)}(n,t),i?(s.type="measure",s.name=i,s.id=i,o=function(e,t){return f().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=t.type,o=e.color,a=o.mode,s=J.getItemLabel(t);switch(ne(e,s||""),i){case"field":a="byDimension",o.byDimDef={label:t.label||J.wrapFieldName(t.name),key:J.wrapFieldName(t.name),type:"expression",activeDimensionIndex:t.activeDimensionIndex};break;case"expression":a="byMeasure",o.byMeasureDef={label:s,key: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)}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=G.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]||Z).colorModeOptions||Z.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=G.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)},de=function(e){e.forEach(function(e){e.qOtherTotalSpec&&"qTotalMode"in e.qOtherTotalSpec&&delete e.qOtherTotalSpec.qTotalMode})},fe=function(e){var t=e.shouldUpdateColorBy,n=e.properties,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)},ye=function(e){var t=o.getValue(e,"qHyperCubeDef.qDimensions",[]),n=o.getValue(e,"color.persistent",!1);return t.length>1&&!n},ge={exportProperties:function(e){var t=e.propertyTree,n=e.hypercubePath,r=e.viewDataMode,i=U.exportProperties({propertyTree:t,hypercubePath:n,viewDataMode:r}),o=i.data[0],a=o.dimensions.concat(o.excludedDimensions),s=o.measures.concat(o.excludedMeasures),l=G.IDMAP,u=l.COLOR_BY_ALTERNATIVE,c=l.COLOR_BY_EXPRESSION;return G.moveByIdFromGroup(a,[],"qAttributeDimensions",u),G.moveByIdFromGroup(a,[],"qAttributeExpressions",u),G.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=U.importProperties({exportFormat:t,initialProperties:n,dataDefinition:r,defaultPropertyValues:i,hypercubePath:a,extension:s,supportedFilters:l,isHCModifierSupported:u}),p=c.qProperty,d=o.getValue(p,"visualization"),f=o.getValue(p,"qHyperCubeDef.qDimensions",[]),m=o.getValue(p,"color.mode",""),h=o.getValue(p,"color.auto",""),y=ue(p,d),g=ce({canColorBy:y,autoColor:h,colorMode:m,dimensions:f});return y[m]?fe({shouldUpdateColorBy:g,properties:p})&&me(p):he(p),g&&pe(p,"qHyperCubeDef."),ye(p)&&le(p,"color.persistent",!0),de(f),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=ge.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=ge.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 Ce(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 we(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 Ee="qHyperCubeDef.qMeasures",Ie="conditionalColoring",Ae="measures",Me="qDef.conditionalColoring";const ke={quarantine:function(e){Ce({properties:e,arrayPath:Ee,quarantineName:Ie,arrayName:Ae,itemPath:Me})},unquarantine:function(e){we({properties:e,arrayPath:Ee,itemPath:Me,arrayName:Ae,quarantineName:Ie})}};var Le="qHyperCubeDef.qMeasures",Oe="measures",Te="qHyperCubeDef.qDimensions",Ne="dimensions",Pe="qHyperCubeDef.qLayoutExclude.qHyperCubeDef.qMeasures",Fe="alternativeMeasures",Re="qHyperCubeDef.qLayoutExclude.qHyperCubeDef.qDimensions",je="alternativeDimensions",He="qCalcCondition",Ve="conditionalShowHide";const ze={quarantine:function(e){Ce({properties:e,arrayPath:Le,quarantineName:Ve,arrayName:Oe,itemPath:He}),Ce({properties:e,arrayPath:Te,quarantineName:Ve,arrayName:Ne,itemPath:He})},unquarantine:function(e){we({properties:e,arrayPath:Le,quarantineName:Ve,arrayName:Oe,itemPath:He}),we({properties:e,arrayPath:Te,quarantineName:Ve,arrayName:Ne,itemPath:He})},quarantineAlternative:function(e){Ce({properties:e,arrayPath:Pe,quarantineName:Ve,arrayName:Fe,itemPath:He}),Ce({properties:e,arrayPath:Re,quarantineName:Ve,arrayName:je,itemPath:He})},unquarantineAlternative:function(e){we({properties:e,arrayPath:Pe,quarantineName:Ve,arrayName:Fe,itemPath:He}),we({properties:e,arrayPath:Re,quarantineName:Ve,arrayName:je,itemPath:He})}},_e={hypercube:U,colorChart:ge,axisChart:De,quarantineProperty:x,unquarantineProperty:$,quarantineArrayProp:Ce,unquarantineArrayProp:we,conditionalColoring:ke,conditionalShow:ze}})(),r.default})()),Vu.exports),_u=js(zu);const Bu={setValue(e,t,n){if(!t)return;const r=t.split(".");let i=e;const o=r[r.length-1];let a;for(a=0;a<r.length-1;++a)null==i[r[a]]&&(i[r[a]]=Number.isNaN(+r[a+1])?{}:[]),i=i[r[a]];void 0!==n?i[o]=n:delete i[o]},getValue(e,t,n){const r=t.split(".");let i,o=e;if(void 0===o)return n;for(i=0;i<r.length;++i){if(null==o[r[i]])return n;o=o[r[i]]}return o}},$u={getDimensions:e=>Bu.getValue(e,"qHyperCubeDef.qDimensions",[]),getNumDimensions:e=>Bu.getValue(e,"qHyperCubeDef.qDimensions.length",0),getMeasures:e=>Bu.getValue(e,"qHyperCubeDef.qMeasures",[]),getNumMeasures:e=>Bu.getValue(e,"qHyperCubeDef.qMeasures.length",0),getDimensionLayouts(e,t){const n=Bu.getValue(e,t?`${t}.qHyperCube`:"qHyperCube",null);return n?n.qDimensionInfo:[]},getDimensionLayout(e,t,n){return this.getDimensionLayouts(t,n).filter(t=>e===t.cId)[0]},getMeasureLayouts(e,t){const n=Bu.getValue(e,t?`${t}.qHyperCube`:"qHyperCube",null);return n?n.qMeasureInfo:[]},getMeasureLayout(e,t,n){return this.getMeasureLayouts(t,n).filter(t=>e===t.cId)[0]}};const Uu={colorModeOptions:{primary:()=>!0,dimension:()=>!0,multiColor:()=>!1,measure:()=>!0,expression:e=>$u.getNumMeasures(e)>=1},showLegend:e=>{const t=Bu.getValue(e,"color.auto"),n=Bu.getValue(e,"color.expressionIsColor"),r=Bu.getValue(e,"color.mode");return!(!t&&"primary"===r||!t&&"byExpression"===r&&(n||void 0===n))},persistentColorsShow:e=>!Bu.getValue(e,"color.auto")&&"byDimension"===Bu.getValue(e,"color.mode"),useDimValColShow:e=>(void 0===Bu.getValue(e,"color.useDimColVal")&&Bu.setValue(e,"color.useDimColVal",!1),!Bu.getValue(e,"color.auto")&&"byDimension"===Bu.getValue(e,"color.mode")&&"libraryItem"===Bu.getValue(e,"color.byDimDef.type"))},Wu=function(e){const{colorModeOptions:t,persistentColorsShow:n,useDimValColShow:r,showLegend:i}=Uu;this.color={colorMode:{options(n){const r=[];return"explore"===e&&r.push({value:"auto",translation:"Common.Auto"}),r.push({value:"primary",translation:"properties.colorMode.primary"}),r.push({value:"byDimension",translation:"properties.colorMode.byDimension"}),r.push({value:"byMeasure",translation:"properties.colorMode.byMeasure"}),t.expression(n)&&"explore"!==e&&r.push({value:"byExpression",translation:"properties.colorMode.byExpression"}),r}},persistentColors:{show:e=>r(e)?n(e)&&!Bu.getValue(e,"color.useDimColVal"):n(e)},useDimColVal:{show:r}},this.legend={show:i,showTitle:{show(e){const t=Bu.getValue(e,"color.auto");return Bu.getValue(e,"legend.show")&&i(e)&&(t||!function(e){return"byExpression"===Bu.getValue(e,"color.mode")&&!0===Bu.getValue(e,"color.expressionIsColor")}(e))}},dock:{show:e=>Bu.getValue(e,"legend.show")&&i(e)}}};function Ku(e){return new Wu(e)}const Yu={classification:{section:"styling",tags:["simple"],exclusive:!0},component:"items",show:!0,chartType:"piechart",translation:"LayerStyleEditor.component.styling",chartTitle:"Object.PieChart",subtitle:"LayerStyleEditor.component.styling",useGeneral:!0,items:{strokeSection:{translation:"properties.Outline",component:"items",items:{strokeItem:{component:"items",ref:"components",key:"slices",items:{strokeWrapper:{component:"inline-wrapper",items:{strokeWidth:{translation:"LayerStyleEditor.style.strokeWidth",ref:"style.strokeWidth",width:9,show:!0,component:"dropdown",type:"string",options:[{value:"none",translation:"Common.None"},{value:"small",translation:"Common.Small"},{value:"medium",translation:"Common.Medium"},{value:"large",translation:"Common.Large"}],defaultValue:"none",schemaIgnore:!0},strokeColor:{ref:"style.strokeColor",defaultValue:{color:"#FFFFFF"},schemaIgnore:!0,width:3,component:"color-picker"}}}}}}},cornerRadius:{component:"items",translation:"LayerStyleEditor.style.cornerRadius",items:{cornerRadiusItem:{component:"items",ref:"components",key:"slices",items:{cornerRadiusSlider:{ref:"style.cornerRadius",translation:"LayerStyleEditor.style.cornerRadius",component:"slider",min:0,max:40,step:.05,width:12,defaultValue:0,schemaIgnore:!0}}}}},innerRadius:{translation:"LayerStyleEditor.style.innerRadius",component:"items",show:e=>e.donut.showAsDonut,items:{innerRadiusItem:{component:"items",ref:"components",key:"slices",items:{innerRadiusSlider:{ref:"style.innerRadius",translation:"LayerStyleEditor.style.innerRadius",component:"slider",min:.05,max:.75,step:.01,width:12,defaultValue:.55,schemaIgnore:!0}}}}}}},Gu=(e,t,n)=>{const r=`${e}.fontFamily`,i=`${e}.fontSize`;return{fontFamilyItem:{component:"dropdown",ref:r,options:()=>t.getOptions(r),defaultValue:()=>t.getDefaultValue(r)},fontWrapperItem:{component:"inline-wrapper",items:{fontSizeItem:{component:"dropdown",ref:i,options:()=>t.getOptions(i),defaultValue:()=>t.getDefaultValue(i)},fontColorItem:{component:"color-picker",width:!1,ref:`${e}.color`,defaultValue:()=>({color:n.getStyle("object.pieChart",e,"color")})}}}}},Ju=(e,t,n,r)=>{const i=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]=Yn({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:r,translator:n,flags:t,config:{id:"pieChart",paths:["axis.title","label.name","label.value","legend.title","legend.label"]}});return{component:"styling-panel",chartTitle:"Object.PieChart",translation:"LayerStyleEditor.component.styling",subtitle:"LayerStyleEditor.component.styling",useGeneral:!0,useBackground:e,items:{strokeSection:{translation:"properties.Outline",component:"panel-section",items:{strokeItem:{component:"items",ref:"components",key:"slices",items:{strokeWrapper:{component:"inline-wrapper",items:{strokeWidth:{ref:"style.strokeWidth",width:9,show:!0,component:"dropdown",type:"string",options:[{value:"none",translation:"Common.None"},{value:"small",translation:"Common.Small"},{value:"medium",translation:"Common.Medium"},{value:"large",translation:"Common.Large"}],defaultValue:"none",schemaIgnore:!0},strokeColor:{ref:"style.strokeColor",defaultValue:{color:"#FFFFFF"},schemaIgnore:!0,width:3,component:"color-picker"}}}}}}},cornerRadius:{translation:"LayerStyleEditor.style.cornerRadius",component:"panel-section",items:{cornerRadiusItem:{component:"items",ref:"components",key:"slices",items:{cornerRadiusSlider:{ref:"style.cornerRadius",component:"slider",min:0,max:40,step:.05,width:12,defaultValue:0,schemaIgnore:!0}}}}},innerRadius:{translation:"LayerStyleEditor.style.innerRadius",component:"panel-section",show:e=>e.donut.showAsDonut,items:{innerRadiusItem:{component:"items",ref:"components",key:"slices",items:{innerRadiusSlider:{ref:"style.innerRadius",component:"slider",min:.05,max:.75,step:.01,width:12,defaultValue:.55,schemaIgnore:!0}}}}},axisTitleSection:t?.isEnabled("CLIENT_IM_3050")?{translation:"properties.dataPoints.dimensionlabels",component:"panel-section",items:{axisTitleItems:{component:"items",ref:"components",key:"axis",items:Gu("axis.title",i,r)}}}:void 0,labelNameSection:t?.isEnabled("CLIENT_IM_3050")?{translation:"properties.dataPoints.dimensionValueLabel",component:"panel-section",items:{labelItems:{component:"items",ref:"components",key:"label",items:Gu("label.name",i,r)}}}:void 0,labelValueSection:t?.isEnabled("CLIENT_IM_3050")?{translation:"properties.value.label",component:"panel-section",items:{labelItems:{component:"items",ref:"components",key:"label",items:Gu("label.value",i,r)}}}:void 0,legendTitleSection:t?.isEnabled("CLIENT_IM_3051")?{translation:"properties.legend.title",component:"panel-section",items:{labelItems:{component:"items",ref:"components",key:"legend",items:Gu("legend.title",i,r)}}}:void 0,legendLabelSection:t?.isEnabled("CLIENT_IM_3051")?{translation:"properties.legend.label",component:"panel-section",items:{labelItems:{component:"items",ref:"components",key:"legend",items:Gu("legend.label",i,r)}}}:void 0}}},Zu=Ku("hard");const Xu=e=>{e.color?.auto||(Vi(e,"color.mode","byDimension"),Vi(e,"color.byDimDef.activeDimensionIndex",0),Vi(e,"color.persistent",!1))},Qu=e=>{const t=[{value:"primary",translation:"properties.colorMode.primary"},{value:"byDimension",translation:"properties.colorMode.byDimension"}];switch(e.color?.mode){case"byMultiple":t.push({value:"byMultiple",translation:"properties.colorMode.multicolored"});break;case"byMeasure":t.push({value:"byMeasure",translation:"properties.colorMode.byMeasure"});break;case"byExpression":t.push({value:"byExpression",translation:"properties.colorMode.byExpression"})}return t},ec=e=>{const{flags:t,translator:n}=e||{},r=e?.sense?.theme,i=t?.isEnabled("SENSECLIENT_IM_2429_PIECHART_BG"),o={items:{simpleItems:{items:{autoColor:{label:e=>e.color?.auto?n.get("Simple.Color.Auto",n.get("properties.colorMode.byDimension")):n.get("Common.Custom"),change:Xu},colorMode:{options:Qu}}}}},a={items:{labels:{items:{header:{show:e=>e.qHyperCubeDef.qDimensions.length&&e.qHyperCubeDef.qMeasures.length},pointLabels:{component:"checkbox",ref:"dataPoint.auto",type:"boolean",defaultValue:!0,translation:"Simple.Label.Value",show:e=>e.qHyperCubeDef.qDimensions.length&&e.qHyperCubeDef.qMeasures.length,change(e){e.dataPoint.auto||Vi(e,"dataPoint.labelMode","none")}},dimensionTitle:{component:"checkbox",ref:"dimensionTitle",type:"string",translation:"Simple.Label.Dimension.Hide",defaultValue:"all",show:e=>e.qHyperCubeDef.qDimensions.length&&e.qHyperCubeDef.qMeasures.length,convertFunctions:{get:(e,t,n,r)=>!r.dimensionTitle,set(e,t,n,r,i){i.dimensionTitle=!e}}}}}}},s={uses:"settings",items:{simpleStyling:Yu,simpleLabels:a,general:{items:{showDisclaimer:{translation:"properties.showDisclaimer",type:"boolean",ref:"showDisclaimer",component:"switch",defaultValue:!0,options:[{value:!0,translation:"Common.Show"},{value:!1,translation:"properties.hide"}]}}},presentation:{type:"items",translation:"properties.presentation",grouped:!0,items:{sliceStyling:Ju(i,t,n,r),showAsDonut:{ref:"donut.showAsDonut",type:"boolean",component:"item-selection-list",defaultValue:!1,horizontal:!0,items:[{icon:"pie_chart_pie",component:"icon-item",labelPlacement:"bottom",translation:"properties.pie",value:!1},{icon:"pie_chart_donut",component:"icon-item",labelPlacement:"bottom",translation:"properties.donut",value:!0}]},labels:{type:"items",snapshot:{tid:"property-labels"},items:{dimensionTitle:{ref:"dimensionTitle",type:"boolean",component:"switch",translation:"properties.dataPoints.dimensionlabels",defaultValue:!0,options:[{value:!0,translation:"Common.Auto"},{value:!1,translation:"properties.off"}]},valuesAuto:{ref:"dataPoint.auto",type:"boolean",translation:"properties.dataPoints.labelmode",component:"switch",defaultValue:!0,options:[{value:!0,translation:"Common.Auto"},{value:!1,translation:"Common.Custom"}]},labelMode:{ref:"dataPoint.labelMode",type:"string",component:"dropdown",options:[{value:"none",translation:"Common.None"},{value:"share",translation:"properties.dataPoints.labelmode.share"},{value:"value",translation:"properties.dataPoints.labelmode.value"}],defaultValue:"share",show:e=>!e.dataPoint.auto},labelValueMode:{ref:"dataPoint.labelValueMode",type:"string",component:"dropdown",translation:"properties.dataPoints.labelvaluemode",options:[{value:"arc",translation:"Visualizations.Descriptions.Angle"},{value:"radius",translation:"Visualizations.Descriptions.Radius"}],defaultValue:"arc",show:e=>!e.dataPoint.auto&&function(e){return e.qHyperCubeDef&&e.qHyperCubeDef.qMeasures.length>1||e.qHyperCube&&e.qHyperCube.qMeasureInfo.length>1}(e)&&"value"===e.dataPoint.labelMode}}}}},colorsAndLegend:{uses:"colorsAndLegend",items:{colors:{items:{colorMode:{options:Zu.color.colorMode.options},persistentColors:{show:Zu.color.persistentColors.show}}},simpleColors:o,legend:{show:Zu.legend.show,items:{show:{defaultValue:!1,snapshot:{tid:"property-legend"}},showTitle:{show:Zu.legend.showTitle.show},dock:{show:Zu.legend.dock.show}}}}},tooltip:{uses:"tooltip"}}};return s},tc={uses:"data",items:{dimensions:{uses:"dimensions"},measures:{uses:"measures",items:{numberFormatting:{items:{percentOfPieMessage:{component:"text",translation:"properties.numberFormatting.pieMessage",show:(e,t,{properties:n}={})=>n&&(n.dataPoint.auto||"share"!==n.dataPoint.labelMode)}}}}}}},nc={uses:"sorting",items:{interColumnSorting:{reset:e=>{const{qDimensions:t,qMeasures:n,qInterColumnSortOrder:r}=e.qHyperCubeDef;if(1===t.length&&n.length>=1){const t=r.length,n=[...Array(t).keys()];[n[0],n[1]]=[n[1],n[0]],e.qHyperCubeDef.qInterColumnSortOrder=n}}}}},rc={type:"items",component:"expandable-items",translation:"properties.addons",items:{dataHandling:{uses:"dataHandling",items:{suppressZero:null,calcCond:{uses:"calcCond"}}}}};function ic(e){return{type:"items",component:"accordion",items:{data:tc,sorting:nc,addons:rc,settings:ec(e)}}}const oc=Ku("explore"),ac=ic();var sc={type:"items",component:"accordion",items:{data:{uses:"data"},sort:{uses:"sort"},presentation:{uses:"presentation",items:{showAsDonut:ac.items.settings.items.presentation.items.showAsDonut,labelMode:{type:"items",items:{labelMode:{type:"string",component:"radio-list",translation:"properties.dataPoints.labelmode",diffs:["dataPoint.auto:false","dataPoint.labelMode"],options:ac.items.settings.items.presentation.items.labels.items.labelMode.options,setPropertyValue(e,t){e.dataPoint.auto=!1,e.dataPoint.labelMode=t},getValue:e=>e.dataPoint.auto?"":e.dataPoint.labelMode}}}}},color:{uses:"color",items:{mode:{options:oc.color.colorMode.options},dimension:{items:{persistentColors:{show:e=>!(e.color&&"byDimension"===e.color.mode&&e.color.useDimColVal&&oc.color.useDimColVal.show(e))}}}}}}};const lc="slices";function uc(e,t){const n=e&&e.desc&&void 0!==e.desc.share?e.desc.share:void 0;return t("share")(n)}function cc(e){return e.data.num.label}function pc(e){return e.data.radius.label}function dc(e,t,n,r){return function(e,t){if(e.dataPoint.auto)return 1===e.qHyperCube.qSize.qcy?cc:uc;if("share"===e.dataPoint.labelMode)return uc;if("value"===e.dataPoint.labelMode)return t.encodings.slice.outerRadius&&"radius"===e.dataPoint.labelValueMode?pc:cc;return cc}(n,r)(e,t)}function fc(e){let t;return t=e.data.label?function(e,t){let n=e;return n.length>t&&(n=`${n.substr(0,t-3)}...`),n}(e.data.label,20):"",t}class mc{constructor({element:e,properties:t,effectHelper:n,Flag:r}){this.element=e,this.Flag=r,n.initFade(this.element);const i=e.find(".effectLayer");i.length>0&&i.remove(),e.append('<div class="effectLayer"></div>'),this.effectLayer=e.find(".effectLayer"),this._effectProperties=t,this.selectedIndex=t.selectedIndex,this.hasPropertiesPanel=!1,this.effectApplied=!0,n.fadeIn(this.element)}updateOrigSettings(e){return{dataPoint:e.dataPoint,legend:e.legend,dimensionTitle:e.dimensionTitle}}updateFlags(e,t){const n=this.chart.getAffectedShapes("highlight"),r=this.effectLayer[0].getBoundingClientRect(),i=n.map(n=>{const{start:i,end:o,outerRadius:a,offset:s}=n.desc.slice,{scaleRatio:l}=this.chart.component(n.key).rect,u=n.element.getBoundingClientRect(),c=(i+o)/2,p=u.left-r.left+l.x*(s.x+a*Math.sin(c)),d=u.top-r.top+l.y*(s.y-a*Math.cos(c)),f=Math.cos(c)>0?"top":"bottom",m=Math.sin(c)>0?"right":"left";return{title:fc(n),label:dc(n,this.chart.formatter,e,t),orientation:`${f}${m}`,position:{x:p,y:d}}});this.Flag.show(this.effectLayer,i)}init(e,t,n,r){return t.getProperties().then(e=>{if(!e.originalModelSettings){const t=Ws(!0,{},e);e.originalModelSettings=this.updateOrigSettings(t)}e.effectProperties=r,e.effectPath=n,e.dataPoint.show=!1,e.legend.show=!1,e.dimensionTitle=!1,t.setProperties(e)})}remove(e,t,n){return e.options=Ws(e.options,{effect:null}),n?t.getProperties().then(e=>Ws(e,{effectPath:null,effectProperties:null,dataPoint:Ws(!0,{},e.originalModelSettings.dataPoint),legend:Ws(!0,{},e.originalModelSettings.legend),dimensionTitle:e.originalModelSettings.dimensionTitle})):Promise.resolve()}}class hc extends mc{init(e,t,n,r){return e.options=Ws(!0,e.options,{effect:this}),t.layout.effectProperties&&t.layout.effectPath===n&&t.layout.effectProperties.max===r.max?Promise.resolve():super.init(e,t,n,r)}update(e,t,n){this.chart=t,this.updateHighlight(e),this.updateFlags(e,n)}updateHighlight(e){const t=this.chart.component(lc).data.items,n=e.effectProperties.min,r=e.effectProperties.max,i=[];let o=[1/0,-1],a=[-1/0,-1];t.forEach((e,t)=>{const i=e.num.value;n&&i<o[0]&&(o=[i,t]),r&&i>a[0]&&(a=[i,t])}),-1!==o[1]&&i.push(t[o[1]].value),-1!==a[1]&&i.push(t[a[1]].value),i.length&&this.chart.brush("highlight").setValues(i.map(e=>({key:"qHyperCube/qDimensionInfo/0",value:e})))}}class yc extends mc{constructor(e){super(e),this.hasPropertiesPanel=!0,this.propsTemplate=e.highlightValuePropsTemplate,this.effectHelper=e.effectHelper}onClick(e){if(!this.chart)return;const t=this.chart.shapesAt(function(e,t){const n=t.element.getBoundingClientRect();return{x:e.clientX-n.left,y:e.clientY-n.top}}(e,this.chart),{propagation:"stop"});if(1!==t.length)return;const n=t[0],r=this.chart.component(lc).data.items.map(e=>e.value).indexOf(n.data.value);-1!==r&&(this.selectedIndex=r,this.effectHelper.updateSelectedPointIndex(this))}update(e,t,n){this.chart=t,this.updateHighlight(e),this.updateDataPoints(e,n),this.updateFlags(e,n)}updateHighlight(e){const t=this.chart.component(lc).data.items[e.effectProperties.selectedIndex];this.chart.brush("highlight").setValues([{key:"qHyperCube/qDimensionInfo/0",value:t.value}])}updateDataPoints(e,t){this.dataPoints=this.chart.findShapes("path").filter(e=>e.key===lc).map((n,r)=>{const i=dc(n,this.chart.formatter,e,t);return{text:`${fc(n)} (${i})`,value:r}})}init(e,t,n,r){return e.options=Ws(!0,e.options,{effect:this}),t.layout.effectProperties&&t.layout.effectPath===n&&t.layout.effectProperties.selectedIndex===r.selectedIndex?Promise.resolve():super.init(e,t,n,r)}}const gc="/effects/highlight-value",vc="/effects/maxmin";var bc={isCompatible:({effectPath:e})=>e===vc||e===gc,create:e=>e.effectPath===vc?new hc(e):e.effectPath===gc?new yc(e):null};function xc(e){const t={},{components:n,tooltip:r}=e,i=n?n.filter(e=>"slices"===e.key)[0]:void 0;if(i&&i.style&&Object.keys(i.style).forEach(e=>{t[`chart_style_${e}`]=i.style[e]}),r){t.chart_tooltip_custom=!r.auto;const e=r.chart?.object?.refId;!r.auto&&e&&(t.chart_tooltip_custom_mini_chart=e)}return t}function qc(e){if(!e.qHyperCubeDef)return;const t=e.qHyperCubeDef.qDimensions,n=e.qHyperCubeDef.qMeasures;1===t.length&&1===n.length&&(n[0].qSortBy.qSortByNumeric=-1,e.qHyperCubeDef.qInterColumnSortOrder.splice(0,e.qHyperCubeDef.qInterColumnSortOrder.length,1,0))}function Dc(e){e.qOtherTotalSpec.qOtherMode="OTHER_COUNTED",e.qOtherTotalSpec.qOtherCounted={qv:"10"}}function Sc({translator:e}){return{dimensions:{min:1,max:1,description:()=>e.get("Visualizations.Descriptions.Slice"),add(e,t){Dc(e),qc(t),zl.addCallbackCustomTooltip(t)},move(e,t){Dc(e),qc(t),zl.moveCallbackCustomTooltip(t,e)},remove(e,t){zl.removeCallbackCustomTooltip(t,e)},replace(e,t,n,r){Dc(e),qc(r),zl.replaceCallbackCustomTooltip(r,t)}},measures:{min:1,max:2,description:(t,n)=>e.get(0===n?"Visualizations.Descriptions.Angle":"Visualizations.Descriptions.Radius"),add(e,t){qc(t)},remove(e,t){!function(e){if(!e.qHyperCubeDef)return;const t=e.qHyperCubeDef.qMeasures,{mode:n}=e.color;"byExpression"===n&&0===t.length&&(e.color.mode="primary")}(t)}}}}const Cc=e=>e.qMax<=0,wc=e=>!(!(e&&e.qHyperCube.qSize.qcy>0)||e.qHyperCube.qMeasureInfo.every(Cc));function Ec(e){return{definition:ic(e),softDefinition:sc,support:{snapshot:wc,export:wc,exportData:!0,sharing:wc,viewData:!0,effects:!0},effects:bc,extendMetrics:xc,importProperties:(t,n,r,i)=>{const o={layout:{templateId:n.templateId}};r.mapProperties(o);const a={defaultDimension:r.getDefaultDimensionProperties(),defaultMeasure:r.getDefaultMeasureProperties()},s=_u.colorChart.importProperties({exportFormat:t,initialProperties:n,dataDefinition:Sc(e),defaultPropertyValues:a,hypercubePath:i});return s.qProperty.dataPoint&&!1===s.qProperty.dataPoint.show&&delete s.qProperty.dataPoint.show,s},exportProperties:(e,t,n)=>_u.colorChart.exportProperties({propertyTree:e,hypercubePath:t,viewDataMode:n})}}function Ic(e){return{properties:{version:"1.28.19",color:{auto:!0,autoMinMax:!0,byDimDef:void 0,byMeasureDef:void 0,colorExpression:void 0,dimensionScheme:"12",expressionIsColor:!0,expressionLabel:"",formatting:{numFormatFromTemplate:!0,isCustomFormatted:void 0},measureMin:void 0,measureMax:void 0,measureScheme:"sg",mode:"primary",paletteColor:{index:6},persistent:!1,reverseScheme:!1,singleColor:void 0,useBaseColors:"off",useDimColVal:!0,useMeasureGradient:!0},components:[{key:"slices",style:{strokeWidth:"none",strokeColor:{index:-1,color:au.STROKE.COLOR},cornerRadius:au.CORNER_RADIUS,innerRadius:au.INNER_RADIUS}}],dataPoint:{auto:!0,labelMode:"share",labelValueMode:"arc"},dimensionTitle:!0,donut:{showAsDonut:!1},footnote:"",legend:{dock:"auto",show:!0,showTitle:!0},qHyperCubeDef:{qDimensions:[],qMeasures:[],qInitialDataFetch:[{qWidth:10,qHeight:500}],qSuppressMissing:!0,qSuppressZero:!1,qMode:"S"},showDetails:!0,showDisclaimer:!0,showTitles:!0,subtitle:"",title:"",tooltip:{auto:!0,hideBasic:!1,data:{qHyperCubeDef:void 0},chart:void 0,imageComponents:void 0}},data:{targets:[Sc(e)]},importProperties:({exportFormat:t,initialProperties:n,hypercubePath:r})=>{const i=_u.colorChart.importProperties({exportFormat:t,initialProperties:n,dataDefinition:Sc(e),hypercubePath:r});return i.qProperty.dataPoint&&!1===i.qProperty.dataPoint.show&&delete i.qProperty.dataPoint.show,i},exportProperties:({propertyTree:e,hypercubePath:t,viewDataMode:n})=>_u.colorChart.exportProperties({propertyTree:e,hypercubePath:t,viewDataMode:n})}}const Ac=i=>{const{flags:o}=i;!function(e){if(e&&e.get&&e.add){const t="Object.Disclaimer.LimitedData";if(e.get(t)!==t)return;Object.keys(V).forEach(t=>{e.add(V[t])})}}(i.translator);const a=function(){const i=t();return i.use(n),i.use(r(e)),i.renderer("react-qcm",ut),i.component("axis-title",nt),i.component("disclaimer",it),i.component("pie-dividers",pn),i.component("negative-indicators",hn),i}();return{qae:Ic(i),ext:Ec(i),component(){const e=_s({picasso:a}),t=Xl({flags:o,picasso:a,instance:e});Ru({instance:e,services:t,picasso:a,flags:o}),function({instance:e}){const t=k(),n=x(),r=R();I(()=>{if(!e||!e.generateSettings)return;const{viewCache:r,chart:i,generateSettings:o}=e;i.update({settings:o()}),r.set("chartWidth",i.element.clientWidth),r.set("chartHeight",i.element.clientHeight),n.effect&&n.effect.update(t,i)},[r.width,r.height])}({instance:e}),ju({instance:e,services:t})}}};export{Ac as default};
|
|
13
|
+
e.exports=function(e,t){if(!e||isNaN(+t))return t;var n,r,i,o,a,s,l,u,c,p,d=e.length,f=e.search(/[0-9\-\+#]/),m=f>0?e.substring(0,f):"",h=e.split("").reverse().join(""),y=h.search(/[0-9\-\+#]/),g=d-y,v=e.substring(g,g+1),b=g+("."===v||","===v?1:0),x=y>0?e.substring(b,d):"";if(n=(t="-"===(e=e.substring(f,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="",g=(p=t[0]).length%l,d=p.length,b=0;b<d;b++)h+=p.charAt(b),!((b-g+1)%l)&&b<d-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}},Ho(Vo={exports:{}}),Vo.exports);function _o(e){return e.replace(/[-[\]/{}()*+?.\\^$|]/g,"\\$&")}const Bo={3:"k",6:"M",9:"G",12:"T",15:"P",18:"E",21:"Z",24:"Y","-3":"m","-6":"μ","-9":"n","-12":"p","-15":"f","-18":"a","-21":"z","-24":"y"},$o=/%\)?$/,Uo=/^\(r(0[2-9]|[12]\d|3[0-6])\)/i,Wo=/^\(oct\)/i,Ko=/^\(dec\)/i,Yo=/^\(hex\)/i,Go=/^\(bin\)/i,Jo=/^\(rom\)/i,Zo=/^(\(rom\)|\(bin\)|\(hex\)|\(dec\)|\(oct\)|\(r(0[2-9]|[12]\d|3[0-6])\))/i,Xo=/#|0/g;function Qo(e,t,n,r){return e=e.toString(t),n[1]===n[1].toUpperCase()&&(e=e.toUpperCase()),e.length-e.indexOf(".")>10&&(e=e.slice(0,e.indexOf(".")+11)),e.replace(".",r||".")}function ea(e,t,n){const r=_o(e);return n?r:new RegExp(r||"",t)}function ta(e,t,n,r){let i,o,a,s,l,u,c,p,d,f=e.pattern;var m,h;r&&(e.abbreviate=!0),m=t,(h=n)&&(h=_o(h)),m&&(m=_o(m)),d=new RegExp("(?:[#0]+".concat(m,")?[#0]+(?:").concat(h,"[#0]+)?")),a=f.match(d),a=a?a[0]:"",s=a?f.substr(0,f.indexOf(a)):f,l=a?f.substring(f.indexOf(a)+a.length):"",a||(a=f?"#":"##########"),t&&t===n&&(i=a.split(n),o=i.pop(),a=i.join("")+n+o,t=""),u=t,t=/,/.test(n)?"¤":",",u&&(a=a.replace(ea(u,"g"),t)),c=n,n=".",c&&(a=a.replace(ea(c,"g"),n)),p=a.match(/#/g),p=p?p.length:0;const y=f.split(c);let g;y[1]&&(g=y[1].match(Xo)),e.prefix=s||"",e.postfix=l||"",e.pattern=f,e.maxPrecision=g?g.length:2,e.percentage=$o.test(f),e.numericPattern=a||"",e.numericRegex=new RegExp("".concat(ea(t,null,!0),"|").concat(ea(n,null,!0)),"g"),e.groupTemp=u,e.decTemp=c,e.t=t,e.d=n,e.temp=p}class na{constructor(e,t,n,r,i){this.localeInfo=e,this.pattern=t,this.thousandDelimiter=n||",",this.decimalDelimiter=r||".",this.type=i||"numeric",this.patternSeparator=";",this.abbreviations=function(e,t){if(!e||!e.qNumericalAbbreviation)return Bo;const n={};return e.qNumericalAbbreviation.split(t).forEach(e=>{let t=e.split(":");2===t.length&&(n[t[0]]=t[1])}),n}(e,this.patternSeparator),this.prepare()}clone(){const e=new na(this.localeInfo,this.pattern,this.thousandDelimiter,this.decimalDelimiter,this.type);return e.subtype=this.subtype,e}format(e,t,n,r){return this.prepare(t,n,r),this.formatValue(e)}prepare(e,t,n){let r;if(void 0===e&&(e=this.pattern),void 0===t&&(t=this.thousandDelimiter),void 0===n&&(n=this.decimalDelimiter),!e)return void(this._prepared={pattern:!1});this._prepared={positive:{d:n,t:t,abbreviate:!1,isFunctional:!1,prefix:"",postfix:""},negative:{d:n,t:t,abbreviate:!1,isFunctional:!1,prefix:"",postfix:""},zero:{d:n,t:t,abbreviate:!1,isFunctional:!1,prefix:"",postfix:""}},r=this._prepared,e=e.split(this.patternSeparator),r.positive.pattern=e[0],r.negative.pattern=e[1],r.zero.pattern=e[2],Zo.test(e[0])&&(r.positive.isFunctional=!0),e[1]?Zo.test(e[1])&&(r.negative.isFunctional=!0):r.negative=!1,e[2]?Zo.test(e[2])&&(r.zero.isFunctional=!0):r.zero=!1;const i="U"===this.type;r.positive.isFunctional||ta(r.positive,t,n,i),r.negative&&!r.negative.isFunctional&&ta(r.negative,t,n,i),r.zero&&!r.zero.isFunctional&&ta(r.zero,t,n,i)}formatValue(e){let t,n,r,i,o,a,s,l,u,c=this._prepared,p="",d="",f=e;if(isNaN(e))return"".concat(f);if(e=+e,!1===c.pattern)return e.toString();if(0===e&&c.zero)return c=c.zero,c.pattern;if(e<0&&c.negative?(c=c.negative,e=-e):c=c.positive,o=c.d,a=c.t,c.isFunctional)e=function(e,t,n){let r;return Uo.test(t)?e=Qo(e,Number(/\d{2}/.exec(t)[0]),t,n):Wo.test(t)?e=Qo(e,8,t,n):Ko.test(t)?e=Qo(e,10,t,n):Yo.test(t)?e=Qo(e,16,t,n):Go.test(t)?e=Qo(e,2,t,n):Jo.test(t)&&(r="",e<0&&(r="-",e=-e),0===(e=Math.floor(e))?e="0":e<=5e5?(e=function(e,t){let n,r="",i=Number(String(e).slice(-3)),o=(e-i)/1e3,a=[0,1,4,5,9,10,40,50,90,100,400,500,900].reverse(),s=["0","I","IV","V","IX","X","XL","L","XC","C","CD","D","CM"].reverse();for(;i>0;)for(n=0;n<a.length;n++)if(a[n]<=i){r+=s[n],i-=a[n];break}for(n=0;n<o;n++)r="M".concat(r);return t[1]!==t[1].toUpperCase()&&(r=r.toLowerCase()),r}(e,t),e=r+e):e=t+r+e.toExponential(0)),e}(e,c.pattern,o);else{if(c.percentage&&(e*=100),c.abbreviate){const t=Object.keys(this.abbreviations).map(e=>parseInt(e,10)).sort((e,t)=>e-t);let r,i,o=t[0];for(s=0,n=Number(Number(e).toExponential().split("e")[1]);o<=n&&s<t.length;)s++,o=t[s];s>0&&(r=t[s-1]),r&&n>0&&r>0?i=r:(n<0&&r<0||!r)&&(o<0&&o-n<=c.maxPrecision?i=o:r<=n&&!(o>0&&-n<=c.maxPrecision)&&(i=r)),i&&(p=this.abbreviations[i],e/=10**i)}if(r=Math.abs(e),t=c.temp,l=c.numericPattern,u=l.split(o)[1],"I"===this.type&&(e=Math.round(e)),i=e,u||"#"!==l.slice(-1)[0])if(r>=1e15||r>0&&r<=1e-14)e=r?r.toExponential(15).replace(/\.?0+(?=e)/,""):"0";else{const t=Number((e+1e-15*(e<0?-1:1)).toFixed(Math.min(20,u?u.length:0)).split(".")[0]);let n=l.split(o)[0];if(n+=o,e=zo(n,t)||"0",u){const t=Math.max(0,Math.min(14,u.length)),n=u.replace(/#+$/,"").length;let i=("I"===this.type?0:r%1+1e-15).toFixed(t).slice(2).replace(/0+$/,"");for(s=i.length;s<n;s++)i+="0";i&&(e+=o+i)}else 0===t&&(i=0)}else if(r>=10**t||r<1||r<1e-4)0===e?e="0":r<1e-4||r>=1e20?(e=(e=i.toExponential(Math.max(1,Math.min(14,t))-1)).replace(/\.?0+(?=e)/,""),d=""):(e=e.toPrecision(Math.max(1,Math.min(14,t)))).indexOf(".")>=0&&(e=(e=e.replace(e.indexOf("e")<0?/0+$/:/\.?0+(?=e)/,"")).replace(".",o));else{for(l+=o,t=Math.max(0,Math.min(20,t-Math.ceil(Math.log(r)/Math.log(10)))),s=0;s<t;s++)l+="#";e=zo(l,e)}e=e.replace(c.numericRegex,e=>e===a?c.groupTemp:e===o?c.decTemp:""),i<0&&!/^-/.test(e)&&(e="-".concat(e))}return c.prefix+e+d+p+c.postfix}static getStaticFormatter(){return{prepare(){},formatValue:e=>"".concat(e)}}}function ra(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const{size:n=5e3,multipleArguments:r=!1,toKey:i=e=>e}=t;let o,a,s=Object.create(null),l=Object.create(null),u=0,c=0;return o=r?function(){return a=i(...arguments),o.has(a)?o.get(a):o.set(a,e(...arguments))}:t=>(a=i(t),o.has(a)?o.get(a):o.set(a,e(t))),o.set=(e,t)=>(u>=n&&(delete s[l[c]],delete l[c],u--,c++),s[e]=t,l[u]=e,u++,t),o.get=e=>s[e],o.has=e=>e in s,o.clear=()=>{s=Object.create(null),l=Object.create(null),u=0,c=0},o.size=()=>u,o}function ia(e,t,n,r,i){const o=function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return new na(...t)}(i,e,t,n,r),a=ra(o.formatValue.bind(o),{toKey:e=>isNaN(e)?e:+e});function s(e){return a(e)}return s.format=function(e,t,n,r){return a.clear(),o.format(t,e,n,r)},s.pattern=function(e){return e&&(a.clear(),o.pattern=e,o.prepare()),o.pattern},s}const oa="D",aa="T",sa="TS",la=["Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"],ua=["Mon","Tue","Wed","Thu","Fri","Sat","Sun"],ca=["January","February","March","April","May","June","July","August","September","October","November","December"],pa=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function da(e,t){for(let n=e.length;n<t;n++)e="0".concat(e);return e}function fa(e){let t=e.toString().split(".");return t[1]?(t=Number("0.".concat(t[1])),t):0}class ma{constructor(e,t,n){const r=e||{};r.qCalendarStrings||(r.qCalendarStrings={qLongDayNames:la,qDayNames:ua,qLongMonthNames:ca,qMonthNames:pa}),this.localeInfo=r,this.locale_days=r.qCalendarStrings.qLongDayNames.slice(),this.locale_days_abbr=r.qCalendarStrings.qDayNames.slice(),this.locale_months=r.qCalendarStrings.qLongMonthNames.slice(),this.locale_months_abbr=r.qCalendarStrings.qMonthNames.slice(),t||(t={[aa]:r.qTimeFmt||"hh:mm:ss",[oa]:r.qDateFmt||"YYYY-MM-DD",[sa]:r.qTimestampFmt||"YYYY-MM-DD hh:mm:ss"}[n]),this.pattern=t}clone(){const e=new ma(this.localeInfo,this.pattern);return e.subtype=this.subtype,e}format(e,t){t||(t=this.pattern?this.pattern:"YYYY-MM-DD hh:mm:ss"),t=t.replace(/\[.+]|\[|]/g,"");const n=/t+/gi.test(t);let r;e instanceof Date?r=function(e,t){let n=e.getUTCHours(),r=e.getUTCDay()-1;return t&&(n%=12,n||(n=12)),r<0&&(r=6),{year:e.getUTCFullYear(),month:e.getUTCMonth(),day:r,date:e.getUTCDate(),h:n,m:e.getUTCMinutes(),s:e.getUTCSeconds(),f:e.getUTCMilliseconds(),t:e.getUTCHours()>=12?"pm":"am"}}(e,n):(e<0&&(e=-e,t="-".concat(t)),r=function(e,t){let n,r=function(e){const t=e,n=24*fa(t),r=60*fa(n),i=60*fa(r),o=1e3*fa(i);return{d:Math.floor(t),h:Math.floor(n),m:Math.floor(r),s:Math.floor(i),f:Math.round(o)}}(e),i=r.d,o=r.h,a=r.m,s=r.s,l=r.f,u=0;/w+|t+/gi.test(t)&&(n=new Date(Date.UTC(1899,11,30+Math.floor(e),0,0,Math.round(86400*(e-Math.floor(e))))),isNaN(n.getTime())&&(n=null)),/D+/gi.test(t)||(o+=24*i),/h+/gi.test(t)||(a+=60*o),/m+/gi.test(t)||(s+=60*a),/w+/gi.test(t)&&(u=n?n.getDay()-1:0,u<0&&(u=6));let c="";return n&&(c=n.getUTCHours()>=12?"pm":"am"),{year:0,month:0,day:u,date:i,h:o,m:a,s:s,f:l,t:c}}(e,t));const i=(o=this,a=r,{"Y+|y+":{Y:"".concat(Number("".concat(a.year).slice(-2))),YY:da("".concat(a.year).slice(-2),2),YYY:da("".concat(a.year).slice(-3),3),def:e=>da("".concat(a.year),e.length)},"M+":{M:a.month+1,MM:da("".concat(a.month+1),2),MMM:o.locale_months_abbr[a.month],def:o.locale_months[a.month]},"W+|w+":{W:a.day,WW:da("".concat(a.day),2),WWW:o.locale_days_abbr[a.day],def:o.locale_days[a.day]},"D+|d+":{D:a.date,def:e=>da("".concat(a.date),e.length)},"h+|H+":{h:a.h,def:e=>da("".concat(a.h),e.length)},"m+":{m:a.m,def:e=>da("".concat(a.m),e.length)},"s+|S+":{s:a.s,def:e=>da("".concat(a.s),e.length)},"f+|F+":{def(e){let t="".concat(a.f),n=e.length-t.length;if(n>0)for(let e=0;e<n;e++)t+="0";else n<0&&(t=t.slice(0,e.length));return t}},"t{1,2}|T{1,2}":{def(e){let t=a.t;return e[0].toUpperCase()===e[0]&&(t=t.toUpperCase()),t=t.slice(0,e.length),t}}});var o,a;const s=[];for(const e in i)Object.prototype.hasOwnProperty.call(i,e)&&s.push(e);const l=new RegExp(s.join("|"),"g");return t.replace(l,e=>{let t,n,r;for(n in i)if(Object.prototype.hasOwnProperty.call(i,n)&&(t=new RegExp(n),t.test(e)))break;if(!t)return"";for(const t in i[n])if(t===e||t.toLowerCase()===e){r=i[n][t],void 0===r&&(r=i[n][t.toLowerCase()]);break}return void 0===r&&(r=i[n].def),"function"==typeof r&&(r=r(e)),r})}}function ha(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return new ma(...t)}function ya(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"TS",n=ha(arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,e,t),r=ra(n.format.bind(n),{toKey:e=>"object"==typeof e&&"function"==typeof e.getTime?e.getTime():e});function i(e){return"IV"!==t?function(e){return new Date(Date.UTC(1899,11,30+Math.floor(e),0,0,0,Math.round(864e5*(e-Math.floor(e)))))}(e):e}function o(e){return e=i(e),r(e)}return o.format=function(e,t){return r.clear(),t=i(t),n.format(t,e)},o.locale=function(i){return n=ha(i,e,t),r=ra(n.format.bind(n),{toKey:e=>"object"==typeof e?e.getTime():e}),this},o.qtype=function(e){return void 0!==e&&(t=e,r.clear()),t},o}function ga(){let e,{meta:t,id:n,key:r,localeInfo:i,fieldExtractor:o,value:a,type:s,sourceField:l}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const u=a||("dimension"===s?e=>null==e?void 0:e.qElemNo:e=>null==e?void 0:e.qValue),c="dimension"===s?"first":"avg",p=function(e,t){if(e&&e.qNumFormat&&-1!==["D","T","TS","IV"].indexOf(e.qNumFormat.qType))return ya(e.qNumFormat.qFmt,e.qNumFormat.qType,t);let n="#",r=t&&void 0!==t.qThousandSep?t.qThousandSep:",",i=t&&void 0!==t.qDecimalSep?t.qDecimalSep:".",o="U",a=e&&!!e.qIsAutoFormat;return e&&e.qNumFormat?(n=e.qNumFormat.qFmt||n,r=e.qNumFormat.qThou||r,i=e.qNumFormat.qDec||i,o=e.qNumFormat.qType||o,a=a&&-1===["M"].indexOf(e.qNumFormat.qType)):a=!0,(a||"U"===o)&&(n="#".concat(i,"##"),o="U"),ia(n,r,i,o,t)}(t,i),d="dimension"===s?"first":(e,t)=>p(t),f={id:()=>n,key:()=>r,raw:()=>t,title:()=>t.qFallbackTitle||t.label,type:()=>s,origin:()=>l,items:()=>(e||(e=o(f)),e),min:()=>t.qMin,max:()=>t.qMax,value:u,label:e=>(null==e?void 0:e.qText)||"",reduce:c,reduceLabel:d,formatter:()=>p,tags:()=>t.qTags};return f}function va(e,t,n,r,i){return(t[e]||[]).map((t,o)=>{const a="".concat(r?"".concat(r,"/"):"").concat(e,"/").concat(o),s={instance:ga(to({id:"".concat(n?"".concat(n,"/"):"").concat(a),key:a,meta:t},i))};return s.attrDims=va("qAttrDimInfo",t,n,a,to({},i,{value:e=>null==e?void 0:e.qElemNo,type:"dimension"})),s.attrExps=va("qAttrExprInfo",t,n,a,to({},i,{value:e=>null==e?void 0:e.qNum,type:"measure"})),s.measures=va("qMeasureInfo",t,n,a,to({},i,{value:e=>null==e?void 0:e.qValue,type:"measure"})),s})}function ba(){let{key:e,data:t,config:n={}}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const r={fields:[],wrappedFields:[],allFields:[],virtualFields:[]},i=t;if(!i)throw new Error('Missing "data" input');if(!i.qDimensionInfo)throw new Error('The "data" input is not recognized as a hypercube');const o=ba.util,a={cache:r,cube:i,localeInfo:n.localeInfo,fieldExtractor:null,pages:null,hierarchy:()=>null,virtualFields:n.virtualFields},s={key:()=>e,raw:()=>i,field:e=>function(e,t){let{cache:n}=t;if("number"==typeof e)return n.fields[e];const r=n.allFields;if("function"==typeof e){for(let t=0;t<r.length;t++)if(e(r[t]))return r[t];return!1}if("string"==typeof e){for(let t=0;t<r.length;t++)if(r[t].key()===e||r[t].title()===e)return r[t]}else if(e&&-1!==r.indexOf(e))return e;throw Error("Field not found: ".concat(e))}(e,a),fields:()=>r.fields.slice(),extract:e=>a.extractor(e,s,r,o),hierarchy:e=>a.hierarchy(e,s,r,o),_cache:()=>r};"K"===i.qMode||"T"===i.qMode||!i.qMode&&i.qNodesOnDim?(a.extractor=jo,a.hierarchy=Ro,a.pages="K"===i.qMode?i.qStackedDataPages:i.qTreeDataPages):"S"===i.qMode?(a.extractor=oo,a.pages=i.qDataPages,a.hierarchy=Ro):a.extractor=()=>[],a.fieldExtractor=e=>a.extractor({field:e},s,r,o);const l="S"===i.qMode?e=>e.qElemNumber:void 0,u="S"===i.qMode?e=>e.qNum:void 0;r.wrappedFields.push(...va("qDimensionInfo",i,e,"",to({},a,{value:l,type:"dimension"}))),r.wrappedFields.push(...va("qMeasureInfo",i,e,"",to({},a,{value:u,type:"measure"}))),r.fields=r.wrappedFields.map(e=>e.instance);const c=e=>{e.forEach(e=>{r.allFields.push(e.instance),c(e.measures),c(e.attrDims),c(e.attrExps)})};return c(r.wrappedFields),(n.virtualFields||[]).forEach(t=>{const n=s.field(t.from),i=ga(Wi({meta:n.raw(),id:"".concat(e,"/").concat(t.key),sourceField:n,fieldExtractor:e=>a.extractor({field:e},s,r,o),key:t.key,type:n.type(),localeInfo:a.localeInfo,value:n.value},t.override||{}));r.virtualFields.push(i)}),r.allFields.push(...r.virtualFields),s}const xa=[["qHyperCube","qHyperCubeDef"],["qTreeData","qTreeDataDef"],["qDimensionInfo","qDimensions"],["qMeasureInfo","qMeasures"],["qAttrDimInfo","qAttributeDimensions"],["qAttrExprInfo","qAttributeExpressions"]],qa=/\/qDimensionInfo(?:\/(\d+))?/,Da=/\/qMeasureInfo\/(\d+)/,Sa=/\/qAttrDimInfo\/(\d+)(?:\/(\d+))?/,Ca=/\/qAttrExprInfo\/(\d+)/,wa=/\/?qHyperCube/,Ea=/\/?qTreeData/,Ia=e=>"".concat(e.substr(0,e.indexOf("/qHyperCubeDef")+14)),Aa=e=>"".concat(e.substr(0,e.indexOf("/qTreeDataDef")+13));function Ma(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2?arguments[2]:void 0;const r=t.byCells,i=t.primarySource,o=[],a={},s=e.isActive();let l=!1;return e.brushes().forEach(e=>{const t=function(e,t){let n=e,r=-1,i=-1,o="",a=e=>e;wa.test(e)?(o="".concat(n.substr(0,n.indexOf("qHyperCube")+10)),a=Ia):Ea.test(e)&&(o="".concat(n.substr(0,n.indexOf("qTreeData")+9)),a=Aa);let s=!0;if(qa.test(e)&&(r=+qa.exec(e)[1]),Da.test(e)&&(i=+Da.exec(e)[1]),Sa.test(e)){i=-1,r=0;const e=+Sa.exec(n)[2];isNaN(e)||(r=e,n=n.replace(/\/\d+$/,"")),s=!1}if(Ca.test(e)){const e=i;if(t){i=0;const a=Do(o,t);i+=(a.qMeasureInfo||[]).length,r>-1?(i=a.qDimensionInfo.slice(0,r).reduce((e,t)=>e+t.qAttrExprInfo.length,i),r=-1):(i=a.qDimensionInfo.reduce((e,t)=>e+t.qAttrExprInfo.length,i),i=a.qMeasureInfo.slice(0,e).reduce((e,t)=>e+t.qAttrExprInfo.length,i)),i+=+Ca.exec(n)[1]}else r>-1?(r=-1,i=+Ca.exec(n)[1]):i+=+Ca.exec(n)[1]+1}return xa.forEach(e=>{let[t,r]=e;n=n.replace(t,r)}),s&&(n=a(n)),n&&"/"!==n[0]&&(n="/".concat(n)),{measureIdx:i,dimensionIdx:r,path:n}}(e.id,n);if("range"===e.type&&t.measureIdx>-1&&t.dimensionIdx>-1){const n=e.brush.ranges();n.length&&(l=!0,a.multiRangeSelectTreeDataValues||(a.multiRangeSelectTreeDataValues={path:t.path,ranges:[]}),n.forEach(e=>a.multiRangeSelectTreeDataValues.ranges.push({qMeasureIx:t.measureIdx,qDimensionIx:t.dimensionIdx,qRange:{qMin:e.min,qMax:e.max,qMinInclEq:!0,qMaxInclEq:!0}})))}else{if("range"===e.type&&t.measureIdx>-1){const n=e.brush.ranges();n.length&&(l=!0,a.rangeSelectHyperCubeValues||(a.rangeSelectHyperCubeValues={path:t.path,ranges:[]}),n.forEach(e=>a.rangeSelectHyperCubeValues.ranges.push({qMeasureIx:t.measureIdx,qRange:{qMin:e.min,qMax:e.max,qMinInclEq:!0,qMaxInclEq:!0}})))}if("range"===e.type&&t.dimensionIdx>-1){const n=e.brush.ranges();n.length&&(l=!0,a.selectHyperCubeContinuousRange||(a.selectHyperCubeContinuousRange={path:t.path,ranges:[]}),n.forEach(e=>a.selectHyperCubeContinuousRange.ranges.push({qDimIx:t.dimensionIdx,qRange:{qMin:e.min,qMax:e.max,qMinInclEq:!0,qMaxInclEq:!1}})))}if("value"===e.type&&t.dimensionIdx>-1)if(r)if(n&&n.qHyperCube&&("P"===n.qHyperCube.qMode||"T"===n.qHyperCube.qMode||"K"===n.qHyperCube.qMode)){const r=n.qHyperCube,o=r.qNoOfLeftDims,s=r.qEffectiveInterColumnSortOrder.indexOf(t.dimensionIdx);if(a.selectPivotCells||(a.selectPivotCells={path:t.path,cells:[]}),e.id===i||!i){const n=e.brush.values().map(e=>+e).filter(e=>!isNaN(e));(0===o||s>=o)&&o>-1?n.forEach(e=>{a.selectPivotCells.cells.push({qType:"T",qCol:e,qRow:s-o})}):n.forEach(e=>{a.selectPivotCells.cells.push({qType:"L",qCol:t.dimensionIdx,qRow:e})}),l=!!a.selectPivotCells.cells.length}}else a.selectHyperCubeCells||(a.selectHyperCubeCells={path:t.path,cols:[]}),a.selectHyperCubeCells.cols.push(t.dimensionIdx),e.id!==i&&(i||a.selectHyperCubeCells.values)||(a.selectHyperCubeCells.values=e.brush.values().map(e=>+e).filter(e=>!isNaN(e)),l=!!a.selectHyperCubeCells.values.length);else{const n=e.brush.values().map(e=>+e).filter(e=>!isNaN(e));l=!!n.length,o.push({params:[t.path,t.dimensionIdx,n,!1],method:"selectHyperCubeValues"})}}}),!l&&s?[{method:"resetMadeSelections",params:[]}]:(a.rangeSelectHyperCubeValues&&o.push({method:"rangeSelectHyperCubeValues",params:[a.rangeSelectHyperCubeValues.path,a.rangeSelectHyperCubeValues.ranges,[],null===(u=t.orMode)||void 0===u||u]}),a.selectHyperCubeContinuousRange&&o.push({method:"selectHyperCubeContinuousRange",params:[a.selectHyperCubeContinuousRange.path,a.selectHyperCubeContinuousRange.ranges]}),a.selectHyperCubeCells&&o.push({method:"selectHyperCubeCells",params:[a.selectHyperCubeCells.path,a.selectHyperCubeCells.values,a.selectHyperCubeCells.cols]}),a.selectPivotCells&&o.push({method:"selectPivotCells",params:[a.selectPivotCells.path,a.selectPivotCells.cells]}),a.multiRangeSelectTreeDataValues&&o.push({method:"multiRangeSelectTreeDataValues",params:[a.multiRangeSelectTreeDataValues.path,a.multiRangeSelectTreeDataValues.ranges]}),o);var u}function ka(e){ba.util=e.data("matrix").util,e.data("q",ba),e.formatter("q-number",ia),e.formatter("q-time",ya)}function La(e){var t=ji(e.layout||{},e.path.split("/").join("."));if(!t)return!1;var n=t.qIsOneAndOnlyOne;return void 0!==n&&n}function Oa(e){var t=e.brush,n=e.colorField,r=e.legendAlias,i=e.useLegendCube,o=void 0!==i&&i;!n||/qAttrDimInfo/.test(n)?(t.removeKeyAlias("attrDim/qDimensionInfo/0"),r&&t.removeKeyAlias(r),t.addKeyAlias("attrDim/qDimensionInfo/0","qHyperCube/".concat(n))):o&&t.addKeyAlias(r,"qHyperCube/".concat(n))}ka.qBrushHelper=Ma,ka.selections=Ma;var Ta="Shift";var Na=function(e,t){return t[e]?Na(e+1,t):e},Pa=function(e,t){var n=t.reduce(function(e,t){return e[t]=!0,e},{});return e.reduce(function(e,t,r){var i=Na(r,n);return n[i]=!0,e[r]=i,e},{})};function Fa(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.layout,n=e.filtered,r=void 0===n?{}:n,i=(null==t?void 0:t.qHyperCube)||{},o=i.qDimensionInfo,a=void 0===o?[]:o,s=i.qMeasureInfo,l=void 0===s?[]:s;return{dimensions:Pa(a,r.dimensions||[]),measures:Pa(l,r.measures||[])}}function Ra(e){var t=e.selection,n=e.fieldMap,r=t.method,i=t.params;if("selectHyperCubeValues"===r){var o=n.dimensions[i[1]];void 0!==o&&(i[1]=o)}return"selectHyperCubeContinuousRange"===r&&i[1].forEach(function(e){var t=n.dimensions[e.qDimIx];void 0!==t&&(e.qDimIx=t)}),t}var ja=[],Ha=0,Va=function(e){var t=ja.filter(function(e){var t;return null===(t=e.selections)||void 0===t?void 0:t.isActive()});t.length&&("Enter"===e.key?t.forEach(function(e){return e.selections.confirm()}):"Escape"!==e.key&&"Esc"!==e.key||t.forEach(function(e){return e.selections.cancel()}))};function za(e){var t=e.chart,n=e.document,r=e.selectionInfo,i=e.eventName,o=e.componentName,a=e.brushName,s=void 0===a?"selection":a,l=e.emit,u=void 0===l?"rangeClear":l,c=r.event===i,p=n.querySelector("[data-key='".concat(o,"-edge-0']"));if(c||!p)return!1;var d=t.component(o);return!!d&&(d.emit(u),"string"==typeof s&&t.brush(s).clear(),d)}var _a=["chart","document","selections","selectionInfo"],Ba=function(e){e.chart,e.document,e.selections,e.selectionInfo;var t=Dn(e,_a);t.clearDiscrete(),t.clearContinuous(),t.clearMinor(),t.clearRange(),t.clearTap(),t.clearLegend()};function $a(e){var t,n=e.lasso;null!=n&&null!==(t=n.active)&&void 0!==t&&t.call(n)&&(null==n||n.action(!1))}function Ua(e){var t,n=e.chart,r=e.selectionInfo,i=e.selectionActions,o=e.actions,a=void 0===o?{}:o,s=e.selections,l=e.selectionEvents;if(!1===i||!1===l)return function(){};var u=i.reset,c=void 0===u?$a:u,p=i.clear,d=!1!==p&&function(e){var t=e.clear,n=void 0===t?Ba:t,r=e.selections,i=e.selectionInfo,o=e.chart;return function(){var e=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}).cleared,t={selections:r,selectionInfo:i,chart:o,document:document,cleared:e};return n(qn({clearDiscrete:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return function(e){var t=e.selectionInfo,n=e.chart,r=e.document,i=e.eventName,o=void 0===i?"discreteRange":i,a=e.componentName,s=void 0===a?"discrete-range-brush":a,l=e.cleared;return za({selectionInfo:t,chart:n,document:r,eventName:void 0!==l&&l?void 0:o,componentName:s,emit:"areaClear",brushName:e.brushName})}(qn(qn({},t),e))},clearContinuous:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return function(e){var t=e.selectionInfo,n=e.chart,r=e.document,i=e.eventName,o=void 0===i?"continuousRange":i,a=e.componentName,s=void 0===a?"continuous-range-brush":a,l=e.cleared;return za({selectionInfo:t,chart:n,document:r,eventName:void 0!==l&&l?void 0:o,componentName:s,brushName:e.brushName})}(qn(qn({},t),e))},clearMinor:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return function(e){var t=e.selectionInfo,n=e.chart,r=e.document,i=e.componentName,o=void 0===i?"minor-range-brush":i,a=e.eventName,s=void 0===a?"minorRange":a,l=e.cleared,u=void 0!==l&&l,c=e.brushName,p=za({selectionInfo:t,chart:n,document:r,eventName:u?void 0:s,componentName:o,brushName:void 0!==c&&c});if(p){var d=p.settings.settings,f=d.scale,m=d.brush,h=n.scale(f).data().fields.map(function(e){return e.id()}),y=n.brush(m),g=y.brushes().filter(function(e){return"range"===e.type&&h.some(function(t){return t===e.id})});y&&g.length&&g.forEach(function(e){y.removeRanges(e.brush.ranges().map(function(t){return{key:e.id,range:t}}))})}}(qn(qn({},t),e))},clearRange:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return function(e){var t=e.selectionInfo,n=e.chart,r=e.document,i=e.selections,o=e.eventName,a=void 0===o?"xAxis":o,s=e.cleared;za({selectionInfo:t,chart:n,document:r,eventName:void 0!==s&&s?void 0:a,componentName:"".concat(a,"-range-brush"),emit:"areaClear",brushName:!1})&&i.clear()}(qn(qn({},t),e))},clearTap:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return function(e){var t=e.chart,n=e.selectionInfo,r=e.selections,i=e.events,o=void 0===i?["tap"]:i,a=e.brushNames,s=void 0===a?[]:a;if(n&&o.includes(n.event)){var l=n.currentComponent;n.previousComponent!==l&&(r.clear(),s.forEach(function(e){return t.brush(e).end()}))}}(qn(qn({},t),e))},clearLegend:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return function(e){var t=e.selectionInfo,n=e.chart,r=e.document,i=e.selections,o=e.eventName,a=void 0===o?"legendRange":o,s=e.componentName,l=void 0===s?"legend-range-brush":s,u=e.cleared,c=void 0!==u&&u,p=e.brushName;za({selectionInfo:t,chart:n,document:r,eventName:c?void 0:a,componentName:l,brushName:void 0!==p&&p})&&i.clear()}(qn(qn({},t),e))}},t))}}({clear:p,selections:s,selectionInfo:r,chart:n}),f=function(e){var t=e.chart,n=e.actions,r=e.reset,i=e.clear,o=!1,a={deactivated:function(e){var t=(n||{}).lasso;r({e:e,lasso:void 0!==t&&t})},canceled:function(e){var o=(n||{}).lasso;r({e:e,lasso:void 0!==o&&o}),i({e:e,chart:t,document:document})},cleared:function(e){o||(o=!0,i({e:e,chart:t,document:document,cleared:!0}),o=!1)}};return!1===r&&delete a.deactivated,!1===i&&delete a.cleared,!1===r&&!1===i&&delete a.canceled,a}({chart:n,clear:d,reset:c,actions:a}),m={};Object.entries(f).forEach(function(e){var t=wn(e,2),n=t[0],r=t[1];m[n]=function(e,t){return t?function(n){return t({event:n,defaultFunc:e})}:e}(r,l[n])});var h=function(e){var t=e.selectionEvents,n=e.selections,r=e.selectionInfo,i=e.clear,o=e.chart,a=e.document,s=t.start,l={selections:n,selectionInfo:r,chart:o,document:a},u=function(e){return Object.assign(r,e||{})},c=function(e){var t=e.event,n=e.components;return function(){return function(e){var t=e.selectionInfo,n=e.clear,r=e.event,i=e.components,o=void 0===i?[]:i;(0,e.setSelectionInfo)(qn(qn({},void 0===t?{}:t),{},{event:r,components:o.map(function(e){return e.key}).filter(Boolean)})),n()}({event:t,components:n,clear:i,selectionInfo:r,setSelectionInfo:u})}};return"function"==typeof s?function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];s(qn(qn({defaultFunc:c({event:e,components:t}),setSelectionInfo:u,clear:i},l),{},{event:e,components:t}))}:function(e){c({event:e,components:arguments.length>1&&void 0!==arguments[1]?arguments[1]:[]})()}}({selectionEvents:l,selections:s,selectionInfo:r,clear:d,chart:n,document:document});return null==a||null===(t=a.select)||void 0===t||t.on("start",h),Object.entries(m).forEach(function(e){var t=wn(e,2),n=t[0],r=t[1];null==s||s.on(n,r)}),function(){var e;null==a||null===(e=a.select)||void 0===e||e.removeListener("start",h),Object.entries(m).forEach(function(e){var t=wn(e,2),n=t[0],r=t[1];null==s||s.removeListener(n,r)})}}var Wa=[{key:"qHyperCube/qDimensionInfo/0:numeric",includeMax:!1}];function Ka(e){var t=e.chart,n=e.actions,r=e.selections,i=e.picassoQ,o=e.config,a=o.allowSimultaneous,s=void 0!==a&&a,l=o.majorScale,u=void 0===l?void 0:l,c=o.selectionActions,p=void 0===c?{}:c,d=p.clear,f=p.reset,m=o.selectionEvents,h=void 0===m?{deactivated:void 0,canceled:void 0,cleared:void 0,start:void 0}:m,y=o.brushEvents,g=void 0===y?{}:y,v=o.brushName,b=void 0===v?"selection":v,x=o.brushMaxListeners,q=void 0===x?20:x,D=o.brushRanges,S=void 0!==D&&D,C=o.interceptors,w=void 0===C?{}:C,E=o.selectionsFn,I=void 0===E?i.selections:E,A=t.brush(b);if("number"==typeof q&&A.setMaxListeners(q),S){var M=!0===S?Wa:S;A.configure({ranges:M})}var k={canSelect:!0,getIsSelectionLocked:!1,isInnerDimensionLocked:!1,lockedDimensions:[],singleSelectIndex:0,selectionInfo:{colorField:void 0,components:[],event:void 0,currentComponent:void 0,previousComponent:void 0}},L=function(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=t.selections,r=t.brush,i=t.majorScale,o=t.actions,a=t.selectionsFn,s=(arguments.length>1&&void 0!==arguments[1]?arguments[1]:{}).path,l=void 0===s?"/qHyperCubeDef":s;if(!n)return{layout:function(){},filteredFields:function(){},allowSimultaneous:function(){},release:function(){}};var u=++Ha,c=null,p={dimensions:[],measures:[]},d=[],f={};n.on=n.on.bind(n),n.isActive=n.isActive.bind(n),n.addListener=n.addListener.bind(n),n.removeListener=n.removeListener.bind(n);var m=function(e){var t=e.brush,n=e.getConfig;return{interceptor:function(e){var r=t.brushes(),i=n(),o=i.allowSimultaneous,a=i.layout,s=void 0===a?{}:a;r.forEach(function(n){var r,i,a;("range"===n.type||null!==(r=e[0])&&void 0!==r&&r.key&&(null===(i=e[0])||void 0===i?void 0:i.key)!==n.id&&0!==o.indexOf(null===(a=e[0])||void 0===a?void 0:a.key))&&t.clear([])});var l=e.filter(function(e){return-2!==e.value});if(l.length>1){var u=function(e){var t=e.layout,n=void 0===t?{}:t,r=e.values,i=void 0===r?[]:r;if(null==i||!i.length)return[];var o=Array.from(new Set(i.map(function(e){return e.key}))),a=[];return o.forEach(function(e){var t=La({layout:n,path:e}),r=i.filter(function(t){return t.key===e}),o=t?[r.pop()]:r;a.push.apply(a,En(o))}),a.filter(Boolean)}({layout:s,values:l});return u}return l},rangeInterceptor:function(e){var r=t.brushes(),i=n().allowSimultaneous;return r.filter(function(e){return"value"===e.type}).length?(t.clear([]),e):(r.forEach(function(n){var r=n.id===e[0].key||i.includes(n.id)&&i.includes(e[0].key);"range"!==n.type||r||t.clear([])}),e)}}}({brush:r,getConfig:function(){return{layout:c,allowSimultaneous:d}}}),h=m.rangeInterceptor,y=m.interceptor;r.intercept("set-ranges",h),r.intercept("toggle-ranges",h),r.intercept("toggle-values",y),r.intercept("set-values",y),r.intercept("add-values",y),r.on("start",function(){return n.begin(l)});var g={activate:function(){},deactivated:function(){return r.end()},cleared:function(){return r.clear()},canceled:function(){return r.end()}};!function(e,t){Object.keys(t).forEach(function(n){e.on(n,t[n])})}(n,g);var v=null==i||null===(e=i.max)||void 0===e?void 0:e.call(i);return null!=o&&o.select?(o.select.on("start",function(){var e;r.start(),"function"==typeof o.select.getBrushOptions&&(f=(e=o.select).getBrushOptions.apply(e,arguments))}),o.select.on("end",function(){var e=a(r,f,c),t=Fa({layout:c,filtered:p});e.forEach(function(e){var r=Ra({selection:e,fieldMap:t});(function(e,t,n){if(t&&void 0!==n&&"selectHyperCubeContinuousRange"===e.method){var r=e.params;if(r&&r[1]&&r[1][0]){var i=r[1][0],o=i.qDimIx,a=i.qRange;"undefined"!==o&&a&&!1===a.qMaxInclEq&&a.qMax>=n&&(a.qMaxInclEq=!0)}}})(r,o.select.brushSelectionIncludeMax,v),n.select(r)})})):r.on("update",function(){var e=a(r,f,c),t=Fa({layout:c,filtered:p});e.forEach(function(e){n.select(Ra({selection:e,fieldMap:t}))})}),0===ja.length&&document.addEventListener("keyup",Va),ja.push({key:u,selections:n}),{layout:function(e){c=e},filteredFields:function(e){p=e},allowSimultaneous:function(e){d=e},release:function(){c=null;var e=ja.indexOf(ja.filter(function(e){return e.key===u})[0]);-1!==e&&ja.splice(e,1),ja.length||document.removeEventListener("keyup",Va),function(e,t){Object.keys(t).forEach(function(n){e.removeListener(n,t[n])})}(n,g)}}}({brush:A,majorScale:u,actions:n,selections:r,picassoQ:i,selectionsFn:I});!function(e){var t=e.brush,n=e.interceptors,r=void 0===n?{}:n;Object.entries(r).forEach(function(e){var n=wn(e,2),r=n[0],i=n[1];(Array.isArray(i)?i:[i]).forEach(function(e){t.intercept(r,e)})})}({brush:A,interceptors:w});var O=function(e){var t=e.chart,n=e.selectionActions,r=e.brush,i=e.actions,o=e.selectionInfo,a=e.selections,s=e.selectionEvents,l=function(e){var t=e.brush,n=e.chart,r=e.selectionInfo,i=e.brushEvents,o=void 0===i?{}:i,a=Object.entries(o).map(function(e){var i=wn(e,2),o=i[0],a=i[1],s=function(){return a({chart:n,selectionInfo:r})};return t.on(o,s),[o,s]});return function(){a.forEach(function(e){var n=wn(e,2),r=n[0],i=n[1];t.removeListener(r,i)})}}({brush:r,chart:t,selectionInfo:o,brushEvents:e.brushEvents}),u=Ua({chart:t,selectionInfo:o,selectionActions:n,actions:i,selections:a,selectionEvents:s}),c=function(e){var t=e.actions;if(null==t||!t.lasso)return function(){};var n=!1,r=function(e){n||e.key!==Ta||(t.lasso.action(!0),n=!0)},i=function(e){e.key===Ta&&(t.lasso.action(!1),n=!1)};return document.addEventListener("keydown",r),document.addEventListener("keyup",i),function(){document.removeEventListener("keydown",r),document.removeEventListener("keyup",i)}}({actions:i});return function(){l(),u(),c()}}({chart:t,brush:A,actions:n,selections:r,selectionInfo:k.selectionInfo,selectionActions:{clear:d,reset:f},selectionEvents:h,brushEvents:g});if(s){var T=!0===s?En(Array(15)).map(function(e,t){return"qHyperCube/qMeasureInfo/".concat(t)}):s;L.allowSimultaneous(T)}return{unbindEvents:O,state:k,picassoSelections:L,brush:A}}var Ya=["colorField","useLegendCube"];function Ga(e){var t=e.chart,n=e.selections,r=e.actions,i=void 0!==r&&r,o=e.config,a=void 0===o?{}:o,s=Ka({chart:t,actions:i,selections:n,picassoQ:ka,config:a}),l=s.unbindEvents,u=s.state,c=s.picassoSelections,p=s.brush,d=a.custom,f=void 0===d?{}:d,m=a.legendAlias,h=void 0===m?void 0:m,y=a.setBrushAliases,g=void 0===y?Oa:y;return{getIsDimensionLocked:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;return u.lockedDimensions[e]},getIsSelectionLocked:function(){var e,t,r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];return null!==(e=null==n||null===(t=n.isLocked)||void 0===t?void 0:t.call(n))&&void 0!==e?e:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];if(null==e||!e.length)return!1;var t=e.filter(function(e){return"object"===In(e.data)&&Array.isArray(e.data.fields)}).every(function(e){return e.data.fields.every(function(e){var t=e.raw();return!(!t.qLocked&&t.qCardinal)})});return t}(r)},getIsSingleSelect:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:u.singleSelectIndex;return u.singleSelectDimensions[e]},getCanSelect:function(){return u.canSelect},getSelectionsObject:function(){return n},getSelectionInfo:function(){return u.selectionInfo},setLayout:function(e){var t=function(e){var t,n,r,i=e.selections,o=e.picassoSelections,a=e.layout,s={lockedDimensions:[],singleSelectDimensions:[]};null!=i&&null!==(t=i.isModal)&&void 0!==t&&t.call(i)&&i.confirm(),o.layout(a);var l=(null!==(n=null==a?void 0:a.qHyperCube)&&void 0!==n?n:{}).qDimensionInfo,u=void 0===l?[]:l;return s.lockedDimensions=u.map(function(e){return!!e.qLocked}),s.singleSelectDimensions=u.map(function(e,t){return La({layout:a,path:"qHyperCube/qDimensionInfo/".concat(t)})}),s.singleSelectIndex=function(e){var t,n=((null==e?void 0:e.qHyperCube)||{}).qDimensionInfo,r=void 0===n?[]:n,i=r.map(function(e,t){var n;return!(e.qLocked||(null===(n=e.qCardinalities)||void 0===n?void 0:n.qHypercubeCardinal)<=1)&&t}).filter(function(e){return"number"==typeof e});return null!==(t=i[0])&&void 0!==t?t:Math.max(r.length-1,0)}(a),s.canSelect=0===u.length||u.some(function(e){return!e.qLocked}),s.dimensionLocked=!(null===(r=u[0])||void 0===r||!r.qLocked),s}({selections:n,picassoSelections:c,layout:e});Object.assign(u,t)},setFilteredFields:function(e){c.filteredFields(e)},setBrushAliases:function(e){var t=e.colorField,n=e.useLegendCube,r=void 0!==n&&n,i=Dn(e,Ya),o=qn({useLegendCube:r,colorField:t,brush:p,legendAlias:h},i);g(qn(qn({},o),{},{defaultFunc:function(){return Oa(o)}}))},destroy:function(){l(),c.release()},custom:qn({},f)}}var Ja="'Source Sans Pro', 'Arial', 'sans-serif'",Za="#333333",Xa="#595959",Qa="#737373",es="#cccccc",ts="#e6e6e6";function ns(e){var t={};return[].concat(En(e),En([["","","color"],["object","","fontFamily"],["object","axis.label.name","color",Xa],["object","axis.label.name","fontFamily",Ja],["object","axis.label.name","fontSize","12px"],["object","axis.line.major","color",es],["object","axis.line.minor","color",ts],["object","axis.title","color"],["object","axis.title","fontFamily",Ja],["object","axis.title","fontSize","13px"],["object","grid.line.highContrast","color",ts],["object","grid.line.major","color",es],["object","grid.line.minor","color",ts],["object","label.value","color",Xa],["object","label.value","fontFamily",Ja],["object","label.value","fontSize","12px"],[!1,"label.value","darkColor",Xa],[!1,"label.value","lightColor",ts],["object","outOfRange","color","#999"],["object","legend.title","color",Za],["object","legend.title","fontFamily",Ja],["object","legend.title","fontSize","15px"],["object","legend.label","color",Xa],["object","legend.label","fontFamily",Ja],["object","legend.label","fontSize","13px"],["object","referenceLine.label.name","color",Za],["object","referenceLine.label.name","fontFamily",Ja],["object","referenceLine.label.name","fontSize","12px"],["object","referenceLine.outOfBounds","color",ts],["object","referenceLine.outOfBounds","fontFamily",Ja],["object","referenceLine.outOfBounds","fontSize","12px"],["object","referenceLine.outOfBounds","backgroundColor",Qa,function(e){return"transparent"===e?Qa: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 rs=function(e){return e};function is(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=wn(t,2),r=n[0],i=n[1];return e[r]=i,e},{});return o.forEach(function(e){var r=wn(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,d=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}),f=(s["".concat(o,".").concat(l)]||rs)(p(d));Vi(a,[o,l].filter(Boolean).join("."),f)}),i.forEach(function(e){var t=wn(e,2),n=t[0],r=t[1];Vi(a,n,r)}),a}var os={NOOP:function(){},FALSE:function(){return!1},ARRAY:function(){return[]},OBJECT:function(){return{}}},as="chart-modules-tooltip",ss="#".concat(as);function ls(){if(!document.querySelector(ss)){var e=document.createElement("div");e.id=as,e.setAttribute("data-qs-css",""),e.style.overflow="hidden",e.style.position="fixed",e.style.pointerEvents="none",e.style.left="0px",e.style.top="0px",e.style.width="100%",e.style.height="100%",e.style.zIndex=1020,document.body.appendChild(e)}}function us(e){return{show:!0,key:e.key,type:"tooltip",layout:{displayOrder:3},beforeMount:function(){ls()},beforeUpdate:function(){ls()},destroyed:function(){var e;null!=(e=document.querySelector(ss))&&e.parentElement&&e.childElementCount<1&&e.parentElement.removeChild(e)},settings:{appendTo:function(){return document.querySelector(ss)},direction:e.rtl?"rtl":"ltr",duration:e.duration},style:{arrow:{color:"#404040"},content:{display:"table","border-spacing":"4px",background:"rgba(64, 64, 64, 0.9)",opacity:"1",fontSize:"13px",fontFamily:"'Source Sans Pro', 'Arial', 'sans-serif'","empty-cells":"show"},cell:{"max-width":"180px","word-break":"break-word","word-wrap":"break-word","overflow-wrap":"break-word",hyphens:"auto"}}}}var cs="position",ps={bar:"rect",diamond:"path",point:"circle",square:"rect",triangle:"path","n-polygon":"path",slice:"path"},ds=function(e){return e.data.value},fs=function(e){var t,n=e.data;return null==n||null===(t=n.major)||void 0===t?void 0:t.value};function ms(e){var t=e.chart,n=e.expando,r=e.nodes,i=e.collectConfig,o=e.collectibles,a=e.meta,s=i.from,l={chart:t,expando:n,nodes:r,collectConfig:i,collectibles:o,meta:a};switch("function"==typeof s?"custom":s){case"single":return function(e){var t=wn(e.nodes,1)[0];if("container"===t.type&&t.children[0]){var n=wn(t.children,1)[0];return n.key=t.key,[n]}return[t]}(l);case"position":return function(e){var t=e.collectibles,n=e.meta;return e.chart.shapesAt(n.position.absolute,{components:t.map(function(e){return{key:e.key}})})}(l);case"dimension":return function(e){var t=e.chart,n=e.nodes,r=e.collectConfig,i=e.collectibles,o=e.meta,a=wn(n,1)[0],s=r.filter,l=r.after,u="function"==typeof s?s:function(){return!0},c="function"==typeof l?l:function(){},p=i.reduce(function(e,n){var i=ps[n.type]||n.type;return e.push.apply(e,En(t.findShapes(i).filter(function(e){return e.key===n.key&&e.data&&function(e){var t=e.meta,n=e.collectible,r=e.nodes,i=e.collectConfig.by,o=void 0===i?ds:i,a=n.major,s=void 0===a?fs:a,l=o({data:r.triggerer.data}),u=s({data:r.candidate.data,meta:t}),c=Array.isArray(l),p=Array.isArray(u);return c&&p?l.length===u.length&&l.every(function(e,t){return e===u[t]}):!c&&!p&&l===u}({collectConfig:r,meta:o,collectible:n,nodes:{triggerer:a,candidate:e}})}))),e},[]).filter(u);return c({collected:p,triggerer:a}),p}(l);case"radius":return function(e){var t=e.chart,n=e.collectConfig,r=e.collectibles,i=e.meta,o=wn(e.nodes,1)[0].localBounds,a=n.distance,s=n.filter,l="function"==typeof s?s:function(){return!0},u=r.map(function(e){return e.key});return t.shapesAt({cx:i.position.absolute.x,cy:i.position.absolute.y,r:a||Math.max(o.width,o.height)},{components:u.map(function(e){return{key:e}})}).filter(l)}(l);case"custom":return function(e){var t=e.chart,n=e.expando,r=e.nodes,i=e.meta;return e.collectConfig.from({chart:t,expando:n,nodes:r,meta:i})}(l);default:return[]}}var hs=Number.MAX_VALUE;function ys(e){var t=e.nodes.filter(function(e){return e.bounds.height+e.bounds.width!==0}).reduce(function(e,t){var n=t.bounds;return e.xMin=Math.min(e.xMin,n.x,n.x+n.width),e.yMin=Math.min(e.yMin,n.y,n.y+n.height),e.xMax=Math.max(e.xMax,n.x,n.x+n.width),e.yMax=Math.max(e.yMax,n.y,n.y+n.height),e},{xMin:hs,xMax:-hs,yMin:hs,yMax:-hs}),n=t.xMin,r=t.xMax,i=t.yMin;return{x:n,y:i,width:r-n,height:t.yMax-i}}function gs(e){var t=e.chart,n=e.config,r=e.expando,i=e.internal,o=e.nodes;if(!o.length)return[];var a=wn(o,1)[0].key,s=n.main.collectibles.filter(function(e){return!e.if||e.if()});if(!s.length)return[];var l=n.main.triggers.find(function(e){return-1!==e.keys.indexOf(a)})||{},u=l.collect,c=l.placement;if(!u||!u.from||!c)return[];var p={triggerer:a,position:i.get(cs)},d=(ms({chart:t,expando:r,nodes:o,collectConfig:u,collectibles:s,meta:p})||[]).map(function(e){return e.children.length?e.children[0]:e});return d.length?function(e){var t=e.chart,n=e.config,r=e.expando,i=e.placementConfig,o=e.hovered,a=e.collected,s=e.meta,l=function(e){for(var t=e.chart,n=e.config,r=e.expando,i=e.placementConfig,o=e.hovered,a=e.collected,s=e.meta,l=wn(o,1)[0],u=Array.isArray(i)?i:[i],c={bounds:l.bounds,key:l.key},p=ys({nodes:a}),d=0;d<u.length;d++){var f=u[d];if("function"==typeof f){var m=f({chart:t,expando:r,hovered:o,collected:En(a),meta:s,collectedBounds:p,combineBounds:ys});if(m)return m}if("trigger"===f)return c;if("collectible"===f){var h=n.main.placements.collectible;return{bounds:"function"==typeof h?h({collected:En(a)}):p,key:a[0].key}}}return c}({chart:t,config:n,expando:r,placementConfig:i,hovered:o,collected:a,meta:s}),u=l.bounds,c=l.key,p=wn(a,1)[0].desc;return[{bounds:u,nodes:a,data:a.map(function(e){return e.data}),key:c,meta:s,desc:p}]}({chart:t,config:n,expando:r,placementConfig:c,hovered:o,collected:d,meta:p}):[]}var vs=new RegExp("[A-Za-zªµºÀ-ÖØ-öø-ʸʻ-ˁː-ˑˠ-ˤˮͰ-ͳͶ-ͽΆΈ-ϵϷ-҂Ҋ-։ः-हऻऽ-ीॉ-ौॎ-ॐक़-ॡ।-ॿং-হঽ-ীে-ৌৎ-ৡ০-ৱ৴-৺ਃ-ਹਾ-ੀਖ਼-੯ੲ-ੴઃ-હઽ-ીૉ-ૌૐ-ૡ૦-૯ଂ-ହଽ-ାୀେ-ୌୗ-ୡ୦-୷ஃ-ிு-ௌௐ-௲ఁ-ఽు-ౄౘ-ౡ౦-౯౿-ಹಽ-ೋೕ-ೡ೦-ീെ-ൌൎ-ൡ൦-ෆා-ෑෘ-ะา-ำเ-ๆ๏-ະາ-ຳຽ-ໆ໐-༗༚-༴༶༸༾-ཬཿ྅ྈ-ྌ྾-࿅࿇-ာေးျ-ြဿ-ၗၚ-ၝၡ-ၰၵ-ႁႃ-ႄႇ-ႌႎ-ႜ႞-ፚ፠-ᎏᎠ-Ᏼᐁ-ᙿᚁ-ᚚᚠ-ᜑᜠ-ᜱ᜵-ᝑᝠ-ᝰក-ាើ-ៅះ-ៈ។-៚ៜ០-៩᠐-ᢨᢪ-ᤜᤣ-ᤦᤩ-ᤱᤳ-ᤸ᥆-᧚ᨀ-ᨖᨙ-ᩕᩗᩡᩣ-ᩤᩭ-ᩲ᪀-᪭ᬄ-ᬳᬵᬻᬽ-ᭁᭃ-᭪᭴-᭼ᮂ-ᮡᮦ-ᮧ᮪-ᯥᯧᯪ-ᯬᯮ᯲-ᰫᰴ-ᰵ᰻-᱿᳓᳡ᳩ-ᳬᳮ-ᶿḀ-ᾼιῂ-ῌῐ-Ίῠ-Ῥῲ-ῼⁱⁿₐ-ₜℂℇℊ-ℓℕℙ-ℝℤΩℨK-ℭℯ-ℹℼ-ℿⅅ-ⅉⅎ-⅏Ⅰ-ↈ⌶-⍺⎕⒜-ⓩ⚬⠀-⣿Ⰰ-ⳤⳫ-ⳮⴀ-⵰ⶀ-ⷞ々-〇〡-〩〱-〵〸-〼ぁ-ゖゝ-ゟァ-ヺー-ㆺㇰ-㈜㈠-㉏㉠-㉻㉿-㊰㋀-㋋㋐-㍶㍻-㏝㏠-㏾㐀-䶵一-ꒌꓐ-ꘌꘐ-ꙮꚀ-ꛯ꛲-꛷Ꜣ-ꞇ꞉-ꠁꠃ-ꠅꠇ-ꠊꠌ-ꠤꠧ꠰-꠷ꡀ-ꡳꢀ-ꣃ꣎-꣙ꣲ-ꤥ꤮-ꥆꥒ-ꥼꦃ-ꦲꦴ-ꦵꦺ-ꦻꦽ-ꨨꨯ-ꨰꨳ-ꨴꩀ-ꩂꩄ-ꩋꩍ-ꪯꪱꪵ-ꪶꪹ-ꪽꫀꫂ-ꯤꯦ-ꯧꯩ-꯬꯰-ﬗA-Za-zヲ-ᅵ]"),bs=new RegExp("[־׀׃׆א-״߀-ߪߴ-ߵߺ-ࠕࠚࠤࠨ࠰-ࡘ࡞יִײַ-ﬨשׁ-ﭏ]"),xs=new RegExp("[؈؋؍؛-ي٭-ٯٱ-ەۥ-ۦۮ-ۯۺ-܍ܐܒ-ܯݍ-ޥޱﭐ-ﴽﵐ-﷼ﹰ-ﻼ]"),qs=function(e){return vs.test(e)},Ds=function(e){return bs.test(e)||xs.test(e)};function Ss(e){for(var t=e?e.length:0,n=0;n<t;n++){var r=e[n];if(qs(r))return"ltr";if(Ds(r))return"rtl"}return"ltr"}function Cs(e){var t=e.config,n=e.h,r=e.context,i={section:function(e){return function(e){return{type:"section",content:e.content}}({content:e.content})},text:function(e){var n=e.value,r=e.style,i=e.visibility;return function(e){var t=e.config,n=e.value,r=e.style,i=void 0===r?{}:r,o=i.bold,a=void 0!==o&&o,s=i.italic,l=e.visibility;return{type:"text",content:[{content:n,style:{"font-weight":a?"bold":"normal","font-style":void 0!==s&&s?"italic":"normal","text-align":t.rtl?"right":"left",direction:Ss(n),"white-space":"pre-wrap"},colspan:2}],visibility:qn(qn({},{count:!0}),l)}}({config:t,value:n,style:r,visibility:i})},measure:function(e){var r=e.label,i=e.value,o=e.color,a=e.style,s=e.survive,l=e.visibility;return function(e){var t,n,r,i,o=e.h,a=e.label,s=e.value,l=e.color,u=e.style,c=e.survive,p=e.visibility,d=e.config.rtl,f=o("div",{style:{display:"inline-block",width:10,height:10,"background-color":l,margin:"0 8px"}});return{type:"measure",label:a,value:s,content:[{content:d?[":",a]:[a,":"],style:{"text-align":d?"right":"left","font-weight":null!=u&&null!==(t=u.label)&&void 0!==t&&t.bold?"bold":"normal","font-style":null!=u&&null!==(n=u.label)&&void 0!==n&&n.italic?"italic":"normal",direction:Ss(a)}},{content:l?d?[s,f]:[f,s]:s,style:{"text-align":d?"left":"right","vertical-align":"middle","font-weight":null!=u&&null!==(r=u.value)&&void 0!==r&&r.bold?"bold":"normal","font-style":null!=u&&null!==(i=u.value)&&void 0!==i&&i.italic?"italic":"normal",direction:Ss(s)}}],survive:qn(qn({},{color:!1,duplicate:!1}),c),visibility:qn(qn({},{count:!0}),p)}}({config:t,h:n,label:r,value:i,color:o,style:a,survive:s,visibility:l})},divider:function(){return function(e){var t=e.visibility;return{type:"divider",content:[{content:"",style:{"background-image":"linear-gradient(transparent 8px, rgba(255, 255, 255, 0.4) 8px, rgba(255, 255, 255, 0.4) 9.2px, transparent 9.2px)",height:"17px"},colspan:2}],visibility:qn(qn({},{count:!1}),t)}}({visibility:(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}).visibility})},row:function(e){return function(e){var t=e.visibility;return{type:"row",content:[{content:e.content,style:e.style,colspan:e.colspan}],visibility:qn(qn({},{count:!0}),t)}}({content:e.content,style:e.style,colspan:e.colspan,visibility:e.visibility})},raw:function(e){return function(e){var t=e.visibility;return{type:"raw",content:e.value,visibility:qn(qn({},{count:!0}),t)}}({value:e.value,visibility:e.visibility})},color:function(e){var i=e.nodes,o=e.property,a=e.filter,s=void 0===a||a,l=e.visibility,u=e.fillColor;return function(e){var t=e.config,n=e.h,r=e.context,i=e.nodes,o=e.property,a=e.filter,s=e.visibility,l=e.fillColor,u=t.rtl,c={type:"color",label:void 0,value:void 0,content:[],filter:a,visibility:qn(qn({},{count:!0}),s)},p=t.getColorSettings();if("color"===p.type||!p.fieldType)return c;var d=wn(i,1)[0];if(c.value=function(e){var t=e.config,n=e.context,r=e.property,i=e.node,o=i.data[r];if(o){if(-3===i.data.value)return i.data.label;var a=n.resources.dataset(o.source.key).field(o.source.field).formatter(),s=o.value,l=o.label,u=t.getColorSettings();if(a&&"measure"===u.fieldType)return Number.isNaN(+s)?"-":a(o.value);var c=l||s;return void 0===c||Number.isNaN(c)||"NaN"===c?"-":c}}({config:t,context:r,property:o,node:d}),void 0===c.value)return c;c.label=function(e){var t=e.context,n=e.property,r=e.node,i=e.config.getColorSettings();if(i.label)return i.label;var o=r.data[n];if(o&&"color"!==i.type){var a=t.resources.dataset,s=o.source,l=s.key,u=s.field;return a(l).field(u).title()}}({config:t,context:r,property:o,node:d});var f=null!=l?l:function(e){var t=e.node.attrs;return(null==t?void 0:t.fill)||"#ddd"}({node:d}),m=n("div",{style:{display:"inline-block",width:10,height:10,"background-color":f,margin:"0 8px"}});return c.content.push({content:u?[":",c.label]:[c.label,":"],style:{"text-align":u?"right":"left",direction:Ss(c.label)}},{content:u?[c.value,m]:[m,c.value],style:{"text-align":u?"left":"right","vertical-align":"middle",direction:Ss(c.value)}}),c}({config:t,h:n,context:r,nodes:i,property:o,filter:s,visibility:l,fillColor:u})}};return i}function ws(e){var t=e.chart,n=e.translator,r=e.config,i=e.expando,o=e.h,a=e.data,s=e.style,l=wn(a,1)[0],u=function(e){var t=e.config,n=e.nodes.reduce(function(e,n){var r=t.main.getGroupByValue({data:n.data});return e[r]||(e[r]={sorting:Object.keys(e).length,items:[]}),e[r].items.push(n),e},{});return Object.keys(n).map(function(e){return n[e]}).sort(function(e,t){return e.sorting-t.sorting}).map(function(e){return e.items})}({config:r,nodes:l.node.nodes}),c=function(e){var t=e.chart,n=e.config,r=e.expando,i=e.h,o=e.context,a=e.groups,s=o.node.meta,l=o.resources,u=l.dataset,c=l.formatter,p=Cs({config:n,h:i,context:o}),d=function(e){var t=e.dataset;return{dataset:{title:function(e,n){return t(e).field(n).title()}}}}({dataset:u}),f=a.map(function(e){var t=p.section({content:En((n.main.section({expando:r,h:i,nodes:e,dataset:u,formatter:c,meta:s,create:p,util:d})||[]).filter(function(e){var t;return null===(t=e.content)||void 0===t?void 0:t.length})).filter(Boolean)});return t.content=function(e){var t=e.config,n=e.content,r=n.find(function(e){return"color"===e.type&&e.filter}),i=r?n.filter(function(e){return"measure"!==e.type||e.survive.color||e.label!==r.label||e.value!==r.value}):n;return t.main.showDuplicateMeasures?i:i.reduce(function(e,t){var n=t.type,r=t.survive;if("measure"!==n||r.duplicate)return e.filtered.push(t),e;var i="".concat(t.label,"-").concat(t.value);return e.memory[i]||(e.memory[i]=!0,e.filtered.push(t)),e},{memory:{},filtered:[]}).filtered}({config:n,content:t.content}),t});return n.main.sections({chart:t,expando:r,h:i,nodes:o.node.nodes,dataset:u,formatter:c,meta:s,create:p,util:d,sections:f}),f.filter(Boolean)}({chart:t,config:r,expando:i,h:o,context:l,groups:u}),p=function(e){var t=e.translator,n=e.config,r=e.context,i=e.templates,o=n.main.layout,a=o.rows,s=o.grouping,l=o.single,u=function(e){var t=e.limit,n=e.grouping,r=e.single,i={count:0,overflow:0,index:{started:void 0,group:void 0}};return{process:function(e){var o=e.visibility,a=e.index;if(r&&0!==a)return n?(i.index.started!==a&&i.index.group!==a&&(i.overflow++,i.index.group=a),!1):(i.overflow++,!1);if(i.count>=t){if(!n)return i.overflow++,!1;if(i.index.started!==a)return i.index.group!==a&&(i.overflow++,i.index.group=a),!1}return o.count&&i.count++,n&&(i.index.started=a),!0},overflow:function(){return i.overflow}}}({limit:a,grouping:s,single:"function"==typeof l?l({meta:r.node.meta,sections:i}):l}),c=i.reduce(function(e,t,n){var r=t.type,o=t.content;"section"===r&&(void 0===o?[]:o).forEach(function(t){u.process({visibility:t.visibility,index:n})&&e.push(t.content)});var a=n===i.length-1;return"divider"!==r||a||u.process({visibility:t.visibility,index:n})&&e.push(t.content),e},[]).filter(function(e){return e.length}),p=u.overflow();return p&&c.push(function(e){var t=e.translator,n=e.config,r=e.count,i=t?t.get("Object.ChartTooltip.NMore",r):"+".concat(r," more"),o=Ss(i);return[{content:i,style:{"font-weight":"bold","text-align":n.rtl?"right":"left",direction:o},colspan:2}]}({translator:t,config:n,count:p})),c}({translator:n,config:r,context:l,templates:c});return p.length?function(e){var t=e.h,n=e.style;return e.rows.map(function(e){return t("tr",{},e.map(function(e){var r={style:qn(qn({},n.cell||{}),e.style||{}),class:e.class};return e.colspan&&(r.colspan=e.colspan),t("td",r,e.content)}))})}({h:o,style:s,rows:p}):function(e){var t=e.h;return t("tr",{},t("td",{style:{fontStyle:"italic",opacity:.75}},"Empty"))}({h:o})}function Es(e){var t=e.chart,n=e.translator,r=e.config,i=e.expando,o=e.internal;if(!r.main.key)return!1;var a=zi(),s=us({key:r.main.key,rtl:r.rtl,duration:r.duration}),l=r.main.events.tooltip,u=l.afterShow,c=l.afterHide,p=function(){var e=a.get("collected");return{expando:i,nodes:e.nodes,meta:e.meta}};return ir(!0,s,{settings:{filter:function(e){return gs({chart:t,config:r,expando:i,internal:o,nodes:e})},extract:function(e){return a.set("collected",e.node),e},content:function(e){var o=e.h,a=e.data,s=e.style;return ws({chart:t,translator:n,config:r,expando:i,h:o,data:a,style:s})},placement:function(e){var t=e.nodes;return r.main.placement({meta:t[0].meta})},afterShow:function(){return u(p())},afterHide:function(){return c(p())}},style:{arrow:{color:r.style.background},content:r.style}})}function Is(e){var t=e.config,n=t.legend.keys;if(!n.tooltip||!n.component)return!1;if("categorical"!==t.getColorSettings().type)return!1;var r=us({key:n.tooltip,rtl:t.rtl,duration:t.duration});return ir(!0,r,{settings:{filter:function(e){return e.filter(function(e){return e.data&&e.key===n.component})},extract:function(e){return e},content:function(e){var t=e.h,n=e.data;return[t("tr",{},[t("td",{style:qn(qn({},e.style.cell||{}),{"font-weight":"bold","text-align":"left"}),colspan:2},n[0].node.data.label)])]},placement:"pointer"},style:{arrow:{color:t.style.background},content:t.style}})}function As(e){var t=e.config.main.triggers.reduce(function(e,t){return t.keys.forEach(function(n){var r=t.distance||0;e.distance[n]=r,e.distances.includes(r)||e.distances.push(r),e.key[n]=!0,e.keys[r]||(e.keys[r]=[]),e.keys[r].push(n)}),e},{distance:{},distances:[],key:{},keys:{}});return function(e){return e.components.filter(function(e){return t.key[e.key]}).reduce(function(e,n){e.any=!0,e.components.push(n.key);var r=t.distance[n.key];return 0===r?e.position.push(n.key):(e.distances.includes(r)||(e.distances.push(r),e.distanceKeys[r]=[]),e.distanceKeys[r].push(n.key)),e},{any:!1,components:[],position:[],distances:[],distanceKeys:{}})}}var Ms,ks,Ls=function(){return!0};function Os(e){var t=e.config.main.triggers.reduce(function(e,t){var n=t.filter;return t.keys.forEach(function(t){e[t]="function"==typeof n?n:Ls}),e},{});return function(e){var n=t[e.key];return!n||n(e)}}function Ts(e){var t=e.chart,n=e.event,r=e.component,i={absolute:{x:0,y:0},relative:{x:0,y:0}},o=t.element.getBoundingClientRect(),a=o.left,s=o.top;i.absolute.x=(void 0===n.clientX?Math.floor(n.srcEvent.clientX):n.clientX)-a,i.absolute.y=(void 0===n.clientY?Math.floor(n.srcEvent.clientY):n.clientY)-s;var l=t.component(r);if(l){var u=l.rect.computedInner;i.relative.x=i.absolute.x-u.x,i.relative.y=i.absolute.y-u.y}return i}function Ns(e){var t=e.chart,n=e.filter,r=e.hits,i=e.position,o=[];if(r.position.length&&o.push.apply(o,En(t.shapesAt(i.absolute,{components:r.position.map(function(e){return{key:e}})}).filter(n))),!o.length&&r.distances.length){var a=[];r.distances.forEach(function(e){a.push.apply(a,En(t.shapesAt({cx:i.absolute.x,cy:i.absolute.y,r:e},{components:r.distanceKeys[e].map(function(e){return{key:e}})}).filter(n)))}),a.length&&o.push(function(e){var t=e.nodes,n=e.origin,r=t.find(function(e){return"path"===e.type});if(r)return r;var i=function(e){var t=Math.abs(n.x-(e.localBounds.x+e.localBounds.width/2)),r=Math.abs(n.y-(e.localBounds.y+e.localBounds.height/2));return Math.sqrt(t*t+r*r)};return t.slice(1).reduce(function(e,t){var n=i(t);return n<e.distance&&(e.distance=n,e.node=t),e},{node:t[0],distance:i(t[0])}).node}({nodes:a,origin:i.relative}))}return o}function Ps(e){var t=e.chart,n=e.config,r=e.expando,i=e.internal,o=e.facade,a=n.delay.tap,s=As({config:n}),l=Os({config:n}),u=n.main.triggers.reduce(function(e,t){return e.push.apply(e,En(t.keys)),e},[]);return{key:"event:".concat("tooltipTap"),type:"Tap",options:{event:"tooltipTap",enable:function(e,r){return!r||!!n.enable({event:r})&&t.componentsFromPoint({x:r.center.x,y:r.center.y}).filter(function(e){return-1!==u.indexOf(e.key)}).length>0}},recognizeWith:"tap",events:bn({},"tooltipTap",function(e){if(e.preventDefault(),"mouse"!==e.pointerType&&!n.main.suppress({event:e})){var u=t.component(n.main.key);if(u&&u.show){var c=t.componentsFromPoint({x:e.center.x,y:e.center.y}),p=s({components:c});if(p.any){var d=wn(p.components,1)[0],f=Ts({chart:t,event:e,component:d});i.set(cs,f);var m=Ns({chart:t,filter:l,hits:p,position:f});if(m.length){var h=m[0].key;n.main.events.tooltip.beforeShow({expando:r,event:e,collectNodes:function(){return o.collectNodes({nodes:m})},meta:{triggerer:h,position:f}}).then(function(){u.emit("show",e,{nodes:m,delay:a})}).catch(function(){})}else u.emit("hide")}else u.emit("hide")}}})}}function Fs(e){var t=e.chart,n=e.config,r=e.expando,i=e.internal,o=e.facade,a=As({config:n}),s=Os({config:n}),l=function(e){var t=e.config,n=e.expando,r=e.internal,i=e.facade,o=t.main.events.tooltip.beforeShow,a=t.delay.hover,s={ongoing:{},latest:void 0};return function(e){var t=e.event,l=e.tooltip,u=e.nodes,c=function(e){var t=e.nodes;return JSON.stringify(t.map(function(e){var t;return{key:e.key,bounds:e.bounds,value:null===(t=e.data)||void 0===t?void 0:t.value}}))}({nodes:u});if(!s.ongoing[c]){s.ongoing[c]=!0,s.latest=c;var p=u[0].key;o({expando:n,event:t,collectNodes:function(){return i.collectNodes({nodes:u})},meta:{triggerer:p,position:r.get(cs)}}).then(function(){c===s.latest&&l.emit("show",t,{nodes:u,delay:a})}).catch(function(){l.emit("show")}).finally(function(){delete s.ongoing[c],c===s.latest&&(s.latest=void 0)})}}}({config:n,expando:r,internal:i,facade:o}),u=[n.main.key,n.legend.keys.tooltip].filter(Boolean),c=function(){u.forEach(function(e){var n=t.component(e);null!=n&&n.show&&n.emit("hide")})};return{type:"native",events:{mousemove:function(e){if(n.enable({event:e})&&!n.main.suppress({event:e})){var r=t.componentsFromPoint({x:e.clientX,y:e.clientY}),o=t.component(n.main.key);if(o&&o.show){var u=a({components:r});if(u.any){var c=wn(u.components,1)[0],p=Ts({chart:t,event:e,component:c});i.set(cs,p);var d=Ns({chart:t,filter:s,hits:u,position:p});if(!d.length)return void o.emit("hide");l({event:e,tooltip:o,nodes:d})}else o.emit("hide")}var f=n.legend;if(f.keys.tooltip&&f.keys.component){var m=t.component(f.keys.tooltip);m&&m.show&&(r.some(function(e){return e.key===f.keys.component})?m.emit("show",e):m.emit("hide"))}}},mouseup:function(e){2===e.button&&c()},mouseleave:function(){n.main.events.interaction.mouseleave({expando:r}),c()},wheel:function(){c()}}}}function Rs(e){var t=e.chart,n=e.translator,r=function(e){var t=e.config;return ir(!0,{},{rtl:!1,enable:os.FALSE,getColorSettings:os.OBJECT,style:{fontSize:void 0,fontFamily:void 0,color:void 0,background:void 0},delay:{hover:500,tap:0},duration:8e3,main:{key:void 0,suppress:os.FALSE,getGroupByValue:os.NOOP,collectibles:[],triggers:[],placement:function(){return{type:"bounds"}},placements:{collectible:"combine"},showDuplicateMeasures:!1,layout:{rows:7,grouping:!1,single:!1},section:os.ARRAY,sections:os.NOOP,events:{tooltip:{beforeShow:function(){return Promise.resolve()},afterShow:os.NOOP,afterHide:os.NOOP},interaction:{mouseleave:os.NOOP}}},legend:{keys:{tooltip:void 0,component:void 0}}},void 0===t?{}:t)}({config:e.config}),i=zi(),o=zi(),a={components:void 0,interactions:void 0};return{getComponents:function(){return a.components||(a.components=function(e){var t=e.config;return[Es({chart:e.chart,translator:e.translator,config:t,expando:e.expando,internal:e.internal}),Is({config:t})].filter(Boolean)}({chart:t,translator:n,config:r,expando:i,internal:o})),a.components},getInteractions:function(){return a.interactions||(a.interactions=function(e){var t=e.chart,n=e.config,r=e.expando,i=e.internal,o=function(e){var t=e.chart,n=e.config,r=e.expando,i=e.internal;return{collectNodes:function(e){var o=e.nodes,a=wn(gs({chart:t,config:n,expando:r,internal:i,nodes:o}),1)[0];return(void 0===a?{nodes:[]}:a).nodes}}}({chart:t,config:n,expando:r,internal:i});return{gestures:[Ps({chart:t,config:n,expando:r,internal:i,facade:o})],native:Fs({chart:t,config:n,expando:r,internal:i,facade:o})}}({chart:t,config:r,expando:i,internal:o})),a.interactions},expando:i}}function js(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Hs=function(){if(ks)return Ms;ks=1;var e={};function t(){t.init.call(this)}return e.isObject=function(e){return"object"==typeof e&&null!==e},e.isNumber=function(e){return"number"==typeof e},e.isUndefined=function(e){return void 0===e},e.isFunction=function(e){return"function"==typeof e},Ms=t,t.EventEmitter=t,t.prototype._events=void 0,t.prototype._maxListeners=void 0,t.defaultMaxListeners=10,t.init=function(){this._events=this._events||{},this._maxListeners=this._maxListeners||void 0},t.prototype.setMaxListeners=function(t){if(!e.isNumber(t)||t<0||isNaN(t))throw TypeError("n must be a positive number");return this._maxListeners=t,this},t.prototype.emit=function(t){var n,r,i,o,a,s;if(this._events||(this._events={}),"error"===t&&!this._events.error)throw(n=arguments[1])instanceof Error?n:Error('Uncaught, unspecified "error" event.');if(r=this._events[t],e.isUndefined(r))return!1;if(e.isFunction(r))switch(arguments.length){case 1:r.call(this);break;case 2:r.call(this,arguments[1]);break;case 3:r.call(this,arguments[1],arguments[2]);break;default:for(i=arguments.length,o=new Array(i-1),a=1;a<i;a++)o[a-1]=arguments[a];r.apply(this,o)}else if(e.isObject(r)){for(i=arguments.length,o=new Array(i-1),a=1;a<i;a++)o[a-1]=arguments[a];for(i=(s=r.slice()).length,a=0;a<i;a++)s[a].apply(this,o)}return!0},t.prototype.addListener=function(n,r){var i;if(!e.isFunction(r))throw TypeError("listener must be a function");(this._events||(this._events={}),this._events.newListener&&this.emit("newListener",n,e.isFunction(r.listener)?r.listener:r),this._events[n]?e.isObject(this._events[n])?this._events[n].push(r):this._events[n]=[this._events[n],r]:this._events[n]=r,e.isObject(this._events[n])&&!this._events[n].warned)&&((i=e.isUndefined(this._maxListeners)?t.defaultMaxListeners:this._maxListeners)&&i>0&&this._events[n].length>i&&(this._events[n].warned=!0,e.isFunction(console.error)&&console.error("(node) warning: possible EventEmitter memory leak detected. %d listeners added. Use emitter.setMaxListeners() to increase limit.",this._events[n].length),e.isFunction(console.trace)&&console.trace()));return this},t.prototype.on=t.prototype.addListener,t.prototype.once=function(t,n){if(!e.isFunction(n))throw TypeError("listener must be a function");var r=!1;function i(){this.removeListener(t,i),r||(r=!0,n.apply(this,arguments))}return i.listener=n,this.on(t,i),this},t.prototype.removeListener=function(t,n){var r,i,o,a;if(!e.isFunction(n))throw TypeError("listener must be a function");if(!this._events||!this._events[t])return this;if(o=(r=this._events[t]).length,i=-1,r===n||e.isFunction(r.listener)&&r.listener===n)delete this._events[t],this._events.removeListener&&this.emit("removeListener",t,n);else if(e.isObject(r)){for(a=o;a-- >0;)if(r[a]===n||r[a].listener&&r[a].listener===n){i=a;break}if(i<0)return this;1===r.length?(r.length=0,delete this._events[t]):r.splice(i,1),this._events.removeListener&&this.emit("removeListener",t,n)}return this},t.prototype.removeAllListeners=function(t){var n,r;if(!this._events)return this;if(!this._events.removeListener)return 0===arguments.length?this._events={}:this._events[t]&&delete this._events[t],this;if(0===arguments.length){for(n in this._events)"removeListener"!==n&&this.removeAllListeners(n);return this.removeAllListeners("removeListener"),this._events={},this}if(r=this._events[t],e.isFunction(r))this.removeListener(t,r);else if(Array.isArray(r))for(;r.length;)this.removeListener(t,r[r.length-1]);return delete this._events[t],this},t.prototype.listeners=function(t){return this._events&&this._events[t]?e.isFunction(this._events[t])?[this._events[t]]:this._events[t].slice():[]},t.listenerCount=function(t,n){return t._events&&t._events[n]?e.isFunction(t._events[n])?1:t._events[n].length:0},Ms}(),Vs=js(Hs);function zs(){const e={};var t;return t=e,Object.keys(Vs.prototype).forEach(e=>{t[e]=Vs.prototype[e]}),Vs.init(t),e.lasso={active:()=>!1},e.select={on:e.on,removeListener:e.removeListener},e}function _s({picasso:e}){const t=x(),n=q(),r=D(),[i,o]=S(),a=zs(),s=C(),l=w(),u=!!s.qSelectionInfo?.qInSelections,[c,p]=S(!1);return a.lasso=function({layout:e,isInSelections:t,isLassoActionActive:n,setIsLassoActionActive:r,translator:i}){return{active:n,label:i.get(n?"Tooltip.ToggleOffLassoSelection":"Tooltip.ToggleOnLassoSelection"),hidden:!t||!!e.qHyperCube?.qDimensionInfo?.[0]?.qIsOneAndOnlyOne,action(e){r("boolean"==typeof e?e:!n)},icon:{shapes:[{type:"path",attrs:{d:"M15.9488039,5.20769129 C16.0487326,6.70662306 15.3492311,8.30548361 14.050157,9.30477145 C12.651154,10.5039169 10.8524359,10.8037032 8.85386017,10.4039881 L7.3549284,10.0042729 L5.75606786,9.70448659 C5.75606786,9.90434416 5.65613907,10.0042729 5.4562815,10.2041305 C5.05656637,10.6038456 4.55692244,10.8037032 4.05727852,10.8037032 C3.75749217,10.8037032 3.45770582,10.7037744 3.15791946,10.6038456 C3.05799068,10.903632 3.15791946,11.2034184 3.45770582,11.7030623 C5.05656637,14.0014243 3.85742095,15.9000712 3.75749217,16 L2.2585604,15.3004985 C2.2585604,15.2005697 2.95806189,14.0014243 1.95877405,12.6024213 C1.6589877,12.0028486 1.15934378,11.0035608 1.55905891,10.0042729 C1.6589877,9.80441537 1.75891648,9.6045578 1.95877405,9.40470024 C1.6589877,8.90505631 1.55905891,8.30548361 1.85884527,7.7059109 C1.55905891,7.40612455 1.25927256,7.1063382 1.15934378,6.70662306 C0.859557424,5.90719279 0.959486209,4.5081898 1.6589877,3.30904439 C1.95877405,2.6095429 2.55834676,2.0099702 3.15791946,1.51032628 C3.95734974,0.91075357 4.95663758,0.610967217 6.15578299,0.311180864 C9.05371774,-0.388320626 11.9516525,0.111323295 13.9502282,1.61025506 C15.1493736,2.50961412 15.8488751,3.80868831 15.9488039,5.20769129 Z M13.0508691,8.10562604 C13.8502994,7.40612455 14.3499433,6.40683671 14.3499433,5.30762008 C14.2500145,4.20840345 13.550513,3.40897318 12.9509403,2.90932926 C12.1515101,2.40968533 11.252151,2.0099702 10.1529344,1.81011263 C8.95378895,1.61025506 7.75464354,1.71018384 6.45556935,1.91004141 C4.75678001,2.30975655 3.65756338,3.00925804 3.05799068,4.10847467 C2.55834676,5.00783373 2.65827554,5.90719279 2.75820433,6.20697914 C2.75820433,6.30690792 2.85813311,6.40683671 3.05799068,6.40683671 C3.15791946,6.40683671 3.25784825,6.40683671 3.35777703,6.40683671 C3.45770582,6.40683671 3.45770582,6.40683671 3.45770582,6.40683671 L3.5576346,6.40683671 L3.65756338,6.40683671 C4.65685123,6.40683671 5.4562815,6.90648063 5.85599664,7.80583969 L5.85599664,8.00569726 C6.35564056,8.10562604 7.05514205,8.30548361 7.75464354,8.50534118 L9.25357531,8.90505631 C10.0530056,9.0049851 10.7525071,9.0049851 11.4520086,8.80512753 C12.0515813,8.70519875 12.5512252,8.40541239 13.0508691,8.10562604 Z"}}]}}}({layout:s,isInSelections:u,isLassoActionActive:c,setIsLassoActionActive:p,translator:l}),E(()=>(i&&(i.interactions.lasso.active=()=>c),{...a.lasso}),[i,c,u,l.language()]),I(()=>{n.style.overflow="hidden";const i=e({renderer:{prio:[t.renderer||"canvas"]}}),l=i.chart({element:n,data:[],settings:{}}),u=Ga({chart:l,actions:a,selections:r,config:{selectionActions:!1}});u.setLayout(s),u.setBrushAliases({colorField:"qDimensionInfo/0/qAttrDimInfo/0"});const c=function(e){var t=qn({},e),n={},r={},i=!1,o={get:function(e){return t[e]},set:function(e,o){var a=t[e];!i&&n[e]?t[e]=n[e](o,a):t[e]=o,!i&&r[e]&&r[e](t[e],a)},preventSet:function(e,t){i=!0,o.set(e,t),i=!1},intercept:function(e,t){n[e]=t},onChanged:function(e,t){r[e]=t}};return o}({legendScrollOffset:0,rotation:0});c.intercept("rotation",e=>(c.get("rotation")+e)%(2*Math.PI)),c.onChanged("rotation",()=>{l.update({partialData:!0})});const p=zi();return a.on("selections-start",()=>{l.brush("selection").start()}),o({picasso:i,chart:l,selectionService:u,viewState:c,viewCache:p,interactions:a}),()=>{u.destroy(),l.destroy(),a.removeAllListeners(),delete a.select,c.intercept("rotation",void 0),c.onChanged("rotation",void 0)}},[]),i}var Bs,$s;var Us=function(){if($s)return Bs;$s=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 Bs=function e(){var t,n,r,l,u,c,p=arguments[0],d=1,f=arguments.length,m=!1;for("boolean"==typeof p&&(m=p,p=arguments[1]||{},d=2),(null==p||"object"!=typeof p&&"function"!=typeof p)&&(p={});d<f;++d)if(null!=(t=arguments[d]))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},Bs}(),Ws=js(Us);const Ks=[["FULL",{width:550,height:450}],["MEDIUM",{width:400,height:220}],["SMALL",{width:300,height:150}],["XSMALL",{width:150,height:75}],["SPARK",{width:0,height:0}]],Ys={};Ks.forEach(([e,{width:t,height:n}])=>{Ys[e]={width:t,height:n}});const Gs={getLayoutModes:()=>Ys,getLayoutMode(e,t){let n;for(n=0;n<Ks.length;++n)if(e>=Ks[n][1].width&&t>=Ks[n][1].height)return Ks[n][0];return"SPARK"}};function Js(e,t){return{layoutModes:Gs.getLayoutModes(),center:void 0!==t.minCenterRatio?{minWidthRatio:t.minCenterRatio,minHeightRatio:t.minCenterRatio}:void 0,logicalSize:t.logicalSize?{align:.5,preserveAspectRatio:!0,...t.logicalSize}:void 0}}const Zs=/^[A-Z][A-z0-9_]*$/i,Xs={getChar(e){let t=e,n=-1;return t>9?(n=65+t-10,n>90&&(n+=6)):t=`${t}`.charCodeAt(0),[48,111,79,105,73,108].indexOf(n)>-1?this.getChar(t+1):String.fromCharCode(n)},base62(e){const t=this.getChar(e%62),n=Math.floor(e/62);return n>0?this.base62(n)+t:t},id(){return this.base62(Math.round(99e11*Math.random()+1e11)).replace(/\W/g,"")}},Qs={setValue:(e,t,n)=>{if(!t)return!1;const r=t.split("."),i=r[r.length-1];let o,a=e;for(o=0;o<r.length-1;++o)void 0===a[r[o]]&&(a[r[o]]=Number.isNaN(+r[o+1])?{}:[]),a=a[r[o]];if(void 0!==n){const e=a[i];return a[i]=n,{updated:n,previous:e}}return delete a[i],!1},getValue:(e,t,n)=>{const r=t.split(".");let i,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},moveArrayElement:(e,t,n)=>{if(n>=e.length){let t=n-e.length;for(;1+t--;)e.push(void 0)}e.splice(n,0,e.splice(t,1)[0])},escapeField:e=>{let t;return t=!e||"]"===e||Zs.test(e)?e:`[${e.replace(/\]/g,"]]")}]`,t},deleteUndefinedProperties:e=>{Object.keys(e).forEach(t=>{void 0===e[t]&&delete e[t]})},generateId:()=>Xs.id(),shouldUseFormat:e=>!e.isCustomFormatted&&(e.qIsAutoFormat||"U"===e.qNumFormat.qType)};function el(e,t){const n=e.component(t);return n&&n._DO_NOT_USE_getInfo&&n._DO_NOT_USE_getInfo().offset}const tl=new RegExp("[A-Za-zªµºÀ-ÖØ-öø-ʸʻ-ˁː-ˑˠ-ˤˮͰ-ͳͶ-ͽΆΈ-ϵϷ-҂Ҋ-։ः-हऻऽ-ीॉ-ौॎ-ॐक़-ॡ।-ॿং-হঽ-ীে-ৌৎ-ৡ০-ৱ৴-৺ਃ-ਹਾ-ੀਖ਼-੯ੲ-ੴઃ-હઽ-ીૉ-ૌૐ-ૡ૦-૯ଂ-ହଽ-ାୀେ-ୌୗ-ୡ୦-୷ஃ-ிு-ௌௐ-௲ఁ-ఽు-ౄౘ-ౡ౦-౯౿-ಹಽ-ೋೕ-ೡ೦-ീെ-ൌൎ-ൡ൦-ෆා-ෑෘ-ะา-ำเ-ๆ๏-ະາ-ຳຽ-ໆ໐-༗༚-༴༶༸༾-ཬཿ྅ྈ-ྌ྾-࿅࿇-ာေးျ-ြဿ-ၗၚ-ၝၡ-ၰၵ-ႁႃ-ႄႇ-ႌႎ-ႜ႞-ፚ፠-ᎏᎠ-Ᏼᐁ-ᙿᚁ-ᚚᚠ-ᜑᜠ-ᜱ᜵-ᝑᝠ-ᝰក-ាើ-ៅះ-ៈ។-៚ៜ០-៩᠐-ᢨᢪ-ᤜᤣ-ᤦᤩ-ᤱᤳ-ᤸ᥆-᧚ᨀ-ᨖᨙ-ᩕᩗᩡᩣ-ᩤᩭ-ᩲ᪀-᪭ᬄ-ᬳᬵᬻᬽ-ᭁᭃ-᭪᭴-᭼ᮂ-ᮡᮦ-ᮧ᮪-ᯥᯧᯪ-ᯬᯮ᯲-ᰫᰴ-ᰵ᰻-᱿᳓᳡ᳩ-ᳬᳮ-ᶿḀ-ᾼιῂ-ῌῐ-Ίῠ-Ῥῲ-ῼⁱⁿₐ-ₜℂℇℊ-ℓℕℙ-ℝℤΩℨK-ℭℯ-ℹℼ-ℿⅅ-ⅉⅎ-⅏Ⅰ-ↈ⌶-⍺⎕⒜-ⓩ⚬⠀-⣿Ⰰ-ⳤⳫ-ⳮⴀ-⵰ⶀ-ⷞ々-〇〡-〩〱-〵〸-〼ぁ-ゖゝ-ゟァ-ヺー-ㆺㇰ-㈜㈠-㉏㉠-㉻㉿-㊰㋀-㋋㋐-㍶㍻-㏝㏠-㏾㐀-䶵一-ꒌꓐ-ꘌꘐ-ꙮꚀ-ꛯ꛲-꛷Ꜣ-ꞇ꞉-ꠁꠃ-ꠅꠇ-ꠊꠌ-ꠤꠧ꠰-꠷ꡀ-ꡳꢀ-ꣃ꣎-꣙ꣲ-ꤥ꤮-ꥆꥒ-ꥼꦃ-ꦲꦴ-ꦵꦺ-ꦻꦽ-ꨨꨯ-ꨰꨳ-ꨴꩀ-ꩂꩄ-ꩋꩍ-ꪯꪱꪵ-ꪶꪹ-ꪽꫀꫂ-ꯤꯦ-ꯧꯩ-꯬꯰-ﬗA-Za-zヲ-ᅵ]"),nl=new RegExp("[־׀׃׆א-״߀-ߪߴ-ߵߺ-ࠕࠚࠤࠨ࠰-ࡘ࡞יִײַ-ﬨשׁ-ﭏ]"),rl=new RegExp("[؈؋؍؛-ي٭-ٯٱ-ەۥ-ۦۮ-ۯۺ-܍ܐܒ-ܯݍ-ޥޱﭐ-ﴽﵐ-﷼ﹰ-ﻼ]"),il={lrm:String.fromCharCode(8206),rlm:String.fromCharCode(8207),isLtrChar:e=>tl.test(e),isRtlChar:e=>nl.test(e)||rl.test(e),detectTextDirection(e){const t=e?e.length:0;let n,r;for(n=0;n<t;n++){if(r=e[n],il.isLtrChar(r))return"ltr";if(il.isRtlChar(r))return"rtl"}return"ltr"}},ol={getColorSymbol:(e,t)=>e.h("div",{style:{display:"inline-block",width:"10px",height:"10px","background-color":t.color.fill,margin:"0 8px"}}),getNodeFillColor:e=>e.attrs&&void 0!==e.attrs.fill?e.attrs.fill:e.children&&e.children[0]&&e.children[0].attrs&&void 0!==e.children[0].attrs.fill?e.children[0].attrs.fill:void 0,getColor(e,t,n){const r=t.data,i=e.resources.formatter,o=e.resources.dataset,a={};if(n.coloring.label&&(a.label=`${n.coloring.label}`),"color"!==n.coloring.type&&r.fillTooltip){const e=i("fill"),t="measure"===n.coloring.fieldType;if(a.value=t&&e?e(r.fillTooltip.value):r.fillTooltip.label?r.fillTooltip.label:r.fillTooltip.value,!n.coloring.label){const e=o(r.fillTooltip.source.key).field(r.fillTooltip.source.field).title();a.label=`${e}`}}return a.fill=void 0===r._fillColor?ol.getNodeFillColor(t):r._fillColor,a},getMeasure:(e,t)=>({label:`${e(t.source.key).field(t.source.field).title()}`,value:""===t.label||"NaN"===t.label?"-":t.label,field:t.source.field}),hideColorRow:(e,t)=>void 0===e.color.value||e.measures.some(e=>e.field===t.coloring.field),getTitleRow(e,t){const n=il.detectTextDirection(e.title);return[{content:e.title,style:{"font-weight":"bold","text-align":t?"right":"left",direction:n,"white-space":"pre-wrap"},colspan:2},{}]},getDescriptionRow(e,t){const n=il.detectTextDirection(e.value);return[{content:e.value,style:{"text-align":t?"right":"left",direction:n,"white-space":"pre-wrap"},colspan:2},{}]},getNMoreRow(e,t,n){const r=t?t.get("Object.ChartTooltip.NMore",e):`+${e} more`;return[{content:r,style:{"font-weight":"bold","text-align":n?"right":"left",direction:il.detectTextDirection(r)},colspan:2},{}]},getSeparatorRow:()=>[{content:"",style:{"background-image":"linear-gradient(transparent 8px, rgba(255, 255, 255, 0.4) 8px, rgba(255, 255, 255, 0.4) 9.2px, transparent 9.2px)",height:"17px"},colspan:2},{}],getColorRow(e,t,n){const r=il.detectTextDirection(t.color.label),i=n?[":",t.color.label]:[t.color.label,":"],o=il.detectTextDirection(t.color.value);return[{content:i,style:{"text-align":n?"right":"left",direction:r}},{content:n?[t.color.value,ol.getColorSymbol(e,t)]:[ol.getColorSymbol(e,t),t.color.value],style:{"text-align":n?"left":"right",direction:o,"vertical-align":"middle"}}]},getMeasureRow(e,t,n,r,i=!1){const o=il.detectTextDirection(e.label),a=r?[":",e.label]:[e.label,":"],s=il.detectTextDirection(e.value);let l;return l=i?r?[e.value,ol.getColorSymbol(t,n)]:[ol.getColorSymbol(t,n),e.value]:[e.value],[{content:a,style:{"text-align":r?"right":"left",direction:o}},{content:l,style:{"text-align":r?"left":"right",direction:s,"vertical-align":"middle"}}]}};function al(e){const t=parseInt(e,10);if(!isNaN(t))return t}const sl=e=>t=>e.getContrastingColorTo(t.node.attrs.fill);function ll(e,t){const n=e.styleService.label.value.getStyle();return{padding:10,placements:e.simplifiedPlacements.map(n=>function(e,t,n){const r=n.themeService.getStyles(),i=n.styleService.label.value.getStyle(),o=i.fill===r.label.value.color;return{position:e.position,justify:e.justify,fill:o&&!e.onBackground?sl(t):i.fill,overflow:e.overflow,padding:e.padding}}(n,t,e)),fontSize:al(n.fontSize),fontFamily:n.fontFamily,label:e.label}}function ul(e,t){return e<t?-1:e>t?1:e>=t?0:NaN}var cl,pl;1===(cl=ul).length&&(pl=cl,cl=function(e,t){return ul(pl(e),t)});var dl="$";function fl(){}function ml(e,t){var n=new fl;if(e instanceof fl)e.each(function(e,t){n.set(t,e)});else if(Array.isArray(e)){var r,i=-1,o=e.length;if(null==t)for(;++i<o;)n.set(i,e[i]);else for(;++i<o;)n.set(t(r=e[i],i,e),r)}else if(e)for(var a in e)n.set(a,e[a]);return n}function hl(){}fl.prototype=ml.prototype={constructor:fl,has:function(e){return dl+e in this},get:function(e){return this[dl+e]},set:function(e,t){return this[dl+e]=t,this},remove:function(e){var t=dl+e;return t in this&&delete this[t]},clear:function(){for(var e in this)e[0]===dl&&delete this[e]},keys:function(){var e=[];for(var t in this)t[0]===dl&&e.push(t.slice(1));return e},values:function(){var e=[];for(var t in this)t[0]===dl&&e.push(this[t]);return e},entries:function(){var e=[];for(var t in this)t[0]===dl&&e.push({key:t.slice(1),value:this[t]});return e},size:function(){var e=0;for(var t in this)t[0]===dl&&++e;return e},empty:function(){for(var e in this)if(e[0]===dl)return!1;return!0},each:function(e){for(var t in this)t[0]===dl&&e(this[t],t.slice(1),this)}};var yl=ml.prototype;hl.prototype={constructor:hl,has:yl.has,add:function(e){return this[dl+(e+="")]=e,this},remove:yl.remove,clear:yl.clear,values:yl.keys,size:yl.size,empty:yl.empty,each:yl.each},Ws.bind(null,!0);const gl=[[2,4,6],[2,4],[3]],vl=[,[,,[[1,2]],[[1,2,3],[1,3]],[[1,2,4],[1,4]],[[1,2,4],[1,5]],[[1,2,4,6],[2,4,6],[1,3,6],[1,6]],[[1,2,4,6],[2,4,6],[1,3,6],[1,7]],[[1,2,4,8],[2,4,8],[1,8]],[[1,2,4,8],[2,4,8],[1,3,9],[1,9]],[[1,2,4,6,10],[1,2,4,10],[1,3,10],[3,10],[1,10]]],[,,,[[2,3]],[[2,3,4],[2,4]],[[2,3,4],[2,4],[2,5]],[[2,4,6],[2,6]],[[2,4,6],[2,6],[2,7]],[[2,4,8],[2,8]],[[2,4,8],[2,8],[2,9]],[[2,4,6,10],[2,4,10],[5,10],[3,10]]],[,,,,[[3,4]],[[3,4,5],[3,5]],[[3,4,5,6],[3,6]],[[3,4,5,6],[3,5,7],[3,7]],[[3,4,5,6,8],[3,5,7],[4,8],[3,8]],[[3,4,5,6,8],[3,4,6,9],[3,4,6,8],[3,6,9],[4,8],[3,9]],[[4,6,10],[5,10],[3,10]]],[,,,,,[[4,5]],[[4,5,6],[4,6]],[[4,5,6,7],[4,5,6],[4,6]],[[4,5,6,7,8],[4,5,6,7],[4,6,8],[4,8]],[[4,5,6,7,8],[4,6,9],[4,6,8],[4,8]],[[4,6,10],[5,7,9],[5,10],[4,10]]],[,,,,,,[[5,6]],[[5,6,7],[5,7]],[[5,6,7,8],[5,6,7],[6,8]],[[5,6,7,8,9],[5,6,7,8],[5,7,9],[5,9]],[[6,8,10],[5,10]]],[,,,,,,,[[6,7]],[[6,7,8],[6,8]],[[6,7,8,9],[6,7,8],[6,9]],[[6,7,8,9,10],[6,8,10],[6,10]]],[,,,,,,,,[[7,8]],[[7,8,9],[7,9]],[[7,8,9,10],[8,10],[7,10],[7,9]]],[,,,,,,,,,[[8,9]],[[8,9,10],[8,10]]],[,,,,,,,,,,[[9,10]]]];function bl(e,t,n){const r=e?e.length:0;let i,o=void 0===t?Number.MAX_VALUE:e[0]/t;for(i=1;i<r;i++)o=Math.min(o,e[i]/e[i-1]);void 0!==n&&(o=Math.min(o,n/e[r-1])),e.splice(0,0,o)}function xl(e,t,n){let r;const i=e?e.length:0;for(r=0;r<i;r++)bl(e[r],t,n)}!function(){let e,t;for(xl(gl,1,10),e=0;e<vl.length;e++)if(vl[e])for(t=0;t<vl[e].length;t++)Array.isArray(vl[e][t])&&xl(vl[e][t])}();var ql={dataRelatedPropertiesPaths:["qHyperCube.qGrandTotalRow","qHyperCube.qHasOtherValues","qHyperCube.qSize","qHyperCube.qDimensionInfo[].qAttrDimInfo","qHyperCube.qDimensionInfo[].qAttrExprInfo","qHyperCube.qDimensionInfo[].qCardinalities","qHyperCube.qDimensionInfo[].qMax","qHyperCube.qDimensionInfo[].qMin","qHyperCube.qDimensionInfo[].qStateCounts","qHyperCube.qMeasureInfo[].qApprMaxGlyphCount","qHyperCube.qMeasureInfo[].qAttrExprInfo","qHyperCube.qMeasureInfo[].qMax","qHyperCube.qMeasureInfo[].qMin","qHyperCube.qMeasureInfo[].qTrendLines","qHyperCube.qTreeNodesOnDim","qSelectionInfo","plugins[].validMeasureValue","plugins[].labelBackgroundColor","plugins[].labelColor","plugins[].hasBackground","plugins[].maxLabelWidth","plugins[].points[].validMeasureValue","plugins[].points[].labelBackgroundColor","plugins[].points[].labelColor","plugins[].points[].hasBackground","plugins[].points[].maxLabelWidth"]};function Dl(e){const{qHyperCube:t,...n}=e,{qAxisData:r,qDataPages:i,qStackedDataPages:o,qTreeDataPages:a,...s}=t,l=Ws(!0,{},{...n,qHyperCube:{...s}}),{dataRelatedPropertiesPaths:u}=ql;function c(e,t){const n=t.indexOf("[]");if(-1===n)return void(void 0!==ji(e,t)&&Vi(e,t,void 0));const r=t.substring(0,n),i=t.substring(n+2),o=i.startsWith(".")?i.substring(1):i;ji(e,r,[]).forEach(e=>{o&&c(e,o)})}return u.forEach(e=>{c(l,e)}),l}var Sl={axes:{trackBy:function({isTime:e,isContinuous:t,isMeasure:n,isMajor:r}){return i=>{if(e||t||n){if("line"===i.type)return i.tickValue??"axis";if("text"===i.type)return`${i.tickValue} ${i.text}`;if("container"===i.type){const e=i.children.filter(e=>"text"===e.type).map(e=>e.text);return`${i.data.value} ${e.join("")}`}return Math.random()}if(r){if("line"===i.type&&void 0===i.tickValue)return"axis";const e=i.transform&&i.transform.match(/rotate/gi)?"rotated":"horizontal";return`${i.data.group?`${i.data.group.value} `:""}${i.data.value} ${i.text} ${e}`}return Math.random()}},compensateForLayoutChanges:function({isMeasure:e,isTime:t,isContinuous:n,isHorizontal:r,dock:i}){return({currentNodes:o,currentRect:a,previousRect:s})=>{const l=a.x-s.x,u=a.y-s.y,c=a.width-s.width,p=a.height-s.height;e?("left"===i&&o.forEach(e=>{"line"===e.type?(e.x1+=c,e.x2+=c):"text"===e.type&&(e.x+=c)}),"left"!==i&&"right"!==i||o.forEach(e=>{"line"===e.type&&(e.x1===e.x2?(e.y1=a.y,e.y2=e.y1+a.height):(Math.round(e.y1)<a.y||e.y1>a.y+a.height)&&(e.strokeWidth=0)),"text"===e.type&&(e.y<a.y||e.y>a.y+a.height)&&(e.fontSize="1px","#"===e.fill?.[0]&&(e.fill=`${e.fill.slice(0,1)}00${e.fill.slice(1)}`))}),"top"!==i&&"bottom"!==i||o.forEach(e=>{"line"===e.type&&(e.y1===e.y2?(e.x1=a.x,e.x2=e.x1+a.width):(Math.round(e.x1)<a.x||e.x1>a.x+a.width)&&(e.strokeWidth=0)),"text"===e.type&&(e.x<a.x||e.x>a.x+a.width)&&(e.fontSize="1px","#"===e.fill?.[0]&&(e.fill=`${e.fill.slice(0,1)}00${e.fill.slice(1)}`))})):t?o.forEach(e=>{"line"===e.type?e.y1===e.y2?e.x2+=c:e.x1===e.x2&&(e.x1-=l,e.x2-=l):"text"===e.type&&(e.x-=l)}):n||r?o.forEach(e=>{"line"===e.type&&e.y1===e.y2&&(e.x1+=l,e.x2+=l+c)}):o.forEach(e=>{"line"===e.type&&e.x1===e.x2&&(e.y1+=u,e.y2+=u+p)})}}},bars:{trackBy:function(e){return e.data.typeIndex?`${e.data.value} ${e.data.typeIndex.value}`:e.data.measureIndex?`${e.data.value} ${e.data.measureIndex.value}`:e.data.group?`${e.data.value} ${e.data.group.value}`:e.data.stack?`${e.data.value} ${e.data.stack.value}`:`${e.data.value}`},compensateForLayoutChanges:function({currentNodes:e,currentRect:t,previousRect:n}){const r=t.x-n.x,i=t.y-n.y;0===r&&0===i||e.forEach(e=>{e.children&&e.children.length>0&&e.children.forEach(e=>{void 0!==e.x&&void 0!==e.y?(e.x-=r,e.y-=i):e.transform=`translate(${-r}, ${-i})`})})}},barOobs:{compensateForLayoutChanges:function({currentNodes:e,currentRect:t,previousRect:n}){const r=t.x-n.x;0===t.y-n.y&&0===r||e.forEach(e=>{e.children&&e.children.length>0&&e.children.forEach(e=>{e.opacity=0})})}},labels:{trackBy:function(e){if("rect"===e.type)return"-3"===e.data?Math.random():`${e.type} ${e.data} ${e.rotation}`;const t=e.transform&&e.transform.match(/rotate/gi)?"rotated":"horizontal";return`${e.type} ${e.data} ${e.text} ${t}`},compensateForLayoutChanges:function({currentNodes:e,currentRect:t,previousRect:n}){const r=t.x-n.x,i=t.y-n.y;0===r&&0===i||e.forEach(e=>{e.transform&&e.transform.match(/rotate\(-90/gi)?(e.x+=i,e.y-=r):(e.x-=r,e.y-=i)})},linkData:function(e){return e.data.measureIndex?`${e.data.value} ${e.data.measureIndex.value}`:e.data.group?`${e.data.value} ${e.data.group.value}`:e.data.stack?`${e.data.value} ${e.data.stack.value}`:`${e.data.value}`}},lines:{trackBy:function(e){return"line"===e.type?e.value??Math.random():"path"===e.type?`${e.generatorType} ${e.layerObj.id} ${e.data.source.key}`:Math.random()},compensateForLayoutChanges:function({currentNodes:e,currentRect:t,previousRect:n}){const r=t.x-n.x,i=t.y-n.y;e.forEach(e=>{if(void 0!==e.x1&&void 0!==e.y1)e.y1===e.y2?(e.x2=e.x1+t.width,e.y1-=i,e.y2-=i):e.x1===e.x2&&(e.y2=e.y1+t.height,e.x1-=r,e.x2-=r);else{const t="x"===e.major.p?r/e.major.size:i/e.major.size,n="y"===e.minor.p?i/e.minor.size:r/e.minor.size;e.points.forEach(e=>{e.modified||(e.major-=t,e.minor-=n,e.minor0-=n,e.modified=!0)})}})}},lineOobs:{compensateForLayoutChanges:function({currentNodes:e,currentRect:t,previousRect:n}){const r=t.x-n.x;0===t.y-n.y&&0===r||e.forEach(e=>{e.opacity=0})}},markers:{trackBy:function(e){return e.data.line?`${e.data.line.value} ${e.data.major.value}`:`${e.data.major.value}`},compensateForLayoutChanges:function({currentNodes:e,currentRect:t,previousRect:n}){const r=t.x-n.x,i=t.y-n.y;0===r&&0===i||e.forEach(e=>{switch(e.type){case"circle":e.cx-=r,e.cy-=i;break;case"rect":e.x-=r,e.y-=i;break;case"path":e.transform=`translate(${-r}, ${-i})`}})}},points:{trackBy:function(e){return e.data.line?`${e.data.line.value} ${e.data.major.value}`:`${e.data.major.value}`},compensateForLayoutChanges:function({currentNodes:e,currentRect:t,previousRect:n}){const r=t.x-n.x,i=t.y-n.y;0===r&&0===i||e.forEach(e=>{"image"===e.type?(e.x-=r,e.y-=i):(e.cx-=r,e.cy-=i)})}},refLineLabels:{trackBy:function(e){if(void 0!==e.value){if("rect"===e.type)return`${e.value}`;if("text"===e.type)return`${e.value} ${e.text}`}return Math.random()},compensateForLayoutChanges:function({currentNodes:e,currentRect:t,previousRect:n}){const r=t.x-n.x,i=t.y-n.y,o=t.width-n.width,a=t.height-n.height;let s=-r,l=-i;e.forEach(e=>{switch(e.dock){case"right":r>0&&(s=t.width);break;case"left":o<0&&(s=-n.width);break;case"top":a<0&&(l=-n.height);break;case"bottom":i>0&&(l=t.height)}switch(e.type){case"text":case"rect":e.x+=s,e.y+=l;break;case"circle":e.cx+=s,e.cy+=l;break;case"path":e.transform=`translate(${s}, ${l})`}})}},shadowBars:{trackBy:function(){return Math.random()}},cacheProperties:function({viewCache:e,layout:t}){const n=Dl(t);e.set("dataIndependentProperties",JSON.stringify(n))},propertiesHaveChanged:function({viewCache:e,layout:t}){const n=Dl(t);return e.get("dataIndependentProperties")!==JSON.stringify(n)},nonUpdatingNode:{trackBy:function(){return Math.random()}}};function Cl(e,t=!1){const n=t?"IM_5791_SVG_LABEL_RENDERING":"IM_4962_SVG_CHART_LABELS";if(e?.isEnabled(n))return/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)?void 0:"svg"}var wl=class e{constructor(e,t){this._key=e,this._value=t}getKey(){return this._key}getValue(){return this._value}equals(t){return t instanceof e&&(this._key===t._key&&this._value===t._value)}static newInstanceIfNeeded(){let t,n,r=arguments[0];return"string"==typeof arguments[1]?(t=arguments[1],n=r.length):(n=arguments[1],t=arguments[2]),t&&r?(r.length>n&&(r=r.substr(0,n)),new e(r,t)):null}},El=class e{setValue(e){this._nextMap=null,this._value=e}getNextNode(e){return this._nextMap?this._nextMap[e]:null}put(t,n,r){let i,o;if(t.length===n)return o=this._value,this.setValue(r),o;const a=t.charAt(n);return this._nextMap?(i=this._nextMap[a],i||(i=new e,this._nextMap[a]=i)):(this._nextMap={},i=new e,this._nextMap[a]=i),i.put(t,n+1,r)}get(e,t){if(e.length<=t)return this._value;const n=this.getNextNode(e.charAt(t));return n?n.get(e,t+1):null}getLongestMatch(e,t){if(e.length<=t)return wl.newInstanceIfNeeded(e,this._value);const n=this.getNextNode(e.charAt(t));if(!n)return wl.newInstanceIfNeeded(e,t,this._value);const r=n.getLongestMatch(e,t+1);return r||wl.newInstanceIfNeeded(e,t,this._value)}},Il=class{constructor(){this.clear()}getLongestMatch(e){return this.root&&e?this.root.getLongestMatch(e,0):null}getMaxKeyLength(){return this.maxKeyLen}clear(){this.root=null,this.maxKeyLen=0,this.size=0}put(e,t){this.root||(this.root=new El);const n=this.root.put(e,0,t);return n||(e.length>this.maxKeyLen&&(this.maxKeyLen=e.length),this.size++,null)}};(()=>{const e=[],t=[],n=new Il;let r,i,o;for(r in e["""]="34",e["&"]="38",e["<"]="60",e[">"]="62",e[" "]="160",e["¡"]="161",e["¢"]="162",e["£"]="163",e["¤"]="164",e["¥"]="165",e["¦"]="166",e["§"]="167",e["¨"]="168",e["©"]="169",e["ª"]="170",e["«"]="171",e["¬"]="172",e["­"]="173",e["®"]="174",e["¯"]="175",e["°"]="176",e["±"]="177",e["²"]="178",e["³"]="179",e["´"]="180",e["µ"]="181",e["¶"]="182",e["·"]="183",e["¸"]="184",e["¹"]="185",e["º"]="186",e["»"]="187",e["¼"]="188",e["½"]="189",e["¾"]="190",e["¿"]="191",e["À"]="192",e["Á"]="193",e["Â"]="194",e["Ã"]="195",e["Ä"]="196",e["Å"]="197",e["Æ"]="198",e["Ç"]="199",e["È"]="200",e["É"]="201",e["Ê"]="202",e["Ë"]="203",e["Ì"]="204",e["Í"]="205",e["Î"]="206",e["Ï"]="207",e["Ð"]="208",e["Ñ"]="209",e["Ò"]="210",e["Ó"]="211",e["Ô"]="212",e["Õ"]="213",e["Ö"]="214",e["×"]="215",e["Ø"]="216",e["Ù"]="217",e["Ú"]="218",e["Û"]="219",e["Ü"]="220",e["Ý"]="221",e["Þ"]="222",e["ß"]="223",e["à"]="224",e["á"]="225",e["â"]="226",e["ã"]="227",e["ä"]="228",e["å"]="229",e["æ"]="230",e["ç"]="231",e["è"]="232",e["é"]="233",e["ê"]="234",e["ë"]="235",e["ì"]="236",e["í"]="237",e["î"]="238",e["ï"]="239",e["ð"]="240",e["ñ"]="241",e["ò"]="242",e["ó"]="243",e["ô"]="244",e["õ"]="245",e["ö"]="246",e["÷"]="247",e["ø"]="248",e["ù"]="249",e["ú"]="250",e["û"]="251",e["ü"]="252",e["ý"]="253",e["þ"]="254",e["ÿ"]="255",e["&OElig"]="338",e["&oelig"]="339",e["&Scaron"]="352",e["&scaron"]="353",e["&Yuml"]="376",e["&fnof"]="402",e["&circ"]="710",e["&tilde"]="732",e["&Alpha"]="913",e["&Beta"]="914",e["&Gamma"]="915",e["&Delta"]="916",e["&Epsilon"]="917",e["&Zeta"]="918",e["&Eta"]="919",e["&Theta"]="920",e["&Iota"]="921",e["&Kappa"]="922",e["&Lambda"]="923",e["&Mu"]="924",e["&Nu"]="925",e["&Xi"]="926",e["&Omicron"]="927",e["&Pi"]="928",e["&Rho"]="929",e["&Sigma"]="931",e["&Tau"]="932",e["&Upsilon"]="933",e["&Phi"]="934",e["&Chi"]="935",e["&Psi"]="936",e["&Omega"]="937",e["&alpha"]="945",e["&beta"]="946",e["&gamma"]="947",e["&delta"]="948",e["&epsilon"]="949",e["&zeta"]="950",e["&eta"]="951",e["&theta"]="952",e["&iota"]="953",e["&kappa"]="954",e["&lambda"]="955",e["&mu"]="956",e["&nu"]="957",e["&xi"]="958",e["&omicron"]="959",e["&pi"]="960",e["&rho"]="961",e["&sigmaf"]="962",e["&sigma"]="963",e["&tau"]="964",e["&upsilon"]="965",e["&phi"]="966",e["&chi"]="967",e["&psi"]="968",e["&omega"]="969",e["&thetasym"]="977",e["&upsih"]="978",e["&piv"]="982",e["&ensp"]="8194",e["&emsp"]="8195",e["&thinsp"]="8201",e["&zwnj"]="8204",e["&zwj"]="8205",e["&lrm"]="8206",e["&rlm"]="8207",e["&ndash"]="8211",e["&mdash"]="8212",e["&lsquo"]="8216",e["&rsquo"]="8217",e["&sbquo"]="8218",e["&ldquo"]="8220",e["&rdquo"]="8221",e["&bdquo"]="8222",e["&dagger"]="8224",e["&Dagger"]="8225",e["&bull"]="8226",e["&hellip"]="8230",e["&permil"]="8240",e["&prime"]="8242",e["&Prime"]="8243",e["&lsaquo"]="8249",e["&rsaquo"]="8250",e["&oline"]="8254",e["&frasl"]="8260",e["&euro"]="8364",e["&image"]="8365",e["&weierp"]="8472",e["&real"]="8476",e["&trade"]="8482",e["&alefsym"]="8501",e["&larr"]="8592",e["&uarr"]="8593",e["&rarr"]="8594",e["&darr"]="8595",e["&harr"]="8596",e["&crarr"]="8629",e["&lArr"]="8656",e["&uArr"]="8657",e["&rArr"]="8658",e["&dArr"]="8659",e["&hArr"]="8660",e["&forall"]="8704",e["&part"]="8706",e["&exist"]="8707",e["&empty"]="8709",e["&nabla"]="8711",e["&isin"]="8712",e["¬in"]="8713",e["&ni"]="8715",e["&prod"]="8719",e["&sum"]="8721",e["&minus"]="8722",e["&lowast"]="8727",e["&radic"]="8730",e["&prop"]="8733",e["&infin"]="8734",e["&ang"]="8736",e["&and"]="8743",e["&or"]="8744",e["&cap"]="8745",e["&cup"]="8746",e["&int"]="8747",e["&there4"]="8756",e["&sim"]="8764",e["&cong"]="8773",e["&asymp"]="8776",e["&ne"]="8800",e["&equiv"]="8801",e["&le"]="8804",e["&ge"]="8805",e["&sub"]="8834",e["&sup"]="8835",e["&nsub"]="8836",e["&sube"]="8838",e["&supe"]="8839",e["&oplus"]="8853",e["&otimes"]="8855",e["&perp"]="8869",e["&sdot"]="8901",e["&lceil"]="8968",e["&rceil"]="8969",e["&lfloor"]="8970",e["&rfloor"]="8971",e["&lang"]="9001",e["&rang"]="9002",e["&loz"]="9674",e["&spades"]="9824",e["&clubs"]="9827",e["&hearts"]="9829",e["&diams"]="9830",e)"function"!=typeof e[r]&&e.hasOwnProperty(r)&&(t[e[r]]=r);for(i in t)"function"!=typeof t[i]&&t.hasOwnProperty(i)&&(o=t[i].toLowerCase().substr(1),n.put(o,String.fromCharCode(i)))})(),"undefined"!=typeof document&&document.createElement("div");for(let e=0;e<255;e++)e>=48&&e<=57||e>=65&&e<=90||e>=97&&e<=122||e.toString(16);const Al={CUSTOM:{EXPRESSION:"customTooltipExpression",TITLE:"customTooltipTitle",DESCRIPTION:"customTooltipDescription",QUARANTINE:"customTooltip",IMAGES:"customTooltipImages"},CHART:{CONTAINER_ID:"tooltipContainerId",STATE:"customTooltipSessionState",CHART_OBJECT_ID:"customTooltipSessionObjectId",CHART_PARENT_TYPE:"TooltipChartParent",CHART_CHILD_TYPE:"TooltipChart",STYLE:{small:"140px",medium:"200px",large:"340px"}}};function Ml(e){const t=e.split("/");return"qmem:"===t[0]&&""===t[1]}const kl={getImageSize(e,t){let n;function r(){n&&(clearTimeout(n),n=null)}function i(e){const t=e;t.onload=null,t.onerror=null,r()}const o={small:50,medium:200,large:340,original:340};return new Promise(a=>{const s=new Image;s.referrerPolicy="no-referrer",s.onload=()=>{let e;const{height:n,width:l}=s,u=o[t]*(n>l?1:n/l),c=o[t]*(l>n?1:l/n);!n||!l||0===n&&0===l?(e={height:20,width:20,imageError:!0},i(s)):"original"===t?(e={height:Math.min(u,n),width:Math.min(c,l)},r()):(e={height:u,width:c},r()),a(e)},s.onerror=()=>{i(s),a({height:20,width:20,imageError:!0})},s.src=e,n=setTimeout(()=>{i(s),a({height:20,width:20,imageError:!0})},3e3)})}};async function Ll(e,t,n){let r=e.ref.qStaticContentUrl.qUrl;const i=function(e){let t,n,r,i,o,a;if(e&&(e.session?.options||e.enigmaModel?.session?.sessionConfig||e.session?.config?.url)){if(t=e.session.options||e.enigmaModel?.session.sessionConfig,!t){t=e.session?.config;const n=new URL(t.url);t.host=n.hostname,t.port=n.port,t.isSecure="wss:"===n.protocol}return a=void 0!==t.secure?t.secure:t.isSecure,n=a?"https://":"http://",r=t.host||"localhost",i=t.port?`:${t.port}`:"",o=t.prefix?t.prefix:"/","/"!==o[o.length-1]&&(o=`${o}/`),n+r+i+o}return""}(n);i&&(!function(e,t){const n=e.replace(t,"").replace(/^\.\.\//i,"/");n[0]}(r,i),r=r.replace(/"/g,'\\"'),r=r.replace(/'/g,"\\'"),r=function(e,t){return t+("/"===e[0]?e.substr(1):e)}(r,i));const{height:o,width:a,imageError:s}=await kl.getImageSize(r,t);return{src:r,size:t,height:o,width:a,imageError:s}}async function Ol(e,t,n,r){const{app:i,flags:o}=t,a=e.layout?.tooltip?.imageComponents;if(!a)return[];const[s]=a,l=s.size||"small",u=s.type||"media";let c=-1;for(let e=0;e<n.length;e++)if(n[e].cId===s.cId){c=e;break}const p=r.data?.customTooltipAttrExps?.value||[];let d;if(-1!==c&&p[c]&&(d=p[c]),"media"===u&&s.ref?.qStaticContentUrl?.qUrl)return Ll(s,l,i);if("url"===u)return async function(e,t,n,r,i){let o,a=n.ref;if(i&&i.label&&(a=i.label),t.isEnabled("IMAGE_BUNDLE_LOAD")&&e?.getImage&&Ml(a))try{const t=`data:image/png;base64, ${await e.getImage(a)}`,{height:n,width:i,imageError:s}=await kl.getImageSize(t,r);o={src:t,size:r,height:n,width:i,imageError:s}}catch(e){}else{const{height:e,width:t,imageError:n}=await kl.getImageSize(a,r);o={src:a,size:r,height:e,width:t,imageError:n}}return o}(i,o,s,l,d);if(o.isEnabled("IMAGE_BUNDLE_LOAD")&&"field"===u&&d&&d.label){return async function(e,t,n,r){let i;const o=r.label,a=`qmem://${t.qFallbackTitle}/${o}`;if(Ml(a))try{const t=await e.getImage(a);if(t){const e=`data:image/png;base64, ${t}`,{height:r,width:o,imageError:a}=await kl.getImageSize(e,n);i={src:e,size:n,height:r,width:o,imageError:a}}}catch(e){}return i}(i,n[c],l,d)}return[]}const Tl={async addImagesToTheNodes({customTooltipModel:e,nodes:t,attrExps:n,opts:r}){const i=t,o=[];for(let t=0;t<i.length;t++)o.push(Ol(e,r,n,i[t]));const a=await Promise.all(o);for(let e=0;e<i.length;e++)i[e].data.customTooltipImages=[a[e]];return i},checkIfPromisesExist({customTooltipModel:e}){const t=e.layout?.tooltip?.imageComponents;return!!t&&t.length>0}},Nl={async handlePromises({customTooltipModel:e,nodes:t,attrExps:n,opts:r}){let i=t;return i=await Tl.addImagesToTheNodes({customTooltipModel:e,nodes:t,attrExps:n,opts:r}),i},checkIfPromisesExist:({customTooltipModel:e})=>Tl.checkIfPromisesExist({customTooltipModel:e})};const Pl=(e,t)=>{const n=e?.qHyperCubeDef?.qDimensions,r=e?.qHyperCubeDef?.qMeasures,i=e?.qHyperCubeDef?.qInterColumnSortOrder,o=t;return{qInfo:{qType:Al.CHART.CHART_PARENT_TYPE,qId:Al.CHART.CHART_OBJECT_ID},qHyperCubeDef:{qDimensions:n,qMeasures:r,qInterColumnSortOrder:i,qInitialDataFetch:[{qWidth:0,qHeight:0}]},qStateName:o}},Fl=e=>{const t=e.tooltip?.chart?.object?.refId;return{qInfo:{qType:Al.CHART.CHART_CHILD_TYPE},qExtendsId:t}};const Rl={createContainer:({ctx:e,layout:t})=>{if(!(t.qHyperCube?.qDimensionInfo?.length<=0))return function(e,t){const n=t.tooltip?.chart?.style?.size??"medium",r=Al.CHART.STYLE[n];return[{content:[e.h("div",{style:{display:"flex",width:r,height:r,backgroundColor:"#FFFFFF",borderRadius:"5px",padding:"2px",color:"#595959"},colspan:2,id:Al.CHART.CONTAINER_ID})],colspan:2,style:{"text-align":e.rtl?"right":"left","max-width":r}},{}]}(e,t)},show:async({app:e,properties:t,selectedNodes:n,dimIndex:r,customTooltipModel:i,rtl:o})=>{const a=i,s=t?.tooltip?.chart?.object?.refId;if(a?.embed&&e.removeSessionAlternateState&&e.addSessionAlternateState&&s&&!(t.qHyperCubeDef.qDimensions.length<=0)){await Rl.hide({app:e,customTooltipModel:i});try{await async function({app:e,properties:t,customTooltipModel:n}){const r=n,i=Al.CHART.STATE,o=t.qStateName;r.miniChartToken.alternateState||(r.miniChartToken.alternateState=i,await e.addSessionAlternateState(i,o),r.miniChartToken.alternateState=i)}({app:e,properties:t,customTooltipModel:i});const s=await async function({app:e,properties:t,customTooltipModel:n}){const r=n;r.miniChartToken.sessionObj?.id&&await e.destroySessionObject(r.miniChartToken.sessionObj.id);const i=Al.CHART.STATE,o=Pl(t,i),a=await e.createSessionObject(o),s=Fl(t);if(a.id!==Al.CHART.CHART_OBJECT_ID)return void e.destroySessionObject(a.id);r.miniChartToken.sessionObj=a;const l=await a.createChild(s);if(r.miniChartToken.sessionObj&&r.miniChartToken.sessionObj.id===a.id)return r.miniChartToken.model=l,l;e.destroySessionObject(a.id)}({app:e,properties:t,customTooltipModel:i});if(a.miniChartToken.alternateState&&a.miniChartToken.sessionObj&&s){const e=n.length>0&&void 0!==n[0].data?.value?[n[0].data?.value]:[],s=void 0!==r?r:t.qHyperCubeDef.qDimensions.length-1;if(2===t.qHyperCubeDef.qDimensions.length&&void 0===r&&n.length>0){const e=n[0].data.selectionOuterDimension??n[0].data.selectionDimension;if(e?.source?.field){const t=e?.source?.field.split("/"),n=t[t.length-1],r=void 0!==e.value?[e.value]:[];r.length>0&&void 0!==n&&a.miniChartToken.sessionObj.selectHyperCubeValues("/qHyperCubeDef",Number(n),r,!1)}}e.length>0&&a.miniChartToken.sessionObj.selectHyperCubeValues("/qHyperCubeDef",s,e,!1);const l=document.getElementById(Al.CHART.CONTAINER_ID),u={direction:o?"rtl":"ltr",isReadonly:!0,isPopover:!0,navigation:!1,selections:!1};a.miniChartToken.vis=await i.embed.render({element:l,model:a.miniChartToken.model,options:u,id:a.miniChartToken.model?.id,type:a.miniChartToken.model?.genericType})}}catch(t){await Rl.hide({app:e,customTooltipModel:i})}}},hide:async({app:e,customTooltipModel:t})=>{const n=t;n?.embed&&(Rl.destroyVisualization({customTooltipModel:t}),await e.destroySessionObject(Al.CHART.CHART_OBJECT_ID),n.miniChartToken.sessionObj=void 0,await async function({app:e,customTooltipModel:t}){const n=t,r=Al.CHART.STATE;n.miniChartToken.alternateState=void 0,await e.removeSessionAlternateState(r)}({app:e,customTooltipModel:t}))},destroyVisualization:({customTooltipModel:e})=>{const t=e;"function"==typeof t.miniChartToken?.vis?.destroy&&(t.miniChartToken.vis.destroy(),t.miniChartToken.vis=void 0)}};function jl(e){const t=e.qHyperCubeDef?e.qHyperCubeDef.qDimensions:e.qHyperCube.qDimensionInfo;if(t&&t.length>0)return t}function Hl(){const{EXPRESSION:e,TITLE:t,DESCRIPTION:n,IMAGES:r}=Al.CUSTOM,i={};return i[e]=!0,i[t]=!0,i[n]=!0,i[r]=!0,i}function Vl(e){const t=Hl();return e.filter(e=>t[e.id])}const zl={getNodes(e,t){const n=function(e,t){let n=0,r=0;e.center?(n+=e.center.x,r+=e.center.y):(n+=e.clientX,r+=e.clientY);const i=t.element.getBoundingClientRect();return{cx:n-i.left,cy:r-i.top}}(e,t);return t.shapesAt({x:n.cx,y:n.cy})},getDataNodes(e,t){let n,r=[];const i={container:{bar:!0,"bullet-axis":!0},circle:{"point-component":!0}};return t.forEach(t=>{const o=t.data?.selectionDimension??t.data;if(!o||t.data?.customTooltipAttrExps||i[t.type]){if(t.data?.customTooltipAttrExps&&!t.data.customTooltipImages){const e=t;e.data.customTooltipImages=[],r.push(e)}}else{n||(n=[],Object.keys(i).forEach(t=>{n=n.concat(e.findShapes(t).filter(e=>e.data&&e.data.customTooltipAttrExps&&!e.data.customTooltipImages&&i[t][e.key]))}));const t=n.filter(e=>{const t=e.data.stack??e.data.selectionOuterDimension??e.data.selectionDimension;return t&&t.value===o.value&&t.label===o.label});t.length>0&&(r=r.concat(t[0]))}}),r},displayTooltip(e,t,{nodes:n,opts:r={},customTooltipModel:i,extractedNodes:o=[],hide:a}){if(i&&!a){const{layout:a,chart:s}=i,{attrExps:l}=zl.getAttrExprData(a);o.length||n.length?Nl.handlePromises({customTooltipModel:i,nodes:zl.getDataNodes(s,o.length>0?o:n),attrExps:l,opts:r}).then(()=>{t.emit("show",e,n.length?{nodes:n}:void 0)}):t.emit("show",e,n.length?{nodes:n}:void 0)}else i?.miniChartToken?.alternateState&&Rl.hide({app:r.app,customTooltipModel:i}),t.emit("hide")},checkIfPromisesExist:({customTooltipModel:e})=>Nl.checkIfPromisesExist({customTooltipModel:e}),getAttrExps(e,t){const n=t,r=e.qHyperCubeDef?.qDimensions?"qAttributeExpressions":"qAttrExprInfo";return n[r]||(n[r]=[]),n[r]},getAttrExprData(e){let t=[],n="";const r=e.qHyperCube?.qDimensionInfo||[];if(r.length>0){const i=r.length-1;t=e.qHyperCube?.qDimensionInfo?.[i]?.qAttrExprInfo||[],n=`qDimensionInfo/${i}/qAttrExprInfo`}return{attrExps:t,fieldPath:n}},quarantineCustomTooltipAttrs(e,t={}){const n=e.qLayoutExclude?.quarantine?.[Al.CUSTOM.QUARANTINE];if(!n){!function(e,t){const n=t;let r=n.qLayoutExclude;r||(n.qLayoutExclude={quarantine:{}},r=n.qLayoutExclude),r.quarantine||(r.quarantine={}),r.quarantine[Al.CUSTOM.QUARANTINE]=[],e.forEach(e=>{r.quarantine[Al.CUSTOM.QUARANTINE].push(e)}),n.qLayoutExclude=r}(Vl(t.qAttributeExpressions||[]),e)}},unquarantineCustomTooltipAttrs(e){const t=e,n=e.qLayoutExclude?.quarantine?.[Al.CUSTOM.QUARANTINE];n&&delete t.qLayoutExclude.quarantine[Al.CUSTOM.QUARANTINE]},setAttrsFromQuarantine(e,t){const n=jl(e);if(!n)return;const r=void 0!==t?t:n.length-1;if(!n[r])return;const i=this.getAttrExps(e,n[r]);if(0===Vl(i).length){const t=e.qLayoutExclude?.quarantine?.customTooltip||[],n=[...i,...t],o=e;o.qHyperCubeDef?o.qHyperCubeDef.qDimensions[r].qAttributeExpressions=n:o.qHyperCube.qDimensionInfo[r].qAttrExprInfo=n}},moveCustomTooltipAttrs(e,t={},n=void 0){let r=[];const i=jl(e)||[];[...i,t].forEach(e=>{const t=Vl(e.qAttributeExpressions||[]);t.length>0&&(r=t)});const o=Hl(),a=i.map(e=>{const t=e,n=e.qAttributeExpressions||[];return t.qAttributeExpressions=n.filter(e=>!o[e.id]),t}),s=void 0!==n?n:a.length-1;a.length>0&&(a[s].qAttributeExpressions=a[s].qAttributeExpressions.concat(r));const l=e;e.qHyperCubeDef?l.qHyperCubeDef.qDimensions=a:l.qHyperCube.qDimensionInfo=a},addCallbackCustomTooltip(e){e.qHyperCubeDef.qDimensions.length>1?this.moveCustomTooltipAttrs(e):(this.setAttrsFromQuarantine(e),this.unquarantineCustomTooltipAttrs(e))},moveCallbackCustomTooltip(e,t){1===e.qHyperCubeDef.qDimensions.length&&(this.setAttrsFromQuarantine(e),this.unquarantineCustomTooltipAttrs(e)),e.qHyperCubeDef.qDimensions.length>1&&this.moveCustomTooltipAttrs(e,t)},removeCallbackCustomTooltip(e,t){e.qHyperCubeDef.qDimensions.length>0?this.moveCustomTooltipAttrs(e,t):this.quarantineCustomTooltipAttrs(e,t)},replaceCallbackCustomTooltip(e,t){e.qHyperCubeDef.qDimensions.length>1?this.moveCustomTooltipAttrs(e,t):(this.quarantineCustomTooltipAttrs(e,t),this.setAttrsFromQuarantine(e),this.unquarantineCustomTooltipAttrs(e))},shouldIgnoreDefaultRows:e=>e.tooltip?.hideBasic||0,DEBOUNCE_THRESHOLD:50,getFooterRow:(e,t)=>[{content:e,style:{"font-style":"italic","font-size":"12px","line-height":"16px",color:"rgba(255, 255, 255, 0.6)","text-align":t?"right":"left",direction:il.detectTextDirection(e)},colspan:2},{}],getImageRow(e,t){const n=il.detectTextDirection(e.src),r=[],i={style:{display:"block","margin-left":"auto","margin-right":"auto",overflow:"hidden",width:e.width,height:e.height}};if("original"===e.size||e.imageError){r.push(t.h("span",{style:{display:"inline-block",height:"100%","vertical-align":"middle"}}));const n=e.imageError?`${e.src}?${Math.random()}`:e.src;r.push(t.h("img",{style:{"max-width":e.width,"max-height":e.height,"vertical-align":"middle"},src:n,referrerpolicy:"no-referrer"})),i.style["text-align"]="center",i.style["white-space"]="nowrap"}else i.style["background-size"]="contain",i.style["background-repeat"]="no-repeat",i.style["background-position"]="center",i.style["background-image"]=`url('${e.src}')`;return[{content:[t.h("div",i,r),""],style:{"text-align":t.rtl?"right":"left",direction:n,"max-width":e.width},colspan:2},{}]}};function _l(e,t,n,r){const i=t.qHyperCube?.[n]?.[r]?.qAttrExprInfo||[],o=[],a=e.qSubNodes&&e.qSubNodes[r]?e.qSubNodes[r].qAttrExps:e.qAttrExps;return a?(i.forEach((e,t)=>{const i=a.qValues&&a.qValues[t]?a.qValues[t]:void 0,s=void 0===i?"NaN":function(e,t){let n;switch(e.id){case Al.CUSTOM.EXPRESSION:n="NaN"===t.qNum||e.isCustomFormatted?void 0===t.qText?"NaN":t.qText:t.qNum;break;case Al.CUSTOM.TITLE:case Al.CUSTOM.DESCRIPTION:case Al.CUSTOM.IMAGES:n=void 0===t.qText?e.qFallbackTitle:t.qText;break;default:n="NaN"}return n}(e,i);o.push({source:{key:"qHyperCube",field:`${n}/${r}/qAttrExprInfo/${t}`},label:s,value:"value"})}),o):o}const Bl={getNode(e,{dimensionCount:t}){if(!t||t<1)return;const n=t-1,r="qDimensionInfo";return{field:`${r}/${n}`,value:t=>_l(t,e,r,n)}}};const $l={getCustomAttrExps(e,t,n){const r={customTooltipAttrExpsArr:[],customTooltipInfoAttrExpsArr:[]},i=t.data?.customTooltipAttrExps?.value||[];if(Number.isNaN(i))return r;return function(e,t,n,r){const i={[Al.CUSTOM.TITLE]:!0,[Al.CUSTOM.DESCRIPTION]:!0},{attrExps:o,fieldPath:a}=zl.getAttrExprData(e);return 0===t.length||0===o.length||""===a||o.forEach((e,o)=>{const s=t[o];if(e.id===Al.CUSTOM.EXPRESSION&&s){const t=e.qFallbackTitle,i="NaN"===s.value||e.isCustomFormatted?s.value:n("qHyperCube").field(`${a}/${o}`).formatter()(s.value);r.customTooltipAttrExpsArr.push({label:t,value:i})}else if(i[e.id]&&s){const t="-"!==s.value&&"NaN"!==s.value?s.value:s.label;t&&"undefined"!==t&&r.customTooltipInfoAttrExpsArr.push({...e.id===Al.CUSTOM.TITLE&&{title:t},value:t,id:e.id})}}),r}(n,i.map(t=>ol.getMeasure(e,t)),e,r)}};function Ul({nodes:e,layout:t,dataset:n}){const r=function(e,t,n){const r=[];return e.forEach(e=>{r.push($l.getCustomAttrExps(n,e,t))}),r}(e,t,n);return r.reduce((e,t)=>({customTooltipAttrExpsArr:e.customTooltipAttrExpsArr.concat(t.customTooltipAttrExpsArr),customTooltipInfoAttrExpsArr:e.customTooltipInfoAttrExpsArr.concat(t.customTooltipInfoAttrExpsArr)}),{customTooltipAttrExpsArr:[],customTooltipInfoAttrExpsArr:[]})}function Wl(e){const t=Al.CUSTOM.EXPRESSION,{qNumFormat:n,qLabel:r,qLabelExpression:i,cId:o}=e.qDef;return e.qLibraryId?{qLibraryId:e.qLibraryId,id:t,qNumFormat:n,qLabel:r,qLabelExpression:i,cId:o}:{qExpression:e.qDef.qDef,id:t,qNumFormat:n,qLabel:r,qLabelExpression:i,cId:o}}function Kl(e){const t=e.qHyperCubeDef?.qDimensions;return t[t.length-1].qAttributeExpressions||[]}var Yl={attrExpr:{migrateProperties(e){const t=Ws(!0,{},e),n=t.tooltip?.data?.qHyperCubeDef?.qMeasures||[];let r=Kl(t);return r=function(e,t){return t.concat(e.map(e=>Wl(e)))}(n,r),function(e,t){const n=t.qHyperCubeDef?.qDimensions;n[n.length-1].qAttributeExpressions=e}(r,t),delete t.tooltip?.data,t},getPatches(e){const t=e.tooltip?.data?.qHyperCubeDef?.qMeasures||[],n=e.qHyperCubeDef?.qDimensions.length-1,r=function(e,t,n){let r=e.length;const i=[];return t.forEach(e=>{const t=Wl(e),o=JSON.stringify(t);i.push({qPath:`/qHyperCubeDef/qDimensions/${n}/qAttributeExpressions/${r}`,qOp:"add",qValue:o}),r++}),i.push({qPath:"/tooltip/data",qOp:"remove"}),i}(Kl(e),t,n);return r},checkForBackwardCompatibility:(e,t)=>(e.qMeasureInfo||[]).length>0&&t.length>0,updateProperties(e,t){return new Promise(n=>{const r=t.qHyperCube?.qDimensionInfo||[],i=t.tooltip?.data?.qHyperCube||{},o=t.qMeta?.privileges?.includes("update");e&&e.getEffectiveProperties&&this.checkForBackwardCompatibility(i,r)&&e.getEffectiveProperties().then(t=>{if(o){const r=this.migrateProperties(t);e.setProperties(r).then(()=>{e.app.clearUndoBuffer(),n(!0)})}else{const r=this.getPatches(t);e.applyPatches(r,!0).then(()=>{e.app.clearUndoBuffer(),n(!0)})}}),n(!1)})}}};const{CUSTOM:Gl}=Al;function Jl({flags:e,layout:t,app:n,model:r,picasso:i,chart:o,translator:a,localeInfo:s,embed:l,options:u}){const c={properties:void 0},p=function({layout:e,app:t,picasso:n,model:r,chart:i,translator:o,localeInfo:a,embed:s}){return{layout:e,app:t,picasso:n,model:r,chart:i,translator:o,localeInfo:a,useCustomTooltip:e.tooltip&&!e.tooltip.auto,utils:zl,miniChartToken:{},embed:s}}({layout:t,app:n,model:r,picasso:i,chart:o,translator:a,localeInfo:s,embed:l}),d="rtl"===u.direction,f=()=>{const e=!!c.properties?.qHyperCubeDef?.qDimensions.some(e=>e.qCalcCondition?.qCond?.qv);return!(!t.tooltip||t.tooltip.auto||e)};return{setProperties:e=>{c.properties=e},isEnabled:()=>f(),hideBasic:()=>f()&&ji(t,"tooltip.hideBasic",!1),getAttributes:({dataset:e,nodes:n})=>{const r=Ul({dataset:e,nodes:n,layout:t});return{title:r.customTooltipInfoAttrExpsArr.find(e=>e.id===Gl.TITLE)?.title,description:r.customTooltipInfoAttrExpsArr.find(e=>e.id===Gl.DESCRIPTION)?.value,measures:r.customTooltipAttrExpsArr}},hasImages:()=>zl.checkIfPromisesExist({customTooltipModel:p}),createImageRow:({value:e,h:t})=>zl.getImageRow(e,{h:t,rtl:d}),addImages:({nodes:r})=>{const i=zl.getDataNodes(o,r),{attrExps:a}=zl.getAttrExprData(t);return Nl.handlePromises({customTooltipModel:p,nodes:i,attrExps:a,opts:{flags:e,app:n}})},chart:{isEnabled:()=>!!(f()&&t.tooltip?.chart?.object?.refId&&l&&"function"==typeof r?.getEffectiveProperties),hasLimitation:()=>!!n?.isInModalSelection?.(),createContainer:({h:e})=>Rl.createContainer({layout:t,ctx:{h:e,rtl:d}}),createLimitationRow:()=>zl.getFooterRow(a.get("properties.tooltip.notselectedmessage"),d),show:({nodes:e,properties:t})=>Rl.show({app:n,properties:t,selectedNodes:e,customTooltipModel:p,rtl:d}),hasAlternateState:()=>!!p.miniChartToken?.alternateState,hide:()=>Rl.hide({app:n,customTooltipModel:p}),destroy:()=>Rl.destroyVisualization({customTooltipModel:p})}}}function Zl(e){return{layout:e,keys:{SCALE:{FILL:"fill"},COMPONENT:{DIMENSION_TITLE:"dimension-title",SLICES:"slices",PIE_LABELS:"pie-labels"}}}}function Xl({flags:e,picasso:t,instance:n}){const r=A(),i=M(),o=w(),a=q(),[s,l]=S(),u=k(),c=L(),p=O(),d=x(),f=T(),{qLocaleInfo:m}=N(),h=P();return I(()=>{if(!n)return;a.style.overflow="hidden";const s=function(e){var t,n=e.app,r=e.translator,i={initialized:!1,dimensions:[],measures:[]};return{initialize:(t=vn(Sn().m(function e(t){var o,a,s,l,u,c,p;return Sn().w(function(e){for(;;)switch(e.n){case 0:if(o=t.properties,!i.initialized){e.n=1;break}return e.a(2);case 1:return s=[Xn(a={app:n,translator:r,properties:o}),tr(a)],e.n=2,Promise.all(s);case 2:l=e.v,u=wn(l,2),c=u[0],p=u[1],i.dimensions=c,i.measures=p,i.initialized=!0;case 3:return e.a(2)}},e)})),function(e){return t.apply(this,arguments)}),getAlternatives:function(){return{dimensions:En(i.dimensions),measures:En(i.measures)}}}}({app:i,translator:o}),y=Oi({picasso:n.picasso,model:r,app:i,translator:o,config:{auto:!1,key:"fill"}}),g=function(e){var t=e.picassoInstance,n=e.plugins,r=e.pluginArgs,i=void 0===r?{}:r,o={initialized:!1,definitions:[]};return{initialize:function(){return vn(Sn().m(function e(){var r,a,s,l;return Sn().w(function(e){for(;;)switch(e.n){case 0:if(!o.initialized){e.n=1;break}return e.a(2);case 1:return a=Promise.all(n.filter(function(e){return"custom-component"===e.info.type}).map(function(){var e=vn(Sn().m(function e(n){var r;return Sn().w(function(e){for(;;)switch(e.n){case 0:if(n.info.componentName){e.n=1;break}throw new Error("plugin-service: Custom component is missing componentName");case 1:return e.n=2,n.fn(qn({},i));case 2:if("object"===In(r=e.v)){e.n=3;break}throw new Error("plugin-service: Custom component needs to be an object");case 3:t.component(n.info.componentName,r);case 4:return e.a(2)}},e)}));return function(t){return e.apply(this,arguments)}}())),s=Promise.all(n.filter(function(e){return"component-definition"===e.info.type}).map(function(e){return e.fn(qn({},i))})),e.n=2,Promise.all([a,s]);case 2:l=e.v,o.initialized=!0,(r=o.definitions).push.apply(r,En(l[1]));case 3:return e.a(2)}},e)}))()},extendComponents:function(e){return o.initialized?(o.definitions.filter(Boolean).forEach(function(t){var n=wn(e.filter(function(e){return e.key&&e.key===t.key}),1)[0];if(n){var r=ir(!0,{},n.brush);ir(!0,n,t),t.brush&&(n.brush=function(e,t){return"object"===In(e)&&Object.keys(e).length?(Array.isArray(t.consume)&&(e.consume=Bi({originalArray:e.consume,newArray:t.consume,matchKey:"context"})),Array.isArray(t.trigger)&&(e.trigger=Bi({originalArray:e.trigger,newArray:t.trigger,matchKey:"on"})),e):t}(r,t.brush))}else e.push(t)}),e):e}}}({picassoInstance:n.picasso,plugins:c,pluginArgs:Zl(u)}),v=Jl({flags:e,layout:u,app:i,model:r,picasso:t,chart:n.chart,translator:o,localeInfo:m,embed:h,options:d}),b=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:ns(a),styles:void 0};return p.styles=is({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=is({theme:e,id:i,transform:l,extend:c,matrix:p.matrix})}}}({theme:f,config:{id:"pieChart",resolve:[["object","label.name","color","#595959"],["object","label.name","fontFamily"],["object","label.name","fontSize","12px"]]}}),x=function({chart:e,translator:t,layout:n,constraints:r,options:i,themeService:o,colorService:a,custom:s}){const l=n.qHyperCube.qMeasureInfo.length>1,u="rtl"===i.direction,{fontFamily:c}=o.getStyles();return Rs({chart:e,translator:t,config:{rtl:u,enable:()=>!r.passive,getColorSettings:()=>a.getSettings(),style:{fontFamily:c},main:{key:"tooltip",getGroupByValue:({data:e})=>e.value,collectibles:[{key:"slices",type:"slice",major:({data:e})=>e.value}],triggers:[{keys:["slices"],collect:{from:"single"},placement:"collectible"},{keys:["pie-labels","negative-indicators"],collect:{from:"dimension",by:({data:e})=>e.value},placement:"trigger"}],placement:({meta:e})=>({type:"slices"===e.triggerer?"slice":"bounds"}),section:({h:e,nodes:n,dataset:r,formatter:i,create:o,util:a})=>{const[u]=n,{title:c,description:p,measures:d}=s.isEnabled()?s.getAttributes({dataset:r,nodes:n}):{},f=[];c&&f.push(o.text({value:c,style:{bold:!0}})),p&&f.push(o.text({value:p}));const m=s.hideBasic();if(m&&!d.length&&(c||p)||f.push(o.text({value:u.data.label,style:{bold:!0}})),!m){f.push(o.color({nodes:n,property:"fill"}));const{num:e}=u.data;if(f.push(o.measure({label:a.dataset.title(e.source.key,e.source.field),value:e.label})),l){const{radius:e}=u.data;f.push(o.measure({label:a.dataset.title(e.source.key,e.source.field),value:e.label}))}f.push(o.measure({label:t?t.get("properties.dataPoints.labelmode.share"):"Share",value:i("share")(u.desc.share)}))}d&&f.push(...d.map(e=>o.measure({label:e.label,value:e.value,survive:{color:!0,duplicate:!0}}))),s.chart.isEnabled()&&(s.chart.hasLimitation()?(s.chart.destroy(),f.push(o.raw({value:s.chart.createLimitationRow()}))):f.push(o.raw({value:s.chart.createContainer({h:e})})));const{customTooltipImages:h}=u.data;return s.isEnabled()&&h&&f.push(...h.map(t=>o.raw({value:s.createImageRow({value:t,h:e})}))),f},layout:{grouping:!0},events:{tooltip:{beforeShow:({collectNodes:e})=>s.isEnabled()&&s.hasImages()?s.addImages({nodes:e()}):Promise.resolve(),afterShow:({expando:e,nodes:t})=>{s.chart.isEnabled()&&!s.chart.hasLimitation()&&s.chart.show({nodes:t,properties:e.get("properties")})}},interaction:{mouseleave:()=>{s.chart.isEnabled()&&s.chart.hasAlternateState()&&s.chart.hide()}}}},legend:{keys:{tooltip:"legend-color-cat",component:"legend-cat"}}}})}({chart:n.chart,translator:o,layout:u,constraints:p,options:d,themeService:b,colorService:y,custom:v}),q=function({layout:e,themeService:t,colorService:n,flags:r}){const i=t.getStyles(),o=t=>r.isEnabled("CLIENT_IM_3050")?e.components?.find(e=>e.key===t):void 0,a=(e,t)=>{const r=n.getPaletteColor;if(e?.color&&r){const n=r(e);return"none"===n&&e.index>0?e?.color??t:n??t}return t};return{axis:{title:{getStyle:()=>{const e=o("axis")?.axis?.title;return{fontFamily:e?.fontFamily??i.axis.title.fontFamily,fontSize:e?.fontSize??i.axis.title.fontSize,color:a(e?.color,i.axis.title.color)}}}},label:{name:{getStyle:()=>{const e=o("label")?.label?.name;return{fill:a(e?.color,i.label.name.color),fontSize:e?.fontSize??i.label.name.fontSize,fontFamily:e?.fontFamily??i.label.name.fontFamily}}},value:{getStyle:()=>{const e=o("label")?.label?.value;return{fill:a(e?.color,i.label.value.color),fontSize:e?.fontSize??i.label.value.fontSize,fontFamily:e?.fontFamily??i.label.value.fontFamily}}}},legend:{title:{getStyle:()=>{const e=o("legend")?.legend?.title;return{fontFamily:e?.fontFamily??i.legend.title.fontFamily,fontSize:e?.fontSize??i.legend.title.fontSize,color:a(e?.color,i.legend.title.color)}}},label:{getStyle:()=>{const e=o("legend")?.legend?.label;return{fontFamily:e?.fontFamily??i.legend.label.fontFamily,fontSize:e?.fontSize??i.legend.label.fontSize,color:a(e?.color,i.legend.label.color)}}}}}}({layout:u,themeService:b,colorService:y,flags:e}),D=function({layout:e}){const t=({ds:e,encodings:t})=>{const n={field:"qDimensionInfo/0",props:{num:{field:t.slice.arc}}};return t.slice.outerRadius&&(n.props.radius={field:t.slice.outerRadius}),e.extract(n)},n=({rows:e,encodings:t})=>t.slice.outerRadius?e.filter(e=>"NaN"!==e.num.value&&"NaN"!==e.radius.value):e.filter(e=>"NaN"!==e.num.value),r=({rows:t,encodings:n})=>n.slice.outerRadius&&!e.donut.showAsDonut?t.filter(e=>e.num.value>0&&e.radius.value>0):t.filter(e=>e.num.value>0);return Ri({layout:e,config:{args:{},disclaimers:{NoDataExist:{condition:({ds:e,encodings:n})=>0===t({ds:e,encodings:n}).length},LimitedData:{condition:()=>{const t=Qs.getValue(e,"qHyperCube.qSize.qcy");return Qs.getValue(e,"qHyperCube.qDataPages.0.qArea.qHeight")<t}},OnlyNanData:{condition:({ds:e,encodings:r})=>{const i=t({ds:e,encodings:r});return 0===n({rows:i,encodings:r}).length}},OnlyNegativeOrZeroValues:{condition:({ds:e,encodings:i})=>{const o=t({ds:e,encodings:i}),a=n({rows:o,encodings:i});return 0===r({rows:a,encodings:i}).length}},NegativeOrZeroValues:{condition:({ds:e,encodings:i})=>{const o=t({ds:e,encodings:i}),a=n({rows:o,encodings:i}),s=a,l=r({rows:a,encodings:i});return s.length!==l.length}}}}})}({layout:u});l({alternativeService:s,colorService:y,disclaimerService:D,pluginService:g,themeService:b,tooltipService:x,styleService:q})},[r,i,n,u,o.language(),p,d.direction,f.name()]),s}const Ql=e=>"[object Object]"===Object.prototype.toString.call(e),eu=e=>Array.isArray(e);function tu(e,t){if(e===t)return!0;if(eu(e)){if(!eu(t))return!1;if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(!tu(e[n],t[n]))return!1;return!0}if(Ql(e)){if(!Ql(t))return!1;const n=Object.keys(e);if(n.length!==Object.keys(t).length)return!1;for(let r=0;r<n.length;r++){if(!Object.hasOwn(t,n[r]))return!1;if(!tu(e[n[r]],t[n[r]]))return!1}return!0}return e===t}function nu({enable:e=!0}={}){const t=A(),n=()=>Date.now().toString()+Math.random(),[r,i]=S(n()),o={properties:void 0};return I(()=>{if(!t||!t.getEffectiveProperties||!e)return()=>{};const r=()=>{t.getEffectiveProperties().then(e=>{const t=Ws(!0,{},e);if(!o.properties)return void(o.properties=t);const r=function(e,t){const n={properties:!1,exclude:!1};if(e===t)return n;const r=Ws(!0,{},e),i=Ws(!0,{},t);return n.exclude=!tu(r.qHyperCubeDef?.qLayoutExclude,i.qHyperCubeDef?.qLayoutExclude),delete r.qHyperCubeDef?.qLayoutExclude,delete i.qHyperCubeDef?.qLayoutExclude,n.properties=!tu(r,i),n}(o.properties,t);o.properties=t,r.exclude&&!r.properties&&i(n())})};return t.on("changed",r),r(),()=>{t.removeListener("changed",r)}},[e]),r}function ru({scaleKey:e,legend:t,onEdited:n}){const{layout:r}=t,{dock:i}=r||{};return{type:"brush-range",key:"legendRangeBrush",layout:{dock:"@legend-seq"},on:n?{bubbleEnd(){n()}}:{},settings:{brush:"selection",scale:`${e}Range`,direction:"left"===i||"right"===i?"vertical":"horizontal",bubbles:{align:"left"===i||"top"===i?"end":"start",placement:"outside"},target:{selector:'[id="legend-seq-target"]',fillSelector:'[id="legend-seq-ticks"]',fill:"rgba(82,204,82,0.2)"}}}}const iu=.8,ou=.55,au={CORNER_RADIUS:0,INNER_RADIUS:ou,STROKE:{COLOR:"#FFFFFF",WIDTH:{NONE:0,SMALL:2,MEDIUM:4,LARGE:6}}},su=({layout:e},t,n)=>t.encodings.slice.outerRadius?{scale:"radius",fn:t=>{let r=iu,i=0;const o=n?.style?.innerRadius??ou;e.donut.showAsDonut&&(r=iu-o,i=o);return t.scale(Math.max(0,t.datum.radius.value))*r+i}}:iu,lu=({layout:e},t,n)=>{if(!e.donut.showAsDonut)return 0;const r=n?.style?.innerRadius??ou;return t.encodings.slice.outerRadius?{scale:"radius",fn:e=>{const t=iu-r,n=r;return e.scale(Math.min(0,e.datum.radius.value))*t+n}}:r},uu=({layout:e},t)=>{const n=t.colorService.getDatumProps(),r=n[Object.keys(n)[0]],i=r&&r.field?r.field:void 0,o="qDimensionInfo/0"===i,a=i?t.ds.field(i).raw():null,s=a&&(a.label||a.title||a.qFallbackTitle)||"",l=t.encodings.slice.outerRadius,{formatter:u}=t.chart,c=Qs.getValue(e,"qHyperCube.qDimensionInfo",[]).length;function p(e,n){const r=t.ds.field(e).raw();return{field:e,label:!r.isCustomFormatted&&(r.qIsAutoFormat||"U"===r.qNumFormat.qType)?e=>u(n)(e.qNum):e=>e.qText}}const d=(e.components||[]).filter(e=>"slices"===e.key)[0];return{type:"pie",key:"slices",data:{extract:{field:"qDimensionInfo/0",props:{...n,num:p(t.encodings.slice.arc,"arc"),fillTooltip:i?{field:i,label:s,value:e=>o?e.qText||"-":void 0!==e.qNum&&"NaN"!==e.qNum?e.qText?e.qText:e.qNum:e.qText||"-"}:void 0,customTooltipAttrExps:0!==c?Bl.getNode(e,{dimensionCount:c}):void 0,radius:l?p(l,"outerRadius"):void 0}}},brush:{consume:[{context:"selection",data:["","fill"],style:{inactive:{opacity:.3},active:{stroke:"rgba(52, 52, 52, 0.7)",strokeWidth:2}}},{context:"highlight",data:[""],style:{inactive:{fill:"#BFDAD9"},active:{fill:"#68B2AF"}}}]},settings:{startAngle:()=>t.viewState.get("rotation"),endAngle:()=>t.viewState.get("rotation")+2*Math.PI,slice:{arc:{ref:"num"},innerRadius:lu({layout:e},t,d),fill:t.colorService.getColor(),strokeWidth:d?.style?.strokeWidth?au.STROKE.WIDTH[d.style.strokeWidth.toUpperCase()]:au.STROKE.WIDTH.NONE,stroke:d?.style?.strokeColor?.color??au.STROKE.COLOR,outerRadius:su({layout:e},t,d),cornerRadius:d?.style?.cornerRadius??0}},animations:{enabled:t.animations.enabled,isMainComponent:!0}}};function cu({layout:e},t){const n=(e.components||[]).filter(e=>"slices"===e.key)[0],r=n?.style?.innerRadius??ou,i=t.encodings.slice.outerRadius,o=t.themeService.getStyles();return!(!e.donut.showAsDonut||!i)&&{type:"pie",key:"zeroLine",data:{items:[1]},settings:{slice:{arc:1,fill:"transparent",innerRadius:0,strokeWidth:1,stroke:o.label.name.color,outerRadius:{scale:"radius",fn:e=>{const t=iu-r,n=r;return e.scale(0)*t+n}}}},animations:{enabled:t.animations.enabled}}}function pu(e){return{type:"pie-dividers",key:"pie-dividers",layout:{displayOrder:2},settings:{component:"slices",selector:"path"},brush:{consume:[{context:"selection",style:{inactive:{opacity:.2}}}]},animations:{enabled:e.animations.enabled,trackBy:()=>Math.random()}}}function du({layout:e},t){if(e.donut.showAsDonut||!t.encodings.slice.outerRadius)return!1;return{type:"negative-indicators",key:"negative-indicators",layout:{displayOrder:2},settings:{component:"slices",selector:"path",offset:5,size:4,fill:t.themeService.getStyles().label.name.color},brush:{consume:[{context:"selection",style:{inactive:{opacity:.2}}}]},animations:{enabled:t.animations.enabled}}}function fu(e){const t=e.node.desc&&e.node.desc.share;return t?e.formatter("share")(t):""}function mu(e){return e.node.data.num.label}function hu(e){return e.node.data.radius.label}function yu(e,t,n){if(e.dataPoint.auto)return n?mu:fu;if("share"===e.dataPoint.labelMode)return fu;if("value"===e.dataPoint.labelMode){return t.encodings.slice.outerRadius&&"radius"===e.dataPoint.labelValueMode?hu:mu}return null}function gu({data:e}){return e?e.label:""}function vu(e){const t=parseInt(e,10);if(!isNaN(t))return t}function bu(e){const t=((e&&e.components?e.components:void 0)||[]).filter(e=>"slices"===e.key)[0];return(t?.style?.innerRadius??ou)>.3}function xu({node:e,data:t}){return Ws({_share:e.desc.share,_fillColor:e.attrs.fill},t)}function qu(e,t,n){const r=t.styleService.label.name.getStyle(),i=[{padding:10,direction:t.encodings.slice.outerRadius?"rotate":"horizontal",placements:[{position:"outside",padding:t.encodings.slice.outerRadius?4:2,fill:r.fill}],fontSize:vu(r.fontSize),fontFamily:r.fontFamily,label:gu,linkData:({node:e,data:t})=>Ws({_share:e.desc.share,_fillColor:e.attrs.fill,_showTooltip:!0},t)}];if(yu(e,t,!1)){const r=function(e,t,n){return{label:yu(e,t,!1),simplifiedPlacements:[{position:e.donut.showAsDonut&&bu(e)?"inside":"into",onBackground:e.donut.showAsDonut&&bu(e),padding:4}],theme:n.theme,themeId:"object.pieChart"}}(e,t,n),o=ll(Ws(t,r),n.theme);o.linkData=xu,i.push(o)}return{key:"pie-labels",type:"labels",renderer:Cl(t.flags),layout:{displayOrder:2,minimumLayoutMode:"XSMALL"},settings:{sources:[{component:"slices",selector:"path",strategy:{type:"slice",settings:{labels:i}}}]},brush:{consume:[{context:"selection",data:["","fill"],style:{inactive:{opacity:.3}}}]},animations:{enabled:t.animations.enabled,trackBy:()=>Math.random()}}}function Du({layout:e,context:t},n){return!1!==e.dataPoint.show&&(1===n.dataRowCount?function(e,t,n){const r=yu(e,t,!0),i=(o=n.theme,e=>o.getContrastingColorTo(e.node.attrs.fill));var o;const a=t.themeService.getStyles(),s=t.styleService.label.name.getStyle(),l=t.styleService.label.value.getStyle(),u=s.fill===a.label.name.color,c=l.fill===a.label.value.color;return{key:"pie-labels",type:"labels",renderer:Cl(t.flags),layout:{displayOrder:2,minimumLayoutMode:"XSMALL"},settings:{sources:[{component:"slices",selector:"path",strategy:{type:"rows",settings:{align:.5,justify:.5,padding:10,labels:[{fontSize:vu(s.fontSize),fontFamily:s.fontFamily,fill:u&&!e.donut.showAsDonut?i:s.fill,label:gu,linkData:({data:e})=>e},{fontSize:vu(l.fontSize),fontFamily:l.fontFamily,fill:c&&!e.donut.showAsDonut?i:l.fill,label:r,linkData:({data:e})=>e}]}}}]},animations:{enabled:t.animations.enabled,trackBy:()=>Math.random()}}}(e,n,t):qu(e,n,t))}const Su=(e,{requireFailure:t,recognizeWith:n}={})=>({type:"Pan",requireFailure:t,recognizeWith:n,options:{event:"legendRange",enable(t,n){if(this.started||!n)return!0;if(e.constraints.select||e.constraints.active)return!1;const r=(this.chart.componentsFromPoint({x:n.center.x,y:n.center.y}).some(e=>"legend-seq"===e.type)||function(e){const{target:t}=e.srcEvent;return!(!t||!(t.hasAttribute("data-other-value")&&t.hasAttribute("data-idx")||"INPUT"===t.nodeName))}(n))&&!e.isLocked([this.chart.component("slices")]);return r||this.chart.component("legendRangeBrush").emit("rangeClear"),r}},events:{legendRangestart(t){t.preventDefault(),e.interactions.emit("selections-start"),this.chart.component("legendRangeBrush").emit("rangeStart",t),this.started=!0},legendRangemove(e){e.preventDefault(),this.chart.component("legendRangeBrush").emit("rangeMove",e)},legendRangeend(t){t.preventDefault(),this.chart.component("legendRangeBrush").emit("rangeEnd",t),e.onSelect(),this.started=!1}}});function Cu(e,t){const n=t.element.getBoundingClientRect();let r,i;return e.center?(({x:r}=e.center),({y:i}=e.center)):(r=e.clientX,i=e.clientY),{x:r-n.left,y:i-n.top}}function wu(e,t){const n=t.component("slices");if(!n)return!1;const{x:r,y:i}=Cu(e,t),o=n.rect.x+n.rect.margin.left+n.rect.width/2,a=n.rect.y+n.rect.margin.top+n.rect.height/2,s=Math.min(n.rect.width,n.rect.height)/2*iu;return(o-r)**2+(a-i)**2<=s**2}const Eu=(e,t,{requireFailure:n,recognizeWith:r}={})=>({type:"Tap",requireFailure:n,recognizeWith:r,options:{event:"tap",interval:10,pointers:1,enable(t,n){return!n||!e.constraints.select&&!e.constraints.active&&(this.components=this.chart.componentsFromPoint({x:n.center.x,y:n.center.y}).filter(e=>"slices"===e.key||"legend-cat"===e.key||"pie-labels"===e.key),this.components.length)}},events:{tap(n){n.preventDefault();const{target:r}=n.srcEvent;if(r&&("INPUT"===r.nodeName||r.hasAttribute("data-other-value")))return void this.chart.component("legendRangeBrush").emit("bubbleStart",n);if(r&&r.hasAttribute("data-action")&&r.hasAttribute("data-component-key"))return void this.chart.component(r.getAttribute("data-component-key")).emit(r.getAttribute("data-action"));if(r&&r.children&&r.children[0]&&"legend-cat"===r.children[0].getAttribute("data-component-key"))return;if(e.isLocked(this.components))return;e.interactions.emit("selections-start");let i=Cu(n,this.chart);this.components.some(e=>"legend-cat"===e.key)&&(i={cx:i.x,cy:i.y,r:5});const o=this.chart.shapesAt(i,{components:[{key:"slices",propagation:"stop"},{key:"legend-cat",propagation:"stop"},{key:"pie-labels",propagation:"stop"}],propagation:"stop"});o.length&&(this.chart.brushFromShapes(o,{components:[{key:o[0].key,action:n.srcEvent.ctrlKey||t?"set":"toggle",contexts:["selection"]}]}),e.onSelect())}}}),Iu=(e,{requireFailure:t,recognizeWith:n}={})=>({type:"Pan",requireFailure:t,recognizeWith:n,options:{event:"lasso",enable(t,n){if(this.isStarted||!n)return!0;if(e.constraints.active||e.constraints.select||!e.interactions.lasso.active())return!1;const r=this.chart.componentsFromPoint({x:n.center.x,y:n.center.y});return!e.isLocked(r)&&r.some(e=>"slices"===e.key)}},events:{lassostart(t){t.preventDefault(),e.constraints.select||e.constraints.active||this.isStarted||(e.interactions.emit("selections-start"),this.chart.component("lasso").emit("lassoStart",t),this.isStarted=!0)},lassomove(e){e.preventDefault(),this.chart.component("lasso").emit("lassoMove",e)},lassoend(t){t.preventDefault(),this.isStarted=!1,this.chart.component("lasso").emit("lassoEnd",t),e.onSelect()}}}),Au=(e,{requireFailure:t,recognizeWith:n}={})=>({type:"Tap",requireFailure:t,recognizeWith:n,options:{event:"areatap",pointers:2,enable(t,n){if(this.started||!n)return!0;if(e.constraints.active||e.constraints.select)return!1;const r=this.chart.componentsFromPoint({x:n.center.x,y:n.center.y});return r.some(e=>"slices"===e.key)&&!e.isLocked(r)}},events:{areatap(t){const n=this.chart.component("area");n&&!this.started&&(e.interactions.emit("selections-start"),n.emit("areaStart",t.pointers[0]),n.emit("areaMove",t.pointers[1]),this.started=!0,setTimeout(()=>{n.emit("areaEnd"),e.onSelect(),this.started=!1},100)),t.preventDefault()}}});function Mu(e){return{type:"native",key:"theusual",events:{wheel(t){let n=!1;if(!e.constraints.active&&wu(t,this.chart)){const r=Math.sign(-t.deltaY);e.viewState.set("rotation",r*(Math.PI/12)),n=!0}else if(!e.constraints.select&&!e.constraints.active){const e=this.chart.componentsFromPoint(t).filter(e=>"legend-cat"===e.key)[0];e&&(n=!0,function(e,t){const n=(Math.abs(e.deltaX)>Math.abs(e.deltaY)?e.deltaX:e.deltaY)>=0?"next":"prev";t.emit(n)}(t,e))}n&&t.preventDefault()}}}}const ku=(e,{requireFailure:t,recognizeWith:n}={})=>({type:"Pan",requireFailure:t,recognizeWith:n,options:{event:"rotate",pointers:1,threshold:10,enable(t,n){return!(!this.started&&n)||!e.constraints.active&&!e.interactions.lasso.active()&&wu(n,this.chart)}},events:{rotatestart(e){e.preventDefault();const t=this.chart.component("slices").rect,n=this.chart.element.getBoundingClientRect();this.pieCenter={x:n.left+t.x+t.width/2,y:n.top+t.y+t.height/2},this.prevAngle=Math.atan2(e.center.y-this.pieCenter.y,e.center.x-this.pieCenter.x),this.started=!0},rotatemove(t){t.preventDefault();const n=Math.atan2(t.center.y-this.pieCenter.y,t.center.x-this.pieCenter.x);e.viewState.set("rotation",n-this.prevAngle),this.prevAngle=n},rotateend(e){e.preventDefault(),this.started=!1},rotatecancel(e){e.preventDefault(),this.started=!1}}}),Lu=(e,{requireFailure:t,recognizeWith:n}={})=>({type:"Pan",requireFailure:t,recognizeWith:n,options:{event:"legendPan",pointers:1,threshold:10,enable(t,n){return!(!this.isStarted&&n)||!e.constraints.active&&this.chart.componentsFromPoint({x:n.center.x,y:n.center.y}).some(e=>"legend-cat"===e.type)}},events:{legendPanstart(e){if(e.preventDefault(),!this.isStarted){this.components=this.chart.componentsFromPoint({x:e.center.x,y:e.center.y}),this.components.forEach(t=>{t.emit("panstart",e)}),this.isStarted=!0;const t=this.chart.component("tooltip");t&&t.show&&t.emit("hide")}},legendPanmove(e){this.components.forEach(t=>{t.emit("panmove",e)}),e.preventDefault()},legendPanend(e){e.preventDefault(),this.components.forEach(t=>{t.emit("panend",e)}),this.isStarted=!1}}}),Ou=(e,t,n)=>({key:"hammered",type:"hammer",enable:!0,gestures:t?[ku(e,{}),Eu(e,t,{}),...n]:[Su(e,{}),Au(e,{}),ku(e,{}),Iu(e,{}),Lu(e,{}),Eu(e,t,{}),...n]});function Tu(e,t,n){const r=e.getIsSingleSelect(0),{constraints:i}=n;if(i.active&&i.passive)return[];const o=t.tooltipService.getInteractions();return[Ou(t,r,o.gestures),Mu(t),o.native]}function Nu({settings:e},t){const n={share:{type:"d3-number",format:".1%"},arc:{data:{field:t.encodings.slice.arc}},fill:e.scales.fill&&e.scales.fill.data&&e.scales.fill.data.field?{data:{field:e.scales.fill.data.field}}:{}};return t.encodings.slice.outerRadius&&(n.outerRadius={data:{field:t.encodings.slice.outerRadius}}),n}function Pu({layout:e},t,n){if(!e.dimensionTitle)return!1;const r=t.alternativeService.getAlternatives(),i=t.styleService.axis.title.getStyle();return{key:"dimension-title",type:"axis-title",renderer:"react-qcm",layout:{dock:"top",minimumLayoutMode:"SMALL"},data:{infos:e.qHyperCube.qDimensionInfo,alternatives:r.dimensions},resources:{app:t.app,cache:t.viewCache,model:t.model,selections:t.selections,translator:t.translator},callbacks:{onChange:()=>{}},settings:{isDisabled:()=>n.constraints.active,isRTL:n.rtl,isSnapshot:!!e.snapshotData,noModelDependencies:t?.flags?.isEnabled("VIZ_252_DATA_TITLE_OUTSIDE_SENSE"),skipAttributeExpressions:!1,type:"dimension"},style:{title:{color:i.color,fontFamily:i.fontFamily,fontSize:i.fontSize}}}}function Fu({layout:e,context:t,selectionService:n},r={}){const i=function({layout:e}={},t={}){const n={};return Ws(n,t.colorService.getScales()),t.encodings.slice.outerRadius&&Ws(n,function({layout:e},t){const n={radius:{type:"linear",include:[0],data:{extract:{field:t.encodings.slice.outerRadius}}}};return e.donut.showAsDonut||(n.radius.min=0),n}({layout:e},t)),n}({layout:e},r),o={scales:i};let a=[];const s=function(e,t){const n=e.disclaimerService.getDisclaimer();if(!n)return!1;const{rtl:r}=t,{translator:i}=e,{fontFamily:o}=e.themeService.getStyles();return{key:"disclaimer",type:"disclaimer",renderer:"react-qcm",layout:{dock:n.alignment},settings:{isRTL:r,label:i.get(`Object.Disclaimer.${n.key}`)},style:{fontFamily:o}}}(r,t);if(r.disclaimerService.getHasSuppressingDisclaimer())return{components:[s]};const l=t.constraints.select||t.constraints.active,u=r.colorService.getLegend({eventName:"legend",key:"legend",viewState:r.viewState,chart:r.chart,styleReference:"object.pieChart",styleOverrides:{title:r.styleService.legend.title.getStyle(),label:r.styleService.legend.label.getStyle()},rtl:t.rtl},{navigationDisabled:l});return i.fillRange&&u.components[0]&&("right"===u.components[0].layout.dock||"left"===u.components[0].layout.dock||t.rtl)&&(i.fillRange.invert=!0),a=[uu({layout:e},r),cu({layout:e},r),pu(r),du({layout:e},r),Pu({layout:e},r,t),...u.components,ru({scaleKey:"fill",legend:u.components[0]||{},onEdited:r.onSelect}),{key:"lasso",type:"brush-lasso",layout:{displayOrder:99},settings:{brush:{components:[{key:"slices",contexts:["selection"]}]},lasso:{fill:"rgba(0, 0, 0, 0)",stroke:"black",strokeWidth:2,opacity:.7,strokeDasharray:[]},snapIndicator:{threshold:75,strokeDasharray:"5, 5",stroke:"black",strokeWidth:2,opacity:.7},startPoint:{r:10,stroke:"rgba(77, 192, 78, 1)",strokeWidth:0,opacity:1}}},{key:"area",type:"brush-area",settings:{brush:{components:[{key:"slices",contexts:["selection"],action:"add"}]}},style:{area:{fill:"transparent",strokeWidth:2,stroke:"black",strokeDasharray:"5 5",opacity:.7}}},Du({layout:{components:e.components,dataPoint:Ws({},e.dataPoint,{show:!(e.effectPath&&e.snapshotData&&!1===e.dataPoint.show)}),donut:e.donut},context:t},r),...r.tooltipService.getComponents(),s],a=a.filter(e=>!1!==e),{interactions:Tu(n,r,t),scales:i,components:r.pluginService.extendComponents(a),palettes:r.colorService.getPalettes(),formatters:Nu({settings:o},r),strategy:Js(0,r)}}function Ru({instance:e,services:t,picasso:r,flags:i}){const o=x(),a=A(),s=M(),l=w(),u=T(),c=k(),p=D(),d=O(),{qLocaleInfo:f}=N(),m=nu({enable:c&&!c.snapshotData}),[h]=F(()=>{if(!t)return Promise.resolve();Yl.attrExpr.updateProperties(a,c);const e=({getUseBaseColors:e})=>({theme:u,legendProps:c.legend,layout:c,localeInfo:f,hc:c.qHyperCube,colorProps:{...c.color,useBaseColors:e(c)}});return Promise.resolve(a&&!c.snapshotData?a.getEffectiveProperties():{}).then(async n=>Promise.all([t.colorService.initialize({createConfig:e}),Promise.resolve(n),t.pluginService.initialize(),t.alternativeService.initialize({properties:n})]))},[t,m]);I(()=>{e?.selectionService&&e.selectionService.setLayout(c)},[c]),I(()=>{if(!e||!h)return;const{chart:m,viewState:y,interactions:g,viewCache:v}=e,{alternativeService:b,colorService:x,disclaimerService:q,pluginService:D,themeService:S,tooltipService:C,styleService:w}=t,E=o.viewState||{};c.snapshotData||(y.preventSet("legendScrollOffset",E.legendScrollOffset||0),y.preventSet("rotation",E.rotation||0)),function(e,t){e&&e.snapshotData&&e.snapshotData.content&&e.snapshotData.content.chartData&&(t.preventSet("legendScrollOffset",e.snapshotData.content.chartData.legendScrollOffset),t.preventSet("rotation",e.snapshotData.content.chartData.rotation))}(c,y),C.expando.set("properties",h[1]);const I=r.data("q")({key:"qHyperCube",data:c.qHyperCube,config:{localeInfo:f}}),A=[{type:"q",key:"qHyperCube",data:c.qHyperCube,config:{localeInfo:f}},...x.getData()],M={slice:{arc:"qMeasureInfo/0"}};c.qHyperCube.qMeasureInfo.length>1&&(M.slice.outerRadius="qMeasureInfo/1"),q.initialize({args:{ds:I,encodings:M}});const k=function(e,t){if(t.slice.outerRadius)return e.extract({field:"qDimensionInfo/0",props:{num:{field:t.slice.arc},radius:{field:t.slice.outerRadius}}}).filter(e=>e.num.value>0&&"NaN"!==e.radius.value).length;return e.extract({field:"qDimensionInfo/0",props:{num:{field:t.slice.arc}}}).filter(e=>e.num.value>0).length}(r.data("q")({data:c.qHyperCube,config:{localeInfo:f}}),M),L=p?()=>{const e=m.brush("selection");n.selections(e,{},c).forEach(e=>{p.select(e)})}:()=>{},O=c.snapshotData&&!o.freeResize?{width:(c.snapshotData.content.size||c.snapshotData.object.size).w,height:(c.snapshotData.content.size||c.snapshotData.object.size).h}:void 0,T=t=>e.selectionService.getIsSelectionLocked(t),N=()=>Fu({layout:c,context:{rtl:"rtl"===o.direction,theme:u,constraints:d},selectionService:e.selectionService},{picasso:r,ds:I,model:a,app:s,chart:m,onSelect:L,isLocked:T,interactions:g,constraints:d,translator:l,viewState:y,dataRowCount:k,encodings:M,alternativeService:b,colorService:x,disclaimerService:q,pluginService:D,themeService:S,styleService:w,tooltipService:C,debouncer:_i,properties:h[1],selections:p,logicalSize:O,flags:i,viewCache:v,animations:{enabled:()=>function({viewState:e,options:t,viewCache:n,layout:r,chart:i}){return!1!==t.chartAnimations&&n.get("chartWidth")===i.element.clientWidth&&n.get("chartHeight")===i.element.clientHeight&&n.get("hasZeroLine")===!!i.component("zeroLine")&&0===e.get("rotation")&&!Sl.propertiesHaveChanged({viewCache:n,layout:r})}({viewState:y,options:o,layout:c,viewCache:v,chart:m})}});e.generateSettings=N;const P=N();m.update({data:A,settings:P}),v.set("chartWidth",m.element.clientWidth),v.set("chartHeight",m.element.clientHeight),v.set("hasZeroLine",P.components.filter(e=>"zeroLine"===e.key).length>0),Sl.cacheProperties({viewCache:v,layout:c}),o.effect&&c.effectProperties?o.effect.update(c,m,{encodings:M}):c.effectPath||m.brush("highlight").end()},[e,h,o.direction,o.effectProperties,d,u.name(),l.language()])}function ju({instance:e,services:t}){const n=q(),r=k();j(i=>{if(!(r.snapshotData&&r.snapshotData.content&&r.snapshotData.content.chartData)&&(function(e,t){const n=t.getBoundingClientRect();e.snapshotData=e.snapshotData||{},e.snapshotData.content=e.snapshotData.content||{},e.snapshotData.content.size=e.snapshotData.content.size||{w:n.width,h:n.height}}(i,n),e&&t))return function({layout:e,chart:t,viewState:n,colorService:r}){return e.snapshotData.content=e.snapshotData.content||{},e.snapshotData.content.chartData={legendScrollOffset:el(t,"legend-cat"),rotation:n.get("rotation")},r.getSnapshotData().then(t=>{e.snapshotData.content.chartData={...e.snapshotData.content.chartData,...t}}).catch(()=>{})}({layout:i,chart:e.chart,colorService:t.colorService,viewState:e.viewState})}),H(()=>({getViewState:()=>({rotation:e.viewState.get("rotation"),legendScrollOffset:el(e.chart,"legend-cat")})}),[e])}var Hu,Vu={exports:{}};var zu=(Hu||(Hu=1,self,Vu.exports=(()=>{var e={909: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],d=1,f=arguments.length,m=!1;for("boolean"==typeof p&&(m=p,p=arguments[1]||{},d=2),(null==p||"object"!=typeof p&&"function"!=typeof p)&&(p={});d<f;++d)if(null!=(t=arguments[d]))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}},8:(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],d=1,f=arguments.length,m=!1;for("boolean"==typeof p&&(m=p,p=arguments[1]||{},d=2),(null==p||"object"!=typeof p&&"function"!=typeof p)&&(p={});d<f;++d)if(null!=(t=arguments[d]))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:()=>Le});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 d(e,t){var n=e.crossAllDimensions;return 2===t&&n?"RowNo(Total)":"RowNo()"}function f(e){var t=function(e){return e?(e=function(e){return e.replace(/\/\*[^]*?\*\//g,"")}(e=function(e){return e.replace(/\/\/(.*)$/gm,"")}(e))).trim():""}(e),n=t.trim();return"="===n.substring(0,1)?n.substring(1).trim():n}function 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 y(e){return void 0===e?")":", 0, ".concat(e,")")}function g(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(g("MinString(".concat(t,")")),")' and Only({1}").concat(t,")<='$(=").concat(g("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),d=c(r[1],i),f=m(0),h=m(1),y=v(p,f),g=v(d,h);return"".concat(a,"({1<").concat(y,",").concat(g,">}").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(f(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),d=m(1);return"If(Count(".concat(p,") * Count(").concat(d,") > 0, ").concat(a," + ").concat(s).concat(l,")")}return a},getRowNoComp:d,getNumStepComp:function(e,t){if(!p(e)){var n=e.steps;return"number"!=typeof n||Number.isNaN(n)?6:n}return d(e,t)},getAboveCompPrefix:h,getAboveCompSuffix:y,getAboveComp:function(e,t,n,r){return h(e,t)+n+y(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:f,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 C(e){return C="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},C(e)}var w=t().bind(null,!0),E={},I=Array.isArray;function A(e){return null!=e&&!Array.isArray(e)&&"object"===C(e)}function M(e){return void 0===e}function k(e,t){return"function"==typeof e[t]||"$$"===t.substring(0,2)||"_"===t.substring(0,1)}function L(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]=M(e[n||t])?o:e[t],e=e[n||t]}}),e}function O(e,t){var n=!0;if(A(e)&&A(t))return Object.keys(e).length===Object.keys(t).length&&(Object.keys(e).forEach(function(r){O(e[r],t[r])||(n=!1)}),n);if(I(e)&&I(t)){if(e.length!==t.length)return!1;for(var r=0,i=e.length;r<i;r+=1)if(!O(e[r],t[r]))return!1;return!0}return e===t}E.generate=function(e,t,n){n=n||"";var r=[];return Object.keys(t).forEach(function(i){var o=function(e){return e?w({},{val:e}).val:e}(t[i]),a=e[i],s="".concat(n,"/").concat(i);O(o,a)||k(t,i)||(M(a)?r.push({op:"add",path:s,value:o}):A(o)&&A(a)?r=r.concat(E.generate(a,o,s)):I(o)&&I(a)?r=r.concat(function(e,t,n){var r=[],i=e.slice(),o=-1;function a(e,t,n){if(e[n]&&M(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(O(t,i))return r;if(!M(t[0])&&M(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(E.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){M(t[i])&&!k(e,i)&&r.push({op:"remove",path:"".concat(n,"/").concat(i)})}),r},E.apply=function(e,t){t.forEach(function(t){var n,r,i=L(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(I(i))"-"===o&&(o=i.length),i.splice(+o,"add"===t.op?0:1,t.value);else if(I(a)&&I(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(A(a)&&A(t.value))n=a,Object.keys(n).forEach(function(e){Object.getOwnPropertyDescriptor(n,e).configurable&&!k(n,e)&&delete n[e]}),w(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=L(e,t.from);I(i)?i.splice(+o,0,c.splice(+s,1)[0]):(i[o]=c[s],delete c[s])}else"remove"===t.op&&(I(i)?i.splice(+o,1):delete i[o])})},E.clone=function(e){return w({},e)},E.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},E.updateObject=function(e,t){Object.keys(e).length?E.apply(e,E.generate(e,t)):w(e,t)};const T=E,N=function(e,n,r){if(!e)return Promise.resolve();var i=T.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 P="accumulation";function F(e,t){var n=o(e,t);if(n)for(var r=0;r<n.length;r++)if(n[r].type===P)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===P)return r;return-1}(e,t);return n>-1?"".concat(t,".").concat(n):t}var j={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),d=D.getAboveComp(n,l,c,p),f=D.getRangeComp("RangeSum",d);if(D.needDimension({modifier:n,properties:r,layout:i})){var m=D.getDimComp(u,1),h=D.getDimComp(u,0),y=D.getAggrComp(f,m,h);f=n.showExcludedValues?D.getExcludedComp({modifier:n,dimensions:u,dimensionAndFieldList:s,valueComp:y}):y}return f},extractInputExpression:D.extractInputExpression,initModifier:function(e){D.initModifier(e,j)},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=F(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=F(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(P))return!1;var o=F(t,e);return o&&!o.disabled}};return n}};var V="movingAverage";function z(e,t){var n=o(e,t);if(n)for(var r=0;r<n.length;r++)if(n[r].type===V)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===V)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,d=D.getExpressionWithExcludedComp({expression:n,modifier:r,dimensions:c,dimensionAndFieldList:l,treatMissingAsNull:p}),f=D.getNumStepComp(r,u),m=D.getAboveComp(r,u,d,f);if(r.nullSuppression)t=D.getRangeComp("RangeAvg",m);else{var h=D.getRangeComp("RangeSum",m),y=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(y)}var g=t;if(D.needDimension({modifier:r,properties:i,layout:a})){var v=D.getDimComp(c,1),b=D.getDimComp(c,0),x=D.getAggrComp(g,v,b);g=r.showExcludedValues?D.getExcludedComp({modifier:r,dimensions:c,dimensionAndFieldList:l,funcComp:"Only",valueComp:x}):x}return g},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(V))return!1;var o=z(t,e);return o&&!o.disabled}};return n}};var U="timeSeriesDecomposition";function W(e,t){var n=o(e,t);if(n)for(var r=0;r<n.length;r++)if(n[r].type===U)return n[r]}function K(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===U)return r;return-1}(e,t);return n>-1?"".concat(t,".").concat(n):t}var Y={type:"timeSeriesDecomposition",disabled:!1,decomposition:"",steps:2,outputExpression:""};const G={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,Y),""===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(K(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(K(t,e),".steps")},type:"integer",translation:t.modifierTimeSeriesDecompositionPeriods||"properties.modifier.timeSeriesDecomposition.periods",schemaIgnore:!0,defaultValue:2,change:function(t,n){var r=W(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=W(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(U))return!1;var o=W(t,e);return o&&!o.disabled}};return n}};var J="difference";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 X(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 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),d="".concat(c," - ").concat(p);if(D.needDimension({modifier:n,properties:r,layout:i})){var f=D.getDimComp(u,1),m=D.getDimComp(u,0),h=D.getAggrComp(d,f,m);d=n.showExcludedValues?D.getExcludedComp({modifier:n,dimensions:u,dimensionAndFieldList:s,funcComp:"Only",valueComp:h}):h}return d},initModifier:function(e){Object.keys(Q).forEach(function(t){void 0===e[t]&&(e[t]=Q[t])})},enableTotalsFunction:function(){return!1},propertyPanelDef:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n={type:"items",items:{disclaimer:{component:"text",translation:t.disclaimer||"properties.modifier.difference.disclaimer",show:function(e,t){return!D.isApplicable({properties:t.properties})}},settings:{type:"items",items:{primaryDimension:{refFn:function(t){return"".concat(X(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(X(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(X(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(J))return!1;var o=Z(t,e);return o&&!o.disabled}};return n}};var te="normalization";function ne(e,t){var n=o(e,t);if(n)for(var 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,d=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),d=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(d,"))")}(c,p,n.field,n.value,d,l,n.primaryDimension)},initModifier:function(e){Object.keys(oe).forEach(function(t){void 0===e[t]&&(e[t]=oe[t])})},updateModifier:function(e,t){1===(t.qDimensions?t.qDimensions.length:0)&&0===e.dimensionalScope&&(e.dimensionalScope=2)},enableTotalsFunction:function(){return!0},propertyPanelDef:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n={type:"items",items:{disclaimer:{component:"text",translation:t.disclaimer||"properties.modifier.normalization.disclaimer",show:function(e,t){return!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",de="qDef.qDef",fe="qDef.base.qDef",me="qLibraryId",he="qDef.base.qLibraryId";const ye={getExpression:function(e){var t=o(e,fe);return void 0!==t?t:o(e,de)},getExpressionRef:function(e){return void 0!==o(e,fe)?fe:de},getLibraryIdRef:function(e){return o(e,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 ge="qDef.qDef",ve="qDef.base.qDef",be="qLibraryId",xe="qDef.base.qLibraryId",qe="qDef.qLabel",De="qDef.qLabelExpression",Se="qDef.base.qLabel",Ce="qDef.base.qLabelExpression",we="qDef.qAggrFunc",Ee="qDef.base.qAggrFunc",Ie={initBase:function(e,t){(t||Ie.isValid(e))&&(n(e,ve,o(e,ge)),n(e,xe,o(e,be)),n(e,Se,o(e,qe)),n(e,Ce,o(e,De)))},restoreBase:function(e){Ie.isValid(e)&&(n(e,ge,o(e,ve)),n(e,be,o(e,xe)),n(e,qe,o(e,Se)),n(e,De,o(e,Ce)),o(e,we)&&o(e,Ee)&&n(e,we,o(e,Ee)),delete e.qDef.base)},isValid:function(e){var t=o(e,ve),n=o(e,xe);return void 0!==t||void 0!==n}};const Ae=Ie;function Me(e){return Me="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},Me(e)}var ke={accumulation:H,movingAverage:$,difference:ee,normalization:ce,timeSeriesDecomposition:G};const Le={modifiers:ke,apply:Te,applyModifiers:Ne,cleanUpMeasure:Pe,destroy:function(e){e&&Oe[e.id]&&Oe[e.id].masterItemSubscriber&&(Oe[e.id].masterItemSubscriber&&Oe[e.id].masterItemSubscriber.unsubscribe(),delete Oe[e.id])},hasActiveModifiers:Fe,getActiveModifier:Re,initBase:Ae.initBase,isSupportedModifiers:function(e){return Array.isArray(e)&&e.some(function(e){return ke[e]})},isApplicableSupportedModifiers:function(e){var t=e.modifierTypes,n=e.properties,r=e.layout;return Array.isArray(t)&&t.some(function(e){return ke[e]&&ke[e].isApplicable({properties:n,layout:r})})},measureBase:ye,limitedSorting:function(e){var t=e.measures,n=e.properties,r=e.layout,i=!1,o=!1;return t.forEach(function(e){var t=Ve(e);Ke({modifiers:t,properties:n,layout:r})&&(i=!0,o=o||Xe({modifiers:t,properties:n,layout:r}))}),i&&!o},ifEnableTotalsFunction:je};var Oe={};function Te(){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;Oe[n.id]=Oe[n.id]||{isFirstTime:!0};var u=Oe[n.id].isFirstTime;if(Oe[n.id].isFirstTime=!1,r&&"object"===Me(r))return Ne({model:n,properties:r});var c=n?n.layout:void 0,p=o(c,"qSelectionInfo.qInSelections");if(a||p)return Promise.resolve(l);var d=o(c,"qHyperCube.qMeasureInfo"),f=Oe[n.id].lastReloadTime;if(Oe[n.id].lastReloadTime=o(n,"app.layout.qLastReloadTime"),Fe({measures:d,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 We({measure:e,properties:n,layout:r})})}({measures:t,layout:n})}({measures:d,layout:c,model:n,lastReloadTime:f});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 Ke({modifiers:Ve(t),layout:n})?!t.base:!!t.base}({measure:e,layout:n})}))}({measures:d,layout:c,masterItem:s,isFirstTime:u})?n.getEffectiveProperties().then(function(e){var r=t()(!0,{},e);_e(r);var i=Qe(r);return Ye({model:n}).then(function(t){return Ge({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(We({measure:t,properties:e.properties})){var n=0,r=t.qDef.modifiers;Array.isArray(r)&&r.forEach(function(e){if("object"===Me(e)&&!e.disabled){if(n++,"object"!==Me(ke[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=ke[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}),Ne({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"===Me(e.base)})}(d)?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 Pe(e)}),Ze({oldProperties:e,newProperties:r,model:n})})}({model:n,properties:e})}):Promise.resolve(l)}function Ne(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 d=Qe(i);return et({model:n,libraryIds:d,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(!Fe({measures:n,properties:r}))return n.forEach(function(e){return Pe(e)}),Promise.resolve();var l=a?void 0:Qe(r);return Ye({model:i,dimensionAndFieldList:s}).then(function(e){return Ge({libraryIds:l,model:i,libraryItemsProps:a}).then(function(i){n.forEach(function(n){Ke({modifiers:n.qDef.modifiers,properties:r})?(function(e){var n=e.measure,r=e.properties,i=e.libraryItemsProps,a=e.dimensionAndFieldList,s=0;Ae.isValid(n)||Ae.initBase(n,!0);var l=n.qDef,u=l.modifiers,c=l.base;Array.isArray(u)&&u.forEach(function(e){if("object"===Me(e)&&!e.disabled){if(s++,"object"!==Me(ke[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)");ke[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:ke[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 ke[r.type].updateModifier&&ke[r.type].updateModifier(r,i.qHyperCubeDef);var a=ye.getExpression(n),s=""===a?a:ke[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||je(e)?"None"!==t?delete e.qDef.base.qAggrFunc:"None"===t&&je(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)):Pe(n)})})})}({measures:a,properties:i,model:n,libraryItemsProps:c,dimensionAndFieldList:p}).then(function(){return l?Ze({oldProperties:r,newProperties:i,model:n}):Promise.resolve(!1)})})}function Pe(e){!function(e){var t=Ve(e);return Array.isArray(t)&&t.some(function(e){return"object"===Me(e)&&!e.disabled&&!ke[e.type]})}(e)?Ae.restoreBase(e):delete e.qDef.base,e.qDef.coloring&&delete e.qDef.coloring,Be(e)}function Fe(e){var t=e.measures,n=e.properties,r=e.layout;return!!Array.isArray(t)&&t.some(function(e){return Ke({modifiers:Ve(e),properties:n,layout:r})})}function Re(e){var t=Ve(e);if(Array.isArray(t))for(var n=0;n<t.length;n++){var r=t[n];if(ke[r.type]&&!r.disabled)return r}}function je(e){var t=Re(e);return!t||ke[t.type].enableTotalsFunction(e)}function He(e){return o(e,"qHyperCubeDef.qMeasures",[]).concat(o(e,"qHyperCubeDef.qLayoutExclude.qHyperCubeDef.qMeasures",[]))}function Ve(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:!Ae.isValid(e)&&n.base&&(e.qDef.base=t()(!0,{},n.base)))}(e)})}function Be(e){var t=Ve(e);Array.isArray(t)&&t.forEach(function(t){"object"===Me(t)&&(t.disabled||!ke[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 Ue(e){var t=$e(e);return e.qLibraryId||t&&t.qLibraryId}function We(e){var t=e.measure,n=e.properties,r=e.layout;return!Ue(t)&&Ke({modifiers:Ve(t),properties:n,layout:r})}function Ke(e){var t=e.modifiers,n=e.properties,r=e.layout,i={};return Array.isArray(t)&&t.some(function(e){return!("object"!==Me(e)||e.disabled||!ke[e.type])&&(void 0===i[e.type]&&(i[e.type]=ke[e.type].isApplicable({properties:n,layout:r})),i[e.type])})}function Ye(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 Ge(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 Je(e,t){if(""!==t||-1===["qFmt","qDec","qThou"].indexOf(e))return t}function Ze(e){var t=e.oldProperties,n=e.newProperties,r=e.model,i=JSON.stringify(o(t,"qHyperCubeDef.qMeasures"),Je)!==JSON.stringify(o(n,"qHyperCubeDef.qMeasures"),Je)||JSON.stringify(o(t,"qHyperCubeDef.qLayoutExclude.qHyperCubeDef.qMeasures"),Je)!==JSON.stringify(o(n,"qHyperCubeDef.qLayoutExclude.qHyperCubeDef.qMeasures"),Je);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):N(t,n,r)}({model:r,oldProperties:t,newProperties:n}).then(function(){return i}):Promise.resolve(i)}function Xe(e){var t=e.modifiers,n=e.properties,r=e.layout;return Array.isArray(t)&&t.some(function(e){return"object"===Me(e)&&!e.disabled&&ke[e.type]&&ke[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=Ve(t);if(Ke({modifiers:r,properties:e})){var o=Ue(t);o&&n.push(o),i=i||Xe({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)?(Oe[t.id].masterItemSubscriber=Oe[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 Te({model:t,masterItem:e}).then(function(){return t.app.clearUndoBuffer()})}}),Oe[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 d=n(8),f=n.n(d);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))},y=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())},g=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){f().cleanUpMeasure(e),e.qDef.modifiers&&(e.store={modifiers:e.qDef.modifiers},delete e.qDef.modifiers)})};function x(e,t,n){var r,i,a=arguments.length>3&&void 0!==arguments[3]&&arguments[3],s=o.getValue(e,t);if(!o.isAtomicValue(s))try{if((i=(i=(r=JSON.stringify(s)).match(/:\{/g))?i.length:0)>2&&!a)return;s=JSON.parse(r)}catch(e){return}o.getValue(e,"qLayoutExclude.quarantine")||o.setValue(e,"qLayoutExclude.quarantine",{});var l=o.getValue(e,"qLayoutExclude.quarantine");l[n]||(l[n]={}),l[n][t]=s}var q=n(909),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 C(e,t){return D()(!0,{},t,e)}function w(e,t,n){return"function"==typeof e?e(t):Number.isNaN(+e)?n:e}var E=Math.pow(2,53)-1;function I(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 A(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 M=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},k=function(e,t,n){t.hasOwnProperty(e)&&(n[e]=t[e])},L=function(e,t,n,r){t.hasOwnProperty(e)?n[e]=t[e]:n[e]=r},O=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}}},T=function(){return{qDef:{autoSort:!0,cId:"",numFormatFromTemplate:!0},qLibraryId:"",qTrendLines:[]}},N=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)}},P=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=C(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=C(s.excludedMeasures[t],a);o.qMeasures.length<i?o.qMeasures.push(u):o.qLayoutExclude.qHyperCubeDef.qMeasures.push(u)}},F=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=w(a.max,i.dimensions.length,E),l=w(a.min,i.dimensions.length,0);return{maxDimensions:w(o.max,s,E),minDimensions:w(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))},j=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},V=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 I(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 I(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)?I(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 A(e)}(t=a.qMeasures)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(t)||function(e,t){if(e){if("string"==typeof e)return A(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?A(e,t):void 0}}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}();a.qMeasures=[],s.forEach(function(e){a.qMeasures.push(e),r.measures.added(e,n)})}},B=function(e){var t=e.measures,n=e.modifierTypes;t&&n&&f().isSupportedModifiers(n)&&t.forEach(function(e){e.store&&e.store.modifiers&&(e.qDef.modifiers=e.store.modifiers),delete e.store})};function $(e,t){var n=o.getValue(e,"qLayoutExclude.quarantine",{})[t];return!!n&&(Object.keys(n).forEach(function(t){o.setValue(e,t,n[t])}),delete e.qLayoutExclude.quarantine[t],!0)}const U={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}),y({exportFormat:i,qHyperCubeDef:l}),delete l.qLayoutExclude,g({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",!0),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,d=void 0===p||p,f=e.isHCModifierSupported,m=void 0===f||f,h={qChildren:[]},y=j({exportFormat:t,initialProperties:r,hypercubePath:u}),g=o.getValue(r,u||"").qHyperCubeDef,v=o.getValue(y,u||"").qHyperCubeDef,b=F({exportFormat:t,dataDefinition:a}),x=b.maxDimensions,q=b.minDimensions,D=b.maxMeasures,S=b.minMeasures,C=l.defaultDimension,w=void 0===C?O():C,E=l.defaultMeasure,I=void 0===E?T():E;v.qDimensions.length=0,v.qMeasures.length=0,H({exportFormat:t,maxDimensions:x,minDimensions:q,maxMeasures:D,minMeasures:S})&&V({exportFormat:t,maxDimensions:x,minDimensions:q,maxMeasures:D,minMeasures:S,newHyperCubeDef:v}),N({exportFormat:t,maxDimensions:x,minDimensions:q,newHyperCubeDef:v,defaultDimension:w}),P({exportFormat:t,maxMeasures:D,minMeasures:S,newHyperCubeDef:v,defaultMeasure:I}),z({newProperties:y,dataDefinition:a,hypercubePath:u}),_({newProperties:y,dataDefinition:a,hypercubePath:u}),R({exportFormat:t,newHyperCubeDef:v}),k("qMaxStackedCells",g,v),k("qNoOfLeftDims",g,v),L("qInitialDataFetch",g,v,[{qTop:0,qLeft:0,qWidth:0,qHeight:0}]),L("qMode",g,v,"S"),L("qReductionMode",g,v,"N"),L("qSortbyYValue",g,v),L("qIndentMode",g,v),L("qShowTotalsAbove",g,v),M(y,t,r),h.qProperty=y;var A=o.getValue(c||{},"support.modifiers");return B({measures:v.qMeasures,modifierTypes:A}),d&&$(h.qProperty,"storedFilters"),"S"===v.qMode&&m&&$(h.qProperty,"dynamicScript"),h}};var W={cellBackgroundColor:!0,cellForegroundColor:!0,colorByAlternative:!0,colorByExpression:!0,tooltip:!0,urlLabel:!0,url:!0};function K(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 Y(e,t){return e.length!==t}const G={create:function(e,t){if(!e||!W[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(K(a,t,r,i),Y(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"}},J={getNumDimensions:function(e){return o.getValue(e,"qHyperCubeDef.qDimensions.length",0)},getNumMeasures:function(e){return o.getValue(e,"qHyperCubeDef.qMeasures.length",0)},wrapFieldName:function(e){return e.split(" ").length>1&&"="!==e[0]&&"["!==e[0]?"[".concat(e,"]"):e},getItemLabel:function(e){return e.label||e.name}},Z={colorModeOptions:{primary:function(){return!0},dimension:function(e){return J.getNumDimensions(e)>0&&J.getNumMeasures(e)<=1},multiColor:function(e){return J.getNumMeasures(e)>1},measure:function(e){return J.getNumDimensions(e)>0},expression:function(e){return J.getNumMeasures(e)>=1}}},X={colorModeOptions:{primary:function(){return!0},dimension:function(){return!0},multiColor:function(){return!1},measure:function(){return!0},expression:function(e){return J.getNumMeasures(e)>=1}}};var Q={scatterplot:X,"sn-scatter-plot":X,piechart:{colorModeOptions:{primary:function(){return!0},dimension:function(){return!0},multiColor:function(){return!1},measure:function(){return!0},expression:function(e){return J.getNumMeasures(e)>=1}}},linechart:{colorModeOptions:{primary:function(){return!0},dimension:function(e){return J.getNumDimensions(e)>1},multiColor:function(e){return J.getNumMeasures(e)>1},measure:function(e){return J.getNumDimensions(e)<=1},expression:function(e){return J.getNumMeasures(e)>=1}}},map:{colorModeOptions:{primary:function(){return!0},dimension:function(e){return J.getNumDimensions(e)>=1},multiColor:function(e){return J.getNumMeasures(e)>1},measure:function(e){return J.getNumDimensions(e)>=1},expression:function(e){return J.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 J.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=G.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"),d=o.getValue(t,"color.formatting.isCustomFormatted");if(u){var f=G.create(G.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:f,label:s,item:u,isDimension:n,qNumFormat:c,isCustomFormatted:d});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:f,measures:a,item:u,isDimension:n,qNumFormat:c,isCustomFormatted:d})}n?(f.qSortBy={qSortByAscii:1},l.qAttributeDimensions.push(f)):l.qAttributeExpressions.push(f)}}}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:f().measureBase.getLibraryId(e)}(n,t),i?(s.type="measure",s.name=i,s.id=i,o=function(e,t){return f().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=t.type,o=e.color,a=o.mode,s=J.getItemLabel(t);switch(ne(e,s||""),i){case"field":a="byDimension",o.byDimDef={label:t.label||J.wrapFieldName(t.name),key:J.wrapFieldName(t.name),type:"expression",activeDimensionIndex:t.activeDimensionIndex};break;case"expression":a="byMeasure",o.byMeasureDef={label:s,key: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)}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=G.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]||Z).colorModeOptions||Z.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=G.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)},de=function(e){e.forEach(function(e){e.qOtherTotalSpec&&"qTotalMode"in e.qOtherTotalSpec&&delete e.qOtherTotalSpec.qTotalMode})},fe=function(e){var t=e.shouldUpdateColorBy,n=e.properties,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)},ye=function(e){var t=o.getValue(e,"qHyperCubeDef.qDimensions",[]),n=o.getValue(e,"color.persistent",!1);return t.length>1&&!n},ge={exportProperties:function(e){var t=e.propertyTree,n=e.hypercubePath,r=e.viewDataMode,i=U.exportProperties({propertyTree:t,hypercubePath:n,viewDataMode:r}),o=i.data[0],a=o.dimensions.concat(o.excludedDimensions),s=o.measures.concat(o.excludedMeasures),l=G.IDMAP,u=l.COLOR_BY_ALTERNATIVE,c=l.COLOR_BY_EXPRESSION;return G.moveByIdFromGroup(a,[],"qAttributeDimensions",u),G.moveByIdFromGroup(a,[],"qAttributeExpressions",u),G.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=U.importProperties({exportFormat:t,initialProperties:n,dataDefinition:r,defaultPropertyValues:i,hypercubePath:a,extension:s,supportedFilters:l,isHCModifierSupported:u}),p=c.qProperty,d=o.getValue(p,"visualization"),f=o.getValue(p,"qHyperCubeDef.qDimensions",[]),m=o.getValue(p,"color.mode",""),h=o.getValue(p,"color.auto",""),y=ue(p,d),g=ce({canColorBy:y,autoColor:h,colorMode:m,dimensions:f});return y[m]?fe({shouldUpdateColorBy:g,properties:p})&&me(p):he(p),g&&pe(p,"qHyperCubeDef."),ye(p)&&le(p,"color.persistent",!0),de(f),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=ge.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=ge.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 Ce(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 we(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 Ee="qHyperCubeDef.qMeasures",Ie="conditionalColoring",Ae="measures",Me="qDef.conditionalColoring";const ke={quarantine:function(e){Ce({properties:e,arrayPath:Ee,quarantineName:Ie,arrayName:Ae,itemPath:Me})},unquarantine:function(e){we({properties:e,arrayPath:Ee,itemPath:Me,arrayName:Ae,quarantineName:Ie})}};var Le="qHyperCubeDef.qMeasures",Oe="measures",Te="qHyperCubeDef.qDimensions",Ne="dimensions",Pe="qHyperCubeDef.qLayoutExclude.qHyperCubeDef.qMeasures",Fe="alternativeMeasures",Re="qHyperCubeDef.qLayoutExclude.qHyperCubeDef.qDimensions",je="alternativeDimensions",He="qCalcCondition",Ve="conditionalShowHide";const ze={quarantine:function(e){Ce({properties:e,arrayPath:Le,quarantineName:Ve,arrayName:Oe,itemPath:He}),Ce({properties:e,arrayPath:Te,quarantineName:Ve,arrayName:Ne,itemPath:He})},unquarantine:function(e){we({properties:e,arrayPath:Le,quarantineName:Ve,arrayName:Oe,itemPath:He}),we({properties:e,arrayPath:Te,quarantineName:Ve,arrayName:Ne,itemPath:He})},quarantineAlternative:function(e){Ce({properties:e,arrayPath:Pe,quarantineName:Ve,arrayName:Fe,itemPath:He}),Ce({properties:e,arrayPath:Re,quarantineName:Ve,arrayName:je,itemPath:He})},unquarantineAlternative:function(e){we({properties:e,arrayPath:Pe,quarantineName:Ve,arrayName:Fe,itemPath:He}),we({properties:e,arrayPath:Re,quarantineName:Ve,arrayName:je,itemPath:He})}},_e={hypercube:U,colorChart:ge,axisChart:De,quarantineProperty:x,unquarantineProperty:$,quarantineArrayProp:Ce,unquarantineArrayProp:we,conditionalColoring:ke,conditionalShow:ze}})(),r.default})()),Vu.exports),_u=js(zu);const Bu={setValue(e,t,n){if(!t)return;const r=t.split(".");let i=e;const o=r[r.length-1];let a;for(a=0;a<r.length-1;++a)null==i[r[a]]&&(i[r[a]]=Number.isNaN(+r[a+1])?{}:[]),i=i[r[a]];void 0!==n?i[o]=n:delete i[o]},getValue(e,t,n){const r=t.split(".");let i,o=e;if(void 0===o)return n;for(i=0;i<r.length;++i){if(null==o[r[i]])return n;o=o[r[i]]}return o}},$u={getDimensions:e=>Bu.getValue(e,"qHyperCubeDef.qDimensions",[]),getNumDimensions:e=>Bu.getValue(e,"qHyperCubeDef.qDimensions.length",0),getMeasures:e=>Bu.getValue(e,"qHyperCubeDef.qMeasures",[]),getNumMeasures:e=>Bu.getValue(e,"qHyperCubeDef.qMeasures.length",0),getDimensionLayouts(e,t){const n=Bu.getValue(e,t?`${t}.qHyperCube`:"qHyperCube",null);return n?n.qDimensionInfo:[]},getDimensionLayout(e,t,n){return this.getDimensionLayouts(t,n).filter(t=>e===t.cId)[0]},getMeasureLayouts(e,t){const n=Bu.getValue(e,t?`${t}.qHyperCube`:"qHyperCube",null);return n?n.qMeasureInfo:[]},getMeasureLayout(e,t,n){return this.getMeasureLayouts(t,n).filter(t=>e===t.cId)[0]}};const Uu={colorModeOptions:{primary:()=>!0,dimension:()=>!0,multiColor:()=>!1,measure:()=>!0,expression:e=>$u.getNumMeasures(e)>=1},showLegend:e=>{const t=Bu.getValue(e,"color.auto"),n=Bu.getValue(e,"color.expressionIsColor"),r=Bu.getValue(e,"color.mode");return!(!t&&"primary"===r||!t&&"byExpression"===r&&(n||void 0===n))},persistentColorsShow:e=>!Bu.getValue(e,"color.auto")&&"byDimension"===Bu.getValue(e,"color.mode"),useDimValColShow:e=>(void 0===Bu.getValue(e,"color.useDimColVal")&&Bu.setValue(e,"color.useDimColVal",!1),!Bu.getValue(e,"color.auto")&&"byDimension"===Bu.getValue(e,"color.mode")&&"libraryItem"===Bu.getValue(e,"color.byDimDef.type"))},Wu=function(e){const{colorModeOptions:t,persistentColorsShow:n,useDimValColShow:r,showLegend:i}=Uu;this.color={colorMode:{options(n){const r=[];return"explore"===e&&r.push({value:"auto",translation:"Common.Auto"}),r.push({value:"primary",translation:"properties.colorMode.primary"}),r.push({value:"byDimension",translation:"properties.colorMode.byDimension"}),r.push({value:"byMeasure",translation:"properties.colorMode.byMeasure"}),t.expression(n)&&"explore"!==e&&r.push({value:"byExpression",translation:"properties.colorMode.byExpression"}),r}},persistentColors:{show:e=>r(e)?n(e)&&!Bu.getValue(e,"color.useDimColVal"):n(e)},useDimColVal:{show:r}},this.legend={show:i,showTitle:{show(e){const t=Bu.getValue(e,"color.auto");return Bu.getValue(e,"legend.show")&&i(e)&&(t||!function(e){return"byExpression"===Bu.getValue(e,"color.mode")&&!0===Bu.getValue(e,"color.expressionIsColor")}(e))}},dock:{show:e=>Bu.getValue(e,"legend.show")&&i(e)}}};function Ku(e){return new Wu(e)}const Yu={classification:{section:"styling",tags:["simple"],exclusive:!0},component:"items",show:!0,chartType:"piechart",translation:"LayerStyleEditor.component.styling",chartTitle:"Object.PieChart",subtitle:"LayerStyleEditor.component.styling",useGeneral:!0,items:{strokeSection:{translation:"properties.Outline",component:"items",items:{strokeItem:{component:"items",ref:"components",key:"slices",items:{strokeWrapper:{component:"inline-wrapper",items:{strokeWidth:{translation:"LayerStyleEditor.style.strokeWidth",ref:"style.strokeWidth",width:9,show:!0,component:"dropdown",type:"string",options:[{value:"none",translation:"Common.None"},{value:"small",translation:"Common.Small"},{value:"medium",translation:"Common.Medium"},{value:"large",translation:"Common.Large"}],defaultValue:"none",schemaIgnore:!0},strokeColor:{ref:"style.strokeColor",defaultValue:{color:"#FFFFFF"},schemaIgnore:!0,width:3,component:"color-picker"}}}}}}},cornerRadius:{component:"items",translation:"LayerStyleEditor.style.cornerRadius",items:{cornerRadiusItem:{component:"items",ref:"components",key:"slices",items:{cornerRadiusSlider:{ref:"style.cornerRadius",translation:"LayerStyleEditor.style.cornerRadius",component:"slider",min:0,max:40,step:.05,width:12,defaultValue:0,schemaIgnore:!0}}}}},innerRadius:{translation:"LayerStyleEditor.style.innerRadius",component:"items",show:e=>e.donut.showAsDonut,items:{innerRadiusItem:{component:"items",ref:"components",key:"slices",items:{innerRadiusSlider:{ref:"style.innerRadius",translation:"LayerStyleEditor.style.innerRadius",component:"slider",min:.05,max:.75,step:.01,width:12,defaultValue:.55,schemaIgnore:!0}}}}}}},Gu=(e,t,n)=>{const r=`${e}.fontFamily`,i=`${e}.fontSize`;return{fontFamilyItem:{component:"dropdown",ref:r,options:()=>t.getOptions(r),defaultValue:()=>t.getDefaultValue(r)},fontWrapperItem:{component:"inline-wrapper",items:{fontSizeItem:{component:"dropdown",ref:i,options:()=>t.getOptions(i),defaultValue:()=>t.getDefaultValue(i)},fontColorItem:{component:"color-picker",width:!1,ref:`${e}.color`,defaultValue:()=>({color:n.getStyle("object.pieChart",e,"color")})}}}}},Ju=(e,t,n,r)=>{const i=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]=Yn({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:r,translator:n,flags:t,config:{id:"pieChart",paths:["axis.title","label.name","label.value","legend.title","legend.label"]}});return{component:"styling-panel",chartTitle:"Object.PieChart",translation:"LayerStyleEditor.component.styling",subtitle:"LayerStyleEditor.component.styling",useGeneral:!0,useBackground:e,items:{strokeSection:{translation:"properties.Outline",component:"panel-section",items:{strokeItem:{component:"items",ref:"components",key:"slices",items:{strokeWrapper:{component:"inline-wrapper",items:{strokeWidth:{ref:"style.strokeWidth",width:9,show:!0,component:"dropdown",type:"string",options:[{value:"none",translation:"Common.None"},{value:"small",translation:"Common.Small"},{value:"medium",translation:"Common.Medium"},{value:"large",translation:"Common.Large"}],defaultValue:"none",schemaIgnore:!0},strokeColor:{ref:"style.strokeColor",defaultValue:{color:"#FFFFFF"},schemaIgnore:!0,width:3,component:"color-picker"}}}}}}},cornerRadius:{translation:"LayerStyleEditor.style.cornerRadius",component:"panel-section",items:{cornerRadiusItem:{component:"items",ref:"components",key:"slices",items:{cornerRadiusSlider:{ref:"style.cornerRadius",component:"slider",min:0,max:40,step:.05,width:12,defaultValue:0,schemaIgnore:!0}}}}},innerRadius:{translation:"LayerStyleEditor.style.innerRadius",component:"panel-section",show:e=>e.donut.showAsDonut,items:{innerRadiusItem:{component:"items",ref:"components",key:"slices",items:{innerRadiusSlider:{ref:"style.innerRadius",component:"slider",min:.05,max:.75,step:.01,width:12,defaultValue:.55,schemaIgnore:!0}}}}},axisTitleSection:t?.isEnabled("CLIENT_IM_3050")?{translation:"properties.dataPoints.dimensionlabels",component:"panel-section",items:{axisTitleItems:{component:"items",ref:"components",key:"axis",items:Gu("axis.title",i,r)}}}:void 0,labelNameSection:t?.isEnabled("CLIENT_IM_3050")?{translation:"properties.dataPoints.dimensionValueLabel",component:"panel-section",items:{labelItems:{component:"items",ref:"components",key:"label",items:Gu("label.name",i,r)}}}:void 0,labelValueSection:t?.isEnabled("CLIENT_IM_3050")?{translation:"properties.value.label",component:"panel-section",items:{labelItems:{component:"items",ref:"components",key:"label",items:Gu("label.value",i,r)}}}:void 0,legendTitleSection:t?.isEnabled("CLIENT_IM_3051")?{translation:"properties.legend.title",component:"panel-section",items:{labelItems:{component:"items",ref:"components",key:"legend",items:Gu("legend.title",i,r)}}}:void 0,legendLabelSection:t?.isEnabled("CLIENT_IM_3051")?{translation:"properties.legend.label",component:"panel-section",items:{labelItems:{component:"items",ref:"components",key:"legend",items:Gu("legend.label",i,r)}}}:void 0}}},Zu=Ku("hard");const Xu=e=>{e.color?.auto||(Vi(e,"color.mode","byDimension"),Vi(e,"color.byDimDef.activeDimensionIndex",0),Vi(e,"color.persistent",!1))},Qu=e=>{const t=[{value:"primary",translation:"properties.colorMode.primary"},{value:"byDimension",translation:"properties.colorMode.byDimension"}];switch(e.color?.mode){case"byMultiple":t.push({value:"byMultiple",translation:"properties.colorMode.multicolored"});break;case"byMeasure":t.push({value:"byMeasure",translation:"properties.colorMode.byMeasure"});break;case"byExpression":t.push({value:"byExpression",translation:"properties.colorMode.byExpression"})}return t},ec=e=>{const{flags:t,translator:n}=e||{},r=e?.sense?.theme,i=t?.isEnabled("SENSECLIENT_IM_2429_PIECHART_BG"),o={items:{simpleItems:{items:{autoColor:{label:e=>e.color?.auto?n.get("Simple.Color.Auto",n.get("properties.colorMode.byDimension")):n.get("Common.Custom"),change:Xu},colorMode:{options:Qu}}}}},a={items:{labels:{items:{header:{show:e=>e.qHyperCubeDef.qDimensions.length&&e.qHyperCubeDef.qMeasures.length},pointLabels:{component:"checkbox",ref:"dataPoint.auto",type:"boolean",defaultValue:!0,translation:"Simple.Label.Value",show:e=>e.qHyperCubeDef.qDimensions.length&&e.qHyperCubeDef.qMeasures.length,change(e){e.dataPoint.auto||Vi(e,"dataPoint.labelMode","none")}},dimensionTitle:{component:"checkbox",ref:"dimensionTitle",type:"string",translation:"Simple.Label.Dimension.Hide",defaultValue:"all",show:e=>e.qHyperCubeDef.qDimensions.length&&e.qHyperCubeDef.qMeasures.length,convertFunctions:{get:(e,t,n,r)=>!r.dimensionTitle,set(e,t,n,r,i){i.dimensionTitle=!e}}}}}}},s={uses:"settings",items:{simpleStyling:Yu,simpleLabels:a,general:{items:{showDisclaimer:{translation:"properties.showDisclaimer",type:"boolean",ref:"showDisclaimer",component:"switch",defaultValue:!0,options:[{value:!0,translation:"Common.Show"},{value:!1,translation:"properties.hide"}]}}},presentation:{type:"items",translation:"properties.presentation",grouped:!0,items:{sliceStyling:Ju(i,t,n,r),showAsDonut:{ref:"donut.showAsDonut",type:"boolean",component:"item-selection-list",defaultValue:!1,horizontal:!0,items:[{icon:"pie_chart_pie",component:"icon-item",labelPlacement:"bottom",translation:"properties.pie",value:!1},{icon:"pie_chart_donut",component:"icon-item",labelPlacement:"bottom",translation:"properties.donut",value:!0}]},labels:{type:"items",snapshot:{tid:"property-labels"},items:{dimensionTitle:{ref:"dimensionTitle",type:"boolean",component:"switch",translation:"properties.dataPoints.dimensionlabels",defaultValue:!0,options:[{value:!0,translation:"Common.Auto"},{value:!1,translation:"properties.off"}]},valuesAuto:{ref:"dataPoint.auto",type:"boolean",translation:"properties.dataPoints.labelmode",component:"switch",defaultValue:!0,options:[{value:!0,translation:"Common.Auto"},{value:!1,translation:"Common.Custom"}]},labelMode:{ref:"dataPoint.labelMode",type:"string",component:"dropdown",options:[{value:"none",translation:"Common.None"},{value:"share",translation:"properties.dataPoints.labelmode.share"},{value:"value",translation:"properties.dataPoints.labelmode.value"}],defaultValue:"share",show:e=>!e.dataPoint.auto},labelValueMode:{ref:"dataPoint.labelValueMode",type:"string",component:"dropdown",translation:"properties.dataPoints.labelvaluemode",options:[{value:"arc",translation:"Visualizations.Descriptions.Angle"},{value:"radius",translation:"Visualizations.Descriptions.Radius"}],defaultValue:"arc",show:e=>!e.dataPoint.auto&&function(e){return e.qHyperCubeDef&&e.qHyperCubeDef.qMeasures.length>1||e.qHyperCube&&e.qHyperCube.qMeasureInfo.length>1}(e)&&"value"===e.dataPoint.labelMode}}}}},colorsAndLegend:{uses:"colorsAndLegend",items:{colors:{items:{colorMode:{options:Zu.color.colorMode.options},persistentColors:{show:Zu.color.persistentColors.show}}},simpleColors:o,legend:{show:Zu.legend.show,items:{show:{defaultValue:!1,snapshot:{tid:"property-legend"}},showTitle:{show:Zu.legend.showTitle.show},dock:{show:Zu.legend.dock.show}}}}},tooltip:{uses:"tooltip"}}};return s},tc={uses:"data",items:{dimensions:{uses:"dimensions"},measures:{uses:"measures",items:{numberFormatting:{items:{percentOfPieMessage:{component:"text",translation:"properties.numberFormatting.pieMessage",show:(e,t,{properties:n}={})=>n&&(n.dataPoint.auto||"share"!==n.dataPoint.labelMode)}}}}}}},nc={uses:"sorting",items:{interColumnSorting:{reset:e=>{const{qDimensions:t,qMeasures:n,qInterColumnSortOrder:r}=e.qHyperCubeDef;if(1===t.length&&n.length>=1){const t=r.length,n=[...Array(t).keys()];[n[0],n[1]]=[n[1],n[0]],e.qHyperCubeDef.qInterColumnSortOrder=n}}}}},rc={type:"items",component:"expandable-items",translation:"properties.addons",items:{dataHandling:{uses:"dataHandling",items:{suppressZero:null,calcCond:{uses:"calcCond"}}}}};function ic(e){return{type:"items",component:"accordion",items:{data:tc,sorting:nc,addons:rc,settings:ec(e)}}}const oc=Ku("explore"),ac=ic();var sc={type:"items",component:"accordion",items:{data:{uses:"data"},sort:{uses:"sort"},presentation:{uses:"presentation",items:{showAsDonut:ac.items.settings.items.presentation.items.showAsDonut,labelMode:{type:"items",items:{labelMode:{type:"string",component:"radio-list",translation:"properties.dataPoints.labelmode",diffs:["dataPoint.auto:false","dataPoint.labelMode"],options:ac.items.settings.items.presentation.items.labels.items.labelMode.options,setPropertyValue(e,t){e.dataPoint.auto=!1,e.dataPoint.labelMode=t},getValue:e=>e.dataPoint.auto?"":e.dataPoint.labelMode}}}}},color:{uses:"color",items:{mode:{options:oc.color.colorMode.options},dimension:{items:{persistentColors:{show:e=>!(e.color&&"byDimension"===e.color.mode&&e.color.useDimColVal&&oc.color.useDimColVal.show(e))}}}}}}};const lc="slices";function uc(e,t){const n=e&&e.desc&&void 0!==e.desc.share?e.desc.share:void 0;return t("share")(n)}function cc(e){return e.data.num.label}function pc(e){return e.data.radius.label}function dc(e,t,n,r){return function(e,t){if(e.dataPoint.auto)return 1===e.qHyperCube.qSize.qcy?cc:uc;if("share"===e.dataPoint.labelMode)return uc;if("value"===e.dataPoint.labelMode)return t.encodings.slice.outerRadius&&"radius"===e.dataPoint.labelValueMode?pc:cc;return cc}(n,r)(e,t)}function fc(e){let t;return t=e.data.label?function(e,t){let n=e;return n.length>t&&(n=`${n.substr(0,t-3)}...`),n}(e.data.label,20):"",t}class mc{constructor({element:e,properties:t,effectHelper:n,Flag:r}){this.element=e,this.Flag=r,n.initFade(this.element);const i=e.find(".effectLayer");i.length>0&&i.remove(),e.append('<div class="effectLayer"></div>'),this.effectLayer=e.find(".effectLayer"),this._effectProperties=t,this.selectedIndex=t.selectedIndex,this.hasPropertiesPanel=!1,this.effectApplied=!0,n.fadeIn(this.element)}updateOrigSettings(e){return{dataPoint:e.dataPoint,legend:e.legend,dimensionTitle:e.dimensionTitle}}updateFlags(e,t){const n=this.chart.getAffectedShapes("highlight"),r=this.effectLayer[0].getBoundingClientRect(),i=n.map(n=>{const{start:i,end:o,outerRadius:a,offset:s}=n.desc.slice,{scaleRatio:l}=this.chart.component(n.key).rect,u=n.element.getBoundingClientRect(),c=(i+o)/2,p=u.left-r.left+l.x*(s.x+a*Math.sin(c)),d=u.top-r.top+l.y*(s.y-a*Math.cos(c)),f=Math.cos(c)>0?"top":"bottom",m=Math.sin(c)>0?"right":"left";return{title:fc(n),label:dc(n,this.chart.formatter,e,t),orientation:`${f}${m}`,position:{x:p,y:d}}});this.Flag.show(this.effectLayer,i)}init(e,t,n,r){return t.getProperties().then(e=>{if(!e.originalModelSettings){const t=Ws(!0,{},e);e.originalModelSettings=this.updateOrigSettings(t)}e.effectProperties=r,e.effectPath=n,e.dataPoint.show=!1,e.legend.show=!1,e.dimensionTitle=!1,t.setProperties(e)})}remove(e,t,n){return e.options=Ws(e.options,{effect:null}),n?t.getProperties().then(e=>Ws(e,{effectPath:null,effectProperties:null,dataPoint:Ws(!0,{},e.originalModelSettings.dataPoint),legend:Ws(!0,{},e.originalModelSettings.legend),dimensionTitle:e.originalModelSettings.dimensionTitle})):Promise.resolve()}}class hc extends mc{init(e,t,n,r){return e.options=Ws(!0,e.options,{effect:this}),t.layout.effectProperties&&t.layout.effectPath===n&&t.layout.effectProperties.max===r.max?Promise.resolve():super.init(e,t,n,r)}update(e,t,n){this.chart=t,this.updateHighlight(e),this.updateFlags(e,n)}updateHighlight(e){const t=this.chart.component(lc).data.items,n=e.effectProperties.min,r=e.effectProperties.max,i=[];let o=[1/0,-1],a=[-1/0,-1];t.forEach((e,t)=>{const i=e.num.value;n&&i<o[0]&&(o=[i,t]),r&&i>a[0]&&(a=[i,t])}),-1!==o[1]&&i.push(t[o[1]].value),-1!==a[1]&&i.push(t[a[1]].value),i.length&&this.chart.brush("highlight").setValues(i.map(e=>({key:"qHyperCube/qDimensionInfo/0",value:e})))}}class yc extends mc{constructor(e){super(e),this.hasPropertiesPanel=!0,this.propsTemplate=e.highlightValuePropsTemplate,this.effectHelper=e.effectHelper}onClick(e){if(!this.chart)return;const t=this.chart.shapesAt(function(e,t){const n=t.element.getBoundingClientRect();return{x:e.clientX-n.left,y:e.clientY-n.top}}(e,this.chart),{propagation:"stop"});if(1!==t.length)return;const n=t[0],r=this.chart.component(lc).data.items.map(e=>e.value).indexOf(n.data.value);-1!==r&&(this.selectedIndex=r,this.effectHelper.updateSelectedPointIndex(this))}update(e,t,n){this.chart=t,this.updateHighlight(e),this.updateDataPoints(e,n),this.updateFlags(e,n)}updateHighlight(e){const t=this.chart.component(lc).data.items[e.effectProperties.selectedIndex];this.chart.brush("highlight").setValues([{key:"qHyperCube/qDimensionInfo/0",value:t.value}])}updateDataPoints(e,t){this.dataPoints=this.chart.findShapes("path").filter(e=>e.key===lc).map((n,r)=>{const i=dc(n,this.chart.formatter,e,t);return{text:`${fc(n)} (${i})`,value:r}})}init(e,t,n,r){return e.options=Ws(!0,e.options,{effect:this}),t.layout.effectProperties&&t.layout.effectPath===n&&t.layout.effectProperties.selectedIndex===r.selectedIndex?Promise.resolve():super.init(e,t,n,r)}}const gc="/effects/highlight-value",vc="/effects/maxmin";var bc={isCompatible:({effectPath:e})=>e===vc||e===gc,create:e=>e.effectPath===vc?new hc(e):e.effectPath===gc?new yc(e):null};function xc(e){const t={},{components:n,tooltip:r}=e,i=n?n.filter(e=>"slices"===e.key)[0]:void 0;if(i&&i.style&&Object.keys(i.style).forEach(e=>{t[`chart_style_${e}`]=i.style[e]}),r){t.chart_tooltip_custom=!r.auto;const e=r.chart?.object?.refId;!r.auto&&e&&(t.chart_tooltip_custom_mini_chart=e)}return t}function qc(e){if(!e.qHyperCubeDef)return;const t=e.qHyperCubeDef.qDimensions,n=e.qHyperCubeDef.qMeasures;1===t.length&&1===n.length&&(n[0].qSortBy.qSortByNumeric=-1,e.qHyperCubeDef.qInterColumnSortOrder.splice(0,e.qHyperCubeDef.qInterColumnSortOrder.length,1,0))}function Dc(e){e.qOtherTotalSpec.qOtherMode="OTHER_COUNTED",e.qOtherTotalSpec.qOtherCounted={qv:"10"}}function Sc({translator:e}){return{dimensions:{min:1,max:1,description:()=>e.get("Visualizations.Descriptions.Slice"),add(e,t){Dc(e),qc(t),zl.addCallbackCustomTooltip(t)},move(e,t){Dc(e),qc(t),zl.moveCallbackCustomTooltip(t,e)},remove(e,t){zl.removeCallbackCustomTooltip(t,e)},replace(e,t,n,r){Dc(e),qc(r),zl.replaceCallbackCustomTooltip(r,t)}},measures:{min:1,max:2,description:(t,n)=>e.get(0===n?"Visualizations.Descriptions.Angle":"Visualizations.Descriptions.Radius"),add(e,t){qc(t)},remove(e,t){!function(e){if(!e.qHyperCubeDef)return;const t=e.qHyperCubeDef.qMeasures,{mode:n}=e.color;"byExpression"===n&&0===t.length&&(e.color.mode="primary")}(t)}}}}const Cc=e=>e.qMax<=0,wc=e=>!(!(e&&e.qHyperCube.qSize.qcy>0)||e.qHyperCube.qMeasureInfo.every(Cc));function Ec(e){return{definition:ic(e),softDefinition:sc,support:{snapshot:wc,export:wc,exportData:!0,sharing:wc,viewData:!0,effects:!0},effects:bc,extendMetrics:xc,importProperties:(t,n,r,i)=>{const o={layout:{templateId:n.templateId}};r.mapProperties(o);const a={defaultDimension:r.getDefaultDimensionProperties(),defaultMeasure:r.getDefaultMeasureProperties()},s=_u.colorChart.importProperties({exportFormat:t,initialProperties:n,dataDefinition:Sc(e),defaultPropertyValues:a,hypercubePath:i});return s.qProperty.dataPoint&&!1===s.qProperty.dataPoint.show&&delete s.qProperty.dataPoint.show,s},exportProperties:(e,t,n)=>_u.colorChart.exportProperties({propertyTree:e,hypercubePath:t,viewDataMode:n})}}function Ic(e){return{properties:{version:"2.0.1",color:{auto:!0,autoMinMax:!0,byDimDef:void 0,byMeasureDef:void 0,colorExpression:void 0,dimensionScheme:"12",expressionIsColor:!0,expressionLabel:"",formatting:{numFormatFromTemplate:!0,isCustomFormatted:void 0},measureMin:void 0,measureMax:void 0,measureScheme:"sg",mode:"primary",paletteColor:{index:6},persistent:!1,reverseScheme:!1,singleColor:void 0,useBaseColors:"off",useDimColVal:!0,useMeasureGradient:!0},components:[{key:"slices",style:{strokeWidth:"none",strokeColor:{index:-1,color:au.STROKE.COLOR},cornerRadius:au.CORNER_RADIUS,innerRadius:au.INNER_RADIUS}}],dataPoint:{auto:!0,labelMode:"share",labelValueMode:"arc"},dimensionTitle:!0,donut:{showAsDonut:!1},footnote:"",legend:{dock:"auto",show:!0,showTitle:!0},qHyperCubeDef:{qDimensions:[],qMeasures:[],qInitialDataFetch:[{qWidth:10,qHeight:500}],qSuppressMissing:!0,qSuppressZero:!1,qMode:"S"},showDetails:!0,showDisclaimer:!0,showTitles:!0,subtitle:"",title:"",tooltip:{auto:!0,hideBasic:!1,data:{qHyperCubeDef:void 0},chart:void 0,imageComponents:void 0}},data:{targets:[Sc(e)]},importProperties:({exportFormat:t,initialProperties:n,hypercubePath:r})=>{const i=_u.colorChart.importProperties({exportFormat:t,initialProperties:n,dataDefinition:Sc(e),hypercubePath:r});return i.qProperty.dataPoint&&!1===i.qProperty.dataPoint.show&&delete i.qProperty.dataPoint.show,i},exportProperties:({propertyTree:e,hypercubePath:t,viewDataMode:n})=>_u.colorChart.exportProperties({propertyTree:e,hypercubePath:t,viewDataMode:n})}}const Ac=i=>{const{flags:o}=i;!function(e){if(e&&e.get&&e.add){const t="Object.Disclaimer.LimitedData";if(e.get(t)!==t)return;Object.keys(V).forEach(t=>{e.add(V[t])})}}(i.translator);const a=function(){const i=t();return i.use(n),i.use(r(e)),i.renderer("react-qcm",ut),i.component("axis-title",nt),i.component("disclaimer",it),i.component("pie-dividers",pn),i.component("negative-indicators",hn),i}();return{qae:Ic(i),ext:Ec(i),component(){const e=_s({picasso:a}),t=Xl({flags:o,picasso:a,instance:e});Ru({instance:e,services:t,picasso:a,flags:o}),function({instance:e}){const t=k(),n=x(),r=R();I(()=>{if(!e||!e.generateSettings)return;const{viewCache:r,chart:i,generateSettings:o}=e;i.update({settings:o()}),r.set("chartWidth",i.element.clientWidth),r.set("chartHeight",i.element.clientHeight),n.effect&&n.effect.update(t,i)},[r.width,r.height])}({instance:e}),ju({instance:e,services:t})}}};export{Ac as default};
|