@nebula.js/sn-distributionplot 0.38.1 → 0.40.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/api-specifications/properties.json +1 -1
- package/core/esm/index.js +4 -4
- package/core/esm/index.js.map +1 -1
- package/dist/sn-distplot.js +9 -25
- package/dist/sn-distplot.js.map +1 -1
- package/dist/sn-distplot.systemjs.js +8 -24
- package/dist/sn-distplot.systemjs.js.map +1 -1
- package/package.json +7 -7
package/dist/sn-distplot.js
CHANGED
|
@@ -1,45 +1,29 @@
|
|
|
1
1
|
/*
|
|
2
|
-
* @nebula.js/sn-distributionplot v0.
|
|
2
|
+
* @nebula.js/sn-distributionplot v0.40.0
|
|
3
3
|
* Copyright (c) 2023 QlikTech International AB
|
|
4
4
|
* Released under the MIT license.
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
|
-
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t(require("@nebula.js/stardust")):"function"==typeof define&&define.amd?define(["@nebula.js/stardust"],t):(e="undefined"!=typeof globalThis?globalThis:e||self)["sn-distributionplot"]=t(e.stardust)}(this,(function(e){"use strict";var t="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function n(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var i={
|
|
7
|
+
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t(require("@nebula.js/stardust")):"function"==typeof define&&define.amd?define(["@nebula.js/stardust"],t):(e="undefined"!=typeof globalThis?globalThis:e||self)["sn-distributionplot"]=t(e.stardust)}(this,(function(e){"use strict";var t="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function n(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var i={exports:{}};
|
|
8
8
|
/*!
|
|
9
|
-
* jQuery JavaScript Library v3.
|
|
9
|
+
* jQuery JavaScript Library v3.7.0
|
|
10
10
|
* https://jquery.com/
|
|
11
11
|
*
|
|
12
|
-
* Includes Sizzle.js
|
|
13
|
-
* https://sizzlejs.com/
|
|
14
|
-
*
|
|
15
12
|
* Copyright OpenJS Foundation and other contributors
|
|
16
13
|
* Released under the MIT license
|
|
17
14
|
* https://jquery.org/license
|
|
18
15
|
*
|
|
19
|
-
* Date: 2023-
|
|
20
|
-
*/
|
|
21
|
-
!function(e){!function(t,n){e.exports=t.document?n(t,!0):function(e){if(!e.document)throw new Error("jQuery requires a window with a document");return n(e)}}("undefined"!=typeof window?window:t,(function(e,t){var n=[],i=Object.getPrototypeOf,r=n.slice,o=n.flat?function(e){return n.flat.call(e)}:function(e){return n.concat.apply([],e)},s=n.push,a=n.indexOf,l={},c=l.toString,u=l.hasOwnProperty,h=u.toString,d=h.call(Object),f={},p=function(e){return"function"==typeof e&&"number"!=typeof e.nodeType&&"function"!=typeof e.item},m=function(e){return null!=e&&e===e.window},g=e.document,y={type:!0,src:!0,nonce:!0,noModule:!0};function v(e,t,n){var i,r,o=(n=n||g).createElement("script");if(o.text=e,t)for(i in y)(r=t[i]||t.getAttribute&&t.getAttribute(i))&&o.setAttribute(i,r);n.head.appendChild(o).parentNode.removeChild(o)}function b(e){return null==e?e+"":"object"==typeof e||"function"==typeof e?l[c.call(e)]||"object":typeof e}var x="3.6.4",w=function(e,t){return new w.fn.init(e,t)};function q(e){var t=!!e&&"length"in e&&e.length,n=b(e);return!p(e)&&!m(e)&&("array"===n||0===t||"number"==typeof t&&t>0&&t-1 in e)}w.fn=w.prototype={jquery:x,constructor:w,length:0,toArray:function(){return r.call(this)},get:function(e){return null==e?r.call(this):e<0?this[e+this.length]:this[e]},pushStack:function(e){var t=w.merge(this.constructor(),e);return t.prevObject=this,t},each:function(e){return w.each(this,e)},map:function(e){return this.pushStack(w.map(this,(function(t,n){return e.call(t,n,t)})))},slice:function(){return this.pushStack(r.apply(this,arguments))},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},even:function(){return this.pushStack(w.grep(this,(function(e,t){return(t+1)%2})))},odd:function(){return this.pushStack(w.grep(this,(function(e,t){return t%2})))},eq:function(e){var t=this.length,n=+e+(e<0?t:0);return this.pushStack(n>=0&&n<t?[this[n]]:[])},end:function(){return this.prevObject||this.constructor()},push:s,sort:n.sort,splice:n.splice},w.extend=w.fn.extend=function(){var e,t,n,i,r,o,s=arguments[0]||{},a=1,l=arguments.length,c=!1;for("boolean"==typeof s&&(c=s,s=arguments[a]||{},a++),"object"==typeof s||p(s)||(s={}),a===l&&(s=this,a--);a<l;a++)if(null!=(e=arguments[a]))for(t in e)i=e[t],"__proto__"!==t&&s!==i&&(c&&i&&(w.isPlainObject(i)||(r=Array.isArray(i)))?(n=s[t],o=r&&!Array.isArray(n)?[]:r||w.isPlainObject(n)?n:{},r=!1,s[t]=w.extend(c,o,i)):void 0!==i&&(s[t]=i));return s},w.extend({expando:"jQuery"+(x+Math.random()).replace(/\D/g,""),isReady:!0,error:function(e){throw new Error(e)},noop:function(){},isPlainObject:function(e){var t,n;return!(!e||"[object Object]"!==c.call(e))&&(!(t=i(e))||"function"==typeof(n=u.call(t,"constructor")&&t.constructor)&&h.call(n)===d)},isEmptyObject:function(e){var t;for(t in e)return!1;return!0},globalEval:function(e,t,n){v(e,{nonce:t&&t.nonce},n)},each:function(e,t){var n,i=0;if(q(e))for(n=e.length;i<n&&!1!==t.call(e[i],i,e[i]);i++);else for(i in e)if(!1===t.call(e[i],i,e[i]))break;return e},makeArray:function(e,t){var n=t||[];return null!=e&&(q(Object(e))?w.merge(n,"string"==typeof e?[e]:e):s.call(n,e)),n},inArray:function(e,t,n){return null==t?-1:a.call(t,e,n)},merge:function(e,t){for(var n=+t.length,i=0,r=e.length;i<n;i++)e[r++]=t[i];return e.length=r,e},grep:function(e,t,n){for(var i=[],r=0,o=e.length,s=!n;r<o;r++)!t(e[r],r)!==s&&i.push(e[r]);return i},map:function(e,t,n){var i,r,s=0,a=[];if(q(e))for(i=e.length;s<i;s++)null!=(r=t(e[s],s,n))&&a.push(r);else for(s in e)null!=(r=t(e[s],s,n))&&a.push(r);return o(a)},guid:1,support:f}),"function"==typeof Symbol&&(w.fn[Symbol.iterator]=n[Symbol.iterator]),w.each("Boolean Number String Function Array Date RegExp Object Error Symbol".split(" "),(function(e,t){l["[object "+t+"]"]=t.toLowerCase()}));var M=
|
|
22
|
-
/*!
|
|
23
|
-
* Sizzle CSS Selector Engine v2.3.10
|
|
24
|
-
* https://sizzlejs.com/
|
|
25
|
-
*
|
|
26
|
-
* Copyright JS Foundation and other contributors
|
|
27
|
-
* Released under the MIT license
|
|
28
|
-
* https://js.foundation/
|
|
29
|
-
*
|
|
30
|
-
* Date: 2023-02-14
|
|
31
|
-
*/
|
|
32
|
-
function(e){var t,n,i,r,o,s,a,l,c,u,h,d,f,p,m,g,y,v,b,x="sizzle"+1*new Date,w=e.document,q=0,M=0,D=le(),S=le(),_=le(),C=le(),k=function(e,t){return e===t&&(h=!0),0},E={}.hasOwnProperty,A=[],T=A.pop,I=A.push,R=A.push,N=A.slice,O=function(e,t){for(var n=0,i=e.length;n<i;n++)if(e[n]===t)return n;return-1},P="checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped",L="[\\x20\\t\\r\\n\\f]",F="(?:\\\\[\\da-fA-F]{1,6}"+L+"?|\\\\[^\\r\\n\\f]|[\\w-]|[^\0-\\x7f])+",z="\\["+L+"*("+F+")(?:"+L+"*([*^$|!~]?=)"+L+"*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|("+F+"))|)"+L+"*\\]",j=":("+F+")(?:\\((('((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\")|((?:\\\\.|[^\\\\()[\\]]|"+z+")*)|.*)\\)|)",H=new RegExp(L+"+","g"),B=new RegExp("^"+L+"+|((?:^|[^\\\\])(?:\\\\.)*)"+L+"+$","g"),V=new RegExp("^"+L+"*,"+L+"*"),$=new RegExp("^"+L+"*([>+~]|"+L+")"+L+"*"),W=new RegExp(L+"|>"),U=new RegExp(j),Y=new RegExp("^"+F+"$"),X={ID:new RegExp("^#("+F+")"),CLASS:new RegExp("^\\.("+F+")"),TAG:new RegExp("^("+F+"|[*])"),ATTR:new RegExp("^"+z),PSEUDO:new RegExp("^"+j),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+L+"*(even|odd|(([+-]|)(\\d*)n|)"+L+"*(?:([+-]|)"+L+"*(\\d+)|))"+L+"*\\)|)","i"),bool:new RegExp("^(?:"+P+")$","i"),needsContext:new RegExp("^"+L+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+L+"*((?:-\\d)?\\d*)"+L+"*\\)|)(?=[^-]|$)","i")},K=/HTML$/i,G=/^(?:input|select|textarea|button)$/i,J=/^h\d$/i,Z=/^[^{]+\{\s*\[native \w/,Q=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,ee=/[+~]/,te=new RegExp("\\\\[\\da-fA-F]{1,6}"+L+"?|\\\\([^\\r\\n\\f])","g"),ne=function(e,t){var n="0x"+e.slice(1)-65536;return t||(n<0?String.fromCharCode(n+65536):String.fromCharCode(n>>10|55296,1023&n|56320))},ie=/([\0-\x1f\x7f]|^-?\d)|^-$|[^\0-\x1f\x7f-\uFFFF\w-]/g,re=function(e,t){return t?"\0"===e?"�":e.slice(0,-1)+"\\"+e.charCodeAt(e.length-1).toString(16)+" ":"\\"+e},oe=function(){d()},se=xe((function(e){return!0===e.disabled&&"fieldset"===e.nodeName.toLowerCase()}),{dir:"parentNode",next:"legend"});try{R.apply(A=N.call(w.childNodes),w.childNodes),A[w.childNodes.length].nodeType}catch(e){R={apply:A.length?function(e,t){I.apply(e,N.call(t))}:function(e,t){for(var n=e.length,i=0;e[n++]=t[i++];);e.length=n-1}}}function ae(e,t,i,r){var o,a,c,u,h,p,y,v=t&&t.ownerDocument,w=t?t.nodeType:9;if(i=i||[],"string"!=typeof e||!e||1!==w&&9!==w&&11!==w)return i;if(!r&&(d(t),t=t||f,m)){if(11!==w&&(h=Q.exec(e)))if(o=h[1]){if(9===w){if(!(c=t.getElementById(o)))return i;if(c.id===o)return i.push(c),i}else if(v&&(c=v.getElementById(o))&&b(t,c)&&c.id===o)return i.push(c),i}else{if(h[2])return R.apply(i,t.getElementsByTagName(e)),i;if((o=h[3])&&n.getElementsByClassName&&t.getElementsByClassName)return R.apply(i,t.getElementsByClassName(o)),i}if(n.qsa&&!C[e+" "]&&(!g||!g.test(e))&&(1!==w||"object"!==t.nodeName.toLowerCase())){if(y=e,v=t,1===w&&(W.test(e)||$.test(e))){for((v=ee.test(e)&&ye(t.parentNode)||t)===t&&n.scope||((u=t.getAttribute("id"))?u=u.replace(ie,re):t.setAttribute("id",u=x)),a=(p=s(e)).length;a--;)p[a]=(u?"#"+u:":scope")+" "+be(p[a]);y=p.join(",")}try{return R.apply(i,v.querySelectorAll(y)),i}catch(t){C(e,!0)}finally{u===x&&t.removeAttribute("id")}}}return l(e.replace(B,"$1"),t,i,r)}function le(){var e=[];return function t(n,r){return e.push(n+" ")>i.cacheLength&&delete t[e.shift()],t[n+" "]=r}}function ce(e){return e[x]=!0,e}function ue(e){var t=f.createElement("fieldset");try{return!!e(t)}catch(e){return!1}finally{t.parentNode&&t.parentNode.removeChild(t),t=null}}function he(e,t){for(var n=e.split("|"),r=n.length;r--;)i.attrHandle[n[r]]=t}function de(e,t){var n=t&&e,i=n&&1===e.nodeType&&1===t.nodeType&&e.sourceIndex-t.sourceIndex;if(i)return i;if(n)for(;n=n.nextSibling;)if(n===t)return-1;return e?1:-1}function fe(e){return function(t){return"input"===t.nodeName.toLowerCase()&&t.type===e}}function pe(e){return function(t){var n=t.nodeName.toLowerCase();return("input"===n||"button"===n)&&t.type===e}}function me(e){return function(t){return"form"in t?t.parentNode&&!1===t.disabled?"label"in t?"label"in t.parentNode?t.parentNode.disabled===e:t.disabled===e:t.isDisabled===e||t.isDisabled!==!e&&se(t)===e:t.disabled===e:"label"in t&&t.disabled===e}}function ge(e){return ce((function(t){return t=+t,ce((function(n,i){for(var r,o=e([],n.length,t),s=o.length;s--;)n[r=o[s]]&&(n[r]=!(i[r]=n[r]))}))}))}function ye(e){return e&&void 0!==e.getElementsByTagName&&e}for(t in n=ae.support={},o=ae.isXML=function(e){var t=e&&e.namespaceURI,n=e&&(e.ownerDocument||e).documentElement;return!K.test(t||n&&n.nodeName||"HTML")},d=ae.setDocument=function(e){var t,r,s=e?e.ownerDocument||e:w;return s!=f&&9===s.nodeType&&s.documentElement?(p=(f=s).documentElement,m=!o(f),w!=f&&(r=f.defaultView)&&r.top!==r&&(r.addEventListener?r.addEventListener("unload",oe,!1):r.attachEvent&&r.attachEvent("onunload",oe)),n.scope=ue((function(e){return p.appendChild(e).appendChild(f.createElement("div")),void 0!==e.querySelectorAll&&!e.querySelectorAll(":scope fieldset div").length})),n.cssHas=ue((function(){try{return f.querySelector(":has(*,:jqfake)"),!1}catch(e){return!0}})),n.attributes=ue((function(e){return e.className="i",!e.getAttribute("className")})),n.getElementsByTagName=ue((function(e){return e.appendChild(f.createComment("")),!e.getElementsByTagName("*").length})),n.getElementsByClassName=Z.test(f.getElementsByClassName),n.getById=ue((function(e){return p.appendChild(e).id=x,!f.getElementsByName||!f.getElementsByName(x).length})),n.getById?(i.filter.ID=function(e){var t=e.replace(te,ne);return function(e){return e.getAttribute("id")===t}},i.find.ID=function(e,t){if(void 0!==t.getElementById&&m){var n=t.getElementById(e);return n?[n]:[]}}):(i.filter.ID=function(e){var t=e.replace(te,ne);return function(e){var n=void 0!==e.getAttributeNode&&e.getAttributeNode("id");return n&&n.value===t}},i.find.ID=function(e,t){if(void 0!==t.getElementById&&m){var n,i,r,o=t.getElementById(e);if(o){if((n=o.getAttributeNode("id"))&&n.value===e)return[o];for(r=t.getElementsByName(e),i=0;o=r[i++];)if((n=o.getAttributeNode("id"))&&n.value===e)return[o]}return[]}}),i.find.TAG=n.getElementsByTagName?function(e,t){return void 0!==t.getElementsByTagName?t.getElementsByTagName(e):n.qsa?t.querySelectorAll(e):void 0}:function(e,t){var n,i=[],r=0,o=t.getElementsByTagName(e);if("*"===e){for(;n=o[r++];)1===n.nodeType&&i.push(n);return i}return o},i.find.CLASS=n.getElementsByClassName&&function(e,t){if(void 0!==t.getElementsByClassName&&m)return t.getElementsByClassName(e)},y=[],g=[],(n.qsa=Z.test(f.querySelectorAll))&&(ue((function(e){var t;p.appendChild(e).innerHTML="<a id='"+x+"'></a><select id='"+x+"-\r\\' msallowcapture=''><option selected=''></option></select>",e.querySelectorAll("[msallowcapture^='']").length&&g.push("[*^$]="+L+"*(?:''|\"\")"),e.querySelectorAll("[selected]").length||g.push("\\["+L+"*(?:value|"+P+")"),e.querySelectorAll("[id~="+x+"-]").length||g.push("~="),(t=f.createElement("input")).setAttribute("name",""),e.appendChild(t),e.querySelectorAll("[name='']").length||g.push("\\["+L+"*name"+L+"*="+L+"*(?:''|\"\")"),e.querySelectorAll(":checked").length||g.push(":checked"),e.querySelectorAll("a#"+x+"+*").length||g.push(".#.+[+~]"),e.querySelectorAll("\\\f"),g.push("[\\r\\n\\f]")})),ue((function(e){e.innerHTML="<a href='' disabled='disabled'></a><select disabled='disabled'><option/></select>";var t=f.createElement("input");t.setAttribute("type","hidden"),e.appendChild(t).setAttribute("name","D"),e.querySelectorAll("[name=d]").length&&g.push("name"+L+"*[*^$|!~]?="),2!==e.querySelectorAll(":enabled").length&&g.push(":enabled",":disabled"),p.appendChild(e).disabled=!0,2!==e.querySelectorAll(":disabled").length&&g.push(":enabled",":disabled"),e.querySelectorAll("*,:x"),g.push(",.*:")}))),(n.matchesSelector=Z.test(v=p.matches||p.webkitMatchesSelector||p.mozMatchesSelector||p.oMatchesSelector||p.msMatchesSelector))&&ue((function(e){n.disconnectedMatch=v.call(e,"*"),v.call(e,"[s!='']:x"),y.push("!=",j)})),n.cssHas||g.push(":has"),g=g.length&&new RegExp(g.join("|")),y=y.length&&new RegExp(y.join("|")),t=Z.test(p.compareDocumentPosition),b=t||Z.test(p.contains)?function(e,t){var n=9===e.nodeType&&e.documentElement||e,i=t&&t.parentNode;return e===i||!(!i||1!==i.nodeType||!(n.contains?n.contains(i):e.compareDocumentPosition&&16&e.compareDocumentPosition(i)))}:function(e,t){if(t)for(;t=t.parentNode;)if(t===e)return!0;return!1},k=t?function(e,t){if(e===t)return h=!0,0;var i=!e.compareDocumentPosition-!t.compareDocumentPosition;return i||(1&(i=(e.ownerDocument||e)==(t.ownerDocument||t)?e.compareDocumentPosition(t):1)||!n.sortDetached&&t.compareDocumentPosition(e)===i?e==f||e.ownerDocument==w&&b(w,e)?-1:t==f||t.ownerDocument==w&&b(w,t)?1:u?O(u,e)-O(u,t):0:4&i?-1:1)}:function(e,t){if(e===t)return h=!0,0;var n,i=0,r=e.parentNode,o=t.parentNode,s=[e],a=[t];if(!r||!o)return e==f?-1:t==f?1:r?-1:o?1:u?O(u,e)-O(u,t):0;if(r===o)return de(e,t);for(n=e;n=n.parentNode;)s.unshift(n);for(n=t;n=n.parentNode;)a.unshift(n);for(;s[i]===a[i];)i++;return i?de(s[i],a[i]):s[i]==w?-1:a[i]==w?1:0},f):f},ae.matches=function(e,t){return ae(e,null,null,t)},ae.matchesSelector=function(e,t){if(d(e),n.matchesSelector&&m&&!C[t+" "]&&(!y||!y.test(t))&&(!g||!g.test(t)))try{var i=v.call(e,t);if(i||n.disconnectedMatch||e.document&&11!==e.document.nodeType)return i}catch(e){C(t,!0)}return ae(t,f,null,[e]).length>0},ae.contains=function(e,t){return(e.ownerDocument||e)!=f&&d(e),b(e,t)},ae.attr=function(e,t){(e.ownerDocument||e)!=f&&d(e);var r=i.attrHandle[t.toLowerCase()],o=r&&E.call(i.attrHandle,t.toLowerCase())?r(e,t,!m):void 0;return void 0!==o?o:n.attributes||!m?e.getAttribute(t):(o=e.getAttributeNode(t))&&o.specified?o.value:null},ae.escape=function(e){return(e+"").replace(ie,re)},ae.error=function(e){throw new Error("Syntax error, unrecognized expression: "+e)},ae.uniqueSort=function(e){var t,i=[],r=0,o=0;if(h=!n.detectDuplicates,u=!n.sortStable&&e.slice(0),e.sort(k),h){for(;t=e[o++];)t===e[o]&&(r=i.push(o));for(;r--;)e.splice(i[r],1)}return u=null,e},r=ae.getText=function(e){var t,n="",i=0,o=e.nodeType;if(o){if(1===o||9===o||11===o){if("string"==typeof e.textContent)return e.textContent;for(e=e.firstChild;e;e=e.nextSibling)n+=r(e)}else if(3===o||4===o)return e.nodeValue}else for(;t=e[i++];)n+=r(t);return n},i=ae.selectors={cacheLength:50,createPseudo:ce,match:X,attrHandle:{},find:{},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(e){return e[1]=e[1].replace(te,ne),e[3]=(e[3]||e[4]||e[5]||"").replace(te,ne),"~="===e[2]&&(e[3]=" "+e[3]+" "),e.slice(0,4)},CHILD:function(e){return e[1]=e[1].toLowerCase(),"nth"===e[1].slice(0,3)?(e[3]||ae.error(e[0]),e[4]=+(e[4]?e[5]+(e[6]||1):2*("even"===e[3]||"odd"===e[3])),e[5]=+(e[7]+e[8]||"odd"===e[3])):e[3]&&ae.error(e[0]),e},PSEUDO:function(e){var t,n=!e[6]&&e[2];return X.CHILD.test(e[0])?null:(e[3]?e[2]=e[4]||e[5]||"":n&&U.test(n)&&(t=s(n,!0))&&(t=n.indexOf(")",n.length-t)-n.length)&&(e[0]=e[0].slice(0,t),e[2]=n.slice(0,t)),e.slice(0,3))}},filter:{TAG:function(e){var t=e.replace(te,ne).toLowerCase();return"*"===e?function(){return!0}:function(e){return e.nodeName&&e.nodeName.toLowerCase()===t}},CLASS:function(e){var t=D[e+" "];return t||(t=new RegExp("(^|"+L+")"+e+"("+L+"|$)"))&&D(e,(function(e){return t.test("string"==typeof e.className&&e.className||void 0!==e.getAttribute&&e.getAttribute("class")||"")}))},ATTR:function(e,t,n){return function(i){var r=ae.attr(i,e);return null==r?"!="===t:!t||(r+="","="===t?r===n:"!="===t?r!==n:"^="===t?n&&0===r.indexOf(n):"*="===t?n&&r.indexOf(n)>-1:"$="===t?n&&r.slice(-n.length)===n:"~="===t?(" "+r.replace(H," ")+" ").indexOf(n)>-1:"|="===t&&(r===n||r.slice(0,n.length+1)===n+"-"))}},CHILD:function(e,t,n,i,r){var o="nth"!==e.slice(0,3),s="last"!==e.slice(-4),a="of-type"===t;return 1===i&&0===r?function(e){return!!e.parentNode}:function(t,n,l){var c,u,h,d,f,p,m=o!==s?"nextSibling":"previousSibling",g=t.parentNode,y=a&&t.nodeName.toLowerCase(),v=!l&&!a,b=!1;if(g){if(o){for(;m;){for(d=t;d=d[m];)if(a?d.nodeName.toLowerCase()===y:1===d.nodeType)return!1;p=m="only"===e&&!p&&"nextSibling"}return!0}if(p=[s?g.firstChild:g.lastChild],s&&v){for(b=(f=(c=(u=(h=(d=g)[x]||(d[x]={}))[d.uniqueID]||(h[d.uniqueID]={}))[e]||[])[0]===q&&c[1])&&c[2],d=f&&g.childNodes[f];d=++f&&d&&d[m]||(b=f=0)||p.pop();)if(1===d.nodeType&&++b&&d===t){u[e]=[q,f,b];break}}else if(v&&(b=f=(c=(u=(h=(d=t)[x]||(d[x]={}))[d.uniqueID]||(h[d.uniqueID]={}))[e]||[])[0]===q&&c[1]),!1===b)for(;(d=++f&&d&&d[m]||(b=f=0)||p.pop())&&((a?d.nodeName.toLowerCase()!==y:1!==d.nodeType)||!++b||(v&&((u=(h=d[x]||(d[x]={}))[d.uniqueID]||(h[d.uniqueID]={}))[e]=[q,b]),d!==t)););return(b-=r)===i||b%i==0&&b/i>=0}}},PSEUDO:function(e,t){var n,r=i.pseudos[e]||i.setFilters[e.toLowerCase()]||ae.error("unsupported pseudo: "+e);return r[x]?r(t):r.length>1?(n=[e,e,"",t],i.setFilters.hasOwnProperty(e.toLowerCase())?ce((function(e,n){for(var i,o=r(e,t),s=o.length;s--;)e[i=O(e,o[s])]=!(n[i]=o[s])})):function(e){return r(e,0,n)}):r}},pseudos:{not:ce((function(e){var t=[],n=[],i=a(e.replace(B,"$1"));return i[x]?ce((function(e,t,n,r){for(var o,s=i(e,null,r,[]),a=e.length;a--;)(o=s[a])&&(e[a]=!(t[a]=o))})):function(e,r,o){return t[0]=e,i(t,null,o,n),t[0]=null,!n.pop()}})),has:ce((function(e){return function(t){return ae(e,t).length>0}})),contains:ce((function(e){return e=e.replace(te,ne),function(t){return(t.textContent||r(t)).indexOf(e)>-1}})),lang:ce((function(e){return Y.test(e||"")||ae.error("unsupported lang: "+e),e=e.replace(te,ne).toLowerCase(),function(t){var n;do{if(n=m?t.lang:t.getAttribute("xml:lang")||t.getAttribute("lang"))return(n=n.toLowerCase())===e||0===n.indexOf(e+"-")}while((t=t.parentNode)&&1===t.nodeType);return!1}})),target:function(t){var n=e.location&&e.location.hash;return n&&n.slice(1)===t.id},root:function(e){return e===p},focus:function(e){return e===f.activeElement&&(!f.hasFocus||f.hasFocus())&&!!(e.type||e.href||~e.tabIndex)},enabled:me(!1),disabled:me(!0),checked:function(e){var t=e.nodeName.toLowerCase();return"input"===t&&!!e.checked||"option"===t&&!!e.selected},selected:function(e){return e.parentNode&&e.parentNode.selectedIndex,!0===e.selected},empty:function(e){for(e=e.firstChild;e;e=e.nextSibling)if(e.nodeType<6)return!1;return!0},parent:function(e){return!i.pseudos.empty(e)},header:function(e){return J.test(e.nodeName)},input:function(e){return G.test(e.nodeName)},button:function(e){var t=e.nodeName.toLowerCase();return"input"===t&&"button"===e.type||"button"===t},text:function(e){var t;return"input"===e.nodeName.toLowerCase()&&"text"===e.type&&(null==(t=e.getAttribute("type"))||"text"===t.toLowerCase())},first:ge((function(){return[0]})),last:ge((function(e,t){return[t-1]})),eq:ge((function(e,t,n){return[n<0?n+t:n]})),even:ge((function(e,t){for(var n=0;n<t;n+=2)e.push(n);return e})),odd:ge((function(e,t){for(var n=1;n<t;n+=2)e.push(n);return e})),lt:ge((function(e,t,n){for(var i=n<0?n+t:n>t?t:n;--i>=0;)e.push(i);return e})),gt:ge((function(e,t,n){for(var i=n<0?n+t:n;++i<t;)e.push(i);return e}))}},i.pseudos.nth=i.pseudos.eq,{radio:!0,checkbox:!0,file:!0,password:!0,image:!0})i.pseudos[t]=fe(t);for(t in{submit:!0,reset:!0})i.pseudos[t]=pe(t);function ve(){}function be(e){for(var t=0,n=e.length,i="";t<n;t++)i+=e[t].value;return i}function xe(e,t,n){var i=t.dir,r=t.next,o=r||i,s=n&&"parentNode"===o,a=M++;return t.first?function(t,n,r){for(;t=t[i];)if(1===t.nodeType||s)return e(t,n,r);return!1}:function(t,n,l){var c,u,h,d=[q,a];if(l){for(;t=t[i];)if((1===t.nodeType||s)&&e(t,n,l))return!0}else for(;t=t[i];)if(1===t.nodeType||s)if(u=(h=t[x]||(t[x]={}))[t.uniqueID]||(h[t.uniqueID]={}),r&&r===t.nodeName.toLowerCase())t=t[i]||t;else{if((c=u[o])&&c[0]===q&&c[1]===a)return d[2]=c[2];if(u[o]=d,d[2]=e(t,n,l))return!0}return!1}}function we(e){return e.length>1?function(t,n,i){for(var r=e.length;r--;)if(!e[r](t,n,i))return!1;return!0}:e[0]}function qe(e,t,n,i,r){for(var o,s=[],a=0,l=e.length,c=null!=t;a<l;a++)(o=e[a])&&(n&&!n(o,i,r)||(s.push(o),c&&t.push(a)));return s}function Me(e,t,n,i,r,o){return i&&!i[x]&&(i=Me(i)),r&&!r[x]&&(r=Me(r,o)),ce((function(o,s,a,l){var c,u,h,d=[],f=[],p=s.length,m=o||function(e,t,n){for(var i=0,r=t.length;i<r;i++)ae(e,t[i],n);return n}(t||"*",a.nodeType?[a]:a,[]),g=!e||!o&&t?m:qe(m,d,e,a,l),y=n?r||(o?e:p||i)?[]:s:g;if(n&&n(g,y,a,l),i)for(c=qe(y,f),i(c,[],a,l),u=c.length;u--;)(h=c[u])&&(y[f[u]]=!(g[f[u]]=h));if(o){if(r||e){if(r){for(c=[],u=y.length;u--;)(h=y[u])&&c.push(g[u]=h);r(null,y=[],c,l)}for(u=y.length;u--;)(h=y[u])&&(c=r?O(o,h):d[u])>-1&&(o[c]=!(s[c]=h))}}else y=qe(y===s?y.splice(p,y.length):y),r?r(null,s,y,l):R.apply(s,y)}))}function De(e){for(var t,n,r,o=e.length,s=i.relative[e[0].type],a=s||i.relative[" "],l=s?1:0,u=xe((function(e){return e===t}),a,!0),h=xe((function(e){return O(t,e)>-1}),a,!0),d=[function(e,n,i){var r=!s&&(i||n!==c)||((t=n).nodeType?u(e,n,i):h(e,n,i));return t=null,r}];l<o;l++)if(n=i.relative[e[l].type])d=[xe(we(d),n)];else{if((n=i.filter[e[l].type].apply(null,e[l].matches))[x]){for(r=++l;r<o&&!i.relative[e[r].type];r++);return Me(l>1&&we(d),l>1&&be(e.slice(0,l-1).concat({value:" "===e[l-2].type?"*":""})).replace(B,"$1"),n,l<r&&De(e.slice(l,r)),r<o&&De(e=e.slice(r)),r<o&&be(e))}d.push(n)}return we(d)}return ve.prototype=i.filters=i.pseudos,i.setFilters=new ve,s=ae.tokenize=function(e,t){var n,r,o,s,a,l,c,u=S[e+" "];if(u)return t?0:u.slice(0);for(a=e,l=[],c=i.preFilter;a;){for(s in n&&!(r=V.exec(a))||(r&&(a=a.slice(r[0].length)||a),l.push(o=[])),n=!1,(r=$.exec(a))&&(n=r.shift(),o.push({value:n,type:r[0].replace(B," ")}),a=a.slice(n.length)),i.filter)!(r=X[s].exec(a))||c[s]&&!(r=c[s](r))||(n=r.shift(),o.push({value:n,type:s,matches:r}),a=a.slice(n.length));if(!n)break}return t?a.length:a?ae.error(e):S(e,l).slice(0)},a=ae.compile=function(e,t){var n,r=[],o=[],a=_[e+" "];if(!a){for(t||(t=s(e)),n=t.length;n--;)(a=De(t[n]))[x]?r.push(a):o.push(a);a=_(e,function(e,t){var n=t.length>0,r=e.length>0,o=function(o,s,a,l,u){var h,p,g,y=0,v="0",b=o&&[],x=[],w=c,M=o||r&&i.find.TAG("*",u),D=q+=null==w?1:Math.random()||.1,S=M.length;for(u&&(c=s==f||s||u);v!==S&&null!=(h=M[v]);v++){if(r&&h){for(p=0,s||h.ownerDocument==f||(d(h),a=!m);g=e[p++];)if(g(h,s||f,a)){l.push(h);break}u&&(q=D)}n&&((h=!g&&h)&&y--,o&&b.push(h))}if(y+=v,n&&v!==y){for(p=0;g=t[p++];)g(b,x,s,a);if(o){if(y>0)for(;v--;)b[v]||x[v]||(x[v]=T.call(l));x=qe(x)}R.apply(l,x),u&&!o&&x.length>0&&y+t.length>1&&ae.uniqueSort(l)}return u&&(q=D,c=w),b};return n?ce(o):o}(o,r)),a.selector=e}return a},l=ae.select=function(e,t,n,r){var o,l,c,u,h,d="function"==typeof e&&e,f=!r&&s(e=d.selector||e);if(n=n||[],1===f.length){if((l=f[0]=f[0].slice(0)).length>2&&"ID"===(c=l[0]).type&&9===t.nodeType&&m&&i.relative[l[1].type]){if(!(t=(i.find.ID(c.matches[0].replace(te,ne),t)||[])[0]))return n;d&&(t=t.parentNode),e=e.slice(l.shift().value.length)}for(o=X.needsContext.test(e)?0:l.length;o--&&(c=l[o],!i.relative[u=c.type]);)if((h=i.find[u])&&(r=h(c.matches[0].replace(te,ne),ee.test(l[0].type)&&ye(t.parentNode)||t))){if(l.splice(o,1),!(e=r.length&&be(l)))return R.apply(n,r),n;break}}return(d||a(e,f))(r,t,!m,n,!t||ee.test(e)&&ye(t.parentNode)||t),n},n.sortStable=x.split("").sort(k).join("")===x,n.detectDuplicates=!!h,d(),n.sortDetached=ue((function(e){return 1&e.compareDocumentPosition(f.createElement("fieldset"))})),ue((function(e){return e.innerHTML="<a href='#'></a>","#"===e.firstChild.getAttribute("href")}))||he("type|href|height|width",(function(e,t,n){if(!n)return e.getAttribute(t,"type"===t.toLowerCase()?1:2)})),n.attributes&&ue((function(e){return e.innerHTML="<input/>",e.firstChild.setAttribute("value",""),""===e.firstChild.getAttribute("value")}))||he("value",(function(e,t,n){if(!n&&"input"===e.nodeName.toLowerCase())return e.defaultValue})),ue((function(e){return null==e.getAttribute("disabled")}))||he(P,(function(e,t,n){var i;if(!n)return!0===e[t]?t.toLowerCase():(i=e.getAttributeNode(t))&&i.specified?i.value:null})),ae}(e);w.find=M,w.expr=M.selectors,w.expr[":"]=w.expr.pseudos,w.uniqueSort=w.unique=M.uniqueSort,w.text=M.getText,w.isXMLDoc=M.isXML,w.contains=M.contains,w.escapeSelector=M.escape;var D=function(e,t,n){for(var i=[],r=void 0!==n;(e=e[t])&&9!==e.nodeType;)if(1===e.nodeType){if(r&&w(e).is(n))break;i.push(e)}return i},S=function(e,t){for(var n=[];e;e=e.nextSibling)1===e.nodeType&&e!==t&&n.push(e);return n},_=w.expr.match.needsContext;function C(e,t){return e.nodeName&&e.nodeName.toLowerCase()===t.toLowerCase()}var k=/^<([a-z][^\/\0>:\x20\t\r\n\f]*)[\x20\t\r\n\f]*\/?>(?:<\/\1>|)$/i;function E(e,t,n){return p(t)?w.grep(e,(function(e,i){return!!t.call(e,i,e)!==n})):t.nodeType?w.grep(e,(function(e){return e===t!==n})):"string"!=typeof t?w.grep(e,(function(e){return a.call(t,e)>-1!==n})):w.filter(t,e,n)}w.filter=function(e,t,n){var i=t[0];return n&&(e=":not("+e+")"),1===t.length&&1===i.nodeType?w.find.matchesSelector(i,e)?[i]:[]:w.find.matches(e,w.grep(t,(function(e){return 1===e.nodeType})))},w.fn.extend({find:function(e){var t,n,i=this.length,r=this;if("string"!=typeof e)return this.pushStack(w(e).filter((function(){for(t=0;t<i;t++)if(w.contains(r[t],this))return!0})));for(n=this.pushStack([]),t=0;t<i;t++)w.find(e,r[t],n);return i>1?w.uniqueSort(n):n},filter:function(e){return this.pushStack(E(this,e||[],!1))},not:function(e){return this.pushStack(E(this,e||[],!0))},is:function(e){return!!E(this,"string"==typeof e&&_.test(e)?w(e):e||[],!1).length}});var A,T=/^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]+))$/,I=w.fn.init=function(e,t,n){var i,r;if(!e)return this;if(n=n||A,"string"==typeof e){if(!(i="<"===e[0]&&">"===e[e.length-1]&&e.length>=3?[null,e,null]:T.exec(e))||!i[1]&&t)return!t||t.jquery?(t||n).find(e):this.constructor(t).find(e);if(i[1]){if(t=t instanceof w?t[0]:t,w.merge(this,w.parseHTML(i[1],t&&t.nodeType?t.ownerDocument||t:g,!0)),k.test(i[1])&&w.isPlainObject(t))for(i in t)p(this[i])?this[i](t[i]):this.attr(i,t[i]);return this}return(r=g.getElementById(i[2]))&&(this[0]=r,this.length=1),this}return e.nodeType?(this[0]=e,this.length=1,this):p(e)?void 0!==n.ready?n.ready(e):e(w):w.makeArray(e,this)};I.prototype=w.fn,A=w(g);var R=/^(?:parents|prev(?:Until|All))/,N={children:!0,contents:!0,next:!0,prev:!0};function O(e,t){for(;(e=e[t])&&1!==e.nodeType;);return e}w.fn.extend({has:function(e){var t=w(e,this),n=t.length;return this.filter((function(){for(var e=0;e<n;e++)if(w.contains(this,t[e]))return!0}))},closest:function(e,t){var n,i=0,r=this.length,o=[],s="string"!=typeof e&&w(e);if(!_.test(e))for(;i<r;i++)for(n=this[i];n&&n!==t;n=n.parentNode)if(n.nodeType<11&&(s?s.index(n)>-1:1===n.nodeType&&w.find.matchesSelector(n,e))){o.push(n);break}return this.pushStack(o.length>1?w.uniqueSort(o):o)},index:function(e){return e?"string"==typeof e?a.call(w(e),this[0]):a.call(this,e.jquery?e[0]:e):this[0]&&this[0].parentNode?this.first().prevAll().length:-1},add:function(e,t){return this.pushStack(w.uniqueSort(w.merge(this.get(),w(e,t))))},addBack:function(e){return this.add(null==e?this.prevObject:this.prevObject.filter(e))}}),w.each({parent:function(e){var t=e.parentNode;return t&&11!==t.nodeType?t:null},parents:function(e){return D(e,"parentNode")},parentsUntil:function(e,t,n){return D(e,"parentNode",n)},next:function(e){return O(e,"nextSibling")},prev:function(e){return O(e,"previousSibling")},nextAll:function(e){return D(e,"nextSibling")},prevAll:function(e){return D(e,"previousSibling")},nextUntil:function(e,t,n){return D(e,"nextSibling",n)},prevUntil:function(e,t,n){return D(e,"previousSibling",n)},siblings:function(e){return S((e.parentNode||{}).firstChild,e)},children:function(e){return S(e.firstChild)},contents:function(e){return null!=e.contentDocument&&i(e.contentDocument)?e.contentDocument:(C(e,"template")&&(e=e.content||e),w.merge([],e.childNodes))}},(function(e,t){w.fn[e]=function(n,i){var r=w.map(this,t,n);return"Until"!==e.slice(-5)&&(i=n),i&&"string"==typeof i&&(r=w.filter(i,r)),this.length>1&&(N[e]||w.uniqueSort(r),R.test(e)&&r.reverse()),this.pushStack(r)}}));var P=/[^\x20\t\r\n\f]+/g;function L(e){return e}function F(e){throw e}function z(e,t,n,i){var r;try{e&&p(r=e.promise)?r.call(e).done(t).fail(n):e&&p(r=e.then)?r.call(e,t,n):t.apply(void 0,[e].slice(i))}catch(e){n.apply(void 0,[e])}}w.Callbacks=function(e){e="string"==typeof e?function(e){var t={};return w.each(e.match(P)||[],(function(e,n){t[n]=!0})),t}(e):w.extend({},e);var t,n,i,r,o=[],s=[],a=-1,l=function(){for(r=r||e.once,i=t=!0;s.length;a=-1)for(n=s.shift();++a<o.length;)!1===o[a].apply(n[0],n[1])&&e.stopOnFalse&&(a=o.length,n=!1);e.memory||(n=!1),t=!1,r&&(o=n?[]:"")},c={add:function(){return o&&(n&&!t&&(a=o.length-1,s.push(n)),function t(n){w.each(n,(function(n,i){p(i)?e.unique&&c.has(i)||o.push(i):i&&i.length&&"string"!==b(i)&&t(i)}))}(arguments),n&&!t&&l()),this},remove:function(){return w.each(arguments,(function(e,t){for(var n;(n=w.inArray(t,o,n))>-1;)o.splice(n,1),n<=a&&a--})),this},has:function(e){return e?w.inArray(e,o)>-1:o.length>0},empty:function(){return o&&(o=[]),this},disable:function(){return r=s=[],o=n="",this},disabled:function(){return!o},lock:function(){return r=s=[],n||t||(o=n=""),this},locked:function(){return!!r},fireWith:function(e,n){return r||(n=[e,(n=n||[]).slice?n.slice():n],s.push(n),t||l()),this},fire:function(){return c.fireWith(this,arguments),this},fired:function(){return!!i}};return c},w.extend({Deferred:function(t){var n=[["notify","progress",w.Callbacks("memory"),w.Callbacks("memory"),2],["resolve","done",w.Callbacks("once memory"),w.Callbacks("once memory"),0,"resolved"],["reject","fail",w.Callbacks("once memory"),w.Callbacks("once memory"),1,"rejected"]],i="pending",r={state:function(){return i},always:function(){return o.done(arguments).fail(arguments),this},catch:function(e){return r.then(null,e)},pipe:function(){var e=arguments;return w.Deferred((function(t){w.each(n,(function(n,i){var r=p(e[i[4]])&&e[i[4]];o[i[1]]((function(){var e=r&&r.apply(this,arguments);e&&p(e.promise)?e.promise().progress(t.notify).done(t.resolve).fail(t.reject):t[i[0]+"With"](this,r?[e]:arguments)}))})),e=null})).promise()},then:function(t,i,r){var o=0;function s(t,n,i,r){return function(){var a=this,l=arguments,c=function(){var e,c;if(!(t<o)){if((e=i.apply(a,l))===n.promise())throw new TypeError("Thenable self-resolution");c=e&&("object"==typeof e||"function"==typeof e)&&e.then,p(c)?r?c.call(e,s(o,n,L,r),s(o,n,F,r)):(o++,c.call(e,s(o,n,L,r),s(o,n,F,r),s(o,n,L,n.notifyWith))):(i!==L&&(a=void 0,l=[e]),(r||n.resolveWith)(a,l))}},u=r?c:function(){try{c()}catch(e){w.Deferred.exceptionHook&&w.Deferred.exceptionHook(e,u.stackTrace),t+1>=o&&(i!==F&&(a=void 0,l=[e]),n.rejectWith(a,l))}};t?u():(w.Deferred.getStackHook&&(u.stackTrace=w.Deferred.getStackHook()),e.setTimeout(u))}}return w.Deferred((function(e){n[0][3].add(s(0,e,p(r)?r:L,e.notifyWith)),n[1][3].add(s(0,e,p(t)?t:L)),n[2][3].add(s(0,e,p(i)?i:F))})).promise()},promise:function(e){return null!=e?w.extend(e,r):r}},o={};return w.each(n,(function(e,t){var s=t[2],a=t[5];r[t[1]]=s.add,a&&s.add((function(){i=a}),n[3-e][2].disable,n[3-e][3].disable,n[0][2].lock,n[0][3].lock),s.add(t[3].fire),o[t[0]]=function(){return o[t[0]+"With"](this===o?void 0:this,arguments),this},o[t[0]+"With"]=s.fireWith})),r.promise(o),t&&t.call(o,o),o},when:function(e){var t=arguments.length,n=t,i=Array(n),o=r.call(arguments),s=w.Deferred(),a=function(e){return function(n){i[e]=this,o[e]=arguments.length>1?r.call(arguments):n,--t||s.resolveWith(i,o)}};if(t<=1&&(z(e,s.done(a(n)).resolve,s.reject,!t),"pending"===s.state()||p(o[n]&&o[n].then)))return s.then();for(;n--;)z(o[n],a(n),s.reject);return s.promise()}});var j=/^(Eval|Internal|Range|Reference|Syntax|Type|URI)Error$/;w.Deferred.exceptionHook=function(t,n){e.console&&e.console.warn&&t&&j.test(t.name)&&e.console.warn("jQuery.Deferred exception: "+t.message,t.stack,n)},w.readyException=function(t){e.setTimeout((function(){throw t}))};var H=w.Deferred();function B(){g.removeEventListener("DOMContentLoaded",B),e.removeEventListener("load",B),w.ready()}w.fn.ready=function(e){return H.then(e).catch((function(e){w.readyException(e)})),this},w.extend({isReady:!1,readyWait:1,ready:function(e){(!0===e?--w.readyWait:w.isReady)||(w.isReady=!0,!0!==e&&--w.readyWait>0||H.resolveWith(g,[w]))}}),w.ready.then=H.then,"complete"===g.readyState||"loading"!==g.readyState&&!g.documentElement.doScroll?e.setTimeout(w.ready):(g.addEventListener("DOMContentLoaded",B),e.addEventListener("load",B));var V=function(e,t,n,i,r,o,s){var a=0,l=e.length,c=null==n;if("object"===b(n))for(a in r=!0,n)V(e,t,a,n[a],!0,o,s);else if(void 0!==i&&(r=!0,p(i)||(s=!0),c&&(s?(t.call(e,i),t=null):(c=t,t=function(e,t,n){return c.call(w(e),n)})),t))for(;a<l;a++)t(e[a],n,s?i:i.call(e[a],a,t(e[a],n)));return r?e:c?t.call(e):l?t(e[0],n):o},$=/^-ms-/,W=/-([a-z])/g;function U(e,t){return t.toUpperCase()}function Y(e){return e.replace($,"ms-").replace(W,U)}var X=function(e){return 1===e.nodeType||9===e.nodeType||!+e.nodeType};function K(){this.expando=w.expando+K.uid++}K.uid=1,K.prototype={cache:function(e){var t=e[this.expando];return t||(t={},X(e)&&(e.nodeType?e[this.expando]=t:Object.defineProperty(e,this.expando,{value:t,configurable:!0}))),t},set:function(e,t,n){var i,r=this.cache(e);if("string"==typeof t)r[Y(t)]=n;else for(i in t)r[Y(i)]=t[i];return r},get:function(e,t){return void 0===t?this.cache(e):e[this.expando]&&e[this.expando][Y(t)]},access:function(e,t,n){return void 0===t||t&&"string"==typeof t&&void 0===n?this.get(e,t):(this.set(e,t,n),void 0!==n?n:t)},remove:function(e,t){var n,i=e[this.expando];if(void 0!==i){if(void 0!==t){n=(t=Array.isArray(t)?t.map(Y):(t=Y(t))in i?[t]:t.match(P)||[]).length;for(;n--;)delete i[t[n]]}(void 0===t||w.isEmptyObject(i))&&(e.nodeType?e[this.expando]=void 0:delete e[this.expando])}},hasData:function(e){var t=e[this.expando];return void 0!==t&&!w.isEmptyObject(t)}};var G=new K,J=new K,Z=/^(?:\{[\w\W]*\}|\[[\w\W]*\])$/,Q=/[A-Z]/g;function ee(e,t,n){var i;if(void 0===n&&1===e.nodeType)if(i="data-"+t.replace(Q,"-$&").toLowerCase(),"string"==typeof(n=e.getAttribute(i))){try{n=function(e){return"true"===e||"false"!==e&&("null"===e?null:e===+e+""?+e:Z.test(e)?JSON.parse(e):e)}(n)}catch(e){}J.set(e,t,n)}else n=void 0;return n}w.extend({hasData:function(e){return J.hasData(e)||G.hasData(e)},data:function(e,t,n){return J.access(e,t,n)},removeData:function(e,t){J.remove(e,t)},_data:function(e,t,n){return G.access(e,t,n)},_removeData:function(e,t){G.remove(e,t)}}),w.fn.extend({data:function(e,t){var n,i,r,o=this[0],s=o&&o.attributes;if(void 0===e){if(this.length&&(r=J.get(o),1===o.nodeType&&!G.get(o,"hasDataAttrs"))){for(n=s.length;n--;)s[n]&&0===(i=s[n].name).indexOf("data-")&&(i=Y(i.slice(5)),ee(o,i,r[i]));G.set(o,"hasDataAttrs",!0)}return r}return"object"==typeof e?this.each((function(){J.set(this,e)})):V(this,(function(t){var n;if(o&&void 0===t)return void 0!==(n=J.get(o,e))||void 0!==(n=ee(o,e))?n:void 0;this.each((function(){J.set(this,e,t)}))}),null,t,arguments.length>1,null,!0)},removeData:function(e){return this.each((function(){J.remove(this,e)}))}}),w.extend({queue:function(e,t,n){var i;if(e)return t=(t||"fx")+"queue",i=G.get(e,t),n&&(!i||Array.isArray(n)?i=G.access(e,t,w.makeArray(n)):i.push(n)),i||[]},dequeue:function(e,t){t=t||"fx";var n=w.queue(e,t),i=n.length,r=n.shift(),o=w._queueHooks(e,t);"inprogress"===r&&(r=n.shift(),i--),r&&("fx"===t&&n.unshift("inprogress"),delete o.stop,r.call(e,(function(){w.dequeue(e,t)}),o)),!i&&o&&o.empty.fire()},_queueHooks:function(e,t){var n=t+"queueHooks";return G.get(e,n)||G.access(e,n,{empty:w.Callbacks("once memory").add((function(){G.remove(e,[t+"queue",n])}))})}}),w.fn.extend({queue:function(e,t){var n=2;return"string"!=typeof e&&(t=e,e="fx",n--),arguments.length<n?w.queue(this[0],e):void 0===t?this:this.each((function(){var n=w.queue(this,e,t);w._queueHooks(this,e),"fx"===e&&"inprogress"!==n[0]&&w.dequeue(this,e)}))},dequeue:function(e){return this.each((function(){w.dequeue(this,e)}))},clearQueue:function(e){return this.queue(e||"fx",[])},promise:function(e,t){var n,i=1,r=w.Deferred(),o=this,s=this.length,a=function(){--i||r.resolveWith(o,[o])};for("string"!=typeof e&&(t=e,e=void 0),e=e||"fx";s--;)(n=G.get(o[s],e+"queueHooks"))&&n.empty&&(i++,n.empty.add(a));return a(),r.promise(t)}});var te=/[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/.source,ne=new RegExp("^(?:([+-])=|)("+te+")([a-z%]*)$","i"),ie=["Top","Right","Bottom","Left"],re=g.documentElement,oe=function(e){return w.contains(e.ownerDocument,e)},se={composed:!0};re.getRootNode&&(oe=function(e){return w.contains(e.ownerDocument,e)||e.getRootNode(se)===e.ownerDocument});var ae=function(e,t){return"none"===(e=t||e).style.display||""===e.style.display&&oe(e)&&"none"===w.css(e,"display")};function le(e,t,n,i){var r,o,s=20,a=i?function(){return i.cur()}:function(){return w.css(e,t,"")},l=a(),c=n&&n[3]||(w.cssNumber[t]?"":"px"),u=e.nodeType&&(w.cssNumber[t]||"px"!==c&&+l)&&ne.exec(w.css(e,t));if(u&&u[3]!==c){for(l/=2,c=c||u[3],u=+l||1;s--;)w.style(e,t,u+c),(1-o)*(1-(o=a()/l||.5))<=0&&(s=0),u/=o;u*=2,w.style(e,t,u+c),n=n||[]}return n&&(u=+u||+l||0,r=n[1]?u+(n[1]+1)*n[2]:+n[2],i&&(i.unit=c,i.start=u,i.end=r)),r}var ce={};function ue(e){var t,n=e.ownerDocument,i=e.nodeName,r=ce[i];return r||(t=n.body.appendChild(n.createElement(i)),r=w.css(t,"display"),t.parentNode.removeChild(t),"none"===r&&(r="block"),ce[i]=r,r)}function he(e,t){for(var n,i,r=[],o=0,s=e.length;o<s;o++)(i=e[o]).style&&(n=i.style.display,t?("none"===n&&(r[o]=G.get(i,"display")||null,r[o]||(i.style.display="")),""===i.style.display&&ae(i)&&(r[o]=ue(i))):"none"!==n&&(r[o]="none",G.set(i,"display",n)));for(o=0;o<s;o++)null!=r[o]&&(e[o].style.display=r[o]);return e}w.fn.extend({show:function(){return he(this,!0)},hide:function(){return he(this)},toggle:function(e){return"boolean"==typeof e?e?this.show():this.hide():this.each((function(){ae(this)?w(this).show():w(this).hide()}))}});var de,fe,pe=/^(?:checkbox|radio)$/i,me=/<([a-z][^\/\0>\x20\t\r\n\f]*)/i,ge=/^$|^module$|\/(?:java|ecma)script/i;de=g.createDocumentFragment().appendChild(g.createElement("div")),(fe=g.createElement("input")).setAttribute("type","radio"),fe.setAttribute("checked","checked"),fe.setAttribute("name","t"),de.appendChild(fe),f.checkClone=de.cloneNode(!0).cloneNode(!0).lastChild.checked,de.innerHTML="<textarea>x</textarea>",f.noCloneChecked=!!de.cloneNode(!0).lastChild.defaultValue,de.innerHTML="<option></option>",f.option=!!de.lastChild;var ye={thead:[1,"<table>","</table>"],col:[2,"<table><colgroup>","</colgroup></table>"],tr:[2,"<table><tbody>","</tbody></table>"],td:[3,"<table><tbody><tr>","</tr></tbody></table>"],_default:[0,"",""]};function ve(e,t){var n;return n=void 0!==e.getElementsByTagName?e.getElementsByTagName(t||"*"):void 0!==e.querySelectorAll?e.querySelectorAll(t||"*"):[],void 0===t||t&&C(e,t)?w.merge([e],n):n}function be(e,t){for(var n=0,i=e.length;n<i;n++)G.set(e[n],"globalEval",!t||G.get(t[n],"globalEval"))}ye.tbody=ye.tfoot=ye.colgroup=ye.caption=ye.thead,ye.th=ye.td,f.option||(ye.optgroup=ye.option=[1,"<select multiple='multiple'>","</select>"]);var xe=/<|&#?\w+;/;function we(e,t,n,i,r){for(var o,s,a,l,c,u,h=t.createDocumentFragment(),d=[],f=0,p=e.length;f<p;f++)if((o=e[f])||0===o)if("object"===b(o))w.merge(d,o.nodeType?[o]:o);else if(xe.test(o)){for(s=s||h.appendChild(t.createElement("div")),a=(me.exec(o)||["",""])[1].toLowerCase(),l=ye[a]||ye._default,s.innerHTML=l[1]+w.htmlPrefilter(o)+l[2],u=l[0];u--;)s=s.lastChild;w.merge(d,s.childNodes),(s=h.firstChild).textContent=""}else d.push(t.createTextNode(o));for(h.textContent="",f=0;o=d[f++];)if(i&&w.inArray(o,i)>-1)r&&r.push(o);else if(c=oe(o),s=ve(h.appendChild(o),"script"),c&&be(s),n)for(u=0;o=s[u++];)ge.test(o.type||"")&&n.push(o);return h}var qe=/^([^.]*)(?:\.(.+)|)/;function Me(){return!0}function De(){return!1}function Se(e,t){return e===function(){try{return g.activeElement}catch(e){}}()==("focus"===t)}function _e(e,t,n,i,r,o){var s,a;if("object"==typeof t){for(a in"string"!=typeof n&&(i=i||n,n=void 0),t)_e(e,a,n,i,t[a],o);return e}if(null==i&&null==r?(r=n,i=n=void 0):null==r&&("string"==typeof n?(r=i,i=void 0):(r=i,i=n,n=void 0)),!1===r)r=De;else if(!r)return e;return 1===o&&(s=r,r=function(e){return w().off(e),s.apply(this,arguments)},r.guid=s.guid||(s.guid=w.guid++)),e.each((function(){w.event.add(this,t,r,i,n)}))}function Ce(e,t,n){n?(G.set(e,t,!1),w.event.add(e,t,{namespace:!1,handler:function(e){var i,o,s=G.get(this,t);if(1&e.isTrigger&&this[t]){if(s.length)(w.event.special[t]||{}).delegateType&&e.stopPropagation();else if(s=r.call(arguments),G.set(this,t,s),i=n(this,t),this[t](),s!==(o=G.get(this,t))||i?G.set(this,t,!1):o={},s!==o)return e.stopImmediatePropagation(),e.preventDefault(),o&&o.value}else s.length&&(G.set(this,t,{value:w.event.trigger(w.extend(s[0],w.Event.prototype),s.slice(1),this)}),e.stopImmediatePropagation())}})):void 0===G.get(e,t)&&w.event.add(e,t,Me)}w.event={global:{},add:function(e,t,n,i,r){var o,s,a,l,c,u,h,d,f,p,m,g=G.get(e);if(X(e))for(n.handler&&(n=(o=n).handler,r=o.selector),r&&w.find.matchesSelector(re,r),n.guid||(n.guid=w.guid++),(l=g.events)||(l=g.events=Object.create(null)),(s=g.handle)||(s=g.handle=function(t){return void 0!==w&&w.event.triggered!==t.type?w.event.dispatch.apply(e,arguments):void 0}),c=(t=(t||"").match(P)||[""]).length;c--;)f=m=(a=qe.exec(t[c])||[])[1],p=(a[2]||"").split(".").sort(),f&&(h=w.event.special[f]||{},f=(r?h.delegateType:h.bindType)||f,h=w.event.special[f]||{},u=w.extend({type:f,origType:m,data:i,handler:n,guid:n.guid,selector:r,needsContext:r&&w.expr.match.needsContext.test(r),namespace:p.join(".")},o),(d=l[f])||((d=l[f]=[]).delegateCount=0,h.setup&&!1!==h.setup.call(e,i,p,s)||e.addEventListener&&e.addEventListener(f,s)),h.add&&(h.add.call(e,u),u.handler.guid||(u.handler.guid=n.guid)),r?d.splice(d.delegateCount++,0,u):d.push(u),w.event.global[f]=!0)},remove:function(e,t,n,i,r){var o,s,a,l,c,u,h,d,f,p,m,g=G.hasData(e)&&G.get(e);if(g&&(l=g.events)){for(c=(t=(t||"").match(P)||[""]).length;c--;)if(f=m=(a=qe.exec(t[c])||[])[1],p=(a[2]||"").split(".").sort(),f){for(h=w.event.special[f]||{},d=l[f=(i?h.delegateType:h.bindType)||f]||[],a=a[2]&&new RegExp("(^|\\.)"+p.join("\\.(?:.*\\.|)")+"(\\.|$)"),s=o=d.length;o--;)u=d[o],!r&&m!==u.origType||n&&n.guid!==u.guid||a&&!a.test(u.namespace)||i&&i!==u.selector&&("**"!==i||!u.selector)||(d.splice(o,1),u.selector&&d.delegateCount--,h.remove&&h.remove.call(e,u));s&&!d.length&&(h.teardown&&!1!==h.teardown.call(e,p,g.handle)||w.removeEvent(e,f,g.handle),delete l[f])}else for(f in l)w.event.remove(e,f+t[c],n,i,!0);w.isEmptyObject(l)&&G.remove(e,"handle events")}},dispatch:function(e){var t,n,i,r,o,s,a=new Array(arguments.length),l=w.event.fix(e),c=(G.get(this,"events")||Object.create(null))[l.type]||[],u=w.event.special[l.type]||{};for(a[0]=l,t=1;t<arguments.length;t++)a[t]=arguments[t];if(l.delegateTarget=this,!u.preDispatch||!1!==u.preDispatch.call(this,l)){for(s=w.event.handlers.call(this,l,c),t=0;(r=s[t++])&&!l.isPropagationStopped();)for(l.currentTarget=r.elem,n=0;(o=r.handlers[n++])&&!l.isImmediatePropagationStopped();)l.rnamespace&&!1!==o.namespace&&!l.rnamespace.test(o.namespace)||(l.handleObj=o,l.data=o.data,void 0!==(i=((w.event.special[o.origType]||{}).handle||o.handler).apply(r.elem,a))&&!1===(l.result=i)&&(l.preventDefault(),l.stopPropagation()));return u.postDispatch&&u.postDispatch.call(this,l),l.result}},handlers:function(e,t){var n,i,r,o,s,a=[],l=t.delegateCount,c=e.target;if(l&&c.nodeType&&!("click"===e.type&&e.button>=1))for(;c!==this;c=c.parentNode||this)if(1===c.nodeType&&("click"!==e.type||!0!==c.disabled)){for(o=[],s={},n=0;n<l;n++)void 0===s[r=(i=t[n]).selector+" "]&&(s[r]=i.needsContext?w(r,this).index(c)>-1:w.find(r,this,null,[c]).length),s[r]&&o.push(i);o.length&&a.push({elem:c,handlers:o})}return c=this,l<t.length&&a.push({elem:c,handlers:t.slice(l)}),a},addProp:function(e,t){Object.defineProperty(w.Event.prototype,e,{enumerable:!0,configurable:!0,get:p(t)?function(){if(this.originalEvent)return t(this.originalEvent)}:function(){if(this.originalEvent)return this.originalEvent[e]},set:function(t){Object.defineProperty(this,e,{enumerable:!0,configurable:!0,writable:!0,value:t})}})},fix:function(e){return e[w.expando]?e:new w.Event(e)},special:{load:{noBubble:!0},click:{setup:function(e){var t=this||e;return pe.test(t.type)&&t.click&&C(t,"input")&&Ce(t,"click",Me),!1},trigger:function(e){var t=this||e;return pe.test(t.type)&&t.click&&C(t,"input")&&Ce(t,"click"),!0},_default:function(e){var t=e.target;return pe.test(t.type)&&t.click&&C(t,"input")&&G.get(t,"click")||C(t,"a")}},beforeunload:{postDispatch:function(e){void 0!==e.result&&e.originalEvent&&(e.originalEvent.returnValue=e.result)}}}},w.removeEvent=function(e,t,n){e.removeEventListener&&e.removeEventListener(t,n)},w.Event=function(e,t){if(!(this instanceof w.Event))return new w.Event(e,t);e&&e.type?(this.originalEvent=e,this.type=e.type,this.isDefaultPrevented=e.defaultPrevented||void 0===e.defaultPrevented&&!1===e.returnValue?Me:De,this.target=e.target&&3===e.target.nodeType?e.target.parentNode:e.target,this.currentTarget=e.currentTarget,this.relatedTarget=e.relatedTarget):this.type=e,t&&w.extend(this,t),this.timeStamp=e&&e.timeStamp||Date.now(),this[w.expando]=!0},w.Event.prototype={constructor:w.Event,isDefaultPrevented:De,isPropagationStopped:De,isImmediatePropagationStopped:De,isSimulated:!1,preventDefault:function(){var e=this.originalEvent;this.isDefaultPrevented=Me,e&&!this.isSimulated&&e.preventDefault()},stopPropagation:function(){var e=this.originalEvent;this.isPropagationStopped=Me,e&&!this.isSimulated&&e.stopPropagation()},stopImmediatePropagation:function(){var e=this.originalEvent;this.isImmediatePropagationStopped=Me,e&&!this.isSimulated&&e.stopImmediatePropagation(),this.stopPropagation()}},w.each({altKey:!0,bubbles:!0,cancelable:!0,changedTouches:!0,ctrlKey:!0,detail:!0,eventPhase:!0,metaKey:!0,pageX:!0,pageY:!0,shiftKey:!0,view:!0,char:!0,code:!0,charCode:!0,key:!0,keyCode:!0,button:!0,buttons:!0,clientX:!0,clientY:!0,offsetX:!0,offsetY:!0,pointerId:!0,pointerType:!0,screenX:!0,screenY:!0,targetTouches:!0,toElement:!0,touches:!0,which:!0},w.event.addProp),w.each({focus:"focusin",blur:"focusout"},(function(e,t){w.event.special[e]={setup:function(){return Ce(this,e,Se),!1},trigger:function(){return Ce(this,e),!0},_default:function(t){return G.get(t.target,e)},delegateType:t}})),w.each({mouseenter:"mouseover",mouseleave:"mouseout",pointerenter:"pointerover",pointerleave:"pointerout"},(function(e,t){w.event.special[e]={delegateType:t,bindType:t,handle:function(e){var n,i=this,r=e.relatedTarget,o=e.handleObj;return r&&(r===i||w.contains(i,r))||(e.type=o.origType,n=o.handler.apply(this,arguments),e.type=t),n}}})),w.fn.extend({on:function(e,t,n,i){return _e(this,e,t,n,i)},one:function(e,t,n,i){return _e(this,e,t,n,i,1)},off:function(e,t,n){var i,r;if(e&&e.preventDefault&&e.handleObj)return i=e.handleObj,w(e.delegateTarget).off(i.namespace?i.origType+"."+i.namespace:i.origType,i.selector,i.handler),this;if("object"==typeof e){for(r in e)this.off(r,t,e[r]);return this}return!1!==t&&"function"!=typeof t||(n=t,t=void 0),!1===n&&(n=De),this.each((function(){w.event.remove(this,e,n,t)}))}});var ke=/<script|<style|<link/i,Ee=/checked\s*(?:[^=]|=\s*.checked.)/i,Ae=/^\s*<!\[CDATA\[|\]\]>\s*$/g;function Te(e,t){return C(e,"table")&&C(11!==t.nodeType?t:t.firstChild,"tr")&&w(e).children("tbody")[0]||e}function Ie(e){return e.type=(null!==e.getAttribute("type"))+"/"+e.type,e}function Re(e){return"true/"===(e.type||"").slice(0,5)?e.type=e.type.slice(5):e.removeAttribute("type"),e}function Ne(e,t){var n,i,r,o,s,a;if(1===t.nodeType){if(G.hasData(e)&&(a=G.get(e).events))for(r in G.remove(t,"handle events"),a)for(n=0,i=a[r].length;n<i;n++)w.event.add(t,r,a[r][n]);J.hasData(e)&&(o=J.access(e),s=w.extend({},o),J.set(t,s))}}function Oe(e,t){var n=t.nodeName.toLowerCase();"input"===n&&pe.test(e.type)?t.checked=e.checked:"input"!==n&&"textarea"!==n||(t.defaultValue=e.defaultValue)}function Pe(e,t,n,i){t=o(t);var r,s,a,l,c,u,h=0,d=e.length,m=d-1,g=t[0],y=p(g);if(y||d>1&&"string"==typeof g&&!f.checkClone&&Ee.test(g))return e.each((function(r){var o=e.eq(r);y&&(t[0]=g.call(this,r,o.html())),Pe(o,t,n,i)}));if(d&&(s=(r=we(t,e[0].ownerDocument,!1,e,i)).firstChild,1===r.childNodes.length&&(r=s),s||i)){for(l=(a=w.map(ve(r,"script"),Ie)).length;h<d;h++)c=r,h!==m&&(c=w.clone(c,!0,!0),l&&w.merge(a,ve(c,"script"))),n.call(e[h],c,h);if(l)for(u=a[a.length-1].ownerDocument,w.map(a,Re),h=0;h<l;h++)c=a[h],ge.test(c.type||"")&&!G.access(c,"globalEval")&&w.contains(u,c)&&(c.src&&"module"!==(c.type||"").toLowerCase()?w._evalUrl&&!c.noModule&&w._evalUrl(c.src,{nonce:c.nonce||c.getAttribute("nonce")},u):v(c.textContent.replace(Ae,""),c,u))}return e}function Le(e,t,n){for(var i,r=t?w.filter(t,e):e,o=0;null!=(i=r[o]);o++)n||1!==i.nodeType||w.cleanData(ve(i)),i.parentNode&&(n&&oe(i)&&be(ve(i,"script")),i.parentNode.removeChild(i));return e}w.extend({htmlPrefilter:function(e){return e},clone:function(e,t,n){var i,r,o,s,a=e.cloneNode(!0),l=oe(e);if(!(f.noCloneChecked||1!==e.nodeType&&11!==e.nodeType||w.isXMLDoc(e)))for(s=ve(a),i=0,r=(o=ve(e)).length;i<r;i++)Oe(o[i],s[i]);if(t)if(n)for(o=o||ve(e),s=s||ve(a),i=0,r=o.length;i<r;i++)Ne(o[i],s[i]);else Ne(e,a);return(s=ve(a,"script")).length>0&&be(s,!l&&ve(e,"script")),a},cleanData:function(e){for(var t,n,i,r=w.event.special,o=0;void 0!==(n=e[o]);o++)if(X(n)){if(t=n[G.expando]){if(t.events)for(i in t.events)r[i]?w.event.remove(n,i):w.removeEvent(n,i,t.handle);n[G.expando]=void 0}n[J.expando]&&(n[J.expando]=void 0)}}}),w.fn.extend({detach:function(e){return Le(this,e,!0)},remove:function(e){return Le(this,e)},text:function(e){return V(this,(function(e){return void 0===e?w.text(this):this.empty().each((function(){1!==this.nodeType&&11!==this.nodeType&&9!==this.nodeType||(this.textContent=e)}))}),null,e,arguments.length)},append:function(){return Pe(this,arguments,(function(e){1!==this.nodeType&&11!==this.nodeType&&9!==this.nodeType||Te(this,e).appendChild(e)}))},prepend:function(){return Pe(this,arguments,(function(e){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var t=Te(this,e);t.insertBefore(e,t.firstChild)}}))},before:function(){return Pe(this,arguments,(function(e){this.parentNode&&this.parentNode.insertBefore(e,this)}))},after:function(){return Pe(this,arguments,(function(e){this.parentNode&&this.parentNode.insertBefore(e,this.nextSibling)}))},empty:function(){for(var e,t=0;null!=(e=this[t]);t++)1===e.nodeType&&(w.cleanData(ve(e,!1)),e.textContent="");return this},clone:function(e,t){return e=null!=e&&e,t=null==t?e:t,this.map((function(){return w.clone(this,e,t)}))},html:function(e){return V(this,(function(e){var t=this[0]||{},n=0,i=this.length;if(void 0===e&&1===t.nodeType)return t.innerHTML;if("string"==typeof e&&!ke.test(e)&&!ye[(me.exec(e)||["",""])[1].toLowerCase()]){e=w.htmlPrefilter(e);try{for(;n<i;n++)1===(t=this[n]||{}).nodeType&&(w.cleanData(ve(t,!1)),t.innerHTML=e);t=0}catch(e){}}t&&this.empty().append(e)}),null,e,arguments.length)},replaceWith:function(){var e=[];return Pe(this,arguments,(function(t){var n=this.parentNode;w.inArray(this,e)<0&&(w.cleanData(ve(this)),n&&n.replaceChild(t,this))}),e)}}),w.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},(function(e,t){w.fn[e]=function(e){for(var n,i=[],r=w(e),o=r.length-1,a=0;a<=o;a++)n=a===o?this:this.clone(!0),w(r[a])[t](n),s.apply(i,n.get());return this.pushStack(i)}}));var Fe=new RegExp("^("+te+")(?!px)[a-z%]+$","i"),ze=/^--/,je=function(t){var n=t.ownerDocument.defaultView;return n&&n.opener||(n=e),n.getComputedStyle(t)},He=function(e,t,n){var i,r,o={};for(r in t)o[r]=e.style[r],e.style[r]=t[r];for(r in i=n.call(e),t)e.style[r]=o[r];return i},Be=new RegExp(ie.join("|"),"i"),Ve="[\\x20\\t\\r\\n\\f]",$e=new RegExp("^"+Ve+"+|((?:^|[^\\\\])(?:\\\\.)*)"+Ve+"+$","g");function We(e,t,n){var i,r,o,s,a=ze.test(t),l=e.style;return(n=n||je(e))&&(s=n.getPropertyValue(t)||n[t],a&&s&&(s=s.replace($e,"$1")||void 0),""!==s||oe(e)||(s=w.style(e,t)),!f.pixelBoxStyles()&&Fe.test(s)&&Be.test(t)&&(i=l.width,r=l.minWidth,o=l.maxWidth,l.minWidth=l.maxWidth=l.width=s,s=n.width,l.width=i,l.minWidth=r,l.maxWidth=o)),void 0!==s?s+"":s}function Ue(e,t){return{get:function(){if(!e())return(this.get=t).apply(this,arguments);delete this.get}}}!function(){function t(){if(u){c.style.cssText="position:absolute;left:-11111px;width:60px;margin-top:1px;padding:0;border:0",u.style.cssText="position:relative;display:block;box-sizing:border-box;overflow:scroll;margin:auto;border:1px;padding:1px;width:60%;top:1%",re.appendChild(c).appendChild(u);var t=e.getComputedStyle(u);i="1%"!==t.top,l=12===n(t.marginLeft),u.style.right="60%",s=36===n(t.right),r=36===n(t.width),u.style.position="absolute",o=12===n(u.offsetWidth/3),re.removeChild(c),u=null}}function n(e){return Math.round(parseFloat(e))}var i,r,o,s,a,l,c=g.createElement("div"),u=g.createElement("div");u.style&&(u.style.backgroundClip="content-box",u.cloneNode(!0).style.backgroundClip="",f.clearCloneStyle="content-box"===u.style.backgroundClip,w.extend(f,{boxSizingReliable:function(){return t(),r},pixelBoxStyles:function(){return t(),s},pixelPosition:function(){return t(),i},reliableMarginLeft:function(){return t(),l},scrollboxSize:function(){return t(),o},reliableTrDimensions:function(){var t,n,i,r;return null==a&&(t=g.createElement("table"),n=g.createElement("tr"),i=g.createElement("div"),t.style.cssText="position:absolute;left:-11111px;border-collapse:separate",n.style.cssText="border:1px solid",n.style.height="1px",i.style.height="9px",i.style.display="block",re.appendChild(t).appendChild(n).appendChild(i),r=e.getComputedStyle(n),a=parseInt(r.height,10)+parseInt(r.borderTopWidth,10)+parseInt(r.borderBottomWidth,10)===n.offsetHeight,re.removeChild(t)),a}}))}();var Ye=["Webkit","Moz","ms"],Xe=g.createElement("div").style,Ke={};function Ge(e){var t=w.cssProps[e]||Ke[e];return t||(e in Xe?e:Ke[e]=function(e){for(var t=e[0].toUpperCase()+e.slice(1),n=Ye.length;n--;)if((e=Ye[n]+t)in Xe)return e}(e)||e)}var Je=/^(none|table(?!-c[ea]).+)/,Ze={position:"absolute",visibility:"hidden",display:"block"},Qe={letterSpacing:"0",fontWeight:"400"};function et(e,t,n){var i=ne.exec(t);return i?Math.max(0,i[2]-(n||0))+(i[3]||"px"):t}function tt(e,t,n,i,r,o){var s="width"===t?1:0,a=0,l=0;if(n===(i?"border":"content"))return 0;for(;s<4;s+=2)"margin"===n&&(l+=w.css(e,n+ie[s],!0,r)),i?("content"===n&&(l-=w.css(e,"padding"+ie[s],!0,r)),"margin"!==n&&(l-=w.css(e,"border"+ie[s]+"Width",!0,r))):(l+=w.css(e,"padding"+ie[s],!0,r),"padding"!==n?l+=w.css(e,"border"+ie[s]+"Width",!0,r):a+=w.css(e,"border"+ie[s]+"Width",!0,r));return!i&&o>=0&&(l+=Math.max(0,Math.ceil(e["offset"+t[0].toUpperCase()+t.slice(1)]-o-l-a-.5))||0),l}function nt(e,t,n){var i=je(e),r=(!f.boxSizingReliable()||n)&&"border-box"===w.css(e,"boxSizing",!1,i),o=r,s=We(e,t,i),a="offset"+t[0].toUpperCase()+t.slice(1);if(Fe.test(s)){if(!n)return s;s="auto"}return(!f.boxSizingReliable()&&r||!f.reliableTrDimensions()&&C(e,"tr")||"auto"===s||!parseFloat(s)&&"inline"===w.css(e,"display",!1,i))&&e.getClientRects().length&&(r="border-box"===w.css(e,"boxSizing",!1,i),(o=a in e)&&(s=e[a])),(s=parseFloat(s)||0)+tt(e,t,n||(r?"border":"content"),o,i,s)+"px"}function it(e,t,n,i,r){return new it.prototype.init(e,t,n,i,r)}w.extend({cssHooks:{opacity:{get:function(e,t){if(t){var n=We(e,"opacity");return""===n?"1":n}}}},cssNumber:{animationIterationCount:!0,columnCount:!0,fillOpacity:!0,flexGrow:!0,flexShrink:!0,fontWeight:!0,gridArea:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnStart:!0,gridRow:!0,gridRowEnd:!0,gridRowStart:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,widows:!0,zIndex:!0,zoom:!0},cssProps:{},style:function(e,t,n,i){if(e&&3!==e.nodeType&&8!==e.nodeType&&e.style){var r,o,s,a=Y(t),l=ze.test(t),c=e.style;if(l||(t=Ge(a)),s=w.cssHooks[t]||w.cssHooks[a],void 0===n)return s&&"get"in s&&void 0!==(r=s.get(e,!1,i))?r:c[t];"string"===(o=typeof n)&&(r=ne.exec(n))&&r[1]&&(n=le(e,t,r),o="number"),null!=n&&n==n&&("number"!==o||l||(n+=r&&r[3]||(w.cssNumber[a]?"":"px")),f.clearCloneStyle||""!==n||0!==t.indexOf("background")||(c[t]="inherit"),s&&"set"in s&&void 0===(n=s.set(e,n,i))||(l?c.setProperty(t,n):c[t]=n))}},css:function(e,t,n,i){var r,o,s,a=Y(t);return ze.test(t)||(t=Ge(a)),(s=w.cssHooks[t]||w.cssHooks[a])&&"get"in s&&(r=s.get(e,!0,n)),void 0===r&&(r=We(e,t,i)),"normal"===r&&t in Qe&&(r=Qe[t]),""===n||n?(o=parseFloat(r),!0===n||isFinite(o)?o||0:r):r}}),w.each(["height","width"],(function(e,t){w.cssHooks[t]={get:function(e,n,i){if(n)return!Je.test(w.css(e,"display"))||e.getClientRects().length&&e.getBoundingClientRect().width?nt(e,t,i):He(e,Ze,(function(){return nt(e,t,i)}))},set:function(e,n,i){var r,o=je(e),s=!f.scrollboxSize()&&"absolute"===o.position,a=(s||i)&&"border-box"===w.css(e,"boxSizing",!1,o),l=i?tt(e,t,i,a,o):0;return a&&s&&(l-=Math.ceil(e["offset"+t[0].toUpperCase()+t.slice(1)]-parseFloat(o[t])-tt(e,t,"border",!1,o)-.5)),l&&(r=ne.exec(n))&&"px"!==(r[3]||"px")&&(e.style[t]=n,n=w.css(e,t)),et(0,n,l)}}})),w.cssHooks.marginLeft=Ue(f.reliableMarginLeft,(function(e,t){if(t)return(parseFloat(We(e,"marginLeft"))||e.getBoundingClientRect().left-He(e,{marginLeft:0},(function(){return e.getBoundingClientRect().left})))+"px"})),w.each({margin:"",padding:"",border:"Width"},(function(e,t){w.cssHooks[e+t]={expand:function(n){for(var i=0,r={},o="string"==typeof n?n.split(" "):[n];i<4;i++)r[e+ie[i]+t]=o[i]||o[i-2]||o[0];return r}},"margin"!==e&&(w.cssHooks[e+t].set=et)})),w.fn.extend({css:function(e,t){return V(this,(function(e,t,n){var i,r,o={},s=0;if(Array.isArray(t)){for(i=je(e),r=t.length;s<r;s++)o[t[s]]=w.css(e,t[s],!1,i);return o}return void 0!==n?w.style(e,t,n):w.css(e,t)}),e,t,arguments.length>1)}}),w.Tween=it,it.prototype={constructor:it,init:function(e,t,n,i,r,o){this.elem=e,this.prop=n,this.easing=r||w.easing._default,this.options=t,this.start=this.now=this.cur(),this.end=i,this.unit=o||(w.cssNumber[n]?"":"px")},cur:function(){var e=it.propHooks[this.prop];return e&&e.get?e.get(this):it.propHooks._default.get(this)},run:function(e){var t,n=it.propHooks[this.prop];return this.options.duration?this.pos=t=w.easing[this.easing](e,this.options.duration*e,0,1,this.options.duration):this.pos=t=e,this.now=(this.end-this.start)*t+this.start,this.options.step&&this.options.step.call(this.elem,this.now,this),n&&n.set?n.set(this):it.propHooks._default.set(this),this}},it.prototype.init.prototype=it.prototype,it.propHooks={_default:{get:function(e){var t;return 1!==e.elem.nodeType||null!=e.elem[e.prop]&&null==e.elem.style[e.prop]?e.elem[e.prop]:(t=w.css(e.elem,e.prop,""))&&"auto"!==t?t:0},set:function(e){w.fx.step[e.prop]?w.fx.step[e.prop](e):1!==e.elem.nodeType||!w.cssHooks[e.prop]&&null==e.elem.style[Ge(e.prop)]?e.elem[e.prop]=e.now:w.style(e.elem,e.prop,e.now+e.unit)}}},it.propHooks.scrollTop=it.propHooks.scrollLeft={set:function(e){e.elem.nodeType&&e.elem.parentNode&&(e.elem[e.prop]=e.now)}},w.easing={linear:function(e){return e},swing:function(e){return.5-Math.cos(e*Math.PI)/2},_default:"swing"},w.fx=it.prototype.init,w.fx.step={};var rt,ot,st=/^(?:toggle|show|hide)$/,at=/queueHooks$/;function lt(){ot&&(!1===g.hidden&&e.requestAnimationFrame?e.requestAnimationFrame(lt):e.setTimeout(lt,w.fx.interval),w.fx.tick())}function ct(){return e.setTimeout((function(){rt=void 0})),rt=Date.now()}function ut(e,t){var n,i=0,r={height:e};for(t=t?1:0;i<4;i+=2-t)r["margin"+(n=ie[i])]=r["padding"+n]=e;return t&&(r.opacity=r.width=e),r}function ht(e,t,n){for(var i,r=(dt.tweeners[t]||[]).concat(dt.tweeners["*"]),o=0,s=r.length;o<s;o++)if(i=r[o].call(n,t,e))return i}function dt(e,t,n){var i,r,o=0,s=dt.prefilters.length,a=w.Deferred().always((function(){delete l.elem})),l=function(){if(r)return!1;for(var t=rt||ct(),n=Math.max(0,c.startTime+c.duration-t),i=1-(n/c.duration||0),o=0,s=c.tweens.length;o<s;o++)c.tweens[o].run(i);return a.notifyWith(e,[c,i,n]),i<1&&s?n:(s||a.notifyWith(e,[c,1,0]),a.resolveWith(e,[c]),!1)},c=a.promise({elem:e,props:w.extend({},t),opts:w.extend(!0,{specialEasing:{},easing:w.easing._default},n),originalProperties:t,originalOptions:n,startTime:rt||ct(),duration:n.duration,tweens:[],createTween:function(t,n){var i=w.Tween(e,c.opts,t,n,c.opts.specialEasing[t]||c.opts.easing);return c.tweens.push(i),i},stop:function(t){var n=0,i=t?c.tweens.length:0;if(r)return this;for(r=!0;n<i;n++)c.tweens[n].run(1);return t?(a.notifyWith(e,[c,1,0]),a.resolveWith(e,[c,t])):a.rejectWith(e,[c,t]),this}}),u=c.props;for(!function(e,t){var n,i,r,o,s;for(n in e)if(r=t[i=Y(n)],o=e[n],Array.isArray(o)&&(r=o[1],o=e[n]=o[0]),n!==i&&(e[i]=o,delete e[n]),(s=w.cssHooks[i])&&"expand"in s)for(n in o=s.expand(o),delete e[i],o)n in e||(e[n]=o[n],t[n]=r);else t[i]=r}(u,c.opts.specialEasing);o<s;o++)if(i=dt.prefilters[o].call(c,e,u,c.opts))return p(i.stop)&&(w._queueHooks(c.elem,c.opts.queue).stop=i.stop.bind(i)),i;return w.map(u,ht,c),p(c.opts.start)&&c.opts.start.call(e,c),c.progress(c.opts.progress).done(c.opts.done,c.opts.complete).fail(c.opts.fail).always(c.opts.always),w.fx.timer(w.extend(l,{elem:e,anim:c,queue:c.opts.queue})),c}w.Animation=w.extend(dt,{tweeners:{"*":[function(e,t){var n=this.createTween(e,t);return le(n.elem,e,ne.exec(t),n),n}]},tweener:function(e,t){p(e)?(t=e,e=["*"]):e=e.match(P);for(var n,i=0,r=e.length;i<r;i++)n=e[i],dt.tweeners[n]=dt.tweeners[n]||[],dt.tweeners[n].unshift(t)},prefilters:[function(e,t,n){var i,r,o,s,a,l,c,u,h="width"in t||"height"in t,d=this,f={},p=e.style,m=e.nodeType&&ae(e),g=G.get(e,"fxshow");for(i in n.queue||(null==(s=w._queueHooks(e,"fx")).unqueued&&(s.unqueued=0,a=s.empty.fire,s.empty.fire=function(){s.unqueued||a()}),s.unqueued++,d.always((function(){d.always((function(){s.unqueued--,w.queue(e,"fx").length||s.empty.fire()}))}))),t)if(r=t[i],st.test(r)){if(delete t[i],o=o||"toggle"===r,r===(m?"hide":"show")){if("show"!==r||!g||void 0===g[i])continue;m=!0}f[i]=g&&g[i]||w.style(e,i)}if((l=!w.isEmptyObject(t))||!w.isEmptyObject(f))for(i in h&&1===e.nodeType&&(n.overflow=[p.overflow,p.overflowX,p.overflowY],null==(c=g&&g.display)&&(c=G.get(e,"display")),"none"===(u=w.css(e,"display"))&&(c?u=c:(he([e],!0),c=e.style.display||c,u=w.css(e,"display"),he([e]))),("inline"===u||"inline-block"===u&&null!=c)&&"none"===w.css(e,"float")&&(l||(d.done((function(){p.display=c})),null==c&&(u=p.display,c="none"===u?"":u)),p.display="inline-block")),n.overflow&&(p.overflow="hidden",d.always((function(){p.overflow=n.overflow[0],p.overflowX=n.overflow[1],p.overflowY=n.overflow[2]}))),l=!1,f)l||(g?"hidden"in g&&(m=g.hidden):g=G.access(e,"fxshow",{display:c}),o&&(g.hidden=!m),m&&he([e],!0),d.done((function(){for(i in m||he([e]),G.remove(e,"fxshow"),f)w.style(e,i,f[i])}))),l=ht(m?g[i]:0,i,d),i in g||(g[i]=l.start,m&&(l.end=l.start,l.start=0))}],prefilter:function(e,t){t?dt.prefilters.unshift(e):dt.prefilters.push(e)}}),w.speed=function(e,t,n){var i=e&&"object"==typeof e?w.extend({},e):{complete:n||!n&&t||p(e)&&e,duration:e,easing:n&&t||t&&!p(t)&&t};return w.fx.off?i.duration=0:"number"!=typeof i.duration&&(i.duration in w.fx.speeds?i.duration=w.fx.speeds[i.duration]:i.duration=w.fx.speeds._default),null!=i.queue&&!0!==i.queue||(i.queue="fx"),i.old=i.complete,i.complete=function(){p(i.old)&&i.old.call(this),i.queue&&w.dequeue(this,i.queue)},i},w.fn.extend({fadeTo:function(e,t,n,i){return this.filter(ae).css("opacity",0).show().end().animate({opacity:t},e,n,i)},animate:function(e,t,n,i){var r=w.isEmptyObject(e),o=w.speed(t,n,i),s=function(){var t=dt(this,w.extend({},e),o);(r||G.get(this,"finish"))&&t.stop(!0)};return s.finish=s,r||!1===o.queue?this.each(s):this.queue(o.queue,s)},stop:function(e,t,n){var i=function(e){var t=e.stop;delete e.stop,t(n)};return"string"!=typeof e&&(n=t,t=e,e=void 0),t&&this.queue(e||"fx",[]),this.each((function(){var t=!0,r=null!=e&&e+"queueHooks",o=w.timers,s=G.get(this);if(r)s[r]&&s[r].stop&&i(s[r]);else for(r in s)s[r]&&s[r].stop&&at.test(r)&&i(s[r]);for(r=o.length;r--;)o[r].elem!==this||null!=e&&o[r].queue!==e||(o[r].anim.stop(n),t=!1,o.splice(r,1));!t&&n||w.dequeue(this,e)}))},finish:function(e){return!1!==e&&(e=e||"fx"),this.each((function(){var t,n=G.get(this),i=n[e+"queue"],r=n[e+"queueHooks"],o=w.timers,s=i?i.length:0;for(n.finish=!0,w.queue(this,e,[]),r&&r.stop&&r.stop.call(this,!0),t=o.length;t--;)o[t].elem===this&&o[t].queue===e&&(o[t].anim.stop(!0),o.splice(t,1));for(t=0;t<s;t++)i[t]&&i[t].finish&&i[t].finish.call(this);delete n.finish}))}}),w.each(["toggle","show","hide"],(function(e,t){var n=w.fn[t];w.fn[t]=function(e,i,r){return null==e||"boolean"==typeof e?n.apply(this,arguments):this.animate(ut(t,!0),e,i,r)}})),w.each({slideDown:ut("show"),slideUp:ut("hide"),slideToggle:ut("toggle"),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"},fadeToggle:{opacity:"toggle"}},(function(e,t){w.fn[e]=function(e,n,i){return this.animate(t,e,n,i)}})),w.timers=[],w.fx.tick=function(){var e,t=0,n=w.timers;for(rt=Date.now();t<n.length;t++)(e=n[t])()||n[t]!==e||n.splice(t--,1);n.length||w.fx.stop(),rt=void 0},w.fx.timer=function(e){w.timers.push(e),w.fx.start()},w.fx.interval=13,w.fx.start=function(){ot||(ot=!0,lt())},w.fx.stop=function(){ot=null},w.fx.speeds={slow:600,fast:200,_default:400},w.fn.delay=function(t,n){return t=w.fx&&w.fx.speeds[t]||t,n=n||"fx",this.queue(n,(function(n,i){var r=e.setTimeout(n,t);i.stop=function(){e.clearTimeout(r)}}))},function(){var e=g.createElement("input"),t=g.createElement("select").appendChild(g.createElement("option"));e.type="checkbox",f.checkOn=""!==e.value,f.optSelected=t.selected,(e=g.createElement("input")).value="t",e.type="radio",f.radioValue="t"===e.value}();var ft,pt=w.expr.attrHandle;w.fn.extend({attr:function(e,t){return V(this,w.attr,e,t,arguments.length>1)},removeAttr:function(e){return this.each((function(){w.removeAttr(this,e)}))}}),w.extend({attr:function(e,t,n){var i,r,o=e.nodeType;if(3!==o&&8!==o&&2!==o)return void 0===e.getAttribute?w.prop(e,t,n):(1===o&&w.isXMLDoc(e)||(r=w.attrHooks[t.toLowerCase()]||(w.expr.match.bool.test(t)?ft:void 0)),void 0!==n?null===n?void w.removeAttr(e,t):r&&"set"in r&&void 0!==(i=r.set(e,n,t))?i:(e.setAttribute(t,n+""),n):r&&"get"in r&&null!==(i=r.get(e,t))?i:null==(i=w.find.attr(e,t))?void 0:i)},attrHooks:{type:{set:function(e,t){if(!f.radioValue&&"radio"===t&&C(e,"input")){var n=e.value;return e.setAttribute("type",t),n&&(e.value=n),t}}}},removeAttr:function(e,t){var n,i=0,r=t&&t.match(P);if(r&&1===e.nodeType)for(;n=r[i++];)e.removeAttribute(n)}}),ft={set:function(e,t,n){return!1===t?w.removeAttr(e,n):e.setAttribute(n,n),n}},w.each(w.expr.match.bool.source.match(/\w+/g),(function(e,t){var n=pt[t]||w.find.attr;pt[t]=function(e,t,i){var r,o,s=t.toLowerCase();return i||(o=pt[s],pt[s]=r,r=null!=n(e,t,i)?s:null,pt[s]=o),r}}));var mt=/^(?:input|select|textarea|button)$/i,gt=/^(?:a|area)$/i;function yt(e){return(e.match(P)||[]).join(" ")}function vt(e){return e.getAttribute&&e.getAttribute("class")||""}function bt(e){return Array.isArray(e)?e:"string"==typeof e&&e.match(P)||[]}w.fn.extend({prop:function(e,t){return V(this,w.prop,e,t,arguments.length>1)},removeProp:function(e){return this.each((function(){delete this[w.propFix[e]||e]}))}}),w.extend({prop:function(e,t,n){var i,r,o=e.nodeType;if(3!==o&&8!==o&&2!==o)return 1===o&&w.isXMLDoc(e)||(t=w.propFix[t]||t,r=w.propHooks[t]),void 0!==n?r&&"set"in r&&void 0!==(i=r.set(e,n,t))?i:e[t]=n:r&&"get"in r&&null!==(i=r.get(e,t))?i:e[t]},propHooks:{tabIndex:{get:function(e){var t=w.find.attr(e,"tabindex");return t?parseInt(t,10):mt.test(e.nodeName)||gt.test(e.nodeName)&&e.href?0:-1}}},propFix:{for:"htmlFor",class:"className"}}),f.optSelected||(w.propHooks.selected={get:function(e){var t=e.parentNode;return t&&t.parentNode&&t.parentNode.selectedIndex,null},set:function(e){var t=e.parentNode;t&&(t.selectedIndex,t.parentNode&&t.parentNode.selectedIndex)}}),w.each(["tabIndex","readOnly","maxLength","cellSpacing","cellPadding","rowSpan","colSpan","useMap","frameBorder","contentEditable"],(function(){w.propFix[this.toLowerCase()]=this})),w.fn.extend({addClass:function(e){var t,n,i,r,o,s;return p(e)?this.each((function(t){w(this).addClass(e.call(this,t,vt(this)))})):(t=bt(e)).length?this.each((function(){if(i=vt(this),n=1===this.nodeType&&" "+yt(i)+" "){for(o=0;o<t.length;o++)r=t[o],n.indexOf(" "+r+" ")<0&&(n+=r+" ");s=yt(n),i!==s&&this.setAttribute("class",s)}})):this},removeClass:function(e){var t,n,i,r,o,s;return p(e)?this.each((function(t){w(this).removeClass(e.call(this,t,vt(this)))})):arguments.length?(t=bt(e)).length?this.each((function(){if(i=vt(this),n=1===this.nodeType&&" "+yt(i)+" "){for(o=0;o<t.length;o++)for(r=t[o];n.indexOf(" "+r+" ")>-1;)n=n.replace(" "+r+" "," ");s=yt(n),i!==s&&this.setAttribute("class",s)}})):this:this.attr("class","")},toggleClass:function(e,t){var n,i,r,o,s=typeof e,a="string"===s||Array.isArray(e);return p(e)?this.each((function(n){w(this).toggleClass(e.call(this,n,vt(this),t),t)})):"boolean"==typeof t&&a?t?this.addClass(e):this.removeClass(e):(n=bt(e),this.each((function(){if(a)for(o=w(this),r=0;r<n.length;r++)i=n[r],o.hasClass(i)?o.removeClass(i):o.addClass(i);else void 0!==e&&"boolean"!==s||((i=vt(this))&&G.set(this,"__className__",i),this.setAttribute&&this.setAttribute("class",i||!1===e?"":G.get(this,"__className__")||""))})))},hasClass:function(e){var t,n,i=0;for(t=" "+e+" ";n=this[i++];)if(1===n.nodeType&&(" "+yt(vt(n))+" ").indexOf(t)>-1)return!0;return!1}});var xt=/\r/g;w.fn.extend({val:function(e){var t,n,i,r=this[0];return arguments.length?(i=p(e),this.each((function(n){var r;1===this.nodeType&&(null==(r=i?e.call(this,n,w(this).val()):e)?r="":"number"==typeof r?r+="":Array.isArray(r)&&(r=w.map(r,(function(e){return null==e?"":e+""}))),(t=w.valHooks[this.type]||w.valHooks[this.nodeName.toLowerCase()])&&"set"in t&&void 0!==t.set(this,r,"value")||(this.value=r))}))):r?(t=w.valHooks[r.type]||w.valHooks[r.nodeName.toLowerCase()])&&"get"in t&&void 0!==(n=t.get(r,"value"))?n:"string"==typeof(n=r.value)?n.replace(xt,""):null==n?"":n:void 0}}),w.extend({valHooks:{option:{get:function(e){var t=w.find.attr(e,"value");return null!=t?t:yt(w.text(e))}},select:{get:function(e){var t,n,i,r=e.options,o=e.selectedIndex,s="select-one"===e.type,a=s?null:[],l=s?o+1:r.length;for(i=o<0?l:s?o:0;i<l;i++)if(((n=r[i]).selected||i===o)&&!n.disabled&&(!n.parentNode.disabled||!C(n.parentNode,"optgroup"))){if(t=w(n).val(),s)return t;a.push(t)}return a},set:function(e,t){for(var n,i,r=e.options,o=w.makeArray(t),s=r.length;s--;)((i=r[s]).selected=w.inArray(w.valHooks.option.get(i),o)>-1)&&(n=!0);return n||(e.selectedIndex=-1),o}}}}),w.each(["radio","checkbox"],(function(){w.valHooks[this]={set:function(e,t){if(Array.isArray(t))return e.checked=w.inArray(w(e).val(),t)>-1}},f.checkOn||(w.valHooks[this].get=function(e){return null===e.getAttribute("value")?"on":e.value})})),f.focusin="onfocusin"in e;var wt=/^(?:focusinfocus|focusoutblur)$/,qt=function(e){e.stopPropagation()};w.extend(w.event,{trigger:function(t,n,i,r){var o,s,a,l,c,h,d,f,y=[i||g],v=u.call(t,"type")?t.type:t,b=u.call(t,"namespace")?t.namespace.split("."):[];if(s=f=a=i=i||g,3!==i.nodeType&&8!==i.nodeType&&!wt.test(v+w.event.triggered)&&(v.indexOf(".")>-1&&(b=v.split("."),v=b.shift(),b.sort()),c=v.indexOf(":")<0&&"on"+v,(t=t[w.expando]?t:new w.Event(v,"object"==typeof t&&t)).isTrigger=r?2:3,t.namespace=b.join("."),t.rnamespace=t.namespace?new RegExp("(^|\\.)"+b.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,t.result=void 0,t.target||(t.target=i),n=null==n?[t]:w.makeArray(n,[t]),d=w.event.special[v]||{},r||!d.trigger||!1!==d.trigger.apply(i,n))){if(!r&&!d.noBubble&&!m(i)){for(l=d.delegateType||v,wt.test(l+v)||(s=s.parentNode);s;s=s.parentNode)y.push(s),a=s;a===(i.ownerDocument||g)&&y.push(a.defaultView||a.parentWindow||e)}for(o=0;(s=y[o++])&&!t.isPropagationStopped();)f=s,t.type=o>1?l:d.bindType||v,(h=(G.get(s,"events")||Object.create(null))[t.type]&&G.get(s,"handle"))&&h.apply(s,n),(h=c&&s[c])&&h.apply&&X(s)&&(t.result=h.apply(s,n),!1===t.result&&t.preventDefault());return t.type=v,r||t.isDefaultPrevented()||d._default&&!1!==d._default.apply(y.pop(),n)||!X(i)||c&&p(i[v])&&!m(i)&&((a=i[c])&&(i[c]=null),w.event.triggered=v,t.isPropagationStopped()&&f.addEventListener(v,qt),i[v](),t.isPropagationStopped()&&f.removeEventListener(v,qt),w.event.triggered=void 0,a&&(i[c]=a)),t.result}},simulate:function(e,t,n){var i=w.extend(new w.Event,n,{type:e,isSimulated:!0});w.event.trigger(i,null,t)}}),w.fn.extend({trigger:function(e,t){return this.each((function(){w.event.trigger(e,t,this)}))},triggerHandler:function(e,t){var n=this[0];if(n)return w.event.trigger(e,t,n,!0)}}),f.focusin||w.each({focus:"focusin",blur:"focusout"},(function(e,t){var n=function(e){w.event.simulate(t,e.target,w.event.fix(e))};w.event.special[t]={setup:function(){var i=this.ownerDocument||this.document||this,r=G.access(i,t);r||i.addEventListener(e,n,!0),G.access(i,t,(r||0)+1)},teardown:function(){var i=this.ownerDocument||this.document||this,r=G.access(i,t)-1;r?G.access(i,t,r):(i.removeEventListener(e,n,!0),G.remove(i,t))}}}));var Mt=e.location,Dt={guid:Date.now()},St=/\?/;w.parseXML=function(t){var n,i;if(!t||"string"!=typeof t)return null;try{n=(new e.DOMParser).parseFromString(t,"text/xml")}catch(e){}return i=n&&n.getElementsByTagName("parsererror")[0],n&&!i||w.error("Invalid XML: "+(i?w.map(i.childNodes,(function(e){return e.textContent})).join("\n"):t)),n};var _t=/\[\]$/,Ct=/\r?\n/g,kt=/^(?:submit|button|image|reset|file)$/i,Et=/^(?:input|select|textarea|keygen)/i;function At(e,t,n,i){var r;if(Array.isArray(t))w.each(t,(function(t,r){n||_t.test(e)?i(e,r):At(e+"["+("object"==typeof r&&null!=r?t:"")+"]",r,n,i)}));else if(n||"object"!==b(t))i(e,t);else for(r in t)At(e+"["+r+"]",t[r],n,i)}w.param=function(e,t){var n,i=[],r=function(e,t){var n=p(t)?t():t;i[i.length]=encodeURIComponent(e)+"="+encodeURIComponent(null==n?"":n)};if(null==e)return"";if(Array.isArray(e)||e.jquery&&!w.isPlainObject(e))w.each(e,(function(){r(this.name,this.value)}));else for(n in e)At(n,e[n],t,r);return i.join("&")},w.fn.extend({serialize:function(){return w.param(this.serializeArray())},serializeArray:function(){return this.map((function(){var e=w.prop(this,"elements");return e?w.makeArray(e):this})).filter((function(){var e=this.type;return this.name&&!w(this).is(":disabled")&&Et.test(this.nodeName)&&!kt.test(e)&&(this.checked||!pe.test(e))})).map((function(e,t){var n=w(this).val();return null==n?null:Array.isArray(n)?w.map(n,(function(e){return{name:t.name,value:e.replace(Ct,"\r\n")}})):{name:t.name,value:n.replace(Ct,"\r\n")}})).get()}});var Tt=/%20/g,It=/#.*$/,Rt=/([?&])_=[^&]*/,Nt=/^(.*?):[ \t]*([^\r\n]*)$/gm,Ot=/^(?:GET|HEAD)$/,Pt=/^\/\//,Lt={},Ft={},zt="*/".concat("*"),jt=g.createElement("a");function Ht(e){return function(t,n){"string"!=typeof t&&(n=t,t="*");var i,r=0,o=t.toLowerCase().match(P)||[];if(p(n))for(;i=o[r++];)"+"===i[0]?(i=i.slice(1)||"*",(e[i]=e[i]||[]).unshift(n)):(e[i]=e[i]||[]).push(n)}}function Bt(e,t,n,i){var r={},o=e===Ft;function s(a){var l;return r[a]=!0,w.each(e[a]||[],(function(e,a){var c=a(t,n,i);return"string"!=typeof c||o||r[c]?o?!(l=c):void 0:(t.dataTypes.unshift(c),s(c),!1)})),l}return s(t.dataTypes[0])||!r["*"]&&s("*")}function Vt(e,t){var n,i,r=w.ajaxSettings.flatOptions||{};for(n in t)void 0!==t[n]&&((r[n]?e:i||(i={}))[n]=t[n]);return i&&w.extend(!0,e,i),e}jt.href=Mt.href,w.extend({active:0,lastModified:{},etag:{},ajaxSettings:{url:Mt.href,type:"GET",isLocal:/^(?:about|app|app-storage|.+-extension|file|res|widget):$/.test(Mt.protocol),global:!0,processData:!0,async:!0,contentType:"application/x-www-form-urlencoded; charset=UTF-8",accepts:{"*":zt,text:"text/plain",html:"text/html",xml:"application/xml, text/xml",json:"application/json, text/javascript"},contents:{xml:/\bxml\b/,html:/\bhtml/,json:/\bjson\b/},responseFields:{xml:"responseXML",text:"responseText",json:"responseJSON"},converters:{"* text":String,"text html":!0,"text json":JSON.parse,"text xml":w.parseXML},flatOptions:{url:!0,context:!0}},ajaxSetup:function(e,t){return t?Vt(Vt(e,w.ajaxSettings),t):Vt(w.ajaxSettings,e)},ajaxPrefilter:Ht(Lt),ajaxTransport:Ht(Ft),ajax:function(t,n){"object"==typeof t&&(n=t,t=void 0),n=n||{};var i,r,o,s,a,l,c,u,h,d,f=w.ajaxSetup({},n),p=f.context||f,m=f.context&&(p.nodeType||p.jquery)?w(p):w.event,y=w.Deferred(),v=w.Callbacks("once memory"),b=f.statusCode||{},x={},q={},M="canceled",D={readyState:0,getResponseHeader:function(e){var t;if(c){if(!s)for(s={};t=Nt.exec(o);)s[t[1].toLowerCase()+" "]=(s[t[1].toLowerCase()+" "]||[]).concat(t[2]);t=s[e.toLowerCase()+" "]}return null==t?null:t.join(", ")},getAllResponseHeaders:function(){return c?o:null},setRequestHeader:function(e,t){return null==c&&(e=q[e.toLowerCase()]=q[e.toLowerCase()]||e,x[e]=t),this},overrideMimeType:function(e){return null==c&&(f.mimeType=e),this},statusCode:function(e){var t;if(e)if(c)D.always(e[D.status]);else for(t in e)b[t]=[b[t],e[t]];return this},abort:function(e){var t=e||M;return i&&i.abort(t),S(0,t),this}};if(y.promise(D),f.url=((t||f.url||Mt.href)+"").replace(Pt,Mt.protocol+"//"),f.type=n.method||n.type||f.method||f.type,f.dataTypes=(f.dataType||"*").toLowerCase().match(P)||[""],null==f.crossDomain){l=g.createElement("a");try{l.href=f.url,l.href=l.href,f.crossDomain=jt.protocol+"//"+jt.host!=l.protocol+"//"+l.host}catch(e){f.crossDomain=!0}}if(f.data&&f.processData&&"string"!=typeof f.data&&(f.data=w.param(f.data,f.traditional)),Bt(Lt,f,n,D),c)return D;for(h in(u=w.event&&f.global)&&0==w.active++&&w.event.trigger("ajaxStart"),f.type=f.type.toUpperCase(),f.hasContent=!Ot.test(f.type),r=f.url.replace(It,""),f.hasContent?f.data&&f.processData&&0===(f.contentType||"").indexOf("application/x-www-form-urlencoded")&&(f.data=f.data.replace(Tt,"+")):(d=f.url.slice(r.length),f.data&&(f.processData||"string"==typeof f.data)&&(r+=(St.test(r)?"&":"?")+f.data,delete f.data),!1===f.cache&&(r=r.replace(Rt,"$1"),d=(St.test(r)?"&":"?")+"_="+Dt.guid+++d),f.url=r+d),f.ifModified&&(w.lastModified[r]&&D.setRequestHeader("If-Modified-Since",w.lastModified[r]),w.etag[r]&&D.setRequestHeader("If-None-Match",w.etag[r])),(f.data&&f.hasContent&&!1!==f.contentType||n.contentType)&&D.setRequestHeader("Content-Type",f.contentType),D.setRequestHeader("Accept",f.dataTypes[0]&&f.accepts[f.dataTypes[0]]?f.accepts[f.dataTypes[0]]+("*"!==f.dataTypes[0]?", "+zt+"; q=0.01":""):f.accepts["*"]),f.headers)D.setRequestHeader(h,f.headers[h]);if(f.beforeSend&&(!1===f.beforeSend.call(p,D,f)||c))return D.abort();if(M="abort",v.add(f.complete),D.done(f.success),D.fail(f.error),i=Bt(Ft,f,n,D)){if(D.readyState=1,u&&m.trigger("ajaxSend",[D,f]),c)return D;f.async&&f.timeout>0&&(a=e.setTimeout((function(){D.abort("timeout")}),f.timeout));try{c=!1,i.send(x,S)}catch(e){if(c)throw e;S(-1,e)}}else S(-1,"No Transport");function S(t,n,s,l){var h,d,g,x,q,M=n;c||(c=!0,a&&e.clearTimeout(a),i=void 0,o=l||"",D.readyState=t>0?4:0,h=t>=200&&t<300||304===t,s&&(x=function(e,t,n){for(var i,r,o,s,a=e.contents,l=e.dataTypes;"*"===l[0];)l.shift(),void 0===i&&(i=e.mimeType||t.getResponseHeader("Content-Type"));if(i)for(r in a)if(a[r]&&a[r].test(i)){l.unshift(r);break}if(l[0]in n)o=l[0];else{for(r in n){if(!l[0]||e.converters[r+" "+l[0]]){o=r;break}s||(s=r)}o=o||s}if(o)return o!==l[0]&&l.unshift(o),n[o]}(f,D,s)),!h&&w.inArray("script",f.dataTypes)>-1&&w.inArray("json",f.dataTypes)<0&&(f.converters["text script"]=function(){}),x=function(e,t,n,i){var r,o,s,a,l,c={},u=e.dataTypes.slice();if(u[1])for(s in e.converters)c[s.toLowerCase()]=e.converters[s];for(o=u.shift();o;)if(e.responseFields[o]&&(n[e.responseFields[o]]=t),!l&&i&&e.dataFilter&&(t=e.dataFilter(t,e.dataType)),l=o,o=u.shift())if("*"===o)o=l;else if("*"!==l&&l!==o){if(!(s=c[l+" "+o]||c["* "+o]))for(r in c)if((a=r.split(" "))[1]===o&&(s=c[l+" "+a[0]]||c["* "+a[0]])){!0===s?s=c[r]:!0!==c[r]&&(o=a[0],u.unshift(a[1]));break}if(!0!==s)if(s&&e.throws)t=s(t);else try{t=s(t)}catch(e){return{state:"parsererror",error:s?e:"No conversion from "+l+" to "+o}}}return{state:"success",data:t}}(f,x,D,h),h?(f.ifModified&&((q=D.getResponseHeader("Last-Modified"))&&(w.lastModified[r]=q),(q=D.getResponseHeader("etag"))&&(w.etag[r]=q)),204===t||"HEAD"===f.type?M="nocontent":304===t?M="notmodified":(M=x.state,d=x.data,h=!(g=x.error))):(g=M,!t&&M||(M="error",t<0&&(t=0))),D.status=t,D.statusText=(n||M)+"",h?y.resolveWith(p,[d,M,D]):y.rejectWith(p,[D,M,g]),D.statusCode(b),b=void 0,u&&m.trigger(h?"ajaxSuccess":"ajaxError",[D,f,h?d:g]),v.fireWith(p,[D,M]),u&&(m.trigger("ajaxComplete",[D,f]),--w.active||w.event.trigger("ajaxStop")))}return D},getJSON:function(e,t,n){return w.get(e,t,n,"json")},getScript:function(e,t){return w.get(e,void 0,t,"script")}}),w.each(["get","post"],(function(e,t){w[t]=function(e,n,i,r){return p(n)&&(r=r||i,i=n,n=void 0),w.ajax(w.extend({url:e,type:t,dataType:r,data:n,success:i},w.isPlainObject(e)&&e))}})),w.ajaxPrefilter((function(e){var t;for(t in e.headers)"content-type"===t.toLowerCase()&&(e.contentType=e.headers[t]||"")})),w._evalUrl=function(e,t,n){return w.ajax({url:e,type:"GET",dataType:"script",cache:!0,async:!1,global:!1,converters:{"text script":function(){}},dataFilter:function(e){w.globalEval(e,t,n)}})},w.fn.extend({wrapAll:function(e){var t;return this[0]&&(p(e)&&(e=e.call(this[0])),t=w(e,this[0].ownerDocument).eq(0).clone(!0),this[0].parentNode&&t.insertBefore(this[0]),t.map((function(){for(var e=this;e.firstElementChild;)e=e.firstElementChild;return e})).append(this)),this},wrapInner:function(e){return p(e)?this.each((function(t){w(this).wrapInner(e.call(this,t))})):this.each((function(){var t=w(this),n=t.contents();n.length?n.wrapAll(e):t.append(e)}))},wrap:function(e){var t=p(e);return this.each((function(n){w(this).wrapAll(t?e.call(this,n):e)}))},unwrap:function(e){return this.parent(e).not("body").each((function(){w(this).replaceWith(this.childNodes)})),this}}),w.expr.pseudos.hidden=function(e){return!w.expr.pseudos.visible(e)},w.expr.pseudos.visible=function(e){return!!(e.offsetWidth||e.offsetHeight||e.getClientRects().length)},w.ajaxSettings.xhr=function(){try{return new e.XMLHttpRequest}catch(e){}};var $t={0:200,1223:204},Wt=w.ajaxSettings.xhr();f.cors=!!Wt&&"withCredentials"in Wt,f.ajax=Wt=!!Wt,w.ajaxTransport((function(t){var n,i;if(f.cors||Wt&&!t.crossDomain)return{send:function(r,o){var s,a=t.xhr();if(a.open(t.type,t.url,t.async,t.username,t.password),t.xhrFields)for(s in t.xhrFields)a[s]=t.xhrFields[s];for(s in t.mimeType&&a.overrideMimeType&&a.overrideMimeType(t.mimeType),t.crossDomain||r["X-Requested-With"]||(r["X-Requested-With"]="XMLHttpRequest"),r)a.setRequestHeader(s,r[s]);n=function(e){return function(){n&&(n=i=a.onload=a.onerror=a.onabort=a.ontimeout=a.onreadystatechange=null,"abort"===e?a.abort():"error"===e?"number"!=typeof a.status?o(0,"error"):o(a.status,a.statusText):o($t[a.status]||a.status,a.statusText,"text"!==(a.responseType||"text")||"string"!=typeof a.responseText?{binary:a.response}:{text:a.responseText},a.getAllResponseHeaders()))}},a.onload=n(),i=a.onerror=a.ontimeout=n("error"),void 0!==a.onabort?a.onabort=i:a.onreadystatechange=function(){4===a.readyState&&e.setTimeout((function(){n&&i()}))},n=n("abort");try{a.send(t.hasContent&&t.data||null)}catch(e){if(n)throw e}},abort:function(){n&&n()}}})),w.ajaxPrefilter((function(e){e.crossDomain&&(e.contents.script=!1)})),w.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/\b(?:java|ecma)script\b/},converters:{"text script":function(e){return w.globalEval(e),e}}}),w.ajaxPrefilter("script",(function(e){void 0===e.cache&&(e.cache=!1),e.crossDomain&&(e.type="GET")})),w.ajaxTransport("script",(function(e){var t,n;if(e.crossDomain||e.scriptAttrs)return{send:function(i,r){t=w("<script>").attr(e.scriptAttrs||{}).prop({charset:e.scriptCharset,src:e.url}).on("load error",n=function(e){t.remove(),n=null,e&&r("error"===e.type?404:200,e.type)}),g.head.appendChild(t[0])},abort:function(){n&&n()}}}));var Ut,Yt=[],Xt=/(=)\?(?=&|$)|\?\?/;w.ajaxSetup({jsonp:"callback",jsonpCallback:function(){var e=Yt.pop()||w.expando+"_"+Dt.guid++;return this[e]=!0,e}}),w.ajaxPrefilter("json jsonp",(function(t,n,i){var r,o,s,a=!1!==t.jsonp&&(Xt.test(t.url)?"url":"string"==typeof t.data&&0===(t.contentType||"").indexOf("application/x-www-form-urlencoded")&&Xt.test(t.data)&&"data");if(a||"jsonp"===t.dataTypes[0])return r=t.jsonpCallback=p(t.jsonpCallback)?t.jsonpCallback():t.jsonpCallback,a?t[a]=t[a].replace(Xt,"$1"+r):!1!==t.jsonp&&(t.url+=(St.test(t.url)?"&":"?")+t.jsonp+"="+r),t.converters["script json"]=function(){return s||w.error(r+" was not called"),s[0]},t.dataTypes[0]="json",o=e[r],e[r]=function(){s=arguments},i.always((function(){void 0===o?w(e).removeProp(r):e[r]=o,t[r]&&(t.jsonpCallback=n.jsonpCallback,Yt.push(r)),s&&p(o)&&o(s[0]),s=o=void 0})),"script"})),f.createHTMLDocument=((Ut=g.implementation.createHTMLDocument("").body).innerHTML="<form></form><form></form>",2===Ut.childNodes.length),w.parseHTML=function(e,t,n){return"string"!=typeof e?[]:("boolean"==typeof t&&(n=t,t=!1),t||(f.createHTMLDocument?((i=(t=g.implementation.createHTMLDocument("")).createElement("base")).href=g.location.href,t.head.appendChild(i)):t=g),o=!n&&[],(r=k.exec(e))?[t.createElement(r[1])]:(r=we([e],t,o),o&&o.length&&w(o).remove(),w.merge([],r.childNodes)));var i,r,o},w.fn.load=function(e,t,n){var i,r,o,s=this,a=e.indexOf(" ");return a>-1&&(i=yt(e.slice(a)),e=e.slice(0,a)),p(t)?(n=t,t=void 0):t&&"object"==typeof t&&(r="POST"),s.length>0&&w.ajax({url:e,type:r||"GET",dataType:"html",data:t}).done((function(e){o=arguments,s.html(i?w("<div>").append(w.parseHTML(e)).find(i):e)})).always(n&&function(e,t){s.each((function(){n.apply(this,o||[e.responseText,t,e])}))}),this},w.expr.pseudos.animated=function(e){return w.grep(w.timers,(function(t){return e===t.elem})).length},w.offset={setOffset:function(e,t,n){var i,r,o,s,a,l,c=w.css(e,"position"),u=w(e),h={};"static"===c&&(e.style.position="relative"),a=u.offset(),o=w.css(e,"top"),l=w.css(e,"left"),("absolute"===c||"fixed"===c)&&(o+l).indexOf("auto")>-1?(s=(i=u.position()).top,r=i.left):(s=parseFloat(o)||0,r=parseFloat(l)||0),p(t)&&(t=t.call(e,n,w.extend({},a))),null!=t.top&&(h.top=t.top-a.top+s),null!=t.left&&(h.left=t.left-a.left+r),"using"in t?t.using.call(e,h):u.css(h)}},w.fn.extend({offset:function(e){if(arguments.length)return void 0===e?this:this.each((function(t){w.offset.setOffset(this,e,t)}));var t,n,i=this[0];return i?i.getClientRects().length?(t=i.getBoundingClientRect(),n=i.ownerDocument.defaultView,{top:t.top+n.pageYOffset,left:t.left+n.pageXOffset}):{top:0,left:0}:void 0},position:function(){if(this[0]){var e,t,n,i=this[0],r={top:0,left:0};if("fixed"===w.css(i,"position"))t=i.getBoundingClientRect();else{for(t=this.offset(),n=i.ownerDocument,e=i.offsetParent||n.documentElement;e&&(e===n.body||e===n.documentElement)&&"static"===w.css(e,"position");)e=e.parentNode;e&&e!==i&&1===e.nodeType&&((r=w(e).offset()).top+=w.css(e,"borderTopWidth",!0),r.left+=w.css(e,"borderLeftWidth",!0))}return{top:t.top-r.top-w.css(i,"marginTop",!0),left:t.left-r.left-w.css(i,"marginLeft",!0)}}},offsetParent:function(){return this.map((function(){for(var e=this.offsetParent;e&&"static"===w.css(e,"position");)e=e.offsetParent;return e||re}))}}),w.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},(function(e,t){var n="pageYOffset"===t;w.fn[e]=function(i){return V(this,(function(e,i,r){var o;if(m(e)?o=e:9===e.nodeType&&(o=e.defaultView),void 0===r)return o?o[t]:e[i];o?o.scrollTo(n?o.pageXOffset:r,n?r:o.pageYOffset):e[i]=r}),e,i,arguments.length)}})),w.each(["top","left"],(function(e,t){w.cssHooks[t]=Ue(f.pixelPosition,(function(e,n){if(n)return n=We(e,t),Fe.test(n)?w(e).position()[t]+"px":n}))})),w.each({Height:"height",Width:"width"},(function(e,t){w.each({padding:"inner"+e,content:t,"":"outer"+e},(function(n,i){w.fn[i]=function(r,o){var s=arguments.length&&(n||"boolean"!=typeof r),a=n||(!0===r||!0===o?"margin":"border");return V(this,(function(t,n,r){var o;return m(t)?0===i.indexOf("outer")?t["inner"+e]:t.document.documentElement["client"+e]:9===t.nodeType?(o=t.documentElement,Math.max(t.body["scroll"+e],o["scroll"+e],t.body["offset"+e],o["offset"+e],o["client"+e])):void 0===r?w.css(t,n,a):w.style(t,n,r,a)}),t,s?r:void 0,s)}}))})),w.each(["ajaxStart","ajaxStop","ajaxComplete","ajaxError","ajaxSuccess","ajaxSend"],(function(e,t){w.fn[t]=function(e){return this.on(t,e)}})),w.fn.extend({bind:function(e,t,n){return this.on(e,null,t,n)},unbind:function(e,t){return this.off(e,null,t)},delegate:function(e,t,n,i){return this.on(t,e,n,i)},undelegate:function(e,t,n){return 1===arguments.length?this.off(e,"**"):this.off(t,e||"**",n)},hover:function(e,t){return this.mouseenter(e).mouseleave(t||e)}}),w.each("blur focus focusin focusout resize scroll click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup contextmenu".split(" "),(function(e,t){w.fn[t]=function(e,n){return arguments.length>0?this.on(t,null,e,n):this.trigger(t)}}));var Kt=/^[\s\uFEFF\xA0]+|([^\s\uFEFF\xA0])[\s\uFEFF\xA0]+$/g;w.proxy=function(e,t){var n,i,o;if("string"==typeof t&&(n=e[t],t=e,e=n),p(e))return i=r.call(arguments,2),o=function(){return e.apply(t||this,i.concat(r.call(arguments)))},o.guid=e.guid=e.guid||w.guid++,o},w.holdReady=function(e){e?w.readyWait++:w.ready(!0)},w.isArray=Array.isArray,w.parseJSON=JSON.parse,w.nodeName=C,w.isFunction=p,w.isWindow=m,w.camelCase=Y,w.type=b,w.now=Date.now,w.isNumeric=function(e){var t=w.type(e);return("number"===t||"string"===t)&&!isNaN(e-parseFloat(e))},w.trim=function(e){return null==e?"":(e+"").replace(Kt,"$1")};var Gt=e.jQuery,Jt=e.$;return w.noConflict=function(t){return e.$===w&&(e.$=Jt),t&&e.jQuery===w&&(e.jQuery=Gt),w},void 0===t&&(e.jQuery=e.$=w),w}))}(r);var o=i,s={"Visualization.Histogram.MeasureAxisLabel":{id:"Visualization.Histogram.MeasureAxisLabel",locale:{"en-US":"Frequency","zh-TW":"頻率","zh-CN":"频率","tr-TR":"Sıklık","sv-SE":"Frekvens","it-IT":"Frequenza","es-ES":"Frecuencia","de-DE":"Häufigkeit","pl-PL":"Częstotliwość","nl-NL":"Frequentie","ko-KR":"빈도","pt-BR":"Frequência","fr-FR":"Fréquence","ja-JP":"レコード数","ru-RU":"Частота"}},"waterfall.legend.positiveValue.label":{id:"waterfall.legend.positiveValue.label",locale:{"en-US":"Positive","zh-TW":"正值","zh-CN":"正","tr-TR":"Pozitif","sv-SE":"Positiv","it-IT":"Positivi","es-ES":"Positivo","de-DE":"Positiv","pl-PL":"Dodatnie","nl-NL":"Positief","ko-KR":"양수","pt-BR":"Positivo","fr-FR":"Positive","ja-JP":"正","ru-RU":"Положительное"}},"waterfall.legend.negativeValue.label":{id:"waterfall.legend.negativeValue.label",locale:{"en-US":"Negative","zh-TW":"負值","zh-CN":"负","tr-TR":"Negatif","sv-SE":"Negativ","it-IT":"Negativi","es-ES":"Negativo","de-DE":"Negativ","pl-PL":"Ujemne","nl-NL":"Negatief","ko-KR":"음수","pt-BR":"Negativo","fr-FR":"Négative","ja-JP":"負","ru-RU":"Отрицательное"}},"waterfall.legend.subtotal.label":{id:"waterfall.legend.subtotal.label",locale:{"en-US":"Subtotal","zh-TW":"小計","zh-CN":"小计","tr-TR":"Ara Toplam","sv-SE":"Deltotal","it-IT":"Subtotale","es-ES":"Subtotal","de-DE":"Teilsumme","pl-PL":"Suma częściowa","nl-NL":"Subtotaal","ko-KR":"소계","pt-BR":"Subtotal","fr-FR":"Sous-total","ja-JP":"小計","ru-RU":"Подытог"}},Object_Disclaimer_LimitedData:{id:"Object.Disclaimer.LimitedData",locale:{"en-US":"Currently showing a limited data set.","zh-TW":"目前顯示的是有限的資料集。","zh-CN":"当前正显示有限的数据集。","tr-TR":"Şu anda sınırlı bir veri kümesi gösteriliyor.","sv-SE":"Just nu visas en begränsad uppsättning data.","it-IT":"Attualmente viene visualizzata una serie di dati limitata.","es-ES":"Mostrando actualmente un conjunto limitado de datos.","de-DE":"Zurzeit wird nur ein beschränkter Datensatz angezeigt.","pl-PL":"Aktualnie przedstawiany jest ograniczony zestaw danych.","nl-NL":"Momenteel wordt een beperkte gegevensverzameling getoond.","ko-KR":"현재 제한된 데이터 집합을 표시하고 있습니다.","pt-BR":"Mostrando um conjunto de dados limitado.","fr-FR":"Affichage d'un ensemble de données limité pour l'instant.","ja-JP":"現在、限定的なデータ セットを表示しています。","ru-RU":"В настоящее время отображается ограниченный набор данных."}},Object_Disclaimer_OnlyNanData:{id:"Object.Disclaimer.OnlyNanData",locale:{"en-US":"The chart is not displayed because it contains only undefined values.","zh-TW":"系統不會顯示圖表,因為該圖表僅包含未定義的值。","zh-CN":"未显示图表,因为它仅包含未定义的值。","tr-TR":"Yalnızca tanımsız değerleri içermesi nedeniyle grafik görüntülenmiyor.","sv-SE":"Diagrammet visas inte eftersom det enbart innehåller odefinierade värden.","it-IT":"Il grafico non è visualizzato poiché contiene solo valori non definiti.","es-ES":"El gráfico no se muestra porque solo contiene valores indefinidos.","de-DE":"Das Diagramm wird nicht angezeigt, da es nur nicht definierte Werte enthält.","pl-PL":"Wykres nie jest wyświetlany, ponieważ zawiera wartości niezdefiniowane.","nl-NL":"De grafiek wordt niet weergegeven omdat deze alleen ongedefinieerde waarden bevat.","ko-KR":"정의되지 않은 값만 포함되어 있으므로 차트가 표시되지 않습니다.","pt-BR":"O gráfico não foi exibido, porque contém apenas valores não definidos.","fr-FR":"Le graphique n'est pas affiché, car il contient uniquement des valeurs non définies.","ja-JP":"未定義の値しか含まれていないため、チャートは表示されていません。","ru-RU":"Диаграмма не отображается, поскольку она содержит только неопределенные значения."}},Object_Disclaimer_OnlyNegativeOrZeroValues:{id:"Object.Disclaimer.OnlyNegativeOrZeroValues",locale:{"en-US":"The chart is not displayed because it contains only negative or zero values.","zh-TW":"系統不會顯示圖表,因為該圖表僅包含負值或零值。","zh-CN":"未显示图表,因为它仅包含负值或零值。","tr-TR":"Yalnızca negatif veya sıfır değerlerini içermesi nedeniyle grafik görüntülenmiyor.","sv-SE":"Diagrammet visas inte eftersom det enbart innehåller negativa eller nollvärden","it-IT":"Il grafico non viene visualizzato poiché contiene solo valori negativi o uguali a zero.","es-ES":"El gráfico no se muestra porque sólo contiene valores negativos o valores cero.","de-DE":"Das Diagramm wird nicht angezeigt, da es nur negative oder 0-Werte enthält.","pl-PL":"Wykres nie jest wyświetlany, ponieważ zawiera wartości ujemne lub zerowe.","nl-NL":"De grafiek wordt niet weergegeven omdat het alleen negatieve waarden of nulwaarden bevat.","ko-KR":"음수 또는 zero 값만 포함되어 있으므로 차트가 표시되지 않습니다.","pt-BR":"O gráfico não foi exibido, porque contém apenas valores negativos ou zero.","fr-FR":"Le graphique n'est pas affiché, car il contient uniquement des valeurs négatives ou égales à zéro.","ja-JP":"チャートは負の値またはゼロ値しか含まれていないため、表示されていません。","ru-RU":"Диаграмма не отображается, поскольку она содержит только отрицательные или нулевые значения."}},Object_Disclaimer_RequireNumericDimension:{id:"Object.Disclaimer.RequireNumericDimension",locale:{"en-US":"This visualization requires a numeric diemnsion."}},"properties.boxplot.calculationMode.tukey.elements.boxEnd":{id:"properties.boxplot.calculationMode.tukey.elements.boxEnd",locale:{"en-US":"Third quartile","zh-TW":"第三四分位數","zh-CN":"第 3 个四分位","tr-TR":"Üçüncü çeyrek","sv-SE":"Tredje kvartilen","it-IT":"Terzo quartile","es-ES":"Tercer cuartil","de-DE":"Drittes Quartil","pl-PL":"Trzeci kwartyl","nl-NL":"Derde kwartiel","ko-KR":"3번째 사분위수","pt-BR":"Terceiro quartil","fr-FR":"Troisième quartile","ja-JP":"第 3 四分位数","ru-RU":"Третий квартиль"}},"properties.boxplot.calculationMode.tukey.elements.boxMiddle":{id:"properties.boxplot.calculationMode.tukey.elements.boxMiddle",locale:{"en-US":"Median","zh-TW":"中位數","zh-CN":"中间值","tr-TR":"Medyan","sv-SE":"Median","it-IT":"Mediana","es-ES":"Mediana","de-DE":"Drittes Quartil","pl-PL":"Mediana","nl-NL":"Mediaan","ko-KR":"중앙값","pt-BR":"Mediano","fr-FR":"Médiane","ja-JP":"中央値","ru-RU":"Медианное"}},"properties.boxplot.calculationMode.tukey.elements.boxStart":{id:"properties.boxplot.calculationMode.tukey.elements.boxStart",locale:{"en-US":"First quartile","zh-TW":"第一四分位數","zh-CN":"第 1 个四分位","tr-TR":"İlk çeyrek","sv-SE":"Första kvartilen","it-IT":"Primo quartile","es-ES":"Primer cuartil","de-DE":"Erstes Quartil","pl-PL":"Pierwszy kwartyl","nl-NL":"Eerste kwartiel","ko-KR":"1번째 사분위수","pt-BR":"Primeiro quartil","fr-FR":"Premier quartile","ja-JP":"第 1 四分位数","ru-RU":"Первый квартиль"}},"properties.boxplot.calculationMode.tukey.elements.firstWhisker":{id:"properties.boxplot.calculationMode.tukey.elements.firstWhisker",locale:{"en-US":"Box start - {0} IQR","zh-TW":"方塊開始 - {0} IQR","zh-CN":"框开始 - {0} IQR","tr-TR":"Kutu başlangıcı - {0} IQR","sv-SE":"Rutans start - {0} IQR","it-IT":"Inizio scatola - {0} IQR","es-ES":"Inicio de caja - {0} IQR","de-DE":"Box-Beginn - {0} IQR","pl-PL":"Początek wykresu pudełkowego - {0} IQR","nl-NL":"Begin box - {0} IQR","ko-KR":"상자 시작 - {0} IQR","pt-BR":"Início da caixa - {0} IQR","fr-FR":"Début de la boîte - {0} IQR","ja-JP":"ボックス開始 - {0} IQR","ru-RU":"Начало поля - {0} IQR"}},"properties.boxplot.calculationMode.tukey.elements.lastWhisker":{id:"properties.boxplot.calculationMode.tukey.elements.lastWhisker",locale:{"en-US":"Box end + {0} IQR","zh-TW":"方塊結束 + {0} IQR","zh-CN":"框结束 + {0} IQR","tr-TR":"Kutu bitişi + {0} IQR","sv-SE":"Rutans slut + {0} IQR","it-IT":"Fine scatola + {0} IQR","es-ES":"Fin de caja + {0} IQR","de-DE":"Box-Ende + {0} IQR","pl-PL":"Koniec wykresu pudełkowego - {0} IQR","nl-NL":"Einde box + {0} IQR","ko-KR":"상자 끝 + {0} IQR","pt-BR":"Fim da caixa + {0} IQR","fr-FR":"Fin de la boîte + {0} IQR","ja-JP":"ボックス終了 + {0} IQR","ru-RU":"Конец поля + {0} IQR"}},"properties.boxplot.calculationMode.stdDev.elements.boxEnd":{id:"properties.boxplot.calculationMode.stdDev.elements.boxEnd",locale:{"en-US":"Box middle + 1 standard deviation","zh-TW":"方塊中間 + 1 個標準差","zh-CN":"框中部 + 1 个标准偏差","tr-TR":"Kutu ortası + 1 standart sapma","sv-SE":"Rutans mitt + 1 standardavvikelse","it-IT":"Centro scatola + 1 deviazione standard","es-ES":"Mitad de la caja + 1 desviación estándar","de-DE":"Box-Mitte +1 Standardabweichung","pl-PL":"Środek wykresu pudełkowego + 1 odch. stand","nl-NL":"Midden box + 1 standaardafwijking","ko-KR":"상자 중간 + 1개 표준 편차","pt-BR":"Meio da caixa + 1 desvio padrão","fr-FR":"Milieu de la boîte + 1 écart type","ja-JP":"ボックス中間 + 1 標準偏差","ru-RU":"Середина поля + 1 стандартное отклонение"}},"properties.boxplot.calculationMode.stdDev.elements.boxMiddle":{id:"properties.boxplot.calculationMode.stdDev.elements.boxMiddle",locale:{"en-US":"Average","zh-TW":"平均值","zh-CN":"平均值","tr-TR":"Ortalama","sv-SE":"Medel","it-IT":"Media","es-ES":"Media","de-DE":"Durchschnitt","pl-PL":"Średnia","nl-NL":"Gemiddelde","ko-KR":"평균","pt-BR":"Média","fr-FR":"Moyenne","ja-JP":"平均値","ru-RU":"Среднее"}},"properties.boxplot.calculationMode.stdDev.elements.boxStart":{id:"properties.boxplot.calculationMode.stdDev.elements.boxStart",locale:{"en-US":"Box middle - 1 standard deviation","zh-TW":"方塊中間 - 1 個標準差","zh-CN":"框中部 - 1 个标准偏差","tr-TR":"Kutu ortası - 1 standart sapma","sv-SE":"Rutans mitt - 1 standardavvikelse","it-IT":"Centro scatola - 1 deviazione standard","es-ES":"Mitad de la caja - {1} desviación estándar","de-DE":"Box-Mitte -1 Standardabweichung","pl-PL":"Środek wykresu pudełkowego - 1 odch. stand","nl-NL":"Midden box - 1 standaardafwijking","ko-KR":"상자 중간 - 1개 표준 편차","pt-BR":"Середина поля - 1 стандартное отклонение","fr-FR":"Milieu de la boîte - 1 écart type","ja-JP":"ボックス中間 - 1 標準偏差","ru-RU":"Первый квартиль"}},"properties.boxplot.calculationMode.stdDev.elements.firstWhisker":{id:"properties.boxplot.calculationMode.stdDev.elements.firstWhisker",locale:{"en-US":"Box middle - {0} standard deviations","zh-TW":"方塊中間 - {0} 個標準差","zh-CN":"框中部 - {0} 个标准偏差","tr-TR":"Kutu ortası - {0} standart sapma","sv-SE":"Rutans mitt - {0} standardavvikelser","it-IT":"Centro scatola - {0} deviazioni standard","es-ES":"Mitad de la caja - {0} desviaciones estándar","de-DE":"Box-Mitte -{0} Standardabweichung","pl-PL":"Środek wykresu pudełkowego - {0} odch. stand","nl-NL":"Midden box - {0} standaardafwijkingen","ko-KR":"상자 중간 - {0}개 표준 편차","pt-BR":"Meio da caixa - {0} desvios padrão","fr-FR":"Milieu de la boîte - {0} écarts types","ja-JP":"ボックス中間 - {0} 標準偏差","ru-RU":"Середина поля - {0} стандартное(ых) отклонение(й)"}},"properties.boxplot.calculationMode.stdDev.elements.lastWhisker":{id:"properties.boxplot.calculationMode.stdDev.elements.lastWhisker",locale:{"en-US":"Box middle + {0} standard deviations","zh-TW":"方塊中間 + {0} 個標準差","zh-CN":"框中部 + {0} 个标准偏差","tr-TR":"Kutu ortası + {0} standart sapma","sv-SE":"Rutans mitt + {0} standardavvikelser","it-IT":"Centro scatola + {0} deviazioni standard","es-ES":"Mitad de la caja + {0} desviaciones estándar","de-DE":"Box-Mitte +{0} Standardabweichung","pl-PL":"Środek wykresu pudełkowego + {0} odch. stand","nl-NL":"Midden box + {0} standaardafwijkingen","ko-KR":"상자 중간 + {0}개 표준 편차","pt-BR":"Meio da caixa + {0} desvios padrão","fr-FR":"Milieu de la boîte + {0} écarts types","ja-JP":"ボックス中間 + {0} 標準偏差","ru-RU":"Середина поля + {0} стандартное(ых) отклонение(й)"}},"properties.boxplot.calculationMode.fractiles.elements.boxEnd":{id:"properties.boxplot.calculationMode.fractiles.elements.boxEnd",locale:{"en-US":"Third quartile","zh-TW":"第三四分位數","zh-CN":"第 3 个四分位","tr-TR":"Üçüncü çeyrek","sv-SE":"Tredje kvartilen","it-IT":"Terzo quartile<","es-ES":"Tercer cuartil","de-DE":"Drittes Quartil","pl-PL":"Trzeci kwartyl","nl-NL":"Derde kwartiel","ko-KR":"3번째 사분위수","pt-BR":"Terceiro quartil","fr-FR":"Troisième quartile","ja-JP":"第 3 四分位数","ru-RU":"Третий квартиль"}},"properties.boxplot.calculationMode.fractiles.elements.boxMiddle":{id:"properties.boxplot.calculationMode.fractiles.elements.boxMiddle",locale:{"en-US":"Median","zh-TW":"中位數","zh-CN":"中间值","tr-TR":"Medyan","sv-SE":"Median","it-IT":"Mediana","es-ES":"Mediana","de-DE":"Median","pl-PL":"Mediana","nl-NL":"Mediaan","ko-KR":"중앙값","pt-BR":"Mediano","fr-FR":"Médiane","ja-JP":"中央値","ru-RU":"Медианное"}},"properties.boxplot.calculationMode.fractiles.elements.boxStart":{id:"properties.boxplot.calculationMode.fractiles.elements.boxStart",locale:{"en-US":"First quartile","zh-TW":"第一四分位數","zh-CN":"第 1 个四分位","tr-TR":"İlk çeyrek","sv-SE":"Första kvartilen","it-IT":"Primo quartile","es-ES":"Primer cuartil","de-DE":"Erstes Quartil","pl-PL":"Pierwszy kwartyl","nl-NL":"Eerste kwartiel","ko-KR":"1번째 사분위수","pt-BR":"Primeiro quartil","fr-FR":"Premier quartile","ja-JP":"第 1 四分位数","ru-RU":"Первый квартиль"}},"properties.boxplot.calculationMode.fractiles.elements.firstWhisker.fifth":{id:"properties.boxplot.calculationMode.fractiles.elements.firstWhisker.fifth",locale:{"en-US":"5th percentile","zh-TW":"第 5 個百分位數","zh-CN":"第 5 个百分位","tr-TR":"5. yüzdebirlik","sv-SE":"5:e percentilen","it-IT":"5° percentile","es-ES":"5º percentil","de-DE":"5. Perzentil","pl-PL":"5. percentyl","nl-NL":"5e percentiel","ko-KR":"5번째 백분위수","pt-BR":"5º percentil","fr-FR":"5e centile","ja-JP":"5 番目のパーセンタイル","ru-RU":"5-й процентиль"}},"properties.boxplot.calculationMode.fractiles.elements.firstWhisker.first":{id:"properties.boxplot.calculationMode.fractiles.elements.firstWhisker.first",locale:{"en-US":"1st percentile","zh-TW":"第 1 個百分位數","zh-CN":"第 1 个百分位","tr-TR":"1. yüzdebirlik","sv-SE":"1:e percentilen","it-IT":"1° percentile","es-ES":"1er percentil","de-DE":"1. Perzentil","pl-PL":"1. percentyl","nl-NL":"1e percentiel","ko-KR":"1번째 백분위수","pt-BR":"1º percentil","fr-FR":"1er centile","ja-JP":"1 番目のパーセンタイル","ru-RU":"1-й процентиль"}},"properties.boxplot.calculationMode.fractiles.elements.firstWhisker.min":{id:"properties.boxplot.calculationMode.fractiles.elements.firstWhisker.min",locale:{"en-US":"Minimum","zh-TW":"最小","zh-CN":"最小值","tr-TR":"En az","sv-SE":"Min","it-IT":"Minimo","es-ES":"Mínimo","de-DE":"Minimum","pl-PL":"Minimum","nl-NL":"Minimum","ko-KR":"최소","pt-BR":"Mínimo","fr-FR":"Minimale","ja-JP":"最小値","ru-RU":"Минимум"}},"properties.boxplot.calculationMode.fractiles.elements.firstWhisker.tenth":{id:"properties.boxplot.calculationMode.fractiles.elements.firstWhisker.tenth",locale:{"en-US":"10th percentile","zh-TW":"第 10 個百分位數","zh-CN":"第 10 个百分位","tr-TR":"10. yüzdebirlik","sv-SE":"10:e percentilen","it-IT":"10° percentile","es-ES":"10º percentil","de-DE":"10. Perzentil","pl-PL":"10. percentyl","nl-NL":"10e percentiel","ko-KR":"10번째 백분위수","pt-BR":"10º percentil","fr-FR":"10e centile","ja-JP":"10 番目のパーセンタイル","ru-RU":"10-й процентиль"}},"properties.boxplot.calculationMode.fractiles.elements.lastWhisker.max":{id:"properties.boxplot.calculationMode.fractiles.elements.lastWhisker.max",locale:{"en-US":"Maximum","zh-TW":"最大","zh-CN":"最大值","tr-TR":"En fazla","sv-SE":"Max","it-IT":"Massimo","es-ES":"Máximo","de-DE":"Maximum","pl-PL":"Maksimum","nl-NL":"Maximum","ko-KR":"최대","pt-BR":"Máximo","fr-FR":"Maximale","ja-JP":"最大値","ru-RU":"Максимум"}},"properties.boxplot.calculationMode.fractiles.elements.lastWhisker.ninetieth":{id:"properties.boxplot.calculationMode.fractiles.elements.lastWhisker.ninetieth",locale:{"en-US":"90th percentile","zh-TW":"第 90 個百分位數","zh-CN":"第 90 个百分位","tr-TR":"90. yüzdebirlik","sv-SE":"90:e percentilen","it-IT":"90° percentile","es-ES":"90º percentil","de-DE":"90. Perzentil","pl-PL":"90. percentyl","nl-NL":"90e percentiel","ko-KR":"90번째 백분위수","pt-BR":"90º percentil","fr-FR":"90e centile","ja-JP":"90 番目の百分位数","ru-RU":"90-й процентиль"}},"properties.boxplot.calculationMode.fractiles.elements.lastWhisker.ninetyfifth":{id:"properties.boxplot.calculationMode.fractiles.elements.lastWhisker.ninetyfifth",locale:{"en-US":"95th percentile","zh-TW":"第 95 個百分位數","zh-CN":"第 95 个百分位","tr-TR":"95. yüzdebirlik","sv-SE":"95:e percentilen","it-IT":"95° percentile","es-ES":"95º percentil","de-DE":"95. Perzentil","pl-PL":"95. percentyl","nl-NL":"95e percentiel","ko-KR":"95번째 백분위수","pt-BR":"95º percentil","fr-FR":"95e centile","ja-JP":"95 番目の百分位数","ru-RU":"95-й процентиль"}},"properties.boxplot.calculationMode.fractiles.elements.lastWhisker.ninetynineth":{id:"properties.boxplot.calculationMode.fractiles.elements.lastWhisker.ninetynineth",locale:{"en-US":"99th percentile","zh-TW":"第 99 個百分位數","zh-CN":"第 99 个百分位","tr-TR":"99. yüzdebirlik","sv-SE":"99:e percentilen","it-IT":"99° percentile","es-ES":"99º percentil","de-DE":"99. Perzentil","pl-PL":"99. percentyl","nl-NL":"99e percentiel","ko-KR":"99번째 백분위수","pt-BR":"99º percentil","fr-FR":"99e centile","ja-JP":"99 番目の百分位数","ru-RU":"99-й процентиль"}}};var a={a:7,c:6,h:1,l:2,m:2,q:4,s:4,t:2,v:1,z:0},l=/([astvzqmhlc])([^astvzqmhlc]*)/gi,c=/-?[0-9]*\.?[0-9]+(?:e[-+]?\d+)?/gi;var u=function(e){var t=[],n=String(e).trim();return"M"!==n[0]&&"m"!==n[0]||n.replace(l,(function(e,n,i){var r=n.toLowerCase(),o=function(e){var t=e.match(c);return t?t.map(Number):[]}(i),s=n;if("m"===r&&o.length>2&&(t.push([s].concat(o.splice(0,2))),r="l",s="m"===s?"l":"L"),o.length<a[r])return"";for(t.push([s].concat(o.splice(0,a[r])));o.length>=a[r]&&o.length&&a[r];)t.push([s].concat(o.splice(0,a[r])));return""})),t};function h(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}function d(e){return function(e){if(Array.isArray(e))return f(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(!e)return;if("string"==typeof e)return f(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return f(e,t)}(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 f(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,i=new Array(t);n<t;n++)i[n]=e[n];return i}var p=u;function m(e,t){var n=e.x*Math.cos(t)-e.y*Math.sin(t),i=e.y*Math.cos(t)+e.x*Math.sin(t);e.x=n,e.y=i}function g(e,t,n){e.x+=t,e.y+=n}function y(e,t){e.x*=t,e.y*=t}var v=function(e){if(void 0!==e&&e.CanvasRenderingContext2D&&(!e.Path2D||!function(e){var t=e.document.createElement("canvas").getContext("2d"),n=new e.Path2D("M0 0 L1 1");return t.strokeStyle="red",t.lineWidth=1,t.stroke(n),255===t.getImageData(0,0,1,1).data[0]}(e))){var t=function(){function e(t){var n;(function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.segments=[],t&&t instanceof e)?(n=this.segments).push.apply(n,d(t.segments)):t&&(this.segments=p(t))}var t,n,i;return t=e,n=[{key:"addPath",value:function(t){var n;t&&t instanceof e&&(n=this.segments).push.apply(n,d(t.segments))}},{key:"moveTo",value:function(e,t){this.segments.push(["M",e,t])}},{key:"lineTo",value:function(e,t){this.segments.push(["L",e,t])}},{key:"arc",value:function(e,t,n,i,r,o){this.segments.push(["AC",e,t,n,i,r,!!o])}},{key:"arcTo",value:function(e,t,n,i,r){this.segments.push(["AT",e,t,n,i,r])}},{key:"ellipse",value:function(e,t,n,i,r,o,s,a){this.segments.push(["E",e,t,n,i,r,o,s,!!a])}},{key:"closePath",value:function(){this.segments.push(["Z"])}},{key:"bezierCurveTo",value:function(e,t,n,i,r,o){this.segments.push(["C",e,t,n,i,r,o])}},{key:"quadraticCurveTo",value:function(e,t,n,i){this.segments.push(["Q",e,t,n,i])}},{key:"rect",value:function(e,t,n,i){this.segments.push(["R",e,t,n,i])}}],n&&h(t.prototype,n),i&&h(t,i),Object.defineProperty(t,"prototype",{writable:!1}),e}(),n=e.CanvasRenderingContext2D.prototype.fill,i=e.CanvasRenderingContext2D.prototype.stroke;e.CanvasRenderingContext2D.prototype.fill=function(){for(var e=arguments.length,t=new Array(e),i=0;i<e;i++)t[i]=arguments[i];var r="nonzero";if(0===t.length||1===t.length&&"string"==typeof t[0])n.apply(this,t);else{2===arguments.length&&(r=t[1]);var s=t[0];o(this,s.segments),n.call(this,r)}},e.CanvasRenderingContext2D.prototype.stroke=function(e){e?(o(this,e.segments),i.call(this)):i.call(this)};var r=e.CanvasRenderingContext2D.prototype.isPointInPath;e.CanvasRenderingContext2D.prototype.isPointInPath=function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];if("Path2D"===t[0].constructor.name){var i=t[1],s=t[2],a=t[3]||"nonzero",l=t[0];return o(this,l.segments),r.apply(this,[i,s,a])}return r.apply(this,t)},e.Path2D=t}function o(e,t){var n,i,r,o,s,a,l,c,u,h,d,f,p,v,b,x,w,q,M,D,S,_,C,k,E,A,T={x:0,y:0},I={x:0,y:0};e.beginPath();for(var R=0;R<t.length;++R){var N=t[R];switch("S"!==(D=N[0])&&"s"!==D&&"C"!==D&&"c"!==D&&(_=null,C=null),"T"!==D&&"t"!==D&&"Q"!==D&&"q"!==D&&(k=null,E=null),D){case"m":case"M":"m"===D?(d+=N[1],p+=N[2]):(d=N[1],p=N[2]),"M"!==D&&T||(T={x:d,y:p}),e.moveTo(d,p);break;case"l":d+=N[1],p+=N[2],e.lineTo(d,p);break;case"L":d=N[1],p=N[2],e.lineTo(d,p);break;case"H":d=N[1],e.lineTo(d,p);break;case"h":d+=N[1],e.lineTo(d,p);break;case"V":p=N[1],e.lineTo(d,p);break;case"v":p+=N[1],e.lineTo(d,p);break;case"a":case"A":"a"===D?(d+=N[6],p+=N[7]):(d=N[6],p=N[7]),x=N[1],w=N[2],l=N[3]*Math.PI/180,r=!!N[4],o=!!N[5],s={x:d,y:p},m(a={x:(I.x-s.x)/2,y:(I.y-s.y)/2},-l),(c=a.x*a.x/(x*x)+a.y*a.y/(w*w))>1&&(x*=c=Math.sqrt(c),w*=c),u=x*x*w*w,h=x*x*a.y*a.y+w*w*a.x*a.x,y(S={x:x*a.y/w,y:-w*a.x/x},o!==r?Math.sqrt((u-h)/h)||0:-Math.sqrt((u-h)/h)||0),i=Math.atan2((a.y-S.y)/w,(a.x-S.x)/x),n=Math.atan2(-(a.y+S.y)/w,-(a.x+S.x)/x),m(S,l),g(S,(s.x+I.x)/2,(s.y+I.y)/2),e.save(),e.translate(S.x,S.y),e.rotate(l),e.scale(x,w),e.arc(0,0,1,i,n,!o),e.restore();break;case"C":_=N[3],C=N[4],d=N[5],p=N[6],e.bezierCurveTo(N[1],N[2],_,C,d,p);break;case"c":e.bezierCurveTo(N[1]+d,N[2]+p,N[3]+d,N[4]+p,N[5]+d,N[6]+p),_=N[3]+d,C=N[4]+p,d+=N[5],p+=N[6];break;case"S":null!==_&&null!==C||(_=d,C=p),e.bezierCurveTo(2*d-_,2*p-C,N[1],N[2],N[3],N[4]),_=N[1],C=N[2],d=N[3],p=N[4];break;case"s":null!==_&&null!==C||(_=d,C=p),e.bezierCurveTo(2*d-_,2*p-C,N[1]+d,N[2]+p,N[3]+d,N[4]+p),_=N[1]+d,C=N[2]+p,d+=N[3],p+=N[4];break;case"Q":k=N[1],E=N[2],d=N[3],p=N[4],e.quadraticCurveTo(k,E,d,p);break;case"q":k=N[1]+d,E=N[2]+p,d+=N[3],p+=N[4],e.quadraticCurveTo(k,E,d,p);break;case"T":null!==k&&null!==E||(k=d,E=p),k=2*d-k,E=2*p-E,d=N[1],p=N[2],e.quadraticCurveTo(k,E,d,p);break;case"t":null!==k&&null!==E||(k=d,E=p),k=2*d-k,E=2*p-E,d+=N[1],p+=N[2],e.quadraticCurveTo(k,E,d,p);break;case"z":case"Z":d=T.x,p=T.y,T=void 0,e.closePath();break;case"AC":d=N[1],p=N[2],b=N[3],i=N[4],n=N[5],A=N[6],e.arc(d,p,b,i,n,A);break;case"AT":f=N[1],v=N[2],d=N[3],p=N[4],b=N[5],e.arcTo(f,v,d,p,b);break;case"E":d=N[1],p=N[2],x=N[3],w=N[4],l=N[5],i=N[6],n=N[7],A=N[8],e.save(),e.translate(d,p),e.rotate(l),e.scale(x,w),e.arc(0,0,1,i,n,A),e.restore();break;case"R":d=N[1],p=N[2],q=N[3],M=N[4],T={x:d,y:p},e.rect(d,p,q,M)}I.x=d,I.y=p}}},b=u,x=v;"undefined"!=typeof window&&x(window);var w={path2dPolyfill:x,parsePath:b},q=Object.prototype.hasOwnProperty,M=Object.prototype.toString,D=Object.defineProperty,S=Object.getOwnPropertyDescriptor,_=function(e){return"function"==typeof Array.isArray?Array.isArray(e):"[object Array]"===M.call(e)},C=function(e){if(!e||"[object Object]"!==M.call(e))return!1;var t,n=q.call(e,"constructor"),i=e.constructor&&e.constructor.prototype&&q.call(e.constructor.prototype,"isPrototypeOf");if(e.constructor&&!n&&!i)return!1;for(t in e);return void 0===t||q.call(e,t)},k=function(e,t){D&&"__proto__"===t.name?D(e,t.name,{enumerable:!0,configurable:!0,value:t.newValue,writable:!0}):e[t.name]=t.newValue},E=function(e,t){if("__proto__"===t){if(!q.call(e,t))return;if(S)return S(e,t).value}return e[t]},A=function e(){var t,n,i,r,o,s,a=arguments[0],l=1,c=arguments.length,u=!1;for("boolean"==typeof a&&(u=a,a=arguments[1]||{},l=2),(null==a||"object"!=typeof a&&"function"!=typeof a)&&(a={});l<c;++l)if(null!=(t=arguments[l]))for(n in t)i=E(a,n),a!==(r=E(t,n))&&(u&&r&&(C(r)||(o=_(r)))?(o?(o=!1,s=i&&_(i)?i:[]):s=i&&C(i)?i:{},k(a,{name:n,newValue:e(u,s,r)})):void 0!==r&&k(a,{name:n,newValue:r}));return a},T="2.2.2";function I(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,i)}return n}function R(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){N(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 N(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 i=n.call(e,t||"default");if("object"!=typeof i)return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:String(t)}(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function O(e){return!!e.changedTouches}function P(e){return"number"==typeof e&&!isNaN(e)}function L(e){return"number"!=typeof e||isNaN(e)}function F(e){const t=e.length;let n=NaN,i=NaN,r=NaN,o=NaN;for(let s=0;s<t;s++)n=isNaN(n)?e[s].x:Math.min(n,e[s].x),i=isNaN(i)?e[s].x:Math.max(i,e[s].x),r=isNaN(r)?e[s].y:Math.min(r,e[s].y),o=isNaN(o)?e[s].y:Math.max(o,e[s].y);return[n,r,i,o]}function z(e){return[{x:e.x1||0,y:e.y1||0},{x:e.x2||0,y:e.y2||0}]}function j(e){return[{x:e.x,y:e.y},{x:e.x+e.width,y:e.y},{x:e.x+e.width,y:e.y+e.height},{x:e.x,y:e.y+e.height}]}function H(e){const[t,n,i,r]=F(e);return{x:t,y:n,width:i-t,height:r-n}}function B(e){return{x1:e[0].x,y1:e[0].y,x2:e[1].x,y2:e[1].y}}function V(e){const{x:t,y:n,width:i,height:r,x1:o,x2:s,y1:a,y2:l,cx:c,cy:u,r:h,vertices:d}=e||{};return P(c)&&P(u)&&P(h)?"circle":P(o)&&P(s)&&P(a)&&P(l)?"line":P(t)&&P(n)&&P(i)&&P(r)?"rect":P(t)&&P(n)?"point":Array.isArray(d)?d.every((e=>Array.isArray(e)))?"geopolygon":"polygon":null}function $(e,t){return{x:t.x-e,y:t.y-e,width:t.width+e,height:t.height+e}}function W(e,t){let{types:n,logger:i}=t;const r={},o=[];Array.isArray(e)?o.push(...e):(i.warn('Deprecated: "data-source" configuration"'),o.push(e)),o.forEach(((e,t)=>{let o=n(e.type);if(o){let n=e.key;void 0===e.key&&(i.warn("Missing key for dataset. Using index '".concat(t,"' as key.")),n=t);let s=o({key:n,data:e.data,config:e.config});r[n]=s}}));return e=>e?r[e]:r[Object.keys(r)[0]]}var U=Math.PI,Y=2*U,X=1e-6,K=Y-X;function G(){this._x0=this._y0=this._x1=this._y1=null,this._=""}function J(){return new G}function Z(e){return function(){return e}}G.prototype=J.prototype={constructor:G,moveTo:function(e,t){this._+="M"+(this._x0=this._x1=+e)+","+(this._y0=this._y1=+t)},closePath:function(){null!==this._x1&&(this._x1=this._x0,this._y1=this._y0,this._+="Z")},lineTo:function(e,t){this._+="L"+(this._x1=+e)+","+(this._y1=+t)},quadraticCurveTo:function(e,t,n,i){this._+="Q"+ +e+","+ +t+","+(this._x1=+n)+","+(this._y1=+i)},bezierCurveTo:function(e,t,n,i,r,o){this._+="C"+ +e+","+ +t+","+ +n+","+ +i+","+(this._x1=+r)+","+(this._y1=+o)},arcTo:function(e,t,n,i,r){e=+e,t=+t,n=+n,i=+i,r=+r;var o=this._x1,s=this._y1,a=n-e,l=i-t,c=o-e,u=s-t,h=c*c+u*u;if(r<0)throw new Error("negative radius: "+r);if(null===this._x1)this._+="M"+(this._x1=e)+","+(this._y1=t);else if(h>X)if(Math.abs(u*a-l*c)>X&&r){var d=n-o,f=i-s,p=a*a+l*l,m=d*d+f*f,g=Math.sqrt(p),y=Math.sqrt(h),v=r*Math.tan((U-Math.acos((p+h-m)/(2*g*y)))/2),b=v/y,x=v/g;Math.abs(b-1)>X&&(this._+="L"+(e+b*c)+","+(t+b*u)),this._+="A"+r+","+r+",0,0,"+ +(u*d>c*f)+","+(this._x1=e+x*a)+","+(this._y1=t+x*l)}else this._+="L"+(this._x1=e)+","+(this._y1=t);else;},arc:function(e,t,n,i,r,o){e=+e,t=+t,o=!!o;var s=(n=+n)*Math.cos(i),a=n*Math.sin(i),l=e+s,c=t+a,u=1^o,h=o?i-r:r-i;if(n<0)throw new Error("negative radius: "+n);null===this._x1?this._+="M"+l+","+c:(Math.abs(this._x1-l)>X||Math.abs(this._y1-c)>X)&&(this._+="L"+l+","+c),n&&(h<0&&(h=h%Y+Y),h>K?this._+="A"+n+","+n+",0,1,"+u+","+(e-s)+","+(t-a)+"A"+n+","+n+",0,1,"+u+","+(this._x1=l)+","+(this._y1=c):h>X&&(this._+="A"+n+","+n+",0,"+ +(h>=U)+","+u+","+(this._x1=e+n*Math.cos(r))+","+(this._y1=t+n*Math.sin(r))))},rect:function(e,t,n,i){this._+="M"+(this._x0=this._x1=+e)+","+(this._y0=this._y1=+t)+"h"+ +n+"v"+ +i+"h"+-n+"Z"},toString:function(){return this._}};var Q=Math.abs,ee=Math.atan2,te=Math.cos,ne=Math.max,ie=Math.min,re=Math.sin,oe=Math.sqrt,se=1e-12,ae=Math.PI,le=ae/2,ce=2*ae;function ue(e){return e>1?0:e<-1?ae:Math.acos(e)}function he(e){return e>=1?le:e<=-1?-le:Math.asin(e)}function de(e){return e.innerRadius}function fe(e){return e.outerRadius}function pe(e){return e.startAngle}function me(e){return e.endAngle}function ge(e){return e&&e.padAngle}function ye(e,t,n,i,r,o,s,a){var l=n-e,c=i-t,u=s-r,h=a-o,d=h*l-u*c;if(!(d*d<se))return[e+(d=(u*(t-o)-h*(e-r))/d)*l,t+d*c]}function ve(e,t,n,i,r,o,s){var a=e-n,l=t-i,c=(s?o:-o)/oe(a*a+l*l),u=c*l,h=-c*a,d=e+u,f=t+h,p=n+u,m=i+h,g=(d+p)/2,y=(f+m)/2,v=p-d,b=m-f,x=v*v+b*b,w=r-o,q=d*m-p*f,M=(b<0?-1:1)*oe(ne(0,w*w*x-q*q)),D=(q*b-v*M)/x,S=(-q*v-b*M)/x,_=(q*b+v*M)/x,C=(-q*v+b*M)/x,k=D-g,E=S-y,A=_-g,T=C-y;return k*k+E*E>A*A+T*T&&(D=_,S=C),{cx:D,cy:S,x01:-u,y01:-h,x11:D*(r/w-1),y11:S*(r/w-1)}}function be(){var e=de,t=fe,n=Z(0),i=null,r=pe,o=me,s=ge,a=null;function l(){var l,c,u=+e.apply(this,arguments),h=+t.apply(this,arguments),d=r.apply(this,arguments)-le,f=o.apply(this,arguments)-le,p=Q(f-d),m=f>d;if(a||(a=l=J()),h<u&&(c=h,h=u,u=c),h>se)if(p>ce-se)a.moveTo(h*te(d),h*re(d)),a.arc(0,0,h,d,f,!m),u>se&&(a.moveTo(u*te(f),u*re(f)),a.arc(0,0,u,f,d,m));else{var g,y,v=d,b=f,x=d,w=f,q=p,M=p,D=s.apply(this,arguments)/2,S=D>se&&(i?+i.apply(this,arguments):oe(u*u+h*h)),_=ie(Q(h-u)/2,+n.apply(this,arguments)),C=_,k=_;if(S>se){var E=he(S/u*re(D)),A=he(S/h*re(D));(q-=2*E)>se?(x+=E*=m?1:-1,w-=E):(q=0,x=w=(d+f)/2),(M-=2*A)>se?(v+=A*=m?1:-1,b-=A):(M=0,v=b=(d+f)/2)}var T=h*te(v),I=h*re(v),R=u*te(w),N=u*re(w);if(_>se){var O,P=h*te(b),L=h*re(b),F=u*te(x),z=u*re(x);if(p<ae&&(O=ye(T,I,F,z,P,L,R,N))){var j=T-O[0],H=I-O[1],B=P-O[0],V=L-O[1],$=1/re(ue((j*B+H*V)/(oe(j*j+H*H)*oe(B*B+V*V)))/2),W=oe(O[0]*O[0]+O[1]*O[1]);C=ie(_,(u-W)/($-1)),k=ie(_,(h-W)/($+1))}}M>se?k>se?(g=ve(F,z,T,I,h,k,m),y=ve(P,L,R,N,h,k,m),a.moveTo(g.cx+g.x01,g.cy+g.y01),k<_?a.arc(g.cx,g.cy,k,ee(g.y01,g.x01),ee(y.y01,y.x01),!m):(a.arc(g.cx,g.cy,k,ee(g.y01,g.x01),ee(g.y11,g.x11),!m),a.arc(0,0,h,ee(g.cy+g.y11,g.cx+g.x11),ee(y.cy+y.y11,y.cx+y.x11),!m),a.arc(y.cx,y.cy,k,ee(y.y11,y.x11),ee(y.y01,y.x01),!m))):(a.moveTo(T,I),a.arc(0,0,h,v,b,!m)):a.moveTo(T,I),u>se&&q>se?C>se?(g=ve(R,N,P,L,u,-C,m),y=ve(T,I,F,z,u,-C,m),a.lineTo(g.cx+g.x01,g.cy+g.y01),C<_?a.arc(g.cx,g.cy,C,ee(g.y01,g.x01),ee(y.y01,y.x01),!m):(a.arc(g.cx,g.cy,C,ee(g.y01,g.x01),ee(g.y11,g.x11),!m),a.arc(0,0,u,ee(g.cy+g.y11,g.cx+g.x11),ee(y.cy+y.y11,y.cx+y.x11),m),a.arc(y.cx,y.cy,C,ee(y.y11,y.x11),ee(y.y01,y.x01),!m))):a.arc(0,0,u,w,x,m):a.lineTo(R,N)}else a.moveTo(0,0);if(a.closePath(),l)return a=null,l+""||null}return l.centroid=function(){var n=(+e.apply(this,arguments)+ +t.apply(this,arguments))/2,i=(+r.apply(this,arguments)+ +o.apply(this,arguments))/2-ae/2;return[te(i)*n,re(i)*n]},l.innerRadius=function(t){return arguments.length?(e="function"==typeof t?t:Z(+t),l):e},l.outerRadius=function(e){return arguments.length?(t="function"==typeof e?e:Z(+e),l):t},l.cornerRadius=function(e){return arguments.length?(n="function"==typeof e?e:Z(+e),l):n},l.padRadius=function(e){return arguments.length?(i=null==e?null:"function"==typeof e?e:Z(+e),l):i},l.startAngle=function(e){return arguments.length?(r="function"==typeof e?e:Z(+e),l):r},l.endAngle=function(e){return arguments.length?(o="function"==typeof e?e:Z(+e),l):o},l.padAngle=function(e){return arguments.length?(s="function"==typeof e?e:Z(+e),l):s},l.context=function(e){return arguments.length?(a=null==e?null:e,l):a},l}function xe(e){this._context=e}function we(e){return new xe(e)}function qe(e){return e[0]}function Me(e){return e[1]}function De(){var e=qe,t=null,n=Z(0),i=Me,r=Z(!0),o=null,s=we,a=null;function l(l){var c,u,h,d,f,p=l.length,m=!1,g=new Array(p),y=new Array(p);for(null==o&&(a=s(f=J())),c=0;c<=p;++c){if(!(c<p&&r(d=l[c],c,l))===m)if(m=!m)u=c,a.areaStart(),a.lineStart();else{for(a.lineEnd(),a.lineStart(),h=c-1;h>=u;--h)a.point(g[h],y[h]);a.lineEnd(),a.areaEnd()}m&&(g[c]=+e(d,c,l),y[c]=+n(d,c,l),a.point(t?+t(d,c,l):g[c],i?+i(d,c,l):y[c]))}if(f)return a=null,f+""||null}function c(){return function(){var e=qe,t=Me,n=Z(!0),i=null,r=we,o=null;function s(s){var a,l,c,u=s.length,h=!1;for(null==i&&(o=r(c=J())),a=0;a<=u;++a)!(a<u&&n(l=s[a],a,s))===h&&((h=!h)?o.lineStart():o.lineEnd()),h&&o.point(+e(l,a,s),+t(l,a,s));if(c)return o=null,c+""||null}return s.x=function(t){return arguments.length?(e="function"==typeof t?t:Z(+t),s):e},s.y=function(e){return arguments.length?(t="function"==typeof e?e:Z(+e),s):t},s.defined=function(e){return arguments.length?(n="function"==typeof e?e:Z(!!e),s):n},s.curve=function(e){return arguments.length?(r=e,null!=i&&(o=r(i)),s):r},s.context=function(e){return arguments.length?(null==e?i=o=null:o=r(i=e),s):i},s}().defined(r).curve(s).context(o)}return l.x=function(n){return arguments.length?(e="function"==typeof n?n:Z(+n),t=null,l):e},l.x0=function(t){return arguments.length?(e="function"==typeof t?t:Z(+t),l):e},l.x1=function(e){return arguments.length?(t=null==e?null:"function"==typeof e?e:Z(+e),l):t},l.y=function(e){return arguments.length?(n="function"==typeof e?e:Z(+e),i=null,l):n},l.y0=function(e){return arguments.length?(n="function"==typeof e?e:Z(+e),l):n},l.y1=function(e){return arguments.length?(i=null==e?null:"function"==typeof e?e:Z(+e),l):i},l.lineX0=l.lineY0=function(){return c().x(e).y(n)},l.lineY1=function(){return c().x(e).y(i)},l.lineX1=function(){return c().x(t).y(n)},l.defined=function(e){return arguments.length?(r="function"==typeof e?e:Z(!!e),l):r},l.curve=function(e){return arguments.length?(s=e,null!=o&&(a=s(o)),l):s},l.context=function(e){return arguments.length?(null==e?o=a=null:a=s(o=e),l):o},l}function Se(e,t){return t<e?-1:t>e?1:t>=e?0:NaN}function _e(e){return e}xe.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;default:this._context.lineTo(e,t)}}};var Ce=Array.prototype.slice;function ke(e,t,n){e._context.bezierCurveTo((2*e._x0+e._x1)/3,(2*e._y0+e._y1)/3,(e._x0+2*e._x1)/3,(e._y0+2*e._y1)/3,(e._x0+4*e._x1+t)/6,(e._y0+4*e._y1+n)/6)}function Ee(e){this._context=e}function Ae(e,t,n){e._context.bezierCurveTo(e._x1+e._k*(e._x2-e._x0),e._y1+e._k*(e._y2-e._y0),e._x2+e._k*(e._x1-t),e._y2+e._k*(e._y1-n),e._x2,e._y2)}function Te(e,t){this._context=e,this._k=(1-t)/6}Ee.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){switch(this._point){case 3:ke(this,this._x1,this._y1);case 2:this._context.lineTo(this._x1,this._y1)}(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3,this._context.lineTo((5*this._x0+this._x1)/6,(5*this._y0+this._y1)/6);default:ke(this,e,t)}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}},Te.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x2,this._y2);break;case 3:Ae(this,this._x1,this._y1)}(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2,this._x1=e,this._y1=t;break;case 2:this._point=3;default:Ae(this,e,t)}this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};var Ie=function e(t){function n(e){return new Te(e,t)}return n.tension=function(t){return e(+t)},n}(0);function Re(e,t){this._context=e,this._alpha=t}Re.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x2,this._y2);break;case 3:this.point(this._x2,this._y2)}(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){if(e=+e,t=+t,this._point){var n=this._x2-e,i=this._y2-t;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(n*n+i*i,this._alpha))}switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3;default:!function(e,t,n){var i=e._x1,r=e._y1,o=e._x2,s=e._y2;if(e._l01_a>se){var a=2*e._l01_2a+3*e._l01_a*e._l12_a+e._l12_2a,l=3*e._l01_a*(e._l01_a+e._l12_a);i=(i*a-e._x0*e._l12_2a+e._x2*e._l01_2a)/l,r=(r*a-e._y0*e._l12_2a+e._y2*e._l01_2a)/l}if(e._l23_a>se){var c=2*e._l23_2a+3*e._l23_a*e._l12_a+e._l12_2a,u=3*e._l23_a*(e._l23_a+e._l12_a);o=(o*c+e._x1*e._l23_2a-t*e._l12_2a)/u,s=(s*c+e._y1*e._l23_2a-n*e._l12_2a)/u}e._context.bezierCurveTo(i,r,o,s,e._x2,e._y2)}(this,e,t)}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};var Ne=function e(t){function n(e){return t?new Re(e,t):new Te(e,0)}return n.alpha=function(t){return e(+t)},n}(.5);function Oe(e){return e<0?-1:1}function Pe(e,t,n){var i=e._x1-e._x0,r=t-e._x1,o=(e._y1-e._y0)/(i||r<0&&-0),s=(n-e._y1)/(r||i<0&&-0),a=(o*r+s*i)/(i+r);return(Oe(o)+Oe(s))*Math.min(Math.abs(o),Math.abs(s),.5*Math.abs(a))||0}function Le(e,t){var n=e._x1-e._x0;return n?(3*(e._y1-e._y0)/n-t)/2:t}function Fe(e,t,n){var i=e._x0,r=e._y0,o=e._x1,s=e._y1,a=(o-i)/3;e._context.bezierCurveTo(i+a,r+a*t,o-a,s-a*n,o,s)}function ze(e){this._context=e}function je(e){this._context=new He(e)}function He(e){this._context=e}function Be(e){this._context=e}function Ve(e){var t,n,i=e.length-1,r=new Array(i),o=new Array(i),s=new Array(i);for(r[0]=0,o[0]=2,s[0]=e[0]+2*e[1],t=1;t<i-1;++t)r[t]=1,o[t]=4,s[t]=4*e[t]+2*e[t+1];for(r[i-1]=2,o[i-1]=7,s[i-1]=8*e[i-1]+e[i],t=1;t<i;++t)n=r[t]/o[t-1],o[t]-=n,s[t]-=n*s[t-1];for(r[i-1]=s[i-1]/o[i-1],t=i-2;t>=0;--t)r[t]=(s[t]-r[t+1])/o[t];for(o[i-1]=(e[i]+r[i-1])/2,t=0;t<i-1;++t)o[t]=2*e[t+1]-r[t+1];return[r,o]}function $e(e,t){this._context=e,this._t=t}function We(e,t){if((r=e.length)>1)for(var n,i,r,o=1,s=e[t[0]],a=s.length;o<r;++o)for(i=s,s=e[t[o]],n=0;n<a;++n)s[n][1]+=s[n][0]=isNaN(i[n][1])?i[n][0]:i[n][1]}function Ue(e){for(var t=e.length,n=new Array(t);--t>=0;)n[t]=t;return n}function Ye(e,t){return e[t]}function Xe(e){for(var t,n=-1,i=0,r=e.length,o=-1/0;++n<r;)(t=+e[n][1])>o&&(o=t,i=n);return i}function Ke(e){for(var t,n=0,i=-1,r=e.length;++i<r;)(t=+e[i][1])&&(n+=t);return n}function Ge(e){let t,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"unspecified",i=arguments.length>2?arguments[2]:void 0;const r={},o=e||{get:()=>{},has:()=>!1,default:()=>{}};function s(e,t){if(!e||"string"!=typeof e)throw new TypeError("Invalid argument: key must be a non-empty string");return!(e in r)&&(r[e]=t,!0)}function a(e){return r[e]||o.get(e)}function l(e){return!!r[e]||o.has(e)}function c(e){const t=r[e];return delete r[e],t}function u(){return Object.keys(r)}function h(){return Object.keys(r).map((e=>r[e]))}function d(e){return void 0!==e&&(t=e),t}function f(e,r){if(void 0!==r)return s(e,r);const o=a(e);return i&&void 0===o&&i.warn("".concat(e," does not exist in ").concat(n," registry")),o||a(t)}return t=o.default(),f.add=s,f.get=a,f.has=l,f.remove=c,f.getKeys=u,f.getValues=h,f.default=d,f.register=s,f}function Je(e,t){if((n=(e=t?e.toExponential(t-1):e.toExponential()).indexOf("e"))<0)return null;var n,i=e.slice(0,n);return[i.length>1?i[0]+i.slice(2):i,+e.slice(n+1)]}function Ze(e){return(e=Je(Math.abs(e)))?e[1]:NaN}ze.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=this._t0=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x1,this._y1);break;case 3:Fe(this,this._t0,Le(this,this._t0))}(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){var n=NaN;if(t=+t,(e=+e)!==this._x1||t!==this._y1){switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3,Fe(this,Le(this,n=Pe(this,e,t)),n);break;default:Fe(this,this._t0,n=Pe(this,e,t))}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t,this._t0=n}}},(je.prototype=Object.create(ze.prototype)).point=function(e,t){ze.prototype.point.call(this,t,e)},He.prototype={moveTo:function(e,t){this._context.moveTo(t,e)},closePath:function(){this._context.closePath()},lineTo:function(e,t){this._context.lineTo(t,e)},bezierCurveTo:function(e,t,n,i,r,o){this._context.bezierCurveTo(t,e,i,n,o,r)}},Be.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=[],this._y=[]},lineEnd:function(){var e=this._x,t=this._y,n=e.length;if(n)if(this._line?this._context.lineTo(e[0],t[0]):this._context.moveTo(e[0],t[0]),2===n)this._context.lineTo(e[1],t[1]);else for(var i=Ve(e),r=Ve(t),o=0,s=1;s<n;++o,++s)this._context.bezierCurveTo(i[0][o],r[0][o],i[1][o],r[1][o],e[s],t[s]);(this._line||0!==this._line&&1===n)&&this._context.closePath(),this._line=1-this._line,this._x=this._y=null},point:function(e,t){this._x.push(+e),this._y.push(+t)}},$e.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=this._y=NaN,this._point=0},lineEnd:function(){0<this._t&&this._t<1&&2===this._point&&this._context.lineTo(this._x,this._y),(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line>=0&&(this._t=1-this._t,this._line=1-this._line)},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;default:if(this._t<=0)this._context.lineTo(this._x,t),this._context.lineTo(e,t);else{var n=this._x*(1-this._t)+e*this._t;this._context.lineTo(n,this._y),this._context.lineTo(n,t)}}this._x=e,this._y=t}};var Qe,et=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function tt(e){if(!(t=et.exec(e)))throw new Error("invalid format: "+e);var t;return new nt({fill:t[1],align:t[2],sign:t[3],symbol:t[4],zero:t[5],width:t[6],comma:t[7],precision:t[8]&&t[8].slice(1),trim:t[9],type:t[10]})}function nt(e){this.fill=void 0===e.fill?" ":e.fill+"",this.align=void 0===e.align?">":e.align+"",this.sign=void 0===e.sign?"-":e.sign+"",this.symbol=void 0===e.symbol?"":e.symbol+"",this.zero=!!e.zero,this.width=void 0===e.width?void 0:+e.width,this.comma=!!e.comma,this.precision=void 0===e.precision?void 0:+e.precision,this.trim=!!e.trim,this.type=void 0===e.type?"":e.type+""}function it(e,t){var n=Je(e,t);if(!n)return e+"";var i=n[0],r=n[1];return r<0?"0."+new Array(-r).join("0")+i:i.length>r+1?i.slice(0,r+1)+"."+i.slice(r+1):i+new Array(r-i.length+2).join("0")}tt.prototype=nt.prototype,nt.prototype.toString=function(){return this.fill+this.align+this.sign+this.symbol+(this.zero?"0":"")+(void 0===this.width?"":Math.max(1,0|this.width))+(this.comma?",":"")+(void 0===this.precision?"":"."+Math.max(0,0|this.precision))+(this.trim?"~":"")+this.type};var rt={"%":(e,t)=>(100*e).toFixed(t),b:e=>Math.round(e).toString(2),c:e=>e+"",d:function(e){return Math.abs(e=Math.round(e))>=1e21?e.toLocaleString("en").replace(/,/g,""):e.toString(10)},e:(e,t)=>e.toExponential(t),f:(e,t)=>e.toFixed(t),g:(e,t)=>e.toPrecision(t),o:e=>Math.round(e).toString(8),p:(e,t)=>it(100*e,t),r:it,s:function(e,t){var n=Je(e,t);if(!n)return e+"";var i=n[0],r=n[1],o=r-(Qe=3*Math.max(-8,Math.min(8,Math.floor(r/3))))+1,s=i.length;return o===s?i:o>s?i+new Array(o-s+1).join("0"):o>0?i.slice(0,o)+"."+i.slice(o):"0."+new Array(1-o).join("0")+Je(e,Math.max(0,t+o-1))[0]},X:e=>Math.round(e).toString(16).toUpperCase(),x:e=>Math.round(e).toString(16)};function ot(e){return e}var st,at,lt,ct=Array.prototype.map,ut=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function ht(e){var t,n,i=void 0===e.grouping||void 0===e.thousands?ot:(t=ct.call(e.grouping,Number),n=e.thousands+"",function(e,i){for(var r=e.length,o=[],s=0,a=t[0],l=0;r>0&&a>0&&(l+a+1>i&&(a=Math.max(1,i-l)),o.push(e.substring(r-=a,r+a)),!((l+=a+1)>i));)a=t[s=(s+1)%t.length];return o.reverse().join(n)}),r=void 0===e.currency?"":e.currency[0]+"",o=void 0===e.currency?"":e.currency[1]+"",s=void 0===e.decimal?".":e.decimal+"",a=void 0===e.numerals?ot:function(e){return function(t){return t.replace(/[0-9]/g,(function(t){return e[+t]}))}}(ct.call(e.numerals,String)),l=void 0===e.percent?"%":e.percent+"",c=void 0===e.minus?"−":e.minus+"",u=void 0===e.nan?"NaN":e.nan+"";function h(e){var t=(e=tt(e)).fill,n=e.align,h=e.sign,d=e.symbol,f=e.zero,p=e.width,m=e.comma,g=e.precision,y=e.trim,v=e.type;"n"===v?(m=!0,v="g"):rt[v]||(void 0===g&&(g=12),y=!0,v="g"),(f||"0"===t&&"="===n)&&(f=!0,t="0",n="=");var b="$"===d?r:"#"===d&&/[boxX]/.test(v)?"0"+v.toLowerCase():"",x="$"===d?o:/[%p]/.test(v)?l:"",w=rt[v],q=/[defgprs%]/.test(v);function M(e){var r,o,l,d=b,M=x;if("c"===v)M=w(e)+M,e="";else{var D=(e=+e)<0||1/e<0;if(e=isNaN(e)?u:w(Math.abs(e),g),y&&(e=function(e){e:for(var t,n=e.length,i=1,r=-1;i<n;++i)switch(e[i]){case".":r=t=i;break;case"0":0===r&&(r=i),t=i;break;default:if(!+e[i])break e;r>0&&(r=0)}return r>0?e.slice(0,r)+e.slice(t+1):e}(e)),D&&0==+e&&"+"!==h&&(D=!1),d=(D?"("===h?h:c:"-"===h||"("===h?"":h)+d,M=("s"===v?ut[8+Qe/3]:"")+M+(D&&"("===h?")":""),q)for(r=-1,o=e.length;++r<o;)if(48>(l=e.charCodeAt(r))||l>57){M=(46===l?s+e.slice(r+1):e.slice(r))+M,e=e.slice(0,r);break}}m&&!f&&(e=i(e,1/0));var S=d.length+e.length+M.length,_=S<p?new Array(p-S+1).join(t):"";switch(m&&f&&(e=i(_+e,_.length?p-M.length:1/0),_=""),n){case"<":e=d+e+M+_;break;case"=":e=d+_+e+M;break;case"^":e=_.slice(0,S=_.length>>1)+d+e+M+_.slice(S);break;default:e=_+d+e+M}return a(e)}return g=void 0===g?6:/[gprs]/.test(v)?Math.max(1,Math.min(21,g)):Math.max(0,Math.min(20,g)),M.toString=function(){return e+""},M}return{format:h,formatPrefix:function(e,t){var n=h(((e=tt(e)).type="f",e)),i=3*Math.max(-8,Math.min(8,Math.floor(Ze(t)/3))),r=Math.pow(10,-i),o=ut[8+i/3];return function(e){return n(r*e)+o}}}}!function(e){st=ht(e),at=st.format,lt=st.formatPrefix}({thousands:",",grouping:[3],currency:["$",""]});const dt=new Date,ft=new Date;function pt(e,t,n,i){function r(t){return e(t=0===arguments.length?new Date:new Date(+t)),t}return r.floor=t=>(e(t=new Date(+t)),t),r.ceil=n=>(e(n=new Date(n-1)),t(n,1),e(n),n),r.round=e=>{const t=r(e),n=r.ceil(e);return e-t<n-e?t:n},r.offset=(e,n)=>(t(e=new Date(+e),null==n?1:Math.floor(n)),e),r.range=(n,i,o)=>{const s=[];if(n=r.ceil(n),o=null==o?1:Math.floor(o),!(n<i&&o>0))return s;let a;do{s.push(a=new Date(+n)),t(n,o),e(n)}while(a<n&&n<i);return s},r.filter=n=>pt((t=>{if(t>=t)for(;e(t),!n(t);)t.setTime(t-1)}),((e,i)=>{if(e>=e)if(i<0)for(;++i<=0;)for(;t(e,-1),!n(e););else for(;--i>=0;)for(;t(e,1),!n(e););})),n&&(r.count=(t,i)=>(dt.setTime(+t),ft.setTime(+i),e(dt),e(ft),Math.floor(n(dt,ft))),r.every=e=>(e=Math.floor(e),isFinite(e)&&e>0?e>1?r.filter(i?t=>i(t)%e==0:t=>r.count(0,t)%e==0):r:null)),r}const mt=6e4,gt=864e5,yt=6048e5,vt=pt((e=>e.setHours(0,0,0,0)),((e,t)=>e.setDate(e.getDate()+t)),((e,t)=>(t-e-(t.getTimezoneOffset()-e.getTimezoneOffset())*mt)/gt),(e=>e.getDate()-1));vt.range;const bt=pt((e=>{e.setUTCHours(0,0,0,0)}),((e,t)=>{e.setUTCDate(e.getUTCDate()+t)}),((e,t)=>(t-e)/gt),(e=>e.getUTCDate()-1));bt.range;const xt=pt((e=>{e.setUTCHours(0,0,0,0)}),((e,t)=>{e.setUTCDate(e.getUTCDate()+t)}),((e,t)=>(t-e)/gt),(e=>Math.floor(e/gt)));function wt(e){return pt((t=>{t.setDate(t.getDate()-(t.getDay()+7-e)%7),t.setHours(0,0,0,0)}),((e,t)=>{e.setDate(e.getDate()+7*t)}),((e,t)=>(t-e-(t.getTimezoneOffset()-e.getTimezoneOffset())*mt)/yt))}xt.range;const qt=wt(0),Mt=wt(1),Dt=wt(2),St=wt(3),_t=wt(4),Ct=wt(5),kt=wt(6);function Et(e){return pt((t=>{t.setUTCDate(t.getUTCDate()-(t.getUTCDay()+7-e)%7),t.setUTCHours(0,0,0,0)}),((e,t)=>{e.setUTCDate(e.getUTCDate()+7*t)}),((e,t)=>(t-e)/yt))}qt.range,Mt.range,Dt.range,St.range,_t.range,Ct.range,kt.range;const At=Et(0),Tt=Et(1),It=Et(2),Rt=Et(3),Nt=Et(4),Ot=Et(5),Pt=Et(6);At.range,Tt.range,It.range,Rt.range,Nt.range,Ot.range,Pt.range;const Lt=pt((e=>{e.setMonth(0,1),e.setHours(0,0,0,0)}),((e,t)=>{e.setFullYear(e.getFullYear()+t)}),((e,t)=>t.getFullYear()-e.getFullYear()),(e=>e.getFullYear()));Lt.every=e=>isFinite(e=Math.floor(e))&&e>0?pt((t=>{t.setFullYear(Math.floor(t.getFullYear()/e)*e),t.setMonth(0,1),t.setHours(0,0,0,0)}),((t,n)=>{t.setFullYear(t.getFullYear()+n*e)})):null,Lt.range;const Ft=pt((e=>{e.setUTCMonth(0,1),e.setUTCHours(0,0,0,0)}),((e,t)=>{e.setUTCFullYear(e.getUTCFullYear()+t)}),((e,t)=>t.getUTCFullYear()-e.getUTCFullYear()),(e=>e.getUTCFullYear()));function zt(e,t){return null==e||null==t?NaN:e<t?-1:e>t?1:e>=t?0:NaN}function jt(e,t){return null==e||null==t?NaN:t<e?-1:t>e?1:t>=e?0:NaN}function Ht(e){let t,n,i;function r(e,i,r=0,o=e.length){if(r<o){if(0!==t(i,i))return o;do{const t=r+o>>>1;n(e[t],i)<0?r=t+1:o=t}while(r<o)}return r}return 2!==e.length?(t=zt,n=(t,n)=>zt(e(t),n),i=(t,n)=>e(t)-n):(t=e===zt||e===jt?e:Bt,n=e,i=e),{left:r,center:function(e,t,n=0,o=e.length){const s=r(e,t,n,o-1);return s>n&&i(e[s-1],t)>-i(e[s],t)?s-1:s},right:function(e,i,r=0,o=e.length){if(r<o){if(0!==t(i,i))return o;do{const t=r+o>>>1;n(e[t],i)<=0?r=t+1:o=t}while(r<o)}return r}}}function Bt(){return 0}Ft.every=e=>isFinite(e=Math.floor(e))&&e>0?pt((t=>{t.setUTCFullYear(Math.floor(t.getUTCFullYear()/e)*e),t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0)}),((t,n)=>{t.setUTCFullYear(t.getUTCFullYear()+n*e)})):null,Ft.range;const Vt=Ht(zt).right;Ht((function(e){return null===e?NaN:+e})).center;var $t=Vt;class Wt extends Map{constructor(e,t=Yt){if(super(),Object.defineProperties(this,{_intern:{value:new Map},_key:{value:t}}),null!=e)for(const[t,n]of e)this.set(t,n)}get(e){return super.get(Ut(this,e))}has(e){return super.has(Ut(this,e))}set(e,t){return super.set(function({_intern:e,_key:t},n){const i=t(n);return e.has(i)?e.get(i):(e.set(i,n),n)}(this,e),t)}delete(e){return super.delete(function({_intern:e,_key:t},n){const i=t(n);e.has(i)&&(n=e.get(i),e.delete(i));return n}(this,e))}}function Ut({_intern:e,_key:t},n){const i=t(n);return e.has(i)?e.get(i):n}function Yt(e){return null!==e&&"object"==typeof e?e.valueOf():e}const Xt=Math.sqrt(50),Kt=Math.sqrt(10),Gt=Math.sqrt(2);function Jt(e,t,n){const i=(t-e)/Math.max(0,n),r=Math.floor(Math.log10(i)),o=i/Math.pow(10,r),s=o>=Xt?10:o>=Kt?5:o>=Gt?2:1;let a,l,c;return r<0?(c=Math.pow(10,-r)/s,a=Math.round(e*c),l=Math.round(t*c),a/c<e&&++a,l/c>t&&--l,c=-c):(c=Math.pow(10,r)*s,a=Math.round(e/c),l=Math.round(t/c),a*c<e&&++a,l*c>t&&--l),l<a&&.5<=n&&n<2?Jt(e,t,2*n):[a,l,c]}function Zt(e,t,n){return Jt(e=+e,t=+t,n=+n)[2]}function Qt(e,t,n){e=+e,t=+t,n=(r=arguments.length)<2?(t=e,e=0,1):r<3?1:+n;for(var i=-1,r=0|Math.max(0,Math.ceil((t-e)/n)),o=new Array(r);++i<r;)o[i]=e+i*n;return o}function en(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 tn(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 nn(e,t,n){return{y:e,m:t,d:n,H:0,M:0,S:0,L:0}}function rn(e){var t=e.dateTime,n=e.date,i=e.time,r=e.periods,o=e.days,s=e.shortDays,a=e.months,l=e.shortMonths,c=hn(r),u=dn(r),h=hn(o),d=dn(o),f=hn(s),p=dn(s),m=hn(a),g=dn(a),y=hn(l),v=dn(l),b={a:function(e){return s[e.getDay()]},A:function(e){return o[e.getDay()]},b:function(e){return l[e.getMonth()]},B:function(e){return a[e.getMonth()]},c:null,d:Rn,e:Rn,f:Fn,g:Kn,G:Jn,H:Nn,I:On,j:Pn,L:Ln,m:zn,M:jn,p:function(e){return r[+(e.getHours()>=12)]},q:function(e){return 1+~~(e.getMonth()/3)},Q:xi,s:wi,S:Hn,u:Bn,U:Vn,V:Wn,w:Un,W:Yn,x:null,X:null,y:Xn,Y:Gn,Z:Zn,"%":bi},x={a:function(e){return s[e.getUTCDay()]},A:function(e){return o[e.getUTCDay()]},b:function(e){return l[e.getUTCMonth()]},B:function(e){return a[e.getUTCMonth()]},c:null,d:Qn,e:Qn,f:ri,g:mi,G:yi,H:ei,I:ti,j:ni,L:ii,m:oi,M:si,p:function(e){return r[+(e.getUTCHours()>=12)]},q:function(e){return 1+~~(e.getUTCMonth()/3)},Q:xi,s:wi,S:ai,u:li,U:ci,V:hi,w:di,W:fi,x:null,X:null,y:pi,Y:gi,Z:vi,"%":bi},w={a:function(e,t,n){var i=f.exec(t.slice(n));return i?(e.w=p.get(i[0].toLowerCase()),n+i[0].length):-1},A:function(e,t,n){var i=h.exec(t.slice(n));return i?(e.w=d.get(i[0].toLowerCase()),n+i[0].length):-1},b:function(e,t,n){var i=y.exec(t.slice(n));return i?(e.m=v.get(i[0].toLowerCase()),n+i[0].length):-1},B:function(e,t,n){var i=m.exec(t.slice(n));return i?(e.m=g.get(i[0].toLowerCase()),n+i[0].length):-1},c:function(e,n,i){return D(e,t,n,i)},d:Mn,e:Mn,f:En,g:bn,G:vn,H:Sn,I:Sn,j:Dn,L:kn,m:qn,M:_n,p:function(e,t,n){var i=c.exec(t.slice(n));return i?(e.p=u.get(i[0].toLowerCase()),n+i[0].length):-1},q:wn,Q:Tn,s:In,S:Cn,u:pn,U:mn,V:gn,w:fn,W:yn,x:function(e,t,i){return D(e,n,t,i)},X:function(e,t,n){return D(e,i,t,n)},y:bn,Y:vn,Z:xn,"%":An};function q(e,t){return function(n){var i,r,o,s=[],a=-1,l=0,c=e.length;for(n instanceof Date||(n=new Date(+n));++a<c;)37===e.charCodeAt(a)&&(s.push(e.slice(l,a)),null!=(r=on[i=e.charAt(++a)])?i=e.charAt(++a):r="e"===i?" ":"0",(o=t[i])&&(i=o(n,r)),s.push(i),l=a+1);return s.push(e.slice(l,a)),s.join("")}}function M(e,t){return function(n){var i,r,o=nn(1900,void 0,1);if(D(o,e,n+="",0)!=n.length)return null;if("Q"in o)return new Date(o.Q);if("s"in o)return new Date(1e3*o.s+("L"in o?o.L:0));if(t&&!("Z"in o)&&(o.Z=0),"p"in o&&(o.H=o.H%12+12*o.p),void 0===o.m&&(o.m="q"in o?o.q:0),"V"in o){if(o.V<1||o.V>53)return null;"w"in o||(o.w=1),"Z"in o?(r=(i=tn(nn(o.y,0,1))).getUTCDay(),i=r>4||0===r?Tt.ceil(i):Tt(i),i=bt.offset(i,7*(o.V-1)),o.y=i.getUTCFullYear(),o.m=i.getUTCMonth(),o.d=i.getUTCDate()+(o.w+6)%7):(r=(i=en(nn(o.y,0,1))).getDay(),i=r>4||0===r?Mt.ceil(i):Mt(i),i=vt.offset(i,7*(o.V-1)),o.y=i.getFullYear(),o.m=i.getMonth(),o.d=i.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),r="Z"in o?tn(nn(o.y,0,1)).getUTCDay():en(nn(o.y,0,1)).getDay(),o.m=0,o.d="W"in o?(o.w+6)%7+7*o.W-(r+5)%7:o.w+7*o.U-(r+6)%7);return"Z"in o?(o.H+=o.Z/100|0,o.M+=o.Z%100,tn(o)):en(o)}}function D(e,t,n,i){for(var r,o,s=0,a=t.length,l=n.length;s<a;){if(i>=l)return-1;if(37===(r=t.charCodeAt(s++))){if(r=t.charAt(s++),!(o=w[r in on?t.charAt(s++):r])||(i=o(e,n,i))<0)return-1}else if(r!=n.charCodeAt(i++))return-1}return i}return b.x=q(n,b),b.X=q(i,b),b.c=q(t,b),x.x=q(n,x),x.X=q(i,x),x.c=q(t,x),{format:function(e){var t=q(e+="",b);return t.toString=function(){return e},t},parse:function(e){var t=M(e+="",!1);return t.toString=function(){return e},t},utcFormat:function(e){var t=q(e+="",x);return t.toString=function(){return e},t},utcParse:function(e){var t=M(e+="",!0);return t.toString=function(){return e},t}}}var on={"-":"",_:" ",0:"0"},sn=/^\s*\d+/,an=/^%/,ln=/[\\^$*+?|[\]().{}]/g;function cn(e,t,n){var i=e<0?"-":"",r=(i?-e:e)+"",o=r.length;return i+(o<n?new Array(n-o+1).join(t)+r:r)}function un(e){return e.replace(ln,"\\$&")}function hn(e){return new RegExp("^(?:"+e.map(un).join("|")+")","i")}function dn(e){return new Map(e.map(((e,t)=>[e.toLowerCase(),t])))}function fn(e,t,n){var i=sn.exec(t.slice(n,n+1));return i?(e.w=+i[0],n+i[0].length):-1}function pn(e,t,n){var i=sn.exec(t.slice(n,n+1));return i?(e.u=+i[0],n+i[0].length):-1}function mn(e,t,n){var i=sn.exec(t.slice(n,n+2));return i?(e.U=+i[0],n+i[0].length):-1}function gn(e,t,n){var i=sn.exec(t.slice(n,n+2));return i?(e.V=+i[0],n+i[0].length):-1}function yn(e,t,n){var i=sn.exec(t.slice(n,n+2));return i?(e.W=+i[0],n+i[0].length):-1}function vn(e,t,n){var i=sn.exec(t.slice(n,n+4));return i?(e.y=+i[0],n+i[0].length):-1}function bn(e,t,n){var i=sn.exec(t.slice(n,n+2));return i?(e.y=+i[0]+(+i[0]>68?1900:2e3),n+i[0].length):-1}function xn(e,t,n){var i=/^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(t.slice(n,n+6));return i?(e.Z=i[1]?0:-(i[2]+(i[3]||"00")),n+i[0].length):-1}function wn(e,t,n){var i=sn.exec(t.slice(n,n+1));return i?(e.q=3*i[0]-3,n+i[0].length):-1}function qn(e,t,n){var i=sn.exec(t.slice(n,n+2));return i?(e.m=i[0]-1,n+i[0].length):-1}function Mn(e,t,n){var i=sn.exec(t.slice(n,n+2));return i?(e.d=+i[0],n+i[0].length):-1}function Dn(e,t,n){var i=sn.exec(t.slice(n,n+3));return i?(e.m=0,e.d=+i[0],n+i[0].length):-1}function Sn(e,t,n){var i=sn.exec(t.slice(n,n+2));return i?(e.H=+i[0],n+i[0].length):-1}function _n(e,t,n){var i=sn.exec(t.slice(n,n+2));return i?(e.M=+i[0],n+i[0].length):-1}function Cn(e,t,n){var i=sn.exec(t.slice(n,n+2));return i?(e.S=+i[0],n+i[0].length):-1}function kn(e,t,n){var i=sn.exec(t.slice(n,n+3));return i?(e.L=+i[0],n+i[0].length):-1}function En(e,t,n){var i=sn.exec(t.slice(n,n+6));return i?(e.L=Math.floor(i[0]/1e3),n+i[0].length):-1}function An(e,t,n){var i=an.exec(t.slice(n,n+1));return i?n+i[0].length:-1}function Tn(e,t,n){var i=sn.exec(t.slice(n));return i?(e.Q=+i[0],n+i[0].length):-1}function In(e,t,n){var i=sn.exec(t.slice(n));return i?(e.s=+i[0],n+i[0].length):-1}function Rn(e,t){return cn(e.getDate(),t,2)}function Nn(e,t){return cn(e.getHours(),t,2)}function On(e,t){return cn(e.getHours()%12||12,t,2)}function Pn(e,t){return cn(1+vt.count(Lt(e),e),t,3)}function Ln(e,t){return cn(e.getMilliseconds(),t,3)}function Fn(e,t){return Ln(e,t)+"000"}function zn(e,t){return cn(e.getMonth()+1,t,2)}function jn(e,t){return cn(e.getMinutes(),t,2)}function Hn(e,t){return cn(e.getSeconds(),t,2)}function Bn(e){var t=e.getDay();return 0===t?7:t}function Vn(e,t){return cn(qt.count(Lt(e)-1,e),t,2)}function $n(e){var t=e.getDay();return t>=4||0===t?_t(e):_t.ceil(e)}function Wn(e,t){return e=$n(e),cn(_t.count(Lt(e),e)+(4===Lt(e).getDay()),t,2)}function Un(e){return e.getDay()}function Yn(e,t){return cn(Mt.count(Lt(e)-1,e),t,2)}function Xn(e,t){return cn(e.getFullYear()%100,t,2)}function Kn(e,t){return cn((e=$n(e)).getFullYear()%100,t,2)}function Gn(e,t){return cn(e.getFullYear()%1e4,t,4)}function Jn(e,t){var n=e.getDay();return cn((e=n>=4||0===n?_t(e):_t.ceil(e)).getFullYear()%1e4,t,4)}function Zn(e){var t=e.getTimezoneOffset();return(t>0?"-":(t*=-1,"+"))+cn(t/60|0,"0",2)+cn(t%60,"0",2)}function Qn(e,t){return cn(e.getUTCDate(),t,2)}function ei(e,t){return cn(e.getUTCHours(),t,2)}function ti(e,t){return cn(e.getUTCHours()%12||12,t,2)}function ni(e,t){return cn(1+bt.count(Ft(e),e),t,3)}function ii(e,t){return cn(e.getUTCMilliseconds(),t,3)}function ri(e,t){return ii(e,t)+"000"}function oi(e,t){return cn(e.getUTCMonth()+1,t,2)}function si(e,t){return cn(e.getUTCMinutes(),t,2)}function ai(e,t){return cn(e.getUTCSeconds(),t,2)}function li(e){var t=e.getUTCDay();return 0===t?7:t}function ci(e,t){return cn(At.count(Ft(e)-1,e),t,2)}function ui(e){var t=e.getUTCDay();return t>=4||0===t?Nt(e):Nt.ceil(e)}function hi(e,t){return e=ui(e),cn(Nt.count(Ft(e),e)+(4===Ft(e).getUTCDay()),t,2)}function di(e){return e.getUTCDay()}function fi(e,t){return cn(Tt.count(Ft(e)-1,e),t,2)}function pi(e,t){return cn(e.getUTCFullYear()%100,t,2)}function mi(e,t){return cn((e=ui(e)).getUTCFullYear()%100,t,2)}function gi(e,t){return cn(e.getUTCFullYear()%1e4,t,4)}function yi(e,t){var n=e.getUTCDay();return cn((e=n>=4||0===n?Nt(e):Nt.ceil(e)).getUTCFullYear()%1e4,t,4)}function vi(){return"+0000"}function bi(){return"%"}function xi(e){return+e}function wi(e){return Math.floor(+e/1e3)}const qi=Ge();qi("d3-number",(function(e,t,n){let i,r;function o(e){return r(e)}function s(){o.locale({decimal:n||".",thousands:t||",",grouping:[3],currency:["$",""]})}return o.locale=function(t){return i=ht(t),r=i.format(e),this},s(),o.format=function(e,r,o,a){return(o||a)&&(t=o,n=a,s()),i.format(e)(r)},o.pattern=function(t){return t&&(e=t,r=i.format(t)),e},o})),qi("d3-time",(function(e){let t=rn({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"]}),n=t.format(e);function i(e){return n(e)}return i.format=function(e,n){return t.format(e)(n)},i.locale=function(){return t=rn(...arguments),n=t.format(e),this},i.parse=function(e,n){return t.parse(e)(n)},i.parsePattern=function(e){return t.parse(e)},i}));const Mi={id:e=>"".concat(e.source,"/").concat(e.key||e.title),key:e=>String(e.key||e.title),tags:e=>e.tags,min:e=>e.min,max:e=>e.max,type:e=>e.type,title:e=>String(e.title),values:e=>e.values,value:e=>e,label:e=>e,formatter:e=>(e=>{if("function"==typeof e.formatter)return e.formatter();const t=e.formatter||{};return qi(t.type||"d3-number")(t.format||"")})(e)};function Di(e){let{id:t=Mi.id,key:n=Mi.key,min:i=Mi.min,max:r=Mi.max,type:o=Mi.type,tags:s=Mi.tags,title:a=Mi.title,values:l=Mi.values,value:c=Mi.value,label:u=Mi.label,formatter:h=Mi.formatter}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const d={id:()=>t(e),key:()=>n(e),raw:()=>e,tags:()=>s(e),type:()=>o(e),min:()=>i(e),max:()=>r(e),title:()=>a(e),items:()=>l(e),formatter:()=>h(e),value:c,label:u};return d}function Si(e,t){let{cache:n}=t;if("number"==typeof e)return n.fields[e];for(let t=0;t<n.fields.length;t++)if(n.fields[t].key()===e)return n.fields[t];for(let t=0;t<n.fields.length;t++)if(n.fields[t].title()===e)return n.fields[t];return null}const _i=e=>e.filter((e=>"number"==typeof e&&!isNaN(e))),Ci=e=>e.reduce(((e,t)=>e+t),0),ki={first:e=>e[0],last:e=>e[e.length-1],min:e=>{const t=_i(e);return t.length?Math.min.apply(null,t):NaN},max:e=>{const t=_i(e);return t.length?Math.max.apply(null,t):NaN},sum:e=>{const t=_i(e);return t.length?t.reduce(((e,t)=>e+t),0):NaN},avg:e=>{const t=_i(e),n=t.length;return n?Ci(t)/n:NaN}};function Ei(e,t,n,i){const r={},o=i.field||(void 0!==e.field?t.field(e.field):null);return Object.keys(n).forEach((s=>{const a=n[s],l=r[s]={};-1!==["number","string","boolean"].indexOf(typeof a)?(l.type="primitive",l.value=a):"function"==typeof a?(l.type="function",l.value=a,l.label=a,l.field=o):"object"==typeof a&&(a.fields?l.fields=a.fields.map((n=>Ei(e,t,{main:n},i).main)):void 0!==a.field?(l.type="field",l.field=t.field(a.field),l.value=l.field.value,l.label=l.field.label):o&&(l.value=o.value,l.label=o.label,l.field=o),"function"==typeof a.filter&&(l.filter=a.filter),void 0!==a.value&&(l.value=a.value),void 0!==a.label&&(l.label=a.label),"function"==typeof a.reduce?l.reduce=a.reduce:a.reduce?l.reduce=ki[a.reduce]:l.field&&l.field.reduce&&(l.reduce="string"==typeof l.field.reduce?ki[l.field.reduce]:l.field.reduce),"function"==typeof a.reduceLabel?l.reduceLabel=a.reduceLabel:a.reduceLabel?l.reduceLabel=ki[a.reduceLabel]:l.field&&l.field.reduceLabel&&(l.reduceLabel="string"==typeof l.field.reduceLabel?ki[l.field.reduceLabel]:l.field.reduceLabel))})),r}function Ai(e,t){const{main:n}=Ei(e,t,{main:{value:e.value,label:e.label,reduce:e.reduce,filter:e.filter}},{});return{props:Ei(e,t,e.props||{},n),main:n}}function Ti(e,t,n,i){const r=Array(e.length),o=Array(e.length);let s;for(let t=0;t<e.length;t++)s=i?e[t][i]:e[t],r[t]=s.value,o[t]=s.label;const a=t.reduce,l=t.reduceLabel,c=a?a(r):r,u={value:c,label:l?l(o,c):n?n(c):String(c)};return i&&e[0][i].source?(u.source=e[0][i].source,u):!i&&e[0].source?(u.source=e[0].source,u):u}function Ii(e,t){let{main:n,propsArr:i,props:r}=t,o=[];const s=n.field.formatter(),a={};return i.forEach((e=>{a[e]=r[e].field?r[e].field.formatter():e=>e})),o.push(...e.map((e=>{const t=Ti(e.items,n,s);return i.forEach((n=>{t[n]=Ti(e.items,r[n],a[n],n)})),t}))),o}function Ri(e){let{cfg:t,itemData:n,obj:i,target:r,tracker:o,trackType:s}=e;const a="function"===s?t.trackBy(n):n[t.trackBy];let l=o[a];l||(l=o[a]={items:[],id:a},r.push(l)),l.items.push(i)}function Ni(e){if(e.length<1e4)return Math.max(...e);let t=-1/0;const n=e.length;for(let i=0;i<n;i++)t<e[i]&&(t=e[i]);return t}function Oi(e){if(e.length<1e4)return Math.min(...e);let t=1/0;const n=e.length;for(let i=0;i<n;i++)t>e[i]&&(t=e[i]);return t}const Pi={diverging:function(e,t){if((a=e.length)>0)for(var n,i,r,o,s,a,l=0,c=e[t[0]].length;l<c;++l)for(o=s=0,n=0;n<a;++n)(r=(i=e[t[n]][l])[1]-i[0])>=0?(i[0]=o,i[1]=o+=r):r<0?(i[1]=s,i[0]=s+=r):i[0]=o},none:We,silhouette:function(e,t){if((n=e.length)>0){for(var n,i=0,r=e[t[0]],o=r.length;i<o;++i){for(var s=0,a=0;s<n;++s)a+=e[s][i][1]||0;r[i][1]+=r[i][0]=-a/2}We(e,t)}},expand:function(e,t){if((i=e.length)>0){for(var n,i,r,o=0,s=e[0].length;o<s;++o){for(r=n=0;n<i;++n)r+=e[n][o][1]||0;if(r)for(n=0;n<i;++n)e[n][o][1]/=r}We(e,t)}},wiggle:function(e,t){if((r=e.length)>0&&(i=(n=e[t[0]]).length)>0){for(var n,i,r,o=0,s=1;s<i;++s){for(var a=0,l=0,c=0;a<r;++a){for(var u=e[t[a]],h=u[s][1]||0,d=(h-(u[s-1][1]||0))/2,f=0;f<a;++f){var p=e[t[f]];d+=(p[s][1]||0)-(p[s-1][1]||0)}l+=h,c+=d*h}n[s-1][1]+=n[s-1][0]=o,l&&(o-=c/l)}n[s-1][1]+=n[s-1][0]=o,We(e,t)}}},Li={ascending:function(e){var t=e.map(Ke);return Ue(e).sort((function(e,n){return t[e]-t[n]}))},insideout:function(e){var t,n,i=e.length,r=e.map(Ke),o=function(e){var t=e.map(Xe);return Ue(e).sort((function(e,n){return t[e]-t[n]}))}(e),s=0,a=0,l=[],c=[];for(t=0;t<i;++t)n=o[t],s<a?(s+=r[n],l.push(n)):(a+=r[n],c.push(n));return c.reverse().concat(l)},none:Ue,reverse:function(e){return Ue(e).reverse()}};function Fi(e,t,n){const i={},r=t.stackKey,o=t.value,s=t.startProp||"start",a=t.endProp||"end",l=t.offset||"none",c=t.order||"none",u=t.valueRef||"";let h=0,d={};for(let t=0;t<e.items.length;t++){let n=e.items[t],o=u?n[u]:null;if(o&&o.source){let e="".concat(o.source.key||"","/").concat(o.source.field);d[e]||(d[e]=o.source)}let s=r(n);i[s]=i[s]||{items:[]},i[s].items.push(n),h=Math.max(h,i[s].items.length)}const f=Array.apply(null,{length:h}).map(Number.call,Number),p=Object.keys(i).map((e=>i[e].items)),m=function(){var e=Z([]),t=Ue,n=We,i=Ye;function r(r){var o,s,a=e.apply(this,arguments),l=r.length,c=a.length,u=new Array(c);for(o=0;o<c;++o){for(var h,d=a[o],f=u[o]=new Array(l),p=0;p<l;++p)f[p]=h=[0,+i(r[p],d,p,r)],h.data=r[p];f.key=d}for(o=0,s=t(u);o<c;++o)u[s[o]].index=o;return n(u,s),u}return r.keys=function(t){return arguments.length?(e="function"==typeof t?t:Z(Ce.call(t)),r):e},r.value=function(e){return arguments.length?(i="function"==typeof e?e:Z(+e),r):i},r.order=function(e){return arguments.length?(t=null==e?Ue:"function"==typeof e?e:Z(Ce.call(e)),r):t},r.offset=function(e){return arguments.length?(n=null==e?We:e,r):n},r}().keys(f).value(((e,t)=>e[t]?o(e[t]):0)).order(Li[c]).offset(Pi[l]);let g=m(p),y=[];for(let e=0;e<g.length;e++){let t=g[e];for(let e=0;e<t.length;e++){let n=t[e],i=t[e].data[t.key];i&&(i[s]={value:n[0]},i[a]={value:n[1]},y.push(n[0],n[1]))}}let v=Object.keys(d).map((e=>{let t=n(d[e].key);return t?t.field(d[e].field):null})).filter((e=>!!e));const b=Di({title:v.map((e=>e.title())).join(", "),min:Oi(y),max:Ni(y),type:"measure",formatter:v[0]?v[0].formatter:void 0});e.fields.push(b)}function zi(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i={};const r=n.logger;if(Array.isArray(e))i.items=e.map((e=>({value:e,label:String(e)})));else if(e){if("collection"in e)i=R({},t.collection(e.collection));else{const n=t.dataset?t.dataset(e.source):null;let o=e.value||(e=>e),s=e.label||(e=>e);if(e.groupBy||e.mapTo)r.warn('Deprecated "data" configuration',e),i.items=[];else if(e.hierarchy)i.root=n.hierarchy?n.hierarchy(e.hierarchy):null,i.fields=n.fields();else if(e.items)i.items=e.items.map((e=>({value:o(e),label:String(s(e))})));else if(e.extract){const r=Array.isArray(e.extract)?e.extract:[e.extract];i.items=[];const o=[];r.forEach((e=>{const r=e.source?t.dataset(e.source):n;r&&(i.items=[...i.items,...r.extract(e)],void 0!==e.field&&o.push(r.field(e.field)))})),o.length&&(i.fields=o),e.amend&&Array.isArray(e.amend)&&(i.items=[...i.items,...e.amend])}else if(void 0!==e.field&&n){const t=n.field(e.field);t&&(i.fields||(i.fields=[]),i.fields.push(t),"value"in e||(o=t.value||(e=>e),s=t.label||(e=>e),i.value=o),i.items=t.items().map((t=>({value:o(t),label:String(s(t)),source:{field:e.field}}))))}else e.fields&&e.fields.forEach((e=>{const r="object"==typeof e&&e.source?t.dataset(e.source):n;if(!r)return;let o;o="object"==typeof e&&void 0!==e.field?r.field(e.field):r.field(e),o&&(i.fields||(i.fields=[]),i.fields.push(o))}));i.items&&e.map&&(i.items=i.items.map(e.map))}e&&e.stack&&Fi(i,e.stack,t.dataset)}return e&&!Array.isArray(e)&&"function"==typeof e.filter&&i.items&&(i.items=i.items.filter(e.filter)),e&&!Array.isArray(e)&&"function"==typeof e.sort&&i.items&&(i.items=i.items.sort(e.sort)),i}function ji(e,t,n){let i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:zi;const r={};(e||[]).forEach((e=>{if(!e.key)throw new Error('Data collection is missing "key" property');if("object"==typeof e.data&&"collection"in e.data)throw new Error("Data config for collections may not reference other collections");r[e.key]=()=>i(e.data,t,n)}));const o=e=>{let t,n;if("string"==typeof e?t=e:"object"==typeof e&&(t=e.key,n=e),!(t in r))throw new Error("Unknown data collection: ".concat(t));"function"==typeof r[t]&&(r[t]=r[t]());let i=r[t];if(n&&n.fields&&n.fields.filter){let e=i.fields.filter(n.fields.filter);i.fields.length!==e.length&&(i=A(i,{fields:e}))}return i};return o}function Hi(e,t,n){let i,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:zi;if(e.data){const i=r(e.data,t,n);if(i&&i.fields&&i.fields[0])return i.fields[0].formatter()}if(i=e.formatter?"".concat(e.formatter,"-").concat(e.type||"number"):e.type||"d3-number",n.formatter.has(i)){return n.formatter.get(i)(e.format||"")}throw new Error("Formatter of type '".concat(i,"' was not found"))}function Bi(e,t,n){let i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:Hi;const r={};return{get(o){let s;return"string"==typeof o&&e[o]?s=o:"object"==typeof o&&"formatter"in o&&e[o.formatter]?s=o.formatter:"object"==typeof o&&"type"in o&&e[o.type]&&(s=o.type),s?(r[s]=r[s]||i(e[s],t,n),r[s]):i(o||{},t,n)},all(){return Object.keys(e).forEach(this.get),r}}}function Vi(e,t){switch(arguments.length){case 0:break;case 1:this.range(e);break;default:this.range(t).domain(e)}return this}const $i=Symbol("implicit");function Wi(){var e=new Wt,t=[],n=[],i=$i;function r(r){let o=e.get(r);if(void 0===o){if(i!==$i)return i;e.set(r,o=t.push(r)-1)}return n[o%n.length]}return r.domain=function(n){if(!arguments.length)return t.slice();t=[],e=new Wt;for(const i of n)e.has(i)||e.set(i,t.push(i)-1);return r},r.range=function(e){return arguments.length?(n=Array.from(e),r):n.slice()},r.unknown=function(e){return arguments.length?(i=e,r):i},r.copy=function(){return Wi(t,n).unknown(i)},Vi.apply(r,arguments),r}function Ui(){var e,t,n=Wi().unknown(void 0),i=n.domain,r=n.range,o=0,s=1,a=!1,l=0,c=0,u=.5;function h(){var n=i().length,h=s<o,d=h?s:o,f=h?o:s;e=(f-d)/Math.max(1,n-l+2*c),a&&(e=Math.floor(e)),d+=(f-d-e*(n-l))*u,t=e*(1-l),a&&(d=Math.round(d),t=Math.round(t));var p=Qt(n).map((function(t){return d+e*t}));return r(h?p.reverse():p)}return delete n.unknown,n.domain=function(e){return arguments.length?(i(e),h()):i()},n.range=function(e){return arguments.length?([o,s]=e,o=+o,s=+s,h()):[o,s]},n.rangeRound=function(e){return[o,s]=e,o=+o,s=+s,a=!0,h()},n.bandwidth=function(){return t},n.step=function(){return e},n.round=function(e){return arguments.length?(a=!!e,h()):a},n.padding=function(e){return arguments.length?(l=Math.min(1,c=+e),h()):l},n.paddingInner=function(e){return arguments.length?(l=Math.min(1,e),h()):l},n.paddingOuter=function(e){return arguments.length?(c=+e,h()):c},n.align=function(e){return arguments.length?(u=Math.max(0,Math.min(1,e)),h()):u},n.copy=function(){return Ui(i(),[o,s]).round(a).paddingInner(l).paddingOuter(c).align(u)},Vi.apply(h(),arguments)}function Yi(e,t,n){e.prototype=t.prototype=n,n.constructor=e}function Xi(e,t){var n=Object.create(e.prototype);for(var i in t)n[i]=t[i];return n}function Ki(){}var Gi=.7,Ji=1/Gi,Zi="\\s*([+-]?\\d+)\\s*",Qi="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",er="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",tr=/^#([0-9a-f]{3,8})$/,nr=new RegExp(`^rgb\\(${Zi},${Zi},${Zi}\\)$`),ir=new RegExp(`^rgb\\(${er},${er},${er}\\)$`),rr=new RegExp(`^rgba\\(${Zi},${Zi},${Zi},${Qi}\\)$`),or=new RegExp(`^rgba\\(${er},${er},${er},${Qi}\\)$`),sr=new RegExp(`^hsl\\(${Qi},${er},${er}\\)$`),ar=new RegExp(`^hsla\\(${Qi},${er},${er},${Qi}\\)$`),lr={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 cr(){return this.rgb().formatHex()}function ur(){return this.rgb().formatRgb()}function hr(e){var t,n;return e=(e+"").trim().toLowerCase(),(t=tr.exec(e))?(n=t[1].length,t=parseInt(t[1],16),6===n?dr(t):3===n?new gr(t>>8&15|t>>4&240,t>>4&15|240&t,(15&t)<<4|15&t,1):8===n?fr(t>>24&255,t>>16&255,t>>8&255,(255&t)/255):4===n?fr(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=nr.exec(e))?new gr(t[1],t[2],t[3],1):(t=ir.exec(e))?new gr(255*t[1]/100,255*t[2]/100,255*t[3]/100,1):(t=rr.exec(e))?fr(t[1],t[2],t[3],t[4]):(t=or.exec(e))?fr(255*t[1]/100,255*t[2]/100,255*t[3]/100,t[4]):(t=sr.exec(e))?qr(t[1],t[2]/100,t[3]/100,1):(t=ar.exec(e))?qr(t[1],t[2]/100,t[3]/100,t[4]):lr.hasOwnProperty(e)?dr(lr[e]):"transparent"===e?new gr(NaN,NaN,NaN,0):null}function dr(e){return new gr(e>>16&255,e>>8&255,255&e,1)}function fr(e,t,n,i){return i<=0&&(e=t=n=NaN),new gr(e,t,n,i)}function pr(e){return e instanceof Ki||(e=hr(e)),e?new gr((e=e.rgb()).r,e.g,e.b,e.opacity):new gr}function mr(e,t,n,i){return 1===arguments.length?pr(e):new gr(e,t,n,null==i?1:i)}function gr(e,t,n,i){this.r=+e,this.g=+t,this.b=+n,this.opacity=+i}function yr(){return`#${wr(this.r)}${wr(this.g)}${wr(this.b)}`}function vr(){const e=br(this.opacity);return`${1===e?"rgb(":"rgba("}${xr(this.r)}, ${xr(this.g)}, ${xr(this.b)}${1===e?")":`, ${e})`}`}function br(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function xr(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function wr(e){return((e=xr(e))<16?"0":"")+e.toString(16)}function qr(e,t,n,i){return i<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new Dr(e,t,n,i)}function Mr(e){if(e instanceof Dr)return new Dr(e.h,e.s,e.l,e.opacity);if(e instanceof Ki||(e=hr(e)),!e)return new Dr;if(e instanceof Dr)return e;var t=(e=e.rgb()).r/255,n=e.g/255,i=e.b/255,r=Math.min(t,n,i),o=Math.max(t,n,i),s=NaN,a=o-r,l=(o+r)/2;return a?(s=t===o?(n-i)/a+6*(n<i):n===o?(i-t)/a+2:(t-n)/a+4,a/=l<.5?o+r:2-o-r,s*=60):a=l>0&&l<1?0:s,new Dr(s,a,l,e.opacity)}function Dr(e,t,n,i){this.h=+e,this.s=+t,this.l=+n,this.opacity=+i}function Sr(e){return(e=(e||0)%360)<0?e+360:e}function _r(e){return Math.max(0,Math.min(1,e||0))}function Cr(e,t,n){return 255*(e<60?t+(n-t)*e/60:e<180?n:e<240?t+(n-t)*(240-e)/60:t)}Yi(Ki,hr,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:cr,formatHex:cr,formatHex8:function(){return this.rgb().formatHex8()},formatHsl:function(){return Mr(this).formatHsl()},formatRgb:ur,toString:ur}),Yi(gr,mr,Xi(Ki,{brighter(e){return e=null==e?Ji:Math.pow(Ji,e),new gr(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=null==e?Gi:Math.pow(Gi,e),new gr(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new gr(xr(this.r),xr(this.g),xr(this.b),br(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:yr,formatHex:yr,formatHex8:function(){return`#${wr(this.r)}${wr(this.g)}${wr(this.b)}${wr(255*(isNaN(this.opacity)?1:this.opacity))}`},formatRgb:vr,toString:vr})),Yi(Dr,(function(e,t,n,i){return 1===arguments.length?Mr(e):new Dr(e,t,n,null==i?1:i)}),Xi(Ki,{brighter(e){return e=null==e?Ji:Math.pow(Ji,e),new Dr(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=null==e?Gi:Math.pow(Gi,e),new Dr(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=this.h%360+360*(this.h<0),t=isNaN(e)||isNaN(this.s)?0:this.s,n=this.l,i=n+(n<.5?n:1-n)*t,r=2*n-i;return new gr(Cr(e>=240?e-240:e+120,r,i),Cr(e,r,i),Cr(e<120?e+240:e-120,r,i),this.opacity)},clamp(){return new Dr(Sr(this.h),_r(this.s),_r(this.l),br(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=br(this.opacity);return`${1===e?"hsl(":"hsla("}${Sr(this.h)}, ${100*_r(this.s)}%, ${100*_r(this.l)}%${1===e?")":`, ${e})`}`}}));var kr=e=>()=>e;function Er(e){return 1==(e=+e)?Ar:function(t,n){return n-t?function(e,t,n){return e=Math.pow(e,n),t=Math.pow(t,n)-e,n=1/n,function(i){return Math.pow(e+i*t,n)}}(t,n,e):kr(isNaN(t)?n:t)}}function Ar(e,t){var n=t-e;return n?function(e,t){return function(n){return e+n*t}}(e,n):kr(isNaN(e)?t:e)}var Tr=function e(t){var n=Er(t);function i(e,t){var i=n((e=mr(e)).r,(t=mr(t)).r),r=n(e.g,t.g),o=n(e.b,t.b),s=Ar(e.opacity,t.opacity);return function(t){return e.r=i(t),e.g=r(t),e.b=o(t),e.opacity=s(t),e+""}}return i.gamma=e,i}(1);function Ir(e,t){t||(t=[]);var n,i=e?Math.min(t.length,e.length):0,r=t.slice();return function(o){for(n=0;n<i;++n)r[n]=e[n]*(1-o)+t[n]*o;return r}}function Rr(e,t){var n,i=t?t.length:0,r=e?Math.min(i,e.length):0,o=new Array(r),s=new Array(i);for(n=0;n<r;++n)o[n]=jr(e[n],t[n]);for(;n<i;++n)s[n]=t[n];return function(e){for(n=0;n<r;++n)s[n]=o[n](e);return s}}function Nr(e,t){var n=new Date;return e=+e,t=+t,function(i){return n.setTime(e*(1-i)+t*i),n}}function Or(e,t){return e=+e,t=+t,function(n){return e*(1-n)+t*n}}function Pr(e,t){var n,i={},r={};for(n in null!==e&&"object"==typeof e||(e={}),null!==t&&"object"==typeof t||(t={}),t)n in e?i[n]=jr(e[n],t[n]):r[n]=t[n];return function(e){for(n in i)r[n]=i[n](e);return r}}var Lr=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,Fr=new RegExp(Lr.source,"g");function zr(e,t){var n,i,r,o=Lr.lastIndex=Fr.lastIndex=0,s=-1,a=[],l=[];for(e+="",t+="";(n=Lr.exec(e))&&(i=Fr.exec(t));)(r=i.index)>o&&(r=t.slice(o,r),a[s]?a[s]+=r:a[++s]=r),(n=n[0])===(i=i[0])?a[s]?a[s]+=i:a[++s]=i:(a[++s]=null,l.push({i:s,x:Or(n,i)})),o=Fr.lastIndex;return o<t.length&&(r=t.slice(o),a[s]?a[s]+=r:a[++s]=r),a.length<2?l[0]?function(e){return function(t){return e(t)+""}}(l[0].x):function(e){return function(){return e}}(t):(t=l.length,function(e){for(var n,i=0;i<t;++i)a[(n=l[i]).i]=n.x(e);return a.join("")})}function jr(e,t){var n,i=typeof t;return null==t||"boolean"===i?kr(t):("number"===i?Or:"string"===i?(n=hr(t))?(t=n,Tr):zr:t instanceof hr?Tr:t instanceof Date?Nr:function(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}(t)?Ir:Array.isArray(t)?Rr:"function"!=typeof t.valueOf&&"function"!=typeof t.toString||isNaN(t)?Pr:Or)(e,t)}function Hr(e,t){return e=+e,t=+t,function(n){return Math.round(e*(1-n)+t*n)}}function Br(e){return+e}var Vr=[0,1];function $r(e){return e}function Wr(e,t){return(t-=e=+e)?function(n){return(n-e)/t}:function(e){return function(){return e}}(isNaN(t)?NaN:.5)}function Ur(e,t,n){var i=e[0],r=e[1],o=t[0],s=t[1];return r<i?(i=Wr(r,i),o=n(s,o)):(i=Wr(i,r),o=n(o,s)),function(e){return o(i(e))}}function Yr(e,t,n){var i=Math.min(e.length,t.length)-1,r=new Array(i),o=new Array(i),s=-1;for(e[i]<e[0]&&(e=e.slice().reverse(),t=t.slice().reverse());++s<i;)r[s]=Wr(e[s],e[s+1]),o[s]=n(t[s],t[s+1]);return function(t){var n=$t(e,t,1,i)-1;return o[n](r[n](t))}}function Xr(e,t){return t.domain(e.domain()).range(e.range()).interpolate(e.interpolate()).clamp(e.clamp()).unknown(e.unknown())}function Kr(){var e,t,n,i,r,o,s=Vr,a=Vr,l=jr,c=$r;function u(){var e=Math.min(s.length,a.length);return c!==$r&&(c=function(e,t){var n;return e>t&&(n=e,e=t,t=n),function(n){return Math.max(e,Math.min(t,n))}}(s[0],s[e-1])),i=e>2?Yr:Ur,r=o=null,h}function h(t){return null==t||isNaN(t=+t)?n:(r||(r=i(s.map(e),a,l)))(e(c(t)))}return h.invert=function(n){return c(t((o||(o=i(a,s.map(e),Or)))(n)))},h.domain=function(e){return arguments.length?(s=Array.from(e,Br),u()):s.slice()},h.range=function(e){return arguments.length?(a=Array.from(e),u()):a.slice()},h.rangeRound=function(e){return a=Array.from(e),l=Hr,u()},h.clamp=function(e){return arguments.length?(c=!!e||$r,u()):c!==$r},h.interpolate=function(e){return arguments.length?(l=e,u()):l},h.unknown=function(e){return arguments.length?(n=e,h):n},function(n,i){return e=n,t=i,u()}}function Gr(){return Kr()($r,$r)}function Jr(e,t,n,i){var r,o=function(e,t,n){n=+n;const i=(t=+t)<(e=+e),r=i?Zt(t,e,n):Zt(e,t,n);return(i?-1:1)*(r<0?1/-r:r)}(e,t,n);switch((i=tt(null==i?",f":i)).type){case"s":var s=Math.max(Math.abs(e),Math.abs(t));return null!=i.precision||isNaN(r=function(e,t){return Math.max(0,3*Math.max(-8,Math.min(8,Math.floor(Ze(t)/3)))-Ze(Math.abs(e)))}(o,s))||(i.precision=r),lt(i,s);case"":case"e":case"g":case"p":case"r":null!=i.precision||isNaN(r=function(e,t){return e=Math.abs(e),t=Math.abs(t)-e,Math.max(0,Ze(t)-Ze(e))+1}(o,Math.max(Math.abs(e),Math.abs(t))))||(i.precision=r-("e"===i.type));break;case"f":case"%":null!=i.precision||isNaN(r=function(e){return Math.max(0,-Ze(Math.abs(e)))}(o))||(i.precision=r-2*("%"===i.type))}return at(i)}function Zr(e){var t=e.domain;return e.ticks=function(e){var n=t();return function(e,t,n){if(!((n=+n)>0))return[];if((e=+e)==(t=+t))return[e];const i=t<e,[r,o,s]=i?Jt(t,e,n):Jt(e,t,n);if(!(o>=r))return[];const a=o-r+1,l=new Array(a);if(i)if(s<0)for(let e=0;e<a;++e)l[e]=(o-e)/-s;else for(let e=0;e<a;++e)l[e]=(o-e)*s;else if(s<0)for(let e=0;e<a;++e)l[e]=(r+e)/-s;else for(let e=0;e<a;++e)l[e]=(r+e)*s;return l}(n[0],n[n.length-1],null==e?10:e)},e.tickFormat=function(e,n){var i=t();return Jr(i[0],i[i.length-1],null==e?10:e,n)},e.nice=function(n){null==n&&(n=10);var i,r,o=t(),s=0,a=o.length-1,l=o[s],c=o[a],u=10;for(c<l&&(r=l,l=c,c=r,r=s,s=a,a=r);u-- >0;){if((r=Zt(l,c,n))===i)return o[s]=l,o[a]=c,t(o);if(r>0)l=Math.floor(l/r)*r,c=Math.ceil(c/r)*r;else{if(!(r<0))break;l=Math.ceil(l*r)/r,c=Math.floor(c*r)/r}i=r}return e},e}function Qr(){var e=Gr();return e.copy=function(){return Xr(e,Qr())},Vi.apply(e,arguments),Zr(e)}function eo(){var e,t=[.5],n=[0,1],i=1;function r(r){return null!=r&&r<=r?n[$t(t,r,0,i)]:e}return r.domain=function(e){return arguments.length?(t=Array.from(e),i=Math.min(t.length,n.length-1),r):t.slice()},r.range=function(e){return arguments.length?(n=Array.from(e),i=Math.min(t.length,n.length-1),r):n.slice()},r.invertExtent=function(e){var i=n.indexOf(e);return[t[i-1],t[i]]},r.unknown=function(t){return arguments.length?(e=t,r):e},r.copy=function(){return eo().domain(t).range(n).unknown(e)},Vi.apply(r,arguments)}function to(e){return void 0===e?e=>e:t=>e(t)}function no(e){return Math.max(0,Math.min(1,e))}function io(e){return"object"==typeof e}function ro(e,t,n){const i=Math.abs(t-n)/(e+1),r=[];for(let o=1;o<=e;o++){const e=o*i;r.push(t<n?t+e:t-e)}return r}function oo(e,t,n){if(1===e.length)return e;const i=e.concat([]);for(let r=0;r<e.length;r++){let o=e[r],s=e[r+1];0===r&&o!==n.start()?(i.push(...ro(t,o,s)),o-=s-o,s=e[r],i.push(...ro(t,o,s))):r===e.length-1&&s!==n.end()?(s=o+(o-e[r-1]),i.push(...ro(t,o,s))):i.push(...ro(t,o,s))}return i.filter((e=>e>=n.min()&&e<=n.max()))}function so(e){let{distance:t,scale:n,minorCount:i=0,unitDivider:r=100,formatter:o}=e;const s=L(r)||L(t)?2:Math.max(t/r,2),a=Math.min(1e3,Math.round(s));let l=n.ticks(a);l.length<=1&&(l=n.ticks(a+1));const c=i>0?oo(l,i,n):l;c.sort(((e,t)=>e-t));const u=c.map(to(o));return c.map(((e,t)=>{const i=n(e);return{position:i,start:i,end:i,label:u[t],value:e,isMinor:-1===l.indexOf(e)}}))}function ao(e){let{distance:t,scale:n,minorCount:i=0,unitDivider:r=100,formatter:o}=e;const s=L(r)||L(t)?2:Math.max(t/r,2),a=Math.min(1e3,Math.round(s)),l=a>10?10:a;n.nice(l);const c=n.ticks(a),u=i>0?oo(c,i,n):c;u.sort(((e,t)=>e-t));const h=u.map(to(o));return u.map(((e,t)=>{const i=n(e);return{position:i,start:i,end:i,label:h[t],value:e,isMinor:-1===c.indexOf(e)}}))}function lo(e){let t,{settings:n,scale:i,distance:r,formatter:o=(e=>e)}=e;const s=n.minorTicks&&!L(n.minorTicks.count)?Math.min(100,n.minorTicks.count):0;if(Array.isArray(n.ticks.values)){const e=n.ticks.values.filter((e=>"object"==typeof e?!L(e.value):!L(e)));t=function(e){let{values:t,scale:n,formatter:i=(e=>e)}=e;return t.sort(((e,t)=>(io(e)?e.value:e)-(io(t)?t.value:t))).filter(((e,t,i)=>{const r=io(e)?e.value:e;return r<=n.max()&&r>=n.min()&&i.indexOf(e)===t})).map((e=>{const t=io(e),r=t?e.value:e,o=n(r);return{position:o,value:r,label:t&&void 0!==e.label?e.label:i(r),isMinor:!!t&&!!e.isMinor,start:t&&!isNaN(e.start)?no(n(e.start)):o,end:t&&!isNaN(e.end)?no(n(e.end)):o}}))}({values:e,scale:i.copy(),formatter:o})}else if(L(n.ticks.count)){t=(n.ticks.tight?ao:so)({distance:r,minorCount:s,unitDivider:n.ticks.distance,scale:i,formatter:o}),n.ticks.forceBounds&&function(e,t,n){const i=e.map((e=>e.position)),r=t.range();-1===i.indexOf(r[0])?e.splice(0,0,{position:r[0],start:r[0],end:r[0],label:n(t.start()),isMinor:!1,value:t.start()}):e[0]&&e[0].isMinor&&(e[0].isMinor=!1);const o=e[e.length-1];-1===i.indexOf(r[1])?e.push({position:r[1],start:r[1],end:r[1],label:n(t.end()),isMinor:!1,value:t.end()}):o&&o.isMinor&&(o.isMinor=!1)}(t,i,o)}else{t=function(e){let{count:t,minorCount:n,scale:i,formatter:r}=e;return i.ticks((t-1)*n+t).map(((e,t)=>{const o=i(e);return{position:o,start:o,end:o,label:r(e),isMinor:t%(n+1)!=0,value:e}}))}({count:Math.min(1e3,n.ticks.count),minorCount:s,scale:i.copy(),formatter:o})}return t}function co(e){let{scale:t}=e;const n=t.domain(),i=t.data().items,r=t.labels?t.labels():n,o=t.bandwidth();return n.map(((e,n)=>{const s=t(e);return{position:s+o/2,label:"".concat(r[n]),data:i?i[n]:void 0,start:s,end:s+o}}))}function uo(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const i={};return Object.keys(t).forEach((r=>{const o=typeof e[r];i[r]="function"===o?e[r](n):"undefined"===o?t[r]:e[r]})),i}const ho={min:NaN,max:NaN,expand:NaN,include:[],invert:!1},fo={tight:!1,forceBounds:!1,values:void 0,count:NaN,distance:100},po={count:NaN};function mo(e,t){const n=+e.min,i=+e.max;let r=0,o=1;if(t&&t[0]){const n=t.map((e=>e.min())).filter((e=>!isNaN(e))),i=t.map((e=>e.max())).filter((e=>!isNaN(e)));if(r=n.length?Math.min(...n):Number.NaN,o=i.length?Math.max(...i):Number.NaN,isNaN(r)||isNaN(o))r=-1,o=1;else if(r===o&&0===r)r=-1,o=1;else if(r===o&&r)r-=Math.abs(.1*r),o+=Math.abs(.1*o);else if(!isNaN(e.expand)){const t=o-r;r-=t*e.expand,o+=t*e.expand}if(Array.isArray(e.include)){const t=e.include.filter((e=>!isNaN(e)));r=Math.min(...t,r),o=Math.max(...t,o)}}return{mini:isNaN(n)?r:n,maxi:isNaN(i)?o:i}}function go(e,t){e.instance||(e.instance=t.copy(),e.instance.domain([t.start(),t.end()]),e.instance.clamp(!0),e.instance.range(e.invert?[1,0]:[0,1]))}function yo(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const i=Qr(),r={instance:null,invert:!1},o={data:t,resources:n},s=uo(e,ho,o);let a;function l(e){return L(e)?NaN:i(e)}s.ticks=uo(e.ticks,fo,o),s.minorTicks=uo(e.minorTicks,po,o),l.data=()=>t,l.invert=function(e){return i.invert(e)},l.rangeRound=function(e){return i.rangeRound(e),l},l.clamp=function(){let e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];return i.clamp(e),l},l.cachedTicks=function(){return a},l.clearTicksCache=function(){return a=void 0,this},l.ticks=function(e){return null!==e&&"object"==typeof e?(e.settings=e.settings||{},e.settings=A(!0,{},s,e.settings),e.scale=l,a=lo(e),a):(a=i.ticks(e),a)},l.nice=function(e){return i.nice(e),l},l.tickFormat=function(e,t){return i.tickFormat(e,t)},l.interpolate=function(e){return i.interpolate(e),l},l.domain=function(e){return arguments.length?(i.domain(e),r.instance&&r.instance.domain([l.start(),l.end()]),l):i.domain()},l.range=function(e){return arguments.length?(i.range(e),l):i.range()},l.start=function(){return l.domain()[0]},l.end=function(){return l.domain()[this.domain().length-1]},l.min=function(){return Math.min(this.start(),this.end())},l.max=function(){return Math.max(this.start(),this.end())},l.classify=function(e){let t=(l.start()-l.end())/e,n=[l.end()],i=[],r=t/2;for(let o=0;o<e;o++){let e=n[n.length-1]||0,o=e+t,s=l(e+r);n.push(o,o),i.push(s,s)}return n.pop(),l.domain(n),l.range(i),l},l.copy=function(){const r=yo(e,t,n);return r.domain(l.domain()),r.range(l.range()),r.clamp(i.clamp()),r},l.norm=function(e){return go(r,l),r.instance(e)},l.normInvert=function(e){return go(r,l),r.instance.invert(e)};const{mini:c,maxi:u}=mo(s,t?t.fields:[]);return l.domain([c,u]),l.range(s.invert?[1,0]:[0,1]),r.invert=s.invert,l}const vo={padding:0,paddingInner:NaN,paddingOuter:NaN,align:.5,invert:!1,maxPxStep:NaN,range:[0,1]};function bo(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const i={data:t,resources:n},r=uo(e,vo,i),o=t.items||[],s={},a=[],l=[];function c(e,n){e.data=()=>t,e.datum=e=>o[s[e]],e.start=function(){return e.domain()[0]},e.end=function(){return e.domain()[e.domain().length-1]},e.labels=()=>l,e.ticks=function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return t.scale=e,co(t,n.trackBy)}}const u=Ui();c(u,e),u.pxScale=function(t){const n=r.maxPxStep;if(isNaN(n))return u;const i=u.domain().length,o=Math.max(1,i-u.paddingInner()+2*u.paddingOuter());if(o*n>=t)return u;const s=u.copy();s.type=u.type,c(s,e);const a=o*n/t,l=(1-a)*u.align();return s.range(r.invert?[a+l,l]:[l,a+l]),s};const h="function"==typeof e.value?e.value:e=>e.datum.value,d="function"==typeof e.label?e.label:e=>e.datum.label;for(let e=0;e<o.length;e++){const t=A({datum:o[e]},i),n=h(t,e);-1===a.indexOf(n)&&(a.push(n),l.push(d(t,e)),s[n]=e)}return u.domain(a),u.range(r.invert?r.range.slice().reverse():r.range),u.padding(isNaN(r.padding)?0:r.padding),isNaN(r.paddingInner)||u.paddingInner(r.paddingInner),isNaN(r.paddingOuter)||u.paddingOuter(r.paddingOuter),u.align(isNaN(r.align)?.5:r.align),u}const xo={depth:0};function wo(e,t,n){return e.ancestors().map((e=>t(A({datum:e.data},n)))).reverse().slice(1).toString()}function qo(e,t,n){const i=t.ticks.depth,r=t.value,o=t.label,s=[],a=[],l={},c=[];let u=0;if(!e)return{values:s,labels:a,items:l,ticks:c};e.eachAfter((e=>{if(e.depth>0){const t=wo(e,r,n),h=e.leaves()||[e],d=r(A({datum:e.data},n)),f=o(A({datum:e.data},n)),p=Array.isArray(e.children),m={key:t,count:h.length,value:d,label:f,leftEdge:wo(h[0],r,n),rightEdge:wo(h[Math.max(h.length-1,0)],r,n),node:e};p?(s.push("SPACER_".concat(u,"_SPACER")),u++):(s.push(t),a.push(f)),(i<=0&&!p||e.depth===i)&&c.push(m),l[t]=m}}));const h=e.height-1;return h>0&&s.splice(-h),{values:s,labels:a,items:l,ticks:c}}const Mo=e=>e.min(),Do=e=>e.max();function So(e,t){const n=e&&!isNaN(e.min),i=e&&!isNaN(e.max);let r=n?+e.min:0,o=i?+e.max:1;if(t&&t.length){if(!n){const e=t.map(Mo).filter(P);r=e.length?Math.min(...e):r}if(!i){const e=t.map(Do).filter(P);o=e.length?Math.max(...e):o}}return[r,o]}const _o={domain:[],range:[],invert:!1,min:NaN,max:NaN};function Co(e,t,n){const i=e.length;if(2===i)return[t,n];const r=[],o=(n-t)/(i-1);r.push(t);for(let e=1;e<i-1;e++)r.push(t+o*e);return r.push(n),r}function ko(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const i=yo(e,t,n).clamp(!0).interpolate(Tr),r=uo(e,_o,{data:t,resources:n}),o=Array.isArray(r.domain)&&r.domain.length,s=Array.isArray(r.range)&&r.range.length,a=i;A(!0,a,i);const[l,c]=So(r,t?t.fields:[]),u=o?r.domain.length:-1,h=n.theme?n.theme.palette("sequential",u>0?u:2):[],d=s?r.range:h;return a.range(r.invert?d.slice().reverse():d.slice()),a.domain(o?r.domain:Co(a.range(),l,c)),a}const Eo={domain:[],range:[],invert:!1,min:NaN,max:NaN,nice:!1};function Ao(e,t,n){const i=e.length;if(2===i)return[t+(n-t)/2];const r=[],o=(n-t)/i;for(let e=1;e<i;e++)r.push(t+o*e);return r}function To(e){const t=[];for(let n=0;n<e.length-1;n++)t.push((e[n]+e[n+1])/2);return t}function Io(e,t,n,i){n=e[0],i=e&&e.length>=2?e[e.length-1]:i;const r=ko().domain([n,i]).range(t);return[n,...To(e),i].map((e=>r(e)))}function Ro(e,t,n){const i=2===e.length?10:Math.max(1,e.length),r=Qr().domain([t,n]).nice(i).ticks(i);if(!e||!e.length)return r;const o=Math.max(0,e.length-1);for(;r.length>o;)r[0]-t<=n-r[r.length-1]?r.shift():r.pop();return r}const No={domain:[],range:[]};function Oo(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const i=Wi(),r={data:t,resources:n},o=uo(e,No,r),s="function"==typeof e.value?e.value:e=>e.datum.value,a="function"==typeof e.label?e.label:e=>e.datum.label,l=t.items||[],c={},u=[],h=[];for(let e=0;e<l.length;e++){const t=A({datum:l[e]},r),n=s(t,e);-1===u.indexOf(n)&&(u.push(n),h.push(a(t,e)),c[n]=e)}return i.data=()=>t,i.labels=()=>h,i.label=e=>h[u.indexOf(e)],i.datum=e=>l[c[e]],i.range(o.range),Array.isArray(o.domain)&&o.domain.length?i.domain(o.domain):i.domain(u),i}const Po={domain:[],range:[],unknown:void 0},Lo={domain:[],range:[],override:!1};const Fo=Ge();function zo(e,t,n){let i=e.data;e.source&&(n.logger.warn("Deprecated: Scale data source configuration"),i={extract:[]},(Array.isArray(e.source)?e.source:[e.source]).forEach((e=>{i.extract.push({field:e})})));const r=zi(i,t,n);let o,s=e.type||function(e){return e.root?"h-band":e.fields&&e.fields[0]?function(e){const t=e.map((e=>"dimension"===e.type()?"band":"linear"));return-1!==t.indexOf("linear")?"linear":"band"}(e.fields):"linear"}(r);return"color"===s&&(s=r.fields&&r.fields[0]&&"dimension"===r.fields[0].type()?"categorical-color":"sequential-color"),n.scale.has(s)&&(o=n.scale.get(s),o=o(e,r,{theme:n.theme,logger:n.logger}),o.type=s),o}function jo(e,t,n){let i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:zo;const r={};return{get(o){let s;return"string"==typeof o&&e[o]?s=o:"object"==typeof o&&"scale"in o&&e[o.scale]&&(s=o.scale),s?(r[s]=r[s]||i(e[s],t,n),r[s]):i(o,t,n)},all(){return Object.keys(e).forEach(this.get),r}}}Fo("linear",yo),Fo("band",bo),Fo("h-band",(function e(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const r={data:n,resources:i},o=uo(t,vo,r);o.ticks=uo(t.ticks,xo,r),o.value="function"==typeof t.value?t.value:e=>e.datum.value,o.label="function"==typeof t.label?t.label:e=>e.datum.value;let s=bo(o);const{values:a,labels:l,items:c,ticks:u}=qo(n.root,o,r),h=function(e){const t=String(e),n=c[t];return s(n?o.invert?n.rightEdge:n.leftEdge:t)};A(!0,h,s),h.bandwidth=function(e){const t=c[String(e)],n=s.bandwidth();if(t&&!t.isLeaf){const e=h(t.leftEdge),i=h(t.rightEdge);return Math.abs(e-i)+n}return n},h.step=function(e){const t=c[String(e)],n=t?t.count:1;let i=s.step();return i*=n,i},h.data=()=>n,h.datum=e=>{const t=c[String(e)];return t?t.node.data:null},h.copy=()=>e(t,n,i),h.labels=()=>l,h.ticks=()=>u.map((e=>{const t=h(e.key),n=h.bandwidth(e.key);return{position:t+n/2,label:e.label,data:e.node.data,start:t,end:t+n}}));const d=s.pxScale;return h.pxScale=function(e){return s=d(e),h},h.domain(a),h})),Fo("sequential-color",ko),Fo("threshold-color",(function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const i=eo(),r=uo(e,Eo,{data:t,resources:n}),o=Array.isArray(r.domain)&&r.domain.length,s=Array.isArray(r.range)&&r.range.length;function a(e){return L(e)?NaN:i(e)}Object.keys(i).forEach((e=>a[e]=i[e]));const l=t.fields,[c,u]=So(r,l),h=o?r.domain.length:-1,d=n.theme?n.theme.palette("sequential",h>0?h:2):[];let f=s?r.range:d,p=[];return p=o?r.domain:r.nice?Ro(f,c,u):[c+(u-c)/2],f.length>p.length+1?p=Ao(f,c,u):f.length<p.length+1&&(f=Io(p,f,c,u)),a.data=()=>t,a.range(r.invert?f.slice().reverse():f),a.domain(p),a})),Fo("categorical-color",(function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const i=Oo(e,t,n),r=n.theme,o=uo(e,Po,{data:t,resources:n});let s;if(o.explicit=uo(e.explicit,Lo,{data:t,resources:n}),s=Array.isArray(o.range)&&0!==o.range.length?o.range.slice():r?r.palette("categorical",i.domain().length).slice():[],o.unknown)i.unknown(o.unknown);else if(r&&r.palette("unknown")){let e=r.palette("unknown");i.unknown(e[0])}if(Array.isArray(o.explicit.domain)&&o.explicit.domain.length){const e=i.domain().slice(),t=o.explicit.domain,n=Array.isArray(o.explicit.range)?o.explicit.range:[],r=Math.floor(e.length/s.length);for(let e=1;e<r+1;e*=2)s=s.concat(s);if(o.explicit.override)for(let i=0;i<t.length;i++){const r=e.indexOf(t[i]);r>-1&&(s[r]=n[i])}else{const i=t.map(((t,i)=>[e.indexOf(t),t,n[i]])).sort(((e,t)=>e[0]-t[0]));i.forEach((t=>{const n=e.indexOf(t[1]);-1!==n&&s.splice(n,0,t[2])}))}s.length=e.length}return i.range(s),i}));var Ho={};function Bo(){Bo.init.call(this)}Ho.isObject=function(e){return"object"==typeof e&&null!==e},Ho.isNumber=function(e){return"number"==typeof e},Ho.isUndefined=function(e){return void 0===e},Ho.isFunction=function(e){return"function"==typeof e};var Vo=Bo;Bo.EventEmitter=Bo,Bo.prototype._events=void 0,Bo.prototype._maxListeners=void 0,Bo.defaultMaxListeners=10,Bo.init=function(){this._events=this._events||{},this._maxListeners=this._maxListeners||void 0},Bo.prototype.setMaxListeners=function(e){if(!Ho.isNumber(e)||e<0||isNaN(e))throw TypeError("n must be a positive number");return this._maxListeners=e,this},Bo.prototype.emit=function(e){var t,n,i,r,o,s;if(this._events||(this._events={}),"error"===e&&!this._events.error)throw(t=arguments[1])instanceof Error?t:Error('Uncaught, unspecified "error" event.');if(n=this._events[e],Ho.isUndefined(n))return!1;if(Ho.isFunction(n))switch(arguments.length){case 1:n.call(this);break;case 2:n.call(this,arguments[1]);break;case 3:n.call(this,arguments[1],arguments[2]);break;default:for(i=arguments.length,r=new Array(i-1),o=1;o<i;o++)r[o-1]=arguments[o];n.apply(this,r)}else if(Ho.isObject(n)){for(i=arguments.length,r=new Array(i-1),o=1;o<i;o++)r[o-1]=arguments[o];for(i=(s=n.slice()).length,o=0;o<i;o++)s[o].apply(this,r)}return!0},Bo.prototype.addListener=function(e,t){var n;if(!Ho.isFunction(t))throw TypeError("listener must be a function");(this._events||(this._events={}),this._events.newListener&&this.emit("newListener",e,Ho.isFunction(t.listener)?t.listener:t),this._events[e]?Ho.isObject(this._events[e])?this._events[e].push(t):this._events[e]=[this._events[e],t]:this._events[e]=t,Ho.isObject(this._events[e])&&!this._events[e].warned)&&((n=Ho.isUndefined(this._maxListeners)?Bo.defaultMaxListeners:this._maxListeners)&&n>0&&this._events[e].length>n&&(this._events[e].warned=!0,Ho.isFunction(console.error)&&console.error("(node) warning: possible EventEmitter memory leak detected. %d listeners added. Use emitter.setMaxListeners() to increase limit.",this._events[e].length),Ho.isFunction(console.trace)&&console.trace()));return this},Bo.prototype.on=Bo.prototype.addListener,Bo.prototype.once=function(e,t){if(!Ho.isFunction(t))throw TypeError("listener must be a function");var n=!1;function i(){this.removeListener(e,i),n||(n=!0,t.apply(this,arguments))}return i.listener=t,this.on(e,i),this},Bo.prototype.removeListener=function(e,t){var n,i,r,o;if(!Ho.isFunction(t))throw TypeError("listener must be a function");if(!this._events||!this._events[e])return this;if(r=(n=this._events[e]).length,i=-1,n===t||Ho.isFunction(n.listener)&&n.listener===t)delete this._events[e],this._events.removeListener&&this.emit("removeListener",e,t);else if(Ho.isObject(n)){for(o=r;o-- >0;)if(n[o]===t||n[o].listener&&n[o].listener===t){i=o;break}if(i<0)return this;1===n.length?(n.length=0,delete this._events[e]):n.splice(i,1),this._events.removeListener&&this.emit("removeListener",e,t)}return this},Bo.prototype.removeAllListeners=function(e){var t,n;if(!this._events)return this;if(!this._events.removeListener)return 0===arguments.length?this._events={}:this._events[e]&&delete this._events[e],this;if(0===arguments.length){for(t in this._events)"removeListener"!==t&&this.removeAllListeners(t);return this.removeAllListeners("removeListener"),this._events={},this}if(n=this._events[e],Ho.isFunction(n))this.removeListener(e,n);else if(Array.isArray(n))for(;n.length;)this.removeListener(e,n[n.length-1]);return delete this._events[e],this},Bo.prototype.listeners=function(e){return this._events&&this._events[e]?Ho.isFunction(this._events[e])?[this._events[e]]:this._events[e].slice():[]},Bo.listenerCount=function(e,t){return e._events&&e._events[t]?Ho.isFunction(e._events[t])?1:e._events[t].length:0};var $o={mixin:e=>(Object.keys(Vo.prototype).forEach((t=>{e[t]=Vo.prototype[t]})),Vo.init(e),e)};function Wo(){let e=0,t=0,n=0,i=0;n=n||e;const r={move(e){this.moveTo(n+e)},moveTo(o){const s=Math.max(e,Math.min(t-i,o));n!==s&&(n=s,r.emit("update"))},update(o){let s=!1;({min:e=e,max:t=t}=o),void 0!==o.viewSize&&o.viewSize!==i&&(i=o.viewSize,s=!0);const a=Math.max(e,Math.min(t-i,n));n!==a&&(n=a,s=!0),s&&r.emit("update")},getState:()=>({min:e,max:t,start:n,viewSize:i})};return $o.mixin(r),r}function Uo(e,t){const n=e.min||0,i=e.max||0,r=e.viewSize||0,o=t||Wo();return o.update({min:n,max:i,viewSize:r}),o}function Yo(e,t){const n={};for(const i in e)Object.prototype.hasOwnProperty.call(e,i)&&(n[i]=Uo(e[i],t?t[i]:null));return n}function Xo(e,t){return t[e]||(t[e]=Wo()),t[e]}function Ko(e,t){return e<=t}function Go(e,t){return e<t}function Jo(e,t,n){let i=0;for(;i<e.length&&t>e[i];)++i;return e[i]===t&&n&&++i,i}function Zo(e,t,n,i){const r=e.length;for(let o=1;o<r;o+=2)if(n(e[o-1],t)&&i(t,e[o]))return!0;return!1}function Qo(){let e,t,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},i=[];function r(){}return r.configure=function(){let n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const{includeMax:i=!0,includeMin:r=!0}=n;e=i?Ko:Go,t=r?Ko:Go},r.add=e=>{let{min:t,max:n}=e;const r=Jo(i,t),o=Jo(i,n,!0),s=[r,o-r];r%2==0&&s.push(t),o%2==0&&s.push(n);const a=i.join(",");i.splice(...s);return a!==i.join(",")},r.remove=e=>{let{min:t,max:n}=e;const r=Jo(i,t),o=Jo(i,n,!0),s=[r,o-r];r%2==1&&s.push(t),o%2==1&&s.push(n);const a=i.join(",");i.splice(...s);return a!==i.join(",")},r.set=e=>{const t=i.join(",");i=[],Array.isArray(e)?e.forEach(r.add):r.add(e);return t!==i.join(",")},r.clear=()=>{const e=i.length>0;return i=[],e},r.containsValue=n=>Zo(i,n,t,e),r.containsRange=e=>{let{min:t,max:n}=e;const r=Jo(i,t,!0),o=Jo(i,n);return r===o&&o%2==1},r.toggle=e=>r.containsRange(e)?r.remove(e):r.add(e),r.ranges=()=>{const e=[];for(let t=1;t<i.length;t+=2)e.push({min:i[t-1],max:i[t]});return e},r.configure(n),r}function es(){let e=[];function t(){}return t.add=t=>-1===e.indexOf(t)&&(e.push(t),!0),t.remove=t=>{const n=e.indexOf(t);return-1!==n&&(e.splice(n,1),!0)},t.contains=t=>-1!==e.indexOf(t),t.values=()=>e.slice(),t.clear=()=>e=[],t.toString=()=>e.join(";"),t}const ts={key:void 0,includeMin:!0,includeMax:!0};function ns(e){let{items:t,collection:n,vc:i}=e;const r={},o=[];let s,a;for(let e=0,o=t.length;e<o;e++){s=t[e].key,n[s]||(n[s]=i()),a=t[e].values||[t[e].value];for(let e=0;e<a.length;e++)n[s].add(a[e])&&(r[s]=r[s]||[],r[s].push(a[e]))}const l=Object.keys(r);for(let e=0,t=l.length;e<t;e++)s=l[e],o.push({id:s,values:r[s]});return o}function is(e){let{items:t,collection:n}=e;const i={},r=[];let o,s;for(let e=0,r=t.length;e<r;e++)if(o=t[e].key,n[o]){s=t[e].values||[t[e].value];for(let e=0;e<s.length;e++)n[o].remove(s[e])&&(i[o]=i[o]||[],i[o].push(s[e]))}const a=Object.keys(i);for(let e=0,t=a.length;e<t;e++)o=a[e],r.push({id:o,values:i[o]});return r}function rs(e){const t={};let n,i;for(let r=0,o=e.length;r<o;r++){n=e[r].key,i=e[r].values||[e[r].value],t[n]||(t[n]=[]);for(let e=0;e<i.length;e++){-1===t[n].indexOf(i[e])&&t[n].push(i[e])}}return t}function os(e){let{key:t,collection:n,obj:i,fn:r,value:o}=e;n[t]||(n[t]=r()),i[t]=i[t]||[],i[t].push(o),n[t].add(o)}function ss(e){let{items:t,values:n,vc:i}=e;const r={},o={},s=[],a=[],l=rs(t);let c,u,h;const d=Object.keys(l);for(let e=0,t=d.length;e<t;e++){c=d[e],h=l[c];for(let e=0,t=h.length;e<t;e++)u=h[e],n[c]&&n[c].contains(u)?n[c]&&n[c].contains(u)&&(o[c]=o[c]||[],o[c].push(u),n[c].remove(u)):os({key:c,value:u,collection:n,obj:r,fn:i})}const f=Object.keys(r);for(let e=0,t=f.length;e<t;e++)c=f[e],s.push({id:c,values:r[c]});const p=Object.keys(o);for(let e=0,t=p.length;e<t;e++)c=p[e],a.push({id:c,values:o[c]});return[s,a]}function as(e,t){const n=[],i=Object.keys(e);let r,o;const s=e=>-1===t[r].indexOf(e);for(let a=0,l=i.length;a<l;a++)r=i[a],t[r]?(o=e[r].filter(s),o.length&&n.push({id:r,values:o})):n.push({id:r,values:e[r]});return n}function ls(e){let{items:t,vCollection:n,vc:i}=e;const r={},o=rs(t);let s,a=[],l=[];const c={},u=Object.keys(n);for(let e=0,t=u.length;e<t;e++)s=u[e],c[s]=n[s].values().slice(),delete n[s];const h=e=>{n[s]&&n[s].contains(e)||os({key:s,value:e,collection:n,obj:r,fn:i})},d=Object.keys(o);for(let e=0,t=d.length;e<t;e++)s=d[e],o[s].forEach(h);return l=as(c,r),a=as(r,c),[a,l]}function cs(e,t,n){const i=function(e,t){if(!Object.keys(t).length)return e;const n=e.length,i=Array(n);for(let r=0;r<n;r++)i[r]=e[r].key in t?A({},e[r],{key:t[e[r].key]}):e[r];return i}(t,n);return e&&e.length?e.reduce(((e,t)=>t(e)),i):i}function us(e){return e.replace(/(-[a-z])/g,(e=>e.toUpperCase().replace("-","")))}function hs(e){return e.replace(/([A-Z])/g,(e=>"-".concat(e.toLowerCase())))}function ds(e,t,n){let{ranges:i,interceptors:r,rc:o,aliases:s,rangeConfig:a}=n;const l=cs(r["".concat(t,"Ranges")],e,s);let c=!1;return l.forEach((e=>{const n=e.key;if(i[n]||(i[n]=o(a.sources[n]||a.default)),"set"===t)c=i[n][t](e.ranges||e.range)||c;else{const r=e.ranges||[e.range];for(let e=0;e<r.length;e++)c=i[n][t](r[e])||c}})),c}function fs(){let{vc:e=es,rc:t=Qo}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=!1,i={},r={},o={},s={sources:{},default:A({},ts)};const a={addValues:[],removeValues:[],toggleValues:[],setValues:[],addRanges:[],setRanges:[],removeRanges:[],toggleRanges:[]},l=()=>{const e={values:{},ranges:{}};return Object.keys(r).forEach((t=>{e.values[t]=r[t].values()})),Object.keys(i).forEach((t=>{e.ranges[t]=i[t].ranges()})),e},c={ls:[],clear(){this.ls.forEach((e=>e.clear()))},start(){this.ls.forEach((e=>e.start()))},end(){this.ls.forEach((e=>e.end()))},update(){const e=l();this.ls.forEach((t=>t._state(e)))},updateValues(){const e=l();this.ls.forEach((t=>t._state({values:e.values})))},updateRanges(){const e=l();this.ls.forEach((t=>t._state({ranges:e.ranges})))}},u={configure:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};Array.isArray(e.ranges)&&e.ranges.length&&(s={sources:{},default:A({},ts)},e.ranges.forEach((e=>{const t={};Object.keys(ts).filter((e=>"key"!==e)).forEach((n=>{t[n]=void 0!==e[n]?e[n]:ts[n]})),void 0!==e.key?s.sources[e.key]=t:s.default=t})),Object.keys(i).forEach((e=>i[e].configure(s.sources[e]||s.default))),u.emit("update",[],[]))},link:e=>{if(u===e)throw new Error("Can't link to self");c.ls.push(e),e._state(l())},_state:e=>{if(!e)return l();if(e.values){const t=[];Object.keys(e.values).forEach((n=>{r[n]&&e.values[n].join(";")===r[n].toString()||t.push({key:n,values:e.values[n]})})),Object.keys(r).forEach((n=>{e.values[n]||t.push({key:n,values:[]})})),t.length&&u.setValues(t)}if(e.ranges){const t=[];Object.keys(e.ranges).forEach((n=>{i[n]&&e.ranges[n].join(";")===i[n].toString()||t.push({key:n,ranges:e.ranges[n]})})),Object.keys(i).forEach((n=>{e.ranges[n]||t.push({key:n,ranges:[]})})),t.length&&u.setRanges(t)}},start:function(){if(!n){n=!0;for(var e=arguments.length,t=new Array(e),i=0;i<e;i++)t[i]=arguments[i];u.emit("start",...t),c.start()}},end:function(){if(n){n=!1,i={},r={};for(var e=arguments.length,t=new Array(e),o=0;o<e;o++)t[o]=arguments[o];u.emit("end",...t),c.end()}},isActive:()=>n,clear:()=>{const e=u.brushes().filter((e=>"value"===e.type&&e.brush.values().length)).map((e=>({id:e.id,values:e.brush.values()}))),t=Object.keys(i).length>0||e.length;i={},r={},t&&(u.emit("update",[],e),c.clear())},brushes:()=>{let e=[];return e=e.concat(Object.keys(i).map((e=>({type:"range",id:e,brush:i[e]})))),e=e.concat(Object.keys(r).map((e=>({type:"value",id:e,brush:r[e]})))),e},addValue:(e,t)=>{u.addValues([{key:e,value:t}])},addValues:t=>{const i=cs(a.addValues,t,o),s=ns({vc:e,collection:r,items:i});u.emit("add-values",i),s.length&&(n||(n=!0,u.emit("start")),u.emit("update",s,[]),c.updateValues())},setValues:t=>{const i=cs(a.setValues,t,o),s=ls({items:i,vCollection:r,vc:e});u.emit("set-values",i),(s[0].length>0||s[1].length>0)&&(n||(n=!0,u.emit("start")),u.emit("update",s[0],s[1]),c.updateValues())},removeValue:(e,t)=>{u.removeValues([{key:e,value:t}])},removeValues:e=>{const t=cs(a.removeValues,e,o),n=is({collection:r,items:t});u.emit("remove-values",t),n.length&&(u.emit("update",[],n),c.updateValues())},addAndRemoveValues:(t,i)=>{const s=cs(a.addValues,t,o),l=cs(a.removeValues,i,o),h=ns({vc:e,collection:r,items:s}),d=is({collection:r,items:l});u.emit("add-values",s),u.emit("remove-values",l),(h.length||d.length)&&(n||(n=!0,u.emit("start")),u.emit("update",h,d),c.updateValues())},toggleValue:(e,t)=>{u.toggleValues([{key:e,value:t}])},toggleValues:t=>{const i=cs(a.toggleValues,t,o),s=ss({items:i,values:r,vc:e});u.emit("toggle-values",i),(s[0].length>0||s[1].length>0)&&(n||(n=!0,u.emit("start")),u.emit("update",s[0],s[1]),c.updateValues())},containsValue:(e,t)=>{let n=o[e]||e;return!!r[n]&&r[n].contains(t)},addRange:(e,t)=>{u.addRanges([{key:e,range:t}])},addRanges:e=>{ds(e,"add",{ranges:i,rc:t,interceptors:a,aliases:o,rangeConfig:s})&&(n||(n=!0,u.emit("start")),u.emit("update",[],[]),c.updateRanges())},removeRange:(e,t)=>{u.removeRanges([{key:e,range:t}])},removeRanges:e=>{ds(e,"remove",{ranges:i,rc:t,interceptors:a,aliases:o,rangeConfig:s})&&(n||(n=!0,u.emit("start")),u.emit("update",[],[]),c.updateRanges())},setRange:(e,t)=>{u.setRanges([{key:e,range:t}])},setRanges:e=>{ds(e,"set",{ranges:i,rc:t,interceptors:a,aliases:o,rangeConfig:s})&&(n||(n=!0,u.emit("start")),u.emit("update",[],[]),c.updateRanges())},toggleRange:(e,t)=>{u.toggleRanges([{key:e,range:t}])},toggleRanges:e=>{ds(e,"toggle",{ranges:i,rc:t,interceptors:a,aliases:o,rangeConfig:s})&&(n||(n=!0,u.emit("start")),u.emit("update",[],[]),c.updateRanges())},containsRangeValue:(e,t)=>{let n=o[e]||e;return!!i[n]&&i[n].containsValue(t)},containsRange:(e,t)=>{let n=o[e]||e;return!!i[n]&&i[n].containsRange(t)},containsMappedData:(e,t,n)=>{let s=[];const a=Object.keys(e);let l,c,u,h;for(let t=0,n=a.length;t<n;t++){if(l=a[t],"value"===l)c=e,s[t]={key:"",i:t,bool:!1};else{if("source"===l)continue;c=e[l],s[t]={key:l,i:t,bool:!1}}u=c.source&&c.source.field,void 0!==u&&(void 0!==c.source.key&&(u="".concat(c.source.key,"/").concat(u)),u in o&&(u=o[u]),h=c.value,i[u]?s[t].bool=Array.isArray(h)?i[u].containsRange({min:h[0],max:h[1]}):i[u].containsValue(h):r[u]&&r[u].contains(h)&&(s[t].bool=!0))}return t?(s=s.filter((e=>-1!==t.indexOf(e.key))),"and"===n?!!s.length&&!s.some((e=>!1===e.bool)):"xor"===n?!!s.length&&s.some((e=>e.bool))&&s.some((e=>!1===e.bool)):s.some((e=>e.bool))):s.some((e=>e.bool))},intercept:(e,t)=>{const n=us(e);a[n]&&a[n].push(t)},removeInterceptor:(e,t)=>{const n=us(e);if(!a[n])return;const i=a[n].indexOf(t);-1!==i&&a[n].splice(i,1)},removeAllInterceptors:e=>{const t=[];if(e){const n=us(e);a[n]&&a[n].length&&t.push({name:e,handlers:a[n]})}else Object.keys(a).forEach((e=>{a[e].length&&t.push({name:hs(e),handlers:a[e]})}));t.forEach((e=>{e.handlers.slice().forEach((t=>u.removeInterceptor(e.name,t)))}))},addKeyAlias:(e,t)=>{o[e]=t},removeKeyAlias:e=>{delete o[e]}};return $o.mixin(u),u}function ps(e){return e*e*e}function ms(e){return--e*e*e+1}function gs(e){return((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2}function ys(e,t){return e.data?e.data.value:"text"===e.type?e.text:t}function vs(e,t,n,i){let r,{old:o,current:s}=e,{renderer:a}=t,l=[],c={nodes:[],ips:[]},u={nodes:[],ips:[]},h={nodes:[],ips:[]},d=[],f=null;const p=n.trackBy||ys,m={start(){let e={};if(o.forEach(((t,n)=>{let i=p(t,n);e[i]=t})),s.forEach(((t,n)=>{let i=p(t,n);if(e[i]){if("path"===t.type&&t.points&&t.points.length>0&&"trend"!==t.data.source.key){const n=function(e,t){const n=e.points.filter((e=>!e.dummy)),i=t.points.filter((e=>!e.dummy)),r=i.map((e=>e.data.major.value)),o=n.filter((e=>r.includes(e.data.major.value))).map((e=>e.data.major.value)),s=n.filter((e=>o.includes(e.data.major.value))),a=i.filter((e=>o.includes(e.data.major.value)));return{old:s,current:a}}(e[i],t);h.ips.push(Pr(A({},e[i],{points:n.old}),A({},t,{points:n.current}))),l.push(A({},e[i],{commonPoints:n.old}))}else h.ips.push(Pr(e[i],t)),l.push(e[i]);h.nodes.push(t),e[i]=!1}else c.nodes.push(t),c.ips.push(Pr(A({},t,{r:.001,opacity:0}),t))})),Object.keys(e).forEach((t=>{e[t]&&(u.nodes.push(e[t]),u.ips.push(Pr(e[t],A({},e[t],{r:1e-4,opacity:0}))))})),d.push({name:"exiting",easing:ps,duration:200,tweens:u.ips,nodes:[...l]}),d.push({name:"updating",easing:gs,duration:400,tweens:h.ips,nodes:[]}),d.push({name:"entering",easing:ms,duration:200,tweens:c.ips,nodes:[...h.nodes]}),n.isMainComponent){var t;const e=null===(t=n.isMainComponent)||void 0===t?void 0:t.filterFn,r=e?l.filter(e).length:l.length,{isInit:o,shouldBeRemoved:s}=i.getValue("animations.updatingStageMeta");!1===o?(i.setValue("animations.updatingStageMeta.shouldBeRemoved",0===r),i.setValue("animations.updatingStageMeta.isInit",!0)):i.setValue("animations.updatingStageMeta.shouldBeRemoved",s&&0===r)}d.length&&(f=a.getScene(s),d[0].started=Date.now(),"undefined"!=typeof window&&(r=window.requestAnimationFrame(m.tick)))},tick(){let e=d[0];e||m.stop(),e.started||(e.started=Date.now());let t=(Date.now()-e.started)/e.duration,n=[],o=e.tweens.map((n=>n(e.easing(Math.min(1,t)))));if(n.push(...o),n.push(...e.nodes),a.render(n),t>=1){d.shift();const{isInit:e,shouldBeRemoved:t}=i.getValue("animations.updatingStageMeta");d.length?"updating"===d[0].name&&t&&d.shift():(!0===e&&i.setValue("animations.updatingStageMeta.isInit",!1),m.stop())}r&&(r=window.requestAnimationFrame(m.tick))},stop(){r&&(window.cancelAnimationFrame(r),r=!1)},inProgress:()=>!!r,get targetScene(){return f}};return m}Ge();const bs={fontFamily:"Arial",fontSize:"13px",color:"#595959",backgroundColor:"#ffffff",stroke:"#000000",strokeWidth:0,$fill:"#333333"},xs=/^\$/;function ws(e){const t=typeof e;return"object"!==t&&"function"!==t&&"undefined"!==t}function qs(e,t,n){const i=e[t];i&&i.scale&&i.scale.pxScale?i.scale=i.scale.pxScale(n):i&&i.pxScale&&(e[t]=i.pxScale(n))}function Ms(e,t){return e.pxScale?e.pxScale(t):e}const Ds={normalizeSettings:function(e,t,n){const i=A({},e),r=A({},t);return Object.keys(i).forEach((e=>{r[e]={};const o=i[e],s=typeof o;if("function"==typeof o)r[e].fn=o;else if(ws(o)){let n=t[e];"string"==typeof n&&xs.test(n)&&(n=bs[n]);const i=typeof n;r[e]="undefined"===i||i===s?o:n}else o&&"object"==typeof o&&("function"==typeof o.fn&&(r[e].fn=o.fn),void 0!==o.scale&&(r[e].scale=n.scale(o.scale)),"string"==typeof o.ref&&(r[e].ref=o.ref))})),Object.keys(t).forEach((e=>{if(e in i)return;const n=t[e];"string"===typeof n&&xs.test(n)?r[e]=bs[n]:r[e]=n})),r},resolveForItem:function(e,t,n){const i={},r=Object.keys(t),o=r.length,s=e.datum,a=e.datum;for(let l=0;l<o;l++){const o=r[l],c=t[o],u="object"==typeof a&&void 0!==c,h=u&&"string"==typeof c.ref,d=u&&o in a,f=h?a[c.ref]:d?a[o]:s;ws(c)?i[o]=c:u&&c.fn?(c.scale&&(e.scale=c.scale),i[o]=c.fn.call(null,e,n)):u&&c.scale&&f?(i[o]=c.scale(f.value),c.scale.bandwidth&&(i[o]+=c.scale.bandwidth()/2)):h&&f?i[o]=f.value:c.fn?i[o]=c.fn.call(null,e,n):i[o]=c}return i},updateScaleSize:qs};function Ss(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Ds,n={};function i(i){let{data:r,settings:o,defaults:s={},scaled:a}=i;const l=n.norm=t.normalizeSettings(o,s,e.chart),c={scale:e.chart.scale,formatter:e.chart.formatter};a&&Object.keys(a).forEach((e=>{l[e]&&t.updateScaleSize(l,e,a[e])}));const u=[];if(!r||!Array.isArray(r.items)){const e={data:r,resources:c};let i=t.resolveForItem(e,n.norm,-1);return{settings:n.norm,item:i}}{let e;for(let i=0,o=r.items.length;i<o;i++){e={datum:r.items[i],data:r,resources:c};let o=t.resolveForItem(e,n.norm,i);o.data=r.items[i],u.push(o)}}return{settings:n.norm,items:u}}return{resolve:i}}function _s(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];return e.reduce(((e,t)=>Array.isArray(t.children)?(e.push(..._s(t.children)),e):(e.push(t),e)),[])}function Cs(e,t){let{context:n,data:i,style:r,filter:o,mode:s}=t;const a=e.chart.brush(n),l=i,c=r.active||{},u=r.inactive||{},h=[];Object.keys(c).forEach((e=>{h.push(e)})),Object.keys(u).forEach((e=>{-1===h.indexOf(e)&&h.push(e)}));const d=[];let f=!1;const p=()=>{let t=_s(e.nodes);return"function"==typeof o&&(t=t.filter(o)),t},m=()=>{const e=p(),t=e.length;let n,i=!1;const r="function"==typeof l?l({brush:a}):l;for(let i=0;i<t;i++){if(n=e[i].data,!n)continue;e[i].__style||(e[i].__style={},h.forEach((t=>{e[i].__style[t]=e[i][t]})));const t=a.containsMappedData(n,r,s),o=d.indexOf(e[i]);let l=!1;t&&-1===o?(d.push(e[i]),l=!0):t||-1===o||(d.splice(o,1),l=!0),e[i].needToUpdate=l||f,e[i].isActive=t}for(let r=0;r<t;r++)if(n=e[r].data,n){if(e[r].needToUpdate){const t=A({},e[r],e[r].__style),n=e[r].isActive;h.forEach((i=>{e[r][i]=n&&i in c?"function"==typeof c[i]?c[i].call(null,t,d):c[i]:!n&&i in u?"function"==typeof u[i]?u[i].call(null,t,d):u[i]:e[r].__style[i]})),i=!0}delete e[r].needToUpdate}return f=!1,i},g=function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{suppressRender:!1};const{suppressRender:n}=t,i=p(),r=i.length;for(let e=0;e<r;e++)i[e].data&&(i[e].__style=i[e].__style||{},h.forEach((t=>{i[e].__style[t]=i[e][t],t in u&&(i[e][t]="function"==typeof u[t]?u[t].call(null,i[e]):u[t])})));f=!0,d.length=0,n||e.renderer.render(e.nodes)},y=function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{suppressRender:!1};const{suppressRender:n}=t,i=p(),r=i.length;for(let e=0;e<r;e++)i[e].__style&&(Object.keys(i[e].__style).forEach((t=>{i[e][t]=i[e].__style[t]})),i[e].__style=void 0);d.length=0,n||e.renderer.render(e.nodes)},v=()=>{if(m()){const t="function"==typeof e.config.sortNodes?e.config.sortNodes(e):e.nodes;"function"==typeof e.config.customRender?e.config.customRender({render:e.renderer.render,nodes:t}):e.renderer.render(t)}};return a.on("start",g),a.on("end",y),a.on("update",v),{isActive:()=>a.isActive(),update:()=>{d.length=0,f=!0,m()},cleanUp:function(){a.removeListener("start",g),a.removeListener("end",y),a.removeListener("update",v)}}}function ks(e){let{nodes:t,action:n,chart:i,trigger:r}=e;const o=[];for(let e=0;e<t.length;e++){let n=t[e].data;null!==n&&o.push(n)}!function(e){let{dataPoints:t,action:n,chart:i,trigger:r}=e;if(!r)return;const o=r.data||[""];let s={items:[],actionFn:"toggleRanges"},a={items:[],actionFn:"toggleValues"};-1!==["add","remove","set","toggle"].indexOf(n)&&(s.actionFn="".concat(n,"Ranges"),a.actionFn="".concat(n,"Values"));for(let e=0;e<t.length;e++){const n=t[e];n&&o.forEach((e=>{let t=n&&!e?n:n[e];if(t){let e={key:t.source.field};void 0!==t.source.key&&(e.key="".concat(t.source.key,"/").concat(t.source.field)),Array.isArray(t.value)?(e.range={min:t.value[0],max:t.value[1]},s.items.push(e)):(e.value=t.value,a.items.push(e))}}))}r.contexts.forEach((e=>{s.items.length?i.brush(e)[s.actionFn](s.items):i.brush(e)[a.actionFn](a.items)}))}({dataPoints:o,action:n,chart:i,trigger:r})}function Es(e){let{collisions:t,t:n,config:i,action:r}=e,o=[],s=!1;t.length>0&&(o=t,s=!0,"stop"===n.propagation&&(o=[t[t.length-1]]));const a=o.map((e=>e.node));return ks({nodes:a,action:r,chart:i.chart,data:i.data,trigger:n}),s}function As(e,t,n){const i=n.element().getBoundingClientRect();let r=O(e)?function(e,t){return 1!==e.changedTouches.length?null:{x:e.changedTouches[0].clientX-t.left,y:e.changedTouches[0].clientY-t.top}}(e,i):function(e,t){return{x:e.clientX-t.left,y:e.clientY-t.top}}(e,i);return null===r||r.x<0||r.y<0||r.x>i.width||r.y>i.height?[]:(t.touchRadius>0&&O(e)?r={cx:r.x,cy:r.y,r:t.touchRadius}:t.mouseRadius>0&&!O(e)&&(r={cx:r.x,cy:r.y,r:t.mouseRadius}),n.itemsAt(r))}function Ts(e,t,n){return e?"function"==typeof e?e(t):e:n}function Is(e){let{e:t,t:n,config:i}=e;return Es({collisions:As(t,n,i.renderer),t:n,config:i,action:Ts(n.action,t,"toggle")})}function Rs(e){let{e:t,t:n,config:i}=e;return Es({collisions:As(t,n,i.renderer),t:n,config:i,action:Ts(n.action,t,"set")})}const Ns={fill:"fill",stroke:"stroke",opacity:"opacity",strokeWidth:"stroke-width",strokeLinejoin:"stroke-linejoin",fontFamily:"font-family",fontSize:"font-size",fontWeight:"font-weight",baseline:"dominant-baseline",dominantBaseline:"dominant-baseline",anchor:"text-anchor",textAnchor:"text-anchor",maxWidth:"maxWidth",transform:"transform",strokeDasharray:"stroke-dasharray",id:"id"};function Os(e){let t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],n="";for(let t=0;t<e.length;t++){const i=e[t];n+=0===t?"M".concat(i.x," ").concat(i.y):"L".concat(i.x," ").concat(i.y),n+=" "}return t&&(n+="Z"),n}function Ps(e,t,n,i){const r=n/2,o=e-i/2,s=t-i/2,a=e-r,l=t-r;return[{x:o,y:s},{x:o,y:l},{x:o+i,y:l},{x:o+i,y:s},{x:a+n,y:s},{x:a+n,y:s+i},{x:o+i,y:s+i},{x:o+i,y:l+n},{x:o,y:l+n},{x:o,y:s+i},{x:a,y:s+i},{x:a,y:s}]}function Ls(e){return-e/180*Math.PI}function Fs(e){return function(e){let t=(.5*(Math.floor(e/Math.PI*2)+2)+.25)*Math.PI,n=Math.cos(Math.abs(t-e))*Math.sqrt(2),i=n*Math.cos(e),r=n*Math.sin(e);return{x1:i<0?1:0,y1:r<0?1:0,x2:i>=0?i:i+1,y2:r>=0?r:r+1}}(Ls(e))}function zs(e,t){return{x:e.x+t.x,y:e.y+t.y}}function js(e,t){return{x:e.x-t.x,y:e.y-t.y}}function Hs(e,t){return{x:e.x*t,y:e.y*t}}function Bs(e,t){return e.x-t.x}function Vs(e,t){return e.y-t.y}function $s(e,t){return Bs(e,t)**2+Vs(e,t)**2}function Ws(e,t){return Math.sqrt($s(e,t))}function Us(e,t){return e.x*t.x+e.y*t.y}function Ys(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{x:0,y:0};const i=Math.cos(t),r=Math.sin(t),o=js(e,n),s={x:i*o.x-r*o.y,y:r*o.x+i*o.y};return zs(s,n)}const Xs={up:0,down:180,left:90,right:-90};function Ks(e){let{x:t,y:n,size:i}=e;const r=i/2;return{type:"rect",x:t-r,y:n-r,width:i,height:i}}const Gs=Ge();function Js(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};Object.keys(t).forEach((n=>{void 0!==Ns[n]&&"transform"!==n&&(e[n]=t[n])}))}Gs.add("circle",(function(e){return{type:"circle",fill:"black",cx:e.x,cy:e.y,r:e.size/2}})),Gs.add("diamond",(function(e){const t=e.size,n=e.x-t/2,i=e.y-t/2;return{type:"path",fill:"black",d:Os([{x:n,y:i+t/2},{x:n+t/2,y:i},{x:n+t,y:i+t/2},{x:n+t/2,y:i+t},{x:n,y:i+t/2}])}})),Gs.add("saltire",(function(e){const t=Ls(45),n=e.size/2,i=isNaN(e.width)?n/2:e.width,r=Math.min(i,n);let o=e.size;const s=Math.sin(Math.asin(-t))*(r/2);o+=2*(n/Math.sin(-t)-n),o-=2*s;const a={x:e.x,y:e.y},l=Ps(e.x,e.y,o,r).map((e=>Ys(e,t,a)));return{type:"path",fill:"black",d:Os(l)}})),Gs.add("square",(function(e){const t=e.size;return{type:"rect",fill:"black",x:e.x-t/2,y:e.y-t/2,width:t,height:t}})),Gs.add("triangle",(function(e){const t=e.size,n={x:e.x,y:e.y},i=Xs[e.direction]||0,r=t/2,o=e.x-r,s=e.y-r;let a=[{x:o,y:s+t},{x:o+r,y:s},{x:o+t,y:s+t},{x:o,y:s+t}];const l=Ls(i);return a=a.map((e=>Ys(e,l,n))),{type:"path",fill:"black",d:Os(a)}})),Gs.add("line",(function(e){const t="vertical"===e.direction,n=e.size/2,i=e.x,r=e.y;return{type:"line",stroke:"black",strokeWidth:1,x1:i-(t?0:n),y1:r-(t?n:0),x2:i+(t?0:n),y2:r+(t?n:0),collider:Ks(e)}})),Gs.add("star",(function(e){const t=e.size,n=[],i=t/2,r=e.points||5,o=Math.min(e.innerRadius||t/2,t)/2,s=isNaN(e.startAngle)?90:e.startAngle,a=360/r;for(let t=1;t<=r;t++){const r=a*t+s,l=Ls(r),c=Ls(r+a/2),u=Math.sin(l),h=Math.cos(l),d=Math.sin(c),f=Math.cos(c);n.push({x:e.x+h*i,y:e.y+u*i}),n.push({x:e.x+f*o,y:e.y+d*o})}return{type:"path",fill:"black",d:Os(n)}})),Gs.add("n-polygon",(function(e){const t=[],n=e.size/2,i=Math.max(isNaN(e.sides)?6:e.sides,3),r=360/i,o=isNaN(e.startAngle)?0:e.startAngle;for(let s=1;s<=i;s++){const i=Ls(r*s+o),a=Math.sin(i),l=Math.cos(i);t.push({x:e.x+l*n,y:e.y+a*n})}return{type:"path",fill:"black",d:Os(t)}})),Gs.add("cross",(function(e){const t=e.x,n=e.y,i=e.size/2,r=isNaN(e.width)?i/2:e.width,o=Math.min(r,i);return{type:"path",fill:"black",d:Os(Ps(t,n,e.size,o))}})),Gs.add("bar",(function(e){const t={x:e.x,y:e.y},n="vertical"===e.direction,i=e.size/2,r=i/2/2;let o=[{x:t.x-i,y:t.y+r},{x:t.x-i,y:t.y-r},{x:t.x+i,y:t.y-r},{x:t.x+i,y:t.y+r}];if(n){const e=Ls(90);o=o.map((n=>Ys(n,e,t)))}const s=H(o);return s.type="rect",s.fill="black",s})),Gs.add("rect",(function(e){const{x:t,y:n,size:i}=e,r=void 0===e.width?i:e.width,o=void 0===e.height?i:e.height;return{type:"rect",fill:"black",x:t-r/2,y:n-o/2,width:r,height:o}}));const Zs=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Gs;return function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const n=e.get(t.type);if(n){const e=n(t);return Js(e,t),void 0!==t.data&&(e.data=t.data),e}return n}};function Qs(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},{dock:n="center",displayOrder:i=0,prioOrder:r=0,preferredSize:o=0,minimumLayoutMode:s,show:a=!0}=e;n=n||"center";const l={computePreferredSize(e){let{inner:n,outer:i,children:r}=e;return"function"==typeof o?o({inner:n,outer:i,children:r,dock:this.dock()},t):o},dock(e){return void 0!==e?(n=e,this):"function"==typeof n?n(t):n},displayOrder(e){return void 0!==e?(i=e,this):"function"==typeof i?i(t):i},prioOrder(e){return void 0!==e?(r=e,this):"function"==typeof r?r(t):r},minimumLayoutMode(e){return void 0!==e?(s=e,this):"function"==typeof s?s(t):s},show(e){return void 0!==e?(a=e,this):"function"==typeof a?a(t):a}};return l}function ea(e,t,n){const{require:i=[]}=t,r=t.mediator||{},{settings:o,formatter:s,scale:a,data:l,renderer:c,chart:u,dockConfig:h,mediator:d,instance:f,rect:p,style:m,registries:g,resolver:y,update:v,_DO_NOT_USE_getInfo:b,symbol:x,isVisible:w}=n;e.emit=()=>{},w&&(e.isVisible=w),Object.defineProperty(e,"settings",{get:o}),Object.defineProperty(e,"data",{get:l}),Object.defineProperty(e,"formatter",{get:s}),Object.defineProperty(e,"scale",{get:a}),Object.defineProperty(e,"mediator",{get:d}),Object.defineProperty(e,"style",{get:m}),Object.defineProperty(e,"registries",{get:g}),p&&Object.defineProperty(e,"rect",{get:p}),b&&(e._DO_NOT_USE_getInfo=b),Object.keys(t).forEach((n=>{var i;i=n,["on","preferredSize","created","beforeMount","mounted","resize","beforeUpdate","updated","beforeRender","render","beforeUnmount","beforeDestroy","destroyed","defaultSettings","data","settings","formatter","scale","chart","dockConfig","mediator","style","resolver","registries","_DO_NOT_USE_getInfo","symbol","isVisible"].some((e=>e===i))||("function"==typeof t[n]?e[n]=t[n].bind(e):e[n]=t[n])})),i.forEach((t=>{"renderer"===t?Object.defineProperty(e,"renderer",{get:c}):"chart"===t?Object.defineProperty(e,"chart",{get:u}):"dockConfig"===t?Object.defineProperty(e,"dockConfig",{get:h}):"instance"===t?Object.defineProperty(e,"instance",{get:f}):"update"===t&&v?Object.defineProperty(e,"update",{get:v}):"resolver"===t?Object.defineProperty(e,"resolver",{get:y}):"symbol"===t&&Object.defineProperty(e,"symbol",{get:x})})),Object.keys(r).forEach((t=>{e.mediator.on(t,r[t].bind(e))}))}function ta(e,t,n){const i=t=>e[t]?(n.warn("Deprecation Warning the ".concat(t," property should be moved into layout: {} property")),e[t]):e.layout?e.layout[t]:void 0,r={};return r.displayOrder=i("displayOrder"),r.dock=i("dock"),r.prioOrder=i("prioOrder"),r.minimumLayoutMode=i("minimumLayoutMode"),e.layout=e.layout||{},e.layout.displayOrder=void 0!==r.displayOrder?r.displayOrder:e.layout.displayOrder,e.layout.prioOrder=void 0!==r.prioOrder?r.prioOrder:e.layout.prioOrder,e.layout.dock=r.dock||e.layout.dock,e.layout.minimumLayoutMode=r.minimumLayoutMode||e.layout.minimumLayoutMode,r.show=e.show,r.preferredSize=t,r}function na(e,t,n){Object.keys(n.on||{}).forEach((i=>{e.eventListeners=e.eventListeners||[];const r=n.on[i].bind(e);e.eventListeners.push({event:i,listener:r}),t.on(i,r)})),e.emit=function(e){for(var n=arguments.length,i=new Array(n>1?n-1:0),r=1;r<n;r++)i[r-1]=arguments[r];return t.emit(e,...i)}}function ia(e,t){e.eventListeners&&(e.eventListeners.forEach((e=>{let{event:n,listener:i}=e;t.removeListener(n,i)})),e.eventListeners.length=0),e.emit=()=>{}}function ra(e){const t=A(!0,{},e),n={getAll:()=>t,getValue:(e,n)=>function(e,t,n){if(void 0===e||void 0===t)return n;const i=t.split(".");let r=e;for(let e=0;e<i.length;++e){const t=i[e];if(void 0===r[t])return n;r=r[t]}return r}(t,e,n),setValue:(e,n)=>function(e,t,n){if(void 0===e||void 0===t)return;const i=t.split("."),r=i[i.length-1];let o=e;for(let e=0;e<i.length-1;++e){const t=i[e];void 0===o[t]&&(o[t]=Number.isNaN(+i[e+1])?{}:[]),o=o[t]}void 0!==n?o[r]=n:delete o[r]}(t,e,n)};return n}function oa(e,t,n){const i=zs(function(e,t){const n=Us(e,t)/Us(t,t)||1;return{x:t.x*n,y:t.y*n}}(js(n,e),js(t,e)),e);return i}function sa(e,t,n){return Ws(e,n)+Ws(t,n)-Ws(e,t)<1e-12}function aa(e,t){return e.x>=t.x&&e.x+e.width<=t.x+t.width&&e.y>=t.y&&e.y+e.height<=t.y+t.height}function la(e){return e.x1===e.x2&&e.y1===e.y2}function ca(e){return e.width<=0||e.height<=0}function ua(e){return e.r<=0}function ha(e){return e.edges.length<=2}function da(e,t){let n=!1;for(let i=0,r=t.edges.length;i<r;i++)if(n=ba(e,B(t.edges[i])),!0===n)return!0;return!1}function fa(e,t){let n=!1;const{numPolygons:i,polygons:r}=t;for(let t=0;t<i;t++){if(n=ka(e,r[t]),!0===n)return!0}return!1}function pa(e,t){if(ua(e))return!1;return $s({x:e.cx,y:e.cy},t)<=e.r**2}function ma(e,t){if(ca(t)||ua(e))return!1;const n=t.width/2,i=t.height/2,r=t.x+n,o=t.y+i,s=e.r,a=e.cx,l=e.cy,c=Math.abs(a-r),u=Math.abs(l-o);if(c>n+s||u>i+s)return!1;if(c<=n||u<=i)return!0;return(c-n)**2+(u-i)**2<=s**2}function ga(e,t){if(ua(e)||la(t))return!1;const[n,i]=z(t);if(pa(e,n)||pa(e,i))return!0;const r={x:e.cx,y:e.cy},o=oa(n,i,r);return $s(o,r)<=e.r**2&&sa(n,i,o)}function ya(e,t){if(ha(t)||ua(e))return!1;if(va(t,{x:e.cx,y:e.cy}))return!0;const n=t.edges.length;for(let i=0;i<n;i++){if(ga(e,B(t.edges[i])))return!0}return!1}function va(e,t){if(ha(e)||!Ma(e.boundingRect(),t))return!1;const{x:n,y:i}=t,r=e.vertices;let o,s,a,l,c;for(o=!1,l=-1,s=r.length,a=s-1;++l<s;a=l){if(r[l].x===n&&r[l].y===i)return!0;if(r[l].y===r[a].y&&r[l].y===i&&(n-r[l].x)*(n-r[a].x)<=0)return!0;if(r[l].y<i&&i<=r[a].y||r[a].y<i&&i<=r[l].y){if(c=(r[a].x-r[l].x)*(i-r[l].y)/(r[a].y-r[l].y)+r[l].x,n===c)return!0;n<c&&(o=!o)}}return o}function ba(e,t){if(ha(e))return!1;for(let n=0,i=e.edges.length;n<i;n++){if(Sa(t,B(e.edges[n])))return!0}const[n,i]=z(t);return va(e,n)||va(e,i)}function xa(e,t){if(ha(e))return!1;for(let n=0,i=e.edges.length;n<i;n++){if(Da(t,B(e.edges[n])))return!0}const[n,i,r,o]=j(t);return va(e,n)||va(e,i)||va(e,r)||va(e,o)}function wa(e,t){return!ca(e)&&!ca(t)&&(e.x<=t.x+t.width&&t.x<=e.x+e.width&&e.y<=t.y+t.height&&t.y<=e.y+e.height)}function qa(e,t){if(ca(e)||ca(t))return!1;return[{x:t.x,y:t.y},{x:t.x+t.width,y:t.y},{x:t.x+t.width,y:t.y+t.height},{x:t.x,y:t.y+t.height}].every((t=>Ma(e,t)))}function Ma(e,t){return!ca(e)&&(t.x>=e.x&&t.x<=e.x+e.width&&t.y>=e.y&&t.y<=e.y+e.height)}function Da(e,t){if(la(t)||ca(e))return!1;const[n,i]=z(t);if(Ma(e,n)||Ma(e,i))return!0;const r=j(e);let o=r.length;for(let e=0;e<o;e++){if(Sa(B([r[e],r[3!==e?e+1:0]]),t))return!0}return!1}function Sa(e,t){const[n,i]=z(e),[r,o]=z(t),s=Bs(i,n),a=Vs(i,n),l=Bs(o,r),c=Vs(o,r),u=Bs(n,r),h=Vs(n,r);let d=c*s-l*a;const f=l*h-c*u,p=s*h-a*u;let m,g;if(0===s&&0===a)return!1;if(0===l&&0===c)return!1;if(0===d){if(0===f&&0===p){if(0===s){if(0===a)return n.x===i.x&&n.y===i.y;m=Vs(r,n)/a,g=Vs(o,n)/a}else m=(r.x-n.x)/s,g=(o.x-n.x)/s;return!(m<0&&g<0||m>1&&g>1)}return!1}const y=f/d;return d=p/d,y>=0&&y<=1&&d>=0&&d<=1}function _a(e,t){if(la(e))return!1;const[n,i]=z(e);return sa(n,i,t)}function Ca(e,t){const n=e.boundingRect(),i=t.boundingRect();return!!wa(n,i)&&(qa(n,i)?da(e,t):da(t,e))}function ka(e,t){const n=e.boundingRect(),i=t.boundingRect();return!!wa(n,i)&&(qa(i,n)?function(e,t){let n=!1;const{numPolygons:i,polygons:r}=e;for(let e=0;e<i;e++)if(n=Ca(t,r[e]),!0===n)return!0;return!1}(e,t):function(e,t){let n=!1;for(let i=0,r=t.edges.length;i<r;i++)if(n=Ta(e,B(t.edges[i])),!0===n)return!0;return!1}(e,t))}function Ea(e,t){if(ua(e))return!1;if(Aa(t,{x:e.cx,y:e.cy}))return!0;const{numPolygons:n,polygons:i}=t;for(let t=0;t<n;t++){const n=i[t],r=n.edges.length;for(let t=0;t<r;t++){if(ga(e,B(n.edges[t])))return!0}}return!1}function Aa(e,t){if(!Ma(e.boundingRect(),t))return!1;const{x:n,y:i}=t,r=e.numPolygons;let o,s,a,l,c,u,h=!1;for(s=0;s<r;s++)for(o=e.vertices[s],c=-1,a=o.length,l=a-1;++c<a;l=c){if(o[c].x===n&&o[c].y===i)return!0;if(o[c].y===o[l].y&&o[c].y===i&&(n-o[c].x)*(n-o[l].x)<=0)return!0;if(o[c].y<i&&i<=o[l].y||o[l].y<i&&i<=o[c].y){if(u=(o[l].x-o[c].x)*(i-o[c].y)/(o[l].y-o[c].y)+o[c].x,n===u)return!0;n<u&&(h=!h)}}return h}function Ta(e,t){const[n,i]=z(t);if(Aa(e,n)||Aa(e,i))return!0;const{numPolygons:r,polygons:o}=e;for(let e=0;e<r;e++){const n=o[e];for(let e=0,i=n.edges.length;e<i;e++){if(Sa(t,B(n.edges[e])))return!0}}return!1}function Ia(e,t){const[n,i,r,o]=j(t);if(Aa(e,n)||Aa(e,i)||Aa(e,r)||Aa(e,o))return!0;const{numPolygons:s,polygons:a}=e;for(let e=0;e<s;e++){const n=a[e];for(let e=0,i=n.edges.length;e<i;e++){if(Da(t,B(n.edges[e])))return!0}}return!1}const Ra=/^\$/,Na="@extend";function Oa(e){throw new Error('Cyclical reference for "'.concat(e,'"'))}function Pa(e,t,n){if("string"==typeof e){let i=t[e];return-1!==n.indexOf(e)&&Oa(e),Ra.test(i)?(n.push(e),Pa(i,t,n)):i}let i=e;const r=A(!0,{},t,e),o={};if(e[Na]){const o=e[Na];-1!==n.indexOf(o)&&Oa(o);let s=n.slice();s.push(o),i=A(!0,{},Pa(r[o],t,s),e)}return Object.keys(i).forEach((e=>{let t=n.slice();if(e===Na||Ra.test(e))return;o[e]=i[e];let s=o[e];Ra.test(s)&&s in r?(-1!==n.indexOf(s)&&Oa(s),t.push(s),s=r[s],"object"==typeof s||Ra.test(s)&&s in r?o[e]=Pa(s,r,t):o[e]=s):"object"==typeof s&&(o[e]=Pa(s,r,t))})),o}function La(e,t){return Pa(e,t,[])}function Fa(e){e.x=Math.floor(e.x),e.y=Math.floor(e.y),e.width=Math.floor(e.width),e.height=Math.floor(e.height)}function za(e,t){const n={x:0,y:0,width:0,height:0},i={x:0,y:0,width:0,height:0};return n.width=e.width||0,n.height=e.height||0,void 0!==t.size&&(n.width=isNaN(t.size.width)?n.width:t.size.width,n.height=isNaN(t.size.height)?n.height:t.size.height),void 0!==t.logicalSize?(i.width=isNaN(t.logicalSize.width)?n.width:t.logicalSize.width,i.height=isNaN(t.logicalSize.height)?n.height:t.logicalSize.height,i.align=isNaN(t.logicalSize.align)?.5:Math.min(Math.max(t.logicalSize.align,0),1),i.preserveAspectRatio=t.logicalSize.preserveAspectRatio):(i.width=n.width,i.height=n.height,i.preserveAspectRatio=!1),Fa(i),Fa(n),{logicalContainerRect:i,containerRect:n}}function ja(e){const t={center:{minWidthRatio:.5,minHeightRatio:.5,minWidth:0,minHeight:0}};return A(!0,t,e),t.center.minWidthRatio=Math.min(Math.max(t.center.minWidthRatio,0),1),t.center.minHeightRatio=Math.min(Math.max(t.center.minHeightRatio,0),1),t.center.minWidth=Math.max(t.center.minWidth,0),t.center.minHeight=Math.max(t.center.minHeight,0),t}function Ha(e,t,n,i,r){return{x:isNaN(e)?0:e,y:isNaN(e)?0:t,width:isNaN(e)?0:n,height:isNaN(e)?0:i,margin:isNaN(r)?0:r}}function Ba(e,t,n){if(void 0===e.cachedSize){const i=e.config.dock();let r,o=e.comp.preferredSize({inner:t,outer:n,dock:i});isNaN(o)?o&&!isNaN(o.size)&&(o.width=o.size,o.height=o.size):o={width:o,height:o},r="top"===i||"bottom"===i?o.height:"right"===i||"left"===i?o.width:Math.max(o.width,o.height),e.cachedSize=Math.ceil(r),e.edgeBleed=o.edgeBleed||0}return e.cachedSize}function Va(e,t){switch(t.config.dock()){case"top":e.y+=t.cachedSize,e.height-=t.cachedSize;break;case"bottom":e.height-=t.cachedSize;break;case"left":e.x+=t.cachedSize,e.width-=t.cachedSize;break;case"right":e.width-=t.cachedSize}}function $a(e,t){const n=t.edgeBleed;n&&(e.left=Math.max(e.left,n.left||0),e.right=Math.max(e.right,n.right||0),e.top=Math.max(e.top,n.top||0),e.bottom=Math.max(e.bottom,n.bottom||0))}function Wa(e,t,n){t.x<n.left&&(t.width-=n.left-t.x,t.x=n.left);const i=e.width-(t.x+t.width);i<n.right&&(t.width-=n.right-i),t.y<n.top&&(t.height-=n.top-t.y,t.y=n.top);const r=e.height-(t.y+t.height);r<n.bottom&&(t.height-=n.bottom-r)}function Ua(e,t,n,i,r){const o=A({},t),s=A({},n);Va(o,i),$a(s,i),Wa(e,o,s);const a=function(e,t,n){const i=Math.min(n.center.minWidth,e.width)||Math.max(e.width*n.center.minWidthRatio,1),r=Math.min(n.center.minHeight,e.height)||Math.max(e.height*n.center.minHeightRatio,1);return t.width>=i&&t.height>=r}(e,o,r);return!!a&&(Va(t,i),$a(n,i),!0)}function Ya(e){let{layoutRect:t,visible:n,hidden:i,settings:r}=e;const o=Ha(t.x,t.y,t.width,t.height),s={left:0,right:0,top:0,bottom:0},a=n.slice();a.sort(((e,t)=>e.config.prioOrder()-t.config.prioOrder()));for(let e=0;e<a.length;++e){const n=a[e];Ba(n,o,t),Ua(t,o,s,n,r)||(i.push(a.splice(e,1)[0]),--e)}!function(e,t){if(0!==t.length)for(let n=0;n<e.length;++n){let i=e[n];if(i.referencedDocks.length){const r=i.referencedDocks.every((e=>t.some((t=>t.key===e))));r&&t.push(e.splice(n,1)[0])}}}(n,i);const l=n.filter((e=>-1!==a.indexOf(e)));return n.length=0,n.push(...l),Wa(t,o,s),o}function Xa(e){return{x:e.margin.left+e.x*e.scaleRatio.x,y:e.margin.top+e.y*e.scaleRatio.y,width:e.width*e.scaleRatio.x,height:e.height*e.scaleRatio.y}}function Ka(e){return H([].concat(...e.map(j)))}function Ga(e){let{visible:t,layoutRect:n,reducedRect:i,containerRect:r,translation:o}=e;const s=Ha(i.x,i.y,i.width,i.height),a=Ha(i.x,i.y,i.width,i.height),l={},c=t.slice(),u=c.slice().sort(((e,t)=>e.config.displayOrder()-t.config.displayOrder()));return t.sort(((e,t)=>{if(e.referencedDocks.length>0&&t.referencedDocks.length>0)return 0;if(t.referencedDocks.length>0)return-1;if(e.referencedDocks.length>0)return 1;const n=e.config.displayOrder()-t.config.displayOrder();return 0===n?c.indexOf(e)-c.indexOf(t):n})).forEach((e=>{let t={},c={};switch(e.config.dock()){case"top":t.height=c.height=e.cachedSize,t.width=n.width,c.width=s.width,t.x=n.x,c.x=s.x,t.y=c.y=s.y-e.cachedSize,s.y-=e.cachedSize,s.height+=e.cachedSize;break;case"bottom":t.x=n.x,c.x=s.x,t.y=c.y=s.y+s.height,t.width=n.width,c.width=s.width,t.height=c.height=e.cachedSize,s.height+=e.cachedSize;break;case"left":t.x=c.x=a.x-e.cachedSize,t.y=n.y,c.y=a.y,t.width=c.width=e.cachedSize,t.height=n.height,c.height=a.height,a.x-=e.cachedSize,a.width+=e.cachedSize;break;case"right":t.x=c.x=a.x+a.width,t.y=n.y,c.y=a.y,t.width=c.width=e.cachedSize,t.height=n.height,c.height=a.height,a.width+=e.cachedSize;break;case"center":t.x=c.x=i.x,t.y=c.y=i.y,t.width=c.width=i.width,t.height=c.height=i.height;break;default:if(e.referencedDocks.length>0){const n=e.referencedDocks.map((e=>l[e])).filter((e=>!!e));n.length>0&&(t=Ka(n.map((e=>e.outerRect))),c=Ka(n.map((e=>e.r))))}}e.key&&(l[e.key]={r:c,outerRect:t}),function(e,t,n,i){const r={x:i.width/n.width,y:i.height/n.height},o={left:0,top:0};if(n.preserveAspectRatio){const e=r.x<r.y,t=Math.min(r.x,r.y);r.x=t,r.y=t;const s=e?"height":"width",a=(i[s]-n[s]*r.x)*n.align;o.left=e?0:a,o.top=e?a:0}e.scaleRatio=r,e.margin=o,t.scaleRatio=r,t.margin=o,n.scaleRatio=r,n.margin=o}(c,t,n,r),c.edgeBleed=e.edgeBleed,c.computed=Xa(c),t.edgeBleed=e.edgeBleed,t.computed=Xa(t),c.x+=o.x,c.y+=o.y,t.x+=o.x,t.y+=o.y,e.comp.resize(c,t),e.cachedSize=void 0,e.edgeBleed=void 0})),u}function Ja(e,t,n){const i=e.layoutModes||{},r=t.minimumLayoutMode();let o=t.show();return o&&"object"==typeof r?o=i[r.width]&&i[r.height]&&n.width>=i[r.width].width&&n.height>=i[r.height].height:o&&void 0!==r&&(o=i[r]&&n.width>=i[r].width&&n.height>=i[r].height),o}function Za(e){if(!e.resize||"function"!=typeof e.resize)throw new Error("Component is missing resize function");if(!e.dockConfig&&!e.preferredSize)throw new Error("Component is missing preferredSize function")}function Qa(e,t,n){const i=[],r=[];for(let o=0;o<e.length;++o){const s=e[o];Za(s);let a=s.dockConfig;const l=s.key,c=a.dock(),u=/@/.test(c)?c.split(",").map((e=>e.replace(/^\s*@/,""))):[];Ja(t,a,n)?i.push({comp:s,key:l,config:a,referencedDocks:u}):r.push({comp:s,key:l,config:a,referencedDocks:u})}return[i,r]}const el=(e,t)=>{for(let n=0;n<e.length;n++){const i=e[n];if(i.hasKey&&i.key===t)return e[n]}return null},tl=e=>null==e?void 0:e.map((e=>{const t=e.instance.dockConfig();return{preferredSize:n=>t.computePreferredSize(R(R({},n),{},{children:tl(e.children)}))}})),nl=(e,t)=>({visible:[],hidden:t,ordered:[]}),il=e=>(t,n)=>{var i;const r=n.map(((e,t)=>{const n=e.instance.dockConfig();return{index:t,key:e.key,dockConfig:n,resize:e.instance.resize,preferredSize:t=>n.computePreferredSize(R(R({},t),{},{children:tl(e.children)}))}})),o=e=>n[e.index],{visible:s=r,hidden:a=[],ordered:l=s}=null!==(i=e(t,r))&&void 0!==i?i:{};return{visible:s.map(o),hidden:a.map(o),ordered:l.map(o)}},rl=e=>{const t=function(e){let t=ja(e);const n={layout:function(e){let n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];if(!e||isNaN(e.x)||isNaN(e.y)||isNaN(e.width)||isNaN(e.height))throw new Error("Invalid rect");if(!n.length)return{visible:[],hidden:[],ordered:[]};const{logicalContainerRect:i,containerRect:r}=za(e,t),[o,s]=Qa(n,t,i),a=Ga({visible:o,layoutRect:i,reducedRect:Ya({layoutRect:i,visible:o,hidden:s,settings:t}),containerRect:r,translation:{x:e.x,y:e.y}});return s.forEach((e=>{e.comp.visible=!1;const t=Ha();e.comp.resize(t,t)})),{visible:o.map((e=>e.comp)),hidden:s.map((e=>e.comp)),ordered:a.map((e=>e.comp))}},settings:function(e){t=ja(e)}};return n}(e);return il(((e,n)=>t.layout(e,n)))},ol=e=>"function"==typeof e?il(e):rl(e);function sl(e,t,n){const i=t.left-n.left,r=t.top-n.top,o=V(e),s=A(!0,{},e);switch(o){case"circle":s.cx+=i,s.cy+=r;break;case"polygon":for(let e=0,t=s.vertices.length;e<t;e++){const t=s.vertices[e];t.x+=i,t.y+=r}break;case"geopolygon":for(let e=0;e<s.vertices.length;e++){const t=s.vertices[e];for(let e=0,n=t.length;e<n;e++){const n=t[e];n.x+=i,n.y+=r}}break;case"line":s.x1+=i,s.y1+=r,s.x2+=i,s.y2+=r;break;case"point":case"rect":s.x+=i,s.y+=r}return s}function al(e,t){const n=[];let i=0;t.forEach((e=>{n.push(i),i++;const t=e.instance.def.additionalElements&&e.instance.def.additionalElements();t&&(i+=t.length)})),t.forEach(((t,i)=>((e,t,n)=>{const i=t.instance.renderer().element();if(isNaN(n)||!i||!e||!e.children)return;const r=e.children[Math.max(0,n)];if(i===r)return;const o=t.instance.def.additionalElements&&t.instance.def.additionalElements().filter(Boolean);e.insertBefore&&void 0!==r?(e.insertBefore(i,r),o&&o.forEach((t=>{e.insertBefore(t,i)}))):(o&&o.forEach((t=>{e.appendChild(t,i)})),e.appendChild(i))})(e,t,n[i])))}function ll(e,t){let{element:n,data:i=[],settings:r={},on:o={}}=e;const s=t.registries,a=t.logger,l=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],n={},i=e;const r=e=>{e.forEach((e=>{const t=Array.isArray(e.colors[0])?e.colors:[e.colors];n[e.key]={colors:t,sizes:t.map((e=>e?e.length:0))}}))},o=(e,t)=>{const i=n[e];if(!i)return[];const r=i.sizes;for(let e=0;e<r.length;e++)if(t<=r[e])return i.colors[e];return i.colors[r.length-1]},s={palette:(e,t)=>o(e,t),setPalettes:r,style:e=>La(e,i),setStyle:t=>{i=A({},e,t)}};return r(t),s}(t.style,t.palettes),c=[],u=A({},e),h=function(){const e={};return $o.mixin(e),e}();let d=[],f=null,p=null,m=null,g=[],y=()=>{},v=()=>{};const b={};let x=!1;const w=function(e){let{createComponent:t}=e;const n={};let i=[],r=[];const o=e=>{const n=t(e);return n&&(i.push(n),e.components&&(n.children=e.components.map((e=>o(e))).filter((e=>!!e)))),n},s=e=>{const t=i.indexOf(e);-1!==t&&i.splice(t,1)},a=(e,t)=>{for(let n=e.length-1;n>=0;n--){const i=e[n],r=t.find((e=>i.hasKey&&i.key===e.key));r?i.children&&r.components&&a(i.children,r.components):(e.splice(n,1),s(i),i.children&&a(i.children,[]),i.instance.destroy())}},l=e=>{let{compList:t,data:n,excludeFromUpdate:i,formatters:r,scales:s,settingsList:a}=e;return a.map((e=>{const a=el(t,e.key);return i.indexOf(e.key)>-1?(delete a.updateWith,a):a?(e.rendererSettings&&"function"==typeof a.instance.renderer().settings&&a.instance.renderer().settings(e.rendererSettings),e.rendererSettings&&"function"==typeof e.rendererSettings.transform&&e.rendererSettings.transform()?(a.applyTransform=!0,a):(a.updateWith={formatters:r,scales:s,data:n,settings:e},e.components&&(a.children=l({compList:a.children||[],data:n,excludeFromUpdate:i,formatters:r,scales:s,settingsList:e.components})),a)):o(e)})).filter((e=>!!e))},c=e=>{let{components:t,hidden:n,layoutFn:i,ordered:r,rect:o,visible:s}=e;const{visible:a,hidden:l,ordered:u}=i(o,t);s.push(...a),n.push(...l),r.push(...u),a.forEach((e=>{if(e.children){var t,i;const o=ol(null!==(t=null===(i=e.settings)||void 0===i?void 0:i.strategy)&&void 0!==t?t:{});c({components:e.children,hidden:n,layoutFn:o,ordered:r,rect:e.instance.getRect(),visible:s})}})),l.forEach((e=>{e.children&&c({components:e.children,hidden:n,layoutFn:nl,ordered:r,rect:null,visible:s})}))};return n.destroy=()=>{i.forEach((e=>e.instance.destroy())),i=[],r=[]},n.findComponentByKey=e=>el(i,e),n.forEach=e=>{i.forEach(e)},n.layout=e=>{let{layoutSettings:t,rect:n}=e;const i=[],o=[],s=[],a=ol(t);return c({components:r,hidden:o,layoutFn:a,ordered:s,rect:n,visible:i}),{visible:i,hidden:o,ordered:s}},n.set=e=>{let{components:t}=e;r=t.map((e=>o(e))).filter((e=>!!e))},n.update=e=>{let{components:t,data:n,excludeFromUpdate:i,formatters:o,scales:s}=e;a(r,t),r=l({compList:r,data:n,excludeFromUpdate:i,formatters:o,scales:s,settingsList:t})},n}({createComponent:e=>{if(!s.component.has(e.type))return a.warn("Unknown component: ".concat(e.type)),!1;const t=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const{defaultSettings:n={},_DO_NOT_USE_getInfo:i=(()=>({}))}=e,{chart:r,container:o,mediator:s,registries:a,theme:l,renderer:c}=t,u=$o.mixin({});let h,d,f,p,m,g=t.settings||{},y=A(!0,{},n,g),v=[],b=Ss({chart:r}),x=!1;const w={nodes:[],chart:r,config:y.brush||{},renderer:null},q={tap:[],over:[]},M=[],D={},S=A({},g);function _(t){let n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:()=>{},i=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return function(){const r=void 0!==e[t],o=void 0!==g[t];let s;for(var a=arguments.length,l=new Array(a),c=0;c<a;c++)l[c]=arguments[c];return r&&("function"==typeof e[t]?s=e[t].call(D,...l):i&&(s=e[t])),o&&("function"==typeof g[t]?s=g[t].call(S,...l):i&&(s=g[t])),r||o||(s=n.call(D,...l)),s}}const C=_("preferredSize",(()=>0),!0),k=_("resize",(e=>{let{inner:t}=e;return t})),E=_("created"),T=_("beforeMount"),I=_("mounted"),N=_("beforeUnmount"),O=_("beforeUpdate"),P=_("updated"),L=_("beforeRender"),F=_("beforeDestroy"),z=_("destroyed"),j=e.render,H=()=>{y.brush&&(y.brush.consume||[]).forEach((e=>{e.context&&e.style&&M.push(Cs(w,e))}))},B=()=>{y.brush&&(y.brush.trigger||[]).forEach((e=>{"over"===e.on?q.over.push(e):q.tap.push(e)}))};Object.defineProperty(w,"data",{get:()=>v});const V=y.renderer||e.renderer,$=V?c||a.renderer(V)():c||a.renderer()();"function"==typeof $.settings&&$.settings(y.rendererSettings),w.renderer=$;const W={resources:r.logger?{logger:r.logger()}:{}};let U=Qs(ta(y,C,r.logger()),W);const Y=e=>{e.key=y.key,e.element=$.element()},X=()=>{};X.dockConfig=()=>U,X.set=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(e.settings&&(g=e.settings,y=A(!0,{},n,e.settings),U=Qs(ta(y,C,r.logger()),W),w.config=y.brush||{}),y.scale&&(h=r.scale(y.scale)),y.data){const{rendererSettings:e}=y,t="function"==typeof(null==e?void 0:e.progressive)&&e.progressive(),n=zi(y.data,{dataset:r.dataset,collection:r.dataCollection},{logger:r.logger()},r.dataCollection);t?t.isFirst?(v=n,v.items&&(v.items=[...n.items])):v.items&&(v.items=[...v.items,...n.items||[]]):v=n}else v=h?h.data():[];"string"==typeof y.formatter||"object"==typeof y.formatter?d=r.formatter(y.formatter):h&&h.data().fields&&(d=h.data().fields[0].formatter()),m=l.style(y.style||{})},X.resize=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const n=k({inner:e,outer:t});p=n?$.size(n):$.size(e),S.rect=A(!0,{computedPhysical:p.computedPhysical,computedOuter:t.computed||t,computedInner:e.computed||e},e),p=A(!0,{computedOuter:t.computed||t,computedInner:e.computed||e},p)},X.getRect=()=>S.rect;const K=()=>{const e=$.renderArgs?$.renderArgs.slice(0):[],{rendererSettings:t}=y;let n=v;const i="function"==typeof(null==t?void 0:t.progressive)&&t.progressive();return v.items&&i&&(n=R(R({},v),{},{items:v.items.slice(i.start,i.end)})),e.push({data:n}),e};let G,J,Z;function Q(e){const{rendererSettings:t}=y,n="function"==typeof(null==t?void 0:t.progressive)&&t.progressive();n?n.isFirst?w.nodes=[...e||[]]:w.nodes&&(w.nodes=[...w.nodes,...e||[]]):w.nodes=e}X.beforeMount=T,X.beforeRender=()=>{L({size:p})},X.render=()=>{const e=j.call(D,...K());Q(e),$.render(e),G=e,J=S.rect.computed},X.hide=()=>{X.unmount(),$.size({x:0,y:0,width:0,height:0}),$.clear()},X.beforeUpdate=()=>{O({settings:y,data:v})},X.update=()=>{Z&&Z.stop();const{rendererSettings:e,brush:t,animations:n}=y;if("function"==typeof(null==e?void 0:e.transform)&&e.transform())return $.render(),void(G=null);const i=j.call(D,...K());Q(i),M.forEach((e=>e.cleanUp())),M.length=0,q.tap=[],q.over=[],t&&(H(),B()),M.forEach((e=>{e.isActive()&&e.update()})),G&&n&&("function"==typeof n.enabled?n.enabled():n.enabled)?(n.compensateForLayoutChanges&&n.compensateForLayoutChanges({currentNodes:G,currentRect:S.rect.computed,previousRect:J}),Z=vs({old:G,current:i},{renderer:$},n,r.storage),Z.start()):$.render(i),G=i,J=S.rect.computed,$.setKey&&"string"==typeof g.key&&$.setKey(g.key)},X.updated=P,X.destroy=()=>{X.unmount(),F(f),$.destroy(),z(),f=null};const ee=e=>{w.nodes=e,M.forEach((e=>{e.isActive()&&e.update()})),$.render(e)};return ea(D,e,{settings:()=>y,data:()=>v,scale:()=>h,formatter:()=>d,renderer:()=>$,chart:()=>r,dockConfig:()=>U,mediator:()=>s,instance:()=>S,rect:()=>S.rect,style:()=>m,update:()=>ee,registries:()=>a,resolver:()=>b,symbol:()=>Zs(a.symbol)}),ea(S,g,{settings:()=>y,data:()=>v,scale:()=>h,formatter:()=>d,renderer:()=>$,chart:()=>r,dockConfig:()=>U,mediator:()=>s,style:()=>m,_DO_NOT_USE_getInfo:i.bind(D),isVisible:()=>x}),X.getBrushedShapes=function(e,t,n){const i=[];if(y.brush&&y.brush.consume){const o=r.brush(e),s=$.findShapes("*");y.brush.consume.filter((t=>t.context===e)).forEach((e=>{for(let r=0;r<s.length;r++){const a=s[r];a.data&&o.containsMappedData(a.data,n||e.data,t)&&(Y(a),i.push(a),s.splice(r,1),r--)}}))}return i},X.findShapes=e=>{var t;const n=(null!==(t=Z)&&void 0!==t&&t.inProgress()?Z.targetScene:$).findShapes(e);for(let e=0,t=n.length;e<t;e++)Y(n[e]);return n},X.shapesAt=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const n=$.itemsAt(e);let i;i=t&&"stop"===t.propagation&&n.length>0?[n.pop().node]:n.map((e=>e.node));for(let e=0,t=i.length;e<t;e++)Y(i[e]);return i},X.brushFromShapes=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};t.contexts=Array.isArray(t.contexts)?t.contexts:[];ks({nodes:e,action:t.action||"toggle",trigger:t,chart:r,data:w.data})},X.mount=()=>{f=$.element&&$.element()?f:$.appendTo(o),$.setKey&&"string"==typeof g.key&&$.setKey(g.key),y.brush&&(H(),B()),na(S,u,g),na(D,u,e),x=!0},X.mounted=()=>I(f),X.unmount=()=>{[S,D].forEach((e=>{ia(e,u)})),q.tap=[],q.over=[],M.forEach((e=>{e.cleanUp()})),M.length=0,N(),x=!1},X.onBrushTap=e=>{q.tap.forEach((t=>{Is({e:e,t:t,config:w})&&"stop"===t.globalPropagation&&r.toggleBrushing(!0)}))},X.onBrushOver=e=>{q.over.forEach((t=>{Rs({e:e,t:t,config:w})&&"stop"===t.globalPropagation&&r.toggleBrushing(!0)}))},X.def=D,X.ctx=S,X.renderer=()=>$,X.set({settings:g}),E(),X}(s.component(e.type),{settings:e,chart:u,mediator:h,registries:s,theme:l,container:n});return{instance:t,settings:A(!0,{},e),key:e.key,hasKey:void 0!==e.key}}});function q(t){let n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:()=>{};return function(){const i="function"==typeof e[t];let r;for(var o=arguments.length,s=new Array(o),a=0;a<o;a++)s[a]=arguments[a];return r=i?e[t].call(u,...s):n.call(u,...s),r}}const M=()=>{let e;r.dockLayout?(a.warn('Deprecation Warning: "dockLayout" property should be renamed to "strategy"'),e=r.dockLayout):e=r.strategy;const t=function(e){if("function"==typeof e.getBoundingClientRect){const{width:t,height:n}=e.getBoundingClientRect();return{x:0,y:0,width:t,height:n}}return{x:0,y:0,width:0,height:0}}(n);return w.layout({layoutSettings:e,rect:t})},D=q("created"),S=q("beforeMount"),_=q("mounted"),C=q("beforeUpdate"),k=q("updated"),E=q("beforeRender"),T=q("beforeDestroy"),I=q("destroyed"),N=function(e,t){let{partialData:n}=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const{formatters:i={},scales:r={},scroll:o={}}=t;y=W(e,{logger:a,types:s.data}),n||Object.keys(b).forEach((e=>b[e].clear())),t.palettes&&l.setPalettes(t.palettes),t.style&&l.setStyle(t.style),v=ji(t.collections,{dataset:y},{logger:a});const c={theme:l,logger:a};f=jo(r,{dataset:y,collection:v},R(R({},c),{},{scale:s.scale})),p=Bi(i,{dataset:y,collection:v},R(R({},c),{},{formatter:s.formatter})),m=Yo(o,m)};function P(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];const t={},i=e.filter((e=>!!e.key)).map((e=>e.key));g.forEach((e=>{e.key&&-1!==i.indexOf(e.key)?t[e.key]=e:e.destroy()})),g=e.map((e=>{const i=e.key&&t[e.key]?t[e.key]:s.interaction(e.type)(u,h,n);return i.set(e),i}))}const L=e=>{const t=n.getBoundingClientRect(),i="clientX"in e?e.clientX:e.x,r="clientY"in e?e.clientY:e.y,o={x:i-t.left,y:r-t.top},s=[];return d.forEach((e=>{const t=e.instance.getRect();Ma(t.computedPhysical?t.computedPhysical:{x:t.margin.left+t.x*t.scaleRatio.x,y:t.margin.top+t.y*t.scaleRatio.y,width:t.width*t.scaleRatio.x,height:t.height*t.scaleRatio.y},o)&&s.push(e)})),s},F=()=>{if(c.length||!n)return;Object.keys(o).forEach((e=>{const t=o[e].bind(u);n.addEventListener(e,t),c.push({key:e,listener:t})}));const e={},t=t=>{t.touches?(e.x=t.touches[0].clientX,e.y=t.touches[0].clientY,e.multiTouch=t.touches.length>1):(e.x=t.clientX,e.y=t.clientY,e.multiTouch=!1),e.time=Date.now(),e.comps=L(e)},i=t=>{const n=e.comps||L(t);if(!n.every((e=>e.instance.def.disableTriggers))&&("touchend"===t.type&&t.preventDefault(),function(e,t){const n=O(e),i=n?e.changedTouches[0]:e,r=Date.now()-t.time,o=isNaN(t.x)?0:Math.abs(i.clientX-t.x),s=isNaN(t.y)?0:Math.abs(i.clientY-t.y);return(0===e.button||n)&&!t.multiTouch&&o<=12&&s<=12&&r<=300}(t,e)))for(let e=n.length-1;e>=0;e--){if(n[e].instance.onBrushTap(t),x){x=!1;break}}},r=[];r.push({key:"mousedown",listener:t}),r.push({key:"mouseup",listener:i}),function(e){return"ontouchstart"in e&&"ontouchend"in e||navigator.maxTouchPoints>1}(n)&&(r.push({key:"touchstart",listener:t}),r.push({key:"touchend",listener:i})),r.push({key:"mousemove",listener:e=>{const t=L(e);for(let n=t.length-1;n>=0;n--){if(t[n].instance.onBrushOver(e),x){x=!1;break}}}}),r.forEach((e=>{n.addEventListener(e.key,e.listener),c.push(e)}))},z=()=>{c.forEach((e=>{let{key:t,listener:i}=e;return n.removeEventListener(t,i)})),c.length=0},j=()=>{n.innerHTML="",(()=>{const{components:e=[]}=r;E(),N(i,r),w.set({components:e});const{visible:t,hidden:o,ordered:s}=M();d=t,o.forEach((e=>{e.instance.hide(),e.visible=!1})),t.forEach((e=>e.instance.beforeMount())),t.forEach((e=>e.instance.mount())),t.forEach((e=>e.instance.beforeRender())),t.forEach((e=>e.instance.render())),t.forEach((e=>e.instance.mounted())),t.forEach((e=>{e.visible=!0})),al(n,s)})(),F(),P(r.interactions)};return u.layoutComponents=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const{excludeFromUpdate:t=[]}=e;e.data&&(i=e.data),e.settings&&(r=e.settings,P(e.settings.interactions)),C(),N(i,r);const{formatters:n,scales:o,components:s=[]}=r;w.update({components:s,data:i,excludeFromUpdate:t,formatters:n,scales:o}),w.forEach((e=>{e.updateWith&&e.instance.set(e.updateWith)})),w.forEach((e=>{e.updateWith&&e.instance.beforeUpdate()})),M()},u.update=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const{partialData:t,excludeFromUpdate:o=[]}=e;let s;e.data&&(i=e.data),e.settings&&(r=e.settings,P(e.settings.interactions)),C(),N(i,r,{partialData:t});const{formatters:a,scales:l,components:c=[]}=r;w.update({components:c,data:i,excludeFromUpdate:o,formatters:a,scales:l}),w.forEach((e=>{e.updateWith&&e.instance.set(e.updateWith)})),w.forEach((e=>{e.updateWith&&e.instance.beforeUpdate()}));const u=[],h=[];let f;if(t)w.forEach((e=>{(e.updateWith||e.applyTransform)&&e.visible&&u.push(e)})),f=u;else{const{visible:e,hidden:t,ordered:n}=M();d=e,f=e,s=n,e.forEach((e=>{e.updateWith&&e.visible?u.push(e):h.push(e)})),t.forEach((e=>{e.instance.hide(),e.visible=!1,delete e.updateWith,e.applyTransform=!1}))}h.forEach((e=>e.instance.beforeMount())),h.forEach((e=>e.instance.mount())),f.forEach((e=>e.instance.beforeRender())),f.forEach((e=>{(e.updateWith||e.applyTransform)&&e.visible?e.instance.update():e.instance.render()})),t||al(n,s),h.forEach((e=>e.instance.mounted())),u.forEach((e=>e.instance.updated())),d.forEach((e=>{delete e.updateWith,e.visible=!0,e.applyTransform=!1})),k()},u.destroy=()=>{T(),w.destroy(),z(),P(),delete u.update,delete u.destroy,I()},u.getAffectedShapes=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"and",n=arguments.length>2?arguments[2]:void 0,i=arguments.length>3?arguments[3]:void 0,r=[];return d.filter((e=>null==i||e.key===i)).forEach((i=>{const o=i.instance.getBrushedShapes(e,t,n);r=[...r,...o]})),r},u.findShapes=e=>{let t=[];return d.forEach((n=>{const i=n.instance.findShapes(e);t=[...t,...i]})),t},u.componentsFromPoint=e=>L(e).map((e=>e.instance.ctx)),u.shapesAt=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=[];const r=n.getBoundingClientRect();let o=d;if(Array.isArray(t.components)&&t.components.length>0){const e=t.components.map((e=>e.key));o=d.filter((t=>-1!==e.indexOf(t.key))).map((n=>({instance:n.instance,opts:t.components[e.indexOf(n.key)]})))}for(let n=o.length-1;n>=0;n--){const s=o[n],a=sl(e,r,s.instance.renderer().element().getBoundingClientRect()),l=s.instance.shapesAt(a,s.opts),c=l.length>0&&"stop"===t.propagation;if(i=[...i,...l],i.length>0&&c)return i}return i},u.brushFromShapes=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{components:[]};for(let n=0;n<t.components.length;n++){const i=t.components[n].key;d.filter((e=>i===e.key)).forEach((i=>{let r=e.filter((e=>e.key===i.key));i.instance.brushFromShapes(r,t.components[n])}))}},u.scroll=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"default";return Xo(e,m)},u.dataset=e=>y(e),u.dataCollection=e=>v(e),u.scales=function(){return f.all()},u.formatters=function(){return p.all()},u.brush=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"default";return b[e]||(b[e]=fs()),b[e]},u.scale=function(e){return f.get(e)},u.formatter=function(e){return p.get(e)},u.toggleBrushing=function(e){x=void 0!==e?e:!x},u.component=e=>{const t=w.findComponentByKey(e);return null==t?void 0:t.instance.ctx},u.logger=()=>a,u.theme=()=>l,u.storage=ra({animations:{updatingStageMeta:{isInit:!1,shouldBeRemoved:!1}}}),Object.defineProperty(u,"interactions",{get:()=>({instances:g,on(){F(),g.forEach((e=>e.on()))},off(){z(),g.forEach((e=>e.off()))}})}),D(),n&&(S(),j(),_(n),u.element=n),u}const cl=e=>{let t=Ge(e);return t.prio=e=>e?t.default(e[0]):[t.default()],t.types=()=>t.getKeys(),t};var ul=Ge();function hl(e,t,n){let{key:i}=n;const r={value:"function"==typeof e.value?e.value(t):void 0!==e.value?e.value:t};return r.label="function"==typeof e.label?e.label(t):void 0!==e.label?String(e.label):String(r.value),e.field&&(r.source={key:i,field:e.field.key()}),r}function dl(e,t){const n=Array.isArray(e)?e:[e];let i=[];return n.forEach((e=>{if(void 0!==e.field){const n=t.field(e.field),r=t.key();if(!n)throw Error("Field '".concat(e.field,"' not found"));const{props:o,main:s}=Ai(e,t),a=Object.keys(o),l=!!e.trackBy,c=typeof e.trackBy,u={},h=[],d=n.items(),f=[];for(let t=0;t<d.length;t++){const n=d[t];if(s.filter&&!s.filter(n))continue;const i=hl(s,n,{key:r});a.forEach((e=>{const s=o[e];let a=s.field?s.field.items()[t]:n;i[e]=hl(s,a,{key:r})})),l&&Ri({cfg:e,itemData:n,obj:i,target:h,tracker:u,trackType:c}),f.push(i)}i=l?[...i,...Ii(h,{main:s,propsArr:a,props:o})]:[...i,...f]}})),i}const fl=e=>e.filter((e=>"number"==typeof e&&!isNaN(e)));const pl=e=>{let{key:t,data:n,cache:i,config:r}=e;if(!n)return;let o=n;"string"==typeof o&&(o=(e=>{let{data:t,config:n}=e;const i=t.split("\n"),r=i[0],o=i[1];let s=",";if(n&&n.parse&&n.parse.delimiter)s=n.parse.delimiter;else if(r){const e=[/,/,/\t/,/;/];for(let t=0;t<e.length;t++){const n=e[t];if(r&&o){if(n.test(r)&&n.test(o)&&r.split(n).length===o.split(n).length){s=n;break}}else n.test(r)&&(s=n)}}return i.map((e=>e.split(s)))})({data:n,config:r})),Array.isArray(o)&&function(e){let t,{source:n,data:i,cache:r,config:o}=e,s=i;const a=o&&o.parse;Array.isArray(i[0])?a&&!1===a.headers?t=i[0].map(((e,t)=>t)):(t=i[0],s=i.slice(1)):t=Object.keys(i[0]);const l=!!a&&"function"==typeof a.row&&a.row;let c,u=t;u=a&&"function"==typeof a.fields?a.fields(u.slice()):t.map((e=>({key:e,title:e}))),Array.isArray(i[0])?c=u.map((()=>[])):(c={},u.forEach((e=>{c[e.key]=[]})));for(let e=0;e<s.length;e++){const t=l?l(s[e],e,u):s[e];if(t)if(Array.isArray(t))for(let e=0;e<u.length;e++)c[e].push(t[e]);else for(let e=0;e<u.length;e++)c[u[e].key].push(t[u[e].key])}const h=Array.isArray(c)?e=>c[e]:e=>c[u[e].key];for(let e=0;e<u.length;e++){const t=h(e),i=fl(t),o=i.length>0,s=o?"measure":"dimension",a=o?Math.min(...i):NaN,l=o?Math.max(...i):NaN;r.fields.push(Di(A({source:n,key:e,title:u[e].title,values:t,min:a,max:l,type:s},u[e]),{value:u[e].value,label:u[e].label}))}}({data:o,cache:i,source:t,config:r})};function ml(){let{key:e,data:t,config:n}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const i={fields:[]},r={key:()=>e,raw:()=>t,field:e=>Si(e,{cache:i,matrix:t}),fields:()=>i.fields.slice(),extract:e=>dl(e,r),hierarchy:()=>null};return pl({key:e,data:t,config:n,cache:i}),r}ml.util={normalizeConfig:Ai,collect:Ii,track:Ri};const gl=Ge();gl.default("matrix"),gl("matrix",ml),gl("default",ml);const yl=Ge();function vl(e,t,n){return Math.max(e,Math.min(t,n))}function bl(e){let{item:t,value:n,boxCenter:i,rendWidth:r,rendHeight:o,flipXY:s,symbol:a}=e,l="x",c="y",u=r,h=o,d=n<.5?90:-90;return s&&(l="y",c="x",u=o,h=r,d=n<.5?180:0),a(A({},t.oob,{[l]:i*u,[c]:Math.max(t.oob.size/2,Math.min(n*h,h-t.oob.size/2)),startAngle:d}))}function xl(e){let{item:t,boxWidth:n,boxPadding:i,rendWidth:r,rendHeight:o,flipXY:s}=e,a="x",l="y",c="width",u="height",h=r,d=o;s&&(a="y",l="x",c="height",u="width",h=o,d=r);const{actualDiff:f,actualLow:p}=function(e){let{start:t,end:n,minPx:i=.1,maxPx:r=1}=e;const o=Math.max(t,n),s=Math.min(t,n),a=vl(-.1,1.2,o),l=vl(-.1,1.2,s),c=a*r-l*r,u=Math.max(i,c),h=(u-c)/2;return{actualDiff:u,startModifier:h,actualLow:l*r-h}}({start:t.start,end:t.end,minPx:t.box.minHeightPx,maxPx:d});return A({},t.box,{type:"rect",[a]:(i+t.major)*h,[l]:p,[u]:f,[c]:n*h,data:t.data||{},collider:{type:null}})}function wl(e){let{item:t,from:n,to:i,boxCenter:r,rendWidth:o,rendHeight:s,flipXY:a}=e,l="x1",c="y1",u="x2",h="y2",d=o,f=s;return a&&(l="y1",c="x1",u="y2",h="x2",d=s,f=o),A({},t.line,{type:"line",[h]:Math.floor(n*f),[l]:r*d,[c]:Math.floor(i*f),[u]:r*d,data:t.data||{},collider:{type:null}})}function ql(e){let{item:t,key:n,position:i,width:r,boxCenter:o,rendWidth:s,rendHeight:a,flipXY:l}=e,c="x1",u="y1",h="x2",d="y2",f=s,p=a;l&&(c="y1",u="x1",h="y2",d="x2",f=a,p=s);const m=r/2;return A({type:"line"},t[n],{[u]:Math.floor(i*p),[c]:(o-m)*f,[d]:Math.floor(i*p),[h]:(o+m)*f,r:m*f,cx:o*f,cy:i*p,width:r*f,data:t.data||{},collider:{type:null}})}function Ml(e,t,n){const{width:i,maxWidthPx:r,minWidthPx:o}=t.box,s=e>=0?1:-1;let a=Math.min(s*e*i,isNaN(r)?n:r/n);return a=isNaN(o)?a:Math.max(o/n,a),a*s}yl("native",(function(e,t,n){let i,r,o={chart:e,mediator:t,element:n},s=[],a=!0;function l(){"function"==typeof i.enable&&(i.enable=i.enable.bind(o)()),i.enable&&Object.keys(i.events).forEach((e=>{const t=i.events[e].bind(o);n.addEventListener(e,t),s.push({key:e,listener:t})}))}function c(){s.forEach((e=>{let{key:t,listener:i}=e;n.removeEventListener(t,i)})),s=[]}return{get key(){return r},set(e){!function(e){r=e.key,i=e,i.events=i.events||[],void 0===i.enable&&(i.enable=!0)}(e),c(),a&&l()},off(){a=!1,c()},on(){a=!0,0===s.length&&l()},destroy(){c(),o=null,i=null}}}));const Dl={oob:{show:!0,type:"n-polygon",fill:"#999",stroke:"#000",strokeWidth:0,size:10,sides:3,startAngle:-90},box:{show:!0,fill:"#fff",stroke:"#000",strokeWidth:1,strokeLinejoin:"miter",width:1,maxWidthPx:void 0,minWidthPx:1,minHeightPx:1},line:{show:!0,stroke:"#000",strokeWidth:1},median:{show:!0,stroke:"#000",strokeWidth:1},whisker:{show:!0,stroke:"#000",strokeWidth:1,fill:"",type:"line",width:1}},Sl=Object.keys(Dl),_l={require:["chart","resolver","symbol"],defaultSettings:{settings:{},data:{},style:{box:"$shape",line:"$shape-guide",whisker:"$shape-guide",median:"$shape-guide--inverted"}},created(){this.state={}},render(e){let{data:t}=e;const{width:n,height:i}=this.rect,r="horizontal"===this.settings.settings.orientation,{style:o,resolver:s,symbol:a}=this,l=Sl.filter((e=>!this.settings.settings[e]||!1!==this.settings.settings[e].show)),c={};l.forEach((e=>c[e]=Dl[e]));const u=function(e){let{keys:t,data:n,defaultSettings:i,style:r,settings:o,width:s,height:a,resolver:l}=e;const c=A(!0,{},i||{},r||{}),u={major:"horizontal"===o.orientation?a:s,minor:"horizontal"===o.orientation?s:a},h=o.major;let d;d="object"==typeof h&&"object"==typeof h.ref&&void 0!==h.ref.start&&void 0!==h.ref.end?l.resolve({data:n,defaults:{start:0,end:1},scaled:u,settings:A(!0,{},{binStart:{scale:o.major.scale,ref:o.major.ref.start},binEnd:{scale:o.major.scale,ref:o.major.ref.end}})}):"object"==typeof h&&void 0!==h.binStart&&void 0!==h.binEnd?l.resolve({data:n,defaults:{start:0,end:1},scaled:u,settings:A(!0,{},{binStart:{scale:o.major.scale,ref:"binStart"},binEnd:{scale:o.major.scale,ref:"binEnd"}},o.major)}):l.resolve({data:n,scaled:u,defaults:{major:.5},settings:{major:o.major}});const f=o.minor||{},p={};["start","end","min","max","med"].forEach((e=>{(f[e]||n.items&&n.items.length&&n.items[0][e])&&(p[e]={scale:f.scale,ref:e})}));let m,g={major:d,minor:l.resolve({data:n,defaults:{start:0,end:1},scaled:u,settings:A(!0,{},p,f)})};for(let e=0,i=t.length;e<i;e++)o[m]&&!1===o[m].show||(m=t[e],g[m]=l.resolve({data:n,defaults:c[m],settings:o[m],scaled:u}));return g}({keys:l,data:t,defaultSettings:c,style:o,settings:this.settings.settings,width:n,height:i,resolver:s}),{settings:h,items:d}=u,f=function(e){let{width:t,height:n,flipXY:i,resolved:r,keys:o,symbol:s}=e;const a=[],l=r.major.items;if(!l.length)return a;const c=t,u=n,h=i?n:t,d=r.major.settings,f=["start","end","min","max","med"].filter((e=>void 0!==r.minor.settings[e])),p=f.length,m=o.filter((e=>"oob"!==e));let g,y,v,b,x,w,q,M,D;const S=o?o.length:0,_=m?m.length:0,C={box:function(){v.box&&P(v.start)&&P(v.end)&&g.push(xl({item:v,boxWidth:b,boxPadding:x,rendWidth:c,rendHeight:u,flipXY:i}))},line:function(){P(v.min)&&P(v.start)&&g.push(wl({item:v,from:v.min,to:v.start,boxCenter:w,rendWidth:c,rendHeight:u,flipXY:i})),P(v.max)&&P(v.end)&&g.push(wl({item:v,from:v.max,to:v.end,boxCenter:w,rendWidth:c,rendHeight:u,flipXY:i}))},median:function(){v.median&&P(v.med)&&g.push(ql({item:v,key:"median",position:v.med,width:b,boxCenter:w,rendWidth:c,rendHeight:u,flipXY:i}))},whisker:function(){if(v.whisker){const e=b*v.whisker.width;P(v.min)&&g.push(ql({item:v,key:"whisker",position:v.min,width:e,boxCenter:w,rendWidth:c,rendHeight:u,flipXY:i})),P(v.max)&&g.push(ql({item:v,key:"whisker",position:v.max,width:e,boxCenter:w,rendWidth:c,rendHeight:u,flipXY:i}))}}};function k(){let e,t=-Number.MAX_VALUE,n=Number.MAX_VALUE;for(let i=0;i<p;i++)e=v[f[i]],P(e)&&(t<e&&(t=e),n>e&&(n=e));q=t<0&&t!==-Number.MAX_VALUE,M=n>1&&n!==Number.MAX_VALUE,D=q||M}for(let e=0,t=l.length;e<t;e++){g=[],y=null;const t=l[e],n=t.data;let f=null,p=null;void 0!==d.binStart?(f=t.binStart,p=t.binEnd,y=d.binStart.scale):(y=d.major.scale,f=y?t.major:0);let E=0;y?y.bandwidth?(E=y.bandwidth(),f-=E/2):E=p-f:E=1,v=A({},{major:f,majorEnd:p},r.minor.items[e]);for(let t=0;t<S;t++)v[o[t]]=r[o[t]].items[e];if(b=Ml(E,v,h),x=(E-b)/2,w=x+v.major+b/2,k(),D)v.oob&&(q?g.push(bl({item:v,value:0,boxCenter:w,rendWidth:c,rendHeight:u,flipXY:i,symbol:s})):M&&g.push(bl({item:v,value:1,boxCenter:w,rendWidth:c,rendHeight:u,flipXY:i,symbol:s})));else for(let e=0;e<_;e++)v[m[e]]&&!1===v[m[e]].show||C[m[e]]();const T={type:"container",data:n,collider:{type:"bounds"},children:g};a.push(T)}return a}({items:d,settings:h,width:n,height:i,flipXY:r,resolved:u,keys:l,symbol:a});return f}};const Cl={shape:"saltire",width:2,size:.5,fill:"#333",stroke:"#333",strokeWidth:0},kl=/px$/,El={shape:"circle",label:"",fill:"#333",stroke:"#ccc",strokeDasharray:"",strokeWidth:0,strokeLinejoin:"miter",opacity:1,x:.5,y:.5,size:1,show:!0},Al={maxPx:1e4,minPx:1,maxRelExtent:.1,minRelExtent:.01,maxRelDiscrete:1,minRelDiscrete:.1};function Tl(e,t){return e&&"function"==typeof e.bandwidth?{isBandwidth:!0,value:Math.max(1,e.bandwidth()*t)}:{isBandwidth:!1,value:Math.max(1,t)}}function Il(e,t,n,i){let{width:r,height:o}=t;return e.filter((e=>!1!==e.show&&!isNaN(e.x+e.y))).map((e=>{let t=e,s=kl.test(e.size)?parseInt(e.size,10):n.min+t.size*(n.max-n.min);L(s)&&(t=Cl,s=n.min+t.size*(n.max-n.min));const[a,l]=function(e){let t=El.shape,n={};return"object"==typeof e.shape&&"string"==typeof e.shape.type?(t=e.shape.type,n=e.shape):"string"==typeof e.shape&&(t=e.shape),[t,n]}(t),c=R(R({},l),{},{type:a,label:e.label,x:e.x*r,y:e.y*o,fill:t.fill,size:Math.min(n.maxGlobal,Math.max(n.minGlobal,s)),stroke:t.stroke,strokeWidth:t.strokeWidth,strokeDasharray:t.strokeDasharray,opacity:t.opacity});t===e.errorShape&&(c.width=t.width);const u=i(c);return u.data=e.data,u}))}const Rl={require:["chart","resolver","symbol"],defaultSettings:{settings:{},data:{},animations:{enabled:!1,trackBy:e=>e.data.value},style:{item:"$shape"}},render(e){let{data:t}=e;const n=this.resolver.resolve({data:t,defaults:A({},El,this.style.item),settings:this.settings.settings,scaled:{x:this.rect.width,y:this.rect.height}}),{width:i,height:r}=this.rect,o=A({},Al,this.settings.settings.sizeLimits),s=n.items,a=function(e,t,n,i,r){const o=Tl(e?e.scale:void 0,n),s=Tl(t?t.scale:void 0,i);let a=Math.min(o.value*r[o.isBandwidth?"maxRelDiscrete":"maxRelExtent"],s.value*r[s.isBandwidth?"maxRelDiscrete":"maxRelExtent"]),l=Math.min(o.value*r[o.isBandwidth?"minRelDiscrete":"minRelExtent"],s.value*r[s.isBandwidth?"minRelDiscrete":"minRelExtent"]);return{min:Math.max(1,Math.floor(l)),max:Math.max(1,Math.floor(a)),maxGlobal:r.maxPx,minGlobal:r.minPx}}(n.settings.x,n.settings.y,i,r,o);return Il(s,this.rect,a,this.settings.shapeFn||this.symbol)}};Math.PI;const Nl={label:"",arc:1,show:!0,fill:"#333",stroke:"#ccc",strokeWidth:1,strokeLinejoin:"round",opacity:1,innerRadius:0,outerRadius:.8,cornerRadius:0,offset:0};function Ol(e,t,n,i){let{x:r,y:o,width:s,height:a}=t;const l=be(),c={x:r+s/2,y:o+a/2},u=Math.min(s,a)/2,h=Math.min(s,a)/2,d=h/100;return e.map(((e,t)=>{const r=n[t];r.type="path";const o=h*r.outerRadius,s=u*r.innerRadius,a=d*r.cornerRadius;l.innerRadius(s),l.outerRadius(o),l.cornerRadius(a),r.arcDatum=e;const f=l.centroid(e),p=r.offset?function(e,t,n,i){let[r,o]=e;const s=Math.sqrt(r*r+o*o);r/=s,o/=s;const a=n-i;return{x:r*t*a,y:o*t*a}}(f,r.offset,o,s):{x:0,y:0};return r.transform="translate(".concat(p.x,", ").concat(p.y,") translate(").concat(c.x,", ").concat(c.y,")"),r.desc={share:e.value/i,slice:{start:e.startAngle,end:e.endAngle,innerRadius:s,outerRadius:o,cornerRadius:a,offset:{x:c.x+p.x,y:c.y+p.y}}},r}))}function Pl(e,t){return e.slice&&"arc"in e.slice?t.arc:t.data.value}const Ll={require:["chart","resolver"],defaultSettings:{settings:{startAngle:0,endAngle:2*Math.PI,padAngle:0,slice:{}},style:{slice:"$shape"},data:{}},render(e){let{data:t}=e;const n=[],i=[],r=this.settings.settings,{items:o}=this.resolver.resolve({data:t,defaults:A({},Nl,this.style.slice),settings:r.slice});let s=0;for(let e=0,t=o.length;e<t;e++){const t=Pl(r,o[e]);t>0&&o[e].outerRadius>=o[e].innerRadius&&(n.push(t),i.push(o[e]),s+=t)}const a=function(){var e=_e,t=Se,n=null,i=Z(0),r=Z(ce),o=Z(0);function s(s){var a,l,c,u,h,d=s.length,f=0,p=new Array(d),m=new Array(d),g=+i.apply(this,arguments),y=Math.min(ce,Math.max(-ce,r.apply(this,arguments)-g)),v=Math.min(Math.abs(y)/d,o.apply(this,arguments)),b=v*(y<0?-1:1);for(a=0;a<d;++a)(h=m[p[a]=a]=+e(s[a],a,s))>0&&(f+=h);for(null!=t?p.sort((function(e,n){return t(m[e],m[n])})):null!=n&&p.sort((function(e,t){return n(s[e],s[t])})),a=0,c=f?(y-d*b)/f:0;a<d;++a,g=u)l=p[a],u=g+((h=m[l])>0?h*c:0)+b,m[l]={data:s[l],index:a,value:h,startAngle:g,endAngle:u,padAngle:v};return m}return s.value=function(t){return arguments.length?(e="function"==typeof t?t:Z(+t),s):e},s.sortValues=function(e){return arguments.length?(t=e,n=null,s):t},s.sort=function(e){return arguments.length?(n=e,t=null,s):n},s.startAngle=function(e){return arguments.length?(i="function"==typeof e?e:Z(+e),s):i},s.endAngle=function(e){return arguments.length?(r="function"==typeof e?e:Z(+e),s):r},s.padAngle=function(e){return arguments.length?(o="function"==typeof e?e:Z(+e),s):o},s}().sortValues(null);a.startAngle(r.startAngle),a.endAngle(r.endAngle),a.padAngle(r.padAngle);return Ol(a(n),A({},this.rect,{x:0,y:0}),i,s)}};const Fl=function(e){function t(t){if(e[t.type]&&e[t.type].condition(t)){const n=e[t.type],i=void 0===n.conditionAppend||n.conditionAppend(t);n.items.forEach((e=>{const n=Math.round(t[e.key]),r=t[e.key]-n;t[e.key]=n,i&&"append"===e.type&&(r>0?t[e.key]+=.5:t[e.key]-=.5)}))}}return void 0===e&&((e={}).line={append:["x1","x2","y1","y2"],round:[],condition:e=>e.x1===e.x2||e.y1===e.y2,conditionAppend:e=>e.strokeWidth%2!=0},e.rect={append:["x","y"],round:["width","height"],condition:()=>!0,conditionAppend:e=>e.strokeWidth%2!=0}),Object.keys(e).forEach((t=>{const n=e[t];n.items=[],n.append.forEach((e=>{n.items.push({key:e,type:"append"})})),n.round.forEach((e=>{n.items.push({key:e,type:"round"})}))})),t.multiple=e=>e.forEach((e=>t(e))),t}();class zl{constructor(){this.reset(),this.push(...arguments)}static evaluateKey(e,t){if(t){const t=e.substring(0,1),n=e.substring(1);if("x"===t)return"y".concat(n);if("y"===t)return"x".concat(n);if("cx"===e)return"cy";if("cy"===e)return"cx";if("width"===e)return"height";if("height"===e)return"width"}return e}transposeCoordinate(e,t,n){if("number"==typeof t&&isFinite(t)){const i=e.substring(0,1);if("x"===i||"cx"===e)return t*this.width;if("width"===e)return t*this.width;if("r"===e)return t*(n?this.height:this.width);if("y"===i||"cy"===e)return t*this.height;if("height"===e)return t*this.height}return t}push(){return this.storage.push(...arguments),this}processItem(e){let t={};const n=void 0!==e.flipXY?e.flipXY:this.flipXY,i=void 0!==e.crisp?e.crisp:this.crisp;if(e.fn&&"function"==typeof e.fn){let i=n?this.height:this.width,r=n?this.width:this.height;e=e.fn({width:i,height:r,flipXY:n});const o=Object.keys(e);for(let i=0,r=o.length;i<r;i++){let r=o[i];t[zl.evaluateKey(r,n)]=e[r]}}else{const i=Object.keys(e);for(let r=0,o=i.length;r<o;r++){let o=i[r];const s=zl.evaluateKey(o,n),a=this.transposeCoordinate(s,e[o],n);t[s]=a}}return i&&Fl(t),t}output(){let e=[];for(let t=0,n=this.storage.length;t<n;t++){let n=this.processItem(this.storage[t]);e.push(n)}return e}reset(){this.storage=[],this.flipXY=!1,this.crisp=!1,this.width=0,this.height=0}}function jl(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return new zl(...t)}function Hl(e,t){return e&&t?e.cachedTicks&&e.cachedTicks()||e.ticks({distance:t}):[]}const Bl={created(){},require:["chart","renderer","resolver"],defaultSettings:{layout:{displayOrder:0},style:{ticks:"$guide-line",minorTicks:"$guide-line--minor"}},beforeRender(){this.blueprint=jl(),this.blueprint.width=this.rect.width,this.blueprint.height=this.rect.height,this.blueprint.x=this.rect.x,this.blueprint.y=this.rect.y,this.blueprint.crisp=!0},render(){if(this.x=this.settings.x?this.chart.scale(this.settings.x):null,this.y=this.settings.y?this.chart.scale(this.settings.y):null,qs(this,"x",this.rect.width),qs(this,"y",this.rect.height),!this.x&&!this.y)return[];this.settings.ticks=A({show:!0},this.style.ticks,this.settings.ticks||{}),this.settings.minorTicks=A({show:!1},this.style.minorTicks,this.settings.minorTicks||{}),this.lines={x:[],y:[]},this.lines.x=Hl(this.x,this.rect.width),this.lines.y=Hl(this.y,this.rect.height),this.lines.y=this.lines.y.map((e=>A(e,{flipXY:!0})));let e=e=>{let{dir:t,isMinor:n}=e,i=this.lines[t].filter((e=>!!e.isMinor===n)),r=n?this.settings.minorTicks:this.settings.ticks;this.resolver.resolve({settings:r,data:{items:i,dir:t}}).items.forEach((e=>{let n=e.data;var i,r;e.show&&this.blueprint.push({type:"line",x1:n.position,y1:0,x2:n.position,y2:1,stroke:e.stroke||"black",strokeWidth:void 0!==e.strokeWidth?e.strokeWidth:1,strokeDasharray:void 0!==e.strokeDasharray?e.strokeDasharray:void 0,flipXY:n.flipXY||!1,value:null!==(i=n.value)&&void 0!==i?i:null===(r=n.data)||void 0===r?void 0:r.value,dir:t})}))};return e({dir:"x",isMinor:!1}),e({dir:"x",isMinor:!0}),e({dir:"y",isMinor:!1}),e({dir:"y",isMinor:!0}),this.blueprint.output()}};function Vl(e,t,n){let i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"bottom";if(n*=.8,"left"===i||"right"===i){let r="right"===i;return"\n M ".concat(e," ").concat(t-n,"\n A ").concat(1.25*n," ").concat(1.25*n,", 0, 1, ").concat(r?0:1,", ").concat(e," ").concat(t+n,"\n L ").concat(r?e+n:e-n," ").concat(t," Z\n ")}let r="bottom"===i;return"\n M ".concat(e-n," ").concat(t,"\n A ").concat(1.25*n," ").concat(1.25*n,", 0, 1, ").concat(r?1:0,", ").concat(e+n," ").concat(t,"\n L ").concat(e," ").concat(r?t+n:t-n," Z\n ")}function $l(e,t,n){let i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"bottom";if(n*=.75,"left"===i||"right"===i){let r="right"===i;return"\n M ".concat(e+=r?1.5*n:-1.5*n," ").concat(t-n,"\n L ").concat(e," ").concat(t+n,"\n L ").concat(r?e+n:e-n," ").concat(t," Z\n ")}let r="bottom"===i;return t+=r?1.5*n:-1.5*n,"\n M ".concat(e-n," ").concat(t,"\n L ").concat(e+n," ").concat(t,"\n L ").concat(e," ").concat(r?t+n:t-n," Z\n ")}function Wl(e){if(void 0===e)return 0;if("number"==typeof e&&isFinite(e))return e;if("string"==typeof e)switch(e){case"center":case"middle":return.5;case"bottom":case"right":return 1;default:return 0}return 0}function Ul(e){const t={value:e.value};return e.label&&(t.label=e.label.text),t}function Yl(e){return void 0!==("function"==typeof e.value?e.value():e.value)}function Xl(e,t){const n=e.min();if(n===e.max()){const i=function(e){const t=e.range();return 2===(null==t?void 0:t.length)&&t[0]>t[1]}(e);if(t<n)return i?2:-1;if(t>n)return i?-1:2}return e(t)}const Kl={require:["chart","renderer"],defaultSettings:{layout:{displayOrder:0},style:{oob:{show:!0,width:10,fill:"#1A1A1A",stroke:"transparent",strokeWidth:0,opacity:1,text:{fontFamily:"Arial",stroke:"transparent",fill:"#fff",strokeWidth:0,opacity:1},triangle:{fill:"#4D4D4D",stroke:"transparent",strokeWidth:0,opacity:1},padding:{x:28,y:5}},line:{stroke:"#000"},label:{strokeWidth:0}}},preferredSize:()=>30,beforeRender(){this.blueprint=jl(),this.blueprint.width=this.rect.width,this.blueprint.height=this.rect.height,this.blueprint.x=this.rect.x,this.blueprint.y=this.rect.y,this.blueprint.crisp=!0},render(){let e=this.settings;if(this.lines={x:[],y:[]},this.lines.x=e.lines&&e.lines.x||[],this.lines.y=e.lines&&e.lines.y||[],0===this.lines.x.length&&0===this.lines.y.length)return[];const t={x0:[],x1:[],y0:[],y1:[]};this.lines.x=this.lines.x.filter(Yl).map((e=>{if("function"==typeof e.value&&(e.value=e.value()),e.scale){let t=this.chart.scale(e.scale);const n=Xl(t,e.value);return A(e,{scale:t,position:n})}return A(e,{position:e.value})})),this.lines.y=this.lines.y.filter(Yl).map((e=>{if("function"==typeof e.value&&(e.value=e.value()),e.scale){let t=this.chart.scale(e.scale);const n=Xl(t,e.value);return A(e,{scale:t,position:n,flipXY:!0})}return A(e,{position:e.value,flipXY:!0})})),this.lines.x=this.lines.x.filter((e=>!(e.position<0||e.position>1)||(t["x".concat(e.position>1?1:0)].push(Ul(e)),!1))),this.lines.y=this.lines.y.filter((e=>!(e.position<0||e.position>1)||(t["y".concat(e.position>1?1:0)].push(Ul(e)),!1)));let n=[];return[...this.lines.x,...this.lines.y].forEach((t=>{(!0===t.show||void 0===t.show)&&function(e){let{chart:t,blueprint:n,renderer:i,p:r,settings:o,items:s}=e,a=!0,l=!1,c=!1,u=!1,h=!1,d=A(!0,{},o.style.line,r.line||{});if(l=n.processItem({type:"line",x1:r.position,y1:0,x2:r.position,y2:1,stroke:d.stroke||"black",strokeWidth:d.strokeWidth||1,strokeDasharray:d.strokeDasharray,flipXY:r.flipXY||!1,value:r.valueInfo?r.valueInfo.id:r.value}),r.label){const e=A(!0,{fill:"#000",fontFamily:"Arial",fontSize:"12px",opacity:1,maxWidth:1,maxWidthPx:9999,padding:5,background:{fill:"#fff",stroke:"transparent",strokeWidth:0,opacity:.5}},o.style.label||{},{fill:d.stroke},r.label);let l,f={width:0,height:0},p="";if("string"==typeof r.formatter)l=t.formatter(r.formatter);else if("object"==typeof r.formatter)l=t.formatter(r.formatter);else if(void 0!==r.scale&&r.scale.data){const e=r.scale.data()&&r.scale.data().fields;l=e&&e[0]?e[0].formatter():null}!1!==r.label.showValue&&(l?p=" (".concat(l(r.value),")"):r.scale&&(p=" (".concat(r.value,")"))),p&&(f=i.measureText({text:p,fontFamily:e.fontFamily,fontSize:e.fontSize}));let m=i.measureText({text:e.text||"",fontFamily:e.fontFamily,fontSize:e.fontSize}),g={width:m.width+f.width,height:Math.max(m.height,f.height)},y=e.padding,v=Wl(r.flipXY?e.vAlign:e.align),b=Wl(r.flipXY?e.align:e.vAlign),x=Math.min(1+g.width+2*y,e.maxWidth*n.width,e.maxWidthPx),w=g.height+2*y,q=r.flipXY?w:x,M=r.flipXY?x:w;if(c=n.processItem({fn:t=>{let{width:i,height:o}=t,s=r.position*i-(r.flipXY?w:x)*(1-v);return s=r.flipXY?s:Math.max(s,0),{type:"rect",x:s,y:Math.max(Math.abs(b*o-M*b),0),width:r.flipXY?q:Math.min(q,n.width-s),height:M,stroke:e.background.stroke,strokeWidth:e.background.strokeWidth,fill:e.background.fill,opacity:e.background.opacity}},flipXY:r.flipXY||!1}),c.x<-1||c.x+c.width>n.width+1||c.y<-1||c.y+c.height>n.height+1)c=void 0;else{u={type:"text",text:e.text||"",fill:e.fill,opacity:e.opacity,fontFamily:e.fontFamily,fontSize:e.fontSize,x:c.x+y,y:c.y+c.height/2+g.height/3,maxWidth:c.width-2*y-f.width,anchor:"start"},p&&(h={type:"text",text:p||"",fill:e.fill,opacity:e.opacity,fontFamily:e.fontFamily,fontSize:e.fontSize,x:u.x+3+(c.width-(f.width+2*y)),y:u.y});for(let e=0,t=s.length;e<t;e++){let t=s[e];"rect"===t.type?wa(c,t)&&(a=!1):"line"===t.type&&r.flipXY===t.flipXY&&Da(c,t)&&(a=!1)}}}s.push(l),a&&c&&u&&(s.push(c,u),h&&s.push(h))}({chart:this.chart,blueprint:this.blueprint,renderer:this.renderer,p:t,settings:e,items:n})})),e.style.oob.show&&function(e){let{blueprint:t,oob:n,settings:i,items:r}=e;const o=Object.keys(n);let s=i.style.oob||{};for(let e=0,i=o.length;e<i;e++){const i=o[e],a=n[i];if(a.length>0){let e=i.charAt(1),n="y"===i.charAt(0),o=s.padding.x+s.width,l=s.padding.y+s.width,c="bottom";c=n?"1"===e?"bottom":"top":"1"===e?"right":"left";let u=t.processItem({fn:t=>{let{width:i,height:r}=t,u=e*i+("1"===e?-o:o),h=n?l:r-l;return"arc"===s.type?{type:"path",d:Vl(n?h:u,n?u:h,s.width,c),x:u,y:h,stroke:s.stroke,fill:s.fill,strokeWidth:s.strokeWidth||0}:{type:"circle",cx:u,cy:h,r:s.width,stroke:s.stroke,fill:s.fill,strokeWidth:s.strokeWidth||0,opacity:s.opacity,data:a}},flipXY:n}),h=u.cx||u.x,d=u.cy||u.y,f={type:"text",text:a.length||"",x:h-.4*s.width,y:d+.4*s.width,fontFamily:s.text.fontFamily,fontSize:"".concat(1.3*s.width,"px"),stroke:s.text.stroke,fill:s.text.fill,strokeWidth:s.text.strokeWidth||0,opacity:s.text.opacity},p={type:"path",d:$l(h,d,s.width,c),x:h,y:d,stroke:s.triangle.stroke,fill:s.triangle.fill,strokeWidth:s.triangle.strokeWidth||0,opacity:s.triangle.opacity};r.push(u,f,p)}}}({blueprint:this.blueprint,oob:t,settings:e,items:n}),n}};function Gl(e){const t={type:"line",x1:0,x2:0,y1:0,y2:0,collider:{type:null}};return"top"===e.align||"bottom"===e.align?(t.x1=e.innerRect.x-e.outerRect.x,t.x2=t.x1+e.innerRect.width,t.y1=t.y2="top"===e.align?e.innerRect.height-e.padding:e.padding):(t.x1=t.x2="left"===e.align?e.innerRect.width-e.padding:e.padding,t.y1=e.innerRect.y-e.outerRect.y,t.y2=t.y1+e.innerRect.height),function(e,t){A(e,t.style)}(t,e),t}function Jl(e){return"string"==typeof e||"number"==typeof e?e:"-"}function Zl(e,t,n){n.layered||!n.stepSize?function(e,t){t.collider={type:"polygon",vertices:[{x:t.boundingRect.x,y:t.boundingRect.y},{x:t.boundingRect.x+t.boundingRect.width,y:t.boundingRect.y},{x:t.boundingRect.x+t.boundingRect.width,y:t.boundingRect.y+t.boundingRect.height},{x:t.boundingRect.x,y:t.boundingRect.y+t.boundingRect.height}]}}(0,t):n.tilted?function(e,t,n){const i=n.angle*(Math.PI/180),r=Math.max(n.stepSize/2,t.boundingRect.height/2),o="start"===t.anchor,s="end"===t.anchor&&i<0,a="start"===t.anchor&&i>=0,l=t.boundingRect.y+(a||s?t.boundingRect.height:0),c=[{x:t.x-r,y:l},{x:t.x+r,y:l}].map((e=>Ys(e,i,{x:t.x,y:t.y}))),u={x:o?t.boundingRect.x+t.boundingRect.width+10:t.boundingRect.x-10,y:t.boundingRect.y+t.boundingRect.height},h={x:o?t.boundingRect.x+t.boundingRect.width+10:t.boundingRect.x-10,y:t.boundingRect.y},d=i>=0?[u,h]:[h,u];c.push(...d),t.collider={type:"polygon",vertices:c}}(0,t,n):function(e,t,n){if("bottom"===n.align||"top"===n.align){const i=e.position*n.innerRect.width+(n.innerRect.x-n.outerRect.x-n.stepSize/2);t.collider={type:"rect",x:i,y:0,width:i<0?n.stepSize+i:n.stepSize,height:n.innerRect.height}}else{const i=e.position*n.innerRect.height+(n.innerRect.y-n.outerRect.y-n.stepSize/2);t.collider={type:"rect",x:0,y:i,width:n.innerRect.width,height:i<0?n.stepSize+i:n.stepSize}}const i=t.collider;i.x=Math.max(i.x,0),i.y=Math.max(i.y,0);const r=i.x+i.width-(n.outerRect.x+n.outerRect.width);i.width=r>0?i.width-r:i.width;const o=i.y+i.height-(n.outerRect.y+n.outerRect.height);i.height=o>0?i.height-o:i.height}(e,t,n)}function Ql(e,t){const n=isNaN(e.style.align)?.5:Math.min(Math.max(e.style.align,0),1);let i=0;if(e.tilted)i=e.stepSize*n;else{const r=t?e.textRect.height:e.textRect.width;i=Math.max(0,e.stepSize-r)*n}return i}function ec(e,t){var n,i;const r={type:"text",text:Jl(e.label),x:0,y:0,maxWidth:t.maxWidth,maxHeight:t.maxHeight,tickValue:null!==(n=e.value)&&void 0!==n?n:null===(i=e.data)||void 0===i?void 0:i.value};return"top"===t.align||"bottom"===t.align?(r.x=e.start*t.innerRect.width+(t.innerRect.x-t.outerRect.x)+Ql(t,!1),r.y="top"===t.align?t.innerRect.height:0,r.anchor=t.stepSize?"start":"middle",r.x+=isNaN(t.style.offset)?0:+t.style.offset):(r.y=e.start*t.innerRect.height+(t.innerRect.y-t.outerRect.y)+Ql(t,!0),r.x="left"===t.align?t.innerRect.width:0,r.anchor="left"===t.align?"end":"start",r.baseline=t.stepSize?"text-before-edge":"central",r.y+=isNaN(t.style.offset)?0:+t.style.offset),function(e,t){["fill","fontSize","fontFamily"].forEach((n=>{e[n]=t.style[n]}))}(r,t),function(e,t){if(!t.tilted&&!t.stepSize)if("top"===t.align||"bottom"===t.align){const n=0,i=t.outerRect.width,r=Math.min(t.maxWidth/2,t.textRect.width/2),o=e.x-r,s=e.x+r;o<n?(e.anchor="start",e.x=t.innerRect.x-t.outerRect.x):s>i&&(e.anchor="end",e.x=t.innerRect.width+t.innerRect.x)}else{const n=0,i=t.outerRect.height,r=t.maxHeight/2,o=e.y-r,s=e.y+r;o<n?(e.y=t.innerRect.y-t.outerRect.y,e.baseline="text-before-edge"):s>i&&(e.y=t.innerRect.height+(t.innerRect.y-t.outerRect.y),e.baseline="text-after-edge")}}(r,t),function(e,t){"top"===t.align?e.y-=t.padding:"bottom"===t.align?e.y+=t.padding+t.maxHeight:"left"===t.align?e.x-=t.padding:"right"===t.align&&(e.x+=t.padding)}(r,t),function(e,t){if(t.tilted){const n=-t.angle,i=n*(Math.PI/180);"bottom"===t.align?(e.x-=t.maxHeight*Math.sin(i)/2,e.y-=t.maxHeight,e.y+=t.maxHeight*Math.cos(i)/2):e.x-=t.maxHeight*Math.sin(i)/3,e.transform="rotate(".concat(n,", ").concat(e.x,", ").concat(e.y,")"),e.anchor="bottom"===t.align==t.angle<0?"start":"end";const r=Math.cos(i)*t.maxWidth;if("bottom"===t.align==t.angle<0){const n=t.outerRect.width-t.paddingEnd;e.x+r>n&&(e.maxWidth=(n-e.x-10)/Math.cos(i))}else{const n=t.paddingEnd;e.x-r<n&&(e.maxWidth=(e.x-n-10)/Math.cos(i))}}}(r,t),function(e,t){e.boundingRect=t.textBounds(e)}(r,t),Zl(e,r,t),r}function tc(e,t){const n={type:"line",x1:0,x2:0,y1:0,y2:0,collider:{type:null},tickValue:e.value};return"top"===t.align||"bottom"===t.align?(n.x1=n.x2=e.position*t.innerRect.width+(t.innerRect.x-t.outerRect.x),n.y1="top"===t.align?t.innerRect.height:0,n.y2="top"===t.align?n.y1-t.tickSize:n.y1+t.tickSize):(n.y1=n.y2=e.position*t.innerRect.height+(t.innerRect.y-t.outerRect.y),n.x1="left"===t.align?t.innerRect.width:0,n.x2="left"===t.align?n.x1-t.tickSize:n.x1+t.tickSize),function(e,t){A(e,t.style)}(n,t),function(e,t){"top"===t.align?(e.y1-=t.padding,e.y2-=t.padding):"bottom"===t.align?(e.y1+=t.padding,e.y2+=t.padding):"left"===t.align?(e.x1-=t.padding,e.x2-=t.padding):"right"===t.align&&(e.x1+=t.padding,e.x2+=t.padding)}(n,t),function(e,t){const n=e.strokeWidth/2;e.x1===t.innerRect.width?(e.x1-=n,e.x2-=n):0===e.x1?(e.x1+=n,e.x2+=n):e.y1===t.innerRect.height?(e.y1-=n,e.y2-=n):0===e.y1&&(e.y1+=n,e.y2+=n)}(n,t),n}function nc(e){return!e.isMinor&&e.position>=0&&e.position<=1}function ic(e){let{rect:t,state:n,majorTicks:i,measure:r,horizontal:o}=e;return o?function(e){let{majorTicks:t,measureText:n,rect:i,state:r}=e;const o="layered"===r.labels.activeMode?2:1,s=i.width,a=t.map((e=>e.label)).map((e=>"".concat(e.slice(0,1)).concat(e.length>1?"…":""))).map(n).map((e=>e.width));for(let e=0;e<t.length;++e){const n=t[e];if(o*s*Math.abs(n.start-n.end)<a[e])return!0}return!1}({majorTicks:i,measureText:r,rect:t,state:n}):function(e){let{majorTicks:t,measureText:n,rect:i}=e;const r=i.height,o=n("M").height;return!(t.length<2)&&r*Math.abs(t[0].position-t[1].position)<o}({majorTicks:i,measureText:r,rect:t,state:n})}function rc(e){let{value:t,maxValue:n,minValue:i,range:r,modifier:o}=e;return isNaN(r)||isNaN(o)||(t=r*o),t>n&&(t=n),t<i&&(t=i),t}function oc(e){let{isDiscrete:t,rect:n,formatter:i,measureText:r,scale:o,settings:s,state:a}=e,l=0;const c={left:0,top:0,right:0,bottom:0},{maxLengthPx:u,minLengthPx:h}=s.labels;if(s.labels.show){const e=s.align,d="top"===e||"bottom"===e,f=d?n.inner.width:n.inner.height,p=o.ticks({settings:s,distance:f,formatter:i}).filter(nc),m=e=>{const t=r({text:e,fontSize:s.labels.fontSize,fontFamily:s.labels.fontFamily});return t.width=rc({value:t.width,maxValue:u,minValue:h}),t};if(t&&d&&"auto"===s.labels.mode&&(!function(e){let{majorTicks:t,measure:n,rect:i,state:r,settings:o}=e;const s=o.labels.maxGlyphCount,a="layered"===r.labels.activeMode?2:1,l=o.labels.tiltThreshold?o.labels.tiltThreshold:.7,c=n("…").width,u=i.width;let h=0,d=0;if(isNaN(s))for(let e=0;e<t.length;e++){const i=t[e],r=i.label,o=n(r).width*(r.length>1?l:1);if(d=a*u*Math.abs(i.start-i.end),o+c>d)return!0}else if(d=a*u*t.reduce(((e,t)=>Math.min(Math.abs(t.start-t.end),e)),1/0),h=n("M").width*l*s,h+c>d)return!0;return!1}({majorTicks:p,measure:m,rect:n.inner,state:a,settings:s})?a.labels.activeMode="horizontal":a.labels.activeMode="tilted"),!s.labels.filterOverlapping&&"tilted"!==a.labels.activeMode&&ic({rect:n.inner,state:a,majorTicks:p,measure:m,horizontal:d})){return{size:Math.max(n.outer.width,n.outer.height),isToLarge:!0}}let g,y;if("tilted"===a.labels.activeMode){const e=Math.abs(s.labels.tiltAngle)*(Math.PI/180);g=t=>rc({value:t.width,maxValue:u,minValue:h})*Math.sin(e)+t.height*Math.cos(e)}else g=d?e=>e.height:e=>rc({value:e.width,maxValue:u,minValue:h});if(d&&"tilted"!==a.labels.activeMode)y=["M"];else if(isNaN(s.labels.maxGlyphCount))y=p.map((e=>e.label));else{let e="";for(let t=0;t<s.labels.maxGlyphCount;t++)e+="M";y=[e]}const v=y.map(m),b=v.map(g),x=Math.max(...b,0);if(l+=x,l+=s.labels.margin,"layered"===a.labels.activeMode&&(l*=2),"tilted"===a.labels.activeMode){const e="bottom"===s.align==s.labels.tiltAngle>=0,t=Math.abs(s.labels.tiltAngle)*(Math.PI/180),i=(x-m("M").height*Math.cos(t))/Math.sin(t),r=e=>Math.min(i,e.width)*Math.cos(t)+e.height,o=(t,i)=>{const r=p[i]?p[i].position:0;return e?t-r*n.inner.width:t-(1-r)*n.inner.width},a=Math.min(s.labels.maxEdgeBleed,Math.max(...v.map(r).map(o),0))+s.paddingEnd;if(c[e?"left":"right"]=a,!s.labels.filterOverlapping&&function(e){let{majorTicks:t,measureText:n,rect:i,bleedSize:r,angle:o}=e;if(t.length<2)return!1;if(0===o)return!0;const s=Math.abs(o),a=1/(Math.min(i.outer.width-r,i.inner.width)*Math.abs(t[0].position-t[1].position));return n("M").height>Math.sin(s*(Math.PI/180))/a}({majorTicks:p,measureText:m,rect:n,bleedSize:a,angle:s.labels.tiltAngle})){return{size:Math.max(n.outer.width,n.outer.height),isToLarge:!0}}}}return{size:l,edgeBleed:c}}const sc=(e,t,n)=>e.width*Math.abs(t.position-n.position);function ac(e){let{layered:t,major:n,innerRect:i,outerRect:r,tick:o,index:s}=e;const a=t?2:1,l=n[s-a],c=n[s+a],u=l?sc(i,o,l)/2-2:1/0,h=c?sc(i,o,c)/2-2:1/0;return n.length<2?i.width:l?c?2*Math.min(u,h):(e=>{let{innerRect:t,outerRect:n,tick:i,prevWidth:r}=e;const o=t.x-n.x,s=n.width-t.width-o,a=t.width-t.width*i.position+s,l=2*Math.min(r,a),c=1===i.position?t.width/2-2:0;return Math.max(r,l,c)})({innerRect:i,outerRect:r,tick:o,prevWidth:u}):(e=>{let{innerRect:t,outerRect:n,tick:i,nextWidth:r}=e;const o=t.x-n.x,s=t.width*i.position+o,a=2*Math.min(r,s),l=0===i.position?t.width/2-2:0;return Math.max(r,a,l)})({innerRect:i,outerRect:r,tick:o,nextWidth:h})}function lc(e){let t=0;return t+=e.paddingStart,t+=e.line.show?e.line.strokeWidth/2:0,t+=e.ticks.show?e.ticks.margin:0,t}function cc(e){let t=0;return t+=e.ticks.show?e.ticks.tickSize:0,t+=lc(e)+e.labels.margin,t}function uc(e,t){return e.map((e=>tc(e,t)))}function hc(e,t){return t?Math.abs(t.end-t.start):e.bandwidth()}function dc(e){let{textMetrics:t,settings:n,innerRect:i,scale:r,tilted:o,layered:s,tick:a}=e;const l=t.height,c=hc(r,a),u={width:0,height:l};if("left"===n.align||"right"===n.align)u.width=i.width-cc(n)-n.paddingEnd;else if(s)u.width=c*i.width*2;else if(o){const e=Math.abs(n.labels.tiltAngle)*(Math.PI/180);u.width=(i.height-cc(n)-n.paddingEnd-l*Math.cos(e))/Math.sin(e)}else u.width=c*i.width;return u.width=rc({value:u.width,maxValue:n.labels.maxLengthPx,minValue:n.labels.minLengthPx}),u}function fc(e){let{textMetrics:t,settings:n,innerRect:i,outerRect:r,tilted:o,layered:s,tick:a,index:l,major:c}=e;const u=t.height,h={width:0,height:u};if("left"===n.align||"right"===n.align)h.width=i.width-cc(n)-n.paddingEnd;else if(o){const e=Math.abs(n.labels.tiltAngle)*(Math.PI/180);h.width=(i.height-cc(n)-n.paddingEnd-u*Math.cos(e))/Math.sin(e)}else h.width=ac({layered:s,major:c,innerRect:i,outerRect:r,tick:a,index:l});return h.width=rc({value:h.width,maxValue:n.labels.maxLengthPx,minValue:n.labels.minLengthPx}),h}function pc(e){let t;function n(){return t=fc,n}function i(){return t=dc,i}function r(e){let{settings:n,scale:i,innerRect:r,outerRect:o,measureText:s,ticks:a,state:l,textBounds:c}=e;const u=[],h=function(e){return e.filter((e=>!e.isMinor))}(a),d=function(e){return e.filter((e=>e.isMinor))}(a),f={innerRect:r,align:n.align,outerRect:o},p="tilted"===l.labels.activeMode,m="layered"===l.labels.activeMode;let g;if(n.line.show&&(f.style=n.line,f.padding=n.paddingStart,u.push(Gl(f))),n.ticks.show&&(f.style=n.ticks,f.tickSize=n.ticks.tickSize,f.padding=lc(n),g=uc(h,f)),n.labels.show){const e=cc(n);f.style=n.labels,f.padding=e,f.tilted=p,f.layered=m,f.angle=n.labels.tiltAngle,f.paddingEnd=n.paddingEnd,f.textBounds=c;const l=(e,l)=>{f.textRect=function(e){let{style:t,measureText:n,tick:i}=e;return n({text:i.label,fontSize:t.fontSize,fontFamily:t.fontFamily})}({tick:e,measureText:s,style:f.style});const c=t({textMetrics:f.textRect,settings:n,innerRect:r,outerRect:o,scale:i,tilted:p,layered:m,tick:e,major:h,index:l});f.maxWidth=c.width,f.maxHeight=c.height,f.stepSize=function(e){let{innerRect:t,scale:n,settings:i,tick:r}=e;return("top"===i.align||"bottom"===i.align?t.width:t.height)*hc(n,r)}({innerRect:r,scale:i,ticks:a,settings:n,tick:e})};let d=[];d=!m||"top"!==n.align&&"bottom"!==n.align?function(e,t,n){return e.map(((e,i)=>{n(e,i);const r=ec(e,t);return r.data=e.data,r}))}(h,f,l):function(e,t,n,i){const r=t.padding,o=cc(n);return e.map(((e,s)=>{i(e,s);const a=o+t.maxHeight+n.labels.margin;t.layer=s%2,t.padding=s%2==0?r:a;const l=ec(e,t);return l.data=e.data,l}))}(h,f,n,l),n.labels.filterOverlapping&&function(e,t,n){let i=(t,n)=>wa($(1,e[t].boundingRect),$(1,e[n].boundingRect));if(n&&n.tilted){const t=Math.abs(n.angle);i=(n,i)=>{const r=1/Math.abs(e[n].x-e[i].x),o=Math.sin(t*(Math.PI/180))/r;return e[n].boundingRect.height>o}}for(let n=0;n<=e.length-1;n++)for(let r=n+1;r<=Math.min(n+5,n+(e.length-1));r++)e[n]&&e[r]&&i(n,r)&&(r===e.length-1?(e.splice(n,1),t&&t.splice(n,1)):(e.splice(r,1),t&&t.splice(r,1)),r--,n--)}(d,g,f),u.push(...d)}return n.minorTicks&&n.minorTicks.show&&d.length>0&&(f.style=n.minorTicks,f.tickSize=n.minorTicks.tickSize,f.padding=function(e){return e.line.strokeWidth+e.minorTicks.margin}(n),u.push(...uc(d,f))),g&&u.push(...g),u}return n.build=r,i.build=r,e?i():n()}const mc={labels:{show:!0,tiltAngle:40,tiltThreshold:.7,maxEdgeBleed:1/0,margin:4,maxLengthPx:150,minLengthPx:0,mode:"auto",maxGlyphCount:NaN,align:.5,offset:0,filterOverlapping:!1},ticks:{show:!1,margin:0,tickSize:4},line:{show:!1},paddingStart:0,paddingEnd:10,align:"auto"},gc={labels:{show:!0,margin:4,maxLengthPx:150,minLengthPx:0,align:.5,offset:0,filterOverlapping:!0},ticks:{show:!0,margin:0,tickSize:8},minorTicks:{show:!1,tickSize:3,margin:0},line:{show:!0},paddingStart:0,paddingEnd:10,align:"auto"};const yc={require:["chart","renderer","dockConfig"],defaultSettings:{layout:{displayOrder:0,prioOrder:0},settings:{},style:{labels:"$label",ticks:"$guide-line",minorTicks:"$guide-line--minor",line:"$guide-line"}},created(){this.state={isDiscrete:!!this.scale.bandwidth,isHorizontal:!1,labels:{activeMode:"horizontal"},ticks:[],innerRect:{width:0,height:0,x:0,y:0},outerRect:{width:0,height:0,x:0,y:0},defaultDock:void 0,concreteNodeBuilder:void 0,settings:void 0},this.state.isDiscrete?this.state.defaultDock="bottom":this.state.defaultDock="left",this.setState(this.settings)},setState(){this.state.isDiscrete=!!this.scale.bandwidth,this.state.settings=function(e){let{state:t,style:n,settings:i}=e;const r=A(!0,{},t.isDiscrete?mc:gc,n),o=A(!0,{},r,i.settings),s=i.layout.dock||t.defaultDock;o.dock=s,o.align=function(e,t){const n=["top","bottom"],i=["left","right"];return-1!==n.indexOf(e)&&-1===i.indexOf(t)||-1!==i.indexOf(e)&&-1===n.indexOf(t)?e:t}(i.settings.align,s),o.labels.tiltAngle=Math.max(-90,Math.min(o.labels.tiltAngle,90));const{paddingStart:a,paddingEnd:l}=o;return o.paddingStart="function"==typeof a?a.call(null):a,o.paddingEnd="function"==typeof l?l.call(null):l,o}(this),this.state.concreteNodeBuilder=pc(this.state.isDiscrete),this.dockConfig.dock(this.state.settings.dock),this.state.isHorizontal="top"===this.state.settings.align||"bottom"===this.state.settings.align,this.state.labels.activeMode=function(e,t,n){const i=t.labels.mode;return n&&e.isHorizontal?"auto"===i?e.labels.activeMode:-1!==["layered","tilted"].indexOf(t.labels.mode)&&-1!==["top","bottom"].indexOf(t.dock)?i:"horizontal":"horizontal"}(this.state,this.state.settings,this.state.isDiscrete)},preferredSize(e){const{formatter:t,state:n,scale:i}=this,r=this.state.isHorizontal?e.inner.width:e.inner.height;this.state.pxScale=Ms(i,r);const o=function(e){let{isDiscrete:t,rect:n,formatter:i,measureText:r,scale:o,settings:s,state:a}=e,l=0;const{size:c,edgeBleed:u,isToLarge:h}=oc({isDiscrete:t,rect:n,formatter:i,measureText:r,scale:o,settings:s,state:a});if(l+=c,h)return{size:l};if(s.ticks.show&&(l+=s.ticks.margin,l+=s.ticks.tickSize),s.minorTicks&&s.minorTicks.show){const e=s.minorTicks.margin+s.minorTicks.tickSize;e>l&&(l=e)}if(s.line.show){const e=s.line.strokeWidth/2;l+=e,u[function(e){switch(e){case"top":return"bottom";case"bottom":return"top";case"left":return"right";case"right":return"left";default:return e}}(s.align)]=Math.ceil(e)}return l+=s.paddingStart,l+=s.paddingEnd,{size:l,edgeBleed:u}}({isDiscrete:this.state.isDiscrete,rect:{inner:e.inner,outer:e.outer},formatter:t,measureText:this.renderer.measureText,scale:this.state.pxScale,settings:this.state.settings,state:n});return o},beforeUpdate(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const{settings:t}=e;this.setState(t)},resize(e){const{inner:t,outer:n}=e,i=A({},t,function(e){let{align:t,inner:n}=e;return"left"===t?{x:n.width+n.x}:"right"===t||"bottom"===t?n:{y:n.y+n.height}}({align:this.state.settings.align,inner:t})),r=n||i;return A(this.state.innerRect,i),A(this.state.outerRect,r),n},beforeRender(){const{scale:e,formatter:t}=this,n=this.state.isHorizontal?this.state.innerRect.width:this.state.innerRect.height;this.state.pxScale=Ms(e,n),this.state.ticks=this.state.pxScale.ticks({distance:n,formatter:t}).filter((e=>e.position>=0&&e.position<=1))},render(){const{state:e}=this,t=[];return t.push(...this.state.concreteNodeBuilder.build({settings:this.state.settings,scale:this.state.pxScale,innerRect:this.state.innerRect,outerRect:this.state.outerRect,measureText:this.renderer.measureText,textBounds:this.renderer.textBounds,ticks:this.state.ticks,state:e})),Fl.multiple(t),t}};const vc={render:()=>[]};function bc(e,t,n){let i="";if("function"==typeof e)i=e();else if("string"==typeof e)i=e;else if(n){const e=(n.data().fields||[]).map((e=>e.title()));i=e.join(t)}return i}function xc(e,t){let n="middle";return"left"===e?"top"===t?n="end":"bottom"===t&&(n="start"):"right"===e?"top"===t?n="start":"bottom"===t&&(n="end"):"left"===t?n="start":"right"===t&&(n="end"),n}const wc={require:["renderer","chart"],defaultSettings:{layout:{dock:"bottom",displayOrder:0,prioOrder:0},settings:{paddingStart:5,paddingEnd:5,paddingLeft:0,paddingRight:0,anchor:"center",join:", ",maxLengthPx:NaN},style:{text:"$title"}},created(){this.definitionSettings=this.settings.settings;const e=this.settings.text,t=this.definitionSettings.join;this.title=bc(e,t,this.scale)},preferredSize(){return this.renderer.measureText({text:this.title,fontSize:this.style.text.fontSize,fontFamily:this.style.text.fontFamily}).height+this.definitionSettings.paddingStart+this.definitionSettings.paddingEnd},render(){const{title:e,definitionSettings:t,rect:n}=this,i=[];return i.push(function(e){let{title:t,definitionSettings:n,dock:i,rect:r,measureText:o,style:s}=e;const a={type:"text",text:t,x:0,y:0,dx:0,dy:0,anchor:xc(i,n.anchor),baseline:"alphabetical",stroke:"transparent",strokeWidth:0,fontWeight:"normal"};A(a,s.text);const l=o(a);if("top"===i||"bottom"===i){let e=r.width/2;"left"===n.anchor?e=n.paddingLeft||0:"right"===n.anchor&&(e=r.width-(n.paddingRight||0)),a.x=e,a.y="top"===i?r.height-n.paddingStart:n.paddingStart+l.height,a.dy="top"===i?-l.height/6:-l.height/3,a.maxWidth=.8*r.width}else{let e=r.height/2;"top"===n.anchor?e=n.paddingStart:"bottom"===n.anchor&&(e=r.height-n.paddingStart),a.y=e,a.x="left"===i?r.width-n.paddingStart:n.paddingStart,a.dx="left"===i?-l.height/3:l.height/3;const t="left"===i?270:90;a.transform="rotate(".concat(t,", ").concat(a.x+a.dx,", ").concat(a.y+a.dy,")"),a.maxWidth=.8*r.height}return isNaN(n.maxLengthPx)||(a.maxWidth=Math.min(a.maxWidth,n.maxLengthPx)),a}({title:e,dock:this.settings.layout.dock,definitionSettings:t,rect:n,measureText:this.renderer.measureText,style:this.style})),i},beforeUpdate(e){e.settings&&(A(this.settings,e.settings),this.definitionSettings=e.settings.settings);const t=this.settings.text,n=this.definitionSettings.join;this.title=bc(t,n,this.scale)}};function qc(e,t){const n=e.settings.layout.dock,i=e.settings.settings.invert,r="top"===n||"bottom"===n,o=r?"width":"height",s=e.rect[o],a=e.chart.scroll(e.settings.scroll);let l;{let e=t[r?"x":"y"];i&&(e=s-e);const n=a.getState();l={startOffset:e,startScroll:n.start,swipe:!1};const o=e/s*(n.max-n.min)+n.min;o<n.start?l.startScroll=o:o>n.start+n.viewSize&&(l.startScroll=o-n.viewSize)}return{update:e=>{let t=e[r?"x":"y"];if(i&&(t=s-t),!l.swipe){if(Math.abs(l.startOffset-t)<=1)return;l.swipe=!0}const n=a.getState(),o=(t-l.startOffset)/s*(n.max-n.min),c=l.startScroll+o;a.moveTo(c)},end:e=>{let t=e[r?"x":"y"];i&&(t=s-t);const n=a.getState();if(l.swipe){const e=(t-l.startOffset)/s*(n.max-n.min),i=l.startScroll+e;a.moveTo(i)}else{const e=t/s*(n.max-n.min)+n.min-n.viewSize/2;a.moveTo(e)}}}}function Mc(e,t){const n=t.element().getBoundingClientRect();return{x:e.center.x-n.left,y:e.center.y-n.top}}const Dc={require:["chart","renderer"],on:{panStart(e){const t=Mc(e,this.renderer),n={x:t.x-e.deltaX,y:t.y-e.deltaY};this.currentMove=qc(this,n),this.currentMove.update(t)},panMove(e){if(!this.currentMove)return;const t=Mc(e,this.renderer);this.currentMove.update(t)},panEnd(e){if(!this.currentMove)return;const t=Mc(e,this.renderer);this.currentMove.end(t),this.currentMove=null},panCancel(){this.currentMove=null},tap(e){const t=Mc(e,this.renderer);qc(this,t).end(t)}},defaultSettings:{settings:{backgroundColor:"#eee",thumbColor:"#ccc",width:16}},preferredSize:function(e){const t=this.chart.scroll(this.settings.scroll).getState();if(t.viewSize>=t.max-t.min){return Math.max(e.width,e.height)}return this.settings.settings.width},render:function(e){const t=this.settings.layout.dock,n=this.settings.settings.invert,i="top"===t||"bottom"===t,r=i?"width":"height",o=this.rect[r],s=this.chart.scroll(this.settings.scroll).getState();let a=o*(s.start-s.min)/(s.max-s.min);const l=o*s.viewSize/(s.max-s.min);return n&&(a=o-a-l),e("div",{style:{position:"relative",width:"100%",height:"100%",background:this.settings.settings.backgroundColor,pointerEvents:"auto"}},[].concat(e("div",{class:"scroller",style:{position:"absolute",[i?"left":"top"]:"".concat(a,"px"),[i?"top":"left"]:"25%",[i?"height":"width"]:"50%",[r]:"".concat(Math.max(1,l),"px"),background:this.settings.settings.thumbColor}})))},renderer:"dom"};function Sc(e){let{h:t,isVertical:n,value:i,pos:r,align:o,borderHit:s,state:a,idx:l}=e;const c="end"!==o,u=c?{left:"0",top:"0"}:{right:"0",bottom:"0"};let h=0,d="100%",f="100%";return a.targetRect&&"start"===a.settings.bubbles.align?(d="".concat(a.targetRect.x+a.targetRect.width,"px"),f="".concat(a.targetRect.y+a.targetRect.height,"px")):a.targetRect&&"end"===a.settings.bubbles.align&&(h=n?a.targetRect.x:a.targetRect.y,d="".concat(a.rect.width-h,"px"),f="".concat(a.rect.height-h,"px")),c||(r-=s),t("div",{onmouseover(e){e.srcElement.children[0].style.backgroundColor="#000",e.srcElement.children[0].style[n?"height":"width"]="2px"},onmouseout(e){e.srcElement.children[0].style.backgroundColor=a.style.line.stroke,e.srcElement.children[0].style[n?"height":"width"]="1px"},"data-value":i,"data-key":[a.key,"edge",l].join("-"),style:{cursor:n?"ns-resize":"ew-resize",position:"absolute",left:"".concat(n?h:r,"px"),top:"".concat(n?r:h,"px"),height:n?"".concat(s,"px"):f,width:n?d:"".concat(s,"px"),pointerEvents:"auto"}},[t("div",{style:A({backgroundColor:a.style.line.stroke,position:"absolute",height:n?"".concat(1,"px"):"100%",width:n?"100%":"".concat(1,"px"),pointerEvents:"none"},u)})])}function _c(e){let{h:t,isVertical:n,label:i,otherValue:r,rangeIdx:o,idx:s,pos:a,align:l,state:c,value:u}=e;const h="end"!==l,d="outside"===c.settings.bubbles.placement;let f,p="none";n?(f=h?"left":"right",d&&(p=h?"translate(-100%, 0px)":"translate(100%, 0px)")):(f=h?"top":"bottom",d&&(p=h?"translate(0px, -100%)":"translate(0px, 100%)"));let m=c.edit&&c.edit.rangeIdx===o&&c.edit.bubbleIdx===s;const g={position:"relative",borderRadius:"".concat(c.style.bubble.borderRadius,"px"),border:"".concat(c.style.bubble.strokeWidth,"px solid ").concat(c.style.bubble.stroke),backgroundColor:c.style.bubble.fill,color:c.style.bubble.color,fontFamily:c.style.bubble.fontFamily,fontSize:c.style.bubble.fontSize,padding:"4px 8px",textAlign:"center",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",maxWidth:"150px",minWidth:"50px",minHeight:"1em",pointerEvents:"auto",transform:n?"translate(0,-50%)":"translate(-50%,0)",cursor:n?"ns-resize":"ew-resize"};let y=c.style.bubble.stroke;const v=m?t("input",{type:"text",value:u,style:R(R({},g),{},{textAlign:"start",textOverflow:"",fontSize:"13px"}),onkeyup(e){if("Enter"===e.key){e.preventDefault(),e.stopPropagation();const t=parseFloat(e.target.value);isNaN(t)?(y="rgba(230, 78, 78, 0.6)",e.target.style.border="".concat(c.style.bubble.strokeWidth,"px solid ").concat(y)):c.onEditConfirmed(o,t,r)}else"Escape"===e.key&&(e.preventDefault(),e.stopPropagation(),c.onEditCanceled())}}):t("div",{"data-key":[c.key,"bubble",o,s].join("-"),"data-other-value":r,"data-idx":o,"data-bidx":s,style:g},[i]);return t("div",{style:{position:"absolute",[f]:"0",[n?"top":"left"]:"".concat(a,"px"),transform:p}},[v])}function Cc(e){let{h:t,isVertical:n,top:i,height:r,color:o,on:s,opacity:a}=e;return t("div",A({style:{backgroundColor:o,opacity:a,position:"absolute",left:n?0:"".concat(i,"px"),top:n?"".concat(i,"px"):0,height:n?"".concat(r,"px"):"100%",width:n?"100%":"".concat(r,"px"),pointerEvents:"auto"}},s),[])}function kc(e){let{borderHit:t,els:n,isVertical:i,state:r,vStart:o,vEnd:s,idx:a}=e,l=0;r.targetRect&&(l=i?r.targetRect.y:r.targetRect.x);const c=!!r.scale,u=c?r.scale.norm(o)*r.size:o,h=c?r.scale.norm(s)*r.size:s,d=Math.abs(u-h),f=Math.min(u,h)+l,p=f+d;if(r.targetRect){const e=r.targetFillRect||r.targetRect,t=i?e.height:e.width,a=c?r.scale.norm(o)*t:o,l=c?r.scale.norm(s)*t:s,u=Math.abs(a-l),h=Math.min(a,l),d={h:r.h,isVertical:i,top:h,height:u,color:r.style.target.fill,opacity:r.style.target.opacity};r.style.target.opacity<.8&&(d.on={onmouseover(e){e.srcElement.style.opacity=r.style.target.opacity+.1},onmouseout(e){e.srcElement.style.opacity=r.style.target.opacity}}),n.push(r.h("div",{style:{position:"absolute",left:"".concat(e.x,"px"),top:"".concat(e.y,"px"),height:"".concat(e.height,"px"),width:"".concat(e.width,"px")}},[Cc(d)]))}const m=u<h?o:s,g=u<h?s:o,[y,v]=c?r.scale.domain():[Math.min(o,s),Math.max(o,s)],b=m+1e-5>=y&&m-1e-5<=v,x=g-1e-5<=v&&g+1e-5>=y;b&&n.push(Sc({h:r.h,isVertical:i,borderHit:t,value:m,pos:f,align:"start",state:r,idx:a})),x&&n.push(Sc({h:r.h,isVertical:i,borderHit:t,value:g,pos:p,align:"end",state:r,idx:a}));const w=r.settings.bubbles;if(w&&w.show){const e={fontSize:w.fontSize,fontFamily:w.fontFamily,color:w.fill},t=[o,s];b&&n.push(_c({h:r.h,isVertical:i,align:w.align,style:e,rangeIdx:a,idx:0,otherValue:g,value:m,label:"".concat(r.format(m,t)),pos:f,state:r})),x&&n.push(_c({h:r.h,isVertical:i,align:w.align,style:e,rangeIdx:a,idx:1,otherValue:m,value:g,label:"".concat(r.format(g,t)),pos:p,state:r}))}}function Ec(e){const t=e.active.limitHigh-e.active.end,n=e.active.limitLow-e.active.start;let i=e.current-e.start;return i=i<0?Math.max(i,n):Math.min(i,t),i}function Ac(e){let t=[];const n=0===e.direction;if(Array.isArray(e.ranges)&&e.ranges.forEach(((i,r)=>{e.active&&r===e.active.idx||kc({borderHit:5,els:t,isVertical:n,state:e,vStart:Math.min(i.min,i.max),vEnd:Math.max(i.min,i.max),idx:r})})),e.active){let i=e.start,r=e.current;if(-1!==e.active.idx)if("foo"===e.active.mode)i=Math.min(e.active.start,e.active.end),r=Math.max(e.active.start,e.active.end);else if("modify"===e.active.mode)i=Math.min(e.start,e.current),r=Math.max(e.start,e.current);else{const t=Ec(e);i=e.active.start+t,r=e.active.end+t}kc({borderHit:5,els:t,isVertical:n,state:e,vStart:i,vEnd:r,idx:e.active.idx})}return t}function Tc(e){return{min:e.scale.min(),max:e.scale.max()}}function Ic(e){return{min:0,max:e.direction?e.rect.width:e.rect.height}}function Rc(e,t,n){let i,r,o=e.ranges,s=-1;for(i=0;i<o.length;i++){if(o[i].min<=t&&t<=o[i].max){s=i,n.min=i?o[i-1].max:n.min,n.max=i+1<o.length?o[i+1].min:n.max;break}if(t<o[i].min){n.max=o[i].min,n.min=i?o[i-1].max:n.min;break}}-1===s&&o.length&&i>=o.length&&(n.min=o[o.length-1].max),-1!==s&&(r={idx:s,start:o[s].min,end:o[s].max,limitLow:n.min,limitHigh:n.max,mode:"foo"}),e.active=r}function Nc(e){e.renderer.render(Ac(e))}function Oc(e,t){if(!t||!t.isActive())return[];const n=e.scale.data(),i=(n&&n.fields||[]).map((e=>e.id())),r=t.brushes().filter((e=>"range"===e.type&&-1!==i.indexOf(e.id)))[0];return r?r.brush.ranges():[]}function Pc(e,t){let n,i=1/0;const r=t.domain(),o=t.bandwidth()/2;for(let s=0;s<r.length;++s){const a=Math.abs(e-o-t(r[s]));a<i&&(i=a,n=r[s])}return n}function Lc(e,t){return Math.min(...e)<=Math.max(...t)&&Math.max(...e)>=Math.min(...t)}function Fc(e){return H(e.reduce(((e,t)=>(e.push(...j(t.bounds)),e)),[]))}const zc={require:["chart","settings","renderer"],defaultSettings:{settings:{bubbles:{show:!0,align:"start"}},style:{bubble:"$label-overlay",line:"$shape-guide--inverted",target:"$selection-area-target"}},renderer:"dom",on:{rangeStart(e){this.start(e)},rangeMove(e){this.move(e)},rangeEnd(e){this.end(e)},rangeClear(e){this.clear(e)},bubbleStart(e){this.bubbleStart(e)}},created(){this.state={key:this.settings.key||"brush-range"}},beforeRender(e){this.state.rect=e.size.computedInner},renderRanges(){this.state.started||(this.state.ranges=Oc(this.state,this.state.brushInstance),this.state.active=null,Nc(this.state))},render(e){const t=this.settings.settings;this.state.direction="vertical"===t.direction?0:1;const n=this.renderer.element().getBoundingClientRect(),i=this.state.rect[0===this.state.direction?"height":"width"];let r=Ms(this.chart.scale(t.scale),i);const o=function(e){const t={targetRect:null,targetFillRect:null,scale:null,size:null},n=e.settings.settings,i=n.target&&(n.target.components||(n.target.component?[n.target.component]:[])).map((t=>e.chart.component(t))).filter((e=>!!e&&!!e.rect)),r=n.target&&n.target.selector?e.chart.findShapes(n.target.selector):[],o=n.target&&n.target.fillSelector?e.chart.findShapes(n.target.fillSelector):[];if(r.length>0){const i=Fc(r);if(t.size=i[0===e.state.direction?"height":"width"],t.scale=Ms(e.chart.scale(n.scale),t.size),t.targetRect=i,o.length>0){const e=Fc(o);t.targetFillRect=e}}else if(i&&i.length>0){const n=i.slice(1).reduce(((e,t)=>({x0:Math.min(e.x0,t.rect.computedInner.x),y0:Math.min(e.y0,t.rect.computedInner.y),x1:Math.max(e.x1,t.rect.computedInner.x+t.rect.computedInner.width),y1:Math.max(e.y1,t.rect.computedInner.y+t.rect.computedInner.height)})),{x0:i[0].rect.computedInner.x,y0:i[0].rect.computedInner.y,x1:i[0].rect.computedInner.x+i[0].rect.computedInner.width,y1:i[0].rect.computedInner.y+i[0].rect.computedInner.height});t.targetRect={x:n.x0-e.state.rect.x,y:n.y0-e.state.rect.y,width:n.x1-n.x0,height:n.y1-n.y0}}return t}(this);if(r=o.scale?o.scale:r,this.state.targetRect=o.targetRect,this.state.targetFillRect=o.targetFillRect,this.state.size=null===o.size?i:o.size,this.state.settings=t,this.state.style=this.style,this.state.offset=n,this.state.brush="object"==typeof t.brush?t.brush.context:t.brush,this.state.brushInstance=this.chart.brush(this.state.brush),this.state.renderer=this.renderer,this.state.multi=!!t.multiple,this.state.h=e,this.state.onEditConfirmed=(e,t,n)=>{this.state.edit=null,function(e,t,n,i){let r=e.ranges.map((e=>({min:e.min,max:e.max})));const o=e.scale.min(),s=e.scale.max();r[t]={min:Math.max(o,Math.min(n,i)),max:Math.min(s,Math.max(n,i))},e.ranges[t]=R({},r[t]);const a=e.scale.data();a&&a.fields&&a.fields.forEach((t=>{e.fauxBrushInstance||e.brushInstance.setRange(t.id(),r)}))}(this.state,e,t,n),this.emit("bubbleEnd"),Nc(this.state)},this.state.onEditCanceled=()=>{this.state.edit=null,Nc(this.state)},this.state.cssCoord={offset:0===this.state.direction?"top":"left",coord:0===this.state.direction?"y":"x",pos:0===this.state.direction?"deltaY":"deltaX"},this.state.format="function"==typeof t.bubbles.label&&((e,n)=>t.bubbles.label.call(void 0,{datum:e,data:n,scale:r,resources:{scale:this.chart.scale,formatter:this.chart.formatter}})),{}.hasOwnProperty.call(r,"norm")){this.state.editable=!0,this.state.observeBrush="object"==typeof t.brush&&t.brush.observe,this.state.fauxBrushInstance=null,this.state.findValues=null,this.state.scale=r;const e=this.state.scale.data();!this.state.format&&e&&e.fields&&e.fields[0]&&(this.state.format=e.fields[0].formatter())}else this.state.editable=!1,this.state.scale=yo(),this.state.scale.data=r.data,this.state.format||(this.state.format=(e,t)=>Lc(r.range(),t)?function(e,t){const n=t.ticks(),i=t.domain().indexOf(Pc(e,t));return-1!==i?n[i].label:"-"}(e,r):"-"),this.state.fauxBrushInstance=fs(),this.state.findValues=e=>function(e,t){const n=t.domain(),i=t.range(),r=[];return e.forEach((e=>{if(!Lc(i,[e.min,e.max]))return;const o=n.indexOf(Pc(e.min,t)),s=n.indexOf(Pc(e.max,t));r.push.apply(r,n.slice(Math.min(o,s),Math.max(o,s)+1))})),r}(e,r);return this.state.ranges=Oc(this.state,this.state.brushInstance),this.state.observeBrush||this.state.sourcedFromThisComponent?[Ac(this.state)]:[]},mounted(){this.state.observeBrush&&this.state.brushInstance&&this.state.brushInstance.on("update",this.renderRanges)},beforeDestroy(){this.state.observeBrush&&this.state.brushInstance&&this.state.brushInstance.removeListener("update",this.renderRanges)},start(e){!function(e){let{state:t,e:n,renderer:i,ranges:r,targetSize:o}=e;if(t.started)return;t.edit=null;const s=n.center.x-n.deltaX,a=n.center.y-n.deltaY;let l=document.elementFromPoint(s,a);i.element().contains(l)||(l=null);const c={started:!0};t.offset=A({},i.element().getBoundingClientRect());const u=s-t.offset.left,h=a-t.offset.top;t.offset.left+=t.targetRect?t.targetRect.x:0,t.offset.top+=t.targetRect?t.targetRect.y:0,t.ranges=r(t,t.fauxBrushInstance||t.brushInstance);const d=n.center[t.cssCoord.coord]-n[t.cssCoord.pos]-t.offset[t.cssCoord.offset],f=n.center[t.cssCoord.coord]-t.offset[t.cssCoord.offset];c.current=t.scale.normInvert(f/t.size),c.start=t.scale.normInvert(d/t.size);let p=t.ranges;const m=Tc(t);let g,y,v=-1;if(l&&l.hasAttribute("data-idx"))v=parseInt(l.getAttribute("data-idx"),10),m.min=v>0?p[v-1].max:m.min,m.max=v+1<p.length?p[v+1].min:m.max;else{for(g=0;g<p.length;g++){if(p[g].min<=c.start&&c.start<=p[g].max){v=g,m.min=g?p[g-1].max:m.min,m.max=g+1<p.length?p[g+1].min:m.max;break}if(c.start<p[g].min){m.max=p[g].min,m.min=g?p[g-1].max:m.min;break}}-1===v&&p.length&&g>=p.length&&(m.min=p[p.length-1].max)}if(-1!==v||t.multi||(c.ranges=[],m.min=t.scale.min(),m.max=t.scale.max()),-1!==v)if(y={idx:v,start:p[v].min,end:p[v].max,limitLow:m.min,limitHigh:m.max,mode:"move"},l&&l.hasAttribute("data-other-value"))c.start=parseFloat(l.getAttribute("data-other-value")),y.mode="modify";else{let e=t.scale.norm(y.start)*t.size,n=t.scale.norm(y.end)*t.size;Math.abs(d-e)<=o?(c.start=y.end,y.mode="modify"):Math.abs(d-n)<=o&&(c.start=y.start,y.mode="modify")}else y={idx:-1,start:c.start,end:c.current,limitLow:m.min,limitHigh:m.max,mode:"current"};c.active=y,"modify"!==y.mode&&t.targetRect&&!Ma(t.targetRect,{x:u,y:h})||Object.keys(c).forEach((e=>t[e]=c[e]))}({e:e,state:this.state,renderer:this.renderer,ranges:Oc,targetSize:5})},end(){this.state.started&&(!function(e,t){e.started=!1,e.ranges=t(e,e.fauxBrushInstance||e.brushInstance);const n=Tc(e);Rc(e,e.current,n)}(this.state,Oc),Nc(this.state),this.state.sourcedFromThisComponent=!0,this.state.active=null)},move(e){this.state.started&&(!function(e,t){const n=(t.center[e.cssCoord.coord]-e.offset[e.cssCoord.offset])/e.size,i=e.scale.normInvert(n);e.current=Math.max(Math.min(i,e.active.limitHigh),e.active.limitLow)}(this.state,e),function(e){let t=e.ranges.map((e=>({min:e.min,max:e.max})));if(-1!==e.active.idx)if("modify"===e.active.mode)t[e.active.idx].min=Math.min(e.start,e.current),t[e.active.idx].max=Math.max(e.start,e.current);else{const n=Ec(e);t[e.active.idx].min+=n,t[e.active.idx].max+=n}else t.push({min:Math.min(e.start,e.current),max:Math.max(e.start,e.current)});const n=e.scale.data();n&&n.fields&&n.fields.forEach((n=>{if(e.fauxBrushInstance){let i=Oc(e,e.fauxBrushInstance),r=e.findValues(i),o=e.findValues(t),s=o.filter((e=>-1===r.indexOf(e))),a=r.filter((e=>-1===o.indexOf(e))),l=s.map((e=>({key:n.id(),value:e}))),c=a.map((e=>({key:n.id(),value:e})));e.brushInstance.addAndRemoveValues(l,c),e.fauxBrushInstance.setRange(n.id(),t)}else e.brushInstance.setRange(n.id(),t)}))}(this.state),Nc(this.state))},clear(){this.state.fauxBrushInstance&&this.state.fauxBrushInstance.clear(),this.state.renderer.render([]),this.state.started=!1,this.state.active=null,this.state.sourcedFromThisComponent=!1},bubbleStart(e){if(!this.state.editable)return;const t=e.srcEvent||e,n=t.target,i={rangeIdx:parseInt(n.getAttribute("data-idx"),10),bubbleIdx:parseInt(n.getAttribute("data-bidx"),10)};if(isNaN(i.rangeIdx)||JSON.stringify(i)===JSON.stringify(this.state.edit))return;this.state.edit=i,t.stopPropagation(),t.stopImmediatePropagation(),t.preventDefault();const r=n.parentNode;Nc(this.state);const o=r.querySelector("input");o.focus(),o.select()}};function jc(e){e.renderer.render(Ac(e))}function Hc(e){return e.rc.ranges()}function Bc(e,t){const n={x:e.direction?t.min+e.rect.x:e.rect.x,y:e.direction?e.rect.y:t.min+e.rect.y,width:e.direction?t.max-t.min:e.rect.width+e.rect.x,height:e.direction?e.rect.height+e.rect.y:t.max-t.min};return e.chart.shapesAt(n,e.settings.brush)}const Vc={require:["chart","settings","renderer"],defaultSettings:{settings:{bubbles:{show:!0,align:"start"}},style:{bubble:"$label-overlay",line:"$shape-guide--inverted",target:"$selection-area-target"}},renderer:"dom",on:{areaStart(e){this.start(e)},areaMove(e){this.move(e)},areaEnd(e){this.end(e)},areaClear(e){this.clear(e)}},created(){this.state={key:this.settings.key||"brush-area-dir"}},render(e){this.state.rect=this.rect;const t=this.settings.settings,n="vertical"===t.direction?0:1,i=this.state.rect[0===n?"height":"width"],r=this.renderer.element().getBoundingClientRect(),o=(t.target?t.target.components||[t.target.component]:[]).map((e=>this.chart.component(e))).filter((e=>!!e&&!!e.rect)),s=o[0]?o.slice(1).reduce(((e,t)=>({x0:Math.min(e.x0,t.rect.x),y0:Math.min(e.y0,t.rect.y),x1:Math.max(e.x1,t.rect.x+t.rect.width),y1:Math.max(e.y1,t.rect.y+t.rect.height)})),{x0:o[0].rect.x,y0:o[0].rect.y,x1:o[0].rect.x+o[0].rect.width,y1:o[0].rect.y+o[0].rect.height}):null;return this.state.targetRect=s?{x:s.x0-this.rect.x,y:s.y0-this.rect.y,width:s.x1-s.x0,height:s.y1-s.y0}:null,this.state.style=this.style,this.state.chart=this.chart,this.state.direction=n,this.state.settings=t,this.state.offset=r,this.state.rc=Qo(),this.state.renderer=this.renderer,this.state.multi=!!t.multiple,this.state.h=e,this.state.size=i,this.state.cssCoord={offset:0===this.state.direction?"top":"left",coord:0===this.state.direction?"y":"x",pos:0===this.state.direction?"deltaY":"deltaX",area:0===this.state.direction?"height":"width"},this.state.format=function(e,t){return function(e,t,n){const i=Math.min(...n),r=Math.max(...n),o={x:e.direction?i+e.rect.x:e.rect.x,y:e.direction?e.rect.y:i+e.rect.y,width:e.direction?r-i:e.rect.width+e.rect.x,height:e.direction?e.rect.height+e.rect.y:r-i},s=e.chart.shapesAt(o,e.settings.brush);if(0===s.length)return"-";const a=s.reduce(((n,r)=>{const o=n.bounds,s=r.bounds;return t===i?o[e.cssCoord.coord]<=s[e.cssCoord.coord]?n:r:o[e.cssCoord.coord]+o[e.cssCoord.area]>=s[e.cssCoord.coord]+s[e.cssCoord.area]?n:r})),l=e.settings.brush.components.reduce(((e,t)=>e.key===a.key?e:t));return"function"==typeof e.settings.bubbles.label?e.settings.bubbles.label(a.data):Array.isArray(l.data)&&l.data.length?a.data[l.data[0]].label:a.data&&a.data.label?a.data.label:"-"}(this,e,t)},[]},start(e){!function(e){let{state:t,e:n,renderer:i,ranges:r,targetSize:o}=e;if(t.started)return;const s=n.center.x-n.deltaX,a=n.center.y-n.deltaY;let l=document.elementFromPoint(s,a);i.element().contains(l)||(l=null);const c={started:!0};t.offset=i.element().getBoundingClientRect(),t.ranges=r(t);const u=s-t.offset.left,h=a-t.offset.top,d=n.center[t.cssCoord.coord]-n[t.cssCoord.pos]-t.offset[t.cssCoord.offset],f=n.center[t.cssCoord.coord]-t.offset[t.cssCoord.offset];let p=f,m=d;c.start=d,c.current=f;let g=t.ranges;const y=Ic(t);let v,b,x=-1;if(l&&l.hasAttribute("data-idx"))x=parseInt(l.getAttribute("data-idx"),10),y.min=x>0?g[x-1].max:y.min,y.max=x+1<g.length?g[x+1].min:y.max;else{for(v=0;v<g.length;v++){if(g[v].min<=m&&m<=g[v].max){x=v,y.min=v?g[v-1].max:y.min,y.max=v+1<g.length?g[v+1].min:y.max;break}if(m<g[v].min){y.max=g[v].min,y.min=v?g[v-1].max:y.min;break}}-1===x&&g.length&&v>=g.length&&(y.min=g[g.length-1].max)}if(-1!==x||t.multi||(c.ranges=[],y.min=0,y.max=t.direction?t.rect.width:t.rect.height),-1!==x)if(b={idx:x,start:g[x].min,end:g[x].max,limitLow:y.min,limitHigh:y.max,mode:"move"},l&&l.hasAttribute("data-other-value"))c.start=parseFloat(l.getAttribute("data-other-value")),b.mode="modify";else{let e=b.start,t=b.end;Math.abs(d-e)<=o?(c.start=b.end,b.mode="modify"):Math.abs(d-t)<=o&&(c.start=b.start,b.mode="modify")}else b={idx:-1,start:m,end:p,limitLow:y.min,limitHigh:y.max,mode:"current"};c.active=b,"modify"!==b.mode&&t.targetRect&&!Ma(t.targetRect,{x:u,y:h})||Object.keys(c).forEach((e=>t[e]=c[e]))}({e:e,state:this.state,renderer:this.renderer,ranges:Hc,targetSize:5})},end(){this.state.started&&(!function(e,t){e.started=!1,e.ranges=t(e);const n=Ic(e);Rc(e,e.current,n)}(this.state,Hc),jc(this.state))},move(e){this.state.started&&(!function(e,t){const n=t.center[e.cssCoord.coord]-e.offset[e.cssCoord.offset];e.current=Math.max(Math.min(n,e.active.limitHigh),e.active.limitLow)}(this.state,e),function(e){const t=e.ranges.map((e=>({min:e.min,max:e.max})));if(-1!==e.active.idx)if("modify"===e.active.mode)t[e.active.idx].min=Math.min(e.start,e.current),t[e.active.idx].max=Math.max(e.start,e.current);else{const n=Ec(e);t[e.active.idx].min=e.active.start+n,t[e.active.idx].max=e.active.end+n}else t.push({min:Math.min(e.start,e.current),max:Math.max(e.start,e.current)});e.rc.set(t);let n=[];t.forEach((t=>{n=[...n,...Bc(e,t)]})),function(e,t){e.chart.brushFromShapes(t,e.settings.brush)}(e,n)}(this.state),jc(this.state))},clear(){this.state.rc&&this.state.rc.clear(),this.state.renderer.render([])}};function $c(e){const t="vertical"===e.direction,n=e.rect[t?"height":"width"],i=e.rect[t?"width":"height"];return function(e){const t=e.brush;if(!t||!t.isActive())return[];const n=e.scale.data(),i=(n&&n.fields||[]).map((e=>e.id())),r=t.brushes().filter((e=>"range"===e.type&&-1!==i.indexOf(e.id)))[0];return r?r.brush.ranges():[]}(e).map((r=>{const o=e.scale(r.min)*n,s=e.scale(r.max)*n,a=Math.min(o,s),l=Math.abs(o-s);return{type:"rect",fill:e.fill,opacity:e.opacity,x:t?0:a,width:t?i:l,y:t?a:0,height:t?l:i}}))}function Wc(e,t,n,i){function r(){!function(e){e.renderer.render($c(e))}(e)}function o(){!function(e){e.renderer.render($c(e))}(e)}function s(){!function(e){e.renderer.render($c(e))}(e)}e.brush=t,t&&(t.on("start",r),t.on("update",o),t.on("end",s),e.start=r,e.update=o,e.end=s,e.brush=t,e.scale=n,e.renderer=i)}function Uc(e){e.brush&&(e.brush.removeListener("start",e.start),e.brush.removeListener("update",e.update),e.brush.removeListener("end",e.end)),e.start=void 0,e.update=void 0,e.end=void 0,e.brush=void 0,e.scale=void 0,e.renderer=void 0}const Yc={require:["chart","settings","renderer"],defaultSettings:{settings:{}},preferredSize:()=>50,created(){this.state={}},render(){const e=this.settings.settings,t=this.chart.brush(e.brush),n=e.direction||"horizontal",i="horizontal"===n?this.rect.width:this.rect.height,r=Ms(this.chart.scale(e.scale),i);return Uc(this.state),Wc(this.state,t,r,this.renderer),this.state.rect=this.rect,this.state.fill=e.fill||"#ccc",this.state.opacity=void 0!==e.opacity?e.opacity:1,this.state.direction=n,$c(this.state)},beforeDestroy(){Uc(this.state)}};function Xc(e,t){const n=t.center.x,i=t.center.y;return{x:n-e.left,y:i-e.top}}function Kc(e,t,n){return $s(e,t.points[0])<n.settings.snapIndicator.threshold**2}function Gc(e,t){null==e.path.d?e.path.d="M".concat(t.x," ").concat(t.y," "):e.path.d+="L".concat(t.x," ").concat(t.y," "),e.points.push(t)}function Jc(e){let{state:t,start:n=null,end:i=null}=e;null!==n&&(t.snapIndicator.x1=n.x,t.snapIndicator.y1=n.y),null!==i&&(t.snapIndicator.x2=i.x,t.snapIndicator.y2=i.y)}function Zc(e,t){e.snapIndicator.visible=t}const Qc={require:["chart","renderer","settings"],defaultSettings:{layout:{displayOrder:0},settings:{brush:{components:[]},snapIndicator:{threshold:75,strokeDasharray:"5, 5",stroke:"black",strokeWidth:2,opacity:.5},lasso:{fill:"transparent",stroke:"black",strokeWidth:2,opacity:.7,strokeDasharray:"20, 10"},startPoint:{r:10,fill:"green",stroke:"black",strokeWidth:1,opacity:1}}},on:{lassoStart(e){this.start(e)},lassoEnd(e){this.end(e)},lassoMove(e){this.move(e)},lassoCancel(){this.cancel()}},created(){this.state={points:[],active:!1,path:null,snapIndicator:null,startPoint:null,rendererBounds:null,componentDelta:null,brushConfig:null,lineBrushShape:{x1:0,y1:0,x2:0,y2:0}}},start(e){var t;this.state.active=!0,this.state.path={visible:!0,type:"path",d:null,fill:(t=this.settings.settings.lasso).fill,stroke:t.stroke,strokeWidth:t.strokeWidth,opacity:t.opacity,strokeDasharray:t.strokeDasharray,collider:{type:null}},this.state.snapIndicator=function(e){return{visible:!1,type:"line",x1:0,y1:0,x2:0,y2:0,strokeDasharray:e.strokeDasharray,stroke:e.stroke,strokeWidth:e.strokeWidth,opacity:e.opacity,collider:{type:null}}}(this.settings.settings.snapIndicator),this.state.startPoint=function(e){return{visible:!0,type:"circle",cx:0,cy:0,r:e.r,fill:e.fill,opacity:e.opacity,stroke:e.stroke,strokeWidth:e.strokeWidth,collider:{type:null}}}(this.settings.settings.startPoint),this.state.rendererBounds=this.renderer.element().getBoundingClientRect(),this.state.componentDelta=function(e,t){const n=e.element.getBoundingClientRect();return{x:t.left-n.left,y:t.top-n.top}}(this.chart,this.state.rendererBounds),this.state.brushConfig=function(e){return e.settings.brush.components.map((e=>({key:e.key,contexts:e.contexts||["lassoBrush"],data:e.data||[""],action:e.action||"add"})))}(this.settings);const n=Xc(this.state.rendererBounds,e);Gc(this.state,n),Jc({state:this.state,start:n}),function(e,t){e.startPoint.cx=t.x,e.startPoint.cy=t.y}(this.state,n)},move(e){if(!this.state.active)return;const t=Xc(this.state.rendererBounds,e);Kc(t,this.state,this.settings)?Zc(this.state,!0):Zc(this.state,!1),Gc(this.state,t),Jc({state:this.state,end:t}),function(e,t){const n=[e.startPoint,e.path,e.snapIndicator].filter((e=>e.visible));t.render(n)}(this.state,this.renderer),function(e,t){if(e.active){const n=e.points[e.points.length-2],i=e.points[e.points.length-1];e.lineBrushShape.x1=n.x+e.componentDelta.x,e.lineBrushShape.y1=n.y+e.componentDelta.y,e.lineBrushShape.x2=i.x+e.componentDelta.x,e.lineBrushShape.y2=i.y+e.componentDelta.y;const r=t.shapesAt(e.lineBrushShape,{components:e.brushConfig});t.brushFromShapes(r,{components:e.brushConfig})}}(this.state,this.chart)},end(e){if(!this.state.active)return;Zc(this.state,!1);Kc(Xc(this.state.rendererBounds,e),this.state,this.settings)&&function(e,t){if(e.active){const n=e.componentDelta.x,i=e.componentDelta.y,r=e.points.map((e=>({x:e.x+n,y:e.y+i}))),o=t.shapesAt({vertices:r},{components:e.brushConfig});t.brushFromShapes(o,{components:e.brushConfig})}}(this.state,this.chart),this.state={points:[],active:!1,path:null,snapIndicator:null,startPoint:null,rendererBounds:null,componentDelta:null,brushConfig:null,lineBrushShape:{x1:0,y1:0,x2:0,y2:0}},this.renderer.render([])},cancel(){this.state.active&&(!function(e,t){e.brushConfig.forEach((e=>{e.contexts.forEach((e=>{t.brush(e).end()}))}))}(this.state,this.chart),this.state={points:[],active:!1,path:null,snapIndicator:null,startPoint:null,rendererBounds:null,componentDelta:null,brushConfig:null,lineBrushShape:{x1:0,y1:0,x2:0,y2:0}},this.renderer.render([]))},render(){}};function eu(e,t,n,i,r){let o,s=0,a=t.length-1;for(;s<a;){let l=Math.floor((s+a)/2);o=r(t[l]),o[n]+o[i]<e[n]?s=l+1:a=l}return s}function tu(e){let{orientation:t,targetNodes:n,labels:i,container:r}=e,o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:eu;const s=[],a="v"===t?"x":"y",l="v"===t?"width":"height",c=e=>e.textBounds,u=e=>e.node.localBounds;return(e,t)=>{const{textBounds:h,node:d}=i[t];if(h[a]<r[a]||h[a]+h[l]>r[a]+r[l])return!1;for(let e=o(h,s,a,l,c);e<s.length;e++)if(wa(h,s[e].textBounds))return!1;const f=o(h,n,a,l,u),p=h[a]+h[l];for(let e=f;e<n.length;e++){const t=n[e].node;if(p<t.localBounds[a])break;if(wa(h,t.localBounds)&&d!==t)return!1}return s.push(i[t]),!0}}const nu=4;function iu(e,t){return{node:e,data:e.data,scale:t.scale,formatter:t.formatter,dataset:t.dataset}}function ru(e){const t=typeof e;return("string"===t||"number"===t)&&""!==e}function ou(e){return R(R({type:"rect",rx:2,ry:2,fill:e.backgroundColor},e.backgroundBounds),{},{data:"".concat(e.data," ").concat(e.text),rotation:e.transform&&e.transform.match(/rotate/gi)?"rotated":"horizontal"})}function su(e,t,n){return n?e.width>=t.height:e.width>=t.width}function au(e,t,n){return n?e.height>=t.width:e.height>=t.height}function lu(e,t,n,i,r){let o,s;return"v"===e?(o=i||r||su(t,n,!0),s=au(t,n,!i)):(o=su(t,n),s=r||au(t,n,!1)),o&&s}function cu(e,t,n,i){return e+.5*t+(i-.5)*(t-n)-.5*n}function uu(e,t,n){const i={type:"text",text:t,maxWidth:n.rotate?e.height:e.width,x:0,y:e.y,dx:0,dy:0,fill:n.fill,anchor:n.rotate?"end":"start",baseline:"central",fontSize:"".concat(n.fontSize,"px"),fontFamily:n.fontFamily},r=n.textMetrics;if(!n.overflow&&!function(e,t,n){return su(e,t,n.rotate)&&au(e,t,n.rotate)}(e,r,n))return!1;const o=.5*r.height;return n.rotate?(i.x=cu(e.x,e.width,r.height,n.align)+o,i.y=cu(e.y,e.height,r.width,n.justify),i.transform="rotate(-90, ".concat(i.x+i.dx,", ").concat(i.y+i.dy,")")):(i.x=cu(e.x,e.width,r.width,n.align),i.y=cu(e.y,e.height,r.height,n.justify)+o),i}function hu(e){let{bar:t,view:n,direction:i,position:r,padding:o=nu}=e;const s={};if(A(s,t),r&&"inside"!==r)if("up"===i||"down"===i){const e=Math.max(0,Math.min(t.y,n.height)),o=Math.max(0,Math.min(t.y+t.height,n.height));"outside"===r&&"up"===i||"opposite"===r&&"down"===i?(s.y=0,s.height=e):("outside"===r&&"down"===i||"opposite"===r&&"up"===i)&&(s.y=o,s.height=n.height-o)}else{const e=Math.max(0,Math.min(t.x,n.width)),o=Math.max(0,Math.min(t.x+t.width,n.width));"outside"===r&&"left"===i||"opposite"===r&&"right"===i?(s.x=0,s.width=e):("outside"===r&&"right"===i||"opposite"===r&&"left"===i)&&(s.x=o,s.width=n.width-o)}else;return function(e,t){const n=Math.max(0,Math.min(e.y,t.height)),i=Math.max(0,Math.min(e.y+e.height,t.height)),r=Math.max(0,Math.min(e.x,t.width)),o=Math.max(0,Math.min(e.x+e.width,t.width));e.x=r,e.width=o-r,e.y=n,e.height=i-n}(s,n),function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const{top:n=nu,bottom:i=nu,left:r=nu,right:o=nu}=t;e.x+=r,e.width-=r+o,e.y+=n,e.height-=n+i}(s,o),s}function du(e){let t,n,i,r,o,{direction:s,fitsHorizontally:a,measured:l,node:c,orientation:u,placementSettings:h,rect:d}=e,f=arguments.length>1&&void 0!==arguments[1]?arguments[1]:hu;const p=[],m="h"===u?"width":"height";for(o=0;o<h.length;o++)if(i=h[o],r=f({bar:c.localBounds,view:d,direction:s,position:i.position,padding:i.padding}),p.push(r),t=!o||r[m]>t[m]?r:t,lu(u,r,l,a,i.overflow)){n=r;break}return n||(n=t,o=p.indexOf(n)),i=h[o],{bounds:n,placement:i}}function fu(e,t,n,i){let r=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{};const{top:o=nu,bottom:s=nu,left:a=nu,right:l=nu}=r,c=e.x+e.dx,u=e.y+e.dy,h=n?Math.min(t.width,i.height):Math.min(t.height,i.width),d=n?Math.min(t.height,i.height):Math.min(t.width,i.width),f=.5*t.height,p=1e-9,m=n?c-f:c,g=n?u:u-f,y={x:m-a-p,y:g-o-p,width:d+(a+l)-p,height:h+(o+s)-p};return y}function pu(e){let{chart:t,targetNodes:n,rect:i,fitsHorizontally:r,collectiveOrientation:o}=e,s=arguments.length>1&&void 0!==arguments[1]?arguments[1]:du,a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:uu,l=arguments.length>3&&void 0!==arguments[3]?arguments[3]:tu;const c=[],u={container:i,targetNodes:n,labels:[],orientation:o};let h,d,f,p,m,g,y,v,b,x,w,q,M,D;for(let e=0,l=n.length;e<l;e++){g=null,d=n[e],f=d.node,M=iu(f,t),b=d.direction,D="left"===b||"right"===b?"h":"v";for(let t=0;t<d.texts.length;t++){if(p=d.texts[t],!ru(p))continue;x=d.labelSettings[t],v=d.measurements[t],q=x.placements;const n=s({direction:b,fitsHorizontally:r,lblStngs:x,measured:v,node:f,orientation:D,placements:q,placementSettings:d.placementSettings[t],rect:i});if(g=n.bounds,w=n.placement,g&&w){m=w.justify;const t="function"==typeof x.linkData?x.linkData(M,e):void 0,n="function"==typeof w.overflow?w.overflow(M,e):w.overflow;"up"===b&&(m=1-m),"opposite"===w.position&&(m=1-m),"left"===b&&(m=1-m);const i=!("h"===o||r);if(h=a(g,p,{justify:"h"===D?w.align:m,align:"h"===D?m:w.align,fontSize:x.fontSize,fontFamily:x.fontFamily,textMetrics:v,rotate:i,overflow:!!n}),h){const n=fu(h,v,i,g,w.padding);y="function"==typeof w.fill?w.fill(R(R({},M),{},{textBounds:n}),e):w.fill,h.fill=y,void 0!==t&&(h.data=t),"object"==typeof w.background&&(h.backgroundColor="function"==typeof w.background.fill?w.background.fill(R(R({},M),{},{textBounds:n}),e):w.background.fill,void 0!==h.backgroundColor&&(h.backgroundBounds=fu(h,v,i,g,w.background.padding))),c.push(h),u.labels.push({node:f,textBounds:n})}}}}const S=c.filter(l(u)),_=S.filter((e=>void 0!==e.backgroundBounds)).map(ou);return[..._,...S]}function mu(e){let{nodes:t,rect:n,chart:i,labelSettings:r,placementSettings:o,settings:s,renderer:a}=e;const l={},c=[];let u,h,d,f,p,m,g,y=!0,v=!1;for(let e=0;e<t.length;e++){if(h=t[e],f=h.localBounds,!wa(f,n))continue;let b=iu(h,i);u={node:h,texts:[],measurements:[],labelSettings:[],placementSettings:[]};for(let t=0;t<r.length;t++)m=r[t],d="function"==typeof m.label?m.label(b,e):void 0,ru(d)&&(g="function"==typeof s.direction?s.direction(b,e):s.direction||"up",v=v||"left"===g||"right"===g,l.fontFamily=m.fontFamily,l.fontSize="".concat(m.fontSize,"px"),l.text=d,p=a.measureText(l),u.measurements.push(p),u.texts.push(d),u.labelSettings.push(m),u.placementSettings.push(o[t]),u.direction=g,y=y&&p.width<=f.width-2*nu);c.push(u)}return{targetNodes:c,fitsHorizontally:y,hasHorizontalDirection:v}}function gu(e){let{orientation:t="auto",defaultOrientation:n="h"}=e;switch(t.toLocaleLowerCase()){case"vertical":return"v";case"horizontal":return"h";default:return n}}function yu(e){const t=2*Math.PI;return(e%t+t)%t}function vu(e,t){e.x+=t,e.width-=2*t,e.y+=t,e.height-=2*t}function bu(e){return{x:e.x,y:e.y-e.height/2,width:e.width,height:e.height}}function xu(e,t,n){let{x:i,y:r}=t;if(i*i+r*r>e*e)return null;let o=Math.sin(n),s=Math.cos(n),a=i*s-r*o,l=e*e-a*a;if(l<0)return null;let c=Math.sqrt(l);return{x:a*s+o*c,y:-a*o+s*c}}function wu(e){let t,n,{radius:i,size:r,angle:o}=e,{width:s,height:a}=r,l={x:s/2,y:a/2};switch(Math.floor(o/(Math.PI/2))){case 0:if(t=xu(i,l,o),!t)return null;t.y*=-1,n={x:-s,y:0};break;case 1:if(t=xu(i,l,Math.PI-o),!t)return null;n={x:-s,y:-a};break;case 2:if(t=xu(i,l,o-Math.PI),!t)return null;t.x*=-1,n={x:0,y:-a};break;case 3:if(t=xu(i,l,2*Math.PI-o),!t)return null;t.x*=-1,t.y*=-1,n={x:0,y:0};break;default:throw new Error("invalid angle")}return{x:t.x+n.x,y:t.y+n.y,width:s,height:a}}function qu(e){let{slice:t,measured:n,padding:i}=e,{start:r,end:o,innerRadius:s,outerRadius:a}=t,l=a-s-2*i,c=o-r;if(c<Math.PI){let e=(n.height/2+i)/Math.tan(c/2);e>s&&(l=a-e-2*i)}if(l<0||l<n.minReqWidth)return null;const u=yu((r+o)/2);let h=a-i,d={x:Math.sin(u)*h,y:-Math.cos(u)*h,width:l,height:n.height};return u<Math.PI?(d.angle=u-Math.PI/2,d.anchor="end"):(d.angle=u+Math.PI/2,d.anchor="start"),d}function Mu(e){let{context:t,node:n,bounds:i}=e;let{start:r,end:o}=n.desc.slice;const s=yu((r+o)/2);switch(Math.floor(s/(Math.PI/2))){case 0:t.q1maxY=i.y-2,void 0===t.q2minY&&(t.q2minY=i.y+i.height+2);break;case 1:t.q2minY=i.y+i.height+2;break;case 2:t.q3minY=i.y+i.height+2;break;case 3:t.q4maxY=i.y-2,void 0===t.q3minY&&(t.q3minY=i.y+i.height+2)}}function Du(e,t){return{node:e,data:e.data,scale:t.scale,formatter:t.formatter,dataset:t.dataset}}function Su(e,t,n){const i={type:"text",text:t,maxWidth:e.width,x:e.x,y:e.y+("top"===e.baseline?e.height/2:0),fill:n.fill,anchor:e.anchor||"start",baseline:"middle",fontSize:"".concat(n.fontSize,"px"),fontFamily:n.fontFamily};if(!isNaN(e.angle)){let t=e.angle*(360/(2*Math.PI));i.transform="rotate(".concat(t,", ").concat(i.x,", ").concat(i.y,")")}return i}function _u(e){let t,n,{slice:i,direction:r,position:o,padding:s,measured:a,view:l,context:c,store:u}=e,{start:h,end:d,innerRadius:f,offset:p}=i;switch(o){case"into":t="rotate"===r?qu({slice:i,measured:a,padding:s}):function(e){let{slice:t,padding:n,measured:i}=e,{start:r,end:o,innerRadius:s,outerRadius:a}=t;const l=yu((r+o)/2);let c=wu({radius:a,size:{width:i.width+2*n+1,height:i.height+2*n},angle:l});return c?(c.baseline="top",Da(c,{x1:0,y1:0,x2:Math.sin(r)*a,y2:-Math.cos(r)*a})||Da(c,{x1:0,y1:0,x2:Math.sin(o)*a,y2:-Math.cos(o)*a})||ma({cx:0,cy:0,r:s},c)?null:(vu(c,n),c)):null}({slice:i,measured:a,padding:s});break;case"inside":n={start:h,end:d,innerRadius:0,outerRadius:f},t="rotate"===r?qu({slice:n,measured:a,padding:s}):function(e){let{slice:t,padding:n,measured:i,store:r}=e;const{start:o,end:s,outerRadius:a}=t,l=yu((o+s)/2);let c=wu({radius:a,size:{width:i.width+2*n+1,height:i.height+2*n},angle:l});return c?(c.baseline="top",vu(c,n),r.insideLabelBounds.some((e=>wa(e,c)))?null:(r.insideLabelBounds.push({x:c.x-4,y:c.y,width:c.width+8,height:c.height}),c)):null}({slice:n,measured:a,padding:s,store:u});break;case"outside":t="rotate"===r?function(e){let{slice:t,measured:n,padding:i,view:r}=e,{start:o,end:s,outerRadius:a,offset:l}=t,c=a+i,u=s-o;if(u<Math.PI&&(n.height/2+i)/Math.tan(u/2)>c)return null;const h=yu((o+s)/2);let d=Math.sin(h)*c,f=-Math.cos(h)*c,p=n.width+1,m=h%Math.PI;if(m>Math.PI/2&&(m=Math.PI-m),Math.cos(m)>.001){let e=f<0?r.y:r.y+r.height,t=Math.abs(e-l.y)/Math.cos(m)-Math.tan(m)*(n.height/2)-2*i-a;t<p&&(p=t)}if(Math.sin(m)>.001){let e=d<0?r.x:r.x+r.width,t=Math.abs(e-l.x)/Math.sin(m)-n.height/2/Math.tan(m)-2*i-a;t<p&&(p=t)}if(p<=0||p<n.minReqWidth)return null;let g={x:d,y:f,width:p,height:n.height};return h<Math.PI?(g.angle=h-Math.PI/2,g.anchor="start"):(g.angle=h+Math.PI/2,g.anchor="end"),g}({slice:i,measured:a,padding:s,view:l}):function(e){let{slice:t,measured:n,padding:i,view:r,context:o}=e,{start:s,end:a,outerRadius:l,offset:c}=t;const u=yu((s+a)/2);if(function(e,t,n){switch(t){case 0:return e.q1maxY<0;case 1:return e.q2minY>n.height;case 2:return e.q3minY>n.height;case 3:return e.q4maxY<0;default:return!0}}(o,Math.floor(u/(Math.PI/2)),r))return null;let h=l+i+n.height/2,d=Math.sin(u)*h,f=-Math.cos(u)*h,p=n.width+1;if(u<Math.PI){let e=Math.abs(r.x+r.width-(d+c.x));e<p&&(p=e)}else{let e=Math.abs(r.x-(d+c.x));e<p&&(p=e)}if(p<n.minReqWidth)return null;let m={x:d,y:f,width:p,height:n.height};return u<Math.PI?m.anchor="start":m.anchor="end",m}({slice:i,measured:a,padding:s,view:l,context:c});break;default:throw new Error("not implemented")}return t&&(t.x+=p.x,t.y+=p.y,"outside"===o&&"rotate"!==r&&function(e,t,n){const{start:i,end:r,offset:o,outerRadius:s}=n,a=yu((i+r)/2);switch(Math.floor(a/(Math.PI/2))){case 0:if(void 0!==t.q1maxY){let n=Math.min(e.y,t.q1maxY-e.height),i=e.y-n;if(e.y=n,i>1){let t=s+2;e.line={type:"line",x1:e.x-2,y1:e.y+2,x2:o.x+Math.sin(a)*t,y2:o.y-Math.cos(a)*t,strokeWidth:1}}}break;case 1:if(void 0!==t.q2minY){let n=Math.max(e.y,t.q2minY),i=n-e.y;if(e.y=n,i>1){let t=s+2;e.line={type:"line",x1:e.x-2,y1:e.y-2,x2:o.x+Math.sin(a)*t,y2:o.y-Math.cos(a)*t,strokeWidth:1}}}break;case 2:if(void 0!==t.q3minY){let n=Math.max(e.y,t.q3minY),i=n-e.y;if(e.y=n,i>1){let t=s+2;e.line={type:"line",x1:e.x+2,y1:e.y-2,x2:o.x+Math.sin(a)*t,y2:o.y-Math.cos(a)*t,strokeWidth:1}}}break;case 3:if(void 0!==t.q4maxY){let n=Math.min(e.y,t.q4maxY-e.height),i=e.y-n;if(e.y=n,i>1){let t=s+2;e.line={type:"line",x1:e.x+2,y1:e.y+2,x2:o.x+Math.sin(a)*t,y2:o.y-Math.cos(a)*t,strokeWidth:1}}}}}(t,c,i)),t}function Cu(e){let{context:t,direction:n,measured:i,node:r,placementSettings:o,rect:s,store:a}=e,l=arguments.length>1&&void 0!==arguments[1]?arguments[1]:_u;for(let e=0;e<o.length;e++){let c=o[e],u=l({context:t,slice:r.desc.slice,view:s,direction:n,position:c.position,measured:i,padding:c.padding,store:a});if(u)return{bounds:u,placement:c}}return{bounds:null,placement:null}}function ku(e){const t=[],n=[],i=[],r=[];for(let o=0;o<e.length;++o){const{start:s,end:a}=e[o].desc.slice,l=yu((s+a)/2);switch(Math.floor(l/(Math.PI/2))){case 0:t.push(e[o]);break;case 1:n.push(e[o]);break;case 2:i.push(e[o]);break;case 3:r.push(e[o])}}const o=(e,t)=>yu((e.desc.slice.start+e.desc.slice.end)/2)-yu((t.desc.slice.start+t.desc.slice.end)/2),s=(e,t)=>o(t,e);return t.sort(s),n.sort(o),i.sort(s),r.sort(o),t.concat(n,r,i)}function Eu(e,t,n){const i=t.fontFamily,r="".concat(t.fontSize,"px"),o=n.measureText({text:e,fontFamily:i,fontSize:r});return o.minReqWidth=Math.min(o.width,n.measureText({text:"".concat(e[0],"…"),fontFamily:i,fontSize:r}).width),o}const Au=/\n+|\r+|\r\n/,Tu=/\s/,Iu=/[a-zA-Z\u00C0-\u00F6\u00F8-\u00FF\u00AD]/;function Ru(e){return"string"==typeof e?-1!==e.search(Au):-1!==String(e).search(Au)}function Nu(e){return-1!==e.search(Tu)}function Ou(e){return-1!==e.search(Iu)}function Pu(e,t,n,i,r){return i.some((i=>i(e,t,n)))?1:r.some((i=>i(e,t,n)))?0:2}function Lu(e){""===e[0]&&e.shift(),""===e[e.length-1]&&e.pop()}function Fu(e,t,n){return Math.max(t,Math.min(n,e))}function zu(){let{string:e,separator:t="",reverse:n=!1,measureText:i=(e=>({width:e.length,height:1})),mandatoryBreakIdentifiers:r=[Ru],noBreakAllowedIdentifiers:o=[],suppressIdentifier:s=[Nu,Ru,e=>""===e],hyphenationIdentifiers:a=[Ou]}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const l=String(e).split(t);Lu(l);const c=l.length,u=n?e=>e>=0:e=>e<c;let h=n?c:-1;function d(e){const t=Fu(e,0,c-1),n=l[t],u=i(n),h=Pu(n,t,l,r,o);return{index:t,value:n,breakOpportunity:h,suppress:s.some((e=>e(n,t,l))),hyphenation:a.some((e=>e(n,t,l))),width:u.width,height:u.height,done:!1}}function f(e){return isNaN(e)?n?h--:h++:h=Fu(e,0,c-1),u(h)?d(h):{done:!0}}return{next:f,peek:d,length:c}}const ju="…",Hu=/^\s*\d+(\.\d+)?px\s*$/i;function Bu(e){return"string"===typeof e&&Hu.test(e)}function Vu(e){const t=e["font-size"]||e.fontSize;return Bu(t)?parseFloat(t)*Math.max(isNaN(e.lineHeight)?1.2:e.lineHeight,0):19.2}function $u(e){const t=e.maxHeight,n=Math.max(e.maxLines,1)||1/0;if(isNaN(t))return n;const i=Vu(e);return Math.max(1,Math.min(Math.floor(t/i),n))}function Wu(e,t){return{lines:[],line:"",width:0,maxLines:$u(e),maxWidth:e.maxWidth,hyphens:{enabled:"auto"===e.hyphens,char:"‐",metrics:t("‐")}}}function Uu(e){e.lines.push(e.line),e.line="",e.width=0}function Yu(e,t){e.line+=t.value,e.width+=t.width}function Xu(e,t,n){if(t.width>e.maxWidth)return t;const i=t.index;for(let r=1;r<5;r++){const o=n.peek(t.index-1);if(!t.hyphenation||!o.hyphenation||0===t.index)return t;if(e.width+e.hyphens.metrics.width<=e.maxWidth)return e.line+=e.hyphens.char,t;if(1===e.line.length)return t;t=n.next(i-r),e.line=e.line.slice(0,-1),e.width-=t.width}return t}function Ku(e,t,n){const i=zu({string:t.value,measureText:n});for(;e.lines.length<e.maxLines;){let t=i.next();if(t.done)break;e.width+t.width>e.maxWidth&&2===t.breakOpportunity&&e.line.length>0?(t=e.hyphens.enabled?Xu(e,t,i):t,Uu(e),Yu(e,t)):Yu(e,t)}}function Gu(e,t){const n=zu({string:e.text,separator:"",measureText:t,noBreakAllowedIdentifiers:[(e,t)=>0===t]}),i=Wu(e,t);let r=!0;for(;i.lines.length<i.maxLines;){let e=n.next();if(e.done){Uu(i),r=!1;break}1===e.breakOpportunity?Uu(i):i.width+e.width>i.maxWidth&&2===e.breakOpportunity?e.suppress?i.width+=e.width:(e=i.hyphens.enabled?Xu(i,e,n):e,Uu(i),Yu(i,e)):Yu(i,e)}return{lines:i.lines,reduced:r}}function Ju(e,t){const n=zu({string:e.text,separator:/(\s|-|\u2010)/,measureText:t}),i=Wu(e,t);let r=!0;for(;i.lines.length<i.maxLines;){let e=n.next();if(e.done){Uu(i),r=!1;break}1===e.breakOpportunity?Uu(i):i.width+e.width>i.maxWidth&&2===e.breakOpportunity?e.suppress?Uu(i):e.width>i.maxWidth?Ku(i,e,t):(Uu(i),Yu(i,e)):Yu(i,e)}return{lines:i.lines,reduced:r}}function Zu(e){return{"break-all":Gu,"break-word":Ju}[e.wordBreak]}function Qu(e){return t=>{const n=t.node;if(function(e){return"text"===e.type&&!e._lineBreak}(n)){const i=Zu(n);if(!i)return;const r=e(n);if(r.width>n.maxWidth||Ru(n.text)){const o=(Vu(n)-r.height)/2,s=i(n,function(e,t){return n=>t({text:n,fontSize:e.fontSize,fontFamily:e.fontFamily})}(n,e));t.node=function(e,t,n,i){const r={type:"container",children:[]};void 0!==t.id&&(r.id=t.id);let o=0;return e.lines.forEach(((s,a)=>{const l=A({},t);l.text=s,l._lineBreak=!0,o+=n,e.reduced&&a===e.lines.length-1?l.text+=ju:delete l.maxWidth,l.dy=isNaN(l.dy)?o:l.dy+o,o+=i,o+=n,r.children.push(l)})),r}(s,n,o,r.height)}}}}function eh(e,t){let{text:n,"font-size":i,"font-family":r,maxWidth:o}=e;if(n="string"==typeof n?n:"".concat(n),void 0===o)return n;let s=t({text:n,fontSize:i,fontFamily:r}).width;if(s<=o)return n;let a=0,l=n.length-1;for(;a<=l;){let e=Math.floor((a+l)/2);s=t({text:n.substr(0,e)+ju,fontSize:i,fontFamily:r}).width,s<=o?a=e+1:l=e-1}return n.substr(0,l)+ju}function th(e){const t=e.baseline||e["dominant-baseline"];let n=0;const i=parseInt(e.fontSize||e["font-size"],10)||0;switch(t){case"hanging":n=.75*i;break;case"text-before-edge":n=.85*i;break;case"middle":n=.25*i;break;case"central":n=.35*i;break;case"mathemetical":n=i/2;break;case"text-after-edge":case"ideographic":n=.2*-i;break;default:n=0}return n}const nh={},ih={},rh={fontSize:void 0,fontFamily:void 0};let oh;function sh(e,t,n){const i=e+t+n;return"number"!=typeof ih[i]&&(oh=oh||document.createElement("canvas").getContext("2d"),function(e,t){rh.fontSize===e&&rh.fontFamily===t||(oh.font=e+" "+t,rh.fontSize=e,rh.fontFamily=t)}(t,n),ih[i]=oh.measureText(e).width),ih[i]}function ah(e){return"number"!=typeof nh[e]&&(nh[e]=function(e){if(Bu(e)){const t=parseFloat(e);return t+4*Math.ceil((t+1e-12)/24)}return 16}(e)),nh[e]}function lh(e){let{text:t,fontSize:n,fontFamily:i}=e;return{width:sh(t,n,i),height:ah(n)}}function ch(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:lh;const n=e["font-size"]||e.fontSize,i=e["font-family"]||e.fontFamily,r=t({text:e.text,fontFamily:i,fontSize:n}),o=Math.min(e.maxWidth||r.width,r.width),s=e.x||0,a=e.y||0,l=e.dx||0,c=(e.dy||0)+th(e),u={x:0,y:a+c-.75*r.height,width:o,height:r.height},h=e["text-anchor"]||e.anchor;return u.x="middle"===h?s+l-o/2:"end"===h?s+l-o:s+l,u}function uh(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:lh;const n=Zu(e),i=e["font-size"]||e.fontSize,r=e["font-family"]||e.fontFamily,o=t({text:e.text,fontFamily:r,fontSize:i});if(n&&(o.width>e.maxWidth||Ru(e.text))){const o=n(e,(e=>t({text:e,fontFamily:r,fontSize:i}))),s=A({},e);let a=0,l="";for(let e=0,n=o.lines.length;e<n;e++){let s=o.lines[e];s+=e===n-1&&o.reduced?ju:"";const c=t({text:s,fontSize:i,fontFamily:r}).width;c>=a&&(a=c,l=s)}s.text=l;const c=ch(s,t);return c.height=Vu(e)*o.lines.length,c}return ch(e,t)}const hh=.9;function dh(e,t){return{node:e,data:e.data,scale:t.scale,formatter:t.formatter,dataset:t.dataset}}function fh(e,t,n){const i={type:"text",text:t,maxWidth:e.width,x:0,y:e.y,dx:0,dy:0,fill:n.fill,anchor:"start",baseline:"alphabetical",fontSize:"".concat(n.fontSize,"px"),fontFamily:n.fontFamily},r=n.textMetrics;if(e.width<n.fontSize)return!1;const o=Math.max(0,e.width-r.width);return i.x=e.x+n.align*o,i.y=e.y+r.height/1.2,i}function ph(e){let{cx:t,cy:n,r:i}=e;return{type:"circle",bounds:{cx:t,cy:n,r:i}}}function mh(e){return e.desc&&e.desc.slice?function(e){let{start:t,end:n,innerRadius:i,outerRadius:r,offset:o}=e;if(Math.abs(t+2*Math.PI-n)>1e-12)return{type:null,bounds:null};let s=0!==i?i:r;return ph({cx:o.x,cy:o.y,r:s})}(e.desc.slice):"circle"===e.type?ph(e.attrs):"rect"===e.type?{type:"rect",bounds:e.bounds}:{type:null,bounds:null}}var gh={bar:function(e){let{settings:t,chart:n,nodes:i,rect:r,renderer:o,style:s}=e,a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:pu;const l=A({fontSize:12,fontFamily:"Arial",align:.5,justify:0,fill:"#333"},s.label);l.fontSize=parseInt(l.fontSize,10);const c=t.labels.map((e=>A({},l,t,e))),u=t.labels.map((e=>e.placements.map((n=>A({},l,t,e,n))))),{fitsHorizontally:h,hasHorizontalDirection:d,targetNodes:f}=mu({nodes:i,chart:n,renderer:o,settings:t,rect:r,labelSettings:c,placementSettings:u}),p=gu({orientation:t.orientation,defaultOrientation:d?"h":"v"}),m="h"===p?"y":"x",g="h"===p?"height":"width";return f.sort(((e,t)=>e.node.localBounds[m]+e.node.localBounds[g]-(t.node.localBounds[m]+t.node.localBounds[g]))),a({chart:n,targetNodes:f,stngs:t,rect:r,fitsHorizontally:h,collectiveOrientation:p})},slice:function(e){let{settings:t,chart:n,nodes:i,rect:r,renderer:o,style:s}=e,a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Cu,l=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Su;const c=A({fontSize:12,fontFamily:"Arial",fill:"#333",padding:4,position:"into"},s.label);c.fontSize=parseInt(c.fontSize,10);const u=t.labels.map((e=>A({},c,t,e))),h=t.labels.map((e=>e.placements.map((n=>A({},c,t,e,n))))),d=[],f={insideLabelBounds:[]};i=ku(i);const p={};for(let e=0,t=i.length;e<t;e++){const t=i[e],s=Du(t,n);for(let n=0;n<u.length;n++){const i=u[n],c="function"==typeof i.label?i.label(s,e):"";if(!c)continue;const m="function"==typeof i.direction?i.direction(s,e):i.direction||"horizontal",g="function"==typeof i.linkData?i.linkData(s,e):void 0,y=Eu(c,i,o),v=a({context:p,direction:m,lblStngs:i,measured:y,node:t,placementSettings:h[n],rect:r,store:f}),b=v.bounds,x=v.placement;if(b&&x){if("outside"===x.position&&"rotate"!==m){Mu({context:p,node:t,bounds:b});if(!aa(bu(b),r))continue}const n="function"==typeof x.fill?x.fill(s,e):x.fill,o=l(b,c,{fill:n,fontSize:i.fontSize,fontFamily:i.fontFamily,textMetrics:y});o&&(void 0!==g&&(o.data=g),d.push(o),b.line&&(b.line.stroke=n,d.push(b.line)))}}}return d},rows:function(e){let{settings:t,chart:n,nodes:i,renderer:r,style:o}=e,s=arguments.length>1&&void 0!==arguments[1]?arguments[1]:fh;const a=A({fontSize:12,fontFamily:"Arial",fill:"#333",padding:4,align:.5,justify:.5},o.label);a.fontSize=parseInt(a.fontSize,10);const l=A({},a,t),c=t.labels.map((e=>A({},l,e))),u={},h=[];for(let e=0,t=i.length;e<t;e++){let t=i[e],o=dh(t,n),{type:a,bounds:d}=mh(t);if(!d)continue;let f,p=0,m=[],g=[],y="circle"===a?2*d.r*hh:d.height;for(p+=l.padding,f=0;f<c.length;f++){let t=c[f],n="function"==typeof t.label?t.label(o,e):"";u.fontFamily=t.fontFamily,u.fontSize="".concat(t.fontSize,"px"),u.text=n;let i=r.measureText(u);if(p+=i.height+t.padding,p>y)break;g.push(n),m.push(i)}const v=f,b=Math.max(0,y-p);let x;for(x="circle"===a?d.cy-d.r*hh:d.y,x+=l.justify*b+l.padding,f=0;f<v;f++){let t,n=c[f];if("circle"===a){let e=Math.max(Math.abs(x-d.cy),Math.abs(x+m[f].height-d.cy)),n=Math.sqrt(d.r*d.r-e*e);t={x:d.cx-n+l.padding,y:x,width:2*n-2*l.padding,height:m[f].height}}else t={x:d.x+l.padding,y:x,width:d.width-2*l.padding,height:m[f].height};x+=m[f].height+l.padding;let i="function"==typeof n.fill?n.fill(o,e):n.fill;const u="function"==typeof n.linkData?n.linkData(o,e):void 0;let p=s(t,g[f],{fill:i,align:n.align,fontSize:n.fontSize,fontFamily:n.fontFamily,textMetrics:m[f]});if(p){if(p.text&&p.text!==ju){const e=eh(p,r.measureText);if(ju===e)continue;p.ellipsed=e}void 0!==u&&(p.data=u),h.push(p)}}}return h}};const yh={require:["chart","renderer","settings"],defaultSettings:{settings:{},style:{label:"$label"}},render(){const e=this.settings.settings,t=[];return(e.sources||[]).forEach((e=>{e.strategy&&gh[e.strategy.type]&&e.component&&t.push(...function(e,t){let{chart:n,source:i,rect:r,renderer:o,style:s}=e;if(!n.component(i.component))return[];const a=n.findShapes(i.selector).filter((e=>e.key===i.component));return t({chart:n,settings:i.strategy.settings,nodes:a,rect:{x:0,y:0,width:r.width,height:r.height},renderer:o,style:s})}({chart:this.chart,rect:this.rect,renderer:this.renderer,source:e,style:this.style},gh[e.strategy.type]))})),t}};const vh={layout:{size:1,direction:"ltr",scrollOffset:0},item:{show:!0,justify:.5,align:.5,label:{fontSize:"12px",fontFamily:"Arial",fill:"#595959",wordBreak:"none",maxLines:2,maxWidth:136,lineHeight:1.2},shape:{type:"square",size:12}},title:{show:!0,text:void 0,anchor:"start",fontSize:"16px",fontFamily:"Arial",fill:"#595959",wordBreak:"none",maxLines:2,maxWidth:156,lineHeight:1.25},navigation:{button:{class:void 0,content:void 0,tabIndex:void 0},disabled:!1}};function bh(e){let{x:t=0,y:n,item:i,globalMetrics:r,createSymbol:o,direction:s="ltr"}=e,a=i.label.displayObject,l=i.label.bounds,c=i.symbol.meta;const u="rtl"===s;let h={x:u?t+r.maxLabelBounds.width:t+r.maxSymbolSize+r.spacing,y:n,width:r.maxLabelBounds.width,height:Math.max(r.maxSymbolSize,r.maxLabelBounds.height)},d=function(e,t,n){const i=Math.max(0,e.width-t),r=Math.max(0,e.height-t);return{x:e.x+t/2+n.align*i,y:e.y+t/2+n.justify*r}}({x:u?t+r.maxLabelBounds.width+r.spacing:t,y:n,width:r.maxSymbolSize,height:h.height},c.size,{align:void 0===c.align?.5:c.align,justify:void 0===c.justify?.5:c.justify});const f=o(A({},c,d));return delete f.collider,a.anchor=u?"end":"start",function(e,t,n){const i=n.textMetrics;if(e.height<i.height)return!1;const r=Math.max(0,e.width-i.width);t.baseline="text-before-edge";const o=Math.max(0,e.height-i.height);t.x=e.x+n.align*r,t.y=e.y+n.justify*o+.175*parseInt(t.fontSize,10)}(h,a,{textMetrics:l,fontSize:parseInt(a.fontSize,10),align:0,justify:.5}),{item:{type:"container",data:i.label.displayObject.data,children:[f,a],collider:{type:"rect",x:t,y:n,width:r.maxItemBounds.width,height:r.maxItemBounds.height}},metrics:h}}function xh(e,t){const n=e.items.length,i=Math.ceil(n/t),r="horizontal"===e.layout.orientation?"width":"height",o="width"===r?"horizontal":"vertical";return e.globalMetrics.maxItemBounds[r]*i+(i-1)*e.layout.margin[o]}function wh(e,t){let n,i,r,o,{onScroll:s=(()=>{})}=t,a=null,l=0;const c={itemize:t=>{n=function(e,t){let n,i,{resolved:r,dock:o}=e,s=[],a=r.items.items,l=r.symbols.items,c=r.labels.items,u=0,h=0,d=0;for(let e=0;e<a.length;e++){if(!1===a[e].show)continue;const r=void 0!==c[e].text?c[e].text:c[e].data.label||"";n=A({},c[e],{type:"text",fontSize:"".concat(parseInt(c[e].fontSize,10),"px"),text:r,title:r}),i={symbol:{meta:l[e]},label:{displayObject:n,bounds:t.textBounds(n)}},s.push(i),u=Math.max(l[e].size,u),h=Math.max(i.label.bounds.width,h),d=Math.max(i.label.bounds.height,d)}return{items:s,globalMetrics:{spacing:8,maxSymbolSize:u,maxItemBounds:{height:Math.max(u,d),width:u+8+h},maxLabelBounds:{width:h,height:d}},layout:{margin:{vertical:void 0!==r.layout.item.vertical?r.layout.item.vertical:4,horizontal:void 0!==r.layout.item.horizontal?r.layout.item.horizontal:4},mode:r.layout.item.mode,size:r.layout.item.size,orientation:"top"===o||"bottom"===o?"horizontal":"vertical",direction:r.layout.item.direction,scrollOffset:r.layout.item.scrollOffset}}}(t,e.renderer),a=isNaN(n.layout.scrollOffset)?a:n.layout.scrollOffset},getItemsToRender:t=>{r=t.viewRect,l=c.getContentOverflow(r);const s=c.extent();a=Math.max(0,Math.min(a,l)),o=A({},r);const u="horizontal"===c.orientation()?"x":"y";return o[u]-=a,o["x"===u?"width":"height"]=s,function(e,t,n){let{viewRect:i}=e,{itemized:r,create:o=bh,parallels:s,createSymbol:a}=n;const l=r.layout.direction,c=r.globalMetrics,u=r.items,h="horizontal"===r.layout.orientation;let d=0;const f=[],p=c.maxItemBounds.height,m=c.maxItemBounds.width,g=r.layout.margin.vertical+p,y=r.layout.margin.horizontal+m;let v=t.x,b=t.y,x=i.x-t.x;for(let e=0;e<u.length;e++){let n=o({y:b,x:"rtl"===l?i.x+x+i.width-m-(v-t.x):v,item:u[e],globalMetrics:c,direction:l,createSymbol:a});if((h&&v>=i.x-m||!h&&b>=i.y-p)&&f.push(n.item),d++,d>=s?(d=0,h?(v+=y,b=t.y):(b+=g,v=t.x)):h?b+=g:v+=y,!h&&b>i.y+i.height)break;if(h&&v>i.x+i.width)break}return f}(t,o,{itemized:n,parallels:i,createSymbol:e.symbol})},parallelize:(e,t)=>(i=function(e,t,n){const i=n.items.length,r="horizontal"===n.layout.orientation?"width":"height",o="width"===r?"horizontal":"vertical",s=n.globalMetrics.maxItemBounds[r]*i+(i-1)*n.layout.margin[o];let a=Math.ceil(s/e);if(null!=t){const e="horizontal"===n.layout.orientation?"height":"width",i="width"===e?"horizontal":"vertical",r=n.layout.margin[i]||4,o=Math.floor((t+r)/(r+n.globalMetrics.maxItemBounds[e]));a=Math.min(a,o)}const l=isNaN(n.layout.size)?1:n.layout.size;return Math.max(1,Math.min(a,l))}(e,t,n),i),hasContentOverflow:()=>{const e="horizontal"===n.layout.orientation?"width":"height";return xh(n,i)>r[e]},getContentOverflow:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:r;const t="horizontal"===n.layout.orientation?"width":"height";return Math.max(0,xh(n,i)-e[t])},getNextSize:()=>{const e="horizontal"===n.layout.orientation?"width":"height",t="width"===e?"horizontal":"vertical";return n.globalMetrics.maxItemBounds[e]+n.layout.margin[t]},getPrevSize:()=>{const e="horizontal"===n.layout.orientation?"width":"height",t="width"===e?"horizontal":"vertical";return n.globalMetrics.maxItemBounds[e]+n.layout.margin[t]},hasNext:()=>"horizontal"===c.orientation()?r.x+r.width<o.x+o.width:r.y+r.height<o.y+o.height,hasPrev:()=>"horizontal"===c.orientation()?o.x<r.x:o.y<r.y,next:()=>{c.scroll(-c.getNextSize())},prev:()=>{c.scroll(c.getPrevSize())},scroll:e=>{const t=Math.max(0,Math.min(l,a-e));t!==a&&(a=t,s())},offset:()=>a,orientation:()=>n.layout.orientation,direction:()=>n.layout.direction,extent:()=>xh(n,i),spread:()=>function(e,t){const n=t,i="horizontal"===e.layout.orientation?"height":"width",r="width"===i?"horizontal":"vertical";return e.globalMetrics.maxItemBounds[i]*n+(n-1)*e.layout.margin[r]}(n,i)};return c}function qh(e){return Object.keys(e).filter((t=>e[t])).join(" ")}const Mh={up:"▲",right:"▶",down:"▼",left:"◀"};function Dh(e,t){let{size:n,isActive:i,direction:r,nav:o,attrs:s}=t,a={},l="";const c=s;o&&o.button&&("function"==typeof o.button.class?a=o.button.class({direction:r}):o.button.class&&(a=o.button.class),"function"==typeof o.button.content&&(l=o.button.content(e,{direction:r})),void 0!==o.button.tabIndex&&(c.tabindex=o.button.tabIndex));const u={width:"".concat(n,"px"),minWidth:"".concat(n,"px"),height:"".concat(n,"px")};return Object.keys(a).length||(u.border="0",u.background="none"),(!i||o&&o.disabled)&&(c.disabled="disabled"),e("button",A({class:qh(a),style:u},c),[l||e("span",{style:{pointerEvents:"none"}},[Mh[r]])])}function Sh(e){let t;const n={itemize:e=>{t=function(e){let{dock:t,navigation:n}=e;return{layout:{orientation:"top"===t||"bottom"===t?"vertical":"horizontal"},navigation:n}}(e)},render:i=>function(e,t,n,i){let{rect:r,itemRenderer:o}=t;if(!e||!e.renderArgs)return;e.size(r);const s=e.renderArgs[0],a="vertical"===n.layout.orientation,l="rtl"===o.direction(),c=o.hasNext(),u=o.hasPrev();if(!u&&!c)return void e.render([]);const h=a?["right","left"]:["down","up"];l&&a&&h.reverse();const d=[s("div",{style:{position:"relative",display:"flex","flex-direction":a?"column":"row","justify-content":"center",height:"100%",pointerEvents:"auto"},dir:l&&!a?"rtl":"ltr"},[Dh(s,{size:32,isActive:c,direction:h[0],attrs:{"data-action":"next","data-component-key":i.settings.key},nav:n.navigation}),Dh(s,{size:32,isActive:u,direction:h[1],attrs:{"data-action":"prev","data-component-key":i.settings.key},nav:n.navigation})])];e.render(d)}(n.renderer,i,t,e),extent:()=>32,spread:()=>64};return n}function _h(e){let t;const n={itemize:n=>{t=function(e,t){let{resolved:n}=e;if(!1===n.title.item.show)return null;const i=A({},n.title.item,{type:"text"});if("rtl"===n.layout.item.direction&&(i.anchor&&"start"!==i.anchor?"end"===i.anchor&&(i.anchor="start"):i.anchor="end"),void 0===n.title.settings.text){const e=t.scale.data().fields;i.text=e&&e[0]?e[0].title():""}return{displayObject:i,bounds:t.renderer.textBounds(i)}}(n,e)},render:e=>{!function(e,t,n){let{rect:i}=e;if(!t)return;const r=[];if(t.size(i),n){const e={start:0,end:i.width,middle:i.width/2};r.push(A({},n.displayObject,{x:e[n.displayObject.anchor]||0,y:0,baseline:"text-before-edge",title:n.displayObject.text}))}t.render(r)}(e,n.renderer,t)},spread:()=>t?t.bounds.height:0,extent:()=>t?t.bounds.width:0};return n}function Ch(e,t,n,i){let r,o,s,{itemRenderer:a,navigationRenderer:l,titleRenderer:c,isPreliminary:u=!1}=i,h=0;const d={x:t.spacing,y:t.spacing,width:e.width-2*t.spacing,height:e.height-2*t.spacing};if(r={x:d.x,y:d.y,width:d.width,height:c.spread()},"horizontal"===n){r={x:d.x,y:d.y,width:c.extent(),height:c.spread()};const e=d.width-r.width-(r.width?t.spacing:0),n=d.height;a.parallelize(e,u?void 0:n);const i=a.extent()>e?l.extent():0,f=a.spread(),p=i?l.spread():0;o={x:r.x+r.width+(r.width?t.spacing:0),y:d.y+Math.max(0,(p-f)/2),width:d.width-i-r.width-(i?t.spacing:0)-(r.width?t.spacing:0),height:n},s={x:o.x+o.width+(i?t.spacing:0),y:d.y,width:i,height:d.height},r.y=o.y;"rtl"===a.direction()&&(s.x=d.x,o.x=s.x+s.width+(s.width?t.spacing:0),r.x=o.x+o.width+(r.width?t.spacing:0)),h=Math.max(r.height,p,a.spread())}else{const e=d.height-r.height-(r.height?t.spacing:0),n=d.width;a.parallelize(e,u?void 0:n);const i=a.extent()>e?l.extent():0;s={x:d.x,y:d.y+d.height-i,width:d.width,height:i},o={x:d.x,y:r.y+r.height+(r.height?t.spacing:0),width:d.width,height:d.height-r.height-(r.height?t.spacing:0)-s.height-(s.height?t.spacing:0)},h=Math.max(c.extent(),i?l.spread():0,a.spread())}return o=A({},e,{x:e.x+o.x,y:e.y+o.y,width:o.width,height:o.height}),s.x+=e.x,s.y+=e.y,r.x+=e.x,r.y+=e.y,{title:A({},e,r),content:A({},e,o),navigation:A({},e,s),orientation:n,preferredSize:h}}function kh(e){e.state.resolved=function(e){const t=e.scale.domain();let n={items:[]};const i=e.settings.layout.dock;if("threshold-color"===e.scale.type){const r=e.scale.data().fields[0];let o=e=>String(e);e.settings.formatter?o=e.chart.formatter(e.settings.formatter):r&&(o=r.formatter());for(let e=0;e<t.length-1;e++){const i={value:t[e],label:"".concat(o(t[e])," - < ").concat(o(t[e+1]))};r&&(i.source={field:r.id()}),n.items.push(i)}"vertical"==("top"===i||"bottom"===i?"horizontal":"vertical")&&n.items.reverse()}else{const i=e.scale.labels?e.scale.labels():null;n.items=t.map(((t,n)=>{const r=e.scale.datum?A({},e.scale.datum(t)):{value:t};return r.value=t,e.scale.label?r.label=e.scale.label(t):i&&(r.label=i[n]),r}))}const r=e.resolver.resolve({data:{fields:e.scale.data().fields},defaults:A(!0,{},vh.title,e.style.title),settings:e.settings.settings.title}),o=e.resolver.resolve({data:{fields:e.scale.data().fields},defaults:vh.layout,settings:e.settings.settings.layout}),s=e.resolver.resolve({data:n,defaults:A(!0,{},vh.item.label,e.style.item.label),settings:(e.settings.settings.item||{}).label}),a=A(!0,{},(e.settings.settings.item||{}).shape);void 0===a.fill&&e.settings.scale&&(a.fill={scale:e.settings.scale});const l=e.resolver.resolve({data:n,defaults:A(!0,{},vh.item.shape,e.style.item.shape),settings:a}),c=e.resolver.resolve({data:n,defaults:A(!0,{},{show:vh.item.show}),settings:{show:(e.settings.settings.item||{}).show}});function u(e,n){let i=e.data.value,r=t[n+1];e.data.value=[i,r]}"threshold-color"===e.scale.type&&("vertical"==("top"===i||"bottom"===i?"horizontal":"vertical")?(c.items.reverse().forEach(u),c.items.reverse()):c.items.forEach(u));return{title:r,labels:s,symbols:l,items:c,layout:o}}(e),e.titleRenderer.itemize({resolved:e.state.resolved,dock:e.settings.layout.dock||"center"}),e.itemRenderer.itemize({resolved:e.state.resolved,dock:e.settings.layout.dock||"center"}),e.navigationRenderer.itemize({resolved:e.state.resolved,dock:e.settings.layout.dock||"center",navigation:e.settings.settings.navigation}),e.state.display={spacing:8}}function Eh(e){const{rect:t,settings:n,state:i,itemRenderer:r,navigationRenderer:o,titleRenderer:s}=e,a=n.layout.dock,l="top"===a||"bottom"===a?"horizontal":"vertical",c=Ch(t,i.display,l,{itemRenderer:r,navigationRenderer:o,titleRenderer:s});e.renderer.size(c.content);let u=r.getItemsToRender({viewRect:A({},c.content,{x:0,y:0})});return o.render({rect:c.navigation,itemRenderer:r}),s.render({rect:c.title}),e.state.views={layout:c},u}const Ah={require:["chart","settings","renderer","update","resolver","registries","symbol"],defaultSettings:{settings:{},style:{item:{label:"$label",shape:"$shape"},title:"$title"}},mounted(e){e&&e.parentNode&&(this.navigationRenderer.renderer.appendTo(e.parentNode),this.titleRenderer.renderer.appendTo(e.parentNode),e.parentNode.insertBefore(this.navigationRenderer.renderer.element(),e),e.parentNode.insertBefore(this.titleRenderer.renderer.element(),e)),this.navigationRenderer.render({rect:this.state.views.layout.navigation,itemRenderer:this.itemRenderer}),this.titleRenderer.render({rect:this.state.views.layout.title})},beforeUnmount(){this.navigationRenderer.renderer.clear(),this.titleRenderer.renderer.clear()},on:{panstart(){if(this.state.interaction.started)return;this.itemRenderer.getContentOverflow()&&(this.state.interaction.started=!0,this.state.interaction.delta=0)},panmove(e){if(!this.state.interaction.started)return;const t="horizontal"===this.itemRenderer.orientation()?("rtl"===this.itemRenderer.direction()?-1:1)*e.deltaX:e.deltaY;this.itemRenderer.scroll(t-this.state.interaction.delta),this.state.interaction.delta=t},panend(){this.state.interaction.started=!1},scroll(e){this.itemRenderer.scroll(-e)},next(){this.itemRenderer.next()},prev(){this.itemRenderer.prev()}},created(){this.state={interaction:{}},this.onScroll=()=>{const e=Eh(this);this.update(e)},this.itemRenderer=wh(this,{onScroll:this.onScroll}),this.navigationRenderer=Sh(this),this.titleRenderer=_h(this),this.navigationRenderer.renderer=this.registries.renderer("dom")(),this.titleRenderer.renderer=this.registries.renderer(this.settings.renderer)(),kh(this)},preferredSize(e){return function(e,t){let n=0;const i=e.settings.layout.dock||"center",r="top"===i||"bottom"===i?"horizontal":"vertical",o=e.state.display,s=Ch(t.inner,o,r,{itemRenderer:e.itemRenderer,navigationRenderer:e.navigationRenderer,titleRenderer:e.titleRenderer,isPreliminary:!0});return n+=o.spacing,n+=s.preferredSize,n+=o.spacing,n}(this,e)},beforeUpdate(){kh(this)},render(){return Eh(this)},beforeDestroy(){this.navigationRenderer.renderer.destroy(),this.titleRenderer.renderer.destroy()},additionalElements(){return[this.titleRenderer.renderer.element(),this.navigationRenderer.renderer.element()]},_DO_NOT_USE_getInfo(){return{offset:this.itemRenderer.offset()}}};function Th(e,t){let n=0;const i=e.state.isVertical?"justify":"align",r=e.state.isVertical?"y":"x",o=e.state.isVertical?"height":"width",s=e.state.isVertical?"requiredHeight":"requiredWidth";n=e.state.rect[o]-e.state.legend.length()-e.state.title[s](),n*=Math.min(1,Math.max(e.stgns[i],0)),t[r]+=n}function Ih(e,t,n){const i=n[e];return"object"==typeof i?-1!==i.valid.indexOf(t)?t:i.default:n.default}function Rh(e){return Ih(e.layout.dock,e.settings.title.anchor,{left:{valid:["top"],default:"top"},right:{valid:["top"],default:"top"},top:{valid:["left","right"],default:"left"},bottom:{valid:["left","right"],default:"left"},default:"top"})}function Nh(e,t){const n={x:0,y:0,width:0,height:0},i=e.stgns.padding;return n.x=i.left,n.y=i.top,n.width=t.width-i.left-i.right,n.height=t.height-i.top-i.bottom,n}function Oh(e){const t="top"!==e.settings.layout.dock&&"bottom"!==e.settings.layout.dock,n=e.stgns.title,i=e.chart.scale(e.stgns.fill),r=e.chart.scale(e.stgns.major),o=function(e,t){const n=t.domain();let i=n,r=e.stgns.tick.label;return!r&&e.formatter?r=e.formatter:!r&&t.data().fields&&(r=t.data().fields[0].formatter()),"function"==typeof r&&(i=n.map(r).map(String)),n.map(((n,r)=>{const o=i[r];return{value:n,label:o,pos:t.norm(parseFloat(n,10)),textMetrics:e.renderer.measureText({text:o,fontSize:e.stgns.tick.fontSize,fontFamily:e.stgns.tick.fontFamily})}}))}(e,r),s=function(e){return Ih(e.layout.dock,e.settings.tick.anchor,{left:{valid:["left","right"],default:"left"},right:{valid:["left","right"],default:"right"},top:{valid:["top","bottom"],default:"top"},bottom:{valid:["top","bottom"],default:"bottom"},default:"right"})}(e.settings);if(void 0===n.text){const e=r.data().fields;n.text=e&&e[0]?e[0].title():""}const a=e.renderer.measureText({text:n.text,fontSize:n.fontSize,fontFamily:n.fontFamily}),l=e.renderer.textBounds({text:n.text,fontSize:n.fontSize,fontFamily:n.fontFamily,maxLines:n.maxLines,maxWidth:n.maxLengthPx,wordBreak:n.wordBreak,hyphens:n.hyphens,lineHeight:n.lineHeight}),c={isVertical:t,nodes:[],title:{anchor:Rh(e.settings),textMetrics:a,textBounds:l,requiredWidth:()=>{if(!n.show)return 0;let e=l.width,i=n.maxLengthPx;return t||(e+=n.padding,i+=n.padding),Math.min(e,i,c.rect.width)},requiredHeight:()=>{if(!n.show)return 0;let e=l.height;return t&&(e+=n.padding),Math.min(e,c.rect.height)}},ticks:{values:o,anchor:s,length:Math.min(Math.max(...o.map((e=>e.textMetrics.width))),e.stgns.tick.maxLengthPx),requiredHeight:()=>"top"===s?Math.max(...c.ticks.values.map((e=>e.textMetrics.height)))+e.stgns.tick.padding:0,height:Math.max(...o.map((e=>e.textMetrics.height)))},legend:{fillScale:i,majorScale:r,length:()=>{const n=t?"height":"width",i=t?"requiredHeight":"requiredWidth",r=Math.min(c.rect[n],c.rect[n]*e.stgns.length)-c.title[i]();return Math.max(0,Math.min(r,e.stgns.maxLengthPx))}}};return c}const Ph={require:["chart","settings","renderer"],defaultSettings:{layout:{displayOrder:0,dock:"right"},settings:{size:15,length:.5,maxLengthPx:250,align:.5,justify:0,padding:{left:5,right:5,top:5,bottom:5},tick:{label:null,fill:"#595959",fontSize:"12px",fontFamily:"Arial",maxLengthPx:100,anchor:null,padding:5},title:{show:!0,text:void 0,fill:"#595959",fontSize:"12px",fontFamily:"Arial",maxLengthPx:100,padding:5,maxLines:2,wordBreak:"none",lineHeight:1.2,hyphens:"auto",anchor:null}}},preferredSize(e){const t=this.state;t.rect=Nh(this,e.inner);let n=this.stgns.size;const i=t.isVertical?this.stgns.padding.left+this.stgns.padding.right:this.stgns.padding.top+this.stgns.padding.bottom;n+=i;const r=Math.max(e.inner.width,e.inner.height);if("left"===t.ticks.anchor||"right"===t.ticks.anchor){const e=t.ticks.values.reduce(((e,t)=>e+t.textMetrics.height),0);if(e>this.state.legend.length())return r;n+=t.ticks.length}else{if(t.ticks.length>this.state.legend.length())return r;n+=Math.max(...t.ticks.values.map((e=>e.textMetrics.height)))}return n+=this.stgns.tick.padding,this.stgns.title.show&&(n="left"===t.title.anchor||"right"===t.title.anchor?Math.max(t.title.textBounds.height+i,n):Math.max(n,t.title.requiredWidth()+i)),this.state.preferredSize=n,n},created(){this.stgns=this.settings.settings,this.state=Oh(this)},beforeUpdate(e){this.stgns=e.settings.settings,this.state=Oh(this)},beforeRender(e){if(this.state.nodes=[],this.state.rect=Nh(this,e.size),this.stgns.title.show){const e=function(e){const t=e.state,n=e.stgns,i="left"===t.ticks.anchor,r="top"===t.ticks.anchor;let o=t.rect.x,s=t.rect.y,a="start";"left"===t.title.anchor?(o+=t.title.requiredWidth()-n.title.padding,s+=t.title.textMetrics.height,s+=r?t.rect.height-t.title.textBounds.height:0,a="end"):"right"===t.title.anchor?(o+=t.legend.length(),o+=n.title.padding,s+=t.title.textMetrics.height,s+=r?t.rect.height-t.title.textBounds.height:0):"top"===t.title.anchor&&(o+=i?t.rect.width:0,s+=t.title.textMetrics.height,a=i?"end":"start");const l={tag:"legend-title",type:"text",x:o,y:Math.min(s,t.rect.y+t.rect.height),text:n.title.text,fill:n.title.fill,fontSize:n.title.fontSize,fontFamily:n.title.fontFamily,maxWidth:n.title.maxLengthPx,maxLines:n.title.maxLines,wordBreak:n.title.wordBreak,hyphens:n.title.hyphens,lineHeight:n.title.lineHeight,anchor:a,title:n.title.text};return Th(e,l),l}(this);this.state.nodes.push(e)}const t=function(e){const t=e.state.legend.fillScale,n=e.state.legend.majorScale,i=t.domain().map((e=>({type:"stop",color:t(e),offset:Math.min(1,Math.max(0,n.norm(e)))})));return i.sort(((e,t)=>e.offset-t.offset))}(this),n=function(e,t){const n=e.state,i=e.stgns,r=n.rect;let o=r.x,s=r.y,a=n.isVertical?i.size:n.legend.length(),l=n.isVertical?n.legend.length():i.size;"left"===n.ticks.anchor?o+=n.rect.width-i.size:"top"===n.ticks.anchor&&(s+=n.rect.height-i.size),"top"===n.title.anchor?s+=n.title.requiredHeight():"left"===n.title.anchor&&(o+=n.title.requiredWidth());const c={type:"rect",x:o,y:s,width:a,height:l,fill:{type:"gradient",stops:t,degree:n.isVertical?90:180}};return Th(e,c),c}(this,t),i=function(e,t){const n=e.state,i=e.stgns;let r="start";const o={type:"rect",x:t.x,y:t.y,width:n.isVertical?0:t.width,height:n.isVertical?t.height:0,fill:"transparent"},s=n.ticks.values.map((s=>{let a=0,l=0,c=0,u="alphabetical";return n.isVertical?(l=t.y+t.height*s.pos,u=0===s.pos?"text-before-edge":"text-after-edge"):a=t.x+t.width*s.pos,"right"===n.ticks.anchor?(a=t.x+i.size+i.tick.padding,o.x=t.x+t.width):"left"===n.ticks.anchor?(a=t.x-i.tick.padding,r="end"):"top"===n.ticks.anchor?(l=t.y-i.tick.padding,c-=.25*s.textMetrics.height,r=0===s.pos?"start":"end"):"bottom"===n.ticks.anchor&&(l=t.y+t.height+i.tick.padding,c=.8*s.textMetrics.height,r=0===s.pos?"start":"end",o.y=t.y+t.height),{type:"text",x:a,y:l,dx:0,dy:c,text:s.label,fontSize:i.tick.fontSize,fontFamily:i.tick.fontFamily,fill:i.tick.fill,maxWidth:n.isVertical?i.tick.maxLengthPx:Math.min(i.tick.maxLengthPx,n.legend.length()/2),anchor:r,textBoundsFn:e.renderer.textBounds,title:s.label,baseline:u}}));return{type:"container",id:"legend-seq-ticks",children:[...s,o]}}(this,n),r={id:"legend-seq-target",type:"container",children:[n,i]};this.state.nodes.push(r)},render(){return this.state.nodes}};const Lh={coordinates:{minor:.5,major:.5,layerId:0,defined:!0},connect:!1,orientation:"horizontal",layers:{curve:"linear",show:!0,sort:void 0,line:{stroke:"#ccc",strokeWidth:1,strokeLinejoin:"miter",strokeDasharray:void 0,opacity:1,show:!0,showMinor0:!0},area:{fill:"#ccc",opacity:.8,show:!0}}};function Fh(e,t){let{generatorType:n,item:i,data:r,major:o,minor:s,layerObj:a,stngs:l}=t,c=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"";const u={type:"path",points:e,generatorType:n,major:o,minor:s,layerObj:a,stngs:l,opacity:i.opacity,stroke:i.stroke,strokeWidth:i.strokeWidth,strokeLinejoin:i.strokeLinejoin,fill:c||i.fill,data:r};return i.strokeDasharray&&(u.strokeDasharray=i.strokeDasharray),u}function zh(e){const{metaLayers:t,coordinates:n,layers:i,lines:r,areas:o}=function(e){let{data:t,stngs:n,rect:i,resolver:r,style:o,domain:s}=e;const{width:a,height:l}=i,c=r.resolve({data:t,defaults:Lh.coordinates,settings:n.coordinates||{},scaled:{major:"vertical"===n.orientation?l:a,minor:"vertical"===n.orientation?a:l}}),u=!n.connect&&s.length>2&&("function"==typeof n.coordinates.layerId||"object"==typeof n.coordinates.layerId),h={};let d=0;for(let e=0;e<c.items.length;e++){let t=c.items[e],n=t.layerId;if(u){const e=h[n]?h[n].items[h[n].items.length-1]:null,i=e?s.indexOf(e.data.major?e.data.major.value:e.data.value):null;e&&s.indexOf(t.data.major?t.data.major.value:t.data.value)-1!==i&&h[n].items.push({dummy:!0})}h[n]=h[n]||{order:d++,id:n,items:[],dataItems:[],consumableData:{}},h[n].dataItems.push(t.data),h[n].items.push(t)}const f=Object.keys(h).map((e=>(h[e].consumableData=R({points:h[e].dataItems},h[e].dataItems[0]),h[e]))),p={items:f.map((e=>e.consumableData))},m=n.layers||{};return{coordinates:c,metaLayers:f,layers:r.resolve({data:p,defaults:{curve:Lh.layers.curve,show:Lh.layers.show},settings:{curve:m.curve,show:m.show}}),lines:r.resolve({data:p,defaults:A({},Lh.layers.line,o.line),settings:m.line}),areas:r.resolve({data:p,defaults:A({},Lh.layers.area,o.area),settings:m.area})}}(e),s=[];return t.forEach(((t,a)=>{const l=i.items[a];if(!1===l.show)return;l.datum=l.data,l.data=[],l.id=t.id;const c=[],u=[];let h,d;for(let i=0;i<t.items.length;i++){if(h=t.items[i],d=h.data,!h.dummy){if(isNaN(h.major))continue;e.missingMinor0&&(h.minor0=n.settings.minor.scale?n.settings.minor.scale(d.minor0?d.minor0.value:0):0),isNaN(h.minor)||c.push(h.minor),l.data.push(h.data)}u.push(h)}const f=c.sort(((e,t)=>e-t))[Math.floor((c.length-1)/2)];s.push({layerObj:l,lineObj:r.items[a],areaObj:o.items[a],median:f,points:u,consumableData:t.consumableData})})),s}const jh={require:["chart","resolver"],defaultSettings:{style:{area:"$shape",line:"$shape-outline"}},created(){},render(e){let{data:t}=e;const{width:n,height:i}=this.rect;this.stngs=this.settings.settings||{};const r=!this.stngs.coordinates||void 0===this.stngs.coordinates.minor0,o=zh({data:t,stngs:this.stngs,rect:this.rect,resolver:this.resolver,style:this.style,missingMinor0:r,domain:this.stngs.coordinates&&this.stngs.coordinates.major&&this.stngs.coordinates.major.scale?this.chart.scale(this.stngs.coordinates.major.scale).domain():[]});if(this.stngs.layers&&this.stngs.layers.sort){const e=o.map((e=>({id:e.layerObj.id,data:e.layerObj.data}))).sort(this.stngs.layers.sort).map((e=>e.id));o.sort(((t,n)=>e.indexOf(t.layerObj.id)-e.indexOf(n.layerObj.id)))}else o.sort(((e,t)=>e.median-t.median));return function(e,t){let{width:n,height:i,missingMinor0:r,stngs:o}=t;const s=[],a=o.layers||{};return e.forEach((e=>{const{lineObj:t,layerObj:l,areaObj:c,points:u}=e;let h={size:i,p:"y"},d={size:n,p:"x"};if("vertical"===o.orientation){const e=A(!0,{},d);d=A(!0,{},h),h=A(!0,{},e)}a.area&&!1!==c.show&&s.push(Fh(u,{data:e.consumableData,item:c,generatorType:"area",major:d,minor:h,layerObj:l,stngs:o})),t&&!1!==t.show&&(s.push(Fh(u,{data:e.consumableData,item:t,generatorType:"line".concat(h.p.toUpperCase(),"1"),major:d,minor:h,layerObj:l,stngs:o},"none")),!r&&a.area&&!1!==c.show&&!1!==t.showMinor0&&s.push(Fh(u,{data:e.consumableData,item:t,generatorType:"line".concat(h.p.toUpperCase(),"0"),major:d,minor:h,layerObj:l,stngs:o},"none")))})),s}(o,{width:n,height:i,missingMinor0:r,stngs:this.stngs})}};function Hh(e,t){let n,i,r=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];"object"==typeof t.center?(n=t.center.x,i=t.center.y):(n=t.clientX,i=t.clientY);const o=n-e.state.boundingRect.left,s=i-e.state.boundingRect.top;return{x:r?Math.max(0,Math.min(o,e.rect.width)):o,y:r?Math.max(0,Math.min(s,e.rect.height)):s}}function Bh(e,t){return{x:t.x+e.rect.x,y:t.y+e.rect.y}}function Vh(e,t){const n=Math.min(e.x,t.x),i=Math.min(e.y,t.y);return{x:n,y:i,width:Math.max(e.x,t.x)-n,height:Math.max(e.y,t.y)-i}}const $h={require:["chart","renderer"],defaultSettings:{layout:{displayOrder:99},settings:{brush:{components:[]}},style:{area:"$selection-area-target"}},on:{areaStart(e){this.start(e)},areaMove(e){this.move(e)},areaEnd(e){this.end(e)},areaCancel(){this.cancel()}},created(){this.state={start:{x:0,y:0},end:{x:0,y:0},active:!1}},preferredSize:()=>0,render(){},start(e){this.state.boundingRect=this.renderer.element().getBoundingClientRect();const t=Hh(this,e,!1);Ma({x:0,y:0,width:this.rect.width,height:this.rect.height},t)&&(this.state.brushConfig=function(e){return e.settings.brush.components.map((e=>({key:e.key,contexts:e.contexts,data:e.data,action:e.action||"set"})))}(this.settings),this.state.start=Hh(this,e),this.state.active=!0)},move(e){var t;this.state.active&&(this.state.end=Hh(this,e),function(e){if(e.state.active){const t=Bh(e,e.state.start),n=Bh(e,e.state.end),i=e.chart.shapesAt(Vh(t,n),{components:e.state.brushConfig});e.chart.brushFromShapes(i,{components:e.state.brushConfig})}}(this),(t=this).renderer.render([A({type:"rect"},Vh(t.state.start,t.state.end),t.style.area)]))},end(){this.state.active&&(this.state={start:{x:0,y:0},end:{x:0,y:0},active:!1},this.renderer.render([]))},cancel(){this.state.active&&(!function(e,t){e.brushConfig.forEach((e=>{Array.isArray(e.contexts)&&e.contexts.forEach((e=>{t.brush(e).end()}))}))}(this.state,this.chart),this.state={start:{x:0,y:0},end:{x:0,y:0},active:!1},this.renderer.render([]))}};function Wh(e,t,n){let{renderer:i,style:r,props:o,h:s}=n;const a=function(e,t){return{tooltip:"function"==typeof e.tooltipClass?e.tooltipClass({dock:t.dock}):e.tooltipClass,content:"function"==typeof e.contentClass?e.contentClass({dock:t.dock}):e.contentClass,arrow:"function"==typeof e.arrowClass?e.arrowClass({dock:t.dock}):e.arrowClass}}(o,t),l=function(e,t,n,i){return i.content({h:e,style:n,data:t})}(s,e,r,o),c=s("div",{dir:o.direction,class:qh(A({"pic-tooltip":!0},a.tooltip)),style:A({position:"relative",display:"inline-block"},t.computedTooltipStyle)},s("div",{style:r.content,class:qh(A({"pic-tooltip-content":!0},a.content))},l),s("div",{class:qh(A({"pic-tooltip-arrow":!0},a.arrow)),style:A({},r.arrow,r["arrow-".concat(t.dock)],t.computedArrowStyle)}));return i.render(c),i.element().children[0]}function Uh(e){let{defaultDuration:t,defaultDelay:n}=e,i=null,r=null,o=!1;const s=function(){const e=function(){},t={pending:[],debounced:[],active:[],cancelled:[],rejected:[],fulfilled:[]};let n;return e.set=e=>{n=e,t[n].forEach((t=>t(e)))},e.on=(e,n)=>{Array.isArray(e)?e.forEach((e=>t[e].push(n))):t[e].push(n)},e.destroy=()=>{Object.keys(t).forEach((e=>{t[e].length=0}))},e}(),a=function(){},l=()=>{i=null,r=null,o=!1,s.set("fulfilled")};return a.invoke=function(e){let a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:t,c=arguments.length>2&&void 0!==arguments[2]?arguments[2]:n;i&&(clearTimeout(i),s.set("debounced")),s.set("pending"),i=setTimeout((()=>{e(),o=!0,i=null,s.set("active")}),c),a>0&&(r&&clearTimeout(r),r=setTimeout(l,a+Math.max(c,0)))},a.clear=()=>{o?s.set("cancelled"):i&&(clearTimeout(i),s.set("rejected")),r&&clearTimeout(r),i=null,r=null,o=!1},a.on=(e,t)=>{s.on(e,t)},a.destroy=()=>{a.clear(),s.destroy()},a}function Yh(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;return{left:"translate(-100%,-50%) translateX(".concat(-e,"px)"),right:"translate(".concat(e,"px, -50%)"),top:"translate(-50%, -100%) translateY(".concat(-e,"px)"),bottom:"translate(-50%, ".concat(e,"px)")}}function Xh(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;return{left:{x:-e-n,y:-t/2},right:{x:n,y:-t/2},top:{x:-e/2,y:-t-n},bottom:{x:-e/2,y:n}}}function Kh(e){return{left:{left:"100%",top:"calc(50% - ".concat(e,"px)"),borderWidth:"".concat(e,"px")},right:{left:"".concat(2*-e,"px"),top:"calc(50% - ".concat(e,"px)"),borderWidth:"".concat(e,"px")},top:{left:"calc(50% - ".concat(e,"px)"),top:"100%",borderWidth:"".concat(e,"px")},bottom:{left:"calc(50% - ".concat(e,"px)"),top:"".concat(2*-e,"px"),borderWidth:"".concat(e,"px")}}}function Gh(e,t,n,i,r,o){const s=t+o.x,a=n+o.y,l=r;return!(s<0||a<0)&&!(s+i>e.width||a+l>e.height)}function Jh(e){let{area:t,vx:n,vy:i,width:r,height:o,offset:s}=e;const a=n+s.x,l=i+s.y,c=r,u=o;let h=a<0?-a:0,d=l<0?-l:0;return h+=a+c>t.width?-(a+c-t.width):0,d+=l+u>t.height?-(l+u-t.height):0,{x:h,y:d}}function Zh(e){let{options:t,pointer:n,width:i,height:r,dockOrder:o,x:s,y:a}=e;const{targetBounds:l}=n,c=Yh(t.offset),u=c[t.dock];if(u)return{computedTooltipStyle:{left:"".concat(s,"px"),top:"".concat(a,"px"),transform:u},computedArrowStyle:Kh(t.offset)[t.dock],dock:t.dock};const h={width:"target"===t.area?l.width:window.innerWidth,height:"target"===t.area?l.height:window.innerHeight},d=Xh(i,r,t.offset),f=[],p="target"===t.area?s:l.left+s,m="target"===t.area?a:l.top+a;for(let e=0;e<o.length;e+=1){const n=o[e],l=Jh({area:h,vx:p,vy:m,width:i,height:r,offset:d[n]}),u={left:"".concat(s,"px"),top:"".concat(a,"px"),transform:c[n]},g=Kh(t.offset)[n];0!==l.x&&(u.width="".concat(i-20-Math.abs(l.x),"px"),"top"!==n&&"bottom"!==n||(u.left="".concat(s+l.x,"px"),g.left="calc(50% ".concat(l.x>0?"-":"+"," ").concat(Math.abs(l.x),"px)")));const y={computedTooltipStyle:u,computedArrowStyle:g,dock:n,rect:{width:i,height:r}};if(0===l.x&&0===l.y)return y;y.offset=l,f.push(y)}return f.sort(((e,t)=>Math.abs(e.offset.x)-Math.abs(t.offset.x))),f[0]}function Qh(e,t,n){const i=e.key?n.component(e.key):n.componentsFromPoint({x:t.clientX,y:t.clientY})[0];if(!i)return{x:0,y:0,width:0,height:0,scaleRatio:{x:1,y:1}};const r=i.rect;return A({scaleRatio:r.scaleRatio},r.computedInner)}const ed={bounds:function(e){let{resources:t,nodes:n,pointer:i,width:r,height:o,options:s}=e;const{targetBounds:a}=i,{x:l,y:c,width:u,height:h}=t.getNodeBoundsRelativeToTarget(n[0]),d={left:{x:l,y:c+h/2},right:{x:l+u,y:c+h/2},top:{x:l+u/2,y:c},bottom:{x:l+u/2,y:c+h}},f=Yh(s.offset),p=f[s.dock];if(p)return{computedTooltipStyle:{left:"".concat(d[s.dock].x,"px"),top:"".concat(d[s.dock].y,"px"),transform:p},computedArrowStyle:Kh(s.offset)[s.dock],dock:s.dock};const m={width:"target"===s.area?a.width:window.innerWidth,height:"target"===s.area?a.height:window.innerHeight},g=Xh(r,o,s.offset),y=["top","left","right","bottom"];for(let e=0;e<y.length;e+=1){const t=y[e];if(Gh(m,"target"===s.area?d[t].x:a.left+d[t].x,"target"===s.area?d[t].y:a.top+d[t].y,r,o,g[t]))return{computedTooltipStyle:{left:"".concat(d[t].x,"px"),top:"".concat(d[t].y,"px"),transform:f[t]},computedArrowStyle:Kh(s.offset)[t],dock:t}}return{computedTooltipStyle:{left:"".concat(d.top.x,"px"),top:"".concat(d.top.y,"px"),transform:f.top},computedArrowStyle:Kh(s.offset).top,dock:"top"}},pointer:function(e){let{options:t,pointer:n,width:i,height:r}=e;const{x:o,y:s}=n;return Zh({x:o,y:s,pointer:n,width:i,height:r,options:t,dockOrder:["top","left","right","bottom"]})},slice:function(e){let{options:t,pointer:n,width:i,height:r,nodes:o,resources:s}=e;const a=o[0],{dx:l,dy:c}=n,u=s.getComponentBoundsFromNode(a),h=l+u.x+u.width/2,d=c+u.y+u.height/2,{start:f,end:p,outerRadius:m}=a.desc.slice,g=(f+p)/2-Math.PI/2,y=2*Math.PI,v=(g%y+y)%y;let b=["top","left","right","bottom"];return"auto"===t.dock&&(b=v<=Math.PI/4||v>=7*Math.PI/4?["right","top","bottom","left"]:v<=3*Math.PI/4?["bottom","left","right","top"]:v<=5*Math.PI/4?["left","top","bottom","right"]:["top","left","right","bottom"]),Zh({x:h+m*u.scaleRatio.x*Math.cos(v),y:d+m*u.scaleRatio.y*Math.sin(v),pointer:n,width:i,height:r,options:t,dockOrder:b})}};function td(e,t){let{width:n,height:i}=e,{chart:r,state:o,props:s}=t;const a={resources:{formatter:r.formatter,scale:r.scale,component:r.component,getComponentBoundsFromNode:e=>Qh(e,o.pointer,r),getNodeBoundsRelativeToTarget:e=>function(e,t,n){const i=Qh(e,t,n),r=e.bounds;return{x:i.x+t.dx+r.x,y:i.y+t.dy+r.y,width:r.width,height:r.height}}(e,o.pointer,r)},nodes:o.activeNodes,pointer:o.pointer,width:n,height:i},l=typeof s.placement;if("object"===l&&"function"==typeof s.placement.fn)return s.placement.fn(a);let c={type:"pointer",offset:8,dock:"auto",area:"viewport"};"function"===l&&(c=A(c,s.placement(a))),"object"===l&&ed[s.placement.type]?c=A(c,s.placement):"string"===l&&ed[s.placement]&&(c=A(c,{type:s.placement})),a.options=c;const u=ed[c.type](a);let{x:h,y:d,width:f,height:p}=a.resources.getComponentBoundsFromNode(a.nodes[0]);return h+=a.pointer.dx,f+=h,d+=a.pointer.dy,p+=d,u.computedTooltipStyle.left="".concat(Math.min(Math.max(0,h,parseFloat(u.computedTooltipStyle.left)),f),"px"),u.computedTooltipStyle.top="".concat(Math.min(Math.max(0,d,parseFloat(u.computedTooltipStyle.top)),p),"px"),u}let nd;function id(){nd=null}const rd={duration:8e3,delay:500,filter:e=>e.filter((e=>e.data&&void 0!==e.data.value)),extract:e=>e.node.data.value,content:e=>{let{h:t,data:n}=e;return n.map((e=>t("div",{},e)))},isEqual:(e,t)=>e.length&&e.length===t.length&&e.every(((e,n)=>t[n]&&JSON.stringify(e.data)===JSON.stringify(t[n].data))),placement:{type:"pointer",dock:"auto",offset:8,area:"viewport"},tooltipClass:{},contentClass:{},arrowClass:{},direction:"ltr",appendTo:void 0,beforeShow:void 0,afterShow:void 0,beforeHide:void 0,onHide:void 0,afterHide:void 0};const od={require:["chart","renderer"],defaultSettings:{settings:rd,style:{tooltip:{},content:{backgroundColor:"$gray-25",color:"$font-color--inverted",fontFamily:"$font-family",fontSize:"$font-size",lineHeight:"$line-height",borderRadius:"4px",padding:"8px",opacity:.9},arrow:{position:"absolute",width:"0px",height:"0px",borderStyle:"solid",color:"$gray-25",opacity:.9},"arrow-bottom":{borderTopColor:"transparent",borderLeftColor:"transparent",borderRightColor:"transparent"},"arrow-top":{borderBottomColor:"transparent",borderLeftColor:"transparent",borderRightColor:"transparent"},"arrow-right":{borderTopColor:"transparent",borderLeftColor:"transparent",borderBottomColor:"transparent"},"arrow-left":{borderTopColor:"transparent",borderBottomColor:"transparent",borderRightColor:"transparent"}}},renderer:"dom",on:{hide(){this.hide()},show(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this.show(e,t)},prevent(e){this.prevent(e)}},hide(){this.dispatcher.clear(),this.state.activeNodes=[],this.state.pointer={}},show(e){let t,{nodes:n,duration:i,delay:r}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};!this.state.prevent&&this.state.targetElement&&(this.state.pointer=function(e,t){let{chart:n,state:i}=t,r=0,o=0;e.center?(r+=e.center.x,o+=e.center.y):(r+=e.clientX,o+=e.clientY);const s=n.element.getBoundingClientRect(),a=i.targetElement.getBoundingClientRect(),l=r,c=o,u=s.left-a.left,h=s.top-a.top,d=r-s.left,f=o-s.top;return r-=a.left,o-=a.top,{x:r,y:o,dx:u,dy:h,cx:d,cy:f,clientX:l,clientY:c,targetBounds:a,chartBounds:s}}(e,this),t=Array.isArray(n)?this.props.filter(n):this.props.filter(this.chart.shapesAt({x:this.state.pointer.cx,y:this.state.pointer.cy})),this.props.isEqual(this.state.activeNodes,t)||(this.dispatcher.clear(),this.state.activeNodes=t,this.state.activeNodes.length&&this.dispatcher.invoke((()=>this.invokeRenderer(this.state.activeNodes)),i,r)))},prevent(e){this.state.prevent=!!e},init(e){this.state={activeNodes:[],pointer:{},targetElement:null,prevent:!1},this.props=e.settings,this.dispatcher=Uh({defaultDuration:this.props.duration,defaultDelay:this.props.delay});const t=this.dispatcher.clear;this.dispatcher.on("pending",(()=>{!function(e){nd&&nd!==e&&nd()}(t),nd=t,"function"==typeof this.props.beforeShow&&this.props.beforeShow.call(void 0,{resources:{formatter:this.chart.formatter,scale:this.chart.scale}})})),this.dispatcher.on(["cancelled","fulfilled"],(()=>{const e={resources:{formatter:this.chart.formatter,scale:this.chart.scale}};"function"==typeof this.props.beforeHide&&this.props.beforeHide.call(void 0,A({element:this.state.tooltipElm},e)),"function"==typeof this.props.onHide?this.props.onHide.call(void 0,A({element:this.state.tooltipElm},e)):this.renderer.clear([]),"function"==typeof this.props.afterHide&&this.props.afterHide.call(void 0,e),nd===t&&(nd=null),this.state.tooltipElm=void 0})),this.dispatcher.on("active",(()=>{"function"==typeof this.props.afterShow&&this.props.afterShow.call(void 0,{element:this.state.tooltipElm,resources:{formatter:this.chart.formatter,scale:this.chart.scale}})}))},created(){this.init(this.settings)},beforeUpdate(e){let{settings:t}=e;this.dispatcher&&(this.dispatcher.destroy(),id()),this.init(t)},render(e){return this.h=e,[]},beforeDestroy(){this.dispatcher.destroy(),id()},appendTo(){if(this.props.appendTo){this.state.targetElement="function"==typeof this.props.appendTo?this.props.appendTo({resources:{formatter:this.chart.formatter,scale:this.chart.scale}}):this.props.appendTo;const{width:e,height:t}=this.state.targetElement.getBoundingClientRect();this.renderer.destroy(),this.renderer.size({width:e,height:t}),this.renderer.appendTo(this.state.targetElement)}else this.state.targetElement=this.renderer.element()},mounted(){this.appendTo()},updated(){this.appendTo()},invokeRenderer(e){const t=function(e,t){let{chart:n,scale:i,props:r,h:o}=t;const s={resources:{dataset:n.dataset,scale:n.scale,formatter:n.formatter},scale:i,h:o},a=[];return e.forEach((e=>{if("function"==typeof r.extract){const t=A({node:e},s);a.push(r.extract(t))}})),a}(e,this),n=td(Wh(t,{style:{left:"0px",top:"0px",visibility:"hidden"}},this).getBoundingClientRect(),this);this.state.tooltipElm=Wh(t,n,this)}};const sd={require:["renderer","chart"],defaultSettings:{settings:{target:"",selector:"*",fill:"rgba(0, 255, 0, 0.1)",stroke:"lime",opacity:1,useOuterRect:!1}},on:{update(){this.draw()}},draw(){const e=this.chart.findShapes(this.props.selector).filter((e=>e.key===this.props.target)),t=e.filter((e=>e.collider)).map((e=>e.collider));t.forEach((e=>{e.fill=this.props.fill,e.stroke=this.props.stroke,e.opacity=this.props.opacity,e.collider={type:null}})),this.renderer.render(t)},created(){this.props=this.settings.settings},resize(e){let{outer:t,inner:n}=e;return this.props.useOuterRect?t:n},render(){},mounted(){this.draw()},updated(){this.props=this.settings.settings,this.draw()}},ad=2*Math.PI;function ld(e,t,n,i){return Math.abs(e.x+n.x-(t.x+t.x))+Math.abs(e.y+n.y-(t.y+t.y))+Math.abs(t.x+i.x-(n.x+n.x))+Math.abs(t.y+i.y-(n.y+n.y))}function cd(e,t){return{x:.5*(e.x+t.x),y:.5*(e.y+t.y)}}function ud(e,t,n,i,r){const o=1-e;return o**3*t+3*o**2*e*n+3*o*e**2*i+e**3*r}function hd(e,t,n,i){let r=arguments.length>4&&void 0!==arguments[4]?arguments[4]:[],o=arguments.length>5&&void 0!==arguments[5]?arguments[5]:8;if(o<1||ld(e,t,n,i)<=10)return r[r.length-1]!==e&&r.push(e),r.push(i),r;const s=.5,a=cd(e,t),l=cd(t,n),c=cd(n,i),u={x:ud(s,e.x,t.x,n.x,i.x),y:ud(s,e.y,t.y,n.y,i.y)},h=cd(a,l),d=cd(l,c);return hd(e,a,h,u,r,o-1),hd(u,d,c,i,r,o-1),r}function dd(e,t,n){const{cp1:i,cp2:r}=function(e,t,n){return{cp1:{x:e.x+2/3*(t.x-e.x),y:e.y+2/3*(t.y-e.y)},cp2:{x:n.x+2/3*(t.x-n.x),y:n.y+2/3*(t.y-n.y)}}}(e,t,n);return hd(e,i,r,n)}function fd(e,t,n){const i=[],r=!!e[4],o=!!e[5],s=e[3];let a,l,c,u,h=e[6],d=e[7],f=e[1],p=e[2];if("a"===e[0]&&(h+=t,d+=n),t===d&&n===d)return i;if(!f||!p)return i.push({x:h,y:d}),i;({cx:a,cy:l,rx:f,ry:p,sweepAngle:c,startAngle:u}=function(e,t,n,i,r,o,s,a,l){let c,u,h,d,f,p;const m=Ls(n%360),g=Math.cos(m),y=Math.sin(m),v=(a-o)/2,b=(l-s)/2,x=g*v+y*b,w=g*b-y*v;p=x**2/(e=Math.abs(e))**2+w**2/(t=Math.abs(t))**2,p>1&&(p=Math.sqrt(p),e*=p,t*=p);const q=e*w,M=t*x,D=q**2+M**2,S=(e*t)**2-D;let _=Math.sqrt(Math.max(S/D,0));i===r&&(_=-_);const C=_*(q/t),k=_*(-M/e);d=g*C-y*k+(a+o)/2,f=y*C+g*k+(l+s)/2;const E=(x-C)/e,A=(w-k)/t,T=(-x-C)/e,I=(-w-k)/t;return c=Math.atan2(A,E),c+=c<0?ad:0,u=Math.atan2(I,T),u+=u<0?ad:0,h=u-c,!r&&c<u?h-=ad:r&&u<c&&(h+=ad),h%=ad,{startAngle:c,sweepAngle:h,cx:d,cy:f,rx:e,ry:t}}(f,p,s,r,o,h,d,t,n));const m=Math.abs(c*Math.sqrt((f**2+p**2)/2)),g=Math.ceil(m/10),y=c/g;for(let e=1;e<=g;e++){const t=(u+y*e)%ad,n=Math.cos(t),r=Math.sin(t);i.push({x:a+n*f+-r*n,y:l+r*p+n*r})}return i}function pd(e){const t=w.parsePath(e),n=[],i=[];let r=0,o=0,s=null,a=null,l=null,c=null;for(let e=0;e<t.length;++e){const u=t[e],h=u[0];switch("S"!==h&&"s"!==h&&"C"!==h&&"c"!==h&&(s=null,a=null),"T"!==h&&"t"!==h&&"Q"!==h&&"q"!==h&&(l=null,c=null),h){case"m":i.length&&n.push(i.splice(0));case"l":r+=u[1],o+=u[2],i.push({x:r,y:o});break;case"M":i.length&&n.push(i.splice(0));case"L":r=u[1],o=u[2],i.push({x:r,y:o});break;case"H":r=u[1],i.push({x:r,y:o});break;case"h":r+=u[1],i.push({x:r,y:o});break;case"V":o=u[1],i.push({x:r,y:o});break;case"v":o+=u[1],i.push({x:r,y:o});break;case"a":i.push(...fd(u,r,o)),r+=u[6],o+=u[7];break;case"A":i.push(...fd(u,r,o)),r=u[6],o=u[7];break;case"c":i.push(...hd({x:r,y:o},{x:u[1]+r,y:u[2]+o},{x:u[3]+r,y:u[4]+o},{x:u[5]+r,y:u[6]+o})),s=u[3]+r,a=u[4]+o,r+=u[5],o+=u[6];break;case"C":i.push(...hd({x:r,y:o},{x:u[1],y:u[2]},{x:u[3],y:u[4]},{x:u[5],y:u[6]})),s=u[3],a=u[4],r=u[5],o=u[6];break;case"s":null!==s&&null!==s||(s=r,a=o),i.push(...hd({x:r,y:o},{x:2*r-s,y:2*o-a},{x:u[1]+r,y:u[2]+o},{x:u[3]+r,y:u[4]+o})),s=u[1]+r,a=u[2]+o,r+=u[3],o+=u[4];break;case"S":null!==s&&null!==s||(s=r,a=o),i.push(...hd({x:r,y:o},{x:2*r-s,y:2*o-a},{x:u[1],y:u[2]},{x:u[3],y:u[4]})),s=u[1],a=u[2],r=u[3],o=u[4];break;case"Q":i.push(...dd({x:r,y:o},{x:u[1],y:u[2]},{x:u[3],y:u[4]})),l=u[1],c=u[2],r=u[3],o=u[4];break;case"q":i.push(...dd({x:r,y:o},{x:u[1]+r,y:u[2]+o},{x:u[3]+r,y:u[4]+o})),l=u[1]+r,c=u[2]+o,r+=u[3],o+=u[4];break;case"T":null!==l&&null!==l||(l=r,c=o),l=2*r-l,c=2*o-c,i.push(...dd({x:r,y:o},{x:l,y:c},{x:u[1],y:u[2]})),r=u[1],o=u[2];break;case"t":null!==l&&null!==l||(l=r,c=o),l=2*r-l,c=2*o-c,i.push(...dd({x:r,y:o},{x:l,y:c},{x:u[1]+r,y:u[2]+o})),r+=u[1],o+=u[2];break;case"z":case"Z":i.length&&i.push({x:i[0].x,y:i[0].y})}}return function(e){for(let t=0;t<e.length-1;t++){const n=e[t],i=e[t+1];Math.abs(n.x-i.x)<1e-12&&Math.abs(n.y-i.y)<1e-12&&(e.splice(t,1),t--)}}(i),n.push(i.splice(0)),n}const md={require:["renderer","chart"],defaultSettings:{settings:{target:"",fill:"transparent",stroke:"lime",opacity:1,radius:2,useOuterRect:!1}},on:{update(){this.draw()}},draw(){const e=this.chart.findShapes("path").filter((e=>e.key===this.props.target)),t=[];e.forEach((e=>{pd(e.attrs.d).forEach((e=>{e.forEach((e=>{t.push({type:"circle",cx:e.x,cy:e.y,r:this.props.radius,fill:this.props.fill,stroke:this.props.stroke,opacity:this.props.opacity,collider:{type:null}})}))}))})),this.renderer.render(t)},created(){this.props=this.settings.settings},resize(e){let{outer:t,inner:n}=e;return this.props.useOuterRect?t:n},render(){},mounted(){this.draw()},updated(){this.props=this.settings.settings,this.draw()}};var gd=[function(e){e.component("box",_l),e.component("box-marker",_l)},function(e){e.component("point",Rl),e.component("point-marker",Rl)},function(e){e.component("pie",Ll)},function(e){e.component("grid-line",Bl)},function(e){e.component("ref-line",Kl)},function(e){e.component("axis",yc)},function(e){e.component("container",vc)},function(e){e.component("text",wc)},function(e){e.component("scrollbar",Dc)},function(e){e.component("brush-range",zc),e.component("brush-area-dir",Vc)},function(e){e.component("range",Yc)},function(e){e.component("brush-lasso",Qc)},function(e){e.component("labels",yh)},function(e){e.component("legend-cat",Ah)},function(e){e.component("legend-seq",Ph)},function(e){e.component("line",jh)},function(e){e.component("brush-area",$h)},function(e){e.component("tooltip",od)},function(e){e.component("debug-collider",sd)},function(e){e.component("debug-path-to-points",md)}];let yd=class{constructor(e){this._parent=null,this._children=[],this._ancestors=null,this.type=e,this.data=null}detach(){return this._parent&&this._parent.removeChild(this),this}get parent(){return this._parent}get isBranch(){return this._children&&this._children.length}get children(){return this._children}get ancestors(){return this._ancestors||(this._ancestors=[],this.parent&&this._ancestors.push(this.parent,...this.parent.ancestors)),this._ancestors}get descendants(){let e=[];const t=this.children.length;let n,i;for(n=0;n<t;n++)i=this.children[n],e.push(i),i.children.length&&(e=[...e,...i.descendants]);return e}equals(e){const t=this.children,n=e.children;if(t.length!==n.length)return!1;for(let e=0;e<t.length;e++)if(!t[e].equals(n[e]))return!1;return!0}toJSON(){return{type:this.type,children:this.children.map((e=>e.toJSON()))}}};class vd{constructor(){let{x:e=0,y:t=0,width:n=0,height:i=0,minWidth:r=0,minHeight:o=0}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.set({x:e,y:t,width:n,height:i,minWidth:r,minHeight:o})}set(){let{x:e=0,y:t=0,width:n=0,height:i=0,minWidth:r=0,minHeight:o=0}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.type="rect",n>=0?(this.x=e,this.width=Math.max(n,r)):(this.x=e+Math.min(n,-r),this.width=-Math.min(n,-r)),i>=0?(this.y=t,this.height=Math.max(i,o)):(this.y=t+Math.min(i,-o),this.height=-Math.min(i,-o))}containsPoint(e){return Ma(this,e)}intersectsLine(e){return Da(this,B(e))}intersectsRect(e){return wa(this,H(e))}intersectsCircle(e){return ma(e,this)}intersectsPolygon(e){return xa(e,this)}intersectsGeoPolygon(e){return Ia(e,this)}points(){return[{x:this.x,y:this.y},{x:this.x+this.width,y:this.y},{x:this.x+this.width,y:this.y+this.height},{x:this.x,y:this.y+this.height}]}}class bd{constructor(){let{cx:e=0,cy:t=0,r:n=0,minRadius:i=0}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.set({cx:e,cy:t,r:n,minRadius:i})}set(){let{cx:e=0,cy:t=0,r:n=0,minRadius:i=0}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.type="circle",this.cx=e,this.cy=t,this.r=Math.max(n,i),this.vector={x:this.cx,y:this.cy}}containsPoint(e){return pa(this,e)}intersectsLine(e){return ga(this,B(e))}intersectsRect(e){return ma(this,H(e))}intersectsCircle(e){return n=e,!ua(t=this)&&!ua(n)&&(t.cx-n.cx)**2+(t.cy-n.cy)**2<=(t.r+n.r)**2;var t,n}intersectsPolygon(e){return ya(this,e)}intersectsGeoPolygon(e){return Ea(this,e)}points(){return[{x:this.cx,y:this.cy}]}}class xd{constructor(){let{x1:e=0,y1:t=0,x2:n=0,y2:i=0,tolerance:r=0}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.set({x1:e,y1:t,x2:n,y2:i,tolerance:r})}set(){let{x1:e=0,y1:t=0,x2:n=0,y2:i=0,tolerance:r=0}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.type="line",this.x1=e,this.y1=t,this.x2=n,this.y2=i,this.tolerance=Math.max(0,Math.round(r)),this.vectors=this.points(),this.zeroSize=e===n&&t===i}containsPoint(e){if(this.tolerance>0){return ga({cx:e.x,cy:e.y,r:this.tolerance},this)}return _a(this,e)}intersectsLine(e){return Sa(this,B(e))}intersectsRect(e){return Da(H(e),this)}intersectsCircle(e){return ga(e,this)}intersectsPolygon(e){return ba(e,this)}intersectsGeoPolygon(e){return Ta(e,this)}points(){return[{x:this.x1,y:this.y1},{x:this.x2,y:this.y2}]}}class wd{constructor(){let{vertices:e=[]}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.set({vertices:e})}set(){let{vertices:e=[]}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(this.type="polygon",this.vertices=e.slice(),this.edges=[],function(e){for(let t=0;t<e.length-1;t++){const n=e[t],i=e[t+1];n.x===i.x&&n.y===i.y&&(e.splice(t,1),t--)}}(this.vertices),!(this.vertices.length<=2)){!function(e){const t=e[0],n=e[e.length-1];t.x===n.x&&t.y===n.y||e.push(t)}(this.vertices),this.xMin=NaN,this.yMin=NaN,this.xMax=NaN,this.yMax=NaN;for(let e=0;e<this.vertices.length;e++)e<this.vertices.length-1&&this.edges.push([this.vertices[e],this.vertices[e+1]]),this.xMin=isNaN(this.xMin)?this.vertices[e].x:Math.min(this.xMin,this.vertices[e].x),this.xMax=isNaN(this.xMax)?this.vertices[e].x:Math.max(this.xMax,this.vertices[e].x),this.yMin=isNaN(this.yMin)?this.vertices[e].y:Math.min(this.yMin,this.vertices[e].y),this.yMax=isNaN(this.yMax)?this.vertices[e].y:Math.max(this.yMax,this.vertices[e].y);this._bounds=null,this._boundingRect=null}}containsPoint(e){return va(this,e)}intersectsCircle(e){return ya(e,this)}intersectsLine(e){return ba(this,B(e))}intersectsRect(e){return xa(this,H(e))}intersectsPolygon(e){return Ca(this,e)}intersectsGeoPolygon(e){return ka(e,this)}points(){return this.vertices}bounds(){return this._bounds||(this._bounds=[{x:this.xMin,y:this.yMin},{x:this.xMax,y:this.yMin},{x:this.xMax,y:this.yMax},{x:this.xMin,y:this.yMax}]),this._bounds}boundingRect(){return this._boundingRect||(this._boundingRect={x:this.xMin,y:this.yMin,width:this.xMax-this.xMin,height:this.yMax-this.yMin}),this._boundingRect}}function qd(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return new wd(...t)}function Md(e){const t=e[0],n=e[e.length-1];t.x===n.x&&t.y===n.y||e.push(t)}function Dd(e){for(let t=0;t<e.length-1;t++){const n=e[t],i=e[t+1];n.x===i.x&&n.y===i.y&&(e.splice(t,1),t--)}}class Sd{constructor(){let{vertices:e=[[]]}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.set({vertices:e})}set(){let{vertices:e=[]}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.type="geopolygon",this.vertices=e.slice(),this.numPolygons=this.vertices.length,this.polygons=[],this.xMin=NaN,this.yMin=NaN,this.xMax=NaN,this.yMax=NaN;for(let e=0;e<this.numPolygons;e++)Dd(this.vertices[e]),this.vertices[e].length>2&&Md(this.vertices[e]),this.polygons[e]=qd({vertices:this.vertices[e]}),this.xMin=isNaN(this.xMin)?this.polygons[e].xMin:Math.min(this.xMin,this.polygons[e].xMin),this.xMax=isNaN(this.xMax)?this.polygons[e].xMax:Math.max(this.xMax,this.polygons[e].xMax),this.yMin=isNaN(this.yMin)?this.polygons[e].yMin:Math.min(this.yMin,this.polygons[e].yMin),this.yMax=isNaN(this.yMax)?this.polygons[e].yMax:Math.max(this.yMax,this.polygons[e].yMax);this._bounds=null,this._boundingRect=null}containsPoint(e){return Aa(this,e)}intersectsCircle(e){return Ea(e,this)}intersectsLine(e){return Ta(this,B(e))}intersectsRect(e){return Ia(this,H(e))}intersectsPolygon(e){return ka(this,e)}intersectsGeoPolygon(e){return function(e,t){const n=e.boundingRect(),i=t.boundingRect();return!!wa(n,i)&&(qa(i,n)?fa(t,e):fa(e,t))}(this,e)}points(){return this.vertices}bounds(){return this._bounds||(this._bounds=[{x:this.xMin,y:this.yMin},{x:this.xMax,y:this.yMin},{x:this.xMax,y:this.yMax},{x:this.xMin,y:this.yMax}]),this._bounds}boundingRect(){return this._boundingRect||(this._boundingRect={x:this.xMin,y:this.yMin,width:this.xMax-this.xMin,height:this.yMax-this.yMin}),this._boundingRect}}function _d(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return new Sd(...t)}class Cd{constructor(){let{points:e=[]}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.set({points:e})}set(){let{points:e=[]}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(this.type="polyline",this.segments=[],this._points=e.slice(),this._points.length>1)for(let e=0,i=this._points.length-1;e<i;e++)t=this._points[e],n=this._points[e+1],(t.x!==n.x||t.y!==n.y)&&this.segments.push({x1:this._points[e].x,y1:this._points[e].y,x2:this._points[e+1].x,y2:this._points[e+1].y});var t,n}containsPoint(e){return this.segments.some((t=>_a(t,e)))}intersectsCircle(e){return this.segments.some((t=>ga(e,t)))}intersectsLine(e){const t=B(e);return this.segments.some((e=>Sa(e,t)))}intersectsRect(e){const t=H(e);return this.segments.some((e=>Da(t,e)))}intersectsPolygon(e){return this.segments.some((t=>ba(e,t)))}intersectsGeoPolygon(e){return this.segments.some((t=>Ta(e,t)))}points(){return this._points}}const kd=Ge();function Ed(e,t){return kd.get(e)(t)}kd.add("rect",(function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return new vd(...t)})),kd.add("circle",(function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return new bd(...t)})),kd.add("line",(function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return new xd(...t)})),kd.add("polygon",qd),kd.add("geopolygon",_d),kd.add("polyline",(function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return new Cd(...t)}));class Ad{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];this.set(e)}set(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];this.geometries=[],e.forEach((e=>{const t=Ed(e.type,e);t&&this.geometries.push(t)}))}containsPoint(e){return this.geometries.some((t=>t.containsPoint(e)))}intersectsLine(e){return this.geometries.some((t=>t.intersectsLine(e)))}intersectsRect(e){return this.geometries.some((t=>t.intersectsRect(e)))}intersectsCircle(e){return this.geometries.some((t=>t.intersectsCircle(e)))}intersectsPolygon(e){return this.geometries.some((t=>t.intersectsPolygon(e)))}intersectsGeoPolygon(e){return this.geometries.some((t=>t.intersectsGeoPolygon(e)))}}class Td{constructor(){this._elements=[[1,0,0],[0,1,0],[0,0,1]],this._stack=[]}clone(){return(new Td).multiply(this)}set(e){return this._elements=e,this}save(){return this._stack.push(this.elements),this}restore(){return this._stack.length&&(this._elements=this._stack.pop()),this}add(e){let t,n;for(t=0;t<this._elements.length;t++)for(n=0;n<this._elements[t].length;n++)this._elements[t][n]+=e;return this}translate(e,t){return this.multiply([[1,0,e],[0,1,t],[0,0,1]]),this}rotate(e){let t=Math.cos(-e),n=Math.sin(-e);return this.multiply([[t,n,0],[-n,t,0],[0,0,1]]),this}multiply(e){let t,n,i,r;if(e instanceof Td&&(e=e._elements),Array.isArray(e)){for(i=[[0,0,0],[0,0,0],[0,0,0]],t=0;t<this._elements.length;t++)for(n=0;n<this._elements[t].length;n++)for(r=0;r<3;r++)i[t][n]+=this._elements[t][r]*e[r][n];this._elements=i}else for(t=0;t<this._elements.length;t++)for(n=0;n<this._elements[t].length;n++)this._elements[t][n]*=e;return this}scale(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:e;return this.multiply([[e,0,0],[0,t,0],[0,0,1]]),this}transform(e,t,n,i,r,o){return this.multiply([[e,n,r],[t,i,o],[0,0,1]]),this}determinant(){let e=this._elements[0][0],t=this._elements[0][1],n=this._elements[0][2],i=this._elements[1][0],r=this._elements[1][1],o=this._elements[1][2],s=this._elements[2][0],a=this._elements[2][1],l=this._elements[2][2],c=0;return c=e*r*l+t*o*s+n*i*a-n*r*s-t*i*l-e*o*a,c}invert(){let e=this.determinant(),t=this._elements[0][0],n=this._elements[0][1],i=this._elements[0][2],r=this._elements[1][0],o=this._elements[1][1],s=this._elements[1][2],a=this._elements[2][0],l=this._elements[2][1],c=this._elements[2][2];return this._elements=[[o*c-s*l,i*l-n*c,n*s-i*o],[s*a-r*c,t*c-i*a,i*r-t*s],[r*l-o*a,a*n-t*l,t*o-n*r]],this.multiply(1/e),this}transpose(){const e=Object.create(this._elements);return this._elements=[[e[0][0],e[1][0],e[2][0]],[e[0][1],e[1][1],e[2][1]],[e[0][2],e[1][2],e[2][2]]],this}identity(){return this._elements=[[1,0,0],[0,1,0],[0,0,1]],this}toString(){return"".concat(this._elements.map((e=>e.join("\t"))).join("\n"))}isIdentity(){const e=this._elements;return 1===e[0][0]&&0===e[0][1]&&0===e[0][2]&&0===e[1][0]&&1===e[1][1]&&0===e[1][2]&&0===e[2][0]&&0===e[2][1]&&1===e[2][2]}transformPoint(e){let t,n,i=[e.x,e.y,1],r=this._elements,o=[0,0,0];for(t=0;t<this._elements.length;t++)for(n=0;n<this._elements[t].length;n++)o[t]+=i[n]*r[t][n];return{x:o[0],y:o[1]}}transformPoints(e){let t,n,i,r,o,s=this._elements,a=[];for(r=0;r<e.length;r++){for(t=[e[r].x,e[r].y,1],o=[0,0,0],n=0;n<this._elements.length;n++)for(i=0;i<this._elements[n].length;i++)o[n]+=t[i]*s[n][i];a.push({x:o[0],y:o[1]})}return a}get elements(){const e=this._elements;return[[e[0][0],e[0][1],e[0][2]],[e[1][0],e[1][1],e[1][2]],[e[2][0],e[2][1],e[2][2]]]}}const Id=/(translate|scale|rotate|matrix)\(([0-9,.eE+-\s]+)(?:,|\s?)+\)/g;function Rd(e,t){const n=t.args[0]*(Math.PI/180);if(t.args.length>2){const i=t.args[1],r=t.args[2];e.translate(i,r),e.rotate(n),e.translate(-i,-r)}else 1===t.args.length&&e.rotate(n)}function Nd(e,t){const n=t.args[0],i=isNaN(t.args[1])?t.args[0]:t.args[1];e.scale(n,i)}function Od(e,t){const n=t.args[0],i=isNaN(t.args[1])?0:t.args[1];e.translate(n,i)}function Pd(e,t){t.args.length>=6&&e.transform(...t.args)}function Ld(e,t){const n=function(e){let t,n=[];for(;null!==(t=Id.exec(e));){const e=t[2].trim(),i=-1===e.indexOf(",")?e.split(" "):e.split(",");n.push({cmd:t[1],args:i.filter((e=>e.trim().length>0)).map((e=>Number(e)))})}return n}(e);let i;for(let e=0,r=n.length;e<r;e++)i=n[e],"rotate"===i.cmd?Rd(t,i):"scale"===i.cmd?Nd(t,i):"matrix"===i.cmd?Pd(t,i):"translate"===i.cmd&&Od(t,i)}const Fd={type:/^\w[\w-]+/,attr:/^\[\w(?:[\w\._-]+)?(?:[!]?=['\"][\w\s*#_-]*['\"])?\]/,universal:/^(\*)/,tag:/^\.(\w+)/},zd={type:(e,t)=>t.filter((t=>{const n=t.type;return!!n&&n.toLowerCase()===e.toLowerCase()})),attr:(e,t,n,i)=>i.filter((i=>{const r=i.attrs[e];if(!t)return void 0!==r;if(void 0===r)return!1;switch(t){case"=":return n===String(r);case"!=":return n!==String(r);default:return!1}})),universal:e=>e,tag:(e,t)=>t.filter((t=>{const n=t.tag;return!!n&&-1!==n.trim().split(/\s+/).indexOf(e.replace(".",""))}))};function jd(e,t){if(!t||!t.length||!e||"function"!=typeof zd[e.type])return[];switch(e.type){case"type":case"tag":return zd[e.type](e.value,t);case"attr":return zd[e.type](e.attribute,e.operator,e.attributeValue,t);case"universal":return zd[e.type](t);default:return[]}}var Hd={find:function(e,t){const n=[],i=[];let r,o;if(t.isBranch){let s;r=function(e){const t=[];let n,i,r,o;return e.split(/\s*,\s*/).forEach((e=>{e=e.trim(),n=[];const s=t=>{r=e.match(Fd[t]),r&&(o=!0,e=e.slice(r[0].length),i={type:t,value:r[0]},"attr"===t&&(r=r[0].match(/\[(\w[\w\._-]+)?(?:([!]?=)['\"]([\w\s#_-]*)['\"])?\]/),i.attribute=r[1],i.operator=r[2],i.attributeValue=r[3]),n.push(i))};for(;e&&(o=!1,r=e.match(/^\s*([>+~]|\s)\s*/),r&&(o=!0,n.push({type:" ",value:r[0]}),e=e.slice(r[0].length)),Object.keys(Fd).forEach(s),n&&n.length&&t.indexOf(n)<0&&t.push(n),o););})),t}(e),o=t.descendants;for(let e=0,t=r.length;e<t;e++){s=r[e];const t=[];let n=o.slice(),a=!1;s.reverse().forEach((e=>{if(" "===e.type)return t.push(n),n=o.slice(),void(a=!1);n=jd(e,n),a=!0})),a&&t.push(n);const l=t[0].filter((e=>{let n,i=e.parent;for(let e=1;e<t.length;e++){for(n=t[e].indexOf(i);i&&n<0;)i=i.parent,n=t[e].indexOf(i);if(n<0)return!1}return!0}));i.push(l)}for(let e=0,t=i.length;e<t;e++)for(let t=0,r=i[e].length;t<r;t++)n.indexOf(i[e][t])<0&&n.push(i[e][t])}return n||[]}};function Bd(e,t,n){const i=e.type;let r=e.points();n&&(r=r.every((e=>Array.isArray(e)))?r.map((e=>n.transformPoints(e))):n.transformPoints(r)),function(e,t){for(let n=0,i=e.length;n<i;n++)e[n].x/=t,e[n].y/=t}(r,t);let o=null;if("rect"===i||"bounds"===i)o=H(r),o.type=i;else if("circle"===i)o=function(e,t){return{cx:e[0].x,cy:e[0].y,r:t}}(r,e.r),o.type=i;else if("line"===i)o=B(r),o.type=i;else if("polygon"===i||"polyline"===i){o={type:"path",d:Os(r,"polygon"===i)}}else if("geopolygon"===i){let e="";for(let t=0;t<r.length;t++)e+=Os(r[t],!0);o={type:"path",d:e}}return o}class Vd{constructor(e){this._bounds=function(){let t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];const{x:n,y:i,width:r,height:o}=e.boundingRect?e.boundingRect(t):{x:0,y:0,width:0,height:0};return{x:n,y:i,width:r,height:o}},this._attrs=e.attrs,this._type=e.type,this._data=e.data,this._dpi=e.stage?e.stage.dpi:1,this._collider=()=>function(e,t){if(e.collider){const n=e.modelViewMatrix;return"collection"===e.colliderType?{type:"container",children:e.collider.geometries.map((e=>Bd(e,t,n)))}:Bd(e.collider,t,n)}return null}(e,this._dpi),this._desc=e.desc,this._tag=e.tag,this._children=()=>e.children.map((e=>new Vd(e))),this._parent=()=>e.parent?new Vd(e.parent):null,this._cache={elementBoundingRect:null},this._getElementBoundingRect=()=>(!this._cache.elementBoundingRect&&this.element&&(this._cache.elementBoundingRect=this.element.getBoundingClientRect()),this._cache.elementBoundingRect||{left:0,top:0})}get children(){return this._children()}get parent(){return this._parent()}get type(){return this._type}get data(){return this._data}get attrs(){return this._attrs}set element(e){this._cache.elementBoundingRect=null,this._element=e}get element(){return this._element}set key(e){this._key=e}get key(){return this._key}get bounds(){const e=this._bounds();return e.x/=this._dpi,e.y/=this._dpi,e.width/=this._dpi,e.height/=this._dpi,e}get localBounds(){return this._bounds(!1)}boundsRelativeTo(e){const t=typeof e,n=!(arguments.length>1&&void 0!==arguments[1])||arguments[1]?this.bounds:this.localBounds,i=this._getElementBoundingRect();let r=i.left,o=i.top;if("object"===t&&null!==e&&"function"==typeof e.getBoundingClientRect){const{left:t=0,top:n=0}=e.getBoundingClientRect();r-=t,o-=n}return n.x+=r,n.y+=o,n}get collider(){return this._collider()}get desc(){return this._desc}get tag(){return this._tag}}function $d(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return new Vd(...t)}class Wd{constructor(e){this._node=$d(e),this._parent=null,this._input=null}get node(){return this._node}set parent(e){this._parent=e}get parent(){return this._parent}set input(e){this._input=e}get input(){return this._input}}function Ud(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return new Wd(...t)}function Yd(e,t){const n=e.parent;if(n&&"stage"!==n.type){t.parent=Ud(n);const e=n.parent;e&&"stage"!==e.type&&Yd(e,t.parent)}}function Xd(e,t,n){if(null===e.colliderType)return null;const i=function(e,t){let n={};if(e.modelViewMatrix)if(Array.isArray(t))n=e.inverseModelViewMatrix.transformPoints(t);else if(isNaN(t.r))Array.isArray(t.vertices)?n.vertices=e.inverseModelViewMatrix.transformPoints(t.vertices):n=e.inverseModelViewMatrix.transformPoint(t);else{const i={x:t.cx,y:t.cy};({x:n.cx,y:n.cy}=e.inverseModelViewMatrix.transformPoint(i)),n.r=t.r}else n=t;return Array.isArray(n.vertices)&&(n=n.vertices.every((e=>Array.isArray(e)))?_d(n):qd(n)),n}(e,n);return"frontChild"===e.colliderType?function(e,t,n){for(let i=e.descendants.length-1;i>=0;i--){const r=e.descendants[i];if(null!==r.collider&&r.collider[t](n)){const e=Ud(r);return Yd(r,e),e}}return null}(e,t,i):function(e,t,n){if(e.collider[t](n)){const t=Ud(e);return Yd(e,t),t}return null}(e,t,i)}function Kd(e,t,n,i){const r=e.length;for(let o=0;o<r;o++){const r=e[o],s=Xd(r,t,i);s&&n.push(s),!r.children||s||r.collider||Kd(r.children,t,n,i)}}function Gd(e,t,n){const i=e.length;for(let r=0;r<i;r++){const i=e[r];if(null!==Xd(i,t,n))return!0;if(i.children&&!i.collider)return Gd(i.children,t,n)}return!1}function Jd(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;const n=V(e);let i={};switch(n){case"circle":return i.cx=e.cx*t,i.cy=e.cy*t,i.r=e.r,["intersectsCircle",i];case"rect":return i=j(e).map((e=>Hs(e,t))),["intersectsRect",i];case"line":return i=z(e).map((e=>Hs(e,t))),["intersectsLine",i];case"point":return i=Hs(e,t),["containsPoint",i];case"polygon":return i.vertices=e.vertices.map((e=>Hs(e,t))),["intersectsPolygon",i];case"geopolygon":return i.vertices=e.vertices.map((e=>e.map((e=>Hs(e,t))))),["intersectsGeoPolygon",i];default:return[]}}function Zd(e,t){const[n,i]=Jd(t,e.dpi),r=[];return n&&(Kd([e],n,r,i),function(e,t){for(let n=0,i=t.length;n<i;n++)t[n].input=e}(t,r)),r}function Qd(e,t){const[n,i]=Jd(t,e.dpi);return Gd([e],n,i)}class ef extends yd{constructor(e){super(e),this._stage=null,this._collider={type:null,definition:null,fn:null},this._attrs={},this._node=null}set(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.node=e;const{data:t,desc:n,tag:i,strokeReference:r,fillReference:o}=e;var s,a;s=this.attrs,a=e,Object.keys(Ns).forEach((e=>{const t=a[e];void 0!==t&&(s[Ns[e]]=t)})),void 0!==t&&(this.data=t),"object"==typeof n&&(this.desc=A(!0,{},n)),"string"==typeof i&&(this.tag=i),"string"==typeof r&&(this.strokeReference=r),"string"==typeof o&&(this.fillReference=o)}findShapes(e){return Hd.find(e,this).map((e=>$d(e)))}getItemsFrom(e){return Zd(this,e)}containsPoint(e){return Qd(this,e)}intersectsLine(e){return Qd(this,e)}intersectsRect(e){return Qd(this,e)}intersectsCircle(e){return Qd(this,e)}intersectsPolygon(e){return Qd(this,e)}intersectsGeoPolygon(e){return Qd(this,e)}resolveLocalTransform(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new Td;void 0!==this.attrs.transform&&Ld(this.attrs.transform,e),this.modelViewMatrix=e.clone()}resolveGlobalTransform(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new Td;const t=this.ancestors;if(t.length>0)for(let n=t.length-1;n>=0;n--)t[n].resolveLocalTransform(e),e=t[n].modelViewMatrix;this.resolveLocalTransform(e)}attr(e){return this.attrs[e]}equals(e){const t=this.attrs,n=Object.keys(t),i=e.attrs,r=Object.keys(i);if(n.length!==r.length)return!1;for(let e=0;e<n.length;e++){const r=n[e];if(!Object.hasOwnProperty.call(i,r))return!1;if(t[r]!==i[r])return!1}return super.equals(e)}toJSON(){const e=super.toJSON();return e.attrs=this.attrs,e}get attrs(){return this._attrs}get stage(){return this._parent&&!this._stage?this._stage=this._parent.stage:this._parent||this._stage===this||(this._stage=null),this._stage}set modelViewMatrix(e){this._mvm=e,this._imvm=null}get modelViewMatrix(){return this._mvm}get inverseModelViewMatrix(){return this._imvm=this._imvm?this._imvm:this._mvm.clone().invert(),this._imvm}set node(e){this._node=e}get node(){return this._node}set collider(e){const t=Array.isArray(e)?"collection":e&&e.type;return"string"!=typeof t?(this._collider.type=null,this._collider.definition=null,void(this._collider.fn=null)):null!==this._collider&&this._collider.type===t&&null!==this._collider.fn?(this._collider.fn.set(e),void(this._collider.definition=e)):(this._collider.type=t,void(this._collider.definition=e))}get collider(){if(null!==this._collider.fn)return this._collider.fn;switch(this._collider.type){case"collection":this._collider.fn=function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return new Ad(...t)}(this._collider.definition);break;case"frontChild":return!0;case"bounds":this._collider.fn=Ed("rect",this.boundingRect());break;case"line":case"rect":case"circle":case"polygon":case"geopolygon":case"polyline":this._collider.fn=Ed(this._collider.type,this._collider.definition);break;default:return null}return this._collider.fn}get colliderType(){return this._collider.type}}class tf extends yd{addChild(e){if(!(e&&e instanceof yd))throw new TypeError("Expecting a Node as argument, but got ".concat(e));if(e===this)throw new Error("Can not add itself as child!");if(e._children&&e._children.length&&this.ancestors.indexOf(e)>=0)throw new Error("Can not add an ancestor as child!");return e._parent&&e._parent!==this&&e._parent.removeChild(e),this._children.push(e),e._parent=this,e._ancestors=null,this}addChildren(e){let t,n=e?e.length:0;for(t=0;t<n;t++)this.addChild(e[t]);return this}removeChild(e){const t=this._children.indexOf(e);return t>=0&&(this._children.splice(t,1),e._parent=null,e._ancestors=null),this}removeChildren(e){let t,n;if(!this._children)return this;if(e)for(n=e.length,t=0;t<n;t++)this.removeChild(e[t]);else for(;this._children.length;)this.removeChild(this._children[0]);return this}}const nf=tf.prototype;class rf extends ef{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const{type:t="container"}=e;super(t),this.set(e)}set(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};super.set(e);const{collider:t}=e,n=A({type:null},t);this.collider=n,this.__boundingRect={true:null,false:null},this.__bounds={true:null,false:null}}appendChildRect(e,t){if(void 0!==e.bounds){const n=this.__boundingRect[t]||{},[i,,r]=e.bounds(t),{x:o,y:s}=i,{x:a,y:l}=r,c=isNaN(n.width)?a:Math.max(a,n.width+n.x),u=isNaN(n.height)?l:Math.max(l,n.height+n.y);n.x=isNaN(n.x)?o:Math.min(o,n.x),n.y=isNaN(n.y)?s:Math.min(s,n.y),n.width=c-n.x,n.height=u-n.y,this.__boundingRect[t]=n}}boundingRect(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(null!==this.__boundingRect[e])return this.__boundingRect[e];const t=this.children.length;for(let n=0;n<t;n++)this.appendChildRect(this.children[n],e);return this.__boundingRect[e]=A({x:0,y:0,width:0,height:0},this.__boundingRect[e]),this.__boundingRect[e]}bounds(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(null!==this.__bounds[e])return this.__bounds[e];const t=this.boundingRect(e);return this.__bounds[e]=[{x:t.x,y:t.y},{x:t.x+t.width,y:t.y},{x:t.x+t.width,y:t.y+t.height},{x:t.x,y:t.y+t.height}],this.__bounds[e]}addChild(e){const t=nf.addChild.call(this,e);if(this._collider&&"bounds"===this._collider.type){this.appendChildRect(e,!0);const t=A({type:"bounds",x:0,y:0,width:0,height:0},this.__boundingRect.true);this.collider=t}return t}addChildren(e){const t=nf.addChildren.call(this,e),n=e.length;if(this._collider&&"bounds"===this._collider.type&&n>0){for(let t=0;t<n;t++)this.appendChildRect(e[t],!0);const t=A({type:"bounds",x:0,y:0,width:0,height:0},this.__boundingRect.true);this.collider=t}return t}removeChild(e){e._stage=null;let t,n=e.descendants,i=n?n.length:0;for(t=0;t<i;t++)n[t]._stage=null;if(nf.removeChild.call(this,e),this._collider&&"bounds"===this._collider.type){this.__boundingRect={true:null,false:null},this.__bounds={true:null,false:null};const e=A(this.boundingRect(!0),{type:"bounds"});this.collider=e}return this}removeChildren(e){if(nf.removeChildren.call(this,e),this._collider&&"bounds"===this._collider.type){this.__boundingRect={true:null,false:null},this.__bounds={true:null,false:null};const e=A(this.boundingRect(!0),{type:"bounds"});this.collider=e}return this}}function of(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return new rf(...t)}class sf extends rf{constructor(e){super("stage"),this._stage=this,this._dpiRatio=e||1}get dpi(){return this._dpiRatio}}const af=tf.prototype,lf=["x1","x2","y1","y2","id","offset","style"];class cf extends ef{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const{type:t="container"}=e;super(t),this.set(e),this._boundingRect={}}set(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};super.set(e);const t=this.attrs;let n="";for(let i=0,r=lf.length;i!==r;i++)n=lf[i],void 0!==e[n]&&(t[n]=e[n])}addChild(e){return af.addChild.call(this,e)}addChildren(e){return af.addChildren.call(this,e)}removeChild(e){e._stage=null;let t,n=e.descendants,i=n?n.length:0;for(t=0;t<i;t++)n[t]._stage=null;return af.removeChild.call(this,e),this}removeChildren(e){return af.removeChildren.call(this,e),this}}function uf(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return new cf(...t)}const hf=tf.prototype,df=["patternUnits","x","y","width","height","id"];class ff extends ef{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const{type:t="container"}=e;super(t),this.set(e),this._boundingRect={}}set(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};super.set(e);const t=this.attrs;let n="";for(let i=0,r=df.length;i!==r;i++)n=df[i],void 0!==e[n]&&(t[n]=e[n])}addChild(e){return hf.addChild.call(this,e)}addChildren(e){return hf.addChildren.call(this,e)}removeChild(e){e._stage=null;let t,n=e.descendants,i=n?n.length:0;for(t=0;t<i;t++)n[t]._stage=null;return hf.removeChild.call(this,e),this}removeChildren(e){return hf.removeChildren.call(this,e),this}}let pf=class extends ef{constructor(){super("rect"),this.set(...arguments)}set(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const{x:t=0,y:n=0,width:i=0,height:r=0,rx:o=0,ry:s=0,collider:a}=e,l=A({type:"rect",x:t,y:n,width:i,height:r},a);super.set(e),i>=0?(this.attrs.x=t,this.attrs.width=i):(this.attrs.x=t+i,this.attrs.width=-i),r>=0?(this.attrs.y=n,this.attrs.height=r):(this.attrs.y=n+r,this.attrs.height=-r),o>0&&(this.attrs.rx=o),s>0&&(this.attrs.ry=s),this.collider=l,this.__boundingRect={true:null,false:null},this.__bounds={true:null,false:null}}boundingRect(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(null!==this.__boundingRect[e])return this.__boundingRect[e];const t=j(this.attrs),n=e&&this.modelViewMatrix?this.modelViewMatrix.transformPoints(t):t,[i,r,o,s]=F(n);return this.__boundingRect[e]={x:i,y:r,width:o-i,height:s-r},this.__boundingRect[e]}bounds(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(null!==this.__bounds[e])return this.__bounds[e];const t=this.boundingRect(e);return this.__bounds[e]=[{x:t.x,y:t.y},{x:t.x+t.width,y:t.y},{x:t.x+t.width,y:t.y+t.height},{x:t.x,y:t.y+t.height}],this.__bounds[e]}};class mf extends ef{constructor(){super("circle"),this.set(...arguments)}set(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const{cx:t=0,cy:n=0,r:i=0,collider:r}=e,o=A({type:"circle",cx:t,cy:n,r:i},r);super.set(e),this.attrs.cx=t,this.attrs.cy=n,this.attrs.r=i,this.collider=o,this.__boundingRect={true:null,false:null},this.__bounds={true:null,false:null}}boundingRect(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(null!==this.__boundingRect[e])return this.__boundingRect[e];const t=this.bounds(e);return this.__boundingRect[e]={x:t[0].x,y:t[0].y,width:t[2].x-t[0].x,height:t[2].y-t[0].y},this.__boundingRect[e]}bounds(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(null!==this.__bounds[e])return this.__bounds[e];const{cx:t,cy:n,r:i,r:r}=this.attrs,o=t-i,s=n-r;let a=2*i,l=2*r,c=[{x:o,y:s},{x:o+a,y:s},{x:o+a,y:s+l},{x:o,y:s+l}];if(e&&this.modelViewMatrix){c=this.modelViewMatrix.transformPoints(c);const[t,n,i,r]=F(c);a=i-t,l=r-n,this.__bounds[e]=[{x:t,y:n},{x:t+a,y:n},{x:t+a,y:n+l},{x:t,y:n+l}]}else this.__bounds[e]=c;return this.__bounds[e]}}class gf extends ef{constructor(){super("line"),this.set(...arguments)}set(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const{x1:t=0,y1:n=0,x2:i=0,y2:r=0,collider:o}=e;super.set(e),this.attrs.x1=t,this.attrs.y1=n,this.attrs.x2=i,this.attrs.y2=r;const s={type:"line",x1:t,y1:n,x2:i,y2:r};this.collider=A(s,o),this.__boundingRect={true:null,false:null},this.__bounds={true:null,false:null}}boundingRect(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(null!==this.__boundingRect[e])return this.__boundingRect[e];let t=z(this.attrs);e&&this.modelViewMatrix&&(t=this.modelViewMatrix.transformPoints(t));const[n,i,r,o]=F(t),s=n!==r||i!==o;return this.__boundingRect[e]={x:n,y:i,width:s?Math.max(1,r-n):0,height:s?Math.max(1,o-i):0},this.__boundingRect[e]}bounds(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(null!==this.__bounds[e])return this.__bounds[e];const t=this.boundingRect(e);return this.__bounds[e]=[{x:t.x,y:t.y},{x:t.x+t.width,y:t.y},{x:t.x+t.width,y:t.y+t.height},{x:t.x,y:t.y+t.height}],this.__bounds[e]}}const yf=Math.PI/2;function vf(e,t){const n=Math.atan2(t.y-e.y,t.x-e.x);return n<0?n+2*Math.PI:n}function bf(e,t,n){return{x:e.x+Math.cos(t)*n,y:e.y+Math.sin(t)*n}}const xf={step:function(e){return new $e(e,.5)},stepAfter:function(e){return new $e(e,1)},stepBefore:function(e){return new $e(e,0)},linear:we,basis:function(e){return new Ee(e)},cardinal:Ie.tension(0),catmullRom:Ne,monotonex:function(e){return new ze(e)},monotoney:function(e){return new je(e)},natural:function(e){return new Be(e)}};function wf(e){if(e.length<2)return!1;const t=e[0],n=e[e.length-1];return Math.abs(t.x-n.x)<1e-12&&Math.abs(t.y-n.y)<1e-12}class qf extends ef{constructor(){super("path"),this.set(...arguments)}set(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(super.set(e),this.segments=[],this.points=[],e.arcDatum){const t=be();t.innerRadius(e.desc.slice.innerRadius),t.outerRadius(e.desc.slice.outerRadius),t.cornerRadius(e.desc.slice.cornerRadius);const n=t(e.arcDatum);this.attrs.d=n}else if(e.points){const{major:t,minor:n,layerObj:i,points:r,stngs:o,generatorType:s}=e,a=De(),l=o.coordinates?o.coordinates.defined:null;a[t.p]((e=>e.major*t.size))["".concat(n.p,"1")]((e=>e.minor*n.size))["".concat(n.p,"0")]((e=>e.minor0*n.size)).curve(xf["monotone"===i.curve?"monotone".concat(t.p):i.curve]),l?a.defined((e=>!e.dummy&&"number"==typeof e.minor&&!isNaN(e.minor)&&e.defined)):a.defined((e=>!e.dummy&&"number"==typeof e.minor&&!isNaN(e.minor)));const c=o.connect?r.filter(a.defined()):r,u=("area"===s?a:a[s]())(c);this.attrs.d=u}else e.d&&(this.attrs.d=e.d);if(this.__boundingRect={true:null,false:null},this.__bounds={true:null,false:null},Array.isArray(e.collider)||"object"==typeof e.collider&&void 0!==e.collider.type)this.collider=e.collider;else if(this.attrs.d){if(this.segments=pd(this.attrs.d),this.segments.length>1&&this.segments.every((e=>wf(e))))return void(this.collider=A({type:"geopolygon",vertices:this.segments},e.collider));this.segments.forEach((t=>{if(t.length<=1);else if(wf(t))this.collider=A({type:"polygon",vertices:t},e.collider);else if("object"==typeof e.collider&&e.collider.visual){const n=this.attrs["stroke-width"]/2;this.collider=function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const i=[],r=[];if("h"===n.forceOrientation){const t=e[0].x<e[1].x?-1:1,n=e[e.length-1].x>e[e.length-2].x?1:-1;e.unshift({x:e[0].x+t,y:e[0].y}),e.push({x:e[e.length-1].x+n,y:e[e.length-1].y})}else if("v"===n.forceOrientation){const t=e[0].y<e[1].y?-1:1,n=e[e.length-1].y>e[e.length-2].y?1:-1;e.unshift({x:e[0].x,y:e[0].y+t}),e.push({x:e[e.length-1].x,y:e[e.length-1].y+n})}const o=e.length-1;for(let n=1;n<o;n++){const s=e[n-1],a=e[n],l=e[n+1],c=vf(a,s),u=vf(a,l),h=(c+u)/2,d=h+Math.PI,f=Math.max(h,d),p=Math.min(h,d),m=c>u;if(1===n){const e=vf(s,a);i.push(bf(s,e-yf,t)),r.unshift(bf(s,e+yf,t))}const g=m?f:p,y=m?p:f;if(i.push(bf(a,g,t)),r.unshift(bf(a,y,t)),n===o-1){const e=vf(l,a);i.push(bf(l,e+yf,t)),r.unshift(bf(l,e-yf,t))}}return{type:"polygon",vertices:[...i,...r]}}(t,n,e.collider)}else this.collider=A({type:"polyline",points:t},e.collider)}))}}boundingRect(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(null!==this.__boundingRect[e])return this.__boundingRect[e];this.points.length||(this.segments=this.segments.length?this.segments:pd(this.attrs.d),this.points=function(e){const t=[];let n,i=e.length;for(let r=0;r<i;r++){n=e[r];for(let e=0;e<n.length;e++)t.push(n[e])}return t}(this.segments));const t=e&&this.modelViewMatrix?this.modelViewMatrix.transformPoints(this.points):this.points,[n,i,r,o]=F(t);return this.__boundingRect[e]={x:n||0,y:i||0,width:r-n||0,height:o-i||0},this.__boundingRect[e]}bounds(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(null!==this.__bounds[e])return this.__bounds[e];const t=this.boundingRect(e);return this.__bounds[e]=[{x:t.x,y:t.y},{x:t.x+t.width,y:t.y},{x:t.x+t.width,y:t.y+t.height},{x:t.x,y:t.y+t.height}],this.__bounds[e]}}function Mf(e){let{data:t,_boundingRect:n,_textBoundsFn:i}=e;return null!=t&&(n||i)}class Df extends ef{constructor(){super("text"),this.set(...arguments)}set(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const{x:t=0,y:n=0,dx:i=0,dy:r=0,textBoundsFn:o,text:s,title:a,collider:l,boundingRect:c,ellipsed:u}=e;super.set(e),this.attrs.x=t,this.attrs.y=n,this.attrs.dx=i,this.attrs.dy=r,this.attrs.text=s,void 0!==a&&(this.attrs.title=String(a)),"object"==typeof c?this._textBoundsFn=()=>c:"function"==typeof o&&(this._textBoundsFn=o),"string"==typeof u&&(this.ellipsed=u),this.collider=A({type:Mf(this)?"bounds":null},l),this.__boundingRect={true:null,false:null},this.__bounds={true:null,false:null}}boundingRect(){let e,t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(null!==this.__boundingRect[t])return this.__boundingRect[t];if("function"!=typeof this._textBoundsFn)return{x:0,y:0,width:0,height:0};e=this._textBoundsFn(this.attrs);const n=j(e),i=t&&this.modelViewMatrix?this.modelViewMatrix.transformPoints(n):n,[r,o,s,a]=F(i);return this.__boundingRect[t]={x:r,y:o,width:s-r,height:a-o},this.__boundingRect[t]}bounds(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(null!==this.__bounds[e])return this.__bounds[e];const t=this.boundingRect(e);return this.__bounds[e]=[{x:t.x,y:t.y},{x:t.x+t.width,y:t.y},{x:t.x+t.width,y:t.y+t.height},{x:t.x,y:t.y+t.height}],this.__bounds[e]}}const Sf=Ge();function _f(e,t){return Sf.get(e)(t)}Sf.add("rect",(function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return new pf(...t)})),Sf.add("circle",(function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return new mf(...t)})),Sf.add("text",(function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return new Df(...t)})),Sf.add("line",(function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return new gf(...t)})),Sf.add("path",(function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return new qf(...t)})),Sf.add("stage",(function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return new sf(...t)})),Sf.add("container",of),Sf.add("defs",of),Sf.add("linearGradient",uf),Sf.add("radialGradient",uf),Sf.add("stop",uf),Sf.add("pattern",(function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return new ff(...t)}));const Cf=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];const t=[{}];function n(){return t[t.length-1]}return n.save=function(){let i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const r=n(),o={};let s="";for(let t=0;t<e.length;t++)s=e[t],void 0!==r[s]&&(o[s]=r[s]);return A(o,i),t.push(o),n()},n.restore=function(){t.splice(t.length-1,1)},n}(["stroke","fill","strokeWidth","opacity","fontFamily","fontSize","baseline"]);function kf(e,t){if(Array.isArray(t))for(let n=0,i=t.length;n<i;n++)t[n](e)}function Ef(e,t,n){e.node=n[t],e.index=t}function Af(e,t,n,i){let r=!1;const o={siblings:e,node:null,index:0};for(let s=0,a=e.length;s<a;s++){if(Ef(o,s,e),kf(o,i.create),r="function"==typeof o.node.disabled?o.node.disabled():o.node.disabled,r)continue;o.node=Cf.save(o.node);const a=_f(o.node.type,o.node);a&&(o.node.transform&&(n.save(),Ld(o.node.transform,n)),n.isIdentity()||(a.modelViewMatrix=n.clone()),t.addChild(a),o.node.children&&Af(o.node.children,a,n,i),o.node.transform&&n.restore()),Cf.restore()}}function Tf(e){let{items:t,stage:n,dpi:i,on:r={}}=e;return n||(n=_f("stage",i)),Af(t,n,new Td,r),n}function If(e,t,n){const{orientation:i,degree:r,stops:o=[]}=n;let s=null;if("radial"===i){const n=t.boundingRect();s=e.createRadialGradient(n.x+n.width/2,n.y+n.height/2,1e-5,n.x+n.width/2,n.y+n.height/2,Math.max(n.width,n.height)/2)}else{const i=Fs(r);["x1","x2","y1","y2"].forEach((e=>{e in n&&(i[e]=n[e])}));const o=t.boundingRect();s=e.createLinearGradient(o.x+i.x1*o.width,o.y+i.y1*o.height,o.x+i.x2*o.width,o.y+i.y2*o.height)}for(let e=0,t=o.length;e<t;e++){let t=o[e];s.addColorStop(t.offset,t.color)}return s}function Rf(e,t,n){return t.width=e.width,t.height=e.height,n.save(),n.fillStyle=e.fill,e.shapes.forEach((e=>{if("rect"===e.type)n.rect(e.x,e.y,e.width,e.height)})),n.fill(),n.restore(),n.createPattern(t,"repeat")}function Nf(e){const t=e.createElement("canvas"),n=t.getContext("2d");let i={};return{create(e){const r=e.key;return r?(i[r]=i[r]||Rf(e,t,n),i[r]):Rf(e,t,n)},clear(){i={}}}}function Of(){let{x:e,y:t,width:n,height:i,scaleRatio:r,margin:o,edgeBleed:s}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const a={x:0,y:0,width:0,height:0,scaleRatio:{x:1,y:1},margin:{left:0,top:0},edgeBleed:{left:0,right:0,top:0,bottom:0,bool:!1}};return a.x=isNaN(e)?a.x:e,a.y=isNaN(t)?a.y:t,a.width=isNaN(n)?a.width:n,a.height=isNaN(i)?a.height:i,void 0!==r&&(a.scaleRatio.x=isNaN(r.x)?a.scaleRatio.x:r.x,a.scaleRatio.y=isNaN(r.y)?a.scaleRatio.y:r.y),void 0!==o&&(a.margin.left=isNaN(o.left)?0:o.left,a.margin.top=isNaN(o.top)?0:o.top),"object"==typeof s&&["left","right","top","bottom"].forEach((e=>{!isNaN(s[e])&&s[e]>0&&(a.edgeBleed[e]=s[e],a.edgeBleed.bool=!0)})),a.computedPhysical={x:Math.round(a.margin.left+(a.x-a.edgeBleed.left)*a.scaleRatio.x),y:Math.round(a.margin.top+(a.y-a.edgeBleed.top)*a.scaleRatio.y),width:Math.round((a.width+a.edgeBleed.left+a.edgeBleed.right)*a.scaleRatio.x),height:Math.round((a.height+a.edgeBleed.top+a.edgeBleed.bottom)*a.scaleRatio.y)},a}function Pf(){const e={element:()=>{},root:()=>{},settings:()=>{},appendTo:()=>{},getScene:()=>[],render:()=>!1,itemsAt:()=>[],findShapes:()=>[],clear:()=>{},destory:()=>{},size:()=>{},measureText:lh,textBounds:uh,setKey:t=>{e.element().setAttribute("data-key",t)}};return e}function Lf(e){return t=>{let{node:n}=t;"text"===n.type&&function(e){return null!=e}(n.data)&&!n.textBoundsFn&&(n.textBoundsFn=e.textBounds)}}const Ff=200,zf=200;class jf{constructor(e){this.targetCanvas=e,this.bufferCanvas=e.cloneNode()}updateSize(e){let t,{rect:n,dpiRatio:i,canvasBufferSize:r}=e;t=r?"function"==typeof r?r(n):r:{width:n.computedPhysical.width+2*Ff,height:n.computedPhysical.height+2*zf},this.bufferCanvas.style.width="".concat(t.width,"px"),this.bufferCanvas.style.height="".concat(t.height,"px"),this.bufferCanvas.width=Math.round(t.width*i),this.bufferCanvas.height=Math.round(t.height*i)}apply(){this.targetCanvas.getContext("2d").drawImage(this.bufferCanvas,0,0)}clear(){this.bufferCanvas.width=this.bufferCanvas.width}getContext(){return this.bufferCanvas.getContext("2d")}}const Hf=Ge();function Bf(e){return Array.isArray(e)?e:"string"==typeof e?-1!==e.indexOf(",")?e.split(","):e.split(" "):[]}function Vf(e){return("undefined"==typeof window?1:window.devicePixelRatio||1)/(e.webkitBackingStorePixelRatio||e.mozBackingStorePixelRatio||e.msBackingStorePixelRatio||e.oBackingStorePixelRatio||e.backingStorePixelRatio||1)}function $f(e,t){t.setTransform(e[0][0],e[1][0],e[0][1],e[1][1],e[0][2],e[1][2])}function Wf(e,t,n){let i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};const r=Object.keys(i);for(let r=0,o=n.length;r<o;r++){let o=n[r];const s=o[0],a=o[1],l=o[2];if(s in t.attrs&&!(a in i)&&e[a]!==t.attrs[s]){const n=l?l(t.attrs[s]):t.attrs[s];"function"==typeof e[a]?e[a](n):e[a]=n}}for(let t=0,n=r.length;t<n;t++){const n=r[t];e[n]=i[n]}}function Uf(e,t,n,i){for(let r=0,o=e.length;r<o;r++){let o=e[r],s={};t.save(),o.attrs&&(o.attrs.fill||o.attrs.stroke)&&(o.attrs.fill&&"object"==typeof o.attrs.fill&&"gradient"===o.attrs.fill.type?s.fillStyle=If(t,o,o.attrs.fill):o.attrs.fill&&"object"==typeof o.attrs.fill&&"pattern"===o.attrs.fill.type&&(s.fillStyle=i.patterns.create(o.attrs.fill)),o.attrs.stroke&&"object"==typeof o.attrs.stroke&&"gradient"===o.attrs.stroke.type?s.strokeStyle=If(t,o,o.attrs.stroke):o.attrs.stroke&&"object"==typeof o.attrs.stroke&&"pattern"===o.attrs.stroke.type&&(s.strokeStyle=i.patterns.create(o.attrs.stroke))),Wf(t,o,n,s),o.modelViewMatrix&&$f(o.modelViewMatrix.elements,t),Hf.has(o.type)&&Hf.get(o.type)(o.attrs,{g:t,doFill:"fill"in o.attrs&&"none"!==o.attrs.fill,doStroke:"stroke"in o.attrs&&0!==o.attrs["stroke-width"],ellipsed:o.ellipsed}),o.children&&Uf(o.children,t,n,i),t.restore()}}function Yf(e){let{el:t,dpiRatio:n,transform:i}=e;if("object"==typeof i){const e=[i.horizontalScaling,i.horizontalSkewing,i.verticalSkewing,i.verticalScaling,i.horizontalMoving*n,i.verticalMoving*n];t.getContext("2d").setTransform(...e)}}function Xf(){let e,t,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Tf;const i={transform:void 0,canvasBufferSize:void 0,progressive:void 0};let r,o=!1,s=Of();const a=[["fill","fillStyle"],["stroke","strokeStyle"],["opacity","globalAlpha"],["globalAlpha","globalAlpha"],["stroke-width","lineWidth"],["stroke-linejoin","lineJoin"],["stroke-dasharray","setLineDash",Bf]];let l;const c=Pf();return c.element=()=>e,c.root=()=>e,c.settings=e=>(e&&Object.keys(i).forEach((t=>{void 0!==e[t]&&(i[t]=e[t])})),i),c.appendTo=n=>(e||(e=n.ownerDocument.createElement("canvas"),e.style.position="absolute",e.style["-webkit-font-smoothing"]="antialiased",e.style["-moz-osx-font-smoothing"]="antialiased",e.style.pointerEvents="none"),"function"!=typeof i.transform||t||(t=new jf(e)),n.appendChild(e),e),c.getScene=i=>{const r=Vf(t&&t.getContext()||e.getContext("2d")),o=s.scaleRatio.x,a=s.scaleRatio.y,l={type:"container",children:i,transform:s.edgeBleed.bool?"translate(".concat(s.edgeBleed.left*r*o,", ").concat(s.edgeBleed.top*r*a,")"):""};return 1===r&&1===o&&1===a||(l.transform+="scale(".concat(r*o,", ").concat(r*a,")")),n({items:[l],dpi:r,on:{create:[Qu(c.measureText),Lf(c)]}})},c.render=n=>{if(!e)return!1;l||(l=Nf(e.ownerDocument));const u=t&&t.getContext()||e.getContext("2d"),h=Vf(u),d=t&&i.transform();if(d)return e.width=e.width,Yf({el:e,dpiRatio:h,transform:d}),t.apply(),!0;o&&(e.style.left="".concat(s.computedPhysical.x,"px"),e.style.top="".concat(s.computedPhysical.y,"px"),e.style.width="".concat(s.computedPhysical.width,"px"),e.style.height="".concat(s.computedPhysical.height,"px"),e.width=Math.round(s.computedPhysical.width*h),e.height=Math.round(s.computedPhysical.height*h),t&&t.updateSize({rect:s,dpiRatio:h,canvasBufferSize:i.canvasBufferSize}));const f=c.getScene(n),p=!r||!f.equals(r);l.clear();const m=o||p,g="function"==typeof i.progressive&&i.progressive();return m&&(g&&!g.isFirst||c.clear(),Uf(f.children,u,a,{patterns:l})),t&&(e.width=e.width,t.apply()),o=!1,g&&!g.isFirst&&f.children.unshift(...r.children),r=f,m},c.itemsAt=e=>r?r.getItemsFrom(e):[],c.findShapes=e=>r?r.findShapes(e):[],c.clear=()=>(e&&(e.width=e.width),t&&t.clear(),r=null,c),c.size=e=>{if(e){const t=Of(e);JSON.stringify(s)!==JSON.stringify(t)&&(o=!0,s=t)}return s},c.destroy=()=>{e&&(e.parentElement&&e.parentElement.removeChild(e),e=null),t&&(t=null),r=null},c}function Kf(e,t){Hf.add(e,t)}function Gf(e,t){return Math.max(0,Math.min(e,t))}const Jf=new RegExp("[A-Za-zªµºÀ-ÖØ-öø-ʸʻ-ˁː-ˑˠ-ˤˮͰ-ͳͶ-ͽΆΈ-ϵϷ-҂Ҋ-։ः-हऻऽ-ीॉ-ौॎ-ॐक़-ॡ।-ॿং-হঽ-ীে-ৌৎ-ৡ০-ৱ৴-৺ਃ-ਹਾ-ੀਖ਼-੯ੲ-ੴઃ-હઽ-ીૉ-ૌૐ-ૡ૦-૯ଂ-ହଽ-ାୀେ-ୌୗ-ୡ୦-୷ஃ-ிு-ௌௐ-௲ఁ-ఽు-ౄౘ-ౡ౦-౯౿-ಹಽ-ೋೕ-ೡ೦-ീെ-ൌൎ-ൡ൦-ෆා-ෑෘ-ะา-ำเ-ๆ๏-ະາ-ຳຽ-ໆ໐-༗༚-༴༶༸༾-ཬཿ྅ྈ-ྌ྾-࿅࿇-ာေးျ-ြဿ-ၗၚ-ၝၡ-ၰၵ-ႁႃ-ႄႇ-ႌႎ-ႜ႞-ፚ፠-ᎏᎠ-Ᏼᐁ-ᙿᚁ-ᚚᚠ-ᜑᜠ-ᜱ᜵-ᝑᝠ-ᝰក-ាើ-ៅះ-ៈ។-៚ៜ០-៩᠐-ᢨᢪ-ᤜᤣ-ᤦᤩ-ᤱᤳ-ᤸ᥆-᧚ᨀ-ᨖᨙ-ᩕᩗᩡᩣ-ᩤᩭ-ᩲ᪀-᪭ᬄ-ᬳᬵᬻᬽ-ᭁᭃ-᭪᭴-᭼ᮂ-ᮡᮦ-ᮧ᮪-ᯥᯧᯪ-ᯬᯮ᯲-ᰫᰴ-ᰵ᰻-᱿᳓᳡ᳩ-ᳬᳮ-ᶿḀ-ᾼιῂ-ῌῐ-Ίῠ-Ῥῲ-ῼⁱⁿₐ-ₜℂℇℊ-ℓℕℙ-ℝℤΩℨK-ℭℯ-ℹℼ-ℿⅅ-ⅉⅎ-⅏Ⅰ-ↈ⌶-⍺⎕⒜-ⓩ⚬⠀-⣿Ⰰ-ⳤⳫ-ⳮⴀ-⵰ⶀ-ⷞ々-〇〡-〩〱-〵〸-〼ぁ-ゖゝ-ゟァ-ヺー-ㆺㇰ-㈜㈠-㉏㉠-㉻㉿-㊰㋀-㋋㋐-㍶㍻-㏝㏠-㏾㐀-䶵一-ꒌꓐ-ꘌꘐ-ꙮꚀ-ꛯ꛲-꛷Ꜣ-ꞇ꞉-ꠁꠃ-ꠅꠇ-ꠊꠌ-ꠤꠧ꠰-꠷ꡀ-ꡳꢀ-ꣃ꣎-꣙ꣲ-ꤥ꤮-ꥆꥒ-ꥼꦃ-ꦲꦴ-ꦵꦺ-ꦻꦽ-ꨨꨯ-ꨰꨳ-ꨴꩀ-ꩂꩄ-ꩋꩍ-ꪯꪱꪵ-ꪶꪹ-ꪽꫀꫂ-ꯤꯦ-ꯧꯩ-꯬꯰-ﬗA-Za-zヲ-ᅵ]"),Zf=new RegExp("[־׀׃׆א-״߀-ߪߴ-ߵߺ-ࠕࠚࠤࠨ࠰-ࡘ࡞יִײַ-ﬨשׁ-ﭏ]"),Qf=new RegExp("[؈؋؍؛-ي٭-ٯٱ-ەۥ-ۦۮ-ۯۺ-܍ܐܒ-ܯݍ-ޥޱﭐ-ﴽﵐ-﷼ﹰ-ﻼ]");function ep(e){return Jf.test(e)}function tp(e){return Zf.test(e)||Qf.test(e)}function np(e){let t,n,i=e?e.length:0;for(t=0;t<i;t++){if(n=e[t],ep(n))return"ltr";if(tp(n))return"rtl"}return"ltr"}const ip={start:"end",end:"start",center:"center",middle:"middle"};function rp(e,t){return"rtl"===t?ip[e]:e}function op(e,t){const n=[];let i;const r=[],o=[],s=[];let a,l;const c=e=>e.id,u=(e,t)=>{let n;return n="object"==typeof e?"id"in e?e.id:t:e,{content:e,id:"".concat(n,"__").concat(e.type||"")}};e.isTree||(e=e.map(u)),t=t.map(u),a=e.map(c),l=t.map(c);for(let e=0,i=t.length;e<i;e++){-1===a.indexOf(t[e].id)?n.push(t[e]):o.push(t[e])}for(let t=0,n=e.length;t<n;t++){-1===l.indexOf(e[t].id)?r.push(e[t]):s.push(e[t])}for(let e=0,t=n.length;e<t;e++)n[e].content.children&&(n[e].diff=op([],n[e].content.children),n[e].children=n[e].diff.updatedNew.concat(n[e].diff.added),n[e].children.isTree=!0);for(let e=0,t=o.length;e<t;e++)o[e].diff=op(s[e].children||[],o[e].content.children||[]),o[e].object=s[e].object,o[e].children=o[e].diff.items;return i=o.concat(n),n.isTree=!0,r.isTree=!0,o.isTree=!0,s.isTree=!0,i.isTree=!0,{added:n,updatedNew:o,updatedOld:s,removed:r,items:i}}function sp(e,t,n){for(let i=0,r=e.length;i<r;i++)e[i].object=n(e[i].content.type,t)}function ap(e,t){for(let n=0,i=e.length;n<i;n++)null!==e[n].object&&void 0!==e[n].object&&(t(e[n].object),e[n].object=null)}function lp(e,t,n,i){let r;for(let o=0,s=e.length;o<s;o++)r=e[o],null!==r.object&&void 0!==r.object&&(n(r.object,r.content),r.diff&&(sp(r.diff.added,r.object,t),ap(r.diff.removed,i),lp(r.diff.items,t,n,i)))}function cp(e,t,n,i,r,o){const s=op(e,t);return sp(s.added,n,i),ap(s.removed,o),lp(s.items,i,r,o),s.items}Kf("rect",(function(e,t){let{g:n,doFill:i,doStroke:r}=t;n.beginPath(),e.rx>0||e.ry>0?function(e,t,n,i,r,o,s){o=Gf(i/2,o>0?o:s),s=Gf(r/2,s>0?s:o),e.moveTo(t,n+s),e.lineTo(t,n+r-s),e.quadraticCurveTo(t,n+r,t+o,n+r),e.lineTo(t+i-o,n+r),e.quadraticCurveTo(t+i,n+r,t+i,n+r-s),e.lineTo(t+i,n+s),e.quadraticCurveTo(t+i,n,t+i-o,n),e.lineTo(t+o,n),e.quadraticCurveTo(t,n,t,n+s)}(n,e.x,e.y,e.width,e.height,e.rx,e.ry):n.rect(e.x,e.y,e.width,e.height),i&&n.fill(),r&&n.stroke()})),Kf("circle",(function(e,t){let{g:n,doFill:i,doStroke:r}=t;n.beginPath(),n.moveTo(e.cx+e.r,e.cy),n.arc(e.cx,e.cy,e.r,0,2*Math.PI,!1),i&&n.fill(),r&&n.stroke()})),Kf("line",(function(e,t){let{g:n,doStroke:i}=t;n.beginPath(),n.moveTo(e.x1,e.y1),n.lineTo(e.x2,e.y2),i&&n.stroke()})),Kf("path",(function(e,t){let{g:n,doStroke:i,doFill:r}=t;const o=new Path2D(e.d);r&&n.fill(o),i&&n.stroke(o)})),Kf("text",(function(e,t){let{g:n,ellipsed:i,doStroke:r}=t;const o=i||eh(e,lh);e["font-weight"]?n.font="".concat(e["font-weight"]," ").concat(e["font-size"]," ").concat(e["font-family"]):n.font="".concat(e["font-size"]," ").concat(e["font-family"]);const s=np(e.text);n.canvas.dir!==s&&(n.canvas.dir=s);const a=rp("middle"===e["text-anchor"]?"center":e["text-anchor"],n.canvas.dir);a&&n.textAlign!==a&&(n.textAlign=a);const l=th(e);n.fillText(o,e.x+e.dx,e.y+e.dy+l),r&&n.strokeText(o,e.x+e.dx,e.y+e.dy+l)}));const up="http://www.w3.org/2000/svg",hp=(e,t)=>{if(!e||"string"!=typeof e)throw new Error("Invalid type: ".concat(e));const n=t.ownerDocument.createElementNS(up,"container"===e?"g":e);return t.appendChild(n),n},dp=e=>{e.parentNode&&e.parentNode.removeChild(e)},fp=(e,t)=>{if((e=>{switch(e.type){case"circle":return!isNaN(e.attrs.cx)&&!isNaN(e.attrs.cy)&&!isNaN(e.attrs.r);case"line":return!(isNaN(e.attrs.x1)||isNaN(e.attrs.y1)||isNaN(e.attrs.x2)||isNaN(e.attrs.y2));case"rect":return!(isNaN(e.attrs.x)||isNaN(e.attrs.y)||isNaN(e.attrs.width)||isNaN(e.attrs.height));case"text":return!isNaN(e.attrs.x)&&!isNaN(e.attrs.y);default:return!0}})(t)){for(const n in t.attrs)if("stroke"===n&&t.strokeReference)e.setAttribute("stroke",t.strokeReference);else if("fill"===n&&t.fillReference)e.setAttribute("fill",t.fillReference);else if("text"===n){e.setAttribute("style","white-space: pre"),e.textContent=t.ellipsed||eh(t.attrs,lh);const n=np(t.attrs.text);"rtl"===n&&(e.setAttribute("direction","rtl"),e.setAttribute("dir","rtl"),e.setAttribute("text-anchor",rp(e.getAttribute("text-anchor"),n)))}else if("text"!==t.type||"dy"!==n&&"dominant-baseline"!==n)if("text"===t.type&&"title"===n&&t.attrs.title){const n=e.ownerDocument.createElementNS(up,"title");n.textContent=t.attrs.title,e.appendChild(n)}else e.setAttribute(n,t.attrs[n]);else{const i=+e.getAttribute(n)||0;let r=0;r="dominant-baseline"===n?th(t.attrs):t.attrs[n],e.setAttribute("dy",r+i)}if("string"==typeof t.data||"number"==typeof t.data||"boolean"==typeof t.data)e.setAttribute("data",t.data);else if("object"==typeof t.data&&null!==t.data)for(const n in t.data)"string"!=typeof t.data[n]&&"number"!=typeof t.data[n]&&"boolean"!=typeof t.data[n]||e.setAttribute("data-".concat(n),t.data[n])}};class pp{constructor(e,t,n,i){this.create=e,this.nodeCreator=t,this.nodeMaintainer=n,this.nodeDestroyer=i}render(e,t){return this.create([],e,t,this.nodeCreator,this.nodeMaintainer,this.nodeDestroyer)}}function mp(){return new pp(cp,hp,fp,dp)}function gp(e){let t,n,i,r=0;if(0===(e=JSON.stringify(e)).length)return r;for(t=0,i=e.length;t<i;t++)n=e.charCodeAt(t),r=(r<<5)-r+n,r&=r;return r}function yp(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:gp,n={},i=Date.now();const r={getOrCreateGradient(){let r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"fill",s=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"",a=t(r[o]),l="picasso-gradient-".concat(i,"-").concat(a);if(!n[a]){let{orientation:t,degree:i,stops:s=[]}=r[o],c={};void 0===i&&(i=90),"radial"===t?c.type="radialGradient":(c=Fs(i),["x1","x2","y1","y2"].forEach((e=>{e in r[o]&&(c[e]=r[o][e])})),c.type="linearGradient"),c.id=l,c.children=s.map((e=>{let{offset:t,color:n,opacity:i}=e;return{type:"stop",offset:"".concat(100*t,"%"),style:"stop-color:".concat(n,";stop-opacity:").concat(void 0!==i?i:1)}})),e.push(c),n[a]=l}return"url('".concat(s,"#").concat(l,"')")},onCreate(e){let t="";"undefined"!=typeof window&&(t=window.location.href.split("#")[0]);const n=e.node;n.fill&&"object"==typeof n.fill&&"gradient"===n.fill.type&&(n.fillReference=r.getOrCreateGradient(n,"fill",t)),n.stroke&&"object"==typeof n.stroke&&"gradient"===n.stroke.type&&(n.strokeReference=r.getOrCreateGradient(n,"stroke",t))},clear(){n={}}};return r}function vp(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:gp,n={},i=Date.now();const r={onCreate(r){let o={};r.node&&"object"==typeof r.node.fill&&"pattern"===r.node.fill.type&&r.node.fill.shapes&&(o.fill=r.node.fill),r.node&&"object"==typeof r.node.stroke&&"pattern"===r.node.stroke.type&&r.node.stroke.shapes&&(o.stroke=r.node.stroke),Object.keys(o).forEach((s=>{let a="";const l=o[s],c=t(l),u="picasso-pattern-".concat(i,"-").concat(c);if("undefined"!=typeof window&&(a=window.location.href.split("#")[0]),!n[c]){const t={patternUnits:"userSpaceOnUse",x:0,y:0,width:l.width,height:l.height,type:"pattern",id:u,children:[],fill:l.fill};l.shapes.forEach((e=>{t.children.push(e)})),e.push(t),n[c]=!0}r.node["".concat(s,"Reference")]="url('".concat(a,"#").concat(u,"')")}))},clear(){n={}}};return r}function bp(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:mp,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:up,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Tf;const i=e();let r,o,s,a=!1,l=Of();const c={transform:void 0},u=Pf(),h={type:"defs",children:[]},d=vp(h.children),f=yp(h.children);return u.element=()=>r,u.root=()=>o,u.settings=e=>(e&&Object.keys(c).forEach((t=>{void 0!==e[t]&&(c[t]=e[t])})),c),u.appendTo=e=>(r||(r=e.ownerDocument.createElementNS(t,"svg"),r.style.position="absolute",r.style["-webkit-font-smoothing"]="antialiased",r.style["-moz-osx-font-smoothing"]="antialiased",r.style.pointerEvents="none",r.setAttribute("xmlns",t),o=e.ownerDocument.createElementNS(t,"g"),o.style.pointerEvents="auto",r.appendChild(o)),e.appendChild(r),r),u.getScene=e=>{const t=l.scaleRatio.x,i=l.scaleRatio.y,r={type:"container",children:Array.isArray(e)?[...e,h]:e,transform:l.edgeBleed.bool?"translate(".concat(l.edgeBleed.left*t,", ").concat(l.edgeBleed.top*i,")"):""};return 1===t&&1===i||(r.transform+="scale(".concat(t,", ").concat(i,")")),n({items:[r],on:{create:[e=>{e.node.fillReference=void 0,e.node.strokeReference=void 0},f.onCreate,d.onCreate,Qu(u.measureText),Lf(u)]}})},u.render=e=>{if(!r)return!1;const t="function"==typeof c.transform&&c.transform();if(t){const{a:e,b:n,c:i,d:r,e:s,f:a}=t;return o.style.transform="matrix(".concat(e,", ").concat(n,", ").concat(i,", ").concat(r,", ").concat(s,", ").concat(a,")"),!0}o.style.transform="",a&&(r.style.left="".concat(l.computedPhysical.x,"px"),r.style.top="".concat(l.computedPhysical.y,"px"),r.setAttribute("width",l.computedPhysical.width),r.setAttribute("height",l.computedPhysical.height)),f.clear(),d.clear(),h.children.length=0;const n=u.getScene(e),p=!s||!n.equals(s),m=a||p;return m&&(u.clear(),i.render(n.children,o)),a=!1,s=n,m},u.itemsAt=e=>s?s.getItemsFrom(e):[],u.findShapes=e=>s?s.findShapes(e):[],u.clear=()=>{if(!o)return u;s=null;const e=o.cloneNode(!1);return r.replaceChild(e,o),o=e,u},u.destroy=()=>{r&&r.parentNode&&r.parentNode.removeChild(r),r=null,o=null},u.size=e=>{if(e){const t=Of(e);JSON.stringify(l)!==JSON.stringify(t)&&(a=!0,l=t)}return l},u}var xp,wp,qp,Mp,Dp,Sp={},_p=[],Cp=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i;function kp(e,t){for(var n in t)e[n]=t[n];return e}function Ep(e){var t=e.parentNode;t&&t.removeChild(e)}function Ap(e,t,n){var i,r,o,s={};for(o in t)"key"==o?i=t[o]:"ref"==o?r=t[o]:s[o]=t[o];if(arguments.length>2&&(s.children=arguments.length>3?xp.call(arguments,2):n),"function"==typeof e&&null!=e.defaultProps)for(o in e.defaultProps)void 0===s[o]&&(s[o]=e.defaultProps[o]);return Tp(e,s,i,r,null)}function Tp(e,t,n,i,r){var o={type:e,props:t,key:n,ref:i,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,__h:null,constructor:void 0,__v:null==r?++qp:r};return null==r&&null!=wp.vnode&&wp.vnode(o),o}function Ip(e){return e.children}function Rp(e,t){this.props=e,this.context=t}function Np(e,t){if(null==t)return e.__?Np(e.__,e.__.__k.indexOf(e)+1):null;for(var n;t<e.__k.length;t++)if(null!=(n=e.__k[t])&&null!=n.__e)return n.__e;return"function"==typeof e.type?Np(e):null}function Op(e){var t,n;if(null!=(e=e.__)&&null!=e.__c){for(e.__e=e.__c.base=null,t=0;t<e.__k.length;t++)if(null!=(n=e.__k[t])&&null!=n.__e){e.__e=e.__c.base=n.__e;break}return Op(e)}}function Pp(e){(!e.__d&&(e.__d=!0)&&Mp.push(e)&&!Lp.__r++||Dp!==wp.debounceRendering)&&((Dp=wp.debounceRendering)||setTimeout)(Lp)}function Lp(){for(var e;Lp.__r=Mp.length;)e=Mp.sort((function(e,t){return e.__v.__b-t.__v.__b})),Mp=[],e.some((function(e){var t,n,i,r,o,s;e.__d&&(o=(r=(t=e).__v).__e,(s=t.__P)&&(n=[],(i=kp({},r)).__v=r.__v+1,Wp(s,r,i,t.__n,void 0!==s.ownerSVGElement,null!=r.__h?[o]:null,n,null==o?Np(r):o,r.__h),Up(n,r),r.__e!=o&&Op(r)))}))}function Fp(e,t,n,i,r,o,s,a,l,c){var u,h,d,f,p,m,g,y=i&&i.__k||_p,v=y.length;for(n.__k=[],u=0;u<t.length;u++)if(null!=(f=n.__k[u]=null==(f=t[u])||"boolean"==typeof f?null:"string"==typeof f||"number"==typeof f||"bigint"==typeof f?Tp(null,f,null,null,f):Array.isArray(f)?Tp(Ip,{children:f},null,null,null):f.__b>0?Tp(f.type,f.props,f.key,f.ref?f.ref:null,f.__v):f)){if(f.__=n,f.__b=n.__b+1,null===(d=y[u])||d&&f.key==d.key&&f.type===d.type)y[u]=void 0;else for(h=0;h<v;h++){if((d=y[h])&&f.key==d.key&&f.type===d.type){y[h]=void 0;break}d=null}Wp(e,f,d=d||Sp,r,o,s,a,l,c),p=f.__e,(h=f.ref)&&d.ref!=h&&(g||(g=[]),d.ref&&g.push(d.ref,null,f),g.push(h,f.__c||p,f)),null!=p?(null==m&&(m=p),"function"==typeof f.type&&f.__k===d.__k?f.__d=l=zp(f,l,e):l=jp(e,f,d,y,p,l),"function"==typeof n.type&&(n.__d=l)):l&&d.__e==l&&l.parentNode!=e&&(l=Np(d))}for(n.__e=m,u=v;u--;)null!=y[u]&&Kp(y[u],y[u]);if(g)for(u=0;u<g.length;u++)Xp(g[u],g[++u],g[++u])}function zp(e,t,n){for(var i,r=e.__k,o=0;r&&o<r.length;o++)(i=r[o])&&(i.__=e,t="function"==typeof i.type?zp(i,t,n):jp(n,i,i,r,i.__e,t));return t}function jp(e,t,n,i,r,o){var s,a,l;if(void 0!==t.__d)s=t.__d,t.__d=void 0;else if(null==n||r!=o||null==r.parentNode)e:if(null==o||o.parentNode!==e)e.appendChild(r),s=null;else{for(a=o,l=0;(a=a.nextSibling)&&l<i.length;l+=1)if(a==r)break e;e.insertBefore(r,o),s=o}return void 0!==s?s:r.nextSibling}function Hp(e,t,n){"-"===t[0]?e.setProperty(t,n):e[t]=null==n?"":"number"!=typeof n||Cp.test(t)?n:n+"px"}function Bp(e,t,n,i,r){var o;e:if("style"===t)if("string"==typeof n)e.style.cssText=n;else{if("string"==typeof i&&(e.style.cssText=i=""),i)for(t in i)n&&t in n||Hp(e.style,t,"");if(n)for(t in n)i&&n[t]===i[t]||Hp(e.style,t,n[t])}else if("o"===t[0]&&"n"===t[1])o=t!==(t=t.replace(/Capture$/,"")),t=t.toLowerCase()in e?t.toLowerCase().slice(2):t.slice(2),e.l||(e.l={}),e.l[t+o]=n,n?i||e.addEventListener(t,o?$p:Vp,o):e.removeEventListener(t,o?$p:Vp,o);else if("dangerouslySetInnerHTML"!==t){if(r)t=t.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if("href"!==t&&"list"!==t&&"form"!==t&&"tabIndex"!==t&&"download"!==t&&t in e)try{e[t]=null==n?"":n;break e}catch(e){}"function"==typeof n||(null==n||!1===n&&-1==t.indexOf("-")?e.removeAttribute(t):e.setAttribute(t,n))}}function Vp(e){this.l[e.type+!1](wp.event?wp.event(e):e)}function $p(e){this.l[e.type+!0](wp.event?wp.event(e):e)}function Wp(e,t,n,i,r,o,s,a,l){var c,u,h,d,f,p,m,g,y,v,b,x,w,q,M,D=t.type;if(void 0!==t.constructor)return null;null!=n.__h&&(l=n.__h,a=t.__e=n.__e,t.__h=null,o=[a]),(c=wp.__b)&&c(t);try{e:if("function"==typeof D){if(g=t.props,y=(c=D.contextType)&&i[c.__c],v=c?y?y.props.value:c.__:i,n.__c?m=(u=t.__c=n.__c).__=u.__E:("prototype"in D&&D.prototype.render?t.__c=u=new D(g,v):(t.__c=u=new Rp(g,v),u.constructor=D,u.render=Gp),y&&y.sub(u),u.props=g,u.state||(u.state={}),u.context=v,u.__n=i,h=u.__d=!0,u.__h=[],u._sb=[]),null==u.__s&&(u.__s=u.state),null!=D.getDerivedStateFromProps&&(u.__s==u.state&&(u.__s=kp({},u.__s)),kp(u.__s,D.getDerivedStateFromProps(g,u.__s))),d=u.props,f=u.state,h)null==D.getDerivedStateFromProps&&null!=u.componentWillMount&&u.componentWillMount(),null!=u.componentDidMount&&u.__h.push(u.componentDidMount);else{if(null==D.getDerivedStateFromProps&&g!==d&&null!=u.componentWillReceiveProps&&u.componentWillReceiveProps(g,v),!u.__e&&null!=u.shouldComponentUpdate&&!1===u.shouldComponentUpdate(g,u.__s,v)||t.__v===n.__v){for(u.props=g,u.state=u.__s,t.__v!==n.__v&&(u.__d=!1),u.__v=t,t.__e=n.__e,t.__k=n.__k,t.__k.forEach((function(e){e&&(e.__=t)})),b=0;b<u._sb.length;b++)u.__h.push(u._sb[b]);u._sb=[],u.__h.length&&s.push(u);break e}null!=u.componentWillUpdate&&u.componentWillUpdate(g,u.__s,v),null!=u.componentDidUpdate&&u.__h.push((function(){u.componentDidUpdate(d,f,p)}))}if(u.context=v,u.props=g,u.__v=t,u.__P=e,x=wp.__r,w=0,"prototype"in D&&D.prototype.render){for(u.state=u.__s,u.__d=!1,x&&x(t),c=u.render(u.props,u.state,u.context),q=0;q<u._sb.length;q++)u.__h.push(u._sb[q]);u._sb=[]}else do{u.__d=!1,x&&x(t),c=u.render(u.props,u.state,u.context),u.state=u.__s}while(u.__d&&++w<25);u.state=u.__s,null!=u.getChildContext&&(i=kp(kp({},i),u.getChildContext())),h||null==u.getSnapshotBeforeUpdate||(p=u.getSnapshotBeforeUpdate(d,f)),M=null!=c&&c.type===Ip&&null==c.key?c.props.children:c,Fp(e,Array.isArray(M)?M:[M],t,n,i,r,o,s,a,l),u.base=t.__e,t.__h=null,u.__h.length&&s.push(u),m&&(u.__E=u.__=null),u.__e=!1}else null==o&&t.__v===n.__v?(t.__k=n.__k,t.__e=n.__e):t.__e=Yp(n.__e,t,n,i,r,o,s,l);(c=wp.diffed)&&c(t)}catch(e){t.__v=null,(l||null!=o)&&(t.__e=a,t.__h=!!l,o[o.indexOf(a)]=null),wp.__e(e,t,n)}}function Up(e,t){wp.__c&&wp.__c(t,e),e.some((function(t){try{e=t.__h,t.__h=[],e.some((function(e){e.call(t)}))}catch(e){wp.__e(e,t.__v)}}))}function Yp(e,t,n,i,r,o,s,a){var l,c,u,h=n.props,d=t.props,f=t.type,p=0;if("svg"===f&&(r=!0),null!=o)for(;p<o.length;p++)if((l=o[p])&&"setAttribute"in l==!!f&&(f?l.localName===f:3===l.nodeType)){e=l,o[p]=null;break}if(null==e){if(null===f)return document.createTextNode(d);e=r?document.createElementNS("http://www.w3.org/2000/svg",f):document.createElement(f,d.is&&d),o=null,a=!1}if(null===f)h===d||a&&e.data===d||(e.data=d);else{if(o=o&&xp.call(e.childNodes),c=(h=n.props||Sp).dangerouslySetInnerHTML,u=d.dangerouslySetInnerHTML,!a){if(null!=o)for(h={},p=0;p<e.attributes.length;p++)h[e.attributes[p].name]=e.attributes[p].value;(u||c)&&(u&&(c&&u.__html==c.__html||u.__html===e.innerHTML)||(e.innerHTML=u&&u.__html||""))}if(function(e,t,n,i,r){var o;for(o in n)"children"===o||"key"===o||o in t||Bp(e,o,null,n[o],i);for(o in t)r&&"function"!=typeof t[o]||"children"===o||"key"===o||"value"===o||"checked"===o||n[o]===t[o]||Bp(e,o,t[o],n[o],i)}(e,d,h,r,a),u)t.__k=[];else if(p=t.props.children,Fp(e,Array.isArray(p)?p:[p],t,n,i,r&&"foreignObject"!==f,o,s,o?o[0]:n.__k&&Np(n,0),a),null!=o)for(p=o.length;p--;)null!=o[p]&&Ep(o[p]);a||("value"in d&&void 0!==(p=d.value)&&(p!==e.value||"progress"===f&&!p||"option"===f&&p!==h.value)&&Bp(e,"value",p,h.value,!1),"checked"in d&&void 0!==(p=d.checked)&&p!==e.checked&&Bp(e,"checked",p,h.checked,!1))}return e}function Xp(e,t,n){try{"function"==typeof e?e(t):e.current=t}catch(e){wp.__e(e,n)}}function Kp(e,t,n){var i,r;if(wp.unmount&&wp.unmount(e),(i=e.ref)&&(i.current&&i.current!==e.__e||Xp(i,null,t)),null!=(i=e.__c)){if(i.componentWillUnmount)try{i.componentWillUnmount()}catch(e){wp.__e(e,t)}i.base=i.__P=null,e.__c=void 0}if(i=e.__k)for(r=0;r<i.length;r++)i[r]&&Kp(i[r],t,n||"function"!=typeof e.type);n||null==e.__e||Ep(e.__e),e.__=e.__e=e.__d=void 0}function Gp(e,t,n){return this.constructor(e,n)}function Jp(e,t,n){var i,r,o;wp.__&&wp.__(e,t),r=(i="function"==typeof n)?null:n&&n.__k||t.__k,o=[],Wp(t,e=(!i&&n||t).__k=Ap(Ip,null,[e]),r||Sp,Sp,void 0!==t.ownerSVGElement,!i&&n?[n]:r?null:t.firstChild?xp.call(t.childNodes):null,o,!i&&n?n:r?r.__e:t.firstChild,i),Up(o,e)}function Zp(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const{createElement:t=document.createElement.bind(document)}=e;let n,i,r=Of();const o={transform:void 0},s=Pf();return s.element=()=>n,s.root=()=>n,s.settings=e=>(e&&Object.keys(o).forEach((t=>{void 0!==e[t]&&(o[t]=e[t])})),o),s.appendTo=e=>(n||(n=t("div"),n.style.position="absolute",n.style["-webkit-font-smoothing"]="antialiased",n.style["-moz-osx-font-smoothing"]="antialiased",n.style.pointerEvents="none"),e.appendChild(n),n),s.render=e=>{if(!n)return!1;const t="function"==typeof o.transform&&o.transform();if(t){const{a:e,b:i,c:r,d:o,e:s,f:a}=t;return n.style.transform="matrix(".concat(e,", ").concat(i,", ").concat(r,", ").concat(o,", ").concat(s,", ").concat(a,")"),!0}let s;return n.style.transform="",n.style.left="".concat(r.computedPhysical.x,"px"),n.style.top="".concat(r.computedPhysical.y,"px"),n.style.width="".concat(r.computedPhysical.width,"px"),n.style.height="".concat(r.computedPhysical.height,"px"),s=Array.isArray(e)?Ap("div",null,e):e,i=Jp(s,n,i),!0},s.renderArgs=[Ap],s.clear=()=>{if(n){let e=n.firstChild;for(;e;)n.removeChild(e),e=n.firstChild;i=null}return s},s.destroy=()=>{n&&n.parentElement&&n.parentElement.removeChild(n),n=null,i=null},s.size=e=>(e&&(r=Of(e)),r),s}xp=_p.slice,wp={__e:function(e,t,n,i){for(var r,o,s;t=t.__;)if((r=t.__c)&&!r.__)try{if((o=r.constructor)&&null!=o.getDerivedStateFromError&&(r.setState(o.getDerivedStateFromError(e)),s=r.__d),null!=r.componentDidCatch&&(r.componentDidCatch(e,i||{}),s=r.__d),s)return r.__E=r}catch(t){e=t}throw e}},qp=0,Rp.prototype.setState=function(e,t){var n;n=null!=this.__s&&this.__s!==this.state?this.__s:this.__s=kp({},this.state),"function"==typeof e&&(e=e(kp({},n),this.props)),e&&kp(n,e),null!=e&&this.__v&&(t&&this._sb.push(t),Pp(this))},Rp.prototype.forceUpdate=function(e){this.__v&&(this.__e=!0,e&&this.__h.push(e),Pp(this))},Rp.prototype.render=Ip,Mp=[],Lp.__r=0;var Qp=[function(e){e.renderer("svg",bp)},function(e){e.renderer("canvas",Xf)},function(e){e.renderer("dom",Zp)}];const em={OFF:0,ERROR:1,WARN:2,INFO:3,DEBUG:4},tm=function(){let{level:e=em.OFF,pipe:t=console}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=e;const i={[em.OFF]:()=>{},[em.ERROR]:function(){return t.error(...arguments)},[em.WARN]:function(){return t.warn(...arguments)},[em.INFO]:function(){return t.info(...arguments)},[em.DEBUG]:function(){return t.log(...arguments)}},r=function(e){if(e&&!(n<e)){for(var t=arguments.length,r=new Array(t>1?t-1:0),o=1;o<t;o++)r[o-1]=arguments[o];(i[e]||i[em.DEBUG])(...r)}};return{log:r,error:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return r(em.ERROR,...t)},warn:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return r(em.WARN,...t)},info:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return r(em.INFO,...t)},debug:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return r(em.DEBUG,...t)},level:e=>("number"==typeof e&&(n=e),n),LOG_LEVEL:em}};function nm(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2?arguments[2]:void 0;e(n,t)}const im=function e(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const i=tm(t.logger),r={component:Ge(n.component,"component",i),data:Ge(n.data,"data",i),formatter:Ge(n.formatter,"formatter",i),interaction:Ge(n.interaction,"interaction",i),renderer:cl(n.renderer),scale:Ge(n.scale,"scale",i),symbol:Ge(n.symbol,"symbol",i),logger:i};function o(){let n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},i={palettes:t.palettes.concat(n.palettes||[]),style:A({},t.style,n.style),logger:n.logger||t.logger,renderer:n.renderer||t.renderer};return e(i,r)}return t.renderer&&t.renderer.prio&&r.renderer.default(t.renderer.prio[0]),o.use=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return nm(e,t,r)},o.chart=e=>ll(e,{registries:r,logger:i,style:t.style,palettes:t.palettes}),o.config=()=>t,Object.keys(r).forEach((e=>{o[e]=r[e]})),o.version=T,o}({renderer:{prio:["svg","canvas"]},logger:{level:0},style:{"$font-family":"'Source Sans Pro', Arial, sans-serif","$font-size":"12px","$line-height":"16px","$font-size--l":"16px","$font-weight":"normal","$gray-100":"#ffffff","$gray-98":"#f9f9f9","$gray-95":"#f2f2f2","$gray-90":"#e6e6e6","$gray-35":"#595959","$gray-30":"#4d4d4d","$gray-25":"#404040","$gray-20":"#333333","$border-95":"rgba(255, 255, 255, 0.05)","$border-90":"rgba(255, 255, 255, 0.1)","$border-80":"rgba(255, 255, 255, 0.2)","$border-20":"rgba(0, 0, 0, 0.2)","$border-10":"rgba(0, 0, 0, 0.1)","$border-5":"rgba(0, 0, 0, 0.05)","$primary-blue":"#3F8AB3","$primary-green":"#6CB33F","$primary-red":"#DC423F","$primary-orange":"#EF960F","$spacing--s":4,$spacing:8,"$spacing--l":12,"$font-color":"$gray-35","$font-color--inverted":"$gray-90","$guide-color":"$gray-90","$guide-color--inverted":"$gray-35",$border:"$border-80","$border--inverted":"$border-10",$shape:{fill:"$primary-blue",strokeWidth:1,stroke:"$border"},"$shape-outline":{stroke:"$primary-blue",strokeWidth:2},"$shape-guide":{stroke:"$guide-color",strokeWidth:1},"$shape-guide--inverted":{"@extend":"$shape-guide",stroke:"$guide-color--inverted"},$label:{fontSize:"$font-size",fontFamily:"$font-family",fill:"$font-color"},"$label--inverted":{$extend:"$label",fill:"$font-color--inverted"},"$label-overlay":{fontSize:"$font-size--l",fontFamily:"$font-family",fill:"$gray-100",color:"$font-color",stroke:"$guide-color--inverted",strokeWidth:1,borderRadius:4},$title:{"@extend":"$label",fontSize:"$font-size--l",fontWeight:"$font-weight",stroke:"$guide-color--inverted",strokeWidth:0},"$guide-line":{strokeWidth:1,stroke:"$guide-color"},"$guide-line--minor":{strokeWidth:1,stroke:"$gray-95"},"$padding--s":{left:"$spacing--s",right:"$spacing--s",top:"$spacing--s",bottom:"$spacing--s"},$padding:{left:"$spacing",right:"$spacing",top:"$spacing",bottom:"$spacing"},"$selection-area-target":{fill:"$primary-green",strokeWidth:0,opacity:.2}},palettes:[{key:"categorical",colors:[["#a54343","#d76c6c","#ec983d","#ecc43d","#f9ec86","#cbe989","#70ba6e","#578b60","#79d69f","#26a0a7","#138185","#65d3da"]]},{key:"diverging",colors:[["#3d52a1","#3a89c9","#77b7e5","#b4ddf7","#e6f5fe","#ffe3aa","#f9bd7e","#ed875e","#d24d3e","#ae1c3e"]]},{key:"sequential",colors:[["rgb(180,221,212)","rgb(34, 83, 90)"]]}]},{component:ul,data:gl,formatter:qi,interaction:yl,renderer:cl(),scale:Fo,symbol:Gs});function rm(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,i)}return n}function om(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?rm(Object(n),!0).forEach((function(t){sm(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):rm(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function sm(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 i=n.call(e,t||"default");if("object"!=typeof i)return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:String(t)}(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}gd.forEach(im.use),Qp.forEach(im.use),[].forEach(im.use);var am=Object.prototype.hasOwnProperty,lm=Object.prototype.toString,cm=Object.defineProperty,um=Object.getOwnPropertyDescriptor,hm=function(e){return"function"==typeof Array.isArray?Array.isArray(e):"[object Array]"===lm.call(e)},dm=function(e){if(!e||"[object Object]"!==lm.call(e))return!1;var t,n=am.call(e,"constructor"),i=e.constructor&&e.constructor.prototype&&am.call(e.constructor.prototype,"isPrototypeOf");if(e.constructor&&!n&&!i)return!1;for(t in e);return void 0===t||am.call(e,t)},fm=function(e,t){cm&&"__proto__"===t.name?cm(e,t.name,{enumerable:!0,configurable:!0,value:t.newValue,writable:!0}):e[t.name]=t.newValue},pm=function(e,t){if("__proto__"===t){if(!am.call(e,t))return;if(um)return um(e,t).value}return e[t]},mm=function e(){var t,n,i,r,o,s,a=arguments[0],l=1,c=arguments.length,u=!1;for("boolean"==typeof a&&(u=a,a=arguments[1]||{},l=2),(null==a||"object"!=typeof a&&"function"!=typeof a)&&(a={});l<c;++l)if(null!=(t=arguments[l]))for(n in t)i=pm(a,n),a!==(r=pm(t,n))&&(u&&r&&(dm(r)||(o=hm(r)))?(o?(o=!1,s=i&&hm(i)?i:[]):s=i&&dm(i)?i:{},fm(a,{name:n,newValue:e(u,s,r)})):void 0!==r&&fm(a,{name:n,newValue:r}));return a};function gm(e,t,n){if(!e)return-1;const i=n.cache,r=e.origin?e.origin():null;r&&(e=r);let o=i.fields.indexOf(e),s=-1,a=-1;if(-1===o)for(let t=0;t<i.wrappedFields.length;t++)if(a=i.wrappedFields[t].attrDims.map((e=>e.instance)).indexOf(e),s=i.wrappedFields[t].attrExps.map((e=>e.instance)).indexOf(e),-1!==a||-1!==s){o=t;break}return o-=t.qArea.qLeft,o<0||o>=t.qArea.qWidth?-1:a>=0?e=>e[o].qAttrDims.qValues[a]:s>=0?e=>e[o].qAttrExps.qValues[s]:e=>e[o]}function ym(e,t,n){let{key:i}=n;const r={value:"function"==typeof e.value?e.value(t):void 0!==e.value?e.value:t};return r.label="function"==typeof e.label?e.label(t):void 0!==e.label?String(e.label):String(r.value),e.field&&(r.source={key:i,field:e.field.key()}),r}function vm(e){let{cache:t,f:n,mainCell:i,p:r,prop:o,page:s,rowIdx:a,row:l,sourceKey:c,target:u,targetProp:h}=e,d=i;if(r.field&&r.field!==n){const e=gm(r.field,s,{cache:t});if(-1===e)return;d=mm({qRow:a},e(l))}u[h]=ym(r,d,{key:c})}function bm(e,t,n,i){const r=Array.isArray(e)?e:[e];let o=[];for(let e=0;e<r.length;e++)if(void 0!==r[e].field){const s=t.raw(),a=t.key(),l="object"==typeof r[e].field?r[e].field:t.field(r[e].field),{props:c,main:u}=i.normalizeConfig(r[e],t),h=Object.keys(c),d=!!r[e].trackBy,f=typeof r[e].trackBy,p={},m=[],g=[];for(let t=0;t<s.qDataPages.length;t++){const o=gm(l,s.qDataPages[t],{cache:n});if(-1!==o)for(let y=0;y<s.qDataPages[t].qMatrix.length;y++){const v=s.qDataPages[t].qArea.qTop+y,b=mm({qRow:v},o(s.qDataPages[t].qMatrix[y])),x=ym(u,b,{key:a});if(!(u.filter&&!u.filter(b))){for(let e=0;e<h.length;e++){const i=c[h[e]];let r=i.fields||[i];i.fields&&(x[h[e]]=[]);for(let o=0;o<r.length;o++)vm({cache:n,f:l,mainCell:b,p:r[o],prop:h[e],props:c,page:s.qDataPages[t],rowIdx:v,row:s.qDataPages[t].qMatrix[y],sourceKey:a,target:i.fields?x[h[e]]:x,targetProp:i.fields?o:h[e]});if(i.fields){const t=x[h[e]].map((e=>e.value)),n=x[h[e]].map((e=>e.label));x[h[e]]={value:"function"==typeof i.value?i.value(t):void 0!==i.value?i.value:t,label:"function"==typeof i.label?i.label(n):void 0!==i.label?String(i.label):String(x[h[e]].value)}}}d&&i.track({cfg:r[e],itemData:b,obj:x,target:m,tracker:p,trackType:f}),g.push(x)}}}const y=d?i.collect(m,{main:u,propsArr:h,props:c}):g;o=[...o,...y]}return o}function xm(e){var t=0,n=e.children,i=n&&n.length;if(i)for(;--i>=0;)t+=n[i].value;else t=1;e.value=t}function wm(e,t){e instanceof Map?(e=[void 0,e],void 0===t&&(t=Mm)):void 0===t&&(t=qm);for(var n,i,r,o,s,a=new _m(e),l=[a];n=l.pop();)if((r=t(n.data))&&(s=(r=Array.from(r)).length))for(n.children=r,o=s-1;o>=0;--o)l.push(i=r[o]=new _m(r[o])),i.parent=n,i.depth=n.depth+1;return a.eachBefore(Sm)}function qm(e){return e.children}function Mm(e){return Array.isArray(e)?e[1]:null}function Dm(e){void 0!==e.data.value&&(e.value=e.data.value),e.data=e.data.data}function Sm(e){var t=0;do{e.height=t}while((e=e.parent)&&e.height<++t)}function _m(e){this.data=e,this.depth=this.height=0,this.parent=null}function Cm(e){return null==e?null:function(e){if("function"!=typeof e)throw new Error;return e}(e)}_m.prototype=wm.prototype={constructor:_m,count:function(){return this.eachAfter(xm)},each:function(e,t){let n=-1;for(const i of this)e.call(t,i,++n,this);return this},eachAfter:function(e,t){for(var n,i,r,o=this,s=[o],a=[],l=-1;o=s.pop();)if(a.push(o),n=o.children)for(i=0,r=n.length;i<r;++i)s.push(n[i]);for(;o=a.pop();)e.call(t,o,++l,this);return this},eachBefore:function(e,t){for(var n,i,r=this,o=[r],s=-1;r=o.pop();)if(e.call(t,r,++s,this),n=r.children)for(i=n.length-1;i>=0;--i)o.push(n[i]);return this},find:function(e,t){let n=-1;for(const i of this)if(e.call(t,i,++n,this))return i},sum:function(e){return this.eachAfter((function(t){for(var n=+e(t.data)||0,i=t.children,r=i&&i.length;--r>=0;)n+=i[r].value;t.value=n}))},sort:function(e){return this.eachBefore((function(t){t.children&&t.children.sort(e)}))},path:function(e){for(var t=this,n=function(e,t){if(e===t)return e;var n=e.ancestors(),i=t.ancestors(),r=null;e=n.pop(),t=i.pop();for(;e===t;)r=e,e=n.pop(),t=i.pop();return r}(t,e),i=[t];t!==n;)t=t.parent,i.push(t);for(var r=i.length;e!==n;)i.splice(r,0,e),e=e.parent;return i},ancestors:function(){for(var e=this,t=[e];e=e.parent;)t.push(e);return t},descendants:function(){return Array.from(this)},leaves:function(){var e=[];return this.eachBefore((function(t){t.children||e.push(t)})),e},links:function(){var e=this,t=[];return e.each((function(n){n!==e&&t.push({source:n.parent,target:n})})),t},copy:function(){return wm(this).eachBefore(Dm)},[Symbol.iterator]:function*(){var e,t,n,i,r=this,o=[r];do{for(e=o.reverse(),o=[];r=e.pop();)if(yield r,t=r.children)for(n=0,i=t.length;n<i;++n)o.push(t[n])}while(o.length)}};var km={depth:-1},Em={},Am={};function Tm(e){return e.id}function Im(e){return e.parentId}function Rm(){var e,t=Tm,n=Im;function i(i){var r,o,s,a,l,c,u,h,d=Array.from(i),f=t,p=n,m=new Map;if(null!=e){const t=d.map(((t,n)=>function(e){e=`${e}`;let t=e.length;Om(e,t-1)&&!Om(e,t-2)&&(e=e.slice(0,-1));return"/"===e[0]?e:`/${e}`}(e(t,n,i)))),n=t.map(Nm),r=new Set(t).add("");for(const e of n)r.has(e)||(r.add(e),t.push(e),n.push(Nm(e)),d.push(Am));f=(e,n)=>t[n],p=(e,t)=>n[t]}for(s=0,r=d.length;s<r;++s)o=d[s],c=d[s]=new _m(o),null!=(u=f(o,s,i))&&(u+="")&&(h=c.id=u,m.set(h,m.has(h)?Em:c)),null!=(u=p(o,s,i))&&(u+="")&&(c.parent=u);for(s=0;s<r;++s)if(u=(c=d[s]).parent){if(!(l=m.get(u)))throw new Error("missing: "+u);if(l===Em)throw new Error("ambiguous: "+u);l.children?l.children.push(c):l.children=[c],c.parent=l}else{if(a)throw new Error("multiple roots");a=c}if(!a)throw new Error("no root");if(null!=e){for(;a.data===Am&&1===a.children.length;)a=a.children[0],--r;for(let e=d.length-1;e>=0&&(c=d[e]).data===Am;--e)c.data=null}if(a.parent=km,a.eachBefore((function(e){e.depth=e.parent.depth+1,--r})).eachBefore(Sm),a.parent=null,r>0)throw new Error("cycle");return a}return i.id=function(e){return arguments.length?(t=Cm(e),i):t},i.parentId=function(e){return arguments.length?(n=Cm(e),i):n},i.path=function(t){return arguments.length?(e=Cm(t),i):e},i}function Nm(e){let t=e.length;if(t<2)return"";for(;--t>1&&!Om(e,t););return e.slice(0,t)}function Om(e,t){if("/"===e[t]){let n=0;for(;t>0&&"\\"===e[--t];)++n;if(0==(1&n))return!0}return!1}function Pm(e,t){"/"===e.charAt(0)&&(e=e.substring(1));const n=e.split("/");let i,r=t;for(let e=0;e<n.length;e++){if("*"===n[e]&&Array.isArray(r)){const t=[];i=n.slice(e+1).join("/");for(let e=0;e<r.length;e++){let n=Pm(i,r[e]);Array.isArray(n)?t.push(...n):t.push(n)}return t}if(!n[e]&&Array.isArray(r)){const t=new Array(r.length);i=n.slice(e+1).join("/");for(let e=0;e<r.length;e++)t[e]=Pm(i,r[e]);return t}n[e]in r&&(r=r[n[e]])}return r}function Lm(e,t,n){let i=[];if(!e||!e.length)return i;if(t<=0){const t=n>=0?[e[n]]:e;i=[...i,...t]}else for(let r=0;r<e.length;r++)e[r].children&&e[r].children.length&&(i=[...i,...Lm(e[r].children,t-1,n)]);return i}function Fm(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 i=Math.max(0,Math.min(100,t-e));return e=>Lm(e.children,i-1,n)}return!1}function zm(e,t){let{cache:n}=t;if("number"==typeof e)return n.fields[e];const i=n.allFields;if("function"==typeof e){for(let t=0;t<i.length;t++)if(e(i[t]))return i[t];return!1}if("string"==typeof e){for(let t=0;t<i.length;t++)if(i[t].key()===e||i[t].title()===e)return i[t]}else if(e&&-1!==i.indexOf(e))return e;throw Error("Field not found: ".concat(e))}const jm=/^qDimensionInfo(?:\/(\d+))?/,Hm=/^\/?qMeasureInfo\/(\d+)/,Bm=/\/qAttrExprInfo\/(\d+)/,Vm=/\/qAttrDimInfo\/(\d+)/;function $m(e){return(e.qColumnOrder&&e.qColumnOrder.length?e.qColumnOrder:e.qDimensionInfo.map(((e,t)=>t))).filter((t=>t<e.qDimensionInfo.length))}function Wm(e,t){let{cube:n}=t;if(!e)return-1;let i=e.origin&&e.origin()?e.origin().key():e.key(),r=!1,o=-1,s=-1,a=-1,l=-1,c=-1,u=-1,h=i;const d=n.qEffectiveInterColumnSortOrder,f=$m(n);return jm.test(h)&&(r=!0,o=+jm.exec(h)[1],h=i.replace(jm,"")),Hm.test(h)&&("K"===n.qMode?c=+Hm.exec(h)[1]:d&&-1!==d.indexOf(-1)?(c=+Hm.exec(h)[1],u=0):u=+Hm.exec(h)[1],h=h.replace(Hm,"")),h&&(Vm.exec(h)?a=+Vm.exec(h)[1]:Bm.exec(h)&&(s=+Bm.exec(h)[1])),l=r?"S"===n.qMode?f[o]:d?d.indexOf(o):o:d&&-1!==d.indexOf(-1)?d.indexOf(-1):n.qDimensionInfo.length-("K"===n.qMode?0:1),{fieldDepth:l+1,pseudoMeasureIndex:c,measureIdx:u,attrDimIdx:a,attrIdx:s}}function Um(e,t){let n,i,r=Fm(e.fieldDepth,t.fieldDepth,t.pseudoMeasureIndex);return n=t.measureIdx>=0?e=>e.data.qValues[t.measureIdx]:e=>e.data,t.attrDimIdx>=0?i=e=>{var n;return null==e||null===(n=e.qAttrDims)||void 0===n?void 0:n.qValues[t.attrDimIdx]}:t.attrIdx>=0&&(i=e=>{var n;return null==e||null===(n=e.qAttrExps)||void 0===n?void 0:n.qValues[t.attrIdx]}),{nodeFn:r,attrFn:i,valueFn:n}}function Ym(e,t,n){let{key:i}=n;const r={value:"function"==typeof e.value?e.value(t):void 0!==e.value?e.value:t};return r.label="function"==typeof e.label?e.label(t):void 0!==e.label?String(e.label):String(r.value),e.field&&(r.source={key:i,field:e.field.key()}),r}function Xm(e){let{propsArr:t,props:n,item:i,itemData:r,ret:o,sourceKey:s}=e;for(let e=0;e<t.length;e++){const a=n[t[e]],l=a.fields||[a];let c,u;a.fields&&(c=[],u=[]);for(let n=0;n<l.length;n++){const h=l[n];let d,f,p,m,g,y;if("primitive"===h.type?(p=h.value,y=String(h.value)):("function"==typeof h.value&&(d=e=>h.value(e,i)),"function"==typeof h.label&&(f=e=>h.label(e,i)),h.accessor?(m=h.accessor(i),Array.isArray(m)?(g=m.map(h.valueAccessor),h.attrAccessor&&(g=g.map(h.attrAccessor)),d&&(p=g.map(d),d=null),f&&(y=g.map(f),f=null),p=h.reduce?h.reduce(p):p,y=h.reduceLabel?h.reduceLabel(y,p):String(p)):(p=h.attrAccessor?h.attrAccessor(h.valueAccessor(m)):h.valueAccessor(m),y=p)):(p=r,y=r)),a.fields){const e=d?d(p):p;c.push(e),u.push(f&&null!=y?f(y):null!=y?y:String(e))}else{const n=d?d(p):p;o[t[e]]={value:n,label:f?f(y):null!=y?y:String(n)},h.field&&(o[t[e]].source={field:h.field.key(),key:s})}}c&&(o[t[e]]={value:"function"==typeof a.value?a.value(c,i):c,label:"function"==typeof a.label?a.label(u,i):u})}}const Km=(e,t,n)=>{const i="K"===e.qMode?"/qStackedDataPages/*/qData":"/qTreeDataPages/*",r="K"===e.qMode?"qSubNodes":"qNodes",o=Pm(i,e);return o&&o[0]?(t.tree=wm(o[0],n.children||(e=>e[r])),t.tree):null};function Gm(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),i=e.fields(),r=e.fields().filter((e=>"dimension"===e.type())).map((e=>n.indexOf(i.indexOf(e)))),o=e.fields().filter((e=>"measure"===e.type())).map((e=>n.indexOf(i.indexOf(e)))),s={__root:{__id:"__root",qValues:[]}};for(let e=0;e<t.length;e++){const n=t[e];let i="__root",l=!1;for(let e=0;e<r.length;e++){var a;const t=n[r[e]],o="".concat(i,"__").concat(null!==(a=t.qElemNumber)&&void 0!==a?a:t.qElemNo);s[o]||(s[o]=om({__id:o,__parent:i,qValues:[]},t),l=!0),i=o}if(l)for(let e=0;e<o.length;e++){const t=n[o[e]];s[i].qValues.push(t)}}const l=Object.keys(s).map((e=>s[e])),c=Rm().id((e=>e.__id)).parentId((e=>e.__parent))(l);return c}const Jm=e=>{let{propsArr:t,props:n,cube:i,cache:r,itemDepthObject:o,f:s}=e;for(let e=0;e<t.length;e++){const a=n[t[e]],l=a.fields?a.fields:[a];for(let e=0;e<l.length;e++){const t=l[e];if(t.field!==s){const e=Um(o,Wm(t.field,{cube:i,cache:r}));t.accessor=e.nodeFn,t.valueAccessor=e.valueFn,t.attrAccessor=e.attrFn}}}};function Zm(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0,n=arguments.length>2?arguments[2]:void 0,i=arguments.length>3?arguments[3]:void 0;const r=t.raw(),o=t.key(),s="S"===r.qMode?Gm(t):Km(r,n,e);if(!s)return null;const a=s.height,l=[];for(let o=0;o<=a;o++){let s=null;if(o>0)if("S"===r.qMode){let e=$m(r)[o-1];s=n.fields[e]}else{let e=r.qEffectiveInterColumnSortOrder[o-1];o>r.qEffectiveInterColumnSortOrder.length&&(e=r.qDimensionInfo.length),s=n.fields[e]}const{props:a,main:c}=i.normalizeConfig(om(om({},e),{},{field:s?s.key():void 0}),t),u=Object.keys(a);l[o]={propsArr:u,props:a,main:c};const h=s?Wm(s,{cube:r,cache:n}):{fieldDepth:0};Jm({propsArr:u,props:a,cube:r,cache:n,itemDepthObject:h,f:s})}const c=s.copy(),u=c.descendants(),h=s.descendants();for(let e=0;e<h.length;e++){const t=l[h[e].depth].propsArr,n=l[h[e].depth].props,i=l[h[e].depth].main,r=u[e],s=r.data,a=Ym(i,s,{key:o});Xm({propsArr:t,props:n,item:r,itemData:s,ret:a,sourceKey:o,isTree:!0}),h[e].data=a}return s}function Qm(e,t,n,i){const r=Array.isArray(e)?e:[e];let o=[];for(let s=0;s<r.length;s++)if(void 0!==r[s].field){const a=t.raw(),l=t.key();if(!Km(a,n,e))continue;const c="object"==typeof r[s].field?r[s].field:t.field(r[s].field),{props:u,main:h}=i.normalizeConfig(r[s],t),d=Object.keys(u),f=Wm(c,{cube:a,cache:n}),{nodeFn:p,attrFn:m,valueFn:g}=Um({fieldDepth:0},f);Jm({propsArr:d,props:u,cube:a,cache:n,itemDepthObject:f,f:c});const y=!!r[s].trackBy,v=typeof r[s].trackBy,b={},x=[],w=p(n.tree),q=[];for(let e=0;e<w.length;e++){const t=w[e],n=m?m(g(t)):g(t);if(h.filter&&!h.filter(n))continue;const o=Ym(h,n,{key:l});Xm({propsArr:d,props:u,item:t,itemData:n,ret:o,sourceKey:l}),y&&i.track({cfg:r[s],itemData:n,obj:o,target:x,tracker:b,trackType:v}),q.push(o)}const M=y?i.collect(x,{main:h,propsArr:d,props:u}):q;o=[...o,...M]}return o}"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self&&self;var eg=function(e,t){return e(t={exports:{}},t.exports),t.exports}((function(e){
|
|
16
|
+
* Date: 2023-05-11T18:29Z
|
|
17
|
+
*/!function(e){!function(t,n){e.exports=t.document?n(t,!0):function(e){if(!e.document)throw new Error("jQuery requires a window with a document");return n(e)}}("undefined"!=typeof window?window:t,(function(e,t){var n=[],i=Object.getPrototypeOf,r=n.slice,o=n.flat?function(e){return n.flat.call(e)}:function(e){return n.concat.apply([],e)},s=n.push,a=n.indexOf,l={},c=l.toString,u=l.hasOwnProperty,h=u.toString,d=h.call(Object),f={},p=function(e){return"function"==typeof e&&"number"!=typeof e.nodeType&&"function"!=typeof e.item},m=function(e){return null!=e&&e===e.window},g=e.document,y={type:!0,src:!0,nonce:!0,noModule:!0};function v(e,t,n){var i,r,o=(n=n||g).createElement("script");if(o.text=e,t)for(i in y)(r=t[i]||t.getAttribute&&t.getAttribute(i))&&o.setAttribute(i,r);n.head.appendChild(o).parentNode.removeChild(o)}function b(e){return null==e?e+"":"object"==typeof e||"function"==typeof e?l[c.call(e)]||"object":typeof e}var x="3.7.0",w=/HTML$/i,q=function(e,t){return new q.fn.init(e,t)};function S(e){var t=!!e&&"length"in e&&e.length,n=b(e);return!p(e)&&!m(e)&&("array"===n||0===t||"number"==typeof t&&t>0&&t-1 in e)}function M(e,t){return e.nodeName&&e.nodeName.toLowerCase()===t.toLowerCase()}q.fn=q.prototype={jquery:x,constructor:q,length:0,toArray:function(){return r.call(this)},get:function(e){return null==e?r.call(this):e<0?this[e+this.length]:this[e]},pushStack:function(e){var t=q.merge(this.constructor(),e);return t.prevObject=this,t},each:function(e){return q.each(this,e)},map:function(e){return this.pushStack(q.map(this,(function(t,n){return e.call(t,n,t)})))},slice:function(){return this.pushStack(r.apply(this,arguments))},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},even:function(){return this.pushStack(q.grep(this,(function(e,t){return(t+1)%2})))},odd:function(){return this.pushStack(q.grep(this,(function(e,t){return t%2})))},eq:function(e){var t=this.length,n=+e+(e<0?t:0);return this.pushStack(n>=0&&n<t?[this[n]]:[])},end:function(){return this.prevObject||this.constructor()},push:s,sort:n.sort,splice:n.splice},q.extend=q.fn.extend=function(){var e,t,n,i,r,o,s=arguments[0]||{},a=1,l=arguments.length,c=!1;for("boolean"==typeof s&&(c=s,s=arguments[a]||{},a++),"object"==typeof s||p(s)||(s={}),a===l&&(s=this,a--);a<l;a++)if(null!=(e=arguments[a]))for(t in e)i=e[t],"__proto__"!==t&&s!==i&&(c&&i&&(q.isPlainObject(i)||(r=Array.isArray(i)))?(n=s[t],o=r&&!Array.isArray(n)?[]:r||q.isPlainObject(n)?n:{},r=!1,s[t]=q.extend(c,o,i)):void 0!==i&&(s[t]=i));return s},q.extend({expando:"jQuery"+(x+Math.random()).replace(/\D/g,""),isReady:!0,error:function(e){throw new Error(e)},noop:function(){},isPlainObject:function(e){var t,n;return!(!e||"[object Object]"!==c.call(e))&&(!(t=i(e))||"function"==typeof(n=u.call(t,"constructor")&&t.constructor)&&h.call(n)===d)},isEmptyObject:function(e){var t;for(t in e)return!1;return!0},globalEval:function(e,t,n){v(e,{nonce:t&&t.nonce},n)},each:function(e,t){var n,i=0;if(S(e))for(n=e.length;i<n&&!1!==t.call(e[i],i,e[i]);i++);else for(i in e)if(!1===t.call(e[i],i,e[i]))break;return e},text:function(e){var t,n="",i=0,r=e.nodeType;if(r){if(1===r||9===r||11===r)return e.textContent;if(3===r||4===r)return e.nodeValue}else for(;t=e[i++];)n+=q.text(t);return n},makeArray:function(e,t){var n=t||[];return null!=e&&(S(Object(e))?q.merge(n,"string"==typeof e?[e]:e):s.call(n,e)),n},inArray:function(e,t,n){return null==t?-1:a.call(t,e,n)},isXMLDoc:function(e){var t=e&&e.namespaceURI,n=e&&(e.ownerDocument||e).documentElement;return!w.test(t||n&&n.nodeName||"HTML")},merge:function(e,t){for(var n=+t.length,i=0,r=e.length;i<n;i++)e[r++]=t[i];return e.length=r,e},grep:function(e,t,n){for(var i=[],r=0,o=e.length,s=!n;r<o;r++)!t(e[r],r)!==s&&i.push(e[r]);return i},map:function(e,t,n){var i,r,s=0,a=[];if(S(e))for(i=e.length;s<i;s++)null!=(r=t(e[s],s,n))&&a.push(r);else for(s in e)null!=(r=t(e[s],s,n))&&a.push(r);return o(a)},guid:1,support:f}),"function"==typeof Symbol&&(q.fn[Symbol.iterator]=n[Symbol.iterator]),q.each("Boolean Number String Function Array Date RegExp Object Error Symbol".split(" "),(function(e,t){l["[object "+t+"]"]=t.toLowerCase()}));var D=n.pop,_=n.sort,C=n.splice,k="[\\x20\\t\\r\\n\\f]",E=new RegExp("^"+k+"+|((?:^|[^\\\\])(?:\\\\.)*)"+k+"+$","g");q.contains=function(e,t){var n=t&&t.parentNode;return e===n||!(!n||1!==n.nodeType||!(e.contains?e.contains(n):e.compareDocumentPosition&&16&e.compareDocumentPosition(n)))};var A=/([\0-\x1f\x7f]|^-?\d)|^-$|[^\x80-\uFFFF\w-]/g;function T(e,t){return t?"\0"===e?"�":e.slice(0,-1)+"\\"+e.charCodeAt(e.length-1).toString(16)+" ":"\\"+e}q.escapeSelector=function(e){return(e+"").replace(A,T)};var I=g,R=s;!function(){var t,i,o,s,l,c,h,d,p,m,g=R,y=q.expando,v=0,b=0,x=ee(),w=ee(),S=ee(),A=ee(),T=function(e,t){return e===t&&(l=!0),0},O="checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped",N="(?:\\\\[\\da-fA-F]{1,6}"+k+"?|\\\\[^\\r\\n\\f]|[\\w-]|[^\0-\\x7f])+",P="\\["+k+"*("+N+")(?:"+k+"*([*^$|!~]?=)"+k+"*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|("+N+"))|)"+k+"*\\]",L=":("+N+")(?:\\((('((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\")|((?:\\\\.|[^\\\\()[\\]]|"+P+")*)|.*)\\)|)",F=new RegExp(k+"+","g"),z=new RegExp("^"+k+"*,"+k+"*"),j=new RegExp("^"+k+"*([>+~]|"+k+")"+k+"*"),H=new RegExp(k+"|>"),B=new RegExp(L),V=new RegExp("^"+N+"$"),$={ID:new RegExp("^#("+N+")"),CLASS:new RegExp("^\\.("+N+")"),TAG:new RegExp("^("+N+"|[*])"),ATTR:new RegExp("^"+P),PSEUDO:new RegExp("^"+L),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+k+"*(even|odd|(([+-]|)(\\d*)n|)"+k+"*(?:([+-]|)"+k+"*(\\d+)|))"+k+"*\\)|)","i"),bool:new RegExp("^(?:"+O+")$","i"),needsContext:new RegExp("^"+k+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+k+"*((?:-\\d)?\\d*)"+k+"*\\)|)(?=[^-]|$)","i")},W=/^(?:input|select|textarea|button)$/i,U=/^h\d$/i,Y=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,X=/[+~]/,K=new RegExp("\\\\[\\da-fA-F]{1,6}"+k+"?|\\\\([^\\r\\n\\f])","g"),G=function(e,t){var n="0x"+e.slice(1)-65536;return t||(n<0?String.fromCharCode(n+65536):String.fromCharCode(n>>10|55296,1023&n|56320))},J=function(){le()},Z=de((function(e){return!0===e.disabled&&M(e,"fieldset")}),{dir:"parentNode",next:"legend"});try{g.apply(n=r.call(I.childNodes),I.childNodes),n[I.childNodes.length].nodeType}catch(e){g={apply:function(e,t){R.apply(e,r.call(t))},call:function(e){R.apply(e,r.call(arguments,1))}}}function Q(e,t,n,i){var r,o,s,a,l,u,h,m=t&&t.ownerDocument,v=t?t.nodeType:9;if(n=n||[],"string"!=typeof e||!e||1!==v&&9!==v&&11!==v)return n;if(!i&&(le(t),t=t||c,d)){if(11!==v&&(l=Y.exec(e)))if(r=l[1]){if(9===v){if(!(s=t.getElementById(r)))return n;if(s.id===r)return g.call(n,s),n}else if(m&&(s=m.getElementById(r))&&Q.contains(t,s)&&s.id===r)return g.call(n,s),n}else{if(l[2])return g.apply(n,t.getElementsByTagName(e)),n;if((r=l[3])&&t.getElementsByClassName)return g.apply(n,t.getElementsByClassName(r)),n}if(!(A[e+" "]||p&&p.test(e))){if(h=e,m=t,1===v&&(H.test(e)||j.test(e))){for((m=X.test(e)&&ae(t.parentNode)||t)==t&&f.scope||((a=t.getAttribute("id"))?a=q.escapeSelector(a):t.setAttribute("id",a=y)),o=(u=ue(e)).length;o--;)u[o]=(a?"#"+a:":scope")+" "+he(u[o]);h=u.join(",")}try{return g.apply(n,m.querySelectorAll(h)),n}catch(t){A(e,!0)}finally{a===y&&t.removeAttribute("id")}}}return ve(e.replace(E,"$1"),t,n,i)}function ee(){var e=[];return function t(n,r){return e.push(n+" ")>i.cacheLength&&delete t[e.shift()],t[n+" "]=r}}function te(e){return e[y]=!0,e}function ne(e){var t=c.createElement("fieldset");try{return!!e(t)}catch(e){return!1}finally{t.parentNode&&t.parentNode.removeChild(t),t=null}}function ie(e){return function(t){return M(t,"input")&&t.type===e}}function re(e){return function(t){return(M(t,"input")||M(t,"button"))&&t.type===e}}function oe(e){return function(t){return"form"in t?t.parentNode&&!1===t.disabled?"label"in t?"label"in t.parentNode?t.parentNode.disabled===e:t.disabled===e:t.isDisabled===e||t.isDisabled!==!e&&Z(t)===e:t.disabled===e:"label"in t&&t.disabled===e}}function se(e){return te((function(t){return t=+t,te((function(n,i){for(var r,o=e([],n.length,t),s=o.length;s--;)n[r=o[s]]&&(n[r]=!(i[r]=n[r]))}))}))}function ae(e){return e&&void 0!==e.getElementsByTagName&&e}function le(e){var t,n=e?e.ownerDocument||e:I;return n!=c&&9===n.nodeType&&n.documentElement?(h=(c=n).documentElement,d=!q.isXMLDoc(c),m=h.matches||h.webkitMatchesSelector||h.msMatchesSelector,I!=c&&(t=c.defaultView)&&t.top!==t&&t.addEventListener("unload",J),f.getById=ne((function(e){return h.appendChild(e).id=q.expando,!c.getElementsByName||!c.getElementsByName(q.expando).length})),f.disconnectedMatch=ne((function(e){return m.call(e,"*")})),f.scope=ne((function(){return c.querySelectorAll(":scope")})),f.cssHas=ne((function(){try{return c.querySelector(":has(*,:jqfake)"),!1}catch(e){return!0}})),f.getById?(i.filter.ID=function(e){var t=e.replace(K,G);return function(e){return e.getAttribute("id")===t}},i.find.ID=function(e,t){if(void 0!==t.getElementById&&d){var n=t.getElementById(e);return n?[n]:[]}}):(i.filter.ID=function(e){var t=e.replace(K,G);return function(e){var n=void 0!==e.getAttributeNode&&e.getAttributeNode("id");return n&&n.value===t}},i.find.ID=function(e,t){if(void 0!==t.getElementById&&d){var n,i,r,o=t.getElementById(e);if(o){if((n=o.getAttributeNode("id"))&&n.value===e)return[o];for(r=t.getElementsByName(e),i=0;o=r[i++];)if((n=o.getAttributeNode("id"))&&n.value===e)return[o]}return[]}}),i.find.TAG=function(e,t){return void 0!==t.getElementsByTagName?t.getElementsByTagName(e):t.querySelectorAll(e)},i.find.CLASS=function(e,t){if(void 0!==t.getElementsByClassName&&d)return t.getElementsByClassName(e)},p=[],ne((function(e){var t;h.appendChild(e).innerHTML="<a id='"+y+"' href='' disabled='disabled'></a><select id='"+y+"-\r\\' disabled='disabled'><option selected=''></option></select>",e.querySelectorAll("[selected]").length||p.push("\\["+k+"*(?:value|"+O+")"),e.querySelectorAll("[id~="+y+"-]").length||p.push("~="),e.querySelectorAll("a#"+y+"+*").length||p.push(".#.+[+~]"),e.querySelectorAll(":checked").length||p.push(":checked"),(t=c.createElement("input")).setAttribute("type","hidden"),e.appendChild(t).setAttribute("name","D"),h.appendChild(e).disabled=!0,2!==e.querySelectorAll(":disabled").length&&p.push(":enabled",":disabled"),(t=c.createElement("input")).setAttribute("name",""),e.appendChild(t),e.querySelectorAll("[name='']").length||p.push("\\["+k+"*name"+k+"*="+k+"*(?:''|\"\")")})),f.cssHas||p.push(":has"),p=p.length&&new RegExp(p.join("|")),T=function(e,t){if(e===t)return l=!0,0;var n=!e.compareDocumentPosition-!t.compareDocumentPosition;return n||(1&(n=(e.ownerDocument||e)==(t.ownerDocument||t)?e.compareDocumentPosition(t):1)||!f.sortDetached&&t.compareDocumentPosition(e)===n?e===c||e.ownerDocument==I&&Q.contains(I,e)?-1:t===c||t.ownerDocument==I&&Q.contains(I,t)?1:s?a.call(s,e)-a.call(s,t):0:4&n?-1:1)},c):c}for(t in Q.matches=function(e,t){return Q(e,null,null,t)},Q.matchesSelector=function(e,t){if(le(e),d&&!A[t+" "]&&(!p||!p.test(t)))try{var n=m.call(e,t);if(n||f.disconnectedMatch||e.document&&11!==e.document.nodeType)return n}catch(e){A(t,!0)}return Q(t,c,null,[e]).length>0},Q.contains=function(e,t){return(e.ownerDocument||e)!=c&&le(e),q.contains(e,t)},Q.attr=function(e,t){(e.ownerDocument||e)!=c&&le(e);var n=i.attrHandle[t.toLowerCase()],r=n&&u.call(i.attrHandle,t.toLowerCase())?n(e,t,!d):void 0;return void 0!==r?r:e.getAttribute(t)},Q.error=function(e){throw new Error("Syntax error, unrecognized expression: "+e)},q.uniqueSort=function(e){var t,n=[],i=0,o=0;if(l=!f.sortStable,s=!f.sortStable&&r.call(e,0),_.call(e,T),l){for(;t=e[o++];)t===e[o]&&(i=n.push(o));for(;i--;)C.call(e,n[i],1)}return s=null,e},q.fn.uniqueSort=function(){return this.pushStack(q.uniqueSort(r.apply(this)))},i=q.expr={cacheLength:50,createPseudo:te,match:$,attrHandle:{},find:{},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(e){return e[1]=e[1].replace(K,G),e[3]=(e[3]||e[4]||e[5]||"").replace(K,G),"~="===e[2]&&(e[3]=" "+e[3]+" "),e.slice(0,4)},CHILD:function(e){return e[1]=e[1].toLowerCase(),"nth"===e[1].slice(0,3)?(e[3]||Q.error(e[0]),e[4]=+(e[4]?e[5]+(e[6]||1):2*("even"===e[3]||"odd"===e[3])),e[5]=+(e[7]+e[8]||"odd"===e[3])):e[3]&&Q.error(e[0]),e},PSEUDO:function(e){var t,n=!e[6]&&e[2];return $.CHILD.test(e[0])?null:(e[3]?e[2]=e[4]||e[5]||"":n&&B.test(n)&&(t=ue(n,!0))&&(t=n.indexOf(")",n.length-t)-n.length)&&(e[0]=e[0].slice(0,t),e[2]=n.slice(0,t)),e.slice(0,3))}},filter:{TAG:function(e){var t=e.replace(K,G).toLowerCase();return"*"===e?function(){return!0}:function(e){return M(e,t)}},CLASS:function(e){var t=x[e+" "];return t||(t=new RegExp("(^|"+k+")"+e+"("+k+"|$)"))&&x(e,(function(e){return t.test("string"==typeof e.className&&e.className||void 0!==e.getAttribute&&e.getAttribute("class")||"")}))},ATTR:function(e,t,n){return function(i){var r=Q.attr(i,e);return null==r?"!="===t:!t||(r+="","="===t?r===n:"!="===t?r!==n:"^="===t?n&&0===r.indexOf(n):"*="===t?n&&r.indexOf(n)>-1:"$="===t?n&&r.slice(-n.length)===n:"~="===t?(" "+r.replace(F," ")+" ").indexOf(n)>-1:"|="===t&&(r===n||r.slice(0,n.length+1)===n+"-"))}},CHILD:function(e,t,n,i,r){var o="nth"!==e.slice(0,3),s="last"!==e.slice(-4),a="of-type"===t;return 1===i&&0===r?function(e){return!!e.parentNode}:function(t,n,l){var c,u,h,d,f,p=o!==s?"nextSibling":"previousSibling",m=t.parentNode,g=a&&t.nodeName.toLowerCase(),b=!l&&!a,x=!1;if(m){if(o){for(;p;){for(h=t;h=h[p];)if(a?M(h,g):1===h.nodeType)return!1;f=p="only"===e&&!f&&"nextSibling"}return!0}if(f=[s?m.firstChild:m.lastChild],s&&b){for(x=(d=(c=(u=m[y]||(m[y]={}))[e]||[])[0]===v&&c[1])&&c[2],h=d&&m.childNodes[d];h=++d&&h&&h[p]||(x=d=0)||f.pop();)if(1===h.nodeType&&++x&&h===t){u[e]=[v,d,x];break}}else if(b&&(x=d=(c=(u=t[y]||(t[y]={}))[e]||[])[0]===v&&c[1]),!1===x)for(;(h=++d&&h&&h[p]||(x=d=0)||f.pop())&&(!(a?M(h,g):1===h.nodeType)||!++x||(b&&((u=h[y]||(h[y]={}))[e]=[v,x]),h!==t)););return(x-=r)===i||x%i==0&&x/i>=0}}},PSEUDO:function(e,t){var n,r=i.pseudos[e]||i.setFilters[e.toLowerCase()]||Q.error("unsupported pseudo: "+e);return r[y]?r(t):r.length>1?(n=[e,e,"",t],i.setFilters.hasOwnProperty(e.toLowerCase())?te((function(e,n){for(var i,o=r(e,t),s=o.length;s--;)e[i=a.call(e,o[s])]=!(n[i]=o[s])})):function(e){return r(e,0,n)}):r}},pseudos:{not:te((function(e){var t=[],n=[],i=ye(e.replace(E,"$1"));return i[y]?te((function(e,t,n,r){for(var o,s=i(e,null,r,[]),a=e.length;a--;)(o=s[a])&&(e[a]=!(t[a]=o))})):function(e,r,o){return t[0]=e,i(t,null,o,n),t[0]=null,!n.pop()}})),has:te((function(e){return function(t){return Q(e,t).length>0}})),contains:te((function(e){return e=e.replace(K,G),function(t){return(t.textContent||q.text(t)).indexOf(e)>-1}})),lang:te((function(e){return V.test(e||"")||Q.error("unsupported lang: "+e),e=e.replace(K,G).toLowerCase(),function(t){var n;do{if(n=d?t.lang:t.getAttribute("xml:lang")||t.getAttribute("lang"))return(n=n.toLowerCase())===e||0===n.indexOf(e+"-")}while((t=t.parentNode)&&1===t.nodeType);return!1}})),target:function(t){var n=e.location&&e.location.hash;return n&&n.slice(1)===t.id},root:function(e){return e===h},focus:function(e){return e===function(){try{return c.activeElement}catch(e){}}()&&c.hasFocus()&&!!(e.type||e.href||~e.tabIndex)},enabled:oe(!1),disabled:oe(!0),checked:function(e){return M(e,"input")&&!!e.checked||M(e,"option")&&!!e.selected},selected:function(e){return e.parentNode&&e.parentNode.selectedIndex,!0===e.selected},empty:function(e){for(e=e.firstChild;e;e=e.nextSibling)if(e.nodeType<6)return!1;return!0},parent:function(e){return!i.pseudos.empty(e)},header:function(e){return U.test(e.nodeName)},input:function(e){return W.test(e.nodeName)},button:function(e){return M(e,"input")&&"button"===e.type||M(e,"button")},text:function(e){var t;return M(e,"input")&&"text"===e.type&&(null==(t=e.getAttribute("type"))||"text"===t.toLowerCase())},first:se((function(){return[0]})),last:se((function(e,t){return[t-1]})),eq:se((function(e,t,n){return[n<0?n+t:n]})),even:se((function(e,t){for(var n=0;n<t;n+=2)e.push(n);return e})),odd:se((function(e,t){for(var n=1;n<t;n+=2)e.push(n);return e})),lt:se((function(e,t,n){var i;for(i=n<0?n+t:n>t?t:n;--i>=0;)e.push(i);return e})),gt:se((function(e,t,n){for(var i=n<0?n+t:n;++i<t;)e.push(i);return e}))}},i.pseudos.nth=i.pseudos.eq,{radio:!0,checkbox:!0,file:!0,password:!0,image:!0})i.pseudos[t]=ie(t);for(t in{submit:!0,reset:!0})i.pseudos[t]=re(t);function ce(){}function ue(e,t){var n,r,o,s,a,l,c,u=w[e+" "];if(u)return t?0:u.slice(0);for(a=e,l=[],c=i.preFilter;a;){for(s in n&&!(r=z.exec(a))||(r&&(a=a.slice(r[0].length)||a),l.push(o=[])),n=!1,(r=j.exec(a))&&(n=r.shift(),o.push({value:n,type:r[0].replace(E," ")}),a=a.slice(n.length)),i.filter)!(r=$[s].exec(a))||c[s]&&!(r=c[s](r))||(n=r.shift(),o.push({value:n,type:s,matches:r}),a=a.slice(n.length));if(!n)break}return t?a.length:a?Q.error(e):w(e,l).slice(0)}function he(e){for(var t=0,n=e.length,i="";t<n;t++)i+=e[t].value;return i}function de(e,t,n){var i=t.dir,r=t.next,o=r||i,s=n&&"parentNode"===o,a=b++;return t.first?function(t,n,r){for(;t=t[i];)if(1===t.nodeType||s)return e(t,n,r);return!1}:function(t,n,l){var c,u,h=[v,a];if(l){for(;t=t[i];)if((1===t.nodeType||s)&&e(t,n,l))return!0}else for(;t=t[i];)if(1===t.nodeType||s)if(u=t[y]||(t[y]={}),r&&M(t,r))t=t[i]||t;else{if((c=u[o])&&c[0]===v&&c[1]===a)return h[2]=c[2];if(u[o]=h,h[2]=e(t,n,l))return!0}return!1}}function fe(e){return e.length>1?function(t,n,i){for(var r=e.length;r--;)if(!e[r](t,n,i))return!1;return!0}:e[0]}function pe(e,t,n,i,r){for(var o,s=[],a=0,l=e.length,c=null!=t;a<l;a++)(o=e[a])&&(n&&!n(o,i,r)||(s.push(o),c&&t.push(a)));return s}function me(e,t,n,i,r,o){return i&&!i[y]&&(i=me(i)),r&&!r[y]&&(r=me(r,o)),te((function(o,s,l,c){var u,h,d,f,p=[],m=[],y=s.length,v=o||function(e,t,n){for(var i=0,r=t.length;i<r;i++)Q(e,t[i],n);return n}(t||"*",l.nodeType?[l]:l,[]),b=!e||!o&&t?v:pe(v,p,e,l,c);if(n?n(b,f=r||(o?e:y||i)?[]:s,l,c):f=b,i)for(u=pe(f,m),i(u,[],l,c),h=u.length;h--;)(d=u[h])&&(f[m[h]]=!(b[m[h]]=d));if(o){if(r||e){if(r){for(u=[],h=f.length;h--;)(d=f[h])&&u.push(b[h]=d);r(null,f=[],u,c)}for(h=f.length;h--;)(d=f[h])&&(u=r?a.call(o,d):p[h])>-1&&(o[u]=!(s[u]=d))}}else f=pe(f===s?f.splice(y,f.length):f),r?r(null,s,f,c):g.apply(s,f)}))}function ge(e){for(var t,n,r,s=e.length,l=i.relative[e[0].type],c=l||i.relative[" "],u=l?1:0,h=de((function(e){return e===t}),c,!0),d=de((function(e){return a.call(t,e)>-1}),c,!0),f=[function(e,n,i){var r=!l&&(i||n!=o)||((t=n).nodeType?h(e,n,i):d(e,n,i));return t=null,r}];u<s;u++)if(n=i.relative[e[u].type])f=[de(fe(f),n)];else{if((n=i.filter[e[u].type].apply(null,e[u].matches))[y]){for(r=++u;r<s&&!i.relative[e[r].type];r++);return me(u>1&&fe(f),u>1&&he(e.slice(0,u-1).concat({value:" "===e[u-2].type?"*":""})).replace(E,"$1"),n,u<r&&ge(e.slice(u,r)),r<s&&ge(e=e.slice(r)),r<s&&he(e))}f.push(n)}return fe(f)}function ye(e,t){var n,r=[],s=[],a=S[e+" "];if(!a){for(t||(t=ue(e)),n=t.length;n--;)(a=ge(t[n]))[y]?r.push(a):s.push(a);a=S(e,function(e,t){var n=t.length>0,r=e.length>0,s=function(s,a,l,u,h){var f,p,m,y=0,b="0",x=s&&[],w=[],S=o,M=s||r&&i.find.TAG("*",h),_=v+=null==S?1:Math.random()||.1,C=M.length;for(h&&(o=a==c||a||h);b!==C&&null!=(f=M[b]);b++){if(r&&f){for(p=0,a||f.ownerDocument==c||(le(f),l=!d);m=e[p++];)if(m(f,a||c,l)){g.call(u,f);break}h&&(v=_)}n&&((f=!m&&f)&&y--,s&&x.push(f))}if(y+=b,n&&b!==y){for(p=0;m=t[p++];)m(x,w,a,l);if(s){if(y>0)for(;b--;)x[b]||w[b]||(w[b]=D.call(u));w=pe(w)}g.apply(u,w),h&&!s&&w.length>0&&y+t.length>1&&q.uniqueSort(u)}return h&&(v=_,o=S),x};return n?te(s):s}(s,r)),a.selector=e}return a}function ve(e,t,n,r){var o,s,a,l,c,u="function"==typeof e&&e,h=!r&&ue(e=u.selector||e);if(n=n||[],1===h.length){if((s=h[0]=h[0].slice(0)).length>2&&"ID"===(a=s[0]).type&&9===t.nodeType&&d&&i.relative[s[1].type]){if(!(t=(i.find.ID(a.matches[0].replace(K,G),t)||[])[0]))return n;u&&(t=t.parentNode),e=e.slice(s.shift().value.length)}for(o=$.needsContext.test(e)?0:s.length;o--&&(a=s[o],!i.relative[l=a.type]);)if((c=i.find[l])&&(r=c(a.matches[0].replace(K,G),X.test(s[0].type)&&ae(t.parentNode)||t))){if(s.splice(o,1),!(e=r.length&&he(s)))return g.apply(n,r),n;break}}return(u||ye(e,h))(r,t,!d,n,!t||X.test(e)&&ae(t.parentNode)||t),n}ce.prototype=i.filters=i.pseudos,i.setFilters=new ce,f.sortStable=y.split("").sort(T).join("")===y,le(),f.sortDetached=ne((function(e){return 1&e.compareDocumentPosition(c.createElement("fieldset"))})),q.find=Q,q.expr[":"]=q.expr.pseudos,q.unique=q.uniqueSort,Q.compile=ye,Q.select=ve,Q.setDocument=le,Q.escape=q.escapeSelector,Q.getText=q.text,Q.isXML=q.isXMLDoc,Q.selectors=q.expr,Q.support=q.support,Q.uniqueSort=q.uniqueSort}();var O=function(e,t,n){for(var i=[],r=void 0!==n;(e=e[t])&&9!==e.nodeType;)if(1===e.nodeType){if(r&&q(e).is(n))break;i.push(e)}return i},N=function(e,t){for(var n=[];e;e=e.nextSibling)1===e.nodeType&&e!==t&&n.push(e);return n},P=q.expr.match.needsContext,L=/^<([a-z][^\/\0>:\x20\t\r\n\f]*)[\x20\t\r\n\f]*\/?>(?:<\/\1>|)$/i;function F(e,t,n){return p(t)?q.grep(e,(function(e,i){return!!t.call(e,i,e)!==n})):t.nodeType?q.grep(e,(function(e){return e===t!==n})):"string"!=typeof t?q.grep(e,(function(e){return a.call(t,e)>-1!==n})):q.filter(t,e,n)}q.filter=function(e,t,n){var i=t[0];return n&&(e=":not("+e+")"),1===t.length&&1===i.nodeType?q.find.matchesSelector(i,e)?[i]:[]:q.find.matches(e,q.grep(t,(function(e){return 1===e.nodeType})))},q.fn.extend({find:function(e){var t,n,i=this.length,r=this;if("string"!=typeof e)return this.pushStack(q(e).filter((function(){for(t=0;t<i;t++)if(q.contains(r[t],this))return!0})));for(n=this.pushStack([]),t=0;t<i;t++)q.find(e,r[t],n);return i>1?q.uniqueSort(n):n},filter:function(e){return this.pushStack(F(this,e||[],!1))},not:function(e){return this.pushStack(F(this,e||[],!0))},is:function(e){return!!F(this,"string"==typeof e&&P.test(e)?q(e):e||[],!1).length}});var z,j=/^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]+))$/,H=q.fn.init=function(e,t,n){var i,r;if(!e)return this;if(n=n||z,"string"==typeof e){if(!(i="<"===e[0]&&">"===e[e.length-1]&&e.length>=3?[null,e,null]:j.exec(e))||!i[1]&&t)return!t||t.jquery?(t||n).find(e):this.constructor(t).find(e);if(i[1]){if(t=t instanceof q?t[0]:t,q.merge(this,q.parseHTML(i[1],t&&t.nodeType?t.ownerDocument||t:g,!0)),L.test(i[1])&&q.isPlainObject(t))for(i in t)p(this[i])?this[i](t[i]):this.attr(i,t[i]);return this}return(r=g.getElementById(i[2]))&&(this[0]=r,this.length=1),this}return e.nodeType?(this[0]=e,this.length=1,this):p(e)?void 0!==n.ready?n.ready(e):e(q):q.makeArray(e,this)};H.prototype=q.fn,z=q(g);var B=/^(?:parents|prev(?:Until|All))/,V={children:!0,contents:!0,next:!0,prev:!0};function $(e,t){for(;(e=e[t])&&1!==e.nodeType;);return e}q.fn.extend({has:function(e){var t=q(e,this),n=t.length;return this.filter((function(){for(var e=0;e<n;e++)if(q.contains(this,t[e]))return!0}))},closest:function(e,t){var n,i=0,r=this.length,o=[],s="string"!=typeof e&&q(e);if(!P.test(e))for(;i<r;i++)for(n=this[i];n&&n!==t;n=n.parentNode)if(n.nodeType<11&&(s?s.index(n)>-1:1===n.nodeType&&q.find.matchesSelector(n,e))){o.push(n);break}return this.pushStack(o.length>1?q.uniqueSort(o):o)},index:function(e){return e?"string"==typeof e?a.call(q(e),this[0]):a.call(this,e.jquery?e[0]:e):this[0]&&this[0].parentNode?this.first().prevAll().length:-1},add:function(e,t){return this.pushStack(q.uniqueSort(q.merge(this.get(),q(e,t))))},addBack:function(e){return this.add(null==e?this.prevObject:this.prevObject.filter(e))}}),q.each({parent:function(e){var t=e.parentNode;return t&&11!==t.nodeType?t:null},parents:function(e){return O(e,"parentNode")},parentsUntil:function(e,t,n){return O(e,"parentNode",n)},next:function(e){return $(e,"nextSibling")},prev:function(e){return $(e,"previousSibling")},nextAll:function(e){return O(e,"nextSibling")},prevAll:function(e){return O(e,"previousSibling")},nextUntil:function(e,t,n){return O(e,"nextSibling",n)},prevUntil:function(e,t,n){return O(e,"previousSibling",n)},siblings:function(e){return N((e.parentNode||{}).firstChild,e)},children:function(e){return N(e.firstChild)},contents:function(e){return null!=e.contentDocument&&i(e.contentDocument)?e.contentDocument:(M(e,"template")&&(e=e.content||e),q.merge([],e.childNodes))}},(function(e,t){q.fn[e]=function(n,i){var r=q.map(this,t,n);return"Until"!==e.slice(-5)&&(i=n),i&&"string"==typeof i&&(r=q.filter(i,r)),this.length>1&&(V[e]||q.uniqueSort(r),B.test(e)&&r.reverse()),this.pushStack(r)}}));var W=/[^\x20\t\r\n\f]+/g;function U(e){return e}function Y(e){throw e}function X(e,t,n,i){var r;try{e&&p(r=e.promise)?r.call(e).done(t).fail(n):e&&p(r=e.then)?r.call(e,t,n):t.apply(void 0,[e].slice(i))}catch(e){n.apply(void 0,[e])}}q.Callbacks=function(e){e="string"==typeof e?function(e){var t={};return q.each(e.match(W)||[],(function(e,n){t[n]=!0})),t}(e):q.extend({},e);var t,n,i,r,o=[],s=[],a=-1,l=function(){for(r=r||e.once,i=t=!0;s.length;a=-1)for(n=s.shift();++a<o.length;)!1===o[a].apply(n[0],n[1])&&e.stopOnFalse&&(a=o.length,n=!1);e.memory||(n=!1),t=!1,r&&(o=n?[]:"")},c={add:function(){return o&&(n&&!t&&(a=o.length-1,s.push(n)),function t(n){q.each(n,(function(n,i){p(i)?e.unique&&c.has(i)||o.push(i):i&&i.length&&"string"!==b(i)&&t(i)}))}(arguments),n&&!t&&l()),this},remove:function(){return q.each(arguments,(function(e,t){for(var n;(n=q.inArray(t,o,n))>-1;)o.splice(n,1),n<=a&&a--})),this},has:function(e){return e?q.inArray(e,o)>-1:o.length>0},empty:function(){return o&&(o=[]),this},disable:function(){return r=s=[],o=n="",this},disabled:function(){return!o},lock:function(){return r=s=[],n||t||(o=n=""),this},locked:function(){return!!r},fireWith:function(e,n){return r||(n=[e,(n=n||[]).slice?n.slice():n],s.push(n),t||l()),this},fire:function(){return c.fireWith(this,arguments),this},fired:function(){return!!i}};return c},q.extend({Deferred:function(t){var n=[["notify","progress",q.Callbacks("memory"),q.Callbacks("memory"),2],["resolve","done",q.Callbacks("once memory"),q.Callbacks("once memory"),0,"resolved"],["reject","fail",q.Callbacks("once memory"),q.Callbacks("once memory"),1,"rejected"]],i="pending",r={state:function(){return i},always:function(){return o.done(arguments).fail(arguments),this},catch:function(e){return r.then(null,e)},pipe:function(){var e=arguments;return q.Deferred((function(t){q.each(n,(function(n,i){var r=p(e[i[4]])&&e[i[4]];o[i[1]]((function(){var e=r&&r.apply(this,arguments);e&&p(e.promise)?e.promise().progress(t.notify).done(t.resolve).fail(t.reject):t[i[0]+"With"](this,r?[e]:arguments)}))})),e=null})).promise()},then:function(t,i,r){var o=0;function s(t,n,i,r){return function(){var a=this,l=arguments,c=function(){var e,c;if(!(t<o)){if((e=i.apply(a,l))===n.promise())throw new TypeError("Thenable self-resolution");c=e&&("object"==typeof e||"function"==typeof e)&&e.then,p(c)?r?c.call(e,s(o,n,U,r),s(o,n,Y,r)):(o++,c.call(e,s(o,n,U,r),s(o,n,Y,r),s(o,n,U,n.notifyWith))):(i!==U&&(a=void 0,l=[e]),(r||n.resolveWith)(a,l))}},u=r?c:function(){try{c()}catch(e){q.Deferred.exceptionHook&&q.Deferred.exceptionHook(e,u.error),t+1>=o&&(i!==Y&&(a=void 0,l=[e]),n.rejectWith(a,l))}};t?u():(q.Deferred.getErrorHook?u.error=q.Deferred.getErrorHook():q.Deferred.getStackHook&&(u.error=q.Deferred.getStackHook()),e.setTimeout(u))}}return q.Deferred((function(e){n[0][3].add(s(0,e,p(r)?r:U,e.notifyWith)),n[1][3].add(s(0,e,p(t)?t:U)),n[2][3].add(s(0,e,p(i)?i:Y))})).promise()},promise:function(e){return null!=e?q.extend(e,r):r}},o={};return q.each(n,(function(e,t){var s=t[2],a=t[5];r[t[1]]=s.add,a&&s.add((function(){i=a}),n[3-e][2].disable,n[3-e][3].disable,n[0][2].lock,n[0][3].lock),s.add(t[3].fire),o[t[0]]=function(){return o[t[0]+"With"](this===o?void 0:this,arguments),this},o[t[0]+"With"]=s.fireWith})),r.promise(o),t&&t.call(o,o),o},when:function(e){var t=arguments.length,n=t,i=Array(n),o=r.call(arguments),s=q.Deferred(),a=function(e){return function(n){i[e]=this,o[e]=arguments.length>1?r.call(arguments):n,--t||s.resolveWith(i,o)}};if(t<=1&&(X(e,s.done(a(n)).resolve,s.reject,!t),"pending"===s.state()||p(o[n]&&o[n].then)))return s.then();for(;n--;)X(o[n],a(n),s.reject);return s.promise()}});var K=/^(Eval|Internal|Range|Reference|Syntax|Type|URI)Error$/;q.Deferred.exceptionHook=function(t,n){e.console&&e.console.warn&&t&&K.test(t.name)&&e.console.warn("jQuery.Deferred exception: "+t.message,t.stack,n)},q.readyException=function(t){e.setTimeout((function(){throw t}))};var G=q.Deferred();function J(){g.removeEventListener("DOMContentLoaded",J),e.removeEventListener("load",J),q.ready()}q.fn.ready=function(e){return G.then(e).catch((function(e){q.readyException(e)})),this},q.extend({isReady:!1,readyWait:1,ready:function(e){(!0===e?--q.readyWait:q.isReady)||(q.isReady=!0,!0!==e&&--q.readyWait>0||G.resolveWith(g,[q]))}}),q.ready.then=G.then,"complete"===g.readyState||"loading"!==g.readyState&&!g.documentElement.doScroll?e.setTimeout(q.ready):(g.addEventListener("DOMContentLoaded",J),e.addEventListener("load",J));var Z=function(e,t,n,i,r,o,s){var a=0,l=e.length,c=null==n;if("object"===b(n))for(a in r=!0,n)Z(e,t,a,n[a],!0,o,s);else if(void 0!==i&&(r=!0,p(i)||(s=!0),c&&(s?(t.call(e,i),t=null):(c=t,t=function(e,t,n){return c.call(q(e),n)})),t))for(;a<l;a++)t(e[a],n,s?i:i.call(e[a],a,t(e[a],n)));return r?e:c?t.call(e):l?t(e[0],n):o},Q=/^-ms-/,ee=/-([a-z])/g;function te(e,t){return t.toUpperCase()}function ne(e){return e.replace(Q,"ms-").replace(ee,te)}var ie=function(e){return 1===e.nodeType||9===e.nodeType||!+e.nodeType};function re(){this.expando=q.expando+re.uid++}re.uid=1,re.prototype={cache:function(e){var t=e[this.expando];return t||(t={},ie(e)&&(e.nodeType?e[this.expando]=t:Object.defineProperty(e,this.expando,{value:t,configurable:!0}))),t},set:function(e,t,n){var i,r=this.cache(e);if("string"==typeof t)r[ne(t)]=n;else for(i in t)r[ne(i)]=t[i];return r},get:function(e,t){return void 0===t?this.cache(e):e[this.expando]&&e[this.expando][ne(t)]},access:function(e,t,n){return void 0===t||t&&"string"==typeof t&&void 0===n?this.get(e,t):(this.set(e,t,n),void 0!==n?n:t)},remove:function(e,t){var n,i=e[this.expando];if(void 0!==i){if(void 0!==t){n=(t=Array.isArray(t)?t.map(ne):(t=ne(t))in i?[t]:t.match(W)||[]).length;for(;n--;)delete i[t[n]]}(void 0===t||q.isEmptyObject(i))&&(e.nodeType?e[this.expando]=void 0:delete e[this.expando])}},hasData:function(e){var t=e[this.expando];return void 0!==t&&!q.isEmptyObject(t)}};var oe=new re,se=new re,ae=/^(?:\{[\w\W]*\}|\[[\w\W]*\])$/,le=/[A-Z]/g;function ce(e,t,n){var i;if(void 0===n&&1===e.nodeType)if(i="data-"+t.replace(le,"-$&").toLowerCase(),"string"==typeof(n=e.getAttribute(i))){try{n=function(e){return"true"===e||"false"!==e&&("null"===e?null:e===+e+""?+e:ae.test(e)?JSON.parse(e):e)}(n)}catch(e){}se.set(e,t,n)}else n=void 0;return n}q.extend({hasData:function(e){return se.hasData(e)||oe.hasData(e)},data:function(e,t,n){return se.access(e,t,n)},removeData:function(e,t){se.remove(e,t)},_data:function(e,t,n){return oe.access(e,t,n)},_removeData:function(e,t){oe.remove(e,t)}}),q.fn.extend({data:function(e,t){var n,i,r,o=this[0],s=o&&o.attributes;if(void 0===e){if(this.length&&(r=se.get(o),1===o.nodeType&&!oe.get(o,"hasDataAttrs"))){for(n=s.length;n--;)s[n]&&0===(i=s[n].name).indexOf("data-")&&(i=ne(i.slice(5)),ce(o,i,r[i]));oe.set(o,"hasDataAttrs",!0)}return r}return"object"==typeof e?this.each((function(){se.set(this,e)})):Z(this,(function(t){var n;if(o&&void 0===t)return void 0!==(n=se.get(o,e))||void 0!==(n=ce(o,e))?n:void 0;this.each((function(){se.set(this,e,t)}))}),null,t,arguments.length>1,null,!0)},removeData:function(e){return this.each((function(){se.remove(this,e)}))}}),q.extend({queue:function(e,t,n){var i;if(e)return t=(t||"fx")+"queue",i=oe.get(e,t),n&&(!i||Array.isArray(n)?i=oe.access(e,t,q.makeArray(n)):i.push(n)),i||[]},dequeue:function(e,t){t=t||"fx";var n=q.queue(e,t),i=n.length,r=n.shift(),o=q._queueHooks(e,t);"inprogress"===r&&(r=n.shift(),i--),r&&("fx"===t&&n.unshift("inprogress"),delete o.stop,r.call(e,(function(){q.dequeue(e,t)}),o)),!i&&o&&o.empty.fire()},_queueHooks:function(e,t){var n=t+"queueHooks";return oe.get(e,n)||oe.access(e,n,{empty:q.Callbacks("once memory").add((function(){oe.remove(e,[t+"queue",n])}))})}}),q.fn.extend({queue:function(e,t){var n=2;return"string"!=typeof e&&(t=e,e="fx",n--),arguments.length<n?q.queue(this[0],e):void 0===t?this:this.each((function(){var n=q.queue(this,e,t);q._queueHooks(this,e),"fx"===e&&"inprogress"!==n[0]&&q.dequeue(this,e)}))},dequeue:function(e){return this.each((function(){q.dequeue(this,e)}))},clearQueue:function(e){return this.queue(e||"fx",[])},promise:function(e,t){var n,i=1,r=q.Deferred(),o=this,s=this.length,a=function(){--i||r.resolveWith(o,[o])};for("string"!=typeof e&&(t=e,e=void 0),e=e||"fx";s--;)(n=oe.get(o[s],e+"queueHooks"))&&n.empty&&(i++,n.empty.add(a));return a(),r.promise(t)}});var ue=/[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/.source,he=new RegExp("^(?:([+-])=|)("+ue+")([a-z%]*)$","i"),de=["Top","Right","Bottom","Left"],fe=g.documentElement,pe=function(e){return q.contains(e.ownerDocument,e)},me={composed:!0};fe.getRootNode&&(pe=function(e){return q.contains(e.ownerDocument,e)||e.getRootNode(me)===e.ownerDocument});var ge=function(e,t){return"none"===(e=t||e).style.display||""===e.style.display&&pe(e)&&"none"===q.css(e,"display")};function ye(e,t,n,i){var r,o,s=20,a=i?function(){return i.cur()}:function(){return q.css(e,t,"")},l=a(),c=n&&n[3]||(q.cssNumber[t]?"":"px"),u=e.nodeType&&(q.cssNumber[t]||"px"!==c&&+l)&&he.exec(q.css(e,t));if(u&&u[3]!==c){for(l/=2,c=c||u[3],u=+l||1;s--;)q.style(e,t,u+c),(1-o)*(1-(o=a()/l||.5))<=0&&(s=0),u/=o;u*=2,q.style(e,t,u+c),n=n||[]}return n&&(u=+u||+l||0,r=n[1]?u+(n[1]+1)*n[2]:+n[2],i&&(i.unit=c,i.start=u,i.end=r)),r}var ve={};function be(e){var t,n=e.ownerDocument,i=e.nodeName,r=ve[i];return r||(t=n.body.appendChild(n.createElement(i)),r=q.css(t,"display"),t.parentNode.removeChild(t),"none"===r&&(r="block"),ve[i]=r,r)}function xe(e,t){for(var n,i,r=[],o=0,s=e.length;o<s;o++)(i=e[o]).style&&(n=i.style.display,t?("none"===n&&(r[o]=oe.get(i,"display")||null,r[o]||(i.style.display="")),""===i.style.display&&ge(i)&&(r[o]=be(i))):"none"!==n&&(r[o]="none",oe.set(i,"display",n)));for(o=0;o<s;o++)null!=r[o]&&(e[o].style.display=r[o]);return e}q.fn.extend({show:function(){return xe(this,!0)},hide:function(){return xe(this)},toggle:function(e){return"boolean"==typeof e?e?this.show():this.hide():this.each((function(){ge(this)?q(this).show():q(this).hide()}))}});var we,qe,Se=/^(?:checkbox|radio)$/i,Me=/<([a-z][^\/\0>\x20\t\r\n\f]*)/i,De=/^$|^module$|\/(?:java|ecma)script/i;we=g.createDocumentFragment().appendChild(g.createElement("div")),(qe=g.createElement("input")).setAttribute("type","radio"),qe.setAttribute("checked","checked"),qe.setAttribute("name","t"),we.appendChild(qe),f.checkClone=we.cloneNode(!0).cloneNode(!0).lastChild.checked,we.innerHTML="<textarea>x</textarea>",f.noCloneChecked=!!we.cloneNode(!0).lastChild.defaultValue,we.innerHTML="<option></option>",f.option=!!we.lastChild;var _e={thead:[1,"<table>","</table>"],col:[2,"<table><colgroup>","</colgroup></table>"],tr:[2,"<table><tbody>","</tbody></table>"],td:[3,"<table><tbody><tr>","</tr></tbody></table>"],_default:[0,"",""]};function Ce(e,t){var n;return n=void 0!==e.getElementsByTagName?e.getElementsByTagName(t||"*"):void 0!==e.querySelectorAll?e.querySelectorAll(t||"*"):[],void 0===t||t&&M(e,t)?q.merge([e],n):n}function ke(e,t){for(var n=0,i=e.length;n<i;n++)oe.set(e[n],"globalEval",!t||oe.get(t[n],"globalEval"))}_e.tbody=_e.tfoot=_e.colgroup=_e.caption=_e.thead,_e.th=_e.td,f.option||(_e.optgroup=_e.option=[1,"<select multiple='multiple'>","</select>"]);var Ee=/<|&#?\w+;/;function Ae(e,t,n,i,r){for(var o,s,a,l,c,u,h=t.createDocumentFragment(),d=[],f=0,p=e.length;f<p;f++)if((o=e[f])||0===o)if("object"===b(o))q.merge(d,o.nodeType?[o]:o);else if(Ee.test(o)){for(s=s||h.appendChild(t.createElement("div")),a=(Me.exec(o)||["",""])[1].toLowerCase(),l=_e[a]||_e._default,s.innerHTML=l[1]+q.htmlPrefilter(o)+l[2],u=l[0];u--;)s=s.lastChild;q.merge(d,s.childNodes),(s=h.firstChild).textContent=""}else d.push(t.createTextNode(o));for(h.textContent="",f=0;o=d[f++];)if(i&&q.inArray(o,i)>-1)r&&r.push(o);else if(c=pe(o),s=Ce(h.appendChild(o),"script"),c&&ke(s),n)for(u=0;o=s[u++];)De.test(o.type||"")&&n.push(o);return h}var Te=/^([^.]*)(?:\.(.+)|)/;function Ie(){return!0}function Re(){return!1}function Oe(e,t,n,i,r,o){var s,a;if("object"==typeof t){for(a in"string"!=typeof n&&(i=i||n,n=void 0),t)Oe(e,a,n,i,t[a],o);return e}if(null==i&&null==r?(r=n,i=n=void 0):null==r&&("string"==typeof n?(r=i,i=void 0):(r=i,i=n,n=void 0)),!1===r)r=Re;else if(!r)return e;return 1===o&&(s=r,r=function(e){return q().off(e),s.apply(this,arguments)},r.guid=s.guid||(s.guid=q.guid++)),e.each((function(){q.event.add(this,t,r,i,n)}))}function Ne(e,t,n){n?(oe.set(e,t,!1),q.event.add(e,t,{namespace:!1,handler:function(e){var n,i=oe.get(this,t);if(1&e.isTrigger&&this[t]){if(i)(q.event.special[t]||{}).delegateType&&e.stopPropagation();else if(i=r.call(arguments),oe.set(this,t,i),this[t](),n=oe.get(this,t),oe.set(this,t,!1),i!==n)return e.stopImmediatePropagation(),e.preventDefault(),n}else i&&(oe.set(this,t,q.event.trigger(i[0],i.slice(1),this)),e.stopPropagation(),e.isImmediatePropagationStopped=Ie)}})):void 0===oe.get(e,t)&&q.event.add(e,t,Ie)}q.event={global:{},add:function(e,t,n,i,r){var o,s,a,l,c,u,h,d,f,p,m,g=oe.get(e);if(ie(e))for(n.handler&&(n=(o=n).handler,r=o.selector),r&&q.find.matchesSelector(fe,r),n.guid||(n.guid=q.guid++),(l=g.events)||(l=g.events=Object.create(null)),(s=g.handle)||(s=g.handle=function(t){return void 0!==q&&q.event.triggered!==t.type?q.event.dispatch.apply(e,arguments):void 0}),c=(t=(t||"").match(W)||[""]).length;c--;)f=m=(a=Te.exec(t[c])||[])[1],p=(a[2]||"").split(".").sort(),f&&(h=q.event.special[f]||{},f=(r?h.delegateType:h.bindType)||f,h=q.event.special[f]||{},u=q.extend({type:f,origType:m,data:i,handler:n,guid:n.guid,selector:r,needsContext:r&&q.expr.match.needsContext.test(r),namespace:p.join(".")},o),(d=l[f])||((d=l[f]=[]).delegateCount=0,h.setup&&!1!==h.setup.call(e,i,p,s)||e.addEventListener&&e.addEventListener(f,s)),h.add&&(h.add.call(e,u),u.handler.guid||(u.handler.guid=n.guid)),r?d.splice(d.delegateCount++,0,u):d.push(u),q.event.global[f]=!0)},remove:function(e,t,n,i,r){var o,s,a,l,c,u,h,d,f,p,m,g=oe.hasData(e)&&oe.get(e);if(g&&(l=g.events)){for(c=(t=(t||"").match(W)||[""]).length;c--;)if(f=m=(a=Te.exec(t[c])||[])[1],p=(a[2]||"").split(".").sort(),f){for(h=q.event.special[f]||{},d=l[f=(i?h.delegateType:h.bindType)||f]||[],a=a[2]&&new RegExp("(^|\\.)"+p.join("\\.(?:.*\\.|)")+"(\\.|$)"),s=o=d.length;o--;)u=d[o],!r&&m!==u.origType||n&&n.guid!==u.guid||a&&!a.test(u.namespace)||i&&i!==u.selector&&("**"!==i||!u.selector)||(d.splice(o,1),u.selector&&d.delegateCount--,h.remove&&h.remove.call(e,u));s&&!d.length&&(h.teardown&&!1!==h.teardown.call(e,p,g.handle)||q.removeEvent(e,f,g.handle),delete l[f])}else for(f in l)q.event.remove(e,f+t[c],n,i,!0);q.isEmptyObject(l)&&oe.remove(e,"handle events")}},dispatch:function(e){var t,n,i,r,o,s,a=new Array(arguments.length),l=q.event.fix(e),c=(oe.get(this,"events")||Object.create(null))[l.type]||[],u=q.event.special[l.type]||{};for(a[0]=l,t=1;t<arguments.length;t++)a[t]=arguments[t];if(l.delegateTarget=this,!u.preDispatch||!1!==u.preDispatch.call(this,l)){for(s=q.event.handlers.call(this,l,c),t=0;(r=s[t++])&&!l.isPropagationStopped();)for(l.currentTarget=r.elem,n=0;(o=r.handlers[n++])&&!l.isImmediatePropagationStopped();)l.rnamespace&&!1!==o.namespace&&!l.rnamespace.test(o.namespace)||(l.handleObj=o,l.data=o.data,void 0!==(i=((q.event.special[o.origType]||{}).handle||o.handler).apply(r.elem,a))&&!1===(l.result=i)&&(l.preventDefault(),l.stopPropagation()));return u.postDispatch&&u.postDispatch.call(this,l),l.result}},handlers:function(e,t){var n,i,r,o,s,a=[],l=t.delegateCount,c=e.target;if(l&&c.nodeType&&!("click"===e.type&&e.button>=1))for(;c!==this;c=c.parentNode||this)if(1===c.nodeType&&("click"!==e.type||!0!==c.disabled)){for(o=[],s={},n=0;n<l;n++)void 0===s[r=(i=t[n]).selector+" "]&&(s[r]=i.needsContext?q(r,this).index(c)>-1:q.find(r,this,null,[c]).length),s[r]&&o.push(i);o.length&&a.push({elem:c,handlers:o})}return c=this,l<t.length&&a.push({elem:c,handlers:t.slice(l)}),a},addProp:function(e,t){Object.defineProperty(q.Event.prototype,e,{enumerable:!0,configurable:!0,get:p(t)?function(){if(this.originalEvent)return t(this.originalEvent)}:function(){if(this.originalEvent)return this.originalEvent[e]},set:function(t){Object.defineProperty(this,e,{enumerable:!0,configurable:!0,writable:!0,value:t})}})},fix:function(e){return e[q.expando]?e:new q.Event(e)},special:{load:{noBubble:!0},click:{setup:function(e){var t=this||e;return Se.test(t.type)&&t.click&&M(t,"input")&&Ne(t,"click",!0),!1},trigger:function(e){var t=this||e;return Se.test(t.type)&&t.click&&M(t,"input")&&Ne(t,"click"),!0},_default:function(e){var t=e.target;return Se.test(t.type)&&t.click&&M(t,"input")&&oe.get(t,"click")||M(t,"a")}},beforeunload:{postDispatch:function(e){void 0!==e.result&&e.originalEvent&&(e.originalEvent.returnValue=e.result)}}}},q.removeEvent=function(e,t,n){e.removeEventListener&&e.removeEventListener(t,n)},q.Event=function(e,t){if(!(this instanceof q.Event))return new q.Event(e,t);e&&e.type?(this.originalEvent=e,this.type=e.type,this.isDefaultPrevented=e.defaultPrevented||void 0===e.defaultPrevented&&!1===e.returnValue?Ie:Re,this.target=e.target&&3===e.target.nodeType?e.target.parentNode:e.target,this.currentTarget=e.currentTarget,this.relatedTarget=e.relatedTarget):this.type=e,t&&q.extend(this,t),this.timeStamp=e&&e.timeStamp||Date.now(),this[q.expando]=!0},q.Event.prototype={constructor:q.Event,isDefaultPrevented:Re,isPropagationStopped:Re,isImmediatePropagationStopped:Re,isSimulated:!1,preventDefault:function(){var e=this.originalEvent;this.isDefaultPrevented=Ie,e&&!this.isSimulated&&e.preventDefault()},stopPropagation:function(){var e=this.originalEvent;this.isPropagationStopped=Ie,e&&!this.isSimulated&&e.stopPropagation()},stopImmediatePropagation:function(){var e=this.originalEvent;this.isImmediatePropagationStopped=Ie,e&&!this.isSimulated&&e.stopImmediatePropagation(),this.stopPropagation()}},q.each({altKey:!0,bubbles:!0,cancelable:!0,changedTouches:!0,ctrlKey:!0,detail:!0,eventPhase:!0,metaKey:!0,pageX:!0,pageY:!0,shiftKey:!0,view:!0,char:!0,code:!0,charCode:!0,key:!0,keyCode:!0,button:!0,buttons:!0,clientX:!0,clientY:!0,offsetX:!0,offsetY:!0,pointerId:!0,pointerType:!0,screenX:!0,screenY:!0,targetTouches:!0,toElement:!0,touches:!0,which:!0},q.event.addProp),q.each({focus:"focusin",blur:"focusout"},(function(e,t){function n(e){if(g.documentMode){var n=oe.get(this,"handle"),i=q.event.fix(e);i.type="focusin"===e.type?"focus":"blur",i.isSimulated=!0,n(e),i.target===i.currentTarget&&n(i)}else q.event.simulate(t,e.target,q.event.fix(e))}q.event.special[e]={setup:function(){var i;if(Ne(this,e,!0),!g.documentMode)return!1;(i=oe.get(this,t))||this.addEventListener(t,n),oe.set(this,t,(i||0)+1)},trigger:function(){return Ne(this,e),!0},teardown:function(){var e;if(!g.documentMode)return!1;(e=oe.get(this,t)-1)?oe.set(this,t,e):(this.removeEventListener(t,n),oe.remove(this,t))},_default:function(t){return oe.get(t.target,e)},delegateType:t},q.event.special[t]={setup:function(){var i=this.ownerDocument||this.document||this,r=g.documentMode?this:i,o=oe.get(r,t);o||(g.documentMode?this.addEventListener(t,n):i.addEventListener(e,n,!0)),oe.set(r,t,(o||0)+1)},teardown:function(){var i=this.ownerDocument||this.document||this,r=g.documentMode?this:i,o=oe.get(r,t)-1;o?oe.set(r,t,o):(g.documentMode?this.removeEventListener(t,n):i.removeEventListener(e,n,!0),oe.remove(r,t))}}})),q.each({mouseenter:"mouseover",mouseleave:"mouseout",pointerenter:"pointerover",pointerleave:"pointerout"},(function(e,t){q.event.special[e]={delegateType:t,bindType:t,handle:function(e){var n,i=e.relatedTarget,r=e.handleObj;return i&&(i===this||q.contains(this,i))||(e.type=r.origType,n=r.handler.apply(this,arguments),e.type=t),n}}})),q.fn.extend({on:function(e,t,n,i){return Oe(this,e,t,n,i)},one:function(e,t,n,i){return Oe(this,e,t,n,i,1)},off:function(e,t,n){var i,r;if(e&&e.preventDefault&&e.handleObj)return i=e.handleObj,q(e.delegateTarget).off(i.namespace?i.origType+"."+i.namespace:i.origType,i.selector,i.handler),this;if("object"==typeof e){for(r in e)this.off(r,t,e[r]);return this}return!1!==t&&"function"!=typeof t||(n=t,t=void 0),!1===n&&(n=Re),this.each((function(){q.event.remove(this,e,n,t)}))}});var Pe=/<script|<style|<link/i,Le=/checked\s*(?:[^=]|=\s*.checked.)/i,Fe=/^\s*<!\[CDATA\[|\]\]>\s*$/g;function ze(e,t){return M(e,"table")&&M(11!==t.nodeType?t:t.firstChild,"tr")&&q(e).children("tbody")[0]||e}function je(e){return e.type=(null!==e.getAttribute("type"))+"/"+e.type,e}function He(e){return"true/"===(e.type||"").slice(0,5)?e.type=e.type.slice(5):e.removeAttribute("type"),e}function Be(e,t){var n,i,r,o,s,a;if(1===t.nodeType){if(oe.hasData(e)&&(a=oe.get(e).events))for(r in oe.remove(t,"handle events"),a)for(n=0,i=a[r].length;n<i;n++)q.event.add(t,r,a[r][n]);se.hasData(e)&&(o=se.access(e),s=q.extend({},o),se.set(t,s))}}function Ve(e,t){var n=t.nodeName.toLowerCase();"input"===n&&Se.test(e.type)?t.checked=e.checked:"input"!==n&&"textarea"!==n||(t.defaultValue=e.defaultValue)}function $e(e,t,n,i){t=o(t);var r,s,a,l,c,u,h=0,d=e.length,m=d-1,g=t[0],y=p(g);if(y||d>1&&"string"==typeof g&&!f.checkClone&&Le.test(g))return e.each((function(r){var o=e.eq(r);y&&(t[0]=g.call(this,r,o.html())),$e(o,t,n,i)}));if(d&&(s=(r=Ae(t,e[0].ownerDocument,!1,e,i)).firstChild,1===r.childNodes.length&&(r=s),s||i)){for(l=(a=q.map(Ce(r,"script"),je)).length;h<d;h++)c=r,h!==m&&(c=q.clone(c,!0,!0),l&&q.merge(a,Ce(c,"script"))),n.call(e[h],c,h);if(l)for(u=a[a.length-1].ownerDocument,q.map(a,He),h=0;h<l;h++)c=a[h],De.test(c.type||"")&&!oe.access(c,"globalEval")&&q.contains(u,c)&&(c.src&&"module"!==(c.type||"").toLowerCase()?q._evalUrl&&!c.noModule&&q._evalUrl(c.src,{nonce:c.nonce||c.getAttribute("nonce")},u):v(c.textContent.replace(Fe,""),c,u))}return e}function We(e,t,n){for(var i,r=t?q.filter(t,e):e,o=0;null!=(i=r[o]);o++)n||1!==i.nodeType||q.cleanData(Ce(i)),i.parentNode&&(n&&pe(i)&&ke(Ce(i,"script")),i.parentNode.removeChild(i));return e}q.extend({htmlPrefilter:function(e){return e},clone:function(e,t,n){var i,r,o,s,a=e.cloneNode(!0),l=pe(e);if(!(f.noCloneChecked||1!==e.nodeType&&11!==e.nodeType||q.isXMLDoc(e)))for(s=Ce(a),i=0,r=(o=Ce(e)).length;i<r;i++)Ve(o[i],s[i]);if(t)if(n)for(o=o||Ce(e),s=s||Ce(a),i=0,r=o.length;i<r;i++)Be(o[i],s[i]);else Be(e,a);return(s=Ce(a,"script")).length>0&&ke(s,!l&&Ce(e,"script")),a},cleanData:function(e){for(var t,n,i,r=q.event.special,o=0;void 0!==(n=e[o]);o++)if(ie(n)){if(t=n[oe.expando]){if(t.events)for(i in t.events)r[i]?q.event.remove(n,i):q.removeEvent(n,i,t.handle);n[oe.expando]=void 0}n[se.expando]&&(n[se.expando]=void 0)}}}),q.fn.extend({detach:function(e){return We(this,e,!0)},remove:function(e){return We(this,e)},text:function(e){return Z(this,(function(e){return void 0===e?q.text(this):this.empty().each((function(){1!==this.nodeType&&11!==this.nodeType&&9!==this.nodeType||(this.textContent=e)}))}),null,e,arguments.length)},append:function(){return $e(this,arguments,(function(e){1!==this.nodeType&&11!==this.nodeType&&9!==this.nodeType||ze(this,e).appendChild(e)}))},prepend:function(){return $e(this,arguments,(function(e){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var t=ze(this,e);t.insertBefore(e,t.firstChild)}}))},before:function(){return $e(this,arguments,(function(e){this.parentNode&&this.parentNode.insertBefore(e,this)}))},after:function(){return $e(this,arguments,(function(e){this.parentNode&&this.parentNode.insertBefore(e,this.nextSibling)}))},empty:function(){for(var e,t=0;null!=(e=this[t]);t++)1===e.nodeType&&(q.cleanData(Ce(e,!1)),e.textContent="");return this},clone:function(e,t){return e=null!=e&&e,t=null==t?e:t,this.map((function(){return q.clone(this,e,t)}))},html:function(e){return Z(this,(function(e){var t=this[0]||{},n=0,i=this.length;if(void 0===e&&1===t.nodeType)return t.innerHTML;if("string"==typeof e&&!Pe.test(e)&&!_e[(Me.exec(e)||["",""])[1].toLowerCase()]){e=q.htmlPrefilter(e);try{for(;n<i;n++)1===(t=this[n]||{}).nodeType&&(q.cleanData(Ce(t,!1)),t.innerHTML=e);t=0}catch(e){}}t&&this.empty().append(e)}),null,e,arguments.length)},replaceWith:function(){var e=[];return $e(this,arguments,(function(t){var n=this.parentNode;q.inArray(this,e)<0&&(q.cleanData(Ce(this)),n&&n.replaceChild(t,this))}),e)}}),q.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},(function(e,t){q.fn[e]=function(e){for(var n,i=[],r=q(e),o=r.length-1,a=0;a<=o;a++)n=a===o?this:this.clone(!0),q(r[a])[t](n),s.apply(i,n.get());return this.pushStack(i)}}));var Ue=new RegExp("^("+ue+")(?!px)[a-z%]+$","i"),Ye=/^--/,Xe=function(t){var n=t.ownerDocument.defaultView;return n&&n.opener||(n=e),n.getComputedStyle(t)},Ke=function(e,t,n){var i,r,o={};for(r in t)o[r]=e.style[r],e.style[r]=t[r];for(r in i=n.call(e),t)e.style[r]=o[r];return i},Ge=new RegExp(de.join("|"),"i");function Je(e,t,n){var i,r,o,s,a=Ye.test(t),l=e.style;return(n=n||Xe(e))&&(s=n.getPropertyValue(t)||n[t],a&&s&&(s=s.replace(E,"$1")||void 0),""!==s||pe(e)||(s=q.style(e,t)),!f.pixelBoxStyles()&&Ue.test(s)&&Ge.test(t)&&(i=l.width,r=l.minWidth,o=l.maxWidth,l.minWidth=l.maxWidth=l.width=s,s=n.width,l.width=i,l.minWidth=r,l.maxWidth=o)),void 0!==s?s+"":s}function Ze(e,t){return{get:function(){if(!e())return(this.get=t).apply(this,arguments);delete this.get}}}!function(){function t(){if(u){c.style.cssText="position:absolute;left:-11111px;width:60px;margin-top:1px;padding:0;border:0",u.style.cssText="position:relative;display:block;box-sizing:border-box;overflow:scroll;margin:auto;border:1px;padding:1px;width:60%;top:1%",fe.appendChild(c).appendChild(u);var t=e.getComputedStyle(u);i="1%"!==t.top,l=12===n(t.marginLeft),u.style.right="60%",s=36===n(t.right),r=36===n(t.width),u.style.position="absolute",o=12===n(u.offsetWidth/3),fe.removeChild(c),u=null}}function n(e){return Math.round(parseFloat(e))}var i,r,o,s,a,l,c=g.createElement("div"),u=g.createElement("div");u.style&&(u.style.backgroundClip="content-box",u.cloneNode(!0).style.backgroundClip="",f.clearCloneStyle="content-box"===u.style.backgroundClip,q.extend(f,{boxSizingReliable:function(){return t(),r},pixelBoxStyles:function(){return t(),s},pixelPosition:function(){return t(),i},reliableMarginLeft:function(){return t(),l},scrollboxSize:function(){return t(),o},reliableTrDimensions:function(){var t,n,i,r;return null==a&&(t=g.createElement("table"),n=g.createElement("tr"),i=g.createElement("div"),t.style.cssText="position:absolute;left:-11111px;border-collapse:separate",n.style.cssText="border:1px solid",n.style.height="1px",i.style.height="9px",i.style.display="block",fe.appendChild(t).appendChild(n).appendChild(i),r=e.getComputedStyle(n),a=parseInt(r.height,10)+parseInt(r.borderTopWidth,10)+parseInt(r.borderBottomWidth,10)===n.offsetHeight,fe.removeChild(t)),a}}))}();var Qe=["Webkit","Moz","ms"],et=g.createElement("div").style,tt={};function nt(e){var t=q.cssProps[e]||tt[e];return t||(e in et?e:tt[e]=function(e){for(var t=e[0].toUpperCase()+e.slice(1),n=Qe.length;n--;)if((e=Qe[n]+t)in et)return e}(e)||e)}var it=/^(none|table(?!-c[ea]).+)/,rt={position:"absolute",visibility:"hidden",display:"block"},ot={letterSpacing:"0",fontWeight:"400"};function st(e,t,n){var i=he.exec(t);return i?Math.max(0,i[2]-(n||0))+(i[3]||"px"):t}function at(e,t,n,i,r,o){var s="width"===t?1:0,a=0,l=0,c=0;if(n===(i?"border":"content"))return 0;for(;s<4;s+=2)"margin"===n&&(c+=q.css(e,n+de[s],!0,r)),i?("content"===n&&(l-=q.css(e,"padding"+de[s],!0,r)),"margin"!==n&&(l-=q.css(e,"border"+de[s]+"Width",!0,r))):(l+=q.css(e,"padding"+de[s],!0,r),"padding"!==n?l+=q.css(e,"border"+de[s]+"Width",!0,r):a+=q.css(e,"border"+de[s]+"Width",!0,r));return!i&&o>=0&&(l+=Math.max(0,Math.ceil(e["offset"+t[0].toUpperCase()+t.slice(1)]-o-l-a-.5))||0),l+c}function lt(e,t,n){var i=Xe(e),r=(!f.boxSizingReliable()||n)&&"border-box"===q.css(e,"boxSizing",!1,i),o=r,s=Je(e,t,i),a="offset"+t[0].toUpperCase()+t.slice(1);if(Ue.test(s)){if(!n)return s;s="auto"}return(!f.boxSizingReliable()&&r||!f.reliableTrDimensions()&&M(e,"tr")||"auto"===s||!parseFloat(s)&&"inline"===q.css(e,"display",!1,i))&&e.getClientRects().length&&(r="border-box"===q.css(e,"boxSizing",!1,i),(o=a in e)&&(s=e[a])),(s=parseFloat(s)||0)+at(e,t,n||(r?"border":"content"),o,i,s)+"px"}function ct(e,t,n,i,r){return new ct.prototype.init(e,t,n,i,r)}q.extend({cssHooks:{opacity:{get:function(e,t){if(t){var n=Je(e,"opacity");return""===n?"1":n}}}},cssNumber:{animationIterationCount:!0,aspectRatio:!0,borderImageSlice:!0,columnCount:!0,flexGrow:!0,flexShrink:!0,fontWeight:!0,gridArea:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnStart:!0,gridRow:!0,gridRowEnd:!0,gridRowStart:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,scale:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeMiterlimit:!0,strokeOpacity:!0},cssProps:{},style:function(e,t,n,i){if(e&&3!==e.nodeType&&8!==e.nodeType&&e.style){var r,o,s,a=ne(t),l=Ye.test(t),c=e.style;if(l||(t=nt(a)),s=q.cssHooks[t]||q.cssHooks[a],void 0===n)return s&&"get"in s&&void 0!==(r=s.get(e,!1,i))?r:c[t];"string"===(o=typeof n)&&(r=he.exec(n))&&r[1]&&(n=ye(e,t,r),o="number"),null!=n&&n==n&&("number"!==o||l||(n+=r&&r[3]||(q.cssNumber[a]?"":"px")),f.clearCloneStyle||""!==n||0!==t.indexOf("background")||(c[t]="inherit"),s&&"set"in s&&void 0===(n=s.set(e,n,i))||(l?c.setProperty(t,n):c[t]=n))}},css:function(e,t,n,i){var r,o,s,a=ne(t);return Ye.test(t)||(t=nt(a)),(s=q.cssHooks[t]||q.cssHooks[a])&&"get"in s&&(r=s.get(e,!0,n)),void 0===r&&(r=Je(e,t,i)),"normal"===r&&t in ot&&(r=ot[t]),""===n||n?(o=parseFloat(r),!0===n||isFinite(o)?o||0:r):r}}),q.each(["height","width"],(function(e,t){q.cssHooks[t]={get:function(e,n,i){if(n)return!it.test(q.css(e,"display"))||e.getClientRects().length&&e.getBoundingClientRect().width?lt(e,t,i):Ke(e,rt,(function(){return lt(e,t,i)}))},set:function(e,n,i){var r,o=Xe(e),s=!f.scrollboxSize()&&"absolute"===o.position,a=(s||i)&&"border-box"===q.css(e,"boxSizing",!1,o),l=i?at(e,t,i,a,o):0;return a&&s&&(l-=Math.ceil(e["offset"+t[0].toUpperCase()+t.slice(1)]-parseFloat(o[t])-at(e,t,"border",!1,o)-.5)),l&&(r=he.exec(n))&&"px"!==(r[3]||"px")&&(e.style[t]=n,n=q.css(e,t)),st(0,n,l)}}})),q.cssHooks.marginLeft=Ze(f.reliableMarginLeft,(function(e,t){if(t)return(parseFloat(Je(e,"marginLeft"))||e.getBoundingClientRect().left-Ke(e,{marginLeft:0},(function(){return e.getBoundingClientRect().left})))+"px"})),q.each({margin:"",padding:"",border:"Width"},(function(e,t){q.cssHooks[e+t]={expand:function(n){for(var i=0,r={},o="string"==typeof n?n.split(" "):[n];i<4;i++)r[e+de[i]+t]=o[i]||o[i-2]||o[0];return r}},"margin"!==e&&(q.cssHooks[e+t].set=st)})),q.fn.extend({css:function(e,t){return Z(this,(function(e,t,n){var i,r,o={},s=0;if(Array.isArray(t)){for(i=Xe(e),r=t.length;s<r;s++)o[t[s]]=q.css(e,t[s],!1,i);return o}return void 0!==n?q.style(e,t,n):q.css(e,t)}),e,t,arguments.length>1)}}),q.Tween=ct,ct.prototype={constructor:ct,init:function(e,t,n,i,r,o){this.elem=e,this.prop=n,this.easing=r||q.easing._default,this.options=t,this.start=this.now=this.cur(),this.end=i,this.unit=o||(q.cssNumber[n]?"":"px")},cur:function(){var e=ct.propHooks[this.prop];return e&&e.get?e.get(this):ct.propHooks._default.get(this)},run:function(e){var t,n=ct.propHooks[this.prop];return this.options.duration?this.pos=t=q.easing[this.easing](e,this.options.duration*e,0,1,this.options.duration):this.pos=t=e,this.now=(this.end-this.start)*t+this.start,this.options.step&&this.options.step.call(this.elem,this.now,this),n&&n.set?n.set(this):ct.propHooks._default.set(this),this}},ct.prototype.init.prototype=ct.prototype,ct.propHooks={_default:{get:function(e){var t;return 1!==e.elem.nodeType||null!=e.elem[e.prop]&&null==e.elem.style[e.prop]?e.elem[e.prop]:(t=q.css(e.elem,e.prop,""))&&"auto"!==t?t:0},set:function(e){q.fx.step[e.prop]?q.fx.step[e.prop](e):1!==e.elem.nodeType||!q.cssHooks[e.prop]&&null==e.elem.style[nt(e.prop)]?e.elem[e.prop]=e.now:q.style(e.elem,e.prop,e.now+e.unit)}}},ct.propHooks.scrollTop=ct.propHooks.scrollLeft={set:function(e){e.elem.nodeType&&e.elem.parentNode&&(e.elem[e.prop]=e.now)}},q.easing={linear:function(e){return e},swing:function(e){return.5-Math.cos(e*Math.PI)/2},_default:"swing"},q.fx=ct.prototype.init,q.fx.step={};var ut,ht,dt=/^(?:toggle|show|hide)$/,ft=/queueHooks$/;function pt(){ht&&(!1===g.hidden&&e.requestAnimationFrame?e.requestAnimationFrame(pt):e.setTimeout(pt,q.fx.interval),q.fx.tick())}function mt(){return e.setTimeout((function(){ut=void 0})),ut=Date.now()}function gt(e,t){var n,i=0,r={height:e};for(t=t?1:0;i<4;i+=2-t)r["margin"+(n=de[i])]=r["padding"+n]=e;return t&&(r.opacity=r.width=e),r}function yt(e,t,n){for(var i,r=(vt.tweeners[t]||[]).concat(vt.tweeners["*"]),o=0,s=r.length;o<s;o++)if(i=r[o].call(n,t,e))return i}function vt(e,t,n){var i,r,o=0,s=vt.prefilters.length,a=q.Deferred().always((function(){delete l.elem})),l=function(){if(r)return!1;for(var t=ut||mt(),n=Math.max(0,c.startTime+c.duration-t),i=1-(n/c.duration||0),o=0,s=c.tweens.length;o<s;o++)c.tweens[o].run(i);return a.notifyWith(e,[c,i,n]),i<1&&s?n:(s||a.notifyWith(e,[c,1,0]),a.resolveWith(e,[c]),!1)},c=a.promise({elem:e,props:q.extend({},t),opts:q.extend(!0,{specialEasing:{},easing:q.easing._default},n),originalProperties:t,originalOptions:n,startTime:ut||mt(),duration:n.duration,tweens:[],createTween:function(t,n){var i=q.Tween(e,c.opts,t,n,c.opts.specialEasing[t]||c.opts.easing);return c.tweens.push(i),i},stop:function(t){var n=0,i=t?c.tweens.length:0;if(r)return this;for(r=!0;n<i;n++)c.tweens[n].run(1);return t?(a.notifyWith(e,[c,1,0]),a.resolveWith(e,[c,t])):a.rejectWith(e,[c,t]),this}}),u=c.props;for(!function(e,t){var n,i,r,o,s;for(n in e)if(r=t[i=ne(n)],o=e[n],Array.isArray(o)&&(r=o[1],o=e[n]=o[0]),n!==i&&(e[i]=o,delete e[n]),(s=q.cssHooks[i])&&"expand"in s)for(n in o=s.expand(o),delete e[i],o)n in e||(e[n]=o[n],t[n]=r);else t[i]=r}(u,c.opts.specialEasing);o<s;o++)if(i=vt.prefilters[o].call(c,e,u,c.opts))return p(i.stop)&&(q._queueHooks(c.elem,c.opts.queue).stop=i.stop.bind(i)),i;return q.map(u,yt,c),p(c.opts.start)&&c.opts.start.call(e,c),c.progress(c.opts.progress).done(c.opts.done,c.opts.complete).fail(c.opts.fail).always(c.opts.always),q.fx.timer(q.extend(l,{elem:e,anim:c,queue:c.opts.queue})),c}q.Animation=q.extend(vt,{tweeners:{"*":[function(e,t){var n=this.createTween(e,t);return ye(n.elem,e,he.exec(t),n),n}]},tweener:function(e,t){p(e)?(t=e,e=["*"]):e=e.match(W);for(var n,i=0,r=e.length;i<r;i++)n=e[i],vt.tweeners[n]=vt.tweeners[n]||[],vt.tweeners[n].unshift(t)},prefilters:[function(e,t,n){var i,r,o,s,a,l,c,u,h="width"in t||"height"in t,d=this,f={},p=e.style,m=e.nodeType&&ge(e),g=oe.get(e,"fxshow");for(i in n.queue||(null==(s=q._queueHooks(e,"fx")).unqueued&&(s.unqueued=0,a=s.empty.fire,s.empty.fire=function(){s.unqueued||a()}),s.unqueued++,d.always((function(){d.always((function(){s.unqueued--,q.queue(e,"fx").length||s.empty.fire()}))}))),t)if(r=t[i],dt.test(r)){if(delete t[i],o=o||"toggle"===r,r===(m?"hide":"show")){if("show"!==r||!g||void 0===g[i])continue;m=!0}f[i]=g&&g[i]||q.style(e,i)}if((l=!q.isEmptyObject(t))||!q.isEmptyObject(f))for(i in h&&1===e.nodeType&&(n.overflow=[p.overflow,p.overflowX,p.overflowY],null==(c=g&&g.display)&&(c=oe.get(e,"display")),"none"===(u=q.css(e,"display"))&&(c?u=c:(xe([e],!0),c=e.style.display||c,u=q.css(e,"display"),xe([e]))),("inline"===u||"inline-block"===u&&null!=c)&&"none"===q.css(e,"float")&&(l||(d.done((function(){p.display=c})),null==c&&(u=p.display,c="none"===u?"":u)),p.display="inline-block")),n.overflow&&(p.overflow="hidden",d.always((function(){p.overflow=n.overflow[0],p.overflowX=n.overflow[1],p.overflowY=n.overflow[2]}))),l=!1,f)l||(g?"hidden"in g&&(m=g.hidden):g=oe.access(e,"fxshow",{display:c}),o&&(g.hidden=!m),m&&xe([e],!0),d.done((function(){for(i in m||xe([e]),oe.remove(e,"fxshow"),f)q.style(e,i,f[i])}))),l=yt(m?g[i]:0,i,d),i in g||(g[i]=l.start,m&&(l.end=l.start,l.start=0))}],prefilter:function(e,t){t?vt.prefilters.unshift(e):vt.prefilters.push(e)}}),q.speed=function(e,t,n){var i=e&&"object"==typeof e?q.extend({},e):{complete:n||!n&&t||p(e)&&e,duration:e,easing:n&&t||t&&!p(t)&&t};return q.fx.off?i.duration=0:"number"!=typeof i.duration&&(i.duration in q.fx.speeds?i.duration=q.fx.speeds[i.duration]:i.duration=q.fx.speeds._default),null!=i.queue&&!0!==i.queue||(i.queue="fx"),i.old=i.complete,i.complete=function(){p(i.old)&&i.old.call(this),i.queue&&q.dequeue(this,i.queue)},i},q.fn.extend({fadeTo:function(e,t,n,i){return this.filter(ge).css("opacity",0).show().end().animate({opacity:t},e,n,i)},animate:function(e,t,n,i){var r=q.isEmptyObject(e),o=q.speed(t,n,i),s=function(){var t=vt(this,q.extend({},e),o);(r||oe.get(this,"finish"))&&t.stop(!0)};return s.finish=s,r||!1===o.queue?this.each(s):this.queue(o.queue,s)},stop:function(e,t,n){var i=function(e){var t=e.stop;delete e.stop,t(n)};return"string"!=typeof e&&(n=t,t=e,e=void 0),t&&this.queue(e||"fx",[]),this.each((function(){var t=!0,r=null!=e&&e+"queueHooks",o=q.timers,s=oe.get(this);if(r)s[r]&&s[r].stop&&i(s[r]);else for(r in s)s[r]&&s[r].stop&&ft.test(r)&&i(s[r]);for(r=o.length;r--;)o[r].elem!==this||null!=e&&o[r].queue!==e||(o[r].anim.stop(n),t=!1,o.splice(r,1));!t&&n||q.dequeue(this,e)}))},finish:function(e){return!1!==e&&(e=e||"fx"),this.each((function(){var t,n=oe.get(this),i=n[e+"queue"],r=n[e+"queueHooks"],o=q.timers,s=i?i.length:0;for(n.finish=!0,q.queue(this,e,[]),r&&r.stop&&r.stop.call(this,!0),t=o.length;t--;)o[t].elem===this&&o[t].queue===e&&(o[t].anim.stop(!0),o.splice(t,1));for(t=0;t<s;t++)i[t]&&i[t].finish&&i[t].finish.call(this);delete n.finish}))}}),q.each(["toggle","show","hide"],(function(e,t){var n=q.fn[t];q.fn[t]=function(e,i,r){return null==e||"boolean"==typeof e?n.apply(this,arguments):this.animate(gt(t,!0),e,i,r)}})),q.each({slideDown:gt("show"),slideUp:gt("hide"),slideToggle:gt("toggle"),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"},fadeToggle:{opacity:"toggle"}},(function(e,t){q.fn[e]=function(e,n,i){return this.animate(t,e,n,i)}})),q.timers=[],q.fx.tick=function(){var e,t=0,n=q.timers;for(ut=Date.now();t<n.length;t++)(e=n[t])()||n[t]!==e||n.splice(t--,1);n.length||q.fx.stop(),ut=void 0},q.fx.timer=function(e){q.timers.push(e),q.fx.start()},q.fx.interval=13,q.fx.start=function(){ht||(ht=!0,pt())},q.fx.stop=function(){ht=null},q.fx.speeds={slow:600,fast:200,_default:400},q.fn.delay=function(t,n){return t=q.fx&&q.fx.speeds[t]||t,n=n||"fx",this.queue(n,(function(n,i){var r=e.setTimeout(n,t);i.stop=function(){e.clearTimeout(r)}}))},function(){var e=g.createElement("input"),t=g.createElement("select").appendChild(g.createElement("option"));e.type="checkbox",f.checkOn=""!==e.value,f.optSelected=t.selected,(e=g.createElement("input")).value="t",e.type="radio",f.radioValue="t"===e.value}();var bt,xt=q.expr.attrHandle;q.fn.extend({attr:function(e,t){return Z(this,q.attr,e,t,arguments.length>1)},removeAttr:function(e){return this.each((function(){q.removeAttr(this,e)}))}}),q.extend({attr:function(e,t,n){var i,r,o=e.nodeType;if(3!==o&&8!==o&&2!==o)return void 0===e.getAttribute?q.prop(e,t,n):(1===o&&q.isXMLDoc(e)||(r=q.attrHooks[t.toLowerCase()]||(q.expr.match.bool.test(t)?bt:void 0)),void 0!==n?null===n?void q.removeAttr(e,t):r&&"set"in r&&void 0!==(i=r.set(e,n,t))?i:(e.setAttribute(t,n+""),n):r&&"get"in r&&null!==(i=r.get(e,t))?i:null==(i=q.find.attr(e,t))?void 0:i)},attrHooks:{type:{set:function(e,t){if(!f.radioValue&&"radio"===t&&M(e,"input")){var n=e.value;return e.setAttribute("type",t),n&&(e.value=n),t}}}},removeAttr:function(e,t){var n,i=0,r=t&&t.match(W);if(r&&1===e.nodeType)for(;n=r[i++];)e.removeAttribute(n)}}),bt={set:function(e,t,n){return!1===t?q.removeAttr(e,n):e.setAttribute(n,n),n}},q.each(q.expr.match.bool.source.match(/\w+/g),(function(e,t){var n=xt[t]||q.find.attr;xt[t]=function(e,t,i){var r,o,s=t.toLowerCase();return i||(o=xt[s],xt[s]=r,r=null!=n(e,t,i)?s:null,xt[s]=o),r}}));var wt=/^(?:input|select|textarea|button)$/i,qt=/^(?:a|area)$/i;function St(e){return(e.match(W)||[]).join(" ")}function Mt(e){return e.getAttribute&&e.getAttribute("class")||""}function Dt(e){return Array.isArray(e)?e:"string"==typeof e&&e.match(W)||[]}q.fn.extend({prop:function(e,t){return Z(this,q.prop,e,t,arguments.length>1)},removeProp:function(e){return this.each((function(){delete this[q.propFix[e]||e]}))}}),q.extend({prop:function(e,t,n){var i,r,o=e.nodeType;if(3!==o&&8!==o&&2!==o)return 1===o&&q.isXMLDoc(e)||(t=q.propFix[t]||t,r=q.propHooks[t]),void 0!==n?r&&"set"in r&&void 0!==(i=r.set(e,n,t))?i:e[t]=n:r&&"get"in r&&null!==(i=r.get(e,t))?i:e[t]},propHooks:{tabIndex:{get:function(e){var t=q.find.attr(e,"tabindex");return t?parseInt(t,10):wt.test(e.nodeName)||qt.test(e.nodeName)&&e.href?0:-1}}},propFix:{for:"htmlFor",class:"className"}}),f.optSelected||(q.propHooks.selected={get:function(e){var t=e.parentNode;return t&&t.parentNode&&t.parentNode.selectedIndex,null},set:function(e){var t=e.parentNode;t&&(t.selectedIndex,t.parentNode&&t.parentNode.selectedIndex)}}),q.each(["tabIndex","readOnly","maxLength","cellSpacing","cellPadding","rowSpan","colSpan","useMap","frameBorder","contentEditable"],(function(){q.propFix[this.toLowerCase()]=this})),q.fn.extend({addClass:function(e){var t,n,i,r,o,s;return p(e)?this.each((function(t){q(this).addClass(e.call(this,t,Mt(this)))})):(t=Dt(e)).length?this.each((function(){if(i=Mt(this),n=1===this.nodeType&&" "+St(i)+" "){for(o=0;o<t.length;o++)r=t[o],n.indexOf(" "+r+" ")<0&&(n+=r+" ");s=St(n),i!==s&&this.setAttribute("class",s)}})):this},removeClass:function(e){var t,n,i,r,o,s;return p(e)?this.each((function(t){q(this).removeClass(e.call(this,t,Mt(this)))})):arguments.length?(t=Dt(e)).length?this.each((function(){if(i=Mt(this),n=1===this.nodeType&&" "+St(i)+" "){for(o=0;o<t.length;o++)for(r=t[o];n.indexOf(" "+r+" ")>-1;)n=n.replace(" "+r+" "," ");s=St(n),i!==s&&this.setAttribute("class",s)}})):this:this.attr("class","")},toggleClass:function(e,t){var n,i,r,o,s=typeof e,a="string"===s||Array.isArray(e);return p(e)?this.each((function(n){q(this).toggleClass(e.call(this,n,Mt(this),t),t)})):"boolean"==typeof t&&a?t?this.addClass(e):this.removeClass(e):(n=Dt(e),this.each((function(){if(a)for(o=q(this),r=0;r<n.length;r++)i=n[r],o.hasClass(i)?o.removeClass(i):o.addClass(i);else void 0!==e&&"boolean"!==s||((i=Mt(this))&&oe.set(this,"__className__",i),this.setAttribute&&this.setAttribute("class",i||!1===e?"":oe.get(this,"__className__")||""))})))},hasClass:function(e){var t,n,i=0;for(t=" "+e+" ";n=this[i++];)if(1===n.nodeType&&(" "+St(Mt(n))+" ").indexOf(t)>-1)return!0;return!1}});var _t=/\r/g;q.fn.extend({val:function(e){var t,n,i,r=this[0];return arguments.length?(i=p(e),this.each((function(n){var r;1===this.nodeType&&(null==(r=i?e.call(this,n,q(this).val()):e)?r="":"number"==typeof r?r+="":Array.isArray(r)&&(r=q.map(r,(function(e){return null==e?"":e+""}))),(t=q.valHooks[this.type]||q.valHooks[this.nodeName.toLowerCase()])&&"set"in t&&void 0!==t.set(this,r,"value")||(this.value=r))}))):r?(t=q.valHooks[r.type]||q.valHooks[r.nodeName.toLowerCase()])&&"get"in t&&void 0!==(n=t.get(r,"value"))?n:"string"==typeof(n=r.value)?n.replace(_t,""):null==n?"":n:void 0}}),q.extend({valHooks:{option:{get:function(e){var t=q.find.attr(e,"value");return null!=t?t:St(q.text(e))}},select:{get:function(e){var t,n,i,r=e.options,o=e.selectedIndex,s="select-one"===e.type,a=s?null:[],l=s?o+1:r.length;for(i=o<0?l:s?o:0;i<l;i++)if(((n=r[i]).selected||i===o)&&!n.disabled&&(!n.parentNode.disabled||!M(n.parentNode,"optgroup"))){if(t=q(n).val(),s)return t;a.push(t)}return a},set:function(e,t){for(var n,i,r=e.options,o=q.makeArray(t),s=r.length;s--;)((i=r[s]).selected=q.inArray(q.valHooks.option.get(i),o)>-1)&&(n=!0);return n||(e.selectedIndex=-1),o}}}}),q.each(["radio","checkbox"],(function(){q.valHooks[this]={set:function(e,t){if(Array.isArray(t))return e.checked=q.inArray(q(e).val(),t)>-1}},f.checkOn||(q.valHooks[this].get=function(e){return null===e.getAttribute("value")?"on":e.value})}));var Ct=e.location,kt={guid:Date.now()},Et=/\?/;q.parseXML=function(t){var n,i;if(!t||"string"!=typeof t)return null;try{n=(new e.DOMParser).parseFromString(t,"text/xml")}catch(e){}return i=n&&n.getElementsByTagName("parsererror")[0],n&&!i||q.error("Invalid XML: "+(i?q.map(i.childNodes,(function(e){return e.textContent})).join("\n"):t)),n};var At=/^(?:focusinfocus|focusoutblur)$/,Tt=function(e){e.stopPropagation()};q.extend(q.event,{trigger:function(t,n,i,r){var o,s,a,l,c,h,d,f,y=[i||g],v=u.call(t,"type")?t.type:t,b=u.call(t,"namespace")?t.namespace.split("."):[];if(s=f=a=i=i||g,3!==i.nodeType&&8!==i.nodeType&&!At.test(v+q.event.triggered)&&(v.indexOf(".")>-1&&(b=v.split("."),v=b.shift(),b.sort()),c=v.indexOf(":")<0&&"on"+v,(t=t[q.expando]?t:new q.Event(v,"object"==typeof t&&t)).isTrigger=r?2:3,t.namespace=b.join("."),t.rnamespace=t.namespace?new RegExp("(^|\\.)"+b.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,t.result=void 0,t.target||(t.target=i),n=null==n?[t]:q.makeArray(n,[t]),d=q.event.special[v]||{},r||!d.trigger||!1!==d.trigger.apply(i,n))){if(!r&&!d.noBubble&&!m(i)){for(l=d.delegateType||v,At.test(l+v)||(s=s.parentNode);s;s=s.parentNode)y.push(s),a=s;a===(i.ownerDocument||g)&&y.push(a.defaultView||a.parentWindow||e)}for(o=0;(s=y[o++])&&!t.isPropagationStopped();)f=s,t.type=o>1?l:d.bindType||v,(h=(oe.get(s,"events")||Object.create(null))[t.type]&&oe.get(s,"handle"))&&h.apply(s,n),(h=c&&s[c])&&h.apply&&ie(s)&&(t.result=h.apply(s,n),!1===t.result&&t.preventDefault());return t.type=v,r||t.isDefaultPrevented()||d._default&&!1!==d._default.apply(y.pop(),n)||!ie(i)||c&&p(i[v])&&!m(i)&&((a=i[c])&&(i[c]=null),q.event.triggered=v,t.isPropagationStopped()&&f.addEventListener(v,Tt),i[v](),t.isPropagationStopped()&&f.removeEventListener(v,Tt),q.event.triggered=void 0,a&&(i[c]=a)),t.result}},simulate:function(e,t,n){var i=q.extend(new q.Event,n,{type:e,isSimulated:!0});q.event.trigger(i,null,t)}}),q.fn.extend({trigger:function(e,t){return this.each((function(){q.event.trigger(e,t,this)}))},triggerHandler:function(e,t){var n=this[0];if(n)return q.event.trigger(e,t,n,!0)}});var It=/\[\]$/,Rt=/\r?\n/g,Ot=/^(?:submit|button|image|reset|file)$/i,Nt=/^(?:input|select|textarea|keygen)/i;function Pt(e,t,n,i){var r;if(Array.isArray(t))q.each(t,(function(t,r){n||It.test(e)?i(e,r):Pt(e+"["+("object"==typeof r&&null!=r?t:"")+"]",r,n,i)}));else if(n||"object"!==b(t))i(e,t);else for(r in t)Pt(e+"["+r+"]",t[r],n,i)}q.param=function(e,t){var n,i=[],r=function(e,t){var n=p(t)?t():t;i[i.length]=encodeURIComponent(e)+"="+encodeURIComponent(null==n?"":n)};if(null==e)return"";if(Array.isArray(e)||e.jquery&&!q.isPlainObject(e))q.each(e,(function(){r(this.name,this.value)}));else for(n in e)Pt(n,e[n],t,r);return i.join("&")},q.fn.extend({serialize:function(){return q.param(this.serializeArray())},serializeArray:function(){return this.map((function(){var e=q.prop(this,"elements");return e?q.makeArray(e):this})).filter((function(){var e=this.type;return this.name&&!q(this).is(":disabled")&&Nt.test(this.nodeName)&&!Ot.test(e)&&(this.checked||!Se.test(e))})).map((function(e,t){var n=q(this).val();return null==n?null:Array.isArray(n)?q.map(n,(function(e){return{name:t.name,value:e.replace(Rt,"\r\n")}})):{name:t.name,value:n.replace(Rt,"\r\n")}})).get()}});var Lt=/%20/g,Ft=/#.*$/,zt=/([?&])_=[^&]*/,jt=/^(.*?):[ \t]*([^\r\n]*)$/gm,Ht=/^(?:GET|HEAD)$/,Bt=/^\/\//,Vt={},$t={},Wt="*/".concat("*"),Ut=g.createElement("a");function Yt(e){return function(t,n){"string"!=typeof t&&(n=t,t="*");var i,r=0,o=t.toLowerCase().match(W)||[];if(p(n))for(;i=o[r++];)"+"===i[0]?(i=i.slice(1)||"*",(e[i]=e[i]||[]).unshift(n)):(e[i]=e[i]||[]).push(n)}}function Xt(e,t,n,i){var r={},o=e===$t;function s(a){var l;return r[a]=!0,q.each(e[a]||[],(function(e,a){var c=a(t,n,i);return"string"!=typeof c||o||r[c]?o?!(l=c):void 0:(t.dataTypes.unshift(c),s(c),!1)})),l}return s(t.dataTypes[0])||!r["*"]&&s("*")}function Kt(e,t){var n,i,r=q.ajaxSettings.flatOptions||{};for(n in t)void 0!==t[n]&&((r[n]?e:i||(i={}))[n]=t[n]);return i&&q.extend(!0,e,i),e}Ut.href=Ct.href,q.extend({active:0,lastModified:{},etag:{},ajaxSettings:{url:Ct.href,type:"GET",isLocal:/^(?:about|app|app-storage|.+-extension|file|res|widget):$/.test(Ct.protocol),global:!0,processData:!0,async:!0,contentType:"application/x-www-form-urlencoded; charset=UTF-8",accepts:{"*":Wt,text:"text/plain",html:"text/html",xml:"application/xml, text/xml",json:"application/json, text/javascript"},contents:{xml:/\bxml\b/,html:/\bhtml/,json:/\bjson\b/},responseFields:{xml:"responseXML",text:"responseText",json:"responseJSON"},converters:{"* text":String,"text html":!0,"text json":JSON.parse,"text xml":q.parseXML},flatOptions:{url:!0,context:!0}},ajaxSetup:function(e,t){return t?Kt(Kt(e,q.ajaxSettings),t):Kt(q.ajaxSettings,e)},ajaxPrefilter:Yt(Vt),ajaxTransport:Yt($t),ajax:function(t,n){"object"==typeof t&&(n=t,t=void 0),n=n||{};var i,r,o,s,a,l,c,u,h,d,f=q.ajaxSetup({},n),p=f.context||f,m=f.context&&(p.nodeType||p.jquery)?q(p):q.event,y=q.Deferred(),v=q.Callbacks("once memory"),b=f.statusCode||{},x={},w={},S="canceled",M={readyState:0,getResponseHeader:function(e){var t;if(c){if(!s)for(s={};t=jt.exec(o);)s[t[1].toLowerCase()+" "]=(s[t[1].toLowerCase()+" "]||[]).concat(t[2]);t=s[e.toLowerCase()+" "]}return null==t?null:t.join(", ")},getAllResponseHeaders:function(){return c?o:null},setRequestHeader:function(e,t){return null==c&&(e=w[e.toLowerCase()]=w[e.toLowerCase()]||e,x[e]=t),this},overrideMimeType:function(e){return null==c&&(f.mimeType=e),this},statusCode:function(e){var t;if(e)if(c)M.always(e[M.status]);else for(t in e)b[t]=[b[t],e[t]];return this},abort:function(e){var t=e||S;return i&&i.abort(t),D(0,t),this}};if(y.promise(M),f.url=((t||f.url||Ct.href)+"").replace(Bt,Ct.protocol+"//"),f.type=n.method||n.type||f.method||f.type,f.dataTypes=(f.dataType||"*").toLowerCase().match(W)||[""],null==f.crossDomain){l=g.createElement("a");try{l.href=f.url,l.href=l.href,f.crossDomain=Ut.protocol+"//"+Ut.host!=l.protocol+"//"+l.host}catch(e){f.crossDomain=!0}}if(f.data&&f.processData&&"string"!=typeof f.data&&(f.data=q.param(f.data,f.traditional)),Xt(Vt,f,n,M),c)return M;for(h in(u=q.event&&f.global)&&0==q.active++&&q.event.trigger("ajaxStart"),f.type=f.type.toUpperCase(),f.hasContent=!Ht.test(f.type),r=f.url.replace(Ft,""),f.hasContent?f.data&&f.processData&&0===(f.contentType||"").indexOf("application/x-www-form-urlencoded")&&(f.data=f.data.replace(Lt,"+")):(d=f.url.slice(r.length),f.data&&(f.processData||"string"==typeof f.data)&&(r+=(Et.test(r)?"&":"?")+f.data,delete f.data),!1===f.cache&&(r=r.replace(zt,"$1"),d=(Et.test(r)?"&":"?")+"_="+kt.guid+++d),f.url=r+d),f.ifModified&&(q.lastModified[r]&&M.setRequestHeader("If-Modified-Since",q.lastModified[r]),q.etag[r]&&M.setRequestHeader("If-None-Match",q.etag[r])),(f.data&&f.hasContent&&!1!==f.contentType||n.contentType)&&M.setRequestHeader("Content-Type",f.contentType),M.setRequestHeader("Accept",f.dataTypes[0]&&f.accepts[f.dataTypes[0]]?f.accepts[f.dataTypes[0]]+("*"!==f.dataTypes[0]?", "+Wt+"; q=0.01":""):f.accepts["*"]),f.headers)M.setRequestHeader(h,f.headers[h]);if(f.beforeSend&&(!1===f.beforeSend.call(p,M,f)||c))return M.abort();if(S="abort",v.add(f.complete),M.done(f.success),M.fail(f.error),i=Xt($t,f,n,M)){if(M.readyState=1,u&&m.trigger("ajaxSend",[M,f]),c)return M;f.async&&f.timeout>0&&(a=e.setTimeout((function(){M.abort("timeout")}),f.timeout));try{c=!1,i.send(x,D)}catch(e){if(c)throw e;D(-1,e)}}else D(-1,"No Transport");function D(t,n,s,l){var h,d,g,x,w,S=n;c||(c=!0,a&&e.clearTimeout(a),i=void 0,o=l||"",M.readyState=t>0?4:0,h=t>=200&&t<300||304===t,s&&(x=function(e,t,n){for(var i,r,o,s,a=e.contents,l=e.dataTypes;"*"===l[0];)l.shift(),void 0===i&&(i=e.mimeType||t.getResponseHeader("Content-Type"));if(i)for(r in a)if(a[r]&&a[r].test(i)){l.unshift(r);break}if(l[0]in n)o=l[0];else{for(r in n){if(!l[0]||e.converters[r+" "+l[0]]){o=r;break}s||(s=r)}o=o||s}if(o)return o!==l[0]&&l.unshift(o),n[o]}(f,M,s)),!h&&q.inArray("script",f.dataTypes)>-1&&q.inArray("json",f.dataTypes)<0&&(f.converters["text script"]=function(){}),x=function(e,t,n,i){var r,o,s,a,l,c={},u=e.dataTypes.slice();if(u[1])for(s in e.converters)c[s.toLowerCase()]=e.converters[s];for(o=u.shift();o;)if(e.responseFields[o]&&(n[e.responseFields[o]]=t),!l&&i&&e.dataFilter&&(t=e.dataFilter(t,e.dataType)),l=o,o=u.shift())if("*"===o)o=l;else if("*"!==l&&l!==o){if(!(s=c[l+" "+o]||c["* "+o]))for(r in c)if((a=r.split(" "))[1]===o&&(s=c[l+" "+a[0]]||c["* "+a[0]])){!0===s?s=c[r]:!0!==c[r]&&(o=a[0],u.unshift(a[1]));break}if(!0!==s)if(s&&e.throws)t=s(t);else try{t=s(t)}catch(e){return{state:"parsererror",error:s?e:"No conversion from "+l+" to "+o}}}return{state:"success",data:t}}(f,x,M,h),h?(f.ifModified&&((w=M.getResponseHeader("Last-Modified"))&&(q.lastModified[r]=w),(w=M.getResponseHeader("etag"))&&(q.etag[r]=w)),204===t||"HEAD"===f.type?S="nocontent":304===t?S="notmodified":(S=x.state,d=x.data,h=!(g=x.error))):(g=S,!t&&S||(S="error",t<0&&(t=0))),M.status=t,M.statusText=(n||S)+"",h?y.resolveWith(p,[d,S,M]):y.rejectWith(p,[M,S,g]),M.statusCode(b),b=void 0,u&&m.trigger(h?"ajaxSuccess":"ajaxError",[M,f,h?d:g]),v.fireWith(p,[M,S]),u&&(m.trigger("ajaxComplete",[M,f]),--q.active||q.event.trigger("ajaxStop")))}return M},getJSON:function(e,t,n){return q.get(e,t,n,"json")},getScript:function(e,t){return q.get(e,void 0,t,"script")}}),q.each(["get","post"],(function(e,t){q[t]=function(e,n,i,r){return p(n)&&(r=r||i,i=n,n=void 0),q.ajax(q.extend({url:e,type:t,dataType:r,data:n,success:i},q.isPlainObject(e)&&e))}})),q.ajaxPrefilter((function(e){var t;for(t in e.headers)"content-type"===t.toLowerCase()&&(e.contentType=e.headers[t]||"")})),q._evalUrl=function(e,t,n){return q.ajax({url:e,type:"GET",dataType:"script",cache:!0,async:!1,global:!1,converters:{"text script":function(){}},dataFilter:function(e){q.globalEval(e,t,n)}})},q.fn.extend({wrapAll:function(e){var t;return this[0]&&(p(e)&&(e=e.call(this[0])),t=q(e,this[0].ownerDocument).eq(0).clone(!0),this[0].parentNode&&t.insertBefore(this[0]),t.map((function(){for(var e=this;e.firstElementChild;)e=e.firstElementChild;return e})).append(this)),this},wrapInner:function(e){return p(e)?this.each((function(t){q(this).wrapInner(e.call(this,t))})):this.each((function(){var t=q(this),n=t.contents();n.length?n.wrapAll(e):t.append(e)}))},wrap:function(e){var t=p(e);return this.each((function(n){q(this).wrapAll(t?e.call(this,n):e)}))},unwrap:function(e){return this.parent(e).not("body").each((function(){q(this).replaceWith(this.childNodes)})),this}}),q.expr.pseudos.hidden=function(e){return!q.expr.pseudos.visible(e)},q.expr.pseudos.visible=function(e){return!!(e.offsetWidth||e.offsetHeight||e.getClientRects().length)},q.ajaxSettings.xhr=function(){try{return new e.XMLHttpRequest}catch(e){}};var Gt={0:200,1223:204},Jt=q.ajaxSettings.xhr();f.cors=!!Jt&&"withCredentials"in Jt,f.ajax=Jt=!!Jt,q.ajaxTransport((function(t){var n,i;if(f.cors||Jt&&!t.crossDomain)return{send:function(r,o){var s,a=t.xhr();if(a.open(t.type,t.url,t.async,t.username,t.password),t.xhrFields)for(s in t.xhrFields)a[s]=t.xhrFields[s];for(s in t.mimeType&&a.overrideMimeType&&a.overrideMimeType(t.mimeType),t.crossDomain||r["X-Requested-With"]||(r["X-Requested-With"]="XMLHttpRequest"),r)a.setRequestHeader(s,r[s]);n=function(e){return function(){n&&(n=i=a.onload=a.onerror=a.onabort=a.ontimeout=a.onreadystatechange=null,"abort"===e?a.abort():"error"===e?"number"!=typeof a.status?o(0,"error"):o(a.status,a.statusText):o(Gt[a.status]||a.status,a.statusText,"text"!==(a.responseType||"text")||"string"!=typeof a.responseText?{binary:a.response}:{text:a.responseText},a.getAllResponseHeaders()))}},a.onload=n(),i=a.onerror=a.ontimeout=n("error"),void 0!==a.onabort?a.onabort=i:a.onreadystatechange=function(){4===a.readyState&&e.setTimeout((function(){n&&i()}))},n=n("abort");try{a.send(t.hasContent&&t.data||null)}catch(e){if(n)throw e}},abort:function(){n&&n()}}})),q.ajaxPrefilter((function(e){e.crossDomain&&(e.contents.script=!1)})),q.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/\b(?:java|ecma)script\b/},converters:{"text script":function(e){return q.globalEval(e),e}}}),q.ajaxPrefilter("script",(function(e){void 0===e.cache&&(e.cache=!1),e.crossDomain&&(e.type="GET")})),q.ajaxTransport("script",(function(e){var t,n;if(e.crossDomain||e.scriptAttrs)return{send:function(i,r){t=q("<script>").attr(e.scriptAttrs||{}).prop({charset:e.scriptCharset,src:e.url}).on("load error",n=function(e){t.remove(),n=null,e&&r("error"===e.type?404:200,e.type)}),g.head.appendChild(t[0])},abort:function(){n&&n()}}}));var Zt,Qt=[],en=/(=)\?(?=&|$)|\?\?/;q.ajaxSetup({jsonp:"callback",jsonpCallback:function(){var e=Qt.pop()||q.expando+"_"+kt.guid++;return this[e]=!0,e}}),q.ajaxPrefilter("json jsonp",(function(t,n,i){var r,o,s,a=!1!==t.jsonp&&(en.test(t.url)?"url":"string"==typeof t.data&&0===(t.contentType||"").indexOf("application/x-www-form-urlencoded")&&en.test(t.data)&&"data");if(a||"jsonp"===t.dataTypes[0])return r=t.jsonpCallback=p(t.jsonpCallback)?t.jsonpCallback():t.jsonpCallback,a?t[a]=t[a].replace(en,"$1"+r):!1!==t.jsonp&&(t.url+=(Et.test(t.url)?"&":"?")+t.jsonp+"="+r),t.converters["script json"]=function(){return s||q.error(r+" was not called"),s[0]},t.dataTypes[0]="json",o=e[r],e[r]=function(){s=arguments},i.always((function(){void 0===o?q(e).removeProp(r):e[r]=o,t[r]&&(t.jsonpCallback=n.jsonpCallback,Qt.push(r)),s&&p(o)&&o(s[0]),s=o=void 0})),"script"})),f.createHTMLDocument=((Zt=g.implementation.createHTMLDocument("").body).innerHTML="<form></form><form></form>",2===Zt.childNodes.length),q.parseHTML=function(e,t,n){return"string"!=typeof e?[]:("boolean"==typeof t&&(n=t,t=!1),t||(f.createHTMLDocument?((i=(t=g.implementation.createHTMLDocument("")).createElement("base")).href=g.location.href,t.head.appendChild(i)):t=g),o=!n&&[],(r=L.exec(e))?[t.createElement(r[1])]:(r=Ae([e],t,o),o&&o.length&&q(o).remove(),q.merge([],r.childNodes)));var i,r,o},q.fn.load=function(e,t,n){var i,r,o,s=this,a=e.indexOf(" ");return a>-1&&(i=St(e.slice(a)),e=e.slice(0,a)),p(t)?(n=t,t=void 0):t&&"object"==typeof t&&(r="POST"),s.length>0&&q.ajax({url:e,type:r||"GET",dataType:"html",data:t}).done((function(e){o=arguments,s.html(i?q("<div>").append(q.parseHTML(e)).find(i):e)})).always(n&&function(e,t){s.each((function(){n.apply(this,o||[e.responseText,t,e])}))}),this},q.expr.pseudos.animated=function(e){return q.grep(q.timers,(function(t){return e===t.elem})).length},q.offset={setOffset:function(e,t,n){var i,r,o,s,a,l,c=q.css(e,"position"),u=q(e),h={};"static"===c&&(e.style.position="relative"),a=u.offset(),o=q.css(e,"top"),l=q.css(e,"left"),("absolute"===c||"fixed"===c)&&(o+l).indexOf("auto")>-1?(s=(i=u.position()).top,r=i.left):(s=parseFloat(o)||0,r=parseFloat(l)||0),p(t)&&(t=t.call(e,n,q.extend({},a))),null!=t.top&&(h.top=t.top-a.top+s),null!=t.left&&(h.left=t.left-a.left+r),"using"in t?t.using.call(e,h):u.css(h)}},q.fn.extend({offset:function(e){if(arguments.length)return void 0===e?this:this.each((function(t){q.offset.setOffset(this,e,t)}));var t,n,i=this[0];return i?i.getClientRects().length?(t=i.getBoundingClientRect(),n=i.ownerDocument.defaultView,{top:t.top+n.pageYOffset,left:t.left+n.pageXOffset}):{top:0,left:0}:void 0},position:function(){if(this[0]){var e,t,n,i=this[0],r={top:0,left:0};if("fixed"===q.css(i,"position"))t=i.getBoundingClientRect();else{for(t=this.offset(),n=i.ownerDocument,e=i.offsetParent||n.documentElement;e&&(e===n.body||e===n.documentElement)&&"static"===q.css(e,"position");)e=e.parentNode;e&&e!==i&&1===e.nodeType&&((r=q(e).offset()).top+=q.css(e,"borderTopWidth",!0),r.left+=q.css(e,"borderLeftWidth",!0))}return{top:t.top-r.top-q.css(i,"marginTop",!0),left:t.left-r.left-q.css(i,"marginLeft",!0)}}},offsetParent:function(){return this.map((function(){for(var e=this.offsetParent;e&&"static"===q.css(e,"position");)e=e.offsetParent;return e||fe}))}}),q.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},(function(e,t){var n="pageYOffset"===t;q.fn[e]=function(i){return Z(this,(function(e,i,r){var o;if(m(e)?o=e:9===e.nodeType&&(o=e.defaultView),void 0===r)return o?o[t]:e[i];o?o.scrollTo(n?o.pageXOffset:r,n?r:o.pageYOffset):e[i]=r}),e,i,arguments.length)}})),q.each(["top","left"],(function(e,t){q.cssHooks[t]=Ze(f.pixelPosition,(function(e,n){if(n)return n=Je(e,t),Ue.test(n)?q(e).position()[t]+"px":n}))})),q.each({Height:"height",Width:"width"},(function(e,t){q.each({padding:"inner"+e,content:t,"":"outer"+e},(function(n,i){q.fn[i]=function(r,o){var s=arguments.length&&(n||"boolean"!=typeof r),a=n||(!0===r||!0===o?"margin":"border");return Z(this,(function(t,n,r){var o;return m(t)?0===i.indexOf("outer")?t["inner"+e]:t.document.documentElement["client"+e]:9===t.nodeType?(o=t.documentElement,Math.max(t.body["scroll"+e],o["scroll"+e],t.body["offset"+e],o["offset"+e],o["client"+e])):void 0===r?q.css(t,n,a):q.style(t,n,r,a)}),t,s?r:void 0,s)}}))})),q.each(["ajaxStart","ajaxStop","ajaxComplete","ajaxError","ajaxSuccess","ajaxSend"],(function(e,t){q.fn[t]=function(e){return this.on(t,e)}})),q.fn.extend({bind:function(e,t,n){return this.on(e,null,t,n)},unbind:function(e,t){return this.off(e,null,t)},delegate:function(e,t,n,i){return this.on(t,e,n,i)},undelegate:function(e,t,n){return 1===arguments.length?this.off(e,"**"):this.off(t,e||"**",n)},hover:function(e,t){return this.mouseenter(e).mouseleave(t||e)}}),q.each("blur focus focusin focusout resize scroll click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup contextmenu".split(" "),(function(e,t){q.fn[t]=function(e,n){return arguments.length>0?this.on(t,null,e,n):this.trigger(t)}}));var tn=/^[\s\uFEFF\xA0]+|([^\s\uFEFF\xA0])[\s\uFEFF\xA0]+$/g;q.proxy=function(e,t){var n,i,o;if("string"==typeof t&&(n=e[t],t=e,e=n),p(e))return i=r.call(arguments,2),o=function(){return e.apply(t||this,i.concat(r.call(arguments)))},o.guid=e.guid=e.guid||q.guid++,o},q.holdReady=function(e){e?q.readyWait++:q.ready(!0)},q.isArray=Array.isArray,q.parseJSON=JSON.parse,q.nodeName=M,q.isFunction=p,q.isWindow=m,q.camelCase=ne,q.type=b,q.now=Date.now,q.isNumeric=function(e){var t=q.type(e);return("number"===t||"string"===t)&&!isNaN(e-parseFloat(e))},q.trim=function(e){return null==e?"":(e+"").replace(tn,"$1")};var nn=e.jQuery,rn=e.$;return q.noConflict=function(t){return e.$===q&&(e.$=rn),t&&e.jQuery===q&&(e.jQuery=nn),q},void 0===t&&(e.jQuery=e.$=q),q}))}(i);var r=n(i.exports),o={"Visualization.Histogram.MeasureAxisLabel":{id:"Visualization.Histogram.MeasureAxisLabel",locale:{"en-US":"Frequency","zh-TW":"頻率","zh-CN":"频率","tr-TR":"Sıklık","sv-SE":"Frekvens","it-IT":"Frequenza","es-ES":"Frecuencia","de-DE":"Häufigkeit","pl-PL":"Częstotliwość","nl-NL":"Frequentie","ko-KR":"빈도","pt-BR":"Frequência","fr-FR":"Fréquence","ja-JP":"レコード数","ru-RU":"Частота"}},"waterfall.legend.positiveValue.label":{id:"waterfall.legend.positiveValue.label",locale:{"en-US":"Positive","zh-TW":"正值","zh-CN":"正","tr-TR":"Pozitif","sv-SE":"Positiv","it-IT":"Positivi","es-ES":"Positivo","de-DE":"Positiv","pl-PL":"Dodatnie","nl-NL":"Positief","ko-KR":"양수","pt-BR":"Positivo","fr-FR":"Positive","ja-JP":"正","ru-RU":"Положительное"}},"waterfall.legend.negativeValue.label":{id:"waterfall.legend.negativeValue.label",locale:{"en-US":"Negative","zh-TW":"負值","zh-CN":"负","tr-TR":"Negatif","sv-SE":"Negativ","it-IT":"Negativi","es-ES":"Negativo","de-DE":"Negativ","pl-PL":"Ujemne","nl-NL":"Negatief","ko-KR":"음수","pt-BR":"Negativo","fr-FR":"Négative","ja-JP":"負","ru-RU":"Отрицательное"}},"waterfall.legend.subtotal.label":{id:"waterfall.legend.subtotal.label",locale:{"en-US":"Subtotal","zh-TW":"小計","zh-CN":"小计","tr-TR":"Ara Toplam","sv-SE":"Deltotal","it-IT":"Subtotale","es-ES":"Subtotal","de-DE":"Teilsumme","pl-PL":"Suma częściowa","nl-NL":"Subtotaal","ko-KR":"소계","pt-BR":"Subtotal","fr-FR":"Sous-total","ja-JP":"小計","ru-RU":"Подытог"}},Object_Disclaimer_LimitedData:{id:"Object.Disclaimer.LimitedData",locale:{"en-US":"Currently showing a limited data set.","zh-TW":"目前顯示的是有限的資料集。","zh-CN":"当前正显示有限的数据集。","tr-TR":"Şu anda sınırlı bir veri kümesi gösteriliyor.","sv-SE":"Just nu visas en begränsad uppsättning data.","it-IT":"Attualmente viene visualizzata una serie di dati limitata.","es-ES":"Mostrando actualmente un conjunto limitado de datos.","de-DE":"Zurzeit wird nur ein beschränkter Datensatz angezeigt.","pl-PL":"Aktualnie przedstawiany jest ograniczony zestaw danych.","nl-NL":"Momenteel wordt een beperkte gegevensverzameling getoond.","ko-KR":"현재 제한된 데이터 집합을 표시하고 있습니다.","pt-BR":"Mostrando um conjunto de dados limitado.","fr-FR":"Affichage d'un ensemble de données limité pour l'instant.","ja-JP":"現在、限定的なデータ セットを表示しています。","ru-RU":"В настоящее время отображается ограниченный набор данных."}},Object_Disclaimer_OnlyNanData:{id:"Object.Disclaimer.OnlyNanData",locale:{"en-US":"The chart is not displayed because it contains only undefined values.","zh-TW":"系統不會顯示圖表,因為該圖表僅包含未定義的值。","zh-CN":"未显示图表,因为它仅包含未定义的值。","tr-TR":"Yalnızca tanımsız değerleri içermesi nedeniyle grafik görüntülenmiyor.","sv-SE":"Diagrammet visas inte eftersom det enbart innehåller odefinierade värden.","it-IT":"Il grafico non è visualizzato poiché contiene solo valori non definiti.","es-ES":"El gráfico no se muestra porque solo contiene valores indefinidos.","de-DE":"Das Diagramm wird nicht angezeigt, da es nur nicht definierte Werte enthält.","pl-PL":"Wykres nie jest wyświetlany, ponieważ zawiera wartości niezdefiniowane.","nl-NL":"De grafiek wordt niet weergegeven omdat deze alleen ongedefinieerde waarden bevat.","ko-KR":"정의되지 않은 값만 포함되어 있으므로 차트가 표시되지 않습니다.","pt-BR":"O gráfico não foi exibido, porque contém apenas valores não definidos.","fr-FR":"Le graphique n'est pas affiché, car il contient uniquement des valeurs non définies.","ja-JP":"未定義の値しか含まれていないため、チャートは表示されていません。","ru-RU":"Диаграмма не отображается, поскольку она содержит только неопределенные значения."}},Object_Disclaimer_OnlyNegativeOrZeroValues:{id:"Object.Disclaimer.OnlyNegativeOrZeroValues",locale:{"en-US":"The chart is not displayed because it contains only negative or zero values.","zh-TW":"系統不會顯示圖表,因為該圖表僅包含負值或零值。","zh-CN":"未显示图表,因为它仅包含负值或零值。","tr-TR":"Yalnızca negatif veya sıfır değerlerini içermesi nedeniyle grafik görüntülenmiyor.","sv-SE":"Diagrammet visas inte eftersom det enbart innehåller negativa eller nollvärden","it-IT":"Il grafico non viene visualizzato poiché contiene solo valori negativi o uguali a zero.","es-ES":"El gráfico no se muestra porque sólo contiene valores negativos o valores cero.","de-DE":"Das Diagramm wird nicht angezeigt, da es nur negative oder 0-Werte enthält.","pl-PL":"Wykres nie jest wyświetlany, ponieważ zawiera wartości ujemne lub zerowe.","nl-NL":"De grafiek wordt niet weergegeven omdat het alleen negatieve waarden of nulwaarden bevat.","ko-KR":"음수 또는 zero 값만 포함되어 있으므로 차트가 표시되지 않습니다.","pt-BR":"O gráfico não foi exibido, porque contém apenas valores negativos ou zero.","fr-FR":"Le graphique n'est pas affiché, car il contient uniquement des valeurs négatives ou égales à zéro.","ja-JP":"チャートは負の値またはゼロ値しか含まれていないため、表示されていません。","ru-RU":"Диаграмма не отображается, поскольку она содержит только отрицательные или нулевые значения."}},Object_Disclaimer_RequireNumericDimension:{id:"Object.Disclaimer.RequireNumericDimension",locale:{"en-US":"This visualization requires a numeric diemnsion."}},"properties.boxplot.calculationMode.tukey.elements.boxEnd":{id:"properties.boxplot.calculationMode.tukey.elements.boxEnd",locale:{"en-US":"Third quartile","zh-TW":"第三四分位數","zh-CN":"第 3 个四分位","tr-TR":"Üçüncü çeyrek","sv-SE":"Tredje kvartilen","it-IT":"Terzo quartile","es-ES":"Tercer cuartil","de-DE":"Drittes Quartil","pl-PL":"Trzeci kwartyl","nl-NL":"Derde kwartiel","ko-KR":"3번째 사분위수","pt-BR":"Terceiro quartil","fr-FR":"Troisième quartile","ja-JP":"第 3 四分位数","ru-RU":"Третий квартиль"}},"properties.boxplot.calculationMode.tukey.elements.boxMiddle":{id:"properties.boxplot.calculationMode.tukey.elements.boxMiddle",locale:{"en-US":"Median","zh-TW":"中位數","zh-CN":"中间值","tr-TR":"Medyan","sv-SE":"Median","it-IT":"Mediana","es-ES":"Mediana","de-DE":"Drittes Quartil","pl-PL":"Mediana","nl-NL":"Mediaan","ko-KR":"중앙값","pt-BR":"Mediano","fr-FR":"Médiane","ja-JP":"中央値","ru-RU":"Медианное"}},"properties.boxplot.calculationMode.tukey.elements.boxStart":{id:"properties.boxplot.calculationMode.tukey.elements.boxStart",locale:{"en-US":"First quartile","zh-TW":"第一四分位數","zh-CN":"第 1 个四分位","tr-TR":"İlk çeyrek","sv-SE":"Första kvartilen","it-IT":"Primo quartile","es-ES":"Primer cuartil","de-DE":"Erstes Quartil","pl-PL":"Pierwszy kwartyl","nl-NL":"Eerste kwartiel","ko-KR":"1번째 사분위수","pt-BR":"Primeiro quartil","fr-FR":"Premier quartile","ja-JP":"第 1 四分位数","ru-RU":"Первый квартиль"}},"properties.boxplot.calculationMode.tukey.elements.firstWhisker":{id:"properties.boxplot.calculationMode.tukey.elements.firstWhisker",locale:{"en-US":"Box start - {0} IQR","zh-TW":"方塊開始 - {0} IQR","zh-CN":"框开始 - {0} IQR","tr-TR":"Kutu başlangıcı - {0} IQR","sv-SE":"Rutans start - {0} IQR","it-IT":"Inizio scatola - {0} IQR","es-ES":"Inicio de caja - {0} IQR","de-DE":"Box-Beginn - {0} IQR","pl-PL":"Początek wykresu pudełkowego - {0} IQR","nl-NL":"Begin box - {0} IQR","ko-KR":"상자 시작 - {0} IQR","pt-BR":"Início da caixa - {0} IQR","fr-FR":"Début de la boîte - {0} IQR","ja-JP":"ボックス開始 - {0} IQR","ru-RU":"Начало поля - {0} IQR"}},"properties.boxplot.calculationMode.tukey.elements.lastWhisker":{id:"properties.boxplot.calculationMode.tukey.elements.lastWhisker",locale:{"en-US":"Box end + {0} IQR","zh-TW":"方塊結束 + {0} IQR","zh-CN":"框结束 + {0} IQR","tr-TR":"Kutu bitişi + {0} IQR","sv-SE":"Rutans slut + {0} IQR","it-IT":"Fine scatola + {0} IQR","es-ES":"Fin de caja + {0} IQR","de-DE":"Box-Ende + {0} IQR","pl-PL":"Koniec wykresu pudełkowego - {0} IQR","nl-NL":"Einde box + {0} IQR","ko-KR":"상자 끝 + {0} IQR","pt-BR":"Fim da caixa + {0} IQR","fr-FR":"Fin de la boîte + {0} IQR","ja-JP":"ボックス終了 + {0} IQR","ru-RU":"Конец поля + {0} IQR"}},"properties.boxplot.calculationMode.stdDev.elements.boxEnd":{id:"properties.boxplot.calculationMode.stdDev.elements.boxEnd",locale:{"en-US":"Box middle + 1 standard deviation","zh-TW":"方塊中間 + 1 個標準差","zh-CN":"框中部 + 1 个标准偏差","tr-TR":"Kutu ortası + 1 standart sapma","sv-SE":"Rutans mitt + 1 standardavvikelse","it-IT":"Centro scatola + 1 deviazione standard","es-ES":"Mitad de la caja + 1 desviación estándar","de-DE":"Box-Mitte +1 Standardabweichung","pl-PL":"Środek wykresu pudełkowego + 1 odch. stand","nl-NL":"Midden box + 1 standaardafwijking","ko-KR":"상자 중간 + 1개 표준 편차","pt-BR":"Meio da caixa + 1 desvio padrão","fr-FR":"Milieu de la boîte + 1 écart type","ja-JP":"ボックス中間 + 1 標準偏差","ru-RU":"Середина поля + 1 стандартное отклонение"}},"properties.boxplot.calculationMode.stdDev.elements.boxMiddle":{id:"properties.boxplot.calculationMode.stdDev.elements.boxMiddle",locale:{"en-US":"Average","zh-TW":"平均值","zh-CN":"平均值","tr-TR":"Ortalama","sv-SE":"Medel","it-IT":"Media","es-ES":"Media","de-DE":"Durchschnitt","pl-PL":"Średnia","nl-NL":"Gemiddelde","ko-KR":"평균","pt-BR":"Média","fr-FR":"Moyenne","ja-JP":"平均値","ru-RU":"Среднее"}},"properties.boxplot.calculationMode.stdDev.elements.boxStart":{id:"properties.boxplot.calculationMode.stdDev.elements.boxStart",locale:{"en-US":"Box middle - 1 standard deviation","zh-TW":"方塊中間 - 1 個標準差","zh-CN":"框中部 - 1 个标准偏差","tr-TR":"Kutu ortası - 1 standart sapma","sv-SE":"Rutans mitt - 1 standardavvikelse","it-IT":"Centro scatola - 1 deviazione standard","es-ES":"Mitad de la caja - {1} desviación estándar","de-DE":"Box-Mitte -1 Standardabweichung","pl-PL":"Środek wykresu pudełkowego - 1 odch. stand","nl-NL":"Midden box - 1 standaardafwijking","ko-KR":"상자 중간 - 1개 표준 편차","pt-BR":"Середина поля - 1 стандартное отклонение","fr-FR":"Milieu de la boîte - 1 écart type","ja-JP":"ボックス中間 - 1 標準偏差","ru-RU":"Первый квартиль"}},"properties.boxplot.calculationMode.stdDev.elements.firstWhisker":{id:"properties.boxplot.calculationMode.stdDev.elements.firstWhisker",locale:{"en-US":"Box middle - {0} standard deviations","zh-TW":"方塊中間 - {0} 個標準差","zh-CN":"框中部 - {0} 个标准偏差","tr-TR":"Kutu ortası - {0} standart sapma","sv-SE":"Rutans mitt - {0} standardavvikelser","it-IT":"Centro scatola - {0} deviazioni standard","es-ES":"Mitad de la caja - {0} desviaciones estándar","de-DE":"Box-Mitte -{0} Standardabweichung","pl-PL":"Środek wykresu pudełkowego - {0} odch. stand","nl-NL":"Midden box - {0} standaardafwijkingen","ko-KR":"상자 중간 - {0}개 표준 편차","pt-BR":"Meio da caixa - {0} desvios padrão","fr-FR":"Milieu de la boîte - {0} écarts types","ja-JP":"ボックス中間 - {0} 標準偏差","ru-RU":"Середина поля - {0} стандартное(ых) отклонение(й)"}},"properties.boxplot.calculationMode.stdDev.elements.lastWhisker":{id:"properties.boxplot.calculationMode.stdDev.elements.lastWhisker",locale:{"en-US":"Box middle + {0} standard deviations","zh-TW":"方塊中間 + {0} 個標準差","zh-CN":"框中部 + {0} 个标准偏差","tr-TR":"Kutu ortası + {0} standart sapma","sv-SE":"Rutans mitt + {0} standardavvikelser","it-IT":"Centro scatola + {0} deviazioni standard","es-ES":"Mitad de la caja + {0} desviaciones estándar","de-DE":"Box-Mitte +{0} Standardabweichung","pl-PL":"Środek wykresu pudełkowego + {0} odch. stand","nl-NL":"Midden box + {0} standaardafwijkingen","ko-KR":"상자 중간 + {0}개 표준 편차","pt-BR":"Meio da caixa + {0} desvios padrão","fr-FR":"Milieu de la boîte + {0} écarts types","ja-JP":"ボックス中間 + {0} 標準偏差","ru-RU":"Середина поля + {0} стандартное(ых) отклонение(й)"}},"properties.boxplot.calculationMode.fractiles.elements.boxEnd":{id:"properties.boxplot.calculationMode.fractiles.elements.boxEnd",locale:{"en-US":"Third quartile","zh-TW":"第三四分位數","zh-CN":"第 3 个四分位","tr-TR":"Üçüncü çeyrek","sv-SE":"Tredje kvartilen","it-IT":"Terzo quartile<","es-ES":"Tercer cuartil","de-DE":"Drittes Quartil","pl-PL":"Trzeci kwartyl","nl-NL":"Derde kwartiel","ko-KR":"3번째 사분위수","pt-BR":"Terceiro quartil","fr-FR":"Troisième quartile","ja-JP":"第 3 四分位数","ru-RU":"Третий квартиль"}},"properties.boxplot.calculationMode.fractiles.elements.boxMiddle":{id:"properties.boxplot.calculationMode.fractiles.elements.boxMiddle",locale:{"en-US":"Median","zh-TW":"中位數","zh-CN":"中间值","tr-TR":"Medyan","sv-SE":"Median","it-IT":"Mediana","es-ES":"Mediana","de-DE":"Median","pl-PL":"Mediana","nl-NL":"Mediaan","ko-KR":"중앙값","pt-BR":"Mediano","fr-FR":"Médiane","ja-JP":"中央値","ru-RU":"Медианное"}},"properties.boxplot.calculationMode.fractiles.elements.boxStart":{id:"properties.boxplot.calculationMode.fractiles.elements.boxStart",locale:{"en-US":"First quartile","zh-TW":"第一四分位數","zh-CN":"第 1 个四分位","tr-TR":"İlk çeyrek","sv-SE":"Första kvartilen","it-IT":"Primo quartile","es-ES":"Primer cuartil","de-DE":"Erstes Quartil","pl-PL":"Pierwszy kwartyl","nl-NL":"Eerste kwartiel","ko-KR":"1번째 사분위수","pt-BR":"Primeiro quartil","fr-FR":"Premier quartile","ja-JP":"第 1 四分位数","ru-RU":"Первый квартиль"}},"properties.boxplot.calculationMode.fractiles.elements.firstWhisker.fifth":{id:"properties.boxplot.calculationMode.fractiles.elements.firstWhisker.fifth",locale:{"en-US":"5th percentile","zh-TW":"第 5 個百分位數","zh-CN":"第 5 个百分位","tr-TR":"5. yüzdebirlik","sv-SE":"5:e percentilen","it-IT":"5° percentile","es-ES":"5º percentil","de-DE":"5. Perzentil","pl-PL":"5. percentyl","nl-NL":"5e percentiel","ko-KR":"5번째 백분위수","pt-BR":"5º percentil","fr-FR":"5e centile","ja-JP":"5 番目のパーセンタイル","ru-RU":"5-й процентиль"}},"properties.boxplot.calculationMode.fractiles.elements.firstWhisker.first":{id:"properties.boxplot.calculationMode.fractiles.elements.firstWhisker.first",locale:{"en-US":"1st percentile","zh-TW":"第 1 個百分位數","zh-CN":"第 1 个百分位","tr-TR":"1. yüzdebirlik","sv-SE":"1:e percentilen","it-IT":"1° percentile","es-ES":"1er percentil","de-DE":"1. Perzentil","pl-PL":"1. percentyl","nl-NL":"1e percentiel","ko-KR":"1번째 백분위수","pt-BR":"1º percentil","fr-FR":"1er centile","ja-JP":"1 番目のパーセンタイル","ru-RU":"1-й процентиль"}},"properties.boxplot.calculationMode.fractiles.elements.firstWhisker.min":{id:"properties.boxplot.calculationMode.fractiles.elements.firstWhisker.min",locale:{"en-US":"Minimum","zh-TW":"最小","zh-CN":"最小值","tr-TR":"En az","sv-SE":"Min","it-IT":"Minimo","es-ES":"Mínimo","de-DE":"Minimum","pl-PL":"Minimum","nl-NL":"Minimum","ko-KR":"최소","pt-BR":"Mínimo","fr-FR":"Minimale","ja-JP":"最小値","ru-RU":"Минимум"}},"properties.boxplot.calculationMode.fractiles.elements.firstWhisker.tenth":{id:"properties.boxplot.calculationMode.fractiles.elements.firstWhisker.tenth",locale:{"en-US":"10th percentile","zh-TW":"第 10 個百分位數","zh-CN":"第 10 个百分位","tr-TR":"10. yüzdebirlik","sv-SE":"10:e percentilen","it-IT":"10° percentile","es-ES":"10º percentil","de-DE":"10. Perzentil","pl-PL":"10. percentyl","nl-NL":"10e percentiel","ko-KR":"10번째 백분위수","pt-BR":"10º percentil","fr-FR":"10e centile","ja-JP":"10 番目のパーセンタイル","ru-RU":"10-й процентиль"}},"properties.boxplot.calculationMode.fractiles.elements.lastWhisker.max":{id:"properties.boxplot.calculationMode.fractiles.elements.lastWhisker.max",locale:{"en-US":"Maximum","zh-TW":"最大","zh-CN":"最大值","tr-TR":"En fazla","sv-SE":"Max","it-IT":"Massimo","es-ES":"Máximo","de-DE":"Maximum","pl-PL":"Maksimum","nl-NL":"Maximum","ko-KR":"최대","pt-BR":"Máximo","fr-FR":"Maximale","ja-JP":"最大値","ru-RU":"Максимум"}},"properties.boxplot.calculationMode.fractiles.elements.lastWhisker.ninetieth":{id:"properties.boxplot.calculationMode.fractiles.elements.lastWhisker.ninetieth",locale:{"en-US":"90th percentile","zh-TW":"第 90 個百分位數","zh-CN":"第 90 个百分位","tr-TR":"90. yüzdebirlik","sv-SE":"90:e percentilen","it-IT":"90° percentile","es-ES":"90º percentil","de-DE":"90. Perzentil","pl-PL":"90. percentyl","nl-NL":"90e percentiel","ko-KR":"90번째 백분위수","pt-BR":"90º percentil","fr-FR":"90e centile","ja-JP":"90 番目の百分位数","ru-RU":"90-й процентиль"}},"properties.boxplot.calculationMode.fractiles.elements.lastWhisker.ninetyfifth":{id:"properties.boxplot.calculationMode.fractiles.elements.lastWhisker.ninetyfifth",locale:{"en-US":"95th percentile","zh-TW":"第 95 個百分位數","zh-CN":"第 95 个百分位","tr-TR":"95. yüzdebirlik","sv-SE":"95:e percentilen","it-IT":"95° percentile","es-ES":"95º percentil","de-DE":"95. Perzentil","pl-PL":"95. percentyl","nl-NL":"95e percentiel","ko-KR":"95번째 백분위수","pt-BR":"95º percentil","fr-FR":"95e centile","ja-JP":"95 番目の百分位数","ru-RU":"95-й процентиль"}},"properties.boxplot.calculationMode.fractiles.elements.lastWhisker.ninetynineth":{id:"properties.boxplot.calculationMode.fractiles.elements.lastWhisker.ninetynineth",locale:{"en-US":"99th percentile","zh-TW":"第 99 個百分位數","zh-CN":"第 99 个百分位","tr-TR":"99. yüzdebirlik","sv-SE":"99:e percentilen","it-IT":"99° percentile","es-ES":"99º percentil","de-DE":"99. Perzentil","pl-PL":"99. percentyl","nl-NL":"99e percentiel","ko-KR":"99번째 백분위수","pt-BR":"99º percentil","fr-FR":"99e centile","ja-JP":"99 番目の百分位数","ru-RU":"99-й процентиль"}}};var s={a:7,c:6,h:1,l:2,m:2,q:4,s:4,t:2,v:1,z:0},a=/([astvzqmhlc])([^astvzqmhlc]*)/gi,l=/-?[0-9]*\.?[0-9]+(?:e[-+]?\d+)?/gi;var c=function(e){var t=[],n=String(e).trim();return"M"!==n[0]&&"m"!==n[0]||n.replace(a,(function(e,n,i){var r=n.toLowerCase(),o=function(e){var t=e.match(l);return t?t.map(Number):[]}(i),a=n;if("m"===r&&o.length>2&&(t.push([a].concat(o.splice(0,2))),r="l",a="m"===a?"l":"L"),o.length<s[r])return"";for(t.push([a].concat(o.splice(0,s[r])));o.length>=s[r]&&o.length&&s[r];)t.push([a].concat(o.splice(0,s[r])));return""})),t};function u(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}function h(e){return function(e){if(Array.isArray(e))return d(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(!e)return;if("string"==typeof e)return d(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return d(e,t)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function d(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,i=new Array(t);n<t;n++)i[n]=e[n];return i}var f=c;function p(e,t){var n=e.x*Math.cos(t)-e.y*Math.sin(t),i=e.y*Math.cos(t)+e.x*Math.sin(t);e.x=n,e.y=i}function m(e,t,n){e.x+=t,e.y+=n}function g(e,t){e.x*=t,e.y*=t}var y=function(e){if(void 0!==e&&e.CanvasRenderingContext2D&&(!e.Path2D||!function(e){var t=e.document.createElement("canvas").getContext("2d"),n=new e.Path2D("M0 0 L1 1");return t.strokeStyle="red",t.lineWidth=1,t.stroke(n),255===t.getImageData(0,0,1,1).data[0]}(e))){var t=function(){function e(t){var n;(function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.segments=[],t&&t instanceof e)?(n=this.segments).push.apply(n,h(t.segments)):t&&(this.segments=f(t))}var t,n,i;return t=e,n=[{key:"addPath",value:function(t){var n;t&&t instanceof e&&(n=this.segments).push.apply(n,h(t.segments))}},{key:"moveTo",value:function(e,t){this.segments.push(["M",e,t])}},{key:"lineTo",value:function(e,t){this.segments.push(["L",e,t])}},{key:"arc",value:function(e,t,n,i,r,o){this.segments.push(["AC",e,t,n,i,r,!!o])}},{key:"arcTo",value:function(e,t,n,i,r){this.segments.push(["AT",e,t,n,i,r])}},{key:"ellipse",value:function(e,t,n,i,r,o,s,a){this.segments.push(["E",e,t,n,i,r,o,s,!!a])}},{key:"closePath",value:function(){this.segments.push(["Z"])}},{key:"bezierCurveTo",value:function(e,t,n,i,r,o){this.segments.push(["C",e,t,n,i,r,o])}},{key:"quadraticCurveTo",value:function(e,t,n,i){this.segments.push(["Q",e,t,n,i])}},{key:"rect",value:function(e,t,n,i){this.segments.push(["R",e,t,n,i])}}],n&&u(t.prototype,n),i&&u(t,i),Object.defineProperty(t,"prototype",{writable:!1}),e}(),n=e.CanvasRenderingContext2D.prototype.fill,i=e.CanvasRenderingContext2D.prototype.stroke;e.CanvasRenderingContext2D.prototype.fill=function(){for(var e=arguments.length,t=new Array(e),i=0;i<e;i++)t[i]=arguments[i];var r="nonzero";0===t.length||1===t.length&&"string"==typeof t[0]?n.apply(this,t):(2===arguments.length&&(r=t[1]),o(this,t[0].segments),n.call(this,r))},e.CanvasRenderingContext2D.prototype.stroke=function(e){e?(o(this,e.segments),i.call(this)):i.call(this)};var r=e.CanvasRenderingContext2D.prototype.isPointInPath;e.CanvasRenderingContext2D.prototype.isPointInPath=function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];if("Path2D"===t[0].constructor.name){var i=t[1],s=t[2],a=t[3]||"nonzero";return o(this,t[0].segments),r.apply(this,[i,s,a])}return r.apply(this,t)},e.Path2D=t}function o(e,t){var n,i,r,o,s,a,l,c,u,h,d,f,y,v,b,x,w,q,S,M,D,_,C,k,E,A,T={x:0,y:0},I={x:0,y:0};e.beginPath();for(var R=0;R<t.length;++R){var O=t[R];switch("S"!==(M=O[0])&&"s"!==M&&"C"!==M&&"c"!==M&&(_=null,C=null),"T"!==M&&"t"!==M&&"Q"!==M&&"q"!==M&&(k=null,E=null),M){case"m":case"M":"m"===M?(d+=O[1],y+=O[2]):(d=O[1],y=O[2]),"M"!==M&&T||(T={x:d,y:y}),e.moveTo(d,y);break;case"l":d+=O[1],y+=O[2],e.lineTo(d,y);break;case"L":d=O[1],y=O[2],e.lineTo(d,y);break;case"H":d=O[1],e.lineTo(d,y);break;case"h":d+=O[1],e.lineTo(d,y);break;case"V":y=O[1],e.lineTo(d,y);break;case"v":y+=O[1],e.lineTo(d,y);break;case"a":case"A":"a"===M?(d+=O[6],y+=O[7]):(d=O[6],y=O[7]),x=O[1],w=O[2],l=O[3]*Math.PI/180,r=!!O[4],o=!!O[5],s={x:d,y:y},p(a={x:(I.x-s.x)/2,y:(I.y-s.y)/2},-l),(c=a.x*a.x/(x*x)+a.y*a.y/(w*w))>1&&(x*=c=Math.sqrt(c),w*=c),u=x*x*w*w,h=x*x*a.y*a.y+w*w*a.x*a.x,g(D={x:x*a.y/w,y:-w*a.x/x},o!==r?Math.sqrt((u-h)/h)||0:-Math.sqrt((u-h)/h)||0),i=Math.atan2((a.y-D.y)/w,(a.x-D.x)/x),n=Math.atan2(-(a.y+D.y)/w,-(a.x+D.x)/x),p(D,l),m(D,(s.x+I.x)/2,(s.y+I.y)/2),e.save(),e.translate(D.x,D.y),e.rotate(l),e.scale(x,w),e.arc(0,0,1,i,n,!o),e.restore();break;case"C":_=O[3],C=O[4],d=O[5],y=O[6],e.bezierCurveTo(O[1],O[2],_,C,d,y);break;case"c":e.bezierCurveTo(O[1]+d,O[2]+y,O[3]+d,O[4]+y,O[5]+d,O[6]+y),_=O[3]+d,C=O[4]+y,d+=O[5],y+=O[6];break;case"S":null!==_&&null!==C||(_=d,C=y),e.bezierCurveTo(2*d-_,2*y-C,O[1],O[2],O[3],O[4]),_=O[1],C=O[2],d=O[3],y=O[4];break;case"s":null!==_&&null!==C||(_=d,C=y),e.bezierCurveTo(2*d-_,2*y-C,O[1]+d,O[2]+y,O[3]+d,O[4]+y),_=O[1]+d,C=O[2]+y,d+=O[3],y+=O[4];break;case"Q":k=O[1],E=O[2],d=O[3],y=O[4],e.quadraticCurveTo(k,E,d,y);break;case"q":k=O[1]+d,E=O[2]+y,d+=O[3],y+=O[4],e.quadraticCurveTo(k,E,d,y);break;case"T":null!==k&&null!==E||(k=d,E=y),k=2*d-k,E=2*y-E,d=O[1],y=O[2],e.quadraticCurveTo(k,E,d,y);break;case"t":null!==k&&null!==E||(k=d,E=y),k=2*d-k,E=2*y-E,d+=O[1],y+=O[2],e.quadraticCurveTo(k,E,d,y);break;case"z":case"Z":d=T.x,y=T.y,T=void 0,e.closePath();break;case"AC":d=O[1],y=O[2],b=O[3],i=O[4],n=O[5],A=O[6],e.arc(d,y,b,i,n,A);break;case"AT":f=O[1],v=O[2],d=O[3],y=O[4],b=O[5],e.arcTo(f,v,d,y,b);break;case"E":d=O[1],y=O[2],x=O[3],w=O[4],l=O[5],i=O[6],n=O[7],A=O[8],e.save(),e.translate(d,y),e.rotate(l),e.scale(x,w),e.arc(0,0,1,i,n,A),e.restore();break;case"R":d=O[1],y=O[2],q=O[3],S=O[4],T={x:d,y:y},e.rect(d,y,q,S)}I.x=d,I.y=y}}},v=c,b=y;"undefined"!=typeof window&&b(window);var x={path2dPolyfill:b,parsePath:v},w=Object.prototype.hasOwnProperty,q=Object.prototype.toString,S=Object.defineProperty,M=Object.getOwnPropertyDescriptor,D=function(e){return"function"==typeof Array.isArray?Array.isArray(e):"[object Array]"===q.call(e)},_=function(e){if(!e||"[object Object]"!==q.call(e))return!1;var t,n=w.call(e,"constructor"),i=e.constructor&&e.constructor.prototype&&w.call(e.constructor.prototype,"isPrototypeOf");if(e.constructor&&!n&&!i)return!1;for(t in e);return void 0===t||w.call(e,t)},C=function(e,t){S&&"__proto__"===t.name?S(e,t.name,{enumerable:!0,configurable:!0,value:t.newValue,writable:!0}):e[t.name]=t.newValue},k=function(e,t){if("__proto__"===t){if(!w.call(e,t))return;if(M)return M(e,t).value}return e[t]},E=function e(){var t,n,i,r,o,s,a=arguments[0],l=1,c=arguments.length,u=!1;for("boolean"==typeof a&&(u=a,a=arguments[1]||{},l=2),(null==a||"object"!=typeof a&&"function"!=typeof a)&&(a={});l<c;++l)if(null!=(t=arguments[l]))for(n in t)i=k(a,n),a!==(r=k(t,n))&&(u&&r&&(_(r)||(o=D(r)))?(o?(o=!1,s=i&&D(i)?i:[]):s=i&&_(i)?i:{},C(a,{name:n,newValue:e(u,s,r)})):void 0!==r&&C(a,{name:n,newValue:r}));return a},A="2.2.4";function T(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,i)}return n}function I(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?T(Object(n),!0).forEach((function(t){R(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):T(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function R(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 i=n.call(e,t||"default");if("object"!=typeof i)return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:String(t)}(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function O(e){return!!e.changedTouches}function N(e){return"number"==typeof e&&!isNaN(e)}function P(e){return"number"!=typeof e||isNaN(e)}function L(e){const t=e.length;let n=NaN,i=NaN,r=NaN,o=NaN;for(let s=0;s<t;s++)n=isNaN(n)?e[s].x:Math.min(n,e[s].x),i=isNaN(i)?e[s].x:Math.max(i,e[s].x),r=isNaN(r)?e[s].y:Math.min(r,e[s].y),o=isNaN(o)?e[s].y:Math.max(o,e[s].y);return[n,r,i,o]}function F(e){return[{x:e.x1||0,y:e.y1||0},{x:e.x2||0,y:e.y2||0}]}function z(e){return[{x:e.x,y:e.y},{x:e.x+e.width,y:e.y},{x:e.x+e.width,y:e.y+e.height},{x:e.x,y:e.y+e.height}]}function j(e){const[t,n,i,r]=L(e);return{x:t,y:n,width:i-t,height:r-n}}function H(e){return{x1:e[0].x,y1:e[0].y,x2:e[1].x,y2:e[1].y}}function B(e){const{x:t,y:n,width:i,height:r,x1:o,x2:s,y1:a,y2:l,cx:c,cy:u,r:h,vertices:d}=e||{};return N(c)&&N(u)&&N(h)?"circle":N(o)&&N(s)&&N(a)&&N(l)?"line":N(t)&&N(n)&&N(i)&&N(r)?"rect":N(t)&&N(n)?"point":Array.isArray(d)?d.every((e=>Array.isArray(e)))?"geopolygon":"polygon":null}function V(e,t){return{x:t.x-e,y:t.y-e,width:t.width+e,height:t.height+e}}var $=Math.PI,W=2*$,U=1e-6,Y=W-U;function X(){this._x0=this._y0=this._x1=this._y1=null,this._=""}function K(){return new X}function G(e){return function(){return e}}X.prototype=K.prototype={constructor:X,moveTo:function(e,t){this._+="M"+(this._x0=this._x1=+e)+","+(this._y0=this._y1=+t)},closePath:function(){null!==this._x1&&(this._x1=this._x0,this._y1=this._y0,this._+="Z")},lineTo:function(e,t){this._+="L"+(this._x1=+e)+","+(this._y1=+t)},quadraticCurveTo:function(e,t,n,i){this._+="Q"+ +e+","+ +t+","+(this._x1=+n)+","+(this._y1=+i)},bezierCurveTo:function(e,t,n,i,r,o){this._+="C"+ +e+","+ +t+","+ +n+","+ +i+","+(this._x1=+r)+","+(this._y1=+o)},arcTo:function(e,t,n,i,r){e=+e,t=+t,n=+n,i=+i,r=+r;var o=this._x1,s=this._y1,a=n-e,l=i-t,c=o-e,u=s-t,h=c*c+u*u;if(r<0)throw new Error("negative radius: "+r);if(null===this._x1)this._+="M"+(this._x1=e)+","+(this._y1=t);else if(h>U)if(Math.abs(u*a-l*c)>U&&r){var d=n-o,f=i-s,p=a*a+l*l,m=d*d+f*f,g=Math.sqrt(p),y=Math.sqrt(h),v=r*Math.tan(($-Math.acos((p+h-m)/(2*g*y)))/2),b=v/y,x=v/g;Math.abs(b-1)>U&&(this._+="L"+(e+b*c)+","+(t+b*u)),this._+="A"+r+","+r+",0,0,"+ +(u*d>c*f)+","+(this._x1=e+x*a)+","+(this._y1=t+x*l)}else this._+="L"+(this._x1=e)+","+(this._y1=t);else;},arc:function(e,t,n,i,r,o){e=+e,t=+t,o=!!o;var s=(n=+n)*Math.cos(i),a=n*Math.sin(i),l=e+s,c=t+a,u=1^o,h=o?i-r:r-i;if(n<0)throw new Error("negative radius: "+n);null===this._x1?this._+="M"+l+","+c:(Math.abs(this._x1-l)>U||Math.abs(this._y1-c)>U)&&(this._+="L"+l+","+c),n&&(h<0&&(h=h%W+W),h>Y?this._+="A"+n+","+n+",0,1,"+u+","+(e-s)+","+(t-a)+"A"+n+","+n+",0,1,"+u+","+(this._x1=l)+","+(this._y1=c):h>U&&(this._+="A"+n+","+n+",0,"+ +(h>=$)+","+u+","+(this._x1=e+n*Math.cos(r))+","+(this._y1=t+n*Math.sin(r))))},rect:function(e,t,n,i){this._+="M"+(this._x0=this._x1=+e)+","+(this._y0=this._y1=+t)+"h"+ +n+"v"+ +i+"h"+-n+"Z"},toString:function(){return this._}};var J=Math.abs,Z=Math.atan2,Q=Math.cos,ee=Math.max,te=Math.min,ne=Math.sin,ie=Math.sqrt,re=1e-12,oe=Math.PI,se=oe/2,ae=2*oe;function le(e){return e>=1?se:e<=-1?-se:Math.asin(e)}function ce(e){return e.innerRadius}function ue(e){return e.outerRadius}function he(e){return e.startAngle}function de(e){return e.endAngle}function fe(e){return e&&e.padAngle}function pe(e,t,n,i,r,o,s){var a=e-n,l=t-i,c=(s?o:-o)/ie(a*a+l*l),u=c*l,h=-c*a,d=e+u,f=t+h,p=n+u,m=i+h,g=(d+p)/2,y=(f+m)/2,v=p-d,b=m-f,x=v*v+b*b,w=r-o,q=d*m-p*f,S=(b<0?-1:1)*ie(ee(0,w*w*x-q*q)),M=(q*b-v*S)/x,D=(-q*v-b*S)/x,_=(q*b+v*S)/x,C=(-q*v+b*S)/x,k=M-g,E=D-y,A=_-g,T=C-y;return k*k+E*E>A*A+T*T&&(M=_,D=C),{cx:M,cy:D,x01:-u,y01:-h,x11:M*(r/w-1),y11:D*(r/w-1)}}function me(){var e=ce,t=ue,n=G(0),i=null,r=he,o=de,s=fe,a=null;function l(){var l,c,u=+e.apply(this,arguments),h=+t.apply(this,arguments),d=r.apply(this,arguments)-se,f=o.apply(this,arguments)-se,p=J(f-d),m=f>d;if(a||(a=l=K()),h<u&&(c=h,h=u,u=c),h>re)if(p>ae-re)a.moveTo(h*Q(d),h*ne(d)),a.arc(0,0,h,d,f,!m),u>re&&(a.moveTo(u*Q(f),u*ne(f)),a.arc(0,0,u,f,d,m));else{var g,y,v=d,b=f,x=d,w=f,q=p,S=p,M=s.apply(this,arguments)/2,D=M>re&&(i?+i.apply(this,arguments):ie(u*u+h*h)),_=te(J(h-u)/2,+n.apply(this,arguments)),C=_,k=_;if(D>re){var E=le(D/u*ne(M)),A=le(D/h*ne(M));(q-=2*E)>re?(x+=E*=m?1:-1,w-=E):(q=0,x=w=(d+f)/2),(S-=2*A)>re?(v+=A*=m?1:-1,b-=A):(S=0,v=b=(d+f)/2)}var T=h*Q(v),I=h*ne(v),R=u*Q(w),O=u*ne(w);if(_>re){var N,P=h*Q(b),L=h*ne(b),F=u*Q(x),z=u*ne(x);if(p<oe&&(N=function(e,t,n,i,r,o,s,a){var l=n-e,c=i-t,u=s-r,h=a-o,d=h*l-u*c;if(!(d*d<re))return[e+(d=(u*(t-o)-h*(e-r))/d)*l,t+d*c]}(T,I,F,z,P,L,R,O))){var j=T-N[0],H=I-N[1],B=P-N[0],V=L-N[1],$=1/ne(function(e){return e>1?0:e<-1?oe:Math.acos(e)}((j*B+H*V)/(ie(j*j+H*H)*ie(B*B+V*V)))/2),W=ie(N[0]*N[0]+N[1]*N[1]);C=te(_,(u-W)/($-1)),k=te(_,(h-W)/($+1))}}S>re?k>re?(g=pe(F,z,T,I,h,k,m),y=pe(P,L,R,O,h,k,m),a.moveTo(g.cx+g.x01,g.cy+g.y01),k<_?a.arc(g.cx,g.cy,k,Z(g.y01,g.x01),Z(y.y01,y.x01),!m):(a.arc(g.cx,g.cy,k,Z(g.y01,g.x01),Z(g.y11,g.x11),!m),a.arc(0,0,h,Z(g.cy+g.y11,g.cx+g.x11),Z(y.cy+y.y11,y.cx+y.x11),!m),a.arc(y.cx,y.cy,k,Z(y.y11,y.x11),Z(y.y01,y.x01),!m))):(a.moveTo(T,I),a.arc(0,0,h,v,b,!m)):a.moveTo(T,I),u>re&&q>re?C>re?(g=pe(R,O,P,L,u,-C,m),y=pe(T,I,F,z,u,-C,m),a.lineTo(g.cx+g.x01,g.cy+g.y01),C<_?a.arc(g.cx,g.cy,C,Z(g.y01,g.x01),Z(y.y01,y.x01),!m):(a.arc(g.cx,g.cy,C,Z(g.y01,g.x01),Z(g.y11,g.x11),!m),a.arc(0,0,u,Z(g.cy+g.y11,g.cx+g.x11),Z(y.cy+y.y11,y.cx+y.x11),m),a.arc(y.cx,y.cy,C,Z(y.y11,y.x11),Z(y.y01,y.x01),!m))):a.arc(0,0,u,w,x,m):a.lineTo(R,O)}else a.moveTo(0,0);if(a.closePath(),l)return a=null,l+""||null}return l.centroid=function(){var n=(+e.apply(this,arguments)+ +t.apply(this,arguments))/2,i=(+r.apply(this,arguments)+ +o.apply(this,arguments))/2-oe/2;return[Q(i)*n,ne(i)*n]},l.innerRadius=function(t){return arguments.length?(e="function"==typeof t?t:G(+t),l):e},l.outerRadius=function(e){return arguments.length?(t="function"==typeof e?e:G(+e),l):t},l.cornerRadius=function(e){return arguments.length?(n="function"==typeof e?e:G(+e),l):n},l.padRadius=function(e){return arguments.length?(i=null==e?null:"function"==typeof e?e:G(+e),l):i},l.startAngle=function(e){return arguments.length?(r="function"==typeof e?e:G(+e),l):r},l.endAngle=function(e){return arguments.length?(o="function"==typeof e?e:G(+e),l):o},l.padAngle=function(e){return arguments.length?(s="function"==typeof e?e:G(+e),l):s},l.context=function(e){return arguments.length?(a=null==e?null:e,l):a},l}function ge(e){this._context=e}function ye(e){return new ge(e)}function ve(e){return e[0]}function be(e){return e[1]}function xe(){var e=ve,t=null,n=G(0),i=be,r=G(!0),o=null,s=ye,a=null;function l(l){var c,u,h,d,f,p=l.length,m=!1,g=new Array(p),y=new Array(p);for(null==o&&(a=s(f=K())),c=0;c<=p;++c){if(!(c<p&&r(d=l[c],c,l))===m)if(m=!m)u=c,a.areaStart(),a.lineStart();else{for(a.lineEnd(),a.lineStart(),h=c-1;h>=u;--h)a.point(g[h],y[h]);a.lineEnd(),a.areaEnd()}m&&(g[c]=+e(d,c,l),y[c]=+n(d,c,l),a.point(t?+t(d,c,l):g[c],i?+i(d,c,l):y[c]))}if(f)return a=null,f+""||null}function c(){return function(){var e=ve,t=be,n=G(!0),i=null,r=ye,o=null;function s(s){var a,l,c,u=s.length,h=!1;for(null==i&&(o=r(c=K())),a=0;a<=u;++a)!(a<u&&n(l=s[a],a,s))===h&&((h=!h)?o.lineStart():o.lineEnd()),h&&o.point(+e(l,a,s),+t(l,a,s));if(c)return o=null,c+""||null}return s.x=function(t){return arguments.length?(e="function"==typeof t?t:G(+t),s):e},s.y=function(e){return arguments.length?(t="function"==typeof e?e:G(+e),s):t},s.defined=function(e){return arguments.length?(n="function"==typeof e?e:G(!!e),s):n},s.curve=function(e){return arguments.length?(r=e,null!=i&&(o=r(i)),s):r},s.context=function(e){return arguments.length?(null==e?i=o=null:o=r(i=e),s):i},s}().defined(r).curve(s).context(o)}return l.x=function(n){return arguments.length?(e="function"==typeof n?n:G(+n),t=null,l):e},l.x0=function(t){return arguments.length?(e="function"==typeof t?t:G(+t),l):e},l.x1=function(e){return arguments.length?(t=null==e?null:"function"==typeof e?e:G(+e),l):t},l.y=function(e){return arguments.length?(n="function"==typeof e?e:G(+e),i=null,l):n},l.y0=function(e){return arguments.length?(n="function"==typeof e?e:G(+e),l):n},l.y1=function(e){return arguments.length?(i=null==e?null:"function"==typeof e?e:G(+e),l):i},l.lineX0=l.lineY0=function(){return c().x(e).y(n)},l.lineY1=function(){return c().x(e).y(i)},l.lineX1=function(){return c().x(t).y(n)},l.defined=function(e){return arguments.length?(r="function"==typeof e?e:G(!!e),l):r},l.curve=function(e){return arguments.length?(s=e,null!=o&&(a=s(o)),l):s},l.context=function(e){return arguments.length?(null==e?o=a=null:a=s(o=e),l):o},l}function we(e,t){return t<e?-1:t>e?1:t>=e?0:NaN}function qe(e){return e}ge.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;default:this._context.lineTo(e,t)}}};var Se=Array.prototype.slice;function Me(e,t,n){e._context.bezierCurveTo((2*e._x0+e._x1)/3,(2*e._y0+e._y1)/3,(e._x0+2*e._x1)/3,(e._y0+2*e._y1)/3,(e._x0+4*e._x1+t)/6,(e._y0+4*e._y1+n)/6)}function De(e){this._context=e}function _e(e,t,n){e._context.bezierCurveTo(e._x1+e._k*(e._x2-e._x0),e._y1+e._k*(e._y2-e._y0),e._x2+e._k*(e._x1-t),e._y2+e._k*(e._y1-n),e._x2,e._y2)}function Ce(e,t){this._context=e,this._k=(1-t)/6}De.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){switch(this._point){case 3:Me(this,this._x1,this._y1);case 2:this._context.lineTo(this._x1,this._y1)}(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3,this._context.lineTo((5*this._x0+this._x1)/6,(5*this._y0+this._y1)/6);default:Me(this,e,t)}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}},Ce.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x2,this._y2);break;case 3:_e(this,this._x1,this._y1)}(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2,this._x1=e,this._y1=t;break;case 2:this._point=3;default:_e(this,e,t)}this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};var ke=function e(t){function n(e){return new Ce(e,t)}return n.tension=function(t){return e(+t)},n}(0);function Ee(e,t){this._context=e,this._alpha=t}Ee.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x2,this._y2);break;case 3:this.point(this._x2,this._y2)}(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){if(e=+e,t=+t,this._point){var n=this._x2-e,i=this._y2-t;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(n*n+i*i,this._alpha))}switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3;default:!function(e,t,n){var i=e._x1,r=e._y1,o=e._x2,s=e._y2;if(e._l01_a>re){var a=2*e._l01_2a+3*e._l01_a*e._l12_a+e._l12_2a,l=3*e._l01_a*(e._l01_a+e._l12_a);i=(i*a-e._x0*e._l12_2a+e._x2*e._l01_2a)/l,r=(r*a-e._y0*e._l12_2a+e._y2*e._l01_2a)/l}if(e._l23_a>re){var c=2*e._l23_2a+3*e._l23_a*e._l12_a+e._l12_2a,u=3*e._l23_a*(e._l23_a+e._l12_a);o=(o*c+e._x1*e._l23_2a-t*e._l12_2a)/u,s=(s*c+e._y1*e._l23_2a-n*e._l12_2a)/u}e._context.bezierCurveTo(i,r,o,s,e._x2,e._y2)}(this,e,t)}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};var Ae=function e(t){function n(e){return t?new Ee(e,t):new Ce(e,0)}return n.alpha=function(t){return e(+t)},n}(.5);function Te(e){return e<0?-1:1}function Ie(e,t,n){var i=e._x1-e._x0,r=t-e._x1,o=(e._y1-e._y0)/(i||r<0&&-0),s=(n-e._y1)/(r||i<0&&-0),a=(o*r+s*i)/(i+r);return(Te(o)+Te(s))*Math.min(Math.abs(o),Math.abs(s),.5*Math.abs(a))||0}function Re(e,t){var n=e._x1-e._x0;return n?(3*(e._y1-e._y0)/n-t)/2:t}function Oe(e,t,n){var i=e._x0,r=e._y0,o=e._x1,s=e._y1,a=(o-i)/3;e._context.bezierCurveTo(i+a,r+a*t,o-a,s-a*n,o,s)}function Ne(e){this._context=e}function Pe(e){this._context=new Le(e)}function Le(e){this._context=e}function Fe(e){this._context=e}function ze(e){var t,n,i=e.length-1,r=new Array(i),o=new Array(i),s=new Array(i);for(r[0]=0,o[0]=2,s[0]=e[0]+2*e[1],t=1;t<i-1;++t)r[t]=1,o[t]=4,s[t]=4*e[t]+2*e[t+1];for(r[i-1]=2,o[i-1]=7,s[i-1]=8*e[i-1]+e[i],t=1;t<i;++t)n=r[t]/o[t-1],o[t]-=n,s[t]-=n*s[t-1];for(r[i-1]=s[i-1]/o[i-1],t=i-2;t>=0;--t)r[t]=(s[t]-r[t+1])/o[t];for(o[i-1]=(e[i]+r[i-1])/2,t=0;t<i-1;++t)o[t]=2*e[t+1]-r[t+1];return[r,o]}function je(e,t){this._context=e,this._t=t}function He(e,t){if((r=e.length)>1)for(var n,i,r,o=1,s=e[t[0]],a=s.length;o<r;++o)for(i=s,s=e[t[o]],n=0;n<a;++n)s[n][1]+=s[n][0]=isNaN(i[n][1])?i[n][0]:i[n][1]}function Be(e){for(var t=e.length,n=new Array(t);--t>=0;)n[t]=t;return n}function Ve(e,t){return e[t]}function $e(e){for(var t,n=-1,i=0,r=e.length,o=-1/0;++n<r;)(t=+e[n][1])>o&&(o=t,i=n);return i}function We(e){for(var t,n=0,i=-1,r=e.length;++i<r;)(t=+e[i][1])&&(n+=t);return n}function Ue(e){let t,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"unspecified",i=arguments.length>2?arguments[2]:void 0;const r={},o=e||{get:()=>{},has:()=>!1,default:()=>{}};function s(e,t){if(!e||"string"!=typeof e)throw new TypeError("Invalid argument: key must be a non-empty string");return!(e in r)&&(r[e]=t,!0)}function a(e){return r[e]||o.get(e)}function l(e,r){if(void 0!==r)return s(e,r);const o=a(e);return i&&void 0===o&&i.warn("".concat(e," does not exist in ").concat(n," registry")),o||a(t)}return t=o.default(),l.add=s,l.get=a,l.has=function(e){return!!r[e]||o.has(e)},l.remove=function(e){const t=r[e];return delete r[e],t},l.getKeys=function(){return Object.keys(r)},l.getValues=function(){return Object.keys(r).map((e=>r[e]))},l.default=function(e){return void 0!==e&&(t=e),t},l.register=s,l}function Ye(e,t){if((n=(e=t?e.toExponential(t-1):e.toExponential()).indexOf("e"))<0)return null;var n,i=e.slice(0,n);return[i.length>1?i[0]+i.slice(2):i,+e.slice(n+1)]}function Xe(e){return(e=Ye(Math.abs(e)))?e[1]:NaN}Ne.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=this._t0=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x1,this._y1);break;case 3:Oe(this,this._t0,Re(this,this._t0))}(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){var n=NaN;if(t=+t,(e=+e)!==this._x1||t!==this._y1){switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3,Oe(this,Re(this,n=Ie(this,e,t)),n);break;default:Oe(this,this._t0,n=Ie(this,e,t))}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t,this._t0=n}}},(Pe.prototype=Object.create(Ne.prototype)).point=function(e,t){Ne.prototype.point.call(this,t,e)},Le.prototype={moveTo:function(e,t){this._context.moveTo(t,e)},closePath:function(){this._context.closePath()},lineTo:function(e,t){this._context.lineTo(t,e)},bezierCurveTo:function(e,t,n,i,r,o){this._context.bezierCurveTo(t,e,i,n,o,r)}},Fe.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=[],this._y=[]},lineEnd:function(){var e=this._x,t=this._y,n=e.length;if(n)if(this._line?this._context.lineTo(e[0],t[0]):this._context.moveTo(e[0],t[0]),2===n)this._context.lineTo(e[1],t[1]);else for(var i=ze(e),r=ze(t),o=0,s=1;s<n;++o,++s)this._context.bezierCurveTo(i[0][o],r[0][o],i[1][o],r[1][o],e[s],t[s]);(this._line||0!==this._line&&1===n)&&this._context.closePath(),this._line=1-this._line,this._x=this._y=null},point:function(e,t){this._x.push(+e),this._y.push(+t)}},je.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=this._y=NaN,this._point=0},lineEnd:function(){0<this._t&&this._t<1&&2===this._point&&this._context.lineTo(this._x,this._y),(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line>=0&&(this._t=1-this._t,this._line=1-this._line)},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;default:if(this._t<=0)this._context.lineTo(this._x,t),this._context.lineTo(e,t);else{var n=this._x*(1-this._t)+e*this._t;this._context.lineTo(n,this._y),this._context.lineTo(n,t)}}this._x=e,this._y=t}};var Ke,Ge=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function Je(e){if(!(t=Ge.exec(e)))throw new Error("invalid format: "+e);var t;return new Ze({fill:t[1],align:t[2],sign:t[3],symbol:t[4],zero:t[5],width:t[6],comma:t[7],precision:t[8]&&t[8].slice(1),trim:t[9],type:t[10]})}function Ze(e){this.fill=void 0===e.fill?" ":e.fill+"",this.align=void 0===e.align?">":e.align+"",this.sign=void 0===e.sign?"-":e.sign+"",this.symbol=void 0===e.symbol?"":e.symbol+"",this.zero=!!e.zero,this.width=void 0===e.width?void 0:+e.width,this.comma=!!e.comma,this.precision=void 0===e.precision?void 0:+e.precision,this.trim=!!e.trim,this.type=void 0===e.type?"":e.type+""}function Qe(e,t){var n=Ye(e,t);if(!n)return e+"";var i=n[0],r=n[1];return r<0?"0."+new Array(-r).join("0")+i:i.length>r+1?i.slice(0,r+1)+"."+i.slice(r+1):i+new Array(r-i.length+2).join("0")}Je.prototype=Ze.prototype,Ze.prototype.toString=function(){return this.fill+this.align+this.sign+this.symbol+(this.zero?"0":"")+(void 0===this.width?"":Math.max(1,0|this.width))+(this.comma?",":"")+(void 0===this.precision?"":"."+Math.max(0,0|this.precision))+(this.trim?"~":"")+this.type};var et={"%":(e,t)=>(100*e).toFixed(t),b:e=>Math.round(e).toString(2),c:e=>e+"",d:function(e){return Math.abs(e=Math.round(e))>=1e21?e.toLocaleString("en").replace(/,/g,""):e.toString(10)},e:(e,t)=>e.toExponential(t),f:(e,t)=>e.toFixed(t),g:(e,t)=>e.toPrecision(t),o:e=>Math.round(e).toString(8),p:(e,t)=>Qe(100*e,t),r:Qe,s:function(e,t){var n=Ye(e,t);if(!n)return e+"";var i=n[0],r=n[1],o=r-(Ke=3*Math.max(-8,Math.min(8,Math.floor(r/3))))+1,s=i.length;return o===s?i:o>s?i+new Array(o-s+1).join("0"):o>0?i.slice(0,o)+"."+i.slice(o):"0."+new Array(1-o).join("0")+Ye(e,Math.max(0,t+o-1))[0]},X:e=>Math.round(e).toString(16).toUpperCase(),x:e=>Math.round(e).toString(16)};function tt(e){return e}var nt,it,rt,ot=Array.prototype.map,st=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function at(e){var t,n,i=void 0===e.grouping||void 0===e.thousands?tt:(t=ot.call(e.grouping,Number),n=e.thousands+"",function(e,i){for(var r=e.length,o=[],s=0,a=t[0],l=0;r>0&&a>0&&(l+a+1>i&&(a=Math.max(1,i-l)),o.push(e.substring(r-=a,r+a)),!((l+=a+1)>i));)a=t[s=(s+1)%t.length];return o.reverse().join(n)}),r=void 0===e.currency?"":e.currency[0]+"",o=void 0===e.currency?"":e.currency[1]+"",s=void 0===e.decimal?".":e.decimal+"",a=void 0===e.numerals?tt:function(e){return function(t){return t.replace(/[0-9]/g,(function(t){return e[+t]}))}}(ot.call(e.numerals,String)),l=void 0===e.percent?"%":e.percent+"",c=void 0===e.minus?"−":e.minus+"",u=void 0===e.nan?"NaN":e.nan+"";function h(e){var t=(e=Je(e)).fill,n=e.align,h=e.sign,d=e.symbol,f=e.zero,p=e.width,m=e.comma,g=e.precision,y=e.trim,v=e.type;"n"===v?(m=!0,v="g"):et[v]||(void 0===g&&(g=12),y=!0,v="g"),(f||"0"===t&&"="===n)&&(f=!0,t="0",n="=");var b="$"===d?r:"#"===d&&/[boxX]/.test(v)?"0"+v.toLowerCase():"",x="$"===d?o:/[%p]/.test(v)?l:"",w=et[v],q=/[defgprs%]/.test(v);function S(e){var r,o,l,d=b,S=x;if("c"===v)S=w(e)+S,e="";else{var M=(e=+e)<0||1/e<0;if(e=isNaN(e)?u:w(Math.abs(e),g),y&&(e=function(e){e:for(var t,n=e.length,i=1,r=-1;i<n;++i)switch(e[i]){case".":r=t=i;break;case"0":0===r&&(r=i),t=i;break;default:if(!+e[i])break e;r>0&&(r=0)}return r>0?e.slice(0,r)+e.slice(t+1):e}(e)),M&&0==+e&&"+"!==h&&(M=!1),d=(M?"("===h?h:c:"-"===h||"("===h?"":h)+d,S=("s"===v?st[8+Ke/3]:"")+S+(M&&"("===h?")":""),q)for(r=-1,o=e.length;++r<o;)if(48>(l=e.charCodeAt(r))||l>57){S=(46===l?s+e.slice(r+1):e.slice(r))+S,e=e.slice(0,r);break}}m&&!f&&(e=i(e,1/0));var D=d.length+e.length+S.length,_=D<p?new Array(p-D+1).join(t):"";switch(m&&f&&(e=i(_+e,_.length?p-S.length:1/0),_=""),n){case"<":e=d+e+S+_;break;case"=":e=d+_+e+S;break;case"^":e=_.slice(0,D=_.length>>1)+d+e+S+_.slice(D);break;default:e=_+d+e+S}return a(e)}return g=void 0===g?6:/[gprs]/.test(v)?Math.max(1,Math.min(21,g)):Math.max(0,Math.min(20,g)),S.toString=function(){return e+""},S}return{format:h,formatPrefix:function(e,t){var n=h(((e=Je(e)).type="f",e)),i=3*Math.max(-8,Math.min(8,Math.floor(Xe(t)/3))),r=Math.pow(10,-i),o=st[8+i/3];return function(e){return n(r*e)+o}}}}!function(e){nt=at(e),it=nt.format,rt=nt.formatPrefix}({thousands:",",grouping:[3],currency:["$",""]});const lt=new Date,ct=new Date;function ut(e,t,n,i){function r(t){return e(t=0===arguments.length?new Date:new Date(+t)),t}return r.floor=t=>(e(t=new Date(+t)),t),r.ceil=n=>(e(n=new Date(n-1)),t(n,1),e(n),n),r.round=e=>{const t=r(e),n=r.ceil(e);return e-t<n-e?t:n},r.offset=(e,n)=>(t(e=new Date(+e),null==n?1:Math.floor(n)),e),r.range=(n,i,o)=>{const s=[];if(n=r.ceil(n),o=null==o?1:Math.floor(o),!(n<i&&o>0))return s;let a;do{s.push(a=new Date(+n)),t(n,o),e(n)}while(a<n&&n<i);return s},r.filter=n=>ut((t=>{if(t>=t)for(;e(t),!n(t);)t.setTime(t-1)}),((e,i)=>{if(e>=e)if(i<0)for(;++i<=0;)for(;t(e,-1),!n(e););else for(;--i>=0;)for(;t(e,1),!n(e););})),n&&(r.count=(t,i)=>(lt.setTime(+t),ct.setTime(+i),e(lt),e(ct),Math.floor(n(lt,ct))),r.every=e=>(e=Math.floor(e),isFinite(e)&&e>0?e>1?r.filter(i?t=>i(t)%e==0:t=>r.count(0,t)%e==0):r:null)),r}const ht=6e4,dt=864e5,ft=6048e5,pt=ut((e=>e.setHours(0,0,0,0)),((e,t)=>e.setDate(e.getDate()+t)),((e,t)=>(t-e-(t.getTimezoneOffset()-e.getTimezoneOffset())*ht)/dt),(e=>e.getDate()-1));pt.range;const mt=ut((e=>{e.setUTCHours(0,0,0,0)}),((e,t)=>{e.setUTCDate(e.getUTCDate()+t)}),((e,t)=>(t-e)/dt),(e=>e.getUTCDate()-1));mt.range;const gt=ut((e=>{e.setUTCHours(0,0,0,0)}),((e,t)=>{e.setUTCDate(e.getUTCDate()+t)}),((e,t)=>(t-e)/dt),(e=>Math.floor(e/dt)));function yt(e){return ut((t=>{t.setDate(t.getDate()-(t.getDay()+7-e)%7),t.setHours(0,0,0,0)}),((e,t)=>{e.setDate(e.getDate()+7*t)}),((e,t)=>(t-e-(t.getTimezoneOffset()-e.getTimezoneOffset())*ht)/ft))}gt.range;const vt=yt(0),bt=yt(1),xt=yt(2),wt=yt(3),qt=yt(4),St=yt(5),Mt=yt(6);function Dt(e){return ut((t=>{t.setUTCDate(t.getUTCDate()-(t.getUTCDay()+7-e)%7),t.setUTCHours(0,0,0,0)}),((e,t)=>{e.setUTCDate(e.getUTCDate()+7*t)}),((e,t)=>(t-e)/ft))}vt.range,bt.range,xt.range,wt.range,qt.range,St.range,Mt.range;const _t=Dt(0),Ct=Dt(1),kt=Dt(2),Et=Dt(3),At=Dt(4),Tt=Dt(5),It=Dt(6);_t.range,Ct.range,kt.range,Et.range,At.range,Tt.range,It.range;const Rt=ut((e=>{e.setMonth(0,1),e.setHours(0,0,0,0)}),((e,t)=>{e.setFullYear(e.getFullYear()+t)}),((e,t)=>t.getFullYear()-e.getFullYear()),(e=>e.getFullYear()));Rt.every=e=>isFinite(e=Math.floor(e))&&e>0?ut((t=>{t.setFullYear(Math.floor(t.getFullYear()/e)*e),t.setMonth(0,1),t.setHours(0,0,0,0)}),((t,n)=>{t.setFullYear(t.getFullYear()+n*e)})):null,Rt.range;const Ot=ut((e=>{e.setUTCMonth(0,1),e.setUTCHours(0,0,0,0)}),((e,t)=>{e.setUTCFullYear(e.getUTCFullYear()+t)}),((e,t)=>t.getUTCFullYear()-e.getUTCFullYear()),(e=>e.getUTCFullYear()));function Nt(e,t){return null==e||null==t?NaN:e<t?-1:e>t?1:e>=t?0:NaN}function Pt(e,t){return null==e||null==t?NaN:t<e?-1:t>e?1:t>=e?0:NaN}function Lt(e){let t,n,i;function r(e,i,r=0,o=e.length){if(r<o){if(0!==t(i,i))return o;do{const t=r+o>>>1;n(e[t],i)<0?r=t+1:o=t}while(r<o)}return r}return 2!==e.length?(t=Nt,n=(t,n)=>Nt(e(t),n),i=(t,n)=>e(t)-n):(t=e===Nt||e===Pt?e:Ft,n=e,i=e),{left:r,center:function(e,t,n=0,o=e.length){const s=r(e,t,n,o-1);return s>n&&i(e[s-1],t)>-i(e[s],t)?s-1:s},right:function(e,i,r=0,o=e.length){if(r<o){if(0!==t(i,i))return o;do{const t=r+o>>>1;n(e[t],i)<=0?r=t+1:o=t}while(r<o)}return r}}}function Ft(){return 0}Ot.every=e=>isFinite(e=Math.floor(e))&&e>0?ut((t=>{t.setUTCFullYear(Math.floor(t.getUTCFullYear()/e)*e),t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0)}),((t,n)=>{t.setUTCFullYear(t.getUTCFullYear()+n*e)})):null,Ot.range;const zt=Lt(Nt).right;Lt((function(e){return null===e?NaN:+e})).center;var jt=zt;class Ht extends Map{constructor(e,t=Vt){if(super(),Object.defineProperties(this,{_intern:{value:new Map},_key:{value:t}}),null!=e)for(const[t,n]of e)this.set(t,n)}get(e){return super.get(Bt(this,e))}has(e){return super.has(Bt(this,e))}set(e,t){return super.set(function({_intern:e,_key:t},n){const i=t(n);return e.has(i)?e.get(i):(e.set(i,n),n)}(this,e),t)}delete(e){return super.delete(function({_intern:e,_key:t},n){const i=t(n);e.has(i)&&(n=e.get(i),e.delete(i));return n}(this,e))}}function Bt({_intern:e,_key:t},n){const i=t(n);return e.has(i)?e.get(i):n}function Vt(e){return null!==e&&"object"==typeof e?e.valueOf():e}const $t=Math.sqrt(50),Wt=Math.sqrt(10),Ut=Math.sqrt(2);function Yt(e,t,n){const i=(t-e)/Math.max(0,n),r=Math.floor(Math.log10(i)),o=i/Math.pow(10,r),s=o>=$t?10:o>=Wt?5:o>=Ut?2:1;let a,l,c;return r<0?(c=Math.pow(10,-r)/s,a=Math.round(e*c),l=Math.round(t*c),a/c<e&&++a,l/c>t&&--l,c=-c):(c=Math.pow(10,r)*s,a=Math.round(e/c),l=Math.round(t/c),a*c<e&&++a,l*c>t&&--l),l<a&&.5<=n&&n<2?Yt(e,t,2*n):[a,l,c]}function Xt(e,t,n){return Yt(e=+e,t=+t,n=+n)[2]}function Kt(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 Gt(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 Jt(e,t,n){return{y:e,m:t,d:n,H:0,M:0,S:0,L:0}}function Zt(e){var t=e.dateTime,n=e.date,i=e.time,r=e.periods,o=e.days,s=e.shortDays,a=e.months,l=e.shortMonths,c=sn(r),u=an(r),h=sn(o),d=an(o),f=sn(s),p=an(s),m=sn(a),g=an(a),y=sn(l),v=an(l),b={a:function(e){return s[e.getDay()]},A:function(e){return o[e.getDay()]},b:function(e){return l[e.getMonth()]},B:function(e){return a[e.getMonth()]},c:null,d:kn,e:kn,f:Rn,g:$n,G:Un,H:En,I:An,j:Tn,L:In,m:On,M:Nn,p:function(e){return r[+(e.getHours()>=12)]},q:function(e){return 1+~~(e.getMonth()/3)},Q:mi,s:gi,S:Pn,u:Ln,U:Fn,V:jn,w:Hn,W:Bn,x:null,X:null,y:Vn,Y:Wn,Z:Yn,"%":pi},x={a:function(e){return s[e.getUTCDay()]},A:function(e){return o[e.getUTCDay()]},b:function(e){return l[e.getUTCMonth()]},B:function(e){return a[e.getUTCMonth()]},c:null,d:Xn,e:Xn,f:Qn,g:ui,G:di,H:Kn,I:Gn,j:Jn,L:Zn,m:ei,M:ti,p:function(e){return r[+(e.getUTCHours()>=12)]},q:function(e){return 1+~~(e.getUTCMonth()/3)},Q:mi,s:gi,S:ni,u:ii,U:ri,V:si,w:ai,W:li,x:null,X:null,y:ci,Y:hi,Z:fi,"%":pi},w={a:function(e,t,n){var i=f.exec(t.slice(n));return i?(e.w=p.get(i[0].toLowerCase()),n+i[0].length):-1},A:function(e,t,n){var i=h.exec(t.slice(n));return i?(e.w=d.get(i[0].toLowerCase()),n+i[0].length):-1},b:function(e,t,n){var i=y.exec(t.slice(n));return i?(e.m=v.get(i[0].toLowerCase()),n+i[0].length):-1},B:function(e,t,n){var i=m.exec(t.slice(n));return i?(e.m=g.get(i[0].toLowerCase()),n+i[0].length):-1},c:function(e,n,i){return M(e,t,n,i)},d:vn,e:vn,f:Mn,g:pn,G:fn,H:xn,I:xn,j:bn,L:Sn,m:yn,M:wn,p:function(e,t,n){var i=c.exec(t.slice(n));return i?(e.p=u.get(i[0].toLowerCase()),n+i[0].length):-1},q:gn,Q:_n,s:Cn,S:qn,u:cn,U:un,V:hn,w:ln,W:dn,x:function(e,t,i){return M(e,n,t,i)},X:function(e,t,n){return M(e,i,t,n)},y:pn,Y:fn,Z:mn,"%":Dn};function q(e,t){return function(n){var i,r,o,s=[],a=-1,l=0,c=e.length;for(n instanceof Date||(n=new Date(+n));++a<c;)37===e.charCodeAt(a)&&(s.push(e.slice(l,a)),null!=(r=Qt[i=e.charAt(++a)])?i=e.charAt(++a):r="e"===i?" ":"0",(o=t[i])&&(i=o(n,r)),s.push(i),l=a+1);return s.push(e.slice(l,a)),s.join("")}}function S(e,t){return function(n){var i,r,o=Jt(1900,void 0,1);if(M(o,e,n+="",0)!=n.length)return null;if("Q"in o)return new Date(o.Q);if("s"in o)return new Date(1e3*o.s+("L"in o?o.L:0));if(t&&!("Z"in o)&&(o.Z=0),"p"in o&&(o.H=o.H%12+12*o.p),void 0===o.m&&(o.m="q"in o?o.q:0),"V"in o){if(o.V<1||o.V>53)return null;"w"in o||(o.w=1),"Z"in o?(r=(i=Gt(Jt(o.y,0,1))).getUTCDay(),i=r>4||0===r?Ct.ceil(i):Ct(i),i=mt.offset(i,7*(o.V-1)),o.y=i.getUTCFullYear(),o.m=i.getUTCMonth(),o.d=i.getUTCDate()+(o.w+6)%7):(r=(i=Kt(Jt(o.y,0,1))).getDay(),i=r>4||0===r?bt.ceil(i):bt(i),i=pt.offset(i,7*(o.V-1)),o.y=i.getFullYear(),o.m=i.getMonth(),o.d=i.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),r="Z"in o?Gt(Jt(o.y,0,1)).getUTCDay():Kt(Jt(o.y,0,1)).getDay(),o.m=0,o.d="W"in o?(o.w+6)%7+7*o.W-(r+5)%7:o.w+7*o.U-(r+6)%7);return"Z"in o?(o.H+=o.Z/100|0,o.M+=o.Z%100,Gt(o)):Kt(o)}}function M(e,t,n,i){for(var r,o,s=0,a=t.length,l=n.length;s<a;){if(i>=l)return-1;if(37===(r=t.charCodeAt(s++))){if(r=t.charAt(s++),!(o=w[r in Qt?t.charAt(s++):r])||(i=o(e,n,i))<0)return-1}else if(r!=n.charCodeAt(i++))return-1}return i}return b.x=q(n,b),b.X=q(i,b),b.c=q(t,b),x.x=q(n,x),x.X=q(i,x),x.c=q(t,x),{format:function(e){var t=q(e+="",b);return t.toString=function(){return e},t},parse:function(e){var t=S(e+="",!1);return t.toString=function(){return e},t},utcFormat:function(e){var t=q(e+="",x);return t.toString=function(){return e},t},utcParse:function(e){var t=S(e+="",!0);return t.toString=function(){return e},t}}}var Qt={"-":"",_:" ",0:"0"},en=/^\s*\d+/,tn=/^%/,nn=/[\\^$*+?|[\]().{}]/g;function rn(e,t,n){var i=e<0?"-":"",r=(i?-e:e)+"",o=r.length;return i+(o<n?new Array(n-o+1).join(t)+r:r)}function on(e){return e.replace(nn,"\\$&")}function sn(e){return new RegExp("^(?:"+e.map(on).join("|")+")","i")}function an(e){return new Map(e.map(((e,t)=>[e.toLowerCase(),t])))}function ln(e,t,n){var i=en.exec(t.slice(n,n+1));return i?(e.w=+i[0],n+i[0].length):-1}function cn(e,t,n){var i=en.exec(t.slice(n,n+1));return i?(e.u=+i[0],n+i[0].length):-1}function un(e,t,n){var i=en.exec(t.slice(n,n+2));return i?(e.U=+i[0],n+i[0].length):-1}function hn(e,t,n){var i=en.exec(t.slice(n,n+2));return i?(e.V=+i[0],n+i[0].length):-1}function dn(e,t,n){var i=en.exec(t.slice(n,n+2));return i?(e.W=+i[0],n+i[0].length):-1}function fn(e,t,n){var i=en.exec(t.slice(n,n+4));return i?(e.y=+i[0],n+i[0].length):-1}function pn(e,t,n){var i=en.exec(t.slice(n,n+2));return i?(e.y=+i[0]+(+i[0]>68?1900:2e3),n+i[0].length):-1}function mn(e,t,n){var i=/^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(t.slice(n,n+6));return i?(e.Z=i[1]?0:-(i[2]+(i[3]||"00")),n+i[0].length):-1}function gn(e,t,n){var i=en.exec(t.slice(n,n+1));return i?(e.q=3*i[0]-3,n+i[0].length):-1}function yn(e,t,n){var i=en.exec(t.slice(n,n+2));return i?(e.m=i[0]-1,n+i[0].length):-1}function vn(e,t,n){var i=en.exec(t.slice(n,n+2));return i?(e.d=+i[0],n+i[0].length):-1}function bn(e,t,n){var i=en.exec(t.slice(n,n+3));return i?(e.m=0,e.d=+i[0],n+i[0].length):-1}function xn(e,t,n){var i=en.exec(t.slice(n,n+2));return i?(e.H=+i[0],n+i[0].length):-1}function wn(e,t,n){var i=en.exec(t.slice(n,n+2));return i?(e.M=+i[0],n+i[0].length):-1}function qn(e,t,n){var i=en.exec(t.slice(n,n+2));return i?(e.S=+i[0],n+i[0].length):-1}function Sn(e,t,n){var i=en.exec(t.slice(n,n+3));return i?(e.L=+i[0],n+i[0].length):-1}function Mn(e,t,n){var i=en.exec(t.slice(n,n+6));return i?(e.L=Math.floor(i[0]/1e3),n+i[0].length):-1}function Dn(e,t,n){var i=tn.exec(t.slice(n,n+1));return i?n+i[0].length:-1}function _n(e,t,n){var i=en.exec(t.slice(n));return i?(e.Q=+i[0],n+i[0].length):-1}function Cn(e,t,n){var i=en.exec(t.slice(n));return i?(e.s=+i[0],n+i[0].length):-1}function kn(e,t){return rn(e.getDate(),t,2)}function En(e,t){return rn(e.getHours(),t,2)}function An(e,t){return rn(e.getHours()%12||12,t,2)}function Tn(e,t){return rn(1+pt.count(Rt(e),e),t,3)}function In(e,t){return rn(e.getMilliseconds(),t,3)}function Rn(e,t){return In(e,t)+"000"}function On(e,t){return rn(e.getMonth()+1,t,2)}function Nn(e,t){return rn(e.getMinutes(),t,2)}function Pn(e,t){return rn(e.getSeconds(),t,2)}function Ln(e){var t=e.getDay();return 0===t?7:t}function Fn(e,t){return rn(vt.count(Rt(e)-1,e),t,2)}function zn(e){var t=e.getDay();return t>=4||0===t?qt(e):qt.ceil(e)}function jn(e,t){return e=zn(e),rn(qt.count(Rt(e),e)+(4===Rt(e).getDay()),t,2)}function Hn(e){return e.getDay()}function Bn(e,t){return rn(bt.count(Rt(e)-1,e),t,2)}function Vn(e,t){return rn(e.getFullYear()%100,t,2)}function $n(e,t){return rn((e=zn(e)).getFullYear()%100,t,2)}function Wn(e,t){return rn(e.getFullYear()%1e4,t,4)}function Un(e,t){var n=e.getDay();return rn((e=n>=4||0===n?qt(e):qt.ceil(e)).getFullYear()%1e4,t,4)}function Yn(e){var t=e.getTimezoneOffset();return(t>0?"-":(t*=-1,"+"))+rn(t/60|0,"0",2)+rn(t%60,"0",2)}function Xn(e,t){return rn(e.getUTCDate(),t,2)}function Kn(e,t){return rn(e.getUTCHours(),t,2)}function Gn(e,t){return rn(e.getUTCHours()%12||12,t,2)}function Jn(e,t){return rn(1+mt.count(Ot(e),e),t,3)}function Zn(e,t){return rn(e.getUTCMilliseconds(),t,3)}function Qn(e,t){return Zn(e,t)+"000"}function ei(e,t){return rn(e.getUTCMonth()+1,t,2)}function ti(e,t){return rn(e.getUTCMinutes(),t,2)}function ni(e,t){return rn(e.getUTCSeconds(),t,2)}function ii(e){var t=e.getUTCDay();return 0===t?7:t}function ri(e,t){return rn(_t.count(Ot(e)-1,e),t,2)}function oi(e){var t=e.getUTCDay();return t>=4||0===t?At(e):At.ceil(e)}function si(e,t){return e=oi(e),rn(At.count(Ot(e),e)+(4===Ot(e).getUTCDay()),t,2)}function ai(e){return e.getUTCDay()}function li(e,t){return rn(Ct.count(Ot(e)-1,e),t,2)}function ci(e,t){return rn(e.getUTCFullYear()%100,t,2)}function ui(e,t){return rn((e=oi(e)).getUTCFullYear()%100,t,2)}function hi(e,t){return rn(e.getUTCFullYear()%1e4,t,4)}function di(e,t){var n=e.getUTCDay();return rn((e=n>=4||0===n?At(e):At.ceil(e)).getUTCFullYear()%1e4,t,4)}function fi(){return"+0000"}function pi(){return"%"}function mi(e){return+e}function gi(e){return Math.floor(+e/1e3)}const yi=Ue();yi("d3-number",(function(e,t,n){let i,r;function o(e){return r(e)}function s(){o.locale({decimal:n||".",thousands:t||",",grouping:[3],currency:["$",""]})}return o.locale=function(t){return i=at(t),r=i.format(e),this},s(),o.format=function(e,r,o,a){return(o||a)&&(t=o,n=a,s()),i.format(e)(r)},o.pattern=function(t){return t&&(e=t,r=i.format(t)),e},o})),yi("d3-time",(function(e){let t=Zt({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"]}),n=t.format(e);function i(e){return n(e)}return i.format=function(e,n){return t.format(e)(n)},i.locale=function(){return t=Zt(...arguments),n=t.format(e),this},i.parse=function(e,n){return t.parse(e)(n)},i.parsePattern=function(e){return t.parse(e)},i}));const vi={id:e=>"".concat(e.source,"/").concat(e.key||e.title),key:e=>String(e.key||e.title),tags:e=>e.tags,min:e=>e.min,max:e=>e.max,type:e=>e.type,title:e=>String(e.title),values:e=>e.values,value:e=>e,label:e=>e,formatter:e=>(e=>{if("function"==typeof e.formatter)return e.formatter();const t=e.formatter||{};return yi(t.type||"d3-number")(t.format||"")})(e)};function bi(e){let{id:t=vi.id,key:n=vi.key,min:i=vi.min,max:r=vi.max,type:o=vi.type,tags:s=vi.tags,title:a=vi.title,values:l=vi.values,value:c=vi.value,label:u=vi.label,formatter:h=vi.formatter}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return{id:()=>t(e),key:()=>n(e),raw:()=>e,tags:()=>s(e),type:()=>o(e),min:()=>i(e),max:()=>r(e),title:()=>a(e),items:()=>l(e),formatter:()=>h(e),value:c,label:u}}const xi=e=>e.filter((e=>"number"==typeof e&&!isNaN(e))),wi=e=>e.reduce(((e,t)=>e+t),0),qi={first:e=>e[0],last:e=>e[e.length-1],min:e=>{const t=xi(e);return t.length?Math.min.apply(null,t):NaN},max:e=>{const t=xi(e);return t.length?Math.max.apply(null,t):NaN},sum:e=>{const t=xi(e);return t.length?t.reduce(((e,t)=>e+t),0):NaN},avg:e=>{const t=xi(e),n=t.length;return n?wi(t)/n:NaN}};function Si(e,t,n,i){const r={},o=i.field||(void 0!==e.field?t.field(e.field):null);return Object.keys(n).forEach((s=>{const a=n[s],l=r[s]={};-1!==["number","string","boolean"].indexOf(typeof a)?(l.type="primitive",l.value=a):"function"==typeof a?(l.type="function",l.value=a,l.label=a,l.field=o):"object"==typeof a&&(a.fields?l.fields=a.fields.map((n=>Si(e,t,{main:n},i).main)):void 0!==a.field?(l.type="field",l.field=t.field(a.field),l.value=l.field.value,l.label=l.field.label):o&&(l.value=o.value,l.label=o.label,l.field=o),"function"==typeof a.filter&&(l.filter=a.filter),void 0!==a.value&&(l.value=a.value),void 0!==a.label&&(l.label=a.label),"function"==typeof a.reduce?l.reduce=a.reduce:a.reduce?l.reduce=qi[a.reduce]:l.field&&l.field.reduce&&(l.reduce="string"==typeof l.field.reduce?qi[l.field.reduce]:l.field.reduce),"function"==typeof a.reduceLabel?l.reduceLabel=a.reduceLabel:a.reduceLabel?l.reduceLabel=qi[a.reduceLabel]:l.field&&l.field.reduceLabel&&(l.reduceLabel="string"==typeof l.field.reduceLabel?qi[l.field.reduceLabel]:l.field.reduceLabel))})),r}function Mi(e,t){const{main:n}=Si(e,t,{main:{value:e.value,label:e.label,reduce:e.reduce,filter:e.filter}},{});return{props:Si(e,t,e.props||{},n),main:n}}function Di(e,t,n,i){const r=Array(e.length),o=Array(e.length);let s;for(let t=0;t<e.length;t++)s=i?e[t][i]:e[t],r[t]=s.value,o[t]=s.label;const a=t.reduce,l=t.reduceLabel,c=a?a(r):r,u={value:c,label:l?l(o,c):n?n(c):String(c)};return i&&e[0][i].source?(u.source=e[0][i].source,u):!i&&e[0].source?(u.source=e[0].source,u):u}function _i(e,t){let{main:n,propsArr:i,props:r}=t,o=[];const s=n.field.formatter(),a={};return i.forEach((e=>{a[e]=r[e].field?r[e].field.formatter():e=>e})),o.push(...e.map((e=>{const t=Di(e.items,n,s);return i.forEach((n=>{t[n]=Di(e.items,r[n],a[n],n)})),t}))),o}function Ci(e){let{cfg:t,itemData:n,obj:i,target:r,tracker:o,trackType:s}=e;const a="function"===s?t.trackBy(n):n[t.trackBy];let l=o[a];l||(l=o[a]={items:[],id:a},r.push(l)),l.items.push(i)}const ki=1e4;function Ei(e){if(e.length<ki)return Math.max(...e);let t=-1/0;const n=e.length;for(let i=0;i<n;i++)t<e[i]&&(t=e[i]);return t}function Ai(e){if(e.length<ki)return Math.min(...e);let t=1/0;const n=e.length;for(let i=0;i<n;i++)t>e[i]&&(t=e[i]);return t}const Ti={diverging:function(e,t){if((a=e.length)>0)for(var n,i,r,o,s,a,l=0,c=e[t[0]].length;l<c;++l)for(o=s=0,n=0;n<a;++n)(r=(i=e[t[n]][l])[1]-i[0])>=0?(i[0]=o,i[1]=o+=r):r<0?(i[1]=s,i[0]=s+=r):i[0]=o},none:He,silhouette:function(e,t){if((n=e.length)>0){for(var n,i=0,r=e[t[0]],o=r.length;i<o;++i){for(var s=0,a=0;s<n;++s)a+=e[s][i][1]||0;r[i][1]+=r[i][0]=-a/2}He(e,t)}},expand:function(e,t){if((i=e.length)>0){for(var n,i,r,o=0,s=e[0].length;o<s;++o){for(r=n=0;n<i;++n)r+=e[n][o][1]||0;if(r)for(n=0;n<i;++n)e[n][o][1]/=r}He(e,t)}},wiggle:function(e,t){if((r=e.length)>0&&(i=(n=e[t[0]]).length)>0){for(var n,i,r,o=0,s=1;s<i;++s){for(var a=0,l=0,c=0;a<r;++a){for(var u=e[t[a]],h=u[s][1]||0,d=(h-(u[s-1][1]||0))/2,f=0;f<a;++f){var p=e[t[f]];d+=(p[s][1]||0)-(p[s-1][1]||0)}l+=h,c+=d*h}n[s-1][1]+=n[s-1][0]=o,l&&(o-=c/l)}n[s-1][1]+=n[s-1][0]=o,He(e,t)}}},Ii={ascending:function(e){var t=e.map(We);return Be(e).sort((function(e,n){return t[e]-t[n]}))},insideout:function(e){var t,n,i=e.length,r=e.map(We),o=function(e){var t=e.map($e);return Be(e).sort((function(e,n){return t[e]-t[n]}))}(e),s=0,a=0,l=[],c=[];for(t=0;t<i;++t)n=o[t],s<a?(s+=r[n],l.push(n)):(a+=r[n],c.push(n));return c.reverse().concat(l)},none:Be,reverse:function(e){return Be(e).reverse()}};function Ri(e,t,n){const i={},r=t.stackKey,o=t.value,s=t.startProp||"start",a=t.endProp||"end",l=t.offset||"none",c=t.order||"none",u=t.valueRef||"";let h=0,d={};for(let t=0;t<e.items.length;t++){let n=e.items[t],o=u?n[u]:null;if(o&&o.source){let e="".concat(o.source.key||"","/").concat(o.source.field);d[e]||(d[e]=o.source)}let s=r(n);i[s]=i[s]||{items:[]},i[s].items.push(n),h=Math.max(h,i[s].items.length)}const f=Array.apply(null,{length:h}).map(Number.call,Number),p=Object.keys(i).map((e=>i[e].items)),m=function(){var e=G([]),t=Be,n=He,i=Ve;function r(r){var o,s,a=e.apply(this,arguments),l=r.length,c=a.length,u=new Array(c);for(o=0;o<c;++o){for(var h,d=a[o],f=u[o]=new Array(l),p=0;p<l;++p)f[p]=h=[0,+i(r[p],d,p,r)],h.data=r[p];f.key=d}for(o=0,s=t(u);o<c;++o)u[s[o]].index=o;return n(u,s),u}return r.keys=function(t){return arguments.length?(e="function"==typeof t?t:G(Se.call(t)),r):e},r.value=function(e){return arguments.length?(i="function"==typeof e?e:G(+e),r):i},r.order=function(e){return arguments.length?(t=null==e?Be:"function"==typeof e?e:G(Se.call(e)),r):t},r.offset=function(e){return arguments.length?(n=null==e?He:e,r):n},r}().keys(f).value(((e,t)=>e[t]?o(e[t]):0)).order(Ii[c]).offset(Ti[l]);let g=m(p),y=[];for(let e=0;e<g.length;e++){let t=g[e];for(let e=0;e<t.length;e++){let n=t[e],i=t[e].data[t.key];i&&(i[s]={value:n[0]},i[a]={value:n[1]},y.push(n[0],n[1]))}}let v=Object.keys(d).map((e=>{let t=n(d[e].key);return t?t.field(d[e].field):null})).filter((e=>!!e));const b=bi({title:v.map((e=>e.title())).join(", "),min:Ai(y),max:Ei(y),type:"measure",formatter:v[0]?v[0].formatter:void 0});e.fields.push(b)}function Oi(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n={};const i=(arguments.length>2&&void 0!==arguments[2]?arguments[2]:{}).logger;if(Array.isArray(e))n.items=e.map((e=>({value:e,label:String(e)})));else if(e){if("collection"in e)n=I({},t.collection(e.collection));else{const r=t.dataset?t.dataset(e.source):null;let o=e.value||(e=>e),s=e.label||(e=>e);if(e.groupBy||e.mapTo)i.warn('Deprecated "data" configuration',e),n.items=[];else if(e.hierarchy)n.root=r.hierarchy?r.hierarchy(e.hierarchy):null,n.fields=r.fields();else if(e.items)n.items=e.items.map((e=>({value:o(e),label:String(s(e))})));else if(e.extract){const i=Array.isArray(e.extract)?e.extract:[e.extract];n.items=[];const o=[];i.forEach((e=>{const i=e.source?t.dataset(e.source):r;i&&(n.items=[...n.items,...i.extract(e)],void 0!==e.field&&o.push(i.field(e.field)))})),o.length&&(n.fields=o),e.amend&&Array.isArray(e.amend)&&(n.items=[...n.items,...e.amend])}else if(void 0!==e.field&&r){const t=r.field(e.field);t&&(n.fields||(n.fields=[]),n.fields.push(t),"value"in e||(o=t.value||(e=>e),s=t.label||(e=>e),n.value=o),n.items=t.items().map((t=>({value:o(t),label:String(s(t)),source:{field:e.field}}))))}else e.fields&&e.fields.forEach((e=>{const i="object"==typeof e&&e.source?t.dataset(e.source):r;if(!i)return;let o;o="object"==typeof e&&void 0!==e.field?i.field(e.field):i.field(e),o&&(n.fields||(n.fields=[]),n.fields.push(o))}));n.items&&e.map&&(n.items=n.items.map(e.map))}e&&e.stack&&Ri(n,e.stack,t.dataset)}return e&&!Array.isArray(e)&&"function"==typeof e.filter&&n.items&&(n.items=n.items.filter(e.filter)),e&&!Array.isArray(e)&&"function"==typeof e.sort&&n.items&&(n.items=n.items.sort(e.sort)),n}function Ni(e,t,n){let i,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:Oi;if(e.data){const i=r(e.data,t,n);if(i&&i.fields&&i.fields[0])return i.fields[0].formatter()}if(i=e.formatter?"".concat(e.formatter,"-").concat(e.type||"number"):e.type||"d3-number",n.formatter.has(i)){return n.formatter.get(i)(e.format||"")}throw new Error("Formatter of type '".concat(i,"' was not found"))}function Pi(e,t){switch(arguments.length){case 0:break;case 1:this.range(e);break;default:this.range(t).domain(e)}return this}const Li=Symbol("implicit");function Fi(){var e=new Ht,t=[],n=[],i=Li;function r(r){let o=e.get(r);if(void 0===o){if(i!==Li)return i;e.set(r,o=t.push(r)-1)}return n[o%n.length]}return r.domain=function(n){if(!arguments.length)return t.slice();t=[],e=new Ht;for(const i of n)e.has(i)||e.set(i,t.push(i)-1);return r},r.range=function(e){return arguments.length?(n=Array.from(e),r):n.slice()},r.unknown=function(e){return arguments.length?(i=e,r):i},r.copy=function(){return Fi(t,n).unknown(i)},Pi.apply(r,arguments),r}function zi(){var e,t,n=Fi().unknown(void 0),i=n.domain,r=n.range,o=0,s=1,a=!1,l=0,c=0,u=.5;function h(){var n=i().length,h=s<o,d=h?s:o,f=h?o:s;e=(f-d)/Math.max(1,n-l+2*c),a&&(e=Math.floor(e)),d+=(f-d-e*(n-l))*u,t=e*(1-l),a&&(d=Math.round(d),t=Math.round(t));var p=function(e,t,n){e=+e,t=+t,n=(r=arguments.length)<2?(t=e,e=0,1):r<3?1:+n;for(var i=-1,r=0|Math.max(0,Math.ceil((t-e)/n)),o=new Array(r);++i<r;)o[i]=e+i*n;return o}(n).map((function(t){return d+e*t}));return r(h?p.reverse():p)}return delete n.unknown,n.domain=function(e){return arguments.length?(i(e),h()):i()},n.range=function(e){return arguments.length?([o,s]=e,o=+o,s=+s,h()):[o,s]},n.rangeRound=function(e){return[o,s]=e,o=+o,s=+s,a=!0,h()},n.bandwidth=function(){return t},n.step=function(){return e},n.round=function(e){return arguments.length?(a=!!e,h()):a},n.padding=function(e){return arguments.length?(l=Math.min(1,c=+e),h()):l},n.paddingInner=function(e){return arguments.length?(l=Math.min(1,e),h()):l},n.paddingOuter=function(e){return arguments.length?(c=+e,h()):c},n.align=function(e){return arguments.length?(u=Math.max(0,Math.min(1,e)),h()):u},n.copy=function(){return zi(i(),[o,s]).round(a).paddingInner(l).paddingOuter(c).align(u)},Pi.apply(h(),arguments)}function ji(e,t,n){e.prototype=t.prototype=n,n.constructor=e}function Hi(e,t){var n=Object.create(e.prototype);for(var i in t)n[i]=t[i];return n}function Bi(){}var Vi=.7,$i=1/Vi,Wi="\\s*([+-]?\\d+)\\s*",Ui="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",Yi="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",Xi=/^#([0-9a-f]{3,8})$/,Ki=new RegExp(`^rgb\\(${Wi},${Wi},${Wi}\\)$`),Gi=new RegExp(`^rgb\\(${Yi},${Yi},${Yi}\\)$`),Ji=new RegExp(`^rgba\\(${Wi},${Wi},${Wi},${Ui}\\)$`),Zi=new RegExp(`^rgba\\(${Yi},${Yi},${Yi},${Ui}\\)$`),Qi=new RegExp(`^hsl\\(${Ui},${Yi},${Yi}\\)$`),er=new RegExp(`^hsla\\(${Ui},${Yi},${Yi},${Ui}\\)$`),tr={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 nr(){return this.rgb().formatHex()}function ir(){return this.rgb().formatRgb()}function rr(e){var t,n;return e=(e+"").trim().toLowerCase(),(t=Xi.exec(e))?(n=t[1].length,t=parseInt(t[1],16),6===n?or(t):3===n?new lr(t>>8&15|t>>4&240,t>>4&15|240&t,(15&t)<<4|15&t,1):8===n?sr(t>>24&255,t>>16&255,t>>8&255,(255&t)/255):4===n?sr(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=Ki.exec(e))?new lr(t[1],t[2],t[3],1):(t=Gi.exec(e))?new lr(255*t[1]/100,255*t[2]/100,255*t[3]/100,1):(t=Ji.exec(e))?sr(t[1],t[2],t[3],t[4]):(t=Zi.exec(e))?sr(255*t[1]/100,255*t[2]/100,255*t[3]/100,t[4]):(t=Qi.exec(e))?pr(t[1],t[2]/100,t[3]/100,1):(t=er.exec(e))?pr(t[1],t[2]/100,t[3]/100,t[4]):tr.hasOwnProperty(e)?or(tr[e]):"transparent"===e?new lr(NaN,NaN,NaN,0):null}function or(e){return new lr(e>>16&255,e>>8&255,255&e,1)}function sr(e,t,n,i){return i<=0&&(e=t=n=NaN),new lr(e,t,n,i)}function ar(e,t,n,i){return 1===arguments.length?function(e){return e instanceof Bi||(e=rr(e)),e?new lr((e=e.rgb()).r,e.g,e.b,e.opacity):new lr}(e):new lr(e,t,n,null==i?1:i)}function lr(e,t,n,i){this.r=+e,this.g=+t,this.b=+n,this.opacity=+i}function cr(){return`#${fr(this.r)}${fr(this.g)}${fr(this.b)}`}function ur(){const e=hr(this.opacity);return`${1===e?"rgb(":"rgba("}${dr(this.r)}, ${dr(this.g)}, ${dr(this.b)}${1===e?")":`, ${e})`}`}function hr(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function dr(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function fr(e){return((e=dr(e))<16?"0":"")+e.toString(16)}function pr(e,t,n,i){return i<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new gr(e,t,n,i)}function mr(e){if(e instanceof gr)return new gr(e.h,e.s,e.l,e.opacity);if(e instanceof Bi||(e=rr(e)),!e)return new gr;if(e instanceof gr)return e;var t=(e=e.rgb()).r/255,n=e.g/255,i=e.b/255,r=Math.min(t,n,i),o=Math.max(t,n,i),s=NaN,a=o-r,l=(o+r)/2;return a?(s=t===o?(n-i)/a+6*(n<i):n===o?(i-t)/a+2:(t-n)/a+4,a/=l<.5?o+r:2-o-r,s*=60):a=l>0&&l<1?0:s,new gr(s,a,l,e.opacity)}function gr(e,t,n,i){this.h=+e,this.s=+t,this.l=+n,this.opacity=+i}function yr(e){return(e=(e||0)%360)<0?e+360:e}function vr(e){return Math.max(0,Math.min(1,e||0))}function br(e,t,n){return 255*(e<60?t+(n-t)*e/60:e<180?n:e<240?t+(n-t)*(240-e)/60:t)}ji(Bi,rr,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:nr,formatHex:nr,formatHex8:function(){return this.rgb().formatHex8()},formatHsl:function(){return mr(this).formatHsl()},formatRgb:ir,toString:ir}),ji(lr,ar,Hi(Bi,{brighter(e){return e=null==e?$i:Math.pow($i,e),new lr(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=null==e?Vi:Math.pow(Vi,e),new lr(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new lr(dr(this.r),dr(this.g),dr(this.b),hr(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:cr,formatHex:cr,formatHex8:function(){return`#${fr(this.r)}${fr(this.g)}${fr(this.b)}${fr(255*(isNaN(this.opacity)?1:this.opacity))}`},formatRgb:ur,toString:ur})),ji(gr,(function(e,t,n,i){return 1===arguments.length?mr(e):new gr(e,t,n,null==i?1:i)}),Hi(Bi,{brighter(e){return e=null==e?$i:Math.pow($i,e),new gr(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=null==e?Vi:Math.pow(Vi,e),new gr(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=this.h%360+360*(this.h<0),t=isNaN(e)||isNaN(this.s)?0:this.s,n=this.l,i=n+(n<.5?n:1-n)*t,r=2*n-i;return new lr(br(e>=240?e-240:e+120,r,i),br(e,r,i),br(e<120?e+240:e-120,r,i),this.opacity)},clamp(){return new gr(yr(this.h),vr(this.s),vr(this.l),hr(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){const e=hr(this.opacity);return`${1===e?"hsl(":"hsla("}${yr(this.h)}, ${100*vr(this.s)}%, ${100*vr(this.l)}%${1===e?")":`, ${e})`}`}}));var xr=e=>()=>e;function wr(e){return 1==(e=+e)?qr:function(t,n){return n-t?function(e,t,n){return e=Math.pow(e,n),t=Math.pow(t,n)-e,n=1/n,function(i){return Math.pow(e+i*t,n)}}(t,n,e):xr(isNaN(t)?n:t)}}function qr(e,t){var n=t-e;return n?function(e,t){return function(n){return e+n*t}}(e,n):xr(isNaN(e)?t:e)}var Sr=function e(t){var n=wr(t);function i(e,t){var i=n((e=ar(e)).r,(t=ar(t)).r),r=n(e.g,t.g),o=n(e.b,t.b),s=qr(e.opacity,t.opacity);return function(t){return e.r=i(t),e.g=r(t),e.b=o(t),e.opacity=s(t),e+""}}return i.gamma=e,i}(1);function Mr(e,t){t||(t=[]);var n,i=e?Math.min(t.length,e.length):0,r=t.slice();return function(o){for(n=0;n<i;++n)r[n]=e[n]*(1-o)+t[n]*o;return r}}function Dr(e,t){var n,i=t?t.length:0,r=e?Math.min(i,e.length):0,o=new Array(r),s=new Array(i);for(n=0;n<r;++n)o[n]=Ir(e[n],t[n]);for(;n<i;++n)s[n]=t[n];return function(e){for(n=0;n<r;++n)s[n]=o[n](e);return s}}function _r(e,t){var n=new Date;return e=+e,t=+t,function(i){return n.setTime(e*(1-i)+t*i),n}}function Cr(e,t){return e=+e,t=+t,function(n){return e*(1-n)+t*n}}function kr(e,t){var n,i={},r={};for(n in null!==e&&"object"==typeof e||(e={}),null!==t&&"object"==typeof t||(t={}),t)n in e?i[n]=Ir(e[n],t[n]):r[n]=t[n];return function(e){for(n in i)r[n]=i[n](e);return r}}var Er=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,Ar=new RegExp(Er.source,"g");function Tr(e,t){var n,i,r,o=Er.lastIndex=Ar.lastIndex=0,s=-1,a=[],l=[];for(e+="",t+="";(n=Er.exec(e))&&(i=Ar.exec(t));)(r=i.index)>o&&(r=t.slice(o,r),a[s]?a[s]+=r:a[++s]=r),(n=n[0])===(i=i[0])?a[s]?a[s]+=i:a[++s]=i:(a[++s]=null,l.push({i:s,x:Cr(n,i)})),o=Ar.lastIndex;return o<t.length&&(r=t.slice(o),a[s]?a[s]+=r:a[++s]=r),a.length<2?l[0]?function(e){return function(t){return e(t)+""}}(l[0].x):function(e){return function(){return e}}(t):(t=l.length,function(e){for(var n,i=0;i<t;++i)a[(n=l[i]).i]=n.x(e);return a.join("")})}function Ir(e,t){var n,i=typeof t;return null==t||"boolean"===i?xr(t):("number"===i?Cr:"string"===i?(n=rr(t))?(t=n,Sr):Tr:t instanceof rr?Sr:t instanceof Date?_r:function(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}(t)?Mr:Array.isArray(t)?Dr:"function"!=typeof t.valueOf&&"function"!=typeof t.toString||isNaN(t)?kr:Cr)(e,t)}function Rr(e,t){return e=+e,t=+t,function(n){return Math.round(e*(1-n)+t*n)}}function Or(e){return+e}var Nr=[0,1];function Pr(e){return e}function Lr(e,t){return(t-=e=+e)?function(n){return(n-e)/t}:function(e){return function(){return e}}(isNaN(t)?NaN:.5)}function Fr(e,t,n){var i=e[0],r=e[1],o=t[0],s=t[1];return r<i?(i=Lr(r,i),o=n(s,o)):(i=Lr(i,r),o=n(o,s)),function(e){return o(i(e))}}function zr(e,t,n){var i=Math.min(e.length,t.length)-1,r=new Array(i),o=new Array(i),s=-1;for(e[i]<e[0]&&(e=e.slice().reverse(),t=t.slice().reverse());++s<i;)r[s]=Lr(e[s],e[s+1]),o[s]=n(t[s],t[s+1]);return function(t){var n=jt(e,t,1,i)-1;return o[n](r[n](t))}}function jr(){var e,t,n,i,r,o,s=Nr,a=Nr,l=Ir,c=Pr;function u(){var e=Math.min(s.length,a.length);return c!==Pr&&(c=function(e,t){var n;return e>t&&(n=e,e=t,t=n),function(n){return Math.max(e,Math.min(t,n))}}(s[0],s[e-1])),i=e>2?zr:Fr,r=o=null,h}function h(t){return null==t||isNaN(t=+t)?n:(r||(r=i(s.map(e),a,l)))(e(c(t)))}return h.invert=function(n){return c(t((o||(o=i(a,s.map(e),Cr)))(n)))},h.domain=function(e){return arguments.length?(s=Array.from(e,Or),u()):s.slice()},h.range=function(e){return arguments.length?(a=Array.from(e),u()):a.slice()},h.rangeRound=function(e){return a=Array.from(e),l=Rr,u()},h.clamp=function(e){return arguments.length?(c=!!e||Pr,u()):c!==Pr},h.interpolate=function(e){return arguments.length?(l=e,u()):l},h.unknown=function(e){return arguments.length?(n=e,h):n},function(n,i){return e=n,t=i,u()}}function Hr(e,t,n,i){var r,o=function(e,t,n){n=+n;const i=(t=+t)<(e=+e),r=i?Xt(t,e,n):Xt(e,t,n);return(i?-1:1)*(r<0?1/-r:r)}(e,t,n);switch((i=Je(null==i?",f":i)).type){case"s":var s=Math.max(Math.abs(e),Math.abs(t));return null!=i.precision||isNaN(r=function(e,t){return Math.max(0,3*Math.max(-8,Math.min(8,Math.floor(Xe(t)/3)))-Xe(Math.abs(e)))}(o,s))||(i.precision=r),rt(i,s);case"":case"e":case"g":case"p":case"r":null!=i.precision||isNaN(r=function(e,t){return e=Math.abs(e),t=Math.abs(t)-e,Math.max(0,Xe(t)-Xe(e))+1}(o,Math.max(Math.abs(e),Math.abs(t))))||(i.precision=r-("e"===i.type));break;case"f":case"%":null!=i.precision||isNaN(r=function(e){return Math.max(0,-Xe(Math.abs(e)))}(o))||(i.precision=r-2*("%"===i.type))}return it(i)}function Br(e){var t=e.domain;return e.ticks=function(e){var n=t();return function(e,t,n){if(!((n=+n)>0))return[];if((e=+e)==(t=+t))return[e];const i=t<e,[r,o,s]=i?Yt(t,e,n):Yt(e,t,n);if(!(o>=r))return[];const a=o-r+1,l=new Array(a);if(i)if(s<0)for(let e=0;e<a;++e)l[e]=(o-e)/-s;else for(let e=0;e<a;++e)l[e]=(o-e)*s;else if(s<0)for(let e=0;e<a;++e)l[e]=(r+e)/-s;else for(let e=0;e<a;++e)l[e]=(r+e)*s;return l}(n[0],n[n.length-1],null==e?10:e)},e.tickFormat=function(e,n){var i=t();return Hr(i[0],i[i.length-1],null==e?10:e,n)},e.nice=function(n){null==n&&(n=10);var i,r,o=t(),s=0,a=o.length-1,l=o[s],c=o[a],u=10;for(c<l&&(r=l,l=c,c=r,r=s,s=a,a=r);u-- >0;){if((r=Xt(l,c,n))===i)return o[s]=l,o[a]=c,t(o);if(r>0)l=Math.floor(l/r)*r,c=Math.ceil(c/r)*r;else{if(!(r<0))break;l=Math.ceil(l*r)/r,c=Math.floor(c*r)/r}i=r}return e},e}function Vr(){var e=jr()(Pr,Pr);return e.copy=function(){return t=e,Vr().domain(t.domain()).range(t.range()).interpolate(t.interpolate()).clamp(t.clamp()).unknown(t.unknown());var t},Pi.apply(e,arguments),Br(e)}function $r(){var e,t=[.5],n=[0,1],i=1;function r(r){return null!=r&&r<=r?n[jt(t,r,0,i)]:e}return r.domain=function(e){return arguments.length?(t=Array.from(e),i=Math.min(t.length,n.length-1),r):t.slice()},r.range=function(e){return arguments.length?(n=Array.from(e),i=Math.min(t.length,n.length-1),r):n.slice()},r.invertExtent=function(e){var i=n.indexOf(e);return[t[i-1],t[i]]},r.unknown=function(t){return arguments.length?(e=t,r):e},r.copy=function(){return $r().domain(t).range(n).unknown(e)},Pi.apply(r,arguments)}function Wr(e){return void 0===e?e=>e:t=>e(t)}function Ur(e){return Math.max(0,Math.min(1,e))}function Yr(e){return"object"==typeof e}function Xr(e,t,n){const i=Math.abs(t-n)/(e+1),r=[];for(let o=1;o<=e;o++){const e=o*i;r.push(t<n?t+e:t-e)}return r}function Kr(e,t,n){if(1===e.length)return e;const i=e.concat([]);for(let r=0;r<e.length;r++){let o=e[r],s=e[r+1];0===r&&o!==n.start()?(i.push(...Xr(t,o,s)),o-=s-o,s=e[r],i.push(...Xr(t,o,s))):r===e.length-1&&s!==n.end()?(s=o+(o-e[r-1]),i.push(...Xr(t,o,s))):i.push(...Xr(t,o,s))}return i.filter((e=>e>=n.min()&&e<=n.max()))}function Gr(e){let{distance:t,scale:n,minorCount:i=0,unitDivider:r=100,formatter:o}=e;const s=P(r)||P(t)?2:Math.max(t/r,2),a=Math.min(1e3,Math.round(s));let l=n.ticks(a);l.length<=1&&(l=n.ticks(a+1));const c=i>0?Kr(l,i,n):l;c.sort(((e,t)=>e-t));const u=c.map(Wr(o));return c.map(((e,t)=>{const i=n(e);return{position:i,start:i,end:i,label:u[t],value:e,isMinor:-1===l.indexOf(e)}}))}function Jr(e){let{distance:t,scale:n,minorCount:i=0,unitDivider:r=100,formatter:o}=e;const s=P(r)||P(t)?2:Math.max(t/r,2),a=Math.min(1e3,Math.round(s)),l=a>10?10:a;n.nice(l);const c=n.ticks(a),u=i>0?Kr(c,i,n):c;u.sort(((e,t)=>e-t));const h=u.map(Wr(o));return u.map(((e,t)=>{const i=n(e);return{position:i,start:i,end:i,label:h[t],value:e,isMinor:-1===c.indexOf(e)}}))}function Zr(e){let t,{settings:n,scale:i,distance:r,formatter:o=(e=>e)}=e;const s=n.minorTicks&&!P(n.minorTicks.count)?Math.min(100,n.minorTicks.count):0;if(Array.isArray(n.ticks.values)){const e=n.ticks.values.filter((e=>"object"==typeof e?!P(e.value):!P(e)));t=function(e){let{values:t,scale:n,formatter:i=(e=>e)}=e;return t.sort(((e,t)=>(Yr(e)?e.value:e)-(Yr(t)?t.value:t))).filter(((e,t,i)=>{const r=Yr(e)?e.value:e;return r<=n.max()&&r>=n.min()&&i.indexOf(e)===t})).map((e=>{const t=Yr(e),r=t?e.value:e,o=n(r);return{position:o,value:r,label:t&&void 0!==e.label?e.label:i(r),isMinor:!!t&&!!e.isMinor,start:t&&!isNaN(e.start)?Ur(n(e.start)):o,end:t&&!isNaN(e.end)?Ur(n(e.end)):o}}))}({values:e,scale:i.copy(),formatter:o})}else if(P(n.ticks.count)){t=(n.ticks.tight?Jr:Gr)({distance:r,minorCount:s,unitDivider:n.ticks.distance,scale:i,formatter:o}),n.ticks.forceBounds&&function(e,t,n){const i=e.map((e=>e.position)),r=t.range();-1===i.indexOf(r[0])?e.splice(0,0,{position:r[0],start:r[0],end:r[0],label:n(t.start()),isMinor:!1,value:t.start()}):e[0]&&e[0].isMinor&&(e[0].isMinor=!1);const o=e[e.length-1];-1===i.indexOf(r[1])?e.push({position:r[1],start:r[1],end:r[1],label:n(t.end()),isMinor:!1,value:t.end()}):o&&o.isMinor&&(o.isMinor=!1)}(t,i,o)}else{t=function(e){let{count:t,minorCount:n,scale:i,formatter:r}=e;return i.ticks((t-1)*n+t).map(((e,t)=>{const o=i(e);return{position:o,start:o,end:o,label:r(e),isMinor:t%(n+1)!=0,value:e}}))}({count:Math.min(1e3,n.ticks.count),minorCount:s,scale:i.copy(),formatter:o})}return t}function Qr(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const i={};return Object.keys(t).forEach((r=>{const o=typeof e[r];i[r]="function"===o?e[r](n):"undefined"===o?t[r]:e[r]})),i}const eo={min:NaN,max:NaN,expand:NaN,include:[],invert:!1},to={tight:!1,forceBounds:!1,values:void 0,count:NaN,distance:100},no={count:NaN};function io(e,t){e.instance||(e.instance=t.copy(),e.instance.domain([t.start(),t.end()]),e.instance.clamp(!0),e.instance.range(e.invert?[1,0]:[0,1]))}function ro(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const i=Vr(),r={instance:null,invert:!1},o={data:t,resources:n},s=Qr(e,eo,o);let a;function l(e){return P(e)?NaN:i(e)}s.ticks=Qr(e.ticks,to,o),s.minorTicks=Qr(e.minorTicks,no,o),l.data=()=>t,l.invert=function(e){return i.invert(e)},l.rangeRound=function(e){return i.rangeRound(e),l},l.clamp=function(){let e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];return i.clamp(e),l},l.cachedTicks=function(){return a},l.clearTicksCache=function(){return a=void 0,this},l.ticks=function(e){return null!==e&&"object"==typeof e?(e.settings=e.settings||{},e.settings=E(!0,{},s,e.settings),e.scale=l,a=Zr(e),a):(a=i.ticks(e),a)},l.nice=function(e){return i.nice(e),l},l.tickFormat=function(e,t){return i.tickFormat(e,t)},l.interpolate=function(e){return i.interpolate(e),l},l.domain=function(e){return arguments.length?(i.domain(e),r.instance&&r.instance.domain([l.start(),l.end()]),l):i.domain()},l.range=function(e){return arguments.length?(i.range(e),l):i.range()},l.start=function(){return l.domain()[0]},l.end=function(){return l.domain()[this.domain().length-1]},l.min=function(){return Math.min(this.start(),this.end())},l.max=function(){return Math.max(this.start(),this.end())},l.classify=function(e){let t=(l.start()-l.end())/e,n=[l.end()],i=[],r=t/2;for(let o=0;o<e;o++){let e=n[n.length-1]||0,o=e+t,s=l(e+r);n.push(o,o),i.push(s,s)}return n.pop(),l.domain(n),l.range(i),l},l.copy=function(){const r=ro(e,t,n);return r.domain(l.domain()),r.range(l.range()),r.clamp(i.clamp()),r},l.norm=function(e){return io(r,l),r.instance(e)},l.normInvert=function(e){return io(r,l),r.instance.invert(e)};const{mini:c,maxi:u}=function(e,t){const n=+e.min,i=+e.max;let r=0,o=1;if(t&&t[0]){const n=t.map((e=>e.min())).filter((e=>!isNaN(e))),i=t.map((e=>e.max())).filter((e=>!isNaN(e)));if(r=n.length?Math.min(...n):Number.NaN,o=i.length?Math.max(...i):Number.NaN,isNaN(r)||isNaN(o))r=-1,o=1;else if(r===o&&0===r)r=-1,o=1;else if(r===o&&r)r-=Math.abs(.1*r),o+=Math.abs(.1*o);else if(!isNaN(e.expand)){const t=o-r;r-=t*e.expand,o+=t*e.expand}if(Array.isArray(e.include)){const t=e.include.filter((e=>!isNaN(e)));r=Math.min(...t,r),o=Math.max(...t,o)}}return{mini:isNaN(n)?r:n,maxi:isNaN(i)?o:i}}(s,t?t.fields:[]);return l.domain([c,u]),l.range(s.invert?[1,0]:[0,1]),r.invert=s.invert,l}const oo={padding:0,paddingInner:NaN,paddingOuter:NaN,align:.5,invert:!1,maxPxStep:NaN,range:[0,1]};function so(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const n={data:t,resources:arguments.length>2&&void 0!==arguments[2]?arguments[2]:{}},i=Qr(e,oo,n),r=t.items||[],o={},s=[],a=[];function l(e,n){e.data=()=>t,e.datum=e=>r[o[e]],e.start=function(){return e.domain()[0]},e.end=function(){return e.domain()[e.domain().length-1]},e.labels=()=>a,e.ticks=function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return t.scale=e,function(e){let{scale:t}=e;const n=t.domain(),i=t.data().items,r=t.labels?t.labels():n,o=t.bandwidth();return n.map(((e,n)=>{const s=t(e);return{position:s+o/2,label:"".concat(r[n]),data:i?i[n]:void 0,start:s,end:s+o}}))}(t,n.trackBy)}}const c=zi();l(c,e),c.pxScale=function(t){const n=i.maxPxStep;if(isNaN(n))return c;const r=c.domain().length,o=Math.max(1,r-c.paddingInner()+2*c.paddingOuter());if(o*n>=t)return c;const s=c.copy();s.type=c.type,l(s,e);const a=o*n/t,u=(1-a)*c.align();return s.range(i.invert?[a+u,u]:[u,a+u]),s};const u="function"==typeof e.value?e.value:e=>e.datum.value,h="function"==typeof e.label?e.label:e=>e.datum.label;for(let e=0;e<r.length;e++){const t=E({datum:r[e]},n),i=u(t,e);-1===s.indexOf(i)&&(s.push(i),a.push(h(t,e)),o[i]=e)}return c.domain(s),c.range(i.invert?i.range.slice().reverse():i.range),c.padding(isNaN(i.padding)?0:i.padding),isNaN(i.paddingInner)||c.paddingInner(i.paddingInner),isNaN(i.paddingOuter)||c.paddingOuter(i.paddingOuter),c.align(isNaN(i.align)?.5:i.align),c}const ao={depth:0};function lo(e,t,n){return e.ancestors().map((e=>t(E({datum:e.data},n)))).reverse().slice(1).toString()}const co=e=>e.min(),uo=e=>e.max();function ho(e,t){const n=e&&!isNaN(e.min),i=e&&!isNaN(e.max);let r=n?+e.min:0,o=i?+e.max:1;if(t&&t.length){if(!n){const e=t.map(co).filter(N);r=e.length?Math.min(...e):r}if(!i){const e=t.map(uo).filter(N);o=e.length?Math.max(...e):o}}return[r,o]}const fo={domain:[],range:[],invert:!1,min:NaN,max:NaN};function po(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const i=ro(e,t,n).clamp(!0).interpolate(Sr),r=Qr(e,fo,{data:t,resources:n}),o=Array.isArray(r.domain)&&r.domain.length,s=Array.isArray(r.range)&&r.range.length,a=i;E(!0,a,i);const[l,c]=ho(r,t?t.fields:[]),u=o?r.domain.length:-1,h=n.theme?n.theme.palette("sequential",u>0?u:2):[],d=s?r.range:h;return a.range(r.invert?d.slice().reverse():d.slice()),a.domain(o?r.domain:function(e,t,n){const i=e.length;if(2===i)return[t,n];const r=[],o=(n-t)/(i-1);r.push(t);for(let e=1;e<i-1;e++)r.push(t+o*e);return r.push(n),r}(a.range(),l,c)),a}const mo={domain:[],range:[],invert:!1,min:NaN,max:NaN,nice:!1};function go(e){const t=[];for(let n=0;n<e.length-1;n++)t.push((e[n]+e[n+1])/2);return t}const yo={domain:[],range:[]};const vo={domain:[],range:[],unknown:void 0},bo={domain:[],range:[],override:!1};const xo=Ue();function wo(e,t,n){let i=e.data;e.source&&(n.logger.warn("Deprecated: Scale data source configuration"),i={extract:[]},(Array.isArray(e.source)?e.source:[e.source]).forEach((e=>{i.extract.push({field:e})})));const r=Oi(i,t,n);let o,s=e.type||function(e){return e.root?"h-band":e.fields&&e.fields[0]?function(e){const t=e.map((e=>"dimension"===e.type()?"band":"linear"));return-1!==t.indexOf("linear")?"linear":"band"}(e.fields):"linear"}(r);return"color"===s&&(s=r.fields&&r.fields[0]&&"dimension"===r.fields[0].type()?"categorical-color":"sequential-color"),n.scale.has(s)&&(o=n.scale.get(s),o=o(e,r,{theme:n.theme,logger:n.logger}),o.type=s),o}xo("linear",ro),xo("band",so),xo("h-band",(function e(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const r={data:n,resources:i},o=Qr(t,oo,r);o.ticks=Qr(t.ticks,ao,r),o.value="function"==typeof t.value?t.value:e=>e.datum.value,o.label="function"==typeof t.label?t.label:e=>e.datum.value;let s=so(o);const{values:a,labels:l,items:c,ticks:u}=function(e,t,n){const i=t.ticks.depth,r=t.value,o=t.label,s=[],a=[],l={},c=[];let u=0;if(!e)return{values:s,labels:a,items:l,ticks:c};e.eachAfter((e=>{if(e.depth>0){const t=lo(e,r,n),h=e.leaves()||[e],d=r(E({datum:e.data},n)),f=o(E({datum:e.data},n)),p=Array.isArray(e.children),m={key:t,count:h.length,value:d,label:f,leftEdge:lo(h[0],r,n),rightEdge:lo(h[Math.max(h.length-1,0)],r,n),node:e};p?(s.push("SPACER_".concat(u,"_SPACER")),u++):(s.push(t),a.push(f)),(i<=0&&!p||e.depth===i)&&c.push(m),l[t]=m}}));const h=e.height-1;return h>0&&s.splice(-h),{values:s,labels:a,items:l,ticks:c}}(n.root,o,r),h=function(e){const t=String(e),n=c[t];return s(n?o.invert?n.rightEdge:n.leftEdge:t)};E(!0,h,s),h.bandwidth=function(e){const t=c[String(e)],n=s.bandwidth();if(t&&!t.isLeaf){const e=h(t.leftEdge),i=h(t.rightEdge);return Math.abs(e-i)+n}return n},h.step=function(e){const t=c[String(e)],n=t?t.count:1;let i=s.step();return i*=n,i},h.data=()=>n,h.datum=e=>{const t=c[String(e)];return t?t.node.data:null},h.copy=()=>e(t,n,i),h.labels=()=>l,h.ticks=()=>u.map((e=>{const t=h(e.key),n=h.bandwidth(e.key);return{position:t+n/2,label:e.label,data:e.node.data,start:t,end:t+n}}));const d=s.pxScale;return h.pxScale=function(e){return s=d(e),h},h.domain(a),h})),xo("sequential-color",po),xo("threshold-color",(function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const i=$r(),r=Qr(e,mo,{data:t,resources:n}),o=Array.isArray(r.domain)&&r.domain.length,s=Array.isArray(r.range)&&r.range.length;function a(e){return P(e)?NaN:i(e)}Object.keys(i).forEach((e=>a[e]=i[e]));const l=t.fields,[c,u]=ho(r,l),h=o?r.domain.length:-1,d=n.theme?n.theme.palette("sequential",h>0?h:2):[];let f=s?r.range:d,p=[];return p=o?r.domain:r.nice?function(e,t,n){const i=2===e.length?10:Math.max(1,e.length),r=Vr().domain([t,n]).nice(i).ticks(i);if(!e||!e.length)return r;const o=Math.max(0,e.length-1);for(;r.length>o;)r[0]-t<=n-r[r.length-1]?r.shift():r.pop();return r}(f,c,u):[c+(u-c)/2],f.length>p.length+1?p=function(e,t,n){const i=e.length;if(2===i)return[t+(n-t)/2];const r=[],o=(n-t)/i;for(let e=1;e<i;e++)r.push(t+o*e);return r}(f,c,u):f.length<p.length+1&&(f=function(e,t,n,i){n=e[0],i=e&&e.length>=2?e[e.length-1]:i;const r=po().domain([n,i]).range(t);return[n,...go(e),i].map((e=>r(e)))}(p,f,c,u)),a.data=()=>t,a.range(r.invert?f.slice().reverse():f),a.domain(p),a})),xo("categorical-color",(function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const i=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const i=Fi(),r={data:t,resources:n},o=Qr(e,yo,r),s="function"==typeof e.value?e.value:e=>e.datum.value,a="function"==typeof e.label?e.label:e=>e.datum.label,l=t.items||[],c={},u=[],h=[];for(let e=0;e<l.length;e++){const t=E({datum:l[e]},r),n=s(t,e);-1===u.indexOf(n)&&(u.push(n),h.push(a(t,e)),c[n]=e)}return i.data=()=>t,i.labels=()=>h,i.label=e=>h[u.indexOf(e)],i.datum=e=>l[c[e]],i.range(o.range),Array.isArray(o.domain)&&o.domain.length?i.domain(o.domain):i.domain(u),i}(e,t,n),r=n.theme,o=Qr(e,vo,{data:t,resources:n});let s;if(o.explicit=Qr(e.explicit,bo,{data:t,resources:n}),s=Array.isArray(o.range)&&0!==o.range.length?o.range.slice():r?r.palette("categorical",i.domain().length).slice():[],o.unknown)i.unknown(o.unknown);else if(r&&r.palette("unknown")){let e=r.palette("unknown");i.unknown(e[0])}if(Array.isArray(o.explicit.domain)&&o.explicit.domain.length){const e=i.domain().slice(),t=o.explicit.domain,n=Array.isArray(o.explicit.range)?o.explicit.range:[],r=Math.floor(e.length/s.length);for(let e=1;e<r+1;e*=2)s=s.concat(s);if(o.explicit.override)for(let i=0;i<t.length;i++){const r=e.indexOf(t[i]);r>-1&&(s[r]=n[i])}else{const i=t.map(((t,i)=>[e.indexOf(t),t,n[i]])).sort(((e,t)=>e[0]-t[0]));i.forEach((t=>{const n=e.indexOf(t[1]);-1!==n&&s.splice(n,0,t[2])}))}s.length=e.length}return i.range(s),i}));var qo={};function So(){So.init.call(this)}qo.isObject=function(e){return"object"==typeof e&&null!==e},qo.isNumber=function(e){return"number"==typeof e},qo.isUndefined=function(e){return void 0===e},qo.isFunction=function(e){return"function"==typeof e};var Mo=So;So.EventEmitter=So,So.prototype._events=void 0,So.prototype._maxListeners=void 0,So.defaultMaxListeners=10,So.init=function(){this._events=this._events||{},this._maxListeners=this._maxListeners||void 0},So.prototype.setMaxListeners=function(e){if(!qo.isNumber(e)||e<0||isNaN(e))throw TypeError("n must be a positive number");return this._maxListeners=e,this},So.prototype.emit=function(e){var t,n,i,r,o,s;if(this._events||(this._events={}),"error"===e&&!this._events.error)throw(t=arguments[1])instanceof Error?t:Error('Uncaught, unspecified "error" event.');if(n=this._events[e],qo.isUndefined(n))return!1;if(qo.isFunction(n))switch(arguments.length){case 1:n.call(this);break;case 2:n.call(this,arguments[1]);break;case 3:n.call(this,arguments[1],arguments[2]);break;default:for(i=arguments.length,r=new Array(i-1),o=1;o<i;o++)r[o-1]=arguments[o];n.apply(this,r)}else if(qo.isObject(n)){for(i=arguments.length,r=new Array(i-1),o=1;o<i;o++)r[o-1]=arguments[o];for(i=(s=n.slice()).length,o=0;o<i;o++)s[o].apply(this,r)}return!0},So.prototype.addListener=function(e,t){var n;if(!qo.isFunction(t))throw TypeError("listener must be a function");(this._events||(this._events={}),this._events.newListener&&this.emit("newListener",e,qo.isFunction(t.listener)?t.listener:t),this._events[e]?qo.isObject(this._events[e])?this._events[e].push(t):this._events[e]=[this._events[e],t]:this._events[e]=t,qo.isObject(this._events[e])&&!this._events[e].warned)&&((n=qo.isUndefined(this._maxListeners)?So.defaultMaxListeners:this._maxListeners)&&n>0&&this._events[e].length>n&&(this._events[e].warned=!0,qo.isFunction(console.error)&&console.error("(node) warning: possible EventEmitter memory leak detected. %d listeners added. Use emitter.setMaxListeners() to increase limit.",this._events[e].length),qo.isFunction(console.trace)&&console.trace()));return this},So.prototype.on=So.prototype.addListener,So.prototype.once=function(e,t){if(!qo.isFunction(t))throw TypeError("listener must be a function");var n=!1;function i(){this.removeListener(e,i),n||(n=!0,t.apply(this,arguments))}return i.listener=t,this.on(e,i),this},So.prototype.removeListener=function(e,t){var n,i,r,o;if(!qo.isFunction(t))throw TypeError("listener must be a function");if(!this._events||!this._events[e])return this;if(r=(n=this._events[e]).length,i=-1,n===t||qo.isFunction(n.listener)&&n.listener===t)delete this._events[e],this._events.removeListener&&this.emit("removeListener",e,t);else if(qo.isObject(n)){for(o=r;o-- >0;)if(n[o]===t||n[o].listener&&n[o].listener===t){i=o;break}if(i<0)return this;1===n.length?(n.length=0,delete this._events[e]):n.splice(i,1),this._events.removeListener&&this.emit("removeListener",e,t)}return this},So.prototype.removeAllListeners=function(e){var t,n;if(!this._events)return this;if(!this._events.removeListener)return 0===arguments.length?this._events={}:this._events[e]&&delete this._events[e],this;if(0===arguments.length){for(t in this._events)"removeListener"!==t&&this.removeAllListeners(t);return this.removeAllListeners("removeListener"),this._events={},this}if(n=this._events[e],qo.isFunction(n))this.removeListener(e,n);else if(Array.isArray(n))for(;n.length;)this.removeListener(e,n[n.length-1]);return delete this._events[e],this},So.prototype.listeners=function(e){return this._events&&this._events[e]?qo.isFunction(this._events[e])?[this._events[e]]:this._events[e].slice():[]},So.listenerCount=function(e,t){return e._events&&e._events[t]?qo.isFunction(e._events[t])?1:e._events[t].length:0};var Do={mixin:e=>(Object.keys(Mo.prototype).forEach((t=>{e[t]=Mo.prototype[t]})),Mo.init(e),e)};function _o(){let e=0,t=0,n=0,i=0;n=n||e;const r={move(e){this.moveTo(n+e)},moveTo(o){const s=Math.max(e,Math.min(t-i,o));n!==s&&(n=s,r.emit("update"))},update(o){let s=!1;({min:e=e,max:t=t}=o),void 0!==o.viewSize&&o.viewSize!==i&&(i=o.viewSize,s=!0);const a=Math.max(e,Math.min(t-i,n));n!==a&&(n=a,s=!0),s&&r.emit("update")},getState:()=>({min:e,max:t,start:n,viewSize:i})};return Do.mixin(r),r}function Co(e,t){const n=e.min||0,i=e.max||0,r=e.viewSize||0,o=t||_o();return o.update({min:n,max:i,viewSize:r}),o}function ko(e,t){return e<=t}function Eo(e,t){return e<t}function Ao(e,t,n){let i=0;for(;i<e.length&&t>e[i];)++i;return e[i]===t&&n&&++i,i}function To(){let e,t,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},i=[];function r(){}return r.configure=function(){let n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const{includeMax:i=!0,includeMin:r=!0}=n;e=i?ko:Eo,t=r?ko:Eo},r.add=e=>{let{min:t,max:n}=e;const r=Ao(i,t),o=Ao(i,n,!0),s=[r,o-r];r%2==0&&s.push(t),o%2==0&&s.push(n);const a=i.join(",");i.splice(...s);return a!==i.join(",")},r.remove=e=>{let{min:t,max:n}=e;const r=Ao(i,t),o=Ao(i,n,!0),s=[r,o-r];r%2==1&&s.push(t),o%2==1&&s.push(n);const a=i.join(",");i.splice(...s);return a!==i.join(",")},r.set=e=>{const t=i.join(",");i=[],Array.isArray(e)?e.forEach(r.add):r.add(e);return t!==i.join(",")},r.clear=()=>{const e=i.length>0;return i=[],e},r.containsValue=n=>function(e,t,n,i){const r=e.length;for(let o=1;o<r;o+=2)if(n(e[o-1],t)&&i(t,e[o]))return!0;return!1}(i,n,t,e),r.containsRange=e=>{let{min:t,max:n}=e;const r=Ao(i,t,!0),o=Ao(i,n);return r===o&&o%2==1},r.toggle=e=>r.containsRange(e)?r.remove(e):r.add(e),r.ranges=()=>{const e=[];for(let t=1;t<i.length;t+=2)e.push({min:i[t-1],max:i[t]});return e},r.configure(n),r}function Io(){let e=[];function t(){}return t.add=t=>-1===e.indexOf(t)&&(e.push(t),!0),t.remove=t=>{const n=e.indexOf(t);return-1!==n&&(e.splice(n,1),!0)},t.contains=t=>-1!==e.indexOf(t),t.values=()=>e.slice(),t.clear=()=>e=[],t.toString=()=>e.join(";"),t}const Ro={key:void 0,includeMin:!0,includeMax:!0};function Oo(e){let{items:t,collection:n,vc:i}=e;const r={},o=[];let s,a;for(let e=0,o=t.length;e<o;e++){s=t[e].key,n[s]||(n[s]=i()),a=t[e].values||[t[e].value];for(let e=0;e<a.length;e++)n[s].add(a[e])&&(r[s]=r[s]||[],r[s].push(a[e]))}const l=Object.keys(r);for(let e=0,t=l.length;e<t;e++)s=l[e],o.push({id:s,values:r[s]});return o}function No(e){let{items:t,collection:n}=e;const i={},r=[];let o,s;for(let e=0,r=t.length;e<r;e++)if(o=t[e].key,n[o]){s=t[e].values||[t[e].value];for(let e=0;e<s.length;e++)n[o].remove(s[e])&&(i[o]=i[o]||[],i[o].push(s[e]))}const a=Object.keys(i);for(let e=0,t=a.length;e<t;e++)o=a[e],r.push({id:o,values:i[o]});return r}function Po(e){const t={};let n,i;for(let r=0,o=e.length;r<o;r++){n=e[r].key,i=e[r].values||[e[r].value],t[n]||(t[n]=[]);for(let e=0;e<i.length;e++){-1===t[n].indexOf(i[e])&&t[n].push(i[e])}}return t}function Lo(e){let{key:t,collection:n,obj:i,fn:r,value:o}=e;n[t]||(n[t]=r()),i[t]=i[t]||[],i[t].push(o),n[t].add(o)}function Fo(e,t){const n=[],i=Object.keys(e);let r,o;const s=e=>-1===t[r].indexOf(e);for(let a=0,l=i.length;a<l;a++)r=i[a],t[r]?(o=e[r].filter(s),o.length&&n.push({id:r,values:o})):n.push({id:r,values:e[r]});return n}function zo(e,t,n){const i=function(e,t){if(!Object.keys(t).length)return e;const n=e.length,i=Array(n);for(let r=0;r<n;r++)i[r]=e[r].key in t?E({},e[r],{key:t[e[r].key]}):e[r];return i}(t,n);return e&&e.length?e.reduce(((e,t)=>t(e)),i):i}function jo(e){return e.replace(/(-[a-z])/g,(e=>e.toUpperCase().replace("-","")))}function Ho(e){return e.replace(/([A-Z])/g,(e=>"-".concat(e.toLowerCase())))}function Bo(e,t,n){let{ranges:i,interceptors:r,rc:o,aliases:s,rangeConfig:a}=n;const l=zo(r["".concat(t,"Ranges")],e,s);let c=!1;return l.forEach((e=>{const n=e.key;if(i[n]||(i[n]=o(a.sources[n]||a.default)),"set"===t)c=i[n][t](e.ranges||e.range)||c;else{const r=e.ranges||[e.range];for(let e=0;e<r.length;e++)c=i[n][t](r[e])||c}})),c}function Vo(){let{vc:e=Io,rc:t=To}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=!1,i={},r={},o={},s={sources:{},default:E({},Ro)};const a={addValues:[],removeValues:[],toggleValues:[],setValues:[],addRanges:[],setRanges:[],removeRanges:[],toggleRanges:[]},l=()=>{const e={values:{},ranges:{}};return Object.keys(r).forEach((t=>{e.values[t]=r[t].values()})),Object.keys(i).forEach((t=>{e.ranges[t]=i[t].ranges()})),e},c={ls:[],clear(){this.ls.forEach((e=>e.clear()))},start(){this.ls.forEach((e=>e.start()))},end(){this.ls.forEach((e=>e.end()))},update(){const e=l();this.ls.forEach((t=>t._state(e)))},updateValues(){const e=l();this.ls.forEach((t=>t._state({values:e.values})))},updateRanges(){const e=l();this.ls.forEach((t=>t._state({ranges:e.ranges})))}},u={configure:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};Array.isArray(e.ranges)&&e.ranges.length&&(s={sources:{},default:E({},Ro)},e.ranges.forEach((e=>{const t={};Object.keys(Ro).filter((e=>"key"!==e)).forEach((n=>{t[n]=void 0!==e[n]?e[n]:Ro[n]})),void 0!==e.key?s.sources[e.key]=t:s.default=t})),Object.keys(i).forEach((e=>i[e].configure(s.sources[e]||s.default))),u.emit("update",[],[]))},link:e=>{if(u===e)throw new Error("Can't link to self");c.ls.push(e),e._state(l())},_state:e=>{if(!e)return l();if(e.values){const t=[];Object.keys(e.values).forEach((n=>{r[n]&&e.values[n].join(";")===r[n].toString()||t.push({key:n,values:e.values[n]})})),Object.keys(r).forEach((n=>{e.values[n]||t.push({key:n,values:[]})})),t.length&&u.setValues(t)}if(e.ranges){const t=[];Object.keys(e.ranges).forEach((n=>{i[n]&&e.ranges[n].join(";")===i[n].toString()||t.push({key:n,ranges:e.ranges[n]})})),Object.keys(i).forEach((n=>{e.ranges[n]||t.push({key:n,ranges:[]})})),t.length&&u.setRanges(t)}},start:function(){if(!n){n=!0;for(var e=arguments.length,t=new Array(e),i=0;i<e;i++)t[i]=arguments[i];u.emit("start",...t),c.start()}},end:function(){if(n){n=!1,i={},r={};for(var e=arguments.length,t=new Array(e),o=0;o<e;o++)t[o]=arguments[o];u.emit("end",...t),c.end()}},isActive:()=>n,clear:()=>{const e=u.brushes().filter((e=>"value"===e.type&&e.brush.values().length)).map((e=>({id:e.id,values:e.brush.values()}))),t=Object.keys(i).length>0||e.length;i={},r={},t&&(u.emit("update",[],e),c.clear())},brushes:()=>{let e=[];return e=e.concat(Object.keys(i).map((e=>({type:"range",id:e,brush:i[e]})))),e=e.concat(Object.keys(r).map((e=>({type:"value",id:e,brush:r[e]})))),e},addValue:(e,t)=>{u.addValues([{key:e,value:t}])},addValues:t=>{const i=zo(a.addValues,t,o),s=Oo({vc:e,collection:r,items:i});u.emit("add-values",i),s.length&&(n||(n=!0,u.emit("start")),u.emit("update",s,[]),c.updateValues())}};return u.setValues=t=>{const i=zo(a.setValues,t,o),s=function(e){let{items:t,vCollection:n,vc:i}=e;const r={},o=Po(t);let s,a=[],l=[];const c={},u=Object.keys(n);for(let e=0,t=u.length;e<t;e++)s=u[e],c[s]=n[s].values().slice(),delete n[s];const h=e=>{n[s]&&n[s].contains(e)||Lo({key:s,value:e,collection:n,obj:r,fn:i})},d=Object.keys(o);for(let e=0,t=d.length;e<t;e++)s=d[e],o[s].forEach(h);return l=Fo(c,r),a=Fo(r,c),[a,l]}({items:i,vCollection:r,vc:e});u.emit("set-values",i),(s[0].length>0||s[1].length>0)&&(n||(n=!0,u.emit("start")),u.emit("update",s[0],s[1]),c.updateValues())},u.removeValue=(e,t)=>{u.removeValues([{key:e,value:t}])},u.removeValues=e=>{const t=zo(a.removeValues,e,o),n=No({collection:r,items:t});u.emit("remove-values",t),n.length&&(u.emit("update",[],n),c.updateValues())},u.addAndRemoveValues=(t,i)=>{const s=zo(a.addValues,t,o),l=zo(a.removeValues,i,o),h=Oo({vc:e,collection:r,items:s}),d=No({collection:r,items:l});u.emit("add-values",s),u.emit("remove-values",l),(h.length||d.length)&&(n||(n=!0,u.emit("start")),u.emit("update",h,d),c.updateValues())},u.toggleValue=(e,t)=>{u.toggleValues([{key:e,value:t}])},u.toggleValues=t=>{const i=zo(a.toggleValues,t,o),s=function(e){let{items:t,values:n,vc:i}=e;const r={},o={},s=[],a=[],l=Po(t);let c,u,h;const d=Object.keys(l);for(let e=0,t=d.length;e<t;e++){c=d[e],h=l[c];for(let e=0,t=h.length;e<t;e++)u=h[e],n[c]&&n[c].contains(u)?n[c]&&n[c].contains(u)&&(o[c]=o[c]||[],o[c].push(u),n[c].remove(u)):Lo({key:c,value:u,collection:n,obj:r,fn:i})}const f=Object.keys(r);for(let e=0,t=f.length;e<t;e++)c=f[e],s.push({id:c,values:r[c]});const p=Object.keys(o);for(let e=0,t=p.length;e<t;e++)c=p[e],a.push({id:c,values:o[c]});return[s,a]}({items:i,values:r,vc:e});u.emit("toggle-values",i),(s[0].length>0||s[1].length>0)&&(n||(n=!0,u.emit("start")),u.emit("update",s[0],s[1]),c.updateValues())},u.containsValue=(e,t)=>{let n=o[e]||e;return!!r[n]&&r[n].contains(t)},u.addRange=(e,t)=>{u.addRanges([{key:e,range:t}])},u.addRanges=e=>{Bo(e,"add",{ranges:i,rc:t,interceptors:a,aliases:o,rangeConfig:s})&&(n||(n=!0,u.emit("start")),u.emit("update",[],[]),c.updateRanges())},u.removeRange=(e,t)=>{u.removeRanges([{key:e,range:t}])},u.removeRanges=e=>{Bo(e,"remove",{ranges:i,rc:t,interceptors:a,aliases:o,rangeConfig:s})&&(n||(n=!0,u.emit("start")),u.emit("update",[],[]),c.updateRanges())},u.setRange=(e,t)=>{u.setRanges([{key:e,range:t}])},u.setRanges=e=>{Bo(e,"set",{ranges:i,rc:t,interceptors:a,aliases:o,rangeConfig:s})&&(n||(n=!0,u.emit("start")),u.emit("update",[],[]),c.updateRanges())},u.toggleRange=(e,t)=>{u.toggleRanges([{key:e,range:t}])},u.toggleRanges=e=>{Bo(e,"toggle",{ranges:i,rc:t,interceptors:a,aliases:o,rangeConfig:s})&&(n||(n=!0,u.emit("start")),u.emit("update",[],[]),c.updateRanges())},u.containsRangeValue=(e,t)=>{let n=o[e]||e;return!!i[n]&&i[n].containsValue(t)},u.containsRange=(e,t)=>{let n=o[e]||e;return!!i[n]&&i[n].containsRange(t)},u.containsMappedData=(e,t,n)=>{let s=[];const a=Object.keys(e);let l,c,u,h;for(let t=0,n=a.length;t<n;t++){if(l=a[t],"value"===l)c=e,s[t]={key:"",i:t,bool:!1};else{if("source"===l)continue;c=e[l],s[t]={key:l,i:t,bool:!1}}u=c.source&&c.source.field,void 0!==u&&(void 0!==c.source.key&&(u="".concat(c.source.key,"/").concat(u)),u in o&&(u=o[u]),h=c.value,i[u]?s[t].bool=Array.isArray(h)?i[u].containsRange({min:h[0],max:h[1]}):i[u].containsValue(h):r[u]&&r[u].contains(h)&&(s[t].bool=!0))}return t?(s=s.filter((e=>-1!==t.indexOf(e.key))),"and"===n?!!s.length&&!s.some((e=>!1===e.bool)):"xor"===n?!!s.length&&s.some((e=>e.bool))&&s.some((e=>!1===e.bool)):s.some((e=>e.bool))):s.some((e=>e.bool))},u.intercept=(e,t)=>{const n=jo(e);a[n]&&a[n].push(t)},u.removeInterceptor=(e,t)=>{const n=jo(e);if(!a[n])return;const i=a[n].indexOf(t);-1!==i&&a[n].splice(i,1)},u.removeAllInterceptors=e=>{const t=[];if(e){const n=jo(e);a[n]&&a[n].length&&t.push({name:e,handlers:a[n]})}else Object.keys(a).forEach((e=>{a[e].length&&t.push({name:Ho(e),handlers:a[e]})}));t.forEach((e=>{e.handlers.slice().forEach((t=>u.removeInterceptor(e.name,t)))}))},u.addKeyAlias=(e,t)=>{o[e]=t},u.removeKeyAlias=e=>{delete o[e]},Do.mixin(u),u}function $o(e){return e*e*e}function Wo(e){return--e*e*e+1}function Uo(e){return((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2}Ue();const Yo=["stroke","fill","color","backgroundColor","thumbColor"];function Xo(e,t){const n=t?t.length:0,i=e?Math.min(n,e.length):0,r=new Array(i),o=new Array(n);let s;for(s=0;s<i;++s)r[s]=Ko(e[s],t[s]);for(;s<n;++s)o[s]=t[s];return function(e){for(s=0;s<i;++s)o[s]=r[s](e);return o}}function Ko(e,t,n){const i=typeof t;let r;return null==t||"boolean"===i?function(e){return()=>e}(t):("number"===i?Cr:"string"===i?(r=rr(t))&&Yo.includes(n)?(t=r,Sr):Tr:t instanceof rr?Sr:t instanceof Date?_r:function(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}(t)?Mr:Array.isArray(t)?Xo:"function"!=typeof t.valueOf&&"function"!=typeof t.toString||isNaN(t)?Go:Cr)(e,t)}function Go(e,t){const n={},i={};let r;for(r in null!==e&&"object"==typeof e||(e={}),null!==t&&"object"==typeof t||(t={}),t)r in e?n[r]=Ko(e[r],t[r],r):i[r]=t[r];return function(e){for(r in n)i[r]=n[r](e);return i}}function Jo(e,t){return e.data?e.data.value:"text"===e.type?e.text:t}const Zo={fontFamily:"Arial",fontSize:"13px",color:"#595959",backgroundColor:"#ffffff",stroke:"#000000",strokeWidth:0,$fill:"#333333"},Qo=/^\$/;function es(e){const t=typeof e;return"object"!==t&&"function"!==t&&"undefined"!==t}function ts(e,t,n){const i=e[t];i&&i.scale&&i.scale.pxScale?i.scale=i.scale.pxScale(n):i&&i.pxScale&&(e[t]=i.pxScale(n))}function ns(e,t){return e.pxScale?e.pxScale(t):e}const is={normalizeSettings:function(e,t,n){const i=E({},e),r=E({},t);return Object.keys(i).forEach((e=>{r[e]={};const o=i[e],s=typeof o;if("function"==typeof o)r[e].fn=o;else if(es(o)){let n=t[e];"string"==typeof n&&Qo.test(n)&&(n=Zo[n]);const i=typeof n;r[e]="undefined"===i||i===s?o:n}else o&&"object"==typeof o&&("function"==typeof o.fn&&(r[e].fn=o.fn),void 0!==o.scale&&(r[e].scale=n.scale(o.scale)),"string"==typeof o.ref&&(r[e].ref=o.ref))})),Object.keys(t).forEach((e=>{if(e in i)return;const n=t[e];"string"===typeof n&&Qo.test(n)?r[e]=Zo[n]:r[e]=n})),r},resolveForItem:function(e,t,n){const i={},r=Object.keys(t),o=r.length,s=e.datum,a=e.datum;for(let l=0;l<o;l++){const o=r[l],c=t[o],u="object"==typeof a&&void 0!==c,h=u&&"string"==typeof c.ref,d=u&&o in a,f=h?a[c.ref]:d?a[o]:s;es(c)?i[o]=c:u&&c.fn?(c.scale&&(e.scale=c.scale),i[o]=c.fn.call(null,e,n)):u&&c.scale&&f?(i[o]=c.scale(f.value),c.scale.bandwidth&&(i[o]+=c.scale.bandwidth()/2)):h&&f?i[o]=f.value:c.fn?i[o]=c.fn.call(null,e,n):i[o]=c}return i},updateScaleSize:ts};function rs(){return(arguments.length>0&&void 0!==arguments[0]?arguments[0]:[]).reduce(((e,t)=>Array.isArray(t.children)?(e.push(...rs(t.children)),e):(e.push(t),e)),[])}function os(e,t){let{context:n,data:i,style:r,filter:o,mode:s}=t;const a=e.chart.brush(n),l=i,c=r.active||{},u=r.inactive||{},h=[];Object.keys(c).forEach((e=>{h.push(e)})),Object.keys(u).forEach((e=>{-1===h.indexOf(e)&&h.push(e)}));const d=[];let f=!1;const p=()=>{let t=rs(e.nodes);return"function"==typeof o&&(t=t.filter(o)),t},m=()=>{const e=p(),t=e.length;let n,i=!1;const r="function"==typeof l?l({brush:a}):l;for(let i=0;i<t;i++){if(n=e[i].data,!n)continue;e[i].__style||(e[i].__style={},h.forEach((t=>{e[i].__style[t]=e[i][t]})));const t=a.containsMappedData(n,r,s),o=d.indexOf(e[i]);let l=!1;t&&-1===o?(d.push(e[i]),l=!0):t||-1===o||(d.splice(o,1),l=!0),e[i].needToUpdate=l||f,e[i].isActive=t}for(let r=0;r<t;r++)if(n=e[r].data,n){if(e[r].needToUpdate){const t=E({},e[r],e[r].__style),n=e[r].isActive;h.forEach((i=>{e[r][i]=n&&i in c?"function"==typeof c[i]?c[i].call(null,t,d):c[i]:!n&&i in u?"function"==typeof u[i]?u[i].call(null,t,d):u[i]:e[r].__style[i]})),i=!0}delete e[r].needToUpdate}return f=!1,i},g=function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{suppressRender:!1};const{suppressRender:n}=t,i=p(),r=i.length;for(let e=0;e<r;e++)i[e].data&&(i[e].__style=i[e].__style||{},h.forEach((t=>{i[e].__style[t]=i[e][t],t in u&&(i[e][t]="function"==typeof u[t]?u[t].call(null,i[e]):u[t])})));f=!0,d.length=0,n||e.renderer.render(e.nodes)},y=function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{suppressRender:!1};const{suppressRender:n}=t,i=p(),r=i.length;for(let e=0;e<r;e++)i[e].__style&&(Object.keys(i[e].__style).forEach((t=>{i[e][t]=i[e].__style[t]})),i[e].__style=void 0);d.length=0,n||e.renderer.render(e.nodes)},v=()=>{if(m()){const t="function"==typeof e.config.sortNodes?e.config.sortNodes(e):e.nodes;"function"==typeof e.config.customRender?e.config.customRender({render:e.renderer.render,nodes:t}):e.renderer.render(t)}};return a.on("start",g),a.on("end",y),a.on("update",v),{isActive:()=>a.isActive(),update:()=>{d.length=0,f=!0,m()},cleanUp:function(){a.removeListener("start",g),a.removeListener("end",y),a.removeListener("update",v)}}}function ss(e){let{nodes:t,action:n,chart:i,trigger:r}=e;const o=[];for(let e=0;e<t.length;e++){let n=t[e].data;null!==n&&o.push(n)}!function(e){let{dataPoints:t,action:n,chart:i,trigger:r}=e;if(!r)return;const o=r.data||[""];let s={items:[],actionFn:"toggleRanges"},a={items:[],actionFn:"toggleValues"};-1!==["add","remove","set","toggle"].indexOf(n)&&(s.actionFn="".concat(n,"Ranges"),a.actionFn="".concat(n,"Values"));for(let e=0;e<t.length;e++){const n=t[e];n&&o.forEach((e=>{let t=n&&!e?n:n[e];if(t){let e={key:t.source.field};void 0!==t.source.key&&(e.key="".concat(t.source.key,"/").concat(t.source.field)),Array.isArray(t.value)?(e.range={min:t.value[0],max:t.value[1]},s.items.push(e)):(e.value=t.value,a.items.push(e))}}))}r.contexts.forEach((e=>{s.items.length?i.brush(e)[s.actionFn](s.items):i.brush(e)[a.actionFn](a.items)}))}({dataPoints:o,action:n,chart:i,trigger:r})}function as(e){let{collisions:t,t:n,config:i,action:r}=e,o=[],s=!1;t.length>0&&(o=t,s=!0,"stop"===n.propagation&&(o=[t[t.length-1]]));const a=o.map((e=>e.node));return ss({nodes:a,action:r,chart:i.chart,data:i.data,trigger:n}),s}function ls(e,t,n){const i=n.element().getBoundingClientRect();let r=O(e)?function(e,t){return 1!==e.changedTouches.length?null:{x:e.changedTouches[0].clientX-t.left,y:e.changedTouches[0].clientY-t.top}}(e,i):function(e,t){return{x:e.clientX-t.left,y:e.clientY-t.top}}(e,i);return null===r||r.x<0||r.y<0||r.x>i.width||r.y>i.height?[]:(t.touchRadius>0&&O(e)?r={cx:r.x,cy:r.y,r:t.touchRadius}:t.mouseRadius>0&&!O(e)&&(r={cx:r.x,cy:r.y,r:t.mouseRadius}),n.itemsAt(r))}function cs(e,t,n){return e?"function"==typeof e?e(t):e:n}const us={fill:"fill",stroke:"stroke",opacity:"opacity",strokeWidth:"stroke-width",strokeLinejoin:"stroke-linejoin",fontFamily:"font-family",fontSize:"font-size",fontWeight:"font-weight",baseline:"dominant-baseline",dominantBaseline:"dominant-baseline",anchor:"text-anchor",textAnchor:"text-anchor",maxWidth:"maxWidth",transform:"transform",strokeDasharray:"stroke-dasharray",id:"id"};function hs(e){let t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],n="";for(let t=0;t<e.length;t++){const i=e[t];n+=0===t?"M".concat(i.x," ").concat(i.y):"L".concat(i.x," ").concat(i.y),n+=" "}return t&&(n+="Z"),n}function ds(e,t,n,i){const r=n/2,o=e-i/2,s=t-i/2,a=e-r,l=t-r;return[{x:o,y:s},{x:o,y:l},{x:o+i,y:l},{x:o+i,y:s},{x:a+n,y:s},{x:a+n,y:s+i},{x:o+i,y:s+i},{x:o+i,y:l+n},{x:o,y:l+n},{x:o,y:s+i},{x:a,y:s+i},{x:a,y:s}]}function fs(e){return-e/180*Math.PI}function ps(e){return function(e){let t=(.5*(Math.floor(e/Math.PI*2)+2)+.25)*Math.PI,n=Math.cos(Math.abs(t-e))*Math.sqrt(2),i=n*Math.cos(e),r=n*Math.sin(e);return{x1:i<0?1:0,y1:r<0?1:0,x2:i>=0?i:i+1,y2:r>=0?r:r+1}}(fs(e))}function ms(e,t){return{x:e.x+t.x,y:e.y+t.y}}function gs(e,t){return{x:e.x-t.x,y:e.y-t.y}}function ys(e,t){return{x:e.x*t,y:e.y*t}}function vs(e,t){return e.x-t.x}function bs(e,t){return e.y-t.y}function xs(e,t){return vs(e,t)**2+bs(e,t)**2}function ws(e,t){return Math.sqrt(xs(e,t))}function qs(e,t){return e.x*t.x+e.y*t.y}function Ss(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{x:0,y:0};const i=Math.cos(t),r=Math.sin(t),o=gs(e,n);return ms({x:i*o.x-r*o.y,y:r*o.x+i*o.y},n)}const Ms={up:0,down:180,left:90,right:-90};function Ds(e){let{x:t,y:n,size:i}=e;const r=i/2;return{type:"rect",x:t-r,y:n-r,width:i,height:i}}const _s=Ue();_s.add("circle",(function(e){return{type:"circle",fill:"black",cx:e.x,cy:e.y,r:e.size/2}})),_s.add("diamond",(function(e){const t=e.size,n=e.x-t/2,i=e.y-t/2;return{type:"path",fill:"black",d:hs([{x:n,y:i+t/2},{x:n+t/2,y:i},{x:n+t,y:i+t/2},{x:n+t/2,y:i+t},{x:n,y:i+t/2}])}})),_s.add("saltire",(function(e){const t=fs(45),n=e.size/2,i=isNaN(e.width)?n/2:e.width,r=Math.min(i,n);let o=e.size;const s=Math.sin(Math.asin(-t))*(r/2);o+=2*(n/Math.sin(-t)-n),o-=2*s;const a={x:e.x,y:e.y},l=ds(e.x,e.y,o,r).map((e=>Ss(e,t,a)));return{type:"path",fill:"black",d:hs(l)}})),_s.add("square",(function(e){const t=e.size;return{type:"rect",fill:"black",x:e.x-t/2,y:e.y-t/2,width:t,height:t}})),_s.add("triangle",(function(e){const t=e.size,n={x:e.x,y:e.y},i=Ms[e.direction]||0,r=t/2,o=e.x-r,s=e.y-r;let a=[{x:o,y:s+t},{x:o+r,y:s},{x:o+t,y:s+t},{x:o,y:s+t}];const l=fs(i);return a=a.map((e=>Ss(e,l,n))),{type:"path",fill:"black",d:hs(a)}})),_s.add("line",(function(e){const t="vertical"===e.direction,n=e.size/2,i=e.x,r=e.y;return{type:"line",stroke:"black",strokeWidth:1,x1:i-(t?0:n),y1:r-(t?n:0),x2:i+(t?0:n),y2:r+(t?n:0),collider:Ds(e)}})),_s.add("star",(function(e){const t=e.size,n=[],i=t/2,r=e.points||5,o=Math.min(e.innerRadius||t/2,t)/2,s=isNaN(e.startAngle)?90:e.startAngle,a=360/r;for(let t=1;t<=r;t++){const r=a*t+s,l=fs(r),c=fs(r+a/2),u=Math.sin(l),h=Math.cos(l),d=Math.sin(c),f=Math.cos(c);n.push({x:e.x+h*i,y:e.y+u*i}),n.push({x:e.x+f*o,y:e.y+d*o})}return{type:"path",fill:"black",d:hs(n)}})),_s.add("n-polygon",(function(e){const t=[],n=e.size/2,i=Math.max(isNaN(e.sides)?6:e.sides,3),r=360/i,o=isNaN(e.startAngle)?0:e.startAngle;for(let s=1;s<=i;s++){const i=fs(r*s+o),a=Math.sin(i),l=Math.cos(i);t.push({x:e.x+l*n,y:e.y+a*n})}return{type:"path",fill:"black",d:hs(t)}})),_s.add("cross",(function(e){const t=e.x,n=e.y,i=e.size/2,r=isNaN(e.width)?i/2:e.width,o=Math.min(r,i);return{type:"path",fill:"black",d:hs(ds(t,n,e.size,o))}})),_s.add("bar",(function(e){const t={x:e.x,y:e.y},n="vertical"===e.direction,i=e.size/2,r=i/2/2;let o=[{x:t.x-i,y:t.y+r},{x:t.x-i,y:t.y-r},{x:t.x+i,y:t.y-r},{x:t.x+i,y:t.y+r}];if(n){const e=fs(90);o=o.map((n=>Ss(n,e,t)))}const s=j(o);return s.type="rect",s.fill="black",s})),_s.add("rect",(function(e){const{x:t,y:n,size:i}=e,r=void 0===e.width?i:e.width,o=void 0===e.height?i:e.height;return{type:"rect",fill:"black",x:t-r/2,y:n-o/2,width:r,height:o}}));const Cs=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:_s;return function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const n=e.get(t.type);if(n){const e=n(t);return function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};Object.keys(t).forEach((n=>{void 0!==us[n]&&"transform"!==n&&(e[n]=t[n])}))}(e,t),void 0!==t.data&&(e.data=t.data),e}return n}};function ks(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},{dock:n="center",displayOrder:i=0,prioOrder:r=0,preferredSize:o=0,minimumLayoutMode:s,show:a=!0}=e;n=n||"center";return{computePreferredSize(e){let{inner:n,outer:i,children:r}=e;return"function"==typeof o?o({inner:n,outer:i,children:r,dock:this.dock()},t):o},dock(e){return void 0!==e?(n=e,this):"function"==typeof n?n(t):n},displayOrder(e){return void 0!==e?(i=e,this):"function"==typeof i?i(t):i},prioOrder(e){return void 0!==e?(r=e,this):"function"==typeof r?r(t):r},minimumLayoutMode(e){return void 0!==e?(s=e,this):"function"==typeof s?s(t):s},show(e){return void 0!==e?(a=e,this):"function"==typeof a?a(t):a}}}const Es=e=>["on","preferredSize","created","beforeMount","mounted","resize","beforeUpdate","updated","beforeRender","render","beforeUnmount","beforeDestroy","destroyed","defaultSettings","data","settings","formatter","scale","chart","dockConfig","mediator","style","resolver","registries","_DO_NOT_USE_getInfo","symbol","isVisible"].some((t=>t===e));function As(e,t,n){const{require:i=[]}=t,r=t.mediator||{},{settings:o,formatter:s,scale:a,data:l,renderer:c,chart:u,dockConfig:h,mediator:d,instance:f,rect:p,style:m,registries:g,resolver:y,update:v,_DO_NOT_USE_getInfo:b,symbol:x,isVisible:w}=n;e.emit=()=>{},w&&(e.isVisible=w),Object.defineProperty(e,"settings",{get:o}),Object.defineProperty(e,"data",{get:l}),Object.defineProperty(e,"formatter",{get:s}),Object.defineProperty(e,"scale",{get:a}),Object.defineProperty(e,"mediator",{get:d}),Object.defineProperty(e,"style",{get:m}),Object.defineProperty(e,"registries",{get:g}),p&&Object.defineProperty(e,"rect",{get:p}),b&&(e._DO_NOT_USE_getInfo=b),Object.keys(t).forEach((n=>{Es(n)||("function"==typeof t[n]?e[n]=t[n].bind(e):e[n]=t[n])})),i.forEach((t=>{"renderer"===t?Object.defineProperty(e,"renderer",{get:c}):"chart"===t?Object.defineProperty(e,"chart",{get:u}):"dockConfig"===t?Object.defineProperty(e,"dockConfig",{get:h}):"instance"===t?Object.defineProperty(e,"instance",{get:f}):"update"===t&&v?Object.defineProperty(e,"update",{get:v}):"resolver"===t?Object.defineProperty(e,"resolver",{get:y}):"symbol"===t&&Object.defineProperty(e,"symbol",{get:x})})),Object.keys(r).forEach((t=>{e.mediator.on(t,r[t].bind(e))}))}function Ts(e,t,n){const i=t=>e[t]?(n.warn("Deprecation Warning the ".concat(t," property should be moved into layout: {} property")),e[t]):e.layout?e.layout[t]:void 0,r={};return r.displayOrder=i("displayOrder"),r.dock=i("dock"),r.prioOrder=i("prioOrder"),r.minimumLayoutMode=i("minimumLayoutMode"),e.layout=e.layout||{},e.layout.displayOrder=void 0!==r.displayOrder?r.displayOrder:e.layout.displayOrder,e.layout.prioOrder=void 0!==r.prioOrder?r.prioOrder:e.layout.prioOrder,e.layout.dock=r.dock||e.layout.dock,e.layout.minimumLayoutMode=r.minimumLayoutMode||e.layout.minimumLayoutMode,r.show=e.show,r.preferredSize=t,r}function Is(e,t,n){Object.keys(n.on||{}).forEach((i=>{e.eventListeners=e.eventListeners||[];const r=n.on[i].bind(e);e.eventListeners.push({event:i,listener:r}),t.on(i,r)})),e.emit=function(e){for(var n=arguments.length,i=new Array(n>1?n-1:0),r=1;r<n;r++)i[r-1]=arguments[r];return t.emit(e,...i)}}function Rs(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const{defaultSettings:n={},_DO_NOT_USE_getInfo:i=(()=>({}))}=e,{chart:r,container:o,mediator:s,registries:a,theme:l,renderer:c}=t,u=Do.mixin({});let h,d,f,p,m,g=t.settings||{},y=E(!0,{},n,g),v=[],b=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:is,n={};return{resolve:function(i){let{data:r,settings:o,defaults:s={},scaled:a}=i;const l=n.norm=t.normalizeSettings(o,s,e.chart),c={scale:e.chart.scale,formatter:e.chart.formatter};a&&Object.keys(a).forEach((e=>{l[e]&&t.updateScaleSize(l,e,a[e])}));const u=[];if(!r||!Array.isArray(r.items)){const e={data:r,resources:c};let i=t.resolveForItem(e,n.norm,-1);return{settings:n.norm,item:i}}{let e;for(let i=0,o=r.items.length;i<o;i++){e={datum:r.items[i],data:r,resources:c};let o=t.resolveForItem(e,n.norm,i);o.data=r.items[i],u.push(o)}}return{settings:n.norm,items:u}}}}({chart:r}),x=!1;const w={nodes:[],chart:r,config:y.brush||{},renderer:null},q={tap:[],over:[]},S=[],M={},D=E({},g);function _(t){let n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:()=>{},i=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return function(){const r=void 0!==e[t],o=void 0!==g[t];let s;for(var a=arguments.length,l=new Array(a),c=0;c<a;c++)l[c]=arguments[c];return r&&("function"==typeof e[t]?s=e[t].call(M,...l):i&&(s=e[t])),o&&("function"==typeof g[t]?s=g[t].call(D,...l):i&&(s=g[t])),r||o||(s=n.call(M,...l)),s}}const C=_("preferredSize",(()=>0),!0),k=_("resize",(e=>{let{inner:t}=e;return t})),A=_("created"),T=_("beforeMount"),R=_("mounted"),O=_("beforeUnmount"),N=_("beforeUpdate"),P=_("updated"),L=_("beforeRender"),F=_("beforeDestroy"),z=_("destroyed"),j=e.render,H=()=>{y.brush&&(y.brush.consume||[]).forEach((e=>{e.context&&e.style&&S.push(os(w,e))}))},B=()=>{y.brush&&(y.brush.trigger||[]).forEach((e=>{"over"===e.on?q.over.push(e):q.tap.push(e)}))};Object.defineProperty(w,"data",{get:()=>v});const V=y.renderer||e.renderer,$=V?c||a.renderer(V)():c||a.renderer()();"function"==typeof $.settings&&$.settings(y.rendererSettings),w.renderer=$;const W={resources:r.logger?{logger:r.logger()}:{}};let U=ks(Ts(y,C,r.logger()),W);const Y=e=>{e.key=y.key,e.element=$.element()},X=()=>{};X.dockConfig=()=>U,X.set=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(e.settings&&(g=e.settings,y=E(!0,{},n,e.settings),U=ks(Ts(y,C,r.logger()),W),w.config=y.brush||{}),y.scale&&(h=r.scale(y.scale)),y.data){const{rendererSettings:e}=y,t="function"==typeof(null==e?void 0:e.progressive)&&e.progressive(),n=Oi(y.data,{dataset:r.dataset,collection:r.dataCollection},{logger:r.logger()},r.dataCollection);t?t.isFirst?(v=n,v.items&&(v.items=[...n.items])):v.items&&(v.items=[...v.items,...n.items||[]]):v=n}else v=h?h.data():[];"string"==typeof y.formatter||"object"==typeof y.formatter?d=r.formatter(y.formatter):h&&h.data().fields&&(d=h.data().fields[0].formatter()),m=l.style(y.style||{})},X.resize=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const n=k({inner:e,outer:t});p=n?$.size(n):$.size(e),D.rect=E(!0,{computedPhysical:p.computedPhysical,computedOuter:t.computed||t,computedInner:e.computed||e},e),p=E(!0,{computedOuter:t.computed||t,computedInner:e.computed||e},p)},X.getRect=()=>D.rect;const K=()=>{const e=$.renderArgs?$.renderArgs.slice(0):[],{rendererSettings:t}=y;let n=v;const i="function"==typeof(null==t?void 0:t.progressive)&&t.progressive();return v.items&&i&&(n=I(I({},v),{},{items:v.items.slice(i.start,i.end)})),e.push({data:n}),e};let G,J,Z;function Q(e){const{rendererSettings:t}=y,n="function"==typeof(null==t?void 0:t.progressive)&&t.progressive();n?n.isFirst?w.nodes=[...e||[]]:w.nodes&&(w.nodes=[...w.nodes,...e||[]]):w.nodes=e}X.beforeMount=T,X.beforeRender=()=>{L({size:p})},X.render=()=>{const e=j.call(M,...K());Q(e),$.render(e),G=e,J=D.rect.computed},X.hide=()=>{X.unmount(),$.size({x:0,y:0,width:0,height:0}),$.clear()},X.beforeUpdate=()=>{N({settings:y,data:v})},X.update=()=>{Z&&Z.stop();const{rendererSettings:e,brush:t,animations:n}=y;if("function"==typeof(null==e?void 0:e.transform)&&e.transform())return $.render(),void(G=null);const i=j.call(M,...K());Q(i),S.forEach((e=>e.cleanUp())),S.length=0,q.tap=[],q.over=[],t&&(H(),B()),S.forEach((e=>{e.isActive()&&e.update()})),G&&n&&("function"==typeof n.enabled?n.enabled():n.enabled)?(n.compensateForLayoutChanges&&n.compensateForLayoutChanges({currentNodes:G,currentRect:D.rect.computed,previousRect:J}),Z=function(e,t,n,i){let r,{old:o,current:s}=e,{renderer:a}=t,l=[],c={nodes:[],ips:[]},u={nodes:[],ips:[]},h={nodes:[],ips:[]},d=[],f=null;const p=n.trackBy||Jo,m={start(){let e={};if(o.forEach(((t,n)=>{let i=p(t,n);e[i]=t})),s.forEach(((t,n)=>{let i=p(t,n);if(e[i]){if("path"===t.type&&t.points&&t.points.length>0&&"trend"!==t.data.source.key){const n=function(e,t){const n=e.points.filter((e=>!e.dummy)),i=t.points.filter((e=>!e.dummy)),r=i.map((e=>e.data.major.value)),o=n.filter((e=>r.includes(e.data.major.value))).map((e=>e.data.major.value)),s=n.filter((e=>o.includes(e.data.major.value))),a=i.filter((e=>o.includes(e.data.major.value)));return{old:s,current:a}}(e[i],t);h.ips.push(Go(E({},e[i],{points:n.old}),E({},t,{points:n.current}))),l.push(E({},e[i],{commonPoints:n.old}))}else h.ips.push(Go(e[i],t)),l.push(e[i]);h.nodes.push(t),e[i]=!1}else c.nodes.push(t),c.ips.push(Go(E({},t,{r:.001,opacity:0}),t))})),Object.keys(e).forEach((t=>{e[t]&&(u.nodes.push(e[t]),u.ips.push(Go(e[t],E({},e[t],{r:1e-4,opacity:0}))))})),d.push({name:"exiting",easing:$o,duration:200,tweens:u.ips,nodes:[...l]}),d.push({name:"updating",easing:Uo,duration:400,tweens:h.ips,nodes:[]}),d.push({name:"entering",easing:Wo,duration:200,tweens:c.ips,nodes:[...h.nodes]}),n.isMainComponent){var t;const e=null===(t=n.isMainComponent)||void 0===t?void 0:t.filterFn,r=e?l.filter(e).length:l.length,{isInit:o,shouldBeRemoved:s}=i.getValue("animations.updatingStageMeta");!1===o?(i.setValue("animations.updatingStageMeta.shouldBeRemoved",0===r),i.setValue("animations.updatingStageMeta.isInit",!0)):i.setValue("animations.updatingStageMeta.shouldBeRemoved",s&&0===r)}d.length&&(f=a.getScene(s),d[0].started=Date.now(),"undefined"!=typeof window&&(r=window.requestAnimationFrame(m.tick)))},tick(){let e=d[0];e||m.stop(),e.started||(e.started=Date.now());let t=(Date.now()-e.started)/e.duration,n=[],o=e.tweens.map((n=>n(e.easing(Math.min(1,t)))));if(n.push(...o),n.push(...e.nodes),a.render(n),t>=1){d.shift();const{isInit:e,shouldBeRemoved:t}=i.getValue("animations.updatingStageMeta");d.length?"updating"===d[0].name&&t&&d.shift():(!0===e&&i.setValue("animations.updatingStageMeta.isInit",!1),m.stop())}r&&(r=window.requestAnimationFrame(m.tick))},stop(){r&&(window.cancelAnimationFrame(r),r=!1)},inProgress:()=>!!r,get targetScene(){return f}};return m}({old:G,current:i},{renderer:$},n,r.storage),Z.start()):$.render(i),G=i,J=D.rect.computed,$.setKey&&"string"==typeof g.key&&$.setKey(g.key)},X.updated=P,X.destroy=()=>{X.unmount(),F(f),$.destroy(),z(),f=null};const ee=e=>{w.nodes=e,S.forEach((e=>{e.isActive()&&e.update()})),$.render(e)};return As(M,e,{settings:()=>y,data:()=>v,scale:()=>h,formatter:()=>d,renderer:()=>$,chart:()=>r,dockConfig:()=>U,mediator:()=>s,instance:()=>D,rect:()=>D.rect,style:()=>m,update:()=>ee,registries:()=>a,resolver:()=>b,symbol:()=>Cs(a.symbol)}),As(D,g,{settings:()=>y,data:()=>v,scale:()=>h,formatter:()=>d,renderer:()=>$,chart:()=>r,dockConfig:()=>U,mediator:()=>s,style:()=>m,_DO_NOT_USE_getInfo:i.bind(M),isVisible:()=>x}),X.getBrushedShapes=function(e,t,n){const i=[];if(y.brush&&y.brush.consume){const o=r.brush(e),s=$.findShapes("*");y.brush.consume.filter((t=>t.context===e)).forEach((e=>{for(let r=0;r<s.length;r++){const a=s[r];a.data&&o.containsMappedData(a.data,n||e.data,t)&&(Y(a),i.push(a),s.splice(r,1),r--)}}))}return i},X.findShapes=e=>{var t;const n=(null!==(t=Z)&&void 0!==t&&t.inProgress()?Z.targetScene:$).findShapes(e);for(let e=0,t=n.length;e<t;e++)Y(n[e]);return n},X.shapesAt=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const n=$.itemsAt(e);let i;i=t&&"stop"===t.propagation&&n.length>0?[n.pop().node]:n.map((e=>e.node));for(let e=0,t=i.length;e<t;e++)Y(i[e]);return i},X.brushFromShapes=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};t.contexts=Array.isArray(t.contexts)?t.contexts:[];ss({nodes:e,action:t.action||"toggle",trigger:t,chart:r,data:w.data})},X.mount=()=>{f=$.element&&$.element()?f:$.appendTo(o),$.setKey&&"string"==typeof g.key&&$.setKey(g.key),y.brush&&(H(),B()),Is(D,u,g),Is(M,u,e),x=!0},X.mounted=()=>R(f),X.unmount=()=>{[D,M].forEach((e=>{!function(e,t){e.eventListeners&&(e.eventListeners.forEach((e=>{let{event:n,listener:i}=e;t.removeListener(n,i)})),e.eventListeners.length=0),e.emit=()=>{}}(e,u)})),q.tap=[],q.over=[],S.forEach((e=>{e.cleanUp()})),S.length=0,O(),x=!1},X.onBrushTap=e=>{q.tap.forEach((t=>{(function(e){let{e:t,t:n,config:i}=e;return as({collisions:ls(t,n,i.renderer),t:n,config:i,action:cs(n.action,t,"toggle")})})({e:e,t:t,config:w})&&"stop"===t.globalPropagation&&r.toggleBrushing(!0)}))},X.onBrushOver=e=>{q.over.forEach((t=>{(function(e){let{e:t,t:n,config:i}=e;return as({collisions:ls(t,n,i.renderer),t:n,config:i,action:cs(n.action,t,"set")})})({e:e,t:t,config:w})&&"stop"===t.globalPropagation&&r.toggleBrushing(!0)}))},X.def=M,X.ctx=D,X.renderer=()=>$,X.set({settings:g}),A(),X}function Os(e){const t=E(!0,{},e),n={getAll:()=>t,getValue:(e,n)=>function(e,t,n){if(void 0===e||void 0===t)return n;const i=t.split(".");let r=e;for(let e=0;e<i.length;++e){const t=i[e];if(void 0===r[t])return n;r=r[t]}return r}(t,e,n),setValue:(e,n)=>function(e,t,n){if(void 0===e||void 0===t)return;const i=t.split("."),r=i[i.length-1];let o=e;for(let e=0;e<i.length-1;++e){const t=i[e];void 0===o[t]&&(o[t]=Number.isNaN(+i[e+1])?{}:[]),o=o[t]}void 0!==n?o[r]=n:delete o[r]}(t,e,n)};return n}const Ns=1e-12;function Ps(e,t,n){const i=ms(function(e,t){const n=qs(e,t)/qs(t,t)||1;return{x:t.x*n,y:t.y*n}}(gs(n,e),gs(t,e)),e);return i}function Ls(e,t,n){return ws(e,n)+ws(t,n)-ws(e,t)<Ns}function Fs(e,t){return e.x>=t.x&&e.x+e.width<=t.x+t.width&&e.y>=t.y&&e.y+e.height<=t.y+t.height}function zs(e){return e.x1===e.x2&&e.y1===e.y2}function js(e){return e.width<=0||e.height<=0}function Hs(e){return e.r<=0}function Bs(e){return e.edges.length<=2}function Vs(e,t){let n=!1;for(let i=0,r=t.edges.length;i<r;i++)if(n=Gs(e,H(t.edges[i])),!0===n)return!0;return!1}function $s(e,t){let n=!1;const{numPolygons:i,polygons:r}=t;for(let t=0;t<i;t++){if(n=oa(e,r[t]),!0===n)return!0}return!1}function Ws(e,t){if(Hs(e))return!1;return xs({x:e.cx,y:e.cy},t)<=e.r**2}function Us(e,t){if(js(t)||Hs(e))return!1;const n=t.width/2,i=t.height/2,r=t.x+n,o=t.y+i,s=e.r,a=e.cx,l=e.cy,c=Math.abs(a-r),u=Math.abs(l-o);if(c>n+s||u>i+s)return!1;if(c<=n||u<=i)return!0;return(c-n)**2+(u-i)**2<=s**2}function Ys(e,t){if(Hs(e)||zs(t))return!1;const[n,i]=F(t);if(Ws(e,n)||Ws(e,i))return!0;const r={x:e.cx,y:e.cy},o=Ps(n,i,r);return xs(o,r)<=e.r**2&&Ls(n,i,o)}function Xs(e,t){if(Bs(t)||Hs(e))return!1;if(Ks(t,{x:e.cx,y:e.cy}))return!0;const n=t.edges.length;for(let i=0;i<n;i++){if(Ys(e,H(t.edges[i])))return!0}return!1}function Ks(e,t){if(Bs(e)||!ea(e.boundingRect(),t))return!1;const{x:n,y:i}=t,r=e.vertices;let o,s,a,l,c;for(o=!1,l=-1,s=r.length,a=s-1;++l<s;a=l){if(r[l].x===n&&r[l].y===i)return!0;if(r[l].y===r[a].y&&r[l].y===i&&(n-r[l].x)*(n-r[a].x)<=0)return!0;if(r[l].y<i&&i<=r[a].y||r[a].y<i&&i<=r[l].y){if(c=(r[a].x-r[l].x)*(i-r[l].y)/(r[a].y-r[l].y)+r[l].x,n===c)return!0;n<c&&(o=!o)}}return o}function Gs(e,t){if(Bs(e))return!1;for(let n=0,i=e.edges.length;n<i;n++){if(na(t,H(e.edges[n])))return!0}const[n,i]=F(t);return Ks(e,n)||Ks(e,i)}function Js(e,t){if(Bs(e))return!1;for(let n=0,i=e.edges.length;n<i;n++){if(ta(t,H(e.edges[n])))return!0}const[n,i,r,o]=z(t);return Ks(e,n)||Ks(e,i)||Ks(e,r)||Ks(e,o)}function Zs(e,t){return!js(e)&&!js(t)&&(e.x<=t.x+t.width&&t.x<=e.x+e.width&&e.y<=t.y+t.height&&t.y<=e.y+e.height)}function Qs(e,t){if(js(e)||js(t))return!1;return[{x:t.x,y:t.y},{x:t.x+t.width,y:t.y},{x:t.x+t.width,y:t.y+t.height},{x:t.x,y:t.y+t.height}].every((t=>ea(e,t)))}function ea(e,t){return!js(e)&&(t.x>=e.x&&t.x<=e.x+e.width&&t.y>=e.y&&t.y<=e.y+e.height)}function ta(e,t){if(zs(t)||js(e))return!1;const[n,i]=F(t);if(ea(e,n)||ea(e,i))return!0;const r=z(e);let o=r.length;for(let e=0;e<o;e++){if(na(H([r[e],r[3!==e?e+1:0]]),t))return!0}return!1}function na(e,t){const[n,i]=F(e),[r,o]=F(t),s=vs(i,n),a=bs(i,n),l=vs(o,r),c=bs(o,r),u=vs(n,r),h=bs(n,r);let d=c*s-l*a;const f=l*h-c*u,p=s*h-a*u;let m,g;if(0===s&&0===a)return!1;if(0===l&&0===c)return!1;if(0===d){if(0===f&&0===p){if(0===s){if(0===a)return n.x===i.x&&n.y===i.y;m=bs(r,n)/a,g=bs(o,n)/a}else m=(r.x-n.x)/s,g=(o.x-n.x)/s;return!(m<0&&g<0||m>1&&g>1)}return!1}const y=f/d;return d=p/d,y>=0&&y<=1&&d>=0&&d<=1}function ia(e,t){if(zs(e))return!1;const[n,i]=F(e);return Ls(n,i,t)}function ra(e,t){const n=e.boundingRect(),i=t.boundingRect();return!!Zs(n,i)&&(Qs(n,i)?Vs(e,t):Vs(t,e))}function oa(e,t){const n=e.boundingRect(),i=t.boundingRect();return!!Zs(n,i)&&(Qs(i,n)?function(e,t){let n=!1;const{numPolygons:i,polygons:r}=e;for(let e=0;e<i;e++)if(n=ra(t,r[e]),!0===n)return!0;return!1}(e,t):function(e,t){let n=!1;for(let i=0,r=t.edges.length;i<r;i++)if(n=la(e,H(t.edges[i])),!0===n)return!0;return!1}(e,t))}function sa(e,t){if(Hs(e))return!1;if(aa(t,{x:e.cx,y:e.cy}))return!0;const{numPolygons:n,polygons:i}=t;for(let t=0;t<n;t++){const n=i[t],r=n.edges.length;for(let t=0;t<r;t++){if(Ys(e,H(n.edges[t])))return!0}}return!1}function aa(e,t){if(!ea(e.boundingRect(),t))return!1;const{x:n,y:i}=t,r=e.numPolygons;let o,s,a,l,c,u,h=!1;for(s=0;s<r;s++)for(o=e.vertices[s],c=-1,a=o.length,l=a-1;++c<a;l=c){if(o[c].x===n&&o[c].y===i)return!0;if(o[c].y===o[l].y&&o[c].y===i&&(n-o[c].x)*(n-o[l].x)<=0)return!0;if(o[c].y<i&&i<=o[l].y||o[l].y<i&&i<=o[c].y){if(u=(o[l].x-o[c].x)*(i-o[c].y)/(o[l].y-o[c].y)+o[c].x,n===u)return!0;n<u&&(h=!h)}}return h}function la(e,t){const[n,i]=F(t);if(aa(e,n)||aa(e,i))return!0;const{numPolygons:r,polygons:o}=e;for(let e=0;e<r;e++){const n=o[e];for(let e=0,i=n.edges.length;e<i;e++){if(na(t,H(n.edges[e])))return!0}}return!1}function ca(e,t){const[n,i,r,o]=z(t);if(aa(e,n)||aa(e,i)||aa(e,r)||aa(e,o))return!0;const{numPolygons:s,polygons:a}=e;for(let e=0;e<s;e++){const n=a[e];for(let e=0,i=n.edges.length;e<i;e++){if(ta(t,H(n.edges[e])))return!0}}return!1}const ua=/^\$/,ha="@extend";function da(e){throw new Error('Cyclical reference for "'.concat(e,'"'))}function fa(e,t,n){if("string"==typeof e){let i=t[e];return-1!==n.indexOf(e)&&da(e),ua.test(i)?(n.push(e),fa(i,t,n)):i}let i=e;const r=E(!0,{},t,e),o={};if(e[ha]){const o=e[ha];-1!==n.indexOf(o)&&da(o);let s=n.slice();s.push(o),i=E(!0,{},fa(r[o],t,s),e)}return Object.keys(i).forEach((e=>{let t=n.slice();if(e===ha||ua.test(e))return;o[e]=i[e];let s=o[e];ua.test(s)&&s in r?(-1!==n.indexOf(s)&&da(s),t.push(s),s=r[s],"object"==typeof s||ua.test(s)&&s in r?o[e]=fa(s,r,t):o[e]=s):"object"==typeof s&&(o[e]=fa(s,r,t))})),o}function pa(e,t){return fa(e,t,[])}function ma(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t={},n=e;const i=e=>{e.forEach((e=>{const n=Array.isArray(e.colors[0])?e.colors:[e.colors];t[e.key]={colors:n,sizes:n.map((e=>e?e.length:0))}}))},r={palette:(e,n)=>((e,n)=>{const i=t[e];if(!i)return[];const r=i.sizes;for(let e=0;e<r.length;e++)if(n<=r[e])return i.colors[e];return i.colors[r.length-1]})(e,n),setPalettes:i,style:e=>pa(e,n),setStyle:t=>{n=E({},e,t)}};return i(arguments.length>1&&void 0!==arguments[1]?arguments[1]:[]),r}function ga(e){e.x=Math.floor(e.x),e.y=Math.floor(e.y),e.width=Math.floor(e.width),e.height=Math.floor(e.height)}function ya(e){const t={center:{minWidthRatio:.5,minHeightRatio:.5,minWidth:0,minHeight:0}};return E(!0,t,e),t.center.minWidthRatio=Math.min(Math.max(t.center.minWidthRatio,0),1),t.center.minHeightRatio=Math.min(Math.max(t.center.minHeightRatio,0),1),t.center.minWidth=Math.max(t.center.minWidth,0),t.center.minHeight=Math.max(t.center.minHeight,0),t}function va(e,t,n,i,r){return{x:isNaN(e)?0:e,y:isNaN(e)?0:t,width:isNaN(e)?0:n,height:isNaN(e)?0:i,margin:isNaN(r)?0:r}}function ba(e,t,n){if(void 0===e.cachedSize){const i=e.config.dock();let r,o=e.comp.preferredSize({inner:t,outer:n,dock:i});isNaN(o)?o&&!isNaN(o.size)&&(o.width=o.size,o.height=o.size):o={width:o,height:o},r="top"===i||"bottom"===i?o.height:"right"===i||"left"===i?o.width:Math.max(o.width,o.height),e.cachedSize=Math.ceil(r),e.edgeBleed=o.edgeBleed||0}return e.cachedSize}function xa(e,t){switch(t.config.dock()){case"top":e.y+=t.cachedSize,e.height-=t.cachedSize;break;case"bottom":e.height-=t.cachedSize;break;case"left":e.x+=t.cachedSize,e.width-=t.cachedSize;break;case"right":e.width-=t.cachedSize}}function wa(e,t){const n=t.edgeBleed;n&&(e.left=Math.max(e.left,n.left||0),e.right=Math.max(e.right,n.right||0),e.top=Math.max(e.top,n.top||0),e.bottom=Math.max(e.bottom,n.bottom||0))}function qa(e,t,n){t.x<n.left&&(t.width-=n.left-t.x,t.x=n.left);const i=e.width-(t.x+t.width);i<n.right&&(t.width-=n.right-i),t.y<n.top&&(t.height-=n.top-t.y,t.y=n.top);const r=e.height-(t.y+t.height);r<n.bottom&&(t.height-=n.bottom-r)}function Sa(e,t,n,i,r){const o=E({},t),s=E({},n);xa(o,i),wa(s,i),qa(e,o,s);const a=function(e,t,n){const i=Math.min(n.center.minWidth,e.width)||Math.max(e.width*n.center.minWidthRatio,1),r=Math.min(n.center.minHeight,e.height)||Math.max(e.height*n.center.minHeightRatio,1);return t.width>=i&&t.height>=r}(e,o,r);return!!a&&(xa(t,i),wa(n,i),!0)}function Ma(e){return{x:e.margin.left+e.x*e.scaleRatio.x,y:e.margin.top+e.y*e.scaleRatio.y,width:e.width*e.scaleRatio.x,height:e.height*e.scaleRatio.y}}function Da(e){return j([].concat(...e.map(z)))}function _a(e){let{visible:t,layoutRect:n,reducedRect:i,containerRect:r,translation:o}=e;const s=va(i.x,i.y,i.width,i.height),a=va(i.x,i.y,i.width,i.height),l={},c=t.slice(),u=c.slice().sort(((e,t)=>e.config.displayOrder()-t.config.displayOrder()));return t.sort(((e,t)=>{if(e.referencedDocks.length>0&&t.referencedDocks.length>0)return 0;if(t.referencedDocks.length>0)return-1;if(e.referencedDocks.length>0)return 1;const n=e.config.displayOrder()-t.config.displayOrder();return 0===n?c.indexOf(e)-c.indexOf(t):n})).forEach((e=>{let t={},c={};switch(e.config.dock()){case"top":t.height=c.height=e.cachedSize,t.width=n.width,c.width=s.width,t.x=n.x,c.x=s.x,t.y=c.y=s.y-e.cachedSize,s.y-=e.cachedSize,s.height+=e.cachedSize;break;case"bottom":t.x=n.x,c.x=s.x,t.y=c.y=s.y+s.height,t.width=n.width,c.width=s.width,t.height=c.height=e.cachedSize,s.height+=e.cachedSize;break;case"left":t.x=c.x=a.x-e.cachedSize,t.y=n.y,c.y=a.y,t.width=c.width=e.cachedSize,t.height=n.height,c.height=a.height,a.x-=e.cachedSize,a.width+=e.cachedSize;break;case"right":t.x=c.x=a.x+a.width,t.y=n.y,c.y=a.y,t.width=c.width=e.cachedSize,t.height=n.height,c.height=a.height,a.width+=e.cachedSize;break;case"center":t.x=c.x=i.x,t.y=c.y=i.y,t.width=c.width=i.width,t.height=c.height=i.height;break;default:if(e.referencedDocks.length>0){const n=e.referencedDocks.map((e=>l[e])).filter((e=>!!e));n.length>0&&(t=Da(n.map((e=>e.outerRect))),c=Da(n.map((e=>e.r))))}}e.key&&(l[e.key]={r:c,outerRect:t}),function(e,t,n,i){const r={x:i.width/n.width,y:i.height/n.height},o={left:0,top:0};if(n.preserveAspectRatio){const e=r.x<r.y,t=Math.min(r.x,r.y);r.x=t,r.y=t;const s=e?"height":"width",a=(i[s]-n[s]*r.x)*n.align;o.left=e?0:a,o.top=e?a:0}e.scaleRatio=r,e.margin=o,t.scaleRatio=r,t.margin=o,n.scaleRatio=r,n.margin=o}(c,t,n,r),c.edgeBleed=e.edgeBleed,c.computed=Ma(c),t.edgeBleed=e.edgeBleed,t.computed=Ma(t),c.x+=o.x,c.y+=o.y,t.x+=o.x,t.y+=o.y,e.comp.resize(c,t),e.cachedSize=void 0,e.edgeBleed=void 0})),u}function Ca(e,t,n){const i=e.layoutModes||{},r=t.minimumLayoutMode();let o=t.show();return o&&"object"==typeof r?o=i[r.width]&&i[r.height]&&n.width>=i[r.width].width&&n.height>=i[r.height].height:o&&void 0!==r&&(o=i[r]&&n.width>=i[r].width&&n.height>=i[r].height),o}function ka(e){if(!e.resize||"function"!=typeof e.resize)throw new Error("Component is missing resize function");if(!e.dockConfig&&!e.preferredSize)throw new Error("Component is missing preferredSize function")}function Ea(e){let t=ya(e);const n={};return n.layout=function(e){let n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];if(!e||isNaN(e.x)||isNaN(e.y)||isNaN(e.width)||isNaN(e.height))throw new Error("Invalid rect");if(!n.length)return{visible:[],hidden:[],ordered:[]};const{logicalContainerRect:i,containerRect:r}=function(e,t){const n={x:0,y:0,width:0,height:0},i={x:0,y:0,width:0,height:0};return n.width=e.width||0,n.height=e.height||0,void 0!==t.size&&(n.width=isNaN(t.size.width)?n.width:t.size.width,n.height=isNaN(t.size.height)?n.height:t.size.height),void 0!==t.logicalSize?(i.width=isNaN(t.logicalSize.width)?n.width:t.logicalSize.width,i.height=isNaN(t.logicalSize.height)?n.height:t.logicalSize.height,i.align=isNaN(t.logicalSize.align)?.5:Math.min(Math.max(t.logicalSize.align,0),1),i.preserveAspectRatio=t.logicalSize.preserveAspectRatio):(i.width=n.width,i.height=n.height,i.preserveAspectRatio=!1),ga(i),ga(n),{logicalContainerRect:i,containerRect:n}}(e,t),[o,s]=function(e,t,n){const i=[],r=[];for(let o=0;o<e.length;++o){const s=e[o];ka(s);let a=s.dockConfig;const l=s.key,c=a.dock(),u=/@/.test(c)?c.split(",").map((e=>e.replace(/^\s*@/,""))):[];Ca(t,a,n)?i.push({comp:s,key:l,config:a,referencedDocks:u}):r.push({comp:s,key:l,config:a,referencedDocks:u})}return[i,r]}(n,t,i),a=function(e){let{layoutRect:t,visible:n,hidden:i,settings:r}=e;const o=va(t.x,t.y,t.width,t.height),s={left:0,right:0,top:0,bottom:0},a=n.slice();a.sort(((e,t)=>e.config.prioOrder()-t.config.prioOrder()));for(let e=0;e<a.length;++e){const n=a[e];ba(n,o,t),Sa(t,o,s,n,r)||(i.push(a.splice(e,1)[0]),--e)}!function(e,t){if(0!==t.length)for(let n=0;n<e.length;++n){let i=e[n];if(i.referencedDocks.length){const r=i.referencedDocks.every((e=>t.some((t=>t.key===e))));r&&t.push(e.splice(n,1)[0])}}}(n,i);const l=n.filter((e=>-1!==a.indexOf(e)));return n.length=0,n.push(...l),qa(t,o,s),o}({layoutRect:i,visible:o,hidden:s,settings:t}),l=_a({visible:o,layoutRect:i,reducedRect:a,containerRect:r,translation:{x:e.x,y:e.y}});return s.forEach((e=>{e.comp.visible=!1;const t=va();e.comp.resize(t,t)})),{visible:o.map((e=>e.comp)),hidden:s.map((e=>e.comp)),ordered:l.map((e=>e.comp))}},n.settings=function(e){t=ya(e)},n}const Aa=(e,t)=>{for(let n=0;n<e.length;n++){const i=e[n];if(i.hasKey&&i.key===t)return e[n]}return null},Ta=e=>null==e?void 0:e.map((e=>{const t=e.instance.dockConfig();return{preferredSize:n=>t.computePreferredSize(I(I({},n),{},{children:Ta(e.children)}))}})),Ia=(e,t)=>({visible:[],hidden:t,ordered:[]}),Ra=e=>(t,n)=>{var i;const r=n.map(((e,t)=>{const n=e.instance.dockConfig();return{index:t,key:e.key,dockConfig:n,resize:e.instance.resize,preferredSize:t=>n.computePreferredSize(I(I({},t),{},{children:Ta(e.children)}))}})),o=e=>n[e.index],{visible:s=r,hidden:a=[],ordered:l=s}=null!==(i=e(t,r))&&void 0!==i?i:{};return{visible:s.map(o),hidden:a.map(o),ordered:l.map(o)}},Oa=e=>"function"==typeof e?Ra(e):(e=>{const t=Ea(e);return Ra(((e,n)=>t.layout(e,n)))})(e);function Na(e,t,n){const i=t.left-n.left,r=t.top-n.top,o=B(e),s=E(!0,{},e);switch(o){case"circle":s.cx+=i,s.cy+=r;break;case"polygon":for(let e=0,t=s.vertices.length;e<t;e++){const t=s.vertices[e];t.x+=i,t.y+=r}break;case"geopolygon":for(let e=0;e<s.vertices.length;e++){const t=s.vertices[e];for(let e=0,n=t.length;e<n;e++){const n=t[e];n.x+=i,n.y+=r}}break;case"line":s.x1+=i,s.y1+=r,s.x2+=i,s.y2+=r;break;case"point":case"rect":s.x+=i,s.y+=r}return s}const Pa=(e,t,n)=>{const i=t.instance.renderer().element();if(isNaN(n)||!i||!e||!e.children)return;const r=e.children[Math.max(0,n)];if(i===r)return;const o=t.instance.def.additionalElements&&t.instance.def.additionalElements().filter(Boolean);e.insertBefore&&void 0!==r?(e.insertBefore(i,r),o&&o.forEach((t=>{e.insertBefore(t,i)}))):(o&&o.forEach((t=>{e.appendChild(t,i)})),e.appendChild(i))};function La(e,t){const n=[];let i=0;t.forEach((e=>{n.push(i),i++;const t=e.instance.def.additionalElements&&e.instance.def.additionalElements();t&&(i+=t.length)})),t.forEach(((t,i)=>Pa(e,t,n[i])))}function Fa(e,t){let{element:n,data:i=[],settings:r={},on:o={}}=e;const s=t.registries,a=t.logger,l=ma(t.style,t.palettes),c=[],u=E({},e),h=function(){const e={};return Do.mixin(e),e}();let d=[],f=null,p=null,m=null,g=[],y=()=>{},v=()=>{};const b={};let x=!1;const w=function(e){let{createComponent:t}=e;const n={};let i=[],r=[];const o=e=>{const n=t(e);return n&&(i.push(n),e.components&&(n.children=e.components.map((e=>o(e))).filter((e=>!!e)))),n},s=e=>{const t=i.indexOf(e);-1!==t&&i.splice(t,1)},a=(e,t)=>{for(let n=e.length-1;n>=0;n--){const i=e[n],r=t.find((e=>i.hasKey&&i.key===e.key));r?i.children&&r.components&&a(i.children,r.components):(e.splice(n,1),s(i),i.children&&a(i.children,[]),i.instance.destroy())}},l=e=>{let{compList:t,data:n,excludeFromUpdate:i,formatters:r,scales:s,settingsList:a}=e;return a.map((e=>{const a=Aa(t,e.key);return i.indexOf(e.key)>-1?(delete a.updateWith,a):a?(e.rendererSettings&&"function"==typeof a.instance.renderer().settings&&a.instance.renderer().settings(e.rendererSettings),e.rendererSettings&&"function"==typeof e.rendererSettings.transform&&e.rendererSettings.transform()?(a.applyTransform=!0,a):(a.updateWith={formatters:r,scales:s,data:n,settings:e},e.components&&(a.children=l({compList:a.children||[],data:n,excludeFromUpdate:i,formatters:r,scales:s,settingsList:e.components})),a)):o(e)})).filter((e=>!!e))},c=e=>{let{components:t,hidden:n,layoutFn:i,ordered:r,rect:o,visible:s}=e;const{visible:a,hidden:l,ordered:u}=i(o,t);s.push(...a),n.push(...l),r.push(...u),a.forEach((e=>{if(e.children){var t,i;const o=Oa(null!==(t=null===(i=e.settings)||void 0===i?void 0:i.strategy)&&void 0!==t?t:{});c({components:e.children,hidden:n,layoutFn:o,ordered:r,rect:e.instance.getRect(),visible:s})}})),l.forEach((e=>{e.children&&c({components:e.children,hidden:n,layoutFn:Ia,ordered:r,rect:null,visible:s})}))};return n.destroy=()=>{i.forEach((e=>e.instance.destroy())),i=[],r=[]},n.findComponentByKey=e=>Aa(i,e),n.forEach=e=>{i.forEach(e)},n.layout=e=>{let{layoutSettings:t,rect:n}=e;const i=[],o=[],s=[],a=Oa(t);return c({components:r,hidden:o,layoutFn:a,ordered:s,rect:n,visible:i}),{visible:i,hidden:o,ordered:s}},n.set=e=>{let{components:t}=e;r=t.map((e=>o(e))).filter((e=>!!e))},n.update=e=>{let{components:t,data:n,excludeFromUpdate:i,formatters:o,scales:s}=e;a(r,t),r=l({compList:r,data:n,excludeFromUpdate:i,formatters:o,scales:s,settingsList:t})},n}({createComponent:e=>{if(!s.component.has(e.type))return a.warn("Unknown component: ".concat(e.type)),!1;return{instance:Rs(s.component(e.type),{settings:e,chart:u,mediator:h,registries:s,theme:l,container:n}),settings:E(!0,{},e),key:e.key,hasKey:void 0!==e.key}}});function q(t){let n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:()=>{};return function(){const i="function"==typeof e[t];let r;for(var o=arguments.length,s=new Array(o),a=0;a<o;a++)s[a]=arguments[a];return r=i?e[t].call(u,...s):n.call(u,...s),r}}const S=()=>{let e;r.dockLayout?(a.warn('Deprecation Warning: "dockLayout" property should be renamed to "strategy"'),e=r.dockLayout):e=r.strategy;const t=function(e){if("function"==typeof e.getBoundingClientRect){const{width:t,height:n}=e.getBoundingClientRect();return{x:0,y:0,width:t,height:n}}return{x:0,y:0,width:0,height:0}}(n);return w.layout({layoutSettings:e,rect:t})},M=q("created"),D=q("beforeMount"),_=q("mounted"),C=q("beforeUpdate"),k=q("updated"),A=q("beforeRender"),T=q("beforeDestroy"),R=q("destroyed"),N=function(e,t){let{partialData:n}=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const{formatters:i={},scales:r={},scroll:o={}}=t;y=function(e,t){let{types:n,logger:i}=t;const r={},o=[];return Array.isArray(e)?o.push(...e):(i.warn('Deprecated: "data-source" configuration"'),o.push(e)),o.forEach(((e,t)=>{let o=n(e.type);if(o){let n=e.key;void 0===e.key&&(i.warn("Missing key for dataset. Using index '".concat(t,"' as key.")),n=t);let s=o({key:n,data:e.data,config:e.config});r[n]=s}})),e=>e?r[e]:r[Object.keys(r)[0]]}(e,{logger:a,types:s.data}),n||Object.keys(b).forEach((e=>b[e].clear())),t.palettes&&l.setPalettes(t.palettes),t.style&&l.setStyle(t.style),v=function(e,t,n){let i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:Oi;const r={};return(e||[]).forEach((e=>{if(!e.key)throw new Error('Data collection is missing "key" property');if("object"==typeof e.data&&"collection"in e.data)throw new Error("Data config for collections may not reference other collections");r[e.key]=()=>i(e.data,t,n)})),e=>{let t,n;if("string"==typeof e?t=e:"object"==typeof e&&(t=e.key,n=e),!(t in r))throw new Error("Unknown data collection: ".concat(t));"function"==typeof r[t]&&(r[t]=r[t]());let i=r[t];if(n&&n.fields&&n.fields.filter){let e=i.fields.filter(n.fields.filter);i.fields.length!==e.length&&(i=E(i,{fields:e}))}return i}}(t.collections,{dataset:y},{logger:a});const c={theme:l,logger:a};f=function(e,t,n){let i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:wo;const r={};return{get(o){let s;return"string"==typeof o&&e[o]?s=o:"object"==typeof o&&"scale"in o&&e[o.scale]&&(s=o.scale),s?(r[s]=r[s]||i(e[s],t,n),r[s]):i(o,t,n)},all(){return Object.keys(e).forEach(this.get),r}}}(r,{dataset:y,collection:v},I(I({},c),{},{scale:s.scale})),p=function(e,t,n){let i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:Ni;const r={};return{get(o){let s;return"string"==typeof o&&e[o]?s=o:"object"==typeof o&&"formatter"in o&&e[o.formatter]?s=o.formatter:"object"==typeof o&&"type"in o&&e[o.type]&&(s=o.type),s?(r[s]=r[s]||i(e[s],t,n),r[s]):i(o||{},t,n)},all(){return Object.keys(e).forEach(this.get),r}}}(i,{dataset:y,collection:v},I(I({},c),{},{formatter:s.formatter})),m=function(e,t){const n={};for(const i in e)Object.prototype.hasOwnProperty.call(e,i)&&(n[i]=Co(e[i],t?t[i]:null));return n}(o,m)};function P(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];const t={},i=e.filter((e=>!!e.key)).map((e=>e.key));g.forEach((e=>{e.key&&-1!==i.indexOf(e.key)?t[e.key]=e:e.destroy()})),g=e.map((e=>{const i=e.key&&t[e.key]?t[e.key]:s.interaction(e.type)(u,h,n);return i.set(e),i}))}const L=e=>{const t=n.getBoundingClientRect(),i="clientX"in e?e.clientX:e.x,r="clientY"in e?e.clientY:e.y,o={x:i-t.left,y:r-t.top},s=[];return d.forEach((e=>{const t=e.instance.getRect();ea(t.computedPhysical?t.computedPhysical:{x:t.margin.left+t.x*t.scaleRatio.x,y:t.margin.top+t.y*t.scaleRatio.y,width:t.width*t.scaleRatio.x,height:t.height*t.scaleRatio.y},o)&&s.push(e)})),s},F=()=>{if(c.length||!n)return;Object.keys(o).forEach((e=>{const t=o[e].bind(u);n.addEventListener(e,t),c.push({key:e,listener:t})}));const e={},t=t=>{t.touches?(e.x=t.touches[0].clientX,e.y=t.touches[0].clientY,e.multiTouch=t.touches.length>1):(e.x=t.clientX,e.y=t.clientY,e.multiTouch=!1),e.time=Date.now(),e.comps=L(e)},i=t=>{const n=e.comps||L(t);if(!n.every((e=>e.instance.def.disableTriggers))&&("touchend"===t.type&&t.preventDefault(),function(e,t){const n=O(e),i=n?e.changedTouches[0]:e,r=Date.now()-t.time,o=isNaN(t.x)?0:Math.abs(i.clientX-t.x),s=isNaN(t.y)?0:Math.abs(i.clientY-t.y);return(0===e.button||n)&&!t.multiTouch&&o<=12&&s<=12&&r<=300}(t,e)))for(let e=n.length-1;e>=0;e--){if(n[e].instance.onBrushTap(t),x){x=!1;break}}},r=[];r.push({key:"mousedown",listener:t}),r.push({key:"mouseup",listener:i}),function(e){return"ontouchstart"in e&&"ontouchend"in e||navigator.maxTouchPoints>1}(n)&&(r.push({key:"touchstart",listener:t}),r.push({key:"touchend",listener:i})),r.push({key:"mousemove",listener:e=>{const t=L(e);for(let n=t.length-1;n>=0;n--){if(t[n].instance.onBrushOver(e),x){x=!1;break}}}}),r.forEach((e=>{n.addEventListener(e.key,e.listener),c.push(e)}))},z=()=>{c.forEach((e=>{let{key:t,listener:i}=e;return n.removeEventListener(t,i)})),c.length=0},j=()=>{n.innerHTML="",(()=>{const{components:e=[]}=r;A(),N(i,r),w.set({components:e});const{visible:t,hidden:o,ordered:s}=S();d=t,o.forEach((e=>{e.instance.hide(),e.visible=!1})),t.forEach((e=>e.instance.beforeMount())),t.forEach((e=>e.instance.mount())),t.forEach((e=>e.instance.beforeRender())),t.forEach((e=>e.instance.render())),t.forEach((e=>e.instance.mounted())),t.forEach((e=>{e.visible=!0})),La(n,s)})(),F(),P(r.interactions)};return u.layoutComponents=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const{excludeFromUpdate:t=[]}=e;e.data&&(i=e.data),e.settings&&(r=e.settings,P(e.settings.interactions)),C(),N(i,r);const{formatters:n,scales:o,components:s=[]}=r;w.update({components:s,data:i,excludeFromUpdate:t,formatters:n,scales:o}),w.forEach((e=>{e.updateWith&&e.instance.set(e.updateWith)})),w.forEach((e=>{e.updateWith&&e.instance.beforeUpdate()})),S()},u.update=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const{partialData:t,excludeFromUpdate:o=[]}=e;let s;e.data&&(i=e.data),e.settings&&(r=e.settings,P(e.settings.interactions)),C(),N(i,r,{partialData:t});const{formatters:a,scales:l,components:c=[]}=r;w.update({components:c,data:i,excludeFromUpdate:o,formatters:a,scales:l}),w.forEach((e=>{e.updateWith&&e.instance.set(e.updateWith)})),w.forEach((e=>{e.updateWith&&e.instance.beforeUpdate()}));const u=[],h=[];let f;if(t)w.forEach((e=>{(e.updateWith||e.applyTransform)&&e.visible&&u.push(e)})),f=u;else{const{visible:e,hidden:t,ordered:n}=S();d=e,f=e,s=n,e.forEach((e=>{e.updateWith&&e.visible?u.push(e):h.push(e)})),t.forEach((e=>{e.instance.hide(),e.visible=!1,delete e.updateWith,e.applyTransform=!1}))}h.forEach((e=>e.instance.beforeMount())),h.forEach((e=>e.instance.mount())),f.forEach((e=>e.instance.beforeRender())),f.forEach((e=>{(e.updateWith||e.applyTransform)&&e.visible?e.instance.update():e.instance.render()})),t||La(n,s),h.forEach((e=>e.instance.mounted())),u.forEach((e=>e.instance.updated())),d.forEach((e=>{delete e.updateWith,e.visible=!0,e.applyTransform=!1})),k()},u.destroy=()=>{T(),w.destroy(),z(),P(),delete u.update,delete u.destroy,R()},u.getAffectedShapes=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"and",n=arguments.length>2?arguments[2]:void 0,i=arguments.length>3?arguments[3]:void 0,r=[];return d.filter((e=>null==i||e.key===i)).forEach((i=>{const o=i.instance.getBrushedShapes(e,t,n);r=[...r,...o]})),r},u.findShapes=e=>{let t=[];return d.forEach((n=>{const i=n.instance.findShapes(e);t=[...t,...i]})),t},u.componentsFromPoint=e=>L(e).map((e=>e.instance.ctx)),u.shapesAt=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=[];const r=n.getBoundingClientRect();let o=d;if(Array.isArray(t.components)&&t.components.length>0){const e=t.components.map((e=>e.key));o=d.filter((t=>-1!==e.indexOf(t.key))).map((n=>({instance:n.instance,opts:t.components[e.indexOf(n.key)]})))}for(let n=o.length-1;n>=0;n--){const s=o[n],a=Na(e,r,s.instance.renderer().element().getBoundingClientRect()),l=s.instance.shapesAt(a,s.opts),c=l.length>0&&"stop"===t.propagation;if(i=[...i,...l],i.length>0&&c)return i}return i},u.brushFromShapes=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{components:[]};for(let n=0;n<t.components.length;n++){const i=t.components[n].key;d.filter((e=>i===e.key)).forEach((i=>{let r=e.filter((e=>e.key===i.key));i.instance.brushFromShapes(r,t.components[n])}))}},u.scroll=function(){return function(e,t){return t[e]||(t[e]=_o()),t[e]}(arguments.length>0&&void 0!==arguments[0]?arguments[0]:"default",m)},u.dataset=e=>y(e),u.dataCollection=e=>v(e),u.scales=function(){return f.all()},u.formatters=function(){return p.all()},u.brush=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"default";return b[e]||(b[e]=Vo()),b[e]},u.scale=function(e){return f.get(e)},u.formatter=function(e){return p.get(e)},u.toggleBrushing=function(e){x=void 0!==e?e:!x},u.component=e=>{const t=w.findComponentByKey(e);return null==t?void 0:t.instance.ctx},u.logger=()=>a,u.theme=()=>l,u.storage=Os({animations:{updatingStageMeta:{isInit:!1,shouldBeRemoved:!1}}}),Object.defineProperty(u,"interactions",{get:()=>({instances:g,on(){F(),g.forEach((e=>e.on()))},off(){z(),g.forEach((e=>e.off()))}})}),M(),n&&(D(),j(),_(n),u.element=n),u}const za=e=>{let t=Ue(e);return t.prio=e=>e?t.default(e[0]):[t.default()],t.types=()=>t.getKeys(),t};var ja=Ue();function Ha(e,t,n){let{key:i}=n;const r={value:"function"==typeof e.value?e.value(t):void 0!==e.value?e.value:t};return r.label="function"==typeof e.label?e.label(t):void 0!==e.label?String(e.label):String(r.value),e.field&&(r.source={key:i,field:e.field.key()}),r}const Ba=e=>e.filter((e=>"number"==typeof e&&!isNaN(e)));const Va=e=>{let{key:t,data:n,cache:i,config:r}=e;if(!n)return;let o=n;"string"==typeof o&&(o=(e=>{let{data:t,config:n}=e;const i=t.split("\n"),r=i[0],o=i[1];let s=",";if(n&&n.parse&&n.parse.delimiter)s=n.parse.delimiter;else if(r){const e=[/,/,/\t/,/;/];for(let t=0;t<e.length;t++){const n=e[t];if(r&&o){if(n.test(r)&&n.test(o)&&r.split(n).length===o.split(n).length){s=n;break}}else n.test(r)&&(s=n)}}return i.map((e=>e.split(s)))})({data:n,config:r})),Array.isArray(o)&&function(e){let t,{source:n,data:i,cache:r,config:o}=e,s=i;const a=o&&o.parse;Array.isArray(i[0])?a&&!1===a.headers?t=i[0].map(((e,t)=>t)):(t=i[0],s=i.slice(1)):t=Object.keys(i[0]);const l=!!a&&"function"==typeof a.row&&a.row;let c,u=t;u=a&&"function"==typeof a.fields?a.fields(u.slice()):t.map((e=>({key:e,title:e}))),Array.isArray(i[0])?c=u.map((()=>[])):(c={},u.forEach((e=>{c[e.key]=[]})));for(let e=0;e<s.length;e++){const t=l?l(s[e],e,u):s[e];if(t)if(Array.isArray(t))for(let e=0;e<u.length;e++)c[e].push(t[e]);else for(let e=0;e<u.length;e++)c[u[e].key].push(t[u[e].key])}const h=Array.isArray(c)?e=>c[e]:e=>c[u[e].key];for(let e=0;e<u.length;e++){const t=h(e),i=Ba(t),o=i.length>0,s=o?"measure":"dimension",a=o?Math.min(...i):NaN,l=o?Math.max(...i):NaN;r.fields.push(bi(E({source:n,key:e,title:u[e].title,values:t,min:a,max:l,type:s},u[e]),{value:u[e].value,label:u[e].label}))}}({data:o,cache:i,source:t,config:r})};function $a(){let{key:e,data:t,config:n}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const i={fields:[]},r={key:()=>e,raw:()=>t,field:e=>function(e,t){let{cache:n}=t;if("number"==typeof e)return n.fields[e];for(let t=0;t<n.fields.length;t++)if(n.fields[t].key()===e)return n.fields[t];for(let t=0;t<n.fields.length;t++)if(n.fields[t].title()===e)return n.fields[t];return null}(e,{cache:i,matrix:t}),fields:()=>i.fields.slice(),extract:e=>function(e,t){const n=Array.isArray(e)?e:[e];let i=[];return n.forEach((e=>{if(void 0!==e.field){const n=t.field(e.field),r=t.key();if(!n)throw Error("Field '".concat(e.field,"' not found"));const{props:o,main:s}=Mi(e,t),a=Object.keys(o),l=!!e.trackBy,c=typeof e.trackBy,u={},h=[],d=n.items(),f=[];for(let t=0;t<d.length;t++){const n=d[t];if(s.filter&&!s.filter(n))continue;const i=Ha(s,n,{key:r});a.forEach((e=>{const s=o[e];let a=s.field?s.field.items()[t]:n;i[e]=Ha(s,a,{key:r})})),l&&Ci({cfg:e,itemData:n,obj:i,target:h,tracker:u,trackType:c}),f.push(i)}i=l?[...i,..._i(h,{main:s,propsArr:a,props:o})]:[...i,...f]}})),i}(e,r),hierarchy:()=>null};return Va({key:e,data:t,config:n,cache:i}),r}$a.util={normalizeConfig:Mi,collect:_i,track:Ci};const Wa=Ue();Wa.default("matrix"),Wa("matrix",$a),Wa("default",$a);const Ua=Ue();function Ya(e,t,n){return Math.max(e,Math.min(t,n))}function Xa(e){let{item:t,value:n,boxCenter:i,rendWidth:r,rendHeight:o,flipXY:s,symbol:a}=e,l="x",c="y",u=r,h=o,d=n<.5?90:-90;return s&&(l="y",c="x",u=o,h=r,d=n<.5?180:0),a(E({},t.oob,{[l]:i*u,[c]:Math.max(t.oob.size/2,Math.min(n*h,h-t.oob.size/2)),startAngle:d}))}function Ka(e){let{item:t,boxWidth:n,boxPadding:i,rendWidth:r,rendHeight:o,flipXY:s}=e,a="x",l="y",c="width",u="height",h=r,d=o;s&&(a="y",l="x",c="height",u="width",h=o,d=r);const{actualDiff:f,actualLow:p}=function(e){let{start:t,end:n,minPx:i=.1,maxPx:r=1}=e;const o=Math.max(t,n),s=Math.min(t,n),a=Ya(-.1,1.2,o),l=Ya(-.1,1.2,s),c=a*r-l*r,u=Math.max(i,c),h=(u-c)/2;return{actualDiff:u,startModifier:h,actualLow:l*r-h}}({start:t.start,end:t.end,minPx:t.box.minHeightPx,maxPx:d});return E({},t.box,{type:"rect",[a]:(i+t.major)*h,[l]:p,[u]:f,[c]:n*h,data:t.data||{},collider:{type:null}})}function Ga(e){let{item:t,from:n,to:i,boxCenter:r,rendWidth:o,rendHeight:s,flipXY:a}=e,l="x1",c="y1",u="x2",h="y2",d=o,f=s;return a&&(l="y1",c="x1",u="y2",h="x2",d=s,f=o),E({},t.line,{type:"line",[h]:Math.floor(n*f),[l]:r*d,[c]:Math.floor(i*f),[u]:r*d,data:t.data||{},collider:{type:null}})}function Ja(e){let{item:t,key:n,position:i,width:r,boxCenter:o,rendWidth:s,rendHeight:a,flipXY:l}=e,c="x1",u="y1",h="x2",d="y2",f=s,p=a;l&&(c="y1",u="x1",h="y2",d="x2",f=a,p=s);const m=r/2;return E({type:"line"},t[n],{[u]:Math.floor(i*p),[c]:(o-m)*f,[d]:Math.floor(i*p),[h]:(o+m)*f,r:m*f,cx:o*f,cy:i*p,width:r*f,data:t.data||{},collider:{type:null}})}function Za(e,t,n){const{width:i,maxWidthPx:r,minWidthPx:o}=t.box,s=e>=0?1:-1;let a=Math.min(s*e*i,isNaN(r)?n:r/n);return a=isNaN(o)?a:Math.max(o/n,a),a*s}Ua("native",(function(e,t,n){let i,r,o={chart:e,mediator:t,element:n},s=[],a=!0;function l(){"function"==typeof i.enable&&(i.enable=i.enable.bind(o)()),i.enable&&Object.keys(i.events).forEach((e=>{const t=i.events[e].bind(o);n.addEventListener(e,t),s.push({key:e,listener:t})}))}function c(){s.forEach((e=>{let{key:t,listener:i}=e;n.removeEventListener(t,i)})),s=[]}return{get key(){return r},set(e){!function(e){r=e.key,i=e,i.events=i.events||[],void 0===i.enable&&(i.enable=!0)}(e),c(),a&&l()},off(){a=!1,c()},on(){a=!0,0===s.length&&l()},destroy(){c(),o=null,i=null}}}));const Qa={oob:{show:!0,type:"n-polygon",fill:"#999",stroke:"#000",strokeWidth:0,size:10,sides:3,startAngle:-90},box:{show:!0,fill:"#fff",stroke:"#000",strokeWidth:1,strokeLinejoin:"miter",width:1,maxWidthPx:void 0,minWidthPx:1,minHeightPx:1},line:{show:!0,stroke:"#000",strokeWidth:1},median:{show:!0,stroke:"#000",strokeWidth:1},whisker:{show:!0,stroke:"#000",strokeWidth:1,fill:"",type:"line",width:1}},el=Object.keys(Qa),tl={require:["chart","resolver","symbol"],defaultSettings:{settings:{},data:{},style:{box:"$shape",line:"$shape-guide",whisker:"$shape-guide",median:"$shape-guide--inverted"}},created(){this.state={}},render(e){let{data:t}=e;const{width:n,height:i}=this.rect,r="horizontal"===this.settings.settings.orientation,{style:o,resolver:s,symbol:a}=this,l=el.filter((e=>!this.settings.settings[e]||!1!==this.settings.settings[e].show)),c={};l.forEach((e=>c[e]=Qa[e]));const u=function(e){let{keys:t,data:n,defaultSettings:i,style:r,settings:o,width:s,height:a,resolver:l}=e;const c=E(!0,{},i||{},r||{}),u={major:"horizontal"===o.orientation?a:s,minor:"horizontal"===o.orientation?s:a},h=o.major;let d;d="object"==typeof h&&"object"==typeof h.ref&&void 0!==h.ref.start&&void 0!==h.ref.end?l.resolve({data:n,defaults:{start:0,end:1},scaled:u,settings:E(!0,{},{binStart:{scale:o.major.scale,ref:o.major.ref.start},binEnd:{scale:o.major.scale,ref:o.major.ref.end}})}):"object"==typeof h&&void 0!==h.binStart&&void 0!==h.binEnd?l.resolve({data:n,defaults:{start:0,end:1},scaled:u,settings:E(!0,{},{binStart:{scale:o.major.scale,ref:"binStart"},binEnd:{scale:o.major.scale,ref:"binEnd"}},o.major)}):l.resolve({data:n,scaled:u,defaults:{major:.5},settings:{major:o.major}});const f=o.minor||{},p={};["start","end","min","max","med"].forEach((e=>{(f[e]||n.items&&n.items.length&&n.items[0][e])&&(p[e]={scale:f.scale,ref:e})}));let m,g={major:d,minor:l.resolve({data:n,defaults:{start:0,end:1},scaled:u,settings:E(!0,{},p,f)})};for(let e=0,i=t.length;e<i;e++)o[m]&&!1===o[m].show||(m=t[e],g[m]=l.resolve({data:n,defaults:c[m],settings:o[m],scaled:u}));return g}({keys:l,data:t,defaultSettings:c,style:o,settings:this.settings.settings,width:n,height:i,resolver:s}),{settings:h,items:d}=u,f=function(e){let{width:t,height:n,flipXY:i,resolved:r,keys:o,symbol:s}=e;const a=[],l=r.major.items;if(!l.length)return a;const c=t,u=n,h=i?n:t,d=r.major.settings,f=["start","end","min","max","med"].filter((e=>void 0!==r.minor.settings[e])),p=f.length,m=o.filter((e=>"oob"!==e));let g,y,v,b,x,w,q,S,M;const D=o?o.length:0,_=m?m.length:0,C={box:function(){v.box&&N(v.start)&&N(v.end)&&g.push(Ka({item:v,boxWidth:b,boxPadding:x,rendWidth:c,rendHeight:u,flipXY:i}))},line:function(){N(v.min)&&N(v.start)&&g.push(Ga({item:v,from:v.min,to:v.start,boxCenter:w,rendWidth:c,rendHeight:u,flipXY:i})),N(v.max)&&N(v.end)&&g.push(Ga({item:v,from:v.max,to:v.end,boxCenter:w,rendWidth:c,rendHeight:u,flipXY:i}))},median:function(){v.median&&N(v.med)&&g.push(Ja({item:v,key:"median",position:v.med,width:b,boxCenter:w,rendWidth:c,rendHeight:u,flipXY:i}))},whisker:function(){if(v.whisker){const e=b*v.whisker.width;N(v.min)&&g.push(Ja({item:v,key:"whisker",position:v.min,width:e,boxCenter:w,rendWidth:c,rendHeight:u,flipXY:i})),N(v.max)&&g.push(Ja({item:v,key:"whisker",position:v.max,width:e,boxCenter:w,rendWidth:c,rendHeight:u,flipXY:i}))}}};function k(){let e,t=-Number.MAX_VALUE,n=Number.MAX_VALUE;for(let i=0;i<p;i++)e=v[f[i]],N(e)&&(t<e&&(t=e),n>e&&(n=e));q=t<0&&t!==-Number.MAX_VALUE,S=n>1&&n!==Number.MAX_VALUE,M=q||S}for(let e=0,t=l.length;e<t;e++){g=[],y=null;const t=l[e],n=t.data;let f=null,p=null;void 0!==d.binStart?(f=t.binStart,p=t.binEnd,y=d.binStart.scale):(y=d.major.scale,f=y?t.major:0);let A=0;y?y.bandwidth?(A=y.bandwidth(),f-=A/2):A=p-f:A=1,v=E({},{major:f,majorEnd:p},r.minor.items[e]);for(let t=0;t<D;t++)v[o[t]]=r[o[t]].items[e];if(b=Za(A,v,h),x=(A-b)/2,w=x+v.major+b/2,k(),M)v.oob&&(q?g.push(Xa({item:v,value:0,boxCenter:w,rendWidth:c,rendHeight:u,flipXY:i,symbol:s})):S&&g.push(Xa({item:v,value:1,boxCenter:w,rendWidth:c,rendHeight:u,flipXY:i,symbol:s})));else for(let e=0;e<_;e++)v[m[e]]&&!1===v[m[e]].show||C[m[e]]();const T={type:"container",data:n,collider:{type:"bounds"},children:g};a.push(T)}return a}({items:d,settings:h,width:n,height:i,flipXY:r,resolved:u,keys:l,symbol:a});return f}};const nl={shape:"saltire",width:2,size:.5,fill:"#333",stroke:"#333",strokeWidth:0},il=/px$/,rl={shape:"circle",label:"",fill:"#333",stroke:"#ccc",strokeDasharray:"",strokeWidth:0,strokeLinejoin:"miter",opacity:1,x:.5,y:.5,size:1,show:!0},ol={maxPx:1e4,minPx:1,maxRelExtent:.1,minRelExtent:.01,maxRelDiscrete:1,minRelDiscrete:.1};function sl(e,t){return e&&"function"==typeof e.bandwidth?{isBandwidth:!0,value:Math.max(1,e.bandwidth()*t)}:{isBandwidth:!1,value:Math.max(1,t)}}function al(e,t,n,i){let{width:r,height:o}=t;return e.filter((e=>!1!==e.show&&!isNaN(e.x+e.y))).map((e=>{let t=e,s=il.test(e.size)?parseInt(e.size,10):n.min+t.size*(n.max-n.min);P(s)&&(t=nl,s=n.min+t.size*(n.max-n.min));const[a,l]=function(e){let t=rl.shape,n={};return"object"==typeof e.shape&&"string"==typeof e.shape.type?(t=e.shape.type,n=e.shape):"string"==typeof e.shape&&(t=e.shape),[t,n]}(t),c=I(I({},l),{},{type:a,label:e.label,x:e.x*r,y:e.y*o,fill:t.fill,size:Math.min(n.maxGlobal,Math.max(n.minGlobal,s)),stroke:t.stroke,strokeWidth:t.strokeWidth,strokeDasharray:t.strokeDasharray,opacity:t.opacity});t===e.errorShape&&(c.width=t.width);const u=i(c);return u.data=e.data,u}))}const ll={require:["chart","resolver","symbol"],defaultSettings:{settings:{},data:{},animations:{enabled:!1,trackBy:e=>e.data.value},style:{item:"$shape"}},render(e){let{data:t}=e;const n=this.resolver.resolve({data:t,defaults:E({},rl,this.style.item),settings:this.settings.settings,scaled:{x:this.rect.width,y:this.rect.height}}),{width:i,height:r}=this.rect,o=E({},ol,this.settings.settings.sizeLimits),s=n.items,a=function(e,t,n,i,r){const o=sl(e?e.scale:void 0,n),s=sl(t?t.scale:void 0,i);let a=Math.min(o.value*r[o.isBandwidth?"maxRelDiscrete":"maxRelExtent"],s.value*r[s.isBandwidth?"maxRelDiscrete":"maxRelExtent"]),l=Math.min(o.value*r[o.isBandwidth?"minRelDiscrete":"minRelExtent"],s.value*r[s.isBandwidth?"minRelDiscrete":"minRelExtent"]);return{min:Math.max(1,Math.floor(l)),max:Math.max(1,Math.floor(a)),maxGlobal:r.maxPx,minGlobal:r.minPx}}(n.settings.x,n.settings.y,i,r,o);return al(s,this.rect,a,this.settings.shapeFn||this.symbol)}};Math.PI;const cl={label:"",arc:1,show:!0,fill:"#333",stroke:"#ccc",strokeWidth:1,strokeLinejoin:"round",opacity:1,innerRadius:0,outerRadius:.8,cornerRadius:0,offset:0};function ul(e,t,n,i){let{x:r,y:o,width:s,height:a}=t;const l=me(),c={x:r+s/2,y:o+a/2},u=Math.min(s,a)/2,h=Math.min(s,a)/2,d=h/100;return e.map(((e,t)=>{const r=n[t];r.type="path";const o=h*r.outerRadius,s=u*r.innerRadius,a=d*r.cornerRadius;l.innerRadius(s),l.outerRadius(o),l.cornerRadius(a),r.arcDatum=e;const f=l.centroid(e),p=r.offset?function(e,t,n,i){let[r,o]=e;const s=Math.sqrt(r*r+o*o);r/=s,o/=s;const a=n-i;return{x:r*t*a,y:o*t*a}}(f,r.offset,o,s):{x:0,y:0};return r.transform="translate(".concat(p.x,", ").concat(p.y,") translate(").concat(c.x,", ").concat(c.y,")"),r.desc={share:e.value/i,slice:{start:e.startAngle,end:e.endAngle,innerRadius:s,outerRadius:o,cornerRadius:a,offset:{x:c.x+p.x,y:c.y+p.y}}},r}))}function hl(e,t){return e.slice&&"arc"in e.slice?t.arc:t.data.value}const dl={require:["chart","resolver"],defaultSettings:{settings:{startAngle:0,endAngle:2*Math.PI,padAngle:0,slice:{}},style:{slice:"$shape"},data:{}},render(e){let{data:t}=e;const n=[],i=[],r=this.settings.settings,{items:o}=this.resolver.resolve({data:t,defaults:E({},cl,this.style.slice),settings:r.slice});let s=0;for(let e=0,t=o.length;e<t;e++){const t=hl(r,o[e]);t>0&&o[e].outerRadius>=o[e].innerRadius&&(n.push(t),i.push(o[e]),s+=t)}const a=function(){var e=qe,t=we,n=null,i=G(0),r=G(ae),o=G(0);function s(s){var a,l,c,u,h,d=s.length,f=0,p=new Array(d),m=new Array(d),g=+i.apply(this,arguments),y=Math.min(ae,Math.max(-ae,r.apply(this,arguments)-g)),v=Math.min(Math.abs(y)/d,o.apply(this,arguments)),b=v*(y<0?-1:1);for(a=0;a<d;++a)(h=m[p[a]=a]=+e(s[a],a,s))>0&&(f+=h);for(null!=t?p.sort((function(e,n){return t(m[e],m[n])})):null!=n&&p.sort((function(e,t){return n(s[e],s[t])})),a=0,c=f?(y-d*b)/f:0;a<d;++a,g=u)l=p[a],u=g+((h=m[l])>0?h*c:0)+b,m[l]={data:s[l],index:a,value:h,startAngle:g,endAngle:u,padAngle:v};return m}return s.value=function(t){return arguments.length?(e="function"==typeof t?t:G(+t),s):e},s.sortValues=function(e){return arguments.length?(t=e,n=null,s):t},s.sort=function(e){return arguments.length?(n=e,t=null,s):n},s.startAngle=function(e){return arguments.length?(i="function"==typeof e?e:G(+e),s):i},s.endAngle=function(e){return arguments.length?(r="function"==typeof e?e:G(+e),s):r},s.padAngle=function(e){return arguments.length?(o="function"==typeof e?e:G(+e),s):o},s}().sortValues(null);a.startAngle(r.startAngle),a.endAngle(r.endAngle),a.padAngle(r.padAngle);return ul(a(n),E({},this.rect,{x:0,y:0}),i,s)}};const fl=function(e){function t(t){if(e[t.type]&&e[t.type].condition(t)){const n=e[t.type],i=void 0===n.conditionAppend||n.conditionAppend(t);n.items.forEach((e=>{const n=Math.round(t[e.key]),r=t[e.key]-n;t[e.key]=n,i&&"append"===e.type&&(r>0?t[e.key]+=.5:t[e.key]-=.5)}))}}return void 0===e&&((e={}).line={append:["x1","x2","y1","y2"],round:[],condition:e=>e.x1===e.x2||e.y1===e.y2,conditionAppend:e=>e.strokeWidth%2!=0},e.rect={append:["x","y"],round:["width","height"],condition:()=>!0,conditionAppend:e=>e.strokeWidth%2!=0}),Object.keys(e).forEach((t=>{const n=e[t];n.items=[],n.append.forEach((e=>{n.items.push({key:e,type:"append"})})),n.round.forEach((e=>{n.items.push({key:e,type:"round"})}))})),t.multiple=e=>e.forEach((e=>t(e))),t}();class pl{constructor(){this.reset(),this.push(...arguments)}static evaluateKey(e,t){if(t){const t=e.substring(0,1),n=e.substring(1);if("x"===t)return"y".concat(n);if("y"===t)return"x".concat(n);if("cx"===e)return"cy";if("cy"===e)return"cx";if("width"===e)return"height";if("height"===e)return"width"}return e}transposeCoordinate(e,t,n){if("number"==typeof t&&isFinite(t)){const i=e.substring(0,1);if("x"===i||"cx"===e)return t*this.width;if("width"===e)return t*this.width;if("r"===e)return t*(n?this.height:this.width);if("y"===i||"cy"===e)return t*this.height;if("height"===e)return t*this.height}return t}push(){return this.storage.push(...arguments),this}processItem(e){let t={};const n=void 0!==e.flipXY?e.flipXY:this.flipXY,i=void 0!==e.crisp?e.crisp:this.crisp;if(e.fn&&"function"==typeof e.fn){let i=n?this.height:this.width,r=n?this.width:this.height;e=e.fn({width:i,height:r,flipXY:n});const o=Object.keys(e);for(let i=0,r=o.length;i<r;i++){let r=o[i];t[pl.evaluateKey(r,n)]=e[r]}}else{const i=Object.keys(e);for(let r=0,o=i.length;r<o;r++){let o=i[r];const s=pl.evaluateKey(o,n),a=this.transposeCoordinate(s,e[o],n);t[s]=a}}return i&&fl(t),t}output(){let e=[];for(let t=0,n=this.storage.length;t<n;t++){let n=this.processItem(this.storage[t]);e.push(n)}return e}reset(){this.storage=[],this.flipXY=!1,this.crisp=!1,this.width=0,this.height=0}}function ml(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return new pl(...t)}function gl(e,t){return e&&t?e.cachedTicks&&e.cachedTicks()||e.ticks({distance:t}):[]}const yl={created(){},require:["chart","renderer","resolver"],defaultSettings:{layout:{displayOrder:0},style:{ticks:"$guide-line",minorTicks:"$guide-line--minor"}},beforeRender(){this.blueprint=ml(),this.blueprint.width=this.rect.width,this.blueprint.height=this.rect.height,this.blueprint.x=this.rect.x,this.blueprint.y=this.rect.y,this.blueprint.crisp=!0},render(){if(this.x=this.settings.x?this.chart.scale(this.settings.x):null,this.y=this.settings.y?this.chart.scale(this.settings.y):null,ts(this,"x",this.rect.width),ts(this,"y",this.rect.height),!this.x&&!this.y)return[];this.settings.ticks=E({show:!0},this.style.ticks,this.settings.ticks||{}),this.settings.minorTicks=E({show:!1},this.style.minorTicks,this.settings.minorTicks||{}),this.lines={x:[],y:[]},this.lines.x=gl(this.x,this.rect.width),this.lines.y=gl(this.y,this.rect.height),this.lines.y=this.lines.y.map((e=>E(e,{flipXY:!0})));let e=e=>{let{dir:t,isMinor:n}=e,i=this.lines[t].filter((e=>!!e.isMinor===n)),r=n?this.settings.minorTicks:this.settings.ticks;this.resolver.resolve({settings:r,data:{items:i,dir:t}}).items.forEach((e=>{let n=e.data;var i,r;e.show&&this.blueprint.push({type:"line",x1:n.position,y1:0,x2:n.position,y2:1,stroke:e.stroke||"black",strokeWidth:void 0!==e.strokeWidth?e.strokeWidth:1,strokeDasharray:void 0!==e.strokeDasharray?e.strokeDasharray:void 0,flipXY:n.flipXY||!1,value:null!==(i=n.value)&&void 0!==i?i:null===(r=n.data)||void 0===r?void 0:r.value,dir:t})}))};return e({dir:"x",isMinor:!1}),e({dir:"x",isMinor:!0}),e({dir:"y",isMinor:!1}),e({dir:"y",isMinor:!0}),this.blueprint.output()}};function vl(e,t,n){let i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"bottom";if(n*=.8,"left"===i||"right"===i){let r="right"===i;return"\n M ".concat(e," ").concat(t-n,"\n A ").concat(1.25*n," ").concat(1.25*n,", 0, 1, ").concat(r?0:1,", ").concat(e," ").concat(t+n,"\n L ").concat(r?e+n:e-n," ").concat(t," Z\n ")}let r="bottom"===i;return"\n M ".concat(e-n," ").concat(t,"\n A ").concat(1.25*n," ").concat(1.25*n,", 0, 1, ").concat(r?1:0,", ").concat(e+n," ").concat(t,"\n L ").concat(e," ").concat(r?t+n:t-n," Z\n ")}function bl(e,t,n){let i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"bottom";if(n*=.75,"left"===i||"right"===i){let r="right"===i;return"\n M ".concat(e+=r?1.5*n:-1.5*n," ").concat(t-n,"\n L ").concat(e," ").concat(t+n,"\n L ").concat(r?e+n:e-n," ").concat(t," Z\n ")}let r="bottom"===i;return t+=r?1.5*n:-1.5*n,"\n M ".concat(e-n," ").concat(t,"\n L ").concat(e+n," ").concat(t,"\n L ").concat(e," ").concat(r?t+n:t-n," Z\n ")}function xl(e){if(void 0===e)return 0;if("number"==typeof e&&isFinite(e))return e;if("string"==typeof e)switch(e){case"center":case"middle":return.5;case"bottom":case"right":return 1;default:return 0}return 0}function wl(e){const t={value:e.value};return e.label&&(t.label=e.label.text),t}function ql(e){return void 0!==("function"==typeof e.value?e.value():e.value)}function Sl(e,t){const n=e.min();if(n===e.max()){const i=function(e){const t=e.range();return 2===(null==t?void 0:t.length)&&t[0]>t[1]}(e);if(t<n)return i?2:-1;if(t>n)return i?-1:2}return e(t)}const Ml={require:["chart","renderer"],defaultSettings:{layout:{displayOrder:0},style:{oob:{show:!0,width:10,fill:"#1A1A1A",stroke:"transparent",strokeWidth:0,opacity:1,text:{fontFamily:"Arial",stroke:"transparent",fill:"#fff",strokeWidth:0,opacity:1},triangle:{fill:"#4D4D4D",stroke:"transparent",strokeWidth:0,opacity:1},padding:{x:28,y:5}},line:{stroke:"#000"},label:{strokeWidth:0}}},preferredSize:()=>30,beforeRender(){this.blueprint=ml(),this.blueprint.width=this.rect.width,this.blueprint.height=this.rect.height,this.blueprint.x=this.rect.x,this.blueprint.y=this.rect.y,this.blueprint.crisp=!0},render(){let e=this.settings;if(this.lines={x:[],y:[]},this.lines.x=e.lines&&e.lines.x||[],this.lines.y=e.lines&&e.lines.y||[],0===this.lines.x.length&&0===this.lines.y.length)return[];const t={x0:[],x1:[],y0:[],y1:[]};this.lines.x=this.lines.x.filter(ql).map((e=>{if("function"==typeof e.value&&(e.value=e.value()),e.scale){let t=this.chart.scale(e.scale);const n=Sl(t,e.value);return E(e,{scale:t,position:n})}return E(e,{position:e.value})})),this.lines.y=this.lines.y.filter(ql).map((e=>{if("function"==typeof e.value&&(e.value=e.value()),e.scale){let t=this.chart.scale(e.scale);const n=Sl(t,e.value);return E(e,{scale:t,position:n,flipXY:!0})}return E(e,{position:e.value,flipXY:!0})})),this.lines.x=this.lines.x.filter((e=>!(e.position<0||e.position>1)||(t["x".concat(e.position>1?1:0)].push(wl(e)),!1))),this.lines.y=this.lines.y.filter((e=>!(e.position<0||e.position>1)||(t["y".concat(e.position>1?1:0)].push(wl(e)),!1)));let n=[];return[...this.lines.x,...this.lines.y].forEach((t=>{(!0===t.show||void 0===t.show)&&function(e){let{chart:t,blueprint:n,renderer:i,p:r,settings:o,items:s}=e,a=!0,l=!1,c=!1,u=!1,h=!1,d=E(!0,{},o.style.line,r.line||{});if(l=n.processItem({type:"line",x1:r.position,y1:0,x2:r.position,y2:1,stroke:d.stroke||"black",strokeWidth:d.strokeWidth||1,strokeDasharray:d.strokeDasharray,flipXY:r.flipXY||!1,value:r.valueInfo?r.valueInfo.id:r.value}),r.label){const e=E(!0,{fill:"#000",fontFamily:"Arial",fontSize:"12px",opacity:1,maxWidth:1,maxWidthPx:9999,padding:5,background:{fill:"#fff",stroke:"transparent",strokeWidth:0,opacity:.5}},o.style.label||{},{fill:d.stroke},r.label);let l,f={width:0,height:0},p="";if("string"==typeof r.formatter)l=t.formatter(r.formatter);else if("object"==typeof r.formatter)l=t.formatter(r.formatter);else if(void 0!==r.scale&&r.scale.data){const e=r.scale.data()&&r.scale.data().fields;l=e&&e[0]?e[0].formatter():null}!1!==r.label.showValue&&(l?p=" (".concat(l(r.value),")"):r.scale&&(p=" (".concat(r.value,")"))),p&&(f=i.measureText({text:p,fontFamily:e.fontFamily,fontSize:e.fontSize}));let m=i.measureText({text:e.text||"",fontFamily:e.fontFamily,fontSize:e.fontSize}),g={width:m.width+f.width,height:Math.max(m.height,f.height)},y=e.padding,v=xl(r.flipXY?e.vAlign:e.align),b=xl(r.flipXY?e.align:e.vAlign),x=Math.min(1+g.width+2*y,e.maxWidth*n.width,e.maxWidthPx),w=g.height+2*y,q=r.flipXY?w:x,S=r.flipXY?x:w;if(c=n.processItem({fn:t=>{let{width:i,height:o}=t,s=r.position*i-(r.flipXY?w:x)*(1-v);return s=r.flipXY?s:Math.max(s,0),{type:"rect",x:s,y:Math.max(Math.abs(b*o-S*b),0),width:r.flipXY?q:Math.min(q,n.width-s),height:S,stroke:e.background.stroke,strokeWidth:e.background.strokeWidth,fill:e.background.fill,opacity:e.background.opacity}},flipXY:r.flipXY||!1}),c.x<-1||c.x+c.width>n.width+1||c.y<-1||c.y+c.height>n.height+1)c=void 0;else{u={type:"text",text:e.text||"",fill:e.fill,opacity:e.opacity,fontFamily:e.fontFamily,fontSize:e.fontSize,x:c.x+y,y:c.y+c.height/2+g.height/3,maxWidth:c.width-2*y-f.width,anchor:"start"},p&&(h={type:"text",text:p||"",fill:e.fill,opacity:e.opacity,fontFamily:e.fontFamily,fontSize:e.fontSize,x:u.x+3+(c.width-(f.width+2*y)),y:u.y});for(let e=0,t=s.length;e<t;e++){let t=s[e];"rect"===t.type?Zs(c,t)&&(a=!1):"line"===t.type&&r.flipXY===t.flipXY&&ta(c,t)&&(a=!1)}}}s.push(l),a&&c&&u&&(s.push(c,u),h&&s.push(h))}({chart:this.chart,blueprint:this.blueprint,renderer:this.renderer,p:t,settings:e,items:n})})),e.style.oob.show&&function(e){let{blueprint:t,oob:n,settings:i,items:r}=e;const o=Object.keys(n);let s=i.style.oob||{};for(let e=0,i=o.length;e<i;e++){const i=o[e],a=n[i];if(a.length>0){let e=i.charAt(1),n="y"===i.charAt(0),o=s.padding.x+s.width,l=s.padding.y+s.width,c="bottom";c=n?"1"===e?"bottom":"top":"1"===e?"right":"left";let u=t.processItem({fn:t=>{let{width:i,height:r}=t,u=e*i+("1"===e?-o:o),h=n?l:r-l;return"arc"===s.type?{type:"path",d:vl(n?h:u,n?u:h,s.width,c),x:u,y:h,stroke:s.stroke,fill:s.fill,strokeWidth:s.strokeWidth||0}:{type:"circle",cx:u,cy:h,r:s.width,stroke:s.stroke,fill:s.fill,strokeWidth:s.strokeWidth||0,opacity:s.opacity,data:a}},flipXY:n}),h=u.cx||u.x,d=u.cy||u.y,f={type:"text",text:a.length||"",x:h-.4*s.width,y:d+.4*s.width,fontFamily:s.text.fontFamily,fontSize:"".concat(1.3*s.width,"px"),stroke:s.text.stroke,fill:s.text.fill,strokeWidth:s.text.strokeWidth||0,opacity:s.text.opacity},p={type:"path",d:bl(h,d,s.width,c),x:h,y:d,stroke:s.triangle.stroke,fill:s.triangle.fill,strokeWidth:s.triangle.strokeWidth||0,opacity:s.triangle.opacity};r.push(u,f,p)}}}({blueprint:this.blueprint,oob:t,settings:e,items:n}),n}};function Dl(e){const t={type:"line",x1:0,x2:0,y1:0,y2:0,collider:{type:null}};return"top"===e.align||"bottom"===e.align?(t.x1=e.innerRect.x-e.outerRect.x,t.x2=t.x1+e.innerRect.width,t.y1=t.y2="top"===e.align?e.innerRect.height-e.padding:e.padding):(t.x1=t.x2="left"===e.align?e.innerRect.width-e.padding:e.padding,t.y1=e.innerRect.y-e.outerRect.y,t.y2=t.y1+e.innerRect.height),function(e,t){E(e,t.style)}(t,e),t}function _l(e){return"string"==typeof e||"number"==typeof e?e:"-"}function Cl(e,t,n){n.layered||!n.stepSize?function(e,t){t.collider={type:"polygon",vertices:[{x:t.boundingRect.x,y:t.boundingRect.y},{x:t.boundingRect.x+t.boundingRect.width,y:t.boundingRect.y},{x:t.boundingRect.x+t.boundingRect.width,y:t.boundingRect.y+t.boundingRect.height},{x:t.boundingRect.x,y:t.boundingRect.y+t.boundingRect.height}]}}(0,t):n.tilted?function(e,t,n){const i=n.angle*(Math.PI/180),r=Math.max(n.stepSize/2,t.boundingRect.height/2),o="start"===t.anchor,s="end"===t.anchor&&i<0,a="start"===t.anchor&&i>=0,l=t.boundingRect.y+(a||s?t.boundingRect.height:0),c=[{x:t.x-r,y:l},{x:t.x+r,y:l}].map((e=>Ss(e,i,{x:t.x,y:t.y}))),u={x:o?t.boundingRect.x+t.boundingRect.width+10:t.boundingRect.x-10,y:t.boundingRect.y+t.boundingRect.height},h={x:o?t.boundingRect.x+t.boundingRect.width+10:t.boundingRect.x-10,y:t.boundingRect.y},d=i>=0?[u,h]:[h,u];c.push(...d),t.collider={type:"polygon",vertices:c}}(0,t,n):function(e,t,n){if("bottom"===n.align||"top"===n.align){const i=e.position*n.innerRect.width+(n.innerRect.x-n.outerRect.x-n.stepSize/2);t.collider={type:"rect",x:i,y:0,width:i<0?n.stepSize+i:n.stepSize,height:n.innerRect.height}}else{const i=e.position*n.innerRect.height+(n.innerRect.y-n.outerRect.y-n.stepSize/2);t.collider={type:"rect",x:0,y:i,width:n.innerRect.width,height:i<0?n.stepSize+i:n.stepSize}}const i=t.collider;i.x=Math.max(i.x,0),i.y=Math.max(i.y,0);const r=i.x+i.width-(n.outerRect.x+n.outerRect.width);i.width=r>0?i.width-r:i.width;const o=i.y+i.height-(n.outerRect.y+n.outerRect.height);i.height=o>0?i.height-o:i.height}(e,t,n)}function kl(e,t){const n=isNaN(e.style.align)?.5:Math.min(Math.max(e.style.align,0),1);let i=0;if(e.tilted)i=e.stepSize*n;else{const r=t?e.textRect.height:e.textRect.width;i=Math.max(0,e.stepSize-r)*n}return i}function El(e,t){var n,i;const r={type:"text",text:_l(e.label),x:0,y:0,maxWidth:t.maxWidth,maxHeight:t.maxHeight,tickValue:null!==(n=e.value)&&void 0!==n?n:null===(i=e.data)||void 0===i?void 0:i.value};return"top"===t.align||"bottom"===t.align?(r.x=e.start*t.innerRect.width+(t.innerRect.x-t.outerRect.x)+kl(t,!1),r.y="top"===t.align?t.innerRect.height:0,r.anchor=t.stepSize?"start":"middle",r.x+=isNaN(t.style.offset)?0:+t.style.offset):(r.y=e.start*t.innerRect.height+(t.innerRect.y-t.outerRect.y)+kl(t,!0),r.x="left"===t.align?t.innerRect.width:0,r.anchor="left"===t.align?"end":"start",r.baseline=t.stepSize?"text-before-edge":"central",r.y+=isNaN(t.style.offset)?0:+t.style.offset),function(e,t){["fill","fontSize","fontFamily"].forEach((n=>{e[n]=t.style[n]}))}(r,t),function(e,t){if(!t.tilted&&!t.stepSize)if("top"===t.align||"bottom"===t.align){const n=0,i=t.outerRect.width,r=Math.min(t.maxWidth/2,t.textRect.width/2),o=e.x-r,s=e.x+r;o<n?(e.anchor="start",e.x=t.innerRect.x-t.outerRect.x):s>i&&(e.anchor="end",e.x=t.innerRect.width+t.innerRect.x)}else{const n=0,i=t.outerRect.height,r=t.maxHeight/2,o=e.y-r,s=e.y+r;o<n?(e.y=t.innerRect.y-t.outerRect.y,e.baseline="text-before-edge"):s>i&&(e.y=t.innerRect.height+(t.innerRect.y-t.outerRect.y),e.baseline="text-after-edge")}}(r,t),function(e,t){"top"===t.align?e.y-=t.padding:"bottom"===t.align?e.y+=t.padding+t.maxHeight:"left"===t.align?e.x-=t.padding:"right"===t.align&&(e.x+=t.padding)}(r,t),function(e,t){if(t.tilted){const n=-t.angle,i=n*(Math.PI/180);"bottom"===t.align?(e.x-=t.maxHeight*Math.sin(i)/2,e.y-=t.maxHeight,e.y+=t.maxHeight*Math.cos(i)/2):e.x-=t.maxHeight*Math.sin(i)/3,e.transform="rotate(".concat(n,", ").concat(e.x,", ").concat(e.y,")"),e.anchor="bottom"===t.align==t.angle<0?"start":"end";const r=Math.cos(i)*t.maxWidth;if("bottom"===t.align==t.angle<0){const n=t.outerRect.width-t.paddingEnd;e.x+r>n&&(e.maxWidth=(n-e.x-10)/Math.cos(i))}else{const n=t.paddingEnd;e.x-r<n&&(e.maxWidth=(e.x-n-10)/Math.cos(i))}}}(r,t),function(e,t){e.boundingRect=t.textBounds(e)}(r,t),Cl(e,r,t),r}function Al(e,t){const n={type:"line",x1:0,x2:0,y1:0,y2:0,collider:{type:null},tickValue:e.value};return"top"===t.align||"bottom"===t.align?(n.x1=n.x2=e.position*t.innerRect.width+(t.innerRect.x-t.outerRect.x),n.y1="top"===t.align?t.innerRect.height:0,n.y2="top"===t.align?n.y1-t.tickSize:n.y1+t.tickSize):(n.y1=n.y2=e.position*t.innerRect.height+(t.innerRect.y-t.outerRect.y),n.x1="left"===t.align?t.innerRect.width:0,n.x2="left"===t.align?n.x1-t.tickSize:n.x1+t.tickSize),function(e,t){E(e,t.style)}(n,t),function(e,t){"top"===t.align?(e.y1-=t.padding,e.y2-=t.padding):"bottom"===t.align?(e.y1+=t.padding,e.y2+=t.padding):"left"===t.align?(e.x1-=t.padding,e.x2-=t.padding):"right"===t.align&&(e.x1+=t.padding,e.x2+=t.padding)}(n,t),function(e,t){const n=e.strokeWidth/2;e.x1===t.innerRect.width?(e.x1-=n,e.x2-=n):0===e.x1?(e.x1+=n,e.x2+=n):e.y1===t.innerRect.height?(e.y1-=n,e.y2-=n):0===e.y1&&(e.y1+=n,e.y2+=n)}(n,t),n}function Tl(e){return!e.isMinor&&e.position>=0&&e.position<=1}function Il(e){let{rect:t,state:n,majorTicks:i,measure:r,horizontal:o}=e;return o?function(e){let{majorTicks:t,measureText:n,rect:i,state:r}=e;const o="layered"===r.labels.activeMode?2:1,s=i.width,a=t.map((e=>e.label)).map((e=>"".concat(e.slice(0,1)).concat(e.length>1?"…":""))).map(n).map((e=>e.width));for(let e=0;e<t.length;++e){const n=t[e];if(o*s*Math.abs(n.start-n.end)<a[e])return!0}return!1}({majorTicks:i,measureText:r,rect:t,state:n}):function(e){let{majorTicks:t,measureText:n,rect:i}=e;const r=i.height,o=n("M").height;return!(t.length<2)&&r*Math.abs(t[0].position-t[1].position)<o}({majorTicks:i,measureText:r,rect:t,state:n})}function Rl(e){let{value:t,maxValue:n,minValue:i,range:r,modifier:o}=e;return isNaN(r)||isNaN(o)||(t=r*o),t>n&&(t=n),t<i&&(t=i),t}function Ol(e){let{isDiscrete:t,rect:n,formatter:i,measureText:r,scale:o,settings:s,state:a}=e,l=0;const c={left:0,top:0,right:0,bottom:0},{maxLengthPx:u,minLengthPx:h}=s.labels;if(s.labels.show){const e=s.align,d="top"===e||"bottom"===e,f=d?n.inner.width:n.inner.height,p=o.ticks({settings:s,distance:f,formatter:i}).filter(Tl),m=e=>{const t=r({text:e,fontSize:s.labels.fontSize,fontFamily:s.labels.fontFamily});return t.width=Rl({value:t.width,maxValue:u,minValue:h}),t};if(t&&d&&"auto"===s.labels.mode&&(!function(e){let{majorTicks:t,measure:n,rect:i,state:r,settings:o}=e;const s=o.labels.maxGlyphCount,a="layered"===r.labels.activeMode?2:1,l=o.labels.tiltThreshold?o.labels.tiltThreshold:.7,c=n("…").width,u=i.width;let h=0,d=0;if(isNaN(s))for(let e=0;e<t.length;e++){const i=t[e],r=i.label,o=n(r).width*(r.length>1?l:1);if(d=a*u*Math.abs(i.start-i.end),o+c>d)return!0}else if(d=a*u*t.reduce(((e,t)=>Math.min(Math.abs(t.start-t.end),e)),1/0),h=n("M").width*l*s,h+c>d)return!0;return!1}({majorTicks:p,measure:m,rect:n.inner,state:a,settings:s})?a.labels.activeMode="horizontal":a.labels.activeMode="tilted"),!s.labels.filterOverlapping&&"tilted"!==a.labels.activeMode&&Il({rect:n.inner,state:a,majorTicks:p,measure:m,horizontal:d})){return{size:Math.max(n.outer.width,n.outer.height),isToLarge:!0}}let g,y;if("tilted"===a.labels.activeMode){const e=Math.abs(s.labels.tiltAngle)*(Math.PI/180);g=t=>Rl({value:t.width,maxValue:u,minValue:h})*Math.sin(e)+t.height*Math.cos(e)}else g=d?e=>e.height:e=>Rl({value:e.width,maxValue:u,minValue:h});if(d&&"tilted"!==a.labels.activeMode)y=["M"];else if(isNaN(s.labels.maxGlyphCount))y=p.map((e=>e.label));else{let e="";for(let t=0;t<s.labels.maxGlyphCount;t++)e+="M";y=[e]}const v=y.map(m),b=v.map(g),x=Math.max(...b,0);if(l+=x,l+=s.labels.margin,"layered"===a.labels.activeMode&&(l*=2),"tilted"===a.labels.activeMode){const e="bottom"===s.align==s.labels.tiltAngle>=0,t=Math.abs(s.labels.tiltAngle)*(Math.PI/180),i=(x-m("M").height*Math.cos(t))/Math.sin(t),r=e=>Math.min(i,e.width)*Math.cos(t)+e.height,o=(t,i)=>{const r=p[i]?p[i].position:0;return e?t-r*n.inner.width:t-(1-r)*n.inner.width},a=Math.min(s.labels.maxEdgeBleed,Math.max(...v.map(r).map(o),0))+s.paddingEnd;if(c[e?"left":"right"]=a,!s.labels.filterOverlapping&&function(e){let{majorTicks:t,measureText:n,rect:i,bleedSize:r,angle:o}=e;if(t.length<2)return!1;if(0===o)return!0;const s=Math.abs(o),a=1/(Math.min(i.outer.width-r,i.inner.width)*Math.abs(t[0].position-t[1].position));return n("M").height>Math.sin(s*(Math.PI/180))/a}({majorTicks:p,measureText:m,rect:n,bleedSize:a,angle:s.labels.tiltAngle})){return{size:Math.max(n.outer.width,n.outer.height),isToLarge:!0}}}}return{size:l,edgeBleed:c}}const Nl=2,Pl=(e,t,n)=>e.width*Math.abs(t.position-n.position),Ll=e=>{let{innerRect:t,outerRect:n,tick:i,nextWidth:r}=e;const o=t.x-n.x,s=t.width*i.position+o,a=2*Math.min(r,s),l=0===i.position?t.width/2-Nl:0;return Math.max(r,a,l)},Fl=e=>{let{innerRect:t,outerRect:n,tick:i,prevWidth:r}=e;const o=t.x-n.x,s=n.width-t.width-o,a=t.width-t.width*i.position+s,l=2*Math.min(r,a),c=1===i.position?t.width/2-Nl:0;return Math.max(r,l,c)};function zl(e){let t=0;return t+=e.paddingStart,t+=e.line.show?e.line.strokeWidth/2:0,t+=e.ticks.show?e.ticks.margin:0,t}function jl(e){let t=0;return t+=e.ticks.show?e.ticks.tickSize:0,t+=zl(e)+e.labels.margin,t}function Hl(e,t){return e.map((e=>Al(e,t)))}function Bl(e,t){return t?Math.abs(t.end-t.start):e.bandwidth()}function Vl(e){let{textMetrics:t,settings:n,innerRect:i,scale:r,tilted:o,layered:s,tick:a}=e;const l=t.height,c=Bl(r,a),u={width:0,height:l};if("left"===n.align||"right"===n.align)u.width=i.width-jl(n)-n.paddingEnd;else if(s)u.width=c*i.width*2;else if(o){const e=Math.abs(n.labels.tiltAngle)*(Math.PI/180);u.width=(i.height-jl(n)-n.paddingEnd-l*Math.cos(e))/Math.sin(e)}else u.width=c*i.width;return u.width=Rl({value:u.width,maxValue:n.labels.maxLengthPx,minValue:n.labels.minLengthPx}),u}function $l(e){let{textMetrics:t,settings:n,innerRect:i,outerRect:r,tilted:o,layered:s,tick:a,index:l,major:c}=e;const u=t.height,h={width:0,height:u};if("left"===n.align||"right"===n.align)h.width=i.width-jl(n)-n.paddingEnd;else if(o){const e=Math.abs(n.labels.tiltAngle)*(Math.PI/180);h.width=(i.height-jl(n)-n.paddingEnd-u*Math.cos(e))/Math.sin(e)}else h.width=function(e){let{layered:t,major:n,innerRect:i,outerRect:r,tick:o,index:s}=e;const a=t?2:1,l=n[s-a],c=n[s+a],u=l?Pl(i,o,l)/2-Nl:1/0,h=c?Pl(i,o,c)/2-Nl:1/0;return n.length<2?i.width:l?c?2*Math.min(u,h):Fl({innerRect:i,outerRect:r,tick:o,prevWidth:u}):Ll({innerRect:i,outerRect:r,tick:o,nextWidth:h})}({layered:s,major:c,innerRect:i,outerRect:r,tick:a,index:l});return h.width=Rl({value:h.width,maxValue:n.labels.maxLengthPx,minValue:n.labels.minLengthPx}),h}function Wl(e){let t;function n(){return t=$l,n}function i(){return t=Vl,i}function r(e){let{settings:n,scale:i,innerRect:r,outerRect:o,measureText:s,ticks:a,state:l,textBounds:c}=e;const u=[],h=function(e){return e.filter((e=>!e.isMinor))}(a),d=function(e){return e.filter((e=>e.isMinor))}(a),f={innerRect:r,align:n.align,outerRect:o},p="tilted"===l.labels.activeMode,m="layered"===l.labels.activeMode;let g;if(n.line.show&&(f.style=n.line,f.padding=n.paddingStart,u.push(Dl(f))),n.ticks.show&&(f.style=n.ticks,f.tickSize=n.ticks.tickSize,f.padding=zl(n),g=Hl(h,f)),n.labels.show){const e=jl(n);f.style=n.labels,f.padding=e,f.tilted=p,f.layered=m,f.angle=n.labels.tiltAngle,f.paddingEnd=n.paddingEnd,f.textBounds=c;const l=(e,l)=>{f.textRect=function(e){let{style:t,measureText:n,tick:i}=e;return n({text:i.label,fontSize:t.fontSize,fontFamily:t.fontFamily})}({tick:e,measureText:s,style:f.style});const c=t({textMetrics:f.textRect,settings:n,innerRect:r,outerRect:o,scale:i,tilted:p,layered:m,tick:e,major:h,index:l});f.maxWidth=c.width,f.maxHeight=c.height,f.stepSize=function(e){let{innerRect:t,scale:n,settings:i,tick:r}=e;return("top"===i.align||"bottom"===i.align?t.width:t.height)*Bl(n,r)}({innerRect:r,scale:i,ticks:a,settings:n,tick:e})};let d=[];d=!m||"top"!==n.align&&"bottom"!==n.align?function(e,t,n){return e.map(((e,i)=>{n(e,i);const r=El(e,t);return r.data=e.data,r}))}(h,f,l):function(e,t,n,i){const r=t.padding,o=jl(n);return e.map(((e,s)=>{i(e,s);const a=o+t.maxHeight+n.labels.margin;t.layer=s%2,t.padding=s%2==0?r:a;const l=El(e,t);return l.data=e.data,l}))}(h,f,n,l),n.labels.filterOverlapping&&function(e,t,n){let i=(t,n)=>Zs(V(1,e[t].boundingRect),V(1,e[n].boundingRect));if(n&&n.tilted){const t=Math.abs(n.angle);i=(n,i)=>{const r=1/Math.abs(e[n].x-e[i].x),o=Math.sin(t*(Math.PI/180))/r;return e[n].boundingRect.height>o}}for(let n=0;n<=e.length-1;n++)for(let r=n+1;r<=Math.min(n+5,n+(e.length-1));r++)e[n]&&e[r]&&i(n,r)&&(r===e.length-1?(e.splice(n,1),t&&t.splice(n,1)):(e.splice(r,1),t&&t.splice(r,1)),r--,n--)}(d,g,f),u.push(...d)}return n.minorTicks&&n.minorTicks.show&&d.length>0&&(f.style=n.minorTicks,f.tickSize=n.minorTicks.tickSize,f.padding=function(e){return e.line.strokeWidth+e.minorTicks.margin}(n),u.push(...Hl(d,f))),g&&u.push(...g),u}return n.build=r,i.build=r,e?i():n()}const Ul={labels:{show:!0,tiltAngle:40,tiltThreshold:.7,maxEdgeBleed:1/0,margin:4,maxLengthPx:150,minLengthPx:0,mode:"auto",maxGlyphCount:NaN,align:.5,offset:0,filterOverlapping:!1},ticks:{show:!1,margin:0,tickSize:4},line:{show:!1},paddingStart:0,paddingEnd:10,align:"auto"},Yl={labels:{show:!0,margin:4,maxLengthPx:150,minLengthPx:0,align:.5,offset:0,filterOverlapping:!0},ticks:{show:!0,margin:0,tickSize:8},minorTicks:{show:!1,tickSize:3,margin:0},line:{show:!0},paddingStart:0,paddingEnd:10,align:"auto"};const Xl={require:["chart","renderer","dockConfig"],defaultSettings:{layout:{displayOrder:0,prioOrder:0},settings:{},style:{labels:"$label",ticks:"$guide-line",minorTicks:"$guide-line--minor",line:"$guide-line"}},created(){this.state={isDiscrete:!!this.scale.bandwidth,isHorizontal:!1,labels:{activeMode:"horizontal"},ticks:[],innerRect:{width:0,height:0,x:0,y:0},outerRect:{width:0,height:0,x:0,y:0},defaultDock:void 0,concreteNodeBuilder:void 0,settings:void 0},this.state.isDiscrete?this.state.defaultDock="bottom":this.state.defaultDock="left",this.setState(this.settings)},setState(){this.state.isDiscrete=!!this.scale.bandwidth,this.state.settings=function(e){let{state:t,style:n,settings:i}=e;const r=E(!0,{},t.isDiscrete?Ul:Yl,n),o=E(!0,{},r,i.settings),s=i.layout.dock||t.defaultDock;o.dock=s,o.align=function(e,t){const n=["top","bottom"],i=["left","right"];return-1!==n.indexOf(e)&&-1===i.indexOf(t)||-1!==i.indexOf(e)&&-1===n.indexOf(t)?e:t}(i.settings.align,s),o.labels.tiltAngle=Math.max(-90,Math.min(o.labels.tiltAngle,90));const{paddingStart:a,paddingEnd:l}=o;return o.paddingStart="function"==typeof a?a.call(null):a,o.paddingEnd="function"==typeof l?l.call(null):l,o}(this),this.state.concreteNodeBuilder=Wl(this.state.isDiscrete),this.dockConfig.dock(this.state.settings.dock),this.state.isHorizontal="top"===this.state.settings.align||"bottom"===this.state.settings.align,this.state.labels.activeMode=function(e,t,n){const i=t.labels.mode;return n&&e.isHorizontal?"auto"===i?e.labels.activeMode:-1!==["layered","tilted"].indexOf(t.labels.mode)&&-1!==["top","bottom"].indexOf(t.dock)?i:"horizontal":"horizontal"}(this.state,this.state.settings,this.state.isDiscrete)},preferredSize(e){const{formatter:t,state:n,scale:i}=this,r=this.state.isHorizontal?e.inner.width:e.inner.height;this.state.pxScale=ns(i,r);const o=function(e){let{isDiscrete:t,rect:n,formatter:i,measureText:r,scale:o,settings:s,state:a}=e,l=0;const{size:c,edgeBleed:u,isToLarge:h}=Ol({isDiscrete:t,rect:n,formatter:i,measureText:r,scale:o,settings:s,state:a});if(l+=c,h)return{size:l};if(s.ticks.show&&(l+=s.ticks.margin,l+=s.ticks.tickSize),s.minorTicks&&s.minorTicks.show){const e=s.minorTicks.margin+s.minorTicks.tickSize;e>l&&(l=e)}if(s.line.show){const e=s.line.strokeWidth/2;l+=e,u[function(e){switch(e){case"top":return"bottom";case"bottom":return"top";case"left":return"right";case"right":return"left";default:return e}}(s.align)]=Math.ceil(e)}return l+=s.paddingStart,l+=s.paddingEnd,{size:l,edgeBleed:u}}({isDiscrete:this.state.isDiscrete,rect:{inner:e.inner,outer:e.outer},formatter:t,measureText:this.renderer.measureText,scale:this.state.pxScale,settings:this.state.settings,state:n});return o},beforeUpdate(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const{settings:t}=e;this.setState(t)},resize(e){const{inner:t,outer:n}=e,i=E({},t,function(e){let{align:t,inner:n}=e;return"left"===t?{x:n.width+n.x}:"right"===t||"bottom"===t?n:{y:n.y+n.height}}({align:this.state.settings.align,inner:t})),r=n||i;return E(this.state.innerRect,i),E(this.state.outerRect,r),n},beforeRender(){const{scale:e,formatter:t}=this,n=this.state.isHorizontal?this.state.innerRect.width:this.state.innerRect.height;this.state.pxScale=ns(e,n),this.state.ticks=this.state.pxScale.ticks({distance:n,formatter:t}).filter((e=>e.position>=0&&e.position<=1))},render(){const{state:e}=this,t=[];return t.push(...this.state.concreteNodeBuilder.build({settings:this.state.settings,scale:this.state.pxScale,innerRect:this.state.innerRect,outerRect:this.state.outerRect,measureText:this.renderer.measureText,textBounds:this.renderer.textBounds,ticks:this.state.ticks,state:e})),fl.multiple(t),t}};const Kl={render:()=>[]};function Gl(e,t,n){let i="";if("function"==typeof e)i=e();else if("string"==typeof e)i=e;else if(n){const e=(n.data().fields||[]).map((e=>e.title()));i=e.join(t)}return i}function Jl(e,t){let n="middle";return"left"===e?"top"===t?n="end":"bottom"===t&&(n="start"):"right"===e?"top"===t?n="start":"bottom"===t&&(n="end"):"left"===t?n="start":"right"===t&&(n="end"),n}const Zl={require:["renderer","chart"],defaultSettings:{layout:{dock:"bottom",displayOrder:0,prioOrder:0},settings:{paddingStart:5,paddingEnd:5,paddingLeft:0,paddingRight:0,anchor:"center",join:", ",maxLengthPx:NaN},style:{text:"$title"}},created(){this.definitionSettings=this.settings.settings;const e=this.settings.text,t=this.definitionSettings.join;this.title=Gl(e,t,this.scale)},preferredSize(){return this.renderer.measureText({text:this.title,fontSize:this.style.text.fontSize,fontFamily:this.style.text.fontFamily}).height+this.definitionSettings.paddingStart+this.definitionSettings.paddingEnd},render(){const{title:e,definitionSettings:t,rect:n}=this,i=[];return i.push(function(e){let{title:t,definitionSettings:n,dock:i,rect:r,measureText:o,style:s}=e;const a={type:"text",text:t,x:0,y:0,dx:0,dy:0,anchor:Jl(i,n.anchor),baseline:"alphabetical",stroke:"transparent",strokeWidth:0,fontWeight:"normal"};E(a,s.text);const l=o(a);if("top"===i||"bottom"===i){let e=r.width/2;"left"===n.anchor?e=n.paddingLeft||0:"right"===n.anchor&&(e=r.width-(n.paddingRight||0)),a.x=e,a.y="top"===i?r.height-n.paddingStart:n.paddingStart+l.height,a.dy="top"===i?-l.height/6:-l.height/3,a.maxWidth=.8*r.width}else{let e=r.height/2;"top"===n.anchor?e=n.paddingStart:"bottom"===n.anchor&&(e=r.height-n.paddingStart),a.y=e,a.x="left"===i?r.width-n.paddingStart:n.paddingStart,a.dx="left"===i?-l.height/3:l.height/3;const t="left"===i?270:90;a.transform="rotate(".concat(t,", ").concat(a.x+a.dx,", ").concat(a.y+a.dy,")"),a.maxWidth=.8*r.height}return isNaN(n.maxLengthPx)||(a.maxWidth=Math.min(a.maxWidth,n.maxLengthPx)),a}({title:e,dock:this.settings.layout.dock,definitionSettings:t,rect:n,measureText:this.renderer.measureText,style:this.style})),i},beforeUpdate(e){e.settings&&(E(this.settings,e.settings),this.definitionSettings=e.settings.settings);const t=this.settings.text,n=this.definitionSettings.join;this.title=Gl(t,n,this.scale)}};function Ql(e,t){const n=e.settings.layout.dock,i=e.settings.settings.invert,r="top"===n||"bottom"===n,o=r?"width":"height",s=e.rect[o],a=e.chart.scroll(e.settings.scroll);let l;{let e=t[r?"x":"y"];i&&(e=s-e);const n=a.getState();l={startOffset:e,startScroll:n.start,swipe:!1};const o=e/s*(n.max-n.min)+n.min;o<n.start?l.startScroll=o:o>n.start+n.viewSize&&(l.startScroll=o-n.viewSize)}return{update:e=>{let t=e[r?"x":"y"];if(i&&(t=s-t),!l.swipe){if(Math.abs(l.startOffset-t)<=1)return;l.swipe=!0}const n=a.getState(),o=(t-l.startOffset)/s*(n.max-n.min),c=l.startScroll+o;a.moveTo(c)},end:e=>{let t=e[r?"x":"y"];i&&(t=s-t);const n=a.getState();if(l.swipe){const e=(t-l.startOffset)/s*(n.max-n.min),i=l.startScroll+e;a.moveTo(i)}else{const e=t/s*(n.max-n.min)+n.min-n.viewSize/2;a.moveTo(e)}}}}function ec(e,t){const n=t.element().getBoundingClientRect();return{x:e.center.x-n.left,y:e.center.y-n.top}}const tc={require:["chart","renderer"],on:{panStart(e){const t=ec(e,this.renderer),n={x:t.x-e.deltaX,y:t.y-e.deltaY};this.currentMove=Ql(this,n),this.currentMove.update(t)},panMove(e){if(!this.currentMove)return;const t=ec(e,this.renderer);this.currentMove.update(t)},panEnd(e){if(!this.currentMove)return;const t=ec(e,this.renderer);this.currentMove.end(t),this.currentMove=null},panCancel(){this.currentMove=null},tap(e){const t=ec(e,this.renderer);Ql(this,t).end(t)}},defaultSettings:{settings:{backgroundColor:"#eee",thumbColor:"#ccc",width:16}},preferredSize:function(e){const t=this.chart.scroll(this.settings.scroll).getState();if(t.viewSize>=t.max-t.min){return Math.max(e.width,e.height)}return this.settings.settings.width},render:function(e){const t=this.settings.layout.dock,n=this.settings.settings.invert,i="top"===t||"bottom"===t,r=i?"width":"height",o=this.rect[r],s=this.chart.scroll(this.settings.scroll).getState();let a=o*(s.start-s.min)/(s.max-s.min);const l=o*s.viewSize/(s.max-s.min);return n&&(a=o-a-l),e("div",{style:{position:"relative",width:"100%",height:"100%",background:this.settings.settings.backgroundColor,pointerEvents:"auto"}},[].concat(e("div",{class:"scroller",style:{position:"absolute",[i?"left":"top"]:"".concat(a,"px"),[i?"top":"left"]:"25%",[i?"height":"width"]:"50%",[r]:"".concat(Math.max(1,l),"px"),background:this.settings.settings.thumbColor}})))},renderer:"dom"};const nc=5,ic=0;function rc(e){let{h:t,isVertical:n,value:i,pos:r,align:o,borderHit:s,state:a,idx:l}=e;const c="end"!==o,u=c?{left:"0",top:"0"}:{right:"0",bottom:"0"};let h=0,d="100%",f="100%";return a.targetRect&&"start"===a.settings.bubbles.align?(d="".concat(a.targetRect.x+a.targetRect.width,"px"),f="".concat(a.targetRect.y+a.targetRect.height,"px")):a.targetRect&&"end"===a.settings.bubbles.align&&(h=n?a.targetRect.x:a.targetRect.y,d="".concat(a.rect.width-h,"px"),f="".concat(a.rect.height-h,"px")),c||(r-=s),t("div",{onmouseover(e){e.srcElement.children[0].style.backgroundColor="#000",e.srcElement.children[0].style[n?"height":"width"]="2px"},onmouseout(e){e.srcElement.children[0].style.backgroundColor=a.style.line.stroke,e.srcElement.children[0].style[n?"height":"width"]="1px"},"data-value":i,"data-key":[a.key,"edge",l].join("-"),style:{cursor:n?"ns-resize":"ew-resize",position:"absolute",left:"".concat(n?h:r,"px"),top:"".concat(n?r:h,"px"),height:n?"".concat(s,"px"):f,width:n?d:"".concat(s,"px"),pointerEvents:"auto"}},[t("div",{style:E({backgroundColor:a.style.line.stroke,position:"absolute",height:n?"".concat(1,"px"):"100%",width:n?"100%":"".concat(1,"px"),pointerEvents:"none"},u)})])}function oc(e){let{h:t,isVertical:n,label:i,otherValue:r,rangeIdx:o,idx:s,pos:a,align:l,state:c,value:u}=e;const h="end"!==l,d="outside"===c.settings.bubbles.placement;let f,p="none";n?(f=h?"left":"right",d&&(p=h?"translate(-100%, 0px)":"translate(100%, 0px)")):(f=h?"top":"bottom",d&&(p=h?"translate(0px, -100%)":"translate(0px, 100%)"));let m=c.edit&&c.edit.rangeIdx===o&&c.edit.bubbleIdx===s;const g={position:"relative",borderRadius:"".concat(c.style.bubble.borderRadius,"px"),border:"".concat(c.style.bubble.strokeWidth,"px solid ").concat(c.style.bubble.stroke),backgroundColor:c.style.bubble.fill,color:c.style.bubble.color,fontFamily:c.style.bubble.fontFamily,fontSize:c.style.bubble.fontSize,padding:"4px 8px",textAlign:"center",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",maxWidth:"150px",minWidth:"50px",minHeight:"1em",pointerEvents:"auto",transform:n?"translate(0,-50%)":"translate(-50%,0)",cursor:n?"ns-resize":"ew-resize"};let y=c.style.bubble.stroke;const v=m?t("input",{type:"text",value:u,style:I(I({},g),{},{textAlign:"start",textOverflow:"",fontSize:"13px"}),onkeyup(e){if("Enter"===e.key){e.preventDefault(),e.stopPropagation();const t=parseFloat(e.target.value);isNaN(t)?(y="rgba(230, 78, 78, 0.6)",e.target.style.border="".concat(c.style.bubble.strokeWidth,"px solid ").concat(y)):c.onEditConfirmed(o,t,r)}else"Escape"===e.key&&(e.preventDefault(),e.stopPropagation(),c.onEditCanceled())}}):t("div",{"data-key":[c.key,"bubble",o,s].join("-"),"data-other-value":r,"data-idx":o,"data-bidx":s,style:g},[i]);return t("div",{style:{position:"absolute",[f]:"0",[n?"top":"left"]:"".concat(a,"px"),transform:p}},[v])}function sc(e){let{h:t,isVertical:n,top:i,height:r,color:o,on:s,opacity:a}=e;return t("div",E({style:{backgroundColor:o,opacity:a,position:"absolute",left:n?0:"".concat(i,"px"),top:n?"".concat(i,"px"):0,height:n?"".concat(r,"px"):"100%",width:n?"100%":"".concat(r,"px"),pointerEvents:"auto"}},s),[])}function ac(e){let{borderHit:t,els:n,isVertical:i,state:r,vStart:o,vEnd:s,idx:a}=e,l=0;r.targetRect&&(l=i?r.targetRect.y:r.targetRect.x);const c=!!r.scale,u=c?r.scale.norm(o)*r.size:o,h=c?r.scale.norm(s)*r.size:s,d=Math.abs(u-h),f=Math.min(u,h)+l,p=f+d;if(r.targetRect){const e=r.targetFillRect||r.targetRect,t=i?e.height:e.width,a=c?r.scale.norm(o)*t:o,l=c?r.scale.norm(s)*t:s,u=Math.abs(a-l),h=Math.min(a,l),d={h:r.h,isVertical:i,top:h,height:u,color:r.style.target.fill,opacity:r.style.target.opacity};r.style.target.opacity<.8&&(d.on={onmouseover(e){e.srcElement.style.opacity=r.style.target.opacity+.1},onmouseout(e){e.srcElement.style.opacity=r.style.target.opacity}}),n.push(r.h("div",{style:{position:"absolute",left:"".concat(e.x,"px"),top:"".concat(e.y,"px"),height:"".concat(e.height,"px"),width:"".concat(e.width,"px")}},[sc(d)]))}const m=u<h?o:s,g=u<h?s:o,[y,v]=c?r.scale.domain():[Math.min(o,s),Math.max(o,s)],b=m+1e-5>=y&&m-1e-5<=v,x=g-1e-5<=v&&g+1e-5>=y;b&&n.push(rc({h:r.h,isVertical:i,borderHit:t,value:m,pos:f,align:"start",state:r,idx:a})),x&&n.push(rc({h:r.h,isVertical:i,borderHit:t,value:g,pos:p,align:"end",state:r,idx:a}));const w=r.settings.bubbles;if(w&&w.show){const e={fontSize:w.fontSize,fontFamily:w.fontFamily,color:w.fill},t=[o,s];b&&n.push(oc({h:r.h,isVertical:i,align:w.align,style:e,rangeIdx:a,idx:0,otherValue:g,value:m,label:"".concat(r.format(m,t)),pos:f,state:r})),x&&n.push(oc({h:r.h,isVertical:i,align:w.align,style:e,rangeIdx:a,idx:1,otherValue:m,value:g,label:"".concat(r.format(g,t)),pos:p,state:r}))}}function lc(e){const t=e.active.limitHigh-e.active.end,n=e.active.limitLow-e.active.start;let i=e.current-e.start;return i=i<0?Math.max(i,n):Math.min(i,t),i}function cc(e){let t=[];const n=e.direction===ic;if(Array.isArray(e.ranges)&&e.ranges.forEach(((i,r)=>{e.active&&r===e.active.idx||ac({borderHit:nc,els:t,isVertical:n,state:e,vStart:Math.min(i.min,i.max),vEnd:Math.max(i.min,i.max),idx:r})})),e.active){let i=e.start,r=e.current;if(-1!==e.active.idx)if("foo"===e.active.mode)i=Math.min(e.active.start,e.active.end),r=Math.max(e.active.start,e.active.end);else if("modify"===e.active.mode)i=Math.min(e.start,e.current),r=Math.max(e.start,e.current);else{const t=lc(e);i=e.active.start+t,r=e.active.end+t}ac({borderHit:nc,els:t,isVertical:n,state:e,vStart:i,vEnd:r,idx:e.active.idx})}return t}function uc(e){return{min:e.scale.min(),max:e.scale.max()}}function hc(e){return{min:0,max:e.direction?e.rect.width:e.rect.height}}function dc(e,t,n){let i,r,o=e.ranges,s=-1;for(i=0;i<o.length;i++){if(o[i].min<=t&&t<=o[i].max){s=i,n.min=i?o[i-1].max:n.min,n.max=i+1<o.length?o[i+1].min:n.max;break}if(t<o[i].min){n.max=o[i].min,n.min=i?o[i-1].max:n.min;break}}-1===s&&o.length&&i>=o.length&&(n.min=o[o.length-1].max),-1!==s&&(r={idx:s,start:o[s].min,end:o[s].max,limitLow:n.min,limitHigh:n.max,mode:"foo"}),e.active=r}function fc(e){e.renderer.render(cc(e))}function pc(e,t){if(!t||!t.isActive())return[];const n=e.scale.data(),i=(n&&n.fields||[]).map((e=>e.id())),r=t.brushes().filter((e=>"range"===e.type&&-1!==i.indexOf(e.id)))[0];return r?r.brush.ranges():[]}function mc(e,t){let n,i=1/0;const r=t.domain(),o=t.bandwidth()/2;for(let s=0;s<r.length;++s){const a=Math.abs(e-o-t(r[s]));a<i&&(i=a,n=r[s])}return n}function gc(e,t){return Math.min(...e)<=Math.max(...t)&&Math.max(...e)>=Math.min(...t)}function yc(e){return j(e.reduce(((e,t)=>(e.push(...z(t.bounds)),e)),[]))}const vc={require:["chart","settings","renderer"],defaultSettings:{settings:{bubbles:{show:!0,align:"start"}},style:{bubble:"$label-overlay",line:"$shape-guide--inverted",target:"$selection-area-target"}},renderer:"dom",on:{rangeStart(e){this.start(e)},rangeMove(e){this.move(e)},rangeEnd(e){this.end(e)},rangeClear(e){this.clear(e)},bubbleStart(e){this.bubbleStart(e)}},created(){this.state={key:this.settings.key||"brush-range"}},beforeRender(e){this.state.rect=e.size.computedInner},renderRanges(){this.state.started||(this.state.ranges=pc(this.state,this.state.brushInstance),this.state.active=null,fc(this.state))},render(e){const t=this.settings.settings;this.state.direction="vertical"===t.direction?ic:1;const n=this.renderer.element().getBoundingClientRect(),i=this.state.rect[this.state.direction===ic?"height":"width"];let r=ns(this.chart.scale(t.scale),i);const o=function(e){const t={targetRect:null,targetFillRect:null,scale:null,size:null},n=e.settings.settings,i=n.target&&(n.target.components||(n.target.component?[n.target.component]:[])).map((t=>e.chart.component(t))).filter((e=>!!e&&!!e.rect)),r=n.target&&n.target.selector?e.chart.findShapes(n.target.selector):[],o=n.target&&n.target.fillSelector?e.chart.findShapes(n.target.fillSelector):[];if(r.length>0){const i=yc(r);if(t.size=i[e.state.direction===ic?"height":"width"],t.scale=ns(e.chart.scale(n.scale),t.size),t.targetRect=i,o.length>0){const e=yc(o);t.targetFillRect=e}}else if(i&&i.length>0){const n=i.slice(1).reduce(((e,t)=>({x0:Math.min(e.x0,t.rect.computedInner.x),y0:Math.min(e.y0,t.rect.computedInner.y),x1:Math.max(e.x1,t.rect.computedInner.x+t.rect.computedInner.width),y1:Math.max(e.y1,t.rect.computedInner.y+t.rect.computedInner.height)})),{x0:i[0].rect.computedInner.x,y0:i[0].rect.computedInner.y,x1:i[0].rect.computedInner.x+i[0].rect.computedInner.width,y1:i[0].rect.computedInner.y+i[0].rect.computedInner.height});t.targetRect={x:n.x0-e.state.rect.x,y:n.y0-e.state.rect.y,width:n.x1-n.x0,height:n.y1-n.y0}}return t}(this);if(r=o.scale?o.scale:r,this.state.targetRect=o.targetRect,this.state.targetFillRect=o.targetFillRect,this.state.size=null===o.size?i:o.size,this.state.settings=t,this.state.style=this.style,this.state.offset=n,this.state.brush="object"==typeof t.brush?t.brush.context:t.brush,this.state.brushInstance=this.chart.brush(this.state.brush),this.state.renderer=this.renderer,this.state.multi=!!t.multiple,this.state.h=e,this.state.onEditConfirmed=(e,t,n)=>{this.state.edit=null,function(e,t,n,i){let r=e.ranges.map((e=>({min:e.min,max:e.max})));const o=e.scale.min(),s=e.scale.max();r[t]={min:Math.max(o,Math.min(n,i)),max:Math.min(s,Math.max(n,i))},e.ranges[t]=I({},r[t]);const a=e.scale.data();a&&a.fields&&a.fields.forEach((t=>{e.fauxBrushInstance||e.brushInstance.setRange(t.id(),r)}))}(this.state,e,t,n),this.emit("bubbleEnd"),fc(this.state)},this.state.onEditCanceled=()=>{this.state.edit=null,fc(this.state)},this.state.cssCoord={offset:this.state.direction===ic?"top":"left",coord:this.state.direction===ic?"y":"x",pos:this.state.direction===ic?"deltaY":"deltaX"},this.state.format="function"==typeof t.bubbles.label&&((e,n)=>t.bubbles.label.call(void 0,{datum:e,data:n,scale:r,resources:{scale:this.chart.scale,formatter:this.chart.formatter}})),{}.hasOwnProperty.call(r,"norm")){this.state.editable=!0,this.state.observeBrush="object"==typeof t.brush&&t.brush.observe,this.state.fauxBrushInstance=null,this.state.findValues=null,this.state.scale=r;const e=this.state.scale.data();!this.state.format&&e&&e.fields&&e.fields[0]&&(this.state.format=e.fields[0].formatter())}else this.state.editable=!1,this.state.scale=ro(),this.state.scale.data=r.data,this.state.format||(this.state.format=(e,t)=>gc(r.range(),t)?function(e,t){const n=t.ticks(),i=t.domain().indexOf(mc(e,t));return-1!==i?n[i].label:"-"}(e,r):"-"),this.state.fauxBrushInstance=Vo(),this.state.findValues=e=>function(e,t){const n=t.domain(),i=t.range(),r=[];return e.forEach((e=>{if(!gc(i,[e.min,e.max]))return;const o=n.indexOf(mc(e.min,t)),s=n.indexOf(mc(e.max,t));r.push.apply(r,n.slice(Math.min(o,s),Math.max(o,s)+1))})),r}(e,r);return this.state.ranges=pc(this.state,this.state.brushInstance),this.state.observeBrush||this.state.sourcedFromThisComponent?[cc(this.state)]:[]},mounted(){this.state.observeBrush&&this.state.brushInstance&&this.state.brushInstance.on("update",this.renderRanges)},beforeDestroy(){this.state.observeBrush&&this.state.brushInstance&&this.state.brushInstance.removeListener("update",this.renderRanges)},start(e){!function(e){let{state:t,e:n,renderer:i,ranges:r,targetSize:o}=e;if(t.started)return;t.edit=null;const s=n.center.x-n.deltaX,a=n.center.y-n.deltaY;let l=document.elementFromPoint(s,a);i.element().contains(l)||(l=null);const c={started:!0};t.offset=E({},i.element().getBoundingClientRect());const u=s-t.offset.left,h=a-t.offset.top;t.offset.left+=t.targetRect?t.targetRect.x:0,t.offset.top+=t.targetRect?t.targetRect.y:0,t.ranges=r(t,t.fauxBrushInstance||t.brushInstance);const d=n.center[t.cssCoord.coord]-n[t.cssCoord.pos]-t.offset[t.cssCoord.offset],f=n.center[t.cssCoord.coord]-t.offset[t.cssCoord.offset];c.current=t.scale.normInvert(f/t.size),c.start=t.scale.normInvert(d/t.size);let p=t.ranges;const m=uc(t);let g,y,v=-1;if(l&&l.hasAttribute("data-idx"))v=parseInt(l.getAttribute("data-idx"),10),m.min=v>0?p[v-1].max:m.min,m.max=v+1<p.length?p[v+1].min:m.max;else{for(g=0;g<p.length;g++){if(p[g].min<=c.start&&c.start<=p[g].max){v=g,m.min=g?p[g-1].max:m.min,m.max=g+1<p.length?p[g+1].min:m.max;break}if(c.start<p[g].min){m.max=p[g].min,m.min=g?p[g-1].max:m.min;break}}-1===v&&p.length&&g>=p.length&&(m.min=p[p.length-1].max)}if(-1!==v||t.multi||(c.ranges=[],m.min=t.scale.min(),m.max=t.scale.max()),-1!==v)if(y={idx:v,start:p[v].min,end:p[v].max,limitLow:m.min,limitHigh:m.max,mode:"move"},l&&l.hasAttribute("data-other-value"))c.start=parseFloat(l.getAttribute("data-other-value")),y.mode="modify";else{let e=t.scale.norm(y.start)*t.size,n=t.scale.norm(y.end)*t.size;Math.abs(d-e)<=o?(c.start=y.end,y.mode="modify"):Math.abs(d-n)<=o&&(c.start=y.start,y.mode="modify")}else y={idx:-1,start:c.start,end:c.current,limitLow:m.min,limitHigh:m.max,mode:"current"};c.active=y,"modify"!==y.mode&&t.targetRect&&!ea(t.targetRect,{x:u,y:h})||Object.keys(c).forEach((e=>t[e]=c[e]))}({e:e,state:this.state,renderer:this.renderer,ranges:pc,targetSize:nc})},end(){this.state.started&&(!function(e,t){e.started=!1,e.ranges=t(e,e.fauxBrushInstance||e.brushInstance);const n=uc(e);dc(e,e.current,n)}(this.state,pc),fc(this.state),this.state.sourcedFromThisComponent=!0,this.state.active=null)},move(e){this.state.started&&(!function(e,t){const n=(t.center[e.cssCoord.coord]-e.offset[e.cssCoord.offset])/e.size,i=e.scale.normInvert(n);e.current=Math.max(Math.min(i,e.active.limitHigh),e.active.limitLow)}(this.state,e),function(e){let t=e.ranges.map((e=>({min:e.min,max:e.max})));if(-1!==e.active.idx)if("modify"===e.active.mode)t[e.active.idx].min=Math.min(e.start,e.current),t[e.active.idx].max=Math.max(e.start,e.current);else{const n=lc(e);t[e.active.idx].min+=n,t[e.active.idx].max+=n}else t.push({min:Math.min(e.start,e.current),max:Math.max(e.start,e.current)});const n=e.scale.data();n&&n.fields&&n.fields.forEach((n=>{if(e.fauxBrushInstance){let i=pc(e,e.fauxBrushInstance),r=e.findValues(i),o=e.findValues(t),s=o.filter((e=>-1===r.indexOf(e))),a=r.filter((e=>-1===o.indexOf(e))),l=s.map((e=>({key:n.id(),value:e}))),c=a.map((e=>({key:n.id(),value:e})));e.brushInstance.addAndRemoveValues(l,c),e.fauxBrushInstance.setRange(n.id(),t)}else e.brushInstance.setRange(n.id(),t)}))}(this.state),fc(this.state))},clear(){this.state.fauxBrushInstance&&this.state.fauxBrushInstance.clear(),this.state.renderer.render([]),this.state.started=!1,this.state.active=null,this.state.sourcedFromThisComponent=!1},bubbleStart(e){if(!this.state.editable)return;const t=e.srcEvent||e,n=t.target,i={rangeIdx:parseInt(n.getAttribute("data-idx"),10),bubbleIdx:parseInt(n.getAttribute("data-bidx"),10)};if(isNaN(i.rangeIdx)||JSON.stringify(i)===JSON.stringify(this.state.edit))return;this.state.edit=i,t.stopPropagation(),t.stopImmediatePropagation(),t.preventDefault();const r=n.parentNode;fc(this.state);const o=r.querySelector("input");o.focus(),o.select()}};function bc(e){e.renderer.render(cc(e))}function xc(e){return e.rc.ranges()}function wc(e,t){const n={x:e.direction?t.min+e.rect.x:e.rect.x,y:e.direction?e.rect.y:t.min+e.rect.y,width:e.direction?t.max-t.min:e.rect.width+e.rect.x,height:e.direction?e.rect.height+e.rect.y:t.max-t.min};return e.chart.shapesAt(n,e.settings.brush)}const qc={require:["chart","settings","renderer"],defaultSettings:{settings:{bubbles:{show:!0,align:"start"}},style:{bubble:"$label-overlay",line:"$shape-guide--inverted",target:"$selection-area-target"}},renderer:"dom",on:{areaStart(e){this.start(e)},areaMove(e){this.move(e)},areaEnd(e){this.end(e)},areaClear(e){this.clear(e)}},created(){this.state={key:this.settings.key||"brush-area-dir"}},render(e){this.state.rect=this.rect;const t=this.settings.settings,n="vertical"===t.direction?ic:1,i=this.state.rect[n===ic?"height":"width"],r=this.renderer.element().getBoundingClientRect(),o=(t.target?t.target.components||[t.target.component]:[]).map((e=>this.chart.component(e))).filter((e=>!!e&&!!e.rect)),s=o[0]?o.slice(1).reduce(((e,t)=>({x0:Math.min(e.x0,t.rect.x),y0:Math.min(e.y0,t.rect.y),x1:Math.max(e.x1,t.rect.x+t.rect.width),y1:Math.max(e.y1,t.rect.y+t.rect.height)})),{x0:o[0].rect.x,y0:o[0].rect.y,x1:o[0].rect.x+o[0].rect.width,y1:o[0].rect.y+o[0].rect.height}):null;return this.state.targetRect=s?{x:s.x0-this.rect.x,y:s.y0-this.rect.y,width:s.x1-s.x0,height:s.y1-s.y0}:null,this.state.style=this.style,this.state.chart=this.chart,this.state.direction=n,this.state.settings=t,this.state.offset=r,this.state.rc=To(),this.state.renderer=this.renderer,this.state.multi=!!t.multiple,this.state.h=e,this.state.size=i,this.state.cssCoord={offset:this.state.direction===ic?"top":"left",coord:this.state.direction===ic?"y":"x",pos:this.state.direction===ic?"deltaY":"deltaX",area:this.state.direction===ic?"height":"width"},this.state.format=function(e,t){return function(e,t,n){const i=Math.min(...n),r=Math.max(...n),o={x:e.direction?i+e.rect.x:e.rect.x,y:e.direction?e.rect.y:i+e.rect.y,width:e.direction?r-i:e.rect.width+e.rect.x,height:e.direction?e.rect.height+e.rect.y:r-i},s=e.chart.shapesAt(o,e.settings.brush);if(0===s.length)return"-";const a=s.reduce(((n,r)=>{const o=n.bounds,s=r.bounds;return t===i?o[e.cssCoord.coord]<=s[e.cssCoord.coord]?n:r:o[e.cssCoord.coord]+o[e.cssCoord.area]>=s[e.cssCoord.coord]+s[e.cssCoord.area]?n:r})),l=e.settings.brush.components.reduce(((e,t)=>e.key===a.key?e:t));return"function"==typeof e.settings.bubbles.label?e.settings.bubbles.label(a.data):Array.isArray(l.data)&&l.data.length?a.data[l.data[0]].label:a.data&&a.data.label?a.data.label:"-"}(this,e,t)},[]},start(e){!function(e){let{state:t,e:n,renderer:i,ranges:r,targetSize:o}=e;if(t.started)return;const s=n.center.x-n.deltaX,a=n.center.y-n.deltaY;let l=document.elementFromPoint(s,a);i.element().contains(l)||(l=null);const c={started:!0};t.offset=i.element().getBoundingClientRect(),t.ranges=r(t);const u=s-t.offset.left,h=a-t.offset.top,d=n.center[t.cssCoord.coord]-n[t.cssCoord.pos]-t.offset[t.cssCoord.offset],f=n.center[t.cssCoord.coord]-t.offset[t.cssCoord.offset];let p=f,m=d;c.start=d,c.current=f;let g=t.ranges;const y=hc(t);let v,b,x=-1;if(l&&l.hasAttribute("data-idx"))x=parseInt(l.getAttribute("data-idx"),10),y.min=x>0?g[x-1].max:y.min,y.max=x+1<g.length?g[x+1].min:y.max;else{for(v=0;v<g.length;v++){if(g[v].min<=m&&m<=g[v].max){x=v,y.min=v?g[v-1].max:y.min,y.max=v+1<g.length?g[v+1].min:y.max;break}if(m<g[v].min){y.max=g[v].min,y.min=v?g[v-1].max:y.min;break}}-1===x&&g.length&&v>=g.length&&(y.min=g[g.length-1].max)}if(-1!==x||t.multi||(c.ranges=[],y.min=0,y.max=t.direction?t.rect.width:t.rect.height),-1!==x)if(b={idx:x,start:g[x].min,end:g[x].max,limitLow:y.min,limitHigh:y.max,mode:"move"},l&&l.hasAttribute("data-other-value"))c.start=parseFloat(l.getAttribute("data-other-value")),b.mode="modify";else{let e=b.start,t=b.end;Math.abs(d-e)<=o?(c.start=b.end,b.mode="modify"):Math.abs(d-t)<=o&&(c.start=b.start,b.mode="modify")}else b={idx:-1,start:m,end:p,limitLow:y.min,limitHigh:y.max,mode:"current"};c.active=b,"modify"!==b.mode&&t.targetRect&&!ea(t.targetRect,{x:u,y:h})||Object.keys(c).forEach((e=>t[e]=c[e]))}({e:e,state:this.state,renderer:this.renderer,ranges:xc,targetSize:nc})},end(){this.state.started&&(!function(e,t){e.started=!1,e.ranges=t(e);const n=hc(e);dc(e,e.current,n)}(this.state,xc),bc(this.state))},move(e){this.state.started&&(!function(e,t){const n=t.center[e.cssCoord.coord]-e.offset[e.cssCoord.offset];e.current=Math.max(Math.min(n,e.active.limitHigh),e.active.limitLow)}(this.state,e),function(e){const t=e.ranges.map((e=>({min:e.min,max:e.max})));if(-1!==e.active.idx)if("modify"===e.active.mode)t[e.active.idx].min=Math.min(e.start,e.current),t[e.active.idx].max=Math.max(e.start,e.current);else{const n=lc(e);t[e.active.idx].min=e.active.start+n,t[e.active.idx].max=e.active.end+n}else t.push({min:Math.min(e.start,e.current),max:Math.max(e.start,e.current)});e.rc.set(t);let n=[];t.forEach((t=>{n=[...n,...wc(e,t)]})),function(e,t){e.chart.brushFromShapes(t,e.settings.brush)}(e,n)}(this.state),bc(this.state))},clear(){this.state.rc&&this.state.rc.clear(),this.state.renderer.render([])}};function Sc(e){const t="vertical"===e.direction,n=e.rect[t?"height":"width"],i=e.rect[t?"width":"height"];return function(e){const t=e.brush;if(!t||!t.isActive())return[];const n=e.scale.data(),i=(n&&n.fields||[]).map((e=>e.id())),r=t.brushes().filter((e=>"range"===e.type&&-1!==i.indexOf(e.id)))[0];return r?r.brush.ranges():[]}(e).map((r=>{const o=e.scale(r.min)*n,s=e.scale(r.max)*n,a=Math.min(o,s),l=Math.abs(o-s);return{type:"rect",fill:e.fill,opacity:e.opacity,x:t?0:a,width:t?i:l,y:t?a:0,height:t?l:i}}))}function Mc(e,t,n,i){function r(){!function(e){e.renderer.render(Sc(e))}(e)}function o(){!function(e){e.renderer.render(Sc(e))}(e)}function s(){!function(e){e.renderer.render(Sc(e))}(e)}e.brush=t,t&&(t.on("start",r),t.on("update",o),t.on("end",s),e.start=r,e.update=o,e.end=s,e.brush=t,e.scale=n,e.renderer=i)}function Dc(e){e.brush&&(e.brush.removeListener("start",e.start),e.brush.removeListener("update",e.update),e.brush.removeListener("end",e.end)),e.start=void 0,e.update=void 0,e.end=void 0,e.brush=void 0,e.scale=void 0,e.renderer=void 0}const _c={require:["chart","settings","renderer"],defaultSettings:{settings:{}},preferredSize:()=>50,created(){this.state={}},render(){const e=this.settings.settings,t=this.chart.brush(e.brush),n=e.direction||"horizontal",i="horizontal"===n?this.rect.width:this.rect.height,r=ns(this.chart.scale(e.scale),i);return Dc(this.state),Mc(this.state,t,r,this.renderer),this.state.rect=this.rect,this.state.fill=e.fill||"#ccc",this.state.opacity=void 0!==e.opacity?e.opacity:1,this.state.direction=n,Sc(this.state)},beforeDestroy(){Dc(this.state)}};function Cc(e,t){const n=t.center.x,i=t.center.y;return{x:n-e.left,y:i-e.top}}function kc(e,t,n){return xs(e,t.points[0])<n.settings.snapIndicator.threshold**2}function Ec(e,t){null==e.path.d?e.path.d="M".concat(t.x," ").concat(t.y," "):e.path.d+="L".concat(t.x," ").concat(t.y," "),e.points.push(t)}function Ac(e){let{state:t,start:n=null,end:i=null}=e;null!==n&&(t.snapIndicator.x1=n.x,t.snapIndicator.y1=n.y),null!==i&&(t.snapIndicator.x2=i.x,t.snapIndicator.y2=i.y)}function Tc(e,t){e.snapIndicator.visible=t}const Ic={require:["chart","renderer","settings"],defaultSettings:{layout:{displayOrder:0},settings:{brush:{components:[]},snapIndicator:{threshold:75,strokeDasharray:"5, 5",stroke:"black",strokeWidth:2,opacity:.5},lasso:{fill:"transparent",stroke:"black",strokeWidth:2,opacity:.7,strokeDasharray:"20, 10"},startPoint:{r:10,fill:"green",stroke:"black",strokeWidth:1,opacity:1}}},on:{lassoStart(e){this.start(e)},lassoEnd(e){this.end(e)},lassoMove(e){this.move(e)},lassoCancel(){this.cancel()}},created(){this.state={points:[],active:!1,path:null,snapIndicator:null,startPoint:null,rendererBounds:null,componentDelta:null,brushConfig:null,lineBrushShape:{x1:0,y1:0,x2:0,y2:0}}},start(e){var t;this.state.active=!0,this.state.path={visible:!0,type:"path",d:null,fill:(t=this.settings.settings.lasso).fill,stroke:t.stroke,strokeWidth:t.strokeWidth,opacity:t.opacity,strokeDasharray:t.strokeDasharray,collider:{type:null}},this.state.snapIndicator=function(e){return{visible:!1,type:"line",x1:0,y1:0,x2:0,y2:0,strokeDasharray:e.strokeDasharray,stroke:e.stroke,strokeWidth:e.strokeWidth,opacity:e.opacity,collider:{type:null}}}(this.settings.settings.snapIndicator),this.state.startPoint=function(e){return{visible:!0,type:"circle",cx:0,cy:0,r:e.r,fill:e.fill,opacity:e.opacity,stroke:e.stroke,strokeWidth:e.strokeWidth,collider:{type:null}}}(this.settings.settings.startPoint),this.state.rendererBounds=this.renderer.element().getBoundingClientRect(),this.state.componentDelta=function(e,t){const n=e.element.getBoundingClientRect();return{x:t.left-n.left,y:t.top-n.top}}(this.chart,this.state.rendererBounds),this.state.brushConfig=function(e){return e.settings.brush.components.map((e=>({key:e.key,contexts:e.contexts||["lassoBrush"],data:e.data||[""],action:e.action||"add"})))}(this.settings);const n=Cc(this.state.rendererBounds,e);Ec(this.state,n),Ac({state:this.state,start:n}),function(e,t){e.startPoint.cx=t.x,e.startPoint.cy=t.y}(this.state,n)},move(e){if(!this.state.active)return;const t=Cc(this.state.rendererBounds,e);kc(t,this.state,this.settings)?Tc(this.state,!0):Tc(this.state,!1),Ec(this.state,t),Ac({state:this.state,end:t}),function(e,t){const n=[e.startPoint,e.path,e.snapIndicator].filter((e=>e.visible));t.render(n)}(this.state,this.renderer),function(e,t){if(e.active){const n=e.points[e.points.length-2],i=e.points[e.points.length-1];e.lineBrushShape.x1=n.x+e.componentDelta.x,e.lineBrushShape.y1=n.y+e.componentDelta.y,e.lineBrushShape.x2=i.x+e.componentDelta.x,e.lineBrushShape.y2=i.y+e.componentDelta.y;const r=t.shapesAt(e.lineBrushShape,{components:e.brushConfig});t.brushFromShapes(r,{components:e.brushConfig})}}(this.state,this.chart)},end(e){if(!this.state.active)return;Tc(this.state,!1);kc(Cc(this.state.rendererBounds,e),this.state,this.settings)&&function(e,t){if(e.active){const n=e.componentDelta.x,i=e.componentDelta.y,r=e.points.map((e=>({x:e.x+n,y:e.y+i}))),o=t.shapesAt({vertices:r},{components:e.brushConfig});t.brushFromShapes(o,{components:e.brushConfig})}}(this.state,this.chart),this.state={points:[],active:!1,path:null,snapIndicator:null,startPoint:null,rendererBounds:null,componentDelta:null,brushConfig:null,lineBrushShape:{x1:0,y1:0,x2:0,y2:0}},this.renderer.render([])},cancel(){this.state.active&&(!function(e,t){e.brushConfig.forEach((e=>{e.contexts.forEach((e=>{t.brush(e).end()}))}))}(this.state,this.chart),this.state={points:[],active:!1,path:null,snapIndicator:null,startPoint:null,rendererBounds:null,componentDelta:null,brushConfig:null,lineBrushShape:{x1:0,y1:0,x2:0,y2:0}},this.renderer.render([]))},render(){}};function Rc(e,t,n,i,r){let o,s=0,a=t.length-1;for(;s<a;){let l=Math.floor((s+a)/2);o=r(t[l]),o[n]+o[i]<e[n]?s=l+1:a=l}return s}function Oc(e){let{orientation:t,targetNodes:n,labels:i,container:r}=e,o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Rc;const s=[],a="v"===t?"x":"y",l="v"===t?"width":"height",c=e=>e.textBounds,u=e=>e.node.localBounds;return(e,t)=>{const{textBounds:h,node:d}=i[t];if(h[a]<r[a]||h[a]+h[l]>r[a]+r[l])return!1;for(let e=o(h,s,a,l,c);e<s.length;e++)if(Zs(h,s[e].textBounds))return!1;const f=o(h,n,a,l,u),p=h[a]+h[l];for(let e=f;e<n.length;e++){const t=n[e].node;if(p<t.localBounds[a])break;if(Zs(h,t.localBounds)&&d!==t)return!1}return s.push(i[t]),!0}}const Nc=4;function Pc(e,t){return{node:e,data:e.data,scale:t.scale,formatter:t.formatter,dataset:t.dataset}}function Lc(e){const t=typeof e;return("string"===t||"number"===t)&&""!==e}function Fc(e){return I(I({type:"rect",rx:2,ry:2,fill:e.backgroundColor},e.backgroundBounds),{},{data:"".concat(e.data," ").concat(e.text),rotation:e.transform&&e.transform.match(/rotate/gi)?"rotated":"horizontal"})}function zc(e,t,n){return n?e.width>=t.height:e.width>=t.width}function jc(e,t,n){return n?e.height>=t.width:e.height>=t.height}function Hc(e,t,n,i,r){let o,s;return"v"===e?(o=i||r||zc(t,n,!0),s=jc(t,n,!i)):(o=zc(t,n),s=r||jc(t,n,!1)),o&&s}function Bc(e,t,n,i){return e+.5*t+(i-.5)*(t-n)-.5*n}function Vc(e,t,n){const i={type:"text",text:t,maxWidth:n.rotate?e.height:e.width,x:0,y:e.y,dx:0,dy:0,fill:n.fill,anchor:n.rotate?"end":"start",baseline:"central",fontSize:"".concat(n.fontSize,"px"),fontFamily:n.fontFamily},r=n.textMetrics;if(!n.overflow&&!function(e,t,n){return zc(e,t,n.rotate)&&jc(e,t,n.rotate)}(e,r,n))return!1;const o=.5*r.height;return n.rotate?(i.x=Bc(e.x,e.width,r.height,n.align)+o,i.y=Bc(e.y,e.height,r.width,n.justify),i.transform="rotate(-90, ".concat(i.x+i.dx,", ").concat(i.y+i.dy,")")):(i.x=Bc(e.x,e.width,r.width,n.align),i.y=Bc(e.y,e.height,r.height,n.justify)+o),i}function $c(e){let{bar:t,view:n,direction:i,position:r,padding:o=Nc}=e;const s={};if(E(s,t),r&&"inside"!==r)if("up"===i||"down"===i){const e=Math.max(0,Math.min(t.y,n.height)),o=Math.max(0,Math.min(t.y+t.height,n.height));"outside"===r&&"up"===i||"opposite"===r&&"down"===i?(s.y=0,s.height=e):("outside"===r&&"down"===i||"opposite"===r&&"up"===i)&&(s.y=o,s.height=n.height-o)}else{const e=Math.max(0,Math.min(t.x,n.width)),o=Math.max(0,Math.min(t.x+t.width,n.width));"outside"===r&&"left"===i||"opposite"===r&&"right"===i?(s.x=0,s.width=e):("outside"===r&&"right"===i||"opposite"===r&&"left"===i)&&(s.x=o,s.width=n.width-o)}else;return function(e,t){const n=Math.max(0,Math.min(e.y,t.height)),i=Math.max(0,Math.min(e.y+e.height,t.height)),r=Math.max(0,Math.min(e.x,t.width)),o=Math.max(0,Math.min(e.x+e.width,t.width));e.x=r,e.width=o-r,e.y=n,e.height=i-n}(s,n),function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const{top:n=Nc,bottom:i=Nc,left:r=Nc,right:o=Nc}=t;e.x+=r,e.width-=r+o,e.y+=n,e.height-=n+i}(s,o),s}function Wc(e){let t,n,i,r,o,{direction:s,fitsHorizontally:a,measured:l,node:c,orientation:u,placementSettings:h,rect:d}=e,f=arguments.length>1&&void 0!==arguments[1]?arguments[1]:$c;const p=[],m="h"===u?"width":"height";for(o=0;o<h.length;o++)if(i=h[o],r=f({bar:c.localBounds,view:d,direction:s,position:i.position,padding:i.padding}),p.push(r),t=!o||r[m]>t[m]?r:t,Hc(u,r,l,a,i.overflow)){n=r;break}return n||(n=t,o=p.indexOf(n)),i=h[o],{bounds:n,placement:i}}function Uc(e,t,n,i){let r=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{};const{top:o=Nc,bottom:s=Nc,left:a=Nc,right:l=Nc}=r,c=e.x+e.dx,u=e.y+e.dy,h=n?Math.min(t.width,i.height):Math.min(t.height,i.width),d=n?Math.min(t.height,i.height):Math.min(t.width,i.width),f=.5*t.height,p=1e-9;return{x:(n?c-f:c)-a-p,y:(n?u:u-f)-o-p,width:d+(a+l)-p,height:h+(o+s)-p}}function Yc(e){let{chart:t,targetNodes:n,rect:i,fitsHorizontally:r,collectiveOrientation:o}=e,s=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Wc,a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Vc,l=arguments.length>3&&void 0!==arguments[3]?arguments[3]:Oc;const c=[],u={container:i,targetNodes:n,labels:[],orientation:o};let h,d,f,p,m,g,y,v,b,x,w,q,S,M;for(let e=0,l=n.length;e<l;e++){g=null,d=n[e],f=d.node,S=Pc(f,t),b=d.direction,M="left"===b||"right"===b?"h":"v";for(let t=0;t<d.texts.length;t++){if(p=d.texts[t],!Lc(p))continue;x=d.labelSettings[t],v=d.measurements[t],q=x.placements;const n=s({direction:b,fitsHorizontally:r,lblStngs:x,measured:v,node:f,orientation:M,placements:q,placementSettings:d.placementSettings[t],rect:i});if(g=n.bounds,w=n.placement,g&&w){m=w.justify;const t="function"==typeof x.linkData?x.linkData(S,e):void 0,n="function"==typeof w.overflow?w.overflow(S,e):w.overflow;"up"===b&&(m=1-m),"opposite"===w.position&&(m=1-m),"left"===b&&(m=1-m);const i=!("h"===o||r);if(h=a(g,p,{justify:"h"===M?w.align:m,align:"h"===M?m:w.align,fontSize:x.fontSize,fontFamily:x.fontFamily,textMetrics:v,rotate:i,overflow:!!n}),h){const n=Uc(h,v,i,g,w.padding);y="function"==typeof w.fill?w.fill(I(I({},S),{},{textBounds:n}),e):w.fill,h.fill=y,void 0!==t&&(h.data=t),"object"==typeof w.background&&(h.backgroundColor="function"==typeof w.background.fill?w.background.fill(I(I({},S),{},{textBounds:n}),e):w.background.fill,void 0!==h.backgroundColor&&(h.backgroundBounds=Uc(h,v,i,g,w.background.padding))),c.push(h),u.labels.push({node:f,textBounds:n})}}}}const D=c.filter(l(u));return[...D.filter((e=>void 0!==e.backgroundBounds)).map(Fc),...D]}const Xc=4,Kc=1;function Gc(e){const t=2*Math.PI;return(e%t+t)%t}function Jc(e,t){e.x+=t,e.width-=2*t,e.y+=t,e.height-=2*t}function Zc(e){return{x:e.x,y:e.y-e.height/2,width:e.width,height:e.height}}function Qc(e,t,n){let{x:i,y:r}=t;if(i*i+r*r>e*e)return null;let o=Math.sin(n),s=Math.cos(n),a=i*s-r*o,l=e*e-a*a;if(l<0)return null;let c=Math.sqrt(l);return{x:a*s+o*c,y:-a*o+s*c}}function eu(e){let t,n,{radius:i,size:r,angle:o}=e,{width:s,height:a}=r,l={x:s/2,y:a/2};switch(Math.floor(o/(Math.PI/2))){case 0:if(t=Qc(i,l,o),!t)return null;t.y*=-1,n={x:-s,y:0};break;case 1:if(t=Qc(i,l,Math.PI-o),!t)return null;n={x:-s,y:-a};break;case 2:if(t=Qc(i,l,o-Math.PI),!t)return null;t.x*=-1,n={x:0,y:-a};break;case 3:if(t=Qc(i,l,2*Math.PI-o),!t)return null;t.x*=-1,t.y*=-1,n={x:0,y:0};break;default:throw new Error("invalid angle")}return{x:t.x+n.x,y:t.y+n.y,width:s,height:a}}function tu(e){let{slice:t,measured:n,padding:i}=e,{start:r,end:o,innerRadius:s,outerRadius:a}=t,l=a-s-2*i,c=o-r;if(c<Math.PI){let e=(n.height/2+i)/Math.tan(c/2);e>s&&(l=a-e-2*i)}if(l<0||l<n.minReqWidth)return null;const u=Gc((r+o)/2);let h=a-i,d={x:Math.sin(u)*h,y:-Math.cos(u)*h,width:l,height:n.height};return u<Math.PI?(d.angle=u-Math.PI/2,d.anchor="end"):(d.angle=u+Math.PI/2,d.anchor="start"),d}function nu(e){let{context:t,node:n,bounds:i}=e;let{start:r,end:o}=n.desc.slice;const s=Gc((r+o)/2);switch(Math.floor(s/(Math.PI/2))){case 0:t.q1maxY=i.y-2,void 0===t.q2minY&&(t.q2minY=i.y+i.height+2);break;case 1:t.q2minY=i.y+i.height+2;break;case 2:t.q3minY=i.y+i.height+2;break;case 3:t.q4maxY=i.y-2,void 0===t.q3minY&&(t.q3minY=i.y+i.height+2)}}function iu(e,t){return{node:e,data:e.data,scale:t.scale,formatter:t.formatter,dataset:t.dataset}}function ru(e,t,n){const i={type:"text",text:t,maxWidth:e.width,x:e.x,y:e.y+("top"===e.baseline?e.height/2:0),fill:n.fill,anchor:e.anchor||"start",baseline:"middle",fontSize:"".concat(n.fontSize,"px"),fontFamily:n.fontFamily};if(!isNaN(e.angle)){let t=e.angle*(360/(2*Math.PI));i.transform="rotate(".concat(t,", ").concat(i.x,", ").concat(i.y,")")}return i}function ou(e){let t,n,{slice:i,direction:r,position:o,padding:s,measured:a,view:l,context:c,store:u}=e,{start:h,end:d,innerRadius:f,offset:p}=i;switch(o){case"into":t="rotate"===r?tu({slice:i,measured:a,padding:s}):function(e){let{slice:t,padding:n,measured:i}=e,{start:r,end:o,innerRadius:s,outerRadius:a}=t;const l=Gc((r+o)/2);let c=eu({radius:a,size:{width:i.width+2*n+Kc,height:i.height+2*n},angle:l});return c?(c.baseline="top",ta(c,{x1:0,y1:0,x2:Math.sin(r)*a,y2:-Math.cos(r)*a})||ta(c,{x1:0,y1:0,x2:Math.sin(o)*a,y2:-Math.cos(o)*a})||Us({cx:0,cy:0,r:s},c)?null:(Jc(c,n),c)):null}({slice:i,measured:a,padding:s});break;case"inside":n={start:h,end:d,innerRadius:0,outerRadius:f},t="rotate"===r?tu({slice:n,measured:a,padding:s}):function(e){let{slice:t,padding:n,measured:i,store:r}=e;const{start:o,end:s,outerRadius:a}=t,l=Gc((o+s)/2);let c=eu({radius:a,size:{width:i.width+2*n+Kc,height:i.height+2*n},angle:l});return c?(c.baseline="top",Jc(c,n),r.insideLabelBounds.some((e=>Zs(e,c)))?null:(r.insideLabelBounds.push({x:c.x-Xc,y:c.y,width:c.width+2*Xc,height:c.height}),c)):null}({slice:n,measured:a,padding:s,store:u});break;case"outside":t="rotate"===r?function(e){let{slice:t,measured:n,padding:i,view:r}=e,{start:o,end:s,outerRadius:a,offset:l}=t,c=a+i,u=s-o;if(u<Math.PI&&(n.height/2+i)/Math.tan(u/2)>c)return null;const h=Gc((o+s)/2);let d=Math.sin(h)*c,f=-Math.cos(h)*c,p=n.width+Kc,m=h%Math.PI;if(m>Math.PI/2&&(m=Math.PI-m),Math.cos(m)>.001){let e=f<0?r.y:r.y+r.height,t=Math.abs(e-l.y)/Math.cos(m)-Math.tan(m)*(n.height/2)-2*i-a;t<p&&(p=t)}if(Math.sin(m)>.001){let e=d<0?r.x:r.x+r.width,t=Math.abs(e-l.x)/Math.sin(m)-n.height/2/Math.tan(m)-2*i-a;t<p&&(p=t)}if(p<=0||p<n.minReqWidth)return null;let g={x:d,y:f,width:p,height:n.height};return h<Math.PI?(g.angle=h-Math.PI/2,g.anchor="start"):(g.angle=h+Math.PI/2,g.anchor="end"),g}({slice:i,measured:a,padding:s,view:l}):function(e){let{slice:t,measured:n,padding:i,view:r,context:o}=e,{start:s,end:a,outerRadius:l,offset:c}=t;const u=Gc((s+a)/2);if(function(e,t,n){switch(t){case 0:return e.q1maxY<0;case 1:return e.q2minY>n.height;case 2:return e.q3minY>n.height;case 3:return e.q4maxY<0;default:return!0}}(o,Math.floor(u/(Math.PI/2)),r))return null;let h=l+i+n.height/2,d=Math.sin(u)*h,f=-Math.cos(u)*h,p=n.width+Kc;if(u<Math.PI){let e=Math.abs(r.x+r.width-(d+c.x));e<p&&(p=e)}else{let e=Math.abs(r.x-(d+c.x));e<p&&(p=e)}if(p<n.minReqWidth)return null;let m={x:d,y:f,width:p,height:n.height};return u<Math.PI?m.anchor="start":m.anchor="end",m}({slice:i,measured:a,padding:s,view:l,context:c});break;default:throw new Error("not implemented")}return t&&(t.x+=p.x,t.y+=p.y,"outside"===o&&"rotate"!==r&&function(e,t,n){const{start:i,end:r,offset:o,outerRadius:s}=n,a=Gc((i+r)/2);switch(Math.floor(a/(Math.PI/2))){case 0:if(void 0!==t.q1maxY){let n=Math.min(e.y,t.q1maxY-e.height),i=e.y-n;if(e.y=n,i>1){let t=s+2;e.line={type:"line",x1:e.x-2,y1:e.y+2,x2:o.x+Math.sin(a)*t,y2:o.y-Math.cos(a)*t,strokeWidth:1}}}break;case 1:if(void 0!==t.q2minY){let n=Math.max(e.y,t.q2minY),i=n-e.y;if(e.y=n,i>1){let t=s+2;e.line={type:"line",x1:e.x-2,y1:e.y-2,x2:o.x+Math.sin(a)*t,y2:o.y-Math.cos(a)*t,strokeWidth:1}}}break;case 2:if(void 0!==t.q3minY){let n=Math.max(e.y,t.q3minY),i=n-e.y;if(e.y=n,i>1){let t=s+2;e.line={type:"line",x1:e.x+2,y1:e.y-2,x2:o.x+Math.sin(a)*t,y2:o.y-Math.cos(a)*t,strokeWidth:1}}}break;case 3:if(void 0!==t.q4maxY){let n=Math.min(e.y,t.q4maxY-e.height),i=e.y-n;if(e.y=n,i>1){let t=s+2;e.line={type:"line",x1:e.x+2,y1:e.y+2,x2:o.x+Math.sin(a)*t,y2:o.y-Math.cos(a)*t,strokeWidth:1}}}}}(t,c,i)),t}function su(e){let{context:t,direction:n,measured:i,node:r,placementSettings:o,rect:s,store:a}=e,l=arguments.length>1&&void 0!==arguments[1]?arguments[1]:ou;for(let e=0;e<o.length;e++){let c=o[e],u=l({context:t,slice:r.desc.slice,view:s,direction:n,position:c.position,measured:i,padding:c.padding,store:a});if(u)return{bounds:u,placement:c}}return{bounds:null,placement:null}}function au(e,t,n){const i=t.fontFamily,r="".concat(t.fontSize,"px"),o=n.measureText({text:e,fontFamily:i,fontSize:r});return o.minReqWidth=Math.min(o.width,n.measureText({text:"".concat(e[0],"…"),fontFamily:i,fontSize:r}).width),o}const lu=/\n+|\r+|\r\n/,cu=/\s/,uu=/[a-zA-Z\u00C0-\u00F6\u00F8-\u00FF\u00AD]/,hu=0,du=1,fu=2;function pu(e){return"string"==typeof e?-1!==e.search(lu):-1!==String(e).search(lu)}function mu(e){return-1!==e.search(cu)}function gu(e){return-1!==e.search(uu)}function yu(e,t,n){return Math.max(t,Math.min(n,e))}function vu(){let{string:e,separator:t="",reverse:n=!1,measureText:i=(e=>({width:e.length,height:1})),mandatoryBreakIdentifiers:r=[pu],noBreakAllowedIdentifiers:o=[],suppressIdentifier:s=[mu,pu,e=>""===e],hyphenationIdentifiers:a=[gu]}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const l=String(e).split(t);!function(e){""===e[0]&&e.shift(),""===e[e.length-1]&&e.pop()}(l);const c=l.length,u=n?e=>e>=0:e=>e<c;let h=n?c:-1;function d(e){const t=yu(e,0,c-1),n=l[t],u=i(n),h=function(e,t,n,i,r){return i.some((i=>i(e,t,n)))?du:r.some((i=>i(e,t,n)))?hu:fu}(n,t,l,r,o);return{index:t,value:n,breakOpportunity:h,suppress:s.some((e=>e(n,t,l))),hyphenation:a.some((e=>e(n,t,l))),width:u.width,height:u.height,done:!1}}return{next:function(e){return isNaN(e)?n?h--:h++:h=yu(e,0,c-1),u(h)?d(h):{done:!0}},peek:d,length:c}}const bu="‐",xu="…",wu=24,qu=4,Su=1e-12,Mu=16,Du=1.2,_u=/^\s*\d+(\.\d+)?px\s*$/i;function Cu(e){return"string"===typeof e&&_u.test(e)}function ku(e){const t=e["font-size"]||e.fontSize;return Cu(t)?parseFloat(t)*Math.max(isNaN(e.lineHeight)?Du:e.lineHeight,0):Mu*Du}function Eu(e){const t=e.maxHeight,n=Math.max(e.maxLines,1)||1/0;if(isNaN(t))return n;const i=ku(e);return Math.max(1,Math.min(Math.floor(t/i),n))}function Au(e,t){return{lines:[],line:"",width:0,maxLines:Eu(e),maxWidth:e.maxWidth,hyphens:{enabled:"auto"===e.hyphens,char:bu,metrics:t(bu)}}}function Tu(e){e.lines.push(e.line),e.line="",e.width=0}function Iu(e,t){e.line+=t.value,e.width+=t.width}function Ru(e,t,n){if(t.width>e.maxWidth)return t;const i=t.index;for(let r=1;r<5;r++){const o=n.peek(t.index-1);if(!t.hyphenation||!o.hyphenation||0===t.index)return t;if(e.width+e.hyphens.metrics.width<=e.maxWidth)return e.line+=e.hyphens.char,t;if(1===e.line.length)return t;t=n.next(i-r),e.line=e.line.slice(0,-1),e.width-=t.width}return t}function Ou(e,t,n){const i=vu({string:t.value,measureText:n});for(;e.lines.length<e.maxLines;){let t=i.next();if(t.done)break;e.width+t.width>e.maxWidth&&t.breakOpportunity===fu&&e.line.length>0?(t=e.hyphens.enabled?Ru(e,t,i):t,Tu(e),Iu(e,t)):Iu(e,t)}}function Nu(e,t){const n=vu({string:e.text,separator:"",measureText:t,noBreakAllowedIdentifiers:[(e,t)=>0===t]}),i=Au(e,t);let r=!0;for(;i.lines.length<i.maxLines;){let e=n.next();if(e.done){Tu(i),r=!1;break}e.breakOpportunity===du?Tu(i):i.width+e.width>i.maxWidth&&e.breakOpportunity===fu?e.suppress?i.width+=e.width:(e=i.hyphens.enabled?Ru(i,e,n):e,Tu(i),Iu(i,e)):Iu(i,e)}return{lines:i.lines,reduced:r}}function Pu(e,t){const n=vu({string:e.text,separator:/(\s|-|\u2010)/,measureText:t}),i=Au(e,t);let r=!0;for(;i.lines.length<i.maxLines;){let e=n.next();if(e.done){Tu(i),r=!1;break}e.breakOpportunity===du?Tu(i):i.width+e.width>i.maxWidth&&e.breakOpportunity===fu?e.suppress?Tu(i):e.width>i.maxWidth?Ou(i,e,t):(Tu(i),Iu(i,e)):Iu(i,e)}return{lines:i.lines,reduced:r}}function Lu(e){return{"break-all":Nu,"break-word":Pu}[e.wordBreak]}function Fu(e){return t=>{const n=t.node;if(function(e){return"text"===e.type&&!e._lineBreak}(n)){const i=Lu(n);if(!i)return;const r=e(n);if(r.width>n.maxWidth||pu(n.text)){const o=(ku(n)-r.height)/2,s=i(n,function(e,t){return n=>t({text:n,fontSize:e.fontSize,fontFamily:e.fontFamily})}(n,e));t.node=function(e,t,n,i){const r={type:"container",children:[]};void 0!==t.id&&(r.id=t.id);let o=0;return e.lines.forEach(((s,a)=>{const l=E({},t);l.text=s,l._lineBreak=!0,o+=n,e.reduced&&a===e.lines.length-1?l.text+=xu:delete l.maxWidth,l.dy=isNaN(l.dy)?o:l.dy+o,o+=i,o+=n,r.children.push(l)})),r}(s,n,o,r.height)}}}}function zu(e,t){let{text:n,"font-size":i,"font-family":r,maxWidth:o}=e;if(n="string"==typeof n?n:"".concat(n),void 0===o)return n;let s=t({text:n,fontSize:i,fontFamily:r}).width;if(s<=o)return n;let a=0,l=n.length-1;for(;a<=l;){let e=Math.floor((a+l)/2);s=t({text:n.substr(0,e)+xu,fontSize:i,fontFamily:r}).width,s<=o?a=e+1:l=e-1}return n.substr(0,l)+xu}function ju(e){const t=e.baseline||e["dominant-baseline"];let n=0;const i=parseInt(e.fontSize||e["font-size"],10)||0;switch(t){case"hanging":n=.75*i;break;case"text-before-edge":n=.85*i;break;case"middle":n=.25*i;break;case"central":n=.35*i;break;case"mathemetical":n=i/2;break;case"text-after-edge":case"ideographic":n=.2*-i;break;default:n=0}return n}const Hu={},Bu={},Vu={fontSize:void 0,fontFamily:void 0};let $u;function Wu(e,t,n){const i=e+t+n;return"number"!=typeof Bu[i]&&($u=$u||document.createElement("canvas").getContext("2d"),function(e,t){Vu.fontSize===e&&Vu.fontFamily===t||($u.font=e+" "+t,Vu.fontSize=e,Vu.fontFamily=t)}(t,n),Bu[i]=$u.measureText(e).width),Bu[i]}function Uu(e){return"number"!=typeof Hu[e]&&(Hu[e]=function(e){if(Cu(e)){const t=parseFloat(e);return t+qu*Math.ceil((t+Su)/wu)}return Mu}(e)),Hu[e]}function Yu(e){let{text:t,fontSize:n,fontFamily:i}=e;return{width:Wu(t,n,i),height:Uu(n)}}function Xu(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Yu;const n=e["font-size"]||e.fontSize,i=e["font-family"]||e.fontFamily,r=t({text:e.text,fontFamily:i,fontSize:n}),o=Math.min(e.maxWidth||r.width,r.width),s=e.x||0,a=e.y||0,l=e.dx||0,c={x:0,y:a+((e.dy||0)+ju(e))-.75*r.height,width:o,height:r.height},u=e["text-anchor"]||e.anchor;return c.x="middle"===u?s+l-o/2:"end"===u?s+l-o:s+l,c}function Ku(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Yu;const n=Lu(e),i=e["font-size"]||e.fontSize,r=e["font-family"]||e.fontFamily,o=t({text:e.text,fontFamily:r,fontSize:i});if(n&&(o.width>e.maxWidth||pu(e.text))){const o=n(e,(e=>t({text:e,fontFamily:r,fontSize:i}))),s=E({},e);let a=0,l="";for(let e=0,n=o.lines.length;e<n;e++){let s=o.lines[e];s+=e===n-1&&o.reduced?xu:"";const c=t({text:s,fontSize:i,fontFamily:r}).width;c>=a&&(a=c,l=s)}s.text=l;const c=Xu(s,t);return c.height=ku(e)*o.lines.length,c}return Xu(e,t)}const Gu=1.2;function Ju(e,t){return{node:e,data:e.data,scale:t.scale,formatter:t.formatter,dataset:t.dataset}}function Zu(e,t,n){const i={type:"text",text:t,maxWidth:e.width,x:0,y:e.y,dx:0,dy:0,fill:n.fill,anchor:"start",baseline:"alphabetical",fontSize:"".concat(n.fontSize,"px"),fontFamily:n.fontFamily},r=n.textMetrics;if(e.width<n.fontSize)return!1;const o=Math.max(0,e.width-r.width);return i.x=e.x+n.align*o,i.y=e.y+r.height/Gu,i}function Qu(e){let{cx:t,cy:n,r:i}=e;return{type:"circle",bounds:{cx:t,cy:n,r:i}}}function eh(e){return e.desc&&e.desc.slice?function(e){let{start:t,end:n,innerRadius:i,outerRadius:r,offset:o}=e;if(Math.abs(t+2*Math.PI-n)>1e-12)return{type:null,bounds:null};let s=0!==i?i:r;return Qu({cx:o.x,cy:o.y,r:s})}(e.desc.slice):"circle"===e.type?Qu(e.attrs):"rect"===e.type?{type:"rect",bounds:e.bounds}:{type:null,bounds:null}}var th={bar:function(e){let{settings:t,chart:n,nodes:i,rect:r,renderer:o,style:s}=e,a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Yc;const l=E({fontSize:12,fontFamily:"Arial",align:.5,justify:0,fill:"#333"},s.label);l.fontSize=parseInt(l.fontSize,10);const c=t.labels.map((e=>E({},l,t,e))),u=t.labels.map((e=>e.placements.map((n=>E({},l,t,e,n))))),{fitsHorizontally:h,hasHorizontalDirection:d,targetNodes:f}=function(e){let{nodes:t,rect:n,chart:i,labelSettings:r,placementSettings:o,settings:s,renderer:a}=e;const l={},c=[];let u,h,d,f,p,m,g,y=!0,v=!1;for(let e=0;e<t.length;e++){if(h=t[e],f=h.localBounds,!Zs(f,n))continue;let b=Pc(h,i);u={node:h,texts:[],measurements:[],labelSettings:[],placementSettings:[]};for(let t=0;t<r.length;t++)m=r[t],d="function"==typeof m.label?m.label(b,e):void 0,Lc(d)&&(g="function"==typeof s.direction?s.direction(b,e):s.direction||"up",v=v||"left"===g||"right"===g,l.fontFamily=m.fontFamily,l.fontSize="".concat(m.fontSize,"px"),l.text=d,p=a.measureText(l),u.measurements.push(p),u.texts.push(d),u.labelSettings.push(m),u.placementSettings.push(o[t]),u.direction=g,y=y&&p.width<=f.width-2*Nc);c.push(u)}return{targetNodes:c,fitsHorizontally:y,hasHorizontalDirection:v}}({nodes:i,chart:n,renderer:o,settings:t,rect:r,labelSettings:c,placementSettings:u}),p=function(e){let{orientation:t="auto",defaultOrientation:n="h"}=e;switch(t.toLocaleLowerCase()){case"vertical":return"v";case"horizontal":return"h";default:return n}}({orientation:t.orientation,defaultOrientation:d?"h":"v"}),m="h"===p?"y":"x",g="h"===p?"height":"width";return f.sort(((e,t)=>e.node.localBounds[m]+e.node.localBounds[g]-(t.node.localBounds[m]+t.node.localBounds[g]))),a({chart:n,targetNodes:f,stngs:t,rect:r,fitsHorizontally:h,collectiveOrientation:p})},slice:function(e){let{settings:t,chart:n,nodes:i,rect:r,renderer:o,style:s}=e,a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:su,l=arguments.length>2&&void 0!==arguments[2]?arguments[2]:ru;const c=E({fontSize:12,fontFamily:"Arial",fill:"#333",padding:4,position:"into"},s.label);c.fontSize=parseInt(c.fontSize,10);const u=t.labels.map((e=>E({},c,t,e))),h=t.labels.map((e=>e.placements.map((n=>E({},c,t,e,n))))),d=[],f={insideLabelBounds:[]};i=function(e){const t=[],n=[],i=[],r=[];for(let o=0;o<e.length;++o){const{start:s,end:a}=e[o].desc.slice,l=Gc((s+a)/2);switch(Math.floor(l/(Math.PI/2))){case 0:t.push(e[o]);break;case 1:n.push(e[o]);break;case 2:i.push(e[o]);break;case 3:r.push(e[o])}}const o=(e,t)=>Gc((e.desc.slice.start+e.desc.slice.end)/2)-Gc((t.desc.slice.start+t.desc.slice.end)/2),s=(e,t)=>o(t,e);return t.sort(s),n.sort(o),i.sort(s),r.sort(o),t.concat(n,r,i)}(i);const p={};for(let e=0,t=i.length;e<t;e++){const t=i[e],s=iu(t,n);for(let n=0;n<u.length;n++){const i=u[n],c="function"==typeof i.label?i.label(s,e):"";if(!c)continue;const m="function"==typeof i.direction?i.direction(s,e):i.direction||"horizontal",g="function"==typeof i.linkData?i.linkData(s,e):void 0,y=au(c,i,o),v=a({context:p,direction:m,lblStngs:i,measured:y,node:t,placementSettings:h[n],rect:r,store:f}),b=v.bounds,x=v.placement;if(b&&x){if("outside"===x.position&&"rotate"!==m){nu({context:p,node:t,bounds:b});if(!Fs(Zc(b),r))continue}const n="function"==typeof x.fill?x.fill(s,e):x.fill,o=l(b,c,{fill:n,fontSize:i.fontSize,fontFamily:i.fontFamily,textMetrics:y});o&&(void 0!==g&&(o.data=g),d.push(o),b.line&&(b.line.stroke=n,d.push(b.line)))}}}return d},rows:function(e){let{settings:t,chart:n,nodes:i,renderer:r,style:o}=e,s=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Zu;const a=E({fontSize:12,fontFamily:"Arial",fill:"#333",padding:4,align:.5,justify:.5},o.label);a.fontSize=parseInt(a.fontSize,10);const l=E({},a,t),c=t.labels.map((e=>E({},l,e))),u={},h=[];for(let e=0,t=i.length;e<t;e++){let t=i[e],o=Ju(t,n),{type:a,bounds:d}=eh(t);if(!d)continue;let f,p=0,m=[],g=[],y="circle"===a?2*d.r*.9:d.height;for(p+=l.padding,f=0;f<c.length;f++){let t=c[f],n="function"==typeof t.label?t.label(o,e):"";u.fontFamily=t.fontFamily,u.fontSize="".concat(t.fontSize,"px"),u.text=n;let i=r.measureText(u);if(p+=i.height+t.padding,p>y)break;g.push(n),m.push(i)}const v=f,b=Math.max(0,y-p);let x;for(x="circle"===a?d.cy-.9*d.r:d.y,x+=l.justify*b+l.padding,f=0;f<v;f++){let t,n=c[f];if("circle"===a){let e=Math.max(Math.abs(x-d.cy),Math.abs(x+m[f].height-d.cy)),n=Math.sqrt(d.r*d.r-e*e);t={x:d.cx-n+l.padding,y:x,width:2*n-2*l.padding,height:m[f].height}}else t={x:d.x+l.padding,y:x,width:d.width-2*l.padding,height:m[f].height};x+=m[f].height+l.padding;let i="function"==typeof n.fill?n.fill(o,e):n.fill;const u="function"==typeof n.linkData?n.linkData(o,e):void 0;let p=s(t,g[f],{fill:i,align:n.align,fontSize:n.fontSize,fontFamily:n.fontFamily,textMetrics:m[f]});if(p){if(p.text&&p.text!==xu){const e=zu(p,r.measureText);if(xu===e)continue;p.ellipsed=e}void 0!==u&&(p.data=u),h.push(p)}}}return h}};const nh={require:["chart","renderer","settings"],defaultSettings:{settings:{},style:{label:"$label"}},render(){const e=this.settings.settings,t=[];return(e.sources||[]).forEach((e=>{e.strategy&&th[e.strategy.type]&&e.component&&t.push(...function(e,t){let{chart:n,source:i,rect:r,renderer:o,style:s}=e;if(!n.component(i.component))return[];const a=n.findShapes(i.selector).filter((e=>e.key===i.component));return t({chart:n,settings:i.strategy.settings,nodes:a,rect:{x:0,y:0,width:r.width,height:r.height},renderer:o,style:s})}({chart:this.chart,rect:this.rect,renderer:this.renderer,source:e,style:this.style},th[e.strategy.type]))})),t}};const ih={layout:{size:1,direction:"ltr",scrollOffset:0},item:{show:!0,justify:.5,align:.5,label:{fontSize:"12px",fontFamily:"Arial",fill:"#595959",wordBreak:"none",maxLines:2,maxWidth:136,lineHeight:1.2},shape:{type:"square",size:12}},title:{show:!0,text:void 0,anchor:"start",fontSize:"16px",fontFamily:"Arial",fill:"#595959",wordBreak:"none",maxLines:2,maxWidth:156,lineHeight:1.25},navigation:{button:{class:void 0,content:void 0,tabIndex:void 0},disabled:!1}};function rh(e){let{x:t=0,y:n,item:i,globalMetrics:r,createSymbol:o,direction:s="ltr"}=e,a=i.label.displayObject,l=i.label.bounds,c=i.symbol.meta;const u="rtl"===s;let h={x:u?t+r.maxLabelBounds.width:t+r.maxSymbolSize+r.spacing,y:n,width:r.maxLabelBounds.width,height:Math.max(r.maxSymbolSize,r.maxLabelBounds.height)},d=function(e,t,n){const i=Math.max(0,e.width-t),r=Math.max(0,e.height-t);return{x:e.x+t/2+n.align*i,y:e.y+t/2+n.justify*r}}({x:u?t+r.maxLabelBounds.width+r.spacing:t,y:n,width:r.maxSymbolSize,height:h.height},c.size,{align:void 0===c.align?.5:c.align,justify:void 0===c.justify?.5:c.justify});const f=o(E({},c,d));return delete f.collider,a.anchor=u?"end":"start",function(e,t,n){const i=n.textMetrics;if(e.height<i.height)return!1;const r=Math.max(0,e.width-i.width);t.baseline="text-before-edge";const o=Math.max(0,e.height-i.height);t.x=e.x+n.align*r,t.y=e.y+n.justify*o+.175*parseInt(t.fontSize,10)}(h,a,{textMetrics:l,fontSize:parseInt(a.fontSize,10),align:0,justify:.5}),{item:{type:"container",data:i.label.displayObject.data,children:[f,a],collider:{type:"rect",x:t,y:n,width:r.maxItemBounds.width,height:r.maxItemBounds.height}},metrics:h}}function oh(e,t){const n=e.items.length,i=Math.ceil(n/t),r="horizontal"===e.layout.orientation?"width":"height",o="width"===r?"horizontal":"vertical";return e.globalMetrics.maxItemBounds[r]*i+(i-1)*e.layout.margin[o]}function sh(e,t){let n,i,r,o,{onScroll:s=(()=>{})}=t,a=null,l=0;const c={itemize:t=>{n=function(e,t){let n,i,{resolved:r,dock:o}=e,s=[],a=r.items.items,l=r.symbols.items,c=r.labels.items,u=0,h=0,d=0;for(let e=0;e<a.length;e++){if(!1===a[e].show)continue;const r=void 0!==c[e].text?c[e].text:c[e].data.label||"";n=E({},c[e],{type:"text",fontSize:"".concat(parseInt(c[e].fontSize,10),"px"),text:r,title:r}),i={symbol:{meta:l[e]},label:{displayObject:n,bounds:t.textBounds(n)}},s.push(i),u=Math.max(l[e].size,u),h=Math.max(i.label.bounds.width,h),d=Math.max(i.label.bounds.height,d)}return{items:s,globalMetrics:{spacing:8,maxSymbolSize:u,maxItemBounds:{height:Math.max(u,d),width:u+8+h},maxLabelBounds:{width:h,height:d}},layout:{margin:{vertical:void 0!==r.layout.item.vertical?r.layout.item.vertical:4,horizontal:void 0!==r.layout.item.horizontal?r.layout.item.horizontal:4},mode:r.layout.item.mode,size:r.layout.item.size,orientation:"top"===o||"bottom"===o?"horizontal":"vertical",direction:r.layout.item.direction,scrollOffset:r.layout.item.scrollOffset}}}(t,e.renderer),a=isNaN(n.layout.scrollOffset)?a:n.layout.scrollOffset},getItemsToRender:t=>{r=t.viewRect,l=c.getContentOverflow(r);const s=c.extent();a=Math.max(0,Math.min(a,l)),o=E({},r);const u="horizontal"===c.orientation()?"x":"y";return o[u]-=a,o["x"===u?"width":"height"]=s,function(e,t,n){let{viewRect:i}=e,{itemized:r,create:o=rh,parallels:s,createSymbol:a}=n;const l=r.layout.direction,c=r.globalMetrics,u=r.items,h="horizontal"===r.layout.orientation;let d=0;const f=[],p=c.maxItemBounds.height,m=c.maxItemBounds.width,g=r.layout.margin.vertical+p,y=r.layout.margin.horizontal+m;let v=t.x,b=t.y,x=i.x-t.x;for(let e=0;e<u.length;e++){let n=o({y:b,x:"rtl"===l?i.x+x+i.width-m-(v-t.x):v,item:u[e],globalMetrics:c,direction:l,createSymbol:a});if((h&&v>=i.x-m||!h&&b>=i.y-p)&&f.push(n.item),d++,d>=s?(d=0,h?(v+=y,b=t.y):(b+=g,v=t.x)):h?b+=g:v+=y,!h&&b>i.y+i.height)break;if(h&&v>i.x+i.width)break}return f}(t,o,{itemized:n,parallels:i,createSymbol:e.symbol})},parallelize:(e,t)=>(i=function(e,t,n){const i=n.items.length,r="horizontal"===n.layout.orientation?"width":"height",o="width"===r?"horizontal":"vertical",s=n.globalMetrics.maxItemBounds[r]*i+(i-1)*n.layout.margin[o];let a=Math.ceil(s/e);if(null!=t){const e="horizontal"===n.layout.orientation?"height":"width",i="width"===e?"horizontal":"vertical",r=n.layout.margin[i]||4,o=Math.floor((t+r)/(r+n.globalMetrics.maxItemBounds[e]));a=Math.min(a,o)}const l=isNaN(n.layout.size)?1:n.layout.size;return Math.max(1,Math.min(a,l))}(e,t,n),i),hasContentOverflow:()=>{const e="horizontal"===n.layout.orientation?"width":"height";return oh(n,i)>r[e]},getContentOverflow:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:r;const t="horizontal"===n.layout.orientation?"width":"height";return Math.max(0,oh(n,i)-e[t])},getNextSize:()=>{const e="horizontal"===n.layout.orientation?"width":"height",t="width"===e?"horizontal":"vertical";return n.globalMetrics.maxItemBounds[e]+n.layout.margin[t]},getPrevSize:()=>{const e="horizontal"===n.layout.orientation?"width":"height",t="width"===e?"horizontal":"vertical";return n.globalMetrics.maxItemBounds[e]+n.layout.margin[t]},hasNext:()=>"horizontal"===c.orientation()?r.x+r.width<o.x+o.width:r.y+r.height<o.y+o.height,hasPrev:()=>"horizontal"===c.orientation()?o.x<r.x:o.y<r.y,next:()=>{c.scroll(-c.getNextSize())},prev:()=>{c.scroll(c.getPrevSize())},scroll:e=>{const t=Math.max(0,Math.min(l,a-e));t!==a&&(a=t,s())},offset:()=>a,orientation:()=>n.layout.orientation,direction:()=>n.layout.direction,extent:()=>oh(n,i),spread:()=>function(e,t){const n=t,i="horizontal"===e.layout.orientation?"height":"width",r="width"===i?"horizontal":"vertical";return e.globalMetrics.maxItemBounds[i]*n+(n-1)*e.layout.margin[r]}(n,i)};return c}function ah(e){return Object.keys(e).filter((t=>e[t])).join(" ")}const lh={up:"▲",right:"▶",down:"▼",left:"◀"};function ch(e,t){let{size:n,isActive:i,direction:r,nav:o,attrs:s}=t,a={},l="";const c=s;o&&o.button&&("function"==typeof o.button.class?a=o.button.class({direction:r}):o.button.class&&(a=o.button.class),"function"==typeof o.button.content&&(l=o.button.content(e,{direction:r})),void 0!==o.button.tabIndex&&(c.tabindex=o.button.tabIndex));const u={width:"".concat(n,"px"),minWidth:"".concat(n,"px"),height:"".concat(n,"px")};return Object.keys(a).length||(u.border="0",u.background="none"),(!i||o&&o.disabled)&&(c.disabled="disabled"),e("button",E({class:ah(a),style:u},c),[l||e("span",{style:{pointerEvents:"none"}},[lh[r]])])}function uh(e){let t;const n={itemize:e=>{t=function(e){let{dock:t,navigation:n}=e;return{layout:{orientation:"top"===t||"bottom"===t?"vertical":"horizontal"},navigation:n}}(e)},render:i=>function(e,t,n,i){let{rect:r,itemRenderer:o}=t;if(!e||!e.renderArgs)return;e.size(r);const s=e.renderArgs[0],a="vertical"===n.layout.orientation,l="rtl"===o.direction(),c=o.hasNext(),u=o.hasPrev();if(!u&&!c)return void e.render([]);const h=a?["right","left"]:["down","up"];l&&a&&h.reverse();const d=[s("div",{style:{position:"relative",display:"flex","flex-direction":a?"column":"row","justify-content":"center",height:"100%",pointerEvents:"auto"},dir:l&&!a?"rtl":"ltr"},[ch(s,{size:32,isActive:c,direction:h[0],attrs:{"data-action":"next","data-component-key":i.settings.key},nav:n.navigation}),ch(s,{size:32,isActive:u,direction:h[1],attrs:{"data-action":"prev","data-component-key":i.settings.key},nav:n.navigation})])];e.render(d)}(n.renderer,i,t,e),extent:()=>32,spread:()=>64};return n}function hh(e){let t;const n={itemize:n=>{t=function(e,t){let{resolved:n}=e;if(!1===n.title.item.show)return null;const i=E({},n.title.item,{type:"text"});if("rtl"===n.layout.item.direction&&(i.anchor&&"start"!==i.anchor?"end"===i.anchor&&(i.anchor="start"):i.anchor="end"),void 0===n.title.settings.text){const e=t.scale.data().fields;i.text=e&&e[0]?e[0].title():""}return{displayObject:i,bounds:t.renderer.textBounds(i)}}(n,e)},render:e=>{!function(e,t,n){let{rect:i}=e;if(!t)return;const r=[];if(t.size(i),n){const e={start:0,end:i.width,middle:i.width/2};r.push(E({},n.displayObject,{x:e[n.displayObject.anchor]||0,y:0,baseline:"text-before-edge",title:n.displayObject.text}))}t.render(r)}(e,n.renderer,t)},spread:()=>t?t.bounds.height:0,extent:()=>t?t.bounds.width:0};return n}function dh(e,t,n,i){let r,o,s,{itemRenderer:a,navigationRenderer:l,titleRenderer:c,isPreliminary:u=!1}=i,h=0;const d={x:t.spacing,y:t.spacing,width:e.width-2*t.spacing,height:e.height-2*t.spacing};if(r={x:d.x,y:d.y,width:d.width,height:c.spread()},"horizontal"===n){r={x:d.x,y:d.y,width:c.extent(),height:c.spread()};const e=d.width-r.width-(r.width?t.spacing:0),n=d.height;a.parallelize(e,u?void 0:n);const i=a.extent()>e?l.extent():0,f=a.spread(),p=i?l.spread():0;o={x:r.x+r.width+(r.width?t.spacing:0),y:d.y+Math.max(0,(p-f)/2),width:d.width-i-r.width-(i?t.spacing:0)-(r.width?t.spacing:0),height:n},s={x:o.x+o.width+(i?t.spacing:0),y:d.y,width:i,height:d.height},r.y=o.y;"rtl"===a.direction()&&(s.x=d.x,o.x=s.x+s.width+(s.width?t.spacing:0),r.x=o.x+o.width+(r.width?t.spacing:0)),h=Math.max(r.height,p,a.spread())}else{const e=d.height-r.height-(r.height?t.spacing:0),n=d.width;a.parallelize(e,u?void 0:n);const i=a.extent()>e?l.extent():0;s={x:d.x,y:d.y+d.height-i,width:d.width,height:i},o={x:d.x,y:r.y+r.height+(r.height?t.spacing:0),width:d.width,height:d.height-r.height-(r.height?t.spacing:0)-s.height-(s.height?t.spacing:0)},h=Math.max(c.extent(),i?l.spread():0,a.spread())}return o=E({},e,{x:e.x+o.x,y:e.y+o.y,width:o.width,height:o.height}),s.x+=e.x,s.y+=e.y,r.x+=e.x,r.y+=e.y,{title:E({},e,r),content:E({},e,o),navigation:E({},e,s),orientation:n,preferredSize:h}}function fh(e){e.state.resolved=function(e){const t=e.scale.domain();let n={items:[]};const i=e.settings.layout.dock;if("threshold-color"===e.scale.type){const r=e.scale.data().fields[0];let o=e=>String(e);e.settings.formatter?o=e.chart.formatter(e.settings.formatter):r&&(o=r.formatter());for(let e=0;e<t.length-1;e++){const i={value:t[e],label:"".concat(o(t[e])," - < ").concat(o(t[e+1]))};r&&(i.source={field:r.id()}),n.items.push(i)}"vertical"==("top"===i||"bottom"===i?"horizontal":"vertical")&&n.items.reverse()}else{const i=e.scale.labels?e.scale.labels():null;n.items=t.map(((t,n)=>{const r=e.scale.datum?E({},e.scale.datum(t)):{value:t};return r.value=t,e.scale.label?r.label=e.scale.label(t):i&&(r.label=i[n]),r}))}const r=e.resolver.resolve({data:{fields:e.scale.data().fields},defaults:E(!0,{},ih.title,e.style.title),settings:e.settings.settings.title}),o=e.resolver.resolve({data:{fields:e.scale.data().fields},defaults:ih.layout,settings:e.settings.settings.layout}),s=e.resolver.resolve({data:n,defaults:E(!0,{},ih.item.label,e.style.item.label),settings:(e.settings.settings.item||{}).label}),a=E(!0,{},(e.settings.settings.item||{}).shape);void 0===a.fill&&e.settings.scale&&(a.fill={scale:e.settings.scale});const l=e.resolver.resolve({data:n,defaults:E(!0,{},ih.item.shape,e.style.item.shape),settings:a}),c=e.resolver.resolve({data:n,defaults:E(!0,{},{show:ih.item.show}),settings:{show:(e.settings.settings.item||{}).show}});function u(e,n){let i=e.data.value,r=t[n+1];e.data.value=[i,r]}"threshold-color"===e.scale.type&&("vertical"==("top"===i||"bottom"===i?"horizontal":"vertical")?(c.items.reverse().forEach(u),c.items.reverse()):c.items.forEach(u));return{title:r,labels:s,symbols:l,items:c,layout:o}}(e),e.titleRenderer.itemize({resolved:e.state.resolved,dock:e.settings.layout.dock||"center"}),e.itemRenderer.itemize({resolved:e.state.resolved,dock:e.settings.layout.dock||"center"}),e.navigationRenderer.itemize({resolved:e.state.resolved,dock:e.settings.layout.dock||"center",navigation:e.settings.settings.navigation}),e.state.display={spacing:8}}function ph(e){const{rect:t,settings:n,state:i,itemRenderer:r,navigationRenderer:o,titleRenderer:s}=e,a=n.layout.dock,l="top"===a||"bottom"===a?"horizontal":"vertical",c=dh(t,i.display,l,{itemRenderer:r,navigationRenderer:o,titleRenderer:s});e.renderer.size(c.content);let u=r.getItemsToRender({viewRect:E({},c.content,{x:0,y:0})});return o.render({rect:c.navigation,itemRenderer:r}),s.render({rect:c.title}),e.state.views={layout:c},u}const mh={require:["chart","settings","renderer","update","resolver","registries","symbol"],defaultSettings:{settings:{},style:{item:{label:"$label",shape:"$shape"},title:"$title"}},mounted(e){e&&e.parentNode&&(this.navigationRenderer.renderer.appendTo(e.parentNode),this.titleRenderer.renderer.appendTo(e.parentNode),e.parentNode.insertBefore(this.navigationRenderer.renderer.element(),e),e.parentNode.insertBefore(this.titleRenderer.renderer.element(),e)),this.navigationRenderer.render({rect:this.state.views.layout.navigation,itemRenderer:this.itemRenderer}),this.titleRenderer.render({rect:this.state.views.layout.title})},beforeUnmount(){this.navigationRenderer.renderer.clear(),this.titleRenderer.renderer.clear()},on:{panstart(){if(this.state.interaction.started)return;this.itemRenderer.getContentOverflow()&&(this.state.interaction.started=!0,this.state.interaction.delta=0)},panmove(e){if(!this.state.interaction.started)return;const t="horizontal"===this.itemRenderer.orientation()?("rtl"===this.itemRenderer.direction()?-1:1)*e.deltaX:e.deltaY;this.itemRenderer.scroll(t-this.state.interaction.delta),this.state.interaction.delta=t},panend(){this.state.interaction.started=!1},scroll(e){this.itemRenderer.scroll(-e)},next(){this.itemRenderer.next()},prev(){this.itemRenderer.prev()}},created(){this.state={interaction:{}},this.onScroll=()=>{const e=ph(this);this.update(e)},this.itemRenderer=sh(this,{onScroll:this.onScroll}),this.navigationRenderer=uh(this),this.titleRenderer=hh(this),this.navigationRenderer.renderer=this.registries.renderer("dom")(),this.titleRenderer.renderer=this.registries.renderer(this.settings.renderer)(),fh(this)},preferredSize(e){return function(e,t){let n=0;const i=e.settings.layout.dock||"center",r="top"===i||"bottom"===i?"horizontal":"vertical",o=e.state.display,s=dh(t.inner,o,r,{itemRenderer:e.itemRenderer,navigationRenderer:e.navigationRenderer,titleRenderer:e.titleRenderer,isPreliminary:!0});return n+=o.spacing,n+=s.preferredSize,n+=o.spacing,n}(this,e)},beforeUpdate(){fh(this)},render(){return ph(this)},beforeDestroy(){this.navigationRenderer.renderer.destroy(),this.titleRenderer.renderer.destroy()},additionalElements(){return[this.titleRenderer.renderer.element(),this.navigationRenderer.renderer.element()]},_DO_NOT_USE_getInfo(){return{offset:this.itemRenderer.offset()}}};function gh(e,t){let n=0;const i=e.state.isVertical?"justify":"align",r=e.state.isVertical?"y":"x",o=e.state.isVertical?"height":"width",s=e.state.isVertical?"requiredHeight":"requiredWidth";n=e.state.rect[o]-e.state.legend.length()-e.state.title[s](),n*=Math.min(1,Math.max(e.stgns[i],0)),t[r]+=n}function yh(e,t,n){const i=n[e];return"object"==typeof i?-1!==i.valid.indexOf(t)?t:i.default:n.default}function vh(e){return yh(e.layout.dock,e.settings.title.anchor,{left:{valid:["top"],default:"top"},right:{valid:["top"],default:"top"},top:{valid:["left","right"],default:"left"},bottom:{valid:["left","right"],default:"left"},default:"top"})}function bh(e,t){const n={x:0,y:0,width:0,height:0},i=e.stgns.padding;return n.x=i.left,n.y=i.top,n.width=t.width-i.left-i.right,n.height=t.height-i.top-i.bottom,n}function xh(e){const t="top"!==e.settings.layout.dock&&"bottom"!==e.settings.layout.dock,n=e.stgns.title,i=e.chart.scale(e.stgns.fill),r=e.chart.scale(e.stgns.major),o=function(e,t){const n=t.domain();let i=n,r=e.stgns.tick.label;!r&&e.formatter?r=e.formatter:!r&&t.data().fields&&(r=t.data().fields[0].formatter()),"function"==typeof r&&(i=n.map(r).map(String));const o=n.map(((n,r)=>{const o=i[r];return{value:n,label:o,pos:t.norm(parseFloat(n,10)),textMetrics:e.renderer.measureText({text:o,fontSize:e.stgns.tick.fontSize,fontFamily:e.stgns.tick.fontFamily})}}));return o}(e,r),s=function(e){return yh(e.layout.dock,e.settings.tick.anchor,{left:{valid:["left","right"],default:"left"},right:{valid:["left","right"],default:"right"},top:{valid:["top","bottom"],default:"top"},bottom:{valid:["top","bottom"],default:"bottom"},default:"right"})}(e.settings);if(void 0===n.text){const e=r.data().fields;n.text=e&&e[0]?e[0].title():""}const a=e.renderer.measureText({text:n.text,fontSize:n.fontSize,fontFamily:n.fontFamily}),l=e.renderer.textBounds({text:n.text,fontSize:n.fontSize,fontFamily:n.fontFamily,maxLines:n.maxLines,maxWidth:n.maxLengthPx,wordBreak:n.wordBreak,hyphens:n.hyphens,lineHeight:n.lineHeight}),c={isVertical:t,nodes:[],title:{anchor:vh(e.settings),textMetrics:a,textBounds:l,requiredWidth:()=>{if(!n.show)return 0;let e=l.width,i=n.maxLengthPx;return t||(e+=n.padding,i+=n.padding),Math.min(e,i,c.rect.width)},requiredHeight:()=>{if(!n.show)return 0;let e=l.height;return t&&(e+=n.padding),Math.min(e,c.rect.height)}},ticks:{values:o,anchor:s,length:Math.min(Math.max(...o.map((e=>e.textMetrics.width))),e.stgns.tick.maxLengthPx),requiredHeight:()=>"top"===s?Math.max(...c.ticks.values.map((e=>e.textMetrics.height)))+e.stgns.tick.padding:0,height:Math.max(...o.map((e=>e.textMetrics.height)))},legend:{fillScale:i,majorScale:r,length:()=>{const n=t?"height":"width",i=t?"requiredHeight":"requiredWidth",r=Math.min(c.rect[n],c.rect[n]*e.stgns.length)-c.title[i]();return Math.max(0,Math.min(r,e.stgns.maxLengthPx))}}};return c}const wh={require:["chart","settings","renderer"],defaultSettings:{layout:{displayOrder:0,dock:"right"},settings:{size:15,length:.5,maxLengthPx:250,align:.5,justify:0,padding:{left:5,right:5,top:5,bottom:5},tick:{label:null,fill:"#595959",fontSize:"12px",fontFamily:"Arial",maxLengthPx:100,anchor:null,padding:5},title:{show:!0,text:void 0,fill:"#595959",fontSize:"12px",fontFamily:"Arial",maxLengthPx:100,padding:5,maxLines:2,wordBreak:"none",lineHeight:1.2,hyphens:"auto",anchor:null}}},preferredSize(e){const t=this.state;t.rect=bh(this,e.inner);let n=this.stgns.size;const i=t.isVertical?this.stgns.padding.left+this.stgns.padding.right:this.stgns.padding.top+this.stgns.padding.bottom;n+=i;const r=Math.max(e.inner.width,e.inner.height);if("left"===t.ticks.anchor||"right"===t.ticks.anchor){const e=t.ticks.values.reduce(((e,t)=>e+t.textMetrics.height),0);if(e>this.state.legend.length())return r;n+=t.ticks.length}else{if(t.ticks.length>this.state.legend.length())return r;n+=Math.max(...t.ticks.values.map((e=>e.textMetrics.height)))}return n+=this.stgns.tick.padding,this.stgns.title.show&&(n="left"===t.title.anchor||"right"===t.title.anchor?Math.max(t.title.textBounds.height+i,n):Math.max(n,t.title.requiredWidth()+i)),this.state.preferredSize=n,n},created(){this.stgns=this.settings.settings,this.state=xh(this)},beforeUpdate(e){this.stgns=e.settings.settings,this.state=xh(this)},beforeRender(e){if(this.state.nodes=[],this.state.rect=bh(this,e.size),this.stgns.title.show){const e=function(e){const t=e.state,n=e.stgns,i="left"===t.ticks.anchor,r="top"===t.ticks.anchor;let o=t.rect.x,s=t.rect.y,a="start";"left"===t.title.anchor?(o+=t.title.requiredWidth()-n.title.padding,s+=t.title.textMetrics.height,s+=r?t.rect.height-t.title.textBounds.height:0,a="end"):"right"===t.title.anchor?(o+=t.legend.length(),o+=n.title.padding,s+=t.title.textMetrics.height,s+=r?t.rect.height-t.title.textBounds.height:0):"top"===t.title.anchor&&(o+=i?t.rect.width:0,s+=t.title.textMetrics.height,a=i?"end":"start");const l={tag:"legend-title",type:"text",x:o,y:Math.min(s,t.rect.y+t.rect.height),text:n.title.text,fill:n.title.fill,fontSize:n.title.fontSize,fontFamily:n.title.fontFamily,maxWidth:n.title.maxLengthPx,maxLines:n.title.maxLines,wordBreak:n.title.wordBreak,hyphens:n.title.hyphens,lineHeight:n.title.lineHeight,anchor:a,title:n.title.text};return gh(e,l),l}(this);this.state.nodes.push(e)}const t=function(e){const t=e.state.legend.fillScale,n=e.state.legend.majorScale,i=t.domain().map((e=>({type:"stop",color:t(e),offset:Math.min(1,Math.max(0,n.norm(e)))})));return i.sort(((e,t)=>e.offset-t.offset))}(this),n=function(e,t){const n=e.state,i=e.stgns,r=n.rect;let o=r.x,s=r.y,a=n.isVertical?i.size:n.legend.length(),l=n.isVertical?n.legend.length():i.size;"left"===n.ticks.anchor?o+=n.rect.width-i.size:"top"===n.ticks.anchor&&(s+=n.rect.height-i.size),"top"===n.title.anchor?s+=n.title.requiredHeight():"left"===n.title.anchor&&(o+=n.title.requiredWidth());const c={type:"rect",x:o,y:s,width:a,height:l,fill:{type:"gradient",stops:t,degree:n.isVertical?90:180}};return gh(e,c),c}(this,t),i=function(e,t){const n=e.state,i=e.stgns;let r="start";const o={type:"rect",x:t.x,y:t.y,width:n.isVertical?0:t.width,height:n.isVertical?t.height:0,fill:"transparent"},s=n.ticks.values.map((s=>{let a=0,l=0,c=0,u="alphabetical";return n.isVertical?(l=t.y+t.height*s.pos,u=0===s.pos?"text-before-edge":"text-after-edge"):a=t.x+t.width*s.pos,"right"===n.ticks.anchor?(a=t.x+i.size+i.tick.padding,o.x=t.x+t.width):"left"===n.ticks.anchor?(a=t.x-i.tick.padding,r="end"):"top"===n.ticks.anchor?(l=t.y-i.tick.padding,c-=.25*s.textMetrics.height,r=0===s.pos?"start":"end"):"bottom"===n.ticks.anchor&&(l=t.y+t.height+i.tick.padding,c=.8*s.textMetrics.height,r=0===s.pos?"start":"end",o.y=t.y+t.height),{type:"text",x:a,y:l,dx:0,dy:c,text:s.label,fontSize:i.tick.fontSize,fontFamily:i.tick.fontFamily,fill:i.tick.fill,maxWidth:n.isVertical?i.tick.maxLengthPx:Math.min(i.tick.maxLengthPx,n.legend.length()/2),anchor:r,textBoundsFn:e.renderer.textBounds,title:s.label,baseline:u}}));return{type:"container",id:"legend-seq-ticks",children:[...s,o]}}(this,n),r={id:"legend-seq-target",type:"container",children:[n,i]};this.state.nodes.push(r)},render(){return this.state.nodes}};const qh={coordinates:{minor:.5,major:.5,layerId:0,defined:!0},connect:!1,orientation:"horizontal",layers:{curve:"linear",show:!0,sort:void 0,line:{stroke:"#ccc",strokeWidth:1,strokeLinejoin:"miter",strokeDasharray:void 0,opacity:1,show:!0,showMinor0:!0},area:{fill:"#ccc",opacity:.8,show:!0}}};function Sh(e,t){let{generatorType:n,item:i,data:r,major:o,minor:s,layerObj:a,stngs:l}=t,c=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"";const u={type:"path",points:e,generatorType:n,major:o,minor:s,layerObj:a,stngs:l,opacity:i.opacity,stroke:i.stroke,strokeWidth:i.strokeWidth,strokeLinejoin:i.strokeLinejoin,fill:c||i.fill,data:r};return i.strokeDasharray&&(u.strokeDasharray=i.strokeDasharray),u}function Mh(e){const{metaLayers:t,coordinates:n,layers:i,lines:r,areas:o}=function(e){let{data:t,stngs:n,rect:i,resolver:r,style:o,domain:s}=e;const{width:a,height:l}=i,c=r.resolve({data:t,defaults:qh.coordinates,settings:n.coordinates||{},scaled:{major:"vertical"===n.orientation?l:a,minor:"vertical"===n.orientation?a:l}}),u=!n.connect&&s.length>2&&("function"==typeof n.coordinates.layerId||"object"==typeof n.coordinates.layerId),h={};let d=0;for(let e=0;e<c.items.length;e++){let t=c.items[e],n=t.layerId;if(u){const e=h[n]?h[n].items[h[n].items.length-1]:null,i=e?s.indexOf(e.data.major?e.data.major.value:e.data.value):null;e&&s.indexOf(t.data.major?t.data.major.value:t.data.value)-1!==i&&h[n].items.push({dummy:!0})}h[n]=h[n]||{order:d++,id:n,items:[],dataItems:[],consumableData:{}},h[n].dataItems.push(t.data),h[n].items.push(t)}const f=Object.keys(h).map((e=>(h[e].consumableData=I({points:h[e].dataItems},h[e].dataItems[0]),h[e]))),p={items:f.map((e=>e.consumableData))},m=n.layers||{};return{coordinates:c,metaLayers:f,layers:r.resolve({data:p,defaults:{curve:qh.layers.curve,show:qh.layers.show},settings:{curve:m.curve,show:m.show}}),lines:r.resolve({data:p,defaults:E({},qh.layers.line,o.line),settings:m.line}),areas:r.resolve({data:p,defaults:E({},qh.layers.area,o.area),settings:m.area})}}(e),s=[];return t.forEach(((t,a)=>{const l=i.items[a];if(!1===l.show)return;l.datum=l.data,l.data=[],l.id=t.id;const c=[],u=[];let h,d;for(let i=0;i<t.items.length;i++){if(h=t.items[i],d=h.data,!h.dummy){if(isNaN(h.major))continue;e.missingMinor0&&(h.minor0=n.settings.minor.scale?n.settings.minor.scale(d.minor0?d.minor0.value:0):0),isNaN(h.minor)||c.push(h.minor),l.data.push(h.data)}u.push(h)}const f=c.sort(((e,t)=>e-t))[Math.floor((c.length-1)/2)];s.push({layerObj:l,lineObj:r.items[a],areaObj:o.items[a],median:f,points:u,consumableData:t.consumableData})})),s}const Dh={require:["chart","resolver"],defaultSettings:{style:{area:"$shape",line:"$shape-outline"}},created(){},render(e){let{data:t}=e;const{width:n,height:i}=this.rect;this.stngs=this.settings.settings||{};const r=!this.stngs.coordinates||void 0===this.stngs.coordinates.minor0,o=Mh({data:t,stngs:this.stngs,rect:this.rect,resolver:this.resolver,style:this.style,missingMinor0:r,domain:this.stngs.coordinates&&this.stngs.coordinates.major&&this.stngs.coordinates.major.scale?this.chart.scale(this.stngs.coordinates.major.scale).domain():[]});if(this.stngs.layers&&this.stngs.layers.sort){const e=o.map((e=>({id:e.layerObj.id,data:e.layerObj.data}))).sort(this.stngs.layers.sort).map((e=>e.id));o.sort(((t,n)=>e.indexOf(t.layerObj.id)-e.indexOf(n.layerObj.id)))}else o.sort(((e,t)=>e.median-t.median));return function(e,t){let{width:n,height:i,missingMinor0:r,stngs:o}=t;const s=[],a=o.layers||{};return e.forEach((e=>{const{lineObj:t,layerObj:l,areaObj:c,points:u}=e;let h={size:i,p:"y"},d={size:n,p:"x"};if("vertical"===o.orientation){const e=E(!0,{},d);d=E(!0,{},h),h=E(!0,{},e)}a.area&&!1!==c.show&&s.push(Sh(u,{data:e.consumableData,item:c,generatorType:"area",major:d,minor:h,layerObj:l,stngs:o})),t&&!1!==t.show&&(s.push(Sh(u,{data:e.consumableData,item:t,generatorType:"line".concat(h.p.toUpperCase(),"1"),major:d,minor:h,layerObj:l,stngs:o},"none")),!r&&a.area&&!1!==c.show&&!1!==t.showMinor0&&s.push(Sh(u,{data:e.consumableData,item:t,generatorType:"line".concat(h.p.toUpperCase(),"0"),major:d,minor:h,layerObj:l,stngs:o},"none")))})),s}(o,{width:n,height:i,missingMinor0:r,stngs:this.stngs})}};function _h(e,t){let n,i,r=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];"object"==typeof t.center?(n=t.center.x,i=t.center.y):(n=t.clientX,i=t.clientY);const o=n-e.state.boundingRect.left,s=i-e.state.boundingRect.top;return{x:r?Math.max(0,Math.min(o,e.rect.width)):o,y:r?Math.max(0,Math.min(s,e.rect.height)):s}}function Ch(e,t){return{x:t.x+e.rect.x,y:t.y+e.rect.y}}function kh(e,t){const n=Math.min(e.x,t.x),i=Math.min(e.y,t.y);return{x:n,y:i,width:Math.max(e.x,t.x)-n,height:Math.max(e.y,t.y)-i}}const Eh={require:["chart","renderer"],defaultSettings:{layout:{displayOrder:99},settings:{brush:{components:[]}},style:{area:"$selection-area-target"}},on:{areaStart(e){this.start(e)},areaMove(e){this.move(e)},areaEnd(e){this.end(e)},areaCancel(){this.cancel()}},created(){this.state={start:{x:0,y:0},end:{x:0,y:0},active:!1}},preferredSize:()=>0,render(){},start(e){this.state.boundingRect=this.renderer.element().getBoundingClientRect();const t=_h(this,e,!1);ea({x:0,y:0,width:this.rect.width,height:this.rect.height},t)&&(this.state.brushConfig=function(e){return e.settings.brush.components.map((e=>({key:e.key,contexts:e.contexts,data:e.data,action:e.action||"set"})))}(this.settings),this.state.start=_h(this,e),this.state.active=!0)},move(e){var t;this.state.active&&(this.state.end=_h(this,e),function(e){if(e.state.active){const t=Ch(e,e.state.start),n=Ch(e,e.state.end),i=e.chart.shapesAt(kh(t,n),{components:e.state.brushConfig});e.chart.brushFromShapes(i,{components:e.state.brushConfig})}}(this),(t=this).renderer.render([E({type:"rect"},kh(t.state.start,t.state.end),t.style.area)]))},end(){this.state.active&&(this.state={start:{x:0,y:0},end:{x:0,y:0},active:!1},this.renderer.render([]))},cancel(){this.state.active&&(!function(e,t){e.brushConfig.forEach((e=>{Array.isArray(e.contexts)&&e.contexts.forEach((e=>{t.brush(e).end()}))}))}(this.state,this.chart),this.state={start:{x:0,y:0},end:{x:0,y:0},active:!1},this.renderer.render([]))}};function Ah(e,t,n){let{renderer:i,style:r,props:o,h:s}=n;const a=function(e,t){return{tooltip:"function"==typeof e.tooltipClass?e.tooltipClass({dock:t.dock}):e.tooltipClass,content:"function"==typeof e.contentClass?e.contentClass({dock:t.dock}):e.contentClass,arrow:"function"==typeof e.arrowClass?e.arrowClass({dock:t.dock}):e.arrowClass}}(o,t),l=function(e,t,n,i){return i.content({h:e,style:n,data:t})}(s,e,r,o),c=s("div",{dir:o.direction,class:ah(E({"pic-tooltip":!0},a.tooltip)),style:E({position:"relative",display:"inline-block"},t.computedTooltipStyle)},s("div",{style:r.content,class:ah(E({"pic-tooltip-content":!0},a.content))},l),s("div",{class:ah(E({"pic-tooltip-arrow":!0},a.arrow)),style:E({},r.arrow,r["arrow-".concat(t.dock)],t.computedArrowStyle)}));return i.render(c),i.element().children[0]}function Th(e){let{defaultDuration:t,defaultDelay:n}=e,i=null,r=null,o=!1;const s=function(){const e=function(){},t={pending:[],debounced:[],active:[],cancelled:[],rejected:[],fulfilled:[]};let n;return e.set=e=>{n=e,t[n].forEach((t=>t(e)))},e.on=(e,n)=>{Array.isArray(e)?e.forEach((e=>t[e].push(n))):t[e].push(n)},e.destroy=()=>{Object.keys(t).forEach((e=>{t[e].length=0}))},e}(),a=function(){},l=()=>{i=null,r=null,o=!1,s.set("fulfilled")};return a.invoke=function(e){let a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:t,c=arguments.length>2&&void 0!==arguments[2]?arguments[2]:n;i&&(clearTimeout(i),s.set("debounced")),s.set("pending"),i=setTimeout((()=>{e(),o=!0,i=null,s.set("active")}),c),a>0&&(r&&clearTimeout(r),r=setTimeout(l,a+Math.max(c,0)))},a.clear=()=>{o?s.set("cancelled"):i&&(clearTimeout(i),s.set("rejected")),r&&clearTimeout(r),i=null,r=null,o=!1},a.on=(e,t)=>{s.on(e,t)},a.destroy=()=>{a.clear(),s.destroy()},a}function Ih(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;return{left:"translate(-100%,-50%) translateX(".concat(-e,"px)"),right:"translate(".concat(e,"px, -50%)"),top:"translate(-50%, -100%) translateY(".concat(-e,"px)"),bottom:"translate(-50%, ".concat(e,"px)")}}function Rh(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;return{left:{x:-e-n,y:-t/2},right:{x:n,y:-t/2},top:{x:-e/2,y:-t-n},bottom:{x:-e/2,y:n}}}function Oh(e){return{left:{left:"100%",top:"calc(50% - ".concat(e,"px)"),borderWidth:"".concat(e,"px")},right:{left:"".concat(2*-e,"px"),top:"calc(50% - ".concat(e,"px)"),borderWidth:"".concat(e,"px")},top:{left:"calc(50% - ".concat(e,"px)"),top:"100%",borderWidth:"".concat(e,"px")},bottom:{left:"calc(50% - ".concat(e,"px)"),top:"".concat(2*-e,"px"),borderWidth:"".concat(e,"px")}}}function Nh(e,t,n,i,r,o){const s=t+o.x,a=n+o.y,l=r;return!(s<0||a<0)&&!(s+i>e.width||a+l>e.height)}function Ph(e){let{area:t,vx:n,vy:i,width:r,height:o,offset:s}=e;const a=n+s.x,l=i+s.y,c=r,u=o;let h=a<0?-a:0,d=l<0?-l:0;return h+=a+c>t.width?-(a+c-t.width):0,d+=l+u>t.height?-(l+u-t.height):0,{x:h,y:d}}function Lh(e){let{options:t,pointer:n,width:i,height:r,dockOrder:o,x:s,y:a}=e;const{targetBounds:l}=n,c=Ih(t.offset),u=c[t.dock];if(u)return{computedTooltipStyle:{left:"".concat(s,"px"),top:"".concat(a,"px"),transform:u},computedArrowStyle:Oh(t.offset)[t.dock],dock:t.dock};const h={width:"target"===t.area?l.width:window.innerWidth,height:"target"===t.area?l.height:window.innerHeight},d=Rh(i,r,t.offset),f=[],p="target"===t.area?s:l.left+s,m="target"===t.area?a:l.top+a;for(let e=0;e<o.length;e+=1){const n=o[e],l=Ph({area:h,vx:p,vy:m,width:i,height:r,offset:d[n]}),u={left:"".concat(s,"px"),top:"".concat(a,"px"),transform:c[n]},g=Oh(t.offset)[n];0!==l.x&&(u.width="".concat(i-20-Math.abs(l.x),"px"),"top"!==n&&"bottom"!==n||(u.left="".concat(s+l.x,"px"),g.left="calc(50% ".concat(l.x>0?"-":"+"," ").concat(Math.abs(l.x),"px)")));const y={computedTooltipStyle:u,computedArrowStyle:g,dock:n,rect:{width:i,height:r}};if(0===l.x&&0===l.y)return y;y.offset=l,f.push(y)}return f.sort(((e,t)=>Math.abs(e.offset.x)-Math.abs(t.offset.x))),f[0]}function Fh(e,t,n){const i=e.key?n.component(e.key):n.componentsFromPoint({x:t.clientX,y:t.clientY})[0];if(!i)return{x:0,y:0,width:0,height:0,scaleRatio:{x:1,y:1}};const r=i.rect;return E({scaleRatio:r.scaleRatio},r.computedInner)}const zh={bounds:function(e){let{resources:t,nodes:n,pointer:i,width:r,height:o,options:s}=e;const{targetBounds:a}=i,{x:l,y:c,width:u,height:h}=t.getNodeBoundsRelativeToTarget(n[0]),d={left:{x:l,y:c+h/2},right:{x:l+u,y:c+h/2},top:{x:l+u/2,y:c},bottom:{x:l+u/2,y:c+h}},f=Ih(s.offset),p=f[s.dock];if(p)return{computedTooltipStyle:{left:"".concat(d[s.dock].x,"px"),top:"".concat(d[s.dock].y,"px"),transform:p},computedArrowStyle:Oh(s.offset)[s.dock],dock:s.dock};const m={width:"target"===s.area?a.width:window.innerWidth,height:"target"===s.area?a.height:window.innerHeight},g=Rh(r,o,s.offset),y=["top","left","right","bottom"];for(let e=0;e<y.length;e+=1){const t=y[e];if(Nh(m,"target"===s.area?d[t].x:a.left+d[t].x,"target"===s.area?d[t].y:a.top+d[t].y,r,o,g[t]))return{computedTooltipStyle:{left:"".concat(d[t].x,"px"),top:"".concat(d[t].y,"px"),transform:f[t]},computedArrowStyle:Oh(s.offset)[t],dock:t}}return{computedTooltipStyle:{left:"".concat(d.top.x,"px"),top:"".concat(d.top.y,"px"),transform:f.top},computedArrowStyle:Oh(s.offset).top,dock:"top"}},pointer:function(e){let{options:t,pointer:n,width:i,height:r}=e;const{x:o,y:s}=n;return Lh({x:o,y:s,pointer:n,width:i,height:r,options:t,dockOrder:["top","left","right","bottom"]})},slice:function(e){let{options:t,pointer:n,width:i,height:r,nodes:o,resources:s}=e;const a=o[0],{dx:l,dy:c}=n,u=s.getComponentBoundsFromNode(a),h=l+u.x+u.width/2,d=c+u.y+u.height/2,{start:f,end:p,outerRadius:m}=a.desc.slice,g=(f+p)/2-Math.PI/2,y=2*Math.PI,v=(g%y+y)%y;let b=["top","left","right","bottom"];return"auto"===t.dock&&(b=v<=Math.PI/4||v>=7*Math.PI/4?["right","top","bottom","left"]:v<=3*Math.PI/4?["bottom","left","right","top"]:v<=5*Math.PI/4?["left","top","bottom","right"]:["top","left","right","bottom"]),Lh({x:h+m*u.scaleRatio.x*Math.cos(v),y:d+m*u.scaleRatio.y*Math.sin(v),pointer:n,width:i,height:r,options:t,dockOrder:b})}};function jh(e,t){let{width:n,height:i}=e,{chart:r,state:o,props:s}=t;const a={resources:{formatter:r.formatter,scale:r.scale,component:r.component,getComponentBoundsFromNode:e=>Fh(e,o.pointer,r),getNodeBoundsRelativeToTarget:e=>function(e,t,n){const i=Fh(e,t,n),r=e.bounds;return{x:i.x+t.dx+r.x,y:i.y+t.dy+r.y,width:r.width,height:r.height}}(e,o.pointer,r)},nodes:o.activeNodes,pointer:o.pointer,width:n,height:i},l=typeof s.placement;if("object"===l&&"function"==typeof s.placement.fn)return s.placement.fn(a);let c={type:"pointer",offset:8,dock:"auto",area:"viewport"};"function"===l&&(c=E(c,s.placement(a))),"object"===l&&zh[s.placement.type]?c=E(c,s.placement):"string"===l&&zh[s.placement]&&(c=E(c,{type:s.placement})),a.options=c;const u=zh[c.type](a);let{x:h,y:d,width:f,height:p}=a.resources.getComponentBoundsFromNode(a.nodes[0]);return h+=a.pointer.dx,f+=h,d+=a.pointer.dy,p+=d,u.computedTooltipStyle.left="".concat(Math.min(Math.max(0,h,parseFloat(u.computedTooltipStyle.left)),f),"px"),u.computedTooltipStyle.top="".concat(Math.min(Math.max(0,d,parseFloat(u.computedTooltipStyle.top)),p),"px"),u}let Hh;function Bh(){Hh=null}const Vh={duration:8e3,delay:500,filter:e=>e.filter((e=>e.data&&void 0!==e.data.value)),extract:e=>e.node.data.value,content:e=>{let{h:t,data:n}=e;return n.map((e=>t("div",{},e)))},isEqual:(e,t)=>e.length&&e.length===t.length&&e.every(((e,n)=>t[n]&&JSON.stringify(e.data)===JSON.stringify(t[n].data))),placement:{type:"pointer",dock:"auto",offset:8,area:"viewport"},tooltipClass:{},contentClass:{},arrowClass:{},direction:"ltr",appendTo:void 0,beforeShow:void 0,afterShow:void 0,beforeHide:void 0,onHide:void 0,afterHide:void 0};const $h={require:["chart","renderer"],defaultSettings:{settings:Vh,style:{tooltip:{},content:{backgroundColor:"$gray-25",color:"$font-color--inverted",fontFamily:"$font-family",fontSize:"$font-size",lineHeight:"$line-height",borderRadius:"4px",padding:"8px",opacity:.9},arrow:{position:"absolute",width:"0px",height:"0px",borderStyle:"solid",color:"$gray-25",opacity:.9},"arrow-bottom":{borderTopColor:"transparent",borderLeftColor:"transparent",borderRightColor:"transparent"},"arrow-top":{borderBottomColor:"transparent",borderLeftColor:"transparent",borderRightColor:"transparent"},"arrow-right":{borderTopColor:"transparent",borderLeftColor:"transparent",borderBottomColor:"transparent"},"arrow-left":{borderTopColor:"transparent",borderBottomColor:"transparent",borderRightColor:"transparent"}}},renderer:"dom",on:{hide(){this.hide()},show(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this.show(e,t)},prevent(e){this.prevent(e)}},hide(){this.dispatcher.clear(),this.state.activeNodes=[],this.state.pointer={}},show(e){let t,{nodes:n,duration:i,delay:r}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};!this.state.prevent&&this.state.targetElement&&(this.state.pointer=function(e,t){let{chart:n,state:i}=t,r=0,o=0;e.center?(r+=e.center.x,o+=e.center.y):(r+=e.clientX,o+=e.clientY);const s=n.element.getBoundingClientRect(),a=i.targetElement.getBoundingClientRect(),l=r,c=o,u=s.left-a.left,h=s.top-a.top,d=r-s.left,f=o-s.top;return r-=a.left,o-=a.top,{x:r,y:o,dx:u,dy:h,cx:d,cy:f,clientX:l,clientY:c,targetBounds:a,chartBounds:s}}(e,this),t=Array.isArray(n)?this.props.filter(n):this.props.filter(this.chart.shapesAt({x:this.state.pointer.cx,y:this.state.pointer.cy})),this.props.isEqual(this.state.activeNodes,t)||(this.dispatcher.clear(),this.state.activeNodes=t,this.state.activeNodes.length&&this.dispatcher.invoke((()=>this.invokeRenderer(this.state.activeNodes)),i,r)))},prevent(e){this.state.prevent=!!e},init(e){this.state={activeNodes:[],pointer:{},targetElement:null,prevent:!1},this.props=e.settings,this.dispatcher=Th({defaultDuration:this.props.duration,defaultDelay:this.props.delay});const t=this.dispatcher.clear;this.dispatcher.on("pending",(()=>{!function(e){Hh&&Hh!==e&&Hh()}(t),Hh=t,"function"==typeof this.props.beforeShow&&this.props.beforeShow.call(void 0,{resources:{formatter:this.chart.formatter,scale:this.chart.scale}})})),this.dispatcher.on(["cancelled","fulfilled"],(()=>{const e={resources:{formatter:this.chart.formatter,scale:this.chart.scale}};"function"==typeof this.props.beforeHide&&this.props.beforeHide.call(void 0,E({element:this.state.tooltipElm},e)),"function"==typeof this.props.onHide?this.props.onHide.call(void 0,E({element:this.state.tooltipElm},e)):this.renderer.clear([]),"function"==typeof this.props.afterHide&&this.props.afterHide.call(void 0,e),Hh===t&&(Hh=null),this.state.tooltipElm=void 0})),this.dispatcher.on("active",(()=>{"function"==typeof this.props.afterShow&&this.props.afterShow.call(void 0,{element:this.state.tooltipElm,resources:{formatter:this.chart.formatter,scale:this.chart.scale}})}))},created(){this.init(this.settings)},beforeUpdate(e){let{settings:t}=e;this.dispatcher&&(this.dispatcher.destroy(),Bh()),this.init(t)},render(e){return this.h=e,[]},beforeDestroy(){this.dispatcher.destroy(),Bh()},appendTo(){if(this.props.appendTo){this.state.targetElement="function"==typeof this.props.appendTo?this.props.appendTo({resources:{formatter:this.chart.formatter,scale:this.chart.scale}}):this.props.appendTo;const{width:e,height:t}=this.state.targetElement.getBoundingClientRect();this.renderer.destroy(),this.renderer.size({width:e,height:t}),this.renderer.appendTo(this.state.targetElement)}else this.state.targetElement=this.renderer.element()},mounted(){this.appendTo()},updated(){this.appendTo()},invokeRenderer(e){const t=function(e,t){let{chart:n,scale:i,props:r,h:o}=t;const s={resources:{dataset:n.dataset,scale:n.scale,formatter:n.formatter},scale:i,h:o},a=[];return e.forEach((e=>{if("function"==typeof r.extract){const t=E({node:e},s);a.push(r.extract(t))}})),a}(e,this),n=jh(Ah(t,{style:{left:"0px",top:"0px",visibility:"hidden"}},this).getBoundingClientRect(),this);this.state.tooltipElm=Ah(t,n,this)}};const Wh={require:["renderer","chart"],defaultSettings:{settings:{target:"",selector:"*",fill:"rgba(0, 255, 0, 0.1)",stroke:"lime",opacity:1,useOuterRect:!1}},on:{update(){this.draw()}},draw(){const e=this.chart.findShapes(this.props.selector).filter((e=>e.key===this.props.target)),t=e.filter((e=>e.collider)).map((e=>e.collider));t.forEach((e=>{e.fill=this.props.fill,e.stroke=this.props.stroke,e.opacity=this.props.opacity,e.collider={type:null}})),this.renderer.render(t)},created(){this.props=this.settings.settings},resize(e){let{outer:t,inner:n}=e;return this.props.useOuterRect?t:n},render(){},mounted(){this.draw()},updated(){this.props=this.settings.settings,this.draw()}},Uh=2*Math.PI;function Yh(e,t){return{x:.5*(e.x+t.x),y:.5*(e.y+t.y)}}function Xh(e,t,n,i,r){const o=1-e;return o**3*t+3*o**2*e*n+3*o*e**2*i+e**3*r}function Kh(e,t,n,i){let r=arguments.length>4&&void 0!==arguments[4]?arguments[4]:[],o=arguments.length>5&&void 0!==arguments[5]?arguments[5]:8;if(o<1||function(e,t,n,i){return Math.abs(e.x+n.x-(t.x+t.x))+Math.abs(e.y+n.y-(t.y+t.y))+Math.abs(t.x+i.x-(n.x+n.x))+Math.abs(t.y+i.y-(n.y+n.y))}(e,t,n,i)<=10)return r[r.length-1]!==e&&r.push(e),r.push(i),r;const s=Yh(e,t),a=Yh(t,n),l=Yh(n,i),c={x:Xh(.5,e.x,t.x,n.x,i.x),y:Xh(.5,e.y,t.y,n.y,i.y)},u=Yh(s,a),h=Yh(a,l);return Kh(e,s,u,c,r,o-1),Kh(c,h,l,i,r,o-1),r}function Gh(e,t,n){const{cp1:i,cp2:r}=function(e,t,n){return{cp1:{x:e.x+2/3*(t.x-e.x),y:e.y+2/3*(t.y-e.y)},cp2:{x:n.x+2/3*(t.x-n.x),y:n.y+2/3*(t.y-n.y)}}}(e,t,n);return Kh(e,i,r,n)}const Jh=1e-12;function Zh(e,t,n){const i=[],r=!!e[4],o=!!e[5],s=e[3];let a,l,c,u,h=e[6],d=e[7],f=e[1],p=e[2];if("a"===e[0]&&(h+=t,d+=n),t===d&&n===d)return i;if(!f||!p)return i.push({x:h,y:d}),i;({cx:a,cy:l,rx:f,ry:p,sweepAngle:c,startAngle:u}=function(e,t,n,i,r,o,s,a,l){let c,u,h,d,f,p;const m=fs(n%360),g=Math.cos(m),y=Math.sin(m),v=(a-o)/2,b=(l-s)/2,x=g*v+y*b,w=g*b-y*v;p=x**2/(e=Math.abs(e))**2+w**2/(t=Math.abs(t))**2,p>1&&(p=Math.sqrt(p),e*=p,t*=p);const q=e*w,S=t*x,M=q**2+S**2,D=(e*t)**2-M;let _=Math.sqrt(Math.max(D/M,0));i===r&&(_=-_);const C=_*(q/t),k=_*(-S/e);d=g*C-y*k+(a+o)/2,f=y*C+g*k+(l+s)/2;const E=(x-C)/e,A=(w-k)/t,T=(-x-C)/e,I=(-w-k)/t;return c=Math.atan2(A,E),c+=c<0?Uh:0,u=Math.atan2(I,T),u+=u<0?Uh:0,h=u-c,!r&&c<u?h-=Uh:r&&u<c&&(h+=Uh),h%=Uh,{startAngle:c,sweepAngle:h,cx:d,cy:f,rx:e,ry:t}}(f,p,s,r,o,h,d,t,n));const m=Math.abs(c*Math.sqrt((f**2+p**2)/2)),g=Math.ceil(m/10),y=c/g;for(let e=1;e<=g;e++){const t=(u+y*e)%Uh,n=Math.cos(t),r=Math.sin(t);i.push({x:a+n*f+-r*n,y:l+r*p+n*r})}return i}function Qh(e){const t=x.parsePath(e),n=[],i=[];let r=0,o=0,s=null,a=null,l=null,c=null;for(let e=0;e<t.length;++e){const u=t[e],h=u[0];switch("S"!==h&&"s"!==h&&"C"!==h&&"c"!==h&&(s=null,a=null),"T"!==h&&"t"!==h&&"Q"!==h&&"q"!==h&&(l=null,c=null),h){case"m":i.length&&n.push(i.splice(0));case"l":r+=u[1],o+=u[2],i.push({x:r,y:o});break;case"M":i.length&&n.push(i.splice(0));case"L":r=u[1],o=u[2],i.push({x:r,y:o});break;case"H":r=u[1],i.push({x:r,y:o});break;case"h":r+=u[1],i.push({x:r,y:o});break;case"V":o=u[1],i.push({x:r,y:o});break;case"v":o+=u[1],i.push({x:r,y:o});break;case"a":i.push(...Zh(u,r,o)),r+=u[6],o+=u[7];break;case"A":i.push(...Zh(u,r,o)),r=u[6],o=u[7];break;case"c":i.push(...Kh({x:r,y:o},{x:u[1]+r,y:u[2]+o},{x:u[3]+r,y:u[4]+o},{x:u[5]+r,y:u[6]+o})),s=u[3]+r,a=u[4]+o,r+=u[5],o+=u[6];break;case"C":i.push(...Kh({x:r,y:o},{x:u[1],y:u[2]},{x:u[3],y:u[4]},{x:u[5],y:u[6]})),s=u[3],a=u[4],r=u[5],o=u[6];break;case"s":null!==s&&null!==s||(s=r,a=o),i.push(...Kh({x:r,y:o},{x:2*r-s,y:2*o-a},{x:u[1]+r,y:u[2]+o},{x:u[3]+r,y:u[4]+o})),s=u[1]+r,a=u[2]+o,r+=u[3],o+=u[4];break;case"S":null!==s&&null!==s||(s=r,a=o),i.push(...Kh({x:r,y:o},{x:2*r-s,y:2*o-a},{x:u[1],y:u[2]},{x:u[3],y:u[4]})),s=u[1],a=u[2],r=u[3],o=u[4];break;case"Q":i.push(...Gh({x:r,y:o},{x:u[1],y:u[2]},{x:u[3],y:u[4]})),l=u[1],c=u[2],r=u[3],o=u[4];break;case"q":i.push(...Gh({x:r,y:o},{x:u[1]+r,y:u[2]+o},{x:u[3]+r,y:u[4]+o})),l=u[1]+r,c=u[2]+o,r+=u[3],o+=u[4];break;case"T":null!==l&&null!==l||(l=r,c=o),l=2*r-l,c=2*o-c,i.push(...Gh({x:r,y:o},{x:l,y:c},{x:u[1],y:u[2]})),r=u[1],o=u[2];break;case"t":null!==l&&null!==l||(l=r,c=o),l=2*r-l,c=2*o-c,i.push(...Gh({x:r,y:o},{x:l,y:c},{x:u[1]+r,y:u[2]+o})),r+=u[1],o+=u[2];break;case"z":case"Z":i.length&&i.push({x:i[0].x,y:i[0].y})}}return function(e){for(let t=0;t<e.length-1;t++){const n=e[t],i=e[t+1];Math.abs(n.x-i.x)<Jh&&Math.abs(n.y-i.y)<Jh&&(e.splice(t,1),t--)}}(i),n.push(i.splice(0)),n}const ed={require:["renderer","chart"],defaultSettings:{settings:{target:"",fill:"transparent",stroke:"lime",opacity:1,radius:2,useOuterRect:!1}},on:{update(){this.draw()}},draw(){const e=this.chart.findShapes("path").filter((e=>e.key===this.props.target)),t=[];e.forEach((e=>{Qh(e.attrs.d).forEach((e=>{e.forEach((e=>{t.push({type:"circle",cx:e.x,cy:e.y,r:this.props.radius,fill:this.props.fill,stroke:this.props.stroke,opacity:this.props.opacity,collider:{type:null}})}))}))})),this.renderer.render(t)},created(){this.props=this.settings.settings},resize(e){let{outer:t,inner:n}=e;return this.props.useOuterRect?t:n},render(){},mounted(){this.draw()},updated(){this.props=this.settings.settings,this.draw()}};var td=[function(e){e.component("box",tl),e.component("box-marker",tl)},function(e){e.component("point",ll),e.component("point-marker",ll)},function(e){e.component("pie",dl)},function(e){e.component("grid-line",yl)},function(e){e.component("ref-line",Ml)},function(e){e.component("axis",Xl)},function(e){e.component("container",Kl)},function(e){e.component("text",Zl)},function(e){e.component("scrollbar",tc)},function(e){e.component("brush-range",vc),e.component("brush-area-dir",qc)},function(e){e.component("range",_c)},function(e){e.component("brush-lasso",Ic)},function(e){e.component("labels",nh)},function(e){e.component("legend-cat",mh)},function(e){e.component("legend-seq",wh)},function(e){e.component("line",Dh)},function(e){e.component("brush-area",Eh)},function(e){e.component("tooltip",$h)},function(e){e.component("debug-collider",Wh)},function(e){e.component("debug-path-to-points",ed)}];let nd=class{constructor(e){this._parent=null,this._children=[],this._ancestors=null,this.type=e,this.data=null}detach(){return this._parent&&this._parent.removeChild(this),this}get parent(){return this._parent}get isBranch(){return this._children&&this._children.length}get children(){return this._children}get ancestors(){return this._ancestors||(this._ancestors=[],this.parent&&this._ancestors.push(this.parent,...this.parent.ancestors)),this._ancestors}get descendants(){let e=[];const t=this.children.length;let n,i;for(n=0;n<t;n++)i=this.children[n],e.push(i),i.children.length&&(e=[...e,...i.descendants]);return e}equals(e){const t=this.children,n=e.children;if(t.length!==n.length)return!1;for(let e=0;e<t.length;e++)if(!t[e].equals(n[e]))return!1;return!0}toJSON(){return{type:this.type,children:this.children.map((e=>e.toJSON()))}}};class id{constructor(){let{x:e=0,y:t=0,width:n=0,height:i=0,minWidth:r=0,minHeight:o=0}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.set({x:e,y:t,width:n,height:i,minWidth:r,minHeight:o})}set(){let{x:e=0,y:t=0,width:n=0,height:i=0,minWidth:r=0,minHeight:o=0}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.type="rect",n>=0?(this.x=e,this.width=Math.max(n,r)):(this.x=e+Math.min(n,-r),this.width=-Math.min(n,-r)),i>=0?(this.y=t,this.height=Math.max(i,o)):(this.y=t+Math.min(i,-o),this.height=-Math.min(i,-o))}containsPoint(e){return ea(this,e)}intersectsLine(e){return ta(this,H(e))}intersectsRect(e){return Zs(this,j(e))}intersectsCircle(e){return Us(e,this)}intersectsPolygon(e){return Js(e,this)}intersectsGeoPolygon(e){return ca(e,this)}points(){return[{x:this.x,y:this.y},{x:this.x+this.width,y:this.y},{x:this.x+this.width,y:this.y+this.height},{x:this.x,y:this.y+this.height}]}}class rd{constructor(){let{cx:e=0,cy:t=0,r:n=0,minRadius:i=0}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.set({cx:e,cy:t,r:n,minRadius:i})}set(){let{cx:e=0,cy:t=0,r:n=0,minRadius:i=0}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.type="circle",this.cx=e,this.cy=t,this.r=Math.max(n,i),this.vector={x:this.cx,y:this.cy}}containsPoint(e){return Ws(this,e)}intersectsLine(e){return Ys(this,H(e))}intersectsRect(e){return Us(this,j(e))}intersectsCircle(e){return n=e,!Hs(t=this)&&!Hs(n)&&(t.cx-n.cx)**2+(t.cy-n.cy)**2<=(t.r+n.r)**2;var t,n}intersectsPolygon(e){return Xs(this,e)}intersectsGeoPolygon(e){return sa(this,e)}points(){return[{x:this.cx,y:this.cy}]}}class od{constructor(){let{x1:e=0,y1:t=0,x2:n=0,y2:i=0,tolerance:r=0}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.set({x1:e,y1:t,x2:n,y2:i,tolerance:r})}set(){let{x1:e=0,y1:t=0,x2:n=0,y2:i=0,tolerance:r=0}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.type="line",this.x1=e,this.y1=t,this.x2=n,this.y2=i,this.tolerance=Math.max(0,Math.round(r)),this.vectors=this.points(),this.zeroSize=e===n&&t===i}containsPoint(e){if(this.tolerance>0){return Ys({cx:e.x,cy:e.y,r:this.tolerance},this)}return ia(this,e)}intersectsLine(e){return na(this,H(e))}intersectsRect(e){return ta(j(e),this)}intersectsCircle(e){return Ys(e,this)}intersectsPolygon(e){return Gs(e,this)}intersectsGeoPolygon(e){return la(e,this)}points(){return[{x:this.x1,y:this.y1},{x:this.x2,y:this.y2}]}}class sd{constructor(){let{vertices:e=[]}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.set({vertices:e})}set(){let{vertices:e=[]}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(this.type="polygon",this.vertices=e.slice(),this.edges=[],function(e){for(let t=0;t<e.length-1;t++){const n=e[t],i=e[t+1];n.x===i.x&&n.y===i.y&&(e.splice(t,1),t--)}}(this.vertices),!(this.vertices.length<=2)){!function(e){const t=e[0],n=e[e.length-1];t.x===n.x&&t.y===n.y||e.push(t)}(this.vertices),this.xMin=NaN,this.yMin=NaN,this.xMax=NaN,this.yMax=NaN;for(let e=0;e<this.vertices.length;e++)e<this.vertices.length-1&&this.edges.push([this.vertices[e],this.vertices[e+1]]),this.xMin=isNaN(this.xMin)?this.vertices[e].x:Math.min(this.xMin,this.vertices[e].x),this.xMax=isNaN(this.xMax)?this.vertices[e].x:Math.max(this.xMax,this.vertices[e].x),this.yMin=isNaN(this.yMin)?this.vertices[e].y:Math.min(this.yMin,this.vertices[e].y),this.yMax=isNaN(this.yMax)?this.vertices[e].y:Math.max(this.yMax,this.vertices[e].y);this._bounds=null,this._boundingRect=null}}containsPoint(e){return Ks(this,e)}intersectsCircle(e){return Xs(e,this)}intersectsLine(e){return Gs(this,H(e))}intersectsRect(e){return Js(this,j(e))}intersectsPolygon(e){return ra(this,e)}intersectsGeoPolygon(e){return oa(e,this)}points(){return this.vertices}bounds(){return this._bounds||(this._bounds=[{x:this.xMin,y:this.yMin},{x:this.xMax,y:this.yMin},{x:this.xMax,y:this.yMax},{x:this.xMin,y:this.yMax}]),this._bounds}boundingRect(){return this._boundingRect||(this._boundingRect={x:this.xMin,y:this.yMin,width:this.xMax-this.xMin,height:this.yMax-this.yMin}),this._boundingRect}}function ad(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return new sd(...t)}function ld(e){const t=e[0],n=e[e.length-1];t.x===n.x&&t.y===n.y||e.push(t)}function cd(e){for(let t=0;t<e.length-1;t++){const n=e[t],i=e[t+1];n.x===i.x&&n.y===i.y&&(e.splice(t,1),t--)}}class ud{constructor(){let{vertices:e=[[]]}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.set({vertices:e})}set(){let{vertices:e=[]}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.type="geopolygon",this.vertices=e.slice(),this.numPolygons=this.vertices.length,this.polygons=[],this.xMin=NaN,this.yMin=NaN,this.xMax=NaN,this.yMax=NaN;for(let e=0;e<this.numPolygons;e++)cd(this.vertices[e]),this.vertices[e].length>2&&ld(this.vertices[e]),this.polygons[e]=ad({vertices:this.vertices[e]}),this.xMin=isNaN(this.xMin)?this.polygons[e].xMin:Math.min(this.xMin,this.polygons[e].xMin),this.xMax=isNaN(this.xMax)?this.polygons[e].xMax:Math.max(this.xMax,this.polygons[e].xMax),this.yMin=isNaN(this.yMin)?this.polygons[e].yMin:Math.min(this.yMin,this.polygons[e].yMin),this.yMax=isNaN(this.yMax)?this.polygons[e].yMax:Math.max(this.yMax,this.polygons[e].yMax);this._bounds=null,this._boundingRect=null}containsPoint(e){return aa(this,e)}intersectsCircle(e){return sa(e,this)}intersectsLine(e){return la(this,H(e))}intersectsRect(e){return ca(this,j(e))}intersectsPolygon(e){return oa(this,e)}intersectsGeoPolygon(e){return function(e,t){const n=e.boundingRect(),i=t.boundingRect();return!!Zs(n,i)&&(Qs(i,n)?$s(t,e):$s(e,t))}(this,e)}points(){return this.vertices}bounds(){return this._bounds||(this._bounds=[{x:this.xMin,y:this.yMin},{x:this.xMax,y:this.yMin},{x:this.xMax,y:this.yMax},{x:this.xMin,y:this.yMax}]),this._bounds}boundingRect(){return this._boundingRect||(this._boundingRect={x:this.xMin,y:this.yMin,width:this.xMax-this.xMin,height:this.yMax-this.yMin}),this._boundingRect}}function hd(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return new ud(...t)}class dd{constructor(){let{points:e=[]}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.set({points:e})}set(){let{points:e=[]}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(this.type="polyline",this.segments=[],this._points=e.slice(),this._points.length>1)for(let e=0,i=this._points.length-1;e<i;e++)t=this._points[e],n=this._points[e+1],(t.x!==n.x||t.y!==n.y)&&this.segments.push({x1:this._points[e].x,y1:this._points[e].y,x2:this._points[e+1].x,y2:this._points[e+1].y});var t,n}containsPoint(e){return this.segments.some((t=>ia(t,e)))}intersectsCircle(e){return this.segments.some((t=>Ys(e,t)))}intersectsLine(e){const t=H(e);return this.segments.some((e=>na(e,t)))}intersectsRect(e){const t=j(e);return this.segments.some((e=>ta(t,e)))}intersectsPolygon(e){return this.segments.some((t=>Gs(e,t)))}intersectsGeoPolygon(e){return this.segments.some((t=>la(e,t)))}points(){return this._points}}const fd=Ue();function pd(e,t){return fd.get(e)(t)}fd.add("rect",(function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return new id(...t)})),fd.add("circle",(function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return new rd(...t)})),fd.add("line",(function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return new od(...t)})),fd.add("polygon",ad),fd.add("geopolygon",hd),fd.add("polyline",(function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return new dd(...t)}));class md{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];this.set(e)}set(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];this.geometries=[],e.forEach((e=>{const t=pd(e.type,e);t&&this.geometries.push(t)}))}containsPoint(e){return this.geometries.some((t=>t.containsPoint(e)))}intersectsLine(e){return this.geometries.some((t=>t.intersectsLine(e)))}intersectsRect(e){return this.geometries.some((t=>t.intersectsRect(e)))}intersectsCircle(e){return this.geometries.some((t=>t.intersectsCircle(e)))}intersectsPolygon(e){return this.geometries.some((t=>t.intersectsPolygon(e)))}intersectsGeoPolygon(e){return this.geometries.some((t=>t.intersectsGeoPolygon(e)))}}class gd{constructor(){this._elements=[[1,0,0],[0,1,0],[0,0,1]],this._stack=[]}clone(){return(new gd).multiply(this)}set(e){return this._elements=e,this}save(){return this._stack.push(this.elements),this}restore(){return this._stack.length&&(this._elements=this._stack.pop()),this}add(e){let t,n;for(t=0;t<this._elements.length;t++)for(n=0;n<this._elements[t].length;n++)this._elements[t][n]+=e;return this}translate(e,t){return this.multiply([[1,0,e],[0,1,t],[0,0,1]]),this}rotate(e){let t=Math.cos(-e),n=Math.sin(-e);return this.multiply([[t,n,0],[-n,t,0],[0,0,1]]),this}multiply(e){let t,n,i,r;if(e instanceof gd&&(e=e._elements),Array.isArray(e)){for(i=[[0,0,0],[0,0,0],[0,0,0]],t=0;t<this._elements.length;t++)for(n=0;n<this._elements[t].length;n++)for(r=0;r<3;r++)i[t][n]+=this._elements[t][r]*e[r][n];this._elements=i}else for(t=0;t<this._elements.length;t++)for(n=0;n<this._elements[t].length;n++)this._elements[t][n]*=e;return this}scale(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:e;return this.multiply([[e,0,0],[0,t,0],[0,0,1]]),this}transform(e,t,n,i,r,o){return this.multiply([[e,n,r],[t,i,o],[0,0,1]]),this}determinant(){let e=this._elements[0][0],t=this._elements[0][1],n=this._elements[0][2],i=this._elements[1][0],r=this._elements[1][1],o=this._elements[1][2],s=this._elements[2][0],a=this._elements[2][1],l=this._elements[2][2],c=0;return c=e*r*l+t*o*s+n*i*a-n*r*s-t*i*l-e*o*a,c}invert(){let e=this.determinant(),t=this._elements[0][0],n=this._elements[0][1],i=this._elements[0][2],r=this._elements[1][0],o=this._elements[1][1],s=this._elements[1][2],a=this._elements[2][0],l=this._elements[2][1],c=this._elements[2][2];return this._elements=[[o*c-s*l,i*l-n*c,n*s-i*o],[s*a-r*c,t*c-i*a,i*r-t*s],[r*l-o*a,a*n-t*l,t*o-n*r]],this.multiply(1/e),this}transpose(){const e=Object.create(this._elements);return this._elements=[[e[0][0],e[1][0],e[2][0]],[e[0][1],e[1][1],e[2][1]],[e[0][2],e[1][2],e[2][2]]],this}identity(){return this._elements=[[1,0,0],[0,1,0],[0,0,1]],this}toString(){return"".concat(this._elements.map((e=>e.join("\t"))).join("\n"))}isIdentity(){const e=this._elements;return 1===e[0][0]&&0===e[0][1]&&0===e[0][2]&&0===e[1][0]&&1===e[1][1]&&0===e[1][2]&&0===e[2][0]&&0===e[2][1]&&1===e[2][2]}transformPoint(e){let t,n,i=[e.x,e.y,1],r=this._elements,o=[0,0,0];for(t=0;t<this._elements.length;t++)for(n=0;n<this._elements[t].length;n++)o[t]+=i[n]*r[t][n];return{x:o[0],y:o[1]}}transformPoints(e){let t,n,i,r,o,s=this._elements,a=[];for(r=0;r<e.length;r++){for(t=[e[r].x,e[r].y,1],o=[0,0,0],n=0;n<this._elements.length;n++)for(i=0;i<this._elements[n].length;i++)o[n]+=t[i]*s[n][i];a.push({x:o[0],y:o[1]})}return a}get elements(){const e=this._elements;return[[e[0][0],e[0][1],e[0][2]],[e[1][0],e[1][1],e[1][2]],[e[2][0],e[2][1],e[2][2]]]}}const yd=/(translate|scale|rotate|matrix)\(([0-9,.eE+-\s]+)(?:,|\s?)+\)/g;function vd(e,t){const n=t.args[0]*(Math.PI/180);if(t.args.length>2){const i=t.args[1],r=t.args[2];e.translate(i,r),e.rotate(n),e.translate(-i,-r)}else 1===t.args.length&&e.rotate(n)}function bd(e,t){const n=t.args[0],i=isNaN(t.args[1])?t.args[0]:t.args[1];e.scale(n,i)}function xd(e,t){const n=t.args[0],i=isNaN(t.args[1])?0:t.args[1];e.translate(n,i)}function wd(e,t){t.args.length>=6&&e.transform(...t.args)}function qd(e,t){const n=function(e){let t,n=[];for(;null!==(t=yd.exec(e));){const e=t[2].trim(),i=-1===e.indexOf(",")?e.split(" "):e.split(",");n.push({cmd:t[1],args:i.filter((e=>e.trim().length>0)).map((e=>Number(e)))})}return n}(e);let i;for(let e=0,r=n.length;e<r;e++)i=n[e],"rotate"===i.cmd?vd(t,i):"scale"===i.cmd?bd(t,i):"matrix"===i.cmd?wd(t,i):"translate"===i.cmd&&xd(t,i)}const Sd={type:/^\w[\w-]+/,attr:/^\[\w(?:[\w\._-]+)?(?:[!]?=['\"][\w\s*#_-]*['\"])?\]/,universal:/^(\*)/,tag:/^\.(\w+)/},Md={type:(e,t)=>t.filter((t=>{const n=t.type;return!!n&&n.toLowerCase()===e.toLowerCase()})),attr:(e,t,n,i)=>i.filter((i=>{const r=i.attrs[e];if(!t)return void 0!==r;if(void 0===r)return!1;switch(t){case"=":return n===String(r);case"!=":return n!==String(r);default:return!1}})),universal:e=>e,tag:(e,t)=>t.filter((t=>{const n=t.tag;return!!n&&-1!==n.trim().split(/\s+/).indexOf(e.replace(".",""))}))};function Dd(e,t){if(!t||!t.length||!e||"function"!=typeof Md[e.type])return[];switch(e.type){case"type":case"tag":return Md[e.type](e.value,t);case"attr":return Md[e.type](e.attribute,e.operator,e.attributeValue,t);case"universal":return Md[e.type](t);default:return[]}}var _d={find:function(e,t){const n=[],i=[];let r,o;if(t.isBranch){let s;r=function(e){const t=[];let n,i,r,o;return e.split(/\s*,\s*/).forEach((e=>{e=e.trim(),n=[];const s=t=>{r=e.match(Sd[t]),r&&(o=!0,e=e.slice(r[0].length),i={type:t,value:r[0]},"attr"===t&&(r=r[0].match(/\[(\w[\w\._-]+)?(?:([!]?=)['\"]([\w\s#_-]*)['\"])?\]/),i.attribute=r[1],i.operator=r[2],i.attributeValue=r[3]),n.push(i))};for(;e&&(o=!1,r=e.match(/^\s*([>+~]|\s)\s*/),r&&(o=!0,n.push({type:" ",value:r[0]}),e=e.slice(r[0].length)),Object.keys(Sd).forEach(s),n&&n.length&&t.indexOf(n)<0&&t.push(n),o););})),t}(e),o=t.descendants;for(let e=0,t=r.length;e<t;e++){s=r[e];const t=[];let n=o.slice(),a=!1;s.reverse().forEach((e=>{if(" "===e.type)return t.push(n),n=o.slice(),void(a=!1);n=Dd(e,n),a=!0})),a&&t.push(n);const l=t[0].filter((e=>{let n,i=e.parent;for(let e=1;e<t.length;e++){for(n=t[e].indexOf(i);i&&n<0;)i=i.parent,n=t[e].indexOf(i);if(n<0)return!1}return!0}));i.push(l)}for(let e=0,t=i.length;e<t;e++)for(let t=0,r=i[e].length;t<r;t++)n.indexOf(i[e][t])<0&&n.push(i[e][t])}return n||[]}};function Cd(e,t,n){const i=e.type;let r=e.points();n&&(r=r.every((e=>Array.isArray(e)))?r.map((e=>n.transformPoints(e))):n.transformPoints(r)),function(e,t){for(let n=0,i=e.length;n<i;n++)e[n].x/=t,e[n].y/=t}(r,t);let o=null;if("rect"===i||"bounds"===i)o=j(r),o.type=i;else if("circle"===i)o=function(e,t){return{cx:e[0].x,cy:e[0].y,r:t}}(r,e.r),o.type=i;else if("line"===i)o=H(r),o.type=i;else if("polygon"===i||"polyline"===i){o={type:"path",d:hs(r,"polygon"===i)}}else if("geopolygon"===i){let e="";for(let t=0;t<r.length;t++)e+=hs(r[t],!0);o={type:"path",d:e}}return o}class kd{constructor(e){this._bounds=function(){let t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];const{x:n,y:i,width:r,height:o}=e.boundingRect?e.boundingRect(t):{x:0,y:0,width:0,height:0};return{x:n,y:i,width:r,height:o}},this._attrs=e.attrs,this._type=e.type,this._data=e.data,this._dpi=e.stage?e.stage.dpi:1,this._collider=()=>function(e,t){if(e.collider){const n=e.modelViewMatrix;return"collection"===e.colliderType?{type:"container",children:e.collider.geometries.map((e=>Cd(e,t,n)))}:Cd(e.collider,t,n)}return null}(e,this._dpi),this._desc=e.desc,this._tag=e.tag,this._children=()=>e.children.map((e=>new kd(e))),this._parent=()=>e.parent?new kd(e.parent):null,this._cache={elementBoundingRect:null},this._getElementBoundingRect=()=>(!this._cache.elementBoundingRect&&this.element&&(this._cache.elementBoundingRect=this.element.getBoundingClientRect()),this._cache.elementBoundingRect||{left:0,top:0})}get children(){return this._children()}get parent(){return this._parent()}get type(){return this._type}get data(){return this._data}get attrs(){return this._attrs}set element(e){this._cache.elementBoundingRect=null,this._element=e}get element(){return this._element}set key(e){this._key=e}get key(){return this._key}get bounds(){const e=this._bounds();return e.x/=this._dpi,e.y/=this._dpi,e.width/=this._dpi,e.height/=this._dpi,e}get localBounds(){return this._bounds(!1)}boundsRelativeTo(e){const t=typeof e,n=!(arguments.length>1&&void 0!==arguments[1])||arguments[1]?this.bounds:this.localBounds,i=this._getElementBoundingRect();let r=i.left,o=i.top;if("object"===t&&null!==e&&"function"==typeof e.getBoundingClientRect){const{left:t=0,top:n=0}=e.getBoundingClientRect();r-=t,o-=n}return n.x+=r,n.y+=o,n}get collider(){return this._collider()}get desc(){return this._desc}get tag(){return this._tag}}function Ed(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return new kd(...t)}class Ad{constructor(e){this._node=Ed(e),this._parent=null,this._input=null}get node(){return this._node}set parent(e){this._parent=e}get parent(){return this._parent}set input(e){this._input=e}get input(){return this._input}}function Td(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return new Ad(...t)}function Id(e,t){const n=e.parent;if(n&&"stage"!==n.type){t.parent=Td(n);const e=n.parent;e&&"stage"!==e.type&&Id(e,t.parent)}}function Rd(e,t,n){if(null===e.colliderType)return null;const i=function(e,t){let n={};if(e.modelViewMatrix)if(Array.isArray(t))n=e.inverseModelViewMatrix.transformPoints(t);else if(isNaN(t.r))Array.isArray(t.vertices)?n.vertices=e.inverseModelViewMatrix.transformPoints(t.vertices):n=e.inverseModelViewMatrix.transformPoint(t);else{const i={x:t.cx,y:t.cy};({x:n.cx,y:n.cy}=e.inverseModelViewMatrix.transformPoint(i)),n.r=t.r}else n=t;return Array.isArray(n.vertices)&&(n=n.vertices.every((e=>Array.isArray(e)))?hd(n):ad(n)),n}(e,n);return"frontChild"===e.colliderType?function(e,t,n){for(let i=e.descendants.length-1;i>=0;i--){const r=e.descendants[i];if(null!==r.collider&&r.collider[t](n)){const e=Td(r);return Id(r,e),e}}return null}(e,t,i):function(e,t,n){if(e.collider[t](n)){const t=Td(e);return Id(e,t),t}return null}(e,t,i)}function Od(e,t,n,i){const r=e.length;for(let o=0;o<r;o++){const r=e[o],s=Rd(r,t,i);s&&n.push(s),!r.children||s||r.collider||Od(r.children,t,n,i)}}function Nd(e,t,n){const i=e.length;for(let r=0;r<i;r++){const i=e[r];if(null!==Rd(i,t,n))return!0;if(i.children&&!i.collider)return Nd(i.children,t,n)}return!1}function Pd(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;let n={};switch(B(e)){case"circle":return n.cx=e.cx*t,n.cy=e.cy*t,n.r=e.r,["intersectsCircle",n];case"rect":return n=z(e).map((e=>ys(e,t))),["intersectsRect",n];case"line":return n=F(e).map((e=>ys(e,t))),["intersectsLine",n];case"point":return n=ys(e,t),["containsPoint",n];case"polygon":return n.vertices=e.vertices.map((e=>ys(e,t))),["intersectsPolygon",n];case"geopolygon":return n.vertices=e.vertices.map((e=>e.map((e=>ys(e,t))))),["intersectsGeoPolygon",n];default:return[]}}function Ld(e,t){const[n,i]=Pd(t,e.dpi),r=[];return n&&(Od([e],n,r,i),function(e,t){for(let n=0,i=t.length;n<i;n++)t[n].input=e}(t,r)),r}function Fd(e,t){const[n,i]=Pd(t,e.dpi);return Nd([e],n,i)}class zd extends nd{constructor(e){super(e),this._stage=null,this._collider={type:null,definition:null,fn:null},this._attrs={},this._node=null}set(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.node=e;const{data:t,desc:n,tag:i,strokeReference:r,fillReference:o}=e;var s,a;s=this.attrs,a=e,Object.keys(us).forEach((e=>{const t=a[e];void 0!==t&&(s[us[e]]=t)})),void 0!==t&&(this.data=t),"object"==typeof n&&(this.desc=E(!0,{},n)),"string"==typeof i&&(this.tag=i),"string"==typeof r&&(this.strokeReference=r),"string"==typeof o&&(this.fillReference=o)}findShapes(e){return _d.find(e,this).map((e=>Ed(e)))}getItemsFrom(e){return Ld(this,e)}containsPoint(e){return Fd(this,e)}intersectsLine(e){return Fd(this,e)}intersectsRect(e){return Fd(this,e)}intersectsCircle(e){return Fd(this,e)}intersectsPolygon(e){return Fd(this,e)}intersectsGeoPolygon(e){return Fd(this,e)}resolveLocalTransform(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new gd;void 0!==this.attrs.transform&&qd(this.attrs.transform,e),this.modelViewMatrix=e.clone()}resolveGlobalTransform(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new gd;const t=this.ancestors;if(t.length>0)for(let n=t.length-1;n>=0;n--)t[n].resolveLocalTransform(e),e=t[n].modelViewMatrix;this.resolveLocalTransform(e)}attr(e){return this.attrs[e]}equals(e){const t=this.attrs,n=Object.keys(t),i=e.attrs,r=Object.keys(i);if(n.length!==r.length)return!1;for(let e=0;e<n.length;e++){const r=n[e];if(!Object.hasOwnProperty.call(i,r))return!1;if(t[r]!==i[r])return!1}return super.equals(e)}toJSON(){const e=super.toJSON();return e.attrs=this.attrs,e}get attrs(){return this._attrs}get stage(){return this._parent&&!this._stage?this._stage=this._parent.stage:this._parent||this._stage===this||(this._stage=null),this._stage}set modelViewMatrix(e){this._mvm=e,this._imvm=null}get modelViewMatrix(){return this._mvm}get inverseModelViewMatrix(){return this._imvm=this._imvm?this._imvm:this._mvm.clone().invert(),this._imvm}set node(e){this._node=e}get node(){return this._node}set collider(e){const t=Array.isArray(e)?"collection":e&&e.type;return"string"!=typeof t?(this._collider.type=null,this._collider.definition=null,void(this._collider.fn=null)):null!==this._collider&&this._collider.type===t&&null!==this._collider.fn?(this._collider.fn.set(e),void(this._collider.definition=e)):(this._collider.type=t,void(this._collider.definition=e))}get collider(){if(null!==this._collider.fn)return this._collider.fn;switch(this._collider.type){case"collection":this._collider.fn=function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return new md(...t)}(this._collider.definition);break;case"frontChild":return!0;case"bounds":this._collider.fn=pd("rect",this.boundingRect());break;case"line":case"rect":case"circle":case"polygon":case"geopolygon":case"polyline":this._collider.fn=pd(this._collider.type,this._collider.definition);break;default:return null}return this._collider.fn}get colliderType(){return this._collider.type}}class jd extends nd{addChild(e){if(!(e&&e instanceof nd))throw new TypeError("Expecting a Node as argument, but got ".concat(e));if(e===this)throw new Error("Can not add itself as child!");if(e._children&&e._children.length&&this.ancestors.indexOf(e)>=0)throw new Error("Can not add an ancestor as child!");return e._parent&&e._parent!==this&&e._parent.removeChild(e),this._children.push(e),e._parent=this,e._ancestors=null,this}addChildren(e){let t,n=e?e.length:0;for(t=0;t<n;t++)this.addChild(e[t]);return this}removeChild(e){const t=this._children.indexOf(e);return t>=0&&(this._children.splice(t,1),e._parent=null,e._ancestors=null),this}removeChildren(e){let t,n;if(!this._children)return this;if(e)for(n=e.length,t=0;t<n;t++)this.removeChild(e[t]);else for(;this._children.length;)this.removeChild(this._children[0]);return this}}const Hd=jd.prototype;class Bd extends zd{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const{type:t="container"}=e;super(t),this.set(e)}set(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};super.set(e);const{collider:t}=e,n=E({type:null},t);this.collider=n,this.__boundingRect={true:null,false:null},this.__bounds={true:null,false:null}}appendChildRect(e,t){if(void 0!==e.bounds){const n=this.__boundingRect[t]||{},[i,,r]=e.bounds(t),{x:o,y:s}=i,{x:a,y:l}=r,c=isNaN(n.width)?a:Math.max(a,n.width+n.x),u=isNaN(n.height)?l:Math.max(l,n.height+n.y);n.x=isNaN(n.x)?o:Math.min(o,n.x),n.y=isNaN(n.y)?s:Math.min(s,n.y),n.width=c-n.x,n.height=u-n.y,this.__boundingRect[t]=n}}boundingRect(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(null!==this.__boundingRect[e])return this.__boundingRect[e];const t=this.children.length;for(let n=0;n<t;n++)this.appendChildRect(this.children[n],e);return this.__boundingRect[e]=E({x:0,y:0,width:0,height:0},this.__boundingRect[e]),this.__boundingRect[e]}bounds(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(null!==this.__bounds[e])return this.__bounds[e];const t=this.boundingRect(e);return this.__bounds[e]=[{x:t.x,y:t.y},{x:t.x+t.width,y:t.y},{x:t.x+t.width,y:t.y+t.height},{x:t.x,y:t.y+t.height}],this.__bounds[e]}addChild(e){const t=Hd.addChild.call(this,e);if(this._collider&&"bounds"===this._collider.type){this.appendChildRect(e,!0);const t=E({type:"bounds",x:0,y:0,width:0,height:0},this.__boundingRect.true);this.collider=t}return t}addChildren(e){const t=Hd.addChildren.call(this,e),n=e.length;if(this._collider&&"bounds"===this._collider.type&&n>0){for(let t=0;t<n;t++)this.appendChildRect(e[t],!0);const t=E({type:"bounds",x:0,y:0,width:0,height:0},this.__boundingRect.true);this.collider=t}return t}removeChild(e){e._stage=null;let t,n=e.descendants,i=n?n.length:0;for(t=0;t<i;t++)n[t]._stage=null;if(Hd.removeChild.call(this,e),this._collider&&"bounds"===this._collider.type){this.__boundingRect={true:null,false:null},this.__bounds={true:null,false:null};const e=E(this.boundingRect(!0),{type:"bounds"});this.collider=e}return this}removeChildren(e){if(Hd.removeChildren.call(this,e),this._collider&&"bounds"===this._collider.type){this.__boundingRect={true:null,false:null},this.__bounds={true:null,false:null};const e=E(this.boundingRect(!0),{type:"bounds"});this.collider=e}return this}}function Vd(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return new Bd(...t)}class $d extends Bd{constructor(e){super("stage"),this._stage=this,this._dpiRatio=e||1}get dpi(){return this._dpiRatio}}const Wd=jd.prototype,Ud=["x1","x2","y1","y2","id","offset","style"];class Yd extends zd{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const{type:t="container"}=e;super(t),this.set(e),this._boundingRect={}}set(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};super.set(e);const t=this.attrs;let n="";for(let i=0,r=Ud.length;i!==r;i++)n=Ud[i],void 0!==e[n]&&(t[n]=e[n])}addChild(e){return Wd.addChild.call(this,e)}addChildren(e){return Wd.addChildren.call(this,e)}removeChild(e){e._stage=null;let t,n=e.descendants,i=n?n.length:0;for(t=0;t<i;t++)n[t]._stage=null;return Wd.removeChild.call(this,e),this}removeChildren(e){return Wd.removeChildren.call(this,e),this}}function Xd(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return new Yd(...t)}const Kd=jd.prototype,Gd=["patternUnits","x","y","width","height","id"];class Jd extends zd{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const{type:t="container"}=e;super(t),this.set(e),this._boundingRect={}}set(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};super.set(e);const t=this.attrs;let n="";for(let i=0,r=Gd.length;i!==r;i++)n=Gd[i],void 0!==e[n]&&(t[n]=e[n])}addChild(e){return Kd.addChild.call(this,e)}addChildren(e){return Kd.addChildren.call(this,e)}removeChild(e){e._stage=null;let t,n=e.descendants,i=n?n.length:0;for(t=0;t<i;t++)n[t]._stage=null;return Kd.removeChild.call(this,e),this}removeChildren(e){return Kd.removeChildren.call(this,e),this}}let Zd=class extends zd{constructor(){super("rect"),this.set(...arguments)}set(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const{x:t=0,y:n=0,width:i=0,height:r=0,rx:o=0,ry:s=0,collider:a}=e,l=E({type:"rect",x:t,y:n,width:i,height:r},a);super.set(e),i>=0?(this.attrs.x=t,this.attrs.width=i):(this.attrs.x=t+i,this.attrs.width=-i),r>=0?(this.attrs.y=n,this.attrs.height=r):(this.attrs.y=n+r,this.attrs.height=-r),o>0&&(this.attrs.rx=o),s>0&&(this.attrs.ry=s),this.collider=l,this.__boundingRect={true:null,false:null},this.__bounds={true:null,false:null}}boundingRect(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(null!==this.__boundingRect[e])return this.__boundingRect[e];const t=z(this.attrs),n=e&&this.modelViewMatrix?this.modelViewMatrix.transformPoints(t):t,[i,r,o,s]=L(n);return this.__boundingRect[e]={x:i,y:r,width:o-i,height:s-r},this.__boundingRect[e]}bounds(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(null!==this.__bounds[e])return this.__bounds[e];const t=this.boundingRect(e);return this.__bounds[e]=[{x:t.x,y:t.y},{x:t.x+t.width,y:t.y},{x:t.x+t.width,y:t.y+t.height},{x:t.x,y:t.y+t.height}],this.__bounds[e]}};class Qd extends zd{constructor(){super("circle"),this.set(...arguments)}set(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const{cx:t=0,cy:n=0,r:i=0,collider:r}=e,o=E({type:"circle",cx:t,cy:n,r:i},r);super.set(e),this.attrs.cx=t,this.attrs.cy=n,this.attrs.r=i,this.collider=o,this.__boundingRect={true:null,false:null},this.__bounds={true:null,false:null}}boundingRect(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(null!==this.__boundingRect[e])return this.__boundingRect[e];const t=this.bounds(e);return this.__boundingRect[e]={x:t[0].x,y:t[0].y,width:t[2].x-t[0].x,height:t[2].y-t[0].y},this.__boundingRect[e]}bounds(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(null!==this.__bounds[e])return this.__bounds[e];const{cx:t,cy:n,r:i,r:r}=this.attrs,o=t-i,s=n-r;let a=2*i,l=2*r,c=[{x:o,y:s},{x:o+a,y:s},{x:o+a,y:s+l},{x:o,y:s+l}];if(e&&this.modelViewMatrix){c=this.modelViewMatrix.transformPoints(c);const[t,n,i,r]=L(c);a=i-t,l=r-n,this.__bounds[e]=[{x:t,y:n},{x:t+a,y:n},{x:t+a,y:n+l},{x:t,y:n+l}]}else this.__bounds[e]=c;return this.__bounds[e]}}class ef extends zd{constructor(){super("line"),this.set(...arguments)}set(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const{x1:t=0,y1:n=0,x2:i=0,y2:r=0,collider:o}=e;super.set(e),this.attrs.x1=t,this.attrs.y1=n,this.attrs.x2=i,this.attrs.y2=r;const s={type:"line",x1:t,y1:n,x2:i,y2:r};this.collider=E(s,o),this.__boundingRect={true:null,false:null},this.__bounds={true:null,false:null}}boundingRect(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(null!==this.__boundingRect[e])return this.__boundingRect[e];let t=F(this.attrs);e&&this.modelViewMatrix&&(t=this.modelViewMatrix.transformPoints(t));const[n,i,r,o]=L(t),s=n!==r||i!==o;return this.__boundingRect[e]={x:n,y:i,width:s?Math.max(1,r-n):0,height:s?Math.max(1,o-i):0},this.__boundingRect[e]}bounds(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(null!==this.__bounds[e])return this.__bounds[e];const t=this.boundingRect(e);return this.__bounds[e]=[{x:t.x,y:t.y},{x:t.x+t.width,y:t.y},{x:t.x+t.width,y:t.y+t.height},{x:t.x,y:t.y+t.height}],this.__bounds[e]}}const tf=Math.PI/2;function nf(e,t){const n=Math.atan2(t.y-e.y,t.x-e.x);return n<0?n+2*Math.PI:n}function rf(e,t,n){return{x:e.x+Math.cos(t)*n,y:e.y+Math.sin(t)*n}}const of={step:function(e){return new je(e,.5)},stepAfter:function(e){return new je(e,1)},stepBefore:function(e){return new je(e,0)},linear:ye,basis:function(e){return new De(e)},cardinal:ke.tension(0),catmullRom:Ae,monotonex:function(e){return new Ne(e)},monotoney:function(e){return new Pe(e)},natural:function(e){return new Fe(e)}};function sf(e){if(e.length<2)return!1;const t=e[0],n=e[e.length-1];return Math.abs(t.x-n.x)<1e-12&&Math.abs(t.y-n.y)<1e-12}class af extends zd{constructor(){super("path"),this.set(...arguments)}set(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(super.set(e),this.segments=[],this.points=[],e.arcDatum){const t=me();t.innerRadius(e.desc.slice.innerRadius),t.outerRadius(e.desc.slice.outerRadius),t.cornerRadius(e.desc.slice.cornerRadius);const n=t(e.arcDatum);this.attrs.d=n}else if(e.points){const{major:t,minor:n,layerObj:i,points:r,stngs:o,generatorType:s}=e,a=xe(),l=o.coordinates?o.coordinates.defined:null;a[t.p]((e=>e.major*t.size))["".concat(n.p,"1")]((e=>e.minor*n.size))["".concat(n.p,"0")]((e=>e.minor0*n.size)).curve(of["monotone"===i.curve?"monotone".concat(t.p):i.curve]),l?a.defined((e=>!e.dummy&&"number"==typeof e.minor&&!isNaN(e.minor)&&e.defined)):a.defined((e=>!e.dummy&&"number"==typeof e.minor&&!isNaN(e.minor)));const c=o.connect?r.filter(a.defined()):r,u=("area"===s?a:a[s]())(c);this.attrs.d=u}else e.d&&(this.attrs.d=e.d);if(this.__boundingRect={true:null,false:null},this.__bounds={true:null,false:null},Array.isArray(e.collider)||"object"==typeof e.collider&&void 0!==e.collider.type)this.collider=e.collider;else if(this.attrs.d){if(this.segments=Qh(this.attrs.d),this.segments.length>1&&this.segments.every((e=>sf(e))))return void(this.collider=E({type:"geopolygon",vertices:this.segments},e.collider));this.segments.forEach((t=>{if(t.length<=1);else if(sf(t))this.collider=E({type:"polygon",vertices:t},e.collider);else if("object"==typeof e.collider&&e.collider.visual){const n=this.attrs["stroke-width"]/2;this.collider=function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const i=[],r=[];if("h"===n.forceOrientation){const t=e[0].x<e[1].x?-1:1,n=e[e.length-1].x>e[e.length-2].x?1:-1;e.unshift({x:e[0].x+t,y:e[0].y}),e.push({x:e[e.length-1].x+n,y:e[e.length-1].y})}else if("v"===n.forceOrientation){const t=e[0].y<e[1].y?-1:1,n=e[e.length-1].y>e[e.length-2].y?1:-1;e.unshift({x:e[0].x,y:e[0].y+t}),e.push({x:e[e.length-1].x,y:e[e.length-1].y+n})}const o=e.length-1;for(let n=1;n<o;n++){const s=e[n-1],a=e[n],l=e[n+1],c=nf(a,s),u=nf(a,l),h=(c+u)/2,d=h+Math.PI,f=Math.max(h,d),p=Math.min(h,d),m=c>u;if(1===n){const e=nf(s,a);i.push(rf(s,e-tf,t)),r.unshift(rf(s,e+tf,t))}const g=m?f:p,y=m?p:f;if(i.push(rf(a,g,t)),r.unshift(rf(a,y,t)),n===o-1){const e=nf(l,a);i.push(rf(l,e+tf,t)),r.unshift(rf(l,e-tf,t))}}return{type:"polygon",vertices:[...i,...r]}}(t,n,e.collider)}else this.collider=E({type:"polyline",points:t},e.collider)}))}}boundingRect(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(null!==this.__boundingRect[e])return this.__boundingRect[e];this.points.length||(this.segments=this.segments.length?this.segments:Qh(this.attrs.d),this.points=function(e){const t=[];let n,i=e.length;for(let r=0;r<i;r++){n=e[r];for(let e=0;e<n.length;e++)t.push(n[e])}return t}(this.segments));const t=e&&this.modelViewMatrix?this.modelViewMatrix.transformPoints(this.points):this.points,[n,i,r,o]=L(t);return this.__boundingRect[e]={x:n||0,y:i||0,width:r-n||0,height:o-i||0},this.__boundingRect[e]}bounds(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(null!==this.__bounds[e])return this.__bounds[e];const t=this.boundingRect(e);return this.__bounds[e]=[{x:t.x,y:t.y},{x:t.x+t.width,y:t.y},{x:t.x+t.width,y:t.y+t.height},{x:t.x,y:t.y+t.height}],this.__bounds[e]}}function lf(e){let{data:t,_boundingRect:n,_textBoundsFn:i}=e;return null!=t&&(n||i)}class cf extends zd{constructor(){super("text"),this.set(...arguments)}set(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const{x:t=0,y:n=0,dx:i=0,dy:r=0,textBoundsFn:o,text:s,title:a,collider:l,boundingRect:c,ellipsed:u}=e;super.set(e),this.attrs.x=t,this.attrs.y=n,this.attrs.dx=i,this.attrs.dy=r,this.attrs.text=s,void 0!==a&&(this.attrs.title=String(a)),"object"==typeof c?this._textBoundsFn=()=>c:"function"==typeof o&&(this._textBoundsFn=o),"string"==typeof u&&(this.ellipsed=u),this.collider=E({type:lf(this)?"bounds":null},l),this.__boundingRect={true:null,false:null},this.__bounds={true:null,false:null}}boundingRect(){let e,t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(null!==this.__boundingRect[t])return this.__boundingRect[t];if("function"!=typeof this._textBoundsFn)return{x:0,y:0,width:0,height:0};e=this._textBoundsFn(this.attrs);const n=z(e),i=t&&this.modelViewMatrix?this.modelViewMatrix.transformPoints(n):n,[r,o,s,a]=L(i);return this.__boundingRect[t]={x:r,y:o,width:s-r,height:a-o},this.__boundingRect[t]}bounds(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(null!==this.__bounds[e])return this.__bounds[e];const t=this.boundingRect(e);return this.__bounds[e]=[{x:t.x,y:t.y},{x:t.x+t.width,y:t.y},{x:t.x+t.width,y:t.y+t.height},{x:t.x,y:t.y+t.height}],this.__bounds[e]}}const uf=Ue();function hf(e,t){return uf.get(e)(t)}uf.add("rect",(function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return new Zd(...t)})),uf.add("circle",(function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return new Qd(...t)})),uf.add("text",(function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return new cf(...t)})),uf.add("line",(function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return new ef(...t)})),uf.add("path",(function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return new af(...t)})),uf.add("stage",(function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return new $d(...t)})),uf.add("container",Vd),uf.add("defs",Vd),uf.add("linearGradient",Xd),uf.add("radialGradient",Xd),uf.add("stop",Xd),uf.add("pattern",(function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return new Jd(...t)}));const df=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];const t=[{}];function n(){return t[t.length-1]}return n.save=function(){let i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const r=n(),o={};let s="";for(let t=0;t<e.length;t++)s=e[t],void 0!==r[s]&&(o[s]=r[s]);return E(o,i),t.push(o),n()},n.restore=function(){t.splice(t.length-1,1)},n}(["stroke","fill","strokeWidth","opacity","fontFamily","fontSize","baseline"]);function ff(e,t){if(Array.isArray(t))for(let n=0,i=t.length;n<i;n++)t[n](e)}function pf(e,t,n){e.node=n[t],e.index=t}function mf(e,t,n,i){let r=!1;const o={siblings:e,node:null,index:0};for(let s=0,a=e.length;s<a;s++){if(pf(o,s,e),ff(o,i.create),r="function"==typeof o.node.disabled?o.node.disabled():o.node.disabled,r)continue;o.node=df.save(o.node);const a=hf(o.node.type,o.node);a&&(o.node.transform&&(n.save(),qd(o.node.transform,n)),n.isIdentity()||(a.modelViewMatrix=n.clone()),t.addChild(a),o.node.children&&mf(o.node.children,a,n,i),o.node.transform&&n.restore()),df.restore()}}function gf(e){let{items:t,stage:n,dpi:i,on:r={}}=e;return n||(n=hf("stage",i)),mf(t,n,new gd,r),n}function yf(e,t,n){const{orientation:i,degree:r,stops:o=[]}=n;let s=null;if("radial"===i){const n=t.boundingRect();s=e.createRadialGradient(n.x+n.width/2,n.y+n.height/2,1e-5,n.x+n.width/2,n.y+n.height/2,Math.max(n.width,n.height)/2)}else{const i=ps(r);["x1","x2","y1","y2"].forEach((e=>{e in n&&(i[e]=n[e])}));const o=t.boundingRect();s=e.createLinearGradient(o.x+i.x1*o.width,o.y+i.y1*o.height,o.x+i.x2*o.width,o.y+i.y2*o.height)}for(let e=0,t=o.length;e<t;e++){let t=o[e];s.addColorStop(t.offset,t.color)}return s}function vf(e,t,n){return t.width=e.width,t.height=e.height,n.save(),n.fillStyle=e.fill,e.shapes.forEach((e=>{if("rect"===e.type)n.rect(e.x,e.y,e.width,e.height)})),n.fill(),n.restore(),n.createPattern(t,"repeat")}function bf(){let{x:e,y:t,width:n,height:i,scaleRatio:r,margin:o,edgeBleed:s}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const a={x:0,y:0,width:0,height:0,scaleRatio:{x:1,y:1},margin:{left:0,top:0},edgeBleed:{left:0,right:0,top:0,bottom:0,bool:!1}};return a.x=isNaN(e)?a.x:e,a.y=isNaN(t)?a.y:t,a.width=isNaN(n)?a.width:n,a.height=isNaN(i)?a.height:i,void 0!==r&&(a.scaleRatio.x=isNaN(r.x)?a.scaleRatio.x:r.x,a.scaleRatio.y=isNaN(r.y)?a.scaleRatio.y:r.y),void 0!==o&&(a.margin.left=isNaN(o.left)?0:o.left,a.margin.top=isNaN(o.top)?0:o.top),"object"==typeof s&&["left","right","top","bottom"].forEach((e=>{!isNaN(s[e])&&s[e]>0&&(a.edgeBleed[e]=s[e],a.edgeBleed.bool=!0)})),a.computedPhysical={x:Math.round(a.margin.left+(a.x-a.edgeBleed.left)*a.scaleRatio.x),y:Math.round(a.margin.top+(a.y-a.edgeBleed.top)*a.scaleRatio.y),width:Math.round((a.width+a.edgeBleed.left+a.edgeBleed.right)*a.scaleRatio.x),height:Math.round((a.height+a.edgeBleed.top+a.edgeBleed.bottom)*a.scaleRatio.y)},a}function xf(){const e={element:()=>{},root:()=>{},settings:()=>{},appendTo:()=>{},getScene:()=>[],render:()=>!1,itemsAt:()=>[],findShapes:()=>[],clear:()=>{},destory:()=>{},size:()=>{},measureText:Yu,textBounds:Ku,setKey:t=>{e.element().setAttribute("data-key",t)}};return e}function wf(e){return t=>{let{node:n}=t;"text"===n.type&&function(e){return null!=e}(n.data)&&!n.textBoundsFn&&(n.textBoundsFn=e.textBounds)}}const qf=200,Sf=200;class Mf{constructor(e){this.targetCanvas=e,this.bufferCanvas=e.cloneNode()}updateSize(e){let t,{rect:n,dpiRatio:i,canvasBufferSize:r}=e;t=r?"function"==typeof r?r(n):r:{width:n.computedPhysical.width+2*qf,height:n.computedPhysical.height+2*Sf},this.bufferCanvas.style.width="".concat(t.width,"px"),this.bufferCanvas.style.height="".concat(t.height,"px"),this.bufferCanvas.width=Math.round(t.width*i),this.bufferCanvas.height=Math.round(t.height*i)}apply(){this.targetCanvas.getContext("2d").drawImage(this.bufferCanvas,0,0)}clear(){this.bufferCanvas.width=this.bufferCanvas.width}getContext(){return this.bufferCanvas.getContext("2d")}}const Df=Ue();function _f(e){return Array.isArray(e)?e:"string"==typeof e?-1!==e.indexOf(",")?e.split(","):e.split(" "):[]}function Cf(e){return("undefined"==typeof window?1:window.devicePixelRatio||1)/(e.webkitBackingStorePixelRatio||e.mozBackingStorePixelRatio||e.msBackingStorePixelRatio||e.oBackingStorePixelRatio||e.backingStorePixelRatio||1)}function kf(e,t){t.setTransform(e[0][0],e[1][0],e[0][1],e[1][1],e[0][2],e[1][2])}function Ef(e,t,n){let i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};const r=Object.keys(i);for(let r=0,o=n.length;r<o;r++){let o=n[r];const s=o[0],a=o[1],l=o[2];if(s in t.attrs&&!(a in i)&&e[a]!==t.attrs[s]){const n=l?l(t.attrs[s]):t.attrs[s];"function"==typeof e[a]?e[a](n):e[a]=n}}for(let t=0,n=r.length;t<n;t++){const n=r[t];e[n]=i[n]}}function Af(e,t,n,i){for(let r=0,o=e.length;r<o;r++){let o=e[r],s={};t.save(),o.attrs&&(o.attrs.fill||o.attrs.stroke)&&(o.attrs.fill&&"object"==typeof o.attrs.fill&&"gradient"===o.attrs.fill.type?s.fillStyle=yf(t,o,o.attrs.fill):o.attrs.fill&&"object"==typeof o.attrs.fill&&"pattern"===o.attrs.fill.type&&(s.fillStyle=i.patterns.create(o.attrs.fill)),o.attrs.stroke&&"object"==typeof o.attrs.stroke&&"gradient"===o.attrs.stroke.type?s.strokeStyle=yf(t,o,o.attrs.stroke):o.attrs.stroke&&"object"==typeof o.attrs.stroke&&"pattern"===o.attrs.stroke.type&&(s.strokeStyle=i.patterns.create(o.attrs.stroke))),Ef(t,o,n,s),o.modelViewMatrix&&kf(o.modelViewMatrix.elements,t),Df.has(o.type)&&Df.get(o.type)(o.attrs,{g:t,doFill:"fill"in o.attrs&&"none"!==o.attrs.fill,doStroke:"stroke"in o.attrs&&0!==o.attrs["stroke-width"],ellipsed:o.ellipsed}),o.children&&Af(o.children,t,n,i),t.restore()}}function Tf(){let e,t,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:gf;const i={transform:void 0,canvasBufferSize:void 0,progressive:void 0};let r,o=!1,s=bf();const a=[["fill","fillStyle"],["stroke","strokeStyle"],["opacity","globalAlpha"],["globalAlpha","globalAlpha"],["stroke-width","lineWidth"],["stroke-linejoin","lineJoin"],["stroke-dasharray","setLineDash",_f]];let l;const c=xf();return c.element=()=>e,c.root=()=>e,c.settings=e=>(e&&Object.keys(i).forEach((t=>{void 0!==e[t]&&(i[t]=e[t])})),i),c.appendTo=n=>(e||(e=n.ownerDocument.createElement("canvas"),e.style.position="absolute",e.style["-webkit-font-smoothing"]="antialiased",e.style["-moz-osx-font-smoothing"]="antialiased",e.style.pointerEvents="none"),"function"!=typeof i.transform||t||(t=new Mf(e)),n.appendChild(e),e),c.getScene=i=>{const r=Cf(t&&t.getContext()||e.getContext("2d")),o=s.scaleRatio.x,a=s.scaleRatio.y,l={type:"container",children:i,transform:s.edgeBleed.bool?"translate(".concat(s.edgeBleed.left*r*o,", ").concat(s.edgeBleed.top*r*a,")"):""};return 1===r&&1===o&&1===a||(l.transform+="scale(".concat(r*o,", ").concat(r*a,")")),n({items:[l],dpi:r,on:{create:[Fu(c.measureText),wf(c)]}})},c.render=n=>{if(!e)return!1;l||(l=function(e){const t=e.createElement("canvas"),n=t.getContext("2d");let i={};return{create(e){const r=e.key;return r?(i[r]=i[r]||vf(e,t,n),i[r]):vf(e,t,n)},clear(){i={}}}}(e.ownerDocument));const u=t&&t.getContext()||e.getContext("2d"),h=Cf(u),d=t&&i.transform();if(d)return e.width=e.width,function(e){let{el:t,dpiRatio:n,transform:i}=e;if("object"==typeof i){const e=[i.horizontalScaling,i.horizontalSkewing,i.verticalSkewing,i.verticalScaling,i.horizontalMoving*n,i.verticalMoving*n];t.getContext("2d").setTransform(...e)}}({el:e,dpiRatio:h,transform:d}),t.apply(),!0;o&&(e.style.left="".concat(s.computedPhysical.x,"px"),e.style.top="".concat(s.computedPhysical.y,"px"),e.style.width="".concat(s.computedPhysical.width,"px"),e.style.height="".concat(s.computedPhysical.height,"px"),e.width=Math.round(s.computedPhysical.width*h),e.height=Math.round(s.computedPhysical.height*h),t&&t.updateSize({rect:s,dpiRatio:h,canvasBufferSize:i.canvasBufferSize}));const f=c.getScene(n),p=!r||!f.equals(r);l.clear();const m=o||p,g="function"==typeof i.progressive&&i.progressive();return m&&(g&&!g.isFirst||c.clear(),Af(f.children,u,a,{patterns:l})),t&&(e.width=e.width,t.apply()),o=!1,g&&!g.isFirst&&f.children.unshift(...r.children),r=f,m},c.itemsAt=e=>r?r.getItemsFrom(e):[],c.findShapes=e=>r?r.findShapes(e):[],c.clear=()=>(e&&(e.width=e.width),t&&t.clear(),r=null,c),c.size=e=>{if(e){const t=bf(e);JSON.stringify(s)!==JSON.stringify(t)&&(o=!0,s=t)}return s},c.destroy=()=>{e&&(e.parentElement&&e.parentElement.removeChild(e),e=null),t&&(t=null),r=null},c}function If(e,t){Df.add(e,t)}function Rf(e,t){return Math.max(0,Math.min(e,t))}const Of=new RegExp("[A-Za-zªµºÀ-ÖØ-öø-ʸʻ-ˁː-ˑˠ-ˤˮͰ-ͳͶ-ͽΆΈ-ϵϷ-҂Ҋ-։ः-हऻऽ-ीॉ-ौॎ-ॐक़-ॡ।-ॿং-হঽ-ীে-ৌৎ-ৡ০-ৱ৴-৺ਃ-ਹਾ-ੀਖ਼-੯ੲ-ੴઃ-હઽ-ીૉ-ૌૐ-ૡ૦-૯ଂ-ହଽ-ାୀେ-ୌୗ-ୡ୦-୷ஃ-ிு-ௌௐ-௲ఁ-ఽు-ౄౘ-ౡ౦-౯౿-ಹಽ-ೋೕ-ೡ೦-ീെ-ൌൎ-ൡ൦-ෆා-ෑෘ-ะา-ำเ-ๆ๏-ະາ-ຳຽ-ໆ໐-༗༚-༴༶༸༾-ཬཿ྅ྈ-ྌ྾-࿅࿇-ာေးျ-ြဿ-ၗၚ-ၝၡ-ၰၵ-ႁႃ-ႄႇ-ႌႎ-ႜ႞-ፚ፠-ᎏᎠ-Ᏼᐁ-ᙿᚁ-ᚚᚠ-ᜑᜠ-ᜱ᜵-ᝑᝠ-ᝰក-ាើ-ៅះ-ៈ។-៚ៜ០-៩᠐-ᢨᢪ-ᤜᤣ-ᤦᤩ-ᤱᤳ-ᤸ᥆-᧚ᨀ-ᨖᨙ-ᩕᩗᩡᩣ-ᩤᩭ-ᩲ᪀-᪭ᬄ-ᬳᬵᬻᬽ-ᭁᭃ-᭪᭴-᭼ᮂ-ᮡᮦ-ᮧ᮪-ᯥᯧᯪ-ᯬᯮ᯲-ᰫᰴ-ᰵ᰻-᱿᳓᳡ᳩ-ᳬᳮ-ᶿḀ-ᾼιῂ-ῌῐ-Ίῠ-Ῥῲ-ῼⁱⁿₐ-ₜℂℇℊ-ℓℕℙ-ℝℤΩℨK-ℭℯ-ℹℼ-ℿⅅ-ⅉⅎ-⅏Ⅰ-ↈ⌶-⍺⎕⒜-ⓩ⚬⠀-⣿Ⰰ-ⳤⳫ-ⳮⴀ-⵰ⶀ-ⷞ々-〇〡-〩〱-〵〸-〼ぁ-ゖゝ-ゟァ-ヺー-ㆺㇰ-㈜㈠-㉏㉠-㉻㉿-㊰㋀-㋋㋐-㍶㍻-㏝㏠-㏾㐀-䶵一-ꒌꓐ-ꘌꘐ-ꙮꚀ-ꛯ꛲-꛷Ꜣ-ꞇ꞉-ꠁꠃ-ꠅꠇ-ꠊꠌ-ꠤꠧ꠰-꠷ꡀ-ꡳꢀ-ꣃ꣎-꣙ꣲ-ꤥ꤮-ꥆꥒ-ꥼꦃ-ꦲꦴ-ꦵꦺ-ꦻꦽ-ꨨꨯ-ꨰꨳ-ꨴꩀ-ꩂꩄ-ꩋꩍ-ꪯꪱꪵ-ꪶꪹ-ꪽꫀꫂ-ꯤꯦ-ꯧꯩ-꯬꯰-ﬗA-Za-zヲ-ᅵ]"),Nf=new RegExp("[־׀׃׆א-״߀-ߪߴ-ߵߺ-ࠕࠚࠤࠨ࠰-ࡘ࡞יִײַ-ﬨשׁ-ﭏ]"),Pf=new RegExp("[؈؋؍؛-ي٭-ٯٱ-ەۥ-ۦۮ-ۯۺ-܍ܐܒ-ܯݍ-ޥޱﭐ-ﴽﵐ-﷼ﹰ-ﻼ]");function Lf(e){return Of.test(e)}function Ff(e){return Nf.test(e)||Pf.test(e)}function zf(e){let t,n,i=e?e.length:0;for(t=0;t<i;t++){if(n=e[t],Lf(n))return"ltr";if(Ff(n))return"rtl"}return"ltr"}const jf={start:"end",end:"start",center:"center",middle:"middle"};function Hf(e,t){return"rtl"===t?jf[e]:e}function Bf(e,t){const n=[];let i;const r=[],o=[],s=[];let a,l;const c=e=>e.id,u=(e,t)=>{let n;return n="object"==typeof e?"id"in e?e.id:t:e,{content:e,id:"".concat(n,"__").concat(e.type||"")}};e.isTree||(e=e.map(u)),t=t.map(u),a=e.map(c),l=t.map(c);for(let e=0,i=t.length;e<i;e++){-1===a.indexOf(t[e].id)?n.push(t[e]):o.push(t[e])}for(let t=0,n=e.length;t<n;t++){-1===l.indexOf(e[t].id)?r.push(e[t]):s.push(e[t])}for(let e=0,t=n.length;e<t;e++)n[e].content.children&&(n[e].diff=Bf([],n[e].content.children),n[e].children=n[e].diff.updatedNew.concat(n[e].diff.added),n[e].children.isTree=!0);for(let e=0,t=o.length;e<t;e++)o[e].diff=Bf(s[e].children||[],o[e].content.children||[]),o[e].object=s[e].object,o[e].children=o[e].diff.items;return i=o.concat(n),n.isTree=!0,r.isTree=!0,o.isTree=!0,s.isTree=!0,i.isTree=!0,{added:n,updatedNew:o,updatedOld:s,removed:r,items:i}}function Vf(e,t,n){for(let i=0,r=e.length;i<r;i++)e[i].object=n(e[i].content.type,t)}function $f(e,t){for(let n=0,i=e.length;n<i;n++)null!==e[n].object&&void 0!==e[n].object&&(t(e[n].object),e[n].object=null)}function Wf(e,t,n,i){let r;for(let o=0,s=e.length;o<s;o++)r=e[o],null!==r.object&&void 0!==r.object&&(n(r.object,r.content),r.diff&&(Vf(r.diff.added,r.object,t),$f(r.diff.removed,i),Wf(r.diff.items,t,n,i)))}function Uf(e,t,n,i,r,o){const s=Bf(e,t);return Vf(s.added,n,i),$f(s.removed,o),Wf(s.items,i,r,o),s.items}If("rect",(function(e,t){let{g:n,doFill:i,doStroke:r}=t;n.beginPath(),e.rx>0||e.ry>0?function(e,t,n,i,r,o,s){o=Rf(i/2,o>0?o:s),s=Rf(r/2,s>0?s:o),e.moveTo(t,n+s),e.lineTo(t,n+r-s),e.quadraticCurveTo(t,n+r,t+o,n+r),e.lineTo(t+i-o,n+r),e.quadraticCurveTo(t+i,n+r,t+i,n+r-s),e.lineTo(t+i,n+s),e.quadraticCurveTo(t+i,n,t+i-o,n),e.lineTo(t+o,n),e.quadraticCurveTo(t,n,t,n+s)}(n,e.x,e.y,e.width,e.height,e.rx,e.ry):n.rect(e.x,e.y,e.width,e.height),i&&n.fill(),r&&n.stroke()})),If("circle",(function(e,t){let{g:n,doFill:i,doStroke:r}=t;n.beginPath(),n.moveTo(e.cx+e.r,e.cy),n.arc(e.cx,e.cy,e.r,0,2*Math.PI,!1),i&&n.fill(),r&&n.stroke()})),If("line",(function(e,t){let{g:n,doStroke:i}=t;n.beginPath(),n.moveTo(e.x1,e.y1),n.lineTo(e.x2,e.y2),i&&n.stroke()})),If("path",(function(e,t){let{g:n,doStroke:i,doFill:r}=t;const o=new Path2D(e.d);r&&n.fill(o),i&&n.stroke(o)})),If("text",(function(e,t){let{g:n,ellipsed:i,doStroke:r}=t;const o=i||zu(e,Yu);e["font-weight"]?n.font="".concat(e["font-weight"]," ").concat(e["font-size"]," ").concat(e["font-family"]):n.font="".concat(e["font-size"]," ").concat(e["font-family"]);const s=zf(e.text);n.canvas.dir!==s&&(n.canvas.dir=s);const a=Hf("middle"===e["text-anchor"]?"center":e["text-anchor"],n.canvas.dir);a&&n.textAlign!==a&&(n.textAlign=a);const l=ju(e);n.fillText(o,e.x+e.dx,e.y+e.dy+l),r&&n.strokeText(o,e.x+e.dx,e.y+e.dy+l)}));const Yf="http://www.w3.org/2000/svg",Xf=(e,t)=>{if(!e||"string"!=typeof e)throw new Error("Invalid type: ".concat(e));const n=t.ownerDocument.createElementNS(Yf,"container"===e?"g":e);return t.appendChild(n),n},Kf=e=>{e.parentNode&&e.parentNode.removeChild(e)},Gf=(e,t)=>{if((e=>{switch(e.type){case"circle":return!isNaN(e.attrs.cx)&&!isNaN(e.attrs.cy)&&!isNaN(e.attrs.r);case"line":return!(isNaN(e.attrs.x1)||isNaN(e.attrs.y1)||isNaN(e.attrs.x2)||isNaN(e.attrs.y2));case"rect":return!(isNaN(e.attrs.x)||isNaN(e.attrs.y)||isNaN(e.attrs.width)||isNaN(e.attrs.height));case"text":return!isNaN(e.attrs.x)&&!isNaN(e.attrs.y);default:return!0}})(t)){for(const n in t.attrs)if("stroke"===n&&t.strokeReference)e.setAttribute("stroke",t.strokeReference);else if("fill"===n&&t.fillReference)e.setAttribute("fill",t.fillReference);else if("text"===n){e.setAttribute("style","white-space: pre"),e.textContent=t.ellipsed||zu(t.attrs,Yu);const n=zf(t.attrs.text);"rtl"===n&&(e.setAttribute("direction","rtl"),e.setAttribute("dir","rtl"),e.setAttribute("text-anchor",Hf(e.getAttribute("text-anchor"),n)))}else if("text"!==t.type||"dy"!==n&&"dominant-baseline"!==n)if("text"===t.type&&"title"===n&&t.attrs.title){const n=e.ownerDocument.createElementNS(Yf,"title");n.textContent=t.attrs.title,e.appendChild(n)}else e.setAttribute(n,t.attrs[n]);else{const i=+e.getAttribute(n)||0;let r=0;r="dominant-baseline"===n?ju(t.attrs):t.attrs[n],e.setAttribute("dy",r+i)}if("string"==typeof t.data||"number"==typeof t.data||"boolean"==typeof t.data)e.setAttribute("data",t.data);else if("object"==typeof t.data&&null!==t.data)for(const n in t.data)"string"!=typeof t.data[n]&&"number"!=typeof t.data[n]&&"boolean"!=typeof t.data[n]||e.setAttribute("data-".concat(n),t.data[n])}};class Jf{constructor(e,t,n,i){this.create=e,this.nodeCreator=t,this.nodeMaintainer=n,this.nodeDestroyer=i}render(e,t){return this.create([],e,t,this.nodeCreator,this.nodeMaintainer,this.nodeDestroyer)}}function Zf(){return new Jf(Uf,Xf,Gf,Kf)}function Qf(e){let t,n,i,r=0;if(0===(e=JSON.stringify(e)).length)return r;for(t=0,i=e.length;t<i;t++)n=e.charCodeAt(t),r=(r<<5)-r+n,r&=r;return r}function ep(){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Yf,t=arguments.length>2&&void 0!==arguments[2]?arguments[2]:gf;const n=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:Zf)();let i,r,o,s=!1,a=bf();const l={transform:void 0},c=xf(),u={type:"defs",children:[]},h=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Qf,n={},i=Date.now();const r={onCreate(r){let o={};r.node&&"object"==typeof r.node.fill&&"pattern"===r.node.fill.type&&r.node.fill.shapes&&(o.fill=r.node.fill),r.node&&"object"==typeof r.node.stroke&&"pattern"===r.node.stroke.type&&r.node.stroke.shapes&&(o.stroke=r.node.stroke),Object.keys(o).forEach((s=>{let a="";const l=o[s],c=t(l),u="picasso-pattern-".concat(i,"-").concat(c);if("undefined"!=typeof window&&(a=window.location.href.split("#")[0]),!n[c]){const t={patternUnits:"userSpaceOnUse",x:0,y:0,width:l.width,height:l.height,type:"pattern",id:u,children:[],fill:l.fill};l.shapes.forEach((e=>{t.children.push(e)})),e.push(t),n[c]=!0}r.node["".concat(s,"Reference")]="url('".concat(a,"#").concat(u,"')")}))},clear(){n={}}};return r}(u.children),d=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Qf,n={},i=Date.now();const r={getOrCreateGradient(){let r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"fill",s=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"",a=t(r[o]),l="picasso-gradient-".concat(i,"-").concat(a);if(!n[a]){let{orientation:t,degree:i,stops:s=[]}=r[o],c={};void 0===i&&(i=90),"radial"===t?c.type="radialGradient":(c=ps(i),["x1","x2","y1","y2"].forEach((e=>{e in r[o]&&(c[e]=r[o][e])})),c.type="linearGradient"),c.id=l,c.children=s.map((e=>{let{offset:t,color:n,opacity:i}=e;return{type:"stop",offset:"".concat(100*t,"%"),style:"stop-color:".concat(n,";stop-opacity:").concat(void 0!==i?i:1)}})),e.push(c),n[a]=l}return"url('".concat(s,"#").concat(l,"')")},onCreate(e){let t="";"undefined"!=typeof window&&(t=window.location.href.split("#")[0]);const n=e.node;n.fill&&"object"==typeof n.fill&&"gradient"===n.fill.type&&(n.fillReference=r.getOrCreateGradient(n,"fill",t)),n.stroke&&"object"==typeof n.stroke&&"gradient"===n.stroke.type&&(n.strokeReference=r.getOrCreateGradient(n,"stroke",t))},clear(){n={}}};return r}(u.children);return c.element=()=>i,c.root=()=>r,c.settings=e=>(e&&Object.keys(l).forEach((t=>{void 0!==e[t]&&(l[t]=e[t])})),l),c.appendTo=t=>(i||(i=t.ownerDocument.createElementNS(e,"svg"),i.style.position="absolute",i.style["-webkit-font-smoothing"]="antialiased",i.style["-moz-osx-font-smoothing"]="antialiased",i.style.pointerEvents="none",i.setAttribute("xmlns",e),r=t.ownerDocument.createElementNS(e,"g"),r.style.pointerEvents="auto",i.appendChild(r)),t.appendChild(i),i),c.getScene=e=>{const n=a.scaleRatio.x,i=a.scaleRatio.y,r={type:"container",children:Array.isArray(e)?[...e,u]:e,transform:a.edgeBleed.bool?"translate(".concat(a.edgeBleed.left*n,", ").concat(a.edgeBleed.top*i,")"):""};return 1===n&&1===i||(r.transform+="scale(".concat(n,", ").concat(i,")")),t({items:[r],on:{create:[e=>{e.node.fillReference=void 0,e.node.strokeReference=void 0},d.onCreate,h.onCreate,Fu(c.measureText),wf(c)]}})},c.render=e=>{if(!i)return!1;const t="function"==typeof l.transform&&l.transform();if(t){const{a:e,b:n,c:i,d:o,e:s,f:a}=t;return r.style.transform="matrix(".concat(e,", ").concat(n,", ").concat(i,", ").concat(o,", ").concat(s,", ").concat(a,")"),!0}r.style.transform="",s&&(i.style.left="".concat(a.computedPhysical.x,"px"),i.style.top="".concat(a.computedPhysical.y,"px"),i.setAttribute("width",a.computedPhysical.width),i.setAttribute("height",a.computedPhysical.height)),d.clear(),h.clear(),u.children.length=0;const f=c.getScene(e),p=!o||!f.equals(o),m=s||p;return m&&(c.clear(),n.render(f.children,r)),s=!1,o=f,m},c.itemsAt=e=>o?o.getItemsFrom(e):[],c.findShapes=e=>o?o.findShapes(e):[],c.clear=()=>{if(!r)return c;o=null;const e=r.cloneNode(!1);return i.replaceChild(e,r),r=e,c},c.destroy=()=>{i&&i.parentNode&&i.parentNode.removeChild(i),i=null,r=null},c.size=e=>{if(e){const t=bf(e);JSON.stringify(a)!==JSON.stringify(t)&&(s=!0,a=t)}return a},c}var tp,np,ip,rp,op,sp,ap,lp={},cp=[],up=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i;function hp(e,t){for(var n in t)e[n]=t[n];return e}function dp(e){var t=e.parentNode;t&&t.removeChild(e)}function fp(e,t,n){var i,r,o,s={};for(o in t)"key"==o?i=t[o]:"ref"==o?r=t[o]:s[o]=t[o];if(arguments.length>2&&(s.children=arguments.length>3?tp.call(arguments,2):n),"function"==typeof e&&null!=e.defaultProps)for(o in e.defaultProps)void 0===s[o]&&(s[o]=e.defaultProps[o]);return pp(e,s,i,r,null)}function pp(e,t,n,i,r){var o={type:e,props:t,key:n,ref:i,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,__h:null,constructor:void 0,__v:null==r?++ip:r};return null==r&&null!=np.vnode&&np.vnode(o),o}function mp(e){return e.children}function gp(e,t){this.props=e,this.context=t}function yp(e,t){if(null==t)return e.__?yp(e.__,e.__.__k.indexOf(e)+1):null;for(var n;t<e.__k.length;t++)if(null!=(n=e.__k[t])&&null!=n.__e)return n.__e;return"function"==typeof e.type?yp(e):null}function vp(e){var t,n;if(null!=(e=e.__)&&null!=e.__c){for(e.__e=e.__c.base=null,t=0;t<e.__k.length;t++)if(null!=(n=e.__k[t])&&null!=n.__e){e.__e=e.__c.base=n.__e;break}return vp(e)}}function bp(e){(!e.__d&&(e.__d=!0)&&rp.push(e)&&!xp.__r++||op!==np.debounceRendering)&&((op=np.debounceRendering)||sp)(xp)}function xp(){var e,t,n,i,r,o,s,a;for(rp.sort(ap);e=rp.shift();)e.__d&&(t=rp.length,i=void 0,r=void 0,s=(o=(n=e).__v).__e,(a=n.__P)&&(i=[],(r=hp({},o)).__v=o.__v+1,Ep(a,o,r,n.__n,void 0!==a.ownerSVGElement,null!=o.__h?[s]:null,i,null==s?yp(o):s,o.__h),Ap(i,o),o.__e!=s&&vp(o)),rp.length>t&&rp.sort(ap));xp.__r=0}function wp(e,t,n,i,r,o,s,a,l,c){var u,h,d,f,p,m,g,y=i&&i.__k||cp,v=y.length;for(n.__k=[],u=0;u<t.length;u++)if(null!=(f=n.__k[u]=null==(f=t[u])||"boolean"==typeof f||"function"==typeof f?null:"string"==typeof f||"number"==typeof f||"bigint"==typeof f?pp(null,f,null,null,f):Array.isArray(f)?pp(mp,{children:f},null,null,null):f.__b>0?pp(f.type,f.props,f.key,f.ref?f.ref:null,f.__v):f)){if(f.__=n,f.__b=n.__b+1,null===(d=y[u])||d&&f.key==d.key&&f.type===d.type)y[u]=void 0;else for(h=0;h<v;h++){if((d=y[h])&&f.key==d.key&&f.type===d.type){y[h]=void 0;break}d=null}Ep(e,f,d=d||lp,r,o,s,a,l,c),p=f.__e,(h=f.ref)&&d.ref!=h&&(g||(g=[]),d.ref&&g.push(d.ref,null,f),g.push(h,f.__c||p,f)),null!=p?(null==m&&(m=p),"function"==typeof f.type&&f.__k===d.__k?f.__d=l=qp(f,l,e):l=Sp(e,f,d,y,p,l),"function"==typeof n.type&&(n.__d=l)):l&&d.__e==l&&l.parentNode!=e&&(l=yp(d))}for(n.__e=m,u=v;u--;)null!=y[u]&&("function"==typeof n.type&&null!=y[u].__e&&y[u].__e==n.__d&&(n.__d=Mp(i).nextSibling),Rp(y[u],y[u]));if(g)for(u=0;u<g.length;u++)Ip(g[u],g[++u],g[++u])}function qp(e,t,n){for(var i,r=e.__k,o=0;r&&o<r.length;o++)(i=r[o])&&(i.__=e,t="function"==typeof i.type?qp(i,t,n):Sp(n,i,i,r,i.__e,t));return t}function Sp(e,t,n,i,r,o){var s,a,l;if(void 0!==t.__d)s=t.__d,t.__d=void 0;else if(null==n||r!=o||null==r.parentNode)e:if(null==o||o.parentNode!==e)e.appendChild(r),s=null;else{for(a=o,l=0;(a=a.nextSibling)&&l<i.length;l+=1)if(a==r)break e;e.insertBefore(r,o),s=o}return void 0!==s?s:r.nextSibling}function Mp(e){var t,n,i;if(null==e.type||"string"==typeof e.type)return e.__e;if(e.__k)for(t=e.__k.length-1;t>=0;t--)if((n=e.__k[t])&&(i=Mp(n)))return i;return null}function Dp(e,t,n){"-"===t[0]?e.setProperty(t,null==n?"":n):e[t]=null==n?"":"number"!=typeof n||up.test(t)?n:n+"px"}function _p(e,t,n,i,r){var o;e:if("style"===t)if("string"==typeof n)e.style.cssText=n;else{if("string"==typeof i&&(e.style.cssText=i=""),i)for(t in i)n&&t in n||Dp(e.style,t,"");if(n)for(t in n)i&&n[t]===i[t]||Dp(e.style,t,n[t])}else if("o"===t[0]&&"n"===t[1])o=t!==(t=t.replace(/Capture$/,"")),t=t.toLowerCase()in e?t.toLowerCase().slice(2):t.slice(2),e.l||(e.l={}),e.l[t+o]=n,n?i||e.addEventListener(t,o?kp:Cp,o):e.removeEventListener(t,o?kp:Cp,o);else if("dangerouslySetInnerHTML"!==t){if(r)t=t.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if("width"!==t&&"height"!==t&&"href"!==t&&"list"!==t&&"form"!==t&&"tabIndex"!==t&&"download"!==t&&t in e)try{e[t]=null==n?"":n;break e}catch(e){}"function"==typeof n||(null==n||!1===n&&"-"!==t[4]?e.removeAttribute(t):e.setAttribute(t,n))}}function Cp(e){return this.l[e.type+!1](np.event?np.event(e):e)}function kp(e){return this.l[e.type+!0](np.event?np.event(e):e)}function Ep(e,t,n,i,r,o,s,a,l){var c,u,h,d,f,p,m,g,y,v,b,x,w,q,S,M=t.type;if(void 0!==t.constructor)return null;null!=n.__h&&(l=n.__h,a=t.__e=n.__e,t.__h=null,o=[a]),(c=np.__b)&&c(t);try{e:if("function"==typeof M){if(g=t.props,y=(c=M.contextType)&&i[c.__c],v=c?y?y.props.value:c.__:i,n.__c?m=(u=t.__c=n.__c).__=u.__E:("prototype"in M&&M.prototype.render?t.__c=u=new M(g,v):(t.__c=u=new gp(g,v),u.constructor=M,u.render=Op),y&&y.sub(u),u.props=g,u.state||(u.state={}),u.context=v,u.__n=i,h=u.__d=!0,u.__h=[],u._sb=[]),null==u.__s&&(u.__s=u.state),null!=M.getDerivedStateFromProps&&(u.__s==u.state&&(u.__s=hp({},u.__s)),hp(u.__s,M.getDerivedStateFromProps(g,u.__s))),d=u.props,f=u.state,u.__v=t,h)null==M.getDerivedStateFromProps&&null!=u.componentWillMount&&u.componentWillMount(),null!=u.componentDidMount&&u.__h.push(u.componentDidMount);else{if(null==M.getDerivedStateFromProps&&g!==d&&null!=u.componentWillReceiveProps&&u.componentWillReceiveProps(g,v),!u.__e&&null!=u.shouldComponentUpdate&&!1===u.shouldComponentUpdate(g,u.__s,v)||t.__v===n.__v){for(t.__v!==n.__v&&(u.props=g,u.state=u.__s,u.__d=!1),u.__e=!1,t.__e=n.__e,t.__k=n.__k,t.__k.forEach((function(e){e&&(e.__=t)})),b=0;b<u._sb.length;b++)u.__h.push(u._sb[b]);u._sb=[],u.__h.length&&s.push(u);break e}null!=u.componentWillUpdate&&u.componentWillUpdate(g,u.__s,v),null!=u.componentDidUpdate&&u.__h.push((function(){u.componentDidUpdate(d,f,p)}))}if(u.context=v,u.props=g,u.__P=e,x=np.__r,w=0,"prototype"in M&&M.prototype.render){for(u.state=u.__s,u.__d=!1,x&&x(t),c=u.render(u.props,u.state,u.context),q=0;q<u._sb.length;q++)u.__h.push(u._sb[q]);u._sb=[]}else do{u.__d=!1,x&&x(t),c=u.render(u.props,u.state,u.context),u.state=u.__s}while(u.__d&&++w<25);u.state=u.__s,null!=u.getChildContext&&(i=hp(hp({},i),u.getChildContext())),h||null==u.getSnapshotBeforeUpdate||(p=u.getSnapshotBeforeUpdate(d,f)),S=null!=c&&c.type===mp&&null==c.key?c.props.children:c,wp(e,Array.isArray(S)?S:[S],t,n,i,r,o,s,a,l),u.base=t.__e,t.__h=null,u.__h.length&&s.push(u),m&&(u.__E=u.__=null),u.__e=!1}else null==o&&t.__v===n.__v?(t.__k=n.__k,t.__e=n.__e):t.__e=Tp(n.__e,t,n,i,r,o,s,l);(c=np.diffed)&&c(t)}catch(e){t.__v=null,(l||null!=o)&&(t.__e=a,t.__h=!!l,o[o.indexOf(a)]=null),np.__e(e,t,n)}}function Ap(e,t){np.__c&&np.__c(t,e),e.some((function(t){try{e=t.__h,t.__h=[],e.some((function(e){e.call(t)}))}catch(e){np.__e(e,t.__v)}}))}function Tp(e,t,n,i,r,o,s,a){var l,c,u,h=n.props,d=t.props,f=t.type,p=0;if("svg"===f&&(r=!0),null!=o)for(;p<o.length;p++)if((l=o[p])&&"setAttribute"in l==!!f&&(f?l.localName===f:3===l.nodeType)){e=l,o[p]=null;break}if(null==e){if(null===f)return document.createTextNode(d);e=r?document.createElementNS("http://www.w3.org/2000/svg",f):document.createElement(f,d.is&&d),o=null,a=!1}if(null===f)h===d||a&&e.data===d||(e.data=d);else{if(o=o&&tp.call(e.childNodes),c=(h=n.props||lp).dangerouslySetInnerHTML,u=d.dangerouslySetInnerHTML,!a){if(null!=o)for(h={},p=0;p<e.attributes.length;p++)h[e.attributes[p].name]=e.attributes[p].value;(u||c)&&(u&&(c&&u.__html==c.__html||u.__html===e.innerHTML)||(e.innerHTML=u&&u.__html||""))}if(function(e,t,n,i,r){var o;for(o in n)"children"===o||"key"===o||o in t||_p(e,o,null,n[o],i);for(o in t)r&&"function"!=typeof t[o]||"children"===o||"key"===o||"value"===o||"checked"===o||n[o]===t[o]||_p(e,o,t[o],n[o],i)}(e,d,h,r,a),u)t.__k=[];else if(p=t.props.children,wp(e,Array.isArray(p)?p:[p],t,n,i,r&&"foreignObject"!==f,o,s,o?o[0]:n.__k&&yp(n,0),a),null!=o)for(p=o.length;p--;)null!=o[p]&&dp(o[p]);a||("value"in d&&void 0!==(p=d.value)&&(p!==e.value||"progress"===f&&!p||"option"===f&&p!==h.value)&&_p(e,"value",p,h.value,!1),"checked"in d&&void 0!==(p=d.checked)&&p!==e.checked&&_p(e,"checked",p,h.checked,!1))}return e}function Ip(e,t,n){try{"function"==typeof e?e(t):e.current=t}catch(e){np.__e(e,n)}}function Rp(e,t,n){var i,r;if(np.unmount&&np.unmount(e),(i=e.ref)&&(i.current&&i.current!==e.__e||Ip(i,null,t)),null!=(i=e.__c)){if(i.componentWillUnmount)try{i.componentWillUnmount()}catch(e){np.__e(e,t)}i.base=i.__P=null,e.__c=void 0}if(i=e.__k)for(r=0;r<i.length;r++)i[r]&&Rp(i[r],t,n||"function"!=typeof e.type);n||null==e.__e||dp(e.__e),e.__=e.__e=e.__d=void 0}function Op(e,t,n){return this.constructor(e,n)}function Np(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const{createElement:t=document.createElement.bind(document)}=e;let n,i,r=bf();const o={transform:void 0},s=xf();return s.element=()=>n,s.root=()=>n,s.settings=e=>(e&&Object.keys(o).forEach((t=>{void 0!==e[t]&&(o[t]=e[t])})),o),s.appendTo=e=>(n||(n=t("div"),n.style.position="absolute",n.style["-webkit-font-smoothing"]="antialiased",n.style["-moz-osx-font-smoothing"]="antialiased",n.style.pointerEvents="none"),e.appendChild(n),n),s.render=e=>{if(!n)return!1;const t="function"==typeof o.transform&&o.transform();if(t){const{a:e,b:i,c:r,d:o,e:s,f:a}=t;return n.style.transform="matrix(".concat(e,", ").concat(i,", ").concat(r,", ").concat(o,", ").concat(s,", ").concat(a,")"),!0}let s;return n.style.transform="",n.style.left="".concat(r.computedPhysical.x,"px"),n.style.top="".concat(r.computedPhysical.y,"px"),n.style.width="".concat(r.computedPhysical.width,"px"),n.style.height="".concat(r.computedPhysical.height,"px"),s=Array.isArray(e)?fp("div",null,e):e,i=function(e,t,n){var i,r,o;np.__&&np.__(e,t),r=(i="function"==typeof n)?null:n&&n.__k||t.__k,o=[],Ep(t,e=(!i&&n||t).__k=fp(mp,null,[e]),r||lp,lp,void 0!==t.ownerSVGElement,!i&&n?[n]:r?null:t.firstChild?tp.call(t.childNodes):null,o,!i&&n?n:r?r.__e:t.firstChild,i),Ap(o,e)}(s,n,i),!0},s.renderArgs=[fp],s.clear=()=>{if(n){let e=n.firstChild;for(;e;)n.removeChild(e),e=n.firstChild;i=null}return s},s.destroy=()=>{n&&n.parentElement&&n.parentElement.removeChild(n),n=null,i=null},s.size=e=>(e&&(r=bf(e)),r),s}tp=cp.slice,np={__e:function(e,t,n,i){for(var r,o,s;t=t.__;)if((r=t.__c)&&!r.__)try{if((o=r.constructor)&&null!=o.getDerivedStateFromError&&(r.setState(o.getDerivedStateFromError(e)),s=r.__d),null!=r.componentDidCatch&&(r.componentDidCatch(e,i||{}),s=r.__d),s)return r.__E=r}catch(t){e=t}throw e}},ip=0,gp.prototype.setState=function(e,t){var n;n=null!=this.__s&&this.__s!==this.state?this.__s:this.__s=hp({},this.state),"function"==typeof e&&(e=e(hp({},n),this.props)),e&&hp(n,e),null!=e&&this.__v&&(t&&this._sb.push(t),bp(this))},gp.prototype.forceUpdate=function(e){this.__v&&(this.__e=!0,e&&this.__h.push(e),bp(this))},gp.prototype.render=mp,rp=[],sp="function"==typeof Promise?Promise.prototype.then.bind(Promise.resolve()):setTimeout,ap=function(e,t){return e.__v.__b-t.__v.__b},xp.__r=0;var Pp=[function(e){e.renderer("svg",ep)},function(e){e.renderer("canvas",Tf)},function(e){e.renderer("dom",Np)}];const Lp={OFF:0,ERROR:1,WARN:2,INFO:3,DEBUG:4};const Fp=function e(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const i=function(){let{level:e=Lp.OFF,pipe:t=console}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=e;const i={[Lp.OFF]:()=>{},[Lp.ERROR]:function(){return t.error(...arguments)},[Lp.WARN]:function(){return t.warn(...arguments)},[Lp.INFO]:function(){return t.info(...arguments)},[Lp.DEBUG]:function(){return t.log(...arguments)}},r=function(e){if(e&&!(n<e)){for(var t=arguments.length,r=new Array(t>1?t-1:0),o=1;o<t;o++)r[o-1]=arguments[o];(i[e]||i[Lp.DEBUG])(...r)}};return{log:r,error:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return r(Lp.ERROR,...t)},warn:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return r(Lp.WARN,...t)},info:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return r(Lp.INFO,...t)},debug:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return r(Lp.DEBUG,...t)},level:e=>("number"==typeof e&&(n=e),n),LOG_LEVEL:Lp}}(t.logger),r={component:Ue(n.component,"component",i),data:Ue(n.data,"data",i),formatter:Ue(n.formatter,"formatter",i),interaction:Ue(n.interaction,"interaction",i),renderer:za(n.renderer),scale:Ue(n.scale,"scale",i),symbol:Ue(n.symbol,"symbol",i),logger:i};function o(){let n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return e({palettes:t.palettes.concat(n.palettes||[]),style:E({},t.style,n.style),logger:n.logger||t.logger,renderer:n.renderer||t.renderer},r)}return t.renderer&&t.renderer.prio&&r.renderer.default(t.renderer.prio[0]),o.use=function(e){return function(e){e(arguments.length>2?arguments[2]:void 0,arguments.length>1&&void 0!==arguments[1]?arguments[1]:{})}(e,arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r)},o.chart=e=>Fa(e,{registries:r,logger:i,style:t.style,palettes:t.palettes}),o.config=()=>t,Object.keys(r).forEach((e=>{o[e]=r[e]})),o.version=A,o}({renderer:{prio:["svg","canvas"]},logger:{level:0},style:{"$font-family":"'Source Sans Pro', Arial, sans-serif","$font-size":"12px","$line-height":"16px","$font-size--l":"16px","$font-weight":"normal","$gray-100":"#ffffff","$gray-98":"#f9f9f9","$gray-95":"#f2f2f2","$gray-90":"#e6e6e6","$gray-35":"#595959","$gray-30":"#4d4d4d","$gray-25":"#404040","$gray-20":"#333333","$border-95":"rgba(255, 255, 255, 0.05)","$border-90":"rgba(255, 255, 255, 0.1)","$border-80":"rgba(255, 255, 255, 0.2)","$border-20":"rgba(0, 0, 0, 0.2)","$border-10":"rgba(0, 0, 0, 0.1)","$border-5":"rgba(0, 0, 0, 0.05)","$primary-blue":"#3F8AB3","$primary-green":"#6CB33F","$primary-red":"#DC423F","$primary-orange":"#EF960F","$spacing--s":4,$spacing:8,"$spacing--l":12,"$font-color":"$gray-35","$font-color--inverted":"$gray-90","$guide-color":"$gray-90","$guide-color--inverted":"$gray-35",$border:"$border-80","$border--inverted":"$border-10",$shape:{fill:"$primary-blue",strokeWidth:1,stroke:"$border"},"$shape-outline":{stroke:"$primary-blue",strokeWidth:2},"$shape-guide":{stroke:"$guide-color",strokeWidth:1},"$shape-guide--inverted":{"@extend":"$shape-guide",stroke:"$guide-color--inverted"},$label:{fontSize:"$font-size",fontFamily:"$font-family",fill:"$font-color"},"$label--inverted":{$extend:"$label",fill:"$font-color--inverted"},"$label-overlay":{fontSize:"$font-size--l",fontFamily:"$font-family",fill:"$gray-100",color:"$font-color",stroke:"$guide-color--inverted",strokeWidth:1,borderRadius:4},$title:{"@extend":"$label",fontSize:"$font-size--l",fontWeight:"$font-weight",stroke:"$guide-color--inverted",strokeWidth:0},"$guide-line":{strokeWidth:1,stroke:"$guide-color"},"$guide-line--minor":{strokeWidth:1,stroke:"$gray-95"},"$padding--s":{left:"$spacing--s",right:"$spacing--s",top:"$spacing--s",bottom:"$spacing--s"},$padding:{left:"$spacing",right:"$spacing",top:"$spacing",bottom:"$spacing"},"$selection-area-target":{fill:"$primary-green",strokeWidth:0,opacity:.2}},palettes:[{key:"categorical",colors:[["#a54343","#d76c6c","#ec983d","#ecc43d","#f9ec86","#cbe989","#70ba6e","#578b60","#79d69f","#26a0a7","#138185","#65d3da"]]},{key:"diverging",colors:[["#3d52a1","#3a89c9","#77b7e5","#b4ddf7","#e6f5fe","#ffe3aa","#f9bd7e","#ed875e","#d24d3e","#ae1c3e"]]},{key:"sequential",colors:[["rgb(180,221,212)","rgb(34, 83, 90)"]]}]},{component:ja,data:Wa,formatter:yi,interaction:Ua,renderer:za(),scale:xo,symbol:_s});function zp(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,i)}return n}function jp(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?zp(Object(n),!0).forEach((function(t){Hp(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):zp(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function Hp(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 i=n.call(e,t||"default");if("object"!=typeof i)return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:String(t)}(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}td.forEach(Fp.use),Pp.forEach(Fp.use),[].forEach(Fp.use);var Bp=Object.prototype.hasOwnProperty,Vp=Object.prototype.toString,$p=Object.defineProperty,Wp=Object.getOwnPropertyDescriptor,Up=function(e){return"function"==typeof Array.isArray?Array.isArray(e):"[object Array]"===Vp.call(e)},Yp=function(e){if(!e||"[object Object]"!==Vp.call(e))return!1;var t,n=Bp.call(e,"constructor"),i=e.constructor&&e.constructor.prototype&&Bp.call(e.constructor.prototype,"isPrototypeOf");if(e.constructor&&!n&&!i)return!1;for(t in e);return void 0===t||Bp.call(e,t)},Xp=function(e,t){$p&&"__proto__"===t.name?$p(e,t.name,{enumerable:!0,configurable:!0,value:t.newValue,writable:!0}):e[t.name]=t.newValue},Kp=function(e,t){if("__proto__"===t){if(!Bp.call(e,t))return;if(Wp)return Wp(e,t).value}return e[t]},Gp=function e(){var t,n,i,r,o,s,a=arguments[0],l=1,c=arguments.length,u=!1;for("boolean"==typeof a&&(u=a,a=arguments[1]||{},l=2),(null==a||"object"!=typeof a&&"function"!=typeof a)&&(a={});l<c;++l)if(null!=(t=arguments[l]))for(n in t)i=Kp(a,n),a!==(r=Kp(t,n))&&(u&&r&&(Yp(r)||(o=Up(r)))?(o?(o=!1,s=i&&Up(i)?i:[]):s=i&&Yp(i)?i:{},Xp(a,{name:n,newValue:e(u,s,r)})):void 0!==r&&Xp(a,{name:n,newValue:r}));return a};function Jp(e,t,n,i){if(!e)return-1;const r=n.cache,o=e.origin?e.origin():null;o&&(e=o);let s=r.fields.indexOf(e),a=-1,l=-1;if(-1===s)for(let t=0;t<r.wrappedFields.length;t++)if(l=r.wrappedFields[t].attrDims.map((e=>e.instance)).indexOf(e),a=r.wrappedFields[t].attrExps.map((e=>e.instance)).indexOf(e),-1!==l||-1!==a){s=t;break}if(Array.isArray(i)&&i.some(((e,t)=>e!==t))){const e=i.indexOf(s);-1!==e&&(s=e)}return s-=t.qArea.qLeft,s<0||s>=t.qArea.qWidth?-1:l>=0?e=>e[s].qAttrDims.qValues[l]:a>=0?e=>e[s].qAttrExps.qValues[a]:e=>e[s]}function Zp(e,t,n){let{key:i}=n;const r={value:"function"==typeof e.value?e.value(t):void 0!==e.value?e.value:t};return r.label="function"==typeof e.label?e.label(t):void 0!==e.label?String(e.label):String(r.value),e.field&&(r.source={key:i,field:e.field.key()}),r}function Qp(e){let{cache:t,f:n,mainCell:i,p:r,prop:o,page:s,rowIdx:a,row:l,sourceKey:c,target:u,targetProp:h,columnOrder:d}=e,f=i;if(r.field&&r.field!==n){const e=Jp(r.field,s,{cache:t},d);if(-1===e)return;f=Gp({qRow:a},e(l))}u[h]=Zp(r,f,{key:c})}function em(e,t,n,i){const r=Array.isArray(e)?e:[e];let o=[];for(let e=0;e<r.length;e++)if(void 0!==r[e].field){const s=t.raw(),a=t.key(),l="object"==typeof r[e].field?r[e].field:t.field(r[e].field),{props:c,main:u}=i.normalizeConfig(r[e],t),h=Object.keys(c),d=!!r[e].trackBy,f=typeof r[e].trackBy,p={},m=[],g=[];for(let t=0;t<s.qDataPages.length;t++){const o=Jp(l,s.qDataPages[t],{cache:n},s.qColumnOrder);if(-1!==o)for(let y=0;y<s.qDataPages[t].qMatrix.length;y++){const v=s.qDataPages[t].qArea.qTop+y,b=Gp({qRow:v},o(s.qDataPages[t].qMatrix[y])),x=Zp(u,b,{key:a});if(!(u.filter&&!u.filter(b))){for(let e=0;e<h.length;e++){const i=c[h[e]];let r=i.fields||[i];i.fields&&(x[h[e]]=[]);for(let o=0;o<r.length;o++)Qp({cache:n,f:l,mainCell:b,p:r[o],prop:h[e],props:c,page:s.qDataPages[t],rowIdx:v,row:s.qDataPages[t].qMatrix[y],sourceKey:a,target:i.fields?x[h[e]]:x,targetProp:i.fields?o:h[e],columnOrder:s.qColumnOrder});if(i.fields){const t=x[h[e]].map((e=>e.value)),n=x[h[e]].map((e=>e.label));x[h[e]]={value:"function"==typeof i.value?i.value(t):void 0!==i.value?i.value:t,label:"function"==typeof i.label?i.label(n):void 0!==i.label?String(i.label):String(x[h[e]].value)}}}d&&i.track({cfg:r[e],itemData:b,obj:x,target:m,tracker:p,trackType:f}),g.push(x)}}}const y=d?i.collect(m,{main:u,propsArr:h,props:c}):g;o=[...o,...y]}return o}function tm(e){var t=0,n=e.children,i=n&&n.length;if(i)for(;--i>=0;)t+=n[i].value;else t=1;e.value=t}function nm(e,t){e instanceof Map?(e=[void 0,e],void 0===t&&(t=rm)):void 0===t&&(t=im);for(var n,i,r,o,s,a=new am(e),l=[a];n=l.pop();)if((r=t(n.data))&&(s=(r=Array.from(r)).length))for(n.children=r,o=s-1;o>=0;--o)l.push(i=r[o]=new am(r[o])),i.parent=n,i.depth=n.depth+1;return a.eachBefore(sm)}function im(e){return e.children}function rm(e){return Array.isArray(e)?e[1]:null}function om(e){void 0!==e.data.value&&(e.value=e.data.value),e.data=e.data.data}function sm(e){var t=0;do{e.height=t}while((e=e.parent)&&e.height<++t)}function am(e){this.data=e,this.depth=this.height=0,this.parent=null}function lm(e){return null==e?null:function(e){if("function"!=typeof e)throw new Error;return e}(e)}am.prototype=nm.prototype={constructor:am,count:function(){return this.eachAfter(tm)},each:function(e,t){let n=-1;for(const i of this)e.call(t,i,++n,this);return this},eachAfter:function(e,t){for(var n,i,r,o=this,s=[o],a=[],l=-1;o=s.pop();)if(a.push(o),n=o.children)for(i=0,r=n.length;i<r;++i)s.push(n[i]);for(;o=a.pop();)e.call(t,o,++l,this);return this},eachBefore:function(e,t){for(var n,i,r=this,o=[r],s=-1;r=o.pop();)if(e.call(t,r,++s,this),n=r.children)for(i=n.length-1;i>=0;--i)o.push(n[i]);return this},find:function(e,t){let n=-1;for(const i of this)if(e.call(t,i,++n,this))return i},sum:function(e){return this.eachAfter((function(t){for(var n=+e(t.data)||0,i=t.children,r=i&&i.length;--r>=0;)n+=i[r].value;t.value=n}))},sort:function(e){return this.eachBefore((function(t){t.children&&t.children.sort(e)}))},path:function(e){for(var t=this,n=function(e,t){if(e===t)return e;var n=e.ancestors(),i=t.ancestors(),r=null;e=n.pop(),t=i.pop();for(;e===t;)r=e,e=n.pop(),t=i.pop();return r}(t,e),i=[t];t!==n;)t=t.parent,i.push(t);for(var r=i.length;e!==n;)i.splice(r,0,e),e=e.parent;return i},ancestors:function(){for(var e=this,t=[e];e=e.parent;)t.push(e);return t},descendants:function(){return Array.from(this)},leaves:function(){var e=[];return this.eachBefore((function(t){t.children||e.push(t)})),e},links:function(){var e=this,t=[];return e.each((function(n){n!==e&&t.push({source:n.parent,target:n})})),t},copy:function(){return nm(this).eachBefore(om)},[Symbol.iterator]:function*(){var e,t,n,i,r=this,o=[r];do{for(e=o.reverse(),o=[];r=e.pop();)if(yield r,t=r.children)for(n=0,i=t.length;n<i;++n)o.push(t[n])}while(o.length)}};var cm={depth:-1},um={},hm={};function dm(e){return e.id}function fm(e){return e.parentId}function pm(){var e,t=dm,n=fm;function i(i){var r,o,s,a,l,c,u,h,d=Array.from(i),f=t,p=n,m=new Map;if(null!=e){const t=d.map(((t,n)=>function(e){e=`${e}`;let t=e.length;gm(e,t-1)&&!gm(e,t-2)&&(e=e.slice(0,-1));return"/"===e[0]?e:`/${e}`}(e(t,n,i)))),n=t.map(mm),r=new Set(t).add("");for(const e of n)r.has(e)||(r.add(e),t.push(e),n.push(mm(e)),d.push(hm));f=(e,n)=>t[n],p=(e,t)=>n[t]}for(s=0,r=d.length;s<r;++s)o=d[s],c=d[s]=new am(o),null!=(u=f(o,s,i))&&(u+="")&&(h=c.id=u,m.set(h,m.has(h)?um:c)),null!=(u=p(o,s,i))&&(u+="")&&(c.parent=u);for(s=0;s<r;++s)if(u=(c=d[s]).parent){if(!(l=m.get(u)))throw new Error("missing: "+u);if(l===um)throw new Error("ambiguous: "+u);l.children?l.children.push(c):l.children=[c],c.parent=l}else{if(a)throw new Error("multiple roots");a=c}if(!a)throw new Error("no root");if(null!=e){for(;a.data===hm&&1===a.children.length;)a=a.children[0],--r;for(let e=d.length-1;e>=0&&(c=d[e]).data===hm;--e)c.data=null}if(a.parent=cm,a.eachBefore((function(e){e.depth=e.parent.depth+1,--r})).eachBefore(sm),a.parent=null,r>0)throw new Error("cycle");return a}return i.id=function(e){return arguments.length?(t=lm(e),i):t},i.parentId=function(e){return arguments.length?(n=lm(e),i):n},i.path=function(t){return arguments.length?(e=lm(t),i):e},i}function mm(e){let t=e.length;if(t<2)return"";for(;--t>1&&!gm(e,t););return e.slice(0,t)}function gm(e,t){if("/"===e[t]){let n=0;for(;t>0&&"\\"===e[--t];)++n;if(0==(1&n))return!0}return!1}function ym(e,t){"/"===e.charAt(0)&&(e=e.substring(1));const n=e.split("/");let i,r=t;for(let e=0;e<n.length;e++){if("*"===n[e]&&Array.isArray(r)){const t=[];i=n.slice(e+1).join("/");for(let e=0;e<r.length;e++){let n=ym(i,r[e]);Array.isArray(n)?t.push(...n):t.push(n)}return t}if(!n[e]&&Array.isArray(r)){const t=new Array(r.length);i=n.slice(e+1).join("/");for(let e=0;e<r.length;e++)t[e]=ym(i,r[e]);return t}n[e]in r&&(r=r[n[e]])}return r}function vm(e,t,n){let i=[];if(!e||!e.length)return i;if(t<=0){const t=n>=0?[e[n]]:e;i=[...i,...t]}else for(let r=0;r<e.length;r++)e[r].children&&e[r].children.length&&(i=[...i,...vm(e[r].children,t-1,n)]);return i}function bm(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 i=Math.max(0,Math.min(100,t-e));return e=>vm(e.children,i-1,n)}return!1}const xm=/^qDimensionInfo(?:\/(\d+))?/,wm=/^\/?qMeasureInfo\/(\d+)/,qm=/\/qAttrExprInfo\/(\d+)/,Sm=/\/qAttrDimInfo\/(\d+)/;function Mm(e){return(e.qColumnOrder&&e.qColumnOrder.length?e.qColumnOrder:e.qDimensionInfo.map(((e,t)=>t))).filter((t=>t<e.qDimensionInfo.length))}function Dm(e,t){let{cube:n}=t;if(!e)return-1;let i=e.origin&&e.origin()?e.origin().key():e.key(),r=!1,o=-1,s=-1,a=-1,l=-1,c=-1,u=-1,h=i;const d=n.qEffectiveInterColumnSortOrder,f=Mm(n);return xm.test(h)&&(r=!0,o=+xm.exec(h)[1],h=i.replace(xm,"")),wm.test(h)&&("K"===n.qMode?c=+wm.exec(h)[1]:d&&-1!==d.indexOf(-1)?(c=+wm.exec(h)[1],u=0):u=+wm.exec(h)[1],h=h.replace(wm,"")),h&&(Sm.exec(h)?a=+Sm.exec(h)[1]:qm.exec(h)&&(s=+qm.exec(h)[1])),l=r?"S"===n.qMode?f[o]:d?d.indexOf(o):o:d&&-1!==d.indexOf(-1)?d.indexOf(-1):n.qDimensionInfo.length-("K"===n.qMode?0:1),{fieldDepth:l+1,pseudoMeasureIndex:c,measureIdx:u,attrDimIdx:a,attrIdx:s}}function _m(e,t){let n,i,r=bm(e.fieldDepth,t.fieldDepth,t.pseudoMeasureIndex);return n=t.measureIdx>=0?e=>e.data.qValues[t.measureIdx]:e=>e.data,t.attrDimIdx>=0?i=e=>{var n;return null==e||null===(n=e.qAttrDims)||void 0===n?void 0:n.qValues[t.attrDimIdx]}:t.attrIdx>=0&&(i=e=>{var n;return null==e||null===(n=e.qAttrExps)||void 0===n?void 0:n.qValues[t.attrIdx]}),{nodeFn:r,attrFn:i,valueFn:n}}function Cm(e,t,n){let{key:i}=n;const r={value:"function"==typeof e.value?e.value(t):void 0!==e.value?e.value:t};return r.label="function"==typeof e.label?e.label(t):void 0!==e.label?String(e.label):String(r.value),e.field&&(r.source={key:i,field:e.field.key()}),r}function km(e){let{propsArr:t,props:n,item:i,itemData:r,ret:o,sourceKey:s}=e;for(let e=0;e<t.length;e++){const a=n[t[e]],l=a.fields||[a];let c,u;a.fields&&(c=[],u=[]);for(let n=0;n<l.length;n++){const h=l[n];let d,f,p,m,g,y;if("primitive"===h.type?(p=h.value,y=String(h.value)):("function"==typeof h.value&&(d=e=>h.value(e,i)),"function"==typeof h.label&&(f=e=>h.label(e,i)),h.accessor?(m=h.accessor(i),Array.isArray(m)?(g=m.map(h.valueAccessor),h.attrAccessor&&(g=g.map(h.attrAccessor)),d&&(p=g.map(d),d=null),f&&(y=g.map(f),f=null),p=h.reduce?h.reduce(p):p,y=h.reduceLabel?h.reduceLabel(y,p):String(p)):(p=h.attrAccessor?h.attrAccessor(h.valueAccessor(m)):h.valueAccessor(m),y=p)):(p=r,y=r)),a.fields){const e=d?d(p):p;c.push(e),u.push(f&&null!=y?f(y):null!=y?y:String(e))}else{const n=d?d(p):p;o[t[e]]={value:n,label:f?f(y):null!=y?y:String(n)},h.field&&(o[t[e]].source={field:h.field.key(),key:s})}}c&&(o[t[e]]={value:"function"==typeof a.value?a.value(c,i):c,label:"function"==typeof a.label?a.label(u,i):u})}}const Em=(e,t,n)=>{const i="K"===e.qMode?"/qStackedDataPages/*/qData":"/qTreeDataPages/*",r="K"===e.qMode?"qSubNodes":"qNodes",o=ym(i,e);return o&&o[0]?(t.tree=nm(o[0],n.children||(e=>e[r])),t.tree):null};const Am=e=>{let{propsArr:t,props:n,cube:i,cache:r,itemDepthObject:o,f:s}=e;for(let e=0;e<t.length;e++){const a=n[t[e]],l=a.fields?a.fields:[a];for(let e=0;e<l.length;e++){const t=l[e];if(t.field!==s){const e=_m(o,Dm(t.field,{cube:i,cache:r}));t.accessor=e.nodeFn,t.valueAccessor=e.valueFn,t.attrAccessor=e.attrFn}}}};function Tm(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0,n=arguments.length>2?arguments[2]:void 0,i=arguments.length>3?arguments[3]:void 0;const r=t.raw(),o=t.key(),s="S"===r.qMode?function(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),i=e.fields(),r=e.fields().filter((e=>"dimension"===e.type())).map((e=>n.indexOf(i.indexOf(e)))),o=e.fields().filter((e=>"measure"===e.type())).map((e=>n.indexOf(i.indexOf(e)))),s={__root:{__id:"__root",qValues:[]}};for(let e=0;e<t.length;e++){const n=t[e];let i="__root",l=!1;for(let e=0;e<r.length;e++){var a;const t=n[r[e]],o="".concat(i,"__").concat(null!==(a=t.qElemNumber)&&void 0!==a?a:t.qElemNo);s[o]||(s[o]=jp({__id:o,__parent:i,qValues:[]},t),l=!0),i=o}if(l)for(let e=0;e<o.length;e++){const t=n[o[e]];s[i].qValues.push(t)}}const l=Object.keys(s).map((e=>s[e])),c=pm().id((e=>e.__id)).parentId((e=>e.__parent))(l);return c}(t):Em(r,n,e);if(!s)return null;const a=s.height,l=[];for(let o=0;o<=a;o++){let s=null;if(o>0)if("S"===r.qMode){let e=Mm(r)[o-1];s=n.fields[e]}else{let e=r.qEffectiveInterColumnSortOrder[o-1];o>r.qEffectiveInterColumnSortOrder.length&&(e=r.qDimensionInfo.length),s=n.fields[e]}const{props:a,main:c}=i.normalizeConfig(jp(jp({},e),{},{field:s?s.key():void 0}),t),u=Object.keys(a);l[o]={propsArr:u,props:a,main:c};const h=s?Dm(s,{cube:r,cache:n}):{fieldDepth:0};Am({propsArr:u,props:a,cube:r,cache:n,itemDepthObject:h,f:s})}const c=s.copy().descendants(),u=s.descendants();for(let e=0;e<u.length;e++){const t=l[u[e].depth].propsArr,n=l[u[e].depth].props,i=l[u[e].depth].main,r=c[e],s=r.data,a=Cm(i,s,{key:o});km({propsArr:t,props:n,item:r,itemData:s,ret:a,sourceKey:o,isTree:!0}),u[e].data=a}return s}function Im(e,t,n,i){const r=Array.isArray(e)?e:[e];let o=[];for(let s=0;s<r.length;s++)if(void 0!==r[s].field){const a=t.raw(),l=t.key();if(!Em(a,n,e))continue;const c="object"==typeof r[s].field?r[s].field:t.field(r[s].field),{props:u,main:h}=i.normalizeConfig(r[s],t),d=Object.keys(u),f=Dm(c,{cube:a,cache:n}),{nodeFn:p,attrFn:m,valueFn:g}=_m({fieldDepth:0},f);Am({propsArr:d,props:u,cube:a,cache:n,itemDepthObject:f,f:c});const y=!!r[s].trackBy,v=typeof r[s].trackBy,b={},x=[],w=p(n.tree),q=[];for(let e=0;e<w.length;e++){const t=w[e],n=m?m(g(t)):g(t);if(h.filter&&!h.filter(n))continue;const o=Cm(h,n,{key:l});km({propsArr:d,props:u,item:t,itemData:n,ret:o,sourceKey:l}),y&&i.track({cfg:r[s],itemData:n,obj:o,target:x,tracker:b,trackType:v}),q.push(o)}const S=y?i.collect(x,{main:h,propsArr:d,props:u}):q;o=[...o,...S]}return o}"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self&&self;var Rm=function(e,t){return e(t={exports:{}},t.exports),t.exports}((function(e){
|
|
33
18
|
/*! javascript-number-formatter - v1.1.11 - http://mottie.github.com/javascript-number-formatter/ * © ecava */
|
|
34
|
-
e.exports=function(e,t){if(!e||isNaN(+t))return t;var n,i,r,o,s,a,l,c,u,h,d=e.length,f=e.search(/[0-9\-\+#]/),p=f>0?e.substring(0,f):"",m=e.split("").reverse().join(""),g=m.search(/[0-9\-\+#]/),y=d-g,v=e.substring(y,y+1),b=y+("."===v||","===v?1:0),x=g>0?e.substring(b,d):"";if(n=(t="-"===(e=e.substring(f,b)).charAt(0)?-t:+t)<0?t=-t:0,r=(i=e.match(/[^\d\-\+#]/g))&&i[i.length-1]||".",o=i&&i[1]&&i[0]||",",e=e.split(r),t=+(t=t.toFixed(e[1]&&e[1].length))+"",a=e[1]&&e[1].lastIndexOf("0"),(!(c=t.split("."))[1]||c[1]&&c[1].length<=a)&&(t=(+t).toFixed(a+1)),u=e[0].split(o),e[0]=u.join(""),(s=e[0]&&e[0].indexOf("0"))>-1)for(;c[0].length<e[0].length-s;)c[0]="0"+c[0];else 0==+c[0]&&(c[0]="");if((t=t.split("."))[0]=c[0],l=u[1]&&u[u.length-1].length){for(m="",y=(h=t[0]).length%l,d=h.length,b=0;b<d;b++)m+=h.charAt(b),!((b-y+1)%l)&&b<d-l&&(m+=o);t[0]=m}return t[1]=e[1]&&t[1]?r+t[1]:"","0"!==(i=t.join(""))&&""!==i||(n=!1),p+(n?"-":"")+i+x}}));function tg(e){return e.replace(/[-[\]/{}()*+?.\\^$|]/g,"\\$&")}const ng={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"},ig=/%\)?$/,rg=/^\(r(0[2-9]|[12]\d|3[0-6])\)/i,og=/^\(oct\)/i,sg=/^\(dec\)/i,ag=/^\(hex\)/i,lg=/^\(bin\)/i,cg=/^\(rom\)/i,ug=/^(\(rom\)|\(bin\)|\(hex\)|\(dec\)|\(oct\)|\(r(0[2-9]|[12]\d|3[0-6])\))/i,hg=/#|0/g;function dg(e,t,n,i){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(".",i||".")}function fg(e,t,n){let i;return rg.test(t)?e=dg(e,Number(/\d{2}/.exec(t)[0]),t,n):og.test(t)?e=dg(e,8,t,n):sg.test(t)?e=dg(e,10,t,n):ag.test(t)?e=dg(e,16,t,n):lg.test(t)?e=dg(e,2,t,n):cg.test(t)&&(i="",e<0&&(i="-",e=-e),0===(e=Math.floor(e))?e="0":e<=5e5?(e=function(e,t){let n,i="",r=Number(String(e).slice(-3)),o=(e-r)/1e3,s=[0,1,4,5,9,10,40,50,90,100,400,500,900].reverse(),a=["0","I","IV","V","IX","X","XL","L","XC","C","CD","D","CM"].reverse();for(;r>0;)for(n=0;n<s.length;n++)if(s[n]<=r){i+=a[n],r-=s[n];break}for(n=0;n<o;n++)i="M".concat(i);return t[1]!==t[1].toUpperCase()&&(i=i.toLowerCase()),i}(e,t),e=i+e):e=t+i+e.toExponential(0)),e}function pg(e,t,n){const i=tg(e);return n?i:new RegExp(i||"",t)}function mg(e,t,n,i){let r,o,s,a,l,c,u,h,d,f=e.pattern;var p,m;i&&(e.abbreviate=!0),p=t,(m=n)&&(m=tg(m)),p&&(p=tg(p)),d=new RegExp("(?:[#0]+".concat(p,")?[#0]+(?:").concat(m,"[#0]+)?")),s=f.match(d),s=s?s[0]:"",a=s?f.substr(0,f.indexOf(s)):f,l=s?f.substring(f.indexOf(s)+s.length):"",s||(s=f?"#":"##########"),t&&t===n&&(r=s.split(n),o=r.pop(),s=r.join("")+n+o,t=""),c=t,t=/,/.test(n)?"¤":",",c&&(s=s.replace(pg(c,"g"),t)),u=n,n=".",u&&(s=s.replace(pg(u,"g"),n)),h=s.match(/#/g),h=h?h.length:0;const g=f.split(u);let y;g[1]&&(y=g[1].match(hg)),e.prefix=a||"",e.postfix=l||"",e.pattern=f,e.maxPrecision=y?y.length:2,e.percentage=ig.test(f),e.numericPattern=s||"",e.numericRegex=new RegExp("".concat(pg(t,null,!0),"|").concat(pg(n,null,!0)),"g"),e.groupTemp=c,e.decTemp=u,e.t=t,e.d=n,e.temp=h}class gg{constructor(e,t,n,i,r){this.localeInfo=e,this.pattern=t,this.thousandDelimiter=n||",",this.decimalDelimiter=i||".",this.type=r||"numeric",this.patternSeparator=";",this.abbreviations=function(e,t){if(!e||!e.qNumericalAbbreviation)return ng;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 gg(this.localeInfo,this.pattern,this.thousandDelimiter,this.decimalDelimiter,this.type);return e.subtype=this.subtype,e}format(e,t,n,i){return this.prepare(t,n,i),this.formatValue(e)}prepare(e,t,n){let i;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:""}},i=this._prepared,e=e.split(this.patternSeparator),i.positive.pattern=e[0],i.negative.pattern=e[1],i.zero.pattern=e[2],ug.test(e[0])&&(i.positive.isFunctional=!0),e[1]?ug.test(e[1])&&(i.negative.isFunctional=!0):i.negative=!1,e[2]?ug.test(e[2])&&(i.zero.isFunctional=!0):i.zero=!1;const r="U"===this.type;i.positive.isFunctional||mg(i.positive,t,n,r),i.negative&&!i.negative.isFunctional&&mg(i.negative,t,n,r),i.zero&&!i.zero.isFunctional&&mg(i.zero,t,n,r)}formatValue(e){let t,n,i,r,o,s,a,l,c,u=this._prepared,h="",d="",f=e;if(isNaN(e))return"".concat(f);if(e=+e,!1===u.pattern)return e.toString();if(0===e&&u.zero)return u=u.zero,u.pattern;if(e<0&&u.negative?(u=u.negative,e=-e):u=u.positive,o=u.d,s=u.t,u.isFunctional)e=fg(e,u.pattern,o);else{if(u.percentage&&(e*=100),u.abbreviate){const t=Object.keys(this.abbreviations).map((e=>parseInt(e,10))).sort(((e,t)=>e-t));let i,r,o=t[0];for(a=0,n=Number(Number(e).toExponential().split("e")[1]);o<=n&&a<t.length;)a++,o=t[a];a>0&&(i=t[a-1]),i&&n>0&&i>0?r=i:(n<0&&i<0||!i)&&(o<0&&o-n<=u.maxPrecision?r=o:i<=n&&!(o>0&&-n<=u.maxPrecision)&&(r=i)),r&&(h=this.abbreviations[r],e/=10**r)}if(i=Math.abs(e),t=u.temp,l=u.numericPattern,c=l.split(o)[1],"I"===this.type&&(e=Math.round(e)),r=e,c||"#"!==l.slice(-1)[0])if(i>=1e15||i>0&&i<=1e-14)e=i?i.toExponential(15).replace(/\.?0+(?=e)/,""):"0";else{const t=Number(e.toFixed(Math.min(20,c?c.length:0)).split(".")[0]);let n=l.split(o)[0];if(n+=o,e=eg(n,t)||"0",c){const t=Math.max(0,Math.min(14,c.length)),n=c.replace(/#+$/,"").length;let r=("I"===this.type?0:i%1).toFixed(t).slice(2).replace(/0+$/,"");for(a=r.length;a<n;a++)r+="0";r&&(e+=o+r)}else 0===t&&(r=0)}else if(i>=10**t||i<1||i<1e-4)0===e?e="0":i<1e-4||i>=1e20?(e=(e=r.toExponential(Math.max(1,Math.min(14,t))-1)).replace(/\.?0+(?=e)/,""),d=""):(e=e.toPrecision(Math.max(1,Math.min(14,t)))).indexOf(".")>=0&&(e=(e=e.replace(e.indexOf("e")<0?/0+$/:/\.?0+(?=e)/,"")).replace(".",o));else{for(l+=o,t=Math.max(0,Math.min(20,t-Math.ceil(Math.log(i)/Math.log(10)))),a=0;a<t;a++)l+="#";e=eg(l,e)}e=e.replace(u.numericRegex,(e=>e===s?u.groupTemp:e===o?u.decTemp:"")),r<0&&!/^-/.test(e)&&(e="-".concat(e))}return u.prefix+e+d+h+u.postfix}static getStaticFormatter(){return{prepare(){},formatValue:e=>"".concat(e)}}}function yg(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const{size:n=5e3,multipleArguments:i=!1,toKey:r=(e=>e)}=t;let o,s,a=Object.create(null),l=Object.create(null),c=0,u=0;return o=i?function(){return s=r(...arguments),o.has(s)?o.get(s):o.set(s,e(...arguments))}:t=>(s=r(t),o.has(s)?o.get(s):o.set(s,e(t))),o.set=(e,t)=>(c>=n&&(delete a[l[u]],delete l[u],c--,u++),a[e]=t,l[c]=e,c++,t),o.get=e=>a[e],o.has=e=>e in a,o.clear=()=>{a=Object.create(null),l=Object.create(null),c=0,u=0},o.size=()=>c,o}function vg(e,t,n,i,r){const o=function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return new gg(...t)}(r,e,t,n,i),s=yg(o.formatValue.bind(o),{toKey:e=>isNaN(e)?e:+e});function a(e){return s(e)}return a.format=function(e,t,n,i){return s.clear(),o.format(t,e,n,i)},a.pattern=function(e){return e&&(s.clear(),o.pattern=e,o.prepare()),o.pattern},a}const bg="D",xg="T",wg="TS",qg="IV",Mg=["Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"],Dg=["Mon","Tue","Wed","Thu","Fri","Sat","Sun"],Sg=["January","February","March","April","May","June","July","August","September","October","November","December"],_g=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function Cg(e,t){for(let n=e.length;n<t;n++)e="0".concat(e);return e}function kg(e){let t=e.toString().split(".");return t[1]?(t=Number("0.".concat(t[1])),t):0}function Eg(e,t){let n,i=function(e){const t=e,n=24*kg(t),i=60*kg(n),r=60*kg(i),o=1e3*kg(r);return{d:Math.floor(t),h:Math.floor(n),m:Math.floor(i),s:Math.floor(r),f:Math.round(o)}}(e),r=i.d,o=i.h,s=i.m,a=i.s,l=i.f,c=0;/w+|t+/gi.test(t)&&(n=new Date(Date.UTC(1899,11,30+Math.floor(e),0,0,Math.round(86400*(e-Math.floor(e))))),isNaN(n.getTime())&&(n=null)),/D+/gi.test(t)||(o+=24*r),/h+/gi.test(t)||(s+=60*o),/m+/gi.test(t)||(a+=60*s),/w+/gi.test(t)&&(c=n?n.getDay()-1:0,c<0&&(c=6));let u="";return n&&(u=n.getUTCHours()>=12?"pm":"am"),{year:0,month:0,day:c,date:r,h:o,m:s,s:a,f:l,t:u}}class Ag{constructor(e,t,n){const i=e||{};if(i.qCalendarStrings||(i.qCalendarStrings={qLongDayNames:Mg,qDayNames:Dg,qLongMonthNames:Sg,qMonthNames:_g}),this.localeInfo=i,this.locale_days=i.qCalendarStrings.qLongDayNames.slice(),this.locale_days_abbr=i.qCalendarStrings.qDayNames.slice(),this.locale_months=i.qCalendarStrings.qLongMonthNames.slice(),this.locale_months_abbr=i.qCalendarStrings.qMonthNames.slice(),!t){t={[xg]:i.qTimeFmt||"hh:mm:ss",[bg]:i.qDateFmt||"YYYY-MM-DD",[wg]:i.qTimestampFmt||"YYYY-MM-DD hh:mm:ss"}[n]}this.pattern=t}clone(){const e=new Ag(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 i;e instanceof Date?i=function(e,t){let n=e.getUTCHours(),i=e.getUTCDay()-1;return t&&(n%=12,n||(n=12)),i<0&&(i=6),{year:e.getUTCFullYear(),month:e.getUTCMonth(),day:i,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)),i=Eg(e,t));const r=function(e,t){return{"Y+|y+":{Y:"".concat(Number("".concat(t.year).slice(-2))),YY:Cg("".concat(t.year).slice(-2),2),YYY:Cg("".concat(t.year).slice(-3),3),def:e=>Cg("".concat(t.year),e.length)},"M+":{M:t.month+1,MM:Cg("".concat(t.month+1),2),MMM:e.locale_months_abbr[t.month],def:e.locale_months[t.month]},"W+|w+":{W:t.day,WW:Cg("".concat(t.day),2),WWW:e.locale_days_abbr[t.day],def:e.locale_days[t.day]},"D+|d+":{D:t.date,def:e=>Cg("".concat(t.date),e.length)},"h+|H+":{h:t.h,def:e=>Cg("".concat(t.h),e.length)},"m+":{m:t.m,def:e=>Cg("".concat(t.m),e.length)},"s+|S+":{s:t.s,def:e=>Cg("".concat(t.s),e.length)},"f+|F+":{def(e){let n="".concat(t.f),i=e.length-n.length;if(i>0)for(let e=0;e<i;e++)n+="0";else i<0&&(n=n.slice(0,e.length));return n}},"t{1,2}|T{1,2}":{def(e){let n=t.t;return e[0].toUpperCase()===e[0]&&(n=n.toUpperCase()),n=n.slice(0,e.length),n}}}}(this,i),o=[];for(const e in r)Object.prototype.hasOwnProperty.call(r,e)&&o.push(e);const s=new RegExp(o.join("|"),"g"),a=t.replace(s,(e=>{let t,n,i;for(n in r)if(Object.prototype.hasOwnProperty.call(r,n)&&(t=new RegExp(n),t.test(e)))break;if(!t)return"";for(const t in r[n])if(t===e||t.toLowerCase()===e){i=r[n][t],void 0===i&&(i=r[n][t.toLowerCase()]);break}return void 0===i&&(i=r[n].def),"function"==typeof i&&(i=i(e)),i}));return a}}function Tg(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return new Ag(...t)}function Ig(e){return new Date(Date.UTC(1899,11,30+Math.floor(e),0,0,0,Math.round(864e5*(e-Math.floor(e)))))}function Rg(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"TS",n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,i=Tg(n,e,t),r=yg(i.format.bind(i),{toKey:e=>"object"==typeof e&&"function"==typeof e.getTime?e.getTime():e});function o(e){return t!==qg?Ig(e):e}function s(e){return e=o(e),r(e)}return s.format=function(e,t){return r.clear(),t=o(t),i.format(t,e)},s.locale=function(n){return i=Tg(n,e,t),r=yg(i.format.bind(i),{toKey:e=>"object"==typeof e?e.getTime():e}),this},s.qtype=function(e){return void 0!==e&&(t=e,r.clear()),t},s}function Ng(e,t){if(e&&e.qNumFormat&&-1!==["D","T","TS","IV"].indexOf(e.qNumFormat.qType))return Rg(e.qNumFormat.qFmt,e.qNumFormat.qType,t);let n="#",i=t&&void 0!==t.qThousandSep?t.qThousandSep:",",r=t&&void 0!==t.qDecimalSep?t.qDecimalSep:".",o="U",s=e&&!!e.qIsAutoFormat;return e&&e.qNumFormat?(n=e.qNumFormat.qFmt||n,i=e.qNumFormat.qThou||i,r=e.qNumFormat.qDec||r,o=e.qNumFormat.qType||o,s=s&&-1===["M"].indexOf(e.qNumFormat.qType)):s=!0,(s||"U"===o)&&(n="#".concat(r,"##"),o="U"),vg(n,i,r,o,t)}function Og(){let e,{meta:t,id:n,key:i,localeInfo:r,fieldExtractor:o,value:s,type:a,sourceField:l}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const c=s||("dimension"===a?e=>null==e?void 0:e.qElemNo:e=>null==e?void 0:e.qValue),u=e=>(null==e?void 0:e.qText)||"",h="dimension"===a?"first":"avg",d=Ng(t,r),f="dimension"===a?"first":(e,t)=>d(t),p={id:()=>n,key:()=>i,raw:()=>t,title:()=>t.qFallbackTitle||t.label,type:()=>a,origin:()=>l,items:()=>(e||(e=o(p)),e),min:()=>t.qMin,max:()=>t.qMax,value:c,label:u,reduce:h,reduceLabel:f,formatter:()=>d,tags:()=>t.qTags};return p}function Pg(e,t,n,i,r){return(t[e]||[]).map(((t,o)=>{const s="".concat(i?"".concat(i,"/"):"").concat(e,"/").concat(o),a={instance:Og(mm({id:"".concat(n?"".concat(n,"/"):"").concat(s),key:s,meta:t},r))};return a.attrDims=Pg("qAttrDimInfo",t,n,s,mm({},r,{value:e=>null==e?void 0:e.qElemNo,type:"dimension"})),a.attrExps=Pg("qAttrExprInfo",t,n,s,mm({},r,{value:e=>null==e?void 0:e.qNum,type:"measure"})),a.measures=Pg("qMeasureInfo",t,n,s,mm({},r,{value:e=>null==e?void 0:e.qValue,type:"measure"})),a}))}function Lg(){let{key:e,data:t,config:n={}}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const i={fields:[],wrappedFields:[],allFields:[],virtualFields:[]},r=t;if(!r)throw new Error('Missing "data" input');if(!r.qDimensionInfo)throw new Error('The "data" input is not recognized as a hypercube');const o=Lg.util,s={cache:i,cube:r,localeInfo:n.localeInfo,fieldExtractor:null,pages:null,hierarchy:()=>null,virtualFields:n.virtualFields},a={key:()=>e,raw:()=>r,field:e=>zm(e,s),fields:()=>i.fields.slice(),extract:e=>s.extractor(e,a,i,o),hierarchy:e=>s.hierarchy(e,a,i,o),_cache:()=>i};"K"===r.qMode||"T"===r.qMode||!r.qMode&&r.qNodesOnDim?(s.extractor=Qm,s.hierarchy=Zm,s.pages="K"===r.qMode?r.qStackedDataPages:r.qTreeDataPages):"S"===r.qMode?(s.extractor=bm,s.pages=r.qDataPages,s.hierarchy=Zm):s.extractor=()=>[],s.fieldExtractor=e=>s.extractor({field:e},a,i,o);const l="S"===r.qMode?e=>e.qElemNumber:void 0,c="S"===r.qMode?e=>e.qNum:void 0;i.wrappedFields.push(...Pg("qDimensionInfo",r,e,"",mm({},s,{value:l,type:"dimension"}))),i.wrappedFields.push(...Pg("qMeasureInfo",r,e,"",mm({},s,{value:c,type:"measure"}))),i.fields=i.wrappedFields.map((e=>e.instance));const u=e=>{e.forEach((e=>{i.allFields.push(e.instance),u(e.measures),u(e.attrDims),u(e.attrExps)}))};return u(i.wrappedFields),(n.virtualFields||[]).forEach((t=>{const n=a.field(t.from),r=Og(om({meta:n.raw(),id:"".concat(e,"/").concat(t.key),sourceField:n,fieldExtractor:e=>s.extractor({field:e},a,i,o),key:t.key,type:n.type(),localeInfo:s.localeInfo,value:n.value},t.override||{}));i.virtualFields.push(r)})),i.allFields.push(...i.virtualFields),a}const Fg=[["qHyperCube","qHyperCubeDef"],["qTreeData","qTreeDataDef"],["qDimensionInfo","qDimensions"],["qMeasureInfo","qMeasures"],["qAttrDimInfo","qAttributeDimensions"],["qAttrExprInfo","qAttributeExpressions"]],zg=/\/qDimensionInfo(?:\/(\d+))?/,jg=/\/qMeasureInfo\/(\d+)/,Hg=/\/qAttrDimInfo\/(\d+)(?:\/(\d+))?/,Bg=/\/qAttrExprInfo\/(\d+)/,Vg=/\/?qHyperCube/,$g=/\/?qTreeData/,Wg=e=>"".concat(e.substr(0,e.indexOf("/qHyperCubeDef")+14)),Ug=e=>"".concat(e.substr(0,e.indexOf("/qTreeDataDef")+13));function Yg(e,t){let n=e,i=-1,r=-1,o="",s=e=>e;Vg.test(e)?(o="".concat(n.substr(0,n.indexOf("qHyperCube")+10)),s=Wg):$g.test(e)&&(o="".concat(n.substr(0,n.indexOf("qTreeData")+9)),s=Ug);let a=!0;if(zg.test(e)&&(i=+zg.exec(e)[1]),jg.test(e)&&(r=+jg.exec(e)[1]),Hg.test(e)){r=-1,i=0;const e=+Hg.exec(n)[2];isNaN(e)||(i=e,n=n.replace(/\/\d+$/,"")),a=!1}if(Bg.test(e)){const e=r;if(t){r=0;const s=Pm(o,t);r+=(s.qMeasureInfo||[]).length,i>-1?(r=s.qDimensionInfo.slice(0,i).reduce(((e,t)=>e+t.qAttrExprInfo.length),r),i=-1):(r=s.qDimensionInfo.reduce(((e,t)=>e+t.qAttrExprInfo.length),r),r=s.qMeasureInfo.slice(0,e).reduce(((e,t)=>e+t.qAttrExprInfo.length),r)),r+=+Bg.exec(n)[1]}else i>-1?(i=-1,r=+Bg.exec(n)[1]):r+=+Bg.exec(n)[1]+1}return Fg.forEach((e=>{let[t,i]=e;n=n.replace(t,i)})),a&&(n=s(n)),n&&"/"!==n[0]&&(n="/".concat(n)),{measureIdx:r,dimensionIdx:i,path:n}}function Xg(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2?arguments[2]:void 0;const i=t.byCells,r=t.primarySource,o=[],s={},a=e.isActive();let l=!1;if(e.brushes().forEach((e=>{const t=Yg(e.id,n);if("range"===e.type&&t.measureIdx>-1&&t.dimensionIdx>-1){const n=e.brush.ranges();n.length&&(l=!0,s.multiRangeSelectTreeDataValues||(s.multiRangeSelectTreeDataValues={path:t.path,ranges:[]}),n.forEach((e=>s.multiRangeSelectTreeDataValues.ranges.push({qMeasureIx:t.measureIdx,qDimensionIx:t.dimensionIdx,qRange:{qMin:e.min,qMax:e.max,qMinInclEq:!0,qMaxInclEq:!0}}))))}else{if("range"===e.type&&t.measureIdx>-1){const n=e.brush.ranges();n.length&&(l=!0,s.rangeSelectHyperCubeValues||(s.rangeSelectHyperCubeValues={path:t.path,ranges:[]}),n.forEach((e=>s.rangeSelectHyperCubeValues.ranges.push({qMeasureIx:t.measureIdx,qRange:{qMin:e.min,qMax:e.max,qMinInclEq:!0,qMaxInclEq:!0}}))))}if("range"===e.type&&t.dimensionIdx>-1){const n=e.brush.ranges();n.length&&(l=!0,s.selectHyperCubeContinuousRange||(s.selectHyperCubeContinuousRange={path:t.path,ranges:[]}),n.forEach((e=>s.selectHyperCubeContinuousRange.ranges.push({qDimIx:t.dimensionIdx,qRange:{qMin:e.min,qMax:e.max,qMinInclEq:!0,qMaxInclEq:!1}}))))}if("value"===e.type&&t.dimensionIdx>-1)if(i)if(n&&n.qHyperCube&&("P"===n.qHyperCube.qMode||"T"===n.qHyperCube.qMode||"K"===n.qHyperCube.qMode)){const i=n.qHyperCube,o=i.qNoOfLeftDims,a=i.qEffectiveInterColumnSortOrder.indexOf(t.dimensionIdx);if(s.selectPivotCells||(s.selectPivotCells={path:t.path,cells:[]}),e.id===r||!r){const n=e.brush.values().map((e=>+e)).filter((e=>!isNaN(e)));(0===o||a>=o)&&o>-1?n.forEach((e=>{s.selectPivotCells.cells.push({qType:"T",qCol:e,qRow:a-o})})):n.forEach((e=>{s.selectPivotCells.cells.push({qType:"L",qCol:t.dimensionIdx,qRow:e})})),l=!!s.selectPivotCells.cells.length}}else s.selectHyperCubeCells||(s.selectHyperCubeCells={path:t.path,cols:[]}),s.selectHyperCubeCells.cols.push(t.dimensionIdx),e.id!==r&&(r||s.selectHyperCubeCells.values)||(s.selectHyperCubeCells.values=e.brush.values().map((e=>+e)).filter((e=>!isNaN(e))),l=!!s.selectHyperCubeCells.values.length);else{const n=e.brush.values().map((e=>+e)).filter((e=>!isNaN(e)));l=!!n.length,o.push({params:[t.path,t.dimensionIdx,n,!1],method:"selectHyperCubeValues"})}}})),!l&&a)return[{method:"resetMadeSelections",params:[]}];var c;s.rangeSelectHyperCubeValues&&o.push({method:"rangeSelectHyperCubeValues",params:[s.rangeSelectHyperCubeValues.path,s.rangeSelectHyperCubeValues.ranges,[],null===(c=t.orMode)||void 0===c||c]});return s.selectHyperCubeContinuousRange&&o.push({method:"selectHyperCubeContinuousRange",params:[s.selectHyperCubeContinuousRange.path,s.selectHyperCubeContinuousRange.ranges]}),s.selectHyperCubeCells&&o.push({method:"selectHyperCubeCells",params:[s.selectHyperCubeCells.path,s.selectHyperCubeCells.values,s.selectHyperCubeCells.cols]}),s.selectPivotCells&&o.push({method:"selectPivotCells",params:[s.selectPivotCells.path,s.selectPivotCells.cells]}),s.multiRangeSelectTreeDataValues&&o.push({method:"multiRangeSelectTreeDataValues",params:[s.multiRangeSelectTreeDataValues.path,s.multiRangeSelectTreeDataValues.ranges]}),o}function Kg(e){Lg.util=e.data("matrix").util,e.data("q",Lg),e.formatter("q-number",vg),e.formatter("q-time",Rg)}Kg.qBrushHelper=Xg,Kg.selections=Xg;const Gg={click:"Tap",Click:"Tap",tap:"Tap",pan:"Pan",swipe:"Swipe",rotate:"Rotate",press:"Press",pinch:"Pinch"};function Jg(e){return Gg[e]||e}function Zg(e){return function(t,n,i){let r,o,s,a,l=[],c=!0;function u(){"function"==typeof r.enable&&(r.enable=r.enable.bind(o)()),r.enable&&(r.gestures.forEach((t=>{t.options=t.options||{},void 0===t.options.enable&&(t.options.enable=!0),"function"==typeof t.options.enable&&(t.options.enable=t.options.enable.bind(o));const n=Jg(t.type);e&&e[n]&&(t.options.event=t.options.event||t.type.toLowerCase(),s=s||new e.Manager(i),s.add(new e[n](t.options)),Object.keys(t.events).forEach((e=>{t.events[e]=t.events[e].bind(o),s.on(e,t.events[e])})),l.push(t))})),r.gestures.forEach((t=>{const n=Jg(t.type);e&&e[n]&&(t.recognizeWith&&s.get(t.options.event).recognizeWith(t.recognizeWith.split(" ").filter((e=>""!==e))),t.requireFailure&&s.get(t.options.event).requireFailure(t.requireFailure.split(" ").filter((e=>""!==e))))})))}function h(){l.forEach((e=>{Object.keys(e.events).forEach((t=>{s.off(t,e.events[t])})),s.remove(e.options.event)})),l=[]}return{get key(){return a},set(e){!function(e){a=e.key,r=e,o={chart:t,mediator:n,settings:r},r.gestures=r.gestures||[],void 0===r.enable&&(r.enable=!0)}(e),h(),c&&u()},off(){c=!1,h()},on(){c=!0,0===l.length&&u()},destroy(){h(),s&&s.destroy(),s=null,o=null,r=null}}}}var Qg={},ey={get exports(){return Qg},set exports(e){Qg=e}};
|
|
19
|
+
e.exports=function(e,t){if(!e||isNaN(+t))return t;var n,i,r,o,s,a,l,c,u,h,d=e.length,f=e.search(/[0-9\-\+#]/),p=f>0?e.substring(0,f):"",m=e.split("").reverse().join(""),g=m.search(/[0-9\-\+#]/),y=d-g,v=e.substring(y,y+1),b=y+("."===v||","===v?1:0),x=g>0?e.substring(b,d):"";if(n=(t="-"===(e=e.substring(f,b)).charAt(0)?-t:+t)<0?t=-t:0,r=(i=e.match(/[^\d\-\+#]/g))&&i[i.length-1]||".",o=i&&i[1]&&i[0]||",",e=e.split(r),t=+(t=t.toFixed(e[1]&&e[1].length))+"",a=e[1]&&e[1].lastIndexOf("0"),(!(c=t.split("."))[1]||c[1]&&c[1].length<=a)&&(t=(+t).toFixed(a+1)),u=e[0].split(o),e[0]=u.join(""),(s=e[0]&&e[0].indexOf("0"))>-1)for(;c[0].length<e[0].length-s;)c[0]="0"+c[0];else 0==+c[0]&&(c[0]="");if((t=t.split("."))[0]=c[0],l=u[1]&&u[u.length-1].length){for(m="",y=(h=t[0]).length%l,d=h.length,b=0;b<d;b++)m+=h.charAt(b),!((b-y+1)%l)&&b<d-l&&(m+=o);t[0]=m}return t[1]=e[1]&&t[1]?r+t[1]:"","0"!==(i=t.join(""))&&""!==i||(n=!1),p+(n?"-":"")+i+x}}));function Om(e){return e.replace(/[-[\]/{}()*+?.\\^$|]/g,"\\$&")}const Nm={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"},Pm=/%\)?$/,Lm=/^\(r(0[2-9]|[12]\d|3[0-6])\)/i,Fm=/^\(oct\)/i,zm=/^\(dec\)/i,jm=/^\(hex\)/i,Hm=/^\(bin\)/i,Bm=/^\(rom\)/i,Vm=/^(\(rom\)|\(bin\)|\(hex\)|\(dec\)|\(oct\)|\(r(0[2-9]|[12]\d|3[0-6])\))/i,$m=/#|0/g;function Wm(e,t,n,i){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(".",i||".")}function Um(e,t,n){let i;return Lm.test(t)?e=Wm(e,Number(/\d{2}/.exec(t)[0]),t,n):Fm.test(t)?e=Wm(e,8,t,n):zm.test(t)?e=Wm(e,10,t,n):jm.test(t)?e=Wm(e,16,t,n):Hm.test(t)?e=Wm(e,2,t,n):Bm.test(t)&&(i="",e<0&&(i="-",e=-e),0===(e=Math.floor(e))?e="0":e<=5e5?(e=function(e,t){let n,i="",r=Number(String(e).slice(-3)),o=(e-r)/1e3,s=[0,1,4,5,9,10,40,50,90,100,400,500,900].reverse(),a=["0","I","IV","V","IX","X","XL","L","XC","C","CD","D","CM"].reverse();for(;r>0;)for(n=0;n<s.length;n++)if(s[n]<=r){i+=a[n],r-=s[n];break}for(n=0;n<o;n++)i="M".concat(i);return t[1]!==t[1].toUpperCase()&&(i=i.toLowerCase()),i}(e,t),e=i+e):e=t+i+e.toExponential(0)),e}function Ym(e,t,n){const i=Om(e);return n?i:new RegExp(i||"",t)}function Xm(e,t,n,i){let r,o,s,a,l,c,u,h,d,f=e.pattern;var p,m;i&&(e.abbreviate=!0),p=t,(m=n)&&(m=Om(m)),p&&(p=Om(p)),d=new RegExp("(?:[#0]+".concat(p,")?[#0]+(?:").concat(m,"[#0]+)?")),s=f.match(d),s=s?s[0]:"",a=s?f.substr(0,f.indexOf(s)):f,l=s?f.substring(f.indexOf(s)+s.length):"",s||(s=f?"#":"##########"),t&&t===n&&(r=s.split(n),o=r.pop(),s=r.join("")+n+o,t=""),c=t,t=/,/.test(n)?"¤":",",c&&(s=s.replace(Ym(c,"g"),t)),u=n,n=".",u&&(s=s.replace(Ym(u,"g"),n)),h=s.match(/#/g),h=h?h.length:0;const g=f.split(u);let y;g[1]&&(y=g[1].match($m)),e.prefix=a||"",e.postfix=l||"",e.pattern=f,e.maxPrecision=y?y.length:2,e.percentage=Pm.test(f),e.numericPattern=s||"",e.numericRegex=new RegExp("".concat(Ym(t,null,!0),"|").concat(Ym(n,null,!0)),"g"),e.groupTemp=c,e.decTemp=u,e.t=t,e.d=n,e.temp=h}class Km{constructor(e,t,n,i,r){this.localeInfo=e,this.pattern=t,this.thousandDelimiter=n||",",this.decimalDelimiter=i||".",this.type=r||"numeric",this.patternSeparator=";",this.abbreviations=function(e,t){if(!e||!e.qNumericalAbbreviation)return Nm;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 Km(this.localeInfo,this.pattern,this.thousandDelimiter,this.decimalDelimiter,this.type);return e.subtype=this.subtype,e}format(e,t,n,i){return this.prepare(t,n,i),this.formatValue(e)}prepare(e,t,n){let i;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:""}},i=this._prepared,e=e.split(this.patternSeparator),i.positive.pattern=e[0],i.negative.pattern=e[1],i.zero.pattern=e[2],Vm.test(e[0])&&(i.positive.isFunctional=!0),e[1]?Vm.test(e[1])&&(i.negative.isFunctional=!0):i.negative=!1,e[2]?Vm.test(e[2])&&(i.zero.isFunctional=!0):i.zero=!1;const r="U"===this.type;i.positive.isFunctional||Xm(i.positive,t,n,r),i.negative&&!i.negative.isFunctional&&Xm(i.negative,t,n,r),i.zero&&!i.zero.isFunctional&&Xm(i.zero,t,n,r)}formatValue(e){let t,n,i,r,o,s,a,l,c,u=this._prepared,h="",d="",f=e;if(isNaN(e))return"".concat(f);if(e=+e,!1===u.pattern)return e.toString();if(0===e&&u.zero)return u=u.zero,u.pattern;if(e<0&&u.negative?(u=u.negative,e=-e):u=u.positive,o=u.d,s=u.t,u.isFunctional)e=Um(e,u.pattern,o);else{if(u.percentage&&(e*=100),u.abbreviate){const t=Object.keys(this.abbreviations).map((e=>parseInt(e,10))).sort(((e,t)=>e-t));let i,r,o=t[0];for(a=0,n=Number(Number(e).toExponential().split("e")[1]);o<=n&&a<t.length;)a++,o=t[a];a>0&&(i=t[a-1]),i&&n>0&&i>0?r=i:(n<0&&i<0||!i)&&(o<0&&o-n<=u.maxPrecision?r=o:i<=n&&!(o>0&&-n<=u.maxPrecision)&&(r=i)),r&&(h=this.abbreviations[r],e/=10**r)}if(i=Math.abs(e),t=u.temp,l=u.numericPattern,c=l.split(o)[1],"I"===this.type&&(e=Math.round(e)),r=e,c||"#"!==l.slice(-1)[0])if(i>=1e15||i>0&&i<=1e-14)e=i?i.toExponential(15).replace(/\.?0+(?=e)/,""):"0";else{const t=Number(e.toFixed(Math.min(20,c?c.length:0)).split(".")[0]);let n=l.split(o)[0];if(n+=o,e=Rm(n,t)||"0",c){const t=Math.max(0,Math.min(14,c.length)),n=c.replace(/#+$/,"").length;let r=("I"===this.type?0:i%1+1e-15).toFixed(t).slice(2).replace(/0+$/,"");for(a=r.length;a<n;a++)r+="0";r&&(e+=o+r)}else 0===t&&(r=0)}else if(i>=10**t||i<1||i<1e-4)0===e?e="0":i<1e-4||i>=1e20?(e=(e=r.toExponential(Math.max(1,Math.min(14,t))-1)).replace(/\.?0+(?=e)/,""),d=""):(e=e.toPrecision(Math.max(1,Math.min(14,t)))).indexOf(".")>=0&&(e=(e=e.replace(e.indexOf("e")<0?/0+$/:/\.?0+(?=e)/,"")).replace(".",o));else{for(l+=o,t=Math.max(0,Math.min(20,t-Math.ceil(Math.log(i)/Math.log(10)))),a=0;a<t;a++)l+="#";e=Rm(l,e)}e=e.replace(u.numericRegex,(e=>e===s?u.groupTemp:e===o?u.decTemp:"")),r<0&&!/^-/.test(e)&&(e="-".concat(e))}return u.prefix+e+d+h+u.postfix}static getStaticFormatter(){return{prepare(){},formatValue:e=>"".concat(e)}}}function Gm(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const{size:n=5e3,multipleArguments:i=!1,toKey:r=(e=>e)}=t;let o,s,a=Object.create(null),l=Object.create(null),c=0,u=0;return o=i?function(){return s=r(...arguments),o.has(s)?o.get(s):o.set(s,e(...arguments))}:t=>(s=r(t),o.has(s)?o.get(s):o.set(s,e(t))),o.set=(e,t)=>(c>=n&&(delete a[l[u]],delete l[u],c--,u++),a[e]=t,l[c]=e,c++,t),o.get=e=>a[e],o.has=e=>e in a,o.clear=()=>{a=Object.create(null),l=Object.create(null),c=0,u=0},o.size=()=>c,o}function Jm(e,t,n,i,r){const o=function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return new Km(...t)}(r,e,t,n,i),s=Gm(o.formatValue.bind(o),{toKey:e=>isNaN(e)?e:+e});function a(e){return s(e)}return a.format=function(e,t,n,i){return s.clear(),o.format(t,e,n,i)},a.pattern=function(e){return e&&(s.clear(),o.pattern=e,o.prepare()),o.pattern},a}const Zm={AUTO:"U",INTEGER:"I",NUMBER:"R",FIXED_TO:"F",MONEY:"M",DATE:"D",TIME:"T",DATE_TIME:"TS",INTERVAL:"IV"},Qm=["Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"],eg=["Mon","Tue","Wed","Thu","Fri","Sat","Sun"],tg=["January","February","March","April","May","June","July","August","September","October","November","December"],ng=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function ig(e,t){for(let n=e.length;n<t;n++)e="0".concat(e);return e}function rg(e){let t=e.toString().split(".");return t[1]?(t=Number("0.".concat(t[1])),t):0}function og(e,t){let n,i=function(e){const t=e,n=24*rg(t),i=60*rg(n),r=60*rg(i),o=1e3*rg(r);return{d:Math.floor(t),h:Math.floor(n),m:Math.floor(i),s:Math.floor(r),f:Math.round(o)}}(e),r=i.d,o=i.h,s=i.m,a=i.s,l=i.f,c=0;/w+|t+/gi.test(t)&&(n=new Date(Date.UTC(1899,11,30+Math.floor(e),0,0,Math.round(86400*(e-Math.floor(e))))),isNaN(n.getTime())&&(n=null)),/D+/gi.test(t)||(o+=24*r),/h+/gi.test(t)||(s+=60*o),/m+/gi.test(t)||(a+=60*s),/w+/gi.test(t)&&(c=n?n.getDay()-1:0,c<0&&(c=6));let u="";return n&&(u=n.getUTCHours()>=12?"pm":"am"),{year:0,month:0,day:c,date:r,h:o,m:s,s:a,f:l,t:u}}class sg{constructor(e,t,n){const i=e||{};if(i.qCalendarStrings||(i.qCalendarStrings={qLongDayNames:Qm,qDayNames:eg,qLongMonthNames:tg,qMonthNames:ng}),this.localeInfo=i,this.locale_days=i.qCalendarStrings.qLongDayNames.slice(),this.locale_days_abbr=i.qCalendarStrings.qDayNames.slice(),this.locale_months=i.qCalendarStrings.qLongMonthNames.slice(),this.locale_months_abbr=i.qCalendarStrings.qMonthNames.slice(),!t){t={[Zm.TIME]:i.qTimeFmt||"hh:mm:ss",[Zm.DATE]:i.qDateFmt||"YYYY-MM-DD",[Zm.DATE_TIME]:i.qTimestampFmt||"YYYY-MM-DD hh:mm:ss"}[n]}this.pattern=t}clone(){const e=new sg(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 i;e instanceof Date?i=function(e,t){let n=e.getUTCHours(),i=e.getUTCDay()-1;return t&&(n%=12,n||(n=12)),i<0&&(i=6),{year:e.getUTCFullYear(),month:e.getUTCMonth(),day:i,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)),i=og(e,t));const r=function(e,t){return{"Y+|y+":{Y:"".concat(Number("".concat(t.year).slice(-2))),YY:ig("".concat(t.year).slice(-2),2),YYY:ig("".concat(t.year).slice(-3),3),def:e=>ig("".concat(t.year),e.length)},"M+":{M:t.month+1,MM:ig("".concat(t.month+1),2),MMM:e.locale_months_abbr[t.month],def:e.locale_months[t.month]},"W+|w+":{W:t.day,WW:ig("".concat(t.day),2),WWW:e.locale_days_abbr[t.day],def:e.locale_days[t.day]},"D+|d+":{D:t.date,def:e=>ig("".concat(t.date),e.length)},"h+|H+":{h:t.h,def:e=>ig("".concat(t.h),e.length)},"m+":{m:t.m,def:e=>ig("".concat(t.m),e.length)},"s+|S+":{s:t.s,def:e=>ig("".concat(t.s),e.length)},"f+|F+":{def(e){let n="".concat(t.f),i=e.length-n.length;if(i>0)for(let e=0;e<i;e++)n+="0";else i<0&&(n=n.slice(0,e.length));return n}},"t{1,2}|T{1,2}":{def(e){let n=t.t;return e[0].toUpperCase()===e[0]&&(n=n.toUpperCase()),n=n.slice(0,e.length),n}}}}(this,i),o=[];for(const e in r)Object.prototype.hasOwnProperty.call(r,e)&&o.push(e);const s=new RegExp(o.join("|"),"g"),a=t.replace(s,(e=>{let t,n,i;for(n in r)if(Object.prototype.hasOwnProperty.call(r,n)&&(t=new RegExp(n),t.test(e)))break;if(!t)return"";for(const t in r[n])if(t===e||t.toLowerCase()===e){i=r[n][t],void 0===i&&(i=r[n][t.toLowerCase()]);break}return void 0===i&&(i=r[n].def),"function"==typeof i&&(i=i(e)),i}));return a}}function ag(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return new sg(...t)}const lg=864e5;function cg(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"TS",n=ag(arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,e,t),i=Gm(n.format.bind(n),{toKey:e=>"object"==typeof e&&"function"==typeof e.getTime?e.getTime():e});function r(e){return t!==Zm.INTERVAL?function(e){return new Date(Date.UTC(1899,11,30+Math.floor(e),0,0,0,Math.round(lg*(e-Math.floor(e)))))}(e):e}function o(e){return e=r(e),i(e)}return o.format=function(e,t){return i.clear(),t=r(t),n.format(t,e)},o.locale=function(r){return n=ag(r,e,t),i=Gm(n.format.bind(n),{toKey:e=>"object"==typeof e?e.getTime():e}),this},o.qtype=function(e){return void 0!==e&&(t=e,i.clear()),t},o}function ug(e,t){if(e&&e.qNumFormat&&-1!==["D","T","TS","IV"].indexOf(e.qNumFormat.qType))return cg(e.qNumFormat.qFmt,e.qNumFormat.qType,t);let n="#",i=t&&void 0!==t.qThousandSep?t.qThousandSep:",",r=t&&void 0!==t.qDecimalSep?t.qDecimalSep:".",o="U",s=e&&!!e.qIsAutoFormat;return e&&e.qNumFormat?(n=e.qNumFormat.qFmt||n,i=e.qNumFormat.qThou||i,r=e.qNumFormat.qDec||r,o=e.qNumFormat.qType||o,s=s&&-1===["M"].indexOf(e.qNumFormat.qType)):s=!0,(s||"U"===o)&&(n="#".concat(r,"##"),o="U"),Jm(n,i,r,o,t)}function hg(){let e,{meta:t,id:n,key:i,localeInfo:r,fieldExtractor:o,value:s,type:a,sourceField:l}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const c=s||("dimension"===a?e=>null==e?void 0:e.qElemNo:e=>null==e?void 0:e.qValue),u="dimension"===a?"first":"avg",h=ug(t,r),d="dimension"===a?"first":(e,t)=>h(t),f={id:()=>n,key:()=>i,raw:()=>t,title:()=>t.qFallbackTitle||t.label,type:()=>a,origin:()=>l,items:()=>(e||(e=o(f)),e),min:()=>t.qMin,max:()=>t.qMax,value:c,label:e=>(null==e?void 0:e.qText)||"",reduce:u,reduceLabel:d,formatter:()=>h,tags:()=>t.qTags};return f}function dg(e,t,n,i,r){return(t[e]||[]).map(((t,o)=>{const s="".concat(i?"".concat(i,"/"):"").concat(e,"/").concat(o),a={instance:hg(Gp({id:"".concat(n?"".concat(n,"/"):"").concat(s),key:s,meta:t},r))};return a.attrDims=dg("qAttrDimInfo",t,n,s,Gp({},r,{value:e=>null==e?void 0:e.qElemNo,type:"dimension"})),a.attrExps=dg("qAttrExprInfo",t,n,s,Gp({},r,{value:e=>null==e?void 0:e.qNum,type:"measure"})),a.measures=dg("qMeasureInfo",t,n,s,Gp({},r,{value:e=>null==e?void 0:e.qValue,type:"measure"})),a}))}function fg(){let{key:e,data:t,config:n={}}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const i={fields:[],wrappedFields:[],allFields:[],virtualFields:[]},r=t;if(!r)throw new Error('Missing "data" input');if(!r.qDimensionInfo)throw new Error('The "data" input is not recognized as a hypercube');const o=fg.util,s={cache:i,cube:r,localeInfo:n.localeInfo,fieldExtractor:null,pages:null,hierarchy:()=>null,virtualFields:n.virtualFields},a={key:()=>e,raw:()=>r,field:e=>function(e,t){let{cache:n}=t;if("number"==typeof e)return n.fields[e];const i=n.allFields;if("function"==typeof e){for(let t=0;t<i.length;t++)if(e(i[t]))return i[t];return!1}if("string"==typeof e){for(let t=0;t<i.length;t++)if(i[t].key()===e||i[t].title()===e)return i[t]}else if(e&&-1!==i.indexOf(e))return e;throw Error("Field not found: ".concat(e))}(e,s),fields:()=>i.fields.slice(),extract:e=>s.extractor(e,a,i,o),hierarchy:e=>s.hierarchy(e,a,i,o),_cache:()=>i};"K"===r.qMode||"T"===r.qMode||!r.qMode&&r.qNodesOnDim?(s.extractor=Im,s.hierarchy=Tm,s.pages="K"===r.qMode?r.qStackedDataPages:r.qTreeDataPages):"S"===r.qMode?(s.extractor=em,s.pages=r.qDataPages,s.hierarchy=Tm):s.extractor=()=>[],s.fieldExtractor=e=>s.extractor({field:e},a,i,o);const l="S"===r.qMode?e=>e.qElemNumber:void 0,c="S"===r.qMode?e=>e.qNum:void 0;i.wrappedFields.push(...dg("qDimensionInfo",r,e,"",Gp({},s,{value:l,type:"dimension"}))),i.wrappedFields.push(...dg("qMeasureInfo",r,e,"",Gp({},s,{value:c,type:"measure"}))),i.fields=i.wrappedFields.map((e=>e.instance));const u=e=>{e.forEach((e=>{i.allFields.push(e.instance),u(e.measures),u(e.attrDims),u(e.attrExps)}))};return u(i.wrappedFields),(n.virtualFields||[]).forEach((t=>{const n=a.field(t.from),r=hg(jp({meta:n.raw(),id:"".concat(e,"/").concat(t.key),sourceField:n,fieldExtractor:e=>s.extractor({field:e},a,i,o),key:t.key,type:n.type(),localeInfo:s.localeInfo,value:n.value},t.override||{}));i.virtualFields.push(r)})),i.allFields.push(...i.virtualFields),a}const pg=[["qHyperCube","qHyperCubeDef"],["qTreeData","qTreeDataDef"],["qDimensionInfo","qDimensions"],["qMeasureInfo","qMeasures"],["qAttrDimInfo","qAttributeDimensions"],["qAttrExprInfo","qAttributeExpressions"]],mg=/\/qDimensionInfo(?:\/(\d+))?/,gg=/\/qMeasureInfo\/(\d+)/,yg=/\/qAttrDimInfo\/(\d+)(?:\/(\d+))?/,vg=/\/qAttrExprInfo\/(\d+)/,bg=/\/?qHyperCube/,xg=/\/?qTreeData/,wg=e=>"".concat(e.substr(0,e.indexOf("/qHyperCubeDef")+14)),qg=e=>"".concat(e.substr(0,e.indexOf("/qTreeDataDef")+13));function Sg(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2?arguments[2]:void 0;const i=t.byCells,r=t.primarySource,o=[],s={},a=e.isActive();let l=!1;if(e.brushes().forEach((e=>{const t=function(e,t){let n=e,i=-1,r=-1,o="",s=e=>e;bg.test(e)?(o="".concat(n.substr(0,n.indexOf("qHyperCube")+10)),s=wg):xg.test(e)&&(o="".concat(n.substr(0,n.indexOf("qTreeData")+9)),s=qg);let a=!0;if(mg.test(e)&&(i=+mg.exec(e)[1]),gg.test(e)&&(r=+gg.exec(e)[1]),yg.test(e)){r=-1,i=0;const e=+yg.exec(n)[2];isNaN(e)||(i=e,n=n.replace(/\/\d+$/,"")),a=!1}if(vg.test(e)){const e=r;if(t){r=0;const s=ym(o,t);r+=(s.qMeasureInfo||[]).length,i>-1?(r=s.qDimensionInfo.slice(0,i).reduce(((e,t)=>e+t.qAttrExprInfo.length),r),i=-1):(r=s.qDimensionInfo.reduce(((e,t)=>e+t.qAttrExprInfo.length),r),r=s.qMeasureInfo.slice(0,e).reduce(((e,t)=>e+t.qAttrExprInfo.length),r)),r+=+vg.exec(n)[1]}else i>-1?(i=-1,r=+vg.exec(n)[1]):r+=+vg.exec(n)[1]+1}return pg.forEach((e=>{let[t,i]=e;n=n.replace(t,i)})),a&&(n=s(n)),n&&"/"!==n[0]&&(n="/".concat(n)),{measureIdx:r,dimensionIdx:i,path:n}}(e.id,n);if("range"===e.type&&t.measureIdx>-1&&t.dimensionIdx>-1){const n=e.brush.ranges();n.length&&(l=!0,s.multiRangeSelectTreeDataValues||(s.multiRangeSelectTreeDataValues={path:t.path,ranges:[]}),n.forEach((e=>s.multiRangeSelectTreeDataValues.ranges.push({qMeasureIx:t.measureIdx,qDimensionIx:t.dimensionIdx,qRange:{qMin:e.min,qMax:e.max,qMinInclEq:!0,qMaxInclEq:!0}}))))}else{if("range"===e.type&&t.measureIdx>-1){const n=e.brush.ranges();n.length&&(l=!0,s.rangeSelectHyperCubeValues||(s.rangeSelectHyperCubeValues={path:t.path,ranges:[]}),n.forEach((e=>s.rangeSelectHyperCubeValues.ranges.push({qMeasureIx:t.measureIdx,qRange:{qMin:e.min,qMax:e.max,qMinInclEq:!0,qMaxInclEq:!0}}))))}if("range"===e.type&&t.dimensionIdx>-1){const n=e.brush.ranges();n.length&&(l=!0,s.selectHyperCubeContinuousRange||(s.selectHyperCubeContinuousRange={path:t.path,ranges:[]}),n.forEach((e=>s.selectHyperCubeContinuousRange.ranges.push({qDimIx:t.dimensionIdx,qRange:{qMin:e.min,qMax:e.max,qMinInclEq:!0,qMaxInclEq:!1}}))))}if("value"===e.type&&t.dimensionIdx>-1)if(i)if(n&&n.qHyperCube&&("P"===n.qHyperCube.qMode||"T"===n.qHyperCube.qMode||"K"===n.qHyperCube.qMode)){const i=n.qHyperCube,o=i.qNoOfLeftDims,a=i.qEffectiveInterColumnSortOrder.indexOf(t.dimensionIdx);if(s.selectPivotCells||(s.selectPivotCells={path:t.path,cells:[]}),e.id===r||!r){const n=e.brush.values().map((e=>+e)).filter((e=>!isNaN(e)));(0===o||a>=o)&&o>-1?n.forEach((e=>{s.selectPivotCells.cells.push({qType:"T",qCol:e,qRow:a-o})})):n.forEach((e=>{s.selectPivotCells.cells.push({qType:"L",qCol:t.dimensionIdx,qRow:e})})),l=!!s.selectPivotCells.cells.length}}else s.selectHyperCubeCells||(s.selectHyperCubeCells={path:t.path,cols:[]}),s.selectHyperCubeCells.cols.push(t.dimensionIdx),e.id!==r&&(r||s.selectHyperCubeCells.values)||(s.selectHyperCubeCells.values=e.brush.values().map((e=>+e)).filter((e=>!isNaN(e))),l=!!s.selectHyperCubeCells.values.length);else{const n=e.brush.values().map((e=>+e)).filter((e=>!isNaN(e)));l=!!n.length,o.push({params:[t.path,t.dimensionIdx,n,!1],method:"selectHyperCubeValues"})}}})),!l&&a)return[{method:"resetMadeSelections",params:[]}];var c;s.rangeSelectHyperCubeValues&&o.push({method:"rangeSelectHyperCubeValues",params:[s.rangeSelectHyperCubeValues.path,s.rangeSelectHyperCubeValues.ranges,[],null===(c=t.orMode)||void 0===c||c]});return s.selectHyperCubeContinuousRange&&o.push({method:"selectHyperCubeContinuousRange",params:[s.selectHyperCubeContinuousRange.path,s.selectHyperCubeContinuousRange.ranges]}),s.selectHyperCubeCells&&o.push({method:"selectHyperCubeCells",params:[s.selectHyperCubeCells.path,s.selectHyperCubeCells.values,s.selectHyperCubeCells.cols]}),s.selectPivotCells&&o.push({method:"selectPivotCells",params:[s.selectPivotCells.path,s.selectPivotCells.cells]}),s.multiRangeSelectTreeDataValues&&o.push({method:"multiRangeSelectTreeDataValues",params:[s.multiRangeSelectTreeDataValues.path,s.multiRangeSelectTreeDataValues.ranges]}),o}function Mg(e){fg.util=e.data("matrix").util,e.data("q",fg),e.formatter("q-number",Jm),e.formatter("q-time",cg)}Mg.qBrushHelper=Sg,Mg.selections=Sg;const Dg={click:"Tap",Click:"Tap",tap:"Tap",pan:"Pan",swipe:"Swipe",rotate:"Rotate",press:"Press",pinch:"Pinch"};function _g(e){return Dg[e]||e}function Cg(e){return function(t,n,i){let r,o,s,a,l=[],c=!0;function u(){"function"==typeof r.enable&&(r.enable=r.enable.bind(o)()),r.enable&&(r.gestures.forEach((t=>{t.options=t.options||{},void 0===t.options.enable&&(t.options.enable=!0),"function"==typeof t.options.enable&&(t.options.enable=t.options.enable.bind(o));const n=_g(t.type);e&&e[n]&&(t.options.event=t.options.event||t.type.toLowerCase(),s=s||new e.Manager(i),s.add(new e[n](t.options)),Object.keys(t.events).forEach((e=>{t.events[e]=t.events[e].bind(o),s.on(e,t.events[e])})),l.push(t))})),r.gestures.forEach((t=>{const n=_g(t.type);e&&e[n]&&(t.recognizeWith&&s.get(t.options.event).recognizeWith(t.recognizeWith.split(" ").filter((e=>""!==e))),t.requireFailure&&s.get(t.options.event).requireFailure(t.requireFailure.split(" ").filter((e=>""!==e))))})))}function h(){l.forEach((e=>{Object.keys(e.events).forEach((t=>{s.off(t,e.events[t])})),s.remove(e.options.event)})),l=[]}return{get key(){return a},set(e){!function(e){a=e.key,r=e,o={chart:t,mediator:n,settings:r},r.gestures=r.gestures||[],void 0===r.enable&&(r.enable=!0)}(e),h(),c&&u()},off(){c=!1,h()},on(){c=!0,0===l.length&&u()},destroy(){h(),s&&s.destroy(),s=null,o=null,r=null}}}}var kg={exports:{}};
|
|
35
20
|
/*! Hammer.JS - v2.0.7 - 2016-04-22
|
|
36
21
|
* http://hammerjs.github.io/
|
|
37
22
|
*
|
|
38
23
|
* Copyright (c) 2016 Jorik Tangelder;
|
|
39
|
-
* Licensed under the MIT license */
|
|
40
|
-
!function(e){!function(t,n,i,r){var o,s=["","webkit","Moz","MS","ms","o"],a=n.createElement("div"),l=Math.round,c=Math.abs,u=Date.now;function h(e,t,n){return setTimeout(v(e,n),t)}function d(e,t,n){return!!Array.isArray(e)&&(f(e,n[t],n),!0)}function f(e,t,n){var i;if(e)if(e.forEach)e.forEach(t,n);else if(e.length!==r)for(i=0;i<e.length;)t.call(n,e[i],i,e),i++;else for(i in e)e.hasOwnProperty(i)&&t.call(n,e[i],i,e)}function p(e,n,i){var r="DEPRECATED METHOD: "+n+"\n"+i+" AT \n";return function(){var n=new Error("get-stack-trace"),i=n&&n.stack?n.stack.replace(/^[^\(]+?[\n$]/gm,"").replace(/^\s+at\s+/gm,"").replace(/^Object.<anonymous>\s*\(/gm,"{anonymous}()@"):"Unknown Stack Trace",o=t.console&&(t.console.warn||t.console.log);return o&&o.call(t.console,r,i),e.apply(this,arguments)}}o="function"!=typeof Object.assign?function(e){if(e===r||null===e)throw new TypeError("Cannot convert undefined or null to object");for(var t=Object(e),n=1;n<arguments.length;n++){var i=arguments[n];if(i!==r&&null!==i)for(var o in i)i.hasOwnProperty(o)&&(t[o]=i[o])}return t}:Object.assign;var m=p((function(e,t,n){for(var i=Object.keys(t),o=0;o<i.length;)(!n||n&&e[i[o]]===r)&&(e[i[o]]=t[i[o]]),o++;return e}),"extend","Use `assign`."),g=p((function(e,t){return m(e,t,!0)}),"merge","Use `assign`.");function y(e,t,n){var i,r=t.prototype;(i=e.prototype=Object.create(r)).constructor=e,i._super=r,n&&o(i,n)}function v(e,t){return function(){return e.apply(t,arguments)}}function b(e,t){return"function"==typeof e?e.apply(t&&t[0]||r,t):e}function x(e,t){return e===r?t:e}function w(e,t,n){f(S(t),(function(t){e.addEventListener(t,n,!1)}))}function q(e,t,n){f(S(t),(function(t){e.removeEventListener(t,n,!1)}))}function M(e,t){for(;e;){if(e==t)return!0;e=e.parentNode}return!1}function D(e,t){return e.indexOf(t)>-1}function S(e){return e.trim().split(/\s+/g)}function _(e,t,n){if(e.indexOf&&!n)return e.indexOf(t);for(var i=0;i<e.length;){if(n&&e[i][n]==t||!n&&e[i]===t)return i;i++}return-1}function C(e){return Array.prototype.slice.call(e,0)}function k(e,t,n){for(var i=[],r=[],o=0;o<e.length;){var s=t?e[o][t]:e[o];_(r,s)<0&&i.push(e[o]),r[o]=s,o++}return n&&(i=t?i.sort((function(e,n){return e[t]>n[t]})):i.sort()),i}function E(e,t){for(var n,i,o=t[0].toUpperCase()+t.slice(1),a=0;a<s.length;){if((i=(n=s[a])?n+o:t)in e)return i;a++}return r}var A=1;function T(e){var n=e.ownerDocument||e;return n.defaultView||n.parentWindow||t}var I="ontouchstart"in t,R=E(t,"PointerEvent")!==r,N=I&&/mobile|tablet|ip(ad|hone|od)|android/i.test(navigator.userAgent),O="touch",P="mouse",L=24,F=["x","y"],z=["clientX","clientY"];function j(e,t){var n=this;this.manager=e,this.callback=t,this.element=e.element,this.target=e.options.inputTarget,this.domHandler=function(t){b(e.options.enable,[e])&&n.handler(t)},this.init()}function H(e,t,n){var i=n.pointers.length,o=n.changedPointers.length,s=1&t&&i-o==0,a=12&t&&i-o==0;n.isFirst=!!s,n.isFinal=!!a,s&&(e.session={}),n.eventType=t,function(e,t){var n=e.session,i=t.pointers,o=i.length;n.firstInput||(n.firstInput=B(t));o>1&&!n.firstMultiple?n.firstMultiple=B(t):1===o&&(n.firstMultiple=!1);var s=n.firstInput,a=n.firstMultiple,l=a?a.center:s.center,h=t.center=V(i);t.timeStamp=u(),t.deltaTime=t.timeStamp-s.timeStamp,t.angle=Y(l,h),t.distance=U(l,h),function(e,t){var n=t.center,i=e.offsetDelta||{},r=e.prevDelta||{},o=e.prevInput||{};1!==t.eventType&&4!==o.eventType||(r=e.prevDelta={x:o.deltaX||0,y:o.deltaY||0},i=e.offsetDelta={x:n.x,y:n.y});t.deltaX=r.x+(n.x-i.x),t.deltaY=r.y+(n.y-i.y)}(n,t),t.offsetDirection=W(t.deltaX,t.deltaY);var d=$(t.deltaTime,t.deltaX,t.deltaY);t.overallVelocityX=d.x,t.overallVelocityY=d.y,t.overallVelocity=c(d.x)>c(d.y)?d.x:d.y,t.scale=a?function(e,t){return U(t[0],t[1],z)/U(e[0],e[1],z)}(a.pointers,i):1,t.rotation=a?function(e,t){return Y(t[1],t[0],z)+Y(e[1],e[0],z)}(a.pointers,i):0,t.maxPointers=n.prevInput?t.pointers.length>n.prevInput.maxPointers?t.pointers.length:n.prevInput.maxPointers:t.pointers.length,function(e,t){var n,i,o,s,a=e.lastInterval||t,l=t.timeStamp-a.timeStamp;if(8!=t.eventType&&(l>25||a.velocity===r)){var u=t.deltaX-a.deltaX,h=t.deltaY-a.deltaY,d=$(l,u,h);i=d.x,o=d.y,n=c(d.x)>c(d.y)?d.x:d.y,s=W(u,h),e.lastInterval=t}else n=a.velocity,i=a.velocityX,o=a.velocityY,s=a.direction;t.velocity=n,t.velocityX=i,t.velocityY=o,t.direction=s}(n,t);var f=e.element;M(t.srcEvent.target,f)&&(f=t.srcEvent.target);t.target=f}(e,n),e.emit("hammer.input",n),e.recognize(n),e.session.prevInput=n}function B(e){for(var t=[],n=0;n<e.pointers.length;)t[n]={clientX:l(e.pointers[n].clientX),clientY:l(e.pointers[n].clientY)},n++;return{timeStamp:u(),pointers:t,center:V(t),deltaX:e.deltaX,deltaY:e.deltaY}}function V(e){var t=e.length;if(1===t)return{x:l(e[0].clientX),y:l(e[0].clientY)};for(var n=0,i=0,r=0;r<t;)n+=e[r].clientX,i+=e[r].clientY,r++;return{x:l(n/t),y:l(i/t)}}function $(e,t,n){return{x:t/e||0,y:n/e||0}}function W(e,t){return e===t?1:c(e)>=c(t)?e<0?2:4:t<0?8:16}function U(e,t,n){n||(n=F);var i=t[n[0]]-e[n[0]],r=t[n[1]]-e[n[1]];return Math.sqrt(i*i+r*r)}function Y(e,t,n){n||(n=F);var i=t[n[0]]-e[n[0]],r=t[n[1]]-e[n[1]];return 180*Math.atan2(r,i)/Math.PI}j.prototype={handler:function(){},init:function(){this.evEl&&w(this.element,this.evEl,this.domHandler),this.evTarget&&w(this.target,this.evTarget,this.domHandler),this.evWin&&w(T(this.element),this.evWin,this.domHandler)},destroy:function(){this.evEl&&q(this.element,this.evEl,this.domHandler),this.evTarget&&q(this.target,this.evTarget,this.domHandler),this.evWin&&q(T(this.element),this.evWin,this.domHandler)}};var X={mousedown:1,mousemove:2,mouseup:4},K="mousedown",G="mousemove mouseup";function J(){this.evEl=K,this.evWin=G,this.pressed=!1,j.apply(this,arguments)}y(J,j,{handler:function(e){var t=X[e.type];1&t&&0===e.button&&(this.pressed=!0),2&t&&1!==e.which&&(t=4),this.pressed&&(4&t&&(this.pressed=!1),this.callback(this.manager,t,{pointers:[e],changedPointers:[e],pointerType:P,srcEvent:e}))}});var Z={pointerdown:1,pointermove:2,pointerup:4,pointercancel:8,pointerout:8},Q={2:O,3:"pen",4:P,5:"kinect"},ee="pointerdown",te="pointermove pointerup pointercancel";function ne(){this.evEl=ee,this.evWin=te,j.apply(this,arguments),this.store=this.manager.session.pointerEvents=[]}t.MSPointerEvent&&!t.PointerEvent&&(ee="MSPointerDown",te="MSPointerMove MSPointerUp MSPointerCancel"),y(ne,j,{handler:function(e){var t=this.store,n=!1,i=e.type.toLowerCase().replace("ms",""),r=Z[i],o=Q[e.pointerType]||e.pointerType,s=o==O,a=_(t,e.pointerId,"pointerId");1&r&&(0===e.button||s)?a<0&&(t.push(e),a=t.length-1):12&r&&(n=!0),a<0||(t[a]=e,this.callback(this.manager,r,{pointers:t,changedPointers:[e],pointerType:o,srcEvent:e}),n&&t.splice(a,1))}});var ie={touchstart:1,touchmove:2,touchend:4,touchcancel:8},re="touchstart",oe="touchstart touchmove touchend touchcancel";function se(){this.evTarget=re,this.evWin=oe,this.started=!1,j.apply(this,arguments)}function ae(e,t){var n=C(e.touches),i=C(e.changedTouches);return 12&t&&(n=k(n.concat(i),"identifier",!0)),[n,i]}y(se,j,{handler:function(e){var t=ie[e.type];if(1===t&&(this.started=!0),this.started){var n=ae.call(this,e,t);12&t&&n[0].length-n[1].length==0&&(this.started=!1),this.callback(this.manager,t,{pointers:n[0],changedPointers:n[1],pointerType:O,srcEvent:e})}}});var le={touchstart:1,touchmove:2,touchend:4,touchcancel:8},ce="touchstart touchmove touchend touchcancel";function ue(){this.evTarget=ce,this.targetIds={},j.apply(this,arguments)}function he(e,t){var n=C(e.touches),i=this.targetIds;if(3&t&&1===n.length)return i[n[0].identifier]=!0,[n,n];var r,o,s=C(e.changedTouches),a=[],l=this.target;if(o=n.filter((function(e){return M(e.target,l)})),1===t)for(r=0;r<o.length;)i[o[r].identifier]=!0,r++;for(r=0;r<s.length;)i[s[r].identifier]&&a.push(s[r]),12&t&&delete i[s[r].identifier],r++;return a.length?[k(o.concat(a),"identifier",!0),a]:void 0}y(ue,j,{handler:function(e){var t=le[e.type],n=he.call(this,e,t);n&&this.callback(this.manager,t,{pointers:n[0],changedPointers:n[1],pointerType:O,srcEvent:e})}});function de(){j.apply(this,arguments);var e=v(this.handler,this);this.touch=new ue(this.manager,e),this.mouse=new J(this.manager,e),this.primaryTouch=null,this.lastTouches=[]}function fe(e,t){1&e?(this.primaryTouch=t.changedPointers[0].identifier,pe.call(this,t)):12&e&&pe.call(this,t)}function pe(e){var t=e.changedPointers[0];if(t.identifier===this.primaryTouch){var n={x:t.clientX,y:t.clientY};this.lastTouches.push(n);var i=this.lastTouches;setTimeout((function(){var e=i.indexOf(n);e>-1&&i.splice(e,1)}),2500)}}function me(e){for(var t=e.srcEvent.clientX,n=e.srcEvent.clientY,i=0;i<this.lastTouches.length;i++){var r=this.lastTouches[i],o=Math.abs(t-r.x),s=Math.abs(n-r.y);if(o<=25&&s<=25)return!0}return!1}y(de,j,{handler:function(e,t,n){var i=n.pointerType==O,r=n.pointerType==P;if(!(r&&n.sourceCapabilities&&n.sourceCapabilities.firesTouchEvents)){if(i)fe.call(this,t,n);else if(r&&me.call(this,n))return;this.callback(e,t,n)}},destroy:function(){this.touch.destroy(),this.mouse.destroy()}});var ge=E(a.style,"touchAction"),ye=ge!==r,ve="compute",be="auto",xe="manipulation",we="none",qe="pan-x",Me="pan-y",De=function(){if(!ye)return!1;var e={},n=t.CSS&&t.CSS.supports;return["auto","manipulation","pan-y","pan-x","pan-x pan-y","none"].forEach((function(i){e[i]=!n||t.CSS.supports("touch-action",i)})),e}();function Se(e,t){this.manager=e,this.set(t)}Se.prototype={set:function(e){e==ve&&(e=this.compute()),ye&&this.manager.element.style&&De[e]&&(this.manager.element.style[ge]=e),this.actions=e.toLowerCase().trim()},update:function(){this.set(this.manager.options.touchAction)},compute:function(){var e=[];return f(this.manager.recognizers,(function(t){b(t.options.enable,[t])&&(e=e.concat(t.getTouchAction()))})),function(e){if(D(e,we))return we;var t=D(e,qe),n=D(e,Me);if(t&&n)return we;if(t||n)return t?qe:Me;if(D(e,xe))return xe;return be}(e.join(" "))},preventDefaults:function(e){var t=e.srcEvent,n=e.offsetDirection;if(this.manager.session.prevented)t.preventDefault();else{var i=this.actions,r=D(i,we)&&!De[we],o=D(i,Me)&&!De[Me],s=D(i,qe)&&!De[qe];if(r){var a=1===e.pointers.length,l=e.distance<2,c=e.deltaTime<250;if(a&&l&&c)return}if(!s||!o)return r||o&&6&n||s&&n&L?this.preventSrc(t):void 0}},preventSrc:function(e){this.manager.session.prevented=!0,e.preventDefault()}};var _e=32;function Ce(e){this.options=o({},this.defaults,e||{}),this.id=A++,this.manager=null,this.options.enable=x(this.options.enable,!0),this.state=1,this.simultaneous={},this.requireFail=[]}function ke(e){return 16&e?"cancel":8&e?"end":4&e?"move":2&e?"start":""}function Ee(e){return 16==e?"down":8==e?"up":2==e?"left":4==e?"right":""}function Ae(e,t){var n=t.manager;return n?n.get(e):e}function Te(){Ce.apply(this,arguments)}function Ie(){Te.apply(this,arguments),this.pX=null,this.pY=null}function Re(){Te.apply(this,arguments)}function Ne(){Ce.apply(this,arguments),this._timer=null,this._input=null}function Oe(){Te.apply(this,arguments)}function Pe(){Te.apply(this,arguments)}function Le(){Ce.apply(this,arguments),this.pTime=!1,this.pCenter=!1,this._timer=null,this._input=null,this.count=0}function Fe(e,t){return(t=t||{}).recognizers=x(t.recognizers,Fe.defaults.preset),new ze(e,t)}Ce.prototype={defaults:{},set:function(e){return o(this.options,e),this.manager&&this.manager.touchAction.update(),this},recognizeWith:function(e){if(d(e,"recognizeWith",this))return this;var t=this.simultaneous;return t[(e=Ae(e,this)).id]||(t[e.id]=e,e.recognizeWith(this)),this},dropRecognizeWith:function(e){return d(e,"dropRecognizeWith",this)||(e=Ae(e,this),delete this.simultaneous[e.id]),this},requireFailure:function(e){if(d(e,"requireFailure",this))return this;var t=this.requireFail;return-1===_(t,e=Ae(e,this))&&(t.push(e),e.requireFailure(this)),this},dropRequireFailure:function(e){if(d(e,"dropRequireFailure",this))return this;e=Ae(e,this);var t=_(this.requireFail,e);return t>-1&&this.requireFail.splice(t,1),this},hasRequireFailures:function(){return this.requireFail.length>0},canRecognizeWith:function(e){return!!this.simultaneous[e.id]},emit:function(e){var t=this,n=this.state;function i(n){t.manager.emit(n,e)}n<8&&i(t.options.event+ke(n)),i(t.options.event),e.additionalEvent&&i(e.additionalEvent),n>=8&&i(t.options.event+ke(n))},tryEmit:function(e){if(this.canEmit())return this.emit(e);this.state=_e},canEmit:function(){for(var e=0;e<this.requireFail.length;){if(!(33&this.requireFail[e].state))return!1;e++}return!0},recognize:function(e){var t=o({},e);if(!b(this.options.enable,[this,t]))return this.reset(),void(this.state=_e);56&this.state&&(this.state=1),this.state=this.process(t),30&this.state&&this.tryEmit(t)},process:function(e){},getTouchAction:function(){},reset:function(){}},y(Te,Ce,{defaults:{pointers:1},attrTest:function(e){var t=this.options.pointers;return 0===t||e.pointers.length===t},process:function(e){var t=this.state,n=e.eventType,i=6&t,r=this.attrTest(e);return i&&(8&n||!r)?16|t:i||r?4&n?8|t:2&t?4|t:2:_e}}),y(Ie,Te,{defaults:{event:"pan",threshold:10,pointers:1,direction:30},getTouchAction:function(){var e=this.options.direction,t=[];return 6&e&&t.push(Me),e&L&&t.push(qe),t},directionTest:function(e){var t=this.options,n=!0,i=e.distance,r=e.direction,o=e.deltaX,s=e.deltaY;return r&t.direction||(6&t.direction?(r=0===o?1:o<0?2:4,n=o!=this.pX,i=Math.abs(e.deltaX)):(r=0===s?1:s<0?8:16,n=s!=this.pY,i=Math.abs(e.deltaY))),e.direction=r,n&&i>t.threshold&&r&t.direction},attrTest:function(e){return Te.prototype.attrTest.call(this,e)&&(2&this.state||!(2&this.state)&&this.directionTest(e))},emit:function(e){this.pX=e.deltaX,this.pY=e.deltaY;var t=Ee(e.direction);t&&(e.additionalEvent=this.options.event+t),this._super.emit.call(this,e)}}),y(Re,Te,{defaults:{event:"pinch",threshold:0,pointers:2},getTouchAction:function(){return[we]},attrTest:function(e){return this._super.attrTest.call(this,e)&&(Math.abs(e.scale-1)>this.options.threshold||2&this.state)},emit:function(e){if(1!==e.scale){var t=e.scale<1?"in":"out";e.additionalEvent=this.options.event+t}this._super.emit.call(this,e)}}),y(Ne,Ce,{defaults:{event:"press",pointers:1,time:251,threshold:9},getTouchAction:function(){return[be]},process:function(e){var t=this.options,n=e.pointers.length===t.pointers,i=e.distance<t.threshold,r=e.deltaTime>t.time;if(this._input=e,!i||!n||12&e.eventType&&!r)this.reset();else if(1&e.eventType)this.reset(),this._timer=h((function(){this.state=8,this.tryEmit()}),t.time,this);else if(4&e.eventType)return 8;return _e},reset:function(){clearTimeout(this._timer)},emit:function(e){8===this.state&&(e&&4&e.eventType?this.manager.emit(this.options.event+"up",e):(this._input.timeStamp=u(),this.manager.emit(this.options.event,this._input)))}}),y(Oe,Te,{defaults:{event:"rotate",threshold:0,pointers:2},getTouchAction:function(){return[we]},attrTest:function(e){return this._super.attrTest.call(this,e)&&(Math.abs(e.rotation)>this.options.threshold||2&this.state)}}),y(Pe,Te,{defaults:{event:"swipe",threshold:10,velocity:.3,direction:30,pointers:1},getTouchAction:function(){return Ie.prototype.getTouchAction.call(this)},attrTest:function(e){var t,n=this.options.direction;return 30&n?t=e.overallVelocity:6&n?t=e.overallVelocityX:n&L&&(t=e.overallVelocityY),this._super.attrTest.call(this,e)&&n&e.offsetDirection&&e.distance>this.options.threshold&&e.maxPointers==this.options.pointers&&c(t)>this.options.velocity&&4&e.eventType},emit:function(e){var t=Ee(e.offsetDirection);t&&this.manager.emit(this.options.event+t,e),this.manager.emit(this.options.event,e)}}),y(Le,Ce,{defaults:{event:"tap",pointers:1,taps:1,interval:300,time:250,threshold:9,posThreshold:10},getTouchAction:function(){return[xe]},process:function(e){var t=this.options,n=e.pointers.length===t.pointers,i=e.distance<t.threshold,r=e.deltaTime<t.time;if(this.reset(),1&e.eventType&&0===this.count)return this.failTimeout();if(i&&r&&n){if(4!=e.eventType)return this.failTimeout();var o=!this.pTime||e.timeStamp-this.pTime<t.interval,s=!this.pCenter||U(this.pCenter,e.center)<t.posThreshold;if(this.pTime=e.timeStamp,this.pCenter=e.center,s&&o?this.count+=1:this.count=1,this._input=e,0===this.count%t.taps)return this.hasRequireFailures()?(this._timer=h((function(){this.state=8,this.tryEmit()}),t.interval,this),2):8}return _e},failTimeout:function(){return this._timer=h((function(){this.state=_e}),this.options.interval,this),_e},reset:function(){clearTimeout(this._timer)},emit:function(){8==this.state&&(this._input.tapCount=this.count,this.manager.emit(this.options.event,this._input))}}),Fe.VERSION="2.0.7",Fe.defaults={domEvents:!1,touchAction:ve,enable:!0,inputTarget:null,inputClass:null,preset:[[Oe,{enable:!1}],[Re,{enable:!1},["rotate"]],[Pe,{direction:6}],[Ie,{direction:6},["swipe"]],[Le],[Le,{event:"doubletap",taps:2},["tap"]],[Ne]],cssProps:{userSelect:"none",touchSelect:"none",touchCallout:"none",contentZooming:"none",userDrag:"none",tapHighlightColor:"rgba(0,0,0,0)"}};function ze(e,t){var n;this.options=o({},Fe.defaults,t||{}),this.options.inputTarget=this.options.inputTarget||e,this.handlers={},this.session={},this.recognizers=[],this.oldCssProps={},this.element=e,this.input=new((n=this).options.inputClass||(R?ne:N?ue:I?de:J))(n,H),this.touchAction=new Se(this,this.options.touchAction),je(this,!0),f(this.options.recognizers,(function(e){var t=this.add(new e[0](e[1]));e[2]&&t.recognizeWith(e[2]),e[3]&&t.requireFailure(e[3])}),this)}function je(e,t){var n,i=e.element;i.style&&(f(e.options.cssProps,(function(r,o){n=E(i.style,o),t?(e.oldCssProps[n]=i.style[n],i.style[n]=r):i.style[n]=e.oldCssProps[n]||""})),t||(e.oldCssProps={}))}ze.prototype={set:function(e){return o(this.options,e),e.touchAction&&this.touchAction.update(),e.inputTarget&&(this.input.destroy(),this.input.target=e.inputTarget,this.input.init()),this},stop:function(e){this.session.stopped=e?2:1},recognize:function(e){var t=this.session;if(!t.stopped){var n;this.touchAction.preventDefaults(e);var i=this.recognizers,r=t.curRecognizer;(!r||r&&8&r.state)&&(r=t.curRecognizer=null);for(var o=0;o<i.length;)n=i[o],2===t.stopped||r&&n!=r&&!n.canRecognizeWith(r)?n.reset():n.recognize(e),!r&&14&n.state&&(r=t.curRecognizer=n),o++}},get:function(e){if(e instanceof Ce)return e;for(var t=this.recognizers,n=0;n<t.length;n++)if(t[n].options.event==e)return t[n];return null},add:function(e){if(d(e,"add",this))return this;var t=this.get(e.options.event);return t&&this.remove(t),this.recognizers.push(e),e.manager=this,this.touchAction.update(),e},remove:function(e){if(d(e,"remove",this))return this;if(e=this.get(e)){var t=this.recognizers,n=_(t,e);-1!==n&&(t.splice(n,1),this.touchAction.update())}return this},on:function(e,t){if(e!==r&&t!==r){var n=this.handlers;return f(S(e),(function(e){n[e]=n[e]||[],n[e].push(t)})),this}},off:function(e,t){if(e!==r){var n=this.handlers;return f(S(e),(function(e){t?n[e]&&n[e].splice(_(n[e],t),1):delete n[e]})),this}},emit:function(e,t){this.options.domEvents&&function(e,t){var i=n.createEvent("Event");i.initEvent(e,!0,!0),i.gesture=t,t.target.dispatchEvent(i)}(e,t);var i=this.handlers[e]&&this.handlers[e].slice();if(i&&i.length){t.type=e,t.preventDefault=function(){t.srcEvent.preventDefault()};for(var r=0;r<i.length;)i[r](t),r++}},destroy:function(){this.element&&je(this,!1),this.handlers={},this.session={},this.input.destroy(),this.element=null}},o(Fe,{INPUT_START:1,INPUT_MOVE:2,INPUT_END:4,INPUT_CANCEL:8,STATE_POSSIBLE:1,STATE_BEGAN:2,STATE_CHANGED:4,STATE_ENDED:8,STATE_RECOGNIZED:8,STATE_CANCELLED:16,STATE_FAILED:_e,DIRECTION_NONE:1,DIRECTION_LEFT:2,DIRECTION_RIGHT:4,DIRECTION_UP:8,DIRECTION_DOWN:16,DIRECTION_HORIZONTAL:6,DIRECTION_VERTICAL:L,DIRECTION_ALL:30,Manager:ze,Input:j,TouchAction:Se,TouchInput:ue,MouseInput:J,PointerEventInput:ne,TouchMouseInput:de,SingleTouchInput:se,Recognizer:Ce,AttrRecognizer:Te,Tap:Le,Pan:Ie,Swipe:Pe,Pinch:Re,Rotate:Oe,Press:Ne,on:w,off:q,each:f,merge:g,extend:m,assign:o,inherit:y,bindFn:v,prefixed:E}),(void 0!==t?t:"undefined"!=typeof self?self:{}).Hammer=Fe,e.exports?e.exports=Fe:t.Hammer=Fe}(window,document)}(ey);var ty=Qg;function ny(e){e.component("event-area",{mounted(e){e.classList.add("event-area"),e.style.pointerEvents="auto",e.style.zIndex=1},render:()=>[]})}var iy={renderer:"dom",disableTriggers:!0,preferredSize:function(){return 22},render(e){const{settings:{label:t,rtl:n},layout:{dock:i}}=this.settings,r="top"!==i&&"bottom"!==i||!n?"ltr":"rtl",o=function(e,t){const n={pointerEvents:"auto",display:"flex",justifyContent:"center",alignItems:"center",color:"#7b7a78",fontStyle:"italic",fontSize:"13px"};switch(e){case"left":n.width=`${t.height}px`,n.transform=`rotate(-90deg) translate(-${t.height}px, 0)`,n.transformOrigin="top left";break;case"right":n.width=`${t.height}px`,n.transform=`rotate(90deg) translate(0, -${t.width}px)`,n.transformOrigin="top left";break;case"center":n.width=`${t.width}px`,n.height=`${t.height}px`,n.color="#595959",n.fontStyle="normal",n.fontSize="1.2em",n.textAlign="center";break;default:n.justifyContent="flex-start",n.alignItems="flex-start"}return n}(i,this.rect),s="center"===i?t:`* ${t}`,a="center"!==i?{overflow:"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis"}:{};return e("div",{style:o,dir:r},e("span",{ref:this.alignToRef,style:a,title:s},s))}};function ry(){const e=im();return e.renderer.prio(["canvas"]),e.use(Kg),e.use(function(e){if("function"!=typeof e.interaction)return t=>{t.interaction("hammer",Zg(e))};e.interaction("hammer",Zg(Hammer))}(ty)),e.use(ny),e.component("disclaimer",iy),e}const oy={shapes:[{type:"path",attrs:{d:"M15.9488039,5.20769129 C16.0487326,6.70662306 15.3492311,8.30548361 14.050157,9.30477145 C12.651154,10.5039169 10.8524359,10.8037032 8.85386017,10.4039881 L7.3549284,10.0042729 L5.75606786,9.70448659 C5.75606786,9.90434416 5.65613907,10.0042729 5.4562815,10.2041305 C5.05656637,10.6038456 4.55692244,10.8037032 4.05727852,10.8037032 C3.75749217,10.8037032 3.45770582,10.7037744 3.15791946,10.6038456 C3.05799068,10.903632 3.15791946,11.2034184 3.45770582,11.7030623 C5.05656637,14.0014243 3.85742095,15.9000712 3.75749217,16 L2.2585604,15.3004985 C2.2585604,15.2005697 2.95806189,14.0014243 1.95877405,12.6024213 C1.6589877,12.0028486 1.15934378,11.0035608 1.55905891,10.0042729 C1.6589877,9.80441537 1.75891648,9.6045578 1.95877405,9.40470024 C1.6589877,8.90505631 1.55905891,8.30548361 1.85884527,7.7059109 C1.55905891,7.40612455 1.25927256,7.1063382 1.15934378,6.70662306 C0.859557424,5.90719279 0.959486209,4.5081898 1.6589877,3.30904439 C1.95877405,2.6095429 2.55834676,2.0099702 3.15791946,1.51032628 C3.95734974,0.91075357 4.95663758,0.610967217 6.15578299,0.311180864 C9.05371774,-0.388320626 11.9516525,0.111323295 13.9502282,1.61025506 C15.1493736,2.50961412 15.8488751,3.80868831 15.9488039,5.20769129 Z M13.0508691,8.10562604 C13.8502994,7.40612455 14.3499433,6.40683671 14.3499433,5.30762008 C14.2500145,4.20840345 13.550513,3.40897318 12.9509403,2.90932926 C12.1515101,2.40968533 11.252151,2.0099702 10.1529344,1.81011263 C8.95378895,1.61025506 7.75464354,1.71018384 6.45556935,1.91004141 C4.75678001,2.30975655 3.65756338,3.00925804 3.05799068,4.10847467 C2.55834676,5.00783373 2.65827554,5.90719279 2.75820433,6.20697914 C2.75820433,6.30690792 2.85813311,6.40683671 3.05799068,6.40683671 C3.15791946,6.40683671 3.25784825,6.40683671 3.35777703,6.40683671 C3.45770582,6.40683671 3.45770582,6.40683671 3.45770582,6.40683671 L3.5576346,6.40683671 L3.65756338,6.40683671 C4.65685123,6.40683671 5.4562815,6.90648063 5.85599664,7.80583969 L5.85599664,8.00569726 C6.35564056,8.10562604 7.05514205,8.30548361 7.75464354,8.50534118 L9.25357531,8.90505631 C10.0530056,9.0049851 10.7525071,9.0049851 11.4520086,8.80512753 C12.0515813,8.70519875 12.5512252,8.40541239 13.0508691,8.10562604 Z"}}]};function sy(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,i)}return n}function ay(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?sy(Object(n),!0).forEach((function(t){cy(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):sy(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function ly(e){return ly="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},ly(e)}function cy(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 i=n.call(e,"string");if("object"!=typeof i)return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function uy(e){return function(e){if(Array.isArray(e))return hy(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(e){if("string"==typeof e)return hy(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)?hy(e,t):void 0}}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function hy(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,i=new Array(t);n<t;n++)i[n]=e[n];return i}var dy=Object.prototype.hasOwnProperty,fy=Object.prototype.toString,py=Object.defineProperty,my=Object.getOwnPropertyDescriptor,gy=function(e){return"function"==typeof Array.isArray?Array.isArray(e):"[object Array]"===fy.call(e)},yy=function(e){if(!e||"[object Object]"!==fy.call(e))return!1;var t,n=dy.call(e,"constructor"),i=e.constructor&&e.constructor.prototype&&dy.call(e.constructor.prototype,"isPrototypeOf");if(e.constructor&&!n&&!i)return!1;for(t in e);return void 0===t||dy.call(e,t)},vy=function(e,t){py&&"__proto__"===t.name?py(e,t.name,{enumerable:!0,configurable:!0,value:t.newValue,writable:!0}):e[t.name]=t.newValue},by=function(e,t){if("__proto__"===t){if(!dy.call(e,t))return;if(my)return my(e,t).value}return e[t]},xy=function e(){var t,n,i,r,o,s,a=arguments[0],l=1,c=arguments.length,u=!1;for("boolean"==typeof a&&(u=a,a=arguments[1]||{},l=2),(null==a||"object"!=typeof a&&"function"!=typeof a)&&(a={});l<c;++l)if(null!=(t=arguments[l]))for(n in t)i=by(a,n),a!==(r=by(t,n))&&(u&&r&&(yy(r)||(o=gy(r)))?(o?(o=!1,s=i&&gy(i)?i:[]):s=i&&yy(i)?i:{},vy(a,{name:n,newValue:e(u,s,r)})):void 0!==r&&vy(a,{name:n,newValue:r}));return a};function wy(e,t){return{range:function(e){var n=e.resources,i=e.data,r=n.theme.palette("categorical",0===t?i.items.length:t);return i.items.map((function(e){return r[e.value%r.length]}))},valueAccessor:e.value}}function qy(e,t){return{range:function(e){var n=e.resources,i=e.data,r=n.theme.palette("categorical",0===t?i.items.length:t);return i.items.map((function(e){return r[e.row.value%r.length]}))},valueAccessor:e.value}}function My(e,t,n,i,r){var o,s,a=r.byRow,l=r.byElemNo;if(i&&(t.input.persistent||e.hc.qDimensionInfo.length>1||void 0===n.activeDimensionIndex&&e.hc.qSize.qcy>((null===(s=(o=e.hc).qDataPages[0]||o.qStackedDataPages[0])||void 0===s?void 0:s.qArea.qHeight)||0)))return l(i,i.raw().qCardinal);if(i){var c=t.pic.extract({field:i.key(),trackBy:i.value}).length;return a(i,c)}return{}}function Dy(e,t){var n=e.hc.qDimensionInfo,i=t.input.byDimDef||{activeDimensionIndex:n.length-1};if(i.activeDimensionIndex>=0){var r=n[i.activeDimensionIndex];i=r.coloring&&r.coloring.colorMapRef?{type:"libraryItem",key:r.coloring.colorMapRef,activeDimensionIndex:i.activeDimensionIndex}:{activeDimensionIndex:i.activeDimensionIndex}}return i}function Sy(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 _y(e,t,n){e.prototype=t.prototype=n,n.constructor=e}function Cy(e,t){var n=Object.create(e.prototype);for(var i in t)n[i]=t[i];return n}function ky(){}var Ey=1/.7,Ay="\\s*([+-]?\\d+)\\s*",Ty="\\s*([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)\\s*",Iy="\\s*([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)%\\s*",Ry=/^#([0-9a-f]{3,8})$/,Ny=new RegExp("^rgb\\("+[Ay,Ay,Ay]+"\\)$"),Oy=new RegExp("^rgb\\("+[Iy,Iy,Iy]+"\\)$"),Py=new RegExp("^rgba\\("+[Ay,Ay,Ay,Ty]+"\\)$"),Ly=new RegExp("^rgba\\("+[Iy,Iy,Iy,Ty]+"\\)$"),Fy=new RegExp("^hsl\\("+[Ty,Iy,Iy]+"\\)$"),zy=new RegExp("^hsla\\("+[Ty,Iy,Iy,Ty]+"\\)$"),jy={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 Hy(){return this.rgb().formatHex()}function By(){return this.rgb().formatRgb()}function Vy(e){var t,n;return e=(e+"").trim().toLowerCase(),(t=Ry.exec(e))?(n=t[1].length,t=parseInt(t[1],16),6===n?$y(t):3===n?new Xy(t>>8&15|t>>4&240,t>>4&15|240&t,(15&t)<<4|15&t,1):8===n?Wy(t>>24&255,t>>16&255,t>>8&255,(255&t)/255):4===n?Wy(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=Ny.exec(e))?new Xy(t[1],t[2],t[3],1):(t=Oy.exec(e))?new Xy(255*t[1]/100,255*t[2]/100,255*t[3]/100,1):(t=Py.exec(e))?Wy(t[1],t[2],t[3],t[4]):(t=Ly.exec(e))?Wy(255*t[1]/100,255*t[2]/100,255*t[3]/100,t[4]):(t=Fy.exec(e))?Zy(t[1],t[2]/100,t[3]/100,1):(t=zy.exec(e))?Zy(t[1],t[2]/100,t[3]/100,t[4]):jy.hasOwnProperty(e)?$y(jy[e]):"transparent"===e?new Xy(NaN,NaN,NaN,0):null}function $y(e){return new Xy(e>>16&255,e>>8&255,255&e,1)}function Wy(e,t,n,i){return i<=0&&(e=t=n=NaN),new Xy(e,t,n,i)}function Uy(e){return e instanceof ky||(e=Vy(e)),e?new Xy((e=e.rgb()).r,e.g,e.b,e.opacity):new Xy}function Yy(e,t,n,i){return 1===arguments.length?Uy(e):new Xy(e,t,n,null==i?1:i)}function Xy(e,t,n,i){this.r=+e,this.g=+t,this.b=+n,this.opacity=+i}function Ky(){return"#"+Jy(this.r)+Jy(this.g)+Jy(this.b)}function Gy(){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+")")}function Jy(e){return((e=Math.max(0,Math.min(255,Math.round(e)||0)))<16?"0":"")+e.toString(16)}function Zy(e,t,n,i){return i<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new ev(e,t,n,i)}function Qy(e){if(e instanceof ev)return new ev(e.h,e.s,e.l,e.opacity);if(e instanceof ky||(e=Vy(e)),!e)return new ev;if(e instanceof ev)return e;var t=(e=e.rgb()).r/255,n=e.g/255,i=e.b/255,r=Math.min(t,n,i),o=Math.max(t,n,i),s=NaN,a=o-r,l=(o+r)/2;return a?(s=t===o?(n-i)/a+6*(n<i):n===o?(i-t)/a+2:(t-n)/a+4,a/=l<.5?o+r:2-o-r,s*=60):a=l>0&&l<1?0:s,new ev(s,a,l,e.opacity)}function ev(e,t,n,i){this.h=+e,this.s=+t,this.l=+n,this.opacity=+i}function tv(e,t,n){return 255*(e<60?t+(n-t)*e/60:e<180?n:e<240?t+(n-t)*(240-e)/60:t)}function nv(e){return function(){return e}}function iv(e,t){var n=t-e;return n?function(e,t){return function(n){return e+n*t}}(e,n):nv(isNaN(e)?t:e)}_y(ky,Vy,{copy:function(e){return Object.assign(new this.constructor,this,e)},displayable:function(){return this.rgb().displayable()},hex:Hy,formatHex:Hy,formatHsl:function(){return Qy(this).formatHsl()},formatRgb:By,toString:By}),_y(Xy,Yy,Cy(ky,{brighter:function(e){return e=null==e?Ey:Math.pow(Ey,e),new Xy(this.r*e,this.g*e,this.b*e,this.opacity)},darker:function(e){return e=null==e?.7:Math.pow(.7,e),new Xy(this.r*e,this.g*e,this.b*e,this.opacity)},rgb:function(){return this},displayable:function(){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:Ky,formatHex:Ky,formatRgb:Gy,toString:Gy})),_y(ev,(function(e,t,n,i){return 1===arguments.length?Qy(e):new ev(e,t,n,null==i?1:i)}),Cy(ky,{brighter:function(e){return e=null==e?Ey:Math.pow(Ey,e),new ev(this.h,this.s,this.l*e,this.opacity)},darker:function(e){return e=null==e?.7:Math.pow(.7,e),new ev(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,i=n+(n<.5?n:1-n)*t,r=2*n-i;return new Xy(tv(e>=240?e-240:e+120,r,i),tv(e,r,i),tv(e<120?e+240:e-120,r,i),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},formatHsl:function(){var e=this.opacity;return(1===(e=isNaN(e)?1:Math.max(0,Math.min(1,e)))?"hsl(":"hsla(")+(this.h||0)+", "+100*(this.s||0)+"%, "+100*(this.l||0)+"%"+(1===e?")":", "+e+")")}}));var rv=function e(t){var n=function(e){return 1==(e=+e)?iv:function(t,n){return n-t?function(e,t,n){return e=Math.pow(e,n),t=Math.pow(t,n)-e,n=1/n,function(i){return Math.pow(e+i*t,n)}}(t,n,e):nv(isNaN(t)?n:t)}}(t);function i(e,t){var i=n((e=Yy(e)).r,(t=Yy(t)).r),r=n(e.g,t.g),o=n(e.b,t.b),s=iv(e.opacity,t.opacity);return function(t){return e.r=i(t),e.g=r(t),e.b=o(t),e.opacity=s(t),e+""}}return i.gamma=e,i}(1),ov=/^class(-pyramid)?/,sv=function(e,t,n,i){var r=void 0!==n.min?n.min:i.min(),o=void 0!==n.max?n.max:i.max(),s=r,a=o,l=t.limits,c={},u="percent"===t.limitType?l.map((function(e){return r+(o-r)*e})):l,h=t.colors.map((function(t){return e.resolveUIColor(t)}));if(r=Math.min.apply(Math,[r].concat(uy(u))),o=Math.max.apply(Math,[o].concat(uy(u))),c.min=r,c.max=o,t.breakTypes&&-1===t.breakTypes.indexOf(!0))c.type="categorical",Object.assign(c,function(e){var t=e.min,n=e.max,i=e.limits,r=e.range,o=[],s=[];if(i.length)if(i[i.length-1]<t)s.push(t,n),o.push(r[r.length-1],r[r.length-1],r[r.length-1]);else if(i[0]>n)s.push(t,n),o.push(r[0],r[0],r[0]);else{if(i[0]>t)s.push(t),o.push(r[0]);else{s.push(t);for(var a=0;a<i.length;a++)if(t<i[a]){o.push(r[a]);break}}for(var l=0;l<i.length;l++)t<i[l]&&i[l]<n&&(s.push(i[l]),o.push(r[l]));if(i[i.length-1]<n)s.push(n),o.push(r[i.length]),o.push(r[i.length]);else{s.push(n);for(var c=0;c<i.length;c++)if(i[c]>n){o.push(r[c]),o.push(r[c]);break}}}else o.push(r[0]);return{min:t,max:n,range:o,domain:s}}({min:"percent"===t.limitType?r:s,max:"percent"===t.limitType?o:a,range:h,limits:"percent"===t.limitType?u:l}));else if(t.breakTypes){var d=t.breakTypes;c.type="continuous",c.domain=[r],c.range=[h[0]];for(var f=0;f<u.length;f+=1)if(d[f]){var p=h[f],m=h[f+1],g=rv(p,m)(.5);c.range.push(g),c.domain.push(u[f]),f<u.length-1&&d[f+1]&&(c.range.push(h[f+1]),c.domain.push((u[f]+u[f+1])/2))}else c.range.push(h[f]),c.range.push(h[f+1]),c.domain.push(u[f]),c.domain.push(u[f]+Math.min(1e-6,(o-r)/1e6));c.range.push(h[h.length-1]),c.domain.push(o)}else c.domain=u,c.range=h;return c};function av(e,t,n,i,r){var o,s,a,l=0,c=[],u=(e-t)/(i+1);if(0===u)return 1;for(o=0;o<n.length;o+=1)s=.99*(n[o]-t),a=n[o]>e?Math.floor(e/u):n[o]<t?0:Math.floor(s/u),Number.isNaN(a)||(c[a]?c[a]+=1:c[a]=1);for(o=0;o<c.length;o+=1)c[o]&&(l+=1);return l<=i||l>=r?Math.max(l,i):av(e,t,n,i+1,r)}var lv=function(e,t,n,i){var r,o,s=t.theme,a=t.hc,l=i.f,c={mode:"field",fieldType:"measure",field:l?l.key():void 0,reverse:n.input.reverseScheme||!1,type:"continuous",range:function(e){return e.resources.theme.palette("quant")}},u=[],h=!0;if(l){if(Number.isNaN(+l.min())||Number.isNaN(+l.max()))return{invalid:!0};(h=!("S"===(r=n.pic.raw()).qMode&&(r.qDataPages[0]&&r.qSize.qcy>r.qDataPages[0].qArea.qHeight||!r.qDataPages.length&&r.qSize.qcy>0)||"K"===r.qMode&&r.qStackedDataPages[0]&&r.qSize.qcy>r.qStackedDataPages[0].qArea.qHeight||"T"===r.qMode&&r.qSize.qcy>r.qTreeDataPages[0].qGroupSize))&&(u=n.pic.extract({field:0,props:{num:{field:l.key()},exclude:{fields:a.qDimensionInfo.map((function(e,t){return{field:"qDimensionInfo/".concat(t)}})),value:function(e){return Math.min.apply(Math,uy(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(c.min=n.input.measureMin,c.max=n.input.measureMax,c.max<c.min)return{invalid:!0}}else if(l&&!h)c.min=l.min(),c.max=l.max();else if(l){if(!u.length)return{invalid:!0};c.min=Math.min.apply(Math,uy(u)),c.max=Math.max.apply(Math,uy(u))}if(n.input.measureScheme&&(c.palettes={quant:n.input.measureScheme}),s){var d=s.getDataColorScales().filter((function(e){return e.key===n.input.measureScheme}))[0];c.type=d&&ov.test(d.type)?"categorical":"continuous","categorical"===c.type&&(o=d.colors.some((function(e){return Array.isArray(e)}))?Math.max.apply(Math,uy(d.colors.map((function(e){return e?e.length:0})))):d.colors.length)}if("categorical"===c.type){for(var f=h?av(c.max,c.min,u,1,o):o,p=(c.max-c.min)/f,m=[],g=0;g<f+1;g+=1)m.push(c.min+p*g);c.domain=m,c.range=function(e){for(var t=e.resources.theme.palette("quant",f),n=Math.max(1,Math.floor(t.length/f)),i=[],r=0;r<f;r+=1)i.push(t[r*n]);return[i[0]].concat(i,[i[i.length-1]])}}return c};function cv(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 uv(e){var t,n=e.cm,i=e.defaults,r=e.index,o=e.input,s=e.pic;if(!o||!o.on)return null;var a=null!==(t=o.mode)&&void 0!==t?t:"primary";return"primary"===a?function(e,t,n){var i=n.primary;return void 0!==t.paletteColor&&t.paletteColor&&(i=e.resolveUIColor(t.paletteColor)),ay(ay({},n),{},{mode:"constant",type:"constant",primary:i})}(n,o,i):"byExpression"===a?function(e,t,n){var i="qMeasureInfo/".concat(e,"/"),r=t.field((function(e){return e.id().startsWith(i)&&"colorByMeasureExpression"===e.raw().id})),o=r;return ay(ay({},n),{},o?{mode:"field",fieldType:"expression",field:r?r.key():void 0,type:"color"}:{mode:"constant",type:"constant",primary:n.nil})}(r,s,i):null}function hv(e){e.measureOverrides.every((function(e){return!e}))&&(e.measureOverrides=null)}function dv(e,t){for(var n=(null==t?void 0:t.domain)||[],i=(null==t?void 0:t.range)||[],r=[],o=0;o<e.length;++o){var s=e[o];if("constant"===(null==s?void 0:s.mode)){var a=n.indexOf(o);-1===a?(n.push(o),i.push(s.primary)):i[a]=s.primary,e[o]=null}else if(s){r.push(o);var l=n.indexOf(o);-1!==l&&(n.splice(l,1),i.splice(l,1))}}return{domain:n,range:i,exclude:r}}function fv(e,t,n,i){var r,o=function(e,t,n,i){if(t.input&&!t.input.auto){if("byMeasure"===t.input.mode)return function(e,t,n){var i=t.theme,r=t.hc,o=(arguments.length>3&&void 0!==arguments[3]?arguments[3]:{}).getCField,s=void 0===o?cv:o,a=n.input.byMeasureDef||{activeMeasureIndex:0},l=s(n,a),c=lv(0,{theme:i,hc:r},n,{f:l});if(c.invalid)return c;"expression"===a.type&&(a.activeMeasureIndex<0||void 0===a.activeMeasureIndex)&&(c.label=a.label,l&&"color.altLabel"===l.raw().labelExpRef&&(c.label=n.input.altLabel)),!c.label&&l&&(c.label=l.title());var u=a.activeMeasureIndex>=0?l:null;if(!u&&l&&void 0!==l.raw().matchMeasure&&l.raw().matchMeasure>-1&&(u=n.pic.fields().filter((function(e){return"measure"===e.type()}))[l.raw().matchMeasure]),n.input.useMeasureGradient&&"libraryItem"===a.type)if(u){var h=u.raw().coloring;h&&h.gradient&&xy(c,sv(e,h.gradient,c,u))}else c.auxiliary=a;return c}(e,n,t);if("byDimension"===t.input.mode)return function(e,t,n){var i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},r=i.getCDef,o=void 0===r?Dy:r,s=i.getCByField,a=void 0===s?Sy:s,l=i.getPersistence,c=void 0===l?My:l,u=o(t,n),h=a(n,u),d=h?h.raw():{},f=n&&n.pic?n.pic.raw():{};if(d.qError||d.qSize&&0===d.qSize.qcy&&!f.qHasOtherValues)return{invalid:!0};var p={mode:"field",fieldType:"dimension",type:"categorical",field:h?h.key():void 0,isFieldLocked:d.qLocked};return("expression"===u.type||u.activeDimensionIndex<0)&&(p.label=u.label,"color.altLabel"===d.labelExpRef&&(p.label=n.input.altLabel)),!p.label&&h&&(p.label=h.title()),n.input.dimensionScheme&&(p.palettes={categorical:n.input.dimensionScheme}),n.input.useDimColVal&&"libraryItem"===u.type&&(p.auxiliary=u),xy(p,c(t,n,u,h,{byRow:qy,byElemNo:wy})),p}(e,n,t);if("byExpression"===t.input.mode)return function(e,t,n,i){var r=t.hc,o=t.theme,s=t.translator,a=n.pic.field((function(e){return"colorByExpression"===e.raw().id}));if(!a||!a.raw().qFallbackTitle&&!n.input.colorExpression||!(Number.isFinite(a.raw().qMin)&&Number.isFinite(a.raw().qMax)||n.input.expressionIsColor))return{mode:"constant",type:"constant",primary:i.nil};if(n.input.expressionIsColor)return{mode:"field",fieldType:"expression",field:a?a.key():void 0,type:"color"};var l=lv(0,{hc:r,theme:o},n,{f:a});return l.invalid||(l.label=n.input.expressionLabel||s.get("Object.ChartTooltip.ColorExpression")),l}(0,n,t,i);if("byMultiple"===t.input.mode||"primary"===t.input.mode)return function(e,t,n,i){var r=t.hc,o=t.theme,s=t.translator,a=n.input.useBaseColors;if(("byMultiple"===n.input.mode||"primary"===n.input.mode&&"measure"===n.input.useBaseColors)&&r.qMeasureInfo.length>1&&(a="measure"),"measure"===a){var l=[],c=[];"measure"===n.input.useBaseColors&&r.qMeasureInfo.forEach((function(t,n){if(t.baseColor||t.coloring&&t.coloring.baseColor){l.push(n);var r=e.resolveUIColor(t.baseColor||t.coloring.baseColor);"none"===r?c.push(i.primary):c.push(r)}}));var u=n.input.dimensionScheme?{categorical:n.input.dimensionScheme}:void 0,h=o?o.getDataColorPalettes()[0]:void 0;return"measure"===n.input.useBaseColors&&h&&(u={categorical:h.key}),{mode:"measure",type:"categorical",palettes:u,label:s?s.get("Common.Measures"):void 0,explicit:l.length?{domain:l,range:c}:void 0}}if("dimension"===a){var d=[],f=[];return r.qDimensionInfo.forEach((function(t,n){if(t.baseColor||t.coloring&&t.coloring.baseColor){d.push(n);var r=e.resolveUIColor(t.baseColor||t.coloring.baseColor);"none"===r?f.push(i.primary):f.push(r)}})),{mode:"dimension",type:"categorical",field:d.length?d[0]:void 0,explicit:d.length?{domain:d,range:f}:void 0}}var p=i.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,i)}return{}}(e,t,n,i);return null!==(r=t.input)&&void 0!==r&&r.measureOverrides?(o.measureOverrides=t.input.measureOverrides.map((function(n,r){return uv({cm:e,input:n,defaults:i,index:r,pic:t.pic})})),function(e,t){var n,i,r,o=t.translator;if(hv(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=dv(e.measureOverrides,e.explicit),hv(e)),null!==(i=e.measureOverrides)&&void 0!==i&&i.every((function(e){return"constant"===(null==e?void 0:e.mode)}))){var s={mode:"measure",type:"categorical",label:null==o?void 0:o.get("Common.Measures")};return s.explicit=dv(e.measureOverrides),s}return null!==(r=e.measureOverrides)&&void 0!==r&&r.every((function(e){return e}))?{invalid:!0,measureOverrides:e.measureOverrides}:e}(o,n)):o}function pv(e){var t=ay({hc:null,colorProps:null,layout:null,theme:null},e),n={},i={auto:function(){return{mode:"primary"}},getDimensionColorMap:function(){return Promise.reject()},getMeasure:function(){return Promise.reject()},getAttributeDimension:function(){return Promise.reject()}},r={auto:function(e){return e?(i.auto=e,r):i.auto},getDimensionColorMap:function(e){return e?(i.getDimensionColorMap=e,r):i.getDimensionColorMap},getAttributeDimension:function(e){return e?(i.getAttributeDimension=e,r):i.getAttributeDimension},getMeasure:function(e){return e?(i.getMeasure=e,r):i.getMeasure},set:function(e){var r;if(!e.colorProps)throw new Error('Missing "colorProps"');if(xy(t,e),(n={pic:t.picasso.data("q")({data:t.hc,config:{localeInfo:t.localeInfo}}),input:t.colorProps}).input.auto){var o=i.auto(e.layout);n.input=xy(!0,{},n.input,o,{auto:!1});var s=t.theme?t.theme.getDataColorPalettes():[];s[0]&&(n.input.dimensionScheme=s[0].key);var a=0;n.input.byDimDef&&+n.input.byDimDef.activeDimensionIndex>=0&&(a=+n.input.byDimDef.activeDimensionIndex),t.hc&&t.hc.qDimensionInfo[a]&&t.hc.qDimensionInfo[a].coloring&&t.hc.qDimensionInfo[a].coloring.colorMapRef&&n.input.byDimDef&&(n.input.byDimDef.type="libraryItem",n.input.byDimDef.key=t.hc.qDimensionInfo[a].coloring.colorMapRef)}null!==(r=n.input.measureOverrides)&&void 0!==r&&r.every((function(e){return!e||!e.on}))&&(n.input=xy(!1,{},n.input,{measureOverrides:null}))},palettes:function(){if(!n.palettes){var e=t.theme,i=[];(e&&e.getDataColorPickerPalettes()||[]).forEach((function(e){i.push({key:"ui",colors:e.colors})})),n.palettes=i}return n.palettes},getAuxiliaryData:function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"/qHyperCubeDef";if(!e.auxiliary&&!/qAttrDimInfo/.test(e.field))return Promise.resolve();var r=e.auxiliary||{},o=r.key;if("measure"===e.fieldType)return i.getMeasure(o,t).catch((function(){}));if("dimension"===e.fieldType){var s="".concat(n,"/").concat(e.field).replace("qDimensionInfo","qDimensions").replace("qAttrDimInfo","qAttributeDimensions");return Promise.all([/qAttrDimInfo/.test(e.field)?i.getAttributeDimension(s,t).catch((function(){})):Promise.resolve(),o?i.getDimensionColorMap(o,t).catch((function(){})):Promise.resolve()])}return Promise.resolve()},getAuxiliarySettings:function(e,i){var r=this;return e.auxiliary||/qAttrDimInfo/.test(e.field)?(this.palettes(),this.getAuxiliaryData(e,i).then((function(i){if(!i)return{};if("measure"===e.fieldType){if(i.coloring&&i.coloring.gradient){var o=n.pic.field(e.field);return sv(r,i.coloring.gradient,e,o)}return{}}if("dimension"===e.fieldType){var s={nil:e.nil,others:e.others},a=i[0],l=i[1]?i[1].colorMap:null;if(a){var c=t.picasso.data("q")({data:{qDimensionInfo:[n.pic.field(e.field).raw(),n.pic.field(e.field).raw()],qMeasureInfo:[],qDataPages:a,qInterColumnSortOrder:[0,1],qMode:"S"}});s.legendDataset=c}return l?function(e,t,n,i){var r=i.external,o=i.field,s=ay({},e);xy(s,wy(o,o.raw().qCardinal));var a=r.theme?r.theme.getDataColorPalettes()[0]:null;return t.nul&&(s.nil=n.resolveUIColor(t.nul)),t.oth&&(s.others=n.resolveUIColor(t.oth)),t.usePal?(s.palettes={categorical:t.pal},a&&!t.pal&&(s.palettes.categorical=a.key,xy(s,wy(o)))):!1===t.autoFill&&t.single?s.range=[n.resolveUIColor(t.single)]:t.autoFill&&(a&&(s.palettes={categorical:a.key}),xy(s,wy(o))),t.colors&&t.colors.length&&(s.explicit=function(e,t,n){for(var i={},r=0;r<e.length;r+=1)i[e[r].value]=e[r].baseColor;var o=[];return{domain:function(e){var r=e.data,s=[];o=[];for(var a=0;a<r.items.length;a++){var l=r.items[a],c=(l.text||l).label;i[c]&&-1===s.indexOf(l.value)&&(s.push(l.value),o.push(t.resolveUIColor(i[c])))}return s.push(-3,-2),o.push(n.others),o.push(n.nil),s},range:function(){return o}}}(t.colors,n,s)),s}(s,l,r,{external:t,field:n.pic.field(e.field)}):s}return{}}))):Promise.resolve()},resolveUIColor:function(e){if(e.index<0||void 0===e.index)return e.color;if(void 0===n.uiPalette&&(n.uiPalette=this.palettes().filter((function(e){return"ui"===e.key}))[0]||!1),!n.uiPalette)return e.color;var t="none"===n.uiPalette.colors[0]?e.index:e.index-1;return void 0===n.uiPalette.colors[t]?e.color:n.uiPalette.colors[t]},settings:function(){if(this.palettes(),!n.settings){var e={primary:"steelblue",others:"#aaa",nil:"#ddd"},i=t.theme;i&&(e=ay(ay({},e),i.getDataColorSpecials())),n.settings=xy(e,fv(this,n,t,e))}return n.settings}};return r}var mv=function(e,t){var n=e.fieldType,i={};if(t)if("measure"===n){var r=t.coloring;r&&(i.measureGradient=r.gradient)}else if("dimension"===n){var o=t[0],s=t[1];o&&(i.legendDataPage=o),s&&(i.dimValsData=s.colorMap)}return i},gv=function(e){throw e.isHandled=!0,e},yv=function(e,t){var n=t.layout,i=t.app;return n&&n.snapshotData?n.snapshotData.content&&n.snapshotData.content.chartData&&n.snapshotData.content.chartData.dimValsData?Promise.resolve({colorMap:n.snapshotData.content.chartData.dimValsData}):Promise.reject():i&&i.getObject?i.getObject("ColorMapModel_".concat(e)).then((function(e){return e.getLayout()})):Promise.reject()},vv=function(e,t){var n=t.layout,i=t.app;return n&&n.snapshotData?n.snapshotData.content&&n.snapshotData.content.chartData&&n.snapshotData.content.chartData.measureGradient?Promise.resolve({coloring:{gradient:n.snapshotData.content.chartData.measureGradient}}):Promise.reject():i&&i.getMeasure?i.getMeasure(e).then((function(e){return e.getMeasure()})):Promise.reject()},bv=function(e,t){var n=t.layout,i=t.model,r=t.app;return n&&n.snapshotData?n.snapshotData.content&&n.snapshotData.content.chartData&&n.snapshotData.content.chartData.legendDataPage?Promise.resolve(n.snapshotData.content.chartData.legendDataPage):Promise.reject():i&&i.session&&r?i.getHyperCubeData(e,[{qHeight:100,qLeft:0,qTop:0,qWidth:2}]).catch(gv):Promise.reject()};function xv(e){var t=e.hc,n=e.source,i=e.coloring,r={data:{extract:[{source:"dummy",field:0,filter:function(){return r.expando=t.qDataPages[0]?t.qDataPages[0].qArea.qTop:0,!1}},{source:n,field:i.field,trackBy:i.valueAccessor,reduce:"first",props:{row:{reduce:function(){return r.expando++}},text:{value:function(e){return e.qText},reduce:"first"}}}]},expando:0};return r}function wv(e){return function(t){return"object"===ly(t.datum[e])?t.datum[e].value:void 0}}function qv(e){return"object"===ly(e.datum.isNull)?e.datum.isNull.value:-2===e.datum.value}function Mv(e){return-3===e.datum.value}var Dv={COLOR:void 0,FONT_SIZE:"16px",FONT_FAMILY:"'Source Sans Pro', 'Arial', 'sans-serif'"},Sv={COLOR:void 0,FONT_SIZE:void 0,FONT_FAMILY:"'Source Sans Pro', 'Arial', 'sans-serif'"};function _v(e){var t=e.theme,n=e.key,i=e.styleOverrides,r={title:{color:Dv.COLOR,fontSize:Dv.FONT_SIZE,fontFamily:Dv.FONT_FAMILY},label:{color:Sv.COLOR,fontSize:Sv.FONT_SIZE,fontFamily:Sv.FONT_FAMILY}};if(!t&&!i)return r;var o=i||{},s=o.title,a=o.label,l=function(e){var t=e.theme,n=e.key;return function(e,i,r,o){return void 0!==e?e:t?t.getStyle(n,i,r):o}}({theme:t,key:n});return r.title.color=l(null==s?void 0:s.color,"legend.title","color",Dv.COLOR),r.title.fontSize=l(null==s?void 0:s.fontSize,"legend.title","fontSize",Dv.FONT_SIZE),r.title.fontFamily=l(null==s?void 0:s.fontFamily,"legend.title","fontFamily",Dv.FONT_FAMILY),r.label.color=l(null==a?void 0:a.color,"legend.label","color",Sv.COLOR),r.label.fontSize=l(null==a?void 0:a.fontSize,"legend.label","fontSize",Sv.FONT_SIZE),r.label.fontFamily=l(null==a?void 0:a.fontFamily,"legend.label","fontFamily",Sv.FONT_FAMILY),r}var Cv=function(e,t,n){var i=e&&e.dock||void 0;if("auto"!==i)return i||"right";if(t){var r=t.element.getBoundingClientRect();if(r.height>r.width)return"bottom"}return n?"left":"right"},kv=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 Ev(e,t){var n=e.styleReference,i=e.styleOverrides,r=e.chart,o=e.rtl,s=t.legendProps,a=t.coloring,l=t.theme,c=t.hc,u=_v({theme:l,key:n,styleOverrides:i});return{layout:{minimumLayoutMode:"MEDIUM",dock:Cv(s,r,o)},show:"function"==typeof s.show?function(){return kv(s,c,a)}:kv(s,c,a),renderer:"svg",mounted:function(e){e.childNodes[0].style.pointerEvents="none",e.style.overflow="hidden"},settings:{title:{show:!1!==s.showTitle,wordBreak:"break-word",maxLines:2,lineHeight:1.2,text:a.label||"",fill:u.title.color,fontSize:u.title.fontSize,fontFamily:u.title.fontFamily}}}}function Av(e,t,n){return"categorical"===t.coloring.type?function(e,t,n){var i=Ev(e,t);if(!i.show)return!1;var r,o=e.key,s=e.styleReference,a=e.styleOverrides,l=e.viewState,c=e.rtl,u=e.settings,h=e.style,d=t.scaleKey,f=t.theme,p=t.scales,m=_v({theme:f,key:s,styleOverrides:a}),g=i.layout.dock,y="left"===g||"right"===g?{maxLines:3,wordBreak:"break-word"}:{},v={up:"M13.6,11 L2.4,11 C2.28954305,11 2.2,10.9104569 2.2,10.8 C2.2,10.756726 2.21403557,10.7146192 2.24,10.68 L7.84,3.21333333 C7.90627417,3.12496777 8.03163444,3.10705916 8.12,3.17333333 C8.13516113,3.18470418 8.14862915,3.1981722 8.16,3.21333333 L13.76,10.68 C13.8262742,10.7683656 13.8083656,10.8937258 13.72,10.96 C13.6853808,10.9859644 13.643274,11 13.6,11 Z",down:"M2.4,4 L13.6,4 C13.7104569,4 13.8,4.08954305 13.8,4.2 C13.8,4.24327404 13.7859644,4.28538077 13.76,4.32 L8.16,11.7866667 C8.09372583,11.8750322 7.96836556,11.8929408 7.88,11.8266667 C7.86483887,11.8152958 7.85137085,11.8018278 7.84,11.7866667 L2.24,4.32 C2.17372583,4.23163444 2.19163444,4.10627417 2.28,4.04 C2.31461923,4.01403557 2.35672596,4 2.4,4 Z",left:"M11,2.4 L11,13.6 C11,13.7104569 10.9104569,13.8 10.8,13.8 C10.756726,13.8 10.7146192,13.7859644 10.68,13.76 L3.21333333,8.16 C3.12496777,8.09372583 3.10705916,7.96836556 3.17333333,7.88 C3.18470418,7.86483887 3.1981722,7.85137085 3.21333333,7.84 L10.68,2.24 C10.7683656,2.17372583 10.8937258,2.19163444 10.96,2.28 C10.9859644,2.31461923 11,2.35672596 11,2.4 Z",right:"M4,13.6 L4,2.4 C4,2.28954305 4.08954305,2.2 4.2,2.2 C4.24327404,2.2 4.28538077,2.21403557 4.32,2.24 L11.7866667,7.84 C11.8750322,7.90627417 11.8929408,8.03163444 11.8266667,8.12 C11.8152958,8.13516113 11.8018278,8.14862915 11.7866667,8.16 L4.32,13.76 C4.23163444,13.8262742 4.10627417,13.8083656 4.04,13.72 C4.01403557,13.6853808 4,13.643274 4,13.6 Z"};"dimension"===t.coloring.fieldType&&(r=function(e){return e.datum.value>=0||-3===e.datum.value});var b="".concat(d,"Legend");return xy(!0,i,{type:"legend-cat",key:"".concat(o,"-cat"),scale:b in p?b:d,settings:{layout:{scrollOffset:function(){return l?l.get("legendScrollOffset"):void 0},size:-1!==["top","bottom"].indexOf(i.layout.dock)?2:1,direction:c?"rtl":"ltr",horizontal:20},item:{show:r,label:ay({fill:m.label.color,fontSize:m.label.fontSize,fontFamily:m.label.fontFamily},y)},navigation:{disabled:n,button:{content:function(e,t){var n=t.direction;return e("i",{style:{"pointer-events":"none",fontSize:"12px",display:"inline-block",fontStyle:"normal",lineHeight:"0",textAlign:"center",textTransform:"none",verticalAlign:"-0.125em",textRendering:"optimizelegibility",margin:"0px"}},[e("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 16 16",fill:"currentColor"},[e("path",{d:v[n]})])])}}}},brush:{consume:[{context:"selection",data:["",o],style:{inactive:{opacity:.3}}}]}},{settings:u,style:h})}(e,t,n):"continuous"===t.coloring.type&&function(e,t){var n,i=e.key,r=e.styleReference,o=e.styleOverrides,s=e.rtl,a=e.settings,l=e.style,c=t.scaleKey,u=t.theme,h="".concat(c,"Range"),d=Ev(e,t);if(!d.show)return!1;var f=_v({theme:u,key:r,styleOverrides:o}),p=d.layout.dock,m="right"===p||"left"===p,g=null===(n=t.scales)||void 0===n?void 0:n[h];return m&&g&&(g.invert=!0),xy(!0,d,{type:"legend-seq",key:"".concat(i,"-seq"),settings:{fill:c,major:h,length:1,tick:{fill:f.label.color,fontSize:f.label.fontSize,fontFamily:f.label.fontFamily},title:{anchor:!s||"top"!==d.layout.dock&&"bottom"!==d.layout.dock?void 0:"right",padding:parseFloat(d.settings.title.fontSize)||16}}},{settings:a,style:l})}(e,t)}function Tv(e,t,n){var i=[],r=[],o=Av(e,t,n&&n.navigationDisabled);return i.push(o),o&&"legend-cat"===o.type&&(r.push(function(e){var t=e.key,n=e.requireFailure,i=e.recognizeWith,r=(arguments.length>1&&void 0!==arguments[1]?arguments[1]:{}).actions;return{key:"event:tap-".concat(t),type:"Tap",requireFailure:n,recognizeWith:i,options:{event:"legendtap",interval:10,pointers:1,enable:function(e,n){var i;if(!n)return!0;if(null!=r&&null!==(i=r.interact)&&void 0!==i&&i.enabled&&!r.interact.enabled())return!1;if(!this.chart.componentsFromPoint({x:n.center.x,y:n.center.y}).some((function(e){return e.key==="".concat(t,"-cat")})))return!1;var o=n.srcEvent.target;return!!(o&&o.hasAttribute("data-action")&&o.hasAttribute("data-component-key"))||!(!o||!o.childNodes[0]||"BUTTON"!==o.childNodes[0].nodeName)}},events:{legendtap:function(e){e.preventDefault();var t=e.srcEvent.target;t&&t.hasAttribute("data-action")&&t.hasAttribute("data-component-key")&&this.chart.component(t.getAttribute("data-component-key")).emit(t.getAttribute("data-action"))}}}}(e,n)),r.push(function(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=t.eventName,i=t.key,r=t.requireFailure,o=t.recognizeWith,s=(arguments.length>1&&void 0!==arguments[1]?arguments[1]:{}).actions;return{key:"event:pan-".concat(i),type:"Pan",requireFailure:r,recognizeWith:o,options:{event:n,pointers:1,threshold:10,enable:function(e,t){var r;return this.started===n||!t||!(null!=s&&null!==(r=s.interact)&&void 0!==r&&r.enabled&&!s.interact.enabled())&&this.chart.componentsFromPoint({x:t.center.x,y:t.center.y}).some((function(e){return e.key==="".concat(i,"-cat")}))}},events:(e={},cy(e,"".concat(n,"start"),(function(e){e.preventDefault(),this.started!==n&&(this.started=n,this.chart.component("".concat(i,"-cat")).emit("panstart",e))})),cy(e,"".concat(n,"move"),(function(e){e.preventDefault(),this.chart.component("".concat(i,"-cat")).emit("panmove",e)})),cy(e,"".concat(n,"end"),(function(e){e.preventDefault(),this.chart.component("".concat(i,"-cat")).emit("panend",e),this.started=!1})),e)}}(e,n))),{interactions:r,components:i}}function Iv(e,t,n){e.prototype=t.prototype=n,n.constructor=e}function Rv(e,t){var n=Object.create(e.prototype);for(var i in t)n[i]=t[i];return n}function Nv(){}var Ov=1/.7,Pv="\\s*([+-]?\\d+)\\s*",Lv="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",Fv="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",zv=/^#([0-9a-f]{3,8})$/,jv=new RegExp(`^rgb\\(${Pv},${Pv},${Pv}\\)$`),Hv=new RegExp(`^rgb\\(${Fv},${Fv},${Fv}\\)$`),Bv=new RegExp(`^rgba\\(${Pv},${Pv},${Pv},${Lv}\\)$`),Vv=new RegExp(`^rgba\\(${Fv},${Fv},${Fv},${Lv}\\)$`),$v=new RegExp(`^hsl\\(${Lv},${Fv},${Fv}\\)$`),Wv=new RegExp(`^hsla\\(${Lv},${Fv},${Fv},${Lv}\\)$`),Uv={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 Yv(){return this.rgb().formatHex()}function Xv(){return this.rgb().formatRgb()}function Kv(e){var t,n;return e=(e+"").trim().toLowerCase(),(t=zv.exec(e))?(n=t[1].length,t=parseInt(t[1],16),6===n?Gv(t):3===n?new Qv(t>>8&15|t>>4&240,t>>4&15|240&t,(15&t)<<4|15&t,1):8===n?Jv(t>>24&255,t>>16&255,t>>8&255,(255&t)/255):4===n?Jv(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=jv.exec(e))?new Qv(t[1],t[2],t[3],1):(t=Hv.exec(e))?new Qv(255*t[1]/100,255*t[2]/100,255*t[3]/100,1):(t=Bv.exec(e))?Jv(t[1],t[2],t[3],t[4]):(t=Vv.exec(e))?Jv(255*t[1]/100,255*t[2]/100,255*t[3]/100,t[4]):(t=$v.exec(e))?ob(t[1],t[2]/100,t[3]/100,1):(t=Wv.exec(e))?ob(t[1],t[2]/100,t[3]/100,t[4]):Uv.hasOwnProperty(e)?Gv(Uv[e]):"transparent"===e?new Qv(NaN,NaN,NaN,0):null}function Gv(e){return new Qv(e>>16&255,e>>8&255,255&e,1)}function Jv(e,t,n,i){return i<=0&&(e=t=n=NaN),new Qv(e,t,n,i)}function Zv(e){return e instanceof Nv||(e=Kv(e)),e?new Qv((e=e.rgb()).r,e.g,e.b,e.opacity):new Qv}function Qv(e,t,n,i){this.r=+e,this.g=+t,this.b=+n,this.opacity=+i}function eb(){return`#${rb(this.r)}${rb(this.g)}${rb(this.b)}`}function tb(){const e=nb(this.opacity);return`${1===e?"rgb(":"rgba("}${ib(this.r)}, ${ib(this.g)}, ${ib(this.b)}${1===e?")":`, ${e})`}`}function nb(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function ib(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function rb(e){return((e=ib(e))<16?"0":"")+e.toString(16)}function ob(e,t,n,i){return i<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new ab(e,t,n,i)}function sb(e){if(e instanceof ab)return new ab(e.h,e.s,e.l,e.opacity);if(e instanceof Nv||(e=Kv(e)),!e)return new ab;if(e instanceof ab)return e;var t=(e=e.rgb()).r/255,n=e.g/255,i=e.b/255,r=Math.min(t,n,i),o=Math.max(t,n,i),s=NaN,a=o-r,l=(o+r)/2;return a?(s=t===o?(n-i)/a+6*(n<i):n===o?(i-t)/a+2:(t-n)/a+4,a/=l<.5?o+r:2-o-r,s*=60):a=l>0&&l<1?0:s,new ab(s,a,l,e.opacity)}function ab(e,t,n,i){this.h=+e,this.s=+t,this.l=+n,this.opacity=+i}function lb(e){return(e=(e||0)%360)<0?e+360:e}function cb(e){return Math.max(0,Math.min(1,e||0))}function ub(e,t,n){return 255*(e<60?t+(n-t)*e/60:e<180?n:e<240?t+(n-t)*(240-e)/60:t)}Iv(Nv,Kv,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:Yv,formatHex:Yv,formatHex8:function(){return this.rgb().formatHex8()},formatHsl:function(){return sb(this).formatHsl()},formatRgb:Xv,toString:Xv}),Iv(Qv,(function(e,t,n,i){return 1===arguments.length?Zv(e):new Qv(e,t,n,null==i?1:i)}),Rv(Nv,{brighter(e){return e=null==e?Ov:Math.pow(Ov,e),new Qv(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=null==e?.7:Math.pow(.7,e),new Qv(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new Qv(ib(this.r),ib(this.g),ib(this.b),nb(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:eb,formatHex:eb,formatHex8:function(){return`#${rb(this.r)}${rb(this.g)}${rb(this.b)}${rb(255*(isNaN(this.opacity)?1:this.opacity))}`},formatRgb:tb,toString:tb})),Iv(ab,(function(e,t,n,i){return 1===arguments.length?sb(e):new ab(e,t,n,null==i?1:i)}),Rv(Nv,{brighter(e){return e=null==e?Ov:Math.pow(Ov,e),new ab(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=null==e?.7:Math.pow(.7,e),new ab(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=this.h%360+360*(this.h<0),t=isNaN(e)||isNaN(this.s)?0:this.s,n=this.l,i=n+(n<.5?n:1-n)*t,r=2*n-i;return new Qv(ub(e>=240?e-240:e+120,r,i),ub(e,r,i),ub(e<120?e+240:e-120,r,i),this.opacity)},clamp(){return new ab(lb(this.h),cb(this.s),cb(this.l),nb(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=nb(this.opacity);return`${1===e?"hsl(":"hsla("}${lb(this.h)}, ${100*cb(this.s)}%, ${100*cb(this.l)}%${1===e?")":`, ${e})`}`}}));const hb=Math.PI/180,db=180/Math.PI,fb=4/29,pb=6/29,mb=3*pb*pb;function gb(e){if(e instanceof yb)return new yb(e.l,e.a,e.b,e.opacity);if(e instanceof Mb)return Db(e);e instanceof Qv||(e=Zv(e));var t,n,i=wb(e.r),r=wb(e.g),o=wb(e.b),s=vb((.2225045*i+.7168786*r+.0606169*o)/1);return i===r&&r===o?t=n=s:(t=vb((.4360747*i+.3850649*r+.1430804*o)/.96422),n=vb((.0139322*i+.0971045*r+.7141733*o)/.82521)),new yb(116*s-16,500*(t-s),200*(s-n),e.opacity)}function yb(e,t,n,i){this.l=+e,this.a=+t,this.b=+n,this.opacity=+i}function vb(e){return e>.008856451679035631?Math.pow(e,1/3):e/mb+fb}function bb(e){return e>pb?e*e*e:mb*(e-fb)}function xb(e){return 255*(e<=.0031308?12.92*e:1.055*Math.pow(e,1/2.4)-.055)}function wb(e){return(e/=255)<=.04045?e/12.92:Math.pow((e+.055)/1.055,2.4)}function qb(e){if(e instanceof Mb)return new Mb(e.h,e.c,e.l,e.opacity);if(e instanceof yb||(e=gb(e)),0===e.a&&0===e.b)return new Mb(NaN,0<e.l&&e.l<100?0:NaN,e.l,e.opacity);var t=Math.atan2(e.b,e.a)*db;return new Mb(t<0?t+360:t,Math.sqrt(e.a*e.a+e.b*e.b),e.l,e.opacity)}function Mb(e,t,n,i){this.h=+e,this.c=+t,this.l=+n,this.opacity=+i}function Db(e){if(isNaN(e.h))return new yb(e.l,0,0,e.opacity);var t=e.h*hb;return new yb(e.l,Math.cos(t)*e.c,Math.sin(t)*e.c,e.opacity)}Iv(yb,(function(e,t,n,i){return 1===arguments.length?gb(e):new yb(e,t,n,null==i?1:i)}),Rv(Nv,{brighter(e){return new yb(this.l+18*(null==e?1:e),this.a,this.b,this.opacity)},darker(e){return new yb(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 Qv(xb(3.1338561*(t=.96422*bb(t))-1.6168667*(e=1*bb(e))-.4906146*(n=.82521*bb(n))),xb(-.9787684*t+1.9161415*e+.033454*n),xb(.0719453*t-.2289914*e+1.4052427*n),this.opacity)}})),Iv(Mb,(function(e,t,n,i){return 1===arguments.length?qb(e):new Mb(e,t,n,null==i?1:i)}),Rv(Nv,{brighter(e){return new Mb(this.h,this.c,this.l+18*(null==e?1:e),this.opacity)},darker(e){return new Mb(this.h,this.c,this.l-18*(null==e?1:e),this.opacity)},rgb(){return Db(this).rgb()}}));var Sb=function(e){return"rgba(".concat([(16711680&e)>>16,(65280&e)>>8,255&e,((4278190080&e)>>>24)/255].join(","),")")};function _b(e){var t=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.auto,n=pv(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,i=t.app;return yv(e,{layout:n,app:i})})).getMeasure((function(e,t){var n=t.layout,i=t.app;return vv(e,{layout:n,app:i})})).getAttributeDimension((function(e,t){var n=t.layout,i=t.model,r=t.app;return bv(e,{layout:n,model:i,app:r})}));return n.getSnapshotData=mv,n}({resources:e}),n={},i={},r=function(e){return i.settings||(e||console.warn("settings() called before auxiliarySettings()"),i.settings=t.settings()),i.settings},o={config:function(r){if(n=ay({},r),i={},!n.key)throw new Error("Missing key");t.set(ay(ay({},e),n))},auto:function(e){return e?(t.auto(e),o):t.auto()},getAuxiliarySettings:function(e){return i.auxiliarySettings?Promise.resolve(i.auxiliarySettings):t.getAuxiliarySettings(r(!0),e).then((function(e){return i.auxiliarySettings=e||{},i.settings=ay(ay({},i.settings),i.auxiliarySettings),i.scales=void 0,i.color=void 0,i.auxiliarySettings}))},getAuxiliaryData:function(){return t.getAuxiliaryData(r())},getSnapshotData:function(e){var n=r();return t.getAuxiliaryData(n,e).then((function(e){return t.getSnapshotData(n,e)}))},resolveUIColor:function(e){return t.resolveUIColor(e)},settings:function(){var e=r();return{mode:e.mode,type:e.type,label:e.label,field:e.field,fieldType:e.fieldType,nil:e.nil,others:e.others,primary:e.primary}},settingsForMeasure:function(e){var t;return(null===(t=r().measureOverrides)||void 0===t?void 0:t[e])||this.settings()},isSelectionLocked:function(e){var t=e.isMeasureSelectionLocked;return function(e,t){var n=t.isMeasureSelectionLocked;return"field"!==e.mode||("dimension"===e.fieldType?e.isFieldLocked:"measure"!==e.fieldType||n)}(r(),{isMeasureSelectionLocked:t})},palettes:function(){return function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.colorProps,n=e.coloring,i=e.theme,r=[];if(n&&n.palettes&&i){var o=n.palettes.categorical||t.dimensionScheme,s=i.getDataColorPalettes().filter((function(e){return e.key===o}))[0]||i.getDataColorPalettes()[0];o&&s&&r.push({key:"categorical",colors:s.colors});var a=n.palettes.metric||t.measureScheme,l=i.getDataColorScales().filter((function(e){return e.key===a}))[0];if(l){var c=l.colors[0]?l.colors:[[]].concat(uy(l.colors.slice(1)));c=Array.isArray(c[0])?c.map((function(e){return e.slice().reverse()})):c.slice().reverse(),r.push({key:"quant",colors:c})}}return r}({coloring:r(),colorProps:n.colorProps,theme:n.theme})},scales:function(){return i.scales=i.scales||function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.hc,n=e.coloring,i=e.rtl,r=e.key,o=e.source,s=e.picasso,a={},l=r;if(n){var c={override:!0,domain:n.explicit&&"function"==typeof n.explicit.domain?n.explicit.domain:[].concat(uy((n.explicit||{}).domain||[]),[-3,-2]),range:n.explicit&&"function"==typeof n.explicit.range?n.explicit.range:[].concat(uy((n.explicit||{}).range||[]),[n.others,n.nil])};if("field"===n.mode){if("dimension"===n.fieldType){var u,h=xv({hc:t,source:o,coloring:n}).data;if(n.legendDataset){var d=0,f={};s.data("q")({data:t}).extract({field:n.field,trackBy:n.valueAccessor,reduce:function(e){var t=e[0];return f[t]=d++,e[0]}}),u={source:"attrDim",extract:{field:"qDimensionInfo/0",filter:function(e){return e.qElemNumber>=0},props:{row:{value:function(e){return f[e.qElemNumber]}}}}}}var p={data:h,range:n.range,domain:n.domain,explicit:c,type:"categorical-color",label:function(e){return e.datum.text&&e.datum.text.value?e.datum.text.value:e.datum.label}};a[l]=p,u&&(a["".concat(l,"Legend")]=ay(ay({},p),{},{data:u})),t&&t.qHasOtherValues&&u&&((u||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};a[l]=xy({},m,{type:"categorical"===n.type?"threshold-color":"sequential-color",range:n.range,domain:n.domain,invert:n.reverse}),"sequential-color"===a[l].type&&(a["".concat(l,"Range")]=xy({},m,{invert:!!i}))}else if("color"!==n.type)throw new Error("UNUSED FIELD")}else if("dimension"===n.mode){var g={data:t.qDimensionInfo.map((function(e,t){return t})),label:function(e){return t.qDimensionInfo[e.datum.value].qFallbackTitle},explicit:c,type:"categorical-color"};a[l]=g}else if("measure"===n.mode){var y={data:t.qMeasureInfo.map((function(e,t){return t})).filter((function(e){var t,i;return!(null!==(t=n.explicit)&&void 0!==t&&null!==(i=t.exclude)&&void 0!==i&&i.includes(e))})),label:function(e){return t.qMeasureInfo[e.datum.value].qFallbackTitle},explicit:c,type:"categorical-color"};a[l]=y}}return a}({hc:n.hc,coloring:r(),key:n.key,source:n.source,picasso:e.picasso}),i.scales},color:function(){return i.color=i.color||function(e){var t=e.coloring,n=e.scales,i=e.key,r=wv(i),o=wv("".concat(i,"IsAnOther")),s=function(e,t){var i=e.fieldType,s=e.invalid,a=e.mode,l=e.nil,c=e.others,u=e.primary,h=e.type;return s?function(e){return Mv(e)||o(e)?c:l}:n[t]?function(e){return Mv(e)?c:qv(e)||-2===r(e)&&"dimension"===i||"NaN"===r(e)?l:o(e)?c:e.resources.scale(t)(r(e))||c}:"constant"===a?function(e){return Mv(e)||o(e)?c:qv(e)?l:u}:"color"===h?function(e){return Mv(e)||o(e)?c:qv(e)?l:r(e)||c}:null},a=s(t,i);if(t.measureOverrides){var l=wv("".concat(i,"MeasureIdx")),c=t.measureOverrides.map((function(e){return e&&s(e)}));return function(e){var t=l(e);return c[t]?c[t](e):a(e)}}return a}({coloring:r(),scales:this.scales(),key:n.key}),i.color},datumProps:function(e){return function(e){var t,n,i=e.hc,r=e.coloring,o=e.scales,s=e.key,a=e.addMeasureIx,l=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,c=s,u=r.nil;"field"===r.mode&&r.field?t=r.field:o[s]&&"field"===r.mode&&(t=o[s].data.field||r.field),t?(n={field:t,reduce:"first"},"color"===r.type&&(n.value=function(e){return"NaN"!==e.qNum?Sb(e.qNum):e.qText&&Kv(e.qText)?e.qText:u})):"dimension"===r.mode?n=void 0!==r.field?r.field:i.qDimensionInfo.length-1:"measure"===r.mode&&(n=l);var h=cy({},c,n);return i.qDimensionInfo.length>1&&(h["".concat(c,"IsAnOther")]={fields:i.qDimensionInfo.map((function(e,t){return{field:"qDimensionInfo/".concat(t)}})),value:function(e){return-1!==e.indexOf(-3)}}),a&&(h["".concat(c,"MeasureIdx")]=l),h}({coloring:this.settingsForMeasure(e),scales:this.scales(),key:n.key,hc:n.hc,addMeasureIx:r().measureOverrides},e)},data:function(){var e=r(),t={key:"dummy",data:[["field"],["a"]]};return e.legendDataset?[t,{type:"q",key:"attrDim",data:e.legendDataset.raw(),config:{localeInfo:n.localeInfo}}]:[t]},legend:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.eventName,i=e.key,o=e.viewState,s=e.chart,a=e.rtl,l=e.styleReference,c=void 0===l?"object.legend":l,u=e.styleOverrides,h=e.settings,d=void 0===h?{}:h,f=e.style,p=void 0===f?{}:f,m=arguments.length>1?arguments[1]:void 0;return Tv({eventName:t,key:i,rtl:a,viewState:o,chart:s,styleReference:c,styleOverrides:u,settings:d,style:p},{legendProps:n.legendProps,scaleKey:n.key,coloring:r(),theme:n.theme,hc:n.hc,scales:this.scales()},m)}};return o}var Cb=function(e){return e.baseColor||e.coloring&&e.coloring.baseColor};function kb(e){var t=e.qHyperCube,n=t.qDimensionInfo,i=t.qMeasureInfo,r=n.some(Cb),o=i.some(Cb),s=e.color.useBaseColors;return"measure"===s&&!o||"dimension"===s&&!r?"off":s}function Eb(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=ay(ay(ay({},e),t),{},{colorProps:ay(ay({},e.colorProps),t.colorProps||{})});return n}var Ab=function(e){return e.baseColor||e.coloring&&e.coloring.baseColor};function Tb(e){var t,n=e.qHyperCube.qDimensionInfo.some(Ab),i=e.qHyperCube.qMeasureInfo.some(Ab),r=n?"dimension":void 0;return{mode:"primary",useBaseColors:null!==(t=null!=r?r:i?"measure":void 0)&&void 0!==t?t:"off",paletteColor:null}}var Ib=function(){};function Rb(e,t,n){if(void 0===e||void 0===t)return n;for(var i=t.split("."),r=e,o=0;o<i.length;++o){var s=i[o];if(void 0===r[s])return n;r=r[s]}return r}function Nb(e,t,n){if(void 0!==e&&void 0!==t){for(var i=t.split("."),r=i[i.length-1],o=e,s=0;s<i.length-1;++s){var a=i[s];void 0===o[a]&&(o[a]=Number.isNaN(+i[s+1])?{}:[]),o=o[a]}void 0!==n?o[r]=n:delete o[r]}}function Ob(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Pb(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}function Lb(e,t,n){return t&&Pb(e.prototype,t),n&&Pb(e,n),e}function Fb(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function zb(e){var t=0,n=e.children,i=n&&n.length;if(i)for(;--i>=0;)t+=n[i].value;else t=1;e.value=t}function jb(e,t){var n,i,r,o,s,a=new $b(e),l=+e.value&&(a.value=e.value),c=[a];for(null==t&&(t=Hb);n=c.pop();)if(l&&(n.value=+n.data.value),(r=t(n.data))&&(s=r.length))for(n.children=new Array(s),o=s-1;o>=0;--o)c.push(i=n.children[o]=new $b(r[o])),i.parent=n,i.depth=n.depth+1;return a.eachBefore(Vb)}function Hb(e){return e.children}function Bb(e){e.data=e.data.data}function Vb(e){var t=0;do{e.height=t}while((e=e.parent)&&e.height<++t)}function $b(e){this.data=e,this.depth=this.height=0,this.parent=null}$b.prototype=jb.prototype={constructor:$b,count:function(){return this.eachAfter(zb)},each:function(e){var t,n,i,r,o=this,s=[o];do{for(t=s.reverse(),s=[];o=t.pop();)if(e(o),n=o.children)for(i=0,r=n.length;i<r;++i)s.push(n[i])}while(s.length);return this},eachAfter:function(e){for(var t,n,i,r=this,o=[r],s=[];r=o.pop();)if(s.push(r),t=r.children)for(n=0,i=t.length;n<i;++n)o.push(t[n]);for(;r=s.pop();)e(r);return this},eachBefore:function(e){for(var t,n,i=this,r=[i];i=r.pop();)if(e(i),t=i.children)for(n=t.length-1;n>=0;--n)r.push(t[n]);return this},sum:function(e){return this.eachAfter((function(t){for(var n=+e(t.data)||0,i=t.children,r=i&&i.length;--r>=0;)n+=i[r].value;t.value=n}))},sort:function(e){return this.eachBefore((function(t){t.children&&t.children.sort(e)}))},path:function(e){for(var t=this,n=function(e,t){if(e===t)return e;var n=e.ancestors(),i=t.ancestors(),r=null;for(e=n.pop(),t=i.pop();e===t;)r=e,e=n.pop(),t=i.pop();return r}(t,e),i=[t];t!==n;)t=t.parent,i.push(t);for(var r=i.length;e!==n;)i.splice(r,0,e),e=e.parent;return i},ancestors:function(){for(var e=this,t=[e];e=e.parent;)t.push(e);return t},descendants:function(){var e=[];return this.each((function(t){e.push(t)})),e},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 jb(this).eachBefore(Bb)}};var Wb,Ub,Yb=(Wb=function(e){
|
|
24
|
+
* Licensed under the MIT license */!function(e){!function(t,n,i,r){var o,s=["","webkit","Moz","MS","ms","o"],a=n.createElement("div"),l="function",c=Math.round,u=Math.abs,h=Date.now;function d(e,t,n){return setTimeout(b(e,n),t)}function f(e,t,n){return!!Array.isArray(e)&&(p(e,n[t],n),!0)}function p(e,t,n){var i;if(e)if(e.forEach)e.forEach(t,n);else if(e.length!==r)for(i=0;i<e.length;)t.call(n,e[i],i,e),i++;else for(i in e)e.hasOwnProperty(i)&&t.call(n,e[i],i,e)}function m(e,n,i){var r="DEPRECATED METHOD: "+n+"\n"+i+" AT \n";return function(){var n=new Error("get-stack-trace"),i=n&&n.stack?n.stack.replace(/^[^\(]+?[\n$]/gm,"").replace(/^\s+at\s+/gm,"").replace(/^Object.<anonymous>\s*\(/gm,"{anonymous}()@"):"Unknown Stack Trace",o=t.console&&(t.console.warn||t.console.log);return o&&o.call(t.console,r,i),e.apply(this,arguments)}}o="function"!=typeof Object.assign?function(e){if(e===r||null===e)throw new TypeError("Cannot convert undefined or null to object");for(var t=Object(e),n=1;n<arguments.length;n++){var i=arguments[n];if(i!==r&&null!==i)for(var o in i)i.hasOwnProperty(o)&&(t[o]=i[o])}return t}:Object.assign;var g=m((function(e,t,n){for(var i=Object.keys(t),o=0;o<i.length;)(!n||n&&e[i[o]]===r)&&(e[i[o]]=t[i[o]]),o++;return e}),"extend","Use `assign`."),y=m((function(e,t){return g(e,t,!0)}),"merge","Use `assign`.");function v(e,t,n){var i,r=t.prototype;(i=e.prototype=Object.create(r)).constructor=e,i._super=r,n&&o(i,n)}function b(e,t){return function(){return e.apply(t,arguments)}}function x(e,t){return typeof e==l?e.apply(t&&t[0]||r,t):e}function w(e,t){return e===r?t:e}function q(e,t,n){p(_(t),(function(t){e.addEventListener(t,n,!1)}))}function S(e,t,n){p(_(t),(function(t){e.removeEventListener(t,n,!1)}))}function M(e,t){for(;e;){if(e==t)return!0;e=e.parentNode}return!1}function D(e,t){return e.indexOf(t)>-1}function _(e){return e.trim().split(/\s+/g)}function C(e,t,n){if(e.indexOf&&!n)return e.indexOf(t);for(var i=0;i<e.length;){if(n&&e[i][n]==t||!n&&e[i]===t)return i;i++}return-1}function k(e){return Array.prototype.slice.call(e,0)}function E(e,t,n){for(var i=[],r=[],o=0;o<e.length;){var s=t?e[o][t]:e[o];C(r,s)<0&&i.push(e[o]),r[o]=s,o++}return n&&(i=t?i.sort((function(e,n){return e[t]>n[t]})):i.sort()),i}function A(e,t){for(var n,i,o=t[0].toUpperCase()+t.slice(1),a=0;a<s.length;){if((i=(n=s[a])?n+o:t)in e)return i;a++}return r}var T=1;function I(e){var n=e.ownerDocument||e;return n.defaultView||n.parentWindow||t}var R="ontouchstart"in t,O=A(t,"PointerEvent")!==r,N=R&&/mobile|tablet|ip(ad|hone|od)|android/i.test(navigator.userAgent),P="touch",L="mouse",F=25,z=1,j=4,H=8,B=1,V=2,$=4,W=8,U=16,Y=V|$,X=W|U,K=Y|X,G=["x","y"],J=["clientX","clientY"];function Z(e,t){var n=this;this.manager=e,this.callback=t,this.element=e.element,this.target=e.options.inputTarget,this.domHandler=function(t){x(e.options.enable,[e])&&n.handler(t)},this.init()}function Q(e,t,n){var i=n.pointers.length,o=n.changedPointers.length,s=t&z&&i-o==0,a=t&(j|H)&&i-o==0;n.isFirst=!!s,n.isFinal=!!a,s&&(e.session={}),n.eventType=t,function(e,t){var n=e.session,i=t.pointers,o=i.length;n.firstInput||(n.firstInput=ee(t));o>1&&!n.firstMultiple?n.firstMultiple=ee(t):1===o&&(n.firstMultiple=!1);var s=n.firstInput,a=n.firstMultiple,l=a?a.center:s.center,c=t.center=te(i);t.timeStamp=h(),t.deltaTime=t.timeStamp-s.timeStamp,t.angle=oe(l,c),t.distance=re(l,c),function(e,t){var n=t.center,i=e.offsetDelta||{},r=e.prevDelta||{},o=e.prevInput||{};t.eventType!==z&&o.eventType!==j||(r=e.prevDelta={x:o.deltaX||0,y:o.deltaY||0},i=e.offsetDelta={x:n.x,y:n.y});t.deltaX=r.x+(n.x-i.x),t.deltaY=r.y+(n.y-i.y)}(n,t),t.offsetDirection=ie(t.deltaX,t.deltaY);var d=ne(t.deltaTime,t.deltaX,t.deltaY);t.overallVelocityX=d.x,t.overallVelocityY=d.y,t.overallVelocity=u(d.x)>u(d.y)?d.x:d.y,t.scale=a?function(e,t){return re(t[0],t[1],J)/re(e[0],e[1],J)}(a.pointers,i):1,t.rotation=a?function(e,t){return oe(t[1],t[0],J)+oe(e[1],e[0],J)}(a.pointers,i):0,t.maxPointers=n.prevInput?t.pointers.length>n.prevInput.maxPointers?t.pointers.length:n.prevInput.maxPointers:t.pointers.length,function(e,t){var n,i,o,s,a=e.lastInterval||t,l=t.timeStamp-a.timeStamp;if(t.eventType!=H&&(l>F||a.velocity===r)){var c=t.deltaX-a.deltaX,h=t.deltaY-a.deltaY,d=ne(l,c,h);i=d.x,o=d.y,n=u(d.x)>u(d.y)?d.x:d.y,s=ie(c,h),e.lastInterval=t}else n=a.velocity,i=a.velocityX,o=a.velocityY,s=a.direction;t.velocity=n,t.velocityX=i,t.velocityY=o,t.direction=s}(n,t);var f=e.element;M(t.srcEvent.target,f)&&(f=t.srcEvent.target);t.target=f}(e,n),e.emit("hammer.input",n),e.recognize(n),e.session.prevInput=n}function ee(e){for(var t=[],n=0;n<e.pointers.length;)t[n]={clientX:c(e.pointers[n].clientX),clientY:c(e.pointers[n].clientY)},n++;return{timeStamp:h(),pointers:t,center:te(t),deltaX:e.deltaX,deltaY:e.deltaY}}function te(e){var t=e.length;if(1===t)return{x:c(e[0].clientX),y:c(e[0].clientY)};for(var n=0,i=0,r=0;r<t;)n+=e[r].clientX,i+=e[r].clientY,r++;return{x:c(n/t),y:c(i/t)}}function ne(e,t,n){return{x:t/e||0,y:n/e||0}}function ie(e,t){return e===t?B:u(e)>=u(t)?e<0?V:$:t<0?W:U}function re(e,t,n){n||(n=G);var i=t[n[0]]-e[n[0]],r=t[n[1]]-e[n[1]];return Math.sqrt(i*i+r*r)}function oe(e,t,n){n||(n=G);var i=t[n[0]]-e[n[0]],r=t[n[1]]-e[n[1]];return 180*Math.atan2(r,i)/Math.PI}Z.prototype={handler:function(){},init:function(){this.evEl&&q(this.element,this.evEl,this.domHandler),this.evTarget&&q(this.target,this.evTarget,this.domHandler),this.evWin&&q(I(this.element),this.evWin,this.domHandler)},destroy:function(){this.evEl&&S(this.element,this.evEl,this.domHandler),this.evTarget&&S(this.target,this.evTarget,this.domHandler),this.evWin&&S(I(this.element),this.evWin,this.domHandler)}};var se={mousedown:z,mousemove:2,mouseup:j},ae="mousedown",le="mousemove mouseup";function ce(){this.evEl=ae,this.evWin=le,this.pressed=!1,Z.apply(this,arguments)}v(ce,Z,{handler:function(e){var t=se[e.type];t&z&&0===e.button&&(this.pressed=!0),2&t&&1!==e.which&&(t=j),this.pressed&&(t&j&&(this.pressed=!1),this.callback(this.manager,t,{pointers:[e],changedPointers:[e],pointerType:L,srcEvent:e}))}});var ue={pointerdown:z,pointermove:2,pointerup:j,pointercancel:H,pointerout:H},he={2:P,3:"pen",4:L,5:"kinect"},de="pointerdown",fe="pointermove pointerup pointercancel";function pe(){this.evEl=de,this.evWin=fe,Z.apply(this,arguments),this.store=this.manager.session.pointerEvents=[]}t.MSPointerEvent&&!t.PointerEvent&&(de="MSPointerDown",fe="MSPointerMove MSPointerUp MSPointerCancel"),v(pe,Z,{handler:function(e){var t=this.store,n=!1,i=e.type.toLowerCase().replace("ms",""),r=ue[i],o=he[e.pointerType]||e.pointerType,s=o==P,a=C(t,e.pointerId,"pointerId");r&z&&(0===e.button||s)?a<0&&(t.push(e),a=t.length-1):r&(j|H)&&(n=!0),a<0||(t[a]=e,this.callback(this.manager,r,{pointers:t,changedPointers:[e],pointerType:o,srcEvent:e}),n&&t.splice(a,1))}});var me={touchstart:z,touchmove:2,touchend:j,touchcancel:H};function ge(){this.evTarget="touchstart",this.evWin="touchstart touchmove touchend touchcancel",this.started=!1,Z.apply(this,arguments)}function ye(e,t){var n=k(e.touches),i=k(e.changedTouches);return t&(j|H)&&(n=E(n.concat(i),"identifier",!0)),[n,i]}v(ge,Z,{handler:function(e){var t=me[e.type];if(t===z&&(this.started=!0),this.started){var n=ye.call(this,e,t);t&(j|H)&&n[0].length-n[1].length==0&&(this.started=!1),this.callback(this.manager,t,{pointers:n[0],changedPointers:n[1],pointerType:P,srcEvent:e})}}});var ve={touchstart:z,touchmove:2,touchend:j,touchcancel:H},be="touchstart touchmove touchend touchcancel";function xe(){this.evTarget=be,this.targetIds={},Z.apply(this,arguments)}function we(e,t){var n=k(e.touches),i=this.targetIds;if(t&(2|z)&&1===n.length)return i[n[0].identifier]=!0,[n,n];var r,o,s=k(e.changedTouches),a=[],l=this.target;if(o=n.filter((function(e){return M(e.target,l)})),t===z)for(r=0;r<o.length;)i[o[r].identifier]=!0,r++;for(r=0;r<s.length;)i[s[r].identifier]&&a.push(s[r]),t&(j|H)&&delete i[s[r].identifier],r++;return a.length?[E(o.concat(a),"identifier",!0),a]:void 0}v(xe,Z,{handler:function(e){var t=ve[e.type],n=we.call(this,e,t);n&&this.callback(this.manager,t,{pointers:n[0],changedPointers:n[1],pointerType:P,srcEvent:e})}});var qe=2500;function Se(){Z.apply(this,arguments);var e=b(this.handler,this);this.touch=new xe(this.manager,e),this.mouse=new ce(this.manager,e),this.primaryTouch=null,this.lastTouches=[]}function Me(e,t){e&z?(this.primaryTouch=t.changedPointers[0].identifier,De.call(this,t)):e&(j|H)&&De.call(this,t)}function De(e){var t=e.changedPointers[0];if(t.identifier===this.primaryTouch){var n={x:t.clientX,y:t.clientY};this.lastTouches.push(n);var i=this.lastTouches;setTimeout((function(){var e=i.indexOf(n);e>-1&&i.splice(e,1)}),qe)}}function _e(e){for(var t=e.srcEvent.clientX,n=e.srcEvent.clientY,i=0;i<this.lastTouches.length;i++){var r=this.lastTouches[i],o=Math.abs(t-r.x),s=Math.abs(n-r.y);if(o<=25&&s<=25)return!0}return!1}v(Se,Z,{handler:function(e,t,n){var i=n.pointerType==P,r=n.pointerType==L;if(!(r&&n.sourceCapabilities&&n.sourceCapabilities.firesTouchEvents)){if(i)Me.call(this,t,n);else if(r&&_e.call(this,n))return;this.callback(e,t,n)}},destroy:function(){this.touch.destroy(),this.mouse.destroy()}});var Ce=A(a.style,"touchAction"),ke=Ce!==r,Ee="compute",Ae="auto",Te="manipulation",Ie="none",Re="pan-x",Oe="pan-y",Ne=function(){if(!ke)return!1;var e={},n=t.CSS&&t.CSS.supports;return["auto","manipulation","pan-y","pan-x","pan-x pan-y","none"].forEach((function(i){e[i]=!n||t.CSS.supports("touch-action",i)})),e}();function Pe(e,t){this.manager=e,this.set(t)}Pe.prototype={set:function(e){e==Ee&&(e=this.compute()),ke&&this.manager.element.style&&Ne[e]&&(this.manager.element.style[Ce]=e),this.actions=e.toLowerCase().trim()},update:function(){this.set(this.manager.options.touchAction)},compute:function(){var e=[];return p(this.manager.recognizers,(function(t){x(t.options.enable,[t])&&(e=e.concat(t.getTouchAction()))})),function(e){if(D(e,Ie))return Ie;var t=D(e,Re),n=D(e,Oe);if(t&&n)return Ie;if(t||n)return t?Re:Oe;if(D(e,Te))return Te;return Ae}(e.join(" "))},preventDefaults:function(e){var t=e.srcEvent,n=e.offsetDirection;if(this.manager.session.prevented)t.preventDefault();else{var i=this.actions,r=D(i,Ie)&&!Ne[Ie],o=D(i,Oe)&&!Ne[Oe],s=D(i,Re)&&!Ne[Re];if(r){var a=1===e.pointers.length,l=e.distance<2,c=e.deltaTime<250;if(a&&l&&c)return}if(!s||!o)return r||o&&n&Y||s&&n&X?this.preventSrc(t):void 0}},preventSrc:function(e){this.manager.session.prevented=!0,e.preventDefault()}};var Le=1,Fe=32;function ze(e){this.options=o({},this.defaults,e||{}),this.id=T++,this.manager=null,this.options.enable=w(this.options.enable,!0),this.state=Le,this.simultaneous={},this.requireFail=[]}function je(e){return 16&e?"cancel":8&e?"end":4&e?"move":2&e?"start":""}function He(e){return e==U?"down":e==W?"up":e==V?"left":e==$?"right":""}function Be(e,t){var n=t.manager;return n?n.get(e):e}function Ve(){ze.apply(this,arguments)}function $e(){Ve.apply(this,arguments),this.pX=null,this.pY=null}function We(){Ve.apply(this,arguments)}function Ue(){ze.apply(this,arguments),this._timer=null,this._input=null}function Ye(){Ve.apply(this,arguments)}function Xe(){Ve.apply(this,arguments)}function Ke(){ze.apply(this,arguments),this.pTime=!1,this.pCenter=!1,this._timer=null,this._input=null,this.count=0}function Ge(e,t){return(t=t||{}).recognizers=w(t.recognizers,Ge.defaults.preset),new Je(e,t)}ze.prototype={defaults:{},set:function(e){return o(this.options,e),this.manager&&this.manager.touchAction.update(),this},recognizeWith:function(e){if(f(e,"recognizeWith",this))return this;var t=this.simultaneous;return t[(e=Be(e,this)).id]||(t[e.id]=e,e.recognizeWith(this)),this},dropRecognizeWith:function(e){return f(e,"dropRecognizeWith",this)||(e=Be(e,this),delete this.simultaneous[e.id]),this},requireFailure:function(e){if(f(e,"requireFailure",this))return this;var t=this.requireFail;return-1===C(t,e=Be(e,this))&&(t.push(e),e.requireFailure(this)),this},dropRequireFailure:function(e){if(f(e,"dropRequireFailure",this))return this;e=Be(e,this);var t=C(this.requireFail,e);return t>-1&&this.requireFail.splice(t,1),this},hasRequireFailures:function(){return this.requireFail.length>0},canRecognizeWith:function(e){return!!this.simultaneous[e.id]},emit:function(e){var t=this,n=this.state;function i(n){t.manager.emit(n,e)}n<8&&i(t.options.event+je(n)),i(t.options.event),e.additionalEvent&&i(e.additionalEvent),n>=8&&i(t.options.event+je(n))},tryEmit:function(e){if(this.canEmit())return this.emit(e);this.state=Fe},canEmit:function(){for(var e=0;e<this.requireFail.length;){if(!(this.requireFail[e].state&(Fe|Le)))return!1;e++}return!0},recognize:function(e){var t=o({},e);if(!x(this.options.enable,[this,t]))return this.reset(),void(this.state=Fe);56&this.state&&(this.state=Le),this.state=this.process(t),30&this.state&&this.tryEmit(t)},process:function(e){},getTouchAction:function(){},reset:function(){}},v(Ve,ze,{defaults:{pointers:1},attrTest:function(e){var t=this.options.pointers;return 0===t||e.pointers.length===t},process:function(e){var t=this.state,n=e.eventType,i=6&t,r=this.attrTest(e);return i&&(n&H||!r)?16|t:i||r?n&j?8|t:2&t?4|t:2:Fe}}),v($e,Ve,{defaults:{event:"pan",threshold:10,pointers:1,direction:K},getTouchAction:function(){var e=this.options.direction,t=[];return e&Y&&t.push(Oe),e&X&&t.push(Re),t},directionTest:function(e){var t=this.options,n=!0,i=e.distance,r=e.direction,o=e.deltaX,s=e.deltaY;return r&t.direction||(t.direction&Y?(r=0===o?B:o<0?V:$,n=o!=this.pX,i=Math.abs(e.deltaX)):(r=0===s?B:s<0?W:U,n=s!=this.pY,i=Math.abs(e.deltaY))),e.direction=r,n&&i>t.threshold&&r&t.direction},attrTest:function(e){return Ve.prototype.attrTest.call(this,e)&&(2&this.state||!(2&this.state)&&this.directionTest(e))},emit:function(e){this.pX=e.deltaX,this.pY=e.deltaY;var t=He(e.direction);t&&(e.additionalEvent=this.options.event+t),this._super.emit.call(this,e)}}),v(We,Ve,{defaults:{event:"pinch",threshold:0,pointers:2},getTouchAction:function(){return[Ie]},attrTest:function(e){return this._super.attrTest.call(this,e)&&(Math.abs(e.scale-1)>this.options.threshold||2&this.state)},emit:function(e){if(1!==e.scale){var t=e.scale<1?"in":"out";e.additionalEvent=this.options.event+t}this._super.emit.call(this,e)}}),v(Ue,ze,{defaults:{event:"press",pointers:1,time:251,threshold:9},getTouchAction:function(){return[Ae]},process:function(e){var t=this.options,n=e.pointers.length===t.pointers,i=e.distance<t.threshold,r=e.deltaTime>t.time;if(this._input=e,!i||!n||e.eventType&(j|H)&&!r)this.reset();else if(e.eventType&z)this.reset(),this._timer=d((function(){this.state=8,this.tryEmit()}),t.time,this);else if(e.eventType&j)return 8;return Fe},reset:function(){clearTimeout(this._timer)},emit:function(e){8===this.state&&(e&&e.eventType&j?this.manager.emit(this.options.event+"up",e):(this._input.timeStamp=h(),this.manager.emit(this.options.event,this._input)))}}),v(Ye,Ve,{defaults:{event:"rotate",threshold:0,pointers:2},getTouchAction:function(){return[Ie]},attrTest:function(e){return this._super.attrTest.call(this,e)&&(Math.abs(e.rotation)>this.options.threshold||2&this.state)}}),v(Xe,Ve,{defaults:{event:"swipe",threshold:10,velocity:.3,direction:Y|X,pointers:1},getTouchAction:function(){return $e.prototype.getTouchAction.call(this)},attrTest:function(e){var t,n=this.options.direction;return n&(Y|X)?t=e.overallVelocity:n&Y?t=e.overallVelocityX:n&X&&(t=e.overallVelocityY),this._super.attrTest.call(this,e)&&n&e.offsetDirection&&e.distance>this.options.threshold&&e.maxPointers==this.options.pointers&&u(t)>this.options.velocity&&e.eventType&j},emit:function(e){var t=He(e.offsetDirection);t&&this.manager.emit(this.options.event+t,e),this.manager.emit(this.options.event,e)}}),v(Ke,ze,{defaults:{event:"tap",pointers:1,taps:1,interval:300,time:250,threshold:9,posThreshold:10},getTouchAction:function(){return[Te]},process:function(e){var t=this.options,n=e.pointers.length===t.pointers,i=e.distance<t.threshold,r=e.deltaTime<t.time;if(this.reset(),e.eventType&z&&0===this.count)return this.failTimeout();if(i&&r&&n){if(e.eventType!=j)return this.failTimeout();var o=!this.pTime||e.timeStamp-this.pTime<t.interval,s=!this.pCenter||re(this.pCenter,e.center)<t.posThreshold;if(this.pTime=e.timeStamp,this.pCenter=e.center,s&&o?this.count+=1:this.count=1,this._input=e,0===this.count%t.taps)return this.hasRequireFailures()?(this._timer=d((function(){this.state=8,this.tryEmit()}),t.interval,this),2):8}return Fe},failTimeout:function(){return this._timer=d((function(){this.state=Fe}),this.options.interval,this),Fe},reset:function(){clearTimeout(this._timer)},emit:function(){8==this.state&&(this._input.tapCount=this.count,this.manager.emit(this.options.event,this._input))}}),Ge.VERSION="2.0.7",Ge.defaults={domEvents:!1,touchAction:Ee,enable:!0,inputTarget:null,inputClass:null,preset:[[Ye,{enable:!1}],[We,{enable:!1},["rotate"]],[Xe,{direction:Y}],[$e,{direction:Y},["swipe"]],[Ke],[Ke,{event:"doubletap",taps:2},["tap"]],[Ue]],cssProps:{userSelect:"none",touchSelect:"none",touchCallout:"none",contentZooming:"none",userDrag:"none",tapHighlightColor:"rgba(0,0,0,0)"}};function Je(e,t){var n;this.options=o({},Ge.defaults,t||{}),this.options.inputTarget=this.options.inputTarget||e,this.handlers={},this.session={},this.recognizers=[],this.oldCssProps={},this.element=e,this.input=new((n=this).options.inputClass||(O?pe:N?xe:R?Se:ce))(n,Q),this.touchAction=new Pe(this,this.options.touchAction),Ze(this,!0),p(this.options.recognizers,(function(e){var t=this.add(new e[0](e[1]));e[2]&&t.recognizeWith(e[2]),e[3]&&t.requireFailure(e[3])}),this)}function Ze(e,t){var n,i=e.element;i.style&&(p(e.options.cssProps,(function(r,o){n=A(i.style,o),t?(e.oldCssProps[n]=i.style[n],i.style[n]=r):i.style[n]=e.oldCssProps[n]||""})),t||(e.oldCssProps={}))}Je.prototype={set:function(e){return o(this.options,e),e.touchAction&&this.touchAction.update(),e.inputTarget&&(this.input.destroy(),this.input.target=e.inputTarget,this.input.init()),this},stop:function(e){this.session.stopped=e?2:1},recognize:function(e){var t=this.session;if(!t.stopped){var n;this.touchAction.preventDefaults(e);var i=this.recognizers,r=t.curRecognizer;(!r||r&&8&r.state)&&(r=t.curRecognizer=null);for(var o=0;o<i.length;)n=i[o],2===t.stopped||r&&n!=r&&!n.canRecognizeWith(r)?n.reset():n.recognize(e),!r&&14&n.state&&(r=t.curRecognizer=n),o++}},get:function(e){if(e instanceof ze)return e;for(var t=this.recognizers,n=0;n<t.length;n++)if(t[n].options.event==e)return t[n];return null},add:function(e){if(f(e,"add",this))return this;var t=this.get(e.options.event);return t&&this.remove(t),this.recognizers.push(e),e.manager=this,this.touchAction.update(),e},remove:function(e){if(f(e,"remove",this))return this;if(e=this.get(e)){var t=this.recognizers,n=C(t,e);-1!==n&&(t.splice(n,1),this.touchAction.update())}return this},on:function(e,t){if(e!==r&&t!==r){var n=this.handlers;return p(_(e),(function(e){n[e]=n[e]||[],n[e].push(t)})),this}},off:function(e,t){if(e!==r){var n=this.handlers;return p(_(e),(function(e){t?n[e]&&n[e].splice(C(n[e],t),1):delete n[e]})),this}},emit:function(e,t){this.options.domEvents&&function(e,t){var i=n.createEvent("Event");i.initEvent(e,!0,!0),i.gesture=t,t.target.dispatchEvent(i)}(e,t);var i=this.handlers[e]&&this.handlers[e].slice();if(i&&i.length){t.type=e,t.preventDefault=function(){t.srcEvent.preventDefault()};for(var r=0;r<i.length;)i[r](t),r++}},destroy:function(){this.element&&Ze(this,!1),this.handlers={},this.session={},this.input.destroy(),this.element=null}},o(Ge,{INPUT_START:z,INPUT_MOVE:2,INPUT_END:j,INPUT_CANCEL:H,STATE_POSSIBLE:Le,STATE_BEGAN:2,STATE_CHANGED:4,STATE_ENDED:8,STATE_RECOGNIZED:8,STATE_CANCELLED:16,STATE_FAILED:Fe,DIRECTION_NONE:B,DIRECTION_LEFT:V,DIRECTION_RIGHT:$,DIRECTION_UP:W,DIRECTION_DOWN:U,DIRECTION_HORIZONTAL:Y,DIRECTION_VERTICAL:X,DIRECTION_ALL:K,Manager:Je,Input:Z,TouchAction:Pe,TouchInput:xe,MouseInput:ce,PointerEventInput:pe,TouchMouseInput:Se,SingleTouchInput:ge,Recognizer:ze,AttrRecognizer:Ve,Tap:Ke,Pan:$e,Swipe:Xe,Pinch:We,Rotate:Ye,Press:Ue,on:q,off:S,each:p,merge:y,extend:g,assign:o,inherit:v,bindFn:b,prefixed:A}),(void 0!==t?t:"undefined"!=typeof self?self:{}).Hammer=Ge,"function"==typeof r&&r.amd?r((function(){return Ge})):e.exports?e.exports=Ge:t.Hammer=Ge}(window,document)}(kg);var Eg=n(kg.exports);function Ag(e){e.component("event-area",{mounted(e){e.classList.add("event-area"),e.style.pointerEvents="auto",e.style.zIndex=1},render:()=>[]})}var Tg={renderer:"dom",disableTriggers:!0,preferredSize:function(){return 22},render(e){const{settings:{label:t,rtl:n},layout:{dock:i}}=this.settings,r="top"!==i&&"bottom"!==i||!n?"ltr":"rtl",o=function(e,t){const n={pointerEvents:"auto",display:"flex",justifyContent:"center",alignItems:"center",color:"#7b7a78",fontStyle:"italic",fontSize:"13px"};switch(e){case"left":n.width=`${t.height}px`,n.transform=`rotate(-90deg) translate(-${t.height}px, 0)`,n.transformOrigin="top left";break;case"right":n.width=`${t.height}px`,n.transform=`rotate(90deg) translate(0, -${t.width}px)`,n.transformOrigin="top left";break;case"center":n.width=`${t.width}px`,n.height=`${t.height}px`,n.color="#595959",n.fontStyle="normal",n.fontSize="1.2em",n.textAlign="center";break;default:n.justifyContent="flex-start",n.alignItems="flex-start"}return n}(i,this.rect),s="center"===i?t:`* ${t}`,a="center"!==i?{overflow:"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis"}:{};return e("div",{style:o,dir:r},e("span",{ref:this.alignToRef,style:a,title:s},s))}};function Ig(e){const t=Fp();return t.renderer.prio([e||"canvas"]),t.use(Mg),t.use(function(e){if("function"!=typeof e.interaction)return t=>{t.interaction("hammer",Cg(e))};e.interaction("hammer",Cg(Hammer))}(Eg)),t.use(Ag),t.component("disclaimer",Tg),t}const Rg={shapes:[{type:"path",attrs:{d:"M15.9488039,5.20769129 C16.0487326,6.70662306 15.3492311,8.30548361 14.050157,9.30477145 C12.651154,10.5039169 10.8524359,10.8037032 8.85386017,10.4039881 L7.3549284,10.0042729 L5.75606786,9.70448659 C5.75606786,9.90434416 5.65613907,10.0042729 5.4562815,10.2041305 C5.05656637,10.6038456 4.55692244,10.8037032 4.05727852,10.8037032 C3.75749217,10.8037032 3.45770582,10.7037744 3.15791946,10.6038456 C3.05799068,10.903632 3.15791946,11.2034184 3.45770582,11.7030623 C5.05656637,14.0014243 3.85742095,15.9000712 3.75749217,16 L2.2585604,15.3004985 C2.2585604,15.2005697 2.95806189,14.0014243 1.95877405,12.6024213 C1.6589877,12.0028486 1.15934378,11.0035608 1.55905891,10.0042729 C1.6589877,9.80441537 1.75891648,9.6045578 1.95877405,9.40470024 C1.6589877,8.90505631 1.55905891,8.30548361 1.85884527,7.7059109 C1.55905891,7.40612455 1.25927256,7.1063382 1.15934378,6.70662306 C0.859557424,5.90719279 0.959486209,4.5081898 1.6589877,3.30904439 C1.95877405,2.6095429 2.55834676,2.0099702 3.15791946,1.51032628 C3.95734974,0.91075357 4.95663758,0.610967217 6.15578299,0.311180864 C9.05371774,-0.388320626 11.9516525,0.111323295 13.9502282,1.61025506 C15.1493736,2.50961412 15.8488751,3.80868831 15.9488039,5.20769129 Z M13.0508691,8.10562604 C13.8502994,7.40612455 14.3499433,6.40683671 14.3499433,5.30762008 C14.2500145,4.20840345 13.550513,3.40897318 12.9509403,2.90932926 C12.1515101,2.40968533 11.252151,2.0099702 10.1529344,1.81011263 C8.95378895,1.61025506 7.75464354,1.71018384 6.45556935,1.91004141 C4.75678001,2.30975655 3.65756338,3.00925804 3.05799068,4.10847467 C2.55834676,5.00783373 2.65827554,5.90719279 2.75820433,6.20697914 C2.75820433,6.30690792 2.85813311,6.40683671 3.05799068,6.40683671 C3.15791946,6.40683671 3.25784825,6.40683671 3.35777703,6.40683671 C3.45770582,6.40683671 3.45770582,6.40683671 3.45770582,6.40683671 L3.5576346,6.40683671 L3.65756338,6.40683671 C4.65685123,6.40683671 5.4562815,6.90648063 5.85599664,7.80583969 L5.85599664,8.00569726 C6.35564056,8.10562604 7.05514205,8.30548361 7.75464354,8.50534118 L9.25357531,8.90505631 C10.0530056,9.0049851 10.7525071,9.0049851 11.4520086,8.80512753 C12.0515813,8.70519875 12.5512252,8.40541239 13.0508691,8.10562604 Z"}}]};function Og(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,i)}return n}function Ng(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Og(Object(n),!0).forEach((function(t){Lg(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Og(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function Pg(e){return Pg="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},Pg(e)}function Lg(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 i=n.call(e,"string");if("object"!=typeof i)return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Fg(e){return function(e){if(Array.isArray(e))return zg(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(e){if("string"==typeof e)return zg(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)?zg(e,t):void 0}}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function zg(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,i=new Array(t);n<t;n++)i[n]=e[n];return i}var jg=Object.prototype.hasOwnProperty,Hg=Object.prototype.toString,Bg=Object.defineProperty,Vg=Object.getOwnPropertyDescriptor,$g=function(e){return"function"==typeof Array.isArray?Array.isArray(e):"[object Array]"===Hg.call(e)},Wg=function(e){if(!e||"[object Object]"!==Hg.call(e))return!1;var t,n=jg.call(e,"constructor"),i=e.constructor&&e.constructor.prototype&&jg.call(e.constructor.prototype,"isPrototypeOf");if(e.constructor&&!n&&!i)return!1;for(t in e);return void 0===t||jg.call(e,t)},Ug=function(e,t){Bg&&"__proto__"===t.name?Bg(e,t.name,{enumerable:!0,configurable:!0,value:t.newValue,writable:!0}):e[t.name]=t.newValue},Yg=function(e,t){if("__proto__"===t){if(!jg.call(e,t))return;if(Vg)return Vg(e,t).value}return e[t]},Xg=function(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}((function e(){var t,n,i,r,o,s,a=arguments[0],l=1,c=arguments.length,u=!1;for("boolean"==typeof a&&(u=a,a=arguments[1]||{},l=2),(null==a||"object"!=typeof a&&"function"!=typeof a)&&(a={});l<c;++l)if(null!=(t=arguments[l]))for(n in t)i=Yg(a,n),a!==(r=Yg(t,n))&&(u&&r&&(Wg(r)||(o=$g(r)))?(o?(o=!1,s=i&&$g(i)?i:[]):s=i&&Wg(i)?i:{},Ug(a,{name:n,newValue:e(u,s,r)})):void 0!==r&&Ug(a,{name:n,newValue:r}));return a}));function Kg(e,t){return{range:function(e){var n=e.resources,i=e.data,r=n.theme.palette("categorical",0===t?i.items.length:t);return i.items.map((function(e){return r[e.value%r.length]}))},valueAccessor:e.value}}function Gg(e,t){return{range:function(e){var n=e.resources,i=e.data,r=n.theme.palette("categorical",0===t?i.items.length:t);return i.items.map((function(e){return r[e.row.value%r.length]}))},valueAccessor:e.value}}function Jg(e,t,n,i,r){var o,s,a=r.byRow,l=r.byElemNo;if(i&&(t.input.persistent||e.hc.qDimensionInfo.length>1||void 0===n.activeDimensionIndex&&e.hc.qSize.qcy>((null===(s=(o=e.hc).qDataPages[0]||o.qStackedDataPages[0])||void 0===s?void 0:s.qArea.qHeight)||0)))return l(i,i.raw().qCardinal);if(i){var c=t.pic.extract({field:i.key(),trackBy:i.value}).length;return a(i,c)}return{}}function Zg(e,t){var n=e.hc.qDimensionInfo,i=t.input.byDimDef||{activeDimensionIndex:n.length-1};if(i.activeDimensionIndex>=0){var r=n[i.activeDimensionIndex];i=r.coloring&&r.coloring.colorMapRef?{type:"libraryItem",key:r.coloring.colorMapRef,activeDimensionIndex:i.activeDimensionIndex}:{activeDimensionIndex:i.activeDimensionIndex}}return i}function Qg(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 ey(e,t,n){e.prototype=t.prototype=n,n.constructor=e}function ty(e,t){var n=Object.create(e.prototype);for(var i in t)n[i]=t[i];return n}function ny(){}var iy=1/.7,ry="\\s*([+-]?\\d+)\\s*",oy="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",sy="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",ay=/^#([0-9a-f]{3,8})$/,ly=new RegExp(`^rgb\\(${ry},${ry},${ry}\\)$`),cy=new RegExp(`^rgb\\(${sy},${sy},${sy}\\)$`),uy=new RegExp(`^rgba\\(${ry},${ry},${ry},${oy}\\)$`),hy=new RegExp(`^rgba\\(${sy},${sy},${sy},${oy}\\)$`),dy=new RegExp(`^hsl\\(${oy},${sy},${sy}\\)$`),fy=new RegExp(`^hsla\\(${oy},${sy},${sy},${oy}\\)$`),py={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 my(){return this.rgb().formatHex()}function gy(){return this.rgb().formatRgb()}function yy(e){var t,n;return e=(e+"").trim().toLowerCase(),(t=ay.exec(e))?(n=t[1].length,t=parseInt(t[1],16),6===n?vy(t):3===n?new qy(t>>8&15|t>>4&240,t>>4&15|240&t,(15&t)<<4|15&t,1):8===n?by(t>>24&255,t>>16&255,t>>8&255,(255&t)/255):4===n?by(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=ly.exec(e))?new qy(t[1],t[2],t[3],1):(t=cy.exec(e))?new qy(255*t[1]/100,255*t[2]/100,255*t[3]/100,1):(t=uy.exec(e))?by(t[1],t[2],t[3],t[4]):(t=hy.exec(e))?by(255*t[1]/100,255*t[2]/100,255*t[3]/100,t[4]):(t=dy.exec(e))?ky(t[1],t[2]/100,t[3]/100,1):(t=fy.exec(e))?ky(t[1],t[2]/100,t[3]/100,t[4]):py.hasOwnProperty(e)?vy(py[e]):"transparent"===e?new qy(NaN,NaN,NaN,0):null}function vy(e){return new qy(e>>16&255,e>>8&255,255&e,1)}function by(e,t,n,i){return i<=0&&(e=t=n=NaN),new qy(e,t,n,i)}function xy(e){return e instanceof ny||(e=yy(e)),e?new qy((e=e.rgb()).r,e.g,e.b,e.opacity):new qy}function wy(e,t,n,i){return 1===arguments.length?xy(e):new qy(e,t,n,null==i?1:i)}function qy(e,t,n,i){this.r=+e,this.g=+t,this.b=+n,this.opacity=+i}function Sy(){return`#${Cy(this.r)}${Cy(this.g)}${Cy(this.b)}`}function My(){const e=Dy(this.opacity);return`${1===e?"rgb(":"rgba("}${_y(this.r)}, ${_y(this.g)}, ${_y(this.b)}${1===e?")":`, ${e})`}`}function Dy(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function _y(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function Cy(e){return((e=_y(e))<16?"0":"")+e.toString(16)}function ky(e,t,n,i){return i<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new Ay(e,t,n,i)}function Ey(e){if(e instanceof Ay)return new Ay(e.h,e.s,e.l,e.opacity);if(e instanceof ny||(e=yy(e)),!e)return new Ay;if(e instanceof Ay)return e;var t=(e=e.rgb()).r/255,n=e.g/255,i=e.b/255,r=Math.min(t,n,i),o=Math.max(t,n,i),s=NaN,a=o-r,l=(o+r)/2;return a?(s=t===o?(n-i)/a+6*(n<i):n===o?(i-t)/a+2:(t-n)/a+4,a/=l<.5?o+r:2-o-r,s*=60):a=l>0&&l<1?0:s,new Ay(s,a,l,e.opacity)}function Ay(e,t,n,i){this.h=+e,this.s=+t,this.l=+n,this.opacity=+i}function Ty(e){return(e=(e||0)%360)<0?e+360:e}function Iy(e){return Math.max(0,Math.min(1,e||0))}function Ry(e,t,n){return 255*(e<60?t+(n-t)*e/60:e<180?n:e<240?t+(n-t)*(240-e)/60:t)}ey(ny,yy,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:my,formatHex:my,formatHex8:function(){return this.rgb().formatHex8()},formatHsl:function(){return Ey(this).formatHsl()},formatRgb:gy,toString:gy}),ey(qy,wy,ty(ny,{brighter(e){return e=null==e?iy:Math.pow(iy,e),new qy(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=null==e?.7:Math.pow(.7,e),new qy(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new qy(_y(this.r),_y(this.g),_y(this.b),Dy(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:Sy,formatHex:Sy,formatHex8:function(){return`#${Cy(this.r)}${Cy(this.g)}${Cy(this.b)}${Cy(255*(isNaN(this.opacity)?1:this.opacity))}`},formatRgb:My,toString:My})),ey(Ay,(function(e,t,n,i){return 1===arguments.length?Ey(e):new Ay(e,t,n,null==i?1:i)}),ty(ny,{brighter(e){return e=null==e?iy:Math.pow(iy,e),new Ay(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=null==e?.7:Math.pow(.7,e),new Ay(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=this.h%360+360*(this.h<0),t=isNaN(e)||isNaN(this.s)?0:this.s,n=this.l,i=n+(n<.5?n:1-n)*t,r=2*n-i;return new qy(Ry(e>=240?e-240:e+120,r,i),Ry(e,r,i),Ry(e<120?e+240:e-120,r,i),this.opacity)},clamp(){return new Ay(Ty(this.h),Iy(this.s),Iy(this.l),Dy(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=Dy(this.opacity);return`${1===e?"hsl(":"hsla("}${Ty(this.h)}, ${100*Iy(this.s)}%, ${100*Iy(this.l)}%${1===e?")":`, ${e})`}`}}));const Oy=Math.PI/180,Ny=180/Math.PI,Py=4/29,Ly=6/29,Fy=3*Ly*Ly;function zy(e){if(e instanceof jy)return new jy(e.l,e.a,e.b,e.opacity);if(e instanceof Wy)return Uy(e);e instanceof qy||(e=xy(e));var t,n,i=$y(e.r),r=$y(e.g),o=$y(e.b),s=Hy((.2225045*i+.7168786*r+.0606169*o)/1);return i===r&&r===o?t=n=s:(t=Hy((.4360747*i+.3850649*r+.1430804*o)/.96422),n=Hy((.0139322*i+.0971045*r+.7141733*o)/.82521)),new jy(116*s-16,500*(t-s),200*(s-n),e.opacity)}function jy(e,t,n,i){this.l=+e,this.a=+t,this.b=+n,this.opacity=+i}function Hy(e){return e>.008856451679035631?Math.pow(e,1/3):e/Fy+Py}function By(e){return e>Ly?e*e*e:Fy*(e-Py)}function Vy(e){return 255*(e<=.0031308?12.92*e:1.055*Math.pow(e,1/2.4)-.055)}function $y(e){return(e/=255)<=.04045?e/12.92:Math.pow((e+.055)/1.055,2.4)}function Wy(e,t,n,i){this.h=+e,this.c=+t,this.l=+n,this.opacity=+i}function Uy(e){if(isNaN(e.h))return new jy(e.l,0,0,e.opacity);var t=e.h*Oy;return new jy(e.l,Math.cos(t)*e.c,Math.sin(t)*e.c,e.opacity)}ey(jy,(function(e,t,n,i){return 1===arguments.length?zy(e):new jy(e,t,n,null==i?1:i)}),ty(ny,{brighter(e){return new jy(this.l+18*(null==e?1:e),this.a,this.b,this.opacity)},darker(e){return new jy(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 qy(Vy(3.1338561*(t=.96422*By(t))-1.6168667*(e=1*By(e))-.4906146*(n=.82521*By(n))),Vy(-.9787684*t+1.9161415*e+.033454*n),Vy(.0719453*t-.2289914*e+1.4052427*n),this.opacity)}})),ey(Wy,(function(e,t,n,i){return 1===arguments.length?function(e){if(e instanceof Wy)return new Wy(e.h,e.c,e.l,e.opacity);if(e instanceof jy||(e=zy(e)),0===e.a&&0===e.b)return new Wy(NaN,0<e.l&&e.l<100?0:NaN,e.l,e.opacity);var t=Math.atan2(e.b,e.a)*Ny;return new Wy(t<0?t+360:t,Math.sqrt(e.a*e.a+e.b*e.b),e.l,e.opacity)}(e):new Wy(e,t,n,null==i?1:i)}),ty(ny,{brighter(e){return new Wy(this.h,this.c,this.l+18*(null==e?1:e),this.opacity)},darker(e){return new Wy(this.h,this.c,this.l-18*(null==e?1:e),this.opacity)},rgb(){return Uy(this).rgb()}}));var Yy=e=>()=>e;function Xy(e,t){var n=t-e;return n?function(e,t){return function(n){return e+n*t}}(e,n):Yy(isNaN(e)?t:e)}var Ky=function e(t){var n=function(e){return 1==(e=+e)?Xy:function(t,n){return n-t?function(e,t,n){return e=Math.pow(e,n),t=Math.pow(t,n)-e,n=1/n,function(i){return Math.pow(e+i*t,n)}}(t,n,e):Yy(isNaN(t)?n:t)}}(t);function i(e,t){var i=n((e=wy(e)).r,(t=wy(t)).r),r=n(e.g,t.g),o=n(e.b,t.b),s=Xy(e.opacity,t.opacity);return function(t){return e.r=i(t),e.g=r(t),e.b=o(t),e.opacity=s(t),e+""}}return i.gamma=e,i}(1),Gy=/^class(-pyramid)?/,Jy=function(e,t,n,i){var r=void 0!==n.min?n.min:i.min(),o=void 0!==n.max?n.max:i.max(),s=r,a=o,l=t.limits,c={},u="percent"===t.limitType?l.map((function(e){return r+(o-r)*e})):l,h=t.colors.map((function(t){return e.resolveUIColor(t)}));if(r=Math.min.apply(Math,[r].concat(Fg(u))),o=Math.max.apply(Math,[o].concat(Fg(u))),c.min=r,c.max=o,t.breakTypes&&-1===t.breakTypes.indexOf(!0))c.type="categorical",Object.assign(c,function(e){var t=e.min,n=e.max,i=e.limits,r=e.range,o=[],s=[];if(i.length)if(i[i.length-1]<t)s.push(t,n),o.push(r[r.length-1],r[r.length-1],r[r.length-1]);else if(i[0]>n)s.push(t,n),o.push(r[0],r[0],r[0]);else{if(i[0]>t)s.push(t),o.push(r[0]);else{s.push(t);for(var a=0;a<i.length;a++)if(t<i[a]){o.push(r[a]);break}}for(var l=0;l<i.length;l++)t<i[l]&&i[l]<n&&(s.push(i[l]),o.push(r[l]));if(i[i.length-1]<n)s.push(n),o.push(r[i.length]),o.push(r[i.length]);else{s.push(n);for(var c=0;c<i.length;c++)if(i[c]>n){o.push(r[c]),o.push(r[c]);break}}}else o.push(r[0]);return{min:t,max:n,range:o,domain:s}}({min:"percent"===t.limitType?r:s,max:"percent"===t.limitType?o:a,range:h,limits:"percent"===t.limitType?u:l}));else if(t.breakTypes){var d=t.breakTypes;c.type="continuous",c.domain=[r],c.range=[h[0]];for(var f=0;f<u.length;f+=1)if(d[f]){var p=h[f],m=h[f+1],g=Ky(p,m)(.5);c.range.push(g),c.domain.push(u[f]),f<u.length-1&&d[f+1]&&(c.range.push(h[f+1]),c.domain.push((u[f]+u[f+1])/2))}else c.range.push(h[f]),c.range.push(h[f+1]),c.domain.push(u[f]),c.domain.push(u[f]+Math.min(1e-6,(o-r)/1e6));c.range.push(h[h.length-1]),c.domain.push(o)}else c.domain=u,c.range=h;return c};function Zy(e,t,n,i,r){var o,s,a,l=0,c=[],u=(e-t)/(i+1);if(0===u)return 1;for(o=0;o<n.length;o+=1)s=.99*(n[o]-t),a=n[o]>e?Math.floor(e/u):n[o]<t?0:Math.floor(s/u),Number.isNaN(a)||(c[a]?c[a]+=1:c[a]=1);for(o=0;o<c.length;o+=1)c[o]&&(l+=1);return l<=i||l>=r?Math.max(l,i):Zy(e,t,n,i+1,r)}var Qy=function(e,t,n,i){var r,o,s=t.theme,a=t.hc,l=i.f,c={mode:"field",fieldType:"measure",field:l?l.key():void 0,reverse:n.input.reverseScheme||!1,type:"continuous",range:function(e){return e.resources.theme.palette("quant")}},u=[],h=!0;if(l){if(Number.isNaN(+l.min())||Number.isNaN(+l.max()))return{invalid:!0};(h=!("S"===(r=n.pic.raw()).qMode&&(r.qDataPages[0]&&r.qSize.qcy>r.qDataPages[0].qArea.qHeight||!r.qDataPages.length&&r.qSize.qcy>0)||"K"===r.qMode&&r.qStackedDataPages[0]&&r.qSize.qcy>r.qStackedDataPages[0].qArea.qHeight||"T"===r.qMode&&r.qSize.qcy>r.qTreeDataPages[0].qGroupSize))&&(u=n.pic.extract({field:0,props:{num:{field:l.key()},exclude:{fields:a.qDimensionInfo.map((function(e,t){return{field:"qDimensionInfo/".concat(t)}})),value:function(e){return Math.min.apply(Math,Fg(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(c.min=n.input.measureMin,c.max=n.input.measureMax,c.max<c.min)return{invalid:!0}}else if(l&&!h)c.min=l.min(),c.max=l.max();else if(l){if(!u.length)return{invalid:!0};c.min=Math.min.apply(Math,Fg(u)),c.max=Math.max.apply(Math,Fg(u))}if(n.input.measureScheme&&(c.palettes={quant:n.input.measureScheme}),s){var d=s.getDataColorScales().filter((function(e){return e.key===n.input.measureScheme}))[0];c.type=d&&Gy.test(d.type)?"categorical":"continuous","categorical"===c.type&&(o=d.colors.some((function(e){return Array.isArray(e)}))?Math.max.apply(Math,Fg(d.colors.map((function(e){return e?e.length:0})))):d.colors.length)}if("categorical"===c.type){for(var f=h?Zy(c.max,c.min,u,1,o):o,p=(c.max-c.min)/f,m=[],g=0;g<f+1;g+=1)m.push(c.min+p*g);c.domain=m,c.range=function(e){for(var t=e.resources.theme.palette("quant",f),n=Math.max(1,Math.floor(t.length/f)),i=[],r=0;r<f;r+=1)i.push(t[r*n]);return[i[0]].concat(i,[i[i.length-1]])}}return c};function ev(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 tv(e){var t,n=e.cm,i=e.defaults,r=e.index,o=e.input,s=e.pic;if(!o||!o.on)return null;var a=null!==(t=o.mode)&&void 0!==t?t:"primary";return"primary"===a?function(e,t,n){var i=n.primary;return void 0!==t.paletteColor&&t.paletteColor&&(i=e.resolveUIColor(t.paletteColor)),Ng(Ng({},n),{},{mode:"constant",type:"constant",primary:i})}(n,o,i):"byExpression"===a?function(e,t,n){var i="qMeasureInfo/".concat(e,"/"),r=t.field((function(e){return e.id().startsWith(i)&&"colorByMeasureExpression"===e.raw().id})),o=r;return Ng(Ng({},n),{},o?{mode:"field",fieldType:"expression",field:r?r.key():void 0,type:"color"}:{mode:"constant",type:"constant",primary:n.nil})}(r,s,i):null}function nv(e){e.measureOverrides.every((function(e){return!e}))&&(e.measureOverrides=null)}function iv(e,t){for(var n=(null==t?void 0:t.domain)||[],i=(null==t?void 0:t.range)||[],r=[],o=0;o<e.length;++o){var s=e[o];if("constant"===(null==s?void 0:s.mode)){var a=n.indexOf(o);-1===a?(n.push(o),i.push(s.primary)):i[a]=s.primary,e[o]=null}else if(s){r.push(o);var l=n.indexOf(o);-1!==l&&(n.splice(l,1),i.splice(l,1))}}return{domain:n,range:i,exclude:r}}function rv(e,t,n,i){var r,o=function(e,t,n,i){if(t.input&&!t.input.auto){if("byMeasure"===t.input.mode)return function(e,t,n){var i=t.theme,r=t.hc,o=(arguments.length>3&&void 0!==arguments[3]?arguments[3]:{}).getCField,s=void 0===o?ev:o,a=n.input.byMeasureDef||{activeMeasureIndex:0},l=s(n,a),c=Qy(0,{theme:i,hc:r},n,{f:l});if(c.invalid)return c;"expression"===a.type&&(a.activeMeasureIndex<0||void 0===a.activeMeasureIndex)&&(c.label=a.label,l&&"color.altLabel"===l.raw().labelExpRef&&(c.label=n.input.altLabel)),!c.label&&l&&(c.label=l.title());var u=a.activeMeasureIndex>=0?l:null;if(!u&&l&&void 0!==l.raw().matchMeasure&&l.raw().matchMeasure>-1&&(u=n.pic.fields().filter((function(e){return"measure"===e.type()}))[l.raw().matchMeasure]),n.input.useMeasureGradient&&"libraryItem"===a.type)if(u){var h=u.raw().coloring;h&&h.gradient&&Xg(c,Jy(e,h.gradient,c,u))}else c.auxiliary=a;return c}(e,n,t);if("byDimension"===t.input.mode)return function(e,t,n){var i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},r=i.getCDef,o=void 0===r?Zg:r,s=i.getCByField,a=void 0===s?Qg:s,l=i.getPersistence,c=void 0===l?Jg:l,u=o(t,n),h=a(n,u),d=h?h.raw():{},f=n&&n.pic?n.pic.raw():{};if(d.qError||d.qSize&&0===d.qSize.qcy&&!f.qHasOtherValues)return{invalid:!0};var p={mode:"field",fieldType:"dimension",type:"categorical",field:h?h.key():void 0,isFieldLocked:d.qLocked};return("expression"===u.type||u.activeDimensionIndex<0)&&(p.label=u.label,"color.altLabel"===d.labelExpRef&&(p.label=n.input.altLabel)),!p.label&&h&&(p.label=h.title()),n.input.dimensionScheme&&(p.palettes={categorical:n.input.dimensionScheme}),n.input.useDimColVal&&"libraryItem"===u.type&&(p.auxiliary=u),Xg(p,c(t,n,u,h,{byRow:Gg,byElemNo:Kg})),p}(e,n,t);if("byExpression"===t.input.mode)return function(e,t,n,i){var r=t.hc,o=t.theme,s=t.translator,a=n.pic.field((function(e){return"colorByExpression"===e.raw().id}));if(!a||!a.raw().qFallbackTitle&&!n.input.colorExpression||!(Number.isFinite(a.raw().qMin)&&Number.isFinite(a.raw().qMax)||n.input.expressionIsColor))return{mode:"constant",type:"constant",primary:i.nil};if(n.input.expressionIsColor)return{mode:"field",fieldType:"expression",field:a?a.key():void 0,type:"color"};var l=Qy(0,{hc:r,theme:o},n,{f:a});return l.invalid||(l.label=n.input.expressionLabel||s.get("Object.ChartTooltip.ColorExpression")),l}(0,n,t,i);if("byMultiple"===t.input.mode||"primary"===t.input.mode)return function(e,t,n,i){var r=t.hc,o=t.theme,s=t.translator,a=n.input.useBaseColors;if(("byMultiple"===n.input.mode||"primary"===n.input.mode&&"measure"===n.input.useBaseColors)&&r.qMeasureInfo.length>1&&(a="measure"),"measure"===a){var l=[],c=[];"measure"===n.input.useBaseColors&&r.qMeasureInfo.forEach((function(t,n){if(t.baseColor||t.coloring&&t.coloring.baseColor){l.push(n);var r=e.resolveUIColor(t.baseColor||t.coloring.baseColor);"none"===r?c.push(i.primary):c.push(r)}}));var u=n.input.dimensionScheme?{categorical:n.input.dimensionScheme}:void 0,h=o?o.getDataColorPalettes()[0]:void 0;return"measure"===n.input.useBaseColors&&h&&(u={categorical:h.key}),{mode:"measure",type:"categorical",palettes:u,label:s?s.get("Common.Measures"):void 0,explicit:l.length?{domain:l,range:c}:void 0}}if("dimension"===a){var d=[],f=[];return r.qDimensionInfo.forEach((function(t,n){if(t.baseColor||t.coloring&&t.coloring.baseColor){d.push(n);var r=e.resolveUIColor(t.baseColor||t.coloring.baseColor);"none"===r?f.push(i.primary):f.push(r)}})),{mode:"dimension",type:"categorical",field:d.length?d[0]:void 0,explicit:d.length?{domain:d,range:f}:void 0}}var p=i.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,i)}return{}}(e,t,n,i);return null!==(r=t.input)&&void 0!==r&&r.measureOverrides?(o.measureOverrides=t.input.measureOverrides.map((function(n,r){return tv({cm:e,input:n,defaults:i,index:r,pic:t.pic})})),function(e,t){var n,i,r,o=t.translator;if(nv(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=iv(e.measureOverrides,e.explicit),nv(e)),null!==(i=e.measureOverrides)&&void 0!==i&&i.every((function(e){return"constant"===(null==e?void 0:e.mode)}))){var s={mode:"measure",type:"categorical",label:null==o?void 0:o.get("Common.Measures")};return s.explicit=iv(e.measureOverrides),s}return null!==(r=e.measureOverrides)&&void 0!==r&&r.every((function(e){return e}))?{invalid:!0,measureOverrides:e.measureOverrides}:e}(o,n)):o}function ov(e){var t=Ng({hc:null,colorProps:null,layout:null,theme:null},e),n={},i={auto:function(){return{mode:"primary"}},getDimensionColorMap:function(){return Promise.reject()},getMeasure:function(){return Promise.reject()},getAttributeDimension:function(){return Promise.reject()}},r={auto:function(e){return e?(i.auto=e,r):i.auto},getDimensionColorMap:function(e){return e?(i.getDimensionColorMap=e,r):i.getDimensionColorMap},getAttributeDimension:function(e){return e?(i.getAttributeDimension=e,r):i.getAttributeDimension},getMeasure:function(e){return e?(i.getMeasure=e,r):i.getMeasure},set:function(e){var r;if(!e.colorProps)throw new Error('Missing "colorProps"');if(Xg(t,e),(n={pic:t.picasso.data("q")({data:t.hc,config:{localeInfo:t.localeInfo}}),input:t.colorProps}).input.auto){var o=i.auto(e.layout);n.input=Xg(!0,{},n.input,o,{auto:!1});var s=t.theme?t.theme.getDataColorPalettes():[];s[0]&&(n.input.dimensionScheme=s[0].key);var a=0;n.input.byDimDef&&+n.input.byDimDef.activeDimensionIndex>=0&&(a=+n.input.byDimDef.activeDimensionIndex),t.hc&&t.hc.qDimensionInfo[a]&&t.hc.qDimensionInfo[a].coloring&&t.hc.qDimensionInfo[a].coloring.colorMapRef&&n.input.byDimDef&&(n.input.byDimDef.type="libraryItem",n.input.byDimDef.key=t.hc.qDimensionInfo[a].coloring.colorMapRef)}null!==(r=n.input.measureOverrides)&&void 0!==r&&r.every((function(e){return!e||!e.on}))&&(n.input=Xg(!1,{},n.input,{measureOverrides:null}))},palettes:function(){if(!n.palettes){var e=t.theme,i=[];(e&&e.getDataColorPickerPalettes()||[]).forEach((function(e){i.push({key:"ui",colors:e.colors})})),n.palettes=i}return n.palettes},getAuxiliaryData:function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"/qHyperCubeDef";if(!e.auxiliary&&!/qAttrDimInfo/.test(e.field))return Promise.resolve();var r=(e.auxiliary||{}).key;if("measure"===e.fieldType)return i.getMeasure(r,t).catch((function(){}));if("dimension"===e.fieldType){var o="".concat(n,"/").concat(e.field).replace("qDimensionInfo","qDimensions").replace("qAttrDimInfo","qAttributeDimensions");return Promise.all([/qAttrDimInfo/.test(e.field)?i.getAttributeDimension(o,t).catch((function(){})):Promise.resolve(),r?i.getDimensionColorMap(r,t).catch((function(){})):Promise.resolve()])}return Promise.resolve()},getAuxiliarySettings:function(e,i){var r=this;return e.auxiliary||/qAttrDimInfo/.test(e.field)?(this.palettes(),this.getAuxiliaryData(e,i).then((function(i){if(!i)return{};if("measure"===e.fieldType){if(i.coloring&&i.coloring.gradient){var o=n.pic.field(e.field);return Jy(r,i.coloring.gradient,e,o)}return{}}if("dimension"===e.fieldType){var s={nil:e.nil,others:e.others},a=i[0],l=i[1]?i[1].colorMap:null;if(a){var c=t.picasso.data("q")({data:{qDimensionInfo:[n.pic.field(e.field).raw(),n.pic.field(e.field).raw()],qMeasureInfo:[],qDataPages:a,qInterColumnSortOrder:[0,1],qMode:"S"}});s.legendDataset=c}return l?function(e,t,n,i){var r=i.external,o=i.field,s=Ng({},e);Xg(s,Kg(o,o.raw().qCardinal));var a=r.theme?r.theme.getDataColorPalettes()[0]:null;return t.nul&&(s.nil=n.resolveUIColor(t.nul)),t.oth&&(s.others=n.resolveUIColor(t.oth)),t.usePal?(s.palettes={categorical:t.pal},a&&!t.pal&&(s.palettes.categorical=a.key,Xg(s,Kg(o)))):!1===t.autoFill&&t.single?s.range=[n.resolveUIColor(t.single)]:t.autoFill&&(a&&(s.palettes={categorical:a.key}),Xg(s,Kg(o))),t.colors&&t.colors.length&&(s.explicit=function(e,t,n){for(var i={},r=0;r<e.length;r+=1)i[e[r].value]=e[r].baseColor;var o=[];return{domain:function(e){var r=e.data,s=[];o=[];for(var a=0;a<r.items.length;a++){var l=r.items[a],c=(l.text||l).label;i[c]&&-1===s.indexOf(l.value)&&(s.push(l.value),o.push(t.resolveUIColor(i[c])))}return s.push(-3,-2),o.push(n.others),o.push(n.nil),s},range:function(){return o}}}(t.colors,n,s)),s}(s,l,r,{external:t,field:n.pic.field(e.field)}):s}return{}}))):Promise.resolve()},resolveUIColor:function(e){if(e.index<0||void 0===e.index)return e.color;if(void 0===n.uiPalette&&(n.uiPalette=this.palettes().filter((function(e){return"ui"===e.key}))[0]||!1),!n.uiPalette)return e.color;var t="none"===n.uiPalette.colors[0]?e.index:e.index-1;return void 0===n.uiPalette.colors[t]?e.color:n.uiPalette.colors[t]},settings:function(){if(this.palettes(),!n.settings){var e={primary:"steelblue",others:"#aaa",nil:"#ddd"},i=t.theme;i&&(e=Ng(Ng({},e),i.getDataColorSpecials())),n.settings=Xg(e,rv(this,n,t,e))}return n.settings}};return r}var sv=function(e,t){var n=e.fieldType,i={};if(t)if("measure"===n){var r=t.coloring;r&&(i.measureGradient=r.gradient)}else if("dimension"===n){var o=t[0],s=t[1];o&&(i.legendDataPage=o),s&&(i.dimValsData=s.colorMap)}return i},av=function(e){throw e.isHandled=!0,e},lv=function(e,t){var n=t.layout,i=t.app;return n&&n.snapshotData?n.snapshotData.content&&n.snapshotData.content.chartData&&n.snapshotData.content.chartData.dimValsData?Promise.resolve({colorMap:n.snapshotData.content.chartData.dimValsData}):Promise.reject():i&&i.getObject?i.getObject("ColorMapModel_".concat(e)).then((function(e){return e.getLayout()})):Promise.reject()},cv=function(e,t){var n=t.layout,i=t.app;return n&&n.snapshotData?n.snapshotData.content&&n.snapshotData.content.chartData&&n.snapshotData.content.chartData.measureGradient?Promise.resolve({coloring:{gradient:n.snapshotData.content.chartData.measureGradient}}):Promise.reject():i&&i.getMeasure?i.getMeasure(e).then((function(e){return e.getMeasure()})):Promise.reject()},uv=function(e,t){var n=t.layout,i=t.model,r=t.app;return n&&n.snapshotData?n.snapshotData.content&&n.snapshotData.content.chartData&&n.snapshotData.content.chartData.legendDataPage?Promise.resolve(n.snapshotData.content.chartData.legendDataPage):Promise.reject():i&&i.session&&r?i.getHyperCubeData(e,[{qHeight:100,qLeft:0,qTop:0,qWidth:2}]).catch(av):Promise.reject()};function hv(e){return function(t){return"object"===Pg(t.datum[e])?t.datum[e].value:void 0}}function dv(e){return"object"===Pg(e.datum.isNull)?e.datum.isNull.value:-2===e.datum.value}function fv(e){return-3===e.datum.value}var pv={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 mv(e){var t=e.theme,n=e.key,i=e.styleOverrides,r={title:{color:pv.TITLE.COLOR,fontSize:pv.TITLE.FONT_SIZE,fontFamily:pv.TITLE.FONT_FAMILY},label:{color:pv.LABEL.COLOR,fontSize:pv.LABEL.FONT_SIZE,fontFamily:pv.LABEL.FONT_FAMILY}};if(!t&&!i)return r;var o=i||{},s=o.title,a=o.label,l=function(e){var t=e.theme,n=e.key;return function(e,i,r,o){return void 0!==e?e:t?t.getStyle(n,i,r):o}}({theme:t,key:n});return r.title.color=l(null==s?void 0:s.color,"legend.title","color",pv.TITLE.COLOR),r.title.fontSize=l(null==s?void 0:s.fontSize,"legend.title","fontSize",pv.TITLE.FONT_SIZE),r.title.fontFamily=l(null==s?void 0:s.fontFamily,"legend.title","fontFamily",pv.TITLE.FONT_FAMILY),r.label.color=l(null==a?void 0:a.color,"legend.label","color",pv.LABEL.COLOR),r.label.fontSize=l(null==a?void 0:a.fontSize,"legend.label","fontSize",pv.LABEL.FONT_SIZE),r.label.fontFamily=l(null==a?void 0:a.fontFamily,"legend.label","fontFamily",pv.LABEL.FONT_FAMILY),r}var gv=function(e,t,n){var i=e&&e.dock||void 0;if("auto"!==i)return i||"right";if(t){var r=t.element.getBoundingClientRect();if(r.height>r.width)return"bottom"}return n?"left":"right"},yv=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 vv(e,t){var n=e.styleReference,i=e.styleOverrides,r=e.chart,o=e.rtl,s=t.legendProps,a=t.coloring,l=t.theme,c=t.hc,u=mv({theme:l,key:n,styleOverrides:i});return{layout:{minimumLayoutMode:"MEDIUM",dock:gv(s,r,o)},show:"function"==typeof s.show?function(){return yv(s,c,a)}:yv(s,c,a),renderer:"svg",mounted:function(e){e.childNodes[0].style.pointerEvents="none",e.style.overflow="hidden"},settings:{title:{show:!1!==s.showTitle,wordBreak:"break-word",maxLines:2,lineHeight:1.2,text:a.label||"",fill:u.title.color,fontSize:u.title.fontSize,fontFamily:u.title.fontFamily}}}}function bv(e,t,n){return"categorical"===t.coloring.type?function(e,t,n){var i=vv(e,t);if(!i.show)return!1;var r,o=e.key,s=e.styleReference,a=e.styleOverrides,l=e.viewState,c=e.rtl,u=e.settings,h=e.style,d=t.scaleKey,f=t.theme,p=t.scales,m=mv({theme:f,key:s,styleOverrides:a}),g=i.layout.dock,y="left"===g||"right"===g?{maxLines:2,wordBreak:"break-word"}:{},v={up:"M13.6,11 L2.4,11 C2.28954305,11 2.2,10.9104569 2.2,10.8 C2.2,10.756726 2.21403557,10.7146192 2.24,10.68 L7.84,3.21333333 C7.90627417,3.12496777 8.03163444,3.10705916 8.12,3.17333333 C8.13516113,3.18470418 8.14862915,3.1981722 8.16,3.21333333 L13.76,10.68 C13.8262742,10.7683656 13.8083656,10.8937258 13.72,10.96 C13.6853808,10.9859644 13.643274,11 13.6,11 Z",down:"M2.4,4 L13.6,4 C13.7104569,4 13.8,4.08954305 13.8,4.2 C13.8,4.24327404 13.7859644,4.28538077 13.76,4.32 L8.16,11.7866667 C8.09372583,11.8750322 7.96836556,11.8929408 7.88,11.8266667 C7.86483887,11.8152958 7.85137085,11.8018278 7.84,11.7866667 L2.24,4.32 C2.17372583,4.23163444 2.19163444,4.10627417 2.28,4.04 C2.31461923,4.01403557 2.35672596,4 2.4,4 Z",left:"M11,2.4 L11,13.6 C11,13.7104569 10.9104569,13.8 10.8,13.8 C10.756726,13.8 10.7146192,13.7859644 10.68,13.76 L3.21333333,8.16 C3.12496777,8.09372583 3.10705916,7.96836556 3.17333333,7.88 C3.18470418,7.86483887 3.1981722,7.85137085 3.21333333,7.84 L10.68,2.24 C10.7683656,2.17372583 10.8937258,2.19163444 10.96,2.28 C10.9859644,2.31461923 11,2.35672596 11,2.4 Z",right:"M4,13.6 L4,2.4 C4,2.28954305 4.08954305,2.2 4.2,2.2 C4.24327404,2.2 4.28538077,2.21403557 4.32,2.24 L11.7866667,7.84 C11.8750322,7.90627417 11.8929408,8.03163444 11.8266667,8.12 C11.8152958,8.13516113 11.8018278,8.14862915 11.7866667,8.16 L4.32,13.76 C4.23163444,13.8262742 4.10627417,13.8083656 4.04,13.72 C4.01403557,13.6853808 4,13.643274 4,13.6 Z"};"dimension"===t.coloring.fieldType&&(r=function(e){return e.datum.value>=0||-3===e.datum.value});var b="".concat(d,"Legend");return Xg(!0,i,{type:"legend-cat",key:"".concat(o,"-cat"),scale:b in p?b:d,settings:{layout:{scrollOffset:function(){return l?l.get("legendScrollOffset"):void 0},size:-1!==["top","bottom"].indexOf(i.layout.dock)?2:1,direction:c?"rtl":"ltr",horizontal:20},item:{show:r,label:Ng({fill:m.label.color,fontSize:m.label.fontSize,fontFamily:m.label.fontFamily},y)},navigation:{disabled:n,button:{content:function(e,t){var n=t.direction;return e("i",{style:{"pointer-events":"none",fontSize:"12px",display:"inline-block",fontStyle:"normal",lineHeight:"0",textAlign:"center",textTransform:"none",verticalAlign:"-0.125em",textRendering:"optimizelegibility",margin:"0px"}},[e("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 16 16",fill:"currentColor"},[e("path",{d:v[n]})])])}}}},brush:{consume:[{context:"selection",data:["",o],style:{inactive:{opacity:.3}}}]}},{settings:u,style:h})}(e,t,n):"continuous"===t.coloring.type&&function(e,t){var n,i=e.key,r=e.styleReference,o=e.styleOverrides,s=e.rtl,a=e.settings,l=e.style,c=t.scaleKey,u=t.theme,h="".concat(c,"Range"),d=vv(e,t);if(!d.show)return!1;var f=mv({theme:u,key:r,styleOverrides:o}),p=d.layout.dock,m="right"===p||"left"===p,g=null===(n=t.scales)||void 0===n?void 0:n[h];return m&&g&&(g.invert=!0),Xg(!0,d,{type:"legend-seq",key:"".concat(i,"-seq"),settings:{fill:c,major:h,length:1,tick:{fill:f.label.color,fontSize:f.label.fontSize,fontFamily:f.label.fontFamily},title:{anchor:!s||"top"!==d.layout.dock&&"bottom"!==d.layout.dock?void 0:"right",padding:parseFloat(d.settings.title.fontSize)||16}}},{settings:a,style:l})}(e,t)}function xv(e,t,n){var i=[],r=[],o=bv(e,t,n&&n.navigationDisabled);return i.push(o),o&&"legend-cat"===o.type&&(r.push(function(e){var t=e.key,n=e.requireFailure,i=e.recognizeWith,r=(arguments.length>1&&void 0!==arguments[1]?arguments[1]:{}).actions;return{key:"event:tap-".concat(t),type:"Tap",requireFailure:n,recognizeWith:i,options:{event:"legendtap",interval:10,pointers:1,enable:function(e,n){var i;if(!n)return!0;if(null!=r&&null!==(i=r.interact)&&void 0!==i&&i.enabled&&!r.interact.enabled())return!1;if(!this.chart.componentsFromPoint({x:n.center.x,y:n.center.y}).some((function(e){return e.key==="".concat(t,"-cat")})))return!1;var o=n.srcEvent.target;return!!(o&&o.hasAttribute("data-action")&&o.hasAttribute("data-component-key"))||!(!o||!o.childNodes[0]||"BUTTON"!==o.childNodes[0].nodeName)}},events:{legendtap:function(e){e.preventDefault();var t=e.srcEvent.target;t&&t.hasAttribute("data-action")&&t.hasAttribute("data-component-key")&&this.chart.component(t.getAttribute("data-component-key")).emit(t.getAttribute("data-action"))}}}}(e,n)),r.push(function(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=t.eventName,i=t.key,r=t.requireFailure,o=t.recognizeWith,s=(arguments.length>1&&void 0!==arguments[1]?arguments[1]:{}).actions;return{key:"event:pan-".concat(i),type:"Pan",requireFailure:r,recognizeWith:o,options:{event:n,pointers:1,threshold:10,enable:function(e,t){var r;return this.started===n||!t||!(null!=s&&null!==(r=s.interact)&&void 0!==r&&r.enabled&&!s.interact.enabled())&&this.chart.componentsFromPoint({x:t.center.x,y:t.center.y}).some((function(e){return e.key==="".concat(i,"-cat")}))}},events:(e={},Lg(e,"".concat(n,"start"),(function(e){e.preventDefault(),this.started!==n&&(this.started=n,this.chart.component("".concat(i,"-cat")).emit("panstart",e))})),Lg(e,"".concat(n,"move"),(function(e){e.preventDefault(),this.chart.component("".concat(i,"-cat")).emit("panmove",e)})),Lg(e,"".concat(n,"end"),(function(e){e.preventDefault(),this.chart.component("".concat(i,"-cat")).emit("panend",e),this.started=!1})),e)}}(e,n))),{interactions:r,components:i}}var wv=function(e){return"rgba(".concat([(16711680&e)>>16,(65280&e)>>8,255&e,((4278190080&e)>>>24)/255].join(","),")")};function qv(e){var t=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.auto,n=ov(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,i=t.app;return lv(e,{layout:n,app:i})})).getMeasure((function(e,t){var n=t.layout,i=t.app;return cv(e,{layout:n,app:i})})).getAttributeDimension((function(e,t){var n=t.layout,i=t.model,r=t.app;return uv(e,{layout:n,model:i,app:r})}));return n.getSnapshotData=sv,n}({resources:e}),n={},i={},r=function(e){return i.settings||(e||console.warn("settings() called before auxiliarySettings()"),i.settings=t.settings()),i.settings},o={config:function(r){if(n=Ng({},r),i={},!n.key)throw new Error("Missing key");t.set(Ng(Ng({},e),n))},auto:function(e){return e?(t.auto(e),o):t.auto()},getAuxiliarySettings:function(e){return i.auxiliarySettings?Promise.resolve(i.auxiliarySettings):t.getAuxiliarySettings(r(!0),e).then((function(e){return i.auxiliarySettings=e||{},i.settings=Ng(Ng({},i.settings),i.auxiliarySettings),i.scales=void 0,i.color=void 0,i.auxiliarySettings}))},getAuxiliaryData:function(){return t.getAuxiliaryData(r())},getSnapshotData:function(e){var n=r();return t.getAuxiliaryData(n,e).then((function(e){return t.getSnapshotData(n,e)}))},resolveUIColor:function(e){return t.resolveUIColor(e)},settings:function(){var e=r();return{mode:e.mode,type:e.type,label:e.label,field:e.field,fieldType:e.fieldType,nil:e.nil,others:e.others,primary:e.primary}},settingsForMeasure:function(e){var t;return(null===(t=r().measureOverrides)||void 0===t?void 0:t[e])||this.settings()},isSelectionLocked:function(e){var t=e.isMeasureSelectionLocked;return function(e,t){var n=t.isMeasureSelectionLocked;return"field"!==e.mode||("dimension"===e.fieldType?e.isFieldLocked:"measure"!==e.fieldType||n)}(r(),{isMeasureSelectionLocked:t})},palettes:function(){return function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.colorProps,n=e.coloring,i=e.theme,r=[];if(n&&n.palettes&&i){var o=n.palettes.categorical||t.dimensionScheme,s=i.getDataColorPalettes().filter((function(e){return e.key===o}))[0]||i.getDataColorPalettes()[0];o&&s&&r.push({key:"categorical",colors:s.colors});var a=n.palettes.metric||t.measureScheme,l=i.getDataColorScales().filter((function(e){return e.key===a}))[0];if(l){var c=l.colors[0]?l.colors:[[]].concat(Fg(l.colors.slice(1)));c=Array.isArray(c[0])?c.map((function(e){return e.slice().reverse()})):c.slice().reverse(),r.push({key:"quant",colors:c})}}return r}({coloring:r(),colorProps:n.colorProps,theme:n.theme})},scales:function(){return i.scales=i.scales||function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.hc,n=e.coloring,i=e.rtl,r=e.key,o=e.source,s=e.picasso,a={},l=r;if(n){var c={override:!0,domain:n.explicit&&"function"==typeof n.explicit.domain?n.explicit.domain:[].concat(Fg((n.explicit||{}).domain||[]),[-3,-2]),range:n.explicit&&"function"==typeof n.explicit.range?n.explicit.range:[].concat(Fg((n.explicit||{}).range||[]),[n.others,n.nil])};if("field"===n.mode){if("dimension"===n.fieldType){var u,h=function(e){var t=e.hc,n=e.source,i=e.coloring,r={data:{extract:[{source:"dummy",field:0,filter:function(){return r.expando=t.qDataPages[0]?t.qDataPages[0].qArea.qTop:0,!1}},{source:n,field:i.field,trackBy:i.valueAccessor,reduce:"first",props:{row:{reduce:function(){return r.expando++}},text:{value:function(e){return e.qText},reduce:"first"}}}]},expando:0};return r}({hc:t,source:o,coloring:n}).data;if(n.legendDataset){var d=0,f={};s.data("q")({data:t}).extract({field:n.field,trackBy:n.valueAccessor,reduce:function(e){var t=e[0];return f[t]=d++,e[0]}}),u={source:"attrDim",extract:{field:"qDimensionInfo/0",filter:function(e){return e.qElemNumber>=0},props:{row:{value:function(e){return f[e.qElemNumber]}}}}}}var p={data:h,range:n.range,domain:n.domain,explicit:c,type:"categorical-color",label:function(e){return e.datum.text&&e.datum.text.value?e.datum.text.value:e.datum.label}};a[l]=p,u&&(a["".concat(l,"Legend")]=Ng(Ng({},p),{},{data:u})),t&&t.qHasOtherValues&&u&&((u||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};a[l]=Xg({},m,{type:"categorical"===n.type?"threshold-color":"sequential-color",range:n.range,domain:n.domain,invert:n.reverse}),"sequential-color"===a[l].type&&(a["".concat(l,"Range")]=Xg({},m,{invert:!!i}))}else if("color"!==n.type)throw new Error("UNUSED FIELD")}else if("dimension"===n.mode){var g={data:t.qDimensionInfo.map((function(e,t){return t})),label:function(e){return t.qDimensionInfo[e.datum.value].qFallbackTitle},explicit:c,type:"categorical-color"};a[l]=g}else if("measure"===n.mode){var y={data:t.qMeasureInfo.map((function(e,t){return t})).filter((function(e){var t,i;return!(null!==(t=n.explicit)&&void 0!==t&&null!==(i=t.exclude)&&void 0!==i&&i.includes(e))})),label:function(e){return t.qMeasureInfo[e.datum.value].qFallbackTitle},explicit:c,type:"categorical-color"};a[l]=y}}return a}({hc:n.hc,coloring:r(),key:n.key,source:n.source,picasso:e.picasso}),i.scales},color:function(){return i.color=i.color||function(e){var t=e.coloring,n=e.scales,i=e.key,r=hv(i),o=hv("".concat(i,"IsAnOther")),s=function(e,t){var i=e.fieldType,s=e.invalid,a=e.mode,l=e.nil,c=e.others,u=e.primary,h=e.type;return s?function(e){return fv(e)||o(e)?c:l}:n[t]?function(e){return fv(e)?c:dv(e)||-2===r(e)&&"dimension"===i||"NaN"===r(e)?l:o(e)?c:e.resources.scale(t)(r(e))||c}:"constant"===a?function(e){return fv(e)||o(e)?c:dv(e)?l:u}:"color"===h?function(e){return fv(e)||o(e)?c:dv(e)?l:r(e)||c}:null},a=s(t,i);if(t.measureOverrides){var l=hv("".concat(i,"MeasureIdx")),c=t.measureOverrides.map((function(e){return e&&s(e)}));return function(e){var t=l(e);return c[t]?c[t](e):a(e)}}return a}({coloring:r(),scales:this.scales(),key:n.key}),i.color},datumProps:function(e){return function(e){var t,n,i=e.hc,r=e.coloring,o=e.scales,s=e.key,a=e.addMeasureIx,l=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,c=s,u=r.nil;"field"===r.mode&&r.field?t=r.field:o[s]&&"field"===r.mode&&(t=o[s].data.field||r.field),t?(n={field:t,reduce:"first"},"color"===r.type&&(n.value=function(e){return"NaN"!==e.qNum?wv(e.qNum):e.qText&&yy(e.qText)?e.qText:u})):"dimension"===r.mode?n=void 0!==r.field?r.field:i.qDimensionInfo.length-1:"measure"===r.mode&&(n=l);var h=Lg({},c,n);return i.qDimensionInfo.length>1&&(h["".concat(c,"IsAnOther")]={fields:i.qDimensionInfo.map((function(e,t){return{field:"qDimensionInfo/".concat(t)}})),value:function(e){return-1!==e.indexOf(-3)}}),a&&(h["".concat(c,"MeasureIdx")]=l),h}({coloring:this.settingsForMeasure(e),scales:this.scales(),key:n.key,hc:n.hc,addMeasureIx:r().measureOverrides},e)},data:function(){var e=r(),t={key:"dummy",data:[["field"],["a"]]};return e.legendDataset?[t,{type:"q",key:"attrDim",data:e.legendDataset.raw(),config:{localeInfo:n.localeInfo}}]:[t]},legend:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.eventName,i=e.key,o=e.viewState,s=e.chart,a=e.rtl,l=e.styleReference,c=void 0===l?"object.legend":l,u=e.styleOverrides,h=e.settings,d=void 0===h?{}:h,f=e.style,p=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return xv({eventName:t,key:i,rtl:a,viewState:o,chart:s,styleReference:c,styleOverrides:u,settings:d,style:void 0===f?{}:f},{legendProps:n.legendProps,scaleKey:n.key,coloring:r(),theme:n.theme,hc:n.hc,scales:this.scales()},p)}};return o}var Sv=function(e){return e.baseColor||e.coloring&&e.coloring.baseColor};function Mv(e){var t=e.qHyperCube,n=t.qDimensionInfo,i=t.qMeasureInfo,r=n.some(Sv),o=i.some(Sv),s=e.color.useBaseColors;return"measure"===s&&!o||"dimension"===s&&!r?"off":s}function Dv(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return Ng(Ng(Ng({},e),t),{},{colorProps:Ng(Ng({},e.colorProps),t.colorProps||{})})}var _v=function(e){return e.baseColor||e.coloring&&e.coloring.baseColor};function Cv(e){var t,n=e.qHyperCube.qDimensionInfo.some(_v),i=e.qHyperCube.qMeasureInfo.some(_v),r=n?"dimension":void 0;return{mode:"primary",useBaseColors:null!==(t=null!=r?r:i?"measure":void 0)&&void 0!==t?t:"off",paletteColor:null}}var kv=function(){};function Ev(e,t,n){if(void 0===e||void 0===t)return n;for(var i=t.split("."),r=e,o=0;o<i.length;++o){var s=i[o];if(void 0===r[s])return n;r=r[s]}return r}var Av,Tv=["__proto__","constructor"];function Iv(e,t,n){if(void 0!==e&&void 0!==t){var i=t.split("."),r=i[i.length-1];if(!Tv.some((function(e){return i.includes(e)}))){for(var o=e,s=0;s<i.length-1;++s){var a=i[s];void 0===o[a]&&(o[a]=Number.isNaN(+i[s+1])?{}:[]),o=o[a]}void 0!==n?o[r]=n:delete o[r]}}}function Rv(e){var t=0,n=e.children,i=n&&n.length;if(i)for(;--i>=0;)t+=n[i].value;else t=1;e.value=t}function Ov(e,t){e instanceof Map?(e=[void 0,e],void 0===t&&(t=Pv)):void 0===t&&(t=Nv);for(var n,i,r,o,s,a=new zv(e),l=[a];n=l.pop();)if((r=t(n.data))&&(s=(r=Array.from(r)).length))for(n.children=r,o=s-1;o>=0;--o)l.push(i=r[o]=new zv(r[o])),i.parent=n,i.depth=n.depth+1;return a.eachBefore(Fv)}function Nv(e){return e.children}function Pv(e){return Array.isArray(e)?e[1]:null}function Lv(e){void 0!==e.data.value&&(e.value=e.data.value),e.data=e.data.data}function Fv(e){var t=0;do{e.height=t}while((e=e.parent)&&e.height<++t)}function zv(e){this.data=e,this.depth=this.height=0,this.parent=null}zv.prototype=Ov.prototype={constructor:zv,count:function(){return this.eachAfter(Rv)},each:function(e,t){let n=-1;for(const i of this)e.call(t,i,++n,this);return this},eachAfter:function(e,t){for(var n,i,r,o=this,s=[o],a=[],l=-1;o=s.pop();)if(a.push(o),n=o.children)for(i=0,r=n.length;i<r;++i)s.push(n[i]);for(;o=a.pop();)e.call(t,o,++l,this);return this},eachBefore:function(e,t){for(var n,i,r=this,o=[r],s=-1;r=o.pop();)if(e.call(t,r,++s,this),n=r.children)for(i=n.length-1;i>=0;--i)o.push(n[i]);return this},find:function(e,t){let n=-1;for(const i of this)if(e.call(t,i,++n,this))return i},sum:function(e){return this.eachAfter((function(t){for(var n=+e(t.data)||0,i=t.children,r=i&&i.length;--r>=0;)n+=i[r].value;t.value=n}))},sort:function(e){return this.eachBefore((function(t){t.children&&t.children.sort(e)}))},path:function(e){for(var t=this,n=function(e,t){if(e===t)return e;var n=e.ancestors(),i=t.ancestors(),r=null;for(e=n.pop(),t=i.pop();e===t;)r=e,e=n.pop(),t=i.pop();return r}(t,e),i=[t];t!==n;)t=t.parent,i.push(t);for(var r=i.length;e!==n;)i.splice(r,0,e),e=e.parent;return i},ancestors:function(){for(var e=this,t=[e];e=e.parent;)t.push(e);return t},descendants:function(){return Array.from(this)},leaves:function(){var e=[];return this.eachBefore((function(t){t.children||e.push(t)})),e},links:function(){var e=this,t=[];return e.each((function(n){n!==e&&t.push({source:n.parent,target:n})})),t},copy:function(){return Ov(this).eachBefore(Lv)},[Symbol.iterator]:function*(){var e,t,n,i,r=this,o=[r];do{for(e=o.reverse(),o=[];r=e.pop();)if(yield r,t=r.children)for(n=0,i=t.length;n<i;++n)o.push(t[n])}while(o.length)}},Av=function(e){
|
|
41
25
|
/*! javascript-number-formatter - v1.1.11 - http://mottie.github.com/javascript-number-formatter/ * © ecava */
|
|
42
|
-
e.exports=function(e,t){if(!e||isNaN(+t))return t;var n,i,r,o,s,a,l,c,u,h,d=e.length,f=e.search(/[0-9\-\+#]/),p=f>0?e.substring(0,f):"",m=e.split("").reverse().join(""),g=m.search(/[0-9\-\+#]/),y=d-g,v=e.substring(y,y+1),b=y+("."===v||","===v?1:0),x=g>0?e.substring(b,d):"";if(n=(t="-"===(e=e.substring(f,b)).charAt(0)?-t:+t)<0?t=-t:0,r=(i=e.match(/[^\d\-\+#]/g))&&i[i.length-1]||".",o=i&&i[1]&&i[0]||",",e=e.split(r),t=+(t=t.toFixed(e[1]&&e[1].length))+"",a=e[1]&&e[1].lastIndexOf("0"),(!(c=t.split("."))[1]||c[1]&&c[1].length<=a)&&(t=(+t).toFixed(a+1)),u=e[0].split(o),e[0]=u.join(""),(s=e[0]&&e[0].indexOf("0"))>-1)for(;c[0].length<e[0].length-s;)c[0]="0"+c[0];else 0==+c[0]&&(c[0]="");if((t=t.split("."))[0]=c[0],l=u[1]&&u[u.length-1].length){for(m="",y=(h=t[0]).length%l,d=h.length,b=0;b<d;b++)m+=h.charAt(b),!((b-y+1)%l)&&b<d-l&&(m+=o);t[0]=m}return t[1]=e[1]&&t[1]?r+t[1]:"","0"!==(i=t.join(""))&&""!==i||(n=!1),p+(n?"-":"")+i+x}},Wb(Ub={exports:{}}),Ub.exports);function Xb(e){return e.replace(/[-[\]/{}()*+?.\\^$|]/g,"\\$&")}var Kb={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"},Gb=/%$/,Jb=/^\(r(0[2-9]|[12]\d|3[0-6])\)/i,Zb=/^\(oct\)/i,Qb=/^\(dec\)/i,ex=/^\(hex\)/i,tx=/^\(bin\)/i,nx=/^\(rom\)/i,ix=/^(\(rom\)|\(bin\)|\(hex\)|\(dec\)|\(oct\)|\(r(0[2-9]|[12]\d|3[0-6])\))/i,rx=/#|0/g;function ox(e,t,n,i){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(".",i||".")}function sx(e,t,n){var i=Xb(e);return n?i:new RegExp(i||"",t)}function ax(e,t,n){var i,r,o,s,a,l,c,u,h,d,f,p=e.pattern;p.indexOf("A")>=0&&(p=p.replace("A",""),e.abbreviate=!0),d=t,(f=n)&&(f=Xb(f)),d&&(d=Xb(d)),h=new RegExp("(?:[#0]+".concat(d,")?[#0]+(?:").concat(f,"[#0]+)?")),s=(o=(o=p.match(h))?o[0]:"")?p.substr(0,p.indexOf(o)):p,a=o?p.substring(p.indexOf(o)+o.length):"",o||(o=p?"#":"##########"),t&&t===n&&(r=(i=o.split(n)).pop(),o=i.join("")+n+r,t=""),l=t,t=/,/.test(n)?"¤":",",l&&(o=o.replace(sx(l,"g"),t)),c=n,n=".",c&&(o=o.replace(sx(c,"g"),n)),u=(u=o.match(/#/g))?u.length:0;var m,g=p.split(c);g[1]&&(m=g[1].match(rx)),e.prefix=s||"",e.postfix=a||"",e.pattern=p,e.maxPrecision=m?m.length:2,e.percentage=Gb.test(p),e.numericPattern=o||"",e.numericRegex=new RegExp("".concat(sx(t,null,!0),"|").concat(sx(n,null,!0)),"g"),e.groupTemp=l,e.decTemp=c,e.t=t,e.d=n,e.temp=u}!function(){function e(t,n,i,r,o){Ob(this,e),this.localeInfo=t,this.pattern=n,this.thousandDelimiter=i||",",this.decimalDelimiter=r||".",this.type=o||"numeric",this.patternSeparator=";",this.abbreviations=function(e,t){if(!e||!e.qNumericalAbbreviation)return Kb;var n={};return e.qNumericalAbbreviation.split(t).forEach((function(e){var t=e.split(":");2===t.length&&(n[t[0]]=t[1])})),n}(t,this.patternSeparator),this.prepare()}Lb(e,[{key:"clone",value:function(){var t=new e(this.localeInfo,this.pattern,this.thousandDelimiter,this.decimalDelimiter,this.type);return t.subtype=this.subtype,t}},{key:"format",value:function(e,t,n,i){return this.prepare(t,n,i),this.formatValue(e)}},{key:"prepare",value:function(e,t,n){var i;void 0===e&&(e=this.pattern),void 0===t&&(t=this.thousandDelimiter),void 0===n&&(n=this.decimalDelimiter),e?(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:""}},i=this._prepared,e=e.split(this.patternSeparator),i.positive.pattern=e[0],i.negative.pattern=e[1],i.zero.pattern=e[2],ix.test(e[0])&&(i.positive.isFunctional=!0),e[1]?ix.test(e[1])&&(i.negative.isFunctional=!0):i.negative=!1,e[2]?ix.test(e[2])&&(i.zero.isFunctional=!0):i.zero=!1,i.positive.isFunctional||ax(i.positive,t,n),i.negative&&!i.negative.isFunctional&&ax(i.negative,t,n),i.zero&&!i.zero.isFunctional&&ax(i.zero,t,n)):this._prepared={pattern:!1}}},{key:"formatValue",value:function(e){var t,n,i,r,o,s,a,l,c,u=this._prepared,h="",d="",f=e;if(isNaN(e))return"".concat(f);if(e=+e,!1===u.pattern)return e.toString();if(0===e&&u.zero)return(u=u.zero).pattern;if(e<0&&u.negative?(u=u.negative,e=-e):u=u.positive,o=u.d,s=u.t,u.isFunctional)e=function(e,t,n){var i;return Jb.test(t)?e=ox(e,Number(/\d{2}/.exec(t)[0]),t,n):Zb.test(t)?e=ox(e,8,t,n):Qb.test(t)?e=ox(e,10,t,n):ex.test(t)?e=ox(e,16,t,n):tx.test(t)?e=ox(e,2,t,n):nx.test(t)&&(i="",e<0&&(i="-",e=-e),0===(e=Math.floor(e))?e="0":e<=5e5?(e=function(e,t){for(var n,i="",r=Number(String(e).slice(-3)),o=(e-r)/1e3,s=[0,1,4,5,9,10,40,50,90,100,400,500,900].reverse(),a=["0","I","IV","V","IX","X","XL","L","XC","C","CD","D","CM"].reverse();r>0;)for(n=0;n<s.length;n++)if(s[n]<=r){i+=a[n],r-=s[n];break}for(n=0;n<o;n++)i="M".concat(i);return t[1]!==t[1].toUpperCase()&&(i=i.toLowerCase()),i}(e,t),e=i+e):e=t+i+e.toExponential(0)),e}(e,u.pattern,o);else{if(u.percentage&&(e*=100),u.abbreviate){var p,m,g=Object.keys(this.abbreviations).map((function(e){return parseInt(e,10)})).sort((function(e,t){return e-t})),y=g[0];for(a=0,n=Number(Number(e).toExponential().split("e")[1]);y<=n&&a<g.length;)y=g[++a];a>0&&(p=g[a-1]),p&&n>0&&p>0?m=p:(n<0&&p<0||!p)&&(y<0&&y-n<=u.maxPrecision?m=y:p<=n&&!(y>0&&-n<=u.maxPrecision)&&(m=p)),m&&(h=this.abbreviations[m],e/=Math.pow(10,m))}if(i=Math.abs(e),t=u.temp,c=(l=u.numericPattern).split(o)[1],"I"===this.type&&(e=Math.round(e)),r=e,c||"#"!==l.slice(-1)[0])if(i>=1e15||i>0&&i<=1e-14)e=i?i.toExponential(15).replace(/\.?0+(?=e)/,""):"0";else{var v=Number(e.toFixed(Math.min(20,c?c.length:0)).split(".")[0]),b=l.split(o)[0];if(e=Yb(b+=o,v)||"0",c){var x=Math.max(0,Math.min(14,c.length)),w=c.replace(/#+$/,"").length,q=("I"===this.type?0:i%1).toFixed(x).slice(2).replace(/0+$/,"");for(a=q.length;a<w;a++)q+="0";q&&(e+=o+q)}else 0===v&&(r=0)}else if(i>=Math.pow(10,t)||i<1||i<1e-4)0===e?e="0":i<1e-4||i>=1e20?(e=(e=r.toExponential(Math.max(1,Math.min(14,t))-1)).replace(/\.?0+(?=e)/,""),d=""):(e=e.toPrecision(Math.max(1,Math.min(14,t)))).indexOf(".")>=0&&(e=(e=e.replace(e.indexOf("e")<0?/0+$/:/\.?0+(?=e)/,"")).replace(".",o));else{for(l+=o,t=Math.max(0,Math.min(20,t-Math.ceil(Math.log(i)/Math.log(10)))),a=0;a<t;a++)l+="#";e=Yb(l,e)}e=e.replace(u.numericRegex,(function(e){return e===s?u.groupTemp:e===o?u.decTemp:""})),r<0&&!/^-/.test(e)&&(e="-".concat(e))}return u.prefix+e+d+h+u.postfix}}],[{key:"getStaticFormatter",value:function(){return{prepare:function(){},formatValue:function(e){return"".concat(e)}}}}])}();var lx=["Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"],cx=["Mon","Tue","Wed","Thu","Fri","Sat","Sun"],ux=["January","February","March","April","May","June","July","August","September","October","November","December"],hx=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function dx(e,t){for(var n=e.length;n<t;n++)e="0".concat(e);return e}function fx(e){var t=e.toString().split(".");return t[1]?t=Number("0.".concat(t[1])):0}!function(){function e(t,n,i){Ob(this,e);var r,o=t||{};o.qCalendarStrings||(o.qCalendarStrings={qLongDayNames:lx,qDayNames:cx,qLongMonthNames:ux,qMonthNames:hx}),this.localeInfo=o,this.locale_days=o.qCalendarStrings.qLongDayNames.slice(),this.locale_days_abbr=o.qCalendarStrings.qDayNames.slice(),this.locale_months=o.qCalendarStrings.qLongMonthNames.slice(),this.locale_months_abbr=o.qCalendarStrings.qMonthNames.slice(),n||(n=(Fb(r={},"T",o.qTimeFmt||"hh:mm:ss"),Fb(r,"D",o.qDateFmt||"YYYY-MM-DD"),Fb(r,"TS",o.qTimestampFmt||"YYYY-MM-DD hh:mm:ss"),r)[i]),this.pattern=n}Lb(e,[{key:"clone",value:function(){var t=new e(this.localeInfo,this.pattern);return t.subtype=this.subtype,t}},{key:"format",value:function(e,t){t||(t=this.pattern?this.pattern:"YYYY-MM-DD hh:mm:ss"),t=t.replace(/\[.+]|\[|]/g,"");var n,i,r,o,s,a=/t+/gi.test(t);e instanceof Date?(r=a,o=(i=e).getUTCHours(),r&&((o%=12)||(o=12)),(s=i.getUTCDay()-1)<0&&(s=6),n={year:i.getUTCFullYear(),month:i.getUTCMonth(),day:s,date:i.getUTCDate(),h:o,m:i.getUTCMinutes(),s:i.getUTCSeconds(),f:i.getUTCMilliseconds(),t:i.getUTCHours()>=12?"pm":"am"}):(e<0&&(e=-e,t="-".concat(t)),n=function(e,t){var n,i=function(e){var t=e,n=24*fx(t),i=60*fx(n),r=60*fx(i),o=1e3*fx(r);return{d:Math.floor(t),h:Math.floor(n),m:Math.floor(i),s:Math.floor(r),f:Math.round(o)}}(e),r=i.d,o=i.h,s=i.m,a=i.s,l=i.f,c=0;/w+|t+/gi.test(t)&&(n=new Date(Date.UTC(1899,11,30+Math.floor(e),0,0,Math.round(86400*(e-Math.floor(e))))),isNaN(n.getTime())&&(n=null)),/D+/gi.test(t)||(o+=24*r),/h+/gi.test(t)||(s+=60*o),/m+/gi.test(t)||(a+=60*s),/w+/gi.test(t)&&(c=n?n.getDay()-1:0)<0&&(c=6);var u="";return n&&(u=n.getUTCHours()>=12?"pm":"am"),{year:0,month:0,day:c,date:r,h:o,m:s,s:a,f:l,t:u}}(e,t));var l=function(e,t){return{"Y+|y+":{Y:"".concat(Number("".concat(t.year).slice(-2))),YY:dx("".concat(t.year).slice(-2),2),YYY:dx("".concat(t.year).slice(-3),3),def:function(e){return dx("".concat(t.year),e.length)}},"M+":{M:t.month+1,MM:dx("".concat(t.month+1),2),MMM:e.locale_months_abbr[t.month],def:e.locale_months[t.month]},"W+|w+":{W:t.day,WW:dx("".concat(t.day),2),WWW:e.locale_days_abbr[t.day],def:e.locale_days[t.day]},"D+|d+":{D:t.date,def:function(e){return dx("".concat(t.date),e.length)}},"h+|H+":{h:t.h,def:function(e){return dx("".concat(t.h),e.length)}},"m+":{m:t.m,def:function(e){return dx("".concat(t.m),e.length)}},"s+|S+":{s:t.s,def:function(e){return dx("".concat(t.s),e.length)}},"f+|F+":{def:function(e){var n="".concat(t.f),i=e.length-n.length;if(i>0)for(var r=0;r<i;r++)n+="0";else i<0&&(n=n.slice(0,e.length));return n}},"t{1,2}|T{1,2}":{def:function(e){var n=t.t;return e[0].toUpperCase()===e[0]&&(n=n.toUpperCase()),n.slice(0,e.length)}}}}(this,n),c=[];for(var u in l)Object.prototype.hasOwnProperty.call(l,u)&&c.push(u);var h=new RegExp(c.join("|"),"g"),d=t.replace(h,(function(e){var t,n,i;for(n in l)if(Object.prototype.hasOwnProperty.call(l,n)&&(t=new RegExp(n)).test(e))break;if(!t)return"";for(var r in l[n])if(r===e||r.toLowerCase()===e){void 0===(i=l[n][r])&&(i=l[n][r.toLowerCase()]);break}return void 0===i&&(i=l[n].def),"function"==typeof i&&(i=i(e)),i}));return d}}])}();var px=["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"],mx=function(e){return{value:e,label:e.charAt(0).toUpperCase()+e.slice(1),groupHeader:!1,disabled:!1}};function gx(e){var t=e.theme,n=e.translator,i=e.id,r=e.path,o=function(){return t.getStyle(i,r,"fontFamily")};return{getDefaultValue:function(){return o()},getOptions:function(){return function(e){var t=e.theme,n=e.translator,i=e.defaultValue,r=[],o=t.getStyle("","","fontFamilies");return Array.isArray(o)&&o.length?r.push.apply(r,uy(new Set([i].concat(uy(o.map((function(e){return e.split(",").map((function(e){return e.trim()})).map((function(e){return e.replace(/\s+/g," ").trim()})).filter(Boolean).join(", ")}))))))):r.push(i),[{value:"ThemeHeader",label:n.get("properties.themeFonts"),metaText:n.get("properties.theme"),groupHeader:!0}].concat(uy(r.map((function(e){return mx(e)}))),[{value:"DefaultHeader",label:n.get("properties.allFonts"),metaText:n.get("properties.default"),groupHeader:!0}],uy(px.map((function(e){return mx(e)}))))}({theme:t,translator:n,defaultValue:o()})}}}var yx=["10px","11px","12px","13px","14px","15px","16px","17px","18px","19px","20px","21px","22px","23px","24px"],vx=function(e){return{value:e,label:e,groupHeader:!1,disabled:!1}};function bx(e){var t=e.theme,n=e.translator,i=e.id,r=e.path,o=function(){return t.getStyle(i,r,"fontSize")};return{getDefaultValue:function(){return o()},getOptions:function(){return function(e){var t=e.translator,n=e.defaultValue,i=[],r=e.theme.getStyle("","","fontSizes");return Array.isArray(r)&&r.length?i.push.apply(i,uy(new Set([n].concat(uy(r))))):i.push(n),[{value:"ThemeHeader",label:t.get("properties.themeFontSizes"),metaText:t.get("properties.theme"),groupHeader:!0}].concat(uy(i.map((function(e){return vx(e)}))),[{value:"DefaultHeader",label:t.get("properties.allFontSizes"),metaText:t.get("properties.default"),groupHeader:!0}],uy(yx.map((function(e){return vx(e)}))))}({theme:t,translator:n,defaultValue:o()})}}}function xx(e){var t=e.theme,n=e.translator,i=e.id,r=e.path;return{fontFamily:gx({theme:t,translator:n,id:i,path:r}),fontSize:bx({theme:t,translator:n,id:i,path:r})}}function wx(e){var t=e.theme,n=e.translator,i=e.config,r=function(e){var t=e.config,n=void 0===t?{}:t,i=n.id,r=n.paths;return{id:void 0===i?"object":"".concat("object",".").concat(i),paths:Array.isArray(r)?r:[]}}({config:void 0===i?{}:i}),o=r.id,s=r.paths,a={};s.forEach((function(e){for(var i=e.split("."),r=a,s=0;s<i.length;s++){var l=i[s];s===i.length-1?r[l]=xx({theme:t,translator:n,id:o,path:e}):void 0===r[l]&&(r[l]={}),r=r[l]}}));var l=function(e){for(var t=e.split("."),n=a,i=0;i<t.length;i++){var r=t[i];if(void 0===n[r])throw new Error("font-resolver: Path '".concat(e,"' could not be resolved."));n=n[r]}return n};return a.getDefaultValue=function(e){return l(e).getDefaultValue()},a.getOptions=function(e){return l(e).getOptions()},a}const qx=/xyz/.test((()=>{}))?/\b_super\b/:/.*/,Mx=function(){};function Dx(e,t,n,i){0===arguments.length?this.set(0,0,0,0):this.set(e,t,n,i)}Mx.extend=function e(t,n){const i=this.prototype;"string"!=typeof t&&(n=t,t="Class");const r=Object.create(this.prototype);for(const e in n)r[e]="function"==typeof n[e]&&"function"==typeof i[e]&&qx.test(n[e])?function(e,t){return function(){const n=this._super;this._super=i[e];const r=t.apply(this,arguments);return this._super=n,r}}(e,n[e]):n[e];if(!/^[_a-z][_a-z\d]*$/i.test(t))throw new Error("Invalid subclass name. Alphanumericals only.");const o=new Function(`return (function ${t}(){ typeof this.init === 'function' && this.init.apply(this, [].slice.call(arguments)) });`)();return o.prototype=r,o.prototype.constructor=o,o.extend=e,o},Dx.prototype={toString(){return`${this.x} ${this.y} ${this.width} ${this.height}`},clone(){return new Dx(this.x,this.y,this.width,this.height)},set(e,t,n,i){n>=0?(this.x=e,this.width=n):(this.x=e+n,this.width=-n),i>=0?(this.y=t,this.height=i):(this.y=t+i,this.height=-i)},setLTRB(e,t,n,i){e<=n?(this.x=e,this.width=n-e):(this.x=n,this.width=e-n),t<=i?(this.y=t,this.height=i-t):(this.y=i,this.height=t-i)},equal(e){return e&&this.x===e.x&&this.y===e.y&&this.width===e.width&&this.height===e.height},combineWith(e){const t=Math.max(e.getRight(),this.getRight()),n=Math.max(e.getBottom(),this.getBottom()),i=Math.min(e.x,this.x),r=Math.min(e.y,this.y);return new Dx(i,r,Math.max(0,t-i),Math.max(0,n-r))},intersectsWith(e){return!!e&&(this.x<=e.getRight()&&e.x<=this.getRight()&&this.y<=e.getBottom()&&e.y<=this.getBottom())},intersectsRect(e){return this.intersectsWith(e)},intersection(e,t){if(this.intersectsWith(e)){const t=Math.max(this.x,e.x),n=Math.max(this.y,e.y);return new Dx(t,n,Math.min(this.getRight(),e.getRight())-t,Math.min(this.getBottom(),e.getBottom())-n)}return t?null:new Dx(this.x,this.y,this.width,this.height)},union(e){const t=Math.min(this.x,e.x),n=Math.min(this.y,e.y);return new Dx(t,n,Math.max(this.getRight(),e.getRight())-t,Math.max(this.getBottom(),e.getBottom())-n)},pointInside(e,t){return e>=this.x&&e<=this.getRight()&&t>=this.y&&t<=this.getBottom()},rectInside(e){const t=e.getPoints();let n;for(n=0;n<4;n++)if(!this.pointInside(t[n].x,t[n].y))return!1;return!0},getPoints(){const e=[];return e.push({x:this.x,y:this.y}),e.push({x:this.getRight(),y:this.y}),e.push({x:this.getRight(),y:this.getBottom()}),e.push({x:this.x,y:this.getBottom()}),e},getRight(){return this.x+this.width},getBottom(){return this.y+this.height},getCenterPoint(){return{x:this.x+this.width/2,y:this.y+this.height/2}},getBoundingRect(){return this},scale(e){const t=e-1,n=t*this.width/2,i=t*this.height/2;this.x-=n,this.y-=i,this.width*=e,this.height*=e},hasNaN(){return Number.isNaN(+this.x)||Number.isNaN(+this.y)||Number.isNaN(+this.width)||Number.isNaN(+this.height)}};const Sx=new Dx(0,0,0,0),_x=new Dx(0,0,0,0),Cx=Mx.extend("CubeSlicer",{init(){this.pages=[]},get(e){return e.map((e=>this.getPage(e)))},getPage(e){let t,n;const i=[];let r;for(n=0;n<this.pages.length;n++)if(t=this.pages[n].qArea,Sx.set(e.qLeft,e.qTop,e.qWidth,e.qHeight),_x.set(t.qLeft,t.qTop,t.qWidth,t.qHeight),r=_x.intersection(Sx,!0),i.push({coverage:r?r.clone():new Dx(0,0,0,0),idx:n}),t.qLeft<=e.qLeft&&t.qLeft+t.qWidth>=e.qLeft+e.qWidth&&t.qTop<=e.qTop&&t.qTop+t.qHeight>=e.qTop+e.qHeight)return this._extract(e,this.pages[n]);return i.sort(((e,t)=>t.coverage.width*t.coverage.height-e.coverage.width*e.coverage.height)),i[0].coverage.height>0&&i[0].coverage.width>0?this._extract(e,this.pages[i[0].idx]):{qArea:{qTop:e.qTop,qLeft:e.qLeft,qWidth:0,qHeight:0},qMatrix:[]}},destroy(){this.clear()},isEmpty(){return!(this.pages&&this.pages[0]&&this.pages[0].qArea.qHeight&&this.pages[0].qArea.qWidth)},clear(){this.pages=[]},store(e){this.pages=e},containsArea(e){let t;for(let n=0;n<this.pages.length;n++)if(t=this.pages[n].qArea,t.qLeft<=e.qLeft&&t.qLeft+t.qWidth>=e.qLeft+e.qWidth&&t.qTop<=e.qTop&&t.qTop+t.qHeight>=e.qTop+e.qHeight)return!0;return!1},contains(e){return!(!this.pages||!this.pages.length)&&0===e.filter((e=>!this.containsArea(e))).length},_extract(e,t){Sx.set(e.qLeft,e.qTop,e.qWidth,e.qHeight),_x.set(t.qArea.qLeft,t.qArea.qTop,t.qArea.qWidth,t.qArea.qHeight);const n=Sx.intersection(_x,!0);if(!n)return{qArea:{qTop:e.qTop,qLeft:e.qLeft,qWidth:0,qHeight:0},qMatrix:[]};const i=Math.max(0,e.qTop-t.qArea.qTop),r=Math.max(0,e.qLeft-t.qArea.qLeft),o=t.qMatrix.slice(i,i+n.height).map((e=>e.slice(r,r+n.width)));return{qArea:{qTop:n.y,qLeft:n.x,qWidth:n.width,qHeight:n.height},qMatrix:o}}});let kx;function Ex(e,t){let n;const i={};for(n in e)"qSubNodes"!==n&&e.hasOwnProperty(n)&&(i[n]=e[n]);return t.push(i),i}function Ax(e,t,n){let i,r,o;const s=[];let a=[],l=0,c=0;for(n.length&&(l=n[0].qUp||0,c=n[n.length-1].qDown||0),i=0;i<n.length;++i)if(r=n[i],r.qSubNodes.length>0&&(a=Ax(e,t,r.qSubNodes)),o=null,(0===r.qSubNodes.length&&kx>=e&&kx<=e+t||a.length>0)&&(o=Ex(r,s),void 0!==o.qUp&&1===s.length&&(o.qUp=l+i),o.qSubNodes=a),0===r.qSubNodes.length&&kx++,kx===e+t){o&&void 0!==o.qDown&&(o.qDown=c+(n.length-1-i));break}return s}function Tx(e,t,n){return kx=0,Ax(e,t,n)}const Ix=new Dx(0,0,0,0),Rx=new Dx(0,0,0,0),Nx=Cx.extend("PivotCubeSlicer",{init(){this._super(),this.requestedAreas=[]},getPage(e){let t,n;const i=[];let r;for(n=0;n<this.pages.length;n++)if(t=this.pages[n].qArea,Ix.set(e.qLeft,e.qTop,e.qWidth,e.qHeight),Rx.set(t.qLeft,t.qTop,t.qWidth,t.qHeight),r=Rx.intersection(Ix,!0),i.push({coverage:r?r.clone():new Dx(0,0,0,0),idx:n}),t.qLeft<=e.qLeft&&t.qLeft+t.qWidth>=e.qLeft+e.qWidth&&t.qTop<=e.qTop&&t.qTop+t.qHeight>=e.qTop+e.qHeight)return this._extract(e,this.pages[n]);return i.sort(((e,t)=>t.coverage.width*t.coverage.height-e.coverage.width*e.coverage.height)),i[0].coverage.height>0&&i[0].coverage.width>0?this._extract(e,this.pages[i[0].idx]):{qLeft:[],qTop:[],qData:[],qArea:{qTop:e.qTop,qLeft:e.qLeft,qWidth:0,qHeight:0}}},_extract(e,t){Ix.set(e.qLeft,e.qTop,e.qWidth,e.qHeight),Rx.set(t.qArea.qLeft,t.qArea.qTop,t.qArea.qWidth,t.qArea.qHeight);const n=Ix.intersection(Rx,!0);if(!n)return{qLeft:[],qTop:[],qData:[],qArea:{qTop:e.qTop,qLeft:e.qLeft,qWidth:0,qHeight:0}};const i=Math.max(0,e.qTop-t.qArea.qTop),r=Math.max(0,e.qLeft-t.qArea.qLeft),o=t.qData.slice(i,i+n.height).map((e=>e.slice(r,r+n.width)));return{qLeft:Tx(i,n.height,t.qLeft),qTop:Tx(r,n.width,t.qTop),qData:o,qArea:{qTop:n.y,qLeft:n.x,qWidth:n.width,qHeight:n.height}}}});function Ox(e){if("pivot-table"===e.visualization)this.responseProperty="qPivotDataPages",this.slicer=new Nx;else{if("table"!==e.visualization)return;this.slicer=new Cx}let t=e.snapshotData.object.origDataPages;t||(t=e.qHyperCube[this.responseProperty]),this.slicer.store(t.filter((e=>e)))}class Px{constructor(e,t,n){this.layout=e,this.dataPath=t,this.responseProperty=n,Ox.call(this,e)}getData(e){!function(e,t,n,i){if(e){t.snapshotData.object.origDataPages||(t.snapshotData.object.origDataPages=t.qHyperCube[i]);for(let e=0;e<n.length;e++)n[e].qHeight=Math.min(t.qHyperCube.qSize.qcy,n[e].qHeight),n[e].qTop=t.snapshotData.object.origDataPages[e].qArea.qTop;t.qHyperCube[i]=e.get(n)}}(this.slicer,this.layout,e,this.responseProperty);const t=Rb(this.layout,`${this.dataPath}.${this.responseProperty}`);return Promise.resolve(t)}setCacheOptions(){}updateCache(){}}const Lx={version:"0.38.1",qHyperCubeDef:{qDimensions:[],qMeasures:[],qMode:"K",qAlwaysFullyExpanded:!0,qSuppressZero:!1,qSuppressMissing:!0},color:{box:{paletteColor:{index:-1,color:"#e6e6e6"}},expressionLabel:"",point:{auto:!0,mode:"primary",useBaseColors:"off",expressionIsColor:!0}},dataPoint:{bubbleScales:100,displacement:"none"},dimensionAxis:{dock:"near",label:"auto",show:"all"},measureAxis:{autoMinMax:!0,dock:"near",max:10,min:0,minMax:"min",show:"all",spacing:1},gridlines:{auto:!0,spacing:2},orientation:"horizontal",presentation:{visibleComponents:"points_box"},refLine:{refLines:[]},sorting:{autoSort:!0},showTitles:!0,subtitle:"",title:"",footnote:""};function Fx(e){2===e.qHyperCubeDef.qInterColumnSortOrder.length?e.qHyperCubeDef.qInterColumnSortOrder=[1,0]:3===e.qHyperCubeDef.qInterColumnSortOrder.length&&(e.qHyperCubeDef.qInterColumnSortOrder=[1,2,0])}function zx(e){e.qHyperCubeDef.qDimensions.length>1&&e.color&&(e.color.point.persistent=!0)}function jx(e){const{translator:t}=e,n={min:1,max:2,description(e,n){let i;return i=0===n?"Visualizations.Descriptions.Point":"horizontal"===e.orientation?"properties.yAxis":"properties.xAxis",t.get(i)},added(e,t){Fx(t),zx(t)},moved(e,t){Fx(t),zx(t)},removed(e,t){Fx(t),zx(t)}},i={min:1,max:1,description(e){const n="horizontal"===e.orientation?"properties.xAxis":"properties.yAxis";return t.get(n)}};return{path:"/qHyperCubeDef",dimensions:n,measures:i}}var Hx={},Bx={get exports(){return Hx},set exports(e){Hx=e}};!function(e,t){window,e.exports=function(e){var t={};function n(i){if(t[i])return t[i].exports;var r=t[i]={i:i,l:!1,exports:{}};return e[i].call(r.exports,r,r.exports,n),r.l=!0,r.exports}return n.m=e,n.c=t,n.d=function(e,t,i){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:i})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var i=Object.create(null);if(n.r(i),Object.defineProperty(i,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var r in e)n.d(i,r,function(t){return e[t]}.bind(null,r));return i},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="/conversion/",n(n.s=2)}([function(e,t,n){var i=Object.prototype.hasOwnProperty,r=Object.prototype.toString,o=Object.defineProperty,s=Object.getOwnPropertyDescriptor,a=function(e){return"function"==typeof Array.isArray?Array.isArray(e):"[object Array]"===r.call(e)},l=function(e){if(!e||"[object Object]"!==r.call(e))return!1;var t,n=i.call(e,"constructor"),o=e.constructor&&e.constructor.prototype&&i.call(e.constructor.prototype,"isPrototypeOf");if(e.constructor&&!n&&!o)return!1;for(t in e);return void 0===t||i.call(e,t)},c=function(e,t){o&&"__proto__"===t.name?o(e,t.name,{enumerable:!0,configurable:!0,value:t.newValue,writable:!0}):e[t.name]=t.newValue},u=function(e,t){if("__proto__"===t){if(!i.call(e,t))return;if(s)return s(e,t).value}return e[t]};e.exports=function e(){var t,n,i,r,o,s,h=arguments[0],d=1,f=arguments.length,p=!1;for("boolean"==typeof h&&(p=h,h=arguments[1]||{},d=2),(null==h||"object"!=typeof h&&"function"!=typeof h)&&(h={});d<f;++d)if(null!=(t=arguments[d]))for(n in t)i=u(h,n),h!==(r=u(t,n))&&(p&&r&&(l(r)||(o=a(r)))?(o?(o=!1,s=i&&a(i)?i:[]):s=i&&l(i)?i:{},c(h,{name:n,newValue:e(p,s,r)})):void 0!==r&&c(h,{name:n,newValue:r}));return h}},function(e,t,n){e.exports=function(e){var t={};function n(i){if(t[i])return t[i].exports;var r=t[i]={i:i,l:!1,exports:{}};return e[i].call(r.exports,r,r.exports,n),r.l=!0,r.exports}return n.m=e,n.c=t,n.d=function(e,t,i){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:i})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var i=Object.create(null);if(n.r(i),Object.defineProperty(i,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var r in e)n.d(i,r,function(t){return e[t]}.bind(null,r));return i},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="/qlik-modifiers/",n(n.s=1)}([function(e,t,n){var i=Object.prototype.hasOwnProperty,r=Object.prototype.toString,o=Object.defineProperty,s=Object.getOwnPropertyDescriptor,a=function(e){return"function"==typeof Array.isArray?Array.isArray(e):"[object Array]"===r.call(e)},l=function(e){if(!e||"[object Object]"!==r.call(e))return!1;var t,n=i.call(e,"constructor"),o=e.constructor&&e.constructor.prototype&&i.call(e.constructor.prototype,"isPrototypeOf");if(e.constructor&&!n&&!o)return!1;for(t in e);return void 0===t||i.call(e,t)},c=function(e,t){o&&"__proto__"===t.name?o(e,t.name,{enumerable:!0,configurable:!0,value:t.newValue,writable:!0}):e[t.name]=t.newValue},u=function(e,t){if("__proto__"===t){if(!i.call(e,t))return;if(s)return s(e,t).value}return e[t]};e.exports=function e(){var t,n,i,r,o,s,h=arguments[0],d=1,f=arguments.length,p=!1;for("boolean"==typeof h&&(p=h,h=arguments[1]||{},d=2),(null==h||"object"!=typeof h&&"function"!=typeof h)&&(h={});d<f;++d)if(null!=(t=arguments[d]))for(n in t)i=u(h,n),h!==(r=u(t,n))&&(p&&r&&(l(r)||(o=a(r)))?(o?(o=!1,s=i&&a(i)?i:[]):s=i&&l(i)?i:{},c(h,{name:n,newValue:e(p,s,r)})):void 0!==r&&c(h,{name:n,newValue:r}));return h}},function(e,t,n){n.r(t);var i=n(0),r=n.n(i),o=function(e,t,n){if(!t)return!1;var i,r=t.split("."),o=r[r.length-1],s=e;for(i=0;i<r.length-1;++i)void 0===s[r[i]]&&(s[r[i]]=Number.isNaN(+r[i+1])?{}:[]),s=s[r[i]];if(void 0!==n){var a=s[o];return s[o]=n,{updated:n,previous:a}}return delete s[o],!1},s=function(e,t,n){var i,r=t.split("."),o=e;if(void 0===o)return n;for(i=0;i<r.length;++i){if(void 0===o[r[i]])return n;o=o[r[i]]}return o},a="".concat(" ","(").concat(" "),l="".concat(" ",")").concat(" ");function c(e){return a+e+l}function u(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(e.qLibraryId){var n=function(e,t){if(!t)return null;var n,i;for(n=0;n<t.length;n++)if((i=t[n]).qInfo.qId===e)return i;return null}(e.qLibraryId,t.dimensionList);return n&&n.qData.info[0].qTags.indexOf("$numeric")>-1}var i=function(e,t){if(!t)return null;var n,i,r=function(e){var t=e.trim();"="===t.charAt(0)&&(t=(t=t.substring(1)).trim());var n=t.length-1;return"["===t.charAt(0)&&"]"===t.charAt(n)&&(t=(t=t.substring(1,n)).trim()),t}(e);for(n=0;n<t.length;n++){if((i=t[n]).qName===r)return i;if(i.qDerivedFieldData)for(var o=0;o<i.qDerivedFieldData.qDerivedFieldLists.length;++o)for(var s=i.qDerivedFieldData.qDerivedFieldLists[o],a=0;a<s.qFieldDefs.length;++a){var l=s.qFieldDefs[a];if(l.qName===r)return l}}return null}(e.qDef.qFieldDefs[0],t.fieldList);return i&&i.qTags.indexOf("$numeric")>-1}function h(e){return!(!e.fullAccumulation&&!e.fullRange)}function d(e,t){var n=e.crossAllDimensions;return 2===t&&n?"RowNo(Total)":"RowNo()"}function f(e){var t=function(e){return e?(e=function(e){return e.replace(/\/\*[^]*?\*\//g,"")}(e=function(e){return e.replace(/\/\/(.*)$/gm,"")}(e))).trim():""}(e).trim();return"="===t.substring(0,1)?t.substring(1).trim():t}function p(){return"[$(=Replace(GetObjectField(".concat(arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,"),']',']]'))]")}function m(e,t){var n=e.crossAllDimensions;return 2===t&&n?"Above(Total ":"Above("}function g(e){return void 0===e?")":", 0, ".concat(e,")")}function y(e,t){return e?"".concat(t,'={">=$(=Min(').concat(t,"))<=$(=Max(").concat(t,'))"}'):"".concat(t,'={"=Only({1}').concat(t,")>='$(=MinString(").concat(t,"))' and Only({1}").concat(t,")<='$(=MaxString(").concat(t,"))'\"}")}function v(e){var t=e.modifier,n=void 0===t?{}:t,i=e.dimensions,r=e.dimensionAndFieldList,o=e.funcComp,s=void 0===o?"Sum":o,a=e.valueComp,l=void 0===a?"0":a;if(!n.showExcludedValues)return"";if(i&&1===i.length){var c=y(u(i[0],r),p(0));return"".concat(s,"({1<").concat(c,">}").concat(l,")")}if(i&&2===i.length){var h=u(i[0],r),d=u(i[1],r),f=p(0),m=p(1),g=y(h,f),v=y(d,m);return"".concat(s,"({1<").concat(g,",").concat(v,">}").concat(l,")")}return"".concat(s,"({1}").concat(l,")")}function b(e){return"".concat(e,"(")}function x(e){var t=e.properties,n=e.layout;return s(t,"qHyperCubeDef.qDimensions",s(n,"qHyperCube.qDimensionInfo",[])).length}var w={isFullRange:h,getNumDimensions:x,getExpressionWithExcludedComp:function(e){var t=e.expression,n=e.modifier,i=e.dimensions,r=e.dimensionAndFieldList,o=e.treatMissingAsNull,s=c(f(t));if(!n.showExcludedValues)return s;var a=v({modifier:n,dimensions:i,dimensionAndFieldList:r}),l=o?"":", 0";if(i&&1===i.length){var u=p(0);return"If(Count(".concat(u,") > 0, ").concat(s," + ").concat(a).concat(l,")")}if(i&&2===i.length){var h=p(0),d=p(1);return"If(Count(".concat(h,") * Count(").concat(d,") > 0, ").concat(s," + ").concat(a).concat(l,")")}return s},getRowNoComp:d,getNumStepComp:function(e,t){if(!h(e)){var n=e.steps;return"number"!=typeof n||Number.isNaN(n)?6:n}return d(e,t)},getAboveCompPrefix:m,getAboveCompSuffix:g,getAboveComp:function(e,t,n,i){return m(e,t)+n+g(i)},getFunctionPrefix:b,getFunctionSuffix:function(){return")"},getRangeComp:function(e,t){return b(e)+t+")"},getAggrComp:function(e,t,n){return"Aggr(".concat(e,", ").concat(t,", ").concat(n,")")},getExcludedComp:v,needDimension:function(e){var t=e.modifier,n=e.properties,i=e.layout;return 0===function(e){return void 0===e.primaryDimension?e.accumulationDimension:e.primaryDimension}(t)&&2===x({properties:n,layout:i})},getDimComp:function(e,t){var n=function(e){return e[arguments.length>1&&void 0!==arguments[1]?arguments[1]:0].qDef.qSortCriterias[0]}(e,t),i=p(t);if(!n.qSortByExpression&&!n.qSortByNumeric&&!n.qSortByAscii)return i;var r=["Descending","Ascending"],o=n.qSortByNumeric?"(Numeric, ".concat(r[(n.qSortByNumeric+1)/2],")"):"",s=n.qSortByAscii?"(Text, ".concat(r[(n.qSortByAscii+1)/2],")"):"";return n.qSortByNumeric&&n.qSortByAscii?"(".concat(i,", ").concat(o,", ").concat(s,")"):n.qSortByNumeric?"(".concat(i,", ").concat(o,")"):n.qSortByAscii?"(".concat(i,", ").concat(s,")"):i},simplifyExpression:f,extractInputExpression:function(e){var t=e.outputExpression;if(e.modifier){var n=t.indexOf(a);if(-1!==n){var i=t.indexOf(l);if(-1!==i)return t.substring(n+a.length,i)}}},initModifier:function(e,t){Object.keys(t).forEach((function(n){void 0===e[n]&&(e[n]=t[n])}))},isNumeric:u,isApplicable:function(e){var t=e.properties,n=e.layout,i=e.minDimensions,r=void 0===i?1:i,o=e.maxDimensions,s=void 0===o?2:o;if(!t&&!n)return!0;var a=x({properties:t,layout:n});return a>=r&&a<=s},getExpressionWithMarkers:c,canExtract:function(e){var t=e.indexOf(a),n=e.indexOf(l);return t>-1&&n>-1&&t<n},getDimDefWithWrapper:p,getFieldWithWrapper:function(e){var t=e?e.replace(/]/g,"]]"):e;return"[".concat(t,"]")}};function q(e){return(q="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}var M=r.a.bind(null,!0),D={},S=Array.isArray;function _(e){return null!=e&&!Array.isArray(e)&&"object"===q(e)}function C(e){return void 0===e}function k(e,t){return"function"==typeof e[t]||"$$"===t.substring(0,2)||"_"===t.substring(0,1)}function E(e,t){var n,i=t.substring(1).split("/").slice(0,-1);return i.forEach((function(t,r){if(r!==i.length){n=+t;var o=Number.isNaN(n)?{}:[];e[n||t]=C(e[n||t])?o:e[t],e=e[n||t]}})),e}function A(e,t){var n=!0;if(_(e)&&_(t))return Object.keys(e).length===Object.keys(t).length&&(Object.keys(e).forEach((function(i){A(e[i],t[i])||(n=!1)})),n);if(S(e)&&S(t)){if(e.length!==t.length)return!1;for(var i=0,r=e.length;i<r;i+=1)if(!A(e[i],t[i]))return!1;return!0}return e===t}D.generate=function(e,t,n){n=n||"";var i=[];return Object.keys(t).forEach((function(r){var o=function(e){return e?M({},{val:e}).val:e}(t[r]),s=e[r],a="".concat(n,"/").concat(r);A(o,s)||k(t,r)||(C(s)?i.push({op:"add",path:a,value:o}):_(o)&&_(s)?i=i.concat(D.generate(s,o,a)):S(o)&&S(s)?i=i.concat(function(e,t,n){var i=[],r=e.slice(),o=-1;function s(e,t,n){if(e[n]&&C(e[n].qInfo))return null;if(e[n]&&e[n].qInfo.qId===t)return n;for(var i=0,r=e.length;i<r;i+=1)if(e[i]&&e[i].qInfo.qId===t)return i;return-1}if(A(t,r))return i;if(!C(t[0])&&C(t[0].qInfo))return i.push({op:"replace",path:n,value:t}),i;for(var a=r.length-1;a>=0;a-=1)-1===(o=s(t,r[a].qInfo&&r[a].qInfo.qId,a))?(i.push({op:"remove",path:"".concat(n,"/").concat(a)}),r.splice(a,1)):i=i.concat(D.generate(r[a],t[o],"".concat(n,"/").concat(a)));for(var l=0,c=t.length;l<c;l+=1)-1===(o=s(r,t[l].qInfo&&t[l].qInfo.qId))?(i.push({op:"add",path:"".concat(n,"/").concat(l),value:t[l]}),r.splice(l,0,t[l])):o!==l&&(i.push({op:"move",path:"".concat(n,"/").concat(l),from:"".concat(n,"/").concat(o)}),r.splice(l,0,r.splice(o,1)[0]));return i}(s,o,a)):i.push({op:"replace",path:"".concat(n,"/").concat(r),value:o}))})),Object.keys(e).forEach((function(r){C(t[r])&&!k(e,r)&&i.push({op:"remove",path:"".concat(n,"/").concat(r)})})),i},D.apply=function(e,t){t.forEach((function(t){var n,i=E(e,t.path),r=t.path.split("/").splice(-1)[0],o=r&&Number.isNaN(+r)?i[r]:i[+r]||i,s=t.from?t.from.split("/").splice(-1)[0]:null;if("/"===t.path&&(i=null,o=e),"add"===t.op||"replace"===t.op)if(S(i))"-"===r&&(r=i.length),i.splice(+r,"add"===t.op?0:1,t.value);else if(S(o)&&S(t.value)){var a,l=t.value.slice();o.length=0,(a=o).push.apply(a,function(e){return function(e){if(Array.isArray(e)){for(var t=0,n=new Array(e.length);t<e.length;t++)n[t]=e[t];return n}}(e)||function(e){if(Symbol.iterator in Object(e)||"[object Arguments]"===Object.prototype.toString.call(e))return Array.from(e)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance")}()}(l))}else if(_(o)&&_(t.value))n=o,Object.keys(n).forEach((function(e){Object.getOwnPropertyDescriptor(n,e).configurable&&!k(n,e)&&delete n[e]})),M(o,t.value);else{if(!i)throw new Error("Patchee is not an object we can patch");i[r]=t.value}else if("move"===t.op){var c=E(e,t.from);S(i)?i.splice(+r,0,c.splice(+s,1)[0]):(i[r]=c[s],delete c[s])}else"remove"===t.op&&(S(i)?i.splice(+r,1):delete i[r])}))},D.clone=function(e){return M({},e)},D.createPatch=function(e,t,n){var i={op:e.toLowerCase(),path:n};return"move"===i.op?i.from=t:void 0!==t&&(i.value=t),i},D.updateObject=function(e,t){Object.keys(e).length?D.apply(e,D.generate(e,t)):M(e,t)};var T=D,I=function(e,t,n){if(!e)return Promise.resolve();var i=T.generate(t,n);return r()(!0,t,n),i&&i.length?(i=i.map((function(e){return{qOp:e.op,qValue:JSON.stringify(e.value),qPath:e.path}})),e.applyPatches(i,!0)):Promise.resolve()},R="accumulation";function N(e,t){var n=s(e,t);if(n)for(var i=0;i<n.length;i++)if(n[i].type===R)return n[i]}function O(e,t){var n=function(e,t){var n=s(e,t);if(!n)return-1;for(var i=0;i<n.length;i++)if(n[i].type===R)return i;return-1}(e,t);return n>-1?"".concat(t,".").concat(n):t}var P={type:"accumulation",disabled:!1,accumulationDimension:0,crossAllDimensions:!1,showExcludedValues:!0,fullAccumulation:!1,steps:6,outputExpression:""},L={translationKey:"properties.modifier.accumulation",needDimension:w.needDimension,isApplicable:function(e){var t=e.properties,n=e.layout;return w.isApplicable({properties:t,layout:n,minDimensions:1,maxDimensions:2})},generateExpression:function(e){var t=e.expression,n=e.modifier,i=e.properties,r=e.layout,o=e.numDimensions,a=e.dimensionAndFieldList;if(!n)return t;var l=o;void 0===l&&(l=w.getNumDimensions({properties:i,layout:r}));var c=s(i,"qHyperCubeDef.qDimensions",[]),u=w.getExpressionWithExcludedComp({expression:t,modifier:n,dimensions:c,dimensionAndFieldList:a}),h=w.getNumStepComp(n,l),d=w.getAboveComp(n,l,u,h),f=w.getRangeComp("RangeSum",d);if(w.needDimension({modifier:n,properties:i,layout:r})){var p=w.getDimComp(c,1),m=w.getDimComp(c,0),g=w.getAggrComp(f,p,m);f=n.showExcludedValues?w.getExcludedComp({modifier:n,dimensions:c,dimensionAndFieldList:a,valueComp:g}):g}return f},extractInputExpression:w.extractInputExpression,initModifier:function(e){w.initModifier(e,P)},enableTotalsFunction:function(){return!1},propertyPanelDef:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n={type:"items",items:{disclaimer:{component:"text",translation:t.disclaimer||"properties.modifier.accumulation.disclaimer",show:function(e,t){return!w.isApplicable({properties:t.properties})}},settings:{type:"items",items:{primaryDimension:{refFn:function(t){return"".concat(O(t,e),".accumulationDimension")},type:"integer",translation:t.primaryDimension||"properties.modifier.primaryDimension",title:{translation:t.primaryDimensionTooltip||"properties.modifier.accumulation.primaryDimension.tooltip"},component:"dropdown",schemaIgnore:!0,defaultValue:1,options:function(e,t){return t.layout.qHyperCube.qDimensionInfo.map((function(e,t){return{value:t,label:e.qGroupFallbackTitles[0]}}))},show:function(e,t){return t.layout.qHyperCube.qDimensionInfo.length>1}},crossAllDimensions:{refFn:function(t){return"".concat(O(t,e),".crossAllDimensions")},type:"boolean",translation:t.crossAllDimensions||"properties.modifier.crossAllDimensions",title:{translation:t.crossAllDimensionsTooltip||"properties.modifier.accumulation.crossAllDimensions.tooltip"},schemaIgnore:!0,defaultValue:!1,show:function(e,t){return t.layout.qHyperCube.qDimensionInfo.length>1}},fullRange:{refFn:function(t){return"".concat(O(t,e),".fullAccumulation")},type:"boolean",translation:t.range||"properties.modifier.range",component:"dropdown",schemaIgnore:!0,defaultValue:!1,options:[{value:!0,translation:t.rangeFull||"properties.modifier.range.full"},{value:!1,translation:t.rangeCustom||"properties.modifier.range.custom"}]},steps:{refFn:function(t){return"".concat(O(t,e),".steps")},type:"integer",translation:t.rangeSteps||"properties.modifier.range.steps",schemaIgnore:!0,defaultValue:6,change:function(t){var n=N(t,e);if(n){var i=n.steps;n.steps="number"!=typeof i||Number.isNaN(i)?6:Math.abs(i)}},show:function(t){var n=N(t,e);return n&&!n.fullAccumulation}},showExcludedValues:{refFn:function(t){return"".concat(O(t,e),".showExcludedValues")},type:"boolean",translation:t.showExcludedValues||"properties.modifier.showExcludedValues",schemaIgnore:!0,defaultValue:!0}},show:function(e,t){return w.isApplicable({properties:t.properties})}}},show:function(t,n,i){var r=i.ext.support.modifiers;if(!Array.isArray(r)||-1===r.indexOf(R))return!1;var o=N(t,e);return o&&!o.disabled}};return n}},F="movingAverage";function z(e,t){var n=s(e,t);if(n)for(var i=0;i<n.length;i++)if(n[i].type===F)return n[i]}function j(e,t){var n=function(e,t){var n=s(e,t);if(!n)return-1;for(var i=0;i<n.length;i++)if(n[i].type===F)return i;return-1}(e,t);return n>-1?"".concat(t,".").concat(n):t}var H={type:"movingAverage",disabled:!1,primaryDimension:0,crossAllDimensions:!1,showExcludedValues:!0,fullRange:!1,steps:6,outputExpression:"",nullSuppression:!1},B={translationKey:"properties.modifier.movingAverage",needDimension:w.needDimension,isApplicable:function(e){var t=e.properties,n=e.layout;return w.isApplicable({properties:t,layout:n,minDimensions:1,maxDimensions:2})},generateExpression:function(e){var t,n=e.expression,i=e.modifier,r=e.properties,o=e.layout,a=e.numDimensions,l=e.dimensionAndFieldList;if(!i)return n;var c=a;void 0===c&&(c=w.getNumDimensions({properties:r,layout:o}));var u=s(r,"qHyperCubeDef.qDimensions",[]),h=i.showExcludedValues&&i.nullSuppression,d=w.getExpressionWithExcludedComp({expression:n,modifier:i,dimensions:u,dimensionAndFieldList:l,treatMissingAsNull:h}),f=w.getNumStepComp(i,c),p=w.getAboveComp(i,c,d,f);if(i.nullSuppression)t=w.getRangeComp("RangeAvg",p);else{var m=w.getRangeComp("RangeSum",p),g=function(e,t){var n=w.getRowNoComp(e,t);if(!w.isFullRange(e)){var i=e.steps,r="number"!=typeof i||Number.isNaN(i)?6:i;return"RangeMin(".concat(r,", ").concat(n,")")}return n}(i,c);t="".concat(m," / ").concat(g)}var y=t;if(w.needDimension({modifier:i,properties:r,layout:o})){var v=w.getDimComp(u,1),b=w.getDimComp(u,0),x=w.getAggrComp(y,v,b);y=i.showExcludedValues?w.getExcludedComp({modifier:i,dimensions:u,dimensionAndFieldList:l,funcComp:"Only",valueComp:x}):x}return y},extractInputExpression:w.extractInputExpression,initModifier:function(e){w.initModifier(e,H)},enableTotalsFunction:function(){return!1},propertyPanelDef:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n={type:"items",items:{disclaimer:{component:"text",translation:t.disclaimer||"properties.modifier.movingAverage.disclaimer",show:function(e,t){return!w.isApplicable({properties:t.properties})}},settings:{type:"items",items:{primaryDimension:{refFn:function(t){return"".concat(j(t,e),".primaryDimension")},type:"integer",translation:t.primaryDimension||"properties.modifier.primaryDimension",title:{translation:t.primaryDimensionTooltip||"properties.modifier.movingAverage.primaryDimension.tooltip"},component:"dropdown",schemaIgnore:!0,defaultValue:1,options:function(e,t){return t.layout.qHyperCube.qDimensionInfo.map((function(e,t){return{value:t,label:e.qGroupFallbackTitles[0]}}))},show:function(e,t){return t.layout.qHyperCube.qDimensionInfo.length>1}},crossAllDimensions:{refFn:function(t){return"".concat(j(t,e),".crossAllDimensions")},type:"boolean",translation:t.crossAllDimensions||"properties.modifier.crossAllDimensions",title:{translation:t.crossAllDimensionsTooltip||"properties.modifier.movingAverage.crossAllDimensions.tooltip"},schemaIgnore:!0,defaultValue:!1,show:function(e,t){return t.layout.qHyperCube.qDimensionInfo.length>1}},fullRange:{refFn:function(t){return"".concat(j(t,e),".fullRange")},type:"boolean",translation:t.range||"properties.modifier.range",component:"dropdown",schemaIgnore:!0,defaultValue:!1,options:[{value:!0,translation:t.rangeFull||"properties.modifier.range.full"},{value:!1,translation:t.rangeCustom||"properties.modifier.range.custom"}]},steps:{refFn:function(t){return"".concat(j(t,e),".steps")},type:"integer",translation:t.rangeSteps||"properties.modifier.range.steps",schemaIgnore:!0,defaultValue:6,change:function(t){var n=z(t,e);if(n){var i=n.steps;n.steps="number"!=typeof i||Number.isNaN(i)?6:Math.abs(i)}},show:function(t){var n=z(t,e);return n&&!n.fullRange}},showExcludedValues:{refFn:function(t){return"".concat(j(t,e),".showExcludedValues")},type:"boolean",translation:t.showExcludedValues||"properties.modifier.showExcludedValues",schemaIgnore:!0,defaultValue:!0},nullSuppression:{refFn:function(t){return"".concat(j(t,e),".nullSuppression")},type:"boolean",translation:t.showNull||"properties.dimensions.showNull",schemaIgnore:!0,defaultValue:!1,inverted:!0}},show:function(e,t){return w.isApplicable({properties:t.properties})}}},show:function(t,n,i){var r=i.ext.support.modifiers;if(!Array.isArray(r)||-1===r.indexOf(F))return!1;var o=z(t,e);return o&&!o.disabled}};return n}},V="difference";function $(e,t){var n=s(e,t);if(n)for(var i=0;i<n.length;i++)if(n[i].type===V)return n[i]}function W(e,t){var n=function(e,t){var n=s(e,t);if(!n)return-1;for(var i=0;i<n.length;i++)if(n[i].type===V)return i;return-1}(e,t);return n>-1?"".concat(t,".").concat(n):t}var U={type:"difference",disabled:!1,primaryDimension:0,crossAllDimensions:!1,showExcludedValues:!0,outputExpression:""},Y={translationKey:"properties.modifier.difference",needDimension:w.needDimension,isApplicable:function(e){var t=e.properties,n=e.layout;return w.isApplicable({properties:t,layout:n,minDimensions:1,maxDimensions:2})},extractInputExpression:w.extractInputExpression,generateExpression:function(e){var t=e.expression,n=e.modifier,i=e.properties,r=e.layout,o=e.numDimensions,a=e.dimensionAndFieldList;if(!n)return t;var l=o;void 0===l&&(l=w.getNumDimensions({properties:i,layout:r}));var c=s(i,"qHyperCubeDef.qDimensions",[]),u=w.getExpressionWithExcludedComp({expression:t,modifier:n,dimensions:c,dimensionAndFieldList:a}),h=w.getAboveComp(n,l,u),d="".concat(u," - ").concat(h);if(w.needDimension({modifier:n,properties:i,layout:r})){var f=w.getDimComp(c,1),p=w.getDimComp(c,0),m=w.getAggrComp(d,f,p);d=n.showExcludedValues?w.getExcludedComp({modifier:n,dimensions:c,dimensionAndFieldList:a,funcComp:"Only",valueComp:m}):m}return d},initModifier:function(e){Object.keys(U).forEach((function(t){void 0===e[t]&&(e[t]=U[t])}))},enableTotalsFunction:function(){return!1},propertyPanelDef:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n={type:"items",items:{disclaimer:{component:"text",translation:t.disclaimer||"properties.modifier.difference.disclaimer",show:function(e,t){return!w.isApplicable({properties:t.properties})}},settings:{type:"items",items:{primaryDimension:{refFn:function(t){return"".concat(W(t,e),".primaryDimension")},type:"integer",translation:t.primaryDimension||"properties.modifier.primaryDimension",title:{translation:t.primaryDimensionTooltip||"properties.modifier.difference.primaryDimension.tooltip"},component:"dropdown",schemaIgnore:!0,defaultValue:1,options:function(e,t){return t.layout.qHyperCube.qDimensionInfo.map((function(e,t){return{value:t,label:e.qGroupFallbackTitles[0]}}))},show:function(e,t){return t.layout.qHyperCube.qDimensionInfo.length>1}},crossAllDimensions:{refFn:function(t){return"".concat(W(t,e),".crossAllDimensions")},type:"boolean",translation:t.crossAllDimensions||"properties.modifier.crossAllDimensions",title:{translation:t.crossAllDimensionsTooltip||"properties.modifier.difference.crossAllDimensions.tooltip"},schemaIgnore:!0,defaultValue:!1,show:function(e,t){return t.layout.qHyperCube.qDimensionInfo.length>1}},showExcludedValues:{refFn:function(t){return"".concat(W(t,e),".showExcludedValues")},type:"boolean",translation:t.showExcludedValues||"properties.modifier.showExcludedValues",schemaIgnore:!0,defaultValue:!0}},show:function(e,t){return w.isApplicable({properties:t.properties})}}},show:function(t,n,i){var r=i.ext.support.modifiers;if(!Array.isArray(r)||-1===r.indexOf(V))return!1;var o=$(t,e);return o&&!o.disabled}};return n}},X={CURRENT_SELECTION:0,SELECT_FIELD_VALUE:1,DISREGARD_SELECTION:2},K={ONE_DIMENSION:0,ALL_DIMENSIOANS:1,DISREGARD_ALL_DIMENSIONS:2},G="normalization";function J(e,t){var n=s(e,t);if(n)for(var i=0;i<n.length;i++)if(n[i].type===G)return n[i]}function Z(e,t){var n=function(e,t){var n=s(e,t);if(!n)return-1;for(var i=0;i<n.length;i++)if(n[i].type===G)return i;return-1}(e,t);return n>-1?"".concat(t,".").concat(n):t}function Q(e,t){for(var n=0;n<e.length;n++)if(e[n].value===t)return n;return-1}function ee(e,t,n,i){var r=t.layout.qHyperCube.qDimensionInfo.length,o=[{value:K.ONE_DIMENSION,translation:n.dimensionalScopeOneDimension||"properties.modifier.dimensionalScope.respectOneDimension",tooltipTranslation:n.dimensionalScopeOneDimensionTooltip||"properties.modifier.dimensionalScope.respectOneDimension.tooltip"},{value:K.ALL_DIMENSIOANS,translation:n.dimensionalScopeAllDimensions||"properties.modifier.dimensionalScope.".concat(2===r?"respectAllDimensions":"respectDimension"),tooltipTranslation:n.dimensionalScopeAllDimensionsTooltip||"properties.modifier.dimensionalScope.".concat(2===r?"respectAllDimensions":"respectDimension",".tooltip")},{value:K.DISREGARD_ALL_DIMENSIONS,translation:n.dimensionalScopeDisregardAllDimensions||"properties.modifier.dimensionalScope.".concat(2===r?"disregardAllDimensions":"disregardDimension"),tooltipTranslation:n.dimensionalScopeDisregardAllDimensionsTooltip||"properties.modifier.dimensionalScope.".concat(2===r?"disregardAllDimensions":"disregardDimension",".tooltip")}];return o=function(e,t,n){if(e<2){var i=Q(t,0);t.splice(i,1)}return t}(r,o),function(e,t,n){if(0===e){var i=Q(t,1);t.splice(i,1)}return t}(J(e,i).selectionScope,o)}function te(e,t,n){var i=[{value:X.CURRENT_SELECTION,translation:t.selectionScopeCurrentSelection||"properties.modifier.selectionScope.currentSelection"},{value:X.SELECT_FIELD_VALUE,translation:t.selectionScopeSpecificValue||"properties.modifier.selectionScope.selectAField"},{value:X.DISREGARD_SELECTION,translation:t.selectionScopeTotal||"properties.modifier.selectionScope.total"}];return function(e,t,n){if(1===e){var i=Q(t,0);t.splice(i,1)}return t}(J(e,n).dimensionalScope,i)}var ne={type:"normalization",disabled:!1,primaryDimension:0,outputExpression:"",dimensionalScope:K.DISREGARD_ALL_DIMENSIONS,selectionScope:X.DISREGARD_SELECTION};function ie(e){return 2===e?"{1}":""}function re(e,t,n){return 1===e?"{$<".concat(w.getFieldWithWrapper(t),"={'").concat(n,"'}>}"):""}function oe(e,t){return 0===e&&t>1||2===e?"Total":""}function se(e,t,n){return 0===e&&t>1?"<".concat(w.getDimDefWithWrapper(n),">"):""}var ae={translationKey:"properties.modifier.normalization",needDimension:function(){return!0},isApplicable:function(e){var t=e.properties,n=e.layout;return w.isApplicable({properties:t,layout:n,minDimensions:1,maxDimensions:2})},extractInputExpression:w.extractInputExpression,generateExpression:function(e){var t=e.expression,n=e.modifier,i=e.properties,r=e.layout,o=e.numDimensions,a=e.dimensionAndFieldList;if(!n)return t;var l=o;void 0===l&&(l=w.getNumDimensions({properties:i,layout:r}));var c=s(i,"qHyperCubeDef.qDimensions",[]),u=w.getExpressionWithExcludedComp({expression:t,modifier:n,dimensions:c,dimensionAndFieldList:a}),h=n.selectionScope,d=n.dimensionalScope;return function(e,t,n,i,r,o,s){var a=ie(t),l=re(t,n,i),c=""===a&&""===l?"":a||l,u=oe(r,o),h=se(r,o,s),d=function(e){for(var t=[],n=0;n<e;n++)t[n]=w.getDimDefWithWrapper(n);return t.join(", ")}(o);return"".concat(e,"/ Sum(").concat(c," ").concat(u).concat(h," Aggr(").concat(c," ").concat(e,", ").concat(d,"))")}(u,h,n.field,n.value,d,l,n.primaryDimension)},initModifier:function(e){Object.keys(ne).forEach((function(t){void 0===e[t]&&(e[t]=ne[t])}))},updateModifier:function(e,t){1===(t.qDimensions?t.qDimensions.length:0)&&0===e.dimensionalScope&&(e.dimensionalScope=2)},enableTotalsFunction:function(){return!0},propertyPanelDef:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n={type:"items",items:{disclaimer:{component:"text",translation:t.disclaimer||"properties.modifier.normalization.disclaimer",show:function(e,t){return!w.isApplicable({properties:t.properties})}},settings:{type:"items",items:{selectionScope:{refFn:function(t){return"".concat(Z(t,e),".selectionScope")},type:"string",translation:t.modifierSelectionScope||"properties.modifier.selectionScope",title:{translation:t.modifierSelectionScopeTooltip||"properties.modifier.selectionScope.tooltip"},component:"dropdown",schemaIgnore:!0,defaultValue:X.DISREGARD_SELECTION,options:function(n){return te(n,t,e)}},field:{refFn:function(t){return"".concat(Z(t,e),".field")},type:"string",component:"expression-with-dropdown",translation:"Common.Field",defaultValue:"",dropdownOnly:!0,options:function(e,t,n){return n.app.getFieldList().then((function(e){return e.map((function(e){return{label:e.qName,value:e.qName}}))}))},show:function(t){return J(t,e).selectionScope===X.SELECT_FIELD_VALUE}},value:{refFn:function(t){return"".concat(Z(t,e),".value")},type:"string",ref:"value",component:"string",translation:"properties.value",expression:"optional",show:function(t){return J(t,e).selectionScope===X.SELECT_FIELD_VALUE}},dimensionalScope:{refFn:function(t){return"".concat(Z(t,e),".dimensionalScope")},type:"string",translation:t.modifierDimensionalScope||"properties.modifier.dimensionalScope",title:{translation:t.modifierDimensionalScopeTooltip||"properties.modifier.dimensionalScope.tooltip"},component:"dropdown",schemaIgnore:!0,defaultValue:K.DISREGARD_ALL_DIMENSIONS,supportTooltip:!0,options:function(n,i){return ee(n,i,t,e)}},primaryDimension:{refFn:function(t){return"".concat(Z(t,e),".primaryDimension")},type:"integer",translation:t.primaryDimension||"properties.modifier.primaryDimension",title:{translation:t.primaryDimensionTooltip||"properties.modifier.normalization.primaryDimension.tooltip"},component:"dropdown",schemaIgnore:!0,defaultValue:1,options:function(e,t){return t.layout.qHyperCube.qDimensionInfo.map((function(e,t){return{value:t,label:e.qGroupFallbackTitles[0]}}))},show:function(t,n){return(J(t,e).dimensionalScope||0)===K.ONE_DIMENSION&&n.layout.qHyperCube.qDimensionInfo.length>1}}},show:function(e,t){return w.isApplicable({properties:t.properties})}}},show:function(t,n,i){var r=i.ext.support.modifiers;if(!Array.isArray(r)||-1===r.indexOf(G))return!1;var o=J(t,e);return o&&!o.disabled}};return n},getDisregardSelectionComp:ie,getFieldSelectionComp:re,getTotalComp:oe,getSelectedDimComp:se},le={getExpression:function(e){return s(e,"qDef.base.qDef")||s(e,"qDef.qDef")},getExpressionRef:function(e){return s(e,"qDef.base.qDef")?"qDef.base.qDef":"qDef.qDef"},getLibraryIdRef:function(e){return s(e,"qDef.base.qLibraryId")?"qDef.base.qLibraryId":"qLibraryId"},getLibraryId:function(e){return s(e,"qDef.base.qLibraryId")||s(e,"qLibraryId")},getLabelRef:function(e){return s(e,"qDef.base")?"qDef.base.qLabel":"qDef.qLabel"},getLabelExpressionRef:function(e){return s(e,"qDef.base")?"qDef.base.qLabelExpression":"qDef.qLabelExpression"}},ce={initBase:function(e,t){(t||ce.isValid(e))&&(o(e,"qDef.base.qDef",s(e,"qDef.qDef")),o(e,"qDef.base.qLibraryId",s(e,"qLibraryId")),o(e,"qDef.base.qLabel",s(e,"qDef.qLabel")),o(e,"qDef.base.qLabelExpression",s(e,"qDef.qLabelExpression")))},restoreBase:function(e){ce.isValid(e)&&(o(e,"qDef.qDef",s(e,"qDef.base.qDef")),o(e,"qLibraryId",s(e,"qDef.base.qLibraryId")),o(e,"qDef.qLabel",s(e,"qDef.base.qLabel")),o(e,"qDef.qLabelExpression",s(e,"qDef.base.qLabelExpression")),s(e,"qDef.qAggrFunc")&&s(e,"qDef.base.qAggrFunc")&&o(e,"qDef.qAggrFunc",s(e,"qDef.base.qAggrFunc")),delete e.qDef.base)},isValid:function(e){var t=s(e,"qDef.base.qDef"),n=s(e,"qDef.base.qLibraryId");return void 0!==t||void 0!==n}},ue=ce;function he(e){return(he="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})(e)}var de={accumulation:L,movingAverage:B,difference:Y,normalization:ae},fe=(t.default={modifiers:de,apply:pe,applyModifiers:me,cleanUpMeasure:ge,destroy:function(e){e&&fe[e.id]&&fe[e.id].masterItemSubscriber&&(fe[e.id].masterItemSubscriber&&fe[e.id].masterItemSubscriber.unsubscribe(),delete fe[e.id])},hasActiveModifiers:ye,getActiveModifier:ve,initBase:ue.initBase,isSupportedModifiers:function(e){return Array.isArray(e)&&e.some((function(e){return de[e]}))},isApplicableSupportedModifiers:function(e){var t=e.modifierTypes,n=e.properties,i=e.layout;return Array.isArray(t)&&t.some((function(e){return de[e]&&de[e].isApplicable({properties:n,layout:i})}))},measureBase:le,limitedSorting:function(e){var t=e.measures,n=e.properties,i=e.layout,r=!1,o=!1;return t.forEach((function(e){var t=we(e);ke({modifiers:t,properties:n,layout:i})&&(r=!0,o=o||Re({modifiers:t,properties:n,layout:i}))})),r&&!o},ifEnableTotalsFunction:be},{});function pe(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.model,n=e.properties,i=e.isSnapshot,o=void 0!==i&&i,a=e.masterItem;fe[t.id]=fe[t.id]||{isFirstTime:!0};var l=fe[t.id].isFirstTime;if(fe[t.id].isFirstTime=!1,n&&"object"===he(n))return me({model:t,properties:n});var c=t?t.layout:void 0,u=s(c,"qSelectionInfo.qInSelections");if(o||u)return Promise.resolve(!1);var h=s(c,"qHyperCube.qMeasureInfo"),d=fe[t.id].lastReloadTime;if(fe[t.id].lastReloadTime=s(t,"app.layout.qLastReloadTime"),ye({measures:h,layout:c})){var f=function(e){var t=e.measures,n=e.layout,i=e.lastReloadTime;return s(e.model,"app.layout.qLastReloadTime")!==i&&function(e){var t=e.measures,n=e.properties,i=e.layout;return!!Array.isArray(t)&&t.some((function(e){return Ce({measure:e,properties:n,layout:i})}))}({measures:t,layout:n})}({measures:h,layout:c,model:t,lastReloadTime:d});return f||function(e){var t=e.measures,n=e.layout,i=e.masterItem,r=e.isFirstTime;return!!Array.isArray(t)&&(r||i||t.some((function(e){return function(e){var t=e.measure,n=e.layout;return ke({modifiers:we(t),layout:n})?!t.base:!!t.base}({measure:e,layout:n})})))}({measures:h,layout:c,masterItem:a,isFirstTime:l})?t.getEffectiveProperties().then((function(e){var n=r()(!0,{},e);Me(n);var i=Ne(n);return Ee({model:t}).then((function(r){return Ae({libraryIds:i,model:t}).then((function(i){return f&&function(e){var t=e.properties;xe(t).forEach((function(e){return function(e){var t=e.measure;if(Ce({measure:t,properties:e.properties})){var n=0,i=t.qDef.modifiers;Array.isArray(i)&&i.forEach((function(e){if("object"===he(e)&&!e.disabled){if(n++,"object"!==he(de[e.type]))throw new Error('Modifier "'.concat(e.type,'" is not available'));if(n>1)throw new Error("More than 1 modifier on a measure! (not yet supported)");var i=de[e.type].extractInputExpression({outputExpression:t.qDef.qDef,modifier:e});void 0!==i&&Se(t)&&w.simplifyExpression(t.qDef.base.qDef)!==w.simplifyExpression(i)&&(t.qDef.base.qDef=i)}}))}}({measure:e,properties:t})}))}({properties:n}),me({model:t,oldProperties:e,properties:n,runUpdateIfChange:!0,masterItem:a,libraryItemsProps:i,dimensionAndFieldList:r})}))}))})):Promise.resolve(!1)}return function(e){return!!Array.isArray(e)&&e.some((function(e){return"object"===he(e.base)}))}(h)?t.getEffectiveProperties().then((function(e){return function(e){var t=e.model,n=e.properties,i=Ne(n);return Oe({model:t,libraryIds:i}).then((function(){var e=r()(!0,{},n);return xe(n).forEach((function(e){return ge(e)})),Ie({oldProperties:e,newProperties:n,model:t})}))}({model:t,properties:e})})):Promise.resolve(!1)}function me(e){var t=e.model,n=e.oldProperties,i=e.properties,o=e.measures,a=e.runUpdateIfChange,l=void 0!==a&&a,c=e.masterItem,u=e.libraryItemsProps,h=e.dimensionAndFieldList;void 0===n&&(n=l?r()(!0,{},i):i),Me(i);var d=Ne(i);return Oe({model:t,libraryIds:d,masterItem:c}).then((function(){return function(e){var t=e.measures,n=e.properties,i=e.model,o=e.libraryItemsProps,a=e.dimensionAndFieldList;if(t||(t=xe(n)),!t.length)return Promise.resolve();if(!ye({measures:t,properties:n}))return t.forEach((function(e){return ge(e)})),Promise.resolve();var l=o?void 0:Ne(n);return Ee({model:i,dimensionAndFieldList:a}).then((function(e){return Ae({libraryIds:l,model:i,libraryItemsProps:o}).then((function(i){t.forEach((function(t){ke({modifiers:t.qDef.modifiers,properties:n})?(function(e){var t=e.measure,n=e.properties,i=e.libraryItemsProps,o=e.dimensionAndFieldList,a=0;ue.isValid(t)||ue.initBase(t,!0);var l=t.qDef,c=l.modifiers,u=l.base;Array.isArray(c)&&c.forEach((function(e){if("object"===he(e)&&!e.disabled){if(a++,"object"!==he(de[e.type]))throw new Error('Modifier "'.concat(e.type,'" is not available'));if(a>1)throw new Error("More than 1 modifier on a measure! (not yet supported)");de[e.type].initModifier(e);var l=t.qLibraryId||u&&u.qLibraryId;l?function(e){var t=e.measure,n=e.modifier,i=e.properties,o=e.dimensionAndFieldList,s=e.libraryItemsProps[e.libraryId],a=s.qMeasure.qDef,l=de[n.type].generateExpression({expression:a,modifier:n,properties:i,dimensionAndFieldList:o});n.outputExpression=l,t.qDef.qDef=n.outputExpression,(t.qDef.qLabel||s.qMeasure.qLabel)&&(t.qDef.qLabel=s.qMeasure.qLabel),(t.qDef.qLabelExpression||s.qMeasure.qLabelExpression)&&(t.qDef.qLabelExpression=s.qMeasure.qLabelExpression),t.qDef.quarantine&&t.qDef.quarantine.qNumFormat&&s.qMeasure.qNumFormat&&(t.qDef.qNumFormat=s.qMeasure.qNumFormat,t.qDef.isCustomFormatted=s.qMeasure.isCustomFormatted),delete t.qLibraryId,t.qDef.coloring=s.qMeasure.coloring,n.base=r()(!0,{},t.qDef.base)}({measure:t,modifier:e,libraryId:l,properties:n,libraryItemsProps:i,dimensionAndFieldList:o}):function(e){var t=e.measure,n=e.modifier,i=e.properties,o=e.dimensionAndFieldList;"function"==typeof de[n.type].updateModifier&&de[n.type].updateModifier(n,i.qHyperCubeDef);var s=le.getExpression(t),a=de[n.type].generateExpression({expression:s,modifier:n,properties:i,dimensionAndFieldList:o});n.outputExpression=a,t.qDef.qDef=n.outputExpression,t.qDef.base.qLabelExpression?t.qDef.qLabelExpression=t.qDef.base.qLabelExpression:t.qDef.qLabel=t.qDef.base.qLabel||s,n.base=r()(!0,{},t.qDef.base)}({measure:t,modifier:e,properties:n,dimensionAndFieldList:o}),function(e){var t=s(e,"qDef.qAggrFunc");"Expr"!==t||be(e)?"None"!==t?delete e.qDef.base.qAggrFunc:"None"===t&&be(e)&&"Expr"===e.qDef.base.qAggrFunc&&(e.qDef.qAggrFunc="Expr",delete e.qDef.base.qAggrFunc):(e.qDef.qAggrFunc="None",e.qDef.base.qAggrFunc="Expr")}(t)}}))}({measure:t,properties:n,libraryItemsProps:i,dimensionAndFieldList:e}),De(t)):ge(t)}))}))}))}({measures:o,properties:i,model:t,libraryItemsProps:u,dimensionAndFieldList:h}).then((function(){return l?Ie({oldProperties:n,newProperties:i,model:t}):Promise.resolve(!1)}))}))}function ge(e){!function(e){var t=we(e);return Array.isArray(t)&&t.some((function(e){return"object"===he(e)&&!e.disabled&&!de[e.type]}))}(e)?ue.restoreBase(e):delete e.qDef.base,e.qDef.coloring&&delete e.qDef.coloring,De(e)}function ye(e){var t=e.measures,n=e.properties,i=e.layout;return!!Array.isArray(t)&&t.some((function(e){return ke({modifiers:we(e),properties:n,layout:i})}))}function ve(e){var t=we(e);if(Array.isArray(t))for(var n=0;n<t.length;n++){var i=t[n];if(de[i.type]&&!i.disabled)return i}}function be(e){var t=ve(e);return!t||de[t.type].enableTotalsFunction(e)}function xe(e){return s(e,"qHyperCubeDef.qMeasures",[]).concat(s(e,"qHyperCubeDef.qLayoutExclude.qHyperCubeDef.qMeasures",[]))}function we(e){return e.modifiers||e.qDef&&e.qDef.modifiers}function qe(e){return s(e,"outputExpression.qValueExpression.qExpr")||s(e,"outputExpression")}function Me(e){xe(e).forEach((function(e){return function(e){var t=ve(e);t&&(void 0!==t.outputExpression&&qe(t)!==e.qDef.qDef?delete e.qDef.base:!ue.isValid(e)&&t.base&&(e.qDef.base=r()(!0,{},t.base)))}(e)}))}function De(e){var t=we(e);Array.isArray(t)&&t.forEach((function(t){"object"===he(t)&&(t.disabled||!de[t.type]&&qe(t)!==e.qDef.qDef)&&(t.disabled=!0,delete t.base)}))}function Se(e){return e.base||e.qDef&&e.qDef.base}function _e(e){var t=Se(e);return e.qLibraryId||t&&t.qLibraryId}function Ce(e){var t=e.measure,n=e.properties,i=e.layout;return!_e(t)&&ke({modifiers:we(t),properties:n,layout:i})}function ke(e){var t=e.modifiers,n=e.properties,i=e.layout,r={};return Array.isArray(t)&&t.some((function(e){return!("object"!==he(e)||e.disabled||!de[e.type])&&(void 0===r[e.type]&&(r[e.type]=de[e.type].isApplicable({properties:n,layout:i})),r[e.type])}))}function Ee(e){var t=e.model,n=e.dimensionAndFieldList;if(n)return Promise.resolve(n);var i=[],r={},o=t.app.getDimensionList().then((function(e){r.dimensionList=e}));i.push(o);var s=t.app.getFieldList().then((function(e){r.fieldList=e}));return i.push(s),Promise.all(i).then((function(){return r}))}function Ae(e){var t=e.libraryIds,n=e.model,i=e.libraryItemsProps;if(i)return Promise.resolve(i);var r=t.measureLibraryIds,o=t.dimensionLibraryIds,s={},a=[];return r.forEach((function(e){var t=n.app.getMeasure(e).then((function(t){return t.getProperties().then((function(t){s[e]=t}))}));a.push(t)})),o.forEach((function(e){var t=n.app.getDimension(e).then((function(t){return t.getProperties().then((function(t){s[e]=t}))}));a.push(t)})),Promise.all(a).then((function(){return s}))}function Te(e,t){if(""!==t||-1===["qFmt","qDec","qThou"].indexOf(e))return t}function Ie(e){var t=e.oldProperties,n=e.newProperties,i=e.model,r=JSON.stringify(s(t,"qHyperCubeDef.qMeasures"),Te)!==JSON.stringify(s(n,"qHyperCubeDef.qMeasures"),Te)||JSON.stringify(s(t,"qHyperCubeDef.qLayoutExclude.qHyperCubeDef.qMeasures"),Te)!==JSON.stringify(s(n,"qHyperCubeDef.qLayoutExclude.qHyperCubeDef.qMeasures"),Te);return r?function(e){var t=e.model,n=e.oldProperties,i=e.newProperties,r=t.layout;return r&&!r.qHasSoftPatches&&!r.qExtendsId&&s(r,"qMeta.privileges",[]).indexOf("update")>-1?t.setProperties(i):I(t,n,i)}({model:i,oldProperties:t,newProperties:n}).then((function(){return r})):Promise.resolve(r)}function Re(e){var t=e.modifiers,n=e.properties,i=e.layout;return Array.isArray(t)&&t.some((function(e){return"object"===he(e)&&!e.disabled&&de[e.type]&&de[e.type].needDimension({modifier:e,properties:n,layout:i})}))}function Ne(e){var t=xe(e),n=[],i=[],r=!1;return t.forEach((function(t){var i=we(t);if(ke({modifiers:i,properties:e})){var o=_e(t);o&&n.push(o),r=r||Re({modifiers:i,properties:e})}})),s(e,"qHyperCubeDef.qDimensions",[]).forEach((function(e){var t=e.qLibraryId;t&&i.push(t)})),{measureLibraryIds:n,dimensionLibraryIds:i}}function Oe(e){var t=e.model,n=e.libraryIds;return!e.masterItem&&n&&(n.measureLibraryIds.length||n.dimensionLibraryIds.length)?(fe[t.id].masterItemSubscriber=fe[t.id].masterItemSubscriber||function(e){var t=e.model,n=e.callback,i={},r={},o={},a={dimension:["qDim.qFieldDefs"],measure:["qMeasure.qDef","qMeasure.qLabel","qMeasure.qLabelExpression","qMeasure.coloring","qMeasure.qNumFormat","qMeasure.isCustomFormatted"]};function l(e){var t={},n=s(e,"qInfo.qType");return n&&a[n]&&a[n].forEach((function(n){t[n]=s(e,n)})),JSON.stringify(t)}function c(e){var t=e.qInfo.qId;if(i[t]){var r=l(e);i[t].properties!==r&&(i[t].properties=r,"function"==typeof n&&i[t].enabled&&n(e)),i[t].enabled=!0}}function u(e,n){return t.app[n](e).then((function(t){i[e]={listener:t.layoutSubscribe(c),enabled:!1,properties:l(t.layout)}}))}return{subscribe:function(e){var n=e.measureLibraryIds,s=e.dimensionLibraryIds,a=[];return function(e){var t=e.dimensionLibraryIds;r={},e.measureLibraryIds.forEach((function(e){r[e]=!0})),o={},t.forEach((function(e){o[e]=!0}))}({measureLibraryIds:n,dimensionLibraryIds:s}),Object.keys(i).forEach((function(e){r[e]||o[e]||(i[e].listener.dispose(),delete i[e])})),t.app&&(Object.keys(r).forEach((function(e){r[e]&&!i[e]&&a.push(u(e,"getMeasure"))})),Object.keys(o).forEach((function(e){o[e]&&!i[e]&&a.push(u(e,"getDimension"))}))),Promise.all(a)},unsubscribe:function(){Object.keys(i).forEach((function(e){i[e].listener.dispose()})),i={}}}}({model:t,callback:function(e){return pe({model:t,masterItem:e}).then((function(){return t.app.clearUndoBuffer()}))}}),fe[t.id].masterItemSubscriber.subscribe(n)):Promise.resolve()}}])},function(e,t,n){function i(e){var t=function e(t){var n,i=t;return i>9?(n=65+i-10)>90&&(n+=6):i="".concat(i).charCodeAt(0),[48,111,79,105,73,108].indexOf(n)>-1?e(i+1):String.fromCharCode(n)}(e%62),n=Math.floor(e/62);return n>0?i(n)+t:t}function r(e){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}n.r(t);var o={getValue:function(e,t,n){if(null==e||null==t)return n;for(var i=t.split("."),r=e,o=0;o<i.length;++o){var s=i[o];if(""!==s){if(void 0===r[s]||null===r[s])return n;r=r[s]}}return r},setValue:function(e,t,n){if(null!=e&&null!=t){for(var i=t.split("."),r=i[i.length-1],o=e,s=0;s<i.length-1;++s){var a=i[s];void 0!==o[a]&&null!==o[a]||(o[a]=Number.isNaN(+i[s+1])?{}:[]),o=o[a]}void 0!==n?o[r]=n:delete o[r]}},isEmpty:function(e){return 0===Object.keys(e).length&&e.constructor===Object},isAtomicValue:function(e){return/boolean|number|string/.test(r(e))},generateId:function(){return i(Math.round(99e11*Math.random()+1e11)).replace(/\W/g,"")}};function s(e){return function(e){if(Array.isArray(e))return a(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(e){if("string"==typeof e)return a(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?a(e,t):void 0}}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function a(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,i=new Array(t);n<t;n++)i[n]=e[n];return i}function l(e){return function(e){if(Array.isArray(e))return c(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(e){if("string"==typeof e)return c(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?c(e,t):void 0}}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function c(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,i=new Array(t);n<t;n++)i[n]=e[n];return i}function u(e,t,n){if(e){for(var i=0;i<e.length;i++)if(e[i][t]===n)return i;return-1}return-1}var h={isOrderedSubset:function(e,t){if(!(e&&t&&e.length&&t.length))return!1;var n=e.indexOf(t[0]);if(-1!==n){for(var i=0;i<t.length;i++){var r=e.indexOf(t[i]);if(n>r)return!1;n=r}return!0}return!1},indexAdded:function(e,t){var n;for(n=0;n<e.length;++n)e[n]>=0&&e[n]>=t&&++e[n];e.push(t)},indexRemoved:function(e,t){var n,i=0;for(n=0;n<e.length;++n)e[n]>t?--e[n]:e[n]===t&&(i=n);return e.splice(i,1),i},findItemByPropertyValue:function(e,t,n){if(e){for(var i=0;i<e.length;i++)if(e[i][t]===n)return e[i];return null}return null},findIndexByPropertyValue:u},d=n(1),f=n.n(d),p={addDimensions:function(e){var t,n=e.exportFormat,i=e.qHyperCubeDef,r=n.data[0];(t=r.dimensions).push.apply(t,s(i.qDimensions));var a,l=o.getValue(i,"qLayoutExclude.qHyperCubeDef.qDimensions");l&&(a=r.excludedDimensions).push.apply(a,s(l))},addMeasures:function(e){var t,n=e.exportFormat,i=e.qHyperCubeDef,r=n.data[0];(t=r.measures).push.apply(t,l(i.qMeasures));var s,a=o.getValue(i,"qLayoutExclude.qHyperCubeDef.qMeasures");a&&(s=r.excludedMeasures).push.apply(s,l(a))},setInterColumnSortOrder:function(e){var t=e.exportFormat,n=e.qHyperCubeDef,i=t.data[0];n.qInterColumnSortOrder||(n.qInterColumnSortOrder=[]),i.interColumnSortOrder=n.qInterColumnSortOrder.concat();var r=o.getValue(n,"qLayoutExclude.qHyperCubeDef.qInterColumnSortOrder");r&&h.isOrderedSubset(r,i.interColumnSortOrder)&&(i.interColumnSortOrder=r.concat())},copyProperties:function(e){var t=e.exportFormat,n=e.properties;Object.keys(n).forEach((function(e){t.properties[e]=n[e]}))},updateLayoutExclude:function(e){var t=e.exportFormat,n=e.properties;n.qLayoutExclude||(n.qLayoutExclude={}),n.qLayoutExclude.disabled&&(Object.keys(n.qLayoutExclude.disabled).forEach((function(e){t.properties.hasOwnProperty(e)||(t.properties[e]=n.qLayoutExclude.disabled[e])})),delete n.qLayoutExclude.disabled),n.qLayoutExclude.changed&&(function(e){Object.keys(e.qLayoutExclude.changed).forEach((function(t){e.qLayoutExclude.changed[t].to===o.getValue(e,t)&&o.setValue(e,t,e.qLayoutExclude.changed[t].from)}))}(n),delete n.qLayoutExclude.changed),n.qLayoutExclude.quarantine&&!o.isEmpty(n.qLayoutExclude.quarantine)||delete n.qLayoutExclude},storeMeasuresModifiers:function(e){e.forEach((function(e){f.a.cleanUpMeasure(e),e.qDef.modifiers&&(e.store={modifiers:e.qDef.modifiers},delete e.qDef.modifiers)}))}};function m(e,t,n){var i,r,s=o.getValue(e,t);if(!o.isAtomicValue(s))try{if((r=(r=(i=JSON.stringify(s)).match(/:\{/g))?r.length:0)>2)return;s=JSON.parse(i)}catch(e){return}o.getValue(e,"qLayoutExclude.quarantine")||o.setValue(e,"qLayoutExclude.quarantine",{});var a=o.getValue(e,"qLayoutExclude.quarantine");a[n]||(a[n]={}),a[n][t]=s}var g=n(0),y=n.n(g);function v(e,t){var n=y()(!0,{},t,e);return o.getValue(n,"qOtherTotalSpec.qOtherCounted")||o.setValue(n,"qOtherTotalSpec.qOtherCounted",{qv:"10"}),o.getValue(n,"qOtherTotalSpec.qOtherLimit")||o.setValue(n,"qOtherTotalSpec.qOtherLimit",{qv:"0"}),n.hasOwnProperty("othersLabel")||(n.othersLabel="Others"),n}function b(e,t){return y()(!0,{},t,e)}function x(e,t,n){return"function"==typeof e?e(t):Number.isNaN(+e)?n:e}var w=Math.pow(2,53)-1;function q(e){return function(e){if(Array.isArray(e))return M(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(e){if("string"==typeof e)return M(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)?M(e,t):void 0}}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function M(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,i=new Array(t);n<t;n++)i[n]=e[n];return i}function D(e){return function(e){if(Array.isArray(e))return S(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(e){if("string"==typeof e)return S(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?S(e,t):void 0}}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function S(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,i=new Array(t);n<t;n++)i[n]=e[n];return i}var _={importCommonProperties:function(e,t,n){var i="masterobject"===o.getValue(t,"properties.qInfo.qType")?"masterobject":o.getValue(n,"qInfo.qType");o.setValue(e,"qInfo.qType",i),e.visualization=n.visualization},copyPropertyIfExist:function(e,t,n){t.hasOwnProperty(e)&&(n[e]=t[e])},copyPropertyOrSetDefault:function(e,t,n,i){t.hasOwnProperty(e)?n[e]=t[e]:n[e]=i},getDefaultDimension:function(){return{qDef:{autoSort:!0,cId:"",othersLabel:"Others"},qLibraryId:"",qNullSuppression:!1,qOtherLabel:"Others",qOtherTotalSpec:{qOtherLimitMode:"OTHER_GE_LIMIT",qOtherMode:"OTHER_OFF",qOtherSortMode:"OTHER_SORT_DESCENDING",qSuppressOther:!1}}},getDefaultMeasure:function(){return{qDef:{autoSort:!0,cId:"",numFormatFromTemplate:!0},qLibraryId:"",qTrendLines:[]}},addDimensions:function(e){var t,n=e.exportFormat,i=e.maxDimensions,r=e.minDimensions,o=e.newHyperCubeDef,s=e.defaultDimension,a=n.data[0];for(t=0;t<a.dimensions.length;++t){var l=v(a.dimensions[t],s);o.qDimensions.length<i?o.qDimensions.push(l):o.qLayoutExclude.qHyperCubeDef.qDimensions.push(l)}for(t=0;t<a.excludedDimensions.length;++t){var c=v(a.excludedDimensions[t],s);o.qDimensions.length<r?o.qDimensions.push(c):o.qLayoutExclude.qHyperCubeDef.qDimensions.push(c)}},addMeasures:function(e){var t,n=e.exportFormat,i=e.maxMeasures,r=e.minMeasures,o=e.newHyperCubeDef,s=e.defaultMeasure,a=n.data[0];for(t=0;t<a.measures.length;++t){var l=b(a.measures[t],s);o.qMeasures.length<i?o.qMeasures.push(l):o.qLayoutExclude.qHyperCubeDef.qMeasures.push(l)}for(t=0;t<a.excludedMeasures.length;++t){var c=b(a.excludedMeasures[t],s);o.qMeasures.length<r?o.qMeasures.push(c):o.qLayoutExclude.qHyperCubeDef.qMeasures.push(c)}},getMaxMinDimensionMeasure:function(e){var t=e.exportFormat,n=e.dataDefinition,i=void 0===n?{}:n,r=t.data[0],o=i.dimensions||{max:0},s=i.measures||{max:0},a=x(s.max,r.dimensions.length,w),l=x(s.min,r.dimensions.length,0);return{maxDimensions:x(o.max,a,w),minDimensions:x(o.min,l,0),maxMeasures:a,minMeasures:l}},setInterColumnSortOrder:function(e){var t=e.exportFormat,n=e.newHyperCubeDef,i=t.data[0],r=n.qDimensions.length+n.qMeasures.length;n.qInterColumnSortOrder=i.interColumnSortOrder.concat();var o=n.qInterColumnSortOrder.length;if(o!==r)for(n.qLayoutExclude&&(n.qLayoutExclude.qHyperCubeDef.qInterColumnSortOrder=i.interColumnSortOrder.concat());o!==r;)o<r?(h.indexAdded(n.qInterColumnSortOrder,o),++o):(--o,h.indexRemoved(n.qInterColumnSortOrder,o))},createNewProperties:function(e){var t=e.exportFormat,n=e.initialProperties,i=e.hypercubePath,r={qLayoutExclude:{disabled:{},quarantine:{}}};return Object.keys(t.properties).forEach((function(e){"qLayoutExclude"===e?t.properties[e].quarantine&&(r.qLayoutExclude.quarantine=y()(!0,{},t.properties[e].quarantine)):"qHyperCubeDef"===e&&i?o.setValue(r,"".concat(i,".qHyperCubeDef"),t.properties.qHyperCubeDef):n.hasOwnProperty(e)||-1!==["qMetaDef","descriptionExpression","labelExpression"].indexOf(e)||function(e,t){return"components"===t&&Array.isArray(e[t])&&e[t].some((function(e){return"general"===e.key}))}(t.properties,e)?r[e]=t.properties[e]:r.qLayoutExclude.disabled[e]=t.properties[e]})),null===(r=y()(!0,{},n,r)).components&&(r.components=[]),r},shouldInitLayoutExclude:function(e){var t=e.exportFormat,n=e.maxDimensions,i=e.minDimensions,r=e.maxMeasures,o=e.minMeasures,s=t.data[0];return s.dimensions.length>n&&n>0||s.measures.length>r&&r>0||s.excludedDimensions.length>0&&s.dimensions.length+s.excludedDimensions.length>i||s.excludedMeasures.length>0&&s.measures.length+s.excludedMeasures.length>o||!r&&s.measures.length>0||!n&&s.dimensions.length>0},initLayoutExclude:function(e){var t=e.exportFormat,n=e.maxDimensions,i=e.minDimensions,r=e.maxMeasures,o=e.minMeasures,s=e.newHyperCubeDef,a=t.data[0];s.qLayoutExclude||(s.qLayoutExclude={}),s.qLayoutExclude.qHyperCubeDef||(s.qLayoutExclude.qHyperCubeDef={}),(a.dimensions.length>n&&n>0||a.excludedDimensions&&a.excludedDimensions.length&&a.dimensions.length+a.excludedDimensions.length>i)&&(s.qLayoutExclude.qHyperCubeDef.qDimensions||(s.qLayoutExclude.qHyperCubeDef.qDimensions=[])),(a.measures.length>r&&r>0||a.excludedMeasures&&a.excludedMeasures.length&&a.measures.length+a.excludedMeasures.length>o)&&(s.qLayoutExclude.qHyperCubeDef.qMeasures||(s.qLayoutExclude.qHyperCubeDef.qMeasures=[])),!r&&a.measures.length&&(s.qLayoutExclude.qHyperCubeDef.qMeasures||(s.qLayoutExclude.qHyperCubeDef.qMeasures=[])),!n&&a.dimensions.length&&(s.qLayoutExclude.qHyperCubeDef.qDimensions||(s.qLayoutExclude.qHyperCubeDef.qDimensions=[]))},updateDimensionsOnAdded:function(e){var t=e.newProperties,n=e.dataDefinition,i=e.hypercubePath;if(n.dimensions&&"function"==typeof n.dimensions.added){var r=o.getValue(t,i||"").qHyperCubeDef,s=q(r.qDimensions);r.qDimensions=[],s.forEach((function(e){r.qDimensions.push(e),n.dimensions.added(e,t)}))}},updateMeasuresOnAdded:function(e){var t=e.newProperties,n=e.dataDefinition,i=e.hypercubePath;if(n.measures&&"function"==typeof n.measures.added){var r=o.getValue(t,i||"").qHyperCubeDef,s=D(r.qMeasures);r.qMeasures=[],s.forEach((function(e){r.qMeasures.push(e),n.measures.added(e,t)}))}},restoreMeasuresModifiers:function(e){var t=e.measures,n=e.modifierTypes;t&&n&&f.a.isSupportedModifiers(n)&&t.forEach((function(e){e.store&&e.store.modifiers&&(e.qDef.modifiers=e.store.modifiers),delete e.store}))}};function C(e,t){var n=o.getValue(e,"qLayoutExclude.quarantine",{})[t];return!!n&&(Object.keys(n).forEach((function(t){o.setValue(e,t,n[t])})),delete e.qLayoutExclude.quarantine[t],!0)}var k={exportProperties:function(e){var t=e.propertyTree,n=e.hypercubePath,i=e.viewDataMode,r=function(){for(var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1,t={data:[],properties:{}},n=0;n<e;++n)t.data.push({dimensions:[],measures:[],excludedDimensions:[],excludedMeasures:[],interColumnSortOrder:[]});return t}(),s=t.qProperty,a=o.getValue(s,n||""),l=a.qHyperCubeDef;return l.qInterColumnSortOrder||(l.qInterColumnSortOrder=[]),p.addDimensions({exportFormat:r,qHyperCubeDef:l}),p.addMeasures({exportFormat:r,qHyperCubeDef:l}),p.setInterColumnSortOrder({exportFormat:r,qHyperCubeDef:l}),delete l.qLayoutExclude,p.copyProperties({exportFormat:r,properties:s}),n&&(r.properties.qHyperCubeDef=l,delete a.qHyperCubeDef),p.updateLayoutExclude({exportFormat:r,properties:s}),i||p.storeMeasuresModifiers(r.properties.qHyperCubeDef.qMeasures),Array.isArray(r.properties.filters)&&(m(r.properties,"filters","storedFilters"),delete r.properties.filters),r.properties.qHyperCubeDef.qContextSetExpression&&(m(r.properties,"qHyperCubeDef.qContextSetExpression","storedFilters"),r.properties.qHyperCubeDef.qContextSetExpression=""),r.properties.qHyperCubeDef.qDynamicScript&&r.properties.qHyperCubeDef.qDynamicScript.length&&(m(r.properties,"qHyperCubeDef.qDynamicScript","dynamicScript"),r.properties.qHyperCubeDef.qDynamicScript=[]),r},importProperties:function(e){var t=e.exportFormat,n=e.initialProperties,i=void 0===n?{}:n,r=e.dataDefinition,s=void 0===r?{}:r,a=e.defaultPropertyValues,l=void 0===a?{}:a,c=e.hypercubePath,u=e.extension,h=e.supportedFilters,d=void 0===h||h,f=e.isHCModifierSupported,p=void 0===f||f,m={qChildren:[]},g=_.createNewProperties({exportFormat:t,initialProperties:i,hypercubePath:c}),y=o.getValue(i,c||"").qHyperCubeDef,v=o.getValue(g,c||"").qHyperCubeDef,b=_.getMaxMinDimensionMeasure({exportFormat:t,dataDefinition:s}),x=b.maxDimensions,w=b.minDimensions,q=b.maxMeasures,M=b.minMeasures,D=l.defaultDimension,S=void 0===D?_.getDefaultDimension():D,k=l.defaultMeasure,E=void 0===k?_.getDefaultMeasure():k;v.qDimensions.length=0,v.qMeasures.length=0,_.shouldInitLayoutExclude({exportFormat:t,maxDimensions:x,minDimensions:w,maxMeasures:q,minMeasures:M})&&_.initLayoutExclude({exportFormat:t,maxDimensions:x,minDimensions:w,maxMeasures:q,minMeasures:M,newHyperCubeDef:v}),_.addDimensions({exportFormat:t,maxDimensions:x,minDimensions:w,newHyperCubeDef:v,defaultDimension:S}),_.addMeasures({exportFormat:t,maxMeasures:q,minMeasures:M,newHyperCubeDef:v,defaultMeasure:E}),_.updateDimensionsOnAdded({newProperties:g,dataDefinition:s,hypercubePath:c}),_.updateMeasuresOnAdded({newProperties:g,dataDefinition:s,hypercubePath:c}),_.setInterColumnSortOrder({exportFormat:t,newHyperCubeDef:v}),_.copyPropertyIfExist("qMaxStackedCells",y,v),_.copyPropertyIfExist("qNoOfLeftDims",y,v),_.copyPropertyOrSetDefault("qInitialDataFetch",y,v,[{qTop:0,qLeft:0,qWidth:0,qHeight:0}]),_.copyPropertyOrSetDefault("qMode",y,v,"S"),_.copyPropertyOrSetDefault("qReductionMode",y,v,"N"),_.copyPropertyOrSetDefault("qSortbyYValue",y,v),_.copyPropertyOrSetDefault("qIndentMode",y,v),_.copyPropertyOrSetDefault("qShowTotalsAbove",y,v),_.importCommonProperties(g,t,i),m.qProperty=g;var A=o.getValue(u||{},"support.modifiers");return _.restoreMeasuresModifiers({measures:v.qMeasures,modifierTypes:A}),d&&C(m.qProperty,"storedFilters"),"S"===v.qMode&&p&&C(m.qProperty,"dynamicScript"),m}},E={cellBackgroundColor:!0,cellForegroundColor:!0,colorByAlternative:!0,colorByExpression:!0,tooltip:!0,urlLabel:!0,url:!0};function A(e,t,n,i){t=t||[];var r=u(e,i,n),o=u(t,i,n);if(-1!==r&&-1===o){var s=e.splice(r,1);t.push(s[0])}return t}function T(e,t){return e.length!==t}var I={create:function(e,t){if(!e||!E[e])throw new Error("Attribute Expressions Util: ID required");var n={};return t&&Object.keys(t).forEach((function(e){n[e]=t[e]})),n.id=e,n.qAttribute=!0,n},moveByIdFromGroup:function(e,t,n,i,r){n=n||"qAttributeExpressions",r=r||"id";for(var o=0;o<e.length;o++){var s=e[o][n],a=t.length;if(A(s,t,i,r),T(t,a))return t}return t},IDMAP:{CELL_BACKGROUND_COLOR:"cellBackgroundColor",CELL_FOREGROUND_COLOR:"cellForegroundColor",COLOR_BY_ALTERNATIVE:"colorByAlternative",COLOR_BY_EXPRESSION:"colorByExpression",TOOLTIP:"tooltip",CELL_LINK_LABEL:"urlLabel",CELL_LINK_URL:"url"}},R={getNumDimensions:function(e){return o.getValue(e,"qHyperCubeDef.qDimensions.length",0)},getNumMeasures:function(e){return o.getValue(e,"qHyperCubeDef.qMeasures.length",0)},wrapFieldName:function(e){return e.split(" ").length>1&&"="!==e[0]&&"["!==e[0]?"[".concat(e,"]"):e},getItemLabel:function(e){return e.label||e.name}},N={colorModeOptions:{primary:function(){return!0},dimension:function(e){return R.getNumDimensions(e)>0&&R.getNumMeasures(e)<=1},multiColor:function(e){return R.getNumMeasures(e)>1},measure:function(e){return R.getNumDimensions(e)>0},expression:function(e){return R.getNumMeasures(e)>=1}}},O={colorModeOptions:{primary:function(){return!0},dimension:function(){return!0},multiColor:function(){return!1},measure:function(){return!0},expression:function(e){return R.getNumMeasures(e)>=1}}},P={scatterplot:O,"sn-scatter-plot":O,piechart:{colorModeOptions:{primary:function(){return!0},dimension:function(){return!0},multiColor:function(){return!1},measure:function(){return!0},expression:function(e){return R.getNumMeasures(e)>=1}}},linechart:{colorModeOptions:{primary:function(){return!0},dimension:function(e){return R.getNumDimensions(e)>1},multiColor:function(e){return R.getNumMeasures(e)>1},measure:function(e){return R.getNumDimensions(e)<=1},expression:function(e){return R.getNumMeasures(e)>=1}}},map:{colorModeOptions:{primary:function(){return!0},dimension:function(e){return R.getNumDimensions(e)>=1},multiColor:function(e){return R.getNumMeasures(e)>1},measure:function(e){return R.getNumDimensions(e)>=1},expression:function(e){return R.getNumDimensions(e)>=1}}},distributionplot:{colorModeOptions:{primary:function(){return!0},dimension:function(){return!0},multiColor:function(){return!1},measure:function(){return!0},expression:function(e){return R.getNumDimensions(e)>=1}}}};function L(e,t,n){if(Array.isArray(e[t])){var i=h.findIndexByPropertyValue(e[t],"id",n);i>=0&&e[t].splice(i,1)}else e[t]=[]}function F(e,t){var n=I.IDMAP.COLOR_BY_ALTERNATIVE;e.forEach((function(e){L(e,"qAttributeDimensions",n),L(e,"qAttributeExpressions",n)})),t.forEach((function(e){L(e,"qAttributeDimensions",n),L(e,"qAttributeExpressions",n)}))}function z(e,t){if(t){var n="="===t.charAt(0);e.color.altLabel=n?{qStringExpression:{qExpr:t.substr(1)}}:t}}function j(e){var t=e.properties,n=e.isDimension,i=e.dimensions,r=e.excludedDimensions,s=e.measures,a=e.label;F(i,r);var l=i[i.length-1];if(l){var c=n?o.getValue(t,"color.byDimDef"):o.getValue(t,"color.byMeasureDef"),u=o.getValue(t,"color.formatting.qNumFormat"),d=o.getValue(t,"color.formatting.isCustomFormatted");if(c){var f=I.create(I.IDMAP.COLOR_BY_ALTERNATIVE);switch(c.type){case"expression":!function(e){var t=e.attributeExpression,n=e.label,i=e.item,r=e.isDimension,o=e.qNumFormat,s=e.isCustomFormatted;t.label=n||i.label,r?t.qDef=i.key:(t.qExpression=i.key,o&&(t.qNumFormat=o,t.isCustomFormatted=s)),t.matchMeasure=i.activeMeasureIndex,t.label&&"="===t.label.charAt(0)&&(t.labelExpRef="color.altLabel")}({attributeExpression:f,label:a,item:c,isDimension:n,qNumFormat:u,isCustomFormatted:d});break;case"libraryItem":!function(e){var t=e.attributeExpression,n=e.measures,i=e.item,r=e.isDimension,o=e.qNumFormat,s=e.isCustomFormatted;r||(t.matchMeasure=h.findIndexByPropertyValue(n,"qLibraryId",i.key),o&&(t.qNumFormat=o,t.isCustomFormatted=s)),void 0!==i.expression?t.qExpression=i.expression:t.qLibraryId=i.key,t.colorMapRef=i.key}({attributeExpression:f,measures:s,item:c,isDimension:n,qNumFormat:u,isCustomFormatted:d})}n?(f.qSortBy={qSortByAscii:1},l.qAttributeDimensions.push(f)):l.qAttributeExpressions.push(f)}}}function H(e,t,n,i){var r,o,s,a={};switch(e){case"dimension":n.qLibraryId?(a.type="dimension",a.name=n.qLibraryId,a.id=n.qLibraryId):(a.type="field",t?(a.name=n.label||n.qDef,a.id=n.qDef):(a.name=n.qDef.qFieldDefs[0],a.label=(s=n.qDef).qLabelExpression?s.qLabelExpression:s.qFieldLabels&&s.qFieldLabels[0]?s.qFieldLabels[0]:s.qFieldDefs[0]));break;case"measure":(r=function(e,t){return t?e.qLibraryId:f.a.measureBase.getLibraryId(e)}(n,t))?(a.type="measure",a.name=r,a.id=r,(o=function(e,t){return f.a.hasActiveModifiers({measures:[e]})&&t?e.qDef.qDef:void 0}(n,i))&&(a.expression=o)):(a.type="expression",t?(a.name=n.label||n.qExpression,a.id=n.qExpression):(a.name=n.qDef.qDef,a.label=function(e){var t=e.qDef;return t.qLabelExpression?t.qLabelExpression:t.qLabel?t.qLabel:t.qDef}(n)));break;default:throw new Error('columnType should be "dimension" or "measure"')}return a}var B={useMasterNumberFormat:function(e){e.quarantine={qNumFormat:e.qNumFormat||{},isCustomFormatted:e.isCustomFormatted||!1},e.qNumFormat=null,e.isCustomFormatted=void 0}};function V(e,t,n,i){var r=n?"expression":t.type,o=e.color,s=o.mode,a=R.getItemLabel(t);switch(z(e,a||""),r){case"field":s="byDimension",o.byDimDef={label:t.label||R.wrapFieldName(t.name),key:R.wrapFieldName(t.name),type:"expression",activeDimensionIndex:t.activeDimensionIndex};break;case"expression":s="byMeasure",o.byMeasureDef={label:n||a,key:n||t.name,type:"expression",activeMeasureIndex:t.activeMeasureIndex};break;case"dimension":s="byDimension",o.byDimDef={label:t.name,key:t.id,type:"libraryItem",activeDimensionIndex:t.activeDimensionIndex};break;case"measure":s="byMeasure",o.byMeasureDef={label:t.name,key:t.id,expression:t.expression,type:"libraryItem",activeMeasureIndex:t.activeMeasureIndex},o.formatting&&B.useMasterNumberFormat(o.formatting)}i||(o.auto=!1,o.mode=s)}function $(e,t){var n=o.getValue(e,"".concat(t,"qDimensions"),[]),i=n[function(e,t,n){var i=o.getValue(t,"visualization"),r=n.split("."),s=Number(r[1]),a=o.getValue(t,"layers.".concat(s,".type"));return 2===e.length&&"map"===i&&"point"===a}(n,e,t)?0:n.length-1],r=I.IDMAP.COLOR_BY_ALTERNATIVE,s=h.findItemByPropertyValue(i.qAttributeDimensions,"id",r);return V(e,H("dimension",!!s,s||i)),!!s}function W(e,t){var n=o.getValue(e,"".concat(t,"qDimensions"),[]),i=o.getValue(e,"".concat(t,"qMeasures"),[]),r=o.getValue(e,"".concat(t,"qLayoutExclude.qHyperCubeDef.qDimensions"),[]),s=o.getValue(e,"color.byDimDef");if(s&&z(e,s.label),function(e){return!!(e&&e.activeDimensionIndex>-1)}(s))!function(e,t){var n=o.getValue(e,"".concat(t,"qDimensions"),[]),i=o.getValue(e,"color.byDimDef");i.activeDimensionIndex=Math.min(i.activeDimensionIndex,n.length-1);var r=H("dimension",!1,n[i.activeDimensionIndex]);r.activeDimensionIndex=i.activeDimensionIndex,V(e,r)}(e,t);else if(function(e){return!e||!e.key}(s)&&$(e,t))return;j({properties:e,isDimension:!0,dimensions:n,excludedDimensions:r,measures:i,label:o.getValue(e,"color.byDimDef.label")})}function U(e,t){var n=o.getValue(e,"".concat(t,"qDimensions"),[]),i=o.getValue(e,"".concat(t,"qMeasures"),[]),r=o.getValue(e,"".concat(t,"qLayoutExclude.qHyperCubeDef.qDimensions"),[]),s=o.getValue(e,"color.byMeasureDef");if(s&&z(e,s.label),function(e){return!!(e&&e.activeMeasureIndex>-1)}(s))!function(e,t){var n=o.getValue(e,"".concat(t,"qMeasures"),[]),i=o.getValue(e,"color.byMeasureDef");if(i.activeMeasureIndex=Math.min(i.activeMeasureIndex,n.length-1),i.activeMeasureIndex>-1){var r=H("measure",!1,n[i.activeMeasureIndex],!0);r.activeMeasureIndex=i.activeMeasureIndex,V(e,r)}}(e,t);else if(function(e,t){return(!e||!e.key)&&t.length>0}(s,i)&&function(e,t){var n=o.getValue(e,"".concat(t,"qDimensions"),[]),i=o.getValue(e,"".concat(t,"qMeasures"),[]),r=n[n.length-1],s=I.IDMAP.COLOR_BY_ALTERNATIVE,a=h.findItemByPropertyValue(r.qAttributeExpressions,"id",s);return V(e,H("measure",!!a,a||i[0])),!!a}(e,t))return;j({properties:e,isDimension:!1,dimensions:n,excludedDimensions:r,measures:i,label:o.getValue(e,"color.byMeasureDef.label")})}var Y={changeProperty:function(e,t,n){o.setValue(e,t,n),o.isAtomicValue(n)&&function(e,t,n){var i=e.qLayoutExclude;i&&(i.changed||(i.changed={}),i.changed[t]={from:o.getValue(e,t),to:n})}(e,t,n)},getCanColorBy:function(e,t){var n={primary:!0};if(e){var i=(P[t]||N).colorModeOptions||N.colorModeOptions;n.byDimension=i.dimension(e),n.byMeasure=i.measure(e),n.byMultiple=i.multiColor(e),n.byExpression=i.expression(e)}return n},shouldUpdateColorBy:function(e){var t=e.canColorBy,n=e.autoColor,i=e.colorMode,r=e.dimensions;return!(t[i]&&!n&&("byDimension"!==i&&"byMeasure"!==i||!r.length))},updateColorBy:function(e,t){var n=o.getValue(e,"color.mode"),i=o.getValue(e,"color.auto"),r=o.getValue(e,"".concat(t,"qDimensions"),[]),s=o.getValue(e,"".concat(t,"qMeasures"),[]),a=o.getValue(e,"".concat(t,"qLayoutExclude.qHyperCubeDef.qDimensions"),[]);i?F(r,a):function(e){var t=e.auto,n=e.colorMode,i=e.dimensions;return!t&&"byDimension"===n&&i.length>0}({auto:i,colorMode:n,dimensions:r})?W(e,t):function(e){var t=e.auto,n=e.colorMode,i=e.dimensions,r=e.measures,s=e.properties,a=o.getValue(s,"visualization");return!(t||"byMeasure"!==n||!i.length||"map"!==a&&!r.length)}({auto:i,colorMode:n,dimensions:r,measures:s,properties:e})?U(e,t):function(e,t){var n=o.getValue(e,"color.mode"),i=o.getValue(e,"".concat(t,"qDimensions"),[]),r=o.getValue(e,"".concat(t,"qMeasures"),[]),s=o.getValue(e,"".concat(t,"qLayoutExclude.qHyperCubeDef.qDimensions"),[]);"byMultiple"===n&&r.length<2&&o.setValue(e,"color.mode","primary"),F(i,s)}(e,t)},deleteTotalMode:function(e){e.forEach((function(e){e.qOtherTotalSpec&&"qTotalMode"in e.qOtherTotalSpec&&delete e.qOtherTotalSpec.qTotalMode}))},shouldAddColorByExpression:function(e){var t=e.shouldUpdateColorBy,n=e.properties,i=o.getValue(n,"qHyperCubeDef.qMeasures",[]),r=o.getValue(n,"color.mode","");return!t&&"byExpression"===r&&i.length>0},addColorByExpression:function(e){var t=o.getValue(e,"qHyperCubeDef.qMeasures.0.qAttributeExpressions",[]),n=o.getValue(e,"color.colorExpression","");t.splice(0,0,{qExpression:n,id:"colorByExpression"}),o.setValue(e,"qHyperCubeDef.qMeasures.0.qAttributeExpressions",t)},switchToAutoColor:function(e){o.setValue(e,"color.mode","primary"),o.setValue(e,"color.auto",!0)},shouldSwitchToColorPersistent:function(e){var t=o.getValue(e,"qHyperCubeDef.qDimensions",[]),n=o.getValue(e,"color.persistent",!1);return t.length>1&&!n}},X={exportProperties:function(e){var t=e.propertyTree,n=e.hypercubePath,i=e.viewDataMode,r=k.exportProperties({propertyTree:t,hypercubePath:n,viewDataMode:i}),o=r.data[0],s=o.dimensions.concat(o.excludedDimensions),a=o.measures.concat(o.excludedMeasures),l=I.IDMAP,c=l.COLOR_BY_ALTERNATIVE,u=l.COLOR_BY_EXPRESSION;return I.moveByIdFromGroup(s,[],"qAttributeDimensions",c),I.moveByIdFromGroup(s,[],"qAttributeExpressions",c),I.moveByIdFromGroup(a,[],"qAttributeExpressions",u),r},importProperties:function(e){var t=e.exportFormat,n=e.initialProperties,i=e.dataDefinition,r=e.defaultPropertyValues,s=e.hypercubePath,a=e.extension,l=e.supportedFilters,c=e.isHCModifierSupported,u=k.importProperties({exportFormat:t,initialProperties:n,dataDefinition:i,defaultPropertyValues:r,hypercubePath:s,extension:a,supportedFilters:l,isHCModifierSupported:c}),h=u.qProperty,d=o.getValue(h,"visualization"),f=o.getValue(h,"qHyperCubeDef.qDimensions",[]),p=o.getValue(h,"color.mode",""),m=o.getValue(h,"color.auto",""),g=Y.getCanColorBy(h,d),y=Y.shouldUpdateColorBy({canColorBy:g,autoColor:m,colorMode:p,dimensions:f});return g[p]?Y.shouldAddColorByExpression({shouldUpdateColorBy:y,properties:h})&&Y.addColorByExpression(h):Y.switchToAutoColor(h),y&&Y.updateColorBy(h,"qHyperCubeDef."),Y.shouldSwitchToColorPersistent(h)&&Y.changeProperty(h,"color.persistent",!0),Y.deleteTotalMode(f),u}},K=["bar","marker","line"],G={handleAutoMinMax:function(e){var t=e.initialProperties,n=e.properties;t.measureAxis&&void 0===t.measureAxis.autoMinMax?C(n,"unsupportedAutoMinMax")||y()(n.measureAxis,t.measureAxis):C(n,"supportedAutoMinMax")||y()(n.measureAxis,t.measureAxis)},handleMeasuresAxis:function(e){var t,n=e.exportFormat,i=e.initialProperties,r=e.properties,o=e.measureType,s=r.qHyperCubeDef,a=r.measureAxis;if(function(e){var t=e.exportFormat,n=e.initialProperties;return!(!t.properties.measureAxes||n.measureAxes||!n.measureAxis||void 0===n.measureAxis.autoMinMax)}({exportFormat:n,initialProperties:i})){var l=function(e){var t=[];return e.qMeasures.length>0&&e.qMeasures.forEach((function(e){if(e.qDef.series){var n=e.qDef.series,i=n.type,r=n.axis;t[r]||(t[r]={axis:r,type:{line:0,marker:0,bar:0,total:0}}),K.includes(i)&&t[r].type[i]++,t[r].type.total++}})),t}(s);l.length?(o&&(t=l.filter((function(e){return e.type[o]>0})).sort((function(e,t){return t.type[o]-e.type[o]}))),t&&t.length||(t=l.sort((function(e,t){return t.type.total-e.type.total}))),t&&t[0]&&y()(a,n.properties.measureAxes[t[0].axis])):y()(a,n.properties.measureAxes[0])}},setInterColumnSortOrder:function(e){if(e.qDimensions.length>1){var t=e.qInterColumnSortOrder.indexOf(0);if(0!==t){var n=e.qInterColumnSortOrder[0];e.qInterColumnSortOrder[0]=0,e.qInterColumnSortOrder[t]=n}}}},J={exportProperties:function(e){var t=e.propertyTree,n=e.hypercubePath,i=e.viewDataMode,r=e.supportedAutoMinMax,o=void 0===r||r,s=X.exportProperties({propertyTree:t,hypercubePath:n,viewDataMode:i}),a=s.properties;return o?(m(a,"measureAxis.min","supportedAutoMinMax"),m(a,"measureAxis.max","supportedAutoMinMax")):(m(a,"measureAxis.min","unsupportedAutoMinMax"),m(a,"measureAxis.max","unsupportedAutoMinMax")),s},importProperties:function(e){var t=e.exportFormat,n=e.initialProperties,i=e.dataDefinition,r=e.defaultPropertyValues,o=e.hypercubePath,s=e.measureType,a=e.extension,l=e.supportedFilters,c=e.isHCModifierSupported,u=X.importProperties({exportFormat:t,initialProperties:n,dataDefinition:i,defaultPropertyValues:r,hypercubePath:o,extension:a,supportedFilters:l,isHCModifierSupported:c}),h=u.qProperty;return G.handleAutoMinMax({initialProperties:n,properties:h}),G.handleMeasuresAxis({exportFormat:t,initialProperties:n,properties:h,measureType:s}),G.setInterColumnSortOrder(h.qHyperCubeDef),u}};function Z(e,t,n){return"qLayoutExclude.quarantine.".concat(e,".").concat(t,".").concat(n)}function Q(e){var t=e.properties,n=e.arrayPath,i=e.quarantineName,r=e.arrayName,s=e.itemPath;o.getValue(t,n,[]).forEach((function(e){return function(e){var t=e.properties,n=e.quarantineName,i=e.arrayName,r=e.item,s=e.itemPath,a=o.getValue(r,s);if(void 0!==a){var l=o.getValue(r,"qDef.cId");l||(l=o.generateId(),o.setValue(r,"qDef.cId",l));var c=Z(n,i,l);o.setValue(t,c,a),o.setValue(r,s,void 0)}}({properties:t,quarantineName:i,arrayName:r,item:e,itemPath:s})}))}function ee(e){var t=e.properties,n=e.arrayPath,i=e.quarantineName,r=e.arrayName,s=e.itemPath;o.getValue(t,n,[]).forEach((function(e){return function(e){var t=e.properties,n=e.quarantineName,i=e.arrayName,r=e.item,s=e.itemPath,a=o.getValue(r,"qDef.cId");if(a){var l=Z(n,i,a),c=o.getValue(t,l);void 0!==c&&(o.setValue(r,s,c),o.setValue(t,l,void 0))}}({properties:t,quarantineName:i,arrayName:r,item:e,itemPath:s})}))}var te={quarantine:function(e){Q({properties:e,arrayPath:"qHyperCubeDef.qMeasures",quarantineName:"conditionalColoring",arrayName:"measures",itemPath:"qDef.conditionalColoring"})},unquarantine:function(e){ee({properties:e,arrayPath:"qHyperCubeDef.qMeasures",itemPath:"qDef.conditionalColoring",arrayName:"measures",quarantineName:"conditionalColoring"})}},ne={quarantine:function(e){Q({properties:e,arrayPath:"qHyperCubeDef.qMeasures",quarantineName:"conditionalShowHide",arrayName:"measures",itemPath:"qCalcCondition"}),Q({properties:e,arrayPath:"qHyperCubeDef.qDimensions",quarantineName:"conditionalShowHide",arrayName:"dimensions",itemPath:"qCalcCondition"})},unquarantine:function(e){ee({properties:e,arrayPath:"qHyperCubeDef.qMeasures",quarantineName:"conditionalShowHide",arrayName:"measures",itemPath:"qCalcCondition"}),ee({properties:e,arrayPath:"qHyperCubeDef.qDimensions",quarantineName:"conditionalShowHide",arrayName:"dimensions",itemPath:"qCalcCondition"})},quarantineAlternative:function(e){Q({properties:e,arrayPath:"qHyperCubeDef.qLayoutExclude.qHyperCubeDef.qMeasures",quarantineName:"conditionalShowHide",arrayName:"alternativeMeasures",itemPath:"qCalcCondition"}),Q({properties:e,arrayPath:"qHyperCubeDef.qLayoutExclude.qHyperCubeDef.qDimensions",quarantineName:"conditionalShowHide",arrayName:"alternativeDimensions",itemPath:"qCalcCondition"})},unquarantineAlternative:function(e){ee({properties:e,arrayPath:"qHyperCubeDef.qLayoutExclude.qHyperCubeDef.qMeasures",quarantineName:"conditionalShowHide",arrayName:"alternativeMeasures",itemPath:"qCalcCondition"}),ee({properties:e,arrayPath:"qHyperCubeDef.qLayoutExclude.qHyperCubeDef.qDimensions",quarantineName:"conditionalShowHide",arrayName:"alternativeDimensions",itemPath:"qCalcCondition"})}};t.default={hypercube:k,colorChart:X,axisChart:J,quarantineProperty:m,unquarantineProperty:C,quarantineArrayProp:Q,unquarantineArrayProp:ee,conditionalColoring:te,conditionalShow:ne}}])}(Bx);var Vx=n(Hx);const $x=["altLabel","auto","autoMinMax","byDimDef","byMeasureDef","dimensionScheme","expressionIsColor","expressionLabel","measureMax","measureMin","measureScheme","mode","paletteColor","persistent","reverseScheme","useBaseColors","useDimColVal"];function Wx(e,t,n){for(let i=0;i<n.length;++i){const r=n[i];void 0!==e[r]&&(t[r]=e[r],delete e[r])}}var Ux={importColors:function(e){e.color.point=e.color.point||{},Wx(e.color,e.color.point,$x),e.color.colorExpression&&(e.color.point.expression={qValueExpression:{qExpr:e.color.colorExpression}},delete e.color.colorExpression),e.color.point.expressionIsColor=!0},exportColors:function(e){Wx(e.color.point,e.color,$x),e.color.colorExpression=Rb(e,"color.point.expression.qValueExpression.qExpr",""),delete e.color.point.expression}};function Yx({dataDefinition:e,defaultPropertyValues:t,exportFormat:n,initialProperties:i}){const r=Vx.axisChart.importProperties({exportFormat:n,initialProperties:i,dataDefinition:e,defaultPropertyValues:t}),o=r.qProperty;return 3===o.qHyperCubeDef.qInterColumnSortOrder.length&&(o.qHyperCubeDef.qInterColumnSortOrder=[1,2,0]),Ux.importColors(o),o.qHyperCubeDef.qAlwaysFullyExpanded=!0,r}function Xx({propertyTree:e,viewDataMode:t}){const n=Vx.axisChart.exportProperties({propertyTree:e,viewDataMode:t});return Ux.exportColors(e.qProperty),n}var Kx=e=>{const t=jx(e);return{properties:Lx,data:{targets:[t]},importProperties:({exportFormat:e,initialProperties:n})=>Yx({dataDefinition:t,exportFormat:e,initialProperties:n}),exportProperties:Xx}},Gx=Object.prototype.hasOwnProperty,Jx=Object.prototype.toString,Zx=Object.defineProperty,Qx=Object.getOwnPropertyDescriptor,ew=function(e){return"function"==typeof Array.isArray?Array.isArray(e):"[object Array]"===Jx.call(e)},tw=function(e){if(!e||"[object Object]"!==Jx.call(e))return!1;var t,n=Gx.call(e,"constructor"),i=e.constructor&&e.constructor.prototype&&Gx.call(e.constructor.prototype,"isPrototypeOf");if(e.constructor&&!n&&!i)return!1;for(t in e);return void 0===t||Gx.call(e,t)},nw=function(e,t){Zx&&"__proto__"===t.name?Zx(e,t.name,{enumerable:!0,configurable:!0,value:t.newValue,writable:!0}):e[t.name]=t.newValue},iw=function(e,t){if("__proto__"===t){if(!Gx.call(e,t))return;if(Qx)return Qx(e,t).value}return e[t]},rw=function e(){var t,n,i,r,o,s,a=arguments[0],l=1,c=arguments.length,u=!1;for("boolean"==typeof a&&(u=a,a=arguments[1]||{},l=2),(null==a||"object"!=typeof a&&"function"!=typeof a)&&(a={});l<c;++l)if(null!=(t=arguments[l]))for(n in t)i=iw(a,n),a!==(r=iw(t,n))&&(u&&r&&(tw(r)||(o=ew(r)))?(o?(o=!1,s=i&&ew(i)?i:[]):s=i&&tw(i)?i:{},nw(a,{name:n,newValue:e(u,s,r)})):void 0!==r&&nw(a,{name:n,newValue:r}));return a};const ow={wrapExpression:function(e){const t=e.replace(/\]/g,"]]");return t?`[${t}]`:""}};const sw={replaceExpressionTokens:function(e,t,n){const i={start:n&&n.start||"{{",end:n&&n.end||"}}"};let r,o,s=e;for(const e in t)r=t[e],o=i.start+e+i.end,s=s.replace(aw(o,!0),r);return s},createRegExp:aw};function aw(e,t,n){const i=e.replace(/[-[\]/{}()*+?.\\^$|]/g,"\\$&");const r=n?`(${i})`:i;return t?new RegExp(r,"g"):new RegExp(r)}const lw={generateExpression:function(e,t){const n={};if(t)for(const e in t){const i=t[e],r=i.wrap?ow.wrapExpression(i.value):i.value;n[e]=r;(i.variations||[]).forEach((t=>{const i=cw(t,r,e);n[t]=i}))}return sw.replaceExpressionTokens(e,n)}};function cw(e,t,n){if(""===t)return"";const i=sw.createRegExp(n,!0,!0),r=e.split(i);let o="";return r.forEach((e=>{o+=e!==n?e:t})),o}const uw={generateHyperCubeDef:function(e,t,n,i,r){return function(e,t,n,i){const r={};let o,s;const a=[];let l;e.forEach((e=>{o=mw(e.match(pw("Dim"))),o.forEach((e=>{a.push(hw(t.qDimensions[e],i,e,n).then((t=>{r[`Dim[${e}]`]={value:t,wrap:!0}})))})),s=mw(e.match(pw("Mea"))),s.forEach((e=>{a.push(dw(t.qMeasures[e],i).then((t=>{r[`Mea[${e}]`]={value:t}})))}))})),l=a.length?Promise.all(a).then((()=>Promise.resolve(r))):Promise.resolve(r);return l}(e.dimensions.concat(e.measures),t,n,i).then((n=>{const i=rw({},n,r),o=rw(!0,{},t);return o.qDimensions=[],o.qMeasures=[],e.dimensions.forEach((e=>{o.qDimensions.push({qDef:{qFieldDefs:[`=${lw.generateExpression(e,i)}`]}})})),e.measures.forEach((e=>{o.qMeasures.push({qDef:{qDef:lw.generateExpression(e,i)}})})),o}))},getAllHyperCubeExpressions:async function(e,t,n){const i=e.qDimensions.map(((e,i)=>hw(e,n,i,t))),r=e.qMeasures.map((e=>dw(e,n)));return{dimensions:await Promise.all(i),measures:await Promise.all(r)}}};function hw(e,t,n,i){if(e.qLibraryId)return fw(e.qLibraryId,"dimension",t,n,i);const r=i.qDimensionInfo[n].qGroupPos;return Promise.resolve(e.qDef.qFieldDefs[r])}function dw(e,t){return e.qLibraryId?fw(e.qLibraryId,"measure",t):Promise.resolve(e.qDef.qDef)}function fw(e,t,n,i,r){if(!n)return console.warn("No app provided, returning library id"),e;return n["dimension"===t?"getDimension":"getMeasure"](e).then((e=>e.getProperties().then((e=>"dimension"===t?e.qDim.qFieldDefs[r.qDimensionInfo[i].qGroupPos]:e.qMeasure.qDef))))}function pw(e){return new RegExp(`\\{\\{${e}\\[\\d\\]\\}\\}`,"g")}function mw(e){return e?e.map((e=>e.substr(6,1))):[]}function gw(e){return e=e||function(){return!1},{get(t){const n=e()?-1:1;switch(t("integer")*n){case-1:return"descending";case 1:return"ascending";default:return"disabled"}},set(t,n){const i=e();switch(t){case"descending":n("integer",i?1:-1);break;case"ascending":n("integer",i?-1:1);break;case"disabled":n("integer",0);break;default:n("integer",void 0)}}}}var yw={booleanConvertFunctions:function(e,t){return e=e||function(){return!1},t=t||1,{get:e=>!!e("integer"),set(n,i){if(n){let n=e()?-1:1;n*=t,i("integer",n)}else i("integer",0)}}},enumConvertFunctions:gw,invertedEnumConvertFunctions:function(e){return gw((function(){return!e||!e()}))}};const vw=[{value:"ascending",translation:"properties.sorting.ascending"},{value:"descending",translation:"properties.sorting.descending"}];function bw(e,t,n){return{type:"items",items:{toggled:{type:"boolean",ref:e,translation:t,convertFunctions:n.toggled},order:{type:"string",component:"dropdown",ref:e,options:vw,convertFunctions:n.sorting,show:t=>0!==Rb(t,e,0)}}}}var xw={state:function(e,t){return bw(e=e||"qSortByState","properties.sorting.sortByState",{toggled:yw.booleanConvertFunctions(t),sorting:yw.invertedEnumConvertFunctions(t)})},ascii:function(e,t){return bw(e=e||"qSortByAscii","properties.sorting.sortByAlphabetic",{toggled:yw.booleanConvertFunctions(t),sorting:yw.enumConvertFunctions(t)})},numeric:function(e,t){return bw(e=e||"qSortByNumeric","properties.sorting.sortByNumeric",{toggled:yw.booleanConvertFunctions(t,-1),sorting:yw.enumConvertFunctions(t)})},expression:function(e,t){e=e||"qSortByExpression";const n={toggled:yw.booleanConvertFunctions(t),sorting:yw.enumConvertFunctions(t)},i=bw(e,"properties.sorting.sortByExpression",n);return i.items.expression={type:"number",component:"expression",expressionType:"ValueExpr",ref:"qExpression",translation:"Common.Expression",defaultValue:"",show:t=>0!==Rb(t,e,0)},i},frequency:function(e,t){return bw(e=e||"qSortByFrequency","properties.sorting.sortByFrequency",{toggled:yw.booleanConvertFunctions(t),sorting:yw.invertedEnumConvertFunctions(t)})}};const ww=(e,t)=>(t.components||[]).find((t=>t.key===e)),qw=(e,t,n,i)=>{var r,o,s,a,l;const c=i.isEnabled("CLIENT_IM_3364")?null===(r=ww("axis",n))||void 0===r?void 0:r.axis:{};return{text:{fontFamily:(null==c||null===(o=c.title)||void 0===o?void 0:o.fontFamily)||t.getStyle(e,"axis.title","fontFamily"),fontSize:(null==c||null===(s=c.title)||void 0===s?void 0:s.fontSize)||t.getStyle(e,"axis.title","fontSize"),fill:(null==c||null===(a=c.title)||void 0===a||null===(l=a.fontColor)||void 0===l?void 0:l.color)||t.getStyle(e,"axis.title","color")}}},Mw=(e,t,n,i)=>{var r,o,s,a,l,c,u,h;const d=i.isEnabled("CLIENT_IM_3364")?null===(r=ww("axis",n))||void 0===r?void 0:r.axis:{};return{labels:{fontFamily:(null==d||null===(o=d.label)||void 0===o||null===(s=o.name)||void 0===s?void 0:s.fontFamily)||t.getStyle(e,"axis.label.name","fontFamily"),fontSize:(null==d||null===(a=d.label)||void 0===a||null===(l=a.name)||void 0===l?void 0:l.fontSize)||t.getStyle(e,"axis.label.name","fontSize"),fill:(null==d||null===(c=d.label)||void 0===c||null===(u=c.name)||void 0===u||null===(h=u.fontColor)||void 0===h?void 0:h.color)||t.getStyle(e,"axis.label.name","color")}}},Dw={DATA_PATH:"qUndoExclude",HYPERCUBE_DEF_PATH:"qHyperCubeDef",HYPERCUBE_PATH:"qHyperCube",CHART_ID:"object.distributionPlot",AUTO_SORT:"sorting.autoSort",SORT_CRITERIA:"sorting.sortCriteria",SORTING_ELEMENT_ID:"sorting.elementId",SORTING_ELEMENT_MIN_ID:"distplot-exp-min",SORTING_ELEMENT_MAX_ID:"distplot-exp-max",SORTING_EXPRESSION:"sorting.expression",MAX_GLYPH_COUNT:20,MAX_STACKED_VALUES:3e3,HORIZONTAL:"horizontal",BOX_PADDING:2,POINT_BANDWIDTH_BASE_RATIO:.35,MAX_POINT_BASE_SIZE_PX:34,MIN_POINT_PIXELS:5,JITTER_PARAMETER:3,BUBBLE_SCALES_MAX:100};function Sw(e){return e.qHyperCubeDef&&e.qHyperCubeDef.qDimensions.length>1||e.qHyperCube&&e.qHyperCube.qDimensionInfo&&e.qHyperCube.qDimensionInfo.length>1}Object.freeze(Dw);const _w={hasMultipleDimensions:Sw,getOuterDimensionCardinality:function(e){const t=Rb(e,Dw.HYPERCUBE_PATH);return Sw(e)?t&&t.qDimensionInfo[1].qCardinal:1},isAutoSort:function(e){return Rb(e,Dw.AUTO_SORT,!1)},isSortByExpression:function(e){return 0!==Rb(e,`${Dw.SORT_CRITERIA}.sortByExpression`,0)},isSortByNumeric:function(e){return 0!==Rb(e,`${Dw.SORT_CRITERIA}.sortByNumeric`,0)},isSortByAscii:function(e){return 0!==Rb(e,`${Dw.SORT_CRITERIA}.sortByAscii`,0)}},Cw={cellBackgroundColor:!0,cellForegroundColor:!0,colorByAlternative:!0,colorByExpression:!0,tooltip:!0,urlLabel:!0,url:!0};var kw={create(e,t){if(!e||!Cw[e])throw new Error("Attribute Expressions Util: ID required");const n={};return t&&Object.keys(t).forEach((e=>{n[e]=t[e]})),n.id=e,n.qAttribute=!0,n},getById:(e,t,n)=>!!e&&(n=n||"id",e.filter((e=>e[n]===t))[0]),getIndexById(e,t,n){let i=-1;return e&&(n=n||"id",e.forEach(((e,r)=>{e[n]===t&&(i=r)}))),i},moveById(e,t,n,i){const r=this.getIndexById(e,n,i);t=t||[];const o=this.getIndexById(t,n,i);if(-1!==r&&-1===o){const n=e.splice(r,1);t.push(n[0])}return t},moveAllById(e,t,n,i){const r=e.filter((e=>e.id===n)),o=t.filter((e=>e.id===n)),s=r.filter((e=>!(o.filter((t=>t[i]===e[i])).length>0)));return[...t,...s]},moveByIdFromGroup(e,t,n,i,r){n=n||"qAttributeExpressions",r=r||"id";for(let o=0;o<e.length;o++){const s=e[o][n],a=t.length;if(this.moveById(s,t,i,r),a!==t.length)return t}return t},clean:e=>e.filter((e=>e&&e.id)),IDMAP:{CELL_BACKGROUND_COLOR:"cellBackgroundColor",CELL_FOREGROUND_COLOR:"cellForegroundColor",COLOR_BY_ALTERNATIVE:"colorByAlternative",COLOR_BY_EXPRESSION:"colorByExpression",TOOLTIP:"tooltip",CELL_LINK_LABEL:"urlLabel",CELL_LINK_URL:"url"}};var Ew={getColorByDefinition:function(e,t,n){const i={};let r,o,s;if("dimension"!==e)throw new Error("Default-property-logic.js: getColorByDefinition: Illegal input");return n.qLibraryId?(i.type="dimension",i.name=n.qLibraryId,i.id=n.qLibraryId):(i.type="field",t?(i.name=n.label||n.qDef,i.id=n.qDef):(r=n.qDef,o=!!r.qLabelExpression,s=r.qFieldLabels&&r.qFieldLabels[0],i.name=r.qFieldDefs[0],i.label=o?r.qLabelExpression:s?r.qFieldLabels[0]:r.qFieldDefs[0])),i}};var Aw={useMasterNumberFormat:function(e){e.quarantine={qNumFormat:e.qNumFormat||{},isCustomFormatted:e.isCustomFormatted||!1},e.qNumFormat=null,e.isCustomFormatted=void 0},useLocalFormat:function(e){var t,n;e.qNumFormat=(null===(t=e.quarantine)||void 0===t?void 0:t.qNumFormat)||{},e.isCustomFormatted=(null===(n=e.quarantine)||void 0===n?void 0:n.isCustomFormatted)||!1,e.quarantine=void 0},isUsingMasterNumberFormat:function(e){var t,n;return null!==(t=!(null==e||null===(n=e.quarantine)||void 0===n||!n.qNumFormat))&&void 0!==t&&t}};const Tw=["scatterplot","map"],Iw=["map"];var Rw={baseColor:{isSupported:e=>e&&e.length&&-1===Tw.indexOf(e),isDimSupported:e=>e&&e.length&&-1!==Iw.indexOf(e)},colorBy:{},colorByUpdater(e,t,n,i){this.updateColorDef(e,i,n),this.updateHypercubeAttributes(e,t,n)},updateColorDef(e,t,n){const i=Rb(n,"mode"),r=Rb(n,"auto"),o=Rb(e,`${t}qDimensions`,[]),s=Rb(e,`${t}qMeasures`,[]);let a,l,c,u;if(!r&&"byDimension"===i&&o.length)a=Rb(n,"byDimDef"),a&&zw(n,a.label),a&&a.activeDimensionIndex>-1?(a.activeDimensionIndex=Math.min(a.activeDimensionIndex,o.length-1),l=o[a.activeDimensionIndex],u=Ew.getColorByDefinition("dimension",!1,l),u.activeDimensionIndex=a.activeDimensionIndex,Lw(n,u)):a&&a.key||(l=o[o.length-1],c=kw.getById(l.qAttributeDimensions,kw.IDMAP.COLOR_BY_ALTERNATIVE),Lw(n,Ew.getColorByDefinition("dimension",!!c,c||l)));else{if(!r&&"byMeasure"===i&&o.length)throw new Error("not suported in any 444-chart");"byMultiple"===i&&s.length<2&&Nb(n,"mode","primary")}},updateHypercubeAttributes(e,t,n){const i=Rb(n,"mode"),r=Rb(n,"auto"),o=Rb(e,`${t}qDimensions`,[]),s=Rb(e,`${t}qMeasures`,[]),a=Rb(e,`${t}qLayoutExclude.qHyperCubeDef.qDimensions`,[]);!r&&"byDimension"===i&&o.length?Fw(n,!0,o,a,s,Rb(n,"byDimDef.label")):!r&&"byMeasure"===i&&o.length?Fw(n,!1,o,a,s,Rb(n,"byMeasureDef.label")):Nw(o,a)},setColorByPropertyDef:Lw,resolveColorByPropertyDef:Fw,clearColorByItem:Nw};function Nw(e,t){e.forEach((e=>{Ow(e,kw.IDMAP.COLOR_BY_ALTERNATIVE,"qAttributeDimensions"),Ow(e,kw.IDMAP.COLOR_BY_ALTERNATIVE,"qAttributeExpressions")})),t.forEach((e=>{Ow(e,kw.IDMAP.COLOR_BY_ALTERNATIVE,"qAttributeDimensions"),Ow(e,kw.IDMAP.COLOR_BY_ALTERNATIVE,"qAttributeExpressions")}))}function Ow(e,t,n){if(e[n]){const i=kw.getIndexById(e[n],t);i>=0&&e[n].splice(i,1)}else e[n]=[]}function Pw(e){return e.split(" ").length>1&&"="!==e[0]&&"["!==e[0]?`[${e}]`:e}function Lw(e,t,n,i){const r=n?"expression":t.type;let o=e.mode;switch(zw(e,t.label||t.name||""),r){case"field":o="byDimension",e.byDimDef={label:t.label||Pw(t.name),key:Pw(t.name),type:"expression",activeDimensionIndex:t.activeDimensionIndex};break;case"expression":o="byMeasure",e.byMeasureDef={label:n||t.label||t.name,key:n||t.name,type:"expression"};break;case"dimension":o="byDimension",e.byDimDef={label:t.name,key:t.id,type:"libraryItem",activeDimensionIndex:t.activeDimensionIndex};break;case"measure":o="byMeasure",e.byMeasureDef={label:t.name,key:t.id,type:"libraryItem"},e.formatting&&Aw.useMasterNumberFormat(e.formatting)}i||(e.auto=!1,e.mode=o)}function Fw(e,t,n,i,r,o){Nw(n,i);const s=n[n.length-1];if(s){const n=Rb(e,t?"byDimDef":"byMeasureDef"),i=Rb(e,"formatting.qNumFormat"),a=Rb(e,"formatting.isCustomFormatted");if(n){const e=kw.create(kw.IDMAP.COLOR_BY_ALTERNATIVE);switch(n.type){case"expression":e.label=o||n.label,t?e.qDef=n.key:(e.qExpression=n.key,i&&(e.qNumFormat=i,e.isCustomFormatted=a));break;case"libraryItem":if(!t){let t=-1;r.forEach(((e,i)=>{n.key===e.qLibraryId&&(t=i)})),e.matchMeasure=t,i&&(e.qNumFormat=i,e.isCustomFormatted=a)}e.qLibraryId=n.key,e.colorMapRef=n.key}t?(e.qSortBy={qSortByAscii:1},s.qAttributeDimensions.push(e)):s.qAttributeExpressions.push(e)}}}function zw(e,t){if(!t)return;const n="="===t.charAt(0);e.altLabel=n?{qStringExpression:{qExpr:t.substr(1)}}:t}function jw(e){return!!e&&(e.coloring&&e.coloring.baseColor&&e.coloring.baseColor.color?e.coloring.baseColor:!(!e.baseColor||!e.baseColor.color)&&e.baseColor)}function Hw(e){return"libraryItem"===Rb(e,"color.point.byDimDef.type")}function Bw(e){return"libraryItem"===Rb(e,"color.point.byMeasureDef.type")}function Vw(e){return!0===Rb(e,"color.point.auto")}function $w(e){return!Vw(e)&&"byDimension"===Rb(e,"color.point.mode")}function Ww(e){return!Vw(e)&&"byMeasure"===Rb(e,"color.point.mode")}var Uw={measuresHasBaseColors:function(e){return Rb(e,"layout.qHyperCube.qMeasureInfo",[]).filter((e=>!!jw(e))).length>0},dimensionsHasBaseColors:function(e){return Rb(e,"layout.qHyperCube.qDimensionInfo",[]).filter((e=>!!jw(e))).length>0},onGlobalChangeColors:function(e){Rw.updateColorDef(e,"qHyperCubeDef.",e.color.point)},onChangeCalcCond:function(e){var t;const n=null==e?void 0:e.qHyperCubeDef,i=null==e||null===(t=e.qUndoExclude)||void 0===t?void 0:t.qHyperCubeDef;n&&i&&(i.qCalcCond=n.qCalcCond,i.qCalcCondition=n.qCalcCondition)},isColorByDimension:$w,isColorByMeasure:Ww,isColorAuto:Vw,isColorByExpression:function(e){return!Vw(e)&&"byExpression"===Rb(e,"color.point.mode")},isColorBySingle:function(e){return!Vw(e)&&"primary"===Rb(e,"color.point.mode","primary")},isDimensionLibraryItem:Hw,isMeasureLibraryItem:Bw,showLegend:function(e){const t=Rb(e,"color.point.mode","primary");return"primary"!==t&&"byExpression"!==t&&!1===Vw(e)},showColorByLabel:function(e){const t=$w(e)&&!1===Hw(e),n=Ww(e)&&!1===Bw(e),i=Rb(e,"color.point.byDimDef.activeDimensionIndex")>-1;return t&&!i||n},hasDimValueColors:function(e,t){var n,i,r;return null===(n=null===(i=e.layout.qHyperCube.qDimensionInfo[t])||void 0===i||null===(r=i.coloring)||void 0===r?void 0:r.hasValueColors)||void 0===n||n}};function Yw(e,t){this.getSettings=e,this.getElements=t}function Xw(e){const t=e.qDef.qSortCriterias;t[0]||t.push({});const n=t[0],i=this.getSettings();Nb(n,"qSortByExpression",i.SORT_BY_EXPRESSION),Nb(n,"qSortByAscii",i.SORT_BY_ASCII),Nb(n,"qSortByNumeric",i.SORT_BY_NUMERIC),Nb(n,"qSortByLoadOrder",i.SORT_BY_LOAD_ORDER),n.qExpression||(n.qExpression={});const r=Kw(this.getElements());n.qExpression.qv=r.exp}function Kw(e){const t=e.filter((e=>e.isDefault));return 0===t.length?e[0]:t[0]}Yw.prototype.applyAutoSorting=Xw,Yw.prototype.applyDefaultCustomSorting=function(e,t){Xw.call(this,e);const n=Kw(this.getElements()),i=e.qDef.qSortCriterias[0];t.elementId=n.id,t.sortCriteria={},Nb(t.sortCriteria,"sortByExpression",i.qSortByExpression),Nb(t.sortCriteria,"sortByAscii",i.qSortByAscii),Nb(t.sortCriteria,"sortByNumeric",i.qSortByNumeric),Nb(t.sortCriteria,"sortByLoadOrder",i.qSortByLoadOrder)},Yw.prototype.applyCustomSorting=function(e,t){const n=e.qDef.qSortCriterias[0];if(Nb(n,"qSortByExpression",t.sortCriteria.sortByExpression),Nb(n,"qSortByAscii",t.sortCriteria.sortByAscii),Nb(n,"qSortByNumeric",t.sortCriteria.sortByNumeric),Nb(n,"qSortByLoadOrder",t.sortCriteria.sortByLoadOrder),1!==n.qSortByExpression&&-1!==n.qSortByExpression)return;n.qExpression||(n.qExpression={});if(t.elementId){const e=function(e,t){const n=e.filter((e=>e.id===t));0===n.length&&function(e){throw new Error(`Sorter: ${e}`)}(`Could not find any element matching the element '${t}'`);return n[0]}(this.getElements(),t.elementId);n.qExpression.qv=e.exp}else n.qExpression.qv=t.expression.qValueExpression.qExpr};const Gw={create:function(e,t){return new Yw(e,t)}};const Jw={applySorting:function(e,t,n){const i=n.autoSort,r=!!n.sortCriteria;i?e.applyAutoSorting(t):r?e.applyCustomSorting(t,n):e.applyDefaultCustomSorting(t,n)}};const Zw={ASCII:{ELEMENT:void 0,SORT_BY_EXPRESSION:void 0,SORT_BY_ASCII:1,SORT_BY_NUMERIC:1,SORT_BY_LOAD_ORDER:1}};Object.freeze(Zw.ASCII),Object.freeze(Zw);const Qw=rw(!0,{DIST_MAX:{ELEMENT:"distplot-exp-max",SORT_BY_EXPRESSION:-1,SORT_BY_ASCII:1,SORT_BY_NUMERIC:1,SORT_BY_LOAD_ORDER:1}},Zw);const eq={getSettings:function(e){return Rb(e,"qHyperCube.qDimensionInfo.1.qCardinal",1)>10?Qw.DIST_MAX:Qw.ASCII}};function tq(e,t,n,i){let r="Fractile";0===e?r="Min":1===e&&(r="Max");const o=t?ow.wrapExpression(t):"",s=n?ow.wrapExpression(n):"";return`${r}( total {{<outerDimString>}} Aggr( {{innerMeasureString}}, {{outerDimString,}} {{innerDimString}} ), ${e} )`.replace(/{{innerDimString}}/g,o).replace(/{{outerDimString}}/g,s).replace(/{{<outerDimString>}}/g,n?`<${s}>`:"").replace(/{{outerDimString,}}/g,n?`${s},`:"").replace(/{{innerMeasureString}}/g,(i||"").replace(/^=/,""))}const nq={getElementIds:function(){return[Dw.SORTING_ELEMENT_MIN_ID,Dw.SORTING_ELEMENT_MAX_ID]},getElements:function(e,t,n,i){const r=t[0],o=t[1],s=e[0],a=tq(0,r,o,s),l=tq(1,r,o,s);return[{id:Dw.SORTING_ELEMENT_MIN_ID,label:i.get("properties.distributionPlot.min"),exp:a,isDefault:Dw.SORTING_ELEMENT_MIN_ID===n.ELEMENT},{id:Dw.SORTING_ELEMENT_MAX_ID,label:i.get("properties.distributionPlot.max"),exp:l,isDefault:Dw.SORTING_ELEMENT_MAX_ID===n.ELEMENT}]},getFractileExpression:tq};function iq(e){throw new Error(`distributionplot-sorter.applySorting: ${e}`)}function rq(e,t,n,i){if(!e.qUndoExclude)return;e.sorting||(e.sorting={autoSort:!0});const r=e.qUndoExclude.qHyperCubeDef.qDimensions;r.length>=2?e.qUndoExclude.qHyperCubeDef.qInterColumnSortOrder=[0,2,1]:e.qUndoExclude.qHyperCubeDef.qInterColumnSortOrder=[1,0];const o=function(){return eq.getSettings(t)},s=Gw.create(o,(function(){const e=o();return nq.getElements(n.measures,n.dimensions,e,i)})),a=r[0],l=e.sorting;Jw.applySorting(s,a,l)}const oq={applySorting:function(e,t,n,i,r){return function(e){const t=e.qHyperCubeDef;t?t.qDimensions?t.qMeasures?(!t.qDimensions.length||t.qDimensions.length<2)&&iq("'qHyperCubeDef.qDimensions' has no outer dimension"):iq("no 'qHyperCubeDef.qMeasures' in properties arg"):iq("no 'qHyperCubeDef.qDimensions' in properties arg"):iq("no 'qHyperCubeDef' in properties arg")}(e),i?rq(e,t,i,r):uw.getAllHyperCubeExpressions(e.qHyperCubeDef,t.qHyperCube,n).then((n=>{rq(e,t,n,r)}))}},sq=`${Dw.SORT_CRITERIA}.sortByExpression`;const aq={updateSortOrder:function(e,t){if(!t)return;const n=Rb(e,sq);if(!(-1===n||1===n))return;const i=Rb(e,Dw.SORTING_ELEMENT_ID),r=Rb(t,Dw.SORTING_ELEMENT_ID),o=i===Dw.SORTING_ELEMENT_MAX_ID,s=i===Dw.SORTING_ELEMENT_MIN_ID&&r===Dw.SORTING_ELEMENT_MAX_ID,a=o&&(!!!r||r===Dw.SORTING_ELEMENT_MIN_ID),l=Rb(t,sq),c=o&&!(-1===l||1===l)&&1===n;s?Nb(e,sq,1):(a||c)&&Nb(e,sq,-1)}},lq=(e,t,n)=>({component:"styling-panel",chartTitle:"Object.DistributionPlot",translation:"LayerStyleEditor.component.styling",subtitle:"LayerStyleEditor.component.styling",ref:"components",useGeneral:!0,useBackground:e,items:n&&null!=n&&n.isEnabled("CLIENT_IM_3364")?{axisTitleSection:{translation:"properties.axis.title",component:"panel-section",items:t.getOptions("axis","axis.title")},axisLabelSection:{translation:"properties.axis.label",component:"panel-section",items:t.getOptions("axis","axis.label.name")}}:void 0});function cq(e){return!Rb(e,"color.point.auto")&&"byDimension"===Rb(e,"color.point.mode")&&Rb(e,"qHyperCubeDef.qMeasures.length",0)<=1}function uq(e){const{flags:t,translator:n}=e,i=e.anything.sense.theme,r=e.flags.isEnabled("SENSECLIENT_IM_2018_STYLINGPANEL_DIST_PLOT"),o=e.flags.isEnabled("SENSECLIENT_IM_2018_DIST_BG"),s=e=>({color:e,index:i.getDataColorPickerPalettes()[0].colors.indexOf(e)}),a={translation:"properties.colors",type:"items",items:{colors:{type:"items",items:{pointColor:{type:"items",translation:"properties.colorsAndLegend",grouped:!0,items:{colors:{type:"items",items:{autoColor:{ref:"color.point.auto",type:"boolean",translation:"properties.colors",component:"switch",defaultValue:!0,options:[{value:!0,translation:"Common.Auto"},{value:!1,translation:"Common.Custom"}]},colorMode:{ref:"color.point.mode",type:"string",component:"dropdown",options:()=>[{value:"primary",translation:"properties.colorMode.primary"},{value:"byExpression",translation:"properties.colorMode.byExpression"}],defaultValue:"primary",show:e=>!Rb(e,"color.point.auto",!0)},boxColor:{ref:"color.box.paletteColor",translation:"properties.distributionPlot.boxColor",type:"object",component:"color-picker",dualOutput:!0,defaultValue(){const e=i.getStyle(Dw.CHART_ID,"box","fill");return s(e)}},paletteColor:{ref:"color.point.paletteColor",translation:"properties.distributionPlot.pointColor",type:"object",component:"color-picker",dualOutput:!0,show:e=>!Rb(e,"color.point.auto",!0)&&"primary"===Rb(e,"color.point.mode","primary"),defaultValue(){const e=i.getDataColorSpecials().primary;return s(e)}},attributeExpression:{type:"string",component:"expression",expressionType:"measure",schemaIgnore:!0,ref:"color.point.expression.qValueExpression.qExpr",translation:"Common.Expression",show:e=>!Rb(e,"color.point.auto")&&"byExpression"===Rb(e,"color.point.mode")},expressionIsColor:{ref:"color.point.expressionIsColor",translation:"properties.expressionIsColor",type:"boolean",defaultValue:!0,show:!1}}}}}}}}},l={items:{showDisclaimer:{translation:"properties.showDisclaimer",type:"boolean",ref:"showDisclaimer",component:"switch",show:()=>t.isEnabled("SHOW_DISCLAIMER"),defaultValue:!0,options:[{value:!0,translation:"Common.Show"},{value:!1,translation:"properties.hide"}]}}},c=((e,t,n,i)=>i({theme:e,translator:t,config:{id:n,paths:["axis.title","axis.label.name","label.value"]}}))(i,n,Dw.CHART_ID,wx),u=((e,t,n)=>{const i={getOptions:(i,r)=>{const o=(e,t)=>({ref:`${r}.fontColor`,component:"color-picker",width:!1,defaultValue:()=>{const n=e.getStyle(t,`${r}.color`,"color");return{color:n,index:e.getDataColorPickerPalettes()[0].colors.indexOf(n)}}});return{labelSection:{component:"items",ref:"components",key:i,items:{fontFamily:{ref:`${r}.fontFamily`,component:"dropdown",options:()=>e.getOptions(`${r}.fontFamily`),defaultValue:()=>e.getDefaultValue(`${r}.fontFamily`)},...((t,n)=>({fontWrapper:{component:"inline-wrapper",items:{fontSize:{ref:`${r}.fontSize`,component:"dropdown",width:!0,options:()=>e.getOptions(`${r}.fontSize`),defaultValue:()=>e.getDefaultValue(`${r}.fontSize`)},fontColor:{...o(t,n)}}}}))(t,n)}}}}};return i})(c,i,Dw.CHART_ID),h={type:"items",translation:"properties.presentation",items:{styleEditor:r&&lq(o,u,t),orientation:{ref:"orientation",type:"string",component:"item-selection-list",defaultValue:"horizontal",horizontal:!0,items:[{component:"icon-item",icon:"direction_up_down",labelPlacement:"bottom",translation:"properties.orientation.vertical",value:"vertical"},{icon:"direction_left_right",component:"icon-item",labelPlacement:"bottom",translation:"Common.Horizontal",value:"horizontal"}]},showDistBackground:{ref:"presentation.visibleComponents",translation:"properties.show",type:"string",component:"dropdown",defaultValue:"points_box",options:[{value:"points_box",translation:"properties.distributionPlot.pointsAndBox"},{value:"points",translation:"properties.distributionPlot.pointsOnly"},{value:"box",translation:"properties.distributionPlot.boxOnly"}]},gridLines:{type:"items",snapshot:{tid:"property-gridLines"},items:{showGridLines:{ref:"gridlines.auto",type:"boolean",translation:"properties.gridLine.spacing",component:"switch",defaultValue:!0,options:[{value:!0,translation:"Common.Auto"},{value:!1,translation:"Common.Custom"}]},gridSpacing:{ref:"gridlines.spacing",type:"number",component:"dropdown",defaultValue:2,options:[{value:0,translation:"properties.gridLine.noLines"},{value:2,translation:"properties.gridLine.medium"},{value:3,translation:"properties.gridLine.narrow"}],show:e=>e.gridlines&&!e.gridlines.auto}}}}};h.items.bubbleScaleItems={type:"items",items:{bubbleScales:{type:"integer",component:"slider",ref:"dataPoint.bubbleScales",translation:"properties.dataPoints.bubbleSizes",min:20,max:Dw.BUBBLE_SCALES_MAX,step:5,defaultValue:100,show:e=>e.qHyperCubeDef.qMeasures.length<2&&"box"!==e.presentation.visibleComponents}}},h.items.jitter={type:"string",component:"switch",ref:"dataPoint.displacement",translation:"properties.distributionPlot.jitter",defaultValue:"none",options:[{value:"none",translation:"properties.off"},{value:"jitter",translation:"properties.on"}],show:e=>"box"!==e.presentation.visibleComponents};const d={uses:"axis.picasso.measureAxis",items:{startAt:{type:"string",component:"dropdown",translation:"properties.axis.startAt",readOnly:e=>!(e.measureAxis.autoMinMax||"min"===e.measureAxis.minMax&&0===e.measureAxis.min),options:[{value:"zero",translation:"properties.axis.startAt.zero"},{value:"lowest",translation:"properties.axis.startAt.lowest"}],defaultValue:"lowest",convertFunctions:{get(e,t,n,i){const{autoMinMax:r,minMax:o,min:s}=(null==i?void 0:i.measureAxis)||{};return!0===r?"lowest":r||"min"!==o||0!==s?e(t.type):"zero"},set(e,t,n,i,r){"zero"===e?(Nb(r,"measureAxis.autoMinMax",!1),Nb(r,"measureAxis.minMax","min"),Nb(r,"measureAxis.min",0)):Nb(r,"measureAxis.autoMinMax",!0)}},classification:{section:"axis",tags:["simple"],exclusive:!0}}}},f={uses:"axis.picasso.dimensionAxis",show:(e,t)=>Rb(t.layout,`${Dw.HYPERCUBE_PATH}.qDimensionInfo.length`)>1,items:{dimensionAxisTitle:{component:"header",type:"string",show:(e,t)=>Rb(t.layout,`${Dw.HYPERCUBE_PATH}.qDimensionInfo.length`)>1,classification:{section:"axis",tags:["simple"],exclusive:!0}},othersGroup:{items:{label:{show:(e,t)=>Rb(t.layout,`${Dw.HYPERCUBE_PATH}.qDimensionInfo.length`)>1&&"horizontal"!==Rb(t.layout,"orientation"),options:t.isEnabled("SENSECLIENT_LAYERED_LABELS")?[{value:"auto",translation:"Common.Auto"},{value:"horizontal",translation:"Common.Horizontal"},{value:"tilted",translation:"properties.labels.tilted"},{value:"layered",translation:"properties.labels.layered"}]:void 0},dock:{show:(e,t)=>Rb(t.layout,`${Dw.HYPERCUBE_PATH}.qDimensionInfo.length`)>1}}}}};function p(e,t){const n=Rb(e,t,void 0);n&&void 0!==n.label&&("="===n.label.charAt(0)?e.color.point.altLabel={qStringExpression:{qExpr:n.label.substr(1)}}:e.color.point.altLabel=n.label)}const m=(e,t)=>{var n,i,r;if("libraryItem"===(null===(n=e.color.point.byDimDef)||void 0===n?void 0:n.type)){var o,s,a,l,c;const n=null!==(o=null===(s=e.color.point.byDimDef)||void 0===s?void 0:s.key)&&void 0!==o?o:"",i=null!==(a=null===(l=t.handler.layout.qUndoExclude)||void 0===l||null===(c=l.qHyperCube)||void 0===c?void 0:c.qDimensionInfo)&&void 0!==a?a:[];for(let e=0;e<i.length;e++){const t=i[e].qAttrDimInfo;if(t)for(let e=0;e<t.length;e++)if(t[e].colorMapRef===n)return t[e].qFallbackTitle}return""}return null!==(i=null===(r=e.color.point.byDimDef)||void 0===r?void 0:r.label)&&void 0!==i?i:""},g=(e,t,i)=>{var r,o;if(null!==(r=e.qHyperCubeDef)&&void 0!==r&&null!==(o=r.qDimensions)&&void 0!==o&&o.length){var s,a,l,c,u;const t=null===(s=e.qHyperCubeDef)||void 0===s?void 0:s.qDimensions.map(((e,t)=>({value:t,label:n.get("properties.colorBy.currentDimension",t+1)})));return(null!==(a=null===(l=e.color)||void 0===l||null===(c=l.point)||void 0===c||null===(u=c.byDimDef)||void 0===u?void 0:u.activeDimensionIndex)&&void 0!==a?a:-1)<0&&t.push({value:-1,label:m(e,i)}),t}return[]},y=(e,t)=>{const n="measure"===Rb(e,"color.point.useBaseColors")&&Uw.measuresHasBaseColors(t),i="dimension"===Rb(e,"color.point.useBaseColors")&&Uw.dimensionsHasBaseColors(t);return Uw.isColorBySingle(e)&&!n&&!i},v=(e,t)=>!Rb(e,"color.point.auto",void 0)&&"primary"===Rb(e,"color.point.mode",void 0)&&!y(e,t),b={items:{disclaimer:{show:(e,n)=>!t.isEnabled("SIMPLE_PROPERTIES_LIBRARY_COLOR")&&v(e,n)},simpleItems:{show:(e,n)=>!!t.isEnabled("SIMPLE_PROPERTIES_LIBRARY_COLOR")||!v(e,n),items:{autoColor:{ref:"color.point.auto",undefinedValue:!1,label:e=>Rb(e,"color.point.auto")?n.get("Simple.Color.Auto",n.get("properties.colorMode.primary")):n.get("Common.Custom"),change:e=>{Rb(e,"color.point.auto")||(Nb(e,"color.point.mode","primary"),Nb(e,"color.point.useBaseColors","off"))}},colorMode:{ref:"color.point.mode",options:e=>{const t=[{value:"primary",translation:"properties.colorMode.primary"},{value:"byDimension",translation:"properties.colorMode.byDimension"}];return"byExpression"===Rb(e,"color.point.mode")&&t.push({value:"byExpression",translation:"properties.colorMode.byExpression"}),t},show:e=>!Uw.isColorAuto(e),change(e){if("primary"===Rb(e,"color.point.mode",void 0)){const t=Rb(e,"color.point.useBaseColors",void 0);void 0!==t&&"off"!==t&&Nb(e,"color.point.useBaseColors","off")}},globalChange(){}},colorByDimension:{ref:"color.point.byDimDef.activeDimensionIndex",options:g,show:(e,t,n)=>Uw.isColorByDimension(e)&&g(e,0,n).length>1,change(e){p(e,"color.point.byDimDef")}},baseColors:{type:"items",items:{useBaseColor:{ref:"color.point.useBaseColors",show(e,n){const i=Rb(e,"color.point.mode","primary");return t.isEnabled("SIMPLE_PROPERTIES_LIBRARY_COLOR")&&!Uw.isColorAuto(e)&&"primary"===i&&(Uw.measuresHasBaseColors(n)||Uw.dimensionsHasBaseColors(n))}}}},paletteColor:{ref:"color.point.paletteColor",translation:"properties.distributionPlot.pointColor",show:y},useDimColVal:{ref:"color.point.useDimColVal",show(e,n,i){var r,o,s;const a=null!==(r=null===(o=e.color.point)||void 0===o||null===(s=o.byDimDef)||void 0===s?void 0:s.activeDimensionIndex)&&void 0!==r?r:null,l=Uw.hasDimValueColors(i.handler,a);return t.isEnabled("SIMPLE_PROPERTIES_LIBRARY_COLOR")&&l&&Uw.isColorByDimension(e)&&Uw.isDimensionLibraryItem(e)}},boxColor:{ref:"color.box.paletteColor",translation:"properties.distributionPlot.boxColor",type:"object",component:"color-picker",dualOutput:!0,defaultValue(){const e=i.getStyle(Dw.CHART_ID,"box","fill");return s(e)},show:e=>!Rb(e,"color.point.auto",!0)}}}}},x={uses:"colorsAndLegend",items:{colors:{globalChange:Uw.onGlobalChangeColors,items:{autoColor:{ref:"color.point.auto",undefinedValue:!1},colorMode:{ref:"color.point.mode",options(e){const t=[];return t.push({value:"primary",translation:"properties.colorMode.primary"}),t.push({value:"byDimension",translation:"properties.colorMode.byDimension"}),Rb(e,"qHyperCubeDef.qDimensions.length",0)>=1&&t.push({value:"byExpression",translation:"properties.colorMode.byExpression"}),t},show:e=>!Uw.isColorAuto(e),globalChange(){}},colorByDimension:{ref:"color.point.byDimDef",show:e=>Uw.isColorByDimension(e),change(e){p(e,"color.point.byDimDef")}},colorByMeasure:{ref:"color.point.byMeasureDef",show:e=>Uw.isColorByMeasure(e),change(e){p(e,"color.point.byMeasureDef")}},colorByLabel:{ref:"color.point.altLabel",show:Uw.showColorByLabel,change(e){const t=Rb(e,"color.point.mode"),n=Rb(e,"color.point.altLabel","");let i;switch(t){case"byMeasure":i=e.color.point.byMeasureDef;break;case"byDimension":i=e.color.point.byDimDef}i&&(i.label=n.qStringExpression?`=${n.qStringExpression.qExpr}`:n)}},baseColors:{type:"items",items:{useBaseColor:{ref:"color.point.useBaseColors",show(e,t){const n=Rb(e,"color.point.mode","primary");return!Uw.isColorAuto(e)&&"primary"===n&&(Uw.measuresHasBaseColors(t)||Uw.dimensionsHasBaseColors(t))}},measureColor:{translation:"properties.libraryColors",component:"measure-color",show:(e,t)=>!Rb(e,"color.point.auto")&&"byMultiple"===Rb(e,"color.point.mode")&&"measure"===Rb(e,"color.point.useBaseColors")&&t.layout.qHyperCube.qMeasureInfo.length>1&&Uw.measuresHasBaseColors(t)}}},paletteColor:{ref:"color.point.paletteColor",translation:"properties.distributionPlot.pointColor",show(e,t){const n="measure"===Rb(e,"color.point.useBaseColors")&&Uw.measuresHasBaseColors(t),i="dimension"===Rb(e,"color.point.useBaseColors")&&Uw.dimensionsHasBaseColors(t);return Uw.isColorBySingle(e)&&!n&&!i}},useDimColVal:{ref:"color.point.useDimColVal",show:e=>Uw.isColorByDimension(e)&&Uw.isDimensionLibraryItem(e)},useMeasureGradient:{ref:"color.point.useMeasureGradient",translation:"properties.libraryColors",type:"boolean",component:"switch",schemaIgnore:!0,defaultValue:!1,options:[{value:!0,translation:"properties.on"},{value:!1,translation:"properties.off"}],show(e){const t=Rb(e,"color.point.auto"),n=Rb(e,"color.point.mode");return!t&&"byMeasure"===n&&"libraryItem"===Rb(e,"color.point.byMeasureDef.type")}},persistentColors:{ref:"color.point.persistent",show:e=>Rb(e,"color.point.auto")||"byDimension"!==Rb(e,"color.point.mode")||"libraryItem"!==Rb(e,"color.point.byDimDef.type")?cq(e):cq(e)&&!Rb(e,"color.point.useDimColVal")},colorSchemeMeasure:{ref:"color.point.measureScheme",show:e=>!Uw.isColorAuto(e)&&Uw.isColorByMeasure(e)},reverseScheme:{ref:"color.point.reverseScheme",change(e){e.color.reverseScheme=e.color.point.reverseScheme},show:e=>!Uw.isColorAuto(e)&&Uw.isColorByMeasure(e)},colorSchemeDimension:{ref:"color.point.dimensionScheme",show:e=>Uw.isColorByDimension(e)&&(!Uw.isDimensionLibraryItem(e)||!Rb(e,"color.point.useDimColVal"))},customRange:{show:e=>!Uw.isColorAuto(e),items:{autoMinMax:{ref:"color.point.autoMinMax",show:e=>Uw.isColorByMeasure(e)},min:{ref:"color.point.measureMin",show:e=>Uw.isColorByMeasure(e)&&!1===Rb(e,"color.point.autoMinMax"),invalid:e=>"minMax"===Rb(e,"color.point.minMax")&&Rb(e,"color.point.measureMin")>=Rb(e,"color.point.measureMax")},max:{ref:"color.point.measureMax",show:e=>Uw.isColorByMeasure(e)&&!1===Rb(e,"color.point.autoMinMax"),invalid:e=>"minMax"===Rb(e,"color.point.minMax")&&Rb(e,"color.point.measureMin")>=Rb(e,"color.point.measureMax")}}},attributeExpression:{ref:"color.point.expression.qValueExpression.qExpr",show:e=>Uw.isColorByExpression(e)},expressionIsColor:{ref:"color.point.expressionIsColor",show:!1},boxColor:{ref:"color.box.paletteColor",translation:"properties.distributionPlot.boxColor",type:"object",component:"color-picker",dualOutput:!0,defaultValue(){const e=i.getStyle(Dw.CHART_ID,"box","fill");return s(e)},show:e=>!Rb(e,"color.point.auto",!0)}}},simpleColors:b,legend:{show:Uw.showLegend,type:"items",items:{show:{snapshot:{tid:"property-legend"}},dock:{show:e=>Uw.showLegend(e)&&Rb(e,"legend.show",!0)},showTitle:{show:e=>Uw.showLegend(e)&&Rb(e,"legend.show",!0)}}}}},w={items:{labels:{items:{header:{show(e){var t,n;return(null===(t=e.qHyperCubeDef.qDimensions)||void 0===t?void 0:t.length)&&(null===(n=e.qHyperCubeDef.qMeasures)||void 0===n?void 0:n.length)}},dimensionTitle:{component:"checkbox",ref:"dimensionAxis.show",type:"string",translation:"Simple.Label.Dimension.Hide",defaultValue:"all",show(e){var t,n;return(null===(t=e.qHyperCubeDef.qDimensions)||void 0===t?void 0:t.length)>1&&(null===(n=e.qHyperCubeDef.qMeasures)||void 0===n?void 0:n.length)},convertFunctions:{get:(e,t,n,i)=>"labels"===i.dimensionAxis.show||"none"===i.dimensionAxis.show,set(e,t,n,i,r){r.dimensionAxis.show=e?"labels":"all"}}},measureTitle:{component:"checkbox",ref:"measureAxis.show",type:"string",translation:"Simple.Label.Measure.Hide",defaultValue:"all",show(e){var t,n;return(null===(t=e.qHyperCubeDef.qDimensions)||void 0===t?void 0:t.length)&&(null===(n=e.qHyperCubeDef.qMeasures)||void 0===n?void 0:n.length)},convertFunctions:{get:(e,t,n,i)=>"labels"===i.measureAxis.show||"none"===i.measureAxis.show,set(e,t,n,i,r){r.measureAxis.show=e?"labels":"all"}}}}}}},q={uses:"settings",items:{simpleLabels:w,general:l,presentation:h,colors:x||a,measureAxis:d,dimensionAxis:f}},M={type:"items",component:"expandable-items",translation:"properties.addons",items:{dataHandling:{uses:"dataHandling",items:{calcCond:{uses:"calcCond",change:Uw.onChangeCalcCond}}},refLines:{uses:"reflines",items:{colorBackground:{show:!1}}}}},D=xw.expression(`${Dw.SORT_CRITERIA}.sortByExpression`),S={type:"items",items:{toggled:D.items.toggled,sortByElement:{component:"sort-by-element",expressionRef:Dw.SORTING_EXPRESSION,elementRef:Dw.SORTING_ELEMENT_ID,show:_w.isSortByExpression,elements:e=>uw.getAllHyperCubeExpressions(e.properties.qHyperCubeDef,e.layout.qHyperCube,e.model.app).then((t=>{const i=eq.getSettings(e.layout);return nq.getElements(t.measures,t.dimensions,i,n)}))},order:D.items.order}},_={type:"items",translation:"properties.sorting",schemaIgnore:!0,grouped:!1,globalChange(e,t,n){n&&aq.updateSortOrder(e,n.prevProperties)},items:{autoSort:{ref:Dw.AUTO_SORT,type:"boolean",translation:"properties.sorting",component:"switch",defaultValue:!0,options:[{value:!0,translation:"Common.Auto"},{value:!1,translation:"Common.Custom"}],show:_w.hasMultipleDimensions,change(e,t,i,r){if(e&&_w.hasMultipleDimensions(e)&&t.layout)return oq.applySorting(e,t.layout,r.model.app,null,n)},classification:{section:"sorting",tags:["simple"]},reset(e){e.sorting={autoSort:!0}}},simpleSorting:{component:"sorting-with-elements",expressionRef:Dw.SORTING_EXPRESSION,elementRef:Dw.SORTING_ELEMENT_ID,sortCriteriasRef:Dw.SORT_CRITERIA,show:e=>_w.hasMultipleDimensions(e)&&!_w.isAutoSort(e),elements:e=>uw.getAllHyperCubeExpressions(e.handler.properties.qHyperCubeDef,e.handler.layout.qHyperCube,e.model.app).then((t=>{const i=eq.getSettings(e.layout);return nq.getElements(t.measures,t.dimensions,i,n)})),classification:{section:"sorting",tags:["simple"],exclusive:!0}},sortingItems:{type:"items",grouped:!0,show:e=>_w.hasMultipleDimensions(e)&&!_w.isAutoSort(e),items:{expression:S,numeric:xw.numeric(`${Dw.SORT_CRITERIA}.sortByNumeric`),ascii:xw.ascii(`${Dw.SORT_CRITERIA}.sortByAscii`),defaultSortMessage:{component:"text",translation:"properties.sorting.defaultSortingMessage",show:e=>!_w.isSortByExpression(e)&&!_w.isSortByNumeric(e)&&!_w.isSortByAscii(e)}}},noData:{component:"text",translation:"Common.NoData",style:"hint",show:e=>!_w.hasMultipleDimensions(e),classification:{section:"sorting",tags:["simple"]}}}};return{type:"items",component:"accordion",items:{data:{uses:"data",grouped:!0,items:{dimensions:{uses:"dimensions"},measures:{uses:"measures"}}},sorting:_,addons:M,settings:q}}}const hq={buildDefinition:function(e,t,n,i,r){const o=`${n}.qDef.qSortCriterias.0.`,s={type:"items",translation:"properties.sorting",icon:"ascending",show:t=>Rb(t,`${e}.qDimensions.length`,0)>1,items:{sortingOptions:{component:"radio-list",type:"number",diffs:[`${o}qSortByExpression`,`${o}qSortByNumeric`,`${o}qSortByAscii`],options:[{value:1,translation:"properties.sorting.ascending"},{value:-1,translation:"properties.sorting.descending"}],setPropertyValue(e,n,s){const a=s.layout;let l=dq(e,o).chart;l||(l="sortByAscii");const c=Rb(e,t);if(c.sortCriteria||(c.sortCriteria={}),c.autoSort){const t=i(a);if(t.ELEMENT)c.elementId=t.ELEMENT;else{const t=r(e,a);c.elementId=t[0]}}c.autoSort=!1,function(e,t){const n=e.sortCriteria;"sortByNumeric"!==t&&"sortByAscii"!==t||(n.sortByExpression=0);"sortByAscii"===t&&(n.sortByNumeric=0)}(c,l),c.sortCriteria[l]=n},getValue(e){const t=dq(e,o).dimension;return t?Rb(e,o+t):0}}}};return s}};function dq(e,t){const n={chart:"",dimension:""};return 0!==Rb(e,`${t}qSortByExpression`,0)?(n.chart="sortByExpression",n.dimension="qSortByExpression"):0!==Rb(e,`${t}qSortByNumeric`,0)?(n.chart="sortByNumeric",n.dimension="qSortByNumeric"):0!==Rb(e,`${t}qSortByAscii`,0)&&(n.chart="sortByAscii",n.dimension="qSortByAscii"),n}const fq={type:"items",component:"accordion",items:{data:{uses:"data"},sorting:hq.buildDefinition("qHyperCubeDef","sorting","qUndoExclude.qHyperCubeDef.qDimensions.0",eq.getSettings,nq.getElementIds),presentation:{uses:"presentation",items:{orientation:{ref:"orientation",type:"string",component:"item-selection-list",horizontal:!0,items:[{component:"icon-item",icon:"direction_up_down",labelPlacement:"bottom",translation:"properties.orientation.vertical",value:"vertical"},{icon:"direction_left_right",component:"icon-item",labelPlacement:"bottom",translation:"Common.Horizontal",value:"horizontal"}]},bubbleScales:{type:"integer",component:"slider",ref:"dataPoint.bubbleScales",translation:"properties.dataPoints.bubbleSizes",min:20,max:100,step:5,defaultValue:100,show:e=>e.qHyperCubeDef.qMeasures.length<2&&"box"!==e.presentation.visibleComponents},jitter:{type:"string",component:"switch",ref:"dataPoint.displacement",translation:"properties.distributionPlot.jitter",defaultValue:"none",options:[{value:"none",translation:"properties.off"},{value:"jitter",translation:"properties.on"}],show:e=>"box"!==e.presentation.visibleComponents}}}}},pq={items:{color:{uses:"color",items:{mode:{options:[{value:"auto",translation:"Common.Auto"},{value:"primary",translation:"properties.colorMode.primary"},{value:"byDimension",translation:"properties.colorMode.byDimension"}],diffs:["color.point.mode","color.point.auto"],setPropertyValue(e,t){"auto"===t?e.color.point.auto=!0:(e.color.point.auto=!1,e.color.point.mode=t)},getValue:e=>Uw.isColorAuto(e)?"auto":e.color.point.mode},dimension:{show:e=>Uw.isColorByDimension(e),items:{colorScheme:{ref:"color.point.dimensionScheme"},persistentColors:{ref:"color.point.persistent"}}},measure:{show:e=>Uw.isColorByMeasure(e),items:{sequential:{ref:"color.point.measureScheme"}}},legend:{show:Uw.showLegend}}}}};function mq(e){var t;if(null!==(t=e.anything)&&void 0!==t&&t.sense)return{definition:uq(e),softDefinition:fq,support:{cssScaling:!1,snapshot:!0,export:!0,exportData:!0,sharing:!0,viewData:!0},options:{usingDerivedProperties:!0,colorByPath:"color.point"},onSoftPropertyChange(e,t){Uw.onGlobalChangeColors(t)},importProperties:(t,n,i)=>{const r=jx(e);i.mapProperties();return Yx({dataDefinition:r,defaultPropertyValues:{defaultDimension:i.getDefaultDimensionProperties(),defaultMeasure:i.getDefaultMeasureProperties()},exportFormat:t,initialProperties:n})},exportProperties:(e,t,n)=>Xx({propertyTree:e,viewDataMode:n})}}rw(!0,fq,pq);const gq={getChar(e){let t,n=e;return n>9?(t=65+n-10,t>90&&(t+=6)):n=`${n}`.charCodeAt(0),[48,111,79,105,73,108].indexOf(t)>-1?this.getChar(n+1):String.fromCharCode(t)},base62(e){const t=this.getChar(e%62),n=Math.floor(e/62);return n>0?this.base62(n)+t:t},id(){return this.base62(Math.round(99e11*Math.random()+1e11)).replace(/\W/g,"")}};function yq(){return gq.id()}const vq="scrollbar";function bq(e,t,n){return"y"===e?xq(t,n):function(e){return"far"===e?"top":"bottom"}(t)}function xq(e,t){const n=e||"near";return t&&"near"===n||!t&&"far"===n?"right":"left"}var wq={getAxisDock:bq,getOppositeAxisDock:function(e,t,n){return bq(e,"far"===t?"near":"far",n)},getYAxisDock:xq};const qq=new RegExp("[A-Za-zªµºÀ-ÖØ-öø-ʸʻ-ˁː-ˑˠ-ˤˮͰ-ͳͶ-ͽΆΈ-ϵϷ-҂Ҋ-։ः-हऻऽ-ीॉ-ौॎ-ॐक़-ॡ।-ॿং-হঽ-ীে-ৌৎ-ৡ০-ৱ৴-৺ਃ-ਹਾ-ੀਖ਼-੯ੲ-ੴઃ-હઽ-ીૉ-ૌૐ-ૡ૦-૯ଂ-ହଽ-ାୀେ-ୌୗ-ୡ୦-୷ஃ-ிு-ௌௐ-௲ఁ-ఽు-ౄౘ-ౡ౦-౯౿-ಹಽ-ೋೕ-ೡ೦-ീെ-ൌൎ-ൡ൦-ෆා-ෑෘ-ะา-ำเ-ๆ๏-ະາ-ຳຽ-ໆ໐-༗༚-༴༶༸༾-ཬཿ྅ྈ-ྌ྾-࿅࿇-ာေးျ-ြဿ-ၗၚ-ၝၡ-ၰၵ-ႁႃ-ႄႇ-ႌႎ-ႜ႞-ፚ፠-ᎏᎠ-Ᏼᐁ-ᙿᚁ-ᚚᚠ-ᜑᜠ-ᜱ᜵-ᝑᝠ-ᝰក-ាើ-ៅះ-ៈ។-៚ៜ០-៩᠐-ᢨᢪ-ᤜᤣ-ᤦᤩ-ᤱᤳ-ᤸ᥆-᧚ᨀ-ᨖᨙ-ᩕᩗᩡᩣ-ᩤᩭ-ᩲ᪀-᪭ᬄ-ᬳᬵᬻᬽ-ᭁᭃ-᭪᭴-᭼ᮂ-ᮡᮦ-ᮧ᮪-ᯥᯧᯪ-ᯬᯮ᯲-ᰫᰴ-ᰵ᰻-᱿᳓᳡ᳩ-ᳬᳮ-ᶿḀ-ᾼιῂ-ῌῐ-Ίῠ-Ῥῲ-ῼⁱⁿₐ-ₜℂℇℊ-ℓℕℙ-ℝℤΩℨK-ℭℯ-ℹℼ-ℿⅅ-ⅉⅎ-⅏Ⅰ-ↈ⌶-⍺⎕⒜-ⓩ⚬⠀-⣿Ⰰ-ⳤⳫ-ⳮⴀ-⵰ⶀ-ⷞ々-〇〡-〩〱-〵〸-〼ぁ-ゖゝ-ゟァ-ヺー-ㆺㇰ-㈜㈠-㉏㉠-㉻㉿-㊰㋀-㋋㋐-㍶㍻-㏝㏠-㏾㐀-䶵一-ꒌꓐ-ꘌꘐ-ꙮꚀ-ꛯ꛲-꛷Ꜣ-ꞇ꞉-ꠁꠃ-ꠅꠇ-ꠊꠌ-ꠤꠧ꠰-꠷ꡀ-ꡳꢀ-ꣃ꣎-꣙ꣲ-ꤥ꤮-ꥆꥒ-ꥼꦃ-ꦲꦴ-ꦵꦺ-ꦻꦽ-ꨨꨯ-ꨰꨳ-ꨴꩀ-ꩂꩄ-ꩋꩍ-ꪯꪱꪵ-ꪶꪹ-ꪽꫀꫂ-ꯤꯦ-ꯧꯩ-꯬꯰-ﬗA-Za-zヲ-ᅵ]"),Mq=new RegExp("[־׀׃׆א-״߀-ߪߴ-ߵߺ-ࠕࠚࠤࠨ࠰-ࡘ࡞יִײַ-ﬨשׁ-ﭏ]"),Dq=new RegExp("[؈؋؍؛-ي٭-ٯٱ-ەۥ-ۦۮ-ۯۺ-܍ܐܒ-ܯݍ-ޥޱﭐ-ﴽﵐ-﷼ﹰ-ﻼ]");function Sq(e){return qq.test(e)}function _q(e){return Mq.test(e)||Dq.test(e)}var Cq={lrm:String.fromCharCode(8206),rlm:String.fromCharCode(8207),detectTextDirection:function(e){const t=e?e.length:0;let n,i;for(n=0;n<t;n++){if(i=e[n],Sq(i))return"ltr";if(_q(i))return"rtl"}return"ltr"}};var kq={lineSettings:function(e,t){var n;const i={value:0,line:{stroke:void 0!==t.paletteColor?t.theme.getColorPickerColor(t.paletteColor):"transparent",strokeDasharray:null==t||null===(n=t.style)||void 0===n?void 0:n.lineType}};return rw(!0,i,e||{})},lineLabelSettings:function(e,t){const n=t&&t.chartID;let i=t.theme.getStyle(n,"referenceLine.label.name","color");const r=t.theme.getStyle(n,"referenceLine.label.name","fontSize"),o=t.theme.getStyle(n,"referenceLine.label.name","fontFamily");return t.paletteColor?i=t.theme.getColorPickerColor(t.paletteColor):i||(i="transparent"),rw(!0,{value:0,line:{stroke:"transparent"},label:{align:"center",vAlign:"middle",text:"",fill:i,fontFamily:o,fontSize:r,maxWidthPx:135}},e||{})},isVisible:e=>e&&!1!==e.show&&0!==e.show&&"0"!==e.show&&void 0!==e.refLineExpr,getRefLineTitle:function({refLine:e,label:t,valueString:n}){return!1!==e.showValue?!1!==e.showLabel?`${t} ${Cq.lrm}(${n})${Cq.lrm}`:`${Cq.lrm}(${n})${Cq.lrm}`:!1!==e.showLabel?t:""}};const Eq={SHOW_AXIS_LABELS_OPTIONS:["all","labels"],SHOW_TITLE_OPTIONS:["all","title"],HORIZONTAL:"horizontal",VERTICAL:"vertical",LAYOUTSETTINGS:{lasso:{displayOrder:1e4},rangeDim:{displayOrder:1e4},rangeMeasure:{displayOrder:1e4},rangeMinor:{displayOrder:1e4},scrollBar:{minimumLayoutMode:"SPARK",prioOrder:-1,displayOrder:100},refLines:{minimumLayoutMode:"SPARK",prioOrder:60,displayOrder:-10},measureAxisTitle:{minimumLayoutMode:"XSMALL",prioOrder:30,displayOrder:90},dimensionAxisTitle:{minimumLayoutMode:"XSMALL",prioOrder:30,displayOrder:90},measureAxis:{minimumLayoutMode:"XSMALL",prioOrder:10,displayOrder:80},dimensionAxis:{minimumLayoutMode:"XSMALL",prioOrder:10,displayOrder:80},gridLines:{minimumLayoutMode:"XSMALL",displayOrder:-100},refLinesLabels:{minimumLayoutMode:"SMALL",prioOrder:60,displayOrder:0}}};Eq.DEFAULT_CHART_ORIENTATION=Eq.HORIZONTAL;function Aq(e,t){const n=t||{},i=n.measureAxisProperties||{},r=n.dimensionAxisProperties||{},o=n.orientation||Eq.DEFAULT_CHART_ORIENTATION,s=o===Eq.HORIZONTAL,a=s?"x":"y",l=s?"y":"x",c=Eq.SHOW_AXIS_LABELS_OPTIONS,u=Eq.SHOW_TITLE_OPTIONS,h=c.includes(i.show),d=!!n.measureTitleText&&u.includes(i.show),f=n.includeDimensionAxis&&c.includes(r.show),p=n.includeDimensionAxis&&!!n.dimensionTitleText&&u.includes(r.show),m=n.gridlines&&!(!n.gridlines.auto&&0===n.gridlines.spacing),g=n.refLines&&n.refLines.some((e=>e.show)),y=[];if(h&&function(e,t,n,i){let r={scale:"measure",settings:t.axisLabelStyle||{},forceBounds:i&&!i.autoMinMax&&i.showBounds};r=rw(r,Eq.LAYOUTSETTINGS.measureAxis);const o=Iq(t,n);e.addComponent(`${n}-axis`,r,o)}(e,n,a,i),d&&function(e,t,n){let i={text:t.measureTitleText,style:t.axisTitleStyle||{}};i=rw(i,Eq.LAYOUTSETTINGS.measureAxisTitle);const r=function(e,t){return Iq(e,t)}(t,n);e.addComponent(`${n}-axis-title`,i,r)}(e,n,a),function(e,t,n,i){let r=t.measureScaleSettings;const o={isRtl:t.isRtl,source:t.measureSource,orientation:n,measureAxisProperties:i};i&&i.spacing>0&&(r=rw(!0,r||{},{component:{ticks:{distance:100*i.spacing}}}));e.addScale("measure-scale",r,o)}(e,n,o,i),f&&function(e,t,n){let i={scale:"dimension",settings:t.axisLabelStyle||{}};i=rw(i,Eq.LAYOUTSETTINGS.dimensionAxis);const r=Rq(t,n);rw(!0,i,t.dimensionAxisSettings||{}),e.addComponent(`${n}-axis`,i,r)}(e,n,l),p&&function(e,t,n){let i={text:t.dimensionTitleText,style:t.axisTitleStyle||{}};i=rw(i,Eq.LAYOUTSETTINGS.dimensionAxisTitle);const r=function(e,t){return Rq(e,t)}(t,n);e.addComponent(`${n}-axis-title`,i,r)}(e,n,l),n.includeDimensionAxis&&function(e,t,n){const i={isRtl:t.isRtl,source:t.dimensionSource,orientation:n===Eq.HORIZONTAL?Eq.VERTICAL:Eq.HORIZONTAL};e.addScale("dimension-scale",t.dimensionScaleSettings,i)}(e,n,o),m&&function(e,t,n){let i={ticks:{show:!0},minorTicks:{show:!t.auto&&!t.auto&&3===t.spacing}};i=rw(i,Eq.LAYOUTSETTINGS.gridLines),i[n]={scale:"measure"},e.addComponent("grid-line",i)}(e,n.gridlines,a),n.hasNavigation&&function(e,t,n,i){const r=e.getSettings();r.scroll={dimension:{viewSize:n.scrollSettings&&n.scrollSettings.viewSize||0,max:n.scrollSettings&&n.scrollSettings.max||0}};const o={isRtl:n.isRtl,chartID:n.chartID,isHorizontal:!i},s=rw({},Eq.LAYOUTSETTINGS.scrollBar);e.addComponent("scrollbar",s,o),Tq(t,function(e){function t(t,n){if(!n||!e())return!1;const i={x:n.center.x-n.deltaX,y:n.center.y-n.deltaY};return this.chart.componentsFromPoint(i).some((e=>e.settings.key===vq))}const n={type:"Tap",options:{enable:t},events:{tap(e){this.chart.component(vq).emit("tap",e)}}},i={type:"Pan",options:{enable:t},events:{panstart(e){this.chart.component(vq).emit("panStart",e)},pan(e){this.chart.component(vq).emit("panMove",e)},panend(e){this.chart.component(vq).emit("panEnd",e)},pancancel(e){this.chart.component(vq).emit("panCancel",e)}}};return[n,i]}(n.isNavigationEnabledFn))}(e,y,n,s),g&&function(e,t,n,i){const r=wq.getAxisDock(n,i.dock,t.isRtl);let o={key:"ref-line",style:{oob:{show:!1}},lines:{x:[],y:[]}};o=rw(o,Eq.LAYOUTSETTINGS.refLines);let s={key:`ref-line-labels-${yq()}`,require:["renderer","chart"],dock:wq.getOppositeAxisDock(n,i.dock,t.isRtl),preferredSize(){if("x"===n)return 26;const t=this.renderer.measureText,i=this.chart.formatter({data:e.settings.scales.measure.data}),r=s.lines.y.map((e=>{const n=!1!==e.label.showValue?`(${i(e.value)})`:"",r=`${e.label.text} ${n}`,o=e.label.text&&n?` ${n}`:n;return{wanted:t({text:r,fontSize:e.fontSize,fontFamily:e.fontFamily}).width,required:t({text:o,fontSize:e.fontSize,fontFamily:e.fontFamily}).width}})),o=r[0];for(let e=1;e<r.length;e++)r[e].wanted>o.wanted&&(o.wanted=r[e].wanted),r[e].required>o.required&&(o.required=r[e].required);const a=12;return o.required+a>100?o.required+a:Math.min(o.wanted+a,100)},lines:{x:[],y:[]}};s=rw(s,Eq.LAYOUTSETTINGS.refLinesLabels),t.refLines.forEach((i=>{if(!i.show)return;const a=i.refLineExpr&&i.refLineExpr.value,l=rw(!0,{},t,{paletteColor:i.paletteColor,style:i.style,chartID:e.options.chartID}),c=kq.lineSettings({scale:"measure",dir:n,value:a},l);o.lines[n].push(c);const u=kq.lineLabelSettings({scale:"measure",value:a,label:{text:!1!==i.showLabel?i.label:"",showValue:!1!==i.showValue}},l);"x"===n?u.label.vAlign="near"===r?1:0:u.label.align="near"===r?0:1,s.lines[n].push(u)})),e.addComponent("ref-line",o,{}),e.addComponent("ref-line",s,{})}(e,n,a,i),n.enableLasso&&n.selectionsEnabled){!function(e,t){const n={brushKey:t.brushKey,brushComponents:t.brushComponents,brushData:t.brushData};e.addComponent("lasso",Eq.LAYOUTSETTINGS.lasso,n)}(e,n.lasso||{})}if(n.enableDimRange&&n.includeDimensionAxis&&n.selectionsEnabled){!function(e,t,n,i,r){let o={key:"rangeDim"};o=rw(o,Eq.LAYOUTSETTINGS.rangeDim);const s={brushKey:t.brushKey,brushAxis:t.brushAxis,brushArea:t.brushArea,brushScale:t.brushScale,isHorizontal:!n,dock:i,isRtl:r};e.addComponent("range",o,s)}(e,n.dimRange||{},s,Rq(n,l).dock,n.isRtl)}if(n.enableMeasureRange&&n.selectionsEnabled){!function(e,t,n,i,r){let o={key:"rangeMeasure"};o=rw(o,Eq.LAYOUTSETTINGS.rangeMeasure);const s={brushKey:t.brushKey,brushAxis:t.brushAxis,brushArea:t.brushArea,brushScale:t.brushScale,multiple:t.multiple,isHorizontal:n,dock:i,isRtl:r};e.addComponent("range",o,s)}(e,n.measureRange||{},s,Iq(n,a).dock,n.isRtl)}if(n.enableAreaRange&&n.selectionsEnabled){!function(e,t,n,i,r){let o={key:"rangeMinor"};o=rw(o,Eq.LAYOUTSETTINGS.rangeMinor);const s={brushKey:t.brushKey,brushAxis:t.brushAxis,brushData:t.brushData,brushArea:t.brushArea,brushComponents:t.brushComponents,brushScale:t.brushScale,multiple:t.multiple,isHorizontal:"measure"===t.brushScale?n:!n,dock:i,isRtl:r,chartInstance:t.chartInstance};e.addComponent("range-area",o,s)}(e,n.areaRange||{},s,Rq(n,l).dock,n.isRtl)}n.brushActions&&Tq(y,n.brushActions),y.length&&function(e,t){e.addInteraction({},{gestures:t})}(e,y)}function Tq(e,t){t.forEach((t=>{e.push(t)}))}function Iq(e,t){return{dock:e.measureAxisProperties&&e.measureAxisProperties.dock,direction:t,isRtl:e.isRtl}}function Rq(e,t){return{dock:e.dimensionAxisProperties&&e.dimensionAxisProperties.dock,direction:t,isRtl:e.isRtl}}function Nq(e,t){const n=t||{},i=!n.orientation||"horizontal"===n.orientation,r=!!n.isRtl,o={name:n.name||"scale",component:{invert:i&&r,minorTicks:{count:1},range:n.range||void 0,domain:n.domain||void 0,trackBy:n.trackBy||"id"}};return rw(!0,{},o,e||{})}function Oq(e,t){const n=t&&t.chartID,i=t&&t.dock,r=t&&t.direction,o=t&&t.isRtl,s=t.theme.getStyle(n,"axis.line.major","color"),a=t.theme.getStyle(n,"axis.title","fontSize"),l=t.theme.getStyle(n,"axis.title","color"),c=t.theme.getStyle(n,"axis.label.name","color"),u=t.theme.getStyle(n,"axis.label.name","fontSize"),h=t.theme.getStyle(n,"axis.title","fontFamily"),d=t.theme.getStyle(n,"axis.label.name","fontFamily"),f={key:"axis",type:"axis",dock:wq.getAxisDock(r,i,o),brush:{trigger:[],consume:[]},settings:{title:{fontSize:a,fontFamily:h,fill:l},line:{show:!0,strokeWidth:1,stroke:s},labels:{fill:c,fontSize:u,fontFamily:d,tiltAngle:o?-40:40,maxEdgeBleed:75,maxSize:150,mode:"auto"},ticks:{stroke:s},minorTicks:{stroke:s}}},p=rw(!0,{},f,e||{});return p.brush.consume.forEach((e=>{e.style.active.strokeWidth=0})),p}function Pq(e,t){const n=t&&t.chartID,i=t&&t.dock,r=t&&t.direction,o=t&&t.isRtl,s=t.theme.getStyle(n,"axis.title","fontSize"),a=t.theme.getStyle(n,"axis.title","color"),l=t.theme.getStyle(n,"axis.title","fontFamily"),c={key:"text",type:"text",dock:wq.getAxisDock(r,i,o)||"bottom",displayOrder:0,style:{text:{fontSize:s,fontFamily:l,fill:a}}};return rw(!0,{},c,e||{})}Nq.measureScale=function(e,t){let n=(t||{}).source||[];"string"==typeof n&&(n=[n]);const i={name:"measure",component:{expand:.1,data:{fields:n.map((e=>({field:e})))}}},r=t&&t.measureAxisProperties;r&&!r.autoMinMax&&(["min","minMax"].includes(r.minMax)&&(i.component.min=r.min),["max","minMax"].includes(r.minMax)&&(i.component.max=r.max));const o=Nq(rw(!0,i,e||{}),t);return!(e&&e.component&&void 0!==e.component.invert)&&t&&"vertical"===t.orientation&&(o.component.invert=!o.component.invert),o},Nq.dimensionScale=function(e,t){const n={name:"dimension",component:{trackBy:"id",type:"band",data:{extract:{field:t&&t.source||"",props:{label:e=>e.qText||""}}},label:e=>e.datum.label.value}};return Nq(rw(!0,n,e||{}),t)},Oq.xAxis=function(e,t){return Oq(rw(!0,{key:"x-axis",scale:"x"},e||{}),t)},Oq.yAxis=function(e,t){const n=t&&t.dock,i=t&&t.isRtl,r={key:"y-axis",scale:"y",dock:wq.getYAxisDock(n,i)};return Oq(rw(!0,r,e||{}),t)},Pq.xAxisTitle=function(e,t){return Pq(rw(!0,{key:"x-axis-title"},e||{}),t)},Pq.yAxisTitle=function(e,t){const n=t&&t.dock,i=t&&t.isRtl,r={key:"y-axis-title",dock:wq.getYAxisDock(n,i)||"left"};return Pq(rw(!0,r,e||{}),t)};var Lq={getBublesAlign:function(e,t,n){let i=e&&"far"!==t||!e&&"far"===t;return!e&&n&&(i=!i),i?"start":"end"},getDock:function(e,t){const n=[];let i;return e&&n.push(`@${e}`),t&&n.push(`@${t}`),n.length&&(i=n.join(",")),i}};const Fq={SPARK:{width:0,height:0},XSMALL:{width:150,height:75},SMALL:{width:300,height:150},MEDIUM:{width:400,height:220},FULL:{width:550,height:450}};function zq(){return Fq}function jq(e){const t=e.data.end;return e.dataset(t.source.key).field(t.source.field).formatter()(t.value)}zq.getLayoutModeKeys=function(){const e=[];let t;for(t in Fq)e.push(t);return e};const Hq={left:"left",right:"right",up:"top",down:"bottom"};function Bq(e,t,n){switch(e){case"scale":return Nq(t,n);case"measure-scale":return Nq.measureScale(t,n);case"dimension-scale":return Nq.dimensionScale(t,n);case"axis":return Oq(t,n);case"box-marker":return function(e){return rw(!0,{},{key:"box-marker",type:"box-marker",settings:{minor:{scale:"x"},orientation:"horizontal"},brush:{trigger:[],consume:[]}},e||{})}(t);case"point-marker":return function(e){return rw(!0,{},{key:"point-marker",type:"point-marker",settings:{},brush:{trigger:[],consume:[]}},e||{})}(t);case"scrollbar":return function(e,t){const n=t&&t.isRtl,i=t&&t.chartID,r=t&&t.isHorizontal,o={key:"scrollbar",type:"scrollbar",scroll:"dimension",dock:r?"bottom":n?"left":"right",settings:{backgroundColor:t.theme.getStyle(i,"","backgroundColor"),invert:n&&r}};return rw(!0,{},o,e||{})}(t,n);case"text":return Pq(t,n);case"lasso":return function(e,t){const n=t&&t.brushKey,i=t&&t.brushComponents?t.brushComponents:[],r=t&&t.brushData?t.brushData:["elemNo"],o={type:"brush-lasso",key:"lasso",displayOrder:99,settings:{brush:{components:[]},lasso:{fill:"rgba(0, 0, 0, 0)",stroke:"rgba(102,102,102,1)",strokeWidth:2,opacity:1,strokeDasharray:null},startPoint:{r:10,fill:"rgba(0, 152, 69, 1)",strokeWidth:0,opacity:1}}};return i.forEach((e=>{o.settings.brush.components.push({contexts:n?[n]:void 0,key:e,data:r})})),rw(!0,{},o,e||{})}(t,n);case"range":return function(e,t){const n=t&&t.brushKey,i=t&&t.brushAxis,r=t&&t.brushArea,o=t&&t.brushScale,s=t&&t.isHorizontal,a=t&&t.dock,l=t&&t.isRtl,c={type:"brush-range",key:"range",displayOrder:99,dock:Lq.getDock(i,r),settings:{brush:n,fill:"rgba(0, 0, 0, 0)",scale:o,multiple:!t||!1!==t.multiple||t.multiple,direction:s?"horizontal":"vertical",target:{component:i,fill:"rgba( 82, 204, 82, 0.2 )",fillActive:"rgba(82, 204, 82, 0.4)"},bubbles:{align:Lq.getBublesAlign(s,a,l)}}};return rw(!0,{},c,e||{})}(t,n);case"range-area":return function(e,t){const n=t&&t.brushKey,i=t&&t.brushAxis,r=t&&t.brushComponents?t.brushComponents:[],o=t&&t.brushData?t.brushData:["elemNo"],s=t&&t.brushArea,a=t&&t.isHorizontal,l=t&&t.dock,c=t&&t.isRtl,u=t&&t.chartInstance;let h=!0;const d={type:"brush-area-dir",key:"area",displayOrder:99,dock:Lq.getDock(i,s),settings:{brush:{components:[]},direction:a?"horizontal":"vertical",target:{component:i,fill:"rgba( 82, 204, 82, 0.2 )",fillActive:"rgba(82, 204, 82, 0.4)"},bubbles:{align:Lq.getBublesAlign(a,l,c),label:e=>h?(h=!1,u.dataset(e.binStart.source.key).field(e.binStart.source.field).formatter()(e.binStart.value)):(h=!0,u.dataset(e.binEnd.source.key).field(e.binEnd.source.field).formatter()(e.binEnd.value))},multiple:!t||!1!==t.multiple||t.multiple}};return r.forEach((e=>{d.settings.brush.components.push({contexts:n?[n]:void 0,key:e,data:o,action:"add"})})),rw(!0,{},d,e||{})}(t,n);case"categorical-legend":return function(e,t){const n=t&&t.chartID,i=t&&t.isRtl;let r=t&&t.dock||"auto";const o=t&&t.show;"auto"===r&&(r=t.chartHeight/t.chartWidth<1?i?"left":"right":"bottom");const s=t.theme.getStyle(n,"legend.title","color"),a=t.theme.getStyle(n,"legend.title","fontSize"),l=t.theme.getStyle(n,"legend.label","color"),c=t.theme.getStyle(n,"legend.label","fontSize"),u=t.theme.getStyle(n,"legend.title","fontFamily"),h={key:"legend",type:"legend-cat",dock:r,show:o,scale:{type:"color"},settings:{title:{anchor:"middle"},layout:{direction:i?"rtl":"ltr",size:"top"===r||"bottom"===r?2:1,vertical:"top"===r||"bottom"===r?16:8},navigation:{button:{class:{"lui-fade-button":!0},content:(e,t)=>e("span",{style:{pointerEvents:"none"},class:["lui-button__icon","lui-icon",`lui-icon--triangle-${Hq[t.direction]}`].join(" ")})}}},style:{item:{label:{fontSize:c,fontFamily:t.theme.getStyle(n,"legend.label","fontFamily"),fill:l,lineHeight:1,wordBreak:"break-word"},margin:{top:5,left:10,right:10,bottom:10},shape:{type:t.type?t.type:"square",size:3*parseInt(c,10)/4}},title:{show:t.showTitle,fontSize:a,fontFamily:u,fill:s}}};return rw(!0,{},h,e)}(t,n);case"sequential-legend":return function(e,t){const n=t&&t.chartID,i=t&&t.isRtl;let r=t.dock||"auto";"auto"===r&&(r=t.chartHeight<t.chartWidth?i?"left":"right":"bottom");const o=t.theme.getStyle(n,"legend.title","color"),s=t.theme.getStyle(n,"legend.title","fontSize"),a=t.theme.getStyle(n,"legend.title","fontFamily"),l=t.theme.getStyle(n,"legend.label","color"),c=t.theme.getStyle(n,"legend.label","fontSize"),u=t.theme.getStyle(n,"legend.label","fontFamily");function h(e){switch(e){case"left":return 0;case"right":return 1;default:return.5}}const d={key:"seqlegend",type:"legend-seq",dock:r,displayOrder:200,minimumLayoutMode:"MEDIUM",prioOrder:0,settings:{align:h(i?"right":"left"),major:{invert:"left"===r||"right"===r||i},title:{show:t.showTitle,fontSize:s,fontFamily:a,fill:o},tick:{fill:l,fontSize:c,fontFamily:u}}};return rw(!0,{},d,e)}(t,n);case"x-axis":return Oq.xAxis(t,n);case"y-axis":return Oq.yAxis(t,n);case"x-axis-title":return Pq.xAxisTitle(t,n);case"y-axis-title":return Pq.yAxisTitle(t,n);case"grid-line":return function(e,t){const n=t&&t.chartID,i=t.theme.getStyle(n,"grid.line.major","color");return rw(!0,{},{displayOrder:-1,key:"grid-line",type:"grid-line",x:null,y:null,ticks:{stroke:i},minorTicks:{stroke:i}},e||{})}(t,n);case"interaction":return function(e,t){const n=t&&t.gestures||[];return rw(!0,{},{type:"hammer",key:"hammered",gestures:n},e||{})}(t,n);case"ref-line":return function(e,t){const n=t&&t.chartID,i=t.theme.getStyle(n,"referenceLine.outOfBounds","color"),r=t.theme.getStyle(n,"referenceLine.outOfBounds","backgroundColor");return rw(!0,{},{key:"ref-line",type:"ref-line",dock:"center",prioOrder:-1,lines:{x:[],y:[]},style:{oob:{width:7,fill:r,text:{fill:i},padding:{x:7,y:5}}}},e||{})}(t,n);case"event-area":return function(e){return rw(!0,{},{type:"event-area",key:"event-area"},e||{})}(t);case"labels":return function(e,t){const n=t&&t.chartID,i=t.theme.getStyle(n,"label.value","color"),r=t.theme.getStyle(n,"label.value","fontSize"),o={key:"labels",type:"labels",displayOrder:1,settings:{sources:[{component:"box-marker",selector:"rect",strategy:{type:"bar",settings:{direction:"up",fontFamily:t.theme.getStyle(n,"label.value","fontFamily"),fontSize:parseFloat(r),align:.5,labels:[{placements:[{position:"outside",fill:i,justify:0},{position:"inside",fill:e&&e.settings.sources[0].strategy.settings.labels[0].placements[1].fill,justify:1}],label:jq}]}}}]}};return rw(!0,{},o,e||{})}(t,n);default:return}}function Vq(e){this.options=e||{},this.settings={dockLayout:{layoutModes:zq()},components:[],scales:{}}}Vq.prototype.addComponent=function(e,t,n){const i=Bq(e,t,rw(!0,{},this.options,n||{}));return this.settings.components.push(i),i},Vq.prototype.addInteraction=function(e,t){const n=Bq("interaction",e,rw(!0,{},this.options,t||{}));return this.settings.interactions||(this.settings.interactions=[]),this.settings.interactions.push(n),n},Vq.prototype.addScale=function(e,t,n){const i=Bq(e,t,rw(!0,{},this.options,n||{}));this.settings.scales[i.name]=i.component},Vq.prototype.getSettings=function(){return this.settings},Vq.prototype.getComponent=function(e){return this.settings.components.filter((t=>t.key===e))[0]},Vq.prototype.addPreset=function(e,t){!function(e,t,n){if("dimension-measure-chart"!==e)throw Error("There is no chart preset with that type");Aq(t,n)}(e,this,t)},Vq.validateComponentKeys=function(e){const t={};return e.map((e=>{const n=e.key;return n?t[n]?`Duplicate key for component ${e.type}`:(t[n]=!0,null):`Missing key for component ${e.type}`})).filter((e=>!!e))},Vq.create=function(e){return new Vq(e)},Vq.createComponent=Bq;const $q={CENTER:0,BOTTOM:1};var Wq={DISCLAIMERS:[{label:"NoDataExist",alignment:$q.CENTER,default:!0},{label:"RequireNumericDimension",alignment:$q.CENTER,default:!1},{label:"OnlyNanData",alignment:$q.CENTER,default:!0},{label:"OnlyNegativeOrZeroValues",alignment:$q.CENTER,default:!1},{label:"LimitedData",alignment:$q.BOTTOM,default:!1},{label:"OnlyNanColor",alignment:$q.BOTTOM,default:!1},{label:"NegativeOrZeroValues",alignment:$q.BOTTOM,default:!1},{label:"DataRangeIncludingZero",alignment:$q.BOTTOM,default:!1}],ALIGNMENT:$q};const Uq={getNoDataExistAttribute:e=>e.qSize.qcy*e.qSize.qcx==0,getLimitedDataAttribute(e,t){let n,i=!1;var r;return e?void 0!==t.explicitLimitedData?i=!0===t.explicitLimitedData:e.qDataPages&&e.qDataPages[0]?i=!t.paging&&e.qSize.qcy>e.qDataPages[0].qMatrix.length:(r=e.qStackedDataPages)&&r[0]&&r[0].qData[0]&&r[0].qData[0].qSubNodes&&(n=t.maxNbrOfDimensions?t.maxNbrOfDimensions:2,i=e.qDimensionInfo.length>=n?e.qStackedDataPages[0].qData[0].qSubNodes.some((e=>e.qDown>0)):e.qStackedDataPages[0].qData[0].qSubNodes.length<e.qStackedDataPages[0].qArea.qHeight):i=!0===t.explicitLimitedData,i},getNegativeOrZeroValuesAttribute:(e,t)=>!t.supportNegative&&e.qMeasureInfo.some((e=>e.qMin<=0)),getOnlyNegativeOrZeroValuesAttribute:(e,t)=>!t.supportNegative&&e.qMeasureInfo.every((e=>e.qMax<=0&&e.qMax>=e.qMin))||0===e.qSize.qcy,getOnlyNanDataAttribute:(e,t)=>void 0!==t.explicitOnlyNanData?t.explicitOnlyNanData:e.qMeasureInfo.every((e=>e.qMax<e.qMin||"NaN"===e.qMax)),getDataRangeIncludingZeroAttribute:(e,t)=>!t.supportRangeOverZero&&function(e,t){const n=t.length;let i,r,o,s,a;for(e&&(r=!(e.autoMinMax||"min"!==e.minMax&&"minMax"!==e.minMax||null===e.min||Number.isNaN(+e.min)),o=!(e.autoMinMax||"max"!==e.minMax&&"minMax"!==e.minMax||null===e.max||Number.isNaN(+e.max))),s=Number.MAX_VALUE,a=-Number.MAX_VALUE,i=0;i<n;i++)if(s=Math.min(s,t[i].qMin),a=Math.max(a,t[i].qMax),s<=0&&a>=0)return!0;return s=r?e.min:s,a=o?e.max:a,s<=0&&a>=0}(e.measureAxis,e.qHyperCube.qMeasureInfo),applyAttributes(e,t){const n=e||{},i={};return n.supportNegative=void 0===n.supportNegative||n.supportNegative,n.supportRangeOverZero=void 0===n.supportRangeOverZero||n.supportRangeOverZero,Wq.DISCLAIMERS.forEach((e=>{i[e.label]=!1})),t&&t.qHyperCube?(i.NoDataExist=this.getNoDataExistAttribute(t.qHyperCube),i.NoDataExist?i:(i.RequireNumericDimension=n.explicitRequireNumericDimension,i.RequireNumericDimension||(i.LimitedData=this.getLimitedDataAttribute(t.qHyperCube,n),i.NegativeOrZeroValues=this.getNegativeOrZeroValuesAttribute(t.qHyperCube,n),i.OnlyNegativeOrZeroValues=this.getOnlyNegativeOrZeroValuesAttribute(t.qHyperCube,n),i.OnlyNanData=this.getOnlyNanDataAttribute(t.qHyperCube,n),i.DataRangeIncludingZero=this.getDataRangeIncludingZeroAttribute(t,n)),i)):i}};function Yq(e,t,n){this.disclaimersConfig=e,this.dataAttributes=t,this.supportedDisclaimers=n}function Xq(e,t){return e&&t&&t[e]}function Kq(e){this.environment=e,this.clear()}Yq.prototype.isValidAndSupported=function(e,t){return Xq(e.label,this.dataAttributes)&&(e.default||Xq(e.label,this.supportedDisclaimers))&&void 0!==t&&e.alignment===t},Yq.prototype.isAnyValidDisclaimer=function(e){let t=!1;const n=this;return this.disclaimersConfig.forEach((i=>{n.isValidAndSupported(i,e)&&(t=!0)})),t},Yq.prototype.getMessage=function(e,t){let n="";const i=this;return t&&this.disclaimersConfig.forEach((r=>{i.isValidAndSupported(r,e)&&(n+=`${t.get(`Object.Disclaimer.${r.label}`)} `)})),n},Kq.ERRORS={SET:"Calling Disclaimer.set() without attributes",DISPLAY:"Calling Disclaimer.display() before attributes are applied"},Kq._applyDefaultSupport=function(e,t){let n=e;return n||(n={}),t.forEach((e=>{void 0===n[e.label]&&(n[e.label]=e.default)})),n},Kq.prototype.getComponentSettings=function(){var e,t;const{translator:n}=this.environment,i=rw(!0,{},this.vizAttributes.supportedDisclaimers),r=new Yq(Wq.DISCLAIMERS,this.dataAttributes,i);let o,s;if(r.isAnyValidDisclaimer(Wq.ALIGNMENT.CENTER))o=r.getMessage(Wq.ALIGNMENT.CENTER,n),s="center";else{if(!r.isAnyValidDisclaimer(Wq.ALIGNMENT.BOTTOM))return;o=r.getMessage(Wq.ALIGNMENT.BOTTOM,n),s="bottom"}return{key:"disclaimer",type:"disclaimer",layout:{displayOrder:1e3,dock:s},settings:{label:o,rtl:"rtl"===(null===(e=this.environment)||void 0===e||null===(t=e.options)||void 0===t?void 0:t.direction)}}},Kq.prototype.set=function(e){if(this.clear(),!e)throw new Error(Kq.ERRORS.SET);this.vizAttributes=e,this.dataAttributes=Uq.applyAttributes(this.vizAttributes.options,this.vizAttributes.data)},Kq.prototype.clear=function(){this.vizAttributes=null,this.dataAttributes=null};const Gq=Mx.extend({init(e,t,n,i,r){this.$element=t,this.environment=n,this.backendApi=i,this._selectionsApi=r,this._on=!1,this._disclaimer=new Kq(n),this._dataPaths=["qHyperCube"];const o=this;this.picassoElement=t[0],this.picassoElement.className+=" picasso-chart",this.chartInstance=e.chart({element:this.picassoElement,settings:{components:[Vq.createComponent("event-area",{mounted(e){o.dataAreaElem=e}})]}})},updateEnvironment(e){this.environment=e},isRtl(){var e;return"rtl"===(null===(e=this.environment.options)||void 0===e?void 0:e.direction)},setDataPaths(e){this._dataPaths=e},getData:(e,t,n)=>function(e,t,n){let i,r={qTop:0,qLeft:0,qWidth:t.qSize.qcx,qHeight:1e4/t.qSize.qcx};if(n){const e=n.width||t.qSize.qcx,i=Math.floor(1e4/e);r={qTop:n.top||0,qLeft:n.left||0,qWidth:e,qHeight:n.height?Math.min(n.height,i):i}}else r={qTop:0,qLeft:0,qWidth:t.qSize.qcx,qHeight:1e4/t.qSize.qcx};i="K"===t.qMode?"qStackedDataPages":"qDataPages";return e.getData([r],null,t).then((e=>{t[i]=e}))}(e,t,n),hasValidData:()=>!0,paint(){if(this.hasValidData()){var e;this._disclaimer.set(this.getDisclaimerAttributes(this.layout));const t=this._disclaimer.getComponentSettings(),n="center"===(null==t||null===(e=t.layout)||void 0===e?void 0:e.dock),i=this.createChartSettings(this.layout);n?i.components=[t]:t&&i.components.push(t),Vq.validateComponentKeys(i.components).forEach((e=>{console.error(e)})),this.updateChart(this.layout,i),this._painted=!0}return Promise.resolve()},resize(){if(this.layout)return this.paint()},createChartSettings(){throw new Error('Subclass must implement "createChartSettings" function')},addSnapshotChartSettings(e,t){const{freeResize:n}=this.environment.options;!n&&t.snapshotData&&(e.dockLayout.logicalSize={width:t.snapshotData.content.size.w,height:t.snapshotData.content.size.h,preserveAspectRatio:!0})},updateData(e){return this._destroyed?Promise.reject():(this.layout=rw(!0,{},e),this.layout.permissions=e.permissions,Promise.resolve())},updateChart(e,t,n){var i,r;const o=null!==(i=null===(r=this.environment.appLayout)||void 0===r?void 0:r.qLocaleInfo)&&void 0!==i?i:{},s=this._dataPaths.map((t=>({type:"q",key:t,config:{localeInfo:o},data:Rb(e,t.replace(/\//g,"."))})));this.colorService&&s.push(...this.colorService.getData()),this.chartInstance.update({data:s,settings:t,partialData:n});this.picassoElement.setAttribute("data-state",2)},destroy(){this._destroyed=!0,this.off(),this.chartInstance.destroy()},getViewState:()=>({}),isLassoDisabled:()=>!0,setSnapshotData(e){e.snapshotData||(e.snapshotData={}),e.snapshotData.content={chartData:{},size:{w:this.$element.width(),h:this.$element.height()}}},getDisclaimerAttributes:e=>({data:e})});function Jq(e){let t=0;if(!e||!e.length)return t;for(let n=0;n<e.length;n++){t=(t<<5)-t+e.charCodeAt(n),t&=t}return t}const Zq={generateHash:function(e){return Jq(JSON.stringify(e))},updateHash:function(e,t){e.qUndoExclude||(e.qUndoExclude={});e.qUndoExclude.hashCode=Zq.generateHash(t)}};const Qq={getDefaultHashDataForHyperCube:function(e,t,n){return function(e,t){const n=[];if(!e.qMeasures)return Promise.resolve(n);return e.qMeasures.forEach((e=>{e.qLibraryId?n.push(function(e,t){return t.getMeasure(e).then((e=>e.getProperties().then((e=>e.qMeasure.qDef))))}(e.qLibraryId,t)):n.push(Promise.resolve())})),Promise.all(n)}(e,n).then((e=>({drillLevel:tM(t),dimensionExpressions:eM(t),measureExpressions:e})))}};function eM(e){return e.qDimensionInfo.map((e=>e.qGroupFieldDefs))}function tM(e){const t=function(e){return Rb(e,"qDimensionInfo",[])}(e);return t.map((e=>e.qGroupPos))}const nM={},iM=rw.bind(null,!0);function rM(e){return null!=e&&!Array.isArray(e)&&"object"==typeof e}const oM=Array.isArray,sM=function(e){return void 0===e};function aM(e,t){return function(e){return"function"==typeof e}(e[t])||"$$"===t.substring(0,2)||"_"===t.substring(0,1)}function lM(e,t){const n=t.substring(1).split("/").slice(0,-1);let i;return n.forEach(((t,r)=>{r!==n.length&&(i=+t,e[i||t]=sM(e[i||t])?Number.isNaN(+i)?{}:[]:e[t],e=e[i||t])})),e}function cM(e,t){if(rM(e)&&rM(t)){if(Object.keys(e).length!==Object.keys(t).length)return!1;for(const n of Object.keys(e))if(!cM(e[n],t[n]))return!1;return!0}if(oM(e)&&oM(t)){if(e.length!==t.length)return!1;for(let n=0,i=e.length;n<i;n++)if(!cM(e[n],t[n]))return!1;return!0}return e===t}nM.generate=function(e,t,n){n=n||"";let i=[];return Object.keys(t).forEach((r=>{const o=function(e){return e&&(e=iM({},{val:e}).val),e}(t[r]),s=e[r],a=`${n}/${r}`;cM(o,s)||aM(t,r)||(sM(s)?i.push({op:"add",path:a,value:o}):rM(o)&&rM(s)?i=i.concat(nM.generate(s,o,a)):oM(o)&&oM(s)?i=i.concat(function(e,t,n){let i=[];const r=e.slice();let o,s,a=-1;function l(e,t,n){if(e[n]&&sM(e[n].qInfo))return null;if(e[n]&&e[n].qInfo.qId===t)return n;for(let n=0,i=e.length;n<i;n++)if(e[n]&&e[n].qInfo.qId===t)return n;return-1}if(cM(t,r))return i;if(null===t[0]||!sM(t[0])&&sM(t[0].qInfo))return i.push({op:"replace",path:n,value:t}),i;for(o=r.length-1;o>=0;--o)a=l(t,r[o]&&r[o].qInfo&&r[o].qInfo.qId,o),-1===a?(i.push({op:"remove",path:`${n}/${o}`}),r.splice(o,1)):i=i.concat(nM.generate(r[o],t[a],`${n}/${o}`));for(o=0,s=t.length;o<s;++o)a=l(r,t[o]&&t[o].qInfo&&t[o].qInfo.qId),-1===a?(i.push({op:"add",path:`${n}/${o}`,value:t[o]}),r.splice(o,0,t[o])):a!==o&&(i.push({op:"move",path:`${n}/${o}`,from:`${n}/${a}`}),r.splice(o,0,r.splice(a,1)[0]));return i}(s,o,a)):i.push({op:"replace",path:`${n}/${r}`,value:o}))})),Object.keys(e).forEach((r=>{sM(t[r])&&!aM(e,r)&&i.push({op:"remove",path:`${n}/${r}`})})),i},nM.apply=function(e,t){t.forEach((t=>{const n=lM(e,t.path);let i=t.path.split("/").splice(-1)[0];const r=i&&Number.isNaN(+i)?n[i]:n[+i]||n,o=t.from?t.from.split("/").splice(-1)[0]:null;if("add"===t.op||"replace"===t.op)if(oM(n))"-"===i&&(i=n.length),n.splice(+i,"add"===t.op?0:1,t.value);else if(oM(r)&&oM(t.value)){const e=t.value.slice();r.length=0,r.push.apply(r,e)}else rM(r)&&rM(t.value)?(s=r,Object.keys(s).forEach((e=>{Object.getOwnPropertyDescriptor(s,e).configurable&&!aM(s,e)&&delete s[e]})),iM(r,t.value)):n[i]=t.value;else if("move"===t.op){const r=lM(e,t.from);oM(n)?n.splice(+i,0,r.splice(+o,1)[0]):(n[i]=r[o],delete r[o])}else"remove"===t.op&&(oM(n)?n.splice(+i,1):delete n[i]);var s}))},nM.clone=function(e){return iM({},e)},nM.createPatch=function(e,t,n){const i={op:e.toLowerCase(),path:n};return"move"===i.op?i.from=t:void 0!==t&&(i.value=t),i},nM.updateObject=function(e,t){Object.keys(e).length?nM.apply(e,nM.generate(e,t)):iM(e,t)};class uM{constructor(e){this._model=e}setModel(e){this._model=e}saveSoftProperties(e,t){if(!this._model)return Promise.resolve(!1);let n=nM.generate(e,t);return rw(!0,e,t),n&&n.length?(n=n.map((e=>({qOp:e.op,qValue:JSON.stringify(e.value),qPath:e.path}))),this._model.applyPatches(n,!0).then((()=>!0))):Promise.resolve(!1)}async mergeSoftPatches(){if(!this._model)return;const e=this._model.getProperties(),t=this._model.getEffectiveProperties(),n=await e,i=await t;if(n.qExtendsId)return;const r=nM.generate(n,i);nM.apply(n,r);const o=this;o._model.setProperties(n).then((()=>{o._model.clearSoftPatches()}))}}var hM={canModifyHardProperties:function(e){if(e.qHasSoftPatches||e.qExtendsId)return!1;if(e.permissions)return e.permissions.update;return-1!==e.qMeta.privileges.indexOf("update")}};var dM={saveDerivedProperties:function(e,t,n,i){if(hM.canModifyHardProperties(t))return e.setProperties(n);return new uM(e).saveSoftProperties(i,n)}};var fM={validate:function(e){if(!(e&&e.layout&&e.properties&&e.model&&e.hashData&&e.generateDerivedProperties))throw Error("Derived-properties: Missing input")}};function pM(){this._generationInProgress=!1}function mM(e){fM.validate(e);const t=e.properties,n=Zq.generateHash(e.hashData);return!(!t.qUndoExclude||t.qUndoExclude.hashCode!==n)}pM.prototype.isDerivedUpToDate=mM,pM.prototype.updateDerivedProperties=function(e){if(fM.validate(e),this._generationInProgress)return Promise.resolve(!0);if(mM(e)){const t=e.layout.qUndoExclude&&e.layout.qUndoExclude.hashCode===e.properties.qUndoExclude.hashCode;return Promise.resolve(!t)}const t=this,n=e.model,i=e.layout,r=rw(!0,{},e.properties),o=rw(!0,{},r);return this._generationInProgress=!0,Zq.updateHash(r,e.hashData),e.generateDerivedProperties(i,r).then((()=>dM.saveDerivedProperties(n,i,r,o).then((()=>(t._generationInProgress=!1,Promise.resolve(!0))))))},pM.prototype.addDefaultHyperCubeHash=function(e,t,n,i){return Qq.getDefaultHashDataForHyperCube(e,t,n).then((e=>rw(!0,i,e)))};var gM={},yM={get exports(){return gM},set exports(e){gM=e}};!function(e,n){e.exports=function(){function e(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,i)}return n}function n(t){for(var n=1;n<arguments.length;n++){var r=null!=arguments[n]?arguments[n]:{};n%2?e(Object(r),!0).forEach((function(e){i(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):e(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function i(e,t,n){return(t=o(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function r(e,t){if("object"!=typeof e||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var i=n.call(e,t||"default");if("object"!=typeof i)return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}function o(e){var t=r(e,"string");return"symbol"==typeof t?t:String(t)}var s=Object.prototype.hasOwnProperty,a=Object.prototype.toString,l=Object.defineProperty,c=Object.getOwnPropertyDescriptor,u=function(e){return"function"==typeof Array.isArray?Array.isArray(e):"[object Array]"===a.call(e)},h=function(e){if(!e||"[object Object]"!==a.call(e))return!1;var t,n=s.call(e,"constructor"),i=e.constructor&&e.constructor.prototype&&s.call(e.constructor.prototype,"isPrototypeOf");if(e.constructor&&!n&&!i)return!1;for(t in e);return void 0===t||s.call(e,t)},d=function(e,t){l&&"__proto__"===t.name?l(e,t.name,{enumerable:!0,configurable:!0,value:t.newValue,writable:!0}):e[t.name]=t.newValue},f=function(e,t){if("__proto__"===t){if(!s.call(e,t))return;if(c)return c(e,t).value}return e[t]},p=function e(){var t,n,i,r,o,s,a=arguments[0],l=1,c=arguments.length,p=!1;for("boolean"==typeof a&&(p=a,a=arguments[1]||{},l=2),(null==a||"object"!=typeof a&&"function"!=typeof a)&&(a={});l<c;++l)if(null!=(t=arguments[l]))for(n in t)i=f(a,n),a!==(r=f(t,n))&&(p&&r&&(h(r)||(o=u(r)))?(o?(o=!1,s=i&&u(i)?i:[]):s=i&&h(i)?i:{},d(a,{name:n,newValue:e(p,s,r)})):void 0!==r&&d(a,{name:n,newValue:r}));return a};function m(e,t,n){if(!e)return-1;const i=n.cache,r=e.origin?e.origin():null;r&&(e=r);let o=i.fields.indexOf(e),s=-1,a=-1;if(-1===o)for(let t=0;t<i.wrappedFields.length;t++)if(a=i.wrappedFields[t].attrDims.map((e=>e.instance)).indexOf(e),s=i.wrappedFields[t].attrExps.map((e=>e.instance)).indexOf(e),-1!==a||-1!==s){o=t;break}return o-=t.qArea.qLeft,o<0||o>=t.qArea.qWidth?-1:a>=0?e=>e[o].qAttrDims.qValues[a]:s>=0?e=>e[o].qAttrExps.qValues[s]:e=>e[o]}function g(e,t,n){let{key:i}=n;const r={value:"function"==typeof e.value?e.value(t):void 0!==e.value?e.value:t};return r.label="function"==typeof e.label?e.label(t):void 0!==e.label?String(e.label):String(r.value),e.field&&(r.source={key:i,field:e.field.key()}),r}function y(e){let{cache:t,f:n,mainCell:i,p:r,prop:o,page:s,rowIdx:a,row:l,sourceKey:c,target:u,targetProp:h}=e,d=i;if(r.field&&r.field!==n){const e=m(r.field,s,{cache:t});if(-1===e)return;d=p({qRow:a},e(l))}u[h]=g(r,d,{key:c})}function v(e,t,n,i){const r=Array.isArray(e)?e:[e];let o=[];for(let e=0;e<r.length;e++)if(void 0!==r[e].field){const s=t.raw(),a=t.key(),l="object"==typeof r[e].field?r[e].field:t.field(r[e].field),{props:c,main:u}=i.normalizeConfig(r[e],t),h=Object.keys(c),d=!!r[e].trackBy,f=typeof r[e].trackBy,v={},b=[],x=[];for(let t=0;t<s.qDataPages.length;t++){const o=m(l,s.qDataPages[t],{cache:n});if(-1!==o)for(let m=0;m<s.qDataPages[t].qMatrix.length;m++){const w=s.qDataPages[t].qArea.qTop+m,q=p({qRow:w},o(s.qDataPages[t].qMatrix[m])),M=g(u,q,{key:a});if(!u.filter||u.filter(q)){for(let e=0;e<h.length;e++){const i=c[h[e]];let r=i.fields||[i];i.fields&&(M[h[e]]=[]);for(let o=0;o<r.length;o++)y({cache:n,f:l,mainCell:q,p:r[o],prop:h[e],props:c,page:s.qDataPages[t],rowIdx:w,row:s.qDataPages[t].qMatrix[m],sourceKey:a,target:i.fields?M[h[e]]:M,targetProp:i.fields?o:h[e]});if(i.fields){const t=M[h[e]].map((e=>e.value)),n=M[h[e]].map((e=>e.label));M[h[e]]={value:"function"==typeof i.value?i.value(t):void 0!==i.value?i.value:t,label:"function"==typeof i.label?i.label(n):void 0!==i.label?String(i.label):String(M[h[e]].value)}}}d&&i.track({cfg:r[e],itemData:q,obj:M,target:b,tracker:v,trackType:f}),x.push(M)}}}const w=d?i.collect(b,{main:u,propsArr:h,props:c}):x;o=[...o,...w]}return o}function b(e){var t=0,n=e.children,i=n&&n.length;if(i)for(;--i>=0;)t+=n[i].value;else t=1;e.value=t}function x(){return this.eachAfter(b)}function w(e,t){let n=-1;for(const i of this)e.call(t,i,++n,this);return this}function q(e,t){for(var n,i,r=this,o=[r],s=-1;r=o.pop();)if(e.call(t,r,++s,this),n=r.children)for(i=n.length-1;i>=0;--i)o.push(n[i]);return this}function M(e,t){for(var n,i,r,o=this,s=[o],a=[],l=-1;o=s.pop();)if(a.push(o),n=o.children)for(i=0,r=n.length;i<r;++i)s.push(n[i]);for(;o=a.pop();)e.call(t,o,++l,this);return this}function D(e,t){let n=-1;for(const i of this)if(e.call(t,i,++n,this))return i}function S(e){return this.eachAfter((function(t){for(var n=+e(t.data)||0,i=t.children,r=i&&i.length;--r>=0;)n+=i[r].value;t.value=n}))}function _(e){return this.eachBefore((function(t){t.children&&t.children.sort(e)}))}function C(e){for(var t=this,n=k(t,e),i=[t];t!==n;)t=t.parent,i.push(t);for(var r=i.length;e!==n;)i.splice(r,0,e),e=e.parent;return i}function k(e,t){if(e===t)return e;var n=e.ancestors(),i=t.ancestors(),r=null;for(e=n.pop(),t=i.pop();e===t;)r=e,e=n.pop(),t=i.pop();return r}function E(){for(var e=this,t=[e];e=e.parent;)t.push(e);return t}function A(){return Array.from(this)}function T(){var e=[];return this.eachBefore((function(t){t.children||e.push(t)})),e}function I(){var e=this,t=[];return e.each((function(n){n!==e&&t.push({source:n.parent,target:n})})),t}function*R(){var e,t,n,i,r=this,o=[r];do{for(e=o.reverse(),o=[];r=e.pop();)if(yield r,t=r.children)for(n=0,i=t.length;n<i;++n)o.push(t[n])}while(o.length)}function N(e,t){e instanceof Map?(e=[void 0,e],void 0===t&&(t=L)):void 0===t&&(t=P);for(var n,i,r,o,s,a=new j(e),l=[a];n=l.pop();)if((r=t(n.data))&&(s=(r=Array.from(r)).length))for(n.children=r,o=s-1;o>=0;--o)l.push(i=r[o]=new j(r[o])),i.parent=n,i.depth=n.depth+1;return a.eachBefore(z)}function O(){return N(this).eachBefore(F)}function P(e){return e.children}function L(e){return Array.isArray(e)?e[1]:null}function F(e){void 0!==e.data.value&&(e.value=e.data.value),e.data=e.data.data}function z(e){var t=0;do{e.height=t}while((e=e.parent)&&e.height<++t)}function j(e){this.data=e,this.depth=this.height=0,this.parent=null}function H(e){return null==e?null:B(e)}function B(e){if("function"!=typeof e)throw new Error;return e}j.prototype=N.prototype={constructor:j,count:x,each:w,eachAfter:M,eachBefore:q,find:D,sum:S,sort:_,path:C,ancestors:E,descendants:A,leaves:T,links:I,copy:O,[Symbol.iterator]:R};var V={depth:-1},$={},W={};function U(e){return e.id}function Y(e){return e.parentId}function X(){var e,t=U,n=Y;function i(i){var r,o,s,a,l,c,u,h,d=Array.from(i),f=t,p=n,m=new Map;if(null!=e){const t=d.map(((t,n)=>K(e(t,n,i)))),n=t.map(G),r=new Set(t).add("");for(const e of n)r.has(e)||(r.add(e),t.push(e),n.push(G(e)),d.push(W));f=(e,n)=>t[n],p=(e,t)=>n[t]}for(s=0,r=d.length;s<r;++s)o=d[s],c=d[s]=new j(o),null!=(u=f(o,s,i))&&(u+="")&&(h=c.id=u,m.set(h,m.has(h)?$:c)),null!=(u=p(o,s,i))&&(u+="")&&(c.parent=u);for(s=0;s<r;++s)if(u=(c=d[s]).parent){if(!(l=m.get(u)))throw new Error("missing: "+u);if(l===$)throw new Error("ambiguous: "+u);l.children?l.children.push(c):l.children=[c],c.parent=l}else{if(a)throw new Error("multiple roots");a=c}if(!a)throw new Error("no root");if(null!=e){for(;a.data===W&&1===a.children.length;)a=a.children[0],--r;for(let e=d.length-1;e>=0&&(c=d[e]).data===W;--e)c.data=null}if(a.parent=V,a.eachBefore((function(e){e.depth=e.parent.depth+1,--r})).eachBefore(z),a.parent=null,r>0)throw new Error("cycle");return a}return i.id=function(e){return arguments.length?(t=H(e),i):t},i.parentId=function(e){return arguments.length?(n=H(e),i):n},i.path=function(t){return arguments.length?(e=H(t),i):e},i}function K(e){let t=(e=`${e}`).length;return J(e,t-1)&&!J(e,t-2)&&(e=e.slice(0,-1)),"/"===e[0]?e:`/${e}`}function G(e){let t=e.length;if(t<2)return"";for(;--t>1&&!J(e,t););return e.slice(0,t)}function J(e,t){if("/"===e[t]){let n=0;for(;t>0&&"\\"===e[--t];)++n;if(0==(1&n))return!0}return!1}function Z(e,t){"/"===e.charAt(0)&&(e=e.substring(1));const n=e.split("/");let i,r=t;for(let e=0;e<n.length;e++){if("*"===n[e]&&Array.isArray(r)){const t=[];i=n.slice(e+1).join("/");for(let e=0;e<r.length;e++){let n=Z(i,r[e]);Array.isArray(n)?t.push(...n):t.push(n)}return t}if(!n[e]&&Array.isArray(r)){const t=new Array(r.length);i=n.slice(e+1).join("/");for(let e=0;e<r.length;e++)t[e]=Z(i,r[e]);return t}n[e]in r&&(r=r[n[e]])}return r}function Q(e,t,n){let i=[];if(!e||!e.length)return i;if(t<=0){const t=n>=0?[e[n]]:e;i=[...i,...t]}else for(let r=0;r<e.length;r++)e[r].children&&e[r].children.length&&(i=[...i,...Q(e[r].children,t-1,n)]);return i}function ee(e,t,n){if(e===t)return e=>e;if(e>t){const n=Math.max(0,Math.min(100,e-t));return e=>{let t=e;for(let e=0;e<n;++e)t=t.parent;return t}}if(t>e){const i=Math.max(0,Math.min(100,t-e));return e=>Q(e.children,i-1,n)}return!1}function te(e,t){let{cache:n}=t;if("number"==typeof e)return n.fields[e];const i=n.allFields;if("function"==typeof e){for(let t=0;t<i.length;t++)if(e(i[t]))return i[t];return!1}if("string"==typeof e){for(let t=0;t<i.length;t++)if(i[t].key()===e||i[t].title()===e)return i[t]}else if(e&&-1!==i.indexOf(e))return e;throw Error("Field not found: ".concat(e))}const ne=/^qDimensionInfo(?:\/(\d+))?/,ie=/^\/?qMeasureInfo\/(\d+)/,re=/\/qAttrExprInfo\/(\d+)/,oe=/\/qAttrDimInfo\/(\d+)/;function se(e){const t=e.raw().qColumnOrder,n=e.fields();return t&&t.length===n.length?t:n.map(((e,t)=>t))}function ae(e){return(e.qColumnOrder&&e.qColumnOrder.length?e.qColumnOrder:e.qDimensionInfo.map(((e,t)=>t))).filter((t=>t<e.qDimensionInfo.length))}function le(e,t){let{cube:n}=t;if(!e)return-1;let i=e.origin&&e.origin()?e.origin().key():e.key(),r=!1,o=-1,s=-1,a=-1,l=-1,c=-1,u=-1,h=i;const d=n.qEffectiveInterColumnSortOrder,f=ae(n);return ne.test(h)&&(r=!0,o=+ne.exec(h)[1],h=i.replace(ne,"")),ie.test(h)&&("K"===n.qMode?c=+ie.exec(h)[1]:d&&-1!==d.indexOf(-1)?(c=+ie.exec(h)[1],u=0):u=+ie.exec(h)[1],h=h.replace(ie,"")),h&&(oe.exec(h)?a=+oe.exec(h)[1]:re.exec(h)&&(s=+re.exec(h)[1])),l=r?"S"===n.qMode?f[o]:d?d.indexOf(o):o:d&&-1!==d.indexOf(-1)?d.indexOf(-1):n.qDimensionInfo.length-("K"===n.qMode?0:1),{fieldDepth:l+1,pseudoMeasureIndex:c,measureIdx:u,attrDimIdx:a,attrIdx:s}}function ce(e,t){let n,i,r=ee(e.fieldDepth,t.fieldDepth,t.pseudoMeasureIndex);return n=t.measureIdx>=0?e=>e.data.qValues[t.measureIdx]:e=>e.data,t.attrDimIdx>=0?i=e=>{var n;return null==e||null===(n=e.qAttrDims)||void 0===n?void 0:n.qValues[t.attrDimIdx]}:t.attrIdx>=0&&(i=e=>{var n;return null==e||null===(n=e.qAttrExps)||void 0===n?void 0:n.qValues[t.attrIdx]}),{nodeFn:r,attrFn:i,valueFn:n}}function ue(e,t,n){let{key:i}=n;const r={value:"function"==typeof e.value?e.value(t):void 0!==e.value?e.value:t};return r.label="function"==typeof e.label?e.label(t):void 0!==e.label?String(e.label):String(r.value),e.field&&(r.source={key:i,field:e.field.key()}),r}function he(e){let{propsArr:t,props:n,item:i,itemData:r,ret:o,sourceKey:s}=e;for(let e=0;e<t.length;e++){const a=n[t[e]],l=a.fields||[a];let c,u;a.fields&&(c=[],u=[]);for(let n=0;n<l.length;n++){const h=l[n];let d,f,p,m,g,y;if("primitive"===h.type?(p=h.value,y=String(h.value)):("function"==typeof h.value&&(d=e=>h.value(e,i)),"function"==typeof h.label&&(f=e=>h.label(e,i)),h.accessor?(m=h.accessor(i),Array.isArray(m)?(g=m.map(h.valueAccessor),h.attrAccessor&&(g=g.map(h.attrAccessor)),d&&(p=g.map(d),d=null),f&&(y=g.map(f),f=null),p=h.reduce?h.reduce(p):p,y=h.reduceLabel?h.reduceLabel(y,p):String(p)):(p=h.attrAccessor?h.attrAccessor(h.valueAccessor(m)):h.valueAccessor(m),y=p)):(p=r,y=r)),a.fields){const e=d?d(p):p;c.push(e),u.push(f&&null!=y?f(y):null!=y?y:String(e))}else{const n=d?d(p):p;o[t[e]]={value:n,label:f?f(y):null!=y?y:String(n)},h.field&&(o[t[e]].source={field:h.field.key(),key:s})}}c&&(o[t[e]]={value:"function"==typeof a.value?a.value(c,i):c,label:"function"==typeof a.label?a.label(u,i):u})}}const de=(e,t,n)=>{const i="K"===e.qMode?"/qStackedDataPages/*/qData":"/qTreeDataPages/*",r="K"===e.qMode?"qSubNodes":"qNodes",o=Z(i,e);return o&&o[0]?(t.tree=N(o[0],n.children||(e=>e[r])),t.tree):null};function fe(e){const t=e.raw().qDataPages.length?e.raw().qDataPages[0].qMatrix:[],i=se(e),r=e.fields(),o=e.fields().filter((e=>"dimension"===e.type())).map((e=>i.indexOf(r.indexOf(e)))),s=e.fields().filter((e=>"measure"===e.type())).map((e=>i.indexOf(r.indexOf(e)))),a={__root:{__id:"__root",qValues:[]}};for(let e=0;e<t.length;e++){const i=t[e];let r="__root",c=!1;for(let e=0;e<o.length;e++){var l;const t=i[o[e]],s="".concat(r,"__").concat(null!==(l=t.qElemNumber)&&void 0!==l?l:t.qElemNo);a[s]||(a[s]=n({__id:s,__parent:r,qValues:[]},t),c=!0),r=s}if(c)for(let e=0;e<s.length;e++){const t=i[s[e]];a[r].qValues.push(t)}}const c=Object.keys(a).map((e=>a[e])),u=X().id((e=>e.__id)).parentId((e=>e.__parent))(c);return u}const pe=e=>{let{propsArr:t,props:n,cube:i,cache:r,itemDepthObject:o,f:s}=e;for(let e=0;e<t.length;e++){const a=n[t[e]],l=a.fields?a.fields:[a];for(let e=0;e<l.length;e++){const t=l[e];if(t.field!==s){const e=ce(o,le(t.field,{cube:i,cache:r}));t.accessor=e.nodeFn,t.valueAccessor=e.valueFn,t.attrAccessor=e.attrFn}}}};function me(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0,i=arguments.length>2?arguments[2]:void 0,r=arguments.length>3?arguments[3]:void 0;const o=t.raw(),s=t.key(),a="S"===o.qMode?fe(t):de(o,i,e);if(!a)return null;const l=a.height,c=[];for(let s=0;s<=l;s++){let a=null;if(s>0)if("S"===o.qMode){let e=ae(o)[s-1];a=i.fields[e]}else{let e=o.qEffectiveInterColumnSortOrder[s-1];s>o.qEffectiveInterColumnSortOrder.length&&(e=o.qDimensionInfo.length),a=i.fields[e]}const{props:l,main:u}=r.normalizeConfig(n(n({},e),{},{field:a?a.key():void 0}),t),h=Object.keys(l);c[s]={propsArr:h,props:l,main:u};const d=a?le(a,{cube:o,cache:i}):{fieldDepth:0};pe({propsArr:h,props:l,cube:o,cache:i,itemDepthObject:d,f:a})}const u=a.copy().descendants(),h=a.descendants();for(let e=0;e<h.length;e++){const t=c[h[e].depth].propsArr,n=c[h[e].depth].props,i=c[h[e].depth].main,r=u[e],o=r.data,a=ue(i,o,{key:s});he({propsArr:t,props:n,item:r,itemData:o,ret:a,sourceKey:s,isTree:!0}),h[e].data=a}return a}function ge(e,t,n,i){const r=Array.isArray(e)?e:[e];let o=[];for(let s=0;s<r.length;s++)if(void 0!==r[s].field){const a=t.raw(),l=t.key();if(!de(a,n,e))continue;const c="object"==typeof r[s].field?r[s].field:t.field(r[s].field),{props:u,main:h}=i.normalizeConfig(r[s],t),d=Object.keys(u),f=le(c,{cube:a,cache:n}),{nodeFn:p,attrFn:m,valueFn:g}=ce({fieldDepth:0},f);pe({propsArr:d,props:u,cube:a,cache:n,itemDepthObject:f,f:c});const y=!!r[s].trackBy,v=typeof r[s].trackBy,b={},x=[],w=p(n.tree),q=[];for(let e=0;e<w.length;e++){const t=w[e],n=m?m(g(t)):g(t);if(h.filter&&!h.filter(n))continue;const o=ue(h,n,{key:l});he({propsArr:d,props:u,item:t,itemData:n,ret:o,sourceKey:l}),y&&i.track({cfg:r[s],itemData:n,obj:o,target:x,tracker:b,trackType:v}),q.push(o)}const M=y?i.collect(x,{main:h,propsArr:d,props:u}):q;o=[...o,...M]}return o}function ye(e,t){return e(t={exports:{}},t.exports),t.exports}"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:void 0!==t||"undefined"!=typeof self&&self;var ve=ye((function(e){
|
|
26
|
+
e.exports=function(e,t){if(!e||isNaN(+t))return t;var n,i,r,o,s,a,l,c,u,h,d=e.length,f=e.search(/[0-9\-\+#]/),p=f>0?e.substring(0,f):"",m=e.split("").reverse().join(""),g=m.search(/[0-9\-\+#]/),y=d-g,v=e.substring(y,y+1),b=y+("."===v||","===v?1:0),x=g>0?e.substring(b,d):"";if(n=(t="-"===(e=e.substring(f,b)).charAt(0)?-t:+t)<0?t=-t:0,r=(i=e.match(/[^\d\-\+#]/g))&&i[i.length-1]||".",o=i&&i[1]&&i[0]||",",e=e.split(r),t=+(t=t.toFixed(e[1]&&e[1].length))+"",a=e[1]&&e[1].lastIndexOf("0"),(!(c=t.split("."))[1]||c[1]&&c[1].length<=a)&&(t=(+t).toFixed(a+1)),u=e[0].split(o),e[0]=u.join(""),(s=e[0]&&e[0].indexOf("0"))>-1)for(;c[0].length<e[0].length-s;)c[0]="0"+c[0];else 0==+c[0]&&(c[0]="");if((t=t.split("."))[0]=c[0],l=u[1]&&u[u.length-1].length){for(m="",y=(h=t[0]).length%l,d=h.length,b=0;b<d;b++)m+=h.charAt(b),!((b-y+1)%l)&&b<d-l&&(m+=o);t[0]=m}return t[1]=e[1]&&t[1]?r+t[1]:"","0"!==(i=t.join(""))&&""!==i||(n=!1),p+(n?"-":"")+i+x}},Av({exports:{}});var jv=["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"],Hv=["Abril Fatface, serif","Bangers, fantasy","EB Garamond, serif","Fredoka One, fantasy","Graduate, fantasy","Gravitas One, serif","Nixie One, sans-serif","Noto Sans, sans-serif","PT Serif, serif","Permanent Marker, fantasy","Rammetto One, fantasy","Roboto, sans-serif","QlikView Sans, sans-serif","Source Sans Pro, sans-serif","Titan One, fantasy","Open Sans, sans-serif","Montserrat, sans-serif","Raleway, sans-serif","Bebas Neue, sans serif","Lobster, fantasy","Pacifico, cursive","Inter, sans-serif","Indie Flower, fantasy","Yanone Kaffeesatz, sans-serif"],Bv=function(e){return{value:e,label:e.charAt(0).toUpperCase()+e.slice(1),groupHeader:!1,disabled:!1}};function Vv(e){var t=e.theme,n=e.translator,i=e.id,r=e.path,o=e.flags,s=function(){return t.getStyle(i,r,"fontFamily")};return{getDefaultValue:function(){return s()},getOptions:function(){return function(e){var t=e.theme,n=e.translator,i=e.defaultValue,r=e.flags,o=[],s=t.getStyle("","","fontFamilies");return Array.isArray(s)&&s.length?o.push.apply(o,Fg(new Set([i].concat(Fg(s.map((function(e){return e.split(",").map((function(e){return e.trim()})).map((function(e){return e.replace(/\s+/g," ").trim()})).filter(Boolean).join(", ")}))))))):o.push(i),[{value:"ThemeHeader",label:n.get("properties.themeFonts"),metaText:n.get("properties.theme"),groupHeader:!0}].concat(Fg(o.map((function(e){return Bv(e)}))),[{value:"DefaultHeader",label:n.get("properties.allFonts"),metaText:n.get("properties.default"),groupHeader:!0}],Fg(function(e){return null!=e&&e.isEnabled("PS_20852_WYSIWYG_FONT_SUPPORT")?Hv:jv}(r).map((function(e){return Bv(e)}))))}({theme:t,translator:n,defaultValue:s(),flags:o})}}}var $v=["10px","11px","12px","13px","14px","15px","16px","17px","18px","19px","20px","21px","22px","23px","24px"],Wv=function(e){return{value:e,label:e,groupHeader:!1,disabled:!1}};function Uv(e){var t=e.theme,n=e.translator,i=e.id,r=e.path,o=function(){return t.getStyle(i,r,"fontSize")};return{getDefaultValue:function(){return o()},getOptions:function(){return function(e){var t=e.translator,n=e.defaultValue,i=[],r=e.theme.getStyle("","","fontSizes");return Array.isArray(r)&&r.length?i.push.apply(i,Fg(new Set([n].concat(Fg(r))))):i.push(n),[{value:"ThemeHeader",label:t.get("properties.themeFontSizes"),metaText:t.get("properties.theme"),groupHeader:!0}].concat(Fg(i.map((function(e){return Wv(e)}))),[{value:"DefaultHeader",label:t.get("properties.allFontSizes"),metaText:t.get("properties.default"),groupHeader:!0}],Fg($v.map((function(e){return Wv(e)}))))}({theme:t,translator:n,defaultValue:o()})}}}function Yv(e){var t=e.theme,n=e.translator,i=e.id,r=e.path;return{fontFamily:Vv({theme:t,translator:n,id:i,path:r,flags:e.flags}),fontSize:Uv({theme:t,translator:n,id:i,path:r})}}function Xv(e){var t=e.theme,n=e.translator,i=e.config,r=void 0===i?{}:i,o=e.flags,s=function(e){var t=e.config,n=void 0===t?{}:t,i=n.id,r=n.paths;return{id:void 0===i?"object":"".concat("object",".").concat(i),paths:Array.isArray(r)?r:[]}}({config:r}),a=s.id,l=s.paths,c={};l.forEach((function(e){for(var i=e.split("."),r=c,s=0;s<i.length;s++){var l=i[s];s===i.length-1?r[l]=Yv({theme:t,translator:n,id:a,path:e,flags:o}):void 0===r[l]&&(r[l]={}),r=r[l]}}));var u=function(e){for(var t=e.split("."),n=c,i=0;i<t.length;i++){var r=t[i];if(void 0===n[r])throw new Error("font-resolver: Path '".concat(e,"' could not be resolved."));n=n[r]}return n};return c.getDefaultValue=function(e){return u(e).getDefaultValue()},c.getOptions=function(e){return u(e).getOptions()},c}const Kv=/xyz/.test((()=>{}))?/\b_super\b/:/.*/,Gv=function(){};function Jv(e,t,n,i){0===arguments.length?this.set(0,0,0,0):this.set(e,t,n,i)}Gv.extend=function e(t,n){const i=this.prototype;"string"!=typeof t&&(n=t,t="Class");const r=Object.create(this.prototype);for(const e in n)r[e]="function"==typeof n[e]&&"function"==typeof i[e]&&Kv.test(n[e])?function(e,t){return function(){const n=this._super;this._super=i[e];const r=t.apply(this,arguments);return this._super=n,r}}(e,n[e]):n[e];if(!/^[_a-z][_a-z\d]*$/i.test(t))throw new Error("Invalid subclass name. Alphanumericals only.");const o=new Function(`return (function ${t}(){ typeof this.init === 'function' && this.init.apply(this, [].slice.call(arguments)) });`)();return o.prototype=r,o.prototype.constructor=o,o.extend=e,o},Jv.prototype={toString(){return`${this.x} ${this.y} ${this.width} ${this.height}`},clone(){return new Jv(this.x,this.y,this.width,this.height)},set(e,t,n,i){n>=0?(this.x=e,this.width=n):(this.x=e+n,this.width=-n),i>=0?(this.y=t,this.height=i):(this.y=t+i,this.height=-i)},setLTRB(e,t,n,i){e<=n?(this.x=e,this.width=n-e):(this.x=n,this.width=e-n),t<=i?(this.y=t,this.height=i-t):(this.y=i,this.height=t-i)},equal(e){return e&&this.x===e.x&&this.y===e.y&&this.width===e.width&&this.height===e.height},combineWith(e){const t=Math.max(e.getRight(),this.getRight()),n=Math.max(e.getBottom(),this.getBottom()),i=Math.min(e.x,this.x),r=Math.min(e.y,this.y);return new Jv(i,r,Math.max(0,t-i),Math.max(0,n-r))},intersectsWith(e){return!!e&&(this.x<=e.getRight()&&e.x<=this.getRight()&&this.y<=e.getBottom()&&e.y<=this.getBottom())},intersectsRect(e){return this.intersectsWith(e)},intersection(e,t){if(this.intersectsWith(e)){const t=Math.max(this.x,e.x),n=Math.max(this.y,e.y);return new Jv(t,n,Math.min(this.getRight(),e.getRight())-t,Math.min(this.getBottom(),e.getBottom())-n)}return t?null:new Jv(this.x,this.y,this.width,this.height)},union(e){const t=Math.min(this.x,e.x),n=Math.min(this.y,e.y);return new Jv(t,n,Math.max(this.getRight(),e.getRight())-t,Math.max(this.getBottom(),e.getBottom())-n)},pointInside(e,t){return e>=this.x&&e<=this.getRight()&&t>=this.y&&t<=this.getBottom()},rectInside(e){const t=e.getPoints();let n;for(n=0;n<4;n++)if(!this.pointInside(t[n].x,t[n].y))return!1;return!0},getPoints(){const e=[];return e.push({x:this.x,y:this.y}),e.push({x:this.getRight(),y:this.y}),e.push({x:this.getRight(),y:this.getBottom()}),e.push({x:this.x,y:this.getBottom()}),e},getRight(){return this.x+this.width},getBottom(){return this.y+this.height},getCenterPoint(){return{x:this.x+this.width/2,y:this.y+this.height/2}},getBoundingRect(){return this},scale(e){const t=e-1,n=t*this.width/2,i=t*this.height/2;this.x-=n,this.y-=i,this.width*=e,this.height*=e},hasNaN(){return Number.isNaN(+this.x)||Number.isNaN(+this.y)||Number.isNaN(+this.width)||Number.isNaN(+this.height)}};const Zv=new Jv(0,0,0,0),Qv=new Jv(0,0,0,0),eb=Gv.extend("CubeSlicer",{init(){this.pages=[]},get(e){return e.map((e=>this.getPage(e)))},getPage(e){let t,n;const i=[];let r;for(n=0;n<this.pages.length;n++)if(t=this.pages[n].qArea,Zv.set(e.qLeft,e.qTop,e.qWidth,e.qHeight),Qv.set(t.qLeft,t.qTop,t.qWidth,t.qHeight),r=Qv.intersection(Zv,!0),i.push({coverage:r?r.clone():new Jv(0,0,0,0),idx:n}),t.qLeft<=e.qLeft&&t.qLeft+t.qWidth>=e.qLeft+e.qWidth&&t.qTop<=e.qTop&&t.qTop+t.qHeight>=e.qTop+e.qHeight)return this._extract(e,this.pages[n]);return i.sort(((e,t)=>t.coverage.width*t.coverage.height-e.coverage.width*e.coverage.height)),i[0].coverage.height>0&&i[0].coverage.width>0?this._extract(e,this.pages[i[0].idx]):{qArea:{qTop:e.qTop,qLeft:e.qLeft,qWidth:0,qHeight:0},qMatrix:[]}},destroy(){this.clear()},isEmpty(){return!(this.pages&&this.pages[0]&&this.pages[0].qArea.qHeight&&this.pages[0].qArea.qWidth)},clear(){this.pages=[]},store(e){this.pages=e},containsArea(e){let t;for(let n=0;n<this.pages.length;n++)if(t=this.pages[n].qArea,t.qLeft<=e.qLeft&&t.qLeft+t.qWidth>=e.qLeft+e.qWidth&&t.qTop<=e.qTop&&t.qTop+t.qHeight>=e.qTop+e.qHeight)return!0;return!1},contains(e){return!(!this.pages||!this.pages.length)&&0===e.filter((e=>!this.containsArea(e))).length},_extract(e,t){Zv.set(e.qLeft,e.qTop,e.qWidth,e.qHeight),Qv.set(t.qArea.qLeft,t.qArea.qTop,t.qArea.qWidth,t.qArea.qHeight);const n=Zv.intersection(Qv,!0);if(!n)return{qArea:{qTop:e.qTop,qLeft:e.qLeft,qWidth:0,qHeight:0},qMatrix:[]};const i=Math.max(0,e.qTop-t.qArea.qTop),r=Math.max(0,e.qLeft-t.qArea.qLeft),o=t.qMatrix.slice(i,i+n.height).map((e=>e.slice(r,r+n.width)));return{qArea:{qTop:n.y,qLeft:n.x,qWidth:n.width,qHeight:n.height},qMatrix:o}}});let tb;function nb(e,t){let n;const i={};for(n in e)"qSubNodes"!==n&&e.hasOwnProperty(n)&&(i[n]=e[n]);return t.push(i),i}function ib(e,t,n){let i,r,o;const s=[];let a=[],l=0,c=0;for(n.length&&(l=n[0].qUp||0,c=n[n.length-1].qDown||0),i=0;i<n.length;++i)if(r=n[i],r.qSubNodes.length>0&&(a=ib(e,t,r.qSubNodes)),o=null,(0===r.qSubNodes.length&&tb>=e&&tb<=e+t||a.length>0)&&(o=nb(r,s),void 0!==o.qUp&&1===s.length&&(o.qUp=l+i),o.qSubNodes=a),0===r.qSubNodes.length&&tb++,tb===e+t){o&&void 0!==o.qDown&&(o.qDown=c+(n.length-1-i));break}return s}function rb(e,t,n){return tb=0,ib(e,t,n)}const ob=new Jv(0,0,0,0),sb=new Jv(0,0,0,0),ab=eb.extend("PivotCubeSlicer",{init(){this._super(),this.requestedAreas=[]},getPage(e){let t,n;const i=[];let r;for(n=0;n<this.pages.length;n++)if(t=this.pages[n].qArea,ob.set(e.qLeft,e.qTop,e.qWidth,e.qHeight),sb.set(t.qLeft,t.qTop,t.qWidth,t.qHeight),r=sb.intersection(ob,!0),i.push({coverage:r?r.clone():new Jv(0,0,0,0),idx:n}),t.qLeft<=e.qLeft&&t.qLeft+t.qWidth>=e.qLeft+e.qWidth&&t.qTop<=e.qTop&&t.qTop+t.qHeight>=e.qTop+e.qHeight)return this._extract(e,this.pages[n]);return i.sort(((e,t)=>t.coverage.width*t.coverage.height-e.coverage.width*e.coverage.height)),i[0].coverage.height>0&&i[0].coverage.width>0?this._extract(e,this.pages[i[0].idx]):{qLeft:[],qTop:[],qData:[],qArea:{qTop:e.qTop,qLeft:e.qLeft,qWidth:0,qHeight:0}}},_extract(e,t){ob.set(e.qLeft,e.qTop,e.qWidth,e.qHeight),sb.set(t.qArea.qLeft,t.qArea.qTop,t.qArea.qWidth,t.qArea.qHeight);const n=ob.intersection(sb,!0);if(!n)return{qLeft:[],qTop:[],qData:[],qArea:{qTop:e.qTop,qLeft:e.qLeft,qWidth:0,qHeight:0}};const i=Math.max(0,e.qTop-t.qArea.qTop),r=Math.max(0,e.qLeft-t.qArea.qLeft),o=t.qData.slice(i,i+n.height).map((e=>e.slice(r,r+n.width)));return{qLeft:rb(i,n.height,t.qLeft),qTop:rb(r,n.width,t.qTop),qData:o,qArea:{qTop:n.y,qLeft:n.x,qWidth:n.width,qHeight:n.height}}}});function lb(e){if("pivot-table"===e.visualization)this.responseProperty="qPivotDataPages",this.slicer=new ab;else{if("table"!==e.visualization)return;this.slicer=new eb}let t=e.snapshotData.object.origDataPages;t||(t=e.qHyperCube[this.responseProperty]),this.slicer.store(t.filter((e=>e)))}class cb{constructor(e,t,n){this.layout=e,this.dataPath=t,this.responseProperty=n,lb.call(this,e)}getData(e){!function(e,t,n,i){if(e){t.snapshotData.object.origDataPages||(t.snapshotData.object.origDataPages=t.qHyperCube[i]);for(let e=0;e<n.length;e++)n[e].qHeight=Math.min(t.qHyperCube.qSize.qcy,n[e].qHeight),n[e].qTop=t.snapshotData.object.origDataPages[e].qArea.qTop;t.qHyperCube[i]=e.get(n)}}(this.slicer,this.layout,e,this.responseProperty);const t=Ev(this.layout,`${this.dataPath}.${this.responseProperty}`);return Promise.resolve(t)}setCacheOptions(){}updateCache(){}}const ub={version:"0.40.0",qHyperCubeDef:{qDimensions:[],qMeasures:[],qMode:"K",qAlwaysFullyExpanded:!0,qSuppressZero:!1,qSuppressMissing:!0},color:{box:{paletteColor:{index:-1,color:"#e6e6e6"}},expressionLabel:"",point:{auto:!0,mode:"primary",useBaseColors:"off",expressionIsColor:!0}},dataPoint:{bubbleScales:100,displacement:"none"},dimensionAxis:{dock:"near",label:"auto",show:"all"},measureAxis:{autoMinMax:!0,dock:"near",max:10,min:0,minMax:"min",show:"all",spacing:1},gridlines:{auto:!0,spacing:2},orientation:"horizontal",presentation:{visibleComponents:"points_box"},refLine:{refLines:[]},sorting:{autoSort:!0},showTitles:!0,subtitle:"",title:"",footnote:""};function hb(e){2===e.qHyperCubeDef.qInterColumnSortOrder.length?e.qHyperCubeDef.qInterColumnSortOrder=[1,0]:3===e.qHyperCubeDef.qInterColumnSortOrder.length&&(e.qHyperCubeDef.qInterColumnSortOrder=[1,2,0])}function db(e){e.qHyperCubeDef.qDimensions.length>1&&e.color&&(e.color.point.persistent=!0)}function fb(e){const{translator:t}=e,n={min:1,max:2,description(e,n){let i;return i=0===n?"Visualizations.Descriptions.Point":"horizontal"===e.orientation?"properties.yAxis":"properties.xAxis",t.get(i)},added(e,t){hb(t),db(t)},moved(e,t){hb(t),db(t)},removed(e,t){hb(t),db(t)}},i={min:1,max:1,description(e){const n="horizontal"===e.orientation?"properties.xAxis":"properties.yAxis";return t.get(n)}};return{path:"/qHyperCubeDef",dimensions:n,measures:i}}var pb={exports:{}};!function(e,t){window,e.exports=function(e){var t={};function n(i){if(t[i])return t[i].exports;var r=t[i]={i:i,l:!1,exports:{}};return e[i].call(r.exports,r,r.exports,n),r.l=!0,r.exports}return n.m=e,n.c=t,n.d=function(e,t,i){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:i})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var i=Object.create(null);if(n.r(i),Object.defineProperty(i,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var r in e)n.d(i,r,function(t){return e[t]}.bind(null,r));return i},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="/conversion/",n(n.s=2)}([function(e,t,n){var i=Object.prototype.hasOwnProperty,r=Object.prototype.toString,o=Object.defineProperty,s=Object.getOwnPropertyDescriptor,a=function(e){return"function"==typeof Array.isArray?Array.isArray(e):"[object Array]"===r.call(e)},l=function(e){if(!e||"[object Object]"!==r.call(e))return!1;var t,n=i.call(e,"constructor"),o=e.constructor&&e.constructor.prototype&&i.call(e.constructor.prototype,"isPrototypeOf");if(e.constructor&&!n&&!o)return!1;for(t in e);return void 0===t||i.call(e,t)},c=function(e,t){o&&"__proto__"===t.name?o(e,t.name,{enumerable:!0,configurable:!0,value:t.newValue,writable:!0}):e[t.name]=t.newValue},u=function(e,t){if("__proto__"===t){if(!i.call(e,t))return;if(s)return s(e,t).value}return e[t]};e.exports=function e(){var t,n,i,r,o,s,h=arguments[0],d=1,f=arguments.length,p=!1;for("boolean"==typeof h&&(p=h,h=arguments[1]||{},d=2),(null==h||"object"!=typeof h&&"function"!=typeof h)&&(h={});d<f;++d)if(null!=(t=arguments[d]))for(n in t)i=u(h,n),h!==(r=u(t,n))&&(p&&r&&(l(r)||(o=a(r)))?(o?(o=!1,s=i&&a(i)?i:[]):s=i&&l(i)?i:{},c(h,{name:n,newValue:e(p,s,r)})):void 0!==r&&c(h,{name:n,newValue:r}));return h}},function(e,t,n){e.exports=function(e){var t={};function n(i){if(t[i])return t[i].exports;var r=t[i]={i:i,l:!1,exports:{}};return e[i].call(r.exports,r,r.exports,n),r.l=!0,r.exports}return n.m=e,n.c=t,n.d=function(e,t,i){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:i})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var i=Object.create(null);if(n.r(i),Object.defineProperty(i,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var r in e)n.d(i,r,function(t){return e[t]}.bind(null,r));return i},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="/qlik-modifiers/",n(n.s=1)}([function(e,t,n){var i=Object.prototype.hasOwnProperty,r=Object.prototype.toString,o=Object.defineProperty,s=Object.getOwnPropertyDescriptor,a=function(e){return"function"==typeof Array.isArray?Array.isArray(e):"[object Array]"===r.call(e)},l=function(e){if(!e||"[object Object]"!==r.call(e))return!1;var t,n=i.call(e,"constructor"),o=e.constructor&&e.constructor.prototype&&i.call(e.constructor.prototype,"isPrototypeOf");if(e.constructor&&!n&&!o)return!1;for(t in e);return void 0===t||i.call(e,t)},c=function(e,t){o&&"__proto__"===t.name?o(e,t.name,{enumerable:!0,configurable:!0,value:t.newValue,writable:!0}):e[t.name]=t.newValue},u=function(e,t){if("__proto__"===t){if(!i.call(e,t))return;if(s)return s(e,t).value}return e[t]};e.exports=function e(){var t,n,i,r,o,s,h=arguments[0],d=1,f=arguments.length,p=!1;for("boolean"==typeof h&&(p=h,h=arguments[1]||{},d=2),(null==h||"object"!=typeof h&&"function"!=typeof h)&&(h={});d<f;++d)if(null!=(t=arguments[d]))for(n in t)i=u(h,n),h!==(r=u(t,n))&&(p&&r&&(l(r)||(o=a(r)))?(o?(o=!1,s=i&&a(i)?i:[]):s=i&&l(i)?i:{},c(h,{name:n,newValue:e(p,s,r)})):void 0!==r&&c(h,{name:n,newValue:r}));return h}},function(e,t,n){n.r(t);var i=n(0),r=n.n(i),o=function(e,t,n){if(!t)return!1;var i,r=t.split("."),o=r[r.length-1],s=e;for(i=0;i<r.length-1;++i)void 0===s[r[i]]&&(s[r[i]]=Number.isNaN(+r[i+1])?{}:[]),s=s[r[i]];if(void 0!==n){var a=s[o];return s[o]=n,{updated:n,previous:a}}return delete s[o],!1},s=function(e,t,n){var i,r=t.split("."),o=e;if(void 0===o)return n;for(i=0;i<r.length;++i){if(void 0===o[r[i]])return n;o=o[r[i]]}return o},a="".concat(" ","(").concat(" "),l="".concat(" ",")").concat(" ");function c(e){return a+e+l}function u(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(e.qLibraryId){var n=function(e,t){if(!t)return null;var n,i;for(n=0;n<t.length;n++)if((i=t[n]).qInfo.qId===e)return i;return null}(e.qLibraryId,t.dimensionList);return n&&n.qData.info[0].qTags.indexOf("$numeric")>-1}var i=function(e,t){if(!t)return null;var n,i,r=function(e){var t=e.trim();"="===t.charAt(0)&&(t=(t=t.substring(1)).trim());var n=t.length-1;return"["===t.charAt(0)&&"]"===t.charAt(n)&&(t=(t=t.substring(1,n)).trim()),t}(e);for(n=0;n<t.length;n++){if((i=t[n]).qName===r)return i;if(i.qDerivedFieldData)for(var o=0;o<i.qDerivedFieldData.qDerivedFieldLists.length;++o)for(var s=i.qDerivedFieldData.qDerivedFieldLists[o],a=0;a<s.qFieldDefs.length;++a){var l=s.qFieldDefs[a];if(l.qName===r)return l}}return null}(e.qDef.qFieldDefs[0],t.fieldList);return i&&i.qTags.indexOf("$numeric")>-1}function h(e){return!(!e.fullAccumulation&&!e.fullRange)}function d(e,t){var n=e.crossAllDimensions;return 2===t&&n?"RowNo(Total)":"RowNo()"}function f(e){var t=function(e){return e?(e=function(e){return e.replace(/\/\*[^]*?\*\//g,"")}(e=function(e){return e.replace(/\/\/(.*)$/gm,"")}(e))).trim():""}(e).trim();return"="===t.substring(0,1)?t.substring(1).trim():t}function p(){return"[$(=Replace(GetObjectField(".concat(arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,"),']',']]'))]")}function m(e,t){var n=e.crossAllDimensions;return 2===t&&n?"Above(Total ":"Above("}function g(e){return void 0===e?")":", 0, ".concat(e,")")}function y(e,t){return e?"".concat(t,'={">=$(=Min(').concat(t,"))<=$(=Max(").concat(t,'))"}'):"".concat(t,'={"=Only({1}').concat(t,")>='$(=MinString(").concat(t,"))' and Only({1}").concat(t,")<='$(=MaxString(").concat(t,"))'\"}")}function v(e){var t=e.modifier,n=void 0===t?{}:t,i=e.dimensions,r=e.dimensionAndFieldList,o=e.funcComp,s=void 0===o?"Sum":o,a=e.valueComp,l=void 0===a?"0":a;if(!n.showExcludedValues)return"";if(i&&1===i.length){var c=y(u(i[0],r),p(0));return"".concat(s,"({1<").concat(c,">}").concat(l,")")}if(i&&2===i.length){var h=u(i[0],r),d=u(i[1],r),f=p(0),m=p(1),g=y(h,f),v=y(d,m);return"".concat(s,"({1<").concat(g,",").concat(v,">}").concat(l,")")}return"".concat(s,"({1}").concat(l,")")}function b(e){return"".concat(e,"(")}function x(e){var t=e.properties,n=e.layout;return s(t,"qHyperCubeDef.qDimensions",s(n,"qHyperCube.qDimensionInfo",[])).length}var w={isFullRange:h,getNumDimensions:x,getExpressionWithExcludedComp:function(e){var t=e.expression,n=e.modifier,i=e.dimensions,r=e.dimensionAndFieldList,o=e.treatMissingAsNull,s=c(f(t));if(!n.showExcludedValues)return s;var a=v({modifier:n,dimensions:i,dimensionAndFieldList:r}),l=o?"":", 0";if(i&&1===i.length){var u=p(0);return"If(Count(".concat(u,") > 0, ").concat(s," + ").concat(a).concat(l,")")}if(i&&2===i.length){var h=p(0),d=p(1);return"If(Count(".concat(h,") * Count(").concat(d,") > 0, ").concat(s," + ").concat(a).concat(l,")")}return s},getRowNoComp:d,getNumStepComp:function(e,t){if(!h(e)){var n=e.steps;return"number"!=typeof n||Number.isNaN(n)?6:n}return d(e,t)},getAboveCompPrefix:m,getAboveCompSuffix:g,getAboveComp:function(e,t,n,i){return m(e,t)+n+g(i)},getFunctionPrefix:b,getFunctionSuffix:function(){return")"},getRangeComp:function(e,t){return b(e)+t+")"},getAggrComp:function(e,t,n){return"Aggr(".concat(e,", ").concat(t,", ").concat(n,")")},getExcludedComp:v,needDimension:function(e){var t=e.modifier,n=e.properties,i=e.layout;return 0===function(e){return void 0===e.primaryDimension?e.accumulationDimension:e.primaryDimension}(t)&&2===x({properties:n,layout:i})},getDimComp:function(e,t){var n=function(e){return e[arguments.length>1&&void 0!==arguments[1]?arguments[1]:0].qDef.qSortCriterias[0]}(e,t),i=p(t);if(!n.qSortByExpression&&!n.qSortByNumeric&&!n.qSortByAscii)return i;var r=["Descending","Ascending"],o=n.qSortByNumeric?"(Numeric, ".concat(r[(n.qSortByNumeric+1)/2],")"):"",s=n.qSortByAscii?"(Text, ".concat(r[(n.qSortByAscii+1)/2],")"):"";return n.qSortByNumeric&&n.qSortByAscii?"(".concat(i,", ").concat(o,", ").concat(s,")"):n.qSortByNumeric?"(".concat(i,", ").concat(o,")"):n.qSortByAscii?"(".concat(i,", ").concat(s,")"):i},simplifyExpression:f,extractInputExpression:function(e){var t=e.outputExpression;if(e.modifier){var n=t.indexOf(a);if(-1!==n){var i=t.indexOf(l);if(-1!==i)return t.substring(n+a.length,i)}}},initModifier:function(e,t){Object.keys(t).forEach((function(n){void 0===e[n]&&(e[n]=t[n])}))},isNumeric:u,isApplicable:function(e){var t=e.properties,n=e.layout,i=e.minDimensions,r=void 0===i?1:i,o=e.maxDimensions,s=void 0===o?2:o;if(!t&&!n)return!0;var a=x({properties:t,layout:n});return a>=r&&a<=s},getExpressionWithMarkers:c,canExtract:function(e){var t=e.indexOf(a),n=e.indexOf(l);return t>-1&&n>-1&&t<n},getDimDefWithWrapper:p,getFieldWithWrapper:function(e){var t=e?e.replace(/]/g,"]]"):e;return"[".concat(t,"]")}};function q(e){return(q="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}var S=r.a.bind(null,!0),M={},D=Array.isArray;function _(e){return null!=e&&!Array.isArray(e)&&"object"===q(e)}function C(e){return void 0===e}function k(e,t){return"function"==typeof e[t]||"$$"===t.substring(0,2)||"_"===t.substring(0,1)}function E(e,t){var n,i=t.substring(1).split("/").slice(0,-1);return i.forEach((function(t,r){if(r!==i.length){n=+t;var o=Number.isNaN(n)?{}:[];e[n||t]=C(e[n||t])?o:e[t],e=e[n||t]}})),e}function A(e,t){var n=!0;if(_(e)&&_(t))return Object.keys(e).length===Object.keys(t).length&&(Object.keys(e).forEach((function(i){A(e[i],t[i])||(n=!1)})),n);if(D(e)&&D(t)){if(e.length!==t.length)return!1;for(var i=0,r=e.length;i<r;i+=1)if(!A(e[i],t[i]))return!1;return!0}return e===t}M.generate=function(e,t,n){n=n||"";var i=[];return Object.keys(t).forEach((function(r){var o=function(e){return e?S({},{val:e}).val:e}(t[r]),s=e[r],a="".concat(n,"/").concat(r);A(o,s)||k(t,r)||(C(s)?i.push({op:"add",path:a,value:o}):_(o)&&_(s)?i=i.concat(M.generate(s,o,a)):D(o)&&D(s)?i=i.concat(function(e,t,n){var i=[],r=e.slice(),o=-1;function s(e,t,n){if(e[n]&&C(e[n].qInfo))return null;if(e[n]&&e[n].qInfo.qId===t)return n;for(var i=0,r=e.length;i<r;i+=1)if(e[i]&&e[i].qInfo.qId===t)return i;return-1}if(A(t,r))return i;if(!C(t[0])&&C(t[0].qInfo))return i.push({op:"replace",path:n,value:t}),i;for(var a=r.length-1;a>=0;a-=1)-1===(o=s(t,r[a].qInfo&&r[a].qInfo.qId,a))?(i.push({op:"remove",path:"".concat(n,"/").concat(a)}),r.splice(a,1)):i=i.concat(M.generate(r[a],t[o],"".concat(n,"/").concat(a)));for(var l=0,c=t.length;l<c;l+=1)-1===(o=s(r,t[l].qInfo&&t[l].qInfo.qId))?(i.push({op:"add",path:"".concat(n,"/").concat(l),value:t[l]}),r.splice(l,0,t[l])):o!==l&&(i.push({op:"move",path:"".concat(n,"/").concat(l),from:"".concat(n,"/").concat(o)}),r.splice(l,0,r.splice(o,1)[0]));return i}(s,o,a)):i.push({op:"replace",path:"".concat(n,"/").concat(r),value:o}))})),Object.keys(e).forEach((function(r){C(t[r])&&!k(e,r)&&i.push({op:"remove",path:"".concat(n,"/").concat(r)})})),i},M.apply=function(e,t){t.forEach((function(t){var n,i=E(e,t.path),r=t.path.split("/").splice(-1)[0],o=r&&Number.isNaN(+r)?i[r]:i[+r]||i,s=t.from?t.from.split("/").splice(-1)[0]:null;if("/"===t.path&&(i=null,o=e),"add"===t.op||"replace"===t.op)if(D(i))"-"===r&&(r=i.length),i.splice(+r,"add"===t.op?0:1,t.value);else if(D(o)&&D(t.value)){var a,l=t.value.slice();o.length=0,(a=o).push.apply(a,function(e){return function(e){if(Array.isArray(e)){for(var t=0,n=new Array(e.length);t<e.length;t++)n[t]=e[t];return n}}(e)||function(e){if(Symbol.iterator in Object(e)||"[object Arguments]"===Object.prototype.toString.call(e))return Array.from(e)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance")}()}(l))}else if(_(o)&&_(t.value))n=o,Object.keys(n).forEach((function(e){Object.getOwnPropertyDescriptor(n,e).configurable&&!k(n,e)&&delete n[e]})),S(o,t.value);else{if(!i)throw new Error("Patchee is not an object we can patch");i[r]=t.value}else if("move"===t.op){var c=E(e,t.from);D(i)?i.splice(+r,0,c.splice(+s,1)[0]):(i[r]=c[s],delete c[s])}else"remove"===t.op&&(D(i)?i.splice(+r,1):delete i[r])}))},M.clone=function(e){return S({},e)},M.createPatch=function(e,t,n){var i={op:e.toLowerCase(),path:n};return"move"===i.op?i.from=t:void 0!==t&&(i.value=t),i},M.updateObject=function(e,t){Object.keys(e).length?M.apply(e,M.generate(e,t)):S(e,t)};var T=M,I=function(e,t,n){if(!e)return Promise.resolve();var i=T.generate(t,n);return r()(!0,t,n),i&&i.length?(i=i.map((function(e){return{qOp:e.op,qValue:JSON.stringify(e.value),qPath:e.path}})),e.applyPatches(i,!0)):Promise.resolve()},R="accumulation";function O(e,t){var n=s(e,t);if(n)for(var i=0;i<n.length;i++)if(n[i].type===R)return n[i]}function N(e,t){var n=function(e,t){var n=s(e,t);if(!n)return-1;for(var i=0;i<n.length;i++)if(n[i].type===R)return i;return-1}(e,t);return n>-1?"".concat(t,".").concat(n):t}var P={type:"accumulation",disabled:!1,accumulationDimension:0,crossAllDimensions:!1,showExcludedValues:!0,fullAccumulation:!1,steps:6,outputExpression:""},L={translationKey:"properties.modifier.accumulation",needDimension:w.needDimension,isApplicable:function(e){var t=e.properties,n=e.layout;return w.isApplicable({properties:t,layout:n,minDimensions:1,maxDimensions:2})},generateExpression:function(e){var t=e.expression,n=e.modifier,i=e.properties,r=e.layout,o=e.numDimensions,a=e.dimensionAndFieldList;if(!n)return t;var l=o;void 0===l&&(l=w.getNumDimensions({properties:i,layout:r}));var c=s(i,"qHyperCubeDef.qDimensions",[]),u=w.getExpressionWithExcludedComp({expression:t,modifier:n,dimensions:c,dimensionAndFieldList:a}),h=w.getNumStepComp(n,l),d=w.getAboveComp(n,l,u,h),f=w.getRangeComp("RangeSum",d);if(w.needDimension({modifier:n,properties:i,layout:r})){var p=w.getDimComp(c,1),m=w.getDimComp(c,0),g=w.getAggrComp(f,p,m);f=n.showExcludedValues?w.getExcludedComp({modifier:n,dimensions:c,dimensionAndFieldList:a,valueComp:g}):g}return f},extractInputExpression:w.extractInputExpression,initModifier:function(e){w.initModifier(e,P)},enableTotalsFunction:function(){return!1},propertyPanelDef:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n={type:"items",items:{disclaimer:{component:"text",translation:t.disclaimer||"properties.modifier.accumulation.disclaimer",show:function(e,t){return!w.isApplicable({properties:t.properties})}},settings:{type:"items",items:{primaryDimension:{refFn:function(t){return"".concat(N(t,e),".accumulationDimension")},type:"integer",translation:t.primaryDimension||"properties.modifier.primaryDimension",title:{translation:t.primaryDimensionTooltip||"properties.modifier.accumulation.primaryDimension.tooltip"},component:"dropdown",schemaIgnore:!0,defaultValue:1,options:function(e,t){return t.layout.qHyperCube.qDimensionInfo.map((function(e,t){return{value:t,label:e.qGroupFallbackTitles[0]}}))},show:function(e,t){return t.layout.qHyperCube.qDimensionInfo.length>1}},crossAllDimensions:{refFn:function(t){return"".concat(N(t,e),".crossAllDimensions")},type:"boolean",translation:t.crossAllDimensions||"properties.modifier.crossAllDimensions",title:{translation:t.crossAllDimensionsTooltip||"properties.modifier.accumulation.crossAllDimensions.tooltip"},schemaIgnore:!0,defaultValue:!1,show:function(e,t){return t.layout.qHyperCube.qDimensionInfo.length>1}},fullRange:{refFn:function(t){return"".concat(N(t,e),".fullAccumulation")},type:"boolean",translation:t.range||"properties.modifier.range",component:"dropdown",schemaIgnore:!0,defaultValue:!1,options:[{value:!0,translation:t.rangeFull||"properties.modifier.range.full"},{value:!1,translation:t.rangeCustom||"properties.modifier.range.custom"}]},steps:{refFn:function(t){return"".concat(N(t,e),".steps")},type:"integer",translation:t.rangeSteps||"properties.modifier.range.steps",schemaIgnore:!0,defaultValue:6,change:function(t){var n=O(t,e);if(n){var i=n.steps;n.steps="number"!=typeof i||Number.isNaN(i)?6:Math.abs(i)}},show:function(t){var n=O(t,e);return n&&!n.fullAccumulation}},showExcludedValues:{refFn:function(t){return"".concat(N(t,e),".showExcludedValues")},type:"boolean",translation:t.showExcludedValues||"properties.modifier.showExcludedValues",schemaIgnore:!0,defaultValue:!0}},show:function(e,t){return w.isApplicable({properties:t.properties})}}},show:function(t,n,i){var r=i.ext.support.modifiers;if(!Array.isArray(r)||-1===r.indexOf(R))return!1;var o=O(t,e);return o&&!o.disabled}};return n}},F="movingAverage";function z(e,t){var n=s(e,t);if(n)for(var i=0;i<n.length;i++)if(n[i].type===F)return n[i]}function j(e,t){var n=function(e,t){var n=s(e,t);if(!n)return-1;for(var i=0;i<n.length;i++)if(n[i].type===F)return i;return-1}(e,t);return n>-1?"".concat(t,".").concat(n):t}var H={type:"movingAverage",disabled:!1,primaryDimension:0,crossAllDimensions:!1,showExcludedValues:!0,fullRange:!1,steps:6,outputExpression:"",nullSuppression:!1},B={translationKey:"properties.modifier.movingAverage",needDimension:w.needDimension,isApplicable:function(e){var t=e.properties,n=e.layout;return w.isApplicable({properties:t,layout:n,minDimensions:1,maxDimensions:2})},generateExpression:function(e){var t,n=e.expression,i=e.modifier,r=e.properties,o=e.layout,a=e.numDimensions,l=e.dimensionAndFieldList;if(!i)return n;var c=a;void 0===c&&(c=w.getNumDimensions({properties:r,layout:o}));var u=s(r,"qHyperCubeDef.qDimensions",[]),h=i.showExcludedValues&&i.nullSuppression,d=w.getExpressionWithExcludedComp({expression:n,modifier:i,dimensions:u,dimensionAndFieldList:l,treatMissingAsNull:h}),f=w.getNumStepComp(i,c),p=w.getAboveComp(i,c,d,f);if(i.nullSuppression)t=w.getRangeComp("RangeAvg",p);else{var m=w.getRangeComp("RangeSum",p),g=function(e,t){var n=w.getRowNoComp(e,t);if(!w.isFullRange(e)){var i=e.steps,r="number"!=typeof i||Number.isNaN(i)?6:i;return"RangeMin(".concat(r,", ").concat(n,")")}return n}(i,c);t="".concat(m," / ").concat(g)}var y=t;if(w.needDimension({modifier:i,properties:r,layout:o})){var v=w.getDimComp(u,1),b=w.getDimComp(u,0),x=w.getAggrComp(y,v,b);y=i.showExcludedValues?w.getExcludedComp({modifier:i,dimensions:u,dimensionAndFieldList:l,funcComp:"Only",valueComp:x}):x}return y},extractInputExpression:w.extractInputExpression,initModifier:function(e){w.initModifier(e,H)},enableTotalsFunction:function(){return!1},propertyPanelDef:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n={type:"items",items:{disclaimer:{component:"text",translation:t.disclaimer||"properties.modifier.movingAverage.disclaimer",show:function(e,t){return!w.isApplicable({properties:t.properties})}},settings:{type:"items",items:{primaryDimension:{refFn:function(t){return"".concat(j(t,e),".primaryDimension")},type:"integer",translation:t.primaryDimension||"properties.modifier.primaryDimension",title:{translation:t.primaryDimensionTooltip||"properties.modifier.movingAverage.primaryDimension.tooltip"},component:"dropdown",schemaIgnore:!0,defaultValue:1,options:function(e,t){return t.layout.qHyperCube.qDimensionInfo.map((function(e,t){return{value:t,label:e.qGroupFallbackTitles[0]}}))},show:function(e,t){return t.layout.qHyperCube.qDimensionInfo.length>1}},crossAllDimensions:{refFn:function(t){return"".concat(j(t,e),".crossAllDimensions")},type:"boolean",translation:t.crossAllDimensions||"properties.modifier.crossAllDimensions",title:{translation:t.crossAllDimensionsTooltip||"properties.modifier.movingAverage.crossAllDimensions.tooltip"},schemaIgnore:!0,defaultValue:!1,show:function(e,t){return t.layout.qHyperCube.qDimensionInfo.length>1}},fullRange:{refFn:function(t){return"".concat(j(t,e),".fullRange")},type:"boolean",translation:t.range||"properties.modifier.range",component:"dropdown",schemaIgnore:!0,defaultValue:!1,options:[{value:!0,translation:t.rangeFull||"properties.modifier.range.full"},{value:!1,translation:t.rangeCustom||"properties.modifier.range.custom"}]},steps:{refFn:function(t){return"".concat(j(t,e),".steps")},type:"integer",translation:t.rangeSteps||"properties.modifier.range.steps",schemaIgnore:!0,defaultValue:6,change:function(t){var n=z(t,e);if(n){var i=n.steps;n.steps="number"!=typeof i||Number.isNaN(i)?6:Math.abs(i)}},show:function(t){var n=z(t,e);return n&&!n.fullRange}},showExcludedValues:{refFn:function(t){return"".concat(j(t,e),".showExcludedValues")},type:"boolean",translation:t.showExcludedValues||"properties.modifier.showExcludedValues",schemaIgnore:!0,defaultValue:!0},nullSuppression:{refFn:function(t){return"".concat(j(t,e),".nullSuppression")},type:"boolean",translation:t.showNull||"properties.dimensions.showNull",schemaIgnore:!0,defaultValue:!1,inverted:!0}},show:function(e,t){return w.isApplicable({properties:t.properties})}}},show:function(t,n,i){var r=i.ext.support.modifiers;if(!Array.isArray(r)||-1===r.indexOf(F))return!1;var o=z(t,e);return o&&!o.disabled}};return n}},V="difference";function $(e,t){var n=s(e,t);if(n)for(var i=0;i<n.length;i++)if(n[i].type===V)return n[i]}function W(e,t){var n=function(e,t){var n=s(e,t);if(!n)return-1;for(var i=0;i<n.length;i++)if(n[i].type===V)return i;return-1}(e,t);return n>-1?"".concat(t,".").concat(n):t}var U={type:"difference",disabled:!1,primaryDimension:0,crossAllDimensions:!1,showExcludedValues:!0,outputExpression:""},Y={translationKey:"properties.modifier.difference",needDimension:w.needDimension,isApplicable:function(e){var t=e.properties,n=e.layout;return w.isApplicable({properties:t,layout:n,minDimensions:1,maxDimensions:2})},extractInputExpression:w.extractInputExpression,generateExpression:function(e){var t=e.expression,n=e.modifier,i=e.properties,r=e.layout,o=e.numDimensions,a=e.dimensionAndFieldList;if(!n)return t;var l=o;void 0===l&&(l=w.getNumDimensions({properties:i,layout:r}));var c=s(i,"qHyperCubeDef.qDimensions",[]),u=w.getExpressionWithExcludedComp({expression:t,modifier:n,dimensions:c,dimensionAndFieldList:a}),h=w.getAboveComp(n,l,u),d="".concat(u," - ").concat(h);if(w.needDimension({modifier:n,properties:i,layout:r})){var f=w.getDimComp(c,1),p=w.getDimComp(c,0),m=w.getAggrComp(d,f,p);d=n.showExcludedValues?w.getExcludedComp({modifier:n,dimensions:c,dimensionAndFieldList:a,funcComp:"Only",valueComp:m}):m}return d},initModifier:function(e){Object.keys(U).forEach((function(t){void 0===e[t]&&(e[t]=U[t])}))},enableTotalsFunction:function(){return!1},propertyPanelDef:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n={type:"items",items:{disclaimer:{component:"text",translation:t.disclaimer||"properties.modifier.difference.disclaimer",show:function(e,t){return!w.isApplicable({properties:t.properties})}},settings:{type:"items",items:{primaryDimension:{refFn:function(t){return"".concat(W(t,e),".primaryDimension")},type:"integer",translation:t.primaryDimension||"properties.modifier.primaryDimension",title:{translation:t.primaryDimensionTooltip||"properties.modifier.difference.primaryDimension.tooltip"},component:"dropdown",schemaIgnore:!0,defaultValue:1,options:function(e,t){return t.layout.qHyperCube.qDimensionInfo.map((function(e,t){return{value:t,label:e.qGroupFallbackTitles[0]}}))},show:function(e,t){return t.layout.qHyperCube.qDimensionInfo.length>1}},crossAllDimensions:{refFn:function(t){return"".concat(W(t,e),".crossAllDimensions")},type:"boolean",translation:t.crossAllDimensions||"properties.modifier.crossAllDimensions",title:{translation:t.crossAllDimensionsTooltip||"properties.modifier.difference.crossAllDimensions.tooltip"},schemaIgnore:!0,defaultValue:!1,show:function(e,t){return t.layout.qHyperCube.qDimensionInfo.length>1}},showExcludedValues:{refFn:function(t){return"".concat(W(t,e),".showExcludedValues")},type:"boolean",translation:t.showExcludedValues||"properties.modifier.showExcludedValues",schemaIgnore:!0,defaultValue:!0}},show:function(e,t){return w.isApplicable({properties:t.properties})}}},show:function(t,n,i){var r=i.ext.support.modifiers;if(!Array.isArray(r)||-1===r.indexOf(V))return!1;var o=$(t,e);return o&&!o.disabled}};return n}},X={CURRENT_SELECTION:0,SELECT_FIELD_VALUE:1,DISREGARD_SELECTION:2},K={ONE_DIMENSION:0,ALL_DIMENSIOANS:1,DISREGARD_ALL_DIMENSIONS:2},G="normalization";function J(e,t){var n=s(e,t);if(n)for(var i=0;i<n.length;i++)if(n[i].type===G)return n[i]}function Z(e,t){var n=function(e,t){var n=s(e,t);if(!n)return-1;for(var i=0;i<n.length;i++)if(n[i].type===G)return i;return-1}(e,t);return n>-1?"".concat(t,".").concat(n):t}function Q(e,t){for(var n=0;n<e.length;n++)if(e[n].value===t)return n;return-1}function ee(e,t,n,i){var r=t.layout.qHyperCube.qDimensionInfo.length,o=[{value:K.ONE_DIMENSION,translation:n.dimensionalScopeOneDimension||"properties.modifier.dimensionalScope.respectOneDimension",tooltipTranslation:n.dimensionalScopeOneDimensionTooltip||"properties.modifier.dimensionalScope.respectOneDimension.tooltip"},{value:K.ALL_DIMENSIOANS,translation:n.dimensionalScopeAllDimensions||"properties.modifier.dimensionalScope.".concat(2===r?"respectAllDimensions":"respectDimension"),tooltipTranslation:n.dimensionalScopeAllDimensionsTooltip||"properties.modifier.dimensionalScope.".concat(2===r?"respectAllDimensions":"respectDimension",".tooltip")},{value:K.DISREGARD_ALL_DIMENSIONS,translation:n.dimensionalScopeDisregardAllDimensions||"properties.modifier.dimensionalScope.".concat(2===r?"disregardAllDimensions":"disregardDimension"),tooltipTranslation:n.dimensionalScopeDisregardAllDimensionsTooltip||"properties.modifier.dimensionalScope.".concat(2===r?"disregardAllDimensions":"disregardDimension",".tooltip")}];return o=function(e,t,n){if(e<2){var i=Q(t,0);t.splice(i,1)}return t}(r,o),function(e,t,n){if(0===e){var i=Q(t,1);t.splice(i,1)}return t}(J(e,i).selectionScope,o)}function te(e,t,n){var i=[{value:X.CURRENT_SELECTION,translation:t.selectionScopeCurrentSelection||"properties.modifier.selectionScope.currentSelection"},{value:X.SELECT_FIELD_VALUE,translation:t.selectionScopeSpecificValue||"properties.modifier.selectionScope.selectAField"},{value:X.DISREGARD_SELECTION,translation:t.selectionScopeTotal||"properties.modifier.selectionScope.total"}];return function(e,t,n){if(1===e){var i=Q(t,0);t.splice(i,1)}return t}(J(e,n).dimensionalScope,i)}var ne={type:"normalization",disabled:!1,primaryDimension:0,outputExpression:"",dimensionalScope:K.DISREGARD_ALL_DIMENSIONS,selectionScope:X.DISREGARD_SELECTION};function ie(e){return 2===e?"{1}":""}function re(e,t,n){return 1===e?"{$<".concat(w.getFieldWithWrapper(t),"={'").concat(n,"'}>}"):""}function oe(e,t){return 0===e&&t>1||2===e?"Total":""}function se(e,t,n){return 0===e&&t>1?"<".concat(w.getDimDefWithWrapper(n),">"):""}var ae={translationKey:"properties.modifier.normalization",needDimension:function(){return!0},isApplicable:function(e){var t=e.properties,n=e.layout;return w.isApplicable({properties:t,layout:n,minDimensions:1,maxDimensions:2})},extractInputExpression:w.extractInputExpression,generateExpression:function(e){var t=e.expression,n=e.modifier,i=e.properties,r=e.layout,o=e.numDimensions,a=e.dimensionAndFieldList;if(!n)return t;var l=o;void 0===l&&(l=w.getNumDimensions({properties:i,layout:r}));var c=s(i,"qHyperCubeDef.qDimensions",[]),u=w.getExpressionWithExcludedComp({expression:t,modifier:n,dimensions:c,dimensionAndFieldList:a}),h=n.selectionScope,d=n.dimensionalScope;return function(e,t,n,i,r,o,s){var a=ie(t),l=re(t,n,i),c=""===a&&""===l?"":a||l,u=oe(r,o),h=se(r,o,s),d=function(e){for(var t=[],n=0;n<e;n++)t[n]=w.getDimDefWithWrapper(n);return t.join(", ")}(o);return"".concat(e,"/ Sum(").concat(c," ").concat(u).concat(h," Aggr(").concat(c," ").concat(e,", ").concat(d,"))")}(u,h,n.field,n.value,d,l,n.primaryDimension)},initModifier:function(e){Object.keys(ne).forEach((function(t){void 0===e[t]&&(e[t]=ne[t])}))},updateModifier:function(e,t){1===(t.qDimensions?t.qDimensions.length:0)&&0===e.dimensionalScope&&(e.dimensionalScope=2)},enableTotalsFunction:function(){return!0},propertyPanelDef:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n={type:"items",items:{disclaimer:{component:"text",translation:t.disclaimer||"properties.modifier.normalization.disclaimer",show:function(e,t){return!w.isApplicable({properties:t.properties})}},settings:{type:"items",items:{selectionScope:{refFn:function(t){return"".concat(Z(t,e),".selectionScope")},type:"string",translation:t.modifierSelectionScope||"properties.modifier.selectionScope",title:{translation:t.modifierSelectionScopeTooltip||"properties.modifier.selectionScope.tooltip"},component:"dropdown",schemaIgnore:!0,defaultValue:X.DISREGARD_SELECTION,options:function(n){return te(n,t,e)}},field:{refFn:function(t){return"".concat(Z(t,e),".field")},type:"string",component:"expression-with-dropdown",translation:"Common.Field",defaultValue:"",dropdownOnly:!0,options:function(e,t,n){return n.app.getFieldList().then((function(e){return e.map((function(e){return{label:e.qName,value:e.qName}}))}))},show:function(t){return J(t,e).selectionScope===X.SELECT_FIELD_VALUE}},value:{refFn:function(t){return"".concat(Z(t,e),".value")},type:"string",ref:"value",component:"string",translation:"properties.value",expression:"optional",show:function(t){return J(t,e).selectionScope===X.SELECT_FIELD_VALUE}},dimensionalScope:{refFn:function(t){return"".concat(Z(t,e),".dimensionalScope")},type:"string",translation:t.modifierDimensionalScope||"properties.modifier.dimensionalScope",title:{translation:t.modifierDimensionalScopeTooltip||"properties.modifier.dimensionalScope.tooltip"},component:"dropdown",schemaIgnore:!0,defaultValue:K.DISREGARD_ALL_DIMENSIONS,supportTooltip:!0,options:function(n,i){return ee(n,i,t,e)}},primaryDimension:{refFn:function(t){return"".concat(Z(t,e),".primaryDimension")},type:"integer",translation:t.primaryDimension||"properties.modifier.primaryDimension",title:{translation:t.primaryDimensionTooltip||"properties.modifier.normalization.primaryDimension.tooltip"},component:"dropdown",schemaIgnore:!0,defaultValue:1,options:function(e,t){return t.layout.qHyperCube.qDimensionInfo.map((function(e,t){return{value:t,label:e.qGroupFallbackTitles[0]}}))},show:function(t,n){return(J(t,e).dimensionalScope||0)===K.ONE_DIMENSION&&n.layout.qHyperCube.qDimensionInfo.length>1}}},show:function(e,t){return w.isApplicable({properties:t.properties})}}},show:function(t,n,i){var r=i.ext.support.modifiers;if(!Array.isArray(r)||-1===r.indexOf(G))return!1;var o=J(t,e);return o&&!o.disabled}};return n},getDisregardSelectionComp:ie,getFieldSelectionComp:re,getTotalComp:oe,getSelectedDimComp:se},le={getExpression:function(e){return s(e,"qDef.base.qDef")||s(e,"qDef.qDef")},getExpressionRef:function(e){return s(e,"qDef.base.qDef")?"qDef.base.qDef":"qDef.qDef"},getLibraryIdRef:function(e){return s(e,"qDef.base.qLibraryId")?"qDef.base.qLibraryId":"qLibraryId"},getLibraryId:function(e){return s(e,"qDef.base.qLibraryId")||s(e,"qLibraryId")},getLabelRef:function(e){return s(e,"qDef.base")?"qDef.base.qLabel":"qDef.qLabel"},getLabelExpressionRef:function(e){return s(e,"qDef.base")?"qDef.base.qLabelExpression":"qDef.qLabelExpression"}},ce={initBase:function(e,t){(t||ce.isValid(e))&&(o(e,"qDef.base.qDef",s(e,"qDef.qDef")),o(e,"qDef.base.qLibraryId",s(e,"qLibraryId")),o(e,"qDef.base.qLabel",s(e,"qDef.qLabel")),o(e,"qDef.base.qLabelExpression",s(e,"qDef.qLabelExpression")))},restoreBase:function(e){ce.isValid(e)&&(o(e,"qDef.qDef",s(e,"qDef.base.qDef")),o(e,"qLibraryId",s(e,"qDef.base.qLibraryId")),o(e,"qDef.qLabel",s(e,"qDef.base.qLabel")),o(e,"qDef.qLabelExpression",s(e,"qDef.base.qLabelExpression")),s(e,"qDef.qAggrFunc")&&s(e,"qDef.base.qAggrFunc")&&o(e,"qDef.qAggrFunc",s(e,"qDef.base.qAggrFunc")),delete e.qDef.base)},isValid:function(e){var t=s(e,"qDef.base.qDef"),n=s(e,"qDef.base.qLibraryId");return void 0!==t||void 0!==n}},ue=ce;function he(e){return(he="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})(e)}var de={accumulation:L,movingAverage:B,difference:Y,normalization:ae},fe=(t.default={modifiers:de,apply:pe,applyModifiers:me,cleanUpMeasure:ge,destroy:function(e){e&&fe[e.id]&&fe[e.id].masterItemSubscriber&&(fe[e.id].masterItemSubscriber&&fe[e.id].masterItemSubscriber.unsubscribe(),delete fe[e.id])},hasActiveModifiers:ye,getActiveModifier:ve,initBase:ue.initBase,isSupportedModifiers:function(e){return Array.isArray(e)&&e.some((function(e){return de[e]}))},isApplicableSupportedModifiers:function(e){var t=e.modifierTypes,n=e.properties,i=e.layout;return Array.isArray(t)&&t.some((function(e){return de[e]&&de[e].isApplicable({properties:n,layout:i})}))},measureBase:le,limitedSorting:function(e){var t=e.measures,n=e.properties,i=e.layout,r=!1,o=!1;return t.forEach((function(e){var t=we(e);ke({modifiers:t,properties:n,layout:i})&&(r=!0,o=o||Re({modifiers:t,properties:n,layout:i}))})),r&&!o},ifEnableTotalsFunction:be},{});function pe(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.model,n=e.properties,i=e.isSnapshot,o=void 0!==i&&i,a=e.masterItem;fe[t.id]=fe[t.id]||{isFirstTime:!0};var l=fe[t.id].isFirstTime;if(fe[t.id].isFirstTime=!1,n&&"object"===he(n))return me({model:t,properties:n});var c=t?t.layout:void 0,u=s(c,"qSelectionInfo.qInSelections");if(o||u)return Promise.resolve(!1);var h=s(c,"qHyperCube.qMeasureInfo"),d=fe[t.id].lastReloadTime;if(fe[t.id].lastReloadTime=s(t,"app.layout.qLastReloadTime"),ye({measures:h,layout:c})){var f=function(e){var t=e.measures,n=e.layout,i=e.lastReloadTime;return s(e.model,"app.layout.qLastReloadTime")!==i&&function(e){var t=e.measures,n=e.properties,i=e.layout;return!!Array.isArray(t)&&t.some((function(e){return Ce({measure:e,properties:n,layout:i})}))}({measures:t,layout:n})}({measures:h,layout:c,model:t,lastReloadTime:d});return f||function(e){var t=e.measures,n=e.layout,i=e.masterItem,r=e.isFirstTime;return!!Array.isArray(t)&&(r||i||t.some((function(e){return function(e){var t=e.measure,n=e.layout;return ke({modifiers:we(t),layout:n})?!t.base:!!t.base}({measure:e,layout:n})})))}({measures:h,layout:c,masterItem:a,isFirstTime:l})?t.getEffectiveProperties().then((function(e){var n=r()(!0,{},e);Se(n);var i=Oe(n);return Ee({model:t}).then((function(r){return Ae({libraryIds:i,model:t}).then((function(i){return f&&function(e){var t=e.properties;xe(t).forEach((function(e){return function(e){var t=e.measure;if(Ce({measure:t,properties:e.properties})){var n=0,i=t.qDef.modifiers;Array.isArray(i)&&i.forEach((function(e){if("object"===he(e)&&!e.disabled){if(n++,"object"!==he(de[e.type]))throw new Error('Modifier "'.concat(e.type,'" is not available'));if(n>1)throw new Error("More than 1 modifier on a measure! (not yet supported)");var i=de[e.type].extractInputExpression({outputExpression:t.qDef.qDef,modifier:e});void 0!==i&&De(t)&&w.simplifyExpression(t.qDef.base.qDef)!==w.simplifyExpression(i)&&(t.qDef.base.qDef=i)}}))}}({measure:e,properties:t})}))}({properties:n}),me({model:t,oldProperties:e,properties:n,runUpdateIfChange:!0,masterItem:a,libraryItemsProps:i,dimensionAndFieldList:r})}))}))})):Promise.resolve(!1)}return function(e){return!!Array.isArray(e)&&e.some((function(e){return"object"===he(e.base)}))}(h)?t.getEffectiveProperties().then((function(e){return function(e){var t=e.model,n=e.properties,i=Oe(n);return Ne({model:t,libraryIds:i}).then((function(){var e=r()(!0,{},n);return xe(n).forEach((function(e){return ge(e)})),Ie({oldProperties:e,newProperties:n,model:t})}))}({model:t,properties:e})})):Promise.resolve(!1)}function me(e){var t=e.model,n=e.oldProperties,i=e.properties,o=e.measures,a=e.runUpdateIfChange,l=void 0!==a&&a,c=e.masterItem,u=e.libraryItemsProps,h=e.dimensionAndFieldList;void 0===n&&(n=l?r()(!0,{},i):i),Se(i);var d=Oe(i);return Ne({model:t,libraryIds:d,masterItem:c}).then((function(){return function(e){var t=e.measures,n=e.properties,i=e.model,o=e.libraryItemsProps,a=e.dimensionAndFieldList;if(t||(t=xe(n)),!t.length)return Promise.resolve();if(!ye({measures:t,properties:n}))return t.forEach((function(e){return ge(e)})),Promise.resolve();var l=o?void 0:Oe(n);return Ee({model:i,dimensionAndFieldList:a}).then((function(e){return Ae({libraryIds:l,model:i,libraryItemsProps:o}).then((function(i){t.forEach((function(t){ke({modifiers:t.qDef.modifiers,properties:n})?(function(e){var t=e.measure,n=e.properties,i=e.libraryItemsProps,o=e.dimensionAndFieldList,a=0;ue.isValid(t)||ue.initBase(t,!0);var l=t.qDef,c=l.modifiers,u=l.base;Array.isArray(c)&&c.forEach((function(e){if("object"===he(e)&&!e.disabled){if(a++,"object"!==he(de[e.type]))throw new Error('Modifier "'.concat(e.type,'" is not available'));if(a>1)throw new Error("More than 1 modifier on a measure! (not yet supported)");de[e.type].initModifier(e);var l=t.qLibraryId||u&&u.qLibraryId;l?function(e){var t=e.measure,n=e.modifier,i=e.properties,o=e.dimensionAndFieldList,s=e.libraryItemsProps[e.libraryId],a=s.qMeasure.qDef,l=de[n.type].generateExpression({expression:a,modifier:n,properties:i,dimensionAndFieldList:o});n.outputExpression=l,t.qDef.qDef=n.outputExpression,(t.qDef.qLabel||s.qMeasure.qLabel)&&(t.qDef.qLabel=s.qMeasure.qLabel),(t.qDef.qLabelExpression||s.qMeasure.qLabelExpression)&&(t.qDef.qLabelExpression=s.qMeasure.qLabelExpression),t.qDef.quarantine&&t.qDef.quarantine.qNumFormat&&s.qMeasure.qNumFormat&&(t.qDef.qNumFormat=s.qMeasure.qNumFormat,t.qDef.isCustomFormatted=s.qMeasure.isCustomFormatted),delete t.qLibraryId,t.qDef.coloring=s.qMeasure.coloring,n.base=r()(!0,{},t.qDef.base)}({measure:t,modifier:e,libraryId:l,properties:n,libraryItemsProps:i,dimensionAndFieldList:o}):function(e){var t=e.measure,n=e.modifier,i=e.properties,o=e.dimensionAndFieldList;"function"==typeof de[n.type].updateModifier&&de[n.type].updateModifier(n,i.qHyperCubeDef);var s=le.getExpression(t),a=de[n.type].generateExpression({expression:s,modifier:n,properties:i,dimensionAndFieldList:o});n.outputExpression=a,t.qDef.qDef=n.outputExpression,t.qDef.base.qLabelExpression?t.qDef.qLabelExpression=t.qDef.base.qLabelExpression:t.qDef.qLabel=t.qDef.base.qLabel||s,n.base=r()(!0,{},t.qDef.base)}({measure:t,modifier:e,properties:n,dimensionAndFieldList:o}),function(e){var t=s(e,"qDef.qAggrFunc");"Expr"!==t||be(e)?"None"!==t?delete e.qDef.base.qAggrFunc:"None"===t&&be(e)&&"Expr"===e.qDef.base.qAggrFunc&&(e.qDef.qAggrFunc="Expr",delete e.qDef.base.qAggrFunc):(e.qDef.qAggrFunc="None",e.qDef.base.qAggrFunc="Expr")}(t)}}))}({measure:t,properties:n,libraryItemsProps:i,dimensionAndFieldList:e}),Me(t)):ge(t)}))}))}))}({measures:o,properties:i,model:t,libraryItemsProps:u,dimensionAndFieldList:h}).then((function(){return l?Ie({oldProperties:n,newProperties:i,model:t}):Promise.resolve(!1)}))}))}function ge(e){!function(e){var t=we(e);return Array.isArray(t)&&t.some((function(e){return"object"===he(e)&&!e.disabled&&!de[e.type]}))}(e)?ue.restoreBase(e):delete e.qDef.base,e.qDef.coloring&&delete e.qDef.coloring,Me(e)}function ye(e){var t=e.measures,n=e.properties,i=e.layout;return!!Array.isArray(t)&&t.some((function(e){return ke({modifiers:we(e),properties:n,layout:i})}))}function ve(e){var t=we(e);if(Array.isArray(t))for(var n=0;n<t.length;n++){var i=t[n];if(de[i.type]&&!i.disabled)return i}}function be(e){var t=ve(e);return!t||de[t.type].enableTotalsFunction(e)}function xe(e){return s(e,"qHyperCubeDef.qMeasures",[]).concat(s(e,"qHyperCubeDef.qLayoutExclude.qHyperCubeDef.qMeasures",[]))}function we(e){return e.modifiers||e.qDef&&e.qDef.modifiers}function qe(e){return s(e,"outputExpression.qValueExpression.qExpr")||s(e,"outputExpression")}function Se(e){xe(e).forEach((function(e){return function(e){var t=ve(e);t&&(void 0!==t.outputExpression&&qe(t)!==e.qDef.qDef?delete e.qDef.base:!ue.isValid(e)&&t.base&&(e.qDef.base=r()(!0,{},t.base)))}(e)}))}function Me(e){var t=we(e);Array.isArray(t)&&t.forEach((function(t){"object"===he(t)&&(t.disabled||!de[t.type]&&qe(t)!==e.qDef.qDef)&&(t.disabled=!0,delete t.base)}))}function De(e){return e.base||e.qDef&&e.qDef.base}function _e(e){var t=De(e);return e.qLibraryId||t&&t.qLibraryId}function Ce(e){var t=e.measure,n=e.properties,i=e.layout;return!_e(t)&&ke({modifiers:we(t),properties:n,layout:i})}function ke(e){var t=e.modifiers,n=e.properties,i=e.layout,r={};return Array.isArray(t)&&t.some((function(e){return!("object"!==he(e)||e.disabled||!de[e.type])&&(void 0===r[e.type]&&(r[e.type]=de[e.type].isApplicable({properties:n,layout:i})),r[e.type])}))}function Ee(e){var t=e.model,n=e.dimensionAndFieldList;if(n)return Promise.resolve(n);var i=[],r={},o=t.app.getDimensionList().then((function(e){r.dimensionList=e}));i.push(o);var s=t.app.getFieldList().then((function(e){r.fieldList=e}));return i.push(s),Promise.all(i).then((function(){return r}))}function Ae(e){var t=e.libraryIds,n=e.model,i=e.libraryItemsProps;if(i)return Promise.resolve(i);var r=t.measureLibraryIds,o=t.dimensionLibraryIds,s={},a=[];return r.forEach((function(e){var t=n.app.getMeasure(e).then((function(t){return t.getProperties().then((function(t){s[e]=t}))}));a.push(t)})),o.forEach((function(e){var t=n.app.getDimension(e).then((function(t){return t.getProperties().then((function(t){s[e]=t}))}));a.push(t)})),Promise.all(a).then((function(){return s}))}function Te(e,t){if(""!==t||-1===["qFmt","qDec","qThou"].indexOf(e))return t}function Ie(e){var t=e.oldProperties,n=e.newProperties,i=e.model,r=JSON.stringify(s(t,"qHyperCubeDef.qMeasures"),Te)!==JSON.stringify(s(n,"qHyperCubeDef.qMeasures"),Te)||JSON.stringify(s(t,"qHyperCubeDef.qLayoutExclude.qHyperCubeDef.qMeasures"),Te)!==JSON.stringify(s(n,"qHyperCubeDef.qLayoutExclude.qHyperCubeDef.qMeasures"),Te);return r?function(e){var t=e.model,n=e.oldProperties,i=e.newProperties,r=t.layout;return r&&!r.qHasSoftPatches&&!r.qExtendsId&&s(r,"qMeta.privileges",[]).indexOf("update")>-1?t.setProperties(i):I(t,n,i)}({model:i,oldProperties:t,newProperties:n}).then((function(){return r})):Promise.resolve(r)}function Re(e){var t=e.modifiers,n=e.properties,i=e.layout;return Array.isArray(t)&&t.some((function(e){return"object"===he(e)&&!e.disabled&&de[e.type]&&de[e.type].needDimension({modifier:e,properties:n,layout:i})}))}function Oe(e){var t=xe(e),n=[],i=[],r=!1;return t.forEach((function(t){var i=we(t);if(ke({modifiers:i,properties:e})){var o=_e(t);o&&n.push(o),r=r||Re({modifiers:i,properties:e})}})),s(e,"qHyperCubeDef.qDimensions",[]).forEach((function(e){var t=e.qLibraryId;t&&i.push(t)})),{measureLibraryIds:n,dimensionLibraryIds:i}}function Ne(e){var t=e.model,n=e.libraryIds;return!e.masterItem&&n&&(n.measureLibraryIds.length||n.dimensionLibraryIds.length)?(fe[t.id].masterItemSubscriber=fe[t.id].masterItemSubscriber||function(e){var t=e.model,n=e.callback,i={},r={},o={},a={dimension:["qDim.qFieldDefs"],measure:["qMeasure.qDef","qMeasure.qLabel","qMeasure.qLabelExpression","qMeasure.coloring","qMeasure.qNumFormat","qMeasure.isCustomFormatted"]};function l(e){var t={},n=s(e,"qInfo.qType");return n&&a[n]&&a[n].forEach((function(n){t[n]=s(e,n)})),JSON.stringify(t)}function c(e){var t=e.qInfo.qId;if(i[t]){var r=l(e);i[t].properties!==r&&(i[t].properties=r,"function"==typeof n&&i[t].enabled&&n(e)),i[t].enabled=!0}}function u(e,n){return t.app[n](e).then((function(t){i[e]={listener:t.layoutSubscribe(c),enabled:!1,properties:l(t.layout)}}))}return{subscribe:function(e){var n=e.measureLibraryIds,s=e.dimensionLibraryIds,a=[];return function(e){var t=e.dimensionLibraryIds;r={},e.measureLibraryIds.forEach((function(e){r[e]=!0})),o={},t.forEach((function(e){o[e]=!0}))}({measureLibraryIds:n,dimensionLibraryIds:s}),Object.keys(i).forEach((function(e){r[e]||o[e]||(i[e].listener.dispose(),delete i[e])})),t.app&&(Object.keys(r).forEach((function(e){r[e]&&!i[e]&&a.push(u(e,"getMeasure"))})),Object.keys(o).forEach((function(e){o[e]&&!i[e]&&a.push(u(e,"getDimension"))}))),Promise.all(a)},unsubscribe:function(){Object.keys(i).forEach((function(e){i[e].listener.dispose()})),i={}}}}({model:t,callback:function(e){return pe({model:t,masterItem:e}).then((function(){return t.app.clearUndoBuffer()}))}}),fe[t.id].masterItemSubscriber.subscribe(n)):Promise.resolve()}}])},function(e,t,n){function i(e){var t=function e(t){var n,i=t;return i>9?(n=65+i-10)>90&&(n+=6):i="".concat(i).charCodeAt(0),[48,111,79,105,73,108].indexOf(n)>-1?e(i+1):String.fromCharCode(n)}(e%62),n=Math.floor(e/62);return n>0?i(n)+t:t}function r(e){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}n.r(t);var o={getValue:function(e,t,n){if(null==e||null==t)return n;for(var i=t.split("."),r=e,o=0;o<i.length;++o){var s=i[o];if(""!==s){if(void 0===r[s]||null===r[s])return n;r=r[s]}}return r},setValue:function(e,t,n){if(null!=e&&null!=t){for(var i=t.split("."),r=i[i.length-1],o=e,s=0;s<i.length-1;++s){var a=i[s];void 0!==o[a]&&null!==o[a]||(o[a]=Number.isNaN(+i[s+1])?{}:[]),o=o[a]}void 0!==n?o[r]=n:delete o[r]}},isEmpty:function(e){return 0===Object.keys(e).length&&e.constructor===Object},isAtomicValue:function(e){return/boolean|number|string/.test(r(e))},generateId:function(){return i(Math.round(99e11*Math.random()+1e11)).replace(/\W/g,"")}};function s(e){return function(e){if(Array.isArray(e))return a(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(e){if("string"==typeof e)return a(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?a(e,t):void 0}}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function a(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,i=new Array(t);n<t;n++)i[n]=e[n];return i}function l(e){return function(e){if(Array.isArray(e))return c(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(e){if("string"==typeof e)return c(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?c(e,t):void 0}}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function c(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,i=new Array(t);n<t;n++)i[n]=e[n];return i}function u(e,t,n){if(e){for(var i=0;i<e.length;i++)if(e[i][t]===n)return i;return-1}return-1}var h={isOrderedSubset:function(e,t){if(!(e&&t&&e.length&&t.length))return!1;var n=e.indexOf(t[0]);if(-1!==n){for(var i=0;i<t.length;i++){var r=e.indexOf(t[i]);if(n>r)return!1;n=r}return!0}return!1},indexAdded:function(e,t){var n;for(n=0;n<e.length;++n)e[n]>=0&&e[n]>=t&&++e[n];e.push(t)},indexRemoved:function(e,t){var n,i=0;for(n=0;n<e.length;++n)e[n]>t?--e[n]:e[n]===t&&(i=n);return e.splice(i,1),i},findItemByPropertyValue:function(e,t,n){if(e){for(var i=0;i<e.length;i++)if(e[i][t]===n)return e[i];return null}return null},findIndexByPropertyValue:u},d=n(1),f=n.n(d),p={addDimensions:function(e){var t,n=e.exportFormat,i=e.qHyperCubeDef,r=n.data[0];(t=r.dimensions).push.apply(t,s(i.qDimensions));var a,l=o.getValue(i,"qLayoutExclude.qHyperCubeDef.qDimensions");l&&(a=r.excludedDimensions).push.apply(a,s(l))},addMeasures:function(e){var t,n=e.exportFormat,i=e.qHyperCubeDef,r=n.data[0];(t=r.measures).push.apply(t,l(i.qMeasures));var s,a=o.getValue(i,"qLayoutExclude.qHyperCubeDef.qMeasures");a&&(s=r.excludedMeasures).push.apply(s,l(a))},setInterColumnSortOrder:function(e){var t=e.exportFormat,n=e.qHyperCubeDef,i=t.data[0];n.qInterColumnSortOrder||(n.qInterColumnSortOrder=[]),i.interColumnSortOrder=n.qInterColumnSortOrder.concat();var r=o.getValue(n,"qLayoutExclude.qHyperCubeDef.qInterColumnSortOrder");r&&h.isOrderedSubset(r,i.interColumnSortOrder)&&(i.interColumnSortOrder=r.concat())},copyProperties:function(e){var t=e.exportFormat,n=e.properties;Object.keys(n).forEach((function(e){t.properties[e]=n[e]}))},updateLayoutExclude:function(e){var t=e.exportFormat,n=e.properties;n.qLayoutExclude||(n.qLayoutExclude={}),n.qLayoutExclude.disabled&&(Object.keys(n.qLayoutExclude.disabled).forEach((function(e){t.properties.hasOwnProperty(e)||(t.properties[e]=n.qLayoutExclude.disabled[e])})),delete n.qLayoutExclude.disabled),n.qLayoutExclude.changed&&(function(e){Object.keys(e.qLayoutExclude.changed).forEach((function(t){e.qLayoutExclude.changed[t].to===o.getValue(e,t)&&o.setValue(e,t,e.qLayoutExclude.changed[t].from)}))}(n),delete n.qLayoutExclude.changed),n.qLayoutExclude.quarantine&&!o.isEmpty(n.qLayoutExclude.quarantine)||delete n.qLayoutExclude},storeMeasuresModifiers:function(e){e.forEach((function(e){f.a.cleanUpMeasure(e),e.qDef.modifiers&&(e.store={modifiers:e.qDef.modifiers},delete e.qDef.modifiers)}))}};function m(e,t,n){var i,r,s=o.getValue(e,t);if(!o.isAtomicValue(s))try{if((r=(r=(i=JSON.stringify(s)).match(/:\{/g))?r.length:0)>2)return;s=JSON.parse(i)}catch(e){return}o.getValue(e,"qLayoutExclude.quarantine")||o.setValue(e,"qLayoutExclude.quarantine",{});var a=o.getValue(e,"qLayoutExclude.quarantine");a[n]||(a[n]={}),a[n][t]=s}var g=n(0),y=n.n(g);function v(e,t){var n=y()(!0,{},t,e);return o.getValue(n,"qOtherTotalSpec.qOtherCounted")||o.setValue(n,"qOtherTotalSpec.qOtherCounted",{qv:"10"}),o.getValue(n,"qOtherTotalSpec.qOtherLimit")||o.setValue(n,"qOtherTotalSpec.qOtherLimit",{qv:"0"}),n.hasOwnProperty("othersLabel")||(n.othersLabel="Others"),n}function b(e,t){return y()(!0,{},t,e)}function x(e,t,n){return"function"==typeof e?e(t):Number.isNaN(+e)?n:e}var w=Math.pow(2,53)-1;function q(e){return function(e){if(Array.isArray(e))return S(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(e){if("string"==typeof e)return S(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?S(e,t):void 0}}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function S(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,i=new Array(t);n<t;n++)i[n]=e[n];return i}function M(e){return function(e){if(Array.isArray(e))return D(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(e){if("string"==typeof e)return D(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?D(e,t):void 0}}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function D(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,i=new Array(t);n<t;n++)i[n]=e[n];return i}var _={importCommonProperties:function(e,t,n){var i="masterobject"===o.getValue(t,"properties.qInfo.qType")?"masterobject":o.getValue(n,"qInfo.qType");o.setValue(e,"qInfo.qType",i),e.visualization=n.visualization},copyPropertyIfExist:function(e,t,n){t.hasOwnProperty(e)&&(n[e]=t[e])},copyPropertyOrSetDefault:function(e,t,n,i){t.hasOwnProperty(e)?n[e]=t[e]:n[e]=i},getDefaultDimension:function(){return{qDef:{autoSort:!0,cId:"",othersLabel:"Others"},qLibraryId:"",qNullSuppression:!1,qOtherLabel:"Others",qOtherTotalSpec:{qOtherLimitMode:"OTHER_GE_LIMIT",qOtherMode:"OTHER_OFF",qOtherSortMode:"OTHER_SORT_DESCENDING",qSuppressOther:!1}}},getDefaultMeasure:function(){return{qDef:{autoSort:!0,cId:"",numFormatFromTemplate:!0},qLibraryId:"",qTrendLines:[]}},addDimensions:function(e){var t,n=e.exportFormat,i=e.maxDimensions,r=e.minDimensions,o=e.newHyperCubeDef,s=e.defaultDimension,a=n.data[0];for(t=0;t<a.dimensions.length;++t){var l=v(a.dimensions[t],s);o.qDimensions.length<i?o.qDimensions.push(l):o.qLayoutExclude.qHyperCubeDef.qDimensions.push(l)}for(t=0;t<a.excludedDimensions.length;++t){var c=v(a.excludedDimensions[t],s);o.qDimensions.length<r?o.qDimensions.push(c):o.qLayoutExclude.qHyperCubeDef.qDimensions.push(c)}},addMeasures:function(e){var t,n=e.exportFormat,i=e.maxMeasures,r=e.minMeasures,o=e.newHyperCubeDef,s=e.defaultMeasure,a=n.data[0];for(t=0;t<a.measures.length;++t){var l=b(a.measures[t],s);o.qMeasures.length<i?o.qMeasures.push(l):o.qLayoutExclude.qHyperCubeDef.qMeasures.push(l)}for(t=0;t<a.excludedMeasures.length;++t){var c=b(a.excludedMeasures[t],s);o.qMeasures.length<r?o.qMeasures.push(c):o.qLayoutExclude.qHyperCubeDef.qMeasures.push(c)}},getMaxMinDimensionMeasure:function(e){var t=e.exportFormat,n=e.dataDefinition,i=void 0===n?{}:n,r=t.data[0],o=i.dimensions||{max:0},s=i.measures||{max:0},a=x(s.max,r.dimensions.length,w),l=x(s.min,r.dimensions.length,0);return{maxDimensions:x(o.max,a,w),minDimensions:x(o.min,l,0),maxMeasures:a,minMeasures:l}},setInterColumnSortOrder:function(e){var t=e.exportFormat,n=e.newHyperCubeDef,i=t.data[0],r=n.qDimensions.length+n.qMeasures.length;n.qInterColumnSortOrder=i.interColumnSortOrder.concat();var o=n.qInterColumnSortOrder.length;if(o!==r)for(n.qLayoutExclude&&(n.qLayoutExclude.qHyperCubeDef.qInterColumnSortOrder=i.interColumnSortOrder.concat());o!==r;)o<r?(h.indexAdded(n.qInterColumnSortOrder,o),++o):(--o,h.indexRemoved(n.qInterColumnSortOrder,o))},createNewProperties:function(e){var t=e.exportFormat,n=e.initialProperties,i=e.hypercubePath,r={qLayoutExclude:{disabled:{},quarantine:{}}};return Object.keys(t.properties).forEach((function(e){"qLayoutExclude"===e?t.properties[e].quarantine&&(r.qLayoutExclude.quarantine=y()(!0,{},t.properties[e].quarantine)):"qHyperCubeDef"===e&&i?o.setValue(r,"".concat(i,".qHyperCubeDef"),t.properties.qHyperCubeDef):n.hasOwnProperty(e)||-1!==["qMetaDef","descriptionExpression","labelExpression"].indexOf(e)||function(e,t){return"components"===t&&Array.isArray(e[t])&&e[t].some((function(e){return"general"===e.key}))}(t.properties,e)?r[e]=t.properties[e]:r.qLayoutExclude.disabled[e]=t.properties[e]})),null===(r=y()(!0,{},n,r)).components&&(r.components=[]),r},shouldInitLayoutExclude:function(e){var t=e.exportFormat,n=e.maxDimensions,i=e.minDimensions,r=e.maxMeasures,o=e.minMeasures,s=t.data[0];return s.dimensions.length>n&&n>0||s.measures.length>r&&r>0||s.excludedDimensions.length>0&&s.dimensions.length+s.excludedDimensions.length>i||s.excludedMeasures.length>0&&s.measures.length+s.excludedMeasures.length>o||!r&&s.measures.length>0||!n&&s.dimensions.length>0},initLayoutExclude:function(e){var t=e.exportFormat,n=e.maxDimensions,i=e.minDimensions,r=e.maxMeasures,o=e.minMeasures,s=e.newHyperCubeDef,a=t.data[0];s.qLayoutExclude||(s.qLayoutExclude={}),s.qLayoutExclude.qHyperCubeDef||(s.qLayoutExclude.qHyperCubeDef={}),(a.dimensions.length>n&&n>0||a.excludedDimensions&&a.excludedDimensions.length&&a.dimensions.length+a.excludedDimensions.length>i)&&(s.qLayoutExclude.qHyperCubeDef.qDimensions||(s.qLayoutExclude.qHyperCubeDef.qDimensions=[])),(a.measures.length>r&&r>0||a.excludedMeasures&&a.excludedMeasures.length&&a.measures.length+a.excludedMeasures.length>o)&&(s.qLayoutExclude.qHyperCubeDef.qMeasures||(s.qLayoutExclude.qHyperCubeDef.qMeasures=[])),!r&&a.measures.length&&(s.qLayoutExclude.qHyperCubeDef.qMeasures||(s.qLayoutExclude.qHyperCubeDef.qMeasures=[])),!n&&a.dimensions.length&&(s.qLayoutExclude.qHyperCubeDef.qDimensions||(s.qLayoutExclude.qHyperCubeDef.qDimensions=[]))},updateDimensionsOnAdded:function(e){var t=e.newProperties,n=e.dataDefinition,i=e.hypercubePath;if(n.dimensions&&"function"==typeof n.dimensions.added){var r=o.getValue(t,i||"").qHyperCubeDef,s=q(r.qDimensions);r.qDimensions=[],s.forEach((function(e){r.qDimensions.push(e),n.dimensions.added(e,t)}))}},updateMeasuresOnAdded:function(e){var t=e.newProperties,n=e.dataDefinition,i=e.hypercubePath;if(n.measures&&"function"==typeof n.measures.added){var r=o.getValue(t,i||"").qHyperCubeDef,s=M(r.qMeasures);r.qMeasures=[],s.forEach((function(e){r.qMeasures.push(e),n.measures.added(e,t)}))}},restoreMeasuresModifiers:function(e){var t=e.measures,n=e.modifierTypes;t&&n&&f.a.isSupportedModifiers(n)&&t.forEach((function(e){e.store&&e.store.modifiers&&(e.qDef.modifiers=e.store.modifiers),delete e.store}))}};function C(e,t){var n=o.getValue(e,"qLayoutExclude.quarantine",{})[t];return!!n&&(Object.keys(n).forEach((function(t){o.setValue(e,t,n[t])})),delete e.qLayoutExclude.quarantine[t],!0)}var k={exportProperties:function(e){var t=e.propertyTree,n=e.hypercubePath,i=e.viewDataMode,r=function(){for(var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1,t={data:[],properties:{}},n=0;n<e;++n)t.data.push({dimensions:[],measures:[],excludedDimensions:[],excludedMeasures:[],interColumnSortOrder:[]});return t}(),s=t.qProperty,a=o.getValue(s,n||""),l=a.qHyperCubeDef;return l.qInterColumnSortOrder||(l.qInterColumnSortOrder=[]),p.addDimensions({exportFormat:r,qHyperCubeDef:l}),p.addMeasures({exportFormat:r,qHyperCubeDef:l}),p.setInterColumnSortOrder({exportFormat:r,qHyperCubeDef:l}),delete l.qLayoutExclude,p.copyProperties({exportFormat:r,properties:s}),n&&(r.properties.qHyperCubeDef=l,delete a.qHyperCubeDef),p.updateLayoutExclude({exportFormat:r,properties:s}),i||p.storeMeasuresModifiers(r.properties.qHyperCubeDef.qMeasures),Array.isArray(r.properties.filters)&&(m(r.properties,"filters","storedFilters"),delete r.properties.filters),r.properties.qHyperCubeDef.qContextSetExpression&&(m(r.properties,"qHyperCubeDef.qContextSetExpression","storedFilters"),r.properties.qHyperCubeDef.qContextSetExpression=""),r.properties.qHyperCubeDef.qDynamicScript&&r.properties.qHyperCubeDef.qDynamicScript.length&&(m(r.properties,"qHyperCubeDef.qDynamicScript","dynamicScript"),r.properties.qHyperCubeDef.qDynamicScript=[]),r},importProperties:function(e){var t=e.exportFormat,n=e.initialProperties,i=void 0===n?{}:n,r=e.dataDefinition,s=void 0===r?{}:r,a=e.defaultPropertyValues,l=void 0===a?{}:a,c=e.hypercubePath,u=e.extension,h=e.supportedFilters,d=void 0===h||h,f=e.isHCModifierSupported,p=void 0===f||f,m={qChildren:[]},g=_.createNewProperties({exportFormat:t,initialProperties:i,hypercubePath:c}),y=o.getValue(i,c||"").qHyperCubeDef,v=o.getValue(g,c||"").qHyperCubeDef,b=_.getMaxMinDimensionMeasure({exportFormat:t,dataDefinition:s}),x=b.maxDimensions,w=b.minDimensions,q=b.maxMeasures,S=b.minMeasures,M=l.defaultDimension,D=void 0===M?_.getDefaultDimension():M,k=l.defaultMeasure,E=void 0===k?_.getDefaultMeasure():k;v.qDimensions.length=0,v.qMeasures.length=0,_.shouldInitLayoutExclude({exportFormat:t,maxDimensions:x,minDimensions:w,maxMeasures:q,minMeasures:S})&&_.initLayoutExclude({exportFormat:t,maxDimensions:x,minDimensions:w,maxMeasures:q,minMeasures:S,newHyperCubeDef:v}),_.addDimensions({exportFormat:t,maxDimensions:x,minDimensions:w,newHyperCubeDef:v,defaultDimension:D}),_.addMeasures({exportFormat:t,maxMeasures:q,minMeasures:S,newHyperCubeDef:v,defaultMeasure:E}),_.updateDimensionsOnAdded({newProperties:g,dataDefinition:s,hypercubePath:c}),_.updateMeasuresOnAdded({newProperties:g,dataDefinition:s,hypercubePath:c}),_.setInterColumnSortOrder({exportFormat:t,newHyperCubeDef:v}),_.copyPropertyIfExist("qMaxStackedCells",y,v),_.copyPropertyIfExist("qNoOfLeftDims",y,v),_.copyPropertyOrSetDefault("qInitialDataFetch",y,v,[{qTop:0,qLeft:0,qWidth:0,qHeight:0}]),_.copyPropertyOrSetDefault("qMode",y,v,"S"),_.copyPropertyOrSetDefault("qReductionMode",y,v,"N"),_.copyPropertyOrSetDefault("qSortbyYValue",y,v),_.copyPropertyOrSetDefault("qIndentMode",y,v),_.copyPropertyOrSetDefault("qShowTotalsAbove",y,v),_.importCommonProperties(g,t,i),m.qProperty=g;var A=o.getValue(u||{},"support.modifiers");return _.restoreMeasuresModifiers({measures:v.qMeasures,modifierTypes:A}),d&&C(m.qProperty,"storedFilters"),"S"===v.qMode&&p&&C(m.qProperty,"dynamicScript"),m}},E={cellBackgroundColor:!0,cellForegroundColor:!0,colorByAlternative:!0,colorByExpression:!0,tooltip:!0,urlLabel:!0,url:!0};function A(e,t,n,i){t=t||[];var r=u(e,i,n),o=u(t,i,n);if(-1!==r&&-1===o){var s=e.splice(r,1);t.push(s[0])}return t}function T(e,t){return e.length!==t}var I={create:function(e,t){if(!e||!E[e])throw new Error("Attribute Expressions Util: ID required");var n={};return t&&Object.keys(t).forEach((function(e){n[e]=t[e]})),n.id=e,n.qAttribute=!0,n},moveByIdFromGroup:function(e,t,n,i,r){n=n||"qAttributeExpressions",r=r||"id";for(var o=0;o<e.length;o++){var s=e[o][n],a=t.length;if(A(s,t,i,r),T(t,a))return t}return t},IDMAP:{CELL_BACKGROUND_COLOR:"cellBackgroundColor",CELL_FOREGROUND_COLOR:"cellForegroundColor",COLOR_BY_ALTERNATIVE:"colorByAlternative",COLOR_BY_EXPRESSION:"colorByExpression",TOOLTIP:"tooltip",CELL_LINK_LABEL:"urlLabel",CELL_LINK_URL:"url"}},R={getNumDimensions:function(e){return o.getValue(e,"qHyperCubeDef.qDimensions.length",0)},getNumMeasures:function(e){return o.getValue(e,"qHyperCubeDef.qMeasures.length",0)},wrapFieldName:function(e){return e.split(" ").length>1&&"="!==e[0]&&"["!==e[0]?"[".concat(e,"]"):e},getItemLabel:function(e){return e.label||e.name}},O={colorModeOptions:{primary:function(){return!0},dimension:function(e){return R.getNumDimensions(e)>0&&R.getNumMeasures(e)<=1},multiColor:function(e){return R.getNumMeasures(e)>1},measure:function(e){return R.getNumDimensions(e)>0},expression:function(e){return R.getNumMeasures(e)>=1}}},N={colorModeOptions:{primary:function(){return!0},dimension:function(){return!0},multiColor:function(){return!1},measure:function(){return!0},expression:function(e){return R.getNumMeasures(e)>=1}}},P={scatterplot:N,"sn-scatter-plot":N,piechart:{colorModeOptions:{primary:function(){return!0},dimension:function(){return!0},multiColor:function(){return!1},measure:function(){return!0},expression:function(e){return R.getNumMeasures(e)>=1}}},linechart:{colorModeOptions:{primary:function(){return!0},dimension:function(e){return R.getNumDimensions(e)>1},multiColor:function(e){return R.getNumMeasures(e)>1},measure:function(e){return R.getNumDimensions(e)<=1},expression:function(e){return R.getNumMeasures(e)>=1}}},map:{colorModeOptions:{primary:function(){return!0},dimension:function(e){return R.getNumDimensions(e)>=1},multiColor:function(e){return R.getNumMeasures(e)>1},measure:function(e){return R.getNumDimensions(e)>=1},expression:function(e){return R.getNumDimensions(e)>=1}}},distributionplot:{colorModeOptions:{primary:function(){return!0},dimension:function(){return!0},multiColor:function(){return!1},measure:function(){return!0},expression:function(e){return R.getNumDimensions(e)>=1}}}};function L(e,t,n){if(Array.isArray(e[t])){var i=h.findIndexByPropertyValue(e[t],"id",n);i>=0&&e[t].splice(i,1)}else e[t]=[]}function F(e,t){var n=I.IDMAP.COLOR_BY_ALTERNATIVE;e.forEach((function(e){L(e,"qAttributeDimensions",n),L(e,"qAttributeExpressions",n)})),t.forEach((function(e){L(e,"qAttributeDimensions",n),L(e,"qAttributeExpressions",n)}))}function z(e,t){if(t){var n="="===t.charAt(0);e.color.altLabel=n?{qStringExpression:{qExpr:t.substr(1)}}:t}}function j(e){var t=e.properties,n=e.isDimension,i=e.dimensions,r=e.excludedDimensions,s=e.measures,a=e.label;F(i,r);var l=i[i.length-1];if(l){var c=n?o.getValue(t,"color.byDimDef"):o.getValue(t,"color.byMeasureDef"),u=o.getValue(t,"color.formatting.qNumFormat"),d=o.getValue(t,"color.formatting.isCustomFormatted");if(c){var f=I.create(I.IDMAP.COLOR_BY_ALTERNATIVE);switch(c.type){case"expression":!function(e){var t=e.attributeExpression,n=e.label,i=e.item,r=e.isDimension,o=e.qNumFormat,s=e.isCustomFormatted;t.label=n||i.label,r?t.qDef=i.key:(t.qExpression=i.key,o&&(t.qNumFormat=o,t.isCustomFormatted=s)),t.matchMeasure=i.activeMeasureIndex,t.label&&"="===t.label.charAt(0)&&(t.labelExpRef="color.altLabel")}({attributeExpression:f,label:a,item:c,isDimension:n,qNumFormat:u,isCustomFormatted:d});break;case"libraryItem":!function(e){var t=e.attributeExpression,n=e.measures,i=e.item,r=e.isDimension,o=e.qNumFormat,s=e.isCustomFormatted;r||(t.matchMeasure=h.findIndexByPropertyValue(n,"qLibraryId",i.key),o&&(t.qNumFormat=o,t.isCustomFormatted=s)),void 0!==i.expression?t.qExpression=i.expression:t.qLibraryId=i.key,t.colorMapRef=i.key}({attributeExpression:f,measures:s,item:c,isDimension:n,qNumFormat:u,isCustomFormatted:d})}n?(f.qSortBy={qSortByAscii:1},l.qAttributeDimensions.push(f)):l.qAttributeExpressions.push(f)}}}function H(e,t,n,i){var r,o,s,a={};switch(e){case"dimension":n.qLibraryId?(a.type="dimension",a.name=n.qLibraryId,a.id=n.qLibraryId):(a.type="field",t?(a.name=n.label||n.qDef,a.id=n.qDef):(a.name=n.qDef.qFieldDefs[0],a.label=(s=n.qDef).qLabelExpression?s.qLabelExpression:s.qFieldLabels&&s.qFieldLabels[0]?s.qFieldLabels[0]:s.qFieldDefs[0]));break;case"measure":(r=function(e,t){return t?e.qLibraryId:f.a.measureBase.getLibraryId(e)}(n,t))?(a.type="measure",a.name=r,a.id=r,(o=function(e,t){return f.a.hasActiveModifiers({measures:[e]})&&t?e.qDef.qDef:void 0}(n,i))&&(a.expression=o)):(a.type="expression",t?(a.name=n.label||n.qExpression,a.id=n.qExpression):(a.name=n.qDef.qDef,a.label=function(e){var t=e.qDef;return t.qLabelExpression?t.qLabelExpression:t.qLabel?t.qLabel:t.qDef}(n)));break;default:throw new Error('columnType should be "dimension" or "measure"')}return a}var B={useMasterNumberFormat:function(e){e.quarantine={qNumFormat:e.qNumFormat||{},isCustomFormatted:e.isCustomFormatted||!1},e.qNumFormat=null,e.isCustomFormatted=void 0}};function V(e,t,n,i){var r=n?"expression":t.type,o=e.color,s=o.mode,a=R.getItemLabel(t);switch(z(e,a||""),r){case"field":s="byDimension",o.byDimDef={label:t.label||R.wrapFieldName(t.name),key:R.wrapFieldName(t.name),type:"expression",activeDimensionIndex:t.activeDimensionIndex};break;case"expression":s="byMeasure",o.byMeasureDef={label:n||a,key:n||t.name,type:"expression",activeMeasureIndex:t.activeMeasureIndex};break;case"dimension":s="byDimension",o.byDimDef={label:t.name,key:t.id,type:"libraryItem",activeDimensionIndex:t.activeDimensionIndex};break;case"measure":s="byMeasure",o.byMeasureDef={label:t.name,key:t.id,expression:t.expression,type:"libraryItem",activeMeasureIndex:t.activeMeasureIndex},o.formatting&&B.useMasterNumberFormat(o.formatting)}i||(o.auto=!1,o.mode=s)}function $(e,t){var n=o.getValue(e,"".concat(t,"qDimensions"),[]),i=n[function(e,t,n){var i=o.getValue(t,"visualization"),r=n.split("."),s=Number(r[1]),a=o.getValue(t,"layers.".concat(s,".type"));return 2===e.length&&"map"===i&&"point"===a}(n,e,t)?0:n.length-1],r=I.IDMAP.COLOR_BY_ALTERNATIVE,s=h.findItemByPropertyValue(i.qAttributeDimensions,"id",r);return V(e,H("dimension",!!s,s||i)),!!s}function W(e,t){var n=o.getValue(e,"".concat(t,"qDimensions"),[]),i=o.getValue(e,"".concat(t,"qMeasures"),[]),r=o.getValue(e,"".concat(t,"qLayoutExclude.qHyperCubeDef.qDimensions"),[]),s=o.getValue(e,"color.byDimDef");if(s&&z(e,s.label),function(e){return!!(e&&e.activeDimensionIndex>-1)}(s))!function(e,t){var n=o.getValue(e,"".concat(t,"qDimensions"),[]),i=o.getValue(e,"color.byDimDef");i.activeDimensionIndex=Math.min(i.activeDimensionIndex,n.length-1);var r=H("dimension",!1,n[i.activeDimensionIndex]);r.activeDimensionIndex=i.activeDimensionIndex,V(e,r)}(e,t);else if(function(e){return!e||!e.key}(s)&&$(e,t))return;j({properties:e,isDimension:!0,dimensions:n,excludedDimensions:r,measures:i,label:o.getValue(e,"color.byDimDef.label")})}function U(e,t){var n=o.getValue(e,"".concat(t,"qDimensions"),[]),i=o.getValue(e,"".concat(t,"qMeasures"),[]),r=o.getValue(e,"".concat(t,"qLayoutExclude.qHyperCubeDef.qDimensions"),[]),s=o.getValue(e,"color.byMeasureDef");if(s&&z(e,s.label),function(e){return!!(e&&e.activeMeasureIndex>-1)}(s))!function(e,t){var n=o.getValue(e,"".concat(t,"qMeasures"),[]),i=o.getValue(e,"color.byMeasureDef");if(i.activeMeasureIndex=Math.min(i.activeMeasureIndex,n.length-1),i.activeMeasureIndex>-1){var r=H("measure",!1,n[i.activeMeasureIndex],!0);r.activeMeasureIndex=i.activeMeasureIndex,V(e,r)}}(e,t);else if(function(e,t){return(!e||!e.key)&&t.length>0}(s,i)&&function(e,t){var n=o.getValue(e,"".concat(t,"qDimensions"),[]),i=o.getValue(e,"".concat(t,"qMeasures"),[]),r=n[n.length-1],s=I.IDMAP.COLOR_BY_ALTERNATIVE,a=h.findItemByPropertyValue(r.qAttributeExpressions,"id",s);return V(e,H("measure",!!a,a||i[0])),!!a}(e,t))return;j({properties:e,isDimension:!1,dimensions:n,excludedDimensions:r,measures:i,label:o.getValue(e,"color.byMeasureDef.label")})}var Y={changeProperty:function(e,t,n){o.setValue(e,t,n),o.isAtomicValue(n)&&function(e,t,n){var i=e.qLayoutExclude;i&&(i.changed||(i.changed={}),i.changed[t]={from:o.getValue(e,t),to:n})}(e,t,n)},getCanColorBy:function(e,t){var n={primary:!0};if(e){var i=(P[t]||O).colorModeOptions||O.colorModeOptions;n.byDimension=i.dimension(e),n.byMeasure=i.measure(e),n.byMultiple=i.multiColor(e),n.byExpression=i.expression(e)}return n},shouldUpdateColorBy:function(e){var t=e.canColorBy,n=e.autoColor,i=e.colorMode,r=e.dimensions;return!(t[i]&&!n&&("byDimension"!==i&&"byMeasure"!==i||!r.length))},updateColorBy:function(e,t){var n=o.getValue(e,"color.mode"),i=o.getValue(e,"color.auto"),r=o.getValue(e,"".concat(t,"qDimensions"),[]),s=o.getValue(e,"".concat(t,"qMeasures"),[]),a=o.getValue(e,"".concat(t,"qLayoutExclude.qHyperCubeDef.qDimensions"),[]);i?F(r,a):function(e){var t=e.auto,n=e.colorMode,i=e.dimensions;return!t&&"byDimension"===n&&i.length>0}({auto:i,colorMode:n,dimensions:r})?W(e,t):function(e){var t=e.auto,n=e.colorMode,i=e.dimensions,r=e.measures,s=e.properties,a=o.getValue(s,"visualization");return!(t||"byMeasure"!==n||!i.length||"map"!==a&&!r.length)}({auto:i,colorMode:n,dimensions:r,measures:s,properties:e})?U(e,t):function(e,t){var n=o.getValue(e,"color.mode"),i=o.getValue(e,"".concat(t,"qDimensions"),[]),r=o.getValue(e,"".concat(t,"qMeasures"),[]),s=o.getValue(e,"".concat(t,"qLayoutExclude.qHyperCubeDef.qDimensions"),[]);"byMultiple"===n&&r.length<2&&o.setValue(e,"color.mode","primary"),F(i,s)}(e,t)},deleteTotalMode:function(e){e.forEach((function(e){e.qOtherTotalSpec&&"qTotalMode"in e.qOtherTotalSpec&&delete e.qOtherTotalSpec.qTotalMode}))},shouldAddColorByExpression:function(e){var t=e.shouldUpdateColorBy,n=e.properties,i=o.getValue(n,"qHyperCubeDef.qMeasures",[]),r=o.getValue(n,"color.mode","");return!t&&"byExpression"===r&&i.length>0},addColorByExpression:function(e){var t=o.getValue(e,"qHyperCubeDef.qMeasures.0.qAttributeExpressions",[]),n=o.getValue(e,"color.colorExpression","");t.splice(0,0,{qExpression:n,id:"colorByExpression"}),o.setValue(e,"qHyperCubeDef.qMeasures.0.qAttributeExpressions",t)},switchToAutoColor:function(e){o.setValue(e,"color.mode","primary"),o.setValue(e,"color.auto",!0)},shouldSwitchToColorPersistent:function(e){var t=o.getValue(e,"qHyperCubeDef.qDimensions",[]),n=o.getValue(e,"color.persistent",!1);return t.length>1&&!n}},X={exportProperties:function(e){var t=e.propertyTree,n=e.hypercubePath,i=e.viewDataMode,r=k.exportProperties({propertyTree:t,hypercubePath:n,viewDataMode:i}),o=r.data[0],s=o.dimensions.concat(o.excludedDimensions),a=o.measures.concat(o.excludedMeasures),l=I.IDMAP,c=l.COLOR_BY_ALTERNATIVE,u=l.COLOR_BY_EXPRESSION;return I.moveByIdFromGroup(s,[],"qAttributeDimensions",c),I.moveByIdFromGroup(s,[],"qAttributeExpressions",c),I.moveByIdFromGroup(a,[],"qAttributeExpressions",u),r},importProperties:function(e){var t=e.exportFormat,n=e.initialProperties,i=e.dataDefinition,r=e.defaultPropertyValues,s=e.hypercubePath,a=e.extension,l=e.supportedFilters,c=e.isHCModifierSupported,u=k.importProperties({exportFormat:t,initialProperties:n,dataDefinition:i,defaultPropertyValues:r,hypercubePath:s,extension:a,supportedFilters:l,isHCModifierSupported:c}),h=u.qProperty,d=o.getValue(h,"visualization"),f=o.getValue(h,"qHyperCubeDef.qDimensions",[]),p=o.getValue(h,"color.mode",""),m=o.getValue(h,"color.auto",""),g=Y.getCanColorBy(h,d),y=Y.shouldUpdateColorBy({canColorBy:g,autoColor:m,colorMode:p,dimensions:f});return g[p]?Y.shouldAddColorByExpression({shouldUpdateColorBy:y,properties:h})&&Y.addColorByExpression(h):Y.switchToAutoColor(h),y&&Y.updateColorBy(h,"qHyperCubeDef."),Y.shouldSwitchToColorPersistent(h)&&Y.changeProperty(h,"color.persistent",!0),Y.deleteTotalMode(f),u}},K=["bar","marker","line"],G={handleAutoMinMax:function(e){var t=e.initialProperties,n=e.properties;t.measureAxis&&void 0===t.measureAxis.autoMinMax?C(n,"unsupportedAutoMinMax")||y()(n.measureAxis,t.measureAxis):C(n,"supportedAutoMinMax")||y()(n.measureAxis,t.measureAxis)},handleMeasuresAxis:function(e){var t,n=e.exportFormat,i=e.initialProperties,r=e.properties,o=e.measureType,s=r.qHyperCubeDef,a=r.measureAxis;if(function(e){var t=e.exportFormat,n=e.initialProperties;return!(!t.properties.measureAxes||n.measureAxes||!n.measureAxis||void 0===n.measureAxis.autoMinMax)}({exportFormat:n,initialProperties:i})){var l=function(e){var t=[];return e.qMeasures.length>0&&e.qMeasures.forEach((function(e){if(e.qDef.series){var n=e.qDef.series,i=n.type,r=n.axis;t[r]||(t[r]={axis:r,type:{line:0,marker:0,bar:0,total:0}}),K.includes(i)&&t[r].type[i]++,t[r].type.total++}})),t}(s);l.length?(o&&(t=l.filter((function(e){return e.type[o]>0})).sort((function(e,t){return t.type[o]-e.type[o]}))),t&&t.length||(t=l.sort((function(e,t){return t.type.total-e.type.total}))),t&&t[0]&&y()(a,n.properties.measureAxes[t[0].axis])):y()(a,n.properties.measureAxes[0])}},setInterColumnSortOrder:function(e){if(e.qDimensions.length>1){var t=e.qInterColumnSortOrder.indexOf(0);if(0!==t){var n=e.qInterColumnSortOrder[0];e.qInterColumnSortOrder[0]=0,e.qInterColumnSortOrder[t]=n}}}},J={exportProperties:function(e){var t=e.propertyTree,n=e.hypercubePath,i=e.viewDataMode,r=e.supportedAutoMinMax,o=void 0===r||r,s=X.exportProperties({propertyTree:t,hypercubePath:n,viewDataMode:i}),a=s.properties;return o?(m(a,"measureAxis.min","supportedAutoMinMax"),m(a,"measureAxis.max","supportedAutoMinMax")):(m(a,"measureAxis.min","unsupportedAutoMinMax"),m(a,"measureAxis.max","unsupportedAutoMinMax")),s},importProperties:function(e){var t=e.exportFormat,n=e.initialProperties,i=e.dataDefinition,r=e.defaultPropertyValues,o=e.hypercubePath,s=e.measureType,a=e.extension,l=e.supportedFilters,c=e.isHCModifierSupported,u=X.importProperties({exportFormat:t,initialProperties:n,dataDefinition:i,defaultPropertyValues:r,hypercubePath:o,extension:a,supportedFilters:l,isHCModifierSupported:c}),h=u.qProperty;return G.handleAutoMinMax({initialProperties:n,properties:h}),G.handleMeasuresAxis({exportFormat:t,initialProperties:n,properties:h,measureType:s}),G.setInterColumnSortOrder(h.qHyperCubeDef),h.qHyperCubeDef.qColumnOrder=[],h.qHyperCubeDef.columnOrder=[],u}};function Z(e,t,n){return"qLayoutExclude.quarantine.".concat(e,".").concat(t,".").concat(n)}function Q(e){var t=e.properties,n=e.arrayPath,i=e.quarantineName,r=e.arrayName,s=e.itemPath;o.getValue(t,n,[]).forEach((function(e){return function(e){var t=e.properties,n=e.quarantineName,i=e.arrayName,r=e.item,s=e.itemPath,a=o.getValue(r,s);if(void 0!==a){var l=o.getValue(r,"qDef.cId");l||(l=o.generateId(),o.setValue(r,"qDef.cId",l));var c=Z(n,i,l);o.setValue(t,c,a),o.setValue(r,s,void 0)}}({properties:t,quarantineName:i,arrayName:r,item:e,itemPath:s})}))}function ee(e){var t=e.properties,n=e.arrayPath,i=e.quarantineName,r=e.arrayName,s=e.itemPath;o.getValue(t,n,[]).forEach((function(e){return function(e){var t=e.properties,n=e.quarantineName,i=e.arrayName,r=e.item,s=e.itemPath,a=o.getValue(r,"qDef.cId");if(a){var l=Z(n,i,a),c=o.getValue(t,l);void 0!==c&&(o.setValue(r,s,c),o.setValue(t,l,void 0))}}({properties:t,quarantineName:i,arrayName:r,item:e,itemPath:s})}))}var te={quarantine:function(e){Q({properties:e,arrayPath:"qHyperCubeDef.qMeasures",quarantineName:"conditionalColoring",arrayName:"measures",itemPath:"qDef.conditionalColoring"})},unquarantine:function(e){ee({properties:e,arrayPath:"qHyperCubeDef.qMeasures",itemPath:"qDef.conditionalColoring",arrayName:"measures",quarantineName:"conditionalColoring"})}},ne={quarantine:function(e){Q({properties:e,arrayPath:"qHyperCubeDef.qMeasures",quarantineName:"conditionalShowHide",arrayName:"measures",itemPath:"qCalcCondition"}),Q({properties:e,arrayPath:"qHyperCubeDef.qDimensions",quarantineName:"conditionalShowHide",arrayName:"dimensions",itemPath:"qCalcCondition"})},unquarantine:function(e){ee({properties:e,arrayPath:"qHyperCubeDef.qMeasures",quarantineName:"conditionalShowHide",arrayName:"measures",itemPath:"qCalcCondition"}),ee({properties:e,arrayPath:"qHyperCubeDef.qDimensions",quarantineName:"conditionalShowHide",arrayName:"dimensions",itemPath:"qCalcCondition"})},quarantineAlternative:function(e){Q({properties:e,arrayPath:"qHyperCubeDef.qLayoutExclude.qHyperCubeDef.qMeasures",quarantineName:"conditionalShowHide",arrayName:"alternativeMeasures",itemPath:"qCalcCondition"}),Q({properties:e,arrayPath:"qHyperCubeDef.qLayoutExclude.qHyperCubeDef.qDimensions",quarantineName:"conditionalShowHide",arrayName:"alternativeDimensions",itemPath:"qCalcCondition"})},unquarantineAlternative:function(e){ee({properties:e,arrayPath:"qHyperCubeDef.qLayoutExclude.qHyperCubeDef.qMeasures",quarantineName:"conditionalShowHide",arrayName:"alternativeMeasures",itemPath:"qCalcCondition"}),ee({properties:e,arrayPath:"qHyperCubeDef.qLayoutExclude.qHyperCubeDef.qDimensions",quarantineName:"conditionalShowHide",arrayName:"alternativeDimensions",itemPath:"qCalcCondition"})}};t.default={hypercube:k,colorChart:X,axisChart:J,quarantineProperty:m,unquarantineProperty:C,quarantineArrayProp:Q,unquarantineArrayProp:ee,conditionalColoring:te,conditionalShow:ne}}])}(pb);var mb=n(pb.exports);const gb=["altLabel","auto","autoMinMax","byDimDef","byMeasureDef","dimensionScheme","expressionIsColor","expressionLabel","measureMax","measureMin","measureScheme","mode","paletteColor","persistent","reverseScheme","useBaseColors","useDimColVal"];function yb(e,t,n){for(let i=0;i<n.length;++i){const r=n[i];void 0!==e[r]&&(t[r]=e[r],delete e[r])}}var vb={importColors:function(e){e.color.point=e.color.point||{},yb(e.color,e.color.point,gb),e.color.colorExpression&&(e.color.point.expression={qValueExpression:{qExpr:e.color.colorExpression}},delete e.color.colorExpression),e.color.point.expressionIsColor=!0},exportColors:function(e){yb(e.color.point,e.color,gb),e.color.colorExpression=Ev(e,"color.point.expression.qValueExpression.qExpr",""),delete e.color.point.expression}};function bb({dataDefinition:e,defaultPropertyValues:t,exportFormat:n,initialProperties:i}){const r=mb.axisChart.importProperties({exportFormat:n,initialProperties:i,dataDefinition:e,defaultPropertyValues:t}),o=r.qProperty;return 3===o.qHyperCubeDef.qInterColumnSortOrder.length&&(o.qHyperCubeDef.qInterColumnSortOrder=[1,2,0]),vb.importColors(o),o.qHyperCubeDef.qAlwaysFullyExpanded=!0,r}function xb({propertyTree:e,viewDataMode:t}){const n=mb.axisChart.exportProperties({propertyTree:e,viewDataMode:t});return vb.exportColors(e.qProperty),n}var wb=e=>{const t=fb(e);return{properties:ub,data:{targets:[t]},importProperties:({exportFormat:e,initialProperties:n})=>bb({dataDefinition:t,exportFormat:e,initialProperties:n}),exportProperties:xb}},qb=Object.prototype.hasOwnProperty,Sb=Object.prototype.toString,Mb=Object.defineProperty,Db=Object.getOwnPropertyDescriptor,_b=function(e){return"function"==typeof Array.isArray?Array.isArray(e):"[object Array]"===Sb.call(e)},Cb=function(e){if(!e||"[object Object]"!==Sb.call(e))return!1;var t,n=qb.call(e,"constructor"),i=e.constructor&&e.constructor.prototype&&qb.call(e.constructor.prototype,"isPrototypeOf");if(e.constructor&&!n&&!i)return!1;for(t in e);return void 0===t||qb.call(e,t)},kb=function(e,t){Mb&&"__proto__"===t.name?Mb(e,t.name,{enumerable:!0,configurable:!0,value:t.newValue,writable:!0}):e[t.name]=t.newValue},Eb=function(e,t){if("__proto__"===t){if(!qb.call(e,t))return;if(Db)return Db(e,t).value}return e[t]},Ab=function e(){var t,n,i,r,o,s,a=arguments[0],l=1,c=arguments.length,u=!1;for("boolean"==typeof a&&(u=a,a=arguments[1]||{},l=2),(null==a||"object"!=typeof a&&"function"!=typeof a)&&(a={});l<c;++l)if(null!=(t=arguments[l]))for(n in t)i=Eb(a,n),a!==(r=Eb(t,n))&&(u&&r&&(Cb(r)||(o=_b(r)))?(o?(o=!1,s=i&&_b(i)?i:[]):s=i&&Cb(i)?i:{},kb(a,{name:n,newValue:e(u,s,r)})):void 0!==r&&kb(a,{name:n,newValue:r}));return a},Tb=n(Ab);const Ib={wrapExpression:function(e){const t=e.replace(/\]/g,"]]");return t?`[${t}]`:""}};const Rb={replaceExpressionTokens:function(e,t,n){const i={start:n&&n.start||"{{",end:n&&n.end||"}}"};let r,o,s=e;for(const e in t)r=t[e],o=i.start+e+i.end,s=s.replace(Ob(o,!0),r);return s},createRegExp:Ob};function Ob(e,t,n){const i=e.replace(/[-[\]/{}()*+?.\\^$|]/g,"\\$&");const r=n?`(${i})`:i;return t?new RegExp(r,"g"):new RegExp(r)}const Nb={generateExpression:function(e,t){const n={};if(t)for(const e in t){const i=t[e],r=i.wrap?Ib.wrapExpression(i.value):i.value;n[e]=r;(i.variations||[]).forEach((t=>{const i=Pb(t,r,e);n[t]=i}))}return Rb.replaceExpressionTokens(e,n)}};function Pb(e,t,n){if(""===t)return"";const i=Rb.createRegExp(n,!0,!0),r=e.split(i);let o="";return r.forEach((e=>{o+=e!==n?e:t})),o}const Lb={generateHyperCubeDef:function(e,t,n,i,r){return function(e,t,n,i){const r={};let o,s;const a=[];let l;e.forEach((e=>{o=Bb(e.match(Hb("Dim"))),o.forEach((e=>{a.push(Fb(t.qDimensions[e],i,e,n).then((t=>{r[`Dim[${e}]`]={value:t,wrap:!0}})))})),s=Bb(e.match(Hb("Mea"))),s.forEach((e=>{a.push(zb(t.qMeasures[e],i).then((t=>{r[`Mea[${e}]`]={value:t}})))}))})),l=a.length?Promise.all(a).then((()=>Promise.resolve(r))):Promise.resolve(r);return l}(e.dimensions.concat(e.measures),t,n,i).then((n=>{const i=Tb({},n,r),o=Tb(!0,{},t);return o.qDimensions=[],o.qMeasures=[],e.dimensions.forEach((e=>{o.qDimensions.push({qDef:{qFieldDefs:[`=${Nb.generateExpression(e,i)}`]}})})),e.measures.forEach((e=>{o.qMeasures.push({qDef:{qDef:Nb.generateExpression(e,i)}})})),o}))},getAllHyperCubeExpressions:async function(e,t,n){const i=e.qDimensions.map(((e,i)=>Fb(e,n,i,t))),r=e.qMeasures.map((e=>zb(e,n)));return{dimensions:await Promise.all(i),measures:await Promise.all(r)}}};function Fb(e,t,n,i){if(e.qLibraryId)return jb(e.qLibraryId,"dimension",t,n,i);const r=i.qDimensionInfo[n].qGroupPos;return Promise.resolve(e.qDef.qFieldDefs[r])}function zb(e,t){return e.qLibraryId?jb(e.qLibraryId,"measure",t):Promise.resolve(e.qDef.qDef)}function jb(e,t,n,i,r){if(!n)return console.warn("No app provided, returning library id"),e;return n["dimension"===t?"getDimension":"getMeasure"](e).then((e=>e.getProperties().then((e=>"dimension"===t?e.qDim.qFieldDefs[r.qDimensionInfo[i].qGroupPos]:e.qMeasure.qDef))))}function Hb(e){return new RegExp(`\\{\\{${e}\\[\\d\\]\\}\\}`,"g")}function Bb(e){return e?e.map((e=>e.substr(6,1))):[]}function Vb(e){return e=e||function(){return!1},{get(t){const n=e()?-1:1;switch(t("integer")*n){case-1:return"descending";case 1:return"ascending";default:return"disabled"}},set(t,n){const i=e();switch(t){case"descending":n("integer",i?1:-1);break;case"ascending":n("integer",i?-1:1);break;case"disabled":n("integer",0);break;default:n("integer",void 0)}}}}var $b={booleanConvertFunctions:function(e,t){return e=e||function(){return!1},t=t||1,{get:e=>!!e("integer"),set(n,i){if(n){let n=e()?-1:1;n*=t,i("integer",n)}else i("integer",0)}}},enumConvertFunctions:Vb,invertedEnumConvertFunctions:function(e){return Vb((function(){return!e||!e()}))}};const Wb=[{value:"ascending",translation:"properties.sorting.ascending"},{value:"descending",translation:"properties.sorting.descending"}];function Ub(e,t,n){return{type:"items",items:{toggled:{type:"boolean",ref:e,translation:t,convertFunctions:n.toggled},order:{type:"string",component:"dropdown",ref:e,options:Wb,convertFunctions:n.sorting,show:t=>0!==Ev(t,e,0)}}}}var Yb={state:function(e,t){return Ub(e=e||"qSortByState","properties.sorting.sortByState",{toggled:$b.booleanConvertFunctions(t),sorting:$b.invertedEnumConvertFunctions(t)})},ascii:function(e,t){return Ub(e=e||"qSortByAscii","properties.sorting.sortByAlphabetic",{toggled:$b.booleanConvertFunctions(t),sorting:$b.enumConvertFunctions(t)})},numeric:function(e,t){return Ub(e=e||"qSortByNumeric","properties.sorting.sortByNumeric",{toggled:$b.booleanConvertFunctions(t,-1),sorting:$b.enumConvertFunctions(t)})},expression:function(e,t){e=e||"qSortByExpression";const n={toggled:$b.booleanConvertFunctions(t),sorting:$b.enumConvertFunctions(t)},i=Ub(e,"properties.sorting.sortByExpression",n);return i.items.expression={type:"number",component:"expression",expressionType:"ValueExpr",ref:"qExpression",translation:"Common.Expression",defaultValue:"",show:t=>0!==Ev(t,e,0)},i},frequency:function(e,t){return Ub(e=e||"qSortByFrequency","properties.sorting.sortByFrequency",{toggled:$b.booleanConvertFunctions(t),sorting:$b.invertedEnumConvertFunctions(t)})}};const Xb=(e,t,n)=>{const i={getOptions:(i,r)=>{const o=(e,t)=>({ref:`${r}.fontColor`,component:"color-picker",width:!1,defaultValue:()=>{const n=e.getStyle(t,`${r}.color`,"color");return{color:n,index:e.getDataColorPickerPalettes()[0].colors.indexOf(n)}}});return{labelSection:{component:"items",ref:"components",key:i,items:{fontFamily:{ref:`${r}.fontFamily`,component:"dropdown",options:()=>e.getOptions(`${r}.fontFamily`),defaultValue:()=>e.getDefaultValue(`${r}.fontFamily`)},...((t,n)=>({fontWrapper:{component:"inline-wrapper",items:{fontSize:{ref:`${r}.fontSize`,component:"dropdown",width:!0,options:()=>e.getOptions(`${r}.fontSize`),defaultValue:()=>e.getDefaultValue(`${r}.fontSize`)},fontColor:{...o(t,n)}}}}))(t,n)}}}}};return i},Kb=(e,t,n,i,r)=>i({theme:e,translator:t,flags:r,config:{id:n,paths:["axis.title","axis.label.name","label.value","legend.title","legend.label"]}}),Gb=(e,t)=>(t.components||[]).find((t=>t.key===e)),Jb=(e,t,n,i)=>{var r,o,s,a,l;const c=i.isEnabled("CLIENT_IM_3364")?null===(r=Gb("axis",n))||void 0===r?void 0:r.axis:{};return{text:{fontFamily:(null==c||null===(o=c.title)||void 0===o?void 0:o.fontFamily)||t.getStyle(e,"axis.title","fontFamily"),fontSize:(null==c||null===(s=c.title)||void 0===s?void 0:s.fontSize)||t.getStyle(e,"axis.title","fontSize"),fill:(null==c||null===(a=c.title)||void 0===a||null===(l=a.fontColor)||void 0===l?void 0:l.color)||t.getStyle(e,"axis.title","color")}}},Zb=(e,t,n,i)=>{var r,o,s,a,l,c,u,h;const d=i.isEnabled("CLIENT_IM_3364")?null===(r=Gb("axis",n))||void 0===r?void 0:r.axis:{};return{labels:{fontFamily:(null==d||null===(o=d.label)||void 0===o||null===(s=o.name)||void 0===s?void 0:s.fontFamily)||t.getStyle(e,"axis.label.name","fontFamily"),fontSize:(null==d||null===(a=d.label)||void 0===a||null===(l=a.name)||void 0===l?void 0:l.fontSize)||t.getStyle(e,"axis.label.name","fontSize"),fill:(null==d||null===(c=d.label)||void 0===c||null===(u=c.name)||void 0===u||null===(h=u.fontColor)||void 0===h?void 0:h.color)||t.getStyle(e,"axis.label.name","color")}}},Qb=(e,t,n,i)=>{var r,o,s,a,l;const c=i.isEnabled("CLIENT_IM_3051")?null===(r=Gb("legend",n))||void 0===r?void 0:r.legend:{};return{fontFamily:(null==c||null===(o=c.title)||void 0===o?void 0:o.fontFamily)||t.getStyle(e,"legend.title","fontFamily"),fontSize:(null==c||null===(s=c.title)||void 0===s?void 0:s.fontSize)||t.getStyle(e,"legend.title","fontSize"),color:(null==c||null===(a=c.title)||void 0===a||null===(l=a.fontColor)||void 0===l?void 0:l.color)||t.getStyle(e,"legend.title","color")}},ex=(e,t,n,i)=>{var r,o,s,a,l;const c=i.isEnabled("CLIENT_IM_3051")?null===(r=Gb("legend",n))||void 0===r?void 0:r.legend:{};return{fontFamily:(null==c||null===(o=c.label)||void 0===o?void 0:o.fontFamily)||t.getStyle(e,"legend.label","fontFamily"),fontSize:(null==c||null===(s=c.label)||void 0===s?void 0:s.fontSize)||t.getStyle(e,"legend.label","fontSize"),color:(null==c||null===(a=c.label)||void 0===a||null===(l=a.fontColor)||void 0===l?void 0:l.color)||t.getStyle(e,"legend.label","color")}},tx={DATA_PATH:"qUndoExclude",HYPERCUBE_DEF_PATH:"qHyperCubeDef",HYPERCUBE_PATH:"qHyperCube",CHART_ID:"object.distributionPlot",AUTO_SORT:"sorting.autoSort",SORT_CRITERIA:"sorting.sortCriteria",SORTING_ELEMENT_ID:"sorting.elementId",SORTING_ELEMENT_MIN_ID:"distplot-exp-min",SORTING_ELEMENT_MAX_ID:"distplot-exp-max",SORTING_EXPRESSION:"sorting.expression",MAX_GLYPH_COUNT:20,MAX_STACKED_VALUES:3e3,HORIZONTAL:"horizontal",BOX_PADDING:2,POINT_BANDWIDTH_BASE_RATIO:.35,MAX_POINT_BASE_SIZE_PX:34,MIN_POINT_PIXELS:5,JITTER_PARAMETER:3,BUBBLE_SCALES_MAX:100};function nx(e){return e.qHyperCubeDef&&e.qHyperCubeDef.qDimensions.length>1||e.qHyperCube&&e.qHyperCube.qDimensionInfo&&e.qHyperCube.qDimensionInfo.length>1}Object.freeze(tx);const ix={hasMultipleDimensions:nx,getOuterDimensionCardinality:function(e){const t=Ev(e,tx.HYPERCUBE_PATH);return nx(e)?t&&t.qDimensionInfo[1].qCardinal:1},isAutoSort:function(e){return Ev(e,tx.AUTO_SORT,!1)},isSortByExpression:function(e){return 0!==Ev(e,`${tx.SORT_CRITERIA}.sortByExpression`,0)},isSortByNumeric:function(e){return 0!==Ev(e,`${tx.SORT_CRITERIA}.sortByNumeric`,0)},isSortByAscii:function(e){return 0!==Ev(e,`${tx.SORT_CRITERIA}.sortByAscii`,0)}},rx={cellBackgroundColor:!0,cellForegroundColor:!0,colorByAlternative:!0,colorByExpression:!0,tooltip:!0,urlLabel:!0,url:!0};var ox={create(e,t){if(!e||!rx[e])throw new Error("Attribute Expressions Util: ID required");const n={};return t&&Object.keys(t).forEach((e=>{n[e]=t[e]})),n.id=e,n.qAttribute=!0,n},getById:(e,t,n)=>!!e&&(n=n||"id",e.filter((e=>e[n]===t))[0]),getIndexById(e,t,n){let i=-1;return e&&(n=n||"id",e.forEach(((e,r)=>{e[n]===t&&(i=r)}))),i},moveById(e,t,n,i){const r=this.getIndexById(e,n,i);t=t||[];const o=this.getIndexById(t,n,i);if(-1!==r&&-1===o){const n=e.splice(r,1);t.push(n[0])}return t},moveAllById(e,t,n,i){const r=e.filter((e=>e.id===n)),o=t.filter((e=>e.id===n)),s=r.filter((e=>!(o.filter((t=>t[i]===e[i])).length>0)));return[...t,...s]},moveByIdFromGroup(e,t,n,i,r){n=n||"qAttributeExpressions",r=r||"id";for(let o=0;o<e.length;o++){const s=e[o][n],a=t.length;if(this.moveById(s,t,i,r),a!==t.length)return t}return t},clean:e=>e.filter((e=>e&&e.id)),IDMAP:{CELL_BACKGROUND_COLOR:"cellBackgroundColor",CELL_FOREGROUND_COLOR:"cellForegroundColor",COLOR_BY_ALTERNATIVE:"colorByAlternative",COLOR_BY_EXPRESSION:"colorByExpression",TOOLTIP:"tooltip",CELL_LINK_LABEL:"urlLabel",CELL_LINK_URL:"url"}};var sx={getColorByDefinition:function(e,t,n){const i={};let r,o,s;if("dimension"!==e)throw new Error("Default-property-logic.js: getColorByDefinition: Illegal input");return n.qLibraryId?(i.type="dimension",i.name=n.qLibraryId,i.id=n.qLibraryId):(i.type="field",t?(i.name=n.label||n.qDef,i.id=n.qDef):(r=n.qDef,o=!!r.qLabelExpression,s=r.qFieldLabels&&r.qFieldLabels[0],i.name=r.qFieldDefs[0],i.label=o?r.qLabelExpression:s?r.qFieldLabels[0]:r.qFieldDefs[0])),i}};var ax={useMasterNumberFormat:function(e){e.quarantine={qNumFormat:e.qNumFormat||{},isCustomFormatted:e.isCustomFormatted||!1},e.qNumFormat=null,e.isCustomFormatted=void 0},useLocalFormat:function(e){var t,n;e.qNumFormat=(null===(t=e.quarantine)||void 0===t?void 0:t.qNumFormat)||{},e.isCustomFormatted=(null===(n=e.quarantine)||void 0===n?void 0:n.isCustomFormatted)||!1,e.quarantine=void 0},isUsingMasterNumberFormat:function(e){var t,n;return null!==(t=!(null==e||null===(n=e.quarantine)||void 0===n||!n.qNumFormat))&&void 0!==t&&t}};const lx=["scatterplot","map"],cx=["map"];var ux={baseColor:{isSupported:e=>e&&e.length&&-1===lx.indexOf(e),isDimSupported:e=>e&&e.length&&-1!==cx.indexOf(e)},colorBy:{},colorByUpdater(e,t,n,i){this.updateColorDef(e,i,n),this.updateHypercubeAttributes(e,t,n)},updateColorDef(e,t,n){const i=Ev(n,"mode"),r=Ev(n,"auto"),o=Ev(e,`${t}qDimensions`,[]),s=Ev(e,`${t}qMeasures`,[]);let a,l,c,u;if(!r&&"byDimension"===i&&o.length)a=Ev(n,"byDimDef"),a&&gx(n,a.label),a&&a.activeDimensionIndex>-1?(a.activeDimensionIndex=Math.min(a.activeDimensionIndex,o.length-1),l=o[a.activeDimensionIndex],u=sx.getColorByDefinition("dimension",!1,l),u.activeDimensionIndex=a.activeDimensionIndex,px(n,u)):a&&a.key||(l=o[o.length-1],c=ox.getById(l.qAttributeDimensions,ox.IDMAP.COLOR_BY_ALTERNATIVE),px(n,sx.getColorByDefinition("dimension",!!c,c||l)));else{if(!r&&"byMeasure"===i&&o.length)throw new Error("not suported in any 444-chart");"byMultiple"===i&&s.length<2&&Iv(n,"mode","primary")}},updateHypercubeAttributes(e,t,n){const i=Ev(n,"mode"),r=Ev(n,"auto"),o=Ev(e,`${t}qDimensions`,[]),s=Ev(e,`${t}qMeasures`,[]),a=Ev(e,`${t}qLayoutExclude.qHyperCubeDef.qDimensions`,[]);!r&&"byDimension"===i&&o.length?mx(n,!0,o,a,s,Ev(n,"byDimDef.label")):!r&&"byMeasure"===i&&o.length?mx(n,!1,o,a,s,Ev(n,"byMeasureDef.label")):hx(o,a)},setColorByPropertyDef:px,resolveColorByPropertyDef:mx,clearColorByItem:hx};function hx(e,t){e.forEach((e=>{dx(e,ox.IDMAP.COLOR_BY_ALTERNATIVE,"qAttributeDimensions"),dx(e,ox.IDMAP.COLOR_BY_ALTERNATIVE,"qAttributeExpressions")})),t.forEach((e=>{dx(e,ox.IDMAP.COLOR_BY_ALTERNATIVE,"qAttributeDimensions"),dx(e,ox.IDMAP.COLOR_BY_ALTERNATIVE,"qAttributeExpressions")}))}function dx(e,t,n){if(e[n]){const i=ox.getIndexById(e[n],t);i>=0&&e[n].splice(i,1)}else e[n]=[]}function fx(e){return e.split(" ").length>1&&"="!==e[0]&&"["!==e[0]?`[${e}]`:e}function px(e,t,n,i){const r=n?"expression":t.type;let o=e.mode;switch(gx(e,t.label||t.name||""),r){case"field":o="byDimension",e.byDimDef={label:t.label||fx(t.name),key:fx(t.name),type:"expression",activeDimensionIndex:t.activeDimensionIndex};break;case"expression":o="byMeasure",e.byMeasureDef={label:n||t.label||t.name,key:n||t.name,type:"expression"};break;case"dimension":o="byDimension",e.byDimDef={label:t.name,key:t.id,type:"libraryItem",activeDimensionIndex:t.activeDimensionIndex};break;case"measure":o="byMeasure",e.byMeasureDef={label:t.name,key:t.id,type:"libraryItem"},e.formatting&&ax.useMasterNumberFormat(e.formatting)}i||(e.auto=!1,e.mode=o)}function mx(e,t,n,i,r,o){hx(n,i);const s=n[n.length-1];if(s){const n=Ev(e,t?"byDimDef":"byMeasureDef"),i=Ev(e,"formatting.qNumFormat"),a=Ev(e,"formatting.isCustomFormatted");if(n){const e=ox.create(ox.IDMAP.COLOR_BY_ALTERNATIVE);switch(n.type){case"expression":e.label=o||n.label,t?e.qDef=n.key:(e.qExpression=n.key,i&&(e.qNumFormat=i,e.isCustomFormatted=a));break;case"libraryItem":if(!t){let t=-1;r.forEach(((e,i)=>{n.key===e.qLibraryId&&(t=i)})),e.matchMeasure=t,i&&(e.qNumFormat=i,e.isCustomFormatted=a)}e.qLibraryId=n.key,e.colorMapRef=n.key}t?(e.qSortBy={qSortByAscii:1},s.qAttributeDimensions.push(e)):s.qAttributeExpressions.push(e)}}}function gx(e,t){if(!t)return;const n="="===t.charAt(0);e.altLabel=n?{qStringExpression:{qExpr:t.substr(1)}}:t}function yx(e){return!!e&&(e.coloring&&e.coloring.baseColor&&e.coloring.baseColor.color?e.coloring.baseColor:!(!e.baseColor||!e.baseColor.color)&&e.baseColor)}function vx(e){return"libraryItem"===Ev(e,"color.point.byDimDef.type")}function bx(e){return"libraryItem"===Ev(e,"color.point.byMeasureDef.type")}function xx(e){return!0===Ev(e,"color.point.auto")}function wx(e){return!xx(e)&&"byDimension"===Ev(e,"color.point.mode")}function qx(e){return!xx(e)&&"byMeasure"===Ev(e,"color.point.mode")}var Sx={measuresHasBaseColors:function(e){return Ev(e,"layout.qHyperCube.qMeasureInfo",[]).filter((e=>!!yx(e))).length>0},dimensionsHasBaseColors:function(e){return Ev(e,"layout.qHyperCube.qDimensionInfo",[]).filter((e=>!!yx(e))).length>0},onGlobalChangeColors:function(e){ux.updateColorDef(e,"qHyperCubeDef.",e.color.point)},onChangeCalcCond:function(e){var t;const n=null==e?void 0:e.qHyperCubeDef,i=null==e||null===(t=e.qUndoExclude)||void 0===t?void 0:t.qHyperCubeDef;n&&i&&(i.qCalcCond=n.qCalcCond,i.qCalcCondition=n.qCalcCondition)},isColorByDimension:wx,isColorByMeasure:qx,isColorAuto:xx,isColorByExpression:function(e){return!xx(e)&&"byExpression"===Ev(e,"color.point.mode")},isColorBySingle:function(e){return!xx(e)&&"primary"===Ev(e,"color.point.mode","primary")},isDimensionLibraryItem:vx,isMeasureLibraryItem:bx,showLegend:function(e){const t=Ev(e,"color.point.mode","primary");return"primary"!==t&&"byExpression"!==t&&!1===xx(e)},showColorByLabel:function(e){const t=wx(e)&&!1===vx(e),n=qx(e)&&!1===bx(e),i=Ev(e,"color.point.byDimDef.activeDimensionIndex")>-1;return t&&!i||n},hasDimValueColors:function(e,t){var n,i,r;return null===(n=null===(i=e.layout.qHyperCube.qDimensionInfo[t])||void 0===i||null===(r=i.coloring)||void 0===r?void 0:r.hasValueColors)||void 0===n||n}};function Mx(e,t){this.getSettings=e,this.getElements=t}function Dx(e){const t=e.qDef.qSortCriterias;t[0]||t.push({});const n=t[0],i=this.getSettings();Iv(n,"qSortByExpression",i.SORT_BY_EXPRESSION),Iv(n,"qSortByAscii",i.SORT_BY_ASCII),Iv(n,"qSortByNumeric",i.SORT_BY_NUMERIC),Iv(n,"qSortByLoadOrder",i.SORT_BY_LOAD_ORDER),n.qExpression||(n.qExpression={});const r=_x(this.getElements());n.qExpression.qv=r.exp}function _x(e){const t=e.filter((e=>e.isDefault));return 0===t.length?e[0]:t[0]}Mx.prototype.applyAutoSorting=Dx,Mx.prototype.applyDefaultCustomSorting=function(e,t){Dx.call(this,e);const n=_x(this.getElements()),i=e.qDef.qSortCriterias[0];t.elementId=n.id,t.sortCriteria={},Iv(t.sortCriteria,"sortByExpression",i.qSortByExpression),Iv(t.sortCriteria,"sortByAscii",i.qSortByAscii),Iv(t.sortCriteria,"sortByNumeric",i.qSortByNumeric),Iv(t.sortCriteria,"sortByLoadOrder",i.qSortByLoadOrder)},Mx.prototype.applyCustomSorting=function(e,t){const n=e.qDef.qSortCriterias[0];if(Iv(n,"qSortByExpression",t.sortCriteria.sortByExpression),Iv(n,"qSortByAscii",t.sortCriteria.sortByAscii),Iv(n,"qSortByNumeric",t.sortCriteria.sortByNumeric),Iv(n,"qSortByLoadOrder",t.sortCriteria.sortByLoadOrder),1!==n.qSortByExpression&&-1!==n.qSortByExpression)return;n.qExpression||(n.qExpression={});if(t.elementId){const e=function(e,t){const n=e.filter((e=>e.id===t));0===n.length&&function(e){throw new Error(`Sorter: ${e}`)}(`Could not find any element matching the element '${t}'`);return n[0]}(this.getElements(),t.elementId);n.qExpression.qv=e.exp}else n.qExpression.qv=t.expression.qValueExpression.qExpr};const Cx={create:function(e,t){return new Mx(e,t)}};const kx={applySorting:function(e,t,n){const i=n.autoSort,r=!!n.sortCriteria;i?e.applyAutoSorting(t):r?e.applyCustomSorting(t,n):e.applyDefaultCustomSorting(t,n)}};const Ex={ASCII:{ELEMENT:void 0,SORT_BY_EXPRESSION:void 0,SORT_BY_ASCII:1,SORT_BY_NUMERIC:1,SORT_BY_LOAD_ORDER:1}};Object.freeze(Ex.ASCII),Object.freeze(Ex);const Ax=Tb(!0,{DIST_MAX:{ELEMENT:"distplot-exp-max",SORT_BY_EXPRESSION:-1,SORT_BY_ASCII:1,SORT_BY_NUMERIC:1,SORT_BY_LOAD_ORDER:1}},Ex);const Tx={getSettings:function(e){return Ev(e,"qHyperCube.qDimensionInfo.1.qCardinal",1)>10?Ax.DIST_MAX:Ax.ASCII}};function Ix(e,t,n,i){let r="Fractile";0===e?r="Min":1===e&&(r="Max");const o=t?Ib.wrapExpression(t):"",s=n?Ib.wrapExpression(n):"";return`${r}( total {{<outerDimString>}} Aggr( {{innerMeasureString}}, {{outerDimString,}} {{innerDimString}} ), ${e} )`.replace(/{{innerDimString}}/g,o).replace(/{{outerDimString}}/g,s).replace(/{{<outerDimString>}}/g,n?`<${s}>`:"").replace(/{{outerDimString,}}/g,n?`${s},`:"").replace(/{{innerMeasureString}}/g,(i||"").replace(/^=/,""))}const Rx={getElementIds:function(){return[tx.SORTING_ELEMENT_MIN_ID,tx.SORTING_ELEMENT_MAX_ID]},getElements:function(e,t,n,i){const r=t[0],o=t[1],s=e[0],a=Ix(0,r,o,s),l=Ix(1,r,o,s);return[{id:tx.SORTING_ELEMENT_MIN_ID,label:i.get("properties.distributionPlot.min"),exp:a,isDefault:tx.SORTING_ELEMENT_MIN_ID===n.ELEMENT},{id:tx.SORTING_ELEMENT_MAX_ID,label:i.get("properties.distributionPlot.max"),exp:l,isDefault:tx.SORTING_ELEMENT_MAX_ID===n.ELEMENT}]},getFractileExpression:Ix};function Ox(e){throw new Error(`distributionplot-sorter.applySorting: ${e}`)}function Nx(e,t,n,i){if(!e.qUndoExclude)return;e.sorting||(e.sorting={autoSort:!0});const r=e.qUndoExclude.qHyperCubeDef.qDimensions;r.length>=2?e.qUndoExclude.qHyperCubeDef.qInterColumnSortOrder=[0,2,1]:e.qUndoExclude.qHyperCubeDef.qInterColumnSortOrder=[1,0];const o=function(){return Tx.getSettings(t)},s=Cx.create(o,(function(){const e=o();return Rx.getElements(n.measures,n.dimensions,e,i)})),a=r[0],l=e.sorting;kx.applySorting(s,a,l)}const Px={applySorting:function(e,t,n,i,r){return function(e){const t=e.qHyperCubeDef;t?t.qDimensions?t.qMeasures?(!t.qDimensions.length||t.qDimensions.length<2)&&Ox("'qHyperCubeDef.qDimensions' has no outer dimension"):Ox("no 'qHyperCubeDef.qMeasures' in properties arg"):Ox("no 'qHyperCubeDef.qDimensions' in properties arg"):Ox("no 'qHyperCubeDef' in properties arg")}(e),i?Nx(e,t,i,r):Lb.getAllHyperCubeExpressions(e.qHyperCubeDef,t.qHyperCube,n).then((n=>{Nx(e,t,n,r)}))}},Lx=`${tx.SORT_CRITERIA}.sortByExpression`;const Fx={updateSortOrder:function(e,t){if(!t)return;const n=Ev(e,Lx);if(!(-1===n||1===n))return;const i=Ev(e,tx.SORTING_ELEMENT_ID),r=Ev(t,tx.SORTING_ELEMENT_ID),o=!!r,s=i===tx.SORTING_ELEMENT_MIN_ID,a=i===tx.SORTING_ELEMENT_MAX_ID,l=r===tx.SORTING_ELEMENT_MIN_ID,c=r===tx.SORTING_ELEMENT_MAX_ID,u=s&&c,h=a&&(!o||l),d=Ev(t,Lx),f=a&&!(-1===d||1===d)&&1===n;u?Iv(e,Lx,1):(h||f)&&Iv(e,Lx,-1)}},zx=(e,t)=>{const n={};return null!=e&&e.isEnabled("CLIENT_IM_3364")&&(n.axisTitleSection={translation:"properties.axis.title",component:"panel-section",items:t.getOptions("axis","axis.title")},n.axisLabelSection={translation:"properties.axis.label",component:"panel-section",items:t.getOptions("axis","axis.label.name")}),null!=e&&e.isEnabled("CLIENT_IM_3051")&&(n.legendTitleSection={translation:"properties.legend.title",component:"panel-section",items:t.getOptions("legend","legend.title")},n.legendLabelSection={translation:"properties.legend.label",component:"panel-section",items:t.getOptions("legend","legend.label")}),Object.keys(n).length>0?n:void 0},jx=(e,t,n)=>({component:"styling-panel",chartTitle:"Object.DistributionPlot",translation:"LayerStyleEditor.component.styling",subtitle:"LayerStyleEditor.component.styling",ref:"components",useGeneral:!0,useBackground:e,items:zx(n,t)});function Hx(e){return!Ev(e,"color.point.auto")&&"byDimension"===Ev(e,"color.point.mode")&&Ev(e,"qHyperCubeDef.qMeasures.length",0)<=1}function Bx(e){const{flags:t,translator:n}=e,i=e.anything.sense.theme,r=e.flags.isEnabled("SENSECLIENT_IM_2018_STYLINGPANEL_DIST_PLOT"),o=e.flags.isEnabled("SENSECLIENT_IM_2018_DIST_BG"),s=e=>({color:e,index:i.getDataColorPickerPalettes()[0].colors.indexOf(e)}),a={translation:"properties.colors",type:"items",items:{colors:{type:"items",items:{pointColor:{type:"items",translation:"properties.colorsAndLegend",grouped:!0,items:{colors:{type:"items",items:{autoColor:{ref:"color.point.auto",type:"boolean",translation:"properties.colors",component:"switch",defaultValue:!0,options:[{value:!0,translation:"Common.Auto"},{value:!1,translation:"Common.Custom"}]},colorMode:{ref:"color.point.mode",type:"string",component:"dropdown",options:()=>[{value:"primary",translation:"properties.colorMode.primary"},{value:"byExpression",translation:"properties.colorMode.byExpression"}],defaultValue:"primary",show:e=>!Ev(e,"color.point.auto",!0)},boxColor:{ref:"color.box.paletteColor",translation:"properties.distributionPlot.boxColor",type:"object",component:"color-picker",dualOutput:!0,defaultValue(){const e=i.getStyle(tx.CHART_ID,"box","fill");return s(e)}},paletteColor:{ref:"color.point.paletteColor",translation:"properties.distributionPlot.pointColor",type:"object",component:"color-picker",dualOutput:!0,show:e=>!Ev(e,"color.point.auto",!0)&&"primary"===Ev(e,"color.point.mode","primary"),defaultValue(){const e=i.getDataColorSpecials().primary;return s(e)}},attributeExpression:{type:"string",component:"expression",expressionType:"measure",schemaIgnore:!0,ref:"color.point.expression.qValueExpression.qExpr",translation:"Common.Expression",show:e=>!Ev(e,"color.point.auto")&&"byExpression"===Ev(e,"color.point.mode")},expressionIsColor:{ref:"color.point.expressionIsColor",translation:"properties.expressionIsColor",type:"boolean",defaultValue:!0,show:!1}}}}}}}}},l={items:{showDisclaimer:{translation:"properties.showDisclaimer",type:"boolean",ref:"showDisclaimer",component:"switch",show:()=>t.isEnabled("SHOW_DISCLAIMER"),defaultValue:!0,options:[{value:!0,translation:"Common.Show"},{value:!1,translation:"properties.hide"}]}}},c=Kb(i,n,tx.CHART_ID,Xv,t),u=Xb(c,i,tx.CHART_ID),h={type:"items",translation:"properties.presentation",items:{styleEditor:r&&jx(o,u,t),orientation:{ref:"orientation",type:"string",component:"item-selection-list",defaultValue:"horizontal",horizontal:!0,items:[{component:"icon-item",icon:"direction_up_down",labelPlacement:"bottom",translation:"properties.orientation.vertical",value:"vertical"},{icon:"direction_left_right",component:"icon-item",labelPlacement:"bottom",translation:"Common.Horizontal",value:"horizontal"}]},showDistBackground:{ref:"presentation.visibleComponents",translation:"properties.show",type:"string",component:"dropdown",defaultValue:"points_box",options:[{value:"points_box",translation:"properties.distributionPlot.pointsAndBox"},{value:"points",translation:"properties.distributionPlot.pointsOnly"},{value:"box",translation:"properties.distributionPlot.boxOnly"}]},gridLines:{type:"items",snapshot:{tid:"property-gridLines"},items:{showGridLines:{ref:"gridlines.auto",type:"boolean",translation:"properties.gridLine.spacing",component:"switch",defaultValue:!0,options:[{value:!0,translation:"Common.Auto"},{value:!1,translation:"Common.Custom"}]},gridSpacing:{ref:"gridlines.spacing",type:"number",component:"dropdown",defaultValue:2,options:[{value:0,translation:"properties.gridLine.noLines"},{value:2,translation:"properties.gridLine.medium"},{value:3,translation:"properties.gridLine.narrow"}],show:e=>e.gridlines&&!e.gridlines.auto}}}}};h.items.bubbleScaleItems={type:"items",items:{bubbleScales:{type:"integer",component:"slider",ref:"dataPoint.bubbleScales",translation:"properties.dataPoints.bubbleSizes",min:20,max:tx.BUBBLE_SCALES_MAX,step:5,defaultValue:100,show:e=>e.qHyperCubeDef.qMeasures.length<2&&"box"!==e.presentation.visibleComponents}}},h.items.jitter={type:"string",component:"switch",ref:"dataPoint.displacement",translation:"properties.distributionPlot.jitter",defaultValue:"none",options:[{value:"none",translation:"properties.off"},{value:"jitter",translation:"properties.on"}],show:e=>"box"!==e.presentation.visibleComponents};const d={uses:"axis.picasso.measureAxis",items:{startAt:{type:"string",component:"dropdown",translation:"properties.axis.startAt",readOnly:e=>!(e.measureAxis.autoMinMax||"min"===e.measureAxis.minMax&&0===e.measureAxis.min),options:[{value:"zero",translation:"properties.axis.startAt.zero"},{value:"lowest",translation:"properties.axis.startAt.lowest"}],defaultValue:"lowest",convertFunctions:{get(e,t,n,i){const{autoMinMax:r,minMax:o,min:s}=(null==i?void 0:i.measureAxis)||{};return!0===r?"lowest":r||"min"!==o||0!==s?e(t.type):"zero"},set(e,t,n,i,r){"zero"===e?(Iv(r,"measureAxis.autoMinMax",!1),Iv(r,"measureAxis.minMax","min"),Iv(r,"measureAxis.min",0)):Iv(r,"measureAxis.autoMinMax",!0)}},classification:{section:"axis",tags:["simple"],exclusive:!0}}}},f={uses:"axis.picasso.dimensionAxis",show:(e,t)=>Ev(t.layout,`${tx.HYPERCUBE_PATH}.qDimensionInfo.length`)>1,items:{dimensionAxisTitle:{component:"header",type:"string",show:(e,t)=>Ev(t.layout,`${tx.HYPERCUBE_PATH}.qDimensionInfo.length`)>1,classification:{section:"axis",tags:["simple"],exclusive:!0}},othersGroup:{items:{label:{show:(e,t)=>Ev(t.layout,`${tx.HYPERCUBE_PATH}.qDimensionInfo.length`)>1&&"horizontal"!==Ev(t.layout,"orientation"),options:t.isEnabled("SENSECLIENT_LAYERED_LABELS")?[{value:"auto",translation:"Common.Auto"},{value:"horizontal",translation:"Common.Horizontal"},{value:"tilted",translation:"properties.labels.tilted"},{value:"layered",translation:"properties.labels.layered"}]:void 0},dock:{show:(e,t)=>Ev(t.layout,`${tx.HYPERCUBE_PATH}.qDimensionInfo.length`)>1}}}}};function p(e,t){const n=Ev(e,t,void 0);n&&void 0!==n.label&&("="===n.label.charAt(0)?e.color.point.altLabel={qStringExpression:{qExpr:n.label.substr(1)}}:e.color.point.altLabel=n.label)}const m=(e,t)=>{var n,i,r;if("libraryItem"===(null===(n=e.color.point.byDimDef)||void 0===n?void 0:n.type)){var o,s,a,l,c;const n=null!==(o=null===(s=e.color.point.byDimDef)||void 0===s?void 0:s.key)&&void 0!==o?o:"",i=null!==(a=null===(l=t.handler.layout.qUndoExclude)||void 0===l||null===(c=l.qHyperCube)||void 0===c?void 0:c.qDimensionInfo)&&void 0!==a?a:[];for(let e=0;e<i.length;e++){const t=i[e].qAttrDimInfo;if(t)for(let e=0;e<t.length;e++)if(t[e].colorMapRef===n)return t[e].qFallbackTitle}return""}return null!==(i=null===(r=e.color.point.byDimDef)||void 0===r?void 0:r.label)&&void 0!==i?i:""},g=(e,t,i)=>{var r,o;if(null!==(r=e.qHyperCubeDef)&&void 0!==r&&null!==(o=r.qDimensions)&&void 0!==o&&o.length){var s,a,l,c,u;const t=null===(s=e.qHyperCubeDef)||void 0===s?void 0:s.qDimensions.map(((e,t)=>({value:t,label:n.get("properties.colorBy.currentDimension",t+1)})));return(null!==(a=null===(l=e.color)||void 0===l||null===(c=l.point)||void 0===c||null===(u=c.byDimDef)||void 0===u?void 0:u.activeDimensionIndex)&&void 0!==a?a:-1)<0&&t.push({value:-1,label:m(e,i)}),t}return[]},y=(e,t)=>{const n="measure"===Ev(e,"color.point.useBaseColors")&&Sx.measuresHasBaseColors(t),i="dimension"===Ev(e,"color.point.useBaseColors")&&Sx.dimensionsHasBaseColors(t);return Sx.isColorBySingle(e)&&!n&&!i},v=(e,t)=>!Ev(e,"color.point.auto",void 0)&&"primary"===Ev(e,"color.point.mode",void 0)&&!y(e,t),b={items:{disclaimer:{show:(e,n)=>!t.isEnabled("SIMPLE_PROPERTIES_LIBRARY_COLOR")&&v(e,n)},simpleItems:{show:(e,n)=>!!t.isEnabled("SIMPLE_PROPERTIES_LIBRARY_COLOR")||!v(e,n),items:{autoColor:{ref:"color.point.auto",undefinedValue:!1,label:e=>Ev(e,"color.point.auto")?n.get("Simple.Color.Auto",n.get("properties.colorMode.primary")):n.get("Common.Custom"),change:e=>{Ev(e,"color.point.auto")||(Iv(e,"color.point.mode","primary"),Iv(e,"color.point.useBaseColors","off"))}},colorMode:{ref:"color.point.mode",options:e=>{const t=[{value:"primary",translation:"properties.colorMode.primary"},{value:"byDimension",translation:"properties.colorMode.byDimension"}];return"byExpression"===Ev(e,"color.point.mode")&&t.push({value:"byExpression",translation:"properties.colorMode.byExpression"}),t},show:e=>!Sx.isColorAuto(e),change(e){if("primary"===Ev(e,"color.point.mode",void 0)){const t=Ev(e,"color.point.useBaseColors",void 0);void 0!==t&&"off"!==t&&Iv(e,"color.point.useBaseColors","off")}},globalChange(){}},colorByDimension:{ref:"color.point.byDimDef.activeDimensionIndex",options:g,show:(e,t,n)=>Sx.isColorByDimension(e)&&g(e,0,n).length>1,change(e){p(e,"color.point.byDimDef")}},baseColors:{type:"items",items:{useBaseColor:{ref:"color.point.useBaseColors",show(e,n){const i=Ev(e,"color.point.mode","primary");return t.isEnabled("SIMPLE_PROPERTIES_LIBRARY_COLOR")&&!Sx.isColorAuto(e)&&"primary"===i&&(Sx.measuresHasBaseColors(n)||Sx.dimensionsHasBaseColors(n))}}}},paletteColor:{ref:"color.point.paletteColor",translation:"properties.distributionPlot.pointColor",show:y},useDimColVal:{ref:"color.point.useDimColVal",show(e,n,i){var r,o,s;const a=null!==(r=null===(o=e.color.point)||void 0===o||null===(s=o.byDimDef)||void 0===s?void 0:s.activeDimensionIndex)&&void 0!==r?r:null,l=Sx.hasDimValueColors(i.handler,a);return t.isEnabled("SIMPLE_PROPERTIES_LIBRARY_COLOR")&&l&&Sx.isColorByDimension(e)&&Sx.isDimensionLibraryItem(e)}},boxColor:{ref:"color.box.paletteColor",translation:"properties.distributionPlot.boxColor",type:"object",component:"color-picker",dualOutput:!0,defaultValue(){const e=i.getStyle(tx.CHART_ID,"box","fill");return s(e)},show:e=>!Ev(e,"color.point.auto",!0)}}}}},x={uses:"colorsAndLegend",items:{colors:{globalChange:Sx.onGlobalChangeColors,items:{autoColor:{ref:"color.point.auto",undefinedValue:!1},colorMode:{ref:"color.point.mode",options(e){const t=[];return t.push({value:"primary",translation:"properties.colorMode.primary"}),t.push({value:"byDimension",translation:"properties.colorMode.byDimension"}),Ev(e,"qHyperCubeDef.qDimensions.length",0)>=1&&t.push({value:"byExpression",translation:"properties.colorMode.byExpression"}),t},show:e=>!Sx.isColorAuto(e),globalChange(){}},colorByDimension:{ref:"color.point.byDimDef",show:e=>Sx.isColorByDimension(e),change(e){p(e,"color.point.byDimDef")}},colorByMeasure:{ref:"color.point.byMeasureDef",show:e=>Sx.isColorByMeasure(e),change(e){p(e,"color.point.byMeasureDef")}},colorByLabel:{ref:"color.point.altLabel",show:Sx.showColorByLabel,change(e){const t=Ev(e,"color.point.mode"),n=Ev(e,"color.point.altLabel","");let i;switch(t){case"byMeasure":i=e.color.point.byMeasureDef;break;case"byDimension":i=e.color.point.byDimDef}i&&(i.label=n.qStringExpression?`=${n.qStringExpression.qExpr}`:n)}},baseColors:{type:"items",items:{useBaseColor:{ref:"color.point.useBaseColors",show(e,t){const n=Ev(e,"color.point.mode","primary");return!Sx.isColorAuto(e)&&"primary"===n&&(Sx.measuresHasBaseColors(t)||Sx.dimensionsHasBaseColors(t))}},measureColor:{translation:"properties.libraryColors",component:"measure-color",show:(e,t)=>!Ev(e,"color.point.auto")&&"byMultiple"===Ev(e,"color.point.mode")&&"measure"===Ev(e,"color.point.useBaseColors")&&t.layout.qHyperCube.qMeasureInfo.length>1&&Sx.measuresHasBaseColors(t)}}},paletteColor:{ref:"color.point.paletteColor",translation:"properties.distributionPlot.pointColor",show(e,t){const n="measure"===Ev(e,"color.point.useBaseColors")&&Sx.measuresHasBaseColors(t),i="dimension"===Ev(e,"color.point.useBaseColors")&&Sx.dimensionsHasBaseColors(t);return Sx.isColorBySingle(e)&&!n&&!i}},useDimColVal:{ref:"color.point.useDimColVal",show:e=>Sx.isColorByDimension(e)&&Sx.isDimensionLibraryItem(e)},useMeasureGradient:{ref:"color.point.useMeasureGradient",translation:"properties.libraryColors",type:"boolean",component:"switch",schemaIgnore:!0,defaultValue:!1,options:[{value:!0,translation:"properties.on"},{value:!1,translation:"properties.off"}],show(e){const t=Ev(e,"color.point.auto"),n=Ev(e,"color.point.mode");return!t&&"byMeasure"===n&&"libraryItem"===Ev(e,"color.point.byMeasureDef.type")}},persistentColors:{ref:"color.point.persistent",show:e=>Ev(e,"color.point.auto")||"byDimension"!==Ev(e,"color.point.mode")||"libraryItem"!==Ev(e,"color.point.byDimDef.type")?Hx(e):Hx(e)&&!Ev(e,"color.point.useDimColVal")},colorSchemeMeasure:{ref:"color.point.measureScheme",show:e=>!Sx.isColorAuto(e)&&Sx.isColorByMeasure(e)},reverseScheme:{ref:"color.point.reverseScheme",change(e){e.color.reverseScheme=e.color.point.reverseScheme},show:e=>!Sx.isColorAuto(e)&&Sx.isColorByMeasure(e)},colorSchemeDimension:{ref:"color.point.dimensionScheme",show:e=>Sx.isColorByDimension(e)&&(!Sx.isDimensionLibraryItem(e)||!Ev(e,"color.point.useDimColVal"))},customRange:{show:e=>!Sx.isColorAuto(e),items:{autoMinMax:{ref:"color.point.autoMinMax",show:e=>Sx.isColorByMeasure(e)},min:{ref:"color.point.measureMin",show:e=>Sx.isColorByMeasure(e)&&!1===Ev(e,"color.point.autoMinMax"),invalid:e=>"minMax"===Ev(e,"color.point.minMax")&&Ev(e,"color.point.measureMin")>=Ev(e,"color.point.measureMax")},max:{ref:"color.point.measureMax",show:e=>Sx.isColorByMeasure(e)&&!1===Ev(e,"color.point.autoMinMax"),invalid:e=>"minMax"===Ev(e,"color.point.minMax")&&Ev(e,"color.point.measureMin")>=Ev(e,"color.point.measureMax")}}},attributeExpression:{ref:"color.point.expression.qValueExpression.qExpr",show:e=>Sx.isColorByExpression(e)},expressionIsColor:{ref:"color.point.expressionIsColor",show:!1},boxColor:{ref:"color.box.paletteColor",translation:"properties.distributionPlot.boxColor",type:"object",component:"color-picker",dualOutput:!0,defaultValue(){const e=i.getStyle(tx.CHART_ID,"box","fill");return s(e)},show:e=>!Ev(e,"color.point.auto",!0)}}},simpleColors:b,legend:{show:Sx.showLegend,type:"items",items:{show:{snapshot:{tid:"property-legend"}},dock:{show:e=>Sx.showLegend(e)&&Ev(e,"legend.show",!0)},showTitle:{show:e=>Sx.showLegend(e)&&Ev(e,"legend.show",!0)}}}}},w={items:{labels:{items:{header:{show(e){var t,n;return(null===(t=e.qHyperCubeDef.qDimensions)||void 0===t?void 0:t.length)&&(null===(n=e.qHyperCubeDef.qMeasures)||void 0===n?void 0:n.length)}},dimensionTitle:{component:"checkbox",ref:"dimensionAxis.show",type:"string",translation:"Simple.Label.Dimension.Hide",defaultValue:"all",show(e){var t,n;return(null===(t=e.qHyperCubeDef.qDimensions)||void 0===t?void 0:t.length)>1&&(null===(n=e.qHyperCubeDef.qMeasures)||void 0===n?void 0:n.length)},convertFunctions:{get:(e,t,n,i)=>"labels"===i.dimensionAxis.show||"none"===i.dimensionAxis.show,set(e,t,n,i,r){r.dimensionAxis.show=e?"labels":"all"}}},measureTitle:{component:"checkbox",ref:"measureAxis.show",type:"string",translation:"Simple.Label.Measure.Hide",defaultValue:"all",show(e){var t,n;return(null===(t=e.qHyperCubeDef.qDimensions)||void 0===t?void 0:t.length)&&(null===(n=e.qHyperCubeDef.qMeasures)||void 0===n?void 0:n.length)},convertFunctions:{get:(e,t,n,i)=>"labels"===i.measureAxis.show||"none"===i.measureAxis.show,set(e,t,n,i,r){r.measureAxis.show=e?"labels":"all"}}}}}}},q={uses:"settings",items:{simpleLabels:w,general:l,presentation:h,colors:x||a,measureAxis:d,dimensionAxis:f}},S={type:"items",component:"expandable-items",translation:"properties.addons",items:{dataHandling:{uses:"dataHandling",items:{calcCond:{uses:"calcCond",change:Sx.onChangeCalcCond}}},refLines:{uses:"reflines",items:{colorBackground:{show:!1}}}}},M=Yb.expression(`${tx.SORT_CRITERIA}.sortByExpression`),D={type:"items",items:{toggled:M.items.toggled,sortByElement:{component:"sort-by-element",expressionRef:tx.SORTING_EXPRESSION,elementRef:tx.SORTING_ELEMENT_ID,show:ix.isSortByExpression,elements:e=>Lb.getAllHyperCubeExpressions(e.properties.qHyperCubeDef,e.layout.qHyperCube,e.model.app).then((t=>{const i=Tx.getSettings(e.layout);return Rx.getElements(t.measures,t.dimensions,i,n)}))},order:M.items.order}},_={type:"items",translation:"properties.sorting",schemaIgnore:!0,grouped:!1,globalChange(e,t,n){n&&Fx.updateSortOrder(e,n.prevProperties)},items:{autoSort:{ref:tx.AUTO_SORT,type:"boolean",translation:"properties.sorting",component:"switch",defaultValue:!0,options:[{value:!0,translation:"Common.Auto"},{value:!1,translation:"Common.Custom"}],show:ix.hasMultipleDimensions,change(e,t,i,r){if(e&&ix.hasMultipleDimensions(e)&&t.layout)return Px.applySorting(e,t.layout,r.model.app,null,n)},classification:{section:"sorting",tags:["simple"]},reset(e){e.sorting={autoSort:!0}}},simpleSorting:{component:"sorting-with-elements",expressionRef:tx.SORTING_EXPRESSION,elementRef:tx.SORTING_ELEMENT_ID,sortCriteriasRef:tx.SORT_CRITERIA,show:e=>ix.hasMultipleDimensions(e)&&!ix.isAutoSort(e),elements:e=>Lb.getAllHyperCubeExpressions(e.handler.properties.qHyperCubeDef,e.handler.layout.qHyperCube,e.model.app).then((t=>{const i=Tx.getSettings(e.layout);return Rx.getElements(t.measures,t.dimensions,i,n)})),classification:{section:"sorting",tags:["simple"],exclusive:!0}},sortingItems:{type:"items",grouped:!0,show:e=>ix.hasMultipleDimensions(e)&&!ix.isAutoSort(e),items:{expression:D,numeric:Yb.numeric(`${tx.SORT_CRITERIA}.sortByNumeric`),ascii:Yb.ascii(`${tx.SORT_CRITERIA}.sortByAscii`),defaultSortMessage:{component:"text",translation:"properties.sorting.defaultSortingMessage",show:e=>!ix.isSortByExpression(e)&&!ix.isSortByNumeric(e)&&!ix.isSortByAscii(e)}}},noData:{component:"text",translation:"Common.NoData",style:"hint",show:e=>!ix.hasMultipleDimensions(e),classification:{section:"sorting",tags:["simple"]}}}};return{type:"items",component:"accordion",items:{data:{uses:"data",grouped:!0,items:{dimensions:{uses:"dimensions"},measures:{uses:"measures"}}},sorting:_,addons:S,settings:q}}}const Vx={buildDefinition:function(e,t,n,i,r){const o=`${n}.qDef.qSortCriterias.0.`,s={type:"items",translation:"properties.sorting",icon:"ascending",show:t=>Ev(t,`${e}.qDimensions.length`,0)>1,items:{sortingOptions:{component:"radio-list",type:"number",diffs:[`${o}qSortByExpression`,`${o}qSortByNumeric`,`${o}qSortByAscii`],options:[{value:1,translation:"properties.sorting.ascending"},{value:-1,translation:"properties.sorting.descending"}],setPropertyValue(e,n,s){const a=s.layout;let l=$x(e,o).chart;l||(l="sortByAscii");const c=Ev(e,t);if(c.sortCriteria||(c.sortCriteria={}),c.autoSort){const t=i(a);if(t.ELEMENT)c.elementId=t.ELEMENT;else{const t=r(e,a);c.elementId=t[0]}}c.autoSort=!1,function(e,t){const n=e.sortCriteria;"sortByNumeric"!==t&&"sortByAscii"!==t||(n.sortByExpression=0);"sortByAscii"===t&&(n.sortByNumeric=0)}(c,l),c.sortCriteria[l]=n},getValue(e){const t=$x(e,o).dimension;return t?Ev(e,o+t):0}}}};return s}};function $x(e,t){const n={chart:"",dimension:""};return 0!==Ev(e,`${t}qSortByExpression`,0)?(n.chart="sortByExpression",n.dimension="qSortByExpression"):0!==Ev(e,`${t}qSortByNumeric`,0)?(n.chart="sortByNumeric",n.dimension="qSortByNumeric"):0!==Ev(e,`${t}qSortByAscii`,0)&&(n.chart="sortByAscii",n.dimension="qSortByAscii"),n}const Wx={type:"items",component:"accordion",items:{data:{uses:"data"},sorting:Vx.buildDefinition("qHyperCubeDef","sorting","qUndoExclude.qHyperCubeDef.qDimensions.0",Tx.getSettings,Rx.getElementIds),presentation:{uses:"presentation",items:{orientation:{ref:"orientation",type:"string",component:"item-selection-list",horizontal:!0,items:[{component:"icon-item",icon:"direction_up_down",labelPlacement:"bottom",translation:"properties.orientation.vertical",value:"vertical"},{icon:"direction_left_right",component:"icon-item",labelPlacement:"bottom",translation:"Common.Horizontal",value:"horizontal"}]},bubbleScales:{type:"integer",component:"slider",ref:"dataPoint.bubbleScales",translation:"properties.dataPoints.bubbleSizes",min:20,max:100,step:5,defaultValue:100,show:e=>e.qHyperCubeDef.qMeasures.length<2&&"box"!==e.presentation.visibleComponents},jitter:{type:"string",component:"switch",ref:"dataPoint.displacement",translation:"properties.distributionPlot.jitter",defaultValue:"none",options:[{value:"none",translation:"properties.off"},{value:"jitter",translation:"properties.on"}],show:e=>"box"!==e.presentation.visibleComponents}}}}},Ux={items:{color:{uses:"color",items:{mode:{options:[{value:"auto",translation:"Common.Auto"},{value:"primary",translation:"properties.colorMode.primary"},{value:"byDimension",translation:"properties.colorMode.byDimension"}],diffs:["color.point.mode","color.point.auto"],setPropertyValue(e,t){"auto"===t?e.color.point.auto=!0:(e.color.point.auto=!1,e.color.point.mode=t)},getValue:e=>Sx.isColorAuto(e)?"auto":e.color.point.mode},dimension:{show:e=>Sx.isColorByDimension(e),items:{colorScheme:{ref:"color.point.dimensionScheme"},persistentColors:{ref:"color.point.persistent"}}},measure:{show:e=>Sx.isColorByMeasure(e),items:{sequential:{ref:"color.point.measureScheme"}}},legend:{show:Sx.showLegend}}}}};function Yx(e){var t;if(null!==(t=e.anything)&&void 0!==t&&t.sense)return{definition:Bx(e),softDefinition:Wx,support:{cssScaling:!1,snapshot:!0,export:!0,exportData:!0,sharing:!0,viewData:!0},options:{usingDerivedProperties:!0,colorByPath:"color.point"},onSoftPropertyChange(e,t){Sx.onGlobalChangeColors(t)},importProperties:(t,n,i)=>{const r=fb(e);i.mapProperties();return bb({dataDefinition:r,defaultPropertyValues:{defaultDimension:i.getDefaultDimensionProperties(),defaultMeasure:i.getDefaultMeasureProperties()},exportFormat:t,initialProperties:n})},exportProperties:(e,t,n)=>xb({propertyTree:e,viewDataMode:n})}}Tb(!0,Wx,Ux);const Xx={getChar(e){let t,n=e;return n>9?(t=65+n-10,t>90&&(t+=6)):n=`${n}`.charCodeAt(0),[48,111,79,105,73,108].indexOf(t)>-1?this.getChar(n+1):String.fromCharCode(t)},base62(e){const t=this.getChar(e%62),n=Math.floor(e/62);return n>0?this.base62(n)+t:t},id(){return this.base62(Math.round(99e11*Math.random()+1e11)).replace(/\W/g,"")}};function Kx(){return Xx.id()}const Gx="scrollbar";function Jx(e,t,n){return"y"===e?Zx(t,n):function(e){return"far"===e?"top":"bottom"}(t)}function Zx(e,t){const n=e||"near";return t&&"near"===n||!t&&"far"===n?"right":"left"}var Qx={getAxisDock:Jx,getOppositeAxisDock:function(e,t,n){return Jx(e,"far"===t?"near":"far",n)},getYAxisDock:Zx};const ew=new RegExp("[A-Za-zªµºÀ-ÖØ-öø-ʸʻ-ˁː-ˑˠ-ˤˮͰ-ͳͶ-ͽΆΈ-ϵϷ-҂Ҋ-։ः-हऻऽ-ीॉ-ौॎ-ॐक़-ॡ।-ॿং-হঽ-ীে-ৌৎ-ৡ০-ৱ৴-৺ਃ-ਹਾ-ੀਖ਼-੯ੲ-ੴઃ-હઽ-ીૉ-ૌૐ-ૡ૦-૯ଂ-ହଽ-ାୀେ-ୌୗ-ୡ୦-୷ஃ-ிு-ௌௐ-௲ఁ-ఽు-ౄౘ-ౡ౦-౯౿-ಹಽ-ೋೕ-ೡ೦-ീെ-ൌൎ-ൡ൦-ෆා-ෑෘ-ะา-ำเ-ๆ๏-ະາ-ຳຽ-ໆ໐-༗༚-༴༶༸༾-ཬཿ྅ྈ-ྌ྾-࿅࿇-ာေးျ-ြဿ-ၗၚ-ၝၡ-ၰၵ-ႁႃ-ႄႇ-ႌႎ-ႜ႞-ፚ፠-ᎏᎠ-Ᏼᐁ-ᙿᚁ-ᚚᚠ-ᜑᜠ-ᜱ᜵-ᝑᝠ-ᝰក-ាើ-ៅះ-ៈ។-៚ៜ០-៩᠐-ᢨᢪ-ᤜᤣ-ᤦᤩ-ᤱᤳ-ᤸ᥆-᧚ᨀ-ᨖᨙ-ᩕᩗᩡᩣ-ᩤᩭ-ᩲ᪀-᪭ᬄ-ᬳᬵᬻᬽ-ᭁᭃ-᭪᭴-᭼ᮂ-ᮡᮦ-ᮧ᮪-ᯥᯧᯪ-ᯬᯮ᯲-ᰫᰴ-ᰵ᰻-᱿᳓᳡ᳩ-ᳬᳮ-ᶿḀ-ᾼιῂ-ῌῐ-Ίῠ-Ῥῲ-ῼⁱⁿₐ-ₜℂℇℊ-ℓℕℙ-ℝℤΩℨK-ℭℯ-ℹℼ-ℿⅅ-ⅉⅎ-⅏Ⅰ-ↈ⌶-⍺⎕⒜-ⓩ⚬⠀-⣿Ⰰ-ⳤⳫ-ⳮⴀ-⵰ⶀ-ⷞ々-〇〡-〩〱-〵〸-〼ぁ-ゖゝ-ゟァ-ヺー-ㆺㇰ-㈜㈠-㉏㉠-㉻㉿-㊰㋀-㋋㋐-㍶㍻-㏝㏠-㏾㐀-䶵一-ꒌꓐ-ꘌꘐ-ꙮꚀ-ꛯ꛲-꛷Ꜣ-ꞇ꞉-ꠁꠃ-ꠅꠇ-ꠊꠌ-ꠤꠧ꠰-꠷ꡀ-ꡳꢀ-ꣃ꣎-꣙ꣲ-ꤥ꤮-ꥆꥒ-ꥼꦃ-ꦲꦴ-ꦵꦺ-ꦻꦽ-ꨨꨯ-ꨰꨳ-ꨴꩀ-ꩂꩄ-ꩋꩍ-ꪯꪱꪵ-ꪶꪹ-ꪽꫀꫂ-ꯤꯦ-ꯧꯩ-꯬꯰-ﬗA-Za-zヲ-ᅵ]"),tw=new RegExp("[־׀׃׆א-״߀-ߪߴ-ߵߺ-ࠕࠚࠤࠨ࠰-ࡘ࡞יִײַ-ﬨשׁ-ﭏ]"),nw=new RegExp("[؈؋؍؛-ي٭-ٯٱ-ەۥ-ۦۮ-ۯۺ-܍ܐܒ-ܯݍ-ޥޱﭐ-ﴽﵐ-﷼ﹰ-ﻼ]");function iw(e){return ew.test(e)}function rw(e){return tw.test(e)||nw.test(e)}var ow={lrm:String.fromCharCode(8206),rlm:String.fromCharCode(8207),detectTextDirection:function(e){const t=e?e.length:0;let n,i;for(n=0;n<t;n++){if(i=e[n],iw(i))return"ltr";if(rw(i))return"rtl"}return"ltr"}};var sw={lineSettings:function(e,t){var n;const i={value:0,line:{stroke:void 0!==t.paletteColor?t.theme.getColorPickerColor(t.paletteColor):"transparent",strokeDasharray:null==t||null===(n=t.style)||void 0===n?void 0:n.lineType}};return Tb(!0,i,e||{})},lineLabelSettings:function(e,t){const n=t&&t.chartID;let i=t.theme.getStyle(n,"referenceLine.label.name","color");const r=t.theme.getStyle(n,"referenceLine.label.name","fontSize"),o=t.theme.getStyle(n,"referenceLine.label.name","fontFamily");return t.paletteColor?i=t.theme.getColorPickerColor(t.paletteColor):i||(i="transparent"),Tb(!0,{value:0,line:{stroke:"transparent"},label:{align:"center",vAlign:"middle",text:"",fill:i,fontFamily:o,fontSize:r,maxWidthPx:135}},e||{})},isVisible:e=>e&&!1!==e.show&&0!==e.show&&"0"!==e.show&&void 0!==e.refLineExpr,getRefLineTitle:function({refLine:e,label:t,valueString:n}){return!1!==e.showValue?!1!==e.showLabel?`${t} ${ow.lrm}(${n})${ow.lrm}`:`${ow.lrm}(${n})${ow.lrm}`:!1!==e.showLabel?t:""}};const aw={SHOW_AXIS_LABELS_OPTIONS:["all","labels"],SHOW_TITLE_OPTIONS:["all","title"],HORIZONTAL:"horizontal",VERTICAL:"vertical",LAYOUTSETTINGS:{lasso:{displayOrder:1e4},rangeDim:{displayOrder:1e4},rangeMeasure:{displayOrder:1e4},rangeMinor:{displayOrder:1e4},scrollBar:{minimumLayoutMode:"SPARK",prioOrder:-1,displayOrder:100},refLines:{layout:{minimumLayoutMode:"SPARK",prioOrder:60,displayOrder:1110}},measureAxisTitle:{minimumLayoutMode:"XSMALL",prioOrder:30,displayOrder:90},dimensionAxisTitle:{minimumLayoutMode:"XSMALL",prioOrder:30,displayOrder:90},measureAxis:{minimumLayoutMode:"XSMALL",prioOrder:10,displayOrder:80},dimensionAxis:{minimumLayoutMode:"XSMALL",prioOrder:10,displayOrder:80},gridLines:{minimumLayoutMode:"XSMALL",displayOrder:-100},refLinesLabels:{minimumLayoutMode:"SMALL",prioOrder:60,displayOrder:0}}};aw.DEFAULT_CHART_ORIENTATION=aw.HORIZONTAL;const lw=100;function cw(e,t){const n=t||{},i=n.measureAxisProperties||{},r=n.dimensionAxisProperties||{},o=n.orientation||aw.DEFAULT_CHART_ORIENTATION,s=o===aw.HORIZONTAL,a=s?"x":"y",l=s?"y":"x",c=aw.SHOW_AXIS_LABELS_OPTIONS,u=aw.SHOW_TITLE_OPTIONS,h=c.includes(i.show),d=!!n.measureTitleText&&u.includes(i.show),f=n.includeDimensionAxis&&c.includes(r.show),p=n.includeDimensionAxis&&!!n.dimensionTitleText&&u.includes(r.show),m=n.gridlines&&!(!n.gridlines.auto&&0===n.gridlines.spacing),g=n.refLines&&n.refLines.some((e=>e.show)),y=[];if(h&&function(e,t,n,i){let r={scale:"measure",settings:t.axisLabelStyle||{},forceBounds:i&&!i.autoMinMax&&i.showBounds};r=Tb(r,aw.LAYOUTSETTINGS.measureAxis);const o=hw(t,n);e.addComponent(`${n}-axis`,r,o)}(e,n,a,i),d&&function(e,t,n){let i={text:t.measureTitleText,style:t.axisTitleStyle||{}};i=Tb(i,aw.LAYOUTSETTINGS.measureAxisTitle);const r=function(e,t){return hw(e,t)}(t,n);e.addComponent(`${n}-axis-title`,i,r)}(e,n,a),function(e,t,n,i){let r=t.measureScaleSettings;const o={isRtl:t.isRtl,source:t.measureSource,orientation:n,measureAxisProperties:i};i&&i.spacing>0&&(r=Tb(!0,r||{},{component:{ticks:{distance:i.spacing*lw}}}));e.addScale("measure-scale",r,o)}(e,n,o,i),f&&function(e,t,n){let i={scale:"dimension",settings:t.axisLabelStyle||{}};i=Tb(i,aw.LAYOUTSETTINGS.dimensionAxis);const r=dw(t,n);Tb(!0,i,t.dimensionAxisSettings||{}),e.addComponent(`${n}-axis`,i,r)}(e,n,l),p&&function(e,t,n){let i={text:t.dimensionTitleText,style:t.axisTitleStyle||{}};i=Tb(i,aw.LAYOUTSETTINGS.dimensionAxisTitle);const r=function(e,t){return dw(e,t)}(t,n);e.addComponent(`${n}-axis-title`,i,r)}(e,n,l),n.includeDimensionAxis&&function(e,t,n){const i={isRtl:t.isRtl,source:t.dimensionSource,orientation:n===aw.HORIZONTAL?aw.VERTICAL:aw.HORIZONTAL};e.addScale("dimension-scale",t.dimensionScaleSettings,i)}(e,n,o),m&&function(e,t,n){let i={ticks:{show:!0},minorTicks:{show:!t.auto&&!t.auto&&3===t.spacing}};i=Tb(i,aw.LAYOUTSETTINGS.gridLines),i[n]={scale:"measure"},e.addComponent("grid-line",i)}(e,n.gridlines,a),n.hasNavigation&&function(e,t,n,i){const r=e.getSettings();r.scroll={dimension:{viewSize:n.scrollSettings&&n.scrollSettings.viewSize||0,max:n.scrollSettings&&n.scrollSettings.max||0}};const o={isRtl:n.isRtl,chartID:n.chartID,isHorizontal:!i},s=Tb({},aw.LAYOUTSETTINGS.scrollBar);e.addComponent("scrollbar",s,o),uw(t,function(e){function t(t,n){if(!n||!e())return!1;const i={x:n.center.x-n.deltaX,y:n.center.y-n.deltaY};return this.chart.componentsFromPoint(i).some((e=>e.settings.key===Gx))}const n={type:"Tap",options:{enable:t},events:{tap(e){this.chart.component(Gx).emit("tap",e)}}},i={type:"Pan",options:{enable:t},events:{panstart(e){this.chart.component(Gx).emit("panStart",e)},pan(e){this.chart.component(Gx).emit("panMove",e)},panend(e){this.chart.component(Gx).emit("panEnd",e)},pancancel(e){this.chart.component(Gx).emit("panCancel",e)}}};return[n,i]}(n.isNavigationEnabledFn))}(e,y,n,s),g&&function(e,t,n,i){const r=Qx.getAxisDock(n,i.dock,t.isRtl);let o={key:"ref-line",style:{oob:{show:!1}},lines:{x:[],y:[]}};o=Tb(o,aw.LAYOUTSETTINGS.refLines);let s={key:`ref-line-labels-${Kx()}`,require:["renderer","chart"],dock:Qx.getOppositeAxisDock(n,i.dock,t.isRtl),preferredSize(){if("x"===n)return 26;const t=this.renderer.measureText,i=this.chart.formatter({data:e.settings.scales.measure.data}),r=s.lines.y.map((e=>{const n=!1!==e.label.showValue?`(${i(e.value)})`:"",r=`${e.label.text} ${n}`,o=e.label.text&&n?` ${n}`:n;return{wanted:t({text:r,fontSize:e.fontSize,fontFamily:e.fontFamily}).width,required:t({text:o,fontSize:e.fontSize,fontFamily:e.fontFamily}).width}})),o=r[0];for(let e=1;e<r.length;e++)r[e].wanted>o.wanted&&(o.wanted=r[e].wanted),r[e].required>o.required&&(o.required=r[e].required);const a=12;return o.required+a>100?o.required+a:Math.min(o.wanted+a,100)},lines:{x:[],y:[]}};s=Tb(s,aw.LAYOUTSETTINGS.refLinesLabels),t.refLines.forEach((i=>{if(!i.show)return;const a=i.refLineExpr&&i.refLineExpr.value,l=Tb(!0,{},t,{paletteColor:i.paletteColor,style:i.style,chartID:e.options.chartID}),c=sw.lineSettings({scale:"measure",dir:n,value:a},l);o.lines[n].push(c);const u=sw.lineLabelSettings({scale:"measure",value:a,label:{text:!1!==i.showLabel?i.label:"",showValue:!1!==i.showValue}},l);"x"===n?u.label.vAlign="near"===r?1:0:u.label.align="near"===r?0:1,s.lines[n].push(u)})),e.addComponent("ref-line",o,{}),e.addComponent("ref-line",s,{})}(e,n,a,i),n.enableLasso&&n.selectionsEnabled){!function(e,t){const n={brushKey:t.brushKey,brushComponents:t.brushComponents,brushData:t.brushData};e.addComponent("lasso",aw.LAYOUTSETTINGS.lasso,n)}(e,n.lasso||{})}if(n.enableDimRange&&n.includeDimensionAxis&&n.selectionsEnabled){!function(e,t,n,i,r){let o={key:"rangeDim"};o=Tb(o,aw.LAYOUTSETTINGS.rangeDim);const s={brushKey:t.brushKey,brushAxis:t.brushAxis,brushArea:t.brushArea,brushScale:t.brushScale,isHorizontal:!n,dock:i,isRtl:r};e.addComponent("range",o,s)}(e,n.dimRange||{},s,dw(n,l).dock,n.isRtl)}if(n.enableMeasureRange&&n.selectionsEnabled){!function(e,t,n,i,r){let o={key:"rangeMeasure"};o=Tb(o,aw.LAYOUTSETTINGS.rangeMeasure);const s={brushKey:t.brushKey,brushAxis:t.brushAxis,brushArea:t.brushArea,brushScale:t.brushScale,multiple:t.multiple,isHorizontal:n,dock:i,isRtl:r};e.addComponent("range",o,s)}(e,n.measureRange||{},s,hw(n,a).dock,n.isRtl)}if(n.enableAreaRange&&n.selectionsEnabled){!function(e,t,n,i,r){let o={key:"rangeMinor"};o=Tb(o,aw.LAYOUTSETTINGS.rangeMinor);const s={brushKey:t.brushKey,brushAxis:t.brushAxis,brushData:t.brushData,brushArea:t.brushArea,brushComponents:t.brushComponents,brushScale:t.brushScale,multiple:t.multiple,isHorizontal:"measure"===t.brushScale?n:!n,dock:i,isRtl:r,chartInstance:t.chartInstance};e.addComponent("range-area",o,s)}(e,n.areaRange||{},s,dw(n,l).dock,n.isRtl)}n.brushActions&&uw(y,n.brushActions),y.length&&function(e,t){e.addInteraction({},{gestures:t})}(e,y)}function uw(e,t){t.forEach((t=>{e.push(t)}))}function hw(e,t){return{dock:e.measureAxisProperties&&e.measureAxisProperties.dock,direction:t,isRtl:e.isRtl}}function dw(e,t){return{dock:e.dimensionAxisProperties&&e.dimensionAxisProperties.dock,direction:t,isRtl:e.isRtl}}function fw(e,t){const n=t||{},i=!n.orientation||"horizontal"===n.orientation,r=!!n.isRtl,o={name:n.name||"scale",component:{invert:i&&r,minorTicks:{count:1},range:n.range||void 0,domain:n.domain||void 0,trackBy:n.trackBy||"id"}};return Tb(!0,{},o,e||{})}function pw(e,t){const n=t&&t.chartID,i=t&&t.dock,r=t&&t.direction,o=t&&t.isRtl,s=t.theme.getStyle(n,"axis.line.major","color"),a=t.theme.getStyle(n,"axis.title","fontSize"),l=t.theme.getStyle(n,"axis.title","color"),c=t.theme.getStyle(n,"axis.label.name","color"),u=t.theme.getStyle(n,"axis.label.name","fontSize"),h=t.theme.getStyle(n,"axis.title","fontFamily"),d=t.theme.getStyle(n,"axis.label.name","fontFamily"),f={key:"axis",type:"axis",dock:Qx.getAxisDock(r,i,o),brush:{trigger:[],consume:[]},settings:{title:{fontSize:a,fontFamily:h,fill:l},line:{show:!0,strokeWidth:1,stroke:s},labels:{fill:c,fontSize:u,fontFamily:d,tiltAngle:o?-40:40,maxEdgeBleed:75,maxSize:150,mode:"auto"},ticks:{stroke:s},minorTicks:{stroke:s}}},p=Tb(!0,{},f,e||{});return p.brush.consume.forEach((e=>{e.style.active.strokeWidth=0})),p}function mw(e,t){const n=t&&t.chartID,i=t&&t.dock,r=t&&t.direction,o=t&&t.isRtl,s=t.theme.getStyle(n,"axis.title","fontSize"),a=t.theme.getStyle(n,"axis.title","color"),l=t.theme.getStyle(n,"axis.title","fontFamily"),c={key:"text",type:"text",dock:Qx.getAxisDock(r,i,o)||"bottom",displayOrder:0,style:{text:{fontSize:s,fontFamily:l,fill:a}}};return Tb(!0,{},c,e||{})}fw.measureScale=function(e,t){let n=(t||{}).source||[];"string"==typeof n&&(n=[n]);const i={name:"measure",component:{expand:.1,data:{fields:n.map((e=>({field:e})))}}},r=t&&t.measureAxisProperties;r&&!r.autoMinMax&&(["min","minMax"].includes(r.minMax)&&(i.component.min=r.min),["max","minMax"].includes(r.minMax)&&(i.component.max=r.max));const o=fw(Tb(!0,i,e||{}),t);return!(e&&e.component&&void 0!==e.component.invert)&&t&&"vertical"===t.orientation&&(o.component.invert=!o.component.invert),o},fw.dimensionScale=function(e,t){const n={name:"dimension",component:{trackBy:"id",type:"band",data:{extract:{field:t&&t.source||"",props:{label:e=>e.qText||""}}},label:e=>e.datum.label.value}};return fw(Tb(!0,n,e||{}),t)},pw.xAxis=function(e,t){return pw(Tb(!0,{key:"x-axis",scale:"x"},e||{}),t)},pw.yAxis=function(e,t){const n=t&&t.dock,i=t&&t.isRtl,r={key:"y-axis",scale:"y",dock:Qx.getYAxisDock(n,i)};return pw(Tb(!0,r,e||{}),t)},mw.xAxisTitle=function(e,t){return mw(Tb(!0,{key:"x-axis-title"},e||{}),t)},mw.yAxisTitle=function(e,t){const n=t&&t.dock,i=t&&t.isRtl,r={key:"y-axis-title",dock:Qx.getYAxisDock(n,i)||"left"};return mw(Tb(!0,r,e||{}),t)};var gw={getBublesAlign:function(e,t,n){let i=e&&"far"!==t||!e&&"far"===t;return!e&&n&&(i=!i),i?"start":"end"},getDock:function(e,t){const n=[];let i;return e&&n.push(`@${e}`),t&&n.push(`@${t}`),n.length&&(i=n.join(",")),i}};const yw={SPARK:{width:0,height:0},XSMALL:{width:150,height:75},SMALL:{width:300,height:150},MEDIUM:{width:400,height:220},FULL:{width:550,height:450}};function vw(){return yw}function bw(e){const t=e.data.end;return e.dataset(t.source.key).field(t.source.field).formatter()(t.value)}vw.getLayoutModeKeys=function(){const e=[];let t;for(t in yw)e.push(t);return e};const xw={left:"left",right:"right",up:"top",down:"bottom"};function ww(e,t,n){switch(e){case"scale":return fw(t,n);case"measure-scale":return fw.measureScale(t,n);case"dimension-scale":return fw.dimensionScale(t,n);case"axis":return pw(t,n);case"box-marker":return function(e){return Tb(!0,{},{key:"box-marker",type:"box-marker",settings:{minor:{scale:"x"},orientation:"horizontal"},brush:{trigger:[],consume:[]}},e||{})}(t);case"point-marker":return function(e){return Tb(!0,{},{key:"point-marker",type:"point-marker",settings:{},brush:{trigger:[],consume:[]}},e||{})}(t);case"scrollbar":return function(e,t){const n=t&&t.isRtl,i=t&&t.chartID,r=t&&t.isHorizontal,o={key:"scrollbar",type:"scrollbar",scroll:"dimension",dock:r?"bottom":n?"left":"right",settings:{backgroundColor:t.theme.getStyle(i,"","backgroundColor"),invert:n&&r}};return Tb(!0,{},o,e||{})}(t,n);case"text":return mw(t,n);case"lasso":return function(e,t){const n=t&&t.brushKey,i=t&&t.brushComponents?t.brushComponents:[],r=t&&t.brushData?t.brushData:["elemNo"],o={type:"brush-lasso",key:"lasso",displayOrder:99,settings:{brush:{components:[]},lasso:{fill:"rgba(0, 0, 0, 0)",stroke:"rgba(102,102,102,1)",strokeWidth:2,opacity:1,strokeDasharray:null},startPoint:{r:10,fill:"rgba(0, 152, 69, 1)",strokeWidth:0,opacity:1}}};return i.forEach((e=>{o.settings.brush.components.push({contexts:n?[n]:void 0,key:e,data:r})})),Tb(!0,{},o,e||{})}(t,n);case"range":return function(e,t){const n=t&&t.brushKey,i=t&&t.brushAxis,r=t&&t.brushArea,o=t&&t.brushScale,s=t&&t.isHorizontal,a=t&&t.dock,l=t&&t.isRtl,c={type:"brush-range",key:"range",displayOrder:99,dock:gw.getDock(i,r),settings:{brush:n,fill:"rgba(0, 0, 0, 0)",scale:o,multiple:!t||!1!==t.multiple||t.multiple,direction:s?"horizontal":"vertical",target:{component:i,fill:"rgba( 82, 204, 82, 0.2 )",fillActive:"rgba(82, 204, 82, 0.4)"},bubbles:{align:gw.getBublesAlign(s,a,l)}}};return Tb(!0,{},c,e||{})}(t,n);case"range-area":return function(e,t){const n=t&&t.brushKey,i=t&&t.brushAxis,r=t&&t.brushComponents?t.brushComponents:[],o=t&&t.brushData?t.brushData:["elemNo"],s=t&&t.brushArea,a=t&&t.isHorizontal,l=t&&t.dock,c=t&&t.isRtl,u=t&&t.chartInstance;let h=!0;const d={type:"brush-area-dir",key:"area",displayOrder:99,dock:gw.getDock(i,s),settings:{brush:{components:[]},direction:a?"horizontal":"vertical",target:{component:i,fill:"rgba( 82, 204, 82, 0.2 )",fillActive:"rgba(82, 204, 82, 0.4)"},bubbles:{align:gw.getBublesAlign(a,l,c),label:e=>h?(h=!1,u.dataset(e.binStart.source.key).field(e.binStart.source.field).formatter()(e.binStart.value)):(h=!0,u.dataset(e.binEnd.source.key).field(e.binEnd.source.field).formatter()(e.binEnd.value))},multiple:!t||!1!==t.multiple||t.multiple}};return r.forEach((e=>{d.settings.brush.components.push({contexts:n?[n]:void 0,key:e,data:o,action:"add"})})),Tb(!0,{},d,e||{})}(t,n);case"categorical-legend":return function(e,t){const n=t&&t.chartID,i=t&&t.isRtl;let r=t&&t.dock||"auto";const o=t&&t.show;"auto"===r&&(r=t.chartHeight/t.chartWidth<1?i?"left":"right":"bottom");const s=t.theme.getStyle(n,"legend.title","color"),a=t.theme.getStyle(n,"legend.title","fontSize"),l=t.theme.getStyle(n,"legend.label","color"),c=t.theme.getStyle(n,"legend.label","fontSize"),u=t.theme.getStyle(n,"legend.title","fontFamily"),h={key:"legend",type:"legend-cat",dock:r,show:o,scale:{type:"color"},settings:{title:{anchor:"middle"},layout:{direction:i?"rtl":"ltr",size:"top"===r||"bottom"===r?2:1,vertical:"top"===r||"bottom"===r?16:8},navigation:{button:{class:{"lui-fade-button":!0},content:(e,t)=>e("span",{style:{pointerEvents:"none"},class:["lui-button__icon","lui-icon",`lui-icon--triangle-${xw[t.direction]}`].join(" ")})}}},style:{item:{label:{fontSize:c,fontFamily:t.theme.getStyle(n,"legend.label","fontFamily"),fill:l,lineHeight:1,wordBreak:"break-word"},margin:{top:5,left:10,right:10,bottom:10},shape:{type:t.type?t.type:"square",size:3*parseInt(c,10)/4}},title:{show:t.showTitle,fontSize:a,fontFamily:u,fill:s}}};return Tb(!0,{},h,e)}(t,n);case"sequential-legend":return function(e,t){const n=t&&t.chartID,i=t&&t.isRtl;let r=t.dock||"auto";"auto"===r&&(r=t.chartHeight<t.chartWidth?i?"left":"right":"bottom");const o=t.theme.getStyle(n,"legend.title","color"),s=t.theme.getStyle(n,"legend.title","fontSize"),a=t.theme.getStyle(n,"legend.title","fontFamily"),l=t.theme.getStyle(n,"legend.label","color"),c=t.theme.getStyle(n,"legend.label","fontSize"),u=t.theme.getStyle(n,"legend.label","fontFamily");function h(e){switch(e){case"left":return 0;case"right":return 1;default:return.5}}const d={key:"seqlegend",type:"legend-seq",dock:r,displayOrder:200,minimumLayoutMode:"MEDIUM",prioOrder:0,settings:{align:h(i?"right":"left"),major:{invert:"left"===r||"right"===r||i},title:{show:t.showTitle,fontSize:s,fontFamily:a,fill:o},tick:{fill:l,fontSize:c,fontFamily:u}}};return Tb(!0,{},d,e)}(t,n);case"x-axis":return pw.xAxis(t,n);case"y-axis":return pw.yAxis(t,n);case"x-axis-title":return mw.xAxisTitle(t,n);case"y-axis-title":return mw.yAxisTitle(t,n);case"grid-line":return function(e,t){const n=t&&t.chartID,i=t.theme.getStyle(n,"grid.line.major","color");return Tb(!0,{},{displayOrder:-1,key:"grid-line",type:"grid-line",x:null,y:null,ticks:{stroke:i},minorTicks:{stroke:i}},e||{})}(t,n);case"interaction":return function(e,t){const n=t&&t.gestures||[];return Tb(!0,{},{type:"hammer",key:"hammered",gestures:n},e||{})}(t,n);case"ref-line":return function(e,t){const n=t&&t.chartID,i=t.theme.getStyle(n,"referenceLine.outOfBounds","color"),r=t.theme.getStyle(n,"referenceLine.outOfBounds","backgroundColor");return Tb(!0,{},{key:"ref-line",type:"ref-line",dock:"center",prioOrder:-1,lines:{x:[],y:[]},style:{oob:{width:7,fill:r,text:{fill:i},padding:{x:7,y:5}}}},e||{})}(t,n);case"event-area":return function(e){return Tb(!0,{},{type:"event-area",key:"event-area"},e||{})}(t);case"labels":return function(e,t){const n=t&&t.chartID,i=t.theme.getStyle(n,"label.value","color"),r=t.theme.getStyle(n,"label.value","fontSize"),o={key:"labels",type:"labels",displayOrder:1,settings:{sources:[{component:"box-marker",selector:"rect",strategy:{type:"bar",settings:{direction:"up",fontFamily:t.theme.getStyle(n,"label.value","fontFamily"),fontSize:parseFloat(r),align:.5,labels:[{placements:[{position:"outside",fill:i,justify:0},{position:"inside",fill:e&&e.settings.sources[0].strategy.settings.labels[0].placements[1].fill,justify:1}],label:bw}]}}}]}};return Tb(!0,{},o,e||{})}(t,n);default:return}}function qw(e){this.options=e||{},this.settings={dockLayout:{layoutModes:vw()},components:[],scales:{}}}qw.prototype.addComponent=function(e,t,n){const i=ww(e,t,Tb(!0,{},this.options,n||{}));return this.settings.components.push(i),i},qw.prototype.addInteraction=function(e,t){const n=ww("interaction",e,Tb(!0,{},this.options,t||{}));return this.settings.interactions||(this.settings.interactions=[]),this.settings.interactions.push(n),n},qw.prototype.addScale=function(e,t,n){const i=ww(e,t,Tb(!0,{},this.options,n||{}));this.settings.scales[i.name]=i.component},qw.prototype.getSettings=function(){return this.settings},qw.prototype.getComponent=function(e){return this.settings.components.filter((t=>t.key===e))[0]},qw.prototype.addPreset=function(e,t){!function(e,t,n){if("dimension-measure-chart"!==e)throw Error("There is no chart preset with that type");cw(t,n)}(e,this,t)},qw.validateComponentKeys=function(e){const t={};return e.map((e=>{const n=e.key;return n?t[n]?`Duplicate key for component ${e.type}`:(t[n]=!0,null):`Missing key for component ${e.type}`})).filter((e=>!!e))},qw.create=function(e){return new qw(e)},qw.createComponent=ww;const Sw={CENTER:0,BOTTOM:1};var Mw={DISCLAIMERS:[{label:"NoDataExist",alignment:Sw.CENTER,default:!0},{label:"RequireNumericDimension",alignment:Sw.CENTER,default:!1},{label:"OnlyNanData",alignment:Sw.CENTER,default:!0},{label:"OnlyNegativeOrZeroValues",alignment:Sw.CENTER,default:!1},{label:"LimitedData",alignment:Sw.BOTTOM,default:!1},{label:"OnlyNanColor",alignment:Sw.BOTTOM,default:!1},{label:"NegativeOrZeroValues",alignment:Sw.BOTTOM,default:!1},{label:"DataRangeIncludingZero",alignment:Sw.BOTTOM,default:!1}],ALIGNMENT:Sw};const Dw={getNoDataExistAttribute:e=>e.qSize.qcy*e.qSize.qcx==0,getLimitedDataAttribute(e,t){let n,i=!1;var r;return e?void 0!==t.explicitLimitedData?i=!0===t.explicitLimitedData:e.qDataPages&&e.qDataPages[0]?i=!t.paging&&e.qSize.qcy>e.qDataPages[0].qMatrix.length:(r=e.qStackedDataPages)&&r[0]&&r[0].qData[0]&&r[0].qData[0].qSubNodes&&(n=t.maxNbrOfDimensions?t.maxNbrOfDimensions:2,i=e.qDimensionInfo.length>=n?e.qStackedDataPages[0].qData[0].qSubNodes.some((e=>e.qDown>0)):e.qStackedDataPages[0].qData[0].qSubNodes.length<e.qStackedDataPages[0].qArea.qHeight):i=!0===t.explicitLimitedData,i},getNegativeOrZeroValuesAttribute:(e,t)=>!t.supportNegative&&e.qMeasureInfo.some((e=>e.qMin<=0)),getOnlyNegativeOrZeroValuesAttribute:(e,t)=>!t.supportNegative&&e.qMeasureInfo.every((e=>e.qMax<=0&&e.qMax>=e.qMin))||0===e.qSize.qcy,getOnlyNanDataAttribute:(e,t)=>void 0!==t.explicitOnlyNanData?t.explicitOnlyNanData:e.qMeasureInfo.every((e=>e.qMax<e.qMin||"NaN"===e.qMax)),getDataRangeIncludingZeroAttribute:(e,t)=>!t.supportRangeOverZero&&function(e,t){const n=t.length;let i,r,o,s,a;for(e&&(r=!(e.autoMinMax||"min"!==e.minMax&&"minMax"!==e.minMax||null===e.min||Number.isNaN(+e.min)),o=!(e.autoMinMax||"max"!==e.minMax&&"minMax"!==e.minMax||null===e.max||Number.isNaN(+e.max))),s=Number.MAX_VALUE,a=-Number.MAX_VALUE,i=0;i<n;i++)if(s=Math.min(s,t[i].qMin),a=Math.max(a,t[i].qMax),s<=0&&a>=0)return!0;return s=r?e.min:s,a=o?e.max:a,s<=0&&a>=0}(e.measureAxis,e.qHyperCube.qMeasureInfo),applyAttributes(e,t){const n=e||{},i={};return n.supportNegative=void 0===n.supportNegative||n.supportNegative,n.supportRangeOverZero=void 0===n.supportRangeOverZero||n.supportRangeOverZero,Mw.DISCLAIMERS.forEach((e=>{i[e.label]=!1})),t&&t.qHyperCube?(i.NoDataExist=this.getNoDataExistAttribute(t.qHyperCube),i.NoDataExist?i:(i.RequireNumericDimension=n.explicitRequireNumericDimension,i.RequireNumericDimension||(i.LimitedData=this.getLimitedDataAttribute(t.qHyperCube,n),i.NegativeOrZeroValues=this.getNegativeOrZeroValuesAttribute(t.qHyperCube,n),i.OnlyNegativeOrZeroValues=this.getOnlyNegativeOrZeroValuesAttribute(t.qHyperCube,n),i.OnlyNanData=this.getOnlyNanDataAttribute(t.qHyperCube,n),i.DataRangeIncludingZero=this.getDataRangeIncludingZeroAttribute(t,n)),i)):i}};function _w(e,t,n){this.disclaimersConfig=e,this.dataAttributes=t,this.supportedDisclaimers=n}function Cw(e,t){return e&&t&&t[e]}function kw(e){this.environment=e,this.clear()}_w.prototype.isValidAndSupported=function(e,t){return Cw(e.label,this.dataAttributes)&&(e.default||Cw(e.label,this.supportedDisclaimers))&&void 0!==t&&e.alignment===t},_w.prototype.isAnyValidDisclaimer=function(e){let t=!1;const n=this;return this.disclaimersConfig.forEach((i=>{n.isValidAndSupported(i,e)&&(t=!0)})),t},_w.prototype.getMessage=function(e,t){let n="";const i=this;return t&&this.disclaimersConfig.forEach((r=>{i.isValidAndSupported(r,e)&&(n+=`${t.get(`Object.Disclaimer.${r.label}`)} `)})),n},kw.ERRORS={SET:"Calling Disclaimer.set() without attributes",DISPLAY:"Calling Disclaimer.display() before attributes are applied"},kw._applyDefaultSupport=function(e,t){let n=e;return n||(n={}),t.forEach((e=>{void 0===n[e.label]&&(n[e.label]=e.default)})),n},kw.prototype.getComponentSettings=function(){var e,t;const{translator:n}=this.environment,i=Tb(!0,{},this.vizAttributes.supportedDisclaimers),r=new _w(Mw.DISCLAIMERS,this.dataAttributes,i);let o,s;if(r.isAnyValidDisclaimer(Mw.ALIGNMENT.CENTER))o=r.getMessage(Mw.ALIGNMENT.CENTER,n),s="center";else{if(!r.isAnyValidDisclaimer(Mw.ALIGNMENT.BOTTOM))return;o=r.getMessage(Mw.ALIGNMENT.BOTTOM,n),s="bottom"}return{key:"disclaimer",type:"disclaimer",layout:{displayOrder:1e3,dock:s},settings:{label:o,rtl:"rtl"===(null===(e=this.environment)||void 0===e||null===(t=e.options)||void 0===t?void 0:t.direction)}}},kw.prototype.set=function(e){if(this.clear(),!e)throw new Error(kw.ERRORS.SET);this.vizAttributes=e,this.dataAttributes=Dw.applyAttributes(this.vizAttributes.options,this.vizAttributes.data)},kw.prototype.clear=function(){this.vizAttributes=null,this.dataAttributes=null};const Ew=Gv.extend({init(e,t,n,i,r){this.$element=t,this.environment=n,this.backendApi=i,this._selectionsApi=r,this._on=!1,this._disclaimer=new kw(n),this._dataPaths=["qHyperCube"];const o=this;this.picassoElement=t[0],this.picassoElement.className+=" picasso-chart",this.chartInstance=e.chart({element:this.picassoElement,settings:{components:[qw.createComponent("event-area",{mounted(e){o.dataAreaElem=e}})]}})},updateEnvironment(e){this.environment=e},isRtl(){var e;return"rtl"===(null===(e=this.environment.options)||void 0===e?void 0:e.direction)},setDataPaths(e){this._dataPaths=e},getData:(e,t,n)=>function(e,t,n){let i,r={qTop:0,qLeft:0,qWidth:t.qSize.qcx,qHeight:1e4/t.qSize.qcx};if(n){const e=n.width||t.qSize.qcx,i=Math.floor(1e4/e);r={qTop:n.top||0,qLeft:n.left||0,qWidth:e,qHeight:n.height?Math.min(n.height,i):i}}else r={qTop:0,qLeft:0,qWidth:t.qSize.qcx,qHeight:1e4/t.qSize.qcx};i="K"===t.qMode?"qStackedDataPages":"qDataPages";return e.getData([r],null,t).then((e=>{t[i]=e}))}(e,t,n),hasValidData:()=>!0,paint(){if(this.hasValidData()){var e;this._disclaimer.set(this.getDisclaimerAttributes(this.layout));const t=this._disclaimer.getComponentSettings(),n="center"===(null==t||null===(e=t.layout)||void 0===e?void 0:e.dock),i=this.createChartSettings(this.layout);n?i.components=[t]:t&&i.components.push(t),qw.validateComponentKeys(i.components).forEach((e=>{console.error(e)})),this.updateChart(this.layout,i),this._painted=!0}return Promise.resolve()},resize(){if(this.layout)return this.paint()},createChartSettings(){throw new Error('Subclass must implement "createChartSettings" function')},addSnapshotChartSettings(e,t){const{freeResize:n}=this.environment.options;!n&&t.snapshotData&&(e.dockLayout.logicalSize={width:t.snapshotData.content.size.w,height:t.snapshotData.content.size.h,preserveAspectRatio:!0})},updateData(e){return this._destroyed?Promise.reject():(this.layout=Tb(!0,{},e),this.layout.permissions=e.permissions,Promise.resolve())},updateChart(e,t,n){var i,r;const o=null!==(i=null===(r=this.environment.appLayout)||void 0===r?void 0:r.qLocaleInfo)&&void 0!==i?i:{},s=this._dataPaths.map((t=>({type:"q",key:t,config:{localeInfo:o},data:Ev(e,t.replace(/\//g,"."))})));this.colorService&&s.push(...this.colorService.getData()),this.chartInstance.update({data:s,settings:t,partialData:n});this.picassoElement.setAttribute("data-state",2)},destroy(){this._destroyed=!0,this.off(),this.chartInstance.destroy()},getViewState:()=>({}),isLassoDisabled:()=>!0,setSnapshotData(e){e.snapshotData||(e.snapshotData={}),e.snapshotData.content={chartData:{},size:{w:this.$element.width(),h:this.$element.height()}}},getDisclaimerAttributes:e=>({data:e})});function Aw(e){let t=0;if(!e||!e.length)return t;for(let n=0;n<e.length;n++){t=(t<<5)-t+e.charCodeAt(n),t&=t}return t}const Tw={generateHash:function(e){return Aw(JSON.stringify(e))},updateHash:function(e,t){e.qUndoExclude||(e.qUndoExclude={});e.qUndoExclude.hashCode=Tw.generateHash(t)}};const Iw={getDefaultHashDataForHyperCube:function(e,t,n){return function(e,t){const n=[];if(!e.qMeasures)return Promise.resolve(n);return e.qMeasures.forEach((e=>{e.qLibraryId?n.push(function(e,t){return t.getMeasure(e).then((e=>e.getProperties().then((e=>e.qMeasure.qDef))))}(e.qLibraryId,t)):n.push(Promise.resolve())})),Promise.all(n)}(e,n).then((e=>({drillLevel:Ow(t),dimensionExpressions:Rw(t),measureExpressions:e})))}};function Rw(e){return e.qDimensionInfo.map((e=>e.qGroupFieldDefs))}function Ow(e){const t=function(e){return Ev(e,"qDimensionInfo",[])}(e);return t.map((e=>e.qGroupPos))}const Nw={},Pw=Tb.bind(null,!0);function Lw(e){return null!=e&&!Array.isArray(e)&&"object"==typeof e}const Fw=Array.isArray,zw=function(e){return void 0===e},jw=function(e){return"function"==typeof e};function Hw(e,t){return jw(e[t])||"$$"===t.substring(0,2)||"_"===t.substring(0,1)}function Bw(e,t){const n=t.substring(1).split("/").slice(0,-1);let i;return n.forEach(((t,r)=>{r!==n.length&&(i=+t,e[i||t]=zw(e[i||t])?Number.isNaN(+i)?{}:[]:e[t],e=e[i||t])})),e}function Vw(e,t){if(Lw(e)&&Lw(t)){if(Object.keys(e).length!==Object.keys(t).length)return!1;for(const n of Object.keys(e))if(!Vw(e[n],t[n]))return!1;return!0}if(Fw(e)&&Fw(t)){if(e.length!==t.length)return!1;for(let n=0,i=e.length;n<i;n++)if(!Vw(e[n],t[n]))return!1;return!0}return e===t}Nw.generate=function(e,t,n){n=n||"";let i=[];return Object.keys(t).forEach((r=>{const o=function(e){return e&&(e=Pw({},{val:e}).val),e}(t[r]),s=e[r],a=`${n}/${r}`;Vw(o,s)||Hw(t,r)||(zw(s)?i.push({op:"add",path:a,value:o}):Lw(o)&&Lw(s)?i=i.concat(Nw.generate(s,o,a)):Fw(o)&&Fw(s)?i=i.concat(function(e,t,n){let i=[];const r=e.slice();let o,s,a=-1;function l(e,t,n){if(e[n]&&zw(e[n].qInfo))return null;if(e[n]&&e[n].qInfo.qId===t)return n;for(let n=0,i=e.length;n<i;n++)if(e[n]&&e[n].qInfo.qId===t)return n;return-1}if(Vw(t,r))return i;if(null===t[0]||!zw(t[0])&&zw(t[0].qInfo))return i.push({op:"replace",path:n,value:t}),i;for(o=r.length-1;o>=0;--o)a=l(t,r[o]&&r[o].qInfo&&r[o].qInfo.qId,o),-1===a?(i.push({op:"remove",path:`${n}/${o}`}),r.splice(o,1)):i=i.concat(Nw.generate(r[o],t[a],`${n}/${o}`));for(o=0,s=t.length;o<s;++o)a=l(r,t[o]&&t[o].qInfo&&t[o].qInfo.qId),-1===a?(i.push({op:"add",path:`${n}/${o}`,value:t[o]}),r.splice(o,0,t[o])):a!==o&&(i.push({op:"move",path:`${n}/${o}`,from:`${n}/${a}`}),r.splice(o,0,r.splice(a,1)[0]));return i}(s,o,a)):i.push({op:"replace",path:`${n}/${r}`,value:o}))})),Object.keys(e).forEach((r=>{zw(t[r])&&!Hw(e,r)&&i.push({op:"remove",path:`${n}/${r}`})})),i},Nw.apply=function(e,t){t.forEach((t=>{const n=Bw(e,t.path);let i=t.path.split("/").splice(-1)[0];const r=i&&Number.isNaN(+i)?n[i]:n[+i]||n,o=t.from?t.from.split("/").splice(-1)[0]:null;if("add"===t.op||"replace"===t.op)if(Fw(n))"-"===i&&(i=n.length),n.splice(+i,"add"===t.op?0:1,t.value);else if(Fw(r)&&Fw(t.value)){const e=t.value.slice();r.length=0,r.push.apply(r,e)}else Lw(r)&&Lw(t.value)?(s=r,Object.keys(s).forEach((e=>{Object.getOwnPropertyDescriptor(s,e).configurable&&!Hw(s,e)&&delete s[e]})),Pw(r,t.value)):n[i]=t.value;else if("move"===t.op){const r=Bw(e,t.from);Fw(n)?n.splice(+i,0,r.splice(+o,1)[0]):(n[i]=r[o],delete r[o])}else"remove"===t.op&&(Fw(n)?n.splice(+i,1):delete n[i]);var s}))},Nw.clone=function(e){return Pw({},e)},Nw.createPatch=function(e,t,n){const i={op:e.toLowerCase(),path:n};return"move"===i.op?i.from=t:void 0!==t&&(i.value=t),i},Nw.updateObject=function(e,t){Object.keys(e).length?Nw.apply(e,Nw.generate(e,t)):Pw(e,t)};class $w{constructor(e){this._model=e}setModel(e){this._model=e}saveSoftProperties(e,t){if(!this._model)return Promise.resolve(!1);let n=Nw.generate(e,t);return Tb(!0,e,t),n&&n.length?(n=n.map((e=>({qOp:e.op,qValue:JSON.stringify(e.value),qPath:e.path}))),this._model.applyPatches(n,!0).then((()=>!0))):Promise.resolve(!1)}async mergeSoftPatches(){if(!this._model)return;const e=this._model.getProperties(),t=this._model.getEffectiveProperties(),n=await e,i=await t;if(n.qExtendsId)return;const r=Nw.generate(n,i);Nw.apply(n,r);const o=this;o._model.setProperties(n).then((()=>{o._model.clearSoftPatches()}))}}var Ww={canModifyHardProperties:function(e){if(e.qHasSoftPatches||e.qExtendsId)return!1;if(e.permissions)return e.permissions.update;return-1!==e.qMeta.privileges.indexOf("update")}};var Uw={saveDerivedProperties:function(e,t,n,i){if(Ww.canModifyHardProperties(t))return e.setProperties(n);return new $w(e).saveSoftProperties(i,n)}};var Yw={validate:function(e){if(!(e&&e.layout&&e.properties&&e.model&&e.hashData&&e.generateDerivedProperties))throw Error("Derived-properties: Missing input")}};function Xw(){this._generationInProgress=!1}function Kw(e){Yw.validate(e);const t=e.properties,n=Tw.generateHash(e.hashData);return!(!t.qUndoExclude||t.qUndoExclude.hashCode!==n)}Xw.prototype.isDerivedUpToDate=Kw,Xw.prototype.updateDerivedProperties=function(e){if(Yw.validate(e),this._generationInProgress)return Promise.resolve(!0);if(Kw(e)){const t=e.layout.qUndoExclude&&e.layout.qUndoExclude.hashCode===e.properties.qUndoExclude.hashCode;return Promise.resolve(!t)}const t=this,n=e.model,i=e.layout,r=Tb(!0,{},e.properties),o=Tb(!0,{},r);return this._generationInProgress=!0,Tw.updateHash(r,e.hashData),e.generateDerivedProperties(i,r).then((()=>Uw.saveDerivedProperties(n,i,r,o).then((()=>(t._generationInProgress=!1,Promise.resolve(!0))))))},Xw.prototype.addDefaultHyperCubeHash=function(e,t,n,i){return Iw.getDefaultHashDataForHyperCube(e,t,n).then((e=>Tb(!0,i,e)))};var Gw={exports:{}};!function(e,n){e.exports=function(){function e(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,i)}return n}function n(t){for(var n=1;n<arguments.length;n++){var r=null!=arguments[n]?arguments[n]:{};n%2?e(Object(r),!0).forEach((function(e){i(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):e(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function i(e,t,n){return(t=o(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function r(e,t){if("object"!=typeof e||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var i=n.call(e,t||"default");if("object"!=typeof i)return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}function o(e){var t=r(e,"string");return"symbol"==typeof t?t:String(t)}var s=Object.prototype.hasOwnProperty,a=Object.prototype.toString,l=Object.defineProperty,c=Object.getOwnPropertyDescriptor,u=function(e){return"function"==typeof Array.isArray?Array.isArray(e):"[object Array]"===a.call(e)},h=function(e){if(!e||"[object Object]"!==a.call(e))return!1;var t,n=s.call(e,"constructor"),i=e.constructor&&e.constructor.prototype&&s.call(e.constructor.prototype,"isPrototypeOf");if(e.constructor&&!n&&!i)return!1;for(t in e);return void 0===t||s.call(e,t)},d=function(e,t){l&&"__proto__"===t.name?l(e,t.name,{enumerable:!0,configurable:!0,value:t.newValue,writable:!0}):e[t.name]=t.newValue},f=function(e,t){if("__proto__"===t){if(!s.call(e,t))return;if(c)return c(e,t).value}return e[t]},p=function e(){var t,n,i,r,o,s,a=arguments[0],l=1,c=arguments.length,p=!1;for("boolean"==typeof a&&(p=a,a=arguments[1]||{},l=2),(null==a||"object"!=typeof a&&"function"!=typeof a)&&(a={});l<c;++l)if(null!=(t=arguments[l]))for(n in t)i=f(a,n),a!==(r=f(t,n))&&(p&&r&&(h(r)||(o=u(r)))?(o?(o=!1,s=i&&u(i)?i:[]):s=i&&h(i)?i:{},d(a,{name:n,newValue:e(p,s,r)})):void 0!==r&&d(a,{name:n,newValue:r}));return a};function m(e,t,n,i){if(!e)return-1;const r=n.cache,o=e.origin?e.origin():null;o&&(e=o);let s=r.fields.indexOf(e),a=-1,l=-1;if(-1===s)for(let t=0;t<r.wrappedFields.length;t++)if(l=r.wrappedFields[t].attrDims.map((e=>e.instance)).indexOf(e),a=r.wrappedFields[t].attrExps.map((e=>e.instance)).indexOf(e),-1!==l||-1!==a){s=t;break}if(Array.isArray(i)&&i.some(((e,t)=>e!==t))){const e=i.indexOf(s);-1!==e&&(s=e)}return s-=t.qArea.qLeft,s<0||s>=t.qArea.qWidth?-1:l>=0?e=>e[s].qAttrDims.qValues[l]:a>=0?e=>e[s].qAttrExps.qValues[a]:e=>e[s]}function g(e,t,n){let{key:i}=n;const r={value:"function"==typeof e.value?e.value(t):void 0!==e.value?e.value:t};return r.label="function"==typeof e.label?e.label(t):void 0!==e.label?String(e.label):String(r.value),e.field&&(r.source={key:i,field:e.field.key()}),r}function y(e){let{cache:t,f:n,mainCell:i,p:r,prop:o,page:s,rowIdx:a,row:l,sourceKey:c,target:u,targetProp:h,columnOrder:d}=e,f=i;if(r.field&&r.field!==n){const e=m(r.field,s,{cache:t},d);if(-1===e)return;f=p({qRow:a},e(l))}u[h]=g(r,f,{key:c})}function v(e,t,n,i){const r=Array.isArray(e)?e:[e];let o=[];for(let e=0;e<r.length;e++)if(void 0!==r[e].field){const s=t.raw(),a=t.key(),l="object"==typeof r[e].field?r[e].field:t.field(r[e].field),{props:c,main:u}=i.normalizeConfig(r[e],t),h=Object.keys(c),d=!!r[e].trackBy,f=typeof r[e].trackBy,v={},b=[],x=[];for(let t=0;t<s.qDataPages.length;t++){const o=m(l,s.qDataPages[t],{cache:n},s.qColumnOrder);if(-1!==o)for(let m=0;m<s.qDataPages[t].qMatrix.length;m++){const w=s.qDataPages[t].qArea.qTop+m,q=p({qRow:w},o(s.qDataPages[t].qMatrix[m])),S=g(u,q,{key:a});if(!u.filter||u.filter(q)){for(let e=0;e<h.length;e++){const i=c[h[e]];let r=i.fields||[i];i.fields&&(S[h[e]]=[]);for(let o=0;o<r.length;o++)y({cache:n,f:l,mainCell:q,p:r[o],prop:h[e],props:c,page:s.qDataPages[t],rowIdx:w,row:s.qDataPages[t].qMatrix[m],sourceKey:a,target:i.fields?S[h[e]]:S,targetProp:i.fields?o:h[e],columnOrder:s.qColumnOrder});if(i.fields){const t=S[h[e]].map((e=>e.value)),n=S[h[e]].map((e=>e.label));S[h[e]]={value:"function"==typeof i.value?i.value(t):void 0!==i.value?i.value:t,label:"function"==typeof i.label?i.label(n):void 0!==i.label?String(i.label):String(S[h[e]].value)}}}d&&i.track({cfg:r[e],itemData:q,obj:S,target:b,tracker:v,trackType:f}),x.push(S)}}}const w=d?i.collect(b,{main:u,propsArr:h,props:c}):x;o=[...o,...w]}return o}function b(e){var t=0,n=e.children,i=n&&n.length;if(i)for(;--i>=0;)t+=n[i].value;else t=1;e.value=t}function x(){return this.eachAfter(b)}function w(e,t){let n=-1;for(const i of this)e.call(t,i,++n,this);return this}function q(e,t){for(var n,i,r=this,o=[r],s=-1;r=o.pop();)if(e.call(t,r,++s,this),n=r.children)for(i=n.length-1;i>=0;--i)o.push(n[i]);return this}function S(e,t){for(var n,i,r,o=this,s=[o],a=[],l=-1;o=s.pop();)if(a.push(o),n=o.children)for(i=0,r=n.length;i<r;++i)s.push(n[i]);for(;o=a.pop();)e.call(t,o,++l,this);return this}function M(e,t){let n=-1;for(const i of this)if(e.call(t,i,++n,this))return i}function D(e){return this.eachAfter((function(t){for(var n=+e(t.data)||0,i=t.children,r=i&&i.length;--r>=0;)n+=i[r].value;t.value=n}))}function _(e){return this.eachBefore((function(t){t.children&&t.children.sort(e)}))}function C(e){for(var t=this,n=k(t,e),i=[t];t!==n;)t=t.parent,i.push(t);for(var r=i.length;e!==n;)i.splice(r,0,e),e=e.parent;return i}function k(e,t){if(e===t)return e;var n=e.ancestors(),i=t.ancestors(),r=null;for(e=n.pop(),t=i.pop();e===t;)r=e,e=n.pop(),t=i.pop();return r}function E(){for(var e=this,t=[e];e=e.parent;)t.push(e);return t}function A(){return Array.from(this)}function T(){var e=[];return this.eachBefore((function(t){t.children||e.push(t)})),e}function I(){var e=this,t=[];return e.each((function(n){n!==e&&t.push({source:n.parent,target:n})})),t}function*R(){var e,t,n,i,r=this,o=[r];do{for(e=o.reverse(),o=[];r=e.pop();)if(yield r,t=r.children)for(n=0,i=t.length;n<i;++n)o.push(t[n])}while(o.length)}function O(e,t){e instanceof Map?(e=[void 0,e],void 0===t&&(t=L)):void 0===t&&(t=P);for(var n,i,r,o,s,a=new j(e),l=[a];n=l.pop();)if((r=t(n.data))&&(s=(r=Array.from(r)).length))for(n.children=r,o=s-1;o>=0;--o)l.push(i=r[o]=new j(r[o])),i.parent=n,i.depth=n.depth+1;return a.eachBefore(z)}function N(){return O(this).eachBefore(F)}function P(e){return e.children}function L(e){return Array.isArray(e)?e[1]:null}function F(e){void 0!==e.data.value&&(e.value=e.data.value),e.data=e.data.data}function z(e){var t=0;do{e.height=t}while((e=e.parent)&&e.height<++t)}function j(e){this.data=e,this.depth=this.height=0,this.parent=null}function H(e){return null==e?null:B(e)}function B(e){if("function"!=typeof e)throw new Error;return e}j.prototype=O.prototype={constructor:j,count:x,each:w,eachAfter:S,eachBefore:q,find:M,sum:D,sort:_,path:C,ancestors:E,descendants:A,leaves:T,links:I,copy:N,[Symbol.iterator]:R};var V={depth:-1},$={},W={};function U(e){return e.id}function Y(e){return e.parentId}function X(){var e,t=U,n=Y;function i(i){var r,o,s,a,l,c,u,h,d=Array.from(i),f=t,p=n,m=new Map;if(null!=e){const t=d.map(((t,n)=>K(e(t,n,i)))),n=t.map(G),r=new Set(t).add("");for(const e of n)r.has(e)||(r.add(e),t.push(e),n.push(G(e)),d.push(W));f=(e,n)=>t[n],p=(e,t)=>n[t]}for(s=0,r=d.length;s<r;++s)o=d[s],c=d[s]=new j(o),null!=(u=f(o,s,i))&&(u+="")&&(h=c.id=u,m.set(h,m.has(h)?$:c)),null!=(u=p(o,s,i))&&(u+="")&&(c.parent=u);for(s=0;s<r;++s)if(u=(c=d[s]).parent){if(!(l=m.get(u)))throw new Error("missing: "+u);if(l===$)throw new Error("ambiguous: "+u);l.children?l.children.push(c):l.children=[c],c.parent=l}else{if(a)throw new Error("multiple roots");a=c}if(!a)throw new Error("no root");if(null!=e){for(;a.data===W&&1===a.children.length;)a=a.children[0],--r;for(let e=d.length-1;e>=0&&(c=d[e]).data===W;--e)c.data=null}if(a.parent=V,a.eachBefore((function(e){e.depth=e.parent.depth+1,--r})).eachBefore(z),a.parent=null,r>0)throw new Error("cycle");return a}return i.id=function(e){return arguments.length?(t=H(e),i):t},i.parentId=function(e){return arguments.length?(n=H(e),i):n},i.path=function(t){return arguments.length?(e=H(t),i):e},i}function K(e){let t=(e=`${e}`).length;return J(e,t-1)&&!J(e,t-2)&&(e=e.slice(0,-1)),"/"===e[0]?e:`/${e}`}function G(e){let t=e.length;if(t<2)return"";for(;--t>1&&!J(e,t););return e.slice(0,t)}function J(e,t){if("/"===e[t]){let n=0;for(;t>0&&"\\"===e[--t];)++n;if(0==(1&n))return!0}return!1}function Z(e,t){"/"===e.charAt(0)&&(e=e.substring(1));const n=e.split("/");let i,r=t;for(let e=0;e<n.length;e++){if("*"===n[e]&&Array.isArray(r)){const t=[];i=n.slice(e+1).join("/");for(let e=0;e<r.length;e++){let n=Z(i,r[e]);Array.isArray(n)?t.push(...n):t.push(n)}return t}if(!n[e]&&Array.isArray(r)){const t=new Array(r.length);i=n.slice(e+1).join("/");for(let e=0;e<r.length;e++)t[e]=Z(i,r[e]);return t}n[e]in r&&(r=r[n[e]])}return r}function Q(e,t,n){let i=[];if(!e||!e.length)return i;if(t<=0){const t=n>=0?[e[n]]:e;i=[...i,...t]}else for(let r=0;r<e.length;r++)e[r].children&&e[r].children.length&&(i=[...i,...Q(e[r].children,t-1,n)]);return i}function ee(e,t,n){if(e===t)return e=>e;if(e>t){const n=Math.max(0,Math.min(100,e-t));return e=>{let t=e;for(let e=0;e<n;++e)t=t.parent;return t}}if(t>e){const i=Math.max(0,Math.min(100,t-e));return e=>Q(e.children,i-1,n)}return!1}function te(e,t){let{cache:n}=t;if("number"==typeof e)return n.fields[e];const i=n.allFields;if("function"==typeof e){for(let t=0;t<i.length;t++)if(e(i[t]))return i[t];return!1}if("string"==typeof e){for(let t=0;t<i.length;t++)if(i[t].key()===e||i[t].title()===e)return i[t]}else if(e&&-1!==i.indexOf(e))return e;throw Error("Field not found: ".concat(e))}const ne=/^qDimensionInfo(?:\/(\d+))?/,ie=/^\/?qMeasureInfo\/(\d+)/,re=/\/qAttrExprInfo\/(\d+)/,oe=/\/qAttrDimInfo\/(\d+)/;function se(e){const t=e.raw().qColumnOrder,n=e.fields();return t&&t.length===n.length?t:n.map(((e,t)=>t))}function ae(e){return(e.qColumnOrder&&e.qColumnOrder.length?e.qColumnOrder:e.qDimensionInfo.map(((e,t)=>t))).filter((t=>t<e.qDimensionInfo.length))}function le(e,t){let{cube:n}=t;if(!e)return-1;let i=e.origin&&e.origin()?e.origin().key():e.key(),r=!1,o=-1,s=-1,a=-1,l=-1,c=-1,u=-1,h=i;const d=n.qEffectiveInterColumnSortOrder,f=ae(n);return ne.test(h)&&(r=!0,o=+ne.exec(h)[1],h=i.replace(ne,"")),ie.test(h)&&("K"===n.qMode?c=+ie.exec(h)[1]:d&&-1!==d.indexOf(-1)?(c=+ie.exec(h)[1],u=0):u=+ie.exec(h)[1],h=h.replace(ie,"")),h&&(oe.exec(h)?a=+oe.exec(h)[1]:re.exec(h)&&(s=+re.exec(h)[1])),l=r?"S"===n.qMode?f[o]:d?d.indexOf(o):o:d&&-1!==d.indexOf(-1)?d.indexOf(-1):n.qDimensionInfo.length-("K"===n.qMode?0:1),{fieldDepth:l+1,pseudoMeasureIndex:c,measureIdx:u,attrDimIdx:a,attrIdx:s}}function ce(e,t){let n,i,r=ee(e.fieldDepth,t.fieldDepth,t.pseudoMeasureIndex);return n=t.measureIdx>=0?e=>e.data.qValues[t.measureIdx]:e=>e.data,t.attrDimIdx>=0?i=e=>{var n;return null==e||null===(n=e.qAttrDims)||void 0===n?void 0:n.qValues[t.attrDimIdx]}:t.attrIdx>=0&&(i=e=>{var n;return null==e||null===(n=e.qAttrExps)||void 0===n?void 0:n.qValues[t.attrIdx]}),{nodeFn:r,attrFn:i,valueFn:n}}function ue(e,t,n){let{key:i}=n;const r={value:"function"==typeof e.value?e.value(t):void 0!==e.value?e.value:t};return r.label="function"==typeof e.label?e.label(t):void 0!==e.label?String(e.label):String(r.value),e.field&&(r.source={key:i,field:e.field.key()}),r}function he(e){let{propsArr:t,props:n,item:i,itemData:r,ret:o,sourceKey:s}=e;for(let e=0;e<t.length;e++){const a=n[t[e]],l=a.fields||[a];let c,u;a.fields&&(c=[],u=[]);for(let n=0;n<l.length;n++){const h=l[n];let d,f,p,m,g,y;if("primitive"===h.type?(p=h.value,y=String(h.value)):("function"==typeof h.value&&(d=e=>h.value(e,i)),"function"==typeof h.label&&(f=e=>h.label(e,i)),h.accessor?(m=h.accessor(i),Array.isArray(m)?(g=m.map(h.valueAccessor),h.attrAccessor&&(g=g.map(h.attrAccessor)),d&&(p=g.map(d),d=null),f&&(y=g.map(f),f=null),p=h.reduce?h.reduce(p):p,y=h.reduceLabel?h.reduceLabel(y,p):String(p)):(p=h.attrAccessor?h.attrAccessor(h.valueAccessor(m)):h.valueAccessor(m),y=p)):(p=r,y=r)),a.fields){const e=d?d(p):p;c.push(e),u.push(f&&null!=y?f(y):null!=y?y:String(e))}else{const n=d?d(p):p;o[t[e]]={value:n,label:f?f(y):null!=y?y:String(n)},h.field&&(o[t[e]].source={field:h.field.key(),key:s})}}c&&(o[t[e]]={value:"function"==typeof a.value?a.value(c,i):c,label:"function"==typeof a.label?a.label(u,i):u})}}const de=(e,t,n)=>{const i="K"===e.qMode?"/qStackedDataPages/*/qData":"/qTreeDataPages/*",r="K"===e.qMode?"qSubNodes":"qNodes",o=Z(i,e);return o&&o[0]?(t.tree=O(o[0],n.children||(e=>e[r])),t.tree):null};function fe(e){const t=e.raw().qDataPages.length?e.raw().qDataPages[0].qMatrix:[],i=se(e),r=e.fields(),o=e.fields().filter((e=>"dimension"===e.type())).map((e=>i.indexOf(r.indexOf(e)))),s=e.fields().filter((e=>"measure"===e.type())).map((e=>i.indexOf(r.indexOf(e)))),a={__root:{__id:"__root",qValues:[]}};for(let e=0;e<t.length;e++){const i=t[e];let r="__root",c=!1;for(let e=0;e<o.length;e++){var l;const t=i[o[e]],s="".concat(r,"__").concat(null!==(l=t.qElemNumber)&&void 0!==l?l:t.qElemNo);a[s]||(a[s]=n({__id:s,__parent:r,qValues:[]},t),c=!0),r=s}if(c)for(let e=0;e<s.length;e++){const t=i[s[e]];a[r].qValues.push(t)}}const c=Object.keys(a).map((e=>a[e])),u=X().id((e=>e.__id)).parentId((e=>e.__parent))(c);return u}const pe=e=>{let{propsArr:t,props:n,cube:i,cache:r,itemDepthObject:o,f:s}=e;for(let e=0;e<t.length;e++){const a=n[t[e]],l=a.fields?a.fields:[a];for(let e=0;e<l.length;e++){const t=l[e];if(t.field!==s){const e=ce(o,le(t.field,{cube:i,cache:r}));t.accessor=e.nodeFn,t.valueAccessor=e.valueFn,t.attrAccessor=e.attrFn}}}};function me(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0,i=arguments.length>2?arguments[2]:void 0,r=arguments.length>3?arguments[3]:void 0;const o=t.raw(),s=t.key(),a="S"===o.qMode?fe(t):de(o,i,e);if(!a)return null;const l=a.height,c=[];for(let s=0;s<=l;s++){let a=null;if(s>0)if("S"===o.qMode){let e=ae(o)[s-1];a=i.fields[e]}else{let e=o.qEffectiveInterColumnSortOrder[s-1];s>o.qEffectiveInterColumnSortOrder.length&&(e=o.qDimensionInfo.length),a=i.fields[e]}const{props:l,main:u}=r.normalizeConfig(n(n({},e),{},{field:a?a.key():void 0}),t),h=Object.keys(l);c[s]={propsArr:h,props:l,main:u};const d=a?le(a,{cube:o,cache:i}):{fieldDepth:0};pe({propsArr:h,props:l,cube:o,cache:i,itemDepthObject:d,f:a})}const u=a.copy().descendants(),h=a.descendants();for(let e=0;e<h.length;e++){const t=c[h[e].depth].propsArr,n=c[h[e].depth].props,i=c[h[e].depth].main,r=u[e],o=r.data,a=ue(i,o,{key:s});he({propsArr:t,props:n,item:r,itemData:o,ret:a,sourceKey:s,isTree:!0}),h[e].data=a}return a}function ge(e,t,n,i){const r=Array.isArray(e)?e:[e];let o=[];for(let s=0;s<r.length;s++)if(void 0!==r[s].field){const a=t.raw(),l=t.key();if(!de(a,n,e))continue;const c="object"==typeof r[s].field?r[s].field:t.field(r[s].field),{props:u,main:h}=i.normalizeConfig(r[s],t),d=Object.keys(u),f=le(c,{cube:a,cache:n}),{nodeFn:p,attrFn:m,valueFn:g}=ce({fieldDepth:0},f);pe({propsArr:d,props:u,cube:a,cache:n,itemDepthObject:f,f:c});const y=!!r[s].trackBy,v=typeof r[s].trackBy,b={},x=[],w=p(n.tree),q=[];for(let e=0;e<w.length;e++){const t=w[e],n=m?m(g(t)):g(t);if(h.filter&&!h.filter(n))continue;const o=ue(h,n,{key:l});he({propsArr:d,props:u,item:t,itemData:n,ret:o,sourceKey:l}),y&&i.track({cfg:r[s],itemData:n,obj:o,target:x,tracker:b,trackType:v}),q.push(o)}const S=y?i.collect(x,{main:h,propsArr:d,props:u}):q;o=[...o,...S]}return o}function ye(e,t){return e(t={exports:{}},t.exports),t.exports}"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:void 0!==t||"undefined"!=typeof self&&self;var ve=ye((function(e){
|
|
43
27
|
/*! javascript-number-formatter - v1.1.11 - http://mottie.github.com/javascript-number-formatter/ * © ecava */
|
|
44
|
-
!function(t,n){e.exports=n()}(0,(function(){return function(e,t){if(!e||isNaN(+t))return t;var n,i,r,o,s,a,l,c,u,h,d=e.length,f=e.search(/[0-9\-\+#]/),p=f>0?e.substring(0,f):"",m=e.split("").reverse().join(""),g=m.search(/[0-9\-\+#]/),y=d-g,v=e.substring(y,y+1),b=y+("."===v||","===v?1:0),x=g>0?e.substring(b,d):"";if(n=(t="-"===(e=e.substring(f,b)).charAt(0)?-t:+t)<0?t=-t:0,r=(i=e.match(/[^\d\-\+#]/g))&&i[i.length-1]||".",o=i&&i[1]&&i[0]||",",e=e.split(r),t=+(t=t.toFixed(e[1]&&e[1].length))+"",a=e[1]&&e[1].lastIndexOf("0"),(!(c=t.split("."))[1]||c[1]&&c[1].length<=a)&&(t=(+t).toFixed(a+1)),u=e[0].split(o),e[0]=u.join(""),(s=e[0]&&e[0].indexOf("0"))>-1)for(;c[0].length<e[0].length-s;)c[0]="0"+c[0];else 0==+c[0]&&(c[0]="");if((t=t.split("."))[0]=c[0],l=u[1]&&u[u.length-1].length){for(m="",y=(h=t[0]).length%l,d=h.length,b=0;b<d;b++)m+=h.charAt(b),!((b-y+1)%l)&&b<d-l&&(m+=o);t[0]=m}return t[1]=e[1]&&t[1]?r+t[1]:"","0"!==(i=t.join(""))&&""!==i||(n=!1),p+(n?"-":"")+i+x}}))}));function be(e){return e.replace(/[-[\]/{}()*+?.\\^$|]/g,"\\$&")}const xe={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"},we=/%\)?$/,qe=/^\(r(0[2-9]|[12]\d|3[0-6])\)/i,Me=/^\(oct\)/i,De=/^\(dec\)/i,Se=/^\(hex\)/i,_e=/^\(bin\)/i,Ce=/^\(rom\)/i,ke=/^(\(rom\)|\(bin\)|\(hex\)|\(dec\)|\(oct\)|\(r(0[2-9]|[12]\d|3[0-6])\))/i,Ee=/#|0/g;function Ae(e,t,n,i){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(".",i||".")}function Te(e,t){let n,i="",r=Number(String(e).slice(-3)),o=(e-r)/1e3,s=[0,1,4,5,9,10,40,50,90,100,400,500,900].reverse(),a=["0","I","IV","V","IX","X","XL","L","XC","C","CD","D","CM"].reverse();for(;r>0;)for(n=0;n<s.length;n++)if(s[n]<=r){i+=a[n],r-=s[n];break}for(n=0;n<o;n++)i="M".concat(i);return t[1]!==t[1].toUpperCase()&&(i=i.toLowerCase()),i}function Ie(e,t,n){let i;return qe.test(t)?e=Ae(e,Number(/\d{2}/.exec(t)[0]),t,n):Me.test(t)?e=Ae(e,8,t,n):De.test(t)?e=Ae(e,10,t,n):Se.test(t)?e=Ae(e,16,t,n):_e.test(t)?e=Ae(e,2,t,n):Ce.test(t)&&(i="",e<0&&(i="-",e=-e),e=0===(e=Math.floor(e))?"0":e<=5e5?i+(e=Te(e,t)):t+i+e.toExponential(0)),e}function Re(e,t,n){const i=be(e);return n?i:new RegExp(i||"",t)}function Ne(e,t){return t&&(t=be(t)),e&&(e=be(e)),new RegExp("(?:[#0]+".concat(e,")?[#0]+(?:").concat(t,"[#0]+)?"))}function Oe(e,t){if(!e||!e.qNumericalAbbreviation)return xe;const n={};return e.qNumericalAbbreviation.split(t).forEach((e=>{let t=e.split(":");2===t.length&&(n[t[0]]=t[1])})),n}function Pe(e,t,n,i){let r,o,s,a,l,c,u,h,d,f=e.pattern;i&&(e.abbreviate=!0),d=Ne(t,n),s=f.match(d),s=s?s[0]:"",a=s?f.substr(0,f.indexOf(s)):f,l=s?f.substring(f.indexOf(s)+s.length):"",s||(s=f?"#":"##########"),t&&t===n&&(r=s.split(n),o=r.pop(),s=r.join("")+n+o,t=""),c=t,t=/,/.test(n)?"¤":",",c&&(s=s.replace(Re(c,"g"),t)),u=n,n=".",u&&(s=s.replace(Re(u,"g"),n)),h=s.match(/#/g),h=h?h.length:0;const p=f.split(u);let m;p[1]&&(m=p[1].match(Ee)),e.prefix=a||"",e.postfix=l||"",e.pattern=f,e.maxPrecision=m?m.length:2,e.percentage=we.test(f),e.numericPattern=s||"",e.numericRegex=new RegExp("".concat(Re(t,null,!0),"|").concat(Re(n,null,!0)),"g"),e.groupTemp=c,e.decTemp=u,e.t=t,e.d=n,e.temp=h}class Le{constructor(e,t,n,i,r){this.localeInfo=e,this.pattern=t,this.thousandDelimiter=n||",",this.decimalDelimiter=i||".",this.type=r||"numeric",this.patternSeparator=";",this.abbreviations=Oe(e,this.patternSeparator),this.prepare()}clone(){const e=new Le(this.localeInfo,this.pattern,this.thousandDelimiter,this.decimalDelimiter,this.type);return e.subtype=this.subtype,e}format(e,t,n,i){return this.prepare(t,n,i),this.formatValue(e)}prepare(e,t,n){let i;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:""}},i=this._prepared,e=e.split(this.patternSeparator),i.positive.pattern=e[0],i.negative.pattern=e[1],i.zero.pattern=e[2],ke.test(e[0])&&(i.positive.isFunctional=!0),e[1]?ke.test(e[1])&&(i.negative.isFunctional=!0):i.negative=!1,e[2]?ke.test(e[2])&&(i.zero.isFunctional=!0):i.zero=!1;const r="U"===this.type;i.positive.isFunctional||Pe(i.positive,t,n,r),i.negative&&!i.negative.isFunctional&&Pe(i.negative,t,n,r),i.zero&&!i.zero.isFunctional&&Pe(i.zero,t,n,r)}formatValue(e){let t,n,i,r,o,s,a,l,c,u=this._prepared,h="",d="",f=e;if(isNaN(e))return"".concat(f);if(e=+e,!1===u.pattern)return e.toString();if(0===e&&u.zero)return u=u.zero,u.pattern;if(e<0&&u.negative?(u=u.negative,e=-e):u=u.positive,o=u.d,s=u.t,u.isFunctional)e=Ie(e,u.pattern,o);else{if(u.percentage&&(e*=100),u.abbreviate){const t=Object.keys(this.abbreviations).map((e=>parseInt(e,10))).sort(((e,t)=>e-t));let i,r,o=t[0];for(a=0,n=Number(Number(e).toExponential().split("e")[1]);o<=n&&a<t.length;)a++,o=t[a];a>0&&(i=t[a-1]),i&&n>0&&i>0?r=i:(n<0&&i<0||!i)&&(o<0&&o-n<=u.maxPrecision?r=o:i<=n&&!(o>0&&-n<=u.maxPrecision)&&(r=i)),r&&(h=this.abbreviations[r],e/=10**r)}if(i=Math.abs(e),t=u.temp,l=u.numericPattern,c=l.split(o)[1],"I"===this.type&&(e=Math.round(e)),r=e,c||"#"!==l.slice(-1)[0])if(i>=1e15||i>0&&i<=1e-14)e=i?i.toExponential(15).replace(/\.?0+(?=e)/,""):"0";else{const t=Number(e.toFixed(Math.min(20,c?c.length:0)).split(".")[0]);let n=l.split(o)[0];if(n+=o,e=ve(n,t)||"0",c){const t=Math.max(0,Math.min(14,c.length)),n=c.replace(/#+$/,"").length;let r=("I"===this.type?0:i%1).toFixed(t).slice(2).replace(/0+$/,"");for(a=r.length;a<n;a++)r+="0";r&&(e+=o+r)}else 0===t&&(r=0)}else if(i>=10**t||i<1||i<1e-4)0===e?e="0":i<1e-4||i>=1e20?(e=(e=r.toExponential(Math.max(1,Math.min(14,t))-1)).replace(/\.?0+(?=e)/,""),d=""):(e=e.toPrecision(Math.max(1,Math.min(14,t)))).indexOf(".")>=0&&(e=(e=e.replace(e.indexOf("e")<0?/0+$/:/\.?0+(?=e)/,"")).replace(".",o));else{for(l+=o,t=Math.max(0,Math.min(20,t-Math.ceil(Math.log(i)/Math.log(10)))),a=0;a<t;a++)l+="#";e=ve(l,e)}e=e.replace(u.numericRegex,(e=>e===s?u.groupTemp:e===o?u.decTemp:"")),r<0&&!/^-/.test(e)&&(e="-".concat(e))}return u.prefix+e+d+h+u.postfix}static getStaticFormatter(){return{prepare(){},formatValue:e=>"".concat(e)}}}function Fe(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return new Le(...t)}function ze(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const{size:n=5e3,multipleArguments:i=!1,toKey:r=(e=>e)}=t;let o,s,a=Object.create(null),l=Object.create(null),c=0,u=0;return o=i?function(){return s=r(...arguments),o.has(s)?o.get(s):o.set(s,e(...arguments))}:t=>(s=r(t),o.has(s)?o.get(s):o.set(s,e(t))),o.set=(e,t)=>(c>=n&&(delete a[l[u]],delete l[u],c--,u++),a[e]=t,l[c]=e,c++,t),o.get=e=>a[e],o.has=e=>e in a,o.clear=()=>{a=Object.create(null),l=Object.create(null),c=0,u=0},o.size=()=>c,o}function je(e,t,n,i,r){const o=Fe(r,e,t,n,i),s=ze(o.formatValue.bind(o),{toKey:e=>isNaN(e)?e:+e});function a(e){return s(e)}return a.format=function(e,t,n,i){return s.clear(),o.format(t,e,n,i)},a.pattern=function(e){return e&&(s.clear(),o.pattern=e,o.prepare()),o.pattern},a}const He={AUTO:"U",INTEGER:"I",NUMBER:"R",FIXED_TO:"F",MONEY:"M",DATE:"D",TIME:"T",DATE_TIME:"TS",INTERVAL:"IV"},Be=["Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"],Ve=["Mon","Tue","Wed","Thu","Fri","Sat","Sun"],$e=["January","February","March","April","May","June","July","August","September","October","November","December"],We=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],Ue=86400;function Ye(e,t){for(let n=e.length;n<t;n++)e="0".concat(e);return e}function Xe(e,t){let n=e.getUTCHours(),i=e.getUTCDay()-1;return t&&(n%=12,n||(n=12)),i<0&&(i=6),{year:e.getUTCFullYear(),month:e.getUTCMonth(),day:i,date:e.getUTCDate(),h:n,m:e.getUTCMinutes(),s:e.getUTCSeconds(),f:e.getUTCMilliseconds(),t:e.getUTCHours()>=12?"pm":"am"}}function Ke(e){let t=e.toString().split(".");return t[1]?(t=Number("0.".concat(t[1])),t):0}function Ge(e){const t=e,n=24*Ke(t),i=60*Ke(n),r=60*Ke(i),o=1e3*Ke(r);return{d:Math.floor(t),h:Math.floor(n),m:Math.floor(i),s:Math.floor(r),f:Math.round(o)}}function Je(e,t){let n,i=Ge(e),r=i.d,o=i.h,s=i.m,a=i.s,l=i.f,c=0;/w+|t+/gi.test(t)&&(n=new Date(Date.UTC(1899,11,30+Math.floor(e),0,0,Math.round(Ue*(e-Math.floor(e))))),isNaN(n.getTime())&&(n=null)),/D+/gi.test(t)||(o+=24*r),/h+/gi.test(t)||(s+=60*o),/m+/gi.test(t)||(a+=60*s),/w+/gi.test(t)&&(c=n?n.getDay()-1:0,c<0&&(c=6));let u="";return n&&(u=n.getUTCHours()>=12?"pm":"am"),{year:0,month:0,day:c,date:r,h:o,m:s,s:a,f:l,t:u}}function Ze(e,t){return{"Y+|y+":{Y:"".concat(Number("".concat(t.year).slice(-2))),YY:Ye("".concat(t.year).slice(-2),2),YYY:Ye("".concat(t.year).slice(-3),3),def:e=>Ye("".concat(t.year),e.length)},"M+":{M:t.month+1,MM:Ye("".concat(t.month+1),2),MMM:e.locale_months_abbr[t.month],def:e.locale_months[t.month]},"W+|w+":{W:t.day,WW:Ye("".concat(t.day),2),WWW:e.locale_days_abbr[t.day],def:e.locale_days[t.day]},"D+|d+":{D:t.date,def:e=>Ye("".concat(t.date),e.length)},"h+|H+":{h:t.h,def:e=>Ye("".concat(t.h),e.length)},"m+":{m:t.m,def:e=>Ye("".concat(t.m),e.length)},"s+|S+":{s:t.s,def:e=>Ye("".concat(t.s),e.length)},"f+|F+":{def(e){let n="".concat(t.f),i=e.length-n.length;if(i>0)for(let e=0;e<i;e++)n+="0";else i<0&&(n=n.slice(0,e.length));return n}},"t{1,2}|T{1,2}":{def(e){let n=t.t;return e[0].toUpperCase()===e[0]&&(n=n.toUpperCase()),n=n.slice(0,e.length),n}}}}class Qe{constructor(e,t,n){const i=e||{};i.qCalendarStrings||(i.qCalendarStrings={qLongDayNames:Be,qDayNames:Ve,qLongMonthNames:$e,qMonthNames:We}),this.localeInfo=i,this.locale_days=i.qCalendarStrings.qLongDayNames.slice(),this.locale_days_abbr=i.qCalendarStrings.qDayNames.slice(),this.locale_months=i.qCalendarStrings.qLongMonthNames.slice(),this.locale_months_abbr=i.qCalendarStrings.qMonthNames.slice(),t||(t={[He.TIME]:i.qTimeFmt||"hh:mm:ss",[He.DATE]:i.qDateFmt||"YYYY-MM-DD",[He.DATE_TIME]:i.qTimestampFmt||"YYYY-MM-DD hh:mm:ss"}[n]),this.pattern=t}clone(){const e=new Qe(this.localeInfo,this.pattern);return e.subtype=this.subtype,e}format(e,t){t||(t=this.pattern?this.pattern:"YYYY-MM-DD hh:mm:ss"),t=t.replace(/\[.+]|\[|]/g,"");const n=/t+/gi.test(t);let i;e instanceof Date?i=Xe(e,n):(e<0&&(e=-e,t="-".concat(t)),i=Je(e,t));const r=Ze(this,i),o=[];for(const e in r)Object.prototype.hasOwnProperty.call(r,e)&&o.push(e);const s=new RegExp(o.join("|"),"g"),a=t.replace(s,(e=>{let t,n,i;for(n in r)if(Object.prototype.hasOwnProperty.call(r,n)&&(t=new RegExp(n),t.test(e)))break;if(!t)return"";for(const t in r[n])if(t===e||t.toLowerCase()===e){i=r[n][t],void 0===i&&(i=r[n][t.toLowerCase()]);break}return void 0===i&&(i=r[n].def),"function"==typeof i&&(i=i(e)),i}));return a}}function et(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return new Qe(...t)}const tt=864e5;function nt(e){return new Date(Date.UTC(1899,11,30+Math.floor(e),0,0,0,Math.round(tt*(e-Math.floor(e)))))}function it(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"TS",n=et(arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,e,t),i=ze(n.format.bind(n),{toKey:e=>"object"==typeof e&&"function"==typeof e.getTime?e.getTime():e});function r(e){return t!==He.INTERVAL?nt(e):e}function o(e){return e=r(e),i(e)}return o.format=function(e,t){return i.clear(),t=r(t),n.format(t,e)},o.locale=function(r){return n=et(r,e,t),i=ze(n.format.bind(n),{toKey:e=>"object"==typeof e?e.getTime():e}),this},o.qtype=function(e){return void 0!==e&&(t=e,i.clear()),t},o}function rt(e,t){if(e&&e.qNumFormat&&-1!==["D","T","TS","IV"].indexOf(e.qNumFormat.qType))return it(e.qNumFormat.qFmt,e.qNumFormat.qType,t);let n="#",i=t&&void 0!==t.qThousandSep?t.qThousandSep:",",r=t&&void 0!==t.qDecimalSep?t.qDecimalSep:".",o="U",s=e&&!!e.qIsAutoFormat;return e&&e.qNumFormat?(n=e.qNumFormat.qFmt||n,i=e.qNumFormat.qThou||i,r=e.qNumFormat.qDec||r,o=e.qNumFormat.qType||o,s=s&&-1===["M"].indexOf(e.qNumFormat.qType)):s=!0,(s||"U"===o)&&(n="#".concat(r,"##"),o="U"),je(n,i,r,o,t)}function ot(){let e,{meta:t,id:n,key:i,localeInfo:r,fieldExtractor:o,value:s,type:a,sourceField:l}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const c=s||("dimension"===a?e=>null==e?void 0:e.qElemNo:e=>null==e?void 0:e.qValue),u=e=>(null==e?void 0:e.qText)||"",h="dimension"===a?"first":"avg",d=rt(t,r),f="dimension"===a?"first":(e,t)=>d(t),p={id:()=>n,key:()=>i,raw:()=>t,title:()=>t.qFallbackTitle||t.label,type:()=>a,origin:()=>l,items:()=>(e||(e=o(p)),e),min:()=>t.qMin,max:()=>t.qMax,value:c,label:u,reduce:h,reduceLabel:f,formatter:()=>d,tags:()=>t.qTags};return p}function st(e,t,n,i,r){return(t[e]||[]).map(((t,o)=>{const s="".concat(i?"".concat(i,"/"):"").concat(e,"/").concat(o),a={instance:ot(p({id:"".concat(n?"".concat(n,"/"):"").concat(s),key:s,meta:t},r))};return a.attrDims=st("qAttrDimInfo",t,n,s,p({},r,{value:e=>null==e?void 0:e.qElemNo,type:"dimension"})),a.attrExps=st("qAttrExprInfo",t,n,s,p({},r,{value:e=>null==e?void 0:e.qNum,type:"measure"})),a.measures=st("qMeasureInfo",t,n,s,p({},r,{value:e=>null==e?void 0:e.qValue,type:"measure"})),a}))}function at(){let{key:e,data:t,config:i={}}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const r={fields:[],wrappedFields:[],allFields:[],virtualFields:[]},o=t;if(!o)throw new Error('Missing "data" input');if(!o.qDimensionInfo)throw new Error('The "data" input is not recognized as a hypercube');const s=at.util,a={cache:r,cube:o,localeInfo:i.localeInfo,fieldExtractor:null,pages:null,hierarchy:()=>null,virtualFields:i.virtualFields},l={key:()=>e,raw:()=>o,field:e=>te(e,a),fields:()=>r.fields.slice(),extract:e=>a.extractor(e,l,r,s),hierarchy:e=>a.hierarchy(e,l,r,s),_cache:()=>r};"K"===o.qMode||"T"===o.qMode||!o.qMode&&o.qNodesOnDim?(a.extractor=ge,a.hierarchy=me,a.pages="K"===o.qMode?o.qStackedDataPages:o.qTreeDataPages):"S"===o.qMode?(a.extractor=v,a.pages=o.qDataPages,a.hierarchy=me):a.extractor=()=>[],a.fieldExtractor=e=>a.extractor({field:e},l,r,s);const c="S"===o.qMode?e=>e.qElemNumber:void 0,u="S"===o.qMode?e=>e.qNum:void 0;r.wrappedFields.push(...st("qDimensionInfo",o,e,"",p({},a,{value:c,type:"dimension"}))),r.wrappedFields.push(...st("qMeasureInfo",o,e,"",p({},a,{value:u,type:"measure"}))),r.fields=r.wrappedFields.map((e=>e.instance));const h=e=>{e.forEach((e=>{r.allFields.push(e.instance),h(e.measures),h(e.attrDims),h(e.attrExps)}))};return h(r.wrappedFields),(i.virtualFields||[]).forEach((t=>{const i=l.field(t.from),o=ot(n({meta:i.raw(),id:"".concat(e,"/").concat(t.key),sourceField:i,fieldExtractor:e=>a.extractor({field:e},l,r,s),key:t.key,type:i.type(),localeInfo:a.localeInfo,value:i.value},t.override||{}));r.virtualFields.push(o)})),r.allFields.push(...r.virtualFields),l}const lt=[["qHyperCube","qHyperCubeDef"],["qTreeData","qTreeDataDef"],["qDimensionInfo","qDimensions"],["qMeasureInfo","qMeasures"],["qAttrDimInfo","qAttributeDimensions"],["qAttrExprInfo","qAttributeExpressions"]],ct=/\/qDimensionInfo(?:\/(\d+))?/,ut=/\/qMeasureInfo\/(\d+)/,ht=/\/qAttrDimInfo\/(\d+)(?:\/(\d+))?/,dt=/\/qAttrExprInfo\/(\d+)/,ft=/\/?qHyperCube/,pt=/\/?qTreeData/,mt=e=>"".concat(e.substr(0,e.indexOf("/qHyperCubeDef")+14)),gt=e=>"".concat(e.substr(0,e.indexOf("/qTreeDataDef")+13));function yt(e,t){let n=e,i=-1,r=-1,o="",s=e=>e;ft.test(e)?(o="".concat(n.substr(0,n.indexOf("qHyperCube")+10)),s=mt):pt.test(e)&&(o="".concat(n.substr(0,n.indexOf("qTreeData")+9)),s=gt);let a=!0;if(ct.test(e)&&(i=+ct.exec(e)[1]),ut.test(e)&&(r=+ut.exec(e)[1]),ht.test(e)){r=-1,i=0;const e=+ht.exec(n)[2];isNaN(e)||(i=e,n=n.replace(/\/\d+$/,"")),a=!1}if(dt.test(e)){const e=r;if(t){r=0;const s=Z(o,t);r+=(s.qMeasureInfo||[]).length,i>-1?(r=s.qDimensionInfo.slice(0,i).reduce(((e,t)=>e+t.qAttrExprInfo.length),r),i=-1):(r=s.qDimensionInfo.reduce(((e,t)=>e+t.qAttrExprInfo.length),r),r=s.qMeasureInfo.slice(0,e).reduce(((e,t)=>e+t.qAttrExprInfo.length),r)),r+=+dt.exec(n)[1]}else i>-1?(i=-1,r=+dt.exec(n)[1]):r+=+dt.exec(n)[1]+1}return lt.forEach((e=>{let[t,i]=e;n=n.replace(t,i)})),a&&(n=s(n)),n&&"/"!==n[0]&&(n="/".concat(n)),{measureIdx:r,dimensionIdx:i,path:n}}function vt(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2?arguments[2]:void 0;const i=t.byCells,r=t.primarySource,o=[],s={},a=e.isActive();let l=!1;return e.brushes().forEach((e=>{const t=yt(e.id,n);if("range"===e.type&&t.measureIdx>-1&&t.dimensionIdx>-1){const n=e.brush.ranges();n.length&&(l=!0,s.multiRangeSelectTreeDataValues||(s.multiRangeSelectTreeDataValues={path:t.path,ranges:[]}),n.forEach((e=>s.multiRangeSelectTreeDataValues.ranges.push({qMeasureIx:t.measureIdx,qDimensionIx:t.dimensionIdx,qRange:{qMin:e.min,qMax:e.max,qMinInclEq:!0,qMaxInclEq:!0}}))))}else{if("range"===e.type&&t.measureIdx>-1){const n=e.brush.ranges();n.length&&(l=!0,s.rangeSelectHyperCubeValues||(s.rangeSelectHyperCubeValues={path:t.path,ranges:[]}),n.forEach((e=>s.rangeSelectHyperCubeValues.ranges.push({qMeasureIx:t.measureIdx,qRange:{qMin:e.min,qMax:e.max,qMinInclEq:!0,qMaxInclEq:!0}}))))}if("range"===e.type&&t.dimensionIdx>-1){const n=e.brush.ranges();n.length&&(l=!0,s.selectHyperCubeContinuousRange||(s.selectHyperCubeContinuousRange={path:t.path,ranges:[]}),n.forEach((e=>s.selectHyperCubeContinuousRange.ranges.push({qDimIx:t.dimensionIdx,qRange:{qMin:e.min,qMax:e.max,qMinInclEq:!0,qMaxInclEq:!1}}))))}if("value"===e.type&&t.dimensionIdx>-1)if(i)if(n&&n.qHyperCube&&("P"===n.qHyperCube.qMode||"T"===n.qHyperCube.qMode||"K"===n.qHyperCube.qMode)){const i=n.qHyperCube,o=i.qNoOfLeftDims,a=i.qEffectiveInterColumnSortOrder.indexOf(t.dimensionIdx);if(s.selectPivotCells||(s.selectPivotCells={path:t.path,cells:[]}),e.id===r||!r){const n=e.brush.values().map((e=>+e)).filter((e=>!isNaN(e)));(0===o||a>=o)&&o>-1?n.forEach((e=>{s.selectPivotCells.cells.push({qType:"T",qCol:e,qRow:a-o})})):n.forEach((e=>{s.selectPivotCells.cells.push({qType:"L",qCol:t.dimensionIdx,qRow:e})})),l=!!s.selectPivotCells.cells.length}}else s.selectHyperCubeCells||(s.selectHyperCubeCells={path:t.path,cols:[]}),s.selectHyperCubeCells.cols.push(t.dimensionIdx),e.id!==r&&(r||s.selectHyperCubeCells.values)||(s.selectHyperCubeCells.values=e.brush.values().map((e=>+e)).filter((e=>!isNaN(e))),l=!!s.selectHyperCubeCells.values.length);else{const n=e.brush.values().map((e=>+e)).filter((e=>!isNaN(e)));l=!!n.length,o.push({params:[t.path,t.dimensionIdx,n,!1],method:"selectHyperCubeValues"})}}})),!l&&a?[{method:"resetMadeSelections",params:[]}]:(s.rangeSelectHyperCubeValues&&o.push({method:"rangeSelectHyperCubeValues",params:[s.rangeSelectHyperCubeValues.path,s.rangeSelectHyperCubeValues.ranges,[],null===(c=t.orMode)||void 0===c||c]}),s.selectHyperCubeContinuousRange&&o.push({method:"selectHyperCubeContinuousRange",params:[s.selectHyperCubeContinuousRange.path,s.selectHyperCubeContinuousRange.ranges]}),s.selectHyperCubeCells&&o.push({method:"selectHyperCubeCells",params:[s.selectHyperCubeCells.path,s.selectHyperCubeCells.values,s.selectHyperCubeCells.cols]}),s.selectPivotCells&&o.push({method:"selectPivotCells",params:[s.selectPivotCells.path,s.selectPivotCells.cells]}),s.multiRangeSelectTreeDataValues&&o.push({method:"multiRangeSelectTreeDataValues",params:[s.multiRangeSelectTreeDataValues.path,s.multiRangeSelectTreeDataValues.ranges]}),o);var c}function bt(e){at.util=e.data("matrix").util,e.data("q",at),e.formatter("q-number",je),e.formatter("q-time",it)}return bt.qBrushHelper=vt,bt.selections=vt,bt}()}(yM);var vM=gM;const bM={brushInterceptors:{DIM_VALUE_NULL:-2,DIM_VALUE_TOTAL:-3,brushOnlyOne:function(e,t){const n=e.brushes().filter((e=>"value"===e.type));let i=[];n.length&&n.forEach((e=>{i=i.concat(e.brush.values().map((t=>({key:e.id,value:t}))))}));return i.concat(t)},filterValues:function(e,t){const n=this;let i,r;const o=[];let s=0;const a=[];return t.forEach((t=>{t.value!==n.DIM_VALUE_NULL&&t.value!==n.DIM_VALUE_TOTAL&&(r=function(e,t){const n=t.key.indexOf("qHyperCube")+"qHyperCube".length,i=t.key.substr(0,n),r=t.key.substr(n+1);return e.dataset(i).field(r)}(e,t),i=r&&r.raw(),i.qLocked?(o.push(i),s++):a.push({key:t.key,value:t.value}))})),{items:a,itemsAreLocked:s>0&&s===t.length,lockedFields:o}}}};const xM={data:["elemNo"],contexts:["select"],startOnEmptySelection:!0,style:{active:{strokeWidth:2,stroke:"#333"},inactive:{opacity:.3}}};function wM(e){if(!e||!e.chartInstance||!e.selectionsApi)throw Error("Selections-handler: Missing input");const t=e.chartInstance,n=e.selectionsApi,i=e.dataPaths||[""],r=e.selectPaths,o=e.lasso;let s=[];const a={propertiesToRestore:{}};let l=!1;const c=function(e,t,n){function i(){}return i.update=function(e,i,r){t.isActive()||t.begin(n),vM.qBrushHelper(r).forEach((e=>{t.select(e)}))},i.toggleValues=function(i,r,o){const s=bM.brushInterceptors.filterValues(e,i),a=s.items;return t.isActive()||s.itemsAreLocked||!(o||a.length>0)||(t.begin(n),r.start(),r.emit("update",[],[])),a},i}(t,n,r),u={};let h=!1;function d(e){16===e.keyCode&&e.shiftKey!==h&&(h=e.shiftKey,o.toggle())}function f(e){const t=e.keyCode;27===t?n.cancel():13===t&&n.confirm()}function p(){s.forEach((e=>{e.listeners.update=function(t,n){e.sleep||c.update(t,n,e.brush)},e.brush.on("update",e.listeners.update),e.brush.on("start",e.listeners.start)}))}function m(){s.forEach((e=>{e.brush.removeListener("update",e.listeners.update),e.brush.removeListener("start",e.listeners.start)}))}return n.on("cleared",(()=>{s.forEach((e=>{e.brush.clear(),e.dependentComponents.forEach((e=>{const n=t.component(e.id);n&&n.emit(e.clear)}))}))})),u.setUp=function(e){u.tearDown();const t=this.setUpBrush(e);return l&&p(),t},u.setUpBrush=function(e){const n=rw(!0,{},xM,e),r={on:"tap",action:t=>t.ctrlKey||e.isSingleSelect?"set":"toggle",contexts:n.contexts,data:n.data,globalPropagation:"stop"},o={context:n.contexts[0],data:n.data,style:n.style},a=function(e,t){return{brush:t.brush(e.contexts[0]),listeners:{},dependentComponents:[],id:e.contexts[0]}}(n,t);return a.listeners.toggle=function(e){if(!l)return[];const r=function(){const e=[];let n=i.map((e=>t.dataset(e).fields().filter((e=>"dimension"===e.type()))));n=[].concat.apply([],n);for(let t=0;t<n.length;t++)n[t].raw().qLocked&&e.push(n[t].raw());return{fields:e,areAllFieldsLocked:e.length&&e.length===n.length}}();return n.startOnEmptySelection&&0===e.length&&r.areAllFieldsLocked?[]:c.toggleValues(e,a.brush,n.startOnEmptySelection)},a.brush.intercept("toggle-values",a.listeners.toggle),a.brush.intercept("add-values",a.listeners.toggle),a.brush.intercept("remove-values",a.listeners.toggle),a.brush.intercept("set-values",a.listeners.toggle),a.listeners.start=function(){s.length>1&&s.forEach((e=>{e!==a&&e.brush.end()}))},s.push(a),{trigger:r,consume:o}},u.setUpStart=function(){u.tearDown()},u.setUpDone=function(){l&&p()},u.tearDown=function(){l&&m(),s.forEach((e=>{e.brush.removeInterceptor("toggle-values",e.listeners.toggle),e.brush.removeInterceptor("add-values",e.listeners.toggle),e.brush.removeInterceptor("remove-values",e.listeners.toggle),e.brush.removeInterceptor("set-values",e.listeners.toggle)})),s=[]},u.pauseEngineCalls=function(e){s.forEach((t=>{t.id===e&&(t.sleep=!0)}))},u.resumeEngineCalls=function(e,t){s.forEach((n=>{n.id===e&&(n.sleep=!1,t&&n.listeners.update([],[]))}))},u.addComponent=function(e,t){s.forEach((n=>{n.id===e&&n.dependentComponents.push(t)}))},u.on=function(){if(l)return;l=!0,p(),document.addEventListener("keydown",d),document.addEventListener("keyup",d);const e=()=>{s.forEach((e=>{e.brush.end()})),document.removeEventListener("keyup",f),o.active()&&o.toggle()};n.on("deactivated",e),a.unbindDeactivated=()=>{n.removeListener("deactivated",e)};const t=()=>{document.addEventListener("keyup",f)};n.on("activated",t),a.unbindActivated=()=>{n.removeListener("activated",t)}},u.isOn=()=>l,u.off=function(){l&&(l=!1,m(),document.removeEventListener("keydown",d),document.removeEventListener("keyup",d),document.removeEventListener("keyup",f),a.unbindActivated(),a.unbindDeactivated())},u.lassoState=function(){return o.active()&&!(e.isLassoDisabled&&e.isLassoDisabled())},u.allFieldsLocked=function(){return function(){let e=i.map((e=>t.dataset(e).fields().filter((e=>"dimension"===e.type()))));return e=[].concat.apply([],e),e.length&&e.every((e=>e.raw().qLocked))}()},u}class qM{isOn(){return!1}on(){console.warn("Can not turn on selections on this object")}off(){}}var MM={create:e=>e.selectionsApi?wM(e):new qM};var DM={isOnComponentForRange:function(e,t,n){return!!e&&!!n.chart.componentsFromPoint({x:e.center.x,y:e.center.y}).filter((e=>-1!==t.indexOf(e.settings.key)))[0]},isOnComponentForLasso:function(e,t,n){return e&&n.chart.componentsFromPoint({x:e.center.x,y:e.center.y}).filter((e=>e.settings.key===t.keys.componentKey))[0]},isOnComponentForNavBtn:function(e,t,n){return n.chart.componentsFromPoint(e.center).some((e=>e.settings.key===t))}};var SM={callLassoGesture:function(e,t,n){return{type:"Pan",options:{direction:ty.DIRECTION_ALL,threshold:1,enable(i,r){if(e.lassoing)return t.isSelectionEnabled();const o=DM.isOnComponentForLasso(r,n,this);return t.isSelectionEnabled()&&r&&((s=n.handlers).selectionHandler.lassoState()&&!s.selectionHandler.allFieldsLocked()||e.lassoing)&&o;var s},event:"lasso"},recognizeWith:n.handlers.scrollHandler?"drag":null,events:{lassostart(i){DM.isOnComponentForLasso(i,n,this)&&(t.switchTo("lasso",this.chart,i),e.lassoing=!0,n.handlers.selectionHandler.pauseEngineCalls(n.keys.lassoBrushKey),i.clientX=i.pointers[0].clientX,i.clientY=i.pointers[0].clientY,t.doEmit(this.chart,"lasso","lassoStart",i))},lassomove(n){e.lassoing&&(n.clientX=n.pointers[0].clientX,n.clientY=n.pointers[0].clientY,t.doEmit(this.chart,"lasso","lassoMove",n))},lassoend(i){e.lassoing&&(i.clientX=i.pointers[0].clientX,i.clientY=i.pointers[0].clientY,t.doEmit(this.chart,"lasso","lassoEnd",i),n.handlers.selectionHandler.resumeEngineCalls(n.keys.lassoBrushKey,!0),e.lassoing=!1)},lassocancel(i){e.lassoing=!1,t.doEmit(this.chart,"lasso","lassoCancel",i),n.handlers.selectionHandler.resumeEngineCalls(n.keys.lassoBrushKey,!1)}}}}};var _M={callMeasureRangeGesture:function(e,t,n,i){const r=n.keys.dimRangeBrushKey?"majorrange":"arearange";return{type:"Pan",options:{direction:n.isHorizontal?ty.DIRECTION_HORIZONTAL:ty.DIRECTION_VERTICAL,event:"measurerange",enable(r,o){if(!n.rangeSelStatus.isOpenMea)return!1;if(e.measureSelecting)return t.isSelectionEnabled();const s="measurerange"===n.active.gesture?[i,n.keys.componentKey]:[i],a=DM.isOnComponentForRange(o,s,this);return e.measureSelecting=t.isSelectionEnabled()&&!!o&&!!a,e.measureSelecting&&!!n.keys.measureRangeBrushKey}},requireFailure:`lasso ${r}`,recognizeWith:n.handlers.scrollHandler?"drag":null,events:{measurerangestart(r){const o="measurerange"===n.active.gesture?[i,n.keys.componentKey]:[i];DM.isOnComponentForRange(r,o,this)&&(e.measureSelecting=!0,t.switchTo("measurerange",this.chart,r),t.doEmit(this.chart,"rangeMeasure","rangeStart",r),n.handlers.selectionHandler.pauseEngineCalls(n.keys.measureRangeBrushKey))},measurerangemove(n){e.measureSelecting&&t.doEmit(this.chart,"rangeMeasure","rangeMove",n)},measurerangeend(i){e.measureSelecting&&(n.handlers.selectionHandler.resumeEngineCalls(n.keys.measureRangeBrushKey,!0),t.doEmit(this.chart,"rangeMeasure","rangeEnd",i),e.measureSelecting=!1)},measurerangecancel(){n.handlers.selectionHandler.resumeEngineCalls(n.keys.measureRangeBrushKey,!1),e.measureSelecting=!1}}}}};function CM(e,t){let n;return n="x-axis"===e?"horizontal"===t?ty.DIRECTION_VERTICAL:ty.DIRECTION_HORIZONTAL:"horizontal"===t?ty.DIRECTION_HORIZONTAL:ty.DIRECTION_VERTICAL,n}var kM={callAreaRangeGesture:function(e,t,n,i){const r=n.keys.dimRangeBrushKey?"majorrange":"measurerange";return{type:"Pan",options:{direction:CM(i,n.isHorizontal),event:"arearange",enable(r,o){if(!n.rangeSelStatus.isOpenDim)return!1;if(e.minoring)return t.isSelectionEnabled();const s="arearange"===n.active.gesture?[i,n.keys.componentKey]:[i],a=DM.isOnComponentForRange(o,s,this);return e.minoring=t.isSelectionEnabled()&&!!o&&!!a,e.minoring}},requireFailure:`lasso ${r}`,recognizeWith:n.handlers.scrollHandler?"drag":null,events:{arearangestart(r){const o="arearange"===n.active.gesture?[i,n.keys.componentKey]:[i];DM.isOnComponentForRange(r,o,this)&&(e.minoring=!0,t.switchTo("arearange",this.chart,r),t.doEmit(this.chart,"rangeMinor","areaStart",r),n.handlers.selectionHandler.pauseEngineCalls(n.keys.areaBrushKey))},arearangemove(i){e.minoring&&(this.chart.brush(n.keys.areaBrushKey).clear(),t.doEmit(this.chart,"rangeMinor","areaMove",i))},arearangeend(i){e.minoring&&(n.handlers.selectionHandler.resumeEngineCalls(n.keys.areaBrushKey,!0),t.doEmit(this.chart,"rangeMinor","areaEnd",i),e.minoring=!1)},arearangecancel(){n.handlers.selectionHandler.resumeEngineCalls(n.keys.areaBrushKey,!1),e.minoring=!1}}}}};var EM={callDimensionRangeGesture:function(e,t,n,i){const r=n.keys.measureRangeBrushKey?"measurerange":"arearange";return{type:"Pan",options:{direction:n.isHorizontal?ty.DIRECTION_VERTICAL:ty.DIRECTION_HORIZONTAL,event:"majorrange",enable(r,o){if(!n.rangeSelStatus.isOpenDim)return!1;if(e.majoring)return t.isSelectionEnabled();const s="majorrange"===n.active.gesture?[i,n.keys.componentKey]:[i],a=DM.isOnComponentForRange(o,s,this);return e.majoring=t.isSelectionEnabled()&&!!o&&!!a,e.majoring&&!!n.keys.dimRangeBrushKey}},requireFailure:`lasso ${r}`,recognizeWith:n.handlers.scrollHandler?"drag":null,events:{majorrangestart(r){const o="majorrange"===n.active.gesture?[i,n.keys.componentKey]:[i];DM.isOnComponentForRange(r,o,this)&&(e.majoring=!0,t.switchTo("majorrange",this.chart,r),t.doEmit(this.chart,"rangeDim","rangeStart",r),n.handlers.selectionHandler.pauseEngineCalls(n.keys.dimRangeBrushKey))},majorrangemove(n){e.majoring&&t.doEmit(this.chart,"rangeDim","rangeMove",n)},majorrangeend(i){e.majoring&&(n.handlers.selectionHandler.resumeEngineCalls(n.keys.dimRangeBrushKey,!0),t.doEmit(this.chart,"rangeDim","rangeEnd",i),e.majoring=!1)},majorrangecancel(){n.handlers.selectionHandler.resumeEngineCalls(n.keys.dimRangeBrushKey,!1),e.majoring=!1}}}}};var AM={callDragGesture:function(e,t,n,i,r){let o={};return{type:"Pan",options:{direction:n.isHorizontal?ty.DIRECTION_VERTICAL:ty.DIRECTION_HORIZONTAL,event:"drag",enable(i,r){return e.dragging?t.isNavigationEnabled():(e.dragging=t.isNavigationEnabled()&&!!r&&!!this.chart.componentsFromPoint({x:r.center.x,y:r.center.y}).filter((e=>e.settings.key===n.keys.componentKey))[0],e.dragging)}},requireFailure:i?`lasso ${t.getBrushConfig()}`:"",events:{dragstart(e){o={x:e.deltaX,y:e.deltaY};let t=-(n.isHorizontal?e.deltaY:e.deltaX)/n.handlers.scrollHandler.getItemSize();!n.isHorizontal&&r&&(t=-t),n.handlers.scrollHandler.getScrollApi().move(t)},dragmove(t){if(!e.dragging)return;let i=-(n.isHorizontal?t.deltaY-o.y:t.deltaX-o.x)/n.handlers.scrollHandler.getItemSize();!n.isHorizontal&&r&&(i=-i),n.handlers.scrollHandler.getScrollApi().move(i),o={x:t.deltaX,y:t.deltaY}},dragend(){e.dragging&&(e.dragging=!1)},dragcancel(){e.dragging=!1}}}}};var TM={callNavBtnGesture:function(e,t){return{type:"Tap",options:{event:"navBtnTap",enable(n,i){return!(!i||!e())&&DM.isOnComponentForNavBtn(i,t,this)}},events:{navBtnTap(e){this.chart.componentsFromPoint(e.center).forEach((t=>{const n=e.target,i=n?n.getAttribute("data-action"):"";if(i)return t.emit(i)}))}}}}};var IM={create:function(e,t,n,i,r){const o={};t=t||"vertical";const s=i.lassoBrushKey||"select",a=i.dimRangeBrushKey||null,l=i.measureRangeBrushKey||null,c=i.areaBrushKey||null,u=i.legendBrushKey||null,h=!!e.selectionHandler&&e.selectionHandler.isOn(),d={dragging:!1,lassoing:!1,majoring:!1,minoring:!1,measureSelecting:!1},f={gesture:"",type:""},p="horizontal"===t,m=p?"y-axis":"x-axis",g=p?"x-axis":"y-axis";function y(e,t,n){if(f.gesture===e)return;let i=s;const r=t||f.chart;switch(f.gesture){case"majorrange":v(r,"rangeDim","rangeClear",n),i=a;break;case"measurerange":v(r,"rangeMeasure","rangeClear",n),i=l;break;case"arearange":v(r,"rangeMinor","areaClear",n),i=c}f.gesture=e;const o="range"===e?"range":"item";f.type&&f.type!==o&&r.brush(i).clear(),f.chart=t,f.type=o}function v(e,t,n,i){if(e){const r=e.component(t);r&&r.emit(n,i)}}let b=[];const x={isSelectionEnabled:()=>e.selectionHandler&&e.selectionHandler.isOn(),isNavigationEnabled:()=>e.scrollHandler&&e.scrollHandler.isOn(),doEmit:v,switchTo:y,getBrushConfig:function(){return a?l?"majorrange measurerange":"majorrange arearange":"measurerange arearange"}},w={handlers:e,keys:i,isHorizontal:p,active:f,rangeSelStatus:r};function q(){y("none"),d.majoring=!1,d.measureSelecting=!1,d.minoring=!1}return h&&(b=[{type:"Tap",options:{event:"rangeClearTap"},events:{rangeClearTap(e){y("none",this.chart,e),d.majoring=!1,d.measureSelecting=!1,d.minoring=!1}}}],b.unshift(TM.callNavBtnGesture(x.isNavigationEnabled,u)),b.push(SM.callLassoGesture(d,x,w)),a?l?(b.push(EM.callDimensionRangeGesture(d,x,w,m)),e.selectionHandler.addComponent(a,{id:"rangeDim",clear:"rangeClear"}),b.push(_M.callMeasureRangeGesture(d,x,w,g)),e.selectionHandler.addComponent(l,{id:"rangeMeasure",clear:"rangeClear"})):(b.push(EM.callDimensionRangeGesture(d,x,w,m)),e.selectionHandler.addComponent(a,{id:"rangeDim",clear:"rangeClear"}),b.push(kM.callAreaRangeGesture(d,x,w,g)),e.selectionHandler.addComponent(c,{id:"rangeMinor",clear:"areaClear"})):(b.push(_M.callMeasureRangeGesture(d,x,w,g)),e.selectionHandler.addComponent(l,{id:"rangeMeasure",clear:"rangeClear"}),b.push(kM.callAreaRangeGesture(d,x,w,m)),e.selectionHandler.addComponent(c,{id:"rangeMinor",clear:"areaClear"}))),e.scrollHandler&&(b.push(AM.callDragGesture(d,x,w,h,n)),e.scrollHandler.getScrollApi().on("update",q)),o.gestures=b,o.destroy=function(){e.scrollHandler&&e.scrollHandler.getScrollApi().removeListener("update",q)},o}};function RM(e,t,n,i,r){let o=!1;i=i||"tooltip",n=n||["self"];const s=e.brush(i),a={};function l(){if(o){e.component(r).emit("hide")}o=!1}return a.isOpen=function(){return o},a.closeTooltip=l,a.update=function(){const a=s.brushes(),c=e.getAffectedShapes(i,"and",n,t);a.length>=1?(o=!0,function(t){o=!0;const n={nodes:t};e.component(r).emit("show",{},n)}(c)):l()},a.toggleInterceptor=function(e){if(n.length>1){const t={},n=[];return e.forEach((e=>{t[e.key]||(t[e.key]={}),t[e.key][e.value]||(t[e.key][e.value]=!0,n.push(e))})),n}return e},a}var NM={create:(...e)=>RM(...e)},OM={formatMeasureValue:function(e,t){if(e.raw().isCustomFormatted)return e.formatter()(t.value.qText);const n=void 0!==t.value.qNum?t.value.qNum:t.value.qValue;return e.formatter()(n)}};const PM=e=>({h:t,data:n,style:i})=>{const r=function(e,t){const n=e.chartInstance.dataset(e.dataPath),i=[],r=t.length-5,o=Math.min(5,t.length);for(let r=0;r<o;r++){const o=t[r],s={rows:[]};if(e.labelData){const t=[],r=e.labelData;let a=!1;for(let e=0;e<r.length;e++){const n=o.data[r[e]].value;if(-2===n.qElemNo||-2===n.qElemNumber){a=!0;break}t.push(o.data[r[e]].value.qText)}if(a)return;s.header=e.headerResolver(t),s.rows=e.measureRows.map((t=>{const i=o.data;return e.rowResolver(n.field(i[t].source.field),i[t],i)})).filter((e=>!!e));const l=LM(e,o);l&&s.rows.unshift(l),i.push(s)}}r>0&&(i.numberInExcess=r);return i.rowCount=i[0]?i.length*i[0].rows.length:0,i}(e,n),o={h:t,style:i,rtl:"rtl"===e.direction,translator:e.translator};return e.renderer(o,r)};function LM(e,t){var n,i,r;const o=t.data.color,s=null===(n=e.colorService)||void 0===n||null===(i=n.getSettings)||void 0===i?void 0:i.call(n);if(!s||"color"===s.type||!o||!s.fieldType)return;const a=[];e.data.forEach((e=>{const n=t.data[e];n&&a.push(n.value)}));const l=function(e){let t=-1;for(let n=0;n<e.length;n++)-3===e[n]&&(t=n);return t}(a),{translator:c}=e,u=s.label;return{color:null===(r=t.attrs)||void 0===r?void 0:r.fill,label:u,value:-1!==l?c.get("properties.dimensionLimits.others"):o.label}}const FM="dist-flow-tooltip",zM=`#${FM}`;function jM(){if(!document.querySelector(zM)){const e=document.createElement("div");e.id=FM,e.style.overflow="hidden",e.style.position="fixed",e.style.pointerEvents="none",e.style.left="0px",e.style.top="0px",e.style.width="100%",e.style.height="100%",e.style.zIndex=1020,document.body.appendChild(e)}}function HM({key:e="tooltip",rtl:t,fontFamily:n,filter:i,content:r}){return{show:!0,key:e,type:"tooltip",layout:{displayOrder:3},beforeMount(){jM()},beforeUpdate(){jM()},destroyed(){!function(){const e=document.querySelector(zM);e&&e.parentElement&&e.childElementCount<1&&e.parentElement.removeChild(e)}()},settings:{appendTo:()=>document.querySelector(zM),content:r,filter:i,extract:e=>e.node,direction:t?"rtl":"ltr",placement:"bounds"},style:{arrow:{color:"#404040"},content:{display:"table","border-spacing":"4px",background:"rgba(64, 64, 64, 0.9)",opacity:"1",fontSize:"13px",fontFamily:n,"empty-cells":"show"},cell:{"max-width":"180px","word-break":"break-word","word-wrap":"break-word","overflow-wrap":"break-word",hyphens:"auto"}}}}const{detectTextDirection:BM}=Cq;const VM={tooltipKey:"tooltip",data:[""],contexts:["tooltip"],headerResolver:e=>e.join(", "),rowResolver:(e,t)=>({value:OM.formatMeasureValue(e,t),label:e.title()}),direction:"ltr",renderer:function(e,t){const{h:n,style:i,translator:r,rtl:o}=e,s=[],a=o?"right":"left";if(t.forEach((e=>{if(e.header){const t={...i.cell,textAlign:a,fontWeight:"bold",direction:BM(e.header)};s.push(n("tr",null,n("td",{style:t,colSpan:2},e.header)))}e.rows.forEach((e=>{let t=e.value;if(e.color){const i={display:"inline-block",width:10,height:10,"background-color":e.color,margin:"0 8px"},r=n("div",{style:i});t=o?[e.value,r]:[r,e.value]}const r=o?[":",e.label]:[e.label,":"],l={...i.cell,textAlign:a,direction:BM(e.label)},c={...i.cell,textAlign:o?"left":"right",direction:BM(e.value)};s.push(n("tr",null,n("td",{style:l},r),n("td",{style:c},t)))}))})),t.numberInExcess){const e=r.get("Object.ChartTooltip.NMore",t.numberInExcess),o={...i.cell,textAlign:a,direction:BM(e)};s.push(n("tr",null,n("td",{style:o,colSpan:2},e)))}return s}};function $M(e,t,n){if(!e)throw Error("Tooltips-handler: Missing input");let i={},r=!1;const o={};function s(e){e.listeners.update=function(t,n){e.action.update(t,n,e)},e.listeners.end=function(){e.action.closeTooltip()},e.brush.on(e.treatAsDesktop?"update":"set-values",e.listeners.update),e.brush.on("end",e.listeners.end),e.brush.intercept("set-values",e.action.toggleInterceptor)}function a(){Object.keys(i).forEach((e=>{l(i[e])}))}function l(e){e.brush.removeListener(e.treatAsDesktop?"update":"set-values",e.listeners.update),e.brush.removeListener("end",e.listeners.end),e.brush.removeInterceptor("set-values",e.action.toggleInterceptor)}function c(){Object.keys(i).forEach((e=>{i[e].action.closeTooltip()}))}function u(){c();for(const e in i)i[e].brush.clear()}return o.setUp=function(t){const o=rw(!0,{},VM,t);if(!o.componentKey)throw Error("Tooltips-handler.setUp: Missing required input");i[o.contexts[0]]&&r&&l(i[o.contexts[0]]);const a=function(e,t){return{brush:t.brush(e.contexts[0]),action:NM.create(t,e.componentKey,e.data,e.contexts[0],e.tooltipKey),listeners:{},chartInstance:t,dataPath:e.dataPath,renderer:e.renderer,data:e.data,headerResolver:e.headerResolver,rowResolver:e.rowResolver,colorService:e.colorService,attrDimPath:e.attrDimPath,measureRows:e.measureRows,labelData:e.labelData,filterShapes:e.filterShapes,direction:e.environment.options.direction,theme:e.environment.theme,translator:e.environment.translator,treatAsDesktop:"touch"!==e.environment.deviceType}}(o,e);i[o.contexts[0]]=a,r&&s(a);const c=HM({key:o.tooltipKey,rtl:"rtl"===a.direction,fontFamily:a.theme.getStyle(n,"tooltip","fontFamily"),filter:(u=a.filterShapes,e=>u?u(e):function(e){const t=[];return e.forEach((e=>{-1===t.indexOf(e)&&"container"!==e.type&&t.push(e)})),t}(e)),content:PM(a,o.dataPath)});var u;return o.chartBuilder.getSettings().components.push(c),{trigger:{on:a.treatAsDesktop?"over":"tap",action:"set",contexts:o.contexts,data:o.data,globalPropagation:"stop"},consume:o.contexts.map((e=>({context:e}))),component:c}},o.tearDown=function(){r&&a(),i=[]},o.closeTooltip=c,o.isOn=()=>r,o.on=function(){r||(r=!0,Object.keys(i).forEach((e=>{s(i[e])})),t&&t.on("mouseleave",u))},o.off=function(){r&&(r=!1,a(),t&&t.off("mouseleave",u),c())},o}var WM={create:(e,t,n)=>$M(e,t,n)};const UM=".scrollHandler";function YM(e,t,n,i,r){if(!e||!t||!n)throw Error("Scroll-handler: Missing input");this._chartInstance=e,this._$chartElement=t,this._getSlicedDataFn=n,this._on=!1,this._itemSize=30,this.options={direction:"vertical"},this._onScrollCallback=i,this._legendKey=r}function XM(){const e=("horizontal"===this.options.direction?this._$chartElement.width():this._$chartElement.height())||0,t=Math.floor(e/this.getItemSize());this._scrollViewSizeInItem=Math.max(t,1)}function KM(e){const t=function(e){let t=0,n=0,i=0;return e.wheelDelta&&(t=e.wheelDelta/60),e.detail&&(t=-e.detail/3),i=t,void 0!==e.axis&&e.axis===e.HORIZONTAL_AXIS&&(i=0,n=-1*t),void 0!==e.wheelDeltaY&&(i=e.wheelDeltaY/60),void 0!==e.wheelDeltaX&&(n=-1*e.wheelDeltaX/60),{delta:t,deltaX:n,deltaY:i,x:e.pageX,y:e.pageY}}(e.originalEvent);if(function(e,t,n,i){if(i&&n.componentsFromPoint(t).some((e=>e.settings.key===i)))return n.component(i).emit(t.delta>0?"prev":"next"),e.preventDefault(),!0;return!1}(e,t,this._chartInstance,this._legendKey)||this._disabled||!this.getScrollApi())return;if(e.preventDefault(),!t.delta)return;const n=t.delta<0?3:-3;this._scrollApi.move(n)}function GM(){if(this._disabled||this._sizeChanged)return void(this._sizeChanged=!1);const e=this;this.getViewData().then((t=>{e._on&&!e._disabled&&e._onScrollCallback&&e._onScrollCallback(t,void 0,!0)})).catch((e=>{}))}YM.prototype.getScrollApi=function(){this._scrollApi||(this._scrollApi=this._chartInstance.scroll("dimension"));return this._scrollApi},YM.prototype.setDisabled=function(e){this._disabled=e},YM.prototype.getDisabled=function(){return this._disabled},YM.prototype.setItemSize=function(e){this._itemSize!==e&&(this._itemSize=e,XM.call(this))},YM.prototype.getItemSize=function(){return this._itemSize},YM.prototype.getScrollViewSizeInItem=function(){this._scrollViewSizeInItem||XM.call(this);return this._scrollViewSizeInItem},YM.prototype.on=function(){if(this._on)return;this.getScrollApi()&&(this._scrollApi.removeAllListeners(),this._scrollApi.on("update",GM.bind(this)));this._$chartElement.on(`mousewheel${UM} DOMMouseScroll${UM}`,KM.bind(this)),this._$chartElement.on(`touchstart${UM}`,(e=>{e.preventDefault()})),this._on=!0},YM.prototype.isOn=function(){return this._on},YM.prototype.off=function(){if(!this._on)return;this.getScrollApi()&&this._scrollApi.removeAllListeners();this._$chartElement.off(UM),this._on=!1},YM.prototype.updateViewState=function(e){XM.call(this),this.getScrollApi()&&this._scrollApi.update({viewSize:this._scrollViewSizeInItem,max:e})},YM.prototype.onResize=function(){this._sizeChanged=!0,XM.call(this),this.getScrollApi()&&this._scrollApi.update({viewSize:this._scrollViewSizeInItem})},YM.prototype.isDataSizeChanged=function(e,t){return Math.min(this.getScrollViewSizeInItem(),t)!==e},YM.prototype.resetScroll=function(){this.getScrollApi()&&this._scrollApi.moveTo(0)},YM.prototype.getViewData=function(){let e=0,t=0;if(this.getScrollApi()){const n=this._scrollApi.getState();e=Math.round(n.start),t=n.viewSize}return this._getSlicedDataFn(e,t)},YM.prototype.setOptions=function(e){this.options.direction!==e.direction&&(this._scrollViewSizeInItem=void 0);this.options=e},YM.prototype.getScrollState=function(){return this.getScrollApi().getState().start},YM.prototype.setScrollState=function(e){this.getScrollApi().moveTo(e)};function JM(e){return(12*Math.min(e,3)+6.384615384615385*Math.max(e-3,0))/11}function ZM(e){if(!e)return{latin:0,cjk:0};let t=e.match(/[\u4E00-\u9FFF]/g),n=e.match(/[\u3040-\u309F]/g),i=e.match(/[\u30A0-\u30FF]/g);t=t?t.length:0,n=n?n.length:0,i=i?i.length:0;const r=t+n+i;return{latin:e.length-r,cjk:r}}function QM(e,t){const n={latin:0,cjk:0};void 0===t?e.forEach((e=>{const t=ZM(e.qText);n.latin+=t.latin,n.cjk+=t.cjk})):e.forEach((e=>{const i=ZM(e[t].qText);n.latin+=i.latin,n.cjk+=i.cjk}));const i=Math.max(1,n.latin+n.cjk);return n.latinRatio=n.latin/i,n.cjkRatio=n.cjk/i,n}function eD(e,t,n){return e*(e<=24?t:n)}var tD={endsWith:function(e,t){return-1!==e.indexOf(t,e.length-t.length)},startsWith:function(e,t){return 0===e.indexOf(t)},contains:function(e,t){if(!e)throw new Error("Haystack is undefined.");if(!t)throw new Error("Needle is undefined.");return-1!==e.indexOf(t)},stringWidthOverMWidth:JM,getCharacterRatios:ZM,getTotalCharacterRatios:QM,getAdjustedMaxGlyphCount:function(e,t,n){const i=QM(t,n),r=i.latinRatio*e,o=i.cjkRatio*e;return Math.ceil(JM(r)+1.0909090909090908*o)},estimateLatinLabelWidth:eD,estimateLabelWidth:function(e,t,n,i,r){return e*n+eD(t,i,r)}};const nD={aliceblue:{r:240,g:248,b:255},antiquewhite:{r:250,g:235,b:215},aqua:{r:0,g:255,b:255},aquamarine:{r:127,g:255,b:212},azure:{r:240,g:255,b:255},beige:{r:245,g:245,b:220},bisque:{r:255,g:228,b:196},black:{r:0,g:0,b:0},blanchedalmond:{r:255,g:235,b:205},blue:{r:0,g:0,b:255},blueviolet:{r:138,g:43,b:226},brown:{r:165,g:42,b:42},burlywood:{r:222,g:184,b:135},cadetblue:{r:95,g:158,b:160},chartreuse:{r:127,g:255,b:0},chocolate:{r:210,g:105,b:30},coral:{r:255,g:127,b:80},cornflowerblue:{r:100,g:149,b:237},cornsilk:{r:255,g:248,b:220},crimson:{r:220,g:20,b:60},cyan:{r:0,g:255,b:255},darkblue:{r:0,g:0,b:139},darkcyan:{r:0,g:139,b:139},darkgoldenrod:{r:184,g:134,b:11},darkgray:{r:169,g:169,b:169},darkgreen:{r:0,g:100,b:0},darkgrey:{r:169,g:169,b:169},darkkhaki:{r:189,g:183,b:107},darkmagenta:{r:139,g:0,b:139},darkolivegreen:{r:85,g:107,b:47},darkorange:{r:255,g:140,b:0},darkorchid:{r:153,g:50,b:204},darkred:{r:139,g:0,b:0},darksalmon:{r:233,g:150,b:122},darkseagreen:{r:143,g:188,b:143},darkslateblue:{r:72,g:61,b:139},darkslategray:{r:47,g:79,b:79},darkslategrey:{r:47,g:79,b:79},darkturquoise:{r:0,g:206,b:209},darkviolet:{r:148,g:0,b:211},deeppink:{r:255,g:20,b:147},deepskyblue:{r:0,g:191,b:255},dimgray:{r:105,g:105,b:105},dimgrey:{r:105,g:105,b:105},dodgerblue:{r:30,g:144,b:255},firebrick:{r:178,g:34,b:34},floralwhite:{r:255,g:250,b:240},forestgreen:{r:34,g:139,b:34},fuchsia:{r:255,g:0,b:255},gainsboro:{r:220,g:220,b:220},ghostwhite:{r:248,g:248,b:255},gold:{r:255,g:215,b:0},goldenrod:{r:218,g:165,b:32},gray:{r:128,g:128,b:128},green:{r:0,g:128,b:0},greenyellow:{r:173,g:255,b:47},grey:{r:128,g:128,b:128},honeydew:{r:240,g:255,b:240},hotpink:{r:255,g:105,b:180},indianred:{r:205,g:92,b:92},indigo:{r:75,g:0,b:130},ivory:{r:255,g:255,b:240},khaki:{r:240,g:230,b:140},lavender:{r:230,g:230,b:250},lavenderblush:{r:255,g:240,b:245},lawngreen:{r:124,g:252,b:0},lemonchiffon:{r:255,g:250,b:205},lightblue:{r:173,g:216,b:230},lightcoral:{r:240,g:128,b:128},lightcyan:{r:224,g:255,b:255},lightgoldenrodyellow:{r:250,g:250,b:210},lightgray:{r:211,g:211,b:211},lightgreen:{r:144,g:238,b:144},lightgrey:{r:211,g:211,b:211},lightpink:{r:255,g:182,b:193},lightsalmon:{r:255,g:160,b:122},lightseagreen:{r:32,g:178,b:170},lightskyblue:{r:135,g:206,b:250},lightslategray:{r:119,g:136,b:153},lightslategrey:{r:119,g:136,b:153},lightsteelblue:{r:176,g:196,b:222},lightyellow:{r:255,g:255,b:224},lime:{r:0,g:255,b:0},limegreen:{r:50,g:205,b:50},linen:{r:250,g:240,b:230},magenta:{r:255,g:0,b:255},maroon:{r:128,g:0,b:0},mediumaquamarine:{r:102,g:205,b:170},mediumblue:{r:0,g:0,b:205},mediumorchid:{r:186,g:85,b:211},mediumpurple:{r:147,g:112,b:219},mediumseagreen:{r:60,g:179,b:113},mediumslateblue:{r:123,g:104,b:238},mediumspringgreen:{r:0,g:250,b:154},mediumturquoise:{r:72,g:209,b:204},mediumvioletred:{r:199,g:21,b:133},midnightblue:{r:25,g:25,b:112},mintcream:{r:245,g:255,b:250},mistyrose:{r:255,g:228,b:225},moccasin:{r:255,g:228,b:181},navajowhite:{r:255,g:222,b:173},navy:{r:0,g:0,b:128},oldlace:{r:253,g:245,b:230},olive:{r:128,g:128,b:0},olivedrab:{r:107,g:142,b:35},orange:{r:255,g:165,b:0},orangered:{r:255,g:69,b:0},orchid:{r:218,g:112,b:214},palegoldenrod:{r:238,g:232,b:170},palegreen:{r:152,g:251,b:152},paleturquoise:{r:175,g:238,b:238},palevioletred:{r:219,g:112,b:147},papayawhip:{r:255,g:239,b:213},peachpuff:{r:255,g:218,b:185},peru:{r:205,g:133,b:63},pink:{r:255,g:192,b:203},plum:{r:221,g:160,b:221},powderblue:{r:176,g:224,b:230},purple:{r:128,g:0,b:128},red:{r:255,g:0,b:0},rosybrown:{r:188,g:143,b:143},royalblue:{r:65,g:105,b:225},saddlebrown:{r:139,g:69,b:19},salmon:{r:250,g:128,b:114},sandybrown:{r:244,g:164,b:96},seagreen:{r:46,g:139,b:87},seashell:{r:255,g:245,b:238},sienna:{r:160,g:82,b:45},silver:{r:192,g:192,b:192},skyblue:{r:135,g:206,b:235},slateblue:{r:106,g:90,b:205},slategray:{r:112,g:128,b:144},slategrey:{r:112,g:128,b:144},snow:{r:255,g:250,b:250},springgreen:{r:0,g:255,b:127},steelblue:{r:70,g:130,b:180},tan:{r:210,g:180,b:140},teal:{r:0,g:128,b:128},thistle:{r:216,g:191,b:216},tomato:{r:255,g:99,b:71},transparent:{r:255,g:255,b:255,a:0},turquoise:{r:64,g:224,b:208},violet:{r:238,g:130,b:238},wheat:{r:245,g:222,b:179},white:{r:255,g:255,b:255},whitesmoke:{r:245,g:245,b:245},yellow:{r:255,g:255,b:0},yellowgreen:{r:154,g:205,b:50}},iD=/^rgb\((\d{1,3}),(\d{1,3}),(\d{1,3})\)$/i,rD=/^rgba\((\d{1,3}),(\d{1,3}),(\d{1,3}),(\d(\.\d+)?)\)$/i,oD=/^#([A-f0-9]{2})([A-f0-9]{2})([A-f0-9]{2})$/i,sD=/^#([A-f0-9])([A-f0-9])([A-f0-9])$/i,aD=/^hsl\(\s*(\d+(\.\d+)?)\s*,\s*(\d+(\.\d+)?%?)\s*,\s*(\d+(\.\d+)?%?)\s*\)$/i,lD=/^hsla\(\s*(\d+(\.\d+)?)\s*,\s*(\d+(\.\d+)?%?)\s*,\s*(\d+(\.\d+)?%?)\s*,(\d(\.\d+)?)\)$/i,cD=Math.floor,uD=Math.round,hD=Mx.extend({init(){let e,t,n,i,r,o,s,a,l,c,u,h,d=0,f=0,p=0,m=1;if(this._invalid=!1,arguments[0]instanceof hD)d=arguments[0]._r,f=arguments[0]._g,p=arguments[0]._b,m=arguments[0]._a,this._invalid=arguments[0]._invalid;else if(arguments.length<3)if("string"==typeof arguments[0])if(h=arguments[0],u=/^rgb\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*\)$/i.exec(h))d=parseInt(u[1],10),f=parseInt(u[2],10),p=parseInt(u[3],10);else if(u=/^rgba\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d(\.\d+)?)\s*\)$/i.exec(h))d=parseInt(u[1],10),f=parseInt(u[2],10),p=parseInt(u[3],10),m=parseFloat(u[4]);else if(u=/^#([A-f0-9]{2})([A-f0-9]{2})([A-f0-9]{2})$/i.exec(h))d=parseInt(u[1],16),f=parseInt(u[2],16),p=parseInt(u[3],16),m=1;else if(u=/^#([A-f0-9])([A-f0-9])([A-f0-9])$/i.exec(h))d=parseInt(u[1]+u[1],16),f=parseInt(u[2]+u[2],16),p=parseInt(u[3]+u[3],16),m=1;else if(u=/^hsl\(\s*(\d+(\.\d+)?)\s*,\s*(\d+(\.\d+)?%?)\s*,\s*(\d+(\.\d+)?%?)\s*\)$/i.exec(h)){switch(e=parseFloat(u[1]),t=parseFloat(u[3]),i=parseFloat(u[5]),e%=360,t/=100,i/=100,e=e<0?0:e>360?360:e,t=t<0?0:t>1?1:t,i=i<0?0:i>1?1:i,o=i<=.5?2*i*t:(2-2*i)*t,s=e/60,a=o*(1-Math.abs(s%2-1)),l=[],s=Math.floor(s),s){case 0:l=[o,a,0];break;case 1:l=[a,o,0];break;case 2:l=[0,o,a];break;case 3:l=[0,a,o];break;case 4:l=[a,0,o];break;case 5:l=[o,0,a];break;default:l=[0,0,0]}c=i-.5*o,d=l[0]+c,f=l[1]+c,p=l[2]+c,d=uD(255*d),f=uD(255*f),p=uD(255*p),m=1}else if(u=/^hsla\(\s*(\d+(\.\d+)?)\s*,\s*(\d+(\.\d+)?%?)\s*,\s*(\d+(\.\d+)?%?)\s*,(\d(\.\d+)?)\)$/i.exec(h)){switch(e=parseFloat(u[1]),t=parseFloat(u[3]),i=parseFloat(u[5]),m=parseFloat(u[7]),e%=360,t/=100,i/=100,e=e<0?0:e>360?360:e,t=t<0?0:t>1?1:t,i=i<0?0:i>1?1:i,o=i<=.5?2*i*t:(2-2*i)*t,s=e/60,a=o*(1-Math.abs(s%2-1)),l=[],s=Math.floor(s),s){case 0:l=[o,a,0];break;case 1:l=[a,o,0];break;case 2:l=[0,o,a];break;case 3:l=[0,a,o];break;case 4:l=[a,0,o];break;case 5:l=[o,0,a];break;default:l=[0,0,0]}c=i-.5*o,d=l[0]+c,f=l[1]+c,p=l[2]+c,d=uD(255*d),f=uD(255*f),p=uD(255*p)}else if(u=/^hsv\(\s*(\d+(\.\d+)?)\s*,\s*(\d+(\.\d+)?%?)\s*,\s*(\d+(\.\d+)?%?)\s*\)$/i.exec(h)){switch(e=parseFloat(u[1]),t=parseFloat(u[3]),r=parseFloat(u[5]),e%=360,t/=100,r/=100,e=e<0?0:e>360?360:e,t=t<0?0:t>1?1:t,r=r<0?0:r>1?1:r,o=r*t,s=e/60,a=o*(1-Math.abs(s%2-1)),l=[],s=Math.floor(s),s){case 0:l=[o,a,0];break;case 1:l=[a,o,0];break;case 2:l=[0,o,a];break;case 3:l=[0,a,o];break;case 4:l=[a,0,o];break;case 5:l=[o,0,a];break;default:l=[0,0,0]}c=r-o,d=l[0]+c,f=l[1]+c,p=l[2]+c,d=uD(255*d),f=uD(255*f),p=uD(255*p),m=1}else nD[h.toLowerCase()]?(n=h.toLowerCase(),d=nD[n].r,f=nD[n].g,p=nD[n].b,m="number"==typeof nD[n].a?nD[n].a:1):this._invalid=!0;else"number"==typeof arguments[0]&&arguments[0]>=0&&"argb"===arguments[1]?(m=(4278190080&arguments[0])>>>24,m/=255,d=(16711680&arguments[0])>>16,f=(65280&arguments[0])>>8,p=255&arguments[0]):"number"==typeof arguments[0]&&arguments[0]>=0?(d=(16711680&arguments[0])>>16,f=(65280&arguments[0])>>8,p=255&arguments[0]):this._invalid=!0;else arguments.length>=3?(d=arguments[0],f=arguments[1],p=arguments[2],m=arguments.length>=4?arguments[3]:1):this._invalid=!0;Number.isNaN(+d+f+p+m)&&(this._invalid=!0),this._r=cD(d),this._g=cD(f),this._b=cD(p),this._a=m,this._spaces={}},isInvalid(){return this._invalid},setAlpha(e){this._a=e,this._spaces={}},getAlpha(){return this._a},toRGB:function(){return this._spaces.rgb||(this._spaces.rgb=hD.toRGB(this)),this._spaces.rgb},toRGBA:function(){return this._spaces.rgba||(this._spaces.rgba=hD.toRGBA(this)),this._spaces.rgba},toString(){return this._spaces.rgb||(this._spaces.rgb=hD.toRGB(this)),this._spaces.rgb},toHex:function(){return this._spaces.hex||(this._spaces.hex=hD.toHex(this)),this._spaces.hex},toHSL:function(e){return this._spaces.hsl||(this._spaces.hsl=hD.toHSL(this,e)),this._spaces.hsl},toHSLA:function(e){return this._spaces.hsla||(this._spaces.hsla=hD.toHSLA(this,e)),this._spaces.hsla},toHSV(){const e=this.toHSVComponents();return`hsv(${e.h},${e.s},${e.v})`},toHSVComponents:function(){return this._spaces.hsvComp||(this._spaces.hsvComp=hD.toHSVComponents(this)),this._spaces.hsvComp},toNumber:function(){return this._spaces.num||(this._spaces.num=hD.toNumber(this)),this._spaces.num},isDark(){return this.isInvalid()||this.getLuminance()<125},getLuminance(){return void 0===this._lumi&&(this._lumi=.299*this._r+.587*this._g+.114*this._b),this._lumi},shiftLuminance(e){const t=this.toHSLA(),n=/^hsla\(\s*(\d+(\.\d+)?)\s*,\s*(\d+(\.\d+)?%?)\s*,\s*(\d+(\.\d+)?%?)\s*,(\d(\.\d+)?)\)$/i.exec(t),i=parseFloat(n[1]),r=parseFloat(n[3]);let o=parseFloat(n[5]);const s=parseFloat(n[7]);return o+=e,o=Math.max(0,Math.min(o,100)),`hsla(${i},${r},${o},${s})`},isEqual(e){return e instanceof hD||(e=new hD(e)),this._r===e._r&&this._g===e._g&&this._b===e._b},blend(e,t){return`rgba(${[cD(this._r+(e._r-this._r)*t),cD(this._g+(e._g-this._g)*t),cD(this._b+(e._b-this._b)*t),cD(this._a+(e._a-this._a)*t)].join(",")})`},createShiftedColor(e){(void 0===e||Number.isNaN(+e))&&(e=1);const t=this.getLuminance(),n=this._g<126?1:1+this._g/512,i=this.shiftLuminance(20*(t*n<220?.8+1/(t+1)*4:-(.8+t/255*1))*e);return new hD(i)}});hD.toRGB=function(e){if(e instanceof hD)return`rgb(${[e._r,e._g,e._b].join(",")})`;"string"==typeof e&&(e=hD.toNumber(e));return`rgb(${(16711680&e)>>16},${(65280&e)>>8},${255&e})`},hD.toRGBA=function(e,t){if(e instanceof hD)return`rgba(${[e._r,e._g,e._b,void 0!==t?t:e._a].join(",")})`;"string"==typeof e&&(e=hD.toNumber(e));return`rgba(${(16711680&e)>>16},${(65280&e)>>8},${255&e},${void 0!==t?t:e._a})`},hD.toHex=function(e){let t,n,i;return e instanceof hD?(t=e._r.toString(16),n=e._g.toString(16),i=e._b.toString(16),1===t.length&&(t=`0${t}`),1===n.length&&(n=`0${n}`),1===i.length&&(i=`0${i}`),`#${[t,n,i].join("")}`):("string"==typeof e&&(e=hD.toNumber(e)),t=((16711680&e)>>16).toString(16),n=((65280&e)>>8).toString(16),i=(255&e).toString(16),1===t.length&&(t=`0${t}`),1===n.length&&(n=`0${n}`),1===i.length&&(i=`0${i}`),`#${t}${n}${i}`)},hD.toHSL=function(e,t){let n,i,r,o=0;"string"==typeof e&&(e=new hD(e));const s=e._r/255,a=e._g/255,l=e._b/255,c=Math.max(s,a,l),u=Math.min(s,a,l);if(i=t?.21*s+.72*a+.07*l:(c+u)/2,c===u)n=0,o=0;else{switch(r=c-u,n=i>.5?r/(2-c-u):r/(c+u),c){case s:o=(a-l)/r+(a<l?6:0);break;case a:o=(l-s)/r+2;break;case l:o=(s-a)/r+4}o/=6}return`hsl(${360*o},${100*n},${100*i})`},hD.toHSLA=function(e,t){let n,i,r,o=0;"string"==typeof e&&(e=new hD(e));const s=e._r/255,a=e._g/255,l=e._b/255,c=e._a,u=Math.max(s,a,l),h=Math.min(s,a,l);if(i=t?.21*s+.72*a+.07*l:(u+h)/2,u===h)n=0,o=0;else{switch(r=u-h,n=i>.5?r/(2-u-h):r/(u+h),u){case s:o=(a-l)/r+(a<l?6:0);break;case a:o=(l-s)/r+2;break;case l:o=(s-a)/r+4}o/=6}return`hsla(${360*o},${100*n},${100*i},${c})`},hD.toHSVComponents=function(e){let t,n,i=0;"string"==typeof e&&(e=new hD(e));const r=e._r/255,o=e._g/255,s=e._b/255,a=Math.max(r,o,s),l=Math.min(r,o,s),c=a;if(a===l)t=0,i=0;else{switch(n=a-l,t=0===n?0:n/c,a){case r:i=(o-s)/n+(o<s?6:0);break;case o:i=(s-r)/n+2;break;case s:i=(r-o)/n+4}i/=6}return{h:360*i%360,s:100*t,v:100*c}},hD.toNumber=function(){if(1===arguments.length&&arguments[0]instanceof hD)return(arguments[0]._r<<16)+(arguments[0]._g<<8)+arguments[0]._b;let e,t,n=0,i=0,r=0;return 1===arguments.length&&"string"==typeof arguments[0]&&(t=arguments[0],(e=/^rgb\((\d{1,3}),(\d{1,3}),(\d{1,3})\)$/i.exec(t))?(n=parseInt(e[1],10),i=parseInt(e[2],10),r=parseInt(e[3],10)):(e=/^#([A-f0-9]{2})([A-f0-9]{2})([A-f0-9]{2})$/i.exec(t))?(n=parseInt(e[1],16),i=parseInt(e[2],16),r=parseInt(e[3],16)):(e=/^#([A-f0-9])([A-f0-9])([A-f0-9])$/i.exec(t))&&(n=parseInt(e[1]+e[1],16),i=parseInt(e[2]+e[2],16),r=parseInt(e[3]+e[3],16))),(n<<16)+(i<<8)+r},hD.blend=function(e,t,n){const i=(16711680&(e=hD.toNumber(e)))>>16,r=(65280&e)>>8,o=255&e;return(i+(((16711680&(t=hD.toNumber(t)))>>16)-i)*n<<16)+(r+(((65280&t)>>8)-r)*n<<8)+(o+((255&t)-o)*n)},hD.getBlend=function(e,t,n){const i=e._r+(t._r-e._r)*n,r=e._g+(t._g-e._g)*n,o=e._b+(t._b-e._b)*n,s=e._a+(t._a-e._a)*n;return new hD(i,r,o,s)},hD.isCSSColor=function(e){return!(arguments.length>1||"string"!=typeof e)&&(iD.test(e)||rD.test(e)||oD.test(e)||sD.test(e)||aD.test(e)||lD.test(e)||nD[e.toLowerCase()])},hD.getBestContrast=function(e,t,n){const i=e.getLuminance();return Math.abs(i-t.getLuminance())>Math.abs(i-n.getLuminance())?t:n},hD.getContrast=function(e,t){if(!e||!t)return;const n=e.getLuminance()/100,i=t.getLuminance()/100;return n>i?(n+.05)/(i+.05):(i+.05)/(n+.05)},hD.isDark=function(){const e={getLuminance:hD.prototype.getLuminance,isInvalid:hD.prototype.isInvalid};return hD.prototype.init.apply(e,[].slice.call(arguments)),hD.prototype.isDark.call(e)},hD.useDarkLabel=function(e,t){return e._a>.5?!e.isDark():!t};const dD={TRANSPARENT_BLACK:"rgba( 0,0,0,0.2 )",TRANSPARENT_WHITE:"rgba( 255,255,255,0.7 )",LIGHT_GREY:"#ccc",DARK_GREY:"#666",BLACK:"#000",WHITE:"#fff",getInverse(e){const t=new hD(e);return 0===t.getAlpha()?this.BLACK:t.isDark()?this.WHITE:this.BLACK},getContrastingGrey(e){const t=new hD(e);return 0===t.getAlpha()?this.DARK_GREY:hD.getBestContrast(t,new hD(dD.LIGHT_GREY),new hD(dD.DARK_GREY))},getBestContrast:(e,t,n)=>hD.getBestContrast(new hD(e),new hD(t),new hD(n)),getContrastingTransparent(e){const t=new hD(e);return 0===t.getAlpha()||"none"===e?this.TRANSPARENT_BLACK:t.isDark()?this.TRANSPARENT_WHITE:this.TRANSPARENT_BLACK}};function fD(e,t){return Rb(e,`${t=t?`${t}.`:""}qHyperCube.qDimensionInfo.length`)>1}function pD(e,t){if(Rb(e,`${t=t?`${t}.`:""}qHyperCube.qStackedDataPages.0.qData.length`))return Rb(e,`${t}qHyperCube.qStackedDataPages.0.qData.0.qSubNodes.length`,0)+Rb(e,`${t}qHyperCube.qStackedDataPages.0.qData.0.qDown`,0)+Rb(e,`${t}qHyperCube.qStackedDataPages.0.qData.0.qUp`,0);const n=Rb(e,`${t}qHyperCube.qEffectiveInterColumnSortOrder.0`);return mD(Rb(e,`${t}qHyperCube.qDimensionInfo.${n}`))}function mD(e){return e.qCardinalities.qHypercubeCardinal}var gD={getHyperCube:function(e,t){return e&&(e=t?Rb(e,t):e)&&e.qHyperCube?e.qHyperCube:null},hasSecondDimension:fD,hasSecondMeasure:function(e,t){return Rb(e,`${t=t?`${t}.`:""}qHyperCube.qMeasureInfo.length`)>1},getStackedCubeSizeOf2Dims:pD,getStackedCubeSizeOfMax2Dims:function(e,t){return fD(e,t)?pD(e,t):function(e,t){return Rb(e,(t=t?`${t}.`:"")+"qHyperCube.qSize.qcy")}(e,t)},getOuterDimensionSizeOfMax2Dims:function(e,t){return fD(e,t)?pD(e,t):1},getDimensionSize:mD};const yD=function(){this._maxJitter=1};yD.prototype.calcMaxJitter=function(e,t,n){this._maxJitter=Math.min(e*t,n-e)},yD.prototype.getJitterValue=function(e){const t=Math.abs(Jq(`${e}`)%10)/9;return this._maxJitter/2-t*this._maxJitter};var vD={toBefore:function(e){const t=e.qUndoExclude.qHyperCube;2===t.qEffectiveInterColumnSortOrder.length&&0===t.qEffectiveInterColumnSortOrder[0]&&(t.qEffectiveInterColumnSortOrder=[1,0],t.qDimensionInfo.reverse())},toAfter:function(e){const t=e.qUndoExclude.qHyperCube;2===t.qEffectiveInterColumnSortOrder.length&&1===t.qEffectiveInterColumnSortOrder[0]&&(t.qEffectiveInterColumnSortOrder=[0,1],t.qDimensionInfo.reverse())}};var bD={generateHyperCube:function(e,t,n,i){t.qUndoExclude||(t.qUndoExclude={}),t.qUndoExclude.qHyperCubeDef=rw(!0,{},t.qHyperCubeDef),t.qUndoExclude.qHyperCubeDef.qDimensions.reverse(),Rw.updateHypercubeAttributes(t,"qUndoExclude.qHyperCubeDef.",t.color.point);let r=[];const o=t.qUndoExclude.qHyperCubeDef.qDimensions.length,s=t.color.point&&!t.color.point.auto&&"byExpression"===t.color.point.mode;if(o>0&&s){r=[kw.create(kw.IDMAP.COLOR_BY_EXPRESSION,{qExpression:Rb(t,"color.point.expression.qValueExpression.qExpr")})]}return t.qUndoExclude.qHyperCubeDef.qMeasures[0].qAttributeExpressions=r,_w.hasMultipleDimensions(t)?uw.getAllHyperCubeExpressions(t.qHyperCubeDef,e.qHyperCube,n).then((r=>{oq.applySorting(t,e,n,r,i);const o=r.dimensions[0],s=r.dimensions[1],a=r.measures[0],l=nq.getFractileExpression(1,o,s,a),c=nq.getFractileExpression(0,o,s,a);t.qUndoExclude.qHyperCubeDef.qDimensions[0].qAttributeExpressions=[{qExpression:c,id:"minBoxValue"},{qExpression:l,id:"maxBoxValue"}]})):(t.qUndoExclude.qHyperCubeDef.qInterColumnSortOrder=[1,0],Promise.resolve())}};const xD=e=>e.baseColor||e.coloring&&e.coloring.baseColor;function wD(e){const{qDimensionInfo:t,qMeasureInfo:n}=e.qUndoExclude.qHyperCube,i=t.some(xD),r=n.some(xD),o=e.color.point.useBaseColors;return"measure"===o&&!r||"dimension"===o&&!i?"off":o}function qD({layout:e,localeInfo:t,model:n,picasso:i,environment:r}){const{app:o,theme:s,translator:a}=r,l=rw(!0,{},e.color.point);var c;return 2===e.qHyperCube.qDimensionInfo.length&&(0===(null==(c=l.byDimDef)?void 0:c.activeDimensionIndex)?c.activeDimensionIndex=1:1===(null==c?void 0:c.activeDimensionIndex)&&(c.activeDimensionIndex=0)),function(e){var t,n,i;return!(!e.snapshotData||null!==(t=e.snapshotData.content)&&void 0!==t&&null!==(n=t.chartData)&&void 0!==n&&n.legendDataPage||null===(i=e.qUndoExclude)||void 0===i||!i.legendData)}(e)&&(e=function(e){return(e=rw({},e)).snapshotData=rw({},e.snapshotData),e.snapshotData.content=rw({},e.snapshotData.content),e.snapshotData.content.chartData=rw({},e.snapshotData.content.chartData),e.snapshotData.content.chartData.legendDataPage=e.qUndoExclude.legendData.qDataPages,e}(e)),l.mode||(l.mode="primary"),function(e){var t,n,i,r,o=e.picasso,s=e.model,a=e.app,l=e.translator,c=e.layoutService,u=void 0===c?void 0:c,h=e.createConfig,d=void 0===h?Ib:h,f=e.config,p=void 0===f?{}:f,m=e.custom,g=void 0===m?{}:m,y=p.localeInfo,v=p.key,b=p.theme,x=void 0===b?void 0:b,w=p.auto,q=void 0===w?void 0:w,M=p.definitionPath,D=null==u||null===(t=u.getLayout)||void 0===t?void 0:t.call(u),S={theme:x,key:v,localeInfo:y,layout:D,hc:null==u||null===(n=u.getHyperCube)||void 0===n?void 0:n.call(u),legendProps:null==u||null===(i=u.getLayoutValue)||void 0===i?void 0:i.call(u,"legend"),colorProps:ay(ay({},null==u||null===(r=u.getLayoutValue)||void 0===r?void 0:r.call(u,"color")),{},{useBaseColors:D?kb(D):void 0})},_=_b({picasso:o,model:s,app:a,translator:l,auto:q});!1!==q&&_.auto((function(e){return q?q({layout:e,defaultAuto:Tb}):Tb(e)}));var C=!1,k={getColor:function(){return _.color()},getPaletteColor:function(e){var t=e.index,n=e.color;return _.resolveUIColor({index:t,color:n})},getData:function(){return _.data()},getDatumProps:function(e){return _.datumProps(e)},getSnapshotData:function(){return _.getSnapshotData(M)},getSettingsForMeasure:function(e){return _.settingsForMeasure(e)},getSettings:function(){return _.settings()},getLegend:function(e,t){return _.legend(e,t)},getScales:function(){return _.scales()},getPalettes:function(){return _.palettes()},isSelectionLocked:function(e){var t=e.isMeasureSelectionLocked;return _.isSelectionLocked({isMeasureSelectionLocked:t})},isInitialized:function(){return C},custom:ay({},g),initialize:function(){var e=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}).createConfig,t=(void 0===e?d:e)({getUseBaseColors:kb}),n=Eb(S,t);return _.config(n),_.getAuxiliarySettings(M).then((function(){C=!0}))}};return k}({app:o,model:n,picasso:i,translator:a,config:{localeInfo:t,theme:s,key:"color",definitionPath:"/qUndoExclude/qHyperCubeDef"},createConfig:()=>({layout:e,hc:e.qUndoExclude.qHyperCube,legendProps:e.legend,colorProps:{...l,useBaseColors:wD(e)}})})}const MD=Dw.DATA_PATH,DD=Dw.HYPERCUBE_PATH,SD=Dw.HYPERCUBE_DEF_PATH;function _D(e){return Array.isArray(e)?e:e?[e]:[]}function CD(e){return Math.min(gD.getOuterDimensionSizeOfMax2Dims(e,MD),Dw.MAX_STACKED_VALUES)}function kD(e,t){return{viewSize:t,max:CD(e)}}function ED(){const e=Dw.MAX_STACKED_VALUES>=this.layout.qUndoExclude.qHyperCube.qSize.qcy?3:1;this.backendApi.setCacheOptions({height:e*this._scrollHandler.getScrollViewSizeInItem(),width:3})}function AD(){if(this.layout&&gD.hasSecondDimension(this.layout,MD)){this._scrollHandler.onResize();!!this.layout.snapshotData||ED.call(this)}}function TD(){const e=this.chartInstance.component("legend");e&&e.emit&&e.emit("resetindex")}function ID(e,t){return Rb(e,`qHyperCube.qDimensionInfo.${t}.qIsOneAndOnlyOne`)||!1}const RD=Gq.extend("DistributionPlot",{namespace:".distributionPlot",init({lasso:e,environment:t,flags:n,picasso:i,$element:r,backendApi:o,selectionsApi:s}){this._super(i,r,t,o,s),this.flags=n,this.picasso=i,this.picassoElement.__do_not_use_findShapes=this.chartInstance.findShapes.bind(this.chartInstance),this._derivedProperties=new pM,this._selectionHandler=MM.create({model:o.model,chartInstance:this.chartInstance,selectionsApi:s,isLassoDisabled:this.isLassoDisabled.bind(this),selectPaths:["/qUndoExclude/qHyperCubeDef"],lasso:e}),this._tooltipHandler=WM.create(this.chartInstance,r,Dw.CHART_ID),this._scrollHandler=new YM(this.chartInstance,r,this.getSlicedData.bind(this),this.onScrollCallback.bind(this),"colorLegend-cat"),this._maxBubbleScale=Dw.BUBBLE_SCALES_MAX,this._jitterTool=new yD,this.setDataPaths([`${MD}/${DD}`])},onScrollCallback(e,t,n){const i=this;this._updateColorMapData(e).then((()=>{i.updateChart(e,t,n)}))},getSlicedData(e,t){const n=this;return this.getData(this.backendApi,this.layout[MD][DD],{top:e,height:t}).then((()=>n.layout))},updateScrollHandlerState(e){void 0!==e&&(this._disableScrolling=!!e),this._scrollHandler.setDisabled(!gD.hasSecondDimension(this.layout,MD)||this._disableScrolling)},updateConstraints(e){const t=!e.active,n=!e.passive,i=!e.select&&!e.active;this._scrollHandler[t?"on":"off"](),this._tooltipHandler[n?"on":"off"](),this._selectionHandler[i?"on":"off"]()},off(){this._scrollHandler.off(),this._tooltipHandler.off(),this._selectionHandler.off()},_getPointScale(){return function(e){return e.dataPoint&&e.dataPoint.bubbleScales}(this.layout)?this.layout.dataPoint.bubbleScales/this._maxBubbleScale:1},_calcBandwidth(e,t){const n=t.scales().dimension;this._bandwidthRatio=n?n.pxScale(e).bandwidth():1,this._bandwidthPx=e*this._bandwidthRatio},_calcPointMaxSize(e,t){const n=Math.min(Dw.MAX_POINT_BASE_SIZE_PX,t*Dw.POINT_BANDWIDTH_BASE_RATIO)*e;this._pointMaxSizePx=Math.max(Dw.MIN_POINT_PIXELS,n)},_calcPointSize(e,t){this._pointSize=e/t},_getDimAxisSettings(e,t){const n=_D(t.trigger),i=_D(t.consume),r=this.picassoElement.getBoundingClientRect()["vertical"===e.orientation?"height":"width"],o=tD.getAdjustedMaxGlyphCount(function(e){const t=e[MD][DD].qDimensionInfo,n=gD.hasSecondDimension(e,MD)?t[0].qApprMaxGlyphCount:0;return Math.min(Dw.MAX_GLYPH_COUNT,n)}(this.layout||e),e[MD][DD].qStackedDataPages[0].qData[0].qSubNodes),s=r/4;return{brush:{trigger:n,consume:i},settings:{labels:{mode:"vertical"===e.orientation?e.dimensionAxis.label:"auto",maxGlyphCount:o,maxLengthPx:s},paddingEnd:4}}},_getBoxMarkerSettings(e,t){const{theme:n}=this.environment,i=e.color.point.auto?n.getStyle(Dw.CHART_ID,"box","fill"):n.getColorPickerColor(e.color.box.paletteColor),r=_D(t.trigger),o=_D(t.consume),s=this;let a="qMeasureInfo/0",l="qMeasureInfo/0";gD.hasSecondDimension(e,MD)&&e.qUndoExclude.qHyperCube.qDimensionInfo[0].qAttrExprInfo.length&&(a="qDimensionInfo/0/qAttrExprInfo/0",l="qDimensionInfo/0/qAttrExprInfo/1");const c={require:["chart"],displayOrder:1e3,settings:{chart:this,box:{fill:i,stroke:n.getStyle(Dw.CHART_ID,"box","stroke"),strokeWidth:0,width:Dw.POINT_BANDWIDTH_BASE_RATIO,maxWidthPx:Dw.MAX_POINT_BASE_SIZE_PX,minWidthPx:Dw.MIN_POINT_PIXELS+2*Dw.BOX_PADDING},minor:{scale:"measure"},orientation:e.orientation},beforeRender(){const e=s.layout.presentation&&s.layout.presentation.visibleComponents&&-1!==s.layout.presentation.visibleComponents.indexOf("point"),t="horizontal"===s.layout.orientation?this.rect.height:this.rect.width;s._calcBandwidth(t,this.chart),s._calcPointMaxSize(e?s._getPointScale():1,s._bandwidthPx);let n=0;s._jitter&&(s._calcPointSize(s._pointMaxSizePx,s._bandwidthPx),n=s._pointSize*s._bandwidthPx*Dw.JITTER_PARAMETER);const i=s._pointMaxSizePx+n+2*Dw.BOX_PADDING,r=i/s._bandwidthPx;this.settings.settings.box.maxWidthPx=Math.min(s._bandwidthPx-2,i),this.settings.settings.box.width=r},brush:{trigger:r,consume:o},data:{extract:{field:"qDimensionInfo/0",trackBy:()=>-1,props:{start:{field:a,reduce:"min"},end:{field:l,reduce:"max"},elemNo:{field:"qDimensionInfo/0"}}}}};return gD.hasSecondDimension(e,MD)&&(c.data.extract.field="qDimensionInfo/0",c.data.extract.trackBy=function(e){return e.qElemNo},c.settings.major={scale:"dimension"}),c},_getPointMarkerSettings(e,t,n){let i=1;e.dataPoint&&!1===e.dataPoint.border&&(i=0);const r=_D(t.trigger),o=_D(t.consume);this._tooltipHandler.isOn()&&(r.push(n.point.trigger),o.push.apply(o,n.point.consume));const s=this,a=this.colorService.getColor(),l={require:["chart"],displayOrder:1100,settings:{chart:this,fill:a,stroke:e=>{const t=a(e);return dD.getContrastingTransparent(t)},size:.3,strokeWidth:i,sizeLimits:{maxRelExtent:10,maxPx:Dw.MAX_POINT_BASE_SIZE_PX,minPx:Dw.MIN_POINT_PIXELS},orientation:e.orientation},beforeRender(){const e="horizontal"===s.layout.orientation?this.rect.height:this.rect.width;if(s._calcBandwidth(e,this.chart),s._calcPointMaxSize(s._getPointScale(),s._bandwidthPx),s._calcPointSize(s._pointMaxSizePx,s._bandwidthPx),s._jitter){const t=2*Dw.BOX_PADDING/e;s._jitterTool.calcMaxJitter(s._pointSize*s._bandwidthRatio,Dw.JITTER_PARAMETER,s._bandwidthRatio-t)}this.settings.settings.sizeLimits.maxPx=s._pointMaxSizePx,this.settings.settings.size=s._pointSize},brush:{trigger:r,consume:o},data:{extract:{field:"qDimensionInfo/0",props:{innerElemNo:{field:"qDimensionInfo/0"},elemNo:{field:"qDimensionInfo/0"},inner:{field:"qDimensionInfo/0",value:e=>e},row:{field:"qDimensionInfo/0",value:e=>e.qRow},measure:{field:"qMeasureInfo/0",reduce:"first",value:e=>e,reduceLabel:"none"},...this.colorService.getDatumProps()}}}};return gD.hasSecondDimension(e,MD)&&(l.data.extract.props.inner.field="qDimensionInfo/1",l.data.extract.props.innerElemNo.field="qDimensionInfo/1",l.data.extract.props.row.field="qDimensionInfo/1",l.data.extract.field="qDimensionInfo/1",l.data.extract.props.outer={field:"qDimensionInfo/0",value:e=>e}),this.setDataPaths([`${MD}/${DD}`]),l},_getPointSelectionLayerSettings(e){const t=rw(!0,{},e,{key:"selection-point-marker",settings:{opacity:0}});return t.brush.consume.pop(),t.brush.consume.forEach((e=>{e.style.inactive=void 0,e.style.active.opacity=1})),t.brush.trigger=[],t},createChartSettings(e){const t=this.isRtl(),{theme:n}=this.environment,i=!!e.snapshotData,r=e.presentation&&e.presentation.visibleComponents,o=r&&-1!==e.presentation.visibleComponents.indexOf("point"),s=r&&-1!==e.presentation.visibleComponents.indexOf("box");this._jitter=o&&e.dataPoint&&"jitter"===e.dataPoint.displacement;const a=e[MD][DD],l=a.qDimensionInfo,c="horizontal"!==e.orientation?"y":"x",u="horizontal"!==e.orientation?"x":"y",h=Vq.create({chartID:Dw.CHART_ID,theme:n,isRtl:t});if(0===a.qStackedDataPages[0].qData.length)return h.getSettings();let d={},f={},p={},m={};if(this._selectionHandler.isOn()){const t=!o&&gD.hasSecondDimension(e,MD);this._selectionHandler.setUpStart();const n=this._selectionHandler.setUpBrush({contexts:["select-inner"],data:["innerElemNo"],isSingleSelect:ID(e,0)},!0),i=this._selectionHandler.setUpBrush({contexts:["select-outer"],data:["elemNo"],isSingleSelect:ID(e,1)},!0),r=this._selectionHandler.setUpBrush({dataPath:MD,contexts:["select-color"],data:["color"],startOnEmptySelection:!1},!0),s=this._selectionHandler.setUpBrush({contexts:["select-measure"],data:[c]},!0);this._selectionHandler.setUpDone(),d={trigger:rw(!0,{},i.trigger,{data:[""]}),consume:[rw(!0,{},i.consume,{data:[""]})]},f={trigger:t?i.trigger:null,consume:[n.consume,i.consume,s.consume]},p={trigger:n.trigger,consume:[n.consume,i.consume,s.consume,r.consume]},m={trigger:[rw(!0,{},r.trigger,{data:[""]})],consume:[rw(!0,{},r.consume,{data:[""]}),n.consume,i.consume]}}const g={point:{},box:{}};this._tooltipHandler.isOn()&&(g.point=this._tooltipHandler.setUp({chartBuilder:h,colorService:this.colorService,data:gD.hasSecondDimension(e,MD)?["innerElemNo","elemNo"]:["innerElemNo"],contexts:["pointTip"],componentKey:"point-marker",environment:this.environment,attrDimPath:`/${DD}/qDimensionInfo/${gD.hasSecondDimension(e,MD)?1:0}/qAttrDimInfo/0`,measureRows:["measure"],labelData:gD.hasSecondDimension(e,MD)?["inner","outer"]:["inner"]}));const y=function(e){const t=[],n=e.qUndoExclude&&e.qUndoExclude.qHyperCube&&e.qUndoExclude.qHyperCube.qDimensionInfo?e.qUndoExclude.qHyperCube.qDimensionInfo:void 0;if(!n)return!1;for(let e=0;e<n.length;e++)n[e].qLocked?t.push(n[e].qLocked):t.push(!1);return t}(e),v=function(e,t,n){const i={};return 1===e.length?(i.isOpenDim=!1,e[0]?i.isOpenMea=!1:i.isOpenMea=!0):e[0]&&!e[1]?(i.isOpenDim=!1,i.isOpenMea=!0):!e[0]&&e[1]?(i.isOpenDim=!0,i.isOpenMea=!1):e[0]&&e[1]?(i.isOpenDim=!1,i.isOpenMea=!1):(i.isOpenDim=!0,i.isOpenMea=!0),t&&(i.isOpenMea=!1),n&&(i.isOpenDim=!1),i}(y,ID(e,0),ID(e,1)),b={scrollHandler:this._scrollHandler,selectionHandler:this._selectionHandler},x={componentKey:o?"point-marker":"box-marker",lassoBrushKey:"select-inner",dimRangeBrushKey:"select-outer",measureRangeBrushKey:"select-measure",areaBrushKey:null,legendBrushKey:"legend"};if(this._dependentActions&&this._dependentActions.destroy(),this._dependentActions=IM.create(b,e.orientation,t,x,v),h.addPreset("dimension-measure-chart",{isRtl:t,includeDimensionAxis:gD.hasSecondDimension(e,MD),orientation:e.orientation,selectionsEnabled:this._selectionHandler.isOn(),theme:n,measureSource:["qMeasureInfo/0"],dimensionSource:"qDimensionInfo/0",measureAxisProperties:e.measureAxis,measureTitleText:a.qMeasureInfo[0].qFallbackTitle,dimensionAxisProperties:e.dimensionAxis,dimensionAxisSettings:this._getDimAxisSettings(e,d),dimensionTitleText:l&&l[0]&&l[0].qFallbackTitle||"",gridlines:e.gridlines,hasNavigation:!i,isNavigationEnabledFn:()=>this._scrollHandler.isOn(),scrollSettings:kD(e,this._scrollHandler.getScrollViewSizeInItem()),enableLasso:!0,lasso:{brushKey:o?"select-inner":"select-outer",brushComponents:o?["point-marker"]:["box-marker"],brushData:o?["innerElemNo"]:["elemNo"]},enableDimRange:!0,dimRange:{brushKey:"select-outer",brushAxis:"horizontal"===e.orientation?"y-axis":"x-axis",brushArea:s?"box-marker":"point-marker",brushScale:"dimension"},enableMeasureRange:o,measureRange:{brushKey:"select-measure",brushAxis:"horizontal"===e.orientation?"x-axis":"y-axis",brushArea:o?"point-marker":"box-marker",brushScale:"measure",multiple:!0},brushActions:this._dependentActions.gestures,refLines:e.refLine&&e.refLine.refLines,axisTitleStyle:qw(Dw.CHART_ID,n,e,this.flags),axisLabelStyle:Mw(Dw.CHART_ID,n,e,this.flags)}),s){const t=this._getBoxMarkerSettings(e,f);h.addComponent("box-marker",t)}if(o){const n=this._getPointMarkerSettings(e,p,g);if(n.data.extract.props[c]={field:"qMeasureInfo/0"},n.settings[c]={scale:"measure"},gD.hasSecondDimension(e,MD)&&(n.data.extract.props[u]={field:"qDimensionInfo/0",type:"qual"},n.settings[u]={scale:"dimension"}),this._jitter){n.settings[u]=n.settings[u]||{};const e=this._jitterTool;n.settings[u].fn=function(t){let n;return n="function"==typeof t.scale?t.scale(t.datum[u].value)+.5*t.scale.bandwidth():.5,n+e.getJitterValue(t.datum.value,Dw.JITTER_PARAMETER)}}h.addComponent("point-marker",n),h.addComponent("point-marker",this._getPointSelectionLayerSettings(n));(e.legend?!1!==e.legend.show:!e.color.point.auto&&"byDimension"===e.color.point.mode)&&this.addLegend(h,t,m)}const w=h.getSettings();return this.addSnapshotChartSettings(w,e),w.scales={...w.scales,...this.colorService.getScales()},w.palettes=this.colorService.getPalettes(),w},addLegend(e,t,n){const i={eventName:"legend-c",key:"colorLegend",styleReference:"object.comboChart",rtl:t,settings:{item:{shape:{type:"circle",size:10}}}},r=this.colorService.getLegend(i,{actions:{interact:{enabled:()=>this._scrollHandler.isOn()}}});let{components:o}=r;o=o.filter((e=>!!e)),o.length>0&&(this._selectionHandler.isOn()&&(o[0].brush={consume:n.consume.map((e=>rw(!0,e,{style:{active:null}}))),trigger:n.trigger}),o[0].layout.displayOrder=200,o[0].layout.prioOrder=50),e.settings.components.push(...o),e.settings.interactions[0].gestures.unshift(...r.interactions)},resize(){this.layout&&(AD.call(this),this._super())},hasValidData(){const e=this.layout;return e[MD]&&e[MD][DD]&&e[MD][DD].qStackedDataPages.length&&e[MD][DD].qStackedDataPages[0].qData},paint(){const e=!!this.layout.snapshotData;e||this.environment.options.viewState||this.updateScrollHandlerState(!1),this._orientation||(this._orientation=this.layout.orientation),this._orientation!==this.layout.orientation&&(AD.call(this),this._orientation=this.layout.orientation);const t=this.layout;if(!this.hasValidData())return Promise.resolve();const n=this,i=this._super;return!e&&gD.hasSecondDimension(t,MD)&&this._scrollHandler.isDataSizeChanged(Rb(t,`${MD}.${DD}.qStackedDataPages.0.qData.0.qSubNodes.length`),gD.getOuterDimensionSizeOfMax2Dims(t,MD))?this._scrollHandler.getViewData().finally((()=>n._updateColorMapData(t).then((()=>i.call(n))))):this._updateColorMapData(t).then((()=>i.call(n)))},async setSnapshotData(e){this._super(e);const t=await this.colorService.getSnapshotData();return e.snapshotData.content.chartData={...e.snapshotData.content.chartData,...t},e[MD][DD].qStackedDataPages=this.layout[MD][DD].qStackedDataPages,vD.toBefore(e),e},getViewState(){return{scroll:Math.round(this._scrollHandler.getScrollState())}},getDisclaimerAttributes(e){const t=!this.flags.isEnabled("SHOW_DISCLAIMER")||!(!1===e.showDisclaimer),n=!gD.hasSecondDimension(e,MD)&&e.qHyperCube.qSize.qcy>1e4||gD.hasSecondDimension(e,MD)&&e.qHyperCube.qSize.qcy>3e3,i=t&&n,r=kD(e,this._scrollHandler.getScrollViewSizeInItem());return{data:e&&e.qUndoExclude,supportedDisclaimers:{LimitedData:t&&i},options:{paddingBottom:i&&r&&r.viewSize<r.max,supportNegative:!0,explicitLimitedData:i}}},async _updateColorMapData(e){this.colorService=qD({layout:e,localeInfo:this.localeInfo,model:this.backendApi.model,picasso:this.picasso,environment:this.environment}),await this.colorService.initialize();const t=this.colorService.getSettings().field,n=this.chartInstance.brush("select-color");/qAttrDimInfo/.test(t)&&n.addKeyAlias("attrDim/qDimensionInfo/0",`${MD}/${DD}/${t}`)},_createColorLegendCube(e){const t=gD.hasSecondDimension(this.layout,MD)?1:0;return{qDimensionInfo:[this.layout[MD][DD].qDimensionInfo[t].qAttrDimInfo[0]],qMeasureInfo:[],qDataPages:e,qMode:"S",qSize:{qcx:1,qcy:e[0].qMatrix.length}}},_updateColorData(){return this._updateColorMapData(this.layout)},updateDerivedProperties(e,t){const{app:n,translator:i}=this.environment,r=this,o=r.backendApi.model;return r._derivedProperties.addDefaultHyperCubeHash(e.qHyperCubeDef,t.qHyperCube,n,function(e){return{cube:e[SD],sorting:e.sorting,color:{point:e.color.point}}}(e)).then((s=>{const a={layout:t,properties:e,model:o,hashData:s,generateDerivedProperties:(e,t)=>bD.generateHyperCube(e,t,n,i)};return r._derivedProperties.updateDerivedProperties(a)}))},updateData(e){const t=this,n=!!e.snapshotData;return t._super(e).then((()=>{if(t._destroyed)return Promise.reject();if(e=t.layout,t._scrollHandler.setOptions({direction:"horizontal"===e.orientation?"vertical":"horizontal"}),n)return vD.toAfter(e),t._updateColorMapData(e);t.updateScrollHandlerState(!0);const{viewState:i}=t.environment.options;let r;return i?(t._scrollHandler.updateViewState(CD(e)),t._scrollHandler.setScrollState(i.scroll)):(t._scrollHandler.resetScroll(),TD.call(t)),t._scrollHandler.getScrollViewSizeInItem()&&!t._cacheSizeInitialized&&(ED.call(t),t._cacheSizeInitialized=!0),r=gD.hasSecondDimension(e,MD)?t.getSlicedData(t._scrollHandler.getScrollState(),t._scrollHandler.getScrollViewSizeInItem()):t.getData(t.backendApi,e[MD][DD],{height:e[MD][DD].qSize.qcy||1}),r.then((()=>t._destroyed?Promise.reject():t._updateColorData()))}))},isLassoDisabled(){const e=this.layout;return!!(e.qHyperCube.qDimensionInfo&&e.qHyperCube.qDimensionInfo.length>1&&ID(e,0))}}),ND={enabled:!0,delay:50};function OD(){const e={};return e.promise=new Promise(((t,n)=>{e.resolve=t,e.reject=n})),e}class PD{constructor({onSend:e}){this.options={},this.ongoingRequests=[],this.queuedRequests=[],this.recentRequests=[],this.resolvedRequests=[],this._debounceTimer=null,this._latestResolvedRequestedAt=-1,this.onSend=e,this.setOptions({})}destroy(){this.clear(),this.recentRequests=[],this.resolvedRequests=[],this.onSend=null,this.onCancel=null}setOptions(e){this.options=rw(!0,{},ND,this.options,e),this.enabled=this.options.enabled||!1,this.delay=this.options.delay||-1}clear(){let e;for(clearTimeout(this._debounceTimer);this.queuedRequests.length;)e=this.queuedRequests.pop(),e.dfd.reject();for(;this.ongoingRequests.length;)e=this.ongoingRequests.pop(),e.dfd.reject()}queue(e){const t=this.enabled?this.delay:-1,n=Date.now(),i={data:e,dfd:OD(),wrapper:OD(),requestedAt:n},r=Math.max(this._getAvgResolutionTime(),t),o=t<1,s=this.recentRequests.length<1,a=s||n-this.recentRequests.slice(-1)[0].requestedAt>r,l=n>this._latestResolvedRequestedAt+t;return o||s||a||l?LD.apply(this,[i,0]):LD.apply(this,[i,Math.min(t,1e3)]),this.recentRequests.push(i),this.recentRequests.length>10&&(this.recentRequests=this.recentRequests.slice(-10)),i.dfd.promise}updateResolutionTime(){this._latestResolvedRequestedAt=Date.now()}_getAvgResolutionTime(){let e;return this.resolvedRequests.length&&(e=0,this.resolvedRequests.forEach((t=>{e+=t.respondedAt-t.sentAt})),e/=this.resolvedRequests.length),e}}function LD(e,t){const n=this;this.queuedRequests.push(e),clearTimeout(this._debounceTimer),t>=10?this._debounceTimer=setTimeout((()=>{FD.call(n)}),t):FD.call(n)}function FD(){if(this.ongoingRequests.length)return void(this.waitingForResponse=!0);let e=this.queuedRequests.pop();for(e&&zD.call(this,e);this.queuedRequests.length;)e=this.queuedRequests.shift(),e.dfd.reject()}function zD(e){this.waitingForResponse=!1,this.ongoingRequests.push(e);const t=this,n=e.wrapper;e.sentAt=Date.now(),n.promise.then((function(...n){t.ongoingRequests.splice(t.ongoingRequests.indexOf(e),1),e.respondedAt=Date.now(),t.resolvedRequests.push({sentAt:e.sentAt,respondedAt:e.respondedAt,requestedAt:e.requestedAt}),t.resolvedRequests.length>10&&(t.resolvedRequests=t.resolvedRequests.slice(-10)),e.requestedAt>t._latestResolvedRequestedAt?e.dfd.resolve(...n):e.dfd.reject(),t._latestResolvedRequestedAt=e.requestedAt}),(function(...n){t.ongoingRequests.splice(t.ongoingRequests.indexOf(e),1),e.respondedAt=Date.now(),e.dfd.reject(...n)})).finally((()=>{t.waitingForResponse&&FD.call(t)})),this.onSend(e.data,n)}const jD=new Dx(0,0,0,0),HD=new Dx(0,0,0,0);class BD{constructor(){this.pages=[]}get(e){return e.map((e=>this.getPage(e)))}getPage(e){const t=[];for(let n=0;n<this.pages.length;n++){const i=this.pages[n].qArea;jD.set(e.qLeft,e.qTop,e.qWidth,e.qHeight),HD.set(i.qLeft,i.qTop,i.qWidth,i.qHeight);const r=HD.intersection(jD,!0);if(t.push({coverage:r?r.clone():new Dx(0,0,0,0),idx:n}),i.qLeft<=e.qLeft&&i.qLeft+i.qWidth>=e.qLeft+e.qWidth&&i.qTop<=e.qTop&&i.qTop+i.qHeight>=e.qTop+e.qHeight)return this._extract(e,this.pages[n])}return t.sort(((e,t)=>t.coverage.width*t.coverage.height-e.coverage.width*e.coverage.height)),t[0].coverage.height>0&&t[0].coverage.width>0?this._extract(e,this.pages[t[0].idx]):{qArea:{qTop:e.qTop,qLeft:e.qLeft,qWidth:0,qHeight:0},qData:[]}}destroy(){this.clear()}isEmpty(){return!(this.pages&&this.pages[0]&&this.pages[0].qArea.qHeight&&this.pages[0].qArea.qWidth)}clear(){this.pages=[]}store(e){this.pages=e}containsArea(e){for(let t=0;t<this.pages.length;t++){const n=this.pages[t].qArea;if(n.qLeft<=e.qLeft&&n.qLeft+n.qWidth>=e.qLeft+e.qWidth&&n.qTop<=e.qTop&&n.qTop+n.qHeight>=e.qTop+e.qHeight)return!0}return!1}contains(e){return!(!this.pages||!this.pages.length)&&0===e.filter((e=>!this.containsArea(e))).length}_extract(e,t){jD.set(e.qLeft,e.qTop,e.qWidth,e.qHeight),HD.set(t.qArea.qLeft,t.qArea.qTop,t.qArea.qWidth,t.qArea.qHeight);const n=jD.intersection(HD,!0);if(!n)return{qArea:{qTop:e.qTop,qLeft:e.qLeft,qWidth:0,qHeight:0},qData:[]};const i=Math.max(0,e.qTop-t.qArea.qTop),r=t.qData[0],o=r.qSubNodes,s={};for(const e in r)r.hasOwnProperty(e)&&(s[e]="qSubNodes"===e?o.slice(i,i+n.height):r[e]);return s.qUp+=i,s.qDown+=t.qArea.qHeight-n.height-i,{qArea:{qTop:n.y,qLeft:n.x,qWidth:n.width,qHeight:n.height},qData:[s]}}}const VD={mode:"S",enabled:!0,debouncing:{enabled:!0,delay:50},height:250,width:250,maxTotalArea:1e4},$D=Mx.extend("CacheCube",{init(e,t,n,i){this.model=e,this.responseProperty=t,this.options={},this.cubeHeight=0,this.cubeWidth=0,this.setOptions(i||{}),this.setPath(n),"K"===this.options.mode?this.cube=new BD:"P"===this.options.mode?this.cube=new Nx:this.cube=new Cx,this.throttle=new PD({onSend:(e,t)=>{const n=this._getDirections(this.throttle.recentRequests.map((e=>({top:e.data[0].qTop,left:e.data[0].qLeft})))),i=this._getAreasToCache(e,n.vertical,n.horizontal);this.cacheData(i,e).then((e=>{this.cube?t.resolve(e):t.reject()}),(()=>{t.reject()}))}}),this._modelBinding=()=>{this.clear()},this.model.on("changed",this._modelBinding)},destroy(){this.cube.destroy(),this.throttle.destroy(),this.model&&this.model.removeListener&&this.model.removeListener("changed",this._modelBinding),this._modelBinding=null,delete this.model,delete this.throttle,delete this.cube},setMethodName(e){this.method=e},setPath(e){this.path=e},setCubeSize(e){this.cubeHeight=e.qcy,this.cubeWidth=e.qcx},setOptions(e){e&&(this.options=rw(!0,{},VD,this.options,e),this.cacheHeight=this.options.height,this.cacheWidth=this.options.width,this.enabled=this.options.enabled||!1,this.debouncing={enabled:this.options.debouncing.enabled||!1,delay:this.options.debouncing.delay||-1})},clear(){this.cube&&this.cube.clear(),this.throttle&&this.throttle.clear()},set(e){this.clear(),e&&e.length&&this.cube.store(e)},cacheData(e,t){const n=function(e){return this.cube?(this.cube.store(e),this.cube.get(t)):e};return"getHyperCubeStackData"===this.method&&this.options.maxStackedValues?this.model[this.method](this.path,e,this.options.maxStackedValues).then(n.bind(this)):this.model[this.method](this.path,e).then(n.bind(this))},getData(e){if(!this.model)return Promise.reject();if(!this.enabled||!this.cubeHeight||!this.cubeWidth)return"getHyperCubeStackData"===this.method&&this.options.maxStackedValues?this.model[this.method](this.path,e,this.options.maxStackedValues):this.model[this.method](this.path,e);let t,n;const i=[];for(t=0;t<e.length;++t)n=e[t],i.push({qTop:Math.max(Math.floor(n.qTop),0),qLeft:Math.max(n.qLeft,0),qHeight:Math.min(n.qHeight,this.cubeHeight-Math.floor(n.qTop)),qWidth:Math.min(n.qWidth,this.cubeWidth-n.qLeft)});return this.cube.contains(i)?(this.throttle.updateResolutionTime(),Promise.resolve(this.cube.get(i))):0===i[0].qTop&&this.cube.isEmpty()&&this.throttle.ongoingRequests.length+this.throttle.queuedRequests.length===0?(this.throttle.updateResolutionTime(),this.cacheData(i,i)):this.throttle.queue(i)},_getDirections(e){if(!e||e.length<2)return{vertical:0,horizontal:0};const t=e.slice(-2),n=t[1].top-t[0].top,i=t[1].left-t[0].left;return{vertical:n<0?-1:n>0?1:0,horizontal:i<0?-1:i>0?1:0}},_getAreasToCache(e,t,n){let i,r,o,s,a,l,c,u,h;const d=[];let f=this.cacheHeight;for(void 0===t&&(t=0),void 0===n&&(n=0),this.cacheHeight*this.cacheWidth*e.length>this.options.maxTotalArea&&(f=Math.floor(this.options.maxTotalArea/(e.length*this.cacheWidth))),i=0;i<e.length;++i)r=0!==t?Math.floor(.5*Math.max(0,f-e[i].qHeight)):0,o=0!==n?Math.floor(.5*Math.max(0,this.cacheWidth-e[i].qWidth)):0,s=r*t-r,a=o*n-o,l=0!==t?Math.max(0,Math.min(Math.max(e[i].qHeight,f),this.cubeHeight)):e[i].qHeight,c=0!==n?Math.max(0,Math.min(Math.max(e[i].qWidth,this.cacheWidth),this.cubeWidth)):e[i].qWidth,u=Math.max(0,Math.min(e[i].qTop+s,this.cubeHeight-l)),h=Math.max(0,Math.min(e[i].qLeft+a,this.cubeWidth-c)),d.push({qTop:u,qHeight:l,qLeft:h,qWidth:c});return d}}),WD=Dw.DATA_PATH,UD=Dw.HYPERCUBE_DEF_PATH;class YD{constructor(e){this.model=e,this.path=`/${WD}/${UD}`,this.cacheCube=new $D(e,"qDataPages",this.path,{mode:"K"}),this.cacheCube.setMethodName("getHyperCubeStackData"),this.cacheCube.setOptions({maxStackedValues:Dw.MAX_STACKED_VALUES})}setPath(e){this.path=e}setCacheOptions(e){this.cacheCube.setOptions(e)}updateCache(e){let t,n;"qHyperCube"===this.dataPath?t=e&&e.qHyperCube:(n=this.dataPath.slice(0,this.dataPath.indexOf("qHyperCube")-1),t=e&&e[n]&&e[n].qHyperCube),e.qSelectionInfo.qInSelections||this.cacheCube.setCubeSize({qcx:t.qSize.qcx,qcy:gD.getStackedCubeSizeOfMax2Dims(e,n)}),this.backendStackThrottle.clear()}getData(e,t){const n=this.cacheCube;return t?this.model.getHyperCubeData(t,e):this.cacheCube.getData(e).then((e=>(e[0]&&e[0].qData[0]&&e[0].qData[0].qSubNodes.some((e=>e.qDown>0))&&n.clear(),e)))}}return function(t){!function(e){if(e&&e.get&&e.add){const t="Object.Disclaimer.LimitedData";if(e.get(t)!==t)return;Object.keys(s).forEach((t=>{e.add(s[t])}))}}(t.translator);const n=ry();return{qae:Kx(t),ext:mq(t),component(){const i=e.useElement(),r=function(){const t=e.useApp(),n=e.useAppLayout(),i=e.useDeviceType(),r=e.useOptions(),o=e.useTheme(),s=e.useTranslator();return e.useMemo((()=>({app:t,appLayout:n,deviceType:i,options:r,theme:o,translator:s})),[t,n,r.direction,r.freeResize,s.language(),o.name(),i])}(),s=e.useSelections(),a=e.useStaleLayout(),l=e.useModel(),c=e.useConstraints(),u=function(){const t=e.useConstraints(),[n,i]=e.useState(!1),[r,o]=e.useState(!1),s=!!e.useLayout().qSelectionInfo.qInSelections,[a]=e.useState((()=>({toggle(){o((e=>!e))}})));return e.useEffect((()=>{t&&i(!t.select&&!t.active)}),[t]),e.useAction((()=>({key:"lasso",label:"Lasso",icon:oy,hidden:!n||!s,active:r,action(){o((e=>!e))}})),[s,r,n]),a.enabled=()=>n,a.active=()=>r,a}(),h=e.useRenderState(),[d,f]=e.useState();e.useEffect((()=>{const e=o(i),c=function(e,t){return t.snapshotData?new Px(t,"qUndoExclude.qHyperCube","qStackedDataPages"):new YD(e)}(l,a),h=s,d=new RD({environment:r,lasso:u,flags:t.flags,picasso:n,$element:e,backendApi:c,selectionsApi:h});return f(d),()=>{d.destroy()}}),[]);const[,p]=e.usePromise((async()=>{if(!d)return;d.updateEnvironment(r),d.updateConstraints(c);if(!!!a.snapshotData){const e=await l.getEffectiveProperties();if(await d.updateDerivedProperties(e,a))return void h.pending();h.restore()}await d.updateData(a),await d.paint()}),[a,d,r]);if(p)throw p;var m;!function(t){const n=e.useRect(),i=e.useOptions(),r=e.useConstraints(),[,o]=e.usePromise((async()=>{t&&(t.updateConstraints(r),t.options=i,await t.resize())}),[n.width,n.height]);if(o)throw o}(d),m=d,e.onTakeSnapshot((e=>{if(m)return m.setSnapshotData(e)})),e.useImperativeHandle((()=>({getViewState(){if(m)return m.getViewState()}})),[m])}}}}));
|
|
28
|
+
!function(t,n){e.exports=n()}(0,(function(){return function(e,t){if(!e||isNaN(+t))return t;var n,i,r,o,s,a,l,c,u,h,d=e.length,f=e.search(/[0-9\-\+#]/),p=f>0?e.substring(0,f):"",m=e.split("").reverse().join(""),g=m.search(/[0-9\-\+#]/),y=d-g,v=e.substring(y,y+1),b=y+("."===v||","===v?1:0),x=g>0?e.substring(b,d):"";if(n=(t="-"===(e=e.substring(f,b)).charAt(0)?-t:+t)<0?t=-t:0,r=(i=e.match(/[^\d\-\+#]/g))&&i[i.length-1]||".",o=i&&i[1]&&i[0]||",",e=e.split(r),t=+(t=t.toFixed(e[1]&&e[1].length))+"",a=e[1]&&e[1].lastIndexOf("0"),(!(c=t.split("."))[1]||c[1]&&c[1].length<=a)&&(t=(+t).toFixed(a+1)),u=e[0].split(o),e[0]=u.join(""),(s=e[0]&&e[0].indexOf("0"))>-1)for(;c[0].length<e[0].length-s;)c[0]="0"+c[0];else 0==+c[0]&&(c[0]="");if((t=t.split("."))[0]=c[0],l=u[1]&&u[u.length-1].length){for(m="",y=(h=t[0]).length%l,d=h.length,b=0;b<d;b++)m+=h.charAt(b),!((b-y+1)%l)&&b<d-l&&(m+=o);t[0]=m}return t[1]=e[1]&&t[1]?r+t[1]:"","0"!==(i=t.join(""))&&""!==i||(n=!1),p+(n?"-":"")+i+x}}))}));const be=1e-15;function xe(e){return e.replace(/[-[\]/{}()*+?.\\^$|]/g,"\\$&")}const we={3:"k",6:"M",9:"G",12:"T",15:"P",18:"E",21:"Z",24:"Y","-3":"m","-6":"μ","-9":"n","-12":"p","-15":"f","-18":"a","-21":"z","-24":"y"},qe=/%\)?$/,Se=/^\(r(0[2-9]|[12]\d|3[0-6])\)/i,Me=/^\(oct\)/i,De=/^\(dec\)/i,_e=/^\(hex\)/i,Ce=/^\(bin\)/i,ke=/^\(rom\)/i,Ee=/^(\(rom\)|\(bin\)|\(hex\)|\(dec\)|\(oct\)|\(r(0[2-9]|[12]\d|3[0-6])\))/i,Ae=/#|0/g;function Te(e,t,n,i){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(".",i||".")}function Ie(e,t){let n,i="",r=Number(String(e).slice(-3)),o=(e-r)/1e3,s=[0,1,4,5,9,10,40,50,90,100,400,500,900].reverse(),a=["0","I","IV","V","IX","X","XL","L","XC","C","CD","D","CM"].reverse();for(;r>0;)for(n=0;n<s.length;n++)if(s[n]<=r){i+=a[n],r-=s[n];break}for(n=0;n<o;n++)i="M".concat(i);return t[1]!==t[1].toUpperCase()&&(i=i.toLowerCase()),i}function Re(e,t,n){let i;return Se.test(t)?e=Te(e,Number(/\d{2}/.exec(t)[0]),t,n):Me.test(t)?e=Te(e,8,t,n):De.test(t)?e=Te(e,10,t,n):_e.test(t)?e=Te(e,16,t,n):Ce.test(t)?e=Te(e,2,t,n):ke.test(t)&&(i="",e<0&&(i="-",e=-e),e=0===(e=Math.floor(e))?"0":e<=5e5?i+(e=Ie(e,t)):t+i+e.toExponential(0)),e}function Oe(e,t,n){const i=xe(e);return n?i:new RegExp(i||"",t)}function Ne(e,t){return t&&(t=xe(t)),e&&(e=xe(e)),new RegExp("(?:[#0]+".concat(e,")?[#0]+(?:").concat(t,"[#0]+)?"))}function Pe(e,t){if(!e||!e.qNumericalAbbreviation)return we;const n={};return e.qNumericalAbbreviation.split(t).forEach((e=>{let t=e.split(":");2===t.length&&(n[t[0]]=t[1])})),n}function Le(e,t,n,i){let r,o,s,a,l,c,u,h,d,f=e.pattern;i&&(e.abbreviate=!0),d=Ne(t,n),s=f.match(d),s=s?s[0]:"",a=s?f.substr(0,f.indexOf(s)):f,l=s?f.substring(f.indexOf(s)+s.length):"",s||(s=f?"#":"##########"),t&&t===n&&(r=s.split(n),o=r.pop(),s=r.join("")+n+o,t=""),c=t,t=/,/.test(n)?"¤":",",c&&(s=s.replace(Oe(c,"g"),t)),u=n,n=".",u&&(s=s.replace(Oe(u,"g"),n)),h=s.match(/#/g),h=h?h.length:0;const p=f.split(u);let m;p[1]&&(m=p[1].match(Ae)),e.prefix=a||"",e.postfix=l||"",e.pattern=f,e.maxPrecision=m?m.length:2,e.percentage=qe.test(f),e.numericPattern=s||"",e.numericRegex=new RegExp("".concat(Oe(t,null,!0),"|").concat(Oe(n,null,!0)),"g"),e.groupTemp=c,e.decTemp=u,e.t=t,e.d=n,e.temp=h}class Fe{constructor(e,t,n,i,r){this.localeInfo=e,this.pattern=t,this.thousandDelimiter=n||",",this.decimalDelimiter=i||".",this.type=r||"numeric",this.patternSeparator=";",this.abbreviations=Pe(e,this.patternSeparator),this.prepare()}clone(){const e=new Fe(this.localeInfo,this.pattern,this.thousandDelimiter,this.decimalDelimiter,this.type);return e.subtype=this.subtype,e}format(e,t,n,i){return this.prepare(t,n,i),this.formatValue(e)}prepare(e,t,n){let i;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:""}},i=this._prepared,e=e.split(this.patternSeparator),i.positive.pattern=e[0],i.negative.pattern=e[1],i.zero.pattern=e[2],Ee.test(e[0])&&(i.positive.isFunctional=!0),e[1]?Ee.test(e[1])&&(i.negative.isFunctional=!0):i.negative=!1,e[2]?Ee.test(e[2])&&(i.zero.isFunctional=!0):i.zero=!1;const r="U"===this.type;i.positive.isFunctional||Le(i.positive,t,n,r),i.negative&&!i.negative.isFunctional&&Le(i.negative,t,n,r),i.zero&&!i.zero.isFunctional&&Le(i.zero,t,n,r)}formatValue(e){let t,n,i,r,o,s,a,l,c,u=this._prepared,h="",d="",f=e;if(isNaN(e))return"".concat(f);if(e=+e,!1===u.pattern)return e.toString();if(0===e&&u.zero)return u=u.zero,u.pattern;if(e<0&&u.negative?(u=u.negative,e=-e):u=u.positive,o=u.d,s=u.t,u.isFunctional)e=Re(e,u.pattern,o);else{if(u.percentage&&(e*=100),u.abbreviate){const t=Object.keys(this.abbreviations).map((e=>parseInt(e,10))).sort(((e,t)=>e-t));let i,r,o=t[0];for(a=0,n=Number(Number(e).toExponential().split("e")[1]);o<=n&&a<t.length;)a++,o=t[a];a>0&&(i=t[a-1]),i&&n>0&&i>0?r=i:(n<0&&i<0||!i)&&(o<0&&o-n<=u.maxPrecision?r=o:i<=n&&!(o>0&&-n<=u.maxPrecision)&&(r=i)),r&&(h=this.abbreviations[r],e/=10**r)}if(i=Math.abs(e),t=u.temp,l=u.numericPattern,c=l.split(o)[1],"I"===this.type&&(e=Math.round(e)),r=e,c||"#"!==l.slice(-1)[0])if(i>=1e15||i>0&&i<=1e-14)e=i?i.toExponential(15).replace(/\.?0+(?=e)/,""):"0";else{const t=Number(e.toFixed(Math.min(20,c?c.length:0)).split(".")[0]);let n=l.split(o)[0];if(n+=o,e=ve(n,t)||"0",c){const t=Math.max(0,Math.min(14,c.length)),n=c.replace(/#+$/,"").length;let r=("I"===this.type?0:i%1+be).toFixed(t).slice(2).replace(/0+$/,"");for(a=r.length;a<n;a++)r+="0";r&&(e+=o+r)}else 0===t&&(r=0)}else if(i>=10**t||i<1||i<1e-4)0===e?e="0":i<1e-4||i>=1e20?(e=(e=r.toExponential(Math.max(1,Math.min(14,t))-1)).replace(/\.?0+(?=e)/,""),d=""):(e=e.toPrecision(Math.max(1,Math.min(14,t)))).indexOf(".")>=0&&(e=(e=e.replace(e.indexOf("e")<0?/0+$/:/\.?0+(?=e)/,"")).replace(".",o));else{for(l+=o,t=Math.max(0,Math.min(20,t-Math.ceil(Math.log(i)/Math.log(10)))),a=0;a<t;a++)l+="#";e=ve(l,e)}e=e.replace(u.numericRegex,(e=>e===s?u.groupTemp:e===o?u.decTemp:"")),r<0&&!/^-/.test(e)&&(e="-".concat(e))}return u.prefix+e+d+h+u.postfix}static getStaticFormatter(){return{prepare(){},formatValue:e=>"".concat(e)}}}function ze(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return new Fe(...t)}function je(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const{size:n=5e3,multipleArguments:i=!1,toKey:r=(e=>e)}=t;let o,s,a=Object.create(null),l=Object.create(null),c=0,u=0;return o=i?function(){return s=r(...arguments),o.has(s)?o.get(s):o.set(s,e(...arguments))}:t=>(s=r(t),o.has(s)?o.get(s):o.set(s,e(t))),o.set=(e,t)=>(c>=n&&(delete a[l[u]],delete l[u],c--,u++),a[e]=t,l[c]=e,c++,t),o.get=e=>a[e],o.has=e=>e in a,o.clear=()=>{a=Object.create(null),l=Object.create(null),c=0,u=0},o.size=()=>c,o}function He(e,t,n,i,r){const o=ze(r,e,t,n,i),s=je(o.formatValue.bind(o),{toKey:e=>isNaN(e)?e:+e});function a(e){return s(e)}return a.format=function(e,t,n,i){return s.clear(),o.format(t,e,n,i)},a.pattern=function(e){return e&&(s.clear(),o.pattern=e,o.prepare()),o.pattern},a}const Be={AUTO:"U",INTEGER:"I",NUMBER:"R",FIXED_TO:"F",MONEY:"M",DATE:"D",TIME:"T",DATE_TIME:"TS",INTERVAL:"IV"},Ve=["Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"],$e=["Mon","Tue","Wed","Thu","Fri","Sat","Sun"],We=["January","February","March","April","May","June","July","August","September","October","November","December"],Ue=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],Ye=86400;function Xe(e,t){for(let n=e.length;n<t;n++)e="0".concat(e);return e}function Ke(e,t){let n=e.getUTCHours(),i=e.getUTCDay()-1;return t&&(n%=12,n||(n=12)),i<0&&(i=6),{year:e.getUTCFullYear(),month:e.getUTCMonth(),day:i,date:e.getUTCDate(),h:n,m:e.getUTCMinutes(),s:e.getUTCSeconds(),f:e.getUTCMilliseconds(),t:e.getUTCHours()>=12?"pm":"am"}}function Ge(e){let t=e.toString().split(".");return t[1]?(t=Number("0.".concat(t[1])),t):0}function Je(e){const t=e,n=24*Ge(t),i=60*Ge(n),r=60*Ge(i),o=1e3*Ge(r);return{d:Math.floor(t),h:Math.floor(n),m:Math.floor(i),s:Math.floor(r),f:Math.round(o)}}function Ze(e,t){let n,i=Je(e),r=i.d,o=i.h,s=i.m,a=i.s,l=i.f,c=0;/w+|t+/gi.test(t)&&(n=new Date(Date.UTC(1899,11,30+Math.floor(e),0,0,Math.round(Ye*(e-Math.floor(e))))),isNaN(n.getTime())&&(n=null)),/D+/gi.test(t)||(o+=24*r),/h+/gi.test(t)||(s+=60*o),/m+/gi.test(t)||(a+=60*s),/w+/gi.test(t)&&(c=n?n.getDay()-1:0,c<0&&(c=6));let u="";return n&&(u=n.getUTCHours()>=12?"pm":"am"),{year:0,month:0,day:c,date:r,h:o,m:s,s:a,f:l,t:u}}function Qe(e,t){return{"Y+|y+":{Y:"".concat(Number("".concat(t.year).slice(-2))),YY:Xe("".concat(t.year).slice(-2),2),YYY:Xe("".concat(t.year).slice(-3),3),def:e=>Xe("".concat(t.year),e.length)},"M+":{M:t.month+1,MM:Xe("".concat(t.month+1),2),MMM:e.locale_months_abbr[t.month],def:e.locale_months[t.month]},"W+|w+":{W:t.day,WW:Xe("".concat(t.day),2),WWW:e.locale_days_abbr[t.day],def:e.locale_days[t.day]},"D+|d+":{D:t.date,def:e=>Xe("".concat(t.date),e.length)},"h+|H+":{h:t.h,def:e=>Xe("".concat(t.h),e.length)},"m+":{m:t.m,def:e=>Xe("".concat(t.m),e.length)},"s+|S+":{s:t.s,def:e=>Xe("".concat(t.s),e.length)},"f+|F+":{def(e){let n="".concat(t.f),i=e.length-n.length;if(i>0)for(let e=0;e<i;e++)n+="0";else i<0&&(n=n.slice(0,e.length));return n}},"t{1,2}|T{1,2}":{def(e){let n=t.t;return e[0].toUpperCase()===e[0]&&(n=n.toUpperCase()),n=n.slice(0,e.length),n}}}}class et{constructor(e,t,n){const i=e||{};i.qCalendarStrings||(i.qCalendarStrings={qLongDayNames:Ve,qDayNames:$e,qLongMonthNames:We,qMonthNames:Ue}),this.localeInfo=i,this.locale_days=i.qCalendarStrings.qLongDayNames.slice(),this.locale_days_abbr=i.qCalendarStrings.qDayNames.slice(),this.locale_months=i.qCalendarStrings.qLongMonthNames.slice(),this.locale_months_abbr=i.qCalendarStrings.qMonthNames.slice(),t||(t={[Be.TIME]:i.qTimeFmt||"hh:mm:ss",[Be.DATE]:i.qDateFmt||"YYYY-MM-DD",[Be.DATE_TIME]:i.qTimestampFmt||"YYYY-MM-DD hh:mm:ss"}[n]),this.pattern=t}clone(){const e=new et(this.localeInfo,this.pattern);return e.subtype=this.subtype,e}format(e,t){t||(t=this.pattern?this.pattern:"YYYY-MM-DD hh:mm:ss"),t=t.replace(/\[.+]|\[|]/g,"");const n=/t+/gi.test(t);let i;e instanceof Date?i=Ke(e,n):(e<0&&(e=-e,t="-".concat(t)),i=Ze(e,t));const r=Qe(this,i),o=[];for(const e in r)Object.prototype.hasOwnProperty.call(r,e)&&o.push(e);const s=new RegExp(o.join("|"),"g"),a=t.replace(s,(e=>{let t,n,i;for(n in r)if(Object.prototype.hasOwnProperty.call(r,n)&&(t=new RegExp(n),t.test(e)))break;if(!t)return"";for(const t in r[n])if(t===e||t.toLowerCase()===e){i=r[n][t],void 0===i&&(i=r[n][t.toLowerCase()]);break}return void 0===i&&(i=r[n].def),"function"==typeof i&&(i=i(e)),i}));return a}}function tt(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return new et(...t)}const nt=864e5;function it(e){return new Date(Date.UTC(1899,11,30+Math.floor(e),0,0,0,Math.round(nt*(e-Math.floor(e)))))}function rt(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"TS",n=tt(arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,e,t),i=je(n.format.bind(n),{toKey:e=>"object"==typeof e&&"function"==typeof e.getTime?e.getTime():e});function r(e){return t!==Be.INTERVAL?it(e):e}function o(e){return e=r(e),i(e)}return o.format=function(e,t){return i.clear(),t=r(t),n.format(t,e)},o.locale=function(r){return n=tt(r,e,t),i=je(n.format.bind(n),{toKey:e=>"object"==typeof e?e.getTime():e}),this},o.qtype=function(e){return void 0!==e&&(t=e,i.clear()),t},o}function ot(e,t){if(e&&e.qNumFormat&&-1!==["D","T","TS","IV"].indexOf(e.qNumFormat.qType))return rt(e.qNumFormat.qFmt,e.qNumFormat.qType,t);let n="#",i=t&&void 0!==t.qThousandSep?t.qThousandSep:",",r=t&&void 0!==t.qDecimalSep?t.qDecimalSep:".",o="U",s=e&&!!e.qIsAutoFormat;return e&&e.qNumFormat?(n=e.qNumFormat.qFmt||n,i=e.qNumFormat.qThou||i,r=e.qNumFormat.qDec||r,o=e.qNumFormat.qType||o,s=s&&-1===["M"].indexOf(e.qNumFormat.qType)):s=!0,(s||"U"===o)&&(n="#".concat(r,"##"),o="U"),He(n,i,r,o,t)}function st(){let e,{meta:t,id:n,key:i,localeInfo:r,fieldExtractor:o,value:s,type:a,sourceField:l}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const c=s||("dimension"===a?e=>null==e?void 0:e.qElemNo:e=>null==e?void 0:e.qValue),u=e=>(null==e?void 0:e.qText)||"",h="dimension"===a?"first":"avg",d=ot(t,r),f="dimension"===a?"first":(e,t)=>d(t),p={id:()=>n,key:()=>i,raw:()=>t,title:()=>t.qFallbackTitle||t.label,type:()=>a,origin:()=>l,items:()=>(e||(e=o(p)),e),min:()=>t.qMin,max:()=>t.qMax,value:c,label:u,reduce:h,reduceLabel:f,formatter:()=>d,tags:()=>t.qTags};return p}function at(e,t,n,i,r){return(t[e]||[]).map(((t,o)=>{const s="".concat(i?"".concat(i,"/"):"").concat(e,"/").concat(o),a={instance:st(p({id:"".concat(n?"".concat(n,"/"):"").concat(s),key:s,meta:t},r))};return a.attrDims=at("qAttrDimInfo",t,n,s,p({},r,{value:e=>null==e?void 0:e.qElemNo,type:"dimension"})),a.attrExps=at("qAttrExprInfo",t,n,s,p({},r,{value:e=>null==e?void 0:e.qNum,type:"measure"})),a.measures=at("qMeasureInfo",t,n,s,p({},r,{value:e=>null==e?void 0:e.qValue,type:"measure"})),a}))}function lt(){let{key:e,data:t,config:i={}}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const r={fields:[],wrappedFields:[],allFields:[],virtualFields:[]},o=t;if(!o)throw new Error('Missing "data" input');if(!o.qDimensionInfo)throw new Error('The "data" input is not recognized as a hypercube');const s=lt.util,a={cache:r,cube:o,localeInfo:i.localeInfo,fieldExtractor:null,pages:null,hierarchy:()=>null,virtualFields:i.virtualFields},l={key:()=>e,raw:()=>o,field:e=>te(e,a),fields:()=>r.fields.slice(),extract:e=>a.extractor(e,l,r,s),hierarchy:e=>a.hierarchy(e,l,r,s),_cache:()=>r};"K"===o.qMode||"T"===o.qMode||!o.qMode&&o.qNodesOnDim?(a.extractor=ge,a.hierarchy=me,a.pages="K"===o.qMode?o.qStackedDataPages:o.qTreeDataPages):"S"===o.qMode?(a.extractor=v,a.pages=o.qDataPages,a.hierarchy=me):a.extractor=()=>[],a.fieldExtractor=e=>a.extractor({field:e},l,r,s);const c="S"===o.qMode?e=>e.qElemNumber:void 0,u="S"===o.qMode?e=>e.qNum:void 0;r.wrappedFields.push(...at("qDimensionInfo",o,e,"",p({},a,{value:c,type:"dimension"}))),r.wrappedFields.push(...at("qMeasureInfo",o,e,"",p({},a,{value:u,type:"measure"}))),r.fields=r.wrappedFields.map((e=>e.instance));const h=e=>{e.forEach((e=>{r.allFields.push(e.instance),h(e.measures),h(e.attrDims),h(e.attrExps)}))};return h(r.wrappedFields),(i.virtualFields||[]).forEach((t=>{const i=l.field(t.from),o=st(n({meta:i.raw(),id:"".concat(e,"/").concat(t.key),sourceField:i,fieldExtractor:e=>a.extractor({field:e},l,r,s),key:t.key,type:i.type(),localeInfo:a.localeInfo,value:i.value},t.override||{}));r.virtualFields.push(o)})),r.allFields.push(...r.virtualFields),l}const ct=[["qHyperCube","qHyperCubeDef"],["qTreeData","qTreeDataDef"],["qDimensionInfo","qDimensions"],["qMeasureInfo","qMeasures"],["qAttrDimInfo","qAttributeDimensions"],["qAttrExprInfo","qAttributeExpressions"]],ut=/\/qDimensionInfo(?:\/(\d+))?/,ht=/\/qMeasureInfo\/(\d+)/,dt=/\/qAttrDimInfo\/(\d+)(?:\/(\d+))?/,ft=/\/qAttrExprInfo\/(\d+)/,pt=/\/?qHyperCube/,mt=/\/?qTreeData/,gt=e=>"".concat(e.substr(0,e.indexOf("/qHyperCubeDef")+14)),yt=e=>"".concat(e.substr(0,e.indexOf("/qTreeDataDef")+13));function vt(e,t){let n=e,i=-1,r=-1,o="",s=e=>e;pt.test(e)?(o="".concat(n.substr(0,n.indexOf("qHyperCube")+10)),s=gt):mt.test(e)&&(o="".concat(n.substr(0,n.indexOf("qTreeData")+9)),s=yt);let a=!0;if(ut.test(e)&&(i=+ut.exec(e)[1]),ht.test(e)&&(r=+ht.exec(e)[1]),dt.test(e)){r=-1,i=0;const e=+dt.exec(n)[2];isNaN(e)||(i=e,n=n.replace(/\/\d+$/,"")),a=!1}if(ft.test(e)){const e=r;if(t){r=0;const s=Z(o,t);r+=(s.qMeasureInfo||[]).length,i>-1?(r=s.qDimensionInfo.slice(0,i).reduce(((e,t)=>e+t.qAttrExprInfo.length),r),i=-1):(r=s.qDimensionInfo.reduce(((e,t)=>e+t.qAttrExprInfo.length),r),r=s.qMeasureInfo.slice(0,e).reduce(((e,t)=>e+t.qAttrExprInfo.length),r)),r+=+ft.exec(n)[1]}else i>-1?(i=-1,r=+ft.exec(n)[1]):r+=+ft.exec(n)[1]+1}return ct.forEach((e=>{let[t,i]=e;n=n.replace(t,i)})),a&&(n=s(n)),n&&"/"!==n[0]&&(n="/".concat(n)),{measureIdx:r,dimensionIdx:i,path:n}}function bt(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2?arguments[2]:void 0;const i=t.byCells,r=t.primarySource,o=[],s={},a=e.isActive();let l=!1;return e.brushes().forEach((e=>{const t=vt(e.id,n);if("range"===e.type&&t.measureIdx>-1&&t.dimensionIdx>-1){const n=e.brush.ranges();n.length&&(l=!0,s.multiRangeSelectTreeDataValues||(s.multiRangeSelectTreeDataValues={path:t.path,ranges:[]}),n.forEach((e=>s.multiRangeSelectTreeDataValues.ranges.push({qMeasureIx:t.measureIdx,qDimensionIx:t.dimensionIdx,qRange:{qMin:e.min,qMax:e.max,qMinInclEq:!0,qMaxInclEq:!0}}))))}else{if("range"===e.type&&t.measureIdx>-1){const n=e.brush.ranges();n.length&&(l=!0,s.rangeSelectHyperCubeValues||(s.rangeSelectHyperCubeValues={path:t.path,ranges:[]}),n.forEach((e=>s.rangeSelectHyperCubeValues.ranges.push({qMeasureIx:t.measureIdx,qRange:{qMin:e.min,qMax:e.max,qMinInclEq:!0,qMaxInclEq:!0}}))))}if("range"===e.type&&t.dimensionIdx>-1){const n=e.brush.ranges();n.length&&(l=!0,s.selectHyperCubeContinuousRange||(s.selectHyperCubeContinuousRange={path:t.path,ranges:[]}),n.forEach((e=>s.selectHyperCubeContinuousRange.ranges.push({qDimIx:t.dimensionIdx,qRange:{qMin:e.min,qMax:e.max,qMinInclEq:!0,qMaxInclEq:!1}}))))}if("value"===e.type&&t.dimensionIdx>-1)if(i)if(n&&n.qHyperCube&&("P"===n.qHyperCube.qMode||"T"===n.qHyperCube.qMode||"K"===n.qHyperCube.qMode)){const i=n.qHyperCube,o=i.qNoOfLeftDims,a=i.qEffectiveInterColumnSortOrder.indexOf(t.dimensionIdx);if(s.selectPivotCells||(s.selectPivotCells={path:t.path,cells:[]}),e.id===r||!r){const n=e.brush.values().map((e=>+e)).filter((e=>!isNaN(e)));(0===o||a>=o)&&o>-1?n.forEach((e=>{s.selectPivotCells.cells.push({qType:"T",qCol:e,qRow:a-o})})):n.forEach((e=>{s.selectPivotCells.cells.push({qType:"L",qCol:t.dimensionIdx,qRow:e})})),l=!!s.selectPivotCells.cells.length}}else s.selectHyperCubeCells||(s.selectHyperCubeCells={path:t.path,cols:[]}),s.selectHyperCubeCells.cols.push(t.dimensionIdx),e.id!==r&&(r||s.selectHyperCubeCells.values)||(s.selectHyperCubeCells.values=e.brush.values().map((e=>+e)).filter((e=>!isNaN(e))),l=!!s.selectHyperCubeCells.values.length);else{const n=e.brush.values().map((e=>+e)).filter((e=>!isNaN(e)));l=!!n.length,o.push({params:[t.path,t.dimensionIdx,n,!1],method:"selectHyperCubeValues"})}}})),!l&&a?[{method:"resetMadeSelections",params:[]}]:(s.rangeSelectHyperCubeValues&&o.push({method:"rangeSelectHyperCubeValues",params:[s.rangeSelectHyperCubeValues.path,s.rangeSelectHyperCubeValues.ranges,[],null===(c=t.orMode)||void 0===c||c]}),s.selectHyperCubeContinuousRange&&o.push({method:"selectHyperCubeContinuousRange",params:[s.selectHyperCubeContinuousRange.path,s.selectHyperCubeContinuousRange.ranges]}),s.selectHyperCubeCells&&o.push({method:"selectHyperCubeCells",params:[s.selectHyperCubeCells.path,s.selectHyperCubeCells.values,s.selectHyperCubeCells.cols]}),s.selectPivotCells&&o.push({method:"selectPivotCells",params:[s.selectPivotCells.path,s.selectPivotCells.cells]}),s.multiRangeSelectTreeDataValues&&o.push({method:"multiRangeSelectTreeDataValues",params:[s.multiRangeSelectTreeDataValues.path,s.multiRangeSelectTreeDataValues.ranges]}),o);var c}function xt(e){lt.util=e.data("matrix").util,e.data("q",lt),e.formatter("q-number",He),e.formatter("q-time",rt)}return xt.qBrushHelper=bt,xt.selections=bt,xt}()}(Gw);var Jw=n(Gw.exports);const Zw={brushInterceptors:{DIM_VALUE_NULL:-2,DIM_VALUE_TOTAL:-3,brushOnlyOne:function(e,t){const n=e.brushes().filter((e=>"value"===e.type));let i=[];n.length&&n.forEach((e=>{i=i.concat(e.brush.values().map((t=>({key:e.id,value:t}))))}));return i.concat(t)},filterValues:function(e,t){const n=this;let i,r;const o=[];let s=0;const a=[];return t.forEach((t=>{t.value!==n.DIM_VALUE_NULL&&t.value!==n.DIM_VALUE_TOTAL&&(r=function(e,t){const n=t.key.indexOf("qHyperCube")+10,i=t.key.substr(0,n),r=t.key.substr(n+1);return e.dataset(i).field(r)}(e,t),i=r&&r.raw(),i.qLocked?(o.push(i),s++):a.push({key:t.key,value:t.value}))})),{items:a,itemsAreLocked:s>0&&s===t.length,lockedFields:o}}}};const Qw={data:["elemNo"],contexts:["select"],startOnEmptySelection:!0,style:{active:{strokeWidth:2,stroke:"#333"},inactive:{opacity:.3}}};function eq(e){if(!e||!e.chartInstance||!e.selectionsApi)throw Error("Selections-handler: Missing input");const t=e.chartInstance,n=e.selectionsApi,i=e.dataPaths||[""],r=e.selectPaths,o=e.lasso;let s=[];const a={propertiesToRestore:{}};let l=!1;const c=function(e,t,n){function i(){}return i.update=function(e,i,r){t.isActive()||t.begin(n),Jw.qBrushHelper(r).forEach((e=>{t.select(e)}))},i.toggleValues=function(i,r,o){const s=Zw.brushInterceptors.filterValues(e,i),a=s.items;return t.isActive()||s.itemsAreLocked||!(o||a.length>0)||(t.begin(n),r.start(),r.emit("update",[],[])),a},i}(t,n,r),u={};let h=!1;function d(e){16===e.keyCode&&e.shiftKey!==h&&(h=e.shiftKey,o.toggle())}function f(e){const t=e.keyCode;27===t?n.cancel():13===t&&n.confirm()}function p(){s.forEach((e=>{e.listeners.update=function(t,n){e.sleep||c.update(t,n,e.brush)},e.brush.on("update",e.listeners.update),e.brush.on("start",e.listeners.start)}))}function m(){s.forEach((e=>{e.brush.removeListener("update",e.listeners.update),e.brush.removeListener("start",e.listeners.start)}))}return n.on("cleared",(()=>{s.forEach((e=>{e.brush.clear(),e.dependentComponents.forEach((e=>{const n=t.component(e.id);n&&n.emit(e.clear)}))}))})),u.setUp=function(e){u.tearDown();const t=this.setUpBrush(e);return l&&p(),t},u.setUpBrush=function(e){const n=Tb(!0,{},Qw,e),r={on:"tap",action:t=>t.ctrlKey||e.isSingleSelect?"set":"toggle",contexts:n.contexts,data:n.data,globalPropagation:"stop"},o={context:n.contexts[0],data:n.data,style:n.style},a=function(e,t){return{brush:t.brush(e.contexts[0]),listeners:{},dependentComponents:[],id:e.contexts[0]}}(n,t);return a.listeners.toggle=function(e){if(!l)return[];const r=function(){const e=[];let n=i.map((e=>t.dataset(e).fields().filter((e=>"dimension"===e.type()))));n=[].concat.apply([],n);for(let t=0;t<n.length;t++)n[t].raw().qLocked&&e.push(n[t].raw());return{fields:e,areAllFieldsLocked:e.length&&e.length===n.length}}();return n.startOnEmptySelection&&0===e.length&&r.areAllFieldsLocked?[]:c.toggleValues(e,a.brush,n.startOnEmptySelection)},a.brush.intercept("toggle-values",a.listeners.toggle),a.brush.intercept("add-values",a.listeners.toggle),a.brush.intercept("remove-values",a.listeners.toggle),a.brush.intercept("set-values",a.listeners.toggle),a.listeners.start=function(){s.length>1&&s.forEach((e=>{e!==a&&e.brush.end()}))},s.push(a),{trigger:r,consume:o}},u.setUpStart=function(){u.tearDown()},u.setUpDone=function(){l&&p()},u.tearDown=function(){l&&m(),s.forEach((e=>{e.brush.removeInterceptor("toggle-values",e.listeners.toggle),e.brush.removeInterceptor("add-values",e.listeners.toggle),e.brush.removeInterceptor("remove-values",e.listeners.toggle),e.brush.removeInterceptor("set-values",e.listeners.toggle)})),s=[]},u.pauseEngineCalls=function(e){s.forEach((t=>{t.id===e&&(t.sleep=!0)}))},u.resumeEngineCalls=function(e,t){s.forEach((n=>{n.id===e&&(n.sleep=!1,t&&n.listeners.update([],[]))}))},u.addComponent=function(e,t){s.forEach((n=>{n.id===e&&n.dependentComponents.push(t)}))},u.on=function(){if(l)return;l=!0,p(),document.addEventListener("keydown",d),document.addEventListener("keyup",d);const e=()=>{s.forEach((e=>{e.brush.end()})),document.removeEventListener("keyup",f),o.active()&&o.toggle()};n.on("deactivated",e),a.unbindDeactivated=()=>{n.removeListener("deactivated",e)};const t=()=>{document.addEventListener("keyup",f)};n.on("activated",t),a.unbindActivated=()=>{n.removeListener("activated",t)}},u.isOn=()=>l,u.off=function(){l&&(l=!1,m(),document.removeEventListener("keydown",d),document.removeEventListener("keyup",d),document.removeEventListener("keyup",f),a.unbindActivated(),a.unbindDeactivated())},u.lassoState=function(){return o.active()&&!(e.isLassoDisabled&&e.isLassoDisabled())},u.allFieldsLocked=function(){return function(){let e=i.map((e=>t.dataset(e).fields().filter((e=>"dimension"===e.type()))));return e=[].concat.apply([],e),e.length&&e.every((e=>e.raw().qLocked))}()},u}class tq{isOn(){return!1}on(){console.warn("Can not turn on selections on this object")}off(){}}var nq={create:e=>e.selectionsApi?eq(e):new tq};var iq={isOnComponentForRange:function(e,t,n){return!!e&&!!n.chart.componentsFromPoint({x:e.center.x,y:e.center.y}).filter((e=>-1!==t.indexOf(e.settings.key)))[0]},isOnComponentForLasso:function(e,t,n){return e&&n.chart.componentsFromPoint({x:e.center.x,y:e.center.y}).filter((e=>e.settings.key===t.keys.componentKey))[0]},isOnComponentForNavBtn:function(e,t,n){return n.chart.componentsFromPoint(e.center).some((e=>e.settings.key===t))}};var rq={callLassoGesture:function(e,t,n){return{type:"Pan",options:{direction:Eg.DIRECTION_ALL,threshold:1,enable(i,r){if(e.lassoing)return t.isSelectionEnabled();const o=iq.isOnComponentForLasso(r,n,this);return t.isSelectionEnabled()&&r&&((s=n.handlers).selectionHandler.lassoState()&&!s.selectionHandler.allFieldsLocked()||e.lassoing)&&o;var s},event:"lasso"},recognizeWith:n.handlers.scrollHandler?"drag":null,events:{lassostart(i){iq.isOnComponentForLasso(i,n,this)&&(t.switchTo("lasso",this.chart,i),e.lassoing=!0,n.handlers.selectionHandler.pauseEngineCalls(n.keys.lassoBrushKey),i.clientX=i.pointers[0].clientX,i.clientY=i.pointers[0].clientY,t.doEmit(this.chart,"lasso","lassoStart",i))},lassomove(n){e.lassoing&&(n.clientX=n.pointers[0].clientX,n.clientY=n.pointers[0].clientY,t.doEmit(this.chart,"lasso","lassoMove",n))},lassoend(i){e.lassoing&&(i.clientX=i.pointers[0].clientX,i.clientY=i.pointers[0].clientY,t.doEmit(this.chart,"lasso","lassoEnd",i),n.handlers.selectionHandler.resumeEngineCalls(n.keys.lassoBrushKey,!0),e.lassoing=!1)},lassocancel(i){e.lassoing=!1,t.doEmit(this.chart,"lasso","lassoCancel",i),n.handlers.selectionHandler.resumeEngineCalls(n.keys.lassoBrushKey,!1)}}}}};var oq={callMeasureRangeGesture:function(e,t,n,i){const r=n.keys.dimRangeBrushKey?"majorrange":"arearange";return{type:"Pan",options:{direction:n.isHorizontal?Eg.DIRECTION_HORIZONTAL:Eg.DIRECTION_VERTICAL,event:"measurerange",enable(r,o){if(!n.rangeSelStatus.isOpenMea)return!1;if(e.measureSelecting)return t.isSelectionEnabled();const s="measurerange"===n.active.gesture?[i,n.keys.componentKey]:[i],a=iq.isOnComponentForRange(o,s,this);return e.measureSelecting=t.isSelectionEnabled()&&!!o&&!!a,e.measureSelecting&&!!n.keys.measureRangeBrushKey}},requireFailure:`lasso ${r}`,recognizeWith:n.handlers.scrollHandler?"drag":null,events:{measurerangestart(r){const o="measurerange"===n.active.gesture?[i,n.keys.componentKey]:[i];iq.isOnComponentForRange(r,o,this)&&(e.measureSelecting=!0,t.switchTo("measurerange",this.chart,r),t.doEmit(this.chart,"rangeMeasure","rangeStart",r),n.handlers.selectionHandler.pauseEngineCalls(n.keys.measureRangeBrushKey))},measurerangemove(n){e.measureSelecting&&t.doEmit(this.chart,"rangeMeasure","rangeMove",n)},measurerangeend(i){e.measureSelecting&&(n.handlers.selectionHandler.resumeEngineCalls(n.keys.measureRangeBrushKey,!0),t.doEmit(this.chart,"rangeMeasure","rangeEnd",i),e.measureSelecting=!1)},measurerangecancel(){n.handlers.selectionHandler.resumeEngineCalls(n.keys.measureRangeBrushKey,!1),e.measureSelecting=!1}}}}};function sq(e,t){let n;return n="x-axis"===e?"horizontal"===t?Eg.DIRECTION_VERTICAL:Eg.DIRECTION_HORIZONTAL:"horizontal"===t?Eg.DIRECTION_HORIZONTAL:Eg.DIRECTION_VERTICAL,n}var aq={callAreaRangeGesture:function(e,t,n,i){const r=n.keys.dimRangeBrushKey?"majorrange":"measurerange";return{type:"Pan",options:{direction:sq(i,n.isHorizontal),event:"arearange",enable(r,o){if(!n.rangeSelStatus.isOpenDim)return!1;if(e.minoring)return t.isSelectionEnabled();const s="arearange"===n.active.gesture?[i,n.keys.componentKey]:[i],a=iq.isOnComponentForRange(o,s,this);return e.minoring=t.isSelectionEnabled()&&!!o&&!!a,e.minoring}},requireFailure:`lasso ${r}`,recognizeWith:n.handlers.scrollHandler?"drag":null,events:{arearangestart(r){const o="arearange"===n.active.gesture?[i,n.keys.componentKey]:[i];iq.isOnComponentForRange(r,o,this)&&(e.minoring=!0,t.switchTo("arearange",this.chart,r),t.doEmit(this.chart,"rangeMinor","areaStart",r),n.handlers.selectionHandler.pauseEngineCalls(n.keys.areaBrushKey))},arearangemove(i){e.minoring&&(this.chart.brush(n.keys.areaBrushKey).clear(),t.doEmit(this.chart,"rangeMinor","areaMove",i))},arearangeend(i){e.minoring&&(n.handlers.selectionHandler.resumeEngineCalls(n.keys.areaBrushKey,!0),t.doEmit(this.chart,"rangeMinor","areaEnd",i),e.minoring=!1)},arearangecancel(){n.handlers.selectionHandler.resumeEngineCalls(n.keys.areaBrushKey,!1),e.minoring=!1}}}}};var lq={callDimensionRangeGesture:function(e,t,n,i){const r=n.keys.measureRangeBrushKey?"measurerange":"arearange";return{type:"Pan",options:{direction:n.isHorizontal?Eg.DIRECTION_VERTICAL:Eg.DIRECTION_HORIZONTAL,event:"majorrange",enable(r,o){if(!n.rangeSelStatus.isOpenDim)return!1;if(e.majoring)return t.isSelectionEnabled();const s="majorrange"===n.active.gesture?[i,n.keys.componentKey]:[i],a=iq.isOnComponentForRange(o,s,this);return e.majoring=t.isSelectionEnabled()&&!!o&&!!a,e.majoring&&!!n.keys.dimRangeBrushKey}},requireFailure:`lasso ${r}`,recognizeWith:n.handlers.scrollHandler?"drag":null,events:{majorrangestart(r){const o="majorrange"===n.active.gesture?[i,n.keys.componentKey]:[i];iq.isOnComponentForRange(r,o,this)&&(e.majoring=!0,t.switchTo("majorrange",this.chart,r),t.doEmit(this.chart,"rangeDim","rangeStart",r),n.handlers.selectionHandler.pauseEngineCalls(n.keys.dimRangeBrushKey))},majorrangemove(n){e.majoring&&t.doEmit(this.chart,"rangeDim","rangeMove",n)},majorrangeend(i){e.majoring&&(n.handlers.selectionHandler.resumeEngineCalls(n.keys.dimRangeBrushKey,!0),t.doEmit(this.chart,"rangeDim","rangeEnd",i),e.majoring=!1)},majorrangecancel(){n.handlers.selectionHandler.resumeEngineCalls(n.keys.dimRangeBrushKey,!1),e.majoring=!1}}}}};var cq={callDragGesture:function(e,t,n,i,r){let o={};return{type:"Pan",options:{direction:n.isHorizontal?Eg.DIRECTION_VERTICAL:Eg.DIRECTION_HORIZONTAL,event:"drag",enable(i,r){return e.dragging?t.isNavigationEnabled():(e.dragging=t.isNavigationEnabled()&&!!r&&!!this.chart.componentsFromPoint({x:r.center.x,y:r.center.y}).filter((e=>e.settings.key===n.keys.componentKey))[0],e.dragging)}},requireFailure:i?`lasso ${t.getBrushConfig()}`:"",events:{dragstart(e){o={x:e.deltaX,y:e.deltaY};let t=-(n.isHorizontal?e.deltaY:e.deltaX)/n.handlers.scrollHandler.getItemSize();!n.isHorizontal&&r&&(t=-t),n.handlers.scrollHandler.getScrollApi().move(t)},dragmove(t){if(!e.dragging)return;let i=-(n.isHorizontal?t.deltaY-o.y:t.deltaX-o.x)/n.handlers.scrollHandler.getItemSize();!n.isHorizontal&&r&&(i=-i),n.handlers.scrollHandler.getScrollApi().move(i),o={x:t.deltaX,y:t.deltaY}},dragend(){e.dragging&&(e.dragging=!1)},dragcancel(){e.dragging=!1}}}}};var uq={callNavBtnGesture:function(e,t){return{type:"Tap",options:{event:"navBtnTap",enable(n,i){return!(!i||!e())&&iq.isOnComponentForNavBtn(i,t,this)}},events:{navBtnTap(e){this.chart.componentsFromPoint(e.center).forEach((t=>{const n=e.target,i=n?n.getAttribute("data-action"):"";if(i)return t.emit(i)}))}}}}};var hq={create:function(e,t,n,i,r){const o={};t=t||"vertical";const s=i.lassoBrushKey||"select",a=i.dimRangeBrushKey||null,l=i.measureRangeBrushKey||null,c=i.areaBrushKey||null,u=i.legendBrushKey||null,h=!!e.selectionHandler&&e.selectionHandler.isOn(),d={dragging:!1,lassoing:!1,majoring:!1,minoring:!1,measureSelecting:!1},f={gesture:"",type:""},p="horizontal"===t,m=p?"y-axis":"x-axis",g=p?"x-axis":"y-axis";function y(e,t,n){if(f.gesture===e)return;let i=s;const r=t||f.chart;switch(f.gesture){case"majorrange":v(r,"rangeDim","rangeClear",n),i=a;break;case"measurerange":v(r,"rangeMeasure","rangeClear",n),i=l;break;case"arearange":v(r,"rangeMinor","areaClear",n),i=c}f.gesture=e;const o="range"===e?"range":"item";f.type&&f.type!==o&&r.brush(i).clear(),f.chart=t,f.type=o}function v(e,t,n,i){if(e){const r=e.component(t);r&&r.emit(n,i)}}let b=[];const x={isSelectionEnabled:()=>e.selectionHandler&&e.selectionHandler.isOn(),isNavigationEnabled:()=>e.scrollHandler&&e.scrollHandler.isOn(),doEmit:v,switchTo:y,getBrushConfig:function(){return a?l?"majorrange measurerange":"majorrange arearange":"measurerange arearange"}},w={handlers:e,keys:i,isHorizontal:p,active:f,rangeSelStatus:r};function q(){y("none"),d.majoring=!1,d.measureSelecting=!1,d.minoring=!1}return h&&(b=[{type:"Tap",options:{event:"rangeClearTap"},events:{rangeClearTap(e){y("none",this.chart,e),d.majoring=!1,d.measureSelecting=!1,d.minoring=!1}}}],b.unshift(uq.callNavBtnGesture(x.isNavigationEnabled,u)),b.push(rq.callLassoGesture(d,x,w)),a?l?(b.push(lq.callDimensionRangeGesture(d,x,w,m)),e.selectionHandler.addComponent(a,{id:"rangeDim",clear:"rangeClear"}),b.push(oq.callMeasureRangeGesture(d,x,w,g)),e.selectionHandler.addComponent(l,{id:"rangeMeasure",clear:"rangeClear"})):(b.push(lq.callDimensionRangeGesture(d,x,w,m)),e.selectionHandler.addComponent(a,{id:"rangeDim",clear:"rangeClear"}),b.push(aq.callAreaRangeGesture(d,x,w,g)),e.selectionHandler.addComponent(c,{id:"rangeMinor",clear:"areaClear"})):(b.push(oq.callMeasureRangeGesture(d,x,w,g)),e.selectionHandler.addComponent(l,{id:"rangeMeasure",clear:"rangeClear"}),b.push(aq.callAreaRangeGesture(d,x,w,m)),e.selectionHandler.addComponent(c,{id:"rangeMinor",clear:"areaClear"}))),e.scrollHandler&&(b.push(cq.callDragGesture(d,x,w,h,n)),e.scrollHandler.getScrollApi().on("update",q)),o.gestures=b,o.destroy=function(){e.scrollHandler&&e.scrollHandler.getScrollApi().removeListener("update",q)},o}};function dq(e,t,n,i,r){let o=!1;i=i||"tooltip",n=n||["self"];const s=e.brush(i),a={};function l(){if(o){e.component(r).emit("hide")}o=!1}return a.isOpen=function(){return o},a.closeTooltip=l,a.update=function(){const a=s.brushes(),c=e.getAffectedShapes(i,"and",n,t);a.length>=1?(o=!0,function(t){o=!0;const n={nodes:t};e.component(r).emit("show",{},n)}(c)):l()},a.toggleInterceptor=function(e){if(n.length>1){const t={},n=[];return e.forEach((e=>{t[e.key]||(t[e.key]={}),t[e.key][e.value]||(t[e.key][e.value]=!0,n.push(e))})),n}return e},a}var fq={create:(...e)=>dq(...e)},pq={formatMeasureValue:function(e,t){if(e.raw().isCustomFormatted)return e.formatter()(t.value.qText);const n=void 0!==t.value.qNum?t.value.qNum:t.value.qValue;return e.formatter()(n)}};const mq=-3;const gq=e=>({h:t,data:n,style:i})=>{const r=function(e,t){const n=e.chartInstance.dataset(e.dataPath),i=[],r=t.length-5,o=Math.min(5,t.length);for(let r=0;r<o;r++){const o=t[r],s={rows:[]};if(e.labelData){const t=[],r=e.labelData;let a=!1;for(let e=0;e<r.length;e++){const n=o.data[r[e]].value;if(-2===n.qElemNo||-2===n.qElemNumber){a=!0;break}t.push(o.data[r[e]].value.qText)}if(a)return;s.header=e.headerResolver(t),s.rows=e.measureRows.map((t=>{const i=o.data;return e.rowResolver(n.field(i[t].source.field),i[t],i)})).filter((e=>!!e));const l=yq(e,o);l&&s.rows.unshift(l),i.push(s)}}r>0&&(i.numberInExcess=r);return i.rowCount=i[0]?i.length*i[0].rows.length:0,i}(e,n),o={h:t,style:i,rtl:"rtl"===e.direction,translator:e.translator};return e.renderer(o,r)};function yq(e,t){var n,i,r;const o=t.data.color,s=null===(n=e.colorService)||void 0===n||null===(i=n.getSettings)||void 0===i?void 0:i.call(n);if(!s||"color"===s.type||!o||!s.fieldType)return;const a=[];e.data.forEach((e=>{const n=t.data[e];n&&a.push(n.value)}));const l=function(e){let t=-1;for(let n=0;n<e.length;n++)e[n]===mq&&(t=n);return t}(a),{translator:c}=e,u=s.label;return{color:null===(r=t.attrs)||void 0===r?void 0:r.fill,label:u,value:-1!==l?c.get("properties.dimensionLimits.others"):o.label}}const vq="dist-flow-tooltip",bq=`#${vq}`;function xq(){if(!document.querySelector(bq)){const e=document.createElement("div");e.id=vq,e.style.overflow="hidden",e.style.position="fixed",e.style.pointerEvents="none",e.style.left="0px",e.style.top="0px",e.style.width="100%",e.style.height="100%",e.style.zIndex=1020,document.body.appendChild(e)}}function wq({key:e="tooltip",rtl:t,fontFamily:n,filter:i,content:r}){return{show:!0,key:e,type:"tooltip",layout:{displayOrder:3},beforeMount(){xq()},beforeUpdate(){xq()},destroyed(){!function(){const e=document.querySelector(bq);e&&e.parentElement&&e.childElementCount<1&&e.parentElement.removeChild(e)}()},settings:{appendTo:()=>document.querySelector(bq),content:r,filter:i,extract:e=>e.node,direction:t?"rtl":"ltr",placement:"bounds"},style:{arrow:{color:"#404040"},content:{display:"table","border-spacing":"4px",background:"rgba(64, 64, 64, 0.9)",opacity:"1",fontSize:"13px",fontFamily:n,"empty-cells":"show"},cell:{"max-width":"180px","word-break":"break-word","word-wrap":"break-word","overflow-wrap":"break-word",hyphens:"auto"}}}}const{detectTextDirection:qq}=ow;const Sq={tooltipKey:"tooltip",data:[""],contexts:["tooltip"],headerResolver:e=>e.join(", "),rowResolver:(e,t)=>({value:pq.formatMeasureValue(e,t),label:e.title()}),direction:"ltr",renderer:function(e,t){const{h:n,style:i,translator:r,rtl:o}=e,s=[],a=o?"right":"left";if(t.forEach((e=>{if(e.header){const t={...i.cell,textAlign:a,fontWeight:"bold",direction:qq(e.header)};s.push(n("tr",null,n("td",{style:t,colSpan:2},e.header)))}e.rows.forEach((e=>{let t=e.value;if(e.color){const i={display:"inline-block",width:10,height:10,"background-color":e.color,margin:"0 8px"},r=n("div",{style:i});t=o?[e.value,r]:[r,e.value]}const r=o?[":",e.label]:[e.label,":"],l={...i.cell,textAlign:a,direction:qq(e.label)},c={...i.cell,textAlign:o?"left":"right",direction:qq(e.value)};s.push(n("tr",null,n("td",{style:l},r),n("td",{style:c},t)))}))})),t.numberInExcess){const e=r.get("Object.ChartTooltip.NMore",t.numberInExcess),o={...i.cell,textAlign:a,direction:qq(e)};s.push(n("tr",null,n("td",{style:o,colSpan:2},e)))}return s}};function Mq(e,t,n){if(!e)throw Error("Tooltips-handler: Missing input");let i={},r=!1;const o={};function s(e){e.listeners.update=function(t,n){e.action.update(t,n,e)},e.listeners.end=function(){e.action.closeTooltip()},e.brush.on(e.treatAsDesktop?"update":"set-values",e.listeners.update),e.brush.on("end",e.listeners.end),e.brush.intercept("set-values",e.action.toggleInterceptor)}function a(){Object.keys(i).forEach((e=>{l(i[e])}))}function l(e){e.brush.removeListener(e.treatAsDesktop?"update":"set-values",e.listeners.update),e.brush.removeListener("end",e.listeners.end),e.brush.removeInterceptor("set-values",e.action.toggleInterceptor)}function c(){Object.keys(i).forEach((e=>{i[e].action.closeTooltip()}))}function u(){c();for(const e in i)i[e].brush.clear()}return o.setUp=function(t){const o=Tb(!0,{},Sq,t);if(!o.componentKey)throw Error("Tooltips-handler.setUp: Missing required input");i[o.contexts[0]]&&r&&l(i[o.contexts[0]]);const a=function(e,t){return{brush:t.brush(e.contexts[0]),action:fq.create(t,e.componentKey,e.data,e.contexts[0],e.tooltipKey),listeners:{},chartInstance:t,dataPath:e.dataPath,renderer:e.renderer,data:e.data,headerResolver:e.headerResolver,rowResolver:e.rowResolver,colorService:e.colorService,attrDimPath:e.attrDimPath,measureRows:e.measureRows,labelData:e.labelData,filterShapes:e.filterShapes,direction:e.environment.options.direction,theme:e.environment.theme,translator:e.environment.translator,treatAsDesktop:"touch"!==e.environment.deviceType}}(o,e);i[o.contexts[0]]=a,r&&s(a);const c=wq({key:o.tooltipKey,rtl:"rtl"===a.direction,fontFamily:a.theme.getStyle(n,"tooltip","fontFamily"),filter:(u=a.filterShapes,e=>u?u(e):function(e){const t=[];return e.forEach((e=>{-1===t.indexOf(e)&&"container"!==e.type&&t.push(e)})),t}(e)),content:gq(a,o.dataPath)});var u;return o.chartBuilder.getSettings().components.push(c),{trigger:{on:a.treatAsDesktop?"over":"tap",action:"set",contexts:o.contexts,data:o.data,globalPropagation:"stop"},consume:o.contexts.map((e=>({context:e}))),component:c}},o.tearDown=function(){r&&a(),i=[]},o.closeTooltip=c,o.isOn=()=>r,o.on=function(){r||(r=!0,Object.keys(i).forEach((e=>{s(i[e])})),t&&t.on("mouseleave",u))},o.off=function(){r&&(r=!1,a(),t&&t.off("mouseleave",u),c())},o}var Dq={create:(e,t,n)=>Mq(e,t,n)};const _q=".scrollHandler";function Cq(e,t,n,i,r){if(!e||!t||!n)throw Error("Scroll-handler: Missing input");this._chartInstance=e,this._$chartElement=t,this._getSlicedDataFn=n,this._on=!1,this._itemSize=30,this.options={direction:"vertical"},this._onScrollCallback=i,this._legendKey=r}function kq(){const e=("horizontal"===this.options.direction?this._$chartElement.width():this._$chartElement.height())||0,t=Math.floor(e/this.getItemSize());this._scrollViewSizeInItem=Math.max(t,1)}function Eq(e){const t=function(e){let t=0,n=0,i=0;return e.wheelDelta&&(t=e.wheelDelta/60),e.detail&&(t=-e.detail/3),i=t,void 0!==e.axis&&e.axis===e.HORIZONTAL_AXIS&&(i=0,n=-1*t),void 0!==e.wheelDeltaY&&(i=e.wheelDeltaY/60),void 0!==e.wheelDeltaX&&(n=-1*e.wheelDeltaX/60),{delta:t,deltaX:n,deltaY:i,x:e.pageX,y:e.pageY}}(e.originalEvent);if(function(e,t,n,i){if(i&&n.componentsFromPoint(t).some((e=>e.settings.key===i)))return n.component(i).emit(t.delta>0?"prev":"next"),e.preventDefault(),!0;return!1}(e,t,this._chartInstance,this._legendKey)||this._disabled||!this.getScrollApi())return;if(e.preventDefault(),!t.delta)return;const n=t.delta<0?3:-3;this._scrollApi.move(n)}function Aq(){if(this._disabled||this._sizeChanged)return void(this._sizeChanged=!1);const e=this;this.getViewData().then((t=>{e._on&&!e._disabled&&e._onScrollCallback&&e._onScrollCallback(t,void 0,!0)})).catch((e=>{}))}Cq.prototype.getScrollApi=function(){this._scrollApi||(this._scrollApi=this._chartInstance.scroll("dimension"));return this._scrollApi},Cq.prototype.setDisabled=function(e){this._disabled=e},Cq.prototype.getDisabled=function(){return this._disabled},Cq.prototype.setItemSize=function(e){this._itemSize!==e&&(this._itemSize=e,kq.call(this))},Cq.prototype.getItemSize=function(){return this._itemSize},Cq.prototype.getScrollViewSizeInItem=function(){this._scrollViewSizeInItem||kq.call(this);return this._scrollViewSizeInItem},Cq.prototype.on=function(){if(this._on)return;this.getScrollApi()&&(this._scrollApi.removeAllListeners(),this._scrollApi.on("update",Aq.bind(this)));this._$chartElement.on(`mousewheel${_q} DOMMouseScroll${_q}`,Eq.bind(this)),this._$chartElement.on(`touchstart${_q}`,(e=>{e.preventDefault()})),this._on=!0},Cq.prototype.isOn=function(){return this._on},Cq.prototype.off=function(){if(!this._on)return;this.getScrollApi()&&this._scrollApi.removeAllListeners();this._$chartElement.off(_q),this._on=!1},Cq.prototype.updateViewState=function(e){kq.call(this),this.getScrollApi()&&this._scrollApi.update({viewSize:this._scrollViewSizeInItem,max:e})},Cq.prototype.onResize=function(){this._sizeChanged=!0,kq.call(this),this.getScrollApi()&&this._scrollApi.update({viewSize:this._scrollViewSizeInItem})},Cq.prototype.isDataSizeChanged=function(e,t){return Math.min(this.getScrollViewSizeInItem(),t)!==e},Cq.prototype.resetScroll=function(){this.getScrollApi()&&this._scrollApi.moveTo(0)},Cq.prototype.getViewData=function(){let e=0,t=0;if(this.getScrollApi()){const n=this._scrollApi.getState();e=Math.round(n.start),t=n.viewSize}return this._getSlicedDataFn(e,t)},Cq.prototype.setOptions=function(e){this.options.direction!==e.direction&&(this._scrollViewSizeInItem=void 0);this.options=e},Cq.prototype.getScrollState=function(){return this.getScrollApi().getState().start},Cq.prototype.setScrollState=function(e){this.getScrollApi().moveTo(e)};const Tq=166/26,Iq=12,Rq=11,Oq=12/Rq;function Nq(e){return(Math.min(e,3)*Iq+Math.max(e-3,0)*Tq)/Rq}function Pq(e){if(!e)return{latin:0,cjk:0};let t=e.match(/[\u4E00-\u9FFF]/g),n=e.match(/[\u3040-\u309F]/g),i=e.match(/[\u30A0-\u30FF]/g);t=t?t.length:0,n=n?n.length:0,i=i?i.length:0;const r=t+n+i;return{latin:e.length-r,cjk:r}}function Lq(e,t){const n={latin:0,cjk:0};void 0===t?e.forEach((e=>{const t=Pq(e.qText);n.latin+=t.latin,n.cjk+=t.cjk})):e.forEach((e=>{const i=Pq(e[t].qText);n.latin+=i.latin,n.cjk+=i.cjk}));const i=Math.max(1,n.latin+n.cjk);return n.latinRatio=n.latin/i,n.cjkRatio=n.cjk/i,n}function Fq(e,t,n){return e*(e<=24?t:n)}var zq={endsWith:function(e,t){return-1!==e.indexOf(t,e.length-t.length)},startsWith:function(e,t){return 0===e.indexOf(t)},contains:function(e,t){if(!e)throw new Error("Haystack is undefined.");if(!t)throw new Error("Needle is undefined.");return-1!==e.indexOf(t)},stringWidthOverMWidth:Nq,getCharacterRatios:Pq,getTotalCharacterRatios:Lq,getAdjustedMaxGlyphCount:function(e,t,n){const i=Lq(t,n),r=i.latinRatio*e,o=i.cjkRatio*e;return Math.ceil(Nq(r)+o*Oq)},estimateLatinLabelWidth:Fq,estimateLabelWidth:function(e,t,n,i,r){return e*n+Fq(t,i,r)}};const jq={aliceblue:{r:240,g:248,b:255},antiquewhite:{r:250,g:235,b:215},aqua:{r:0,g:255,b:255},aquamarine:{r:127,g:255,b:212},azure:{r:240,g:255,b:255},beige:{r:245,g:245,b:220},bisque:{r:255,g:228,b:196},black:{r:0,g:0,b:0},blanchedalmond:{r:255,g:235,b:205},blue:{r:0,g:0,b:255},blueviolet:{r:138,g:43,b:226},brown:{r:165,g:42,b:42},burlywood:{r:222,g:184,b:135},cadetblue:{r:95,g:158,b:160},chartreuse:{r:127,g:255,b:0},chocolate:{r:210,g:105,b:30},coral:{r:255,g:127,b:80},cornflowerblue:{r:100,g:149,b:237},cornsilk:{r:255,g:248,b:220},crimson:{r:220,g:20,b:60},cyan:{r:0,g:255,b:255},darkblue:{r:0,g:0,b:139},darkcyan:{r:0,g:139,b:139},darkgoldenrod:{r:184,g:134,b:11},darkgray:{r:169,g:169,b:169},darkgreen:{r:0,g:100,b:0},darkgrey:{r:169,g:169,b:169},darkkhaki:{r:189,g:183,b:107},darkmagenta:{r:139,g:0,b:139},darkolivegreen:{r:85,g:107,b:47},darkorange:{r:255,g:140,b:0},darkorchid:{r:153,g:50,b:204},darkred:{r:139,g:0,b:0},darksalmon:{r:233,g:150,b:122},darkseagreen:{r:143,g:188,b:143},darkslateblue:{r:72,g:61,b:139},darkslategray:{r:47,g:79,b:79},darkslategrey:{r:47,g:79,b:79},darkturquoise:{r:0,g:206,b:209},darkviolet:{r:148,g:0,b:211},deeppink:{r:255,g:20,b:147},deepskyblue:{r:0,g:191,b:255},dimgray:{r:105,g:105,b:105},dimgrey:{r:105,g:105,b:105},dodgerblue:{r:30,g:144,b:255},firebrick:{r:178,g:34,b:34},floralwhite:{r:255,g:250,b:240},forestgreen:{r:34,g:139,b:34},fuchsia:{r:255,g:0,b:255},gainsboro:{r:220,g:220,b:220},ghostwhite:{r:248,g:248,b:255},gold:{r:255,g:215,b:0},goldenrod:{r:218,g:165,b:32},gray:{r:128,g:128,b:128},green:{r:0,g:128,b:0},greenyellow:{r:173,g:255,b:47},grey:{r:128,g:128,b:128},honeydew:{r:240,g:255,b:240},hotpink:{r:255,g:105,b:180},indianred:{r:205,g:92,b:92},indigo:{r:75,g:0,b:130},ivory:{r:255,g:255,b:240},khaki:{r:240,g:230,b:140},lavender:{r:230,g:230,b:250},lavenderblush:{r:255,g:240,b:245},lawngreen:{r:124,g:252,b:0},lemonchiffon:{r:255,g:250,b:205},lightblue:{r:173,g:216,b:230},lightcoral:{r:240,g:128,b:128},lightcyan:{r:224,g:255,b:255},lightgoldenrodyellow:{r:250,g:250,b:210},lightgray:{r:211,g:211,b:211},lightgreen:{r:144,g:238,b:144},lightgrey:{r:211,g:211,b:211},lightpink:{r:255,g:182,b:193},lightsalmon:{r:255,g:160,b:122},lightseagreen:{r:32,g:178,b:170},lightskyblue:{r:135,g:206,b:250},lightslategray:{r:119,g:136,b:153},lightslategrey:{r:119,g:136,b:153},lightsteelblue:{r:176,g:196,b:222},lightyellow:{r:255,g:255,b:224},lime:{r:0,g:255,b:0},limegreen:{r:50,g:205,b:50},linen:{r:250,g:240,b:230},magenta:{r:255,g:0,b:255},maroon:{r:128,g:0,b:0},mediumaquamarine:{r:102,g:205,b:170},mediumblue:{r:0,g:0,b:205},mediumorchid:{r:186,g:85,b:211},mediumpurple:{r:147,g:112,b:219},mediumseagreen:{r:60,g:179,b:113},mediumslateblue:{r:123,g:104,b:238},mediumspringgreen:{r:0,g:250,b:154},mediumturquoise:{r:72,g:209,b:204},mediumvioletred:{r:199,g:21,b:133},midnightblue:{r:25,g:25,b:112},mintcream:{r:245,g:255,b:250},mistyrose:{r:255,g:228,b:225},moccasin:{r:255,g:228,b:181},navajowhite:{r:255,g:222,b:173},navy:{r:0,g:0,b:128},oldlace:{r:253,g:245,b:230},olive:{r:128,g:128,b:0},olivedrab:{r:107,g:142,b:35},orange:{r:255,g:165,b:0},orangered:{r:255,g:69,b:0},orchid:{r:218,g:112,b:214},palegoldenrod:{r:238,g:232,b:170},palegreen:{r:152,g:251,b:152},paleturquoise:{r:175,g:238,b:238},palevioletred:{r:219,g:112,b:147},papayawhip:{r:255,g:239,b:213},peachpuff:{r:255,g:218,b:185},peru:{r:205,g:133,b:63},pink:{r:255,g:192,b:203},plum:{r:221,g:160,b:221},powderblue:{r:176,g:224,b:230},purple:{r:128,g:0,b:128},red:{r:255,g:0,b:0},rosybrown:{r:188,g:143,b:143},royalblue:{r:65,g:105,b:225},saddlebrown:{r:139,g:69,b:19},salmon:{r:250,g:128,b:114},sandybrown:{r:244,g:164,b:96},seagreen:{r:46,g:139,b:87},seashell:{r:255,g:245,b:238},sienna:{r:160,g:82,b:45},silver:{r:192,g:192,b:192},skyblue:{r:135,g:206,b:235},slateblue:{r:106,g:90,b:205},slategray:{r:112,g:128,b:144},slategrey:{r:112,g:128,b:144},snow:{r:255,g:250,b:250},springgreen:{r:0,g:255,b:127},steelblue:{r:70,g:130,b:180},tan:{r:210,g:180,b:140},teal:{r:0,g:128,b:128},thistle:{r:216,g:191,b:216},tomato:{r:255,g:99,b:71},transparent:{r:255,g:255,b:255,a:0},turquoise:{r:64,g:224,b:208},violet:{r:238,g:130,b:238},wheat:{r:245,g:222,b:179},white:{r:255,g:255,b:255},whitesmoke:{r:245,g:245,b:245},yellow:{r:255,g:255,b:0},yellowgreen:{r:154,g:205,b:50}},Hq=/^rgb\((\d{1,3}),(\d{1,3}),(\d{1,3})\)$/i,Bq=/^rgba\((\d{1,3}),(\d{1,3}),(\d{1,3}),(\d(\.\d+)?)\)$/i,Vq=/^#([A-f0-9]{2})([A-f0-9]{2})([A-f0-9]{2})$/i,$q=/^#([A-f0-9])([A-f0-9])([A-f0-9])$/i,Wq=/^hsl\(\s*(\d+(\.\d+)?)\s*,\s*(\d+(\.\d+)?%?)\s*,\s*(\d+(\.\d+)?%?)\s*\)$/i,Uq=/^hsla\(\s*(\d+(\.\d+)?)\s*,\s*(\d+(\.\d+)?%?)\s*,\s*(\d+(\.\d+)?%?)\s*,(\d(\.\d+)?)\)$/i,Yq=Math.floor,Xq=Math.round,Kq=Gv.extend({init(){let e,t,n,i,r,o,s,a,l,c,u,h,d=0,f=0,p=0,m=1;if(this._invalid=!1,arguments[0]instanceof Kq)d=arguments[0]._r,f=arguments[0]._g,p=arguments[0]._b,m=arguments[0]._a,this._invalid=arguments[0]._invalid;else if(arguments.length<3)if("string"==typeof arguments[0])if(h=arguments[0],u=/^rgb\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*\)$/i.exec(h))d=parseInt(u[1],10),f=parseInt(u[2],10),p=parseInt(u[3],10);else if(u=/^rgba\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d(\.\d+)?)\s*\)$/i.exec(h))d=parseInt(u[1],10),f=parseInt(u[2],10),p=parseInt(u[3],10),m=parseFloat(u[4]);else if(u=/^#([A-f0-9]{2})([A-f0-9]{2})([A-f0-9]{2})$/i.exec(h))d=parseInt(u[1],16),f=parseInt(u[2],16),p=parseInt(u[3],16),m=1;else if(u=/^#([A-f0-9])([A-f0-9])([A-f0-9])$/i.exec(h))d=parseInt(u[1]+u[1],16),f=parseInt(u[2]+u[2],16),p=parseInt(u[3]+u[3],16),m=1;else if(u=/^hsl\(\s*(\d+(\.\d+)?)\s*,\s*(\d+(\.\d+)?%?)\s*,\s*(\d+(\.\d+)?%?)\s*\)$/i.exec(h)){switch(e=parseFloat(u[1]),t=parseFloat(u[3]),i=parseFloat(u[5]),e%=360,t/=100,i/=100,e=e<0?0:e>360?360:e,t=t<0?0:t>1?1:t,i=i<0?0:i>1?1:i,o=i<=.5?2*i*t:(2-2*i)*t,s=e/60,a=o*(1-Math.abs(s%2-1)),l=[],s=Math.floor(s),s){case 0:l=[o,a,0];break;case 1:l=[a,o,0];break;case 2:l=[0,o,a];break;case 3:l=[0,a,o];break;case 4:l=[a,0,o];break;case 5:l=[o,0,a];break;default:l=[0,0,0]}c=i-.5*o,d=l[0]+c,f=l[1]+c,p=l[2]+c,d=Xq(255*d),f=Xq(255*f),p=Xq(255*p),m=1}else if(u=/^hsla\(\s*(\d+(\.\d+)?)\s*,\s*(\d+(\.\d+)?%?)\s*,\s*(\d+(\.\d+)?%?)\s*,(\d(\.\d+)?)\)$/i.exec(h)){switch(e=parseFloat(u[1]),t=parseFloat(u[3]),i=parseFloat(u[5]),m=parseFloat(u[7]),e%=360,t/=100,i/=100,e=e<0?0:e>360?360:e,t=t<0?0:t>1?1:t,i=i<0?0:i>1?1:i,o=i<=.5?2*i*t:(2-2*i)*t,s=e/60,a=o*(1-Math.abs(s%2-1)),l=[],s=Math.floor(s),s){case 0:l=[o,a,0];break;case 1:l=[a,o,0];break;case 2:l=[0,o,a];break;case 3:l=[0,a,o];break;case 4:l=[a,0,o];break;case 5:l=[o,0,a];break;default:l=[0,0,0]}c=i-.5*o,d=l[0]+c,f=l[1]+c,p=l[2]+c,d=Xq(255*d),f=Xq(255*f),p=Xq(255*p)}else if(u=/^hsv\(\s*(\d+(\.\d+)?)\s*,\s*(\d+(\.\d+)?%?)\s*,\s*(\d+(\.\d+)?%?)\s*\)$/i.exec(h)){switch(e=parseFloat(u[1]),t=parseFloat(u[3]),r=parseFloat(u[5]),e%=360,t/=100,r/=100,e=e<0?0:e>360?360:e,t=t<0?0:t>1?1:t,r=r<0?0:r>1?1:r,o=r*t,s=e/60,a=o*(1-Math.abs(s%2-1)),l=[],s=Math.floor(s),s){case 0:l=[o,a,0];break;case 1:l=[a,o,0];break;case 2:l=[0,o,a];break;case 3:l=[0,a,o];break;case 4:l=[a,0,o];break;case 5:l=[o,0,a];break;default:l=[0,0,0]}c=r-o,d=l[0]+c,f=l[1]+c,p=l[2]+c,d=Xq(255*d),f=Xq(255*f),p=Xq(255*p),m=1}else jq[h.toLowerCase()]?(n=h.toLowerCase(),d=jq[n].r,f=jq[n].g,p=jq[n].b,m="number"==typeof jq[n].a?jq[n].a:1):this._invalid=!0;else"number"==typeof arguments[0]&&arguments[0]>=0&&"argb"===arguments[1]?(m=(4278190080&arguments[0])>>>24,m/=255,d=(16711680&arguments[0])>>16,f=(65280&arguments[0])>>8,p=255&arguments[0]):"number"==typeof arguments[0]&&arguments[0]>=0?(d=(16711680&arguments[0])>>16,f=(65280&arguments[0])>>8,p=255&arguments[0]):this._invalid=!0;else arguments.length>=3?(d=arguments[0],f=arguments[1],p=arguments[2],m=arguments.length>=4?arguments[3]:1):this._invalid=!0;Number.isNaN(+d+f+p+m)&&(this._invalid=!0),this._r=Yq(d),this._g=Yq(f),this._b=Yq(p),this._a=m,this._spaces={}},isInvalid(){return this._invalid},setAlpha(e){this._a=e,this._spaces={}},getAlpha(){return this._a},toRGB:function(){return this._spaces.rgb||(this._spaces.rgb=Kq.toRGB(this)),this._spaces.rgb},toRGBA:function(){return this._spaces.rgba||(this._spaces.rgba=Kq.toRGBA(this)),this._spaces.rgba},toString(){return this._spaces.rgb||(this._spaces.rgb=Kq.toRGB(this)),this._spaces.rgb},toHex:function(){return this._spaces.hex||(this._spaces.hex=Kq.toHex(this)),this._spaces.hex},toHSL:function(e){return this._spaces.hsl||(this._spaces.hsl=Kq.toHSL(this,e)),this._spaces.hsl},toHSLA:function(e){return this._spaces.hsla||(this._spaces.hsla=Kq.toHSLA(this,e)),this._spaces.hsla},toHSV(){const e=this.toHSVComponents();return`hsv(${e.h},${e.s},${e.v})`},toHSVComponents:function(){return this._spaces.hsvComp||(this._spaces.hsvComp=Kq.toHSVComponents(this)),this._spaces.hsvComp},toNumber:function(){return this._spaces.num||(this._spaces.num=Kq.toNumber(this)),this._spaces.num},isDark(){return this.isInvalid()||this.getLuminance()<125},getLuminance(){return void 0===this._lumi&&(this._lumi=.299*this._r+.587*this._g+.114*this._b),this._lumi},shiftLuminance(e){const t=this.toHSLA(),n=/^hsla\(\s*(\d+(\.\d+)?)\s*,\s*(\d+(\.\d+)?%?)\s*,\s*(\d+(\.\d+)?%?)\s*,(\d(\.\d+)?)\)$/i.exec(t),i=parseFloat(n[1]),r=parseFloat(n[3]);let o=parseFloat(n[5]);const s=parseFloat(n[7]);return o+=e,o=Math.max(0,Math.min(o,100)),`hsla(${i},${r},${o},${s})`},isEqual(e){return e instanceof Kq||(e=new Kq(e)),this._r===e._r&&this._g===e._g&&this._b===e._b},blend(e,t){return`rgba(${[Yq(this._r+(e._r-this._r)*t),Yq(this._g+(e._g-this._g)*t),Yq(this._b+(e._b-this._b)*t),Yq(this._a+(e._a-this._a)*t)].join(",")})`},createShiftedColor(e){(void 0===e||Number.isNaN(+e))&&(e=1);const t=this.getLuminance(),n=this._g<126?1:1+this._g/512,i=this.shiftLuminance(20*(t*n<220?.8+1/(t+1)*4:-(.8+t/255*1))*e);return new Kq(i)}});Kq.toRGB=function(e){if(e instanceof Kq)return`rgb(${[e._r,e._g,e._b].join(",")})`;"string"==typeof e&&(e=Kq.toNumber(e));return`rgb(${(16711680&e)>>16},${(65280&e)>>8},${255&e})`},Kq.toRGBA=function(e,t){if(e instanceof Kq)return`rgba(${[e._r,e._g,e._b,void 0!==t?t:e._a].join(",")})`;"string"==typeof e&&(e=Kq.toNumber(e));return`rgba(${(16711680&e)>>16},${(65280&e)>>8},${255&e},${void 0!==t?t:e._a})`},Kq.toHex=function(e){let t,n,i;return e instanceof Kq?(t=e._r.toString(16),n=e._g.toString(16),i=e._b.toString(16),1===t.length&&(t=`0${t}`),1===n.length&&(n=`0${n}`),1===i.length&&(i=`0${i}`),`#${[t,n,i].join("")}`):("string"==typeof e&&(e=Kq.toNumber(e)),t=((16711680&e)>>16).toString(16),n=((65280&e)>>8).toString(16),i=(255&e).toString(16),1===t.length&&(t=`0${t}`),1===n.length&&(n=`0${n}`),1===i.length&&(i=`0${i}`),`#${t}${n}${i}`)},Kq.toHSL=function(e,t){let n,i,r,o=0;"string"==typeof e&&(e=new Kq(e));const s=e._r/255,a=e._g/255,l=e._b/255,c=Math.max(s,a,l),u=Math.min(s,a,l);if(i=t?.21*s+.72*a+.07*l:(c+u)/2,c===u)n=0,o=0;else{switch(r=c-u,n=i>.5?r/(2-c-u):r/(c+u),c){case s:o=(a-l)/r+(a<l?6:0);break;case a:o=(l-s)/r+2;break;case l:o=(s-a)/r+4}o/=6}return`hsl(${360*o},${100*n},${100*i})`},Kq.toHSLA=function(e,t){let n,i,r,o=0;"string"==typeof e&&(e=new Kq(e));const s=e._r/255,a=e._g/255,l=e._b/255,c=e._a,u=Math.max(s,a,l),h=Math.min(s,a,l);if(i=t?.21*s+.72*a+.07*l:(u+h)/2,u===h)n=0,o=0;else{switch(r=u-h,n=i>.5?r/(2-u-h):r/(u+h),u){case s:o=(a-l)/r+(a<l?6:0);break;case a:o=(l-s)/r+2;break;case l:o=(s-a)/r+4}o/=6}return`hsla(${360*o},${100*n},${100*i},${c})`},Kq.toHSVComponents=function(e){let t,n,i=0;"string"==typeof e&&(e=new Kq(e));const r=e._r/255,o=e._g/255,s=e._b/255,a=Math.max(r,o,s),l=Math.min(r,o,s),c=a;if(a===l)t=0,i=0;else{switch(n=a-l,t=0===n?0:n/c,a){case r:i=(o-s)/n+(o<s?6:0);break;case o:i=(s-r)/n+2;break;case s:i=(r-o)/n+4}i/=6}return{h:360*i%360,s:100*t,v:100*c}},Kq.toNumber=function(){if(1===arguments.length&&arguments[0]instanceof Kq)return(arguments[0]._r<<16)+(arguments[0]._g<<8)+arguments[0]._b;let e,t,n=0,i=0,r=0;return 1===arguments.length&&"string"==typeof arguments[0]&&(t=arguments[0],(e=/^rgb\((\d{1,3}),(\d{1,3}),(\d{1,3})\)$/i.exec(t))?(n=parseInt(e[1],10),i=parseInt(e[2],10),r=parseInt(e[3],10)):(e=/^#([A-f0-9]{2})([A-f0-9]{2})([A-f0-9]{2})$/i.exec(t))?(n=parseInt(e[1],16),i=parseInt(e[2],16),r=parseInt(e[3],16)):(e=/^#([A-f0-9])([A-f0-9])([A-f0-9])$/i.exec(t))&&(n=parseInt(e[1]+e[1],16),i=parseInt(e[2]+e[2],16),r=parseInt(e[3]+e[3],16))),(n<<16)+(i<<8)+r},Kq.blend=function(e,t,n){const i=(16711680&(e=Kq.toNumber(e)))>>16,r=(65280&e)>>8,o=255&e;return(i+(((16711680&(t=Kq.toNumber(t)))>>16)-i)*n<<16)+(r+(((65280&t)>>8)-r)*n<<8)+(o+((255&t)-o)*n)},Kq.getBlend=function(e,t,n){const i=e._r+(t._r-e._r)*n,r=e._g+(t._g-e._g)*n,o=e._b+(t._b-e._b)*n,s=e._a+(t._a-e._a)*n;return new Kq(i,r,o,s)},Kq.isCSSColor=function(e){return!(arguments.length>1||"string"!=typeof e)&&(Hq.test(e)||Bq.test(e)||Vq.test(e)||$q.test(e)||Wq.test(e)||Uq.test(e)||jq[e.toLowerCase()])},Kq.getBestContrast=function(e,t,n){const i=e.getLuminance();return Math.abs(i-t.getLuminance())>Math.abs(i-n.getLuminance())?t:n},Kq.getContrast=function(e,t){if(!e||!t)return;const n=e.getLuminance()/100,i=t.getLuminance()/100;return n>i?(n+.05)/(i+.05):(i+.05)/(n+.05)},Kq.isDark=function(){const e={getLuminance:Kq.prototype.getLuminance,isInvalid:Kq.prototype.isInvalid};return Kq.prototype.init.apply(e,[].slice.call(arguments)),Kq.prototype.isDark.call(e)},Kq.useDarkLabel=function(e,t){return e._a>.5?!e.isDark():!t};const Gq={TRANSPARENT_BLACK:"rgba( 0,0,0,0.2 )",TRANSPARENT_WHITE:"rgba( 255,255,255,0.7 )",LIGHT_GREY:"#ccc",DARK_GREY:"#666",BLACK:"#000",WHITE:"#fff",getInverse(e){const t=new Kq(e);return 0===t.getAlpha()?this.BLACK:t.isDark()?this.WHITE:this.BLACK},getContrastingGrey(e){const t=new Kq(e);return 0===t.getAlpha()?this.DARK_GREY:Kq.getBestContrast(t,new Kq(Gq.LIGHT_GREY),new Kq(Gq.DARK_GREY))},getBestContrast:(e,t,n)=>Kq.getBestContrast(new Kq(e),new Kq(t),new Kq(n)),getContrastingTransparent(e){const t=new Kq(e);return 0===t.getAlpha()||"none"===e?this.TRANSPARENT_BLACK:t.isDark()?this.TRANSPARENT_WHITE:this.TRANSPARENT_BLACK}};function Jq(e,t){return Ev(e,`${t=t?`${t}.`:""}qHyperCube.qDimensionInfo.length`)>1}function Zq(e,t){if(Ev(e,`${t=t?`${t}.`:""}qHyperCube.qStackedDataPages.0.qData.length`))return Ev(e,`${t}qHyperCube.qStackedDataPages.0.qData.0.qSubNodes.length`,0)+Ev(e,`${t}qHyperCube.qStackedDataPages.0.qData.0.qDown`,0)+Ev(e,`${t}qHyperCube.qStackedDataPages.0.qData.0.qUp`,0);const n=Ev(e,`${t}qHyperCube.qEffectiveInterColumnSortOrder.0`);return Qq(Ev(e,`${t}qHyperCube.qDimensionInfo.${n}`))}function Qq(e){return e.qCardinalities.qHypercubeCardinal}var eS={getHyperCube:function(e,t){return e&&(e=t?Ev(e,t):e)&&e.qHyperCube?e.qHyperCube:null},hasSecondDimension:Jq,hasSecondMeasure:function(e,t){return Ev(e,`${t=t?`${t}.`:""}qHyperCube.qMeasureInfo.length`)>1},getStackedCubeSizeOf2Dims:Zq,getStackedCubeSizeOfMax2Dims:function(e,t){return Jq(e,t)?Zq(e,t):function(e,t){return Ev(e,(t=t?`${t}.`:"")+"qHyperCube.qSize.qcy")}(e,t)},getOuterDimensionSizeOfMax2Dims:function(e,t){return Jq(e,t)?Zq(e,t):1},getDimensionSize:Qq};const tS=function(){this._maxJitter=1};tS.prototype.calcMaxJitter=function(e,t,n){this._maxJitter=Math.min(e*t,n-e)},tS.prototype.getJitterValue=function(e){const t=Math.abs(Aw(`${e}`)%10)/9;return this._maxJitter/2-t*this._maxJitter};var nS={toBefore:function(e){const t=e.qUndoExclude.qHyperCube;2===t.qEffectiveInterColumnSortOrder.length&&0===t.qEffectiveInterColumnSortOrder[0]&&(t.qEffectiveInterColumnSortOrder=[1,0],t.qDimensionInfo.reverse())},toAfter:function(e){const t=e.qUndoExclude.qHyperCube;2===t.qEffectiveInterColumnSortOrder.length&&1===t.qEffectiveInterColumnSortOrder[0]&&(t.qEffectiveInterColumnSortOrder=[0,1],t.qDimensionInfo.reverse())}};var iS={generateHyperCube:function(e,t,n,i){t.qUndoExclude||(t.qUndoExclude={}),t.qUndoExclude.qHyperCubeDef=Tb(!0,{},t.qHyperCubeDef),t.qUndoExclude.qHyperCubeDef.qDimensions.reverse(),ux.updateHypercubeAttributes(t,"qUndoExclude.qHyperCubeDef.",t.color.point);let r=[];const o=t.qUndoExclude.qHyperCubeDef.qDimensions.length,s=t.color.point&&!t.color.point.auto&&"byExpression"===t.color.point.mode;if(o>0&&s){r=[ox.create(ox.IDMAP.COLOR_BY_EXPRESSION,{qExpression:Ev(t,"color.point.expression.qValueExpression.qExpr")})]}return t.qUndoExclude.qHyperCubeDef.qMeasures[0].qAttributeExpressions=r,ix.hasMultipleDimensions(t)?Lb.getAllHyperCubeExpressions(t.qHyperCubeDef,e.qHyperCube,n).then((r=>{Px.applySorting(t,e,n,r,i);const o=r.dimensions[0],s=r.dimensions[1],a=r.measures[0],l=Rx.getFractileExpression(1,o,s,a),c=Rx.getFractileExpression(0,o,s,a);t.qUndoExclude.qHyperCubeDef.qDimensions[0].qAttributeExpressions=[{qExpression:c,id:"minBoxValue"},{qExpression:l,id:"maxBoxValue"}]})):(t.qUndoExclude.qHyperCubeDef.qInterColumnSortOrder=[1,0],Promise.resolve())}};const rS=e=>e.baseColor||e.coloring&&e.coloring.baseColor;function oS(e){const{qDimensionInfo:t,qMeasureInfo:n}=e.qUndoExclude.qHyperCube,i=t.some(rS),r=n.some(rS),o=e.color.point.useBaseColors;return"measure"===o&&!r||"dimension"===o&&!i?"off":o}function sS({layout:e,localeInfo:t,model:n,picasso:i,environment:r}){const{app:o,theme:s,translator:a}=r,l=Tb(!0,{},e.color.point);var c;return 2===e.qHyperCube.qDimensionInfo.length&&(0===(null==(c=l.byDimDef)?void 0:c.activeDimensionIndex)?c.activeDimensionIndex=1:1===(null==c?void 0:c.activeDimensionIndex)&&(c.activeDimensionIndex=0)),function(e){var t,n,i;return!(!e.snapshotData||null!==(t=e.snapshotData.content)&&void 0!==t&&null!==(n=t.chartData)&&void 0!==n&&n.legendDataPage||null===(i=e.qUndoExclude)||void 0===i||!i.legendData)}(e)&&(e=function(e){return(e=Tb({},e)).snapshotData=Tb({},e.snapshotData),e.snapshotData.content=Tb({},e.snapshotData.content),e.snapshotData.content.chartData=Tb({},e.snapshotData.content.chartData),e.snapshotData.content.chartData.legendDataPage=e.qUndoExclude.legendData.qDataPages,e}(e)),l.mode||(l.mode="primary"),function(e){var t,n,i,r,o=e.picasso,s=e.model,a=e.app,l=e.translator,c=e.layoutService,u=void 0===c?void 0:c,h=e.createConfig,d=void 0===h?kv:h,f=e.config,p=void 0===f?{}:f,m=e.custom,g=void 0===m?{}:m,y=p.localeInfo,v=p.key,b=p.theme,x=void 0===b?void 0:b,w=p.auto,q=void 0===w?void 0:w,S=p.definitionPath,M=null==u||null===(t=u.getLayout)||void 0===t?void 0:t.call(u),D={theme:x,key:v,localeInfo:y,layout:M,hc:null==u||null===(n=u.getHyperCube)||void 0===n?void 0:n.call(u),legendProps:null==u||null===(i=u.getLayoutValue)||void 0===i?void 0:i.call(u,"legend"),colorProps:Ng(Ng({},null==u||null===(r=u.getLayoutValue)||void 0===r?void 0:r.call(u,"color")),{},{useBaseColors:M?Mv(M):void 0})},_=qv({picasso:o,model:s,app:a,translator:l,auto:q});!1!==q&&_.auto((function(e){return q?q({layout:e,defaultAuto:Cv}):Cv(e)}));var C=!1,k={getColor:function(){return _.color()},getPaletteColor:function(e){var t=e.index,n=e.color;return _.resolveUIColor({index:t,color:n})},getData:function(){return _.data()},getDatumProps:function(e){return _.datumProps(e)},getSnapshotData:function(){return _.getSnapshotData(S)},getSettingsForMeasure:function(e){return _.settingsForMeasure(e)},getSettings:function(){return _.settings()},getLegend:function(e,t){return _.legend(e,t)},getScales:function(){return _.scales()},getPalettes:function(){return _.palettes()},isSelectionLocked:function(e){var t=e.isMeasureSelectionLocked;return _.isSelectionLocked({isMeasureSelectionLocked:t})},isInitialized:function(){return C},custom:Ng({},g),initialize:function(){var e=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}).createConfig,t=(void 0===e?d:e)({getUseBaseColors:Mv}),n=Dv(D,t);return _.config(n),_.getAuxiliarySettings(S).then((function(){C=!0}))}};return k}({app:o,model:n,picasso:i,translator:a,config:{localeInfo:t,theme:s,key:"color",definitionPath:"/qUndoExclude/qHyperCubeDef"},createConfig:()=>({layout:e,hc:e.qUndoExclude.qHyperCube,legendProps:e.legend,colorProps:{...l,useBaseColors:oS(e)}})})}const aS=tx.DATA_PATH,lS=tx.HYPERCUBE_PATH,cS=tx.HYPERCUBE_DEF_PATH;function uS(e){return Array.isArray(e)?e:e?[e]:[]}function hS(e){return Math.min(eS.getOuterDimensionSizeOfMax2Dims(e,aS),tx.MAX_STACKED_VALUES)}function dS(e,t){return{viewSize:t,max:hS(e)}}function fS(){const e=tx.MAX_STACKED_VALUES>=this.layout.qUndoExclude.qHyperCube.qSize.qcy?3:1;this.backendApi.setCacheOptions({height:e*this._scrollHandler.getScrollViewSizeInItem(),width:3})}function pS(){if(this.layout&&eS.hasSecondDimension(this.layout,aS)){this._scrollHandler.onResize();!!this.layout.snapshotData||fS.call(this)}}function mS(){const e=this.chartInstance.component("legend");e&&e.emit&&e.emit("resetindex")}function gS(e,t){return Ev(e,`qHyperCube.qDimensionInfo.${t}.qIsOneAndOnlyOne`)||!1}const yS=Ew.extend("DistributionPlot",{namespace:".distributionPlot",init({lasso:e,environment:t,flags:n,picasso:i,$element:r,backendApi:o,selectionsApi:s}){this._super(i,r,t,o,s),this.flags=n,this.picasso=i,this.picassoElement.__do_not_use_findShapes=this.chartInstance.findShapes.bind(this.chartInstance),this._derivedProperties=new Xw,this._selectionHandler=nq.create({model:o.model,chartInstance:this.chartInstance,selectionsApi:s,isLassoDisabled:this.isLassoDisabled.bind(this),selectPaths:["/qUndoExclude/qHyperCubeDef"],lasso:e}),this._tooltipHandler=Dq.create(this.chartInstance,r,tx.CHART_ID),this._scrollHandler=new Cq(this.chartInstance,r,this.getSlicedData.bind(this),this.onScrollCallback.bind(this),"colorLegend-cat"),this._maxBubbleScale=tx.BUBBLE_SCALES_MAX,this._jitterTool=new tS,this.setDataPaths([`${aS}/${lS}`])},onScrollCallback(e,t,n){const i=this;this._updateColorMapData(e).then((()=>{i.updateChart(e,t,n)}))},getSlicedData(e,t){const n=this;return this.getData(this.backendApi,this.layout[aS][lS],{top:e,height:t}).then((()=>n.layout))},updateScrollHandlerState(e){void 0!==e&&(this._disableScrolling=!!e),this._scrollHandler.setDisabled(!eS.hasSecondDimension(this.layout,aS)||this._disableScrolling)},updateConstraints(e){const t=!e.active,n=!e.passive,i=!e.select&&!e.active;this._scrollHandler[t?"on":"off"](),this._tooltipHandler[n?"on":"off"](),this._selectionHandler[i?"on":"off"]()},off(){this._scrollHandler.off(),this._tooltipHandler.off(),this._selectionHandler.off()},_getPointScale(){return function(e){return e.dataPoint&&e.dataPoint.bubbleScales}(this.layout)?this.layout.dataPoint.bubbleScales/this._maxBubbleScale:1},_calcBandwidth(e,t){const n=t.scales().dimension;this._bandwidthRatio=n?n.pxScale(e).bandwidth():1,this._bandwidthPx=e*this._bandwidthRatio},_calcPointMaxSize(e,t){const n=Math.min(tx.MAX_POINT_BASE_SIZE_PX,t*tx.POINT_BANDWIDTH_BASE_RATIO)*e;this._pointMaxSizePx=Math.max(tx.MIN_POINT_PIXELS,n)},_calcPointSize(e,t){this._pointSize=e/t},_getDimAxisSettings(e,t){const n=uS(t.trigger),i=uS(t.consume),r=this.picassoElement.getBoundingClientRect()["vertical"===e.orientation?"height":"width"],o=zq.getAdjustedMaxGlyphCount(function(e){const t=e[aS][lS].qDimensionInfo,n=eS.hasSecondDimension(e,aS)?t[0].qApprMaxGlyphCount:0;return Math.min(tx.MAX_GLYPH_COUNT,n)}(this.layout||e),e[aS][lS].qStackedDataPages[0].qData[0].qSubNodes),s=r/4;return{brush:{trigger:n,consume:i},settings:{labels:{mode:"vertical"===e.orientation?e.dimensionAxis.label:"auto",maxGlyphCount:o,maxLengthPx:s},paddingEnd:4}}},_getBoxMarkerSettings(e,t){const{theme:n}=this.environment,i=e.color.point.auto?n.getStyle(tx.CHART_ID,"box","fill"):n.getColorPickerColor(e.color.box.paletteColor),r=uS(t.trigger),o=uS(t.consume),s=this;let a="qMeasureInfo/0",l="qMeasureInfo/0";eS.hasSecondDimension(e,aS)&&e.qUndoExclude.qHyperCube.qDimensionInfo[0].qAttrExprInfo.length&&(a="qDimensionInfo/0/qAttrExprInfo/0",l="qDimensionInfo/0/qAttrExprInfo/1");const c={require:["chart"],displayOrder:1e3,settings:{chart:this,box:{fill:i,stroke:n.getStyle(tx.CHART_ID,"box","stroke"),strokeWidth:0,width:tx.POINT_BANDWIDTH_BASE_RATIO,maxWidthPx:tx.MAX_POINT_BASE_SIZE_PX,minWidthPx:tx.MIN_POINT_PIXELS+2*tx.BOX_PADDING},minor:{scale:"measure"},orientation:e.orientation},beforeRender(){const e=s.layout.presentation&&s.layout.presentation.visibleComponents&&-1!==s.layout.presentation.visibleComponents.indexOf("point"),t="horizontal"===s.layout.orientation?this.rect.height:this.rect.width;s._calcBandwidth(t,this.chart),s._calcPointMaxSize(e?s._getPointScale():1,s._bandwidthPx);let n=0;s._jitter&&(s._calcPointSize(s._pointMaxSizePx,s._bandwidthPx),n=s._pointSize*s._bandwidthPx*tx.JITTER_PARAMETER);const i=s._pointMaxSizePx+n+2*tx.BOX_PADDING,r=i/s._bandwidthPx;this.settings.settings.box.maxWidthPx=Math.min(s._bandwidthPx-2,i),this.settings.settings.box.width=r},brush:{trigger:r,consume:o},data:{extract:{field:"qDimensionInfo/0",trackBy:()=>-1,props:{start:{field:a,reduce:"min"},end:{field:l,reduce:"max"},elemNo:{field:"qDimensionInfo/0"}}}}};return eS.hasSecondDimension(e,aS)&&(c.data.extract.field="qDimensionInfo/0",c.data.extract.trackBy=function(e){return e.qElemNo},c.settings.major={scale:"dimension"}),c},_getPointMarkerSettings(e,t,n){let i=1;e.dataPoint&&!1===e.dataPoint.border&&(i=0);const r=uS(t.trigger),o=uS(t.consume);this._tooltipHandler.isOn()&&(r.push(n.point.trigger),o.push.apply(o,n.point.consume));const s=this,a=this.colorService.getColor(),l={require:["chart"],displayOrder:1100,settings:{chart:this,fill:a,stroke:e=>{const t=a(e);return Gq.getContrastingTransparent(t)},size:.3,strokeWidth:i,sizeLimits:{maxRelExtent:10,maxPx:tx.MAX_POINT_BASE_SIZE_PX,minPx:tx.MIN_POINT_PIXELS},orientation:e.orientation},beforeRender(){const e="horizontal"===s.layout.orientation?this.rect.height:this.rect.width;if(s._calcBandwidth(e,this.chart),s._calcPointMaxSize(s._getPointScale(),s._bandwidthPx),s._calcPointSize(s._pointMaxSizePx,s._bandwidthPx),s._jitter){const t=2*tx.BOX_PADDING/e;s._jitterTool.calcMaxJitter(s._pointSize*s._bandwidthRatio,tx.JITTER_PARAMETER,s._bandwidthRatio-t)}this.settings.settings.sizeLimits.maxPx=s._pointMaxSizePx,this.settings.settings.size=s._pointSize},brush:{trigger:r,consume:o},data:{extract:{field:"qDimensionInfo/0",props:{innerElemNo:{field:"qDimensionInfo/0"},elemNo:{field:"qDimensionInfo/0"},inner:{field:"qDimensionInfo/0",value:e=>e},row:{field:"qDimensionInfo/0",value:e=>e.qRow},measure:{field:"qMeasureInfo/0",reduce:"first",value:e=>e,reduceLabel:"none"},...this.colorService.getDatumProps()}}}};return eS.hasSecondDimension(e,aS)&&(l.data.extract.props.inner.field="qDimensionInfo/1",l.data.extract.props.innerElemNo.field="qDimensionInfo/1",l.data.extract.props.row.field="qDimensionInfo/1",l.data.extract.field="qDimensionInfo/1",l.data.extract.props.outer={field:"qDimensionInfo/0",value:e=>e}),this.setDataPaths([`${aS}/${lS}`]),l},_getPointSelectionLayerSettings(e){const t=Tb(!0,{},e,{key:"selection-point-marker",settings:{opacity:0}});return t.brush.consume.pop(),t.brush.consume.forEach((e=>{e.style.inactive=void 0,e.style.active.opacity=1})),t.brush.trigger=[],t},createChartSettings(e){const t=this.isRtl(),{theme:n}=this.environment,i=!!e.snapshotData,r=e.presentation&&e.presentation.visibleComponents,o=r&&-1!==e.presentation.visibleComponents.indexOf("point"),s=r&&-1!==e.presentation.visibleComponents.indexOf("box");this._jitter=o&&e.dataPoint&&"jitter"===e.dataPoint.displacement;const a=e[aS][lS],l=a.qDimensionInfo,c="horizontal"!==e.orientation?"y":"x",u="horizontal"!==e.orientation?"x":"y",h=qw.create({chartID:tx.CHART_ID,theme:n,isRtl:t});if(0===a.qStackedDataPages[0].qData.length)return h.getSettings();let d={},f={},p={},m={};if(this._selectionHandler.isOn()){const t=!o&&eS.hasSecondDimension(e,aS);this._selectionHandler.setUpStart();const n=this._selectionHandler.setUpBrush({contexts:["select-inner"],data:["innerElemNo"],isSingleSelect:gS(e,0)},!0),i=this._selectionHandler.setUpBrush({contexts:["select-outer"],data:["elemNo"],isSingleSelect:gS(e,1)},!0),r=this._selectionHandler.setUpBrush({dataPath:aS,contexts:["select-color"],data:["color"],startOnEmptySelection:!1},!0),s=this._selectionHandler.setUpBrush({contexts:["select-measure"],data:[c]},!0);this._selectionHandler.setUpDone(),d={trigger:Tb(!0,{},i.trigger,{data:[""]}),consume:[Tb(!0,{},i.consume,{data:[""]})]},f={trigger:t?i.trigger:null,consume:[n.consume,i.consume,s.consume]},p={trigger:n.trigger,consume:[n.consume,i.consume,s.consume,r.consume]},m={trigger:[Tb(!0,{},r.trigger,{data:[""]})],consume:[Tb(!0,{},r.consume,{data:[""]}),n.consume,i.consume]}}const g={point:{},box:{}};this._tooltipHandler.isOn()&&(g.point=this._tooltipHandler.setUp({chartBuilder:h,colorService:this.colorService,data:eS.hasSecondDimension(e,aS)?["innerElemNo","elemNo"]:["innerElemNo"],contexts:["pointTip"],componentKey:"point-marker",environment:this.environment,attrDimPath:`/${lS}/qDimensionInfo/${eS.hasSecondDimension(e,aS)?1:0}/qAttrDimInfo/0`,measureRows:["measure"],labelData:eS.hasSecondDimension(e,aS)?["inner","outer"]:["inner"]}));const y=function(e){const t=[],n=e.qUndoExclude&&e.qUndoExclude.qHyperCube&&e.qUndoExclude.qHyperCube.qDimensionInfo?e.qUndoExclude.qHyperCube.qDimensionInfo:void 0;if(!n)return!1;for(let e=0;e<n.length;e++)n[e].qLocked?t.push(n[e].qLocked):t.push(!1);return t}(e),v=function(e,t,n){const i={};return 1===e.length?(i.isOpenDim=!1,e[0]?i.isOpenMea=!1:i.isOpenMea=!0):e[0]&&!e[1]?(i.isOpenDim=!1,i.isOpenMea=!0):!e[0]&&e[1]?(i.isOpenDim=!0,i.isOpenMea=!1):e[0]&&e[1]?(i.isOpenDim=!1,i.isOpenMea=!1):(i.isOpenDim=!0,i.isOpenMea=!0),t&&(i.isOpenMea=!1),n&&(i.isOpenDim=!1),i}(y,gS(e,0),gS(e,1)),b={scrollHandler:this._scrollHandler,selectionHandler:this._selectionHandler},x={componentKey:o?"point-marker":"box-marker",lassoBrushKey:"select-inner",dimRangeBrushKey:"select-outer",measureRangeBrushKey:"select-measure",areaBrushKey:null,legendBrushKey:"legend"};if(this._dependentActions&&this._dependentActions.destroy(),this._dependentActions=hq.create(b,e.orientation,t,x,v),h.addPreset("dimension-measure-chart",{isRtl:t,includeDimensionAxis:eS.hasSecondDimension(e,aS),orientation:e.orientation,selectionsEnabled:this._selectionHandler.isOn(),theme:n,measureSource:["qMeasureInfo/0"],dimensionSource:"qDimensionInfo/0",measureAxisProperties:e.measureAxis,measureTitleText:a.qMeasureInfo[0].qFallbackTitle,dimensionAxisProperties:e.dimensionAxis,dimensionAxisSettings:this._getDimAxisSettings(e,d),dimensionTitleText:l&&l[0]&&l[0].qFallbackTitle||"",gridlines:e.gridlines,hasNavigation:!i,isNavigationEnabledFn:()=>this._scrollHandler.isOn(),scrollSettings:dS(e,this._scrollHandler.getScrollViewSizeInItem()),enableLasso:!0,lasso:{brushKey:o?"select-inner":"select-outer",brushComponents:o?["point-marker"]:["box-marker"],brushData:o?["innerElemNo"]:["elemNo"]},enableDimRange:!0,dimRange:{brushKey:"select-outer",brushAxis:"horizontal"===e.orientation?"y-axis":"x-axis",brushArea:s?"box-marker":"point-marker",brushScale:"dimension"},enableMeasureRange:o,measureRange:{brushKey:"select-measure",brushAxis:"horizontal"===e.orientation?"x-axis":"y-axis",brushArea:o?"point-marker":"box-marker",brushScale:"measure",multiple:!0},brushActions:this._dependentActions.gestures,refLines:e.refLine&&e.refLine.refLines,axisTitleStyle:Jb(tx.CHART_ID,n,e,this.flags),axisLabelStyle:Zb(tx.CHART_ID,n,e,this.flags)}),s){const t=this._getBoxMarkerSettings(e,f);h.addComponent("box-marker",t)}if(o){const i=this._getPointMarkerSettings(e,p,g);if(i.data.extract.props[c]={field:"qMeasureInfo/0"},i.settings[c]={scale:"measure"},eS.hasSecondDimension(e,aS)&&(i.data.extract.props[u]={field:"qDimensionInfo/0",type:"qual"},i.settings[u]={scale:"dimension"}),this._jitter){i.settings[u]=i.settings[u]||{};const e=this._jitterTool;i.settings[u].fn=function(t){let n;return n="function"==typeof t.scale?t.scale(t.datum[u].value)+.5*t.scale.bandwidth():.5,n+e.getJitterValue(t.datum.value,tx.JITTER_PARAMETER)}}h.addComponent("point-marker",i),h.addComponent("point-marker",this._getPointSelectionLayerSettings(i));if(e.legend?!1!==e.legend.show:!e.color.point.auto&&"byDimension"===e.color.point.mode){const i={title:Qb(tx.CHART_ID,n,e,this.flags),label:ex(tx.CHART_ID,n,e,this.flags)};this.addLegend(h,t,m,i)}}const w=h.getSettings();return this.addSnapshotChartSettings(w,e),w.scales={...w.scales,...this.colorService.getScales()},w.palettes=this.colorService.getPalettes(),w},addLegend(e,t,n,i){const r={eventName:"legend-c",key:"colorLegend",styleReference:"object.comboChart",styleOverrides:i,rtl:t,settings:{item:{shape:{type:"circle",size:10}}}},o=this.colorService.getLegend(r,{actions:{interact:{enabled:()=>this._scrollHandler.isOn()}}});let{components:s}=o;s=s.filter((e=>!!e)),s.length>0&&(this._selectionHandler.isOn()&&(s[0].brush={consume:n.consume.map((e=>Tb(!0,e,{style:{active:null}}))),trigger:n.trigger}),s[0].layout.displayOrder=200,s[0].layout.prioOrder=50),e.settings.components.push(...s),e.settings.interactions[0].gestures.unshift(...o.interactions)},resize(){this.layout&&(pS.call(this),this._super())},hasValidData(){const e=this.layout;return e[aS]&&e[aS][lS]&&e[aS][lS].qStackedDataPages.length&&e[aS][lS].qStackedDataPages[0].qData},paint(){const e=!!this.layout.snapshotData;e||this.environment.options.viewState||this.updateScrollHandlerState(!1),this._orientation||(this._orientation=this.layout.orientation),this._orientation!==this.layout.orientation&&(pS.call(this),this._orientation=this.layout.orientation);const t=this.layout;if(!this.hasValidData())return Promise.resolve();const n=this,i=this._super;return!e&&eS.hasSecondDimension(t,aS)&&this._scrollHandler.isDataSizeChanged(Ev(t,`${aS}.${lS}.qStackedDataPages.0.qData.0.qSubNodes.length`),eS.getOuterDimensionSizeOfMax2Dims(t,aS))?this._scrollHandler.getViewData().finally((()=>n._updateColorMapData(t).then((()=>i.call(n))))):this._updateColorMapData(t).then((()=>i.call(n)))},async setSnapshotData(e){this._super(e);const t=await this.colorService.getSnapshotData();return e.snapshotData.content.chartData={...e.snapshotData.content.chartData,...t},e[aS][lS].qStackedDataPages=this.layout[aS][lS].qStackedDataPages,nS.toBefore(e),e},getViewState(){return{scroll:Math.round(this._scrollHandler.getScrollState())}},getDisclaimerAttributes(e){const t=!this.flags.isEnabled("SHOW_DISCLAIMER")||!(!1===e.showDisclaimer),n=!eS.hasSecondDimension(e,aS)&&e.qHyperCube.qSize.qcy>1e4||eS.hasSecondDimension(e,aS)&&e.qHyperCube.qSize.qcy>3e3,i=t&&n,r=dS(e,this._scrollHandler.getScrollViewSizeInItem());return{data:e&&e.qUndoExclude,supportedDisclaimers:{LimitedData:t&&i},options:{paddingBottom:i&&r&&r.viewSize<r.max,supportNegative:!0,explicitLimitedData:i}}},async _updateColorMapData(e){this.colorService=sS({layout:e,localeInfo:this.localeInfo,model:this.backendApi.model,picasso:this.picasso,environment:this.environment}),await this.colorService.initialize();const t=this.colorService.getSettings().field,n=this.chartInstance.brush("select-color");/qAttrDimInfo/.test(t)&&n.addKeyAlias("attrDim/qDimensionInfo/0",`${aS}/${lS}/${t}`)},_createColorLegendCube(e){const t=eS.hasSecondDimension(this.layout,aS)?1:0;return{qDimensionInfo:[this.layout[aS][lS].qDimensionInfo[t].qAttrDimInfo[0]],qMeasureInfo:[],qDataPages:e,qMode:"S",qSize:{qcx:1,qcy:e[0].qMatrix.length}}},_updateColorData(){return this._updateColorMapData(this.layout)},updateDerivedProperties(e,t){const{app:n,translator:i}=this.environment,r=this,o=r.backendApi.model;return r._derivedProperties.addDefaultHyperCubeHash(e.qHyperCubeDef,t.qHyperCube,n,function(e){return{cube:e[cS],sorting:e.sorting,color:{point:e.color.point}}}(e)).then((s=>{const a={layout:t,properties:e,model:o,hashData:s,generateDerivedProperties:(e,t)=>iS.generateHyperCube(e,t,n,i)};return r._derivedProperties.updateDerivedProperties(a)}))},updateData(e){const t=this,n=!!e.snapshotData;return t._super(e).then((()=>{if(t._destroyed)return Promise.reject();if(e=t.layout,t._scrollHandler.setOptions({direction:"horizontal"===e.orientation?"vertical":"horizontal"}),n)return nS.toAfter(e),t._updateColorMapData(e);t.updateScrollHandlerState(!0);const{viewState:i}=t.environment.options;let r;return i?(t._scrollHandler.updateViewState(hS(e)),t._scrollHandler.setScrollState(i.scroll)):(t._scrollHandler.resetScroll(),mS.call(t)),t._scrollHandler.getScrollViewSizeInItem()&&!t._cacheSizeInitialized&&(fS.call(t),t._cacheSizeInitialized=!0),r=eS.hasSecondDimension(e,aS)?t.getSlicedData(t._scrollHandler.getScrollState(),t._scrollHandler.getScrollViewSizeInItem()):t.getData(t.backendApi,e[aS][lS],{height:e[aS][lS].qSize.qcy||1}),r.then((()=>t._destroyed?Promise.reject():t._updateColorData()))}))},isLassoDisabled(){const e=this.layout;return!!(e.qHyperCube.qDimensionInfo&&e.qHyperCube.qDimensionInfo.length>1&&gS(e,0))}}),vS={enabled:!0,delay:50};function bS(){const e={};return e.promise=new Promise(((t,n)=>{e.resolve=t,e.reject=n})),e}class xS{constructor({onSend:e}){this.options={},this.ongoingRequests=[],this.queuedRequests=[],this.recentRequests=[],this.resolvedRequests=[],this._debounceTimer=null,this._latestResolvedRequestedAt=-1,this.onSend=e,this.setOptions({})}destroy(){this.clear(),this.recentRequests=[],this.resolvedRequests=[],this.onSend=null,this.onCancel=null}setOptions(e){this.options=Tb(!0,{},vS,this.options,e),this.enabled=this.options.enabled||!1,this.delay=this.options.delay||-1}clear(){let e;for(clearTimeout(this._debounceTimer);this.queuedRequests.length;)e=this.queuedRequests.pop(),e.dfd.reject();for(;this.ongoingRequests.length;)e=this.ongoingRequests.pop(),e.dfd.reject()}queue(e){const t=this.enabled?this.delay:-1,n=Date.now(),i={data:e,dfd:bS(),wrapper:bS(),requestedAt:n},r=Math.max(this._getAvgResolutionTime(),t),o=t<1,s=this.recentRequests.length<1,a=s||n-this.recentRequests.slice(-1)[0].requestedAt>r,l=n>this._latestResolvedRequestedAt+t;return o||s||a||l?wS.apply(this,[i,0]):wS.apply(this,[i,Math.min(t,1e3)]),this.recentRequests.push(i),this.recentRequests.length>10&&(this.recentRequests=this.recentRequests.slice(-10)),i.dfd.promise}updateResolutionTime(){this._latestResolvedRequestedAt=Date.now()}_getAvgResolutionTime(){let e;return this.resolvedRequests.length&&(e=0,this.resolvedRequests.forEach((t=>{e+=t.respondedAt-t.sentAt})),e/=this.resolvedRequests.length),e}}function wS(e,t){const n=this;this.queuedRequests.push(e),clearTimeout(this._debounceTimer),t>=10?this._debounceTimer=setTimeout((()=>{qS.call(n)}),t):qS.call(n)}function qS(){if(this.ongoingRequests.length)return void(this.waitingForResponse=!0);let e=this.queuedRequests.pop();for(e&&SS.call(this,e);this.queuedRequests.length;)e=this.queuedRequests.shift(),e.dfd.reject()}function SS(e){this.waitingForResponse=!1,this.ongoingRequests.push(e);const t=this,n=e.wrapper;e.sentAt=Date.now(),n.promise.then((function(...n){t.ongoingRequests.splice(t.ongoingRequests.indexOf(e),1),e.respondedAt=Date.now(),t.resolvedRequests.push({sentAt:e.sentAt,respondedAt:e.respondedAt,requestedAt:e.requestedAt}),t.resolvedRequests.length>10&&(t.resolvedRequests=t.resolvedRequests.slice(-10)),e.requestedAt>t._latestResolvedRequestedAt?e.dfd.resolve(...n):e.dfd.reject(),t._latestResolvedRequestedAt=e.requestedAt}),(function(...n){t.ongoingRequests.splice(t.ongoingRequests.indexOf(e),1),e.respondedAt=Date.now(),e.dfd.reject(...n)})).finally((()=>{t.waitingForResponse&&qS.call(t)})),this.onSend(e.data,n)}const MS=new Jv(0,0,0,0),DS=new Jv(0,0,0,0);class _S{constructor(){this.pages=[]}get(e){return e.map((e=>this.getPage(e)))}getPage(e){const t=[];for(let n=0;n<this.pages.length;n++){const i=this.pages[n].qArea;MS.set(e.qLeft,e.qTop,e.qWidth,e.qHeight),DS.set(i.qLeft,i.qTop,i.qWidth,i.qHeight);const r=DS.intersection(MS,!0);if(t.push({coverage:r?r.clone():new Jv(0,0,0,0),idx:n}),i.qLeft<=e.qLeft&&i.qLeft+i.qWidth>=e.qLeft+e.qWidth&&i.qTop<=e.qTop&&i.qTop+i.qHeight>=e.qTop+e.qHeight)return this._extract(e,this.pages[n])}return t.sort(((e,t)=>t.coverage.width*t.coverage.height-e.coverage.width*e.coverage.height)),t[0].coverage.height>0&&t[0].coverage.width>0?this._extract(e,this.pages[t[0].idx]):{qArea:{qTop:e.qTop,qLeft:e.qLeft,qWidth:0,qHeight:0},qData:[]}}destroy(){this.clear()}isEmpty(){return!(this.pages&&this.pages[0]&&this.pages[0].qArea.qHeight&&this.pages[0].qArea.qWidth)}clear(){this.pages=[]}store(e){this.pages=e}containsArea(e){for(let t=0;t<this.pages.length;t++){const n=this.pages[t].qArea;if(n.qLeft<=e.qLeft&&n.qLeft+n.qWidth>=e.qLeft+e.qWidth&&n.qTop<=e.qTop&&n.qTop+n.qHeight>=e.qTop+e.qHeight)return!0}return!1}contains(e){return!(!this.pages||!this.pages.length)&&0===e.filter((e=>!this.containsArea(e))).length}_extract(e,t){MS.set(e.qLeft,e.qTop,e.qWidth,e.qHeight),DS.set(t.qArea.qLeft,t.qArea.qTop,t.qArea.qWidth,t.qArea.qHeight);const n=MS.intersection(DS,!0);if(!n)return{qArea:{qTop:e.qTop,qLeft:e.qLeft,qWidth:0,qHeight:0},qData:[]};const i=Math.max(0,e.qTop-t.qArea.qTop),r=t.qData[0],o=r.qSubNodes,s={};for(const e in r)r.hasOwnProperty(e)&&(s[e]="qSubNodes"===e?o.slice(i,i+n.height):r[e]);return s.qUp+=i,s.qDown+=t.qArea.qHeight-n.height-i,{qArea:{qTop:n.y,qLeft:n.x,qWidth:n.width,qHeight:n.height},qData:[s]}}}const CS={mode:"S",enabled:!0,debouncing:{enabled:!0,delay:50},height:250,width:250,maxTotalArea:1e4},kS=Gv.extend("CacheCube",{init(e,t,n,i){this.model=e,this.responseProperty=t,this.options={},this.cubeHeight=0,this.cubeWidth=0,this.setOptions(i||{}),this.setPath(n),"K"===this.options.mode?this.cube=new _S:"P"===this.options.mode?this.cube=new ab:this.cube=new eb,this.throttle=new xS({onSend:(e,t)=>{const n=this._getDirections(this.throttle.recentRequests.map((e=>({top:e.data[0].qTop,left:e.data[0].qLeft})))),i=this._getAreasToCache(e,n.vertical,n.horizontal);this.cacheData(i,e).then((e=>{this.cube?t.resolve(e):t.reject()}),(()=>{t.reject()}))}}),this._modelBinding=()=>{this.clear()},this.model.on("changed",this._modelBinding)},destroy(){this.cube.destroy(),this.throttle.destroy(),this.model&&this.model.removeListener&&this.model.removeListener("changed",this._modelBinding),this._modelBinding=null,delete this.model,delete this.throttle,delete this.cube},setMethodName(e){this.method=e},setPath(e){this.path=e},setCubeSize(e){this.cubeHeight=e.qcy,this.cubeWidth=e.qcx},setOptions(e){e&&(this.options=Tb(!0,{},CS,this.options,e),this.cacheHeight=this.options.height,this.cacheWidth=this.options.width,this.enabled=this.options.enabled||!1,this.debouncing={enabled:this.options.debouncing.enabled||!1,delay:this.options.debouncing.delay||-1})},clear(){this.cube&&this.cube.clear(),this.throttle&&this.throttle.clear()},set(e){this.clear(),e&&e.length&&this.cube.store(e)},cacheData(e,t){const n=function(e){return this.cube?(this.cube.store(e),this.cube.get(t)):e};return"getHyperCubeStackData"===this.method&&this.options.maxStackedValues?this.model[this.method](this.path,e,this.options.maxStackedValues).then(n.bind(this)):this.model[this.method](this.path,e).then(n.bind(this))},getData(e){if(!this.model)return Promise.reject();if(!this.enabled||!this.cubeHeight||!this.cubeWidth)return"getHyperCubeStackData"===this.method&&this.options.maxStackedValues?this.model[this.method](this.path,e,this.options.maxStackedValues):this.model[this.method](this.path,e);let t,n;const i=[];for(t=0;t<e.length;++t)n=e[t],i.push({qTop:Math.max(Math.floor(n.qTop),0),qLeft:Math.max(n.qLeft,0),qHeight:Math.min(n.qHeight,this.cubeHeight-Math.floor(n.qTop)),qWidth:Math.min(n.qWidth,this.cubeWidth-n.qLeft)});return this.cube.contains(i)?(this.throttle.updateResolutionTime(),Promise.resolve(this.cube.get(i))):0===i[0].qTop&&this.cube.isEmpty()&&this.throttle.ongoingRequests.length+this.throttle.queuedRequests.length===0?(this.throttle.updateResolutionTime(),this.cacheData(i,i)):this.throttle.queue(i)},_getDirections(e){if(!e||e.length<2)return{vertical:0,horizontal:0};const t=e.slice(-2),n=t[1].top-t[0].top,i=t[1].left-t[0].left;return{vertical:n<0?-1:n>0?1:0,horizontal:i<0?-1:i>0?1:0}},_getAreasToCache(e,t,n){let i,r,o,s,a,l,c,u,h;const d=[];let f=this.cacheHeight;for(void 0===t&&(t=0),void 0===n&&(n=0),this.cacheHeight*this.cacheWidth*e.length>this.options.maxTotalArea&&(f=Math.floor(this.options.maxTotalArea/(e.length*this.cacheWidth))),i=0;i<e.length;++i)r=0!==t?Math.floor(.5*Math.max(0,f-e[i].qHeight)):0,o=0!==n?Math.floor(.5*Math.max(0,this.cacheWidth-e[i].qWidth)):0,s=r*t-r,a=o*n-o,l=0!==t?Math.max(0,Math.min(Math.max(e[i].qHeight,f),this.cubeHeight)):e[i].qHeight,c=0!==n?Math.max(0,Math.min(Math.max(e[i].qWidth,this.cacheWidth),this.cubeWidth)):e[i].qWidth,u=Math.max(0,Math.min(e[i].qTop+s,this.cubeHeight-l)),h=Math.max(0,Math.min(e[i].qLeft+a,this.cubeWidth-c)),d.push({qTop:u,qHeight:l,qLeft:h,qWidth:c});return d}}),ES=tx.DATA_PATH,AS=tx.HYPERCUBE_DEF_PATH;class TS{constructor(e){this.model=e,this.path=`/${ES}/${AS}`,this.cacheCube=new kS(e,"qDataPages",this.path,{mode:"K"}),this.cacheCube.setMethodName("getHyperCubeStackData"),this.cacheCube.setOptions({maxStackedValues:tx.MAX_STACKED_VALUES})}setPath(e){this.path=e}setCacheOptions(e){this.cacheCube.setOptions(e)}updateCache(e){let t,n;"qHyperCube"===this.dataPath?t=e&&e.qHyperCube:(n=this.dataPath.slice(0,this.dataPath.indexOf("qHyperCube")-1),t=e&&e[n]&&e[n].qHyperCube),e.qSelectionInfo.qInSelections||this.cacheCube.setCubeSize({qcx:t.qSize.qcx,qcy:eS.getStackedCubeSizeOfMax2Dims(e,n)}),this.backendStackThrottle.clear()}getData(e,t){const n=this.cacheCube;return t?this.model.getHyperCubeData(t,e):this.cacheCube.getData(e).then((e=>(e[0]&&e[0].qData[0]&&e[0].qData[0].qSubNodes.some((e=>e.qDown>0))&&n.clear(),e)))}}return function(t){return function(e){if(e&&e.get&&e.add){const t="Object.Disclaimer.LimitedData";if(e.get(t)!==t)return;Object.keys(o).forEach((t=>{e.add(o[t])}))}}(t.translator),{qae:wb(t),ext:Yx(t),component(){const n=e.useElement(),i=function(){const t=e.useApp(),n=e.useAppLayout(),i=e.useDeviceType(),r=e.useOptions(),o=e.useTheme(),s=e.useTranslator();return e.useMemo((()=>({app:t,appLayout:n,deviceType:i,options:r,theme:o,translator:s})),[t,n,r.direction,r.freeResize,s.language(),o.name(),i])}(),o=i.options.renderer,s=e.useMemo((()=>Ig(o)),[o]),a=e.useSelections(),l=e.useStaleLayout(),c=e.useModel(),u=e.useConstraints(),h=function(){const t=e.useConstraints(),[n,i]=e.useState(!1),[r,o]=e.useState(!1),s=!!e.useLayout().qSelectionInfo.qInSelections,[a]=e.useState((()=>({toggle(){o((e=>!e))}})));return e.useEffect((()=>{t&&i(!t.select&&!t.active)}),[t]),e.useAction((()=>({key:"lasso",label:"Lasso",icon:Rg,hidden:!n||!s,active:r,action(){o((e=>!e))}})),[s,r,n]),a.enabled=()=>n,a.active=()=>r,a}(),d=e.useRenderState(),[f,p]=e.useState();e.useEffect((()=>{const e=r(n),o=function(e,t){return t.snapshotData?new cb(t,"qUndoExclude.qHyperCube","qStackedDataPages"):new TS(e)}(c,l),u=a,d=new yS({environment:i,lasso:h,flags:t.flags,picasso:s,$element:e,backendApi:o,selectionsApi:u});return p(d),()=>{d.destroy()}}),[]);const[,m]=e.usePromise((async()=>{if(!f)return;f.updateEnvironment(i),f.updateConstraints(u);if(!!!l.snapshotData){const e=await c.getEffectiveProperties();if(await f.updateDerivedProperties(e,l))return void d.pending();d.restore()}await f.updateData(l),await f.paint()}),[l,f,i]);if(m)throw m;var g;!function(t){const n=e.useRect(),i=e.useOptions(),r=e.useConstraints(),[,o]=e.usePromise((async()=>{t&&(t.updateConstraints(r),t.options=i,await t.resize())}),[n.width,n.height]);if(o)throw o}(f),g=f,e.onTakeSnapshot((e=>{if(g)return g.setSnapshotData(e)})),e.useImperativeHandle((()=>({getViewState(){if(g)return g.getViewState()}})),[g])}}}}));
|
|
45
29
|
//# sourceMappingURL=sn-distplot.js.map
|