@antv/component 1.0.2 → 1.0.3
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/dist/component.min.js +1 -1
- package/esm/animation/fadeIn.d.ts +1 -1
- package/esm/animation/fadeOut.d.ts +1 -1
- package/esm/animation/utils.d.ts +3 -3
- package/esm/core/component.d.ts +1 -0
- package/esm/core/component.js +5 -1
- package/esm/core/component.js.map +1 -1
- package/esm/ui/axis/axis.d.ts +1 -1
- package/esm/ui/axis/guides/grid.d.ts +1 -1
- package/esm/ui/axis/guides/labels.d.ts +1 -1
- package/esm/ui/axis/guides/ticks.d.ts +1 -1
- package/esm/ui/axis/guides/title.d.ts +1 -1
- package/esm/ui/checkbox/constant.d.ts +3 -3
- package/esm/ui/grid/index.d.ts +1 -1
- package/esm/ui/legend/base.d.ts +1 -1
- package/esm/ui/legend/category/item.js +14 -5
- package/esm/ui/legend/category/item.js.map +1 -1
- package/esm/ui/marker/index.js +1 -1
- package/esm/ui/marker/index.js.map +1 -1
- package/esm/ui/timebar/icons.d.ts +2 -2
- package/esm/util/keyframe-interpolate.d.ts +1 -1
- package/esm/util/number.d.ts +2 -2
- package/esm/util/text.d.ts +6 -1
- package/lib/animation/fadeIn.d.ts +1 -1
- package/lib/animation/fadeOut.d.ts +1 -1
- package/lib/animation/utils.d.ts +3 -3
- package/lib/core/component.d.ts +1 -0
- package/lib/core/component.js +4 -0
- package/lib/core/component.js.map +1 -1
- package/lib/ui/axis/axis.d.ts +1 -1
- package/lib/ui/axis/guides/grid.d.ts +1 -1
- package/lib/ui/axis/guides/labels.d.ts +1 -1
- package/lib/ui/axis/guides/ticks.d.ts +1 -1
- package/lib/ui/axis/guides/title.d.ts +1 -1
- package/lib/ui/checkbox/constant.d.ts +3 -3
- package/lib/ui/grid/index.d.ts +1 -1
- package/lib/ui/legend/base.d.ts +1 -1
- package/lib/ui/legend/category/item.js +14 -5
- package/lib/ui/legend/category/item.js.map +1 -1
- package/lib/ui/marker/index.js +1 -1
- package/lib/ui/marker/index.js.map +1 -1
- package/lib/ui/timebar/icons.d.ts +2 -2
- package/lib/util/keyframe-interpolate.d.ts +1 -1
- package/lib/util/number.d.ts +2 -2
- package/lib/util/text.d.ts +6 -1
- package/package.json +2 -1
- package/src/core/component.ts +5 -0
- package/src/ui/legend/category/item.ts +12 -5
- package/src/ui/marker/index.ts +1 -1
package/dist/component.min.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e(require("@antv/g")):"function"==typeof define&&define.amd?define(["@antv/g"],e):"object"==typeof exports?exports.Component=e(require("@antv/g")):t.Component=e(t.G)}(self,(t=>(()=>{var e={867:t=>{"use strict";t.exports={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]}},629:(t,e,n)=>{var i=n(867),r=n(984),s=Object.hasOwnProperty,a=Object.create(null);for(var o in i)s.call(i,o)&&(a[i[o]]=o);var l=t.exports={to:{},get:{}};function c(t,e,n){return Math.min(Math.max(e,t),n)}function u(t){var e=Math.round(t).toString(16).toUpperCase();return e.length<2?"0"+e:e}l.get=function(t){var e,n;switch(t.substring(0,3).toLowerCase()){case"hsl":e=l.get.hsl(t),n="hsl";break;case"hwb":e=l.get.hwb(t),n="hwb";break;default:e=l.get.rgb(t),n="rgb"}return e?{model:n,value:e}:null},l.get.rgb=function(t){if(!t)return null;var e,n,r,a=[0,0,0,1];if(e=t.match(/^#([a-f0-9]{6})([a-f0-9]{2})?$/i)){for(r=e[2],e=e[1],n=0;n<3;n++){var o=2*n;a[n]=parseInt(e.slice(o,o+2),16)}r&&(a[3]=parseInt(r,16)/255)}else if(e=t.match(/^#([a-f0-9]{3,4})$/i)){for(r=(e=e[1])[3],n=0;n<3;n++)a[n]=parseInt(e[n]+e[n],16);r&&(a[3]=parseInt(r+r,16)/255)}else if(e=t.match(/^rgba?\(\s*([+-]?\d+)(?=[\s,])\s*(?:,\s*)?([+-]?\d+)(?=[\s,])\s*(?:,\s*)?([+-]?\d+)\s*(?:[,|\/]\s*([+-]?[\d\.]+)(%?)\s*)?\)$/)){for(n=0;n<3;n++)a[n]=parseInt(e[n+1],0);e[4]&&(e[5]?a[3]=.01*parseFloat(e[4]):a[3]=parseFloat(e[4]))}else{if(!(e=t.match(/^rgba?\(\s*([+-]?[\d\.]+)\%\s*,?\s*([+-]?[\d\.]+)\%\s*,?\s*([+-]?[\d\.]+)\%\s*(?:[,|\/]\s*([+-]?[\d\.]+)(%?)\s*)?\)$/)))return(e=t.match(/^(\w+)$/))?"transparent"===e[1]?[0,0,0,0]:s.call(i,e[1])?((a=i[e[1]])[3]=1,a):null:null;for(n=0;n<3;n++)a[n]=Math.round(2.55*parseFloat(e[n+1]));e[4]&&(e[5]?a[3]=.01*parseFloat(e[4]):a[3]=parseFloat(e[4]))}for(n=0;n<3;n++)a[n]=c(a[n],0,255);return a[3]=c(a[3],0,1),a},l.get.hsl=function(t){if(!t)return null;var e=t.match(/^hsla?\(\s*([+-]?(?:\d{0,3}\.)?\d+)(?:deg)?\s*,?\s*([+-]?[\d\.]+)%\s*,?\s*([+-]?[\d\.]+)%\s*(?:[,|\/]\s*([+-]?(?=\.\d|\d)(?:0|[1-9]\d*)?(?:\.\d*)?(?:[eE][+-]?\d+)?)\s*)?\)$/);if(e){var n=parseFloat(e[4]);return[(parseFloat(e[1])%360+360)%360,c(parseFloat(e[2]),0,100),c(parseFloat(e[3]),0,100),c(isNaN(n)?1:n,0,1)]}return null},l.get.hwb=function(t){if(!t)return null;var e=t.match(/^hwb\(\s*([+-]?\d{0,3}(?:\.\d+)?)(?:deg)?\s*,\s*([+-]?[\d\.]+)%\s*,\s*([+-]?[\d\.]+)%\s*(?:,\s*([+-]?(?=\.\d|\d)(?:0|[1-9]\d*)?(?:\.\d*)?(?:[eE][+-]?\d+)?)\s*)?\)$/);if(e){var n=parseFloat(e[4]);return[(parseFloat(e[1])%360+360)%360,c(parseFloat(e[2]),0,100),c(parseFloat(e[3]),0,100),c(isNaN(n)?1:n,0,1)]}return null},l.to.hex=function(){var t=r(arguments);return"#"+u(t[0])+u(t[1])+u(t[2])+(t[3]<1?u(Math.round(255*t[3])):"")},l.to.rgb=function(){var t=r(arguments);return t.length<4||1===t[3]?"rgb("+Math.round(t[0])+", "+Math.round(t[1])+", "+Math.round(t[2])+")":"rgba("+Math.round(t[0])+", "+Math.round(t[1])+", "+Math.round(t[2])+", "+t[3]+")"},l.to.rgb.percent=function(){var t=r(arguments),e=Math.round(t[0]/255*100),n=Math.round(t[1]/255*100),i=Math.round(t[2]/255*100);return t.length<4||1===t[3]?"rgb("+e+"%, "+n+"%, "+i+"%)":"rgba("+e+"%, "+n+"%, "+i+"%, "+t[3]+")"},l.to.hsl=function(){var t=r(arguments);return t.length<4||1===t[3]?"hsl("+t[0]+", "+t[1]+"%, "+t[2]+"%)":"hsla("+t[0]+", "+t[1]+"%, "+t[2]+"%, "+t[3]+")"},l.to.hwb=function(){var t=r(arguments),e="";return t.length>=4&&1!==t[3]&&(e=", "+t[3]),"hwb("+t[0]+", "+t[1]+"%, "+t[2]+"%"+e+")"},l.to.keyword=function(t){return a[t.slice(0,3)]}},119:t=>{t.exports=function(t){return!(!t||"string"==typeof t)&&(t instanceof Array||Array.isArray(t)||t.length>=0&&(t.splice instanceof Function||Object.getOwnPropertyDescriptor(t,t.length-1)&&"String"!==t.constructor.name))}},984:(t,e,n)=>{"use strict";var i=n(119),r=Array.prototype.concat,s=Array.prototype.slice,a=t.exports=function(t){for(var e=[],n=0,a=t.length;n<a;n++){var o=t[n];i(o)?e=r.call(e,s.call(o)):e.push(o)}return e};a.wrap=function(t){return function(){return t(a(arguments))}}},271:(t,e,n)=>{var i=n(421).parse;i.parseSVG=i,i.makeAbsolute=function(t){var e,n={x:0,y:0},i={x:"x0",y:"y0",x1:"x0",y1:"y0",x2:"x0",y2:"y0"};return t.forEach((function(t){for(var r in"moveto"===t.command&&(e=t),t.x0=n.x,t.y0=n.y,i)r in t&&(t[r]+=t.relative?t[i[r]]:0);"x"in t||(t.x=n.x),"y"in t||(t.y=n.y),t.relative=!1,t.code=t.code.toUpperCase(),"closepath"==t.command&&(t.x=e.x,t.y=e.y),n=t})),t},t.exports=i},421:t=>{"use strict";function e(t,n,i,r){this.message=t,this.expected=n,this.found=i,this.location=r,this.name="SyntaxError","function"==typeof Error.captureStackTrace&&Error.captureStackTrace(this,e)}!function(t,e){function n(){this.constructor=t}n.prototype=e.prototype,t.prototype=new n}(e,Error),e.buildMessage=function(t,e){var n={literal:function(t){return'"'+r(t.text)+'"'},class:function(t){var e,n="";for(e=0;e<t.parts.length;e++)n+=t.parts[e]instanceof Array?s(t.parts[e][0])+"-"+s(t.parts[e][1]):s(t.parts[e]);return"["+(t.inverted?"^":"")+n+"]"},any:function(t){return"any character"},end:function(t){return"end of input"},other:function(t){return t.description}};function i(t){return t.charCodeAt(0).toString(16).toUpperCase()}function r(t){return t.replace(/\\/g,"\\\\").replace(/"/g,'\\"').replace(/\0/g,"\\0").replace(/\t/g,"\\t").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/[\x00-\x0F]/g,(function(t){return"\\x0"+i(t)})).replace(/[\x10-\x1F\x7F-\x9F]/g,(function(t){return"\\x"+i(t)}))}function s(t){return t.replace(/\\/g,"\\\\").replace(/\]/g,"\\]").replace(/\^/g,"\\^").replace(/-/g,"\\-").replace(/\0/g,"\\0").replace(/\t/g,"\\t").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/[\x00-\x0F]/g,(function(t){return"\\x0"+i(t)})).replace(/[\x10-\x1F\x7F-\x9F]/g,(function(t){return"\\x"+i(t)}))}return"Expected "+function(t){var e,i,r,s=new Array(t.length);for(e=0;e<t.length;e++)s[e]=(r=t[e],n[r.type](r));if(s.sort(),s.length>0){for(e=1,i=1;e<s.length;e++)s[e-1]!==s[e]&&(s[i]=s[e],i++);s.length=i}switch(s.length){case 1:return s[0];case 2:return s[0]+" or "+s[1];default:return s.slice(0,-1).join(", ")+", or "+s[s.length-1]}}(t)+" but "+function(t){return t?'"'+r(t)+'"':"end of input"}(e)+" found."},t.exports={SyntaxError:e,parse:function(t,n){n=void 0!==n?n:{};var i,r={},s={svg_path:gt},a=gt,o=function(t){if(!t)return[];for(var e=[],n=0;n<t.length;n++)e=e.concat.apply(e,t[n]);var i=e[0];return i&&"m"==i.code&&(delete i.relative,i.code="M"),e},l=function(t,e){return function(t,e){if(!e)return[t];for(var n=[t],i=0,r=e.length;i<r;i++)n[i+1]=e[i][1];return n}(t,e)},c=/^[Mm]/,u=ht(["M","m"],!1,!1),h=function(t,e,n){var i=Ht(t,[e]);return n&&(i=i.concat(Ht("M"==t?"L":"l",n[1]))),i},d=/^[Zz]/,p=ht(["Z","z"],!1,!1),f=function(){return Ht("Z")},g=/^[Ll]/,m=ht(["L","l"],!1,!1),y=function(t,e){return Ht(t,e)},b=/^[Hh]/,v=ht(["H","h"],!1,!1),x=function(t,e){return Ht(t,e.map((function(t){return{x:t}})))},w=/^[Vv]/,S=ht(["V","v"],!1,!1),k=function(t,e){return Ht(t,e.map((function(t){return{y:t}})))},A=/^[Cc]/,L=ht(["C","c"],!1,!1),P=function(t,e,n){return{x1:t.x,y1:t.y,x2:e.x,y2:e.y,x:n.x,y:n.y}},E=/^[Ss]/,B=ht(["S","s"],!1,!1),C=function(t,e){return{x2:t.x,y2:t.y,x:e.x,y:e.y}},M=/^[Qq]/,O=ht(["Q","q"],!1,!1),T=function(t,e){return{x1:t.x,y1:t.y,x:e.x,y:e.y}},j=/^[Tt]/,N=ht(["T","t"],!1,!1),_=/^[Aa]/,z=ht(["A","a"],!1,!1),I=function(t,e,n,i,r,s){return{rx:t,ry:e,xAxisRotation:n,largeArc:i,sweep:r,x:s.x,y:s.y}},F=function(t,e){return{x:t,y:e}},G=function(t){return 1*t},H=function(t){return 1*t.join("")},V=/^[01]/,W=ht(["0","1"],!1,!1),D=function(t){return"1"==t},R=function(){return""},Y=",",q=ut(",",!1),K=function(t){return t.join("")},Z=".",U=ut(".",!1),$=/^[eE]/,X=ht(["e","E"],!1,!1),J=/^[+\-]/,Q=ht(["+","-"],!1,!1),tt=/^[0-9]/,et=ht([["0","9"]],!1,!1),nt=function(t){return t.join("")},it=/^[ \t\n\r]/,rt=ht([" ","\t","\n","\r"],!1,!1),st=0,at=[{line:1,column:1}],ot=0,lt=[],ct=0;if("startRule"in n){if(!(n.startRule in s))throw new Error("Can't start parsing from rule \""+n.startRule+'".');a=s[n.startRule]}function ut(t,e){return{type:"literal",text:t,ignoreCase:e}}function ht(t,e,n){return{type:"class",parts:t,inverted:e,ignoreCase:n}}function dt(e){var n,i=at[e];if(i)return i;for(n=e-1;!at[n];)n--;for(i={line:(i=at[n]).line,column:i.column};n<e;)10===t.charCodeAt(n)?(i.line++,i.column=1):i.column++,n++;return at[e]=i,i}function pt(t,e){var n=dt(t),i=dt(e);return{start:{offset:t,line:n.line,column:n.column},end:{offset:e,line:i.line,column:i.column}}}function ft(t){st<ot||(st>ot&&(ot=st,lt=[]),lt.push(t))}function gt(){var t,e,n,i,s;for(t=st,e=[],n=Nt();n!==r;)e.push(n),n=Nt();if(e!==r)if(n=function(){var t,e,n,i,s,a;if(t=st,(e=mt())!==r){for(n=[],i=st,s=[],a=Nt();a!==r;)s.push(a),a=Nt();for(s!==r&&(a=mt())!==r?i=s=[s,a]:(st=i,i=r);i!==r;){for(n.push(i),i=st,s=[],a=Nt();a!==r;)s.push(a),a=Nt();s!==r&&(a=mt())!==r?i=s=[s,a]:(st=i,i=r)}n!==r?t=e=l(e,n):(st=t,t=r)}else st=t,t=r;return t}(),n===r&&(n=null),n!==r){for(i=[],s=Nt();s!==r;)i.push(s),s=Nt();i!==r?t=e=o(n):(st=t,t=r)}else st=t,t=r;else st=t,t=r;return t}function mt(){var e,n,i,s,a,o;if(e=st,n=function(){var e,n,i,s,a,o,l;if(e=st,c.test(t.charAt(st))?(n=t.charAt(st),st++):(n=r,0===ct&&ft(u)),n!==r){for(i=[],s=Nt();s!==r;)i.push(s),s=Nt();i!==r&&(s=At())!==r?(a=st,(o=Bt())===r&&(o=null),o!==r&&(l=bt())!==r?a=o=[o,l]:(st=a,a=r),a===r&&(a=null),a!==r?e=n=h(n,s,a):(st=e,e=r)):(st=e,e=r)}else st=e,e=r;return e}(),n!==r){for(i=[],s=st,a=[],o=Nt();o!==r;)a.push(o),o=Nt();for(a!==r&&(o=yt())!==r?s=a=[a,o]:(st=s,s=r);s!==r;){for(i.push(s),s=st,a=[],o=Nt();o!==r;)a.push(o),o=Nt();a!==r&&(o=yt())!==r?s=a=[a,o]:(st=s,s=r)}i!==r?e=n=l(n,i):(st=e,e=r)}else st=e,e=r;return e}function yt(){var e,n;return d.test(t.charAt(st))?(n=t.charAt(st),st++):(n=r,0===ct&&ft(p)),n!==r&&(n=f()),(e=n)===r&&(e=function(){var e,n,i,s;if(e=st,g.test(t.charAt(st))?(n=t.charAt(st),st++):(n=r,0===ct&&ft(m)),n!==r){for(i=[],s=Nt();s!==r;)i.push(s),s=Nt();i!==r&&(s=bt())!==r?e=n=y(n,s):(st=e,e=r)}else st=e,e=r;return e}())===r&&(e=function(){var e,n,i,s;if(e=st,b.test(t.charAt(st))?(n=t.charAt(st),st++):(n=r,0===ct&&ft(v)),n!==r){for(i=[],s=Nt();s!==r;)i.push(s),s=Nt();i!==r&&(s=vt())!==r?e=n=x(n,s):(st=e,e=r)}else st=e,e=r;return e}())===r&&(e=function(){var e,n,i,s;if(e=st,w.test(t.charAt(st))?(n=t.charAt(st),st++):(n=r,0===ct&&ft(S)),n!==r){for(i=[],s=Nt();s!==r;)i.push(s),s=Nt();i!==r&&(s=vt())!==r?e=n=k(n,s):(st=e,e=r)}else st=e,e=r;return e}())===r&&(e=function(){var e,n,i,s;if(e=st,A.test(t.charAt(st))?(n=t.charAt(st),st++):(n=r,0===ct&&ft(L)),n!==r){for(i=[],s=Nt();s!==r;)i.push(s),s=Nt();i!==r?(s=function(){var t,e,n,i,s,a;if(t=st,(e=xt())!==r){for(n=[],i=st,(s=Bt())===r&&(s=null),s!==r&&(a=xt())!==r?i=s=[s,a]:(st=i,i=r);i!==r;)n.push(i),i=st,(s=Bt())===r&&(s=null),s!==r&&(a=xt())!==r?i=s=[s,a]:(st=i,i=r);n!==r?t=e=l(e,n):(st=t,t=r)}else st=t,t=r;return t}(),s!==r?e=n=y(n,s):(st=e,e=r)):(st=e,e=r)}else st=e,e=r;return e}())===r&&(e=function(){var e,n,i,s;if(e=st,E.test(t.charAt(st))?(n=t.charAt(st),st++):(n=r,0===ct&&ft(B)),n!==r){for(i=[],s=Nt();s!==r;)i.push(s),s=Nt();i!==r?(s=function(){var t,e,n,i,s,a;if(t=st,(e=wt())!==r){for(n=[],i=st,(s=Bt())===r&&(s=null),s!==r&&(a=wt())!==r?i=s=[s,a]:(st=i,i=r);i!==r;)n.push(i),i=st,(s=Bt())===r&&(s=null),s!==r&&(a=wt())!==r?i=s=[s,a]:(st=i,i=r);n!==r?t=e=l(e,n):(st=t,t=r)}else st=t,t=r;return t}(),s!==r?e=n=y(n,s):(st=e,e=r)):(st=e,e=r)}else st=e,e=r;return e}())===r&&(e=function(){var e,n,i,s;if(e=st,M.test(t.charAt(st))?(n=t.charAt(st),st++):(n=r,0===ct&&ft(O)),n!==r){for(i=[],s=Nt();s!==r;)i.push(s),s=Nt();i!==r?(s=function(){var t,e,n,i,s,a;if(t=st,(e=St())!==r){for(n=[],i=st,(s=Bt())===r&&(s=null),s!==r&&(a=St())!==r?i=s=[s,a]:(st=i,i=r);i!==r;)n.push(i),i=st,(s=Bt())===r&&(s=null),s!==r&&(a=St())!==r?i=s=[s,a]:(st=i,i=r);n!==r?t=e=l(e,n):(st=t,t=r)}else st=t,t=r;return t}(),s!==r?e=n=y(n,s):(st=e,e=r)):(st=e,e=r)}else st=e,e=r;return e}())===r&&(e=function(){var e,n,i,s;if(e=st,j.test(t.charAt(st))?(n=t.charAt(st),st++):(n=r,0===ct&&ft(N)),n!==r){for(i=[],s=Nt();s!==r;)i.push(s),s=Nt();i!==r?(s=function(){var t,e,n,i,s,a;if(t=st,(e=At())!==r){for(n=[],i=st,(s=Bt())===r&&(s=null),s!==r&&(a=At())!==r?i=s=[s,a]:(st=i,i=r);i!==r;)n.push(i),i=st,(s=Bt())===r&&(s=null),s!==r&&(a=At())!==r?i=s=[s,a]:(st=i,i=r);n!==r?t=e=l(e,n):(st=t,t=r)}else st=t,t=r;return t}(),s!==r?e=n=y(n,s):(st=e,e=r)):(st=e,e=r)}else st=e,e=r;return e}())===r&&(e=function(){var e,n,i,s;if(e=st,_.test(t.charAt(st))?(n=t.charAt(st),st++):(n=r,0===ct&&ft(z)),n!==r){for(i=[],s=Nt();s!==r;)i.push(s),s=Nt();i!==r?(s=function(){var t,e,n,i,s,a;if(t=st,(e=kt())!==r){for(n=[],i=st,(s=Bt())===r&&(s=null),s!==r&&(a=kt())!==r?i=s=[s,a]:(st=i,i=r);i!==r;)n.push(i),i=st,(s=Bt())===r&&(s=null),s!==r&&(a=kt())!==r?i=s=[s,a]:(st=i,i=r);n!==r?t=e=l(e,n):(st=t,t=r)}else st=t,t=r;return t}(),s!==r?e=n=y(n,s):(st=e,e=r)):(st=e,e=r)}else st=e,e=r;return e}()),e}function bt(){var t,e,n,i,s,a;if(t=st,(e=At())!==r){for(n=[],i=st,(s=Bt())===r&&(s=null),s!==r&&(a=At())!==r?i=s=[s,a]:(st=i,i=r);i!==r;)n.push(i),i=st,(s=Bt())===r&&(s=null),s!==r&&(a=At())!==r?i=s=[s,a]:(st=i,i=r);n!==r?t=e=l(e,n):(st=t,t=r)}else st=t,t=r;return t}function vt(){var t,e,n,i,s,a;if(t=st,(e=Pt())!==r){for(n=[],i=st,(s=Bt())===r&&(s=null),s!==r&&(a=Pt())!==r?i=s=[s,a]:(st=i,i=r);i!==r;)n.push(i),i=st,(s=Bt())===r&&(s=null),s!==r&&(a=Pt())!==r?i=s=[s,a]:(st=i,i=r);n!==r?t=e=l(e,n):(st=t,t=r)}else st=t,t=r;return t}function xt(){var t,e,n,i,s,a;return t=st,(e=At())!==r?((n=Bt())===r&&(n=null),n!==r&&(i=At())!==r?((s=Bt())===r&&(s=null),s!==r&&(a=At())!==r?t=e=P(e,i,a):(st=t,t=r)):(st=t,t=r)):(st=t,t=r),t}function wt(){var t,e,n,i;return t=st,(e=At())!==r?((n=Bt())===r&&(n=null),n!==r&&(i=At())!==r?t=e=C(e,i):(st=t,t=r)):(st=t,t=r),t}function St(){var t,e,n,i;return t=st,(e=At())!==r?((n=Bt())===r&&(n=null),n!==r&&(i=At())!==r?t=e=T(e,i):(st=t,t=r)):(st=t,t=r),t}function kt(){var t,e,n,i,s,a,o,l,c,u,h;return t=st,(e=Lt())!==r?((n=Bt())===r&&(n=null),n!==r&&(i=Lt())!==r?((s=Bt())===r&&(s=null),s!==r&&(a=Pt())!==r&&Bt()!==r&&(o=Et())!==r?((l=Bt())===r&&(l=null),l!==r&&(c=Et())!==r?((u=Bt())===r&&(u=null),u!==r&&(h=At())!==r?t=e=I(e,i,a,o,c,h):(st=t,t=r)):(st=t,t=r)):(st=t,t=r)):(st=t,t=r)):(st=t,t=r),t}function At(){var t,e,n,i;return t=st,(e=Pt())!==r?((n=Bt())===r&&(n=null),n!==r&&(i=Pt())!==r?t=e=F(e,i):(st=t,t=r)):(st=t,t=r),t}function Lt(){var t;return st,(t=Mt())===r&&(t=jt()),t!==r&&(t=G(t)),t}function Pt(){var t,e,n;return st,t=st,(e=Tt())===r&&(e=null),e!==r&&(n=Mt())!==r?t=e=[e,n]:(st=t,t=r),t===r&&(t=st,(e=Tt())===r&&(e=null),e!==r&&(n=jt())!==r?t=e=[e,n]:(st=t,t=r)),t!==r&&(t=H(t)),t}function Et(){var e;return st,V.test(t.charAt(st))?(e=t.charAt(st),st++):(e=r,0===ct&&ft(W)),e!==r&&(e=D(e)),e}function Bt(){var t,e,n,i,s;if(t=st,e=[],(n=Nt())!==r)for(;n!==r;)e.push(n),n=Nt();else e=r;if(e!==r)if((n=Ct())===r&&(n=null),n!==r){for(i=[],s=Nt();s!==r;)i.push(s),s=Nt();i!==r?t=e=[e,n,i]:(st=t,t=r)}else st=t,t=r;else st=t,t=r;if(t===r){if(t=st,e=st,(n=Ct())!==r){for(i=[],s=Nt();s!==r;)i.push(s),s=Nt();i!==r?e=n=[n,i]:(st=e,e=r)}else st=e,e=r;e!==r&&(e=R()),t=e}return t}function Ct(){var e;return 44===t.charCodeAt(st)?(e=Y,st++):(e=r,0===ct&&ft(q)),e}function Mt(){var e,n,i;return st,e=st,n=function(){var e,n,i,s;return st,e=st,(n=jt())===r&&(n=null),n!==r?(46===t.charCodeAt(st)?(i=Z,st++):(i=r,0===ct&&ft(U)),i!==r&&(s=jt())!==r?e=n=[n,i,s]:(st=e,e=r)):(st=e,e=r),e===r&&(e=st,(n=jt())!==r?(46===t.charCodeAt(st)?(i=Z,st++):(i=r,0===ct&&ft(U)),i!==r?e=n=[n,i]:(st=e,e=r)):(st=e,e=r)),e!==r&&(e=K(e)),e}(),n!==r?((i=Ot())===r&&(i=null),i!==r?e=n=[n,i]:(st=e,e=r)):(st=e,e=r),e===r&&(e=st,(n=jt())!==r&&(i=Ot())!==r?e=n=[n,i]:(st=e,e=r)),e!==r&&(e=K(e)),e}function Ot(){var e,n,i,s;return st,e=st,$.test(t.charAt(st))?(n=t.charAt(st),st++):(n=r,0===ct&&ft(X)),n!==r?((i=Tt())===r&&(i=null),i!==r&&(s=jt())!==r?e=n=[n,i,s]:(st=e,e=r)):(st=e,e=r),e!==r&&(e=K(e)),e}function Tt(){var e;return J.test(t.charAt(st))?(e=t.charAt(st),st++):(e=r,0===ct&&ft(Q)),e}function jt(){var e,n;if(st,e=[],tt.test(t.charAt(st))?(n=t.charAt(st),st++):(n=r,0===ct&&ft(et)),n!==r)for(;n!==r;)e.push(n),tt.test(t.charAt(st))?(n=t.charAt(st),st++):(n=r,0===ct&&ft(et));else e=r;return e!==r&&(e=nt(e)),e}function Nt(){var e;return st,it.test(t.charAt(st))?(e=t.charAt(st),st++):(e=r,0===ct&&ft(rt)),e!==r&&(e=R()),e}var _t,zt,It,Ft={m:"moveto",l:"lineto",h:"horizontal lineto",v:"vertical lineto",c:"curveto",s:"smooth curveto",q:"quadratic curveto",t:"smooth quadratic curveto",a:"elliptical arc",z:"closepath"};for(var Gt in Ft)Ft[Gt.toUpperCase()]=Ft[Gt];function Ht(t,e){e||(e=[{}]);for(var n=e.length;n--;){var i={code:t,command:Ft[t]};for(var r in t==t.toLowerCase()&&(i.relative=!0),e[n])i[r]=e[n][r];e[n]=i}return e}if((i=a())!==r&&st===t.length)return i;throw i!==r&&st<t.length&&ft({type:"end"}),_t=lt,zt=ot<t.length?t.charAt(ot):null,It=ot<t.length?pt(ot,ot+1):pt(ot,ot),new e(e.buildMessage(_t,zt),_t,zt,It)}}},509:e=>{"use strict";e.exports=t}},n={};function i(t){var r=n[t];if(void 0!==r)return r.exports;var s=n[t]={exports:{}};return e[t](s,s.exports,i),s.exports}i.n=t=>{var e=t&&t.__esModule?()=>t.default:()=>t;return i.d(e,{a:e}),e},i.d=(t,e)=>{for(var n in e)i.o(e,n)&&!i.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},i.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),i.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})};var r={};return(()=>{"use strict";i.r(r),i.d(r,{Axis:()=>Yi,BBox:()=>Ii,Breadcrumb:()=>mt,Button:()=>ht,Category:()=>Br,Checkbox:()=>as,CircleCrosshair:()=>Zr,Continuous:()=>pr,Layout:()=>xs,LineCrosshair:()=>qr,Marker:()=>et,Navigator:()=>vr,PRIMILTIVE_ATTRIBUTES:()=>yn,PolygonCrosshair:()=>ts,Poptip:()=>fs,Scrollbar:()=>cn,Select:()=>As,Selection:()=>I,Slider:()=>on,Sparkline:()=>_e,Switch:()=>Fr,Tag:()=>nt,Timebar:()=>na,Timeline:()=>qi,Tooltip:()=>Nr,add:()=>ye,addPrefix:()=>A,applyStyleSheet:()=>P,applyToText:()=>ni,arrayInterpolate:()=>En,calcLayout:()=>bs,catmullRom2Bezier:()=>Le,classNames:()=>$e,copyAttributes:()=>ki,createOffscreenGroup:()=>c,createTempText:()=>xi,deepAssign:()=>y,defined:()=>oi,degToRad:()=>pn,distance:()=>we,ellipsisIt:()=>ii,flex:()=>ms,formatTime:()=>Cs,getCallbackValue:()=>gn,getEventPos:()=>Ve,getFont:()=>ti,getLocalBBox:()=>vi,getMask:()=>Bs,getPrimitiveAttributes:()=>vn,getRenderBBox:()=>Fi,getShapeSpace:()=>bi,getTimeDiff:()=>Ms,getTimeScale:()=>Os,getTimeStart:()=>Ts,getTranslate:()=>si,grid:()=>ys,groupBy:()=>gr,hide:()=>a,ifNegative:()=>qe,ifPositive:()=>Ke,ifShow:()=>W,inRange:()=>Un,interpolate:()=>Cn,intersection:()=>Jr,isHorizontal:()=>wi,isInOffscreenGroup:()=>u,isPrimitiveAttribute:()=>bn,isVertical:()=>Si,keyframeInterpolate:()=>Mn,lineLen:()=>Ur,max:()=>xe,maybeAppend:()=>H,measureTextWidth:()=>Qn,mid:()=>Ue,min:()=>ve,multi:()=>Ze,normalize:()=>Se,numberInterpolate:()=>Pn,objectInterpolate:()=>Bn,omit:()=>jn,parseDate:()=>Es,parseHTML:()=>ra,parseSeriesAttr:()=>T,path2marker:()=>oa,percentTransform:()=>ai,radToDeg:()=>fn,removePrefix:()=>L,renderExtDo:()=>On,rotate:()=>ke,sampling:()=>un,scale:()=>me,scaleToPixel:()=>Tn,select:()=>G,setMockMeasureTextWidth:()=>Jn,show:()=>s,splitStyle:()=>M,stringToHTML:()=>ia,sub:()=>be,subStyleProps:()=>B,superStyleProps:()=>C,svg2marker:()=>la,textOf:()=>ei,throttle:()=>ca,timer:()=>ua,toKNotation:()=>Ye,toLowercaseFirstLetter:()=>k,toPrecision:()=>We,toScientificNotation:()=>Re,toThousands:()=>De,toUppercaseFirstLetter:()=>S,transpose:()=>mr,traverse:()=>n,vertical:()=>Ae,visibility:()=>o,wrapIt:()=>ri});var t=i(509);const e=function(t){return null==t};function n(t,e){e(t),t.children&&t.children.forEach((t=>{t&&n(t,e)}))}function s(t){o(t,!0)}function a(t){o(t,!1)}function o(t,e){const i=e?"visible":"hidden";n(t,(t=>{t.attr("visibility",i)}))}class l extends t.Group{constructor(){super(...arguments),this.addEventListener(t.ElementEvent.INSERTED,(()=>{a(this)}))}}function c(t){const e=t.appendChild(new l({class:"offscreen"}));return a(e),e}function u(t){let e=t;for(;e;){if("offscreen"===e.className)return!0;e=e.parent}return!1}const h=function(t){return"object"==typeof t&&null!==t};var d={}.toString;const p=function(t,e){return d.call(t)==="[object "+e+"]"},f=function(t){if(!h(t)||!p(t,"Object"))return!1;if(null===Object.getPrototypeOf(t))return!0;for(var e=t;null!==Object.getPrototypeOf(e);)e=Object.getPrototypeOf(e);return Object.getPrototypeOf(t)===e},g=function(t){return Array.isArray?Array.isArray(t):p(t,"Array")},m=function(t,e){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:5;Object.entries(e).forEach((r=>{let[s,a]=r;const o=t;Object.prototype.hasOwnProperty.call(e,s)&&(a?f(a)?(f(t[s])||(o[s]={}),n<i?m(t[s],a,n+1,i):o[s]=e[s]):g(a)?(o[s]=[],o[s]=o[s].concat(a)):o[s]=a:o[s]=a)}))},y=function(t){for(let e=0;e<(arguments.length<=1?0:arguments.length-1);e+=1)m(t,e+1<1||arguments.length<=e+1?void 0:arguments[e+1]);return t};function b(t,e,n){var i;return(e="symbol"==typeof(i=function(t,e){if("object"!=typeof t||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var i=n.call(t,"string");if("object"!=typeof i)return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(e))?i:String(i))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function v(){o(this,"hidden"!==this.attributes.visibility)}class x extends t.CustomElement{get offscreenGroup(){return this._offscreen||(this._offscreen=c(this)),this._offscreen}get defaultOptions(){return this._defaultOptions}constructor(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};super(y({},{style:e},t)),b(this,"_defaultOptions",void 0),b(this,"_offscreen",void 0),b(this,"initialized",!1),this._defaultOptions=e}connectedCallback(){this.render(this.attributes,this),this.bindEvents(this.attributes,this),this.initialized=!0}disconnectedCallback(){var t;null===(t=this._offscreen)||void 0===t||t.destroy()}attributeChangedCallback(t){"visibility"===t&&v.call(this)}update(t,e){var n;return this.attr(y({},this.attributes,t||{})),null===(n=this.render)||void 0===n?void 0:n.call(this,this.attributes,this,e)}clear(){this.removeChildren()}bindEvents(t,e){}}class w extends t.Text{get offscreenGroup(){return this._offscreen||(this._offscreen=c(this)),this._offscreen}disconnectedCallback(){var t;null===(t=this._offscreen)||void 0===t||t.destroy()}constructor(){let{style:t,...e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};super({style:{text:"",fill:"black",fontFamily:"sans-serif",fontSize:16,fontStyle:"normal",fontVariant:"normal",fontWeight:"normal",lineWidth:1,textAlign:"start",textBaseline:"middle",...t},...e}),function(t,e,n){var i;(e="symbol"==typeof(i=function(t,e){if("object"!=typeof t||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var i=n.call(t,"string");if("object"!=typeof i)return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(e))?i:String(i))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n}(this,"_offscreen",void 0)}}function S(t){return t.toString().charAt(0).toUpperCase()+t.toString().slice(1)}function k(t){return t.toString().charAt(0).toLowerCase()+t.toString().slice(1)}function A(t,e){return"".concat(e).concat(S(t))}function L(t,e){var n;let i=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];const r=e||(null===(n=t.match(/^([a-z][a-z0-9]+)/))||void 0===n?void 0:n[0])||"",s=t.replace(new RegExp("^(".concat(r,")")),"");return i?k(s):s}function P(t,e){Object.entries(e).forEach((e=>{let[n,i]=e;[t,...t.querySelectorAll(n)].filter((t=>t.matches(n))).forEach((t=>{t&&(t.style.cssText+=Object.entries(i).reduce(((t,e)=>"".concat(t).concat(e.join(":"),";")),""))}))}))}const E=(t,e)=>{if(null==t||!t.startsWith(e))return!1;const n=t[e.length];return n>="A"&&n<="Z"};function B(t,e){let n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];const i={};return Object.entries(t).forEach((t=>{let[r,s]=t;if("className"===r||"class"===r);else if(E(r,"show")&&E(L(r,"show"),e)!==n)r===A(e,"show")?i[r]=s:i[r.replace(new RegExp(S(e)),"")]=s;else if(!E(r,"show")&&E(r,e)!==n){const t=L(r,e);"filter"===t&&"function"==typeof s||(i[t]=s)}})),i}function C(t,e){return Object.entries(t).reduce(((t,n)=>{let[i,r]=n;return i.startsWith("show")?t["show".concat(e).concat(i.slice(4))]=r:t["".concat(e).concat(S(i))]=r,t}),{})}function M(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:["x","y","class","className"];const n=["transform","transformOrigin","anchor","visibility","pointerEvents","zIndex","cursor","clipPath","clipPathTargets","offsetPath","offsetPathTargets","offsetDistance","draggable","droppable"],i={},r={};return Object.entries(t).forEach((t=>{let[s,a]=t;e.includes(s)||(-1!==n.indexOf(s)?r[s]=a:i[s]=a)})),[i,r]}const O=function(t){return p(t,"Number")};function T(t){if(O(t))return[t,t,t,t];if(g(t)){const e=t.length;if(1===e)return[t[0],t[0],t[0],t[0]];if(2===e)return[t[0],t[1],t[0],t[1]];if(3===e)return[t[0],t[1],t[2],t[1]];if(4===e)return t}return[0,0,0,0]}var j;function N(t,e,n){var i;return(e="symbol"==typeof(i=function(t,e){if("object"!=typeof t||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var i=n.call(t,"string");if("object"!=typeof i)return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(e))?i:String(i))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function _(t,e,n){if(!e.has(t))throw new TypeError("attempted to get private field on non-instance");return n}var z=new WeakSet;class I{constructor(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null,r=arguments.length>4&&void 0!==arguments[4]?arguments[4]:[null,null,null,null,null],s=arguments.length>5&&void 0!==arguments[5]?arguments[5]:[],a=arguments.length>6&&void 0!==arguments[6]?arguments[6]:[];(function(t,e){!function(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}(t,e),e.add(t)})(this,z),N(this,"_elements",void 0),N(this,"_parent",void 0),N(this,"_data",void 0),N(this,"_enter",void 0),N(this,"_exit",void 0),N(this,"_update",void 0),N(this,"_merge",void 0),N(this,"_split",void 0),N(this,"_document",void 0),N(this,"_transitions",void 0),N(this,"_facetElements",void 0),this._elements=Array.from(t),this._data=e,this._parent=n,this._document=i,this._enter=r[0],this._update=r[1],this._exit=r[2],this._merge=r[3],this._split=r[4],this._transitions=s,this._facetElements=a}selectAll(t){const e="string"==typeof t?this._parent.querySelectorAll(t):t;return new I(e,null,this._elements[0],this._document)}selectFacetAll(t){const e="string"==typeof t?this._parent.querySelectorAll(t):t;return new I(this._elements,null,this._parent,this._document,void 0,void 0,e)}select(t){const e="string"==typeof t?this._parent.querySelectorAll(t)[0]||null:t;return new I([e],null,e,this._document)}append(t){const e="function"==typeof t?t:()=>this.createElement(t),n=[];if(null!==this._data){for(let t=0;t<this._data.length;t++){const i=this._data[t],[r,s]=Array.isArray(i)?i:[i,null],a=e(r,t);a.__data__=r,null!==s&&(a.__fromElements__=s),this._parent.appendChild(a),n.push(a)}return new I(n,null,this._parent,this._document)}for(let t=0;t<this._elements.length;t++){const i=this._elements[t],r=e(i.__data__,t);i.appendChild(r),n.push(r)}return new I(n,null,n[0],this._document)}maybeAppend(t,e){const n=_(this,z,F).call(this,"#"===t[0]?t:"#".concat(t),e);return n.attr("id",t),n}maybeAppendByClassName(t,e){const n=t.toString(),i=_(this,z,F).call(this,"."===n[0]?n:".".concat(n),e);return i.attr("className",n),i}maybeAppendByName(t,e){const n=_(this,z,F).call(this,'[name="'.concat(t,'"]'),e);return n.attr("name",t),n}data(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:t=>t,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:()=>null;const i=[],r=[],s=new Set(this._elements),a=[],o=new Set,l=new Map(this._elements.map(((t,n)=>[e(t.__data__,n),t]))),c=new Map(this._facetElements.map(((t,n)=>[e(t.__data__,n),t]))),u=function(t,e){const i=new Map;return t.forEach((t=>{const e=n(t.__data__);i.has(e)||i.set(e,[]),i.get(e).push(t)})),i}(this._elements);for(let h=0;h<t.length;h++){const d=t[h],p=e(d,h),f=n(d,h);if(l.has(p)){const t=l.get(p);t.__data__=d,t.__facet__=!1,r.push(t),s.delete(t),l.delete(p)}else if(c.has(p)){const t=c.get(p);t.__data__=d,t.__facet__=!0,r.push(t),c.delete(p)}else if(u.has(p)){const t=u.get(p);a.push([d,t]);for(const e of t)s.delete(e);u.delete(p)}else if(l.has(f)){const t=l.get(f);t.__toData__?t.__toData__.push(d):t.__toData__=[d],o.add(t),s.delete(t)}else i.push(d)}const h=[new I([],i,this._parent,this._document),new I(r,null,this._parent,this._document),new I(s,null,this._parent,this._document),new I([],a,this._parent,this._document),new I(o,null,this._parent,this._document)];return new I(this._elements,null,this._parent,this._document,h)}merge(t){const e=[...this._elements,...t._elements],n=[...this._transitions,...t._transitions];return new I(e,null,this._parent,this._document,void 0,n)}createElement(t){if(this._document)return this._document.createElement(t,{});const e=I.registry[t];return e?new e:function(t){throw new Error(t)}("Unknown node type: ".concat(t))}join(){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:t=>t,e=arguments.length>2&&void 0!==arguments[2]?arguments[2]:t=>t.remove(),n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:t=>t,i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:t=>t.remove();const r=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:t=>t)(this._enter),s=t(this._update),a=e(this._exit),o=n(this._merge),l=i(this._split);return s.merge(r).merge(a).merge(o).merge(l)}remove(){for(let t=0;t<this._elements.length;t++){const e=this._elements[t],n=this._transitions[t];n?n.then((()=>e.remove())):e.remove()}return new I([],null,this._parent,this._document,void 0,this._transitions)}each(t){for(let e=0;e<this._elements.length;e++){const n=this._elements[e],i=n.__data__;t.call(n,i,e)}return this}attr(t,e){const n="function"!=typeof e?()=>e:e;return this.each((function(i,r){void 0!==e&&(this[t]=n.call(this,i,r))}))}style(t,e){const n="function"!=typeof e||arguments.length>2&&void 0!==arguments[2]&&!arguments[2]?()=>e:e;return this.each((function(i,r){void 0!==e&&(this.style[t]=n.call(this,i,r))}))}styles(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return this.each((function(n,i){Object.entries(t).forEach((t=>{let[r,s]=t;const a="function"==typeof s&&e?s:()=>s;void 0!==s&&this.attr(r,a.call(this,n,i))}))}))}update(t){const e="function"!=typeof t||arguments.length>1&&void 0!==arguments[1]&&!arguments[1]?()=>t:t;return this.each((function(n,i){t&&this.update&&this.update(e.call(this,n,i))}))}maybeUpdate(t){const e="function"!=typeof t||arguments.length>1&&void 0!==arguments[1]&&!arguments[1]?()=>t:t;return this.each((function(n,i){t&&this.update&&this.update(e.call(this,n,i))}))}transition(t){const{_transitions:e}=this;return this.each((function(n,i){e[i]=t.call(this,n,i)}))}on(t,e){return this.each((function(){this.addEventListener(t,e)})),this}call(t){for(var e=arguments.length,n=new Array(e>1?e-1:0),i=1;i<e;i++)n[i-1]=arguments[i];return t.call(this._parent,this,...n),this}node(){return this._elements[0]}nodes(){return this._elements}transitions(){return this._transitions.filter((t=>!!t))}parent(){return this._parent}}function F(t,e){const n=this._elements[0],i=n.querySelector(t);if(i)return new j([i],null,this._parent,this._document);const r="string"==typeof e?this.createElement(e):e();return n.appendChild(r),new j([r],null,this._parent,this._document)}function G(t){return new I([t],null,t,t.ownerDocument)}function H(t,e,n){return t.querySelector(e)?G(t).select(e):G(t).append(n)}j=I,N(I,"registry",{g:t.Group,rect:t.Rect,circle:t.Circle,path:t.Path,text:w,ellipse:t.Ellipse,image:t.Image,line:t.Line,polygon:t.Polygon,polyline:t.Polyline,html:t.HTML});const V=function(t){return"function"==typeof t};function W(t,e,n){let i=!(arguments.length>3&&void 0!==arguments[3])||arguments[3],r=arguments.length>4&&void 0!==arguments[4]?arguments[4]:t=>{t.node().removeChildren()};return t?n(e):(i&&r(e),null)}const D=(t,e,n)=>[["M",t-n,e],["A",n,n,0,1,0,t+n,e],["A",n,n,0,1,0,t-n,e],["Z"]],R=D,Y=(t,e,n)=>[["M",t,e+n],["L",t,e-n]],q=(t,e,n)=>[["M",t-n,e],["L",t+n,e]],K=q,Z=function(t){var e=typeof t;return null!==t&&"object"===e||"function"===e},U=function(t){return p(t,"String")};var $,X,J,Q;function tt(t,e,n){var i;return(e="symbol"==typeof(i=function(t,e){if("object"!=typeof t||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var i=n.call(t,"string");if("object"!=typeof i)return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(e))?i:String(i))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}class et extends x{render(t,e){const{symbol:n,size:i=16,...r}=t,s=function(t){const e=function(t){let e="default";if(Z(t)&&t instanceof Image)e="image";else if(V(t))e="symbol";else if(U(t)){const n=new RegExp("data:(image|text)");e=t.match(n)?"base64":/^(https?:\/\/(([a-zA-Z0-9]+-?)+[a-zA-Z0-9]+\.)+[a-zA-Z]+)(:\d+)?(\/.*)?(\?.*)?(#.*)?$/.test(t)?"url":"symbol"}return e}(t);return["base64","url","image"].includes(e)?"image":t&&"symbol"===e?"path":null}(n);W(!!s,G(e),(t=>{t.maybeAppendByClassName("marker",s).attr("className","marker ".concat(s,"-marker")).call((t=>{if("image"===s){const e=2*i;t.styles({img:n,width:e,height:e,x:-i,y:-i})}else{const e=i/2,s=V(n)?n:et.getSymbol(n);t.styles({path:null==s?void 0:s(0,0,e),...r})}}))}))}}$=et,tt(et,"MARKER_SYMBOL_MAP",new Map),tt(et,"registerSymbol",((t,e)=>{$.MARKER_SYMBOL_MAP.set(t,e)})),tt(et,"getSymbol",(t=>$.MARKER_SYMBOL_MAP.get(t))),tt(et,"getSymbols",(()=>Array.from($.MARKER_SYMBOL_MAP.keys()))),et.registerSymbol("cross",((t,e,n)=>[["M",t-n,e-n],["L",t+n,e+n],["M",t+n,e-n],["L",t-n,e+n]])),et.registerSymbol("hyphen",((t,e,n)=>[["M",t-n,e],["L",t+n,e]])),et.registerSymbol("line",Y),et.registerSymbol("plus",((t,e,n)=>[["M",t-n,e],["L",t+n,e],["M",t,e-n],["L",t,e+n]])),et.registerSymbol("tick",((t,e,n)=>[["M",t-n/2,e-n],["L",t+n/2,e-n],["M",t,e-n],["L",t,e+n],["M",t-n/2,e+n],["L",t+n/2,e+n]])),et.registerSymbol("circle",D),et.registerSymbol("point",R),et.registerSymbol("bowtie",((t,e,n)=>{const i=n-1.5;return[["M",t-n,e-i],["L",t+n,e+i],["L",t+n,e-i],["L",t-n,e+i],["Z"]]})),et.registerSymbol("hexagon",((t,e,n)=>{const i=n/2*Math.sqrt(3);return[["M",t,e-n],["L",t+i,e-n/2],["L",t+i,e+n/2],["L",t,e+n],["L",t-i,e+n/2],["L",t-i,e-n/2],["Z"]]})),et.registerSymbol("square",((t,e,n)=>[["M",t-n,e-n],["L",t+n,e-n],["L",t+n,e+n],["L",t-n,e+n],["Z"]])),et.registerSymbol("diamond",((t,e,n)=>[["M",t-n,e],["L",t,e-n],["L",t+n,e],["L",t,e+n],["Z"]])),et.registerSymbol("triangle",((t,e,n)=>{const i=n*Math.sin(1/3*Math.PI);return[["M",t-n,e+i],["L",t,e-i],["L",t+n,e+i],["Z"]]})),et.registerSymbol("triangle-down",((t,e,n)=>{const i=n*Math.sin(1/3*Math.PI);return[["M",t-n,e-i],["L",t+n,e-i],["L",t,e+i],["Z"]]})),et.registerSymbol("line",Y),et.registerSymbol("dot",q),et.registerSymbol("dash",K),et.registerSymbol("smooth",((t,e,n)=>[["M",t-n,e],["A",n/2,n/2,0,1,1,t,e],["A",n/2,n/2,0,1,0,t+n,e]])),et.registerSymbol("hv",((t,e,n)=>[["M",t-n-1,e-2.5],["L",t,e-2.5],["L",t,e+2.5],["L",t+n+1,e+2.5]])),et.registerSymbol("vh",((t,e,n)=>[["M",t-n-1,e+2.5],["L",t,e+2.5],["L",t,e-2.5],["L",t+n+1,e-2.5]])),et.registerSymbol("hvh",((t,e,n)=>[["M",t-(n+1),e+2.5],["L",t-n/2,e+2.5],["L",t-n/2,e-2.5],["L",t+n/2,e-2.5],["L",t+n/2,e+2.5],["L",t+n+1,e+2.5]])),et.registerSymbol("vhv",(function(t,e){return[["M",t-5,e+2.5],["L",t-5,e],["L",t,e],["L",t,e-3],["L",t,e+3],["L",t+6.5,e+3]]}));class nt extends x{constructor(t){super(t,{padding:4,spacing:4})}render(t,n){const{padding:i=0,marker:r,text:s,radius:a,spacing:o,align:l,verticalAlign:c}=t,u=B(t,"label"),h=B(t,"background"),[d,p,f,g]=T(i),m=H(n,".tag-content","g").attr("className","tag-content").style("zIndex",0).node(),y=r||{symbol:"triangle",size:0},b=H(m,".tag-marker",(()=>new et({style:y}))).attr("className","tag-marker").call((t=>{t.node().clear()})).update(y).node(),{x:v,y:x}=function(t,e){const n=t.getLocalBounds();return{x:n.halfExtents[0]?n.max[0]+(e||0):t.style.x,y:n.halfExtents[1]?(n.min[1]+n.max[1])/2:t.style.y}}(b,o);G(m).maybeAppendByClassName("tag-text",(()=>new w)).styles({fontSize:12,text:e(s)?"":"".concat(s),x:v,y:x,...u,textBaseline:"middle"}).call((t=>{s||t.remove()})),function(t,e,n,i,r){const s=t.getLocalBounds();let a=0,o=0;"start"===i&&(a=e),"center"===i&&(a=-s.halfExtents[0]),"end"===i&&(a=-e-2*s.halfExtents[0]),"top"===r&&(o=n+s.halfExtents[1]),"middle"===r&&(o=0),"bottom"===r&&(o=n-2*s.halfExtents[1]),t.setLocalPosition([a,o])}(m,g,d,l||"start",c||"top");const S=m.getLocalBounds();G(n).maybeAppendByClassName("tag-background","rect").styles({zIndex:-1,y:S.min[1]-d,x:S.min[0]-g,width:null!==h?g+p+2*S.halfExtents[0]:0,height:null!==h?d+f+2*S.halfExtents[1]:0,radius:null!=a?a:2,fill:"#fafafa",stroke:"#d9d9d9",lineWidth:1,...h})}}X=nt,(J="symbol"==typeof(Q=function(t,e){if("object"!=typeof t||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var i=n.call(t,"string");if("object"!=typeof i)return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(J="tag"))?Q:String(Q))in X?Object.defineProperty(X,J,{value:"tag",enumerable:!0,configurable:!0,writable:!0}):X[J]="tag";const it=function(t){return void 0===t};function rt(t,e){if(Object.hasOwn)return Object.hasOwn(t,e);if(null==t)throw new TypeError("Cannot convert undefined or null to object");return Object.prototype.hasOwnProperty.call(Object(t),e)}function st(t,e,n,i){for(var r in n=n||0,i=i||5,e)if(rt(e,r)){var s=e[r];null!==s&&f(s)?(f(t[r])||(t[r]={}),n<i?st(t[r],s,n+1,i):t[r]=e[r]):g(s)?(t[r]=[],t[r]=t[r].concat(s)):void 0!==s&&(t[r]=s)}}const at=function(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];for(var i=0;i<e.length;i+=1)st(t,e[i]);return t},ot={small:{textFontSize:10,buttonWidth:40,buttonHeight:20,markerSize:8},middle:{textFontSize:12,buttonWidth:60,buttonHeight:30,markerSize:12},large:{textFontSize:16,buttonWidth:80,buttonHeight:40,markerSize:16}},lt={primary:{default:{textFill:"#fff",buttonFill:"#1890ff",buttonLineWidth:0,markerFill:"#1890ff"},active:{buttonFill:"#40a9ff",markerFill:"#40a9ff"},disabled:{}},dashed:{default:{buttonFill:"transparent",buttonStroke:"#bbb",buttonLineDash:[5,5]},active:{},disabled:{}},link:{default:{textFill:"#1890ff",buttonFill:"transparent",buttonLineWidth:0,markerFill:"#1890ff"},active:{},disabled:{}},text:{default:{textFill:"#000",buttonFill:"transparent",buttonLineWidth:0,markerFill:"#000"},active:{},disabled:{}},default:{default:{textFill:"#000",buttonFill:"transparent",buttonStroke:"#bbb",markerFill:"#bbb"},active:{textFill:"#1890ff",buttonStroke:"#1890ff",markerStroke:"#1890ff"},disabled:{}}},ct={strict:{textFill:"#b8b8b8"},buttonStroke:"#d9d9d9",buttonFill:"#f5f5f5",markerStroke:"#d9d9d9"};function ut(t,e,n){return e=function(t){var e=function(t,e){if("object"!=typeof t||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var i=n.call(t,"string");if("object"!=typeof i)return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==typeof e?e:String(e)}(e),e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}class ht extends x{get markerSize(){const{markerSymbol:t}=this.attributes,e=this.getStyle("marker");return t?(null==e?void 0:e.size)||2:0}get textAvailableWidth(){const{markerSymbol:t,padding:e,ellipsis:n,width:i,markerSpacing:r}=this.attributes;if(!n)return 1/0;const s=it(i)?this.getStyle("button").width:i;return t?s-2*e-r-this.markerSize:s-2*e}get buttonHeight(){const{height:t}=this.attributes;return t?+t:+this.getStyle("button").height}constructor(t){super(t,{cursor:"pointer",padding:10,size:"middle",type:"default",text:"",state:"default",markerAlign:"left",markerSpacing:5,default:{buttonLineWidth:1,buttonRadius:5},active:{}}),ut(this,"textShape",void 0),ut(this,"state","default"),ut(this,"clickEvents",(()=>{const{onClick:t,state:e}=this.attributes;"disabled"!==e&&(null==t||t.call(this,this))})),ut(this,"mouseenterEvent",(()=>{const{state:t}=this.attributes;"disabled"!==t&&(this.state="active",this.render(this.attributes,this))})),ut(this,"mouseleaveEvent",(()=>{const{state:t}=this.attributes;this.state=t,this.render(this.attributes,this)}))}getStyle(t){const{size:e,type:n}=this.attributes,{state:i}=this,r=at({},ot[e],lt[n][i],this.attributes.default,this.attributes[i]);return"disabled"===i&&(Object.keys(r).forEach((t=>{t in ct&&(r[t]=ct[t])})),Object.keys(ct.strict).forEach((t=>{r[t]=ct.strict[t]})),at(r,this.attributes.disabled||{})),B(r,t)}render(t,e){const{text:n="",padding:i=0,markerSymbol:r,markerSpacing:s=0}=t;e.attr("cursor","disabled"===this.state?"not-allowed":"pointer");const[a,o,l,c]=T(i),u=this.buttonHeight,h=this.getStyle("marker"),{markerSize:d}=this,p={...h,symbol:r,x:c+d/2,y:u/2,size:d},f=H(e,".marker",(()=>new et({className:"marker",style:p}))).update({style:p}).node().getLocalBounds(),g=this.getStyle("text");this.textShape=H(e,".text","text").attr("className","text").styles({x:d?f.max[0]+s:c,y:u/2,...g,text:n,textAlign:"left",textBaseline:"middle",wordWrap:!0,wordWrapWidth:this.textAvailableWidth,maxLines:1,textOverflow:"..."}).node();const m=this.textShape.getLocalBounds(),y=this.getStyle("button");G(e).maybeAppendByClassName(".background","rect").styles({zIndex:-1,...y,height:u,width:c+(d?d+s:0)+2*m.halfExtents[0]+o})}update(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.attr(at({},this.attributes,t));const{state:e}=this.attributes;this.state=e,this.render(this.attributes,this)}setState(t){this.update({state:t})}hide(){this.style.visibility="hidden"}show(){this.style.visibility="visible"}bindEvents(){this.addEventListener("click",this.clickEvents),this.addEventListener("mouseenter",this.mouseenterEvent),this.addEventListener("mouseleave",this.mouseleaveEvent)}}ut(ht,"tag","button");const dt=function(t,e){if(t)if(g(t))for(var n=0,i=t.length;n<i&&!1!==e(t[n],n);n++);else if(Z(t))for(var r in t)if(t.hasOwnProperty(r)&&!1===e(t[r],r))break};var pt=Object.prototype.hasOwnProperty;const ft=function(t,e){if(null===t||!f(t))return{};var n={};return dt(e,(function(e){pt.call(t,e)&&(n[e]=t[e])})),n};function gt(t,e,n){return e=function(t){var e=function(t,e){if("object"!=typeof t||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var i=n.call(t,"string");if("object"!=typeof i)return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==typeof e?e:String(e)}(e),e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}class mt extends x{constructor(t){super(at({},mt.defaultOptions,t))}render(t,n){const{x:i,y:r,items:s,textStyle:a,padding:o=0,width:l,separator:c}=t,[u,h,d]=T(o),p=B(t,"tag"),f=H(n,".container","g").styles({className:"container",x:i+d,y:r+u});let g=0,m=0;f.node().removeChildren();for(let t=0;t<s.length;t++){const n=s[t],i=new nt({className:"breadcrumb-item",style:{x:g,y:m,...p,text:e(n.text)?n.id:n.text,...ft(n,["marker"]),padding:0}});f.append((()=>i));const r=i.getLocalBounds(),a=2*r.halfExtents[0],o=2*r.halfExtents[1];g+=a,e(l)||g>l-h&&(i.attr({x:0,y:m+o}),g=a,m+=o),this.bindInnerEvents(i,n);const{spacing:u=0,text:d="/",style:y}=c||{};if(t!==s.length-1){const e=new w({className:"".concat(mt.tag,"-separator"),id:"".concat(mt.tag,"-separator-").concat(t),style:{x:g+u,y:m+o/2,...y,text:d,textAlign:"end",textBaseline:"middle"}});f.append((()=>e)),g+=2*e.getLocalBounds().halfExtents[0]+u}}}update(t){this.attr(at({},this.attributes,t)),this.render(this.attributes,this)}bindInnerEvents(t,e){const{items:n,onClick:i}=this.attributes;i&&t.addEventListener("click",(()=>{i.call(t,e.id,e,n)}))}}gt(mt,"tag","breadcrumb"),gt(mt,"defaultOptions",{style:{separator:{text:"/",style:{fontSize:14,fill:"rgba(0, 0, 0, 0.45)"},spacing:8},textStyle:{default:{fontSize:14,fill:"rgba(0, 0, 0, 0.45)"},active:{fill:"#5468ff",cursor:"pointer"}},padding:[8,8,8,8]}});var yt={}.toString;const bt=function(t,e){return yt.call(t)==="[object "+e+"]"},vt=function(t){return bt(t,"Function")},xt=function(t){return Array.isArray?Array.isArray(t):bt(t,"Array")};Object.keys;const wt=function(t){if(!function(t){return"object"==typeof t&&null!==t}(t)||!bt(t,"Object"))return!1;if(null===Object.getPrototypeOf(t))return!0;for(var e=t;null!==Object.getPrototypeOf(e);)e=Object.getPrototypeOf(e);return Object.getPrototypeOf(t)===e};var St=Array.prototype;St.splice,St.indexOf,Array.prototype.splice,Object.prototype.hasOwnProperty;Number.isInteger&&Number.isInteger,Math.PI,Math.PI;var kt=Object.values?function(t){return Object.values(t)}:function(t){var e=[];return function(t,e){if(t)if(xt(t))for(var n=0,i=t.length;n<i&&!1!==e(t[n],n);n++);else if(function(t){var e=typeof t;return null!==t&&"object"===e||"function"===e}(t))for(var r in t)if(t.hasOwnProperty(r)&&!1===e(t[r],r))break}(t,(function(n,i){vt(t)&&"prototype"===i||e.push(n)})),e};const At=kt;Object.prototype;function Lt(t,e,n,i){for(var r in n=n||0,i=i||5,e)if(e.hasOwnProperty(r)){var s=e[r];null!==s&&wt(s)?(wt(t[r])||(t[r]={}),n<i?Lt(t[r],s,n+1,i):t[r]=e[r]):xt(s)?(t[r]=[],t[r]=t[r].concat(s)):void 0!==s&&(t[r]=s)}}const Pt=function(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];for(var i=0;i<e.length;i+=1)Lt(t,e[i]);return t};Object.prototype.hasOwnProperty,Object.prototype.hasOwnProperty;const Et=function(t){return t};var Bt;Object.create,Object.create,"function"==typeof SuppressedError&&SuppressedError,function(t,e){if(!vt(t))throw new TypeError("Expected a function");var n=function(){for(var i=[],r=0;r<arguments.length;r++)i[r]=arguments[r];var s=e?e.apply(this,i):i[0],a=n.cache;if(a.has(s))return a.get(s);var o=t.apply(this,i);return a.set(s,o),o};n.cache=new Map}((function(t,e){void 0===e&&(e={});var n,i=e.fontSize,r=e.fontFamily,s=e.fontWeight,a=e.fontStyle,o=e.fontVariant;return Bt||(Bt=document.createElement("canvas").getContext("2d")),Bt.font=[a,o,s,i+"px",r].join(" "),Bt.measureText((n=t,bt(n,"String")?t:"")).width}),(function(t,e){return void 0===e&&(e={}),function(){for(var t=0,e=0,n=arguments.length;e<n;e++)t+=arguments[e].length;var i=Array(t),r=0;for(e=0;e<n;e++)for(var s=arguments[e],a=0,o=s.length;a<o;a++,r++)i[r]=s[a];return i}([t],At(e)).join("")})),function(){function t(){this.map={}}t.prototype.has=function(t){return void 0!==this.map[t]},t.prototype.get=function(t,e){var n=this.map[t];return void 0===n?e:n},t.prototype.set=function(t,e){this.map[t]=e},t.prototype.clear=function(){this.map={}},t.prototype.delete=function(t){delete this.map[t]},t.prototype.size=function(){return Object.keys(this.map).length}}();class Ct{constructor(t){this.options=Pt({},this.getDefaultOptions()),this.update(t)}getOptions(){return this.options}update(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.options=Pt({},this.options,t),this.rescale(t)}rescale(t){}}function Mt(t,e){return e-t?n=>(n-t)/(e-t):t=>.5}function Ot(t){for(var e=arguments.length,n=new Array(e>1?e-1:0),i=1;i<e;i++)n[i-1]=arguments[i];return n.reduce(((t,e)=>n=>t(e(n))),t)}var Tt=i(629),jt=i.n(Tt);function Nt(t,e,n){let i=n;return i<0&&(i+=1),i>1&&(i-=1),i<1/6?t+6*(e-t)*i:i<.5?e:i<2/3?t+(e-t)*(2/3-i)*6:t}function _t(t){const e=jt().get(t);if(!e)return null;const{model:n,value:i}=e;return"rgb"===n?i:"hsl"===n?function(t){const e=t[0]/360,n=t[1]/100,i=t[2]/100,r=t[3];if(0===n)return[255*i,255*i,255*i,r];const s=i<.5?i*(1+n):i+n-i*n,a=2*i-s;return[255*Nt(a,s,e+1/3),255*Nt(a,s,e),255*Nt(a,s,e-1/3),r]}(i):null}const zt=(t,e)=>n=>t*(1-n)+e*n,It=(t,e)=>"number"==typeof t&&"number"==typeof e?zt(t,e):"string"==typeof t&&"string"==typeof e?((t,e)=>{const n=_t(t),i=_t(e);return null===n||null===i?n?()=>t:()=>e:t=>{const e=new Array(4);for(let r=0;r<4;r+=1){const s=n[r],a=i[r];e[r]=s*(1-t)+a*t}const[r,s,a,o]=e;return"rgba(".concat(Math.round(r),", ").concat(Math.round(s),", ").concat(Math.round(a),", ").concat(o,")")}})(t,e):()=>t,Ft=(t,e)=>{const n=zt(t,e);return t=>Math.round(n(t))};function Gt(t){return!function(t){return void 0===t}(t)&&!function(t){return null===t}(t)&&!Number.isNaN(t)}const Ht=Math.sqrt(50),Vt=Math.sqrt(10),Wt=Math.sqrt(2);function Dt(t,e,n){const i=(e-t)/Math.max(0,n),r=Math.floor(Math.log(i)/Math.LN10),s=i/10**r;return r>=0?(s>=Ht?10:s>=Vt?5:s>=Wt?2:1)*10**r:-(10**-r)/(s>=Ht?10:s>=Vt?5:s>=Wt?2:1)}const Rt=function(t,e){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:5;const i=[t,e];let r,s=0,a=i.length-1,o=i[s],l=i[a];return l<o&&([o,l]=[l,o],[s,a]=[a,s]),r=Dt(o,l,n),r>0?(o=Math.floor(o/r)*r,l=Math.ceil(l/r)*r,r=Dt(o,l,n)):r<0&&(o=Math.ceil(o*r)/r,l=Math.floor(l*r)/r,r=Dt(o,l,n)),r>0?(i[s]=Math.floor(o/r)*r,i[a]=Math.ceil(l/r)*r):r<0&&(i[s]=Math.ceil(o*r)/r,i[a]=Math.floor(l*r)/r),i},Yt=(t,e,n)=>{const[i,r]=t,[s,a]=e;let o,l;return i<r?(o=Mt(i,r),l=n(s,a)):(o=Mt(r,i),l=n(a,s)),Ot(l,o)},qt=(t,e,n)=>{const i=Math.min(t.length,e.length)-1,r=new Array(i),s=new Array(i),a=t[0]>t[i],o=a?[...t].reverse():t,l=a?[...e].reverse():e;for(let t=0;t<i;t+=1)r[t]=Mt(o[t],o[t+1]),s[t]=n(l[t],l[t+1]);return e=>{const n=function(t,e,n,i,r){let s=1,a=i||t.length;const o=t=>t;for(;s<a;){const n=Math.floor((s+a)/2);o(t[n])>e?a=n:s=n+1}return s}(t,e,0,i)-1,a=r[n];return Ot(s[n],a)(e)}},Kt=(t,e,n,i)=>(Math.min(t.length,e.length)>2?qt:Yt)(t,e,i?Ft:n);class Zt extends Ct{getDefaultOptions(){return{domain:[0,1],range:[0,1],nice:!1,clamp:!1,round:!1,interpolate:zt,tickCount:5}}map(t){return Gt(t)?this.output(t):this.options.unknown}invert(t){return Gt(t)?this.input(t):this.options.unknown}nice(){if(!this.options.nice)return;const[t,e,n,...i]=this.getTickMethodOptions();this.options.domain=this.chooseNice()(t,e,n,...i)}getTicks(){const{tickMethod:t}=this.options,[e,n,i,...r]=this.getTickMethodOptions();return t(e,n,i,...r)}getTickMethodOptions(){const{domain:t,tickCount:e}=this.options;return[t[0],t[t.length-1],e]}chooseNice(){return Rt}rescale(){this.nice();const[t,e]=this.chooseTransforms();this.composeOutput(t,this.chooseClamp(t)),this.composeInput(t,e,this.chooseClamp(e))}chooseClamp(t){const{clamp:e,range:n}=this.options,i=this.options.domain.map(t),r=Math.min(i.length,n.length);return e?function(t,e){const n=e<t?e:t,i=t>e?t:e;return t=>Math.min(Math.max(n,t),i)}(i[0],i[r-1]):Et}composeOutput(t,e){const{domain:n,range:i,round:r,interpolate:s}=this.options,a=Kt(n.map(t),i,s,r);this.output=Ot(a,e,t)}composeInput(t,e,n){const{domain:i,range:r}=this.options,s=Kt(r,i.map(t),zt);this.input=Ot(e,n,s)}}const Ut=(t,e,n)=>{let i,r,s=t,a=e;if(s===a&&n>0)return[s];let o=Dt(s,a,n);if(0===o||!Number.isFinite(o))return[];if(o>0){s=Math.ceil(s/o),a=Math.floor(a/o),r=new Array(i=Math.ceil(a-s+1));for(let t=0;t<i;t+=1)r[t]=(s+t)*o}else{o=-o,s=Math.ceil(s*o),a=Math.floor(a*o),r=new Array(i=Math.ceil(a-s+1));for(let t=0;t<i;t+=1)r[t]=(s+t)/o}return r};class $t extends Zt{getDefaultOptions(){return{domain:[0,1],range:[0,1],unknown:void 0,nice:!1,clamp:!1,round:!1,interpolate:It,tickMethod:Ut,tickCount:5}}chooseTransforms(){return[Et,Et]}clone(){return new $t(this.options)}}function Xt(t,e){let{map:n,initKey:i}=t;const r=i(e);return n.has(r)?n.get(r):e}function Jt(t){return"object"==typeof t?t.valueOf():t}class Qt extends Map{constructor(t){if(super(),this.map=new Map,this.initKey=Jt,null!==t)for(const[e,n]of t)this.set(e,n)}get(t){return super.get(Xt({map:this.map,initKey:this.initKey},t))}has(t){return super.has(Xt({map:this.map,initKey:this.initKey},t))}set(t,e){return super.set(function(t,e){let{map:n,initKey:i}=t;const r=i(e);return n.has(r)?n.get(r):(n.set(r,e),e)}({map:this.map,initKey:this.initKey},t),e)}delete(t){return super.delete(function(t,e){let{map:n,initKey:i}=t;const r=i(e);return n.has(r)&&(e=n.get(r),n.delete(r)),e}({map:this.map,initKey:this.initKey},t))}}const te=Symbol("defaultUnknown");function ee(t,e,n){for(let i=0;i<e.length;i+=1)t.has(e[i])||t.set(n(e[i]),i)}function ne(t){const{value:e,from:n,to:i,mapper:r,notFoundReturn:s}=t;let a=r.get(e);if(void 0===a){if(s!==te)return s;a=n.push(e)-1,r.set(e,a)}return i[a%i.length]}function ie(t){return t instanceof Date?t=>"".concat(t):"object"==typeof t?t=>JSON.stringify(t):t=>t}class re extends Ct{getDefaultOptions(){return{domain:[],range:[],unknown:te}}constructor(t){super(t)}map(t){return 0===this.domainIndexMap.size&&ee(this.domainIndexMap,this.getDomain(),this.domainKey),ne({value:this.domainKey(t),mapper:this.domainIndexMap,from:this.getDomain(),to:this.getRange(),notFoundReturn:this.options.unknown})}invert(t){return 0===this.rangeIndexMap.size&&ee(this.rangeIndexMap,this.getRange(),this.rangeKey),ne({value:this.rangeKey(t),mapper:this.rangeIndexMap,from:this.getRange(),to:this.getDomain(),notFoundReturn:this.options.unknown})}rescale(t){const[e]=this.options.domain,[n]=this.options.range;if(this.domainKey=ie(e),this.rangeKey=ie(n),!this.rangeIndexMap)return this.rangeIndexMap=new Map,void(this.domainIndexMap=new Map);t&&!t.range||this.rangeIndexMap.clear(),(!t||t.domain||t.compare)&&(this.domainIndexMap.clear(),this.sortedDomain=void 0)}clone(){return new re(this.options)}getRange(){return this.options.range}getDomain(){if(this.sortedDomain)return this.sortedDomain;const{domain:t,compare:e}=this.options;return this.sortedDomain=e?[...t].sort(e):t,this.sortedDomain}}function se(t){return Math.round(1e12*t)/1e12}class ae extends re{getDefaultOptions(){return{domain:[],range:[0,1],align:.5,round:!1,paddingInner:0,paddingOuter:0,padding:0,unknown:te,flex:[]}}constructor(t){super(t)}clone(){return new ae(this.options)}getStep(t){return void 0===this.valueStep?1:"number"==typeof this.valueStep?this.valueStep:void 0===t?Array.from(this.valueStep.values())[0]:this.valueStep.get(t)}getBandWidth(t){return void 0===this.valueBandWidth?1:"number"==typeof this.valueBandWidth?this.valueBandWidth:void 0===t?Array.from(this.valueBandWidth.values())[0]:this.valueBandWidth.get(t)}getRange(){return this.adjustedRange}getPaddingInner(){const{padding:t,paddingInner:e}=this.options;return t>0?t:e}getPaddingOuter(){const{padding:t,paddingOuter:e}=this.options;return t>0?t:e}rescale(){super.rescale();const{align:t,domain:e,range:n,round:i,flex:r}=this.options,{adjustedRange:s,valueBandWidth:a,valueStep:o}=function(t){var e;const{domain:n}=t,i=n.length;if(0===i)return{valueBandWidth:void 0,valueStep:void 0,adjustedRange:[]};if(null===(e=t.flex)||void 0===e?void 0:e.length)return function(t){const{domain:e,range:n,paddingOuter:i,paddingInner:r,flex:s,round:a,align:o}=t,l=e.length,c=function(t,e){const n=e-t.length;return n>0?[...t,...new Array(n).fill(1)]:n<0?t.slice(0,e):t}(s,l),[u,h]=n,d=h-u,p=d/(2/l*i+1-1/l*r),f=p*r/l,g=p-l*f,m=function(t){const e=Math.min(...t);return t.map((t=>t/e))}(c),y=m.reduce(((t,e)=>t+e)),b=g/y,v=new Qt(e.map(((t,e)=>{const n=m[e]*b;return[t,a?Math.floor(n):n]}))),x=new Qt(e.map(((t,e)=>{const n=m[e]*b+f;return[t,a?Math.floor(n):n]}))),w=Array.from(x.values()).reduce(((t,e)=>t+e)),S=u+(d-(w-w/l*r))*o;let k=a?Math.round(S):S;const A=new Array(l);for(let t=0;t<l;t+=1){A[t]=se(k);const n=e[t];k+=x.get(n)}return{valueBandWidth:v,valueStep:x,adjustedRange:A}}(t);const{range:r,paddingOuter:s,paddingInner:a,round:o,align:l}=t;let c,u,h=r[0];const d=r[1]-h,p=2*s,f=i-a;c=d/Math.max(1,p+f),o&&(c=Math.floor(c)),h+=(d-c*(i-a))*l,u=c*(1-a),o&&(h=Math.round(h),u=Math.round(u));const g=new Array(i).fill(0).map(((t,e)=>h+e*c));return{valueStep:c,valueBandWidth:u,adjustedRange:g}}({align:t,range:n,round:i,flex:r,paddingInner:this.getPaddingInner(),paddingOuter:this.getPaddingOuter(),domain:e});this.valueStep=o,this.valueBandWidth=a,this.adjustedRange=s}}var oe=function(t){if("object"!=typeof t||null===t)return t;var e;if(g(t)){e=[];for(var n=0,i=t.length;n<i;n++)"object"==typeof t[n]&&null!=t[n]?e[n]=oe(t[n]):e[n]=t[n]}else for(var r in e={},t)"object"==typeof t[r]&&null!=t[r]?e[r]=oe(t[r]):e[r]=t[r];return e};const le=oe;class ce extends t.DisplayObject{constructor(e){let{style:n,...i}=e;super(at({},{type:"column"},{style:n,...i})),function(t,e,n){e=function(t){var e=function(t,e){if("object"!=typeof t||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var i=n.call(t,"string");if("object"!=typeof i)return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==typeof e?e:String(e)}(e),e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n}(this,"columnsGroup",void 0),this.columnsGroup=new t.Group({name:"columns"}),this.appendChild(this.columnsGroup),this.render()}render(){const{columns:t}=this.attributes;G(this.columnsGroup).selectAll(".column").data(t.flat()).join((t=>t.append("rect").attr("className","column").each((function(t){this.attr(t)}))),(t=>t.each((function(t){this.attr(t)}))),(t=>t.remove()))}update(t){this.attr(y({},this.attributes,t)),this.render()}clear(){this.removeChildren()}}function ue(t,e,n){return e=function(t){var e=function(t,e){if("object"!=typeof t||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var i=n.call(t,"string");if("object"!=typeof i)return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==typeof e?e:String(e)}(e),e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}class he extends t.DisplayObject{constructor(e){let{style:n,...i}=e;super(at({},{type:"lines"},{style:n,...i})),ue(this,"linesGroup",this.appendChild(new t.Group)),ue(this,"areasGroup",this.appendChild(new t.Group)),this.render()}render(){const{lines:t,areas:e}=this.attributes;t&&this.renderLines(t),e&&this.renderAreas(e)}clear(){this.linesGroup.removeChildren(),this.areasGroup.removeChildren()}update(t){this.attr(y({},this.attributes,t)),this.render()}renderLines(t){G(this.linesGroup).selectAll(".line").data(t).join((t=>t.append("path").attr("className","line").each((function(t){this.attr(t)}))),(t=>t.each((function(t){this.attr(t)}))),(t=>t.remove()))}renderAreas(t){G(this.linesGroup).selectAll(".area").data(t).join((t=>t.append("path").attr("className","area").each((function(t){this.attr(t)}))),(t=>t.each((function(t){this.style(t)}))),(t=>t.remove()))}}const de=function(t,e,n){return t<e?e:t>n?n:t},pe=function(t){return null!==t&&"function"!=typeof t&&isFinite(t.length)};var fe=function(t,e){if(t===e)return!0;if(!t||!e)return!1;if(U(t)||U(e))return!1;if(pe(t)||pe(e)){if(t.length!==e.length)return!1;for(var n=!0,i=0;i<t.length&&(n=fe(t[i],e[i]));i++);return n}if(h(t)||h(e)){var r=Object.keys(t),s=Object.keys(e);if(r.length!==s.length)return!1;for(n=!0,i=0;i<r.length&&(n=fe(t[r[i]],e[r[i]]));i++);return n}return!1};const ge=fe;function me(t,e){return[t[0]*e,t[1]*e]}function ye(t,e){return[t[0]+e[0],t[1]+e[1]]}function be(t,e){return[t[0]-e[0],t[1]-e[1]]}function ve(t,e){return[Math.min(t[0],e[0]),Math.min(t[1],e[1])]}function xe(t,e){return[Math.max(t[0],e[0]),Math.max(t[1],e[1])]}function we(t,e){return Math.sqrt((t[0]-e[0])**2+(t[1]-e[1])**2)}function Se(t){if(0===t[0]&&0===t[1])return[0,0];const e=Math.sqrt(t[0]**2+t[1]**2);return[t[0]/e,t[1]/e]}function ke(t,e,n){const[i,r]=t,[s,a]=e,o=i-s,l=r-a,c=Math.sin(n),u=Math.cos(n);return[o*u-l*c+s,o*c+l*u+a]}function Ae(t,e){return e?[t[1],-t[0]]:[-t[1],t[0]]}function Le(t){let e=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[[0,0],[1,1]];const n=!!(arguments.length>1&&void 0!==arguments[1]&&arguments[1]),i=[];for(let e=0,n=t.length;e<n;e+=2)i.push([t[e],t[e+1]]);const r=function(t,e,n,i){const r=[],s=!!i;let a,o,l,c,u,h=[1/0,1/0],d=[-1/0,-1/0];if(s){[h,d]=i;for(let e=0,n=t.length;e<n;e+=1){const n=t[e];h=ve(h,n),d=xe(d,n)}}for(let e=0,i=t.length;e<i;e+=1){const p=t[e];if(0!==e||n)if(e!==i-1||n){a=t[[e?e-1:i-1,e-1][n?0:1]],o=t[n?(e+1)%i:e+1];let f=[0,0];f=be(o,a),f=me(f,.4);let g=we(p,a),m=we(p,o);const y=g+m;0!==y&&(g/=y,m/=y);let b=me(f,-g),v=me(f,m);c=ye(p,b),l=ye(p,v),l=ve(l,xe(o,p)),l=xe(l,ve(o,p)),b=be(l,p),b=me(b,-g/m),c=ye(p,b),c=ve(c,xe(a,p)),c=xe(c,ve(a,p)),v=be(p,c),v=me(v,m/g),l=ye(p,v),s&&(c=xe(c,h),c=ve(c,d),l=xe(l,h),l=ve(l,d)),r.push(u),r.push(c),u=l}else c=p,r.push(u),r.push(c);else u=p}return n&&r.push(r.shift()),r}(i,0,n,e),s=i.length,a=[];let o,l,c;for(let t=0;t<s-1;t+=1)o=r[2*t],l=r[2*t+1],c=i[t+1],a.push(["C",o[0],o[1],l[0],l[1],c[0],c[1]]);return n&&(o=r[s],l=r[s+1],[c]=i,a.push(["C",o[0],o[1],l[0],l[1],c[0],c[1]])),a}function Pe(t){let e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];const n=e?t.length-1:0,i=t.map(((t,e)=>[e===n?"M":"L",...t]));return e?i.reverse():i}function Ee(t){let e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(t.length<=2)return Pe(t);const n=[],i=t.length;for(let r=0;r<i;r+=1){const s=e?t[i-r-1]:t[r];ge(s,n.slice(-2))||n.push(...s)}const r=Le(n,!1);return e?r.unshift(["M",...t[i-1]]):r.unshift(["M",...t[0]]),r}function Be(t,e,n){const i=le(t);return i.push(["L",e,n],["L",0,n],["Z"]),i}const Ce=function(t){if(g(t))return t.reduce((function(t,e){return Math.min(t,e)}),t[0])},Me=function(t,e){if(g(t)){for(var n,i=1/0,r=0;r<t.length;r++){var s=t[r],a=V(e)?e(s):s[e];a<i&&(n=s,i=a)}return n}},Oe=function(t){if(g(t))return t.reduce((function(t,e){return Math.max(t,e)}),t[0])},Te=function(t,e){if(g(t)){for(var n,i=-1/0,r=0;r<t.length;r++){var s=t[r],a=V(e)?e(s):s[e];a>i&&(n=s,i=a)}return n}};function je(t){return 0===t.length?[0,0]:[Ce(Me(t,(t=>Ce(t)||0))),Oe(Te(t,(t=>Oe(t)||0)))]}function Ne(t){const e=le(t),n=e[0].length,[i,r]=[Array(n).fill(0),Array(n).fill(0)];for(let t=0;t<e.length;t+=1){const s=e[t];for(let t=0;t<n;t+=1)s[t]>=0?(s[t]+=i[t],i[t]=s[t]):(s[t]+=r[t],r[t]=s[t])}return e}class _e extends x{get rawData(){const{data:t}=this.attributes;if(!t||0===(null==t?void 0:t.length))return[[]];const e=le(t);return O(e[0])?[e]:e}get data(){return this.attributes.isStack?Ne(this.rawData):this.rawData}get scales(){return this.createScales(this.data)}get baseline(){const{y:t}=this.scales,[e,n]=t.getOptions().domain||[0,0];return n<0?t.map(n):t.map(e<0?0:e)}get containerShape(){const{width:t,height:e}=this.attributes;return{width:t,height:e}}get linesStyle(){const{type:t,isStack:e,smooth:n}=this.attributes;if("line"!==t)throw new Error("linesStyle can only be used in line type");const i=B(this.attributes,"area"),r=B(this.attributes,"line"),{width:s}=this.containerShape,{data:a}=this;if(0===a[0].length)return{lines:[],areas:[]};const{x:o,y:l}=this.scales,c=function(t,e){const{x:n,y:i}=e;let[r,s]=i.getOptions().range||[0,0];return s>r&&([s,r]=[r,s]),t.map((t=>t.map(((t,e)=>[n.map(e),de(i.map(t),s,r)]))))}(a,{type:"line",x:o,y:l});let u=[];if(i){const{baseline:t}=this;u=e?n?function(t,e,n){const i=[];for(let r=t.length-1;r>=0;r-=1){const s=t[r],a=Ee(s);let o;if(0===r)o=Be(a,e,n);else{const e=Ee(t[r-1],!0),n=s[0];e[0][0]="L",o=[...a,...e,["M",...n],["Z"]]}i.push(o)}return i}(c,s,t):function(t,e,n){const i=[];for(let r=t.length-1;r>=0;r-=1){const s=Pe(t[r]);let a;if(0===r)a=Be(s,e,n);else{const e=Pe(t[r-1],!0);e[0][0]="L",a=[...s,...e,["Z"]]}i.push(a)}return i}(c,s,t):function(t,e,n,i){return t.map((t=>Be(e?Ee(t):Pe(t),n,i)))}(c,n,s,t)}return{lines:c.map(((t,e)=>({stroke:this.getColor(e),path:n?Ee(t):Pe(t),...r}))),areas:u.map(((t,e)=>({path:t,fill:this.getColor(e),...i})))}}get columnsStyle(){const t=B(this.attributes,"column"),{isStack:e,type:n,scale:i}=this.attributes;if("column"!==n)throw new Error("columnsStyle can only be used in column type");const{height:r}=this.containerShape;let{rawData:s}=this;if(!s)return{columns:[]};e&&(s=Ne(s));const{x:a,y:o}=this.createScales(s),[l,c]=je(s),u=new $t({domain:[0,c-(l>0?0:l)],range:[0,r*i]}),h=a.getBandWidth(),{rawData:d}=this;return{columns:s.map(((n,i)=>n.map(((n,r)=>{const l=h/s.length;return{fill:this.getColor(i),...t,...e?{x:a.map(r),y:o.map(n),width:h,height:u.map(d[i][r])}:{x:a.map(r)+l*i,y:n>=0?o.map(n):o.map(0),width:l,height:u.map(Math.abs(n))}}}))))}}constructor(t){super(t,{type:"line",width:200,height:20,isStack:!1,color:["#83daad","#edbf45","#d2cef9","#e290b3","#6f63f4"],smooth:!0,lineLineWidth:1,areaOpacity:0,isGroup:!1,columnLineWidth:1,columnStroke:"#fff",scale:1,spacing:0})}render(t,e){H(e,".container","rect").attr("className","container").node();const{type:n}=t,i="spark".concat(n),r="line"===n?this.linesStyle:this.columnsStyle;G(e).selectAll(".spark").data([n]).join((t=>t.append((t=>"line"===t?new he({className:i,style:r}):new ce({className:i,style:r}))).attr("className","spark ".concat(i))),(t=>t.update(r)),(t=>t.remove()))}getColor(t){const{color:e}=this.attributes;return g(e)?e[t%e.length]:V(e)?e.call(null,t):e}createScales(t){var e,n;const{type:i,scale:r,range:s=[],spacing:a}=this.attributes,{width:o,height:l}=this.containerShape,[c,u]=je(t),h=new $t({domain:[null!==(e=s[0])&&void 0!==e?e:c,null!==(n=s[1])&&void 0!==n?n:u],range:[l,l*(1-r)]});return"line"===i?{type:i,x:new $t({domain:[0,t[0].length-1],range:[0,o]}),y:h}:{type:i,x:new ae({domain:t[0].map(((t,e)=>e)),range:[0,o],paddingInner:a,paddingOuter:a/2,align:.5}),y:h}}}function ze(t){if(!t)return{enter:!1,update:!1,exit:!1};const e=["enter","update","exit"],n=Object.fromEntries(Object.entries(t).filter((t=>{let[n]=t;return!e.includes(n)})));return Object.fromEntries(e.map((e=>function(t){return"boolean"!=typeof t&&"enter"in t&&"update"in t&&"exit"in t}(t)?!1===t[e]?[e,!1]:[e,{...t[e],...n}]:[e,n])))}function Ie(t,e){t?t.finished.then(e):e()}function Fe(t,e){"update"in t?t.update(e):t.attr(e)}function Ge(t,e,n){return 0===e.length?null:n?t.animate(e,n):(Fe(t,{style:e.slice(-1)[0]}),null)}function He(t,n,i){const r={},s={};return Object.entries(n).forEach((n=>{let[i,a]=n;if(!e(a)){const e=t.style[i]||t.parsedStyle[i]||0;e!==a&&(r[i]=e,s[i]=a)}})),i?Ge(t,[r,s],{fill:"both",...i}):(Fe(t,s),null)}function Ve(t){const{canvas:e,touches:n,offsetX:i,offsetY:r}=t;if(e){const{x:t,y:n}=e;return[t,n]}if(n){const{clientX:t,clientY:e}=n[0];return[t,e]}return i&&r?[i,r]:[0,0]}function We(t,e){return+t.toPrecision(e)}function De(t){return t.toLocaleString()}function Re(t){return t.toExponential()}function Ye(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return Math.abs(t)<1e3?String(t):"".concat(We(t/1e3,e).toLocaleString(),"K")}!function(t,e,n){e=function(t){var e=function(t,e){if("object"!=typeof t||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var i=n.call(t,"string");if("object"!=typeof i)return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==typeof e?e:String(e)}(e),e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n}(_e,"tag","sparkline");const qe=(t,e,n)=>t<0&&Number.isFinite(t)?e:n,Ke=(t,e,n)=>t>0&&Number.isFinite(t)?e:n,Ze=(t,e)=>t*e,Ue=(t,e)=>t/2+(e||0)/2,$e=(t,e)=>{const n=t=>"".concat(e,"-").concat(t),i=Object.fromEntries(Object.entries(t).map((t=>{let[e,i]=t;const r=n(i);return[e,{name:r,class:".".concat(r),id:"#".concat(r),toString:()=>r}]})));return Object.assign(i,{prefix:n}),i},Xe={fill:"#fff",lineWidth:1,radius:2,size:10,stroke:"#bfbfbf",strokeOpacity:1,zIndex:0},Je={fill:"#000",fillOpacity:.45,fontSize:12,textAlign:"center",textBaseline:"middle",zIndex:1},Qe={orientation:"horizontal",showLabel:!0,type:"start"},tn=$e({foreground:"foreground",handle:"handle",selection:"selection",sparkline:"sparkline",sparklineGroup:"sparkline-group",track:"track",brushArea:"brush-area"},"slider");function en(t,e,n){return e=function(t){var e=function(t,e){if("object"!=typeof t||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var i=n.call(t,"string");if("object"!=typeof i)return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==typeof e?e:String(e)}(e),e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}const nn=$e({labelGroup:"label-group",label:"label",iconGroup:"icon-group",icon:"icon",iconRect:"icon-rect",iconLine:"icon-line"},"handle");class rn extends x{render(t,e){const{size:n=10,radius:i=n/4,orientation:r,...s}=t,a=n,o=2.4*a,l=G(e).maybeAppendByClassName(nn.iconRect,"rect").styles({...s,width:a,height:o,radius:i,x:-a/2,y:-o/2}),c=1/3*a,u=2/3*a,h=1/4*o,d=3/4*o;l.maybeAppendByClassName("".concat(nn.iconLine,"-1"),"line").styles({x1:c,x2:c,y1:h,y2:d,...s}),l.maybeAppendByClassName("".concat(nn.iconLine,"-2"),"line").styles({x1:u,x2:u,y1:h,y2:d,...s}),l.node().setOrigin(a/2,o/2),"vertical"===r?e.setLocalEulerAngles(90):e.setLocalEulerAngles(0)}}class sn extends x{constructor(t){super(t,Qe),en(this,"label",void 0),en(this,"icon",void 0)}renderLabel(t){const{showLabel:e}=this.attributes,{transform:n,...i}=B(this.attributes,"label"),[r,s]=M(i,[]),a=G(t).maybeAppendByClassName(nn.labelGroup,"g").styles(s),{text:o,...l}={...Je,...r};W(!!e,a,(t=>{this.label=t.maybeAppendByClassName(nn.label,"text").styles({...l,transform:n,text:"".concat(o)}),this.label.on("mousedown",(t=>{t.stopPropagation()})),this.label.on("touchstart",(t=>{t.stopPropagation()}))}))}renderIcon(t){const{orientation:e,type:n}=this.attributes,i={orientation:e,...Xe,...B(this.attributes,"icon")},{iconShape:r=(()=>new rn({style:i}))}=this.attributes;G(t).maybeAppendByClassName(nn.iconGroup,"g").selectAll(nn.icon.class).data([r]).join((t=>t.append("string"==typeof r?r:()=>r(n)).attr("className",nn.icon.name)),(t=>t.update(i)),(t=>t.remove()))}render(t,e){this.renderIcon(e),this.renderLabel(e)}}function an(t,e,n){return e=function(t){var e=function(t,e){if("object"!=typeof t||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var i=n.call(t,"string");if("object"!=typeof i)return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==typeof e?e:String(e)}(e),e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}class on extends x{get values(){return this.attributes.values}set values(t){this.attributes.values=this.clampValues(t)}get sparklineStyle(){const{orientation:t}=this.attributes;if("horizontal"!==t)return null;const e=B(this.attributes,"sparkline");return{zIndex:0,...this.availableSpace,...e}}get shape(){const{trackLength:t,trackSize:e}=this.attributes,[n,i]=this.getOrientVal([[t,e],[e,t]]);return{width:n,height:i}}get availableSpace(){const{padding:t}=this.attributes,[e,n,i,r]=T(t),{width:s,height:a}=this.shape;return{x:r,y:e,width:s-(r+n),height:a-(e+i)}}constructor(e){super(e,{animate:{duration:100,fill:"both"},brushable:!0,formatter:t=>t.toString(),handleSpacing:2,orientation:"horizontal",padding:0,autoFitLabel:!0,scrollable:!0,selectionFill:"#5B8FF9",selectionFillOpacity:.45,selectionZIndex:2,showHandle:!0,showLabel:!0,slidable:!0,trackFill:"#416180",trackLength:200,trackOpacity:.05,trackSize:20,trackZIndex:-1,values:[0,1],type:"range",selectionType:"select",handleIconOffset:0,...C(Qe,"handle"),...C(Xe,"handleIcon"),...C(Je,"handleLabel")}),an(this,"range",[0,1]),an(this,"trackShape",void 0),an(this,"brushArea",void 0),an(this,"foregroundGroup",void 0),an(this,"selectionShape",void 0),an(this,"startHandle",void 0),an(this,"endHandle",void 0),an(this,"selectionStartPos",void 0),an(this,"selectionWidth",void 0),an(this,"prevPos",void 0),an(this,"target",void 0),an(this,"onDragStart",(t=>e=>{e.stopPropagation(),this.target=t,this.prevPos=this.getOrientVal(Ve(e));const{x:n,y:i}=this.availableSpace,{x:r,y:s}=this.getBBox();this.selectionStartPos=this.getRatio(this.prevPos-this.getOrientVal([n,i])-this.getOrientVal([+r,+s])),this.selectionWidth=0,document.addEventListener("pointermove",this.onDragging),document.addEventListener("pointerup",this.onDragEnd)})),an(this,"onDragging",(t=>{const{slidable:e,brushable:n,type:i}=this.attributes;t.stopPropagation();const r=this.getOrientVal(Ve(t)),s=r-this.prevPos;if(!s)return;const a=this.getRatio(s);switch(this.target){case"start":e&&this.setValuesOffset(a);break;case"end":e&&this.setValuesOffset(0,a);break;case"selection":e&&this.setValuesOffset(a,a);break;case"track":if(!n)return;this.selectionWidth+=a,"range"===i?this.innerSetValues([this.selectionStartPos,this.selectionStartPos+this.selectionWidth].sort(),!0):this.innerSetValues([0,this.selectionStartPos+this.selectionWidth],!0)}this.prevPos=r})),an(this,"onDragEnd",(()=>{document.removeEventListener("pointermove",this.onDragging),document.removeEventListener("pointermove",this.onDragging),document.removeEventListener("pointerup",this.onDragEnd),this.target="",this.updateHandlesPosition(!1)})),an(this,"onValueChange",(e=>{const{onChange:n,type:i}=this.attributes,r="range"===i?e:e[1],s="range"===i?this.getValues():this.getValues()[1],a=new t.CustomEvent("valuechange",{detail:{oldValue:r,value:s}});this.dispatchEvent(a),null==n||n(s)})),this.selectionStartPos=0,this.selectionWidth=0,this.prevPos=0,this.target=""}getValues(){return this.values}setValues(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[0,0],e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];this.attributes.values=t;const n=!1!==e&&this.attributes.animate;this.updateSelectionArea(n),this.updateHandlesPosition(n)}updateSelectionArea(t){const e=this.calcSelectionArea();this.foregroundGroup.selectAll(tn.selection.class).each((function(n,i){He(this,e[i],t)}))}updateHandlesPosition(t){this.attributes.showHandle&&(this.startHandle&&He(this.startHandle,this.getHandleStyle("start"),t),this.endHandle&&He(this.endHandle,this.getHandleStyle("end"),t))}innerSetValues(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[0,0],e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];const n=this.values,i=this.clampValues(t);this.attributes.values=i,this.setValues(i),e&&this.onValueChange(n)}renderTrack(t){const e=B(this.attributes,"track");this.trackShape=G(t).maybeAppendByClassName(tn.track,"rect").styles({...this.shape,...e})}renderBrushArea(t){const{brushable:e}=this.attributes;this.brushArea=G(t).maybeAppendByClassName(tn.brushArea,"rect").styles({fill:"transparent",cursor:e?"crosshair":"default",...this.shape})}renderSparkline(t){const{orientation:e}=this.attributes;W("horizontal"===e,G(t).maybeAppendByClassName(tn.sparklineGroup,"g"),(t=>{const e=this.sparklineStyle;t.maybeAppendByClassName(tn.sparkline,(()=>new _e({style:e}))).update(e)}))}renderHandles(){var t;const{showHandle:e,type:n}=this.attributes,i=e?"range"===n?["start","end"]:["end"]:[],r=this;null===(t=this.foregroundGroup)||void 0===t||t.selectAll(tn.handle.class).data(i.map((t=>({type:t}))),(t=>t.type)).join((t=>t.append((t=>{let{type:e}=t;return new sn({style:this.getHandleStyle(e)})})).each((function(t){let{type:e}=t;this.attr("class","".concat(tn.handle.name," ").concat(e,"-handle"));const n="".concat(e,"Handle");r[n]=this,this.addEventListener("pointerdown",r.onDragStart(e))}))),(t=>t.each((function(t){let{type:e}=t;this.update(r.getHandleStyle(e))}))),(t=>t.each((t=>{let{type:e}=t;const n="".concat(e,"Handle");r[n]=void 0})).remove()))}renderSelection(t){const{type:e,selectionType:n}=this.attributes;this.foregroundGroup=G(t).maybeAppendByClassName(tn.foreground,"g");const i=B(this.attributes,"selection"),r=t=>t.style("visibility",(t=>t.show?"visible":"hidden")).style("cursor",(t=>"select"===n?"grab":"invert"===n?"crosshair":"default")).styles(i),s=this;this.foregroundGroup.selectAll(tn.selection.class).data("value"===e?[]:this.calcSelectionArea().map(((t,e)=>({style:{...t},index:e,show:"select"===n?1===e:1!==e}))),(t=>t.index)).join((t=>t.append("rect").attr("className",tn.selection.name).call(r).each((function(t,e){1===e?(s.selectionShape=G(this),this.on("pointerdown",(t=>{this.attr("cursor","grabbing"),s.onDragStart("selection")(t)})),s.dispatchCustomEvent(this,"pointerenter","selectionMouseenter"),s.dispatchCustomEvent(this,"pointerleave","selectionMouseleave"),s.dispatchCustomEvent(this,"click","selectionClick"),this.addEventListener("pointerdown",(()=>{this.attr("cursor","grabbing")})),this.addEventListener("pointerup",(()=>{this.attr("cursor","pointer")})),this.addEventListener("pointerover",(()=>{this.attr("cursor","pointer")}))):this.on("pointerdown",s.onDragStart("track"))}))),(t=>t.call(r)),(t=>t.remove())),this.updateSelectionArea(!1),this.renderHandles()}render(t,e){this.renderTrack(e),this.renderSparkline(e),this.renderBrushArea(e),this.renderSelection(e)}clampValues(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:4;const[n,i]=this.range,[r,s]=this.getValues().map((t=>We(t,e))),a=Array.isArray(t)?t:[r,null!=t?t:s];let[o,l]=(a||[r,s]).map((t=>We(t,e)));if("value"===this.attributes.type)return[0,de(l,n,i)];o>l&&([o,l]=[l,o]);const c=l-o;return c>i-n?[n,i]:o<n?r===n&&s===l?[n,l]:[n,c+n]:l>i?s===i&&r===o?[o,i]:[i-c,i]:[o,l]}calcSelectionArea(t){const[e,n]=this.clampValues(t),{x:i,y:r,width:s,height:a}=this.availableSpace;return this.getOrientVal([[{y:r,height:a,x:i,width:e*s},{y:r,height:a,x:e*s+i,width:(n-e)*s},{y:r,height:a,x:n*s,width:(1-n)*s}],[{x:i,width:s,y:r,height:e*a},{x:i,width:s,y:e*a+r,height:(n-e)*a},{x:i,width:s,y:n*a,height:(1-n)*a}]])}calcHandlePosition(t){const{handleIconOffset:e}=this.attributes,{x:n,y:i,width:r,height:s}=this.availableSpace,[a,o]=this.clampValues(),l="start"===t?-e:e,c=("start"===t?a:o)*this.getOrientVal([r,s])+l;return{x:n+this.getOrientVal([c,r/2]),y:i+this.getOrientVal([s/2,c])}}inferTextStyle(t){const{orientation:e}=this.attributes;return"horizontal"===e?{}:"start"===t?{transform:"rotate(90)",textAlign:"start"}:"end"===t?{transform:"rotate(90)",textAlign:"end"}:{}}calcHandleText(t){const{type:e,orientation:n,formatter:i,autoFitLabel:r}=this.attributes,s=B(this.attributes,"handle"),a=B(s,"label"),{spacing:o}=s,l=this.getHandleSize(),c=this.clampValues(),u=i("start"===t?c[0]:c[1]),h=new w({style:{...a,...this.inferTextStyle(t),text:u}}),{width:d,height:p}=h.getBBox();if(h.destroy(),!r){if("value"===e)return{text:u,x:0,y:-p-o};const i=o+l+("horizontal"===n?d/2:0);return{text:u,["horizontal"===n?"x":"y"]:"start"===t?-i:i}}let f=0,g=0;const{width:m,height:y}=this.availableSpace,{x:b,y:v,width:x,height:S}=this.calcSelectionArea()[1],k=o+l;if("horizontal"===n){const e=k+d/2;f="start"===t?b-k-d>0?-e:e:m-b-x-k>d?e:-e}else{const e=p+k;g="start"===t?v-l>p?-e:k:y-(v+S)-l>p?e:-k}return{x:f,y:g,text:u}}getHandleLabelStyle(t){return{...B(this.attributes,"handleLabel"),...this.calcHandleText(t),...this.inferTextStyle(t)}}getHandleIconStyle(){const{handleIconShape:t}=this.attributes,e=B(this.attributes,"handleIcon");return{cursor:this.getOrientVal(["ew-resize","ns-resize"]),shape:t,size:this.getHandleSize(),...e}}getHandleStyle(t){const{showLabel:e,showLabelOnInteraction:n,orientation:i}=this.attributes,r=this.calcHandlePosition(t),s=this.calcHandleText(t);let a=e;return!e&&n&&(a=!!this.target),{...C(this.getHandleIconStyle(),"icon"),...C({...this.getHandleLabelStyle(t),...s},"label"),...r,orientation:i,showLabel:a,type:t,zIndex:3}}getHandleSize(){const{handleIconSize:t,width:e,height:n}=this.attributes;return t||Math.floor((this.getOrientVal([+n,+e])+4)/2.4)}getOrientVal(t){let[e,n]=t;const{orientation:i}=this.attributes;return"horizontal"===i?e:n}setValuesOffset(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];const{type:i}=this.attributes,[r,s]=this.getValues(),a=[r+("range"===i?t:0),s+e].sort();n?this.setValues(a):this.innerSetValues(a,!0)}getRatio(t){const{width:e,height:n}=this.availableSpace;return t/this.getOrientVal([e,n])}dispatchCustomEvent(e,n,i){e.on(n,(e=>{e.stopPropagation(),this.dispatchEvent(new t.CustomEvent(i,{detail:e}))}))}bindEvents(){this.addEventListener("wheel",this.onScroll);const t=this.brushArea;this.dispatchCustomEvent(t,"click","trackClick"),this.dispatchCustomEvent(t,"pointerenter","trackMouseenter"),this.dispatchCustomEvent(t,"pointerleave","trackMouseleave"),t.on("pointerdown",this.onDragStart("track"))}onScroll(t){const{scrollable:e}=this.attributes;if(e){const{deltaX:e,deltaY:n}=t,i=n||e,r=this.getRatio(i);this.setValuesOffset(r,r,!0)}}}function ln(t,e,n){return e=function(t){var e=function(t,e){if("object"!=typeof t||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var i=n.call(t,"string");if("object"!=typeof i)return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==typeof e?e:String(e)}(e),e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}an(on,"tag","slider");class cn extends x{get padding(){const{padding:t}=this.attributes;return T(t)}constructor(e){super(e,{isRound:!0,orientation:"vertical",padding:[2,2,2,2],scrollable:!0,slidable:!0,thumbCursor:"default",trackSize:10,value:0}),ln(this,"slider",void 0),ln(this,"range",[0,1]),ln(this,"onValueChange",(e=>{const{value:n}=this.attributes;if(e===n)return;const i={detail:{oldValue:e,value:n}};this.dispatchEvent(new t.CustomEvent("scroll",i)),this.dispatchEvent(new t.CustomEvent("valuechange",i))})),ln(this,"onTrackClick",(t=>{const{slidable:e}=this.attributes;if(!e)return;const[n,i]=this.getLocalPosition(),[r,,,s]=this.padding,a=this.getOrientVal([n+s,i+r]),o=(this.getOrientVal(Ve(t))-a)/this.trackLength;this.setValue(o,!0)})),ln(this,"onThumbMouseenter",(e=>{this.dispatchEvent(new t.CustomEvent("thumbMouseenter",{detail:e.detail}))})),ln(this,"onTrackMouseenter",(e=>{this.dispatchEvent(new t.CustomEvent("trackMouseenter",{detail:e.detail}))})),ln(this,"onThumbMouseleave",(e=>{this.dispatchEvent(new t.CustomEvent("thumbMouseleave",{detail:e.detail}))})),ln(this,"onTrackMouseleave",(e=>{this.dispatchEvent(new t.CustomEvent("trackMouseleave",{detail:e.detail}))}))}get value(){const{value:t}=this.attributes,[e,n]=this.range;return de(t,e,n)}get trackLength(){const{viewportLength:t,trackLength:e=t}=this.attributes;return e}get availableSpace(){const{trackSize:t}=this.attributes,e=this.trackLength,[n,i,r,s]=this.padding,[a,o]=this.getOrientVal([[e,t],[t,e]]);return{x:s,y:n,width:+a-(s+i),height:+o-(n+r)}}get trackRadius(){const{isRound:t,trackSize:e}=this.attributes;return t?e/2:0}get thumbRadius(){const{isRound:t,thumbRadius:e}=this.attributes;if(!t)return 0;const{width:n,height:i}=this.availableSpace;return e||this.getOrientVal([i,n])/2}getValues(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.value;const{viewportLength:e,contentLength:n}=this.attributes,i=e/n,[r,s]=this.range,a=t*(s-r-i);return[a,a+i]}getValue(){return this.value}renderSlider(t){const{orientation:e,trackSize:n,padding:i,slidable:r}=this.attributes,s=B(this.attributes,"track"),a=B(this.attributes,"thumb"),o={brushable:!1,orientation:e,padding:i,selectionRadius:this.thumbRadius,showHandle:!1,slidable:r,trackLength:this.trackLength,trackRadius:this.trackRadius,trackSize:n,values:this.getValues(),...C(s,"track"),...C(a,"selection")};this.slider=G(t).maybeAppendByClassName("scrollbar",(()=>new on({style:o}))).update(o).node()}render(t,e){this.renderSlider(e)}setValue(t){let e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];const{value:n}=this.attributes,[i,r]=this.range;this.slider.setValues(this.getValues(de(t,i,r)),e),this.onValueChange(n)}bindEvents(){this.slider.addEventListener("trackClick",(t=>{t.stopPropagation(),this.onTrackClick(t.detail)})),this.onHover()}getOrientVal(t){const{orientation:e}=this.attributes;return"horizontal"===e?t[0]:t[1]}onHover(){this.slider.addEventListener("selectionMouseenter",this.onThumbMouseenter),this.slider.addEventListener("trackMouseenter",this.onTrackMouseenter),this.slider.addEventListener("selectionMouseleave",this.onThumbMouseleave),this.slider.addEventListener("trackMouseleave",this.onTrackMouseleave)}}function un(t,e){if(t.length<=e)return t;const n=Math.floor(t.length/e),i=[];for(let e=0;e<t.length;e+=n)i.push(t[e]);return i}ln(cn,"tag","scrollbar");const hn={data:[],animate:{enter:!1,update:{duration:100,easing:"ease-in-out-sine",fill:"both"},exit:{duration:100,fill:"both"}},showArrow:!0,showGrid:!0,showLabel:!0,showLine:!0,showTick:!0,showTitle:!0,showTrunc:!1,dataThreshold:100,lineLineWidth:1,lineStroke:"black",crossPadding:10,titleFill:"black",titleFontSize:12,titlePosition:"lb",titleSpacing:0,titleTextAlign:"center",titleTextBaseline:"middle",lineArrow:()=>new t.Path({style:{path:[["M",10,10],["L",-10,0],["L",10,-10],["L",0,0],["L",10,10],["Z"]],anchor:"0.5 0.5",fill:"black",transformOrigin:"center"}}),labelAlign:"parallel",labelDirection:"positive",labelFontSize:12,labelSpacing:0,gridConnect:"line",gridControlAngles:[],gridDirection:"positive",gridLength:0,gridType:"segment",lineArrowOffset:15,lineArrowSize:10,tickDirection:"positive",tickLength:5,tickLineWidth:1,tickStroke:"black",labelOverlap:[]},dn=(at({},hn,{style:{type:"arc"}}),at({},hn,{style:{}}),$e({mainGroup:"main-group",gridGroup:"grid-group",grid:"grid",lineGroup:"line-group",line:"line",tickGroup:"tick-group",tick:"tick",tickItem:"tick-item",labelGroup:"label-group",label:"label",labelItem:"label-item",titleGroup:"title-group",title:"title",lineFirst:"line-first",lineSecond:"line-second"},"axis"));function pn(t){return t*Math.PI/180}function fn(t){return Number((180*t/Math.PI).toPrecision(5))}function gn(t,e){return V(t)?t(...e):t}function mn(t,e){return t.style.opacity||(t.style.opacity=1),He(t,{opacity:0},e)}const yn=["$el","anchor","cx","cy","d","defX","defY","dx","dy","fill","fillOpacity","filter","fontFamily","fontSize","fontStyle","fontVariant","fontWeight","height","img","increasedLineWidthForHitTesting","innerHTML","isBillboard","billboardRotation","isSizeAttenuation","isClosed","isOverflowing","leading","letterSpacing","lineDash","lineHeight","lineWidth","markerEnd","markerEndOffset","markerMid","markerStart","markerStartOffset","maxLines","metrics","miterLimit","offsetX","offsetY","opacity","path","points","r","radius","rx","ry","shadowColor","src","stroke","strokeOpacity","text","textAlign","textBaseline","textDecorationColor","textDecorationLine","textDecorationStyle","textOverflow","textPath","textPathSide","textPathStartOffset","transform","transformOrigin","visibility","width","wordWrap","wordWrapWidth","x","x1","x2","y","y1","y2","z1","z2","zIndex"];function bn(t){return yn.includes(t)}function vn(t){const e={};for(const n in t)bn(n)&&(e[n]=t[n]);return e}const xn=$e({lineGroup:"line-group",line:"line",regionGroup:"region-group",region:"region"},"grid");function wn(t){return t.reduce(((t,e,n)=>(t.push([0===n?"M":"L",...e]),t)),[])}function Sn(t,e,n){return"surround"===e.type?function(t,e,n){const{connect:i="line",center:r}=e;if("line"===i)return wn(t);if(!r)return[];const s=we(t[0],r),a=n?0:1;return t.reduce(((t,e,n)=>(0===n?t.push(["M",...e]):t.push(["A",s,s,0,0,a,...e]),t)),[])}(t,e,n):wn(t)}function kn(t,e,n){const{type:i,connect:r,center:s,closed:a}=n,o=a?[["Z"]]:[],[l,c]=[Sn(t,n),Sn(e.slice().reverse(),n,!0)],[u,h]=[t[0],e.slice(-1)[0]],d=(t,e)=>[l,t,c,e,o].flat();if("line"===r||"surround"===i)return d([["L",...h]],[["L",...u]]);if(!s)throw new Error("Arc grid need to specified center");const[p,f]=[we(h,s),we(u,s)];return d([["A",p,p,0,0,1,...h],["L",...h]],[["A",f,f,0,0,0,...u],["L",...u]])}class An extends x{render(t,e){const{type:n,center:i,areaFill:r,closed:s,...a}=t,o=function(t){const{data:e=[],closed:n}=t;return n?e.map((t=>{const{points:e}=t,[n]=e;return{...t,points:[...e,n]}})):e}(t),l=G(e).maybeAppendByClassName(xn.lineGroup,"g"),c=G(e).maybeAppendByClassName(xn.regionGroup,"g"),u=function(t,e,n,i){const{animate:r,isBillboard:s}=n,a=e.map(((t,e)=>({id:t.id||"grid-line-".concat(e),path:Sn(t.points,n)})));return t.selectAll(xn.line.class).data(a,(t=>t.id)).join((t=>t.append("path").each((function(t,e){const n=gn(vn({path:t.path,...i}),[t,e,a]);this.attr({class:xn.line.name,stroke:"#D9D9D9",lineWidth:1,lineDash:[4,4],isBillboard:s,...n})}))),(t=>t.transition((function(t,e){return He(this,gn(vn({path:t.path,...i}),[t,e,a]),r.update)}))),(t=>t.transition((function(){const t=mn(this,r.exit);return Ie(t,(()=>this.remove())),t})))).transitions()}(l,o,t,a),h=function(t,e,n){const{animate:i,connect:r,areaFill:s}=n;if(e.length<2||!s||!r)return[];const a=Array.isArray(s)?s:[s,"transparent"],o=t=>a[t%a.length],l=[];for(let t=0;t<e.length-1;t++){const[i,r]=[e[t].points,e[t+1].points],s=kn(i,r,n);l.push({path:s,fill:o(t)})}return t.selectAll(xn.region.class).data(l,((t,e)=>e)).join((t=>t.append("path").each((function(t,e){const n=gn(t,[t,e,l]);this.attr(n)})).attr("className",xn.region.name)),(t=>t.transition((function(t,e){return He(this,gn(t,[t,e,l]),i.update)}))),(t=>t.transition((function(){const t=mn(this,i.exit);return Ie(t,(()=>this.remove())),t})))).transitions()}(c,o,t);return[...u,...h]}}const Ln=function(t,e,n){for(var i=0,r=U(e)?e.split("."):e;t&&i<r.length;)t=t[r[i++]];return void 0===t||i<r.length?n:t},Pn=function(t,e){return function(n){return t*(1-n)+e*n}};function En(t,e){const n=e?e.length:0,i=t?Math.min(n,t.length):0;return function(r){const s=new Array(i),a=new Array(n);let o=0;for(o=0;o<i;++o)s[o]=Cn(t[o],e[o]);for(;o<n;++o)a[o]=e[o];for(o=0;o<i;++o)a[o]=s[o](r);return a}}function Bn(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const n={},i={};return Object.entries(e).forEach((e=>{let[r,s]=e;r in t?n[r]=Cn(t[r],s):i[r]=s})),function(t){return Object.entries(n).forEach((e=>{let[n,r]=e;return i[n]=r(t)})),i}}function Cn(t,e){return"number"==typeof t&&"number"==typeof e?Pn(t,e):Array.isArray(t)&&Array.isArray(e)?En(t,e):"object"==typeof t&&"object"==typeof e?Bn(t,e):e=>t}function Mn(t,e,n,i){if(!i)return t.attr("__keyframe_data__",n),null;const{duration:r=0}=i,s=Cn(e,n),a=Math.ceil(+r/16),o=new Array(a).fill(0).map(((t,e,n)=>({__keyframe_data__:s(e/(n.length-1))})));return t.animate(o,{fill:"both",...i})}function On(t){return"function"==typeof t?t():U(t)||O(t)?new w({style:{text:String(t)}}):t}function Tn(t,e){let n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];const{width:i,height:r}=t.getBBox(),s=e/Math.max(i,r);return n&&t.scale(s),s}function jn(t,e){const n={},i=Array.isArray(e)?e:[e];for(const e in t)i.includes(e)||(n[e]=t[e]);return n}function Nn(t,e){return Object.fromEntries(Object.entries(t).map((t=>{let[n,i]=t;return[n,gn(i,e)]})))}function _n(t,e){return e&&V(e)?t.filter(e):t}function zn(t,e){const{startAngle:n,endAngle:i}=e;return(i-n)*t+n}function In(t,e){if("linear"===e.type){const{startPos:[t,n],endPos:[i,r]}=e,[s,a]=[i-t,r-n];return Se([s,a])}const n=pn(zn(t,e));return[-Math.sin(n),Math.cos(n)]}function Fn(t,e,n){return Ae(In(t,n),"positive"!==e)}function Gn(t,e){return Fn(t,e.labelDirection,e)}function Hn(t,e){return"linear"===e.type?function(t,e){const{startPos:[n,i],endPos:[r,s]}=e,[a,o]=[r-n,s-i];return[n+a*t,i+o*t]}(t,e):function(t,e){const{radius:n,center:[i,r]}=e,s=pn(zn(t,e));return[i+n*Math.cos(s),r+n*Math.sin(s)]}(t,e)}function Vn(t){return 0===In(0,t)[1]}function Wn(t){return 0===In(0,t)[0]}function Dn(t,e){return e-t==360}function Rn(t,e,n,i,r){const s=e-t,[a,o]=[r,r],[l,c]=[pn(t),pn(e)],u=t=>[n+r*Math.cos(t),i+r*Math.sin(t)],[h,d]=u(l),[p,f]=u(c);if(Dn(t,e)){const t=(c+l)/2,[e,n]=u(t);return[["M",h,d],["A",a,o,0,1,0,e,n],["A",a,o,0,1,0,p,f]]}const g=s>180?1:0,m=t>e?0:1;return"M".concat(h,",").concat(d,",A").concat(a,",").concat(o,",0,").concat(g,",").concat(m,",").concat(p,",").concat(f)}function Yn(t){const[[e,n],[i,r]]=t;return{x1:e,y1:n,x2:i,y2:r}}function qn(t,e,n){const{type:i}=e;let r;const s=B(e,"line");return r="linear"===i?function(t,e,n,i){const{showTrunc:r,startPos:s,endPos:a,truncRange:o,lineExtension:l}=e,[[c,u],[h,d]]=[s,a],[p,f,g,m]=l?function(t,e){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[0,0];const[[i,r],[s,a],[o,l]]=[t,e,n],[c,u]=[s-i,a-r],h=Math.sqrt(c**2+u**2),[d,p]=[-o/h,l/h];return[d*c,d*u,p*c,p*u]}(s,a,l):new Array(4).fill(0),y=e=>t.selectAll(dn.line.class).data(e,((t,e)=>e)).join((t=>t.append("line").attr("className",(t=>"".concat(dn.line.name," ").concat(t.className))).styles(n).transition((function(t){return He(this,Yn(t.line),!1)}))),(t=>t.styles(n).transition((function(t){let{line:e}=t;return He(this,Yn(e),i.update)}))),(t=>t.remove())).transitions();if(!r||!o)return y([{line:[[c+p,u+f],[h+g,d+m]],className:dn.line.name}]);const[b,v]=o,x=h-c,w=d-u,[S,k]=[c+x*b,u+w*b],[A,L]=[c+x*v,u+w*v],P=y([{line:[[c+p,u+f],[S,k]],className:dn.lineFirst.name},{line:[[A,L],[h+g,d+m]],className:dn.lineSecond.name}]);return function(t,e){let{truncRange:n,truncShape:i,lineExtension:r}=e}(0,e),P}(t,e,jn(s,"arrow"),n):function(t,e,n,i){const{startAngle:r,endAngle:s,center:a,radius:o}=e;return t.selectAll(dn.line.class).data([{path:Rn(r,s,...a,o)}],((t,e)=>e)).join((t=>t.append("path").attr("className",dn.line.name).styles(e).styles({path:t=>t.path})),(t=>t.transition((function(){const t=Mn(this,function(t){const{startAngle:e,endAngle:n,center:i,radius:r}=t.attributes;return[e,n,...i,r]}(this),[r,s,...a,o],i.update);if(t){const e=()=>{const t=Ln(this.attributes,"__keyframe_data__");this.style.path=Rn(...t)};t.onframe=e,t.onfinish=e}return t})).styles(e)),(t=>t.remove())).styles(n).transitions()}(t,e,jn(s,"arrow"),n),function(t,e,n,i){const{showArrow:r,showTrunc:s,lineArrow:a,lineArrowOffset:o,lineArrowSize:l}=n;let c;if(c="arc"===e?t.select(dn.line.class):s?t.select(dn.lineSecond.class):t.select(dn.line.class),!r||!a||"arc"===n.type&&Dn(n.startAngle,n.endAngle)){const t=c.node();return void(t&&(t.style.markerEnd=void 0))}const u=On(a);u.attr(i),Tn(u,l,!0),c.style("markerEnd",u).style("markerEndOffset",-o)}(t,i,e,s),r}function Kn(t){const{type:e,gridCenter:n}=t;return"linear"===e?n:n||t.center}function Zn(t,e,n,i){const r=B(n,"grid"),{type:s,areaFill:a}=r,o=Kn(n),l=_n(e,n.gridFilter),c="segment"===s?function(t,e){const{gridLength:n}=e;return t.map(((t,i)=>{let{value:r}=t;const[s,a]=Hn(r,e),[o,l]=me(function(t,e){return Fn(t,e.gridDirection,e)}(r,e),n);return{id:i,points:[[s,a],[s+o,a+l]]}}))}(l,n):function(t,e){const n=e.gridControlAngles,i=Kn(e);if(!i)throw new Error("grid center is not provide");if(t.length<2)throw new Error("Invalid grid data");if(!n||0===n.length)throw new Error("Invalid gridControlAngles");const[r,s]=i;return t.map(((t,i)=>{let{value:a}=t;const[o,l]=Hn(a,e),[c,u]=[o-r,l-s],h=[];return n.forEach((t=>{const e=pn(t),[n,i]=[Math.cos(e),Math.sin(e)],a=c*n-u*i+r,o=c*i+u*n+s;h.push([a,o])})),{points:h,id:i}}))}(l,n),u={...r,center:o,areaFill:V(a)?l.map(((t,e)=>gn(a,[t,e,l]))):a,animate:i,data:c};return t.selectAll(dn.grid.class).data([1]).join((t=>t.append((()=>new An({style:u}))).attr("className",dn.grid.name)),(t=>t.transition((function(){return this.update(u)}))),(t=>t.remove())).transitions()}function Un(t,e,n){return!((arguments.length>3&&void 0!==arguments[3]&&!arguments[3]||t!==e)&&!(arguments.length>4&&void 0!==arguments[4]&&arguments[4]&&t===n))||t>e&&t<n}let $n,Xn;function Jn(t){Xn=t}const Qn=function(t,e,n){if(void 0===n&&(n=128),!V(t))throw new TypeError("Expected a function");var i=function(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];var s=e?e.apply(this,n):n[0],a=i.cache;if(a.has(s))return a.get(s);var o=t.apply(this,n);return a.set(s,o),o};return i.cache=function(t){var e,n,i,r=t||1;function s(t,s){++e>r&&(i=n,a(1),++e),n[t]=s}function a(t){e=0,n=Object.create(null),t||(i=Object.create(null))}return a(),{clear:a,has:function(t){return void 0!==n[t]||void 0!==i[t]},get:function(t){var e=n[t];return void 0!==e?e:void 0!==(e=i[t])?(s(t,e),e):void 0},set:function(t,e){void 0!==n[t]?n[t]=e:s(t,e)}}}(n),i}(((e,n)=>{const{fontSize:i,fontFamily:r,fontWeight:s,fontStyle:a,fontVariant:o}=n;return Xn?Xn(e,i):($n||($n=t.runtime.offscreenCanvasCreator.getOrCreateContext(void 0)),$n.font=[a,o,s,"".concat(i,"px"),r].join(" "),$n.measureText(e).width)}),((t,e)=>[t,Object.values(e||ti(t)).join()].join("")),4096),ti=t=>{const e=t.style.fontFamily||"sans-serif",n=t.style.fontWeight||"normal",i=t.style.fontStyle||"normal",r=t.style.fontVariant;let s=t.style.fontSize;return s="object"==typeof s?s.value:s,{fontSize:s,fontFamily:e,fontWeight:n,fontStyle:i,fontVariant:r}};function ei(t){return"text"===t.nodeName?t:"g"===t.nodeName&&1===t.children.length&&"text"===t.children[0].nodeName?t.children[0]:null}function ni(t,e){const n=ei(t);n&&n.attr(e)}function ii(t,e){ni(t,{wordWrap:!0,wordWrapWidth:e,maxLines:1,textOverflow:arguments.length>2&&void 0!==arguments[2]?arguments[2]:"..."})}function ri(t,e){ni(t,{wordWrap:!0,wordWrapWidth:e,maxLines:arguments.length>2&&void 0!==arguments[2]?arguments[2]:2,textBaseline:arguments.length>3&&void 0!==arguments[3]?arguments[3]:"top"})}function si(t,e,n){const{width:i,height:r}=t.getBBox(),[s,a]=[e,n].map(((t,e)=>{var n;return t.includes("%")?parseFloat((null===(n=t.match(/[+-]?([0-9]*[.])?[0-9]+/))||void 0===n?void 0:n[0])||"0")/100*(0===e?i:r):t}));return[s,a]}function ai(t,e){if(e)try{const n=/translate\(([+-]*[\d]+[%]*),[ ]*([+-]*[\d]+[%]*)\)/g,i=e.replace(n,((e,n,i)=>"translate(".concat(si(t,n,i),")")));t.attr("transform",i)}catch(t){}}const oi=t=>void 0!==t&&null!=t&&!Number.isNaN(t);function li(t,e,n){return e=function(t){var e=function(t,e){if("object"!=typeof t||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var i=n.call(t,"string");if("object"!=typeof i)return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==typeof e?e:String(e)}(e),e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}class ci{constructor(t,e,n,i){li(this,"x1",void 0),li(this,"y1",void 0),li(this,"x2",void 0),li(this,"y2",void 0),this.set(t,e,n,i)}get left(){return this.x1}get top(){return this.y1}get right(){return this.x2}get bottom(){return this.y2}get width(){return this.defined("x2")&&this.defined("x1")?this.x2-this.x1:void 0}get height(){return this.defined("y2")&&this.defined("y1")?this.y2-this.y1:void 0}rotatedPoints(t,e,n){const{x1:i,y1:r,x2:s,y2:a}=this,o=Math.cos(t),l=Math.sin(t),c=e-e*o+n*l,u=n-e*l-n*o;return[[o*i-l*a+c,l*i+o*a+u],[o*s-l*a+c,l*s+o*a+u],[o*i-l*r+c,l*i+o*r+u],[o*s-l*r+c,l*s+o*r+u]]}set(t,e,n,i){return n<t?(this.x2=t,this.x1=n):(this.x1=t,this.x2=n),i<e?(this.y2=e,this.y1=i):(this.y1=e,this.y2=i),this}defined(t){return this[t]!==Number.MAX_VALUE&&this[t]!==-Number.MAX_VALUE}}function ui(t,e){const n=t.getEulerAngles()||0;t.setEulerAngles(0);const{min:[i,r],max:[s,a]}=t.getLocalBounds(),{width:o,height:l}=hi(t);let c=l,u=0,h=0,d=i,p=r;const f=ei(t);if(f){c-=1.5;const t=f.style.textAlign,e=f.style.textBaseline;"center"===t?d=(i+s)/2:"right"!==t&&"end"!==t||(d=s),"middle"===e?p=(r+a)/2:"bottom"===e&&(p=a)}const[g=0,m=0,y=g,b=m]=T(e),v=new ci((u+=i)-b,(h+=r)-g,u+o+m,h+c+y);return t.setEulerAngles(n),v.rotatedPoints(pn(n),d,p)}function hi(t){return t.__bbox__?t.__bbox__:t.getBBox()}function di(t,e){return e[0]<=Math.max(t[0][0],t[1][0])&&e[0]<=Math.min(t[0][0],t[1][0])&&e[1]<=Math.max(t[0][1],t[1][1])&&e[1]<=Math.min(t[0][1],t[1][1])}function pi(t,e,n){const i=(e[1]-t[1])*(n[0]-e[0])-(e[0]-t[0])*(n[1]-e[1]);return 0===i?0:i<0?2:1}function fi(t,e){const n=pi(t[0],t[1],e[0]),i=pi(t[0],t[1],e[1]),r=pi(e[0],e[1],t[0]),s=pi(e[0],e[1],t[1]);return n!==i&&r!==s||!(0!==n||!di(t,e[0]))||!(0!==i||!di(t,e[1]))||!(0!==r||!di(e,t[0]))||!(0!==s||!di(e,t[1]))}function gi(t,e){return[[t[0],t[1],t[2],t[3]],[t[2],t[3],t[4],t[5]],[t[4],t[5],t[6],t[7]],[t[6],t[7],t[0],t[1]]].some((t=>function(t,e){const[n,i,r,s]=t,[a,o,l,c]=e,u=r-n,h=s-i,d=l-a,p=c-o,f=u*p-d*h;if(0===f)return!1;const g=f>0,m=n-a,y=i-o,b=u*y-h*m;if(b<0===g)return!1;const v=d*y-p*m;return v<0!==g&&b>f!==g&&v>f!==g}(e,t)))}function mi(t,e,n){const{crossPadding:i}=e,r=new Set;let s=null;const a=function(t,e){const{type:n,labelDirection:i,crossSize:r}=t;if(!r)return!1;if("arc"===n){const{center:n,radius:s}=t,[a,o]=n,l="negative"===i?0:r,c=-s-l,u=s+l,[h,d,p,f]=T(e);return new ci(a+c-f,o+c-h,a+u+d,o+u+p)}const{startPos:[s,a],endPos:[o,l]}=t,[c,u,h,d]=Wn(t)?[-e,0,e,0]:[0,e,0,-e],p=me(Gn(0,t),r),f=new ci(s,a,o,l);return f.x1+=d,f.y1+=c,f.x2+=u+p[0],f.y2+=h+p[1],f}(e,i),o=t=>!a||function(t,e,n){const{x1:i,x2:r,y1:s,y2:a}=t;return o=[[i,s],[r,s],[r,a],[i,a]],ui(e,void 0).every((t=>function(t,e){const n=t.length;if(n<3)return!1;const i=[e,[9999,e[1]]];let r=0,s=0;do{const a=[t[s],t[(s+1)%n]];if(fi(a,i)){if(0===pi(a[0],e,a[1]))return di(a,e);r++}s=(s+1)%n}while(0!==s);return!!(1&r)}(o,t)));var o}(a,t);for(const e of t)o(e)?s&&(c=e,(l=s)&&function(t,e,n){const i=ui(t,n).flat(1),r=ui(e,n).flat(1),s=[[i[0],i[1],i[2],i[3]],[i[0],i[1],i[4],i[5]],[i[4],i[5],i[6],i[7]],[i[2],i[3],i[6],i[7]]];for(const t of s)if(gi(r,t))return!0;return!1}(l,c,T(n)))?(r.add(s),r.add(e)):s=e:r.add(e);var l,c;return Array.from(r)}function yi(t){let n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return e(t)?0:"number"==typeof t?t:Math.floor(Qn(t,n))}function bi(t){const e=t&&t.getRenderBounds();if(!e)return{width:0,height:0};const n=e.getMax(),i=e.getMin();return{width:n[0]-i[0],height:n[1]-i[1]}}function vi(t){const{min:e,max:n}=t.getLocalBounds(),[[i,r],[s,a]]=[e,n];return{x:i,y:r,width:s-i,height:a-r,left:i,bottom:a,top:r,right:s}}function xi(t,e){const n=G(t).append("text").node();return n.attr({...e,visibility:"hidden"}),n}function wi(t,e){const[n,i]=t,[r,s]=e;return n!==r&&i===s}function Si(t,e){const[n,i]=t,[r,s]=e;return n===r&&i!==s}function ki(t,e){const{attributes:n}=e;for(const[e,i]of Object.entries(n))"id"!==e&&"className"!==e&&t.attr(e,i)}const Ai=(t,e)=>{let{seq:n=2}=e;return t.filter(((t,e)=>!(e%n&&(a(t),1))))},Li=new Map([["hide",function(t,e,n,i){const r=t.length,{keepHeader:s,keepTail:a}=e;if(r<=1||2===r&&s&&a)return;const o=Ai,l=t=>(t.forEach(i.show),t);let c=2;const u=t.slice();let h=t.slice();const d=Math.min(1,...t.map((t=>hi(t).width)));if("linear"===n.type&&(Vn(n)||Wn(n))){const e=vi(t[0]).left,n=vi(t[r-1]).right,i=Math.abs(n-e)||1;c=Math.max(Math.floor(r*d/i),c)}let p,f;for(s&&(p=u.splice(0,1)[0]),a&&(f=u.splice(-1,1)[0],u.reverse()),l(u);c<t.length&&mi((g=f?[f,...h,p]:[p,...h],g.filter(oi)),n,null==e?void 0:e.margin).length;)(f&&!p&&c%2==0||f&&p)&&u.splice(0,1).forEach(i.hide),h=o(l(u),{seq:c}),c++;var g}],["rotate",function(t,e,n,i){const{optionalAngles:r=[0,45,90],margin:s,recoverWhenFailed:a=!0}=e,o=t.map((t=>t.getLocalEulerAngles())),l=e=>t.forEach(((t,n)=>{const r=Array.isArray(e)?e[n]:e;i.rotate(t,+r)}));for(const e of r)if(l(e),mi(t,n,s).length<1)return;a&&l(o)}],["ellipsis",function(t,n,i,r){if(t.length<=1)return;const{suffix:s="...",minLength:a,maxLength:o=1/0,step:l=" ",margin:c=[0,0,0,0]}=n,u=ti(r.getTextShape(t[0])),h=yi(l,u),d=a?yi(a,u):h;let p=yi(o,u);(e(p)||p===1/0)&&(p=Math.max.apply(null,t.map((t=>hi(t).width))));let f=t.slice();const[g=0,m=0,y=g,b=m]=c;for(let e=p;e>d+h;e-=h)if(f.forEach((t=>{r.ellipsis(r.getTextShape(t),e,s)})),f=mi(t,i,c),f.length<1)return}],["wrap",function(t,e,n,i){const{wordWrapWidth:r=50,maxLines:s=3,recoverWhenFailed:a=!0,margin:o=[0,0,0,0]}=e,l=t.map((t=>t.attr("maxLines")||1)),c=Math.min(...l),u=function(t){const{type:e,labelDirection:n}=t;return"linear"===e&&Vn(t)?"negative"===n?"bottom":"top":"middle"}(n),h=e=>t.forEach(((t,n)=>{const s=Array.isArray(e)?e[n]:e;i.wrap(t,r,s,u)}));if(!(c>s)){for(let e=c;e<=s;e++)if(h(e),mi(t,n,o).length<1)return;a&&h(l)}}]]);function Pi(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];return e.reduce(((t,e)=>t*("positive"===e?-1:1)),1)}function Ei(t){let e=t;for(;e<0;)e+=360;return Math.round(e%360)}function Bi(t,e){const[n,i]=t,[r,s]=e,[a,o]=[n*r+i*s,n*s-i*r];return Math.atan2(o,a)}function Ci(t,e,n){const{type:i,labelAlign:r}=n,s=Gn(t,n),a=Ei(e),o=Ei(fn(Bi([1,0],s)));let l="center",c="middle";return"linear"===i?[90,270].includes(o)&&0===a?(l="center",c=1===s[1]?"top":"bottom"):o%180||![90,270].includes(a)?0===o?(Un(a,0,90,!1,!0)||Un(a,0,90)||Un(a,270,360))&&(l="start"):90===o?Un(a,0,90,!1,!0)?l="start":(Un(a,90,180)||Un(a,270,360))&&(l="end"):270===o?Un(a,0,90,!1,!0)?l="end":(Un(a,90,180)||Un(a,270,360))&&(l="start"):180===o&&(90===a?l="start":(Un(a,0,90)||Un(a,270,360))&&(l="end")):l="center":"parallel"===r?c=Un(o,0,180,!0)?"top":"bottom":"horizontal"===r?Un(o,90,270,!1)?l="end":(Un(o,270,360,!1)||Un(o,0,90))&&(l="start"):"perpendicular"===r&&(l=Un(o,90,270)?"end":"start"),{textAlign:l,textBaseline:c}}function Mi(t,e,n){const{showTick:i,tickLength:r,tickDirection:s,labelDirection:a,labelSpacing:o}=n,l=e.indexOf(t),c=gn(o,[t,l,e]),[u,h]=[Gn(t.value,n),Pi(a,s)],d=1===h?gn(i?r:0,[t,l,e]):0,[p,f]=ye(me(u,c+d),Hn(t.value,n));return{x:p,y:f}}function Oi(t,e){"text"===t.nodeName&&t.attr(e)}function Ti(t){!function(t,e,n){const{labelOverlap:i=[]}=e;i.length&&i.forEach((i=>{const{type:r}=i,s=Li.get(r);(function(t,e,n){return!(e.labelOverlap.length<1)&&("hide"===n?!u(t[0]):"rotate"===n?!t.some((t=>{var e;return!(null===(e=t.attr("transform"))||void 0===e||!e.includes("rotate"))})):"ellipsis"!==n&&"wrap"!==n||t.filter((t=>t.querySelector("text"))).length>1)})(t,e,r)&&(null==s||s(t,i,e,n))}))}(this.node().childNodes,t,{hide:a,show:s,rotate:(e,n)=>{!function(t,e,n){e.setLocalEulerAngles(t);const{value:i}=e.__data__,r=Ci(i,t,n),s=e.querySelector(dn.labelItem.class);s&&Oi(s,r)}(+n,e,t)},ellipsis:(t,e,n)=>{t&&ii(t,e||1/0,n)},wrap:(t,e,n)=>{t&&ri(t,e,n)},getTextShape:t=>t.querySelector("text")})}function ji(t,e,n,i,r){const s=n.indexOf(e),a=G(t).append(function(t,e,n,i){const{labelFormatter:r}=i;return V(r)?()=>On(gn(r,[t,e,n,Gn(t.value,i)])):()=>On(t.label||"")}(e,s,n,r)).attr("className",dn.labelItem.name).node(),[o,{transform:l,...c}]=M(Nn(i,[e,s,n]));ai(t,l);const u=function(t,e,n){var i;const{labelAlign:r}=n;if(null===(i=e.style.transform)||void 0===i?void 0:i.includes("rotate"))return e.getLocalEulerAngles();let s=0;const a=Gn(t.value,n),o=In(t.value,n);return"horizontal"===r?0:(s="perpendicular"===r?Bi([1,0],a):Bi([o[0]<0?-1:1,0],o),function(t){let e=(t+360)%180;return Un(e,-90,90)||(e+=180),e}(fn(s)))}(e,t,r);return t.setLocalEulerAngles(+u),Oi(a,{...Ci(e.value,u,r),...o}),ai(t,l),t.attr(c),a}function Ni(t,e){return Fn(t,e.tickDirection,e)}function _i(t,e,n,i,r,s){const a=function(t,e,n,i,r){const{tickFormatter:s}=r,a=Ni(e.value,r);let o="line";return V(s)&&(o=()=>gn(s,[e,n,i,a])),t.append(o).attr("className",dn.tickItem.name)}(G(this),t,e,n,i);!function(t,e,n,i,r,s,a){const o=Ni(t.value,s),{x1:l,x2:c,y1:u,y2:h}=function(t,e,n,i,r){const{tickLength:s}=r,[[a,o],[l,c]]=function(t,e){const[n,i]=t;return[[0,0],[n*e,i*e]]}(i,gn(s,[t,e,n]));return{x1:a,x2:l,y1:o,y2:c}}(t,e,n,o,s),[d,p]=M(Nn(a,[t,e,n,o]));"line"===i.node().nodeName&&i.styles({x1:l,x2:c,y1:u,y2:h,...d}),r.attr(p),i.styles(d)}(t,e,n,a,this,i,r);const[o,l]=Hn(t.value,i);return He(this,{x:o,y:l},s)}function zi(t,e,n){return e=function(t){var e=function(t,e){if("object"!=typeof t||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var i=n.call(t,"string");if("object"!=typeof i)return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==typeof e?e:String(e)}(e),e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}class Ii{get bottom(){return this.y+this.height}get left(){return this.x}get right(){return this.x+this.width}get top(){return this.y}constructor(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0;zi(this,"x",0),zi(this,"y",0),zi(this,"width",0),zi(this,"height",0),this.x=t,this.y=e,this.width=n,this.height=i}static fromRect(t){return new Ii(t.x,t.y,t.width,t.height)}toJSON(){return{x:this.x,y:this.y,width:this.width,height:this.height,top:this.top,right:this.right,bottom:this.bottom,left:this.left}}isPointIn(t,e){return t>=this.left&&t<=this.right&&e>=this.top&&e<=this.bottom}}function Fi(t){const{min:[e,n],max:[i,r]}=t.getRenderBounds();return new Ii(e,n,i-e,r-n)}const Gi=$e({text:"text"},"title");function Hi(t){return/\S+-\S+/g.test(t)?t.split("-").map((t=>t[0])):t.length>2?[t[0]]:t.split("")}function Vi(t,e){const n=Object.entries(e).reduce(((e,n)=>{let[i,r]=n;return t.node().attr(i)||(e[i]=r),e}),{});t.styles(n)}class Wi extends x{constructor(t){super(t,{text:"",width:0,height:0,fill:"#4a505a",fontWeight:"bold",fontSize:12,fontFamily:"sans-serif",inset:0,spacing:0,position:"top-left"}),function(t,e,n){e=function(t){var e=function(t,e){if("object"!=typeof t||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var i=n.call(t,"string");if("object"!=typeof i)return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==typeof e?e:String(e)}(e),e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n}(this,"title",void 0)}getAvailableSpace(){const{width:t,height:e,position:n,spacing:i,inset:r}=this.attributes,s=this.querySelector(Gi.text.class);if(!s)return new Ii(0,0,+t,+e);const{width:a,height:o}=s.getBBox(),[l,c,u,h]=T(i);let[d,p,f,g]=[0,0,+t,+e];const m=Hi(n);if(m.includes("i"))return new Ii(d,p,f,g);m.forEach(((n,i)=>{"t"===n&&([p,g]=0===i?[o+u,+e-o-u]:[0,+e]),"r"===n&&([f]=[+t-a-h]),"b"===n&&([g]=[+e-o-l]),"l"===n&&([d,f]=0===i?[a+c,+t-a-c]:[0,+t])}));const[y,b,v,x]=T(r),[w,S]=[x+b,y+v];return new Ii(d+x,p+y,f-w,g-S)}getBBox(){return this.title?this.title.getBBox():new Ii(0,0,0,0)}render(t,e){const{width:n,height:i,position:r,spacing:s,...a}=t,[o]=M(a),{x:l,y:c,textAlign:u,textBaseline:h}=function(t){const{width:e,height:n,position:i}=t,[r,s]=[+e/2,+n/2];let[a,o,l,c]=[+r,+s,"center","middle"];const u=Hi(i);return u.includes("l")&&([a,l]=[0,"start"]),u.includes("r")&&([a,l]=[+e,"end"]),u.includes("t")&&([o,c]=[0,"top"]),u.includes("b")&&([o,c]=[+n,"bottom"]),{x:a,y:o,textAlign:l,textBaseline:c}}(t);W(!!a.text,G(e),(t=>{this.title=t.maybeAppendByClassName(Gi.text,"text").styles(o).call(Vi,{x:l,y:c,textAlign:u,textBaseline:h}).node()}))}}function Di(t,e,n,i,r){const s=B(i,"title"),[a,{transform:o,...l}]=M(s);t.styles(a),e.styles(l);const c=o||function(t,e,n){const i=t.cloneNode(!0);i.style.transform="scale(1, 1)",i.style.transform="none";const{height:r}=i.getBBox();if("vertical"===e){if("left"===n)return"rotate(-90) translate(0, ".concat(r/2,")");if("right"===n)return"rotate(-90) translate(0, -".concat(r/2,")")}return""}(t.node(),a.direction,a.position);ai(t.node(),c);const{x:u,y:h}=function(t,e,n){const{titlePosition:i="lb",titleSpacing:r}=n,s=Hi(i),{min:[a,o],halfExtents:[l,c]}=t.node().getLocalBounds(),[u,h]=e.node().getLocalBounds().halfExtents;let[d,p]=[a+l,o+c];const[f,g,m,y]=T(r);if(["start","end"].includes(i)&&"linear"===n.type){const{startPos:t,endPos:e}=n,[r,s]="start"===i?[t,e]:[e,t],a=Se([-s[0]+r[0],-s[1]+r[1]]),[o,l]=me(a,f);return{x:r[0]+o,y:r[1]+l}}return s.includes("t")&&(p-=c+h+f),s.includes("r")&&(d+=l+u+g),s.includes("l")&&(d-=l+2*u+y),s.includes("b")&&(p+=c+2*h+m),{x:d,y:p}}(G(n._offscreen||n.querySelector(dn.mainGroup.class)),e,i),d=He(e.node(),{x:u,y:h},r);return ai(t.node(),c),d}function Ri(t,e,n,i){const{showLine:r,showTick:o,showLabel:l}=t,c=W(r,e.maybeAppendByClassName(dn.lineGroup,"g"),(e=>qn(e,t,i)))||[],u=W(o,e.maybeAppendByClassName(dn.tickGroup,"g"),(e=>function(t,e,n,i){const r=_n(e,n.tickFilter),s=B(n,"tick");return t.selectAll(dn.tick.class).data(r,(t=>t.id||t.label)).join((t=>t.append("g").attr("className",dn.tick.name).transition((function(t,e){return _i.call(this,t,e,r,n,s,!1)}))),(t=>t.transition((function(t,e){return this.removeChildren(),_i.call(this,t,e,r,n,s,i.update)}))),(t=>t.transition((function(){const t=mn(this.childNodes[0],i.exit);return Ie(t,(()=>this.remove())),t})))).transitions()}(e,n,t,i)))||[],h=W(l,e.maybeAppendByClassName(dn.labelGroup,"g"),(e=>function(t,e,n,i){const r=_n(e,n.labelFilter),o=B(n,"label");return t.selectAll(dn.label.class).data(r,((t,e)=>e)).join((i=>i.append("g").attr("className",dn.label.name).transition((function(t){return ji(this,t,e,o,n),this.attr(Mi(t,e,n)),this.__bbox__=t.bbox,null})).call((()=>Ti.call(t,n)))),(r=>r.transition((function(t){const r=function(t,e,n){let i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"destroy";if(function(t,e){return"text"===t.nodeName&&"text"===e.nodeName&&t.attributes.text===e.attributes.text}(t,e))return t.remove(),[null];const r=()=>{"destroy"===i?t.destroy():"hide"===i&&a(t),e.isVisible()&&s(e)};if(!n)return r(),[null];const{duration:o=0,delay:l=0}=n,c=Math.ceil(+o/2),u=+o/4,h=t=>{if("circle"===t.nodeName){const[e,n]=t.getLocalPosition(),i=t.attr("r");return[e-i,n-i]}return t.getLocalPosition()},[d,p]=h(t),[f,g]=h(e),[m,y]=[(d+f)/2-d,(p+g)/2-p],{opacity:b=1}=t.style,{opacity:v=1}=e.style,x=t.animate([{opacity:b,transform:"translate(0, 0)"},{opacity:0,transform:"translate(".concat(m,", ").concat(y,")")}],{fill:"both",...n,duration:l+c+u}),w=e.animate([{opacity:0,transform:"translate(".concat(-m,", ").concat(-y,")"),offset:.01},{opacity:v,transform:"translate(0, 0)"}],{fill:"both",...n,duration:c+u,delay:l+c-u});return Ie(w,r),[x,w]}(this.querySelector(dn.labelItem.class),ji(this,t,e,o,n),i.update),l=He(this,Mi(t,e,n),i.update);return this.__bbox__=t.bbox,[...r,l]})).call((e=>{var i,r;r=()=>Ti.call(t,n),0===(i=Ln(e,"_transitions").flat().filter(oi)).length?r():Promise.all(i.map((t=>null==t?void 0:t.finished))).then(r)}))),(t=>t.transition((function(){const t=mn(this.childNodes[0],i.exit);return Ie(t,(()=>G(this).remove())),t})))).transitions()}(e,n,t,i)))||[];return[...c,...u,...h].filter((t=>!!t))}class Yi extends x{constructor(t){super(t,hn)}render(t,e,n){const{titleText:i,data:r,animate:s,showTitle:a,showGrid:o,dataThreshold:l,truncRange:c}=t,u=un(r,l).filter((t=>{let{value:e}=t;return!(c&&e>c[0]&&e<c[1])})),h=ze(void 0===n?s:n),d=W(o,G(e).maybeAppendByClassName(dn.gridGroup,"g"),(e=>Zn(e,u,t,h)))||[],p=G(e).maybeAppendByClassName(dn.mainGroup,"g");i&&(!this.initialized&&h.enter||this.initialized&&h.update)&&Ri(t,G(this.offscreenGroup),u,ze(!1));const f=Ri(t,G(p.node()),u,h),g=W(a,G(e).maybeAppendByClassName(dn.titleGroup,"g"),(e=>function(t,e,n,i){const{titleText:r}=n;return t.selectAll(dn.title.class).data([{title:r}].filter((t=>!!t.title)),((t,e)=>t.title)).join((s=>s.append((()=>On(r))).attr("className",dn.title.name).transition((function(){return Di(G(this),t,e,n,i.enter)}))),(r=>r.transition((function(){return Di(G(this),t,e,n,i.update)}))),(t=>t.remove())).transitions()}(e,this,t,h)))||[];return[...d,...f,...g].flat().filter((t=>!!t))}}class qi{}const Ki={backgroundFill:"#262626",backgroundLineCap:"round",backgroundLineWidth:1,backgroundStroke:"#333",backgroundZIndex:-1,formatter:t=>t.toString(),labelFill:"#fff",labelFontSize:12,labelTextBaseline:"middle",padding:[2,4],position:"right",radius:0,zIndex:999};function Zi(t,e,n){return e=function(t){var e=function(t,e){if("object"!=typeof t||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var i=n.call(t,"string");if("object"!=typeof i)return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==typeof e?e:String(e)}(e),e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}const Ui=$e({background:"background",labelGroup:"label-group",label:"label"},"indicator");class $i extends x{constructor(e){super(e,Ki),Zi(this,"group",void 0),Zi(this,"background",void 0),Zi(this,"label",void 0),Zi(this,"point",[0,0]),this.group=this.appendChild(new t.Group({})),this.isMutationObserved=!0}renderBackground(){if(!this.label)return;const{position:t,padding:e}=this.attributes,[n,i,r,s]=T(e),{min:a,max:o}=this.label.node().getLocalBounds(),l=new Ii(a[0]-s,a[1]-n,o[0]+i-a[0]+s,o[1]+r-a[1]+n),c=this.getPath(t,l),u=B(this.attributes,"background");this.background=G(this.group).maybeAppendByClassName(Ui.background,"path").styles({...u,path:c}),this.group.appendChild(this.label.node())}renderLabel(){const{formatter:t,labelText:e}=this.attributes,n=B(this.attributes,"label"),[{text:i,...r},s]=M(n);this.label=G(this.group).maybeAppendByClassName(Ui.labelGroup,"g").styles(s),e&&this.label.maybeAppendByClassName(Ui.label,(()=>On(t(e)))).style("text",t(e).toString()).selectAll("text").styles(r)}adjustLayout(){const[t,e]=this.point;this.group.attr("x",-t).attr("y",-e)}getPath(t,e){const{radius:n}=this.attributes,{x:i,y:r,width:s,height:a}=e,o=[["M",i+n,r],["L",i+s-n,r],["A",n,n,0,0,1,i+s,r+n],["L",i+s,r+a-n],["A",n,n,0,0,1,i+s-n,r+a],["L",i+n,r+a],["A",n,n,0,0,1,i,r+a-n],["L",i,r+n],["A",n,n,0,0,1,i+n,r],["Z"]],l={top:4,right:6,bottom:0,left:2}[t],c=this.createCorner([o[l].slice(-2),o[l+1].slice(-2)]);return o.splice(l+1,1,...c),o[0][0]="M",o}createCorner(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:10;const n=wi(...t),[[i,r],[s,a]]=t,[o,[l,c]]=n?[s-i,[i,s]]:[a-r,[r,a]],u=o/2,h=e*(o/Math.abs(o)),d=h/2,p=h*Math.sqrt(3)/2*.8,[f,g,m,y,b]=[l,l+u-d,l+u,l+u+d,c];return n?(this.point=[m,r-p],[["L",f,r],["L",g,r],["L",m,r-p],["L",y,r],["L",b,r]]):(this.point=[i+p,m],[["L",i,f],["L",i,g],["L",i+p,m],["L",i,y],["L",i,b]])}applyVisibility(){const{visibility:t}=this.attributes;"hidden"===t?a(this):s(this)}bindEvents(){this.label.on(t.ElementEvent.BOUNDS_CHANGED,this.renderBackground)}render(){this.renderLabel(),this.renderBackground(),this.adjustLayout(),this.applyVisibility()}}function Xi(){return"horizontal"===(arguments.length>0&&void 0!==arguments[0]?arguments[0]:"horizontal")?arguments.length>1?arguments[1]:void 0:arguments.length>2?arguments[2]:void 0}et.registerSymbol("hiddenHandle",(function(t,e,n){const i=1.4*n;return[["M",t-n,e-i],["L",t+n,e-i],["L",t+n,e+i],["L",t-n,e+i],["Z"]]})),et.registerSymbol("verticalHandle",(function(t,e,n){const i=1.4*n,r=n/2,s=n/6,a=t+.4*i;return[["M",t,e],["L",a,e+r],["L",t+i,e+r],["L",t+i,e-r],["L",a,e-r],["Z"],["M",a,e+s],["L",t+i-2,e+s],["M",a,e-s],["L",t+i-2,e-s]]})),et.registerSymbol("horizontalHandle",(function(t,e,n){const i=1.4*n,r=n/2,s=n/6,a=e+.4*i;return[["M",t,e],["L",t-r,a],["L",t-r,e+i],["L",t+r,e+i],["L",t+r,a],["Z"],["M",t-s,a],["L",t-s,e+i-2],["M",t+s,a],["L",t+s,e+i-2]]}));const Ji=$e({markerGroup:"marker-group",marker:"marker",labelGroup:"label-group",label:"label"},"handle"),Qi={showLabel:!0,formatter:t=>t.toString(),markerSize:25,markerStroke:"#c5c5c5",markerFill:"#fff",markerLineWidth:1,labelFontSize:12,labelFill:"#c5c5c5",labelText:"",orientation:"vertical",spacing:0};class tr extends x{constructor(t){super(t,Qi),function(t,e,n){e=function(t){var e=function(t,e){if("object"!=typeof t||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var i=n.call(t,"string");if("object"!=typeof i)return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==typeof e?e:String(e)}(e),e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n}(this,"marker",void 0)}render(t,e){const n=G(e).maybeAppendByClassName(Ji.markerGroup,"g");this.renderMarker(n);const i=G(e).maybeAppendByClassName(Ji.labelGroup,"g");this.renderLabel(i)}renderMarker(t){const{orientation:e,markerSymbol:n=Xi(e,"horizontalHandle","verticalHandle")}=this.attributes;W(!!n,t,(t=>{const e=B(this.attributes,"marker"),i={symbol:n,...e};this.marker=t.maybeAppendByClassName(Ji.marker,(()=>new et({style:i}))).update(i)}))}renderLabel(t){const{showLabel:e,orientation:n,spacing:i=0,formatter:r}=this.attributes;W(e,t,(t=>{var e;const{text:s,...a}=B(this.attributes,"label"),{width:o=0,height:l=0}=(null===(e=t.select(Ji.marker.class))||void 0===e?void 0:e.node().getBBox())||{},[c,u,h,d]=Xi(n,[0,l+i,"center","top"],[o+i,0,"start","middle"]);t.maybeAppendByClassName(Ji.label,"text").styles({...a,x:c,y:u,text:r(s).toString(),textAlign:h,textBaseline:d})}))}}const er={showTitle:!0,padding:0,orientation:"horizontal",backgroundFill:"transparent",titleText:"",titleSpacing:4,titlePosition:"top-left",titleFill:"#2C3542",titleFontWeight:"bold",titleFontFamily:"sans-serif",titleFontSize:12},nr=y({},er,{}),ir=y({},er,C(Qi,"handle"),{color:["#d0e3fa","#acc7f6","#8daaf2","#6d8eea","#4d73cd","#325bb1","#5a3e75","#8c3c79","#e23455","#e7655b"],indicatorBackgroundFill:"#262626",indicatorLabelFill:"white",indicatorLabelFontSize:12,indicatorVisibility:"hidden",labelAlign:"value",labelDirection:"positive",labelSpacing:5,showHandle:!0,showIndicator:!0,showLabel:!0,slidable:!0,titleText:"",type:"continuous"}),rr=$e({title:"title",titleGroup:"title-group",items:"items",itemsGroup:"items-group",contentGroup:"content-group",ribbonGroup:"ribbon-group",ribbon:"ribbon",handlesGroup:"handles-group",handle:"handle",startHandle:"start-handle",endHandle:"end-handle",labelGroup:"label-group",label:"label",indicator:"indicator"},"legend");function sr(t,e){const[n,i]=function(t,e){for(let n=1;n<t.length;n+=1){const i=t[n-1],r=t[n];if(e>=i&&e<=r)return[i,r]}return[e,e]}(t,e);return{tick:e>(n+i)/2?i:n,range:[n,i]}}const ar=$e({trackGroup:"background-group",track:"background",selectionGroup:"ribbon-group",selection:"ribbon",clipPath:"clip-path"},"ribbon");function or(t){const{orientation:e,size:n,length:i}=t;return Xi(e,[i,n],[n,i])}function lr(t){const{type:e}=t,[n,i]=or(t);return"size"===e?[["M",0,i],["L",0+n,0],["L",0+n,i],["Z"]]:[["M",0,i],["L",0,0],["L",0+n,0],["L",0+n,i],["Z"]]}function cr(t){return lr(t)}function ur(t){const{orientation:e,range:n}=t;if(!n)return[];const[i,r]=or(t),[s,a]=n,o=Xi(e,s*i,0),l=Xi(e,0,s*r),c=Xi(e,a*i,i),u=Xi(e,r,a*r);return[["M",o,l],["L",o,u],["L",c,u],["L",c,l],["Z"]]}class hr extends x{constructor(t){super(t,{type:"color",orientation:"horizontal",size:30,range:[0,1],length:200,block:!1,partition:[],color:["#fff","#000"],trackFill:"#e5e5e5"})}render(e,n){!function(t,e){const n=B(e,"track");t.maybeAppendByClassName(ar.track,"path").styles({path:lr(e),...n})}(G(n).maybeAppendByClassName(ar.trackGroup,"g"),e),function(e,n){const i=B(n,"selection"),r=function(e){const{orientation:n,color:i,block:r,partition:s}=e;let a;a=V(i)?new Array(20).fill(0).map(((t,e,n)=>i(e/(n.length-1)))):i;const o=a.length,l=a.map((e=>(0,t.parseColor)(e).toString()));return o?1===o?l[0]:r?function(t,e,n){const i=Array.from(e),r=t.length;return new Array(r).fill(0).reduce(((e,n,s)=>{const a=i[s%i.length];return e+" ".concat(t[s],":").concat(a).concat(s<r-1?" ".concat(t[s+1],":").concat(a):"")}),"l(".concat("horizontal"===n?"0":"270",")"))}(s,l,n):l.reduce(((t,e,n)=>t+" ".concat(n/(o-1),":").concat(e)),"l(".concat(Xi(n,"0","270"),")")):""}(n),s=e.maybeAppendByClassName(ar.selection,"path").styles({path:cr(n),fill:r,...i}),a=s.maybeAppendByClassName(ar.clipPath,"path").styles({path:ur(n)}).node();s.style("clip-path",a)}(G(n).maybeAppendByClassName(ar.selectionGroup,"g"),e)}}function dr(t,e,n){return e=function(t){var e=function(t,e){if("object"!=typeof t||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var i=n.call(t,"string");if("object"!=typeof i)return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==typeof e?e:String(e)}(e),e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}class pr extends x{constructor(t){super(t,ir),dr(this,"eventToOffsetScale",new $t({})),dr(this,"innerRibbonScale",new $t({})),dr(this,"title",void 0),dr(this,"label",void 0),dr(this,"ribbon",void 0),dr(this,"indicator",void 0),dr(this,"handlesGroup",void 0),dr(this,"startHandle",void 0),dr(this,"endHandle",void 0),dr(this,"cacheLabelBBox",null),dr(this,"cacheHandleBBox",null),dr(this,"target",void 0),dr(this,"prevValue",void 0),dr(this,"onHovering",(t=>{const{data:e,block:n}=this.attributes;t.stopPropagation();const i=this.getValueByCanvasPoint(t);if(n){const{range:t}=sr(e.map((t=>{let{value:e}=t;return e})),i);this.showIndicator((t[0]+t[1])/2,"".concat(t[0],"-").concat(t[1])),this.dispatchIndicated(i,t)}else{const t=this.getTickValue(i);this.showIndicator(t),this.dispatchIndicated(t)}})),dr(this,"onDragStart",(t=>e=>{e.stopPropagation(),this.attributes.slidable&&(this.target=t,this.prevValue=this.getTickValue(this.getValueByCanvasPoint(e)),document.addEventListener("mousemove",this.onDragging),document.addEventListener("touchmove",this.onDragging),document.addEventListener("mouseleave",this.onDragEnd),document.addEventListener("mouseup",this.onDragEnd),document.addEventListener("mouseup",this.onDragEnd),document.addEventListener("touchend",this.onDragEnd))})),dr(this,"onDragging",(t=>{const{target:e}=this;this.updateMouse();const[n,i]=this.selection,r=this.getTickValue(this.getValueByCanvasPoint(t)),s=r-this.prevValue;"start"===e?n!==r&&this.updateSelection(r,i):"end"===e?i!==r&&this.updateSelection(n,r):"ribbon"===e&&0!==s&&(this.prevValue=r,this.updateSelection(s,s,!0))})),dr(this,"onDragEnd",(()=>{this.style.cursor="pointer",document.removeEventListener("mousemove",this.onDragging),document.removeEventListener("touchmove",this.onDragging),document.removeEventListener("mouseup",this.onDragEnd),document.removeEventListener("touchend",this.onDragEnd)}))}get handleOffsetRatio(){return this.ifHorizontal(.5,.5)}getBBox(){const{width:t,height:e}=this.attributes;return new Ii(0,0,t,e)}render(t,e){const{showLabel:n}=t;this.renderTitle(G(e));const{x:i,y:r}=this.availableSpace,s=G(e).maybeAppendByClassName(rr.contentGroup,"g").styles({x:i,y:r});W(!!n,s.maybeAppendByClassName(rr.labelGroup,"g").styles({zIndex:1}),(t=>{this.renderLabel(t)}));const a=s.maybeAppendByClassName(rr.ribbonGroup,"g").styles({zIndex:0});this.handlesGroup=s.maybeAppendByClassName(rr.handlesGroup,"g").styles({zIndex:2}),this.renderHandles(),this.renderRibbon(a),this.renderIndicator(s),this.adjustLabel(),this.adjustHandles()}get range(){const{data:t,domain:e}=this.attributes;return e?{min:e[0],max:e[1]}:function(t){return{min:Math.min(...t.map((t=>t.value))),max:Math.max(...t.map((t=>t.value)))}}(t)}get ribbonScale(){const{min:t,max:e}=this.range;return this.innerRibbonScale.update({domain:[t,e],range:[0,1]}),this.innerRibbonScale}get ribbonRange(){const[t,e]=this.selection,n=this.ribbonScale;return[n.map(t),n.map(e)]}get selection(){const{min:t,max:e}=this.range,{defaultValue:[n,i]=[t,e]}=this.attributes;return[n,i]}ifHorizontal(t,e){return Xi(this.attributes.orientation,"function"==typeof t?t():t,"function"==typeof e?e():e)}renderTitle(t){const{showTitle:e,titleText:n,width:i,height:r}=this.attributes,s={...B(this.attributes,"title"),width:i,height:r,text:n},a=this;t.selectAll(rr.title.class).data(e?[n]:[]).join((t=>t.append((()=>new Wi({style:s}))).attr("className",rr.title.name).each((function(){a.title=this}))),(t=>t.update(s)),(t=>t.each((()=>{a.title=void 0})).remove()))}get availableSpace(){if(this.title)return this.title.getAvailableSpace();const{width:t,height:e}=this.attributes;return new Ii(0,0,t,e)}get labelFixedSpacing(){const{showTick:t}=this.attributes;return t?5:0}get labelPosition(){const{orientation:t,labelDirection:e}=this.attributes;return{vertical:{positive:"right",negative:"left"},horizontal:{positive:"bottom",negative:"top"}}[t][e]}get labelBBox(){var t;const{showLabel:e}=this.attributes;if(!e)return new Ii(0,0,0,0);if(this.cacheLabelBBox)return this.cacheLabelBBox;const{width:n,height:i}=(null===(t=this.label.querySelector(dn.labelGroup.class))||void 0===t?void 0:t.children.slice(-1)[0]).getBBox();return this.cacheLabelBBox=new Ii(0,0,n,i),this.cacheLabelBBox}get labelShape(){const{showLabel:t,labelSpacing:e=0}=this.attributes;if(!t)return{width:0,height:0,size:0,length:0};const{width:n,height:i}=this.labelBBox;return{width:n,height:i,size:this.ifHorizontal(i,n)+e+this.labelFixedSpacing,length:this.ifHorizontal(n,i)}}get ribbonBBox(){const{showHandle:t,ribbonSize:e}=this.attributes,{width:n,height:i}=this.availableSpace,{size:r,length:s}=this.labelShape,[a,o]=this.ifHorizontal([i,n],[n,i]),{size:l,length:c}=t?this.handleShape:{size:0,length:0},u=this.handleOffsetRatio;let h=0;const d=this.labelPosition;h=e||(["bottom","right"].includes(d)?Math.min(a-r,(a-l)/u):a*(1-u)>l?Math.max(a-r,0):Math.max((a-r-l)/u,0));const p=Math.max(c,s),f=o-p,[g,m]=this.ifHorizontal([f,h],[h,f]),y=["top","left"].includes(d)?r:0,[b,v]=this.ifHorizontal([p/2,y],[y,p/2]);return new Ii(b,v,g,m)}get ribbonShape(){const{width:t,height:e}=this.ribbonBBox;return this.ifHorizontal({size:e,length:t},{size:t,length:e})}renderRibbon(t){const{data:e,type:n,orientation:i,color:r,block:s}=this.attributes,a=B(this.attributes,"ribbon"),{min:o,max:l}=this.range,{x:c,y:u}=this.ribbonBBox,{length:h,size:d}=this.ribbonShape,p=y({x:c,y:u,length:h,size:d,type:n,orientation:i,color:r,block:s,partition:e.map((t=>(t.value-o)/(l-o))),range:this.ribbonRange},a);this.ribbon=t.maybeAppendByClassName(rr.ribbon,(()=>new hr({style:p}))).update(p)}getHandleClassName(t){return"".concat(rr.prefix("".concat(t,"-handle")))}renderHandles(){const{showHandle:t,orientation:e}=this.attributes,n=B(this.attributes,"handle"),[i,r]=this.selection,s={...n,orientation:e},{shape:a="slider"}=n,o="basic"===a?tr:sn,l=this;this.handlesGroup.selectAll(rr.handle.class).data(t?[{value:i,type:"start"},{value:r,type:"end"}]:[],(t=>t.type)).join((t=>t.append((()=>new o({style:s}))).attr("className",(t=>{let{type:e}=t;return"".concat(rr.handle," ").concat(l.getHandleClassName(e))})).each((function(t){let{type:e,value:n}=t;this.update({labelText:n});const i="".concat(e,"Handle");l[i]=this,this.addEventListener("pointerdown",l.onDragStart(e))}))),(t=>t.update(s).each((function(t){let{value:e}=t;this.update({labelText:e})}))),(t=>t.each((t=>{let{type:e}=t;const n="".concat(e,"Handle");l[n]=void 0})).remove()))}adjustHandles(){const[t,e]=this.selection;this.setHandlePosition("start",t),this.setHandlePosition("end",e)}adjustTitle(){const{titlePosition:t,orientation:e}=this.attributes,[n]=this.getElementsByClassName(rr.title.name),i=this.handlesGroup.select(".".concat(this.getHandleClassName("start"))).node();if(!n||!i)return;if("top-left"!==t||"horizontal"!==e)return;const{min:[r]}=i.getLocalBounds(),{min:[s]}=n.getLocalBounds(),a=r-s;n.style.x=+(this.style.x||0)+a}get handleBBox(){if(this.cacheHandleBBox)return this.cacheHandleBBox;if(!this.attributes.showHandle)return new Ii(0,0,0,0);const{width:t,height:e}=this.startHandle.getBBox(),{width:n,height:i}=this.endHandle.getBBox(),[r,s]=[Math.max(t,n),Math.max(e,i)];return this.cacheHandleBBox=new Ii(0,0,r,s),this.cacheHandleBBox}get handleShape(){const{width:t,height:e}=this.handleBBox,[n,i]=this.ifHorizontal([e,t],[t,e]);return{width:t,height:e,size:n,length:i}}setHandlePosition(t,e){const{handleFormatter:n}=this.attributes,{x:i,y:r}=this.ribbonBBox,{size:s}=this.ribbonShape,a=this.getOffset(e),[o,l]=this.ifHorizontal([i+a,r+s*this.handleOffsetRatio],[i+s*this.handleOffsetRatio,r+a]),c=this.handlesGroup.select(".".concat(this.getHandleClassName(t))).node();null==c||c.update({x:o,y:l,formatter:n})}renderIndicator(t){const e=B(this.attributes,"indicator");this.indicator=t.maybeAppendByClassName(rr.indicator,(()=>new $i({}))).update(e)}get labelData(){const{data:t}=this.attributes;return t.reduce(((t,e,n,i)=>{var r,s;const a=null!==(r=null==e?void 0:e.id)&&void 0!==r?r:n.toString();if(t.push({...e,id:a,index:n,type:"value",label:null!==(s=null==e?void 0:e.label)&&void 0!==s?s:e.value.toString(),value:this.ribbonScale.map(e.value)}),n<i.length-1){const r=i[n+1],[s,o]=[e.value,r.value],l=(s+o)/2;t.push({...e,id:a,index:n,type:"range",range:[s,o],label:[s,o].join("~"),value:this.ribbonScale.map(l)})}return t}),[])}get labelStyle(){let[t,e]=["center","middle"];const n=this.labelPosition;return"top"===n?e="bottom":"bottom"===n?e="top":"left"===n?t="end":"right"===n&&(t="start"),{labelTextAlign:t,labelTextBaseline:e}}renderLabel(t){const{showTick:e=!1,labelFilter:n,labelFormatter:i}=this.attributes,r=B(this.attributes,"tick"),s=B(this.attributes,"label"),{align:a}=s,o={...y({showLine:!1,showGrid:!1,showTick:e,type:"linear",startPos:[0,0],endPos:[0,0],tickDirection:"negative",labelTransform:"rotate(0)",...this.labelStyle},C(r,"tick"),C(s,"label"),{data:this.labelData}),tickFilter:(t,e,i)=>"value"===(null==t?void 0:t.type)&&(!n||n(t,t.index,i.filter((t=>"value"!==t.type)))),labelFilter:(t,e,i)=>(null==t?void 0:t.type)===a&&(!n||n(t,t.index,i.filter((t=>t.type===a)))),labelFormatter:i,labelOverlap:[{type:"hide"}]};this.label=t.maybeAppendByClassName(rr.label,(()=>new Yi({style:o}))).node(),this.label.update(o,!1)}get labelAxisStyle(){const{showTick:t,labelDirection:e,labelSpacing:n,tickLength:i}=this.attributes,{size:r}=this.ribbonShape,s=this.labelPosition,a=this.labelFixedSpacing;let[o,l,c]=[0,0,0];const u=null!=i?i:r;return t?(c=u,l=a,"positive"===e?"right"===s?(o=u,c=u):"bottom"===s&&(o=c):"negative"===e&&("top"===s||"left"===s)&&(o=r)):"positive"===e?"right"===s?l=u:"bottom"===s&&(o=r+a,l=n):"negative"===e&&("left"===s||"top"===s)&&(l=n),{offset:o,spacing:n,tickLength:c}}adjustLabel(){const{showLabel:t}=this.attributes;if(!t)return;const{x:e,y:n,width:i,height:r}=this.ribbonBBox,{offset:s,spacing:a,tickLength:o}=this.labelAxisStyle,[l,c]=this.ifHorizontal([[e,n+s],[e+i,n+s]],[[e+s,n+r],[e+s,n]]);this.label.update({startPos:l,endPos:c,tickLength:o,labelSpacing:a},!1)}bindEvents(){this.style.cursor="pointer",this.ribbon.on("pointerdown",this.onDragStart("ribbon")),this.ribbon.on("pointermove",this.onHovering),this.addEventListener("pointerout",this.hideIndicator)}showIndicator(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"".concat(t);const{showIndicator:n}=this.attributes;if(!n||"number"!=typeof t)return void this.hideIndicator();const{min:i,max:r}=this.range,{x:a,y:o}=this.ribbonBBox,l=de(t,i,r),c=this.getOffset(l),u=this.ifHorizontal([c+a,o],[a,c+o]);this.indicator.update({x:u[0],y:u[1],position:this.ifHorizontal("top","left"),labelText:e}),s(this.indicator.node())}hideIndicator(){a(this.indicator.node())}updateMouse(){this.attributes.slidable&&(this.style.cursor="grabbing")}setSelection(t,e){this.updateSelection(t,e)}updateSelection(t,e){let n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];const[i,r]=this.selection;let[s,a]=[t,e];n&&(s+=i,a+=r);const{min:o,max:l}=this.range;[s,a]=function(t,e,n){const[i,r]=t,[s,a]=e,[o,l]=n;let[c,u]=[s,a];const h=u-c;return c>u&&([c,u]=[u,c]),h>r-i?[i,r]:c<i?o===i&&l===u?[i,u]:[i,h+i]:u>r?l===r&&o===c?[c,r]:[r-h,r]:[c,u]}([o,l],[s,a],this.selection),this.update({defaultValue:[s,a]}),this.dispatchSelection()}get step(){const{step:t=1}=this.attributes,{min:e,max:n}=this.range;return it(t)?We(.01*(n-e),0):t}getTickValue(t){const{data:e,block:n}=this.attributes,{min:i}=this.range;return n?sr(e.map((t=>{let{value:e}=t;return e})),t).tick:function(t,e,n){return n+Math.round((t-n)/e)*e}(t,this.step,i)}getValueByCanvasPoint(t){const{min:e,max:n}=this.range,[i,r]=this.ribbon.node().getPosition(),s=this.ifHorizontal(i,r),a=this.ifHorizontal(...Ve(t))-s;return de(this.getOffset(a,!0),e,n)}getOffset(t){let e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];const{min:n,max:i}=this.range,{length:r}=this.ribbonShape,s=this.eventToOffsetScale;return s.update({domain:[n,i],range:[0,r]}),e?s.invert(t):s.map(t)}dispatchSelection(){const e=new t.CustomEvent("valuechange",{detail:{value:this.selection}});this.dispatchEvent(e)}dispatchIndicated(e,n){const i=new t.CustomEvent("indicate",{detail:{value:e,range:n}});this.dispatchEvent(i)}}const fr=function(){};function gr(t,e){return t.reduce(((t,n)=>((t[n[e]]=t[n[e]]||[]).push(n),t)),{})}function mr(t){var e;return(null===(e=t[0])||void 0===e?void 0:e.map(((e,n)=>t.map((t=>t[n])))))||[]}function yr(t,e,n){return e=function(t){var e=function(t,e){if("object"!=typeof t||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var i=n.call(t,"string");if("object"!=typeof i)return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==typeof e?e:String(e)}(e),e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}const br=$e({prevBtnGroup:"prev-btn-group",prevBtn:"prev-btn",nextBtnGroup:"next-btn-group",nextBtn:"next-btn",pageInfoGroup:"page-info-group",pageInfo:"page-info",playWindow:"play-window",contentGroup:"content-group",controller:"controller",clipPath:"clip-path"},"navigator");class vr extends x{constructor(e){super(e,{animate:{easing:"linear",duration:200,fill:"both"},buttonCursor:"pointer",buttonFill:"black",buttonPath:(0,0,6,[["M",-6,-6],["L",6,0],["L",-6,6],["Z"]]),buttonSize:12,controllerPadding:5,controllerSpacing:5,formatter:(t,e)=>"".concat(t,"/").concat(e),defaultPage:0,loop:!1,orientation:"horizontal",pageNumFill:"black",pageNumFontSize:12,pageNumTextAlign:"start",pageNumTextBaseline:"middle"}),yr(this,"playState","idle"),yr(this,"contentGroup",this.appendChild(new t.Group({class:br.contentGroup.name}))),yr(this,"playWindow",this.contentGroup.appendChild(new t.Group({class:br.playWindow.name}))),yr(this,"innerCurrPage",this.defaultPage),yr(this,"clipPath",void 0),yr(this,"prevBtnGroup",void 0),yr(this,"nextBtnGroup",void 0),yr(this,"pageInfoGroup",void 0)}get defaultPage(){const{defaultPage:t}=this.attributes;return de(t,0,Math.max(this.pageViews.length-1,0))}get pageViews(){return this.playWindow.children}get controllerShape(){return this.totalPages>1?{width:55,height:0}:{width:0,height:0}}get pageShape(){const{pageViews:t}=this,[e,n]=mr(t.map((t=>{const{width:e,height:n}=t.getBBox();return[e,n]}))).map((t=>Math.max(...t))),{pageWidth:i=e,pageHeight:r=n}=this.attributes;return{pageWidth:i,pageHeight:r}}getContainer(){return this.playWindow}get totalPages(){return this.pageViews.length}get currPage(){return this.innerCurrPage}getBBox(){const{x:t,y:e}=super.getBBox(),n=this.controllerShape,{pageWidth:i,pageHeight:r}=this.pageShape;return new Ii(t,e,i+n.width,r)}goTo(t){const{animate:e}=this.attributes,{currPage:n,playState:i,playWindow:r,pageViews:s}=this;if("idle"!==i||t<0||s.length<=0||t>=s.length)return null;s[n].setLocalPosition(0,0),this.prepareFollowingPage(t);const[a,o]=this.getFollowingPageDiff(t);this.playState="running";const l=Ge(r,[{transform:"translate(0, 0)"},{transform:"translate(".concat(-a,", ").concat(-o,")")}],e);return Ie(l,(()=>{this.innerCurrPage=t,this.playState="idle",this.setVisiblePages([t]),this.updatePageInfo()})),l}prev(){const{loop:t}=this.attributes,e=this.pageViews.length,n=this.currPage;if(!t&&n<=0)return null;const i=t?(n-1+e)%e:de(n-1,0,e);return this.goTo(i)}next(){const{loop:t}=this.attributes,e=this.pageViews.length,n=this.currPage;if(!t&&n>=e-1)return null;const i=t?(n+1)%e:de(n+1,0,e);return this.goTo(i)}renderClipPath(t){const{pageWidth:e,pageHeight:n}=this.pageShape;e&&n?(this.clipPath=t.maybeAppendByClassName(br.clipPath,"rect").styles({width:e,height:n}),this.contentGroup.attr("clipPath",this.clipPath.node())):this.contentGroup.style.clipPath=void 0}setVisiblePages(t){this.playWindow.children.forEach(((e,n)=>{t.includes(n)?s(e):a(e)}))}adjustControllerLayout(){const{prevBtnGroup:t,nextBtnGroup:e,pageInfoGroup:n}=this,{orientation:i,controllerPadding:r}=this.attributes,{width:s,height:a}=n.getBBox(),[o,l]="horizontal"===i?[-180,0]:[-90,90];t.setLocalEulerAngles(o),e.setLocalEulerAngles(l);const{width:c,height:u}=t.getBBox(),{width:h,height:d}=e.getBBox(),p=Math.max(c,s,h),{offset:[[f,g],[m,y],[b,v]],textAlign:x}="horizontal"===i?{offset:[[0,0],[c/2+r,0],[c+s+2*r,0]],textAlign:"start"}:{offset:[[p/2,-u-r],[p/2,0],[p/2,d+r]],textAlign:"center"},w=n.querySelector("text");w&&(w.style.textAlign=x),t.setLocalPosition(f,g),n.setLocalPosition(m,y),e.setLocalPosition(b,v)}updatePageInfo(){var t;const{currPage:e,pageViews:n,attributes:{formatter:i}}=this;n.length<2||(null===(t=this.pageInfoGroup.querySelector(br.pageInfo.class))||void 0===t||t.attr("text",i(e+1,n.length)),this.adjustControllerLayout())}getFollowingPageDiff(t){const{currPage:e}=this;if(e===t)return[0,0];const{orientation:n}=this.attributes,{pageWidth:i,pageHeight:r}=this.pageShape,s=t<e?-1:1;return"horizontal"===n?[s*i,0]:[0,s*r]}prepareFollowingPage(t){const{currPage:e,pageViews:n}=this;if(this.setVisiblePages([t,e]),t!==e){const[e,i]=this.getFollowingPageDiff(t);n[t].setLocalPosition(e,i)}}renderController(t){const{controllerSpacing:e}=this.attributes,{pageWidth:n,pageHeight:i}=this.pageShape,r=this.pageViews.length>=2,s=t.maybeAppendByClassName(br.controller,"g");if(o(s.node(),r),!r)return;const a=B(this.attributes,"button"),l=B(this.attributes,"pageNum"),[{size:c,...u},h]=M(a),d=!s.select(br.prevBtnGroup.class).node(),p=s.maybeAppendByClassName(br.prevBtnGroup,"g").styles(h);this.prevBtnGroup=p.node();const f=p.maybeAppendByClassName(br.prevBtn,"path"),g=s.maybeAppendByClassName(br.nextBtnGroup,"g").styles(h);this.nextBtnGroup=g.node(),[f,g.maybeAppendByClassName(br.nextBtn,"path")].forEach((t=>{t.styles({...u,transformOrigin:"center"}),Tn(t.node(),c,!0)}));const m=s.maybeAppendByClassName(br.pageInfoGroup,"g");this.pageInfoGroup=m.node(),m.maybeAppendByClassName(br.pageInfo,"text").styles(l),this.updatePageInfo(),s.node().setLocalPosition(n+e,i/2),d&&(this.prevBtnGroup.addEventListener("click",(()=>{this.prev()})),this.nextBtnGroup.addEventListener("click",(()=>{this.next()})))}render(t,e){const n=G(e);this.renderClipPath(n),this.renderController(n),this.setVisiblePages([this.defaultPage]),this.goTo(this.defaultPage)}bindEvents(){const e=(n=()=>this.render(this.attributes,this),i=50,function(){var t=this,e=arguments,a=r&&!s;clearTimeout(s),s=setTimeout((function(){s=null,r||n.apply(t,e)}),i),a&&n.apply(t,e)});var n,i,r,s;this.playWindow.addEventListener(t.ElementEvent.INSERTED,e),this.playWindow.addEventListener(t.ElementEvent.REMOVED,e)}}function xr(t,e,n){return e=function(t){var e=function(t,e){if("object"!=typeof t||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var i=n.call(t,"string");if("object"!=typeof i)return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==typeof e?e:String(e)}(e),e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}const wr=$e({layout:"flex",markerGroup:"marker-group",marker:"marker",labelGroup:"label-group",label:"label",valueGroup:"value-group",value:"value",backgroundGroup:"background-group",background:"background"},"legend-category-item");class Sr extends x{constructor(e){super(e,{span:[1,1],marker:()=>new t.Circle({style:{r:6}}),markerSize:10,labelFill:"#646464",valueFill:"#646464",labelFontSize:12,valueFontSize:12,labelTextBaseline:"middle",valueTextBaseline:"middle"}),xr(this,"markerGroup",void 0),xr(this,"labelGroup",void 0),xr(this,"valueGroup",void 0),xr(this,"background",void 0)}get showValue(){const{valueText:t}=this.attributes;return!!t&&("string"==typeof t||"number"==typeof t?""!==t:"function"==typeof t||""!==t.attr("text"))}get actualSpace(){const t=this.labelGroup,e=this.valueGroup,{markerSize:n}=this.attributes,{width:i,height:r}=t.node().getBBox(),{width:s,height:a}=e.node().getBBox();return{markerWidth:n,labelWidth:i,valueWidth:s,height:Math.max(n,r,a)}}get span(){const{span:t}=this.attributes;if(!t)return[1,1];const[e,n]=T(t),i=this.showValue?n:0,r=e+i;return[e/r,i/r]}get shape(){const{markerSize:t,width:e}=this.attributes,n=this.actualSpace,{markerWidth:i,height:r}=n;let{labelWidth:s,valueWidth:a}=this.actualSpace;const[o,l]=this.spacing;if(e){const n=e-t-o-l,[i,r]=this.span;[s,a]=[i*n,r*n]}return{width:i+s+a+o+l,height:r,markerWidth:i,labelWidth:s,valueWidth:a}}get spacing(){const{spacing:t}=this.attributes;if(!t)return[0,0];const[e,n]=T(t);return this.showValue?[e,n]:[e,0]}get layout(){const{markerWidth:t,labelWidth:e,valueWidth:n,width:i,height:r}=this.shape,[s,a]=this.spacing;return{height:r,width:i,markerWidth:t,labelWidth:e,valueWidth:n,position:[t/2,t+s,t+e+s+a]}}get scaleSize(){const t=function(t){const e=t.querySelector(wr.marker.class);return e?e.style:{}}(this.markerGroup.node()),{markerSize:e,markerStrokeWidth:n=t.strokeWidth,markerLineWidth:i=t.lineWidth,markerStroke:r=t.stroke}=this.attributes,s=+(n||i||(r?1:0))*Math.sqrt(2),{width:a,height:o}=this.markerGroup.node().getBBox();return(1-s/Math.max(a,o))*e}renderMarker(t){const{marker:e}=this.attributes,n=B(this.attributes,"marker");this.markerGroup=t.maybeAppendByClassName(wr.markerGroup,"g").style("zIndex",0),W(!!e,this.markerGroup,(()=>{const t=this.markerGroup.node(),i=t.getElementsByClassName(wr.marker.name)[0],r=e();i?r.nodeName===i.nodeName?(ki(i,r),G(i).styles(n)):(i.remove(),G(r).attr("className",wr.marker.name).styles(n),t.appendChild(r)):(G(r).attr("className",wr.marker.name).styles(n),t.appendChild(r)),this.markerGroup.node().scale(1/this.markerGroup.node().getScale()[0]),Tn(this.markerGroup.node(),this.scaleSize,!0)}))}renderLabel(t){const{text:e,...n}=B(this.attributes,"label");this.labelGroup=t.maybeAppendByClassName(wr.labelGroup,"g").style("zIndex",0),this.labelGroup.maybeAppendByClassName(wr.label,(()=>On(e))).styles(n)}renderValue(t){const{text:e,...n}=B(this.attributes,"value");this.valueGroup=t.maybeAppendByClassName(wr.valueGroup,"g").style("zIndex",0),W(this.showValue,this.valueGroup,(()=>{this.valueGroup.maybeAppendByClassName(wr.value,(()=>On(e))).styles(n)}))}renderBackground(t){const{width:e,height:n}=this.shape,i=B(this.attributes,"background");this.background=t.maybeAppendByClassName(wr.backgroundGroup,"g").style("zIndex",-1),this.background.maybeAppendByClassName(wr.background,"rect").styles({width:e,height:n,...i})}adjustLayout(){const{layout:{labelWidth:t,valueWidth:e,height:n,position:[i,r,s]}}=this,a=n/2;this.markerGroup.styles({x:i,y:a}),this.labelGroup.styles({x:r,y:a}),ii(this.labelGroup.select(wr.label.class).node(),Math.ceil(t)),this.showValue&&(this.valueGroup.styles({x:s,y:a}),ii(this.valueGroup.select(wr.value.class).node(),Math.ceil(e)))}render(t,e){const n=G(e);this.renderMarker(n),this.renderLabel(n),this.renderValue(n),this.renderBackground(n),this.adjustLayout()}}function kr(t,e,n){return e=function(t){var e=function(t,e){if("object"!=typeof t||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var i=n.call(t,"string");if("object"!=typeof i)return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==typeof e?e:String(e)}(e),e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}const Ar=$e({page:"item-page",navigator:"navigator",item:"item"},"items"),Lr=function(t,e){let n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];return t?e(t):n};class Pr extends x{constructor(t){super(t,{data:[],gridRow:1/0,gridCol:void 0,padding:0,width:1e3,height:100,rowPadding:0,colPadding:0,layout:"flex",orientation:"horizontal",click:fr,mouseenter:fr,mouseleave:fr}),kr(this,"navigator",void 0),kr(this,"navigatorShape",[0,0])}get pageViews(){return this.navigator.getContainer()}get grid(){const{gridRow:t,gridCol:e,data:n}=this.attributes;if(!t&&!e)throw new Error("gridRow and gridCol can not be set null at the same time");return t&&e?[t,e]:t?[t,n.length]:[n.length,e]}get renderData(){const{data:t,layout:e}=this.attributes,n=B(this.attributes,"item"),i=t.map(((i,r)=>{const{id:s=r,label:a,value:o}=i;return{id:"".concat(s),index:r,style:{layout:e,labelText:a,valueText:o,...Object.fromEntries(Object.entries(n).map((e=>{let[n,s]=e;return[n,gn(s,[i,r,t])]})))}}}));return i}getGridLayout(){const{orientation:t,width:e,rowPadding:n,colPadding:i}=this.attributes,[r]=this.navigatorShape,[s,a]=this.grid,o=a*s;let l=0;return this.pageViews.children.map(((c,u)=>{const h=Math.floor(u/o),d=u%o,p=this.ifHorizontal(a,s),f=[Math.floor(d/p),d%p];"vertical"===t&&f.reverse();const[g,m]=f,y=(e-r-(a-1)*i)/a,b=c.getBBox().height;let[v,x]=[0,0];return"horizontal"===t?([v,x]=[l,g*(b+n)],l=m===a-1?0:l+y+i):([v,x]=[m*(y+i),l],l=g===s-1?0:l+b+n),{page:h,index:u,row:g,col:m,pageIndex:d,width:y,height:b,x:v,y:x}}))}getFlexLayout(){const{width:t,height:e,rowPadding:n,colPadding:i}=this.attributes,[r]=this.navigatorShape,[s,a]=this.grid,[o,l]=[t-r,e];let[c,u,h,d,p,f,g,m]=[0,0,0,0,0,0,0,0];return this.pageViews.children.map(((t,e)=>{const{width:r,height:y}=t.getBBox(),b=0===g?0:i,v=g+b+r;return v<=o&&Lr(p,(t=>t<a))?([c,u,g]=[g+b,m,v],{width:r,height:y,x:c,y:u,page:h,index:e,pageIndex:d++,row:f,col:p++}):([f,p,g,m]=[f+1,0,0,m+y+n],m+y<=l&&Lr(f,(t=>t<s))?([c,u,g]=[g,m,r],{width:r,height:y,x:c,y:u,page:h,index:e,pageIndex:d++,row:f,col:p++}):([c,u,g,m,h,d,f,p]=[0,0,r,0,h+1,0,0,0],{width:r,height:y,x:c,y:u,page:h,index:e,pageIndex:d++,row:f,col:p++}))}))}get itemsLayout(){this.navigatorShape=[0,0];const t="grid"===this.attributes.layout?this.getGridLayout:this.getFlexLayout,e=t.call(this);return e.slice(-1)[0].page>0?(this.navigatorShape=[55,0],t.call(this)):e}ifHorizontal(t,e){const{orientation:n}=this.attributes;return Xi(n,t,e)}flattenPage(t){t.querySelectorAll(Ar.item.class).forEach((e=>{t.appendChild(e)})),t.querySelectorAll(Ar.page.class).forEach((e=>{t.removeChild(e).destroy()}))}renderItems(t){const{click:e,mouseenter:n,mouseleave:i}=this.attributes;this.flattenPage(t);const r=this.dispatchCustomEvent.bind(this);G(t).selectAll(Ar.item.class).data(this.renderData,(t=>t.id)).join((t=>t.append((t=>{let{style:e}=t;return new Sr({style:e})})).attr("className",Ar.item.name).on("click",(function(){null==e||e(this),r("itemClick",{item:this})})).on("pointerenter",(function(){null==n||n(this),r("itemMouseenter",{item:this})})).on("pointerleave",(function(){null==i||i(this),r("itemMouseleave",{item:this})}))),(t=>t.each((function(t){let{style:e}=t;this.update(e)}))),(t=>t.remove()))}relayoutNavigator(){var t;const{layout:e,width:n}=this.attributes,i=(null===(t=this.pageViews.children[0])||void 0===t?void 0:t.getBBox().height)||0,[r,s]=this.navigatorShape;this.navigator.update("grid"===e?{pageWidth:n-r,pageHeight:i-s}:{})}adjustLayout(){const e=Object.entries(gr(this.itemsLayout,"page")).map((t=>{let[e,n]=t;return{page:e,layouts:n}})),n=[...this.navigator.getContainer().children];e.forEach((e=>{let{layouts:i}=e;const r=this.pageViews.appendChild(new t.Group({className:Ar.page.name}));i.forEach((t=>{const{x:e,y:i,index:s,width:a,height:o}=t,l=n[s];r.appendChild(l),function(t,e,n){var i=t,r=U(e)?e.split("."):e;r.forEach((function(t,e){e<r.length-1?(Z(i[t])||(i[t]=O(r[e+1])?[]:{}),i=i[t]):i[t]=n}))}(l,"__layout__",t),l.update({x:e,y:i,width:a,height:o})}))})),this.relayoutNavigator()}renderNavigator(t){const{orientation:e}=this.attributes,n=B(this.attributes,"nav"),i=y({orientation:e},n),r=this;return t.selectAll(Ar.navigator.class).data(["nav"]).join((t=>t.append((()=>new vr({style:i}))).attr("className",Ar.navigator.name).each((function(){r.navigator=this}))),(t=>t.each((function(){this.update(i)}))),(t=>t.remove())),this.navigator}getBBox(){return this.navigator.getBBox()}render(t,e){const{data:n}=this.attributes;if(!n||0===n.length)return;const i=this.renderNavigator(G(e));this.renderItems(i.getContainer()),this.adjustLayout()}dispatchCustomEvent(e,n){const i=new t.CustomEvent(e,{detail:n});this.dispatchEvent(i)}}function Er(t,e,n){return e=function(t){var e=function(t,e){if("object"!=typeof t||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var i=n.call(t,"string");if("object"!=typeof i)return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==typeof e?e:String(e)}(e),e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}class Br extends x{constructor(t){super(t,nr),Er(this,"titleGroup",void 0),Er(this,"title",void 0),Er(this,"itemsGroup",void 0),Er(this,"items",void 0)}renderTitle(t,e,n){const{showTitle:i,titleText:r}=this.attributes,s=B(this.attributes,"title"),[a,o]=M(s);this.titleGroup=t.maybeAppendByClassName(rr.titleGroup,"g").styles(o);const l={width:e,height:n,...a,text:i?r:""};this.title=this.titleGroup.maybeAppendByClassName(rr.title,(()=>new Wi({style:l}))).update(l)}renderItems(t,e){const{x:n,y:i,width:r,height:s}=e,a=B(this.attributes,"title",!0),[o,l]=M(a),c={...o,width:r,height:s,x:0,y:0};this.itemsGroup=t.maybeAppendByClassName(rr.itemsGroup,"g").styles({x:n,y:i,...l});const u=this;this.itemsGroup.selectAll(rr.items.class).data(["items"]).join((t=>t.append((()=>new Pr({style:c}))).attr("className",rr.items.name).each((function(){u.items=G(this)}))),(t=>t.update(c)),(t=>t.remove()))}adjustLayout(){const{showTitle:t}=this.attributes;if(t){const{x:t,y:e}=this.title.node().getAvailableSpace();this.itemsGroup.node().setLocalPosition(t,e)}}get availableSpace(){const{showTitle:t,width:e,height:n}=this.attributes;return t?this.title.node().getAvailableSpace():new Ii(0,0,e,n)}getBBox(){var t,e;const n=null===(t=this.title)||void 0===t?void 0:t.node(),i=null===(e=this.items)||void 0===e?void 0:e.node();return n&&i?function(t,e){const{position:n,spacing:i,inset:r,text:s}=t.attributes,a=t.getBBox(),o=e.getBBox(),l=Hi(n),[c,u,h,d]=T(s?i:0),[p,f,g,m]=T(r),[y,b]=[d+u,c+h],[v,x]=[m+f,p+g];if("l"===l[0])return new Ii(a.x,a.y,o.width+a.width+y+v,Math.max(o.height+x,a.height));if("t"===l[0])return new Ii(a.x,a.y,Math.max(o.width+v,a.width),o.height+a.height+b+x);const[w,S]=[e.attributes.width||o.width,e.attributes.height||o.height];return new Ii(o.x,o.y,w+a.width+y+v,S+a.height+b+x)}(n,i):super.getBBox()}render(t,e){const{width:n,height:i}=t,r=G(e);this.renderTitle(r,n,i),this.renderItems(r,this.availableSpace),this.adjustLayout()}}function Cr(t){var e=document.createElement("div");e.innerHTML=t;var n=e.childNodes[0];return n&&e.contains(n)&&e.removeChild(n),n}function Mr(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return{CONTAINER:"".concat(t,"tooltip"),TITLE:"".concat(t,"tooltip-title"),LIST:"".concat(t,"tooltip-list"),LIST_ITEM:"".concat(t,"tooltip-list-item"),NAME:"".concat(t,"tooltip-list-item-name"),MARKER:"".concat(t,"tooltip-list-item-marker"),NAME_LABEL:"".concat(t,"tooltip-list-item-name-label"),VALUE:"".concat(t,"tooltip-list-item-value"),CROSSHAIR_X:"".concat(t,"tooltip-crosshair-x"),CROSSHAIR_Y:"".concat(t,"tooltip-crosshair-y")}}const Or={overflow:"hidden","white-space":"nowrap","text-overflow":"ellipsis"};function Tr(){const t=Mr(arguments.length>0&&void 0!==arguments[0]?arguments[0]:"");return{[".".concat(t.CONTAINER)]:{position:"absolute",visibility:"visible","z-index":8,transition:"visibility 0.2s cubic-bezier(0.23, 1, 0.32, 1), left 0.4s cubic-bezier(0.23, 1, 0.32, 1), top 0.4s cubic-bezier(0.23, 1, 0.32, 1)","background-color":"rgba(255, 255, 255, 0.96)","box-shadow":"0 6px 12px 0 rgba(0, 0, 0, 0.12)","border-radius":"4px",color:"rgba(0, 0, 0, 0.65)","font-size":"12px","line-height":"20px",padding:"12px","min-width":"120px","max-width":"360px","font-family":"Roboto-Regular"},[".".concat(t.TITLE)]:{color:"rgba(0, 0, 0, 0.45)"},[".".concat(t.LIST)]:{margin:"0px","list-style-type":"none",padding:"0px"},[".".concat(t.LIST_ITEM)]:{"list-style-type":"none",display:"flex","line-height":"2em","align-items":"center","justify-content":"space-between","white-space":"nowrap"},[".".concat(t.MARKER)]:{width:"8px",height:"8px","border-radius":"50%",display:"inline-block","margin-right":"4px"},[".".concat(t.NAME)]:{display:"flex","align-items":"center","max-width":"216px"},[".".concat(t.NAME_LABEL)]:{flex:1,...Or},[".".concat(t.VALUE)]:{display:"inline-block",float:"right",flex:1,"text-align":"right","min-width":"28px","margin-left":"30px",color:"rgba(0, 0, 0, 0.85)",...Or},[".".concat(t.CROSSHAIR_X)]:{position:"absolute",width:"1px","background-color":"rgba(0, 0, 0, 0.25)"},[".".concat(t.CROSSHAIR_Y)]:{position:"absolute",height:"1px","background-color":"rgba(0, 0, 0, 0.25)"}}}function jr(t,e,n){return e=function(t){var e=function(t,e){if("object"!=typeof t||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var i=n.call(t,"string");if("object"!=typeof i)return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==typeof e?e:String(e)}(e),e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}class Nr extends x{get HTMLTooltipElement(){return this.element}getContainer(){return this.element}get elementSize(){return{width:this.element.offsetWidth,height:this.element.offsetHeight}}get HTMLTooltipItemsElements(){const{data:t,template:e}=this.attributes;return t.map(((t,n)=>{let{name:i="",color:r="black",index:s,...a}=t;const o={name:i,color:r,index:null!=s?s:n,...a};return Cr((l=e.item,c=o,l&&c?l.replace(/\\?\{([^{}]+)\}/g,(function(t,e){return"\\"===t.charAt(0)?t.slice(1):void 0===c[e]?"":c[e]})):l));var l,c}))}constructor(t){var e;const n=null===(e=t.style)||void 0===e||null===(e=e.template)||void 0===e?void 0:e.prefixCls,i=Mr(n);super(t,{data:[],x:0,y:0,visibility:"visible",title:"",position:"bottom-right",offset:[5,5],enterable:!1,container:{x:0,y:0},bounding:null,template:{prefixCls:"",container:'<div class="'.concat(i.CONTAINER,'"></div>'),title:'<div class="'.concat(i.TITLE,'"></div>'),item:'<li class="'.concat(i.LIST_ITEM,'" data-index={index}>\n <span class="').concat(i.NAME,'">\n <span class="').concat(i.MARKER,'" style="background:{color}"></span>\n <span class="').concat(i.NAME_LABEL,'" title="{name}">{name}</span>\n </span>\n <span class="').concat(i.VALUE,'" title="{value}">{value}</span>\n </li>')},style:Tr(n)}),jr(this,"timestamp",-1),jr(this,"element",void 0),jr(this,"prevCustomContentKey",this.attributes.contentKey),this.initShape(),this.render(this.attributes,this)}render(t,e){this.renderHTMLTooltipElement(),this.updatePosition()}destroy(){var t;null===(t=this.element)||void 0===t||t.remove(),super.destroy()}show(t,e){if(void 0!==t&&void 0!==e){const n=()=>{this.attributes.x=null!=t?t:this.attributes.x,this.attributes.y=null!=e?e:this.attributes.y,this.updatePosition()};"hidden"===this.element.style.visibility?this.closeTransition(n):n()}this.element.style.visibility="visible"}hide(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;const{enterable:n}=this.attributes;n&&this.isCursorEntered(t,e)||(this.element.style.visibility="hidden")}initShape(){const{template:t}=this.attributes;this.element=Cr(t.container),this.id&&this.element.setAttribute("id",this.id)}renderCustomContent(){if(void 0!==this.prevCustomContentKey&&this.prevCustomContentKey===this.attributes.contentKey)return;this.prevCustomContentKey=this.attributes.contentKey;const{content:t}=this.attributes;t&&("string"==typeof t?this.element.innerHTML=t:this.element.replaceChildren(t))}renderHTMLTooltipElement(){const{template:t,title:e,enterable:n,style:i,content:r}=this.attributes,s=Mr(t.prefixCls),a=this.element;if(this.element.style.pointerEvents=n?"auto":"none",r)this.renderCustomContent();else{var o;e?(a.innerHTML=t.title,a.getElementsByClassName(s.TITLE)[0].innerHTML=e):null===(o=a.getElementsByClassName(s.TITLE))||void 0===o||null===(o=o[0])||void 0===o||o.remove();const n=this.HTMLTooltipItemsElements,i=document.createElement("ul");i.className=s.LIST,i.replaceChildren(...n);const r=this.element.querySelector(".".concat(s.LIST));r?r.replaceWith(i):a.appendChild(i)}P(a,i)}getRelativeOffsetFromCursor(t){const{position:e,offset:n}=this.attributes,i=(t||e).split("-"),r={left:[-1,0],right:[1,0],top:[0,-1],bottom:[0,1]},{width:s,height:a}=this.elementSize;let o=[-s/2,-a/2];return i.forEach((t=>{const[e,i]=o,[l,c]=r[t];o=[e+(s/2+n[0])*l,i+(a/2+n[1])*c]})),o}setOffsetPosition(t){let[e,n]=t;const{x:i=0,y:r=0,container:{x:s,y:a}}=this.attributes;this.element.style.left="".concat(+i+s+e,"px"),this.element.style.top="".concat(+r+a+n,"px")}updatePosition(){const{showDelay:t=60}=this.attributes,e=Date.now();this.timestamp>0&&e-this.timestamp<t||(this.timestamp=e,this.setOffsetPosition(this.autoPosition(this.getRelativeOffsetFromCursor())))}autoPosition(t){let[e,n]=t;const{x:i,y:r,bounding:s,position:a}=this.attributes;if(!s)return[e,n];const{offsetWidth:o,offsetHeight:l}=this.element,[c,u]=[+i+e,+r+n],h={left:"right",right:"left",top:"bottom",bottom:"top"},{x:d,y:p,width:f,height:g}=s,m={left:c<d,right:c+o>d+f,top:u<p,bottom:u+l>p+g},y=[];a.split("-").forEach((t=>{m[t]?y.push(h[t]):y.push(t)}));const b=y.join("-");return this.getRelativeOffsetFromCursor(b)}isCursorEntered(t,e){if(this.element){const{x:n,y:i,width:r,height:s}=this.element.getBoundingClientRect();return new Ii(n,i,r,s).isPointIn(t,e)}return!1}closeTransition(t){const e=this.element.style.transition;this.element.style.transition="none",t(),setTimeout((()=>{this.element.style.transition=e}),10)}}jr(Nr,"tag","tooltip");const _r={default:{sizeStyle:{width:44,height:22,radius:11},tagStyle:{textStyle:{fontSize:12,lineHeight:16,fill:"#fff"},padding:0},markerStyle:{size:11}},small:{sizeStyle:{width:28,height:16,radius:8},tagStyle:{textStyle:{fontSize:10,lineHeight:14,fill:"#fff"},padding:0},markerStyle:{size:8}},mini:{sizeStyle:{width:20,height:14,radius:7},tagStyle:{textStyle:{fontSize:7,lineHeight:10,fill:"#fff"},padding:0},markerStyle:{size:7}}};function zr(t,e,n){return e=function(t){var e=function(t,e){if("object"!=typeof t||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var i=n.call(t,"string");if("object"!=typeof i)return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==typeof e?e:String(e)}(e),e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Ir(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];const i=Number(t.style.height)-2*e;return{x:n?Number(t.style.width)+Number(t.style.x)-e-i:Number(t.style.x)+e,y:Number(t.style.y)+e,width:i,height:i,radius:i/2}}class Fr extends x{constructor(t){super(t,{x:0,y:0,size:"default",spacing:2,checked:!0,disabled:!1}),zr(this,"checked",void 0)}render(t,e){const{size:n,spacing:i,disabled:r,checked:s,unCheckedChildren:a,checkedChildren:o}=t,l=G(e).maybeAppendByClassName("switch-content","g").node(),c=l.getLocalBounds(),{sizeStyle:u,tagStyle:h}=Ln(_r,n,_r.default),d=r?"no-drop":"pointer",p=s?"#1890FF":"#00000040";let f=u;const g=s?o:a;(o||a)&&G(l).maybeAppendByClassName("switch-tag",(()=>new nt({}))).call((t=>{const e=t.node();e.update({cursor:d,backgroundStyle:null,text:!1,marker:!1,...h,...g});const{max:n,min:i}=(null==e?void 0:e.getLocalBounds())||{},r=n[0]-i[0]+u.radius,a=n[1]-i[1],o=Math.max(r+u.height+2,u.width);f={...u,width:o},e.update(function(t,e){let{width:n,height:i}=e,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;return{x:arguments.length>3&&void 0!==arguments[3]&&!arguments[3]?Number(t.width)+Number(t.x)-n:Number(t.x)+r,y:Number(t.y)+(Number(t.height)-i)/2}}({x:c.min[0],y:c.min[1],width:o,height:f.height},{width:r,height:a},f.radius,s))}));const m=G(l).maybeAppendByClassName("switch-background","rect").styles({zIndex:(l.style.zIndex||0)-1,x:c.min[0],y:c.min[1],fill:p,cursor:d,fillOpacity:r?.4:1,...f}).node(),y=G(l).maybeAppendByClassName("switch-background-stroke","rect").styles({zIndex:(l.style.zIndex||0)-2,x:c.min[0],y:c.min[1],stroke:p,lineWidth:0,...f}).node();G(l).maybeAppendByClassName("switch-handle","rect").styles({fill:"#fff",cursor:d}).call((t=>{const e=t.node(),n=Ir(m,i,s),r=Ir(m,i,!s);var a,o;e.attr("x")&&!ge(n,r)&&this.checked!==s?(e.attr(r),null===(a=e.getAnimations()[0])||void 0===a||a.cancel(),null===(o=y.getAnimations()[0])||void 0===o||o.cancel(),e.animate([{x:r.x},{x:n.x}],{duration:120,fill:"both"}),y.animate([{lineWidth:0,strokeOpacity:.5},{lineWidth:14,strokeOpacity:0}],{duration:400,easing:"ease-on"})):e.attr(n)})),this.checked=!!s}}zr(Fr,"tag","switch");const Gr={tagText:"",lineStroke:"#416180",lineStrokeOpacity:.45,lineLineWidth:1,lineLineDash:[5,5]},Hr=y({},Gr,{type:"line",tagPosition:"start",tagAlign:"center",tagVerticalAlign:"bottom"}),Vr=y({},Gr,{type:"circle",defaultRadius:0}),Wr=y({},Gr,{type:"polygon",defaultRadius:0,startAngle:0});function Dr(t,e,n){return e=function(t){var e=function(t,e){if("object"!=typeof t||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var i=n.call(t,"string");if("object"!=typeof i)return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==typeof e?e:String(e)}(e),e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}class Rr extends x{get localPointer(){const[t,e]=this.getPosition(),[n,i]=this.pointer;return[n-t,i-e]}get tagStyle(){return B(this.attributes,"tag")}get crosshairStyle(){return{...B(this.attributes,"line"),path:this.crosshairPath}}constructor(t){super(t,Gr),Dr(this,"pointer",void 0),Dr(this,"shapesGroup",void 0),Dr(this,"tagShape",void 0),Dr(this,"crosshairShape",void 0)}render(t,e){const n=G(e).maybeAppendByClassName(".crosshair-group","g").node();this.shapesGroup=n;const i=this.tagStyle,r=this.crosshairStyle;this.tagShape=G(n).maybeAppendByClassName("crosshair-tag",(()=>new nt({style:i}))).styles(i).node(),this.crosshairShape=G(n).maybeAppendByClassName(".crosshair-path","path").styles(r).node(),this.adjustLayout()}setPointer(t){this.pointer=t}}function Yr(t,e,n){return e=function(t){var e=function(t,e){if("object"!=typeof t||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var i=n.call(t,"string");if("object"!=typeof i)return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==typeof e?e:String(e)}(e),e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}Dr(Rr,"tag","crosshair-base");class qr extends Rr{get crosshairPath(){const{startPos:[t,e],endPos:[n,i]}=this.attributes;return[["M",0,0],["L",n-t,i-e],["Z"]]}get localPointer(){if(!this.pointer)return this.attributes.startPos;const[t,e]=this.getPosition(),[n,i]=this.pointer;return[n-t,i-e]}get isVertical(){const{startPos:[t,e],endPos:[n,i]}=this.attributes;return t===n&&e!==i}get tagShapeSpace(){const{width:t,height:e}=bi(this.tagShape);return{width:t,height:e}}constructor(t){super(y({},qr.defaultOptions,t))}update(t){super.update(t)}setPointer(t){super.setPointer(t),this.adjustPosition()}setText(t){this.tagShape.update({text:t}),this.adjustTag()}adjustLayout(){this.adjustPosition(),this.adjustTag()}adjustPosition(){const[t,e]=this.localPointer,{startPos:[n,i]}=this.attributes,r=this.getOrientVal([n,e],[t,i]);this.shapesGroup.setLocalPosition(r)}adjustTag(){const{tagText:t,tagPosition:e,startPos:[n,i],endPos:[r,o]}=this.attributes;if(!t||""===t)return void a(this.tagShape);s(this.tagShape);const{width:l,height:c}=this.tagShapeSpace,[u,h]=this.getOrientVal({start:[-l/2,c/2],end:[r-n+l/2,c/2]},{start:[0,0],end:[0,o-i+c]})[e];this.tagShape.setLocalPosition(u,h)}getOrientVal(t,e){return this.isVertical?e:t}}function Kr(t,e,n){return e=function(t){var e=function(t,e){if("object"!=typeof t||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var i=n.call(t,"string");if("object"!=typeof i)return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==typeof e?e:String(e)}(e),e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}Yr(qr,"tag","line-crosshair"),Yr(qr,"defaultOptions",{style:Hr});class Zr extends Rr{get crosshairPath(){return this.createCirclePath()}constructor(t){super(y({},Zr.defaultOptions,t))}update(t){super.update(t)}setPointer(t){let[e,n]=t;super.setPointer([e,n]);const[i,r]=this.localPointer,{center:[s,a]}=this.attributes,o=this.createCirclePath(((i-s)**2+(r-a)**2)**.5);this.crosshairShape.attr({path:o})}adjustLayout(){a(this.tagShape)}createCirclePath(t){const{center:[e,n],defaultRadius:i}=this.attributes;return D(e,n,t||i)}}function Ur(t,e){let[n,i]=t,[r,s]=e;return((n-r)**2+(i-s)**2)**.5}function $r(t,e,n,i,r,s){return(t===e||Math.min(t,e)<=r&&r<=Math.max(t,e))&&(n===i||Math.min(n,i)<=s&&s<=Math.max(n,i))}function Xr(t,e,n){const i=t;(!t.length||e<t[0]||e===t[0]&&n<t[1])&&(i[0]=e,i[1]=n)}function Jr(t,e,n,i){let[r,s]=t,[a,o]=e,[l,c]=n,[u,h]=i;const d=[];if((h-c)*(a-r)==(o-s)*(u-l))(o-s)*(l-r)==(c-s)*(a-r)&&($r(r,a,s,o,l,c)&&Xr(d,l,c),$r(r,a,s,o,u,h)&&Xr(d,u,h),$r(l,u,c,h,r,s)&&Xr(d,r,s),$r(l,u,c,h,a,o)&&Xr(d,a,o));else{const t=(l*(h-c)+s*(u-l)-c*(u-l)-r*(h-c))/((a-r)*(h-c)-(u-l)*(o-s)),e=(r*(o-s)+c*(a-r)-s*(a-r)-l*(o-s))/((u-l)*(o-s)-(a-r)*(h-c));t>=0&&t<=1&&e>=0&&e<=1&&(d[0]=r+t*(a-r),d[1]=s+t*(o-s))}return d}function Qr(t,e,n){return e=function(t){var e=function(t,e){if("object"!=typeof t||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var i=n.call(t,"string");if("object"!=typeof i)return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==typeof e?e:String(e)}(e),e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}Kr(Zr,"tag","circle-crosshair"),Kr(Zr,"defaultOptions",{style:Vr});class ts extends Rr{get crosshairPath(){return this.createPolygonPath()}constructor(t){super(y({},ts.defaultOptions,t))}update(t){super.update(t)}get points(){const{startAngle:t,sides:e}=this.attributes,n=2*Math.PI/e,i=[1,0],r=[];for(let s=0;s<e;s+=1)r.push(ke(i,[0,0],t/180*Math.PI+n*s));return r}setPointer(t){let[e,n]=t;super.setPointer([e,n]);const[i,r]=this.localPointer,{center:s}=this.attributes,[a,o]=this.intersection([i,r]);if(!a||!o)return;const l=Ur(s,[i,r])/Ur(s,[a,o]),c=this.createPolygonPath(l);this.crosshairShape.attr({path:c})}adjustLayout(){a(this.tagShape)}createPolygonPath(t){const{defaultRadius:e,center:[n,i]}=this.attributes,r=this.points.map(((r,s)=>{let[a,o]=r;const[l,c]=me([a,o],t||e);return[0===s?"M":"L",n+l,i+c]}));return r.push(["Z"]),r}intersection(t){let[e,n]=t;const{points:i}=this,{center:[r,s]}=this.attributes;let a,o;for(let t=1;t<=i.length;t+=1){const[l,c]=i[t-1],[u,h]=i[t%i.length],d=Jr([e,n],[r,s],[l+r,c+s],[u+r,h+s]);0!==d.length&&([a,o]=d)}return[a,o]}}Qr(ts,"tag","polygon-crosshair"),Qr(ts,"defaultOptions",{style:Wr});const es=C({fill:"rgba(0,0,0,0.45)",fontSize:10,textAlign:"start",textBaseline:"middle",overflow:"clip"},"label"),ns={width:12,height:12,radius:2,stroke:"#dadada",lineWidth:1,fill:"#ffffff",cursor:"pointer"},is={width:12,height:12,radius:2,stroke:"#3471F9",lineWidth:1,fill:"#3471F9",cursor:"pointer"},rs={path:[["M",3,6],["L","5","8.5"],["L","8.5","4"]],lineWidth:1,cursor:"pointer"};function ss(t,e,n){return e=function(t){var e=function(t,e){if("object"!=typeof t||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var i=n.call(t,"string");if("object"!=typeof i)return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==typeof e?e:String(e)}(e),e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}class as extends x{constructor(t){super(t,{x:0,y:0,labelText:"",spacing:4,checked:!1,...es}),ss(this,"checkboxBoxShape",void 0),ss(this,"checked",void 0)}render(t,e){const{checked:n,spacing:i}=t;this.checked=!!n;const r=H(e,".checkbox-content","g").attr("className","checkbox-content").node(),s=B(t,"box"),a=B(t,"checked"),o=B(t,"label"),l={...this.checked?is:ns,...s},c={...rs,...a};this.checkboxBoxShape=H(r,".checkbox-box","rect").styles({className:"checkbox-box",zIndex:(r.style.zIndex||0)-1,...l}).node(),H(this.checkboxBoxShape,".checkbox-checked","path").styles({className:"checkbox-box-checked",stroke:"#fff",...c});const{x:u,y:h}=function(t,e){const n=t.getLocalBounds();return{x:n.halfExtents[0]?n.max[0]+(e||0):t.style.x,y:n.halfExtents[1]?(n.min[1]+n.max[1])/2:t.style.y}}(this.checkboxBoxShape,Number(i));H(r,".checkbox-label","text").styles({className:"checkbox-label",x:u,y:h,...o})}}function os(t,e){for(var n in e)e.hasOwnProperty(n)&&"constructor"!==n&&void 0!==e[n]&&(t[n]=e[n])}ss(as,"tag","checkbox");const ls="component-poptip",cs="component-poptip-arrow",us="component-poptip-text",hs={[".".concat(ls)]:{visibility:"visible",position:"absolute","background-color":"rgba(0, 0, 0)","box-shadow":"0px 0px 10px #aeaeae","border-radius":"3px",color:"#fff",opacity:.8,"font-size":"12px",padding:"4px 6px",display:"flex","justify-content":"center","align-items":"center","z-index":8,transition:"visibility 50ms"},[".".concat(us)]:{"text-align":"center"},[".".concat(ls,"[data-position='top']")]:{transform:"translate(-50%, -100%)"},[".".concat(ls,"[data-position='left']")]:{transform:"translate(-100%, -50%)"},[".".concat(ls,"[data-position='right']")]:{transform:"translate(0, -50%)"},[".".concat(ls,"[data-position='bottom']")]:{transform:"translate(-50%, 0)"},[".".concat(ls,"[data-position='top-left']")]:{transform:"translate(0,-100%)"},[".".concat(ls,"[data-position='top-right']")]:{transform:"translate(-100%,-100%)"},[".".concat(ls,"[data-position='left-top']")]:{transform:"translate(-100%, 0)"},[".".concat(ls,"[data-position='left-bottom']")]:{transform:"translate(-100%, -100%)"},[".".concat(ls,"[data-position='right-top']")]:{transform:"translate(0, 0)"},[".".concat(ls,"[data-position='right-bottom']")]:{transform:"translate(0, -100%)"},[".".concat(ls,"[data-position='bottom-left']")]:{transform:"translate(0, 0)"},[".".concat(ls,"[data-position='bottom-right']")]:{transform:"translate(-100%, 0)"},[".".concat(cs)]:{width:"4px",height:"4px",transform:"rotate(45deg)","background-color":"rgba(0, 0, 0)",position:"absolute","z-index":-1},[".".concat(ls,"[data-position='top']")]:{transform:"translate(-50%, calc(-100% - 5px))"},["[data-position='top'] .".concat(cs)]:{bottom:"-2px"},[".".concat(ls,"[data-position='left']")]:{transform:"translate(calc(-100% - 5px), -50%)"},["[data-position='left'] .".concat(cs)]:{right:"-2px"},[".".concat(ls,"[data-position='right']")]:{transform:"translate(5px, -50%)"},["[data-position='right'] .".concat(cs)]:{left:"-2px"},[".".concat(ls,"[data-position='bottom']")]:{transform:"translate(-50%, 5px)"},["[data-position='bottom'] .".concat(cs)]:{top:"-2px"},[".".concat(ls,"[data-position='top-left']")]:{transform:"translate(0, calc(-100% - 5px))"},["[data-position='top-left'] .".concat(cs)]:{left:"10px",bottom:"-2px"},[".".concat(ls,"[data-position='top-right']")]:{transform:"translate(-100%, calc(-100% - 5px))"},["[data-position='top-right'] .".concat(cs)]:{right:"10px",bottom:"-2px"},[".".concat(ls,"[data-position='left-top']")]:{transform:"translate(calc(-100% - 5px), 0)"},["[data-position='left-top'] .".concat(cs)]:{right:"-2px",top:"8px"},[".".concat(ls,"[data-position='left-bottom']")]:{transform:"translate(calc(-100% - 5px), -100%)"},["[data-position='left-bottom'] .".concat(cs)]:{right:"-2px",bottom:"8px"},[".".concat(ls,"[data-position='right-top']")]:{transform:"translate(5px, 0)"},["[data-position='right-top'] .".concat(cs)]:{left:"-2px",top:"8px"},[".".concat(ls,"[data-position='right-bottom']")]:{transform:"translate(5px, -100%)"},["[data-position='right-bottom'] .".concat(cs)]:{left:"-2px",bottom:"8px"},[".".concat(ls,"[data-position='bottom-left']")]:{transform:"translate(0, 5px)"},["[data-position='bottom-left'] .".concat(cs)]:{top:"-2px",left:"8px"},[".".concat(ls,"[data-position='bottom-right']")]:{transform:"translate(-100%, 5px)"},["[data-position='bottom-right'] .".concat(cs)]:{top:"-2px",right:"8px"}};function ds(t){let e=t&&document.getElementById(t);return e||(e=document.createElement("div"),e.setAttribute("id",t),document.body.appendChild(e)),e}function ps(t,e,n){return e=function(t){var e=function(t,e){if("object"!=typeof t||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var i=n.call(t,"string");if("object"!=typeof i)return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==typeof e?e:String(e)}(e),e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}class fs extends x{get visible(){return"visible"===this.visibility}constructor(t){super(at({style:{id:"component-poptip"}},fs.defaultOptions,t)),ps(this,"container",void 0),ps(this,"visibility","visible"),ps(this,"map",new Map),ps(this,"domStyles",""),this.initShape(),this.render(this.attributes,this)}render(t,e){this.visibility=this.style.visibility,this.updatePoptipElement()}update(t){this.attr(at({},this.style,t)),this.render(this.attributes,this)}bind(t,e){if(!t)return;const{text:n}=this.style,i=i=>{let r=t,s=this.style,a=n;if(e){const{html:t,target:n,...u}="function"==typeof e?e.call(null,i):e;o={},c=u,(l=this.style)&&os(o,l),c&&os(o,c),s=o,(n||!1===n)&&(r=n),"string"==typeof t&&(a=t)}var o,l,c;const{position:u,arrowPointAtCenter:h,follow:d,offset:p}=s;if(r){const{clientX:t,clientY:e}=i,[n,s]=function(t,e,n,i){let r=arguments.length>4&&void 0!==arguments[4]&&arguments[4];if(arguments.length>5&&void 0!==arguments[5]&&arguments[5])return[t,e];const{x:s,y:a,width:o,height:l}=n.getBoundingClientRect();switch(i){case"top":return r?[s+o/2,a]:[t,a];case"left":return r?[s,a+l/2]:[s,e];case"bottom":return r?[s+o/2,a+l]:[t,a+l];case"right":return r?[s+o,a+l/2]:[s+o,e];case"top-right":case"right-top":return[s+o,a];case"left-bottom":case"bottom-left":return[s,a+l];case"right-bottom":case"bottom-right":return[s+o,a+l];default:return[s,a]}}(t,e,r,u,h,d);this.showTip(n,s,{text:a,position:u,offset:p})}else this.hideTip()},r=()=>{this.hideTip()};t.addEventListener("mousemove",i),t.addEventListener("mouseleave",r),this.map.set(t,[i,r])}unbind(t){if(this.map.has(t)){const[e,n]=this.map.get(t)||[];e&&t.removeEventListener("mousemove",e),n&&t.removeEventListener("mouseleave",n),this.map.delete(t)}}clear(){this.container.innerHTML=""}destroy(){var t;[...this.map.keys()].forEach((t=>this.unbind(t))),null===(t=this.container)||void 0===t||t.remove(),super.destroy()}showTip(t,e,n){const i=Ln(n,"text");if((!i||"string"==typeof i)&&(this.applyStyles(),t&&e&&n)){const{offset:r,position:s}=n;if(s&&this.container.setAttribute("data-position",s),this.setOffsetPosition(t,e,r),"string"==typeof i){const t=this.container.querySelector(".".concat(us));t&&(t.innerHTML=i)}this.visibility="visible",this.container.style.visibility="visible"}}hideTip(){this.visibility="hidden",this.container.style.visibility="hidden"}getContainer(){return this.container}getClassName(){const{containerClassName:t}=this.style;return"".concat(ls).concat(t?" ".concat(t):"")}initShape(){const{id:t}=this.style;this.container=function(t){const e=(t=>{let e;return function(){for(var n=arguments.length,i=new Array(n),r=0;r<n;r++)i[r]=arguments[r];return e||(e=t.apply(void 0,i)),e}})(ds)(t);return e}(t),this.container.className=this.getClassName(),this.container.addEventListener("mousemove",(()=>this.showTip())),this.container.addEventListener("mouseleave",(()=>this.hideTip()))}updatePoptipElement(){const{container:t}=this;this.clear();const{id:e,template:n,text:i}=this.style;this.container.setAttribute("id",e),this.container.className=this.getClassName();const r='<span class="'.concat(cs,'"></span>');var s;t.innerHTML=r,U(n)?t.innerHTML+=n:n&&((s=n)instanceof Element||s instanceof Document)&&t.appendChild(n),i&&(t.getElementsByClassName(us)[0].textContent=i),this.applyStyles(),this.container.style.visibility=this.visibility}applyStyles(){const t=y({},hs,this.style.domStyles),e=Object.entries(t).reduce(((t,e)=>{let[n,i]=e;const r=Object.entries(i).reduce(((t,e)=>{let[n,i]=e;return"".concat(t).concat(n,": ").concat(i,";")}),"");return"".concat(t).concat(n,"{").concat(r,"}")}),"");if(this.domStyles!==e){this.domStyles=e;let t=this.container.querySelector("style");t&&this.container.removeChild(t),t=document.createElement("style"),t.innerHTML=e,this.container.appendChild(t)}}setOffsetPosition(t,e){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:this.style.offset;const[i=0,r=0]=n;this.container.style.left="".concat(t+i,"px"),this.container.style.top="".concat(e+r,"px")}}function gs(t){let e=1/0,n=1/0,i=-1/0,r=-1/0;for(let s=0;s<t.length;s++){const{x:a,y:o,width:l,height:c}=t[s],[u,h]=[a+l,o+c];a<e&&(e=a),o<n&&(n=o),u>i&&(i=u),h>r&&(r=h)}return new Ii(e,n,i-e,r-n)}ps(fs,"tag","poptip"),ps(fs,"defaultOptions",{style:{x:0,y:0,width:0,height:0,target:null,visibility:"hidden",text:"",position:"top",follow:!1,offset:[0,0],domStyles:hs,template:'<div class="'.concat(us,'"></div>')}});const ms=function(t,e,n){const{width:i,height:r}=t,{flexDirection:s="row",flexWrap:a="nowrap",justifyContent:o="flex-start",alignContent:l="flex-start",alignItems:c="flex-start"}=n,u="row"===s,h="row"===s||"column"===s,d=u?h?[1,0]:[-1,0]:h?[0,1]:[0,-1];let[p,f]=[0,0];const g=e.map((t=>{const{width:e,height:n}=t,[i,r]=[p,f];return[p,f]=[p+e*d[0],f+n*d[1]],new Ii(i,r,e,n)})),m=gs(g),y={"flex-start":0,"flex-end":u?i-m.width:r-m.height,center:u?(i-m.width)/2:(r-m.height)/2},b=g.map((t=>{const{x:e,y:n}=t,i=Ii.fromRect(t);return i.x=u?e+y[o]:e,i.y=u?n:n+y[o],i})),v=(gs(b),t=>{const[e,n]=u?["height",r]:["width",i];switch(c){case"flex-start":default:return 0;case"flex-end":return n-t[e];case"center":return n/2-t[e]/2}});return b.map((t=>{const{x:e,y:n}=t,i=Ii.fromRect(t);return i.x=u?e:e+v(i),i.y=u?n+v(i):n,i})).map((e=>{var n,i;const r=Ii.fromRect(e);return r.x+=null!==(n=t.x)&&void 0!==n?n:0,r.y+=null!==(i=t.y)&&void 0!==i?i:0,r}))},ys=function(t,e,n){return[]},bs=(t,e,n)=>{if(0===e.length)return[];const i={flex:ms,grid:ys},r=n.display in i?i[n.display]:null;return(null==r?void 0:r.call(null,t,e,n))||[]};function vs(t,e,n){return e=function(t){var e=function(t,e){if("object"!=typeof t||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var i=n.call(t,"string");if("object"!=typeof i)return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==typeof e?e:String(e)}(e),e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}class xs extends t.Group{set margin(t){this.$margin=T(t)}get margin(){return this.$margin}set padding(t){this.$padding=T(t)}get padding(){return this.$padding}getBBox(){const{x:t=0,y:e=0,width:n,height:i}=this.attributes,[r,s,a,o]=this.$margin;return new Ii(t-o,e-r,n+o+s,i+r+a)}appendChild(t,e){return t.isMutationObserved=!0,super.appendChild(t,e),t}getAvailableSpace(){const{width:t,height:e}=this.attributes,[n,i,r,s]=this.$padding,[a,,,o]=this.$margin;return new Ii(s+o,n+a,t-s-i,e-n-r)}constructor(e){super(e),vs(this,"layoutEvents",[t.ElementEvent.BOUNDS_CHANGED,t.ElementEvent.INSERTED,t.ElementEvent.REMOVED]),vs(this,"$margin",T(0)),vs(this,"$padding",T(0));const{margin:n=0,padding:i=0}=e.style||{};this.margin=n,this.padding=i,this.isMutationObserved=!0,this.bindEvents()}layout(){if(this.attributes.display&&this.isConnected&&!this.children.some((t=>!t.isConnected)))try{const t=bs(this.getAvailableSpace(),this.children.map((t=>t.getBBox())),this.attributes);this.children.forEach(((e,n)=>{const{x:i,y:r}=t[n];e.attr({x:i,y:r})}))}catch(t){}}bindEvents(){this.layoutEvents.forEach((t=>{this.addEventListener(t,(t=>{t.target.isMutationObserved=!0,this.layout()}))}))}attributeChangedCallback(t,e,n){"margin"===t?this.margin=n:"padding"===t&&(this.padding=n),this.layout()}}function ws(t,e,n){return e=function(t){var e=function(t,e){if("object"!=typeof t||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var i=n.call(t,"string");if("object"!=typeof i)return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==typeof e?e:String(e)}(e),e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}class Ss extends x{get padding(){return T(this.style.padding)}renderLabel(){const{label:t,value:e}=this.style,n=B(this.attributes,"label");G(this.label).maybeAppend(".label",(()=>On(t))).attr("className","label").styles(n),this.label.attr("__data__",e)}renderBackground(){const t=this.label.getBBox(),[e,n,i,r]=this.padding,{width:s,height:a}=t,o=s+r+n,l=a+e+i,c=B(this.attributes,"background"),{width:u=0,height:h=0,selected:d}=this.style;this.background.attr({...c,width:Math.max(o,u),height:Math.max(l,h),fill:d?this.selectedColor:"#fff"}),this.label.attr({x:r,y:(l-a)/2})}constructor(e){super(y({},Ss.defaultOptions,e)),ws(this,"hoverColor","#f5f5f5"),ws(this,"selectedColor","#e6f7ff"),ws(this,"background",this.appendChild(new t.Rect({}))),ws(this,"label",this.background.appendChild(new t.Group({})))}render(){this.renderLabel(),this.renderBackground()}bindEvents(){this.addEventListener("pointerenter",(()=>{this.style.selected||this.background.attr("fill",this.hoverColor)})),this.addEventListener("pointerleave",(()=>{this.style.selected||this.background.attr("fill",this.style.backgroundFill)}));const t=this;this.addEventListener("click",(()=>{const{label:e,value:n,onClick:i}=this.style;null==i||i(n,{label:e,value:n},t)}))}}function ks(t,e,n){return e=function(t){var e=function(t,e){if("object"!=typeof t||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var i=n.call(t,"string");if("object"!=typeof i)return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==typeof e?e:String(e)}(e),e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}ws(Ss,"defaultOptions",{style:{value:"",label:"",cursor:"pointer"}});class As extends x{setValue(t){this.currentValue=t,this.render()}getValue(){return this.currentValue}get dropdownPadding(){return T(this.style.dropdownPadding)}renderSelect(){var t;const{width:e,height:n,bordered:i,showDropdownIcon:r}=this.style,s=B(this.attributes,"select"),a=B(this.attributes,"placeholder");this.select.attr({width:e,height:n,...s,fill:"#fff",strokeWidth:i?1:0});const o=this.dropdownPadding;r&&G(this.select).maybeAppend(".dropdown-icon","path").style("d","M-5,-3.5 L0,3.5 L5,-3.5").style("transform","translate(".concat(e-10-o[1]-o[3],", ").concat(n/2,")")).style("lineWidth",1).style("stroke",this.select.style.stroke);const l=null===(t=this.style.options)||void 0===t?void 0:t.find((t=>t.value===this.currentValue)),c={x:o[3],...a};G(this.select).selectAll(".placeholder").data(l?[]:[1]).join((t=>t.append("text").attr("className","placeholder").styles(c).style("y",(function(){const t=this.getBBox();return(n-t.height)/2}))),(t=>t.styles(c)),(t=>t.remove()));const u=B(this.attributes,"optionLabel"),h={x:o[3],...u};G(this.select).selectAll(".value").data(l?[l]:[]).join((t=>t.append((t=>On(t.label))).attr("className","value").styles(h).style("y",(function(){const t=this.getBBox();return(n-t.height)/2}))),(t=>t.styles(h)),(t=>t.remove()))}renderDropdown(){var e;const{width:n,height:i,options:r,onSelect:s,open:o}=this.style,l=B(this.attributes,"dropdown"),c=B(this.attributes,"option"),u=this.dropdownPadding;G(this.dropdown).maybeAppend(".dropdown-container","g").attr("className","dropdown-container").selectAll(".dropdown-item").data(r,(t=>t.value)).join((e=>e.append((e=>new Ss({className:"dropdown-item",style:{...e,...c,width:n-u[1]-u[3],selected:e.value===this.currentValue,onClick:(e,n,i)=>{this.setValue(e),null==s||s(e,n,i),this.dispatchEvent(new t.CustomEvent("change",{detail:{value:e,option:n,item:i}})),a(this.dropdown)}}}))).each((function(t,e){var n;const i=(null===(n=this.parentNode)||void 0===n?void 0:n.children).reduce(((t,n,i)=>(i<e&&(t+=n.getBBox().height),t)),0);this.attr("transform","translate(".concat(u[3],", ").concat(u[0]+i,")"))}))),(t=>t.update((t=>({selected:t.value===this.currentValue})))),(t=>t.remove()));const h=null===(e=this.dropdown.getElementsByClassName("dropdown-container"))||void 0===e||null===(e=e[0])||void 0===e?void 0:e.getBBox(),{spacing:d}=l;this.dropdown.attr({y:i+d,width:h.width+u[1]+u[3],height:h.height+u[0]+u[2],...l}),!o&&a(this.dropdown)}constructor(e){var n,i;super(y({},As.defaultOptions,e)),ks(this,"currentValue",null===(n=As.defaultOptions.style)||void 0===n?void 0:n.defaultValue),ks(this,"isPointerInSelect",!1),ks(this,"select",this.appendChild(new t.Rect({className:"select",style:{cursor:"pointer",width:0,height:0}}))),ks(this,"dropdown",this.appendChild(new t.Rect({className:"dropdown"})));const{defaultValue:r}=this.style;r&&null!==(i=this.style.options)&&void 0!==i&&i.some((t=>t.value===r))&&(this.currentValue=r)}render(){this.renderSelect(),this.renderDropdown()}bindEvents(){var t;this.addEventListener("click",(t=>{t.stopPropagation()})),this.select.addEventListener("click",(()=>{"visible"===this.dropdown.style.visibility?a(this.dropdown):s(this.dropdown)})),this.addEventListener("pointerenter",(()=>{this.isPointerInSelect=!0})),this.addEventListener("pointerleave",(()=>{this.isPointerInSelect=!1})),null===(t=document)||void 0===t||t.addEventListener("click",(()=>{this.isPointerInSelect||a(this.dropdown)}))}}ks(As,"defaultOptions",{style:{width:140,height:32,options:[],bordered:!0,defaultValue:"",selectRadius:8,selectStroke:"#d9d9d9",showDropdownIcon:!0,placeholderText:"请选择",placeholderFontSize:12,placeholderTextBaseline:"top",placeholderFill:"#c2c2c2",dropdownFill:"#fff",dropdownStroke:"#d9d9d9",dropdownRadius:8,dropdownShadowBlur:4,dropdownShadowColor:"rgba(0, 0, 0, 0.08)",dropdownPadding:8,dropdownSpacing:10,optionPadding:[8,12],optionFontSize:12,optionTextBaseline:"top",optionBackgroundFill:"#fff",optionBackgroundRadius:4,optionLabelFontSize:12,optionLabelTextBaseline:"top"}});const Ls=["year","month","day","hour","minute","second"],Ps=["YYYY","MM","DD","hh","mm","ss"];function Es(t){return t instanceof Date?t:new Date(t)}function Bs(t){let[e,n]=t;const i=Ls.indexOf(e),r=Ls.indexOf(n);let s="";for(let t=i;t<=r;t+=1)if(s+=Ps[t],t<r){let e="-";2===t?e=" ":t>2&&(e=":"),s+=e}return s}function Cs(t,e){const n={YYYY:t.getFullYear(),MM:t.getMonth()+1,DD:t.getDate(),HH:t.getHours(),mm:t.getMinutes(),ss:t.getSeconds()};let i=e;return Object.keys(n).forEach((t=>{const e=n[t];i=i.replace(t,"YYYY"===t?"".concat(e):"".concat(e).padStart(2,"0"))})),i}function Ms(t,e){return Es(t).getTime()-Es(e).getTime()}function Os(t,e){const[n,i]=[Es(t),Es(e)];return n.getFullYear()!==i.getFullYear()?"year":n.getMonth()!==i.getMonth()?"month":n.getDay()!==i.getDay()?"day":n.getHours()!==i.getHours()?"hour":n.getMinutes()!==i.getMinutes()?"minute":"second"}function Ts(t,e){const n=new Date(t);return{year:t=>{t.setMonth(0),t.setHours(0,0,0,0)},month:t=>{t.setDate(1),t.setHours(0,0,0,0)},day:t=>t.setHours(0,0,0,0),hour:t=>t.setMinutes(0,0,0),minute:t=>t.setSeconds(0,0),second:t=>t.setMilliseconds(0)}[e](n),Cs(n,Bs(["year",e]))}function js(t,e,n){return e=function(t){var e=function(t,e){if("object"!=typeof t||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var i=n.call(t,"string");if("object"!=typeof i)return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==typeof e?e:String(e)}(e),e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}class Ns extends x{get label(){return"BaseIcon"}get lineWidth(){return Math.log10(this.attributes.size)}get padding(){return T(this.attributes.size/5)}get iconSize(){const{size:t}=this.attributes,[e,n,i,r]=this.padding;return Math.max(t-Math.max(r+n,e+i),2*this.lineWidth+1)}renderBackground(){const{size:t}=this.attributes,e=t/2,n=B(this.attributes,"background");this.background.attr({x:-e,y:-e,width:t,height:t,...n})}showIndicator(){if(!this.label)return;const{size:t}=this.attributes,{x:e,y:n}=this.background.getBBox();this.indicator.update({x:e+t/2,y:n-5,labelText:this.label,visibility:"visible"})}hideIndicator(){this.indicator.update({visibility:"hidden"})}constructor(e){super(y({},{style:{backgroundOpacity:Ns.backgroundOpacities.default}},Ns.defaultOptions,e)),js(this,"showBackground",!0),js(this,"indicator",void 0),js(this,"background",this.appendChild(new t.Rect({}))),js(this,"icon",this.appendChild(new t.Group({})))}connectedCallback(){var t;super.connectedCallback();const{size:e}=this.attributes,{x:n,y:i}=this.background.getBBox(),r=null===(t=this.ownerDocument)||void 0===t?void 0:t.defaultView;r&&(this.indicator=r.appendChild(new $i({style:{x:n+e/2,y:i-e/2,visibility:"hidden",position:"top",radius:3,zIndex:100}})))}disconnectedCallback(){this.indicator.destroy()}render(){this.renderIcon(),this.showBackground&&this.renderBackground()}bindEvents(){const{onClick:t}=this.attributes;if(this.addEventListener("click",(()=>{null==t||t(this)})),this.showBackground){const t=()=>this.background.attr({opacity:Ns.backgroundOpacities.default}),e=()=>this.background.attr({opacity:Ns.backgroundOpacities.hover}),n=()=>this.background.attr({opacity:Ns.backgroundOpacities.active});this.addEventListener("pointerenter",(()=>{e(),this.showIndicator()})),this.addEventListener("pointerleave",(()=>{t(),this.hideIndicator()})),this.addEventListener("pointerdown",(()=>{n()})),this.addEventListener("pointerup",(()=>{t()}))}}}js(Ns,"tag","IconBase"),js(Ns,"defaultOptions",{style:{x:0,y:0,size:10,color:"#565758",backgroundRadius:4,backgroundFill:"#e2e2e2"}}),js(Ns,"backgroundOpacities",{default:0,hover:.8,active:1});const _s=function(e){let n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"#565758";return new t.Path({style:{fill:n,anchor:"0.5 0.5",path:"M ".concat(e,",").concat(e," L -").concat(e,",0 L ").concat(e,",-").concat(e," Z"),transformOrigin:"center"}})};class zs extends Ns{get label(){return"播放"}renderIcon(){const{color:t}=this.attributes,e=this.iconSize,n=e/3*3**.5*.8,i=[[n,0],[-n/2,-e/2*.8],[-n/2,e/2*.8],[n,0]];G(this.icon).maybeAppend(".play","polygon").styles({points:i,fill:t})}}class Is extends Ns{get label(){return"暂停"}renderIcon(){const{color:t}=this.attributes,e=this.iconSize,n=e/3,i=[[-n,-e/2],[-n,e/2],[-n/2,e/2],[-n/2,-e/2],[-n,-e/2],[n/2,-e/2],[n/2,e/2],[n,e/2],[n,-e/2]];G(this.icon).maybeAppend(".pause","polygon").styles({points:i,fill:t})}}class Fs extends Ns{get label(){return"范围时间"}renderIcon(){const{color:t}=this.attributes,{iconSize:e,lineWidth:n}=this,i=n;G(this.icon).maybeAppend(".left-line","line").styles({x1:-e/2,y1:-e/2,x2:-e/2,y2:e/2,stroke:t,lineWidth:n}),G(this.icon).maybeAppend(".right-line","line").styles({x1:e/2,y1:-e/2,x2:e/2,y2:e/2,stroke:t,lineWidth:n}),G(this.icon).maybeAppend(".left-arrow","line").styles({x1:0,y1:0,x2:-e/2+2*i,y2:0,stroke:t,lineWidth:n,markerEnd:_s(2*n,t)}),G(this.icon).maybeAppend(".right-arrow","line").styles({x1:0,y1:0,x2:e/2-2*i,y2:0,stroke:t,lineWidth:n,markerEnd:_s(2*n,t)})}}class Gs extends Ns{get label(){return"单一时间"}renderIcon(){const{color:t}=this.attributes,{iconSize:e,lineWidth:n}=this;G(this.icon).maybeAppend(".line","line").styles({x1:0,y1:-e/2,x2:0,y2:e/2,stroke:t,lineWidth:n});const i=n;G(this.icon).maybeAppend(".left-arrow","line").styles({x1:-e/2-2*i,y1:0,x2:2*-i,y2:0,stroke:t,lineWidth:n,markerEnd:_s(2*n,t)}),G(this.icon).maybeAppend(".right-arrow","line").styles({x1:e/2+2*i,y1:0,x2:2*i,y2:0,stroke:t,lineWidth:n,markerEnd:_s(2*n,t)})}}const Hs=t=>[[-t/2,-t/2],[-t/2,t/2],[t/2,t/2]];class Vs extends Ns{get label(){return"折线图"}renderIcon(){const{color:t}=this.attributes,{iconSize:e,lineWidth:n}=this,i=n,r=(e-2*i-n)/4,s=(e-2*i-n)/2,[a,o]=[-e/2+i,e/2-2*i];G(this.icon).maybeAppend(".coordinate","polyline").styles({points:Hs(e),stroke:t,lineWidth:n}),G(this.icon).maybeAppend(".line","polyline").styles({points:[[a,o],[a+r,o-s],[a+2*r,o],[a+4*r,o-2*s]],stroke:t,lineWidth:n})}}class Ws extends Ns{get label(){return"条形图"}get data(){return[1,4,2,4,3]}renderIcon(){const{data:t}=this,{color:e}=this.attributes,{iconSize:n,lineWidth:i}=this,r=i,s=(n-r)/t.length,a=(n-2*r)/4,[o,l]=[-n/2+2*r,n/2-r];G(this.icon).maybeAppend(".coordinate","polyline").styles({points:Hs(n),stroke:e,lineWidth:i}),G(this.icon).maybeAppend(".bars","g").selectAll(".column").data(this.data.map(((t,e)=>({value:t,index:e})))).join((t=>t.append("line").attr("className","column").style("x1",(t=>{let{index:e}=t;return o+s*e})).style("y1",l).style("x2",(t=>{let{index:e}=t;return o+s*e})).style("y2",(t=>{let{value:e}=t;return l-a*e})).styles({y1:l,stroke:e,lineWidth:i})))}}class Ds extends Ns{constructor(){super(...arguments),js(this,"showBackground",!1)}get padding(){return T(0)}renderIcon(){const{iconSize:t}=this,{speed:e=1}=this.attributes,n=function(t,e){return function(t,e,n){if(!g(t)&&!f(t))return t;var i=n;return dt(t,(function(t,n){i=e(i,t,n)})),i}(t,(function(t,n,i){return e.includes(i)||(t[i]=n),t}),{})}(this.attributes,["x","y","width","height","size","color","speed"]),i=de(t,20,1/0),r={...n,x:-i/2,y:-10,width:i,height:20,defaultValue:e,bordered:!1,showDropdownIcon:!1,selectRadius:2,dropdownPadding:this.padding,dropdownRadius:2,dropdownSpacing:t/5,placeholderFontSize:t/2,optionPadding:0,optionLabelFontSize:t/2,optionBackgroundRadius:1,options:[{label:"1x",value:1},{label:"1.5x",value:1.5},{label:"2x",value:2}]};G(this.icon).maybeAppend(".speed",(()=>new As({style:r}))).attr("className","speed").each((function(){this.update(r)}))}}js(Ds,"tag","SpeedSelect");class Rs extends x{getType(){return this.currentType}constructor(e){super(e),js(this,"icon",this.appendChild(new t.Group({}))),js(this,"currentType",void 0),this.currentType=this.attributes.type}render(){const{x:t,y:e,onChange:n,...i}=this.attributes;G(this.icon).selectAll(".icon").data([this.currentType]).join((t=>t.append((t=>{var e;const n=null===(e=this.toggles.find((e=>{let[n]=e;return n===t})))||void 0===e?void 0:e[1];if(!n)throw new Error("Invalid type: ".concat(t));return new n({})})).attr("className","icon").styles(i,!1).update({})),(t=>t.styles({restStyles:i}).update({})),(t=>t.remove()))}bindEvents(){const{onChange:t}=this.attributes;this.addEventListener("click",(e=>{e.preventDefault(),e.stopPropagation();const n=(this.toggles.findIndex((t=>{let[e]=t;return e===this.currentType}))+1)%this.toggles.length,i=this.toggles[n][0];null==t||t(this.currentType),this.currentType=i,this.render()}))}}js(Rs,"tag","ToggleIcon");class Ys extends Rs{constructor(t){super(y({},{style:{type:"play"}},t)),js(this,"toggles",[["play",zs],["pause",Is]])}}class qs extends Rs{constructor(t){super(y({},{style:{type:"range"}},t)),js(this,"toggles",[["range",Fs],["value",Gs]])}}class Ks extends Rs{constructor(t){super(y({},{style:{type:"column"}},t)),js(this,"toggles",[["line",Vs],["column",Ws]])}}function Zs(t,e,n){return e=function(t){var e=function(t,e){if("object"!=typeof t||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var i=n.call(t,"string");if("object"!=typeof i)return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==typeof e?e:String(e)}(e),e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}const Us={reset:class extends Ns{arcPath(t,e,n){const[i,r]=[n,n],s=i=>[t+n*Math.cos(i),e+n*Math.sin(i)],[a,o]=s(-5/4*Math.PI),[l,c]=s(1/4*Math.PI);return"M".concat(a,",").concat(o,",A").concat(i,",").concat(r,",0,1,1,").concat(l,",").concat(c)}get label(){return"重置"}renderIcon(){const{color:t}=this.attributes,e=this.iconSize,{lineWidth:n}=this,i=n+.5;G(this.icon).maybeAppend(".reset","path").styles({stroke:t,lineWidth:n,path:this.arcPath(0,0,e/2-n),markerStart:_s(i,t)})}},speed:Ds,backward:class extends Ns{get label(){return"快退"}renderIcon(){const{color:t}=this.attributes,e=this.iconSize,n=e/2,i=e/2/3**.5,r=[[0,0],[0,-i],[-n,0],[0,i],[0,0],[n,-i],[n,i],[0,0]];G(this.icon).maybeAppend(".backward","polygon").styles({points:r,fill:t})}},playPause:Ys,forward:class extends Ns{get label(){return"快进"}renderIcon(){const{color:t}=this.attributes,e=this.iconSize,n=e/2,i=e/2/3**.5,r=[[0,0],[0,-i],[n,0],[0,i],[0,0],[-n,-i],[-n,i],[0,0]];G(this.icon).maybeAppend(".forward","polygon").styles({points:r,fill:t})}},selectionType:qs,chartType:Ks,split:class extends Ns{constructor(t){super(y({},{style:{color:"#d8d9d9"}},t)),js(this,"showBackground",!1)}renderIcon(){const{color:t}=this.attributes,{iconSize:e,lineWidth:n}=this;G(this.icon).maybeAppend(".split","line").styles({x1:0,y1:-e/2,x2:0,y2:e/2,stroke:t,lineWidth:n})}}};class $s extends x{get padding(){return T(this.attributes.padding)}renderBackground(){const{width:t,height:e}=this.style,n=B(this.attributes,"background");this.background.attr({width:t,height:e,...n})}renderFunctions(){var t;const{functions:e,iconSize:n,iconSpacing:i,width:r,height:s,align:a}=this.attributes,{padding:[,o,,l]}=this,c=e.reduce(((t,e)=>t.length&&e.length?t.concat("split",...e):t.concat(...e)),[]),u=c.length*(n+i)-i,h={left:l+n/2,center:(r-u)/2+n/2,right:r-u-l-o+n/2}[a]||0;null===(t=this.speedSelect)||void 0===t||t.destroy(),this.functions.removeChildren(),c.forEach(((t,e)=>{const r=Us[t],a={x:e*(n+i)+h,y:s/2,size:n};if(r===Ds?(a.speed=this.attributes.speed,a.onSelect=e=>this.handleFunctionChange(t,{value:e})):[Ys,qs,Ks].includes(r)?(a.onChange=e=>this.handleFunctionChange(t,{value:e}),r===Ys&&(a.type="play"===this.attributes.state?"pause":"play"),r===qs&&(a.type="range"===this.attributes.selectionType?"value":"range"),r===Ks&&(a.type="line"===this.attributes.chartType?"column":"line")):a.onClick=()=>this.handleFunctionChange(t,{value:t}),r===Ds){var o;const{x:t,y:e}=this.getBBox(),{x:n,y:i}=a,s=null===(o=this.ownerDocument)||void 0===o?void 0:o.defaultView;s&&(this.speedSelect=new r({style:{...a,zIndex:100,x:t+n,y:e+i}}),s.appendChild(this.speedSelect))}else this.functions.appendChild(new r({style:a}))}))}constructor(e){super(y({},$s.defaultOptions,e)),Zs(this,"background",this.appendChild(new t.Rect({}))),Zs(this,"functions",this.appendChild(new t.Group({}))),Zs(this,"speedSelect",void 0)}disconnectedCallback(){var t;super.disconnectedCallback(),null===(t=this.speedSelect)||void 0===t||t.destroy()}render(){this.renderBackground(),this.renderFunctions()}handleFunctionChange(t,e){const{onChange:n}=this.attributes;null==n||n(t,e)}}function Xs(t,e,n){return e=function(t){var e=function(t,e){if("object"!=typeof t||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var i=n.call(t,"string");if("object"!=typeof i)return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==typeof e?e:String(e)}(e),e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}Zs($s,"defaultOptions",{style:{width:300,height:40,padding:0,align:"center",iconSize:25,iconSpacing:0,speed:1,state:"pause",chartType:"line",selectionType:"range",backgroundFill:"#fbfdff",backgroundStroke:"#ebedf0",functions:[["reset","speed"],["backward","playPause","forward"],["selectionType","chartType"]]}});class Js extends t.Circle{constructor(t){super(y({},Js.defaultOptions,t)),this.bindEvents()}bindEvents(){this.addEventListener("mouseenter",(()=>{this.attr("lineWidth",Math.ceil(+(this.style.r||0)/2))})),this.addEventListener("mouseleave",(()=>{this.attr("lineWidth",0)}))}}Xs(Js,"defaultOptions",{style:{r:5,fill:"#3f7cf7",lineWidth:0,stroke:"#3f7cf7",strokeOpacity:.5,cursor:"pointer"}});class Qs extends x{renderBackground(){const{width:t,height:e}=this.attributes,n=B(this.attributes,"background");G(this).maybeAppend("background","rect").attr("className","background").styles({x:-t/2,y:-e/2,width:t,height:e,...n})}renderIcon(){const{iconSize:t}=this.attributes,e=B(this.attributes,"icon"),n=t/2;G(this).maybeAppend("icon-left-line","line").attr("className","icon-left-line").styles({x1:-1,y1:-n,x2:-1,y2:n,...e}),G(this).maybeAppend("icon-right-line","line").attr("className","icon-right-line").styles({x1:1,y1:-n,x2:1,y2:n,...e})}renderBorder(){const{width:t,height:e,type:n}=this.attributes,i=B(this.attributes,"border"),r="start"===n?+t/2:-t/2;G(this).maybeAppend("border","line").attr("className","border").styles({x1:r,y1:-e/2,x2:r,y2:+e/2,...i})}render(){this.renderBackground(),this.renderIcon(),this.renderBorder()}constructor(t){super(y({},Qs.defaultOptions,t))}}function ta(t){const e=String(Math.floor(t/3600)).padStart(2,"0"),n=String(Math.floor(t%3600/60)).padStart(2,"0"),i=String(Math.floor(t%60)).padStart(2,"0");return t<3600?"".concat(n,":").concat(i):"".concat(e,":").concat(n,":").concat(i)}function ea(t,e,n){return e=function(t){var e=function(t,e){if("object"!=typeof t||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var i=n.call(t,"string");if("object"!=typeof i)return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==typeof e?e:String(e)}(e),e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}Xs(Qs,"defaultOptions",{style:{width:10,height:50,iconSize:10,type:"start",backgroundFill:"#fff",backgroundFillOpacity:.5,iconStroke:"#9a9a9a",iconLineWidth:1,borderStroke:"#e8e8e8",borderLineWidth:1}});class na extends x{get data(){const{data:t}=this.attributes;return t.sort(((t,e)=>t.time<e.time?-1:t.time>e.time?1:0))}get space(){const{width:t,height:e,type:n,controllerHeight:i}=this.attributes,r=de(+e-i,0,+e),s=new Ii(0,+e-i,+t,i);let a,o=0;"chart"===n?(o=35,a=new Ii(0,r-o,+t,o)):a=new Ii;const l="time"===n?10:r;return{axisBBox:a,controllerBBox:s,timelineBBox:new Ii(0,"time"===n?r:r-l,+t,l-o)}}setBySliderValues(t){var e,n;const{data:i}=this,[r,s]=Array.isArray(t)?t:[0,t],a=i.length,o=i[Math.floor(r*a)],l=i[Math.ceil(s*a)-(Array.isArray(t)?0:1)];this.states.values=[null!==(e=null==o?void 0:o.time)&&void 0!==e?e:i[0].time,null!==(n=null==l?void 0:l.time)&&void 0!==n?n:1/0]}setByTimebarValues(t){var e,n,i;const{data:r}=this,[s,a]=Array.isArray(t)?t:[void 0,t],o=r.find((t=>{let{time:e}=t;return e===s})),l=r.find((t=>{let{time:e}=t;return e===a}));this.states.values=[null!==(e=null==o?void 0:o.time)&&void 0!==e?e:null===(n=r[0])||void 0===n?void 0:n.time,null!==(i=null==l?void 0:l.time)&&void 0!==i?i:1/0]}setByIndex(t){var e,n,i,r;const{data:s}=this,[a,o]=t;this.states.values=[null!==(e=null===(n=s[a])||void 0===n?void 0:n.time)&&void 0!==e?e:s[0].time,null!==(i=null===(r=this.data[o])||void 0===r?void 0:r.time)&&void 0!==i?i:1/0]}get sliderValues(){const{values:t,selectionType:e}=this.states,[n,i]=Array.isArray(t)?t:[void 0,t],{data:r}=this,s=r.length,a="value"===e;return[(()=>{const t=r.findIndex((t=>{let{time:e}=t;return e===n}));return a?0:t>-1?t/s:0})(),(()=>{if(i===1/0)return 1;const t=r.findIndex((t=>{let{time:e}=t;return e===i}));return t>-1?t/s:a?.5:1})()]}get values(){const{values:t,selectionType:e}=this.states,[n,i]=Array.isArray(t)?t:[this.data[0].time,t];return"value"===e?i:[n,i]}getDatumByRatio(t){const{data:e}=this,n=e.length;return e[Math.floor(t*(n-1))]}get chartHandleIconShape(){const{selectionType:e}=this.states,{timelineBBox:{height:n}}=this.space;return"range"===e?t=>new Qs({style:{type:t,height:n,iconSize:n/6}}):()=>new t.Line({style:{x1:0,y1:-n/2,x2:0,y2:n/2,lineWidth:2,stroke:"#c8c8c8"}})}getChartStyle(t){const{x:e,y:n,width:i,height:r}=t,{selectionType:s,chartType:a}=this.states,{data:o}=this,{type:l,labelFormatter:c}=this.attributes,{type:u,...h}=B(this.attributes,"chart"),d="range"===s;if("time"===l)return{handleIconShape:()=>new Js({}),selectionFill:"#2e7ff8",selectionFillOpacity:1,showLabelOnInteraction:!0,handleLabelDy:d?-15:0,autoFitLabel:d,handleSpacing:d?-15:0,trackFill:"#edeeef",trackLength:i,trackOpacity:.5,trackRadius:r/2,trackSize:r/2,type:s,values:this.sliderValues,formatter:t=>{if(c)return c(t);const e=this.getDatumByRatio(t).time;return"number"==typeof e?ta(e):Cs(e,"YYYY-MM-DD HH:mm:ss")},x:e,y:n,zIndex:1,...h};const p="range"===s?5:0,f=o.map((t=>{let{value:e}=t;return e}));return{handleIconOffset:p,handleIconShape:this.chartHandleIconShape,selectionFill:"#fff",selectionFillOpacity:.5,selectionType:"invert",sparklineSpacing:.1,sparklineColumnLineWidth:0,sparklineColor:"#d4e5fd",sparklineAreaOpacity:1,sparklineAreaLineWidth:0,sparklineData:f,sparklineType:a,sparklineScale:.8,trackLength:i,trackSize:r,type:s,values:this.sliderValues,x:e,y:n,zIndex:1,...h}}renderChart(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.space.timelineBBox;this.timeline.update(this.getChartStyle(t))}updateSelection(){this.timeline.setValues(this.sliderValues,!0),this.handleSliderChange(this.sliderValues)}getAxisStyle(t){const{data:e}=this,{interval:n,labelFormatter:i}=this.attributes,r=B(this.attributes,"axis"),{x:s,y:a,width:o}=t,l=[...e,{time:0}].map(((t,e,n)=>{let{time:i}=t;return{label:"".concat(i),value:e/(n.length-1),time:i}}));return{startPos:[s,a],endPos:[s+o,a],data:l,labelFilter:(t,e)=>e<l.length-1,labelFormatter:t=>{let{time:e}=t;return i?i(e):function(t,e){return"number"==typeof t?ta(t):function(t,e){const n=new Date(t);switch(e){case"half-hour":case"hour":case"four-hour":return[0,6,12,18].includes(n.getHours())&&0===n.getMinutes()?Cs(n,"HH:mm\nYYYY-MM-DD"):Cs(n,"HH:mm");case"half-day":return n.getHours()<12?"AM\n".concat(Cs(n,"YYYY-MM-DD")):"PM";case"day":return[1,10,20].includes(n.getDate())?Cs(n,"DD\nYYYY-MM"):Cs(n,"DD");case"week":return n.getDate()<=7?Cs(n,"DD\nYYYY-MM"):Cs(n,"DD");case"month":return[0,6].includes(n.getMonth())?Cs(n,"MM月\nYYYY"):Cs(n,"MM月");case"season":return[0].includes(n.getMonth())?Cs(n,"MM月\nYYYY"):Cs(n,"MM月");case"year":return Cs(n,"YYYY");default:return Cs(n,"YYYY-MM-DD HH:mm")}}(t,e)}(e,n)},...r}}renderAxis(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.space.axisBBox;const{type:e}=this.attributes;"chart"===e&&this.axis.update(this.getAxisStyle(t))}renderController(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.space.controllerBBox;const{type:e}=this.attributes,{state:n,speed:i,selectionType:r,chartType:s}=this.states,a=B(this.attributes,"controller"),o=this,l={...t,iconSize:20,speed:i,state:n,selectionType:r,chartType:s,onChange(t,e){let{value:n}=e;switch(t){case"reset":o.internalReset();break;case"speed":o.handleSpeedChange(n);break;case"backward":o.internalBackward();break;case"playPause":"play"===n?o.internalPlay():o.internalPause();break;case"forward":o.internalForward();break;case"selectionType":o.handleSelectionTypeChange(n);break;case"chartType":o.handleChartTypeChange(n)}},...a};"time"===e&&(l.functions=[["reset","speed"],["backward","playPause","forward"],["selectionType"]]),this.controller.update(l)}dispatchOnChange(t){const{data:e}=this,{onChange:n}=this.attributes,{values:i,selectionType:r}=this.states,[s,a]=i,o=a===1/0?e.at(-1).time:a;t&&((t,e)=>{if(Array.isArray(t)){if(!Array.isArray(e))return!1;if(t[0]===e[0]){if(t[1]===e[1])return!0;if(t[1]===1/0||e[1]===1/0)return!0}return!1}return!Array.isArray(e)&&t===e})(t,"range"===r?[s,o]:o)||null==n||n("range"===r?[s,o]:o)}internalReset(t){const{selectionType:e}=this.states;var n,i;this.internalPause(),this.setBySliderValues("range"===e?[0,1]:[0,0]),this.renderController(),this.updateSelection(),t||(null===(n=this.attributes)||void 0===n||null===(i=n.onReset)||void 0===i||i.call(n),this.dispatchOnChange())}reset(){this.internalReset()}moveSelection(t,e){const{data:n}=this,i=n.length,{values:r,selectionType:s,playMode:a}=this.states,[o,l]=r,c=n.findIndex((t=>{let{time:e}=t;return e===o}));let u=n.findIndex((t=>{let{time:e}=t;return e===l}));-1===u&&(u=i);const h="backward"===t?-1:1;let d;"range"===s?"acc"===a?(d=[c,u+h],-1===h&&c===u&&(d=[c,i])):d=[c+h,u+h]:d=[c,u+h];const p=(t=>{const[e,n]=t.sort(((t,e)=>t-e)),r=t=>de(t,0,i);return n>i?"value"===s?[0,0]:"acc"===a?[r(e),r(e)]:[0,r(n-e)]:e<0?"acc"===a?[0,r(n)]:[r(e+i-n),i]:[r(e),r(n)]})(d);return this.setByIndex(p),this.updateSelection(),p}internalBackward(t){const e=this.moveSelection("backward",t);var n,i;return t||(null===(n=this.attributes)||void 0===n||null===(i=n.onBackward)||void 0===i||i.call(n),this.dispatchOnChange()),e}backward(){this.internalBackward()}internalPlay(t){var e,n;const{data:i}=this,{loop:r}=this.attributes,{speed:s=1}=this.states;this.playInterval=window.setInterval((()=>{this.internalForward()[1]!==i.length||r||(this.internalPause(),this.renderController())}),1e3/s),this.states.state="play",!t&&(null===(e=this.attributes)||void 0===e||null===(n=e.onPlay)||void 0===n||n.call(e))}play(){this.internalPlay()}internalPause(t){var e,n;clearInterval(this.playInterval),this.states.state="pause",!t&&(null===(e=this.attributes)||void 0===e||null===(n=e.onPause)||void 0===n||n.call(e))}pause(){this.internalPause()}internalForward(t){const e=this.moveSelection("forward",t);var n,i;return t||(null===(n=this.attributes)||void 0===n||null===(i=n.onForward)||void 0===i||i.call(n),this.dispatchOnChange()),e}forward(){this.internalForward()}handleSpeedChange(t){var e,n;this.states.speed=t;const{state:i}=this.states;"play"===i&&(this.internalPause(!0),this.internalPlay(!0)),null===(e=this.attributes)||void 0===e||null===(n=e.onSpeedChange)||void 0===n||n.call(e,t)}handleSelectionTypeChange(t){var e,n;this.states.selectionType=t,this.renderChart(),null===(e=this.attributes)||void 0===e||null===(n=e.onSelectionTypeChange)||void 0===n||n.call(e,t)}handleChartTypeChange(t){var e,n;this.states.chartType=t,this.renderChart(),null===(e=this.attributes)||void 0===e||null===(n=e.onChartTypeChange)||void 0===n||n.call(e,t)}constructor(t){super(y({},na.defaultOptions,t)),ea(this,"axis",this.appendChild(new Yi({style:{type:"linear",startPos:[0,0],endPos:[0,0],data:[],showArrow:!1,animate:!1}}))),ea(this,"timeline",this.appendChild(new on({style:{onChange:t=>{this.handleSliderChange(t)}}}))),ea(this,"controller",this.appendChild(new $s({}))),ea(this,"states",{}),ea(this,"playInterval",void 0),ea(this,"handleSliderChange",(t=>{const e=(()=>{const t=this.states.values;return Array.isArray(t)?[...t]:t})();this.setBySliderValues(t),this.dispatchOnChange(e)}));const{selectionType:e,chartType:n,speed:i,state:r,playMode:s,values:a}=this.attributes;this.states={chartType:n,playMode:s,selectionType:e,speed:i,state:r},this.setByTimebarValues(a)}render(){const{axisBBox:t,controllerBBox:e,timelineBBox:n}=this.space;this.renderController(e),this.renderAxis(t),this.renderChart(n),"play"===this.states.state&&this.internalPlay()}destroy(){super.destroy(),this.internalPause(!0)}}function ia(t){const e=document.createElement("div");return e.innerHTML=t,e.firstChild}function ra(t){return"string"==typeof t?ia(t):t}ea(na,"defaultOptions",{style:{axisLabelFill:"#6e6e6e",axisLabelTextAlign:"left",axisLabelTextBaseline:"top",axisLabelTransform:"translate(5, -12)",axisLineLineWidth:1,axisLineStroke:"#cacdd1",axisTickLength:15,axisTickLineWidth:1,axisTickStroke:"#cacdd1",chartShowLabel:!1,chartType:"line",controllerAlign:"center",controllerHeight:40,data:[],interval:"day",loop:!1,playMode:"acc",selectionType:"range",type:"time"}});var sa=i(271),aa=i.n(sa);function oa(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1024,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1014;return(i,r,s)=>aa()(t).map((t=>{const a=[];return a.push(!0===t.relative?t.code.toLowerCase():t.code.toUpperCase()),[[t.x1,t.y1],[t.x2,t.y2],[t.x,t.y]].forEach((o=>{const[l,c]=o;void 0!==l&&a.push(!0===t.relative?l/e*2*s:i-s+2*s*(l/e)),void 0!==c&&a.push(!0===t.relative?c/n*2*s:r-s+2*s*(c/n))})),a}))}function la(t){const e=/<path\s+d="(.*?)"/i.exec(t),n=/viewBox="\d+\s+\d+\s+(\d+)\s+(\d+)"/i.exec(t);if(null===e||e.length<2)return()=>[];let i=1024,r=1024;return null!==n&&n.length>=3&&(Number.isNaN(parseInt(n[1],10))||(i=parseInt(n[1],10)),Number.isNaN(parseInt(n[2],10))||(r=parseInt(n[2],10))),oa(e[1],i,r)}function ca(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return(n,i,r)=>{const s=r.value;let a;"function"==typeof s&&(r.value=function(){for(var n=arguments.length,i=new Array(n),r=0;r<n;r++)i[r]=arguments[r];if(a)return;const o=this;e&&s.apply(o,i),a=window.setTimeout((()=>{s.apply(o,i),a=null}),t)})}}function ua(t){const e=localStorage.getItem("__debug__");return(n,i,r)=>{const s="[".concat(i,"] ").concat(t),a=r.value;"function"==typeof a&&(r.value=function(){e&&console.time(s);for(var t=arguments.length,n=new Array(t),i=0;i<t;i++)n[i]=arguments[i];a.apply(this,n),e&&console.timeEnd(s)})}}t.runtime.enableCSSParsing=!1})(),r})()));
|
|
1
|
+
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e(require("@antv/g")):"function"==typeof define&&define.amd?define(["@antv/g"],e):"object"==typeof exports?exports.Component=e(require("@antv/g")):t.Component=e(t.G)}(self,(t=>(()=>{var e={105:t=>{"use strict";t.exports={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]}},694:(t,e,n)=>{var i=n(105),r=n(486),s=Object.hasOwnProperty,a=Object.create(null);for(var o in i)s.call(i,o)&&(a[i[o]]=o);var l=t.exports={to:{},get:{}};function c(t,e,n){return Math.min(Math.max(e,t),n)}function u(t){var e=Math.round(t).toString(16).toUpperCase();return e.length<2?"0"+e:e}l.get=function(t){var e,n;switch(t.substring(0,3).toLowerCase()){case"hsl":e=l.get.hsl(t),n="hsl";break;case"hwb":e=l.get.hwb(t),n="hwb";break;default:e=l.get.rgb(t),n="rgb"}return e?{model:n,value:e}:null},l.get.rgb=function(t){if(!t)return null;var e,n,r,a=[0,0,0,1];if(e=t.match(/^#([a-f0-9]{6})([a-f0-9]{2})?$/i)){for(r=e[2],e=e[1],n=0;n<3;n++){var o=2*n;a[n]=parseInt(e.slice(o,o+2),16)}r&&(a[3]=parseInt(r,16)/255)}else if(e=t.match(/^#([a-f0-9]{3,4})$/i)){for(r=(e=e[1])[3],n=0;n<3;n++)a[n]=parseInt(e[n]+e[n],16);r&&(a[3]=parseInt(r+r,16)/255)}else if(e=t.match(/^rgba?\(\s*([+-]?\d+)(?=[\s,])\s*(?:,\s*)?([+-]?\d+)(?=[\s,])\s*(?:,\s*)?([+-]?\d+)\s*(?:[,|\/]\s*([+-]?[\d\.]+)(%?)\s*)?\)$/)){for(n=0;n<3;n++)a[n]=parseInt(e[n+1],0);e[4]&&(e[5]?a[3]=.01*parseFloat(e[4]):a[3]=parseFloat(e[4]))}else{if(!(e=t.match(/^rgba?\(\s*([+-]?[\d\.]+)\%\s*,?\s*([+-]?[\d\.]+)\%\s*,?\s*([+-]?[\d\.]+)\%\s*(?:[,|\/]\s*([+-]?[\d\.]+)(%?)\s*)?\)$/)))return(e=t.match(/^(\w+)$/))?"transparent"===e[1]?[0,0,0,0]:s.call(i,e[1])?((a=i[e[1]])[3]=1,a):null:null;for(n=0;n<3;n++)a[n]=Math.round(2.55*parseFloat(e[n+1]));e[4]&&(e[5]?a[3]=.01*parseFloat(e[4]):a[3]=parseFloat(e[4]))}for(n=0;n<3;n++)a[n]=c(a[n],0,255);return a[3]=c(a[3],0,1),a},l.get.hsl=function(t){if(!t)return null;var e=t.match(/^hsla?\(\s*([+-]?(?:\d{0,3}\.)?\d+)(?:deg)?\s*,?\s*([+-]?[\d\.]+)%\s*,?\s*([+-]?[\d\.]+)%\s*(?:[,|\/]\s*([+-]?(?=\.\d|\d)(?:0|[1-9]\d*)?(?:\.\d*)?(?:[eE][+-]?\d+)?)\s*)?\)$/);if(e){var n=parseFloat(e[4]);return[(parseFloat(e[1])%360+360)%360,c(parseFloat(e[2]),0,100),c(parseFloat(e[3]),0,100),c(isNaN(n)?1:n,0,1)]}return null},l.get.hwb=function(t){if(!t)return null;var e=t.match(/^hwb\(\s*([+-]?\d{0,3}(?:\.\d+)?)(?:deg)?\s*,\s*([+-]?[\d\.]+)%\s*,\s*([+-]?[\d\.]+)%\s*(?:,\s*([+-]?(?=\.\d|\d)(?:0|[1-9]\d*)?(?:\.\d*)?(?:[eE][+-]?\d+)?)\s*)?\)$/);if(e){var n=parseFloat(e[4]);return[(parseFloat(e[1])%360+360)%360,c(parseFloat(e[2]),0,100),c(parseFloat(e[3]),0,100),c(isNaN(n)?1:n,0,1)]}return null},l.to.hex=function(){var t=r(arguments);return"#"+u(t[0])+u(t[1])+u(t[2])+(t[3]<1?u(Math.round(255*t[3])):"")},l.to.rgb=function(){var t=r(arguments);return t.length<4||1===t[3]?"rgb("+Math.round(t[0])+", "+Math.round(t[1])+", "+Math.round(t[2])+")":"rgba("+Math.round(t[0])+", "+Math.round(t[1])+", "+Math.round(t[2])+", "+t[3]+")"},l.to.rgb.percent=function(){var t=r(arguments),e=Math.round(t[0]/255*100),n=Math.round(t[1]/255*100),i=Math.round(t[2]/255*100);return t.length<4||1===t[3]?"rgb("+e+"%, "+n+"%, "+i+"%)":"rgba("+e+"%, "+n+"%, "+i+"%, "+t[3]+")"},l.to.hsl=function(){var t=r(arguments);return t.length<4||1===t[3]?"hsl("+t[0]+", "+t[1]+"%, "+t[2]+"%)":"hsla("+t[0]+", "+t[1]+"%, "+t[2]+"%, "+t[3]+")"},l.to.hwb=function(){var t=r(arguments),e="";return t.length>=4&&1!==t[3]&&(e=", "+t[3]),"hwb("+t[0]+", "+t[1]+"%, "+t[2]+"%"+e+")"},l.to.keyword=function(t){return a[t.slice(0,3)]}},628:t=>{t.exports=function(t){return!(!t||"string"==typeof t)&&(t instanceof Array||Array.isArray(t)||t.length>=0&&(t.splice instanceof Function||Object.getOwnPropertyDescriptor(t,t.length-1)&&"String"!==t.constructor.name))}},486:(t,e,n)=>{"use strict";var i=n(628),r=Array.prototype.concat,s=Array.prototype.slice,a=t.exports=function(t){for(var e=[],n=0,a=t.length;n<a;n++){var o=t[n];i(o)?e=r.call(e,s.call(o)):e.push(o)}return e};a.wrap=function(t){return function(){return t(a(arguments))}}},269:(t,e,n)=>{var i=n(42).parse;i.parseSVG=i,i.makeAbsolute=function(t){var e,n={x:0,y:0},i={x:"x0",y:"y0",x1:"x0",y1:"y0",x2:"x0",y2:"y0"};return t.forEach((function(t){for(var r in"moveto"===t.command&&(e=t),t.x0=n.x,t.y0=n.y,i)r in t&&(t[r]+=t.relative?t[i[r]]:0);"x"in t||(t.x=n.x),"y"in t||(t.y=n.y),t.relative=!1,t.code=t.code.toUpperCase(),"closepath"==t.command&&(t.x=e.x,t.y=e.y),n=t})),t},t.exports=i},42:t=>{"use strict";function e(t,n,i,r){this.message=t,this.expected=n,this.found=i,this.location=r,this.name="SyntaxError","function"==typeof Error.captureStackTrace&&Error.captureStackTrace(this,e)}!function(t,e){function n(){this.constructor=t}n.prototype=e.prototype,t.prototype=new n}(e,Error),e.buildMessage=function(t,e){var n={literal:function(t){return'"'+r(t.text)+'"'},class:function(t){var e,n="";for(e=0;e<t.parts.length;e++)n+=t.parts[e]instanceof Array?s(t.parts[e][0])+"-"+s(t.parts[e][1]):s(t.parts[e]);return"["+(t.inverted?"^":"")+n+"]"},any:function(t){return"any character"},end:function(t){return"end of input"},other:function(t){return t.description}};function i(t){return t.charCodeAt(0).toString(16).toUpperCase()}function r(t){return t.replace(/\\/g,"\\\\").replace(/"/g,'\\"').replace(/\0/g,"\\0").replace(/\t/g,"\\t").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/[\x00-\x0F]/g,(function(t){return"\\x0"+i(t)})).replace(/[\x10-\x1F\x7F-\x9F]/g,(function(t){return"\\x"+i(t)}))}function s(t){return t.replace(/\\/g,"\\\\").replace(/\]/g,"\\]").replace(/\^/g,"\\^").replace(/-/g,"\\-").replace(/\0/g,"\\0").replace(/\t/g,"\\t").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/[\x00-\x0F]/g,(function(t){return"\\x0"+i(t)})).replace(/[\x10-\x1F\x7F-\x9F]/g,(function(t){return"\\x"+i(t)}))}return"Expected "+function(t){var e,i,r,s=new Array(t.length);for(e=0;e<t.length;e++)s[e]=(r=t[e],n[r.type](r));if(s.sort(),s.length>0){for(e=1,i=1;e<s.length;e++)s[e-1]!==s[e]&&(s[i]=s[e],i++);s.length=i}switch(s.length){case 1:return s[0];case 2:return s[0]+" or "+s[1];default:return s.slice(0,-1).join(", ")+", or "+s[s.length-1]}}(t)+" but "+function(t){return t?'"'+r(t)+'"':"end of input"}(e)+" found."},t.exports={SyntaxError:e,parse:function(t,n){n=void 0!==n?n:{};var i,r={},s={svg_path:gt},a=gt,o=function(t){if(!t)return[];for(var e=[],n=0;n<t.length;n++)e=e.concat.apply(e,t[n]);var i=e[0];return i&&"m"==i.code&&(delete i.relative,i.code="M"),e},l=function(t,e){return function(t,e){if(!e)return[t];for(var n=[t],i=0,r=e.length;i<r;i++)n[i+1]=e[i][1];return n}(t,e)},c=/^[Mm]/,u=ht(["M","m"],!1,!1),h=function(t,e,n){var i=Ht(t,[e]);return n&&(i=i.concat(Ht("M"==t?"L":"l",n[1]))),i},d=/^[Zz]/,p=ht(["Z","z"],!1,!1),f=function(){return Ht("Z")},g=/^[Ll]/,m=ht(["L","l"],!1,!1),y=function(t,e){return Ht(t,e)},b=/^[Hh]/,v=ht(["H","h"],!1,!1),x=function(t,e){return Ht(t,e.map((function(t){return{x:t}})))},w=/^[Vv]/,S=ht(["V","v"],!1,!1),k=function(t,e){return Ht(t,e.map((function(t){return{y:t}})))},A=/^[Cc]/,L=ht(["C","c"],!1,!1),P=function(t,e,n){return{x1:t.x,y1:t.y,x2:e.x,y2:e.y,x:n.x,y:n.y}},E=/^[Ss]/,B=ht(["S","s"],!1,!1),C=function(t,e){return{x2:t.x,y2:t.y,x:e.x,y:e.y}},M=/^[Qq]/,O=ht(["Q","q"],!1,!1),T=function(t,e){return{x1:t.x,y1:t.y,x:e.x,y:e.y}},j=/^[Tt]/,N=ht(["T","t"],!1,!1),_=/^[Aa]/,z=ht(["A","a"],!1,!1),I=function(t,e,n,i,r,s){return{rx:t,ry:e,xAxisRotation:n,largeArc:i,sweep:r,x:s.x,y:s.y}},F=function(t,e){return{x:t,y:e}},G=function(t){return 1*t},H=function(t){return 1*t.join("")},V=/^[01]/,W=ht(["0","1"],!1,!1),D=function(t){return"1"==t},R=function(){return""},Y=",",q=ut(",",!1),K=function(t){return t.join("")},Z=".",U=ut(".",!1),$=/^[eE]/,X=ht(["e","E"],!1,!1),J=/^[+\-]/,Q=ht(["+","-"],!1,!1),tt=/^[0-9]/,et=ht([["0","9"]],!1,!1),nt=function(t){return t.join("")},it=/^[ \t\n\r]/,rt=ht([" ","\t","\n","\r"],!1,!1),st=0,at=[{line:1,column:1}],ot=0,lt=[],ct=0;if("startRule"in n){if(!(n.startRule in s))throw new Error("Can't start parsing from rule \""+n.startRule+'".');a=s[n.startRule]}function ut(t,e){return{type:"literal",text:t,ignoreCase:e}}function ht(t,e,n){return{type:"class",parts:t,inverted:e,ignoreCase:n}}function dt(e){var n,i=at[e];if(i)return i;for(n=e-1;!at[n];)n--;for(i={line:(i=at[n]).line,column:i.column};n<e;)10===t.charCodeAt(n)?(i.line++,i.column=1):i.column++,n++;return at[e]=i,i}function pt(t,e){var n=dt(t),i=dt(e);return{start:{offset:t,line:n.line,column:n.column},end:{offset:e,line:i.line,column:i.column}}}function ft(t){st<ot||(st>ot&&(ot=st,lt=[]),lt.push(t))}function gt(){var t,e,n,i,s;for(t=st,e=[],n=Nt();n!==r;)e.push(n),n=Nt();if(e!==r)if(n=function(){var t,e,n,i,s,a;if(t=st,(e=mt())!==r){for(n=[],i=st,s=[],a=Nt();a!==r;)s.push(a),a=Nt();for(s!==r&&(a=mt())!==r?i=s=[s,a]:(st=i,i=r);i!==r;){for(n.push(i),i=st,s=[],a=Nt();a!==r;)s.push(a),a=Nt();s!==r&&(a=mt())!==r?i=s=[s,a]:(st=i,i=r)}n!==r?t=e=l(e,n):(st=t,t=r)}else st=t,t=r;return t}(),n===r&&(n=null),n!==r){for(i=[],s=Nt();s!==r;)i.push(s),s=Nt();i!==r?t=e=o(n):(st=t,t=r)}else st=t,t=r;else st=t,t=r;return t}function mt(){var e,n,i,s,a,o;if(e=st,n=function(){var e,n,i,s,a,o,l;if(e=st,c.test(t.charAt(st))?(n=t.charAt(st),st++):(n=r,0===ct&&ft(u)),n!==r){for(i=[],s=Nt();s!==r;)i.push(s),s=Nt();i!==r&&(s=At())!==r?(a=st,(o=Bt())===r&&(o=null),o!==r&&(l=bt())!==r?a=o=[o,l]:(st=a,a=r),a===r&&(a=null),a!==r?e=n=h(n,s,a):(st=e,e=r)):(st=e,e=r)}else st=e,e=r;return e}(),n!==r){for(i=[],s=st,a=[],o=Nt();o!==r;)a.push(o),o=Nt();for(a!==r&&(o=yt())!==r?s=a=[a,o]:(st=s,s=r);s!==r;){for(i.push(s),s=st,a=[],o=Nt();o!==r;)a.push(o),o=Nt();a!==r&&(o=yt())!==r?s=a=[a,o]:(st=s,s=r)}i!==r?e=n=l(n,i):(st=e,e=r)}else st=e,e=r;return e}function yt(){var e,n;return d.test(t.charAt(st))?(n=t.charAt(st),st++):(n=r,0===ct&&ft(p)),n!==r&&(n=f()),(e=n)===r&&(e=function(){var e,n,i,s;if(e=st,g.test(t.charAt(st))?(n=t.charAt(st),st++):(n=r,0===ct&&ft(m)),n!==r){for(i=[],s=Nt();s!==r;)i.push(s),s=Nt();i!==r&&(s=bt())!==r?e=n=y(n,s):(st=e,e=r)}else st=e,e=r;return e}())===r&&(e=function(){var e,n,i,s;if(e=st,b.test(t.charAt(st))?(n=t.charAt(st),st++):(n=r,0===ct&&ft(v)),n!==r){for(i=[],s=Nt();s!==r;)i.push(s),s=Nt();i!==r&&(s=vt())!==r?e=n=x(n,s):(st=e,e=r)}else st=e,e=r;return e}())===r&&(e=function(){var e,n,i,s;if(e=st,w.test(t.charAt(st))?(n=t.charAt(st),st++):(n=r,0===ct&&ft(S)),n!==r){for(i=[],s=Nt();s!==r;)i.push(s),s=Nt();i!==r&&(s=vt())!==r?e=n=k(n,s):(st=e,e=r)}else st=e,e=r;return e}())===r&&(e=function(){var e,n,i,s;if(e=st,A.test(t.charAt(st))?(n=t.charAt(st),st++):(n=r,0===ct&&ft(L)),n!==r){for(i=[],s=Nt();s!==r;)i.push(s),s=Nt();i!==r?(s=function(){var t,e,n,i,s,a;if(t=st,(e=xt())!==r){for(n=[],i=st,(s=Bt())===r&&(s=null),s!==r&&(a=xt())!==r?i=s=[s,a]:(st=i,i=r);i!==r;)n.push(i),i=st,(s=Bt())===r&&(s=null),s!==r&&(a=xt())!==r?i=s=[s,a]:(st=i,i=r);n!==r?t=e=l(e,n):(st=t,t=r)}else st=t,t=r;return t}(),s!==r?e=n=y(n,s):(st=e,e=r)):(st=e,e=r)}else st=e,e=r;return e}())===r&&(e=function(){var e,n,i,s;if(e=st,E.test(t.charAt(st))?(n=t.charAt(st),st++):(n=r,0===ct&&ft(B)),n!==r){for(i=[],s=Nt();s!==r;)i.push(s),s=Nt();i!==r?(s=function(){var t,e,n,i,s,a;if(t=st,(e=wt())!==r){for(n=[],i=st,(s=Bt())===r&&(s=null),s!==r&&(a=wt())!==r?i=s=[s,a]:(st=i,i=r);i!==r;)n.push(i),i=st,(s=Bt())===r&&(s=null),s!==r&&(a=wt())!==r?i=s=[s,a]:(st=i,i=r);n!==r?t=e=l(e,n):(st=t,t=r)}else st=t,t=r;return t}(),s!==r?e=n=y(n,s):(st=e,e=r)):(st=e,e=r)}else st=e,e=r;return e}())===r&&(e=function(){var e,n,i,s;if(e=st,M.test(t.charAt(st))?(n=t.charAt(st),st++):(n=r,0===ct&&ft(O)),n!==r){for(i=[],s=Nt();s!==r;)i.push(s),s=Nt();i!==r?(s=function(){var t,e,n,i,s,a;if(t=st,(e=St())!==r){for(n=[],i=st,(s=Bt())===r&&(s=null),s!==r&&(a=St())!==r?i=s=[s,a]:(st=i,i=r);i!==r;)n.push(i),i=st,(s=Bt())===r&&(s=null),s!==r&&(a=St())!==r?i=s=[s,a]:(st=i,i=r);n!==r?t=e=l(e,n):(st=t,t=r)}else st=t,t=r;return t}(),s!==r?e=n=y(n,s):(st=e,e=r)):(st=e,e=r)}else st=e,e=r;return e}())===r&&(e=function(){var e,n,i,s;if(e=st,j.test(t.charAt(st))?(n=t.charAt(st),st++):(n=r,0===ct&&ft(N)),n!==r){for(i=[],s=Nt();s!==r;)i.push(s),s=Nt();i!==r?(s=function(){var t,e,n,i,s,a;if(t=st,(e=At())!==r){for(n=[],i=st,(s=Bt())===r&&(s=null),s!==r&&(a=At())!==r?i=s=[s,a]:(st=i,i=r);i!==r;)n.push(i),i=st,(s=Bt())===r&&(s=null),s!==r&&(a=At())!==r?i=s=[s,a]:(st=i,i=r);n!==r?t=e=l(e,n):(st=t,t=r)}else st=t,t=r;return t}(),s!==r?e=n=y(n,s):(st=e,e=r)):(st=e,e=r)}else st=e,e=r;return e}())===r&&(e=function(){var e,n,i,s;if(e=st,_.test(t.charAt(st))?(n=t.charAt(st),st++):(n=r,0===ct&&ft(z)),n!==r){for(i=[],s=Nt();s!==r;)i.push(s),s=Nt();i!==r?(s=function(){var t,e,n,i,s,a;if(t=st,(e=kt())!==r){for(n=[],i=st,(s=Bt())===r&&(s=null),s!==r&&(a=kt())!==r?i=s=[s,a]:(st=i,i=r);i!==r;)n.push(i),i=st,(s=Bt())===r&&(s=null),s!==r&&(a=kt())!==r?i=s=[s,a]:(st=i,i=r);n!==r?t=e=l(e,n):(st=t,t=r)}else st=t,t=r;return t}(),s!==r?e=n=y(n,s):(st=e,e=r)):(st=e,e=r)}else st=e,e=r;return e}()),e}function bt(){var t,e,n,i,s,a;if(t=st,(e=At())!==r){for(n=[],i=st,(s=Bt())===r&&(s=null),s!==r&&(a=At())!==r?i=s=[s,a]:(st=i,i=r);i!==r;)n.push(i),i=st,(s=Bt())===r&&(s=null),s!==r&&(a=At())!==r?i=s=[s,a]:(st=i,i=r);n!==r?t=e=l(e,n):(st=t,t=r)}else st=t,t=r;return t}function vt(){var t,e,n,i,s,a;if(t=st,(e=Pt())!==r){for(n=[],i=st,(s=Bt())===r&&(s=null),s!==r&&(a=Pt())!==r?i=s=[s,a]:(st=i,i=r);i!==r;)n.push(i),i=st,(s=Bt())===r&&(s=null),s!==r&&(a=Pt())!==r?i=s=[s,a]:(st=i,i=r);n!==r?t=e=l(e,n):(st=t,t=r)}else st=t,t=r;return t}function xt(){var t,e,n,i,s,a;return t=st,(e=At())!==r?((n=Bt())===r&&(n=null),n!==r&&(i=At())!==r?((s=Bt())===r&&(s=null),s!==r&&(a=At())!==r?t=e=P(e,i,a):(st=t,t=r)):(st=t,t=r)):(st=t,t=r),t}function wt(){var t,e,n,i;return t=st,(e=At())!==r?((n=Bt())===r&&(n=null),n!==r&&(i=At())!==r?t=e=C(e,i):(st=t,t=r)):(st=t,t=r),t}function St(){var t,e,n,i;return t=st,(e=At())!==r?((n=Bt())===r&&(n=null),n!==r&&(i=At())!==r?t=e=T(e,i):(st=t,t=r)):(st=t,t=r),t}function kt(){var t,e,n,i,s,a,o,l,c,u,h;return t=st,(e=Lt())!==r?((n=Bt())===r&&(n=null),n!==r&&(i=Lt())!==r?((s=Bt())===r&&(s=null),s!==r&&(a=Pt())!==r&&Bt()!==r&&(o=Et())!==r?((l=Bt())===r&&(l=null),l!==r&&(c=Et())!==r?((u=Bt())===r&&(u=null),u!==r&&(h=At())!==r?t=e=I(e,i,a,o,c,h):(st=t,t=r)):(st=t,t=r)):(st=t,t=r)):(st=t,t=r)):(st=t,t=r),t}function At(){var t,e,n,i;return t=st,(e=Pt())!==r?((n=Bt())===r&&(n=null),n!==r&&(i=Pt())!==r?t=e=F(e,i):(st=t,t=r)):(st=t,t=r),t}function Lt(){var t;return st,(t=Mt())===r&&(t=jt()),t!==r&&(t=G(t)),t}function Pt(){var t,e,n;return st,t=st,(e=Tt())===r&&(e=null),e!==r&&(n=Mt())!==r?t=e=[e,n]:(st=t,t=r),t===r&&(t=st,(e=Tt())===r&&(e=null),e!==r&&(n=jt())!==r?t=e=[e,n]:(st=t,t=r)),t!==r&&(t=H(t)),t}function Et(){var e;return st,V.test(t.charAt(st))?(e=t.charAt(st),st++):(e=r,0===ct&&ft(W)),e!==r&&(e=D(e)),e}function Bt(){var t,e,n,i,s;if(t=st,e=[],(n=Nt())!==r)for(;n!==r;)e.push(n),n=Nt();else e=r;if(e!==r)if((n=Ct())===r&&(n=null),n!==r){for(i=[],s=Nt();s!==r;)i.push(s),s=Nt();i!==r?t=e=[e,n,i]:(st=t,t=r)}else st=t,t=r;else st=t,t=r;if(t===r){if(t=st,e=st,(n=Ct())!==r){for(i=[],s=Nt();s!==r;)i.push(s),s=Nt();i!==r?e=n=[n,i]:(st=e,e=r)}else st=e,e=r;e!==r&&(e=R()),t=e}return t}function Ct(){var e;return 44===t.charCodeAt(st)?(e=Y,st++):(e=r,0===ct&&ft(q)),e}function Mt(){var e,n,i;return st,e=st,n=function(){var e,n,i,s;return st,e=st,(n=jt())===r&&(n=null),n!==r?(46===t.charCodeAt(st)?(i=Z,st++):(i=r,0===ct&&ft(U)),i!==r&&(s=jt())!==r?e=n=[n,i,s]:(st=e,e=r)):(st=e,e=r),e===r&&(e=st,(n=jt())!==r?(46===t.charCodeAt(st)?(i=Z,st++):(i=r,0===ct&&ft(U)),i!==r?e=n=[n,i]:(st=e,e=r)):(st=e,e=r)),e!==r&&(e=K(e)),e}(),n!==r?((i=Ot())===r&&(i=null),i!==r?e=n=[n,i]:(st=e,e=r)):(st=e,e=r),e===r&&(e=st,(n=jt())!==r&&(i=Ot())!==r?e=n=[n,i]:(st=e,e=r)),e!==r&&(e=K(e)),e}function Ot(){var e,n,i,s;return st,e=st,$.test(t.charAt(st))?(n=t.charAt(st),st++):(n=r,0===ct&&ft(X)),n!==r?((i=Tt())===r&&(i=null),i!==r&&(s=jt())!==r?e=n=[n,i,s]:(st=e,e=r)):(st=e,e=r),e!==r&&(e=K(e)),e}function Tt(){var e;return J.test(t.charAt(st))?(e=t.charAt(st),st++):(e=r,0===ct&&ft(Q)),e}function jt(){var e,n;if(st,e=[],tt.test(t.charAt(st))?(n=t.charAt(st),st++):(n=r,0===ct&&ft(et)),n!==r)for(;n!==r;)e.push(n),tt.test(t.charAt(st))?(n=t.charAt(st),st++):(n=r,0===ct&&ft(et));else e=r;return e!==r&&(e=nt(e)),e}function Nt(){var e;return st,it.test(t.charAt(st))?(e=t.charAt(st),st++):(e=r,0===ct&&ft(rt)),e!==r&&(e=R()),e}var _t,zt,It,Ft={m:"moveto",l:"lineto",h:"horizontal lineto",v:"vertical lineto",c:"curveto",s:"smooth curveto",q:"quadratic curveto",t:"smooth quadratic curveto",a:"elliptical arc",z:"closepath"};for(var Gt in Ft)Ft[Gt.toUpperCase()]=Ft[Gt];function Ht(t,e){e||(e=[{}]);for(var n=e.length;n--;){var i={code:t,command:Ft[t]};for(var r in t==t.toLowerCase()&&(i.relative=!0),e[n])i[r]=e[n][r];e[n]=i}return e}if((i=a())!==r&&st===t.length)return i;throw i!==r&&st<t.length&&ft({type:"end"}),_t=lt,zt=ot<t.length?t.charAt(ot):null,It=ot<t.length?pt(ot,ot+1):pt(ot,ot),new e(e.buildMessage(_t,zt),_t,zt,It)}}},10:e=>{"use strict";e.exports=t}},n={};function i(t){var r=n[t];if(void 0!==r)return r.exports;var s=n[t]={exports:{}};return e[t](s,s.exports,i),s.exports}i.n=t=>{var e=t&&t.__esModule?()=>t.default:()=>t;return i.d(e,{a:e}),e},i.d=(t,e)=>{for(var n in e)i.o(e,n)&&!i.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},i.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),i.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})};var r={};return(()=>{"use strict";i.r(r),i.d(r,{Axis:()=>Yi,BBox:()=>Ii,Breadcrumb:()=>mt,Button:()=>ht,Category:()=>Br,Checkbox:()=>as,CircleCrosshair:()=>Zr,Continuous:()=>pr,Layout:()=>xs,LineCrosshair:()=>qr,Marker:()=>et,Navigator:()=>vr,PRIMILTIVE_ATTRIBUTES:()=>yn,PolygonCrosshair:()=>ts,Poptip:()=>fs,Scrollbar:()=>cn,Select:()=>As,Selection:()=>I,Slider:()=>on,Sparkline:()=>_e,Switch:()=>Fr,Tag:()=>nt,Timebar:()=>na,Timeline:()=>qi,Tooltip:()=>Nr,add:()=>ye,addPrefix:()=>A,applyStyleSheet:()=>P,applyToText:()=>ni,arrayInterpolate:()=>En,calcLayout:()=>bs,catmullRom2Bezier:()=>Le,classNames:()=>$e,copyAttributes:()=>ki,createOffscreenGroup:()=>c,createTempText:()=>xi,deepAssign:()=>y,defined:()=>oi,degToRad:()=>pn,distance:()=>we,ellipsisIt:()=>ii,flex:()=>ms,formatTime:()=>Cs,getCallbackValue:()=>gn,getEventPos:()=>Ve,getFont:()=>ti,getLocalBBox:()=>vi,getMask:()=>Bs,getPrimitiveAttributes:()=>vn,getRenderBBox:()=>Fi,getShapeSpace:()=>bi,getTimeDiff:()=>Ms,getTimeScale:()=>Os,getTimeStart:()=>Ts,getTranslate:()=>si,grid:()=>ys,groupBy:()=>gr,hide:()=>a,ifNegative:()=>qe,ifPositive:()=>Ke,ifShow:()=>W,inRange:()=>Un,interpolate:()=>Cn,intersection:()=>Jr,isHorizontal:()=>wi,isInOffscreenGroup:()=>u,isPrimitiveAttribute:()=>bn,isVertical:()=>Si,keyframeInterpolate:()=>Mn,lineLen:()=>Ur,max:()=>xe,maybeAppend:()=>H,measureTextWidth:()=>Qn,mid:()=>Ue,min:()=>ve,multi:()=>Ze,normalize:()=>Se,numberInterpolate:()=>Pn,objectInterpolate:()=>Bn,omit:()=>jn,parseDate:()=>Es,parseHTML:()=>ra,parseSeriesAttr:()=>T,path2marker:()=>oa,percentTransform:()=>ai,radToDeg:()=>fn,removePrefix:()=>L,renderExtDo:()=>On,rotate:()=>ke,sampling:()=>un,scale:()=>me,scaleToPixel:()=>Tn,select:()=>G,setMockMeasureTextWidth:()=>Jn,show:()=>s,splitStyle:()=>M,stringToHTML:()=>ia,sub:()=>be,subStyleProps:()=>B,superStyleProps:()=>C,svg2marker:()=>la,textOf:()=>ei,throttle:()=>ca,timer:()=>ua,toKNotation:()=>Ye,toLowercaseFirstLetter:()=>k,toPrecision:()=>We,toScientificNotation:()=>Re,toThousands:()=>De,toUppercaseFirstLetter:()=>S,transpose:()=>mr,traverse:()=>n,vertical:()=>Ae,visibility:()=>o,wrapIt:()=>ri});var t=i(10);const e=function(t){return null==t};function n(t,e){e(t),t.children&&t.children.forEach((t=>{t&&n(t,e)}))}function s(t){o(t,!0)}function a(t){o(t,!1)}function o(t,e){const i=e?"visible":"hidden";n(t,(t=>{t.attr("visibility",i)}))}class l extends t.Group{constructor(){super(...arguments),this.addEventListener(t.ElementEvent.INSERTED,(()=>{a(this)}))}}function c(t){const e=t.appendChild(new l({class:"offscreen"}));return a(e),e}function u(t){let e=t;for(;e;){if("offscreen"===e.className)return!0;e=e.parent}return!1}const h=function(t){return"object"==typeof t&&null!==t};var d={}.toString;const p=function(t,e){return d.call(t)==="[object "+e+"]"},f=function(t){if(!h(t)||!p(t,"Object"))return!1;if(null===Object.getPrototypeOf(t))return!0;for(var e=t;null!==Object.getPrototypeOf(e);)e=Object.getPrototypeOf(e);return Object.getPrototypeOf(t)===e},g=function(t){return Array.isArray?Array.isArray(t):p(t,"Array")},m=function(t,e){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:5;Object.entries(e).forEach((r=>{let[s,a]=r;const o=t;Object.prototype.hasOwnProperty.call(e,s)&&(a?f(a)?(f(t[s])||(o[s]={}),n<i?m(t[s],a,n+1,i):o[s]=e[s]):g(a)?(o[s]=[],o[s]=o[s].concat(a)):o[s]=a:o[s]=a)}))},y=function(t){for(let e=0;e<(arguments.length<=1?0:arguments.length-1);e+=1)m(t,e+1<1||arguments.length<=e+1?void 0:arguments[e+1]);return t};function b(t,e,n){var i;return(e="symbol"==typeof(i=function(t,e){if("object"!=typeof t||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var i=n.call(t,"string");if("object"!=typeof i)return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(e))?i:i+"")in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function v(){o(this,"hidden"!==this.attributes.visibility)}class x extends t.CustomElement{get offscreenGroup(){return this._offscreen||(this._offscreen=c(this)),this._offscreen}get defaultOptions(){return this._defaultOptions}constructor(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};super(y({},{style:e},t)),b(this,"_defaultOptions",void 0),b(this,"_offscreen",void 0),b(this,"initialized",!1),this._defaultOptions=e}connectedCallback(){this.render(this.attributes,this),this.bindEvents(this.attributes,this),this.initialized=!0}disconnectedCallback(){var t;null===(t=this._offscreen)||void 0===t||t.destroy()}attributeChangedCallback(t){"visibility"===t&&v.call(this)}update(t,e){var n;return this.attr(y({},this.attributes,t||{})),null===(n=this.render)||void 0===n?void 0:n.call(this,this.attributes,this,e)}clear(){this.removeChildren()}bindEvents(t,e){}getSubShapeStyle(t){const{x:e,y:n,transform:i,transformOrigin:r,class:s,className:a,zIndex:o,...l}=t;return l}}class w extends t.Text{get offscreenGroup(){return this._offscreen||(this._offscreen=c(this)),this._offscreen}disconnectedCallback(){var t;null===(t=this._offscreen)||void 0===t||t.destroy()}constructor(){let{style:t,...e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};super({style:{text:"",fill:"black",fontFamily:"sans-serif",fontSize:16,fontStyle:"normal",fontVariant:"normal",fontWeight:"normal",lineWidth:1,textAlign:"start",textBaseline:"middle",...t},...e}),function(t,e,n){var i;(e="symbol"==typeof(i=function(t,e){if("object"!=typeof t||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var i=n.call(t,"string");if("object"!=typeof i)return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(e))?i:i+"")in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n}(this,"_offscreen",void 0)}}function S(t){return t.toString().charAt(0).toUpperCase()+t.toString().slice(1)}function k(t){return t.toString().charAt(0).toLowerCase()+t.toString().slice(1)}function A(t,e){return"".concat(e).concat(S(t))}function L(t,e){var n;let i=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];const r=e||(null===(n=t.match(/^([a-z][a-z0-9]+)/))||void 0===n?void 0:n[0])||"",s=t.replace(new RegExp("^(".concat(r,")")),"");return i?k(s):s}function P(t,e){Object.entries(e).forEach((e=>{let[n,i]=e;[t,...t.querySelectorAll(n)].filter((t=>t.matches(n))).forEach((t=>{t&&(t.style.cssText+=Object.entries(i).reduce(((t,e)=>"".concat(t).concat(e.join(":"),";")),""))}))}))}const E=(t,e)=>{if(null==t||!t.startsWith(e))return!1;const n=t[e.length];return n>="A"&&n<="Z"};function B(t,e){let n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];const i={};return Object.entries(t).forEach((t=>{let[r,s]=t;if("className"===r||"class"===r);else if(E(r,"show")&&E(L(r,"show"),e)!==n)r===A(e,"show")?i[r]=s:i[r.replace(new RegExp(S(e)),"")]=s;else if(!E(r,"show")&&E(r,e)!==n){const t=L(r,e);"filter"===t&&"function"==typeof s||(i[t]=s)}})),i}function C(t,e){return Object.entries(t).reduce(((t,n)=>{let[i,r]=n;return i.startsWith("show")?t["show".concat(e).concat(i.slice(4))]=r:t["".concat(e).concat(S(i))]=r,t}),{})}function M(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:["x","y","class","className"];const n=["transform","transformOrigin","anchor","visibility","pointerEvents","zIndex","cursor","clipPath","clipPathTargets","offsetPath","offsetPathTargets","offsetDistance","draggable","droppable"],i={},r={};return Object.entries(t).forEach((t=>{let[s,a]=t;e.includes(s)||(-1!==n.indexOf(s)?r[s]=a:i[s]=a)})),[i,r]}const O=function(t){return p(t,"Number")};function T(t){if(O(t))return[t,t,t,t];if(g(t)){const e=t.length;if(1===e)return[t[0],t[0],t[0],t[0]];if(2===e)return[t[0],t[1],t[0],t[1]];if(3===e)return[t[0],t[1],t[2],t[1]];if(4===e)return t}return[0,0,0,0]}var j;function N(t,e,n){var i;return(e="symbol"==typeof(i=function(t,e){if("object"!=typeof t||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var i=n.call(t,"string");if("object"!=typeof i)return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(e))?i:i+"")in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function _(t,e,n){if("function"==typeof t?t===e:t.has(e))return arguments.length<3?e:n;throw new TypeError("Private element is not present on this object")}var z=new WeakSet;class I{constructor(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null,r=arguments.length>4&&void 0!==arguments[4]?arguments[4]:[null,null,null,null,null],s=arguments.length>5&&void 0!==arguments[5]?arguments[5]:[],a=arguments.length>6&&void 0!==arguments[6]?arguments[6]:[];(function(t,e){!function(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}(t,e),e.add(t)})(this,z),N(this,"_elements",void 0),N(this,"_parent",void 0),N(this,"_data",void 0),N(this,"_enter",void 0),N(this,"_exit",void 0),N(this,"_update",void 0),N(this,"_merge",void 0),N(this,"_split",void 0),N(this,"_document",void 0),N(this,"_transitions",void 0),N(this,"_facetElements",void 0),this._elements=Array.from(t),this._data=e,this._parent=n,this._document=i,this._enter=r[0],this._update=r[1],this._exit=r[2],this._merge=r[3],this._split=r[4],this._transitions=s,this._facetElements=a}selectAll(t){const e="string"==typeof t?this._parent.querySelectorAll(t):t;return new I(e,null,this._elements[0],this._document)}selectFacetAll(t){const e="string"==typeof t?this._parent.querySelectorAll(t):t;return new I(this._elements,null,this._parent,this._document,void 0,void 0,e)}select(t){const e="string"==typeof t?this._parent.querySelectorAll(t)[0]||null:t;return new I([e],null,e,this._document)}append(t){const e="function"==typeof t?t:()=>this.createElement(t),n=[];if(null!==this._data){for(let t=0;t<this._data.length;t++){const i=this._data[t],[r,s]=Array.isArray(i)?i:[i,null],a=e(r,t);a.__data__=r,null!==s&&(a.__fromElements__=s),this._parent.appendChild(a),n.push(a)}return new I(n,null,this._parent,this._document)}for(let t=0;t<this._elements.length;t++){const i=this._elements[t],r=e(i.__data__,t);i.appendChild(r),n.push(r)}return new I(n,null,n[0],this._document)}maybeAppend(t,e){const n=_(z,this,F).call(this,"#"===t[0]?t:"#".concat(t),e);return n.attr("id",t),n}maybeAppendByClassName(t,e){const n=t.toString(),i=_(z,this,F).call(this,"."===n[0]?n:".".concat(n),e);return i.attr("className",n),i}maybeAppendByName(t,e){const n=_(z,this,F).call(this,'[name="'.concat(t,'"]'),e);return n.attr("name",t),n}data(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:t=>t,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:()=>null;const i=[],r=[],s=new Set(this._elements),a=[],o=new Set,l=new Map(this._elements.map(((t,n)=>[e(t.__data__,n),t]))),c=new Map(this._facetElements.map(((t,n)=>[e(t.__data__,n),t]))),u=function(t,e){const i=new Map;return t.forEach((t=>{const e=n(t.__data__);i.has(e)||i.set(e,[]),i.get(e).push(t)})),i}(this._elements);for(let h=0;h<t.length;h++){const d=t[h],p=e(d,h),f=n(d,h);if(l.has(p)){const t=l.get(p);t.__data__=d,t.__facet__=!1,r.push(t),s.delete(t),l.delete(p)}else if(c.has(p)){const t=c.get(p);t.__data__=d,t.__facet__=!0,r.push(t),c.delete(p)}else if(u.has(p)){const t=u.get(p);a.push([d,t]);for(const e of t)s.delete(e);u.delete(p)}else if(l.has(f)){const t=l.get(f);t.__toData__?t.__toData__.push(d):t.__toData__=[d],o.add(t),s.delete(t)}else i.push(d)}const h=[new I([],i,this._parent,this._document),new I(r,null,this._parent,this._document),new I(s,null,this._parent,this._document),new I([],a,this._parent,this._document),new I(o,null,this._parent,this._document)];return new I(this._elements,null,this._parent,this._document,h)}merge(t){const e=[...this._elements,...t._elements],n=[...this._transitions,...t._transitions];return new I(e,null,this._parent,this._document,void 0,n)}createElement(t){if(this._document)return this._document.createElement(t,{});const e=I.registry[t];return e?new e:function(t){throw new Error(t)}("Unknown node type: ".concat(t))}join(){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:t=>t,e=arguments.length>2&&void 0!==arguments[2]?arguments[2]:t=>t.remove(),n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:t=>t,i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:t=>t.remove();const r=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:t=>t)(this._enter),s=t(this._update),a=e(this._exit),o=n(this._merge),l=i(this._split);return s.merge(r).merge(a).merge(o).merge(l)}remove(){for(let t=0;t<this._elements.length;t++){const e=this._elements[t],n=this._transitions[t];n?n.then((()=>e.remove())):e.remove()}return new I([],null,this._parent,this._document,void 0,this._transitions)}each(t){for(let e=0;e<this._elements.length;e++){const n=this._elements[e],i=n.__data__;t.call(n,i,e)}return this}attr(t,e){const n="function"!=typeof e?()=>e:e;return this.each((function(i,r){void 0!==e&&(this[t]=n.call(this,i,r))}))}style(t,e){const n="function"!=typeof e||arguments.length>2&&void 0!==arguments[2]&&!arguments[2]?()=>e:e;return this.each((function(i,r){void 0!==e&&(this.style[t]=n.call(this,i,r))}))}styles(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return this.each((function(n,i){Object.entries(t).forEach((t=>{let[r,s]=t;const a="function"==typeof s&&e?s:()=>s;void 0!==s&&this.attr(r,a.call(this,n,i))}))}))}update(t){const e="function"!=typeof t||arguments.length>1&&void 0!==arguments[1]&&!arguments[1]?()=>t:t;return this.each((function(n,i){t&&this.update&&this.update(e.call(this,n,i))}))}maybeUpdate(t){const e="function"!=typeof t||arguments.length>1&&void 0!==arguments[1]&&!arguments[1]?()=>t:t;return this.each((function(n,i){t&&this.update&&this.update(e.call(this,n,i))}))}transition(t){const{_transitions:e}=this;return this.each((function(n,i){e[i]=t.call(this,n,i)}))}on(t,e){return this.each((function(){this.addEventListener(t,e)})),this}call(t){for(var e=arguments.length,n=new Array(e>1?e-1:0),i=1;i<e;i++)n[i-1]=arguments[i];return t.call(this._parent,this,...n),this}node(){return this._elements[0]}nodes(){return this._elements}transitions(){return this._transitions.filter((t=>!!t))}parent(){return this._parent}}function F(t,e){const n=this._elements[0],i=n.querySelector(t);if(i)return new j([i],null,this._parent,this._document);const r="string"==typeof e?this.createElement(e):e();return n.appendChild(r),new j([r],null,this._parent,this._document)}function G(t){return new I([t],null,t,t.ownerDocument)}function H(t,e,n){return t.querySelector(e)?G(t).select(e):G(t).append(n)}j=I,N(I,"registry",{g:t.Group,rect:t.Rect,circle:t.Circle,path:t.Path,text:w,ellipse:t.Ellipse,image:t.Image,line:t.Line,polygon:t.Polygon,polyline:t.Polyline,html:t.HTML});const V=function(t){return"function"==typeof t};function W(t,e,n){let i=!(arguments.length>3&&void 0!==arguments[3])||arguments[3],r=arguments.length>4&&void 0!==arguments[4]?arguments[4]:t=>{t.node().removeChildren()};return t?n(e):(i&&r(e),null)}const D=(t,e,n)=>[["M",t-n,e],["A",n,n,0,1,0,t+n,e],["A",n,n,0,1,0,t-n,e],["Z"]],R=D,Y=(t,e,n)=>[["M",t,e+n],["L",t,e-n]],q=(t,e,n)=>[["M",t-n,e],["L",t+n,e]],K=q,Z=function(t){var e=typeof t;return null!==t&&"object"===e||"function"===e},U=function(t){return p(t,"String")};var $,X,J,Q;function tt(t,e,n){var i;return(e="symbol"==typeof(i=function(t,e){if("object"!=typeof t||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var i=n.call(t,"string");if("object"!=typeof i)return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(e))?i:i+"")in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}class et extends x{render(t,e){const{symbol:n,size:i=16,...r}=this.getSubShapeStyle(t),s=function(t){const e=function(t){let e="default";if(Z(t)&&t instanceof Image)e="image";else if(V(t))e="symbol";else if(U(t)){const n=new RegExp("data:(image|text)");e=t.match(n)?"base64":/^(https?:\/\/(([a-zA-Z0-9]+-?)+[a-zA-Z0-9]+\.)+[a-zA-Z]+)(:\d+)?(\/.*)?(\?.*)?(#.*)?$/.test(t)?"url":"symbol"}return e}(t);return["base64","url","image"].includes(e)?"image":t&&"symbol"===e?"path":null}(n);W(!!s,G(e),(t=>{t.maybeAppendByClassName("marker",s).attr("className","marker ".concat(s,"-marker")).call((t=>{if("image"===s){const e=2*i;t.styles({img:n,width:e,height:e,x:-i,y:-i})}else{const e=i/2,s=V(n)?n:et.getSymbol(n);t.styles({path:null==s?void 0:s(0,0,e),...r})}}))}))}}$=et,tt(et,"MARKER_SYMBOL_MAP",new Map),tt(et,"registerSymbol",((t,e)=>{$.MARKER_SYMBOL_MAP.set(t,e)})),tt(et,"getSymbol",(t=>$.MARKER_SYMBOL_MAP.get(t))),tt(et,"getSymbols",(()=>Array.from($.MARKER_SYMBOL_MAP.keys()))),et.registerSymbol("cross",((t,e,n)=>[["M",t-n,e-n],["L",t+n,e+n],["M",t+n,e-n],["L",t-n,e+n]])),et.registerSymbol("hyphen",((t,e,n)=>[["M",t-n,e],["L",t+n,e]])),et.registerSymbol("line",Y),et.registerSymbol("plus",((t,e,n)=>[["M",t-n,e],["L",t+n,e],["M",t,e-n],["L",t,e+n]])),et.registerSymbol("tick",((t,e,n)=>[["M",t-n/2,e-n],["L",t+n/2,e-n],["M",t,e-n],["L",t,e+n],["M",t-n/2,e+n],["L",t+n/2,e+n]])),et.registerSymbol("circle",D),et.registerSymbol("point",R),et.registerSymbol("bowtie",((t,e,n)=>{const i=n-1.5;return[["M",t-n,e-i],["L",t+n,e+i],["L",t+n,e-i],["L",t-n,e+i],["Z"]]})),et.registerSymbol("hexagon",((t,e,n)=>{const i=n/2*Math.sqrt(3);return[["M",t,e-n],["L",t+i,e-n/2],["L",t+i,e+n/2],["L",t,e+n],["L",t-i,e+n/2],["L",t-i,e-n/2],["Z"]]})),et.registerSymbol("square",((t,e,n)=>[["M",t-n,e-n],["L",t+n,e-n],["L",t+n,e+n],["L",t-n,e+n],["Z"]])),et.registerSymbol("diamond",((t,e,n)=>[["M",t-n,e],["L",t,e-n],["L",t+n,e],["L",t,e+n],["Z"]])),et.registerSymbol("triangle",((t,e,n)=>{const i=n*Math.sin(1/3*Math.PI);return[["M",t-n,e+i],["L",t,e-i],["L",t+n,e+i],["Z"]]})),et.registerSymbol("triangle-down",((t,e,n)=>{const i=n*Math.sin(1/3*Math.PI);return[["M",t-n,e-i],["L",t+n,e-i],["L",t,e+i],["Z"]]})),et.registerSymbol("line",Y),et.registerSymbol("dot",q),et.registerSymbol("dash",K),et.registerSymbol("smooth",((t,e,n)=>[["M",t-n,e],["A",n/2,n/2,0,1,1,t,e],["A",n/2,n/2,0,1,0,t+n,e]])),et.registerSymbol("hv",((t,e,n)=>[["M",t-n-1,e-2.5],["L",t,e-2.5],["L",t,e+2.5],["L",t+n+1,e+2.5]])),et.registerSymbol("vh",((t,e,n)=>[["M",t-n-1,e+2.5],["L",t,e+2.5],["L",t,e-2.5],["L",t+n+1,e-2.5]])),et.registerSymbol("hvh",((t,e,n)=>[["M",t-(n+1),e+2.5],["L",t-n/2,e+2.5],["L",t-n/2,e-2.5],["L",t+n/2,e-2.5],["L",t+n/2,e+2.5],["L",t+n+1,e+2.5]])),et.registerSymbol("vhv",(function(t,e){return[["M",t-5,e+2.5],["L",t-5,e],["L",t,e],["L",t,e-3],["L",t,e+3],["L",t+6.5,e+3]]}));class nt extends x{constructor(t){super(t,{padding:4,spacing:4})}render(t,n){const{padding:i=0,marker:r,text:s,radius:a,spacing:o,align:l,verticalAlign:c}=t,u=B(t,"label"),h=B(t,"background"),[d,p,f,g]=T(i),m=H(n,".tag-content","g").attr("className","tag-content").style("zIndex",0).node(),y=r||{symbol:"triangle",size:0},b=H(m,".tag-marker",(()=>new et({style:y}))).attr("className","tag-marker").call((t=>{t.node().clear()})).update(y).node(),{x:v,y:x}=function(t,e){const n=t.getLocalBounds();return{x:n.halfExtents[0]?n.max[0]+(e||0):t.style.x,y:n.halfExtents[1]?(n.min[1]+n.max[1])/2:t.style.y}}(b,o);G(m).maybeAppendByClassName("tag-text",(()=>new w)).styles({fontSize:12,text:e(s)?"":"".concat(s),x:v,y:x,...u,textBaseline:"middle"}).call((t=>{s||t.remove()})),function(t,e,n,i,r){const s=t.getLocalBounds();let a=0,o=0;"start"===i&&(a=e),"center"===i&&(a=-s.halfExtents[0]),"end"===i&&(a=-e-2*s.halfExtents[0]),"top"===r&&(o=n+s.halfExtents[1]),"middle"===r&&(o=0),"bottom"===r&&(o=n-2*s.halfExtents[1]),t.setLocalPosition([a,o])}(m,g,d,l||"start",c||"top");const S=m.getLocalBounds();G(n).maybeAppendByClassName("tag-background","rect").styles({zIndex:-1,y:S.min[1]-d,x:S.min[0]-g,width:null!==h?g+p+2*S.halfExtents[0]:0,height:null!==h?d+f+2*S.halfExtents[1]:0,radius:null!=a?a:2,fill:"#fafafa",stroke:"#d9d9d9",lineWidth:1,...h})}}X=nt,(J="symbol"==typeof(Q=function(t,e){if("object"!=typeof t||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var i=n.call(t,"string");if("object"!=typeof i)return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(J="tag"))?Q:Q+"")in X?Object.defineProperty(X,J,{value:"tag",enumerable:!0,configurable:!0,writable:!0}):X[J]="tag";const it=function(t){return void 0===t};function rt(t,e){if(Object.hasOwn)return Object.hasOwn(t,e);if(null==t)throw new TypeError("Cannot convert undefined or null to object");return Object.prototype.hasOwnProperty.call(Object(t),e)}function st(t,e,n,i){for(var r in n=n||0,i=i||5,e)if(rt(e,r)){var s=e[r];null!==s&&f(s)?(f(t[r])||(t[r]={}),n<i?st(t[r],s,n+1,i):t[r]=e[r]):g(s)?(t[r]=[],t[r]=t[r].concat(s)):void 0!==s&&(t[r]=s)}}const at=function(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];for(var i=0;i<e.length;i+=1)st(t,e[i]);return t},ot={small:{textFontSize:10,buttonWidth:40,buttonHeight:20,markerSize:8},middle:{textFontSize:12,buttonWidth:60,buttonHeight:30,markerSize:12},large:{textFontSize:16,buttonWidth:80,buttonHeight:40,markerSize:16}},lt={primary:{default:{textFill:"#fff",buttonFill:"#1890ff",buttonLineWidth:0,markerFill:"#1890ff"},active:{buttonFill:"#40a9ff",markerFill:"#40a9ff"},disabled:{}},dashed:{default:{buttonFill:"transparent",buttonStroke:"#bbb",buttonLineDash:[5,5]},active:{},disabled:{}},link:{default:{textFill:"#1890ff",buttonFill:"transparent",buttonLineWidth:0,markerFill:"#1890ff"},active:{},disabled:{}},text:{default:{textFill:"#000",buttonFill:"transparent",buttonLineWidth:0,markerFill:"#000"},active:{},disabled:{}},default:{default:{textFill:"#000",buttonFill:"transparent",buttonStroke:"#bbb",markerFill:"#bbb"},active:{textFill:"#1890ff",buttonStroke:"#1890ff",markerStroke:"#1890ff"},disabled:{}}},ct={strict:{textFill:"#b8b8b8"},buttonStroke:"#d9d9d9",buttonFill:"#f5f5f5",markerStroke:"#d9d9d9"};function ut(t,e,n){return e=function(t){var e=function(t,e){if("object"!=typeof t||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var i=n.call(t,"string");if("object"!=typeof i)return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==typeof e?e:e+""}(e),e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}class ht extends x{get markerSize(){const{markerSymbol:t}=this.attributes,e=this.getStyle("marker");return t?(null==e?void 0:e.size)||2:0}get textAvailableWidth(){const{markerSymbol:t,padding:e,ellipsis:n,width:i,markerSpacing:r}=this.attributes;if(!n)return 1/0;const s=it(i)?this.getStyle("button").width:i;return t?s-2*e-r-this.markerSize:s-2*e}get buttonHeight(){const{height:t}=this.attributes;return t?+t:+this.getStyle("button").height}constructor(t){super(t,{cursor:"pointer",padding:10,size:"middle",type:"default",text:"",state:"default",markerAlign:"left",markerSpacing:5,default:{buttonLineWidth:1,buttonRadius:5},active:{}}),ut(this,"textShape",void 0),ut(this,"state","default"),ut(this,"clickEvents",(()=>{const{onClick:t,state:e}=this.attributes;"disabled"!==e&&(null==t||t.call(this,this))})),ut(this,"mouseenterEvent",(()=>{const{state:t}=this.attributes;"disabled"!==t&&(this.state="active",this.render(this.attributes,this))})),ut(this,"mouseleaveEvent",(()=>{const{state:t}=this.attributes;this.state=t,this.render(this.attributes,this)}))}getStyle(t){const{size:e,type:n}=this.attributes,{state:i}=this,r=at({},ot[e],lt[n][i],this.attributes.default,this.attributes[i]);return"disabled"===i&&(Object.keys(r).forEach((t=>{t in ct&&(r[t]=ct[t])})),Object.keys(ct.strict).forEach((t=>{r[t]=ct.strict[t]})),at(r,this.attributes.disabled||{})),B(r,t)}render(t,e){const{text:n="",padding:i=0,markerSymbol:r,markerSpacing:s=0}=t;e.attr("cursor","disabled"===this.state?"not-allowed":"pointer");const[a,o,l,c]=T(i),u=this.buttonHeight,h=this.getStyle("marker"),{markerSize:d}=this,p={...h,symbol:r,x:c+d/2,y:u/2,size:d},f=H(e,".marker",(()=>new et({className:"marker",style:p}))).update({style:p}).node().getLocalBounds(),g=this.getStyle("text");this.textShape=H(e,".text","text").attr("className","text").styles({x:d?f.max[0]+s:c,y:u/2,...g,text:n,textAlign:"left",textBaseline:"middle",wordWrap:!0,wordWrapWidth:this.textAvailableWidth,maxLines:1,textOverflow:"..."}).node();const m=this.textShape.getLocalBounds(),y=this.getStyle("button");G(e).maybeAppendByClassName(".background","rect").styles({zIndex:-1,...y,height:u,width:c+(d?d+s:0)+2*m.halfExtents[0]+o})}update(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.attr(at({},this.attributes,t));const{state:e}=this.attributes;this.state=e,this.render(this.attributes,this)}setState(t){this.update({state:t})}hide(){this.style.visibility="hidden"}show(){this.style.visibility="visible"}bindEvents(){this.addEventListener("click",this.clickEvents),this.addEventListener("mouseenter",this.mouseenterEvent),this.addEventListener("mouseleave",this.mouseleaveEvent)}}ut(ht,"tag","button");const dt=function(t,e){if(t)if(g(t))for(var n=0,i=t.length;n<i&&!1!==e(t[n],n);n++);else if(Z(t))for(var r in t)if(t.hasOwnProperty(r)&&!1===e(t[r],r))break};var pt=Object.prototype.hasOwnProperty;const ft=function(t,e){if(null===t||!f(t))return{};var n={};return dt(e,(function(e){pt.call(t,e)&&(n[e]=t[e])})),n};function gt(t,e,n){return e=function(t){var e=function(t,e){if("object"!=typeof t||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var i=n.call(t,"string");if("object"!=typeof i)return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==typeof e?e:e+""}(e),e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}class mt extends x{constructor(t){super(at({},mt.defaultOptions,t))}render(t,n){const{x:i,y:r,items:s,textStyle:a,padding:o=0,width:l,separator:c}=t,[u,h,d]=T(o),p=B(t,"tag"),f=H(n,".container","g").styles({className:"container",x:i+d,y:r+u});let g=0,m=0;f.node().removeChildren();for(let t=0;t<s.length;t++){const n=s[t],i=new nt({className:"breadcrumb-item",style:{x:g,y:m,...p,text:e(n.text)?n.id:n.text,...ft(n,["marker"]),padding:0}});f.append((()=>i));const r=i.getLocalBounds(),a=2*r.halfExtents[0],o=2*r.halfExtents[1];g+=a,e(l)||g>l-h&&(i.attr({x:0,y:m+o}),g=a,m+=o),this.bindInnerEvents(i,n);const{spacing:u=0,text:d="/",style:y}=c||{};if(t!==s.length-1){const e=new w({className:"".concat(mt.tag,"-separator"),id:"".concat(mt.tag,"-separator-").concat(t),style:{x:g+u,y:m+o/2,...y,text:d,textAlign:"end",textBaseline:"middle"}});f.append((()=>e)),g+=2*e.getLocalBounds().halfExtents[0]+u}}}update(t){this.attr(at({},this.attributes,t)),this.render(this.attributes,this)}bindInnerEvents(t,e){const{items:n,onClick:i}=this.attributes;i&&t.addEventListener("click",(()=>{i.call(t,e.id,e,n)}))}}gt(mt,"tag","breadcrumb"),gt(mt,"defaultOptions",{style:{separator:{text:"/",style:{fontSize:14,fill:"rgba(0, 0, 0, 0.45)"},spacing:8},textStyle:{default:{fontSize:14,fill:"rgba(0, 0, 0, 0.45)"},active:{fill:"#5468ff",cursor:"pointer"}},padding:[8,8,8,8]}});var yt={}.toString;const bt=function(t,e){return yt.call(t)==="[object "+e+"]"},vt=function(t){return bt(t,"Function")},xt=function(t){return Array.isArray?Array.isArray(t):bt(t,"Array")};Object.keys;const wt=function(t){if(!function(t){return"object"==typeof t&&null!==t}(t)||!bt(t,"Object"))return!1;if(null===Object.getPrototypeOf(t))return!0;for(var e=t;null!==Object.getPrototypeOf(e);)e=Object.getPrototypeOf(e);return Object.getPrototypeOf(t)===e};var St=Array.prototype;St.splice,St.indexOf,Array.prototype.splice,Object.prototype.hasOwnProperty;Number.isInteger&&Number.isInteger,Math.PI,Math.PI;var kt=Object.values?function(t){return Object.values(t)}:function(t){var e=[];return function(t,e){if(t)if(xt(t))for(var n=0,i=t.length;n<i&&!1!==e(t[n],n);n++);else if(function(t){var e=typeof t;return null!==t&&"object"===e||"function"===e}(t))for(var r in t)if(t.hasOwnProperty(r)&&!1===e(t[r],r))break}(t,(function(n,i){vt(t)&&"prototype"===i||e.push(n)})),e};const At=kt;Object.prototype;function Lt(t,e,n,i){for(var r in n=n||0,i=i||5,e)if(e.hasOwnProperty(r)){var s=e[r];null!==s&&wt(s)?(wt(t[r])||(t[r]={}),n<i?Lt(t[r],s,n+1,i):t[r]=e[r]):xt(s)?(t[r]=[],t[r]=t[r].concat(s)):void 0!==s&&(t[r]=s)}}const Pt=function(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];for(var i=0;i<e.length;i+=1)Lt(t,e[i]);return t};Object.prototype.hasOwnProperty,Object.prototype.hasOwnProperty;const Et=function(t){return t};var Bt;Object.create,Object.create,"function"==typeof SuppressedError&&SuppressedError,function(t,e){if(!vt(t))throw new TypeError("Expected a function");var n=function(){for(var i=[],r=0;r<arguments.length;r++)i[r]=arguments[r];var s=e?e.apply(this,i):i[0],a=n.cache;if(a.has(s))return a.get(s);var o=t.apply(this,i);return a.set(s,o),o};n.cache=new Map}((function(t,e){void 0===e&&(e={});var n,i=e.fontSize,r=e.fontFamily,s=e.fontWeight,a=e.fontStyle,o=e.fontVariant;return Bt||(Bt=document.createElement("canvas").getContext("2d")),Bt.font=[a,o,s,i+"px",r].join(" "),Bt.measureText((n=t,bt(n,"String")?t:"")).width}),(function(t,e){return void 0===e&&(e={}),function(){for(var t=0,e=0,n=arguments.length;e<n;e++)t+=arguments[e].length;var i=Array(t),r=0;for(e=0;e<n;e++)for(var s=arguments[e],a=0,o=s.length;a<o;a++,r++)i[r]=s[a];return i}([t],At(e)).join("")})),function(){function t(){this.map={}}t.prototype.has=function(t){return void 0!==this.map[t]},t.prototype.get=function(t,e){var n=this.map[t];return void 0===n?e:n},t.prototype.set=function(t,e){this.map[t]=e},t.prototype.clear=function(){this.map={}},t.prototype.delete=function(t){delete this.map[t]},t.prototype.size=function(){return Object.keys(this.map).length}}();class Ct{constructor(t){this.options=Pt({},this.getDefaultOptions()),this.update(t)}getOptions(){return this.options}update(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.options=Pt({},this.options,t),this.rescale(t)}rescale(t){}}function Mt(t,e){return e-t?n=>(n-t)/(e-t):t=>.5}function Ot(t){for(var e=arguments.length,n=new Array(e>1?e-1:0),i=1;i<e;i++)n[i-1]=arguments[i];return n.reduce(((t,e)=>n=>t(e(n))),t)}var Tt=i(694),jt=i.n(Tt);function Nt(t,e,n){let i=n;return i<0&&(i+=1),i>1&&(i-=1),i<1/6?t+6*(e-t)*i:i<.5?e:i<2/3?t+(e-t)*(2/3-i)*6:t}function _t(t){const e=jt().get(t);if(!e)return null;const{model:n,value:i}=e;return"rgb"===n?i:"hsl"===n?function(t){const e=t[0]/360,n=t[1]/100,i=t[2]/100,r=t[3];if(0===n)return[255*i,255*i,255*i,r];const s=i<.5?i*(1+n):i+n-i*n,a=2*i-s;return[255*Nt(a,s,e+1/3),255*Nt(a,s,e),255*Nt(a,s,e-1/3),r]}(i):null}const zt=(t,e)=>n=>t*(1-n)+e*n,It=(t,e)=>"number"==typeof t&&"number"==typeof e?zt(t,e):"string"==typeof t&&"string"==typeof e?((t,e)=>{const n=_t(t),i=_t(e);return null===n||null===i?n?()=>t:()=>e:t=>{const e=new Array(4);for(let r=0;r<4;r+=1){const s=n[r],a=i[r];e[r]=s*(1-t)+a*t}const[r,s,a,o]=e;return"rgba(".concat(Math.round(r),", ").concat(Math.round(s),", ").concat(Math.round(a),", ").concat(o,")")}})(t,e):()=>t,Ft=(t,e)=>{const n=zt(t,e);return t=>Math.round(n(t))};function Gt(t){return!function(t){return void 0===t}(t)&&!function(t){return null===t}(t)&&!Number.isNaN(t)}const Ht=Math.sqrt(50),Vt=Math.sqrt(10),Wt=Math.sqrt(2);function Dt(t,e,n){const i=(e-t)/Math.max(0,n),r=Math.floor(Math.log(i)/Math.LN10),s=i/10**r;return r>=0?(s>=Ht?10:s>=Vt?5:s>=Wt?2:1)*10**r:-(10**-r)/(s>=Ht?10:s>=Vt?5:s>=Wt?2:1)}const Rt=function(t,e){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:5;const i=[t,e];let r,s=0,a=i.length-1,o=i[s],l=i[a];return l<o&&([o,l]=[l,o],[s,a]=[a,s]),r=Dt(o,l,n),r>0?(o=Math.floor(o/r)*r,l=Math.ceil(l/r)*r,r=Dt(o,l,n)):r<0&&(o=Math.ceil(o*r)/r,l=Math.floor(l*r)/r,r=Dt(o,l,n)),r>0?(i[s]=Math.floor(o/r)*r,i[a]=Math.ceil(l/r)*r):r<0&&(i[s]=Math.ceil(o*r)/r,i[a]=Math.floor(l*r)/r),i},Yt=(t,e,n)=>{const[i,r]=t,[s,a]=e;let o,l;return i<r?(o=Mt(i,r),l=n(s,a)):(o=Mt(r,i),l=n(a,s)),Ot(l,o)},qt=(t,e,n)=>{const i=Math.min(t.length,e.length)-1,r=new Array(i),s=new Array(i),a=t[0]>t[i],o=a?[...t].reverse():t,l=a?[...e].reverse():e;for(let t=0;t<i;t+=1)r[t]=Mt(o[t],o[t+1]),s[t]=n(l[t],l[t+1]);return e=>{const n=function(t,e,n,i,r){let s=1,a=i||t.length;const o=t=>t;for(;s<a;){const n=Math.floor((s+a)/2);o(t[n])>e?a=n:s=n+1}return s}(t,e,0,i)-1,a=r[n];return Ot(s[n],a)(e)}},Kt=(t,e,n,i)=>(Math.min(t.length,e.length)>2?qt:Yt)(t,e,i?Ft:n);class Zt extends Ct{getDefaultOptions(){return{domain:[0,1],range:[0,1],nice:!1,clamp:!1,round:!1,interpolate:zt,tickCount:5}}map(t){return Gt(t)?this.output(t):this.options.unknown}invert(t){return Gt(t)?this.input(t):this.options.unknown}nice(){if(!this.options.nice)return;const[t,e,n,...i]=this.getTickMethodOptions();this.options.domain=this.chooseNice()(t,e,n,...i)}getTicks(){const{tickMethod:t}=this.options,[e,n,i,...r]=this.getTickMethodOptions();return t(e,n,i,...r)}getTickMethodOptions(){const{domain:t,tickCount:e}=this.options;return[t[0],t[t.length-1],e]}chooseNice(){return Rt}rescale(){this.nice();const[t,e]=this.chooseTransforms();this.composeOutput(t,this.chooseClamp(t)),this.composeInput(t,e,this.chooseClamp(e))}chooseClamp(t){const{clamp:e,range:n}=this.options,i=this.options.domain.map(t),r=Math.min(i.length,n.length);return e?function(t,e){const n=e<t?e:t,i=t>e?t:e;return t=>Math.min(Math.max(n,t),i)}(i[0],i[r-1]):Et}composeOutput(t,e){const{domain:n,range:i,round:r,interpolate:s}=this.options,a=Kt(n.map(t),i,s,r);this.output=Ot(a,e,t)}composeInput(t,e,n){const{domain:i,range:r}=this.options,s=Kt(r,i.map(t),zt);this.input=Ot(e,n,s)}}const Ut=(t,e,n)=>{let i,r,s=t,a=e;if(s===a&&n>0)return[s];let o=Dt(s,a,n);if(0===o||!Number.isFinite(o))return[];if(o>0){s=Math.ceil(s/o),a=Math.floor(a/o),r=new Array(i=Math.ceil(a-s+1));for(let t=0;t<i;t+=1)r[t]=(s+t)*o}else{o=-o,s=Math.ceil(s*o),a=Math.floor(a*o),r=new Array(i=Math.ceil(a-s+1));for(let t=0;t<i;t+=1)r[t]=(s+t)/o}return r};class $t extends Zt{getDefaultOptions(){return{domain:[0,1],range:[0,1],unknown:void 0,nice:!1,clamp:!1,round:!1,interpolate:It,tickMethod:Ut,tickCount:5}}chooseTransforms(){return[Et,Et]}clone(){return new $t(this.options)}}function Xt(t,e){let{map:n,initKey:i}=t;const r=i(e);return n.has(r)?n.get(r):e}function Jt(t){return"object"==typeof t?t.valueOf():t}class Qt extends Map{constructor(t){if(super(),this.map=new Map,this.initKey=Jt,null!==t)for(const[e,n]of t)this.set(e,n)}get(t){return super.get(Xt({map:this.map,initKey:this.initKey},t))}has(t){return super.has(Xt({map:this.map,initKey:this.initKey},t))}set(t,e){return super.set(function(t,e){let{map:n,initKey:i}=t;const r=i(e);return n.has(r)?n.get(r):(n.set(r,e),e)}({map:this.map,initKey:this.initKey},t),e)}delete(t){return super.delete(function(t,e){let{map:n,initKey:i}=t;const r=i(e);return n.has(r)&&(e=n.get(r),n.delete(r)),e}({map:this.map,initKey:this.initKey},t))}}const te=Symbol("defaultUnknown");function ee(t,e,n){for(let i=0;i<e.length;i+=1)t.has(e[i])||t.set(n(e[i]),i)}function ne(t){const{value:e,from:n,to:i,mapper:r,notFoundReturn:s}=t;let a=r.get(e);if(void 0===a){if(s!==te)return s;a=n.push(e)-1,r.set(e,a)}return i[a%i.length]}function ie(t){return t instanceof Date?t=>"".concat(t):"object"==typeof t?t=>JSON.stringify(t):t=>t}class re extends Ct{getDefaultOptions(){return{domain:[],range:[],unknown:te}}constructor(t){super(t)}map(t){return 0===this.domainIndexMap.size&&ee(this.domainIndexMap,this.getDomain(),this.domainKey),ne({value:this.domainKey(t),mapper:this.domainIndexMap,from:this.getDomain(),to:this.getRange(),notFoundReturn:this.options.unknown})}invert(t){return 0===this.rangeIndexMap.size&&ee(this.rangeIndexMap,this.getRange(),this.rangeKey),ne({value:this.rangeKey(t),mapper:this.rangeIndexMap,from:this.getRange(),to:this.getDomain(),notFoundReturn:this.options.unknown})}rescale(t){const[e]=this.options.domain,[n]=this.options.range;if(this.domainKey=ie(e),this.rangeKey=ie(n),!this.rangeIndexMap)return this.rangeIndexMap=new Map,void(this.domainIndexMap=new Map);t&&!t.range||this.rangeIndexMap.clear(),(!t||t.domain||t.compare)&&(this.domainIndexMap.clear(),this.sortedDomain=void 0)}clone(){return new re(this.options)}getRange(){return this.options.range}getDomain(){if(this.sortedDomain)return this.sortedDomain;const{domain:t,compare:e}=this.options;return this.sortedDomain=e?[...t].sort(e):t,this.sortedDomain}}function se(t){return Math.round(1e12*t)/1e12}class ae extends re{getDefaultOptions(){return{domain:[],range:[0,1],align:.5,round:!1,paddingInner:0,paddingOuter:0,padding:0,unknown:te,flex:[]}}constructor(t){super(t)}clone(){return new ae(this.options)}getStep(t){return void 0===this.valueStep?1:"number"==typeof this.valueStep?this.valueStep:void 0===t?Array.from(this.valueStep.values())[0]:this.valueStep.get(t)}getBandWidth(t){return void 0===this.valueBandWidth?1:"number"==typeof this.valueBandWidth?this.valueBandWidth:void 0===t?Array.from(this.valueBandWidth.values())[0]:this.valueBandWidth.get(t)}getRange(){return this.adjustedRange}getPaddingInner(){const{padding:t,paddingInner:e}=this.options;return t>0?t:e}getPaddingOuter(){const{padding:t,paddingOuter:e}=this.options;return t>0?t:e}rescale(){super.rescale();const{align:t,domain:e,range:n,round:i,flex:r}=this.options,{adjustedRange:s,valueBandWidth:a,valueStep:o}=function(t){var e;const{domain:n}=t,i=n.length;if(0===i)return{valueBandWidth:void 0,valueStep:void 0,adjustedRange:[]};if(null===(e=t.flex)||void 0===e?void 0:e.length)return function(t){const{domain:e,range:n,paddingOuter:i,paddingInner:r,flex:s,round:a,align:o}=t,l=e.length,c=function(t,e){const n=e-t.length;return n>0?[...t,...new Array(n).fill(1)]:n<0?t.slice(0,e):t}(s,l),[u,h]=n,d=h-u,p=d/(2/l*i+1-1/l*r),f=p*r/l,g=p-l*f,m=function(t){const e=Math.min(...t);return t.map((t=>t/e))}(c),y=m.reduce(((t,e)=>t+e)),b=g/y,v=new Qt(e.map(((t,e)=>{const n=m[e]*b;return[t,a?Math.floor(n):n]}))),x=new Qt(e.map(((t,e)=>{const n=m[e]*b+f;return[t,a?Math.floor(n):n]}))),w=Array.from(x.values()).reduce(((t,e)=>t+e)),S=u+(d-(w-w/l*r))*o;let k=a?Math.round(S):S;const A=new Array(l);for(let t=0;t<l;t+=1){A[t]=se(k);const n=e[t];k+=x.get(n)}return{valueBandWidth:v,valueStep:x,adjustedRange:A}}(t);const{range:r,paddingOuter:s,paddingInner:a,round:o,align:l}=t;let c,u,h=r[0];const d=r[1]-h,p=2*s,f=i-a;c=d/Math.max(1,p+f),o&&(c=Math.floor(c)),h+=(d-c*(i-a))*l,u=c*(1-a),o&&(h=Math.round(h),u=Math.round(u));const g=new Array(i).fill(0).map(((t,e)=>h+e*c));return{valueStep:c,valueBandWidth:u,adjustedRange:g}}({align:t,range:n,round:i,flex:r,paddingInner:this.getPaddingInner(),paddingOuter:this.getPaddingOuter(),domain:e});this.valueStep=o,this.valueBandWidth=a,this.adjustedRange=s}}var oe=function(t){if("object"!=typeof t||null===t)return t;var e;if(g(t)){e=[];for(var n=0,i=t.length;n<i;n++)"object"==typeof t[n]&&null!=t[n]?e[n]=oe(t[n]):e[n]=t[n]}else for(var r in e={},t)"object"==typeof t[r]&&null!=t[r]?e[r]=oe(t[r]):e[r]=t[r];return e};const le=oe;class ce extends t.DisplayObject{constructor(e){let{style:n,...i}=e;super(at({},{type:"column"},{style:n,...i})),function(t,e,n){e=function(t){var e=function(t,e){if("object"!=typeof t||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var i=n.call(t,"string");if("object"!=typeof i)return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==typeof e?e:e+""}(e),e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n}(this,"columnsGroup",void 0),this.columnsGroup=new t.Group({name:"columns"}),this.appendChild(this.columnsGroup),this.render()}render(){const{columns:t}=this.attributes;G(this.columnsGroup).selectAll(".column").data(t.flat()).join((t=>t.append("rect").attr("className","column").each((function(t){this.attr(t)}))),(t=>t.each((function(t){this.attr(t)}))),(t=>t.remove()))}update(t){this.attr(y({},this.attributes,t)),this.render()}clear(){this.removeChildren()}}function ue(t,e,n){return e=function(t){var e=function(t,e){if("object"!=typeof t||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var i=n.call(t,"string");if("object"!=typeof i)return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==typeof e?e:e+""}(e),e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}class he extends t.DisplayObject{constructor(e){let{style:n,...i}=e;super(at({},{type:"lines"},{style:n,...i})),ue(this,"linesGroup",this.appendChild(new t.Group)),ue(this,"areasGroup",this.appendChild(new t.Group)),this.render()}render(){const{lines:t,areas:e}=this.attributes;t&&this.renderLines(t),e&&this.renderAreas(e)}clear(){this.linesGroup.removeChildren(),this.areasGroup.removeChildren()}update(t){this.attr(y({},this.attributes,t)),this.render()}renderLines(t){G(this.linesGroup).selectAll(".line").data(t).join((t=>t.append("path").attr("className","line").each((function(t){this.attr(t)}))),(t=>t.each((function(t){this.attr(t)}))),(t=>t.remove()))}renderAreas(t){G(this.linesGroup).selectAll(".area").data(t).join((t=>t.append("path").attr("className","area").each((function(t){this.attr(t)}))),(t=>t.each((function(t){this.style(t)}))),(t=>t.remove()))}}const de=function(t,e,n){return t<e?e:t>n?n:t},pe=function(t){return null!==t&&"function"!=typeof t&&isFinite(t.length)};var fe=function(t,e){if(t===e)return!0;if(!t||!e)return!1;if(U(t)||U(e))return!1;if(pe(t)||pe(e)){if(t.length!==e.length)return!1;for(var n=!0,i=0;i<t.length&&(n=fe(t[i],e[i]));i++);return n}if(h(t)||h(e)){var r=Object.keys(t),s=Object.keys(e);if(r.length!==s.length)return!1;for(n=!0,i=0;i<r.length&&(n=fe(t[r[i]],e[r[i]]));i++);return n}return!1};const ge=fe;function me(t,e){return[t[0]*e,t[1]*e]}function ye(t,e){return[t[0]+e[0],t[1]+e[1]]}function be(t,e){return[t[0]-e[0],t[1]-e[1]]}function ve(t,e){return[Math.min(t[0],e[0]),Math.min(t[1],e[1])]}function xe(t,e){return[Math.max(t[0],e[0]),Math.max(t[1],e[1])]}function we(t,e){return Math.sqrt((t[0]-e[0])**2+(t[1]-e[1])**2)}function Se(t){if(0===t[0]&&0===t[1])return[0,0];const e=Math.sqrt(t[0]**2+t[1]**2);return[t[0]/e,t[1]/e]}function ke(t,e,n){const[i,r]=t,[s,a]=e,o=i-s,l=r-a,c=Math.sin(n),u=Math.cos(n);return[o*u-l*c+s,o*c+l*u+a]}function Ae(t,e){return e?[t[1],-t[0]]:[-t[1],t[0]]}function Le(t){let e=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[[0,0],[1,1]];const n=!!(arguments.length>1&&void 0!==arguments[1]&&arguments[1]),i=[];for(let e=0,n=t.length;e<n;e+=2)i.push([t[e],t[e+1]]);const r=function(t,e,n,i){const r=[],s=!!i;let a,o,l,c,u,h=[1/0,1/0],d=[-1/0,-1/0];if(s){[h,d]=i;for(let e=0,n=t.length;e<n;e+=1){const n=t[e];h=ve(h,n),d=xe(d,n)}}for(let e=0,i=t.length;e<i;e+=1){const p=t[e];if(0!==e||n)if(e!==i-1||n){a=t[[e?e-1:i-1,e-1][n?0:1]],o=t[n?(e+1)%i:e+1];let f=[0,0];f=be(o,a),f=me(f,.4);let g=we(p,a),m=we(p,o);const y=g+m;0!==y&&(g/=y,m/=y);let b=me(f,-g),v=me(f,m);c=ye(p,b),l=ye(p,v),l=ve(l,xe(o,p)),l=xe(l,ve(o,p)),b=be(l,p),b=me(b,-g/m),c=ye(p,b),c=ve(c,xe(a,p)),c=xe(c,ve(a,p)),v=be(p,c),v=me(v,m/g),l=ye(p,v),s&&(c=xe(c,h),c=ve(c,d),l=xe(l,h),l=ve(l,d)),r.push(u),r.push(c),u=l}else c=p,r.push(u),r.push(c);else u=p}return n&&r.push(r.shift()),r}(i,0,n,e),s=i.length,a=[];let o,l,c;for(let t=0;t<s-1;t+=1)o=r[2*t],l=r[2*t+1],c=i[t+1],a.push(["C",o[0],o[1],l[0],l[1],c[0],c[1]]);return n&&(o=r[s],l=r[s+1],[c]=i,a.push(["C",o[0],o[1],l[0],l[1],c[0],c[1]])),a}function Pe(t){let e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];const n=e?t.length-1:0,i=t.map(((t,e)=>[e===n?"M":"L",...t]));return e?i.reverse():i}function Ee(t){let e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(t.length<=2)return Pe(t);const n=[],i=t.length;for(let r=0;r<i;r+=1){const s=e?t[i-r-1]:t[r];ge(s,n.slice(-2))||n.push(...s)}const r=Le(n,!1);return e?r.unshift(["M",...t[i-1]]):r.unshift(["M",...t[0]]),r}function Be(t,e,n){const i=le(t);return i.push(["L",e,n],["L",0,n],["Z"]),i}const Ce=function(t){if(g(t))return t.reduce((function(t,e){return Math.min(t,e)}),t[0])},Me=function(t,e){if(g(t)){for(var n,i=1/0,r=0;r<t.length;r++){var s=t[r],a=V(e)?e(s):s[e];a<i&&(n=s,i=a)}return n}},Oe=function(t){if(g(t))return t.reduce((function(t,e){return Math.max(t,e)}),t[0])},Te=function(t,e){if(g(t)){for(var n,i=-1/0,r=0;r<t.length;r++){var s=t[r],a=V(e)?e(s):s[e];a>i&&(n=s,i=a)}return n}};function je(t){return 0===t.length?[0,0]:[Ce(Me(t,(t=>Ce(t)||0))),Oe(Te(t,(t=>Oe(t)||0)))]}function Ne(t){const e=le(t),n=e[0].length,[i,r]=[Array(n).fill(0),Array(n).fill(0)];for(let t=0;t<e.length;t+=1){const s=e[t];for(let t=0;t<n;t+=1)s[t]>=0?(s[t]+=i[t],i[t]=s[t]):(s[t]+=r[t],r[t]=s[t])}return e}class _e extends x{get rawData(){const{data:t}=this.attributes;if(!t||0===(null==t?void 0:t.length))return[[]];const e=le(t);return O(e[0])?[e]:e}get data(){return this.attributes.isStack?Ne(this.rawData):this.rawData}get scales(){return this.createScales(this.data)}get baseline(){const{y:t}=this.scales,[e,n]=t.getOptions().domain||[0,0];return n<0?t.map(n):t.map(e<0?0:e)}get containerShape(){const{width:t,height:e}=this.attributes;return{width:t,height:e}}get linesStyle(){const{type:t,isStack:e,smooth:n}=this.attributes;if("line"!==t)throw new Error("linesStyle can only be used in line type");const i=B(this.attributes,"area"),r=B(this.attributes,"line"),{width:s}=this.containerShape,{data:a}=this;if(0===a[0].length)return{lines:[],areas:[]};const{x:o,y:l}=this.scales,c=function(t,e){const{x:n,y:i}=e;let[r,s]=i.getOptions().range||[0,0];return s>r&&([s,r]=[r,s]),t.map((t=>t.map(((t,e)=>[n.map(e),de(i.map(t),s,r)]))))}(a,{type:"line",x:o,y:l});let u=[];if(i){const{baseline:t}=this;u=e?n?function(t,e,n){const i=[];for(let r=t.length-1;r>=0;r-=1){const s=t[r],a=Ee(s);let o;if(0===r)o=Be(a,e,n);else{const e=Ee(t[r-1],!0),n=s[0];e[0][0]="L",o=[...a,...e,["M",...n],["Z"]]}i.push(o)}return i}(c,s,t):function(t,e,n){const i=[];for(let r=t.length-1;r>=0;r-=1){const s=Pe(t[r]);let a;if(0===r)a=Be(s,e,n);else{const e=Pe(t[r-1],!0);e[0][0]="L",a=[...s,...e,["Z"]]}i.push(a)}return i}(c,s,t):function(t,e,n,i){return t.map((t=>Be(e?Ee(t):Pe(t),n,i)))}(c,n,s,t)}return{lines:c.map(((t,e)=>({stroke:this.getColor(e),path:n?Ee(t):Pe(t),...r}))),areas:u.map(((t,e)=>({path:t,fill:this.getColor(e),...i})))}}get columnsStyle(){const t=B(this.attributes,"column"),{isStack:e,type:n,scale:i}=this.attributes;if("column"!==n)throw new Error("columnsStyle can only be used in column type");const{height:r}=this.containerShape;let{rawData:s}=this;if(!s)return{columns:[]};e&&(s=Ne(s));const{x:a,y:o}=this.createScales(s),[l,c]=je(s),u=new $t({domain:[0,c-(l>0?0:l)],range:[0,r*i]}),h=a.getBandWidth(),{rawData:d}=this;return{columns:s.map(((n,i)=>n.map(((n,r)=>{const l=h/s.length;return{fill:this.getColor(i),...t,...e?{x:a.map(r),y:o.map(n),width:h,height:u.map(d[i][r])}:{x:a.map(r)+l*i,y:n>=0?o.map(n):o.map(0),width:l,height:u.map(Math.abs(n))}}}))))}}constructor(t){super(t,{type:"line",width:200,height:20,isStack:!1,color:["#83daad","#edbf45","#d2cef9","#e290b3","#6f63f4"],smooth:!0,lineLineWidth:1,areaOpacity:0,isGroup:!1,columnLineWidth:1,columnStroke:"#fff",scale:1,spacing:0})}render(t,e){H(e,".container","rect").attr("className","container").node();const{type:n}=t,i="spark".concat(n),r="line"===n?this.linesStyle:this.columnsStyle;G(e).selectAll(".spark").data([n]).join((t=>t.append((t=>"line"===t?new he({className:i,style:r}):new ce({className:i,style:r}))).attr("className","spark ".concat(i))),(t=>t.update(r)),(t=>t.remove()))}getColor(t){const{color:e}=this.attributes;return g(e)?e[t%e.length]:V(e)?e.call(null,t):e}createScales(t){var e,n;const{type:i,scale:r,range:s=[],spacing:a}=this.attributes,{width:o,height:l}=this.containerShape,[c,u]=je(t),h=new $t({domain:[null!==(e=s[0])&&void 0!==e?e:c,null!==(n=s[1])&&void 0!==n?n:u],range:[l,l*(1-r)]});return"line"===i?{type:i,x:new $t({domain:[0,t[0].length-1],range:[0,o]}),y:h}:{type:i,x:new ae({domain:t[0].map(((t,e)=>e)),range:[0,o],paddingInner:a,paddingOuter:a/2,align:.5}),y:h}}}function ze(t){if(!t)return{enter:!1,update:!1,exit:!1};const e=["enter","update","exit"],n=Object.fromEntries(Object.entries(t).filter((t=>{let[n]=t;return!e.includes(n)})));return Object.fromEntries(e.map((e=>function(t){return"boolean"!=typeof t&&"enter"in t&&"update"in t&&"exit"in t}(t)?!1===t[e]?[e,!1]:[e,{...t[e],...n}]:[e,n])))}function Ie(t,e){t?t.finished.then(e):e()}function Fe(t,e){"update"in t?t.update(e):t.attr(e)}function Ge(t,e,n){return 0===e.length?null:n?t.animate(e,n):(Fe(t,{style:e.slice(-1)[0]}),null)}function He(t,n,i){const r={},s={};return Object.entries(n).forEach((n=>{let[i,a]=n;if(!e(a)){const e=t.style[i]||t.parsedStyle[i]||0;e!==a&&(r[i]=e,s[i]=a)}})),i?Ge(t,[r,s],{fill:"both",...i}):(Fe(t,s),null)}function Ve(t){const{canvas:e,touches:n,offsetX:i,offsetY:r}=t;if(e){const{x:t,y:n}=e;return[t,n]}if(n){const{clientX:t,clientY:e}=n[0];return[t,e]}return i&&r?[i,r]:[0,0]}function We(t,e){return+t.toPrecision(e)}function De(t){return t.toLocaleString()}function Re(t){return t.toExponential()}function Ye(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return Math.abs(t)<1e3?String(t):"".concat(We(t/1e3,e).toLocaleString(),"K")}!function(t,e,n){e=function(t){var e=function(t,e){if("object"!=typeof t||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var i=n.call(t,"string");if("object"!=typeof i)return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==typeof e?e:e+""}(e),e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n}(_e,"tag","sparkline");const qe=(t,e,n)=>t<0&&Number.isFinite(t)?e:n,Ke=(t,e,n)=>t>0&&Number.isFinite(t)?e:n,Ze=(t,e)=>t*e,Ue=(t,e)=>t/2+(e||0)/2,$e=(t,e)=>{const n=t=>"".concat(e,"-").concat(t),i=Object.fromEntries(Object.entries(t).map((t=>{let[e,i]=t;const r=n(i);return[e,{name:r,class:".".concat(r),id:"#".concat(r),toString:()=>r}]})));return Object.assign(i,{prefix:n}),i},Xe={fill:"#fff",lineWidth:1,radius:2,size:10,stroke:"#bfbfbf",strokeOpacity:1,zIndex:0},Je={fill:"#000",fillOpacity:.45,fontSize:12,textAlign:"center",textBaseline:"middle",zIndex:1},Qe={orientation:"horizontal",showLabel:!0,type:"start"},tn=$e({foreground:"foreground",handle:"handle",selection:"selection",sparkline:"sparkline",sparklineGroup:"sparkline-group",track:"track",brushArea:"brush-area"},"slider");function en(t,e,n){return e=function(t){var e=function(t,e){if("object"!=typeof t||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var i=n.call(t,"string");if("object"!=typeof i)return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==typeof e?e:e+""}(e),e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}const nn=$e({labelGroup:"label-group",label:"label",iconGroup:"icon-group",icon:"icon",iconRect:"icon-rect",iconLine:"icon-line"},"handle");class rn extends x{render(t,e){const{size:n=10,radius:i=n/4,orientation:r,...s}=t,a=n,o=2.4*a,l=G(e).maybeAppendByClassName(nn.iconRect,"rect").styles({...s,width:a,height:o,radius:i,x:-a/2,y:-o/2}),c=1/3*a,u=2/3*a,h=1/4*o,d=3/4*o;l.maybeAppendByClassName("".concat(nn.iconLine,"-1"),"line").styles({x1:c,x2:c,y1:h,y2:d,...s}),l.maybeAppendByClassName("".concat(nn.iconLine,"-2"),"line").styles({x1:u,x2:u,y1:h,y2:d,...s}),l.node().setOrigin(a/2,o/2),"vertical"===r?e.setLocalEulerAngles(90):e.setLocalEulerAngles(0)}}class sn extends x{constructor(t){super(t,Qe),en(this,"label",void 0),en(this,"icon",void 0)}renderLabel(t){const{showLabel:e}=this.attributes,{transform:n,...i}=B(this.attributes,"label"),[r,s]=M(i,[]),a=G(t).maybeAppendByClassName(nn.labelGroup,"g").styles(s),{text:o,...l}={...Je,...r};W(!!e,a,(t=>{this.label=t.maybeAppendByClassName(nn.label,"text").styles({...l,transform:n,text:"".concat(o)}),this.label.on("mousedown",(t=>{t.stopPropagation()})),this.label.on("touchstart",(t=>{t.stopPropagation()}))}))}renderIcon(t){const{orientation:e,type:n}=this.attributes,i={orientation:e,...Xe,...B(this.attributes,"icon")},{iconShape:r=(()=>new rn({style:i}))}=this.attributes;G(t).maybeAppendByClassName(nn.iconGroup,"g").selectAll(nn.icon.class).data([r]).join((t=>t.append("string"==typeof r?r:()=>r(n)).attr("className",nn.icon.name)),(t=>t.update(i)),(t=>t.remove()))}render(t,e){this.renderIcon(e),this.renderLabel(e)}}function an(t,e,n){return e=function(t){var e=function(t,e){if("object"!=typeof t||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var i=n.call(t,"string");if("object"!=typeof i)return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==typeof e?e:e+""}(e),e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}class on extends x{get values(){return this.attributes.values}set values(t){this.attributes.values=this.clampValues(t)}get sparklineStyle(){const{orientation:t}=this.attributes;if("horizontal"!==t)return null;const e=B(this.attributes,"sparkline");return{zIndex:0,...this.availableSpace,...e}}get shape(){const{trackLength:t,trackSize:e}=this.attributes,[n,i]=this.getOrientVal([[t,e],[e,t]]);return{width:n,height:i}}get availableSpace(){const{padding:t}=this.attributes,[e,n,i,r]=T(t),{width:s,height:a}=this.shape;return{x:r,y:e,width:s-(r+n),height:a-(e+i)}}constructor(e){super(e,{animate:{duration:100,fill:"both"},brushable:!0,formatter:t=>t.toString(),handleSpacing:2,orientation:"horizontal",padding:0,autoFitLabel:!0,scrollable:!0,selectionFill:"#5B8FF9",selectionFillOpacity:.45,selectionZIndex:2,showHandle:!0,showLabel:!0,slidable:!0,trackFill:"#416180",trackLength:200,trackOpacity:.05,trackSize:20,trackZIndex:-1,values:[0,1],type:"range",selectionType:"select",handleIconOffset:0,...C(Qe,"handle"),...C(Xe,"handleIcon"),...C(Je,"handleLabel")}),an(this,"range",[0,1]),an(this,"trackShape",void 0),an(this,"brushArea",void 0),an(this,"foregroundGroup",void 0),an(this,"selectionShape",void 0),an(this,"startHandle",void 0),an(this,"endHandle",void 0),an(this,"selectionStartPos",void 0),an(this,"selectionWidth",void 0),an(this,"prevPos",void 0),an(this,"target",void 0),an(this,"onDragStart",(t=>e=>{e.stopPropagation(),this.target=t,this.prevPos=this.getOrientVal(Ve(e));const{x:n,y:i}=this.availableSpace,{x:r,y:s}=this.getBBox();this.selectionStartPos=this.getRatio(this.prevPos-this.getOrientVal([n,i])-this.getOrientVal([+r,+s])),this.selectionWidth=0,document.addEventListener("pointermove",this.onDragging),document.addEventListener("pointerup",this.onDragEnd)})),an(this,"onDragging",(t=>{const{slidable:e,brushable:n,type:i}=this.attributes;t.stopPropagation();const r=this.getOrientVal(Ve(t)),s=r-this.prevPos;if(!s)return;const a=this.getRatio(s);switch(this.target){case"start":e&&this.setValuesOffset(a);break;case"end":e&&this.setValuesOffset(0,a);break;case"selection":e&&this.setValuesOffset(a,a);break;case"track":if(!n)return;this.selectionWidth+=a,"range"===i?this.innerSetValues([this.selectionStartPos,this.selectionStartPos+this.selectionWidth].sort(),!0):this.innerSetValues([0,this.selectionStartPos+this.selectionWidth],!0)}this.prevPos=r})),an(this,"onDragEnd",(()=>{document.removeEventListener("pointermove",this.onDragging),document.removeEventListener("pointermove",this.onDragging),document.removeEventListener("pointerup",this.onDragEnd),this.target="",this.updateHandlesPosition(!1)})),an(this,"onValueChange",(e=>{const{onChange:n,type:i}=this.attributes,r="range"===i?e:e[1],s="range"===i?this.getValues():this.getValues()[1],a=new t.CustomEvent("valuechange",{detail:{oldValue:r,value:s}});this.dispatchEvent(a),null==n||n(s)})),this.selectionStartPos=0,this.selectionWidth=0,this.prevPos=0,this.target=""}getValues(){return this.values}setValues(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[0,0],e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];this.attributes.values=t;const n=!1!==e&&this.attributes.animate;this.updateSelectionArea(n),this.updateHandlesPosition(n)}updateSelectionArea(t){const e=this.calcSelectionArea();this.foregroundGroup.selectAll(tn.selection.class).each((function(n,i){He(this,e[i],t)}))}updateHandlesPosition(t){this.attributes.showHandle&&(this.startHandle&&He(this.startHandle,this.getHandleStyle("start"),t),this.endHandle&&He(this.endHandle,this.getHandleStyle("end"),t))}innerSetValues(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[0,0],e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];const n=this.values,i=this.clampValues(t);this.attributes.values=i,this.setValues(i),e&&this.onValueChange(n)}renderTrack(t){const e=B(this.attributes,"track");this.trackShape=G(t).maybeAppendByClassName(tn.track,"rect").styles({...this.shape,...e})}renderBrushArea(t){const{brushable:e}=this.attributes;this.brushArea=G(t).maybeAppendByClassName(tn.brushArea,"rect").styles({fill:"transparent",cursor:e?"crosshair":"default",...this.shape})}renderSparkline(t){const{orientation:e}=this.attributes;W("horizontal"===e,G(t).maybeAppendByClassName(tn.sparklineGroup,"g"),(t=>{const e=this.sparklineStyle;t.maybeAppendByClassName(tn.sparkline,(()=>new _e({style:e}))).update(e)}))}renderHandles(){var t;const{showHandle:e,type:n}=this.attributes,i=e?"range"===n?["start","end"]:["end"]:[],r=this;null===(t=this.foregroundGroup)||void 0===t||t.selectAll(tn.handle.class).data(i.map((t=>({type:t}))),(t=>t.type)).join((t=>t.append((t=>{let{type:e}=t;return new sn({style:this.getHandleStyle(e)})})).each((function(t){let{type:e}=t;this.attr("class","".concat(tn.handle.name," ").concat(e,"-handle"));const n="".concat(e,"Handle");r[n]=this,this.addEventListener("pointerdown",r.onDragStart(e))}))),(t=>t.each((function(t){let{type:e}=t;this.update(r.getHandleStyle(e))}))),(t=>t.each((t=>{let{type:e}=t;const n="".concat(e,"Handle");r[n]=void 0})).remove()))}renderSelection(t){const{type:e,selectionType:n}=this.attributes;this.foregroundGroup=G(t).maybeAppendByClassName(tn.foreground,"g");const i=B(this.attributes,"selection"),r=t=>t.style("visibility",(t=>t.show?"visible":"hidden")).style("cursor",(t=>"select"===n?"grab":"invert"===n?"crosshair":"default")).styles(i),s=this;this.foregroundGroup.selectAll(tn.selection.class).data("value"===e?[]:this.calcSelectionArea().map(((t,e)=>({style:{...t},index:e,show:"select"===n?1===e:1!==e}))),(t=>t.index)).join((t=>t.append("rect").attr("className",tn.selection.name).call(r).each((function(t,e){1===e?(s.selectionShape=G(this),this.on("pointerdown",(t=>{this.attr("cursor","grabbing"),s.onDragStart("selection")(t)})),s.dispatchCustomEvent(this,"pointerenter","selectionMouseenter"),s.dispatchCustomEvent(this,"pointerleave","selectionMouseleave"),s.dispatchCustomEvent(this,"click","selectionClick"),this.addEventListener("pointerdown",(()=>{this.attr("cursor","grabbing")})),this.addEventListener("pointerup",(()=>{this.attr("cursor","pointer")})),this.addEventListener("pointerover",(()=>{this.attr("cursor","pointer")}))):this.on("pointerdown",s.onDragStart("track"))}))),(t=>t.call(r)),(t=>t.remove())),this.updateSelectionArea(!1),this.renderHandles()}render(t,e){this.renderTrack(e),this.renderSparkline(e),this.renderBrushArea(e),this.renderSelection(e)}clampValues(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:4;const[n,i]=this.range,[r,s]=this.getValues().map((t=>We(t,e))),a=Array.isArray(t)?t:[r,null!=t?t:s];let[o,l]=(a||[r,s]).map((t=>We(t,e)));if("value"===this.attributes.type)return[0,de(l,n,i)];o>l&&([o,l]=[l,o]);const c=l-o;return c>i-n?[n,i]:o<n?r===n&&s===l?[n,l]:[n,c+n]:l>i?s===i&&r===o?[o,i]:[i-c,i]:[o,l]}calcSelectionArea(t){const[e,n]=this.clampValues(t),{x:i,y:r,width:s,height:a}=this.availableSpace;return this.getOrientVal([[{y:r,height:a,x:i,width:e*s},{y:r,height:a,x:e*s+i,width:(n-e)*s},{y:r,height:a,x:n*s,width:(1-n)*s}],[{x:i,width:s,y:r,height:e*a},{x:i,width:s,y:e*a+r,height:(n-e)*a},{x:i,width:s,y:n*a,height:(1-n)*a}]])}calcHandlePosition(t){const{handleIconOffset:e}=this.attributes,{x:n,y:i,width:r,height:s}=this.availableSpace,[a,o]=this.clampValues(),l="start"===t?-e:e,c=("start"===t?a:o)*this.getOrientVal([r,s])+l;return{x:n+this.getOrientVal([c,r/2]),y:i+this.getOrientVal([s/2,c])}}inferTextStyle(t){const{orientation:e}=this.attributes;return"horizontal"===e?{}:"start"===t?{transform:"rotate(90)",textAlign:"start"}:"end"===t?{transform:"rotate(90)",textAlign:"end"}:{}}calcHandleText(t){const{type:e,orientation:n,formatter:i,autoFitLabel:r}=this.attributes,s=B(this.attributes,"handle"),a=B(s,"label"),{spacing:o}=s,l=this.getHandleSize(),c=this.clampValues(),u=i("start"===t?c[0]:c[1]),h=new w({style:{...a,...this.inferTextStyle(t),text:u}}),{width:d,height:p}=h.getBBox();if(h.destroy(),!r){if("value"===e)return{text:u,x:0,y:-p-o};const i=o+l+("horizontal"===n?d/2:0);return{text:u,["horizontal"===n?"x":"y"]:"start"===t?-i:i}}let f=0,g=0;const{width:m,height:y}=this.availableSpace,{x:b,y:v,width:x,height:S}=this.calcSelectionArea()[1],k=o+l;if("horizontal"===n){const e=k+d/2;f="start"===t?b-k-d>0?-e:e:m-b-x-k>d?e:-e}else{const e=p+k;g="start"===t?v-l>p?-e:k:y-(v+S)-l>p?e:-k}return{x:f,y:g,text:u}}getHandleLabelStyle(t){return{...B(this.attributes,"handleLabel"),...this.calcHandleText(t),...this.inferTextStyle(t)}}getHandleIconStyle(){const{handleIconShape:t}=this.attributes,e=B(this.attributes,"handleIcon");return{cursor:this.getOrientVal(["ew-resize","ns-resize"]),shape:t,size:this.getHandleSize(),...e}}getHandleStyle(t){const{showLabel:e,showLabelOnInteraction:n,orientation:i}=this.attributes,r=this.calcHandlePosition(t),s=this.calcHandleText(t);let a=e;return!e&&n&&(a=!!this.target),{...C(this.getHandleIconStyle(),"icon"),...C({...this.getHandleLabelStyle(t),...s},"label"),...r,orientation:i,showLabel:a,type:t,zIndex:3}}getHandleSize(){const{handleIconSize:t,width:e,height:n}=this.attributes;return t||Math.floor((this.getOrientVal([+n,+e])+4)/2.4)}getOrientVal(t){let[e,n]=t;const{orientation:i}=this.attributes;return"horizontal"===i?e:n}setValuesOffset(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];const{type:i}=this.attributes,[r,s]=this.getValues(),a=[r+("range"===i?t:0),s+e].sort();n?this.setValues(a):this.innerSetValues(a,!0)}getRatio(t){const{width:e,height:n}=this.availableSpace;return t/this.getOrientVal([e,n])}dispatchCustomEvent(e,n,i){e.on(n,(e=>{e.stopPropagation(),this.dispatchEvent(new t.CustomEvent(i,{detail:e}))}))}bindEvents(){this.addEventListener("wheel",this.onScroll);const t=this.brushArea;this.dispatchCustomEvent(t,"click","trackClick"),this.dispatchCustomEvent(t,"pointerenter","trackMouseenter"),this.dispatchCustomEvent(t,"pointerleave","trackMouseleave"),t.on("pointerdown",this.onDragStart("track"))}onScroll(t){const{scrollable:e}=this.attributes;if(e){const{deltaX:e,deltaY:n}=t,i=n||e,r=this.getRatio(i);this.setValuesOffset(r,r,!0)}}}function ln(t,e,n){return e=function(t){var e=function(t,e){if("object"!=typeof t||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var i=n.call(t,"string");if("object"!=typeof i)return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==typeof e?e:e+""}(e),e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}an(on,"tag","slider");class cn extends x{get padding(){const{padding:t}=this.attributes;return T(t)}constructor(e){super(e,{isRound:!0,orientation:"vertical",padding:[2,2,2,2],scrollable:!0,slidable:!0,thumbCursor:"default",trackSize:10,value:0}),ln(this,"slider",void 0),ln(this,"range",[0,1]),ln(this,"onValueChange",(e=>{const{value:n}=this.attributes;if(e===n)return;const i={detail:{oldValue:e,value:n}};this.dispatchEvent(new t.CustomEvent("scroll",i)),this.dispatchEvent(new t.CustomEvent("valuechange",i))})),ln(this,"onTrackClick",(t=>{const{slidable:e}=this.attributes;if(!e)return;const[n,i]=this.getLocalPosition(),[r,,,s]=this.padding,a=this.getOrientVal([n+s,i+r]),o=(this.getOrientVal(Ve(t))-a)/this.trackLength;this.setValue(o,!0)})),ln(this,"onThumbMouseenter",(e=>{this.dispatchEvent(new t.CustomEvent("thumbMouseenter",{detail:e.detail}))})),ln(this,"onTrackMouseenter",(e=>{this.dispatchEvent(new t.CustomEvent("trackMouseenter",{detail:e.detail}))})),ln(this,"onThumbMouseleave",(e=>{this.dispatchEvent(new t.CustomEvent("thumbMouseleave",{detail:e.detail}))})),ln(this,"onTrackMouseleave",(e=>{this.dispatchEvent(new t.CustomEvent("trackMouseleave",{detail:e.detail}))}))}get value(){const{value:t}=this.attributes,[e,n]=this.range;return de(t,e,n)}get trackLength(){const{viewportLength:t,trackLength:e=t}=this.attributes;return e}get availableSpace(){const{trackSize:t}=this.attributes,e=this.trackLength,[n,i,r,s]=this.padding,[a,o]=this.getOrientVal([[e,t],[t,e]]);return{x:s,y:n,width:+a-(s+i),height:+o-(n+r)}}get trackRadius(){const{isRound:t,trackSize:e}=this.attributes;return t?e/2:0}get thumbRadius(){const{isRound:t,thumbRadius:e}=this.attributes;if(!t)return 0;const{width:n,height:i}=this.availableSpace;return e||this.getOrientVal([i,n])/2}getValues(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.value;const{viewportLength:e,contentLength:n}=this.attributes,i=e/n,[r,s]=this.range,a=t*(s-r-i);return[a,a+i]}getValue(){return this.value}renderSlider(t){const{orientation:e,trackSize:n,padding:i,slidable:r}=this.attributes,s=B(this.attributes,"track"),a=B(this.attributes,"thumb"),o={brushable:!1,orientation:e,padding:i,selectionRadius:this.thumbRadius,showHandle:!1,slidable:r,trackLength:this.trackLength,trackRadius:this.trackRadius,trackSize:n,values:this.getValues(),...C(s,"track"),...C(a,"selection")};this.slider=G(t).maybeAppendByClassName("scrollbar",(()=>new on({style:o}))).update(o).node()}render(t,e){this.renderSlider(e)}setValue(t){let e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];const{value:n}=this.attributes,[i,r]=this.range;this.slider.setValues(this.getValues(de(t,i,r)),e),this.onValueChange(n)}bindEvents(){this.slider.addEventListener("trackClick",(t=>{t.stopPropagation(),this.onTrackClick(t.detail)})),this.onHover()}getOrientVal(t){const{orientation:e}=this.attributes;return"horizontal"===e?t[0]:t[1]}onHover(){this.slider.addEventListener("selectionMouseenter",this.onThumbMouseenter),this.slider.addEventListener("trackMouseenter",this.onTrackMouseenter),this.slider.addEventListener("selectionMouseleave",this.onThumbMouseleave),this.slider.addEventListener("trackMouseleave",this.onTrackMouseleave)}}function un(t,e){if(t.length<=e)return t;const n=Math.floor(t.length/e),i=[];for(let e=0;e<t.length;e+=n)i.push(t[e]);return i}ln(cn,"tag","scrollbar");const hn={data:[],animate:{enter:!1,update:{duration:100,easing:"ease-in-out-sine",fill:"both"},exit:{duration:100,fill:"both"}},showArrow:!0,showGrid:!0,showLabel:!0,showLine:!0,showTick:!0,showTitle:!0,showTrunc:!1,dataThreshold:100,lineLineWidth:1,lineStroke:"black",crossPadding:10,titleFill:"black",titleFontSize:12,titlePosition:"lb",titleSpacing:0,titleTextAlign:"center",titleTextBaseline:"middle",lineArrow:()=>new t.Path({style:{path:[["M",10,10],["L",-10,0],["L",10,-10],["L",0,0],["L",10,10],["Z"]],anchor:"0.5 0.5",fill:"black",transformOrigin:"center"}}),labelAlign:"parallel",labelDirection:"positive",labelFontSize:12,labelSpacing:0,gridConnect:"line",gridControlAngles:[],gridDirection:"positive",gridLength:0,gridType:"segment",lineArrowOffset:15,lineArrowSize:10,tickDirection:"positive",tickLength:5,tickLineWidth:1,tickStroke:"black",labelOverlap:[]},dn=(at({},hn,{style:{type:"arc"}}),at({},hn,{style:{}}),$e({mainGroup:"main-group",gridGroup:"grid-group",grid:"grid",lineGroup:"line-group",line:"line",tickGroup:"tick-group",tick:"tick",tickItem:"tick-item",labelGroup:"label-group",label:"label",labelItem:"label-item",titleGroup:"title-group",title:"title",lineFirst:"line-first",lineSecond:"line-second"},"axis"));function pn(t){return t*Math.PI/180}function fn(t){return Number((180*t/Math.PI).toPrecision(5))}function gn(t,e){return V(t)?t(...e):t}function mn(t,e){return t.style.opacity||(t.style.opacity=1),He(t,{opacity:0},e)}const yn=["$el","anchor","cx","cy","d","defX","defY","dx","dy","fill","fillOpacity","filter","fontFamily","fontSize","fontStyle","fontVariant","fontWeight","height","img","increasedLineWidthForHitTesting","innerHTML","isBillboard","billboardRotation","isSizeAttenuation","isClosed","isOverflowing","leading","letterSpacing","lineDash","lineHeight","lineWidth","markerEnd","markerEndOffset","markerMid","markerStart","markerStartOffset","maxLines","metrics","miterLimit","offsetX","offsetY","opacity","path","points","r","radius","rx","ry","shadowColor","src","stroke","strokeOpacity","text","textAlign","textBaseline","textDecorationColor","textDecorationLine","textDecorationStyle","textOverflow","textPath","textPathSide","textPathStartOffset","transform","transformOrigin","visibility","width","wordWrap","wordWrapWidth","x","x1","x2","y","y1","y2","z1","z2","zIndex"];function bn(t){return yn.includes(t)}function vn(t){const e={};for(const n in t)bn(n)&&(e[n]=t[n]);return e}const xn=$e({lineGroup:"line-group",line:"line",regionGroup:"region-group",region:"region"},"grid");function wn(t){return t.reduce(((t,e,n)=>(t.push([0===n?"M":"L",...e]),t)),[])}function Sn(t,e,n){return"surround"===e.type?function(t,e,n){const{connect:i="line",center:r}=e;if("line"===i)return wn(t);if(!r)return[];const s=we(t[0],r),a=n?0:1;return t.reduce(((t,e,n)=>(0===n?t.push(["M",...e]):t.push(["A",s,s,0,0,a,...e]),t)),[])}(t,e,n):wn(t)}function kn(t,e,n){const{type:i,connect:r,center:s,closed:a}=n,o=a?[["Z"]]:[],[l,c]=[Sn(t,n),Sn(e.slice().reverse(),n,!0)],[u,h]=[t[0],e.slice(-1)[0]],d=(t,e)=>[l,t,c,e,o].flat();if("line"===r||"surround"===i)return d([["L",...h]],[["L",...u]]);if(!s)throw new Error("Arc grid need to specified center");const[p,f]=[we(h,s),we(u,s)];return d([["A",p,p,0,0,1,...h],["L",...h]],[["A",f,f,0,0,0,...u],["L",...u]])}class An extends x{render(t,e){const{type:n,center:i,areaFill:r,closed:s,...a}=t,o=function(t){const{data:e=[],closed:n}=t;return n?e.map((t=>{const{points:e}=t,[n]=e;return{...t,points:[...e,n]}})):e}(t),l=G(e).maybeAppendByClassName(xn.lineGroup,"g"),c=G(e).maybeAppendByClassName(xn.regionGroup,"g"),u=function(t,e,n,i){const{animate:r,isBillboard:s}=n,a=e.map(((t,e)=>({id:t.id||"grid-line-".concat(e),path:Sn(t.points,n)})));return t.selectAll(xn.line.class).data(a,(t=>t.id)).join((t=>t.append("path").each((function(t,e){const n=gn(vn({path:t.path,...i}),[t,e,a]);this.attr({class:xn.line.name,stroke:"#D9D9D9",lineWidth:1,lineDash:[4,4],isBillboard:s,...n})}))),(t=>t.transition((function(t,e){return He(this,gn(vn({path:t.path,...i}),[t,e,a]),r.update)}))),(t=>t.transition((function(){const t=mn(this,r.exit);return Ie(t,(()=>this.remove())),t})))).transitions()}(l,o,t,a),h=function(t,e,n){const{animate:i,connect:r,areaFill:s}=n;if(e.length<2||!s||!r)return[];const a=Array.isArray(s)?s:[s,"transparent"],o=t=>a[t%a.length],l=[];for(let t=0;t<e.length-1;t++){const[i,r]=[e[t].points,e[t+1].points],s=kn(i,r,n);l.push({path:s,fill:o(t)})}return t.selectAll(xn.region.class).data(l,((t,e)=>e)).join((t=>t.append("path").each((function(t,e){const n=gn(t,[t,e,l]);this.attr(n)})).attr("className",xn.region.name)),(t=>t.transition((function(t,e){return He(this,gn(t,[t,e,l]),i.update)}))),(t=>t.transition((function(){const t=mn(this,i.exit);return Ie(t,(()=>this.remove())),t})))).transitions()}(c,o,t);return[...u,...h]}}const Ln=function(t,e,n){for(var i=0,r=U(e)?e.split("."):e;t&&i<r.length;)t=t[r[i++]];return void 0===t||i<r.length?n:t},Pn=function(t,e){return function(n){return t*(1-n)+e*n}};function En(t,e){const n=e?e.length:0,i=t?Math.min(n,t.length):0;return function(r){const s=new Array(i),a=new Array(n);let o=0;for(o=0;o<i;++o)s[o]=Cn(t[o],e[o]);for(;o<n;++o)a[o]=e[o];for(o=0;o<i;++o)a[o]=s[o](r);return a}}function Bn(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const n={},i={};return Object.entries(e).forEach((e=>{let[r,s]=e;r in t?n[r]=Cn(t[r],s):i[r]=s})),function(t){return Object.entries(n).forEach((e=>{let[n,r]=e;return i[n]=r(t)})),i}}function Cn(t,e){return"number"==typeof t&&"number"==typeof e?Pn(t,e):Array.isArray(t)&&Array.isArray(e)?En(t,e):"object"==typeof t&&"object"==typeof e?Bn(t,e):e=>t}function Mn(t,e,n,i){if(!i)return t.attr("__keyframe_data__",n),null;const{duration:r=0}=i,s=Cn(e,n),a=Math.ceil(+r/16),o=new Array(a).fill(0).map(((t,e,n)=>({__keyframe_data__:s(e/(n.length-1))})));return t.animate(o,{fill:"both",...i})}function On(t){return"function"==typeof t?t():U(t)||O(t)?new w({style:{text:String(t)}}):t}function Tn(t,e){let n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];const{width:i,height:r}=t.getBBox(),s=e/Math.max(i,r);return n&&t.scale(s),s}function jn(t,e){const n={},i=Array.isArray(e)?e:[e];for(const e in t)i.includes(e)||(n[e]=t[e]);return n}function Nn(t,e){return Object.fromEntries(Object.entries(t).map((t=>{let[n,i]=t;return[n,gn(i,e)]})))}function _n(t,e){return e&&V(e)?t.filter(e):t}function zn(t,e){const{startAngle:n,endAngle:i}=e;return(i-n)*t+n}function In(t,e){if("linear"===e.type){const{startPos:[t,n],endPos:[i,r]}=e,[s,a]=[i-t,r-n];return Se([s,a])}const n=pn(zn(t,e));return[-Math.sin(n),Math.cos(n)]}function Fn(t,e,n){return Ae(In(t,n),"positive"!==e)}function Gn(t,e){return Fn(t,e.labelDirection,e)}function Hn(t,e){return"linear"===e.type?function(t,e){const{startPos:[n,i],endPos:[r,s]}=e,[a,o]=[r-n,s-i];return[n+a*t,i+o*t]}(t,e):function(t,e){const{radius:n,center:[i,r]}=e,s=pn(zn(t,e));return[i+n*Math.cos(s),r+n*Math.sin(s)]}(t,e)}function Vn(t){return 0===In(0,t)[1]}function Wn(t){return 0===In(0,t)[0]}function Dn(t,e){return e-t==360}function Rn(t,e,n,i,r){const s=e-t,[a,o]=[r,r],[l,c]=[pn(t),pn(e)],u=t=>[n+r*Math.cos(t),i+r*Math.sin(t)],[h,d]=u(l),[p,f]=u(c);if(Dn(t,e)){const t=(c+l)/2,[e,n]=u(t);return[["M",h,d],["A",a,o,0,1,0,e,n],["A",a,o,0,1,0,p,f]]}const g=s>180?1:0,m=t>e?0:1;return"M".concat(h,",").concat(d,",A").concat(a,",").concat(o,",0,").concat(g,",").concat(m,",").concat(p,",").concat(f)}function Yn(t){const[[e,n],[i,r]]=t;return{x1:e,y1:n,x2:i,y2:r}}function qn(t,e,n){const{type:i}=e;let r;const s=B(e,"line");return r="linear"===i?function(t,e,n,i){const{showTrunc:r,startPos:s,endPos:a,truncRange:o,lineExtension:l}=e,[[c,u],[h,d]]=[s,a],[p,f,g,m]=l?function(t,e){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[0,0];const[[i,r],[s,a],[o,l]]=[t,e,n],[c,u]=[s-i,a-r],h=Math.sqrt(c**2+u**2),[d,p]=[-o/h,l/h];return[d*c,d*u,p*c,p*u]}(s,a,l):new Array(4).fill(0),y=e=>t.selectAll(dn.line.class).data(e,((t,e)=>e)).join((t=>t.append("line").attr("className",(t=>"".concat(dn.line.name," ").concat(t.className))).styles(n).transition((function(t){return He(this,Yn(t.line),!1)}))),(t=>t.styles(n).transition((function(t){let{line:e}=t;return He(this,Yn(e),i.update)}))),(t=>t.remove())).transitions();if(!r||!o)return y([{line:[[c+p,u+f],[h+g,d+m]],className:dn.line.name}]);const[b,v]=o,x=h-c,w=d-u,[S,k]=[c+x*b,u+w*b],[A,L]=[c+x*v,u+w*v],P=y([{line:[[c+p,u+f],[S,k]],className:dn.lineFirst.name},{line:[[A,L],[h+g,d+m]],className:dn.lineSecond.name}]);return function(t,e){let{truncRange:n,truncShape:i,lineExtension:r}=e}(0,e),P}(t,e,jn(s,"arrow"),n):function(t,e,n,i){const{startAngle:r,endAngle:s,center:a,radius:o}=e;return t.selectAll(dn.line.class).data([{path:Rn(r,s,...a,o)}],((t,e)=>e)).join((t=>t.append("path").attr("className",dn.line.name).styles(e).styles({path:t=>t.path})),(t=>t.transition((function(){const t=Mn(this,function(t){const{startAngle:e,endAngle:n,center:i,radius:r}=t.attributes;return[e,n,...i,r]}(this),[r,s,...a,o],i.update);if(t){const e=()=>{const t=Ln(this.attributes,"__keyframe_data__");this.style.path=Rn(...t)};t.onframe=e,t.onfinish=e}return t})).styles(e)),(t=>t.remove())).styles(n).transitions()}(t,e,jn(s,"arrow"),n),function(t,e,n,i){const{showArrow:r,showTrunc:s,lineArrow:a,lineArrowOffset:o,lineArrowSize:l}=n;let c;if(c="arc"===e?t.select(dn.line.class):s?t.select(dn.lineSecond.class):t.select(dn.line.class),!r||!a||"arc"===n.type&&Dn(n.startAngle,n.endAngle)){const t=c.node();return void(t&&(t.style.markerEnd=void 0))}const u=On(a);u.attr(i),Tn(u,l,!0),c.style("markerEnd",u).style("markerEndOffset",-o)}(t,i,e,s),r}function Kn(t){const{type:e,gridCenter:n}=t;return"linear"===e?n:n||t.center}function Zn(t,e,n,i){const r=B(n,"grid"),{type:s,areaFill:a}=r,o=Kn(n),l=_n(e,n.gridFilter),c="segment"===s?function(t,e){const{gridLength:n}=e;return t.map(((t,i)=>{let{value:r}=t;const[s,a]=Hn(r,e),[o,l]=me(function(t,e){return Fn(t,e.gridDirection,e)}(r,e),n);return{id:i,points:[[s,a],[s+o,a+l]]}}))}(l,n):function(t,e){const n=e.gridControlAngles,i=Kn(e);if(!i)throw new Error("grid center is not provide");if(t.length<2)throw new Error("Invalid grid data");if(!n||0===n.length)throw new Error("Invalid gridControlAngles");const[r,s]=i;return t.map(((t,i)=>{let{value:a}=t;const[o,l]=Hn(a,e),[c,u]=[o-r,l-s],h=[];return n.forEach((t=>{const e=pn(t),[n,i]=[Math.cos(e),Math.sin(e)],a=c*n-u*i+r,o=c*i+u*n+s;h.push([a,o])})),{points:h,id:i}}))}(l,n),u={...r,center:o,areaFill:V(a)?l.map(((t,e)=>gn(a,[t,e,l]))):a,animate:i,data:c};return t.selectAll(dn.grid.class).data([1]).join((t=>t.append((()=>new An({style:u}))).attr("className",dn.grid.name)),(t=>t.transition((function(){return this.update(u)}))),(t=>t.remove())).transitions()}function Un(t,e,n){return!((arguments.length>3&&void 0!==arguments[3]&&!arguments[3]||t!==e)&&!(arguments.length>4&&void 0!==arguments[4]&&arguments[4]&&t===n))||t>e&&t<n}let $n,Xn;function Jn(t){Xn=t}const Qn=function(t,e,n){if(void 0===n&&(n=128),!V(t))throw new TypeError("Expected a function");var i=function(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];var s=e?e.apply(this,n):n[0],a=i.cache;if(a.has(s))return a.get(s);var o=t.apply(this,n);return a.set(s,o),o};return i.cache=function(t){var e,n,i,r=t||1;function s(t,s){++e>r&&(i=n,a(1),++e),n[t]=s}function a(t){e=0,n=Object.create(null),t||(i=Object.create(null))}return a(),{clear:a,has:function(t){return void 0!==n[t]||void 0!==i[t]},get:function(t){var e=n[t];return void 0!==e?e:void 0!==(e=i[t])?(s(t,e),e):void 0},set:function(t,e){void 0!==n[t]?n[t]=e:s(t,e)}}}(n),i}(((e,n)=>{const{fontSize:i,fontFamily:r,fontWeight:s,fontStyle:a,fontVariant:o}=n;return Xn?Xn(e,i):($n||($n=t.runtime.offscreenCanvasCreator.getOrCreateContext(void 0)),$n.font=[a,o,s,"".concat(i,"px"),r].join(" "),$n.measureText(e).width)}),((t,e)=>[t,Object.values(e||ti(t)).join()].join("")),4096),ti=t=>{const e=t.style.fontFamily||"sans-serif",n=t.style.fontWeight||"normal",i=t.style.fontStyle||"normal",r=t.style.fontVariant;let s=t.style.fontSize;return s="object"==typeof s?s.value:s,{fontSize:s,fontFamily:e,fontWeight:n,fontStyle:i,fontVariant:r}};function ei(t){return"text"===t.nodeName?t:"g"===t.nodeName&&1===t.children.length&&"text"===t.children[0].nodeName?t.children[0]:null}function ni(t,e){const n=ei(t);n&&n.attr(e)}function ii(t,e){ni(t,{wordWrap:!0,wordWrapWidth:e,maxLines:1,textOverflow:arguments.length>2&&void 0!==arguments[2]?arguments[2]:"..."})}function ri(t,e){ni(t,{wordWrap:!0,wordWrapWidth:e,maxLines:arguments.length>2&&void 0!==arguments[2]?arguments[2]:2,textBaseline:arguments.length>3&&void 0!==arguments[3]?arguments[3]:"top"})}function si(t,e,n){const{width:i,height:r}=t.getBBox(),[s,a]=[e,n].map(((t,e)=>{var n;return t.includes("%")?parseFloat((null===(n=t.match(/[+-]?([0-9]*[.])?[0-9]+/))||void 0===n?void 0:n[0])||"0")/100*(0===e?i:r):t}));return[s,a]}function ai(t,e){if(e)try{const n=/translate\(([+-]*[\d]+[%]*),[ ]*([+-]*[\d]+[%]*)\)/g,i=e.replace(n,((e,n,i)=>"translate(".concat(si(t,n,i),")")));t.attr("transform",i)}catch(t){}}const oi=t=>void 0!==t&&null!=t&&!Number.isNaN(t);function li(t,e,n){return e=function(t){var e=function(t,e){if("object"!=typeof t||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var i=n.call(t,"string");if("object"!=typeof i)return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==typeof e?e:e+""}(e),e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}class ci{constructor(t,e,n,i){li(this,"x1",void 0),li(this,"y1",void 0),li(this,"x2",void 0),li(this,"y2",void 0),this.set(t,e,n,i)}get left(){return this.x1}get top(){return this.y1}get right(){return this.x2}get bottom(){return this.y2}get width(){return this.defined("x2")&&this.defined("x1")?this.x2-this.x1:void 0}get height(){return this.defined("y2")&&this.defined("y1")?this.y2-this.y1:void 0}rotatedPoints(t,e,n){const{x1:i,y1:r,x2:s,y2:a}=this,o=Math.cos(t),l=Math.sin(t),c=e-e*o+n*l,u=n-e*l-n*o;return[[o*i-l*a+c,l*i+o*a+u],[o*s-l*a+c,l*s+o*a+u],[o*i-l*r+c,l*i+o*r+u],[o*s-l*r+c,l*s+o*r+u]]}set(t,e,n,i){return n<t?(this.x2=t,this.x1=n):(this.x1=t,this.x2=n),i<e?(this.y2=e,this.y1=i):(this.y1=e,this.y2=i),this}defined(t){return this[t]!==Number.MAX_VALUE&&this[t]!==-Number.MAX_VALUE}}function ui(t,e){const n=t.getEulerAngles()||0;t.setEulerAngles(0);const{min:[i,r],max:[s,a]}=t.getLocalBounds(),{width:o,height:l}=hi(t);let c=l,u=0,h=0,d=i,p=r;const f=ei(t);if(f){c-=1.5;const t=f.style.textAlign,e=f.style.textBaseline;"center"===t?d=(i+s)/2:"right"!==t&&"end"!==t||(d=s),"middle"===e?p=(r+a)/2:"bottom"===e&&(p=a)}const[g=0,m=0,y=g,b=m]=T(e),v=new ci((u+=i)-b,(h+=r)-g,u+o+m,h+c+y);return t.setEulerAngles(n),v.rotatedPoints(pn(n),d,p)}function hi(t){return t.__bbox__?t.__bbox__:t.getBBox()}function di(t,e){return e[0]<=Math.max(t[0][0],t[1][0])&&e[0]<=Math.min(t[0][0],t[1][0])&&e[1]<=Math.max(t[0][1],t[1][1])&&e[1]<=Math.min(t[0][1],t[1][1])}function pi(t,e,n){const i=(e[1]-t[1])*(n[0]-e[0])-(e[0]-t[0])*(n[1]-e[1]);return 0===i?0:i<0?2:1}function fi(t,e){const n=pi(t[0],t[1],e[0]),i=pi(t[0],t[1],e[1]),r=pi(e[0],e[1],t[0]),s=pi(e[0],e[1],t[1]);return n!==i&&r!==s||!(0!==n||!di(t,e[0]))||!(0!==i||!di(t,e[1]))||!(0!==r||!di(e,t[0]))||!(0!==s||!di(e,t[1]))}function gi(t,e){return[[t[0],t[1],t[2],t[3]],[t[2],t[3],t[4],t[5]],[t[4],t[5],t[6],t[7]],[t[6],t[7],t[0],t[1]]].some((t=>function(t,e){const[n,i,r,s]=t,[a,o,l,c]=e,u=r-n,h=s-i,d=l-a,p=c-o,f=u*p-d*h;if(0===f)return!1;const g=f>0,m=n-a,y=i-o,b=u*y-h*m;if(b<0===g)return!1;const v=d*y-p*m;return v<0!==g&&b>f!==g&&v>f!==g}(e,t)))}function mi(t,e,n){const{crossPadding:i}=e,r=new Set;let s=null;const a=function(t,e){const{type:n,labelDirection:i,crossSize:r}=t;if(!r)return!1;if("arc"===n){const{center:n,radius:s}=t,[a,o]=n,l="negative"===i?0:r,c=-s-l,u=s+l,[h,d,p,f]=T(e);return new ci(a+c-f,o+c-h,a+u+d,o+u+p)}const{startPos:[s,a],endPos:[o,l]}=t,[c,u,h,d]=Wn(t)?[-e,0,e,0]:[0,e,0,-e],p=me(Gn(0,t),r),f=new ci(s,a,o,l);return f.x1+=d,f.y1+=c,f.x2+=u+p[0],f.y2+=h+p[1],f}(e,i),o=t=>!a||function(t,e,n){const{x1:i,x2:r,y1:s,y2:a}=t;return o=[[i,s],[r,s],[r,a],[i,a]],ui(e,void 0).every((t=>function(t,e){const n=t.length;if(n<3)return!1;const i=[e,[9999,e[1]]];let r=0,s=0;do{const a=[t[s],t[(s+1)%n]];if(fi(a,i)){if(0===pi(a[0],e,a[1]))return di(a,e);r++}s=(s+1)%n}while(0!==s);return!!(1&r)}(o,t)));var o}(a,t);for(const e of t)o(e)?s&&(c=e,(l=s)&&function(t,e,n){const i=ui(t,n).flat(1),r=ui(e,n).flat(1),s=[[i[0],i[1],i[2],i[3]],[i[0],i[1],i[4],i[5]],[i[4],i[5],i[6],i[7]],[i[2],i[3],i[6],i[7]]];for(const t of s)if(gi(r,t))return!0;return!1}(l,c,T(n)))?(r.add(s),r.add(e)):s=e:r.add(e);var l,c;return Array.from(r)}function yi(t){let n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return e(t)?0:"number"==typeof t?t:Math.floor(Qn(t,n))}function bi(t){const e=t&&t.getRenderBounds();if(!e)return{width:0,height:0};const n=e.getMax(),i=e.getMin();return{width:n[0]-i[0],height:n[1]-i[1]}}function vi(t){const{min:e,max:n}=t.getLocalBounds(),[[i,r],[s,a]]=[e,n];return{x:i,y:r,width:s-i,height:a-r,left:i,bottom:a,top:r,right:s}}function xi(t,e){const n=G(t).append("text").node();return n.attr({...e,visibility:"hidden"}),n}function wi(t,e){const[n,i]=t,[r,s]=e;return n!==r&&i===s}function Si(t,e){const[n,i]=t,[r,s]=e;return n===r&&i!==s}function ki(t,e){const{attributes:n}=e;for(const[e,i]of Object.entries(n))"id"!==e&&"className"!==e&&t.attr(e,i)}const Ai=(t,e)=>{let{seq:n=2}=e;return t.filter(((t,e)=>!(e%n&&(a(t),1))))},Li=new Map([["hide",function(t,e,n,i){const r=t.length,{keepHeader:s,keepTail:a}=e;if(r<=1||2===r&&s&&a)return;const o=Ai,l=t=>(t.forEach(i.show),t);let c=2;const u=t.slice();let h=t.slice();const d=Math.min(1,...t.map((t=>hi(t).width)));if("linear"===n.type&&(Vn(n)||Wn(n))){const e=vi(t[0]).left,n=vi(t[r-1]).right,i=Math.abs(n-e)||1;c=Math.max(Math.floor(r*d/i),c)}let p,f;for(s&&(p=u.splice(0,1)[0]),a&&(f=u.splice(-1,1)[0],u.reverse()),l(u);c<t.length&&mi((g=f?[f,...h,p]:[p,...h],g.filter(oi)),n,null==e?void 0:e.margin).length;)(f&&!p&&c%2==0||f&&p)&&u.splice(0,1).forEach(i.hide),h=o(l(u),{seq:c}),c++;var g}],["rotate",function(t,e,n,i){const{optionalAngles:r=[0,45,90],margin:s,recoverWhenFailed:a=!0}=e,o=t.map((t=>t.getLocalEulerAngles())),l=e=>t.forEach(((t,n)=>{const r=Array.isArray(e)?e[n]:e;i.rotate(t,+r)}));for(const e of r)if(l(e),mi(t,n,s).length<1)return;a&&l(o)}],["ellipsis",function(t,n,i,r){if(t.length<=1)return;const{suffix:s="...",minLength:a,maxLength:o=1/0,step:l=" ",margin:c=[0,0,0,0]}=n,u=ti(r.getTextShape(t[0])),h=yi(l,u),d=a?yi(a,u):h;let p=yi(o,u);(e(p)||p===1/0)&&(p=Math.max.apply(null,t.map((t=>hi(t).width))));let f=t.slice();const[g=0,m=0,y=g,b=m]=c;for(let e=p;e>d+h;e-=h)if(f.forEach((t=>{r.ellipsis(r.getTextShape(t),e,s)})),f=mi(t,i,c),f.length<1)return}],["wrap",function(t,e,n,i){const{wordWrapWidth:r=50,maxLines:s=3,recoverWhenFailed:a=!0,margin:o=[0,0,0,0]}=e,l=t.map((t=>t.attr("maxLines")||1)),c=Math.min(...l),u=function(t){const{type:e,labelDirection:n}=t;return"linear"===e&&Vn(t)?"negative"===n?"bottom":"top":"middle"}(n),h=e=>t.forEach(((t,n)=>{const s=Array.isArray(e)?e[n]:e;i.wrap(t,r,s,u)}));if(!(c>s)){for(let e=c;e<=s;e++)if(h(e),mi(t,n,o).length<1)return;a&&h(l)}}]]);function Pi(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];return e.reduce(((t,e)=>t*("positive"===e?-1:1)),1)}function Ei(t){let e=t;for(;e<0;)e+=360;return Math.round(e%360)}function Bi(t,e){const[n,i]=t,[r,s]=e,[a,o]=[n*r+i*s,n*s-i*r];return Math.atan2(o,a)}function Ci(t,e,n){const{type:i,labelAlign:r}=n,s=Gn(t,n),a=Ei(e),o=Ei(fn(Bi([1,0],s)));let l="center",c="middle";return"linear"===i?[90,270].includes(o)&&0===a?(l="center",c=1===s[1]?"top":"bottom"):o%180||![90,270].includes(a)?0===o?(Un(a,0,90,!1,!0)||Un(a,0,90)||Un(a,270,360))&&(l="start"):90===o?Un(a,0,90,!1,!0)?l="start":(Un(a,90,180)||Un(a,270,360))&&(l="end"):270===o?Un(a,0,90,!1,!0)?l="end":(Un(a,90,180)||Un(a,270,360))&&(l="start"):180===o&&(90===a?l="start":(Un(a,0,90)||Un(a,270,360))&&(l="end")):l="center":"parallel"===r?c=Un(o,0,180,!0)?"top":"bottom":"horizontal"===r?Un(o,90,270,!1)?l="end":(Un(o,270,360,!1)||Un(o,0,90))&&(l="start"):"perpendicular"===r&&(l=Un(o,90,270)?"end":"start"),{textAlign:l,textBaseline:c}}function Mi(t,e,n){const{showTick:i,tickLength:r,tickDirection:s,labelDirection:a,labelSpacing:o}=n,l=e.indexOf(t),c=gn(o,[t,l,e]),[u,h]=[Gn(t.value,n),Pi(a,s)],d=1===h?gn(i?r:0,[t,l,e]):0,[p,f]=ye(me(u,c+d),Hn(t.value,n));return{x:p,y:f}}function Oi(t,e){"text"===t.nodeName&&t.attr(e)}function Ti(t){!function(t,e,n){const{labelOverlap:i=[]}=e;i.length&&i.forEach((i=>{const{type:r}=i,s=Li.get(r);(function(t,e,n){return!(e.labelOverlap.length<1)&&("hide"===n?!u(t[0]):"rotate"===n?!t.some((t=>{var e;return!(null===(e=t.attr("transform"))||void 0===e||!e.includes("rotate"))})):"ellipsis"!==n&&"wrap"!==n||t.filter((t=>t.querySelector("text"))).length>1)})(t,e,r)&&(null==s||s(t,i,e,n))}))}(this.node().childNodes,t,{hide:a,show:s,rotate:(e,n)=>{!function(t,e,n){e.setLocalEulerAngles(t);const{value:i}=e.__data__,r=Ci(i,t,n),s=e.querySelector(dn.labelItem.class);s&&Oi(s,r)}(+n,e,t)},ellipsis:(t,e,n)=>{t&&ii(t,e||1/0,n)},wrap:(t,e,n)=>{t&&ri(t,e,n)},getTextShape:t=>t.querySelector("text")})}function ji(t,e,n,i,r){const s=n.indexOf(e),a=G(t).append(function(t,e,n,i){const{labelFormatter:r}=i;return V(r)?()=>On(gn(r,[t,e,n,Gn(t.value,i)])):()=>On(t.label||"")}(e,s,n,r)).attr("className",dn.labelItem.name).node(),[o,{transform:l,...c}]=M(Nn(i,[e,s,n]));ai(t,l);const u=function(t,e,n){var i;const{labelAlign:r}=n;if(null===(i=e.style.transform)||void 0===i?void 0:i.includes("rotate"))return e.getLocalEulerAngles();let s=0;const a=Gn(t.value,n),o=In(t.value,n);return"horizontal"===r?0:(s="perpendicular"===r?Bi([1,0],a):Bi([o[0]<0?-1:1,0],o),function(t){let e=(t+360)%180;return Un(e,-90,90)||(e+=180),e}(fn(s)))}(e,t,r);return t.setLocalEulerAngles(+u),Oi(a,{...Ci(e.value,u,r),...o}),ai(t,l),t.attr(c),a}function Ni(t,e){return Fn(t,e.tickDirection,e)}function _i(t,e,n,i,r,s){const a=function(t,e,n,i,r){const{tickFormatter:s}=r,a=Ni(e.value,r);let o="line";return V(s)&&(o=()=>gn(s,[e,n,i,a])),t.append(o).attr("className",dn.tickItem.name)}(G(this),t,e,n,i);!function(t,e,n,i,r,s,a){const o=Ni(t.value,s),{x1:l,x2:c,y1:u,y2:h}=function(t,e,n,i,r){const{tickLength:s}=r,[[a,o],[l,c]]=function(t,e){const[n,i]=t;return[[0,0],[n*e,i*e]]}(i,gn(s,[t,e,n]));return{x1:a,x2:l,y1:o,y2:c}}(t,e,n,o,s),[d,p]=M(Nn(a,[t,e,n,o]));"line"===i.node().nodeName&&i.styles({x1:l,x2:c,y1:u,y2:h,...d}),r.attr(p),i.styles(d)}(t,e,n,a,this,i,r);const[o,l]=Hn(t.value,i);return He(this,{x:o,y:l},s)}function zi(t,e,n){return e=function(t){var e=function(t,e){if("object"!=typeof t||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var i=n.call(t,"string");if("object"!=typeof i)return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==typeof e?e:e+""}(e),e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}class Ii{get bottom(){return this.y+this.height}get left(){return this.x}get right(){return this.x+this.width}get top(){return this.y}constructor(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0;zi(this,"x",0),zi(this,"y",0),zi(this,"width",0),zi(this,"height",0),this.x=t,this.y=e,this.width=n,this.height=i}static fromRect(t){return new Ii(t.x,t.y,t.width,t.height)}toJSON(){return{x:this.x,y:this.y,width:this.width,height:this.height,top:this.top,right:this.right,bottom:this.bottom,left:this.left}}isPointIn(t,e){return t>=this.left&&t<=this.right&&e>=this.top&&e<=this.bottom}}function Fi(t){const{min:[e,n],max:[i,r]}=t.getRenderBounds();return new Ii(e,n,i-e,r-n)}const Gi=$e({text:"text"},"title");function Hi(t){return/\S+-\S+/g.test(t)?t.split("-").map((t=>t[0])):t.length>2?[t[0]]:t.split("")}function Vi(t,e){const n=Object.entries(e).reduce(((e,n)=>{let[i,r]=n;return t.node().attr(i)||(e[i]=r),e}),{});t.styles(n)}class Wi extends x{constructor(t){super(t,{text:"",width:0,height:0,fill:"#4a505a",fontWeight:"bold",fontSize:12,fontFamily:"sans-serif",inset:0,spacing:0,position:"top-left"}),function(t,e,n){e=function(t){var e=function(t,e){if("object"!=typeof t||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var i=n.call(t,"string");if("object"!=typeof i)return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==typeof e?e:e+""}(e),e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n}(this,"title",void 0)}getAvailableSpace(){const{width:t,height:e,position:n,spacing:i,inset:r}=this.attributes,s=this.querySelector(Gi.text.class);if(!s)return new Ii(0,0,+t,+e);const{width:a,height:o}=s.getBBox(),[l,c,u,h]=T(i);let[d,p,f,g]=[0,0,+t,+e];const m=Hi(n);if(m.includes("i"))return new Ii(d,p,f,g);m.forEach(((n,i)=>{"t"===n&&([p,g]=0===i?[o+u,+e-o-u]:[0,+e]),"r"===n&&([f]=[+t-a-h]),"b"===n&&([g]=[+e-o-l]),"l"===n&&([d,f]=0===i?[a+c,+t-a-c]:[0,+t])}));const[y,b,v,x]=T(r),[w,S]=[x+b,y+v];return new Ii(d+x,p+y,f-w,g-S)}getBBox(){return this.title?this.title.getBBox():new Ii(0,0,0,0)}render(t,e){const{width:n,height:i,position:r,spacing:s,...a}=t,[o]=M(a),{x:l,y:c,textAlign:u,textBaseline:h}=function(t){const{width:e,height:n,position:i}=t,[r,s]=[+e/2,+n/2];let[a,o,l,c]=[+r,+s,"center","middle"];const u=Hi(i);return u.includes("l")&&([a,l]=[0,"start"]),u.includes("r")&&([a,l]=[+e,"end"]),u.includes("t")&&([o,c]=[0,"top"]),u.includes("b")&&([o,c]=[+n,"bottom"]),{x:a,y:o,textAlign:l,textBaseline:c}}(t);W(!!a.text,G(e),(t=>{this.title=t.maybeAppendByClassName(Gi.text,"text").styles(o).call(Vi,{x:l,y:c,textAlign:u,textBaseline:h}).node()}))}}function Di(t,e,n,i,r){const s=B(i,"title"),[a,{transform:o,...l}]=M(s);t.styles(a),e.styles(l);const c=o||function(t,e,n){const i=t.cloneNode(!0);i.style.transform="scale(1, 1)",i.style.transform="none";const{height:r}=i.getBBox();if("vertical"===e){if("left"===n)return"rotate(-90) translate(0, ".concat(r/2,")");if("right"===n)return"rotate(-90) translate(0, -".concat(r/2,")")}return""}(t.node(),a.direction,a.position);ai(t.node(),c);const{x:u,y:h}=function(t,e,n){const{titlePosition:i="lb",titleSpacing:r}=n,s=Hi(i),{min:[a,o],halfExtents:[l,c]}=t.node().getLocalBounds(),[u,h]=e.node().getLocalBounds().halfExtents;let[d,p]=[a+l,o+c];const[f,g,m,y]=T(r);if(["start","end"].includes(i)&&"linear"===n.type){const{startPos:t,endPos:e}=n,[r,s]="start"===i?[t,e]:[e,t],a=Se([-s[0]+r[0],-s[1]+r[1]]),[o,l]=me(a,f);return{x:r[0]+o,y:r[1]+l}}return s.includes("t")&&(p-=c+h+f),s.includes("r")&&(d+=l+u+g),s.includes("l")&&(d-=l+2*u+y),s.includes("b")&&(p+=c+2*h+m),{x:d,y:p}}(G(n._offscreen||n.querySelector(dn.mainGroup.class)),e,i),d=He(e.node(),{x:u,y:h},r);return ai(t.node(),c),d}function Ri(t,e,n,i){const{showLine:r,showTick:o,showLabel:l}=t,c=W(r,e.maybeAppendByClassName(dn.lineGroup,"g"),(e=>qn(e,t,i)))||[],u=W(o,e.maybeAppendByClassName(dn.tickGroup,"g"),(e=>function(t,e,n,i){const r=_n(e,n.tickFilter),s=B(n,"tick");return t.selectAll(dn.tick.class).data(r,(t=>t.id||t.label)).join((t=>t.append("g").attr("className",dn.tick.name).transition((function(t,e){return _i.call(this,t,e,r,n,s,!1)}))),(t=>t.transition((function(t,e){return this.removeChildren(),_i.call(this,t,e,r,n,s,i.update)}))),(t=>t.transition((function(){const t=mn(this.childNodes[0],i.exit);return Ie(t,(()=>this.remove())),t})))).transitions()}(e,n,t,i)))||[],h=W(l,e.maybeAppendByClassName(dn.labelGroup,"g"),(e=>function(t,e,n,i){const r=_n(e,n.labelFilter),o=B(n,"label");return t.selectAll(dn.label.class).data(r,((t,e)=>e)).join((i=>i.append("g").attr("className",dn.label.name).transition((function(t){return ji(this,t,e,o,n),this.attr(Mi(t,e,n)),this.__bbox__=t.bbox,null})).call((()=>Ti.call(t,n)))),(r=>r.transition((function(t){const r=function(t,e,n){let i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"destroy";if(function(t,e){return"text"===t.nodeName&&"text"===e.nodeName&&t.attributes.text===e.attributes.text}(t,e))return t.remove(),[null];const r=()=>{"destroy"===i?t.destroy():"hide"===i&&a(t),e.isVisible()&&s(e)};if(!n)return r(),[null];const{duration:o=0,delay:l=0}=n,c=Math.ceil(+o/2),u=+o/4,h=t=>{if("circle"===t.nodeName){const[e,n]=t.getLocalPosition(),i=t.attr("r");return[e-i,n-i]}return t.getLocalPosition()},[d,p]=h(t),[f,g]=h(e),[m,y]=[(d+f)/2-d,(p+g)/2-p],{opacity:b=1}=t.style,{opacity:v=1}=e.style,x=t.animate([{opacity:b,transform:"translate(0, 0)"},{opacity:0,transform:"translate(".concat(m,", ").concat(y,")")}],{fill:"both",...n,duration:l+c+u}),w=e.animate([{opacity:0,transform:"translate(".concat(-m,", ").concat(-y,")"),offset:.01},{opacity:v,transform:"translate(0, 0)"}],{fill:"both",...n,duration:c+u,delay:l+c-u});return Ie(w,r),[x,w]}(this.querySelector(dn.labelItem.class),ji(this,t,e,o,n),i.update),l=He(this,Mi(t,e,n),i.update);return this.__bbox__=t.bbox,[...r,l]})).call((e=>{var i,r;r=()=>Ti.call(t,n),0===(i=Ln(e,"_transitions").flat().filter(oi)).length?r():Promise.all(i.map((t=>null==t?void 0:t.finished))).then(r)}))),(t=>t.transition((function(){const t=mn(this.childNodes[0],i.exit);return Ie(t,(()=>G(this).remove())),t})))).transitions()}(e,n,t,i)))||[];return[...c,...u,...h].filter((t=>!!t))}class Yi extends x{constructor(t){super(t,hn)}render(t,e,n){const{titleText:i,data:r,animate:s,showTitle:a,showGrid:o,dataThreshold:l,truncRange:c}=t,u=un(r,l).filter((t=>{let{value:e}=t;return!(c&&e>c[0]&&e<c[1])})),h=ze(void 0===n?s:n),d=W(o,G(e).maybeAppendByClassName(dn.gridGroup,"g"),(e=>Zn(e,u,t,h)))||[],p=G(e).maybeAppendByClassName(dn.mainGroup,"g");i&&(!this.initialized&&h.enter||this.initialized&&h.update)&&Ri(t,G(this.offscreenGroup),u,ze(!1));const f=Ri(t,G(p.node()),u,h),g=W(a,G(e).maybeAppendByClassName(dn.titleGroup,"g"),(e=>function(t,e,n,i){const{titleText:r}=n;return t.selectAll(dn.title.class).data([{title:r}].filter((t=>!!t.title)),((t,e)=>t.title)).join((s=>s.append((()=>On(r))).attr("className",dn.title.name).transition((function(){return Di(G(this),t,e,n,i.enter)}))),(r=>r.transition((function(){return Di(G(this),t,e,n,i.update)}))),(t=>t.remove())).transitions()}(e,this,t,h)))||[];return[...d,...f,...g].flat().filter((t=>!!t))}}class qi{}const Ki={backgroundFill:"#262626",backgroundLineCap:"round",backgroundLineWidth:1,backgroundStroke:"#333",backgroundZIndex:-1,formatter:t=>t.toString(),labelFill:"#fff",labelFontSize:12,labelTextBaseline:"middle",padding:[2,4],position:"right",radius:0,zIndex:999};function Zi(t,e,n){return e=function(t){var e=function(t,e){if("object"!=typeof t||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var i=n.call(t,"string");if("object"!=typeof i)return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==typeof e?e:e+""}(e),e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}const Ui=$e({background:"background",labelGroup:"label-group",label:"label"},"indicator");class $i extends x{constructor(e){super(e,Ki),Zi(this,"group",void 0),Zi(this,"background",void 0),Zi(this,"label",void 0),Zi(this,"point",[0,0]),this.group=this.appendChild(new t.Group({})),this.isMutationObserved=!0}renderBackground(){if(!this.label)return;const{position:t,padding:e}=this.attributes,[n,i,r,s]=T(e),{min:a,max:o}=this.label.node().getLocalBounds(),l=new Ii(a[0]-s,a[1]-n,o[0]+i-a[0]+s,o[1]+r-a[1]+n),c=this.getPath(t,l),u=B(this.attributes,"background");this.background=G(this.group).maybeAppendByClassName(Ui.background,"path").styles({...u,path:c}),this.group.appendChild(this.label.node())}renderLabel(){const{formatter:t,labelText:e}=this.attributes,n=B(this.attributes,"label"),[{text:i,...r},s]=M(n);this.label=G(this.group).maybeAppendByClassName(Ui.labelGroup,"g").styles(s),e&&this.label.maybeAppendByClassName(Ui.label,(()=>On(t(e)))).style("text",t(e).toString()).selectAll("text").styles(r)}adjustLayout(){const[t,e]=this.point;this.group.attr("x",-t).attr("y",-e)}getPath(t,e){const{radius:n}=this.attributes,{x:i,y:r,width:s,height:a}=e,o=[["M",i+n,r],["L",i+s-n,r],["A",n,n,0,0,1,i+s,r+n],["L",i+s,r+a-n],["A",n,n,0,0,1,i+s-n,r+a],["L",i+n,r+a],["A",n,n,0,0,1,i,r+a-n],["L",i,r+n],["A",n,n,0,0,1,i+n,r],["Z"]],l={top:4,right:6,bottom:0,left:2}[t],c=this.createCorner([o[l].slice(-2),o[l+1].slice(-2)]);return o.splice(l+1,1,...c),o[0][0]="M",o}createCorner(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:10;const n=wi(...t),[[i,r],[s,a]]=t,[o,[l,c]]=n?[s-i,[i,s]]:[a-r,[r,a]],u=o/2,h=e*(o/Math.abs(o)),d=h/2,p=h*Math.sqrt(3)/2*.8,[f,g,m,y,b]=[l,l+u-d,l+u,l+u+d,c];return n?(this.point=[m,r-p],[["L",f,r],["L",g,r],["L",m,r-p],["L",y,r],["L",b,r]]):(this.point=[i+p,m],[["L",i,f],["L",i,g],["L",i+p,m],["L",i,y],["L",i,b]])}applyVisibility(){const{visibility:t}=this.attributes;"hidden"===t?a(this):s(this)}bindEvents(){this.label.on(t.ElementEvent.BOUNDS_CHANGED,this.renderBackground)}render(){this.renderLabel(),this.renderBackground(),this.adjustLayout(),this.applyVisibility()}}function Xi(){return"horizontal"===(arguments.length>0&&void 0!==arguments[0]?arguments[0]:"horizontal")?arguments.length>1?arguments[1]:void 0:arguments.length>2?arguments[2]:void 0}et.registerSymbol("hiddenHandle",(function(t,e,n){const i=1.4*n;return[["M",t-n,e-i],["L",t+n,e-i],["L",t+n,e+i],["L",t-n,e+i],["Z"]]})),et.registerSymbol("verticalHandle",(function(t,e,n){const i=1.4*n,r=n/2,s=n/6,a=t+.4*i;return[["M",t,e],["L",a,e+r],["L",t+i,e+r],["L",t+i,e-r],["L",a,e-r],["Z"],["M",a,e+s],["L",t+i-2,e+s],["M",a,e-s],["L",t+i-2,e-s]]})),et.registerSymbol("horizontalHandle",(function(t,e,n){const i=1.4*n,r=n/2,s=n/6,a=e+.4*i;return[["M",t,e],["L",t-r,a],["L",t-r,e+i],["L",t+r,e+i],["L",t+r,a],["Z"],["M",t-s,a],["L",t-s,e+i-2],["M",t+s,a],["L",t+s,e+i-2]]}));const Ji=$e({markerGroup:"marker-group",marker:"marker",labelGroup:"label-group",label:"label"},"handle"),Qi={showLabel:!0,formatter:t=>t.toString(),markerSize:25,markerStroke:"#c5c5c5",markerFill:"#fff",markerLineWidth:1,labelFontSize:12,labelFill:"#c5c5c5",labelText:"",orientation:"vertical",spacing:0};class tr extends x{constructor(t){super(t,Qi),function(t,e,n){e=function(t){var e=function(t,e){if("object"!=typeof t||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var i=n.call(t,"string");if("object"!=typeof i)return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==typeof e?e:e+""}(e),e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n}(this,"marker",void 0)}render(t,e){const n=G(e).maybeAppendByClassName(Ji.markerGroup,"g");this.renderMarker(n);const i=G(e).maybeAppendByClassName(Ji.labelGroup,"g");this.renderLabel(i)}renderMarker(t){const{orientation:e,markerSymbol:n=Xi(e,"horizontalHandle","verticalHandle")}=this.attributes;W(!!n,t,(t=>{const e=B(this.attributes,"marker"),i={symbol:n,...e};this.marker=t.maybeAppendByClassName(Ji.marker,(()=>new et({style:i}))).update(i)}))}renderLabel(t){const{showLabel:e,orientation:n,spacing:i=0,formatter:r}=this.attributes;W(e,t,(t=>{var e;const{text:s,...a}=B(this.attributes,"label"),{width:o=0,height:l=0}=(null===(e=t.select(Ji.marker.class))||void 0===e?void 0:e.node().getBBox())||{},[c,u,h,d]=Xi(n,[0,l+i,"center","top"],[o+i,0,"start","middle"]);t.maybeAppendByClassName(Ji.label,"text").styles({...a,x:c,y:u,text:r(s).toString(),textAlign:h,textBaseline:d})}))}}const er={showTitle:!0,padding:0,orientation:"horizontal",backgroundFill:"transparent",titleText:"",titleSpacing:4,titlePosition:"top-left",titleFill:"#2C3542",titleFontWeight:"bold",titleFontFamily:"sans-serif",titleFontSize:12},nr=y({},er,{}),ir=y({},er,C(Qi,"handle"),{color:["#d0e3fa","#acc7f6","#8daaf2","#6d8eea","#4d73cd","#325bb1","#5a3e75","#8c3c79","#e23455","#e7655b"],indicatorBackgroundFill:"#262626",indicatorLabelFill:"white",indicatorLabelFontSize:12,indicatorVisibility:"hidden",labelAlign:"value",labelDirection:"positive",labelSpacing:5,showHandle:!0,showIndicator:!0,showLabel:!0,slidable:!0,titleText:"",type:"continuous"}),rr=$e({title:"title",titleGroup:"title-group",items:"items",itemsGroup:"items-group",contentGroup:"content-group",ribbonGroup:"ribbon-group",ribbon:"ribbon",handlesGroup:"handles-group",handle:"handle",startHandle:"start-handle",endHandle:"end-handle",labelGroup:"label-group",label:"label",indicator:"indicator"},"legend");function sr(t,e){const[n,i]=function(t,e){for(let n=1;n<t.length;n+=1){const i=t[n-1],r=t[n];if(e>=i&&e<=r)return[i,r]}return[e,e]}(t,e);return{tick:e>(n+i)/2?i:n,range:[n,i]}}const ar=$e({trackGroup:"background-group",track:"background",selectionGroup:"ribbon-group",selection:"ribbon",clipPath:"clip-path"},"ribbon");function or(t){const{orientation:e,size:n,length:i}=t;return Xi(e,[i,n],[n,i])}function lr(t){const{type:e}=t,[n,i]=or(t);return"size"===e?[["M",0,i],["L",0+n,0],["L",0+n,i],["Z"]]:[["M",0,i],["L",0,0],["L",0+n,0],["L",0+n,i],["Z"]]}function cr(t){return lr(t)}function ur(t){const{orientation:e,range:n}=t;if(!n)return[];const[i,r]=or(t),[s,a]=n,o=Xi(e,s*i,0),l=Xi(e,0,s*r),c=Xi(e,a*i,i),u=Xi(e,r,a*r);return[["M",o,l],["L",o,u],["L",c,u],["L",c,l],["Z"]]}class hr extends x{constructor(t){super(t,{type:"color",orientation:"horizontal",size:30,range:[0,1],length:200,block:!1,partition:[],color:["#fff","#000"],trackFill:"#e5e5e5"})}render(e,n){!function(t,e){const n=B(e,"track");t.maybeAppendByClassName(ar.track,"path").styles({path:lr(e),...n})}(G(n).maybeAppendByClassName(ar.trackGroup,"g"),e),function(e,n){const i=B(n,"selection"),r=function(e){const{orientation:n,color:i,block:r,partition:s}=e;let a;a=V(i)?new Array(20).fill(0).map(((t,e,n)=>i(e/(n.length-1)))):i;const o=a.length,l=a.map((e=>(0,t.parseColor)(e).toString()));return o?1===o?l[0]:r?function(t,e,n){const i=Array.from(e),r=t.length;return new Array(r).fill(0).reduce(((e,n,s)=>{const a=i[s%i.length];return e+" ".concat(t[s],":").concat(a).concat(s<r-1?" ".concat(t[s+1],":").concat(a):"")}),"l(".concat("horizontal"===n?"0":"270",")"))}(s,l,n):l.reduce(((t,e,n)=>t+" ".concat(n/(o-1),":").concat(e)),"l(".concat(Xi(n,"0","270"),")")):""}(n),s=e.maybeAppendByClassName(ar.selection,"path").styles({path:cr(n),fill:r,...i}),a=s.maybeAppendByClassName(ar.clipPath,"path").styles({path:ur(n)}).node();s.style("clip-path",a)}(G(n).maybeAppendByClassName(ar.selectionGroup,"g"),e)}}function dr(t,e,n){return e=function(t){var e=function(t,e){if("object"!=typeof t||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var i=n.call(t,"string");if("object"!=typeof i)return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==typeof e?e:e+""}(e),e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}class pr extends x{constructor(t){super(t,ir),dr(this,"eventToOffsetScale",new $t({})),dr(this,"innerRibbonScale",new $t({})),dr(this,"title",void 0),dr(this,"label",void 0),dr(this,"ribbon",void 0),dr(this,"indicator",void 0),dr(this,"handlesGroup",void 0),dr(this,"startHandle",void 0),dr(this,"endHandle",void 0),dr(this,"cacheLabelBBox",null),dr(this,"cacheHandleBBox",null),dr(this,"target",void 0),dr(this,"prevValue",void 0),dr(this,"onHovering",(t=>{const{data:e,block:n}=this.attributes;t.stopPropagation();const i=this.getValueByCanvasPoint(t);if(n){const{range:t}=sr(e.map((t=>{let{value:e}=t;return e})),i);this.showIndicator((t[0]+t[1])/2,"".concat(t[0],"-").concat(t[1])),this.dispatchIndicated(i,t)}else{const t=this.getTickValue(i);this.showIndicator(t),this.dispatchIndicated(t)}})),dr(this,"onDragStart",(t=>e=>{e.stopPropagation(),this.attributes.slidable&&(this.target=t,this.prevValue=this.getTickValue(this.getValueByCanvasPoint(e)),document.addEventListener("mousemove",this.onDragging),document.addEventListener("touchmove",this.onDragging),document.addEventListener("mouseleave",this.onDragEnd),document.addEventListener("mouseup",this.onDragEnd),document.addEventListener("mouseup",this.onDragEnd),document.addEventListener("touchend",this.onDragEnd))})),dr(this,"onDragging",(t=>{const{target:e}=this;this.updateMouse();const[n,i]=this.selection,r=this.getTickValue(this.getValueByCanvasPoint(t)),s=r-this.prevValue;"start"===e?n!==r&&this.updateSelection(r,i):"end"===e?i!==r&&this.updateSelection(n,r):"ribbon"===e&&0!==s&&(this.prevValue=r,this.updateSelection(s,s,!0))})),dr(this,"onDragEnd",(()=>{this.style.cursor="pointer",document.removeEventListener("mousemove",this.onDragging),document.removeEventListener("touchmove",this.onDragging),document.removeEventListener("mouseup",this.onDragEnd),document.removeEventListener("touchend",this.onDragEnd)}))}get handleOffsetRatio(){return this.ifHorizontal(.5,.5)}getBBox(){const{width:t,height:e}=this.attributes;return new Ii(0,0,t,e)}render(t,e){const{showLabel:n}=t;this.renderTitle(G(e));const{x:i,y:r}=this.availableSpace,s=G(e).maybeAppendByClassName(rr.contentGroup,"g").styles({x:i,y:r});W(!!n,s.maybeAppendByClassName(rr.labelGroup,"g").styles({zIndex:1}),(t=>{this.renderLabel(t)}));const a=s.maybeAppendByClassName(rr.ribbonGroup,"g").styles({zIndex:0});this.handlesGroup=s.maybeAppendByClassName(rr.handlesGroup,"g").styles({zIndex:2}),this.renderHandles(),this.renderRibbon(a),this.renderIndicator(s),this.adjustLabel(),this.adjustHandles()}get range(){const{data:t,domain:e}=this.attributes;return e?{min:e[0],max:e[1]}:function(t){return{min:Math.min(...t.map((t=>t.value))),max:Math.max(...t.map((t=>t.value)))}}(t)}get ribbonScale(){const{min:t,max:e}=this.range;return this.innerRibbonScale.update({domain:[t,e],range:[0,1]}),this.innerRibbonScale}get ribbonRange(){const[t,e]=this.selection,n=this.ribbonScale;return[n.map(t),n.map(e)]}get selection(){const{min:t,max:e}=this.range,{defaultValue:[n,i]=[t,e]}=this.attributes;return[n,i]}ifHorizontal(t,e){return Xi(this.attributes.orientation,"function"==typeof t?t():t,"function"==typeof e?e():e)}renderTitle(t){const{showTitle:e,titleText:n,width:i,height:r}=this.attributes,s={...B(this.attributes,"title"),width:i,height:r,text:n},a=this;t.selectAll(rr.title.class).data(e?[n]:[]).join((t=>t.append((()=>new Wi({style:s}))).attr("className",rr.title.name).each((function(){a.title=this}))),(t=>t.update(s)),(t=>t.each((()=>{a.title=void 0})).remove()))}get availableSpace(){if(this.title)return this.title.getAvailableSpace();const{width:t,height:e}=this.attributes;return new Ii(0,0,t,e)}get labelFixedSpacing(){const{showTick:t}=this.attributes;return t?5:0}get labelPosition(){const{orientation:t,labelDirection:e}=this.attributes;return{vertical:{positive:"right",negative:"left"},horizontal:{positive:"bottom",negative:"top"}}[t][e]}get labelBBox(){var t;const{showLabel:e}=this.attributes;if(!e)return new Ii(0,0,0,0);if(this.cacheLabelBBox)return this.cacheLabelBBox;const{width:n,height:i}=(null===(t=this.label.querySelector(dn.labelGroup.class))||void 0===t?void 0:t.children.slice(-1)[0]).getBBox();return this.cacheLabelBBox=new Ii(0,0,n,i),this.cacheLabelBBox}get labelShape(){const{showLabel:t,labelSpacing:e=0}=this.attributes;if(!t)return{width:0,height:0,size:0,length:0};const{width:n,height:i}=this.labelBBox;return{width:n,height:i,size:this.ifHorizontal(i,n)+e+this.labelFixedSpacing,length:this.ifHorizontal(n,i)}}get ribbonBBox(){const{showHandle:t,ribbonSize:e}=this.attributes,{width:n,height:i}=this.availableSpace,{size:r,length:s}=this.labelShape,[a,o]=this.ifHorizontal([i,n],[n,i]),{size:l,length:c}=t?this.handleShape:{size:0,length:0},u=this.handleOffsetRatio;let h=0;const d=this.labelPosition;h=e||(["bottom","right"].includes(d)?Math.min(a-r,(a-l)/u):a*(1-u)>l?Math.max(a-r,0):Math.max((a-r-l)/u,0));const p=Math.max(c,s),f=o-p,[g,m]=this.ifHorizontal([f,h],[h,f]),y=["top","left"].includes(d)?r:0,[b,v]=this.ifHorizontal([p/2,y],[y,p/2]);return new Ii(b,v,g,m)}get ribbonShape(){const{width:t,height:e}=this.ribbonBBox;return this.ifHorizontal({size:e,length:t},{size:t,length:e})}renderRibbon(t){const{data:e,type:n,orientation:i,color:r,block:s}=this.attributes,a=B(this.attributes,"ribbon"),{min:o,max:l}=this.range,{x:c,y:u}=this.ribbonBBox,{length:h,size:d}=this.ribbonShape,p=y({x:c,y:u,length:h,size:d,type:n,orientation:i,color:r,block:s,partition:e.map((t=>(t.value-o)/(l-o))),range:this.ribbonRange},a);this.ribbon=t.maybeAppendByClassName(rr.ribbon,(()=>new hr({style:p}))).update(p)}getHandleClassName(t){return"".concat(rr.prefix("".concat(t,"-handle")))}renderHandles(){const{showHandle:t,orientation:e}=this.attributes,n=B(this.attributes,"handle"),[i,r]=this.selection,s={...n,orientation:e},{shape:a="slider"}=n,o="basic"===a?tr:sn,l=this;this.handlesGroup.selectAll(rr.handle.class).data(t?[{value:i,type:"start"},{value:r,type:"end"}]:[],(t=>t.type)).join((t=>t.append((()=>new o({style:s}))).attr("className",(t=>{let{type:e}=t;return"".concat(rr.handle," ").concat(l.getHandleClassName(e))})).each((function(t){let{type:e,value:n}=t;this.update({labelText:n});const i="".concat(e,"Handle");l[i]=this,this.addEventListener("pointerdown",l.onDragStart(e))}))),(t=>t.update(s).each((function(t){let{value:e}=t;this.update({labelText:e})}))),(t=>t.each((t=>{let{type:e}=t;const n="".concat(e,"Handle");l[n]=void 0})).remove()))}adjustHandles(){const[t,e]=this.selection;this.setHandlePosition("start",t),this.setHandlePosition("end",e)}adjustTitle(){const{titlePosition:t,orientation:e}=this.attributes,[n]=this.getElementsByClassName(rr.title.name),i=this.handlesGroup.select(".".concat(this.getHandleClassName("start"))).node();if(!n||!i)return;if("top-left"!==t||"horizontal"!==e)return;const{min:[r]}=i.getLocalBounds(),{min:[s]}=n.getLocalBounds(),a=r-s;n.style.x=+(this.style.x||0)+a}get handleBBox(){if(this.cacheHandleBBox)return this.cacheHandleBBox;if(!this.attributes.showHandle)return new Ii(0,0,0,0);const{width:t,height:e}=this.startHandle.getBBox(),{width:n,height:i}=this.endHandle.getBBox(),[r,s]=[Math.max(t,n),Math.max(e,i)];return this.cacheHandleBBox=new Ii(0,0,r,s),this.cacheHandleBBox}get handleShape(){const{width:t,height:e}=this.handleBBox,[n,i]=this.ifHorizontal([e,t],[t,e]);return{width:t,height:e,size:n,length:i}}setHandlePosition(t,e){const{handleFormatter:n}=this.attributes,{x:i,y:r}=this.ribbonBBox,{size:s}=this.ribbonShape,a=this.getOffset(e),[o,l]=this.ifHorizontal([i+a,r+s*this.handleOffsetRatio],[i+s*this.handleOffsetRatio,r+a]),c=this.handlesGroup.select(".".concat(this.getHandleClassName(t))).node();null==c||c.update({x:o,y:l,formatter:n})}renderIndicator(t){const e=B(this.attributes,"indicator");this.indicator=t.maybeAppendByClassName(rr.indicator,(()=>new $i({}))).update(e)}get labelData(){const{data:t}=this.attributes;return t.reduce(((t,e,n,i)=>{var r,s;const a=null!==(r=null==e?void 0:e.id)&&void 0!==r?r:n.toString();if(t.push({...e,id:a,index:n,type:"value",label:null!==(s=null==e?void 0:e.label)&&void 0!==s?s:e.value.toString(),value:this.ribbonScale.map(e.value)}),n<i.length-1){const r=i[n+1],[s,o]=[e.value,r.value],l=(s+o)/2;t.push({...e,id:a,index:n,type:"range",range:[s,o],label:[s,o].join("~"),value:this.ribbonScale.map(l)})}return t}),[])}get labelStyle(){let[t,e]=["center","middle"];const n=this.labelPosition;return"top"===n?e="bottom":"bottom"===n?e="top":"left"===n?t="end":"right"===n&&(t="start"),{labelTextAlign:t,labelTextBaseline:e}}renderLabel(t){const{showTick:e=!1,labelFilter:n,labelFormatter:i}=this.attributes,r=B(this.attributes,"tick"),s=B(this.attributes,"label"),{align:a}=s,o={...y({showLine:!1,showGrid:!1,showTick:e,type:"linear",startPos:[0,0],endPos:[0,0],tickDirection:"negative",labelTransform:"rotate(0)",...this.labelStyle},C(r,"tick"),C(s,"label"),{data:this.labelData}),tickFilter:(t,e,i)=>"value"===(null==t?void 0:t.type)&&(!n||n(t,t.index,i.filter((t=>"value"!==t.type)))),labelFilter:(t,e,i)=>(null==t?void 0:t.type)===a&&(!n||n(t,t.index,i.filter((t=>t.type===a)))),labelFormatter:i,labelOverlap:[{type:"hide"}]};this.label=t.maybeAppendByClassName(rr.label,(()=>new Yi({style:o}))).node(),this.label.update(o,!1)}get labelAxisStyle(){const{showTick:t,labelDirection:e,labelSpacing:n,tickLength:i}=this.attributes,{size:r}=this.ribbonShape,s=this.labelPosition,a=this.labelFixedSpacing;let[o,l,c]=[0,0,0];const u=null!=i?i:r;return t?(c=u,l=a,"positive"===e?"right"===s?(o=u,c=u):"bottom"===s&&(o=c):"negative"===e&&("top"===s||"left"===s)&&(o=r)):"positive"===e?"right"===s?l=u:"bottom"===s&&(o=r+a,l=n):"negative"===e&&("left"===s||"top"===s)&&(l=n),{offset:o,spacing:n,tickLength:c}}adjustLabel(){const{showLabel:t}=this.attributes;if(!t)return;const{x:e,y:n,width:i,height:r}=this.ribbonBBox,{offset:s,spacing:a,tickLength:o}=this.labelAxisStyle,[l,c]=this.ifHorizontal([[e,n+s],[e+i,n+s]],[[e+s,n+r],[e+s,n]]);this.label.update({startPos:l,endPos:c,tickLength:o,labelSpacing:a},!1)}bindEvents(){this.style.cursor="pointer",this.ribbon.on("pointerdown",this.onDragStart("ribbon")),this.ribbon.on("pointermove",this.onHovering),this.addEventListener("pointerout",this.hideIndicator)}showIndicator(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"".concat(t);const{showIndicator:n}=this.attributes;if(!n||"number"!=typeof t)return void this.hideIndicator();const{min:i,max:r}=this.range,{x:a,y:o}=this.ribbonBBox,l=de(t,i,r),c=this.getOffset(l),u=this.ifHorizontal([c+a,o],[a,c+o]);this.indicator.update({x:u[0],y:u[1],position:this.ifHorizontal("top","left"),labelText:e}),s(this.indicator.node())}hideIndicator(){a(this.indicator.node())}updateMouse(){this.attributes.slidable&&(this.style.cursor="grabbing")}setSelection(t,e){this.updateSelection(t,e)}updateSelection(t,e){let n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];const[i,r]=this.selection;let[s,a]=[t,e];n&&(s+=i,a+=r);const{min:o,max:l}=this.range;[s,a]=function(t,e,n){const[i,r]=t,[s,a]=e,[o,l]=n;let[c,u]=[s,a];const h=u-c;return c>u&&([c,u]=[u,c]),h>r-i?[i,r]:c<i?o===i&&l===u?[i,u]:[i,h+i]:u>r?l===r&&o===c?[c,r]:[r-h,r]:[c,u]}([o,l],[s,a],this.selection),this.update({defaultValue:[s,a]}),this.dispatchSelection()}get step(){const{step:t=1}=this.attributes,{min:e,max:n}=this.range;return it(t)?We(.01*(n-e),0):t}getTickValue(t){const{data:e,block:n}=this.attributes,{min:i}=this.range;return n?sr(e.map((t=>{let{value:e}=t;return e})),t).tick:function(t,e,n){return n+Math.round((t-n)/e)*e}(t,this.step,i)}getValueByCanvasPoint(t){const{min:e,max:n}=this.range,[i,r]=this.ribbon.node().getPosition(),s=this.ifHorizontal(i,r),a=this.ifHorizontal(...Ve(t))-s;return de(this.getOffset(a,!0),e,n)}getOffset(t){let e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];const{min:n,max:i}=this.range,{length:r}=this.ribbonShape,s=this.eventToOffsetScale;return s.update({domain:[n,i],range:[0,r]}),e?s.invert(t):s.map(t)}dispatchSelection(){const e=new t.CustomEvent("valuechange",{detail:{value:this.selection}});this.dispatchEvent(e)}dispatchIndicated(e,n){const i=new t.CustomEvent("indicate",{detail:{value:e,range:n}});this.dispatchEvent(i)}}const fr=function(){};function gr(t,e){return t.reduce(((t,n)=>((t[n[e]]=t[n[e]]||[]).push(n),t)),{})}function mr(t){var e;return(null===(e=t[0])||void 0===e?void 0:e.map(((e,n)=>t.map((t=>t[n])))))||[]}function yr(t,e,n){return e=function(t){var e=function(t,e){if("object"!=typeof t||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var i=n.call(t,"string");if("object"!=typeof i)return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==typeof e?e:e+""}(e),e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}const br=$e({prevBtnGroup:"prev-btn-group",prevBtn:"prev-btn",nextBtnGroup:"next-btn-group",nextBtn:"next-btn",pageInfoGroup:"page-info-group",pageInfo:"page-info",playWindow:"play-window",contentGroup:"content-group",controller:"controller",clipPath:"clip-path"},"navigator");class vr extends x{constructor(e){super(e,{animate:{easing:"linear",duration:200,fill:"both"},buttonCursor:"pointer",buttonFill:"black",buttonPath:(0,0,6,[["M",-6,-6],["L",6,0],["L",-6,6],["Z"]]),buttonSize:12,controllerPadding:5,controllerSpacing:5,formatter:(t,e)=>"".concat(t,"/").concat(e),defaultPage:0,loop:!1,orientation:"horizontal",pageNumFill:"black",pageNumFontSize:12,pageNumTextAlign:"start",pageNumTextBaseline:"middle"}),yr(this,"playState","idle"),yr(this,"contentGroup",this.appendChild(new t.Group({class:br.contentGroup.name}))),yr(this,"playWindow",this.contentGroup.appendChild(new t.Group({class:br.playWindow.name}))),yr(this,"innerCurrPage",this.defaultPage),yr(this,"clipPath",void 0),yr(this,"prevBtnGroup",void 0),yr(this,"nextBtnGroup",void 0),yr(this,"pageInfoGroup",void 0)}get defaultPage(){const{defaultPage:t}=this.attributes;return de(t,0,Math.max(this.pageViews.length-1,0))}get pageViews(){return this.playWindow.children}get controllerShape(){return this.totalPages>1?{width:55,height:0}:{width:0,height:0}}get pageShape(){const{pageViews:t}=this,[e,n]=mr(t.map((t=>{const{width:e,height:n}=t.getBBox();return[e,n]}))).map((t=>Math.max(...t))),{pageWidth:i=e,pageHeight:r=n}=this.attributes;return{pageWidth:i,pageHeight:r}}getContainer(){return this.playWindow}get totalPages(){return this.pageViews.length}get currPage(){return this.innerCurrPage}getBBox(){const{x:t,y:e}=super.getBBox(),n=this.controllerShape,{pageWidth:i,pageHeight:r}=this.pageShape;return new Ii(t,e,i+n.width,r)}goTo(t){const{animate:e}=this.attributes,{currPage:n,playState:i,playWindow:r,pageViews:s}=this;if("idle"!==i||t<0||s.length<=0||t>=s.length)return null;s[n].setLocalPosition(0,0),this.prepareFollowingPage(t);const[a,o]=this.getFollowingPageDiff(t);this.playState="running";const l=Ge(r,[{transform:"translate(0, 0)"},{transform:"translate(".concat(-a,", ").concat(-o,")")}],e);return Ie(l,(()=>{this.innerCurrPage=t,this.playState="idle",this.setVisiblePages([t]),this.updatePageInfo()})),l}prev(){const{loop:t}=this.attributes,e=this.pageViews.length,n=this.currPage;if(!t&&n<=0)return null;const i=t?(n-1+e)%e:de(n-1,0,e);return this.goTo(i)}next(){const{loop:t}=this.attributes,e=this.pageViews.length,n=this.currPage;if(!t&&n>=e-1)return null;const i=t?(n+1)%e:de(n+1,0,e);return this.goTo(i)}renderClipPath(t){const{pageWidth:e,pageHeight:n}=this.pageShape;e&&n?(this.clipPath=t.maybeAppendByClassName(br.clipPath,"rect").styles({width:e,height:n}),this.contentGroup.attr("clipPath",this.clipPath.node())):this.contentGroup.style.clipPath=void 0}setVisiblePages(t){this.playWindow.children.forEach(((e,n)=>{t.includes(n)?s(e):a(e)}))}adjustControllerLayout(){const{prevBtnGroup:t,nextBtnGroup:e,pageInfoGroup:n}=this,{orientation:i,controllerPadding:r}=this.attributes,{width:s,height:a}=n.getBBox(),[o,l]="horizontal"===i?[-180,0]:[-90,90];t.setLocalEulerAngles(o),e.setLocalEulerAngles(l);const{width:c,height:u}=t.getBBox(),{width:h,height:d}=e.getBBox(),p=Math.max(c,s,h),{offset:[[f,g],[m,y],[b,v]],textAlign:x}="horizontal"===i?{offset:[[0,0],[c/2+r,0],[c+s+2*r,0]],textAlign:"start"}:{offset:[[p/2,-u-r],[p/2,0],[p/2,d+r]],textAlign:"center"},w=n.querySelector("text");w&&(w.style.textAlign=x),t.setLocalPosition(f,g),n.setLocalPosition(m,y),e.setLocalPosition(b,v)}updatePageInfo(){var t;const{currPage:e,pageViews:n,attributes:{formatter:i}}=this;n.length<2||(null===(t=this.pageInfoGroup.querySelector(br.pageInfo.class))||void 0===t||t.attr("text",i(e+1,n.length)),this.adjustControllerLayout())}getFollowingPageDiff(t){const{currPage:e}=this;if(e===t)return[0,0];const{orientation:n}=this.attributes,{pageWidth:i,pageHeight:r}=this.pageShape,s=t<e?-1:1;return"horizontal"===n?[s*i,0]:[0,s*r]}prepareFollowingPage(t){const{currPage:e,pageViews:n}=this;if(this.setVisiblePages([t,e]),t!==e){const[e,i]=this.getFollowingPageDiff(t);n[t].setLocalPosition(e,i)}}renderController(t){const{controllerSpacing:e}=this.attributes,{pageWidth:n,pageHeight:i}=this.pageShape,r=this.pageViews.length>=2,s=t.maybeAppendByClassName(br.controller,"g");if(o(s.node(),r),!r)return;const a=B(this.attributes,"button"),l=B(this.attributes,"pageNum"),[{size:c,...u},h]=M(a),d=!s.select(br.prevBtnGroup.class).node(),p=s.maybeAppendByClassName(br.prevBtnGroup,"g").styles(h);this.prevBtnGroup=p.node();const f=p.maybeAppendByClassName(br.prevBtn,"path"),g=s.maybeAppendByClassName(br.nextBtnGroup,"g").styles(h);this.nextBtnGroup=g.node(),[f,g.maybeAppendByClassName(br.nextBtn,"path")].forEach((t=>{t.styles({...u,transformOrigin:"center"}),Tn(t.node(),c,!0)}));const m=s.maybeAppendByClassName(br.pageInfoGroup,"g");this.pageInfoGroup=m.node(),m.maybeAppendByClassName(br.pageInfo,"text").styles(l),this.updatePageInfo(),s.node().setLocalPosition(n+e,i/2),d&&(this.prevBtnGroup.addEventListener("click",(()=>{this.prev()})),this.nextBtnGroup.addEventListener("click",(()=>{this.next()})))}render(t,e){const n=G(e);this.renderClipPath(n),this.renderController(n),this.setVisiblePages([this.defaultPage]),this.goTo(this.defaultPage)}bindEvents(){const e=(n=()=>this.render(this.attributes,this),i=50,function(){var t=this,e=arguments,a=r&&!s;clearTimeout(s),s=setTimeout((function(){s=null,r||n.apply(t,e)}),i),a&&n.apply(t,e)});var n,i,r,s;this.playWindow.addEventListener(t.ElementEvent.INSERTED,e),this.playWindow.addEventListener(t.ElementEvent.REMOVED,e)}}function xr(t,e,n){return e=function(t){var e=function(t,e){if("object"!=typeof t||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var i=n.call(t,"string");if("object"!=typeof i)return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==typeof e?e:e+""}(e),e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}const wr=$e({layout:"flex",markerGroup:"marker-group",marker:"marker",labelGroup:"label-group",label:"label",valueGroup:"value-group",value:"value",backgroundGroup:"background-group",background:"background"},"legend-category-item");class Sr extends x{constructor(e){super(e,{span:[1,1],marker:()=>new t.Circle({style:{r:6}}),markerSize:10,labelFill:"#646464",valueFill:"#646464",labelFontSize:12,valueFontSize:12,labelTextBaseline:"middle",valueTextBaseline:"middle"}),xr(this,"markerGroup",void 0),xr(this,"labelGroup",void 0),xr(this,"valueGroup",void 0),xr(this,"background",void 0)}get showValue(){const{valueText:t}=this.attributes;return!!t&&("string"==typeof t||"number"==typeof t?""!==t:"function"==typeof t||""!==t.attr("text"))}get actualSpace(){const t=this.labelGroup,e=this.valueGroup,{markerSize:n}=this.attributes,{width:i,height:r}=t.node().getBBox(),{width:s,height:a}=e.node().getBBox();return{markerWidth:n,labelWidth:i,valueWidth:s,height:Math.max(n,r,a)}}get span(){const{span:t}=this.attributes;if(!t)return[1,1];const[e,n]=T(t),i=this.showValue?n:0,r=e+i;return[e/r,i/r]}get shape(){const{markerSize:t,width:e}=this.attributes,n=this.actualSpace,{markerWidth:i,height:r}=n;let{labelWidth:s,valueWidth:a}=this.actualSpace;const[o,l]=this.spacing;if(e){const n=e-t-o-l,[i,r]=this.span;[s,a]=[i*n,r*n]}return{width:i+s+a+o+l,height:r,markerWidth:i,labelWidth:s,valueWidth:a}}get spacing(){const{spacing:t}=this.attributes;if(!t)return[0,0];const[e,n]=T(t);return this.showValue?[e,n]:[e,0]}get layout(){const{markerWidth:t,labelWidth:e,valueWidth:n,width:i,height:r}=this.shape,[s,a]=this.spacing;return{height:r,width:i,markerWidth:t,labelWidth:e,valueWidth:n,position:[t/2,t+s,t+e+s+a]}}get scaleSize(){const t=function(t){const e=t.querySelector(wr.marker.class);return e?e.style:{}}(this.markerGroup.node()),{markerSize:e,markerStrokeWidth:n=t.strokeWidth,markerLineWidth:i=t.lineWidth,markerStroke:r=t.stroke}=this.attributes,s=+(n||i||(r?1:0))*Math.sqrt(2),{width:a,height:o}=this.markerGroup.node().getBBox();return(1-s/Math.max(a,o))*e}renderMarker(t){const{marker:e}=this.attributes,n=B(this.attributes,"marker");this.markerGroup=t.maybeAppendByClassName(wr.markerGroup,"g").style("zIndex",0),W(!!e,this.markerGroup,(()=>{var t;const i=this.markerGroup.node(),r=null===(t=i.childNodes)||void 0===t?void 0:t[0],s="string"==typeof e?new et({style:{symbol:e},className:wr.marker.name}):e();r?s.nodeName===r.nodeName?r instanceof et?r.update({...n,symbol:e}):(ki(r,s),G(r).styles(n)):(r.remove(),G(s).attr("className",wr.marker.name).styles(n),i.appendChild(s)):(s instanceof et||G(s).attr("className",wr.marker.name).styles(n),i.appendChild(s)),this.markerGroup.node().scale(1/this.markerGroup.node().getScale()[0]),Tn(this.markerGroup.node(),this.scaleSize,!0)}))}renderLabel(t){const{text:e,...n}=B(this.attributes,"label");this.labelGroup=t.maybeAppendByClassName(wr.labelGroup,"g").style("zIndex",0),this.labelGroup.maybeAppendByClassName(wr.label,(()=>On(e))).styles(n)}renderValue(t){const{text:e,...n}=B(this.attributes,"value");this.valueGroup=t.maybeAppendByClassName(wr.valueGroup,"g").style("zIndex",0),W(this.showValue,this.valueGroup,(()=>{this.valueGroup.maybeAppendByClassName(wr.value,(()=>On(e))).styles(n)}))}renderBackground(t){const{width:e,height:n}=this.shape,i=B(this.attributes,"background");this.background=t.maybeAppendByClassName(wr.backgroundGroup,"g").style("zIndex",-1),this.background.maybeAppendByClassName(wr.background,"rect").styles({width:e,height:n,...i})}adjustLayout(){const{layout:{labelWidth:t,valueWidth:e,height:n,position:[i,r,s]}}=this,a=n/2;this.markerGroup.styles({x:i,y:a}),this.labelGroup.styles({x:r,y:a}),ii(this.labelGroup.select(wr.label.class).node(),Math.ceil(t)),this.showValue&&(this.valueGroup.styles({x:s,y:a}),ii(this.valueGroup.select(wr.value.class).node(),Math.ceil(e)))}render(t,e){const n=G(e);this.renderMarker(n),this.renderLabel(n),this.renderValue(n),this.renderBackground(n),this.adjustLayout()}}function kr(t,e,n){return e=function(t){var e=function(t,e){if("object"!=typeof t||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var i=n.call(t,"string");if("object"!=typeof i)return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==typeof e?e:e+""}(e),e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}const Ar=$e({page:"item-page",navigator:"navigator",item:"item"},"items"),Lr=function(t,e){let n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];return t?e(t):n};class Pr extends x{constructor(t){super(t,{data:[],gridRow:1/0,gridCol:void 0,padding:0,width:1e3,height:100,rowPadding:0,colPadding:0,layout:"flex",orientation:"horizontal",click:fr,mouseenter:fr,mouseleave:fr}),kr(this,"navigator",void 0),kr(this,"navigatorShape",[0,0])}get pageViews(){return this.navigator.getContainer()}get grid(){const{gridRow:t,gridCol:e,data:n}=this.attributes;if(!t&&!e)throw new Error("gridRow and gridCol can not be set null at the same time");return t&&e?[t,e]:t?[t,n.length]:[n.length,e]}get renderData(){const{data:t,layout:e}=this.attributes,n=B(this.attributes,"item"),i=t.map(((i,r)=>{const{id:s=r,label:a,value:o}=i;return{id:"".concat(s),index:r,style:{layout:e,labelText:a,valueText:o,...Object.fromEntries(Object.entries(n).map((e=>{let[n,s]=e;return[n,gn(s,[i,r,t])]})))}}}));return i}getGridLayout(){const{orientation:t,width:e,rowPadding:n,colPadding:i}=this.attributes,[r]=this.navigatorShape,[s,a]=this.grid,o=a*s;let l=0;return this.pageViews.children.map(((c,u)=>{const h=Math.floor(u/o),d=u%o,p=this.ifHorizontal(a,s),f=[Math.floor(d/p),d%p];"vertical"===t&&f.reverse();const[g,m]=f,y=(e-r-(a-1)*i)/a,b=c.getBBox().height;let[v,x]=[0,0];return"horizontal"===t?([v,x]=[l,g*(b+n)],l=m===a-1?0:l+y+i):([v,x]=[m*(y+i),l],l=g===s-1?0:l+b+n),{page:h,index:u,row:g,col:m,pageIndex:d,width:y,height:b,x:v,y:x}}))}getFlexLayout(){const{width:t,height:e,rowPadding:n,colPadding:i}=this.attributes,[r]=this.navigatorShape,[s,a]=this.grid,[o,l]=[t-r,e];let[c,u,h,d,p,f,g,m]=[0,0,0,0,0,0,0,0];return this.pageViews.children.map(((t,e)=>{const{width:r,height:y}=t.getBBox(),b=0===g?0:i,v=g+b+r;return v<=o&&Lr(p,(t=>t<a))?([c,u,g]=[g+b,m,v],{width:r,height:y,x:c,y:u,page:h,index:e,pageIndex:d++,row:f,col:p++}):([f,p,g,m]=[f+1,0,0,m+y+n],m+y<=l&&Lr(f,(t=>t<s))?([c,u,g]=[g,m,r],{width:r,height:y,x:c,y:u,page:h,index:e,pageIndex:d++,row:f,col:p++}):([c,u,g,m,h,d,f,p]=[0,0,r,0,h+1,0,0,0],{width:r,height:y,x:c,y:u,page:h,index:e,pageIndex:d++,row:f,col:p++}))}))}get itemsLayout(){this.navigatorShape=[0,0];const t="grid"===this.attributes.layout?this.getGridLayout:this.getFlexLayout,e=t.call(this);return e.slice(-1)[0].page>0?(this.navigatorShape=[55,0],t.call(this)):e}ifHorizontal(t,e){const{orientation:n}=this.attributes;return Xi(n,t,e)}flattenPage(t){t.querySelectorAll(Ar.item.class).forEach((e=>{t.appendChild(e)})),t.querySelectorAll(Ar.page.class).forEach((e=>{t.removeChild(e).destroy()}))}renderItems(t){const{click:e,mouseenter:n,mouseleave:i}=this.attributes;this.flattenPage(t);const r=this.dispatchCustomEvent.bind(this);G(t).selectAll(Ar.item.class).data(this.renderData,(t=>t.id)).join((t=>t.append((t=>{let{style:e}=t;return new Sr({style:e})})).attr("className",Ar.item.name).on("click",(function(){null==e||e(this),r("itemClick",{item:this})})).on("pointerenter",(function(){null==n||n(this),r("itemMouseenter",{item:this})})).on("pointerleave",(function(){null==i||i(this),r("itemMouseleave",{item:this})}))),(t=>t.each((function(t){let{style:e}=t;this.update(e)}))),(t=>t.remove()))}relayoutNavigator(){var t;const{layout:e,width:n}=this.attributes,i=(null===(t=this.pageViews.children[0])||void 0===t?void 0:t.getBBox().height)||0,[r,s]=this.navigatorShape;this.navigator.update("grid"===e?{pageWidth:n-r,pageHeight:i-s}:{})}adjustLayout(){const e=Object.entries(gr(this.itemsLayout,"page")).map((t=>{let[e,n]=t;return{page:e,layouts:n}})),n=[...this.navigator.getContainer().children];e.forEach((e=>{let{layouts:i}=e;const r=this.pageViews.appendChild(new t.Group({className:Ar.page.name}));i.forEach((t=>{const{x:e,y:i,index:s,width:a,height:o}=t,l=n[s];r.appendChild(l),function(t,e,n){var i=t,r=U(e)?e.split("."):e;r.forEach((function(t,e){e<r.length-1?(Z(i[t])||(i[t]=O(r[e+1])?[]:{}),i=i[t]):i[t]=n}))}(l,"__layout__",t),l.update({x:e,y:i,width:a,height:o})}))})),this.relayoutNavigator()}renderNavigator(t){const{orientation:e}=this.attributes,n=B(this.attributes,"nav"),i=y({orientation:e},n),r=this;return t.selectAll(Ar.navigator.class).data(["nav"]).join((t=>t.append((()=>new vr({style:i}))).attr("className",Ar.navigator.name).each((function(){r.navigator=this}))),(t=>t.each((function(){this.update(i)}))),(t=>t.remove())),this.navigator}getBBox(){return this.navigator.getBBox()}render(t,e){const{data:n}=this.attributes;if(!n||0===n.length)return;const i=this.renderNavigator(G(e));this.renderItems(i.getContainer()),this.adjustLayout()}dispatchCustomEvent(e,n){const i=new t.CustomEvent(e,{detail:n});this.dispatchEvent(i)}}function Er(t,e,n){return e=function(t){var e=function(t,e){if("object"!=typeof t||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var i=n.call(t,"string");if("object"!=typeof i)return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==typeof e?e:e+""}(e),e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}class Br extends x{constructor(t){super(t,nr),Er(this,"titleGroup",void 0),Er(this,"title",void 0),Er(this,"itemsGroup",void 0),Er(this,"items",void 0)}renderTitle(t,e,n){const{showTitle:i,titleText:r}=this.attributes,s=B(this.attributes,"title"),[a,o]=M(s);this.titleGroup=t.maybeAppendByClassName(rr.titleGroup,"g").styles(o);const l={width:e,height:n,...a,text:i?r:""};this.title=this.titleGroup.maybeAppendByClassName(rr.title,(()=>new Wi({style:l}))).update(l)}renderItems(t,e){const{x:n,y:i,width:r,height:s}=e,a=B(this.attributes,"title",!0),[o,l]=M(a),c={...o,width:r,height:s,x:0,y:0};this.itemsGroup=t.maybeAppendByClassName(rr.itemsGroup,"g").styles({x:n,y:i,...l});const u=this;this.itemsGroup.selectAll(rr.items.class).data(["items"]).join((t=>t.append((()=>new Pr({style:c}))).attr("className",rr.items.name).each((function(){u.items=G(this)}))),(t=>t.update(c)),(t=>t.remove()))}adjustLayout(){const{showTitle:t}=this.attributes;if(t){const{x:t,y:e}=this.title.node().getAvailableSpace();this.itemsGroup.node().setLocalPosition(t,e)}}get availableSpace(){const{showTitle:t,width:e,height:n}=this.attributes;return t?this.title.node().getAvailableSpace():new Ii(0,0,e,n)}getBBox(){var t,e;const n=null===(t=this.title)||void 0===t?void 0:t.node(),i=null===(e=this.items)||void 0===e?void 0:e.node();return n&&i?function(t,e){const{position:n,spacing:i,inset:r,text:s}=t.attributes,a=t.getBBox(),o=e.getBBox(),l=Hi(n),[c,u,h,d]=T(s?i:0),[p,f,g,m]=T(r),[y,b]=[d+u,c+h],[v,x]=[m+f,p+g];if("l"===l[0])return new Ii(a.x,a.y,o.width+a.width+y+v,Math.max(o.height+x,a.height));if("t"===l[0])return new Ii(a.x,a.y,Math.max(o.width+v,a.width),o.height+a.height+b+x);const[w,S]=[e.attributes.width||o.width,e.attributes.height||o.height];return new Ii(o.x,o.y,w+a.width+y+v,S+a.height+b+x)}(n,i):super.getBBox()}render(t,e){const{width:n,height:i}=t,r=G(e);this.renderTitle(r,n,i),this.renderItems(r,this.availableSpace),this.adjustLayout()}}function Cr(t){var e=document.createElement("div");e.innerHTML=t;var n=e.childNodes[0];return n&&e.contains(n)&&e.removeChild(n),n}function Mr(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return{CONTAINER:"".concat(t,"tooltip"),TITLE:"".concat(t,"tooltip-title"),LIST:"".concat(t,"tooltip-list"),LIST_ITEM:"".concat(t,"tooltip-list-item"),NAME:"".concat(t,"tooltip-list-item-name"),MARKER:"".concat(t,"tooltip-list-item-marker"),NAME_LABEL:"".concat(t,"tooltip-list-item-name-label"),VALUE:"".concat(t,"tooltip-list-item-value"),CROSSHAIR_X:"".concat(t,"tooltip-crosshair-x"),CROSSHAIR_Y:"".concat(t,"tooltip-crosshair-y")}}const Or={overflow:"hidden","white-space":"nowrap","text-overflow":"ellipsis"};function Tr(){const t=Mr(arguments.length>0&&void 0!==arguments[0]?arguments[0]:"");return{[".".concat(t.CONTAINER)]:{position:"absolute",visibility:"visible","z-index":8,transition:"visibility 0.2s cubic-bezier(0.23, 1, 0.32, 1), left 0.4s cubic-bezier(0.23, 1, 0.32, 1), top 0.4s cubic-bezier(0.23, 1, 0.32, 1)","background-color":"rgba(255, 255, 255, 0.96)","box-shadow":"0 6px 12px 0 rgba(0, 0, 0, 0.12)","border-radius":"4px",color:"rgba(0, 0, 0, 0.65)","font-size":"12px","line-height":"20px",padding:"12px","min-width":"120px","max-width":"360px","font-family":"Roboto-Regular"},[".".concat(t.TITLE)]:{color:"rgba(0, 0, 0, 0.45)"},[".".concat(t.LIST)]:{margin:"0px","list-style-type":"none",padding:"0px"},[".".concat(t.LIST_ITEM)]:{"list-style-type":"none",display:"flex","line-height":"2em","align-items":"center","justify-content":"space-between","white-space":"nowrap"},[".".concat(t.MARKER)]:{width:"8px",height:"8px","border-radius":"50%",display:"inline-block","margin-right":"4px"},[".".concat(t.NAME)]:{display:"flex","align-items":"center","max-width":"216px"},[".".concat(t.NAME_LABEL)]:{flex:1,...Or},[".".concat(t.VALUE)]:{display:"inline-block",float:"right",flex:1,"text-align":"right","min-width":"28px","margin-left":"30px",color:"rgba(0, 0, 0, 0.85)",...Or},[".".concat(t.CROSSHAIR_X)]:{position:"absolute",width:"1px","background-color":"rgba(0, 0, 0, 0.25)"},[".".concat(t.CROSSHAIR_Y)]:{position:"absolute",height:"1px","background-color":"rgba(0, 0, 0, 0.25)"}}}function jr(t,e,n){return e=function(t){var e=function(t,e){if("object"!=typeof t||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var i=n.call(t,"string");if("object"!=typeof i)return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==typeof e?e:e+""}(e),e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}class Nr extends x{get HTMLTooltipElement(){return this.element}getContainer(){return this.element}get elementSize(){return{width:this.element.offsetWidth,height:this.element.offsetHeight}}get HTMLTooltipItemsElements(){const{data:t,template:e}=this.attributes;return t.map(((t,n)=>{let{name:i="",color:r="black",index:s,...a}=t;const o={name:i,color:r,index:null!=s?s:n,...a};return Cr((l=e.item,c=o,l&&c?l.replace(/\\?\{([^{}]+)\}/g,(function(t,e){return"\\"===t.charAt(0)?t.slice(1):void 0===c[e]?"":c[e]})):l));var l,c}))}constructor(t){var e;const n=null===(e=t.style)||void 0===e||null===(e=e.template)||void 0===e?void 0:e.prefixCls,i=Mr(n);super(t,{data:[],x:0,y:0,visibility:"visible",title:"",position:"bottom-right",offset:[5,5],enterable:!1,container:{x:0,y:0},bounding:null,template:{prefixCls:"",container:'<div class="'.concat(i.CONTAINER,'"></div>'),title:'<div class="'.concat(i.TITLE,'"></div>'),item:'<li class="'.concat(i.LIST_ITEM,'" data-index={index}>\n <span class="').concat(i.NAME,'">\n <span class="').concat(i.MARKER,'" style="background:{color}"></span>\n <span class="').concat(i.NAME_LABEL,'" title="{name}">{name}</span>\n </span>\n <span class="').concat(i.VALUE,'" title="{value}">{value}</span>\n </li>')},style:Tr(n)}),jr(this,"timestamp",-1),jr(this,"element",void 0),jr(this,"prevCustomContentKey",this.attributes.contentKey),this.initShape(),this.render(this.attributes,this)}render(t,e){this.renderHTMLTooltipElement(),this.updatePosition()}destroy(){var t;null===(t=this.element)||void 0===t||t.remove(),super.destroy()}show(t,e){if(void 0!==t&&void 0!==e){const n=()=>{this.attributes.x=null!=t?t:this.attributes.x,this.attributes.y=null!=e?e:this.attributes.y,this.updatePosition()};"hidden"===this.element.style.visibility?this.closeTransition(n):n()}this.element.style.visibility="visible"}hide(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;const{enterable:n}=this.attributes;n&&this.isCursorEntered(t,e)||(this.element.style.visibility="hidden")}initShape(){const{template:t}=this.attributes;this.element=Cr(t.container),this.id&&this.element.setAttribute("id",this.id)}renderCustomContent(){if(void 0!==this.prevCustomContentKey&&this.prevCustomContentKey===this.attributes.contentKey)return;this.prevCustomContentKey=this.attributes.contentKey;const{content:t}=this.attributes;t&&("string"==typeof t?this.element.innerHTML=t:this.element.replaceChildren(t))}renderHTMLTooltipElement(){const{template:t,title:e,enterable:n,style:i,content:r}=this.attributes,s=Mr(t.prefixCls),a=this.element;if(this.element.style.pointerEvents=n?"auto":"none",r)this.renderCustomContent();else{var o;e?(a.innerHTML=t.title,a.getElementsByClassName(s.TITLE)[0].innerHTML=e):null===(o=a.getElementsByClassName(s.TITLE))||void 0===o||null===(o=o[0])||void 0===o||o.remove();const n=this.HTMLTooltipItemsElements,i=document.createElement("ul");i.className=s.LIST,i.replaceChildren(...n);const r=this.element.querySelector(".".concat(s.LIST));r?r.replaceWith(i):a.appendChild(i)}P(a,i)}getRelativeOffsetFromCursor(t){const{position:e,offset:n}=this.attributes,i=(t||e).split("-"),r={left:[-1,0],right:[1,0],top:[0,-1],bottom:[0,1]},{width:s,height:a}=this.elementSize;let o=[-s/2,-a/2];return i.forEach((t=>{const[e,i]=o,[l,c]=r[t];o=[e+(s/2+n[0])*l,i+(a/2+n[1])*c]})),o}setOffsetPosition(t){let[e,n]=t;const{x:i=0,y:r=0,container:{x:s,y:a}}=this.attributes;this.element.style.left="".concat(+i+s+e,"px"),this.element.style.top="".concat(+r+a+n,"px")}updatePosition(){const{showDelay:t=60}=this.attributes,e=Date.now();this.timestamp>0&&e-this.timestamp<t||(this.timestamp=e,this.setOffsetPosition(this.autoPosition(this.getRelativeOffsetFromCursor())))}autoPosition(t){let[e,n]=t;const{x:i,y:r,bounding:s,position:a}=this.attributes;if(!s)return[e,n];const{offsetWidth:o,offsetHeight:l}=this.element,[c,u]=[+i+e,+r+n],h={left:"right",right:"left",top:"bottom",bottom:"top"},{x:d,y:p,width:f,height:g}=s,m={left:c<d,right:c+o>d+f,top:u<p,bottom:u+l>p+g},y=[];a.split("-").forEach((t=>{m[t]?y.push(h[t]):y.push(t)}));const b=y.join("-");return this.getRelativeOffsetFromCursor(b)}isCursorEntered(t,e){if(this.element){const{x:n,y:i,width:r,height:s}=this.element.getBoundingClientRect();return new Ii(n,i,r,s).isPointIn(t,e)}return!1}closeTransition(t){const e=this.element.style.transition;this.element.style.transition="none",t(),setTimeout((()=>{this.element.style.transition=e}),10)}}jr(Nr,"tag","tooltip");const _r={default:{sizeStyle:{width:44,height:22,radius:11},tagStyle:{textStyle:{fontSize:12,lineHeight:16,fill:"#fff"},padding:0},markerStyle:{size:11}},small:{sizeStyle:{width:28,height:16,radius:8},tagStyle:{textStyle:{fontSize:10,lineHeight:14,fill:"#fff"},padding:0},markerStyle:{size:8}},mini:{sizeStyle:{width:20,height:14,radius:7},tagStyle:{textStyle:{fontSize:7,lineHeight:10,fill:"#fff"},padding:0},markerStyle:{size:7}}};function zr(t,e,n){return e=function(t){var e=function(t,e){if("object"!=typeof t||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var i=n.call(t,"string");if("object"!=typeof i)return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==typeof e?e:e+""}(e),e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Ir(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];const i=Number(t.style.height)-2*e;return{x:n?Number(t.style.width)+Number(t.style.x)-e-i:Number(t.style.x)+e,y:Number(t.style.y)+e,width:i,height:i,radius:i/2}}class Fr extends x{constructor(t){super(t,{x:0,y:0,size:"default",spacing:2,checked:!0,disabled:!1}),zr(this,"checked",void 0)}render(t,e){const{size:n,spacing:i,disabled:r,checked:s,unCheckedChildren:a,checkedChildren:o}=t,l=G(e).maybeAppendByClassName("switch-content","g").node(),c=l.getLocalBounds(),{sizeStyle:u,tagStyle:h}=Ln(_r,n,_r.default),d=r?"no-drop":"pointer",p=s?"#1890FF":"#00000040";let f=u;const g=s?o:a;(o||a)&&G(l).maybeAppendByClassName("switch-tag",(()=>new nt({}))).call((t=>{const e=t.node();e.update({cursor:d,backgroundStyle:null,text:!1,marker:!1,...h,...g});const{max:n,min:i}=(null==e?void 0:e.getLocalBounds())||{},r=n[0]-i[0]+u.radius,a=n[1]-i[1],o=Math.max(r+u.height+2,u.width);f={...u,width:o},e.update(function(t,e){let{width:n,height:i}=e,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;return{x:arguments.length>3&&void 0!==arguments[3]&&!arguments[3]?Number(t.width)+Number(t.x)-n:Number(t.x)+r,y:Number(t.y)+(Number(t.height)-i)/2}}({x:c.min[0],y:c.min[1],width:o,height:f.height},{width:r,height:a},f.radius,s))}));const m=G(l).maybeAppendByClassName("switch-background","rect").styles({zIndex:(l.style.zIndex||0)-1,x:c.min[0],y:c.min[1],fill:p,cursor:d,fillOpacity:r?.4:1,...f}).node(),y=G(l).maybeAppendByClassName("switch-background-stroke","rect").styles({zIndex:(l.style.zIndex||0)-2,x:c.min[0],y:c.min[1],stroke:p,lineWidth:0,...f}).node();G(l).maybeAppendByClassName("switch-handle","rect").styles({fill:"#fff",cursor:d}).call((t=>{const e=t.node(),n=Ir(m,i,s),r=Ir(m,i,!s);var a,o;e.attr("x")&&!ge(n,r)&&this.checked!==s?(e.attr(r),null===(a=e.getAnimations()[0])||void 0===a||a.cancel(),null===(o=y.getAnimations()[0])||void 0===o||o.cancel(),e.animate([{x:r.x},{x:n.x}],{duration:120,fill:"both"}),y.animate([{lineWidth:0,strokeOpacity:.5},{lineWidth:14,strokeOpacity:0}],{duration:400,easing:"ease-on"})):e.attr(n)})),this.checked=!!s}}zr(Fr,"tag","switch");const Gr={tagText:"",lineStroke:"#416180",lineStrokeOpacity:.45,lineLineWidth:1,lineLineDash:[5,5]},Hr=y({},Gr,{type:"line",tagPosition:"start",tagAlign:"center",tagVerticalAlign:"bottom"}),Vr=y({},Gr,{type:"circle",defaultRadius:0}),Wr=y({},Gr,{type:"polygon",defaultRadius:0,startAngle:0});function Dr(t,e,n){return e=function(t){var e=function(t,e){if("object"!=typeof t||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var i=n.call(t,"string");if("object"!=typeof i)return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==typeof e?e:e+""}(e),e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}class Rr extends x{get localPointer(){const[t,e]=this.getPosition(),[n,i]=this.pointer;return[n-t,i-e]}get tagStyle(){return B(this.attributes,"tag")}get crosshairStyle(){return{...B(this.attributes,"line"),path:this.crosshairPath}}constructor(t){super(t,Gr),Dr(this,"pointer",void 0),Dr(this,"shapesGroup",void 0),Dr(this,"tagShape",void 0),Dr(this,"crosshairShape",void 0)}render(t,e){const n=G(e).maybeAppendByClassName(".crosshair-group","g").node();this.shapesGroup=n;const i=this.tagStyle,r=this.crosshairStyle;this.tagShape=G(n).maybeAppendByClassName("crosshair-tag",(()=>new nt({style:i}))).styles(i).node(),this.crosshairShape=G(n).maybeAppendByClassName(".crosshair-path","path").styles(r).node(),this.adjustLayout()}setPointer(t){this.pointer=t}}function Yr(t,e,n){return e=function(t){var e=function(t,e){if("object"!=typeof t||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var i=n.call(t,"string");if("object"!=typeof i)return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==typeof e?e:e+""}(e),e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}Dr(Rr,"tag","crosshair-base");class qr extends Rr{get crosshairPath(){const{startPos:[t,e],endPos:[n,i]}=this.attributes;return[["M",0,0],["L",n-t,i-e],["Z"]]}get localPointer(){if(!this.pointer)return this.attributes.startPos;const[t,e]=this.getPosition(),[n,i]=this.pointer;return[n-t,i-e]}get isVertical(){const{startPos:[t,e],endPos:[n,i]}=this.attributes;return t===n&&e!==i}get tagShapeSpace(){const{width:t,height:e}=bi(this.tagShape);return{width:t,height:e}}constructor(t){super(y({},qr.defaultOptions,t))}update(t){super.update(t)}setPointer(t){super.setPointer(t),this.adjustPosition()}setText(t){this.tagShape.update({text:t}),this.adjustTag()}adjustLayout(){this.adjustPosition(),this.adjustTag()}adjustPosition(){const[t,e]=this.localPointer,{startPos:[n,i]}=this.attributes,r=this.getOrientVal([n,e],[t,i]);this.shapesGroup.setLocalPosition(r)}adjustTag(){const{tagText:t,tagPosition:e,startPos:[n,i],endPos:[r,o]}=this.attributes;if(!t||""===t)return void a(this.tagShape);s(this.tagShape);const{width:l,height:c}=this.tagShapeSpace,[u,h]=this.getOrientVal({start:[-l/2,c/2],end:[r-n+l/2,c/2]},{start:[0,0],end:[0,o-i+c]})[e];this.tagShape.setLocalPosition(u,h)}getOrientVal(t,e){return this.isVertical?e:t}}function Kr(t,e,n){return e=function(t){var e=function(t,e){if("object"!=typeof t||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var i=n.call(t,"string");if("object"!=typeof i)return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==typeof e?e:e+""}(e),e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}Yr(qr,"tag","line-crosshair"),Yr(qr,"defaultOptions",{style:Hr});class Zr extends Rr{get crosshairPath(){return this.createCirclePath()}constructor(t){super(y({},Zr.defaultOptions,t))}update(t){super.update(t)}setPointer(t){let[e,n]=t;super.setPointer([e,n]);const[i,r]=this.localPointer,{center:[s,a]}=this.attributes,o=this.createCirclePath(((i-s)**2+(r-a)**2)**.5);this.crosshairShape.attr({path:o})}adjustLayout(){a(this.tagShape)}createCirclePath(t){const{center:[e,n],defaultRadius:i}=this.attributes;return D(e,n,t||i)}}function Ur(t,e){let[n,i]=t,[r,s]=e;return((n-r)**2+(i-s)**2)**.5}function $r(t,e,n,i,r,s){return(t===e||Math.min(t,e)<=r&&r<=Math.max(t,e))&&(n===i||Math.min(n,i)<=s&&s<=Math.max(n,i))}function Xr(t,e,n){const i=t;(!t.length||e<t[0]||e===t[0]&&n<t[1])&&(i[0]=e,i[1]=n)}function Jr(t,e,n,i){let[r,s]=t,[a,o]=e,[l,c]=n,[u,h]=i;const d=[];if((h-c)*(a-r)==(o-s)*(u-l))(o-s)*(l-r)==(c-s)*(a-r)&&($r(r,a,s,o,l,c)&&Xr(d,l,c),$r(r,a,s,o,u,h)&&Xr(d,u,h),$r(l,u,c,h,r,s)&&Xr(d,r,s),$r(l,u,c,h,a,o)&&Xr(d,a,o));else{const t=(l*(h-c)+s*(u-l)-c*(u-l)-r*(h-c))/((a-r)*(h-c)-(u-l)*(o-s)),e=(r*(o-s)+c*(a-r)-s*(a-r)-l*(o-s))/((u-l)*(o-s)-(a-r)*(h-c));t>=0&&t<=1&&e>=0&&e<=1&&(d[0]=r+t*(a-r),d[1]=s+t*(o-s))}return d}function Qr(t,e,n){return e=function(t){var e=function(t,e){if("object"!=typeof t||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var i=n.call(t,"string");if("object"!=typeof i)return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==typeof e?e:e+""}(e),e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}Kr(Zr,"tag","circle-crosshair"),Kr(Zr,"defaultOptions",{style:Vr});class ts extends Rr{get crosshairPath(){return this.createPolygonPath()}constructor(t){super(y({},ts.defaultOptions,t))}update(t){super.update(t)}get points(){const{startAngle:t,sides:e}=this.attributes,n=2*Math.PI/e,i=[1,0],r=[];for(let s=0;s<e;s+=1)r.push(ke(i,[0,0],t/180*Math.PI+n*s));return r}setPointer(t){let[e,n]=t;super.setPointer([e,n]);const[i,r]=this.localPointer,{center:s}=this.attributes,[a,o]=this.intersection([i,r]);if(!a||!o)return;const l=Ur(s,[i,r])/Ur(s,[a,o]),c=this.createPolygonPath(l);this.crosshairShape.attr({path:c})}adjustLayout(){a(this.tagShape)}createPolygonPath(t){const{defaultRadius:e,center:[n,i]}=this.attributes,r=this.points.map(((r,s)=>{let[a,o]=r;const[l,c]=me([a,o],t||e);return[0===s?"M":"L",n+l,i+c]}));return r.push(["Z"]),r}intersection(t){let[e,n]=t;const{points:i}=this,{center:[r,s]}=this.attributes;let a,o;for(let t=1;t<=i.length;t+=1){const[l,c]=i[t-1],[u,h]=i[t%i.length],d=Jr([e,n],[r,s],[l+r,c+s],[u+r,h+s]);0!==d.length&&([a,o]=d)}return[a,o]}}Qr(ts,"tag","polygon-crosshair"),Qr(ts,"defaultOptions",{style:Wr});const es=C({fill:"rgba(0,0,0,0.45)",fontSize:10,textAlign:"start",textBaseline:"middle",overflow:"clip"},"label"),ns={width:12,height:12,radius:2,stroke:"#dadada",lineWidth:1,fill:"#ffffff",cursor:"pointer"},is={width:12,height:12,radius:2,stroke:"#3471F9",lineWidth:1,fill:"#3471F9",cursor:"pointer"},rs={path:[["M",3,6],["L","5","8.5"],["L","8.5","4"]],lineWidth:1,cursor:"pointer"};function ss(t,e,n){return e=function(t){var e=function(t,e){if("object"!=typeof t||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var i=n.call(t,"string");if("object"!=typeof i)return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==typeof e?e:e+""}(e),e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}class as extends x{constructor(t){super(t,{x:0,y:0,labelText:"",spacing:4,checked:!1,...es}),ss(this,"checkboxBoxShape",void 0),ss(this,"checked",void 0)}render(t,e){const{checked:n,spacing:i}=t;this.checked=!!n;const r=H(e,".checkbox-content","g").attr("className","checkbox-content").node(),s=B(t,"box"),a=B(t,"checked"),o=B(t,"label"),l={...this.checked?is:ns,...s},c={...rs,...a};this.checkboxBoxShape=H(r,".checkbox-box","rect").styles({className:"checkbox-box",zIndex:(r.style.zIndex||0)-1,...l}).node(),H(this.checkboxBoxShape,".checkbox-checked","path").styles({className:"checkbox-box-checked",stroke:"#fff",...c});const{x:u,y:h}=function(t,e){const n=t.getLocalBounds();return{x:n.halfExtents[0]?n.max[0]+(e||0):t.style.x,y:n.halfExtents[1]?(n.min[1]+n.max[1])/2:t.style.y}}(this.checkboxBoxShape,Number(i));H(r,".checkbox-label","text").styles({className:"checkbox-label",x:u,y:h,...o})}}function os(t,e){for(var n in e)e.hasOwnProperty(n)&&"constructor"!==n&&void 0!==e[n]&&(t[n]=e[n])}ss(as,"tag","checkbox");const ls="component-poptip",cs="component-poptip-arrow",us="component-poptip-text",hs={[".".concat(ls)]:{visibility:"visible",position:"absolute","background-color":"rgba(0, 0, 0)","box-shadow":"0px 0px 10px #aeaeae","border-radius":"3px",color:"#fff",opacity:.8,"font-size":"12px",padding:"4px 6px",display:"flex","justify-content":"center","align-items":"center","z-index":8,transition:"visibility 50ms"},[".".concat(us)]:{"text-align":"center"},[".".concat(ls,"[data-position='top']")]:{transform:"translate(-50%, -100%)"},[".".concat(ls,"[data-position='left']")]:{transform:"translate(-100%, -50%)"},[".".concat(ls,"[data-position='right']")]:{transform:"translate(0, -50%)"},[".".concat(ls,"[data-position='bottom']")]:{transform:"translate(-50%, 0)"},[".".concat(ls,"[data-position='top-left']")]:{transform:"translate(0,-100%)"},[".".concat(ls,"[data-position='top-right']")]:{transform:"translate(-100%,-100%)"},[".".concat(ls,"[data-position='left-top']")]:{transform:"translate(-100%, 0)"},[".".concat(ls,"[data-position='left-bottom']")]:{transform:"translate(-100%, -100%)"},[".".concat(ls,"[data-position='right-top']")]:{transform:"translate(0, 0)"},[".".concat(ls,"[data-position='right-bottom']")]:{transform:"translate(0, -100%)"},[".".concat(ls,"[data-position='bottom-left']")]:{transform:"translate(0, 0)"},[".".concat(ls,"[data-position='bottom-right']")]:{transform:"translate(-100%, 0)"},[".".concat(cs)]:{width:"4px",height:"4px",transform:"rotate(45deg)","background-color":"rgba(0, 0, 0)",position:"absolute","z-index":-1},[".".concat(ls,"[data-position='top']")]:{transform:"translate(-50%, calc(-100% - 5px))"},["[data-position='top'] .".concat(cs)]:{bottom:"-2px"},[".".concat(ls,"[data-position='left']")]:{transform:"translate(calc(-100% - 5px), -50%)"},["[data-position='left'] .".concat(cs)]:{right:"-2px"},[".".concat(ls,"[data-position='right']")]:{transform:"translate(5px, -50%)"},["[data-position='right'] .".concat(cs)]:{left:"-2px"},[".".concat(ls,"[data-position='bottom']")]:{transform:"translate(-50%, 5px)"},["[data-position='bottom'] .".concat(cs)]:{top:"-2px"},[".".concat(ls,"[data-position='top-left']")]:{transform:"translate(0, calc(-100% - 5px))"},["[data-position='top-left'] .".concat(cs)]:{left:"10px",bottom:"-2px"},[".".concat(ls,"[data-position='top-right']")]:{transform:"translate(-100%, calc(-100% - 5px))"},["[data-position='top-right'] .".concat(cs)]:{right:"10px",bottom:"-2px"},[".".concat(ls,"[data-position='left-top']")]:{transform:"translate(calc(-100% - 5px), 0)"},["[data-position='left-top'] .".concat(cs)]:{right:"-2px",top:"8px"},[".".concat(ls,"[data-position='left-bottom']")]:{transform:"translate(calc(-100% - 5px), -100%)"},["[data-position='left-bottom'] .".concat(cs)]:{right:"-2px",bottom:"8px"},[".".concat(ls,"[data-position='right-top']")]:{transform:"translate(5px, 0)"},["[data-position='right-top'] .".concat(cs)]:{left:"-2px",top:"8px"},[".".concat(ls,"[data-position='right-bottom']")]:{transform:"translate(5px, -100%)"},["[data-position='right-bottom'] .".concat(cs)]:{left:"-2px",bottom:"8px"},[".".concat(ls,"[data-position='bottom-left']")]:{transform:"translate(0, 5px)"},["[data-position='bottom-left'] .".concat(cs)]:{top:"-2px",left:"8px"},[".".concat(ls,"[data-position='bottom-right']")]:{transform:"translate(-100%, 5px)"},["[data-position='bottom-right'] .".concat(cs)]:{top:"-2px",right:"8px"}};function ds(t){let e=t&&document.getElementById(t);return e||(e=document.createElement("div"),e.setAttribute("id",t),document.body.appendChild(e)),e}function ps(t,e,n){return e=function(t){var e=function(t,e){if("object"!=typeof t||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var i=n.call(t,"string");if("object"!=typeof i)return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==typeof e?e:e+""}(e),e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}class fs extends x{get visible(){return"visible"===this.visibility}constructor(t){super(at({style:{id:"component-poptip"}},fs.defaultOptions,t)),ps(this,"container",void 0),ps(this,"visibility","visible"),ps(this,"map",new Map),ps(this,"domStyles",""),this.initShape(),this.render(this.attributes,this)}render(t,e){this.visibility=this.style.visibility,this.updatePoptipElement()}update(t){this.attr(at({},this.style,t)),this.render(this.attributes,this)}bind(t,e){if(!t)return;const{text:n}=this.style,i=i=>{let r=t,s=this.style,a=n;if(e){const{html:t,target:n,...u}="function"==typeof e?e.call(null,i):e;o={},c=u,(l=this.style)&&os(o,l),c&&os(o,c),s=o,(n||!1===n)&&(r=n),"string"==typeof t&&(a=t)}var o,l,c;const{position:u,arrowPointAtCenter:h,follow:d,offset:p}=s;if(r){const{clientX:t,clientY:e}=i,[n,s]=function(t,e,n,i){let r=arguments.length>4&&void 0!==arguments[4]&&arguments[4];if(arguments.length>5&&void 0!==arguments[5]&&arguments[5])return[t,e];const{x:s,y:a,width:o,height:l}=n.getBoundingClientRect();switch(i){case"top":return r?[s+o/2,a]:[t,a];case"left":return r?[s,a+l/2]:[s,e];case"bottom":return r?[s+o/2,a+l]:[t,a+l];case"right":return r?[s+o,a+l/2]:[s+o,e];case"top-right":case"right-top":return[s+o,a];case"left-bottom":case"bottom-left":return[s,a+l];case"right-bottom":case"bottom-right":return[s+o,a+l];default:return[s,a]}}(t,e,r,u,h,d);this.showTip(n,s,{text:a,position:u,offset:p})}else this.hideTip()},r=()=>{this.hideTip()};t.addEventListener("mousemove",i),t.addEventListener("mouseleave",r),this.map.set(t,[i,r])}unbind(t){if(this.map.has(t)){const[e,n]=this.map.get(t)||[];e&&t.removeEventListener("mousemove",e),n&&t.removeEventListener("mouseleave",n),this.map.delete(t)}}clear(){this.container.innerHTML=""}destroy(){var t;[...this.map.keys()].forEach((t=>this.unbind(t))),null===(t=this.container)||void 0===t||t.remove(),super.destroy()}showTip(t,e,n){const i=Ln(n,"text");if((!i||"string"==typeof i)&&(this.applyStyles(),t&&e&&n)){const{offset:r,position:s}=n;if(s&&this.container.setAttribute("data-position",s),this.setOffsetPosition(t,e,r),"string"==typeof i){const t=this.container.querySelector(".".concat(us));t&&(t.innerHTML=i)}this.visibility="visible",this.container.style.visibility="visible"}}hideTip(){this.visibility="hidden",this.container.style.visibility="hidden"}getContainer(){return this.container}getClassName(){const{containerClassName:t}=this.style;return"".concat(ls).concat(t?" ".concat(t):"")}initShape(){const{id:t}=this.style;this.container=function(t){const e=(t=>{let e;return function(){for(var n=arguments.length,i=new Array(n),r=0;r<n;r++)i[r]=arguments[r];return e||(e=t.apply(void 0,i)),e}})(ds)(t);return e}(t),this.container.className=this.getClassName(),this.container.addEventListener("mousemove",(()=>this.showTip())),this.container.addEventListener("mouseleave",(()=>this.hideTip()))}updatePoptipElement(){const{container:t}=this;this.clear();const{id:e,template:n,text:i}=this.style;this.container.setAttribute("id",e),this.container.className=this.getClassName();const r='<span class="'.concat(cs,'"></span>');var s;t.innerHTML=r,U(n)?t.innerHTML+=n:n&&((s=n)instanceof Element||s instanceof Document)&&t.appendChild(n),i&&(t.getElementsByClassName(us)[0].textContent=i),this.applyStyles(),this.container.style.visibility=this.visibility}applyStyles(){const t=y({},hs,this.style.domStyles),e=Object.entries(t).reduce(((t,e)=>{let[n,i]=e;const r=Object.entries(i).reduce(((t,e)=>{let[n,i]=e;return"".concat(t).concat(n,": ").concat(i,";")}),"");return"".concat(t).concat(n,"{").concat(r,"}")}),"");if(this.domStyles!==e){this.domStyles=e;let t=this.container.querySelector("style");t&&this.container.removeChild(t),t=document.createElement("style"),t.innerHTML=e,this.container.appendChild(t)}}setOffsetPosition(t,e){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:this.style.offset;const[i=0,r=0]=n;this.container.style.left="".concat(t+i,"px"),this.container.style.top="".concat(e+r,"px")}}function gs(t){let e=1/0,n=1/0,i=-1/0,r=-1/0;for(let s=0;s<t.length;s++){const{x:a,y:o,width:l,height:c}=t[s],[u,h]=[a+l,o+c];a<e&&(e=a),o<n&&(n=o),u>i&&(i=u),h>r&&(r=h)}return new Ii(e,n,i-e,r-n)}ps(fs,"tag","poptip"),ps(fs,"defaultOptions",{style:{x:0,y:0,width:0,height:0,target:null,visibility:"hidden",text:"",position:"top",follow:!1,offset:[0,0],domStyles:hs,template:'<div class="'.concat(us,'"></div>')}});const ms=function(t,e,n){const{width:i,height:r}=t,{flexDirection:s="row",flexWrap:a="nowrap",justifyContent:o="flex-start",alignContent:l="flex-start",alignItems:c="flex-start"}=n,u="row"===s,h="row"===s||"column"===s,d=u?h?[1,0]:[-1,0]:h?[0,1]:[0,-1];let[p,f]=[0,0];const g=e.map((t=>{const{width:e,height:n}=t,[i,r]=[p,f];return[p,f]=[p+e*d[0],f+n*d[1]],new Ii(i,r,e,n)})),m=gs(g),y={"flex-start":0,"flex-end":u?i-m.width:r-m.height,center:u?(i-m.width)/2:(r-m.height)/2},b=g.map((t=>{const{x:e,y:n}=t,i=Ii.fromRect(t);return i.x=u?e+y[o]:e,i.y=u?n:n+y[o],i})),v=(gs(b),t=>{const[e,n]=u?["height",r]:["width",i];switch(c){case"flex-start":default:return 0;case"flex-end":return n-t[e];case"center":return n/2-t[e]/2}});return b.map((t=>{const{x:e,y:n}=t,i=Ii.fromRect(t);return i.x=u?e:e+v(i),i.y=u?n+v(i):n,i})).map((e=>{var n,i;const r=Ii.fromRect(e);return r.x+=null!==(n=t.x)&&void 0!==n?n:0,r.y+=null!==(i=t.y)&&void 0!==i?i:0,r}))},ys=function(t,e,n){return[]},bs=(t,e,n)=>{if(0===e.length)return[];const i={flex:ms,grid:ys},r=n.display in i?i[n.display]:null;return(null==r?void 0:r.call(null,t,e,n))||[]};function vs(t,e,n){return e=function(t){var e=function(t,e){if("object"!=typeof t||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var i=n.call(t,"string");if("object"!=typeof i)return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==typeof e?e:e+""}(e),e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}class xs extends t.Group{set margin(t){this.$margin=T(t)}get margin(){return this.$margin}set padding(t){this.$padding=T(t)}get padding(){return this.$padding}getBBox(){const{x:t=0,y:e=0,width:n,height:i}=this.attributes,[r,s,a,o]=this.$margin;return new Ii(t-o,e-r,n+o+s,i+r+a)}appendChild(t,e){return t.isMutationObserved=!0,super.appendChild(t,e),t}getAvailableSpace(){const{width:t,height:e}=this.attributes,[n,i,r,s]=this.$padding,[a,,,o]=this.$margin;return new Ii(s+o,n+a,t-s-i,e-n-r)}constructor(e){super(e),vs(this,"layoutEvents",[t.ElementEvent.BOUNDS_CHANGED,t.ElementEvent.INSERTED,t.ElementEvent.REMOVED]),vs(this,"$margin",T(0)),vs(this,"$padding",T(0));const{margin:n=0,padding:i=0}=e.style||{};this.margin=n,this.padding=i,this.isMutationObserved=!0,this.bindEvents()}layout(){if(this.attributes.display&&this.isConnected&&!this.children.some((t=>!t.isConnected)))try{const t=bs(this.getAvailableSpace(),this.children.map((t=>t.getBBox())),this.attributes);this.children.forEach(((e,n)=>{const{x:i,y:r}=t[n];e.attr({x:i,y:r})}))}catch(t){}}bindEvents(){this.layoutEvents.forEach((t=>{this.addEventListener(t,(t=>{t.target.isMutationObserved=!0,this.layout()}))}))}attributeChangedCallback(t,e,n){"margin"===t?this.margin=n:"padding"===t&&(this.padding=n),this.layout()}}function ws(t,e,n){return e=function(t){var e=function(t,e){if("object"!=typeof t||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var i=n.call(t,"string");if("object"!=typeof i)return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==typeof e?e:e+""}(e),e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}class Ss extends x{get padding(){return T(this.style.padding)}renderLabel(){const{label:t,value:e}=this.style,n=B(this.attributes,"label");G(this.label).maybeAppend(".label",(()=>On(t))).attr("className","label").styles(n),this.label.attr("__data__",e)}renderBackground(){const t=this.label.getBBox(),[e,n,i,r]=this.padding,{width:s,height:a}=t,o=s+r+n,l=a+e+i,c=B(this.attributes,"background"),{width:u=0,height:h=0,selected:d}=this.style;this.background.attr({...c,width:Math.max(o,u),height:Math.max(l,h),fill:d?this.selectedColor:"#fff"}),this.label.attr({x:r,y:(l-a)/2})}constructor(e){super(y({},Ss.defaultOptions,e)),ws(this,"hoverColor","#f5f5f5"),ws(this,"selectedColor","#e6f7ff"),ws(this,"background",this.appendChild(new t.Rect({}))),ws(this,"label",this.background.appendChild(new t.Group({})))}render(){this.renderLabel(),this.renderBackground()}bindEvents(){this.addEventListener("pointerenter",(()=>{this.style.selected||this.background.attr("fill",this.hoverColor)})),this.addEventListener("pointerleave",(()=>{this.style.selected||this.background.attr("fill",this.style.backgroundFill)}));const t=this;this.addEventListener("click",(()=>{const{label:e,value:n,onClick:i}=this.style;null==i||i(n,{label:e,value:n},t)}))}}function ks(t,e,n){return e=function(t){var e=function(t,e){if("object"!=typeof t||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var i=n.call(t,"string");if("object"!=typeof i)return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==typeof e?e:e+""}(e),e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}ws(Ss,"defaultOptions",{style:{value:"",label:"",cursor:"pointer"}});class As extends x{setValue(t){this.currentValue=t,this.render()}getValue(){return this.currentValue}get dropdownPadding(){return T(this.style.dropdownPadding)}renderSelect(){var t;const{width:e,height:n,bordered:i,showDropdownIcon:r}=this.style,s=B(this.attributes,"select"),a=B(this.attributes,"placeholder");this.select.attr({width:e,height:n,...s,fill:"#fff",strokeWidth:i?1:0});const o=this.dropdownPadding;r&&G(this.select).maybeAppend(".dropdown-icon","path").style("d","M-5,-3.5 L0,3.5 L5,-3.5").style("transform","translate(".concat(e-10-o[1]-o[3],", ").concat(n/2,")")).style("lineWidth",1).style("stroke",this.select.style.stroke);const l=null===(t=this.style.options)||void 0===t?void 0:t.find((t=>t.value===this.currentValue)),c={x:o[3],...a};G(this.select).selectAll(".placeholder").data(l?[]:[1]).join((t=>t.append("text").attr("className","placeholder").styles(c).style("y",(function(){const t=this.getBBox();return(n-t.height)/2}))),(t=>t.styles(c)),(t=>t.remove()));const u=B(this.attributes,"optionLabel"),h={x:o[3],...u};G(this.select).selectAll(".value").data(l?[l]:[]).join((t=>t.append((t=>On(t.label))).attr("className","value").styles(h).style("y",(function(){const t=this.getBBox();return(n-t.height)/2}))),(t=>t.styles(h)),(t=>t.remove()))}renderDropdown(){var e;const{width:n,height:i,options:r,onSelect:s,open:o}=this.style,l=B(this.attributes,"dropdown"),c=B(this.attributes,"option"),u=this.dropdownPadding;G(this.dropdown).maybeAppend(".dropdown-container","g").attr("className","dropdown-container").selectAll(".dropdown-item").data(r,(t=>t.value)).join((e=>e.append((e=>new Ss({className:"dropdown-item",style:{...e,...c,width:n-u[1]-u[3],selected:e.value===this.currentValue,onClick:(e,n,i)=>{this.setValue(e),null==s||s(e,n,i),this.dispatchEvent(new t.CustomEvent("change",{detail:{value:e,option:n,item:i}})),a(this.dropdown)}}}))).each((function(t,e){var n;const i=(null===(n=this.parentNode)||void 0===n?void 0:n.children).reduce(((t,n,i)=>(i<e&&(t+=n.getBBox().height),t)),0);this.attr("transform","translate(".concat(u[3],", ").concat(u[0]+i,")"))}))),(t=>t.update((t=>({selected:t.value===this.currentValue})))),(t=>t.remove()));const h=null===(e=this.dropdown.getElementsByClassName("dropdown-container"))||void 0===e||null===(e=e[0])||void 0===e?void 0:e.getBBox(),{spacing:d}=l;this.dropdown.attr({y:i+d,width:h.width+u[1]+u[3],height:h.height+u[0]+u[2],...l}),!o&&a(this.dropdown)}constructor(e){var n,i;super(y({},As.defaultOptions,e)),ks(this,"currentValue",null===(n=As.defaultOptions.style)||void 0===n?void 0:n.defaultValue),ks(this,"isPointerInSelect",!1),ks(this,"select",this.appendChild(new t.Rect({className:"select",style:{cursor:"pointer",width:0,height:0}}))),ks(this,"dropdown",this.appendChild(new t.Rect({className:"dropdown"})));const{defaultValue:r}=this.style;r&&null!==(i=this.style.options)&&void 0!==i&&i.some((t=>t.value===r))&&(this.currentValue=r)}render(){this.renderSelect(),this.renderDropdown()}bindEvents(){var t;this.addEventListener("click",(t=>{t.stopPropagation()})),this.select.addEventListener("click",(()=>{"visible"===this.dropdown.style.visibility?a(this.dropdown):s(this.dropdown)})),this.addEventListener("pointerenter",(()=>{this.isPointerInSelect=!0})),this.addEventListener("pointerleave",(()=>{this.isPointerInSelect=!1})),null===(t=document)||void 0===t||t.addEventListener("click",(()=>{this.isPointerInSelect||a(this.dropdown)}))}}ks(As,"defaultOptions",{style:{width:140,height:32,options:[],bordered:!0,defaultValue:"",selectRadius:8,selectStroke:"#d9d9d9",showDropdownIcon:!0,placeholderText:"请选择",placeholderFontSize:12,placeholderTextBaseline:"top",placeholderFill:"#c2c2c2",dropdownFill:"#fff",dropdownStroke:"#d9d9d9",dropdownRadius:8,dropdownShadowBlur:4,dropdownShadowColor:"rgba(0, 0, 0, 0.08)",dropdownPadding:8,dropdownSpacing:10,optionPadding:[8,12],optionFontSize:12,optionTextBaseline:"top",optionBackgroundFill:"#fff",optionBackgroundRadius:4,optionLabelFontSize:12,optionLabelTextBaseline:"top"}});const Ls=["year","month","day","hour","minute","second"],Ps=["YYYY","MM","DD","hh","mm","ss"];function Es(t){return t instanceof Date?t:new Date(t)}function Bs(t){let[e,n]=t;const i=Ls.indexOf(e),r=Ls.indexOf(n);let s="";for(let t=i;t<=r;t+=1)if(s+=Ps[t],t<r){let e="-";2===t?e=" ":t>2&&(e=":"),s+=e}return s}function Cs(t,e){const n={YYYY:t.getFullYear(),MM:t.getMonth()+1,DD:t.getDate(),HH:t.getHours(),mm:t.getMinutes(),ss:t.getSeconds()};let i=e;return Object.keys(n).forEach((t=>{const e=n[t];i=i.replace(t,"YYYY"===t?"".concat(e):"".concat(e).padStart(2,"0"))})),i}function Ms(t,e){return Es(t).getTime()-Es(e).getTime()}function Os(t,e){const[n,i]=[Es(t),Es(e)];return n.getFullYear()!==i.getFullYear()?"year":n.getMonth()!==i.getMonth()?"month":n.getDay()!==i.getDay()?"day":n.getHours()!==i.getHours()?"hour":n.getMinutes()!==i.getMinutes()?"minute":"second"}function Ts(t,e){const n=new Date(t);return{year:t=>{t.setMonth(0),t.setHours(0,0,0,0)},month:t=>{t.setDate(1),t.setHours(0,0,0,0)},day:t=>t.setHours(0,0,0,0),hour:t=>t.setMinutes(0,0,0),minute:t=>t.setSeconds(0,0),second:t=>t.setMilliseconds(0)}[e](n),Cs(n,Bs(["year",e]))}function js(t,e,n){return e=function(t){var e=function(t,e){if("object"!=typeof t||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var i=n.call(t,"string");if("object"!=typeof i)return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==typeof e?e:e+""}(e),e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}class Ns extends x{get label(){return"BaseIcon"}get lineWidth(){return Math.log10(this.attributes.size)}get padding(){return T(this.attributes.size/5)}get iconSize(){const{size:t}=this.attributes,[e,n,i,r]=this.padding;return Math.max(t-Math.max(r+n,e+i),2*this.lineWidth+1)}renderBackground(){const{size:t}=this.attributes,e=t/2,n=B(this.attributes,"background");this.background.attr({x:-e,y:-e,width:t,height:t,...n})}showIndicator(){if(!this.label)return;const{size:t}=this.attributes,{x:e,y:n}=this.background.getBBox();this.indicator.update({x:e+t/2,y:n-5,labelText:this.label,visibility:"visible"})}hideIndicator(){this.indicator.update({visibility:"hidden"})}constructor(e){super(y({},{style:{backgroundOpacity:Ns.backgroundOpacities.default}},Ns.defaultOptions,e)),js(this,"showBackground",!0),js(this,"indicator",void 0),js(this,"background",this.appendChild(new t.Rect({}))),js(this,"icon",this.appendChild(new t.Group({})))}connectedCallback(){var t;super.connectedCallback();const{size:e}=this.attributes,{x:n,y:i}=this.background.getBBox(),r=null===(t=this.ownerDocument)||void 0===t?void 0:t.defaultView;r&&(this.indicator=r.appendChild(new $i({style:{x:n+e/2,y:i-e/2,visibility:"hidden",position:"top",radius:3,zIndex:100}})))}disconnectedCallback(){this.indicator.destroy()}render(){this.renderIcon(),this.showBackground&&this.renderBackground()}bindEvents(){const{onClick:t}=this.attributes;if(this.addEventListener("click",(()=>{null==t||t(this)})),this.showBackground){const t=()=>this.background.attr({opacity:Ns.backgroundOpacities.default}),e=()=>this.background.attr({opacity:Ns.backgroundOpacities.hover}),n=()=>this.background.attr({opacity:Ns.backgroundOpacities.active});this.addEventListener("pointerenter",(()=>{e(),this.showIndicator()})),this.addEventListener("pointerleave",(()=>{t(),this.hideIndicator()})),this.addEventListener("pointerdown",(()=>{n()})),this.addEventListener("pointerup",(()=>{t()}))}}}js(Ns,"tag","IconBase"),js(Ns,"defaultOptions",{style:{x:0,y:0,size:10,color:"#565758",backgroundRadius:4,backgroundFill:"#e2e2e2"}}),js(Ns,"backgroundOpacities",{default:0,hover:.8,active:1});const _s=function(e){let n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"#565758";return new t.Path({style:{fill:n,anchor:"0.5 0.5",path:"M ".concat(e,",").concat(e," L -").concat(e,",0 L ").concat(e,",-").concat(e," Z"),transformOrigin:"center"}})};class zs extends Ns{get label(){return"播放"}renderIcon(){const{color:t}=this.attributes,e=this.iconSize,n=e/3*3**.5*.8,i=[[n,0],[-n/2,-e/2*.8],[-n/2,e/2*.8],[n,0]];G(this.icon).maybeAppend(".play","polygon").styles({points:i,fill:t})}}class Is extends Ns{get label(){return"暂停"}renderIcon(){const{color:t}=this.attributes,e=this.iconSize,n=e/3,i=[[-n,-e/2],[-n,e/2],[-n/2,e/2],[-n/2,-e/2],[-n,-e/2],[n/2,-e/2],[n/2,e/2],[n,e/2],[n,-e/2]];G(this.icon).maybeAppend(".pause","polygon").styles({points:i,fill:t})}}class Fs extends Ns{get label(){return"范围时间"}renderIcon(){const{color:t}=this.attributes,{iconSize:e,lineWidth:n}=this,i=n;G(this.icon).maybeAppend(".left-line","line").styles({x1:-e/2,y1:-e/2,x2:-e/2,y2:e/2,stroke:t,lineWidth:n}),G(this.icon).maybeAppend(".right-line","line").styles({x1:e/2,y1:-e/2,x2:e/2,y2:e/2,stroke:t,lineWidth:n}),G(this.icon).maybeAppend(".left-arrow","line").styles({x1:0,y1:0,x2:-e/2+2*i,y2:0,stroke:t,lineWidth:n,markerEnd:_s(2*n,t)}),G(this.icon).maybeAppend(".right-arrow","line").styles({x1:0,y1:0,x2:e/2-2*i,y2:0,stroke:t,lineWidth:n,markerEnd:_s(2*n,t)})}}class Gs extends Ns{get label(){return"单一时间"}renderIcon(){const{color:t}=this.attributes,{iconSize:e,lineWidth:n}=this;G(this.icon).maybeAppend(".line","line").styles({x1:0,y1:-e/2,x2:0,y2:e/2,stroke:t,lineWidth:n});const i=n;G(this.icon).maybeAppend(".left-arrow","line").styles({x1:-e/2-2*i,y1:0,x2:2*-i,y2:0,stroke:t,lineWidth:n,markerEnd:_s(2*n,t)}),G(this.icon).maybeAppend(".right-arrow","line").styles({x1:e/2+2*i,y1:0,x2:2*i,y2:0,stroke:t,lineWidth:n,markerEnd:_s(2*n,t)})}}const Hs=t=>[[-t/2,-t/2],[-t/2,t/2],[t/2,t/2]];class Vs extends Ns{get label(){return"折线图"}renderIcon(){const{color:t}=this.attributes,{iconSize:e,lineWidth:n}=this,i=n,r=(e-2*i-n)/4,s=(e-2*i-n)/2,[a,o]=[-e/2+i,e/2-2*i];G(this.icon).maybeAppend(".coordinate","polyline").styles({points:Hs(e),stroke:t,lineWidth:n}),G(this.icon).maybeAppend(".line","polyline").styles({points:[[a,o],[a+r,o-s],[a+2*r,o],[a+4*r,o-2*s]],stroke:t,lineWidth:n})}}class Ws extends Ns{get label(){return"条形图"}get data(){return[1,4,2,4,3]}renderIcon(){const{data:t}=this,{color:e}=this.attributes,{iconSize:n,lineWidth:i}=this,r=i,s=(n-r)/t.length,a=(n-2*r)/4,[o,l]=[-n/2+2*r,n/2-r];G(this.icon).maybeAppend(".coordinate","polyline").styles({points:Hs(n),stroke:e,lineWidth:i}),G(this.icon).maybeAppend(".bars","g").selectAll(".column").data(this.data.map(((t,e)=>({value:t,index:e})))).join((t=>t.append("line").attr("className","column").style("x1",(t=>{let{index:e}=t;return o+s*e})).style("y1",l).style("x2",(t=>{let{index:e}=t;return o+s*e})).style("y2",(t=>{let{value:e}=t;return l-a*e})).styles({y1:l,stroke:e,lineWidth:i})))}}class Ds extends Ns{constructor(){super(...arguments),js(this,"showBackground",!1)}get padding(){return T(0)}renderIcon(){const{iconSize:t}=this,{speed:e=1}=this.attributes,n=function(t,e){return function(t,e,n){if(!g(t)&&!f(t))return t;var i=n;return dt(t,(function(t,n){i=e(i,t,n)})),i}(t,(function(t,n,i){return e.includes(i)||(t[i]=n),t}),{})}(this.attributes,["x","y","width","height","size","color","speed"]),i=de(t,20,1/0),r={...n,x:-i/2,y:-10,width:i,height:20,defaultValue:e,bordered:!1,showDropdownIcon:!1,selectRadius:2,dropdownPadding:this.padding,dropdownRadius:2,dropdownSpacing:t/5,placeholderFontSize:t/2,optionPadding:0,optionLabelFontSize:t/2,optionBackgroundRadius:1,options:[{label:"1x",value:1},{label:"1.5x",value:1.5},{label:"2x",value:2}]};G(this.icon).maybeAppend(".speed",(()=>new As({style:r}))).attr("className","speed").each((function(){this.update(r)}))}}js(Ds,"tag","SpeedSelect");class Rs extends x{getType(){return this.currentType}constructor(e){super(e),js(this,"icon",this.appendChild(new t.Group({}))),js(this,"currentType",void 0),this.currentType=this.attributes.type}render(){const{x:t,y:e,onChange:n,...i}=this.attributes;G(this.icon).selectAll(".icon").data([this.currentType]).join((t=>t.append((t=>{var e;const n=null===(e=this.toggles.find((e=>{let[n]=e;return n===t})))||void 0===e?void 0:e[1];if(!n)throw new Error("Invalid type: ".concat(t));return new n({})})).attr("className","icon").styles(i,!1).update({})),(t=>t.styles({restStyles:i}).update({})),(t=>t.remove()))}bindEvents(){const{onChange:t}=this.attributes;this.addEventListener("click",(e=>{e.preventDefault(),e.stopPropagation();const n=(this.toggles.findIndex((t=>{let[e]=t;return e===this.currentType}))+1)%this.toggles.length,i=this.toggles[n][0];null==t||t(this.currentType),this.currentType=i,this.render()}))}}js(Rs,"tag","ToggleIcon");class Ys extends Rs{constructor(t){super(y({},{style:{type:"play"}},t)),js(this,"toggles",[["play",zs],["pause",Is]])}}class qs extends Rs{constructor(t){super(y({},{style:{type:"range"}},t)),js(this,"toggles",[["range",Fs],["value",Gs]])}}class Ks extends Rs{constructor(t){super(y({},{style:{type:"column"}},t)),js(this,"toggles",[["line",Vs],["column",Ws]])}}function Zs(t,e,n){return e=function(t){var e=function(t,e){if("object"!=typeof t||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var i=n.call(t,"string");if("object"!=typeof i)return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==typeof e?e:e+""}(e),e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}const Us={reset:class extends Ns{arcPath(t,e,n){const[i,r]=[n,n],s=i=>[t+n*Math.cos(i),e+n*Math.sin(i)],[a,o]=s(-5/4*Math.PI),[l,c]=s(1/4*Math.PI);return"M".concat(a,",").concat(o,",A").concat(i,",").concat(r,",0,1,1,").concat(l,",").concat(c)}get label(){return"重置"}renderIcon(){const{color:t}=this.attributes,e=this.iconSize,{lineWidth:n}=this,i=n+.5;G(this.icon).maybeAppend(".reset","path").styles({stroke:t,lineWidth:n,path:this.arcPath(0,0,e/2-n),markerStart:_s(i,t)})}},speed:Ds,backward:class extends Ns{get label(){return"快退"}renderIcon(){const{color:t}=this.attributes,e=this.iconSize,n=e/2,i=e/2/3**.5,r=[[0,0],[0,-i],[-n,0],[0,i],[0,0],[n,-i],[n,i],[0,0]];G(this.icon).maybeAppend(".backward","polygon").styles({points:r,fill:t})}},playPause:Ys,forward:class extends Ns{get label(){return"快进"}renderIcon(){const{color:t}=this.attributes,e=this.iconSize,n=e/2,i=e/2/3**.5,r=[[0,0],[0,-i],[n,0],[0,i],[0,0],[-n,-i],[-n,i],[0,0]];G(this.icon).maybeAppend(".forward","polygon").styles({points:r,fill:t})}},selectionType:qs,chartType:Ks,split:class extends Ns{constructor(t){super(y({},{style:{color:"#d8d9d9"}},t)),js(this,"showBackground",!1)}renderIcon(){const{color:t}=this.attributes,{iconSize:e,lineWidth:n}=this;G(this.icon).maybeAppend(".split","line").styles({x1:0,y1:-e/2,x2:0,y2:e/2,stroke:t,lineWidth:n})}}};class $s extends x{get padding(){return T(this.attributes.padding)}renderBackground(){const{width:t,height:e}=this.style,n=B(this.attributes,"background");this.background.attr({width:t,height:e,...n})}renderFunctions(){var t;const{functions:e,iconSize:n,iconSpacing:i,width:r,height:s,align:a}=this.attributes,{padding:[,o,,l]}=this,c=e.reduce(((t,e)=>t.length&&e.length?t.concat("split",...e):t.concat(...e)),[]),u=c.length*(n+i)-i,h={left:l+n/2,center:(r-u)/2+n/2,right:r-u-l-o+n/2}[a]||0;null===(t=this.speedSelect)||void 0===t||t.destroy(),this.functions.removeChildren(),c.forEach(((t,e)=>{const r=Us[t],a={x:e*(n+i)+h,y:s/2,size:n};if(r===Ds?(a.speed=this.attributes.speed,a.onSelect=e=>this.handleFunctionChange(t,{value:e})):[Ys,qs,Ks].includes(r)?(a.onChange=e=>this.handleFunctionChange(t,{value:e}),r===Ys&&(a.type="play"===this.attributes.state?"pause":"play"),r===qs&&(a.type="range"===this.attributes.selectionType?"value":"range"),r===Ks&&(a.type="line"===this.attributes.chartType?"column":"line")):a.onClick=()=>this.handleFunctionChange(t,{value:t}),r===Ds){var o;const{x:t,y:e}=this.getBBox(),{x:n,y:i}=a,s=null===(o=this.ownerDocument)||void 0===o?void 0:o.defaultView;s&&(this.speedSelect=new r({style:{...a,zIndex:100,x:t+n,y:e+i}}),s.appendChild(this.speedSelect))}else this.functions.appendChild(new r({style:a}))}))}constructor(e){super(y({},$s.defaultOptions,e)),Zs(this,"background",this.appendChild(new t.Rect({}))),Zs(this,"functions",this.appendChild(new t.Group({}))),Zs(this,"speedSelect",void 0)}disconnectedCallback(){var t;super.disconnectedCallback(),null===(t=this.speedSelect)||void 0===t||t.destroy()}render(){this.renderBackground(),this.renderFunctions()}handleFunctionChange(t,e){const{onChange:n}=this.attributes;null==n||n(t,e)}}function Xs(t,e,n){return e=function(t){var e=function(t,e){if("object"!=typeof t||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var i=n.call(t,"string");if("object"!=typeof i)return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==typeof e?e:e+""}(e),e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}Zs($s,"defaultOptions",{style:{width:300,height:40,padding:0,align:"center",iconSize:25,iconSpacing:0,speed:1,state:"pause",chartType:"line",selectionType:"range",backgroundFill:"#fbfdff",backgroundStroke:"#ebedf0",functions:[["reset","speed"],["backward","playPause","forward"],["selectionType","chartType"]]}});class Js extends t.Circle{constructor(t){super(y({},Js.defaultOptions,t)),this.bindEvents()}bindEvents(){this.addEventListener("mouseenter",(()=>{this.attr("lineWidth",Math.ceil(+(this.style.r||0)/2))})),this.addEventListener("mouseleave",(()=>{this.attr("lineWidth",0)}))}}Xs(Js,"defaultOptions",{style:{r:5,fill:"#3f7cf7",lineWidth:0,stroke:"#3f7cf7",strokeOpacity:.5,cursor:"pointer"}});class Qs extends x{renderBackground(){const{width:t,height:e}=this.attributes,n=B(this.attributes,"background");G(this).maybeAppend("background","rect").attr("className","background").styles({x:-t/2,y:-e/2,width:t,height:e,...n})}renderIcon(){const{iconSize:t}=this.attributes,e=B(this.attributes,"icon"),n=t/2;G(this).maybeAppend("icon-left-line","line").attr("className","icon-left-line").styles({x1:-1,y1:-n,x2:-1,y2:n,...e}),G(this).maybeAppend("icon-right-line","line").attr("className","icon-right-line").styles({x1:1,y1:-n,x2:1,y2:n,...e})}renderBorder(){const{width:t,height:e,type:n}=this.attributes,i=B(this.attributes,"border"),r="start"===n?+t/2:-t/2;G(this).maybeAppend("border","line").attr("className","border").styles({x1:r,y1:-e/2,x2:r,y2:+e/2,...i})}render(){this.renderBackground(),this.renderIcon(),this.renderBorder()}constructor(t){super(y({},Qs.defaultOptions,t))}}function ta(t){const e=String(Math.floor(t/3600)).padStart(2,"0"),n=String(Math.floor(t%3600/60)).padStart(2,"0"),i=String(Math.floor(t%60)).padStart(2,"0");return t<3600?"".concat(n,":").concat(i):"".concat(e,":").concat(n,":").concat(i)}function ea(t,e,n){return e=function(t){var e=function(t,e){if("object"!=typeof t||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var i=n.call(t,"string");if("object"!=typeof i)return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==typeof e?e:e+""}(e),e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}Xs(Qs,"defaultOptions",{style:{width:10,height:50,iconSize:10,type:"start",backgroundFill:"#fff",backgroundFillOpacity:.5,iconStroke:"#9a9a9a",iconLineWidth:1,borderStroke:"#e8e8e8",borderLineWidth:1}});class na extends x{get data(){const{data:t}=this.attributes;return t.sort(((t,e)=>t.time<e.time?-1:t.time>e.time?1:0))}get space(){const{width:t,height:e,type:n,controllerHeight:i}=this.attributes,r=de(+e-i,0,+e),s=new Ii(0,+e-i,+t,i);let a,o=0;"chart"===n?(o=35,a=new Ii(0,r-o,+t,o)):a=new Ii;const l="time"===n?10:r;return{axisBBox:a,controllerBBox:s,timelineBBox:new Ii(0,"time"===n?r:r-l,+t,l-o)}}setBySliderValues(t){var e,n;const{data:i}=this,[r,s]=Array.isArray(t)?t:[0,t],a=i.length,o=i[Math.floor(r*a)],l=i[Math.ceil(s*a)-(Array.isArray(t)?0:1)];this.states.values=[null!==(e=null==o?void 0:o.time)&&void 0!==e?e:i[0].time,null!==(n=null==l?void 0:l.time)&&void 0!==n?n:1/0]}setByTimebarValues(t){var e,n,i;const{data:r}=this,[s,a]=Array.isArray(t)?t:[void 0,t],o=r.find((t=>{let{time:e}=t;return e===s})),l=r.find((t=>{let{time:e}=t;return e===a}));this.states.values=[null!==(e=null==o?void 0:o.time)&&void 0!==e?e:null===(n=r[0])||void 0===n?void 0:n.time,null!==(i=null==l?void 0:l.time)&&void 0!==i?i:1/0]}setByIndex(t){var e,n,i,r;const{data:s}=this,[a,o]=t;this.states.values=[null!==(e=null===(n=s[a])||void 0===n?void 0:n.time)&&void 0!==e?e:s[0].time,null!==(i=null===(r=this.data[o])||void 0===r?void 0:r.time)&&void 0!==i?i:1/0]}get sliderValues(){const{values:t,selectionType:e}=this.states,[n,i]=Array.isArray(t)?t:[void 0,t],{data:r}=this,s=r.length,a="value"===e;return[(()=>{const t=r.findIndex((t=>{let{time:e}=t;return e===n}));return a?0:t>-1?t/s:0})(),(()=>{if(i===1/0)return 1;const t=r.findIndex((t=>{let{time:e}=t;return e===i}));return t>-1?t/s:a?.5:1})()]}get values(){const{values:t,selectionType:e}=this.states,[n,i]=Array.isArray(t)?t:[this.data[0].time,t];return"value"===e?i:[n,i]}getDatumByRatio(t){const{data:e}=this,n=e.length;return e[Math.floor(t*(n-1))]}get chartHandleIconShape(){const{selectionType:e}=this.states,{timelineBBox:{height:n}}=this.space;return"range"===e?t=>new Qs({style:{type:t,height:n,iconSize:n/6}}):()=>new t.Line({style:{x1:0,y1:-n/2,x2:0,y2:n/2,lineWidth:2,stroke:"#c8c8c8"}})}getChartStyle(t){const{x:e,y:n,width:i,height:r}=t,{selectionType:s,chartType:a}=this.states,{data:o}=this,{type:l,labelFormatter:c}=this.attributes,{type:u,...h}=B(this.attributes,"chart"),d="range"===s;if("time"===l)return{handleIconShape:()=>new Js({}),selectionFill:"#2e7ff8",selectionFillOpacity:1,showLabelOnInteraction:!0,handleLabelDy:d?-15:0,autoFitLabel:d,handleSpacing:d?-15:0,trackFill:"#edeeef",trackLength:i,trackOpacity:.5,trackRadius:r/2,trackSize:r/2,type:s,values:this.sliderValues,formatter:t=>{if(c)return c(t);const e=this.getDatumByRatio(t).time;return"number"==typeof e?ta(e):Cs(e,"YYYY-MM-DD HH:mm:ss")},x:e,y:n,zIndex:1,...h};const p="range"===s?5:0,f=o.map((t=>{let{value:e}=t;return e}));return{handleIconOffset:p,handleIconShape:this.chartHandleIconShape,selectionFill:"#fff",selectionFillOpacity:.5,selectionType:"invert",sparklineSpacing:.1,sparklineColumnLineWidth:0,sparklineColor:"#d4e5fd",sparklineAreaOpacity:1,sparklineAreaLineWidth:0,sparklineData:f,sparklineType:a,sparklineScale:.8,trackLength:i,trackSize:r,type:s,values:this.sliderValues,x:e,y:n,zIndex:1,...h}}renderChart(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.space.timelineBBox;this.timeline.update(this.getChartStyle(t))}updateSelection(){this.timeline.setValues(this.sliderValues,!0),this.handleSliderChange(this.sliderValues)}getAxisStyle(t){const{data:e}=this,{interval:n,labelFormatter:i}=this.attributes,r=B(this.attributes,"axis"),{x:s,y:a,width:o}=t,l=[...e,{time:0}].map(((t,e,n)=>{let{time:i}=t;return{label:"".concat(i),value:e/(n.length-1),time:i}}));return{startPos:[s,a],endPos:[s+o,a],data:l,labelFilter:(t,e)=>e<l.length-1,labelFormatter:t=>{let{time:e}=t;return i?i(e):function(t,e){return"number"==typeof t?ta(t):function(t,e){const n=new Date(t);switch(e){case"half-hour":case"hour":case"four-hour":return[0,6,12,18].includes(n.getHours())&&0===n.getMinutes()?Cs(n,"HH:mm\nYYYY-MM-DD"):Cs(n,"HH:mm");case"half-day":return n.getHours()<12?"AM\n".concat(Cs(n,"YYYY-MM-DD")):"PM";case"day":return[1,10,20].includes(n.getDate())?Cs(n,"DD\nYYYY-MM"):Cs(n,"DD");case"week":return n.getDate()<=7?Cs(n,"DD\nYYYY-MM"):Cs(n,"DD");case"month":return[0,6].includes(n.getMonth())?Cs(n,"MM月\nYYYY"):Cs(n,"MM月");case"season":return[0].includes(n.getMonth())?Cs(n,"MM月\nYYYY"):Cs(n,"MM月");case"year":return Cs(n,"YYYY");default:return Cs(n,"YYYY-MM-DD HH:mm")}}(t,e)}(e,n)},...r}}renderAxis(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.space.axisBBox;const{type:e}=this.attributes;"chart"===e&&this.axis.update(this.getAxisStyle(t))}renderController(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.space.controllerBBox;const{type:e}=this.attributes,{state:n,speed:i,selectionType:r,chartType:s}=this.states,a=B(this.attributes,"controller"),o=this,l={...t,iconSize:20,speed:i,state:n,selectionType:r,chartType:s,onChange(t,e){let{value:n}=e;switch(t){case"reset":o.internalReset();break;case"speed":o.handleSpeedChange(n);break;case"backward":o.internalBackward();break;case"playPause":"play"===n?o.internalPlay():o.internalPause();break;case"forward":o.internalForward();break;case"selectionType":o.handleSelectionTypeChange(n);break;case"chartType":o.handleChartTypeChange(n)}},...a};"time"===e&&(l.functions=[["reset","speed"],["backward","playPause","forward"],["selectionType"]]),this.controller.update(l)}dispatchOnChange(t){const{data:e}=this,{onChange:n}=this.attributes,{values:i,selectionType:r}=this.states,[s,a]=i,o=a===1/0?e.at(-1).time:a;t&&((t,e)=>{if(Array.isArray(t)){if(!Array.isArray(e))return!1;if(t[0]===e[0]){if(t[1]===e[1])return!0;if(t[1]===1/0||e[1]===1/0)return!0}return!1}return!Array.isArray(e)&&t===e})(t,"range"===r?[s,o]:o)||null==n||n("range"===r?[s,o]:o)}internalReset(t){const{selectionType:e}=this.states;var n,i;this.internalPause(),this.setBySliderValues("range"===e?[0,1]:[0,0]),this.renderController(),this.updateSelection(),t||(null===(n=this.attributes)||void 0===n||null===(i=n.onReset)||void 0===i||i.call(n),this.dispatchOnChange())}reset(){this.internalReset()}moveSelection(t,e){const{data:n}=this,i=n.length,{values:r,selectionType:s,playMode:a}=this.states,[o,l]=r,c=n.findIndex((t=>{let{time:e}=t;return e===o}));let u=n.findIndex((t=>{let{time:e}=t;return e===l}));-1===u&&(u=i);const h="backward"===t?-1:1;let d;"range"===s?"acc"===a?(d=[c,u+h],-1===h&&c===u&&(d=[c,i])):d=[c+h,u+h]:d=[c,u+h];const p=(t=>{const[e,n]=t.sort(((t,e)=>t-e)),r=t=>de(t,0,i);return n>i?"value"===s?[0,0]:"acc"===a?[r(e),r(e)]:[0,r(n-e)]:e<0?"acc"===a?[0,r(n)]:[r(e+i-n),i]:[r(e),r(n)]})(d);return this.setByIndex(p),this.updateSelection(),p}internalBackward(t){const e=this.moveSelection("backward",t);var n,i;return t||(null===(n=this.attributes)||void 0===n||null===(i=n.onBackward)||void 0===i||i.call(n),this.dispatchOnChange()),e}backward(){this.internalBackward()}internalPlay(t){var e,n;const{data:i}=this,{loop:r}=this.attributes,{speed:s=1}=this.states;this.playInterval=window.setInterval((()=>{this.internalForward()[1]!==i.length||r||(this.internalPause(),this.renderController())}),1e3/s),this.states.state="play",!t&&(null===(e=this.attributes)||void 0===e||null===(n=e.onPlay)||void 0===n||n.call(e))}play(){this.internalPlay()}internalPause(t){var e,n;clearInterval(this.playInterval),this.states.state="pause",!t&&(null===(e=this.attributes)||void 0===e||null===(n=e.onPause)||void 0===n||n.call(e))}pause(){this.internalPause()}internalForward(t){const e=this.moveSelection("forward",t);var n,i;return t||(null===(n=this.attributes)||void 0===n||null===(i=n.onForward)||void 0===i||i.call(n),this.dispatchOnChange()),e}forward(){this.internalForward()}handleSpeedChange(t){var e,n;this.states.speed=t;const{state:i}=this.states;"play"===i&&(this.internalPause(!0),this.internalPlay(!0)),null===(e=this.attributes)||void 0===e||null===(n=e.onSpeedChange)||void 0===n||n.call(e,t)}handleSelectionTypeChange(t){var e,n;this.states.selectionType=t,this.renderChart(),null===(e=this.attributes)||void 0===e||null===(n=e.onSelectionTypeChange)||void 0===n||n.call(e,t)}handleChartTypeChange(t){var e,n;this.states.chartType=t,this.renderChart(),null===(e=this.attributes)||void 0===e||null===(n=e.onChartTypeChange)||void 0===n||n.call(e,t)}constructor(t){super(y({},na.defaultOptions,t)),ea(this,"axis",this.appendChild(new Yi({style:{type:"linear",startPos:[0,0],endPos:[0,0],data:[],showArrow:!1,animate:!1}}))),ea(this,"timeline",this.appendChild(new on({style:{onChange:t=>{this.handleSliderChange(t)}}}))),ea(this,"controller",this.appendChild(new $s({}))),ea(this,"states",{}),ea(this,"playInterval",void 0),ea(this,"handleSliderChange",(t=>{const e=(()=>{const t=this.states.values;return Array.isArray(t)?[...t]:t})();this.setBySliderValues(t),this.dispatchOnChange(e)}));const{selectionType:e,chartType:n,speed:i,state:r,playMode:s,values:a}=this.attributes;this.states={chartType:n,playMode:s,selectionType:e,speed:i,state:r},this.setByTimebarValues(a)}render(){const{axisBBox:t,controllerBBox:e,timelineBBox:n}=this.space;this.renderController(e),this.renderAxis(t),this.renderChart(n),"play"===this.states.state&&this.internalPlay()}destroy(){super.destroy(),this.internalPause(!0)}}function ia(t){const e=document.createElement("div");return e.innerHTML=t,e.firstChild}function ra(t){return"string"==typeof t?ia(t):t}ea(na,"defaultOptions",{style:{axisLabelFill:"#6e6e6e",axisLabelTextAlign:"left",axisLabelTextBaseline:"top",axisLabelTransform:"translate(5, -12)",axisLineLineWidth:1,axisLineStroke:"#cacdd1",axisTickLength:15,axisTickLineWidth:1,axisTickStroke:"#cacdd1",chartShowLabel:!1,chartType:"line",controllerAlign:"center",controllerHeight:40,data:[],interval:"day",loop:!1,playMode:"acc",selectionType:"range",type:"time"}});var sa=i(269),aa=i.n(sa);function oa(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1024,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1014;return(i,r,s)=>aa()(t).map((t=>{const a=[];return a.push(!0===t.relative?t.code.toLowerCase():t.code.toUpperCase()),[[t.x1,t.y1],[t.x2,t.y2],[t.x,t.y]].forEach((o=>{const[l,c]=o;void 0!==l&&a.push(!0===t.relative?l/e*2*s:i-s+2*s*(l/e)),void 0!==c&&a.push(!0===t.relative?c/n*2*s:r-s+2*s*(c/n))})),a}))}function la(t){const e=/<path\s+d="(.*?)"/i.exec(t),n=/viewBox="\d+\s+\d+\s+(\d+)\s+(\d+)"/i.exec(t);if(null===e||e.length<2)return()=>[];let i=1024,r=1024;return null!==n&&n.length>=3&&(Number.isNaN(parseInt(n[1],10))||(i=parseInt(n[1],10)),Number.isNaN(parseInt(n[2],10))||(r=parseInt(n[2],10))),oa(e[1],i,r)}function ca(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return(n,i,r)=>{const s=r.value;let a;"function"==typeof s&&(r.value=function(){for(var n=arguments.length,i=new Array(n),r=0;r<n;r++)i[r]=arguments[r];if(a)return;const o=this;e&&s.apply(o,i),a=window.setTimeout((()=>{s.apply(o,i),a=null}),t)})}}function ua(t){const e=localStorage.getItem("__debug__");return(n,i,r)=>{const s="[".concat(i,"] ").concat(t),a=r.value;"function"==typeof a&&(r.value=function(){e&&console.time(s);for(var t=arguments.length,n=new Array(t),i=0;i<t;i++)n[i]=arguments[i];a.apply(this,n),e&&console.timeEnd(s)})}}t.runtime.enableCSSParsing=!1})(),r})()));
|