@nebula.js/sn-funnel-chart 1.9.0 → 1.9.1

Sign up to get free protection for your applications and to get access to all the features.
package/core/esm/index.js CHANGED
@@ -1,9 +1,9 @@
1
1
  /*
2
- * @nebula.js/sn-funnel-chart v1.9.0
2
+ * @nebula.js/sn-funnel-chart v1.9.1
3
3
  * Copyright (c) 2024 QlikTech International AB
4
4
  * Released under the MIT license.
5
5
  */
6
6
 
7
- import e from"picasso.js";import t from"picasso-plugin-q";import{useElement as n,useSelections as r,useModel as i,useApp as o,useTranslator as a,useOptions as l,useState as u,useEffect as s,useStaleLayout as c,useTheme as f,useConstraints as h,useRect as d,usePlugins as p,useAppLayout as m,usePromise as g,onTakeSnapshot as v}from"@nebula.js/stardust";const y={fill:"steelblue",num:1},b=.9,x=150,w=(e,t,n)=>{let r=0,i=0,o=0,a={},l=0;if("labelCenter"===e)r=t.bottomLeft.x,i=t.topRight.y,o=t.bottomRight.x-t.bottomLeft.x,l=t.bottomRight.y-t.topRight.y,a={share:n.share,fill:n.fill};else{const e=180/Math.PI*Math.atan((t.bottomRight.y-t.topRight.y)/(t.topRight.x-t.bottomRight.x));r=e<15&&e>=0?t.topRight.x:e>-15&&e<0?t.bottomRight.x:e<-15?(t.bottomRight.x-t.topRight.x)/2+t.topRight.x+15:(t.topRight.x-t.bottomRight.x)/2+t.bottomRight.x+15,i=t.topRight.y,o=t.width-r,l=t.bottomRight.y-t.topRight.y,a={fill:n.fill}}return{tag:e,type:"rect",x:r,y:i,width:o,height:l,data:n.data,desc:a,fill:"none"}},M=(e,t)=>{const n=(e=>{const t=(e=>{let t=0;return e.forEach((e=>{e.num>t&&(t=e.num)})),t})(e);let n=0;const r=e.slice().reverse().map((e=>{const r={datum:e,s:n/t,e:e.num/t};return n=e.num,r}));return r.reverse()})(e),r=t.width*b,i=t.height*b,o=(t.width-r)/2,a=(t.height-i)/2,l=r-(r>x&&i>x?100:0),u=(i-1*(n.length-1))/n.length,s=[];return n.forEach(((e,r)=>{const i=(c=e.e,f=r<n.length-1?e.s:e.e,[.5-.5*c,.5+.5*c,.5+.5*f,.5-.5*f]).map((e=>Math.round(e*l+o)));var c,f;const h=u*r+1*r+a,d={bottomRight:{x:i[2],y:Math.round(h+u)},bottomLeft:{x:i[3],y:Math.round(h+u)},topRight:{x:i[1],y:Math.round(h)},topLeft:{x:i[0],y:Math.round(h)},width:t.width},p=`M${d.topLeft.x},${d.topLeft.y} L${d.topRight.x},${d.topRight.y} ${d.bottomRight.x},${d.bottomRight.y} ${d.bottomLeft.x},${d.bottomLeft.y}Z`;s.push({tag:"section",type:"path",d:p,data:e.datum.data,fill:e.datum.fill});const m={share:e.e,fill:e.datum.fill,data:e.datum.data};u>12&&(d.bottomRight.x-d.bottomLeft.x>32&&s.push(w("labelCenter",d,m)),s.push(w("labelLeft",d,m)))})),s},q=(e,t,n,r)=>(r-e)/r*(t-n)+n,C=(e,t,n)=>{const r=e.filter((e=>"NaN"!==e.num&&e.num>0)),i=r.length,o=n.width*b,a=n.height*b,l=Math.round((n.width-o)/2),u=Math.round((n.height-a)/2),s=o-(o>x&&a>x?100:0),c=a-1*(i-1),f=[],h=r[0].data.num.value;let d=u;return r.forEach(((e,r)=>{const i=t[r]*c,o=Math.round(q(d-u,s,.2*s,a)/2),p=Math.round(q(d-u+i,s,.2*s,a)/2),m=l+Math.round(s/2),g={bottomRight:{x:m+p,y:Math.round(d+i)},bottomLeft:{x:m-p,y:Math.round(d+i)},topRight:{x:m+o,y:d},topLeft:{x:m-o,y:d},width:n.width},v=`M${g.topLeft.x},${g.topLeft.y} L${g.topRight.x},${g.topRight.y} ${g.bottomRight.x},${g.bottomRight.y} ${g.bottomLeft.x},${g.bottomLeft.y}Z`;f.push({tag:"section",type:"path",d:v,data:e.data,fill:e.fill});const y={share:e.data.num.value/h,fill:e.fill,data:e.data};i>2&&(g.bottomRight.x-g.bottomLeft.x>32&&f.push(w("labelCenter",g,y)),f.push(w("labelLeft",g,y))),d+=i+1})),f},D=(e,t,n)=>{const r=e.filter((e=>"NaN"!==e.num&&e.num>0));if(r&&r.length>0)switch(t){case"WIDTH":default:return M(r,n);case"ORDER":return C(r,r.map((()=>1/r.length)),n);case"HEIGHT":return C(r,(e=>{const t=e.reduce(((e,t)=>e+t.data.num.value),0);return e.map((e=>e.data.num.value/t))})(r),n);case"AREA":return C(r,((e,t,n)=>{const r=e.reduce(((e,t)=>e+t.data.num.value),0),i=t.width*b,o=t.height*b,a=i*n,l=o*(i+a)/2,u=(i-a)/2/o,s=[];let c=0;for(let t=e.length-1;t>=0;t--){const n=e[t].data.num.value/r,i=2*u*c+a,f=-i/(2*u)+Math.sqrt(i*i/(4*u*u)+n*l/u);s[t]=f/o,c+=f}return s})(r,n,.2),n)}return[]};var k={require:["resolver"],defaultSettings:{settings:{},data:{},style:{item:"$shape"}},render({data:e}){const t=this.resolver.resolve({data:e,defaults:{...y,...this.style.item},settings:this.settings.settings});return D(t.items,this.settings.settings.mode,this.rect)}};const S={version:"1.9.0",color:{auto:!0,autoMinMax:!0,byDimDef:void 0,byMeasureDef:void 0,colorExpression:void 0,dimensionScheme:"12",expressionIsColor:!0,expressionLabel:"",measureMin:void 0,measureMax:void 0,measureScheme:"sg",mode:"primary",paletteColor:{index:6},persistent:!1,reverseScheme:!1,singleColor:void 0,useBaseColors:"off",useDimColVal:!0,useMeasureGradient:!0},dataPoint:{auto:!0,labelMode:"share"},footnote:"",funnel:{mode:"WIDTH"},qHyperCubeDef:{qDimensions:[],qMeasures:[],qInterColumnSortOrder:[],qInitialDataFetch:[{qWidth:2,qHeight:5e3}],qSuppressMissing:!0,qSuppressZero:!1},showDimensionTitle:!0,showTitles:!0,subtitle:"",title:""};function I(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(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?I(Object(n),!0).forEach((function(t){L(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):I(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function O(){O=function(){return e};var e={},t=Object.prototype,n=t.hasOwnProperty,r=Object.defineProperty||function(e,t,n){e[t]=n.value},i="function"==typeof Symbol?Symbol:{},o=i.iterator||"@@iterator",a=i.asyncIterator||"@@asyncIterator",l=i.toStringTag||"@@toStringTag";function u(e,t,n){return Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{u({},"")}catch(e){u=function(e,t,n){return e[t]=n}}function s(e,t,n,i){var o=t&&t.prototype instanceof h?t:h,a=Object.create(o.prototype),l=new D(i||[]);return r(a,"_invoke",{value:w(e,n,l)}),a}function c(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(e){return{type:"throw",arg:e}}}e.wrap=s;var f={};function h(){}function d(){}function p(){}var m={};u(m,o,(function(){return this}));var g=Object.getPrototypeOf,v=g&&g(g(k([])));v&&v!==t&&n.call(v,o)&&(m=v);var y=p.prototype=h.prototype=Object.create(m);function b(e){["next","throw","return"].forEach((function(t){u(e,t,(function(e){return this._invoke(t,e)}))}))}function x(e,t){function i(r,o,a,l){var u=c(e[r],e,o);if("throw"!==u.type){var s=u.arg,f=s.value;return f&&"object"==typeof f&&n.call(f,"__await")?t.resolve(f.__await).then((function(e){i("next",e,a,l)}),(function(e){i("throw",e,a,l)})):t.resolve(f).then((function(e){s.value=e,a(s)}),(function(e){return i("throw",e,a,l)}))}l(u.arg)}var o;r(this,"_invoke",{value:function(e,n){function r(){return new t((function(t,r){i(e,n,t,r)}))}return o=o?o.then(r,r):r()}})}function w(e,t,n){var r="suspendedStart";return function(i,o){if("executing"===r)throw new Error("Generator is already running");if("completed"===r){if("throw"===i)throw o;return{value:void 0,done:!0}}for(n.method=i,n.arg=o;;){var a=n.delegate;if(a){var l=M(a,n);if(l){if(l===f)continue;return l}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if("suspendedStart"===r)throw r="completed",n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);r="executing";var u=c(e,t,n);if("normal"===u.type){if(r=n.done?"completed":"suspendedYield",u.arg===f)continue;return{value:u.arg,done:n.done}}"throw"===u.type&&(r="completed",n.method="throw",n.arg=u.arg)}}}function M(e,t){var n=t.method,r=e.iterator[n];if(void 0===r)return t.delegate=null,"throw"===n&&e.iterator.return&&(t.method="return",t.arg=void 0,M(e,t),"throw"===t.method)||"return"!==n&&(t.method="throw",t.arg=new TypeError("The iterator does not provide a '"+n+"' method")),f;var i=c(r,e.iterator,t.arg);if("throw"===i.type)return t.method="throw",t.arg=i.arg,t.delegate=null,f;var o=i.arg;return o?o.done?(t[e.resultName]=o.value,t.next=e.nextLoc,"return"!==t.method&&(t.method="next",t.arg=void 0),t.delegate=null,f):o:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,f)}function q(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function C(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function D(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(q,this),this.reset(!0)}function k(e){if(e||""===e){var t=e[o];if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var r=-1,i=function t(){for(;++r<e.length;)if(n.call(e,r))return t.value=e[r],t.done=!1,t;return t.value=void 0,t.done=!0,t};return i.next=i}}throw new TypeError(typeof e+" is not iterable")}return d.prototype=p,r(y,"constructor",{value:p,configurable:!0}),r(p,"constructor",{value:d,configurable:!0}),d.displayName=u(p,l,"GeneratorFunction"),e.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===d||"GeneratorFunction"===(t.displayName||t.name))},e.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,p):(e.__proto__=p,u(e,l,"GeneratorFunction")),e.prototype=Object.create(y),e},e.awrap=function(e){return{__await:e}},b(x.prototype),u(x.prototype,a,(function(){return this})),e.AsyncIterator=x,e.async=function(t,n,r,i,o){void 0===o&&(o=Promise);var a=new x(s(t,n,r,i),o);return e.isGeneratorFunction(n)?a:a.next().then((function(e){return e.done?e.value:a.next()}))},b(y),u(y,l,"Generator"),u(y,o,(function(){return this})),u(y,"toString",(function(){return"[object Generator]"})),e.keys=function(e){var t=Object(e),n=[];for(var r in t)n.push(r);return n.reverse(),function e(){for(;n.length;){var r=n.pop();if(r in t)return e.value=r,e.done=!1,e}return e.done=!0,e}},e.values=k,D.prototype={constructor:D,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(C),!e)for(var t in this)"t"===t.charAt(0)&&n.call(this,t)&&!isNaN(+t.slice(1))&&(this[t]=void 0)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var t=this;function r(n,r){return a.type="throw",a.arg=e,t.next=n,r&&(t.method="next",t.arg=void 0),!!r}for(var i=this.tryEntries.length-1;i>=0;--i){var o=this.tryEntries[i],a=o.completion;if("root"===o.tryLoc)return r("end");if(o.tryLoc<=this.prev){var l=n.call(o,"catchLoc"),u=n.call(o,"finallyLoc");if(l&&u){if(this.prev<o.catchLoc)return r(o.catchLoc,!0);if(this.prev<o.finallyLoc)return r(o.finallyLoc)}else if(l){if(this.prev<o.catchLoc)return r(o.catchLoc,!0)}else{if(!u)throw new Error("try statement without catch or finally");if(this.prev<o.finallyLoc)return r(o.finallyLoc)}}}},abrupt:function(e,t){for(var r=this.tryEntries.length-1;r>=0;--r){var i=this.tryEntries[r];if(i.tryLoc<=this.prev&&n.call(i,"finallyLoc")&&this.prev<i.finallyLoc){var o=i;break}}o&&("break"===e||"continue"===e)&&o.tryLoc<=t&&t<=o.finallyLoc&&(o=null);var a=o?o.completion:{};return a.type=e,a.arg=t,o?(this.method="next",this.next=o.finallyLoc,f):this.complete(a)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),f},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),C(n),f}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var r=n.completion;if("throw"===r.type){var i=r.arg;C(n)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,n){return this.delegate={iterator:k(e),resultName:t,nextLoc:n},"next"===this.method&&(this.arg=void 0),f}},e}function T(e){return T="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},T(e)}function E(e,t,n,r,i,o,a){try{var l=e[o](a),u=l.value}catch(e){return void n(e)}l.done?t(u):Promise.resolve(u).then(r,i)}function A(e){return function(){var t=this,n=arguments;return new Promise((function(r,i){var o=e.apply(t,n);function a(e){E(o,r,i,a,l,"next",e)}function l(e){E(o,r,i,a,l,"throw",e)}a(void 0)}))}}function L(e,t,n){return(t=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function F(e,t){if(null==e)return{};var n,r,i=function(e,t){if(null==e)return{};var n,r,i={},o=Object.keys(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||(i[n]=e[n]);return i}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function P(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,i,o,a,l=[],u=!0,s=!1;try{if(o=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;u=!1}else for(;!(u=(r=o.call(n)).done)&&(l.push(r.value),l.length!==t);u=!0);}catch(e){s=!0,i=e}finally{try{if(!u&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(s)throw i}}return l}}(e,t)||$(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 j(e){return function(e){if(Array.isArray(e))return H(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||$(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 $(e,t){if(e){if("string"==typeof e)return H(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)?H(e,t):void 0}}function H(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}var R=Object.prototype.hasOwnProperty,U=Object.prototype.toString,_=Object.defineProperty,z=Object.getOwnPropertyDescriptor,V=function(e){return"function"==typeof Array.isArray?Array.isArray(e):"[object Array]"===U.call(e)},B=function(e){if(!e||"[object Object]"!==U.call(e))return!1;var t,n=R.call(e,"constructor"),r=e.constructor&&e.constructor.prototype&&R.call(e.constructor.prototype,"isPrototypeOf");if(e.constructor&&!n&&!r)return!1;for(t in e);return void 0===t||R.call(e,t)},Y=function(e,t){_&&"__proto__"===t.name?_(e,t.name,{enumerable:!0,configurable:!0,value:t.newValue,writable:!0}):e[t.name]=t.newValue},W=function(e,t){if("__proto__"===t){if(!R.call(e,t))return;if(z)return z(e,t).value}return e[t]},G=function(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}((function e(){var t,n,r,i,o,a,l=arguments[0],u=1,s=arguments.length,c=!1;for("boolean"==typeof l&&(c=l,l=arguments[1]||{},u=2),(null==l||"object"!=typeof l&&"function"!=typeof l)&&(l={});u<s;++u)if(null!=(t=arguments[u]))for(n in t)r=W(l,n),l!==(i=W(t,n))&&(c&&i&&(B(i)||(o=V(i)))?(o?(o=!1,a=r&&V(r)?r:[]):a=r&&B(r)?r:{},Y(l,{name:n,newValue:e(c,a,i)})):void 0!==i&&Y(l,{name:n,newValue:i}));return l}));function K(e,t){return{range:function(e){var n=e.resources,r=e.data,i=n.theme.palette("categorical",0===t?r.items.length:t);return r.items.map((function(e){return i[e.value%i.length]}))},valueAccessor:e.value}}function Z(e,t){return{range:function(e){var n=e.resources,r=e.data,i=n.theme.palette("categorical",0===t?r.items.length:t);return r.items.map((function(e){return i[e.row.value%i.length]}))},valueAccessor:e.value}}function J(e,t,n,r,i){var o,a,l=i.byRow,u=i.byElemNo;if(r&&(t.input.persistent||e.hc.qDimensionInfo.length>1||void 0===n.activeDimensionIndex&&e.hc.qSize.qcy>((null===(a=(o=e.hc).qDataPages[0]||o.qStackedDataPages[0])||void 0===a?void 0:a.qArea.qHeight)||0)))return u(r,r.raw().qCardinal);if(r){var s=t.pic.extract({field:r.key(),trackBy:r.value}).length;return l(r,s)}return{}}function X(e,t){var n=e.hc.qDimensionInfo,r=t.input.byDimDef||{activeDimensionIndex:n.length-1};if(r.activeDimensionIndex>=0){var i=n[r.activeDimensionIndex];r=i.coloring&&i.coloring.colorMapRef?{type:"libraryItem",key:i.coloring.colorMapRef,activeDimensionIndex:r.activeDimensionIndex}:{activeDimensionIndex:r.activeDimensionIndex}}return r}function Q(e,t){var n;return t.activeDimensionIndex>=0?n=e.pic.fields().filter((function(e){return"dimension"===e.type()}))[t.activeDimensionIndex]:"libraryItem"===t.type?!1===(n=t.key?e.pic.field((function(e){return e.raw().colorMapRef===t.key})):void 0)&&(n=e.pic.field((function(e){return"colorByAlternative"===e.raw().id}))):"expression"===t.type&&(n=e.pic.field((function(e){return"colorByAlternative"===e.raw().id}))),n}function ee(e,t,n){e.prototype=t.prototype=n,n.constructor=e}function te(e,t){var n=Object.create(e.prototype);for(var r in t)n[r]=t[r];return n}function ne(){}var re=1/.7,ie="\\s*([+-]?\\d+)\\s*",oe="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",ae="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",le=/^#([0-9a-f]{3,8})$/,ue=new RegExp(`^rgb\\(${ie},${ie},${ie}\\)$`),se=new RegExp(`^rgb\\(${ae},${ae},${ae}\\)$`),ce=new RegExp(`^rgba\\(${ie},${ie},${ie},${oe}\\)$`),fe=new RegExp(`^rgba\\(${ae},${ae},${ae},${oe}\\)$`),he=new RegExp(`^hsl\\(${oe},${ae},${ae}\\)$`),de=new RegExp(`^hsla\\(${oe},${ae},${ae},${oe}\\)$`),pe={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 me(){return this.rgb().formatHex()}function ge(){return this.rgb().formatRgb()}function ve(e){var t,n;return e=(e+"").trim().toLowerCase(),(t=le.exec(e))?(n=t[1].length,t=parseInt(t[1],16),6===n?ye(t):3===n?new Me(t>>8&15|t>>4&240,t>>4&15|240&t,(15&t)<<4|15&t,1):8===n?be(t>>24&255,t>>16&255,t>>8&255,(255&t)/255):4===n?be(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=ue.exec(e))?new Me(t[1],t[2],t[3],1):(t=se.exec(e))?new Me(255*t[1]/100,255*t[2]/100,255*t[3]/100,1):(t=ce.exec(e))?be(t[1],t[2],t[3],t[4]):(t=fe.exec(e))?be(255*t[1]/100,255*t[2]/100,255*t[3]/100,t[4]):(t=he.exec(e))?Ie(t[1],t[2]/100,t[3]/100,1):(t=de.exec(e))?Ie(t[1],t[2]/100,t[3]/100,t[4]):pe.hasOwnProperty(e)?ye(pe[e]):"transparent"===e?new Me(NaN,NaN,NaN,0):null}function ye(e){return new Me(e>>16&255,e>>8&255,255&e,1)}function be(e,t,n,r){return r<=0&&(e=t=n=NaN),new Me(e,t,n,r)}function xe(e){return e instanceof ne||(e=ve(e)),e?new Me((e=e.rgb()).r,e.g,e.b,e.opacity):new Me}function we(e,t,n,r){return 1===arguments.length?xe(e):new Me(e,t,n,null==r?1:r)}function Me(e,t,n,r){this.r=+e,this.g=+t,this.b=+n,this.opacity=+r}function qe(){return`#${Se(this.r)}${Se(this.g)}${Se(this.b)}`}function Ce(){const e=De(this.opacity);return`${1===e?"rgb(":"rgba("}${ke(this.r)}, ${ke(this.g)}, ${ke(this.b)}${1===e?")":`, ${e})`}`}function De(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function ke(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function Se(e){return((e=ke(e))<16?"0":"")+e.toString(16)}function Ie(e,t,n,r){return r<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new Oe(e,t,n,r)}function Ne(e){if(e instanceof Oe)return new Oe(e.h,e.s,e.l,e.opacity);if(e instanceof ne||(e=ve(e)),!e)return new Oe;if(e instanceof Oe)return e;var t=(e=e.rgb()).r/255,n=e.g/255,r=e.b/255,i=Math.min(t,n,r),o=Math.max(t,n,r),a=NaN,l=o-i,u=(o+i)/2;return l?(a=t===o?(n-r)/l+6*(n<r):n===o?(r-t)/l+2:(t-n)/l+4,l/=u<.5?o+i:2-o-i,a*=60):l=u>0&&u<1?0:a,new Oe(a,l,u,e.opacity)}function Oe(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}function Te(e){return(e=(e||0)%360)<0?e+360:e}function Ee(e){return Math.max(0,Math.min(1,e||0))}function Ae(e,t,n){return 255*(e<60?t+(n-t)*e/60:e<180?n:e<240?t+(n-t)*(240-e)/60:t)}ee(ne,ve,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:me,formatHex:me,formatHex8:function(){return this.rgb().formatHex8()},formatHsl:function(){return Ne(this).formatHsl()},formatRgb:ge,toString:ge}),ee(Me,we,te(ne,{brighter(e){return e=null==e?re:Math.pow(re,e),new Me(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=null==e?.7:Math.pow(.7,e),new Me(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new Me(ke(this.r),ke(this.g),ke(this.b),De(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:qe,formatHex:qe,formatHex8:function(){return`#${Se(this.r)}${Se(this.g)}${Se(this.b)}${Se(255*(isNaN(this.opacity)?1:this.opacity))}`},formatRgb:Ce,toString:Ce})),ee(Oe,(function(e,t,n,r){return 1===arguments.length?Ne(e):new Oe(e,t,n,null==r?1:r)}),te(ne,{brighter(e){return e=null==e?re:Math.pow(re,e),new Oe(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=null==e?.7:Math.pow(.7,e),new Oe(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 Me(Ae(e>=240?e-240:e+120,i,r),Ae(e,i,r),Ae(e<120?e+240:e-120,i,r),this.opacity)},clamp(){return new Oe(Te(this.h),Ee(this.s),Ee(this.l),De(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){const e=De(this.opacity);return`${1===e?"hsl(":"hsla("}${Te(this.h)}, ${100*Ee(this.s)}%, ${100*Ee(this.l)}%${1===e?")":`, ${e})`}`}}));const Le=Math.PI/180,Fe=180/Math.PI,Pe=4/29,je=6/29,$e=3*je*je;function He(e){if(e instanceof Re)return new Re(e.l,e.a,e.b,e.opacity);if(e instanceof Be)return Ye(e);e instanceof Me||(e=xe(e));var t,n,r=Ve(e.r),i=Ve(e.g),o=Ve(e.b),a=Ue((.2225045*r+.7168786*i+.0606169*o)/1);return r===i&&i===o?t=n=a:(t=Ue((.4360747*r+.3850649*i+.1430804*o)/.96422),n=Ue((.0139322*r+.0971045*i+.7141733*o)/.82521)),new Re(116*a-16,500*(t-a),200*(a-n),e.opacity)}function Re(e,t,n,r){this.l=+e,this.a=+t,this.b=+n,this.opacity=+r}function Ue(e){return e>.008856451679035631?Math.pow(e,1/3):e/$e+Pe}function _e(e){return e>je?e*e*e:$e*(e-Pe)}function ze(e){return 255*(e<=.0031308?12.92*e:1.055*Math.pow(e,1/2.4)-.055)}function Ve(e){return(e/=255)<=.04045?e/12.92:Math.pow((e+.055)/1.055,2.4)}function Be(e,t,n,r){this.h=+e,this.c=+t,this.l=+n,this.opacity=+r}function Ye(e){if(isNaN(e.h))return new Re(e.l,0,0,e.opacity);var t=e.h*Le;return new Re(e.l,Math.cos(t)*e.c,Math.sin(t)*e.c,e.opacity)}ee(Re,(function(e,t,n,r){return 1===arguments.length?He(e):new Re(e,t,n,null==r?1:r)}),te(ne,{brighter(e){return new Re(this.l+18*(null==e?1:e),this.a,this.b,this.opacity)},darker(e){return new Re(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 Me(ze(3.1338561*(t=.96422*_e(t))-1.6168667*(e=1*_e(e))-.4906146*(n=.82521*_e(n))),ze(-.9787684*t+1.9161415*e+.033454*n),ze(.0719453*t-.2289914*e+1.4052427*n),this.opacity)}})),ee(Be,(function(e,t,n,r){return 1===arguments.length?function(e){if(e instanceof Be)return new Be(e.h,e.c,e.l,e.opacity);if(e instanceof Re||(e=He(e)),0===e.a&&0===e.b)return new Be(NaN,0<e.l&&e.l<100?0:NaN,e.l,e.opacity);var t=Math.atan2(e.b,e.a)*Fe;return new Be(t<0?t+360:t,Math.sqrt(e.a*e.a+e.b*e.b),e.l,e.opacity)}(e):new Be(e,t,n,null==r?1:r)}),te(ne,{brighter(e){return new Be(this.h,this.c,this.l+18*(null==e?1:e),this.opacity)},darker(e){return new Be(this.h,this.c,this.l-18*(null==e?1:e),this.opacity)},rgb(){return Ye(this).rgb()}}));var We=e=>()=>e;function Ge(e,t){var n=t-e;return n?function(e,t){return function(n){return e+n*t}}(e,n):We(isNaN(e)?t:e)}var Ke=function e(t){var n=function(e){return 1==(e=+e)?Ge: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):We(isNaN(t)?n:t)}}(t);function r(e,t){var r=n((e=we(e)).r,(t=we(t)).r),i=n(e.g,t.g),o=n(e.b,t.b),a=Ge(e.opacity,t.opacity);return function(t){return e.r=r(t),e.g=i(t),e.b=o(t),e.opacity=a(t),e+""}}return r.gamma=e,r}(1),Ze=/^class(-pyramid)?/,Je=function(e,t,n,r){var i=void 0!==n.min?n.min:r.min(),o=void 0!==n.max?n.max:r.max(),a=i,l=o,u=t.limits,s={},c="percent"===t.limitType?u.map((function(e){return i+(o-i)*e})):u,f=t.colors.map((function(t){return e.resolveUIColor(t)}));if(i=Math.min.apply(Math,[i].concat(j(c))),o=Math.max.apply(Math,[o].concat(j(c))),s.min=i,s.max=o,t.breakTypes&&-1===t.breakTypes.indexOf(!0))s.type="categorical",Object.assign(s,function(e){var t=e.min,n=e.max,r=e.limits,i=e.range,o=[],a=[];if(r.length)if(r[r.length-1]<t)a.push(t,n),o.push(i[i.length-1],i[i.length-1],i[i.length-1]);else if(r[0]>n)a.push(t,n),o.push(i[0],i[0],i[0]);else{if(r[0]>t)a.push(t),o.push(i[0]);else{a.push(t);for(var l=0;l<r.length;l++)if(t<r[l]){o.push(i[l]);break}}for(var u=0;u<r.length;u++)t<r[u]&&r[u]<n&&(a.push(r[u]),o.push(i[u]));if(r[r.length-1]<n)a.push(n),o.push(i[r.length]),o.push(i[r.length]);else{a.push(n);for(var s=0;s<r.length;s++)if(r[s]>n){o.push(i[s]),o.push(i[s]);break}}}else o.push(i[0]);return{min:t,max:n,range:o,domain:a}}({min:"percent"===t.limitType?i:a,max:"percent"===t.limitType?o:l,range:f,limits:"percent"===t.limitType?c:u}));else if(t.breakTypes){var h=t.breakTypes;s.type="continuous",s.domain=[i],s.range=[f[0]];for(var d=0;d<c.length;d+=1)if(h[d]){var p=f[d],m=f[d+1],g=Ke(p,m)(.5);s.range.push(g),s.domain.push(c[d]),d<c.length-1&&h[d+1]&&(s.range.push(f[d+1]),s.domain.push((c[d]+c[d+1])/2))}else s.range.push(f[d]),s.range.push(f[d+1]),s.domain.push(c[d]),s.domain.push(c[d]+Math.min(1e-6,(o-i)/1e6));s.range.push(f[f.length-1]),s.domain.push(o)}else s.domain=c,s.range=f;return s};function Xe(e,t,n,r,i){var o,a,l,u=0,s=[],c=(e-t)/(r+1);if(0===c)return 1;for(o=0;o<n.length;o+=1)a=.99*(n[o]-t),l=n[o]>e?Math.floor(e/c):n[o]<t?0:Math.floor(a/c),Number.isNaN(l)||(s[l]?s[l]+=1:s[l]=1);for(o=0;o<s.length;o+=1)s[o]&&(u+=1);return u<=r||u>=i?Math.max(u,r):Xe(e,t,n,r+1,i)}var Qe=function(e,t,n,r){var i,o,a=t.theme,l=t.hc,u=r.f,s={mode:"field",fieldType:"measure",field:u?u.key():void 0,reverse:n.input.reverseScheme||!1,type:"continuous",range:function(e){return e.resources.theme.palette("quant")}},c=[],f=!0;if(u){if(Number.isNaN(+u.min())||Number.isNaN(+u.max()))return{invalid:!0};(f=!("S"===(i=n.pic.raw()).qMode&&(i.qDataPages[0]&&i.qSize.qcy>i.qDataPages[0].qArea.qHeight||!i.qDataPages.length&&i.qSize.qcy>0)||"K"===i.qMode&&i.qStackedDataPages[0]&&i.qSize.qcy>i.qStackedDataPages[0].qArea.qHeight||"T"===i.qMode&&i.qSize.qcy>i.qTreeDataPages[0].qGroupSize))&&(c=n.pic.extract({field:0,props:{num:{field:u.key()},exclude:{fields:l.qDimensionInfo.map((function(e,t){return{field:"qDimensionInfo/".concat(t)}})),value:function(e){return Math.min.apply(Math,j(e))<0}}}}).filter((function(e){return e.value>=0&&!e.exclude.value})).map((function(e){return e.num.value})).filter((function(e){return"number"==typeof e})))}if(!1===n.input.autoMinMax){if(s.min=n.input.measureMin,s.max=n.input.measureMax,s.max<s.min)return{invalid:!0}}else if(u&&!f)s.min=u.min(),s.max=u.max();else if(u){if(!c.length)return{invalid:!0};s.min=Math.min.apply(Math,j(c)),s.max=Math.max.apply(Math,j(c))}if(n.input.measureScheme&&(s.palettes={quant:n.input.measureScheme}),a){var h=a.getDataColorScales().filter((function(e){return e.key===n.input.measureScheme}))[0];s.type=h&&Ze.test(h.type)?"categorical":"continuous","categorical"===s.type&&(o=h.colors.some((function(e){return Array.isArray(e)}))?Math.max.apply(Math,j(h.colors.map((function(e){return e?e.length:0})))):h.colors.length)}if("categorical"===s.type){for(var d=f?Xe(s.max,s.min,c,1,o):o,p=(s.max-s.min)/d,m=[],g=0;g<d+1;g+=1)m.push(s.min+p*g);s.domain=m,s.range=function(e){for(var t=e.resources.theme.palette("quant",d),n=Math.max(1,Math.floor(t.length/d)),r=[],i=0;i<d;i+=1)r.push(t[i*n]);return[r[0]].concat(r,[r[r.length-1]])}}return s};function et(e,t){var n;return t.activeMeasureIndex>=0?n=e.pic.fields().filter((function(e){return"measure"===e.type()}))[t.activeMeasureIndex]:"libraryItem"===t.type?n=e.pic.field((function(e){return e.raw().colorMapRef===t.key&&void 0!==t.key})):"expression"===t.type&&(n=e.pic.field((function(e){return"colorByAlternative"===e.raw().id}))),n||(n=e.pic.field((function(e){return void 0!==e.raw().matchMeasure})))&&(n=e.pic.fields().filter((function(e){return"measure"===e.type()}))[n.raw().matchMeasure]),n}function tt(e){var t,n=e.cm,r=e.defaults,i=e.index,o=e.input,a=e.pic;if(!o||!o.on)return null;var l=null!==(t=o.mode)&&void 0!==t?t:"primary";return"primary"===l?function(e,t,n){var r=n.primary;return void 0!==t.paletteColor&&t.paletteColor&&(r=e.resolveUIColor(t.paletteColor)),N(N({},n),{},{mode:"constant",type:"constant",primary:r})}(n,o,r):"byExpression"===l?function(e,t,n){var r="qMeasureInfo/".concat(e,"/"),i=t.field((function(e){return e.id().startsWith(r)&&"colorByMeasureExpression"===e.raw().id})),o=i;return N(N({},n),{},o?{mode:"field",fieldType:"expression",field:i?i.key():void 0,type:"color"}:{mode:"constant",type:"constant",primary:n.nil})}(i,a,r):null}function nt(e){e.measureOverrides.every((function(e){return!e}))&&(e.measureOverrides=null)}function rt(e,t){for(var n=(null==t?void 0:t.domain)||[],r=(null==t?void 0:t.range)||[],i=[],o=0;o<e.length;++o){var a=e[o];if("constant"===(null==a?void 0:a.mode)){var l=n.indexOf(o);-1===l?(n.push(o),r.push(a.primary)):r[l]=a.primary,e[o]=null}else if(a){i.push(o);var u=n.indexOf(o);-1!==u&&(n.splice(u,1),r.splice(u,1))}}return{domain:n,range:r,exclude:i}}function it(e,t,n,r){var i,o=function(e,t,n,r){if(t.input&&!t.input.auto){if("byMeasure"===t.input.mode)return function(e,t,n){var r=t.theme,i=t.hc,o=(arguments.length>3&&void 0!==arguments[3]?arguments[3]:{}).getCField,a=void 0===o?et:o,l=n.input.byMeasureDef||{activeMeasureIndex:0},u=a(n,l),s=Qe(0,{theme:r,hc:i},n,{f:u});if(s.invalid)return s;"expression"===l.type&&(l.activeMeasureIndex<0||void 0===l.activeMeasureIndex)&&(s.label=l.label,u&&"color.altLabel"===u.raw().labelExpRef&&(s.label=n.input.altLabel)),!s.label&&u&&(s.label=u.title());var c=l.activeMeasureIndex>=0?u:null;if(!c&&u&&void 0!==u.raw().matchMeasure&&u.raw().matchMeasure>-1&&(c=n.pic.fields().filter((function(e){return"measure"===e.type()}))[u.raw().matchMeasure]),n.input.useMeasureGradient&&"libraryItem"===l.type)if(c){var f=c.raw().coloring;f&&f.gradient&&G(s,Je(e,f.gradient,s,c))}else s.auxiliary=l;return s}(e,n,t);if("byDimension"===t.input.mode)return function(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},i=r.getCDef,o=void 0===i?X:i,a=r.getCByField,l=void 0===a?Q:a,u=r.getPersistence,s=void 0===u?J:u,c=o(t,n),f=l(n,c),h=f?f.raw():{},d=n&&n.pic?n.pic.raw():{};if(h.qError||h.qSize&&0===h.qSize.qcy&&!d.qHasOtherValues)return{invalid:!0};var p={mode:"field",fieldType:"dimension",type:"categorical",field:f?f.key():void 0,isFieldLocked:h.qLocked};return("expression"===c.type||c.activeDimensionIndex<0)&&(p.label=c.label,"color.altLabel"===h.labelExpRef&&(p.label=n.input.altLabel)),!p.label&&f&&(p.label=f.title()),n.input.dimensionScheme&&(p.palettes={categorical:n.input.dimensionScheme}),n.input.useDimColVal&&"libraryItem"===c.type&&(p.auxiliary=c),G(p,s(t,n,c,f,{byRow:Z,byElemNo:K})),p}(e,n,t);if("byExpression"===t.input.mode)return function(e,t,n,r){var i=t.hc,o=t.theme,a=t.translator,l=n.pic.field((function(e){return"colorByExpression"===e.raw().id}));if(!l||!l.raw().qFallbackTitle&&!n.input.colorExpression||!(Number.isFinite(l.raw().qMin)&&Number.isFinite(l.raw().qMax)||n.input.expressionIsColor))return{mode:"constant",type:"constant",primary:r.nil};if(n.input.expressionIsColor)return{mode:"field",fieldType:"expression",field:l?l.key():void 0,type:"color"};var u=Qe(0,{hc:i,theme:o},n,{f:l});return u.invalid||(u.label=n.input.expressionLabel||a.get("Object.ChartTooltip.ColorExpression")),u}(0,n,t,r);if("byMultiple"===t.input.mode||"primary"===t.input.mode)return function(e,t,n,r){var i=t.hc,o=t.theme,a=t.translator,l=n.input.useBaseColors;if(("byMultiple"===n.input.mode||"primary"===n.input.mode&&"measure"===n.input.useBaseColors)&&i.qMeasureInfo.length>1&&(l="measure"),"measure"===l){var u=[],s=[];"measure"===n.input.useBaseColors&&i.qMeasureInfo.forEach((function(t,n){if(t.baseColor||t.coloring&&t.coloring.baseColor){u.push(n);var i=e.resolveUIColor(t.baseColor||t.coloring.baseColor);"none"===i?s.push(r.primary):s.push(i)}}));var c=n.input.dimensionScheme?{categorical:n.input.dimensionScheme}:void 0,f=o?o.getDataColorPalettes()[0]:void 0;return"measure"===n.input.useBaseColors&&f&&(c={categorical:f.key}),{mode:"measure",type:"categorical",palettes:c,label:a?a.get("Common.Measures"):void 0,explicit:u.length?{domain:u,range:s}:void 0}}if("dimension"===l){var h=[],d=[];return i.qDimensionInfo.forEach((function(t,n){if(t.baseColor||t.coloring&&t.coloring.baseColor){h.push(n);var i=e.resolveUIColor(t.baseColor||t.coloring.baseColor);"none"===i?d.push(r.primary):d.push(i)}})),{mode:"dimension",type:"categorical",field:h.length?h[0]:void 0,explicit:h.length?{domain:h,range:d}:void 0}}var p=r.primary;if(void 0!==n.input.paletteColor)n.input.paletteColor&&(p=e.resolveUIColor(n.input.paletteColor));else{var m=n.input.singleColor;"number"!=typeof m||Number.isNaN(m)||(p=["#b0afae","#7b7a78","#545352","#4477aa","#7db8da","#b6d7ea","#46c646","#f93f17","#ffcf02","#276e27","#ffffff","#000000"][m])}return{mode:"constant",type:"constant",primary:p}}(e,n,t,r)}return{}}(e,t,n,r);return null!==(i=t.input)&&void 0!==i&&i.measureOverrides?(o.measureOverrides=t.input.measureOverrides.map((function(n,i){return tt({cm:e,input:n,defaults:r,index:i,pic:t.pic})})),function(e,t){var n,r,i,o=t.translator;if(nt(e),1===(null===(n=e.measureOverrides)||void 0===n?void 0:n.length))return e.measureOverrides[0];if("measure"===e.mode&&e.measureOverrides&&(e.explicit=rt(e.measureOverrides,e.explicit),nt(e)),null!==(r=e.measureOverrides)&&void 0!==r&&r.every((function(e){return"constant"===(null==e?void 0:e.mode)}))){var a={mode:"measure",type:"categorical",label:null==o?void 0:o.get("Common.Measures")};return a.explicit=rt(e.measureOverrides),a}return null!==(i=e.measureOverrides)&&void 0!==i&&i.every((function(e){return e}))?{invalid:!0,measureOverrides:e.measureOverrides}:e}(o,n)):o}function ot(e){var t=N({hc:null,colorProps:null,layout:null,theme:null},e),n={},r={auto:function(){return{mode:"primary"}},getDimensionColorMap:function(){return Promise.reject()},getMeasure:function(){return Promise.reject()},getAttributeDimension:function(){return Promise.reject()}},i={auto:function(e){return e?(r.auto=e,i):r.auto},getDimensionColorMap:function(e){return e?(r.getDimensionColorMap=e,i):r.getDimensionColorMap},getAttributeDimension:function(e){return e?(r.getAttributeDimension=e,i):r.getAttributeDimension},getMeasure:function(e){return e?(r.getMeasure=e,i):r.getMeasure},set:function(e){var i;if(!e.colorProps)throw new Error('Missing "colorProps"');if(G(t,e),(n={pic:t.picasso.data("q")({data:t.hc,config:{localeInfo:t.localeInfo}}),input:t.colorProps}).input.auto){var o=r.auto(e.layout);n.input=G(!0,{},n.input,o,{auto:!1});var a=t.theme?t.theme.getDataColorPalettes():[];a[0]&&(n.input.dimensionScheme=a[0].key);var l=0;n.input.byDimDef&&+n.input.byDimDef.activeDimensionIndex>=0&&(l=+n.input.byDimDef.activeDimensionIndex),t.hc&&t.hc.qDimensionInfo[l]&&t.hc.qDimensionInfo[l].coloring&&t.hc.qDimensionInfo[l].coloring.colorMapRef&&n.input.byDimDef&&(n.input.byDimDef.type="libraryItem",n.input.byDimDef.key=t.hc.qDimensionInfo[l].coloring.colorMapRef)}null!==(i=n.input.measureOverrides)&&void 0!==i&&i.every((function(e){return!e||!e.on}))&&(n.input=G(!1,{},n.input,{measureOverrides:null}))},palettes:function(){if(!n.palettes){var e=t.theme,r=[];(e&&e.getDataColorPickerPalettes()||[]).forEach((function(e){r.push({key:"ui",colors:e.colors})})),n.palettes=r}return n.palettes},getAuxiliaryData:function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"/qHyperCubeDef";if(!e.auxiliary&&!/qAttrDimInfo/.test(e.field))return Promise.resolve();var i=(e.auxiliary||{}).key;if("measure"===e.fieldType)return r.getMeasure(i,t).catch((function(){}));if("dimension"===e.fieldType){var o="".concat(n,"/").concat(e.field).replace("qDimensionInfo","qDimensions").replace("qAttrDimInfo","qAttributeDimensions");return Promise.all([/qAttrDimInfo/.test(e.field)?r.getAttributeDimension(o,t).catch((function(){})):Promise.resolve(),i?r.getDimensionColorMap(i,t).catch((function(){})):Promise.resolve()])}return Promise.resolve()},getAuxiliarySettings:function(e,r){var i=this;return e.auxiliary||/qAttrDimInfo/.test(e.field)?(this.palettes(),this.getAuxiliaryData(e,r).then((function(r){if(!r)return{};if("measure"===e.fieldType){if(r.coloring&&r.coloring.gradient){var o=n.pic.field(e.field);return Je(i,r.coloring.gradient,e,o)}return{}}if("dimension"===e.fieldType){var a={nil:e.nil,others:e.others},l=r[0],u=r[1]?r[1].colorMap:null;if(l){var s=t.picasso.data("q")({data:{qDimensionInfo:[n.pic.field(e.field).raw(),n.pic.field(e.field).raw()],qMeasureInfo:[],qDataPages:l,qInterColumnSortOrder:[0,1],qMode:"S"}});a.legendDataset=s}return u?function(e,t,n,r){var i=r.external,o=r.field,a=N({},e);G(a,K(o,o.raw().qCardinal));var l=i.theme?i.theme.getDataColorPalettes()[0]:null;return t.nul&&(a.nil=n.resolveUIColor(t.nul)),t.oth&&(a.others=n.resolveUIColor(t.oth)),t.usePal?(a.palettes={categorical:t.pal},l&&!t.pal&&(a.palettes.categorical=l.key,G(a,K(o)))):!1===t.autoFill&&t.single?a.range=[n.resolveUIColor(t.single)]:t.autoFill&&(l&&(a.palettes={categorical:l.key}),G(a,K(o))),t.colors&&t.colors.length&&(a.explicit=function(e,t,n){for(var r={},i=0;i<e.length;i+=1)r[e[i].value]=e[i].baseColor;var o=[];return{domain:function(e){var i=e.data,a=[];o=[];for(var l=0;l<i.items.length;l++){var u=i.items[l],s=(u.text||u).label;r[s]&&-1===a.indexOf(u.value)&&(a.push(u.value),o.push(t.resolveUIColor(r[s])))}return a.push(-3,-2),o.push(n.others),o.push(n.nil),a},range:function(){return o}}}(t.colors,n,a)),a}(a,u,i,{external:t,field:n.pic.field(e.field)}):a}return{}}))):Promise.resolve()},resolveUIColor:function(e){if(e.index<0||void 0===e.index)return e.color;if(void 0===n.uiPalette&&(n.uiPalette=this.palettes().filter((function(e){return"ui"===e.key}))[0]||!1),!n.uiPalette)return e.color;var t="none"===n.uiPalette.colors[0]?e.index:e.index-1;return void 0===n.uiPalette.colors[t]?e.color:n.uiPalette.colors[t]},settings:function(){if(this.palettes(),!n.settings){var e={primary:"steelblue",others:"#aaa",nil:"#ddd"},r=t.theme;r&&(e=N(N({},e),r.getDataColorSpecials())),n.settings=G(e,it(this,n,t,e))}return n.settings}};return i}var at=function(e,t){var n=e.fieldType,r={};if(t)if("measure"===n){var i=t.coloring;i&&(r.measureGradient=i.gradient)}else if("dimension"===n){var o=t[0],a=t[1];o&&(r.legendDataPage=o),a&&(r.dimValsData=a.colorMap)}return r},lt=function(e){throw e.isHandled=!0,e},ut=function(e,t){var n=t.layout,r=t.app;return n&&n.snapshotData?n.snapshotData.content&&n.snapshotData.content.chartData&&n.snapshotData.content.chartData.dimValsData?Promise.resolve({colorMap:n.snapshotData.content.chartData.dimValsData}):Promise.reject():r&&r.getObject?r.getObject("ColorMapModel_".concat(e)).then((function(e){return e.getLayout()})):Promise.reject()},st=function(e,t){var n=t.layout,r=t.app;return n&&n.snapshotData?n.snapshotData.content&&n.snapshotData.content.chartData&&n.snapshotData.content.chartData.measureGradient?Promise.resolve({coloring:{gradient:n.snapshotData.content.chartData.measureGradient}}):Promise.reject():r&&r.getMeasure?r.getMeasure(e).then((function(e){return e.getMeasure()})):Promise.reject()},ct=function(e,t){var n=t.layout,r=t.model,i=t.app;return n&&n.snapshotData?n.snapshotData.content&&n.snapshotData.content.chartData&&n.snapshotData.content.chartData.legendDataPage?Promise.resolve(n.snapshotData.content.chartData.legendDataPage):Promise.reject():r&&r.session&&i?r.getHyperCubeData(e,[{qHeight:100,qLeft:0,qTop:0,qWidth:2}]).catch(lt):Promise.reject()};function ft(e){return function(t){return"object"===T(t.datum[e])?t.datum[e].value:void 0}}function ht(e){return"object"===T(e.datum.isNull)?e.datum.isNull.value:-2===e.datum.value}function dt(e){return-3===e.datum.value}var pt={TITLE:{COLOR:void 0,FONT_SIZE:"16px",FONT_FAMILY:"'Source Sans Pro', 'Arial', 'sans-serif'"},LABEL:{COLOR:void 0,FONT_SIZE:void 0,FONT_FAMILY:"'Source Sans Pro', 'Arial', 'sans-serif'"}};function mt(e){var t=e.theme,n=e.key,r=e.styleOverrides,i={title:{color:pt.TITLE.COLOR,fontSize:pt.TITLE.FONT_SIZE,fontFamily:pt.TITLE.FONT_FAMILY},label:{color:pt.LABEL.COLOR,fontSize:pt.LABEL.FONT_SIZE,fontFamily:pt.LABEL.FONT_FAMILY}};if(!t&&!r)return i;var o=r||{},a=o.title,l=o.label,u=function(e){var t=e.theme,n=e.key;return function(e,r,i,o){return void 0!==e?e:t?t.getStyle(n,r,i):o}}({theme:t,key:n});return i.title.color=u(null==a?void 0:a.color,"legend.title","color",pt.TITLE.COLOR),i.title.fontSize=u(null==a?void 0:a.fontSize,"legend.title","fontSize",pt.TITLE.FONT_SIZE),i.title.fontFamily=u(null==a?void 0:a.fontFamily,"legend.title","fontFamily",pt.TITLE.FONT_FAMILY),i.label.color=u(null==l?void 0:l.color,"legend.label","color",pt.LABEL.COLOR),i.label.fontSize=u(null==l?void 0:l.fontSize,"legend.label","fontSize",pt.LABEL.FONT_SIZE),i.label.fontFamily=u(null==l?void 0:l.fontFamily,"legend.label","fontFamily",pt.LABEL.FONT_FAMILY),i}var gt=function(e,t,n){var r=e&&e.dock||void 0;if("auto"!==r)return r||"right";if(t){var i=t.element.getBoundingClientRect();if(i.height>i.width)return"bottom"}return n?"left":"right"},vt=function(e,t,n){return!(n.invalid||"color"===n.type||"measure"===n.mode&&t.qMeasureInfo.length<=1||"dimension"===n.mode)&&("function"==typeof e.show?e.show():!1!==e.show)};function yt(e,t){var n=e.styleReference,r=e.styleOverrides,i=e.chart,o=e.rtl,a=t.legendProps,l=t.coloring,u=t.theme,s=t.hc,c=mt({theme:u,key:n,styleOverrides:r});return{layout:{minimumLayoutMode:"MEDIUM",dock:gt(a,i,o)},show:"function"==typeof a.show?function(){return vt(a,s,l)}:vt(a,s,l),renderer:"svg",mounted:function(e){e.childNodes[0].style.pointerEvents="none",e.style.overflow="hidden"},settings:{title:{show:!1!==a.showTitle,wordBreak:"break-word",maxLines:2,lineHeight:1.2,text:l.label||"",fill:c.title.color,fontSize:c.title.fontSize,fontFamily:c.title.fontFamily}}}}function bt(e,t,n){return"categorical"===t.coloring.type?function(e,t,n){var r=yt(e,t);if(!r.show)return!1;var i,o=e.key,a=e.styleReference,l=e.styleOverrides,u=e.viewState,s=e.rtl,c=e.settings,f=e.style,h=t.scaleKey,d=t.theme,p=t.scales,m=mt({theme:d,key:a,styleOverrides:l}),g=r.layout.dock,v="left"===g||"right"===g?{maxLines:2,wordBreak:"break-word"}:{},y={up:"M13.6,11 L2.4,11 C2.28954305,11 2.2,10.9104569 2.2,10.8 C2.2,10.756726 2.21403557,10.7146192 2.24,10.68 L7.84,3.21333333 C7.90627417,3.12496777 8.03163444,3.10705916 8.12,3.17333333 C8.13516113,3.18470418 8.14862915,3.1981722 8.16,3.21333333 L13.76,10.68 C13.8262742,10.7683656 13.8083656,10.8937258 13.72,10.96 C13.6853808,10.9859644 13.643274,11 13.6,11 Z",down:"M2.4,4 L13.6,4 C13.7104569,4 13.8,4.08954305 13.8,4.2 C13.8,4.24327404 13.7859644,4.28538077 13.76,4.32 L8.16,11.7866667 C8.09372583,11.8750322 7.96836556,11.8929408 7.88,11.8266667 C7.86483887,11.8152958 7.85137085,11.8018278 7.84,11.7866667 L2.24,4.32 C2.17372583,4.23163444 2.19163444,4.10627417 2.28,4.04 C2.31461923,4.01403557 2.35672596,4 2.4,4 Z",left:"M11,2.4 L11,13.6 C11,13.7104569 10.9104569,13.8 10.8,13.8 C10.756726,13.8 10.7146192,13.7859644 10.68,13.76 L3.21333333,8.16 C3.12496777,8.09372583 3.10705916,7.96836556 3.17333333,7.88 C3.18470418,7.86483887 3.1981722,7.85137085 3.21333333,7.84 L10.68,2.24 C10.7683656,2.17372583 10.8937258,2.19163444 10.96,2.28 C10.9859644,2.31461923 11,2.35672596 11,2.4 Z",right:"M4,13.6 L4,2.4 C4,2.28954305 4.08954305,2.2 4.2,2.2 C4.24327404,2.2 4.28538077,2.21403557 4.32,2.24 L11.7866667,7.84 C11.8750322,7.90627417 11.8929408,8.03163444 11.8266667,8.12 C11.8152958,8.13516113 11.8018278,8.14862915 11.7866667,8.16 L4.32,13.76 C4.23163444,13.8262742 4.10627417,13.8083656 4.04,13.72 C4.01403557,13.6853808 4,13.643274 4,13.6 Z"};"dimension"===t.coloring.fieldType&&(i=function(e){return e.datum.value>=0||-3===e.datum.value});var b="".concat(h,"Legend");return G(!0,r,{type:"legend-cat",key:"".concat(o,"-cat"),scale:b in p?b:h,settings:{layout:{scrollOffset:function(){return u?u.get("legendScrollOffset"):void 0},size:-1!==["top","bottom"].indexOf(r.layout.dock)?2:1,direction:s?"rtl":"ltr",horizontal:20},item:{show:i,label:N({fill:m.label.color,fontSize:m.label.fontSize,fontFamily:m.label.fontFamily},v)},navigation:{disabled:n,button:{content:function(e,t){var n=t.direction;return e("i",{style:{"pointer-events":"none",fontSize:"12px",display:"inline-block",fontStyle:"normal",lineHeight:"0",textAlign:"center",textTransform:"none",verticalAlign:"-0.125em",textRendering:"optimizelegibility",margin:"0px"}},[e("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 16 16",fill:"currentColor"},[e("path",{d:y[n]})])])}}}},brush:{consume:[{context:"selection",data:["",o],style:{inactive:{opacity:.3}}}]}},{settings:c,style:f})}(e,t,n):"continuous"===t.coloring.type&&function(e,t){var n,r=e.key,i=e.styleReference,o=e.styleOverrides,a=e.rtl,l=e.settings,u=e.style,s=t.scaleKey,c=t.theme,f="".concat(s,"Range"),h=yt(e,t);if(!h.show)return!1;var d=mt({theme:c,key:i,styleOverrides:o}),p=h.layout.dock,m="right"===p||"left"===p,g=null===(n=t.scales)||void 0===n?void 0:n[f];return m&&g&&(g.invert=!0),G(!0,h,{type:"legend-seq",key:"".concat(r,"-seq"),settings:{fill:s,major:f,length:1,tick:{fill:d.label.color,fontSize:d.label.fontSize,fontFamily:d.label.fontFamily},title:{anchor:!a||"top"!==h.layout.dock&&"bottom"!==h.layout.dock?void 0:"right",padding:parseFloat(h.settings.title.fontSize)||16}}},{settings:l,style:u})}(e,t)}function xt(e,t,n){var r=[],i=[],o=bt(e,t,n&&n.navigationDisabled);return r.push(o),o&&"legend-cat"===o.type&&(i.push(function(e){var t=e.key,n=e.requireFailure,r=e.recognizeWith,i=(arguments.length>1&&void 0!==arguments[1]?arguments[1]:{}).actions;return{key:"event:tap-".concat(t),type:"Tap",requireFailure:n,recognizeWith:r,options:{event:"legendtap",interval:10,pointers:1,enable:function(e,n){var r;if(!n)return!0;if(null!=i&&null!==(r=i.interact)&&void 0!==r&&r.enabled&&!i.interact.enabled())return!1;if(!this.chart.componentsFromPoint({x:n.center.x,y:n.center.y}).some((function(e){return e.key==="".concat(t,"-cat")})))return!1;var o=n.srcEvent.target;return!!(o&&o.hasAttribute("data-action")&&o.hasAttribute("data-component-key"))||!(!o||!o.childNodes[0]||"BUTTON"!==o.childNodes[0].nodeName)}},events:{legendtap:function(e){e.preventDefault();var t=e.srcEvent.target;t&&t.hasAttribute("data-action")&&t.hasAttribute("data-component-key")&&this.chart.component(t.getAttribute("data-component-key")).emit(t.getAttribute("data-action"))}}}}(e,n)),i.push(function(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=t.eventName,r=t.key,i=t.requireFailure,o=t.recognizeWith,a=(arguments.length>1&&void 0!==arguments[1]?arguments[1]:{}).actions;return{key:"event:pan-".concat(r),type:"Pan",requireFailure:i,recognizeWith:o,options:{event:n,pointers:1,threshold:10,enable:function(e,t){var i;return this.started===n||!t||!(null!=a&&null!==(i=a.interact)&&void 0!==i&&i.enabled&&!a.interact.enabled())&&this.chart.componentsFromPoint({x:t.center.x,y:t.center.y}).some((function(e){return e.key==="".concat(r,"-cat")}))}},events:(e={},L(e,"".concat(n,"start"),(function(e){e.preventDefault(),this.started!==n&&(this.started=n,this.chart.component("".concat(r,"-cat")).emit("panstart",e))})),L(e,"".concat(n,"move"),(function(e){e.preventDefault(),this.chart.component("".concat(r,"-cat")).emit("panmove",e)})),L(e,"".concat(n,"end"),(function(e){e.preventDefault(),this.chart.component("".concat(r,"-cat")).emit("panend",e),this.started=!1})),e)}}(e,n))),{interactions:i,components:r}}var wt=function(e){return"rgba(".concat([(16711680&e)>>16,(65280&e)>>8,255&e,((4278190080&e)>>>24)/255].join(","),")")};function Mt(e){var t=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.auto,n=ot(e.resources).auto(t||function(){return{mode:"byDimension",persistent:!1,useDimColVal:!0,byDimDef:{activeDimensionIndex:0,type:"expression",label:""}}}).getDimensionColorMap((function(e,t){var n=t.layout,r=t.app;return ut(e,{layout:n,app:r})})).getMeasure((function(e,t){var n=t.layout,r=t.app;return st(e,{layout:n,app:r})})).getAttributeDimension((function(e,t){var n=t.layout,r=t.model,i=t.app;return ct(e,{layout:n,model:r,app:i})}));return n.getSnapshotData=at,n}({resources:e}),n={},r={},i=function(e){return r.settings||(e||console.warn("settings() called before auxiliarySettings()"),r.settings=t.settings()),r.settings},o={config:function(i){if(n=N({},i),r={},!n.key)throw new Error("Missing key");t.set(N(N({},e),n))},auto:function(e){return e?(t.auto(e),o):t.auto()},getAuxiliarySettings:function(e){return r.auxiliarySettings?Promise.resolve(r.auxiliarySettings):t.getAuxiliarySettings(i(!0),e).then((function(e){return r.auxiliarySettings=e||{},r.settings=N(N({},r.settings),r.auxiliarySettings),r.scales=void 0,r.color=void 0,r.auxiliarySettings}))},getAuxiliaryData:function(){return t.getAuxiliaryData(i())},getSnapshotData:function(e){var n=i();return t.getAuxiliaryData(n,e).then((function(e){return t.getSnapshotData(n,e)}))},resolveUIColor:function(e){return t.resolveUIColor(e)},settings:function(){var e=i();return{mode:e.mode,type:e.type,label:e.label,field:e.field,fieldType:e.fieldType,nil:e.nil,others:e.others,primary:e.primary}},settingsForMeasure:function(e){var t;return(null===(t=i().measureOverrides)||void 0===t?void 0:t[e])||this.settings()},isSelectionLocked:function(e){var t=e.isMeasureSelectionLocked;return function(e,t){var n=t.isMeasureSelectionLocked;return"field"!==e.mode||("dimension"===e.fieldType?e.isFieldLocked:"measure"!==e.fieldType||n)}(i(),{isMeasureSelectionLocked:t})},palettes:function(){return function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.colorProps,n=e.coloring,r=e.theme,i=[];if(n&&n.palettes&&r){var o=n.palettes.categorical||t.dimensionScheme,a=r.getDataColorPalettes().filter((function(e){return e.key===o}))[0]||r.getDataColorPalettes()[0];o&&a&&i.push({key:"categorical",colors:a.colors});var l=n.palettes.metric||t.measureScheme,u=r.getDataColorScales().filter((function(e){return e.key===l}))[0];if(u){var s=u.colors[0]?u.colors:[[]].concat(j(u.colors.slice(1)));s=Array.isArray(s[0])?s.map((function(e){return e.slice().reverse()})):s.slice().reverse(),i.push({key:"quant",colors:s})}}return i}({coloring:i(),colorProps:n.colorProps,theme:n.theme})},scales:function(){return r.scales=r.scales||function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.hc,n=e.coloring,r=e.rtl,i=e.key,o=e.source,a=e.picasso,l={},u=i;if(n){var s={override:!0,domain:n.explicit&&"function"==typeof n.explicit.domain?n.explicit.domain:[].concat(j((n.explicit||{}).domain||[]),[-3,-2]),range:n.explicit&&"function"==typeof n.explicit.range?n.explicit.range:[].concat(j((n.explicit||{}).range||[]),[n.others,n.nil])};if("field"===n.mode){if("dimension"===n.fieldType){var c,f=function(e){var t=e.hc,n=e.source,r=e.coloring,i={data:{extract:[{source:"dummy",field:0,filter:function(){return i.expando=t.qDataPages[0]?t.qDataPages[0].qArea.qTop:0,!1}},{source:n,field:r.field,trackBy:r.valueAccessor,reduce:"first",props:{row:{reduce:function(){return i.expando++}},text:{value:function(e){return e.qText},reduce:"first"}}}]},expando:0};return i}({hc:t,source:o,coloring:n}).data;if(n.legendDataset){var h=0,d={};a.data("q")({data:t}).extract({field:n.field,trackBy:n.valueAccessor,reduce:function(e){var t=e[0];return d[t]=h++,e[0]}}),c={source:"attrDim",extract:{field:"qDimensionInfo/0",filter:function(e){return e.qElemNumber>=0},props:{row:{value:function(e){return d[e.qElemNumber]}}}}}}var p={data:f,range:n.range,domain:n.domain,explicit:s,type:"categorical-color",label:function(e){return e.datum.text&&e.datum.text.value?e.datum.text.value:e.datum.label}};l[u]=p,c&&(l["".concat(u,"Legend")]=N(N({},p),{},{data:c})),t&&t.qHasOtherValues&&c&&((c||p.data).amend=[{label:t.qDimensionInfo[0].othersLabel,source:{key:"qHyperCube",field:"qDimensionInfo/0"},row:{value:-3},value:-3}])}else if("measure"===n.fieldType){var m={data:{field:n.field},min:n.min,max:n.max};l[u]=G({},m,{type:"categorical"===n.type?"threshold-color":"sequential-color",range:n.range,domain:n.domain,invert:n.reverse}),"sequential-color"===l[u].type&&(l["".concat(u,"Range")]=G({},m,{invert:!!r}))}else if("color"!==n.type)throw new Error("UNUSED FIELD")}else if("dimension"===n.mode){var g={data:t.qDimensionInfo.map((function(e,t){return t})),label:function(e){return t.qDimensionInfo[e.datum.value].qFallbackTitle},explicit:s,type:"categorical-color"};l[u]=g}else if("measure"===n.mode){var v={data:t.qMeasureInfo.map((function(e,t){return t})).filter((function(e){var t;return!(null!==(t=n.explicit)&&void 0!==t&&null!==(t=t.exclude)&&void 0!==t&&t.includes(e))})),label:function(e){return t.qMeasureInfo[e.datum.value].qFallbackTitle},explicit:s,type:"categorical-color"};l[u]=v}}return l}({hc:n.hc,coloring:i(),key:n.key,source:n.source,picasso:e.picasso}),r.scales},color:function(){return r.color=r.color||function(e){var t=e.coloring,n=e.scales,r=e.key,i=ft(r),o=ft("".concat(r,"IsAnOther")),a=function(e,t){var r=e.fieldType,a=e.invalid,l=e.mode,u=e.nil,s=e.others,c=e.primary,f=e.type;return a?function(e){return dt(e)||o(e)?s:u}:n[t]?function(e){return dt(e)?s:ht(e)||-2===i(e)&&"dimension"===r||"NaN"===i(e)?u:o(e)?s:e.resources.scale(t)(i(e))||s}:"constant"===l?function(e){return dt(e)||o(e)?s:ht(e)?u:c}:"color"===f?function(e){return dt(e)||o(e)?s:ht(e)?u:i(e)||s}:null},l=a(t,r);if(t.measureOverrides){var u=ft("".concat(r,"MeasureIdx")),s=t.measureOverrides.map((function(e){return e&&a(e)}));return function(e){var t=u(e);return s[t]?s[t](e):l(e)}}return l}({coloring:i(),scales:this.scales(),key:n.key}),r.color},datumProps:function(e){return function(e){var t,n,r=e.hc,i=e.coloring,o=e.scales,a=e.key,l=e.addMeasureIx,u=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,s=a,c=i.nil;"field"===i.mode&&i.field?t=i.field:o[a]&&"field"===i.mode&&(t=o[a].data.field||i.field),t?(n={field:t,reduce:"first"},"color"===i.type&&(n.value=function(e){return"NaN"!==e.qNum?wt(e.qNum):e.qText&&ve(e.qText)?e.qText:c})):"dimension"===i.mode?n=void 0!==i.field?i.field:r.qDimensionInfo.length-1:"measure"===i.mode&&(n=u);var f=L({},s,n);return r.qDimensionInfo.length>1&&(f["".concat(s,"IsAnOther")]={fields:r.qDimensionInfo.map((function(e,t){return{field:"qDimensionInfo/".concat(t)}})),value:function(e){return-1!==e.indexOf(-3)}}),l&&(f["".concat(s,"MeasureIdx")]=u),f}({coloring:this.settingsForMeasure(e),scales:this.scales(),key:n.key,hc:n.hc,addMeasureIx:i().measureOverrides},e)},data:function(){var e=i(),t={key:"dummy",data:[["field"],["a"]]};return e.legendDataset?[t,{type:"q",key:"attrDim",data:e.legendDataset.raw(),config:{localeInfo:n.localeInfo}}]:[t]},legend:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.eventName,r=e.key,o=e.viewState,a=e.chart,l=e.rtl,u=e.styleReference,s=void 0===u?"object.legend":u,c=e.styleOverrides,f=e.settings,h=void 0===f?{}:f,d=e.style,p=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return xt({eventName:t,key:r,rtl:l,viewState:o,chart:a,styleReference:s,styleOverrides:c,settings:h,style:void 0===d?{}:d},{legendProps:n.legendProps,scaleKey:n.key,coloring:i(),theme:n.theme,hc:n.hc,scales:this.scales()},p)}};return o}var qt=function(e){return e.baseColor||e.coloring&&e.coloring.baseColor};function Ct(e){var t=e.qHyperCube,n=t.qDimensionInfo,r=t.qMeasureInfo,i=n.some(qt),o=r.some(qt),a=e.color.useBaseColors;return"measure"===a&&!o||"dimension"===a&&!i?"off":a}function Dt(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return N(N(N({},e),t),{},{colorProps:N(N({},e.colorProps),t.colorProps||{})})}var kt=function(e){return e.baseColor||e.coloring&&e.coloring.baseColor};function St(e){var t,n=e.qHyperCube.qDimensionInfo.some(kt),r=e.qHyperCube.qMeasureInfo.some(kt),i=n?"dimension":void 0;return{mode:"primary",useBaseColors:null!==(t=null!=i?i:r?"measure":void 0)&&void 0!==t?t:"off",paletteColor:null}}var It=function(){};function Nt(e,t,n){if(void 0===e||void 0===t)return n;for(var r=t.split("."),i=e,o=0;o<r.length;++o){var a=r[o];if(void 0===i[a])return n;i=i[a]}return i}var Ot=["__proto__","constructor"];function Tt(e,t,n){if(void 0!==e&&void 0!==t){var r=t.split("."),i=r[r.length-1];if(!Ot.some((function(e){return r.includes(e)}))){for(var o=e,a=0;a<r.length-1;++a){var l=r[a];void 0===o[l]&&(o[l]=Number.isNaN(+r[a+1])?{}:[]),o=o[l]}void 0!==n?o[i]=n:delete o[i]}}}function Et(e){var t=e.originalArray,n=e.newArray,r=e.matchKey;return Array.isArray(t)&&t.length?(n.forEach((function(e){var n=-1;t.some((function(t,i){return t[r]&&t[r]===e[r]&&(n=i),n})),n>-1?t[n]=e:t.push(e)})),t):n}function At(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 Lt(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?At(Object(n),!0).forEach((function(t){Ft(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):At(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function Ft(e,t,n){return(t=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var Pt=Object.prototype.hasOwnProperty,jt=Object.prototype.toString,$t=Object.defineProperty,Ht=Object.getOwnPropertyDescriptor,Rt=function(e){return"function"==typeof Array.isArray?Array.isArray(e):"[object Array]"===jt.call(e)},Ut=function(e){if(!e||"[object Object]"!==jt.call(e))return!1;var t,n=Pt.call(e,"constructor"),r=e.constructor&&e.constructor.prototype&&Pt.call(e.constructor.prototype,"isPrototypeOf");if(e.constructor&&!n&&!r)return!1;for(t in e);return void 0===t||Pt.call(e,t)},_t=function(e,t){$t&&"__proto__"===t.name?$t(e,t.name,{enumerable:!0,configurable:!0,value:t.newValue,writable:!0}):e[t.name]=t.newValue},zt=function(e,t){if("__proto__"===t){if(!Pt.call(e,t))return;if(Ht)return Ht(e,t).value}return e[t]},Vt=function e(){var t,n,r,i,o,a,l=arguments[0],u=1,s=arguments.length,c=!1;for("boolean"==typeof l&&(c=l,l=arguments[1]||{},u=2),(null==l||"object"!=typeof l&&"function"!=typeof l)&&(l={});u<s;++u)if(null!=(t=arguments[u]))for(n in t)r=zt(l,n),l!==(i=zt(t,n))&&(c&&i&&(Ut(i)||(o=Rt(i)))?(o?(o=!1,a=r&&Rt(r)?r:[]):a=r&&Ut(r)?r:{},_t(l,{name:n,newValue:e(c,a,i)})):void 0!==i&&_t(l,{name:n,newValue:i}));return l};function Bt(e,t,n,r){if(!e)return-1;const i=n.cache,o=e.origin?e.origin():null;o&&(e=o);let a=i.fields.indexOf(e),l=-1,u=-1;if(-1===a)for(let t=0;t<i.wrappedFields.length;t++)if(u=i.wrappedFields[t].attrDims.map((e=>e.instance)).indexOf(e),l=i.wrappedFields[t].attrExps.map((e=>e.instance)).indexOf(e),-1!==u||-1!==l){a=t;break}if(Array.isArray(r)&&r.some(((e,t)=>e!==t))){const e=r.indexOf(a);-1!==e&&(a=e)}return a-=t.qArea.qLeft,a<0||a>=t.qArea.qWidth?-1:u>=0?e=>e[a].qAttrDims.qValues[u]:l>=0?e=>e[a].qAttrExps.qValues[l]:e=>e[a]}function Yt(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 Wt(e){let{cache:t,f:n,mainCell:r,p:i,prop:o,page:a,rowIdx:l,row:u,sourceKey:s,target:c,targetProp:f,columnOrder:h}=e,d=r;if(i.field&&i.field!==n){const e=Bt(i.field,a,{cache:t},h);if(-1===e)return;d=Vt({qRow:l},e(u))}c[f]=Yt(i,d,{key:s})}function Gt(e,t,n,r){const i=Array.isArray(e)?e:[e];let o=[];for(let e=0;e<i.length;e++)if(void 0!==i[e].field){const a=t.raw(),l=t.key(),u="object"==typeof i[e].field?i[e].field:t.field(i[e].field),{props:s,main:c}=r.normalizeConfig(i[e],t),f=Object.keys(s),h=!!i[e].trackBy,d=typeof i[e].trackBy,p={},m=[],g=[];for(let t=0;t<a.qDataPages.length;t++){const o=Bt(u,a.qDataPages[t],{cache:n},a.qColumnOrder);if(-1!==o)for(let v=0;v<a.qDataPages[t].qMatrix.length;v++){const y=a.qDataPages[t].qArea.qTop+v,b=Vt({qRow:y},o(a.qDataPages[t].qMatrix[v])),x=Yt(c,b,{key:l});if(!c.filter||c.filter(b)){for(let e=0;e<f.length;e++){const r=s[f[e]];let i=r.fields||[r];r.fields&&(x[f[e]]=[]);for(let o=0;o<i.length;o++)Wt({cache:n,f:u,mainCell:b,p:i[o],prop:f[e],props:s,page:a.qDataPages[t],rowIdx:y,row:a.qDataPages[t].qMatrix[v],sourceKey:l,target:r.fields?x[f[e]]:x,targetProp:r.fields?o:f[e],columnOrder:a.qColumnOrder});if(r.fields){const t=x[f[e]].map((e=>e.value)),n=x[f[e]].map((e=>e.label));x[f[e]]={value:"function"==typeof r.value?r.value(t):void 0!==r.value?r.value:t,label:"function"==typeof r.label?r.label(n):void 0!==r.label?String(r.label):String(x[f[e]].value)}}}h&&r.track({cfg:i[e],itemData:b,obj:x,target:m,tracker:p,trackType:d}),g.push(x)}}}const v=h?r.collect(m,{main:c,propsArr:f,props:s}):g;o=[...o,...v]}return o}function Kt(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 Zt(e,t){e instanceof Map?(e=[void 0,e],void 0===t&&(t=Xt)):void 0===t&&(t=Jt);for(var n,r,i,o,a,l=new tn(e),u=[l];n=u.pop();)if((i=t(n.data))&&(a=(i=Array.from(i)).length))for(n.children=i,o=a-1;o>=0;--o)u.push(r=i[o]=new tn(i[o])),r.parent=n,r.depth=n.depth+1;return l.eachBefore(en)}function Jt(e){return e.children}function Xt(e){return Array.isArray(e)?e[1]:null}function Qt(e){void 0!==e.data.value&&(e.value=e.data.value),e.data=e.data.data}function en(e){var t=0;do{e.height=t}while((e=e.parent)&&e.height<++t)}function tn(e){this.data=e,this.depth=this.height=0,this.parent=null}function nn(e){return null==e?null:function(e){if("function"!=typeof e)throw new Error;return e}(e)}tn.prototype=Zt.prototype={constructor:tn,count:function(){return this.eachAfter(Kt)},each:function(e,t){let n=-1;for(const r of this)e.call(t,r,++n,this);return this},eachAfter:function(e,t){for(var n,r,i,o=this,a=[o],l=[],u=-1;o=a.pop();)if(l.push(o),n=o.children)for(r=0,i=n.length;r<i;++r)a.push(n[r]);for(;o=l.pop();)e.call(t,o,++u,this);return this},eachBefore:function(e,t){for(var n,r,i=this,o=[i],a=-1;i=o.pop();)if(e.call(t,i,++a,this),n=i.children)for(r=n.length-1;r>=0;--r)o.push(n[r]);return this},find:function(e,t){let n=-1;for(const r of this)if(e.call(t,r,++n,this))return r},sum:function(e){return this.eachAfter((function(t){for(var n=+e(t.data)||0,r=t.children,i=r&&r.length;--i>=0;)n+=r[i].value;t.value=n}))},sort:function(e){return this.eachBefore((function(t){t.children&&t.children.sort(e)}))},path:function(e){for(var t=this,n=function(e,t){if(e===t)return e;var n=e.ancestors(),r=t.ancestors(),i=null;for(e=n.pop(),t=r.pop();e===t;)i=e,e=n.pop(),t=r.pop();return i}(t,e),r=[t];t!==n;)t=t.parent,r.push(t);for(var i=r.length;e!==n;)r.splice(i,0,e),e=e.parent;return r},ancestors:function(){for(var e=this,t=[e];e=e.parent;)t.push(e);return t},descendants:function(){return Array.from(this)},leaves:function(){var e=[];return this.eachBefore((function(t){t.children||e.push(t)})),e},links:function(){var e=this,t=[];return e.each((function(n){n!==e&&t.push({source:n.parent,target:n})})),t},copy:function(){return Zt(this).eachBefore(Qt)},[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 rn={depth:-1},on={},an={};function ln(e){return e.id}function un(e){return e.parentId}function sn(e){let t=e.length;if(t<2)return"";for(;--t>1&&!cn(e,t););return e.slice(0,t)}function cn(e,t){if("/"===e[t]){let n=0;for(;t>0&&"\\"===e[--t];)++n;if(0==(1&n))return!0}return!1}function fn(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=fn(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]=fn(r,i[e]);return t}n[e]in i&&(i=i[n[e]])}return i}function hn(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,...hn(e[i].children,t-1,n)]);return r}function dn(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=>hn(e.children,r-1,n)}return!1}const pn=/^qDimensionInfo(?:\/(\d+))?/,mn=/^\/?qMeasureInfo\/(\d+)/,gn=/\/qAttrExprInfo\/(\d+)/,vn=/\/qAttrDimInfo\/(\d+)/;function yn(e){return(e.qColumnOrder&&e.qColumnOrder.length?e.qColumnOrder:e.qDimensionInfo.map(((e,t)=>t))).filter((t=>t<e.qDimensionInfo.length))}function bn(e,t){let{cube:n}=t;if(!e)return-1;let r=e.origin&&e.origin()?e.origin().key():e.key(),i=!1,o=-1,a=-1,l=-1,u=-1,s=-1,c=-1,f=r;const h=n.qEffectiveInterColumnSortOrder,d=yn(n);return pn.test(f)&&(i=!0,o=+pn.exec(f)[1],f=r.replace(pn,"")),mn.test(f)&&("K"===n.qMode?s=+mn.exec(f)[1]:h&&-1!==h.indexOf(-1)?(s=+mn.exec(f)[1],c=0):c=+mn.exec(f)[1],f=f.replace(mn,"")),f&&(vn.exec(f)?l=+vn.exec(f)[1]:gn.exec(f)&&(a=+gn.exec(f)[1])),u=i?"S"===n.qMode?d[o]:h?h.indexOf(o):o:h&&-1!==h.indexOf(-1)?h.indexOf(-1):n.qDimensionInfo.length-("K"===n.qMode?0:1),{fieldDepth:u+1,pseudoMeasureIndex:s,measureIdx:c,attrDimIdx:l,attrIdx:a}}function xn(e,t){let n,r,i=dn(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 wn(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 Mn(e){let{propsArr:t,props:n,item:r,itemData:i,ret:o,sourceKey:a}=e;for(let e=0;e<t.length;e++){const l=n[t[e]],u=l.fields||[l];let s,c;l.fields&&(s=[],c=[]);for(let n=0;n<u.length;n++){const f=u[n];let h,d,p,m,g,v;if("primitive"===f.type?(p=f.value,v=String(f.value)):("function"==typeof f.value&&(h=e=>f.value(e,r)),"function"==typeof f.label&&(d=e=>f.label(e,r)),f.accessor?(m=f.accessor(r),Array.isArray(m)?(g=m.map(f.valueAccessor),f.attrAccessor&&(g=g.map(f.attrAccessor)),h&&(p=g.map(h),h=null),d&&(v=g.map(d),d=null),p=f.reduce?f.reduce(p):p,v=f.reduceLabel?f.reduceLabel(v,p):String(p)):(p=f.attrAccessor?f.attrAccessor(f.valueAccessor(m)):f.valueAccessor(m),v=p)):(p=i,v=i)),l.fields){const e=h?h(p):p;s.push(e),c.push(d&&null!=v?d(v):null!=v?v:String(e))}else{const n=h?h(p):p;o[t[e]]={value:n,label:d?d(v):null!=v?v:String(n)},f.field&&(o[t[e]].source={field:f.field.key(),key:a})}}s&&(o[t[e]]={value:"function"==typeof l.value?l.value(s,r):s,label:"function"==typeof l.label?l.label(c,r):c})}}const qn=(e,t,n)=>{const r="K"===e.qMode?"/qStackedDataPages/*/qData":"/qTreeDataPages/*",i="K"===e.qMode?"qSubNodes":"qNodes",o=fn(r,e);return o&&o[0]?(t.tree=Zt(o[0],n.children||(e=>e[i])),t.tree):null};function Cn(e){const t=e.raw().qDataPages.length?e.raw().qDataPages[0].qMatrix:[],n=function(e){const t=e.raw().qColumnOrder,n=e.fields();return t&&t.length===n.length?t:n.map(((e,t)=>t))}(e),r=e.fields(),i=e.fields().filter((e=>"dimension"===e.type())).map((e=>n.indexOf(r.indexOf(e)))),o=e.fields().filter((e=>"measure"===e.type())).map((e=>n.indexOf(r.indexOf(e)))),a={__root:{__id:"__root",qValues:[]}};for(let e=0;e<t.length;e++){const n=t[e];let r="__root",u=!1;for(let e=0;e<i.length;e++){var l;const t=n[i[e]],o="".concat(r,"__").concat(null!==(l=t.qElemNumber)&&void 0!==l?l:t.qElemNo);a[o]||(a[o]=Lt({__id:o,__parent:r,qValues:[]},t),u=!0),r=o}if(u)for(let e=0;e<o.length;e++){const t=n[o[e]];a[r].qValues.push(t)}}const u=Object.keys(a).map((e=>a[e]));return function(){var e,t=ln,n=un;function r(r){var i,o,a,l,u,s,c,f,h=Array.from(r),d=t,p=n,m=new Map;if(null!=e){const t=h.map(((t,n)=>function(e){let t=(e=`${e}`).length;return cn(e,t-1)&&!cn(e,t-2)&&(e=e.slice(0,-1)),"/"===e[0]?e:`/${e}`}(e(t,n,r)))),n=t.map(sn),i=new Set(t).add("");for(const e of n)i.has(e)||(i.add(e),t.push(e),n.push(sn(e)),h.push(an));d=(e,n)=>t[n],p=(e,t)=>n[t]}for(a=0,i=h.length;a<i;++a)o=h[a],s=h[a]=new tn(o),null!=(c=d(o,a,r))&&(c+="")&&(f=s.id=c,m.set(f,m.has(f)?on:s)),null!=(c=p(o,a,r))&&(c+="")&&(s.parent=c);for(a=0;a<i;++a)if(c=(s=h[a]).parent){if(!(u=m.get(c)))throw new Error("missing: "+c);if(u===on)throw new Error("ambiguous: "+c);u.children?u.children.push(s):u.children=[s],s.parent=u}else{if(l)throw new Error("multiple roots");l=s}if(!l)throw new Error("no root");if(null!=e){for(;l.data===an&&1===l.children.length;)l=l.children[0],--i;for(let e=h.length-1;e>=0&&(s=h[e]).data===an;--e)s.data=null}if(l.parent=rn,l.eachBefore((function(e){e.depth=e.parent.depth+1,--i})).eachBefore(en),l.parent=null,i>0)throw new Error("cycle");return l}return r.id=function(e){return arguments.length?(t=nn(e),r):t},r.parentId=function(e){return arguments.length?(n=nn(e),r):n},r.path=function(t){return arguments.length?(e=nn(t),r):e},r}().id((e=>e.__id)).parentId((e=>e.__parent))(u)}const Dn=e=>{let{propsArr:t,props:n,cube:r,cache:i,itemDepthObject:o,f:a}=e;for(let e=0;e<t.length;e++){const l=n[t[e]],u=l.fields?l.fields:[l];for(let e=0;e<u.length;e++){const t=u[e];if(t.field!==a){const e=xn(o,bn(t.field,{cube:r,cache:i}));t.accessor=e.nodeFn,t.valueAccessor=e.valueFn,t.attrAccessor=e.attrFn}}}};function kn(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0,n=arguments.length>2?arguments[2]:void 0,r=arguments.length>3?arguments[3]:void 0;const i=t.raw(),o=t.key(),a="S"===i.qMode?Cn(t):qn(i,n,e);if(!a)return null;const l=a.height,u=[];for(let o=0;o<=l;o++){let a=null;if(o>0)if("S"===i.qMode){let e=yn(i)[o-1];a=n.fields[e]}else{let e=i.qEffectiveInterColumnSortOrder[o-1];o>i.qEffectiveInterColumnSortOrder.length&&(e=i.qDimensionInfo.length),a=n.fields[e]}const{props:l,main:s}=r.normalizeConfig(Lt(Lt({},e),{},{field:a?a.key():void 0}),t),c=Object.keys(l);u[o]={propsArr:c,props:l,main:s};const f=a?bn(a,{cube:i,cache:n}):{fieldDepth:0};Dn({propsArr:c,props:l,cube:i,cache:n,itemDepthObject:f,f:a})}const s=a.copy().descendants(),c=a.descendants();for(let e=0;e<c.length;e++){const t=u[c[e].depth].propsArr,n=u[c[e].depth].props,r=u[c[e].depth].main,i=s[e],a=i.data,l=wn(r,a,{key:o});Mn({propsArr:t,props:n,item:i,itemData:a,ret:l,sourceKey:o,isTree:!0}),c[e].data=l}return a}function Sn(e,t,n,r){const i=Array.isArray(e)?e:[e];let o=[];for(let a=0;a<i.length;a++)if(void 0!==i[a].field){const l=t.raw(),u=t.key();if(!qn(l,n,e))continue;const s="object"==typeof i[a].field?i[a].field:t.field(i[a].field),{props:c,main:f}=r.normalizeConfig(i[a],t),h=Object.keys(c),d=bn(s,{cube:l,cache:n}),{nodeFn:p,attrFn:m,valueFn:g}=xn({fieldDepth:0},d);Dn({propsArr:h,props:c,cube:l,cache:n,itemDepthObject:d,f:s});const v=!!i[a].trackBy,y=typeof i[a].trackBy,b={},x=[],w=p(n.tree),M=[];for(let e=0;e<w.length;e++){const t=w[e],n=m?m(g(t)):g(t);if(f.filter&&!f.filter(n))continue;const o=wn(f,n,{key:u});Mn({propsArr:h,props:c,item:t,itemData:n,ret:o,sourceKey:u}),v&&r.track({cfg:i[a],itemData:n,obj:o,target:x,tracker:b,trackType:y}),M.push(o)}const q=v?r.collect(x,{main:f,propsArr:h,props:c}):M;o=[...o,...q]}return o}var In,Nn,On=(In=function(e){
7
+ import e from"picasso.js";import t from"picasso-plugin-q";import{useElement as n,useSelections as r,useModel as i,useApp as o,useTranslator as a,useOptions as l,useState as u,useEffect as s,useStaleLayout as c,useTheme as f,useConstraints as h,useRect as d,usePlugins as p,useAppLayout as m,usePromise as g,onTakeSnapshot as v}from"@nebula.js/stardust";const y={fill:"steelblue",num:1},b=.9,x=150,w=(e,t,n)=>{let r=0,i=0,o=0,a={},l=0;if("labelCenter"===e)r=t.bottomLeft.x,i=t.topRight.y,o=t.bottomRight.x-t.bottomLeft.x,l=t.bottomRight.y-t.topRight.y,a={share:n.share,fill:n.fill};else{const e=180/Math.PI*Math.atan((t.bottomRight.y-t.topRight.y)/(t.topRight.x-t.bottomRight.x));r=e<15&&e>=0?t.topRight.x:e>-15&&e<0?t.bottomRight.x:e<-15?(t.bottomRight.x-t.topRight.x)/2+t.topRight.x+15:(t.topRight.x-t.bottomRight.x)/2+t.bottomRight.x+15,i=t.topRight.y,o=t.width-r,l=t.bottomRight.y-t.topRight.y,a={fill:n.fill}}return{tag:e,type:"rect",x:r,y:i,width:o,height:l,data:n.data,desc:a,fill:"none"}},M=(e,t)=>{const n=(e=>{const t=(e=>{let t=0;return e.forEach((e=>{e.num>t&&(t=e.num)})),t})(e);let n=0;const r=e.slice().reverse().map((e=>{const r={datum:e,s:n/t,e:e.num/t};return n=e.num,r}));return r.reverse()})(e),r=t.width*b,i=t.height*b,o=(t.width-r)/2,a=(t.height-i)/2,l=r-(r>x&&i>x?100:0),u=(i-1*(n.length-1))/n.length,s=[];return n.forEach(((e,r)=>{const i=(c=e.e,f=r<n.length-1?e.s:e.e,[.5-.5*c,.5+.5*c,.5+.5*f,.5-.5*f]).map((e=>Math.round(e*l+o)));var c,f;const h=u*r+1*r+a,d={bottomRight:{x:i[2],y:Math.round(h+u)},bottomLeft:{x:i[3],y:Math.round(h+u)},topRight:{x:i[1],y:Math.round(h)},topLeft:{x:i[0],y:Math.round(h)},width:t.width},p=`M${d.topLeft.x},${d.topLeft.y} L${d.topRight.x},${d.topRight.y} ${d.bottomRight.x},${d.bottomRight.y} ${d.bottomLeft.x},${d.bottomLeft.y}Z`;s.push({tag:"section",type:"path",d:p,data:e.datum.data,fill:e.datum.fill});const m={share:e.e,fill:e.datum.fill,data:e.datum.data};u>12&&(d.bottomRight.x-d.bottomLeft.x>32&&s.push(w("labelCenter",d,m)),s.push(w("labelLeft",d,m)))})),s},q=(e,t,n,r)=>(r-e)/r*(t-n)+n,C=(e,t,n)=>{const r=e.filter((e=>"NaN"!==e.num&&e.num>0)),i=r.length,o=n.width*b,a=n.height*b,l=Math.round((n.width-o)/2),u=Math.round((n.height-a)/2),s=o-(o>x&&a>x?100:0),c=a-1*(i-1),f=[],h=r[0].data.num.value;let d=u;return r.forEach(((e,r)=>{const i=t[r]*c,o=Math.round(q(d-u,s,.2*s,a)/2),p=Math.round(q(d-u+i,s,.2*s,a)/2),m=l+Math.round(s/2),g={bottomRight:{x:m+p,y:Math.round(d+i)},bottomLeft:{x:m-p,y:Math.round(d+i)},topRight:{x:m+o,y:d},topLeft:{x:m-o,y:d},width:n.width},v=`M${g.topLeft.x},${g.topLeft.y} L${g.topRight.x},${g.topRight.y} ${g.bottomRight.x},${g.bottomRight.y} ${g.bottomLeft.x},${g.bottomLeft.y}Z`;f.push({tag:"section",type:"path",d:v,data:e.data,fill:e.fill});const y={share:e.data.num.value/h,fill:e.fill,data:e.data};i>2&&(g.bottomRight.x-g.bottomLeft.x>32&&f.push(w("labelCenter",g,y)),f.push(w("labelLeft",g,y))),d+=i+1})),f},D=(e,t,n)=>{const r=e.filter((e=>"NaN"!==e.num&&e.num>0));if(r&&r.length>0)switch(t){case"WIDTH":default:return M(r,n);case"ORDER":return C(r,r.map((()=>1/r.length)),n);case"HEIGHT":return C(r,(e=>{const t=e.reduce(((e,t)=>e+t.data.num.value),0);return e.map((e=>e.data.num.value/t))})(r),n);case"AREA":return C(r,((e,t,n)=>{const r=e.reduce(((e,t)=>e+t.data.num.value),0),i=t.width*b,o=t.height*b,a=i*n,l=o*(i+a)/2,u=(i-a)/2/o,s=[];let c=0;for(let t=e.length-1;t>=0;t--){const n=e[t].data.num.value/r,i=2*u*c+a,f=-i/(2*u)+Math.sqrt(i*i/(4*u*u)+n*l/u);s[t]=f/o,c+=f}return s})(r,n,.2),n)}return[]};var k={require:["resolver"],defaultSettings:{settings:{},data:{},style:{item:"$shape"}},render({data:e}){const t=this.resolver.resolve({data:e,defaults:{...y,...this.style.item},settings:this.settings.settings});return D(t.items,this.settings.settings.mode,this.rect)}};const S={version:"1.9.1",color:{auto:!0,autoMinMax:!0,byDimDef:void 0,byMeasureDef:void 0,colorExpression:void 0,dimensionScheme:"12",expressionIsColor:!0,expressionLabel:"",measureMin:void 0,measureMax:void 0,measureScheme:"sg",mode:"primary",paletteColor:{index:6},persistent:!1,reverseScheme:!1,singleColor:void 0,useBaseColors:"off",useDimColVal:!0,useMeasureGradient:!0},dataPoint:{auto:!0,labelMode:"share"},footnote:"",funnel:{mode:"WIDTH"},qHyperCubeDef:{qDimensions:[],qMeasures:[],qInterColumnSortOrder:[],qInitialDataFetch:[{qWidth:2,qHeight:5e3}],qSuppressMissing:!0,qSuppressZero:!1},showDimensionTitle:!0,showTitles:!0,subtitle:"",title:""};function I(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(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?I(Object(n),!0).forEach((function(t){L(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):I(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function O(){O=function(){return e};var e={},t=Object.prototype,n=t.hasOwnProperty,r=Object.defineProperty||function(e,t,n){e[t]=n.value},i="function"==typeof Symbol?Symbol:{},o=i.iterator||"@@iterator",a=i.asyncIterator||"@@asyncIterator",l=i.toStringTag||"@@toStringTag";function u(e,t,n){return Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{u({},"")}catch(e){u=function(e,t,n){return e[t]=n}}function s(e,t,n,i){var o=t&&t.prototype instanceof h?t:h,a=Object.create(o.prototype),l=new D(i||[]);return r(a,"_invoke",{value:w(e,n,l)}),a}function c(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(e){return{type:"throw",arg:e}}}e.wrap=s;var f={};function h(){}function d(){}function p(){}var m={};u(m,o,(function(){return this}));var g=Object.getPrototypeOf,v=g&&g(g(k([])));v&&v!==t&&n.call(v,o)&&(m=v);var y=p.prototype=h.prototype=Object.create(m);function b(e){["next","throw","return"].forEach((function(t){u(e,t,(function(e){return this._invoke(t,e)}))}))}function x(e,t){function i(r,o,a,l){var u=c(e[r],e,o);if("throw"!==u.type){var s=u.arg,f=s.value;return f&&"object"==typeof f&&n.call(f,"__await")?t.resolve(f.__await).then((function(e){i("next",e,a,l)}),(function(e){i("throw",e,a,l)})):t.resolve(f).then((function(e){s.value=e,a(s)}),(function(e){return i("throw",e,a,l)}))}l(u.arg)}var o;r(this,"_invoke",{value:function(e,n){function r(){return new t((function(t,r){i(e,n,t,r)}))}return o=o?o.then(r,r):r()}})}function w(e,t,n){var r="suspendedStart";return function(i,o){if("executing"===r)throw new Error("Generator is already running");if("completed"===r){if("throw"===i)throw o;return{value:void 0,done:!0}}for(n.method=i,n.arg=o;;){var a=n.delegate;if(a){var l=M(a,n);if(l){if(l===f)continue;return l}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if("suspendedStart"===r)throw r="completed",n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);r="executing";var u=c(e,t,n);if("normal"===u.type){if(r=n.done?"completed":"suspendedYield",u.arg===f)continue;return{value:u.arg,done:n.done}}"throw"===u.type&&(r="completed",n.method="throw",n.arg=u.arg)}}}function M(e,t){var n=t.method,r=e.iterator[n];if(void 0===r)return t.delegate=null,"throw"===n&&e.iterator.return&&(t.method="return",t.arg=void 0,M(e,t),"throw"===t.method)||"return"!==n&&(t.method="throw",t.arg=new TypeError("The iterator does not provide a '"+n+"' method")),f;var i=c(r,e.iterator,t.arg);if("throw"===i.type)return t.method="throw",t.arg=i.arg,t.delegate=null,f;var o=i.arg;return o?o.done?(t[e.resultName]=o.value,t.next=e.nextLoc,"return"!==t.method&&(t.method="next",t.arg=void 0),t.delegate=null,f):o:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,f)}function q(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function C(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function D(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(q,this),this.reset(!0)}function k(e){if(e||""===e){var t=e[o];if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var r=-1,i=function t(){for(;++r<e.length;)if(n.call(e,r))return t.value=e[r],t.done=!1,t;return t.value=void 0,t.done=!0,t};return i.next=i}}throw new TypeError(typeof e+" is not iterable")}return d.prototype=p,r(y,"constructor",{value:p,configurable:!0}),r(p,"constructor",{value:d,configurable:!0}),d.displayName=u(p,l,"GeneratorFunction"),e.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===d||"GeneratorFunction"===(t.displayName||t.name))},e.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,p):(e.__proto__=p,u(e,l,"GeneratorFunction")),e.prototype=Object.create(y),e},e.awrap=function(e){return{__await:e}},b(x.prototype),u(x.prototype,a,(function(){return this})),e.AsyncIterator=x,e.async=function(t,n,r,i,o){void 0===o&&(o=Promise);var a=new x(s(t,n,r,i),o);return e.isGeneratorFunction(n)?a:a.next().then((function(e){return e.done?e.value:a.next()}))},b(y),u(y,l,"Generator"),u(y,o,(function(){return this})),u(y,"toString",(function(){return"[object Generator]"})),e.keys=function(e){var t=Object(e),n=[];for(var r in t)n.push(r);return n.reverse(),function e(){for(;n.length;){var r=n.pop();if(r in t)return e.value=r,e.done=!1,e}return e.done=!0,e}},e.values=k,D.prototype={constructor:D,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(C),!e)for(var t in this)"t"===t.charAt(0)&&n.call(this,t)&&!isNaN(+t.slice(1))&&(this[t]=void 0)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var t=this;function r(n,r){return a.type="throw",a.arg=e,t.next=n,r&&(t.method="next",t.arg=void 0),!!r}for(var i=this.tryEntries.length-1;i>=0;--i){var o=this.tryEntries[i],a=o.completion;if("root"===o.tryLoc)return r("end");if(o.tryLoc<=this.prev){var l=n.call(o,"catchLoc"),u=n.call(o,"finallyLoc");if(l&&u){if(this.prev<o.catchLoc)return r(o.catchLoc,!0);if(this.prev<o.finallyLoc)return r(o.finallyLoc)}else if(l){if(this.prev<o.catchLoc)return r(o.catchLoc,!0)}else{if(!u)throw new Error("try statement without catch or finally");if(this.prev<o.finallyLoc)return r(o.finallyLoc)}}}},abrupt:function(e,t){for(var r=this.tryEntries.length-1;r>=0;--r){var i=this.tryEntries[r];if(i.tryLoc<=this.prev&&n.call(i,"finallyLoc")&&this.prev<i.finallyLoc){var o=i;break}}o&&("break"===e||"continue"===e)&&o.tryLoc<=t&&t<=o.finallyLoc&&(o=null);var a=o?o.completion:{};return a.type=e,a.arg=t,o?(this.method="next",this.next=o.finallyLoc,f):this.complete(a)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),f},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),C(n),f}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var r=n.completion;if("throw"===r.type){var i=r.arg;C(n)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,n){return this.delegate={iterator:k(e),resultName:t,nextLoc:n},"next"===this.method&&(this.arg=void 0),f}},e}function T(e){return T="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},T(e)}function E(e,t,n,r,i,o,a){try{var l=e[o](a),u=l.value}catch(e){return void n(e)}l.done?t(u):Promise.resolve(u).then(r,i)}function A(e){return function(){var t=this,n=arguments;return new Promise((function(r,i){var o=e.apply(t,n);function a(e){E(o,r,i,a,l,"next",e)}function l(e){E(o,r,i,a,l,"throw",e)}a(void 0)}))}}function L(e,t,n){return(t=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function F(e,t){if(null==e)return{};var n,r,i=function(e,t){if(null==e)return{};var n,r,i={},o=Object.keys(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||(i[n]=e[n]);return i}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function P(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,i,o,a,l=[],u=!0,s=!1;try{if(o=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;u=!1}else for(;!(u=(r=o.call(n)).done)&&(l.push(r.value),l.length!==t);u=!0);}catch(e){s=!0,i=e}finally{try{if(!u&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(s)throw i}}return l}}(e,t)||$(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 j(e){return function(e){if(Array.isArray(e))return H(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||$(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 $(e,t){if(e){if("string"==typeof e)return H(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)?H(e,t):void 0}}function H(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}var R=Object.prototype.hasOwnProperty,U=Object.prototype.toString,_=Object.defineProperty,z=Object.getOwnPropertyDescriptor,V=function(e){return"function"==typeof Array.isArray?Array.isArray(e):"[object Array]"===U.call(e)},B=function(e){if(!e||"[object Object]"!==U.call(e))return!1;var t,n=R.call(e,"constructor"),r=e.constructor&&e.constructor.prototype&&R.call(e.constructor.prototype,"isPrototypeOf");if(e.constructor&&!n&&!r)return!1;for(t in e);return void 0===t||R.call(e,t)},Y=function(e,t){_&&"__proto__"===t.name?_(e,t.name,{enumerable:!0,configurable:!0,value:t.newValue,writable:!0}):e[t.name]=t.newValue},W=function(e,t){if("__proto__"===t){if(!R.call(e,t))return;if(z)return z(e,t).value}return e[t]},G=function(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}((function e(){var t,n,r,i,o,a,l=arguments[0],u=1,s=arguments.length,c=!1;for("boolean"==typeof l&&(c=l,l=arguments[1]||{},u=2),(null==l||"object"!=typeof l&&"function"!=typeof l)&&(l={});u<s;++u)if(null!=(t=arguments[u]))for(n in t)r=W(l,n),l!==(i=W(t,n))&&(c&&i&&(B(i)||(o=V(i)))?(o?(o=!1,a=r&&V(r)?r:[]):a=r&&B(r)?r:{},Y(l,{name:n,newValue:e(c,a,i)})):void 0!==i&&Y(l,{name:n,newValue:i}));return l}));function K(e,t){return{range:function(e){var n=e.resources,r=e.data,i=n.theme.palette("categorical",0===t?r.items.length:t);return r.items.map((function(e){return i[e.value%i.length]}))},valueAccessor:e.value}}function Z(e,t){return{range:function(e){var n=e.resources,r=e.data,i=n.theme.palette("categorical",0===t?r.items.length:t);return r.items.map((function(e){return i[e.row.value%i.length]}))},valueAccessor:e.value}}function J(e,t,n,r,i){var o,a,l=i.byRow,u=i.byElemNo;if(r&&(t.input.persistent||e.hc.qDimensionInfo.length>1||void 0===n.activeDimensionIndex&&e.hc.qSize.qcy>((null===(a=(o=e.hc).qDataPages[0]||o.qStackedDataPages[0])||void 0===a?void 0:a.qArea.qHeight)||0)))return u(r,r.raw().qCardinal);if(r){var s=t.pic.extract({field:r.key(),trackBy:r.value}).length;return l(r,s)}return{}}function X(e,t){var n=e.hc.qDimensionInfo,r=t.input.byDimDef||{activeDimensionIndex:n.length-1};if(r.activeDimensionIndex>=0){var i=n[r.activeDimensionIndex];r=i.coloring&&i.coloring.colorMapRef?{type:"libraryItem",key:i.coloring.colorMapRef,activeDimensionIndex:r.activeDimensionIndex}:{activeDimensionIndex:r.activeDimensionIndex}}return r}function Q(e,t){var n;return t.activeDimensionIndex>=0?n=e.pic.fields().filter((function(e){return"dimension"===e.type()}))[t.activeDimensionIndex]:"libraryItem"===t.type?!1===(n=t.key?e.pic.field((function(e){return e.raw().colorMapRef===t.key})):void 0)&&(n=e.pic.field((function(e){return"colorByAlternative"===e.raw().id}))):"expression"===t.type&&(n=e.pic.field((function(e){return"colorByAlternative"===e.raw().id}))),n}function ee(e,t,n){e.prototype=t.prototype=n,n.constructor=e}function te(e,t){var n=Object.create(e.prototype);for(var r in t)n[r]=t[r];return n}function ne(){}var re=1/.7,ie="\\s*([+-]?\\d+)\\s*",oe="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",ae="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",le=/^#([0-9a-f]{3,8})$/,ue=new RegExp(`^rgb\\(${ie},${ie},${ie}\\)$`),se=new RegExp(`^rgb\\(${ae},${ae},${ae}\\)$`),ce=new RegExp(`^rgba\\(${ie},${ie},${ie},${oe}\\)$`),fe=new RegExp(`^rgba\\(${ae},${ae},${ae},${oe}\\)$`),he=new RegExp(`^hsl\\(${oe},${ae},${ae}\\)$`),de=new RegExp(`^hsla\\(${oe},${ae},${ae},${oe}\\)$`),pe={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 me(){return this.rgb().formatHex()}function ge(){return this.rgb().formatRgb()}function ve(e){var t,n;return e=(e+"").trim().toLowerCase(),(t=le.exec(e))?(n=t[1].length,t=parseInt(t[1],16),6===n?ye(t):3===n?new Me(t>>8&15|t>>4&240,t>>4&15|240&t,(15&t)<<4|15&t,1):8===n?be(t>>24&255,t>>16&255,t>>8&255,(255&t)/255):4===n?be(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=ue.exec(e))?new Me(t[1],t[2],t[3],1):(t=se.exec(e))?new Me(255*t[1]/100,255*t[2]/100,255*t[3]/100,1):(t=ce.exec(e))?be(t[1],t[2],t[3],t[4]):(t=fe.exec(e))?be(255*t[1]/100,255*t[2]/100,255*t[3]/100,t[4]):(t=he.exec(e))?Ie(t[1],t[2]/100,t[3]/100,1):(t=de.exec(e))?Ie(t[1],t[2]/100,t[3]/100,t[4]):pe.hasOwnProperty(e)?ye(pe[e]):"transparent"===e?new Me(NaN,NaN,NaN,0):null}function ye(e){return new Me(e>>16&255,e>>8&255,255&e,1)}function be(e,t,n,r){return r<=0&&(e=t=n=NaN),new Me(e,t,n,r)}function xe(e){return e instanceof ne||(e=ve(e)),e?new Me((e=e.rgb()).r,e.g,e.b,e.opacity):new Me}function we(e,t,n,r){return 1===arguments.length?xe(e):new Me(e,t,n,null==r?1:r)}function Me(e,t,n,r){this.r=+e,this.g=+t,this.b=+n,this.opacity=+r}function qe(){return`#${Se(this.r)}${Se(this.g)}${Se(this.b)}`}function Ce(){const e=De(this.opacity);return`${1===e?"rgb(":"rgba("}${ke(this.r)}, ${ke(this.g)}, ${ke(this.b)}${1===e?")":`, ${e})`}`}function De(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function ke(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function Se(e){return((e=ke(e))<16?"0":"")+e.toString(16)}function Ie(e,t,n,r){return r<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new Oe(e,t,n,r)}function Ne(e){if(e instanceof Oe)return new Oe(e.h,e.s,e.l,e.opacity);if(e instanceof ne||(e=ve(e)),!e)return new Oe;if(e instanceof Oe)return e;var t=(e=e.rgb()).r/255,n=e.g/255,r=e.b/255,i=Math.min(t,n,r),o=Math.max(t,n,r),a=NaN,l=o-i,u=(o+i)/2;return l?(a=t===o?(n-r)/l+6*(n<r):n===o?(r-t)/l+2:(t-n)/l+4,l/=u<.5?o+i:2-o-i,a*=60):l=u>0&&u<1?0:a,new Oe(a,l,u,e.opacity)}function Oe(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}function Te(e){return(e=(e||0)%360)<0?e+360:e}function Ee(e){return Math.max(0,Math.min(1,e||0))}function Ae(e,t,n){return 255*(e<60?t+(n-t)*e/60:e<180?n:e<240?t+(n-t)*(240-e)/60:t)}ee(ne,ve,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:me,formatHex:me,formatHex8:function(){return this.rgb().formatHex8()},formatHsl:function(){return Ne(this).formatHsl()},formatRgb:ge,toString:ge}),ee(Me,we,te(ne,{brighter(e){return e=null==e?re:Math.pow(re,e),new Me(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=null==e?.7:Math.pow(.7,e),new Me(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new Me(ke(this.r),ke(this.g),ke(this.b),De(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:qe,formatHex:qe,formatHex8:function(){return`#${Se(this.r)}${Se(this.g)}${Se(this.b)}${Se(255*(isNaN(this.opacity)?1:this.opacity))}`},formatRgb:Ce,toString:Ce})),ee(Oe,(function(e,t,n,r){return 1===arguments.length?Ne(e):new Oe(e,t,n,null==r?1:r)}),te(ne,{brighter(e){return e=null==e?re:Math.pow(re,e),new Oe(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=null==e?.7:Math.pow(.7,e),new Oe(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 Me(Ae(e>=240?e-240:e+120,i,r),Ae(e,i,r),Ae(e<120?e+240:e-120,i,r),this.opacity)},clamp(){return new Oe(Te(this.h),Ee(this.s),Ee(this.l),De(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){const e=De(this.opacity);return`${1===e?"hsl(":"hsla("}${Te(this.h)}, ${100*Ee(this.s)}%, ${100*Ee(this.l)}%${1===e?")":`, ${e})`}`}}));const Le=Math.PI/180,Fe=180/Math.PI,Pe=4/29,je=6/29,$e=3*je*je;function He(e){if(e instanceof Re)return new Re(e.l,e.a,e.b,e.opacity);if(e instanceof Be)return Ye(e);e instanceof Me||(e=xe(e));var t,n,r=Ve(e.r),i=Ve(e.g),o=Ve(e.b),a=Ue((.2225045*r+.7168786*i+.0606169*o)/1);return r===i&&i===o?t=n=a:(t=Ue((.4360747*r+.3850649*i+.1430804*o)/.96422),n=Ue((.0139322*r+.0971045*i+.7141733*o)/.82521)),new Re(116*a-16,500*(t-a),200*(a-n),e.opacity)}function Re(e,t,n,r){this.l=+e,this.a=+t,this.b=+n,this.opacity=+r}function Ue(e){return e>.008856451679035631?Math.pow(e,1/3):e/$e+Pe}function _e(e){return e>je?e*e*e:$e*(e-Pe)}function ze(e){return 255*(e<=.0031308?12.92*e:1.055*Math.pow(e,1/2.4)-.055)}function Ve(e){return(e/=255)<=.04045?e/12.92:Math.pow((e+.055)/1.055,2.4)}function Be(e,t,n,r){this.h=+e,this.c=+t,this.l=+n,this.opacity=+r}function Ye(e){if(isNaN(e.h))return new Re(e.l,0,0,e.opacity);var t=e.h*Le;return new Re(e.l,Math.cos(t)*e.c,Math.sin(t)*e.c,e.opacity)}ee(Re,(function(e,t,n,r){return 1===arguments.length?He(e):new Re(e,t,n,null==r?1:r)}),te(ne,{brighter(e){return new Re(this.l+18*(null==e?1:e),this.a,this.b,this.opacity)},darker(e){return new Re(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 Me(ze(3.1338561*(t=.96422*_e(t))-1.6168667*(e=1*_e(e))-.4906146*(n=.82521*_e(n))),ze(-.9787684*t+1.9161415*e+.033454*n),ze(.0719453*t-.2289914*e+1.4052427*n),this.opacity)}})),ee(Be,(function(e,t,n,r){return 1===arguments.length?function(e){if(e instanceof Be)return new Be(e.h,e.c,e.l,e.opacity);if(e instanceof Re||(e=He(e)),0===e.a&&0===e.b)return new Be(NaN,0<e.l&&e.l<100?0:NaN,e.l,e.opacity);var t=Math.atan2(e.b,e.a)*Fe;return new Be(t<0?t+360:t,Math.sqrt(e.a*e.a+e.b*e.b),e.l,e.opacity)}(e):new Be(e,t,n,null==r?1:r)}),te(ne,{brighter(e){return new Be(this.h,this.c,this.l+18*(null==e?1:e),this.opacity)},darker(e){return new Be(this.h,this.c,this.l-18*(null==e?1:e),this.opacity)},rgb(){return Ye(this).rgb()}}));var We=e=>()=>e;function Ge(e,t){var n=t-e;return n?function(e,t){return function(n){return e+n*t}}(e,n):We(isNaN(e)?t:e)}var Ke=function e(t){var n=function(e){return 1==(e=+e)?Ge: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):We(isNaN(t)?n:t)}}(t);function r(e,t){var r=n((e=we(e)).r,(t=we(t)).r),i=n(e.g,t.g),o=n(e.b,t.b),a=Ge(e.opacity,t.opacity);return function(t){return e.r=r(t),e.g=i(t),e.b=o(t),e.opacity=a(t),e+""}}return r.gamma=e,r}(1),Ze=/^class(-pyramid)?/,Je=function(e,t,n,r){var i=void 0!==n.min?n.min:r.min(),o=void 0!==n.max?n.max:r.max(),a=i,l=o,u=t.limits,s={},c="percent"===t.limitType?u.map((function(e){return i+(o-i)*e})):u,f=t.colors.map((function(t){return e.resolveUIColor(t)}));if(i=Math.min.apply(Math,[i].concat(j(c))),o=Math.max.apply(Math,[o].concat(j(c))),s.min=i,s.max=o,t.breakTypes&&-1===t.breakTypes.indexOf(!0))s.type="categorical",Object.assign(s,function(e){var t=e.min,n=e.max,r=e.limits,i=e.range,o=[],a=[];if(r.length)if(r[r.length-1]<t)a.push(t,n),o.push(i[i.length-1],i[i.length-1],i[i.length-1]);else if(r[0]>n)a.push(t,n),o.push(i[0],i[0],i[0]);else{if(r[0]>t)a.push(t),o.push(i[0]);else{a.push(t);for(var l=0;l<r.length;l++)if(t<r[l]){o.push(i[l]);break}}for(var u=0;u<r.length;u++)t<r[u]&&r[u]<n&&(a.push(r[u]),o.push(i[u]));if(r[r.length-1]<n)a.push(n),o.push(i[r.length]),o.push(i[r.length]);else{a.push(n);for(var s=0;s<r.length;s++)if(r[s]>n){o.push(i[s]),o.push(i[s]);break}}}else o.push(i[0]);return{min:t,max:n,range:o,domain:a}}({min:"percent"===t.limitType?i:a,max:"percent"===t.limitType?o:l,range:f,limits:"percent"===t.limitType?c:u}));else if(t.breakTypes){var h=t.breakTypes;s.type="continuous",s.domain=[i],s.range=[f[0]];for(var d=0;d<c.length;d+=1)if(h[d]){var p=f[d],m=f[d+1],g=Ke(p,m)(.5);s.range.push(g),s.domain.push(c[d]),d<c.length-1&&h[d+1]&&(s.range.push(f[d+1]),s.domain.push((c[d]+c[d+1])/2))}else s.range.push(f[d]),s.range.push(f[d+1]),s.domain.push(c[d]),s.domain.push(c[d]+Math.min(1e-6,(o-i)/1e6));s.range.push(f[f.length-1]),s.domain.push(o)}else s.domain=c,s.range=f;return s};function Xe(e,t,n,r,i){var o,a,l,u=0,s=[],c=(e-t)/(r+1);if(0===c)return 1;for(o=0;o<n.length;o+=1)a=.99*(n[o]-t),l=n[o]>e?Math.floor(e/c):n[o]<t?0:Math.floor(a/c),Number.isNaN(l)||(s[l]?s[l]+=1:s[l]=1);for(o=0;o<s.length;o+=1)s[o]&&(u+=1);return u<=r||u>=i?Math.max(u,r):Xe(e,t,n,r+1,i)}var Qe=function(e,t,n,r){var i,o,a=t.theme,l=t.hc,u=r.f,s={mode:"field",fieldType:"measure",field:u?u.key():void 0,reverse:n.input.reverseScheme||!1,type:"continuous",range:function(e){return e.resources.theme.palette("quant")}},c=[],f=!0;if(u){if(Number.isNaN(+u.min())||Number.isNaN(+u.max()))return{invalid:!0};(f=!("S"===(i=n.pic.raw()).qMode&&(i.qDataPages[0]&&i.qSize.qcy>i.qDataPages[0].qArea.qHeight||!i.qDataPages.length&&i.qSize.qcy>0)||"K"===i.qMode&&i.qStackedDataPages[0]&&i.qSize.qcy>i.qStackedDataPages[0].qArea.qHeight||"T"===i.qMode&&i.qSize.qcy>i.qTreeDataPages[0].qGroupSize))&&(c=n.pic.extract({field:0,props:{num:{field:u.key()},exclude:{fields:l.qDimensionInfo.map((function(e,t){return{field:"qDimensionInfo/".concat(t)}})),value:function(e){return Math.min.apply(Math,j(e))<0}}}}).filter((function(e){return e.value>=0&&!e.exclude.value})).map((function(e){return e.num.value})).filter((function(e){return"number"==typeof e})))}if(!1===n.input.autoMinMax){if(s.min=n.input.measureMin,s.max=n.input.measureMax,s.max<s.min)return{invalid:!0}}else if(u&&!f)s.min=u.min(),s.max=u.max();else if(u){if(!c.length)return{invalid:!0};s.min=Math.min.apply(Math,j(c)),s.max=Math.max.apply(Math,j(c))}if(n.input.measureScheme&&(s.palettes={quant:n.input.measureScheme}),a){var h=a.getDataColorScales().filter((function(e){return e.key===n.input.measureScheme}))[0];s.type=h&&Ze.test(h.type)?"categorical":"continuous","categorical"===s.type&&(o=h.colors.some((function(e){return Array.isArray(e)}))?Math.max.apply(Math,j(h.colors.map((function(e){return e?e.length:0})))):h.colors.length)}if("categorical"===s.type){for(var d=f?Xe(s.max,s.min,c,1,o):o,p=(s.max-s.min)/d,m=[],g=0;g<d+1;g+=1)m.push(s.min+p*g);s.domain=m,s.range=function(e){for(var t=e.resources.theme.palette("quant",d),n=Math.max(1,Math.floor(t.length/d)),r=[],i=0;i<d;i+=1)r.push(t[i*n]);return[r[0]].concat(r,[r[r.length-1]])}}return s};function et(e,t){var n;return t.activeMeasureIndex>=0?n=e.pic.fields().filter((function(e){return"measure"===e.type()}))[t.activeMeasureIndex]:"libraryItem"===t.type?n=e.pic.field((function(e){return e.raw().colorMapRef===t.key&&void 0!==t.key})):"expression"===t.type&&(n=e.pic.field((function(e){return"colorByAlternative"===e.raw().id}))),n||(n=e.pic.field((function(e){return void 0!==e.raw().matchMeasure})))&&(n=e.pic.fields().filter((function(e){return"measure"===e.type()}))[n.raw().matchMeasure]),n}function tt(e){var t,n=e.cm,r=e.defaults,i=e.index,o=e.input,a=e.pic;if(!o||!o.on)return null;var l=null!==(t=o.mode)&&void 0!==t?t:"primary";return"primary"===l?function(e,t,n){var r=n.primary;return void 0!==t.paletteColor&&t.paletteColor&&(r=e.resolveUIColor(t.paletteColor)),N(N({},n),{},{mode:"constant",type:"constant",primary:r})}(n,o,r):"byExpression"===l?function(e,t,n){var r="qMeasureInfo/".concat(e,"/"),i=t.field((function(e){return e.id().startsWith(r)&&"colorByMeasureExpression"===e.raw().id})),o=i;return N(N({},n),{},o?{mode:"field",fieldType:"expression",field:i?i.key():void 0,type:"color"}:{mode:"constant",type:"constant",primary:n.nil})}(i,a,r):null}function nt(e){e.measureOverrides.every((function(e){return!e}))&&(e.measureOverrides=null)}function rt(e,t){for(var n=(null==t?void 0:t.domain)||[],r=(null==t?void 0:t.range)||[],i=[],o=0;o<e.length;++o){var a=e[o];if("constant"===(null==a?void 0:a.mode)){var l=n.indexOf(o);-1===l?(n.push(o),r.push(a.primary)):r[l]=a.primary,e[o]=null}else if(a){i.push(o);var u=n.indexOf(o);-1!==u&&(n.splice(u,1),r.splice(u,1))}}return{domain:n,range:r,exclude:i}}function it(e,t,n,r){var i,o=function(e,t,n,r){if(t.input&&!t.input.auto){if("byMeasure"===t.input.mode)return function(e,t,n){var r=t.theme,i=t.hc,o=(arguments.length>3&&void 0!==arguments[3]?arguments[3]:{}).getCField,a=void 0===o?et:o,l=n.input.byMeasureDef||{activeMeasureIndex:0},u=a(n,l),s=Qe(0,{theme:r,hc:i},n,{f:u});if(s.invalid)return s;"expression"===l.type&&(l.activeMeasureIndex<0||void 0===l.activeMeasureIndex)&&(s.label=l.label,u&&"color.altLabel"===u.raw().labelExpRef&&(s.label=n.input.altLabel)),!s.label&&u&&(s.label=u.title());var c=l.activeMeasureIndex>=0?u:null;if(!c&&u&&void 0!==u.raw().matchMeasure&&u.raw().matchMeasure>-1&&(c=n.pic.fields().filter((function(e){return"measure"===e.type()}))[u.raw().matchMeasure]),n.input.useMeasureGradient&&"libraryItem"===l.type)if(c){var f=c.raw().coloring;f&&f.gradient&&G(s,Je(e,f.gradient,s,c))}else s.auxiliary=l;return s}(e,n,t);if("byDimension"===t.input.mode)return function(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},i=r.getCDef,o=void 0===i?X:i,a=r.getCByField,l=void 0===a?Q:a,u=r.getPersistence,s=void 0===u?J:u,c=o(t,n),f=l(n,c),h=f?f.raw():{},d=n&&n.pic?n.pic.raw():{};if(h.qError||h.qSize&&0===h.qSize.qcy&&!d.qHasOtherValues)return{invalid:!0};var p={mode:"field",fieldType:"dimension",type:"categorical",field:f?f.key():void 0,isFieldLocked:h.qLocked};return("expression"===c.type||c.activeDimensionIndex<0)&&(p.label=c.label,"color.altLabel"===h.labelExpRef&&(p.label=n.input.altLabel)),!p.label&&f&&(p.label=f.title()),n.input.dimensionScheme&&(p.palettes={categorical:n.input.dimensionScheme}),n.input.useDimColVal&&"libraryItem"===c.type&&(p.auxiliary=c),G(p,s(t,n,c,f,{byRow:Z,byElemNo:K})),p}(e,n,t);if("byExpression"===t.input.mode)return function(e,t,n,r){var i=t.hc,o=t.theme,a=t.translator,l=n.pic.field((function(e){return"colorByExpression"===e.raw().id}));if(!l||!l.raw().qFallbackTitle&&!n.input.colorExpression||!(Number.isFinite(l.raw().qMin)&&Number.isFinite(l.raw().qMax)||n.input.expressionIsColor))return{mode:"constant",type:"constant",primary:r.nil};if(n.input.expressionIsColor)return{mode:"field",fieldType:"expression",field:l?l.key():void 0,type:"color"};var u=Qe(0,{hc:i,theme:o},n,{f:l});return u.invalid||(u.label=n.input.expressionLabel||a.get("Object.ChartTooltip.ColorExpression")),u}(0,n,t,r);if("byMultiple"===t.input.mode||"primary"===t.input.mode)return function(e,t,n,r){var i=t.hc,o=t.theme,a=t.translator,l=n.input.useBaseColors;if(("byMultiple"===n.input.mode||"primary"===n.input.mode&&"measure"===n.input.useBaseColors)&&i.qMeasureInfo.length>1&&(l="measure"),"measure"===l){var u=[],s=[];"measure"===n.input.useBaseColors&&i.qMeasureInfo.forEach((function(t,n){if(t.baseColor||t.coloring&&t.coloring.baseColor){u.push(n);var i=e.resolveUIColor(t.baseColor||t.coloring.baseColor);"none"===i?s.push(r.primary):s.push(i)}}));var c=n.input.dimensionScheme?{categorical:n.input.dimensionScheme}:void 0,f=o?o.getDataColorPalettes()[0]:void 0;return"measure"===n.input.useBaseColors&&f&&(c={categorical:f.key}),{mode:"measure",type:"categorical",palettes:c,label:a?a.get("Common.Measures"):void 0,explicit:u.length?{domain:u,range:s}:void 0}}if("dimension"===l){var h=[],d=[];return i.qDimensionInfo.forEach((function(t,n){if(t.baseColor||t.coloring&&t.coloring.baseColor){h.push(n);var i=e.resolveUIColor(t.baseColor||t.coloring.baseColor);"none"===i?d.push(r.primary):d.push(i)}})),{mode:"dimension",type:"categorical",field:h.length?h[0]:void 0,explicit:h.length?{domain:h,range:d}:void 0}}var p=r.primary;if(void 0!==n.input.paletteColor)n.input.paletteColor&&(p=e.resolveUIColor(n.input.paletteColor));else{var m=n.input.singleColor;"number"!=typeof m||Number.isNaN(m)||(p=["#b0afae","#7b7a78","#545352","#4477aa","#7db8da","#b6d7ea","#46c646","#f93f17","#ffcf02","#276e27","#ffffff","#000000"][m])}return{mode:"constant",type:"constant",primary:p}}(e,n,t,r)}return{}}(e,t,n,r);return null!==(i=t.input)&&void 0!==i&&i.measureOverrides?(o.measureOverrides=t.input.measureOverrides.map((function(n,i){return tt({cm:e,input:n,defaults:r,index:i,pic:t.pic})})),function(e,t){var n,r,i,o=t.translator;if(nt(e),1===(null===(n=e.measureOverrides)||void 0===n?void 0:n.length))return e.measureOverrides[0];if("measure"===e.mode&&e.measureOverrides&&(e.explicit=rt(e.measureOverrides,e.explicit),nt(e)),null!==(r=e.measureOverrides)&&void 0!==r&&r.every((function(e){return"constant"===(null==e?void 0:e.mode)}))){var a={mode:"measure",type:"categorical",label:null==o?void 0:o.get("Common.Measures")};return a.explicit=rt(e.measureOverrides),a}return null!==(i=e.measureOverrides)&&void 0!==i&&i.every((function(e){return e}))?{invalid:!0,measureOverrides:e.measureOverrides}:e}(o,n)):o}function ot(e){var t=N({hc:null,colorProps:null,layout:null,theme:null},e),n={},r={auto:function(){return{mode:"primary"}},getDimensionColorMap:function(){return Promise.reject()},getMeasure:function(){return Promise.reject()},getAttributeDimension:function(){return Promise.reject()}},i={auto:function(e){return e?(r.auto=e,i):r.auto},getDimensionColorMap:function(e){return e?(r.getDimensionColorMap=e,i):r.getDimensionColorMap},getAttributeDimension:function(e){return e?(r.getAttributeDimension=e,i):r.getAttributeDimension},getMeasure:function(e){return e?(r.getMeasure=e,i):r.getMeasure},set:function(e){var i;if(!e.colorProps)throw new Error('Missing "colorProps"');if(G(t,e),(n={pic:t.picasso.data("q")({data:t.hc,config:{localeInfo:t.localeInfo}}),input:t.colorProps}).input.auto){var o=r.auto(e.layout);n.input=G(!0,{},n.input,o,{auto:!1});var a=t.theme?t.theme.getDataColorPalettes():[];a[0]&&(n.input.dimensionScheme=a[0].key);var l=0;n.input.byDimDef&&+n.input.byDimDef.activeDimensionIndex>=0&&(l=+n.input.byDimDef.activeDimensionIndex),t.hc&&t.hc.qDimensionInfo[l]&&t.hc.qDimensionInfo[l].coloring&&t.hc.qDimensionInfo[l].coloring.colorMapRef&&n.input.byDimDef&&(n.input.byDimDef.type="libraryItem",n.input.byDimDef.key=t.hc.qDimensionInfo[l].coloring.colorMapRef)}null!==(i=n.input.measureOverrides)&&void 0!==i&&i.every((function(e){return!e||!e.on}))&&(n.input=G(!1,{},n.input,{measureOverrides:null}))},palettes:function(){if(!n.palettes){var e=t.theme,r=[];(e&&e.getDataColorPickerPalettes()||[]).forEach((function(e){r.push({key:"ui",colors:e.colors})})),n.palettes=r}return n.palettes},getAuxiliaryData:function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"/qHyperCubeDef";if(!e.auxiliary&&!/qAttrDimInfo/.test(e.field))return Promise.resolve();var i=(e.auxiliary||{}).key;if("measure"===e.fieldType)return r.getMeasure(i,t).catch((function(){}));if("dimension"===e.fieldType){var o="".concat(n,"/").concat(e.field).replace("qDimensionInfo","qDimensions").replace("qAttrDimInfo","qAttributeDimensions");return Promise.all([/qAttrDimInfo/.test(e.field)?r.getAttributeDimension(o,t).catch((function(){})):Promise.resolve(),i?r.getDimensionColorMap(i,t).catch((function(){})):Promise.resolve()])}return Promise.resolve()},getAuxiliarySettings:function(e,r){var i=this;return e.auxiliary||/qAttrDimInfo/.test(e.field)?(this.palettes(),this.getAuxiliaryData(e,r).then((function(r){if(!r)return{};if("measure"===e.fieldType){if(r.coloring&&r.coloring.gradient){var o=n.pic.field(e.field);return Je(i,r.coloring.gradient,e,o)}return{}}if("dimension"===e.fieldType){var a={nil:e.nil,others:e.others},l=r[0],u=r[1]?r[1].colorMap:null;if(l){var s=t.picasso.data("q")({data:{qDimensionInfo:[n.pic.field(e.field).raw(),n.pic.field(e.field).raw()],qMeasureInfo:[],qDataPages:l,qInterColumnSortOrder:[0,1],qMode:"S"}});a.legendDataset=s}return u?function(e,t,n,r){var i=r.external,o=r.field,a=N({},e);G(a,K(o,o.raw().qCardinal));var l=i.theme?i.theme.getDataColorPalettes()[0]:null;return t.nul&&(a.nil=n.resolveUIColor(t.nul)),t.oth&&(a.others=n.resolveUIColor(t.oth)),t.usePal?(a.palettes={categorical:t.pal},l&&!t.pal&&(a.palettes.categorical=l.key,G(a,K(o)))):!1===t.autoFill&&t.single?a.range=[n.resolveUIColor(t.single)]:t.autoFill&&(l&&(a.palettes={categorical:l.key}),G(a,K(o))),t.colors&&t.colors.length&&(a.explicit=function(e,t,n){for(var r={},i=0;i<e.length;i+=1)r[e[i].value]=e[i].baseColor;var o=[];return{domain:function(e){var i=e.data,a=[];o=[];for(var l=0;l<i.items.length;l++){var u=i.items[l],s=(u.text||u).label;r[s]&&-1===a.indexOf(u.value)&&(a.push(u.value),o.push(t.resolveUIColor(r[s])))}return a.push(-3,-2),o.push(n.others),o.push(n.nil),a},range:function(){return o}}}(t.colors,n,a)),a}(a,u,i,{external:t,field:n.pic.field(e.field)}):a}return{}}))):Promise.resolve()},resolveUIColor:function(e){if(e.index<0||void 0===e.index)return e.color;if(void 0===n.uiPalette&&(n.uiPalette=this.palettes().filter((function(e){return"ui"===e.key}))[0]||!1),!n.uiPalette)return e.color;var t="none"===n.uiPalette.colors[0]?e.index:e.index-1;return void 0===n.uiPalette.colors[t]?e.color:n.uiPalette.colors[t]},settings:function(){if(this.palettes(),!n.settings){var e={primary:"steelblue",others:"#aaa",nil:"#ddd"},r=t.theme;r&&(e=N(N({},e),r.getDataColorSpecials())),n.settings=G(e,it(this,n,t,e))}return n.settings}};return i}var at=function(e,t){var n=e.fieldType,r={};if(t)if("measure"===n){var i=t.coloring;i&&(r.measureGradient=i.gradient)}else if("dimension"===n){var o=t[0],a=t[1];o&&(r.legendDataPage=o),a&&(r.dimValsData=a.colorMap)}return r},lt=function(e){throw e.isHandled=!0,e},ut=function(e,t){var n=t.layout,r=t.app;return n&&n.snapshotData?n.snapshotData.content&&n.snapshotData.content.chartData&&n.snapshotData.content.chartData.dimValsData?Promise.resolve({colorMap:n.snapshotData.content.chartData.dimValsData}):Promise.reject():r&&r.getObject?r.getObject("ColorMapModel_".concat(e)).then((function(e){return e.getLayout()})):Promise.reject()},st=function(e,t){var n=t.layout,r=t.app;return n&&n.snapshotData?n.snapshotData.content&&n.snapshotData.content.chartData&&n.snapshotData.content.chartData.measureGradient?Promise.resolve({coloring:{gradient:n.snapshotData.content.chartData.measureGradient}}):Promise.reject():r&&r.getMeasure?r.getMeasure(e).then((function(e){return e.getMeasure()})):Promise.reject()},ct=function(e,t){var n=t.layout,r=t.model,i=t.app;return n&&n.snapshotData?n.snapshotData.content&&n.snapshotData.content.chartData&&n.snapshotData.content.chartData.legendDataPage?Promise.resolve(n.snapshotData.content.chartData.legendDataPage):Promise.reject():r&&r.session&&i?r.getHyperCubeData(e,[{qHeight:100,qLeft:0,qTop:0,qWidth:2}]).catch(lt):Promise.reject()};function ft(e){return function(t){return"object"===T(t.datum[e])?t.datum[e].value:void 0}}function ht(e){return"object"===T(e.datum.isNull)?e.datum.isNull.value:-2===e.datum.value}function dt(e){return-3===e.datum.value}var pt={TITLE:{COLOR:void 0,FONT_SIZE:"16px",FONT_FAMILY:"'Source Sans Pro', 'Arial', 'sans-serif'"},LABEL:{COLOR:void 0,FONT_SIZE:void 0,FONT_FAMILY:"'Source Sans Pro', 'Arial', 'sans-serif'"}};function mt(e){var t=e.theme,n=e.key,r=e.styleOverrides,i={title:{color:pt.TITLE.COLOR,fontSize:pt.TITLE.FONT_SIZE,fontFamily:pt.TITLE.FONT_FAMILY},label:{color:pt.LABEL.COLOR,fontSize:pt.LABEL.FONT_SIZE,fontFamily:pt.LABEL.FONT_FAMILY}};if(!t&&!r)return i;var o=r||{},a=o.title,l=o.label,u=function(e){var t=e.theme,n=e.key;return function(e,r,i,o){return void 0!==e?e:t?t.getStyle(n,r,i):o}}({theme:t,key:n});return i.title.color=u(null==a?void 0:a.color,"legend.title","color",pt.TITLE.COLOR),i.title.fontSize=u(null==a?void 0:a.fontSize,"legend.title","fontSize",pt.TITLE.FONT_SIZE),i.title.fontFamily=u(null==a?void 0:a.fontFamily,"legend.title","fontFamily",pt.TITLE.FONT_FAMILY),i.label.color=u(null==l?void 0:l.color,"legend.label","color",pt.LABEL.COLOR),i.label.fontSize=u(null==l?void 0:l.fontSize,"legend.label","fontSize",pt.LABEL.FONT_SIZE),i.label.fontFamily=u(null==l?void 0:l.fontFamily,"legend.label","fontFamily",pt.LABEL.FONT_FAMILY),i}var gt=function(e,t,n){var r=e&&e.dock||void 0;if("auto"!==r)return r||"right";if(t){var i=t.element.getBoundingClientRect();if(i.height>i.width)return"bottom"}return n?"left":"right"},vt=function(e,t,n){return!(n.invalid||"color"===n.type||"measure"===n.mode&&t.qMeasureInfo.length<=1||"dimension"===n.mode)&&("function"==typeof e.show?e.show():!1!==e.show)};function yt(e,t){var n=e.styleReference,r=e.styleOverrides,i=e.chart,o=e.rtl,a=t.legendProps,l=t.coloring,u=t.theme,s=t.hc,c=mt({theme:u,key:n,styleOverrides:r});return{layout:{minimumLayoutMode:"MEDIUM",dock:gt(a,i,o)},show:"function"==typeof a.show?function(){return vt(a,s,l)}:vt(a,s,l),renderer:"svg",mounted:function(e){e.childNodes[0].style.pointerEvents="none",e.style.overflow="hidden"},settings:{title:{show:!1!==a.showTitle,wordBreak:"break-word",maxLines:2,lineHeight:1.2,text:l.label||"",fill:c.title.color,fontSize:c.title.fontSize,fontFamily:c.title.fontFamily}}}}function bt(e,t,n){return"categorical"===t.coloring.type?function(e,t,n){var r=yt(e,t);if(!r.show)return!1;var i,o=e.key,a=e.styleReference,l=e.styleOverrides,u=e.viewState,s=e.rtl,c=e.settings,f=e.style,h=t.scaleKey,d=t.theme,p=t.scales,m=mt({theme:d,key:a,styleOverrides:l}),g=r.layout.dock,v="left"===g||"right"===g?{maxLines:2,wordBreak:"break-word"}:{},y={up:"M13.6,11 L2.4,11 C2.28954305,11 2.2,10.9104569 2.2,10.8 C2.2,10.756726 2.21403557,10.7146192 2.24,10.68 L7.84,3.21333333 C7.90627417,3.12496777 8.03163444,3.10705916 8.12,3.17333333 C8.13516113,3.18470418 8.14862915,3.1981722 8.16,3.21333333 L13.76,10.68 C13.8262742,10.7683656 13.8083656,10.8937258 13.72,10.96 C13.6853808,10.9859644 13.643274,11 13.6,11 Z",down:"M2.4,4 L13.6,4 C13.7104569,4 13.8,4.08954305 13.8,4.2 C13.8,4.24327404 13.7859644,4.28538077 13.76,4.32 L8.16,11.7866667 C8.09372583,11.8750322 7.96836556,11.8929408 7.88,11.8266667 C7.86483887,11.8152958 7.85137085,11.8018278 7.84,11.7866667 L2.24,4.32 C2.17372583,4.23163444 2.19163444,4.10627417 2.28,4.04 C2.31461923,4.01403557 2.35672596,4 2.4,4 Z",left:"M11,2.4 L11,13.6 C11,13.7104569 10.9104569,13.8 10.8,13.8 C10.756726,13.8 10.7146192,13.7859644 10.68,13.76 L3.21333333,8.16 C3.12496777,8.09372583 3.10705916,7.96836556 3.17333333,7.88 C3.18470418,7.86483887 3.1981722,7.85137085 3.21333333,7.84 L10.68,2.24 C10.7683656,2.17372583 10.8937258,2.19163444 10.96,2.28 C10.9859644,2.31461923 11,2.35672596 11,2.4 Z",right:"M4,13.6 L4,2.4 C4,2.28954305 4.08954305,2.2 4.2,2.2 C4.24327404,2.2 4.28538077,2.21403557 4.32,2.24 L11.7866667,7.84 C11.8750322,7.90627417 11.8929408,8.03163444 11.8266667,8.12 C11.8152958,8.13516113 11.8018278,8.14862915 11.7866667,8.16 L4.32,13.76 C4.23163444,13.8262742 4.10627417,13.8083656 4.04,13.72 C4.01403557,13.6853808 4,13.643274 4,13.6 Z"};"dimension"===t.coloring.fieldType&&(i=function(e){return e.datum.value>=0||-3===e.datum.value});var b="".concat(h,"Legend");return G(!0,r,{type:"legend-cat",key:"".concat(o,"-cat"),scale:b in p?b:h,settings:{layout:{scrollOffset:function(){return u?u.get("legendScrollOffset"):void 0},size:-1!==["top","bottom"].indexOf(r.layout.dock)?2:1,direction:s?"rtl":"ltr",horizontal:20},item:{show:i,label:N({fill:m.label.color,fontSize:m.label.fontSize,fontFamily:m.label.fontFamily},v)},navigation:{disabled:n,button:{content:function(e,t){var n=t.direction;return e("i",{style:{"pointer-events":"none",fontSize:"12px",display:"inline-block",fontStyle:"normal",lineHeight:"0",textAlign:"center",textTransform:"none",verticalAlign:"-0.125em",textRendering:"optimizelegibility",margin:"0px"}},[e("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 16 16",fill:"currentColor"},[e("path",{d:y[n]})])])}}}},brush:{consume:[{context:"selection",data:["",o],style:{inactive:{opacity:.3}}}]}},{settings:c,style:f})}(e,t,n):"continuous"===t.coloring.type&&function(e,t){var n,r=e.key,i=e.styleReference,o=e.styleOverrides,a=e.rtl,l=e.settings,u=e.style,s=t.scaleKey,c=t.theme,f="".concat(s,"Range"),h=yt(e,t);if(!h.show)return!1;var d=mt({theme:c,key:i,styleOverrides:o}),p=h.layout.dock,m="right"===p||"left"===p,g=null===(n=t.scales)||void 0===n?void 0:n[f];return m&&g&&(g.invert=!0),G(!0,h,{type:"legend-seq",key:"".concat(r,"-seq"),settings:{fill:s,major:f,length:1,tick:{fill:d.label.color,fontSize:d.label.fontSize,fontFamily:d.label.fontFamily},title:{anchor:!a||"top"!==h.layout.dock&&"bottom"!==h.layout.dock?void 0:"right",padding:parseFloat(h.settings.title.fontSize)||16}}},{settings:l,style:u})}(e,t)}function xt(e,t,n){var r=[],i=[],o=bt(e,t,n&&n.navigationDisabled);return r.push(o),o&&"legend-cat"===o.type&&(i.push(function(e){var t=e.key,n=e.requireFailure,r=e.recognizeWith,i=(arguments.length>1&&void 0!==arguments[1]?arguments[1]:{}).actions;return{key:"event:tap-".concat(t),type:"Tap",requireFailure:n,recognizeWith:r,options:{event:"legendtap",interval:10,pointers:1,enable:function(e,n){var r;if(!n)return!0;if(null!=i&&null!==(r=i.interact)&&void 0!==r&&r.enabled&&!i.interact.enabled())return!1;if(!this.chart.componentsFromPoint({x:n.center.x,y:n.center.y}).some((function(e){return e.key==="".concat(t,"-cat")})))return!1;var o=n.srcEvent.target;return!!(o&&o.hasAttribute("data-action")&&o.hasAttribute("data-component-key"))||!(!o||!o.childNodes[0]||"BUTTON"!==o.childNodes[0].nodeName)}},events:{legendtap:function(e){e.preventDefault();var t=e.srcEvent.target;t&&t.hasAttribute("data-action")&&t.hasAttribute("data-component-key")&&this.chart.component(t.getAttribute("data-component-key")).emit(t.getAttribute("data-action"))}}}}(e,n)),i.push(function(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=t.eventName,r=t.key,i=t.requireFailure,o=t.recognizeWith,a=(arguments.length>1&&void 0!==arguments[1]?arguments[1]:{}).actions;return{key:"event:pan-".concat(r),type:"Pan",requireFailure:i,recognizeWith:o,options:{event:n,pointers:1,threshold:10,enable:function(e,t){var i;return this.started===n||!t||!(null!=a&&null!==(i=a.interact)&&void 0!==i&&i.enabled&&!a.interact.enabled())&&this.chart.componentsFromPoint({x:t.center.x,y:t.center.y}).some((function(e){return e.key==="".concat(r,"-cat")}))}},events:(e={},L(e,"".concat(n,"start"),(function(e){e.preventDefault(),this.started!==n&&(this.started=n,this.chart.component("".concat(r,"-cat")).emit("panstart",e))})),L(e,"".concat(n,"move"),(function(e){e.preventDefault(),this.chart.component("".concat(r,"-cat")).emit("panmove",e)})),L(e,"".concat(n,"end"),(function(e){e.preventDefault(),this.chart.component("".concat(r,"-cat")).emit("panend",e),this.started=!1})),e)}}(e,n))),{interactions:i,components:r}}var wt=function(e){return"rgba(".concat([(16711680&e)>>16,(65280&e)>>8,255&e,((4278190080&e)>>>24)/255].join(","),")")};function Mt(e){var t=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.auto,n=ot(e.resources).auto(t||function(){return{mode:"byDimension",persistent:!1,useDimColVal:!0,byDimDef:{activeDimensionIndex:0,type:"expression",label:""}}}).getDimensionColorMap((function(e,t){var n=t.layout,r=t.app;return ut(e,{layout:n,app:r})})).getMeasure((function(e,t){var n=t.layout,r=t.app;return st(e,{layout:n,app:r})})).getAttributeDimension((function(e,t){var n=t.layout,r=t.model,i=t.app;return ct(e,{layout:n,model:r,app:i})}));return n.getSnapshotData=at,n}({resources:e}),n={},r={},i=function(e){return r.settings||(e||console.warn("settings() called before auxiliarySettings()"),r.settings=t.settings()),r.settings},o={config:function(i){if(n=N({},i),r={},!n.key)throw new Error("Missing key");t.set(N(N({},e),n))},auto:function(e){return e?(t.auto(e),o):t.auto()},getAuxiliarySettings:function(e){return r.auxiliarySettings?Promise.resolve(r.auxiliarySettings):t.getAuxiliarySettings(i(!0),e).then((function(e){return r.auxiliarySettings=e||{},r.settings=N(N({},r.settings),r.auxiliarySettings),r.scales=void 0,r.color=void 0,r.auxiliarySettings}))},getAuxiliaryData:function(){return t.getAuxiliaryData(i())},getSnapshotData:function(e){var n=i();return t.getAuxiliaryData(n,e).then((function(e){return t.getSnapshotData(n,e)}))},resolveUIColor:function(e){return t.resolveUIColor(e)},settings:function(){var e=i();return{mode:e.mode,type:e.type,label:e.label,field:e.field,fieldType:e.fieldType,nil:e.nil,others:e.others,primary:e.primary}},settingsForMeasure:function(e){var t;return(null===(t=i().measureOverrides)||void 0===t?void 0:t[e])||this.settings()},isSelectionLocked:function(e){var t=e.isMeasureSelectionLocked;return function(e,t){var n=t.isMeasureSelectionLocked;return"field"!==e.mode||("dimension"===e.fieldType?e.isFieldLocked:"measure"!==e.fieldType||n)}(i(),{isMeasureSelectionLocked:t})},palettes:function(){return function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.colorProps,n=e.coloring,r=e.theme,i=[];if(n&&n.palettes&&r){var o=n.palettes.categorical||t.dimensionScheme,a=r.getDataColorPalettes().filter((function(e){return e.key===o}))[0]||r.getDataColorPalettes()[0];o&&a&&i.push({key:"categorical",colors:a.colors});var l=n.palettes.metric||t.measureScheme,u=r.getDataColorScales().filter((function(e){return e.key===l}))[0];if(u){var s=u.colors[0]?u.colors:[[]].concat(j(u.colors.slice(1)));s=Array.isArray(s[0])?s.map((function(e){return e.slice().reverse()})):s.slice().reverse(),i.push({key:"quant",colors:s})}}return i}({coloring:i(),colorProps:n.colorProps,theme:n.theme})},scales:function(){return r.scales=r.scales||function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.hc,n=e.coloring,r=e.rtl,i=e.key,o=e.source,a=e.picasso,l={},u=i;if(n){var s={override:!0,domain:n.explicit&&"function"==typeof n.explicit.domain?n.explicit.domain:[].concat(j((n.explicit||{}).domain||[]),[-3,-2]),range:n.explicit&&"function"==typeof n.explicit.range?n.explicit.range:[].concat(j((n.explicit||{}).range||[]),[n.others,n.nil])};if("field"===n.mode){if("dimension"===n.fieldType){var c,f=function(e){var t=e.hc,n=e.source,r=e.coloring,i={data:{extract:[{source:"dummy",field:0,filter:function(){return i.expando=t.qDataPages[0]?t.qDataPages[0].qArea.qTop:0,!1}},{source:n,field:r.field,trackBy:r.valueAccessor,reduce:"first",props:{row:{reduce:function(){return i.expando++}},text:{value:function(e){return e.qText},reduce:"first"}}}]},expando:0};return i}({hc:t,source:o,coloring:n}).data;if(n.legendDataset){var h=0,d={};a.data("q")({data:t}).extract({field:n.field,trackBy:n.valueAccessor,reduce:function(e){var t=e[0];return d[t]=h++,e[0]}}),c={source:"attrDim",extract:{field:"qDimensionInfo/0",filter:function(e){return e.qElemNumber>=0},props:{row:{value:function(e){return d[e.qElemNumber]}}}}}}var p={data:f,range:n.range,domain:n.domain,explicit:s,type:"categorical-color",label:function(e){return e.datum.text&&e.datum.text.value?e.datum.text.value:e.datum.label}};l[u]=p,c&&(l["".concat(u,"Legend")]=N(N({},p),{},{data:c})),t&&t.qHasOtherValues&&c&&((c||p.data).amend=[{label:t.qDimensionInfo[0].othersLabel,source:{key:"qHyperCube",field:"qDimensionInfo/0"},row:{value:-3},value:-3}])}else if("measure"===n.fieldType){var m={data:{field:n.field},min:n.min,max:n.max};l[u]=G({},m,{type:"categorical"===n.type?"threshold-color":"sequential-color",range:n.range,domain:n.domain,invert:n.reverse}),"sequential-color"===l[u].type&&(l["".concat(u,"Range")]=G({},m,{invert:!!r}))}else if("color"!==n.type)throw new Error("UNUSED FIELD")}else if("dimension"===n.mode){var g={data:t.qDimensionInfo.map((function(e,t){return t})),label:function(e){return t.qDimensionInfo[e.datum.value].qFallbackTitle},explicit:s,type:"categorical-color"};l[u]=g}else if("measure"===n.mode){var v={data:t.qMeasureInfo.map((function(e,t){return t})).filter((function(e){var t;return!(null!==(t=n.explicit)&&void 0!==t&&null!==(t=t.exclude)&&void 0!==t&&t.includes(e))})),label:function(e){return t.qMeasureInfo[e.datum.value].qFallbackTitle},explicit:s,type:"categorical-color"};l[u]=v}}return l}({hc:n.hc,coloring:i(),key:n.key,source:n.source,picasso:e.picasso}),r.scales},color:function(){return r.color=r.color||function(e){var t=e.coloring,n=e.scales,r=e.key,i=ft(r),o=ft("".concat(r,"IsAnOther")),a=function(e,t){var r=e.fieldType,a=e.invalid,l=e.mode,u=e.nil,s=e.others,c=e.primary,f=e.type;return a?function(e){return dt(e)||o(e)?s:u}:n[t]?function(e){return dt(e)?s:ht(e)||-2===i(e)&&"dimension"===r||"NaN"===i(e)?u:o(e)?s:e.resources.scale(t)(i(e))||s}:"constant"===l?function(e){return dt(e)||o(e)?s:ht(e)?u:c}:"color"===f?function(e){return dt(e)||o(e)?s:ht(e)?u:i(e)||s}:null},l=a(t,r);if(t.measureOverrides){var u=ft("".concat(r,"MeasureIdx")),s=t.measureOverrides.map((function(e){return e&&a(e)}));return function(e){var t=u(e);return s[t]?s[t](e):l(e)}}return l}({coloring:i(),scales:this.scales(),key:n.key}),r.color},datumProps:function(e){return function(e){var t,n,r=e.hc,i=e.coloring,o=e.scales,a=e.key,l=e.addMeasureIx,u=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,s=a,c=i.nil;"field"===i.mode&&i.field?t=i.field:o[a]&&"field"===i.mode&&(t=o[a].data.field||i.field),t?(n={field:t,reduce:"first"},"color"===i.type&&(n.value=function(e){return"NaN"!==e.qNum?wt(e.qNum):e.qText&&ve(e.qText)?e.qText:c})):"dimension"===i.mode?n=void 0!==i.field?i.field:r.qDimensionInfo.length-1:"measure"===i.mode&&(n=u);var f=L({},s,n);return r.qDimensionInfo.length>1&&(f["".concat(s,"IsAnOther")]={fields:r.qDimensionInfo.map((function(e,t){return{field:"qDimensionInfo/".concat(t)}})),value:function(e){return-1!==e.indexOf(-3)}}),l&&(f["".concat(s,"MeasureIdx")]=u),f}({coloring:this.settingsForMeasure(e),scales:this.scales(),key:n.key,hc:n.hc,addMeasureIx:i().measureOverrides},e)},data:function(){var e=i(),t={key:"dummy",data:[["field"],["a"]]};return e.legendDataset?[t,{type:"q",key:"attrDim",data:e.legendDataset.raw(),config:{localeInfo:n.localeInfo}}]:[t]},legend:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.eventName,r=e.key,o=e.viewState,a=e.chart,l=e.rtl,u=e.styleReference,s=void 0===u?"object.legend":u,c=e.styleOverrides,f=e.settings,h=void 0===f?{}:f,d=e.style,p=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return xt({eventName:t,key:r,rtl:l,viewState:o,chart:a,styleReference:s,styleOverrides:c,settings:h,style:void 0===d?{}:d},{legendProps:n.legendProps,scaleKey:n.key,coloring:i(),theme:n.theme,hc:n.hc,scales:this.scales()},p)}};return o}var qt=function(e){return e.baseColor||e.coloring&&e.coloring.baseColor};function Ct(e){var t=e.qHyperCube,n=t.qDimensionInfo,r=t.qMeasureInfo,i=n.some(qt),o=r.some(qt),a=e.color.useBaseColors;return"measure"===a&&!o||"dimension"===a&&!i?"off":a}function Dt(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return N(N(N({},e),t),{},{colorProps:N(N({},e.colorProps),t.colorProps||{})})}var kt=function(e){return e.baseColor||e.coloring&&e.coloring.baseColor};function St(e){var t,n=e.qHyperCube.qDimensionInfo.some(kt),r=e.qHyperCube.qMeasureInfo.some(kt),i=n?"dimension":void 0;return{mode:"primary",useBaseColors:null!==(t=null!=i?i:r?"measure":void 0)&&void 0!==t?t:"off",paletteColor:null}}var It=function(){};function Nt(e,t,n){if(void 0===e||void 0===t)return n;for(var r=t.split("."),i=e,o=0;o<r.length;++o){var a=r[o];if(void 0===i[a])return n;i=i[a]}return i}var Ot=["__proto__","constructor"];function Tt(e,t,n){if(void 0!==e&&void 0!==t){var r=t.split("."),i=r[r.length-1];if(!Ot.some((function(e){return r.includes(e)}))){for(var o=e,a=0;a<r.length-1;++a){var l=r[a];void 0===o[l]&&(o[l]=Number.isNaN(+r[a+1])?{}:[]),o=o[l]}void 0!==n?o[i]=n:delete o[i]}}}function Et(e){var t=e.originalArray,n=e.newArray,r=e.matchKey;return Array.isArray(t)&&t.length?(n.forEach((function(e){var n=-1;t.some((function(t,i){return t[r]&&t[r]===e[r]&&(n=i),n})),n>-1?t[n]=e:t.push(e)})),t):n}function At(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 Lt(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?At(Object(n),!0).forEach((function(t){Ft(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):At(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function Ft(e,t,n){return(t=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var Pt=Object.prototype.hasOwnProperty,jt=Object.prototype.toString,$t=Object.defineProperty,Ht=Object.getOwnPropertyDescriptor,Rt=function(e){return"function"==typeof Array.isArray?Array.isArray(e):"[object Array]"===jt.call(e)},Ut=function(e){if(!e||"[object Object]"!==jt.call(e))return!1;var t,n=Pt.call(e,"constructor"),r=e.constructor&&e.constructor.prototype&&Pt.call(e.constructor.prototype,"isPrototypeOf");if(e.constructor&&!n&&!r)return!1;for(t in e);return void 0===t||Pt.call(e,t)},_t=function(e,t){$t&&"__proto__"===t.name?$t(e,t.name,{enumerable:!0,configurable:!0,value:t.newValue,writable:!0}):e[t.name]=t.newValue},zt=function(e,t){if("__proto__"===t){if(!Pt.call(e,t))return;if(Ht)return Ht(e,t).value}return e[t]},Vt=function e(){var t,n,r,i,o,a,l=arguments[0],u=1,s=arguments.length,c=!1;for("boolean"==typeof l&&(c=l,l=arguments[1]||{},u=2),(null==l||"object"!=typeof l&&"function"!=typeof l)&&(l={});u<s;++u)if(null!=(t=arguments[u]))for(n in t)r=zt(l,n),l!==(i=zt(t,n))&&(c&&i&&(Ut(i)||(o=Rt(i)))?(o?(o=!1,a=r&&Rt(r)?r:[]):a=r&&Ut(r)?r:{},_t(l,{name:n,newValue:e(c,a,i)})):void 0!==i&&_t(l,{name:n,newValue:i}));return l};function Bt(e,t,n,r){if(!e)return-1;const i=n.cache,o=e.origin?e.origin():null;o&&(e=o);let a=i.fields.indexOf(e),l=-1,u=-1;if(-1===a)for(let t=0;t<i.wrappedFields.length;t++)if(u=i.wrappedFields[t].attrDims.map((e=>e.instance)).indexOf(e),l=i.wrappedFields[t].attrExps.map((e=>e.instance)).indexOf(e),-1!==u||-1!==l){a=t;break}if(Array.isArray(r)&&r.some(((e,t)=>e!==t))){const e=r.indexOf(a);-1!==e&&(a=e)}return a-=t.qArea.qLeft,a<0||a>=t.qArea.qWidth?-1:u>=0?e=>e[a].qAttrDims.qValues[u]:l>=0?e=>e[a].qAttrExps.qValues[l]:e=>e[a]}function Yt(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 Wt(e){let{cache:t,f:n,mainCell:r,p:i,prop:o,page:a,rowIdx:l,row:u,sourceKey:s,target:c,targetProp:f,columnOrder:h}=e,d=r;if(i.field&&i.field!==n){const e=Bt(i.field,a,{cache:t},h);if(-1===e)return;d=Vt({qRow:l},e(u))}c[f]=Yt(i,d,{key:s})}function Gt(e,t,n,r){const i=Array.isArray(e)?e:[e];let o=[];for(let e=0;e<i.length;e++)if(void 0!==i[e].field){const a=t.raw(),l=t.key(),u="object"==typeof i[e].field?i[e].field:t.field(i[e].field),{props:s,main:c}=r.normalizeConfig(i[e],t),f=Object.keys(s),h=!!i[e].trackBy,d=typeof i[e].trackBy,p={},m=[],g=[];for(let t=0;t<a.qDataPages.length;t++){const o=Bt(u,a.qDataPages[t],{cache:n},a.qColumnOrder);if(-1!==o)for(let v=0;v<a.qDataPages[t].qMatrix.length;v++){const y=a.qDataPages[t].qArea.qTop+v,b=Vt({qRow:y},o(a.qDataPages[t].qMatrix[v])),x=Yt(c,b,{key:l});if(!c.filter||c.filter(b)){for(let e=0;e<f.length;e++){const r=s[f[e]];let i=r.fields||[r];r.fields&&(x[f[e]]=[]);for(let o=0;o<i.length;o++)Wt({cache:n,f:u,mainCell:b,p:i[o],prop:f[e],props:s,page:a.qDataPages[t],rowIdx:y,row:a.qDataPages[t].qMatrix[v],sourceKey:l,target:r.fields?x[f[e]]:x,targetProp:r.fields?o:f[e],columnOrder:a.qColumnOrder});if(r.fields){const t=x[f[e]].map((e=>e.value)),n=x[f[e]].map((e=>e.label));x[f[e]]={value:"function"==typeof r.value?r.value(t):void 0!==r.value?r.value:t,label:"function"==typeof r.label?r.label(n):void 0!==r.label?String(r.label):String(x[f[e]].value)}}}h&&r.track({cfg:i[e],itemData:b,obj:x,target:m,tracker:p,trackType:d}),g.push(x)}}}const v=h?r.collect(m,{main:c,propsArr:f,props:s}):g;o=[...o,...v]}return o}function Kt(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 Zt(e,t){e instanceof Map?(e=[void 0,e],void 0===t&&(t=Xt)):void 0===t&&(t=Jt);for(var n,r,i,o,a,l=new tn(e),u=[l];n=u.pop();)if((i=t(n.data))&&(a=(i=Array.from(i)).length))for(n.children=i,o=a-1;o>=0;--o)u.push(r=i[o]=new tn(i[o])),r.parent=n,r.depth=n.depth+1;return l.eachBefore(en)}function Jt(e){return e.children}function Xt(e){return Array.isArray(e)?e[1]:null}function Qt(e){void 0!==e.data.value&&(e.value=e.data.value),e.data=e.data.data}function en(e){var t=0;do{e.height=t}while((e=e.parent)&&e.height<++t)}function tn(e){this.data=e,this.depth=this.height=0,this.parent=null}function nn(e){return null==e?null:function(e){if("function"!=typeof e)throw new Error;return e}(e)}tn.prototype=Zt.prototype={constructor:tn,count:function(){return this.eachAfter(Kt)},each:function(e,t){let n=-1;for(const r of this)e.call(t,r,++n,this);return this},eachAfter:function(e,t){for(var n,r,i,o=this,a=[o],l=[],u=-1;o=a.pop();)if(l.push(o),n=o.children)for(r=0,i=n.length;r<i;++r)a.push(n[r]);for(;o=l.pop();)e.call(t,o,++u,this);return this},eachBefore:function(e,t){for(var n,r,i=this,o=[i],a=-1;i=o.pop();)if(e.call(t,i,++a,this),n=i.children)for(r=n.length-1;r>=0;--r)o.push(n[r]);return this},find:function(e,t){let n=-1;for(const r of this)if(e.call(t,r,++n,this))return r},sum:function(e){return this.eachAfter((function(t){for(var n=+e(t.data)||0,r=t.children,i=r&&r.length;--i>=0;)n+=r[i].value;t.value=n}))},sort:function(e){return this.eachBefore((function(t){t.children&&t.children.sort(e)}))},path:function(e){for(var t=this,n=function(e,t){if(e===t)return e;var n=e.ancestors(),r=t.ancestors(),i=null;for(e=n.pop(),t=r.pop();e===t;)i=e,e=n.pop(),t=r.pop();return i}(t,e),r=[t];t!==n;)t=t.parent,r.push(t);for(var i=r.length;e!==n;)r.splice(i,0,e),e=e.parent;return r},ancestors:function(){for(var e=this,t=[e];e=e.parent;)t.push(e);return t},descendants:function(){return Array.from(this)},leaves:function(){var e=[];return this.eachBefore((function(t){t.children||e.push(t)})),e},links:function(){var e=this,t=[];return e.each((function(n){n!==e&&t.push({source:n.parent,target:n})})),t},copy:function(){return Zt(this).eachBefore(Qt)},[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 rn={depth:-1},on={},an={};function ln(e){return e.id}function un(e){return e.parentId}function sn(e){let t=e.length;if(t<2)return"";for(;--t>1&&!cn(e,t););return e.slice(0,t)}function cn(e,t){if("/"===e[t]){let n=0;for(;t>0&&"\\"===e[--t];)++n;if(0==(1&n))return!0}return!1}function fn(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=fn(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]=fn(r,i[e]);return t}n[e]in i&&(i=i[n[e]])}return i}function hn(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,...hn(e[i].children,t-1,n)]);return r}function dn(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=>hn(e.children,r-1,n)}return!1}const pn=/^qDimensionInfo(?:\/(\d+))?/,mn=/^\/?qMeasureInfo\/(\d+)/,gn=/\/qAttrExprInfo\/(\d+)/,vn=/\/qAttrDimInfo\/(\d+)/;function yn(e){return(e.qColumnOrder&&e.qColumnOrder.length?e.qColumnOrder:e.qDimensionInfo.map(((e,t)=>t))).filter((t=>t<e.qDimensionInfo.length))}function bn(e,t){let{cube:n}=t;if(!e)return-1;let r=e.origin&&e.origin()?e.origin().key():e.key(),i=!1,o=-1,a=-1,l=-1,u=-1,s=-1,c=-1,f=r;const h=n.qEffectiveInterColumnSortOrder,d=yn(n);return pn.test(f)&&(i=!0,o=+pn.exec(f)[1],f=r.replace(pn,"")),mn.test(f)&&("K"===n.qMode?s=+mn.exec(f)[1]:h&&-1!==h.indexOf(-1)?(s=+mn.exec(f)[1],c=0):c=+mn.exec(f)[1],f=f.replace(mn,"")),f&&(vn.exec(f)?l=+vn.exec(f)[1]:gn.exec(f)&&(a=+gn.exec(f)[1])),u=i?"S"===n.qMode?d[o]:h?h.indexOf(o):o:h&&-1!==h.indexOf(-1)?h.indexOf(-1):n.qDimensionInfo.length-("K"===n.qMode?0:1),{fieldDepth:u+1,pseudoMeasureIndex:s,measureIdx:c,attrDimIdx:l,attrIdx:a}}function xn(e,t){let n,r,i=dn(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 wn(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 Mn(e){let{propsArr:t,props:n,item:r,itemData:i,ret:o,sourceKey:a}=e;for(let e=0;e<t.length;e++){const l=n[t[e]],u=l.fields||[l];let s,c;l.fields&&(s=[],c=[]);for(let n=0;n<u.length;n++){const f=u[n];let h,d,p,m,g,v;if("primitive"===f.type?(p=f.value,v=String(f.value)):("function"==typeof f.value&&(h=e=>f.value(e,r)),"function"==typeof f.label&&(d=e=>f.label(e,r)),f.accessor?(m=f.accessor(r),Array.isArray(m)?(g=m.map(f.valueAccessor),f.attrAccessor&&(g=g.map(f.attrAccessor)),h&&(p=g.map(h),h=null),d&&(v=g.map(d),d=null),p=f.reduce?f.reduce(p):p,v=f.reduceLabel?f.reduceLabel(v,p):String(p)):(p=f.attrAccessor?f.attrAccessor(f.valueAccessor(m)):f.valueAccessor(m),v=p)):(p=i,v=i)),l.fields){const e=h?h(p):p;s.push(e),c.push(d&&null!=v?d(v):null!=v?v:String(e))}else{const n=h?h(p):p;o[t[e]]={value:n,label:d?d(v):null!=v?v:String(n)},f.field&&(o[t[e]].source={field:f.field.key(),key:a})}}s&&(o[t[e]]={value:"function"==typeof l.value?l.value(s,r):s,label:"function"==typeof l.label?l.label(c,r):c})}}const qn=(e,t,n)=>{const r="K"===e.qMode?"/qStackedDataPages/*/qData":"/qTreeDataPages/*",i="K"===e.qMode?"qSubNodes":"qNodes",o=fn(r,e);return o&&o[0]?(t.tree=Zt(o[0],n.children||(e=>e[i])),t.tree):null};function Cn(e){const t=e.raw().qDataPages.length?e.raw().qDataPages[0].qMatrix:[],n=function(e){const t=e.raw().qColumnOrder,n=e.fields();return t&&t.length===n.length?t:n.map(((e,t)=>t))}(e),r=e.fields(),i=e.fields().filter((e=>"dimension"===e.type())).map((e=>n.indexOf(r.indexOf(e)))),o=e.fields().filter((e=>"measure"===e.type())).map((e=>n.indexOf(r.indexOf(e)))),a={__root:{__id:"__root",qValues:[]}};for(let e=0;e<t.length;e++){const n=t[e];let r="__root",u=!1;for(let e=0;e<i.length;e++){var l;const t=n[i[e]],o="".concat(r,"__").concat(null!==(l=t.qElemNumber)&&void 0!==l?l:t.qElemNo);a[o]||(a[o]=Lt({__id:o,__parent:r,qValues:[]},t),u=!0),r=o}if(u)for(let e=0;e<o.length;e++){const t=n[o[e]];a[r].qValues.push(t)}}const u=Object.keys(a).map((e=>a[e]));return function(){var e,t=ln,n=un;function r(r){var i,o,a,l,u,s,c,f,h=Array.from(r),d=t,p=n,m=new Map;if(null!=e){const t=h.map(((t,n)=>function(e){let t=(e=`${e}`).length;return cn(e,t-1)&&!cn(e,t-2)&&(e=e.slice(0,-1)),"/"===e[0]?e:`/${e}`}(e(t,n,r)))),n=t.map(sn),i=new Set(t).add("");for(const e of n)i.has(e)||(i.add(e),t.push(e),n.push(sn(e)),h.push(an));d=(e,n)=>t[n],p=(e,t)=>n[t]}for(a=0,i=h.length;a<i;++a)o=h[a],s=h[a]=new tn(o),null!=(c=d(o,a,r))&&(c+="")&&(f=s.id=c,m.set(f,m.has(f)?on:s)),null!=(c=p(o,a,r))&&(c+="")&&(s.parent=c);for(a=0;a<i;++a)if(c=(s=h[a]).parent){if(!(u=m.get(c)))throw new Error("missing: "+c);if(u===on)throw new Error("ambiguous: "+c);u.children?u.children.push(s):u.children=[s],s.parent=u}else{if(l)throw new Error("multiple roots");l=s}if(!l)throw new Error("no root");if(null!=e){for(;l.data===an&&1===l.children.length;)l=l.children[0],--i;for(let e=h.length-1;e>=0&&(s=h[e]).data===an;--e)s.data=null}if(l.parent=rn,l.eachBefore((function(e){e.depth=e.parent.depth+1,--i})).eachBefore(en),l.parent=null,i>0)throw new Error("cycle");return l}return r.id=function(e){return arguments.length?(t=nn(e),r):t},r.parentId=function(e){return arguments.length?(n=nn(e),r):n},r.path=function(t){return arguments.length?(e=nn(t),r):e},r}().id((e=>e.__id)).parentId((e=>e.__parent))(u)}const Dn=e=>{let{propsArr:t,props:n,cube:r,cache:i,itemDepthObject:o,f:a}=e;for(let e=0;e<t.length;e++){const l=n[t[e]],u=l.fields?l.fields:[l];for(let e=0;e<u.length;e++){const t=u[e];if(t.field!==a){const e=xn(o,bn(t.field,{cube:r,cache:i}));t.accessor=e.nodeFn,t.valueAccessor=e.valueFn,t.attrAccessor=e.attrFn}}}};function kn(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0,n=arguments.length>2?arguments[2]:void 0,r=arguments.length>3?arguments[3]:void 0;const i=t.raw(),o=t.key(),a="S"===i.qMode?Cn(t):qn(i,n,e);if(!a)return null;const l=a.height,u=[];for(let o=0;o<=l;o++){let a=null;if(o>0)if("S"===i.qMode){let e=yn(i)[o-1];a=n.fields[e]}else{let e=i.qEffectiveInterColumnSortOrder[o-1];o>i.qEffectiveInterColumnSortOrder.length&&(e=i.qDimensionInfo.length),a=n.fields[e]}const{props:l,main:s}=r.normalizeConfig(Lt(Lt({},e),{},{field:a?a.key():void 0}),t),c=Object.keys(l);u[o]={propsArr:c,props:l,main:s};const f=a?bn(a,{cube:i,cache:n}):{fieldDepth:0};Dn({propsArr:c,props:l,cube:i,cache:n,itemDepthObject:f,f:a})}const s=a.copy().descendants(),c=a.descendants();for(let e=0;e<c.length;e++){const t=u[c[e].depth].propsArr,n=u[c[e].depth].props,r=u[c[e].depth].main,i=s[e],a=i.data,l=wn(r,a,{key:o});Mn({propsArr:t,props:n,item:i,itemData:a,ret:l,sourceKey:o,isTree:!0}),c[e].data=l}return a}function Sn(e,t,n,r){const i=Array.isArray(e)?e:[e];let o=[];for(let a=0;a<i.length;a++)if(void 0!==i[a].field){const l=t.raw(),u=t.key();if(!qn(l,n,e))continue;const s="object"==typeof i[a].field?i[a].field:t.field(i[a].field),{props:c,main:f}=r.normalizeConfig(i[a],t),h=Object.keys(c),d=bn(s,{cube:l,cache:n}),{nodeFn:p,attrFn:m,valueFn:g}=xn({fieldDepth:0},d);Dn({propsArr:h,props:c,cube:l,cache:n,itemDepthObject:d,f:s});const v=!!i[a].trackBy,y=typeof i[a].trackBy,b={},x=[],w=p(n.tree),M=[];for(let e=0;e<w.length;e++){const t=w[e],n=m?m(g(t)):g(t);if(f.filter&&!f.filter(n))continue;const o=wn(f,n,{key:u});Mn({propsArr:h,props:c,item:t,itemData:n,ret:o,sourceKey:u}),v&&r.track({cfg:i[a],itemData:n,obj:o,target:x,tracker:b,trackType:y}),M.push(o)}const q=v?r.collect(x,{main:f,propsArr:h,props:c}):M;o=[...o,...q]}return o}var In,Nn,On=(In=function(e){
8
8
  /*! javascript-number-formatter - v1.1.11 - http://mottie.github.com/javascript-number-formatter/ * © ecava */
9
9
  e.exports=function(e,t){if(!e||isNaN(+t))return t;var n,r,i,o,a,l,u,s,c,f,h=e.length,d=e.search(/[0-9\-\+#]/),p=d>0?e.substring(0,d):"",m=e.split("").reverse().join(""),g=m.search(/[0-9\-\+#]/),v=h-g,y=e.substring(v,v+1),b=v+("."===y||","===y?1:0),x=g>0?e.substring(b,h):"";if(n=(t="-"===(e=e.substring(d,b)).charAt(0)?-t:+t)<0?t=-t:0,i=(r=e.match(/[^\d\-\+#]/g))&&r[r.length-1]||".",o=r&&r[1]&&r[0]||",",e=e.split(i),t=+(t=t.toFixed(e[1]&&e[1].length))+"",l=e[1]&&e[1].lastIndexOf("0"),(!(s=t.split("."))[1]||s[1]&&s[1].length<=l)&&(t=(+t).toFixed(l+1)),c=e[0].split(o),e[0]=c.join(""),(a=e[0]&&e[0].indexOf("0"))>-1)for(;s[0].length<e[0].length-a;)s[0]="0"+s[0];else 0==+s[0]&&(s[0]="");if((t=t.split("."))[0]=s[0],u=c[1]&&c[c.length-1].length){for(m="",v=(f=t[0]).length%u,h=f.length,b=0;b<h;b++)m+=f.charAt(b),!((b-v+1)%u)&&b<h-u&&(m+=o);t[0]=m}return t[1]=e[1]&&t[1]?i+t[1]:"","0"!==(r=t.join(""))&&""!==r||(n=!1),p+(n?"-":"")+r+x}},In(Nn={exports:{}}),Nn.exports);function Tn(e){return e.replace(/[-[\]/{}()*+?.\\^$|]/g,"\\$&")}const En={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"},An=/%\)?$/,Ln=/^\(r(0[2-9]|[12]\d|3[0-6])\)/i,Fn=/^\(oct\)/i,Pn=/^\(dec\)/i,jn=/^\(hex\)/i,$n=/^\(bin\)/i,Hn=/^\(rom\)/i,Rn=/^(\(rom\)|\(bin\)|\(hex\)|\(dec\)|\(oct\)|\(r(0[2-9]|[12]\d|3[0-6])\))/i,Un=/#|0/g;function _n(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 zn(e,t,n){const r=Tn(e);return n?r:new RegExp(r||"",t)}function Vn(e,t,n,r){let i,o,a,l,u,s,c,f,h,d=e.pattern;var p,m;r&&(e.abbreviate=!0),p=t,(m=n)&&(m=Tn(m)),p&&(p=Tn(p)),h=new RegExp("(?:[#0]+".concat(p,")?[#0]+(?:").concat(m,"[#0]+)?")),a=d.match(h),a=a?a[0]:"",l=a?d.substr(0,d.indexOf(a)):d,u=a?d.substring(d.indexOf(a)+a.length):"",a||(a=d?"#":"##########"),t&&t===n&&(i=a.split(n),o=i.pop(),a=i.join("")+n+o,t=""),s=t,t=/,/.test(n)?"¤":",",s&&(a=a.replace(zn(s,"g"),t)),c=n,n=".",c&&(a=a.replace(zn(c,"g"),n)),f=a.match(/#/g),f=f?f.length:0;const g=d.split(c);let v;g[1]&&(v=g[1].match(Un)),e.prefix=l||"",e.postfix=u||"",e.pattern=d,e.maxPrecision=v?v.length:2,e.percentage=An.test(d),e.numericPattern=a||"",e.numericRegex=new RegExp("".concat(zn(t,null,!0),"|").concat(zn(n,null,!0)),"g"),e.groupTemp=s,e.decTemp=c,e.t=t,e.d=n,e.temp=f}class Bn{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 En;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 Bn(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],Rn.test(e[0])&&(r.positive.isFunctional=!0),e[1]?Rn.test(e[1])&&(r.negative.isFunctional=!0):r.negative=!1,e[2]?Rn.test(e[2])&&(r.zero.isFunctional=!0):r.zero=!1;const i="U"===this.type;r.positive.isFunctional||Vn(r.positive,t,n,i),r.negative&&!r.negative.isFunctional&&Vn(r.negative,t,n,i),r.zero&&!r.zero.isFunctional&&Vn(r.zero,t,n,i)}formatValue(e){let t,n,r,i,o,a,l,u,s,c=this._prepared,f="",h="",d=e;if(isNaN(e))return"".concat(d);if(e=+e,!1===c.pattern)return e.toString();if(0===e&&c.zero)return c=c.zero,c.pattern;if(e<0&&c.negative?(c=c.negative,e=-e):c=c.positive,o=c.d,a=c.t,c.isFunctional)e=function(e,t,n){let r;return Ln.test(t)?e=_n(e,Number(/\d{2}/.exec(t)[0]),t,n):Fn.test(t)?e=_n(e,8,t,n):Pn.test(t)?e=_n(e,10,t,n):jn.test(t)?e=_n(e,16,t,n):$n.test(t)?e=_n(e,2,t,n):Hn.test(t)&&(r="",e<0&&(r="-",e=-e),0===(e=Math.floor(e))?e="0":e<=5e5?(e=function(e,t){let n,r="",i=Number(String(e).slice(-3)),o=(e-i)/1e3,a=[0,1,4,5,9,10,40,50,90,100,400,500,900].reverse(),l=["0","I","IV","V","IX","X","XL","L","XC","C","CD","D","CM"].reverse();for(;i>0;)for(n=0;n<a.length;n++)if(a[n]<=i){r+=l[n],i-=a[n];break}for(n=0;n<o;n++)r="M".concat(r);return t[1]!==t[1].toUpperCase()&&(r=r.toLowerCase()),r}(e,t),e=r+e):e=t+r+e.toExponential(0)),e}(e,c.pattern,o);else{if(c.percentage&&(e*=100),c.abbreviate){const t=Object.keys(this.abbreviations).map((e=>parseInt(e,10))).sort(((e,t)=>e-t));let r,i,o=t[0];for(l=0,n=Number(Number(e).toExponential().split("e")[1]);o<=n&&l<t.length;)l++,o=t[l];l>0&&(r=t[l-1]),r&&n>0&&r>0?i=r:(n<0&&r<0||!r)&&(o<0&&o-n<=c.maxPrecision?i=o:r<=n&&!(o>0&&-n<=c.maxPrecision)&&(i=r)),i&&(f=this.abbreviations[i],e/=10**i)}if(r=Math.abs(e),t=c.temp,u=c.numericPattern,s=u.split(o)[1],"I"===this.type&&(e=Math.round(e)),i=e,s||"#"!==u.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.toFixed(Math.min(20,s?s.length:0)).split(".")[0]);let n=u.split(o)[0];if(n+=o,e=On(n,t)||"0",s){const t=Math.max(0,Math.min(14,s.length)),n=s.replace(/#+$/,"").length;let i=("I"===this.type?0:r%1+1e-15).toFixed(t).slice(2).replace(/0+$/,"");for(l=i.length;l<n;l++)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)/,""),h=""):(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(u+=o,t=Math.max(0,Math.min(20,t-Math.ceil(Math.log(r)/Math.log(10)))),l=0;l<t;l++)u+="#";e=On(u,e)}e=e.replace(c.numericRegex,(e=>e===a?c.groupTemp:e===o?c.decTemp:"")),i<0&&!/^-/.test(e)&&(e="-".concat(e))}return c.prefix+e+h+f+c.postfix}static getStaticFormatter(){return{prepare(){},formatValue:e=>"".concat(e)}}}function Yn(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const{size:n=5e3,multipleArguments:r=!1,toKey:i=(e=>e)}=t;let o,a,l=Object.create(null),u=Object.create(null),s=0,c=0;return o=r?function(){return a=i(...arguments),o.has(a)?o.get(a):o.set(a,e(...arguments))}:t=>(a=i(t),o.has(a)?o.get(a):o.set(a,e(t))),o.set=(e,t)=>(s>=n&&(delete l[u[c]],delete u[c],s--,c++),l[e]=t,u[s]=e,s++,t),o.get=e=>l[e],o.has=e=>e in l,o.clear=()=>{l=Object.create(null),u=Object.create(null),s=0,c=0},o.size=()=>s,o}function Wn(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 Bn(...t)}(i,e,t,n,r),a=Yn(o.formatValue.bind(o),{toKey:e=>isNaN(e)?e:+e});function l(e){return a(e)}return l.format=function(e,t,n,r){return a.clear(),o.format(t,e,n,r)},l.pattern=function(e){return e&&(a.clear(),o.pattern=e,o.prepare()),o.pattern},l}const Gn="IV",Kn=["Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"],Zn=["Mon","Tue","Wed","Thu","Fri","Sat","Sun"],Jn=["January","February","March","April","May","June","July","August","September","October","November","December"],Xn=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function Qn(e,t){for(let n=e.length;n<t;n++)e="0".concat(e);return e}function er(e){let t=e.toString().split(".");return t[1]?(t=Number("0.".concat(t[1])),t):0}class tr{constructor(e,t,n){const r=e||{};r.qCalendarStrings||(r.qCalendarStrings={qLongDayNames:Kn,qDayNames:Zn,qLongMonthNames:Jn,qMonthNames:Xn}),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={T:r.qTimeFmt||"hh:mm:ss",D:r.qDateFmt||"YYYY-MM-DD",TS:r.qTimestampFmt||"YYYY-MM-DD hh:mm:ss"}[n]),this.pattern=t}clone(){const e=new tr(this.localeInfo,this.pattern);return e.subtype=this.subtype,e}format(e,t){t||(t=this.pattern?this.pattern:"YYYY-MM-DD hh:mm:ss"),t=t.replace(/\[.+]|\[|]/g,"");const n=/t+/gi.test(t);let r;e instanceof Date?r=function(e,t){let n=e.getUTCHours(),r=e.getUTCDay()-1;return t&&(n%=12,n||(n=12)),r<0&&(r=6),{year:e.getUTCFullYear(),month:e.getUTCMonth(),day:r,date:e.getUTCDate(),h:n,m:e.getUTCMinutes(),s:e.getUTCSeconds(),f:e.getUTCMilliseconds(),t:e.getUTCHours()>=12?"pm":"am"}}(e,n):(e<0&&(e=-e,t="-".concat(t)),r=function(e,t){let n,r=function(e){const t=e,n=24*er(t),r=60*er(n),i=60*er(r),o=1e3*er(i);return{d:Math.floor(t),h:Math.floor(n),m:Math.floor(r),s:Math.floor(i),f:Math.round(o)}}(e),i=r.d,o=r.h,a=r.m,l=r.s,u=r.f,s=0;/w+|t+/gi.test(t)&&(n=new Date(Date.UTC(1899,11,30+Math.floor(e),0,0,Math.round(86400*(e-Math.floor(e))))),isNaN(n.getTime())&&(n=null)),/D+/gi.test(t)||(o+=24*i),/h+/gi.test(t)||(a+=60*o),/m+/gi.test(t)||(l+=60*a),/w+/gi.test(t)&&(s=n?n.getDay()-1:0,s<0&&(s=6));let c="";return n&&(c=n.getUTCHours()>=12?"pm":"am"),{year:0,month:0,day:s,date:i,h:o,m:a,s:l,f:u,t:c}}(e,t));const i=(o=this,a=r,{"Y+|y+":{Y:"".concat(Number("".concat(a.year).slice(-2))),YY:Qn("".concat(a.year).slice(-2),2),YYY:Qn("".concat(a.year).slice(-3),3),def:e=>Qn("".concat(a.year),e.length)},"M+":{M:a.month+1,MM:Qn("".concat(a.month+1),2),MMM:o.locale_months_abbr[a.month],def:o.locale_months[a.month]},"W+|w+":{W:a.day,WW:Qn("".concat(a.day),2),WWW:o.locale_days_abbr[a.day],def:o.locale_days[a.day]},"D+|d+":{D:a.date,def:e=>Qn("".concat(a.date),e.length)},"h+|H+":{h:a.h,def:e=>Qn("".concat(a.h),e.length)},"m+":{m:a.m,def:e=>Qn("".concat(a.m),e.length)},"s+|S+":{s:a.s,def:e=>Qn("".concat(a.s),e.length)},"f+|F+":{def(e){let t="".concat(a.f),n=e.length-t.length;if(n>0)for(let e=0;e<n;e++)t+="0";else n<0&&(t=t.slice(0,e.length));return t}},"t{1,2}|T{1,2}":{def(e){let t=a.t;return e[0].toUpperCase()===e[0]&&(t=t.toUpperCase()),t=t.slice(0,e.length),t}}});var o,a;const l=[];for(const e in i)Object.prototype.hasOwnProperty.call(i,e)&&l.push(e);const u=new RegExp(l.join("|"),"g");return t.replace(u,(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 nr(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return new tr(...t)}function rr(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"TS",n=nr(arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,e,t),r=Yn(n.format.bind(n),{toKey:e=>"object"==typeof e&&"function"==typeof e.getTime?e.getTime():e});function i(e){return t!==Gn?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=nr(i,e,t),r=Yn(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 ir(){let e,{meta:t,id:n,key:r,localeInfo:i,fieldExtractor:o,value:a,type:l,sourceField:u}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const s=a||("dimension"===l?e=>null==e?void 0:e.qElemNo:e=>null==e?void 0:e.qValue),c="dimension"===l?"first":"avg",f=function(e,t){if(e&&e.qNumFormat&&-1!==["D","T","TS","IV"].indexOf(e.qNumFormat.qType))return rr(e.qNumFormat.qFmt,e.qNumFormat.qType,t);let n="#",r=t&&void 0!==t.qThousandSep?t.qThousandSep:",",i=t&&void 0!==t.qDecimalSep?t.qDecimalSep:".",o="U",a=e&&!!e.qIsAutoFormat;return e&&e.qNumFormat?(n=e.qNumFormat.qFmt||n,r=e.qNumFormat.qThou||r,i=e.qNumFormat.qDec||i,o=e.qNumFormat.qType||o,a=a&&-1===["M"].indexOf(e.qNumFormat.qType)):a=!0,(a||"U"===o)&&(n="#".concat(i,"##"),o="U"),Wn(n,r,i,o,t)}(t,i),h="dimension"===l?"first":(e,t)=>f(t),d={id:()=>n,key:()=>r,raw:()=>t,title:()=>t.qFallbackTitle||t.label,type:()=>l,origin:()=>u,items:()=>(e||(e=o(d)),e),min:()=>t.qMin,max:()=>t.qMax,value:s,label:e=>(null==e?void 0:e.qText)||"",reduce:c,reduceLabel:h,formatter:()=>f,tags:()=>t.qTags};return d}function or(e,t,n,r,i){return(t[e]||[]).map(((t,o)=>{const a="".concat(r?"".concat(r,"/"):"").concat(e,"/").concat(o),l={instance:ir(Vt({id:"".concat(n?"".concat(n,"/"):"").concat(a),key:a,meta:t},i))};return l.attrDims=or("qAttrDimInfo",t,n,a,Vt({},i,{value:e=>null==e?void 0:e.qElemNo,type:"dimension"})),l.attrExps=or("qAttrExprInfo",t,n,a,Vt({},i,{value:e=>null==e?void 0:e.qNum,type:"measure"})),l.measures=or("qMeasureInfo",t,n,a,Vt({},i,{value:e=>null==e?void 0:e.qValue,type:"measure"})),l}))}function ar(){let{key:e,data:t,config:n={}}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const r={fields:[],wrappedFields:[],allFields:[],virtualFields:[]},i=t;if(!i)throw new Error('Missing "data" input');if(!i.qDimensionInfo)throw new Error('The "data" input is not recognized as a hypercube');const o=ar.util,a={cache:r,cube:i,localeInfo:n.localeInfo,fieldExtractor:null,pages:null,hierarchy:()=>null,virtualFields:n.virtualFields},l={key:()=>e,raw:()=>i,field:e=>function(e,t){let{cache:n}=t;if("number"==typeof e)return n.fields[e];const r=n.allFields;if("function"==typeof e){for(let t=0;t<r.length;t++)if(e(r[t]))return r[t];return!1}if("string"==typeof e){for(let t=0;t<r.length;t++)if(r[t].key()===e||r[t].title()===e)return r[t]}else if(e&&-1!==r.indexOf(e))return e;throw Error("Field not found: ".concat(e))}(e,a),fields:()=>r.fields.slice(),extract:e=>a.extractor(e,l,r,o),hierarchy:e=>a.hierarchy(e,l,r,o),_cache:()=>r};"K"===i.qMode||"T"===i.qMode||!i.qMode&&i.qNodesOnDim?(a.extractor=Sn,a.hierarchy=kn,a.pages="K"===i.qMode?i.qStackedDataPages:i.qTreeDataPages):"S"===i.qMode?(a.extractor=Gt,a.pages=i.qDataPages,a.hierarchy=kn):a.extractor=()=>[],a.fieldExtractor=e=>a.extractor({field:e},l,r,o);const u="S"===i.qMode?e=>e.qElemNumber:void 0,s="S"===i.qMode?e=>e.qNum:void 0;r.wrappedFields.push(...or("qDimensionInfo",i,e,"",Vt({},a,{value:u,type:"dimension"}))),r.wrappedFields.push(...or("qMeasureInfo",i,e,"",Vt({},a,{value:s,type:"measure"}))),r.fields=r.wrappedFields.map((e=>e.instance));const c=e=>{e.forEach((e=>{r.allFields.push(e.instance),c(e.measures),c(e.attrDims),c(e.attrExps)}))};return c(r.wrappedFields),(n.virtualFields||[]).forEach((t=>{const n=l.field(t.from),i=ir(Lt({meta:n.raw(),id:"".concat(e,"/").concat(t.key),sourceField:n,fieldExtractor:e=>a.extractor({field:e},l,r,o),key:t.key,type:n.type(),localeInfo:a.localeInfo,value:n.value},t.override||{}));r.virtualFields.push(i)})),r.allFields.push(...r.virtualFields),l}const lr=[["qHyperCube","qHyperCubeDef"],["qTreeData","qTreeDataDef"],["qDimensionInfo","qDimensions"],["qMeasureInfo","qMeasures"],["qAttrDimInfo","qAttributeDimensions"],["qAttrExprInfo","qAttributeExpressions"]],ur=/\/qDimensionInfo(?:\/(\d+))?/,sr=/\/qMeasureInfo\/(\d+)/,cr=/\/qAttrDimInfo\/(\d+)(?:\/(\d+))?/,fr=/\/qAttrExprInfo\/(\d+)/,hr=/\/?qHyperCube/,dr=/\/?qTreeData/,pr=e=>"".concat(e.substr(0,e.indexOf("/qHyperCubeDef")+14)),mr=e=>"".concat(e.substr(0,e.indexOf("/qTreeDataDef")+13));function gr(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2?arguments[2]:void 0;const r=t.byCells,i=t.primarySource,o=[],a={},l=e.isActive();let u=!1;return e.brushes().forEach((e=>{const t=function(e,t){let n=e,r=-1,i=-1,o="",a=e=>e;hr.test(e)?(o="".concat(n.substr(0,n.indexOf("qHyperCube")+10)),a=pr):dr.test(e)&&(o="".concat(n.substr(0,n.indexOf("qTreeData")+9)),a=mr);let l=!0;if(ur.test(e)&&(r=+ur.exec(e)[1]),sr.test(e)&&(i=+sr.exec(e)[1]),cr.test(e)){i=-1,r=0;const e=+cr.exec(n)[2];isNaN(e)||(r=e,n=n.replace(/\/\d+$/,"")),l=!1}if(fr.test(e)){const e=i;if(t){i=0;const a=fn(o,t);i+=(a.qMeasureInfo||[]).length,r>-1?(i=a.qDimensionInfo.slice(0,r).reduce(((e,t)=>e+t.qAttrExprInfo.length),i),r=-1):(i=a.qDimensionInfo.reduce(((e,t)=>e+t.qAttrExprInfo.length),i),i=a.qMeasureInfo.slice(0,e).reduce(((e,t)=>e+t.qAttrExprInfo.length),i)),i+=+fr.exec(n)[1]}else r>-1?(r=-1,i=+fr.exec(n)[1]):i+=+fr.exec(n)[1]+1}return lr.forEach((e=>{let[t,r]=e;n=n.replace(t,r)})),l&&(n=a(n)),n&&"/"!==n[0]&&(n="/".concat(n)),{measureIdx:i,dimensionIdx:r,path:n}}(e.id,n);if("range"===e.type&&t.measureIdx>-1&&t.dimensionIdx>-1){const n=e.brush.ranges();n.length&&(u=!0,a.multiRangeSelectTreeDataValues||(a.multiRangeSelectTreeDataValues={path:t.path,ranges:[]}),n.forEach((e=>a.multiRangeSelectTreeDataValues.ranges.push({qMeasureIx:t.measureIdx,qDimensionIx:t.dimensionIdx,qRange:{qMin:e.min,qMax:e.max,qMinInclEq:!0,qMaxInclEq:!0}}))))}else{if("range"===e.type&&t.measureIdx>-1){const n=e.brush.ranges();n.length&&(u=!0,a.rangeSelectHyperCubeValues||(a.rangeSelectHyperCubeValues={path:t.path,ranges:[]}),n.forEach((e=>a.rangeSelectHyperCubeValues.ranges.push({qMeasureIx:t.measureIdx,qRange:{qMin:e.min,qMax:e.max,qMinInclEq:!0,qMaxInclEq:!0}}))))}if("range"===e.type&&t.dimensionIdx>-1){const n=e.brush.ranges();n.length&&(u=!0,a.selectHyperCubeContinuousRange||(a.selectHyperCubeContinuousRange={path:t.path,ranges:[]}),n.forEach((e=>a.selectHyperCubeContinuousRange.ranges.push({qDimIx:t.dimensionIdx,qRange:{qMin:e.min,qMax:e.max,qMinInclEq:!0,qMaxInclEq:!1}}))))}if("value"===e.type&&t.dimensionIdx>-1)if(r)if(n&&n.qHyperCube&&("P"===n.qHyperCube.qMode||"T"===n.qHyperCube.qMode||"K"===n.qHyperCube.qMode)){const r=n.qHyperCube,o=r.qNoOfLeftDims,l=r.qEffectiveInterColumnSortOrder.indexOf(t.dimensionIdx);if(a.selectPivotCells||(a.selectPivotCells={path:t.path,cells:[]}),e.id===i||!i){const n=e.brush.values().map((e=>+e)).filter((e=>!isNaN(e)));(0===o||l>=o)&&o>-1?n.forEach((e=>{a.selectPivotCells.cells.push({qType:"T",qCol:e,qRow:l-o})})):n.forEach((e=>{a.selectPivotCells.cells.push({qType:"L",qCol:t.dimensionIdx,qRow:e})})),u=!!a.selectPivotCells.cells.length}}else a.selectHyperCubeCells||(a.selectHyperCubeCells={path:t.path,cols:[]}),a.selectHyperCubeCells.cols.push(t.dimensionIdx),e.id!==i&&(i||a.selectHyperCubeCells.values)||(a.selectHyperCubeCells.values=e.brush.values().map((e=>+e)).filter((e=>!isNaN(e))),u=!!a.selectHyperCubeCells.values.length);else{const n=e.brush.values().map((e=>+e)).filter((e=>!isNaN(e)));u=!!n.length,o.push({params:[t.path,t.dimensionIdx,n,!1],method:"selectHyperCubeValues"})}}})),!u&&l?[{method:"resetMadeSelections",params:[]}]:(a.rangeSelectHyperCubeValues&&o.push({method:"rangeSelectHyperCubeValues",params:[a.rangeSelectHyperCubeValues.path,a.rangeSelectHyperCubeValues.ranges,[],null===(s=t.orMode)||void 0===s||s]}),a.selectHyperCubeContinuousRange&&o.push({method:"selectHyperCubeContinuousRange",params:[a.selectHyperCubeContinuousRange.path,a.selectHyperCubeContinuousRange.ranges]}),a.selectHyperCubeCells&&o.push({method:"selectHyperCubeCells",params:[a.selectHyperCubeCells.path,a.selectHyperCubeCells.values,a.selectHyperCubeCells.cols]}),a.selectPivotCells&&o.push({method:"selectPivotCells",params:[a.selectPivotCells.path,a.selectPivotCells.cells]}),a.multiRangeSelectTreeDataValues&&o.push({method:"multiRangeSelectTreeDataValues",params:[a.multiRangeSelectTreeDataValues.path,a.multiRangeSelectTreeDataValues.ranges]}),o);var s}function vr(e){ar.util=e.data("matrix").util,e.data("q",ar),e.formatter("q-number",Wn),e.formatter("q-time",rr)}function yr(e){var t=Nt(e.layout||{},e.path.split("/").join("."));if(!t)return!1;var n=t.qIsOneAndOnlyOne;return void 0!==n&&n}function br(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];if(null==e||!e.length)return!1;var t=e.filter((function(e){return"object"===T(e.data)&&Array.isArray(e.data.fields)})).every((function(e){return e.data.fields.every((function(e){var t=e.raw();return!(!t.qLocked&&t.qCardinal)}))}));return t}function xr(e){var t=e.brush,n=e.colorField,r=e.legendAlias,i=e.useLegendCube,o=void 0!==i&&i;!n||/qAttrDimInfo/.test(n)?(t.removeKeyAlias("attrDim/qDimensionInfo/0"),r&&t.removeKeyAlias(r),t.addKeyAlias("attrDim/qDimensionInfo/0","qHyperCube/".concat(n))):o&&t.addKeyAlias(r,"qHyperCube/".concat(n))}vr.qBrushHelper=gr,vr.selections=gr;var wr="Shift";function Mr(e){var t=e.brush,n=e.getConfig;return{interceptor:function(e){var r=t.brushes(),i=n(),o=i.allowSimultaneous,a=i.layout,l=void 0===a?{}:a;r.forEach((function(n){var r,i,a;("range"===n.type||null!==(r=e[0])&&void 0!==r&&r.key&&(null===(i=e[0])||void 0===i?void 0:i.key)!==n.id&&0!==o.indexOf(null===(a=e[0])||void 0===a?void 0:a.key))&&t.clear([])}));var u=e.filter((function(e){return-2!==e.value}));if(u.length>1){var s=function(e){var t=e.layout,n=void 0===t?{}:t,r=e.values,i=void 0===r?[]:r;if(null==i||!i.length)return[];var o=Array.from(new Set(i.map((function(e){return e.key})))),a=[];return o.forEach((function(e){var t=yr({layout:n,path:e}),r=i.filter((function(t){return t.key===e})),o=t?[r.pop()]:r;a.push.apply(a,j(o))})),a.filter(Boolean)}({layout:l,values:u});return s}return u},rangeInterceptor:function(e){var r=t.brushes(),i=n().allowSimultaneous;return r.filter((function(e){return"value"===e.type})).length?(t.clear([]),e):(r.forEach((function(n){var r=n.id===e[0].key||i.includes(n.id)&&i.includes(e[0].key);"range"!==n.type||r||t.clear([])})),e)}}}var qr=function e(t,n){return n[t]?e(t+1,n):t},Cr=function(e,t){var n=t.reduce((function(e,t){return e[t]=!0,e}),{});return e.reduce((function(e,t,r){var i=qr(r,n);return n[i]=!0,e[r]=i,e}),{})};function Dr(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.layout,n=e.filtered,r=void 0===n?{}:n,i=(null==t?void 0:t.qHyperCube)||{},o=i.qDimensionInfo,a=void 0===o?[]:o,l=i.qMeasureInfo,u=void 0===l?[]:l;return{dimensions:Cr(a,r.dimensions||[]),measures:Cr(u,r.measures||[])}}var kr="selectHyperCubeValues",Sr="selectHyperCubeContinuousRange";function Ir(e){var t=e.selection,n=e.fieldMap,r=t.method,i=t.params;if(r===kr){var o=n.dimensions[i[1]];void 0!==o&&(i[1]=o)}return r===Sr&&i[1].forEach((function(e){var t=n.dimensions[e.qDimIx];void 0!==t&&(e.qDimIx=t)})),t}var Nr=[],Or=0,Tr=function(e){var t=Nr.filter((function(e){var t;return null===(t=e.selections)||void 0===t?void 0:t.isActive()}));t.length&&("Enter"===e.key?t.forEach((function(e){return e.selections.confirm()})):"Escape"!==e.key&&"Esc"!==e.key||t.forEach((function(e){return e.selections.cancel()})))},Er=function(){document.addEventListener("keyup",Tr)},Ar=function(){document.removeEventListener("keyup",Tr)},Lr=function(e,t){Object.keys(t).forEach((function(n){e.on(n,t[n])}))},Fr=function(e,t){Object.keys(t).forEach((function(n){e.removeListener(n,t[n])}))};function Pr(e){var t=e.chart,n=e.document,r=e.selectionInfo,i=e.eventName,o=e.componentName,a=e.brushName,l=void 0===a?"selection":a,u=e.emit,s=void 0===u?"rangeClear":u,c=r.event===i,f=n.querySelector("[data-key='".concat(o,"-edge-0']"));if(c||!f)return!1;var h=t.component(o);return!!h&&(h.emit(s),"string"==typeof l&&t.brush(l).clear(),h)}var jr=["chart","document","selections","selectionInfo"],$r=function(e){e.chart,e.document,e.selections,e.selectionInfo;var t=F(e,jr);t.clearDiscrete(),t.clearContinuous(),t.clearMinor(),t.clearRange(),t.clearTap(),t.clearLegend()};function Hr(e){var t,n=e.lasso;null!=n&&null!==(t=n.active)&&void 0!==t&&t.call(n)&&(null==n||n.action(!1))}function Rr(e){var t,n=e.chart,r=e.selectionInfo,i=e.selectionActions,o=e.actions,a=void 0===o?{}:o,l=e.selections,u=e.selectionEvents;if(!1===i||!1===u)return function(){};var s=i.reset,c=void 0===s?Hr:s,f=i.clear,h=!1!==f&&function(e){var t=e.clear,n=void 0===t?$r:t,r=e.selections,i=e.selectionInfo,o=e.chart;return function(){var e=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}).cleared,t={selections:r,selectionInfo:i,chart:o,document:document,cleared:e};return n(N({clearDiscrete:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return function(e){var t=e.selectionInfo,n=e.chart,r=e.document,i=e.eventName,o=void 0===i?"discreteRange":i,a=e.componentName,l=void 0===a?"discrete-range-brush":a,u=e.cleared;return Pr({selectionInfo:t,chart:n,document:r,eventName:void 0!==u&&u?void 0:o,componentName:l,emit:"areaClear",brushName:e.brushName})}(N(N({},t),e))},clearContinuous:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return function(e){var t=e.selectionInfo,n=e.chart,r=e.document,i=e.eventName,o=void 0===i?"continuousRange":i,a=e.componentName,l=void 0===a?"continuous-range-brush":a,u=e.cleared;return Pr({selectionInfo:t,chart:n,document:r,eventName:void 0!==u&&u?void 0:o,componentName:l,brushName:e.brushName})}(N(N({},t),e))},clearMinor:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return function(e){var t=e.selectionInfo,n=e.chart,r=e.document,i=e.componentName,o=void 0===i?"minor-range-brush":i,a=e.eventName,l=void 0===a?"minorRange":a,u=e.cleared,s=void 0!==u&&u,c=e.brushName,f=Pr({selectionInfo:t,chart:n,document:r,eventName:s?void 0:l,componentName:o,brushName:void 0!==c&&c});if(f){var h=f.settings.settings,d=h.scale,p=h.brush,m=n.scale(d).data().fields.map((function(e){return e.id()})),g=n.brush(p),v=g.brushes().filter((function(e){return"range"===e.type&&m.some((function(t){return t===e.id}))}));g&&v.length&&v.forEach((function(e){g.removeRanges(e.brush.ranges().map((function(t){return{key:e.id,range:t}})))}))}}(N(N({},t),e))},clearRange:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return function(e){var t=e.selectionInfo,n=e.chart,r=e.document,i=e.selections,o=e.eventName,a=void 0===o?"xAxis":o,l=e.cleared;Pr({selectionInfo:t,chart:n,document:r,eventName:void 0!==l&&l?void 0:a,componentName:"".concat(a,"-range-brush"),emit:"areaClear",brushName:!1})&&i.clear()}(N(N({},t),e))},clearTap:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return function(e){var t=e.chart,n=e.selectionInfo,r=e.selections,i=e.events,o=void 0===i?["tap"]:i,a=e.brushNames,l=void 0===a?[]:a;if(n&&o.includes(n.event)){var u=n.currentComponent;n.previousComponent!==u&&(r.clear(),l.forEach((function(e){return t.brush(e).end()})))}}(N(N({},t),e))},clearLegend:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return function(e){var t=e.selectionInfo,n=e.chart,r=e.document,i=e.selections,o=e.eventName,a=void 0===o?"legendRange":o,l=e.componentName,u=void 0===l?"legend-range-brush":l,s=e.cleared,c=void 0!==s&&s,f=e.brushName;Pr({selectionInfo:t,chart:n,document:r,eventName:c?void 0:a,componentName:u,brushName:void 0!==f&&f})&&i.clear()}(N(N({},t),e))}},t))}}({clear:f,selections:l,selectionInfo:r,chart:n}),d=function(e){var t=e.chart,n=e.actions,r=e.reset,i=e.clear,o=!1,a={deactivated:function(e){var t=(n||{}).lasso;r({e:e,lasso:void 0!==t&&t})},canceled:function(e){var o=(n||{}).lasso;r({e:e,lasso:void 0!==o&&o}),i({e:e,chart:t,document:document})},cleared:function(e){o||(o=!0,i({e:e,chart:t,document:document,cleared:!0}),o=!1)}};return!1===r&&delete a.deactivated,!1===i&&delete a.cleared,!1===r&&!1===i&&delete a.canceled,a}({chart:n,clear:h,reset:c,actions:a}),p={};Object.entries(d).forEach((function(e){var t=P(e,2),n=t[0],r=t[1];p[n]=function(e,t){return t?function(n){return t({event:n,defaultFunc:e})}:e}(r,u[n])}));var m=function(e){var t=e.selectionEvents,n=e.selections,r=e.selectionInfo,i=e.clear,o=e.chart,a=e.document,l=t.start,u={selections:n,selectionInfo:r,chart:o,document:a},s=function(e){return Object.assign(r,e||{})},c=function(e){var t=e.event,n=e.components;return function(){return function(e){var t=e.selectionInfo,n=e.clear,r=e.event,i=e.components,o=void 0===i?[]:i;(0,e.setSelectionInfo)(N(N({},void 0===t?{}:t),{},{event:r,components:o.map((function(e){return e.key})).filter(Boolean)})),n()}({event:t,components:n,clear:i,chart:o,selectionInfo:r,setSelectionInfo:s})}};return"function"==typeof l?function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];l(N(N({defaultFunc:c({event:e,components:t}),setSelectionInfo:s,clear:i},u),{},{event:e,components:t}))}:function(e){c({event:e,components:arguments.length>1&&void 0!==arguments[1]?arguments[1]:[]})()}}({selectionEvents:u,selections:l,selectionInfo:r,clear:h,chart:n,document:document});return null==a||null===(t=a.select)||void 0===t||t.on("start",m),Object.entries(p).forEach((function(e){var t=P(e,2),n=t[0],r=t[1];null==l||l.on(n,r)})),function(){var e;null==a||null===(e=a.select)||void 0===e||e.removeListener("start",m),Object.entries(p).forEach((function(e){var t=P(e,2),n=t[0],r=t[1];null==l||l.removeListener(n,r)}))}}var Ur=[{key:"qHyperCube/qDimensionInfo/0:numeric",includeMax:!1}];function _r(e){var t=e.chart,n=e.actions,r=e.selections,i=e.picassoQ,o=e.config,a=o.allowSimultaneous,l=void 0!==a&&a,u=o.majorScale,s=void 0===u?void 0:u,c=o.selectionActions,f=void 0===c?{}:c,h=f.clear,d=f.reset,p=o.selectionEvents,m=void 0===p?{deactivated:void 0,canceled:void 0,cleared:void 0,start:void 0}:p,g=o.brushEvents,v=void 0===g?{}:g,y=o.brushName,b=void 0===y?"selection":y,x=o.brushMaxListeners,w=void 0===x?20:x,M=o.brushRanges,q=void 0!==M&&M,C=o.interceptors,D=void 0===C?{}:C,k=o.selectionsFn,S=void 0===k?i.selections:k,I=t.brush(b);if("number"==typeof w&&I.setMaxListeners(w),q){var N=!0===q?Ur:q;I.configure({ranges:N})}var O={canSelect:!0,getIsSelectionLocked:!1,isInnerDimensionLocked:!1,lockedDimensions:[],singleSelectIndex:0,selectionInfo:{colorField:void 0,components:[],event:void 0,currentComponent:void 0,previousComponent:void 0}},T=function(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=t.selections,r=t.brush,i=t.majorScale,o=t.actions,a=t.selectionsFn,l=(arguments.length>1&&void 0!==arguments[1]?arguments[1]:{}).path,u=void 0===l?"/qHyperCubeDef":l;if(!n)return{layout:function(){},filteredFields:function(){},allowSimultaneous:function(){},release:function(){}};var s=++Or,c=null,f={dimensions:[],measures:[]},h=[],d={};n.on=n.on.bind(n),n.isActive=n.isActive.bind(n),n.addListener=n.addListener.bind(n),n.removeListener=n.removeListener.bind(n);var p=Mr({brush:r,getConfig:function(){return{layout:c,allowSimultaneous:h}}}),m=p.rangeInterceptor,g=p.interceptor;r.intercept("set-ranges",m),r.intercept("toggle-ranges",m),r.intercept("toggle-values",g),r.intercept("set-values",g),r.intercept("add-values",g),r.on("start",(function(){return n.begin(u)}));var v={activate:function(){},deactivated:function(){return r.end()},cleared:function(){return r.clear()},canceled:function(){return r.end()}};Lr(n,v);var y=null==i||null===(e=i.max)||void 0===e?void 0:e.call(i);return null!=o&&o.select?(o.select.on("start",(function(){var e;r.start(),"function"==typeof o.select.getBrushOptions&&(d=(e=o.select).getBrushOptions.apply(e,arguments))})),o.select.on("end",(function(){var e=a(r,d,c),t=Dr({layout:c,filtered:f});e.forEach((function(e){var r=Ir({selection:e,fieldMap:t});(function(e,t,n){if(t&&void 0!==n&&"selectHyperCubeContinuousRange"===e.method){var r=e.params;if(r&&r[1]&&r[1][0]){var i=r[1][0],o=i.qDimIx,a=i.qRange;"undefined"!==o&&a&&!1===a.qMaxInclEq&&a.qMax>=n&&(a.qMaxInclEq=!0)}}})(r,o.select.brushSelectionIncludeMax,y),n.select(r)}))}))):r.on("update",(function(){var e=a(r,d,c),t=Dr({layout:c,filtered:f});e.forEach((function(e){n.select(Ir({selection:e,fieldMap:t}))}))})),0===Nr.length&&Er(),Nr.push({key:s,selections:n}),{layout:function(e){c=e},filteredFields:function(e){f=e},allowSimultaneous:function(e){h=e},release:function(){c=null;var e=Nr.indexOf(Nr.filter((function(e){return e.key===s}))[0]);-1!==e&&Nr.splice(e,1),Nr.length||Ar(),Fr(n,v)}}}({brush:I,majorScale:s,actions:n,selections:r,picassoQ:i,selectionsFn:S});!function(e){var t=e.brush,n=e.interceptors,r=void 0===n?{}:n;Object.entries(r).forEach((function(e){var n=P(e,2),r=n[0],i=n[1];(Array.isArray(i)?i:[i]).forEach((function(e){t.intercept(r,e)}))}))}({brush:I,interceptors:D});var E=function(e){var t=e.chart,n=e.selectionActions,r=e.brush,i=e.actions,o=e.selectionInfo,a=e.selections,l=e.selectionEvents,u=function(e){var t=e.brush,n=e.chart,r=e.selectionInfo,i=e.brushEvents,o=void 0===i?{}:i,a=Object.entries(o).map((function(e){var i=P(e,2),o=i[0],a=i[1],l=function(){return a({chart:n,selectionInfo:r})};return t.on(o,l),[o,l]}));return function(){a.forEach((function(e){var n=P(e,2),r=n[0],i=n[1];t.removeListener(r,i)}))}}({brush:r,chart:t,selectionInfo:o,brushEvents:e.brushEvents}),s=Rr({chart:t,selectionInfo:o,selectionActions:n,actions:i,selections:a,selectionEvents:l}),c=function(e){var t=e.actions;if(null==t||!t.lasso)return function(){};var n=!1,r=function(e){n||e.key!==wr||(t.lasso.action(!0),n=!0)},i=function(e){e.key===wr&&(t.lasso.action(!1),n=!1)};return document.addEventListener("keydown",r),document.addEventListener("keyup",i),function(){document.removeEventListener("keydown",r),document.removeEventListener("keyup",i)}}({actions:i});return function(){u(),s(),c()}}({chart:t,brush:I,actions:n,selections:r,selectionInfo:O.selectionInfo,selectionActions:{clear:h,reset:d},selectionEvents:m,brushEvents:v});if(l){var A=!0===l?j(Array(15)).map((function(e,t){return"qHyperCube/qMeasureInfo/".concat(t)})):l;T.allowSimultaneous(A)}return{unbindEvents:E,state:O,picassoSelections:T,brush:I}}var zr=["colorField","useLegendCube"];function Vr(e){var t=e.chart,n=e.selections,r=e.actions,i=void 0!==r&&r,o=e.config,a=void 0===o?{}:o,l=_r({chart:t,actions:i,selections:n,picassoQ:vr,config:a}),u=l.unbindEvents,s=l.state,c=l.picassoSelections,f=l.brush,h=a.custom,d=void 0===h?{}:h,p=a.legendAlias,m=void 0===p?void 0:p,g=a.setBrushAliases,v=void 0===g?xr:g;return{getIsDimensionLocked:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;return s.lockedDimensions[e]},getIsSelectionLocked:function(){var e,t,r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];return null!==(e=null==n||null===(t=n.isLocked)||void 0===t?void 0:t.call(n))&&void 0!==e?e:br(r)},getIsSingleSelect:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:s.singleSelectIndex;return s.singleSelectDimensions[e]},getCanSelect:function(){return s.canSelect},getSelectionInfo:function(){return s.selectionInfo},setLayout:function(e){var t=function(e){var t,n,r,i=e.selections,o=e.picassoSelections,a=e.layout,l={lockedDimensions:[],singleSelectDimensions:[]};null!=i&&null!==(t=i.isModal)&&void 0!==t&&t.call(i)&&i.confirm(),o.layout(a);var u=(null!==(n=null==a?void 0:a.qHyperCube)&&void 0!==n?n:{}).qDimensionInfo,s=void 0===u?[]:u;return l.lockedDimensions=s.map((function(e){return!!e.qLocked})),l.singleSelectDimensions=s.map((function(e,t){return yr({layout:a,path:"qHyperCube/qDimensionInfo/".concat(t)})})),l.singleSelectIndex=function(e){var t,n=((null==e?void 0:e.qHyperCube)||{}).qDimensionInfo,r=void 0===n?[]:n;return null!==(t=r.map((function(e,t){var n;return!(e.qLocked||(null===(n=e.qCardinalities)||void 0===n?void 0:n.qHypercubeCardinal)<=1)&&t})).filter((function(e){return"number"==typeof e}))[0])&&void 0!==t?t:Math.max(r.length-1,0)}(a),l.canSelect=0===s.length||s.some((function(e){return!e.qLocked})),l.dimensionLocked=!(null===(r=s[0])||void 0===r||!r.qLocked),l}({selections:n,picassoSelections:c,layout:e});Object.assign(s,t)},setFilteredFields:function(e){c.filteredFields(e)},setBrushAliases:function(e){var t=e.colorField,n=e.useLegendCube,r=void 0!==n&&n,i=F(e,zr),o=N({useLegendCube:r,colorField:t,brush:f,legendAlias:m},i);v(N(N({},o),{},{defaultFunc:function(){return xr(o)}}))},destroy:function(){u(),c.release()},custom:N({},d)}}var Br="'Source Sans Pro', 'Arial', 'sans-serif'",Yr="#333333",Wr="#595959",Gr="#737373",Kr="#cccccc",Zr="#e6e6e6";function Jr(e){var t={};return[].concat(j(e),j([["","","color"],["object","","fontFamily"],["object","axis.label.name","color",Wr],["object","axis.label.name","fontFamily",Br],["object","axis.label.name","fontSize","12px"],["object","axis.line.major","color",Kr],["object","axis.line.minor","color",Zr],["object","axis.title","color"],["object","axis.title","fontFamily",Br],["object","axis.title","fontSize","13px"],["object","grid.line.highContrast","color",Zr],["object","grid.line.major","color",Kr],["object","grid.line.minor","color",Zr],["object","label.value","color",Wr],["object","label.value","fontFamily",Br],["object","label.value","fontSize","12px"],[!1,"label.value","darkColor",Wr],[!1,"label.value","lightColor",Zr],["object","outOfRange","color","#999"],["object","legend.title","color",Yr],["object","legend.title","fontFamily",Br],["object","legend.title","fontSize","15px"],["object","legend.label","color",Wr],["object","legend.label","fontFamily",Br],["object","legend.label","fontSize","13px"],["object","referenceLine.label.name","color",Yr],["object","referenceLine.label.name","fontFamily",Br],["object","referenceLine.label.name","fontSize","12px"],["object","referenceLine.outOfBounds","color",Zr],["object","referenceLine.outOfBounds","fontFamily",Br],["object","referenceLine.outOfBounds","fontSize","12px"],["object","referenceLine.outOfBounds","backgroundColor",Gr,function(e){return"transparent"===e?Gr: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 Xr=function(e){return e};function Qr(e){var t=e.theme,n=e.id,r=e.transform,i=e.extend,o=e.matrix,a={},l=r.reduce((function(e,t){var n=P(t,2),r=n[0],i=n[1];return e[r]=i,e}),{});return o.forEach((function(e){var r=P(e,5),i=r[0],o=r[1],u=r[2],s=r[3],c=r[4],f=void 0===c?function(e){return e}:c,h=function(e){var t=e.theme,n=e.base,r=e.path,i=e.attribute,o=e.defaultValue,a=void 0===o?void 0:o;if(!t||!1===n)return a;var l=t.getStyle(n,r,i);return void 0===l?a:l}({theme:t,base:"object"===i&&n?"".concat("object",".").concat(n):i,path:o,attribute:u,defaultValue:s}),d=(l["".concat(o,".").concat(u)]||Xr)(f(h));Tt(a,[o,u].filter(Boolean).join("."),d)})),i.forEach((function(e){var t=P(e,2),n=t[0],r=t[1];Tt(a,n,r)})),a}var ei=["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"],ti=["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 ni=function(e){return{value:e,label:e.charAt(0).toUpperCase()+e.slice(1),groupHeader:!1,disabled:!1,styles:{fontFamily:e}}};function ri(e){var t=e.theme,n=e.translator,r=e.defaultValue,i=e.flags,o=[],a=t.getStyle("","","fontFamilies");return Array.isArray(a)&&a.length?o.push.apply(o,j(new Set([r].concat(j(a.map((function(e){return e.split(",").map((function(e){return e.trim()})).map((function(e){return e.replace(/\s+/g," ").trim()})).filter(Boolean).join(", ")}))))))):o.push(r),[{value:"ThemeHeader",label:n.get("properties.themeFonts"),metaText:n.get("properties.theme"),groupHeader:!0}].concat(j(o.map((function(e){return ni(e)}))),[{value:"DefaultHeader",label:n.get("properties.allFonts"),metaText:n.get("properties.default"),groupHeader:!0}],j(function(e){return null!=e&&e.isEnabled("PS_20852_WYSIWYG_FONT_SUPPORT")?ti:ei}(i).map((function(e){return ni(e)}))))}function ii(e){var t=e.theme,n=e.translator,r=e.id,i=e.path,o=e.flags,a=function(){return t.getStyle(r,i,"fontFamily")};return{getDefaultValue:function(){return a()},getOptions:function(){return ri({theme:t,translator:n,defaultValue:a(),flags:o})}}}var oi=["10px","11px","12px","13px","14px","15px","16px","17px","18px","19px","20px","21px","22px","23px","24px"],ai=function(e){return{value:e,label:e,groupHeader:!1,disabled:!1}};function li(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,j(new Set([n].concat(j(i))))):r.push(n),[{value:"ThemeHeader",label:t.get("properties.themeFontSizes"),metaText:t.get("properties.theme"),groupHeader:!0}].concat(j(r.map((function(e){return ai(e)}))),[{value:"DefaultHeader",label:t.get("properties.allFontSizes"),metaText:t.get("properties.default"),groupHeader:!0}],j(oi.map((function(e){return ai(e)}))))}({theme:t,translator:n,defaultValue:o()})}}}function ui(e){var t=e.theme,n=e.translator,r=e.id,i=e.path;return{fontFamily:ii({theme:t,translator:n,id:r,path:i,flags:e.flags}),fontSize:li({theme:t,translator:n,id:r,path:i})}}function si(e,t,n){const r=`${e}.fontFamily`,i=`${e}.fontSize`;return{fontFamilyItem:{component:"dropdown",ref:r,options:()=>t.getOptions(r),defaultValue:()=>t.getDefaultValue(r)},fontWrapperItem:{component:"inline-wrapper",items:{fontSizeItem:{component:"dropdown",ref:i,options:()=>t.getOptions(i),defaultValue:()=>t.getDefaultValue(i)},fontColorItem:{component:"color-picker",width:!1,ref:`${e}.color`,defaultValue:()=>({color:n.getStyle("object.funnelChart",e,"color")})}}}}}function ci(e,t,n){const r=function(e){var t=e.theme,n=e.translator,r=e.config,i=void 0===r?{}:r,o=e.flags,a=function(e){var t=e.config,n=void 0===t?{}:t,r=n.id,i=n.paths;return{id:void 0===r?"object":"".concat("object",".").concat(r),paths:Array.isArray(i)?i:[]}}({config:i}),l=a.id,u=a.paths,s={};u.forEach((function(e){for(var r=e.split("."),i=s,a=0;a<r.length;a++){var u=r[a];a===r.length-1?i[u]=ui({theme:t,translator:n,id:l,path:e,flags:o}):void 0===i[u]&&(i[u]={}),i=i[u]}}));var c=function(e){for(var t=e.split("."),n=s,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 s.getDefaultValue=function(e){return c(e).getDefaultValue()},s.getOptions=function(e){return c(e).getOptions()},s}({theme:e,translator:n,flags:t,config:{id:"funnelChart",paths:["axis.title","axis.label.name","label.value"]}});return{component:"styling-panel",show:!0,chartType:"funnelchart",translation:"LayerStyleEditor.component.styling",chartTitle:"Object.FunnelChart",subtitle:"LayerStyleEditor.component.styling",useGeneral:!0,useBackground:!0,items:{axisTitleSection:{component:"panel-section",label:"Dimension title",items:{dimensionTitleItems:{component:"items",ref:"components",key:"axis",items:si("axis.title",r,e)}}},labelNameSection:{component:"panel-section",label:"Dimension value label",items:{dimensionTitleItems:{component:"items",ref:"components",key:"axis",items:si("axis.label.name",r,e)}}},labelValueSection:{component:"panel-section",label:"Value Label",items:{labelItems:{component:"items",ref:"components",key:"label",items:{...si("label.value",r,e),contrastColor:{component:"checkbox",type:"boolean",ref:"label.value.useContrastColor",translation:"properties.dataPoints.valuelabel.contrast",defaultValue:!0}}}}}}}}const fi={uses:"sorting"},hi=(e,t,n)=>{var r;const i=null==n||null===(r=n.sense)||void 0===r?void 0:r.theme;return{uses:"settings",items:{presentation:{type:"items",label:"Presentation",grouped:!0,items:{...(null==t?void 0:t.isEnabled("SENSECLIENT_IM_4897_VIZBUNDLE_STYLING"))&&{funnelStyling:ci(i,t,e)},funnelmode:{ref:"funnel.mode",label:"Funnel Mode",type:"string",component:"dropdown",options:[{value:"AREA",label:"Area"},{value:"HEIGHT",label:"Height"},{value:"WIDTH",label:"Width"},{value:"ORDER",label:"Ordering"}],defaultValue:"WIDTH"},dimensionTitle:{ref:"showDimensionTitle",type:"boolean",component:"switch",label:"Dimension title",defaultValue:!0,options:[{value:!0,label:"Auto"},{value:!1,label:"Off"}]},valuesAuto:{ref:"dataPoint.auto",type:"boolean",label:"Value labels",component:"switch",defaultValue:!0,options:[{value:!0,label:"Auto"},{value:!1,label:"Custom"}]},labelMode:{ref:"dataPoint.labelMode",type:"string",component:"dropdown",options:[{value:"none",label:"None"},{value:"share",label:"Share"},{value:"value",label:"Values"}],defaultValue:"share",show:e=>!e.dataPoint.auto}}},colorsAndLegend:{uses:"colorsAndLegend",translation:"Colors",items:{colors:{items:{colorByLabel:{show:!1},expressionLabel:{show:!1}}},legend:{show:!1}}}}}},di={uses:"data",items:{dimensions:{uses:"dimensions",items:{others:{items:{suppressOther:{defaultValue:!0,show:!1}}}},disabledRef:""},measures:{uses:"measures",disabledRef:""}}};function pi({translator:e,flags:t,anything:n}){return{type:"items",component:"accordion",items:{data:di,sorting:fi,settings:hi(e,t,n)}}}function mi(e){return{definition:pi(e),support:{export:!0,exportData:!0,snapshot:!0,viewData:!1},importProperties:null,exportProperties:null}}const gi=[{path:"/qHyperCubeDef",dimensions:{min:1,max:1,description:()=>"Segments"},measures:{min:1,max:1,description(e){switch(e.funnel.mode){case"WIDTH":return"Width";case"AREA":return"Area";case"HEIGHT":return"Height";case"ORDER":return"Order";default:return""}},added(e,t){2===t.qHyperCubeDef.qInterColumnSortOrder.length&&1!==t.qHyperCubeDef.qInterColumnSortOrder[0]&&(t.qHyperCubeDef.qInterColumnSortOrder=[1,0])}}}];function vi(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var yi=Object.prototype.hasOwnProperty,bi=Object.prototype.toString,xi=Object.defineProperty,wi=Object.getOwnPropertyDescriptor,Mi=function(e){return"function"==typeof Array.isArray?Array.isArray(e):"[object Array]"===bi.call(e)},qi=function(e){if(!e||"[object Object]"!==bi.call(e))return!1;var t,n=yi.call(e,"constructor"),r=e.constructor&&e.constructor.prototype&&yi.call(e.constructor.prototype,"isPrototypeOf");if(e.constructor&&!n&&!r)return!1;for(t in e);return void 0===t||yi.call(e,t)},Ci=function(e,t){xi&&"__proto__"===t.name?xi(e,t.name,{enumerable:!0,configurable:!0,value:t.newValue,writable:!0}):e[t.name]=t.newValue},Di=function(e,t){if("__proto__"===t){if(!yi.call(e,t))return;if(wi)return wi(e,t).value}return e[t]},ki=function e(){var t,n,r,i,o,a,l=arguments[0],u=1,s=arguments.length,c=!1;for("boolean"==typeof l&&(c=l,l=arguments[1]||{},u=2),(null==l||"object"!=typeof l&&"function"!=typeof l)&&(l={});u<s;++u)if(null!=(t=arguments[u]))for(n in t)r=Di(l,n),l!==(i=Di(t,n))&&(c&&i&&(qi(i)||(o=Mi(i)))?(o?(o=!1,a=r&&Mi(r)?r:[]):a=r&&qi(r)?r:{},Ci(l,{name:n,newValue:e(c,a,i)})):void 0!==i&&Ci(l,{name:n,newValue:i}));return l},Si=vi(ki),Ii={dataRelatedPropertiesPaths:["qHyperCube.qGrandTotalRow","qHyperCube.qHasOtherValues","qHyperCube.qSize","qHyperCube.qDimensionInfo[].qAttrDimInfo","qHyperCube.qDimensionInfo[].qCardinalities","qHyperCube.qDimensionInfo[].qMax","qHyperCube.qDimensionInfo[].qMin","qHyperCube.qDimensionInfo[].qStateCounts","qHyperCube.qMeasureInfo[].qApprMaxGlyphCount","qHyperCube.qMeasureInfo[].qAttrExprInfo","qHyperCube.qMeasureInfo[].qMax","qHyperCube.qMeasureInfo[].qMin","qHyperCube.qMeasureInfo[].qTrendLines","qHyperCube.qTreeNodesOnDim","qSelectionInfo"]};function Ni(e){const{qHyperCube:t,...n}=e,{qAxisData:r,qDataPages:i,qStackedDataPages:o,qTreeDataPages:a,...l}=t,u=Si(!0,{},{...n,qHyperCube:{...l,qAxisData:null,qDataPages:null,qStackedDataPages:null,qTreeDataPages:null}}),{dataRelatedPropertiesPaths:s}=Ii;return s.forEach((e=>{const t=e.split("[");if(1===t.length)void 0!==Nt(u,e)&&Tt(u,e,null);else{const e=t[0],n=t[1].split("].")[1];Nt(u,e,[]).forEach((e=>{void 0!==Nt(e,n)&&Tt(e,n,null)}))}})),u}var Oi={axes:{trackBy:function({isTime:e,isContinuous:t,isMeasure:n,isMajor:r}){return i=>{if(e||t||n){var o;if("line"===i.type)return null!==(o=i.tickValue)&&void 0!==o?o:"axis";if("text"===i.type)return`${i.tickValue} ${i.text}`;if("container"===i.type){const e=i.children.filter((e=>"text"===e.type)).map((e=>e.text));return`${i.data.value} ${e.join("")}`}return Math.random()}if(r){if("line"===i.type&&void 0===i.tickValue)return"axis";const e=i.transform&&i.transform.match(/rotate/gi)?"rotated":"horizontal";return`${i.data.group?`${i.data.group.value} `:""}${i.data.value} ${i.text} ${e}`}return Math.random()}},compensateForLayoutChanges:function({isMeasure:e,isTime:t,isContinuous:n,isHorizontal:r,dock:i}){return({currentNodes:o,currentRect:a,previousRect:l})=>{const u=a.x-l.x,s=a.y-l.y,c=a.width-l.width,f=a.height-l.height;e?("left"===i&&o.forEach((e=>{"line"===e.type?(e.x1+=c,e.x2+=c):"text"===e.type&&(e.x+=c)})),"left"!==i&&"right"!==i||o.forEach((e=>{var t;("line"===e.type&&(e.x1===e.x2?(e.y1=a.y,e.y2=e.y1+a.height):(Math.round(e.y1)<a.y||e.y1>a.y+a.height)&&(e.strokeWidth=0)),"text"===e.type)&&((e.y<a.y||e.y>a.y+a.height)&&(e.fontSize="1px","#"===(null===(t=e.fill)||void 0===t?void 0:t[0])&&(e.fill=`${e.fill.slice(0,1)}00${e.fill.slice(1)}`)))})),"top"!==i&&"bottom"!==i||o.forEach((e=>{var t;("line"===e.type&&(e.y1===e.y2?(e.x1=a.x,e.x2=e.x1+a.width):(Math.round(e.x1)<a.x||e.x1>a.x+a.width)&&(e.strokeWidth=0)),"text"===e.type)&&((e.x<a.x||e.x>a.x+a.width)&&(e.fontSize="1px","#"===(null===(t=e.fill)||void 0===t?void 0:t[0])&&(e.fill=`${e.fill.slice(0,1)}00${e.fill.slice(1)}`)))}))):t?o.forEach((e=>{"line"===e.type?e.y1===e.y2?e.x2+=c:e.x1===e.x2&&(e.x1-=u,e.x2-=u):"text"===e.type&&(e.x-=u)})):n||r?o.forEach((e=>{"line"===e.type&&e.y1===e.y2&&(e.x1+=u,e.x2+=u+c)})):o.forEach((e=>{"line"===e.type&&e.x1===e.x2&&(e.y1+=s,e.y2+=s+f)}))}}},bars:{trackBy:function(e){return e.data.measureIndex?`${e.data.value} ${e.data.measureIndex.value}`:e.data.group?`${e.data.value} ${e.data.group.value}`:e.data.stack?`${e.data.value} ${e.data.stack.value}`:`${e.data.value}`},compensateForLayoutChanges:function({currentNodes:e,currentRect:t,previousRect:n}){const r=t.x-n.x,i=t.y-n.y;0===r&&0===i||e.forEach((e=>{e.children&&e.children.length>0&&e.children.forEach((e=>{void 0!==e.x&&void 0!==e.y?(e.x-=r,e.y-=i):e.transform=`translate(${-r}, ${-i})`}))}))}},barOobs:{compensateForLayoutChanges:function({currentNodes:e,currentRect:t,previousRect:n}){const r=t.x-n.x;0===t.y-n.y&&0===r||e.forEach((e=>{e.children&&e.children.length>0&&e.children.forEach((e=>{e.opacity=0}))}))}},labels:{trackBy:function(e){if("rect"===e.type)return"-3"===e.data?Math.random():`${e.type} ${e.data} ${e.rotation}`;const t=e.transform&&e.transform.match(/rotate/gi)?"rotated":"horizontal";return`${e.type} ${e.data} ${e.text} ${t}`},compensateForLayoutChanges:function({currentNodes:e,currentRect:t,previousRect:n}){const r=t.x-n.x,i=t.y-n.y;0===r&&0===i||e.forEach((e=>{e.transform&&e.transform.match(/rotate\(-90/gi)?(e.x+=i,e.y-=r):(e.x-=r,e.y-=i)}))},linkData:function(e){return e.data.measureIndex?`${e.data.value} ${e.data.measureIndex.value}`:e.data.group?`${e.data.value} ${e.data.group.value}`:e.data.stack?`${e.data.value} ${e.data.stack.value}`:`${e.data.value}`}},lines:{trackBy:function(e){var t;return"line"===e.type?null!==(t=e.value)&&void 0!==t?t:Math.random():"path"===e.type?`${e.generatorType} ${e.layerObj.id} ${e.data.source.key}`:Math.random()},compensateForLayoutChanges:function({currentNodes:e,currentRect:t,previousRect:n}){const r=t.x-n.x,i=t.y-n.y;e.forEach((e=>{if(void 0!==e.x1&&void 0!==e.y1)e.y1===e.y2?(e.x2=e.x1+t.width,e.y1-=i,e.y2-=i):e.x1===e.x2&&(e.y2=e.y1+t.height,e.x1-=r,e.x2-=r);else{const t="x"===e.major.p?r/e.major.size:i/e.major.size,n="y"===e.minor.p?i/e.minor.size:r/e.minor.size;e.points.forEach((e=>{e.modified||(e.major-=t,e.minor-=n,e.minor0-=n,e.modified=!0)}))}}))}},lineOobs:{compensateForLayoutChanges:function({currentNodes:e,currentRect:t,previousRect:n}){const r=t.x-n.x;0===t.y-n.y&&0===r||e.forEach((e=>{e.opacity=0}))}},points:{trackBy:function(e){return e.data.line?`${e.data.line.value} ${e.data.major.value}`:`${e.data.major.value}`},compensateForLayoutChanges:function({currentNodes:e,currentRect:t,previousRect:n}){const r=t.x-n.x,i=t.y-n.y;0===r&&0===i||e.forEach((e=>{e.cx-=r,e.cy-=i}))}},refLineLabels:{trackBy:function(e){if(void 0!==e.value){if("rect"===e.type)return`${e.value}`;if("text"===e.type)return`${e.value} ${e.text}`}return Math.random()},compensateForLayoutChanges:function({currentNodes:e,currentRect:t,previousRect:n}){const r=t.x-n.x,i=t.y-n.y,o=t.width-n.width,a=t.height-n.height;let l=-r,u=-i;e.forEach((e=>{switch(e.dock){case"right":r>0&&(l=t.width);break;case"left":o<0&&(l=-n.width);break;case"top":a<0&&(u=-n.height);break;case"bottom":i>0&&(u=t.height)}switch(e.type){case"text":case"rect":e.x+=l,e.y+=u;break;case"circle":e.cx+=l,e.cy+=u;break;case"path":e.transform=`translate(${l}, ${u})`}}))}},shadowBars:{trackBy:function(){return Math.random()}},cacheProperties:function({viewCache:e,layout:t}){const n=Ni(t);e.set("dataIndependentProperties",JSON.stringify(n))},propertiesHaveChanged:function({viewCache:e,layout:t}){const n=Ni(t);return e.get("dataIndependentProperties")!==JSON.stringify(n)},nonUpdatingNode:{trackBy:function(){return Math.random()}}};function Ti(e,t,n){e.prototype=t.prototype=n,n.constructor=e}function Ei(e,t){var n=Object.create(e.prototype);for(var r in t)n[r]=t[r];return n}function Ai(){}var Li=.7,Fi=1/Li,Pi="\\s*([+-]?\\d+)\\s*",ji="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",$i="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",Hi=/^#([0-9a-f]{3,8})$/,Ri=new RegExp(`^rgb\\(${Pi},${Pi},${Pi}\\)$`),Ui=new RegExp(`^rgb\\(${$i},${$i},${$i}\\)$`),_i=new RegExp(`^rgba\\(${Pi},${Pi},${Pi},${ji}\\)$`),zi=new RegExp(`^rgba\\(${$i},${$i},${$i},${ji}\\)$`),Vi=new RegExp(`^hsl\\(${ji},${$i},${$i}\\)$`),Bi=new RegExp(`^hsla\\(${ji},${$i},${$i},${ji}\\)$`),Yi={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 Wi(){return this.rgb().formatHex()}function Gi(){return this.rgb().formatRgb()}function Ki(e){var t,n;return e=(e+"").trim().toLowerCase(),(t=Hi.exec(e))?(n=t[1].length,t=parseInt(t[1],16),6===n?Zi(t):3===n?new Qi(t>>8&15|t>>4&240,t>>4&15|240&t,(15&t)<<4|15&t,1):8===n?Ji(t>>24&255,t>>16&255,t>>8&255,(255&t)/255):4===n?Ji(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=Ri.exec(e))?new Qi(t[1],t[2],t[3],1):(t=Ui.exec(e))?new Qi(255*t[1]/100,255*t[2]/100,255*t[3]/100,1):(t=_i.exec(e))?Ji(t[1],t[2],t[3],t[4]):(t=zi.exec(e))?Ji(255*t[1]/100,255*t[2]/100,255*t[3]/100,t[4]):(t=Vi.exec(e))?oo(t[1],t[2]/100,t[3]/100,1):(t=Bi.exec(e))?oo(t[1],t[2]/100,t[3]/100,t[4]):Yi.hasOwnProperty(e)?Zi(Yi[e]):"transparent"===e?new Qi(NaN,NaN,NaN,0):null}function Zi(e){return new Qi(e>>16&255,e>>8&255,255&e,1)}function Ji(e,t,n,r){return r<=0&&(e=t=n=NaN),new Qi(e,t,n,r)}function Xi(e){return e instanceof Ai||(e=Ki(e)),e?new Qi((e=e.rgb()).r,e.g,e.b,e.opacity):new Qi}function Qi(e,t,n,r){this.r=+e,this.g=+t,this.b=+n,this.opacity=+r}function eo(){return`#${io(this.r)}${io(this.g)}${io(this.b)}`}function to(){const e=no(this.opacity);return`${1===e?"rgb(":"rgba("}${ro(this.r)}, ${ro(this.g)}, ${ro(this.b)}${1===e?")":`, ${e})`}`}function no(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function ro(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function io(e){return((e=ro(e))<16?"0":"")+e.toString(16)}function oo(e,t,n,r){return r<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new lo(e,t,n,r)}function ao(e){if(e instanceof lo)return new lo(e.h,e.s,e.l,e.opacity);if(e instanceof Ai||(e=Ki(e)),!e)return new lo;if(e instanceof lo)return e;var t=(e=e.rgb()).r/255,n=e.g/255,r=e.b/255,i=Math.min(t,n,r),o=Math.max(t,n,r),a=NaN,l=o-i,u=(o+i)/2;return l?(a=t===o?(n-r)/l+6*(n<r):n===o?(r-t)/l+2:(t-n)/l+4,l/=u<.5?o+i:2-o-i,a*=60):l=u>0&&u<1?0:a,new lo(a,l,u,e.opacity)}function lo(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}function uo(e){return(e=(e||0)%360)<0?e+360:e}function so(e){return Math.max(0,Math.min(1,e||0))}function co(e,t,n){return 255*(e<60?t+(n-t)*e/60:e<180?n:e<240?t+(n-t)*(240-e)/60:t)}Ti(Ai,Ki,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:Wi,formatHex:Wi,formatHex8:function(){return this.rgb().formatHex8()},formatHsl:function(){return ao(this).formatHsl()},formatRgb:Gi,toString:Gi}),Ti(Qi,(function(e,t,n,r){return 1===arguments.length?Xi(e):new Qi(e,t,n,null==r?1:r)}),Ei(Ai,{brighter(e){return e=null==e?Fi:Math.pow(Fi,e),new Qi(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=null==e?Li:Math.pow(Li,e),new Qi(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new Qi(ro(this.r),ro(this.g),ro(this.b),no(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:eo,formatHex:eo,formatHex8:function(){return`#${io(this.r)}${io(this.g)}${io(this.b)}${io(255*(isNaN(this.opacity)?1:this.opacity))}`},formatRgb:to,toString:to})),Ti(lo,(function(e,t,n,r){return 1===arguments.length?ao(e):new lo(e,t,n,null==r?1:r)}),Ei(Ai,{brighter(e){return e=null==e?Fi:Math.pow(Fi,e),new lo(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=null==e?Li:Math.pow(Li,e),new lo(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 Qi(co(e>=240?e-240:e+120,i,r),co(e,i,r),co(e<120?e+240:e-120,i,r),this.opacity)},clamp(){return new lo(uo(this.h),so(this.s),so(this.l),no(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=no(this.opacity);return`${1===e?"hsl(":"hsla("}${uo(this.h)}, ${100*so(this.s)}%, ${100*so(this.l)}%${1===e?")":`, ${e})`}`}}));const fo=Math.PI/180,ho=180/Math.PI,po=.96422,mo=1,go=.82521,vo=4/29,yo=6/29,bo=3*yo*yo,xo=yo*yo*yo;function wo(e){if(e instanceof Mo)return new Mo(e.l,e.a,e.b,e.opacity);if(e instanceof Io)return No(e);e instanceof Qi||(e=Xi(e));var t,n,r=ko(e.r),i=ko(e.g),o=ko(e.b),a=qo((.2225045*r+.7168786*i+.0606169*o)/mo);return r===i&&i===o?t=n=a:(t=qo((.4360747*r+.3850649*i+.1430804*o)/po),n=qo((.0139322*r+.0971045*i+.7141733*o)/go)),new Mo(116*a-16,500*(t-a),200*(a-n),e.opacity)}function Mo(e,t,n,r){this.l=+e,this.a=+t,this.b=+n,this.opacity=+r}function qo(e){return e>xo?Math.pow(e,1/3):e/bo+vo}function Co(e){return e>yo?e*e*e:bo*(e-vo)}function Do(e){return 255*(e<=.0031308?12.92*e:1.055*Math.pow(e,1/2.4)-.055)}function ko(e){return(e/=255)<=.04045?e/12.92:Math.pow((e+.055)/1.055,2.4)}function So(e,t,n,r){return 1===arguments.length?function(e){if(e instanceof Io)return new Io(e.h,e.c,e.l,e.opacity);if(e instanceof Mo||(e=wo(e)),0===e.a&&0===e.b)return new Io(NaN,0<e.l&&e.l<100?0:NaN,e.l,e.opacity);var t=Math.atan2(e.b,e.a)*ho;return new Io(t<0?t+360:t,Math.sqrt(e.a*e.a+e.b*e.b),e.l,e.opacity)}(e):new Io(e,t,n,null==r?1:r)}function Io(e,t,n,r){this.h=+e,this.c=+t,this.l=+n,this.opacity=+r}function No(e){if(isNaN(e.h))return new Mo(e.l,0,0,e.opacity);var t=e.h*fo;return new Mo(e.l,Math.cos(t)*e.c,Math.sin(t)*e.c,e.opacity)}Ti(Mo,(function(e,t,n,r){return 1===arguments.length?wo(e):new Mo(e,t,n,null==r?1:r)}),Ei(Ai,{brighter(e){return new Mo(this.l+18*(null==e?1:e),this.a,this.b,this.opacity)},darker(e){return new Mo(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 Qi(Do(3.1338561*(t=po*Co(t))-1.6168667*(e=mo*Co(e))-.4906146*(n=go*Co(n))),Do(-.9787684*t+1.9161415*e+.033454*n),Do(.0719453*t-.2289914*e+1.4052427*n),this.opacity)}})),Ti(Io,So,Ei(Ai,{brighter(e){return new Io(this.h,this.c,this.l+18*(null==e?1:e),this.opacity)},darker(e){return new Io(this.h,this.c,this.l-18*(null==e?1:e),this.opacity)},rgb(){return No(this).rgb()}}));var Oo,To={isDark:function(e){return So(e).l<70}};function Eo(e,t){return e<t?-1:e>t?1:e>=t?0:NaN}1===(Oo=Eo).length&&(Oo=function(e){return function(t,n){return Eo(e(t),n)}}(Oo));var Ao="$";function Lo(){}function Fo(e,t){var n=new Lo;if(e instanceof Lo)e.each((function(e,t){n.set(t,e)}));else if(Array.isArray(e)){var r,i=-1,o=e.length;if(null==t)for(;++i<o;)n.set(i,e[i]);else for(;++i<o;)n.set(t(r=e[i],i,e),r)}else if(e)for(var a in e)n.set(a,e[a]);return n}function Po(){}Lo.prototype=Fo.prototype={constructor:Lo,has:function(e){return Ao+e in this},get:function(e){return this[Ao+e]},set:function(e,t){return this[Ao+e]=t,this},remove:function(e){var t=Ao+e;return t in this&&delete this[t]},clear:function(){for(var e in this)e[0]===Ao&&delete this[e]},keys:function(){var e=[];for(var t in this)t[0]===Ao&&e.push(t.slice(1));return e},values:function(){var e=[];for(var t in this)t[0]===Ao&&e.push(this[t]);return e},entries:function(){var e=[];for(var t in this)t[0]===Ao&&e.push({key:t.slice(1),value:this[t]});return e},size:function(){var e=0;for(var t in this)t[0]===Ao&&++e;return e},empty:function(){for(var e in this)if(e[0]===Ao)return!1;return!0},each:function(e){for(var t in this)t[0]===Ao&&e(this[t],t.slice(1),this)}};var jo=Fo.prototype;function $o(e,t,n){e.prototype=t.prototype=n,n.constructor=e}function Ho(e,t){var n=Object.create(e.prototype);for(var r in t)n[r]=t[r];return n}function Ro(){}Po.prototype={constructor:Po,has:jo.has,add:function(e){return this[Ao+(e+="")]=e,this},remove:jo.remove,clear:jo.clear,values:jo.keys,size:jo.size,empty:jo.empty,each:jo.each};var Uo=.7,_o=1/Uo,zo="\\s*([+-]?\\d+)\\s*",Vo="\\s*([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)\\s*",Bo="\\s*([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)%\\s*",Yo=/^#([0-9a-f]{3})$/,Wo=/^#([0-9a-f]{6})$/,Go=new RegExp("^rgb\\("+[zo,zo,zo]+"\\)$"),Ko=new RegExp("^rgb\\("+[Bo,Bo,Bo]+"\\)$"),Zo=new RegExp("^rgba\\("+[zo,zo,zo,Vo]+"\\)$"),Jo=new RegExp("^rgba\\("+[Bo,Bo,Bo,Vo]+"\\)$"),Xo=new RegExp("^hsl\\("+[Vo,Bo,Bo]+"\\)$"),Qo=new RegExp("^hsla\\("+[Vo,Bo,Bo,Vo]+"\\)$"),ea={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 ta(e){var t;return e=(e+"").trim().toLowerCase(),(t=Yo.exec(e))?new aa((t=parseInt(t[1],16))>>8&15|t>>4&240,t>>4&15|240&t,(15&t)<<4|15&t,1):(t=Wo.exec(e))?na(parseInt(t[1],16)):(t=Go.exec(e))?new aa(t[1],t[2],t[3],1):(t=Ko.exec(e))?new aa(255*t[1]/100,255*t[2]/100,255*t[3]/100,1):(t=Zo.exec(e))?ra(t[1],t[2],t[3],t[4]):(t=Jo.exec(e))?ra(255*t[1]/100,255*t[2]/100,255*t[3]/100,t[4]):(t=Xo.exec(e))?ua(t[1],t[2]/100,t[3]/100,1):(t=Qo.exec(e))?ua(t[1],t[2]/100,t[3]/100,t[4]):ea.hasOwnProperty(e)?na(ea[e]):"transparent"===e?new aa(NaN,NaN,NaN,0):null}function na(e){return new aa(e>>16&255,e>>8&255,255&e,1)}function ra(e,t,n,r){return r<=0&&(e=t=n=NaN),new aa(e,t,n,r)}function ia(e){return e instanceof Ro||(e=ta(e)),e?new aa((e=e.rgb()).r,e.g,e.b,e.opacity):new aa}function oa(e,t,n,r){return 1===arguments.length?ia(e):new aa(e,t,n,null==r?1:r)}function aa(e,t,n,r){this.r=+e,this.g=+t,this.b=+n,this.opacity=+r}function la(e){return((e=Math.max(0,Math.min(255,Math.round(e)||0)))<16?"0":"")+e.toString(16)}function ua(e,t,n,r){return r<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new sa(e,t,n,r)}function sa(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}function ca(e,t,n){return 255*(e<60?t+(n-t)*e/60:e<180?n:e<240?t+(n-t)*(240-e)/60:t)}$o(Ro,ta,{displayable:function(){return this.rgb().displayable()},hex:function(){return this.rgb().hex()},toString:function(){return this.rgb()+""}}),$o(aa,oa,Ho(Ro,{brighter:function(e){return e=null==e?_o:Math.pow(_o,e),new aa(this.r*e,this.g*e,this.b*e,this.opacity)},darker:function(e){return e=null==e?Uo:Math.pow(Uo,e),new aa(this.r*e,this.g*e,this.b*e,this.opacity)},rgb:function(){return this},displayable:function(){return 0<=this.r&&this.r<=255&&0<=this.g&&this.g<=255&&0<=this.b&&this.b<=255&&0<=this.opacity&&this.opacity<=1},hex:function(){return"#"+la(this.r)+la(this.g)+la(this.b)},toString:function(){var e=this.opacity;return(1===(e=isNaN(e)?1:Math.max(0,Math.min(1,e)))?"rgb(":"rgba(")+Math.max(0,Math.min(255,Math.round(this.r)||0))+", "+Math.max(0,Math.min(255,Math.round(this.g)||0))+", "+Math.max(0,Math.min(255,Math.round(this.b)||0))+(1===e?")":", "+e+")")}})),$o(sa,(function(e,t,n,r){return 1===arguments.length?function(e){if(e instanceof sa)return new sa(e.h,e.s,e.l,e.opacity);if(e instanceof Ro||(e=ta(e)),!e)return new sa;if(e instanceof sa)return e;var t=(e=e.rgb()).r/255,n=e.g/255,r=e.b/255,i=Math.min(t,n,r),o=Math.max(t,n,r),a=NaN,l=o-i,u=(o+i)/2;return l?(a=t===o?(n-r)/l+6*(n<r):n===o?(r-t)/l+2:(t-n)/l+4,l/=u<.5?o+i:2-o-i,a*=60):l=u>0&&u<1?0:a,new sa(a,l,u,e.opacity)}(e):new sa(e,t,n,null==r?1:r)}),Ho(Ro,{brighter:function(e){return e=null==e?_o:Math.pow(_o,e),new sa(this.h,this.s,this.l*e,this.opacity)},darker:function(e){return e=null==e?Uo:Math.pow(Uo,e),new sa(this.h,this.s,this.l*e,this.opacity)},rgb:function(){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 aa(ca(e>=240?e-240:e+120,i,r),ca(e,i,r),ca(e<120?e+240:e-120,i,r),this.opacity)},displayable:function(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1}}));var fa=Math.PI/180,ha=180/Math.PI,da=.96422,pa=1,ma=.82521,ga=4/29,va=6/29,ya=3*va*va,ba=va*va*va;function xa(e){if(e instanceof wa)return new wa(e.l,e.a,e.b,e.opacity);if(e instanceof ka){if(isNaN(e.h))return new wa(e.l,0,0,e.opacity);var t=e.h*fa;return new wa(e.l,Math.cos(t)*e.c,Math.sin(t)*e.c,e.opacity)}e instanceof aa||(e=ia(e));var n,r,i=Da(e.r),o=Da(e.g),a=Da(e.b),l=Ma((.2225045*i+.7168786*o+.0606169*a)/pa);return i===o&&o===a?n=r=l:(n=Ma((.4360747*i+.3850649*o+.1430804*a)/da),r=Ma((.0139322*i+.0971045*o+.7141733*a)/ma)),new wa(116*l-16,500*(n-l),200*(l-r),e.opacity)}function wa(e,t,n,r){this.l=+e,this.a=+t,this.b=+n,this.opacity=+r}function Ma(e){return e>ba?Math.pow(e,1/3):e/ya+ga}function qa(e){return e>va?e*e*e:ya*(e-ga)}function Ca(e){return 255*(e<=.0031308?12.92*e:1.055*Math.pow(e,1/2.4)-.055)}function Da(e){return(e/=255)<=.04045?e/12.92:Math.pow((e+.055)/1.055,2.4)}function ka(e,t,n,r){this.h=+e,this.c=+t,this.l=+n,this.opacity=+r}$o(wa,(function(e,t,n,r){return 1===arguments.length?xa(e):new wa(e,t,n,null==r?1:r)}),Ho(Ro,{brighter:function(e){return new wa(this.l+18*(null==e?1:e),this.a,this.b,this.opacity)},darker:function(e){return new wa(this.l-18*(null==e?1:e),this.a,this.b,this.opacity)},rgb:function(){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 aa(Ca(3.1338561*(t=da*qa(t))-1.6168667*(e=pa*qa(e))-.4906146*(n=ma*qa(n))),Ca(-.9787684*t+1.9161415*e+.033454*n),Ca(.0719453*t-.2289914*e+1.4052427*n),this.opacity)}})),$o(ka,(function(e,t,n,r){return 1===arguments.length?function(e){if(e instanceof ka)return new ka(e.h,e.c,e.l,e.opacity);if(e instanceof wa||(e=xa(e)),0===e.a&&0===e.b)return new ka(NaN,0,e.l,e.opacity);var t=Math.atan2(e.b,e.a)*ha;return new ka(t<0?t+360:t,Math.sqrt(e.a*e.a+e.b*e.b),e.l,e.opacity)}(e):new ka(e,t,n,null==r?1:r)}),Ho(Ro,{brighter:function(e){return new ka(this.h,this.c,this.l+18*(null==e?1:e),this.opacity)},darker:function(e){return new ka(this.h,this.c,this.l-18*(null==e?1:e),this.opacity)},rgb:function(){return xa(this).rgb()}}));var Sa=-.14861,Ia=1.78277,Na=-.29227,Oa=-.90649,Ta=1.97294,Ea=Ta*Oa,Aa=Ta*Ia,La=Ia*Na-Oa*Sa;function Fa(e,t,n,r){return 1===arguments.length?function(e){if(e instanceof Pa)return new Pa(e.h,e.s,e.l,e.opacity);e instanceof aa||(e=ia(e));var t=e.r/255,n=e.g/255,r=e.b/255,i=(La*r+Ea*t-Aa*n)/(La+Ea-Aa),o=r-i,a=(Ta*(n-i)-Na*o)/Oa,l=Math.sqrt(a*a+o*o)/(Ta*i*(1-i)),u=l?Math.atan2(a,o)*ha-120:NaN;return new Pa(u<0?u+360:u,l,i,e.opacity)}(e):new Pa(e,t,n,null==r?1:r)}function Pa(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}function ja(e){return function(){return e}}function $a(e,t){return function(n){return e+n*t}}function Ha(e){return 1==(e=+e)?Ra: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):ja(isNaN(t)?n:t)}}function Ra(e,t){var n=t-e;return n?$a(e,n):ja(isNaN(e)?t:e)}function Ua(e){return function t(n){function r(t,r){var i=e((t=Fa(t)).h,(r=Fa(r)).h),o=Ra(t.s,r.s),a=Ra(t.l,r.l),l=Ra(t.opacity,r.opacity);return function(e){return t.h=i(e),t.s=o(e),t.l=a(Math.pow(e,n)),t.opacity=l(e),t+""}}return n=+n,r.gamma=t,r}(1)}function _a(e,t){if((n=(e=t?e.toExponential(t-1):e.toExponential()).indexOf("e"))<0)return null;var n,r=e.slice(0,n);return[r.length>1?r[0]+r.slice(2):r,+e.slice(n+1)]}$o(Pa,Fa,Ho(Ro,{brighter:function(e){return e=null==e?_o:Math.pow(_o,e),new Pa(this.h,this.s,this.l*e,this.opacity)},darker:function(e){return e=null==e?Uo:Math.pow(Uo,e),new Pa(this.h,this.s,this.l*e,this.opacity)},rgb:function(){var e=isNaN(this.h)?0:(this.h+120)*fa,t=+this.l,n=isNaN(this.s)?0:this.s*t*(1-t),r=Math.cos(e),i=Math.sin(e);return new aa(255*(t+n*(Sa*r+Ia*i)),255*(t+n*(Na*r+Oa*i)),255*(t+n*(Ta*r)),this.opacity)}})),function e(t){var n=Ha(t);function r(e,t){var r=n((e=oa(e)).r,(t=oa(t)).r),i=n(e.g,t.g),o=n(e.b,t.b),a=Ra(e.opacity,t.opacity);return function(t){return e.r=r(t),e.g=i(t),e.b=o(t),e.opacity=a(t),e+""}}return r.gamma=e,r}(1),Ua((function(e,t){var n=t-e;return n?$a(e,n>180||n<-180?n-360*Math.round(n/360):n):ja(isNaN(e)?t:e)})),Ua(Ra);var za,Va=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function Ba(e){return new Ya(e)}function Ya(e){if(!(t=Va.exec(e)))throw new Error("invalid format: "+e);var t;this.fill=t[1]||" ",this.align=t[2]||">",this.sign=t[3]||"-",this.symbol=t[4]||"",this.zero=!!t[5],this.width=t[6]&&+t[6],this.comma=!!t[7],this.precision=t[8]&&+t[8].slice(1),this.trim=!!t[9],this.type=t[10]||""}function Wa(e,t){var n=_a(e,t);if(!n)return e+"";var r=n[0],i=n[1];return i<0?"0."+new Array(-i).join("0")+r:r.length>i+1?r.slice(0,i+1)+"."+r.slice(i+1):r+new Array(i-r.length+2).join("0")}Ba.prototype=Ya.prototype,Ya.prototype.toString=function(){return this.fill+this.align+this.sign+this.symbol+(this.zero?"0":"")+(null==this.width?"":Math.max(1,0|this.width))+(this.comma?",":"")+(null==this.precision?"":"."+Math.max(0,0|this.precision))+(this.trim?"~":"")+this.type};var Ga={"%":function(e,t){return(100*e).toFixed(t)},b:function(e){return Math.round(e).toString(2)},c:function(e){return e+""},d:function(e){return Math.round(e).toString(10)},e:function(e,t){return e.toExponential(t)},f:function(e,t){return e.toFixed(t)},g:function(e,t){return e.toPrecision(t)},o:function(e){return Math.round(e).toString(8)},p:function(e,t){return Wa(100*e,t)},r:Wa,s:function(e,t){var n=_a(e,t);if(!n)return e+"";var r=n[0],i=n[1],o=i-(za=3*Math.max(-8,Math.min(8,Math.floor(i/3))))+1,a=r.length;return o===a?r:o>a?r+new Array(o-a+1).join("0"):o>0?r.slice(0,o)+"."+r.slice(o):"0."+new Array(1-o).join("0")+_a(e,Math.max(0,t+o-1))[0]},X:function(e){return Math.round(e).toString(16).toUpperCase()},x:function(e){return Math.round(e).toString(16)}};function Ka(e){return e}var Za,Ja=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function Xa(e){var t,n,r=e.grouping&&e.thousands?(t=e.grouping,n=e.thousands,function(e,r){for(var i=e.length,o=[],a=0,l=t[0],u=0;i>0&&l>0&&(u+l+1>r&&(l=Math.max(1,r-u)),o.push(e.substring(i-=l,i+l)),!((u+=l+1)>r));)l=t[a=(a+1)%t.length];return o.reverse().join(n)}):Ka,i=e.currency,o=e.decimal,a=e.numerals?function(e){return function(t){return t.replace(/[0-9]/g,(function(t){return e[+t]}))}}(e.numerals):Ka,l=e.percent||"%";function u(e){var t=(e=Ba(e)).fill,n=e.align,u=e.sign,s=e.symbol,c=e.zero,f=e.width,h=e.comma,d=e.precision,p=e.trim,m=e.type;"n"===m?(h=!0,m="g"):Ga[m]||(null==d&&(d=12),p=!0,m="g"),(c||"0"===t&&"="===n)&&(c=!0,t="0",n="=");var g="$"===s?i[0]:"#"===s&&/[boxX]/.test(m)?"0"+m.toLowerCase():"",v="$"===s?i[1]:/[%p]/.test(m)?l:"",y=Ga[m],b=/[defgprs%]/.test(m);function x(e){var i,l,s,x=g,w=v;if("c"===m)w=y(e)+w,e="";else{var M=(e=+e)<0;if(e=y(Math.abs(e),d),p&&(e=function(e){e:for(var t,n=e.length,r=1,i=-1;r<n;++r)switch(e[r]){case".":i=t=r;break;case"0":0===i&&(i=r),t=r;break;default:if(i>0){if(!+e[r])break e;i=0}}return i>0?e.slice(0,i)+e.slice(t+1):e}(e)),M&&0==+e&&(M=!1),x=(M?"("===u?u:"-":"-"===u||"("===u?"":u)+x,w=("s"===m?Ja[8+za/3]:"")+w+(M&&"("===u?")":""),b)for(i=-1,l=e.length;++i<l;)if(48>(s=e.charCodeAt(i))||s>57){w=(46===s?o+e.slice(i+1):e.slice(i))+w,e=e.slice(0,i);break}}h&&!c&&(e=r(e,1/0));var q=x.length+e.length+w.length,C=q<f?new Array(f-q+1).join(t):"";switch(h&&c&&(e=r(C+e,C.length?f-w.length:1/0),C=""),n){case"<":e=x+e+w+C;break;case"=":e=x+C+e+w;break;case"^":e=C.slice(0,q=C.length>>1)+x+e+w+C.slice(q);break;default:e=C+x+e+w}return a(e)}return d=null==d?6:/[gprs]/.test(m)?Math.max(1,Math.min(21,d)):Math.max(0,Math.min(20,d)),x.toString=function(){return e+""},x}return{format:u,formatPrefix:function(e,t){var n=u(((e=Ba(e)).type="f",e)),r=3*Math.max(-8,Math.min(8,Math.floor(function(e){return(e=_a(Math.abs(e)))?e[1]:NaN}(t)/3))),i=Math.pow(10,-r),o=Ja[8+r/3];return function(e){return n(i*e)+o}}}}(Za=Xa({decimal:".",thousands:",",grouping:[3],currency:["$",""]})).format,Za.formatPrefix;var Qa=new Date,el=new Date;function tl(e,t,n,r){function i(t){return e(t=new Date(+t)),t}return i.floor=i,i.ceil=function(n){return e(n=new Date(n-1)),t(n,1),e(n),n},i.round=function(e){var t=i(e),n=i.ceil(e);return e-t<n-e?t:n},i.offset=function(e,n){return t(e=new Date(+e),null==n?1:Math.floor(n)),e},i.range=function(n,r,o){var a,l=[];if(n=i.ceil(n),o=null==o?1:Math.floor(o),!(n<r&&o>0))return l;do{l.push(a=new Date(+n)),t(n,o),e(n)}while(a<n&&n<r);return l},i.filter=function(n){return tl((function(t){if(t>=t)for(;e(t),!n(t);)t.setTime(t-1)}),(function(e,r){if(e>=e)if(r<0)for(;++r<=0;)for(;t(e,-1),!n(e););else for(;--r>=0;)for(;t(e,1),!n(e););}))},n&&(i.count=function(t,r){return Qa.setTime(+t),el.setTime(+r),e(Qa),e(el),Math.floor(n(Qa,el))},i.every=function(e){return e=Math.floor(e),isFinite(e)&&e>0?e>1?i.filter(r?function(t){return r(t)%e==0}:function(t){return i.count(0,t)%e==0}):i:null}),i}var nl=tl((function(){}),(function(e,t){e.setTime(+e+t)}),(function(e,t){return t-e}));nl.every=function(e){return e=Math.floor(e),isFinite(e)&&e>0?e>1?tl((function(t){t.setTime(Math.floor(t/e)*e)}),(function(t,n){t.setTime(+t+n*e)}),(function(t,n){return(n-t)/e})):nl:null},nl.range;var rl=1e3,il=6e4,ol=36e5,al=864e5,ll=6048e5;tl((function(e){e.setTime(Math.floor(e/rl)*rl)}),(function(e,t){e.setTime(+e+t*rl)}),(function(e,t){return(t-e)/rl}),(function(e){return e.getUTCSeconds()})).range,tl((function(e){e.setTime(Math.floor(e/il)*il)}),(function(e,t){e.setTime(+e+t*il)}),(function(e,t){return(t-e)/il}),(function(e){return e.getMinutes()})).range,tl((function(e){var t=e.getTimezoneOffset()*il%ol;t<0&&(t+=ol),e.setTime(Math.floor((+e-t)/ol)*ol+t)}),(function(e,t){e.setTime(+e+t*ol)}),(function(e,t){return(t-e)/ol}),(function(e){return e.getHours()})).range;var ul=tl((function(e){e.setHours(0,0,0,0)}),(function(e,t){e.setDate(e.getDate()+t)}),(function(e,t){return(t-e-(t.getTimezoneOffset()-e.getTimezoneOffset())*il)/al}),(function(e){return e.getDate()-1}));function sl(e){return tl((function(t){t.setDate(t.getDate()-(t.getDay()+7-e)%7),t.setHours(0,0,0,0)}),(function(e,t){e.setDate(e.getDate()+7*t)}),(function(e,t){return(t-e-(t.getTimezoneOffset()-e.getTimezoneOffset())*il)/ll}))}ul.range;var cl=sl(0),fl=sl(1),hl=sl(2),dl=sl(3),pl=sl(4),ml=sl(5),gl=sl(6);cl.range,fl.range,hl.range,dl.range,pl.range,ml.range,gl.range,tl((function(e){e.setDate(1),e.setHours(0,0,0,0)}),(function(e,t){e.setMonth(e.getMonth()+t)}),(function(e,t){return t.getMonth()-e.getMonth()+12*(t.getFullYear()-e.getFullYear())}),(function(e){return e.getMonth()})).range;var vl=tl((function(e){e.setMonth(0,1),e.setHours(0,0,0,0)}),(function(e,t){e.setFullYear(e.getFullYear()+t)}),(function(e,t){return t.getFullYear()-e.getFullYear()}),(function(e){return e.getFullYear()}));vl.every=function(e){return isFinite(e=Math.floor(e))&&e>0?tl((function(t){t.setFullYear(Math.floor(t.getFullYear()/e)*e),t.setMonth(0,1),t.setHours(0,0,0,0)}),(function(t,n){t.setFullYear(t.getFullYear()+n*e)})):null},vl.range,tl((function(e){e.setUTCSeconds(0,0)}),(function(e,t){e.setTime(+e+t*il)}),(function(e,t){return(t-e)/il}),(function(e){return e.getUTCMinutes()})).range,tl((function(e){e.setUTCMinutes(0,0,0)}),(function(e,t){e.setTime(+e+t*ol)}),(function(e,t){return(t-e)/ol}),(function(e){return e.getUTCHours()})).range;var yl=tl((function(e){e.setUTCHours(0,0,0,0)}),(function(e,t){e.setUTCDate(e.getUTCDate()+t)}),(function(e,t){return(t-e)/al}),(function(e){return e.getUTCDate()-1}));function bl(e){return tl((function(t){t.setUTCDate(t.getUTCDate()-(t.getUTCDay()+7-e)%7),t.setUTCHours(0,0,0,0)}),(function(e,t){e.setUTCDate(e.getUTCDate()+7*t)}),(function(e,t){return(t-e)/ll}))}yl.range;var xl=bl(0),wl=bl(1),Ml=bl(2),ql=bl(3),Cl=bl(4),Dl=bl(5),kl=bl(6);xl.range,wl.range,Ml.range,ql.range,Cl.range,Dl.range,kl.range,tl((function(e){e.setUTCDate(1),e.setUTCHours(0,0,0,0)}),(function(e,t){e.setUTCMonth(e.getUTCMonth()+t)}),(function(e,t){return t.getUTCMonth()-e.getUTCMonth()+12*(t.getUTCFullYear()-e.getUTCFullYear())}),(function(e){return e.getUTCMonth()})).range;var Sl=tl((function(e){e.setUTCMonth(0,1),e.setUTCHours(0,0,0,0)}),(function(e,t){e.setUTCFullYear(e.getUTCFullYear()+t)}),(function(e,t){return t.getUTCFullYear()-e.getUTCFullYear()}),(function(e){return e.getUTCFullYear()}));function Il(e){if(0<=e.y&&e.y<100){var t=new Date(-1,e.m,e.d,e.H,e.M,e.S,e.L);return t.setFullYear(e.y),t}return new Date(e.y,e.m,e.d,e.H,e.M,e.S,e.L)}function Nl(e){if(0<=e.y&&e.y<100){var t=new Date(Date.UTC(-1,e.m,e.d,e.H,e.M,e.S,e.L));return t.setUTCFullYear(e.y),t}return new Date(Date.UTC(e.y,e.m,e.d,e.H,e.M,e.S,e.L))}function Ol(e){return{y:e,m:0,d:1,H:0,M:0,S:0,L:0}}Sl.every=function(e){return isFinite(e=Math.floor(e))&&e>0?tl((function(t){t.setUTCFullYear(Math.floor(t.getUTCFullYear()/e)*e),t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0)}),(function(t,n){t.setUTCFullYear(t.getUTCFullYear()+n*e)})):null},Sl.range;var Tl,El,Al,Ll={"-":"",_:" ",0:"0"},Fl=/^\s*\d+/,Pl=/^%/,jl=/[\\^$*+?|[\]().{}]/g;function $l(e,t,n){var r=e<0?"-":"",i=(r?-e:e)+"",o=i.length;return r+(o<n?new Array(n-o+1).join(t)+i:i)}function Hl(e){return e.replace(jl,"\\$&")}function Rl(e){return new RegExp("^(?:"+e.map(Hl).join("|")+")","i")}function Ul(e){for(var t={},n=-1,r=e.length;++n<r;)t[e[n].toLowerCase()]=n;return t}function _l(e,t,n){var r=Fl.exec(t.slice(n,n+1));return r?(e.w=+r[0],n+r[0].length):-1}function zl(e,t,n){var r=Fl.exec(t.slice(n,n+1));return r?(e.u=+r[0],n+r[0].length):-1}function Vl(e,t,n){var r=Fl.exec(t.slice(n,n+2));return r?(e.U=+r[0],n+r[0].length):-1}function Bl(e,t,n){var r=Fl.exec(t.slice(n,n+2));return r?(e.V=+r[0],n+r[0].length):-1}function Yl(e,t,n){var r=Fl.exec(t.slice(n,n+2));return r?(e.W=+r[0],n+r[0].length):-1}function Wl(e,t,n){var r=Fl.exec(t.slice(n,n+4));return r?(e.y=+r[0],n+r[0].length):-1}function Gl(e,t,n){var r=Fl.exec(t.slice(n,n+2));return r?(e.y=+r[0]+(+r[0]>68?1900:2e3),n+r[0].length):-1}function Kl(e,t,n){var r=/^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(t.slice(n,n+6));return r?(e.Z=r[1]?0:-(r[2]+(r[3]||"00")),n+r[0].length):-1}function Zl(e,t,n){var r=Fl.exec(t.slice(n,n+2));return r?(e.m=r[0]-1,n+r[0].length):-1}function Jl(e,t,n){var r=Fl.exec(t.slice(n,n+2));return r?(e.d=+r[0],n+r[0].length):-1}function Xl(e,t,n){var r=Fl.exec(t.slice(n,n+3));return r?(e.m=0,e.d=+r[0],n+r[0].length):-1}function Ql(e,t,n){var r=Fl.exec(t.slice(n,n+2));return r?(e.H=+r[0],n+r[0].length):-1}function eu(e,t,n){var r=Fl.exec(t.slice(n,n+2));return r?(e.M=+r[0],n+r[0].length):-1}function tu(e,t,n){var r=Fl.exec(t.slice(n,n+2));return r?(e.S=+r[0],n+r[0].length):-1}function nu(e,t,n){var r=Fl.exec(t.slice(n,n+3));return r?(e.L=+r[0],n+r[0].length):-1}function ru(e,t,n){var r=Fl.exec(t.slice(n,n+6));return r?(e.L=Math.floor(r[0]/1e3),n+r[0].length):-1}function iu(e,t,n){var r=Pl.exec(t.slice(n,n+1));return r?n+r[0].length:-1}function ou(e,t,n){var r=Fl.exec(t.slice(n));return r?(e.Q=+r[0],n+r[0].length):-1}function au(e,t,n){var r=Fl.exec(t.slice(n));return r?(e.Q=1e3*+r[0],n+r[0].length):-1}function lu(e,t){return $l(e.getDate(),t,2)}function uu(e,t){return $l(e.getHours(),t,2)}function su(e,t){return $l(e.getHours()%12||12,t,2)}function cu(e,t){return $l(1+ul.count(vl(e),e),t,3)}function fu(e,t){return $l(e.getMilliseconds(),t,3)}function hu(e,t){return fu(e,t)+"000"}function du(e,t){return $l(e.getMonth()+1,t,2)}function pu(e,t){return $l(e.getMinutes(),t,2)}function mu(e,t){return $l(e.getSeconds(),t,2)}function gu(e){var t=e.getDay();return 0===t?7:t}function vu(e,t){return $l(cl.count(vl(e),e),t,2)}function yu(e,t){var n=e.getDay();return e=n>=4||0===n?pl(e):pl.ceil(e),$l(pl.count(vl(e),e)+(4===vl(e).getDay()),t,2)}function bu(e){return e.getDay()}function xu(e,t){return $l(fl.count(vl(e),e),t,2)}function wu(e,t){return $l(e.getFullYear()%100,t,2)}function Mu(e,t){return $l(e.getFullYear()%1e4,t,4)}function qu(e){var t=e.getTimezoneOffset();return(t>0?"-":(t*=-1,"+"))+$l(t/60|0,"0",2)+$l(t%60,"0",2)}function Cu(e,t){return $l(e.getUTCDate(),t,2)}function Du(e,t){return $l(e.getUTCHours(),t,2)}function ku(e,t){return $l(e.getUTCHours()%12||12,t,2)}function Su(e,t){return $l(1+yl.count(Sl(e),e),t,3)}function Iu(e,t){return $l(e.getUTCMilliseconds(),t,3)}function Nu(e,t){return Iu(e,t)+"000"}function Ou(e,t){return $l(e.getUTCMonth()+1,t,2)}function Tu(e,t){return $l(e.getUTCMinutes(),t,2)}function Eu(e,t){return $l(e.getUTCSeconds(),t,2)}function Au(e){var t=e.getUTCDay();return 0===t?7:t}function Lu(e,t){return $l(xl.count(Sl(e),e),t,2)}function Fu(e,t){var n=e.getUTCDay();return e=n>=4||0===n?Cl(e):Cl.ceil(e),$l(Cl.count(Sl(e),e)+(4===Sl(e).getUTCDay()),t,2)}function Pu(e){return e.getUTCDay()}function ju(e,t){return $l(wl.count(Sl(e),e),t,2)}function $u(e,t){return $l(e.getUTCFullYear()%100,t,2)}function Hu(e,t){return $l(e.getUTCFullYear()%1e4,t,4)}function Ru(){return"+0000"}function Uu(){return"%"}function _u(e){return+e}function zu(e){return Math.floor(+e/1e3)}!function(e){Tl=function(e){var t=e.dateTime,n=e.date,r=e.time,i=e.periods,o=e.days,a=e.shortDays,l=e.months,u=e.shortMonths,s=Rl(i),c=Ul(i),f=Rl(o),h=Ul(o),d=Rl(a),p=Ul(a),m=Rl(l),g=Ul(l),v=Rl(u),y=Ul(u),b={a:function(e){return a[e.getDay()]},A:function(e){return o[e.getDay()]},b:function(e){return u[e.getMonth()]},B:function(e){return l[e.getMonth()]},c:null,d:lu,e:lu,f:hu,H:uu,I:su,j:cu,L:fu,m:du,M:pu,p:function(e){return i[+(e.getHours()>=12)]},Q:_u,s:zu,S:mu,u:gu,U:vu,V:yu,w:bu,W:xu,x:null,X:null,y:wu,Y:Mu,Z:qu,"%":Uu},x={a:function(e){return a[e.getUTCDay()]},A:function(e){return o[e.getUTCDay()]},b:function(e){return u[e.getUTCMonth()]},B:function(e){return l[e.getUTCMonth()]},c:null,d:Cu,e:Cu,f:Nu,H:Du,I:ku,j:Su,L:Iu,m:Ou,M:Tu,p:function(e){return i[+(e.getUTCHours()>=12)]},Q:_u,s:zu,S:Eu,u:Au,U:Lu,V:Fu,w:Pu,W:ju,x:null,X:null,y:$u,Y:Hu,Z:Ru,"%":Uu},w={a:function(e,t,n){var r=d.exec(t.slice(n));return r?(e.w=p[r[0].toLowerCase()],n+r[0].length):-1},A:function(e,t,n){var r=f.exec(t.slice(n));return r?(e.w=h[r[0].toLowerCase()],n+r[0].length):-1},b:function(e,t,n){var r=v.exec(t.slice(n));return r?(e.m=y[r[0].toLowerCase()],n+r[0].length):-1},B:function(e,t,n){var r=m.exec(t.slice(n));return r?(e.m=g[r[0].toLowerCase()],n+r[0].length):-1},c:function(e,n,r){return C(e,t,n,r)},d:Jl,e:Jl,f:ru,H:Ql,I:Ql,j:Xl,L:nu,m:Zl,M:eu,p:function(e,t,n){var r=s.exec(t.slice(n));return r?(e.p=c[r[0].toLowerCase()],n+r[0].length):-1},Q:ou,s:au,S:tu,u:zl,U:Vl,V:Bl,w:_l,W:Yl,x:function(e,t,r){return C(e,n,t,r)},X:function(e,t,n){return C(e,r,t,n)},y:Gl,Y:Wl,Z:Kl,"%":iu};function M(e,t){return function(n){var r,i,o,a=[],l=-1,u=0,s=e.length;for(n instanceof Date||(n=new Date(+n));++l<s;)37===e.charCodeAt(l)&&(a.push(e.slice(u,l)),null!=(i=Ll[r=e.charAt(++l)])?r=e.charAt(++l):i="e"===r?" ":"0",(o=t[r])&&(r=o(n,i)),a.push(r),u=l+1);return a.push(e.slice(u,l)),a.join("")}}function q(e,t){return function(n){var r,i,o=Ol(1900);if(C(o,e,n+="",0)!=n.length)return null;if("Q"in o)return new Date(o.Q);if("p"in o&&(o.H=o.H%12+12*o.p),"V"in o){if(o.V<1||o.V>53)return null;"w"in o||(o.w=1),"Z"in o?(i=(r=Nl(Ol(o.y))).getUTCDay(),r=i>4||0===i?wl.ceil(r):wl(r),r=yl.offset(r,7*(o.V-1)),o.y=r.getUTCFullYear(),o.m=r.getUTCMonth(),o.d=r.getUTCDate()+(o.w+6)%7):(i=(r=t(Ol(o.y))).getDay(),r=i>4||0===i?fl.ceil(r):fl(r),r=ul.offset(r,7*(o.V-1)),o.y=r.getFullYear(),o.m=r.getMonth(),o.d=r.getDate()+(o.w+6)%7)}else("W"in o||"U"in o)&&("w"in o||(o.w="u"in o?o.u%7:"W"in o?1:0),i="Z"in o?Nl(Ol(o.y)).getUTCDay():t(Ol(o.y)).getDay(),o.m=0,o.d="W"in o?(o.w+6)%7+7*o.W-(i+5)%7:o.w+7*o.U-(i+6)%7);return"Z"in o?(o.H+=o.Z/100|0,o.M+=o.Z%100,Nl(o)):t(o)}}function C(e,t,n,r){for(var i,o,a=0,l=t.length,u=n.length;a<l;){if(r>=u)return-1;if(37===(i=t.charCodeAt(a++))){if(i=t.charAt(a++),!(o=w[i in Ll?t.charAt(a++):i])||(r=o(e,n,r))<0)return-1}else if(i!=n.charCodeAt(r++))return-1}return r}return b.x=M(n,b),b.X=M(r,b),b.c=M(t,b),x.x=M(n,x),x.X=M(r,x),x.c=M(t,x),{format:function(e){var t=M(e+="",b);return t.toString=function(){return e},t},parse:function(e){var t=q(e+="",Il);return t.toString=function(){return e},t},utcFormat:function(e){var t=M(e+="",x);return t.toString=function(){return e},t},utcParse:function(e){var t=q(e,Nl);return t.toString=function(){return e},t}}}(e),Tl.format,Tl.parse,El=Tl.utcFormat,Al=Tl.utcParse}({dateTime:"%x, %X",date:"%-m/%-d/%Y",time:"%-I:%M:%S %p",periods:["AM","PM"],days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],shortDays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],shortMonths:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]});var Vu="%Y-%m-%dT%H:%M:%S.%LZ";Date.prototype.toISOString||El(Vu),+new Date("2000-01-01T00:00:00.000Z")||Al(Vu),Si.bind(null,!0);const Bu=[[2,4,6],[2,4],[3]],Yu=[,[,,[[1,2]],[[1,2,3],[1,3]],[[1,2,4],[1,4]],[[1,2,4],[1,5]],[[1,2,4,6],[2,4,6],[1,3,6],[1,6]],[[1,2,4,6],[2,4,6],[1,3,6],[1,7]],[[1,2,4,8],[2,4,8],[1,8]],[[1,2,4,8],[2,4,8],[1,3,9],[1,9]],[[1,2,4,6,10],[1,2,4,10],[1,3,10],[3,10],[1,10]]],[,,,[[2,3]],[[2,3,4],[2,4]],[[2,3,4],[2,4],[2,5]],[[2,4,6],[2,6]],[[2,4,6],[2,6],[2,7]],[[2,4,8],[2,8]],[[2,4,8],[2,8],[2,9]],[[2,4,6,10],[2,4,10],[5,10],[3,10]]],[,,,,[[3,4]],[[3,4,5],[3,5]],[[3,4,5,6],[3,6]],[[3,4,5,6],[3,5,7],[3,7]],[[3,4,5,6,8],[3,5,7],[4,8],[3,8]],[[3,4,5,6,8],[3,4,6,9],[3,4,6,8],[3,6,9],[4,8],[3,9]],[[4,6,10],[5,10],[3,10]]],[,,,,,[[4,5]],[[4,5,6],[4,6]],[[4,5,6,7],[4,5,6],[4,6]],[[4,5,6,7,8],[4,5,6,7],[4,6,8],[4,8]],[[4,5,6,7,8],[4,6,9],[4,6,8],[4,8]],[[4,6,10],[5,7,9],[5,10],[4,10]]],[,,,,,,[[5,6]],[[5,6,7],[5,7]],[[5,6,7,8],[5,6,7],[6,8]],[[5,6,7,8,9],[5,6,7,8],[5,7,9],[5,9]],[[6,8,10],[5,10]]],[,,,,,,,[[6,7]],[[6,7,8],[6,8]],[[6,7,8,9],[6,7,8],[6,9]],[[6,7,8,9,10],[6,8,10],[6,10]]],[,,,,,,,,[[7,8]],[[7,8,9],[7,9]],[[7,8,9,10],[8,10],[7,10],[7,9]]],[,,,,,,,,,[[8,9]],[[8,9,10],[8,10]]],[,,,,,,,,,,[[9,10]]]];function Wu(e,t,n){const r=e?e.length:0;let i,o=void 0===t?Number.MAX_VALUE:e[0]/t;for(i=1;i<r;i++)o=Math.min(o,e[i]/e[i-1]);void 0!==n&&(o=Math.min(o,n/e[r-1])),e.splice(0,0,o)}function Gu(e,t,n){let r;const i=e?e.length:0;for(r=0;r<i;r++)Wu(e[r],t,n)}function Ku(e,t=!1){const n=t?"IM_5791_SVG_LABEL_RENDERING":"IM_4962_SVG_CHART_LABELS";if(null!=e&&e.isEnabled(n))return/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)?void 0:"svg"}function Zu(e){const t=e.node.desc&&e.node.desc.share;return t?e.formatter("share")(t):""}function Ju(e){return e.formatter("num")(e.node.data.num.value)}function Xu({data:e}){return e?e.label:""}function Qu(e){if(e.dataPoint.auto)return Zu;switch(e.dataPoint.labelMode){case"share":default:return Zu;case"value":return Ju;case"none":return null}}function es(e,t,n,r,i){const o=i.axis.label.getStyle(),a=i.label.value.getStyle(),l=n.getStyles().label.value;return{type:"labels",key:"funnel-labels",renderer:Ku(e,!0),layout:{displayOrder:2},settings:{sources:[{component:"fun",selector:".labelLeft",strategy:{type:"rows",settings:{align:0,fill:o.fill,fontSize:parseInt(o.fontSize,10),fontFamily:o.fontFamily,labels:[{label:Xu}],linkData:e=>`${e.data.value} ${Xu(e)}`}}},{component:"fun",selector:".labelCenter",strategy:{type:"rows",settings:{align:.5,fill:a.useContrastColor?({node:e})=>(e=>To.isDark(e.desc.fill)?l.lightColor:l.darkColor)(e):a.fill,fontSize:parseInt(a.fontSize,10),fontFamily:a.fontFamily,labels:[{label:Qu(t)}],linkData:e=>"none"===t.dataPoint.labelMode?Math.random():`${e.data.value} ${Qu(t)(e)}`}}}]},animations:{enabled:r,trackBy:e=>e.data}}}function ts(e,t,n){if(!t.showDimensionTitle||!t.qHyperCube.qDimensionInfo[0].qFallbackTitle)return!1;const r=t.qHyperCube.qDimensionInfo[0].qFallbackTitle,i=n.axis.title.getStyle();return{type:"text",key:"dimension-title",renderer:Ku(e,!0),text:r,layout:{dock:"top"},style:{text:{fill:i.fill,fontSize:i.fontSize,fontFamily:i.fontFamily}}}}function ns({picasso:e}){const t=n(),c=r(),f=i(),h=o(),d=a(),p=l(),[m,g]=u(),[v,y]=u(),[b,x]=u(),[w,M]=u();return s((()=>{const n=function(e){var t,n,r,i,o=e.picasso,a=e.model,l=e.app,u=e.translator,s=e.layoutService,c=void 0===s?void 0:s,f=e.createConfig,h=void 0===f?It:f,d=e.config,p=void 0===d?{}:d,m=e.custom,g=void 0===m?{}:m,v=p.localeInfo,y=p.key,b=p.theme,x=void 0===b?void 0:b,w=p.auto,M=void 0===w?void 0:w,q=p.definitionPath,C=null==c||null===(t=c.getLayout)||void 0===t?void 0:t.call(c),D={theme:x,key:y,localeInfo:v,layout:C,hc:null==c||null===(n=c.getHyperCube)||void 0===n?void 0:n.call(c),legendProps:null==c||null===(r=c.getLayoutValue)||void 0===r?void 0:r.call(c,"legend"),colorProps:N(N({},null==c||null===(i=c.getLayoutValue)||void 0===i?void 0:i.call(c,"color")),{},{useBaseColors:C?Ct(C):void 0})},k=Mt({picasso:o,model:a,app:l,translator:u,auto:M});!1!==M&&k.auto((function(e){return M?M({layout:e,defaultAuto:St}):St(e)}));var S=!1,I={getColor:function(){return k.color()},getPaletteColor:function(e){var t=e.index,n=e.color;return k.resolveUIColor({index:t,color:n})},getData:function(){return k.data()},getDatumProps:function(e){return k.datumProps(e)},getSnapshotData:function(){return k.getSnapshotData(q)},getSettingsForMeasure:function(e){return k.settingsForMeasure(e)},getSettings:function(){return k.settings()},getLegend:function(e,t){return k.legend(e,t)},getScales:function(){return k.scales()},getPalettes:function(){return k.palettes()},isSelectionLocked:function(e){var t=e.isMeasureSelectionLocked;return k.isSelectionLocked({isMeasureSelectionLocked:t})},isInitialized:function(){return S},custom:N({},g),initialize:function(){var e=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}).createConfig,t=(void 0===e?h:e)({getUseBaseColors:Ct}),n=Dt(D,t);return k.config(n),k.getAuxiliarySettings(q).then((function(){S=!0}))}};return I}({picasso:e,model:f,app:h,translator:d,config:{auto:!1,key:"fill"}});t.style.overflow="hidden";const r=e({renderer:{prio:[p.renderer||"svg"]}}).chart({element:t,data:[],settings:{}}),i=Vr({chart:r,selections:c,config:{selectionActions:!1}});return x(i),y(n),g(r),M(function(){var e={};return{get:function(t){return e[t]},set:function(t,n){return e[t]=n,n},has:function(t){return t in e},remove:function(t){delete e[t]},empty:function(){e={}}}}()),()=>{i.destroy(),r.destroy()}}),[]),[m,v,b,w]}function rs({picasso:e,flags:t}){const n=c(),r=f(),i=h(),o=d(),a=p(),u=m().qLocaleInfo,[y,b,x,w]=ns({picasso:e,layout:n}),M=l(),q=()=>{const e=y.element.clientWidth!==w.get("width")||y.element.clientHeight!==w.get("height");return!1!==M.chartAnimations&&t.isEnabled("IM_1355_ANIMATIONS_FUNNEL")&&!e&&!Oi.propertiesHaveChanged({viewCache:w,layout:n})},[C]=g((()=>{if(!b)return Promise.resolve();const t=function(e){return{layout:e,keys:{SCALE:{FILL:"fill"},COMPONENT:{FUNNEL:"fun",FUNNEL_LABELS:"funnel-labels",DIMENSION_TITLE:"dimension-title"}}}}(n),i=function(e){var t=e.picassoInstance,n=e.plugins,r=e.pluginArgs,i=void 0===r?{}:r,o={initialized:!1,definitions:[]};return{initialize:function(){return A(O().mark((function e(){var r,a,l,u;return O().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!o.initialized){e.next=2;break}return e.abrupt("return");case 2:return a=Promise.all(n.filter((function(e){return"custom-component"===e.info.type})).map(function(){var e=A(O().mark((function e(n){var r;return O().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n.info.componentName){e.next=2;break}throw new Error("plugin-service: Custom component is missing componentName");case 2:return e.next=4,n.fn(N({},i));case 4:if("object"===T(r=e.sent)){e.next=7;break}throw new Error("plugin-service: Custom component needs to be an object");case 7:t.component(n.info.componentName,r);case 8:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}())),l=Promise.all(n.filter((function(e){return"component-definition"===e.info.type})).map((function(e){return e.fn(N({},i))}))),e.next=6,Promise.all([a,l]);case 6:u=e.sent,o.initialized=!0,(r=o.definitions).push.apply(r,j(u[1]));case 9:case"end":return e.stop()}}),e)})))()},extendComponents:function(e){return o.initialized?(o.definitions.filter(Boolean).forEach((function(t){var n=P(e.filter((function(e){return e.key&&e.key===t.key})),1)[0];if(n){var r=G(!0,{},n.brush);G(!0,n,t),t.brush&&(n.brush=function(e,t){return"object"===T(e)&&Object.keys(e).length?(Array.isArray(t.consume)&&(e.consume=Et({originalArray:e.consume,newArray:t.consume,matchKey:"context"})),Array.isArray(t.trigger)&&(e.trigger=Et({originalArray:e.trigger,newArray:t.trigger,matchKey:"on"})),e):t}(r,t.brush))}else e.push(t)})),e):e}}}({picassoInstance:e,plugins:a,pluginArgs:t});return Promise.all([b.initialize({createConfig:({getUseBaseColors:e})=>({theme:r,colorProps:{...n.color,useBaseColors:e(n)},layout:n,hc:n.qHyperCube})}),i.initialize()]).then((()=>i))}),[n,b]);s((()=>{if(!y||!b||!C)return;const e=[{type:"q",key:"qHyperCube",data:n.qHyperCube,config:{localeInfo:u}},...b.getData()],o=function(e){var t=e.theme,n=e.config,r=void 0===n?{}:n,i=r.id,o=r.resolve,a=void 0===o?[]:o,l=r.transform,u=void 0===l?[]:l,s=r.extend,c=void 0===s?[]:s,f={theme:t,matrix:Jr(a),styles:void 0};return f.styles=Qr({theme:t,id:i,transform:u,extend:c,matrix:f.matrix}),{getStyles:function(){return f.styles},getTheme:function(){return f.theme},setTheme:function(e){f.theme=e,f.styles=Qr({theme:e,id:i,transform:u,extend:c,matrix:f.matrix})}}}({theme:r,config:{id:"funnelChart"}}),a=function({layout:e,themeService:t}){const n=t.getStyles(),r=t=>{var n,r;return null!==(n=null===(r=e.components)||void 0===r?void 0:r.find((e=>e.key===t)))&&void 0!==n?n:void 0};return{axis:{title:{getStyle:()=>{var e,t,i,o,a,l;return{fontFamily:null!==(e=null===(t=r("axis"))||void 0===t||null===(t=t.axis)||void 0===t||null===(t=t.title)||void 0===t?void 0:t.fontFamily)&&void 0!==e?e:n.axis.title.fontFamily,fontSize:null!==(i=null===(o=r("axis"))||void 0===o||null===(o=o.axis)||void 0===o||null===(o=o.title)||void 0===o?void 0:o.fontSize)&&void 0!==i?i:n.axis.title.fontSize,fill:null!==(a=null===(l=r("axis"))||void 0===l||null===(l=l.axis)||void 0===l||null===(l=l.title)||void 0===l||null===(l=l.color)||void 0===l?void 0:l.color)&&void 0!==a?a:n.axis.title.color}}},label:{getStyle:()=>{var e,t,i,o,a,l;return{fontSize:null!==(e=null===(t=r("axis"))||void 0===t||null===(t=t.axis)||void 0===t||null===(t=t.label)||void 0===t||null===(t=t.name)||void 0===t?void 0:t.fontSize)&&void 0!==e?e:n.axis.label.name.fontSize,fontFamily:null!==(i=null===(o=r("axis"))||void 0===o||null===(o=o.axis)||void 0===o||null===(o=o.label)||void 0===o||null===(o=o.name)||void 0===o?void 0:o.fontFamily)&&void 0!==i?i:n.axis.label.name.fontFamily,fill:null!==(a=null===(l=r("axis"))||void 0===l||null===(l=l.axis)||void 0===l||null===(l=l.label)||void 0===l||null===(l=l.name)||void 0===l||null===(l=l.color)||void 0===l?void 0:l.color)&&void 0!==a?a:n.axis.label.name.color}}}},label:{value:{getStyle:()=>{var e,t,i,o,a,l,u,s;return{fontSize:null!==(e=null===(t=r("label"))||void 0===t||null===(t=t.label)||void 0===t||null===(t=t.value)||void 0===t?void 0:t.fontSize)&&void 0!==e?e:n.label.value.fontSize,fontFamily:null!==(i=null===(o=r("label"))||void 0===o||null===(o=o.label)||void 0===o||null===(o=o.value)||void 0===o?void 0:o.fontFamily)&&void 0!==i?i:n.label.value.fontFamily,fill:null!==(a=null===(l=r("label"))||void 0===l||null===(l=l.label)||void 0===l||null===(l=l.value)||void 0===l||null===(l=l.color)||void 0===l?void 0:l.color)&&void 0!==a?a:n.label.value.color,useContrastColor:null===(u=null===(s=r("label"))||void 0===s||null===(s=s.label)||void 0===s||null===(s=s.value)||void 0===s?void 0:s.useContrastColor)||void 0===u||u}}}}}}({layout:n,themeService:o}),l=function({flags:e,layout:t,constraints:n,colorService:r,themeService:i,styleModel:o,pluginService:a,animationsEnabled:l}){const u=function(e){return{...e.getScales()}}(r),s=r.getPalettes(),c=function({layout:e,constraints:t,colorService:n,animationsEnabled:r}){const i=n.getDatumProps(),o=n.getColor(),a={type:"funnel",key:"fun",data:{extract:{field:"qDimensionInfo/0",props:{num:{field:"qMeasureInfo/0"},...i}}},brush:t.select||t.active?{}:{trigger:[{contexts:["selection"],data:[""]}],consume:[{context:"selection",filter:e=>"section"===e.tag,style:{inactive:{opacity:.3}}}]},settings:{num:{ref:"num"},fill:o,mode:e.funnel.mode},animations:{enabled:r,isMainComponent:!0,trackBy:e=>`${e.tag}: ${e.data.value}`}};return a}({layout:t,constraints:n,colorService:r,animationsEnabled:l}),f=[c,es(e,t,i,l,o),ts(e,t,o)];return{palettes:s,scales:u,components:a.extendComponents(f),formatters:{share:{type:"d3-number",format:".1%"},num:{data:{field:"qMeasureInfo/0"}}}}}({flags:t,layout:n,constraints:i,colorService:b,themeService:o,styleModel:a,pluginService:C,animationsEnabled:q});y.update({data:e,settings:l}),w.set("width",y.element.clientWidth),w.set("height",y.element.clientHeight),Oi.cacheProperties({viewCache:w,layout:n})}),[y,b,r.name(),C,i]),s((()=>{y&&(y.update(),w.set("width",y.element.clientWidth),w.set("height",y.element.clientHeight))}),[o.width,o.height]),s((()=>{x&&x.setLayout(n)}),[n]),v((e=>b.getSnapshotData().then((t=>(e.snapshotData=e.snapshotData||{},e.snapshotData.content=e.snapshotData.content||{},e.snapshotData.content.chartData=t,e))).catch((()=>e))))}function is(n){const r=e();r.use(t),r.component("funnel",k);const{flags:i}=n;return{ext:mi(n),qae:{properties:{initial:S},data:{targets:gi}},component(){rs({picasso:r,flags:i})}}}!function(){let e,t;for(Gu(Bu,1,10),e=0;e<Yu.length;e++)if(Yu[e])for(t=0;t<Yu[e].length;t++)Array.isArray(Yu[e][t])&&Gu(Yu[e][t])}();export{is as default};