@nebula.js/sn-histogram 1.0.4 → 1.0.5
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/api-specifications/properties.json +1 -1
- package/core/esm/index.js +18554 -4
- package/core/esm/index.js.map +1 -1
- package/dist/sn-histogram.js +38132 -15
- package/dist/sn-histogram.js.map +1 -1
- package/dist/sn-histogram.systemjs.js +30298 -11
- package/dist/sn-histogram.systemjs.js.map +1 -1
- package/package.json +5 -3
- package/sn-histogram-ext/dist/sn-histogram.js +4 -4
- package/sn-histogram-ext/sn-histogram.qext +1 -1
- package/api-specifications/api.md +0 -330
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*
|
|
2
|
-
* @nebula.js/sn-histogram v1.0.
|
|
2
|
+
* @nebula.js/sn-histogram v1.0.4
|
|
3
3
|
* Copyright (c) 2025 QlikTech International AB
|
|
4
4
|
* Released under the MIT license.
|
|
5
5
|
*/
|
|
@@ -21,9 +21,9 @@ e.exports=function(e,t){if(!e||isNaN(+t))return t;var n,r,i,o,s,a,l,c,u,h,d=e.le
|
|
|
21
21
|
* http://hammerjs.github.io/
|
|
22
22
|
*
|
|
23
23
|
* Copyright (c) 2016 Jorik Tangelder;
|
|
24
|
-
* Licensed under the MIT license */var mm=(pm||(pm=1,function(e){!function(t,n,r,i){var o,s=["","webkit","Moz","MS","ms","o"],a=n.createElement("div"),l=Math.round,c=Math.abs,u=Date.now;function h(e,t,n){return setTimeout(b(e,n),t)}function d(e,t,n){return!!Array.isArray(e)&&(f(e,n[t],n),!0)}function f(e,t,n){var r;if(e)if(e.forEach)e.forEach(t,n);else if(e.length!==i)for(r=0;r<e.length;)t.call(n,e[r],r,e),r++;else for(r in e)e.hasOwnProperty(r)&&t.call(n,e[r],r,e)}function p(e,n,r){var i="DEPRECATED METHOD: "+n+"\n"+r+" AT \n";return function(){var n=new Error("get-stack-trace"),r=n&&n.stack?n.stack.replace(/^[^\(]+?[\n$]/gm,"").replace(/^\s+at\s+/gm,"").replace(/^Object.<anonymous>\s*\(/gm,"{anonymous}()@"):"Unknown Stack Trace",o=t.console&&(t.console.warn||t.console.log);return o&&o.call(t.console,i,r),e.apply(this,arguments)}}o="function"!=typeof Object.assign?function(e){if(e===i||null===e)throw new TypeError("Cannot convert undefined or null to object");for(var t=Object(e),n=1;n<arguments.length;n++){var r=arguments[n];if(r!==i&&null!==r)for(var o in r)r.hasOwnProperty(o)&&(t[o]=r[o])}return t}:Object.assign;var g=p(function(e,t,n){for(var r=Object.keys(t),o=0;o<r.length;)(!n||n&&e[r[o]]===i)&&(e[r[o]]=t[r[o]]),o++;return e},"extend","Use `assign`."),m=p(function(e,t){return g(e,t,!0)},"merge","Use `assign`.");function y(e,t,n){var r,i=t.prototype;(r=e.prototype=Object.create(i)).constructor=e,r._super=i,n&&o(r,n)}function b(e,t){return function(){return e.apply(t,arguments)}}function v(e,t){return"function"==typeof e?e.apply(t&&t[0]||i,t):e}function x(e,t){return e===i?t:e}function w(e,t,n){f(S(t),function(t){e.addEventListener(t,n,!1)})}function M(e,t,n){f(S(t),function(t){e.removeEventListener(t,n,!1)})}function k(e,t){for(;e;){if(e==t)return!0;e=e.parentNode}return!1}function q(e,t){return e.indexOf(t)>-1}function S(e){return e.trim().split(/\s+/g)}function _(e,t,n){if(e.indexOf&&!n)return e.indexOf(t);for(var r=0;r<e.length;){if(n&&e[r][n]==t||!n&&e[r]===t)return r;r++}return-1}function D(e){return Array.prototype.slice.call(e,0)}function C(e,t,n){for(var r=[],i=[],o=0;o<e.length;){var s=e[o][t];_(i,s)<0&&r.push(e[o]),i[o]=s,o++}return r=r.sort(function(e,n){return e[t]>n[t]}),r}function E(e,t){for(var n,r,o=t[0].toUpperCase()+t.slice(1),a=0;a<s.length;){if((r=(n=s[a])?n+o:t)in e)return r;a++}return i}var A=1;function T(e){var n=e.ownerDocument||e;return n.defaultView||n.parentWindow||t}var N="ontouchstart"in t,O=E(t,"PointerEvent")!==i,R=N&&/mobile|tablet|ip(ad|hone|od)|android/i.test(navigator.userAgent),I="touch",P="mouse",L=24,j=["x","y"],F=["clientX","clientY"];function z(e,t){var n=this;this.manager=e,this.callback=t,this.element=e.element,this.target=e.options.inputTarget,this.domHandler=function(t){v(e.options.enable,[e])&&n.handler(t)},this.init()}function H(e,t,n){var r=n.pointers.length,o=n.changedPointers.length,s=1&t&&r-o===0,a=12&t&&r-o===0;n.isFirst=!!s,n.isFinal=!!a,s&&(e.session={}),n.eventType=t,function(e,t){var n=e.session,r=t.pointers,o=r.length;n.firstInput||(n.firstInput=V(t)),o>1&&!n.firstMultiple?n.firstMultiple=V(t):1===o&&(n.firstMultiple=!1);var s=n.firstInput,a=n.firstMultiple,l=a?a.center:s.center,h=t.center=B(r);t.timeStamp=u(),t.deltaTime=t.timeStamp-s.timeStamp,t.angle=Y(l,h),t.distance=U(l,h),function(e,t){var n=t.center,r=e.offsetDelta||{},i=e.prevDelta||{},o=e.prevInput||{};1!==t.eventType&&4!==o.eventType||(i=e.prevDelta={x:o.deltaX||0,y:o.deltaY||0},r=e.offsetDelta={x:n.x,y:n.y}),t.deltaX=i.x+(n.x-r.x),t.deltaY=i.y+(n.y-r.y)}(n,t),t.offsetDirection=W(t.deltaX,t.deltaY);var d=$(t.deltaTime,t.deltaX,t.deltaY);t.overallVelocityX=d.x,t.overallVelocityY=d.y,t.overallVelocity=c(d.x)>c(d.y)?d.x:d.y,t.scale=a?function(e,t){return U(t[0],t[1],F)/U(e[0],e[1],F)}(a.pointers,r):1,t.rotation=a?function(e,t){return Y(t[1],t[0],F)+Y(e[1],e[0],F)}(a.pointers,r):0,t.maxPointers=n.prevInput?t.pointers.length>n.prevInput.maxPointers?t.pointers.length:n.prevInput.maxPointers:t.pointers.length,function(e,t){var n,r,o,s,a=e.lastInterval||t,l=t.timeStamp-a.timeStamp;if(8!=t.eventType&&(l>25||a.velocity===i)){var u=t.deltaX-a.deltaX,h=t.deltaY-a.deltaY,d=$(l,u,h);r=d.x,o=d.y,n=c(d.x)>c(d.y)?d.x:d.y,s=W(u,h),e.lastInterval=t}else n=a.velocity,r=a.velocityX,o=a.velocityY,s=a.direction;t.velocity=n,t.velocityX=r,t.velocityY=o,t.direction=s}(n,t);var f=e.element;k(t.srcEvent.target,f)&&(f=t.srcEvent.target),t.target=f}(e,n),e.emit("hammer.input",n),e.recognize(n),e.session.prevInput=n}function V(e){for(var t=[],n=0;n<e.pointers.length;)t[n]={clientX:l(e.pointers[n].clientX),clientY:l(e.pointers[n].clientY)},n++;return{timeStamp:u(),pointers:t,center:B(t),deltaX:e.deltaX,deltaY:e.deltaY}}function B(e){var t=e.length;if(1===t)return{x:l(e[0].clientX),y:l(e[0].clientY)};for(var n=0,r=0,i=0;i<t;)n+=e[i].clientX,r+=e[i].clientY,i++;return{x:l(n/t),y:l(r/t)}}function $(e,t,n){return{x:t/e||0,y:n/e||0}}function W(e,t){return e===t?1:c(e)>=c(t)?e<0?2:4:t<0?8:16}function U(e,t,n){n||(n=j);var r=t[n[0]]-e[n[0]],i=t[n[1]]-e[n[1]];return Math.sqrt(r*r+i*i)}function Y(e,t,n){n||(n=j);var r=t[n[0]]-e[n[0]],i=t[n[1]]-e[n[1]];return 180*Math.atan2(i,r)/Math.PI}z.prototype={handler:function(){},init:function(){this.evEl&&w(this.element,this.evEl,this.domHandler),this.evTarget&&w(this.target,this.evTarget,this.domHandler),this.evWin&&w(T(this.element),this.evWin,this.domHandler)},destroy:function(){this.evEl&&M(this.element,this.evEl,this.domHandler),this.evTarget&&M(this.target,this.evTarget,this.domHandler),this.evWin&&M(T(this.element),this.evWin,this.domHandler)}};var K={mousedown:1,mousemove:2,mouseup:4},X="mousedown",G="mousemove mouseup";function J(){this.evEl=X,this.evWin=G,this.pressed=!1,z.apply(this,arguments)}y(J,z,{handler:function(e){var t=K[e.type];1&t&&0===e.button&&(this.pressed=!0),2&t&&1!==e.which&&(t=4),this.pressed&&(4&t&&(this.pressed=!1),this.callback(this.manager,t,{pointers:[e],changedPointers:[e],pointerType:P,srcEvent:e}))}});var Z={pointerdown:1,pointermove:2,pointerup:4,pointercancel:8,pointerout:8},Q={2:I,3:"pen",4:P,5:"kinect"},ee="pointerdown",te="pointermove pointerup pointercancel";function ne(){this.evEl=ee,this.evWin=te,z.apply(this,arguments),this.store=this.manager.session.pointerEvents=[]}t.MSPointerEvent&&!t.PointerEvent&&(ee="MSPointerDown",te="MSPointerMove MSPointerUp MSPointerCancel"),y(ne,z,{handler:function(e){var t=this.store,n=!1,r=e.type.toLowerCase().replace("ms",""),i=Z[r],o=Q[e.pointerType]||e.pointerType,s=o==I,a=_(t,e.pointerId,"pointerId");1&i&&(0===e.button||s)?a<0&&(t.push(e),a=t.length-1):12&i&&(n=!0),a<0||(t[a]=e,this.callback(this.manager,i,{pointers:t,changedPointers:[e],pointerType:o,srcEvent:e}),n&&t.splice(a,1))}});var re={touchstart:1,touchmove:2,touchend:4,touchcancel:8};function ie(){this.evTarget="touchstart",this.evWin="touchstart touchmove touchend touchcancel",this.started=!1,z.apply(this,arguments)}function oe(e,t){var n=D(e.touches),r=D(e.changedTouches);return 12&t&&(n=C(n.concat(r),"identifier")),[n,r]}y(ie,z,{handler:function(e){var t=re[e.type];if(1===t&&(this.started=!0),this.started){var n=oe.call(this,e,t);12&t&&n[0].length-n[1].length===0&&(this.started=!1),this.callback(this.manager,t,{pointers:n[0],changedPointers:n[1],pointerType:I,srcEvent:e})}}});var se={touchstart:1,touchmove:2,touchend:4,touchcancel:8},ae="touchstart touchmove touchend touchcancel";function le(){this.evTarget=ae,this.targetIds={},z.apply(this,arguments)}function ce(e,t){var n=D(e.touches),r=this.targetIds;if(3&t&&1===n.length)return r[n[0].identifier]=!0,[n,n];var i,o,s=D(e.changedTouches),a=[],l=this.target;if(o=n.filter(function(e){return k(e.target,l)}),1===t)for(i=0;i<o.length;)r[o[i].identifier]=!0,i++;for(i=0;i<s.length;)r[s[i].identifier]&&a.push(s[i]),12&t&&delete r[s[i].identifier],i++;return a.length?[C(o.concat(a),"identifier"),a]:void 0}function ue(){z.apply(this,arguments);var e=b(this.handler,this);this.touch=new le(this.manager,e),this.mouse=new J(this.manager,e),this.primaryTouch=null,this.lastTouches=[]}function he(e,t){1&e?(this.primaryTouch=t.changedPointers[0].identifier,de.call(this,t)):12&e&&de.call(this,t)}function de(e){var t=e.changedPointers[0];if(t.identifier===this.primaryTouch){var n={x:t.clientX,y:t.clientY};this.lastTouches.push(n);var r=this.lastTouches;setTimeout(function(){var e=r.indexOf(n);e>-1&&r.splice(e,1)},2500)}}function fe(e){for(var t=e.srcEvent.clientX,n=e.srcEvent.clientY,r=0;r<this.lastTouches.length;r++){var i=this.lastTouches[r],o=Math.abs(t-i.x),s=Math.abs(n-i.y);if(o<=25&&s<=25)return!0}return!1}y(le,z,{handler:function(e){var t=se[e.type],n=ce.call(this,e,t);n&&this.callback(this.manager,t,{pointers:n[0],changedPointers:n[1],pointerType:I,srcEvent:e})}}),y(ue,z,{handler:function(e,t,n){var r=n.pointerType==I,i=n.pointerType==P;if(!(i&&n.sourceCapabilities&&n.sourceCapabilities.firesTouchEvents)){if(r)he.call(this,t,n);else if(i&&fe.call(this,n))return;this.callback(e,t,n)}},destroy:function(){this.touch.destroy(),this.mouse.destroy()}});var pe=E(a.style,"touchAction"),ge=pe!==i,me="compute",ye="auto",be="manipulation",ve="none",xe="pan-x",we="pan-y",Me=function(){if(!ge)return!1;var e={},n=t.CSS&&t.CSS.supports;return["auto","manipulation","pan-y","pan-x","pan-x pan-y","none"].forEach(function(r){e[r]=!n||t.CSS.supports("touch-action",r)}),e}();function ke(e,t){this.manager=e,this.set(t)}ke.prototype={set:function(e){e==me&&(e=this.compute()),ge&&this.manager.element.style&&Me[e]&&(this.manager.element.style[pe]=e),this.actions=e.toLowerCase().trim()},update:function(){this.set(this.manager.options.touchAction)},compute:function(){var e=[];return f(this.manager.recognizers,function(t){v(t.options.enable,[t])&&(e=e.concat(t.getTouchAction()))}),function(e){if(q(e,ve))return ve;var t=q(e,xe),n=q(e,we);return t&&n?ve:t||n?t?xe:we:q(e,be)?be:ye}(e.join(" "))},preventDefaults:function(e){var t=e.srcEvent,n=e.offsetDirection;if(this.manager.session.prevented)t.preventDefault();else{var r=this.actions,i=q(r,ve)&&!Me[ve],o=q(r,we)&&!Me[we],s=q(r,xe)&&!Me[xe];if(i){var a=1===e.pointers.length,l=e.distance<2,c=e.deltaTime<250;if(a&&l&&c)return}if(!s||!o)return i||o&&6&n||s&&n&L?this.preventSrc(t):void 0}},preventSrc:function(e){this.manager.session.prevented=!0,e.preventDefault()}};var qe=32;function Se(e){this.options=o({},this.defaults,e||{}),this.id=A++,this.manager=null,this.options.enable=x(this.options.enable,!0),this.state=1,this.simultaneous={},this.requireFail=[]}function _e(e){return 16&e?"cancel":8&e?"end":4&e?"move":2&e?"start":""}function De(e){return 16==e?"down":8==e?"up":2==e?"left":4==e?"right":""}function Ce(e,t){var n=t.manager;return n?n.get(e):e}function Ee(){Se.apply(this,arguments)}function Ae(){Ee.apply(this,arguments),this.pX=null,this.pY=null}function Te(){Ee.apply(this,arguments)}function Ne(){Se.apply(this,arguments),this._timer=null,this._input=null}function Oe(){Ee.apply(this,arguments)}function Re(){Ee.apply(this,arguments)}function Ie(){Se.apply(this,arguments),this.pTime=!1,this.pCenter=!1,this._timer=null,this._input=null,this.count=0}function Pe(e,t){return(t=t||{}).recognizers=x(t.recognizers,Pe.defaults.preset),new Le(e,t)}function Le(e,t){var n;this.options=o({},Pe.defaults,t||{}),this.options.inputTarget=this.options.inputTarget||e,this.handlers={},this.session={},this.recognizers=[],this.oldCssProps={},this.element=e,this.input=new((n=this).options.inputClass||(O?ne:R?le:N?ue:J))(n,H),this.touchAction=new ke(this,this.options.touchAction),je(this,!0),f(this.options.recognizers,function(e){var t=this.add(new e[0](e[1]));e[2]&&t.recognizeWith(e[2]),e[3]&&t.requireFailure(e[3])},this)}function je(e,t){var n,r=e.element;r.style&&(f(e.options.cssProps,function(i,o){n=E(r.style,o),t?(e.oldCssProps[n]=r.style[n],r.style[n]=i):r.style[n]=e.oldCssProps[n]||""}),t||(e.oldCssProps={}))}Se.prototype={defaults:{},set:function(e){return o(this.options,e),this.manager&&this.manager.touchAction.update(),this},recognizeWith:function(e){if(d(e,"recognizeWith",this))return this;var t=this.simultaneous;return t[(e=Ce(e,this)).id]||(t[e.id]=e,e.recognizeWith(this)),this},dropRecognizeWith:function(e){return d(e,"dropRecognizeWith",this)||(e=Ce(e,this),delete this.simultaneous[e.id]),this},requireFailure:function(e){if(d(e,"requireFailure",this))return this;var t=this.requireFail;return-1===_(t,e=Ce(e,this))&&(t.push(e),e.requireFailure(this)),this},dropRequireFailure:function(e){if(d(e,"dropRequireFailure",this))return this;e=Ce(e,this);var t=_(this.requireFail,e);return t>-1&&this.requireFail.splice(t,1),this},hasRequireFailures:function(){return this.requireFail.length>0},canRecognizeWith:function(e){return!!this.simultaneous[e.id]},emit:function(e){var t=this,n=this.state;function r(n){t.manager.emit(n,e)}n<8&&r(t.options.event+_e(n)),r(t.options.event),e.additionalEvent&&r(e.additionalEvent),n>=8&&r(t.options.event+_e(n))},tryEmit:function(e){if(this.canEmit())return this.emit(e);this.state=qe},canEmit:function(){for(var e=0;e<this.requireFail.length;){if(!(33&this.requireFail[e].state))return!1;e++}return!0},recognize:function(e){var t=o({},e);if(!v(this.options.enable,[this,t]))return this.reset(),void(this.state=qe);56&this.state&&(this.state=1),this.state=this.process(t),30&this.state&&this.tryEmit(t)},process:function(e){},getTouchAction:function(){},reset:function(){}},y(Ee,Se,{defaults:{pointers:1},attrTest:function(e){var t=this.options.pointers;return 0===t||e.pointers.length===t},process:function(e){var t=this.state,n=e.eventType,r=6&t,i=this.attrTest(e);return r&&(8&n||!i)?16|t:r||i?4&n?8|t:2&t?4|t:2:qe}}),y(Ae,Ee,{defaults:{event:"pan",threshold:10,pointers:1,direction:30},getTouchAction:function(){var e=this.options.direction,t=[];return 6&e&&t.push(we),e&L&&t.push(xe),t},directionTest:function(e){var t=this.options,n=!0,r=e.distance,i=e.direction,o=e.deltaX,s=e.deltaY;return i&t.direction||(6&t.direction?(i=0===o?1:o<0?2:4,n=o!=this.pX,r=Math.abs(e.deltaX)):(i=0===s?1:s<0?8:16,n=s!=this.pY,r=Math.abs(e.deltaY))),e.direction=i,n&&r>t.threshold&&i&t.direction},attrTest:function(e){return Ee.prototype.attrTest.call(this,e)&&(2&this.state||!(2&this.state)&&this.directionTest(e))},emit:function(e){this.pX=e.deltaX,this.pY=e.deltaY;var t=De(e.direction);t&&(e.additionalEvent=this.options.event+t),this._super.emit.call(this,e)}}),y(Te,Ee,{defaults:{event:"pinch",threshold:0,pointers:2},getTouchAction:function(){return[ve]},attrTest:function(e){return this._super.attrTest.call(this,e)&&(Math.abs(e.scale-1)>this.options.threshold||2&this.state)},emit:function(e){if(1!==e.scale){var t=e.scale<1?"in":"out";e.additionalEvent=this.options.event+t}this._super.emit.call(this,e)}}),y(Ne,Se,{defaults:{event:"press",pointers:1,time:251,threshold:9},getTouchAction:function(){return[ye]},process:function(e){var t=this.options,n=e.pointers.length===t.pointers,r=e.distance<t.threshold,i=e.deltaTime>t.time;if(this._input=e,!r||!n||12&e.eventType&&!i)this.reset();else if(1&e.eventType)this.reset(),this._timer=h(function(){this.state=8,this.tryEmit()},t.time,this);else if(4&e.eventType)return 8;return qe},reset:function(){clearTimeout(this._timer)},emit:function(e){8===this.state&&(e&&4&e.eventType?this.manager.emit(this.options.event+"up",e):(this._input.timeStamp=u(),this.manager.emit(this.options.event,this._input)))}}),y(Oe,Ee,{defaults:{event:"rotate",threshold:0,pointers:2},getTouchAction:function(){return[ve]},attrTest:function(e){return this._super.attrTest.call(this,e)&&(Math.abs(e.rotation)>this.options.threshold||2&this.state)}}),y(Re,Ee,{defaults:{event:"swipe",threshold:10,velocity:.3,direction:30,pointers:1},getTouchAction:function(){return Ae.prototype.getTouchAction.call(this)},attrTest:function(e){var t,n=this.options.direction;return 30&n?t=e.overallVelocity:6&n?t=e.overallVelocityX:n&L&&(t=e.overallVelocityY),this._super.attrTest.call(this,e)&&n&e.offsetDirection&&e.distance>this.options.threshold&&e.maxPointers==this.options.pointers&&c(t)>this.options.velocity&&4&e.eventType},emit:function(e){var t=De(e.offsetDirection);t&&this.manager.emit(this.options.event+t,e),this.manager.emit(this.options.event,e)}}),y(Ie,Se,{defaults:{event:"tap",pointers:1,taps:1,interval:300,time:250,threshold:9,posThreshold:10},getTouchAction:function(){return[be]},process:function(e){var t=this.options,n=e.pointers.length===t.pointers,r=e.distance<t.threshold,i=e.deltaTime<t.time;if(this.reset(),1&e.eventType&&0===this.count)return this.failTimeout();if(r&&i&&n){if(4!=e.eventType)return this.failTimeout();var o=!this.pTime||e.timeStamp-this.pTime<t.interval,s=!this.pCenter||U(this.pCenter,e.center)<t.posThreshold;if(this.pTime=e.timeStamp,this.pCenter=e.center,s&&o?this.count+=1:this.count=1,this._input=e,0===this.count%t.taps)return this.hasRequireFailures()?(this._timer=h(function(){this.state=8,this.tryEmit()},t.interval,this),2):8}return qe},failTimeout:function(){return this._timer=h(function(){this.state=qe},this.options.interval,this),qe},reset:function(){clearTimeout(this._timer)},emit:function(){8==this.state&&(this._input.tapCount=this.count,this.manager.emit(this.options.event,this._input))}}),Pe.VERSION="2.0.7",Pe.defaults={domEvents:!1,touchAction:me,enable:!0,inputTarget:null,inputClass:null,preset:[[Oe,{enable:!1}],[Te,{enable:!1},["rotate"]],[Re,{direction:6}],[Ae,{direction:6},["swipe"]],[Ie],[Ie,{event:"doubletap",taps:2},["tap"]],[Ne]],cssProps:{userSelect:"none",touchSelect:"none",touchCallout:"none",contentZooming:"none",userDrag:"none",tapHighlightColor:"rgba(0,0,0,0)"}},Le.prototype={set:function(e){return o(this.options,e),e.touchAction&&this.touchAction.update(),e.inputTarget&&(this.input.destroy(),this.input.target=e.inputTarget,this.input.init()),this},stop:function(e){this.session.stopped=e?2:1},recognize:function(e){var t=this.session;if(!t.stopped){var n;this.touchAction.preventDefaults(e);var r=this.recognizers,i=t.curRecognizer;(!i||i&&8&i.state)&&(i=t.curRecognizer=null);for(var o=0;o<r.length;)n=r[o],2===t.stopped||i&&n!=i&&!n.canRecognizeWith(i)?n.reset():n.recognize(e),!i&&14&n.state&&(i=t.curRecognizer=n),o++}},get:function(e){if(e instanceof Se)return e;for(var t=this.recognizers,n=0;n<t.length;n++)if(t[n].options.event==e)return t[n];return null},add:function(e){if(d(e,"add",this))return this;var t=this.get(e.options.event);return t&&this.remove(t),this.recognizers.push(e),e.manager=this,this.touchAction.update(),e},remove:function(e){if(d(e,"remove",this))return this;if(e=this.get(e)){var t=this.recognizers,n=_(t,e);-1!==n&&(t.splice(n,1),this.touchAction.update())}return this},on:function(e,t){if(e!==i&&t!==i){var n=this.handlers;return f(S(e),function(e){n[e]=n[e]||[],n[e].push(t)}),this}},off:function(e,t){if(e!==i){var n=this.handlers;return f(S(e),function(e){t?n[e]&&n[e].splice(_(n[e],t),1):delete n[e]}),this}},emit:function(e,t){this.options.domEvents&&function(e,t){var r=n.createEvent("Event");r.initEvent(e,!0,!0),r.gesture=t,t.target.dispatchEvent(r)}(e,t);var r=this.handlers[e]&&this.handlers[e].slice();if(r&&r.length){t.type=e,t.preventDefault=function(){t.srcEvent.preventDefault()};for(var i=0;i<r.length;)r[i](t),i++}},destroy:function(){this.element&&je(this,!1),this.handlers={},this.session={},this.input.destroy(),this.element=null}},o(Pe,{INPUT_START:1,INPUT_MOVE:2,INPUT_END:4,INPUT_CANCEL:8,STATE_POSSIBLE:1,STATE_BEGAN:2,STATE_CHANGED:4,STATE_ENDED:8,STATE_RECOGNIZED:8,STATE_CANCELLED:16,STATE_FAILED:qe,DIRECTION_NONE:1,DIRECTION_LEFT:2,DIRECTION_RIGHT:4,DIRECTION_UP:8,DIRECTION_DOWN:16,DIRECTION_HORIZONTAL:6,DIRECTION_VERTICAL:L,DIRECTION_ALL:30,Manager:Le,Input:z,TouchAction:ke,TouchInput:le,MouseInput:J,PointerEventInput:ne,TouchMouseInput:ue,SingleTouchInput:ie,Recognizer:Se,AttrRecognizer:Ee,Tap:Ie,Pan:Ae,Swipe:Re,Pinch:Te,Rotate:Oe,Press:Ne,on:w,off:M,each:f,merge:m,extend:g,assign:o,inherit:y,bindFn:b,prefixed:E}),(void 0!==t?t:"undefined"!=typeof self?self:{}).Hammer=Pe,e.exports?e.exports=Pe:t.Hammer=Pe}(window,document)}(gm)),gm.exports),ym=n(mm);function bm(e){e.component("event-area",{mounted(e){e.classList.add("event-area"),e.style.pointerEvents="auto",e.style.zIndex=1},render:()=>[]})}var vm={renderer:"dom",disableTriggers:!0,preferredSize:function(){return 22},render(e){const{settings:{label:t,rtl:n},layout:{dock:r}}=this.settings,i="top"!==r&&"bottom"!==r||!n?"ltr":"rtl",o=function(e,t){const n={pointerEvents:"auto",display:"flex",justifyContent:"center",alignItems:"center",color:"#7b7a78",fontStyle:"italic",fontSize:"13px"};switch(e){case"left":n.width=`${t.height}px`,n.transform=`rotate(-90deg) translate(-${t.height}px, 0)`,n.transformOrigin="top left";break;case"right":n.width=`${t.height}px`,n.transform=`rotate(90deg) translate(0, -${t.width}px)`,n.transformOrigin="top left";break;case"center":n.width=`${t.width}px`,n.height=`${t.height}px`,n.color="#595959",n.fontStyle="normal",n.fontSize="1.2em",n.textAlign="center";break;default:n.justifyContent="flex-start",n.alignItems="flex-start"}return n}(r,this.rect),s="center"===r?t:`* ${t}`,a="center"!==r?{overflow:"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis"}:{};return e("div",{style:o,dir:i},e("span",{ref:this.alignToRef,style:a,title:s},s))}};function xm(e){const t=Mp();return t.renderer.prio([e||"canvas"]),t.use(um),t.use(function(e){if("function"!=typeof e.interaction)return t=>{t.interaction("hammer",fm(e))};e.interaction("hammer",fm(Hammer))}(ym)),t.use(bm),t.component("disclaimer",vm),t}const wm={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"}}]};var Mm,km={exports:{}};var qm=(Mm||(Mm=1,function(e){self,e.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)},s=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)},a=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,c,u,h=arguments[0],d=1,f=arguments.length,p=!1;for("boolean"==typeof h&&(p=h,h=arguments[1]||{},d=2),(null==h||"object"!=typeof h&&"function"!=typeof h)&&(h={});d<f;++d)if(null!=(t=arguments[d]))for(n in t)r=l(h,n),h!==(i=l(t,n))&&(p&&i&&(s(i)||(c=o(i)))?(c?(c=!1,u=r&&o(r)?r:[]):u=r&&s(r)?r:{},a(h,{name:n,newValue:e(p,u,i)})):void 0!==i&&a(h,{name:n,newValue:i}));return h}},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)},s=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)},a=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,c,u,h=arguments[0],d=1,f=arguments.length,p=!1;for("boolean"==typeof h&&(p=h,h=arguments[1]||{},d=2),(null==h||"object"!=typeof h&&"function"!=typeof h)&&(h={});d<f;++d)if(null!=(t=arguments[d]))for(n in t)r=l(h,n),h!==(i=l(t,n))&&(p&&i&&(s(i)||(c=o(i)))?(c?(c=!1,u=r&&o(r)?r:[]):u=r&&s(r)?r:{},a(h,{name:n,newValue:e(p,u,i)})):void 0!==i&&a(h,{name:n,newValue:i}));return h}}},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:()=>Te});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],s=e;for(r=0;r<i.length-1;++r)void 0===s[i[r]]&&(s[i[r]]=Number.isNaN(+i[r+1])?{}:[]),s=s[i[r]];if(void 0!==n){var a=s[o];return s[o]=n,{updated:n,previous:a}}return delete s[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},s={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 a="".concat(" ","(").concat(" "),l="".concat(" ",")").concat(" ");function c(e){return a+e+l}function u(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(e.qLibraryId){var n=function(e,t){if(!t)return null;var n,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 s=r.qDerivedFieldData.qDerivedFieldLists[o],a=0;a<s.qFieldDefs.length;++a){var l=s.qFieldDefs[a];if(l.qName===i)return l}}return null}(e.qDef.qFieldDefs[0],t.fieldList);return r&&r.qTags.indexOf("$numeric")>-1}function h(e){return!(!e.fullAccumulation&&!e.fullRange)}function d(e,t){var n=e.crossAllDimensions;return 2===t&&n?"RowNo(Total)":"RowNo()"}function f(e){var t=function(e){return e?(e=function(e){return e.replace(/\/\*[^]*?\*\//g,"")}(e=function(e){return e.replace(/\/\/(.*)$/gm,"")}(e))).trim():""}(e),n=t.trim();return"="===n.substring(0,1)?n.substring(1).trim():n}function p(){return"[$(=Replace(GetObjectField(".concat(arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,"),']',']]'))]")}function g(e,t){var n=e.crossAllDimensions;return 2===t&&n?"Above(Total ":"Above("}function m(e){return void 0===e?")":", 0, ".concat(e,")")}function y(e){return"Replace(Replace(".concat(e,",'''',''''''),'$','$''&''')")}function b(e,t){return e?"".concat(t,'={">=$(=Min(').concat(t,"))<=$(=Max(").concat(t,'))"}'):"".concat(t,'={"=Only({1}').concat(t,")>='$(=").concat(y("MinString(".concat(t,")")),")' and Only({1}").concat(t,")<='$(=").concat(y("MaxString(".concat(t,")")),")'\"}")}function v(e){var t=e.modifier,n=void 0===t?{}:t,r=e.dimensions,i=e.dimensionAndFieldList,o=e.funcComp,s=void 0===o?"Sum":o,a=e.valueComp,l=void 0===a?"0":a;if(!n.showExcludedValues)return"";if(r&&1===r.length){var c=b(u(r[0],i),p(0));return"".concat(s,"({1<").concat(c,">}").concat(l,")")}if(r&&2===r.length){var h=u(r[0],i),d=u(r[1],i),f=p(0),g=p(1),m=b(h,f),y=b(d,g);return"".concat(s,"({1<").concat(m,",").concat(y,">}").concat(l,")")}return"".concat(s,"({1}").concat(l,")")}function x(e){return"".concat(e,"(")}function w(e){var t=e.properties,n=e.layout;return o(t,"qHyperCubeDef.qDimensions",o(n,"qHyperCube.qDimensionInfo",[])).length}const M={isFullRange:h,getNumDimensions:w,getExpressionWithExcludedComp:function(e){var t=e.expression,n=e.modifier,r=e.dimensions,i=e.dimensionAndFieldList,o=e.treatMissingAsNull,s=c(f(t));if(!n.showExcludedValues)return s;var a=v({modifier:n,dimensions:r,dimensionAndFieldList:i}),l=o?"":", 0";if(r&&1===r.length){var u=p(0);return"If(Count(".concat(u,") > 0, ").concat(s," + ").concat(a).concat(l,")")}if(r&&2===r.length){var h=p(0),d=p(1);return"If(Count(".concat(h,") * Count(").concat(d,") > 0, ").concat(s," + ").concat(a).concat(l,")")}return s},getRowNoComp:d,getNumStepComp:function(e,t){if(!h(e)){var n=e.steps;return"number"!=typeof n||Number.isNaN(n)?6:n}return d(e,t)},getAboveCompPrefix:g,getAboveCompSuffix:m,getAboveComp:function(e,t,n,r){return g(e,t)+n+m(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:v,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===w({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=p(t);if(!n.qSortByExpression&&!n.qSortByNumeric&&!n.qSortByAscii)return r;var i=["Descending","Ascending"],o=n.qSortByNumeric?"(Numeric, ".concat(i[(n.qSortByNumeric+1)/2],")"):"",s=n.qSortByAscii?"(Text, ".concat(i[(n.qSortByAscii+1)/2],")"):"";return n.qSortByNumeric&&n.qSortByAscii?"(".concat(r,", ").concat(o,", ").concat(s,")"):n.qSortByNumeric?"(".concat(r,", ").concat(o,")"):n.qSortByAscii?"(".concat(r,", ").concat(s,")"):r},simplifyExpression:f,extractInputExpression:function(e){var t=e.outputExpression;if(e.modifier){var n=t.indexOf(a);if(-1!==n){var r=t.indexOf(l);if(-1!==r)return t.substring(n+a.length,r)}}},initModifier:function(e,t){Object.keys(t).forEach(function(n){void 0===e[n]&&(e[n]=t[n])})},isNumeric:u,isApplicable:function(e){var t=e.properties,n=e.layout,r=e.minDimensions,i=void 0===r?1:r,o=e.maxDimensions,s=void 0===o?2:o;if(!t&&!n)return!0;var a=w({properties:t,layout:n});return a>=i&&a<=s},getExpressionWithMarkers:c,canExtract:function(e){var t=e.indexOf(a),n=e.indexOf(l);return t>-1&&n>-1&&t<n},getDimDefWithWrapper:p,getFieldWithWrapper:function(e){var t=e?e.replace(/]/g,"]]"):e;return"[".concat(t,"]")},generateTSDExpression:function(e,t,n){var 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=s.OPTIONS.find(function(t){return t.value===e.decomposition});return t?s.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(s.EXPRESSIONS).find(function(n){var r=e.qDef.base.qDef.toLowerCase()||e.qDef.qDef.toLowerCase();return s.EXPRESSIONS[n]&&r.includes(s.EXPRESSIONS[n].toLowerCase())&&(t=n),n}),t}};function k(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function q(e){return q="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},q(e)}var S=t().bind(null,!0),_={},D=Array.isArray;function C(e){return null!=e&&!Array.isArray(e)&&"object"===q(e)}function E(e){return void 0===e}function A(e,t){return"function"==typeof e[t]||"$$"===t.substring(0,2)||"_"===t.substring(0,1)}function T(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]=E(e[n||t])?o:e[t],e=e[n||t]}}),e}function N(e,t){var n=!0;if(C(e)&&C(t))return Object.keys(e).length===Object.keys(t).length&&(Object.keys(e).forEach(function(r){N(e[r],t[r])||(n=!1)}),n);if(D(e)&&D(t)){if(e.length!==t.length)return!1;for(var r=0,i=e.length;r<i;r+=1)if(!N(e[r],t[r]))return!1;return!0}return e===t}_.generate=function(e,t,n){n=n||"";var r=[];return Object.keys(t).forEach(function(i){var o=function(e){return e?S({},{val:e}).val:e}(t[i]),s=e[i],a="".concat(n,"/").concat(i);N(o,s)||A(t,i)||(E(s)?r.push({op:"add",path:a,value:o}):C(o)&&C(s)?r=r.concat(_.generate(s,o,a)):D(o)&&D(s)?r=r.concat(function(e,t,n){var r=[],i=e.slice(),o=-1;function s(e,t,n){if(e[n]&&E(e[n].qInfo))return null;if(e[n]&&e[n].qInfo.qId===t)return n;for(var r=0,i=e.length;r<i;r+=1)if(e[r]&&e[r].qInfo.qId===t)return r;return-1}if(N(t,i))return r;if(!E(t[0])&&E(t[0].qInfo))return r.push({op:"replace",path:n,value:t}),r;for(var a=i.length-1;a>=0;a-=1)-1===(o=s(t,i[a].qInfo&&i[a].qInfo.qId,a))?(r.push({op:"remove",path:"".concat(n,"/").concat(a)}),i.splice(a,1)):r=r.concat(_.generate(i[a],t[o],"".concat(n,"/").concat(a)));for(var l=0,c=t.length;l<c;l+=1)-1===(o=s(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}(s,o,a)):r.push({op:"replace",path:"".concat(n,"/").concat(i),value:o}))}),Object.keys(e).forEach(function(i){E(t[i])&&!A(e,i)&&r.push({op:"remove",path:"".concat(n,"/").concat(i)})}),r},_.apply=function(e,t){t.forEach(function(t){var n,r,i=T(e,t.path),o=t.path.split("/").splice(-1)[0],s=o&&Number.isNaN(+o)?i[o]:i[+o]||i,a=t.from?t.from.split("/").splice(-1)[0]:null;if("/"===t.path&&(i=null,s=e),"add"===t.op||"replace"===t.op)if(D(i))"-"===o&&(o=i.length),i.splice(+o,"add"===t.op?0:1,t.value);else if(D(s)&&D(t.value)){var l,c=t.value.slice();s.length=0,(l=s).push.apply(l,function(e){if(Array.isArray(e))return k(e)}(r=c)||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 k(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?k(e,t):void 0}}(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(C(s)&&C(t.value))n=s,Object.keys(n).forEach(function(e){Object.getOwnPropertyDescriptor(n,e).configurable&&!A(n,e)&&delete n[e]}),S(s,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 u=T(e,t.from);D(i)?i.splice(+o,0,u.splice(+a,1)[0]):(i[o]=u[a],delete u[a])}else"remove"===t.op&&(D(i)?i.splice(+o,1):delete i[o])})},_.clone=function(e){return S({},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},_.updateObject=function(e,t){Object.keys(e).length?_.apply(e,_.generate(e,t)):S(e,t)};const O=_,R=function(e,n,r){if(!e)return Promise.resolve();var i=O.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 I="accumulation";function P(e,t){var n=o(e,t);if(n)for(var r=0;r<n.length;r++)if(n[r].type===I)return n[r]}function L(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===I)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 F={translationKey:"properties.modifier.accumulation",needDimension:M.needDimension,isApplicable:function(e){var t=e.properties,n=e.layout;return M.isApplicable({properties:t,layout:n,minDimensions:1,maxDimensions:2})},generateExpression:function(e){var t=e.expression,n=e.modifier,r=e.properties,i=e.layout,s=e.numDimensions,a=e.dimensionAndFieldList;if(!n)return t;var l=s;void 0===l&&(l=M.getNumDimensions({properties:r,layout:i}));var c=o(r,"qHyperCubeDef.qDimensions",[]),u=M.getExpressionWithExcludedComp({expression:t,modifier:n,dimensions:c,dimensionAndFieldList:a}),h=M.getNumStepComp(n,l),d=M.getAboveComp(n,l,u,h),f=M.getRangeComp("RangeSum",d);if(M.needDimension({modifier:n,properties:r,layout:i})){var p=M.getDimComp(c,1),g=M.getDimComp(c,0),m=M.getAggrComp(f,p,g);f=n.showExcludedValues?M.getExcludedComp({modifier:n,dimensions:c,dimensionAndFieldList:a,valueComp:m}):m}return f},extractInputExpression:M.extractInputExpression,initModifier:function(e){M.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!M.isApplicable({properties:t.properties})}},settings:{type:"items",items:{primaryDimension:{refFn:function(t){return"".concat(L(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(L(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(L(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(L(t,e),".steps")},type:"integer",translation:t.rangeSteps||"properties.modifier.range.steps",schemaIgnore:!0,defaultValue:6,change:function(t){var n=P(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=P(t,e);return n&&!n.fullAccumulation}},showExcludedValues:{refFn:function(t){return"".concat(L(t,e),".showExcludedValues")},type:"boolean",translation:t.showExcludedValues||"properties.modifier.showExcludedValues",schemaIgnore:!0,defaultValue:!0}},show:function(e,t){return M.isApplicable({properties:t.properties})}}},show:function(t,n,r){var i=r.ext.support.modifiers;if(!Array.isArray(i)||-1===i.indexOf(I))return!1;var o=P(t,e);return o&&!o.disabled}};return n}};var z="movingAverage";function H(e,t){var n=o(e,t);if(n)for(var r=0;r<n.length;r++)if(n[r].type===z)return n[r]}function V(e,t){var n=function(e,t){var n=o(e,t);if(!n)return-1;for(var r=0;r<n.length;r++)if(n[r].type===z)return r;return-1}(e,t);return n>-1?"".concat(t,".").concat(n):t}var B={type:"movingAverage",disabled:!1,primaryDimension:0,crossAllDimensions:!1,showExcludedValues:!0,fullRange:!1,steps:6,outputExpression:"",nullSuppression:!1};const $={translationKey:"properties.modifier.movingAverage",needDimension:M.needDimension,isApplicable:function(e){var t=e.properties,n=e.layout;return M.isApplicable({properties:t,layout:n,minDimensions:1,maxDimensions:2})},generateExpression:function(e){var t,n=e.expression,r=e.modifier,i=e.properties,s=e.layout,a=e.numDimensions,l=e.dimensionAndFieldList;if(!r)return n;var c=a;void 0===c&&(c=M.getNumDimensions({properties:i,layout:s}));var u=o(i,"qHyperCubeDef.qDimensions",[]),h=r.showExcludedValues&&r.nullSuppression,d=M.getExpressionWithExcludedComp({expression:n,modifier:r,dimensions:u,dimensionAndFieldList:l,treatMissingAsNull:h}),f=M.getNumStepComp(r,c),p=M.getAboveComp(r,c,d,f);if(r.nullSuppression)t=M.getRangeComp("RangeAvg",p);else{var g=M.getRangeComp("RangeSum",p),m=function(e,t){var n=M.getRowNoComp(e,t);if(!M.isFullRange(e)){var r=e.steps,i="number"!=typeof r||Number.isNaN(r)?6:r;return"RangeMin(".concat(i,", ").concat(n,")")}return n}(r,c);t="".concat(g," / ").concat(m)}var y=t;if(M.needDimension({modifier:r,properties:i,layout:s})){var b=M.getDimComp(u,1),v=M.getDimComp(u,0),x=M.getAggrComp(y,b,v);y=r.showExcludedValues?M.getExcludedComp({modifier:r,dimensions:u,dimensionAndFieldList:l,funcComp:"Only",valueComp:x}):x}return y},extractInputExpression:M.extractInputExpression,initModifier:function(e){M.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!M.isApplicable({properties:t.properties})}},settings:{type:"items",items:{primaryDimension:{refFn:function(t){return"".concat(V(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(V(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(V(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(V(t,e),".steps")},type:"integer",translation:t.rangeSteps||"properties.modifier.range.steps",schemaIgnore:!0,defaultValue:6,change:function(t){var n=H(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=H(t,e);return n&&!n.fullRange}},showExcludedValues:{refFn:function(t){return"".concat(V(t,e),".showExcludedValues")},type:"boolean",translation:t.showExcludedValues||"properties.modifier.showExcludedValues",schemaIgnore:!0,defaultValue:!0},nullSuppression:{refFn:function(t){return"".concat(V(t,e),".nullSuppression")},type:"boolean",translation:t.showNull||"properties.dimensions.showNull",schemaIgnore:!0,defaultValue:!1,inverted:!0}},show:function(e,t){return M.isApplicable({properties:t.properties})}}},show:function(t,n,r){var i=r.ext.support.modifiers;if(!Array.isArray(i)||-1===i.indexOf(z))return!1;var o=H(t,e);return o&&!o.disabled}};return n}};var W="timeSeriesDecomposition";function U(e,t){var n=o(e,t);if(n)for(var r=0;r<n.length;r++)if(n[r].type===W)return n[r]}function Y(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===W)return r;return-1}(e,t);return n>-1?"".concat(t,".").concat(n):t}var K={type:"timeSeriesDecomposition",disabled:!1,decomposition:"",steps:2,outputExpression:""};const X={translationKey:"properties.modifier.timeSeriesDecomposition",needDimension:M.needDimension,isApplicable:function(e){var t=e.properties,n=e.layout;return M.isApplicable({properties:t,layout:n,minDimensions:1,maxDimensions:2})},generateExpression:function(e){var t=e.expression,n=e.modifier,r=e.properties;return n?M.generateTSDExpression(n,t,r):t},extractInputExpression:M.extractInputExpression,initModifier:function(e,t){M.initModifier(e,K),""===e.decomposition&&t&&(e.decomposition=M.getDecomposition(t))},propertyPanelDef:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n={type:"items",items:{disclaimer:{component:"text",translation:t.timeSeriesDecomposition||"properties.modifier.timeSeriesDecomposition",show:function(e,t){return!M.isApplicable({properties:t.properties})}},settings:{type:"items",items:{decomposition:{refFn:function(t){return"".concat(Y(t,e),".decomposition")},type:"string",translation:t.modifierTrendDecompositionDecomposition||"properties.modifier.trendDecomposition.decomposition",component:"dropdown",schemaIgnore:!0,defaultValue:t.trendDecompositionParametersDecompositionObserved||"cao.trendDecomposition.parameters.decomposition.observed",options:s.OPTIONS},steps:{refFn:function(t){return"".concat(Y(t,e),".steps")},type:"integer",translation:t.modifierTimeSeriesDecompositionPeriods||"properties.modifier.timeSeriesDecomposition.periods",schemaIgnore:!0,defaultValue:2,change:function(t,n){var r=U(t,e);if(r){var i=r.steps;r.steps="number"!=typeof i||Number.isNaN(i)?2:Math.abs(i),n.properties.qHyperCubeDef.qMeasures=n.properties.qHyperCubeDef.qMeasures.map(function(e){return e.qDef.modifiers.map(function(e){return"timeSeriesDecomposition"===e.type?e.steps=i:e.steps=e.steps,e}),e})}},show:function(t){var n=U(t,e);return n&&!n.fullRange}}},show:function(e,t){return M.isApplicable({properties:t.properties})}}},show:function(t,n,r){var i=r.ext.support.modifiers;if(!Array.isArray(i)||-1===i.indexOf(W))return!1;var o=U(t,e);return o&&!o.disabled}};return n}};var G="difference";function J(e,t){var n=o(e,t);if(n)for(var r=0;r<n.length;r++)if(n[r].type===G)return n[r]}function Z(e,t){var n=function(e,t){var n=o(e,t);if(!n)return-1;for(var r=0;r<n.length;r++)if(n[r].type===G)return r;return-1}(e,t);return n>-1?"".concat(t,".").concat(n):t}var Q={type:"difference",disabled:!1,primaryDimension:0,crossAllDimensions:!1,showExcludedValues:!0,outputExpression:""};const ee={translationKey:"properties.modifier.difference",needDimension:M.needDimension,isApplicable:function(e){var t=e.properties,n=e.layout;return M.isApplicable({properties:t,layout:n,minDimensions:1,maxDimensions:2})},extractInputExpression:M.extractInputExpression,generateExpression:function(e){var t=e.expression,n=e.modifier,r=e.properties,i=e.layout,s=e.numDimensions,a=e.dimensionAndFieldList;if(!n)return t;var l=s;void 0===l&&(l=M.getNumDimensions({properties:r,layout:i}));var c=o(r,"qHyperCubeDef.qDimensions",[]),u=M.getExpressionWithExcludedComp({expression:t,modifier:n,dimensions:c,dimensionAndFieldList:a}),h=M.getAboveComp(n,l,u),d="".concat(u," - ").concat(h);if(M.needDimension({modifier:n,properties:r,layout:i})){var f=M.getDimComp(c,1),p=M.getDimComp(c,0),g=M.getAggrComp(d,f,p);d=n.showExcludedValues?M.getExcludedComp({modifier:n,dimensions:c,dimensionAndFieldList:a,funcComp:"Only",valueComp:g}):g}return d},initModifier:function(e){Object.keys(Q).forEach(function(t){void 0===e[t]&&(e[t]=Q[t])})},enableTotalsFunction:function(){return!1},propertyPanelDef:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n={type:"items",items:{disclaimer:{component:"text",translation:t.disclaimer||"properties.modifier.difference.disclaimer",show:function(e,t){return!M.isApplicable({properties:t.properties})}},settings:{type:"items",items:{primaryDimension:{refFn:function(t){return"".concat(Z(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(Z(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(Z(t,e),".showExcludedValues")},type:"boolean",translation:t.showExcludedValues||"properties.modifier.showExcludedValues",schemaIgnore:!0,defaultValue:!0}},show:function(e,t){return M.isApplicable({properties:t.properties})}}},show:function(t,n,r){var i=r.ext.support.modifiers;if(!Array.isArray(i)||-1===i.indexOf(G))return!1;var o=J(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 se(e){return 2===e?"{1}":""}function ae(e,t,n){return 1===e?"{$<".concat(M.getFieldWithWrapper(t),"={'").concat(n,"'}>}"):""}function le(e,t){return 0===e&&t>1||2===e?"Total":""}function ce(e,t,n){return 0===e&&t>1?"<".concat(M.getDimDefWithWrapper(n),">"):""}const ue={translationKey:"properties.modifier.normalization",needDimension:function(){return!0},isApplicable:function(e){var t=e.properties,n=e.layout;return M.isApplicable({properties:t,layout:n,minDimensions:1,maxDimensions:2})},extractInputExpression:M.extractInputExpression,generateExpression:function(e){var t=e.expression,n=e.modifier,r=e.properties,i=e.layout,s=e.numDimensions,a=e.dimensionAndFieldList;if(!n)return t;var l=s;void 0===l&&(l=M.getNumDimensions({properties:r,layout:i}));var c=o(r,"qHyperCubeDef.qDimensions",[]),u=M.getExpressionWithExcludedComp({expression:t,modifier:n,dimensions:c,dimensionAndFieldList:a}),h=n.selectionScope,d=n.dimensionalScope;return function(e,t,n,r,i,o,s){var a=se(t),l=ae(t,n,r),c=""===a&&""===l?"":a||l,u=le(i,o),h=ce(i,o,s),d=function(e){for(var t=[],n=0;n<e;n++)t[n]=M.getDimDefWithWrapper(n);return t.join(", ")}(o);return"".concat(e,"/ Sum(").concat(c," ").concat(u).concat(h," Aggr(").concat(c," ").concat(e,", ").concat(d,"))")}(u,h,n.field,n.value,d,l,n.primaryDimension)},initModifier:function(e){Object.keys(oe).forEach(function(t){void 0===e[t]&&(e[t]=oe[t])})},updateModifier:function(e,t){1===(t.qDimensions?t.qDimensions.length:0)&&0===e.dimensionalScope&&(e.dimensionalScope=2)},enableTotalsFunction:function(){return!0},propertyPanelDef:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n={type:"items",items:{disclaimer:{component:"text",translation:t.disclaimer||"properties.modifier.normalization.disclaimer",show:function(e,t){return!M.isApplicable({properties:t.properties})}},settings:{type:"items",items:{selectionScope:{refFn:function(t){return"".concat(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 M.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:se,getFieldSelectionComp:ae,getTotalComp:le,getSelectedDimComp:ce};var he="qDef.base",de="qDef.qDef",fe="qDef.base.qDef",pe="qLibraryId",ge="qDef.base.qLibraryId";const me={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,ge)?ge:pe},getLibraryId:function(e){return o(e,ge)||o(e,pe)},getLabelRef:function(e){return o(e,he)?"qDef.base.qLabel":"qDef.qLabel"},getLabelExpressionRef:function(e){return o(e,he)?"qDef.base.qLabelExpression":"qDef.qLabelExpression"}};var ye="qDef.qDef",be="qDef.base.qDef",ve="qLibraryId",xe="qDef.base.qLibraryId",we="qDef.qLabel",Me="qDef.qLabelExpression",ke="qDef.base.qLabel",qe="qDef.base.qLabelExpression",Se="qDef.qAggrFunc",_e="qDef.base.qAggrFunc",De={initBase:function(e,t){(t||De.isValid(e))&&(n(e,be,o(e,ye)),n(e,xe,o(e,ve)),n(e,ke,o(e,we)),n(e,qe,o(e,Me)))},restoreBase:function(e){De.isValid(e)&&(n(e,ye,o(e,be)),n(e,ve,o(e,xe)),n(e,we,o(e,ke)),n(e,Me,o(e,qe)),o(e,Se)&&o(e,_e)&&n(e,Se,o(e,_e)),delete e.qDef.base)},isValid:function(e){var t=o(e,be),n=o(e,xe);return void 0!==t||void 0!==n}};const Ce=De;function Ee(e){return Ee="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},Ee(e)}var Ae={accumulation:F,movingAverage:$,difference:ee,normalization:ue,timeSeriesDecomposition:X};const Te={modifiers:Ae,apply:Oe,applyModifiers:Re,cleanUpMeasure:Ie,destroy:function(e){e&&Ne[e.id]&&Ne[e.id].masterItemSubscriber&&(Ne[e.id].masterItemSubscriber&&Ne[e.id].masterItemSubscriber.unsubscribe(),delete Ne[e.id])},hasActiveModifiers:Pe,getActiveModifier:Le,initBase:Ce.initBase,isSupportedModifiers:function(e){return Array.isArray(e)&&e.some(function(e){return Ae[e]})},isApplicableSupportedModifiers:function(e){var t=e.modifierTypes,n=e.properties,r=e.layout;return Array.isArray(t)&&t.some(function(e){return Ae[e]&&Ae[e].isApplicable({properties:n,layout:r})})},measureBase:me,limitedSorting:function(e){var t=e.measures,n=e.properties,r=e.layout,i=!1,o=!1;return t.forEach(function(e){var t=ze(e);Ye({modifiers:t,properties:n,layout:r})&&(i=!0,o=o||Ze({modifiers:t,properties:n,layout:r}))}),i&&!o},ifEnableTotalsFunction:je};var Ne={};function Oe(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=e.model,r=e.properties,i=e.isSnapshot,s=void 0!==i&&i,a=e.masterItem,l=!1;Ne[n.id]=Ne[n.id]||{isFirstTime:!0};var c=Ne[n.id].isFirstTime;if(Ne[n.id].isFirstTime=!1,r&&"object"===Ee(r))return Re({model:n,properties:r});var u=n?n.layout:void 0,h=o(u,"qSelectionInfo.qInSelections");if(s||h)return Promise.resolve(l);var d=o(u,"qHyperCube.qMeasureInfo"),f=Ne[n.id].lastReloadTime;if(Ne[n.id].lastReloadTime=o(n,"app.layout.qLastReloadTime"),Pe({measures:d,layout:u})){var p=function(e){var t=e.measures,n=e.layout,r=e.lastReloadTime;return o(e.model,"app.layout.qLastReloadTime")!==r&&function(e){var t=e.measures,n=e.properties,r=e.layout;return!!Array.isArray(t)&&t.some(function(e){return Ue({measure:e,properties:n,layout:r})})}({measures:t,layout:n})}({measures:d,layout:u,model:n,lastReloadTime:f});return p||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 Ye({modifiers:ze(t),layout:n})?!t.base:!!t.base}({measure:e,layout:n})}))}({measures:d,layout:u,masterItem:a,isFirstTime:c})?n.getEffectiveProperties().then(function(e){var r=t()(!0,{},e);Ve(r);var i=Qe(r);return Ke({model:n}).then(function(t){return Xe({libraryIds:i,model:n}).then(function(i){return p&&function(e){var t=e.properties;Fe(t).forEach(function(e){return function(e){var t=e.measure;if(Ue({measure:t,properties:e.properties})){var n=0,r=t.qDef.modifiers;Array.isArray(r)&&r.forEach(function(e){if("object"===Ee(e)&&!e.disabled){if(n++,"object"!==Ee(Ae[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=Ae[e.type].extractInputExpression({outputExpression:t.qDef.qDef,modifier:e});void 0!==r&&$e(t)&&M.simplifyExpression(t.qDef.base.qDef)!==M.simplifyExpression(r)&&(t.qDef.base.qDef=r)}})}}({measure:e,properties:t})})}({properties:r}),Re({model:n,oldProperties:e,properties:r,runUpdateIfChange:!0,masterItem:a,libraryItemsProps:i,dimensionAndFieldList:t})})})}):Promise.resolve(l)}return function(e){return!!Array.isArray(e)&&e.some(function(e){return"object"===Ee(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 Fe(r).forEach(function(e){return Ie(e)}),Je({oldProperties:e,newProperties:r,model:n})})}({model:n,properties:e})}):Promise.resolve(l)}function Re(e){var n=e.model,r=e.oldProperties,i=e.properties,s=e.measures,a=e.runUpdateIfChange,l=void 0!==a&&a,c=e.masterItem,u=e.libraryItemsProps,h=e.dimensionAndFieldList;void 0===r&&(r=l?t()(!0,{},i):i),Ve(i);var d=Qe(i);return et({model:n,libraryIds:d,masterItem:c}).then(function(){return function(e){var n=e.measures,r=e.properties,i=e.model,s=e.libraryItemsProps,a=e.dimensionAndFieldList;if(n||(n=Fe(r)),!n.length)return Promise.resolve();if(!Pe({measures:n,properties:r}))return n.forEach(function(e){return Ie(e)}),Promise.resolve();var l=s?void 0:Qe(r);return Ke({model:i,dimensionAndFieldList:a}).then(function(e){return Xe({libraryIds:l,model:i,libraryItemsProps:s}).then(function(i){n.forEach(function(n){Ye({modifiers:n.qDef.modifiers,properties:r})?(function(e){var n=e.measure,r=e.properties,i=e.libraryItemsProps,s=e.dimensionAndFieldList,a=0;Ce.isValid(n)||Ce.initBase(n,!0);var l=n.qDef,c=l.modifiers,u=l.base;Array.isArray(c)&&c.forEach(function(e){if("object"===Ee(e)&&!e.disabled){if(a++,"object"!==Ee(Ae[e.type]))throw new Error('Modifier "'.concat(e.type,'" is not available'));if(a>1)throw new Error("More than 1 modifier on a measure! (not yet supported)");Ae[e.type].initModifier(e,n);var l=n.qLibraryId||u&&u.qLibraryId;l?function(e){var n=e.measure,r=e.modifier,i=e.properties,o=e.dimensionAndFieldList,s=e.libraryItemsProps[e.libraryId],a=s.qMeasure.qDef,l=""===a?a:Ae[r.type].generateExpression({expression:a,modifier:r,properties:i,dimensionAndFieldList:o});r.outputExpression=l,n.qDef.qDef=r.outputExpression,(n.qDef.qLabel||s.qMeasure.qLabel)&&(n.qDef.qLabel=s.qMeasure.qLabel),(n.qDef.qLabelExpression||s.qMeasure.qLabelExpression)&&(n.qDef.qLabelExpression=s.qMeasure.qLabelExpression),n.qDef.quarantine&&n.qDef.quarantine.qNumFormat&&s.qMeasure.qNumFormat&&(n.qDef.qNumFormat=s.qMeasure.qNumFormat,n.qDef.isCustomFormatted=s.qMeasure.isCustomFormatted),delete n.qLibraryId,n.qDef.coloring=s.qMeasure.coloring,r.base=t()(!0,{},n.qDef.base)}({measure:n,modifier:e,libraryId:l,properties:r,libraryItemsProps:i,dimensionAndFieldList:s}):function(e){var n=e.measure,r=e.modifier,i=e.properties,o=e.dimensionAndFieldList;"function"==typeof Ae[r.type].updateModifier&&Ae[r.type].updateModifier(r,i.qHyperCubeDef);var s=me.getExpression(n),a=""===s?s:Ae[r.type].generateExpression({expression:s,modifier:r,properties:i,dimensionAndFieldList:o});r.outputExpression=a,n.qDef.qDef=r.outputExpression,n.qDef.base.qLabelExpression?n.qDef.qLabelExpression=n.qDef.base.qLabelExpression:n.qDef.qLabel=n.qDef.base.qLabel||s,r.base=t()(!0,{},n.qDef.base)}({measure:n,modifier:e,properties:r,dimensionAndFieldList:s}),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)):Ie(n)})})})}({measures:s,properties:i,model:n,libraryItemsProps:u,dimensionAndFieldList:h}).then(function(){return l?Je({oldProperties:r,newProperties:i,model:n}):Promise.resolve(!1)})})}function Ie(e){!function(e){var t=ze(e);return Array.isArray(t)&&t.some(function(e){return"object"===Ee(e)&&!e.disabled&&!Ae[e.type]})}(e)?Ce.restoreBase(e):delete e.qDef.base,e.qDef.coloring&&delete e.qDef.coloring,Be(e)}function Pe(e){var t=e.measures,n=e.properties,r=e.layout;return!!Array.isArray(t)&&t.some(function(e){return Ye({modifiers:ze(e),properties:n,layout:r})})}function Le(e){var t=ze(e);if(Array.isArray(t))for(var n=0;n<t.length;n++){var r=t[n];if(Ae[r.type]&&!r.disabled)return r}}function je(e){var t=Le(e);return!t||Ae[t.type].enableTotalsFunction(e)}function Fe(e){return o(e,"qHyperCubeDef.qMeasures",[]).concat(o(e,"qHyperCubeDef.qLayoutExclude.qHyperCubeDef.qMeasures",[]))}function ze(e){return e.modifiers||e.qDef&&e.qDef.modifiers}function He(e){return o(e,"outputExpression.qValueExpression.qExpr")||o(e,"outputExpression")}function Ve(e){Fe(e).forEach(function(e){return function(e){var n=Le(e);n&&(void 0!==n.outputExpression&&He(n)!==e.qDef.qDef?delete e.qDef.base:!Ce.isValid(e)&&n.base&&(e.qDef.base=t()(!0,{},n.base)))}(e)})}function Be(e){var t=ze(e);Array.isArray(t)&&t.forEach(function(t){"object"===Ee(t)&&(t.disabled||!Ae[t.type]&&He(t)!==e.qDef.qDef)&&(t.disabled=!0,delete t.base)})}function $e(e){return e.base||e.qDef&&e.qDef.base}function We(e){var t=$e(e);return e.qLibraryId||t&&t.qLibraryId}function Ue(e){var t=e.measure,n=e.properties,r=e.layout;return!We(t)&&Ye({modifiers:ze(t),properties:n,layout:r})}function Ye(e){var t=e.modifiers,n=e.properties,r=e.layout,i={};return Array.isArray(t)&&t.some(function(e){return!("object"!==Ee(e)||e.disabled||!Ae[e.type])&&(void 0===i[e.type]&&(i[e.type]=Ae[e.type].isApplicable({properties:n,layout:r})),i[e.type])})}function Ke(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 s=t.app.getFieldList().then(function(e){i.fieldList=e});return r.push(s),Promise.all(r).then(function(){return i})}function Xe(e){var t=e.libraryIds,n=e.model,r=e.libraryItemsProps;if(r)return Promise.resolve(r);var i=t.measureLibraryIds,o=t.dimensionLibraryIds,s={},a=[];return i.forEach(function(e){var t=n.app.getMeasure(e).then(function(t){return t.getProperties().then(function(t){s[e]=t})});a.push(t)}),o.forEach(function(e){var t=n.app.getDimension(e).then(function(t){return t.getProperties().then(function(t){s[e]=t})});a.push(t)}),Promise.all(a).then(function(){return s})}function Ge(e,t){if(""!==t||-1===["qFmt","qDec","qThou"].indexOf(e))return t}function Je(e){var t=e.oldProperties,n=e.newProperties,r=e.model,i=JSON.stringify(o(t,"qHyperCubeDef.qMeasures"),Ge)!==JSON.stringify(o(n,"qHyperCubeDef.qMeasures"),Ge)||JSON.stringify(o(t,"qHyperCubeDef.qLayoutExclude.qHyperCubeDef.qMeasures"),Ge)!==JSON.stringify(o(n,"qHyperCubeDef.qLayoutExclude.qHyperCubeDef.qMeasures"),Ge);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):R(t,n,r)}({model:r,oldProperties:t,newProperties:n}).then(function(){return i}):Promise.resolve(i)}function Ze(e){var t=e.modifiers,n=e.properties,r=e.layout;return Array.isArray(t)&&t.some(function(e){return"object"===Ee(e)&&!e.disabled&&Ae[e.type]&&Ae[e.type].needDimension({modifier:e,properties:n,layout:r})})}function Qe(e){var t=Fe(e),n=[],r=[],i=!1;return t.forEach(function(t){var r=ze(t);if(Ye({modifiers:r,properties:e})){var o=We(t);o&&n.push(o),i=i||Ze({modifiers:r,properties:e})}}),o(e,"qHyperCubeDef.qDimensions",[]).forEach(function(e){var t=e.qLibraryId;t&&r.push(t)}),{measureLibraryIds:n,dimensionLibraryIds:r}}function et(e){var t=e.model,n=e.libraryIds;return!e.masterItem&&n&&(n.measureLibraryIds.length||n.dimensionLibraryIds.length)?(Ne[t.id].masterItemSubscriber=Ne[t.id].masterItemSubscriber||function(e){var t=e.model,n=e.callback,r={},i={},s={},a={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&&a[n]&&a[n].forEach(function(n){t[n]=o(e,n)}),JSON.stringify(t)}function c(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 u(e,n){return t.app[n](e).then(function(t){r[e]={listener:t.layoutSubscribe(c),enabled:!1,properties:l(t.layout)}})}return{subscribe:function(e){var n=e.measureLibraryIds,o=e.dimensionLibraryIds,a=[];return function(e){var t=e.dimensionLibraryIds;i={},e.measureLibraryIds.forEach(function(e){i[e]=!0}),s={},t.forEach(function(e){s[e]=!0})}({measureLibraryIds:n,dimensionLibraryIds:o}),Object.keys(r).forEach(function(e){i[e]||s[e]||(r[e].listener.dispose(),delete r[e])}),t.app&&(Object.keys(i).forEach(function(e){i[e]&&!r[e]&&a.push(u(e,"getMeasure"))}),Object.keys(s).forEach(function(e){s[e]&&!r[e]&&a.push(u(e,"getDimension"))})),Promise.all(a)},unsubscribe:function(){Object.keys(r).forEach(function(e){r[e].listener.dispose()}),r={}}}}({model:t,callback:function(e){return Oe({model:t,masterItem:e}).then(function(){return t.app.clearUndoBuffer()})}}),Ne[t.id].masterItemSubscriber.subscribe(n)):Promise.resolve()}})(),t.default=i.default,Object.defineProperty(t,"__esModule",{value:!0})})()}},t={};function n(r){var i=t[r];if(void 0!==i)return i.exports;var o=t[r]={exports:{}};return e[r](o,o.exports,n),o.exports}n.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return n.d(t,{a:t}),t},n.d=(e,t)=>{for(var r in t)n.o(t,r)&&!n.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t);var r={};return(()=>{function e(t){var n,r=t;return r>9?(n=65+r-10)>90&&(n+=6):r="".concat(r).charCodeAt(0),[48,111,79,105,73,108].indexOf(n)>-1?e(r+1):String.fromCharCode(n)}function t(n){var r=e(n%62),i=Math.floor(n/62);return i>0?t(i)+r:r}function i(e){return i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},i(e)}n.d(r,{default:()=>Ve});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 s=r[o];if(""!==s){if(void 0===i[s]||null===i[s])return n;i=i[s]}}return i},setValue:function(e,t,n){if(null!=e&&null!=t){for(var r=t.split("."),i=r[r.length-1],o=e,s=0;s<r.length-1;++s){var a=r[s];void 0!==o[a]&&null!==o[a]||(o[a]=Number.isNaN(+r[s+1])?{}:[]),o=o[a]}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 s(e){return function(e){if(Array.isArray(e))return a(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 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}}(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 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}function l(e){return function(e){if(Array.isArray(e))return c(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(e){if("string"==typeof e)return c(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?c(e,t):void 0}}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function c(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function u(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 h={isOrderedSubset:function(e,t){if(!(e&&t&&e.length&&t.length))return!1;var n=e.indexOf(t[0]);if(-1!==n){for(var 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:u};var d=n(8),f=n.n(d);const p=function(e){var t,n=e.exportFormat,r=e.qHyperCubeDef,i=n.data[0];(t=i.dimensions).push.apply(t,s(r.qDimensions));var a,l=o.getValue(r,"qLayoutExclude.qHyperCubeDef.qDimensions");l&&(a=i.excludedDimensions).push.apply(a,s(l))},g=function(e){var t,n=e.exportFormat,r=e.qHyperCubeDef,i=n.data[0];(t=i.measures).push.apply(t,l(r.qMeasures));var s,a=o.getValue(r,"qLayoutExclude.qHyperCubeDef.qMeasures");a&&(s=i.excludedMeasures).push.apply(s,l(a))},m=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&&h.isOrderedSubset(i,r.interColumnSortOrder)&&(r.interColumnSortOrder=i.concat())},y=function(e){var t=e.exportFormat,n=e.properties;Object.keys(n).forEach(function(e){t.properties[e]=n[e]})},b=function(e){var t=e.exportFormat,n=e.properties;n.qLayoutExclude||(n.qLayoutExclude={}),n.qLayoutExclude.disabled&&(Object.keys(n.qLayoutExclude.disabled).forEach(function(e){t.properties.hasOwnProperty(e)||(t.properties[e]=n.qLayoutExclude.disabled[e])}),delete n.qLayoutExclude.disabled),n.qLayoutExclude.changed&&(function(e){Object.keys(e.qLayoutExclude.changed).forEach(function(t){e.qLayoutExclude.changed[t].to===o.getValue(e,t)&&o.setValue(e,t,e.qLayoutExclude.changed[t].from)})}(n),delete n.qLayoutExclude.changed),n.qLayoutExclude.quarantine&&!o.isEmpty(n.qLayoutExclude.quarantine)||delete n.qLayoutExclude},v=function(e){e.forEach(function(e){f().cleanUpMeasure(e),e.qDef.modifiers&&(e.store={modifiers:e.qDef.modifiers},delete e.qDef.modifiers)})};function x(e,t,n){var r,i,s=arguments.length>3&&void 0!==arguments[3]&&arguments[3],a=o.getValue(e,t);if(!o.isAtomicValue(a))try{if((i=(i=(r=JSON.stringify(a)).match(/:\{/g))?i.length:0)>2&&!s)return;a=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]=a}var w=n(909),M=n.n(w);function k(e,t){var n=M()(!0,{},t,e);return o.getValue(n,"qOtherTotalSpec.qOtherCounted")||o.setValue(n,"qOtherTotalSpec.qOtherCounted",{qv:"10"}),o.getValue(n,"qOtherTotalSpec.qOtherLimit")||o.setValue(n,"qOtherTotalSpec.qOtherLimit",{qv:"0"}),n.hasOwnProperty("othersLabel")||(n.othersLabel="Others"),n}function q(e,t){return M()(!0,{},t,e)}function S(e,t,n){return"function"==typeof e?e(t):Number.isNaN(+e)?n:e}var _=Math.pow(2,53)-1;function D(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){(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 E=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},A=function(e,t,n){t.hasOwnProperty(e)&&(n[e]=t[e])},T=function(e,t,n,r){t.hasOwnProperty(e)?n[e]=t[e]:n[e]=r},N=function(){return{qDef:{autoSort:!0,cId:"",othersLabel:"Others"},qLibraryId:"",qNullSuppression:!1,qOtherLabel:"Others",qOtherTotalSpec:{qOtherLimitMode:"OTHER_GE_LIMIT",qOtherMode:"OTHER_OFF",qOtherSortMode:"OTHER_SORT_DESCENDING",qSuppressOther:!1}}},O=function(){return{qDef:{autoSort:!0,cId:"",numFormatFromTemplate:!0},qLibraryId:"",qTrendLines:[]}},R=function(e){var t,n=e.exportFormat,r=e.maxDimensions,i=e.minDimensions,o=e.newHyperCubeDef,s=e.defaultDimension,a=n.data[0];for(t=0;t<a.dimensions.length;++t){var l=k(a.dimensions[t],s);o.qDimensions.length<r?o.qDimensions.push(l):o.qLayoutExclude.qHyperCubeDef.qDimensions.push(l)}for(t=0;t<a.excludedDimensions.length;++t){var c=k(a.excludedDimensions[t],s);o.qDimensions.length<i?o.qDimensions.push(c):o.qLayoutExclude.qHyperCubeDef.qDimensions.push(c)}},I=function(e){var t,n=e.exportFormat,r=e.maxMeasures,i=e.minMeasures,o=e.newHyperCubeDef,s=e.defaultMeasure,a=n.data[0];for(t=0;t<a.measures.length;++t){var l=q(a.measures[t],s);o.qMeasures.length<r?o.qMeasures.push(l):o.qLayoutExclude.qHyperCubeDef.qMeasures.push(l)}for(t=0;t<a.excludedMeasures.length;++t){var c=q(a.excludedMeasures[t],s);o.qMeasures.length<i?o.qMeasures.push(c):o.qLayoutExclude.qHyperCubeDef.qMeasures.push(c)}},P=function(e){var t=e.exportFormat,n=e.dataDefinition,r=void 0===n?{}:n,i=t.data[0],o=r.dimensions||{max:0},s=r.measures||{max:0},a=S(s.max,i.dimensions.length,_),l=S(s.min,i.dimensions.length,0);return{maxDimensions:S(o.max,a,_),minDimensions:S(o.min,l,0),maxMeasures:a,minMeasures:l}},L=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?(h.indexAdded(n.qInterColumnSortOrder,o),++o):(--o,h.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=M()(!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=M()(!0,{},n,i)).components&&(i.components=[]),i},F=function(e){var t=e.exportFormat,n=e.maxDimensions,r=e.minDimensions,i=e.maxMeasures,o=e.minMeasures,s=t.data[0];return s.dimensions.length>n&&n>0||s.measures.length>i&&i>0||s.excludedDimensions.length>0&&s.dimensions.length+s.excludedDimensions.length>r||s.excludedMeasures.length>0&&s.measures.length+s.excludedMeasures.length>o||!i&&s.measures.length>0||!n&&s.dimensions.length>0},z=function(e){var t=e.exportFormat,n=e.maxDimensions,r=e.minDimensions,i=e.maxMeasures,o=e.minMeasures,s=e.newHyperCubeDef,a=t.data[0];s.qLayoutExclude||(s.qLayoutExclude={}),s.qLayoutExclude.qHyperCubeDef||(s.qLayoutExclude.qHyperCubeDef={}),(a.dimensions.length>n&&n>0||a.excludedDimensions&&a.excludedDimensions.length&&a.dimensions.length+a.excludedDimensions.length>r)&&(s.qLayoutExclude.qHyperCubeDef.qDimensions||(s.qLayoutExclude.qHyperCubeDef.qDimensions=[])),(a.measures.length>i&&i>0||a.excludedMeasures&&a.excludedMeasures.length&&a.measures.length+a.excludedMeasures.length>o)&&(s.qLayoutExclude.qHyperCubeDef.qMeasures||(s.qLayoutExclude.qHyperCubeDef.qMeasures=[])),!i&&a.measures.length&&(s.qLayoutExclude.qHyperCubeDef.qMeasures||(s.qLayoutExclude.qHyperCubeDef.qMeasures=[])),!n&&a.dimensions.length&&(s.qLayoutExclude.qHyperCubeDef.qDimensions||(s.qLayoutExclude.qHyperCubeDef.qDimensions=[]))},H=function(e){var t,n=e.newProperties,r=e.dataDefinition,i=e.hypercubePath;if(r.dimensions&&"function"==typeof r.dimensions.added){var s=o.getValue(n,i||"").qHyperCubeDef,a=function(e){if(Array.isArray(e))return D(e)}(t=s.qDimensions)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(t)||function(e,t){if(e){if("string"==typeof e)return D(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?D(e,t):void 0}}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}();s.qDimensions=[],a.forEach(function(e){s.qDimensions.push(e),r.dimensions.added(e,n)})}},V=function(e){var t,n=e.newProperties,r=e.dataDefinition,i=e.hypercubePath;if(r.measures&&"function"==typeof r.measures.added){var s=o.getValue(n,i||"").qHyperCubeDef,a=function(e){if(Array.isArray(e))return C(e)}(t=s.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 C(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?C(e,t):void 0}}(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.")}();s.qMeasures=[],a.forEach(function(e){s.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 W={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}(),s=t.qProperty,a=o.getValue(s,n||""),l=a.qHyperCubeDef;return l.qInterColumnSortOrder||(l.qInterColumnSortOrder=[]),p({exportFormat:i,qHyperCubeDef:l}),g({exportFormat:i,qHyperCubeDef:l}),m({exportFormat:i,qHyperCubeDef:l}),delete l.qLayoutExclude,y({exportFormat:i,properties:s}),n&&(i.properties.qHyperCubeDef=l,delete a.qHyperCubeDef),b({exportFormat:i,properties:s}),r||v(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,s=void 0===i?{}:i,a=e.defaultPropertyValues,l=void 0===a?{}:a,c=e.hypercubePath,u=e.extension,h=e.supportedFilters,d=void 0===h||h,f=e.isHCModifierSupported,p=void 0===f||f,g={qChildren:[]},m=j({exportFormat:t,initialProperties:r,hypercubePath:c}),y=o.getValue(r,c||"").qHyperCubeDef,b=o.getValue(m,c||"").qHyperCubeDef,v=P({exportFormat:t,dataDefinition:s}),x=v.maxDimensions,w=v.minDimensions,M=v.maxMeasures,k=v.minMeasures,q=l.defaultDimension,S=void 0===q?N():q,_=l.defaultMeasure,D=void 0===_?O():_;b.qDimensions.length=0,b.qMeasures.length=0,F({exportFormat:t,maxDimensions:x,minDimensions:w,maxMeasures:M,minMeasures:k})&&z({exportFormat:t,maxDimensions:x,minDimensions:w,maxMeasures:M,minMeasures:k,newHyperCubeDef:b}),R({exportFormat:t,maxDimensions:x,minDimensions:w,newHyperCubeDef:b,defaultDimension:S}),I({exportFormat:t,maxMeasures:M,minMeasures:k,newHyperCubeDef:b,defaultMeasure:D}),H({newProperties:m,dataDefinition:s,hypercubePath:c}),V({newProperties:m,dataDefinition:s,hypercubePath:c}),L({exportFormat:t,newHyperCubeDef:b}),A("qMaxStackedCells",y,b),A("qNoOfLeftDims",y,b),T("qInitialDataFetch",y,b,[{qTop:0,qLeft:0,qWidth:0,qHeight:0}]),T("qMode",y,b,"S"),T("qReductionMode",y,b,"N"),T("qSortbyYValue",y,b),T("qIndentMode",y,b),T("qShowTotalsAbove",y,b),E(m,t,r),g.qProperty=m;var C=o.getValue(u||{},"support.modifiers");return B({measures:b.qMeasures,modifierTypes:C}),d&&$(g.qProperty,"storedFilters"),"S"===b.qMode&&p&&$(g.qProperty,"dynamicScript"),g}};var U={cellBackgroundColor:!0,cellForegroundColor:!0,colorByAlternative:!0,colorByExpression:!0,tooltip:!0,urlLabel:!0,url:!0};function Y(e,t,n,r){t=t||[];var i=u(e,r,n),o=u(t,r,n);if(-1!==i&&-1===o){var s=e.splice(i,1);t.push(s[0])}return t}function K(e,t){return e.length!==t}const X={create:function(e,t){if(!e||!U[e])throw new Error("Attribute Expressions Util: ID required");var n={};return t&&Object.keys(t).forEach(function(e){n[e]=t[e]}),n.id=e,n.qAttribute=!0,n},moveByIdFromGroup:function(e,t,n,r,i){n=n||"qAttributeExpressions",i=i||"id";for(var o=0;o<e.length;o++){var s=e[o][n],a=t.length;if(Y(s,t,r,i),K(t,a))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"}},G={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}},J={colorModeOptions:{primary:function(){return!0},dimension:function(e){return G.getNumDimensions(e)>0&&G.getNumMeasures(e)<=1},multiColor:function(e){return G.getNumMeasures(e)>1},measure:function(e){return G.getNumDimensions(e)>0},expression:function(e){return G.getNumMeasures(e)>=1}}},Z={colorModeOptions:{primary:function(){return!0},dimension:function(){return!0},multiColor:function(){return!1},measure:function(){return!0},expression:function(e){return G.getNumMeasures(e)>=1}}};var Q={scatterplot:Z,"sn-scatter-plot":Z,piechart:{colorModeOptions:{primary:function(){return!0},dimension:function(){return!0},multiColor:function(){return!1},measure:function(){return!0},expression:function(e){return G.getNumMeasures(e)>=1}}},linechart:{colorModeOptions:{primary:function(){return!0},dimension:function(e){return G.getNumDimensions(e)>1},multiColor:function(e){return G.getNumMeasures(e)>1},measure:function(e){return G.getNumDimensions(e)<=1},expression:function(e){return G.getNumMeasures(e)>=1}}},map:{colorModeOptions:{primary:function(){return!0},dimension:function(e){return G.getNumDimensions(e)>=1},multiColor:function(e){return G.getNumMeasures(e)>1},measure:function(e){return G.getNumDimensions(e)>=1},expression:function(e){return G.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 G.getNumDimensions(e)>=1}}}};function ee(e,t,n){if(Array.isArray(e[t])){var r=h.findIndexByPropertyValue(e[t],"id",n);r>=0&&e[t].splice(r,1)}else e[t]=[]}function te(e,t){var n=X.IDMAP.COLOR_BY_ALTERNATIVE;e.forEach(function(e){ee(e,"qAttributeDimensions",n),ee(e,"qAttributeExpressions",n)}),t.forEach(function(e){ee(e,"qAttributeDimensions",n),ee(e,"qAttributeExpressions",n)})}function ne(e,t){if(t){var n="="===t.charAt(0);e.color.altLabel=n?{qStringExpression:{qExpr:t.substr(1)}}:t}}function re(e){var t=e.properties,n=e.isDimension,r=e.dimensions,i=e.excludedDimensions,s=e.measures,a=e.label;te(r,i);var l=r[r.length-1];if(l){var c=n?o.getValue(t,"color.byDimDef"):o.getValue(t,"color.byMeasureDef"),u=o.getValue(t,"color.formatting.qNumFormat"),d=o.getValue(t,"color.formatting.isCustomFormatted");if(c){var f=X.create(X.IDMAP.COLOR_BY_ALTERNATIVE);switch(c.type){case"expression":!function(e){var t=e.attributeExpression,n=e.label,r=e.item,i=e.isDimension,o=e.qNumFormat,s=e.isCustomFormatted;t.label=n||r.label,i?t.qDef=r.key:(t.qExpression=r.key,o&&(t.qNumFormat=o,t.isCustomFormatted=s)),t.matchMeasure=r.activeMeasureIndex,t.label&&"="===t.label.charAt(0)&&(t.labelExpRef="color.altLabel")}({attributeExpression:f,label:a,item:c,isDimension:n,qNumFormat:u,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=h.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:s,item:c,isDimension:n,qNumFormat:u,isCustomFormatted:d})}n?(f.qSortBy={qSortByAscii:1},l.qAttributeDimensions.push(f)):l.qAttributeExpressions.push(f)}}}function ie(e,t,n,r){var i,o,s,a={};switch(e){case"dimension":n.qLibraryId?(a.type="dimension",a.name=n.qLibraryId,a.id=n.qLibraryId):(a.type="field",t?(a.name=n.label||n.qDef,a.id=n.qDef):(a.name=n.qDef.qFieldDefs[0],a.label=(s=n.qDef).qLabelExpression?s.qLabelExpression:s.qFieldLabels&&s.qFieldLabels[0]?s.qFieldLabels[0]:s.qFieldDefs[0]));break;case"measure":i=function(e,t){return t?e.qLibraryId:f().measureBase.getLibraryId(e)}(n,t),i?(a.type="measure",a.name=i,a.id=i,o=function(e,t){return f().hasActiveModifiers({measures:[e]})&&t?e.qDef.qDef:void 0}(n,r),o&&(a.expression=o)):(a.type="expression",t?(a.name=n.label||n.qExpression,a.id=n.qExpression):(a.name=n.qDef.qDef,a.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 a}const oe={useMasterNumberFormat:function(e){e.quarantine={qNumFormat:e.qNumFormat||{},isCustomFormatted:e.isCustomFormatted||!1},e.qNumFormat=null,e.isCustomFormatted=void 0}};function se(e,t,n,r){var i=t.type,o=e.color,s=o.mode,a=G.getItemLabel(t);switch(ne(e,a||""),i){case"field":s="byDimension",o.byDimDef={label:t.label||G.wrapFieldName(t.name),key:G.wrapFieldName(t.name),type:"expression",activeDimensionIndex:t.activeDimensionIndex};break;case"expression":s="byMeasure",o.byMeasureDef={label:a,key:t.name,type:"expression",activeMeasureIndex:t.activeMeasureIndex};break;case"dimension":s="byDimension",o.byDimDef={label:t.name,key:t.id,type:"libraryItem",activeDimensionIndex:t.activeDimensionIndex};break;case"measure":s="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=s}function ae(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"),[]),s=o.getValue(e,"color.byDimDef");if(s&&ne(e,s.label),function(e){return!!(e&&e.activeDimensionIndex>-1)}(s))!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,se(e,i)}(e,t);else if(function(e){return!e||!e.key}(s)&&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("."),s=Number(i[1]),a=o.getValue(t,"layers.".concat(s,".type"));return 2===e.length&&"map"===r&&"point"===a}(n,e,t)?0:n.length-1],i=X.IDMAP.COLOR_BY_ALTERNATIVE,s=h.findItemByPropertyValue(r.qAttributeDimensions,"id",i);return se(e,ie("dimension",!!s,s||r)),!!s}(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)},ce=function(e,t){var n={primary:!0};if(e){var r=(Q[t]||J).colorModeOptions||J.colorModeOptions;n.byDimension=r.dimension(e),n.byMeasure=r.measure(e),n.byMultiple=r.multiColor(e),n.byExpression=r.expression(e)}return n},ue=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))},he=function(e,t){var n,r=o.getValue(e,"color.mode"),i=o.getValue(e,"color.auto"),s=o.getValue(e,"".concat(t,"qDimensions"),[]),a=o.getValue(e,"".concat(t,"qMeasures"),[]),l=o.getValue(e,"".concat(t,"qLayoutExclude.qHyperCubeDef.qDimensions"),[]);i?te(s,l):!(n={auto:i,colorMode:r,dimensions:s}).auto&&"byDimension"===n.colorMode&&n.dimensions.length>0?ae(e,t):function(e){var t=e.auto,n=e.colorMode,r=e.dimensions,i=e.measures,s=e.properties,a=o.getValue(s,"visualization");return!(t||"byMeasure"!==n||!r.length||"map"!==a&&!i.length)}({auto:i,colorMode:r,dimensions:s,measures:a,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"),[]),s=o.getValue(e,"color.byMeasureDef");if(s&&ne(e,s.label),function(e){return!!(e&&e.activeMeasureIndex>-1)}(s))!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,se(e,i)}}(e,t);else if(function(e,t){return(!e||!e.key)&&t.length>0}(s,r)&&function(e,t){var n=o.getValue(e,"".concat(t,"qDimensions"),[]),r=o.getValue(e,"".concat(t,"qMeasures"),[]),i=n[n.length-1],s=X.IDMAP.COLOR_BY_ALTERNATIVE,a=h.findItemByPropertyValue(i.qAttributeExpressions,"id",s);return se(e,ie("measure",!!a,a||r[0])),!!a}(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"),[]),s=o.getValue(e,"".concat(t,"qLayoutExclude.qHyperCubeDef.qDimensions"),[]);"byMultiple"===n&&i.length<2&&o.setValue(e,"color.mode","primary"),te(r,s)}(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},pe=function(e){var t=o.getValue(e,"qHyperCubeDef.qMeasures.0.qAttributeExpressions",[]),n=o.getValue(e,"color.colorExpression","");t.splice(0,0,{qExpression:n,id:"colorByExpression"}),o.setValue(e,"qHyperCubeDef.qMeasures.0.qAttributeExpressions",t)},ge=function(e){o.setValue(e,"color.mode","primary"),o.setValue(e,"color.auto",!0)},me=function(e){var t=o.getValue(e,"qHyperCubeDef.qDimensions",[]),n=o.getValue(e,"color.persistent",!1);return t.length>1&&!n},ye={exportProperties:function(e){var t=e.propertyTree,n=e.hypercubePath,r=e.viewDataMode,i=W.exportProperties({propertyTree:t,hypercubePath:n,viewDataMode:r}),o=i.data[0],s=o.dimensions.concat(o.excludedDimensions),a=o.measures.concat(o.excludedMeasures),l=X.IDMAP,c=l.COLOR_BY_ALTERNATIVE,u=l.COLOR_BY_EXPRESSION;return X.moveByIdFromGroup(s,[],"qAttributeDimensions",c),X.moveByIdFromGroup(s,[],"qAttributeExpressions",c),X.moveByIdFromGroup(a,[],"qAttributeExpressions",u),i},importProperties:function(e){var t=e.exportFormat,n=e.initialProperties,r=e.dataDefinition,i=e.defaultPropertyValues,s=e.hypercubePath,a=e.extension,l=e.supportedFilters,c=e.isHCModifierSupported,u=W.importProperties({exportFormat:t,initialProperties:n,dataDefinition:r,defaultPropertyValues:i,hypercubePath:s,extension:a,supportedFilters:l,isHCModifierSupported:c}),h=u.qProperty,d=o.getValue(h,"visualization"),f=o.getValue(h,"qHyperCubeDef.qDimensions",[]),p=o.getValue(h,"color.mode",""),g=o.getValue(h,"color.auto",""),m=ce(h,d),y=ue({canColorBy:m,autoColor:g,colorMode:p,dimensions:f});return m[p]?fe({shouldUpdateColorBy:y,properties:h})&&pe(h):ge(h),y&&he(h,"qHyperCubeDef."),me(h)&&le(h,"color.persistent",!0),de(f),u}};var be=["bar","marker","line"];const ve=function(e){var t=e.initialProperties,n=e.properties;t.measureAxis&&void 0===t.measureAxis.autoMinMax?$(n,"unsupportedAutoMinMax")||M()(n.measureAxis,t.measureAxis):$(n,"supportedAutoMinMax")||M()(n.measureAxis,t.measureAxis)},xe=function(e){var t,n=e.exportFormat,r=e.initialProperties,i=e.properties,o=e.measureType,s=i.qHyperCubeDef,a=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}}),be.includes(r)&&t[i].type[r]++,t[i].type.total++}}),t}(s);l.length?(o&&(t=l.filter(function(e){return e.type[o]>0}).sort(function(e,t){return t.type[o]-e.type[o]})),t&&t.length||(t=l.sort(function(e,t){return t.type.total-e.type.total})),t&&t[0]&&M()(a,n.properties.measureAxes[t[0].axis])):M()(a,n.properties.measureAxes[0])}},we=function(e){if(e.qDimensions.length>1){var t=e.qInterColumnSortOrder.indexOf(0);if(0!==t){var n=e.qInterColumnSortOrder[0];e.qInterColumnSortOrder[0]=0,e.qInterColumnSortOrder[t]=n}}},Me={exportProperties:function(e){var t=e.propertyTree,n=e.hypercubePath,r=e.viewDataMode,i=e.supportedAutoMinMax,o=void 0===i||i,s=ye.exportProperties({propertyTree:t,hypercubePath:n,viewDataMode:r}),a=s.properties;return o?(x(a,"measureAxis.min","supportedAutoMinMax"),x(a,"measureAxis.max","supportedAutoMinMax")):(x(a,"measureAxis.min","unsupportedAutoMinMax"),x(a,"measureAxis.max","unsupportedAutoMinMax")),s},importProperties:function(e){var t=e.exportFormat,n=e.initialProperties,r=e.dataDefinition,i=e.defaultPropertyValues,o=e.hypercubePath,s=e.measureType,a=e.extension,l=e.supportedFilters,c=e.isHCModifierSupported,u=ye.importProperties({exportFormat:t,initialProperties:n,dataDefinition:r,defaultPropertyValues:i,hypercubePath:o,extension:a,supportedFilters:l,isHCModifierSupported:c}),h=u.qProperty;return ve({initialProperties:n,properties:h}),xe({exportFormat:t,initialProperties:n,properties:h,measureType:s}),we(h.qHyperCubeDef),h.qHyperCubeDef.qColumnOrder=[],h.qHyperCubeDef.columnOrder=[],u}};function ke(e,t,n){return"qLayoutExclude.quarantine.".concat(e,".").concat(t,".").concat(n)}function qe(e){var t=e.properties,n=e.arrayPath,r=e.quarantineName,i=e.arrayName,s=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,s=e.itemPath,a=o.getValue(i,s);if(void 0!==a){var l=o.getValue(i,"qDef.cId");l||(l=o.generateId(),o.setValue(i,"qDef.cId",l));var c=ke(n,r,l);o.setValue(t,c,a),o.setValue(i,s,void 0)}}({properties:t,quarantineName:r,arrayName:i,item:e,itemPath:s})})}function Se(e){var t=e.properties,n=e.arrayPath,r=e.quarantineName,i=e.arrayName,s=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,s=e.itemPath,a=o.getValue(i,"qDef.cId");if(a){var l=ke(n,r,a),c=o.getValue(t,l);void 0!==c&&(o.setValue(i,s,c),o.setValue(t,l,void 0))}}({properties:t,quarantineName:r,arrayName:i,item:e,itemPath:s})})}var _e="qHyperCubeDef.qMeasures",De="conditionalColoring",Ce="measures",Ee="qDef.conditionalColoring";const Ae={quarantine:function(e){qe({properties:e,arrayPath:_e,quarantineName:De,arrayName:Ce,itemPath:Ee})},unquarantine:function(e){Se({properties:e,arrayPath:_e,itemPath:Ee,arrayName:Ce,quarantineName:De})}};var Te="qHyperCubeDef.qMeasures",Ne="measures",Oe="qHyperCubeDef.qDimensions",Re="dimensions",Ie="qHyperCubeDef.qLayoutExclude.qHyperCubeDef.qMeasures",Pe="alternativeMeasures",Le="qHyperCubeDef.qLayoutExclude.qHyperCubeDef.qDimensions",je="alternativeDimensions",Fe="qCalcCondition",ze="conditionalShowHide";const He={quarantine:function(e){qe({properties:e,arrayPath:Te,quarantineName:ze,arrayName:Ne,itemPath:Fe}),qe({properties:e,arrayPath:Oe,quarantineName:ze,arrayName:Re,itemPath:Fe})},unquarantine:function(e){Se({properties:e,arrayPath:Te,quarantineName:ze,arrayName:Ne,itemPath:Fe}),Se({properties:e,arrayPath:Oe,quarantineName:ze,arrayName:Re,itemPath:Fe})},quarantineAlternative:function(e){qe({properties:e,arrayPath:Ie,quarantineName:ze,arrayName:Pe,itemPath:Fe}),qe({properties:e,arrayPath:Le,quarantineName:ze,arrayName:je,itemPath:Fe})},unquarantineAlternative:function(e){Se({properties:e,arrayPath:Ie,quarantineName:ze,arrayName:Pe,itemPath:Fe}),Se({properties:e,arrayPath:Le,quarantineName:ze,arrayName:je,itemPath:Fe})}},Ve={hypercube:W,colorChart:ye,axisChart:Me,quarantineProperty:x,unquarantineProperty:$,quarantineArrayProp:qe,unquarantineArrayProp:Se,conditionalColoring:Ae,conditionalShow:He}})(),r.default})()}(km)),km.exports),Sm=n(qm);const _m={AUTO:!0,BIN_COUNT:10,BIN_SIZE:10,LABEL:"x",OFFSET:0,COUNT_DISTINCT:!1,BIN_MODE:"maxCount"};Object.freeze(_m);const Dm={version:"1.0.3",qHyperCubeDef:{qDimensions:[],qMeasures:[],qMode:"S",qAlwaysFullyExpanded:!0,qSuppressZero:!1,qSuppressMissing:!0},bins:{auto:_m.AUTO,binCount:"",binSize:_m.BIN_SIZE,offset:_m.OFFSET,countDistinct:_m.COUNT_DISTINCT,binMode:_m.BIN_MODE},color:{bar:{paletteColor:{index:6,color:"#4477aa"}}},dataPoint:{showLabels:!1},dimensionAxis:{dock:"near",label:"auto",show:"all"},measureAxis:{autoMinMax:!0,dock:"near",label:"",max:10,min:0,minMax:"min",show:"all",spacing:1},gridlines:{auto:!0,spacing:2},refLine:{refLines:[]},sorting:{autoSort:!0},showTitles:!0,subtitle:"",title:"",footnote:""};function Cm(e){const{translator:t}=e;return{path:"/qHyperCubeDef",dimensions:{min:1,max:1,description:()=>t.get("Visualization.Histogram.Binning")},measures:{min:0,max:0}}}function Em(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function Am(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 Tm(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,s,a=[],l=!0,c=!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)&&(a.push(r.value),a.length!==t);l=!0);}catch(e){c=!0,i=e}finally{try{if(!l&&null!=n.return&&(s=n.return(),Object(s)!==s))return}finally{if(c)throw i}}return a}}(e,t)||Om(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 Nm(e){return function(e){if(Array.isArray(e))return Em(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||Om(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 Om(e,t){if(e){if("string"==typeof e)return Em(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)?Em(e,t):void 0}}var Rm,Im="top",Pm="top-right",Lm="right",jm="bottom-right",Fm="bottom",zm="bottom-left",Hm="left",Vm="top-left";Am(Am(Am(Am(Am(Am(Am(Am(Am(Am(Rm={},"equal-equal",[Im,Fm]),"equal-higher",[Fm,jm]),"equal-lower",[Im,Pm]),"equal-void",[Im,Fm]),"higher-equal",[Hm,zm,Im,Pm]),"higher-higher-acute",[Fm,zm,Hm,Pm]),"higher-higher-obtuse",[Fm,Im]),"higher-lower-negative",[Im,Pm,Lm]),"higher-lower-positive",[Fm,zm,Hm]),"higher-void",[Im]),Am(Am(Am(Am(Am(Am(Am(Am(Am(Am(Rm,"lower-equal",[Im]),"lower-higher-negative",[Im,Vm]),"lower-higher-positive",[jm]),"lower-lower-acute",[Im,Vm,Hm,Pm,Lm]),"lower-lower-obtuse",[Im,Fm]),"lower-void",[Im]),"void-equal",[Im]),"void-higher",[Im,Fm]),"void-lower",[Im,Fm,Hm]),"void-void",[Im]),Am(Rm,"unclassified",[Im,Fm,Lm,Hm,Pm,jm,zm,Vm]);var Bm=["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"],$m=["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 Wm=function(e){return{value:e,label:e.charAt(0).toUpperCase()+e.slice(1),groupHeader:!1,disabled:!1,styles:{fontFamily:e}}};function Um(e){var t=e.theme,n=e.translator,r=e.defaultValue,i=e.flags,o=[],s=t.getStyle("","","fontFamilies");return Array.isArray(s)&&s.length?o.push.apply(o,Nm(new Set([r].concat(Nm(s.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(Nm(o.map(function(e){return Wm(e)})),[{value:"DefaultHeader",label:n.get("properties.allFonts"),metaText:n.get("properties.default"),groupHeader:!0}],Nm(function(e){return null!=e&&e.isEnabled("PS_20852_WYSIWYG_FONT_SUPPORT")?$m:Bm}(i).map(function(e){return Wm(e)})))}function Ym(e){var t=e.theme,n=e.translator,r=e.id,i=e.path,o=e.flags,s=function(){return t.getStyle(r,i,"fontFamily")};return{getDefaultValue:function(){return s()},getOptions:function(){return Um({theme:t,translator:n,defaultValue:s(),flags:o})}}}var Km,Xm,Gm=["10px","11px","12px","13px","14px","15px","16px","17px","18px","19px","20px","21px","22px","23px","24px"],Jm=function(e){return{value:e,label:e,groupHeader:!1,disabled:!1}};function Zm(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,Nm(new Set([n].concat(Nm(i))))):r.push(n),[{value:"ThemeHeader",label:t.get("properties.themeFontSizes"),metaText:t.get("properties.theme"),groupHeader:!0}].concat(Nm(r.map(function(e){return Jm(e)})),[{value:"DefaultHeader",label:t.get("properties.allFontSizes"),metaText:t.get("properties.default"),groupHeader:!0}],Nm(Gm.map(function(e){return Jm(e)})))}({theme:t,translator:n,defaultValue:o()})}}}function Qm(e){var t=e.theme,n=e.translator,r=e.id,i=e.path;return{fontFamily:Ym({theme:t,translator:n,id:r,path:i,flags:e.flags}),fontSize:Zm({theme:t,translator:n,id:r,path:i})}}function ey(e){var t=e.theme,n=e.translator,r=e.config,i=void 0===r?{}:r,o=e.flags,s=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}),a=s.id,l=s.paths,c={};l.forEach(function(e){for(var r=e.split("."),i=c,s=0;s<r.length;s++){var l=r[s];s===r.length-1?i[l]=Qm({theme:t,translator:n,id:a,path:e,flags:o}):void 0===i[l]&&(i[l]={}),i=i[l]}});var u=function(e){for(var t=e.split("."),n=c,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 c.getDefaultValue=function(e){return u(e).getDefaultValue()},c.getOptions=function(e){return u(e).getOptions()},c}var ty,ny=function(){if(Xm)return Km;Xm=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)},s=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},a=function(t,n){if("__proto__"===n){if(!e.call(t,n))return;if(r)return r(t,n).value}return t[n]};return Km=function e(){var t,n,r,l,c,u,h=arguments[0],d=1,f=arguments.length,p=!1;for("boolean"==typeof h&&(p=h,h=arguments[1]||{},d=2),(null==h||"object"!=typeof h&&"function"!=typeof h)&&(h={});d<f;++d)if(null!=(t=arguments[d]))for(n in t)r=a(h,n),h!==(l=a(t,n))&&(p&&l&&(o(l)||(c=i(l)))?(c?(c=!1,u=r&&i(r)?r:[]):u=r&&o(r)?r:{},s(h,{name:n,newValue:e(p,u,l)})):void 0!==l&&s(h,{name:n,newValue:l}));return h},Km}();function ry(e,t,n){e.prototype=t.prototype=n,n.constructor=e}function iy(e,t){var n=Object.create(e.prototype);for(var r in t)n[r]=t[r];return n}function oy(){}(ty=ny)&&ty.__esModule&&Object.prototype.hasOwnProperty.call(ty,"default")&&ty.default;var sy=1/.7,ay="\\s*([+-]?\\d+)\\s*",ly="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",cy="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",uy=/^#([0-9a-f]{3,8})$/,hy=new RegExp(`^rgb\\(${ay},${ay},${ay}\\)$`),dy=new RegExp(`^rgb\\(${cy},${cy},${cy}\\)$`),fy=new RegExp(`^rgba\\(${ay},${ay},${ay},${ly}\\)$`),py=new RegExp(`^rgba\\(${cy},${cy},${cy},${ly}\\)$`),gy=new RegExp(`^hsl\\(${ly},${cy},${cy}\\)$`),my=new RegExp(`^hsla\\(${ly},${cy},${cy},${ly}\\)$`),yy={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 by(){return this.rgb().formatHex()}function vy(){return this.rgb().formatRgb()}function xy(e){var t,n;return e=(e+"").trim().toLowerCase(),(t=uy.exec(e))?(n=t[1].length,t=parseInt(t[1],16),6===n?wy(t):3===n?new Sy(t>>8&15|t>>4&240,t>>4&15|240&t,(15&t)<<4|15&t,1):8===n?My(t>>24&255,t>>16&255,t>>8&255,(255&t)/255):4===n?My(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=hy.exec(e))?new Sy(t[1],t[2],t[3],1):(t=dy.exec(e))?new Sy(255*t[1]/100,255*t[2]/100,255*t[3]/100,1):(t=fy.exec(e))?My(t[1],t[2],t[3],t[4]):(t=py.exec(e))?My(255*t[1]/100,255*t[2]/100,255*t[3]/100,t[4]):(t=gy.exec(e))?Ty(t[1],t[2]/100,t[3]/100,1):(t=my.exec(e))?Ty(t[1],t[2]/100,t[3]/100,t[4]):yy.hasOwnProperty(e)?wy(yy[e]):"transparent"===e?new Sy(NaN,NaN,NaN,0):null}function wy(e){return new Sy(e>>16&255,e>>8&255,255&e,1)}function My(e,t,n,r){return r<=0&&(e=t=n=NaN),new Sy(e,t,n,r)}function ky(e){return e instanceof oy||(e=xy(e)),e?new Sy((e=e.rgb()).r,e.g,e.b,e.opacity):new Sy}function qy(e,t,n,r){return 1===arguments.length?ky(e):new Sy(e,t,n,null==r?1:r)}function Sy(e,t,n,r){this.r=+e,this.g=+t,this.b=+n,this.opacity=+r}function _y(){return`#${Ay(this.r)}${Ay(this.g)}${Ay(this.b)}`}function Dy(){const e=Cy(this.opacity);return`${1===e?"rgb(":"rgba("}${Ey(this.r)}, ${Ey(this.g)}, ${Ey(this.b)}${1===e?")":`, ${e})`}`}function Cy(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function Ey(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function Ay(e){return((e=Ey(e))<16?"0":"")+e.toString(16)}function Ty(e,t,n,r){return r<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new Oy(e,t,n,r)}function Ny(e){if(e instanceof Oy)return new Oy(e.h,e.s,e.l,e.opacity);if(e instanceof oy||(e=xy(e)),!e)return new Oy;if(e instanceof Oy)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),s=NaN,a=o-i,l=(o+i)/2;return a?(s=t===o?(n-r)/a+6*(n<r):n===o?(r-t)/a+2:(t-n)/a+4,a/=l<.5?o+i:2-o-i,s*=60):a=l>0&&l<1?0:s,new Oy(s,a,l,e.opacity)}function Oy(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}function Ry(e){return(e=(e||0)%360)<0?e+360:e}function Iy(e){return Math.max(0,Math.min(1,e||0))}function Py(e,t,n){return 255*(e<60?t+(n-t)*e/60:e<180?n:e<240?t+(n-t)*(240-e)/60:t)}ry(oy,xy,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:by,formatHex:by,formatHex8:function(){return this.rgb().formatHex8()},formatHsl:function(){return Ny(this).formatHsl()},formatRgb:vy,toString:vy}),ry(Sy,qy,iy(oy,{brighter(e){return e=null==e?sy:Math.pow(sy,e),new Sy(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=null==e?.7:Math.pow(.7,e),new Sy(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new Sy(Ey(this.r),Ey(this.g),Ey(this.b),Cy(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:_y,formatHex:_y,formatHex8:function(){return`#${Ay(this.r)}${Ay(this.g)}${Ay(this.b)}${Ay(255*(isNaN(this.opacity)?1:this.opacity))}`},formatRgb:Dy,toString:Dy})),ry(Oy,function(e,t,n,r){return 1===arguments.length?Ny(e):new Oy(e,t,n,null==r?1:r)},iy(oy,{brighter(e){return e=null==e?sy:Math.pow(sy,e),new Oy(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=null==e?.7:Math.pow(.7,e),new Oy(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 Sy(Py(e>=240?e-240:e+120,i,r),Py(e,i,r),Py(e<120?e+240:e-120,i,r),this.opacity)},clamp(){return new Oy(Ry(this.h),Iy(this.s),Iy(this.l),Cy(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=Cy(this.opacity);return`${1===e?"hsl(":"hsla("}${Ry(this.h)}, ${100*Iy(this.s)}%, ${100*Iy(this.l)}%${1===e?")":`, ${e})`}`}}));const Ly=Math.PI/180,jy=180/Math.PI,Fy=4/29,zy=6/29,Hy=3*zy*zy;function Vy(e){if(e instanceof By)return new By(e.l,e.a,e.b,e.opacity);if(e instanceof Ky)return Xy(e);e instanceof Sy||(e=ky(e));var t,n,r=Yy(e.r),i=Yy(e.g),o=Yy(e.b),s=$y((.2225045*r+.7168786*i+.0606169*o)/1);return r===i&&i===o?t=n=s:(t=$y((.4360747*r+.3850649*i+.1430804*o)/.96422),n=$y((.0139322*r+.0971045*i+.7141733*o)/.82521)),new By(116*s-16,500*(t-s),200*(s-n),e.opacity)}function By(e,t,n,r){this.l=+e,this.a=+t,this.b=+n,this.opacity=+r}function $y(e){return e>.008856451679035631?Math.pow(e,1/3):e/Hy+Fy}function Wy(e){return e>zy?e*e*e:Hy*(e-Fy)}function Uy(e){return 255*(e<=.0031308?12.92*e:1.055*Math.pow(e,1/2.4)-.055)}function Yy(e){return(e/=255)<=.04045?e/12.92:Math.pow((e+.055)/1.055,2.4)}function Ky(e,t,n,r){this.h=+e,this.c=+t,this.l=+n,this.opacity=+r}function Xy(e){if(isNaN(e.h))return new By(e.l,0,0,e.opacity);var t=e.h*Ly;return new By(e.l,Math.cos(t)*e.c,Math.sin(t)*e.c,e.opacity)}ry(By,function(e,t,n,r){return 1===arguments.length?Vy(e):new By(e,t,n,null==r?1:r)},iy(oy,{brighter(e){return new By(this.l+18*(null==e?1:e),this.a,this.b,this.opacity)},darker(e){return new By(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 Sy(Uy(3.1338561*(t=.96422*Wy(t))-1.6168667*(e=1*Wy(e))-.4906146*(n=.82521*Wy(n))),Uy(-.9787684*t+1.9161415*e+.033454*n),Uy(.0719453*t-.2289914*e+1.4052427*n),this.opacity)}})),ry(Ky,function(e,t,n,r){return 1===arguments.length?function(e){if(e instanceof Ky)return new Ky(e.h,e.c,e.l,e.opacity);if(e instanceof By||(e=Vy(e)),0===e.a&&0===e.b)return new Ky(NaN,0<e.l&&e.l<100?0:NaN,e.l,e.opacity);var t=Math.atan2(e.b,e.a)*jy;return new Ky(t<0?t+360:t,Math.sqrt(e.a*e.a+e.b*e.b),e.l,e.opacity)}(e):new Ky(e,t,n,null==r?1:r)},iy(oy,{brighter(e){return new Ky(this.h,this.c,this.l+18*(null==e?1:e),this.opacity)},darker(e){return new Ky(this.h,this.c,this.l-18*(null==e?1:e),this.opacity)},rgb(){return Xy(this).rgb()}}));var Gy=e=>()=>e;function Jy(e,t){var n=t-e;return n?function(e,t){return function(n){return e+n*t}}(e,n):Gy(isNaN(e)?t:e)}!function e(t){var n=function(e){return 1==(e=+e)?Jy: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):Gy(isNaN(t)?n:t)}}(t);function r(e,t){var r=n((e=qy(e)).r,(t=qy(t)).r),i=n(e.g,t.g),o=n(e.b,t.b),s=Jy(e.opacity,t.opacity);return function(t){return e.r=r(t),e.g=i(t),e.b=o(t),e.opacity=s(t),e+""}}return r.gamma=e,r}(1);var Zy="center",Qy="bottom";function eb(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 s=r[o];if(void 0===i[s])return n;i=i[s]}return i}[{key:"NoDataExist",alignment:Zy,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:Zy,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:Zy,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:Zy},{key:"DataRangeIncludingZero",alignment:Qy},{key:"LimitedData",alignment:Qy},{key:"NegativeOrZeroValues",alignment:Qy}].reduce(function(e,t){return e[t.key]=t,e},{});var tb,nb=["__proto__","constructor"];function rb(e,t,n){if(void 0!==e&&void 0!==t){var r=t.split("."),i=r[r.length-1];if(!nb.some(function(e){return r.includes(e)})){for(var o=e,s=0;s<r.length-1;++s){var a=r[s];void 0===o[a]&&(o[a]=Number.isNaN(+r[s+1])?{}:[]),o=o[a]}void 0!==n?o[i]=n:delete o[i]}}}function ib(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 ob(e,t){e instanceof Map?(e=[void 0,e],void 0===t&&(t=ab)):void 0===t&&(t=sb);for(var n,r,i,o,s,a=new ub(e),l=[a];n=l.pop();)if((i=t(n.data))&&(s=(i=Array.from(i)).length))for(n.children=i,o=s-1;o>=0;--o)l.push(r=i[o]=new ub(i[o])),r.parent=n,r.depth=n.depth+1;return a.eachBefore(cb)}function sb(e){return e.children}function ab(e){return Array.isArray(e)?e[1]:null}function lb(e){void 0!==e.data.value&&(e.value=e.data.value),e.data=e.data.data}function cb(e){var t=0;do{e.height=t}while((e=e.parent)&&e.height<++t)}function ub(e){this.data=e,this.depth=this.height=0,this.parent=null}ub.prototype=ob.prototype={constructor:ub,count:function(){return this.eachAfter(ib)},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,s=[o],a=[],l=-1;o=s.pop();)if(a.push(o),n=o.children)for(r=0,i=n.length;r<i;++r)s.push(n[r]);for(;o=a.pop();)e.call(t,o,++l,this);return this},eachBefore:function(e,t){for(var n,r,i=this,o=[i],s=-1;i=o.pop();)if(e.call(t,i,++s,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 ob(this).eachBefore(lb)},[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)}},tb=function(e){
|
|
24
|
+
* Licensed under the MIT license */var mm=(pm||(pm=1,function(e){!function(t,n,r,i){var o,s=["","webkit","Moz","MS","ms","o"],a=n.createElement("div"),l=Math.round,c=Math.abs,u=Date.now;function h(e,t,n){return setTimeout(b(e,n),t)}function d(e,t,n){return!!Array.isArray(e)&&(f(e,n[t],n),!0)}function f(e,t,n){var r;if(e)if(e.forEach)e.forEach(t,n);else if(e.length!==i)for(r=0;r<e.length;)t.call(n,e[r],r,e),r++;else for(r in e)e.hasOwnProperty(r)&&t.call(n,e[r],r,e)}function p(e,n,r){var i="DEPRECATED METHOD: "+n+"\n"+r+" AT \n";return function(){var n=new Error("get-stack-trace"),r=n&&n.stack?n.stack.replace(/^[^\(]+?[\n$]/gm,"").replace(/^\s+at\s+/gm,"").replace(/^Object.<anonymous>\s*\(/gm,"{anonymous}()@"):"Unknown Stack Trace",o=t.console&&(t.console.warn||t.console.log);return o&&o.call(t.console,i,r),e.apply(this,arguments)}}o="function"!=typeof Object.assign?function(e){if(e===i||null===e)throw new TypeError("Cannot convert undefined or null to object");for(var t=Object(e),n=1;n<arguments.length;n++){var r=arguments[n];if(r!==i&&null!==r)for(var o in r)r.hasOwnProperty(o)&&(t[o]=r[o])}return t}:Object.assign;var g=p(function(e,t,n){for(var r=Object.keys(t),o=0;o<r.length;)(!n||n&&e[r[o]]===i)&&(e[r[o]]=t[r[o]]),o++;return e},"extend","Use `assign`."),m=p(function(e,t){return g(e,t,!0)},"merge","Use `assign`.");function y(e,t,n){var r,i=t.prototype;(r=e.prototype=Object.create(i)).constructor=e,r._super=i,n&&o(r,n)}function b(e,t){return function(){return e.apply(t,arguments)}}function v(e,t){return"function"==typeof e?e.apply(t&&t[0]||i,t):e}function x(e,t){return e===i?t:e}function w(e,t,n){f(S(t),function(t){e.addEventListener(t,n,!1)})}function M(e,t,n){f(S(t),function(t){e.removeEventListener(t,n,!1)})}function k(e,t){for(;e;){if(e==t)return!0;e=e.parentNode}return!1}function q(e,t){return e.indexOf(t)>-1}function S(e){return e.trim().split(/\s+/g)}function _(e,t,n){if(e.indexOf&&!n)return e.indexOf(t);for(var r=0;r<e.length;){if(n&&e[r][n]==t||!n&&e[r]===t)return r;r++}return-1}function D(e){return Array.prototype.slice.call(e,0)}function C(e,t,n){for(var r=[],i=[],o=0;o<e.length;){var s=e[o][t];_(i,s)<0&&r.push(e[o]),i[o]=s,o++}return r=r.sort(function(e,n){return e[t]>n[t]}),r}function E(e,t){for(var n,r,o=t[0].toUpperCase()+t.slice(1),a=0;a<s.length;){if((r=(n=s[a])?n+o:t)in e)return r;a++}return i}var A=1;function T(e){var n=e.ownerDocument||e;return n.defaultView||n.parentWindow||t}var N="ontouchstart"in t,O=E(t,"PointerEvent")!==i,R=N&&/mobile|tablet|ip(ad|hone|od)|android/i.test(navigator.userAgent),I="touch",P="mouse",L=24,j=["x","y"],F=["clientX","clientY"];function z(e,t){var n=this;this.manager=e,this.callback=t,this.element=e.element,this.target=e.options.inputTarget,this.domHandler=function(t){v(e.options.enable,[e])&&n.handler(t)},this.init()}function H(e,t,n){var r=n.pointers.length,o=n.changedPointers.length,s=1&t&&r-o===0,a=12&t&&r-o===0;n.isFirst=!!s,n.isFinal=!!a,s&&(e.session={}),n.eventType=t,function(e,t){var n=e.session,r=t.pointers,o=r.length;n.firstInput||(n.firstInput=V(t)),o>1&&!n.firstMultiple?n.firstMultiple=V(t):1===o&&(n.firstMultiple=!1);var s=n.firstInput,a=n.firstMultiple,l=a?a.center:s.center,h=t.center=B(r);t.timeStamp=u(),t.deltaTime=t.timeStamp-s.timeStamp,t.angle=Y(l,h),t.distance=U(l,h),function(e,t){var n=t.center,r=e.offsetDelta||{},i=e.prevDelta||{},o=e.prevInput||{};1!==t.eventType&&4!==o.eventType||(i=e.prevDelta={x:o.deltaX||0,y:o.deltaY||0},r=e.offsetDelta={x:n.x,y:n.y}),t.deltaX=i.x+(n.x-r.x),t.deltaY=i.y+(n.y-r.y)}(n,t),t.offsetDirection=W(t.deltaX,t.deltaY);var d=$(t.deltaTime,t.deltaX,t.deltaY);t.overallVelocityX=d.x,t.overallVelocityY=d.y,t.overallVelocity=c(d.x)>c(d.y)?d.x:d.y,t.scale=a?function(e,t){return U(t[0],t[1],F)/U(e[0],e[1],F)}(a.pointers,r):1,t.rotation=a?function(e,t){return Y(t[1],t[0],F)+Y(e[1],e[0],F)}(a.pointers,r):0,t.maxPointers=n.prevInput?t.pointers.length>n.prevInput.maxPointers?t.pointers.length:n.prevInput.maxPointers:t.pointers.length,function(e,t){var n,r,o,s,a=e.lastInterval||t,l=t.timeStamp-a.timeStamp;if(8!=t.eventType&&(l>25||a.velocity===i)){var u=t.deltaX-a.deltaX,h=t.deltaY-a.deltaY,d=$(l,u,h);r=d.x,o=d.y,n=c(d.x)>c(d.y)?d.x:d.y,s=W(u,h),e.lastInterval=t}else n=a.velocity,r=a.velocityX,o=a.velocityY,s=a.direction;t.velocity=n,t.velocityX=r,t.velocityY=o,t.direction=s}(n,t);var f=e.element;k(t.srcEvent.target,f)&&(f=t.srcEvent.target),t.target=f}(e,n),e.emit("hammer.input",n),e.recognize(n),e.session.prevInput=n}function V(e){for(var t=[],n=0;n<e.pointers.length;)t[n]={clientX:l(e.pointers[n].clientX),clientY:l(e.pointers[n].clientY)},n++;return{timeStamp:u(),pointers:t,center:B(t),deltaX:e.deltaX,deltaY:e.deltaY}}function B(e){var t=e.length;if(1===t)return{x:l(e[0].clientX),y:l(e[0].clientY)};for(var n=0,r=0,i=0;i<t;)n+=e[i].clientX,r+=e[i].clientY,i++;return{x:l(n/t),y:l(r/t)}}function $(e,t,n){return{x:t/e||0,y:n/e||0}}function W(e,t){return e===t?1:c(e)>=c(t)?e<0?2:4:t<0?8:16}function U(e,t,n){n||(n=j);var r=t[n[0]]-e[n[0]],i=t[n[1]]-e[n[1]];return Math.sqrt(r*r+i*i)}function Y(e,t,n){n||(n=j);var r=t[n[0]]-e[n[0]],i=t[n[1]]-e[n[1]];return 180*Math.atan2(i,r)/Math.PI}z.prototype={handler:function(){},init:function(){this.evEl&&w(this.element,this.evEl,this.domHandler),this.evTarget&&w(this.target,this.evTarget,this.domHandler),this.evWin&&w(T(this.element),this.evWin,this.domHandler)},destroy:function(){this.evEl&&M(this.element,this.evEl,this.domHandler),this.evTarget&&M(this.target,this.evTarget,this.domHandler),this.evWin&&M(T(this.element),this.evWin,this.domHandler)}};var K={mousedown:1,mousemove:2,mouseup:4},X="mousedown",G="mousemove mouseup";function J(){this.evEl=X,this.evWin=G,this.pressed=!1,z.apply(this,arguments)}y(J,z,{handler:function(e){var t=K[e.type];1&t&&0===e.button&&(this.pressed=!0),2&t&&1!==e.which&&(t=4),this.pressed&&(4&t&&(this.pressed=!1),this.callback(this.manager,t,{pointers:[e],changedPointers:[e],pointerType:P,srcEvent:e}))}});var Z={pointerdown:1,pointermove:2,pointerup:4,pointercancel:8,pointerout:8},Q={2:I,3:"pen",4:P,5:"kinect"},ee="pointerdown",te="pointermove pointerup pointercancel";function ne(){this.evEl=ee,this.evWin=te,z.apply(this,arguments),this.store=this.manager.session.pointerEvents=[]}t.MSPointerEvent&&!t.PointerEvent&&(ee="MSPointerDown",te="MSPointerMove MSPointerUp MSPointerCancel"),y(ne,z,{handler:function(e){var t=this.store,n=!1,r=e.type.toLowerCase().replace("ms",""),i=Z[r],o=Q[e.pointerType]||e.pointerType,s=o==I,a=_(t,e.pointerId,"pointerId");1&i&&(0===e.button||s)?a<0&&(t.push(e),a=t.length-1):12&i&&(n=!0),a<0||(t[a]=e,this.callback(this.manager,i,{pointers:t,changedPointers:[e],pointerType:o,srcEvent:e}),n&&t.splice(a,1))}});var re={touchstart:1,touchmove:2,touchend:4,touchcancel:8};function ie(){this.evTarget="touchstart",this.evWin="touchstart touchmove touchend touchcancel",this.started=!1,z.apply(this,arguments)}function oe(e,t){var n=D(e.touches),r=D(e.changedTouches);return 12&t&&(n=C(n.concat(r),"identifier")),[n,r]}y(ie,z,{handler:function(e){var t=re[e.type];if(1===t&&(this.started=!0),this.started){var n=oe.call(this,e,t);12&t&&n[0].length-n[1].length===0&&(this.started=!1),this.callback(this.manager,t,{pointers:n[0],changedPointers:n[1],pointerType:I,srcEvent:e})}}});var se={touchstart:1,touchmove:2,touchend:4,touchcancel:8},ae="touchstart touchmove touchend touchcancel";function le(){this.evTarget=ae,this.targetIds={},z.apply(this,arguments)}function ce(e,t){var n=D(e.touches),r=this.targetIds;if(3&t&&1===n.length)return r[n[0].identifier]=!0,[n,n];var i,o,s=D(e.changedTouches),a=[],l=this.target;if(o=n.filter(function(e){return k(e.target,l)}),1===t)for(i=0;i<o.length;)r[o[i].identifier]=!0,i++;for(i=0;i<s.length;)r[s[i].identifier]&&a.push(s[i]),12&t&&delete r[s[i].identifier],i++;return a.length?[C(o.concat(a),"identifier"),a]:void 0}function ue(){z.apply(this,arguments);var e=b(this.handler,this);this.touch=new le(this.manager,e),this.mouse=new J(this.manager,e),this.primaryTouch=null,this.lastTouches=[]}function he(e,t){1&e?(this.primaryTouch=t.changedPointers[0].identifier,de.call(this,t)):12&e&&de.call(this,t)}function de(e){var t=e.changedPointers[0];if(t.identifier===this.primaryTouch){var n={x:t.clientX,y:t.clientY};this.lastTouches.push(n);var r=this.lastTouches;setTimeout(function(){var e=r.indexOf(n);e>-1&&r.splice(e,1)},2500)}}function fe(e){for(var t=e.srcEvent.clientX,n=e.srcEvent.clientY,r=0;r<this.lastTouches.length;r++){var i=this.lastTouches[r],o=Math.abs(t-i.x),s=Math.abs(n-i.y);if(o<=25&&s<=25)return!0}return!1}y(le,z,{handler:function(e){var t=se[e.type],n=ce.call(this,e,t);n&&this.callback(this.manager,t,{pointers:n[0],changedPointers:n[1],pointerType:I,srcEvent:e})}}),y(ue,z,{handler:function(e,t,n){var r=n.pointerType==I,i=n.pointerType==P;if(!(i&&n.sourceCapabilities&&n.sourceCapabilities.firesTouchEvents)){if(r)he.call(this,t,n);else if(i&&fe.call(this,n))return;this.callback(e,t,n)}},destroy:function(){this.touch.destroy(),this.mouse.destroy()}});var pe=E(a.style,"touchAction"),ge=pe!==i,me="compute",ye="auto",be="manipulation",ve="none",xe="pan-x",we="pan-y",Me=function(){if(!ge)return!1;var e={},n=t.CSS&&t.CSS.supports;return["auto","manipulation","pan-y","pan-x","pan-x pan-y","none"].forEach(function(r){e[r]=!n||t.CSS.supports("touch-action",r)}),e}();function ke(e,t){this.manager=e,this.set(t)}ke.prototype={set:function(e){e==me&&(e=this.compute()),ge&&this.manager.element.style&&Me[e]&&(this.manager.element.style[pe]=e),this.actions=e.toLowerCase().trim()},update:function(){this.set(this.manager.options.touchAction)},compute:function(){var e=[];return f(this.manager.recognizers,function(t){v(t.options.enable,[t])&&(e=e.concat(t.getTouchAction()))}),function(e){if(q(e,ve))return ve;var t=q(e,xe),n=q(e,we);return t&&n?ve:t||n?t?xe:we:q(e,be)?be:ye}(e.join(" "))},preventDefaults:function(e){var t=e.srcEvent,n=e.offsetDirection;if(this.manager.session.prevented)t.preventDefault();else{var r=this.actions,i=q(r,ve)&&!Me[ve],o=q(r,we)&&!Me[we],s=q(r,xe)&&!Me[xe];if(i){var a=1===e.pointers.length,l=e.distance<2,c=e.deltaTime<250;if(a&&l&&c)return}if(!s||!o)return i||o&&6&n||s&&n&L?this.preventSrc(t):void 0}},preventSrc:function(e){this.manager.session.prevented=!0,e.preventDefault()}};var qe=32;function Se(e){this.options=o({},this.defaults,e||{}),this.id=A++,this.manager=null,this.options.enable=x(this.options.enable,!0),this.state=1,this.simultaneous={},this.requireFail=[]}function _e(e){return 16&e?"cancel":8&e?"end":4&e?"move":2&e?"start":""}function De(e){return 16==e?"down":8==e?"up":2==e?"left":4==e?"right":""}function Ce(e,t){var n=t.manager;return n?n.get(e):e}function Ee(){Se.apply(this,arguments)}function Ae(){Ee.apply(this,arguments),this.pX=null,this.pY=null}function Te(){Ee.apply(this,arguments)}function Ne(){Se.apply(this,arguments),this._timer=null,this._input=null}function Oe(){Ee.apply(this,arguments)}function Re(){Ee.apply(this,arguments)}function Ie(){Se.apply(this,arguments),this.pTime=!1,this.pCenter=!1,this._timer=null,this._input=null,this.count=0}function Pe(e,t){return(t=t||{}).recognizers=x(t.recognizers,Pe.defaults.preset),new Le(e,t)}function Le(e,t){var n;this.options=o({},Pe.defaults,t||{}),this.options.inputTarget=this.options.inputTarget||e,this.handlers={},this.session={},this.recognizers=[],this.oldCssProps={},this.element=e,this.input=new((n=this).options.inputClass||(O?ne:R?le:N?ue:J))(n,H),this.touchAction=new ke(this,this.options.touchAction),je(this,!0),f(this.options.recognizers,function(e){var t=this.add(new e[0](e[1]));e[2]&&t.recognizeWith(e[2]),e[3]&&t.requireFailure(e[3])},this)}function je(e,t){var n,r=e.element;r.style&&(f(e.options.cssProps,function(i,o){n=E(r.style,o),t?(e.oldCssProps[n]=r.style[n],r.style[n]=i):r.style[n]=e.oldCssProps[n]||""}),t||(e.oldCssProps={}))}Se.prototype={defaults:{},set:function(e){return o(this.options,e),this.manager&&this.manager.touchAction.update(),this},recognizeWith:function(e){if(d(e,"recognizeWith",this))return this;var t=this.simultaneous;return t[(e=Ce(e,this)).id]||(t[e.id]=e,e.recognizeWith(this)),this},dropRecognizeWith:function(e){return d(e,"dropRecognizeWith",this)||(e=Ce(e,this),delete this.simultaneous[e.id]),this},requireFailure:function(e){if(d(e,"requireFailure",this))return this;var t=this.requireFail;return-1===_(t,e=Ce(e,this))&&(t.push(e),e.requireFailure(this)),this},dropRequireFailure:function(e){if(d(e,"dropRequireFailure",this))return this;e=Ce(e,this);var t=_(this.requireFail,e);return t>-1&&this.requireFail.splice(t,1),this},hasRequireFailures:function(){return this.requireFail.length>0},canRecognizeWith:function(e){return!!this.simultaneous[e.id]},emit:function(e){var t=this,n=this.state;function r(n){t.manager.emit(n,e)}n<8&&r(t.options.event+_e(n)),r(t.options.event),e.additionalEvent&&r(e.additionalEvent),n>=8&&r(t.options.event+_e(n))},tryEmit:function(e){if(this.canEmit())return this.emit(e);this.state=qe},canEmit:function(){for(var e=0;e<this.requireFail.length;){if(!(33&this.requireFail[e].state))return!1;e++}return!0},recognize:function(e){var t=o({},e);if(!v(this.options.enable,[this,t]))return this.reset(),void(this.state=qe);56&this.state&&(this.state=1),this.state=this.process(t),30&this.state&&this.tryEmit(t)},process:function(e){},getTouchAction:function(){},reset:function(){}},y(Ee,Se,{defaults:{pointers:1},attrTest:function(e){var t=this.options.pointers;return 0===t||e.pointers.length===t},process:function(e){var t=this.state,n=e.eventType,r=6&t,i=this.attrTest(e);return r&&(8&n||!i)?16|t:r||i?4&n?8|t:2&t?4|t:2:qe}}),y(Ae,Ee,{defaults:{event:"pan",threshold:10,pointers:1,direction:30},getTouchAction:function(){var e=this.options.direction,t=[];return 6&e&&t.push(we),e&L&&t.push(xe),t},directionTest:function(e){var t=this.options,n=!0,r=e.distance,i=e.direction,o=e.deltaX,s=e.deltaY;return i&t.direction||(6&t.direction?(i=0===o?1:o<0?2:4,n=o!=this.pX,r=Math.abs(e.deltaX)):(i=0===s?1:s<0?8:16,n=s!=this.pY,r=Math.abs(e.deltaY))),e.direction=i,n&&r>t.threshold&&i&t.direction},attrTest:function(e){return Ee.prototype.attrTest.call(this,e)&&(2&this.state||!(2&this.state)&&this.directionTest(e))},emit:function(e){this.pX=e.deltaX,this.pY=e.deltaY;var t=De(e.direction);t&&(e.additionalEvent=this.options.event+t),this._super.emit.call(this,e)}}),y(Te,Ee,{defaults:{event:"pinch",threshold:0,pointers:2},getTouchAction:function(){return[ve]},attrTest:function(e){return this._super.attrTest.call(this,e)&&(Math.abs(e.scale-1)>this.options.threshold||2&this.state)},emit:function(e){if(1!==e.scale){var t=e.scale<1?"in":"out";e.additionalEvent=this.options.event+t}this._super.emit.call(this,e)}}),y(Ne,Se,{defaults:{event:"press",pointers:1,time:251,threshold:9},getTouchAction:function(){return[ye]},process:function(e){var t=this.options,n=e.pointers.length===t.pointers,r=e.distance<t.threshold,i=e.deltaTime>t.time;if(this._input=e,!r||!n||12&e.eventType&&!i)this.reset();else if(1&e.eventType)this.reset(),this._timer=h(function(){this.state=8,this.tryEmit()},t.time,this);else if(4&e.eventType)return 8;return qe},reset:function(){clearTimeout(this._timer)},emit:function(e){8===this.state&&(e&&4&e.eventType?this.manager.emit(this.options.event+"up",e):(this._input.timeStamp=u(),this.manager.emit(this.options.event,this._input)))}}),y(Oe,Ee,{defaults:{event:"rotate",threshold:0,pointers:2},getTouchAction:function(){return[ve]},attrTest:function(e){return this._super.attrTest.call(this,e)&&(Math.abs(e.rotation)>this.options.threshold||2&this.state)}}),y(Re,Ee,{defaults:{event:"swipe",threshold:10,velocity:.3,direction:30,pointers:1},getTouchAction:function(){return Ae.prototype.getTouchAction.call(this)},attrTest:function(e){var t,n=this.options.direction;return 30&n?t=e.overallVelocity:6&n?t=e.overallVelocityX:n&L&&(t=e.overallVelocityY),this._super.attrTest.call(this,e)&&n&e.offsetDirection&&e.distance>this.options.threshold&&e.maxPointers==this.options.pointers&&c(t)>this.options.velocity&&4&e.eventType},emit:function(e){var t=De(e.offsetDirection);t&&this.manager.emit(this.options.event+t,e),this.manager.emit(this.options.event,e)}}),y(Ie,Se,{defaults:{event:"tap",pointers:1,taps:1,interval:300,time:250,threshold:9,posThreshold:10},getTouchAction:function(){return[be]},process:function(e){var t=this.options,n=e.pointers.length===t.pointers,r=e.distance<t.threshold,i=e.deltaTime<t.time;if(this.reset(),1&e.eventType&&0===this.count)return this.failTimeout();if(r&&i&&n){if(4!=e.eventType)return this.failTimeout();var o=!this.pTime||e.timeStamp-this.pTime<t.interval,s=!this.pCenter||U(this.pCenter,e.center)<t.posThreshold;if(this.pTime=e.timeStamp,this.pCenter=e.center,s&&o?this.count+=1:this.count=1,this._input=e,0===this.count%t.taps)return this.hasRequireFailures()?(this._timer=h(function(){this.state=8,this.tryEmit()},t.interval,this),2):8}return qe},failTimeout:function(){return this._timer=h(function(){this.state=qe},this.options.interval,this),qe},reset:function(){clearTimeout(this._timer)},emit:function(){8==this.state&&(this._input.tapCount=this.count,this.manager.emit(this.options.event,this._input))}}),Pe.VERSION="2.0.7",Pe.defaults={domEvents:!1,touchAction:me,enable:!0,inputTarget:null,inputClass:null,preset:[[Oe,{enable:!1}],[Te,{enable:!1},["rotate"]],[Re,{direction:6}],[Ae,{direction:6},["swipe"]],[Ie],[Ie,{event:"doubletap",taps:2},["tap"]],[Ne]],cssProps:{userSelect:"none",touchSelect:"none",touchCallout:"none",contentZooming:"none",userDrag:"none",tapHighlightColor:"rgba(0,0,0,0)"}},Le.prototype={set:function(e){return o(this.options,e),e.touchAction&&this.touchAction.update(),e.inputTarget&&(this.input.destroy(),this.input.target=e.inputTarget,this.input.init()),this},stop:function(e){this.session.stopped=e?2:1},recognize:function(e){var t=this.session;if(!t.stopped){var n;this.touchAction.preventDefaults(e);var r=this.recognizers,i=t.curRecognizer;(!i||i&&8&i.state)&&(i=t.curRecognizer=null);for(var o=0;o<r.length;)n=r[o],2===t.stopped||i&&n!=i&&!n.canRecognizeWith(i)?n.reset():n.recognize(e),!i&&14&n.state&&(i=t.curRecognizer=n),o++}},get:function(e){if(e instanceof Se)return e;for(var t=this.recognizers,n=0;n<t.length;n++)if(t[n].options.event==e)return t[n];return null},add:function(e){if(d(e,"add",this))return this;var t=this.get(e.options.event);return t&&this.remove(t),this.recognizers.push(e),e.manager=this,this.touchAction.update(),e},remove:function(e){if(d(e,"remove",this))return this;if(e=this.get(e)){var t=this.recognizers,n=_(t,e);-1!==n&&(t.splice(n,1),this.touchAction.update())}return this},on:function(e,t){if(e!==i&&t!==i){var n=this.handlers;return f(S(e),function(e){n[e]=n[e]||[],n[e].push(t)}),this}},off:function(e,t){if(e!==i){var n=this.handlers;return f(S(e),function(e){t?n[e]&&n[e].splice(_(n[e],t),1):delete n[e]}),this}},emit:function(e,t){this.options.domEvents&&function(e,t){var r=n.createEvent("Event");r.initEvent(e,!0,!0),r.gesture=t,t.target.dispatchEvent(r)}(e,t);var r=this.handlers[e]&&this.handlers[e].slice();if(r&&r.length){t.type=e,t.preventDefault=function(){t.srcEvent.preventDefault()};for(var i=0;i<r.length;)r[i](t),i++}},destroy:function(){this.element&&je(this,!1),this.handlers={},this.session={},this.input.destroy(),this.element=null}},o(Pe,{INPUT_START:1,INPUT_MOVE:2,INPUT_END:4,INPUT_CANCEL:8,STATE_POSSIBLE:1,STATE_BEGAN:2,STATE_CHANGED:4,STATE_ENDED:8,STATE_RECOGNIZED:8,STATE_CANCELLED:16,STATE_FAILED:qe,DIRECTION_NONE:1,DIRECTION_LEFT:2,DIRECTION_RIGHT:4,DIRECTION_UP:8,DIRECTION_DOWN:16,DIRECTION_HORIZONTAL:6,DIRECTION_VERTICAL:L,DIRECTION_ALL:30,Manager:Le,Input:z,TouchAction:ke,TouchInput:le,MouseInput:J,PointerEventInput:ne,TouchMouseInput:ue,SingleTouchInput:ie,Recognizer:Se,AttrRecognizer:Ee,Tap:Ie,Pan:Ae,Swipe:Re,Pinch:Te,Rotate:Oe,Press:Ne,on:w,off:M,each:f,merge:m,extend:g,assign:o,inherit:y,bindFn:b,prefixed:E}),(void 0!==t?t:"undefined"!=typeof self?self:{}).Hammer=Pe,e.exports?e.exports=Pe:t.Hammer=Pe}(window,document)}(gm)),gm.exports),ym=n(mm);function bm(e){e.component("event-area",{mounted(e){e.classList.add("event-area"),e.style.pointerEvents="auto",e.style.zIndex=1},render:()=>[]})}var vm={renderer:"dom",disableTriggers:!0,preferredSize:function(){return 22},render(e){const{settings:{label:t,rtl:n},layout:{dock:r}}=this.settings,i="top"!==r&&"bottom"!==r||!n?"ltr":"rtl",o=function(e,t){const n={pointerEvents:"auto",display:"flex",justifyContent:"center",alignItems:"center",color:"#7b7a78",fontStyle:"italic",fontSize:"13px"};switch(e){case"left":n.width=`${t.height}px`,n.transform=`rotate(-90deg) translate(-${t.height}px, 0)`,n.transformOrigin="top left";break;case"right":n.width=`${t.height}px`,n.transform=`rotate(90deg) translate(0, -${t.width}px)`,n.transformOrigin="top left";break;case"center":n.width=`${t.width}px`,n.height=`${t.height}px`,n.color="#595959",n.fontStyle="normal",n.fontSize="1.2em",n.textAlign="center";break;default:n.justifyContent="flex-start",n.alignItems="flex-start"}return n}(r,this.rect),s="center"===r?t:`* ${t}`,a="center"!==r?{overflow:"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis"}:{};return e("div",{style:o,dir:i},e("span",{ref:this.alignToRef,style:a,title:s},s))}};function xm(e){const t=Mp();return t.renderer.prio([e||"canvas"]),t.use(um),t.use(function(e){if("function"!=typeof e.interaction)return t=>{t.interaction("hammer",fm(e))};e.interaction("hammer",fm(Hammer))}(ym)),t.use(bm),t.component("disclaimer",vm),t}const wm={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"}}]};var Mm,km={exports:{}};var qm=(Mm||(Mm=1,function(e){self,e.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)},s=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)},a=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,c,u,h=arguments[0],d=1,f=arguments.length,p=!1;for("boolean"==typeof h&&(p=h,h=arguments[1]||{},d=2),(null==h||"object"!=typeof h&&"function"!=typeof h)&&(h={});d<f;++d)if(null!=(t=arguments[d]))for(n in t)r=l(h,n),h!==(i=l(t,n))&&(p&&i&&(s(i)||(c=o(i)))?(c?(c=!1,u=r&&o(r)?r:[]):u=r&&s(r)?r:{},a(h,{name:n,newValue:e(p,u,i)})):void 0!==i&&a(h,{name:n,newValue:i}));return h}},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)},s=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)},a=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,c,u,h=arguments[0],d=1,f=arguments.length,p=!1;for("boolean"==typeof h&&(p=h,h=arguments[1]||{},d=2),(null==h||"object"!=typeof h&&"function"!=typeof h)&&(h={});d<f;++d)if(null!=(t=arguments[d]))for(n in t)r=l(h,n),h!==(i=l(t,n))&&(p&&i&&(s(i)||(c=o(i)))?(c?(c=!1,u=r&&o(r)?r:[]):u=r&&s(r)?r:{},a(h,{name:n,newValue:e(p,u,i)})):void 0!==i&&a(h,{name:n,newValue:i}));return h}}},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:()=>Te});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],s=e;for(r=0;r<i.length-1;++r)void 0===s[i[r]]&&(s[i[r]]=Number.isNaN(+i[r+1])?{}:[]),s=s[i[r]];if(void 0!==n){var a=s[o];return s[o]=n,{updated:n,previous:a}}return delete s[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},s={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 a="".concat(" ","(").concat(" "),l="".concat(" ",")").concat(" ");function c(e){return a+e+l}function u(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(e.qLibraryId){var n=function(e,t){if(!t)return null;var n,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 s=r.qDerivedFieldData.qDerivedFieldLists[o],a=0;a<s.qFieldDefs.length;++a){var l=s.qFieldDefs[a];if(l.qName===i)return l}}return null}(e.qDef.qFieldDefs[0],t.fieldList);return r&&r.qTags.indexOf("$numeric")>-1}function h(e){return!(!e.fullAccumulation&&!e.fullRange)}function d(e,t){var n=e.crossAllDimensions;return 2===t&&n?"RowNo(Total)":"RowNo()"}function f(e){var t=function(e){return e?(e=function(e){return e.replace(/\/\*[^]*?\*\//g,"")}(e=function(e){return e.replace(/\/\/(.*)$/gm,"")}(e))).trim():""}(e),n=t.trim();return"="===n.substring(0,1)?n.substring(1).trim():n}function p(){return"[$(=Replace(GetObjectField(".concat(arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,"),']',']]'))]")}function g(e,t){var n=e.crossAllDimensions;return 2===t&&n?"Above(Total ":"Above("}function m(e){return void 0===e?")":", 0, ".concat(e,")")}function y(e){return"Replace(Replace(".concat(e,",'''',''''''),'$','$''&''')")}function b(e,t){return e?"".concat(t,'={">=$(=Min(').concat(t,"))<=$(=Max(").concat(t,'))"}'):"".concat(t,'={"=Only({1}').concat(t,")>='$(=").concat(y("MinString(".concat(t,")")),")' and Only({1}").concat(t,")<='$(=").concat(y("MaxString(".concat(t,")")),")'\"}")}function v(e){var t=e.modifier,n=void 0===t?{}:t,r=e.dimensions,i=e.dimensionAndFieldList,o=e.funcComp,s=void 0===o?"Sum":o,a=e.valueComp,l=void 0===a?"0":a;if(!n.showExcludedValues)return"";if(r&&1===r.length){var c=b(u(r[0],i),p(0));return"".concat(s,"({1<").concat(c,">}").concat(l,")")}if(r&&2===r.length){var h=u(r[0],i),d=u(r[1],i),f=p(0),g=p(1),m=b(h,f),y=b(d,g);return"".concat(s,"({1<").concat(m,",").concat(y,">}").concat(l,")")}return"".concat(s,"({1}").concat(l,")")}function x(e){return"".concat(e,"(")}function w(e){var t=e.properties,n=e.layout;return o(t,"qHyperCubeDef.qDimensions",o(n,"qHyperCube.qDimensionInfo",[])).length}const M={isFullRange:h,getNumDimensions:w,getExpressionWithExcludedComp:function(e){var t=e.expression,n=e.modifier,r=e.dimensions,i=e.dimensionAndFieldList,o=e.treatMissingAsNull,s=c(f(t));if(!n.showExcludedValues)return s;var a=v({modifier:n,dimensions:r,dimensionAndFieldList:i}),l=o?"":", 0";if(r&&1===r.length){var u=p(0);return"If(Count(".concat(u,") > 0, ").concat(s," + ").concat(a).concat(l,")")}if(r&&2===r.length){var h=p(0),d=p(1);return"If(Count(".concat(h,") * Count(").concat(d,") > 0, ").concat(s," + ").concat(a).concat(l,")")}return s},getRowNoComp:d,getNumStepComp:function(e,t){if(!h(e)){var n=e.steps;return"number"!=typeof n||Number.isNaN(n)?6:n}return d(e,t)},getAboveCompPrefix:g,getAboveCompSuffix:m,getAboveComp:function(e,t,n,r){return g(e,t)+n+m(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:v,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===w({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=p(t);if(!n.qSortByExpression&&!n.qSortByNumeric&&!n.qSortByAscii)return r;var i=["Descending","Ascending"],o=n.qSortByNumeric?"(Numeric, ".concat(i[(n.qSortByNumeric+1)/2],")"):"",s=n.qSortByAscii?"(Text, ".concat(i[(n.qSortByAscii+1)/2],")"):"";return n.qSortByNumeric&&n.qSortByAscii?"(".concat(r,", ").concat(o,", ").concat(s,")"):n.qSortByNumeric?"(".concat(r,", ").concat(o,")"):n.qSortByAscii?"(".concat(r,", ").concat(s,")"):r},simplifyExpression:f,extractInputExpression:function(e){var t=e.outputExpression;if(e.modifier){var n=t.indexOf(a);if(-1!==n){var r=t.indexOf(l);if(-1!==r)return t.substring(n+a.length,r)}}},initModifier:function(e,t){Object.keys(t).forEach(function(n){void 0===e[n]&&(e[n]=t[n])})},isNumeric:u,isApplicable:function(e){var t=e.properties,n=e.layout,r=e.minDimensions,i=void 0===r?1:r,o=e.maxDimensions,s=void 0===o?2:o;if(!t&&!n)return!0;var a=w({properties:t,layout:n});return a>=i&&a<=s},getExpressionWithMarkers:c,canExtract:function(e){var t=e.indexOf(a),n=e.indexOf(l);return t>-1&&n>-1&&t<n},getDimDefWithWrapper:p,getFieldWithWrapper:function(e){var t=e?e.replace(/]/g,"]]"):e;return"[".concat(t,"]")},generateTSDExpression:function(e,t,n){var 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=s.OPTIONS.find(function(t){return t.value===e.decomposition});return t?s.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(s.EXPRESSIONS).find(function(n){var r=e.qDef.base.qDef.toLowerCase()||e.qDef.qDef.toLowerCase();return s.EXPRESSIONS[n]&&r.includes(s.EXPRESSIONS[n].toLowerCase())&&(t=n),n}),t}};function k(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function q(e){return q="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},q(e)}var S=t().bind(null,!0),_={},D=Array.isArray;function C(e){return null!=e&&!Array.isArray(e)&&"object"===q(e)}function E(e){return void 0===e}function A(e,t){return"function"==typeof e[t]||"$$"===t.substring(0,2)||"_"===t.substring(0,1)}function T(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]=E(e[n||t])?o:e[t],e=e[n||t]}}),e}function N(e,t){var n=!0;if(C(e)&&C(t))return Object.keys(e).length===Object.keys(t).length&&(Object.keys(e).forEach(function(r){N(e[r],t[r])||(n=!1)}),n);if(D(e)&&D(t)){if(e.length!==t.length)return!1;for(var r=0,i=e.length;r<i;r+=1)if(!N(e[r],t[r]))return!1;return!0}return e===t}_.generate=function(e,t,n){n=n||"";var r=[];return Object.keys(t).forEach(function(i){var o=function(e){return e?S({},{val:e}).val:e}(t[i]),s=e[i],a="".concat(n,"/").concat(i);N(o,s)||A(t,i)||(E(s)?r.push({op:"add",path:a,value:o}):C(o)&&C(s)?r=r.concat(_.generate(s,o,a)):D(o)&&D(s)?r=r.concat(function(e,t,n){var r=[],i=e.slice(),o=-1;function s(e,t,n){if(e[n]&&E(e[n].qInfo))return null;if(e[n]&&e[n].qInfo.qId===t)return n;for(var r=0,i=e.length;r<i;r+=1)if(e[r]&&e[r].qInfo.qId===t)return r;return-1}if(N(t,i))return r;if(!E(t[0])&&E(t[0].qInfo))return r.push({op:"replace",path:n,value:t}),r;for(var a=i.length-1;a>=0;a-=1)-1===(o=s(t,i[a].qInfo&&i[a].qInfo.qId,a))?(r.push({op:"remove",path:"".concat(n,"/").concat(a)}),i.splice(a,1)):r=r.concat(_.generate(i[a],t[o],"".concat(n,"/").concat(a)));for(var l=0,c=t.length;l<c;l+=1)-1===(o=s(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}(s,o,a)):r.push({op:"replace",path:"".concat(n,"/").concat(i),value:o}))}),Object.keys(e).forEach(function(i){E(t[i])&&!A(e,i)&&r.push({op:"remove",path:"".concat(n,"/").concat(i)})}),r},_.apply=function(e,t){t.forEach(function(t){var n,r,i=T(e,t.path),o=t.path.split("/").splice(-1)[0],s=o&&Number.isNaN(+o)?i[o]:i[+o]||i,a=t.from?t.from.split("/").splice(-1)[0]:null;if("/"===t.path&&(i=null,s=e),"add"===t.op||"replace"===t.op)if(D(i))"-"===o&&(o=i.length),i.splice(+o,"add"===t.op?0:1,t.value);else if(D(s)&&D(t.value)){var l,c=t.value.slice();s.length=0,(l=s).push.apply(l,function(e){if(Array.isArray(e))return k(e)}(r=c)||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 k(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?k(e,t):void 0}}(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(C(s)&&C(t.value))n=s,Object.keys(n).forEach(function(e){Object.getOwnPropertyDescriptor(n,e).configurable&&!A(n,e)&&delete n[e]}),S(s,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 u=T(e,t.from);D(i)?i.splice(+o,0,u.splice(+a,1)[0]):(i[o]=u[a],delete u[a])}else"remove"===t.op&&(D(i)?i.splice(+o,1):delete i[o])})},_.clone=function(e){return S({},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},_.updateObject=function(e,t){Object.keys(e).length?_.apply(e,_.generate(e,t)):S(e,t)};const O=_,R=function(e,n,r){if(!e)return Promise.resolve();var i=O.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 I="accumulation";function P(e,t){var n=o(e,t);if(n)for(var r=0;r<n.length;r++)if(n[r].type===I)return n[r]}function L(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===I)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 F={translationKey:"properties.modifier.accumulation",needDimension:M.needDimension,isApplicable:function(e){var t=e.properties,n=e.layout;return M.isApplicable({properties:t,layout:n,minDimensions:1,maxDimensions:2})},generateExpression:function(e){var t=e.expression,n=e.modifier,r=e.properties,i=e.layout,s=e.numDimensions,a=e.dimensionAndFieldList;if(!n)return t;var l=s;void 0===l&&(l=M.getNumDimensions({properties:r,layout:i}));var c=o(r,"qHyperCubeDef.qDimensions",[]),u=M.getExpressionWithExcludedComp({expression:t,modifier:n,dimensions:c,dimensionAndFieldList:a}),h=M.getNumStepComp(n,l),d=M.getAboveComp(n,l,u,h),f=M.getRangeComp("RangeSum",d);if(M.needDimension({modifier:n,properties:r,layout:i})){var p=M.getDimComp(c,1),g=M.getDimComp(c,0),m=M.getAggrComp(f,p,g);f=n.showExcludedValues?M.getExcludedComp({modifier:n,dimensions:c,dimensionAndFieldList:a,valueComp:m}):m}return f},extractInputExpression:M.extractInputExpression,initModifier:function(e){M.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!M.isApplicable({properties:t.properties})}},settings:{type:"items",items:{primaryDimension:{refFn:function(t){return"".concat(L(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(L(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(L(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(L(t,e),".steps")},type:"integer",translation:t.rangeSteps||"properties.modifier.range.steps",schemaIgnore:!0,defaultValue:6,change:function(t){var n=P(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=P(t,e);return n&&!n.fullAccumulation}},showExcludedValues:{refFn:function(t){return"".concat(L(t,e),".showExcludedValues")},type:"boolean",translation:t.showExcludedValues||"properties.modifier.showExcludedValues",schemaIgnore:!0,defaultValue:!0}},show:function(e,t){return M.isApplicable({properties:t.properties})}}},show:function(t,n,r){var i=r.ext.support.modifiers;if(!Array.isArray(i)||-1===i.indexOf(I))return!1;var o=P(t,e);return o&&!o.disabled}};return n}};var z="movingAverage";function H(e,t){var n=o(e,t);if(n)for(var r=0;r<n.length;r++)if(n[r].type===z)return n[r]}function V(e,t){var n=function(e,t){var n=o(e,t);if(!n)return-1;for(var r=0;r<n.length;r++)if(n[r].type===z)return r;return-1}(e,t);return n>-1?"".concat(t,".").concat(n):t}var B={type:"movingAverage",disabled:!1,primaryDimension:0,crossAllDimensions:!1,showExcludedValues:!0,fullRange:!1,steps:6,outputExpression:"",nullSuppression:!1};const $={translationKey:"properties.modifier.movingAverage",needDimension:M.needDimension,isApplicable:function(e){var t=e.properties,n=e.layout;return M.isApplicable({properties:t,layout:n,minDimensions:1,maxDimensions:2})},generateExpression:function(e){var t,n=e.expression,r=e.modifier,i=e.properties,s=e.layout,a=e.numDimensions,l=e.dimensionAndFieldList;if(!r)return n;var c=a;void 0===c&&(c=M.getNumDimensions({properties:i,layout:s}));var u=o(i,"qHyperCubeDef.qDimensions",[]),h=r.showExcludedValues&&r.nullSuppression,d=M.getExpressionWithExcludedComp({expression:n,modifier:r,dimensions:u,dimensionAndFieldList:l,treatMissingAsNull:h}),f=M.getNumStepComp(r,c),p=M.getAboveComp(r,c,d,f);if(r.nullSuppression)t=M.getRangeComp("RangeAvg",p);else{var g=M.getRangeComp("RangeSum",p),m=function(e,t){var n=M.getRowNoComp(e,t);if(!M.isFullRange(e)){var r=e.steps,i="number"!=typeof r||Number.isNaN(r)?6:r;return"RangeMin(".concat(i,", ").concat(n,")")}return n}(r,c);t="".concat(g," / ").concat(m)}var y=t;if(M.needDimension({modifier:r,properties:i,layout:s})){var b=M.getDimComp(u,1),v=M.getDimComp(u,0),x=M.getAggrComp(y,b,v);y=r.showExcludedValues?M.getExcludedComp({modifier:r,dimensions:u,dimensionAndFieldList:l,funcComp:"Only",valueComp:x}):x}return y},extractInputExpression:M.extractInputExpression,initModifier:function(e){M.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!M.isApplicable({properties:t.properties})}},settings:{type:"items",items:{primaryDimension:{refFn:function(t){return"".concat(V(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(V(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(V(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(V(t,e),".steps")},type:"integer",translation:t.rangeSteps||"properties.modifier.range.steps",schemaIgnore:!0,defaultValue:6,change:function(t){var n=H(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=H(t,e);return n&&!n.fullRange}},showExcludedValues:{refFn:function(t){return"".concat(V(t,e),".showExcludedValues")},type:"boolean",translation:t.showExcludedValues||"properties.modifier.showExcludedValues",schemaIgnore:!0,defaultValue:!0},nullSuppression:{refFn:function(t){return"".concat(V(t,e),".nullSuppression")},type:"boolean",translation:t.showNull||"properties.dimensions.showNull",schemaIgnore:!0,defaultValue:!1,inverted:!0}},show:function(e,t){return M.isApplicable({properties:t.properties})}}},show:function(t,n,r){var i=r.ext.support.modifiers;if(!Array.isArray(i)||-1===i.indexOf(z))return!1;var o=H(t,e);return o&&!o.disabled}};return n}};var W="timeSeriesDecomposition";function U(e,t){var n=o(e,t);if(n)for(var r=0;r<n.length;r++)if(n[r].type===W)return n[r]}function Y(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===W)return r;return-1}(e,t);return n>-1?"".concat(t,".").concat(n):t}var K={type:"timeSeriesDecomposition",disabled:!1,decomposition:"",steps:2,outputExpression:""};const X={translationKey:"properties.modifier.timeSeriesDecomposition",needDimension:M.needDimension,isApplicable:function(e){var t=e.properties,n=e.layout;return M.isApplicable({properties:t,layout:n,minDimensions:1,maxDimensions:2})},generateExpression:function(e){var t=e.expression,n=e.modifier,r=e.properties;return n?M.generateTSDExpression(n,t,r):t},extractInputExpression:M.extractInputExpression,initModifier:function(e,t){M.initModifier(e,K),""===e.decomposition&&t&&(e.decomposition=M.getDecomposition(t))},propertyPanelDef:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n={type:"items",items:{disclaimer:{component:"text",translation:t.timeSeriesDecomposition||"properties.modifier.timeSeriesDecomposition",show:function(e,t){return!M.isApplicable({properties:t.properties})}},settings:{type:"items",items:{decomposition:{refFn:function(t){return"".concat(Y(t,e),".decomposition")},type:"string",translation:t.modifierTrendDecompositionDecomposition||"properties.modifier.trendDecomposition.decomposition",component:"dropdown",schemaIgnore:!0,defaultValue:t.trendDecompositionParametersDecompositionObserved||"cao.trendDecomposition.parameters.decomposition.observed",options:s.OPTIONS},steps:{refFn:function(t){return"".concat(Y(t,e),".steps")},type:"integer",translation:t.modifierTimeSeriesDecompositionPeriods||"properties.modifier.timeSeriesDecomposition.periods",schemaIgnore:!0,defaultValue:2,change:function(t,n){var r=U(t,e);if(r){var i=r.steps;r.steps="number"!=typeof i||Number.isNaN(i)?2:Math.abs(i),n.properties.qHyperCubeDef.qMeasures=n.properties.qHyperCubeDef.qMeasures.map(function(e){return e.qDef.modifiers.map(function(e){return"timeSeriesDecomposition"===e.type?e.steps=i:e.steps=e.steps,e}),e})}},show:function(t){var n=U(t,e);return n&&!n.fullRange}}},show:function(e,t){return M.isApplicable({properties:t.properties})}}},show:function(t,n,r){var i=r.ext.support.modifiers;if(!Array.isArray(i)||-1===i.indexOf(W))return!1;var o=U(t,e);return o&&!o.disabled}};return n}};var G="difference";function J(e,t){var n=o(e,t);if(n)for(var r=0;r<n.length;r++)if(n[r].type===G)return n[r]}function Z(e,t){var n=function(e,t){var n=o(e,t);if(!n)return-1;for(var r=0;r<n.length;r++)if(n[r].type===G)return r;return-1}(e,t);return n>-1?"".concat(t,".").concat(n):t}var Q={type:"difference",disabled:!1,primaryDimension:0,crossAllDimensions:!1,showExcludedValues:!0,outputExpression:""};const ee={translationKey:"properties.modifier.difference",needDimension:M.needDimension,isApplicable:function(e){var t=e.properties,n=e.layout;return M.isApplicable({properties:t,layout:n,minDimensions:1,maxDimensions:2})},extractInputExpression:M.extractInputExpression,generateExpression:function(e){var t=e.expression,n=e.modifier,r=e.properties,i=e.layout,s=e.numDimensions,a=e.dimensionAndFieldList;if(!n)return t;var l=s;void 0===l&&(l=M.getNumDimensions({properties:r,layout:i}));var c=o(r,"qHyperCubeDef.qDimensions",[]),u=M.getExpressionWithExcludedComp({expression:t,modifier:n,dimensions:c,dimensionAndFieldList:a}),h=M.getAboveComp(n,l,u),d="".concat(u," - ").concat(h);if(M.needDimension({modifier:n,properties:r,layout:i})){var f=M.getDimComp(c,1),p=M.getDimComp(c,0),g=M.getAggrComp(d,f,p);d=n.showExcludedValues?M.getExcludedComp({modifier:n,dimensions:c,dimensionAndFieldList:a,funcComp:"Only",valueComp:g}):g}return d},initModifier:function(e){Object.keys(Q).forEach(function(t){void 0===e[t]&&(e[t]=Q[t])})},enableTotalsFunction:function(){return!1},propertyPanelDef:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n={type:"items",items:{disclaimer:{component:"text",translation:t.disclaimer||"properties.modifier.difference.disclaimer",show:function(e,t){return!M.isApplicable({properties:t.properties})}},settings:{type:"items",items:{primaryDimension:{refFn:function(t){return"".concat(Z(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(Z(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(Z(t,e),".showExcludedValues")},type:"boolean",translation:t.showExcludedValues||"properties.modifier.showExcludedValues",schemaIgnore:!0,defaultValue:!0}},show:function(e,t){return M.isApplicable({properties:t.properties})}}},show:function(t,n,r){var i=r.ext.support.modifiers;if(!Array.isArray(i)||-1===i.indexOf(G))return!1;var o=J(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 se(e){return 2===e?"{1}":""}function ae(e,t,n){return 1===e?"{$<".concat(M.getFieldWithWrapper(t),"={'").concat(n,"'}>}"):""}function le(e,t){return 0===e&&t>1||2===e?"Total":""}function ce(e,t,n){return 0===e&&t>1?"<".concat(M.getDimDefWithWrapper(n),">"):""}const ue={translationKey:"properties.modifier.normalization",needDimension:function(){return!0},isApplicable:function(e){var t=e.properties,n=e.layout;return M.isApplicable({properties:t,layout:n,minDimensions:1,maxDimensions:2})},extractInputExpression:M.extractInputExpression,generateExpression:function(e){var t=e.expression,n=e.modifier,r=e.properties,i=e.layout,s=e.numDimensions,a=e.dimensionAndFieldList;if(!n)return t;var l=s;void 0===l&&(l=M.getNumDimensions({properties:r,layout:i}));var c=o(r,"qHyperCubeDef.qDimensions",[]),u=M.getExpressionWithExcludedComp({expression:t,modifier:n,dimensions:c,dimensionAndFieldList:a}),h=n.selectionScope,d=n.dimensionalScope;return function(e,t,n,r,i,o,s){var a=se(t),l=ae(t,n,r),c=""===a&&""===l?"":a||l,u=le(i,o),h=ce(i,o,s),d=function(e){for(var t=[],n=0;n<e;n++)t[n]=M.getDimDefWithWrapper(n);return t.join(", ")}(o);return"".concat(e,"/ Sum(").concat(c," ").concat(u).concat(h," Aggr(").concat(c," ").concat(e,", ").concat(d,"))")}(u,h,n.field,n.value,d,l,n.primaryDimension)},initModifier:function(e){Object.keys(oe).forEach(function(t){void 0===e[t]&&(e[t]=oe[t])})},updateModifier:function(e,t){1===(t.qDimensions?t.qDimensions.length:0)&&0===e.dimensionalScope&&(e.dimensionalScope=2)},enableTotalsFunction:function(){return!0},propertyPanelDef:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n={type:"items",items:{disclaimer:{component:"text",translation:t.disclaimer||"properties.modifier.normalization.disclaimer",show:function(e,t){return!M.isApplicable({properties:t.properties})}},settings:{type:"items",items:{selectionScope:{refFn:function(t){return"".concat(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 M.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:se,getFieldSelectionComp:ae,getTotalComp:le,getSelectedDimComp:ce};var he="qDef.base",de="qDef.qDef",fe="qDef.base.qDef",pe="qLibraryId",ge="qDef.base.qLibraryId";const me={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,ge)?ge:pe},getLibraryId:function(e){return o(e,ge)||o(e,pe)},getLabelRef:function(e){return o(e,he)?"qDef.base.qLabel":"qDef.qLabel"},getLabelExpressionRef:function(e){return o(e,he)?"qDef.base.qLabelExpression":"qDef.qLabelExpression"}};var ye="qDef.qDef",be="qDef.base.qDef",ve="qLibraryId",xe="qDef.base.qLibraryId",we="qDef.qLabel",Me="qDef.qLabelExpression",ke="qDef.base.qLabel",qe="qDef.base.qLabelExpression",Se="qDef.qAggrFunc",_e="qDef.base.qAggrFunc",De={initBase:function(e,t){(t||De.isValid(e))&&(n(e,be,o(e,ye)),n(e,xe,o(e,ve)),n(e,ke,o(e,we)),n(e,qe,o(e,Me)))},restoreBase:function(e){De.isValid(e)&&(n(e,ye,o(e,be)),n(e,ve,o(e,xe)),n(e,we,o(e,ke)),n(e,Me,o(e,qe)),o(e,Se)&&o(e,_e)&&n(e,Se,o(e,_e)),delete e.qDef.base)},isValid:function(e){var t=o(e,be),n=o(e,xe);return void 0!==t||void 0!==n}};const Ce=De;function Ee(e){return Ee="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},Ee(e)}var Ae={accumulation:F,movingAverage:$,difference:ee,normalization:ue,timeSeriesDecomposition:X};const Te={modifiers:Ae,apply:Oe,applyModifiers:Re,cleanUpMeasure:Ie,destroy:function(e){e&&Ne[e.id]&&Ne[e.id].masterItemSubscriber&&(Ne[e.id].masterItemSubscriber&&Ne[e.id].masterItemSubscriber.unsubscribe(),delete Ne[e.id])},hasActiveModifiers:Pe,getActiveModifier:Le,initBase:Ce.initBase,isSupportedModifiers:function(e){return Array.isArray(e)&&e.some(function(e){return Ae[e]})},isApplicableSupportedModifiers:function(e){var t=e.modifierTypes,n=e.properties,r=e.layout;return Array.isArray(t)&&t.some(function(e){return Ae[e]&&Ae[e].isApplicable({properties:n,layout:r})})},measureBase:me,limitedSorting:function(e){var t=e.measures,n=e.properties,r=e.layout,i=!1,o=!1;return t.forEach(function(e){var t=ze(e);Ye({modifiers:t,properties:n,layout:r})&&(i=!0,o=o||Ze({modifiers:t,properties:n,layout:r}))}),i&&!o},ifEnableTotalsFunction:je};var Ne={};function Oe(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=e.model,r=e.properties,i=e.isSnapshot,s=void 0!==i&&i,a=e.masterItem,l=!1;Ne[n.id]=Ne[n.id]||{isFirstTime:!0};var c=Ne[n.id].isFirstTime;if(Ne[n.id].isFirstTime=!1,r&&"object"===Ee(r))return Re({model:n,properties:r});var u=n?n.layout:void 0,h=o(u,"qSelectionInfo.qInSelections");if(s||h)return Promise.resolve(l);var d=o(u,"qHyperCube.qMeasureInfo"),f=Ne[n.id].lastReloadTime;if(Ne[n.id].lastReloadTime=o(n,"app.layout.qLastReloadTime"),Pe({measures:d,layout:u})){var p=function(e){var t=e.measures,n=e.layout,r=e.lastReloadTime;return o(e.model,"app.layout.qLastReloadTime")!==r&&function(e){var t=e.measures,n=e.properties,r=e.layout;return!!Array.isArray(t)&&t.some(function(e){return Ue({measure:e,properties:n,layout:r})})}({measures:t,layout:n})}({measures:d,layout:u,model:n,lastReloadTime:f});return p||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 Ye({modifiers:ze(t),layout:n})?!t.base:!!t.base}({measure:e,layout:n})}))}({measures:d,layout:u,masterItem:a,isFirstTime:c})?n.getEffectiveProperties().then(function(e){var r=t()(!0,{},e);Ve(r);var i=Qe(r);return Ke({model:n}).then(function(t){return Xe({libraryIds:i,model:n}).then(function(i){return p&&function(e){var t=e.properties;Fe(t).forEach(function(e){return function(e){var t=e.measure;if(Ue({measure:t,properties:e.properties})){var n=0,r=t.qDef.modifiers;Array.isArray(r)&&r.forEach(function(e){if("object"===Ee(e)&&!e.disabled){if(n++,"object"!==Ee(Ae[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=Ae[e.type].extractInputExpression({outputExpression:t.qDef.qDef,modifier:e});void 0!==r&&$e(t)&&M.simplifyExpression(t.qDef.base.qDef)!==M.simplifyExpression(r)&&(t.qDef.base.qDef=r)}})}}({measure:e,properties:t})})}({properties:r}),Re({model:n,oldProperties:e,properties:r,runUpdateIfChange:!0,masterItem:a,libraryItemsProps:i,dimensionAndFieldList:t})})})}):Promise.resolve(l)}return function(e){return!!Array.isArray(e)&&e.some(function(e){return"object"===Ee(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 Fe(r).forEach(function(e){return Ie(e)}),Je({oldProperties:e,newProperties:r,model:n})})}({model:n,properties:e})}):Promise.resolve(l)}function Re(e){var n=e.model,r=e.oldProperties,i=e.properties,s=e.measures,a=e.runUpdateIfChange,l=void 0!==a&&a,c=e.masterItem,u=e.libraryItemsProps,h=e.dimensionAndFieldList;void 0===r&&(r=l?t()(!0,{},i):i),Ve(i);var d=Qe(i);return et({model:n,libraryIds:d,masterItem:c}).then(function(){return function(e){var n=e.measures,r=e.properties,i=e.model,s=e.libraryItemsProps,a=e.dimensionAndFieldList;if(n||(n=Fe(r)),!n.length)return Promise.resolve();if(!Pe({measures:n,properties:r}))return n.forEach(function(e){return Ie(e)}),Promise.resolve();var l=s?void 0:Qe(r);return Ke({model:i,dimensionAndFieldList:a}).then(function(e){return Xe({libraryIds:l,model:i,libraryItemsProps:s}).then(function(i){n.forEach(function(n){Ye({modifiers:n.qDef.modifiers,properties:r})?(function(e){var n=e.measure,r=e.properties,i=e.libraryItemsProps,s=e.dimensionAndFieldList,a=0;Ce.isValid(n)||Ce.initBase(n,!0);var l=n.qDef,c=l.modifiers,u=l.base;Array.isArray(c)&&c.forEach(function(e){if("object"===Ee(e)&&!e.disabled){if(a++,"object"!==Ee(Ae[e.type]))throw new Error('Modifier "'.concat(e.type,'" is not available'));if(a>1)throw new Error("More than 1 modifier on a measure! (not yet supported)");Ae[e.type].initModifier(e,n);var l=n.qLibraryId||u&&u.qLibraryId;l?function(e){var n=e.measure,r=e.modifier,i=e.properties,o=e.dimensionAndFieldList,s=e.libraryItemsProps[e.libraryId],a=s.qMeasure.qDef,l=""===a?a:Ae[r.type].generateExpression({expression:a,modifier:r,properties:i,dimensionAndFieldList:o});r.outputExpression=l,n.qDef.qDef=r.outputExpression,(n.qDef.qLabel||s.qMeasure.qLabel)&&(n.qDef.qLabel=s.qMeasure.qLabel),(n.qDef.qLabelExpression||s.qMeasure.qLabelExpression)&&(n.qDef.qLabelExpression=s.qMeasure.qLabelExpression),n.qDef.quarantine&&n.qDef.quarantine.qNumFormat&&s.qMeasure.qNumFormat&&(n.qDef.qNumFormat=s.qMeasure.qNumFormat,n.qDef.isCustomFormatted=s.qMeasure.isCustomFormatted),delete n.qLibraryId,n.qDef.coloring=s.qMeasure.coloring,r.base=t()(!0,{},n.qDef.base)}({measure:n,modifier:e,libraryId:l,properties:r,libraryItemsProps:i,dimensionAndFieldList:s}):function(e){var n=e.measure,r=e.modifier,i=e.properties,o=e.dimensionAndFieldList;"function"==typeof Ae[r.type].updateModifier&&Ae[r.type].updateModifier(r,i.qHyperCubeDef);var s=me.getExpression(n),a=""===s?s:Ae[r.type].generateExpression({expression:s,modifier:r,properties:i,dimensionAndFieldList:o});r.outputExpression=a,n.qDef.qDef=r.outputExpression,n.qDef.base.qLabelExpression?n.qDef.qLabelExpression=n.qDef.base.qLabelExpression:n.qDef.qLabel=n.qDef.base.qLabel||s,r.base=t()(!0,{},n.qDef.base)}({measure:n,modifier:e,properties:r,dimensionAndFieldList:s}),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)):Ie(n)})})})}({measures:s,properties:i,model:n,libraryItemsProps:u,dimensionAndFieldList:h}).then(function(){return l?Je({oldProperties:r,newProperties:i,model:n}):Promise.resolve(!1)})})}function Ie(e){!function(e){var t=ze(e);return Array.isArray(t)&&t.some(function(e){return"object"===Ee(e)&&!e.disabled&&!Ae[e.type]})}(e)?Ce.restoreBase(e):delete e.qDef.base,e.qDef.coloring&&delete e.qDef.coloring,Be(e)}function Pe(e){var t=e.measures,n=e.properties,r=e.layout;return!!Array.isArray(t)&&t.some(function(e){return Ye({modifiers:ze(e),properties:n,layout:r})})}function Le(e){var t=ze(e);if(Array.isArray(t))for(var n=0;n<t.length;n++){var r=t[n];if(Ae[r.type]&&!r.disabled)return r}}function je(e){var t=Le(e);return!t||Ae[t.type].enableTotalsFunction(e)}function Fe(e){return o(e,"qHyperCubeDef.qMeasures",[]).concat(o(e,"qHyperCubeDef.qLayoutExclude.qHyperCubeDef.qMeasures",[]))}function ze(e){return e.modifiers||e.qDef&&e.qDef.modifiers}function He(e){return o(e,"outputExpression.qValueExpression.qExpr")||o(e,"outputExpression")}function Ve(e){Fe(e).forEach(function(e){return function(e){var n=Le(e);n&&(void 0!==n.outputExpression&&He(n)!==e.qDef.qDef?delete e.qDef.base:!Ce.isValid(e)&&n.base&&(e.qDef.base=t()(!0,{},n.base)))}(e)})}function Be(e){var t=ze(e);Array.isArray(t)&&t.forEach(function(t){"object"===Ee(t)&&(t.disabled||!Ae[t.type]&&He(t)!==e.qDef.qDef)&&(t.disabled=!0,delete t.base)})}function $e(e){return e.base||e.qDef&&e.qDef.base}function We(e){var t=$e(e);return e.qLibraryId||t&&t.qLibraryId}function Ue(e){var t=e.measure,n=e.properties,r=e.layout;return!We(t)&&Ye({modifiers:ze(t),properties:n,layout:r})}function Ye(e){var t=e.modifiers,n=e.properties,r=e.layout,i={};return Array.isArray(t)&&t.some(function(e){return!("object"!==Ee(e)||e.disabled||!Ae[e.type])&&(void 0===i[e.type]&&(i[e.type]=Ae[e.type].isApplicable({properties:n,layout:r})),i[e.type])})}function Ke(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 s=t.app.getFieldList().then(function(e){i.fieldList=e});return r.push(s),Promise.all(r).then(function(){return i})}function Xe(e){var t=e.libraryIds,n=e.model,r=e.libraryItemsProps;if(r)return Promise.resolve(r);var i=t.measureLibraryIds,o=t.dimensionLibraryIds,s={},a=[];return i.forEach(function(e){var t=n.app.getMeasure(e).then(function(t){return t.getProperties().then(function(t){s[e]=t})});a.push(t)}),o.forEach(function(e){var t=n.app.getDimension(e).then(function(t){return t.getProperties().then(function(t){s[e]=t})});a.push(t)}),Promise.all(a).then(function(){return s})}function Ge(e,t){if(""!==t||-1===["qFmt","qDec","qThou"].indexOf(e))return t}function Je(e){var t=e.oldProperties,n=e.newProperties,r=e.model,i=JSON.stringify(o(t,"qHyperCubeDef.qMeasures"),Ge)!==JSON.stringify(o(n,"qHyperCubeDef.qMeasures"),Ge)||JSON.stringify(o(t,"qHyperCubeDef.qLayoutExclude.qHyperCubeDef.qMeasures"),Ge)!==JSON.stringify(o(n,"qHyperCubeDef.qLayoutExclude.qHyperCubeDef.qMeasures"),Ge);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):R(t,n,r)}({model:r,oldProperties:t,newProperties:n}).then(function(){return i}):Promise.resolve(i)}function Ze(e){var t=e.modifiers,n=e.properties,r=e.layout;return Array.isArray(t)&&t.some(function(e){return"object"===Ee(e)&&!e.disabled&&Ae[e.type]&&Ae[e.type].needDimension({modifier:e,properties:n,layout:r})})}function Qe(e){var t=Fe(e),n=[],r=[],i=!1;return t.forEach(function(t){var r=ze(t);if(Ye({modifiers:r,properties:e})){var o=We(t);o&&n.push(o),i=i||Ze({modifiers:r,properties:e})}}),o(e,"qHyperCubeDef.qDimensions",[]).forEach(function(e){var t=e.qLibraryId;t&&r.push(t)}),{measureLibraryIds:n,dimensionLibraryIds:r}}function et(e){var t=e.model,n=e.libraryIds;return!e.masterItem&&n&&(n.measureLibraryIds.length||n.dimensionLibraryIds.length)?(Ne[t.id].masterItemSubscriber=Ne[t.id].masterItemSubscriber||function(e){var t=e.model,n=e.callback,r={},i={},s={},a={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&&a[n]&&a[n].forEach(function(n){t[n]=o(e,n)}),JSON.stringify(t)}function c(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 u(e,n){return t.app[n](e).then(function(t){r[e]={listener:t.layoutSubscribe(c),enabled:!1,properties:l(t.layout)}})}return{subscribe:function(e){var n=e.measureLibraryIds,o=e.dimensionLibraryIds,a=[];return function(e){var t=e.dimensionLibraryIds;i={},e.measureLibraryIds.forEach(function(e){i[e]=!0}),s={},t.forEach(function(e){s[e]=!0})}({measureLibraryIds:n,dimensionLibraryIds:o}),Object.keys(r).forEach(function(e){i[e]||s[e]||(r[e].listener.dispose(),delete r[e])}),t.app&&(Object.keys(i).forEach(function(e){i[e]&&!r[e]&&a.push(u(e,"getMeasure"))}),Object.keys(s).forEach(function(e){s[e]&&!r[e]&&a.push(u(e,"getDimension"))})),Promise.all(a)},unsubscribe:function(){Object.keys(r).forEach(function(e){r[e].listener.dispose()}),r={}}}}({model:t,callback:function(e){return Oe({model:t,masterItem:e}).then(function(){return t.app.clearUndoBuffer()})}}),Ne[t.id].masterItemSubscriber.subscribe(n)):Promise.resolve()}})(),t.default=i.default,Object.defineProperty(t,"__esModule",{value:!0})})()}},t={};function n(r){var i=t[r];if(void 0!==i)return i.exports;var o=t[r]={exports:{}};return e[r](o,o.exports,n),o.exports}n.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return n.d(t,{a:t}),t},n.d=(e,t)=>{for(var r in t)n.o(t,r)&&!n.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t);var r={};return(()=>{function e(t){var n,r=t;return r>9?(n=65+r-10)>90&&(n+=6):r="".concat(r).charCodeAt(0),[48,111,79,105,73,108].indexOf(n)>-1?e(r+1):String.fromCharCode(n)}function t(n){var r=e(n%62),i=Math.floor(n/62);return i>0?t(i)+r:r}function i(e){return i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},i(e)}n.d(r,{default:()=>Ve});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 s=r[o];if(""!==s){if(void 0===i[s]||null===i[s])return n;i=i[s]}}return i},setValue:function(e,t,n){if(null!=e&&null!=t){for(var r=t.split("."),i=r[r.length-1],o=e,s=0;s<r.length-1;++s){var a=r[s];void 0!==o[a]&&null!==o[a]||(o[a]=Number.isNaN(+r[s+1])?{}:[]),o=o[a]}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 s(e){return function(e){if(Array.isArray(e))return a(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 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}}(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 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}function l(e){return function(e){if(Array.isArray(e))return c(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(e){if("string"==typeof e)return c(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?c(e,t):void 0}}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function c(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function u(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 h={isOrderedSubset:function(e,t){if(!(e&&t&&e.length&&t.length))return!1;var n=e.indexOf(t[0]);if(-1!==n){for(var 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:u};var d=n(8),f=n.n(d);const p=function(e){var t,n=e.exportFormat,r=e.qHyperCubeDef,i=n.data[0];(t=i.dimensions).push.apply(t,s(r.qDimensions));var a,l=o.getValue(r,"qLayoutExclude.qHyperCubeDef.qDimensions");l&&(a=i.excludedDimensions).push.apply(a,s(l))},g=function(e){var t,n=e.exportFormat,r=e.qHyperCubeDef,i=n.data[0];(t=i.measures).push.apply(t,l(r.qMeasures));var s,a=o.getValue(r,"qLayoutExclude.qHyperCubeDef.qMeasures");a&&(s=i.excludedMeasures).push.apply(s,l(a))},m=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&&h.isOrderedSubset(i,r.interColumnSortOrder)&&(r.interColumnSortOrder=i.concat())},y=function(e){var t=e.exportFormat,n=e.properties;Object.keys(n).forEach(function(e){t.properties[e]=n[e]})},b=function(e){var t=e.exportFormat,n=e.properties;n.qLayoutExclude||(n.qLayoutExclude={}),n.qLayoutExclude.disabled&&(Object.keys(n.qLayoutExclude.disabled).forEach(function(e){t.properties.hasOwnProperty(e)||(t.properties[e]=n.qLayoutExclude.disabled[e])}),delete n.qLayoutExclude.disabled),n.qLayoutExclude.changed&&(function(e){Object.keys(e.qLayoutExclude.changed).forEach(function(t){e.qLayoutExclude.changed[t].to===o.getValue(e,t)&&o.setValue(e,t,e.qLayoutExclude.changed[t].from)})}(n),delete n.qLayoutExclude.changed),n.qLayoutExclude.quarantine&&!o.isEmpty(n.qLayoutExclude.quarantine)||delete n.qLayoutExclude},v=function(e){e.forEach(function(e){f().cleanUpMeasure(e),e.qDef.modifiers&&(e.store={modifiers:e.qDef.modifiers},delete e.qDef.modifiers)})};function x(e,t,n){var r,i,s=arguments.length>3&&void 0!==arguments[3]&&arguments[3],a=o.getValue(e,t);if(!o.isAtomicValue(a))try{if((i=(i=(r=JSON.stringify(a)).match(/:\{/g))?i.length:0)>2&&!s)return;a=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]=a}var w=n(909),M=n.n(w);function k(e,t){var n=M()(!0,{},t,e);return o.getValue(n,"qOtherTotalSpec.qOtherCounted")||o.setValue(n,"qOtherTotalSpec.qOtherCounted",{qv:"10"}),o.getValue(n,"qOtherTotalSpec.qOtherLimit")||o.setValue(n,"qOtherTotalSpec.qOtherLimit",{qv:"0"}),n.hasOwnProperty("othersLabel")||(n.othersLabel="Others"),n}function q(e,t){return M()(!0,{},t,e)}function S(e,t,n){return"function"==typeof e?e(t):Number.isNaN(+e)?n:e}var _=Math.pow(2,53)-1;function D(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){(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 E=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},A=function(e,t,n){t.hasOwnProperty(e)&&(n[e]=t[e])},T=function(e,t,n,r){t.hasOwnProperty(e)?n[e]=t[e]:n[e]=r},N=function(){return{qDef:{autoSort:!0,cId:"",othersLabel:"Others"},qLibraryId:"",qNullSuppression:!1,qOtherLabel:"Others",qOtherTotalSpec:{qOtherLimitMode:"OTHER_GE_LIMIT",qOtherMode:"OTHER_OFF",qOtherSortMode:"OTHER_SORT_DESCENDING",qSuppressOther:!1}}},O=function(){return{qDef:{autoSort:!0,cId:"",numFormatFromTemplate:!0},qLibraryId:"",qTrendLines:[]}},R=function(e){var t,n=e.exportFormat,r=e.maxDimensions,i=e.minDimensions,o=e.newHyperCubeDef,s=e.defaultDimension,a=n.data[0];for(t=0;t<a.dimensions.length;++t){var l=k(a.dimensions[t],s);o.qDimensions.length<r?o.qDimensions.push(l):o.qLayoutExclude.qHyperCubeDef.qDimensions.push(l)}for(t=0;t<a.excludedDimensions.length;++t){var c=k(a.excludedDimensions[t],s);o.qDimensions.length<i?o.qDimensions.push(c):o.qLayoutExclude.qHyperCubeDef.qDimensions.push(c)}},I=function(e){var t,n=e.exportFormat,r=e.maxMeasures,i=e.minMeasures,o=e.newHyperCubeDef,s=e.defaultMeasure,a=n.data[0];for(t=0;t<a.measures.length;++t){var l=q(a.measures[t],s);o.qMeasures.length<r?o.qMeasures.push(l):o.qLayoutExclude.qHyperCubeDef.qMeasures.push(l)}for(t=0;t<a.excludedMeasures.length;++t){var c=q(a.excludedMeasures[t],s);o.qMeasures.length<i?o.qMeasures.push(c):o.qLayoutExclude.qHyperCubeDef.qMeasures.push(c)}},P=function(e){var t=e.exportFormat,n=e.dataDefinition,r=void 0===n?{}:n,i=t.data[0],o=r.dimensions||{max:0},s=r.measures||{max:0},a=S(s.max,i.dimensions.length,_),l=S(s.min,i.dimensions.length,0);return{maxDimensions:S(o.max,a,_),minDimensions:S(o.min,l,0),maxMeasures:a,minMeasures:l}},L=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?(h.indexAdded(n.qInterColumnSortOrder,o),++o):(--o,h.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=M()(!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=M()(!0,{},n,i)).components&&(i.components=[]),i},F=function(e){var t=e.exportFormat,n=e.maxDimensions,r=e.minDimensions,i=e.maxMeasures,o=e.minMeasures,s=t.data[0];return s.dimensions.length>n&&n>0||s.measures.length>i&&i>0||s.excludedDimensions.length>0&&s.dimensions.length+s.excludedDimensions.length>r||s.excludedMeasures.length>0&&s.measures.length+s.excludedMeasures.length>o||!i&&s.measures.length>0||!n&&s.dimensions.length>0},z=function(e){var t=e.exportFormat,n=e.maxDimensions,r=e.minDimensions,i=e.maxMeasures,o=e.minMeasures,s=e.newHyperCubeDef,a=t.data[0];s.qLayoutExclude||(s.qLayoutExclude={}),s.qLayoutExclude.qHyperCubeDef||(s.qLayoutExclude.qHyperCubeDef={}),(a.dimensions.length>n&&n>0||a.excludedDimensions&&a.excludedDimensions.length&&a.dimensions.length+a.excludedDimensions.length>r)&&(s.qLayoutExclude.qHyperCubeDef.qDimensions||(s.qLayoutExclude.qHyperCubeDef.qDimensions=[])),(a.measures.length>i&&i>0||a.excludedMeasures&&a.excludedMeasures.length&&a.measures.length+a.excludedMeasures.length>o)&&(s.qLayoutExclude.qHyperCubeDef.qMeasures||(s.qLayoutExclude.qHyperCubeDef.qMeasures=[])),!i&&a.measures.length&&(s.qLayoutExclude.qHyperCubeDef.qMeasures||(s.qLayoutExclude.qHyperCubeDef.qMeasures=[])),!n&&a.dimensions.length&&(s.qLayoutExclude.qHyperCubeDef.qDimensions||(s.qLayoutExclude.qHyperCubeDef.qDimensions=[]))},H=function(e){var t,n=e.newProperties,r=e.dataDefinition,i=e.hypercubePath;if(r.dimensions&&"function"==typeof r.dimensions.added){var s=o.getValue(n,i||"").qHyperCubeDef,a=function(e){if(Array.isArray(e))return D(e)}(t=s.qDimensions)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(t)||function(e,t){if(e){if("string"==typeof e)return D(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?D(e,t):void 0}}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}();s.qDimensions=[],a.forEach(function(e){s.qDimensions.push(e),r.dimensions.added(e,n)})}},V=function(e){var t,n=e.newProperties,r=e.dataDefinition,i=e.hypercubePath;if(r.measures&&"function"==typeof r.measures.added){var s=o.getValue(n,i||"").qHyperCubeDef,a=function(e){if(Array.isArray(e))return C(e)}(t=s.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 C(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?C(e,t):void 0}}(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.")}();s.qMeasures=[],a.forEach(function(e){s.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 W={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}(),s=t.qProperty,a=o.getValue(s,n||""),l=a.qHyperCubeDef;return l.qInterColumnSortOrder||(l.qInterColumnSortOrder=[]),p({exportFormat:i,qHyperCubeDef:l}),g({exportFormat:i,qHyperCubeDef:l}),m({exportFormat:i,qHyperCubeDef:l}),delete l.qLayoutExclude,y({exportFormat:i,properties:s}),n&&(i.properties.qHyperCubeDef=l,delete a.qHyperCubeDef),b({exportFormat:i,properties:s}),r||v(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,s=void 0===i?{}:i,a=e.defaultPropertyValues,l=void 0===a?{}:a,c=e.hypercubePath,u=e.extension,h=e.supportedFilters,d=void 0===h||h,f=e.isHCModifierSupported,p=void 0===f||f,g={qChildren:[]},m=j({exportFormat:t,initialProperties:r,hypercubePath:c}),y=o.getValue(r,c||"").qHyperCubeDef,b=o.getValue(m,c||"").qHyperCubeDef,v=P({exportFormat:t,dataDefinition:s}),x=v.maxDimensions,w=v.minDimensions,M=v.maxMeasures,k=v.minMeasures,q=l.defaultDimension,S=void 0===q?N():q,_=l.defaultMeasure,D=void 0===_?O():_;b.qDimensions.length=0,b.qMeasures.length=0,F({exportFormat:t,maxDimensions:x,minDimensions:w,maxMeasures:M,minMeasures:k})&&z({exportFormat:t,maxDimensions:x,minDimensions:w,maxMeasures:M,minMeasures:k,newHyperCubeDef:b}),R({exportFormat:t,maxDimensions:x,minDimensions:w,newHyperCubeDef:b,defaultDimension:S}),I({exportFormat:t,maxMeasures:M,minMeasures:k,newHyperCubeDef:b,defaultMeasure:D}),H({newProperties:m,dataDefinition:s,hypercubePath:c}),V({newProperties:m,dataDefinition:s,hypercubePath:c}),L({exportFormat:t,newHyperCubeDef:b}),A("qMaxStackedCells",y,b),A("qNoOfLeftDims",y,b),T("qInitialDataFetch",y,b,[{qTop:0,qLeft:0,qWidth:0,qHeight:0}]),T("qMode",y,b,"S"),T("qReductionMode",y,b,"N"),T("qSortbyYValue",y,b),T("qIndentMode",y,b),T("qShowTotalsAbove",y,b),E(m,t,r),g.qProperty=m;var C=o.getValue(u||{},"support.modifiers");return B({measures:b.qMeasures,modifierTypes:C}),d&&$(g.qProperty,"storedFilters"),"S"===b.qMode&&p&&$(g.qProperty,"dynamicScript"),g}};var U={cellBackgroundColor:!0,cellForegroundColor:!0,colorByAlternative:!0,colorByExpression:!0,tooltip:!0,urlLabel:!0,url:!0};function Y(e,t,n,r){t=t||[];var i=u(e,r,n),o=u(t,r,n);if(-1!==i&&-1===o){var s=e.splice(i,1);t.push(s[0])}return t}function K(e,t){return e.length!==t}const X={create:function(e,t){if(!e||!U[e])throw new Error("Attribute Expressions Util: ID required");var n={};return t&&Object.keys(t).forEach(function(e){n[e]=t[e]}),n.id=e,n.qAttribute=!0,n},moveByIdFromGroup:function(e,t,n,r,i){n=n||"qAttributeExpressions",i=i||"id";for(var o=0;o<e.length;o++){var s=e[o][n],a=t.length;if(Y(s,t,r,i),K(t,a))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"}},G={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}},J={colorModeOptions:{primary:function(){return!0},dimension:function(e){return G.getNumDimensions(e)>0&&G.getNumMeasures(e)<=1},multiColor:function(e){return G.getNumMeasures(e)>1},measure:function(e){return G.getNumDimensions(e)>0},expression:function(e){return G.getNumMeasures(e)>=1}}},Z={colorModeOptions:{primary:function(){return!0},dimension:function(){return!0},multiColor:function(){return!1},measure:function(){return!0},expression:function(e){return G.getNumMeasures(e)>=1}}};var Q={scatterplot:Z,"sn-scatter-plot":Z,piechart:{colorModeOptions:{primary:function(){return!0},dimension:function(){return!0},multiColor:function(){return!1},measure:function(){return!0},expression:function(e){return G.getNumMeasures(e)>=1}}},linechart:{colorModeOptions:{primary:function(){return!0},dimension:function(e){return G.getNumDimensions(e)>1},multiColor:function(e){return G.getNumMeasures(e)>1},measure:function(e){return G.getNumDimensions(e)<=1},expression:function(e){return G.getNumMeasures(e)>=1}}},map:{colorModeOptions:{primary:function(){return!0},dimension:function(e){return G.getNumDimensions(e)>=1},multiColor:function(e){return G.getNumMeasures(e)>1},measure:function(e){return G.getNumDimensions(e)>=1},expression:function(e){return G.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 G.getNumDimensions(e)>=1}}}};function ee(e,t,n){if(Array.isArray(e[t])){var r=h.findIndexByPropertyValue(e[t],"id",n);r>=0&&e[t].splice(r,1)}else e[t]=[]}function te(e,t){var n=X.IDMAP.COLOR_BY_ALTERNATIVE;e.forEach(function(e){ee(e,"qAttributeDimensions",n),ee(e,"qAttributeExpressions",n)}),t.forEach(function(e){ee(e,"qAttributeDimensions",n),ee(e,"qAttributeExpressions",n)})}function ne(e,t){if(t){var n="="===t.charAt(0);e.color.altLabel=n?{qStringExpression:{qExpr:t.substr(1)}}:t}}function re(e){var t=e.properties,n=e.isDimension,r=e.dimensions,i=e.excludedDimensions,s=e.measures,a=e.label;te(r,i);var l=r[r.length-1];if(l){var c=n?o.getValue(t,"color.byDimDef"):o.getValue(t,"color.byMeasureDef"),u=o.getValue(t,"color.formatting.qNumFormat"),d=o.getValue(t,"color.formatting.isCustomFormatted");if(c){var f=X.create(X.IDMAP.COLOR_BY_ALTERNATIVE);switch(c.type){case"expression":!function(e){var t=e.attributeExpression,n=e.label,r=e.item,i=e.isDimension,o=e.qNumFormat,s=e.isCustomFormatted;t.label=n||r.label,i?t.qDef=r.key:(t.qExpression=r.key,o&&(t.qNumFormat=o,t.isCustomFormatted=s)),t.matchMeasure=r.activeMeasureIndex,t.label&&"="===t.label.charAt(0)&&(t.labelExpRef="color.altLabel")}({attributeExpression:f,label:a,item:c,isDimension:n,qNumFormat:u,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=h.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:s,item:c,isDimension:n,qNumFormat:u,isCustomFormatted:d})}n?(f.qSortBy={qSortByAscii:1},l.qAttributeDimensions.push(f)):l.qAttributeExpressions.push(f)}}}function ie(e,t,n,r){var i,o,s,a={};switch(e){case"dimension":n.qLibraryId?(a.type="dimension",a.name=n.qLibraryId,a.id=n.qLibraryId):(a.type="field",t?(a.name=n.label||n.qDef,a.id=n.qDef):(a.name=n.qDef.qFieldDefs[0],a.label=(s=n.qDef).qLabelExpression?s.qLabelExpression:s.qFieldLabels&&s.qFieldLabels[0]?s.qFieldLabels[0]:s.qFieldDefs[0]));break;case"measure":i=function(e,t){return t?e.qLibraryId:f().measureBase.getLibraryId(e)}(n,t),i?(a.type="measure",a.name=i,a.id=i,o=function(e,t){return f().hasActiveModifiers({measures:[e]})&&t?e.qDef.qDef:void 0}(n,r),o&&(a.expression=o)):(a.type="expression",t?(a.name=n.label||n.qExpression,a.id=n.qExpression):(a.name=n.qDef.qDef,a.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 a}const oe={useMasterNumberFormat:function(e){e.quarantine={qNumFormat:e.qNumFormat||{},isCustomFormatted:e.isCustomFormatted||!1},e.qNumFormat=null,e.isCustomFormatted=void 0}};function se(e,t,n,r){var i=t.type,o=e.color,s=o.mode,a=G.getItemLabel(t);switch(ne(e,a||""),i){case"field":s="byDimension",o.byDimDef={label:t.label||G.wrapFieldName(t.name),key:G.wrapFieldName(t.name),type:"expression",activeDimensionIndex:t.activeDimensionIndex};break;case"expression":s="byMeasure",o.byMeasureDef={label:a,key:t.name,type:"expression",activeMeasureIndex:t.activeMeasureIndex};break;case"dimension":s="byDimension",o.byDimDef={label:t.name,key:t.id,type:"libraryItem",activeDimensionIndex:t.activeDimensionIndex};break;case"measure":s="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=s}function ae(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"),[]),s=o.getValue(e,"color.byDimDef");if(s&&ne(e,s.label),function(e){return!!(e&&e.activeDimensionIndex>-1)}(s))!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,se(e,i)}(e,t);else if(function(e){return!e||!e.key}(s)&&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("."),s=Number(i[1]),a=o.getValue(t,"layers.".concat(s,".type"));return 2===e.length&&"map"===r&&"point"===a}(n,e,t)?0:n.length-1],i=X.IDMAP.COLOR_BY_ALTERNATIVE,s=h.findItemByPropertyValue(r.qAttributeDimensions,"id",i);return se(e,ie("dimension",!!s,s||r)),!!s}(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)},ce=function(e,t){var n={primary:!0};if(e){var r=(Q[t]||J).colorModeOptions||J.colorModeOptions;n.byDimension=r.dimension(e),n.byMeasure=r.measure(e),n.byMultiple=r.multiColor(e),n.byExpression=r.expression(e)}return n},ue=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))},he=function(e,t){var n,r=o.getValue(e,"color.mode"),i=o.getValue(e,"color.auto"),s=o.getValue(e,"".concat(t,"qDimensions"),[]),a=o.getValue(e,"".concat(t,"qMeasures"),[]),l=o.getValue(e,"".concat(t,"qLayoutExclude.qHyperCubeDef.qDimensions"),[]);i?te(s,l):!(n={auto:i,colorMode:r,dimensions:s}).auto&&"byDimension"===n.colorMode&&n.dimensions.length>0?ae(e,t):function(e){var t=e.auto,n=e.colorMode,r=e.dimensions,i=e.measures,s=e.properties,a=o.getValue(s,"visualization");return!(t||"byMeasure"!==n||!r.length||"map"!==a&&!i.length)}({auto:i,colorMode:r,dimensions:s,measures:a,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"),[]),s=o.getValue(e,"color.byMeasureDef");if(s&&ne(e,s.label),function(e){return!!(e&&e.activeMeasureIndex>-1)}(s))!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,se(e,i)}}(e,t);else if(function(e,t){return(!e||!e.key)&&t.length>0}(s,r)&&function(e,t){var n=o.getValue(e,"".concat(t,"qDimensions"),[]),r=o.getValue(e,"".concat(t,"qMeasures"),[]),i=n[n.length-1],s=X.IDMAP.COLOR_BY_ALTERNATIVE,a=h.findItemByPropertyValue(i.qAttributeExpressions,"id",s);return se(e,ie("measure",!!a,a||r[0])),!!a}(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"),[]),s=o.getValue(e,"".concat(t,"qLayoutExclude.qHyperCubeDef.qDimensions"),[]);"byMultiple"===n&&i.length<2&&o.setValue(e,"color.mode","primary"),te(r,s)}(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},pe=function(e){var t=o.getValue(e,"qHyperCubeDef.qMeasures.0.qAttributeExpressions",[]),n=o.getValue(e,"color.colorExpression","");t.splice(0,0,{qExpression:n,id:"colorByExpression"}),o.setValue(e,"qHyperCubeDef.qMeasures.0.qAttributeExpressions",t)},ge=function(e){o.setValue(e,"color.mode","primary"),o.setValue(e,"color.auto",!0)},me=function(e){var t=o.getValue(e,"qHyperCubeDef.qDimensions",[]),n=o.getValue(e,"color.persistent",!1);return t.length>1&&!n},ye={exportProperties:function(e){var t=e.propertyTree,n=e.hypercubePath,r=e.viewDataMode,i=W.exportProperties({propertyTree:t,hypercubePath:n,viewDataMode:r}),o=i.data[0],s=o.dimensions.concat(o.excludedDimensions),a=o.measures.concat(o.excludedMeasures),l=X.IDMAP,c=l.COLOR_BY_ALTERNATIVE,u=l.COLOR_BY_EXPRESSION;return X.moveByIdFromGroup(s,[],"qAttributeDimensions",c),X.moveByIdFromGroup(s,[],"qAttributeExpressions",c),X.moveByIdFromGroup(a,[],"qAttributeExpressions",u),i},importProperties:function(e){var t=e.exportFormat,n=e.initialProperties,r=e.dataDefinition,i=e.defaultPropertyValues,s=e.hypercubePath,a=e.extension,l=e.supportedFilters,c=e.isHCModifierSupported,u=W.importProperties({exportFormat:t,initialProperties:n,dataDefinition:r,defaultPropertyValues:i,hypercubePath:s,extension:a,supportedFilters:l,isHCModifierSupported:c}),h=u.qProperty,d=o.getValue(h,"visualization"),f=o.getValue(h,"qHyperCubeDef.qDimensions",[]),p=o.getValue(h,"color.mode",""),g=o.getValue(h,"color.auto",""),m=ce(h,d),y=ue({canColorBy:m,autoColor:g,colorMode:p,dimensions:f});return m[p]?fe({shouldUpdateColorBy:y,properties:h})&&pe(h):ge(h),y&&he(h,"qHyperCubeDef."),me(h)&&le(h,"color.persistent",!0),de(f),u}};var be=["bar","marker","line"];const ve=function(e){var t=e.initialProperties,n=e.properties;t.measureAxis&&void 0===t.measureAxis.autoMinMax?$(n,"unsupportedAutoMinMax")||M()(n.measureAxis,t.measureAxis):$(n,"supportedAutoMinMax")||M()(n.measureAxis,t.measureAxis)},xe=function(e){var t,n=e.exportFormat,r=e.initialProperties,i=e.properties,o=e.measureType,s=i.qHyperCubeDef,a=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}}),be.includes(r)&&t[i].type[r]++,t[i].type.total++}}),t}(s);l.length?(o&&(t=l.filter(function(e){return e.type[o]>0}).sort(function(e,t){return t.type[o]-e.type[o]})),t&&t.length||(t=l.sort(function(e,t){return t.type.total-e.type.total})),t&&t[0]&&M()(a,n.properties.measureAxes[t[0].axis])):M()(a,n.properties.measureAxes[0])}},we=function(e){if(e.qDimensions.length>1){var t=e.qInterColumnSortOrder.indexOf(0);if(0!==t){var n=e.qInterColumnSortOrder[0];e.qInterColumnSortOrder[0]=0,e.qInterColumnSortOrder[t]=n}}},Me={exportProperties:function(e){var t=e.propertyTree,n=e.hypercubePath,r=e.viewDataMode,i=e.supportedAutoMinMax,o=void 0===i||i,s=ye.exportProperties({propertyTree:t,hypercubePath:n,viewDataMode:r}),a=s.properties;return o?(x(a,"measureAxis.min","supportedAutoMinMax"),x(a,"measureAxis.max","supportedAutoMinMax")):(x(a,"measureAxis.min","unsupportedAutoMinMax"),x(a,"measureAxis.max","unsupportedAutoMinMax")),s},importProperties:function(e){var t=e.exportFormat,n=e.initialProperties,r=e.dataDefinition,i=e.defaultPropertyValues,o=e.hypercubePath,s=e.measureType,a=e.extension,l=e.supportedFilters,c=e.isHCModifierSupported,u=ye.importProperties({exportFormat:t,initialProperties:n,dataDefinition:r,defaultPropertyValues:i,hypercubePath:o,extension:a,supportedFilters:l,isHCModifierSupported:c}),h=u.qProperty;return ve({initialProperties:n,properties:h}),xe({exportFormat:t,initialProperties:n,properties:h,measureType:s}),we(h.qHyperCubeDef),h.qHyperCubeDef.qColumnOrder=[],h.qHyperCubeDef.columnOrder=[],u}};function ke(e,t,n){return"qLayoutExclude.quarantine.".concat(e,".").concat(t,".").concat(n)}function qe(e){var t=e.properties,n=e.arrayPath,r=e.quarantineName,i=e.arrayName,s=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,s=e.itemPath,a=o.getValue(i,s);if(void 0!==a){var l=o.getValue(i,"qDef.cId");l||(l=o.generateId(),o.setValue(i,"qDef.cId",l));var c=ke(n,r,l);o.setValue(t,c,a),o.setValue(i,s,void 0)}}({properties:t,quarantineName:r,arrayName:i,item:e,itemPath:s})})}function Se(e){var t=e.properties,n=e.arrayPath,r=e.quarantineName,i=e.arrayName,s=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,s=e.itemPath,a=o.getValue(i,"qDef.cId");if(a){var l=ke(n,r,a),c=o.getValue(t,l);void 0!==c&&(o.setValue(i,s,c),o.setValue(t,l,void 0))}}({properties:t,quarantineName:r,arrayName:i,item:e,itemPath:s})})}var _e="qHyperCubeDef.qMeasures",De="conditionalColoring",Ce="measures",Ee="qDef.conditionalColoring";const Ae={quarantine:function(e){qe({properties:e,arrayPath:_e,quarantineName:De,arrayName:Ce,itemPath:Ee})},unquarantine:function(e){Se({properties:e,arrayPath:_e,itemPath:Ee,arrayName:Ce,quarantineName:De})}};var Te="qHyperCubeDef.qMeasures",Ne="measures",Oe="qHyperCubeDef.qDimensions",Re="dimensions",Ie="qHyperCubeDef.qLayoutExclude.qHyperCubeDef.qMeasures",Pe="alternativeMeasures",Le="qHyperCubeDef.qLayoutExclude.qHyperCubeDef.qDimensions",je="alternativeDimensions",Fe="qCalcCondition",ze="conditionalShowHide";const He={quarantine:function(e){qe({properties:e,arrayPath:Te,quarantineName:ze,arrayName:Ne,itemPath:Fe}),qe({properties:e,arrayPath:Oe,quarantineName:ze,arrayName:Re,itemPath:Fe})},unquarantine:function(e){Se({properties:e,arrayPath:Te,quarantineName:ze,arrayName:Ne,itemPath:Fe}),Se({properties:e,arrayPath:Oe,quarantineName:ze,arrayName:Re,itemPath:Fe})},quarantineAlternative:function(e){qe({properties:e,arrayPath:Ie,quarantineName:ze,arrayName:Pe,itemPath:Fe}),qe({properties:e,arrayPath:Le,quarantineName:ze,arrayName:je,itemPath:Fe})},unquarantineAlternative:function(e){Se({properties:e,arrayPath:Ie,quarantineName:ze,arrayName:Pe,itemPath:Fe}),Se({properties:e,arrayPath:Le,quarantineName:ze,arrayName:je,itemPath:Fe})}},Ve={hypercube:W,colorChart:ye,axisChart:Me,quarantineProperty:x,unquarantineProperty:$,quarantineArrayProp:qe,unquarantineArrayProp:Se,conditionalColoring:Ae,conditionalShow:He}})(),r.default})()}(km)),km.exports),Sm=n(qm);const _m={AUTO:!0,BIN_COUNT:10,BIN_SIZE:10,LABEL:"x",OFFSET:0,COUNT_DISTINCT:!1,BIN_MODE:"maxCount"};Object.freeze(_m);const Dm={version:"1.0.4",qHyperCubeDef:{qDimensions:[],qMeasures:[],qMode:"S",qAlwaysFullyExpanded:!0,qSuppressZero:!1,qSuppressMissing:!0},bins:{auto:_m.AUTO,binCount:"",binSize:_m.BIN_SIZE,offset:_m.OFFSET,countDistinct:_m.COUNT_DISTINCT,binMode:_m.BIN_MODE},color:{bar:{paletteColor:{index:6,color:"#4477aa"}}},dataPoint:{showLabels:!1},dimensionAxis:{dock:"near",label:"auto",show:"all"},measureAxis:{autoMinMax:!0,dock:"near",label:"",max:10,min:0,minMax:"min",show:"all",spacing:1},gridlines:{auto:!0,spacing:2},refLine:{refLines:[]},sorting:{autoSort:!0},showTitles:!0,subtitle:"",title:"",footnote:""};function Cm(e){const{translator:t}=e;return{path:"/qHyperCubeDef",dimensions:{min:1,max:1,description:()=>t.get("Visualization.Histogram.Binning")},measures:{min:0,max:0}}}function Em(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function Am(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 Tm(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,s,a=[],l=!0,c=!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)&&(a.push(r.value),a.length!==t);l=!0);}catch(e){c=!0,i=e}finally{try{if(!l&&null!=n.return&&(s=n.return(),Object(s)!==s))return}finally{if(c)throw i}}return a}}(e,t)||Om(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 Nm(e){return function(e){if(Array.isArray(e))return Em(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||Om(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 Om(e,t){if(e){if("string"==typeof e)return Em(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)?Em(e,t):void 0}}var Rm,Im="top",Pm="top-right",Lm="right",jm="bottom-right",Fm="bottom",zm="bottom-left",Hm="left",Vm="top-left";Am(Am(Am(Am(Am(Am(Am(Am(Am(Am(Rm={},"equal-equal",[Im,Fm]),"equal-higher",[Fm,jm]),"equal-lower",[Im,Pm]),"equal-void",[Im,Fm]),"higher-equal",[Hm,zm,Im,Pm]),"higher-higher-acute",[Fm,zm,Hm,Pm]),"higher-higher-obtuse",[Fm,Im]),"higher-lower-negative",[Im,Pm,Lm]),"higher-lower-positive",[Fm,zm,Hm]),"higher-void",[Im]),Am(Am(Am(Am(Am(Am(Am(Am(Am(Am(Rm,"lower-equal",[Im]),"lower-higher-negative",[Im,Vm]),"lower-higher-positive",[jm]),"lower-lower-acute",[Im,Vm,Hm,Pm,Lm]),"lower-lower-obtuse",[Im,Fm]),"lower-void",[Im]),"void-equal",[Im]),"void-higher",[Im,Fm]),"void-lower",[Im,Fm,Hm]),"void-void",[Im]),Am(Rm,"unclassified",[Im,Fm,Lm,Hm,Pm,jm,zm,Vm]);var Bm=["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"],$m=["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 Wm=function(e){return{value:e,label:e.charAt(0).toUpperCase()+e.slice(1),groupHeader:!1,disabled:!1,styles:{fontFamily:e}}};function Um(e){var t=e.theme,n=e.translator,r=e.defaultValue,i=e.flags,o=[],s=t.getStyle("","","fontFamilies");return Array.isArray(s)&&s.length?o.push.apply(o,Nm(new Set([r].concat(Nm(s.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(Nm(o.map(function(e){return Wm(e)})),[{value:"DefaultHeader",label:n.get("properties.allFonts"),metaText:n.get("properties.default"),groupHeader:!0}],Nm(function(e){return null!=e&&e.isEnabled("PS_20852_WYSIWYG_FONT_SUPPORT")?$m:Bm}(i).map(function(e){return Wm(e)})))}function Ym(e){var t=e.theme,n=e.translator,r=e.id,i=e.path,o=e.flags,s=function(){return t.getStyle(r,i,"fontFamily")};return{getDefaultValue:function(){return s()},getOptions:function(){return Um({theme:t,translator:n,defaultValue:s(),flags:o})}}}var Km=["10px","11px","12px","13px","14px","15px","16px","17px","18px","19px","20px","21px","22px","23px","24px"],Xm=function(e){return{value:e,label:e,groupHeader:!1,disabled:!1}};function Gm(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,Nm(new Set([n].concat(Nm(i))))):r.push(n),[{value:"ThemeHeader",label:t.get("properties.themeFontSizes"),metaText:t.get("properties.theme"),groupHeader:!0}].concat(Nm(r.map(function(e){return Xm(e)})),[{value:"DefaultHeader",label:t.get("properties.allFontSizes"),metaText:t.get("properties.default"),groupHeader:!0}],Nm(Km.map(function(e){return Xm(e)})))}({theme:t,translator:n,defaultValue:o()})}}}function Jm(e){var t=e.theme,n=e.translator,r=e.id,i=e.path;return{fontFamily:Ym({theme:t,translator:n,id:r,path:i,flags:e.flags}),fontSize:Gm({theme:t,translator:n,id:r,path:i})}}var Zm,Qm,ey=["__proto__","constructor"],ty=function(e){if(ey.some(function(t){return e.includes(t)}))throw new Error("font-resolver: Forbidden property.")};function ny(e){var t=e.theme,n=e.translator,r=e.config,i=void 0===r?{}:r,o=e.flags,s=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}),a=s.id,l=s.paths,c={};l.forEach(function(e){var r=e.split(".");ty(r);for(var i=c,s=0;s<r.length;s++){var l=r[s];s===r.length-1?i[l]=Jm({theme:t,translator:n,id:a,path:e,flags:o}):void 0===i[l]&&(i[l]={}),i=i[l]}});var u=function(e){var t=e.split(".");ty(t);for(var n=c,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 c.getDefaultValue=function(e){return u(e).getDefaultValue()},c.getOptions=function(e){return u(e).getOptions()},c}var ry,iy=function(){if(Qm)return Zm;Qm=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)},s=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},a=function(t,n){if("__proto__"===n){if(!e.call(t,n))return;if(r)return r(t,n).value}return t[n]};return Zm=function e(){var t,n,r,l,c,u,h=arguments[0],d=1,f=arguments.length,p=!1;for("boolean"==typeof h&&(p=h,h=arguments[1]||{},d=2),(null==h||"object"!=typeof h&&"function"!=typeof h)&&(h={});d<f;++d)if(null!=(t=arguments[d]))for(n in t)r=a(h,n),h!==(l=a(t,n))&&(p&&l&&(o(l)||(c=i(l)))?(c?(c=!1,u=r&&i(r)?r:[]):u=r&&o(r)?r:{},s(h,{name:n,newValue:e(p,u,l)})):void 0!==l&&s(h,{name:n,newValue:l}));return h},Zm}();function oy(e,t,n){e.prototype=t.prototype=n,n.constructor=e}function sy(e,t){var n=Object.create(e.prototype);for(var r in t)n[r]=t[r];return n}function ay(){}(ry=iy)&&ry.__esModule&&Object.prototype.hasOwnProperty.call(ry,"default")&&ry.default;var ly=1/.7,cy="\\s*([+-]?\\d+)\\s*",uy="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",hy="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",dy=/^#([0-9a-f]{3,8})$/,fy=new RegExp(`^rgb\\(${cy},${cy},${cy}\\)$`),py=new RegExp(`^rgb\\(${hy},${hy},${hy}\\)$`),gy=new RegExp(`^rgba\\(${cy},${cy},${cy},${uy}\\)$`),my=new RegExp(`^rgba\\(${hy},${hy},${hy},${uy}\\)$`),yy=new RegExp(`^hsl\\(${uy},${hy},${hy}\\)$`),by=new RegExp(`^hsla\\(${uy},${hy},${hy},${uy}\\)$`),vy={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 xy(){return this.rgb().formatHex()}function wy(){return this.rgb().formatRgb()}function My(e){var t,n;return e=(e+"").trim().toLowerCase(),(t=dy.exec(e))?(n=t[1].length,t=parseInt(t[1],16),6===n?ky(t):3===n?new Dy(t>>8&15|t>>4&240,t>>4&15|240&t,(15&t)<<4|15&t,1):8===n?qy(t>>24&255,t>>16&255,t>>8&255,(255&t)/255):4===n?qy(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=fy.exec(e))?new Dy(t[1],t[2],t[3],1):(t=py.exec(e))?new Dy(255*t[1]/100,255*t[2]/100,255*t[3]/100,1):(t=gy.exec(e))?qy(t[1],t[2],t[3],t[4]):(t=my.exec(e))?qy(255*t[1]/100,255*t[2]/100,255*t[3]/100,t[4]):(t=yy.exec(e))?Oy(t[1],t[2]/100,t[3]/100,1):(t=by.exec(e))?Oy(t[1],t[2]/100,t[3]/100,t[4]):vy.hasOwnProperty(e)?ky(vy[e]):"transparent"===e?new Dy(NaN,NaN,NaN,0):null}function ky(e){return new Dy(e>>16&255,e>>8&255,255&e,1)}function qy(e,t,n,r){return r<=0&&(e=t=n=NaN),new Dy(e,t,n,r)}function Sy(e){return e instanceof ay||(e=My(e)),e?new Dy((e=e.rgb()).r,e.g,e.b,e.opacity):new Dy}function _y(e,t,n,r){return 1===arguments.length?Sy(e):new Dy(e,t,n,null==r?1:r)}function Dy(e,t,n,r){this.r=+e,this.g=+t,this.b=+n,this.opacity=+r}function Cy(){return`#${Ny(this.r)}${Ny(this.g)}${Ny(this.b)}`}function Ey(){const e=Ay(this.opacity);return`${1===e?"rgb(":"rgba("}${Ty(this.r)}, ${Ty(this.g)}, ${Ty(this.b)}${1===e?")":`, ${e})`}`}function Ay(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function Ty(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function Ny(e){return((e=Ty(e))<16?"0":"")+e.toString(16)}function Oy(e,t,n,r){return r<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new Iy(e,t,n,r)}function Ry(e){if(e instanceof Iy)return new Iy(e.h,e.s,e.l,e.opacity);if(e instanceof ay||(e=My(e)),!e)return new Iy;if(e instanceof Iy)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),s=NaN,a=o-i,l=(o+i)/2;return a?(s=t===o?(n-r)/a+6*(n<r):n===o?(r-t)/a+2:(t-n)/a+4,a/=l<.5?o+i:2-o-i,s*=60):a=l>0&&l<1?0:s,new Iy(s,a,l,e.opacity)}function Iy(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}function Py(e){return(e=(e||0)%360)<0?e+360:e}function Ly(e){return Math.max(0,Math.min(1,e||0))}function jy(e,t,n){return 255*(e<60?t+(n-t)*e/60:e<180?n:e<240?t+(n-t)*(240-e)/60:t)}oy(ay,My,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:xy,formatHex:xy,formatHex8:function(){return this.rgb().formatHex8()},formatHsl:function(){return Ry(this).formatHsl()},formatRgb:wy,toString:wy}),oy(Dy,_y,sy(ay,{brighter(e){return e=null==e?ly:Math.pow(ly,e),new Dy(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=null==e?.7:Math.pow(.7,e),new Dy(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new Dy(Ty(this.r),Ty(this.g),Ty(this.b),Ay(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:Cy,formatHex:Cy,formatHex8:function(){return`#${Ny(this.r)}${Ny(this.g)}${Ny(this.b)}${Ny(255*(isNaN(this.opacity)?1:this.opacity))}`},formatRgb:Ey,toString:Ey})),oy(Iy,function(e,t,n,r){return 1===arguments.length?Ry(e):new Iy(e,t,n,null==r?1:r)},sy(ay,{brighter(e){return e=null==e?ly:Math.pow(ly,e),new Iy(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=null==e?.7:Math.pow(.7,e),new Iy(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 Dy(jy(e>=240?e-240:e+120,i,r),jy(e,i,r),jy(e<120?e+240:e-120,i,r),this.opacity)},clamp(){return new Iy(Py(this.h),Ly(this.s),Ly(this.l),Ay(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=Ay(this.opacity);return`${1===e?"hsl(":"hsla("}${Py(this.h)}, ${100*Ly(this.s)}%, ${100*Ly(this.l)}%${1===e?")":`, ${e})`}`}}));const Fy=Math.PI/180,zy=180/Math.PI,Hy=4/29,Vy=6/29,By=3*Vy*Vy;function $y(e){if(e instanceof Wy)return new Wy(e.l,e.a,e.b,e.opacity);if(e instanceof Gy)return Jy(e);e instanceof Dy||(e=Sy(e));var t,n,r=Xy(e.r),i=Xy(e.g),o=Xy(e.b),s=Uy((.2225045*r+.7168786*i+.0606169*o)/1);return r===i&&i===o?t=n=s:(t=Uy((.4360747*r+.3850649*i+.1430804*o)/.96422),n=Uy((.0139322*r+.0971045*i+.7141733*o)/.82521)),new Wy(116*s-16,500*(t-s),200*(s-n),e.opacity)}function Wy(e,t,n,r){this.l=+e,this.a=+t,this.b=+n,this.opacity=+r}function Uy(e){return e>.008856451679035631?Math.pow(e,1/3):e/By+Hy}function Yy(e){return e>Vy?e*e*e:By*(e-Hy)}function Ky(e){return 255*(e<=.0031308?12.92*e:1.055*Math.pow(e,1/2.4)-.055)}function Xy(e){return(e/=255)<=.04045?e/12.92:Math.pow((e+.055)/1.055,2.4)}function Gy(e,t,n,r){this.h=+e,this.c=+t,this.l=+n,this.opacity=+r}function Jy(e){if(isNaN(e.h))return new Wy(e.l,0,0,e.opacity);var t=e.h*Fy;return new Wy(e.l,Math.cos(t)*e.c,Math.sin(t)*e.c,e.opacity)}oy(Wy,function(e,t,n,r){return 1===arguments.length?$y(e):new Wy(e,t,n,null==r?1:r)},sy(ay,{brighter(e){return new Wy(this.l+18*(null==e?1:e),this.a,this.b,this.opacity)},darker(e){return new Wy(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 Dy(Ky(3.1338561*(t=.96422*Yy(t))-1.6168667*(e=1*Yy(e))-.4906146*(n=.82521*Yy(n))),Ky(-.9787684*t+1.9161415*e+.033454*n),Ky(.0719453*t-.2289914*e+1.4052427*n),this.opacity)}})),oy(Gy,function(e,t,n,r){return 1===arguments.length?function(e){if(e instanceof Gy)return new Gy(e.h,e.c,e.l,e.opacity);if(e instanceof Wy||(e=$y(e)),0===e.a&&0===e.b)return new Gy(NaN,0<e.l&&e.l<100?0:NaN,e.l,e.opacity);var t=Math.atan2(e.b,e.a)*zy;return new Gy(t<0?t+360:t,Math.sqrt(e.a*e.a+e.b*e.b),e.l,e.opacity)}(e):new Gy(e,t,n,null==r?1:r)},sy(ay,{brighter(e){return new Gy(this.h,this.c,this.l+18*(null==e?1:e),this.opacity)},darker(e){return new Gy(this.h,this.c,this.l-18*(null==e?1:e),this.opacity)},rgb(){return Jy(this).rgb()}}));var Zy=e=>()=>e;function Qy(e,t){var n=t-e;return n?function(e,t){return function(n){return e+n*t}}(e,n):Zy(isNaN(e)?t:e)}!function e(t){var n=function(e){return 1==(e=+e)?Qy: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):Zy(isNaN(t)?n:t)}}(t);function r(e,t){var r=n((e=_y(e)).r,(t=_y(t)).r),i=n(e.g,t.g),o=n(e.b,t.b),s=Qy(e.opacity,t.opacity);return function(t){return e.r=r(t),e.g=i(t),e.b=o(t),e.opacity=s(t),e+""}}return r.gamma=e,r}(1);var eb="center",tb="bottom";function nb(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 s=r[o];if(void 0===i[s])return n;i=i[s]}return i}[{key:"NoDataExist",alignment:eb,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:eb,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:eb,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:eb},{key:"DataRangeIncludingZero",alignment:tb},{key:"LimitedData",alignment:tb},{key:"NegativeOrZeroValues",alignment:tb}].reduce(function(e,t){return e[t.key]=t,e},{});var rb,ib=["__proto__","constructor"];function ob(e,t,n){if(void 0!==e&&void 0!==t){var r=t.split("."),i=r[r.length-1];if(!ib.some(function(e){return r.includes(e)})){for(var o=e,s=0;s<r.length-1;++s){var a=r[s];void 0===o[a]&&(o[a]=Number.isNaN(+r[s+1])?{}:[]),o=o[a]}void 0!==n?o[i]=n:delete o[i]}}}function sb(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 ab(e,t){e instanceof Map?(e=[void 0,e],void 0===t&&(t=cb)):void 0===t&&(t=lb);for(var n,r,i,o,s,a=new db(e),l=[a];n=l.pop();)if((i=t(n.data))&&(s=(i=Array.from(i)).length))for(n.children=i,o=s-1;o>=0;--o)l.push(r=i[o]=new db(i[o])),r.parent=n,r.depth=n.depth+1;return a.eachBefore(hb)}function lb(e){return e.children}function cb(e){return Array.isArray(e)?e[1]:null}function ub(e){void 0!==e.data.value&&(e.value=e.data.value),e.data=e.data.data}function hb(e){var t=0;do{e.height=t}while((e=e.parent)&&e.height<++t)}function db(e){this.data=e,this.depth=this.height=0,this.parent=null}db.prototype=ab.prototype={constructor:db,count:function(){return this.eachAfter(sb)},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,s=[o],a=[],l=-1;o=s.pop();)if(a.push(o),n=o.children)for(r=0,i=n.length;r<i;++r)s.push(n[r]);for(;o=a.pop();)e.call(t,o,++l,this);return this},eachBefore:function(e,t){for(var n,r,i=this,o=[i],s=-1;i=o.pop();)if(e.call(t,i,++s,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 ab(this).eachBefore(ub)},[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)}},rb=function(e){
|
|
25
25
|
/*! javascript-number-formatter - v1.1.11 - http://mottie.github.com/javascript-number-formatter/ * © ecava */
|
|
26
|
-
e.exports=function(e,t){if(!e||isNaN(+t))return t;var n,r,i,o,s,a,l,c,u,h,d=e.length,f=e.search(/[0-9\-\+#]/),p=f>0?e.substring(0,f):"",g=e.split("").reverse().join(""),m=g.search(/[0-9\-\+#]/),y=d-m,b=e.substring(y,y+1),v=y+("."===b||","===b?1:0),x=m>0?e.substring(v,d):"";if(n=(t="-"===(e=e.substring(f,v)).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))+"",a=e[1]&&e[1].lastIndexOf("0"),(!(c=t.split("."))[1]||c[1]&&c[1].length<=a)&&(t=(+t).toFixed(a+1)),u=e[0].split(o),e[0]=u.join(""),(s=e[0]&&e[0].indexOf("0"))>-1)for(;c[0].length<e[0].length-s;)c[0]="0"+c[0];else 0==+c[0]&&(c[0]="");if((t=t.split("."))[0]=c[0],l=u[1]&&u[u.length-1].length){for(g="",y=(h=t[0]).length%l,d=h.length,v=0;v<d;v++)g+=h.charAt(v),!((v-y+1)%l)&&v<d-l&&(g+=o);t[0]=g}return t[1]=e[1]&&t[1]?i+t[1]:"","0"!==(r=t.join(""))&&""!==r||(n=!1),p+(n?"-":"")+r+x}},tb({exports:{}});var hb="'Source Sans Pro', 'Arial', 'sans-serif'",db="#333333",fb="#595959",pb="#737373",gb="#cccccc",mb="#e6e6e6";function yb(e){var t={};return[].concat(Nm(e),Nm([["","","color"],["object","","fontFamily"],["object","axis.label.name","color",fb],["object","axis.label.name","fontFamily",hb],["object","axis.label.name","fontSize","12px"],["object","axis.line.major","color",gb],["object","axis.line.minor","color",mb],["object","axis.title","color"],["object","axis.title","fontFamily",hb],["object","axis.title","fontSize","13px"],["object","grid.line.highContrast","color",mb],["object","grid.line.major","color",gb],["object","grid.line.minor","color",mb],["object","label.value","color",fb],["object","label.value","fontFamily",hb],["object","label.value","fontSize","12px"],[!1,"label.value","darkColor",fb],[!1,"label.value","lightColor",mb],["object","outOfRange","color","#999"],["object","legend.title","color",db],["object","legend.title","fontFamily",hb],["object","legend.title","fontSize","15px"],["object","legend.label","color",fb],["object","legend.label","fontFamily",hb],["object","legend.label","fontSize","13px"],["object","referenceLine.label.name","color",db],["object","referenceLine.label.name","fontFamily",hb],["object","referenceLine.label.name","fontSize","12px"],["object","referenceLine.outOfBounds","color",mb],["object","referenceLine.outOfBounds","fontFamily",hb],["object","referenceLine.outOfBounds","fontSize","12px"],["object","referenceLine.outOfBounds","backgroundColor",pb,function(e){return"transparent"===e?pb: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 bb,vb,xb=function(e){return e};function wb(e){var t=e.theme,n=e.id,r=e.transform,i=e.extend,o=e.matrix,s={},a=r.reduce(function(e,t){var n=Tm(t,2),r=n[0],i=n[1];return e[r]=i,e},{});return o.forEach(function(e){var r=Tm(e,5),i=r[0],o=r[1],l=r[2],c=r[3],u=r[4],h=void 0===u?function(e){return e}:u,d=function(e){var t=e.theme,n=e.base,r=e.path,i=e.attribute,o=e.defaultValue,s=void 0===o?void 0:o;if(!t||!1===n)return s;var a=t.getStyle(n,r,i);return void 0===a?s:a}({theme:t,base:"object"===i&&n?"".concat("object",".").concat(n):i,path:o,attribute:l,defaultValue:c}),f=(a["".concat(o,".").concat(l)]||xb)(h(d));rb(s,[o,l].filter(Boolean).join("."),f)}),i.forEach(function(e){var t=Tm(e,2),n=t[0],r=t[1];rb(s,n,r)}),s}var Mb,kb,qb=function(){if(vb)return bb;vb=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)},s=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},a=function(t,n){if("__proto__"===n){if(!e.call(t,n))return;if(r)return r(t,n).value}return t[n]};return bb=function e(){var t,n,r,l,c,u,h=arguments[0],d=1,f=arguments.length,p=!1;for("boolean"==typeof h&&(p=h,h=arguments[1]||{},d=2),(null==h||"object"!=typeof h&&"function"!=typeof h)&&(h={});d<f;++d)if(null!=(t=arguments[d]))for(n in t)r=a(h,n),h!==(l=a(t,n))&&(p&&l&&(o(l)||(c=i(l)))?(c?(c=!1,u=r&&i(r)?r:[]):u=r&&o(r)?r:{},s(h,{name:n,newValue:e(p,u,l)})):void 0!==l&&s(h,{name:n,newValue:l}));return h},bb}(),Sb=n(qb);function _b(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Db=function(){if(kb)return Mb;kb=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)},s=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},a=function(t,n){if("__proto__"===n){if(!e.call(t,n))return;if(r)return r(t,n).value}return t[n]};return Mb=function e(){var t,n,r,l,c,u,h=arguments[0],d=1,f=arguments.length,p=!1;for("boolean"==typeof h&&(p=h,h=arguments[1]||{},d=2),(null==h||"object"!=typeof h&&"function"!=typeof h)&&(h={});d<f;++d)if(null!=(t=arguments[d]))for(n in t)r=a(h,n),h!==(l=a(t,n))&&(p&&l&&(o(l)||(c=i(l)))?(c?(c=!1,u=r&&i(r)?r:[]):u=r&&o(r)?r:{},s(h,{name:n,newValue:e(p,u,l)})):void 0!==l&&s(h,{name:n,newValue:l}));return h},Mb}();function Cb(e,t,n){e.prototype=t.prototype=n,n.constructor=e}function Eb(e,t){var n=Object.create(e.prototype);for(var r in t)n[r]=t[r];return n}function Ab(){}_b(Db);var Tb=1/.7,Nb="\\s*([+-]?\\d+)\\s*",Ob="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",Rb="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",Ib=/^#([0-9a-f]{3,8})$/,Pb=new RegExp(`^rgb\\(${Nb},${Nb},${Nb}\\)$`),Lb=new RegExp(`^rgb\\(${Rb},${Rb},${Rb}\\)$`),jb=new RegExp(`^rgba\\(${Nb},${Nb},${Nb},${Ob}\\)$`),Fb=new RegExp(`^rgba\\(${Rb},${Rb},${Rb},${Ob}\\)$`),zb=new RegExp(`^hsl\\(${Ob},${Rb},${Rb}\\)$`),Hb=new RegExp(`^hsla\\(${Ob},${Rb},${Rb},${Ob}\\)$`),Vb={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 Bb(){return this.rgb().formatHex()}function $b(){return this.rgb().formatRgb()}function Wb(e){var t,n;return e=(e+"").trim().toLowerCase(),(t=Ib.exec(e))?(n=t[1].length,t=parseInt(t[1],16),6===n?Ub(t):3===n?new Gb(t>>8&15|t>>4&240,t>>4&15|240&t,(15&t)<<4|15&t,1):8===n?Yb(t>>24&255,t>>16&255,t>>8&255,(255&t)/255):4===n?Yb(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=Pb.exec(e))?new Gb(t[1],t[2],t[3],1):(t=Lb.exec(e))?new Gb(255*t[1]/100,255*t[2]/100,255*t[3]/100,1):(t=jb.exec(e))?Yb(t[1],t[2],t[3],t[4]):(t=Fb.exec(e))?Yb(255*t[1]/100,255*t[2]/100,255*t[3]/100,t[4]):(t=zb.exec(e))?nv(t[1],t[2]/100,t[3]/100,1):(t=Hb.exec(e))?nv(t[1],t[2]/100,t[3]/100,t[4]):Vb.hasOwnProperty(e)?Ub(Vb[e]):"transparent"===e?new Gb(NaN,NaN,NaN,0):null}function Ub(e){return new Gb(e>>16&255,e>>8&255,255&e,1)}function Yb(e,t,n,r){return r<=0&&(e=t=n=NaN),new Gb(e,t,n,r)}function Kb(e){return e instanceof Ab||(e=Wb(e)),e?new Gb((e=e.rgb()).r,e.g,e.b,e.opacity):new Gb}function Xb(e,t,n,r){return 1===arguments.length?Kb(e):new Gb(e,t,n,null==r?1:r)}function Gb(e,t,n,r){this.r=+e,this.g=+t,this.b=+n,this.opacity=+r}function Jb(){return`#${tv(this.r)}${tv(this.g)}${tv(this.b)}`}function Zb(){const e=Qb(this.opacity);return`${1===e?"rgb(":"rgba("}${ev(this.r)}, ${ev(this.g)}, ${ev(this.b)}${1===e?")":`, ${e})`}`}function Qb(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function ev(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function tv(e){return((e=ev(e))<16?"0":"")+e.toString(16)}function nv(e,t,n,r){return r<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new iv(e,t,n,r)}function rv(e){if(e instanceof iv)return new iv(e.h,e.s,e.l,e.opacity);if(e instanceof Ab||(e=Wb(e)),!e)return new iv;if(e instanceof iv)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),s=NaN,a=o-i,l=(o+i)/2;return a?(s=t===o?(n-r)/a+6*(n<r):n===o?(r-t)/a+2:(t-n)/a+4,a/=l<.5?o+i:2-o-i,s*=60):a=l>0&&l<1?0:s,new iv(s,a,l,e.opacity)}function iv(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}function ov(e){return(e=(e||0)%360)<0?e+360:e}function sv(e){return Math.max(0,Math.min(1,e||0))}function av(e,t,n){return 255*(e<60?t+(n-t)*e/60:e<180?n:e<240?t+(n-t)*(240-e)/60:t)}Cb(Ab,Wb,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:Bb,formatHex:Bb,formatHex8:function(){return this.rgb().formatHex8()},formatHsl:function(){return rv(this).formatHsl()},formatRgb:$b,toString:$b}),Cb(Gb,Xb,Eb(Ab,{brighter(e){return e=null==e?Tb:Math.pow(Tb,e),new Gb(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=null==e?.7:Math.pow(.7,e),new Gb(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new Gb(ev(this.r),ev(this.g),ev(this.b),Qb(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:Jb,formatHex:Jb,formatHex8:function(){return`#${tv(this.r)}${tv(this.g)}${tv(this.b)}${tv(255*(isNaN(this.opacity)?1:this.opacity))}`},formatRgb:Zb,toString:Zb})),Cb(iv,function(e,t,n,r){return 1===arguments.length?rv(e):new iv(e,t,n,null==r?1:r)},Eb(Ab,{brighter(e){return e=null==e?Tb:Math.pow(Tb,e),new iv(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=null==e?.7:Math.pow(.7,e),new iv(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 Gb(av(e>=240?e-240:e+120,i,r),av(e,i,r),av(e<120?e+240:e-120,i,r),this.opacity)},clamp(){return new iv(ov(this.h),sv(this.s),sv(this.l),Qb(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=Qb(this.opacity);return`${1===e?"hsl(":"hsla("}${ov(this.h)}, ${100*sv(this.s)}%, ${100*sv(this.l)}%${1===e?")":`, ${e})`}`}}));const lv=Math.PI/180,cv=180/Math.PI,uv=4/29,hv=6/29,dv=3*hv*hv;function fv(e){if(e instanceof pv)return new pv(e.l,e.a,e.b,e.opacity);if(e instanceof vv)return xv(e);e instanceof Gb||(e=Kb(e));var t,n,r=bv(e.r),i=bv(e.g),o=bv(e.b),s=gv((.2225045*r+.7168786*i+.0606169*o)/1);return r===i&&i===o?t=n=s:(t=gv((.4360747*r+.3850649*i+.1430804*o)/.96422),n=gv((.0139322*r+.0971045*i+.7141733*o)/.82521)),new pv(116*s-16,500*(t-s),200*(s-n),e.opacity)}function pv(e,t,n,r){this.l=+e,this.a=+t,this.b=+n,this.opacity=+r}function gv(e){return e>.008856451679035631?Math.pow(e,1/3):e/dv+uv}function mv(e){return e>hv?e*e*e:dv*(e-uv)}function yv(e){return 255*(e<=.0031308?12.92*e:1.055*Math.pow(e,1/2.4)-.055)}function bv(e){return(e/=255)<=.04045?e/12.92:Math.pow((e+.055)/1.055,2.4)}function vv(e,t,n,r){this.h=+e,this.c=+t,this.l=+n,this.opacity=+r}function xv(e){if(isNaN(e.h))return new pv(e.l,0,0,e.opacity);var t=e.h*lv;return new pv(e.l,Math.cos(t)*e.c,Math.sin(t)*e.c,e.opacity)}Cb(pv,function(e,t,n,r){return 1===arguments.length?fv(e):new pv(e,t,n,null==r?1:r)},Eb(Ab,{brighter(e){return new pv(this.l+18*(null==e?1:e),this.a,this.b,this.opacity)},darker(e){return new pv(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 Gb(yv(3.1338561*(t=.96422*mv(t))-1.6168667*(e=1*mv(e))-.4906146*(n=.82521*mv(n))),yv(-.9787684*t+1.9161415*e+.033454*n),yv(.0719453*t-.2289914*e+1.4052427*n),this.opacity)}})),Cb(vv,function(e,t,n,r){return 1===arguments.length?function(e){if(e instanceof vv)return new vv(e.h,e.c,e.l,e.opacity);if(e instanceof pv||(e=fv(e)),0===e.a&&0===e.b)return new vv(NaN,0<e.l&&e.l<100?0:NaN,e.l,e.opacity);var t=Math.atan2(e.b,e.a)*cv;return new vv(t<0?t+360:t,Math.sqrt(e.a*e.a+e.b*e.b),e.l,e.opacity)}(e):new vv(e,t,n,null==r?1:r)},Eb(Ab,{brighter(e){return new vv(this.h,this.c,this.l+18*(null==e?1:e),this.opacity)},darker(e){return new vv(this.h,this.c,this.l-18*(null==e?1:e),this.opacity)},rgb(){return xv(this).rgb()}}));var wv=-.14861,Mv=1.78277,kv=-.29227,qv=-.90649,Sv=1.97294,_v=Sv*qv,Dv=Sv*Mv,Cv=Mv*kv-qv*wv;function Ev(e,t,n,r){return 1===arguments.length?function(e){if(e instanceof Av)return new Av(e.h,e.s,e.l,e.opacity);e instanceof Gb||(e=Kb(e));var t=e.r/255,n=e.g/255,r=e.b/255,i=(Cv*r+_v*t-Dv*n)/(Cv+_v-Dv),o=r-i,s=(Sv*(n-i)-kv*o)/qv,a=Math.sqrt(s*s+o*o)/(Sv*i*(1-i)),l=a?Math.atan2(s,o)*cv-120:NaN;return new Av(l<0?l+360:l,a,i,e.opacity)}(e):new Av(e,t,n,null==r?1:r)}function Av(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}Cb(Av,Ev,Eb(Ab,{brighter(e){return e=null==e?Tb:Math.pow(Tb,e),new Av(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=null==e?.7:Math.pow(.7,e),new Av(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=isNaN(this.h)?0:(this.h+120)*lv,t=+this.l,n=isNaN(this.s)?0:this.s*t*(1-t),r=Math.cos(e),i=Math.sin(e);return new Gb(255*(t+n*(wv*r+Mv*i)),255*(t+n*(kv*r+qv*i)),255*(t+n*(Sv*r)),this.opacity)}}));var Tv=e=>()=>e;function Nv(e,t){return function(n){return e+n*t}}function Ov(e,t){var n=t-e;return n?Nv(e,n):Tv(isNaN(e)?t:e)}function Rv(e){return((e=Math.exp(e))+1/e)/2}function Iv(e){return function t(n){function r(t,r){var i=e((t=Ev(t)).h,(r=Ev(r)).h),o=Ov(t.s,r.s),s=Ov(t.l,r.l),a=Ov(t.opacity,r.opacity);return function(e){return t.h=i(e),t.s=o(e),t.l=s(Math.pow(e,n)),t.opacity=a(e),t+""}}return n=+n,r.gamma=t,r}(1)}!function e(t){var n=function(e){return 1==(e=+e)?Ov: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):Tv(isNaN(t)?n:t)}}(t);function r(e,t){var r=n((e=Xb(e)).r,(t=Xb(t)).r),i=n(e.g,t.g),o=n(e.b,t.b),s=Ov(e.opacity,t.opacity);return function(t){return e.r=r(t),e.g=i(t),e.b=o(t),e.opacity=s(t),e+""}}return r.gamma=e,r}(1),function e(t,n,r){function i(e,i){var o,s,a=e[0],l=e[1],c=e[2],u=i[0],h=i[1],d=i[2],f=u-a,p=h-l,g=f*f+p*p;if(g<1e-12)s=Math.log(d/c)/t,o=function(e){return[a+e*f,l+e*p,c*Math.exp(t*e*s)]};else{var m=Math.sqrt(g),y=(d*d-c*c+r*g)/(2*c*n*m),b=(d*d-c*c-r*g)/(2*d*n*m),v=Math.log(Math.sqrt(y*y+1)-y),x=Math.log(Math.sqrt(b*b+1)-b);s=(x-v)/t,o=function(e){var r,i=e*s,o=Rv(v),u=c/(n*m)*(o*(r=t*i+v,((r=Math.exp(2*r))-1)/(r+1))-function(e){return((e=Math.exp(e))-1/e)/2}(v));return[a+u*f,l+u*p,c*o/Rv(t*i+v)]}}return o.duration=1e3*s*t/Math.SQRT2,o}return i.rho=function(t){var n=Math.max(.001,+t),r=n*n;return e(n,r,r*r)},i}(Math.SQRT2,2,4),Iv(function(e,t){var n=t-e;return n?Nv(e,n>180||n<-180?n-360*Math.round(n/360):n):Tv(isNaN(e)?t:e)}),Iv(Ov);var Pv="center",Lv="bottom";function jv(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 s=r[o];if(void 0===i[s])return n;i=i[s]}return i}[{key:"NoDataExist",alignment:Pv,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:Pv,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:Pv,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:Pv},{key:"DataRangeIncludingZero",alignment:Lv},{key:"LimitedData",alignment:Lv},{key:"NegativeOrZeroValues",alignment:Lv}].reduce(function(e,t){return e[t.key]=t,e},{});var Fv,zv={exports:{}},Hv=Fv?zv.exports:(Fv=1,zv.exports=function(){function e(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"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function t(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 n(n){for(var r=1;r<arguments.length;r++){var i=null!=arguments[r]?arguments[r]:{};r%2?t(Object(i),!0).forEach(function(t){e(n,t,i[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(i)):t(Object(i)).forEach(function(e){Object.defineProperty(n,e,Object.getOwnPropertyDescriptor(i,e))})}return n}var r=Object.prototype.hasOwnProperty,i=Object.prototype.toString,o=Object.defineProperty,s=Object.getOwnPropertyDescriptor,a=function(e){return"function"==typeof Array.isArray?Array.isArray(e):"[object Array]"===i.call(e)},l=function(e){if(!e||"[object Object]"!==i.call(e))return!1;var t,n=r.call(e,"constructor"),o=e.constructor&&e.constructor.prototype&&r.call(e.constructor.prototype,"isPrototypeOf");if(e.constructor&&!n&&!o)return!1;for(t in e);return void 0===t||r.call(e,t)},c=function(e,t){o&&"__proto__"===t.name?o(e,t.name,{enumerable:!0,configurable:!0,value:t.newValue,writable:!0}):e[t.name]=t.newValue},u=function(e,t){if("__proto__"===t){if(!r.call(e,t))return;if(s)return s(e,t).value}return e[t]},h=function e(){var t,n,r,i,o,s,h=arguments[0],d=1,f=arguments.length,p=!1;for("boolean"==typeof h&&(p=h,h=arguments[1]||{},d=2),(null==h||"object"!=typeof h&&"function"!=typeof h)&&(h={});d<f;++d)if(null!=(t=arguments[d]))for(n in t)r=u(h,n),h!==(i=u(t,n))&&(p&&i&&(l(i)||(o=a(i)))?(o?(o=!1,s=r&&a(r)?r:[]):s=r&&l(r)?r:{},c(h,{name:n,newValue:e(p,s,i)})):void 0!==i&&c(h,{name:n,newValue:i}));return h};function d(e,t,n,r){if(!e)return-1;const i=n.cache,o=e.origin?e.origin():null;o&&(e=o);let s=i.fields.indexOf(e),a=-1,l=-1;if(-1===s)for(let t=0;t<i.wrappedFields.length;t++)if(l=i.wrappedFields[t].attrDims.map(e=>e.instance).indexOf(e),a=i.wrappedFields[t].attrExps.map(e=>e.instance).indexOf(e),-1!==l||-1!==a){s=t;break}if(Array.isArray(r)&&r.some((e,t)=>e!==t)){const e=r.indexOf(s);-1!==e&&(s=e)}return s-=t.qArea.qLeft,s<0||s>=t.qArea.qWidth?-1:l>=0?e=>e[s].qAttrDims.qValues[l]:a>=0?e=>e[s].qAttrExps.qValues[a]:e=>e[s]}function f(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 p(e){let{cache:t,f:n,mainCell:r,p:i,page:o,rowIdx:s,row:a,sourceKey:l,target:c,targetProp:u,columnOrder:p}=e,g=r;if(i.field&&i.field!==n){const e=d(i.field,o,{cache:t},p);if(-1===e)return;g=h({qRow:s},e(a))}c[u]=f(i,g,{key:l})}function g(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 s=t.raw(),a=t.key(),l="object"==typeof i[e].field?i[e].field:t.field(i[e].field),{props:c,main:u}=r.normalizeConfig(i[e],t),g=Object.keys(c),m=!!i[e].trackBy,y=typeof i[e].trackBy,b={},v=[],x=[];for(let t=0;t<s.qDataPages.length;t++){const o=d(l,s.qDataPages[t],{cache:n},s.qColumnOrder);if(-1!==o)for(let d=0;d<s.qDataPages[t].qMatrix.length;d++){const w=s.qDataPages[t].qArea.qTop+d,M=h({qRow:w},o(s.qDataPages[t].qMatrix[d])),k=f(u,M,{key:a});if(!u.filter||u.filter(M)){for(let e=0;e<g.length;e++){const r=c[g[e]];let i=r.fields||[r];r.fields&&(k[g[e]]=[]);for(let o=0;o<i.length;o++)p({cache:n,f:l,mainCell:M,p:i[o],prop:g[e],page:s.qDataPages[t],rowIdx:w,row:s.qDataPages[t].qMatrix[d],sourceKey:a,target:r.fields?k[g[e]]:k,targetProp:r.fields?o:g[e],columnOrder:s.qColumnOrder});if(r.fields){const t=k[g[e]].map(e=>e.value),n=k[g[e]].map(e=>e.label);k[g[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(k[g[e]].value)}}}m&&r.track({cfg:i[e],itemData:M,obj:k,target:v,tracker:b,trackType:y}),x.push(k)}}}const w=m?r.collect(v,{main:u,propsArr:g,props:c}):x;o=[...o,...w]}return o}function m(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 y(e,t){e instanceof Map?(e=[void 0,e],void 0===t&&(t=v)):void 0===t&&(t=b);for(var n,r,i,o,s,a=new M(e),l=[a];n=l.pop();)if((i=t(n.data))&&(s=(i=Array.from(i)).length))for(n.children=i,o=s-1;o>=0;--o)l.push(r=i[o]=new M(i[o])),r.parent=n,r.depth=n.depth+1;return a.eachBefore(w)}function b(e){return e.children}function v(e){return Array.isArray(e)?e[1]:null}function x(e){void 0!==e.data.value&&(e.value=e.data.value),e.data=e.data.data}function w(e){var t=0;do{e.height=t}while((e=e.parent)&&e.height<++t)}function M(e){this.data=e,this.depth=this.height=0,this.parent=null}function k(e){return null==e?null:function(e){if("function"!=typeof e)throw new Error;return e}(e)}M.prototype=y.prototype={constructor:M,count:function(){return this.eachAfter(m)},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,s=[o],a=[],l=-1;o=s.pop();)if(a.push(o),n=o.children)for(r=0,i=n.length;r<i;++r)s.push(n[r]);for(;o=a.pop();)e.call(t,o,++l,this);return this},eachBefore:function(e,t){for(var n,r,i=this,o=[i],s=-1;i=o.pop();)if(e.call(t,i,++s,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 y(this).eachBefore(x)},[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 q={depth:-1},S={},_={};function D(e){return e.id}function C(e){return e.parentId}function E(){var e,t=D,n=C;function r(r){var i,o,s,a,l,c,u,h,d=Array.from(r),f=t,p=n,g=new Map;if(null!=e){const t=d.map((t,n)=>function(e){let t=(e=`${e}`).length;return T(e,t-1)&&!T(e,t-2)&&(e=e.slice(0,-1)),"/"===e[0]?e:`/${e}`}(e(t,n,r))),n=t.map(A),i=new Set(t).add("");for(const e of n)i.has(e)||(i.add(e),t.push(e),n.push(A(e)),d.push(_));f=(e,n)=>t[n],p=(e,t)=>n[t]}for(s=0,i=d.length;s<i;++s)o=d[s],c=d[s]=new M(o),null!=(u=f(o,s,r))&&(u+="")&&(h=c.id=u,g.set(h,g.has(h)?S:c)),null!=(u=p(o,s,r))&&(u+="")&&(c.parent=u);for(s=0;s<i;++s)if(u=(c=d[s]).parent){if(!(l=g.get(u)))throw new Error("missing: "+u);if(l===S)throw new Error("ambiguous: "+u);l.children?l.children.push(c):l.children=[c],c.parent=l}else{if(a)throw new Error("multiple roots");a=c}if(!a)throw new Error("no root");if(null!=e){for(;a.data===_&&1===a.children.length;)a=a.children[0],--i;for(let e=d.length-1;e>=0&&(c=d[e]).data===_;--e)c.data=null}if(a.parent=q,a.eachBefore(function(e){e.depth=e.parent.depth+1,--i}).eachBefore(w),a.parent=null,i>0)throw new Error("cycle");return a}return r.id=function(e){return arguments.length?(t=k(e),r):t},r.parentId=function(e){return arguments.length?(n=k(e),r):n},r.path=function(t){return arguments.length?(e=k(t),r):e},r}function A(e){let t=e.length;if(t<2)return"";for(;--t>1&&!T(e,t););return e.slice(0,t)}function T(e,t){if("/"===e[t]){let n=0;for(;t>0&&"\\"===e[--t];)++n;if(!(1&n))return!0}return!1}function N(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=N(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]=N(r,i[e]);return t}n[e]in i&&(i=i[n[e]])}return i}function O(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,...O(e[i].children,t-1,n)]);return r}function R(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=>O(e.children,r-1,n)}return!1}const I=/^qDimensionInfo(?:\/(\d+))?/,P=/^\/?qMeasureInfo\/(\d+)/,L=/\/qAttrExprInfo\/(\d+)/,j=/\/qAttrDimInfo\/(\d+)/;function F(e){return(e.qColumnOrder&&e.qColumnOrder.length?e.qColumnOrder:e.qDimensionInfo.map((e,t)=>t)).filter(t=>t<e.qDimensionInfo.length)}function z(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,s=-1,a=-1,l=-1,c=-1,u=-1,h=r;const d=n.qEffectiveInterColumnSortOrder,f=F(n);return I.test(h)&&(i=!0,o=+I.exec(h)[1],h=r.replace(I,"")),P.test(h)&&("K"===n.qMode?c=+P.exec(h)[1]:d&&-1!==d.indexOf(-1)?(c=+P.exec(h)[1],u=0):u=+P.exec(h)[1],h=h.replace(P,"")),h&&(j.exec(h)?a=+j.exec(h)[1]:L.exec(h)&&(s=+L.exec(h)[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:c,measureIdx:u,attrDimIdx:a,attrIdx:s}}function H(e,t){let n,r,i=R(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 V(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 B(e){let{propsArr:t,props:n,item:r,itemData:i,ret:o,sourceKey:s}=e;for(let e=0;e<t.length;e++){const a=n[t[e]],l=a.fields||[a];let c,u;a.fields&&(c=[],u=[]);for(let n=0;n<l.length;n++){const h=l[n];let d,f,p,g,m,y;if("primitive"===h.type?(p=h.value,y=String(h.value)):("function"==typeof h.value&&(d=e=>h.value(e,r)),"function"==typeof h.label&&(f=e=>h.label(e,r)),h.accessor?(g=h.accessor(r),Array.isArray(g)?(m=g.map(h.valueAccessor),h.attrAccessor&&(m=m.map(h.attrAccessor)),d&&(p=m.map(d),d=null),f&&(y=m.map(f),f=null),p=h.reduce?h.reduce(p):p,y=h.reduceLabel?h.reduceLabel(y,p):String(p)):(p=h.attrAccessor?h.attrAccessor(h.valueAccessor(g)):h.valueAccessor(g),y=p)):(p=i,y=i)),a.fields){const e=d?d(p):p;c.push(e),u.push(f&&null!=y?f(y):null!=y?y:String(e))}else{const n=d?d(p):p;o[t[e]]={value:n,label:f?f(y):null!=y?y:String(n)},h.field&&(o[t[e]].source={field:h.field.key(),key:s})}}c&&(o[t[e]]={value:"function"==typeof a.value?a.value(c,r):c,label:"function"==typeof a.label?a.label(u,r):u})}}const $=(e,t,n)=>{const r="K"===e.qMode?"/qStackedDataPages/*/qData":"/qTreeDataPages/*",i="K"===e.qMode?"qSubNodes":"qNodes",o=N(r,e);return o&&o[0]?(t.tree=y(o[0],n.children||(e=>e[i])),t.tree):null};const W=e=>{let{propsArr:t,props:n,cube:r,cache:i,itemDepthObject:o,f:s}=e;for(let e=0;e<t.length;e++){const i=n[t[e]],a=i.fields?i.fields:[i];for(let e=0;e<a.length;e++){const t=a[e];if(t.field!==s){const e=H(o,z(t.field,{cube:r}));t.accessor=e.nodeFn,t.valueAccessor=e.valueFn,t.attrAccessor=e.attrFn}}}};function U(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0,r=arguments.length>2?arguments[2]:void 0,i=arguments.length>3?arguments[3]:void 0;const o=t.raw(),s=t.key(),a="S"===o.qMode?function(e){const t=e.raw().qDataPages.length?e.raw().qDataPages[0].qMatrix:[],r=function(e){const t=e.raw().qColumnOrder,n=e.fields();return t&&t.length===n.length?t:n.map((e,t)=>t)}(e),i=e.fields(),o=e.fields().filter(e=>"dimension"===e.type()).map(e=>r.indexOf(i.indexOf(e))),s=e.fields().filter(e=>"measure"===e.type()).map(e=>r.indexOf(i.indexOf(e))),a={__root:{__id:"__root",qValues:[]}};for(let e=0;e<t.length;e++){const r=t[e];let i="__root",c=!1;for(let e=0;e<o.length;e++){var l;const t=r[o[e]],s="".concat(i,"__").concat(null!==(l=t.qElemNumber)&&void 0!==l?l:t.qElemNo);a[s]||(a[s]=n({__id:s,__parent:i,qValues:[]},t),c=!0),i=s}if(c)for(let e=0;e<s.length;e++){const t=r[s[e]];a[i].qValues.push(t)}}const c=Object.keys(a).map(e=>a[e]);return E().id(e=>e.__id).parentId(e=>e.__parent)(c)}(t):$(o,r,e);if(!a)return null;const l=a.height,c=[];for(let s=0;s<=l;s++){let a=null;if(s>0)if("S"===o.qMode){let e=F(o)[s-1];a=r.fields[e]}else{let e=o.qEffectiveInterColumnSortOrder[s-1];s>o.qEffectiveInterColumnSortOrder.length&&(e=o.qDimensionInfo.length),a=r.fields[e]}const{props:l,main:u}=i.normalizeConfig(n(n({},e),{},{field:a?a.key():void 0}),t),h=Object.keys(l);c[s]={propsArr:h,props:l,main:u};const d=a?z(a,{cube:o}):{fieldDepth:0};W({propsArr:h,props:l,cube:o,cache:r,itemDepthObject:d,f:a})}const u=a.copy().descendants(),h=a.descendants();for(let e=0;e<h.length;e++){const t=c[h[e].depth].propsArr,n=c[h[e].depth].props,r=c[h[e].depth].main,i=u[e],o=i.data,a=V(r,o,{key:s});B({propsArr:t,props:n,item:i,itemData:o,ret:a,sourceKey:s}),h[e].data=a}return a}function Y(e,t,n,r){const i=Array.isArray(e)?e:[e];let o=[];for(let s=0;s<i.length;s++)if(void 0!==i[s].field){const a=t.raw(),l=t.key();if(!$(a,n,e))continue;const c="object"==typeof i[s].field?i[s].field:t.field(i[s].field),{props:u,main:h}=r.normalizeConfig(i[s],t),d=Object.keys(u),f=z(c,{cube:a}),{nodeFn:p,attrFn:g,valueFn:m}=H({fieldDepth:0},f);W({propsArr:d,props:u,cube:a,cache:n,itemDepthObject:f,f:c});const y=!!i[s].trackBy,b=typeof i[s].trackBy,v={},x=[],w=p(n.tree),M=[];for(let e=0;e<w.length;e++){const t=w[e],n=g?g(m(t)):m(t);if(h.filter&&!h.filter(n))continue;const o=V(h,n,{key:l});B({propsArr:d,props:u,item:t,itemData:n,ret:o,sourceKey:l}),y&&r.track({cfg:i[s],itemData:n,obj:o,target:x,tracker:v,trackType:b}),M.push(o)}const k=y?r.collect(x,{main:h,propsArr:d,props:u}):M;o=[...o,...k]}return o}var K=function(e,t){return e(t={exports:{}},t.exports),t.exports}(function(e){var t;t=function(){return function(e,t){if(!e||isNaN(+t))return t;var n,r,i,o,s,a,l,c,u,h,d=e.length,f=e.search(/[0-9\-\+#]/),p=f>0?e.substring(0,f):"",g=e.split("").reverse().join(""),m=g.search(/[0-9\-\+#]/),y=d-m,b=e.substring(y,y+1),v=y+("."===b||","===b?1:0),x=m>0?e.substring(v,d):"";if(n=(t="-"===(e=e.substring(f,v)).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))+"",a=e[1]&&e[1].lastIndexOf("0"),(!(c=t.split("."))[1]||c[1]&&c[1].length<=a)&&(t=(+t).toFixed(a+1)),u=e[0].split(o),e[0]=u.join(""),(s=e[0]&&e[0].indexOf("0"))>-1)for(;c[0].length<e[0].length-s;)c[0]="0"+c[0];else 0==+c[0]&&(c[0]="");if((t=t.split("."))[0]=c[0],l=u[1]&&u[u.length-1].length){for(g="",y=(h=t[0]).length%l,d=h.length,v=0;v<d;v++)g+=h.charAt(v),!((v-y+1)%l)&&v<d-l&&(g+=o);t[0]=g}return t[1]=e[1]&&t[1]?i+t[1]:"","0"!==(r=t.join(""))&&""!==r||(n=!1),p+(n?"-":"")+r+x}},e.exports=t()});function X(e){return e.replace(/[-[\]/{}()*+?.\\^$|]/g,"\\$&")}const G={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"},J=/%\)?$/,Z=/^\(r(0[2-9]|[12]\d|3[0-6])\)/i,Q=/^\(oct\)/i,ee=/^\(dec\)/i,te=/^\(hex\)/i,ne=/^\(bin\)/i,re=/^\(rom\)/i,ie=/^(\(rom\)|\(bin\)|\(hex\)|\(dec\)|\(oct\)|\(r(0[2-9]|[12]\d|3[0-6])\))/i,oe=/#|0/g;function se(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 ae(e,t,n){let r;return Z.test(t)?e=se(e,Number(/\d{2}/.exec(t)[0]),t,n):Q.test(t)?e=se(e,8,t,n):ee.test(t)?e=se(e,10,t,n):te.test(t)?e=se(e,16,t,n):ne.test(t)?e=se(e,2,t,n):re.test(t)&&(r="",e<0&&(r="-",e=-e),e=0===(e=Math.floor(e))?"0":e<=5e5?r+(e=function(e,t){let n,r="",i=Number(String(e).slice(-3)),o=(e-i)/1e3,s=[0,1,4,5,9,10,40,50,90,100,400,500,900].reverse(),a=["0","I","IV","V","IX","X","XL","L","XC","C","CD","D","CM"].reverse();for(;i>0;)for(n=0;n<s.length;n++)if(s[n]<=i){r+=a[n],i-=s[n];break}for(n=0;n<o;n++)r="M".concat(r);return t[1]!==t[1].toUpperCase()&&(r=r.toLowerCase()),r}(e,t)):t+r+e.toExponential(0)),e}function le(e,t,n){const r=X(e);return n?r:new RegExp(r||"",t)}function ce(e,t,n,r){let i,o,s,a,l,c,u,h,d,f=e.pattern;r&&(e.abbreviate=!0),d=function(e,t){return t&&(t=X(t)),e&&(e=X(e)),new RegExp("(?:[#0]+".concat(e,")?[#0]+(?:").concat(t,"[#0]+)?"))}(t,n),s=f.match(d),s=s?s[0]:"",a=s?f.substr(0,f.indexOf(s)):f,l=s?f.substring(f.indexOf(s)+s.length):"",s||(s=f?"#":"##########"),t&&t===n&&(i=s.split(n),o=i.pop(),s=i.join("")+n+o,t=""),c=t,t=/,/.test(n)?"¤":",",c&&(s=s.replace(le(c,"g"),t)),u=n,n=".",u&&(s=s.replace(le(u,"g"),n)),h=s.match(/#/g),h=h?h.length:0;const p=f.split(u);let g;p[1]&&(g=p[1].match(oe)),e.prefix=a||"",e.postfix=l||"",e.pattern=f,e.maxPrecision=g?g.length:2,e.percentage=J.test(f),e.numericPattern=s||"",e.numericRegex=new RegExp("".concat(le(t,null,!0),"|").concat(le(n,null,!0)),"g"),e.groupTemp=c,e.decTemp=u,e.t=t,e.d=n,e.temp=h}class ue{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 G;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 ue(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],ie.test(e[0])&&(r.positive.isFunctional=!0),e[1]?ie.test(e[1])&&(r.negative.isFunctional=!0):r.negative=!1,e[2]?ie.test(e[2])&&(r.zero.isFunctional=!0):r.zero=!1;const i="U"===this.type;r.positive.isFunctional||ce(r.positive,t,n,i),r.negative&&!r.negative.isFunctional&&ce(r.negative,t,n,i),r.zero&&!r.zero.isFunctional&&ce(r.zero,t,n,i)}formatValue(e){let t,n,r,i,o,s,a,l,c,u=this._prepared,h="",d="",f=e;if(isNaN(e))return"".concat(f);if(e=+e,!1===u.pattern)return e.toString();if(0===e&&u.zero)return u=u.zero,u.pattern;if(e<0&&u.negative?(u=u.negative,e=-e):u=u.positive,o=u.d,s=u.t,u.isFunctional)e=ae(e,u.pattern,o);else{if(u.percentage&&(e*=100),u.abbreviate){const t=Object.keys(this.abbreviations).map(e=>parseInt(e,10)).sort((e,t)=>e-t);let r,i,o=t[0];for(a=0,n=Number(Number(e).toExponential().split("e")[1]);o<=n&&a<t.length;)a++,o=t[a];a>0&&(r=t[a-1]),r&&n>0&&r>0?i=r:(n<0&&r<0||!r)&&(o<0&&o-n<=u.maxPrecision?i=o:r<=n&&!(o>0&&-n<=u.maxPrecision)&&(i=r)),i&&(h=this.abbreviations[i],e/=10**i)}if(r=Math.abs(e),t=u.temp,l=u.numericPattern,c=l.split(o)[1],"I"===this.type&&(e=Math.round(e)),i=e,c||"#"!==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,c?c.length:0)).split(".")[0]);let n=l.split(o)[0];if(n+=o,e=K(n,t)||"0",c){const t=Math.max(0,Math.min(14,c.length)),n=c.replace(/#+$/,"").length;let i=("I"===this.type?0:r%1+1e-15).toFixed(t).slice(2).replace(/0+$/,"");for(a=i.length;a<n;a++)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)))),a=0;a<t;a++)l+="#";e=K(l,e)}e=e.replace(u.numericRegex,e=>e===s?u.groupTemp:e===o?u.decTemp:""),i<0&&!/^-/.test(e)&&(e="-".concat(e))}return u.prefix+e+d+h+u.postfix}static getStaticFormatter(){return{prepare(){},formatValue:e=>"".concat(e)}}}function he(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,s,a=Object.create(null),l=Object.create(null),c=0,u=0;return o=r?function(){return s=i(...arguments),o.has(s)?o.get(s):o.set(s,e(...arguments))}:t=>(s=i(t),o.has(s)?o.get(s):o.set(s,e(t))),o.set=(e,t)=>(c>=n&&(delete a[l[u]],delete l[u],c--,u++),a[e]=t,l[c]=e,c++,t),o.get=e=>a[e],o.has=e=>e in a,o.clear=()=>{a=Object.create(null),l=Object.create(null),c=0,u=0},o.size=()=>c,o}function de(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 ue(...t)}(i,e,t,n,r),s=he(o.formatValue.bind(o),{toKey:e=>isNaN(e)?e:+e});function a(e){return s(e)}return a.format=function(e,t,n,r){return s.clear(),o.format(t,e,n,r)},a.pattern=function(e){return e&&(s.clear(),o.pattern=e,o.prepare()),o.pattern},a}const fe="D",pe="T",ge="TS",me="IV",ye=["Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"],be=["Mon","Tue","Wed","Thu","Fri","Sat","Sun"],ve=["January","February","March","April","May","June","July","August","September","October","November","December"],xe=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function we(e,t){for(let n=e.length;n<t;n++)e="0".concat(e);return e}function Me(e){let t=e.toString().split(".");return t[1]?(t=Number("0.".concat(t[1])),t):0}function ke(e,t){let n,r=function(e){const t=e,n=24*Me(t),r=60*Me(n),i=60*Me(r),o=1e3*Me(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,s=r.m,a=r.s,l=r.f,c=0;/w+|t+/gi.test(t)&&(n=new Date(Date.UTC(1899,11,30+Math.floor(e),0,0,Math.round(86400*(e-Math.floor(e))))),isNaN(n.getTime())&&(n=null)),/D+/gi.test(t)||(o+=24*i),/h+/gi.test(t)||(s+=60*o),/m+/gi.test(t)||(a+=60*s),/w+/gi.test(t)&&(c=n?n.getDay()-1:0,c<0&&(c=6));let u="";return n&&(u=n.getUTCHours()>=12?"pm":"am"),{year:0,month:0,day:c,date:i,h:o,m:s,s:a,f:l,t:u}}class qe{constructor(e,t,n){const r=e||{};r.qCalendarStrings||(r.qCalendarStrings={qLongDayNames:ye,qDayNames:be,qLongMonthNames:ve,qMonthNames:xe}),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={[pe]:r.qTimeFmt||"hh:mm:ss",[fe]:r.qDateFmt||"YYYY-MM-DD",[ge]:r.qTimestampFmt||"YYYY-MM-DD hh:mm:ss"}[n]),this.pattern=t}clone(){const e=new qe(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=ke(e,t));const i=function(e,t){return{"Y+|y+":{Y:"".concat(Number("".concat(t.year).slice(-2))),YY:we("".concat(t.year).slice(-2),2),YYY:we("".concat(t.year).slice(-3),3),def:e=>we("".concat(t.year),e.length)},"M+":{M:t.month+1,MM:we("".concat(t.month+1),2),MMM:e.locale_months_abbr[t.month],def:e.locale_months[t.month]},"W+|w+":{W:t.day,WW:we("".concat(t.day),2),WWW:e.locale_days_abbr[t.day],def:e.locale_days[t.day]},"D+|d+":{D:t.date,def:e=>we("".concat(t.date),e.length)},"h+|H+":{h:t.h,def:e=>we("".concat(t.h),e.length)},"m+":{m:t.m,def:e=>we("".concat(t.m),e.length)},"s+|S+":{s:t.s,def:e=>we("".concat(t.s),e.length)},"f+|F+":{def(e){let n="".concat(t.f),r=e.length-n.length;if(r>0)for(let e=0;e<r;e++)n+="0";else r<0&&(n=n.slice(0,e.length));return n}},"t{1,2}|T{1,2}":{def(e){let n=t.t;return e[0].toUpperCase()===e[0]&&(n=n.toUpperCase()),n=n.slice(0,e.length),n}}}}(this,r),o=[];for(const e in i)Object.prototype.hasOwnProperty.call(i,e)&&o.push(e);const s=new RegExp(o.join("|"),"g");return t.replace(s,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 Se(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return new qe(...t)}function _e(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"TS",n=Se(arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,e,t),r=he(n.format.bind(n),{toKey:e=>"object"==typeof e&&"function"==typeof e.getTime?e.getTime():e});function i(e){return t!==me?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=Se(i,e,t),r=he(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 De(){let e,{meta:t,id:n,key:r,localeInfo:i,fieldExtractor:o,value:s,type:a,sourceField:l}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const c=s||("dimension"===a?e=>null==e?void 0:e.qElemNo:e=>null==e?void 0:e.qValue),u="dimension"===a?"first":"avg",h=function(e,t){if(e&&e.qNumFormat&&-1!==["D","T","TS","IV"].indexOf(e.qNumFormat.qType))return _e(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",s=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,s=s&&-1===["M"].indexOf(e.qNumFormat.qType)):s=!0,(s||"U"===o)&&(n="#".concat(i,"##"),o="U"),de(n,r,i,o,t)}(t,i),d={id:()=>n,key:()=>r,raw:()=>t,title:()=>t.qFallbackTitle||t.label,type:()=>a,origin:()=>l,items:()=>(e||(e=o(d)),e),min:()=>t.qMin,max:()=>t.qMax,value:c,label:e=>(null==e?void 0:e.qText)||"",reduce:u,reduceLabel:"dimension"===a?"first":(e,t)=>h(t),formatter:()=>h,tags:()=>t.qTags};return d}function Ce(e,t,n,r,i){return(t[e]||[]).map((t,o)=>{const s="".concat(r?"".concat(r,"/"):"").concat(e,"/").concat(o),a={instance:De(h({id:"".concat(n?"".concat(n,"/"):"").concat(s),key:s,meta:t},i))};return a.attrDims=Ce("qAttrDimInfo",t,n,s,h({},i,{value:e=>null==e?void 0:e.qElemNo,type:"dimension"})),a.attrExps=Ce("qAttrExprInfo",t,n,s,h({},i,{value:e=>null==e?void 0:e.qNum,type:"measure"})),a.measures=Ce("qMeasureInfo",t,n,s,h({},i,{value:e=>null==e?void 0:e.qValue,type:"measure"})),a})}function Ee(){let{key:e,data:t,config:r={}}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const i={fields:[],wrappedFields:[],allFields:[],virtualFields:[]},o=t;if(!o)throw new Error('Missing "data" input');if(!o.qDimensionInfo)throw new Error('The "data" input is not recognized as a hypercube');const s=Ee.util,a={cache:i,cube:o,localeInfo:r.localeInfo,fieldExtractor:null,pages:null,hierarchy:()=>null,virtualFields:r.virtualFields},l={key:()=>e,raw:()=>o,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:()=>i.fields.slice(),extract:e=>a.extractor(e,l,i,s),hierarchy:e=>a.hierarchy(e,l,i,s),_cache:()=>i};"K"===o.qMode||"T"===o.qMode||!o.qMode&&o.qNodesOnDim?(a.extractor=Y,a.hierarchy=U,a.pages="K"===o.qMode?o.qStackedDataPages:o.qTreeDataPages):"S"===o.qMode?(a.extractor=g,a.pages=o.qDataPages,a.hierarchy=U):a.extractor=()=>[],a.fieldExtractor=e=>a.extractor({field:e},l,i,s);const c="S"===o.qMode?e=>e.qElemNumber:void 0,u="S"===o.qMode?e=>e.qNum:void 0;i.wrappedFields.push(...Ce("qDimensionInfo",o,e,"",h({},a,{value:c,type:"dimension"}))),i.wrappedFields.push(...Ce("qMeasureInfo",o,e,"",h({},a,{value:u,type:"measure"}))),i.fields=i.wrappedFields.map(e=>e.instance);const d=e=>{e.forEach(e=>{i.allFields.push(e.instance),d(e.measures),d(e.attrDims),d(e.attrExps)})};return d(i.wrappedFields),(r.virtualFields||[]).forEach(t=>{const r=l.field(t.from),o=De(n({meta:r.raw(),id:"".concat(e,"/").concat(t.key),sourceField:r,fieldExtractor:e=>a.extractor({field:e},l,i,s),key:t.key,type:r.type(),localeInfo:a.localeInfo,value:r.value},t.override||{}));i.virtualFields.push(o)}),i.allFields.push(...i.virtualFields),l}const Ae=[["qHyperCube","qHyperCubeDef"],["qTreeData","qTreeDataDef"],["qDimensionInfo","qDimensions"],["qMeasureInfo","qMeasures"],["qAttrDimInfo","qAttributeDimensions"],["qAttrExprInfo","qAttributeExpressions"]],Te=/\/qDimensionInfo(?:\/(\d+))?/,Ne=/\/qMeasureInfo\/(\d+)/,Oe=/\/qAttrDimInfo\/(\d+)(?:\/(\d+))?/,Re=/\/qAttrExprInfo\/(\d+)/,Ie=/\/?qHyperCube/,Pe=/\/?qTreeData/,Le=e=>"".concat(e.substr(0,e.indexOf("/qHyperCubeDef")+14)),je=e=>"".concat(e.substr(0,e.indexOf("/qTreeDataDef")+13));function Fe(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=[],s={},a=e.isActive();let l=!1;return e.brushes().forEach(e=>{const t=function(e,t){let n=e,r=-1,i=-1,o="",s=e=>e;Ie.test(e)?(o="".concat(n.substr(0,n.indexOf("qHyperCube")+10)),s=Le):Pe.test(e)&&(o="".concat(n.substr(0,n.indexOf("qTreeData")+9)),s=je);let a=!0;if(Te.test(e)&&(r=+Te.exec(e)[1]),Ne.test(e)&&(i=+Ne.exec(e)[1]),Oe.test(e)){i=-1,r=0;const e=+Oe.exec(n)[2];isNaN(e)||(r=e,n=n.replace(/\/\d+$/,"")),a=!1}if(Re.test(e)){const e=i;if(t){i=0;const s=N(o,t);i+=(s.qMeasureInfo||[]).length,r>-1?(i=s.qDimensionInfo.slice(0,r).reduce((e,t)=>e+t.qAttrExprInfo.length,i),r=-1):(i=s.qDimensionInfo.reduce((e,t)=>e+t.qAttrExprInfo.length,i),i=s.qMeasureInfo.slice(0,e).reduce((e,t)=>e+t.qAttrExprInfo.length,i)),i+=+Re.exec(n)[1]}else r>-1?(r=-1,i=+Re.exec(n)[1]):i+=+Re.exec(n)[1]+1}return Ae.forEach(e=>{let[t,r]=e;n=n.replace(t,r)}),a&&(n=s(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,s.multiRangeSelectTreeDataValues||(s.multiRangeSelectTreeDataValues={path:t.path,ranges:[]}),n.forEach(e=>s.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,s.rangeSelectHyperCubeValues||(s.rangeSelectHyperCubeValues={path:t.path,ranges:[]}),n.forEach(e=>s.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,s.selectHyperCubeContinuousRange||(s.selectHyperCubeContinuousRange={path:t.path,ranges:[]}),n.forEach(e=>s.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,a=r.qEffectiveInterColumnSortOrder.indexOf(t.dimensionIdx);if(s.selectPivotCells||(s.selectPivotCells={path:t.path,cells:[]}),e.id===i||!i){const n=e.brush.values().map(e=>+e).filter(e=>!isNaN(e));(0===o||a>=o)&&o>-1?n.forEach(e=>{s.selectPivotCells.cells.push({qType:"T",qCol:e,qRow:a-o})}):n.forEach(e=>{s.selectPivotCells.cells.push({qType:"L",qCol:t.dimensionIdx,qRow:e})}),l=!!s.selectPivotCells.cells.length}}else s.selectHyperCubeCells||(s.selectHyperCubeCells={path:t.path,cols:[]}),s.selectHyperCubeCells.cols.push(t.dimensionIdx),e.id!==i&&(i||s.selectHyperCubeCells.values)||(s.selectHyperCubeCells.values=e.brush.values().map(e=>+e).filter(e=>!isNaN(e)),l=!!s.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&&a?[{method:"resetMadeSelections",params:[]}]:(s.rangeSelectHyperCubeValues&&o.push({method:"rangeSelectHyperCubeValues",params:[s.rangeSelectHyperCubeValues.path,s.rangeSelectHyperCubeValues.ranges,[],null===(c=t.orMode)||void 0===c||c]}),s.selectHyperCubeContinuousRange&&o.push({method:"selectHyperCubeContinuousRange",params:[s.selectHyperCubeContinuousRange.path,s.selectHyperCubeContinuousRange.ranges]}),s.selectHyperCubeCells&&o.push({method:"selectHyperCubeCells",params:[s.selectHyperCubeCells.path,s.selectHyperCubeCells.values,s.selectHyperCubeCells.cols]}),s.selectPivotCells&&o.push({method:"selectPivotCells",params:[s.selectPivotCells.path,s.selectPivotCells.cells]}),s.multiRangeSelectTreeDataValues&&o.push({method:"multiRangeSelectTreeDataValues",params:[s.multiRangeSelectTreeDataValues.path,s.multiRangeSelectTreeDataValues.ranges]}),o);var c}function ze(e){Ee.util=e.data("matrix").util,e.data("q",Ee),e.formatter("q-number",de),e.formatter("q-time",_e)}return ze.qBrushHelper=Fe,ze.selections=Fe,ze}());_b(Hv);const Vv=/xyz/.test(()=>{})?/\b_super\b/:/.*/,Bv=function(){};Bv.extend=function e(t,n){const r=this.prototype;"string"!=typeof t&&(n=t,t="Class");const i=Object.create(this.prototype);for(const e in n)i[e]="function"==typeof n[e]&&"function"==typeof r[e]&&Vv.test(n[e])?function(e,t){return function(){const n=this._super;this._super=r[e];const i=t.apply(this,arguments);return this._super=n,i}}(e,n[e]):n[e];if(!/^[_a-z][_a-z\d]*$/i.test(t))throw new Error("Invalid subclass name. Alphanumericals only.");const o=new Function(`return (function ${t}(){ typeof this.init === 'function' && this.init.apply(this, [].slice.call(arguments)) });`)();return o.prototype=i,o.prototype.constructor=o,o.extend=e,o};const $v={getChar(e){let t,n=e;return n>9?(t=65+n-10,t>90&&(t+=6)):n=`${n}`.charCodeAt(0),[48,111,79,105,73,108].indexOf(t)>-1?this.getChar(n+1):String.fromCharCode(t)},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,"")}};function Wv(){return $v.id()}const Uv="scrollbar";function Yv(e,t,n){return"y"===e?Kv(t,n):function(e){return"far"===e?"top":"bottom"}(t)}function Kv(e,t){const n=e||"near";return t&&"near"===n||!t&&"far"===n?"right":"left"}var Xv={getAxisDock:Yv,getOppositeAxisDock:function(e,t,n){return Yv(e,"far"===t?"near":"far",n)},getYAxisDock:Kv};const Gv=new RegExp("[A-Za-zªµºÀ-ÖØ-öø-ʸʻ-ˁː-ˑˠ-ˤˮͰ-ͳͶ-ͽΆΈ-ϵϷ-҂Ҋ-։ः-हऻऽ-ीॉ-ौॎ-ॐक़-ॡ।-ॿং-হঽ-ীে-ৌৎ-ৡ০-ৱ৴-৺ਃ-ਹਾ-ੀਖ਼-੯ੲ-ੴઃ-હઽ-ીૉ-ૌૐ-ૡ૦-૯ଂ-ହଽ-ାୀେ-ୌୗ-ୡ୦-୷ஃ-ிு-ௌௐ-௲ఁ-ఽు-ౄౘ-ౡ౦-౯౿-ಹಽ-ೋೕ-ೡ೦-ീെ-ൌൎ-ൡ൦-ෆා-ෑෘ-ะา-ำเ-ๆ๏-ະາ-ຳຽ-ໆ໐-༗༚-༴༶༸༾-ཬཿ྅ྈ-ྌ྾-࿅࿇-ာေးျ-ြဿ-ၗၚ-ၝၡ-ၰၵ-ႁႃ-ႄႇ-ႌႎ-ႜ႞-ፚ፠-ᎏᎠ-Ᏼᐁ-ᙿᚁ-ᚚᚠ-ᜑᜠ-ᜱ᜵-ᝑᝠ-ᝰក-ាើ-ៅះ-ៈ។-៚ៜ០-៩᠐-ᢨᢪ-ᤜᤣ-ᤦᤩ-ᤱᤳ-ᤸ᥆-᧚ᨀ-ᨖᨙ-ᩕᩗᩡᩣ-ᩤᩭ-ᩲ᪀-᪭ᬄ-ᬳᬵᬻᬽ-ᭁᭃ-᭪᭴-᭼ᮂ-ᮡᮦ-ᮧ᮪-ᯥᯧᯪ-ᯬᯮ᯲-ᰫᰴ-ᰵ᰻-᱿᳓᳡ᳩ-ᳬᳮ-ᶿḀ-ᾼιῂ-ῌῐ-Ίῠ-Ῥῲ-ῼⁱⁿₐ-ₜℂℇℊ-ℓℕℙ-ℝℤΩℨK-ℭℯ-ℹℼ-ℿⅅ-ⅉⅎ-⅏Ⅰ-ↈ⌶-⍺⎕⒜-ⓩ⚬⠀-⣿Ⰰ-ⳤⳫ-ⳮⴀ-⵰ⶀ-ⷞ々-〇〡-〩〱-〵〸-〼ぁ-ゖゝ-ゟァ-ヺー-ㆺㇰ-㈜㈠-㉏㉠-㉻㉿-㊰㋀-㋋㋐-㍶㍻-㏝㏠-㏾㐀-䶵一-ꒌꓐ-ꘌꘐ-ꙮꚀ-ꛯ꛲-꛷Ꜣ-ꞇ꞉-ꠁꠃ-ꠅꠇ-ꠊꠌ-ꠤꠧ꠰-꠷ꡀ-ꡳꢀ-ꣃ꣎-꣙ꣲ-ꤥ꤮-ꥆꥒ-ꥼꦃ-ꦲꦴ-ꦵꦺ-ꦻꦽ-ꨨꨯ-ꨰꨳ-ꨴꩀ-ꩂꩄ-ꩋꩍ-ꪯꪱꪵ-ꪶꪹ-ꪽꫀꫂ-ꯤꯦ-ꯧꯩ-꯬꯰-ﬗA-Za-zヲ-ᅵ]"),Jv=new RegExp("[־׀׃׆א-״߀-ߪߴ-ߵߺ-ࠕࠚࠤࠨ࠰-ࡘ࡞יִײַ-ﬨשׁ-ﭏ]"),Zv=new RegExp("[؈؋؍؛-ي٭-ٯٱ-ەۥ-ۦۮ-ۯۺ-܍ܐܒ-ܯݍ-ޥޱﭐ-ﴽﵐ-﷼ﹰ-ﻼ]");function Qv(e){return Gv.test(e)}function ex(e){return Jv.test(e)||Zv.test(e)}var tx={lrm:String.fromCharCode(8206),detectTextDirection:function(e){const t=e?e.length:0;let n,r;for(n=0;n<t;n++){if(r=e[n],Qv(r))return"ltr";if(ex(r))return"rtl"}return"ltr"}};var nx={lineSettings:function(e,t){const n=void 0!==t.paletteColor?t.theme.getColorPickerColor(t.paletteColor):"transparent";return Sb(!0,{value:0,line:{stroke:n,strokeDasharray:t?.style?.lineType}},e||{})},lineLabelSettings:function(e,t){const n=t&&t.chartID;let r=t.theme.getStyle(n,"referenceLine.label.name","color");const i=t.theme.getStyle(n,"referenceLine.label.name","fontSize"),o=t.theme.getStyle(n,"referenceLine.label.name","fontFamily");return t.paletteColor?r=t.theme.getColorPickerColor(t.paletteColor):r||(r="transparent"),Sb(!0,{value:0,line:{stroke:"transparent"},label:{align:"center",vAlign:"middle",text:"",fill:r,fontFamily:o,fontSize:i,maxWidthPx:135}},e||{})},isVisible:e=>e&&!1!==e.show&&0!==e.show&&"0"!==e.show&&void 0!==e.refLineExpr,getRefLineTitle:function({refLine:e,label:t,valueString:n}){return!1!==e.showValue?!1!==e.showLabel?`${t} ${tx.lrm}(${n})${tx.lrm}`:`${tx.lrm}(${n})${tx.lrm}`:!1!==e.showLabel?t:""}};const rx={SHOW_AXIS_LABELS_OPTIONS:["all","labels"],SHOW_TITLE_OPTIONS:["all","title"],HORIZONTAL:"horizontal",VERTICAL:"vertical",LAYOUTSETTINGS:{lasso:{displayOrder:1e4},rangeDim:{displayOrder:1e4},rangeMeasure:{displayOrder:1e4},rangeMinor:{displayOrder:1e4},scrollBar:{minimumLayoutMode:"SPARK",prioOrder:-1,displayOrder:100},refLines:{layout:{minimumLayoutMode:"SPARK",prioOrder:60,displayOrder:1110}},measureAxisTitle:{minimumLayoutMode:"XSMALL",prioOrder:30,displayOrder:90},dimensionAxisTitle:{minimumLayoutMode:"XSMALL",prioOrder:30,displayOrder:90},measureAxis:{minimumLayoutMode:"XSMALL",prioOrder:10,displayOrder:80},dimensionAxis:{minimumLayoutMode:"XSMALL",prioOrder:10,displayOrder:80},gridLines:{minimumLayoutMode:"XSMALL",displayOrder:-100},refLinesLabels:{minimumLayoutMode:"SMALL",prioOrder:60,displayOrder:0}}};rx.DEFAULT_CHART_ORIENTATION=rx.HORIZONTAL;function ix(e,t){const n=t||{},r=n.measureAxisProperties||{},i=n.dimensionAxisProperties||{},o=n.orientation||rx.DEFAULT_CHART_ORIENTATION,s=o===rx.HORIZONTAL,a=s?"x":"y",l=s?"y":"x",c=rx.SHOW_AXIS_LABELS_OPTIONS,u=rx.SHOW_TITLE_OPTIONS,h=c.includes(r.show),d=!!n.measureTitleText&&u.includes(r.show),f=n.includeDimensionAxis&&c.includes(i.show),p=n.includeDimensionAxis&&!!n.dimensionTitleText&&u.includes(i.show),g=n.gridlines&&!(!n.gridlines.auto&&0===n.gridlines.spacing),m=n.refLines&&n.refLines.some(e=>e.show),y=[];if(h&&function(e,t,n,r){let i={scale:"measure",settings:t.axisLabelStyle||{},forceBounds:r&&!r.autoMinMax&&r.showBounds};i=Sb(i,rx.LAYOUTSETTINGS.measureAxis);const o=sx(t,n);e.addComponent(`${n}-axis`,i,o)}(e,n,a,r),d&&function(e,t,n){let r={text:t.measureTitleText,style:t.axisTitleStyle||{}};r=Sb(r,rx.LAYOUTSETTINGS.measureAxisTitle);const i=function(e,t){return sx(e,t)}(t,n);e.addComponent(`${n}-axis-title`,r,i)}(e,n,a),function(e,t,n,r){let i=t.measureScaleSettings;const o={isRtl:t.isRtl,source:t.measureSource,orientation:n,measureAxisProperties:r};r&&r.spacing>0&&(i=Sb(!0,i||{},{component:{ticks:{distance:100*r.spacing}}}));e.addScale("measure-scale",i,o)}(e,n,o,r),f&&function(e,t,n){let r={scale:"dimension",settings:t.axisLabelStyle||{}};r=Sb(r,rx.LAYOUTSETTINGS.dimensionAxis);const i=ax(t,n);Sb(!0,r,t.dimensionAxisSettings||{}),e.addComponent(`${n}-axis`,r,i)}(e,n,l),p&&function(e,t,n){let r={text:t.dimensionTitleText,style:t.axisTitleStyle||{}};r=Sb(r,rx.LAYOUTSETTINGS.dimensionAxisTitle);const i=function(e,t){return ax(e,t)}(t,n);e.addComponent(`${n}-axis-title`,r,i)}(e,n,l),n.includeDimensionAxis&&function(e,t,n){const r={isRtl:t.isRtl,source:t.dimensionSource,orientation:n===rx.HORIZONTAL?rx.VERTICAL:rx.HORIZONTAL};e.addScale("dimension-scale",t.dimensionScaleSettings,r)}(e,n,o),g&&function(e,t,n){let r={ticks:{show:!0},minorTicks:{show:!t.auto&&!t.auto&&3===t.spacing}};r=Sb(r,rx.LAYOUTSETTINGS.gridLines),r[n]={scale:"measure"},e.addComponent("grid-line",r)}(e,n.gridlines,a),n.hasNavigation&&function(e,t,n,r){const i=e.getSettings();i.scroll={dimension:{viewSize:n.scrollSettings&&n.scrollSettings.viewSize||0,max:n.scrollSettings&&n.scrollSettings.max||0}};const o={isRtl:n.isRtl,chartID:n.chartID,isHorizontal:!r},s=Sb({},rx.LAYOUTSETTINGS.scrollBar);e.addComponent("scrollbar",s,o),ox(t,function(e){function t(t,n){if(!n||!e())return!1;const r={x:n.center.x-n.deltaX,y:n.center.y-n.deltaY};return this.chart.componentsFromPoint(r).some(e=>e.settings.key===Uv)}const n={type:"Tap",options:{enable:t},events:{tap(e){this.chart.component(Uv).emit("tap",e)}}},r={type:"Pan",options:{enable:t},events:{panstart(e){this.chart.component(Uv).emit("panStart",e)},pan(e){this.chart.component(Uv).emit("panMove",e)},panend(e){this.chart.component(Uv).emit("panEnd",e)},pancancel(e){this.chart.component(Uv).emit("panCancel",e)}}};return[n,r]}(n.isNavigationEnabledFn))}(e,y,n,s),m&&function(e,t,n,r){const i=Xv.getAxisDock(n,r.dock,t.isRtl);let o={key:"ref-line",style:{oob:{show:!1}},lines:{x:[],y:[]}};o=Sb(o,rx.LAYOUTSETTINGS.refLines);let s={key:`ref-line-labels-${Wv()}`,require:["renderer","chart"],dock:Xv.getOppositeAxisDock(n,r.dock,t.isRtl),preferredSize(){if("x"===n)return 26;const t=this.renderer.measureText,r=this.chart.formatter({data:e.settings.scales.measure.data}),i=s.lines.y.map(e=>{const n=!1!==e.label.showValue?`(${r(e.value)})`:"",i=`${e.label.text} ${n}`,o=e.label.text&&n?` ${n}`:n;return{wanted:t({text:i,fontSize:e.fontSize,fontFamily:e.fontFamily}).width,required:t({text:o,fontSize:e.fontSize,fontFamily:e.fontFamily}).width}}),o=i[0];for(let e=1;e<i.length;e++)i[e].wanted>o.wanted&&(o.wanted=i[e].wanted),i[e].required>o.required&&(o.required=i[e].required);const a=12;return o.required+a>100?o.required+a:Math.min(o.wanted+a,100)},lines:{x:[],y:[]}};s=Sb(s,rx.LAYOUTSETTINGS.refLinesLabels),t.refLines.forEach(r=>{if(!r.show)return;const a=r.refLineExpr&&r.refLineExpr.value,l=Sb(!0,{},t,{paletteColor:r.paletteColor,style:r.style,chartID:e.options.chartID}),c=nx.lineSettings({scale:"measure",dir:n,value:a},l);o.lines[n].push(c);const u=nx.lineLabelSettings({scale:"measure",value:a,label:{text:!1!==r.showLabel?r.label:"",showValue:!1!==r.showValue}},l);"x"===n?u.label.vAlign="near"===i?1:0:u.label.align="near"===i?0:1,s.lines[n].push(u)}),e.addComponent("ref-line",o,{}),e.addComponent("ref-line",s,{})}(e,n,a,r),n.enableLasso&&n.selectionsEnabled){!function(e,t){const n={brushKey:t.brushKey,brushComponents:t.brushComponents,brushData:t.brushData};e.addComponent("lasso",rx.LAYOUTSETTINGS.lasso,n)}(e,n.lasso||{})}if(n.enableDimRange&&n.includeDimensionAxis&&n.selectionsEnabled){!function(e,t,n,r,i){let o={key:"rangeDim"};o=Sb(o,rx.LAYOUTSETTINGS.rangeDim);const s={brushKey:t.brushKey,brushAxis:t.brushAxis,brushArea:t.brushArea,brushScale:t.brushScale,isHorizontal:!n,dock:r,isRtl:i};e.addComponent("range",o,s)}(e,n.dimRange||{},s,ax(n,l).dock,n.isRtl)}if(n.enableMeasureRange&&n.selectionsEnabled){!function(e,t,n,r,i){let o={key:"rangeMeasure"};o=Sb(o,rx.LAYOUTSETTINGS.rangeMeasure);const s={brushKey:t.brushKey,brushAxis:t.brushAxis,brushArea:t.brushArea,brushScale:t.brushScale,multiple:t.multiple,isHorizontal:n,dock:r,isRtl:i};e.addComponent("range",o,s)}(e,n.measureRange||{},s,sx(n,a).dock,n.isRtl)}if(n.enableAreaRange&&n.selectionsEnabled){!function(e,t,n,r,i){let o={key:"rangeMinor"};o=Sb(o,rx.LAYOUTSETTINGS.rangeMinor);const s={brushKey:t.brushKey,brushAxis:t.brushAxis,brushData:t.brushData,brushArea:t.brushArea,brushComponents:t.brushComponents,brushScale:t.brushScale,multiple:t.multiple,isHorizontal:"measure"===t.brushScale?n:!n,dock:r,isRtl:i,chartInstance:t.chartInstance};e.addComponent("range-area",o,s)}(e,n.areaRange||{},s,ax(n,l).dock,n.isRtl)}n.brushActions&&ox(y,n.brushActions),y.length&&function(e,t){e.addInteraction({},{gestures:t})}(e,y)}function ox(e,t){t.forEach(t=>{e.push(t)})}function sx(e,t){return{dock:e.measureAxisProperties&&e.measureAxisProperties.dock,direction:t,isRtl:e.isRtl}}function ax(e,t){return{dock:e.dimensionAxisProperties&&e.dimensionAxisProperties.dock,direction:t,isRtl:e.isRtl}}function lx(e,t){const n=t||{},r=!n.orientation||"horizontal"===n.orientation,i=!!n.isRtl,o={name:n.name||"scale",component:{invert:r&&i,minorTicks:{count:1},range:n.range||void 0,domain:n.domain||void 0,trackBy:n.trackBy||"id"}};return Sb(!0,{},o,e||{})}function cx(){return/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)?void 0:"svg"}function ux(e,t){const n=t&&t.chartID,r=t&&t.dock,i=t&&t.direction,o=t&&t.isRtl,s=t.theme.getStyle(n,"axis.line.major","color"),a=t.theme.getStyle(n,"axis.title","fontSize"),l=t.theme.getStyle(n,"axis.title","color"),c=t.theme.getStyle(n,"axis.label.name","color"),u=t.theme.getStyle(n,"axis.label.name","fontSize"),h=t.theme.getStyle(n,"axis.title","fontFamily"),d=t.theme.getStyle(n,"axis.label.name","fontFamily"),f={key:"axis",type:"axis",renderer:cx(),dock:Xv.getAxisDock(i,r,o),brush:{trigger:[],consume:[]},settings:{title:{fontSize:a,fontFamily:h,fill:l},line:{show:!0,strokeWidth:1,stroke:s},labels:{fill:c,fontSize:u,fontFamily:d,tiltAngle:o?-40:40,maxEdgeBleed:75,maxSize:150,mode:"auto"},ticks:{stroke:s},minorTicks:{stroke:s}}},p=Sb(!0,{},f,e||{});return p.brush.consume.forEach(e=>{e.style.active.strokeWidth=0}),p}function hx(e,t){const n=t&&t.chartID,r=t&&t.dock,i=t&&t.direction,o=t&&t.isRtl,s=t.theme.getStyle(n,"axis.title","fontSize"),a=t.theme.getStyle(n,"axis.title","color"),l=t.theme.getStyle(n,"axis.title","fontFamily"),c={key:"text",type:"text",dock:Xv.getAxisDock(i,r,o),displayOrder:0,style:{text:{fontSize:s,fontFamily:l,fill:a}}};return Sb(!0,{},c,e||{})}lx.measureScale=function(e,t){let n=(t||{}).source||[];"string"==typeof n&&(n=[n]);const r={name:"measure",component:{expand:.1,data:{fields:n.map(e=>({field:e}))}}},i=t&&t.measureAxisProperties;i&&!i.autoMinMax&&(["min","minMax"].includes(i.minMax)&&(r.component.min=i.min),["max","minMax"].includes(i.minMax)&&(r.component.max=i.max));const o=lx(Sb(!0,r,e||{}),t);return!(e&&e.component&&void 0!==e.component.invert)&&t&&"vertical"===t.orientation&&(o.component.invert=!o.component.invert),o},lx.dimensionScale=function(e,t){const n={name:"dimension",component:{trackBy:"id",type:"band",data:{extract:{field:t&&t.source||"",props:{label:e=>e.qText||""}}},label:e=>e.datum.label.value}};return lx(Sb(!0,n,e||{}),t)},ux.xAxis=function(e,t){return ux(Sb(!0,{key:"x-axis",scale:"x"},e||{}),t)},ux.yAxis=function(e,t){const n=t&&t.dock,r=t&&t.isRtl,i={key:"y-axis",scale:"y",dock:Xv.getYAxisDock(n,r)};return ux(Sb(!0,i,e||{}),t)},hx.xAxisTitle=function(e,t){return hx(Sb(!0,{key:"x-axis-title"},e||{}),t)},hx.yAxisTitle=function(e,t){const n=t&&t.dock,r=t&&t.isRtl,i={key:"y-axis-title",dock:Xv.getYAxisDock(n,r)||"left"};return hx(Sb(!0,i,e||{}),t)};var dx={getBublesAlign:function(e,t,n){let r=e&&"far"!==t||!e&&"far"===t;return!e&&n&&(r=!r),r?"start":"end"},getDock:function(e,t){const n=[];let r;return e&&n.push(`@${e}`),t&&n.push(`@${t}`),n.length&&(r=n.join(",")),r}};const fx={SPARK:{width:0,height:0},XSMALL:{width:150,height:75},SMALL:{width:300,height:150},MEDIUM:{width:400,height:220},FULL:{width:550,height:450}};function px(){return fx}function gx(e){const t=e.data.end;return e.dataset(t.source.key).field(t.source.field).formatter()(t.value)}px.getLayoutModeKeys=function(){const e=[];let t;for(t in fx)e.push(t);return e};const mx={left:"left",right:"right",up:"top",down:"bottom"};function yx(e,t,n){switch(e){case"scale":return lx(t,n);case"measure-scale":return lx.measureScale(t,n);case"dimension-scale":return lx.dimensionScale(t,n);case"axis":return ux(t,n);case"box-marker":return function(e){return Sb(!0,{},{key:"box-marker",type:"box-marker",settings:{minor:{scale:"x"},orientation:"horizontal"},brush:{trigger:[],consume:[]}},e||{})}(t);case"point-marker":return function(e){return Sb(!0,{},{key:"point-marker",type:"point-marker",settings:{},brush:{trigger:[],consume:[]}},e||{})}(t);case"scrollbar":return function(e,t){const n=t&&t.isRtl,r=t&&t.chartID,i=t&&t.isHorizontal,o={key:"scrollbar",type:"scrollbar",scroll:"dimension",dock:i?"bottom":n?"left":"right",settings:{backgroundColor:t.theme.getStyle(r,"","backgroundColor"),invert:n&&i}};return Sb(!0,{},o,e||{})}(t,n);case"text":return hx(t,n);case"lasso":return function(e,t){const n=t&&t.brushKey,r=t&&t.brushComponents?t.brushComponents:[],i=t&&t.brushData?t.brushData:["elemNo"],o={type:"brush-lasso",key:"lasso",displayOrder:99,settings:{brush:{components:[]},lasso:{fill:"rgba(0, 0, 0, 0)",stroke:"rgba(102,102,102,1)",strokeWidth:2,opacity:1,strokeDasharray:null},startPoint:{r:10,fill:"rgba(0, 152, 69, 1)",strokeWidth:0,opacity:1}}};return r.forEach(e=>{o.settings.brush.components.push({contexts:n?[n]:void 0,key:e,data:i})}),Sb(!0,{},o,e||{})}(t,n);case"range":return function(e,t){const n=t&&t.brushKey,r=t&&t.brushAxis,i=t&&t.brushArea,o=t&&t.brushScale,s=t&&t.isHorizontal,a=t&&t.dock,l=t&&t.isRtl,c={type:"brush-range",key:"range",displayOrder:99,dock:dx.getDock(r,i),settings:{brush:n,fill:"rgba(0, 0, 0, 0)",scale:o,multiple:!t||!1!==t.multiple||t.multiple,direction:s?"horizontal":"vertical",target:{component:r,fill:"rgba( 82, 204, 82, 0.2 )",fillActive:"rgba(82, 204, 82, 0.4)"},bubbles:{align:dx.getBublesAlign(s,a,l)}}};return Sb(!0,{},c,e||{})}(t,n);case"range-area":return function(e,t){const n=t&&t.brushKey,r=t&&t.brushAxis,i=t&&t.brushComponents?t.brushComponents:[],o=t&&t.brushData?t.brushData:["elemNo"],s=t&&t.brushArea,a=t&&t.isHorizontal,l=t&&t.dock,c=t&&t.isRtl,u=t&&t.chartInstance;let h=!0;const d={type:"brush-area-dir",key:"area",displayOrder:99,dock:dx.getDock(r,s),settings:{brush:{components:[]},direction:a?"horizontal":"vertical",target:{component:r,fill:"rgba( 82, 204, 82, 0.2 )",fillActive:"rgba(82, 204, 82, 0.4)"},bubbles:{align:dx.getBublesAlign(a,l,c),label:e=>h?(h=!1,u.dataset(e.binStart.source.key).field(e.binStart.source.field).formatter()(e.binStart.value)):(h=!0,u.dataset(e.binEnd.source.key).field(e.binEnd.source.field).formatter()(e.binEnd.value))},multiple:!t||!1!==t.multiple||t.multiple}};return i.forEach(e=>{d.settings.brush.components.push({contexts:n?[n]:void 0,key:e,data:o,action:"add"})}),Sb(!0,{},d,e||{})}(t,n);case"categorical-legend":return function(e,t){const n=t&&t.chartID,r=t&&t.isRtl;let i=t&&t.dock||"auto";const o=t&&t.show;"auto"===i&&(i=t.chartHeight/t.chartWidth<1?r?"left":"right":"bottom");const s=t.theme.getStyle(n,"legend.title","color"),a=t.theme.getStyle(n,"legend.title","fontSize"),l=t.theme.getStyle(n,"legend.label","color"),c=t.theme.getStyle(n,"legend.label","fontSize"),u=t.theme.getStyle(n,"legend.title","fontFamily"),h=t.theme.getStyle(n,"legend.label","fontFamily"),d={key:"legend",type:"legend-cat",renderer:cx(),dock:i,show:o,scale:{type:"color"},settings:{title:{anchor:"middle"},layout:{direction:r?"rtl":"ltr",size:"top"===i||"bottom"===i?2:1,vertical:"top"===i||"bottom"===i?16:8},navigation:{button:{class:{"lui-fade-button":!0},content:(e,t)=>e("span",{style:{pointerEvents:"none"},class:["lui-button__icon","lui-icon",`lui-icon--triangle-${mx[t.direction]}`].join(" ")})}}},style:{item:{label:{fontSize:c,fontFamily:h,fill:l,lineHeight:1,wordBreak:"break-word"},margin:{top:5,left:10,right:10,bottom:10},shape:{type:t.type?t.type:"square",size:3*parseInt(c,10)/4}},title:{show:t.showTitle,fontSize:a,fontFamily:u,fill:s}}};return Sb(!0,{},d,e)}(t,n);case"sequential-legend":return function(e,t){const n=t&&t.chartID,r=t&&t.isRtl;let i=t.dock||"auto";"auto"===i&&(i=t.chartHeight<t.chartWidth?r?"left":"right":"bottom");const o=t.theme.getStyle(n,"legend.title","color"),s=t.theme.getStyle(n,"legend.title","fontSize"),a=t.theme.getStyle(n,"legend.title","fontFamily"),l=t.theme.getStyle(n,"legend.label","color"),c=t.theme.getStyle(n,"legend.label","fontSize"),u=t.theme.getStyle(n,"legend.label","fontFamily");function h(e){switch(e){case"left":return 0;case"right":return 1;default:return.5}}const d={key:"seqlegend",type:"legend-seq",dock:i,displayOrder:200,minimumLayoutMode:"MEDIUM",prioOrder:0,settings:{align:h(r?"right":"left"),major:{invert:"left"===i||"right"===i||r},title:{show:t.showTitle,fontSize:s,fontFamily:a,fill:o},tick:{fill:l,fontSize:c,fontFamily:u}}};return Sb(!0,{},d,e)}(t,n);case"x-axis":return ux.xAxis(t,n);case"y-axis":return ux.yAxis(t,n);case"x-axis-title":return hx.xAxisTitle(t,n);case"y-axis-title":return hx.yAxisTitle(t,n);case"grid-line":return function(e,t){const n=t&&t.chartID,r=t.theme.getStyle(n,"grid.line.major","color");return Sb(!0,{},{displayOrder:-1,key:"grid-line",type:"grid-line",x:null,y:null,ticks:{stroke:r},minorTicks:{stroke:r}},e||{})}(t,n);case"interaction":return function(e,t){const n=t&&t.gestures||[];return Sb(!0,{},{type:"hammer",key:"hammered",gestures:n},e||{})}(t,n);case"ref-line":return function(e,t){const n=t&&t.chartID,r=t.theme.getStyle(n,"referenceLine.outOfBounds","color"),i=t.theme.getStyle(n,"referenceLine.outOfBounds","backgroundColor");return Sb(!0,{},{key:"ref-line",type:"ref-line",dock:"center",prioOrder:-1,lines:{x:[],y:[]},style:{oob:{width:7,fill:i,text:{fill:r},padding:{x:7,y:5}}}},e||{})}(t,n);case"event-area":return function(e){return Sb(!0,{},{type:"event-area",key:"event-area"},e||{})}(t);case"labels":return function(e,t){const n=t&&t.chartID,r=t.theme.getStyle(n,"label.value","color"),i=t.theme.getStyle(n,"label.value","fontSize"),o=t.theme.getStyle(n,"label.value","fontFamily"),s={key:"labels",type:"labels",renderer:cx(),displayOrder:1,settings:{sources:[{component:"box-marker",selector:"rect",strategy:{type:"bar",settings:{direction:"up",fontFamily:o,fontSize:parseFloat(i),align:.5,labels:[{placements:[{position:"outside",fill:r,justify:0},{position:"inside",fill:e&&e.settings.sources[0].strategy.settings.labels[0].placements[1].fill,justify:1}],label:gx}]}}}]}};return Sb(!0,{},s,e||{})}(t,n);default:return}}function bx(e){this.options=e||{},this.settings={dockLayout:{layoutModes:px()},components:[],scales:{}}}bx.prototype.addComponent=function(e,t,n){const r=yx(e,t,Sb(!0,{},this.options,n||{}));return this.settings.components.push(r),r},bx.prototype.addInteraction=function(e,t){const n=yx("interaction",e,Sb(!0,{},this.options,t||{}));return this.settings.interactions||(this.settings.interactions=[]),this.settings.interactions.push(n),n},bx.prototype.addScale=function(e,t,n){const r=yx(e,t,Sb(!0,{},this.options,n||{}));this.settings.scales[r.name]=r.component},bx.prototype.getSettings=function(){return this.settings},bx.prototype.getComponent=function(e){return this.settings.components.filter(t=>t.key===e)[0]},bx.prototype.addPreset=function(e,t){!function(e,t,n){if("dimension-measure-chart"!==e)throw Error("There is no chart preset with that type");ix(t,n)}(e,this,t)},bx.validateComponentKeys=function(e){const t={};return e.map(e=>{const n=e.key;return n?t[n]?`Duplicate key for component ${e.type}`:(t[n]=!0,null):`Missing key for component ${e.type}`}).filter(e=>!!e)},bx.create=function(e){return new bx(e)},bx.createComponent=yx;const vx={CENTER:0,BOTTOM:1};var xx={DISCLAIMERS:[{label:"NoDataExist",alignment:vx.CENTER,default:!0},{label:"RequireNumericDimension",alignment:vx.CENTER,default:!1},{label:"OnlyNanData",alignment:vx.CENTER,default:!0},{label:"OnlyNegativeOrZeroValues",alignment:vx.CENTER,default:!1},{label:"LimitedData",alignment:vx.BOTTOM,default:!1},{label:"OnlyNanColor",alignment:vx.BOTTOM,default:!1},{label:"NegativeOrZeroValues",alignment:vx.BOTTOM,default:!1},{label:"DataRangeIncludingZero",alignment:vx.BOTTOM,default:!1}],ALIGNMENT:vx};const wx={getNoDataExistAttribute:e=>e.qSize.qcy*e.qSize.qcx===0,getLimitedDataAttribute(e,t){let n,r=!1;var i;return e?void 0!==t.explicitLimitedData?r=!0===t.explicitLimitedData:e.qDataPages&&e.qDataPages[0]?r=!t.paging&&e.qSize.qcy>e.qDataPages[0].qMatrix.length:(i=e.qStackedDataPages)&&i[0]&&i[0].qData[0]&&i[0].qData[0].qSubNodes&&(n=t.maxNbrOfDimensions?t.maxNbrOfDimensions:2,r=e.qDimensionInfo.length>=n?e.qStackedDataPages[0].qData[0].qSubNodes.some(e=>e.qDown>0):e.qStackedDataPages[0].qData[0].qSubNodes.length<e.qStackedDataPages[0].qArea.qHeight):r=!0===t.explicitLimitedData,r},getNegativeOrZeroValuesAttribute:(e,t)=>!t.supportNegative&&e.qMeasureInfo.some(e=>e.qMin<=0),getOnlyNegativeOrZeroValuesAttribute:(e,t)=>!t.supportNegative&&e.qMeasureInfo.every(e=>e.qMax<=0&&e.qMax>=e.qMin)||0===e.qSize.qcy,getOnlyNanDataAttribute:(e,t)=>void 0!==t.explicitOnlyNanData?t.explicitOnlyNanData:e.qMeasureInfo.every(e=>e.qMax<e.qMin||"NaN"===e.qMax),getDataRangeIncludingZeroAttribute:(e,t)=>!t.supportRangeOverZero&&function(e,t){const n=t.length;let r,i,o,s,a;for(e&&(i=!(e.autoMinMax||"min"!==e.minMax&&"minMax"!==e.minMax||null===e.min||Number.isNaN(+e.min)),o=!(e.autoMinMax||"max"!==e.minMax&&"minMax"!==e.minMax||null===e.max||Number.isNaN(+e.max))),s=Number.MAX_VALUE,a=-Number.MAX_VALUE,r=0;r<n;r++)if(s=Math.min(s,t[r].qMin),a=Math.max(a,t[r].qMax),s<=0&&a>=0)return!0;return s=i?e.min:s,a=o?e.max:a,s<=0&&a>=0}(e.measureAxis,e.qHyperCube.qMeasureInfo),applyAttributes(e,t){const n=e||{},r={};return n.supportNegative=void 0===n.supportNegative||n.supportNegative,n.supportRangeOverZero=void 0===n.supportRangeOverZero||n.supportRangeOverZero,xx.DISCLAIMERS.forEach(e=>{r[e.label]=!1}),t&&t.qHyperCube?(r.NoDataExist=this.getNoDataExistAttribute(t.qHyperCube),r.NoDataExist?r:(r.RequireNumericDimension=n.explicitRequireNumericDimension,r.RequireNumericDimension||(r.LimitedData=this.getLimitedDataAttribute(t.qHyperCube,n),r.NegativeOrZeroValues=this.getNegativeOrZeroValuesAttribute(t.qHyperCube,n),r.OnlyNegativeOrZeroValues=this.getOnlyNegativeOrZeroValuesAttribute(t.qHyperCube,n),r.OnlyNanData=this.getOnlyNanDataAttribute(t.qHyperCube,n),r.DataRangeIncludingZero=this.getDataRangeIncludingZeroAttribute(t,n)),r)):r}};function Mx(e,t,n){this.disclaimersConfig=e,this.dataAttributes=t,this.supportedDisclaimers=n}function kx(e,t){return e&&t&&t[e]}function qx(e){this.environment=e,this.clear()}Mx.prototype.isValidAndSupported=function(e,t){return kx(e.label,this.dataAttributes)&&(e.default||kx(e.label,this.supportedDisclaimers))&&void 0!==t&&e.alignment===t},Mx.prototype.isAnyValidDisclaimer=function(e){let t=!1;const n=this;return this.disclaimersConfig.forEach(r=>{n.isValidAndSupported(r,e)&&(t=!0)}),t},Mx.prototype.getMessage=function(e,t){let n="";const r=this;return t&&this.disclaimersConfig.forEach(i=>{r.isValidAndSupported(i,e)&&(n+=`${t.get(`Object.Disclaimer.${i.label}`)} `)}),n},qx.ERRORS={SET:"Calling Disclaimer.set() without attributes",DISPLAY:"Calling Disclaimer.display() before attributes are applied"},qx._applyDefaultSupport=function(e,t){let n=e;return n||(n={}),t.forEach(e=>{void 0===n[e.label]&&(n[e.label]=e.default)}),n},qx.prototype.getComponentSettings=function(){const{translator:e}=this.environment,t=Sb(!0,{},this.vizAttributes.supportedDisclaimers),n=new Mx(xx.DISCLAIMERS,this.dataAttributes,t);let r,i;if(n.isAnyValidDisclaimer(xx.ALIGNMENT.CENTER))r=n.getMessage(xx.ALIGNMENT.CENTER,e),i="center";else{if(!n.isAnyValidDisclaimer(xx.ALIGNMENT.BOTTOM))return;r=n.getMessage(xx.ALIGNMENT.BOTTOM,e),i="bottom"}return{key:"disclaimer",type:"disclaimer",layout:{displayOrder:1e3,dock:i},settings:{label:r,rtl:"rtl"===this.environment?.options?.direction}}},qx.prototype.set=function(e){if(this.clear(),!e)throw new Error(qx.ERRORS.SET);this.vizAttributes=e,this.dataAttributes=wx.applyAttributes(this.vizAttributes.options,this.vizAttributes.data)},qx.prototype.clear=function(){this.vizAttributes=null,this.dataAttributes=null};const Sx=Bv.extend({init(e,t,n,r,i){this.$element=t,this.environment=n,this.backendApi=r,this._selectionsApi=i,this._on=!1,this._disclaimer=new qx(n),this._dataPaths=["qHyperCube"];const o=this;this.picassoElement=t[0],this.picassoElement.className+=" picasso-chart",this.chartInstance=e.chart({element:this.picassoElement,settings:{components:[bx.createComponent("event-area",{mounted(e){o.dataAreaElem=e}})]}})},updateEnvironment(e){this.environment=e},isRtl(){return"rtl"===this.environment.options?.direction},setDataPaths(e){this._dataPaths=e},getData:(e,t,n)=>function(e,t,n){let r,i={qTop:0,qLeft:0,qWidth:t.qSize.qcx,qHeight:1e4/t.qSize.qcx};if(n){const e=n.width||t.qSize.qcx,r=Math.floor(1e4/e);i={qTop:n.top||0,qLeft:n.left||0,qWidth:e,qHeight:n.height?Math.min(n.height,r):r}}else i={qTop:0,qLeft:0,qWidth:t.qSize.qcx,qHeight:1e4/t.qSize.qcx};r="K"===t.qMode?"qStackedDataPages":"qDataPages";return e.getData([i],null,t).then(e=>{t[r]=e})}(e,t,n),hasValidData:()=>!0,paint(){if(this.hasValidData()){this._disclaimer.set(this.getDisclaimerAttributes(this.layout));const e=this._disclaimer.getComponentSettings(),t="center"===e?.layout?.dock,n=this.createChartSettings(this.layout);t?n.components=[e]:e&&n.components.push(e),bx.validateComponentKeys(n.components).forEach(e=>{console.error(e)}),this.updateChart(this.layout,n),this._painted=!0}return Promise.resolve()},resize(){if(this.layout)return this.paint()},createChartSettings(){throw new Error('Subclass must implement "createChartSettings" function')},addSnapshotChartSettings(e,t){const{freeResize:n}=this.environment.options;!n&&t.snapshotData&&(e.dockLayout.logicalSize={width:t.snapshotData.content.size.w,height:t.snapshotData.content.size.h,preserveAspectRatio:!0})},updateData(e){return this._destroyed?Promise.reject():(this.layout=Sb(!0,{},e),this.layout.permissions=e.permissions,Promise.resolve())},updateChart(e,t,n){const r=this.environment.appLayout?.qLocaleInfo??{},i=this._dataPaths.map(t=>({type:"q",key:t,config:{localeInfo:r},data:jv(e,t.replace(/\//g,"."))}));this.colorService&&i.push(...this.colorService.getData()),this.chartInstance.update({data:i,settings:t,partialData:n});this.picassoElement.setAttribute("data-state",2)},destroy(){this._destroyed=!0,this.off(),this.chartInstance.destroy()},getViewState:()=>({}),isLassoDisabled:()=>!0,setSnapshotData(e){e.snapshotData||(e.snapshotData={}),e.snapshotData.content={chartData:{},size:{w:this.$element.width(),h:this.$element.height()}}},getDisclaimerAttributes:e=>({data:e})});var _x,Dx={exports:{}};var Cx=(_x||(_x=1,function(e){e.exports=function(){function e(e,t,n){return(t=o(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function n(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 r(t){for(var r=1;r<arguments.length;r++){var i=null!=arguments[r]?arguments[r]:{};r%2?n(Object(i),!0).forEach(function(n){e(t,n,i[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(i)):n(Object(i)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(i,e))})}return t}function i(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"===t?String:Number)(e)}function o(e){var t=i(e,"string");return"symbol"==typeof t?t:t+""}var s=Object.prototype.hasOwnProperty,a=Object.prototype.toString,l=Object.defineProperty,c=Object.getOwnPropertyDescriptor,u=function(e){return"function"==typeof Array.isArray?Array.isArray(e):"[object Array]"===a.call(e)},h=function(e){if(!e||"[object Object]"!==a.call(e))return!1;var t,n=s.call(e,"constructor"),r=e.constructor&&e.constructor.prototype&&s.call(e.constructor.prototype,"isPrototypeOf");if(e.constructor&&!n&&!r)return!1;for(t in e);return void 0===t||s.call(e,t)},d=function(e,t){l&&"__proto__"===t.name?l(e,t.name,{enumerable:!0,configurable:!0,value:t.newValue,writable:!0}):e[t.name]=t.newValue},f=function(e,t){if("__proto__"===t){if(!s.call(e,t))return;if(c)return c(e,t).value}return e[t]},p=function e(){var t,n,r,i,o,s,a=arguments[0],l=1,c=arguments.length,p=!1;for("boolean"==typeof a&&(p=a,a=arguments[1]||{},l=2),(null==a||"object"!=typeof a&&"function"!=typeof a)&&(a={});l<c;++l)if(null!=(t=arguments[l]))for(n in t)r=f(a,n),a!==(i=f(t,n))&&(p&&i&&(h(i)||(o=u(i)))?(o?(o=!1,s=r&&u(r)?r:[]):s=r&&h(r)?r:{},d(a,{name:n,newValue:e(p,s,i)})):void 0!==i&&d(a,{name:n,newValue:i}));return a};function g(e,t,n,r){if(!e)return-1;const i=n.cache,o=e.origin?e.origin():null;o&&(e=o);let s=i.fields.indexOf(e),a=-1,l=-1;if(-1===s)for(let t=0;t<i.wrappedFields.length;t++)if(l=i.wrappedFields[t].attrDims.map(e=>e.instance).indexOf(e),a=i.wrappedFields[t].attrExps.map(e=>e.instance).indexOf(e),-1!==l||-1!==a){s=t;break}if(Array.isArray(r)&&r.some((e,t)=>e!==t)){const e=r.indexOf(s);-1!==e&&(s=e)}return s-=t.qArea.qLeft,s<0||s>=t.qArea.qWidth?-1:l>=0?e=>e[s].qAttrDims.qValues[l]:a>=0?e=>e[s].qAttrExps.qValues[a]:e=>e[s]}function m(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 y(e){let{cache:t,f:n,mainCell:r,p:i,page:o,rowIdx:s,row:a,sourceKey:l,target:c,targetProp:u,columnOrder:h}=e,d=r;if(i.field&&i.field!==n){const e=g(i.field,o,{cache:t},h);if(-1===e)return;d=p({qRow:s},e(a))}c[u]=m(i,d,{key:l})}function b(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 s=t.raw(),a=t.key(),l="object"==typeof i[e].field?i[e].field:t.field(i[e].field),{props:c,main:u}=r.normalizeConfig(i[e],t),h=Object.keys(c),d=!!i[e].trackBy,f=typeof i[e].trackBy,b={},v=[],x=[];for(let t=0;t<s.qDataPages.length;t++){const o=g(l,s.qDataPages[t],{cache:n},s.qColumnOrder);if(-1!==o)for(let g=0;g<s.qDataPages[t].qMatrix.length;g++){const w=s.qDataPages[t].qArea.qTop+g,M=p({qRow:w},o(s.qDataPages[t].qMatrix[g])),k=m(u,M,{key:a});if(!u.filter||u.filter(M)){for(let e=0;e<h.length;e++){const r=c[h[e]];let i=r.fields||[r];r.fields&&(k[h[e]]=[]);for(let o=0;o<i.length;o++)y({cache:n,f:l,mainCell:M,p:i[o],prop:h[e],page:s.qDataPages[t],rowIdx:w,row:s.qDataPages[t].qMatrix[g],sourceKey:a,target:r.fields?k[h[e]]:k,targetProp:r.fields?o:h[e],columnOrder:s.qColumnOrder});if(r.fields){const t=k[h[e]].map(e=>e.value),n=k[h[e]].map(e=>e.label);k[h[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(k[h[e]].value)}}}d&&r.track({cfg:i[e],itemData:M,obj:k,target:v,tracker:b,trackType:f}),x.push(k)}}}const w=d?r.collect(v,{main:u,propsArr:h,props:c}):x;o=[...o,...w]}return o}function v(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 x(){return this.eachAfter(v)}function w(e,t){let n=-1;for(const r of this)e.call(t,r,++n,this);return this}function M(e,t){for(var n,r,i=this,o=[i],s=-1;i=o.pop();)if(e.call(t,i,++s,this),n=i.children)for(r=n.length-1;r>=0;--r)o.push(n[r]);return this}function k(e,t){for(var n,r,i,o=this,s=[o],a=[],l=-1;o=s.pop();)if(a.push(o),n=o.children)for(r=0,i=n.length;r<i;++r)s.push(n[r]);for(;o=a.pop();)e.call(t,o,++l,this);return this}function q(e,t){let n=-1;for(const r of this)if(e.call(t,r,++n,this))return r}function S(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})}function _(e){return this.eachBefore(function(t){t.children&&t.children.sort(e)})}function D(e){for(var t=this,n=C(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}function C(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}function E(){for(var e=this,t=[e];e=e.parent;)t.push(e);return t}function A(){return Array.from(this)}function T(){var e=[];return this.eachBefore(function(t){t.children||e.push(t)}),e}function N(){var e=this,t=[];return e.each(function(n){n!==e&&t.push({source:n.parent,target:n})}),t}function*O(){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)}function R(e,t){e instanceof Map?(e=[void 0,e],void 0===t&&(t=L)):void 0===t&&(t=P);for(var n,r,i,o,s,a=new z(e),l=[a];n=l.pop();)if((i=t(n.data))&&(s=(i=Array.from(i)).length))for(n.children=i,o=s-1;o>=0;--o)l.push(r=i[o]=new z(i[o])),r.parent=n,r.depth=n.depth+1;return a.eachBefore(F)}function I(){return R(this).eachBefore(j)}function P(e){return e.children}function L(e){return Array.isArray(e)?e[1]:null}function j(e){void 0!==e.data.value&&(e.value=e.data.value),e.data=e.data.data}function F(e){var t=0;do{e.height=t}while((e=e.parent)&&e.height<++t)}function z(e){this.data=e,this.depth=this.height=0,this.parent=null}function H(e){return null==e?null:V(e)}function V(e){if("function"!=typeof e)throw new Error;return e}z.prototype=R.prototype={constructor:z,count:x,each:w,eachAfter:k,eachBefore:M,find:q,sum:S,sort:_,path:D,ancestors:E,descendants:A,leaves:T,links:N,copy:I,[Symbol.iterator]:O};var B={depth:-1},$={},W={};function U(e){return e.id}function Y(e){return e.parentId}function K(){var e,t=U,n=Y;function r(r){var i,o,s,a,l,c,u,h,d=Array.from(r),f=t,p=n,g=new Map;if(null!=e){const t=d.map((t,n)=>X(e(t,n,r))),n=t.map(G),i=new Set(t).add("");for(const e of n)i.has(e)||(i.add(e),t.push(e),n.push(G(e)),d.push(W));f=(e,n)=>t[n],p=(e,t)=>n[t]}for(s=0,i=d.length;s<i;++s)o=d[s],c=d[s]=new z(o),null!=(u=f(o,s,r))&&(u+="")&&(h=c.id=u,g.set(h,g.has(h)?$:c)),null!=(u=p(o,s,r))&&(u+="")&&(c.parent=u);for(s=0;s<i;++s)if(u=(c=d[s]).parent){if(!(l=g.get(u)))throw new Error("missing: "+u);if(l===$)throw new Error("ambiguous: "+u);l.children?l.children.push(c):l.children=[c],c.parent=l}else{if(a)throw new Error("multiple roots");a=c}if(!a)throw new Error("no root");if(null!=e){for(;a.data===W&&1===a.children.length;)a=a.children[0],--i;for(let e=d.length-1;e>=0&&(c=d[e]).data===W;--e)c.data=null}if(a.parent=B,a.eachBefore(function(e){e.depth=e.parent.depth+1,--i}).eachBefore(F),a.parent=null,i>0)throw new Error("cycle");return a}return r.id=function(e){return arguments.length?(t=H(e),r):t},r.parentId=function(e){return arguments.length?(n=H(e),r):n},r.path=function(t){return arguments.length?(e=H(t),r):e},r}function X(e){let t=(e=`${e}`).length;return J(e,t-1)&&!J(e,t-2)&&(e=e.slice(0,-1)),"/"===e[0]?e:`/${e}`}function G(e){let t=e.length;if(t<2)return"";for(;--t>1&&!J(e,t););return e.slice(0,t)}function J(e,t){if("/"===e[t]){let n=0;for(;t>0&&"\\"===e[--t];)++n;if(!(1&n))return!0}return!1}function Z(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=Z(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]=Z(r,i[e]);return t}n[e]in i&&(i=i[n[e]])}return i}function Q(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,...Q(e[i].children,t-1,n)]);return r}function ee(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=>Q(e.children,r-1,n)}return!1}function te(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))}const ne=/^qDimensionInfo(?:\/(\d+))?/,re=/^\/?qMeasureInfo\/(\d+)/,ie=/\/qAttrExprInfo\/(\d+)/,oe=/\/qAttrDimInfo\/(\d+)/;function se(e){const t=e.raw().qColumnOrder,n=e.fields();return t&&t.length===n.length?t:n.map((e,t)=>t)}function ae(e){return(e.qColumnOrder&&e.qColumnOrder.length?e.qColumnOrder:e.qDimensionInfo.map((e,t)=>t)).filter(t=>t<e.qDimensionInfo.length)}function le(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,s=-1,a=-1,l=-1,c=-1,u=-1,h=r;const d=n.qEffectiveInterColumnSortOrder,f=ae(n);return ne.test(h)&&(i=!0,o=+ne.exec(h)[1],h=r.replace(ne,"")),re.test(h)&&("K"===n.qMode?c=+re.exec(h)[1]:d&&-1!==d.indexOf(-1)?(c=+re.exec(h)[1],u=0):u=+re.exec(h)[1],h=h.replace(re,"")),h&&(oe.exec(h)?a=+oe.exec(h)[1]:ie.exec(h)&&(s=+ie.exec(h)[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:c,measureIdx:u,attrDimIdx:a,attrIdx:s}}function ce(e,t){let n,r,i=ee(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 ue(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 he(e){let{propsArr:t,props:n,item:r,itemData:i,ret:o,sourceKey:s}=e;for(let e=0;e<t.length;e++){const a=n[t[e]],l=a.fields||[a];let c,u;a.fields&&(c=[],u=[]);for(let n=0;n<l.length;n++){const h=l[n];let d,f,p,g,m,y;if("primitive"===h.type?(p=h.value,y=String(h.value)):("function"==typeof h.value&&(d=e=>h.value(e,r)),"function"==typeof h.label&&(f=e=>h.label(e,r)),h.accessor?(g=h.accessor(r),Array.isArray(g)?(m=g.map(h.valueAccessor),h.attrAccessor&&(m=m.map(h.attrAccessor)),d&&(p=m.map(d),d=null),f&&(y=m.map(f),f=null),p=h.reduce?h.reduce(p):p,y=h.reduceLabel?h.reduceLabel(y,p):String(p)):(p=h.attrAccessor?h.attrAccessor(h.valueAccessor(g)):h.valueAccessor(g),y=p)):(p=i,y=i)),a.fields){const e=d?d(p):p;c.push(e),u.push(f&&null!=y?f(y):null!=y?y:String(e))}else{const n=d?d(p):p;o[t[e]]={value:n,label:f?f(y):null!=y?y:String(n)},h.field&&(o[t[e]].source={field:h.field.key(),key:s})}}c&&(o[t[e]]={value:"function"==typeof a.value?a.value(c,r):c,label:"function"==typeof a.label?a.label(u,r):u})}}const de=(e,t,n)=>{const r="K"===e.qMode?"/qStackedDataPages/*/qData":"/qTreeDataPages/*",i="K"===e.qMode?"qSubNodes":"qNodes",o=Z(r,e);return o&&o[0]?(t.tree=R(o[0],n.children||(e=>e[i])),t.tree):null};function fe(e){const t=e.raw().qDataPages.length?e.raw().qDataPages[0].qMatrix:[],n=se(e),i=e.fields(),o=e.fields().filter(e=>"dimension"===e.type()).map(e=>n.indexOf(i.indexOf(e))),s=e.fields().filter(e=>"measure"===e.type()).map(e=>n.indexOf(i.indexOf(e))),a={__root:{__id:"__root",qValues:[]}};for(let e=0;e<t.length;e++){const n=t[e];let i="__root",c=!1;for(let e=0;e<o.length;e++){var l;const t=n[o[e]],s="".concat(i,"__").concat(null!==(l=t.qElemNumber)&&void 0!==l?l:t.qElemNo);a[s]||(a[s]=r({__id:s,__parent:i,qValues:[]},t),c=!0),i=s}if(c)for(let e=0;e<s.length;e++){const t=n[s[e]];a[i].qValues.push(t)}}const c=Object.keys(a).map(e=>a[e]);return K().id(e=>e.__id).parentId(e=>e.__parent)(c)}const pe=e=>{let{propsArr:t,props:n,cube:r,cache:i,itemDepthObject:o,f:s}=e;for(let e=0;e<t.length;e++){const i=n[t[e]],a=i.fields?i.fields:[i];for(let e=0;e<a.length;e++){const t=a[e];if(t.field!==s){const e=ce(o,le(t.field,{cube:r}));t.accessor=e.nodeFn,t.valueAccessor=e.valueFn,t.attrAccessor=e.attrFn}}}};function ge(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0,n=arguments.length>2?arguments[2]:void 0,i=arguments.length>3?arguments[3]:void 0;const o=t.raw(),s=t.key(),a="S"===o.qMode?fe(t):de(o,n,e);if(!a)return null;const l=a.height,c=[];for(let s=0;s<=l;s++){let a=null;if(s>0)if("S"===o.qMode){let e=ae(o)[s-1];a=n.fields[e]}else{let e=o.qEffectiveInterColumnSortOrder[s-1];s>o.qEffectiveInterColumnSortOrder.length&&(e=o.qDimensionInfo.length),a=n.fields[e]}const{props:l,main:u}=i.normalizeConfig(r(r({},e),{},{field:a?a.key():void 0}),t),h=Object.keys(l);c[s]={propsArr:h,props:l,main:u};const d=a?le(a,{cube:o}):{fieldDepth:0};pe({propsArr:h,props:l,cube:o,cache:n,itemDepthObject:d,f:a})}const u=a.copy().descendants(),h=a.descendants();for(let e=0;e<h.length;e++){const t=c[h[e].depth].propsArr,n=c[h[e].depth].props,r=c[h[e].depth].main,i=u[e],o=i.data,a=ue(r,o,{key:s});he({propsArr:t,props:n,item:i,itemData:o,ret:a,sourceKey:s}),h[e].data=a}return a}function me(e,t,n,r){const i=Array.isArray(e)?e:[e];let o=[];for(let s=0;s<i.length;s++)if(void 0!==i[s].field){const a=t.raw(),l=t.key();if(!de(a,n,e))continue;const c="object"==typeof i[s].field?i[s].field:t.field(i[s].field),{props:u,main:h}=r.normalizeConfig(i[s],t),d=Object.keys(u),f=le(c,{cube:a}),{nodeFn:p,attrFn:g,valueFn:m}=ce({fieldDepth:0},f);pe({propsArr:d,props:u,cube:a,cache:n,itemDepthObject:f,f:c});const y=!!i[s].trackBy,b=typeof i[s].trackBy,v={},x=[],w=p(n.tree),M=[];for(let e=0;e<w.length;e++){const t=w[e],n=g?g(m(t)):m(t);if(h.filter&&!h.filter(n))continue;const o=ue(h,n,{key:l});he({propsArr:d,props:u,item:t,itemData:n,ret:o,sourceKey:l}),y&&r.track({cfg:i[s],itemData:n,obj:o,target:x,tracker:v,trackType:b}),M.push(o)}const k=y?r.collect(x,{main:h,propsArr:d,props:u}):M;o=[...o,...k]}return o}function ye(e,t){return e(t={exports:{}},t.exports),t.exports}"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:void 0!==t||"undefined"!=typeof self&&self;var be=ye(function(e){
|
|
26
|
+
e.exports=function(e,t){if(!e||isNaN(+t))return t;var n,r,i,o,s,a,l,c,u,h,d=e.length,f=e.search(/[0-9\-\+#]/),p=f>0?e.substring(0,f):"",g=e.split("").reverse().join(""),m=g.search(/[0-9\-\+#]/),y=d-m,b=e.substring(y,y+1),v=y+("."===b||","===b?1:0),x=m>0?e.substring(v,d):"";if(n=(t="-"===(e=e.substring(f,v)).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))+"",a=e[1]&&e[1].lastIndexOf("0"),(!(c=t.split("."))[1]||c[1]&&c[1].length<=a)&&(t=(+t).toFixed(a+1)),u=e[0].split(o),e[0]=u.join(""),(s=e[0]&&e[0].indexOf("0"))>-1)for(;c[0].length<e[0].length-s;)c[0]="0"+c[0];else 0==+c[0]&&(c[0]="");if((t=t.split("."))[0]=c[0],l=u[1]&&u[u.length-1].length){for(g="",y=(h=t[0]).length%l,d=h.length,v=0;v<d;v++)g+=h.charAt(v),!((v-y+1)%l)&&v<d-l&&(g+=o);t[0]=g}return t[1]=e[1]&&t[1]?i+t[1]:"","0"!==(r=t.join(""))&&""!==r||(n=!1),p+(n?"-":"")+r+x}},rb({exports:{}});var fb="'Source Sans Pro', 'Arial', 'sans-serif'",pb="#333333",gb="#595959",mb="#737373",yb="#cccccc",bb="#e6e6e6";function vb(e){var t={};return[].concat(Nm(e),Nm([["","","color"],["object","","fontFamily"],["object","axis.label.name","color",gb],["object","axis.label.name","fontFamily",fb],["object","axis.label.name","fontSize","12px"],["object","axis.line.major","color",yb],["object","axis.line.minor","color",bb],["object","axis.title","color"],["object","axis.title","fontFamily",fb],["object","axis.title","fontSize","13px"],["object","grid.line.highContrast","color",bb],["object","grid.line.major","color",yb],["object","grid.line.minor","color",bb],["object","label.value","color",gb],["object","label.value","fontFamily",fb],["object","label.value","fontSize","12px"],[!1,"label.value","darkColor",gb],[!1,"label.value","lightColor",bb],["object","outOfRange","color","#999"],["object","legend.title","color",pb],["object","legend.title","fontFamily",fb],["object","legend.title","fontSize","15px"],["object","legend.label","color",gb],["object","legend.label","fontFamily",fb],["object","legend.label","fontSize","13px"],["object","referenceLine.label.name","color",pb],["object","referenceLine.label.name","fontFamily",fb],["object","referenceLine.label.name","fontSize","12px"],["object","referenceLine.outOfBounds","color",bb],["object","referenceLine.outOfBounds","fontFamily",fb],["object","referenceLine.outOfBounds","fontSize","12px"],["object","referenceLine.outOfBounds","backgroundColor",mb,function(e){return"transparent"===e?mb: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 xb,wb,Mb=function(e){return e};function kb(e){var t=e.theme,n=e.id,r=e.transform,i=e.extend,o=e.matrix,s={},a=r.reduce(function(e,t){var n=Tm(t,2),r=n[0],i=n[1];return e[r]=i,e},{});return o.forEach(function(e){var r=Tm(e,5),i=r[0],o=r[1],l=r[2],c=r[3],u=r[4],h=void 0===u?function(e){return e}:u,d=function(e){var t=e.theme,n=e.base,r=e.path,i=e.attribute,o=e.defaultValue,s=void 0===o?void 0:o;if(!t||!1===n)return s;var a=t.getStyle(n,r,i);return void 0===a?s:a}({theme:t,base:"object"===i&&n?"".concat("object",".").concat(n):i,path:o,attribute:l,defaultValue:c}),f=(a["".concat(o,".").concat(l)]||Mb)(h(d));ob(s,[o,l].filter(Boolean).join("."),f)}),i.forEach(function(e){var t=Tm(e,2),n=t[0],r=t[1];ob(s,n,r)}),s}var qb,Sb,_b=function(){if(wb)return xb;wb=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)},s=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},a=function(t,n){if("__proto__"===n){if(!e.call(t,n))return;if(r)return r(t,n).value}return t[n]};return xb=function e(){var t,n,r,l,c,u,h=arguments[0],d=1,f=arguments.length,p=!1;for("boolean"==typeof h&&(p=h,h=arguments[1]||{},d=2),(null==h||"object"!=typeof h&&"function"!=typeof h)&&(h={});d<f;++d)if(null!=(t=arguments[d]))for(n in t)r=a(h,n),h!==(l=a(t,n))&&(p&&l&&(o(l)||(c=i(l)))?(c?(c=!1,u=r&&i(r)?r:[]):u=r&&o(r)?r:{},s(h,{name:n,newValue:e(p,u,l)})):void 0!==l&&s(h,{name:n,newValue:l}));return h},xb}(),Db=n(_b);function Cb(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Eb=function(){if(Sb)return qb;Sb=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)},s=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},a=function(t,n){if("__proto__"===n){if(!e.call(t,n))return;if(r)return r(t,n).value}return t[n]};return qb=function e(){var t,n,r,l,c,u,h=arguments[0],d=1,f=arguments.length,p=!1;for("boolean"==typeof h&&(p=h,h=arguments[1]||{},d=2),(null==h||"object"!=typeof h&&"function"!=typeof h)&&(h={});d<f;++d)if(null!=(t=arguments[d]))for(n in t)r=a(h,n),h!==(l=a(t,n))&&(p&&l&&(o(l)||(c=i(l)))?(c?(c=!1,u=r&&i(r)?r:[]):u=r&&o(r)?r:{},s(h,{name:n,newValue:e(p,u,l)})):void 0!==l&&s(h,{name:n,newValue:l}));return h},qb}();function Ab(e,t,n){e.prototype=t.prototype=n,n.constructor=e}function Tb(e,t){var n=Object.create(e.prototype);for(var r in t)n[r]=t[r];return n}function Nb(){}Cb(Eb);var Ob=1/.7,Rb="\\s*([+-]?\\d+)\\s*",Ib="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",Pb="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",Lb=/^#([0-9a-f]{3,8})$/,jb=new RegExp(`^rgb\\(${Rb},${Rb},${Rb}\\)$`),Fb=new RegExp(`^rgb\\(${Pb},${Pb},${Pb}\\)$`),zb=new RegExp(`^rgba\\(${Rb},${Rb},${Rb},${Ib}\\)$`),Hb=new RegExp(`^rgba\\(${Pb},${Pb},${Pb},${Ib}\\)$`),Vb=new RegExp(`^hsl\\(${Ib},${Pb},${Pb}\\)$`),Bb=new RegExp(`^hsla\\(${Ib},${Pb},${Pb},${Ib}\\)$`),$b={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 Wb(){return this.rgb().formatHex()}function Ub(){return this.rgb().formatRgb()}function Yb(e){var t,n;return e=(e+"").trim().toLowerCase(),(t=Lb.exec(e))?(n=t[1].length,t=parseInt(t[1],16),6===n?Kb(t):3===n?new Zb(t>>8&15|t>>4&240,t>>4&15|240&t,(15&t)<<4|15&t,1):8===n?Xb(t>>24&255,t>>16&255,t>>8&255,(255&t)/255):4===n?Xb(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=jb.exec(e))?new Zb(t[1],t[2],t[3],1):(t=Fb.exec(e))?new Zb(255*t[1]/100,255*t[2]/100,255*t[3]/100,1):(t=zb.exec(e))?Xb(t[1],t[2],t[3],t[4]):(t=Hb.exec(e))?Xb(255*t[1]/100,255*t[2]/100,255*t[3]/100,t[4]):(t=Vb.exec(e))?iv(t[1],t[2]/100,t[3]/100,1):(t=Bb.exec(e))?iv(t[1],t[2]/100,t[3]/100,t[4]):$b.hasOwnProperty(e)?Kb($b[e]):"transparent"===e?new Zb(NaN,NaN,NaN,0):null}function Kb(e){return new Zb(e>>16&255,e>>8&255,255&e,1)}function Xb(e,t,n,r){return r<=0&&(e=t=n=NaN),new Zb(e,t,n,r)}function Gb(e){return e instanceof Nb||(e=Yb(e)),e?new Zb((e=e.rgb()).r,e.g,e.b,e.opacity):new Zb}function Jb(e,t,n,r){return 1===arguments.length?Gb(e):new Zb(e,t,n,null==r?1:r)}function Zb(e,t,n,r){this.r=+e,this.g=+t,this.b=+n,this.opacity=+r}function Qb(){return`#${rv(this.r)}${rv(this.g)}${rv(this.b)}`}function ev(){const e=tv(this.opacity);return`${1===e?"rgb(":"rgba("}${nv(this.r)}, ${nv(this.g)}, ${nv(this.b)}${1===e?")":`, ${e})`}`}function tv(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function nv(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function rv(e){return((e=nv(e))<16?"0":"")+e.toString(16)}function iv(e,t,n,r){return r<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new sv(e,t,n,r)}function ov(e){if(e instanceof sv)return new sv(e.h,e.s,e.l,e.opacity);if(e instanceof Nb||(e=Yb(e)),!e)return new sv;if(e instanceof sv)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),s=NaN,a=o-i,l=(o+i)/2;return a?(s=t===o?(n-r)/a+6*(n<r):n===o?(r-t)/a+2:(t-n)/a+4,a/=l<.5?o+i:2-o-i,s*=60):a=l>0&&l<1?0:s,new sv(s,a,l,e.opacity)}function sv(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}function av(e){return(e=(e||0)%360)<0?e+360:e}function lv(e){return Math.max(0,Math.min(1,e||0))}function cv(e,t,n){return 255*(e<60?t+(n-t)*e/60:e<180?n:e<240?t+(n-t)*(240-e)/60:t)}Ab(Nb,Yb,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:Wb,formatHex:Wb,formatHex8:function(){return this.rgb().formatHex8()},formatHsl:function(){return ov(this).formatHsl()},formatRgb:Ub,toString:Ub}),Ab(Zb,Jb,Tb(Nb,{brighter(e){return e=null==e?Ob:Math.pow(Ob,e),new Zb(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=null==e?.7:Math.pow(.7,e),new Zb(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new Zb(nv(this.r),nv(this.g),nv(this.b),tv(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:Qb,formatHex:Qb,formatHex8:function(){return`#${rv(this.r)}${rv(this.g)}${rv(this.b)}${rv(255*(isNaN(this.opacity)?1:this.opacity))}`},formatRgb:ev,toString:ev})),Ab(sv,function(e,t,n,r){return 1===arguments.length?ov(e):new sv(e,t,n,null==r?1:r)},Tb(Nb,{brighter(e){return e=null==e?Ob:Math.pow(Ob,e),new sv(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=null==e?.7:Math.pow(.7,e),new sv(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 Zb(cv(e>=240?e-240:e+120,i,r),cv(e,i,r),cv(e<120?e+240:e-120,i,r),this.opacity)},clamp(){return new sv(av(this.h),lv(this.s),lv(this.l),tv(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=tv(this.opacity);return`${1===e?"hsl(":"hsla("}${av(this.h)}, ${100*lv(this.s)}%, ${100*lv(this.l)}%${1===e?")":`, ${e})`}`}}));const uv=Math.PI/180,hv=180/Math.PI,dv=4/29,fv=6/29,pv=3*fv*fv;function gv(e){if(e instanceof mv)return new mv(e.l,e.a,e.b,e.opacity);if(e instanceof wv)return Mv(e);e instanceof Zb||(e=Gb(e));var t,n,r=xv(e.r),i=xv(e.g),o=xv(e.b),s=yv((.2225045*r+.7168786*i+.0606169*o)/1);return r===i&&i===o?t=n=s:(t=yv((.4360747*r+.3850649*i+.1430804*o)/.96422),n=yv((.0139322*r+.0971045*i+.7141733*o)/.82521)),new mv(116*s-16,500*(t-s),200*(s-n),e.opacity)}function mv(e,t,n,r){this.l=+e,this.a=+t,this.b=+n,this.opacity=+r}function yv(e){return e>.008856451679035631?Math.pow(e,1/3):e/pv+dv}function bv(e){return e>fv?e*e*e:pv*(e-dv)}function vv(e){return 255*(e<=.0031308?12.92*e:1.055*Math.pow(e,1/2.4)-.055)}function xv(e){return(e/=255)<=.04045?e/12.92:Math.pow((e+.055)/1.055,2.4)}function wv(e,t,n,r){this.h=+e,this.c=+t,this.l=+n,this.opacity=+r}function Mv(e){if(isNaN(e.h))return new mv(e.l,0,0,e.opacity);var t=e.h*uv;return new mv(e.l,Math.cos(t)*e.c,Math.sin(t)*e.c,e.opacity)}Ab(mv,function(e,t,n,r){return 1===arguments.length?gv(e):new mv(e,t,n,null==r?1:r)},Tb(Nb,{brighter(e){return new mv(this.l+18*(null==e?1:e),this.a,this.b,this.opacity)},darker(e){return new mv(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 Zb(vv(3.1338561*(t=.96422*bv(t))-1.6168667*(e=1*bv(e))-.4906146*(n=.82521*bv(n))),vv(-.9787684*t+1.9161415*e+.033454*n),vv(.0719453*t-.2289914*e+1.4052427*n),this.opacity)}})),Ab(wv,function(e,t,n,r){return 1===arguments.length?function(e){if(e instanceof wv)return new wv(e.h,e.c,e.l,e.opacity);if(e instanceof mv||(e=gv(e)),0===e.a&&0===e.b)return new wv(NaN,0<e.l&&e.l<100?0:NaN,e.l,e.opacity);var t=Math.atan2(e.b,e.a)*hv;return new wv(t<0?t+360:t,Math.sqrt(e.a*e.a+e.b*e.b),e.l,e.opacity)}(e):new wv(e,t,n,null==r?1:r)},Tb(Nb,{brighter(e){return new wv(this.h,this.c,this.l+18*(null==e?1:e),this.opacity)},darker(e){return new wv(this.h,this.c,this.l-18*(null==e?1:e),this.opacity)},rgb(){return Mv(this).rgb()}}));var kv=-.14861,qv=1.78277,Sv=-.29227,_v=-.90649,Dv=1.97294,Cv=Dv*_v,Ev=Dv*qv,Av=qv*Sv-_v*kv;function Tv(e,t,n,r){return 1===arguments.length?function(e){if(e instanceof Nv)return new Nv(e.h,e.s,e.l,e.opacity);e instanceof Zb||(e=Gb(e));var t=e.r/255,n=e.g/255,r=e.b/255,i=(Av*r+Cv*t-Ev*n)/(Av+Cv-Ev),o=r-i,s=(Dv*(n-i)-Sv*o)/_v,a=Math.sqrt(s*s+o*o)/(Dv*i*(1-i)),l=a?Math.atan2(s,o)*hv-120:NaN;return new Nv(l<0?l+360:l,a,i,e.opacity)}(e):new Nv(e,t,n,null==r?1:r)}function Nv(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}Ab(Nv,Tv,Tb(Nb,{brighter(e){return e=null==e?Ob:Math.pow(Ob,e),new Nv(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=null==e?.7:Math.pow(.7,e),new Nv(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=isNaN(this.h)?0:(this.h+120)*uv,t=+this.l,n=isNaN(this.s)?0:this.s*t*(1-t),r=Math.cos(e),i=Math.sin(e);return new Zb(255*(t+n*(kv*r+qv*i)),255*(t+n*(Sv*r+_v*i)),255*(t+n*(Dv*r)),this.opacity)}}));var Ov=e=>()=>e;function Rv(e,t){return function(n){return e+n*t}}function Iv(e,t){var n=t-e;return n?Rv(e,n):Ov(isNaN(e)?t:e)}function Pv(e){return((e=Math.exp(e))+1/e)/2}function Lv(e){return function t(n){function r(t,r){var i=e((t=Tv(t)).h,(r=Tv(r)).h),o=Iv(t.s,r.s),s=Iv(t.l,r.l),a=Iv(t.opacity,r.opacity);return function(e){return t.h=i(e),t.s=o(e),t.l=s(Math.pow(e,n)),t.opacity=a(e),t+""}}return n=+n,r.gamma=t,r}(1)}!function e(t){var n=function(e){return 1==(e=+e)?Iv: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):Ov(isNaN(t)?n:t)}}(t);function r(e,t){var r=n((e=Jb(e)).r,(t=Jb(t)).r),i=n(e.g,t.g),o=n(e.b,t.b),s=Iv(e.opacity,t.opacity);return function(t){return e.r=r(t),e.g=i(t),e.b=o(t),e.opacity=s(t),e+""}}return r.gamma=e,r}(1),function e(t,n,r){function i(e,i){var o,s,a=e[0],l=e[1],c=e[2],u=i[0],h=i[1],d=i[2],f=u-a,p=h-l,g=f*f+p*p;if(g<1e-12)s=Math.log(d/c)/t,o=function(e){return[a+e*f,l+e*p,c*Math.exp(t*e*s)]};else{var m=Math.sqrt(g),y=(d*d-c*c+r*g)/(2*c*n*m),b=(d*d-c*c-r*g)/(2*d*n*m),v=Math.log(Math.sqrt(y*y+1)-y),x=Math.log(Math.sqrt(b*b+1)-b);s=(x-v)/t,o=function(e){var r,i=e*s,o=Pv(v),u=c/(n*m)*(o*(r=t*i+v,((r=Math.exp(2*r))-1)/(r+1))-function(e){return((e=Math.exp(e))-1/e)/2}(v));return[a+u*f,l+u*p,c*o/Pv(t*i+v)]}}return o.duration=1e3*s*t/Math.SQRT2,o}return i.rho=function(t){var n=Math.max(.001,+t),r=n*n;return e(n,r,r*r)},i}(Math.SQRT2,2,4),Lv(function(e,t){var n=t-e;return n?Rv(e,n>180||n<-180?n-360*Math.round(n/360):n):Ov(isNaN(e)?t:e)}),Lv(Iv);var jv="center",Fv="bottom";function zv(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 s=r[o];if(void 0===i[s])return n;i=i[s]}return i}[{key:"NoDataExist",alignment:jv,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:jv,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:jv,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:jv},{key:"DataRangeIncludingZero",alignment:Fv},{key:"LimitedData",alignment:Fv},{key:"NegativeOrZeroValues",alignment:Fv}].reduce(function(e,t){return e[t.key]=t,e},{});var Hv,Vv={exports:{}},Bv=Hv?Vv.exports:(Hv=1,Vv.exports=function(){function e(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"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function t(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 n(n){for(var r=1;r<arguments.length;r++){var i=null!=arguments[r]?arguments[r]:{};r%2?t(Object(i),!0).forEach(function(t){e(n,t,i[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(i)):t(Object(i)).forEach(function(e){Object.defineProperty(n,e,Object.getOwnPropertyDescriptor(i,e))})}return n}var r=Object.prototype.hasOwnProperty,i=Object.prototype.toString,o=Object.defineProperty,s=Object.getOwnPropertyDescriptor,a=function(e){return"function"==typeof Array.isArray?Array.isArray(e):"[object Array]"===i.call(e)},l=function(e){if(!e||"[object Object]"!==i.call(e))return!1;var t,n=r.call(e,"constructor"),o=e.constructor&&e.constructor.prototype&&r.call(e.constructor.prototype,"isPrototypeOf");if(e.constructor&&!n&&!o)return!1;for(t in e);return void 0===t||r.call(e,t)},c=function(e,t){o&&"__proto__"===t.name?o(e,t.name,{enumerable:!0,configurable:!0,value:t.newValue,writable:!0}):e[t.name]=t.newValue},u=function(e,t){if("__proto__"===t){if(!r.call(e,t))return;if(s)return s(e,t).value}return e[t]},h=function e(){var t,n,r,i,o,s,h=arguments[0],d=1,f=arguments.length,p=!1;for("boolean"==typeof h&&(p=h,h=arguments[1]||{},d=2),(null==h||"object"!=typeof h&&"function"!=typeof h)&&(h={});d<f;++d)if(null!=(t=arguments[d]))for(n in t)r=u(h,n),h!==(i=u(t,n))&&(p&&i&&(l(i)||(o=a(i)))?(o?(o=!1,s=r&&a(r)?r:[]):s=r&&l(r)?r:{},c(h,{name:n,newValue:e(p,s,i)})):void 0!==i&&c(h,{name:n,newValue:i}));return h};function d(e,t,n,r){if(!e)return-1;const i=n.cache,o=e.origin?e.origin():null;o&&(e=o);let s=i.fields.indexOf(e),a=-1,l=-1;if(-1===s)for(let t=0;t<i.wrappedFields.length;t++)if(l=i.wrappedFields[t].attrDims.map(e=>e.instance).indexOf(e),a=i.wrappedFields[t].attrExps.map(e=>e.instance).indexOf(e),-1!==l||-1!==a){s=t;break}if(Array.isArray(r)&&r.some((e,t)=>e!==t)){const e=r.indexOf(s);-1!==e&&(s=e)}return s-=t.qArea.qLeft,s<0||s>=t.qArea.qWidth?-1:l>=0?e=>e[s].qAttrDims.qValues[l]:a>=0?e=>e[s].qAttrExps.qValues[a]:e=>e[s]}function f(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 p(e){let{cache:t,f:n,mainCell:r,p:i,page:o,rowIdx:s,row:a,sourceKey:l,target:c,targetProp:u,columnOrder:p}=e,g=r;if(i.field&&i.field!==n){const e=d(i.field,o,{cache:t},p);if(-1===e)return;g=h({qRow:s},e(a))}c[u]=f(i,g,{key:l})}function g(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 s=t.raw(),a=t.key(),l="object"==typeof i[e].field?i[e].field:t.field(i[e].field),{props:c,main:u}=r.normalizeConfig(i[e],t),g=Object.keys(c),m=!!i[e].trackBy,y=typeof i[e].trackBy,b={},v=[],x=[];for(let t=0;t<s.qDataPages.length;t++){const o=d(l,s.qDataPages[t],{cache:n},s.qColumnOrder);if(-1!==o)for(let d=0;d<s.qDataPages[t].qMatrix.length;d++){const w=s.qDataPages[t].qArea.qTop+d,M=h({qRow:w},o(s.qDataPages[t].qMatrix[d])),k=f(u,M,{key:a});if(!u.filter||u.filter(M)){for(let e=0;e<g.length;e++){const r=c[g[e]];let i=r.fields||[r];r.fields&&(k[g[e]]=[]);for(let o=0;o<i.length;o++)p({cache:n,f:l,mainCell:M,p:i[o],prop:g[e],page:s.qDataPages[t],rowIdx:w,row:s.qDataPages[t].qMatrix[d],sourceKey:a,target:r.fields?k[g[e]]:k,targetProp:r.fields?o:g[e],columnOrder:s.qColumnOrder});if(r.fields){const t=k[g[e]].map(e=>e.value),n=k[g[e]].map(e=>e.label);k[g[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(k[g[e]].value)}}}m&&r.track({cfg:i[e],itemData:M,obj:k,target:v,tracker:b,trackType:y}),x.push(k)}}}const w=m?r.collect(v,{main:u,propsArr:g,props:c}):x;o=[...o,...w]}return o}function m(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 y(e,t){e instanceof Map?(e=[void 0,e],void 0===t&&(t=v)):void 0===t&&(t=b);for(var n,r,i,o,s,a=new M(e),l=[a];n=l.pop();)if((i=t(n.data))&&(s=(i=Array.from(i)).length))for(n.children=i,o=s-1;o>=0;--o)l.push(r=i[o]=new M(i[o])),r.parent=n,r.depth=n.depth+1;return a.eachBefore(w)}function b(e){return e.children}function v(e){return Array.isArray(e)?e[1]:null}function x(e){void 0!==e.data.value&&(e.value=e.data.value),e.data=e.data.data}function w(e){var t=0;do{e.height=t}while((e=e.parent)&&e.height<++t)}function M(e){this.data=e,this.depth=this.height=0,this.parent=null}function k(e){return null==e?null:function(e){if("function"!=typeof e)throw new Error;return e}(e)}M.prototype=y.prototype={constructor:M,count:function(){return this.eachAfter(m)},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,s=[o],a=[],l=-1;o=s.pop();)if(a.push(o),n=o.children)for(r=0,i=n.length;r<i;++r)s.push(n[r]);for(;o=a.pop();)e.call(t,o,++l,this);return this},eachBefore:function(e,t){for(var n,r,i=this,o=[i],s=-1;i=o.pop();)if(e.call(t,i,++s,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 y(this).eachBefore(x)},[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 q={depth:-1},S={},_={};function D(e){return e.id}function C(e){return e.parentId}function E(){var e,t=D,n=C;function r(r){var i,o,s,a,l,c,u,h,d=Array.from(r),f=t,p=n,g=new Map;if(null!=e){const t=d.map((t,n)=>function(e){let t=(e=`${e}`).length;return T(e,t-1)&&!T(e,t-2)&&(e=e.slice(0,-1)),"/"===e[0]?e:`/${e}`}(e(t,n,r))),n=t.map(A),i=new Set(t).add("");for(const e of n)i.has(e)||(i.add(e),t.push(e),n.push(A(e)),d.push(_));f=(e,n)=>t[n],p=(e,t)=>n[t]}for(s=0,i=d.length;s<i;++s)o=d[s],c=d[s]=new M(o),null!=(u=f(o,s,r))&&(u+="")&&(h=c.id=u,g.set(h,g.has(h)?S:c)),null!=(u=p(o,s,r))&&(u+="")&&(c.parent=u);for(s=0;s<i;++s)if(u=(c=d[s]).parent){if(!(l=g.get(u)))throw new Error("missing: "+u);if(l===S)throw new Error("ambiguous: "+u);l.children?l.children.push(c):l.children=[c],c.parent=l}else{if(a)throw new Error("multiple roots");a=c}if(!a)throw new Error("no root");if(null!=e){for(;a.data===_&&1===a.children.length;)a=a.children[0],--i;for(let e=d.length-1;e>=0&&(c=d[e]).data===_;--e)c.data=null}if(a.parent=q,a.eachBefore(function(e){e.depth=e.parent.depth+1,--i}).eachBefore(w),a.parent=null,i>0)throw new Error("cycle");return a}return r.id=function(e){return arguments.length?(t=k(e),r):t},r.parentId=function(e){return arguments.length?(n=k(e),r):n},r.path=function(t){return arguments.length?(e=k(t),r):e},r}function A(e){let t=e.length;if(t<2)return"";for(;--t>1&&!T(e,t););return e.slice(0,t)}function T(e,t){if("/"===e[t]){let n=0;for(;t>0&&"\\"===e[--t];)++n;if(!(1&n))return!0}return!1}function N(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=N(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]=N(r,i[e]);return t}n[e]in i&&(i=i[n[e]])}return i}function O(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,...O(e[i].children,t-1,n)]);return r}function R(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=>O(e.children,r-1,n)}return!1}const I=/^qDimensionInfo(?:\/(\d+))?/,P=/^\/?qMeasureInfo\/(\d+)/,L=/\/qAttrExprInfo\/(\d+)/,j=/\/qAttrDimInfo\/(\d+)/;function F(e){return(e.qColumnOrder&&e.qColumnOrder.length?e.qColumnOrder:e.qDimensionInfo.map((e,t)=>t)).filter(t=>t<e.qDimensionInfo.length)}function z(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,s=-1,a=-1,l=-1,c=-1,u=-1,h=r;const d=n.qEffectiveInterColumnSortOrder,f=F(n);return I.test(h)&&(i=!0,o=+I.exec(h)[1],h=r.replace(I,"")),P.test(h)&&("K"===n.qMode?c=+P.exec(h)[1]:d&&-1!==d.indexOf(-1)?(c=+P.exec(h)[1],u=0):u=+P.exec(h)[1],h=h.replace(P,"")),h&&(j.exec(h)?a=+j.exec(h)[1]:L.exec(h)&&(s=+L.exec(h)[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:c,measureIdx:u,attrDimIdx:a,attrIdx:s}}function H(e,t){let n,r,i=R(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 V(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 B(e){let{propsArr:t,props:n,item:r,itemData:i,ret:o,sourceKey:s}=e;for(let e=0;e<t.length;e++){const a=n[t[e]],l=a.fields||[a];let c,u;a.fields&&(c=[],u=[]);for(let n=0;n<l.length;n++){const h=l[n];let d,f,p,g,m,y;if("primitive"===h.type?(p=h.value,y=String(h.value)):("function"==typeof h.value&&(d=e=>h.value(e,r)),"function"==typeof h.label&&(f=e=>h.label(e,r)),h.accessor?(g=h.accessor(r),Array.isArray(g)?(m=g.map(h.valueAccessor),h.attrAccessor&&(m=m.map(h.attrAccessor)),d&&(p=m.map(d),d=null),f&&(y=m.map(f),f=null),p=h.reduce?h.reduce(p):p,y=h.reduceLabel?h.reduceLabel(y,p):String(p)):(p=h.attrAccessor?h.attrAccessor(h.valueAccessor(g)):h.valueAccessor(g),y=p)):(p=i,y=i)),a.fields){const e=d?d(p):p;c.push(e),u.push(f&&null!=y?f(y):null!=y?y:String(e))}else{const n=d?d(p):p;o[t[e]]={value:n,label:f?f(y):null!=y?y:String(n)},h.field&&(o[t[e]].source={field:h.field.key(),key:s})}}c&&(o[t[e]]={value:"function"==typeof a.value?a.value(c,r):c,label:"function"==typeof a.label?a.label(u,r):u})}}const $=(e,t,n)=>{const r="K"===e.qMode?"/qStackedDataPages/*/qData":"/qTreeDataPages/*",i="K"===e.qMode?"qSubNodes":"qNodes",o=N(r,e);return o&&o[0]?(t.tree=y(o[0],n.children||(e=>e[i])),t.tree):null};const W=e=>{let{propsArr:t,props:n,cube:r,cache:i,itemDepthObject:o,f:s}=e;for(let e=0;e<t.length;e++){const i=n[t[e]],a=i.fields?i.fields:[i];for(let e=0;e<a.length;e++){const t=a[e];if(t.field!==s){const e=H(o,z(t.field,{cube:r}));t.accessor=e.nodeFn,t.valueAccessor=e.valueFn,t.attrAccessor=e.attrFn}}}};function U(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0,r=arguments.length>2?arguments[2]:void 0,i=arguments.length>3?arguments[3]:void 0;const o=t.raw(),s=t.key(),a="S"===o.qMode?function(e){const t=e.raw().qDataPages.length?e.raw().qDataPages[0].qMatrix:[],r=function(e){const t=e.raw().qColumnOrder,n=e.fields();return t&&t.length===n.length?t:n.map((e,t)=>t)}(e),i=e.fields(),o=e.fields().filter(e=>"dimension"===e.type()).map(e=>r.indexOf(i.indexOf(e))),s=e.fields().filter(e=>"measure"===e.type()).map(e=>r.indexOf(i.indexOf(e))),a={__root:{__id:"__root",qValues:[]}};for(let e=0;e<t.length;e++){const r=t[e];let i="__root",c=!1;for(let e=0;e<o.length;e++){var l;const t=r[o[e]],s="".concat(i,"__").concat(null!==(l=t.qElemNumber)&&void 0!==l?l:t.qElemNo);a[s]||(a[s]=n({__id:s,__parent:i,qValues:[]},t),c=!0),i=s}if(c)for(let e=0;e<s.length;e++){const t=r[s[e]];a[i].qValues.push(t)}}const c=Object.keys(a).map(e=>a[e]);return E().id(e=>e.__id).parentId(e=>e.__parent)(c)}(t):$(o,r,e);if(!a)return null;const l=a.height,c=[];for(let s=0;s<=l;s++){let a=null;if(s>0)if("S"===o.qMode){let e=F(o)[s-1];a=r.fields[e]}else{let e=o.qEffectiveInterColumnSortOrder[s-1];s>o.qEffectiveInterColumnSortOrder.length&&(e=o.qDimensionInfo.length),a=r.fields[e]}const{props:l,main:u}=i.normalizeConfig(n(n({},e),{},{field:a?a.key():void 0}),t),h=Object.keys(l);c[s]={propsArr:h,props:l,main:u};const d=a?z(a,{cube:o}):{fieldDepth:0};W({propsArr:h,props:l,cube:o,cache:r,itemDepthObject:d,f:a})}const u=a.copy().descendants(),h=a.descendants();for(let e=0;e<h.length;e++){const t=c[h[e].depth].propsArr,n=c[h[e].depth].props,r=c[h[e].depth].main,i=u[e],o=i.data,a=V(r,o,{key:s});B({propsArr:t,props:n,item:i,itemData:o,ret:a,sourceKey:s}),h[e].data=a}return a}function Y(e,t,n,r){const i=Array.isArray(e)?e:[e];let o=[];for(let s=0;s<i.length;s++)if(void 0!==i[s].field){const a=t.raw(),l=t.key();if(!$(a,n,e))continue;const c="object"==typeof i[s].field?i[s].field:t.field(i[s].field),{props:u,main:h}=r.normalizeConfig(i[s],t),d=Object.keys(u),f=z(c,{cube:a}),{nodeFn:p,attrFn:g,valueFn:m}=H({fieldDepth:0},f);W({propsArr:d,props:u,cube:a,cache:n,itemDepthObject:f,f:c});const y=!!i[s].trackBy,b=typeof i[s].trackBy,v={},x=[],w=p(n.tree),M=[];for(let e=0;e<w.length;e++){const t=w[e],n=g?g(m(t)):m(t);if(h.filter&&!h.filter(n))continue;const o=V(h,n,{key:l});B({propsArr:d,props:u,item:t,itemData:n,ret:o,sourceKey:l}),y&&r.track({cfg:i[s],itemData:n,obj:o,target:x,tracker:v,trackType:b}),M.push(o)}const k=y?r.collect(x,{main:h,propsArr:d,props:u}):M;o=[...o,...k]}return o}var K=function(e,t){return e(t={exports:{}},t.exports),t.exports}(function(e){var t;t=function(){return function(e,t){if(!e||isNaN(+t))return t;var n,r,i,o,s,a,l,c,u,h,d=e.length,f=e.search(/[0-9\-\+#]/),p=f>0?e.substring(0,f):"",g=e.split("").reverse().join(""),m=g.search(/[0-9\-\+#]/),y=d-m,b=e.substring(y,y+1),v=y+("."===b||","===b?1:0),x=m>0?e.substring(v,d):"";if(n=(t="-"===(e=e.substring(f,v)).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))+"",a=e[1]&&e[1].lastIndexOf("0"),(!(c=t.split("."))[1]||c[1]&&c[1].length<=a)&&(t=(+t).toFixed(a+1)),u=e[0].split(o),e[0]=u.join(""),(s=e[0]&&e[0].indexOf("0"))>-1)for(;c[0].length<e[0].length-s;)c[0]="0"+c[0];else 0==+c[0]&&(c[0]="");if((t=t.split("."))[0]=c[0],l=u[1]&&u[u.length-1].length){for(g="",y=(h=t[0]).length%l,d=h.length,v=0;v<d;v++)g+=h.charAt(v),!((v-y+1)%l)&&v<d-l&&(g+=o);t[0]=g}return t[1]=e[1]&&t[1]?i+t[1]:"","0"!==(r=t.join(""))&&""!==r||(n=!1),p+(n?"-":"")+r+x}},e.exports=t()});function X(e){return e.replace(/[-[\]/{}()*+?.\\^$|]/g,"\\$&")}const G={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"},J=/%\)?$/,Z=/^\(r(0[2-9]|[12]\d|3[0-6])\)/i,Q=/^\(oct\)/i,ee=/^\(dec\)/i,te=/^\(hex\)/i,ne=/^\(bin\)/i,re=/^\(rom\)/i,ie=/^(\(rom\)|\(bin\)|\(hex\)|\(dec\)|\(oct\)|\(r(0[2-9]|[12]\d|3[0-6])\))/i,oe=/#|0/g;function se(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 ae(e,t,n){let r;return Z.test(t)?e=se(e,Number(/\d{2}/.exec(t)[0]),t,n):Q.test(t)?e=se(e,8,t,n):ee.test(t)?e=se(e,10,t,n):te.test(t)?e=se(e,16,t,n):ne.test(t)?e=se(e,2,t,n):re.test(t)&&(r="",e<0&&(r="-",e=-e),e=0===(e=Math.floor(e))?"0":e<=5e5?r+(e=function(e,t){let n,r="",i=Number(String(e).slice(-3)),o=(e-i)/1e3,s=[0,1,4,5,9,10,40,50,90,100,400,500,900].reverse(),a=["0","I","IV","V","IX","X","XL","L","XC","C","CD","D","CM"].reverse();for(;i>0;)for(n=0;n<s.length;n++)if(s[n]<=i){r+=a[n],i-=s[n];break}for(n=0;n<o;n++)r="M".concat(r);return t[1]!==t[1].toUpperCase()&&(r=r.toLowerCase()),r}(e,t)):t+r+e.toExponential(0)),e}function le(e,t,n){const r=X(e);return n?r:new RegExp(r||"",t)}function ce(e,t,n,r){let i,o,s,a,l,c,u,h,d,f=e.pattern;r&&(e.abbreviate=!0),d=function(e,t){return t&&(t=X(t)),e&&(e=X(e)),new RegExp("(?:[#0]+".concat(e,")?[#0]+(?:").concat(t,"[#0]+)?"))}(t,n),s=f.match(d),s=s?s[0]:"",a=s?f.substr(0,f.indexOf(s)):f,l=s?f.substring(f.indexOf(s)+s.length):"",s||(s=f?"#":"##########"),t&&t===n&&(i=s.split(n),o=i.pop(),s=i.join("")+n+o,t=""),c=t,t=/,/.test(n)?"¤":",",c&&(s=s.replace(le(c,"g"),t)),u=n,n=".",u&&(s=s.replace(le(u,"g"),n)),h=s.match(/#/g),h=h?h.length:0;const p=f.split(u);let g;p[1]&&(g=p[1].match(oe)),e.prefix=a||"",e.postfix=l||"",e.pattern=f,e.maxPrecision=g?g.length:2,e.percentage=J.test(f),e.numericPattern=s||"",e.numericRegex=new RegExp("".concat(le(t,null,!0),"|").concat(le(n,null,!0)),"g"),e.groupTemp=c,e.decTemp=u,e.t=t,e.d=n,e.temp=h}class ue{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 G;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 ue(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],ie.test(e[0])&&(r.positive.isFunctional=!0),e[1]?ie.test(e[1])&&(r.negative.isFunctional=!0):r.negative=!1,e[2]?ie.test(e[2])&&(r.zero.isFunctional=!0):r.zero=!1;const i="U"===this.type;r.positive.isFunctional||ce(r.positive,t,n,i),r.negative&&!r.negative.isFunctional&&ce(r.negative,t,n,i),r.zero&&!r.zero.isFunctional&&ce(r.zero,t,n,i)}formatValue(e){let t,n,r,i,o,s,a,l,c,u=this._prepared,h="",d="",f=e;if(isNaN(e))return"".concat(f);if(e=+e,!1===u.pattern)return e.toString();if(0===e&&u.zero)return u=u.zero,u.pattern;if(e<0&&u.negative?(u=u.negative,e=-e):u=u.positive,o=u.d,s=u.t,u.isFunctional)e=ae(e,u.pattern,o);else{if(u.percentage&&(e*=100),u.abbreviate){const t=Object.keys(this.abbreviations).map(e=>parseInt(e,10)).sort((e,t)=>e-t);let r,i,o=t[0];for(a=0,n=Number(Number(e).toExponential().split("e")[1]);o<=n&&a<t.length;)a++,o=t[a];a>0&&(r=t[a-1]),r&&n>0&&r>0?i=r:(n<0&&r<0||!r)&&(o<0&&o-n<=u.maxPrecision?i=o:r<=n&&!(o>0&&-n<=u.maxPrecision)&&(i=r)),i&&(h=this.abbreviations[i],e/=10**i)}if(r=Math.abs(e),t=u.temp,l=u.numericPattern,c=l.split(o)[1],"I"===this.type&&(e=Math.round(e)),i=e,c||"#"!==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,c?c.length:0)).split(".")[0]);let n=l.split(o)[0];if(n+=o,e=K(n,t)||"0",c){const t=Math.max(0,Math.min(14,c.length)),n=c.replace(/#+$/,"").length;let i=("I"===this.type?0:r%1+1e-15).toFixed(t).slice(2).replace(/0+$/,"");for(a=i.length;a<n;a++)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)))),a=0;a<t;a++)l+="#";e=K(l,e)}e=e.replace(u.numericRegex,e=>e===s?u.groupTemp:e===o?u.decTemp:""),i<0&&!/^-/.test(e)&&(e="-".concat(e))}return u.prefix+e+d+h+u.postfix}static getStaticFormatter(){return{prepare(){},formatValue:e=>"".concat(e)}}}function he(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,s,a=Object.create(null),l=Object.create(null),c=0,u=0;return o=r?function(){return s=i(...arguments),o.has(s)?o.get(s):o.set(s,e(...arguments))}:t=>(s=i(t),o.has(s)?o.get(s):o.set(s,e(t))),o.set=(e,t)=>(c>=n&&(delete a[l[u]],delete l[u],c--,u++),a[e]=t,l[c]=e,c++,t),o.get=e=>a[e],o.has=e=>e in a,o.clear=()=>{a=Object.create(null),l=Object.create(null),c=0,u=0},o.size=()=>c,o}function de(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 ue(...t)}(i,e,t,n,r),s=he(o.formatValue.bind(o),{toKey:e=>isNaN(e)?e:+e});function a(e){return s(e)}return a.format=function(e,t,n,r){return s.clear(),o.format(t,e,n,r)},a.pattern=function(e){return e&&(s.clear(),o.pattern=e,o.prepare()),o.pattern},a}const fe="D",pe="T",ge="TS",me="IV",ye=["Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"],be=["Mon","Tue","Wed","Thu","Fri","Sat","Sun"],ve=["January","February","March","April","May","June","July","August","September","October","November","December"],xe=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function we(e,t){for(let n=e.length;n<t;n++)e="0".concat(e);return e}function Me(e){let t=e.toString().split(".");return t[1]?(t=Number("0.".concat(t[1])),t):0}function ke(e,t){let n,r=function(e){const t=e,n=24*Me(t),r=60*Me(n),i=60*Me(r),o=1e3*Me(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,s=r.m,a=r.s,l=r.f,c=0;/w+|t+/gi.test(t)&&(n=new Date(Date.UTC(1899,11,30+Math.floor(e),0,0,Math.round(86400*(e-Math.floor(e))))),isNaN(n.getTime())&&(n=null)),/D+/gi.test(t)||(o+=24*i),/h+/gi.test(t)||(s+=60*o),/m+/gi.test(t)||(a+=60*s),/w+/gi.test(t)&&(c=n?n.getDay()-1:0,c<0&&(c=6));let u="";return n&&(u=n.getUTCHours()>=12?"pm":"am"),{year:0,month:0,day:c,date:i,h:o,m:s,s:a,f:l,t:u}}class qe{constructor(e,t,n){const r=e||{};r.qCalendarStrings||(r.qCalendarStrings={qLongDayNames:ye,qDayNames:be,qLongMonthNames:ve,qMonthNames:xe}),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={[pe]:r.qTimeFmt||"hh:mm:ss",[fe]:r.qDateFmt||"YYYY-MM-DD",[ge]:r.qTimestampFmt||"YYYY-MM-DD hh:mm:ss"}[n]),this.pattern=t}clone(){const e=new qe(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=ke(e,t));const i=function(e,t){return{"Y+|y+":{Y:"".concat(Number("".concat(t.year).slice(-2))),YY:we("".concat(t.year).slice(-2),2),YYY:we("".concat(t.year).slice(-3),3),def:e=>we("".concat(t.year),e.length)},"M+":{M:t.month+1,MM:we("".concat(t.month+1),2),MMM:e.locale_months_abbr[t.month],def:e.locale_months[t.month]},"W+|w+":{W:t.day,WW:we("".concat(t.day),2),WWW:e.locale_days_abbr[t.day],def:e.locale_days[t.day]},"D+|d+":{D:t.date,def:e=>we("".concat(t.date),e.length)},"h+|H+":{h:t.h,def:e=>we("".concat(t.h),e.length)},"m+":{m:t.m,def:e=>we("".concat(t.m),e.length)},"s+|S+":{s:t.s,def:e=>we("".concat(t.s),e.length)},"f+|F+":{def(e){let n="".concat(t.f),r=e.length-n.length;if(r>0)for(let e=0;e<r;e++)n+="0";else r<0&&(n=n.slice(0,e.length));return n}},"t{1,2}|T{1,2}":{def(e){let n=t.t;return e[0].toUpperCase()===e[0]&&(n=n.toUpperCase()),n=n.slice(0,e.length),n}}}}(this,r),o=[];for(const e in i)Object.prototype.hasOwnProperty.call(i,e)&&o.push(e);const s=new RegExp(o.join("|"),"g");return t.replace(s,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 Se(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return new qe(...t)}function _e(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"TS",n=Se(arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,e,t),r=he(n.format.bind(n),{toKey:e=>"object"==typeof e&&"function"==typeof e.getTime?e.getTime():e});function i(e){return t!==me?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=Se(i,e,t),r=he(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 De(){let e,{meta:t,id:n,key:r,localeInfo:i,fieldExtractor:o,value:s,type:a,sourceField:l}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const c=s||("dimension"===a?e=>null==e?void 0:e.qElemNo:e=>null==e?void 0:e.qValue),u="dimension"===a?"first":"avg",h=function(e,t){if(e&&e.qNumFormat&&-1!==["D","T","TS","IV"].indexOf(e.qNumFormat.qType))return _e(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",s=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,s=s&&-1===["M"].indexOf(e.qNumFormat.qType)):s=!0,(s||"U"===o)&&(n="#".concat(i,"##"),o="U"),de(n,r,i,o,t)}(t,i),d={id:()=>n,key:()=>r,raw:()=>t,title:()=>t.qFallbackTitle||t.label,type:()=>a,origin:()=>l,items:()=>(e||(e=o(d)),e),min:()=>t.qMin,max:()=>t.qMax,value:c,label:e=>(null==e?void 0:e.qText)||"",reduce:u,reduceLabel:"dimension"===a?"first":(e,t)=>h(t),formatter:()=>h,tags:()=>t.qTags};return d}function Ce(e,t,n,r,i){return(t[e]||[]).map((t,o)=>{const s="".concat(r?"".concat(r,"/"):"").concat(e,"/").concat(o),a={instance:De(h({id:"".concat(n?"".concat(n,"/"):"").concat(s),key:s,meta:t},i))};return a.attrDims=Ce("qAttrDimInfo",t,n,s,h({},i,{value:e=>null==e?void 0:e.qElemNo,type:"dimension"})),a.attrExps=Ce("qAttrExprInfo",t,n,s,h({},i,{value:e=>null==e?void 0:e.qNum,type:"measure"})),a.measures=Ce("qMeasureInfo",t,n,s,h({},i,{value:e=>null==e?void 0:e.qValue,type:"measure"})),a})}function Ee(){let{key:e,data:t,config:r={}}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const i={fields:[],wrappedFields:[],allFields:[],virtualFields:[]},o=t;if(!o)throw new Error('Missing "data" input');if(!o.qDimensionInfo)throw new Error('The "data" input is not recognized as a hypercube');const s=Ee.util,a={cache:i,cube:o,localeInfo:r.localeInfo,fieldExtractor:null,pages:null,hierarchy:()=>null,virtualFields:r.virtualFields},l={key:()=>e,raw:()=>o,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:()=>i.fields.slice(),extract:e=>a.extractor(e,l,i,s),hierarchy:e=>a.hierarchy(e,l,i,s),_cache:()=>i};"K"===o.qMode||"T"===o.qMode||!o.qMode&&o.qNodesOnDim?(a.extractor=Y,a.hierarchy=U,a.pages="K"===o.qMode?o.qStackedDataPages:o.qTreeDataPages):"S"===o.qMode?(a.extractor=g,a.pages=o.qDataPages,a.hierarchy=U):a.extractor=()=>[],a.fieldExtractor=e=>a.extractor({field:e},l,i,s);const c="S"===o.qMode?e=>e.qElemNumber:void 0,u="S"===o.qMode?e=>e.qNum:void 0;i.wrappedFields.push(...Ce("qDimensionInfo",o,e,"",h({},a,{value:c,type:"dimension"}))),i.wrappedFields.push(...Ce("qMeasureInfo",o,e,"",h({},a,{value:u,type:"measure"}))),i.fields=i.wrappedFields.map(e=>e.instance);const d=e=>{e.forEach(e=>{i.allFields.push(e.instance),d(e.measures),d(e.attrDims),d(e.attrExps)})};return d(i.wrappedFields),(r.virtualFields||[]).forEach(t=>{const r=l.field(t.from),o=De(n({meta:r.raw(),id:"".concat(e,"/").concat(t.key),sourceField:r,fieldExtractor:e=>a.extractor({field:e},l,i,s),key:t.key,type:r.type(),localeInfo:a.localeInfo,value:r.value},t.override||{}));i.virtualFields.push(o)}),i.allFields.push(...i.virtualFields),l}const Ae=[["qHyperCube","qHyperCubeDef"],["qTreeData","qTreeDataDef"],["qDimensionInfo","qDimensions"],["qMeasureInfo","qMeasures"],["qAttrDimInfo","qAttributeDimensions"],["qAttrExprInfo","qAttributeExpressions"]],Te=/\/qDimensionInfo(?:\/(\d+))?/,Ne=/\/qMeasureInfo\/(\d+)/,Oe=/\/qAttrDimInfo\/(\d+)(?:\/(\d+))?/,Re=/\/qAttrExprInfo\/(\d+)/,Ie=/\/?qHyperCube/,Pe=/\/?qTreeData/,Le=e=>"".concat(e.substr(0,e.indexOf("/qHyperCubeDef")+14)),je=e=>"".concat(e.substr(0,e.indexOf("/qTreeDataDef")+13));function Fe(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=[],s={},a=e.isActive();let l=!1;return e.brushes().forEach(e=>{const t=function(e,t){let n=e,r=-1,i=-1,o="",s=e=>e;Ie.test(e)?(o="".concat(n.substr(0,n.indexOf("qHyperCube")+10)),s=Le):Pe.test(e)&&(o="".concat(n.substr(0,n.indexOf("qTreeData")+9)),s=je);let a=!0;if(Te.test(e)&&(r=+Te.exec(e)[1]),Ne.test(e)&&(i=+Ne.exec(e)[1]),Oe.test(e)){i=-1,r=0;const e=+Oe.exec(n)[2];isNaN(e)||(r=e,n=n.replace(/\/\d+$/,"")),a=!1}if(Re.test(e)){const e=i;if(t){i=0;const s=N(o,t);i+=(s.qMeasureInfo||[]).length,r>-1?(i=s.qDimensionInfo.slice(0,r).reduce((e,t)=>e+t.qAttrExprInfo.length,i),r=-1):(i=s.qDimensionInfo.reduce((e,t)=>e+t.qAttrExprInfo.length,i),i=s.qMeasureInfo.slice(0,e).reduce((e,t)=>e+t.qAttrExprInfo.length,i)),i+=+Re.exec(n)[1]}else r>-1?(r=-1,i=+Re.exec(n)[1]):i+=+Re.exec(n)[1]+1}return Ae.forEach(e=>{let[t,r]=e;n=n.replace(t,r)}),a&&(n=s(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,s.multiRangeSelectTreeDataValues||(s.multiRangeSelectTreeDataValues={path:t.path,ranges:[]}),n.forEach(e=>s.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,s.rangeSelectHyperCubeValues||(s.rangeSelectHyperCubeValues={path:t.path,ranges:[]}),n.forEach(e=>s.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,s.selectHyperCubeContinuousRange||(s.selectHyperCubeContinuousRange={path:t.path,ranges:[]}),n.forEach(e=>s.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,a=r.qEffectiveInterColumnSortOrder.indexOf(t.dimensionIdx);if(s.selectPivotCells||(s.selectPivotCells={path:t.path,cells:[]}),e.id===i||!i){const n=e.brush.values().map(e=>+e).filter(e=>!isNaN(e));(0===o||a>=o)&&o>-1?n.forEach(e=>{s.selectPivotCells.cells.push({qType:"T",qCol:e,qRow:a-o})}):n.forEach(e=>{s.selectPivotCells.cells.push({qType:"L",qCol:t.dimensionIdx,qRow:e})}),l=!!s.selectPivotCells.cells.length}}else s.selectHyperCubeCells||(s.selectHyperCubeCells={path:t.path,cols:[]}),s.selectHyperCubeCells.cols.push(t.dimensionIdx),e.id!==i&&(i||s.selectHyperCubeCells.values)||(s.selectHyperCubeCells.values=e.brush.values().map(e=>+e).filter(e=>!isNaN(e)),l=!!s.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&&a?[{method:"resetMadeSelections",params:[]}]:(s.rangeSelectHyperCubeValues&&o.push({method:"rangeSelectHyperCubeValues",params:[s.rangeSelectHyperCubeValues.path,s.rangeSelectHyperCubeValues.ranges,[],null===(c=t.orMode)||void 0===c||c]}),s.selectHyperCubeContinuousRange&&o.push({method:"selectHyperCubeContinuousRange",params:[s.selectHyperCubeContinuousRange.path,s.selectHyperCubeContinuousRange.ranges]}),s.selectHyperCubeCells&&o.push({method:"selectHyperCubeCells",params:[s.selectHyperCubeCells.path,s.selectHyperCubeCells.values,s.selectHyperCubeCells.cols]}),s.selectPivotCells&&o.push({method:"selectPivotCells",params:[s.selectPivotCells.path,s.selectPivotCells.cells]}),s.multiRangeSelectTreeDataValues&&o.push({method:"multiRangeSelectTreeDataValues",params:[s.multiRangeSelectTreeDataValues.path,s.multiRangeSelectTreeDataValues.ranges]}),o);var c}function ze(e){Ee.util=e.data("matrix").util,e.data("q",Ee),e.formatter("q-number",de),e.formatter("q-time",_e)}return ze.qBrushHelper=Fe,ze.selections=Fe,ze}());Cb(Bv);const $v=/xyz/.test(()=>{})?/\b_super\b/:/.*/,Wv=function(){};Wv.extend=function e(t,n){const r=this.prototype;"string"!=typeof t&&(n=t,t="Class");const i=Object.create(this.prototype);for(const e in n)i[e]="function"==typeof n[e]&&"function"==typeof r[e]&&$v.test(n[e])?function(e,t){return function(){const n=this._super;this._super=r[e];const i=t.apply(this,arguments);return this._super=n,i}}(e,n[e]):n[e];if(!/^[_a-z][_a-z\d]*$/i.test(t))throw new Error("Invalid subclass name. Alphanumericals only.");const o=new Function(`return (function ${t}(){ typeof this.init === 'function' && this.init.apply(this, [].slice.call(arguments)) });`)();return o.prototype=i,o.prototype.constructor=o,o.extend=e,o};const Uv={getChar(e){let t,n=e;return n>9?(t=65+n-10,t>90&&(t+=6)):n=`${n}`.charCodeAt(0),[48,111,79,105,73,108].indexOf(t)>-1?this.getChar(n+1):String.fromCharCode(t)},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,"")}};function Yv(){return Uv.id()}const Kv="scrollbar";function Xv(e,t,n){return"y"===e?Gv(t,n):function(e){return"far"===e?"top":"bottom"}(t)}function Gv(e,t){const n=e||"near";return t&&"near"===n||!t&&"far"===n?"right":"left"}var Jv={getAxisDock:Xv,getOppositeAxisDock:function(e,t,n){return Xv(e,"far"===t?"near":"far",n)},getYAxisDock:Gv};const Zv=new RegExp("[A-Za-zªµºÀ-ÖØ-öø-ʸʻ-ˁː-ˑˠ-ˤˮͰ-ͳͶ-ͽΆΈ-ϵϷ-҂Ҋ-։ः-हऻऽ-ीॉ-ौॎ-ॐक़-ॡ।-ॿং-হঽ-ীে-ৌৎ-ৡ০-ৱ৴-৺ਃ-ਹਾ-ੀਖ਼-੯ੲ-ੴઃ-હઽ-ીૉ-ૌૐ-ૡ૦-૯ଂ-ହଽ-ାୀେ-ୌୗ-ୡ୦-୷ஃ-ிு-ௌௐ-௲ఁ-ఽు-ౄౘ-ౡ౦-౯౿-ಹಽ-ೋೕ-ೡ೦-ീെ-ൌൎ-ൡ൦-ෆා-ෑෘ-ะา-ำเ-ๆ๏-ະາ-ຳຽ-ໆ໐-༗༚-༴༶༸༾-ཬཿ྅ྈ-ྌ྾-࿅࿇-ာေးျ-ြဿ-ၗၚ-ၝၡ-ၰၵ-ႁႃ-ႄႇ-ႌႎ-ႜ႞-ፚ፠-ᎏᎠ-Ᏼᐁ-ᙿᚁ-ᚚᚠ-ᜑᜠ-ᜱ᜵-ᝑᝠ-ᝰក-ាើ-ៅះ-ៈ។-៚ៜ០-៩᠐-ᢨᢪ-ᤜᤣ-ᤦᤩ-ᤱᤳ-ᤸ᥆-᧚ᨀ-ᨖᨙ-ᩕᩗᩡᩣ-ᩤᩭ-ᩲ᪀-᪭ᬄ-ᬳᬵᬻᬽ-ᭁᭃ-᭪᭴-᭼ᮂ-ᮡᮦ-ᮧ᮪-ᯥᯧᯪ-ᯬᯮ᯲-ᰫᰴ-ᰵ᰻-᱿᳓᳡ᳩ-ᳬᳮ-ᶿḀ-ᾼιῂ-ῌῐ-Ίῠ-Ῥῲ-ῼⁱⁿₐ-ₜℂℇℊ-ℓℕℙ-ℝℤΩℨK-ℭℯ-ℹℼ-ℿⅅ-ⅉⅎ-⅏Ⅰ-ↈ⌶-⍺⎕⒜-ⓩ⚬⠀-⣿Ⰰ-ⳤⳫ-ⳮⴀ-⵰ⶀ-ⷞ々-〇〡-〩〱-〵〸-〼ぁ-ゖゝ-ゟァ-ヺー-ㆺㇰ-㈜㈠-㉏㉠-㉻㉿-㊰㋀-㋋㋐-㍶㍻-㏝㏠-㏾㐀-䶵一-ꒌꓐ-ꘌꘐ-ꙮꚀ-ꛯ꛲-꛷Ꜣ-ꞇ꞉-ꠁꠃ-ꠅꠇ-ꠊꠌ-ꠤꠧ꠰-꠷ꡀ-ꡳꢀ-ꣃ꣎-꣙ꣲ-ꤥ꤮-ꥆꥒ-ꥼꦃ-ꦲꦴ-ꦵꦺ-ꦻꦽ-ꨨꨯ-ꨰꨳ-ꨴꩀ-ꩂꩄ-ꩋꩍ-ꪯꪱꪵ-ꪶꪹ-ꪽꫀꫂ-ꯤꯦ-ꯧꯩ-꯬꯰-ﬗA-Za-zヲ-ᅵ]"),Qv=new RegExp("[־׀׃׆א-״߀-ߪߴ-ߵߺ-ࠕࠚࠤࠨ࠰-ࡘ࡞יִײַ-ﬨשׁ-ﭏ]"),ex=new RegExp("[؈؋؍؛-ي٭-ٯٱ-ەۥ-ۦۮ-ۯۺ-܍ܐܒ-ܯݍ-ޥޱﭐ-ﴽﵐ-﷼ﹰ-ﻼ]");function tx(e){return Zv.test(e)}function nx(e){return Qv.test(e)||ex.test(e)}var rx={lrm:String.fromCharCode(8206),detectTextDirection:function(e){const t=e?e.length:0;let n,r;for(n=0;n<t;n++){if(r=e[n],tx(r))return"ltr";if(nx(r))return"rtl"}return"ltr"}};var ix={lineSettings:function(e,t){const n=void 0!==t.paletteColor?t.theme.getColorPickerColor(t.paletteColor):"transparent";return Db(!0,{value:0,line:{stroke:n,strokeDasharray:t?.style?.lineType}},e||{})},lineLabelSettings:function(e,t){const n=t&&t.chartID;let r=t.theme.getStyle(n,"referenceLine.label.name","color");const i=t.theme.getStyle(n,"referenceLine.label.name","fontSize"),o=t.theme.getStyle(n,"referenceLine.label.name","fontFamily");return t.paletteColor?r=t.theme.getColorPickerColor(t.paletteColor):r||(r="transparent"),Db(!0,{value:0,line:{stroke:"transparent"},label:{align:"center",vAlign:"middle",text:"",fill:r,fontFamily:o,fontSize:i,maxWidthPx:135}},e||{})},isVisible:e=>e&&!1!==e.show&&0!==e.show&&"0"!==e.show&&void 0!==e.refLineExpr,getRefLineTitle:function({refLine:e,label:t,valueString:n}){return!1!==e.showValue?!1!==e.showLabel?`${t} ${rx.lrm}(${n})${rx.lrm}`:`${rx.lrm}(${n})${rx.lrm}`:!1!==e.showLabel?t:""}};const ox={SHOW_AXIS_LABELS_OPTIONS:["all","labels"],SHOW_TITLE_OPTIONS:["all","title"],HORIZONTAL:"horizontal",VERTICAL:"vertical",LAYOUTSETTINGS:{lasso:{displayOrder:1e4},rangeDim:{displayOrder:1e4},rangeMeasure:{displayOrder:1e4},rangeMinor:{displayOrder:1e4},scrollBar:{minimumLayoutMode:"SPARK",prioOrder:-1,displayOrder:100},refLines:{layout:{minimumLayoutMode:"SPARK",prioOrder:60,displayOrder:1110}},measureAxisTitle:{minimumLayoutMode:"XSMALL",prioOrder:30,displayOrder:90},dimensionAxisTitle:{minimumLayoutMode:"XSMALL",prioOrder:30,displayOrder:90},measureAxis:{minimumLayoutMode:"XSMALL",prioOrder:10,displayOrder:80},dimensionAxis:{minimumLayoutMode:"XSMALL",prioOrder:10,displayOrder:80},gridLines:{minimumLayoutMode:"XSMALL",displayOrder:-100},refLinesLabels:{minimumLayoutMode:"SMALL",prioOrder:60,displayOrder:0}}};ox.DEFAULT_CHART_ORIENTATION=ox.HORIZONTAL;function sx(e,t){const n=t||{},r=n.measureAxisProperties||{},i=n.dimensionAxisProperties||{},o=n.orientation||ox.DEFAULT_CHART_ORIENTATION,s=o===ox.HORIZONTAL,a=s?"x":"y",l=s?"y":"x",c=ox.SHOW_AXIS_LABELS_OPTIONS,u=ox.SHOW_TITLE_OPTIONS,h=c.includes(r.show),d=!!n.measureTitleText&&u.includes(r.show),f=n.includeDimensionAxis&&c.includes(i.show),p=n.includeDimensionAxis&&!!n.dimensionTitleText&&u.includes(i.show),g=n.gridlines&&!(!n.gridlines.auto&&0===n.gridlines.spacing),m=n.refLines&&n.refLines.some(e=>e.show),y=[];if(h&&function(e,t,n,r){let i={scale:"measure",settings:t.axisLabelStyle||{},forceBounds:r&&!r.autoMinMax&&r.showBounds};i=Db(i,ox.LAYOUTSETTINGS.measureAxis);const o=lx(t,n);e.addComponent(`${n}-axis`,i,o)}(e,n,a,r),d&&function(e,t,n){let r={text:t.measureTitleText,style:t.axisTitleStyle||{}};r=Db(r,ox.LAYOUTSETTINGS.measureAxisTitle);const i=function(e,t){return lx(e,t)}(t,n);e.addComponent(`${n}-axis-title`,r,i)}(e,n,a),function(e,t,n,r){let i=t.measureScaleSettings;const o={isRtl:t.isRtl,source:t.measureSource,orientation:n,measureAxisProperties:r};r&&r.spacing>0&&(i=Db(!0,i||{},{component:{ticks:{distance:100*r.spacing}}}));e.addScale("measure-scale",i,o)}(e,n,o,r),f&&function(e,t,n){let r={scale:"dimension",settings:t.axisLabelStyle||{}};r=Db(r,ox.LAYOUTSETTINGS.dimensionAxis);const i=cx(t,n);Db(!0,r,t.dimensionAxisSettings||{}),e.addComponent(`${n}-axis`,r,i)}(e,n,l),p&&function(e,t,n){let r={text:t.dimensionTitleText,style:t.axisTitleStyle||{}};r=Db(r,ox.LAYOUTSETTINGS.dimensionAxisTitle);const i=function(e,t){return cx(e,t)}(t,n);e.addComponent(`${n}-axis-title`,r,i)}(e,n,l),n.includeDimensionAxis&&function(e,t,n){const r={isRtl:t.isRtl,source:t.dimensionSource,orientation:n===ox.HORIZONTAL?ox.VERTICAL:ox.HORIZONTAL};e.addScale("dimension-scale",t.dimensionScaleSettings,r)}(e,n,o),g&&function(e,t,n){let r={ticks:{show:!0},minorTicks:{show:!t.auto&&!t.auto&&3===t.spacing}};r=Db(r,ox.LAYOUTSETTINGS.gridLines),r[n]={scale:"measure"},e.addComponent("grid-line",r)}(e,n.gridlines,a),n.hasNavigation&&function(e,t,n,r){const i=e.getSettings();i.scroll={dimension:{viewSize:n.scrollSettings&&n.scrollSettings.viewSize||0,max:n.scrollSettings&&n.scrollSettings.max||0}};const o={isRtl:n.isRtl,chartID:n.chartID,isHorizontal:!r},s=Db({},ox.LAYOUTSETTINGS.scrollBar);e.addComponent("scrollbar",s,o),ax(t,function(e){function t(t,n){if(!n||!e())return!1;const r={x:n.center.x-n.deltaX,y:n.center.y-n.deltaY};return this.chart.componentsFromPoint(r).some(e=>e.settings.key===Kv)}const n={type:"Tap",options:{enable:t},events:{tap(e){this.chart.component(Kv).emit("tap",e)}}},r={type:"Pan",options:{enable:t},events:{panstart(e){this.chart.component(Kv).emit("panStart",e)},pan(e){this.chart.component(Kv).emit("panMove",e)},panend(e){this.chart.component(Kv).emit("panEnd",e)},pancancel(e){this.chart.component(Kv).emit("panCancel",e)}}};return[n,r]}(n.isNavigationEnabledFn))}(e,y,n,s),m&&function(e,t,n,r){const i=Jv.getAxisDock(n,r.dock,t.isRtl);let o={key:"ref-line",style:{oob:{show:!1}},lines:{x:[],y:[]}};o=Db(o,ox.LAYOUTSETTINGS.refLines);let s={key:`ref-line-labels-${Yv()}`,require:["renderer","chart"],dock:Jv.getOppositeAxisDock(n,r.dock,t.isRtl),preferredSize(){if("x"===n)return 26;const t=this.renderer.measureText,r=this.chart.formatter({data:e.settings.scales.measure.data}),i=s.lines.y.map(e=>{const n=!1!==e.label.showValue?`(${r(e.value)})`:"",i=`${e.label.text} ${n}`,o=e.label.text&&n?` ${n}`:n;return{wanted:t({text:i,fontSize:e.fontSize,fontFamily:e.fontFamily}).width,required:t({text:o,fontSize:e.fontSize,fontFamily:e.fontFamily}).width}}),o=i[0];for(let e=1;e<i.length;e++)i[e].wanted>o.wanted&&(o.wanted=i[e].wanted),i[e].required>o.required&&(o.required=i[e].required);const a=12;return o.required+a>100?o.required+a:Math.min(o.wanted+a,100)},lines:{x:[],y:[]}};s=Db(s,ox.LAYOUTSETTINGS.refLinesLabels),t.refLines.forEach(r=>{if(!r.show)return;const a=r.refLineExpr&&r.refLineExpr.value,l=Db(!0,{},t,{paletteColor:r.paletteColor,style:r.style,chartID:e.options.chartID}),c=ix.lineSettings({scale:"measure",dir:n,value:a},l);o.lines[n].push(c);const u=ix.lineLabelSettings({scale:"measure",value:a,label:{text:!1!==r.showLabel?r.label:"",showValue:!1!==r.showValue}},l);"x"===n?u.label.vAlign="near"===i?1:0:u.label.align="near"===i?0:1,s.lines[n].push(u)}),e.addComponent("ref-line",o,{}),e.addComponent("ref-line",s,{})}(e,n,a,r),n.enableLasso&&n.selectionsEnabled){!function(e,t){const n={brushKey:t.brushKey,brushComponents:t.brushComponents,brushData:t.brushData};e.addComponent("lasso",ox.LAYOUTSETTINGS.lasso,n)}(e,n.lasso||{})}if(n.enableDimRange&&n.includeDimensionAxis&&n.selectionsEnabled){!function(e,t,n,r,i){let o={key:"rangeDim"};o=Db(o,ox.LAYOUTSETTINGS.rangeDim);const s={brushKey:t.brushKey,brushAxis:t.brushAxis,brushArea:t.brushArea,brushScale:t.brushScale,isHorizontal:!n,dock:r,isRtl:i};e.addComponent("range",o,s)}(e,n.dimRange||{},s,cx(n,l).dock,n.isRtl)}if(n.enableMeasureRange&&n.selectionsEnabled){!function(e,t,n,r,i){let o={key:"rangeMeasure"};o=Db(o,ox.LAYOUTSETTINGS.rangeMeasure);const s={brushKey:t.brushKey,brushAxis:t.brushAxis,brushArea:t.brushArea,brushScale:t.brushScale,multiple:t.multiple,isHorizontal:n,dock:r,isRtl:i};e.addComponent("range",o,s)}(e,n.measureRange||{},s,lx(n,a).dock,n.isRtl)}if(n.enableAreaRange&&n.selectionsEnabled){!function(e,t,n,r,i){let o={key:"rangeMinor"};o=Db(o,ox.LAYOUTSETTINGS.rangeMinor);const s={brushKey:t.brushKey,brushAxis:t.brushAxis,brushData:t.brushData,brushArea:t.brushArea,brushComponents:t.brushComponents,brushScale:t.brushScale,multiple:t.multiple,isHorizontal:"measure"===t.brushScale?n:!n,dock:r,isRtl:i,chartInstance:t.chartInstance};e.addComponent("range-area",o,s)}(e,n.areaRange||{},s,cx(n,l).dock,n.isRtl)}n.brushActions&&ax(y,n.brushActions),y.length&&function(e,t){e.addInteraction({},{gestures:t})}(e,y)}function ax(e,t){t.forEach(t=>{e.push(t)})}function lx(e,t){return{dock:e.measureAxisProperties&&e.measureAxisProperties.dock,direction:t,isRtl:e.isRtl}}function cx(e,t){return{dock:e.dimensionAxisProperties&&e.dimensionAxisProperties.dock,direction:t,isRtl:e.isRtl}}function ux(e,t){const n=t||{},r=!n.orientation||"horizontal"===n.orientation,i=!!n.isRtl,o={name:n.name||"scale",component:{invert:r&&i,minorTicks:{count:1},range:n.range||void 0,domain:n.domain||void 0,trackBy:n.trackBy||"id"}};return Db(!0,{},o,e||{})}function hx(){return/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)?void 0:"svg"}function dx(e,t){const n=t&&t.chartID,r=t&&t.dock,i=t&&t.direction,o=t&&t.isRtl,s=t.theme.getStyle(n,"axis.line.major","color"),a=t.theme.getStyle(n,"axis.title","fontSize"),l=t.theme.getStyle(n,"axis.title","color"),c=t.theme.getStyle(n,"axis.label.name","color"),u=t.theme.getStyle(n,"axis.label.name","fontSize"),h=t.theme.getStyle(n,"axis.title","fontFamily"),d=t.theme.getStyle(n,"axis.label.name","fontFamily"),f={key:"axis",type:"axis",renderer:hx(),dock:Jv.getAxisDock(i,r,o),brush:{trigger:[],consume:[]},settings:{title:{fontSize:a,fontFamily:h,fill:l},line:{show:!0,strokeWidth:1,stroke:s},labels:{fill:c,fontSize:u,fontFamily:d,tiltAngle:o?-40:40,maxEdgeBleed:75,maxSize:150,mode:"auto"},ticks:{stroke:s},minorTicks:{stroke:s}}},p=Db(!0,{},f,e||{});return p.brush.consume.forEach(e=>{e.style.active.strokeWidth=0}),p}function fx(e,t){const n=t&&t.chartID,r=t&&t.dock,i=t&&t.direction,o=t&&t.isRtl,s=t.theme.getStyle(n,"axis.title","fontSize"),a=t.theme.getStyle(n,"axis.title","color"),l=t.theme.getStyle(n,"axis.title","fontFamily"),c={key:"text",type:"text",dock:Jv.getAxisDock(i,r,o),displayOrder:0,style:{text:{fontSize:s,fontFamily:l,fill:a}}};return Db(!0,{},c,e||{})}ux.measureScale=function(e,t){let n=(t||{}).source||[];"string"==typeof n&&(n=[n]);const r={name:"measure",component:{expand:.1,data:{fields:n.map(e=>({field:e}))}}},i=t&&t.measureAxisProperties;i&&!i.autoMinMax&&(["min","minMax"].includes(i.minMax)&&(r.component.min=i.min),["max","minMax"].includes(i.minMax)&&(r.component.max=i.max));const o=ux(Db(!0,r,e||{}),t);return!(e&&e.component&&void 0!==e.component.invert)&&t&&"vertical"===t.orientation&&(o.component.invert=!o.component.invert),o},ux.dimensionScale=function(e,t){const n={name:"dimension",component:{trackBy:"id",type:"band",data:{extract:{field:t&&t.source||"",props:{label:e=>e.qText||""}}},label:e=>e.datum.label.value}};return ux(Db(!0,n,e||{}),t)},dx.xAxis=function(e,t){return dx(Db(!0,{key:"x-axis",scale:"x"},e||{}),t)},dx.yAxis=function(e,t){const n=t&&t.dock,r=t&&t.isRtl,i={key:"y-axis",scale:"y",dock:Jv.getYAxisDock(n,r)};return dx(Db(!0,i,e||{}),t)},fx.xAxisTitle=function(e,t){return fx(Db(!0,{key:"x-axis-title"},e||{}),t)},fx.yAxisTitle=function(e,t){const n=t&&t.dock,r=t&&t.isRtl,i={key:"y-axis-title",dock:Jv.getYAxisDock(n,r)||"left"};return fx(Db(!0,i,e||{}),t)};var px={getBublesAlign:function(e,t,n){let r=e&&"far"!==t||!e&&"far"===t;return!e&&n&&(r=!r),r?"start":"end"},getDock:function(e,t){const n=[];let r;return e&&n.push(`@${e}`),t&&n.push(`@${t}`),n.length&&(r=n.join(",")),r}};const gx={SPARK:{width:0,height:0},XSMALL:{width:150,height:75},SMALL:{width:300,height:150},MEDIUM:{width:400,height:220},FULL:{width:550,height:450}};function mx(){return gx}function yx(e){const t=e.data.end;return e.dataset(t.source.key).field(t.source.field).formatter()(t.value)}mx.getLayoutModeKeys=function(){const e=[];let t;for(t in gx)e.push(t);return e};const bx={left:"left",right:"right",up:"top",down:"bottom"};function vx(e,t,n){switch(e){case"scale":return ux(t,n);case"measure-scale":return ux.measureScale(t,n);case"dimension-scale":return ux.dimensionScale(t,n);case"axis":return dx(t,n);case"box-marker":return function(e){return Db(!0,{},{key:"box-marker",type:"box-marker",settings:{minor:{scale:"x"},orientation:"horizontal"},brush:{trigger:[],consume:[]}},e||{})}(t);case"point-marker":return function(e){return Db(!0,{},{key:"point-marker",type:"point-marker",settings:{},brush:{trigger:[],consume:[]}},e||{})}(t);case"scrollbar":return function(e,t){const n=t&&t.isRtl,r=t&&t.chartID,i=t&&t.isHorizontal,o={key:"scrollbar",type:"scrollbar",scroll:"dimension",dock:i?"bottom":n?"left":"right",settings:{backgroundColor:t.theme.getStyle(r,"","backgroundColor"),invert:n&&i}};return Db(!0,{},o,e||{})}(t,n);case"text":return fx(t,n);case"lasso":return function(e,t){const n=t&&t.brushKey,r=t&&t.brushComponents?t.brushComponents:[],i=t&&t.brushData?t.brushData:["elemNo"],o={type:"brush-lasso",key:"lasso",displayOrder:99,settings:{brush:{components:[]},lasso:{fill:"rgba(0, 0, 0, 0)",stroke:"rgba(102,102,102,1)",strokeWidth:2,opacity:1,strokeDasharray:null},startPoint:{r:10,fill:"rgba(0, 152, 69, 1)",strokeWidth:0,opacity:1}}};return r.forEach(e=>{o.settings.brush.components.push({contexts:n?[n]:void 0,key:e,data:i})}),Db(!0,{},o,e||{})}(t,n);case"range":return function(e,t){const n=t&&t.brushKey,r=t&&t.brushAxis,i=t&&t.brushArea,o=t&&t.brushScale,s=t&&t.isHorizontal,a=t&&t.dock,l=t&&t.isRtl,c={type:"brush-range",key:"range",displayOrder:99,dock:px.getDock(r,i),settings:{brush:n,fill:"rgba(0, 0, 0, 0)",scale:o,multiple:!t||!1!==t.multiple||t.multiple,direction:s?"horizontal":"vertical",target:{component:r,fill:"rgba( 82, 204, 82, 0.2 )",fillActive:"rgba(82, 204, 82, 0.4)"},bubbles:{align:px.getBublesAlign(s,a,l)}}};return Db(!0,{},c,e||{})}(t,n);case"range-area":return function(e,t){const n=t&&t.brushKey,r=t&&t.brushAxis,i=t&&t.brushComponents?t.brushComponents:[],o=t&&t.brushData?t.brushData:["elemNo"],s=t&&t.brushArea,a=t&&t.isHorizontal,l=t&&t.dock,c=t&&t.isRtl,u=t&&t.chartInstance;let h=!0;const d={type:"brush-area-dir",key:"area",displayOrder:99,dock:px.getDock(r,s),settings:{brush:{components:[]},direction:a?"horizontal":"vertical",target:{component:r,fill:"rgba( 82, 204, 82, 0.2 )",fillActive:"rgba(82, 204, 82, 0.4)"},bubbles:{align:px.getBublesAlign(a,l,c),label:e=>h?(h=!1,u.dataset(e.binStart.source.key).field(e.binStart.source.field).formatter()(e.binStart.value)):(h=!0,u.dataset(e.binEnd.source.key).field(e.binEnd.source.field).formatter()(e.binEnd.value))},multiple:!t||!1!==t.multiple||t.multiple}};return i.forEach(e=>{d.settings.brush.components.push({contexts:n?[n]:void 0,key:e,data:o,action:"add"})}),Db(!0,{},d,e||{})}(t,n);case"categorical-legend":return function(e,t){const n=t&&t.chartID,r=t&&t.isRtl;let i=t&&t.dock||"auto";const o=t&&t.show;"auto"===i&&(i=t.chartHeight/t.chartWidth<1?r?"left":"right":"bottom");const s=t.theme.getStyle(n,"legend.title","color"),a=t.theme.getStyle(n,"legend.title","fontSize"),l=t.theme.getStyle(n,"legend.label","color"),c=t.theme.getStyle(n,"legend.label","fontSize"),u=t.theme.getStyle(n,"legend.title","fontFamily"),h=t.theme.getStyle(n,"legend.label","fontFamily"),d={key:"legend",type:"legend-cat",renderer:hx(),dock:i,show:o,scale:{type:"color"},settings:{title:{anchor:"middle"},layout:{direction:r?"rtl":"ltr",size:"top"===i||"bottom"===i?2:1,vertical:"top"===i||"bottom"===i?16:8},navigation:{button:{class:{"lui-fade-button":!0},content:(e,t)=>e("span",{style:{pointerEvents:"none"},class:["lui-button__icon","lui-icon",`lui-icon--triangle-${bx[t.direction]}`].join(" ")})}}},style:{item:{label:{fontSize:c,fontFamily:h,fill:l,lineHeight:1,wordBreak:"break-word"},margin:{top:5,left:10,right:10,bottom:10},shape:{type:t.type?t.type:"square",size:3*parseInt(c,10)/4}},title:{show:t.showTitle,fontSize:a,fontFamily:u,fill:s}}};return Db(!0,{},d,e)}(t,n);case"sequential-legend":return function(e,t){const n=t&&t.chartID,r=t&&t.isRtl;let i=t.dock||"auto";"auto"===i&&(i=t.chartHeight<t.chartWidth?r?"left":"right":"bottom");const o=t.theme.getStyle(n,"legend.title","color"),s=t.theme.getStyle(n,"legend.title","fontSize"),a=t.theme.getStyle(n,"legend.title","fontFamily"),l=t.theme.getStyle(n,"legend.label","color"),c=t.theme.getStyle(n,"legend.label","fontSize"),u=t.theme.getStyle(n,"legend.label","fontFamily");function h(e){switch(e){case"left":return 0;case"right":return 1;default:return.5}}const d={key:"seqlegend",type:"legend-seq",dock:i,displayOrder:200,minimumLayoutMode:"MEDIUM",prioOrder:0,settings:{align:h(r?"right":"left"),major:{invert:"left"===i||"right"===i||r},title:{show:t.showTitle,fontSize:s,fontFamily:a,fill:o},tick:{fill:l,fontSize:c,fontFamily:u}}};return Db(!0,{},d,e)}(t,n);case"x-axis":return dx.xAxis(t,n);case"y-axis":return dx.yAxis(t,n);case"x-axis-title":return fx.xAxisTitle(t,n);case"y-axis-title":return fx.yAxisTitle(t,n);case"grid-line":return function(e,t){const n=t&&t.chartID,r=t.theme.getStyle(n,"grid.line.major","color");return Db(!0,{},{displayOrder:-1,key:"grid-line",type:"grid-line",x:null,y:null,ticks:{stroke:r},minorTicks:{stroke:r}},e||{})}(t,n);case"interaction":return function(e,t){const n=t&&t.gestures||[];return Db(!0,{},{type:"hammer",key:"hammered",gestures:n},e||{})}(t,n);case"ref-line":return function(e,t){const n=t&&t.chartID,r=t.theme.getStyle(n,"referenceLine.outOfBounds","color"),i=t.theme.getStyle(n,"referenceLine.outOfBounds","backgroundColor");return Db(!0,{},{key:"ref-line",type:"ref-line",dock:"center",prioOrder:-1,lines:{x:[],y:[]},style:{oob:{width:7,fill:i,text:{fill:r},padding:{x:7,y:5}}}},e||{})}(t,n);case"event-area":return function(e){return Db(!0,{},{type:"event-area",key:"event-area"},e||{})}(t);case"labels":return function(e,t){const n=t&&t.chartID,r=t.theme.getStyle(n,"label.value","color"),i=t.theme.getStyle(n,"label.value","fontSize"),o=t.theme.getStyle(n,"label.value","fontFamily"),s={key:"labels",type:"labels",renderer:hx(),displayOrder:1,settings:{sources:[{component:"box-marker",selector:"rect",strategy:{type:"bar",settings:{direction:"up",fontFamily:o,fontSize:parseFloat(i),align:.5,labels:[{placements:[{position:"outside",fill:r,justify:0},{position:"inside",fill:e&&e.settings.sources[0].strategy.settings.labels[0].placements[1].fill,justify:1}],label:yx}]}}}]}};return Db(!0,{},s,e||{})}(t,n);default:return}}function xx(e){this.options=e||{},this.settings={dockLayout:{layoutModes:mx()},components:[],scales:{}}}xx.prototype.addComponent=function(e,t,n){const r=vx(e,t,Db(!0,{},this.options,n||{}));return this.settings.components.push(r),r},xx.prototype.addInteraction=function(e,t){const n=vx("interaction",e,Db(!0,{},this.options,t||{}));return this.settings.interactions||(this.settings.interactions=[]),this.settings.interactions.push(n),n},xx.prototype.addScale=function(e,t,n){const r=vx(e,t,Db(!0,{},this.options,n||{}));this.settings.scales[r.name]=r.component},xx.prototype.getSettings=function(){return this.settings},xx.prototype.getComponent=function(e){return this.settings.components.filter(t=>t.key===e)[0]},xx.prototype.addPreset=function(e,t){!function(e,t,n){if("dimension-measure-chart"!==e)throw Error("There is no chart preset with that type");sx(t,n)}(e,this,t)},xx.validateComponentKeys=function(e){const t={};return e.map(e=>{const n=e.key;return n?t[n]?`Duplicate key for component ${e.type}`:(t[n]=!0,null):`Missing key for component ${e.type}`}).filter(e=>!!e)},xx.create=function(e){return new xx(e)},xx.createComponent=vx;const wx={CENTER:0,BOTTOM:1};var Mx={DISCLAIMERS:[{label:"NoDataExist",alignment:wx.CENTER,default:!0},{label:"RequireNumericDimension",alignment:wx.CENTER,default:!1},{label:"OnlyNanData",alignment:wx.CENTER,default:!0},{label:"OnlyNegativeOrZeroValues",alignment:wx.CENTER,default:!1},{label:"LimitedData",alignment:wx.BOTTOM,default:!1},{label:"OnlyNanColor",alignment:wx.BOTTOM,default:!1},{label:"NegativeOrZeroValues",alignment:wx.BOTTOM,default:!1},{label:"DataRangeIncludingZero",alignment:wx.BOTTOM,default:!1}],ALIGNMENT:wx};const kx={getNoDataExistAttribute:e=>e.qSize.qcy*e.qSize.qcx===0,getLimitedDataAttribute(e,t){let n,r=!1;var i;return e?void 0!==t.explicitLimitedData?r=!0===t.explicitLimitedData:e.qDataPages&&e.qDataPages[0]?r=!t.paging&&e.qSize.qcy>e.qDataPages[0].qMatrix.length:(i=e.qStackedDataPages)&&i[0]&&i[0].qData[0]&&i[0].qData[0].qSubNodes&&(n=t.maxNbrOfDimensions?t.maxNbrOfDimensions:2,r=e.qDimensionInfo.length>=n?e.qStackedDataPages[0].qData[0].qSubNodes.some(e=>e.qDown>0):e.qStackedDataPages[0].qData[0].qSubNodes.length<e.qStackedDataPages[0].qArea.qHeight):r=!0===t.explicitLimitedData,r},getNegativeOrZeroValuesAttribute:(e,t)=>!t.supportNegative&&e.qMeasureInfo.some(e=>e.qMin<=0),getOnlyNegativeOrZeroValuesAttribute:(e,t)=>!t.supportNegative&&e.qMeasureInfo.every(e=>e.qMax<=0&&e.qMax>=e.qMin)||0===e.qSize.qcy,getOnlyNanDataAttribute:(e,t)=>void 0!==t.explicitOnlyNanData?t.explicitOnlyNanData:e.qMeasureInfo.every(e=>e.qMax<e.qMin||"NaN"===e.qMax),getDataRangeIncludingZeroAttribute:(e,t)=>!t.supportRangeOverZero&&function(e,t){const n=t.length;let r,i,o,s,a;for(e&&(i=!(e.autoMinMax||"min"!==e.minMax&&"minMax"!==e.minMax||null===e.min||Number.isNaN(+e.min)),o=!(e.autoMinMax||"max"!==e.minMax&&"minMax"!==e.minMax||null===e.max||Number.isNaN(+e.max))),s=Number.MAX_VALUE,a=-Number.MAX_VALUE,r=0;r<n;r++)if(s=Math.min(s,t[r].qMin),a=Math.max(a,t[r].qMax),s<=0&&a>=0)return!0;return s=i?e.min:s,a=o?e.max:a,s<=0&&a>=0}(e.measureAxis,e.qHyperCube.qMeasureInfo),applyAttributes(e,t){const n=e||{},r={};return n.supportNegative=void 0===n.supportNegative||n.supportNegative,n.supportRangeOverZero=void 0===n.supportRangeOverZero||n.supportRangeOverZero,Mx.DISCLAIMERS.forEach(e=>{r[e.label]=!1}),t&&t.qHyperCube?(r.NoDataExist=this.getNoDataExistAttribute(t.qHyperCube),r.NoDataExist?r:(r.RequireNumericDimension=n.explicitRequireNumericDimension,r.RequireNumericDimension||(r.LimitedData=this.getLimitedDataAttribute(t.qHyperCube,n),r.NegativeOrZeroValues=this.getNegativeOrZeroValuesAttribute(t.qHyperCube,n),r.OnlyNegativeOrZeroValues=this.getOnlyNegativeOrZeroValuesAttribute(t.qHyperCube,n),r.OnlyNanData=this.getOnlyNanDataAttribute(t.qHyperCube,n),r.DataRangeIncludingZero=this.getDataRangeIncludingZeroAttribute(t,n)),r)):r}};function qx(e,t,n){this.disclaimersConfig=e,this.dataAttributes=t,this.supportedDisclaimers=n}function Sx(e,t){return e&&t&&t[e]}function _x(e){this.environment=e,this.clear()}qx.prototype.isValidAndSupported=function(e,t){return Sx(e.label,this.dataAttributes)&&(e.default||Sx(e.label,this.supportedDisclaimers))&&void 0!==t&&e.alignment===t},qx.prototype.isAnyValidDisclaimer=function(e){let t=!1;const n=this;return this.disclaimersConfig.forEach(r=>{n.isValidAndSupported(r,e)&&(t=!0)}),t},qx.prototype.getMessage=function(e,t){let n="";const r=this;return t&&this.disclaimersConfig.forEach(i=>{r.isValidAndSupported(i,e)&&(n+=`${t.get(`Object.Disclaimer.${i.label}`)} `)}),n},_x.ERRORS={SET:"Calling Disclaimer.set() without attributes",DISPLAY:"Calling Disclaimer.display() before attributes are applied"},_x._applyDefaultSupport=function(e,t){let n=e;return n||(n={}),t.forEach(e=>{void 0===n[e.label]&&(n[e.label]=e.default)}),n},_x.prototype.getComponentSettings=function(){const{translator:e}=this.environment,t=Db(!0,{},this.vizAttributes.supportedDisclaimers),n=new qx(Mx.DISCLAIMERS,this.dataAttributes,t);let r,i;if(n.isAnyValidDisclaimer(Mx.ALIGNMENT.CENTER))r=n.getMessage(Mx.ALIGNMENT.CENTER,e),i="center";else{if(!n.isAnyValidDisclaimer(Mx.ALIGNMENT.BOTTOM))return;r=n.getMessage(Mx.ALIGNMENT.BOTTOM,e),i="bottom"}return{key:"disclaimer",type:"disclaimer",layout:{displayOrder:1e3,dock:i},settings:{label:r,rtl:"rtl"===this.environment?.options?.direction}}},_x.prototype.set=function(e){if(this.clear(),!e)throw new Error(_x.ERRORS.SET);this.vizAttributes=e,this.dataAttributes=kx.applyAttributes(this.vizAttributes.options,this.vizAttributes.data)},_x.prototype.clear=function(){this.vizAttributes=null,this.dataAttributes=null};const Dx=Wv.extend({init(e,t,n,r,i){this.$element=t,this.environment=n,this.backendApi=r,this._selectionsApi=i,this._on=!1,this._disclaimer=new _x(n),this._dataPaths=["qHyperCube"];const o=this;this.picassoElement=t[0],this.picassoElement.className+=" picasso-chart",this.chartInstance=e.chart({element:this.picassoElement,settings:{components:[xx.createComponent("event-area",{mounted(e){o.dataAreaElem=e}})]}})},updateEnvironment(e){this.environment=e},isRtl(){return"rtl"===this.environment.options?.direction},setDataPaths(e){this._dataPaths=e},getData:(e,t,n)=>function(e,t,n){let r,i={qTop:0,qLeft:0,qWidth:t.qSize.qcx,qHeight:1e4/t.qSize.qcx};if(n){const e=n.width||t.qSize.qcx,r=Math.floor(1e4/e);i={qTop:n.top||0,qLeft:n.left||0,qWidth:e,qHeight:n.height?Math.min(n.height,r):r}}else i={qTop:0,qLeft:0,qWidth:t.qSize.qcx,qHeight:1e4/t.qSize.qcx};r="K"===t.qMode?"qStackedDataPages":"qDataPages";return e.getData([i],null,t).then(e=>{t[r]=e})}(e,t,n),hasValidData:()=>!0,paint(){if(this.hasValidData()){this._disclaimer.set(this.getDisclaimerAttributes(this.layout));const e=this._disclaimer.getComponentSettings(),t="center"===e?.layout?.dock,n=this.createChartSettings(this.layout);t?n.components=[e]:e&&n.components.push(e),xx.validateComponentKeys(n.components).forEach(e=>{console.error(e)}),this.updateChart(this.layout,n),this._painted=!0}return Promise.resolve()},resize(){if(this.layout)return this.paint()},createChartSettings(){throw new Error('Subclass must implement "createChartSettings" function')},addSnapshotChartSettings(e,t){const{freeResize:n}=this.environment.options;!n&&t.snapshotData&&(e.dockLayout.logicalSize={width:t.snapshotData.content.size.w,height:t.snapshotData.content.size.h,preserveAspectRatio:!0})},updateData(e){return this._destroyed?Promise.reject():(this.layout=Db(!0,{},e),this.layout.permissions=e.permissions,Promise.resolve())},updateChart(e,t,n){const r=this.environment.appLayout?.qLocaleInfo??{},i=this._dataPaths.map(t=>({type:"q",key:t,config:{localeInfo:r},data:zv(e,t.replace(/\//g,"."))}));this.colorService&&i.push(...this.colorService.getData()),this.chartInstance.update({data:i,settings:t,partialData:n});this.picassoElement.setAttribute("data-state",2)},destroy(){this._destroyed=!0,this.off(),this.chartInstance.destroy()},getViewState:()=>({}),isLassoDisabled:()=>!0,setSnapshotData(e){e.snapshotData||(e.snapshotData={}),e.snapshotData.content={chartData:{},size:{w:this.$element.width(),h:this.$element.height()}}},getDisclaimerAttributes:e=>({data:e})});var Cx,Ex={exports:{}};var Ax=(Cx||(Cx=1,function(e){e.exports=function(){function e(e,t,n){return(t=o(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function n(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 r(t){for(var r=1;r<arguments.length;r++){var i=null!=arguments[r]?arguments[r]:{};r%2?n(Object(i),!0).forEach(function(n){e(t,n,i[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(i)):n(Object(i)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(i,e))})}return t}function i(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"===t?String:Number)(e)}function o(e){var t=i(e,"string");return"symbol"==typeof t?t:t+""}var s=Object.prototype.hasOwnProperty,a=Object.prototype.toString,l=Object.defineProperty,c=Object.getOwnPropertyDescriptor,u=function(e){return"function"==typeof Array.isArray?Array.isArray(e):"[object Array]"===a.call(e)},h=function(e){if(!e||"[object Object]"!==a.call(e))return!1;var t,n=s.call(e,"constructor"),r=e.constructor&&e.constructor.prototype&&s.call(e.constructor.prototype,"isPrototypeOf");if(e.constructor&&!n&&!r)return!1;for(t in e);return void 0===t||s.call(e,t)},d=function(e,t){l&&"__proto__"===t.name?l(e,t.name,{enumerable:!0,configurable:!0,value:t.newValue,writable:!0}):e[t.name]=t.newValue},f=function(e,t){if("__proto__"===t){if(!s.call(e,t))return;if(c)return c(e,t).value}return e[t]},p=function e(){var t,n,r,i,o,s,a=arguments[0],l=1,c=arguments.length,p=!1;for("boolean"==typeof a&&(p=a,a=arguments[1]||{},l=2),(null==a||"object"!=typeof a&&"function"!=typeof a)&&(a={});l<c;++l)if(null!=(t=arguments[l]))for(n in t)r=f(a,n),a!==(i=f(t,n))&&(p&&i&&(h(i)||(o=u(i)))?(o?(o=!1,s=r&&u(r)?r:[]):s=r&&h(r)?r:{},d(a,{name:n,newValue:e(p,s,i)})):void 0!==i&&d(a,{name:n,newValue:i}));return a};function g(e,t,n,r){if(!e)return-1;const i=n.cache,o=e.origin?e.origin():null;o&&(e=o);let s=i.fields.indexOf(e),a=-1,l=-1;if(-1===s)for(let t=0;t<i.wrappedFields.length;t++)if(l=i.wrappedFields[t].attrDims.map(e=>e.instance).indexOf(e),a=i.wrappedFields[t].attrExps.map(e=>e.instance).indexOf(e),-1!==l||-1!==a){s=t;break}if(Array.isArray(r)&&r.some((e,t)=>e!==t)){const e=r.indexOf(s);-1!==e&&(s=e)}return s-=t.qArea.qLeft,s<0||s>=t.qArea.qWidth?-1:l>=0?e=>e[s].qAttrDims.qValues[l]:a>=0?e=>e[s].qAttrExps.qValues[a]:e=>e[s]}function m(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 y(e){let{cache:t,f:n,mainCell:r,p:i,page:o,rowIdx:s,row:a,sourceKey:l,target:c,targetProp:u,columnOrder:h}=e,d=r;if(i.field&&i.field!==n){const e=g(i.field,o,{cache:t},h);if(-1===e)return;d=p({qRow:s},e(a))}c[u]=m(i,d,{key:l})}function b(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 s=t.raw(),a=t.key(),l="object"==typeof i[e].field?i[e].field:t.field(i[e].field),{props:c,main:u}=r.normalizeConfig(i[e],t),h=Object.keys(c),d=!!i[e].trackBy,f=typeof i[e].trackBy,b={},v=[],x=[];for(let t=0;t<s.qDataPages.length;t++){const o=g(l,s.qDataPages[t],{cache:n},s.qColumnOrder);if(-1!==o)for(let g=0;g<s.qDataPages[t].qMatrix.length;g++){const w=s.qDataPages[t].qArea.qTop+g,M=p({qRow:w},o(s.qDataPages[t].qMatrix[g])),k=m(u,M,{key:a});if(!u.filter||u.filter(M)){for(let e=0;e<h.length;e++){const r=c[h[e]];let i=r.fields||[r];r.fields&&(k[h[e]]=[]);for(let o=0;o<i.length;o++)y({cache:n,f:l,mainCell:M,p:i[o],prop:h[e],page:s.qDataPages[t],rowIdx:w,row:s.qDataPages[t].qMatrix[g],sourceKey:a,target:r.fields?k[h[e]]:k,targetProp:r.fields?o:h[e],columnOrder:s.qColumnOrder});if(r.fields){const t=k[h[e]].map(e=>e.value),n=k[h[e]].map(e=>e.label);k[h[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(k[h[e]].value)}}}d&&r.track({cfg:i[e],itemData:M,obj:k,target:v,tracker:b,trackType:f}),x.push(k)}}}const w=d?r.collect(v,{main:u,propsArr:h,props:c}):x;o=[...o,...w]}return o}function v(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 x(){return this.eachAfter(v)}function w(e,t){let n=-1;for(const r of this)e.call(t,r,++n,this);return this}function M(e,t){for(var n,r,i=this,o=[i],s=-1;i=o.pop();)if(e.call(t,i,++s,this),n=i.children)for(r=n.length-1;r>=0;--r)o.push(n[r]);return this}function k(e,t){for(var n,r,i,o=this,s=[o],a=[],l=-1;o=s.pop();)if(a.push(o),n=o.children)for(r=0,i=n.length;r<i;++r)s.push(n[r]);for(;o=a.pop();)e.call(t,o,++l,this);return this}function q(e,t){let n=-1;for(const r of this)if(e.call(t,r,++n,this))return r}function S(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})}function _(e){return this.eachBefore(function(t){t.children&&t.children.sort(e)})}function D(e){for(var t=this,n=C(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}function C(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}function E(){for(var e=this,t=[e];e=e.parent;)t.push(e);return t}function A(){return Array.from(this)}function T(){var e=[];return this.eachBefore(function(t){t.children||e.push(t)}),e}function N(){var e=this,t=[];return e.each(function(n){n!==e&&t.push({source:n.parent,target:n})}),t}function*O(){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)}function R(e,t){e instanceof Map?(e=[void 0,e],void 0===t&&(t=L)):void 0===t&&(t=P);for(var n,r,i,o,s,a=new z(e),l=[a];n=l.pop();)if((i=t(n.data))&&(s=(i=Array.from(i)).length))for(n.children=i,o=s-1;o>=0;--o)l.push(r=i[o]=new z(i[o])),r.parent=n,r.depth=n.depth+1;return a.eachBefore(F)}function I(){return R(this).eachBefore(j)}function P(e){return e.children}function L(e){return Array.isArray(e)?e[1]:null}function j(e){void 0!==e.data.value&&(e.value=e.data.value),e.data=e.data.data}function F(e){var t=0;do{e.height=t}while((e=e.parent)&&e.height<++t)}function z(e){this.data=e,this.depth=this.height=0,this.parent=null}function H(e){return null==e?null:V(e)}function V(e){if("function"!=typeof e)throw new Error;return e}z.prototype=R.prototype={constructor:z,count:x,each:w,eachAfter:k,eachBefore:M,find:q,sum:S,sort:_,path:D,ancestors:E,descendants:A,leaves:T,links:N,copy:I,[Symbol.iterator]:O};var B={depth:-1},$={},W={};function U(e){return e.id}function Y(e){return e.parentId}function K(){var e,t=U,n=Y;function r(r){var i,o,s,a,l,c,u,h,d=Array.from(r),f=t,p=n,g=new Map;if(null!=e){const t=d.map((t,n)=>X(e(t,n,r))),n=t.map(G),i=new Set(t).add("");for(const e of n)i.has(e)||(i.add(e),t.push(e),n.push(G(e)),d.push(W));f=(e,n)=>t[n],p=(e,t)=>n[t]}for(s=0,i=d.length;s<i;++s)o=d[s],c=d[s]=new z(o),null!=(u=f(o,s,r))&&(u+="")&&(h=c.id=u,g.set(h,g.has(h)?$:c)),null!=(u=p(o,s,r))&&(u+="")&&(c.parent=u);for(s=0;s<i;++s)if(u=(c=d[s]).parent){if(!(l=g.get(u)))throw new Error("missing: "+u);if(l===$)throw new Error("ambiguous: "+u);l.children?l.children.push(c):l.children=[c],c.parent=l}else{if(a)throw new Error("multiple roots");a=c}if(!a)throw new Error("no root");if(null!=e){for(;a.data===W&&1===a.children.length;)a=a.children[0],--i;for(let e=d.length-1;e>=0&&(c=d[e]).data===W;--e)c.data=null}if(a.parent=B,a.eachBefore(function(e){e.depth=e.parent.depth+1,--i}).eachBefore(F),a.parent=null,i>0)throw new Error("cycle");return a}return r.id=function(e){return arguments.length?(t=H(e),r):t},r.parentId=function(e){return arguments.length?(n=H(e),r):n},r.path=function(t){return arguments.length?(e=H(t),r):e},r}function X(e){let t=(e=`${e}`).length;return J(e,t-1)&&!J(e,t-2)&&(e=e.slice(0,-1)),"/"===e[0]?e:`/${e}`}function G(e){let t=e.length;if(t<2)return"";for(;--t>1&&!J(e,t););return e.slice(0,t)}function J(e,t){if("/"===e[t]){let n=0;for(;t>0&&"\\"===e[--t];)++n;if(!(1&n))return!0}return!1}function Z(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=Z(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]=Z(r,i[e]);return t}n[e]in i&&(i=i[n[e]])}return i}function Q(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,...Q(e[i].children,t-1,n)]);return r}function ee(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=>Q(e.children,r-1,n)}return!1}function te(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))}const ne=/^qDimensionInfo(?:\/(\d+))?/,re=/^\/?qMeasureInfo\/(\d+)/,ie=/\/qAttrExprInfo\/(\d+)/,oe=/\/qAttrDimInfo\/(\d+)/;function se(e){const t=e.raw().qColumnOrder,n=e.fields();return t&&t.length===n.length?t:n.map((e,t)=>t)}function ae(e){return(e.qColumnOrder&&e.qColumnOrder.length?e.qColumnOrder:e.qDimensionInfo.map((e,t)=>t)).filter(t=>t<e.qDimensionInfo.length)}function le(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,s=-1,a=-1,l=-1,c=-1,u=-1,h=r;const d=n.qEffectiveInterColumnSortOrder,f=ae(n);return ne.test(h)&&(i=!0,o=+ne.exec(h)[1],h=r.replace(ne,"")),re.test(h)&&("K"===n.qMode?c=+re.exec(h)[1]:d&&-1!==d.indexOf(-1)?(c=+re.exec(h)[1],u=0):u=+re.exec(h)[1],h=h.replace(re,"")),h&&(oe.exec(h)?a=+oe.exec(h)[1]:ie.exec(h)&&(s=+ie.exec(h)[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:c,measureIdx:u,attrDimIdx:a,attrIdx:s}}function ce(e,t){let n,r,i=ee(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 ue(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 he(e){let{propsArr:t,props:n,item:r,itemData:i,ret:o,sourceKey:s}=e;for(let e=0;e<t.length;e++){const a=n[t[e]],l=a.fields||[a];let c,u;a.fields&&(c=[],u=[]);for(let n=0;n<l.length;n++){const h=l[n];let d,f,p,g,m,y;if("primitive"===h.type?(p=h.value,y=String(h.value)):("function"==typeof h.value&&(d=e=>h.value(e,r)),"function"==typeof h.label&&(f=e=>h.label(e,r)),h.accessor?(g=h.accessor(r),Array.isArray(g)?(m=g.map(h.valueAccessor),h.attrAccessor&&(m=m.map(h.attrAccessor)),d&&(p=m.map(d),d=null),f&&(y=m.map(f),f=null),p=h.reduce?h.reduce(p):p,y=h.reduceLabel?h.reduceLabel(y,p):String(p)):(p=h.attrAccessor?h.attrAccessor(h.valueAccessor(g)):h.valueAccessor(g),y=p)):(p=i,y=i)),a.fields){const e=d?d(p):p;c.push(e),u.push(f&&null!=y?f(y):null!=y?y:String(e))}else{const n=d?d(p):p;o[t[e]]={value:n,label:f?f(y):null!=y?y:String(n)},h.field&&(o[t[e]].source={field:h.field.key(),key:s})}}c&&(o[t[e]]={value:"function"==typeof a.value?a.value(c,r):c,label:"function"==typeof a.label?a.label(u,r):u})}}const de=(e,t,n)=>{const r="K"===e.qMode?"/qStackedDataPages/*/qData":"/qTreeDataPages/*",i="K"===e.qMode?"qSubNodes":"qNodes",o=Z(r,e);return o&&o[0]?(t.tree=R(o[0],n.children||(e=>e[i])),t.tree):null};function fe(e){const t=e.raw().qDataPages.length?e.raw().qDataPages[0].qMatrix:[],n=se(e),i=e.fields(),o=e.fields().filter(e=>"dimension"===e.type()).map(e=>n.indexOf(i.indexOf(e))),s=e.fields().filter(e=>"measure"===e.type()).map(e=>n.indexOf(i.indexOf(e))),a={__root:{__id:"__root",qValues:[]}};for(let e=0;e<t.length;e++){const n=t[e];let i="__root",c=!1;for(let e=0;e<o.length;e++){var l;const t=n[o[e]],s="".concat(i,"__").concat(null!==(l=t.qElemNumber)&&void 0!==l?l:t.qElemNo);a[s]||(a[s]=r({__id:s,__parent:i,qValues:[]},t),c=!0),i=s}if(c)for(let e=0;e<s.length;e++){const t=n[s[e]];a[i].qValues.push(t)}}const c=Object.keys(a).map(e=>a[e]);return K().id(e=>e.__id).parentId(e=>e.__parent)(c)}const pe=e=>{let{propsArr:t,props:n,cube:r,cache:i,itemDepthObject:o,f:s}=e;for(let e=0;e<t.length;e++){const i=n[t[e]],a=i.fields?i.fields:[i];for(let e=0;e<a.length;e++){const t=a[e];if(t.field!==s){const e=ce(o,le(t.field,{cube:r}));t.accessor=e.nodeFn,t.valueAccessor=e.valueFn,t.attrAccessor=e.attrFn}}}};function ge(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0,n=arguments.length>2?arguments[2]:void 0,i=arguments.length>3?arguments[3]:void 0;const o=t.raw(),s=t.key(),a="S"===o.qMode?fe(t):de(o,n,e);if(!a)return null;const l=a.height,c=[];for(let s=0;s<=l;s++){let a=null;if(s>0)if("S"===o.qMode){let e=ae(o)[s-1];a=n.fields[e]}else{let e=o.qEffectiveInterColumnSortOrder[s-1];s>o.qEffectiveInterColumnSortOrder.length&&(e=o.qDimensionInfo.length),a=n.fields[e]}const{props:l,main:u}=i.normalizeConfig(r(r({},e),{},{field:a?a.key():void 0}),t),h=Object.keys(l);c[s]={propsArr:h,props:l,main:u};const d=a?le(a,{cube:o}):{fieldDepth:0};pe({propsArr:h,props:l,cube:o,cache:n,itemDepthObject:d,f:a})}const u=a.copy().descendants(),h=a.descendants();for(let e=0;e<h.length;e++){const t=c[h[e].depth].propsArr,n=c[h[e].depth].props,r=c[h[e].depth].main,i=u[e],o=i.data,a=ue(r,o,{key:s});he({propsArr:t,props:n,item:i,itemData:o,ret:a,sourceKey:s}),h[e].data=a}return a}function me(e,t,n,r){const i=Array.isArray(e)?e:[e];let o=[];for(let s=0;s<i.length;s++)if(void 0!==i[s].field){const a=t.raw(),l=t.key();if(!de(a,n,e))continue;const c="object"==typeof i[s].field?i[s].field:t.field(i[s].field),{props:u,main:h}=r.normalizeConfig(i[s],t),d=Object.keys(u),f=le(c,{cube:a}),{nodeFn:p,attrFn:g,valueFn:m}=ce({fieldDepth:0},f);pe({propsArr:d,props:u,cube:a,cache:n,itemDepthObject:f,f:c});const y=!!i[s].trackBy,b=typeof i[s].trackBy,v={},x=[],w=p(n.tree),M=[];for(let e=0;e<w.length;e++){const t=w[e],n=g?g(m(t)):m(t);if(h.filter&&!h.filter(n))continue;const o=ue(h,n,{key:l});he({propsArr:d,props:u,item:t,itemData:n,ret:o,sourceKey:l}),y&&r.track({cfg:i[s],itemData:n,obj:o,target:x,tracker:v,trackType:b}),M.push(o)}const k=y?r.collect(x,{main:h,propsArr:d,props:u}):M;o=[...o,...k]}return o}function ye(e,t){return e(t={exports:{}},t.exports),t.exports}"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:void 0!==t||"undefined"!=typeof self&&self;var be=ye(function(e){
|
|
27
27
|
/*! javascript-number-formatter - v1.1.11 - http://mottie.github.com/javascript-number-formatter/ * © ecava */
|
|
28
|
-
!function(t,n){e.exports=n()}(0,function(){return function(e,t){if(!e||isNaN(+t))return t;var n,r,i,o,s,a,l,c,u,h,d=e.length,f=e.search(/[0-9\-\+#]/),p=f>0?e.substring(0,f):"",g=e.split("").reverse().join(""),m=g.search(/[0-9\-\+#]/),y=d-m,b=e.substring(y,y+1),v=y+("."===b||","===b?1:0),x=m>0?e.substring(v,d):"";if(n=(t="-"===(e=e.substring(f,v)).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))+"",a=e[1]&&e[1].lastIndexOf("0"),(!(c=t.split("."))[1]||c[1]&&c[1].length<=a)&&(t=(+t).toFixed(a+1)),u=e[0].split(o),e[0]=u.join(""),(s=e[0]&&e[0].indexOf("0"))>-1)for(;c[0].length<e[0].length-s;)c[0]="0"+c[0];else 0===+c[0]&&(c[0]="");if((t=t.split("."))[0]=c[0],l=u[1]&&u[u.length-1].length){for(g="",y=(h=t[0]).length%l,d=h.length,v=0;v<d;v++)g+=h.charAt(v),!((v-y+1)%l)&&v<d-l&&(g+=o);t[0]=g}return t[1]=e[1]&&t[1]?i+t[1]:"","0"!==(r=t.join(""))&&""!==r||(n=!1),p+(n?"-":"")+r+x}})});const ve=1e-15;function xe(e){return e.replace(/[-[\]/{}()*+?.\\^$|]/g,"\\$&")}const we={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"},Me=/%\)?$/,ke=/^\(r(0[2-9]|[12]\d|3[0-6])\)/i,qe=/^\(oct\)/i,Se=/^\(dec\)/i,_e=/^\(hex\)/i,De=/^\(bin\)/i,Ce=/^\(rom\)/i,Ee=/^(\(rom\)|\(bin\)|\(hex\)|\(dec\)|\(oct\)|\(r(0[2-9]|[12]\d|3[0-6])\))/i,Ae=/#|0/g;function Te(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 Ne(e,t){let n,r="",i=Number(String(e).slice(-3)),o=(e-i)/1e3,s=[0,1,4,5,9,10,40,50,90,100,400,500,900].reverse(),a=["0","I","IV","V","IX","X","XL","L","XC","C","CD","D","CM"].reverse();for(;i>0;)for(n=0;n<s.length;n++)if(s[n]<=i){r+=a[n],i-=s[n];break}for(n=0;n<o;n++)r="M".concat(r);return t[1]!==t[1].toUpperCase()&&(r=r.toLowerCase()),r}function Oe(e,t,n){let r;return ke.test(t)?e=Te(e,Number(/\d{2}/.exec(t)[0]),t,n):qe.test(t)?e=Te(e,8,t,n):Se.test(t)?e=Te(e,10,t,n):_e.test(t)?e=Te(e,16,t,n):De.test(t)?e=Te(e,2,t,n):Ce.test(t)&&(r="",e<0&&(r="-",e=-e),e=0===(e=Math.floor(e))?"0":e<=5e5?r+(e=Ne(e,t)):t+r+e.toExponential(0)),e}function Re(e,t,n){const r=xe(e);return n?r:new RegExp(r||"",t)}function Ie(e,t){return t&&(t=xe(t)),e&&(e=xe(e)),new RegExp("(?:[#0]+".concat(e,")?[#0]+(?:").concat(t,"[#0]+)?"))}function Pe(e,t){if(!e||!e.qNumericalAbbreviation)return we;const n={};return e.qNumericalAbbreviation.split(t).forEach(e=>{let t=e.split(":");2===t.length&&(n[t[0]]=t[1])}),n}function Le(e,t,n,r){let i,o,s,a,l,c,u,h,d,f=e.pattern;r&&(e.abbreviate=!0),d=Ie(t,n),s=f.match(d),s=s?s[0]:"",a=s?f.substr(0,f.indexOf(s)):f,l=s?f.substring(f.indexOf(s)+s.length):"",s||(s=f?"#":"##########"),t&&t===n&&(i=s.split(n),o=i.pop(),s=i.join("")+n+o,t=""),c=t,t=/,/.test(n)?"¤":",",c&&(s=s.replace(Re(c,"g"),t)),u=n,n=".",u&&(s=s.replace(Re(u,"g"),n)),h=s.match(/#/g),h=h?h.length:0;const p=f.split(u);let g;p[1]&&(g=p[1].match(Ae)),e.prefix=a||"",e.postfix=l||"",e.pattern=f,e.maxPrecision=g?g.length:2,e.percentage=Me.test(f),e.numericPattern=s||"",e.numericRegex=new RegExp("".concat(Re(t,null,!0),"|").concat(Re(n,null,!0)),"g"),e.groupTemp=c,e.decTemp=u,e.t=t,e.d=n,e.temp=h}class je{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=Pe(e,this.patternSeparator),this.prepare()}clone(){const e=new je(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],Ee.test(e[0])&&(r.positive.isFunctional=!0),e[1]?Ee.test(e[1])&&(r.negative.isFunctional=!0):r.negative=!1,e[2]?Ee.test(e[2])&&(r.zero.isFunctional=!0):r.zero=!1;const i="U"===this.type;r.positive.isFunctional||Le(r.positive,t,n,i),r.negative&&!r.negative.isFunctional&&Le(r.negative,t,n,i),r.zero&&!r.zero.isFunctional&&Le(r.zero,t,n,i)}formatValue(e){let t,n,r,i,o,s,a,l,c,u=this._prepared,h="",d="",f=e;if(isNaN(e))return"".concat(f);if(e=+e,!1===u.pattern)return e.toString();if(0===e&&u.zero)return u=u.zero,u.pattern;if(e<0&&u.negative?(u=u.negative,e=-e):u=u.positive,o=u.d,s=u.t,u.isFunctional)e=Oe(e,u.pattern,o);else{if(u.percentage&&(e*=100),u.abbreviate){const t=Object.keys(this.abbreviations).map(e=>parseInt(e,10)).sort((e,t)=>e-t);let r,i,o=t[0];for(a=0,n=Number(Number(e).toExponential().split("e")[1]);o<=n&&a<t.length;)a++,o=t[a];a>0&&(r=t[a-1]),r&&n>0&&r>0?i=r:(n<0&&r<0||!r)&&(o<0&&o-n<=u.maxPrecision?i=o:r<=n&&!(o>0&&-n<=u.maxPrecision)&&(i=r)),i&&(h=this.abbreviations[i],e/=10**i)}if(r=Math.abs(e),t=u.temp,l=u.numericPattern,c=l.split(o)[1],"I"===this.type&&(e=Math.round(e)),i=e,c||"#"!==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+ve*(e<0?-1:1)).toFixed(Math.min(20,c?c.length:0)).split(".")[0]);let n=l.split(o)[0];if(n+=o,e=be(n,t)||"0",c){const t=Math.max(0,Math.min(14,c.length)),n=c.replace(/#+$/,"").length;let i=("I"===this.type?0:r%1+ve).toFixed(t).slice(2).replace(/0+$/,"");for(a=i.length;a<n;a++)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)))),a=0;a<t;a++)l+="#";e=be(l,e)}e=e.replace(u.numericRegex,e=>e===s?u.groupTemp:e===o?u.decTemp:""),i<0&&!/^-/.test(e)&&(e="-".concat(e))}return u.prefix+e+d+h+u.postfix}static getStaticFormatter(){return{prepare(){},formatValue:e=>"".concat(e)}}}function Fe(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return new je(...t)}function ze(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,s,a=Object.create(null),l=Object.create(null),c=0,u=0;return o=r?function(){return s=i(...arguments),o.has(s)?o.get(s):o.set(s,e(...arguments))}:t=>(s=i(t),o.has(s)?o.get(s):o.set(s,e(t))),o.set=(e,t)=>(c>=n&&(delete a[l[u]],delete l[u],c--,u++),a[e]=t,l[c]=e,c++,t),o.get=e=>a[e],o.has=e=>e in a,o.clear=()=>{a=Object.create(null),l=Object.create(null),c=0,u=0},o.size=()=>c,o}function He(e,t,n,r,i){const o=Fe(i,e,t,n,r),s=ze(o.formatValue.bind(o),{toKey:e=>isNaN(e)?e:+e});function a(e){return s(e)}return a.format=function(e,t,n,r){return s.clear(),o.format(t,e,n,r)},a.pattern=function(e){return e&&(s.clear(),o.pattern=e,o.prepare()),o.pattern},a}const Ve={DATE:"D",TIME:"T",DATE_TIME:"TS",INTERVAL:"IV"},Be=["Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"],$e=["Mon","Tue","Wed","Thu","Fri","Sat","Sun"],We=["January","February","March","April","May","June","July","August","September","October","November","December"],Ue=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],Ye=86400;function Ke(e,t){for(let n=e.length;n<t;n++)e="0".concat(e);return e}function Xe(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"}}function Ge(e){let t=e.toString().split(".");return t[1]?(t=Number("0.".concat(t[1])),t):0}function Je(e){const t=e,n=24*Ge(t),r=60*Ge(n),i=60*Ge(r),o=1e3*Ge(i);return{d:Math.floor(t),h:Math.floor(n),m:Math.floor(r),s:Math.floor(i),f:Math.round(o)}}function Ze(e,t){let n,r=Je(e),i=r.d,o=r.h,s=r.m,a=r.s,l=r.f,c=0;/w+|t+/gi.test(t)&&(n=new Date(Date.UTC(1899,11,30+Math.floor(e),0,0,Math.round(Ye*(e-Math.floor(e))))),isNaN(n.getTime())&&(n=null)),/D+/gi.test(t)||(o+=24*i),/h+/gi.test(t)||(s+=60*o),/m+/gi.test(t)||(a+=60*s),/w+/gi.test(t)&&(c=n?n.getDay()-1:0,c<0&&(c=6));let u="";return n&&(u=n.getUTCHours()>=12?"pm":"am"),{year:0,month:0,day:c,date:i,h:o,m:s,s:a,f:l,t:u}}function Qe(e,t){return{"Y+|y+":{Y:"".concat(Number("".concat(t.year).slice(-2))),YY:Ke("".concat(t.year).slice(-2),2),YYY:Ke("".concat(t.year).slice(-3),3),def:e=>Ke("".concat(t.year),e.length)},"M+":{M:t.month+1,MM:Ke("".concat(t.month+1),2),MMM:e.locale_months_abbr[t.month],def:e.locale_months[t.month]},"W+|w+":{W:t.day,WW:Ke("".concat(t.day),2),WWW:e.locale_days_abbr[t.day],def:e.locale_days[t.day]},"D+|d+":{D:t.date,def:e=>Ke("".concat(t.date),e.length)},"h+|H+":{h:t.h,def:e=>Ke("".concat(t.h),e.length)},"m+":{m:t.m,def:e=>Ke("".concat(t.m),e.length)},"s+|S+":{s:t.s,def:e=>Ke("".concat(t.s),e.length)},"f+|F+":{def(e){let n="".concat(t.f),r=e.length-n.length;if(r>0)for(let e=0;e<r;e++)n+="0";else r<0&&(n=n.slice(0,e.length));return n}},"t{1,2}|T{1,2}":{def(e){let n=t.t;return e[0].toUpperCase()===e[0]&&(n=n.toUpperCase()),n=n.slice(0,e.length),n}}}}class et{constructor(e,t,n){const r=e||{};r.qCalendarStrings||(r.qCalendarStrings={qLongDayNames:Be,qDayNames:$e,qLongMonthNames:We,qMonthNames:Ue}),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={[Ve.TIME]:r.qTimeFmt||"hh:mm:ss",[Ve.DATE]:r.qDateFmt||"YYYY-MM-DD",[Ve.DATE_TIME]:r.qTimestampFmt||"YYYY-MM-DD hh:mm:ss"}[n]),this.pattern=t}clone(){const e=new et(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=Xe(e,n):(e<0&&(e=-e,t="-".concat(t)),r=Ze(e,t));const i=Qe(this,r),o=[];for(const e in i)Object.prototype.hasOwnProperty.call(i,e)&&o.push(e);const s=new RegExp(o.join("|"),"g"),a=t.replace(s,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});return a}}function tt(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return new et(...t)}const nt=864e5;function rt(e){return new Date(Date.UTC(1899,11,30+Math.floor(e),0,0,0,Math.round(nt*(e-Math.floor(e)))))}function it(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"TS",n=tt(arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,e,t),r=ze(n.format.bind(n),{toKey:e=>"object"==typeof e&&"function"==typeof e.getTime?e.getTime():e});function i(e){return t!==Ve.INTERVAL?rt(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=tt(i,e,t),r=ze(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 ot(e,t){if(e&&e.qNumFormat&&-1!==["D","T","TS","IV"].indexOf(e.qNumFormat.qType))return it(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",s=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,s=s&&-1===["M"].indexOf(e.qNumFormat.qType)):s=!0,(s||"U"===o)&&(n="#".concat(i,"##"),o="U"),He(n,r,i,o,t)}function st(){let e,{meta:t,id:n,key:r,localeInfo:i,fieldExtractor:o,value:s,type:a,sourceField:l}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const c=s||("dimension"===a?e=>null==e?void 0:e.qElemNo:e=>null==e?void 0:e.qValue),u=e=>(null==e?void 0:e.qText)||"",h="dimension"===a?"first":"avg",d=ot(t,i),f="dimension"===a?"first":(e,t)=>d(t),p={id:()=>n,key:()=>r,raw:()=>t,title:()=>t.qFallbackTitle||t.label,type:()=>a,origin:()=>l,items:()=>(e||(e=o(p)),e),min:()=>t.qMin,max:()=>t.qMax,value:c,label:u,reduce:h,reduceLabel:f,formatter:()=>d,tags:()=>t.qTags};return p}function at(e,t,n,r,i){return(t[e]||[]).map((t,o)=>{const s="".concat(r?"".concat(r,"/"):"").concat(e,"/").concat(o),a={instance:st(p({id:"".concat(n?"".concat(n,"/"):"").concat(s),key:s,meta:t},i))};return a.attrDims=at("qAttrDimInfo",t,n,s,p({},i,{value:e=>null==e?void 0:e.qElemNo,type:"dimension"})),a.attrExps=at("qAttrExprInfo",t,n,s,p({},i,{value:e=>null==e?void 0:e.qNum,type:"measure"})),a.measures=at("qMeasureInfo",t,n,s,p({},i,{value:e=>null==e?void 0:e.qValue,type:"measure"})),a})}function lt(){let{key:e,data:t,config:n={}}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const i={fields:[],wrappedFields:[],allFields:[],virtualFields:[]},o=t;if(!o)throw new Error('Missing "data" input');if(!o.qDimensionInfo)throw new Error('The "data" input is not recognized as a hypercube');const s=lt.util,a={cache:i,cube:o,localeInfo:n.localeInfo,fieldExtractor:null,pages:null,hierarchy:()=>null,virtualFields:n.virtualFields},l={key:()=>e,raw:()=>o,field:e=>te(e,a),fields:()=>i.fields.slice(),extract:e=>a.extractor(e,l,i,s),hierarchy:e=>a.hierarchy(e,l,i,s),_cache:()=>i};"K"===o.qMode||"T"===o.qMode||!o.qMode&&o.qNodesOnDim?(a.extractor=me,a.hierarchy=ge,a.pages="K"===o.qMode?o.qStackedDataPages:o.qTreeDataPages):"S"===o.qMode?(a.extractor=b,a.pages=o.qDataPages,a.hierarchy=ge):a.extractor=()=>[],a.fieldExtractor=e=>a.extractor({field:e},l,i,s);const c="S"===o.qMode?e=>e.qElemNumber:void 0,u="S"===o.qMode?e=>e.qNum:void 0;i.wrappedFields.push(...at("qDimensionInfo",o,e,"",p({},a,{value:c,type:"dimension"}))),i.wrappedFields.push(...at("qMeasureInfo",o,e,"",p({},a,{value:u,type:"measure"}))),i.fields=i.wrappedFields.map(e=>e.instance);const h=e=>{e.forEach(e=>{i.allFields.push(e.instance),h(e.measures),h(e.attrDims),h(e.attrExps)})};return h(i.wrappedFields),(n.virtualFields||[]).forEach(t=>{const n=l.field(t.from),o=st(r({meta:n.raw(),id:"".concat(e,"/").concat(t.key),sourceField:n,fieldExtractor:e=>a.extractor({field:e},l,i,s),key:t.key,type:n.type(),localeInfo:a.localeInfo,value:n.value},t.override||{}));i.virtualFields.push(o)}),i.allFields.push(...i.virtualFields),l}const ct=[["qHyperCube","qHyperCubeDef"],["qTreeData","qTreeDataDef"],["qDimensionInfo","qDimensions"],["qMeasureInfo","qMeasures"],["qAttrDimInfo","qAttributeDimensions"],["qAttrExprInfo","qAttributeExpressions"]],ut=/\/qDimensionInfo(?:\/(\d+))?/,ht=/\/qMeasureInfo\/(\d+)/,dt=/\/qAttrDimInfo\/(\d+)(?:\/(\d+))?/,ft=/\/qAttrExprInfo\/(\d+)/,pt=/\/?qHyperCube/,gt=/\/?qTreeData/,mt=e=>"".concat(e.substr(0,e.indexOf("/qHyperCubeDef")+14)),yt=e=>"".concat(e.substr(0,e.indexOf("/qTreeDataDef")+13));function bt(e,t){let n=e,r=-1,i=-1,o="",s=e=>e;pt.test(e)?(o="".concat(n.substr(0,n.indexOf("qHyperCube")+10)),s=mt):gt.test(e)&&(o="".concat(n.substr(0,n.indexOf("qTreeData")+9)),s=yt);let a=!0;if(ut.test(e)&&(r=+ut.exec(e)[1]),ht.test(e)&&(i=+ht.exec(e)[1]),dt.test(e)){i=-1,r=0;const e=+dt.exec(n)[2];isNaN(e)||(r=e,n=n.replace(/\/\d+$/,"")),a=!1}if(ft.test(e)){const e=i;if(t){i=0;const s=Z(o,t);i+=(s.qMeasureInfo||[]).length,r>-1?(i=s.qDimensionInfo.slice(0,r).reduce((e,t)=>e+t.qAttrExprInfo.length,i),r=-1):(i=s.qDimensionInfo.reduce((e,t)=>e+t.qAttrExprInfo.length,i),i=s.qMeasureInfo.slice(0,e).reduce((e,t)=>e+t.qAttrExprInfo.length,i)),i+=+ft.exec(n)[1]}else r>-1?(r=-1,i=+ft.exec(n)[1]):i+=+ft.exec(n)[1]+1}return ct.forEach(e=>{let[t,r]=e;n=n.replace(t,r)}),a&&(n=s(n)),n&&"/"!==n[0]&&(n="/".concat(n)),{measureIdx:i,dimensionIdx:r,path:n}}function vt(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=[],s={},a=e.isActive();let l=!1;return e.brushes().forEach(e=>{const t=bt(e.id,n);if("range"===e.type&&t.measureIdx>-1&&t.dimensionIdx>-1){const n=e.brush.ranges();n.length&&(l=!0,s.multiRangeSelectTreeDataValues||(s.multiRangeSelectTreeDataValues={path:t.path,ranges:[]}),n.forEach(e=>s.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,s.rangeSelectHyperCubeValues||(s.rangeSelectHyperCubeValues={path:t.path,ranges:[]}),n.forEach(e=>s.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,s.selectHyperCubeContinuousRange||(s.selectHyperCubeContinuousRange={path:t.path,ranges:[]}),n.forEach(e=>s.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,a=r.qEffectiveInterColumnSortOrder.indexOf(t.dimensionIdx);if(s.selectPivotCells||(s.selectPivotCells={path:t.path,cells:[]}),e.id===i||!i){const n=e.brush.values().map(e=>+e).filter(e=>!isNaN(e));(0===o||a>=o)&&o>-1?n.forEach(e=>{s.selectPivotCells.cells.push({qType:"T",qCol:e,qRow:a-o})}):n.forEach(e=>{s.selectPivotCells.cells.push({qType:"L",qCol:t.dimensionIdx,qRow:e})}),l=!!s.selectPivotCells.cells.length}}else s.selectHyperCubeCells||(s.selectHyperCubeCells={path:t.path,cols:[]}),s.selectHyperCubeCells.cols.push(t.dimensionIdx),e.id!==i&&(i||s.selectHyperCubeCells.values)||(s.selectHyperCubeCells.values=e.brush.values().map(e=>+e).filter(e=>!isNaN(e)),l=!!s.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&&a?[{method:"resetMadeSelections",params:[]}]:(s.rangeSelectHyperCubeValues&&o.push({method:"rangeSelectHyperCubeValues",params:[s.rangeSelectHyperCubeValues.path,s.rangeSelectHyperCubeValues.ranges,[],null===(c=t.orMode)||void 0===c||c]}),s.selectHyperCubeContinuousRange&&o.push({method:"selectHyperCubeContinuousRange",params:[s.selectHyperCubeContinuousRange.path,s.selectHyperCubeContinuousRange.ranges]}),s.selectHyperCubeCells&&o.push({method:"selectHyperCubeCells",params:[s.selectHyperCubeCells.path,s.selectHyperCubeCells.values,s.selectHyperCubeCells.cols]}),s.selectPivotCells&&o.push({method:"selectPivotCells",params:[s.selectPivotCells.path,s.selectPivotCells.cells]}),s.multiRangeSelectTreeDataValues&&o.push({method:"multiRangeSelectTreeDataValues",params:[s.multiRangeSelectTreeDataValues.path,s.multiRangeSelectTreeDataValues.ranges]}),o);var c}function xt(e){lt.util=e.data("matrix").util,e.data("q",lt),e.formatter("q-number",He),e.formatter("q-time",it)}return xt.qBrushHelper=vt,xt.selections=vt,xt}()}(Dx)),Dx.exports),Ex=n(Cx);const Ax={brushInterceptors:{DIM_VALUE_NULL:-2,DIM_VALUE_TOTAL:-3,brushOnlyOne:function(e,t){const n=e.brushes().filter(e=>"value"===e.type);let r=[];n.length&&n.forEach(e=>{r=r.concat(e.brush.values().map(t=>({key:e.id,value:t})))});return r.concat(t)},filterValues:function(e,t){const n=this;let r,i;const o=[];let s=0;const a=[];return t.forEach(t=>{t.value!==n.DIM_VALUE_NULL&&t.value!==n.DIM_VALUE_TOTAL&&(i=function(e,t){const n=t.key.indexOf("qHyperCube")+10,r=t.key.substr(0,n),i=t.key.substr(n+1);return e.dataset(r).field(i)}(e,t),r=i&&i.raw(),r.qLocked?(o.push(r),s++):a.push({key:t.key,value:t.value}))}),{items:a,itemsAreLocked:s>0&&s===t.length,lockedFields:o}}}};const Tx={data:["elemNo"],contexts:["select"],startOnEmptySelection:!0,style:{active:{strokeWidth:2,stroke:"#333"},inactive:{opacity:.3}}};function Nx(e){if(!e||!e.chartInstance||!e.selectionsApi)throw Error("Selections-handler: Missing input");const t=e.chartInstance,n=e.selectionsApi,r=e.dataPaths||[""],i=e.selectPaths,o=e.lasso;let s=[];const a={propertiesToRestore:{}};let l=!1;const c=function(e,t,n){function r(){}return r.update=function(e,r,i){t.isActive()||t.begin(n),Ex.qBrushHelper(i).forEach(e=>{t.select(e)})},r.toggleValues=function(r,i,o){const s=Ax.brushInterceptors.filterValues(e,r),a=s.items;return t.isActive()||s.itemsAreLocked||!(o||a.length>0)||(t.begin(n),i.start(),i.emit("update",[],[])),a},r}(t,n,i),u={};let h=!1;function d(e){16===e.keyCode&&e.shiftKey!==h&&(h=e.shiftKey,o.toggle())}function f(e){const t=e.keyCode;27===t?n.cancel():13===t&&n.confirm()}function p(){s.forEach(e=>{e.listeners.update=function(t,n){e.sleep||c.update(t,n,e.brush)},e.brush.on("update",e.listeners.update),e.brush.on("start",e.listeners.start)})}function g(){s.forEach(e=>{e.brush.removeListener("update",e.listeners.update),e.brush.removeListener("start",e.listeners.start)})}return n.on("cleared",()=>{s.forEach(e=>{e.brush.clear(),e.dependentComponents.forEach(e=>{const n=t.component(e.id);n&&n.emit(e.clear)})})}),u.setUp=function(e){u.tearDown();const t=this.setUpBrush(e);return l&&p(),t},u.setUpBrush=function(e){const n=Sb(!0,{},Tx,e),i={on:"tap",action:t=>t.ctrlKey||e.isSingleSelect?"set":"toggle",contexts:n.contexts,data:n.data,globalPropagation:"stop"},o={context:n.contexts[0],data:n.data,style:n.style},a=function(e,t){return{brush:t.brush(e.contexts[0]),listeners:{},dependentComponents:[],id:e.contexts[0]}}(n,t);return a.listeners.toggle=function(e){if(!l)return[];const i=function(){const e=[];let n=r.map(e=>t.dataset(e).fields().filter(e=>"dimension"===e.type()));n=[].concat.apply([],n);for(let t=0;t<n.length;t++)n[t].raw().qLocked&&e.push(n[t].raw());return{fields:e,areAllFieldsLocked:e.length&&e.length===n.length}}();return n.startOnEmptySelection&&0===e.length&&i.areAllFieldsLocked?[]:c.toggleValues(e,a.brush,n.startOnEmptySelection)},a.brush.intercept("toggle-values",a.listeners.toggle),a.brush.intercept("add-values",a.listeners.toggle),a.brush.intercept("remove-values",a.listeners.toggle),a.brush.intercept("set-values",a.listeners.toggle),a.listeners.start=function(){s.length>1&&s.forEach(e=>{e!==a&&e.brush.end()})},s.push(a),{trigger:i,consume:o}},u.setUpStart=function(){u.tearDown()},u.setUpDone=function(){l&&p()},u.tearDown=function(){l&&g(),s.forEach(e=>{e.brush.removeInterceptor("toggle-values",e.listeners.toggle),e.brush.removeInterceptor("add-values",e.listeners.toggle),e.brush.removeInterceptor("remove-values",e.listeners.toggle),e.brush.removeInterceptor("set-values",e.listeners.toggle)}),s=[]},u.pauseEngineCalls=function(e){s.forEach(t=>{t.id===e&&(t.sleep=!0)})},u.resumeEngineCalls=function(e,t){s.forEach(n=>{n.id===e&&(n.sleep=!1,t&&n.listeners.update([],[]))})},u.addComponent=function(e,t){s.forEach(n=>{n.id===e&&n.dependentComponents.push(t)})},u.on=function(){if(l)return;l=!0,p(),document.addEventListener("keydown",d),document.addEventListener("keyup",d);const e=()=>{s.forEach(e=>{e.brush.end()}),document.removeEventListener("keyup",f),o.active()&&o.toggle()};n.on("deactivated",e),a.unbindDeactivated=()=>{n.removeListener("deactivated",e)};const t=()=>{document.addEventListener("keyup",f)};n.on("activated",t),a.unbindActivated=()=>{n.removeListener("activated",t)}},u.isOn=()=>l,u.off=function(){l&&(l=!1,g(),document.removeEventListener("keydown",d),document.removeEventListener("keyup",d),document.removeEventListener("keyup",f),a.unbindActivated(),a.unbindDeactivated())},u.lassoState=function(){return o.active()&&!(e.isLassoDisabled&&e.isLassoDisabled())},u.allFieldsLocked=function(){return function(){let e=r.map(e=>t.dataset(e).fields().filter(e=>"dimension"===e.type()));return e=[].concat.apply([],e),e.length&&e.every(e=>e.raw().qLocked)}()},u}class Ox{isOn(){return!1}on(){console.warn("Can not turn on selections on this object")}off(){}}var Rx={create:e=>e.selectionsApi?Nx(e):new Ox};function Ix(e,t,n,r,i){let o=!1;r=r||"tooltip",n=n||["self"];const s=e.brush(r),a={};function l(){if(o){e.component(i).emit("hide")}o=!1}return a.isOpen=function(){return o},a.closeTooltip=l,a.update=function(){const a=s.brushes(),c=e.getAffectedShapes(r,"and",n,t);a.length>=1?(o=!0,function(t){o=!0;const n={nodes:t};e.component(i).emit("show",{},n)}(c)):l()},a.toggleInterceptor=function(e){if(n.length>1){const t={},n=[];return e.forEach(e=>{t[e.key]||(t[e.key]={}),t[e.key][e.value]||(t[e.key][e.value]=!0,n.push(e))}),n}return e},a}var Px={create:(...e)=>Ix(...e)},Lx={formatMeasureValue:function(e,t){if(e.raw().isCustomFormatted)return e.formatter()(t.value.qText);const n=void 0!==t.value.qNum?t.value.qNum:t.value.qValue;return e.formatter()(n)}};const jx=e=>({h:t,data:n,style:r})=>{const i=function(e,t){const n=e.chartInstance.dataset(e.dataPath),r=[],i=t.length-5,o=Math.min(5,t.length);for(let i=0;i<o;i++){const o=t[i],s={rows:[]};if(e.labelData){const t=[],i=e.labelData;let a=!1;for(let e=0;e<i.length;e++){const n=o.data[i[e]].value;if(-2===n.qElemNo||-2===n.qElemNumber){a=!0;break}t.push(o.data[i[e]].value.qText)}if(a)return;s.header=e.headerResolver(t),s.rows=e.measureRows.map(t=>{const r=o.data;return e.rowResolver(n.field(r[t].source.field),r[t],r)}).filter(e=>!!e);const l=Fx(e,o);l&&s.rows.unshift(l),r.push(s)}}i>0&&(r.numberInExcess=i);return r.rowCount=r[0]?r.length*r[0].rows.length:0,r}(e,n),o={h:t,style:r,rtl:"rtl"===e.direction,translator:e.translator};return e.renderer(o,i)};function Fx(e,t){const n=t.data.color,r=e.colorService?.getSettings?.();if(!r||"color"===r.type||!n||!r.fieldType)return;const i=[];e.data.forEach(e=>{const n=t.data[e];n&&i.push(n.value)});const o=function(e){let t=-1;for(let n=0;n<e.length;n++)-3===e[n]&&(t=n);return t}(i),{translator:s}=e,a=r.label,l=t.attrs?.fill;return{color:l,label:a,value:-1!==o?s.get("properties.dimensionLimits.others"):n.label}}const zx="dist-flow-tooltip",Hx=`#${zx}`;function Vx(){if(!document.querySelector(Hx)){const e=document.createElement("div");e.id=zx,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 Bx({key:e="tooltip",rtl:t,fontFamily:n,filter:r,content:i}){return{show:!0,key:e,type:"tooltip",layout:{displayOrder:3},beforeMount(){Vx()},beforeUpdate(){Vx()},destroyed(){!function(){const e=document.querySelector(Hx);e&&e.parentElement&&e.childElementCount<1&&e.parentElement.removeChild(e)}()},settings:{appendTo:()=>document.querySelector(Hx),content:i,filter:r,extract:e=>e.node,direction:t?"rtl":"ltr",placement:"bounds"},style:{arrow:{color:"#404040"},content:{display:"table","border-spacing":"4px",background:"rgba(64, 64, 64, 0.9)",opacity:"1",fontSize:"13px",fontFamily:n,"empty-cells":"show"},cell:{"max-width":"180px","word-break":"break-word","word-wrap":"break-word","overflow-wrap":"break-word",hyphens:"auto"}}}}const{detectTextDirection:$x}=tx;const Wx={tooltipKey:"tooltip",data:[""],contexts:["tooltip"],headerResolver:e=>e.join(", "),rowResolver:(e,t)=>({value:Lx.formatMeasureValue(e,t),label:e.title()}),direction:"ltr",renderer:function(e,t){const{h:n,style:r,translator:i,rtl:o}=e,s=[],a=o?"right":"left";if(t.forEach(e=>{if(e.header){const t={...r.cell,textAlign:a,fontWeight:"bold",direction:$x(e.header)};s.push(n("tr",null,n("td",{style:t,colSpan:2},e.header)))}e.rows.forEach(e=>{let t=e.value;if(e.color){const r={display:"inline-block",width:10,height:10,"background-color":e.color,margin:"0 8px"},i=n("div",{style:r});t=o?[e.value,i]:[i,e.value]}const i=o?[":",e.label]:[e.label,":"],l={...r.cell,textAlign:a,direction:$x(e.label)},c={...r.cell,textAlign:o?"left":"right",direction:$x(e.value)};s.push(n("tr",null,n("td",{style:l},i),n("td",{style:c},t)))})}),t.numberInExcess){const e=i.get("Object.ChartTooltip.NMore",t.numberInExcess),o={...r.cell,textAlign:a,direction:$x(e)};s.push(n("tr",null,n("td",{style:o,colSpan:2},e)))}return s}};function Ux(e,t,n){if(!e)throw Error("Tooltips-handler: Missing input");let r={},i=!1;const o={};function s(e){e.listeners.update=function(t,n){e.action.update(t,n,e)},e.listeners.end=function(){e.action.closeTooltip()},e.brush.on(e.treatAsDesktop?"update":"set-values",e.listeners.update),e.brush.on("end",e.listeners.end),e.brush.intercept("set-values",e.action.toggleInterceptor)}function a(){Object.keys(r).forEach(e=>{l(r[e])})}function l(e){e.brush.removeListener(e.treatAsDesktop?"update":"set-values",e.listeners.update),e.brush.removeListener("end",e.listeners.end),e.brush.removeInterceptor("set-values",e.action.toggleInterceptor)}function c(){Object.keys(r).forEach(e=>{r[e].action.closeTooltip()})}function u(){c();for(const e in r)r[e].brush.clear()}return o.setUp=function(t){const o=Sb(!0,{},Wx,t);if(!o.componentKey)throw Error("Tooltips-handler.setUp: Missing required input");r[o.contexts[0]]&&i&&l(r[o.contexts[0]]);const a=function(e,t){return{brush:t.brush(e.contexts[0]),action:Px.create(t,e.componentKey,e.data,e.contexts[0],e.tooltipKey),listeners:{},chartInstance:t,dataPath:e.dataPath,renderer:e.renderer,data:e.data,headerResolver:e.headerResolver,rowResolver:e.rowResolver,colorService:e.colorService,attrDimPath:e.attrDimPath,measureRows:e.measureRows,labelData:e.labelData,filterShapes:e.filterShapes,direction:e.environment.options.direction,theme:e.environment.theme,translator:e.environment.translator,treatAsDesktop:"touch"!==e.environment.deviceType}}(o,e);r[o.contexts[0]]=a,i&&s(a);const c=Bx({key:o.tooltipKey,rtl:"rtl"===a.direction,fontFamily:a.theme.getStyle(n,"tooltip","fontFamily"),filter:(u=a.filterShapes,e=>u?u(e):function(e){const t=[];return e.forEach(e=>{-1===t.indexOf(e)&&"container"!==e.type&&t.push(e)}),t}(e)),content:jx(a,o.dataPath)});var u;return o.chartBuilder.getSettings().components.push(c),{trigger:{on:a.treatAsDesktop?"over":"tap",action:"set",contexts:o.contexts,data:o.data,globalPropagation:"stop"},consume:o.contexts.map(e=>({context:e})),component:c}},o.tearDown=function(){i&&a(),r=[]},o.closeTooltip=c,o.isOn=()=>i,o.on=function(){i||(i=!0,Object.keys(r).forEach(e=>{s(r[e])}),t&&t.on("mouseleave",u))},o.off=function(){i&&(i=!1,a(),t&&t.off("mouseleave",u),c())},o}var Yx={create:(e,t,n)=>Ux(e,t,n)};const Kx={generateHash:function(e){return function(e){let t=0;if(!e||!e.length)return t;for(let n=0;n<e.length;n++)t=(t<<5)-t+e.charCodeAt(n),t&=t;return t}(JSON.stringify(e))},updateHash:function(e,t){e.qUndoExclude||(e.qUndoExclude={});e.qUndoExclude.hashCode=Kx.generateHash(t)}};const Xx={getDefaultHashDataForHyperCube:function(e,t,n){return function(e,t){const n=[];if(!e.qMeasures)return Promise.resolve(n);return e.qMeasures.forEach(e=>{e.qLibraryId?n.push(function(e,t){return t.getMeasure(e).then(e=>e.getProperties().then(e=>e.qMeasure.qDef))}(e.qLibraryId,t)):n.push(Promise.resolve())}),Promise.all(n)}(e,n).then(e=>({drillLevel:Jx(t),dimensionExpressions:Gx(t),measureExpressions:e}))}};function Gx(e){return e.qDimensionInfo.map(e=>e.qGroupFieldDefs)}function Jx(e){const t=function(e){return jv(e,"qDimensionInfo",[])}(e);return t.map(e=>e.qGroupPos)}const Zx={},Qx=Sb.bind(null,!0);function ew(e){return null!=e&&!Array.isArray(e)&&"object"==typeof e}const tw=Array.isArray,nw=function(e){return void 0===e};function rw(e,t){return function(e){return"function"==typeof e}(e[t])||"$$"===t.substring(0,2)||"_"===t.substring(0,1)}function iw(e,t){const n=t.substring(1).split("/").slice(0,-1);let r;return n.forEach((t,i)=>{i!==n.length&&(r=+t,e[r||t]=nw(e[r||t])?Number.isNaN(+r)?{}:[]:e[t],e=e[r||t])}),e}function ow(e,t){if(ew(e)&&ew(t)){if(Object.keys(e).length!==Object.keys(t).length)return!1;for(const n of Object.keys(e))if(!ow(e[n],t[n]))return!1;return!0}if(tw(e)&&tw(t)){if(e.length!==t.length)return!1;for(let n=0,r=e.length;n<r;n++)if(!ow(e[n],t[n]))return!1;return!0}return e===t}Zx.generate=function(e,t,n){n=n||"";let r=[];return Object.keys(t).forEach(i=>{const o=function(e){return e&&(e=Qx({},{val:e}).val),e}(t[i]),s=e[i],a=`${n}/${i}`;ow(o,s)||rw(t,i)||(nw(s)?r.push({op:"add",path:a,value:o}):ew(o)&&ew(s)?r=r.concat(Zx.generate(s,o,a)):tw(o)&&tw(s)?r=r.concat(function(e,t,n){let r=[];const i=e.slice();let o,s,a=-1;function l(e,t,n){if(e[n]&&nw(e[n].qInfo))return null;if(e[n]&&e[n].qInfo.qId===t)return n;for(let n=0,r=e.length;n<r;n++)if(e[n]&&e[n].qInfo.qId===t)return n;return-1}if(ow(t,i))return r;if(null===t[0]||!nw(t[0])&&nw(t[0].qInfo))return r.push({op:"replace",path:n,value:t}),r;for(o=i.length-1;o>=0;--o)a=l(t,i[o]&&i[o].qInfo&&i[o].qInfo.qId,o),-1===a?(r.push({op:"remove",path:`${n}/${o}`}),i.splice(o,1)):r=r.concat(Zx.generate(i[o],t[a],`${n}/${o}`));for(o=0,s=t.length;o<s;++o)a=l(i,t[o]&&t[o].qInfo&&t[o].qInfo.qId),-1===a?(r.push({op:"add",path:`${n}/${o}`,value:t[o]}),i.splice(o,0,t[o])):a!==o&&(r.push({op:"move",path:`${n}/${o}`,from:`${n}/${a}`}),i.splice(o,0,i.splice(a,1)[0]));return r}(s,o,a)):r.push({op:"replace",path:`${n}/${i}`,value:o}))}),Object.keys(e).forEach(i=>{nw(t[i])&&!rw(e,i)&&r.push({op:"remove",path:`${n}/${i}`})}),r},Zx.apply=function(e,t){t.forEach(t=>{const n=iw(e,t.path);let r=t.path.split("/").splice(-1)[0];const i=r&&Number.isNaN(+r)?n[r]:n[+r]||n,o=t.from?t.from.split("/").splice(-1)[0]:null;if("add"===t.op||"replace"===t.op)if(tw(n))"-"===r&&(r=n.length),n.splice(+r,"add"===t.op?0:1,t.value);else if(tw(i)&&tw(t.value)){const e=t.value.slice();i.length=0,i.push.apply(i,e)}else ew(i)&&ew(t.value)?(s=i,Object.keys(s).forEach(e=>{Object.getOwnPropertyDescriptor(s,e).configurable&&!rw(s,e)&&delete s[e]}),Qx(i,t.value)):n[r]=t.value;else if("move"===t.op){const i=iw(e,t.from);tw(n)?n.splice(+r,0,i.splice(+o,1)[0]):(n[r]=i[o],delete i[o])}else"remove"===t.op&&(tw(n)?n.splice(+r,1):delete n[r]);var s})},Zx.clone=function(e){return Qx({},e)},Zx.createPatch=function(e,t,n){const r={op:e.toLowerCase(),path:n};return"move"===r.op?r.from=t:void 0!==t&&(r.value=t),r},Zx.updateObject=function(e,t){Object.keys(e).length?Zx.apply(e,Zx.generate(e,t)):Qx(e,t)};class sw{constructor(e){this._model=e}setModel(e){this._model=e}saveSoftProperties(e,t){if(!this._model)return Promise.resolve(!1);let n=Zx.generate(e,t);return Sb(!0,e,t),n&&n.length?(n=n.map(e=>({qOp:e.op,qValue:JSON.stringify(e.value),qPath:e.path})),this._model.applyPatches(n,!0).then(()=>!0)):Promise.resolve(!1)}async mergeSoftPatches(){if(!this._model)return;const e=this._model.getProperties(),t=this._model.getEffectiveProperties(),n=await e,r=await t;if(n.qExtendsId)return;const i=Zx.generate(n,r);Zx.apply(n,i);const o=this;o._model.setProperties(n).then(()=>{o._model.clearSoftPatches()})}}var aw={canModifyHardProperties:function(e){if(e.qHasSoftPatches||e.qExtendsId)return!1;if(e.permissions)return e.permissions.update;return-1!==e.qMeta.privileges.indexOf("update")}};var lw={saveDerivedProperties:function(e,t,n,r){if(aw.canModifyHardProperties(t))return e.setProperties(n);return new sw(e).saveSoftProperties(r,n)}};var cw={validate:function(e){if(!(e&&e.layout&&e.properties&&e.model&&e.hashData&&e.generateDerivedProperties))throw Error("Derived-properties: Missing input")}};function uw(){this._generationInProgress=!1}function hw(e){cw.validate(e);const t=e.properties,n=Kx.generateHash(e.hashData);return!(!t.qUndoExclude||t.qUndoExclude.hashCode!==n)}uw.prototype.isDerivedUpToDate=hw,uw.prototype.updateDerivedProperties=function(e){if(cw.validate(e),this._generationInProgress)return Promise.resolve(!0);if(hw(e)){const t=e.layout.qUndoExclude&&e.layout.qUndoExclude.hashCode===e.properties.qUndoExclude.hashCode;return Promise.resolve(!t)}const t=this,n=e.model,r=e.layout,i=Sb(!0,{},e.properties),o=Sb(!0,{},i);return this._generationInProgress=!0,Kx.updateHash(i,e.hashData),e.generateDerivedProperties(r,i).then(()=>lw.saveDerivedProperties(n,r,i,o).then(()=>(t._generationInProgress=!1,Promise.resolve(!0))))},uw.prototype.addDefaultHyperCubeHash=function(e,t,n,r){return Xx.getDefaultHashDataForHyperCube(e,t,n).then(e=>Sb(!0,r,e))};const dw={wrapExpression:function(e){const t=e.replace(/\]/g,"]]");return t?`[${t}]`:""}};const fw={replaceExpressionTokens:function(e,t,n){const r={start:n&&n.start||"{{",end:n&&n.end||"}}"};let i,o,s=e;for(const e in t)i=t[e],o=r.start+e+r.end,s=s.replace(pw(o,!0),i);return s},createRegExp:pw};function pw(e,t,n){const r=e.replace(/[-[\]/{}()*+?.\\^$|]/g,"\\$&");const i=n?`(${r})`:r;return t?new RegExp(i,"g"):new RegExp(i)}const gw={generateExpression:function(e,t){const n={};if(t)for(const e in t){const r=t[e],i=r.wrap?dw.wrapExpression(r.value):r.value;n[e]=i;(r.variations||[]).forEach(t=>{const r=mw(t,i,e);n[t]=r})}return fw.replaceExpressionTokens(e,n)}};function mw(e,t,n){if(""===t)return"";const r=fw.createRegExp(n,!0,!0),i=e.split(r);let o="";return i.forEach(e=>{o+=e!==n?e:t}),o}const yw={generateHyperCubeDef:function(e,t,n,r,i){return function(e,t,n,r){const i={};let o,s;const a=[];let l;e.forEach(e=>{o=Mw(e.match(ww("Dim"))),o.forEach(e=>{a.push(bw(t.qDimensions[e],r,e,n).then(t=>{i[`Dim[${e}]`]={value:t,wrap:!0}}))}),s=Mw(e.match(ww("Mea"))),s.forEach(e=>{a.push(vw(t.qMeasures[e],r).then(t=>{i[`Mea[${e}]`]={value:t}}))})}),l=a.length?Promise.all(a).then(()=>Promise.resolve(i)):Promise.resolve(i);return l}(e.dimensions.concat(e.measures),t,n,r).then(n=>{const r=Sb({},n,i),o=Sb(!0,{},t);return o.qDimensions=[],o.qMeasures=[],e.dimensions.forEach(e=>{o.qDimensions.push({qDef:{qFieldDefs:[`=${gw.generateExpression(e,r)}`]}})}),e.measures.forEach(e=>{o.qMeasures.push({qDef:{qDef:gw.generateExpression(e,r)}})}),o})},getAllHyperCubeExpressions:async function(e,t,n){const r=e.qDimensions.map((e,r)=>bw(e,n,r,t)),i=e.qMeasures.map(e=>vw(e,n));return{dimensions:await Promise.all(r),measures:await Promise.all(i)}}};function bw(e,t,n,r){if(e.qLibraryId)return xw(e.qLibraryId,"dimension",t,n,r);const i=r.qDimensionInfo[n].qGroupPos;return Promise.resolve(e.qDef.qFieldDefs[i])}function vw(e,t){return e.qLibraryId?xw(e.qLibraryId,"measure",t):Promise.resolve(e.qDef.qDef)}function xw(e,t,n,r,i){if(!n)return console.warn("No app provided, returning library id"),e;return n["dimension"===t?"getDimension":"getMeasure"](e).then(e=>e.getProperties().then(e=>"dimension"===t?e.qDim.qFieldDefs[i.qDimensionInfo[r].qGroupPos]:e.qMeasure.qDef))}function ww(e){return new RegExp(`\\{\\{${e}\\[\\d\\]\\}\\}`,"g")}function Mw(e){return e?e.map(e=>e.substr(6,1)):[]}function kw(e){return!Number.isNaN(parseFloat(e))&&Number.isFinite(+e)}function qw(e){return!Number.isNaN(parseInt(e,10))&&parseFloat(e,10)===parseInt(e,10)}const Sw={getBinSize:function(e){return eb(e,"bins.binSize",_m.BIN_SIZE)},getDerivedBinSize:function(e){return eb(e,"qUndoExclude.bins.binSize",_m.BIN_SIZE)},getDerivedBinOffset:function(e){return eb(e,"qUndoExclude.bins.offset",_m.OFFSET)},getDerivedBinCount:function(e){const t=eb(e,"qUndoExclude.bins.binCount",_m.BIN_COUNT);return kw(t)?t<1?1:qw(t)?t:Math.ceil(t):_m.BIN_COUNT},getBinCount:function(e){return eb(e,"bins.binCount",void 0)},getBinOffset:function(e){return eb(e,"bins.offset",_m.OFFSET)},isAutoBin:function(e){return eb(e,"bins.auto",_m.AUTO)},isCountDistinct:function(e){return eb(e,"bins.countDistinct",_m.COUNT_DISTINCT)},getBinMode:function(e){return eb(e,"bins.binMode",_m.BIN_MODE)},isEmpty:function(e){return null==e||""===e}},_w=Math.log(10),Dw=[1,1.5,2,3,4,5,6,10],Cw=[1,2,4,5,6,8,10],Ew=[2,4,5,10];function Aw(e,t){if(0===e)return 0;let n;const r=Math.floor(Math.log(Math.abs(e))/_w),i=e/10**r;for(let e=0;e<t.length;e++)if(i<=t[e]){n=t[e];break}return(r>=0?n*10**r:n/10**-r)*(e<0?-1:1)}function Tw(e,t,n,r,i,o){return Math.floor(Math.abs(e-i)/r)+Math.floor(Math.abs(o-t)/r)}const Nw={calculateBinSize:function(e,t,n){return function(e,t,n){if(!kw(e)||!kw(t)||!kw(n))throw Error("binSizeCalculator: One of the inputs is NOT numeric");if(e>t)throw Error("binSizeCalculator: The 'min' parameter is bigger than the 'max' parameter")}(e,t,n),function(e,t,n){let r,i,o,s,a,l,c,u,h,d,f,p,g=-1,m=Dw;if(n=Math.max(1,n),t===e)if(0===t){if(s=1,1===n)return{min:e,max:t,nbrOfBins:n,rawBinSize:o/n,offset:-.5,newMax:.5,binSize:1,numEmptyBins:0}}else 1===n?(s=t+1e-9,m=Cw):s=Math.abs(t/n);else o=(t+=1e-9)-e,s=o/n;do{if(u=1,f=0,g>=0)for(h=1/Ew[g],d=1,m=[];d<=10;)m.push(Math.round(1e3*d)/1e3),d+=h;a=s;do{a=Aw(a*u,m),l=Math.floor(Math.log(a)/_w),c=10**l,i=t===e?(Math.ceil(t/a)+Math.floor(n/2))*a:Math.ceil(t/a)*a,r=i-n*a;let o=0;for(p=c;(r>e||i<t)&&o<Ew.length;)r=Math.floor(e/p)*p,i=r+n*a,p=c/Ew[o++];l<1&&(c=10**(Math.abs(l)+1),i=Math.round(i*c)/c,r=Math.round(r*c)/c),u=1.1,f++}while((r>e||i<t)&&f<10);g++}while(Tw(e,t,0,s,r,i)>0&&g<Ew.length);return{binCount:n,offset:r,binSize:a}}(e,t,n=function(e){return e<1?1:qw(e)?e:Math.ceil(e)}(n))}};const Ow={getMappingValues:function(e){const t=Sw.isAutoBin(e),n=Sw.getBinMode(e);let r,i,o,s;const a=Sw.isCountDistinct(e);return t||"maxCount"===n?(s=function(e){const t=eb(e,"qHyperCube.qDimensionInfo.0",{});let n=t.qMin,r=t.qMax;n=kw(n)?n:1,r=kw(r)?r:1;const i=Sw.getDerivedBinCount(e);return Nw.calculateBinSize(n,r,i)}(e),r=s.binSize,i=s.offset,o=s.binCount):(r=Sw.getBinSize(e),i=Sw.getBinOffset(e)),{binSize:r,binOffset:i,binCount:o,distinct:a}},getMappings:function(e){const t={};return t.BinSize={value:`,${e.binSize}`},t.Label={value:0===e.binOffset?"":",'x'"},t.Offset={value:0===e.binOffset?"":`,${e.binOffset}`},t.Distinct={value:e.distinct?"Distinct ":""},t}};const Rw={generateHyperCubes:async function(e,t,n){const{app:r,translator:i}=n,o=Ow.getMappingValues(e),s=Ow.getMappings(o),a=yw.getAllHyperCubeExpressions(t.qHyperCubeDef,e.qHyperCube,r),l=yw.generateHyperCubeDef({dimensions:["Class(aggr({{Dim[0]}},{{Dim[0]}}){{BinSize}}{{Label}}{{Offset}})"],measures:["Count({{Distinct}}{{Dim[0]}})"]},t.qHyperCubeDef,e.qHyperCube,r,s),c=await a,u=await l;let h;h=Sw.isAutoBin(e)?{qValueExpression:{qExpr:gw.generateExpression("=Ceil(Log10(Count({{Dim[0]}})) / Log10(2)) + 1",{"Dim[0]":{value:c.dimensions[0],wrap:!0}})}}:"maxCount"===Sw.getBinMode(e)&&Sw.isEmpty(t.bins.binCount)?Sw.getDerivedBinCount(e):t.bins.binCount,rb(u,"qDimensions.0.qDef.qSortCriterias",[{qSortByNumeric:1}]),rb(u,"qDimensions.0.qDef.qFieldLabels",[e.qHyperCube.qDimensionInfo[0].qFallbackTitle]),rb(u,"qMeasures.0.qDef.qLabel",e.measureAxis.label||i.get("Visualization.Histogram.MeasureAxisLabel")),rb(t,"qUndoExclude.box.qHyperCubeDef",u),rb(t,"qUndoExclude.bins.binSize",o.binSize),rb(t,"qUndoExclude.bins.offset",o.binOffset),rb(t,"qUndoExclude.bins.binCount",h)}};var Iw={isOnComponentForRange:function(e,t,n){return!!e&&!!n.chart.componentsFromPoint({x:e.center.x,y:e.center.y}).filter(e=>-1!==t.indexOf(e.settings.key))[0]},isOnComponentForLasso:function(e,t,n){return e&&n.chart.componentsFromPoint({x:e.center.x,y:e.center.y}).filter(e=>e.settings.key===t.keys.componentKey)[0]},isOnComponentForNavBtn:function(e,t,n){return n.chart.componentsFromPoint(e.center).some(e=>e.settings.key===t)}};var Pw={callLassoGesture:function(e,t,n){return{type:"Pan",options:{direction:ym.DIRECTION_ALL,threshold:1,enable(r,i){if(e.lassoing)return t.isSelectionEnabled();const o=Iw.isOnComponentForLasso(i,n,this);return t.isSelectionEnabled()&&i&&((s=n.handlers).selectionHandler.lassoState()&&!s.selectionHandler.allFieldsLocked()||e.lassoing)&&o;var s},event:"lasso"},recognizeWith:n.handlers.scrollHandler?"drag":null,events:{lassostart(r){Iw.isOnComponentForLasso(r,n,this)&&(t.switchTo("lasso",this.chart,r),e.lassoing=!0,n.handlers.selectionHandler.pauseEngineCalls(n.keys.lassoBrushKey),r.clientX=r.pointers[0].clientX,r.clientY=r.pointers[0].clientY,t.doEmit(this.chart,"lasso","lassoStart",r))},lassomove(n){e.lassoing&&(n.clientX=n.pointers[0].clientX,n.clientY=n.pointers[0].clientY,t.doEmit(this.chart,"lasso","lassoMove",n))},lassoend(r){e.lassoing&&(r.clientX=r.pointers[0].clientX,r.clientY=r.pointers[0].clientY,t.doEmit(this.chart,"lasso","lassoEnd",r),n.handlers.selectionHandler.resumeEngineCalls(n.keys.lassoBrushKey,!0),e.lassoing=!1)},lassocancel(r){e.lassoing=!1,t.doEmit(this.chart,"lasso","lassoCancel",r),n.handlers.selectionHandler.resumeEngineCalls(n.keys.lassoBrushKey,!1)}}}}};var Lw={callMeasureRangeGesture:function(e,t,n,r){const i=n.keys.dimRangeBrushKey?"majorrange":"arearange";return{type:"Pan",options:{direction:n.isHorizontal?ym.DIRECTION_HORIZONTAL:ym.DIRECTION_VERTICAL,event:"measurerange",enable(i,o){if(!n.rangeSelStatus.isOpenMea)return!1;if(e.measureSelecting)return t.isSelectionEnabled();const s="measurerange"===n.active.gesture?[r,n.keys.componentKey]:[r],a=Iw.isOnComponentForRange(o,s,this);return e.measureSelecting=t.isSelectionEnabled()&&!!o&&!!a,e.measureSelecting&&!!n.keys.measureRangeBrushKey}},requireFailure:`lasso ${i}`,recognizeWith:n.handlers.scrollHandler?"drag":null,events:{measurerangestart(i){const o="measurerange"===n.active.gesture?[r,n.keys.componentKey]:[r];Iw.isOnComponentForRange(i,o,this)&&(e.measureSelecting=!0,t.switchTo("measurerange",this.chart,i),t.doEmit(this.chart,"rangeMeasure","rangeStart",i),n.handlers.selectionHandler.pauseEngineCalls(n.keys.measureRangeBrushKey))},measurerangemove(n){e.measureSelecting&&t.doEmit(this.chart,"rangeMeasure","rangeMove",n)},measurerangeend(r){e.measureSelecting&&(n.handlers.selectionHandler.resumeEngineCalls(n.keys.measureRangeBrushKey,!0),t.doEmit(this.chart,"rangeMeasure","rangeEnd",r),e.measureSelecting=!1)},measurerangecancel(){n.handlers.selectionHandler.resumeEngineCalls(n.keys.measureRangeBrushKey,!1),e.measureSelecting=!1}}}}};function jw(e,t){let n;return n="x-axis"===e?"horizontal"===t?ym.DIRECTION_VERTICAL:ym.DIRECTION_HORIZONTAL:"horizontal"===t?ym.DIRECTION_HORIZONTAL:ym.DIRECTION_VERTICAL,n}var Fw={callAreaRangeGesture:function(e,t,n,r){const i=n.keys.dimRangeBrushKey?"majorrange":"measurerange";return{type:"Pan",options:{direction:jw(r,n.isHorizontal),event:"arearange",enable(i,o){if(!n.rangeSelStatus.isOpenDim)return!1;if(e.minoring)return t.isSelectionEnabled();const s="arearange"===n.active.gesture?[r,n.keys.componentKey]:[r],a=Iw.isOnComponentForRange(o,s,this);return e.minoring=t.isSelectionEnabled()&&!!o&&!!a,e.minoring}},requireFailure:`lasso ${i}`,recognizeWith:n.handlers.scrollHandler?"drag":null,events:{arearangestart(i){const o="arearange"===n.active.gesture?[r,n.keys.componentKey]:[r];Iw.isOnComponentForRange(i,o,this)&&(e.minoring=!0,t.switchTo("arearange",this.chart,i),t.doEmit(this.chart,"rangeMinor","areaStart",i),n.handlers.selectionHandler.pauseEngineCalls(n.keys.areaBrushKey))},arearangemove(r){e.minoring&&(this.chart.brush(n.keys.areaBrushKey).clear(),t.doEmit(this.chart,"rangeMinor","areaMove",r))},arearangeend(r){e.minoring&&(n.handlers.selectionHandler.resumeEngineCalls(n.keys.areaBrushKey,!0),t.doEmit(this.chart,"rangeMinor","areaEnd",r),e.minoring=!1)},arearangecancel(){n.handlers.selectionHandler.resumeEngineCalls(n.keys.areaBrushKey,!1),e.minoring=!1}}}}};var zw={callDimensionRangeGesture:function(e,t,n,r){const i=n.keys.measureRangeBrushKey?"measurerange":"arearange";return{type:"Pan",options:{direction:n.isHorizontal?ym.DIRECTION_VERTICAL:ym.DIRECTION_HORIZONTAL,event:"majorrange",enable(i,o){if(!n.rangeSelStatus.isOpenDim)return!1;if(e.majoring)return t.isSelectionEnabled();const s="majorrange"===n.active.gesture?[r,n.keys.componentKey]:[r],a=Iw.isOnComponentForRange(o,s,this);return e.majoring=t.isSelectionEnabled()&&!!o&&!!a,e.majoring&&!!n.keys.dimRangeBrushKey}},requireFailure:`lasso ${i}`,recognizeWith:n.handlers.scrollHandler?"drag":null,events:{majorrangestart(i){const o="majorrange"===n.active.gesture?[r,n.keys.componentKey]:[r];Iw.isOnComponentForRange(i,o,this)&&(e.majoring=!0,t.switchTo("majorrange",this.chart,i),t.doEmit(this.chart,"rangeDim","rangeStart",i),n.handlers.selectionHandler.pauseEngineCalls(n.keys.dimRangeBrushKey))},majorrangemove(n){e.majoring&&t.doEmit(this.chart,"rangeDim","rangeMove",n)},majorrangeend(r){e.majoring&&(n.handlers.selectionHandler.resumeEngineCalls(n.keys.dimRangeBrushKey,!0),t.doEmit(this.chart,"rangeDim","rangeEnd",r),e.majoring=!1)},majorrangecancel(){n.handlers.selectionHandler.resumeEngineCalls(n.keys.dimRangeBrushKey,!1),e.majoring=!1}}}}};var Hw={callDragGesture:function(e,t,n,r,i){let o={};return{type:"Pan",options:{direction:n.isHorizontal?ym.DIRECTION_VERTICAL:ym.DIRECTION_HORIZONTAL,event:"drag",enable(r,i){return e.dragging?t.isNavigationEnabled():(e.dragging=t.isNavigationEnabled()&&!!i&&!!this.chart.componentsFromPoint({x:i.center.x,y:i.center.y}).filter(e=>e.settings.key===n.keys.componentKey)[0],e.dragging)}},requireFailure:r?`lasso ${t.getBrushConfig()}`:"",events:{dragstart(e){o={x:e.deltaX,y:e.deltaY};let t=-(n.isHorizontal?e.deltaY:e.deltaX)/n.handlers.scrollHandler.getItemSize();!n.isHorizontal&&i&&(t=-t),n.handlers.scrollHandler.getScrollApi().move(t)},dragmove(t){if(!e.dragging)return;let r=-(n.isHorizontal?t.deltaY-o.y:t.deltaX-o.x)/n.handlers.scrollHandler.getItemSize();!n.isHorizontal&&i&&(r=-r),n.handlers.scrollHandler.getScrollApi().move(r),o={x:t.deltaX,y:t.deltaY}},dragend(){e.dragging&&(e.dragging=!1)},dragcancel(){e.dragging=!1}}}}};var Vw={callNavBtnGesture:function(e,t){return{type:"Tap",options:{event:"navBtnTap",enable(n,r){return!(!r||!e())&&Iw.isOnComponentForNavBtn(r,t,this)}},events:{navBtnTap(e){this.chart.componentsFromPoint(e.center).forEach(t=>{const n=e.target,r=n?n.getAttribute("data-action"):"";if(r)return t.emit(r)})}}}}};var Bw={create:function(e,t,n,r,i){const o={};t=t||"vertical";const s=r.lassoBrushKey||"select",a=r.dimRangeBrushKey||null,l=r.measureRangeBrushKey||null,c=r.areaBrushKey||null,u=r.legendBrushKey||null,h=!!e.selectionHandler&&e.selectionHandler.isOn(),d={dragging:!1,lassoing:!1,majoring:!1,minoring:!1,measureSelecting:!1},f={gesture:"",type:""},p="horizontal"===t,g=p?"y-axis":"x-axis",m=p?"x-axis":"y-axis";function y(e,t,n){if(f.gesture===e)return;let r=s;const i=t||f.chart;switch(f.gesture){case"majorrange":b(i,"rangeDim","rangeClear",n),r=a;break;case"measurerange":b(i,"rangeMeasure","rangeClear",n),r=l;break;case"arearange":b(i,"rangeMinor","areaClear",n),r=c}f.gesture=e;const o="range"===e?"range":"item";f.type&&f.type!==o&&i.brush(r).clear(),f.chart=t,f.type=o}function b(e,t,n,r){if(e){const i=e.component(t);i&&i.emit(n,r)}}let v=[];const x={isSelectionEnabled:()=>e.selectionHandler&&e.selectionHandler.isOn(),isNavigationEnabled:()=>e.scrollHandler&&e.scrollHandler.isOn(),doEmit:b,switchTo:y,getBrushConfig:function(){return a?l?"majorrange measurerange":"majorrange arearange":"measurerange arearange"}},w={handlers:e,keys:r,isHorizontal:p,active:f,rangeSelStatus:i};function M(){y("none"),d.majoring=!1,d.measureSelecting=!1,d.minoring=!1}return h&&(v=[{type:"Tap",options:{event:"rangeClearTap"},events:{rangeClearTap(e){y("none",this.chart,e),d.majoring=!1,d.measureSelecting=!1,d.minoring=!1}}}],v.unshift(Vw.callNavBtnGesture(x.isNavigationEnabled,u)),v.push(Pw.callLassoGesture(d,x,w)),a?l?(v.push(zw.callDimensionRangeGesture(d,x,w,g)),e.selectionHandler.addComponent(a,{id:"rangeDim",clear:"rangeClear"}),v.push(Lw.callMeasureRangeGesture(d,x,w,m)),e.selectionHandler.addComponent(l,{id:"rangeMeasure",clear:"rangeClear"})):(v.push(zw.callDimensionRangeGesture(d,x,w,g)),e.selectionHandler.addComponent(a,{id:"rangeDim",clear:"rangeClear"}),v.push(Fw.callAreaRangeGesture(d,x,w,m)),e.selectionHandler.addComponent(c,{id:"rangeMinor",clear:"areaClear"})):(v.push(Lw.callMeasureRangeGesture(d,x,w,m)),e.selectionHandler.addComponent(l,{id:"rangeMeasure",clear:"rangeClear"}),v.push(Fw.callAreaRangeGesture(d,x,w,g)),e.selectionHandler.addComponent(c,{id:"rangeMinor",clear:"areaClear"}))),e.scrollHandler&&(v.push(Hw.callDragGesture(d,x,w,h,n)),e.scrollHandler.getScrollApi().on("update",M)),o.gestures=v,o.destroy=function(){e.scrollHandler&&e.scrollHandler.getScrollApi().removeListener("update",M)},o}};const $w=(e,t)=>(t.components||[]).find(t=>t.key===e),Ww=(e,t,n)=>{const r=$w("axis",n)?.axis;return{text:{fontFamily:r?.title?.fontFamily||t.getStyle(e,"axis.title","fontFamily"),fontSize:r?.title?.fontSize||t.getStyle(e,"axis.title","fontSize"),fill:r?.title?.fontColor?.color||t.getStyle(e,"axis.title","color")}}},Uw=(e,t,n)=>{const r=$w("axis",n)?.axis;return{labels:{fontFamily:r?.label?.name?.fontFamily||t.getStyle(e,"axis.label.name","fontFamily"),fontSize:r?.label?.name?.fontSize||t.getStyle(e,"axis.label.name","fontSize"),fill:r?.label?.name?.fontColor?.color||t.getStyle(e,"axis.label.name","color")}}};function Yw(e){const t=eb(e,"qUndoExclude.box.qHyperCube.qDimensionInfo.0.qApprMaxGlyphCount",0);return Math.min(20,t)}const Kw={createSettings:function(e){return{settings:{labels:{maxGlyphCount:Yw(e)}}}}};const Xw={createSettings:function(e){const t=Sw.isAutoBin(e),n=Sw.getBinMode(e),r=Sw.getDerivedBinSize(e);let i,o;if(t||"maxCount"===n){const t=Sw.getDerivedBinOffset(e);i=t,o=t+Sw.getDerivedBinCount(e)*r}else{const t=eb(e,"qUndoExclude.box.qHyperCube.qDimensionInfo.0",{});i=t.qMin||0,o=(t.qMax||0)+r}return{component:{type:"linear",min:i,max:o}}}},Gw={aliceblue:{r:240,g:248,b:255},antiquewhite:{r:250,g:235,b:215},aqua:{r:0,g:255,b:255},aquamarine:{r:127,g:255,b:212},azure:{r:240,g:255,b:255},beige:{r:245,g:245,b:220},bisque:{r:255,g:228,b:196},black:{r:0,g:0,b:0},blanchedalmond:{r:255,g:235,b:205},blue:{r:0,g:0,b:255},blueviolet:{r:138,g:43,b:226},brown:{r:165,g:42,b:42},burlywood:{r:222,g:184,b:135},cadetblue:{r:95,g:158,b:160},chartreuse:{r:127,g:255,b:0},chocolate:{r:210,g:105,b:30},coral:{r:255,g:127,b:80},cornflowerblue:{r:100,g:149,b:237},cornsilk:{r:255,g:248,b:220},crimson:{r:220,g:20,b:60},cyan:{r:0,g:255,b:255},darkblue:{r:0,g:0,b:139},darkcyan:{r:0,g:139,b:139},darkgoldenrod:{r:184,g:134,b:11},darkgray:{r:169,g:169,b:169},darkgreen:{r:0,g:100,b:0},darkgrey:{r:169,g:169,b:169},darkkhaki:{r:189,g:183,b:107},darkmagenta:{r:139,g:0,b:139},darkolivegreen:{r:85,g:107,b:47},darkorange:{r:255,g:140,b:0},darkorchid:{r:153,g:50,b:204},darkred:{r:139,g:0,b:0},darksalmon:{r:233,g:150,b:122},darkseagreen:{r:143,g:188,b:143},darkslateblue:{r:72,g:61,b:139},darkslategray:{r:47,g:79,b:79},darkslategrey:{r:47,g:79,b:79},darkturquoise:{r:0,g:206,b:209},darkviolet:{r:148,g:0,b:211},deeppink:{r:255,g:20,b:147},deepskyblue:{r:0,g:191,b:255},dimgray:{r:105,g:105,b:105},dimgrey:{r:105,g:105,b:105},dodgerblue:{r:30,g:144,b:255},firebrick:{r:178,g:34,b:34},floralwhite:{r:255,g:250,b:240},forestgreen:{r:34,g:139,b:34},fuchsia:{r:255,g:0,b:255},gainsboro:{r:220,g:220,b:220},ghostwhite:{r:248,g:248,b:255},gold:{r:255,g:215,b:0},goldenrod:{r:218,g:165,b:32},gray:{r:128,g:128,b:128},green:{r:0,g:128,b:0},greenyellow:{r:173,g:255,b:47},grey:{r:128,g:128,b:128},honeydew:{r:240,g:255,b:240},hotpink:{r:255,g:105,b:180},indianred:{r:205,g:92,b:92},indigo:{r:75,g:0,b:130},ivory:{r:255,g:255,b:240},khaki:{r:240,g:230,b:140},lavender:{r:230,g:230,b:250},lavenderblush:{r:255,g:240,b:245},lawngreen:{r:124,g:252,b:0},lemonchiffon:{r:255,g:250,b:205},lightblue:{r:173,g:216,b:230},lightcoral:{r:240,g:128,b:128},lightcyan:{r:224,g:255,b:255},lightgoldenrodyellow:{r:250,g:250,b:210},lightgray:{r:211,g:211,b:211},lightgreen:{r:144,g:238,b:144},lightgrey:{r:211,g:211,b:211},lightpink:{r:255,g:182,b:193},lightsalmon:{r:255,g:160,b:122},lightseagreen:{r:32,g:178,b:170},lightskyblue:{r:135,g:206,b:250},lightslategray:{r:119,g:136,b:153},lightslategrey:{r:119,g:136,b:153},lightsteelblue:{r:176,g:196,b:222},lightyellow:{r:255,g:255,b:224},lime:{r:0,g:255,b:0},limegreen:{r:50,g:205,b:50},linen:{r:250,g:240,b:230},magenta:{r:255,g:0,b:255},maroon:{r:128,g:0,b:0},mediumaquamarine:{r:102,g:205,b:170},mediumblue:{r:0,g:0,b:205},mediumorchid:{r:186,g:85,b:211},mediumpurple:{r:147,g:112,b:219},mediumseagreen:{r:60,g:179,b:113},mediumslateblue:{r:123,g:104,b:238},mediumspringgreen:{r:0,g:250,b:154},mediumturquoise:{r:72,g:209,b:204},mediumvioletred:{r:199,g:21,b:133},midnightblue:{r:25,g:25,b:112},mintcream:{r:245,g:255,b:250},mistyrose:{r:255,g:228,b:225},moccasin:{r:255,g:228,b:181},navajowhite:{r:255,g:222,b:173},navy:{r:0,g:0,b:128},oldlace:{r:253,g:245,b:230},olive:{r:128,g:128,b:0},olivedrab:{r:107,g:142,b:35},orange:{r:255,g:165,b:0},orangered:{r:255,g:69,b:0},orchid:{r:218,g:112,b:214},palegoldenrod:{r:238,g:232,b:170},palegreen:{r:152,g:251,b:152},paleturquoise:{r:175,g:238,b:238},palevioletred:{r:219,g:112,b:147},papayawhip:{r:255,g:239,b:213},peachpuff:{r:255,g:218,b:185},peru:{r:205,g:133,b:63},pink:{r:255,g:192,b:203},plum:{r:221,g:160,b:221},powderblue:{r:176,g:224,b:230},purple:{r:128,g:0,b:128},red:{r:255,g:0,b:0},rosybrown:{r:188,g:143,b:143},royalblue:{r:65,g:105,b:225},saddlebrown:{r:139,g:69,b:19},salmon:{r:250,g:128,b:114},sandybrown:{r:244,g:164,b:96},seagreen:{r:46,g:139,b:87},seashell:{r:255,g:245,b:238},sienna:{r:160,g:82,b:45},silver:{r:192,g:192,b:192},skyblue:{r:135,g:206,b:235},slateblue:{r:106,g:90,b:205},slategray:{r:112,g:128,b:144},slategrey:{r:112,g:128,b:144},snow:{r:255,g:250,b:250},springgreen:{r:0,g:255,b:127},steelblue:{r:70,g:130,b:180},tan:{r:210,g:180,b:140},teal:{r:0,g:128,b:128},thistle:{r:216,g:191,b:216},tomato:{r:255,g:99,b:71},transparent:{r:255,g:255,b:255,a:0},turquoise:{r:64,g:224,b:208},violet:{r:238,g:130,b:238},wheat:{r:245,g:222,b:179},white:{r:255,g:255,b:255},whitesmoke:{r:245,g:245,b:245},yellow:{r:255,g:255,b:0},yellowgreen:{r:154,g:205,b:50}},Jw=/^rgb\((\d{1,3}),(\d{1,3}),(\d{1,3})\)$/i,Zw=/^rgba\((\d{1,3}),(\d{1,3}),(\d{1,3}),(\d(\.\d+)?)\)$/i,Qw=/^#([A-f0-9]{2})([A-f0-9]{2})([A-f0-9]{2})$/i,eM=/^#([A-f0-9])([A-f0-9])([A-f0-9])$/i,tM=/^hsl\(\s*(\d+(\.\d+)?)\s*,\s*(\d+(\.\d+)?%?)\s*,\s*(\d+(\.\d+)?%?)\s*\)$/i,nM=/^hsla\(\s*(\d+(\.\d+)?)\s*,\s*(\d+(\.\d+)?%?)\s*,\s*(\d+(\.\d+)?%?)\s*,(\d(\.\d+)?)\)$/i,rM=Math.floor,iM=Math.round,oM=Bv.extend({init(){let e,t,n,r,i,o,s,a,l,c,u,h,d=0,f=0,p=0,g=1;if(this._invalid=!1,arguments[0]instanceof oM)d=arguments[0]._r,f=arguments[0]._g,p=arguments[0]._b,g=arguments[0]._a,this._invalid=arguments[0]._invalid;else if(arguments.length<3)if("string"==typeof arguments[0])if(h=arguments[0],u=/^rgb\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*\)$/i.exec(h))d=parseInt(u[1],10),f=parseInt(u[2],10),p=parseInt(u[3],10);else if(u=/^rgba\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d(\.\d+)?)\s*\)$/i.exec(h))d=parseInt(u[1],10),f=parseInt(u[2],10),p=parseInt(u[3],10),g=parseFloat(u[4]);else if(u=/^#([A-f0-9]{2})([A-f0-9]{2})([A-f0-9]{2})$/i.exec(h))d=parseInt(u[1],16),f=parseInt(u[2],16),p=parseInt(u[3],16),g=1;else if(u=/^#([A-f0-9])([A-f0-9])([A-f0-9])$/i.exec(h))d=parseInt(u[1]+u[1],16),f=parseInt(u[2]+u[2],16),p=parseInt(u[3]+u[3],16),g=1;else if(u=/^hsl\(\s*(\d+(\.\d+)?)\s*,\s*(\d+(\.\d+)?%?)\s*,\s*(\d+(\.\d+)?%?)\s*\)$/i.exec(h)){switch(e=parseFloat(u[1]),t=parseFloat(u[3]),r=parseFloat(u[5]),e%=360,t/=100,r/=100,e=e<0?0:e>360?360:e,t=t<0?0:t>1?1:t,r=r<0?0:r>1?1:r,o=r<=.5?2*r*t:(2-2*r)*t,s=e/60,a=o*(1-Math.abs(s%2-1)),l=[],s=Math.floor(s),s){case 0:l=[o,a,0];break;case 1:l=[a,o,0];break;case 2:l=[0,o,a];break;case 3:l=[0,a,o];break;case 4:l=[a,0,o];break;case 5:l=[o,0,a];break;default:l=[0,0,0]}c=r-.5*o,d=l[0]+c,f=l[1]+c,p=l[2]+c,d=iM(255*d),f=iM(255*f),p=iM(255*p),g=1}else if(u=/^hsla\(\s*(\d+(\.\d+)?)\s*,\s*(\d+(\.\d+)?%?)\s*,\s*(\d+(\.\d+)?%?)\s*,(\d(\.\d+)?)\)$/i.exec(h)){switch(e=parseFloat(u[1]),t=parseFloat(u[3]),r=parseFloat(u[5]),g=parseFloat(u[7]),e%=360,t/=100,r/=100,e=e<0?0:e>360?360:e,t=t<0?0:t>1?1:t,r=r<0?0:r>1?1:r,o=r<=.5?2*r*t:(2-2*r)*t,s=e/60,a=o*(1-Math.abs(s%2-1)),l=[],s=Math.floor(s),s){case 0:l=[o,a,0];break;case 1:l=[a,o,0];break;case 2:l=[0,o,a];break;case 3:l=[0,a,o];break;case 4:l=[a,0,o];break;case 5:l=[o,0,a];break;default:l=[0,0,0]}c=r-.5*o,d=l[0]+c,f=l[1]+c,p=l[2]+c,d=iM(255*d),f=iM(255*f),p=iM(255*p)}else if(u=/^hsv\(\s*(\d+(\.\d+)?)\s*,\s*(\d+(\.\d+)?%?)\s*,\s*(\d+(\.\d+)?%?)\s*\)$/i.exec(h)){switch(e=parseFloat(u[1]),t=parseFloat(u[3]),i=parseFloat(u[5]),e%=360,t/=100,i/=100,e=e<0?0:e>360?360:e,t=t<0?0:t>1?1:t,i=i<0?0:i>1?1:i,o=i*t,s=e/60,a=o*(1-Math.abs(s%2-1)),l=[],s=Math.floor(s),s){case 0:l=[o,a,0];break;case 1:l=[a,o,0];break;case 2:l=[0,o,a];break;case 3:l=[0,a,o];break;case 4:l=[a,0,o];break;case 5:l=[o,0,a];break;default:l=[0,0,0]}c=i-o,d=l[0]+c,f=l[1]+c,p=l[2]+c,d=iM(255*d),f=iM(255*f),p=iM(255*p),g=1}else Gw[h.toLowerCase()]?(n=h.toLowerCase(),d=Gw[n].r,f=Gw[n].g,p=Gw[n].b,g="number"==typeof Gw[n].a?Gw[n].a:1):this._invalid=!0;else"number"==typeof arguments[0]&&arguments[0]>=0&&"argb"===arguments[1]?(g=(4278190080&arguments[0])>>>24,g/=255,d=(16711680&arguments[0])>>16,f=(65280&arguments[0])>>8,p=255&arguments[0]):"number"==typeof arguments[0]&&arguments[0]>=0?(d=(16711680&arguments[0])>>16,f=(65280&arguments[0])>>8,p=255&arguments[0]):this._invalid=!0;else arguments.length>=3?(d=arguments[0],f=arguments[1],p=arguments[2],g=arguments.length>=4?arguments[3]:1):this._invalid=!0;Number.isNaN(+d+f+p+g)&&(this._invalid=!0),this._r=rM(d),this._g=rM(f),this._b=rM(p),this._a=g,this._spaces={}},isInvalid(){return this._invalid},setAlpha(e){this._a=e,this._spaces={}},getAlpha(){return this._a},toRGB:function(){return this._spaces.rgb||(this._spaces.rgb=oM.toRGB(this)),this._spaces.rgb},toRGBA:function(){return this._spaces.rgba||(this._spaces.rgba=oM.toRGBA(this)),this._spaces.rgba},toString(){return this._spaces.rgb||(this._spaces.rgb=oM.toRGB(this)),this._spaces.rgb},toHex:function(){return this._spaces.hex||(this._spaces.hex=oM.toHex(this)),this._spaces.hex},toHSL:function(e){return this._spaces.hsl||(this._spaces.hsl=oM.toHSL(this,e)),this._spaces.hsl},toHSLA:function(e){return this._spaces.hsla||(this._spaces.hsla=oM.toHSLA(this,e)),this._spaces.hsla},toHSV(){const e=this.toHSVComponents();return`hsv(${e.h},${e.s},${e.v})`},toHSVComponents:function(){return this._spaces.hsvComp||(this._spaces.hsvComp=oM.toHSVComponents(this)),this._spaces.hsvComp},toNumber:function(){return this._spaces.num||(this._spaces.num=oM.toNumber(this)),this._spaces.num},isDark(){return this.isInvalid()||this.getLuminance()<125},getLuminance(){return void 0===this._lumi&&(this._lumi=.299*this._r+.587*this._g+.114*this._b),this._lumi},shiftLuminance(e){const t=this.toHSLA(),n=/^hsla\(\s*(\d+(\.\d+)?)\s*,\s*(\d+(\.\d+)?%?)\s*,\s*(\d+(\.\d+)?%?)\s*,(\d(\.\d+)?)\)$/i.exec(t),r=parseFloat(n[1]),i=parseFloat(n[3]);let o=parseFloat(n[5]);const s=parseFloat(n[7]);return o+=e,o=Math.max(0,Math.min(o,100)),`hsla(${r},${i},${o},${s})`},isEqual(e){return e instanceof oM||(e=new oM(e)),this._r===e._r&&this._g===e._g&&this._b===e._b},blend(e,t){return`rgba(${[rM(this._r+(e._r-this._r)*t),rM(this._g+(e._g-this._g)*t),rM(this._b+(e._b-this._b)*t),rM(this._a+(e._a-this._a)*t)].join(",")})`},createShiftedColor(e){(void 0===e||Number.isNaN(+e))&&(e=1);const t=this.getLuminance(),n=this._g<126?1:1+this._g/512,r=this.shiftLuminance(20*(t*n<220?.8+1/(t+1)*4:-(.8+t/255*1))*e);return new oM(r)}});oM.toRGB=function(e){if(e instanceof oM)return`rgb(${[e._r,e._g,e._b].join(",")})`;"string"==typeof e&&(e=oM.toNumber(e));return`rgb(${(16711680&e)>>16},${(65280&e)>>8},${255&e})`},oM.toRGBA=function(e,t){if(e instanceof oM)return`rgba(${[e._r,e._g,e._b,void 0!==t?t:e._a].join(",")})`;"string"==typeof e&&(e=oM.toNumber(e));return`rgba(${(16711680&e)>>16},${(65280&e)>>8},${255&e},${void 0!==t?t:e._a})`},oM.toHex=function(e){let t,n,r;return e instanceof oM?(t=e._r.toString(16),n=e._g.toString(16),r=e._b.toString(16),1===t.length&&(t=`0${t}`),1===n.length&&(n=`0${n}`),1===r.length&&(r=`0${r}`),`#${[t,n,r].join("")}`):("string"==typeof e&&(e=oM.toNumber(e)),t=((16711680&e)>>16).toString(16),n=((65280&e)>>8).toString(16),r=(255&e).toString(16),1===t.length&&(t=`0${t}`),1===n.length&&(n=`0${n}`),1===r.length&&(r=`0${r}`),`#${t}${n}${r}`)},oM.toHSL=function(e,t){let n,r,i,o=0;"string"==typeof e&&(e=new oM(e));const s=e._r/255,a=e._g/255,l=e._b/255,c=Math.max(s,a,l),u=Math.min(s,a,l);if(r=t?.21*s+.72*a+.07*l:(c+u)/2,c===u)n=0,o=0;else{switch(i=c-u,n=r>.5?i/(2-c-u):i/(c+u),c){case s:o=(a-l)/i+(a<l?6:0);break;case a:o=(l-s)/i+2;break;case l:o=(s-a)/i+4}o/=6}return`hsl(${360*o},${100*n},${100*r})`},oM.toHSLA=function(e,t){let n,r,i,o=0;"string"==typeof e&&(e=new oM(e));const s=e._r/255,a=e._g/255,l=e._b/255,c=e._a,u=Math.max(s,a,l),h=Math.min(s,a,l);if(r=t?.21*s+.72*a+.07*l:(u+h)/2,u===h)n=0,o=0;else{switch(i=u-h,n=r>.5?i/(2-u-h):i/(u+h),u){case s:o=(a-l)/i+(a<l?6:0);break;case a:o=(l-s)/i+2;break;case l:o=(s-a)/i+4}o/=6}return`hsla(${360*o},${100*n},${100*r},${c})`},oM.toHSVComponents=function(e){let t,n,r=0;"string"==typeof e&&(e=new oM(e));const i=e._r/255,o=e._g/255,s=e._b/255,a=Math.max(i,o,s),l=Math.min(i,o,s),c=a;if(a===l)t=0,r=0;else{switch(n=a-l,t=0===n?0:n/c,a){case i:r=(o-s)/n+(o<s?6:0);break;case o:r=(s-i)/n+2;break;case s:r=(i-o)/n+4}r/=6}return{h:360*r%360,s:100*t,v:100*c}},oM.toNumber=function(){if(1===arguments.length&&arguments[0]instanceof oM)return(arguments[0]._r<<16)+(arguments[0]._g<<8)+arguments[0]._b;let e,t,n=0,r=0,i=0;return 1===arguments.length&&"string"==typeof arguments[0]&&(t=arguments[0],(e=/^rgb\((\d{1,3}),(\d{1,3}),(\d{1,3})\)$/i.exec(t))?(n=parseInt(e[1],10),r=parseInt(e[2],10),i=parseInt(e[3],10)):(e=/^#([A-f0-9]{2})([A-f0-9]{2})([A-f0-9]{2})$/i.exec(t))?(n=parseInt(e[1],16),r=parseInt(e[2],16),i=parseInt(e[3],16)):(e=/^#([A-f0-9])([A-f0-9])([A-f0-9])$/i.exec(t))&&(n=parseInt(e[1]+e[1],16),r=parseInt(e[2]+e[2],16),i=parseInt(e[3]+e[3],16))),(n<<16)+(r<<8)+i},oM.blend=function(e,t,n){const r=(16711680&(e=oM.toNumber(e)))>>16,i=(65280&e)>>8,o=255&e;return(r+(((16711680&(t=oM.toNumber(t)))>>16)-r)*n<<16)+(i+(((65280&t)>>8)-i)*n<<8)+(o+((255&t)-o)*n)},oM.getBlend=function(e,t,n){const r=e._r+(t._r-e._r)*n,i=e._g+(t._g-e._g)*n,o=e._b+(t._b-e._b)*n,s=e._a+(t._a-e._a)*n;return new oM(r,i,o,s)},oM.isCSSColor=function(e){return!(arguments.length>1||"string"!=typeof e)&&(Jw.test(e)||Zw.test(e)||Qw.test(e)||eM.test(e)||tM.test(e)||nM.test(e)||Gw[e.toLowerCase()])},oM.getBestContrast=function(e,t,n){const r=e.getLuminance();return Math.abs(r-t.getLuminance())>Math.abs(r-n.getLuminance())?t:n},oM.getContrast=function(e,t){if(!e||!t)return;const n=e.getLuminance()/100,r=t.getLuminance()/100;return n>r?(n+.05)/(r+.05):(r+.05)/(n+.05)},oM.isDark=function(){const e={getLuminance:oM.prototype.getLuminance,isInvalid:oM.prototype.isInvalid};return oM.prototype.init.apply(e,[].slice.call(arguments)),oM.prototype.isDark.call(e)},oM.useDarkLabel=function(e,t){return e._a>.5?!e.isDark():!t};const sM={TRANSPARENT_BLACK:"rgba( 0,0,0,0.2 )",TRANSPARENT_WHITE:"rgba( 255,255,255,0.7 )",LIGHT_GREY:"#ccc",DARK_GREY:"#666",BLACK:"#000",WHITE:"#fff",getInverse(e){const t=new oM(e);return 0===t.getAlpha()?this.BLACK:t.isDark()?this.WHITE:this.BLACK},getContrastingGrey(e){const t=new oM(e);return 0===t.getAlpha()?this.DARK_GREY:oM.getBestContrast(t,new oM(sM.LIGHT_GREY),new oM(sM.DARK_GREY))},getBestContrast:(e,t,n)=>oM.getBestContrast(new oM(e),new oM(t),new oM(n)),getContrastingTransparent(e){const t=new oM(e);return 0===t.getAlpha()||"none"===e?this.TRANSPARENT_BLACK:t.isDark()?this.TRANSPARENT_WHITE:this.TRANSPARENT_BLACK}};const aM={createSettings:function(e,t,n,r,i,o){const{theme:s}=e.environment,a=s.getColorPickerColor(t.color.bar.paletteColor),l=Sw.getDerivedBinSize(t),c=[],u=[n.consume,r.consume,i.consume];return e._tooltipHandler.isOn()&&(c.push(o.box.trigger),u.push.apply(u,o.box.consume)),c.push(n.trigger),{key:"box-marker",settings:{box:{fill:a,stroke:sM.getContrastingGrey(a).toHex(),strokeWidth:1,maxWidthPx:1/0,minWidthPx:NaN,minWidth:0},major:{scale:"dimension",ref:{start:"binStart",end:"binEnd"}},minor:{scale:"measure"},whiskers:!1,orientation:"vertical"},brush:{trigger:c,consume:u},data:{extract:{field:"qDimensionInfo/0",props:{start:0,end:{field:"qMeasureInfo/0"},measure:{field:"qMeasureInfo/0",reduce:"first",value:e=>e,reduceLabel:"none"},binStart:{field:"qDimensionInfo/0",value:e=>e.qNum},binEnd:{field:"qDimensionInfo/0",value:e=>e.qNum+l},elemNo:{field:"qDimensionInfo/0"},bin:{field:"qDimensionInfo/0",value:e=>e}}}}}}};const lM={createSettings:function(e,t,n){const r=t.getStyles(),i=((e,t,n)=>{const r=$w("value",n)?.label,i=r?.value?.fontFamily||t.label.value.fontFamily;let o=r?.value?.fontSize||t.label.value.fontSize;o=parseFloat(o);const s=r?.value?.fontColor?.color;return{fontFamily:i,fontSize:o,fill:s}})(0,r,e),o=i.fill||r.label.value.color;return{settings:{sources:[{strategy:{settings:{...i,labels:[{placements:[{fill:o},{fill:i.fill?o:e=>oM.isDark(e.node.attrs.fill)?r.label.value.lightColor:r.label.value.darkColor}]}]}}}]}}}},cM="object.histogram";function uM(e){return eb(e,"qHyperCube.qDimensionInfo.0.qIsOneAndOnlyOne",!1)}const hM={createChartSettings:function(e,t){const n=e.isRtl(),r=eb(t,"qHyperCube.qDimensionInfo.0",{}).qFallbackTitle||"",{theme:i,translator:o}=e.environment,s=bx.create({chartID:cM,theme:i,isRtl:n,flags:e.flags}),a=function(e){var t=e.theme,n=e.config,r=void 0===n?{}:n,i=r.id,o=r.resolve,s=void 0===o?[]:o,a=r.transform,l=void 0===a?[]:a,c=r.extend,u=void 0===c?[]:c,h={theme:t,matrix:yb(s),styles:void 0};return h.styles=wb({theme:t,id:i,transform:l,extend:u,matrix:h.matrix}),{getStyles:function(){return h.styles},getTheme:function(){return h.theme},setTheme:function(e){h.theme=e,h.styles=wb({theme:e,id:i,transform:l,extend:u,matrix:h.matrix})}}}({theme:i,config:{id:"histogram"}});let l={},c={},u={};e._selectionHandler.isOn()&&(e._selectionHandler.setUpStart(),l=e._selectionHandler.setUpBrush({contexts:["select"],data:["elemNo"],dataPath:"qUndoExclude/box"}),c=e._selectionHandler.setUpBrush({contexts:["select-dimension"],data:["elemNo"],dataPath:"qUndoExclude/box",isSingleSelect:uM(t)}),u=e._selectionHandler.setUpBrush({dataPath:"qUndoExclude/box",contexts:["select-measure"],data:["end"]}),e._selectionHandler.setUpDone());const h={box:{}};e._tooltipHandler.isOn()&&(h.box=e._tooltipHandler.setUp({chartBuilder:s,environment:e.environment,data:[""],contexts:["boxTip"],componentKey:"box-marker",measureRows:["measure"],labelData:["bin"]}));const d=function(e){const t=e.qUndoExclude&&e.qUndoExclude.box&&e.qUndoExclude.box.qHyperCube&&e.qUndoExclude.box.qHyperCube.qDimensionInfo?e.qUndoExclude.box.qHyperCube.qDimensionInfo:void 0;return!!t&&!!t[0].qLocked}(t),f=function(e){const t={};return e?(t.isOpenDim=!1,t.isOpenMea=!1):(t.isOpenDim=!0,t.isOpenMea=!0),t}(d),p={scrollHandler:null,selectionHandler:e._selectionHandler};this._dependentActions&&this._dependentActions.destroy(),this._dependentActions=Bw.create(p,"vertical",n,{componentKey:"box-marker",lassoBrushKey:"select",dimRangeBrushKey:null,measureRangeBrushKey:"select-measure",areaBrushKey:"select-dimension"},f),s.addPreset("dimension-measure-chart",{isRtl:n,includeDimensionAxis:!0,orientation:"vertical",selectionsEnabled:e._selectionHandler.isOn(),theme:i,measureSource:"qMeasureInfo/0",measureScaleSettings:{component:{expand:0,include:[0]}},enableLasso:!0,lasso:{brushKey:"select",brushComponents:["box-marker"]},enableMeasureRange:!0,measureRange:{brushKey:"select-measure",brushAxis:"y-axis",brushArea:"box-marker",brushScale:"measure"},enableAreaRange:!0,areaRange:{brushKey:"select-dimension",brushAxis:"x-axis",brushData:["elemNo"],brushArea:"box-marker",brushScale:"rangeSelSettings",brushComponents:["box-marker"],multiple:!0,chartInstance:e.chartInstance},brushActions:this._dependentActions.gestures,dimensionSource:"qDimensionInfo/0",dimensionScaleSettings:Xw.createSettings(t),measureAxisProperties:t.measureAxis,measureTitleText:t.measureAxis.label||o.get("Visualization.Histogram.MeasureAxisLabel"),dimensionAxisProperties:t.dimensionAxis,dimensionAxisSettings:Kw.createSettings(t),dimensionTitleText:r,gridlines:t.gridlines,hasNavigation:!1,isNavigationEnabledFn:()=>!1,refLines:t.refLine&&t.refLine.refLines,axisTitleStyle:Ww(cM,i,t),axisLabelStyle:Uw(cM,i,t)});const g=s.getSettings(),m=aM.createSettings(e,t,l,c,u,h);if(s.addComponent("box-marker",m),t.dataPoint&&t.dataPoint.showLabels){const e=lM.createSettings(t,a,cM);s.addComponent("labels",e)}return e.addSnapshotChartSettings(g,t),g.scales.rangeSelSettings={type:"linear",min:g.scales.dimension.min,max:g.scales.dimension.max,source:"qDimensionInfo/0"},g}};const dM=Sx.extend("Histogram",{namespace:".histogram",init:function({environment:e,flags:t,lasso:n,picasso:r,$element:i,backendApi:o,selectionsApi:s,renderState:a}){this._super(r,i,e,o,s),this.flags=t,this.renderState=a,this.picassoElement.__do_not_use_findShapes=this.chartInstance.findShapes.bind(this.chartInstance),this._derivedProperties=new uw,this._selectionHandler=Rx.create({model:o.model,chartInstance:this.chartInstance,selectionsApi:s,selectPaths:["/qUndoExclude/box/qHyperCubeDef"],lasso:n}),this._tooltipHandler=Yx.create(this.chartInstance,i,"object.histogram"),this.setDataPaths(["qUndoExclude/box/qHyperCube"])},updateConstraints:function(e){const t=!e.passive,n=!e.select&&!e.active;this._tooltipHandler[t?"on":"off"](),this._selectionHandler[n?"on":"off"]()},off:function(){this._tooltipHandler.off(),this._selectionHandler.off()},createChartSettings:function(e){return hM.createChartSettings(this,e)},setSnapshotData:function(e){return this._super(e),e.qUndoExclude.box.qHyperCube.qDataPages=this.layout.qUndoExclude.box.qHyperCube.qDataPages,Promise.resolve(e)},getDisclaimerAttributes:function(e){const t=function(){const t=eb(e,"qUndoExclude.box.qHyperCube.qDataPages.0.qMatrix",[]);return 1===t.length&&t[0][0]&&t[0][0].qIsNull}();return{data:e.qUndoExclude&&e.qUndoExclude.box,supportedDisclaimers:{LimitedData:!0,OnlyNanData:!0,OnlyNegativeOrZeroValues:!t,RequireNumericDimension:!0},options:{bottom:!0,supportNegative:!1,explicitOnlyNanData:t,explicitRequireNumericDimension:(n=e.qHyperCube,n.qDimensionInfo.length>0&&-1===n.qDimensionInfo[0].qTags.indexOf("$numeric"))}};var n},updateChart:function(e,t){if(!e.qUndoExclude)return Promise.resolve();this._super(e,t)},updateData:function(e){const t=this;return t._super(e).then(()=>{if(t._destroyed)return Promise.reject();e=t.layout;const n={height:Math.min(e.qHyperCube.qSize.qcy,1e3),width:2},r=t.backendApi.model;return!!this.layout.snapshotData?Promise.resolve():r.getEffectiveProperties().then(i=>t._destroyed?Promise.reject():t._derivedProperties.addDefaultHyperCubeHash(i.qHyperCubeDef,e.qHyperCube,t.environment.app,function(e,t){return{box:t.qHyperCubeDef,binMappings:Ow.getMappingValues(e),binProperties:t.bins,measureAxis:t.measureAxis,version:"2.0"}}(e,i)).then(o=>{if(t._destroyed)return Promise.reject();const s={layout:e,properties:i,model:r,hashData:o,generateDerivedProperties:(e,n)=>Rw.generateHyperCubes(e,n,t.environment)};return t._derivedProperties.isDerivedUpToDate(s)?e.qUndoExclude?(t.renderState.restore(),t.backendApi.updateCache(e.qUndoExclude.box),t.getData(t.backendApi,e.qUndoExclude.box.qHyperCube,n)):Promise.resolve():(t.renderState.pending(),t._derivedProperties.updateDerivedProperties(s))}))})},paint:function(){const e=this.layout.qUndoExclude;return e&&e.box&&e.box.qHyperCube.qDataPages.length?this._super():Promise.resolve(!1)},isLassoDisabled:function(){return!1}});class fM{constructor(e){this.model=e,this.path="/qUndoExclude/box/qHyperCubeDef"}setCacheOptions({maxStackedValues:e}){}updateCache(e){}getData(e){return this.model.getHyperCubeData(this.path,e)}}var pM={onChangeCalcCond:function(e){const t=e?.qHyperCubeDef,n=e?.qUndoExclude?.box?.qHyperCubeDef;t&&n&&(n.qCalcCond=t.qCalcCond,n.qCalcCondition=t.qCalcCondition)}};const gM=(e,t)=>({component:"styling-panel",chartTitle:"Object.Histogram",translation:"LayerStyleEditor.component.styling",subtitle:"LayerStyleEditor.component.styling",ref:"components",useGeneral:!0,useBackground:e,items:{axisTitleSection:{translation:"properties.axis.title",component:"panel-section",items:t.getOptions("axis","axis.title")},axisLabelSection:{translation:"properties.axis.label",component:"panel-section",items:t.getOptions("axis","axis.label.name")},valueLabelSection:{translation:"properties.value.label",component:"panel-section",items:t.getOptions("value","label.value")}}}),mM="maxCount",yM="size";function bM(e){return!(e.bins&&e.bins.auto)}function vM(e){return bM(e)&&e.bins.binMode===mM}function xM(e){const{translator:t,flags:n}=e,r=e?.flags?.isEnabled("SENSECLIENT_IM_2021_STYLINGPANEL_HISTOGRAM"),i=e?.flags?.isEnabled("SENSECLIENT_IM_2021_HISTOGRAM_BG"),o=e.theme,s={translation:"properties.colors",type:"items",items:{colors:{classification:{section:"color",tags:["simple"]},type:"items",items:{barColor:{ref:"color.bar.paletteColor",translation:"properties.histogram.barColor",type:"object",component:"color-picker",dualOutput:!0,defaultValue:()=>{const{primary:e}=o.getDataColorSpecials(),t=o.getDataColorPickerPalettes()[0].colors,n=t.indexOf(e);return{index:-1===n?Math.min(6,t.length-1):n}}}}}}},a="object.histogram",l=((e,t,n,r,i)=>r({theme:e,translator:t,flags:i,config:{id:n,paths:["axis.title","axis.label.name","label.value","legend.title","legend.label"]}}))(o,t,a,ey,n),c=((e,t,n)=>{const r={getOptions:(r,i)=>{const o=(e,t)=>({ref:`${i}.fontColor`,component:"color-picker",width:!1,defaultValue:()=>{const n=e.getStyle(t,`${i}.color`,"color");return{color:n,index:e.getDataColorPickerPalettes()[0].colors.indexOf(n)}}});return{labelSection:{component:"items",ref:"components",key:r,items:{fontFamily:{ref:`${i}.fontFamily`,component:"dropdown",options:()=>e.getOptions(`${i}.fontFamily`),defaultValue:()=>e.getDefaultValue(`${i}.fontFamily`)},...((t,n)=>({fontWrapper:{component:"inline-wrapper",items:{fontSize:{ref:`${i}.fontSize`,component:"dropdown",width:!0,options:()=>e.getOptions(`${i}.fontSize`),defaultValue:()=>e.getDefaultValue(`${i}.fontSize`)},fontColor:{...o(t,n)}}}}))(t,n)}}}}};return r})(l,o,a),u={type:"items",translation:"properties.presentation",items:{stylingPanel:r&&gM(i,c),gridLines:{type:"items",snapshot:{tid:"property-gridLines"},items:{showGridLines:{ref:"gridlines.auto",type:"boolean",translation:"properties.gridLine.spacing",component:"switch",defaultValue:!0,options:[{value:!0,translation:"Common.Auto"},{value:!1,translation:"Common.Custom"}]},gridSpacing:{ref:"gridlines.spacing",type:"number",component:"dropdown",defaultValue:2,options:[{value:0,translation:"properties.gridLine.noLines"},{value:2,translation:"properties.gridLine.medium"},{value:3,translation:"properties.gridLine.narrow"}],show:e=>e.gridlines&&!e.gridlines.auto}}},showLabels:{ref:"dataPoint.showLabels",type:"boolean",translation:"properties.dataPoints.labelmode",component:"switch",defaultValue:!1,options:[{value:!0,translation:"Common.Auto"},{value:!1,translation:"properties.off"}],snapshot:{tid:"property-dataPoints"}}}},h={items:{labels:{items:{header:{show:e=>e.qHyperCubeDef.qDimensions?.length},pointLabels:{component:"checkbox",ref:"dataPoint.showLabels",type:"boolean",translation:"Simple.Label.Value",show:e=>e.qHyperCubeDef.qDimensions?.length},dimensionTitle:{component:"checkbox",ref:"dimensionAxis.show",type:"string",translation:"Simple.Label.XAxis.Hide",defaultValue:"all",show:e=>e.qHyperCubeDef.qDimensions?.length,convertFunctions:{get:(e,t,n,r)=>"labels"===r.dimensionAxis.show||"none"===r.dimensionAxis.show,set(e,t,n,r,i){i.dimensionAxis.show=e?"labels":"all"}}},measureTitle:{component:"checkbox",ref:"measureAxis.show",type:"string",translation:"Simple.Label.YAxis.Hide",defaultValue:"all",show:e=>e.qHyperCubeDef.qDimensions?.length,convertFunctions:{get:(e,t,n,r)=>"labels"===r.measureAxis.show||"none"===r.measureAxis.show,set(e,t,n,r,i){i.measureAxis.show=e?"labels":"all"}}}}}}},d={uses:"settings",items:{simpleLabels:h,presentation:u,colors:s,measureAxis:{uses:"axis.picasso.measureAxis",items:{label:{type:"string",expression:"optional",expressionType:"StringExpression",ref:"measureAxis.label",defaultValue:"",translation:"Common.Label",placeholderTranslation:"Visualization.Histogram.MeasureAxisLabel"}}},dimensionAxis:{uses:"axis.picasso.dimensionAxis",items:{othersGroup:{items:{label:{show:!1}}}}}}},f={type:"items",component:"expandable-items",translation:"properties.addons",items:{dataHandling:{uses:"dataHandling",items:{calcCond:{uses:"calcCond",change:pM.onChangeCalcCond}}},refLines:{uses:"reflines",items:{colorBackground:{show:!1}}}}},p={uses:"data",items:{dimensions:{translation:"Common.Fields",alternativeTranslation:"properties.alternative.fields",items:{dimensionLimits:{show:!1,items:{otherMode:{readOnly:!1},otherSortMode:{show:e=>"OTHER_COUNTED"===eb(e,"qOtherTotalSpec.qOtherMode")},otherCounted:{show:e=>"OTHER_COUNTED"===eb(e,"qOtherTotalSpec.qOtherMode")},otherLimitMode:{show(e){const t=eb(e,"qOtherTotalSpec.qOtherMode");return"OTHER_ABS_LIMITED"===t||"OTHER_REL_LIMITED"===t}},otherLimit:{show(e){const t=eb(e,"qOtherTotalSpec.qOtherMode");return"OTHER_ABS_LIMITED"===t||"OTHER_REL_LIMITED"===t}},calculatedAgainstMessage:{show:!0,label(){const e=t.get("properties.histogram.staticMeasureName");return t.get("Properties.DimensionLimits.CalculatedAgainst",e)}}}},others:{show:!1,items:{suppressOther:{defaultValue:!0}}}}}}},g={ref:"bins.binMode",type:"string",component:"dropdown",options:[{value:mM,translation:"Visualization.Histogram.Binning.NumberOfBinsOption"},{value:yM,translation:"Visualization.Histogram.Binning.BarWidthOption"}],defaultValue:mM,show:e=>bM(e)},m={translation:"Visualization.Histogram.Bins",type:"items",component:"items",items:{auto:{ref:"bins.auto",translation:"Visualization.Histogram.Binning",component:"switch",type:"boolean",defaultValue:!0,undefinedValue:!1,options:[{value:!0,translation:"Visualization.Histogram.Binning.Auto"},{value:!1,translation:"Visualization.Histogram.Binning.Custom"}]},autoMessage:{component:"text",translation:"Visualization.Histogram.Binning.AutoDescription",show:e=>!bM(e)},mode:g,binCount:{ref:"bins.binCount",type:"number",expression:"optional",expressionType:"ValueExpression",translation:"Visualization.Histogram.Binning.BinCount",defaultValue:"",convertFunctions:{get(e,t,n){const r=n.properties.bins.binCount;return Sw.isEmpty(r)?Sw.getDerivedBinCount(n.layout):e(null)||""},set(e,t,n){t(n.type,e,void 0)}},show:vM},binMessage:{component:"text",translation:"Visualization.Histogram.Binning.BinCountRounding",show(e){const t=eb(e,"bins.binCount"),n="object"==typeof t;return vM(e)&&!Sw.isEmpty(t)&&!n&&!qw(t)&&t>0}},minBinMessage:{component:"text",translation:"Visualization.Histogram.Binning.BinCountMin",show(e){const t=eb(e,"bins.binCount");return!!(vM(e)&&!Sw.isEmpty(t)&&t<=0)}},binSize:{ref:"bins.binSize",type:"number",expression:"optional",expressionType:"ValueExpression",defaultValue:10,show:e=>bM(e)&&e.bins.binMode===yM,translation:"Visualization.Histogram.Binning.BinSize"},offset:{ref:"bins.offset",type:"number",expression:"optional",expressionType:"ValueExpression",show:e=>bM(e)&&e.bins.binMode===yM,translation:"Visualization.Histogram.Binning.Offset"},distinct:{ref:"bins.countDistinct",type:"boolean",defaultValue:!1,component:"checkbox",translation:"Visualization.Histogram.CountDistinct"}}};return{type:"items",component:"accordion",items:{data:p,bins:m,addons:f,settings:d}}}var wM={type:"items",component:"accordion",items:{data:{uses:"data",items:{dimensions:{translation:"Common.Fields"}}}}};var MM={getExportRawDataOptions:function(e){return{model:e.model,exportDataPath:"/qUndoExclude/box/qHyperCubeDef"}}};const kM="qUndoExclude.box";function qM(e){return{definition:xM(e),softDefinition:wM,support:{cssScaling:!1,snapshot:!0,export:!0,exportData:!0,sharing:!0,viewData:!0},importProperties:(t,n,r,i)=>{const o=Cm(e);r.mapProperties();const s={defaultDimension:r.getDefaultDimensionProperties(),defaultMeasure:r.getDefaultMeasureProperties()};return Sm.hypercube.importProperties({exportFormat:t,initialProperties:n,dataDefinition:o,defaultPropertyValues:s,hypercubePath:i})},exportProperties:(e,t,n)=>Sm.hypercube.exportProperties({propertyTree:e,hyperCubePath:n?kM:t,viewDataMode:n}),requireNumericDimension:!0,exportTableProperties(e){const t=kM;return Sm.hypercube.exportProperties({propertyTree:e,hypercubePath:t,viewData:!0})},getExportRawDataOptions:MM.getExportRawDataOptions}}return function(t){!function(e){if(e&&e.get&&e.add){const t="Object.Disclaimer.LimitedData";if(e.get(t)!==t)return;Object.keys(l).forEach(t=>{e.add(l[t])})}}(t.translator);const n=Cm(t);return{qae:{properties:Dm,data:{targets:[n]},exportProperties:({propertyTree:e,hypercubePath:t,viewDataMode:n})=>Sm.hypercube.exportProperties({propertyTree:e,hypercubePath:n?"qUndoExclude.box":t})},ext:qM(t),component(){const n=e.useConstraints(),r=e.useElement(),i=function(){const t=e.useApp(),n=e.useAppLayout(),r=e.useDeviceType(),i=e.useOptions(),o=e.useTheme(),s=e.useTranslator();return e.useMemo(()=>({app:t,appLayout:n,deviceType:r,options:i,theme:o,translator:s}),[t,n,i.direction,i.freeResize,s.language(),o.name(),r])}(),o=i.options.renderer,s=e.useMemo(()=>xm(o),[o]),l=function(){const t=e.useConstraints(),[n,r]=e.useState(!1),[i,o]=e.useState(!1),s=!!e.useLayout().qSelectionInfo.qInSelections,[a]=e.useState(()=>({toggle(){o(e=>!e)}}));return e.useEffect(()=>{t&&r(!t.select&&!t.active)},[t]),e.useAction(()=>({key:"lasso",label:"Lasso",icon:wm,hidden:!n||!s,active:i,action(){o(e=>!e)}}),[s,i,n]),a.enabled=()=>n,a.active=()=>i,a}(),c=e.useModel(),u=e.useSelections(),h=e.useStaleLayout(),d=e.useRenderState(),[f,p]=e.useState();e.useEffect(()=>{const e=a(r),n=new fM(c),o=u,h=new dM({$element:e,backendApi:n,environment:i,flags:t.flags,lasso:l,picasso:s,selectionsApi:o,renderState:d});return p(h),()=>{h.destroy()}},[]);const[,g]=e.usePromise(async()=>{f&&(f.updateEnvironment(i),f.updateConstraints(n),await f.updateData(h),await f.paint())},[h,f,i]);if(g)throw g;var m;!function(t){const n=e.useRect(),r=e.useOptions(),i=e.useConstraints(),[,o]=e.usePromise(async()=>{t&&(t.updateConstraints(i),t.options=r,await t.resize())},[n.width,n.height]);if(o)throw o}(f),m=f,e.onTakeSnapshot(e=>{if(m)return m.setSnapshotData(e)}),e.useImperativeHandle(()=>({getViewState(){if(m)return m.getViewState()}}),[m])}}}});
|
|
28
|
+
!function(t,n){e.exports=n()}(0,function(){return function(e,t){if(!e||isNaN(+t))return t;var n,r,i,o,s,a,l,c,u,h,d=e.length,f=e.search(/[0-9\-\+#]/),p=f>0?e.substring(0,f):"",g=e.split("").reverse().join(""),m=g.search(/[0-9\-\+#]/),y=d-m,b=e.substring(y,y+1),v=y+("."===b||","===b?1:0),x=m>0?e.substring(v,d):"";if(n=(t="-"===(e=e.substring(f,v)).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))+"",a=e[1]&&e[1].lastIndexOf("0"),(!(c=t.split("."))[1]||c[1]&&c[1].length<=a)&&(t=(+t).toFixed(a+1)),u=e[0].split(o),e[0]=u.join(""),(s=e[0]&&e[0].indexOf("0"))>-1)for(;c[0].length<e[0].length-s;)c[0]="0"+c[0];else 0===+c[0]&&(c[0]="");if((t=t.split("."))[0]=c[0],l=u[1]&&u[u.length-1].length){for(g="",y=(h=t[0]).length%l,d=h.length,v=0;v<d;v++)g+=h.charAt(v),!((v-y+1)%l)&&v<d-l&&(g+=o);t[0]=g}return t[1]=e[1]&&t[1]?i+t[1]:"","0"!==(r=t.join(""))&&""!==r||(n=!1),p+(n?"-":"")+r+x}})});const ve=1e-15;function xe(e){return e.replace(/[-[\]/{}()*+?.\\^$|]/g,"\\$&")}const we={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"},Me=/%\)?$/,ke=/^\(r(0[2-9]|[12]\d|3[0-6])\)/i,qe=/^\(oct\)/i,Se=/^\(dec\)/i,_e=/^\(hex\)/i,De=/^\(bin\)/i,Ce=/^\(rom\)/i,Ee=/^(\(rom\)|\(bin\)|\(hex\)|\(dec\)|\(oct\)|\(r(0[2-9]|[12]\d|3[0-6])\))/i,Ae=/#|0/g;function Te(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 Ne(e,t){let n,r="",i=Number(String(e).slice(-3)),o=(e-i)/1e3,s=[0,1,4,5,9,10,40,50,90,100,400,500,900].reverse(),a=["0","I","IV","V","IX","X","XL","L","XC","C","CD","D","CM"].reverse();for(;i>0;)for(n=0;n<s.length;n++)if(s[n]<=i){r+=a[n],i-=s[n];break}for(n=0;n<o;n++)r="M".concat(r);return t[1]!==t[1].toUpperCase()&&(r=r.toLowerCase()),r}function Oe(e,t,n){let r;return ke.test(t)?e=Te(e,Number(/\d{2}/.exec(t)[0]),t,n):qe.test(t)?e=Te(e,8,t,n):Se.test(t)?e=Te(e,10,t,n):_e.test(t)?e=Te(e,16,t,n):De.test(t)?e=Te(e,2,t,n):Ce.test(t)&&(r="",e<0&&(r="-",e=-e),e=0===(e=Math.floor(e))?"0":e<=5e5?r+(e=Ne(e,t)):t+r+e.toExponential(0)),e}function Re(e,t,n){const r=xe(e);return n?r:new RegExp(r||"",t)}function Ie(e,t){return t&&(t=xe(t)),e&&(e=xe(e)),new RegExp("(?:[#0]+".concat(e,")?[#0]+(?:").concat(t,"[#0]+)?"))}function Pe(e,t){if(!e||!e.qNumericalAbbreviation)return we;const n={};return e.qNumericalAbbreviation.split(t).forEach(e=>{let t=e.split(":");2===t.length&&(n[t[0]]=t[1])}),n}function Le(e,t,n,r){let i,o,s,a,l,c,u,h,d,f=e.pattern;r&&(e.abbreviate=!0),d=Ie(t,n),s=f.match(d),s=s?s[0]:"",a=s?f.substr(0,f.indexOf(s)):f,l=s?f.substring(f.indexOf(s)+s.length):"",s||(s=f?"#":"##########"),t&&t===n&&(i=s.split(n),o=i.pop(),s=i.join("")+n+o,t=""),c=t,t=/,/.test(n)?"¤":",",c&&(s=s.replace(Re(c,"g"),t)),u=n,n=".",u&&(s=s.replace(Re(u,"g"),n)),h=s.match(/#/g),h=h?h.length:0;const p=f.split(u);let g;p[1]&&(g=p[1].match(Ae)),e.prefix=a||"",e.postfix=l||"",e.pattern=f,e.maxPrecision=g?g.length:2,e.percentage=Me.test(f),e.numericPattern=s||"",e.numericRegex=new RegExp("".concat(Re(t,null,!0),"|").concat(Re(n,null,!0)),"g"),e.groupTemp=c,e.decTemp=u,e.t=t,e.d=n,e.temp=h}class je{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=Pe(e,this.patternSeparator),this.prepare()}clone(){const e=new je(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],Ee.test(e[0])&&(r.positive.isFunctional=!0),e[1]?Ee.test(e[1])&&(r.negative.isFunctional=!0):r.negative=!1,e[2]?Ee.test(e[2])&&(r.zero.isFunctional=!0):r.zero=!1;const i="U"===this.type;r.positive.isFunctional||Le(r.positive,t,n,i),r.negative&&!r.negative.isFunctional&&Le(r.negative,t,n,i),r.zero&&!r.zero.isFunctional&&Le(r.zero,t,n,i)}formatValue(e){let t,n,r,i,o,s,a,l,c,u=this._prepared,h="",d="",f=e;if(isNaN(e))return"".concat(f);if(e=+e,!1===u.pattern)return e.toString();if(0===e&&u.zero)return u=u.zero,u.pattern;if(e<0&&u.negative?(u=u.negative,e=-e):u=u.positive,o=u.d,s=u.t,u.isFunctional)e=Oe(e,u.pattern,o);else{if(u.percentage&&(e*=100),u.abbreviate){const t=Object.keys(this.abbreviations).map(e=>parseInt(e,10)).sort((e,t)=>e-t);let r,i,o=t[0];for(a=0,n=Number(Number(e).toExponential().split("e")[1]);o<=n&&a<t.length;)a++,o=t[a];a>0&&(r=t[a-1]),r&&n>0&&r>0?i=r:(n<0&&r<0||!r)&&(o<0&&o-n<=u.maxPrecision?i=o:r<=n&&!(o>0&&-n<=u.maxPrecision)&&(i=r)),i&&(h=this.abbreviations[i],e/=10**i)}if(r=Math.abs(e),t=u.temp,l=u.numericPattern,c=l.split(o)[1],"I"===this.type&&(e=Math.round(e)),i=e,c||"#"!==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+ve*(e<0?-1:1)).toFixed(Math.min(20,c?c.length:0)).split(".")[0]);let n=l.split(o)[0];if(n+=o,e=be(n,t)||"0",c){const t=Math.max(0,Math.min(14,c.length)),n=c.replace(/#+$/,"").length;let i=("I"===this.type?0:r%1+ve).toFixed(t).slice(2).replace(/0+$/,"");for(a=i.length;a<n;a++)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)))),a=0;a<t;a++)l+="#";e=be(l,e)}e=e.replace(u.numericRegex,e=>e===s?u.groupTemp:e===o?u.decTemp:""),i<0&&!/^-/.test(e)&&(e="-".concat(e))}return u.prefix+e+d+h+u.postfix}static getStaticFormatter(){return{prepare(){},formatValue:e=>"".concat(e)}}}function Fe(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return new je(...t)}function ze(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,s,a=Object.create(null),l=Object.create(null),c=0,u=0;return o=r?function(){return s=i(...arguments),o.has(s)?o.get(s):o.set(s,e(...arguments))}:t=>(s=i(t),o.has(s)?o.get(s):o.set(s,e(t))),o.set=(e,t)=>(c>=n&&(delete a[l[u]],delete l[u],c--,u++),a[e]=t,l[c]=e,c++,t),o.get=e=>a[e],o.has=e=>e in a,o.clear=()=>{a=Object.create(null),l=Object.create(null),c=0,u=0},o.size=()=>c,o}function He(e,t,n,r,i){const o=Fe(i,e,t,n,r),s=ze(o.formatValue.bind(o),{toKey:e=>isNaN(e)?e:+e});function a(e){return s(e)}return a.format=function(e,t,n,r){return s.clear(),o.format(t,e,n,r)},a.pattern=function(e){return e&&(s.clear(),o.pattern=e,o.prepare()),o.pattern},a}const Ve={DATE:"D",TIME:"T",DATE_TIME:"TS",INTERVAL:"IV"},Be=["Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"],$e=["Mon","Tue","Wed","Thu","Fri","Sat","Sun"],We=["January","February","March","April","May","June","July","August","September","October","November","December"],Ue=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],Ye=86400;function Ke(e,t){for(let n=e.length;n<t;n++)e="0".concat(e);return e}function Xe(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"}}function Ge(e){let t=e.toString().split(".");return t[1]?(t=Number("0.".concat(t[1])),t):0}function Je(e){const t=e,n=24*Ge(t),r=60*Ge(n),i=60*Ge(r),o=1e3*Ge(i);return{d:Math.floor(t),h:Math.floor(n),m:Math.floor(r),s:Math.floor(i),f:Math.round(o)}}function Ze(e,t){let n,r=Je(e),i=r.d,o=r.h,s=r.m,a=r.s,l=r.f,c=0;/w+|t+/gi.test(t)&&(n=new Date(Date.UTC(1899,11,30+Math.floor(e),0,0,Math.round(Ye*(e-Math.floor(e))))),isNaN(n.getTime())&&(n=null)),/D+/gi.test(t)||(o+=24*i),/h+/gi.test(t)||(s+=60*o),/m+/gi.test(t)||(a+=60*s),/w+/gi.test(t)&&(c=n?n.getDay()-1:0,c<0&&(c=6));let u="";return n&&(u=n.getUTCHours()>=12?"pm":"am"),{year:0,month:0,day:c,date:i,h:o,m:s,s:a,f:l,t:u}}function Qe(e,t){return{"Y+|y+":{Y:"".concat(Number("".concat(t.year).slice(-2))),YY:Ke("".concat(t.year).slice(-2),2),YYY:Ke("".concat(t.year).slice(-3),3),def:e=>Ke("".concat(t.year),e.length)},"M+":{M:t.month+1,MM:Ke("".concat(t.month+1),2),MMM:e.locale_months_abbr[t.month],def:e.locale_months[t.month]},"W+|w+":{W:t.day,WW:Ke("".concat(t.day),2),WWW:e.locale_days_abbr[t.day],def:e.locale_days[t.day]},"D+|d+":{D:t.date,def:e=>Ke("".concat(t.date),e.length)},"h+|H+":{h:t.h,def:e=>Ke("".concat(t.h),e.length)},"m+":{m:t.m,def:e=>Ke("".concat(t.m),e.length)},"s+|S+":{s:t.s,def:e=>Ke("".concat(t.s),e.length)},"f+|F+":{def(e){let n="".concat(t.f),r=e.length-n.length;if(r>0)for(let e=0;e<r;e++)n+="0";else r<0&&(n=n.slice(0,e.length));return n}},"t{1,2}|T{1,2}":{def(e){let n=t.t;return e[0].toUpperCase()===e[0]&&(n=n.toUpperCase()),n=n.slice(0,e.length),n}}}}class et{constructor(e,t,n){const r=e||{};r.qCalendarStrings||(r.qCalendarStrings={qLongDayNames:Be,qDayNames:$e,qLongMonthNames:We,qMonthNames:Ue}),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={[Ve.TIME]:r.qTimeFmt||"hh:mm:ss",[Ve.DATE]:r.qDateFmt||"YYYY-MM-DD",[Ve.DATE_TIME]:r.qTimestampFmt||"YYYY-MM-DD hh:mm:ss"}[n]),this.pattern=t}clone(){const e=new et(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=Xe(e,n):(e<0&&(e=-e,t="-".concat(t)),r=Ze(e,t));const i=Qe(this,r),o=[];for(const e in i)Object.prototype.hasOwnProperty.call(i,e)&&o.push(e);const s=new RegExp(o.join("|"),"g"),a=t.replace(s,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});return a}}function tt(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return new et(...t)}const nt=864e5;function rt(e){return new Date(Date.UTC(1899,11,30+Math.floor(e),0,0,0,Math.round(nt*(e-Math.floor(e)))))}function it(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"TS",n=tt(arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,e,t),r=ze(n.format.bind(n),{toKey:e=>"object"==typeof e&&"function"==typeof e.getTime?e.getTime():e});function i(e){return t!==Ve.INTERVAL?rt(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=tt(i,e,t),r=ze(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 ot(e,t){if(e&&e.qNumFormat&&-1!==["D","T","TS","IV"].indexOf(e.qNumFormat.qType))return it(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",s=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,s=s&&-1===["M"].indexOf(e.qNumFormat.qType)):s=!0,(s||"U"===o)&&(n="#".concat(i,"##"),o="U"),He(n,r,i,o,t)}function st(){let e,{meta:t,id:n,key:r,localeInfo:i,fieldExtractor:o,value:s,type:a,sourceField:l}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const c=s||("dimension"===a?e=>null==e?void 0:e.qElemNo:e=>null==e?void 0:e.qValue),u=e=>(null==e?void 0:e.qText)||"",h="dimension"===a?"first":"avg",d=ot(t,i),f="dimension"===a?"first":(e,t)=>d(t),p={id:()=>n,key:()=>r,raw:()=>t,title:()=>t.qFallbackTitle||t.label,type:()=>a,origin:()=>l,items:()=>(e||(e=o(p)),e),min:()=>t.qMin,max:()=>t.qMax,value:c,label:u,reduce:h,reduceLabel:f,formatter:()=>d,tags:()=>t.qTags};return p}function at(e,t,n,r,i){return(t[e]||[]).map((t,o)=>{const s="".concat(r?"".concat(r,"/"):"").concat(e,"/").concat(o),a={instance:st(p({id:"".concat(n?"".concat(n,"/"):"").concat(s),key:s,meta:t},i))};return a.attrDims=at("qAttrDimInfo",t,n,s,p({},i,{value:e=>null==e?void 0:e.qElemNo,type:"dimension"})),a.attrExps=at("qAttrExprInfo",t,n,s,p({},i,{value:e=>null==e?void 0:e.qNum,type:"measure"})),a.measures=at("qMeasureInfo",t,n,s,p({},i,{value:e=>null==e?void 0:e.qValue,type:"measure"})),a})}function lt(){let{key:e,data:t,config:n={}}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const i={fields:[],wrappedFields:[],allFields:[],virtualFields:[]},o=t;if(!o)throw new Error('Missing "data" input');if(!o.qDimensionInfo)throw new Error('The "data" input is not recognized as a hypercube');const s=lt.util,a={cache:i,cube:o,localeInfo:n.localeInfo,fieldExtractor:null,pages:null,hierarchy:()=>null,virtualFields:n.virtualFields},l={key:()=>e,raw:()=>o,field:e=>te(e,a),fields:()=>i.fields.slice(),extract:e=>a.extractor(e,l,i,s),hierarchy:e=>a.hierarchy(e,l,i,s),_cache:()=>i};"K"===o.qMode||"T"===o.qMode||!o.qMode&&o.qNodesOnDim?(a.extractor=me,a.hierarchy=ge,a.pages="K"===o.qMode?o.qStackedDataPages:o.qTreeDataPages):"S"===o.qMode?(a.extractor=b,a.pages=o.qDataPages,a.hierarchy=ge):a.extractor=()=>[],a.fieldExtractor=e=>a.extractor({field:e},l,i,s);const c="S"===o.qMode?e=>e.qElemNumber:void 0,u="S"===o.qMode?e=>e.qNum:void 0;i.wrappedFields.push(...at("qDimensionInfo",o,e,"",p({},a,{value:c,type:"dimension"}))),i.wrappedFields.push(...at("qMeasureInfo",o,e,"",p({},a,{value:u,type:"measure"}))),i.fields=i.wrappedFields.map(e=>e.instance);const h=e=>{e.forEach(e=>{i.allFields.push(e.instance),h(e.measures),h(e.attrDims),h(e.attrExps)})};return h(i.wrappedFields),(n.virtualFields||[]).forEach(t=>{const n=l.field(t.from),o=st(r({meta:n.raw(),id:"".concat(e,"/").concat(t.key),sourceField:n,fieldExtractor:e=>a.extractor({field:e},l,i,s),key:t.key,type:n.type(),localeInfo:a.localeInfo,value:n.value},t.override||{}));i.virtualFields.push(o)}),i.allFields.push(...i.virtualFields),l}const ct=[["qHyperCube","qHyperCubeDef"],["qTreeData","qTreeDataDef"],["qDimensionInfo","qDimensions"],["qMeasureInfo","qMeasures"],["qAttrDimInfo","qAttributeDimensions"],["qAttrExprInfo","qAttributeExpressions"]],ut=/\/qDimensionInfo(?:\/(\d+))?/,ht=/\/qMeasureInfo\/(\d+)/,dt=/\/qAttrDimInfo\/(\d+)(?:\/(\d+))?/,ft=/\/qAttrExprInfo\/(\d+)/,pt=/\/?qHyperCube/,gt=/\/?qTreeData/,mt=e=>"".concat(e.substr(0,e.indexOf("/qHyperCubeDef")+14)),yt=e=>"".concat(e.substr(0,e.indexOf("/qTreeDataDef")+13));function bt(e,t){let n=e,r=-1,i=-1,o="",s=e=>e;pt.test(e)?(o="".concat(n.substr(0,n.indexOf("qHyperCube")+10)),s=mt):gt.test(e)&&(o="".concat(n.substr(0,n.indexOf("qTreeData")+9)),s=yt);let a=!0;if(ut.test(e)&&(r=+ut.exec(e)[1]),ht.test(e)&&(i=+ht.exec(e)[1]),dt.test(e)){i=-1,r=0;const e=+dt.exec(n)[2];isNaN(e)||(r=e,n=n.replace(/\/\d+$/,"")),a=!1}if(ft.test(e)){const e=i;if(t){i=0;const s=Z(o,t);i+=(s.qMeasureInfo||[]).length,r>-1?(i=s.qDimensionInfo.slice(0,r).reduce((e,t)=>e+t.qAttrExprInfo.length,i),r=-1):(i=s.qDimensionInfo.reduce((e,t)=>e+t.qAttrExprInfo.length,i),i=s.qMeasureInfo.slice(0,e).reduce((e,t)=>e+t.qAttrExprInfo.length,i)),i+=+ft.exec(n)[1]}else r>-1?(r=-1,i=+ft.exec(n)[1]):i+=+ft.exec(n)[1]+1}return ct.forEach(e=>{let[t,r]=e;n=n.replace(t,r)}),a&&(n=s(n)),n&&"/"!==n[0]&&(n="/".concat(n)),{measureIdx:i,dimensionIdx:r,path:n}}function vt(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=[],s={},a=e.isActive();let l=!1;return e.brushes().forEach(e=>{const t=bt(e.id,n);if("range"===e.type&&t.measureIdx>-1&&t.dimensionIdx>-1){const n=e.brush.ranges();n.length&&(l=!0,s.multiRangeSelectTreeDataValues||(s.multiRangeSelectTreeDataValues={path:t.path,ranges:[]}),n.forEach(e=>s.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,s.rangeSelectHyperCubeValues||(s.rangeSelectHyperCubeValues={path:t.path,ranges:[]}),n.forEach(e=>s.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,s.selectHyperCubeContinuousRange||(s.selectHyperCubeContinuousRange={path:t.path,ranges:[]}),n.forEach(e=>s.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,a=r.qEffectiveInterColumnSortOrder.indexOf(t.dimensionIdx);if(s.selectPivotCells||(s.selectPivotCells={path:t.path,cells:[]}),e.id===i||!i){const n=e.brush.values().map(e=>+e).filter(e=>!isNaN(e));(0===o||a>=o)&&o>-1?n.forEach(e=>{s.selectPivotCells.cells.push({qType:"T",qCol:e,qRow:a-o})}):n.forEach(e=>{s.selectPivotCells.cells.push({qType:"L",qCol:t.dimensionIdx,qRow:e})}),l=!!s.selectPivotCells.cells.length}}else s.selectHyperCubeCells||(s.selectHyperCubeCells={path:t.path,cols:[]}),s.selectHyperCubeCells.cols.push(t.dimensionIdx),e.id!==i&&(i||s.selectHyperCubeCells.values)||(s.selectHyperCubeCells.values=e.brush.values().map(e=>+e).filter(e=>!isNaN(e)),l=!!s.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&&a?[{method:"resetMadeSelections",params:[]}]:(s.rangeSelectHyperCubeValues&&o.push({method:"rangeSelectHyperCubeValues",params:[s.rangeSelectHyperCubeValues.path,s.rangeSelectHyperCubeValues.ranges,[],null===(c=t.orMode)||void 0===c||c]}),s.selectHyperCubeContinuousRange&&o.push({method:"selectHyperCubeContinuousRange",params:[s.selectHyperCubeContinuousRange.path,s.selectHyperCubeContinuousRange.ranges]}),s.selectHyperCubeCells&&o.push({method:"selectHyperCubeCells",params:[s.selectHyperCubeCells.path,s.selectHyperCubeCells.values,s.selectHyperCubeCells.cols]}),s.selectPivotCells&&o.push({method:"selectPivotCells",params:[s.selectPivotCells.path,s.selectPivotCells.cells]}),s.multiRangeSelectTreeDataValues&&o.push({method:"multiRangeSelectTreeDataValues",params:[s.multiRangeSelectTreeDataValues.path,s.multiRangeSelectTreeDataValues.ranges]}),o);var c}function xt(e){lt.util=e.data("matrix").util,e.data("q",lt),e.formatter("q-number",He),e.formatter("q-time",it)}return xt.qBrushHelper=vt,xt.selections=vt,xt}()}(Ex)),Ex.exports),Tx=n(Ax);const Nx={brushInterceptors:{DIM_VALUE_NULL:-2,DIM_VALUE_TOTAL:-3,brushOnlyOne:function(e,t){const n=e.brushes().filter(e=>"value"===e.type);let r=[];n.length&&n.forEach(e=>{r=r.concat(e.brush.values().map(t=>({key:e.id,value:t})))});return r.concat(t)},filterValues:function(e,t){const n=this;let r,i;const o=[];let s=0;const a=[];return t.forEach(t=>{t.value!==n.DIM_VALUE_NULL&&t.value!==n.DIM_VALUE_TOTAL&&(i=function(e,t){const n=t.key.indexOf("qHyperCube")+10,r=t.key.substr(0,n),i=t.key.substr(n+1);return e.dataset(r).field(i)}(e,t),r=i&&i.raw(),r.qLocked?(o.push(r),s++):a.push({key:t.key,value:t.value}))}),{items:a,itemsAreLocked:s>0&&s===t.length,lockedFields:o}}}};const Ox={data:["elemNo"],contexts:["select"],startOnEmptySelection:!0,style:{active:{strokeWidth:2,stroke:"#333"},inactive:{opacity:.3}}};function Rx(e){if(!e||!e.chartInstance||!e.selectionsApi)throw Error("Selections-handler: Missing input");const t=e.chartInstance,n=e.selectionsApi,r=e.dataPaths||[""],i=e.selectPaths,o=e.lasso;let s=[];const a={propertiesToRestore:{}};let l=!1;const c=function(e,t,n){function r(){}return r.update=function(e,r,i){t.isActive()||t.begin(n),Tx.qBrushHelper(i).forEach(e=>{t.select(e)})},r.toggleValues=function(r,i,o){const s=Nx.brushInterceptors.filterValues(e,r),a=s.items;return t.isActive()||s.itemsAreLocked||!(o||a.length>0)||(t.begin(n),i.start(),i.emit("update",[],[])),a},r}(t,n,i),u={};let h=!1;function d(e){16===e.keyCode&&e.shiftKey!==h&&(h=e.shiftKey,o.toggle())}function f(e){const t=e.keyCode;27===t?n.cancel():13===t&&n.confirm()}function p(){s.forEach(e=>{e.listeners.update=function(t,n){e.sleep||c.update(t,n,e.brush)},e.brush.on("update",e.listeners.update),e.brush.on("start",e.listeners.start)})}function g(){s.forEach(e=>{e.brush.removeListener("update",e.listeners.update),e.brush.removeListener("start",e.listeners.start)})}return n.on("cleared",()=>{s.forEach(e=>{e.brush.clear(),e.dependentComponents.forEach(e=>{const n=t.component(e.id);n&&n.emit(e.clear)})})}),u.setUp=function(e){u.tearDown();const t=this.setUpBrush(e);return l&&p(),t},u.setUpBrush=function(e){const n=Db(!0,{},Ox,e),i={on:"tap",action:t=>t.ctrlKey||e.isSingleSelect?"set":"toggle",contexts:n.contexts,data:n.data,globalPropagation:"stop"},o={context:n.contexts[0],data:n.data,style:n.style},a=function(e,t){return{brush:t.brush(e.contexts[0]),listeners:{},dependentComponents:[],id:e.contexts[0]}}(n,t);return a.listeners.toggle=function(e){if(!l)return[];const i=function(){const e=[];let n=r.map(e=>t.dataset(e).fields().filter(e=>"dimension"===e.type()));n=[].concat.apply([],n);for(let t=0;t<n.length;t++)n[t].raw().qLocked&&e.push(n[t].raw());return{fields:e,areAllFieldsLocked:e.length&&e.length===n.length}}();return n.startOnEmptySelection&&0===e.length&&i.areAllFieldsLocked?[]:c.toggleValues(e,a.brush,n.startOnEmptySelection)},a.brush.intercept("toggle-values",a.listeners.toggle),a.brush.intercept("add-values",a.listeners.toggle),a.brush.intercept("remove-values",a.listeners.toggle),a.brush.intercept("set-values",a.listeners.toggle),a.listeners.start=function(){s.length>1&&s.forEach(e=>{e!==a&&e.brush.end()})},s.push(a),{trigger:i,consume:o}},u.setUpStart=function(){u.tearDown()},u.setUpDone=function(){l&&p()},u.tearDown=function(){l&&g(),s.forEach(e=>{e.brush.removeInterceptor("toggle-values",e.listeners.toggle),e.brush.removeInterceptor("add-values",e.listeners.toggle),e.brush.removeInterceptor("remove-values",e.listeners.toggle),e.brush.removeInterceptor("set-values",e.listeners.toggle)}),s=[]},u.pauseEngineCalls=function(e){s.forEach(t=>{t.id===e&&(t.sleep=!0)})},u.resumeEngineCalls=function(e,t){s.forEach(n=>{n.id===e&&(n.sleep=!1,t&&n.listeners.update([],[]))})},u.addComponent=function(e,t){s.forEach(n=>{n.id===e&&n.dependentComponents.push(t)})},u.on=function(){if(l)return;l=!0,p(),document.addEventListener("keydown",d),document.addEventListener("keyup",d);const e=()=>{s.forEach(e=>{e.brush.end()}),document.removeEventListener("keyup",f),o.active()&&o.toggle()};n.on("deactivated",e),a.unbindDeactivated=()=>{n.removeListener("deactivated",e)};const t=()=>{document.addEventListener("keyup",f)};n.on("activated",t),a.unbindActivated=()=>{n.removeListener("activated",t)}},u.isOn=()=>l,u.off=function(){l&&(l=!1,g(),document.removeEventListener("keydown",d),document.removeEventListener("keyup",d),document.removeEventListener("keyup",f),a.unbindActivated(),a.unbindDeactivated())},u.lassoState=function(){return o.active()&&!(e.isLassoDisabled&&e.isLassoDisabled())},u.allFieldsLocked=function(){return function(){let e=r.map(e=>t.dataset(e).fields().filter(e=>"dimension"===e.type()));return e=[].concat.apply([],e),e.length&&e.every(e=>e.raw().qLocked)}()},u}class Ix{isOn(){return!1}on(){console.warn("Can not turn on selections on this object")}off(){}}var Px={create:e=>e.selectionsApi?Rx(e):new Ix};function Lx(e,t,n,r,i){let o=!1;r=r||"tooltip",n=n||["self"];const s=e.brush(r),a={};function l(){if(o){e.component(i).emit("hide")}o=!1}return a.isOpen=function(){return o},a.closeTooltip=l,a.update=function(){const a=s.brushes(),c=e.getAffectedShapes(r,"and",n,t);a.length>=1?(o=!0,function(t){o=!0;const n={nodes:t};e.component(i).emit("show",{},n)}(c)):l()},a.toggleInterceptor=function(e){if(n.length>1){const t={},n=[];return e.forEach(e=>{t[e.key]||(t[e.key]={}),t[e.key][e.value]||(t[e.key][e.value]=!0,n.push(e))}),n}return e},a}var jx={create:(...e)=>Lx(...e)},Fx={formatMeasureValue:function(e,t){if(e.raw().isCustomFormatted)return e.formatter()(t.value.qText);const n=void 0!==t.value.qNum?t.value.qNum:t.value.qValue;return e.formatter()(n)}};const zx=e=>({h:t,data:n,style:r})=>{const i=function(e,t){const n=e.chartInstance.dataset(e.dataPath),r=[],i=t.length-5,o=Math.min(5,t.length);for(let i=0;i<o;i++){const o=t[i],s={rows:[]};if(e.labelData){const t=[],i=e.labelData;let a=!1;for(let e=0;e<i.length;e++){const n=o.data[i[e]].value;if(-2===n.qElemNo||-2===n.qElemNumber){a=!0;break}t.push(o.data[i[e]].value.qText)}if(a)return;s.header=e.headerResolver(t),s.rows=e.measureRows.map(t=>{const r=o.data;return e.rowResolver(n.field(r[t].source.field),r[t],r)}).filter(e=>!!e);const l=Hx(e,o);l&&s.rows.unshift(l),r.push(s)}}i>0&&(r.numberInExcess=i);return r.rowCount=r[0]?r.length*r[0].rows.length:0,r}(e,n),o={h:t,style:r,rtl:"rtl"===e.direction,translator:e.translator};return e.renderer(o,i)};function Hx(e,t){const n=t.data.color,r=e.colorService?.getSettings?.();if(!r||"color"===r.type||!n||!r.fieldType)return;const i=[];e.data.forEach(e=>{const n=t.data[e];n&&i.push(n.value)});const o=function(e){let t=-1;for(let n=0;n<e.length;n++)-3===e[n]&&(t=n);return t}(i),{translator:s}=e,a=r.label,l=t.attrs?.fill;return{color:l,label:a,value:-1!==o?s.get("properties.dimensionLimits.others"):n.label}}const Vx="dist-flow-tooltip",Bx=`#${Vx}`;function $x(){if(!document.querySelector(Bx)){const e=document.createElement("div");e.id=Vx,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 Wx({key:e="tooltip",rtl:t,fontFamily:n,filter:r,content:i}){return{show:!0,key:e,type:"tooltip",layout:{displayOrder:3},beforeMount(){$x()},beforeUpdate(){$x()},destroyed(){!function(){const e=document.querySelector(Bx);e&&e.parentElement&&e.childElementCount<1&&e.parentElement.removeChild(e)}()},settings:{appendTo:()=>document.querySelector(Bx),content:i,filter:r,extract:e=>e.node,direction:t?"rtl":"ltr",placement:"bounds"},style:{arrow:{color:"#404040"},content:{display:"table","border-spacing":"4px",background:"rgba(64, 64, 64, 0.9)",opacity:"1",fontSize:"13px",fontFamily:n,"empty-cells":"show"},cell:{"max-width":"180px","word-break":"break-word","word-wrap":"break-word","overflow-wrap":"break-word",hyphens:"auto"}}}}const{detectTextDirection:Ux}=rx;const Yx={tooltipKey:"tooltip",data:[""],contexts:["tooltip"],headerResolver:e=>e.join(", "),rowResolver:(e,t)=>({value:Fx.formatMeasureValue(e,t),label:e.title()}),direction:"ltr",renderer:function(e,t){const{h:n,style:r,translator:i,rtl:o}=e,s=[],a=o?"right":"left";if(t.forEach(e=>{if(e.header){const t={...r.cell,textAlign:a,fontWeight:"bold",direction:Ux(e.header)};s.push(n("tr",null,n("td",{style:t,colSpan:2},e.header)))}e.rows.forEach(e=>{let t=e.value;if(e.color){const r={display:"inline-block",width:10,height:10,"background-color":e.color,margin:"0 8px"},i=n("div",{style:r});t=o?[e.value,i]:[i,e.value]}const i=o?[":",e.label]:[e.label,":"],l={...r.cell,textAlign:a,direction:Ux(e.label)},c={...r.cell,textAlign:o?"left":"right",direction:Ux(e.value)};s.push(n("tr",null,n("td",{style:l},i),n("td",{style:c},t)))})}),t.numberInExcess){const e=i.get("Object.ChartTooltip.NMore",t.numberInExcess),o={...r.cell,textAlign:a,direction:Ux(e)};s.push(n("tr",null,n("td",{style:o,colSpan:2},e)))}return s}};function Kx(e,t,n){if(!e)throw Error("Tooltips-handler: Missing input");let r={},i=!1;const o={};function s(e){e.listeners.update=function(t,n){e.action.update(t,n,e)},e.listeners.end=function(){e.action.closeTooltip()},e.brush.on(e.treatAsDesktop?"update":"set-values",e.listeners.update),e.brush.on("end",e.listeners.end),e.brush.intercept("set-values",e.action.toggleInterceptor)}function a(){Object.keys(r).forEach(e=>{l(r[e])})}function l(e){e.brush.removeListener(e.treatAsDesktop?"update":"set-values",e.listeners.update),e.brush.removeListener("end",e.listeners.end),e.brush.removeInterceptor("set-values",e.action.toggleInterceptor)}function c(){Object.keys(r).forEach(e=>{r[e].action.closeTooltip()})}function u(){c();for(const e in r)r[e].brush.clear()}return o.setUp=function(t){const o=Db(!0,{},Yx,t);if(!o.componentKey)throw Error("Tooltips-handler.setUp: Missing required input");r[o.contexts[0]]&&i&&l(r[o.contexts[0]]);const a=function(e,t){return{brush:t.brush(e.contexts[0]),action:jx.create(t,e.componentKey,e.data,e.contexts[0],e.tooltipKey),listeners:{},chartInstance:t,dataPath:e.dataPath,renderer:e.renderer,data:e.data,headerResolver:e.headerResolver,rowResolver:e.rowResolver,colorService:e.colorService,attrDimPath:e.attrDimPath,measureRows:e.measureRows,labelData:e.labelData,filterShapes:e.filterShapes,direction:e.environment.options.direction,theme:e.environment.theme,translator:e.environment.translator,treatAsDesktop:"touch"!==e.environment.deviceType}}(o,e);r[o.contexts[0]]=a,i&&s(a);const c=Wx({key:o.tooltipKey,rtl:"rtl"===a.direction,fontFamily:a.theme.getStyle(n,"tooltip","fontFamily"),filter:(u=a.filterShapes,e=>u?u(e):function(e){const t=[];return e.forEach(e=>{-1===t.indexOf(e)&&"container"!==e.type&&t.push(e)}),t}(e)),content:zx(a,o.dataPath)});var u;return o.chartBuilder.getSettings().components.push(c),{trigger:{on:a.treatAsDesktop?"over":"tap",action:"set",contexts:o.contexts,data:o.data,globalPropagation:"stop"},consume:o.contexts.map(e=>({context:e})),component:c}},o.tearDown=function(){i&&a(),r=[]},o.closeTooltip=c,o.isOn=()=>i,o.on=function(){i||(i=!0,Object.keys(r).forEach(e=>{s(r[e])}),t&&t.on("mouseleave",u))},o.off=function(){i&&(i=!1,a(),t&&t.off("mouseleave",u),c())},o}var Xx={create:(e,t,n)=>Kx(e,t,n)};const Gx={generateHash:function(e){return function(e){let t=0;if(!e||!e.length)return t;for(let n=0;n<e.length;n++)t=(t<<5)-t+e.charCodeAt(n),t&=t;return t}(JSON.stringify(e))},updateHash:function(e,t){e.qUndoExclude||(e.qUndoExclude={});e.qUndoExclude.hashCode=Gx.generateHash(t)}};const Jx={getDefaultHashDataForHyperCube:function(e,t,n){return function(e,t){const n=[];if(!e.qMeasures)return Promise.resolve(n);return e.qMeasures.forEach(e=>{e.qLibraryId?n.push(function(e,t){return t.getMeasure(e).then(e=>e.getProperties().then(e=>e.qMeasure.qDef))}(e.qLibraryId,t)):n.push(Promise.resolve())}),Promise.all(n)}(e,n).then(e=>({drillLevel:Qx(t),dimensionExpressions:Zx(t),measureExpressions:e}))}};function Zx(e){return e.qDimensionInfo.map(e=>e.qGroupFieldDefs)}function Qx(e){const t=function(e){return zv(e,"qDimensionInfo",[])}(e);return t.map(e=>e.qGroupPos)}const ew={},tw=Db.bind(null,!0);function nw(e){return null!=e&&!Array.isArray(e)&&"object"==typeof e}const rw=Array.isArray,iw=function(e){return void 0===e};function ow(e,t){return function(e){return"function"==typeof e}(e[t])||"$$"===t.substring(0,2)||"_"===t.substring(0,1)}function sw(e,t){const n=t.substring(1).split("/").slice(0,-1);let r;return n.forEach((t,i)=>{i!==n.length&&(r=+t,e[r||t]=iw(e[r||t])?Number.isNaN(+r)?{}:[]:e[t],e=e[r||t])}),e}function aw(e,t){if(nw(e)&&nw(t)){if(Object.keys(e).length!==Object.keys(t).length)return!1;for(const n of Object.keys(e))if(!aw(e[n],t[n]))return!1;return!0}if(rw(e)&&rw(t)){if(e.length!==t.length)return!1;for(let n=0,r=e.length;n<r;n++)if(!aw(e[n],t[n]))return!1;return!0}return e===t}ew.generate=function(e,t,n){n=n||"";let r=[];return Object.keys(t).forEach(i=>{const o=function(e){return e&&(e=tw({},{val:e}).val),e}(t[i]),s=e[i],a=`${n}/${i}`;aw(o,s)||ow(t,i)||(iw(s)?r.push({op:"add",path:a,value:o}):nw(o)&&nw(s)?r=r.concat(ew.generate(s,o,a)):rw(o)&&rw(s)?r=r.concat(function(e,t,n){let r=[];const i=e.slice();let o,s,a=-1;function l(e,t,n){if(e[n]&&iw(e[n].qInfo))return null;if(e[n]&&e[n].qInfo.qId===t)return n;for(let n=0,r=e.length;n<r;n++)if(e[n]&&e[n].qInfo.qId===t)return n;return-1}if(aw(t,i))return r;if(null===t[0]||!iw(t[0])&&iw(t[0].qInfo))return r.push({op:"replace",path:n,value:t}),r;for(o=i.length-1;o>=0;--o)a=l(t,i[o]&&i[o].qInfo&&i[o].qInfo.qId,o),-1===a?(r.push({op:"remove",path:`${n}/${o}`}),i.splice(o,1)):r=r.concat(ew.generate(i[o],t[a],`${n}/${o}`));for(o=0,s=t.length;o<s;++o)a=l(i,t[o]&&t[o].qInfo&&t[o].qInfo.qId),-1===a?(r.push({op:"add",path:`${n}/${o}`,value:t[o]}),i.splice(o,0,t[o])):a!==o&&(r.push({op:"move",path:`${n}/${o}`,from:`${n}/${a}`}),i.splice(o,0,i.splice(a,1)[0]));return r}(s,o,a)):r.push({op:"replace",path:`${n}/${i}`,value:o}))}),Object.keys(e).forEach(i=>{iw(t[i])&&!ow(e,i)&&r.push({op:"remove",path:`${n}/${i}`})}),r},ew.apply=function(e,t){t.forEach(t=>{const n=sw(e,t.path);let r=t.path.split("/").splice(-1)[0];const i=r&&Number.isNaN(+r)?n[r]:n[+r]||n,o=t.from?t.from.split("/").splice(-1)[0]:null;if("add"===t.op||"replace"===t.op)if(rw(n))"-"===r&&(r=n.length),n.splice(+r,"add"===t.op?0:1,t.value);else if(rw(i)&&rw(t.value)){const e=t.value.slice();i.length=0,i.push.apply(i,e)}else nw(i)&&nw(t.value)?(s=i,Object.keys(s).forEach(e=>{Object.getOwnPropertyDescriptor(s,e).configurable&&!ow(s,e)&&delete s[e]}),tw(i,t.value)):n[r]=t.value;else if("move"===t.op){const i=sw(e,t.from);rw(n)?n.splice(+r,0,i.splice(+o,1)[0]):(n[r]=i[o],delete i[o])}else"remove"===t.op&&(rw(n)?n.splice(+r,1):delete n[r]);var s})},ew.clone=function(e){return tw({},e)},ew.createPatch=function(e,t,n){const r={op:e.toLowerCase(),path:n};return"move"===r.op?r.from=t:void 0!==t&&(r.value=t),r},ew.updateObject=function(e,t){Object.keys(e).length?ew.apply(e,ew.generate(e,t)):tw(e,t)};class lw{constructor(e){this._model=e}setModel(e){this._model=e}saveSoftProperties(e,t){if(!this._model)return Promise.resolve(!1);let n=ew.generate(e,t);return Db(!0,e,t),n&&n.length?(n=n.map(e=>({qOp:e.op,qValue:JSON.stringify(e.value),qPath:e.path})),this._model.applyPatches(n,!0).then(()=>!0)):Promise.resolve(!1)}async mergeSoftPatches(){if(!this._model)return;const e=this._model.getProperties(),t=this._model.getEffectiveProperties(),n=await e,r=await t;if(n.qExtendsId)return;const i=ew.generate(n,r);ew.apply(n,i);const o=this;o._model.setProperties(n).then(()=>{o._model.clearSoftPatches()})}}var cw={canModifyHardProperties:function(e){if(e.qHasSoftPatches||e.qExtendsId)return!1;if(e.permissions)return e.permissions.update;return-1!==e.qMeta.privileges.indexOf("update")}};var uw={saveDerivedProperties:function(e,t,n,r){if(cw.canModifyHardProperties(t))return e.setProperties(n);return new lw(e).saveSoftProperties(r,n)}};var hw={validate:function(e){if(!(e&&e.layout&&e.properties&&e.model&&e.hashData&&e.generateDerivedProperties))throw Error("Derived-properties: Missing input")}};function dw(){this._generationInProgress=!1}function fw(e){hw.validate(e);const t=e.properties,n=Gx.generateHash(e.hashData);return!(!t.qUndoExclude||t.qUndoExclude.hashCode!==n)}dw.prototype.isDerivedUpToDate=fw,dw.prototype.updateDerivedProperties=function(e){if(hw.validate(e),this._generationInProgress)return Promise.resolve(!0);if(fw(e)){const t=e.layout.qUndoExclude&&e.layout.qUndoExclude.hashCode===e.properties.qUndoExclude.hashCode;return Promise.resolve(!t)}const t=this,n=e.model,r=e.layout,i=Db(!0,{},e.properties),o=Db(!0,{},i);return this._generationInProgress=!0,Gx.updateHash(i,e.hashData),e.generateDerivedProperties(r,i).then(()=>uw.saveDerivedProperties(n,r,i,o).then(()=>(t._generationInProgress=!1,Promise.resolve(!0))))},dw.prototype.addDefaultHyperCubeHash=function(e,t,n,r){return Jx.getDefaultHashDataForHyperCube(e,t,n).then(e=>Db(!0,r,e))};const pw={wrapExpression:function(e){const t=e.replace(/\]/g,"]]");return t?`[${t}]`:""}};const gw={replaceExpressionTokens:function(e,t,n){const r={start:n&&n.start||"{{",end:n&&n.end||"}}"};let i,o,s=e;for(const e in t)i=t[e],o=r.start+e+r.end,s=s.replace(mw(o,!0),i);return s},createRegExp:mw};function mw(e,t,n){const r=e.replace(/[-[\]/{}()*+?.\\^$|]/g,"\\$&");const i=n?`(${r})`:r;return t?new RegExp(i,"g"):new RegExp(i)}const yw={generateExpression:function(e,t){const n={};if(t)for(const e in t){const r=t[e],i=r.wrap?pw.wrapExpression(r.value):r.value;n[e]=i;(r.variations||[]).forEach(t=>{const r=bw(t,i,e);n[t]=r})}return gw.replaceExpressionTokens(e,n)}};function bw(e,t,n){if(""===t)return"";const r=gw.createRegExp(n,!0,!0),i=e.split(r);let o="";return i.forEach(e=>{o+=e!==n?e:t}),o}const vw={generateHyperCubeDef:function(e,t,n,r,i){return function(e,t,n,r){const i={};let o,s;const a=[];let l;e.forEach(e=>{o=qw(e.match(kw("Dim"))),o.forEach(e=>{a.push(xw(t.qDimensions[e],r,e,n).then(t=>{i[`Dim[${e}]`]={value:t,wrap:!0}}))}),s=qw(e.match(kw("Mea"))),s.forEach(e=>{a.push(ww(t.qMeasures[e],r).then(t=>{i[`Mea[${e}]`]={value:t}}))})}),l=a.length?Promise.all(a).then(()=>Promise.resolve(i)):Promise.resolve(i);return l}(e.dimensions.concat(e.measures),t,n,r).then(n=>{const r=Db({},n,i),o=Db(!0,{},t);return o.qDimensions=[],o.qMeasures=[],e.dimensions.forEach(e=>{o.qDimensions.push({qDef:{qFieldDefs:[`=${yw.generateExpression(e,r)}`]}})}),e.measures.forEach(e=>{o.qMeasures.push({qDef:{qDef:yw.generateExpression(e,r)}})}),o})},getAllHyperCubeExpressions:async function(e,t,n){const r=e.qDimensions.map((e,r)=>xw(e,n,r,t)),i=e.qMeasures.map(e=>ww(e,n));return{dimensions:await Promise.all(r),measures:await Promise.all(i)}}};function xw(e,t,n,r){if(e.qLibraryId)return Mw(e.qLibraryId,"dimension",t,n,r);const i=r.qDimensionInfo[n].qGroupPos;return Promise.resolve(e.qDef.qFieldDefs[i])}async function ww(e,t){return function(e){const t=e.lastIndexOf("//"),n=e.lastIndexOf("\n");if(t>n)return`${e}\n`;return e}(e.qLibraryId?Mw(e.qLibraryId,"measure",t):e.qDef.qDef)}function Mw(e,t,n,r,i){if(!n)return console.warn("No app provided, returning library id"),e;return n["dimension"===t?"getDimension":"getMeasure"](e).then(e=>e.getProperties().then(e=>"dimension"===t?e.qDim.qFieldDefs[i.qDimensionInfo[r].qGroupPos]:e.qMeasure.qDef))}function kw(e){return new RegExp(`\\{\\{${e}\\[\\d\\]\\}\\}`,"g")}function qw(e){return e?e.map(e=>e.substr(6,1)):[]}function Sw(e){return!Number.isNaN(parseFloat(e))&&Number.isFinite(+e)}function _w(e){return!Number.isNaN(parseInt(e,10))&&parseFloat(e,10)===parseInt(e,10)}const Dw={getBinSize:function(e){return nb(e,"bins.binSize",_m.BIN_SIZE)},getDerivedBinSize:function(e){return nb(e,"qUndoExclude.bins.binSize",_m.BIN_SIZE)},getDerivedBinOffset:function(e){return nb(e,"qUndoExclude.bins.offset",_m.OFFSET)},getDerivedBinCount:function(e){const t=nb(e,"qUndoExclude.bins.binCount",_m.BIN_COUNT);return Sw(t)?t<1?1:_w(t)?t:Math.ceil(t):_m.BIN_COUNT},getBinCount:function(e){return nb(e,"bins.binCount",void 0)},getBinOffset:function(e){return nb(e,"bins.offset",_m.OFFSET)},isAutoBin:function(e){return nb(e,"bins.auto",_m.AUTO)},isCountDistinct:function(e){return nb(e,"bins.countDistinct",_m.COUNT_DISTINCT)},getBinMode:function(e){return nb(e,"bins.binMode",_m.BIN_MODE)},isEmpty:function(e){return null==e||""===e}},Cw=Math.log(10),Ew=[1,1.5,2,3,4,5,6,10],Aw=[1,2,4,5,6,8,10],Tw=[2,4,5,10];function Nw(e,t){if(0===e)return 0;let n;const r=Math.floor(Math.log(Math.abs(e))/Cw),i=e/10**r;for(let e=0;e<t.length;e++)if(i<=t[e]){n=t[e];break}return(r>=0?n*10**r:n/10**-r)*(e<0?-1:1)}function Ow(e,t,n,r,i,o){return Math.floor(Math.abs(e-i)/r)+Math.floor(Math.abs(o-t)/r)}const Rw={calculateBinSize:function(e,t,n){return function(e,t,n){if(!Sw(e)||!Sw(t)||!Sw(n))throw Error("binSizeCalculator: One of the inputs is NOT numeric");if(e>t)throw Error("binSizeCalculator: The 'min' parameter is bigger than the 'max' parameter")}(e,t,n),function(e,t,n){let r,i,o,s,a,l,c,u,h,d,f,p,g=-1,m=Ew;if(n=Math.max(1,n),t===e)if(0===t){if(s=1,1===n)return{min:e,max:t,nbrOfBins:n,rawBinSize:o/n,offset:-.5,newMax:.5,binSize:1,numEmptyBins:0}}else 1===n?(s=t+1e-9,m=Aw):s=Math.abs(t/n);else o=(t+=1e-9)-e,s=o/n;do{if(u=1,f=0,g>=0)for(h=1/Tw[g],d=1,m=[];d<=10;)m.push(Math.round(1e3*d)/1e3),d+=h;a=s;do{a=Nw(a*u,m),l=Math.floor(Math.log(a)/Cw),c=10**l,i=t===e?(Math.ceil(t/a)+Math.floor(n/2))*a:Math.ceil(t/a)*a,r=i-n*a;let o=0;for(p=c;(r>e||i<t)&&o<Tw.length;)r=Math.floor(e/p)*p,i=r+n*a,p=c/Tw[o++];l<1&&(c=10**(Math.abs(l)+1),i=Math.round(i*c)/c,r=Math.round(r*c)/c),u=1.1,f++}while((r>e||i<t)&&f<10);g++}while(Ow(e,t,0,s,r,i)>0&&g<Tw.length);return{binCount:n,offset:r,binSize:a}}(e,t,n=function(e){return e<1?1:_w(e)?e:Math.ceil(e)}(n))}};const Iw={getMappingValues:function(e){const t=Dw.isAutoBin(e),n=Dw.getBinMode(e);let r,i,o,s;const a=Dw.isCountDistinct(e);return t||"maxCount"===n?(s=function(e){const t=nb(e,"qHyperCube.qDimensionInfo.0",{});let n=t.qMin,r=t.qMax;n=Sw(n)?n:1,r=Sw(r)?r:1;const i=Dw.getDerivedBinCount(e);return Rw.calculateBinSize(n,r,i)}(e),r=s.binSize,i=s.offset,o=s.binCount):(r=Dw.getBinSize(e),i=Dw.getBinOffset(e)),{binSize:r,binOffset:i,binCount:o,distinct:a}},getMappings:function(e){const t={};return t.BinSize={value:`,${e.binSize}`},t.Label={value:0===e.binOffset?"":",'x'"},t.Offset={value:0===e.binOffset?"":`,${e.binOffset}`},t.Distinct={value:e.distinct?"Distinct ":""},t}};const Pw={generateHyperCubes:async function(e,t,n){const{app:r,translator:i}=n,o=Iw.getMappingValues(e),s=Iw.getMappings(o),a=vw.getAllHyperCubeExpressions(t.qHyperCubeDef,e.qHyperCube,r),l=vw.generateHyperCubeDef({dimensions:["Class(aggr({{Dim[0]}},{{Dim[0]}}){{BinSize}}{{Label}}{{Offset}})"],measures:["Count({{Distinct}}{{Dim[0]}})"]},t.qHyperCubeDef,e.qHyperCube,r,s),c=await a,u=await l;let h;h=Dw.isAutoBin(e)?{qValueExpression:{qExpr:yw.generateExpression("=Ceil(Log10(Count({{Dim[0]}})) / Log10(2)) + 1",{"Dim[0]":{value:c.dimensions[0],wrap:!0}})}}:"maxCount"===Dw.getBinMode(e)&&Dw.isEmpty(t.bins.binCount)?Dw.getDerivedBinCount(e):t.bins.binCount,ob(u,"qDimensions.0.qDef.qSortCriterias",[{qSortByNumeric:1}]),ob(u,"qDimensions.0.qDef.qFieldLabels",[e.qHyperCube.qDimensionInfo[0].qFallbackTitle]),ob(u,"qMeasures.0.qDef.qLabel",e.measureAxis.label||i.get("Visualization.Histogram.MeasureAxisLabel")),ob(t,"qUndoExclude.box.qHyperCubeDef",u),ob(t,"qUndoExclude.bins.binSize",o.binSize),ob(t,"qUndoExclude.bins.offset",o.binOffset),ob(t,"qUndoExclude.bins.binCount",h)}};var Lw={isOnComponentForRange:function(e,t,n){return!!e&&!!n.chart.componentsFromPoint({x:e.center.x,y:e.center.y}).filter(e=>-1!==t.indexOf(e.settings.key))[0]},isOnComponentForLasso:function(e,t,n){return e&&n.chart.componentsFromPoint({x:e.center.x,y:e.center.y}).filter(e=>e.settings.key===t.keys.componentKey)[0]},isOnComponentForNavBtn:function(e,t,n){return n.chart.componentsFromPoint(e.center).some(e=>e.settings.key===t)}};var jw={callLassoGesture:function(e,t,n){return{type:"Pan",options:{direction:ym.DIRECTION_ALL,threshold:1,enable(r,i){if(e.lassoing)return t.isSelectionEnabled();const o=Lw.isOnComponentForLasso(i,n,this);return t.isSelectionEnabled()&&i&&((s=n.handlers).selectionHandler.lassoState()&&!s.selectionHandler.allFieldsLocked()||e.lassoing)&&o;var s},event:"lasso"},recognizeWith:n.handlers.scrollHandler?"drag":null,events:{lassostart(r){Lw.isOnComponentForLasso(r,n,this)&&(t.switchTo("lasso",this.chart,r),e.lassoing=!0,n.handlers.selectionHandler.pauseEngineCalls(n.keys.lassoBrushKey),r.clientX=r.pointers[0].clientX,r.clientY=r.pointers[0].clientY,t.doEmit(this.chart,"lasso","lassoStart",r))},lassomove(n){e.lassoing&&(n.clientX=n.pointers[0].clientX,n.clientY=n.pointers[0].clientY,t.doEmit(this.chart,"lasso","lassoMove",n))},lassoend(r){e.lassoing&&(r.clientX=r.pointers[0].clientX,r.clientY=r.pointers[0].clientY,t.doEmit(this.chart,"lasso","lassoEnd",r),n.handlers.selectionHandler.resumeEngineCalls(n.keys.lassoBrushKey,!0),e.lassoing=!1)},lassocancel(r){e.lassoing=!1,t.doEmit(this.chart,"lasso","lassoCancel",r),n.handlers.selectionHandler.resumeEngineCalls(n.keys.lassoBrushKey,!1)}}}}};var Fw={callMeasureRangeGesture:function(e,t,n,r){const i=n.keys.dimRangeBrushKey?"majorrange":"arearange";return{type:"Pan",options:{direction:n.isHorizontal?ym.DIRECTION_HORIZONTAL:ym.DIRECTION_VERTICAL,event:"measurerange",enable(i,o){if(!n.rangeSelStatus.isOpenMea)return!1;if(e.measureSelecting)return t.isSelectionEnabled();const s="measurerange"===n.active.gesture?[r,n.keys.componentKey]:[r],a=Lw.isOnComponentForRange(o,s,this);return e.measureSelecting=t.isSelectionEnabled()&&!!o&&!!a,e.measureSelecting&&!!n.keys.measureRangeBrushKey}},requireFailure:`lasso ${i}`,recognizeWith:n.handlers.scrollHandler?"drag":null,events:{measurerangestart(i){const o="measurerange"===n.active.gesture?[r,n.keys.componentKey]:[r];Lw.isOnComponentForRange(i,o,this)&&(e.measureSelecting=!0,t.switchTo("measurerange",this.chart,i),t.doEmit(this.chart,"rangeMeasure","rangeStart",i),n.handlers.selectionHandler.pauseEngineCalls(n.keys.measureRangeBrushKey))},measurerangemove(n){e.measureSelecting&&t.doEmit(this.chart,"rangeMeasure","rangeMove",n)},measurerangeend(r){e.measureSelecting&&(n.handlers.selectionHandler.resumeEngineCalls(n.keys.measureRangeBrushKey,!0),t.doEmit(this.chart,"rangeMeasure","rangeEnd",r),e.measureSelecting=!1)},measurerangecancel(){n.handlers.selectionHandler.resumeEngineCalls(n.keys.measureRangeBrushKey,!1),e.measureSelecting=!1}}}}};function zw(e,t){let n;return n="x-axis"===e?"horizontal"===t?ym.DIRECTION_VERTICAL:ym.DIRECTION_HORIZONTAL:"horizontal"===t?ym.DIRECTION_HORIZONTAL:ym.DIRECTION_VERTICAL,n}var Hw={callAreaRangeGesture:function(e,t,n,r){const i=n.keys.dimRangeBrushKey?"majorrange":"measurerange";return{type:"Pan",options:{direction:zw(r,n.isHorizontal),event:"arearange",enable(i,o){if(!n.rangeSelStatus.isOpenDim)return!1;if(e.minoring)return t.isSelectionEnabled();const s="arearange"===n.active.gesture?[r,n.keys.componentKey]:[r],a=Lw.isOnComponentForRange(o,s,this);return e.minoring=t.isSelectionEnabled()&&!!o&&!!a,e.minoring}},requireFailure:`lasso ${i}`,recognizeWith:n.handlers.scrollHandler?"drag":null,events:{arearangestart(i){const o="arearange"===n.active.gesture?[r,n.keys.componentKey]:[r];Lw.isOnComponentForRange(i,o,this)&&(e.minoring=!0,t.switchTo("arearange",this.chart,i),t.doEmit(this.chart,"rangeMinor","areaStart",i),n.handlers.selectionHandler.pauseEngineCalls(n.keys.areaBrushKey))},arearangemove(r){e.minoring&&(this.chart.brush(n.keys.areaBrushKey).clear(),t.doEmit(this.chart,"rangeMinor","areaMove",r))},arearangeend(r){e.minoring&&(n.handlers.selectionHandler.resumeEngineCalls(n.keys.areaBrushKey,!0),t.doEmit(this.chart,"rangeMinor","areaEnd",r),e.minoring=!1)},arearangecancel(){n.handlers.selectionHandler.resumeEngineCalls(n.keys.areaBrushKey,!1),e.minoring=!1}}}}};var Vw={callDimensionRangeGesture:function(e,t,n,r){const i=n.keys.measureRangeBrushKey?"measurerange":"arearange";return{type:"Pan",options:{direction:n.isHorizontal?ym.DIRECTION_VERTICAL:ym.DIRECTION_HORIZONTAL,event:"majorrange",enable(i,o){if(!n.rangeSelStatus.isOpenDim)return!1;if(e.majoring)return t.isSelectionEnabled();const s="majorrange"===n.active.gesture?[r,n.keys.componentKey]:[r],a=Lw.isOnComponentForRange(o,s,this);return e.majoring=t.isSelectionEnabled()&&!!o&&!!a,e.majoring&&!!n.keys.dimRangeBrushKey}},requireFailure:`lasso ${i}`,recognizeWith:n.handlers.scrollHandler?"drag":null,events:{majorrangestart(i){const o="majorrange"===n.active.gesture?[r,n.keys.componentKey]:[r];Lw.isOnComponentForRange(i,o,this)&&(e.majoring=!0,t.switchTo("majorrange",this.chart,i),t.doEmit(this.chart,"rangeDim","rangeStart",i),n.handlers.selectionHandler.pauseEngineCalls(n.keys.dimRangeBrushKey))},majorrangemove(n){e.majoring&&t.doEmit(this.chart,"rangeDim","rangeMove",n)},majorrangeend(r){e.majoring&&(n.handlers.selectionHandler.resumeEngineCalls(n.keys.dimRangeBrushKey,!0),t.doEmit(this.chart,"rangeDim","rangeEnd",r),e.majoring=!1)},majorrangecancel(){n.handlers.selectionHandler.resumeEngineCalls(n.keys.dimRangeBrushKey,!1),e.majoring=!1}}}}};var Bw={callDragGesture:function(e,t,n,r,i){let o={};return{type:"Pan",options:{direction:n.isHorizontal?ym.DIRECTION_VERTICAL:ym.DIRECTION_HORIZONTAL,event:"drag",enable(r,i){return e.dragging?t.isNavigationEnabled():(e.dragging=t.isNavigationEnabled()&&!!i&&!!this.chart.componentsFromPoint({x:i.center.x,y:i.center.y}).filter(e=>e.settings.key===n.keys.componentKey)[0],e.dragging)}},requireFailure:r?`lasso ${t.getBrushConfig()}`:"",events:{dragstart(e){o={x:e.deltaX,y:e.deltaY};let t=-(n.isHorizontal?e.deltaY:e.deltaX)/n.handlers.scrollHandler.getItemSize();!n.isHorizontal&&i&&(t=-t),n.handlers.scrollHandler.getScrollApi().move(t)},dragmove(t){if(!e.dragging)return;let r=-(n.isHorizontal?t.deltaY-o.y:t.deltaX-o.x)/n.handlers.scrollHandler.getItemSize();!n.isHorizontal&&i&&(r=-r),n.handlers.scrollHandler.getScrollApi().move(r),o={x:t.deltaX,y:t.deltaY}},dragend(){e.dragging&&(e.dragging=!1)},dragcancel(){e.dragging=!1}}}}};var $w={callNavBtnGesture:function(e,t){return{type:"Tap",options:{event:"navBtnTap",enable(n,r){return!(!r||!e())&&Lw.isOnComponentForNavBtn(r,t,this)}},events:{navBtnTap(e){this.chart.componentsFromPoint(e.center).forEach(t=>{const n=e.target,r=n?n.getAttribute("data-action"):"";if(r)return t.emit(r)})}}}}};var Ww={create:function(e,t,n,r,i){const o={};t=t||"vertical";const s=r.lassoBrushKey||"select",a=r.dimRangeBrushKey||null,l=r.measureRangeBrushKey||null,c=r.areaBrushKey||null,u=r.legendBrushKey||null,h=!!e.selectionHandler&&e.selectionHandler.isOn(),d={dragging:!1,lassoing:!1,majoring:!1,minoring:!1,measureSelecting:!1},f={gesture:"",type:""},p="horizontal"===t,g=p?"y-axis":"x-axis",m=p?"x-axis":"y-axis";function y(e,t,n){if(f.gesture===e)return;let r=s;const i=t||f.chart;switch(f.gesture){case"majorrange":b(i,"rangeDim","rangeClear",n),r=a;break;case"measurerange":b(i,"rangeMeasure","rangeClear",n),r=l;break;case"arearange":b(i,"rangeMinor","areaClear",n),r=c}f.gesture=e;const o="range"===e?"range":"item";f.type&&f.type!==o&&i.brush(r).clear(),f.chart=t,f.type=o}function b(e,t,n,r){if(e){const i=e.component(t);i&&i.emit(n,r)}}let v=[];const x={isSelectionEnabled:()=>e.selectionHandler&&e.selectionHandler.isOn(),isNavigationEnabled:()=>e.scrollHandler&&e.scrollHandler.isOn(),doEmit:b,switchTo:y,getBrushConfig:function(){return a?l?"majorrange measurerange":"majorrange arearange":"measurerange arearange"}},w={handlers:e,keys:r,isHorizontal:p,active:f,rangeSelStatus:i};function M(){y("none"),d.majoring=!1,d.measureSelecting=!1,d.minoring=!1}return h&&(v=[{type:"Tap",options:{event:"rangeClearTap"},events:{rangeClearTap(e){y("none",this.chart,e),d.majoring=!1,d.measureSelecting=!1,d.minoring=!1}}}],v.unshift($w.callNavBtnGesture(x.isNavigationEnabled,u)),v.push(jw.callLassoGesture(d,x,w)),a?l?(v.push(Vw.callDimensionRangeGesture(d,x,w,g)),e.selectionHandler.addComponent(a,{id:"rangeDim",clear:"rangeClear"}),v.push(Fw.callMeasureRangeGesture(d,x,w,m)),e.selectionHandler.addComponent(l,{id:"rangeMeasure",clear:"rangeClear"})):(v.push(Vw.callDimensionRangeGesture(d,x,w,g)),e.selectionHandler.addComponent(a,{id:"rangeDim",clear:"rangeClear"}),v.push(Hw.callAreaRangeGesture(d,x,w,m)),e.selectionHandler.addComponent(c,{id:"rangeMinor",clear:"areaClear"})):(v.push(Fw.callMeasureRangeGesture(d,x,w,m)),e.selectionHandler.addComponent(l,{id:"rangeMeasure",clear:"rangeClear"}),v.push(Hw.callAreaRangeGesture(d,x,w,g)),e.selectionHandler.addComponent(c,{id:"rangeMinor",clear:"areaClear"}))),e.scrollHandler&&(v.push(Bw.callDragGesture(d,x,w,h,n)),e.scrollHandler.getScrollApi().on("update",M)),o.gestures=v,o.destroy=function(){e.scrollHandler&&e.scrollHandler.getScrollApi().removeListener("update",M)},o}};const Uw=(e,t)=>(t.components||[]).find(t=>t.key===e),Yw=(e,t,n)=>{const r=Uw("axis",n)?.axis;return{text:{fontFamily:r?.title?.fontFamily||t.getStyle(e,"axis.title","fontFamily"),fontSize:r?.title?.fontSize||t.getStyle(e,"axis.title","fontSize"),fill:r?.title?.fontColor?.color||t.getStyle(e,"axis.title","color")}}},Kw=(e,t,n)=>{const r=Uw("axis",n)?.axis;return{labels:{fontFamily:r?.label?.name?.fontFamily||t.getStyle(e,"axis.label.name","fontFamily"),fontSize:r?.label?.name?.fontSize||t.getStyle(e,"axis.label.name","fontSize"),fill:r?.label?.name?.fontColor?.color||t.getStyle(e,"axis.label.name","color")}}};function Xw(e){const t=nb(e,"qUndoExclude.box.qHyperCube.qDimensionInfo.0.qApprMaxGlyphCount",0);return Math.min(20,t)}const Gw={createSettings:function(e){return{settings:{labels:{maxGlyphCount:Xw(e)}}}}};const Jw={createSettings:function(e){const t=Dw.isAutoBin(e),n=Dw.getBinMode(e),r=Dw.getDerivedBinSize(e);let i,o;if(t||"maxCount"===n){const t=Dw.getDerivedBinOffset(e);i=t,o=t+Dw.getDerivedBinCount(e)*r}else{const t=nb(e,"qUndoExclude.box.qHyperCube.qDimensionInfo.0",{});i=t.qMin||0,o=(t.qMax||0)+r}return{component:{type:"linear",min:i,max:o}}}},Zw={aliceblue:{r:240,g:248,b:255},antiquewhite:{r:250,g:235,b:215},aqua:{r:0,g:255,b:255},aquamarine:{r:127,g:255,b:212},azure:{r:240,g:255,b:255},beige:{r:245,g:245,b:220},bisque:{r:255,g:228,b:196},black:{r:0,g:0,b:0},blanchedalmond:{r:255,g:235,b:205},blue:{r:0,g:0,b:255},blueviolet:{r:138,g:43,b:226},brown:{r:165,g:42,b:42},burlywood:{r:222,g:184,b:135},cadetblue:{r:95,g:158,b:160},chartreuse:{r:127,g:255,b:0},chocolate:{r:210,g:105,b:30},coral:{r:255,g:127,b:80},cornflowerblue:{r:100,g:149,b:237},cornsilk:{r:255,g:248,b:220},crimson:{r:220,g:20,b:60},cyan:{r:0,g:255,b:255},darkblue:{r:0,g:0,b:139},darkcyan:{r:0,g:139,b:139},darkgoldenrod:{r:184,g:134,b:11},darkgray:{r:169,g:169,b:169},darkgreen:{r:0,g:100,b:0},darkgrey:{r:169,g:169,b:169},darkkhaki:{r:189,g:183,b:107},darkmagenta:{r:139,g:0,b:139},darkolivegreen:{r:85,g:107,b:47},darkorange:{r:255,g:140,b:0},darkorchid:{r:153,g:50,b:204},darkred:{r:139,g:0,b:0},darksalmon:{r:233,g:150,b:122},darkseagreen:{r:143,g:188,b:143},darkslateblue:{r:72,g:61,b:139},darkslategray:{r:47,g:79,b:79},darkslategrey:{r:47,g:79,b:79},darkturquoise:{r:0,g:206,b:209},darkviolet:{r:148,g:0,b:211},deeppink:{r:255,g:20,b:147},deepskyblue:{r:0,g:191,b:255},dimgray:{r:105,g:105,b:105},dimgrey:{r:105,g:105,b:105},dodgerblue:{r:30,g:144,b:255},firebrick:{r:178,g:34,b:34},floralwhite:{r:255,g:250,b:240},forestgreen:{r:34,g:139,b:34},fuchsia:{r:255,g:0,b:255},gainsboro:{r:220,g:220,b:220},ghostwhite:{r:248,g:248,b:255},gold:{r:255,g:215,b:0},goldenrod:{r:218,g:165,b:32},gray:{r:128,g:128,b:128},green:{r:0,g:128,b:0},greenyellow:{r:173,g:255,b:47},grey:{r:128,g:128,b:128},honeydew:{r:240,g:255,b:240},hotpink:{r:255,g:105,b:180},indianred:{r:205,g:92,b:92},indigo:{r:75,g:0,b:130},ivory:{r:255,g:255,b:240},khaki:{r:240,g:230,b:140},lavender:{r:230,g:230,b:250},lavenderblush:{r:255,g:240,b:245},lawngreen:{r:124,g:252,b:0},lemonchiffon:{r:255,g:250,b:205},lightblue:{r:173,g:216,b:230},lightcoral:{r:240,g:128,b:128},lightcyan:{r:224,g:255,b:255},lightgoldenrodyellow:{r:250,g:250,b:210},lightgray:{r:211,g:211,b:211},lightgreen:{r:144,g:238,b:144},lightgrey:{r:211,g:211,b:211},lightpink:{r:255,g:182,b:193},lightsalmon:{r:255,g:160,b:122},lightseagreen:{r:32,g:178,b:170},lightskyblue:{r:135,g:206,b:250},lightslategray:{r:119,g:136,b:153},lightslategrey:{r:119,g:136,b:153},lightsteelblue:{r:176,g:196,b:222},lightyellow:{r:255,g:255,b:224},lime:{r:0,g:255,b:0},limegreen:{r:50,g:205,b:50},linen:{r:250,g:240,b:230},magenta:{r:255,g:0,b:255},maroon:{r:128,g:0,b:0},mediumaquamarine:{r:102,g:205,b:170},mediumblue:{r:0,g:0,b:205},mediumorchid:{r:186,g:85,b:211},mediumpurple:{r:147,g:112,b:219},mediumseagreen:{r:60,g:179,b:113},mediumslateblue:{r:123,g:104,b:238},mediumspringgreen:{r:0,g:250,b:154},mediumturquoise:{r:72,g:209,b:204},mediumvioletred:{r:199,g:21,b:133},midnightblue:{r:25,g:25,b:112},mintcream:{r:245,g:255,b:250},mistyrose:{r:255,g:228,b:225},moccasin:{r:255,g:228,b:181},navajowhite:{r:255,g:222,b:173},navy:{r:0,g:0,b:128},oldlace:{r:253,g:245,b:230},olive:{r:128,g:128,b:0},olivedrab:{r:107,g:142,b:35},orange:{r:255,g:165,b:0},orangered:{r:255,g:69,b:0},orchid:{r:218,g:112,b:214},palegoldenrod:{r:238,g:232,b:170},palegreen:{r:152,g:251,b:152},paleturquoise:{r:175,g:238,b:238},palevioletred:{r:219,g:112,b:147},papayawhip:{r:255,g:239,b:213},peachpuff:{r:255,g:218,b:185},peru:{r:205,g:133,b:63},pink:{r:255,g:192,b:203},plum:{r:221,g:160,b:221},powderblue:{r:176,g:224,b:230},purple:{r:128,g:0,b:128},red:{r:255,g:0,b:0},rosybrown:{r:188,g:143,b:143},royalblue:{r:65,g:105,b:225},saddlebrown:{r:139,g:69,b:19},salmon:{r:250,g:128,b:114},sandybrown:{r:244,g:164,b:96},seagreen:{r:46,g:139,b:87},seashell:{r:255,g:245,b:238},sienna:{r:160,g:82,b:45},silver:{r:192,g:192,b:192},skyblue:{r:135,g:206,b:235},slateblue:{r:106,g:90,b:205},slategray:{r:112,g:128,b:144},slategrey:{r:112,g:128,b:144},snow:{r:255,g:250,b:250},springgreen:{r:0,g:255,b:127},steelblue:{r:70,g:130,b:180},tan:{r:210,g:180,b:140},teal:{r:0,g:128,b:128},thistle:{r:216,g:191,b:216},tomato:{r:255,g:99,b:71},transparent:{r:255,g:255,b:255,a:0},turquoise:{r:64,g:224,b:208},violet:{r:238,g:130,b:238},wheat:{r:245,g:222,b:179},white:{r:255,g:255,b:255},whitesmoke:{r:245,g:245,b:245},yellow:{r:255,g:255,b:0},yellowgreen:{r:154,g:205,b:50}},Qw=/^rgb\((\d{1,3}),(\d{1,3}),(\d{1,3})\)$/i,eM=/^rgba\((\d{1,3}),(\d{1,3}),(\d{1,3}),(\d(\.\d+)?)\)$/i,tM=/^#([A-f0-9]{2})([A-f0-9]{2})([A-f0-9]{2})$/i,nM=/^#([A-f0-9])([A-f0-9])([A-f0-9])$/i,rM=/^hsl\(\s*(\d+(\.\d+)?)\s*,\s*(\d+(\.\d+)?%?)\s*,\s*(\d+(\.\d+)?%?)\s*\)$/i,iM=/^hsla\(\s*(\d+(\.\d+)?)\s*,\s*(\d+(\.\d+)?%?)\s*,\s*(\d+(\.\d+)?%?)\s*,(\d(\.\d+)?)\)$/i,oM=Math.floor,sM=Math.round,aM=Wv.extend({init(){let e,t,n,r,i,o,s,a,l,c,u,h,d=0,f=0,p=0,g=1;if(this._invalid=!1,arguments[0]instanceof aM)d=arguments[0]._r,f=arguments[0]._g,p=arguments[0]._b,g=arguments[0]._a,this._invalid=arguments[0]._invalid;else if(arguments.length<3)if("string"==typeof arguments[0])if(h=arguments[0],u=/^rgb\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*\)$/i.exec(h))d=parseInt(u[1],10),f=parseInt(u[2],10),p=parseInt(u[3],10);else if(u=/^rgba\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d(\.\d+)?)\s*\)$/i.exec(h))d=parseInt(u[1],10),f=parseInt(u[2],10),p=parseInt(u[3],10),g=parseFloat(u[4]);else if(u=/^#([A-f0-9]{2})([A-f0-9]{2})([A-f0-9]{2})$/i.exec(h))d=parseInt(u[1],16),f=parseInt(u[2],16),p=parseInt(u[3],16),g=1;else if(u=/^#([A-f0-9])([A-f0-9])([A-f0-9])$/i.exec(h))d=parseInt(u[1]+u[1],16),f=parseInt(u[2]+u[2],16),p=parseInt(u[3]+u[3],16),g=1;else if(u=/^hsl\(\s*(\d+(\.\d+)?)\s*,\s*(\d+(\.\d+)?%?)\s*,\s*(\d+(\.\d+)?%?)\s*\)$/i.exec(h)){switch(e=parseFloat(u[1]),t=parseFloat(u[3]),r=parseFloat(u[5]),e%=360,t/=100,r/=100,e=e<0?0:e>360?360:e,t=t<0?0:t>1?1:t,r=r<0?0:r>1?1:r,o=r<=.5?2*r*t:(2-2*r)*t,s=e/60,a=o*(1-Math.abs(s%2-1)),l=[],s=Math.floor(s),s){case 0:l=[o,a,0];break;case 1:l=[a,o,0];break;case 2:l=[0,o,a];break;case 3:l=[0,a,o];break;case 4:l=[a,0,o];break;case 5:l=[o,0,a];break;default:l=[0,0,0]}c=r-.5*o,d=l[0]+c,f=l[1]+c,p=l[2]+c,d=sM(255*d),f=sM(255*f),p=sM(255*p),g=1}else if(u=/^hsla\(\s*(\d+(\.\d+)?)\s*,\s*(\d+(\.\d+)?%?)\s*,\s*(\d+(\.\d+)?%?)\s*,(\d(\.\d+)?)\)$/i.exec(h)){switch(e=parseFloat(u[1]),t=parseFloat(u[3]),r=parseFloat(u[5]),g=parseFloat(u[7]),e%=360,t/=100,r/=100,e=e<0?0:e>360?360:e,t=t<0?0:t>1?1:t,r=r<0?0:r>1?1:r,o=r<=.5?2*r*t:(2-2*r)*t,s=e/60,a=o*(1-Math.abs(s%2-1)),l=[],s=Math.floor(s),s){case 0:l=[o,a,0];break;case 1:l=[a,o,0];break;case 2:l=[0,o,a];break;case 3:l=[0,a,o];break;case 4:l=[a,0,o];break;case 5:l=[o,0,a];break;default:l=[0,0,0]}c=r-.5*o,d=l[0]+c,f=l[1]+c,p=l[2]+c,d=sM(255*d),f=sM(255*f),p=sM(255*p)}else if(u=/^hsv\(\s*(\d+(\.\d+)?)\s*,\s*(\d+(\.\d+)?%?)\s*,\s*(\d+(\.\d+)?%?)\s*\)$/i.exec(h)){switch(e=parseFloat(u[1]),t=parseFloat(u[3]),i=parseFloat(u[5]),e%=360,t/=100,i/=100,e=e<0?0:e>360?360:e,t=t<0?0:t>1?1:t,i=i<0?0:i>1?1:i,o=i*t,s=e/60,a=o*(1-Math.abs(s%2-1)),l=[],s=Math.floor(s),s){case 0:l=[o,a,0];break;case 1:l=[a,o,0];break;case 2:l=[0,o,a];break;case 3:l=[0,a,o];break;case 4:l=[a,0,o];break;case 5:l=[o,0,a];break;default:l=[0,0,0]}c=i-o,d=l[0]+c,f=l[1]+c,p=l[2]+c,d=sM(255*d),f=sM(255*f),p=sM(255*p),g=1}else Zw[h.toLowerCase()]?(n=h.toLowerCase(),d=Zw[n].r,f=Zw[n].g,p=Zw[n].b,g="number"==typeof Zw[n].a?Zw[n].a:1):this._invalid=!0;else"number"==typeof arguments[0]&&arguments[0]>=0&&"argb"===arguments[1]?(g=(4278190080&arguments[0])>>>24,g/=255,d=(16711680&arguments[0])>>16,f=(65280&arguments[0])>>8,p=255&arguments[0]):"number"==typeof arguments[0]&&arguments[0]>=0?(d=(16711680&arguments[0])>>16,f=(65280&arguments[0])>>8,p=255&arguments[0]):this._invalid=!0;else arguments.length>=3?(d=arguments[0],f=arguments[1],p=arguments[2],g=arguments.length>=4?arguments[3]:1):this._invalid=!0;Number.isNaN(+d+f+p+g)&&(this._invalid=!0),this._r=oM(d),this._g=oM(f),this._b=oM(p),this._a=g,this._spaces={}},isInvalid(){return this._invalid},setAlpha(e){this._a=e,this._spaces={}},getAlpha(){return this._a},toRGB:function(){return this._spaces.rgb||(this._spaces.rgb=aM.toRGB(this)),this._spaces.rgb},toRGBA:function(){return this._spaces.rgba||(this._spaces.rgba=aM.toRGBA(this)),this._spaces.rgba},toString(){return this._spaces.rgb||(this._spaces.rgb=aM.toRGB(this)),this._spaces.rgb},toHex:function(){return this._spaces.hex||(this._spaces.hex=aM.toHex(this)),this._spaces.hex},toHSL:function(e){return this._spaces.hsl||(this._spaces.hsl=aM.toHSL(this,e)),this._spaces.hsl},toHSLA:function(e){return this._spaces.hsla||(this._spaces.hsla=aM.toHSLA(this,e)),this._spaces.hsla},toHSV(){const e=this.toHSVComponents();return`hsv(${e.h},${e.s},${e.v})`},toHSVComponents:function(){return this._spaces.hsvComp||(this._spaces.hsvComp=aM.toHSVComponents(this)),this._spaces.hsvComp},toNumber:function(){return this._spaces.num||(this._spaces.num=aM.toNumber(this)),this._spaces.num},isDark(){return this.isInvalid()||this.getLuminance()<125},getLuminance(){return void 0===this._lumi&&(this._lumi=.299*this._r+.587*this._g+.114*this._b),this._lumi},shiftLuminance(e){const t=this.toHSLA(),n=/^hsla\(\s*(\d+(\.\d+)?)\s*,\s*(\d+(\.\d+)?%?)\s*,\s*(\d+(\.\d+)?%?)\s*,(\d(\.\d+)?)\)$/i.exec(t),r=parseFloat(n[1]),i=parseFloat(n[3]);let o=parseFloat(n[5]);const s=parseFloat(n[7]);return o+=e,o=Math.max(0,Math.min(o,100)),`hsla(${r},${i},${o},${s})`},isEqual(e){return e instanceof aM||(e=new aM(e)),this._r===e._r&&this._g===e._g&&this._b===e._b},blend(e,t){return`rgba(${[oM(this._r+(e._r-this._r)*t),oM(this._g+(e._g-this._g)*t),oM(this._b+(e._b-this._b)*t),oM(this._a+(e._a-this._a)*t)].join(",")})`},createShiftedColor(e){(void 0===e||Number.isNaN(+e))&&(e=1);const t=this.getLuminance(),n=this._g<126?1:1+this._g/512,r=this.shiftLuminance(20*(t*n<220?.8+1/(t+1)*4:-(.8+t/255*1))*e);return new aM(r)}});aM.toRGB=function(e){if(e instanceof aM)return`rgb(${[e._r,e._g,e._b].join(",")})`;"string"==typeof e&&(e=aM.toNumber(e));return`rgb(${(16711680&e)>>16},${(65280&e)>>8},${255&e})`},aM.toRGBA=function(e,t){if(e instanceof aM)return`rgba(${[e._r,e._g,e._b,void 0!==t?t:e._a].join(",")})`;"string"==typeof e&&(e=aM.toNumber(e));return`rgba(${(16711680&e)>>16},${(65280&e)>>8},${255&e},${void 0!==t?t:e._a})`},aM.toHex=function(e){let t,n,r;return e instanceof aM?(t=e._r.toString(16),n=e._g.toString(16),r=e._b.toString(16),1===t.length&&(t=`0${t}`),1===n.length&&(n=`0${n}`),1===r.length&&(r=`0${r}`),`#${[t,n,r].join("")}`):("string"==typeof e&&(e=aM.toNumber(e)),t=((16711680&e)>>16).toString(16),n=((65280&e)>>8).toString(16),r=(255&e).toString(16),1===t.length&&(t=`0${t}`),1===n.length&&(n=`0${n}`),1===r.length&&(r=`0${r}`),`#${t}${n}${r}`)},aM.toHSL=function(e,t){let n,r,i,o=0;"string"==typeof e&&(e=new aM(e));const s=e._r/255,a=e._g/255,l=e._b/255,c=Math.max(s,a,l),u=Math.min(s,a,l);if(r=t?.21*s+.72*a+.07*l:(c+u)/2,c===u)n=0,o=0;else{switch(i=c-u,n=r>.5?i/(2-c-u):i/(c+u),c){case s:o=(a-l)/i+(a<l?6:0);break;case a:o=(l-s)/i+2;break;case l:o=(s-a)/i+4}o/=6}return`hsl(${360*o},${100*n},${100*r})`},aM.toHSLA=function(e,t){let n,r,i,o=0;"string"==typeof e&&(e=new aM(e));const s=e._r/255,a=e._g/255,l=e._b/255,c=e._a,u=Math.max(s,a,l),h=Math.min(s,a,l);if(r=t?.21*s+.72*a+.07*l:(u+h)/2,u===h)n=0,o=0;else{switch(i=u-h,n=r>.5?i/(2-u-h):i/(u+h),u){case s:o=(a-l)/i+(a<l?6:0);break;case a:o=(l-s)/i+2;break;case l:o=(s-a)/i+4}o/=6}return`hsla(${360*o},${100*n},${100*r},${c})`},aM.toHSVComponents=function(e){let t,n,r=0;"string"==typeof e&&(e=new aM(e));const i=e._r/255,o=e._g/255,s=e._b/255,a=Math.max(i,o,s),l=Math.min(i,o,s),c=a;if(a===l)t=0,r=0;else{switch(n=a-l,t=0===n?0:n/c,a){case i:r=(o-s)/n+(o<s?6:0);break;case o:r=(s-i)/n+2;break;case s:r=(i-o)/n+4}r/=6}return{h:360*r%360,s:100*t,v:100*c}},aM.toNumber=function(){if(1===arguments.length&&arguments[0]instanceof aM)return(arguments[0]._r<<16)+(arguments[0]._g<<8)+arguments[0]._b;let e,t,n=0,r=0,i=0;return 1===arguments.length&&"string"==typeof arguments[0]&&(t=arguments[0],(e=/^rgb\((\d{1,3}),(\d{1,3}),(\d{1,3})\)$/i.exec(t))?(n=parseInt(e[1],10),r=parseInt(e[2],10),i=parseInt(e[3],10)):(e=/^#([A-f0-9]{2})([A-f0-9]{2})([A-f0-9]{2})$/i.exec(t))?(n=parseInt(e[1],16),r=parseInt(e[2],16),i=parseInt(e[3],16)):(e=/^#([A-f0-9])([A-f0-9])([A-f0-9])$/i.exec(t))&&(n=parseInt(e[1]+e[1],16),r=parseInt(e[2]+e[2],16),i=parseInt(e[3]+e[3],16))),(n<<16)+(r<<8)+i},aM.blend=function(e,t,n){const r=(16711680&(e=aM.toNumber(e)))>>16,i=(65280&e)>>8,o=255&e;return(r+(((16711680&(t=aM.toNumber(t)))>>16)-r)*n<<16)+(i+(((65280&t)>>8)-i)*n<<8)+(o+((255&t)-o)*n)},aM.getBlend=function(e,t,n){const r=e._r+(t._r-e._r)*n,i=e._g+(t._g-e._g)*n,o=e._b+(t._b-e._b)*n,s=e._a+(t._a-e._a)*n;return new aM(r,i,o,s)},aM.isCSSColor=function(e){return!(arguments.length>1||"string"!=typeof e)&&(Qw.test(e)||eM.test(e)||tM.test(e)||nM.test(e)||rM.test(e)||iM.test(e)||Zw[e.toLowerCase()])},aM.getBestContrast=function(e,t,n){const r=e.getLuminance();return Math.abs(r-t.getLuminance())>Math.abs(r-n.getLuminance())?t:n},aM.getContrast=function(e,t){if(!e||!t)return;const n=e.getLuminance()/100,r=t.getLuminance()/100;return n>r?(n+.05)/(r+.05):(r+.05)/(n+.05)},aM.isDark=function(){const e={getLuminance:aM.prototype.getLuminance,isInvalid:aM.prototype.isInvalid};return aM.prototype.init.apply(e,[].slice.call(arguments)),aM.prototype.isDark.call(e)},aM.useDarkLabel=function(e,t){return e._a>.5?!e.isDark():!t};const lM={TRANSPARENT_BLACK:"rgba( 0,0,0,0.2 )",TRANSPARENT_WHITE:"rgba( 255,255,255,0.7 )",LIGHT_GREY:"#ccc",DARK_GREY:"#666",BLACK:"#000",WHITE:"#fff",getInverse(e){const t=new aM(e);return 0===t.getAlpha()?this.BLACK:t.isDark()?this.WHITE:this.BLACK},getContrastingGrey(e){const t=new aM(e);return 0===t.getAlpha()?this.DARK_GREY:aM.getBestContrast(t,new aM(lM.LIGHT_GREY),new aM(lM.DARK_GREY))},getBestContrast:(e,t,n)=>aM.getBestContrast(new aM(e),new aM(t),new aM(n)),getContrastingTransparent(e){const t=new aM(e);return 0===t.getAlpha()||"none"===e?this.TRANSPARENT_BLACK:t.isDark()?this.TRANSPARENT_WHITE:this.TRANSPARENT_BLACK}};const cM={createSettings:function(e,t,n,r,i,o){const{theme:s}=e.environment,a=s.getColorPickerColor(t.color.bar.paletteColor),l=Dw.getDerivedBinSize(t),c=[],u=[n.consume,r.consume,i.consume];return e._tooltipHandler.isOn()&&(c.push(o.box.trigger),u.push.apply(u,o.box.consume)),c.push(n.trigger),{key:"box-marker",settings:{box:{fill:a,stroke:lM.getContrastingGrey(a).toHex(),strokeWidth:1,maxWidthPx:1/0,minWidthPx:NaN,minWidth:0},major:{scale:"dimension",ref:{start:"binStart",end:"binEnd"}},minor:{scale:"measure"},whiskers:!1,orientation:"vertical"},brush:{trigger:c,consume:u},data:{extract:{field:"qDimensionInfo/0",props:{start:0,end:{field:"qMeasureInfo/0"},measure:{field:"qMeasureInfo/0",reduce:"first",value:e=>e,reduceLabel:"none"},binStart:{field:"qDimensionInfo/0",value:e=>e.qNum},binEnd:{field:"qDimensionInfo/0",value:e=>e.qNum+l},elemNo:{field:"qDimensionInfo/0"},bin:{field:"qDimensionInfo/0",value:e=>e}}}}}}};const uM={createSettings:function(e,t,n){const r=t.getStyles(),i=((e,t,n)=>{const r=Uw("value",n)?.label,i=r?.value?.fontFamily||t.label.value.fontFamily;let o=r?.value?.fontSize||t.label.value.fontSize;o=parseFloat(o);const s=r?.value?.fontColor?.color;return{fontFamily:i,fontSize:o,fill:s}})(0,r,e),o=i.fill||r.label.value.color;return{settings:{sources:[{strategy:{settings:{...i,labels:[{placements:[{fill:o},{fill:i.fill?o:e=>aM.isDark(e.node.attrs.fill)?r.label.value.lightColor:r.label.value.darkColor}]}]}}}]}}}},hM="object.histogram";function dM(e){return nb(e,"qHyperCube.qDimensionInfo.0.qIsOneAndOnlyOne",!1)}const fM={createChartSettings:function(e,t){const n=e.isRtl(),r=nb(t,"qHyperCube.qDimensionInfo.0",{}).qFallbackTitle||"",{theme:i,translator:o}=e.environment,s=xx.create({chartID:hM,theme:i,isRtl:n,flags:e.flags}),a=function(e){var t=e.theme,n=e.config,r=void 0===n?{}:n,i=r.id,o=r.resolve,s=void 0===o?[]:o,a=r.transform,l=void 0===a?[]:a,c=r.extend,u=void 0===c?[]:c,h={theme:t,matrix:vb(s),styles:void 0};return h.styles=kb({theme:t,id:i,transform:l,extend:u,matrix:h.matrix}),{getStyles:function(){return h.styles},getTheme:function(){return h.theme},setTheme:function(e){h.theme=e,h.styles=kb({theme:e,id:i,transform:l,extend:u,matrix:h.matrix})}}}({theme:i,config:{id:"histogram"}});let l={},c={},u={};e._selectionHandler.isOn()&&(e._selectionHandler.setUpStart(),l=e._selectionHandler.setUpBrush({contexts:["select"],data:["elemNo"],dataPath:"qUndoExclude/box"}),c=e._selectionHandler.setUpBrush({contexts:["select-dimension"],data:["elemNo"],dataPath:"qUndoExclude/box",isSingleSelect:dM(t)}),u=e._selectionHandler.setUpBrush({dataPath:"qUndoExclude/box",contexts:["select-measure"],data:["end"]}),e._selectionHandler.setUpDone());const h={box:{}};e._tooltipHandler.isOn()&&(h.box=e._tooltipHandler.setUp({chartBuilder:s,environment:e.environment,data:[""],contexts:["boxTip"],componentKey:"box-marker",measureRows:["measure"],labelData:["bin"]}));const d=function(e){const t=e.qUndoExclude&&e.qUndoExclude.box&&e.qUndoExclude.box.qHyperCube&&e.qUndoExclude.box.qHyperCube.qDimensionInfo?e.qUndoExclude.box.qHyperCube.qDimensionInfo:void 0;return!!t&&!!t[0].qLocked}(t),f=function(e){const t={};return e?(t.isOpenDim=!1,t.isOpenMea=!1):(t.isOpenDim=!0,t.isOpenMea=!0),t}(d),p={scrollHandler:null,selectionHandler:e._selectionHandler};this._dependentActions&&this._dependentActions.destroy(),this._dependentActions=Ww.create(p,"vertical",n,{componentKey:"box-marker",lassoBrushKey:"select",dimRangeBrushKey:null,measureRangeBrushKey:"select-measure",areaBrushKey:"select-dimension"},f),s.addPreset("dimension-measure-chart",{isRtl:n,includeDimensionAxis:!0,orientation:"vertical",selectionsEnabled:e._selectionHandler.isOn(),theme:i,measureSource:"qMeasureInfo/0",measureScaleSettings:{component:{expand:0,include:[0]}},enableLasso:!0,lasso:{brushKey:"select",brushComponents:["box-marker"]},enableMeasureRange:!0,measureRange:{brushKey:"select-measure",brushAxis:"y-axis",brushArea:"box-marker",brushScale:"measure"},enableAreaRange:!0,areaRange:{brushKey:"select-dimension",brushAxis:"x-axis",brushData:["elemNo"],brushArea:"box-marker",brushScale:"rangeSelSettings",brushComponents:["box-marker"],multiple:!0,chartInstance:e.chartInstance},brushActions:this._dependentActions.gestures,dimensionSource:"qDimensionInfo/0",dimensionScaleSettings:Jw.createSettings(t),measureAxisProperties:t.measureAxis,measureTitleText:t.measureAxis.label||o.get("Visualization.Histogram.MeasureAxisLabel"),dimensionAxisProperties:t.dimensionAxis,dimensionAxisSettings:Gw.createSettings(t),dimensionTitleText:r,gridlines:t.gridlines,hasNavigation:!1,isNavigationEnabledFn:()=>!1,refLines:t.refLine&&t.refLine.refLines,axisTitleStyle:Yw(hM,i,t),axisLabelStyle:Kw(hM,i,t)});const g=s.getSettings(),m=cM.createSettings(e,t,l,c,u,h);if(s.addComponent("box-marker",m),t.dataPoint&&t.dataPoint.showLabels){const e=uM.createSettings(t,a,hM);s.addComponent("labels",e)}return e.addSnapshotChartSettings(g,t),g.scales.rangeSelSettings={type:"linear",min:g.scales.dimension.min,max:g.scales.dimension.max,source:"qDimensionInfo/0"},g}};const pM=Dx.extend("Histogram",{namespace:".histogram",init:function({environment:e,flags:t,lasso:n,picasso:r,$element:i,backendApi:o,selectionsApi:s,renderState:a}){this._super(r,i,e,o,s),this.flags=t,this.renderState=a,this.picassoElement.__do_not_use_findShapes=this.chartInstance.findShapes.bind(this.chartInstance),this._derivedProperties=new dw,this._selectionHandler=Px.create({model:o.model,chartInstance:this.chartInstance,selectionsApi:s,selectPaths:["/qUndoExclude/box/qHyperCubeDef"],lasso:n}),this._tooltipHandler=Xx.create(this.chartInstance,i,"object.histogram"),this.setDataPaths(["qUndoExclude/box/qHyperCube"])},updateConstraints:function(e){const t=!e.passive,n=!e.select&&!e.active;this._tooltipHandler[t?"on":"off"](),this._selectionHandler[n?"on":"off"]()},off:function(){this._tooltipHandler.off(),this._selectionHandler.off()},createChartSettings:function(e){return fM.createChartSettings(this,e)},setSnapshotData:function(e){return this._super(e),e.qUndoExclude.box.qHyperCube.qDataPages=this.layout.qUndoExclude.box.qHyperCube.qDataPages,Promise.resolve(e)},getDisclaimerAttributes:function(e){const t=function(){const t=nb(e,"qUndoExclude.box.qHyperCube.qDataPages.0.qMatrix",[]);return 1===t.length&&t[0][0]&&t[0][0].qIsNull}();return{data:e.qUndoExclude&&e.qUndoExclude.box,supportedDisclaimers:{LimitedData:!0,OnlyNanData:!0,OnlyNegativeOrZeroValues:!t,RequireNumericDimension:!0},options:{bottom:!0,supportNegative:!1,explicitOnlyNanData:t,explicitRequireNumericDimension:(n=e.qHyperCube,n.qDimensionInfo.length>0&&-1===n.qDimensionInfo[0].qTags.indexOf("$numeric"))}};var n},updateChart:function(e,t){if(!e.qUndoExclude)return Promise.resolve();this._super(e,t)},updateData:function(e){const t=this;return t._super(e).then(()=>{if(t._destroyed)return Promise.reject();e=t.layout;const n={height:Math.min(e.qHyperCube.qSize.qcy,1e3),width:2},r=t.backendApi.model;return!!this.layout.snapshotData?Promise.resolve():r.getEffectiveProperties().then(i=>t._destroyed?Promise.reject():t._derivedProperties.addDefaultHyperCubeHash(i.qHyperCubeDef,e.qHyperCube,t.environment.app,function(e,t){return{box:t.qHyperCubeDef,binMappings:Iw.getMappingValues(e),binProperties:t.bins,measureAxis:t.measureAxis,version:"2.0"}}(e,i)).then(o=>{if(t._destroyed)return Promise.reject();const s={layout:e,properties:i,model:r,hashData:o,generateDerivedProperties:(e,n)=>Pw.generateHyperCubes(e,n,t.environment)};return t._derivedProperties.isDerivedUpToDate(s)?e.qUndoExclude?(t.renderState.restore(),t.backendApi.updateCache(e.qUndoExclude.box),t.getData(t.backendApi,e.qUndoExclude.box.qHyperCube,n)):Promise.resolve():(t.renderState.pending(),t._derivedProperties.updateDerivedProperties(s))}))})},paint:function(){const e=this.layout.qUndoExclude;return e&&e.box&&e.box.qHyperCube.qDataPages.length?this._super():Promise.resolve(!1)},isLassoDisabled:function(){return!1}});class gM{constructor(e){this.model=e,this.path="/qUndoExclude/box/qHyperCubeDef"}setCacheOptions({maxStackedValues:e}){}updateCache(e){}getData(e){return this.model.getHyperCubeData(this.path,e)}}var mM={onChangeCalcCond:function(e){const t=e?.qHyperCubeDef,n=e?.qUndoExclude?.box?.qHyperCubeDef;t&&n&&(n.qCalcCond=t.qCalcCond,n.qCalcCondition=t.qCalcCondition)}};const yM=(e,t)=>({component:"styling-panel",chartTitle:"Object.Histogram",translation:"LayerStyleEditor.component.styling",subtitle:"LayerStyleEditor.component.styling",ref:"components",useGeneral:!0,useBackground:e,items:{axisTitleSection:{translation:"properties.axis.title",component:"panel-section",items:t.getOptions("axis","axis.title")},axisLabelSection:{translation:"properties.axis.label",component:"panel-section",items:t.getOptions("axis","axis.label.name")},valueLabelSection:{translation:"properties.value.label",component:"panel-section",items:t.getOptions("value","label.value")}}}),bM="maxCount",vM="size";function xM(e){return!(e.bins&&e.bins.auto)}function wM(e){return xM(e)&&e.bins.binMode===bM}function MM(e){const{translator:t,flags:n}=e,r=e?.flags?.isEnabled("SENSECLIENT_IM_2021_STYLINGPANEL_HISTOGRAM"),i=e?.flags?.isEnabled("SENSECLIENT_IM_2021_HISTOGRAM_BG"),o=e.theme,s={translation:"properties.colors",type:"items",items:{colors:{classification:{section:"color",tags:["simple"]},type:"items",items:{barColor:{ref:"color.bar.paletteColor",translation:"properties.histogram.barColor",type:"object",component:"color-picker",dualOutput:!0,defaultValue:()=>{const{primary:e}=o.getDataColorSpecials(),t=o.getDataColorPickerPalettes()[0].colors,n=t.indexOf(e);return{index:-1===n?Math.min(6,t.length-1):n}}}}}}},a="object.histogram",l=((e,t,n,r,i)=>r({theme:e,translator:t,flags:i,config:{id:n,paths:["axis.title","axis.label.name","label.value","legend.title","legend.label"]}}))(o,t,a,ny,n),c=((e,t,n)=>{const r={getOptions:(r,i)=>{const o=(e,t)=>({ref:`${i}.fontColor`,component:"color-picker",width:!1,defaultValue:()=>{const n=e.getStyle(t,`${i}.color`,"color");return{color:n,index:e.getDataColorPickerPalettes()[0].colors.indexOf(n)}}});return{labelSection:{component:"items",ref:"components",key:r,items:{fontFamily:{ref:`${i}.fontFamily`,component:"dropdown",options:()=>e.getOptions(`${i}.fontFamily`),defaultValue:()=>e.getDefaultValue(`${i}.fontFamily`)},...((t,n)=>({fontWrapper:{component:"inline-wrapper",items:{fontSize:{ref:`${i}.fontSize`,component:"dropdown",width:!0,options:()=>e.getOptions(`${i}.fontSize`),defaultValue:()=>e.getDefaultValue(`${i}.fontSize`)},fontColor:{...o(t,n)}}}}))(t,n)}}}}};return r})(l,o,a),u={type:"items",translation:"properties.presentation",items:{stylingPanel:r&&yM(i,c),gridLines:{type:"items",snapshot:{tid:"property-gridLines"},items:{showGridLines:{ref:"gridlines.auto",type:"boolean",translation:"properties.gridLine.spacing",component:"switch",defaultValue:!0,options:[{value:!0,translation:"Common.Auto"},{value:!1,translation:"Common.Custom"}]},gridSpacing:{ref:"gridlines.spacing",type:"number",component:"dropdown",defaultValue:2,options:[{value:0,translation:"properties.gridLine.noLines"},{value:2,translation:"properties.gridLine.medium"},{value:3,translation:"properties.gridLine.narrow"}],show:e=>e.gridlines&&!e.gridlines.auto}}},showLabels:{ref:"dataPoint.showLabels",type:"boolean",translation:"properties.dataPoints.labelmode",component:"switch",defaultValue:!1,options:[{value:!0,translation:"Common.Auto"},{value:!1,translation:"properties.off"}],snapshot:{tid:"property-dataPoints"}}}},h={items:{labels:{items:{header:{show:e=>e.qHyperCubeDef.qDimensions?.length},pointLabels:{component:"checkbox",ref:"dataPoint.showLabels",type:"boolean",translation:"Simple.Label.Value",show:e=>e.qHyperCubeDef.qDimensions?.length},dimensionTitle:{component:"checkbox",ref:"dimensionAxis.show",type:"string",translation:"Simple.Label.XAxis.Hide",defaultValue:"all",show:e=>e.qHyperCubeDef.qDimensions?.length,convertFunctions:{get:(e,t,n,r)=>"labels"===r.dimensionAxis.show||"none"===r.dimensionAxis.show,set(e,t,n,r,i){i.dimensionAxis.show=e?"labels":"all"}}},measureTitle:{component:"checkbox",ref:"measureAxis.show",type:"string",translation:"Simple.Label.YAxis.Hide",defaultValue:"all",show:e=>e.qHyperCubeDef.qDimensions?.length,convertFunctions:{get:(e,t,n,r)=>"labels"===r.measureAxis.show||"none"===r.measureAxis.show,set(e,t,n,r,i){i.measureAxis.show=e?"labels":"all"}}}}}}},d={uses:"settings",items:{simpleLabels:h,presentation:u,colors:s,measureAxis:{uses:"axis.picasso.measureAxis",items:{label:{type:"string",expression:"optional",expressionType:"StringExpression",ref:"measureAxis.label",defaultValue:"",translation:"Common.Label",placeholderTranslation:"Visualization.Histogram.MeasureAxisLabel"}}},dimensionAxis:{uses:"axis.picasso.dimensionAxis",items:{othersGroup:{items:{label:{show:!1}}}}}}},f={type:"items",component:"expandable-items",translation:"properties.addons",items:{dataHandling:{uses:"dataHandling",items:{calcCond:{uses:"calcCond",change:mM.onChangeCalcCond}}},refLines:{uses:"reflines",items:{colorBackground:{show:!1}}}}},p={uses:"data",items:{dimensions:{translation:"Common.Fields",alternativeTranslation:"properties.alternative.fields",items:{dimensionLimits:{show:!1,items:{otherMode:{readOnly:!1},otherSortMode:{show:e=>"OTHER_COUNTED"===nb(e,"qOtherTotalSpec.qOtherMode")},otherCounted:{show:e=>"OTHER_COUNTED"===nb(e,"qOtherTotalSpec.qOtherMode")},otherLimitMode:{show(e){const t=nb(e,"qOtherTotalSpec.qOtherMode");return"OTHER_ABS_LIMITED"===t||"OTHER_REL_LIMITED"===t}},otherLimit:{show(e){const t=nb(e,"qOtherTotalSpec.qOtherMode");return"OTHER_ABS_LIMITED"===t||"OTHER_REL_LIMITED"===t}},calculatedAgainstMessage:{show:!0,label(){const e=t.get("properties.histogram.staticMeasureName");return t.get("Properties.DimensionLimits.CalculatedAgainst",e)}}}},others:{show:!1,items:{suppressOther:{defaultValue:!0}}}}}}},g={ref:"bins.binMode",type:"string",component:"dropdown",options:[{value:bM,translation:"Visualization.Histogram.Binning.NumberOfBinsOption"},{value:vM,translation:"Visualization.Histogram.Binning.BarWidthOption"}],defaultValue:bM,show:e=>xM(e)},m={translation:"Visualization.Histogram.Bins",type:"items",component:"items",items:{auto:{ref:"bins.auto",translation:"Visualization.Histogram.Binning",component:"switch",type:"boolean",defaultValue:!0,undefinedValue:!1,options:[{value:!0,translation:"Visualization.Histogram.Binning.Auto"},{value:!1,translation:"Visualization.Histogram.Binning.Custom"}]},autoMessage:{component:"text",translation:"Visualization.Histogram.Binning.AutoDescription",show:e=>!xM(e)},mode:g,binCount:{ref:"bins.binCount",type:"number",expression:"optional",expressionType:"ValueExpression",translation:"Visualization.Histogram.Binning.BinCount",defaultValue:"",convertFunctions:{get(e,t,n){const r=n.properties.bins.binCount;return Dw.isEmpty(r)?Dw.getDerivedBinCount(n.layout):e(null)||""},set(e,t,n){t(n.type,e,void 0)}},show:wM},binMessage:{component:"text",translation:"Visualization.Histogram.Binning.BinCountRounding",show(e){const t=nb(e,"bins.binCount"),n="object"==typeof t;return wM(e)&&!Dw.isEmpty(t)&&!n&&!_w(t)&&t>0}},minBinMessage:{component:"text",translation:"Visualization.Histogram.Binning.BinCountMin",show(e){const t=nb(e,"bins.binCount");return!!(wM(e)&&!Dw.isEmpty(t)&&t<=0)}},binSize:{ref:"bins.binSize",type:"number",expression:"optional",expressionType:"ValueExpression",defaultValue:10,show:e=>xM(e)&&e.bins.binMode===vM,translation:"Visualization.Histogram.Binning.BinSize"},offset:{ref:"bins.offset",type:"number",expression:"optional",expressionType:"ValueExpression",show:e=>xM(e)&&e.bins.binMode===vM,translation:"Visualization.Histogram.Binning.Offset"},distinct:{ref:"bins.countDistinct",type:"boolean",defaultValue:!1,component:"checkbox",translation:"Visualization.Histogram.CountDistinct"}}};return{type:"items",component:"accordion",items:{data:p,bins:m,addons:f,settings:d}}}var kM={type:"items",component:"accordion",items:{data:{uses:"data",items:{dimensions:{translation:"Common.Fields"}}}}};var qM={getExportRawDataOptions:function(e){return{model:e.model,exportDataPath:"/qUndoExclude/box/qHyperCubeDef"}}};const SM="qUndoExclude.box";function _M(e){return{definition:MM(e),softDefinition:kM,support:{cssScaling:!1,snapshot:!0,export:!0,exportData:!0,sharing:!0,viewData:!0},importProperties:(t,n,r,i)=>{const o=Cm(e);r.mapProperties();const s={defaultDimension:r.getDefaultDimensionProperties(),defaultMeasure:r.getDefaultMeasureProperties()};return Sm.hypercube.importProperties({exportFormat:t,initialProperties:n,dataDefinition:o,defaultPropertyValues:s,hypercubePath:i})},exportProperties:(e,t,n)=>Sm.hypercube.exportProperties({propertyTree:e,hyperCubePath:n?SM:t,viewDataMode:n}),requireNumericDimension:!0,exportTableProperties(e){const t=SM;return Sm.hypercube.exportProperties({propertyTree:e,hypercubePath:t,viewData:!0})},getExportRawDataOptions:qM.getExportRawDataOptions}}return function(t){!function(e){if(e&&e.get&&e.add){const t="Object.Disclaimer.LimitedData";if(e.get(t)!==t)return;Object.keys(l).forEach(t=>{e.add(l[t])})}}(t.translator);const n=Cm(t);return{qae:{properties:Dm,data:{targets:[n]},exportProperties:({propertyTree:e,hypercubePath:t,viewDataMode:n})=>Sm.hypercube.exportProperties({propertyTree:e,hypercubePath:n?"qUndoExclude.box":t})},ext:_M(t),component(){const n=e.useConstraints(),r=e.useElement(),i=function(){const t=e.useApp(),n=e.useAppLayout(),r=e.useDeviceType(),i=e.useOptions(),o=e.useTheme(),s=e.useTranslator();return e.useMemo(()=>({app:t,appLayout:n,deviceType:r,options:i,theme:o,translator:s}),[t,n,i.direction,i.freeResize,s.language(),o.name(),r])}(),o=i.options.renderer,s=e.useMemo(()=>xm(o),[o]),l=function(){const t=e.useConstraints(),[n,r]=e.useState(!1),[i,o]=e.useState(!1),s=!!e.useLayout().qSelectionInfo.qInSelections,[a]=e.useState(()=>({toggle(){o(e=>!e)}}));return e.useEffect(()=>{t&&r(!t.select&&!t.active)},[t]),e.useAction(()=>({key:"lasso",label:"Lasso",icon:wm,hidden:!n||!s,active:i,action(){o(e=>!e)}}),[s,i,n]),a.enabled=()=>n,a.active=()=>i,a}(),c=e.useModel(),u=e.useSelections(),h=e.useStaleLayout(),d=e.useRenderState(),[f,p]=e.useState();e.useEffect(()=>{const e=a(r),n=new gM(c),o=u,h=new pM({$element:e,backendApi:n,environment:i,flags:t.flags,lasso:l,picasso:s,selectionsApi:o,renderState:d});return p(h),()=>{h.destroy()}},[]);const[,g]=e.usePromise(async()=>{f&&(f.updateEnvironment(i),f.updateConstraints(n),await f.updateData(h),await f.paint())},[h,f,i]);if(g)throw g;var m;!function(t){const n=e.useRect(),r=e.useOptions(),i=e.useConstraints(),[,o]=e.usePromise(async()=>{t&&(t.updateConstraints(i),t.options=r,await t.resize())},[n.width,n.height]);if(o)throw o}(f),m=f,e.onTakeSnapshot(e=>{if(m)return m.setSnapshotData(e)}),e.useImperativeHandle(()=>({getViewState(){if(m)return m.getViewState()}}),[m])}}}});
|
|
29
29
|
//# sourceMappingURL=sn-histogram.js.map
|