@nebula.js/sn-scatter-plot
Version: 
A scatter plot.
9 lines (8 loc) • 1.39 MB
JavaScript
/*
* @nebula.js/sn-scatter-plot v3.59.2
* Copyright (c) 2025 QlikTech International AB
* Released under the MIT license.
*/
!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-scatter-plot"]=t(e.stardust)}(this,(function(e){"use strict";function t(e,t){return t.forEach((function(t){t&&"string"!=typeof t&&!Array.isArray(t)&&Object.keys(t).forEach((function(n){if("default"!==n&&!(n in e)){var r=Object.getOwnPropertyDescriptor(t,n);Object.defineProperty(e,n,r.get?r:{enumerable:!0,get:function(){return t[n]}})}}))})),Object.freeze(e)}const n={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 r(){const[t]=e.useState({}),r=e.useConstraints(),i=function(t){const n=e.useConstraints(),[r,i]=e.useState(!1),[o,a]=e.useState({});return e.useEffect((()=>()=>{a({})}),[]),e.useEffect((()=>{n&&i(!n.select&&!n.active)}),[n]),{enabled:()=>r&&!t.getProgressive(),emit:(e,...t)=>{var n;return null===(n=o[e])||void 0===n?void 0:n.forEach((e=>e(...t)))},removeListener:(e,t)=>{var n;const r=null===(n=o[e])||void 0===n?void 0:n.indexOf(t);r>-1&&o[e].splice(r,1)},removeAllListeners:e=>{o[e]=void 0},on:(e,t)=>{Array.isArray(o[e])?o[e].push(t):o[e]=[t]},getBrushOptions:e=>({orMode:"tap"===e})}}(t),o=function(){var t;const r=e.useConstraints(),[i,o]=e.useState(!1),[a,s]=e.useState(!1),l=e.useLayout(),c=e.useTranslator(),u=!!l.qSelectionInfo.qInSelections,d=!(null===(t=l.qHyperCube)||void 0===t||null===(t=t.qDimensionInfo)||void 0===t||null===(t=t[0])||void 0===t||!t.qIsOneAndOnlyOne);e.useEffect((()=>{r&&o(!r.select&&!r.active)}),[r]);const f=e=>{s("boolean"==typeof e?e:!a)};return e.useAction((()=>({key:"lasso",label:c.get(a?"Tooltip.ToggleOffLassoSelection":"Tooltip.ToggleOnLassoSelection"),icon:n,hidden:!i||!u||d,active:a,action:f})),[u,d,a,i]),{action:f,enabled:()=>i,active:()=>a}}();return t.zoom={enabled:()=>r&&!r.active},t.scroll={enabled:()=>r&&!r.active},t.interact={enabled:()=>r&&!r.active},t.tooltip={enabled:()=>r&&!r.passive},t.getProgressive=()=>t.progressive,t.setProgressive=e=>{t.progressive=e},t.lasso=o,t.select=i,t}function i(e){return null!==e&&"object"==typeof e&&"r"in e&&"number"==typeof e.r&&"g"in e&&"number"==typeof e.g&&"b"in e&&"number"==typeof e.b&&("number"==typeof e.a||void 0===e.a)}function o(e){if("object"==typeof e&&i(e))return(e.r<<16)+(e.g<<8)+e.b;let t=0,n=0,r=0;if("string"==typeof e){let i;(i=/^rgb\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*\)$/i.exec(e))?(t=parseInt(i[1],10),n=parseInt(i[2],10),r=parseInt(i[3],10)):(i=/^#([A-Fa-f0-9]{2})([A-Fa-f0-9]{2})([A-Fa-f0-9]{2})$/i.exec(e))?(t=parseInt(i[1],16),n=parseInt(i[2],16),r=parseInt(i[3],16)):(i=/^#([A-Fa-f0-9])([A-Fa-f0-9])([A-Fa-f0-9])$/i.exec(e))&&(t=parseInt(i[1]+i[1],16),n=parseInt(i[2]+i[2],16),r=parseInt(i[3]+i[3],16))}return(t<<16)+(n<<8)+r}const a={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:0,g:0,b:0,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}};function s(...e){const t={type:"qcm-color",r:0,g:0,b:0,a:1,invalid:!1,spaces:{}};let n=0,r=0,o=0,s=1;if(null!==(l=e[0])&&"object"==typeof l&&"type"in l&&"qcm-color"===l.type)({r:n,g:r,b:o,a:s}=e[0]),t.invalid=e[0].invalid,t.spaces={...e[0].spaces};else if(i(e[0]))({r:n,g:r,b:o}=e[0]),"a"in e[0]&&({a:s}=e[0]);else if(e.length<3)if("string"==typeof e[0]){const i=e[0];let l;if(l=/^rgb\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*\)$/i.exec(i))n=parseInt(l[1],10),r=parseInt(l[2],10),o=parseInt(l[3],10);else if(l=/^rgba\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d(\.\d+)?)\s*\)$/i.exec(i))n=parseInt(l[1],10),r=parseInt(l[2],10),o=parseInt(l[3],10),s=parseFloat(l[4]);else if(l=/^ARGB\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*\)$/i.exec(i))s=parseInt(l[1],10)/255,n=parseInt(l[2],10),r=parseInt(l[3],10),o=parseInt(l[4],10);else if(l=/^#([A-Fa-f0-9]{2})([A-Fa-f0-9]{2})([A-Fa-f0-9]{2})$/i.exec(i))n=parseInt(l[1],16),r=parseInt(l[2],16),o=parseInt(l[3],16),s=1;else if(l=/^#([A-Fa-f0-9])([A-Fa-f0-9])([A-Fa-f0-9])$/i.exec(i))n=parseInt(l[1]+l[1],16),r=parseInt(l[2]+l[2],16),o=parseInt(l[3]+l[3],16),s=1;else if(l=/^hsl\(\s*(\d+(\.\d+)?)\s*,\s*(\d+(\.\d+)?%?)\s*,\s*(\d+(\.\d+)?%?)\s*\)$/i.exec(i)){let e=parseFloat(l[1]),t=parseFloat(l[3]),i=parseFloat(l[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;const a=i<=.5?2*i*t:(2-2*i)*t;let c=e/60;const u=a*(1-Math.abs(c%2-1));let d=[];switch(c=Math.floor(c),c){case 0:d=[a,u,0];break;case 1:d=[u,a,0];break;case 2:d=[0,a,u];break;case 3:d=[0,u,a];break;case 4:d=[u,0,a];break;case 5:d=[a,0,u];break;default:d=[0,0,0]}const f=i-.5*a;n=d[0]+f,r=d[1]+f,o=d[2]+f,n=Math.round(255*n),r=Math.round(255*r),o=Math.round(255*o),s=1}else if(l=/^hsla\(\s*(\d+(\.\d+)?)\s*,\s*(\d+(\.\d+)?%?)\s*,\s*(\d+(\.\d+)?%?)\s*,\s*(\d(\.\d+)?)\s*\)$/i.exec(i)){let e=parseFloat(l[1]),t=parseFloat(l[3]),i=parseFloat(l[5]);s=parseFloat(l[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;const a=i<=.5?2*i*t:(2-2*i)*t;let c=e/60;const u=a*(1-Math.abs(c%2-1));let d=[];switch(c=Math.floor(c),c){case 0:d=[a,u,0];break;case 1:d=[u,a,0];break;case 2:d=[0,a,u];break;case 3:d=[0,u,a];break;case 4:d=[u,0,a];break;case 5:d=[a,0,u];break;default:d=[0,0,0]}const f=i-.5*a;n=d[0]+f,r=d[1]+f,o=d[2]+f,n=Math.round(255*n),r=Math.round(255*r),o=Math.round(255*o)}else if(l=/^hsv\(\s*(\d+(\.\d+)?)\s*,\s*(\d+(\.\d+)?%?)\s*,\s*(\d+(\.\d+)?%?)\s*\)$/i.exec(i)){let e=parseFloat(l[1]),t=parseFloat(l[3]),i=parseFloat(l[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;const a=i*t;let c=e/60;const u=a*(1-Math.abs(c%2-1));let d=[];switch(c=Math.floor(c),c){case 0:d=[a,u,0];break;case 1:d=[u,a,0];break;case 2:d=[0,a,u];break;case 3:d=[0,u,a];break;case 4:d=[u,0,a];break;case 5:d=[a,0,u];break;default:d=[0,0,0]}const f=i-a;n=d[0]+f,r=d[1]+f,o=d[2]+f,n=Math.round(255*n),r=Math.round(255*r),o=Math.round(255*o),s=1}else{const e=i.toLowerCase();if(function(e){return e in a}(e)){const t=a[e];({r:n,g:r,b:o}=t),s="a"in t?t.a:1}else t.invalid=!0}}else"number"==typeof e[0]&&e[0]>=0&&"argb"===e[1]?(s=(4278190080&e[0])>>>24,s/=255,n=(16711680&e[0])>>16,r=(65280&e[0])>>8,o=255&e[0]):"number"==typeof e[0]&&e[0]>=0?(n=(16711680&e[0])>>16,r=(65280&e[0])>>8,o=255&e[0]):t.invalid=!0;else 3===e.length||4===e.length?(n=e[0],r=e[1],o=e[2],s=4===e.length?e[3]:1):t.invalid=!0;var l;return Number.isNaN(+n+r+o+s)&&(t.invalid=!0),t.r=Math.floor(n),t.g=Math.floor(r),t.b=Math.floor(o),t.a=s,t}function l(e){let t,n,r;if(i(e))return t=e.r.toString(16),n=e.g.toString(16),r=e.b.toString(16),1===t.length&&(t=`0${t}`),1===n.length&&(n=`0${n}`),1===r.length&&(r=`0${r}`),`#${[t,n,r].join("")}`;const a="string"==typeof e?o(e):e;return t=((16711680&a)>>16).toString(16),n=((65280&a)>>8).toString(16),r=(255&a).toString(16),1===t.length&&(t=`0${t}`),1===n.length&&(n=`0${n}`),1===r.length&&(r=`0${r}`),`#${t}${n}${r}`}function c(e){let t,n,r=0;const i="string"==typeof e?s(e):e,o=i.r/255,a=i.g/255,l=i.b/255,{a:c}=i,u=Math.max(o,a,l),d=Math.min(o,a,l),f=(u+d)/2;if(u===d)t=0,r=0;else{switch(n=u-d,t=f>.5?n/(2-u-d):n/(u+d),u){case o:r=(a-l)/n+(a<l?6:0);break;case a:r=(l-o)/n+2;break;case l:r=(o-a)/n+4}r/=6}return{h:360*r,s:100*t,l:100*f,a:c}}function u(e){let t,n,r=0;const i="string"==typeof e?s(e):e,o=i.r/255,a=i.g/255,l=i.b/255,c=Math.max(o,a,l),u=Math.min(o,a,l),d=c;if(c===u)t=0,r=0;else{switch(n=c-u,t=0===n?0:n/d,c){case o:r=(a-l)/n+(a<l?6:0);break;case a:r=(l-o)/n+2;break;case l:r=(o-a)/n+4}r/=6}return{h:360*r%360,s:100*t,v:100*d}}function d(e){if(i(e))return`rgb(${e.r}, ${e.g}, ${e.b})`;const t="string"==typeof e?o(e):e;return`rgb(${(16711680&t)>>16}, ${(65280&t)>>8}, ${255&t})`}function f(e,t){return i(e)?`rgba(${e.r}, ${e.g}, ${e.b}, ${e.a})`:f(s(e))}function p(e){return i(e)?1===e.a?d(e):f(e):p(s(e))}const h=e=>{const t=e/255;return t<=.03928?t/12.92:((t+.055)/1.055)**2.4};function m(...e){const t=s(...e);return t.invalid||function(e){return.2126*h(e.r)+.7152*h(e.g)+.0722*h(e.b)}(t)<.4}function g(...e){const t=s(...e),n={type:t.type,r:t.r,g:t.g,b:t.b,a:t.a,invalid:t.invalid,spaces:t.spaces},r=()=>(n.spaces.hslaObject||(n.spaces.hslaObject=c(n)),n.spaces.hslaObject),i=e=>{const t=r(),{h:n,s:i,l:o,a:a}=t;return`hsla(${n}, ${i}, ${Math.max(0,Math.min(o+e,100))}, ${a})`};return{get type(){return n.type},isInvalid:()=>n.invalid,get r(){return n.r},get g(){return n.g},get b(){return n.b},get a(){return n.a},getR:()=>n.r,getG:()=>n.g,getB:()=>n.b,getAlpha:()=>n.a,setAlpha:e=>{n.a=e,n.spaces={}},isEqualTo:e=>{let t;if("string"==typeof e)t=s(e);else{if(e.type!==n.type)return!1;t=e}return t.r===n.r&&t.g===n.g&&t.b===n.b&&t.a===n.a},isDark:()=>m(n),getRGB:()=>(n.spaces.rgb||(n.spaces.rgb=d(n)),n.spaces.rgb),getRGBA:()=>(n.spaces.rgba||(n.spaces.rgba=f(n)),n.spaces.rgba),getString:()=>(n.spaces.string||(n.spaces.string=p(n)),n.spaces.string),getHex:()=>(n.spaces.hex||(n.spaces.hex=l(n)),n.spaces.hex),getHSL:()=>(n.spaces.hsl||(n.spaces.hsl=function(e){let t,n,r=0;const i="string"==typeof e?s(e):e,o=i.r/255,a=i.g/255,l=i.b/255,c=Math.max(o,a,l),u=Math.min(o,a,l),d=(c+u)/2;if(c===u)t=0,r=0;else{switch(n=c-u,t=d>.5?n/(2-c-u):n/(c+u),c){case o:r=(a-l)/n+(a<l?6:0);break;case a:r=(l-o)/n+2;break;case l:r=(o-a)/n+4}r/=6}return`hsl(${360*r}, ${100*t}, ${100*d})`}(n)),n.spaces.hsl),getHSLA:()=>(n.spaces.hsla||(n.spaces.hsla=function(e){const{h:t,s:n,l:r,a:i}=c(e);return`hsla(${t}, ${n}, ${r}, ${i})`}(n)),n.spaces.hsla),getHSLAObject:r,getShiftedHSLA:i,getHSV:()=>(n.spaces.hsv||(n.spaces.hsv=function(e){const{h:t,s:n,v:r}=u(e);return`hsv(${t}, ${n}, ${r})`}(n)),n.spaces.hsv),getHSVObject:()=>(n.spaces.hsvObject||(n.spaces.hsvObject=u(n)),n.spaces.hsvObject),blend:(e,t)=>`rgba(${Math.floor(n.r+(e.r-n.r)*t)}, ${Math.floor(n.g+(e.g-n.g)*t)}, ${Math.floor(n.b+(e.b-n.b)*t)}, ${Math.floor(n.a+(e.getAlpha()-n.a)*t)})`,getBrightenedColor:(e=1)=>g(i(18*e)),getDarkenedColor:(e=1)=>g(i(18*-e))}}function y(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function v(e,t,n,r,i,o,a){try{var s=e[o](a),l=s.value}catch(e){return void n(e)}s.done?t(l):Promise.resolve(l).then(r,i)}function b(e){return function(){var t=this,n=arguments;return new Promise((function(r,i){var o=e.apply(t,n);function a(e){v(o,r,i,a,s,"next",e)}function s(e){v(o,r,i,a,s,"throw",e)}a(void 0)}))}}function x(e,t,n){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t);if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function w(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function S(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?w(Object(n),!0).forEach((function(t){x(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):w(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function M(e,t){if(null==e)return{};var n,r,i=function(e,t){if(null==e)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(-1!==t.indexOf(r))continue;n[r]=e[r]}return n}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r<o.length;r++)n=o[r],-1===t.indexOf(n)&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function k(){
/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */
var e,t,n="function"==typeof Symbol?Symbol:{},r=n.iterator||"@@iterator",i=n.toStringTag||"@@toStringTag";function o(n,r,i,o){var l=r&&r.prototype instanceof s?r:s,c=Object.create(l.prototype);return E(c,"_invoke",function(n,r,i){var o,s,l,c=0,u=i||[],d=!1,f={p:0,n:0,v:e,a:p,f:p.bind(e,4),d:function(t,n){return o=t,s=0,l=e,f.n=n,a}};function p(n,r){for(s=n,l=r,t=0;!d&&c&&!i&&t<u.length;t++){var i,o=u[t],p=f.p,h=o[2];n>3?(i=h===r)&&(l=o[(s=o[4])?5:(s=3,3)],o[4]=o[5]=e):o[0]<=p&&((i=n<2&&p<o[1])?(s=0,f.v=r,f.n=o[1]):p<h&&(i=n<3||o[0]>r||r>h)&&(o[4]=n,o[5]=r,f.n=h,s=0))}if(i||n>1)return a;throw d=!0,r}return function(i,u,h){if(c>1)throw TypeError("Generator is already running");for(d&&1===u&&p(u,h),s=u,l=h;(t=s<2?e:l)||!d;){o||(s?s<3?(s>1&&(f.n=-1),p(s,l)):f.n=l:f.v=l);try{if(c=2,o){if(s||(i="next"),t=o[i]){if(!(t=t.call(o,l)))throw TypeError("iterator result is not an object");if(!t.done)return t;l=t.value,s<2&&(s=0)}else 1===s&&(t=o.return)&&t.call(o),s<2&&(l=TypeError("The iterator does not provide a '"+i+"' method"),s=1);o=e}else if((t=(d=f.n<0)?l:n.call(r,f))!==a)break}catch(t){o=e,s=1,l=t}finally{c=1}}return{value:t,done:d}}}(n,i,o),!0),c}var a={};function s(){}function l(){}function c(){}t=Object.getPrototypeOf;var u=[][r]?t(t([][r]())):(E(t={},r,(function(){return this})),t),d=c.prototype=s.prototype=Object.create(u);function f(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,c):(e.__proto__=c,E(e,i,"GeneratorFunction")),e.prototype=Object.create(d),e}return l.prototype=c,E(d,"constructor",c),E(c,"constructor",l),l.displayName="GeneratorFunction",E(c,i,"GeneratorFunction"),E(d),E(d,i,"Generator"),E(d,r,(function(){return this})),E(d,"toString",(function(){return"[object Generator]"})),(k=function(){return{w:o,m:f}})()}function E(e,t,n,r){var i=Object.defineProperty;try{i({},"",{})}catch(e){i=0}E=function(e,t,n,r){function o(t,n){E(e,t,(function(e){return this._invoke(t,n,e)}))}t?i?i(e,t,{value:n,enumerable:!r,configurable:!r,writable:!r}):e[t]=n:(o("next",0),o("throw",1),o("return",2))},E(e,t,n,r)}function C(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,i,o,a,s=[],l=!0,c=!1;try{if(o=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;l=!1}else for(;!(l=(r=o.call(n)).done)&&(s.push(r.value),s.length!==t);l=!0);}catch(e){c=!0,i=e}finally{try{if(!l&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(c)throw i}}return s}}(e,t)||q(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function A(e){return function(e){if(Array.isArray(e))return y(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||q(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function D(e){return D="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},D(e)}function q(e,t){if(e){if("string"==typeof e)return y(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?y(e,t):void 0}}var T="point-label-cross-placement",_="unclassified",N="equal-equal",O="equal-higher",I="equal-lower",P="equal-void",R="higher-equal",L="higher-higher-acute",z="higher-higher-obtuse",F="higher-lower-negative",j="higher-lower-positive",V="higher-void",H="lower-equal",B="lower-higher-negative",$="lower-higher-positive",W="lower-lower-acute",U="lower-lower-obtuse",Y="lower-void",X="void-equal",G="void-higher",K="void-lower",Z="void-void";function J(e,t){return Math.atan2(t.y-e.y,t.x-e.x)*(180/Math.PI)}function Q(e,t,n){var r=Math.sqrt(Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2)),i=Math.sqrt(Math.pow(t.x-n.x,2)+Math.pow(t.y-n.y,2)),o=Math.sqrt(Math.pow(n.x-e.x,2)+Math.pow(n.y-e.y,2));return Math.acos((i*i+r*r-o*o)/(2*i*r))*(180/Math.PI)}function ee(e){var t=e.previous,n=e.current,r=e.next,i=t&&t.value,o=n&&n.value,a=r&&r.value;return t||r?t?r?i===o?o===a?N:o<a?O:I:o===a?i>o?R:H:i>o?o<a?Q(t,n,r)>90?z:L:J(t,n)>J(t,r)?j:F:o>a?Q(t,n,r)>90?U:W:J(t,n)>J(t,r)?$:B:i===o?P:i>o?V:Y:o===a?X:o<a?G:K:Z}var te,ne={TOP:"top",TOP_RIGHT:"top-right",RIGHT:"right",BOTTOM_RIGHT:"bottom-right",BOTTOM:"bottom",BOTTOM_LEFT:"bottom-left",LEFT:"left",TOP_LEFT:"top-left"};function re(e){var t=e.bounds,n=e.size,r=t.x,i=t.y,o=t.width,a=t.height;return"center"===n.insideStrategy?Math.floor(r+o/2)>=0&&Math.ceil(r+o/2)<=n.width&&Math.floor(i+a/2)>=0&&Math.ceil(i+a/2)<=n.height:Math.floor(r+o)>0&&Math.ceil(r)<n.width&&Math.floor(i+a/2)>=0&&Math.ceil(i+a/2)<=n.height}function ie(){te=te||document.createElement("canvas").getContext("2d")}var oe,ae={measureTextWidth:function(e){return ie(),te.measureText(e).width},lineWrap:function(e,t,n,r){var i,o;ie();var a,s,l=e?e.split(/\n+|\r+|\r\n/):[],c=[],u=e?e.split(/\s+/):[],d=l[0];if("number"!=typeof t||t<=0)return[e];if("number"==typeof r&&l.length>=r)return l.slice(0,r);for(n&&(te.font=n),o=0;o<l.length;o++){for(d=C(u=(l[o]||"").split(/\s+/),1)[0],s="",i=1;i<u.length;i++)if(a="".concat(d," ").concat(u[i]),ae.measureTextWidth(a)>t&&("number"!=typeof r||r>c.length)?(c.push(d),d=u[i]):d=a,"number"==typeof r&&c.length>=r){s=u.slice(i+1).join(" ");break}"number"!=typeof r||c.length<r?c.push(d):c[Math.max(0,c.length-1)]="".concat(c[Math.max(0,c.length-1)]||""," ").concat(d," ").concat(s)}return c},wordWrap:function(e,t,n,r,i){if(ie(),!e||!e.length)return[];n&&(te.font=n);var o,a,s,l,c=[],u=e.slice();if(u.filter((function(e){return!!e})),"number"!=typeof t||t<0)return e.slice();for(l=0;l<u.length;l++)a=null,(s=u[l])&&(s.length<=1||ae.measureTextWidth(s)<=t?c.push(s):(o=ae.splitWord(s,t,void 0,r-c.length)).length<=1?c.push(o[0]):(a=o.pop(),c=c.concat(o),u[l+1]?ae.measureTextWidth("".concat(a," ").concat(u[l+1]))>t&&c.length+u.length-l<=r?u.splice(l+1,0,a):u[l+1]="".concat(a," ").concat(u[l+1]):u.push(a)));return c.forEach((function(e,t,n){n[t]=e?e.trim():e})),c.length>r?(c=c.splice(0,r))[c.length-1]=ae.truncate(c[c.length-1],t,n,i).text:(s=c[c.length-1])&&s.length>1&&ae.measureTextWidth(s)>t&&(c[c.length-1]=ae.truncate(s,t,n,i).text),c},truncate:function(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"…";ie();var i,o,a,s=e,l=ae.measureTextWidth("i"),c=Math.ceil(t/l);if(n&&(te.font=n),e&&t){if(ae.measureTextWidth(s)>t){for(i=Math.min(c,s.length);i>0;i--)if(o=s.substring(0,i-1).trim()+r,ae.measureTextWidth(o)<=t){a=s.substring(i-1),s=o;break}i||(a=s,s="…")}}else a=void 0;return{text:s,rest:a}},isNumber:function(e){return"number"==typeof e&&Number.isFinite(e)},explodeWord:function(e,t,n,r){var i;ie();var o=e,a="",s=[];if(ae.isNumber(n)&&n<=1)return[e];var l=Math.ceil(t/r);for(i=Math.min(e.length,l);i>0&&(o=e.substring(0,i)," "===e.substring(i-1,i)?o=e.substring(0,i-1):o+="-",a=e.substring(i),!(ae.measureTextWidth(o)<=t));i--);return(!i&&!o||ae.measureTextWidth(o)>t)&&(o=e.substring(0,1),a=e.substring(1)),s.push(o),a?(ae.measureTextWidth(a)>t?(a=ae.explodeWord(a,t,n-1,r),s=s.concat(a)):s.push(a),s.filter((function(e){return""!==e.trim()}))):s},splitWord:function(e,t,n,r){return ie(),e&&t?(n&&(te.font=n),ae.explodeWord(e,t,r,Math.max(1,ae.measureTextWidth("i")))):[]},wrapText:function(e,t,n,r,i){var o;return Number.isNaN(t)?[e]:(o=r>1?ae.lineWrap(e,t,n,r):[e],o=ae.wordWrap(o,t,n,r,i))},getFontHeight:function(e){return ie(),e&&(te.font=e),1.5*ae.measureTextWidth("m")},tokenize:function(e,t,n,r,i,o){var a=arguments.length>6&&void 0!==arguments[6]?arguments[6]:1;ie(),t&&(te.font=t);var s=ae.getFontHeight(),l=a*s,c=[],u=0,d=[];if(o<s)return[];var f=o?Math.max(1,Math.floor(o/l)):r||1;return Array.isArray(r)?(r.forEach((function(e){u+=Number.isNaN(e)||e<=0?0:e})),r.forEach((function(e){c.push(Number.isNaN(e)||e<=0?f-u:e)}))):c=[Number.isNaN(r)||r<=0?f:Math.min(f,r)],Array.isArray(e)?e.forEach((function(e,n){d.length<f&&(d=d.concat(ae.wrapText(e,i,t,c[n])))})):d=ae.wrapText(e,i,t,c[0],n),d}};function se(e){var t,n,r=e.config,i=e.crossPlacements,o=e.node,a=e.line,s=e.groupIndex,l=e.extract,c=e.style,u=e.measureText,d=e.size,f=e.horizontal,p=e.rtl,h=e.meta,m=e.showLabel,g=l.label(o.data);if("string"!=typeof g&&"number"!=typeof g||""===g)return!1;var y=function(){var e,t,n=u({fontFamily:c.fontFamily,fontSize:c.fontSize,text:g});if(null===(e=o.data)||void 0===e||null===(e=e.value)||void 0===e||!e.maxLabelWidth||n.width<=(null===(t=o.data)||void 0===t||null===(t=t.value)||void 0===t?void 0:t.maxLabelWidth))return n;var r="".concat(c.fontSize," ").concat(c.fontFamily),i=ae.tokenize(g,r,"…",3,o.data.value.maxLabelWidth);return n.lines=i.map((function(e){return{text:e,size:u({fontFamily:c.fontFamily,fontSize:c.fontSize,text:e})}})),n.width=Math.max.apply(Math,A(n.lines.map((function(e){return e.size.width})))),n.height*=i.length,n}(),v=o.localBounds,b=o.attrs["stroke-width"],x=l.pointValue(o.data),w=!(null===(t=o.data)||void 0===t||null===(t=t.value)||void 0===t||!t.hasBackground),S=w?{X:3,Y:2}:{X:1,Y:0},M=w?{X:2,Y:2}:{X:0,Y:0},k={x:v.x+v.width/2,y:v.y+v.height/2,width:y.width+2*S.X+2*M.X,height:y.height+2*S.Y+2*M.Y},E="".concat(k.x,"-").concat(k.y),C=!f&&!p,D=f?d.height:d.width,q=(f?k.y:k.x)/D,T=(C?1-q:q)<=(D<=200?.25:.1),N=null===(n=o.data)||void 0===n||null===(n=n.value)||void 0===n||null===(n=n.label)||void 0===n?void 0:n.placement,O=Object.keys(ne).map((function(e){return ne[e]})),I={key:E,config:r,node:o,line:a,group:s,value:x,labelMeasurements:y,bounds:k,inside:re({bounds:v,size:d}),border:b?b/2:0,classification:_,setClassification:function(e){I.classification=e},preferences:[],setPreferences:function(e){var t;(t=I.preferences).push.apply(t,A(e))},fixedPlacement:O.includes(N)?N:void 0,placement:void 0,setPlacement:function(e){I.placement=e,i.setPlacement(e)},duplicate:!1,setDuplicate:function(){I.duplicate=!0},extreme:h.getExtreme(E),elite:T,show:r.labels&&m(o)};return I}var le=(x(x(x(x(x(x(x(x(x(x(oe={},N,[ne.TOP,ne.BOTTOM]),O,[ne.BOTTOM,ne.BOTTOM_RIGHT]),I,[ne.TOP,ne.TOP_RIGHT]),P,[ne.TOP,ne.BOTTOM]),R,[ne.LEFT,ne.BOTTOM_LEFT,ne.TOP,ne.TOP_RIGHT]),L,[ne.BOTTOM,ne.BOTTOM_LEFT,ne.LEFT,ne.TOP_RIGHT]),z,[ne.BOTTOM,ne.TOP]),F,[ne.TOP,ne.TOP_RIGHT,ne.RIGHT]),j,[ne.BOTTOM,ne.BOTTOM_LEFT,ne.LEFT]),V,[ne.TOP]),x(x(x(x(x(x(x(x(x(x(oe,H,[ne.TOP]),B,[ne.TOP,ne.TOP_LEFT]),$,[ne.BOTTOM_RIGHT]),W,[ne.TOP,ne.TOP_LEFT,ne.LEFT,ne.TOP_RIGHT,ne.RIGHT]),U,[ne.TOP,ne.BOTTOM]),Y,[ne.TOP]),X,[ne.TOP]),G,[ne.TOP,ne.BOTTOM]),K,[ne.TOP,ne.BOTTOM,ne.LEFT]),Z,[ne.TOP]),x(oe,_,[ne.TOP,ne.BOTTOM,ne.RIGHT,ne.LEFT,ne.TOP_RIGHT,ne.BOTTOM_RIGHT,ne.BOTTOM_LEFT,ne.TOP_LEFT]));function ce(e){var t=function(e){var t=e.configs,n=e.crossPlacements,r=e.nodes,i=e.extract,o=e.style,a=e.measureText,s=e.size,l=e.horizontal,c=e.rtl,u=e.showLabel,d=function(e){var t={top:[],right:[],bottom:[],left:[]},n=e.nodes.map((function(e){var t=e.localBounds,n={x:t.x+t.width/2,y:t.y+t.height/2};return{key:"".concat(n.x,"-").concat(n.y),center:n}})),r=n.reduce((function(e,t){return(!e.top||t.center.y<e.top.center.y)&&(e.top=t),(!e.right||t.center.x>e.right.center.x)&&(e.right=t),(!e.bottom||t.center.y>e.bottom.center.y)&&(e.bottom=t),(!e.left||t.center.x<e.left.center.x)&&(e.left=t),e}),{});return t.top=n.filter((function(e){return e.center.y===r.top.center.y})).map((function(e){return e.key})),t.right=n.filter((function(e){return e.center.x===r.right.center.x})).map((function(e){return e.key})),t.bottom=n.filter((function(e){return e.center.y===r.bottom.center.y})).map((function(e){return e.key})),t.left=n.filter((function(e){return e.center.x===r.left.center.x})).map((function(e){return e.key})),{getExtrema:function(e){return{top:-1!==t.top.indexOf(e),right:-1!==t.right.indexOf(e),bottom:-1!==t.bottom.indexOf(e),left:-1!==t.left.indexOf(e)}},getExtreme:function(e){return[t.top,t.right,t.bottom,t.left].some((function(t){return-1!==t.indexOf(e)}))}}}({nodes:r}),f=function(e){var t=e.by,n=e.lineId,r=e.nodes.reduce((function(e,r,i){var o=t(r.data);return e[o]||(e[o]={items:[],index:i}),e[o].items.push({node:r,line:n(r)}),e}),{});return Object.keys(r).map((function(e){return r[e]})).sort((function(e,t){return e.index-t.index})).map((function(e){return e.items}))}({nodes:r,by:i.majorValue,lineId:i.lineId}).map((function(e,r){return e.map((function(e){return{line:e.line,item:se({config:t.get(e.node.key),crossPlacements:n,node:e.node,line:e.line,groupIndex:r,extract:i,style:o,measureText:a,size:s,horizontal:l,rtl:c,meta:d,showLabel:u})}})).filter((function(e){return e.item})).reduce((function(e,t){return e[t.line]=t.item,e}),{})}));return f.filter((function(e){return Object.keys(e).length}))}({configs:e.configs,crossPlacements:e.crossPlacements,nodes:e.nodes,extract:e.extract,style:e.style,measureText:e.measureText,size:e.size,horizontal:e.horizontal,rtl:e.rtl,showLabel:e.showLabel}),n=A(t.reduce((function(e,t){return e.push.apply(e,A(Object.keys(t).map((function(e){return t[e]})))),e}),[])),r=C(n,1)[0],i=function(e){for(var t=e.threshold,n=e.groups.map((function(e){return Object.keys(e).map((function(t){return e[t]}))})),r={},i=0;i<=n.length;i++){var o=n[i];if(o)for(var a=0;a<o.length;a++){var s=o[a];if(s.config.lines){var l=s.line;r[l]||(r[l]=[]),r[l].push(s.bounds)}}}for(var c=Object.keys(r).map((function(e){return r[e]})),u=[],d=0;d<c.length;d++)for(var f=0;f<c[d].length-1;f++){var p=c[d][f],h=c[d][f+1],m={x1:p.x,y1:p.y,x2:h.x,y2:h.y},g=m.x1-m.x2,y=m.y1-m.y2;Math.sqrt(g*g+y*y)>t&&u.push(m)}return u}({groups:t,threshold:null==r?void 0:r.node.localBounds.height}),o={getItems:function(){return n},getLines:function(){return i}};return function(e){for(var t=e.groups,n=function(e){for(var n=Object.keys(t[e]).map((function(n){return t[e][n]})),r=0;r<n.length;r++){var i=n[r];if(!i.config.fixed){var o=ee({previous:t[e-1]&&t[e-1][i.line],current:i,next:t[e+1]&&t[e+1][i.line]});i.setClassification(o)}}},r=0;r<t.length;r++)n(r)}({groups:t}),o.getItems().forEach((function(e){e.setPreferences(le[e.classification])})),o}function ue(e){var t=e.item,n=e.placement,r=e.size;return n.x>=0-r.edgeBleed.left&&n.x<=r.width-t.bounds.width+r.edgeBleed.right&&n.y>=0-r.edgeBleed.top&&n.y<=r.height-t.bounds.height}function de(e){var t=e.line1,n=e.line2,r=(n.y2-n.y1)*(t.x2-t.x1)-(n.x2-n.x1)*(t.y2-t.y1);if(0===r)return!1;var i=((n.x2-n.x1)*(t.y1-n.y1)-(n.y2-n.y1)*(t.x1-n.x1))/r,o=((t.x2-t.x1)*(t.y1-n.y1)-(t.y2-t.y1)*(t.x1-n.x1))/r;return i>=0&&i<=1&&o>=0&&o<=1}var fe={x:0,width:0,y:0,height:0},pe=function(e){var t=e.item;return{x:t.bounds.x-t.bounds.width/2,y:t.bounds.y-t.bounds.height-t.node.localBounds.height/2-t.border}},he=function(e){var t=e.item;return{x:t.bounds.x,y:t.bounds.y-t.bounds.height-t.node.localBounds.height/2-t.border}},me=function(e){var t=e.item;return{x:t.bounds.x+t.node.localBounds.width/2+t.border,y:t.bounds.y-t.bounds.height/2}},ge=function(e){var t=e.item;return{x:t.bounds.x,y:t.bounds.y+t.node.localBounds.height/2+t.border}},ye=function(e){var t=e.item;return{x:t.bounds.x-t.bounds.width/2,y:t.bounds.y+t.node.localBounds.height/2+t.border}},ve=function(e){var t=e.item;return{x:t.bounds.x-t.bounds.width,y:t.bounds.y+t.node.localBounds.height/2+t.border}},be=function(e){var t=e.item;return{x:t.bounds.x-t.bounds.width-t.node.localBounds.width/2-t.border,y:t.bounds.y-t.bounds.height/2}},xe=function(e){var t=e.item;return{x:t.bounds.x-t.bounds.width,y:t.bounds.y-t.bounds.height-t.node.localBounds.height/2-t.border}},we=[ne.TOP,ne.TOP_LEFT,ne.TOP_RIGHT],Se=[ne.BOTTOM,ne.BOTTOM_LEFT,ne.BOTTOM_RIGHT];function Me(e){var t=e.position,n={x:2.5,width:-5,y:0,height:0},r=we.indexOf(t)>-1,i=Se.indexOf(t)>-1;return r&&(n.y=4,n.height=-4),i&&(n.height=-4),n}function ke(e){var t=e.cx,n=e.cy,r=e.r,i=e.degrees*(Math.PI/180);return{x:Math.round(t+r*Math.sin(i)),y:Math.round(n+r*-Math.cos(i))}}function Ee(e){var t=e.coordinates,n=e.degrees,r=e.item,i={x:t.x,y:t.y};return n<=90?i.y-=r.bounds.height:n>180&&n<=270?i.x-=r.bounds.width:n>270&&(i.y-=r.bounds.height,i.x-=r.bounds.width),i}function Ce(e){var t=e.item,n=e.validator,r=e.force,i=void 0!==r&&r,o=x(x(x(x(x(x(x(x({},ne.TOP,pe),ne.TOP_RIGHT,he),ne.RIGHT,me),ne.BOTTOM_RIGHT,ge),ne.BOTTOM,ye),ne.BOTTOM_LEFT,ve),ne.LEFT,be),ne.TOP_LEFT,xe);if(t.fixedPlacement)return o[t.fixedPlacement]({item:t});for(var a=[].concat(A(t.preferences),A(Object.keys(ne).map((function(e){return ne[e]})).filter((function(e){return-1===t.preferences.indexOf(e)})))),s=[],l=0;l<a.length;l++){var c=a[l],u=o[c]({item:t}),d=Me({position:c}),f=n({item:t,placement:u,adjustment:d,ignoreLines:i});if(i&&f.inside&&s.push(u),f.valid)return u}var p=function(){return function(e){for(var t=e.item,n=e.validator,r=e.force,i=void 0!==r&&r,o=function(e){return[e.item.node.localBounds.height/2*Math.sqrt(2)]}({item:t}),a=t.bounds.x,s=t.bounds.y,l=0;l<o.length;l++){for(var c=o[l],u=40;u<=180;u+=15){var d=Ee({coordinates:ke({cx:a,cy:s,r:c,degrees:u}),degrees:u,item:t});if(n({item:t,placement:d,ignoreLines:i}).valid)return d}for(var f=320;f>180;f-=15){var p=Ee({coordinates:ke({cx:a,cy:s,r:c,degrees:f}),degrees:f,item:t});if(n({item:t,placement:p,ignoreLines:i}).valid)return p}}return!1}({item:t,validator:n,force:i})};return i?p()||s[0]||void 0:(t.extreme||t.elite)&&p()||void 0}function Ae(e){var t=e.configs,n=e.crossPlacements,r=e.model,i=e.size,o=e.all,a={},s=r.getItems(),l=[].concat(A(s.map((function(e){return{x:e.node.localBounds.x-e.border+1,y:e.node.localBounds.y-e.border+1,height:e.node.localBounds.height+2*e.border-2,width:e.node.localBounds.width+2*e.border-2}}))),A(n.getPlacements({configs:t}))),c=[],u=r.getLines();s.forEach((function(e){var t=e.node.data;if(!(!e.show||!e.inside||t.null&&t.null.value||t.interpolated&&t.interpolated.value)){var n=e.key;if(!a[n]||e.config.duplicates){a[n]=!0;var r=function(e){var t=e.size,n=e.lines,r=e.placements;return function(e){var i=e.item,o=e.placement,a=e.adjustment,s=void 0===a?fe:a,l=e.ignoreLines,c=void 0!==l&&l,u={inside:ue({item:i,placement:o,size:t}),collides:!0,valid:!1};return u.inside?(u.collides=function(e){var t=e.candidate,n=e.lines;return!!e.rects.some((function(e){return function(e){var t=e.rect1,n=e.rect2;return!(n.x>t.x+t.width||n.x+n.width<t.x||n.y>t.y+t.height||n.y+n.height<t.y)}({rect1:e,rect2:t})}))||n.some((function(e){return function(e){var t=e.line,n=e.rect,r={x:n.x,y:n.y},i={x:n.x+n.width,y:n.y},o={x:n.x+n.width,y:n.y+n.height},a={x:n.x,y:n.y+n.height},s={x1:i.x,y1:i.y,x2:o.x,y2:o.y},l={x1:o.x,y1:o.y,x2:a.x,y2:a.y},c={x1:a.x,y1:a.y,x2:r.x,y2:r.y};return de({line1:t,line2:{x1:r.x,y1:r.y,x2:i.x,y2:i.y}})||de({line1:t,line2:s})||de({line1:t,line2:l})||de({line1:t,line2:c})}({line:e,rect:t})}))}({candidate:{x:o.x+s.x,y:o.y+s.y,width:i.bounds.width+s.width,height:i.bounds.height+s.height},lines:c?[]:n,rects:r}),u.valid=!u.collides,u):u}}({size:i,lines:u,placements:l}),s=Ce({item:e,validator:r});s?(s.height=e.bounds.height,s.width=e.bounds.width,l.push(s),e.setPlacement(s)):o&&c.push({item:e,validator:r})}else e.setDuplicate()}})),c.forEach((function(e){var t=e.item,n=Ce({item:t,validator:e.validator,force:!0});n&&(n.height=t.bounds.height,n.width=t.bounds.width,l.push(n),t.setPlacement(n))}))}var De={require:["chart","renderer"],defaultSettings:{settings:{orientation:"horizontal",rtl:!1,all:!1,label:function(){},showLabel:function(){return!0},pointValue:function(){},majorValue:function(){},lineId:function(){},enabled:function(){return!0},configs:[],insideStrategy:"edge",labelSpace:{use:function(){return!1},size:10},cache:void 0},style:{fontFamily:'"Source Sans Pro", "Arial", "sans-serif"',fontSize:"12px",fill:"#333"}},created:function(){var e,t,n,r,i,o;this.crossPlacements=(e={cache:this.settings.settings.cache,key:this.settings.key},i=e.key,o={isPrimary:!1},null!=(r=e.cache)&&null!==(t=r.has)&&void 0!==t&&t.call(r,T)||(o.isPrimary=!0,null==r||null===(n=r.set)||void 0===n||n.call(r,T,{})),{reset:function(){var e,t=null==r||null===(e=r.get)||void 0===e?void 0:e.call(r,T);t&&(o.isPrimary&&Object.keys(t).forEach((function(e){return delete t[e]})),t[i]=[])},setPlacement:function(e){var t,n=null==r||null===(t=r.get)||void 0===t?void 0:t.call(r,T);n&&n[i].push(e)},getPlacements:function(e){var t,n=e.configs,o=null==r||null===(t=r.get)||void 0===t?void 0:t.call(r,T);if(!o)return[];var a=[],s=n.getCollection().filter((function(e){return!e.labels&&!!e.labelKeys.length})).reduce((function(e,t){return e.push.apply(e,A(t.labelKeys)),e}),[]);return Object.keys(o).forEach((function(e){e!==i&&s.some((function(t){return t===e}))&&a.push.apply(a,A(o[e]))})),a}})},preferredSize:function(){var e={edgeBleed:{top:0,right:0,left:0}},t=this.settings.settings,n=t.orientation,r=t.rtl,i=t.labelSpace,o=i.use,a=i.size;if(o()){var s="horizontal"===n;e.edgeBleed.top=s?a:0,e.edgeBleed[r?"left":"right"]=s?0:a}return e},render:function(){this.crossPlacements.reset();var e=this.settings.settings;if(!(0,e.enabled)())return[];var t=function(){var e=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}).configs,t=void 0===e?[]:e,n={},r=[];return t.forEach((function(e){var t=e.key;n[t]={labels:void 0===e.labels||e.labels,labelKeys:Array.isArray(e.labelKeys)?e.labelKeys:[],lines:void 0===e.lines||e.lines,fixed:void 0!==e.fixed&&e.fixed,duplicates:void 0!==e.duplicates&&e.duplicates},r.push(n[t])})),{meta:{allKeys:t.map((function(e){return e.key}))},getCollection:function(){return r},get:function(e){return n[e]},getFirstLabelKey:function(){var e;return null===(e=t.find((function(e){return e.labels})))||void 0===e?void 0:e.key}}}({configs:e.configs}),n=t.getFirstLabelKey();if(!n)return[];if(!this.chart.component(n))return[];var r=this.chart.findShapes("circle, path, rect").filter((function(e){return t.meta.allKeys.includes(e.key)}));if(!r.length)return[];var i="horizontal"===e.orientation,o=i?"x":"y";r.sort((function(e,t){return e.localBounds[o]-t.localBounds[o]}));var a={label:e.label,pointValue:e.pointValue,majorValue:e.majorValue,lineId:e.lineId},s=this.rect,l={height:s.height,width:s.width,edgeBleed:s.edgeBleed,insideStrategy:e.insideStrategy},c=this.crossPlacements,u=this.style,d=ce({configs:t,crossPlacements:c,nodes:r,extract:a,style:u,measureText:this.renderer.measureText,size:l,horizontal:i,rtl:e.rtl,showLabel:e.showLabel});({model:d}).model.getItems().sort((function(e,t){return e.extreme===t.extreme?0:e.extreme&&!t.extreme?-1:1})),Ae({configs:t,crossPlacements:c,model:d,size:l,all:e.all});var f=d.getItems(),p=[];f.filter((function(e){return e.placement})).forEach((function(e){var t,n,r,i,o,s=null!==(t=e.node.data.value)&&void 0!==t&&t.hasBackground?2:0,l=null!==(n=e.node.data.value)&&void 0!==n&&n.hasBackground?2:0,c=(null===(r=e.node.data.value)||void 0===r||null===(r=r.style)||void 0===r||null===(r=r.label)||void 0===r?void 0:r.fontSize)||u.fontSize,d=(null===(i=e.node.data.value)||void 0===i||null===(i=i.style)||void 0===i||null===(i=i.label)||void 0===i?void 0:i.fontFamily)||u.fontFamily,f=(null===(o=e.node.data.value)||void 0===o?void 0:o.labelColor)||u.fill;e.labelMeasurements.lines?e.labelMeasurements.lines.forEach((function(t,n){p.push({type:"text",x:e.placement.x+e.placement.width/2,y:e.placement.y+(n+.5)*t.size.height+s+l,fontSize:c,fontFamily:d,fill:f,text:t.text,data:e.node.data.value,baseline:"central",anchor:"middle"})})):p.push({type:"text",x:e.placement.x+e.placement.width/2,y:e.placement.y+e.labelMeasurements.height/2+s+l,fontSize:c,fontFamily:d,fill:f,text:a.label(e.node.data),data:e.node.data.value,baseline:"central",anchor:"middle"})}));var h=f.filter((function(e){var t;return e.placement&&(null===(t=e.node.data.value)||void 0===t?void 0:t.hasBackground)})).map((function(e){var t;return{type:"rect",x:e.placement.x+2,y:e.placement.y+2,rx:3,ry:3,fill:null===(t=e.node.data.value)||void 0===t?void 0:t.labelBackgroundColor,width:e.placement.width-4,height:e.placement.height-4,data:e.node.data.value}}));return[].concat(A(h),p)}},qe=["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"],Te=["Abril Fatface, serif","Bangers, fantasy","Bebas Neue, sans serif","EB Garamond, serif","Fredoka One, fantasy","Graduate, fantasy","Gravitas One, serif","Indie Flower, fantasy","Inter, sans-serif","Lobster, fantasy","Montserrat, sans-serif","Nixie One, sans-serif","Noto Sans, sans-serif","Open Sans, sans-serif","PT Serif, serif","Pacifico, cursive","Permanent Marker, fantasy","QlikView Sans, sans-serif","Raleway, sans-serif","Rammetto One, fantasy","Roboto, sans-serif","Source Sans Pro, sans-serif","Titan One, fantasy","Yanone Kaffeesatz, sans-serif"];var _e=function(e){return{value:e,label:e.charAt(0).toUpperCase()+e.slice(1),groupHeader:!1,disabled:!1,styles:{fontFamily:e}}};function Ne(e){var t=e.theme,n=e.translator,r=e.defaultValue,i=e.flags,o=[],a=t.getStyle("","","fontFamilies");return Array.isArray(a)&&a.length?o.push.apply(o,A(new Set([r].concat(A(a.map((function(e){return e.split(",").map((function(e){return e.trim()})).map((function(e){return e.replace(/\s+/g," ").trim()})).filter(Boolean).join(", ")}))))))):o.push(r),[{value:"ThemeHeader",label:n.get("properties.themeFonts"),metaText:n.get("properties.theme"),groupHeader:!0}].concat(A(o.map((function(e){return _e(e)}))),[{value:"DefaultHeader",label:n.get("properties.allFonts"),metaText:n.get("properties.default"),groupHeader:!0}],A(function(e){return null!=e&&e.isEnabled("PS_20852_WYSIWYG_FONT_SUPPORT")?Te:qe}(i).map((function(e){return _e(e)}))))}function Oe(e){var t=e.theme,n=e.translator,r=e.id,i=e.path,o=e.flags,a=function(){return t.getStyle(r,i,"fontFamily")};return{getDefaultValue:function(){return a()},getOptions:function(){return Ne({theme:t,translator:n,defaultValue:a(),flags:o})}}}var Ie,Pe,Re=["10px","11px","12px","13px","14px","15px","16px","17px","18px","19px","20px","21px","22px","23px","24px"],Le=function(e){return{value:e,label:e,groupHeader:!1,disabled:!1}};function ze(e){var t=e.theme,n=e.translator,r=e.id,i=e.path,o=function(){return t.getStyle(r,i,"fontSize")};return{getDefaultValue:function(){return o()},getOptions:function(){return function(e){var t=e.translator,n=e.defaultValue,r=[],i=e.theme.getStyle("","","fontSizes");return Array.isArray(i)&&i.length?r.push.apply(r,A(new Set([n].concat(A(i))))):r.push(n),[{value:"ThemeHeader",label:t.get("properties.themeFontSizes"),metaText:t.get("properties.theme"),groupHeader:!0}].concat(A(r.map((function(e){return Le(e)}))),[{value:"DefaultHeader",label:t.get("properties.allFontSizes"),metaText:t.get("properties.default"),groupHeader:!0}],A(Re.map((function(e){return Le(e)}))))}({theme:t,translator:n,defaultValue:o()})}}}function Fe(e){var t=e.theme,n=e.translator,r=e.id,i=e.path;return{fontFamily:Oe({theme:t,translator:n,id:r,path:i,flags:e.flags}),fontSize:ze({theme:t,translator:n,id:r,path:i})}}function je(e){return Ve.apply(this,arguments)}function Ve(){return(Ve=b(k().m((function e(t){var n,r,i,o;return k().w((function(e){for(;;)switch(e.n){case 0:if(n=t.app,r=t.items,n.evaluate){e.n=1;break}return e.a(2,r);case 1:return e.n=2,Promise.all(r.filter((function(e){var t;return!(null===(t=e.qCalcCondition)||void 0===t||null===(t=t.qCond)||void 0===t||!t.qv)})).map((function(e){var t=e.qCalcCondition.qCond.qv;return n.evaluate(t).then((function(t){return"0"===t?e.qDef.cId:void 0})).catch((function(){return e.qDef.cId}))})));case 2:return i=e.v,o=i.filter(Boolean),e.a(2,r.filter((function(e){return!o.includes(e.qDef.cId)})))}}),e)})))).apply(this,arguments)}function He(e){var t=e.app,n=e.translator,r=e.dimension,i={id:r.qDef.cId,text:n.get("Object.ErrorMessage.MissingDimension"),meta:{}},o=r.qLibraryId;if(o)return t.getDimension?t.getDimension(o).then((function(e){return e.getLayout()})).catch((function(){})).then((function(e){if(!e)return i;var t=e.qDim,n=t.qGrouping,o=t.qLabelExpression,a="C"===n,s="H"===n,l="N"===n;return{id:r.qDef.cId,text:o&&l?o:e.qDim.title,meta:{isCyclic:a,isDrillDown:s,isNormal:l}}})):i;var a=r.qDef,s=a.cId,l=a.qLabelExpression,c=a.qFieldLabels,u=a.qFieldDefs,d={isCyclic:!1,isDrillDown:!1,isNormal:!0};return l?t.evaluate?t.evaluate(l).then((function(e){return{id:s,text:e,meta:d}})):i:{id:s,text:c[0]||u[0],meta:d}}function Be(e){return $e.apply(this,arguments)}function $e(){return($e=b(k().m((function e(t){var n,r,i,o,a,s,l,c;return k().w((function(e){for(;;)switch(e.n){case 0:if(r=t.app,i=t.translator,o=t.properties,a=(null==o||null===(n=o.qHyperCubeDef)||void 0===n||null===(n=n.qLayoutExclude)||void 0===n?void 0:n.qHyperCubeDef)||{},s=a.qDimensions,(l=void 0===s?[]:s).length){e.n=1;break}return e.a(2,Promise.resolve([]));case 1:return e.n=2,je({app:r,items:l});case 2:return c=e.v,e.a(2,Promise.all(c.map((function(e){return He({app:r,translator:i,dimension:e})}))))}}),e)})))).apply(this,arguments)}function We(e){var t=e.app,n=e.translator,r=e.measure,i={id:r.qDef.cId,text:n.get("Object.ErrorMessage.MissingMeasure")},o=r.qLibraryId;if(o)return t.getMeasure?t.getMeasure(o).then((function(e){return e.getLayout()})).catch((function(){})).then((function(e){if(!e)return i;var t=e.qMeasure.qLabelExpression;return{id:r.qDef.cId,text:t||e.qMeasure.qLabel||e.qMeasure.qDef}})):i;var a=r.qDef,s=a.cId,l=a.qLabelExpression,c=a.qLabel,u=a.qDef;return l?t.evaluate?t.evaluate(l).then((function(e){return{id:s,text:e}})):i:{id:s,text:c||u}}function Ue(e){return Ye.apply(this,arguments)}function Ye(){return(Ye=b(k().m((function e(t){var n,r,i,o,a,s,l,c;return k().w((function(e){for(;;)switch(e.n){case 0:if(r=t.app,i=t.translator,o=t.properties,a=(null==o||null===(n=o.qHyperCubeDef)||void 0===n||null===(n=n.qLayoutExclude)||void 0===n?void 0:n.qHyperCubeDef)||{},s=a.qMeasures,(l=void 0===s?[]:s).length){e.n=1;break}return e.a(2,Promise.resolve([]));case 1:return e.n=2,je({app:r,items:l});case 2:return c=e.v,e.a(2,Promise.all(c.map((function(e){return We({app:r,translator:i,measure:e})}))))}}),e)})))).apply(this,arguments)}var Xe=function(){if(Pe)return Ie;Pe=1;var e=Object.prototype.hasOwnProperty,t=Object.prototype.toString,n=Object.defineProperty,r=Object.getOwnPropertyDescriptor,i=function(e){return"function"==typeof Array.isArray?Array.isArray(e):"[object Array]"===t.call(e)},o=function(n){if(!n||"[object Object]"!==t.call(n))return!1;var r,i=e.call(n,"constructor"),o=n.constructor&&n.constructor.prototype&&e.call(n.constructor.prototype,"isPrototypeOf");if(n.constructor&&!i&&!o)return!1;for(r in n);return void 0===r||e.call(n,r)},a=function(e,t){n&&"__proto__"===t.name?n(e,t.name,{enumerable:!0,configurable:!0,value:t.newValue,writable:!0}):e[t.name]=t.newValue},s=function(t,n){if("__proto__"===n){if(!e.call(t,n))return;if(r)return r(t,n).value}return t[n]};return Ie=function e(){var t,n,r,l,c,u,d=arguments[0],f=1,p=arguments.length,h=!1;for("boolean"==typeof d&&(h=d,d=arguments[1]||{},f=2),(null==d||"object"!=typeof d&&"function"!=typeof d)&&(d={});f<p;++f)if(null!=(t=arguments[f]))for(n in t)r=s(d,n),d!==(l=s(t,n))&&(h&&l&&(o(l)||(c=i(l)))?(c?(c=!1,u=r&&i(r)?r:[]):u=r&&o(r)?r:{},a(d,{name:n,newValue:e(h,u,l)})):void 0!==l&&a(d,{name:n,newValue:l}));return d},Ie}(),