Socket
Socket
Sign inDemoInstall

vega-scenegraph

Package Overview
Dependencies
Maintainers
2
Versions
110
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

vega-scenegraph - npm Package Compare versions

Comparing version 4.7.0 to 4.7.1

2

build/vega-scenegraph.min.js

@@ -1,1 +0,1 @@

!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("vega-util"),require("vega-canvas"),require("vega-loader"),require("d3-shape"),require("d3-path"),require("vega-scale")):"function"==typeof define&&define.amd?define(["exports","vega-util","vega-canvas","vega-loader","d3-shape","d3-path","vega-scale"],e):e((t=t||self).vega={},t.vega,t.vega,t.vega,t.d3,t.d3,t.vega)}(this,(function(t,e,n,i,r,o,s){"use strict";function a(t){this.clear(),t&&this.union(t)}var l=a.prototype;l.clone=function(){return new a(this)},l.clear=function(){return this.x1=+Number.MAX_VALUE,this.y1=+Number.MAX_VALUE,this.x2=-Number.MAX_VALUE,this.y2=-Number.MAX_VALUE,this},l.empty=function(){return this.x1===+Number.MAX_VALUE&&this.y1===+Number.MAX_VALUE&&this.x2===-Number.MAX_VALUE&&this.y2===-Number.MAX_VALUE},l.equals=function(t){return this.x1===t.x1&&this.y1===t.y1&&this.x2===t.x2&&this.y2===t.y2},l.set=function(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},l.add=function(t,e){return t<this.x1&&(this.x1=t),e<this.y1&&(this.y1=e),t>this.x2&&(this.x2=t),e>this.y2&&(this.y2=e),this},l.expand=function(t){return this.x1-=t,this.y1-=t,this.x2+=t,this.y2+=t,this},l.round=function(){return this.x1=Math.floor(this.x1),this.y1=Math.floor(this.y1),this.x2=Math.ceil(this.x2),this.y2=Math.ceil(this.y2),this},l.scale=function(t){return this.x1*=t,this.y1*=t,this.x2*=t,this.y2*=t,this},l.translate=function(t,e){return this.x1+=t,this.x2+=t,this.y1+=e,this.y2+=e,this},l.rotate=function(t,e,n){const i=this.rotatedPoints(t,e,n);return this.clear().add(i[0],i[1]).add(i[2],i[3]).add(i[4],i[5]).add(i[6],i[7])},l.rotatedPoints=function(t,e,n){var{x1:i,y1:r,x2:o,y2:s}=this,a=Math.cos(t),l=Math.sin(t),u=e-e*a+n*l,c=n-e*l-n*a;return[a*i-l*r+u,l*i+a*r+c,a*i-l*s+u,l*i+a*s+c,a*o-l*r+u,l*o+a*r+c,a*o-l*s+u,l*o+a*s+c]},l.union=function(t){return t.x1<this.x1&&(this.x1=t.x1),t.y1<this.y1&&(this.y1=t.y1),t.x2>this.x2&&(this.x2=t.x2),t.y2>this.y2&&(this.y2=t.y2),this},l.intersect=function(t){return t.x1>this.x1&&(this.x1=t.x1),t.y1>this.y1&&(this.y1=t.y1),t.x2<this.x2&&(this.x2=t.x2),t.y2<this.y2&&(this.y2=t.y2),this},l.encloses=function(t){return t&&this.x1<=t.x1&&this.x2>=t.x2&&this.y1<=t.y1&&this.y2>=t.y2},l.alignsWith=function(t){return t&&(this.x1==t.x1||this.x2==t.x2||this.y1==t.y1||this.y2==t.y2)},l.intersects=function(t){return t&&!(this.x2<t.x1||this.x1>t.x2||this.y2<t.y1||this.y1>t.y2)},l.contains=function(t,e){return!(t<this.x1||t>this.x2||e<this.y1||e>this.y2)},l.width=function(){return this.x2-this.x1},l.height=function(){return this.y2-this.y1};var u=0;function c(t){return t&&t.gradient}function h(t,e,n){let i=t.id,r=t.gradient,o="radial"===r?"p_":"";return i||(i=t.id="gradient_"+u++,"radial"===r?(t.x1=f(t.x1,.5),t.y1=f(t.y1,.5),t.r1=f(t.r1,0),t.x2=f(t.x2,.5),t.y2=f(t.y2,.5),t.r2=f(t.r2,.5),o="p_"):(t.x1=f(t.x1,0),t.y1=f(t.y1,0),t.x2=f(t.x2,1),t.y2=f(t.y2,0))),e[i]=t,"url("+(n||"")+"#"+o+i+")"}function f(t,e){return null!=t?t:e}function d(t){this.mark=t,this.bounds=this.bounds||new a}function g(t){d.call(this,t),this.items=this.items||[]}function p(t){this._pending=0,this._loader=t||i.loader()}e.inherits(g,d);var v=p.prototype;function y(t){t._pending+=1}function m(t){t._pending-=1}v.pending=function(){return this._pending},v.sanitizeURL=function(t){var e=this;return y(e),e._loader.sanitize(t,{context:"href"}).then((function(t){return m(e),t})).catch((function(){return m(e),null}))},v.loadImage=function(t){const i=this,r=n.image();return y(i),i._loader.sanitize(t,{context:"image"}).then((function(t){const n=t.href;if(!n||!r)throw{url:n};const o=new r,s=e.hasOwnProperty(t,"crossOrigin")?t.crossOrigin:"anonymous";return null!=s&&(o.crossOrigin=s),o.onload=()=>m(i),o.onerror=()=>m(i),o.src=n,o})).catch((function(t){return m(i),{complete:!1,width:0,height:0,src:t&&t.url||""}}))},v.ready=function(){var t=this;return new Promise((function(e){!function n(i){t.pending()?setTimeout((function(){n(!0)}),10):e(i)}(!1)}))};var _={basis:{curve:r.curveBasis},"basis-closed":{curve:r.curveBasisClosed},"basis-open":{curve:r.curveBasisOpen},bundle:{curve:r.curveBundle,tension:"beta",value:.85},cardinal:{curve:r.curveCardinal,tension:"tension",value:0},"cardinal-open":{curve:r.curveCardinalOpen,tension:"tension",value:0},"cardinal-closed":{curve:r.curveCardinalClosed,tension:"tension",value:0},"catmull-rom":{curve:r.curveCatmullRom,tension:"alpha",value:.5},"catmull-rom-closed":{curve:r.curveCatmullRomClosed,tension:"alpha",value:.5},"catmull-rom-open":{curve:r.curveCatmullRomOpen,tension:"alpha",value:.5},linear:{curve:r.curveLinear},"linear-closed":{curve:r.curveLinearClosed},monotone:{horizontal:r.curveMonotoneY,vertical:r.curveMonotoneX},natural:{curve:r.curveNatural},step:{curve:r.curveStep},"step-after":{curve:r.curveStepAfter},"step-before":{curve:r.curveStepBefore}};function x(t,n,i){var r=e.hasOwnProperty(_,t)&&_[t],o=null;return r&&(o=r.curve||r[n||"vertical"],r.tension&&null!=i&&(o=o[r.tension](i))),o}var b={m:2,l:2,h:1,v:1,c:6,s:4,q:4,t:2,a:7},k=[/([MLHVCSQTAZmlhvcsqtaz])/g,/###/,/(\d)([-+])/g,/\s|,|###/];function w(t){var e,n,i,r,o,s,a,l,u,c,h,f=[];for(l=0,c=(e=t.slice().replace(k[0],"###$1").split(k[1]).slice(1)).length;l<c;++l){for(i=(n=e[l]).slice(1).trim().replace(k[2],"$1###$2").split(k[3]),r=[s=n.charAt(0)],u=0,h=i.length;u<h;++u)(o=+i[u])===o&&r.push(o);if(a=b[s.toLowerCase()],r.length-1>a)for(u=1,h=r.length;u<h;u+=a)f.push([s].concat(r.slice(u,u+a)));else f.push(r)}return f}const T=Math.PI/180,A=Math.PI/2,M=2*Math.PI,C=Math.sqrt(3)/2;var R={},z={},P=[].join;function S(t){var e=P.call(t);if(z[e])return z[e];var n=t[0],i=t[1],r=t[2],o=t[3],s=t[4],a=t[5],l=t[6],u=t[7],c=u*s,h=-l*a,f=l*s,d=u*a,g=Math.cos(r),p=Math.sin(r),v=Math.cos(o),y=Math.sin(o),m=.5*(o-r),_=Math.sin(.5*m),x=8/3*_*_/Math.sin(m),b=n+g-x*p,k=i+p+x*g,w=n+v,T=i+y,A=w+x*y,M=T-x*v;return z[e]=[c*b+h*k,f*b+d*k,c*A+h*M,f*A+d*M,c*w+h*T,f*w+d*T]}var L=["l",0,0,0,0,0,0,0];function O(t,e,n){var i=L[0]=t[0];if("a"===i||"A"===i)L[1]=e*t[1],L[2]=n*t[2],L[3]=t[3],L[4]=t[4],L[5]=t[5],L[6]=e*t[6],L[7]=n*t[7];else if("h"===i||"H"===i)L[1]=e*t[1];else if("v"===i||"V"===i)L[1]=n*t[1];else for(var r=1,o=t.length;r<o;++r)L[r]=(r%2==1?e:n)*t[r];return L}function N(t,e,n,i,r,o){var s,a,l,u,c,h=null,f=0,d=0,g=0,p=0;null==n&&(n=0),null==i&&(i=0),null==r&&(r=1),null==o&&(o=r),t.beginPath&&t.beginPath();for(var v=0,y=e.length;v<y;++v){switch(s=e[v],1===r&&1===o||(s=O(s,r,o)),s[0]){case"l":f+=s[1],d+=s[2],t.lineTo(f+n,d+i);break;case"L":f=s[1],d=s[2],t.lineTo(f+n,d+i);break;case"h":f+=s[1],t.lineTo(f+n,d+i);break;case"H":f=s[1],t.lineTo(f+n,d+i);break;case"v":d+=s[1],t.lineTo(f+n,d+i);break;case"V":d=s[1],t.lineTo(f+n,d+i);break;case"m":f+=s[1],d+=s[2],t.moveTo(f+n,d+i);break;case"M":f=s[1],d=s[2],t.moveTo(f+n,d+i);break;case"c":a=f+s[5],l=d+s[6],g=f+s[3],p=d+s[4],t.bezierCurveTo(f+s[1]+n,d+s[2]+i,g+n,p+i,a+n,l+i),f=a,d=l;break;case"C":f=s[5],d=s[6],g=s[3],p=s[4],t.bezierCurveTo(s[1]+n,s[2]+i,g+n,p+i,f+n,d+i);break;case"s":a=f+s[3],l=d+s[4],g=2*f-g,p=2*d-p,t.bezierCurveTo(g+n,p+i,f+s[1]+n,d+s[2]+i,a+n,l+i),g=f+s[1],p=d+s[2],f=a,d=l;break;case"S":a=s[3],l=s[4],g=2*f-g,p=2*d-p,t.bezierCurveTo(g+n,p+i,s[1]+n,s[2]+i,a+n,l+i),f=a,d=l,g=s[1],p=s[2];break;case"q":a=f+s[3],l=d+s[4],g=f+s[1],p=d+s[2],t.quadraticCurveTo(g+n,p+i,a+n,l+i),f=a,d=l;break;case"Q":a=s[3],l=s[4],t.quadraticCurveTo(s[1]+n,s[2]+i,a+n,l+i),f=a,d=l,g=s[1],p=s[2];break;case"t":a=f+s[1],l=d+s[2],null===h[0].match(/[QqTt]/)?(g=f,p=d):"t"===h[0]?(g=2*f-u,p=2*d-c):"q"===h[0]&&(g=2*f-g,p=2*d-p),u=g,c=p,t.quadraticCurveTo(g+n,p+i,a+n,l+i),d=l,g=(f=a)+s[1],p=d+s[2];break;case"T":a=s[1],l=s[2],g=2*f-g,p=2*d-p,t.quadraticCurveTo(g+n,p+i,a+n,l+i),f=a,d=l;break;case"a":q(t,f+n,d+i,[s[1],s[2],s[3],s[4],s[5],s[6]+f+n,s[7]+d+i]),f+=s[6],d+=s[7];break;case"A":q(t,f+n,d+i,[s[1],s[2],s[3],s[4],s[5],s[6]+n,s[7]+i]),f=s[6],d=s[7];break;case"z":case"Z":t.closePath()}h=s}}function q(t,e,n,i){for(var r=function(t,e,n,i,r,o,s,a,l){var u=P.call(arguments);if(R[u])return R[u];var c=s*T,h=Math.sin(c),f=Math.cos(c),d=f*(a-t)*.5+h*(l-e)*.5,g=f*(l-e)*.5-h*(a-t)*.5,p=d*d/((n=Math.abs(n))*n)+g*g/((i=Math.abs(i))*i);p>1&&(n*=p=Math.sqrt(p),i*=p);var v=f/n,y=h/n,m=-h/i,_=f/i,x=v*a+y*l,b=m*a+_*l,k=v*t+y*e,w=m*t+_*e,C=(k-x)*(k-x)+(w-b)*(w-b),z=1/C-.25;z<0&&(z=0);var S=Math.sqrt(z);o==r&&(S=-S);var L=.5*(x+k)-S*(w-b),O=.5*(b+w)+S*(k-x),N=Math.atan2(b-O,x-L),q=Math.atan2(w-O,k-L),D=q-N;D<0&&1===o?D+=M:D>0&&0===o&&(D-=M);for(var E=Math.ceil(Math.abs(D/(A+.001))),I=[],B=0;B<E;++B){var V=N+B*D/E,H=N+(B+1)*D/E;I[B]=[L,O,V,H,n,i,h,f]}return R[u]=I}(i[5],i[6],i[0],i[1],i[3],i[4],i[2],e,n),o=0;o<r.length;++o){var s=S(r[o]);t.bezierCurveTo(s[0],s[1],s[2],s[3],s[4],s[5])}}var D=.5773502691896257,E={circle:{draw:function(t,e){var n=Math.sqrt(e)/2;t.moveTo(n,0),t.arc(0,0,n,0,M)}},cross:{draw:function(t,e){var n=Math.sqrt(e)/2,i=n/2.5;t.moveTo(-n,-i),t.lineTo(-n,i),t.lineTo(-i,i),t.lineTo(-i,n),t.lineTo(i,n),t.lineTo(i,i),t.lineTo(n,i),t.lineTo(n,-i),t.lineTo(i,-i),t.lineTo(i,-n),t.lineTo(-i,-n),t.lineTo(-i,-i),t.closePath()}},diamond:{draw:function(t,e){var n=Math.sqrt(e)/2;t.moveTo(-n,0),t.lineTo(0,-n),t.lineTo(n,0),t.lineTo(0,n),t.closePath()}},square:{draw:function(t,e){var n=Math.sqrt(e),i=-n/2;t.rect(i,i,n,n)}},arrow:{draw:function(t,e){var n=Math.sqrt(e)/2,i=n/7,r=n/2.5,o=n/8;t.moveTo(-i,n),t.lineTo(i,n),t.lineTo(i,-o),t.lineTo(r,-o),t.lineTo(0,-n),t.lineTo(-r,-o),t.lineTo(-i,-o),t.closePath()}},wedge:{draw:function(t,e){var n=Math.sqrt(e)/2,i=C*n,r=i-n*D,o=n/4;t.moveTo(0,-i-r),t.lineTo(-o,i-r),t.lineTo(o,i-r),t.closePath()}},triangle:{draw:function(t,e){var n=Math.sqrt(e)/2,i=C*n,r=i-n*D;t.moveTo(0,-i-r),t.lineTo(-n,i-r),t.lineTo(n,i-r),t.closePath()}},"triangle-up":{draw:function(t,e){var n=Math.sqrt(e)/2,i=C*n;t.moveTo(0,-i),t.lineTo(-n,i),t.lineTo(n,i),t.closePath()}},"triangle-down":{draw:function(t,e){var n=Math.sqrt(e)/2,i=C*n;t.moveTo(0,i),t.lineTo(-n,-i),t.lineTo(n,-i),t.closePath()}},"triangle-right":{draw:function(t,e){var n=Math.sqrt(e)/2,i=C*n;t.moveTo(i,0),t.lineTo(-i,-n),t.lineTo(-i,n),t.closePath()}},"triangle-left":{draw:function(t,e){var n=Math.sqrt(e)/2,i=C*n;t.moveTo(-i,0),t.lineTo(i,-n),t.lineTo(i,n),t.closePath()}},stroke:{draw:function(t,e){var n=Math.sqrt(e)/2;t.moveTo(-n,0),t.lineTo(n,0)}}};function I(t){return e.hasOwnProperty(E,t)?E[t]:function(t){if(!e.hasOwnProperty(B,t)){var n=w(t);B[t]={draw:function(t,e){N(t,n,0,0,Math.sqrt(e)/2)}}}return B[t]}(t)}var B={};const V=.448084975506;function H(t){return t.x}function j(t){return t.y}function G(t){return t.width}function W(t){return t.height}function U(t){return"function"==typeof t?t:()=>+t}function X(t,e,n){return Math.max(e,Math.min(t,n))}function F(){var t=H,e=j,n=G,i=W,r=U(0),s=r,a=r,l=r,u=null;function c(c,h,f){var d,g=null!=h?h:+t.call(this,c),p=null!=f?f:+e.call(this,c),v=+n.call(this,c),y=+i.call(this,c),m=Math.min(v,y)/2,_=X(+r.call(this,c),0,m),x=X(+s.call(this,c),0,m),b=X(+a.call(this,c),0,m),k=X(+l.call(this,c),0,m);if(u||(u=d=o.path()),_<=0&&x<=0&&b<=0&&k<=0)u.rect(g,p,v,y);else{var w=g+v,T=p+y;u.moveTo(g+_,p),u.lineTo(w-x,p),u.bezierCurveTo(w-V*x,p,w,p+V*x,w,p+x),u.lineTo(w,T-k),u.bezierCurveTo(w,T-V*k,w-V*k,T,w-k,T),u.lineTo(g+b,T),u.bezierCurveTo(g+V*b,T,g,T-V*b,g,T-b),u.lineTo(g,p+_),u.bezierCurveTo(g,p+V*_,g+V*_,p,g+_,p),u.closePath()}if(d)return u=null,d+""||null}return c.x=function(e){return arguments.length?(t=U(e),c):t},c.y=function(t){return arguments.length?(e=U(t),c):e},c.width=function(t){return arguments.length?(n=U(t),c):n},c.height=function(t){return arguments.length?(i=U(t),c):i},c.cornerRadius=function(t,e,n,i){return arguments.length?(r=U(t),s=null!=e?U(e):r,l=null!=n?U(n):r,a=null!=i?U(i):s,c):r},c.context=function(t){return arguments.length?(u=null==t?null:t,c):u},c}function $(){var t,e,n,i,r,s,a,l,u=null;function c(t,e,n){var i=n/2;if(r){var o=a-e,c=t-s;if(o||c){var h=Math.sqrt(o*o+c*c),f=(o/=h)*l,d=(c/=h)*l,g=Math.atan2(c,o);u.moveTo(s-f,a-d),u.lineTo(t-o*i,e-c*i),u.arc(t,e,i,g-Math.PI,g),u.lineTo(s+f,a+d),u.arc(s,a,l,g,g+Math.PI)}else u.arc(t,e,i,0,M);u.closePath()}else r=1;s=t,a=e,l=i}function h(s){var a,l,h,f=s.length,d=!1;for(null==u&&(u=h=o.path()),a=0;a<=f;++a)!(a<f&&i(l=s[a],a,s))===d&&(d=!d)&&(r=0),d&&c(+t(l,a,s),+e(l,a,s),+n(l,a,s));if(h)return u=null,h+""||null}return h.x=function(e){return arguments.length?(t=e,h):t},h.y=function(t){return arguments.length?(e=t,h):e},h.size=function(t){return arguments.length?(n=t,h):n},h.defined=function(t){return arguments.length?(i=t,h):i},h.context=function(t){return arguments.length?(u=null==t?null:t,h):u},h}function Y(t,e){return null!=t?t:e}const J=t=>t.x||0,Q=t=>t.y||0,Z=t=>!(!1===t.defined),K=r.arc().startAngle(t=>t.startAngle||0).endAngle(t=>t.endAngle||0).padAngle(t=>t.padAngle||0).innerRadius(t=>t.innerRadius||0).outerRadius(t=>t.outerRadius||0).cornerRadius(t=>t.cornerRadius||0),tt=r.area().x(J).y1(Q).y0(t=>(t.y||0)+(t.height||0)).defined(Z),et=r.area().y(Q).x1(J).x0(t=>(t.x||0)+(t.width||0)).defined(Z),nt=r.line().x(J).y(Q).defined(Z),it=F().x(J).y(Q).width(t=>t.width||0).height(t=>t.height||0).cornerRadius(t=>Y(t.cornerRadiusTopLeft,t.cornerRadius)||0,t=>Y(t.cornerRadiusTopRight,t.cornerRadius)||0,t=>Y(t.cornerRadiusBottomRight,t.cornerRadius)||0,t=>Y(t.cornerRadiusBottomLeft,t.cornerRadius)||0),rt=r.symbol().type(t=>I(t.shape||"circle")).size(t=>Y(t.size,64)),ot=$().x(J).y(Q).defined(Z).size(t=>t.size||1);function st(t){return t.cornerRadius||t.cornerRadiusTopLeft||t.cornerRadiusTopRight||t.cornerRadiusBottomRight||t.cornerRadiusBottomLeft}function at(t,e,n,i){return it.context(t)(e,n,i)}function lt(t,e,n){if(e.stroke&&0!==e.opacity&&0!==e.strokeOpacity){const i=null!=e.strokeWidth?+e.strokeWidth:1;t.expand(i+(n?function(t,e){return t.strokeJoin&&"miter"!==t.strokeJoin?0:e}(e,i):0))}return t}var ut,ct,ht,ft=M-1e-8;function dt(t){return ut=t,dt}function gt(){}function pt(t,e){ut.add(t,e)}function vt(t,e){pt(ct=t,ht=e)}function yt(t){pt(t,ut.y1)}function mt(t){pt(ut.x1,t)}function _t(t,e,n,i){const r=(t-e)/(t+n-2*e);0<r&&r<1&&i(t+(e-t)*r)}function xt(t,e,n,i,r){const o=i-t+3*e-3*n,s=t+n-2*e,a=t-e;let l,u=0,c=0;Math.abs(o)>1e-14?(l=s*s+a*o,l>=0&&(l=Math.sqrt(l),u=(-s+l)/o,c=(-s-l)/o)):u=.5*a/s,0<u&&u<1&&r(bt(u,t,e,n,i)),0<c&&c<1&&r(bt(c,t,e,n,i))}function bt(t,e,n,i,r){const o=1-t,s=o*o,a=t*t;return s*o*e+3*s*t*n+3*o*a*i+a*t*r}dt.beginPath=gt,dt.closePath=gt,dt.moveTo=vt,dt.lineTo=vt,dt.rect=function(t,e,n,i){pt(t+n,e+i),vt(t,e)},dt.quadraticCurveTo=function(t,e,n,i){_t(ct,t,n,yt),_t(ht,e,i,mt),vt(n,i)},dt.bezierCurveTo=function(t,e,n,i,r,o){xt(ct,t,n,r,yt),xt(ht,e,i,o,mt),vt(r,o)},dt.arc=function(t,e,n,i,r,o){if(ct=n*Math.cos(r)+t,ht=n*Math.sin(r)+e,Math.abs(r-i)>ft)pt(t-n,e-n),pt(t+n,e+n);else{const s=i=>pt(n*Math.cos(i)+t,n*Math.sin(i)+e);let a,l;if(s(i),s(r),r!==i)if((i%=M)<0&&(i+=M),(r%=M)<0&&(r+=M),r<i&&(o=!o,a=i,i=r,r=a),o)for(r-=M,a=i-i%A,l=0;l<4&&a>r;++l,a-=A)s(a);else for(a=i-i%A+A,l=0;l<4&&a<r;++l,a+=A)s(a)}};var kt=(kt=n.canvas(1,1))?kt.getContext("2d"):null;const wt=new a;function Tt(t){return function(e,n){if(!kt)return!0;t(kt,e),wt.clear().union(e.bounds).intersect(n).round();const{x1:i,y1:r,x2:o,y2:s}=wt;for(let t=r;t<=s;++t)for(let e=i;e<=o;++e)if(kt.isPointInPath(e,t))return!0;return!1}}function At(t,e){return e.contains(t.x||0,t.y||0)}function Mt(t,e){const n=t.x||0,i=t.y||0,r=t.width||0,o=t.height||0;return e.intersects(wt.set(n,i,n+r,i+o))}function Ct(t,e){const n=t.x||0,i=t.y||0;return Rt(e,n,i,null!=t.x2?t.x2:n,null!=t.y2?t.y2:i)}function Rt(t,e,n,i,r){const{x1:o,y1:s,x2:a,y2:l}=t,u=i-e,c=r-n;let h,f,d,g,p=0,v=1;for(g=0;g<4;++g){if(0===g&&(h=-u,f=-(o-e)),1===g&&(h=u,f=a-e),2===g&&(h=-c,f=-(s-n)),3===g&&(h=c,f=l-n),Math.abs(h)<1e-10&&f<0)return!1;if(d=f/h,h<0){if(d>v)return!1;d>p&&(p=d)}else if(h>0){if(d<p)return!1;d<v&&(v=d)}}return!0}function zt(t,e){t.globalCompositeOperation=e.blend||"source-over"}function Pt(t,e){return null==t?e:t}function St(t,e){const n=e.length;for(let i=0;i<n;++i)t.addColorStop(e[i].offset,e[i].color);return t}function Lt(t,e,i){return c(i)?function(t,e,i){const r=i.width(),o=i.height();let s;if("radial"===e.gradient)s=t.createRadialGradient(i.x1+Pt(e.x1,.5)*r,i.y1+Pt(e.y1,.5)*o,Math.max(r,o)*Pt(e.r1,0),i.x1+Pt(e.x2,.5)*r,i.y1+Pt(e.y2,.5)*o,Math.max(r,o)*Pt(e.r2,.5));else{const a=Pt(e.x1,0),l=Pt(e.y1,0),u=Pt(e.x2,1),c=Pt(e.y2,0);if(a!==u&&l!==c&&r!==o){const i=n.canvas(Math.ceil(r),Math.ceil(o)),s=i.getContext("2d");return s.scale(r,o),s.fillStyle=St(s.createLinearGradient(a,l,u,c),e.stops),s.fillRect(0,0,r,o),t.createPattern(i,"no-repeat")}s=t.createLinearGradient(i.x1+a*r,i.y1+l*o,i.x1+u*r,i.y1+c*o)}return St(s,e.stops)}(t,i,e.bounds):i}function Ot(t,e,n){return(n*=null==e.fillOpacity?1:e.fillOpacity)>0&&(t.globalAlpha=n,t.fillStyle=Lt(t,e,e.fill),!0)}var Nt=[];function qt(t,e,n){var i=null!=(i=e.strokeWidth)?i:1;return!(i<=0)&&((n*=null==e.strokeOpacity?1:e.strokeOpacity)>0&&(t.globalAlpha=n,t.strokeStyle=Lt(t,e,e.stroke),t.lineWidth=i,t.lineCap=e.strokeCap||"butt",t.lineJoin=e.strokeJoin||"miter",t.miterLimit=e.strokeMiterLimit||10,t.setLineDash&&(t.setLineDash(e.strokeDash||Nt),t.lineDashOffset=e.strokeDashOffset||0),!0))}function Dt(t,e){return t.zindex-e.zindex||t.index-e.index}function Et(t){if(!t.zdirty)return t.zitems;var e,n,i,r=t.items,o=[];for(n=0,i=r.length;n<i;++n)(e=r[n]).index=n,e.zindex&&o.push(e);return t.zdirty=!1,t.zitems=o.sort(Dt)}function It(t,e){var n,i,r=t.items;if(r&&r.length){var o=Et(t);if(o&&o.length){for(n=0,i=r.length;n<i;++n)r[n].zindex||e(r[n]);r=o}for(n=0,i=r.length;n<i;++n)e(r[n])}}function Bt(t,e){var n,i,r=t.items;if(!r||!r.length)return null;var o=Et(t);for(o&&o.length&&(r=o),i=r.length;--i>=0;)if(n=e(r[i]))return n;if(r===o)for(i=(r=t.items).length;--i>=0;)if(!r[i].zindex&&(n=e(r[i])))return n;return null}function Vt(t){return function(e,n,i){It(n,(function(n){i&&!i.intersects(n.bounds)||jt(t,e,n,n)}))}}function Ht(t){return function(e,n,i){!n.items.length||i&&!i.intersects(n.bounds)||jt(t,e,n.items[0],n.items)}}function jt(t,e,n,i){var r=null==n.opacity?1:n.opacity;0!==r&&(t(e,i)||(zt(e,n),n.fill&&Ot(e,n,r)&&e.fill(),n.stroke&&qt(e,n,r)&&e.stroke()))}function Gt(t){return t=t||e.truthy,function(e,n,i,r,o,s){return i*=e.pixelRatio,r*=e.pixelRatio,Bt(n,(function(n){var a=n.bounds;if((!a||a.contains(o,s))&&a)return t(e,n,i,r,o,s)?n:void 0}))}}function Wt(t,e){return function(n,i,r,o){var s,a,l=Array.isArray(i)?i[0]:i,u=null==e?l.fill:e,c=l.stroke&&n.isPointInStroke;return c&&(s=l.strokeWidth,a=l.strokeCap,n.lineWidth=null!=s?s:1,n.lineCap=null!=a?a:"butt"),!t(n,i)&&(u&&n.isPointInPath(r,o)||c&&n.isPointInStroke(r,o))}}function Ut(t){return Gt(Wt(t))}function Xt(t,e){return"translate("+t+","+e+")"}function Ft(t){return"rotate("+t+")"}function $t(t){return Xt(t.x||0,t.y||0)}function Yt(t){return Xt(t.x||0,t.y||0)+(t.angle?" "+Ft(t.angle):"")+(t.scaleX||t.scaleY?" "+(e=t.scaleX||1,n=t.scaleY||1,"scale("+e+","+n+")"):"");var e,n}function Jt(t,e,n){function i(t,n){var i=n.x||0,r=n.y||0,o=n.angle||0;t.translate(i,r),o&&t.rotate(o*=T),t.beginPath(),e(t,n),o&&t.rotate(-o),t.translate(-i,-r)}return{type:t,tag:"path",nested:!1,attr:function(t,n){t("transform",Yt(n)),t("d",e(null,n))},bound:function(t,n){var i=n.x||0,r=n.y||0;return e(dt(t),n),lt(t,n).translate(i,r),n.angle&&t.rotate(n.angle*T,i,r),t},draw:Vt(i),pick:Ut(i),isect:n||Tt(i)}}var Qt=Jt("arc",(function(t,e){return K.context(t)(e)}));function Zt(t,e,n){function i(t,n){t.beginPath(),e(t,n)}var r=Wt(i);return{type:t,tag:"path",nested:!0,attr:function(t,n){var i=n.mark.items;i.length&&t("d",e(null,i))},bound:function(t,n){var i=n.items;return 0===i.length?t:(e(dt(t),i),lt(t,i[0]))},draw:Ht(i),pick:function(t,e,n,i,o,s){var a=e.items,l=e.bounds;return!a||!a.length||l&&!l.contains(o,s)?null:(n*=t.pixelRatio,i*=t.pixelRatio,r(t,a,n,i)?a[0]:null)},isect:At,tip:n}}var Kt=Zt("area",(function(t,e){var n=e[0],i=n.interpolate||"linear";return("horizontal"===n.orient?et:tt).curve(x(i,n.orient,n.tension)).context(t)(e)}),(function(t,e){for(var n,i,r="horizontal"===t[0].orient?e[1]:e[0],o="horizontal"===t[0].orient?"y":"x",s=t.length,a=1/0;--s>=0;)!1!==t[s].defined&&(i=Math.abs(t[s][o]-r))<a&&(a=i,n=t[s]);return n}));function te(t,e){t.beginPath(),st(e)?at(t,e,0,0):t.rect(0,0,e.width||0,e.height||0),t.clip()}var ee=1;function ne(t,n,i){var r=n.clip,o=t._defs,s=n.clip_id||(n.clip_id="clip"+ee++),a=o.clipping[s]||(o.clipping[s]={id:s});return e.isFunction(r)?a.path=r(null):st(i)?a.path=at(null,i,0,0):(a.width=i.width||0,a.height=i.height||0),"url(#"+s+")"}function ie(t){var e=null!=(e=t.strokeWidth)?e:1;return null!=t.strokeOffset?t.strokeOffset:t.stroke&&e>.5&&e<1.5?.5-Math.abs(e-1):0}function re(t,e){var n=ie(e);t("d",at(null,e,n,n))}function oe(t,e,n,i){var r=ie(e);t.beginPath(),at(t,e,(n||0)+r,(i||0)+r)}var se=Wt(oe),ae=Wt(oe,!1);var le={type:"group",tag:"g",nested:!1,attr:function(t,e){t("transform",$t(e))},bound:function(t,e){if(!e.clip&&e.items)for(var n=e.items,i=0,r=n.length;i<r;++i)t.union(n[i].bounds);return(e.clip||e.width||e.height)&&!e.noBound&&t.add(0,0).add(e.width||0,e.height||0),lt(t,e),t.translate(e.x||0,e.y||0)},draw:function(t,e,n){var i=this;It(e,(function(e){var r=e.x||0,o=e.y||0,s=e.strokeForeground,a=null==e.opacity?1:e.opacity;(e.stroke||e.fill)&&a&&(oe(t,e,r,o),zt(t,e),e.fill&&Ot(t,e,a)&&t.fill(),e.stroke&&!s&&qt(t,e,a)&&t.stroke()),t.save(),t.translate(r,o),e.clip&&te(t,e),n&&n.translate(-r,-o),It(e,(function(e){i.draw(t,e,n)})),n&&n.translate(r,o),t.restore(),s&&e.stroke&&a&&(oe(t,e,r,o),zt(t,e),qt(t,e,a)&&t.stroke())}))},pick:function(t,e,n,i,r,o){if(e.bounds&&!e.bounds.contains(r,o)||!e.items)return null;var s=this,a=n*t.pixelRatio,l=i*t.pixelRatio;return Bt(e,(function(u){var c,h,f,d,g,p,v,y,m;if((!(y=u.bounds)||y.contains(r,o))&&(d=u.x||0,g=u.y||0,p=d+(u.width||0),v=g+(u.height||0),!(m=u.clip)||!(r<d||r>p||o<d||o>v)))return t.save(),t.translate(d,g),d=r-d,g=o-g,m&&st(u)&&!se(t,u,a,l)?(t.restore(),null):(h=u.strokeForeground,(f=!1!==e.interactive)&&h&&u.stroke&&ae(t,u,a,l)?(t.restore(),u):(!(c=Bt(u,(function(t){return function(t,e,n){return(!1!==t.interactive||"group"===t.marktype)&&t.bounds&&t.bounds.contains(e,n)}(t,d,g)?s.pick(t,n,i,d,g):null})))&&f&&(u.fill||!h&&u.stroke)&&se(t,u,a,l)&&(c=u),t.restore(),c||null))}))},isect:Mt,content:function(t,e,n){t("clip-path",e.clip?ne(n,e,e):null)},background:function(t,e){t("class","background"),t("aria-hidden",!0),re(t,e)},foreground:function(t,e){t("class","foreground"),t("aria-hidden",!0),e.strokeForeground?re(t,e):t("d","")}};function ue(t,e){var n=t.image;return(!n||t.url&&t.url!==n.url)&&(n={complete:!1,width:0,height:0},e.loadImage(t.url).then(e=>{t.image=e,t.image.url=t.url})),n}function ce(t,e){return null!=t.width?t.width:e&&e.width?!1!==t.aspect&&t.height?t.height*e.width/e.height:e.width:0}function he(t,e){return null!=t.height?t.height:e&&e.height?!1!==t.aspect&&t.width?t.width*e.height/e.width:e.height:0}function fe(t,e){return"center"===t?e/2:"right"===t?e:0}function de(t,e){return"middle"===t?e/2:"bottom"===t?e:0}var ge={type:"image",tag:"image",nested:!1,attr:function(t,e,n){var i=ue(e,n),r=e.x||0,o=e.y||0,s=ce(e,i),a=he(e,i),l=!1===e.aspect?"none":"xMidYMid";r-=fe(e.align,s),o-=de(e.baseline,a),!i.src&&i.toDataURL?t("href",i.toDataURL(),"http://www.w3.org/1999/xlink","xlink:href"):t("href",i.src||"","http://www.w3.org/1999/xlink","xlink:href"),t("transform",Xt(r,o)),t("width",s),t("height",a),t("preserveAspectRatio",l)},bound:function(t,e){var n=e.image,i=e.x||0,r=e.y||0,o=ce(e,n),s=he(e,n);return i-=fe(e.align,o),r-=de(e.baseline,s),t.set(i,r,i+o,r+s)},draw:function(t,e,n){var i=this;It(e,(function(e){if(!n||n.intersects(e.bounds)){var r,o,s,a,l=ue(e,i),u=e.x||0,c=e.y||0,h=ce(e,l),f=he(e,l);u-=fe(e.align,h),c-=de(e.baseline,f),!1!==e.aspect&&(o=l.width/l.height,s=e.width/e.height,o==o&&s==s&&o!==s&&(s<o?(c+=(f-(a=h/o))/2,f=a):(u+=(h-(a=f*o))/2,h=a))),(l.complete||l.toDataURL)&&(zt(t,e),t.globalAlpha=null!=(r=e.opacity)?r:1,t.imageSmoothingEnabled=!1!==e.smooth,t.drawImage(l,u,c,h,f))}}))},pick:Gt(),isect:e.truthy,get:ue,xOffset:fe,yOffset:de},pe=Zt("line",(function(t,e){var n=e[0],i=n.interpolate||"linear";return nt.curve(x(i,n.orient,n.tension)).context(t)(e)}),(function(t,e){for(var n,i,r=Math.pow(t[0].strokeWidth||1,2),o=t.length;--o>=0;)if(!1!==t[o].defined&&(n=t[o].x-e[0])*n+(i=t[o].y-e[1])*i<r)return t[o];return null}));function ve(t,e){var n=e.path;if(null==n)return!0;var i=e.x||0,r=e.y||0,o=e.scaleX||1,s=e.scaleY||1,a=(e.angle||0)*T,l=e.pathCache;l&&l.path===n||((e.pathCache=l=w(n)).path=n),a&&t.rotate&&t.translate?(t.translate(i,r),t.rotate(a),N(t,l,0,0,o,s),t.rotate(-a),t.translate(-i,-r)):N(t,l,i,r,o,s)}var ye={type:"path",tag:"path",nested:!1,attr:function(t,e){var n=e.scaleX||1,i=e.scaleY||1;1===n&&1===i||t("vector-effect","non-scaling-stroke"),t("transform",Yt(e)),t("d",e.path)},bound:function(t,e){return ve(dt(t),e)?t.set(0,0,0,0):lt(t,e,!0),e.angle&&t.rotate(e.angle*T,e.x||0,e.y||0),t},draw:Vt(ve),pick:Ut(ve),isect:Tt(ve)};function me(t,e){t.beginPath(),at(t,e)}var _e={type:"rect",tag:"path",nested:!1,attr:function(t,e){t("d",at(null,e))},bound:function(t,e){var n,i;return lt(t.set(n=e.x||0,i=e.y||0,n+e.width||0,i+e.height||0),e)},draw:Vt(me),pick:Ut(me),isect:Mt};function xe(t,e,n){var i,r,o,s;return!(!e.stroke||!qt(t,e,n))&&(i=e.x||0,r=e.y||0,o=null!=e.x2?e.x2:i,s=null!=e.y2?e.y2:r,t.beginPath(),t.moveTo(i,r),t.lineTo(o,s),!0)}var be={type:"rule",tag:"line",nested:!1,attr:function(t,e){t("transform",$t(e)),t("x2",null!=e.x2?e.x2-(e.x||0):0),t("y2",null!=e.y2?e.y2-(e.y||0):0)},bound:function(t,e){var n,i;return lt(t.set(n=e.x||0,i=e.y||0,null!=e.x2?e.x2:n,null!=e.y2?e.y2:i),e)},draw:function(t,e,n){It(e,(function(e){if(!n||n.intersects(e.bounds)){var i=null==e.opacity?1:e.opacity;i&&xe(t,e,i)&&(zt(t,e),t.stroke())}}))},pick:Gt((function(t,e,n,i){return!!t.isPointInStroke&&(xe(t,e,1)&&t.isPointInStroke(n,i))})),isect:Ct},ke=Jt("shape",(function(t,e){return(e.mark.shape||e.shape).context(t)(e)})),we=Jt("symbol",(function(t,e){return rt.context(t)(e)}),At);const Te=e.lruCache();var Ae={height:Se,measureWidth:ze,estimateWidth:Ce,width:Ce,canvas:Me};function Me(t){Ae.width=t&&kt?ze:Ce}function Ce(t,e){return Re(Ne(t,e),Se(t))}function Re(t,e){return~~(.8*t.length*e)}function ze(t,e){return Se(t)<=0||!(e=Ne(t,e))?0:Pe(e,De(t))}function Pe(t,e){const n=`(${e}) ${t}`;let i=Te.get(n);return void 0===i&&(kt.font=e,i=kt.measureText(t).width,Te.set(n,i)),i}function Se(t){return null!=t.fontSize?+t.fontSize||0:11}function Le(t){return null!=t.lineHeight?t.lineHeight:Se(t)+2}function Oe(t){return n=t.lineBreak&&t.text&&!e.isArray(t.text)?t.text.split(t.lineBreak):t.text,e.isArray(n)?n.length>1?n:n[0]:n;var n}function Ne(t,e){const n=null==e?"":(e+"").trim();return t.limit>0&&n.length?function(t,e){var n=+t.limit,i=function(t){if(Ae.width===ze){const e=De(t);return t=>Pe(t,e)}{const e=Se(t);return t=>Re(t,e)}}(t);if(i(e)<n)return e;var r,o=t.ellipsis||"…",s="rtl"===t.dir,a=0,l=e.length;if(n-=i(o),s){for(;a<l;)r=a+l>>>1,i(e.slice(r))>n?a=r+1:l=r;return o+e.slice(a)}for(;a<l;)r=1+(a+l>>>1),i(e.slice(0,r))<n?a=r:l=r-1;return e.slice(0,a)+o}(t,n):n}function qe(t,e){var n=t.font;return(e&&n?String(n).replace(/"/g,"'"):n)||"sans-serif"}function De(t,e){return(t.fontStyle?t.fontStyle+" ":"")+(t.fontVariant?t.fontVariant+" ":"")+(t.fontWeight?t.fontWeight+" ":"")+Se(t)+"px "+qe(t,e)}function Ee(t){var e=t.baseline,n=Se(t);return Math.round("top"===e?.79*n:"middle"===e?.3*n:"bottom"===e?-.21*n:"line-top"===e?.29*n+.5*Le(t):"line-bottom"===e?.29*n-.5*Le(t):0)}Me(!0);var Ie={left:"start",center:"middle",right:"end"},Be=new a;function Ve(t){var e,n=t.x||0,i=t.y||0,r=t.radius||0;return r&&(e=(t.theta||0)-A,n+=r*Math.cos(e),i+=r*Math.sin(e)),Be.x1=n,Be.y1=i,Be}function He(t,n,i){var r,o=Ae.height(n),s=n.align,a=Ve(n),l=a.x1,u=a.y1,c=n.dx||0,h=(n.dy||0)+Ee(n)-Math.round(.8*o),f=Oe(n);if(e.isArray(f)?(o+=Le(n)*(f.length-1),r=f.reduce((t,e)=>Math.max(t,Ae.width(n,e)),0)):r=Ae.width(n,f),"center"===s?c-=r/2:"right"===s&&(c-=r),t.set(c+=l,h+=u,c+r,h+o),n.angle&&!i)t.rotate(n.angle*T,l,u);else if(2===i)return t.rotatedPoints(n.angle*T,l,u);return t}var je={arc:Qt,area:Kt,group:le,image:ge,line:pe,path:ye,rect:_e,rule:be,shape:ke,symbol:we,text:{type:"text",tag:"text",nested:!1,attr:function(t,e){var n,i=e.dx||0,r=(e.dy||0)+Ee(e),o=Ve(e),s=o.x1,a=o.y1,l=e.angle||0;t("text-anchor",Ie[e.align]||"start"),l?(n=Xt(s,a)+" "+Ft(l),(i||r)&&(n+=" "+Xt(i,r))):n=Xt(s+i,a+r),t("transform",n)},bound:He,draw:function(t,n,i){It(n,(function(n){var r,o,s,a,l,u,c,h=null==n.opacity?1:n.opacity;if(!(i&&!i.intersects(n.bounds)||0===h||n.fontSize<=0||null==n.text||0===n.text.length)){if(t.font=De(n),t.textAlign=n.align||"left",o=(r=Ve(n)).x1,s=r.y1,n.angle&&(t.save(),t.translate(o,s),t.rotate(n.angle*T),o=s=0),o+=n.dx||0,s+=(n.dy||0)+Ee(n),u=Oe(n),zt(t,n),e.isArray(u))for(l=Le(n),a=0;a<u.length;++a)c=Ne(n,u[a]),n.fill&&Ot(t,n,h)&&t.fillText(c,o,s),n.stroke&&qt(t,n,h)&&t.strokeText(c,o,s),s+=l;else c=Ne(n,u),n.fill&&Ot(t,n,h)&&t.fillText(c,o,s),n.stroke&&qt(t,n,h)&&t.strokeText(c,o,s);n.angle&&t.restore()}}))},pick:Gt((function(t,e,n,i,r,o){if(e.fontSize<=0)return!1;if(!e.angle)return!0;var s=Ve(e),a=s.x1,l=s.y1,u=He(Be,e,1),c=-e.angle*T,h=Math.cos(c),f=Math.sin(c),d=h*r-f*o+(a-h*a+f*l),g=f*r+h*o+(l-f*a-h*l);return u.contains(d,g)})),isect:function(t,e){var n=He(Be,t,2);return Rt(e,n[0],n[1],n[2],n[3])||Rt(e,n[0],n[1],n[4],n[5])||Rt(e,n[4],n[5],n[6],n[7])||Rt(e,n[2],n[3],n[6],n[7])}},trail:Zt("trail",(function(t,e){return ot.context(t)(e)}),(function(t,e){for(var n,i,r=t.length;--r>=0;)if(!1!==t[r].defined&&(n=t[r].x-e[0])*n+(i=t[r].y-e[1])*i<(n=t[r].size||1)*n)return t[r];return null}))};function Ge(t,e,n){var i=je[t.mark.marktype],r=e||i.bound;return i.nested&&(t=t.mark),r(t.bounds||(t.bounds=new a),t,n)}var We={mark:null};function Ue(t,e,n){var i,r,o,s,l=je[t.marktype],u=l.bound,c=t.items,h=c&&c.length;if(l.nested)return h?o=c[0]:(We.mark=t,o=We),s=Ge(o,u,n),e=e&&e.union(s)||s;if(e=e||t.bounds&&t.bounds.clear()||new a,h)for(i=0,r=c.length;i<r;++i)e.union(Ge(c[i],u,n));return t.bounds=e}var Xe=["marktype","name","role","interactive","clip","items","zindex","x","y","width","height","align","baseline","fill","fillOpacity","opacity","blend","stroke","strokeOpacity","strokeWidth","strokeCap","strokeDash","strokeDashOffset","strokeForeground","strokeOffset","startAngle","endAngle","innerRadius","outerRadius","cornerRadius","padAngle","cornerRadiusTopLeft","cornerRadiusTopRight","cornerRadiusBottomLeft","cornerRadiusBottomRight","interpolate","tension","orient","defined","url","aspect","smooth","path","scaleX","scaleY","x2","y2","size","shape","text","angle","theta","radius","dir","dx","dy","ellipsis","limit","lineBreak","lineHeight","font","fontSize","fontWeight","fontStyle","fontVariant","description","aria","ariaRole","ariaRoleDescription"];function Fe(t,e){return JSON.stringify(t,Xe,e)}function $e(t){return function t(e){var n,i,r,o=e.marktype,s=e.items;if(s)for(i=0,r=s.length;i<r;++i)n=o?"mark":"group",s[i][n]=e,s[i].zindex&&(s[i][n].zdirty=!0),"group"===(o||n)&&t(s[i]);o&&Ue(e);return e}("string"==typeof t?JSON.parse(t):t)}function Ye(t){arguments.length?this.root=$e(t):(this.root=Qe({marktype:"group",name:"root",role:"frame"}),this.root.items=[new g(this.root)])}var Je=Ye.prototype;function Qe(t,e){const n={bounds:new a,clip:!!t.clip,group:e,interactive:!1!==t.interactive,items:[],marktype:t.marktype,name:t.name||void 0,role:t.role||void 0,zindex:t.zindex||0};return null!=t.aria&&(n.aria=t.aria),t.description&&(n.description=t.description),n}function Ze(t,e,n){return!t&&"undefined"!=typeof document&&document.createElement&&(t=document),t?n?t.createElementNS(n,e):t.createElement(e):null}function Ke(t,e){e=e.toLowerCase();for(var n=t.childNodes,i=0,r=n.length;i<r;++i)if(n[i].tagName.toLowerCase()===e)return n[i]}function tn(t,e,n,i){var r,o=t.childNodes[e];return o&&o.tagName.toLowerCase()===n.toLowerCase()||(r=o||null,o=Ze(t.ownerDocument,n,i),t.insertBefore(o,r)),o}function en(t,e){for(var n=t.childNodes,i=n.length;i>e;)t.removeChild(n[--i]);return t}function nn(t){return"mark-"+t.marktype+(t.role?" role-"+t.role:"")+(t.name?" "+t.name:"")}function rn(t,e){var n=e.getBoundingClientRect();return[t.clientX-n.left-(e.clientLeft||0),t.clientY-n.top-(e.clientTop||0)]}function on(t,e){this._active=null,this._handlers={},this._loader=t||i.loader(),this._tooltip=e||sn}function sn(t,e,n,i){t.element().setAttribute("title",i||"")}Je.toJSON=function(t){return Fe(this.root,t||0)},Je.mark=function(t,e,n){var i=Qe(t,e=e||this.root.items[0]);return e.items[n]=i,i.zindex&&(i.group.zdirty=!0),i};var an=on.prototype;function ln(t){this._el=null,this._bgcolor=null,this._loader=new p(t)}an.initialize=function(t,e,n){return this._el=t,this._obj=n||null,this.origin(e)},an.element=function(){return this._el},an.canvas=function(){return this._el&&this._el.firstChild},an.origin=function(t){return arguments.length?(this._origin=t||[0,0],this):this._origin.slice()},an.scene=function(t){return arguments.length?(this._scene=t,this):this._scene},an.on=function(){},an.off=function(){},an._handlerIndex=function(t,e,n){for(var i=t?t.length:0;--i>=0;)if(t[i].type===e&&(!n||t[i].handler===n))return i;return-1},an.handlers=function(t){var e,n=this._handlers,i=[];if(t)i.push.apply(i,n[this.eventName(t)]);else for(e in n)i.push.apply(i,n[e]);return i},an.eventName=function(t){var e=t.indexOf(".");return e<0?t:t.slice(0,e)},an.handleHref=function(t,e,n){this._loader.sanitize(n,{context:"href"}).then((function(e){var n=new MouseEvent(t.type,t),i=Ze(null,"a");for(var r in e)i.setAttribute(r,e[r]);i.dispatchEvent(n)})).catch((function(){}))},an.handleTooltip=function(t,e,n){if(e&&null!=e.tooltip){e=function(t,e,n,i){var r,o,s=t&&t.mark;if(s&&(r=je[s.marktype]).tip){for((o=rn(e,n))[0]-=i[0],o[1]-=i[1];t=t.mark.group;)o[0]-=t.x||0,o[1]-=t.y||0;t=r.tip(s.items,o)}return t}(e,t,this.canvas(),this._origin);var i=n&&e&&e.tooltip||null;this._tooltip.call(this._obj,this,t,e,i)}},an.getItemBoundingClientRect=function(t){if(e=this.canvas()){for(var e,n=e.getBoundingClientRect(),i=this._origin,r=t.bounds,o=r.x1+i[0]+n.left,s=r.y1+i[1]+n.top,a=r.width(),l=r.height();t.mark&&(t=t.mark.group);)o+=t.x||0,s+=t.y||0;return{x:o,y:s,width:a,height:l,left:o,top:s,right:o+a,bottom:s+l}}};var un=ln.prototype;un.initialize=function(t,e,n,i,r){return this._el=t,this.resize(e,n,i,r)},un.element=function(){return this._el},un.canvas=function(){return this._el&&this._el.firstChild},un.background=function(t){return 0===arguments.length?this._bgcolor:(this._bgcolor=t,this)},un.resize=function(t,e,n,i){return this._width=t,this._height=e,this._origin=n||[0,0],this._scale=i||1,this},un.dirty=function(){},un.render=function(t){var e=this;return e._call=function(){e._render(t)},e._call(),e._call=null,e},un._render=function(){},un.renderAsync=function(t){var e=this.render(t);return this._ready?this._ready.then((function(){return e})):Promise.resolve(e)},un._load=function(t,e){var n=this,i=n._loader[t](e);if(!n._ready){var r=n._call;n._ready=n._loader.ready().then((function(t){t&&r(),n._ready=null}))}return i},un.sanitizeURL=function(t){return this._load("sanitizeURL",t)},un.loadImage=function(t){return this._load("loadImage",t)};function cn(t,e){on.call(this,t,e),this._down=null,this._touch=null,this._first=!0}var hn=e.inherits(cn,on);function fn(t,e,n){return function(i){var r=this._active,o=this.pickEvent(i);o===r||(r&&r.exit||this.fire(n,i),this._active=o,this.fire(e,i)),this.fire(t,i)}}function dn(t){return function(e){this.fire(t,e),this._active=null}}hn.initialize=function(t,e,n){var i=this._canvas=t&&Ke(t,"canvas");if(i){var r=this;this.events.forEach((function(t){i.addEventListener(t,(function(e){hn[t]?hn[t].call(r,e):r.fire(t,e)}))}))}return on.prototype.initialize.call(this,t,e,n)},hn.canvas=function(){return this._canvas},hn.context=function(){return this._canvas.getContext("2d")},hn.events=["keydown","keypress","keyup","dragenter","dragleave","dragover","mousedown","mouseup","mousemove","mouseout","mouseover","click","dblclick","wheel","mousewheel","touchstart","touchmove","touchend"],hn.DOMMouseScroll=function(t){this.fire("mousewheel",t)},hn.mousemove=fn("mousemove","mouseover","mouseout"),hn.dragover=fn("dragover","dragenter","dragleave"),hn.mouseout=dn("mouseout"),hn.dragleave=dn("dragleave"),hn.mousedown=function(t){this._down=this._active,this.fire("mousedown",t)},hn.click=function(t){this._down===this._active&&(this.fire("click",t),this._down=null)},hn.touchstart=function(t){this._touch=this.pickEvent(t.changedTouches[0]),this._first&&(this._active=this._touch,this._first=!1),this.fire("touchstart",t,!0)},hn.touchmove=function(t){this.fire("touchmove",t,!0)},hn.touchend=function(t){this.fire("touchend",t,!0),this._touch=null},hn.fire=function(t,e,n){var i,r,o=n?this._touch:this._active,s=this._handlers[t];if(e.vegaType=t,"click"===t&&o&&o.href?this.handleHref(e,o,o.href):"mousemove"!==t&&"mouseout"!==t||this.handleTooltip(e,o,"mouseout"!==t),s)for(i=0,r=s.length;i<r;++i)s[i].handler.call(this._obj,e,o)},hn.on=function(t,e){var n=this.eventName(t),i=this._handlers;return this._handlerIndex(i[n],t,e)<0&&(i[n]||(i[n]=[])).push({type:t,handler:e}),this},hn.off=function(t,e){var n=this.eventName(t),i=this._handlers[n],r=this._handlerIndex(i,t,e);return r>=0&&i.splice(r,1),this},hn.pickEvent=function(t){var e=rn(t,this._canvas),n=this._origin;return this.pick(this._scene,e[0],e[1],e[0]-n[0],e[1]-n[1])},hn.pick=function(t,e,n,i,r){var o=this.context();return je[t.marktype].pick.call(this,o,t,e,n,i,r)};var gn="undefined"!=typeof window&&window.devicePixelRatio||1;function pn(t){ln.call(this,t),this._redraw=!1,this._dirty=new a}var vn=e.inherits(pn,ln),yn=ln.prototype,mn=new a;function _n(t,e,n){return mn.set(0,0,e,n).translate(-t[0],-t[1])}function xn(t,e){on.call(this,t,e);var n=this;n._hrefHandler=kn(n,(function(t,e){e&&e.href&&n.handleHref(t,e,e.href)})),n._tooltipHandler=kn(n,(function(t,e){n.handleTooltip(t,e,"mouseout"!==t.type)}))}vn.initialize=function(t,e,i,r,o,s){return this._options=s,this._canvas=n.canvas(1,1,s&&s.type),t&&(en(t,0).appendChild(this._canvas),this._canvas.setAttribute("class","marks")),yn.initialize.call(this,t,e,i,r,o)},vn.resize=function(t,e,n,i){return yn.resize.call(this,t,e,n,i),function(t,e,n,i,r,o){const s="undefined"!=typeof HTMLElement&&t instanceof HTMLElement&&null!=t.parentNode,a=t.getContext("2d"),l=s?gn:r;t.width=e*l,t.height=n*l;for(const t in o)a[t]=o[t];s&&1!==l&&(t.style.width=e+"px",t.style.height=n+"px"),a.pixelRatio=l,a.setTransform(l,0,0,l,l*i[0],l*i[1])}(this._canvas,this._width,this._height,this._origin,this._scale,this._options&&this._options.context),this._redraw=!0,this},vn.canvas=function(){return this._canvas},vn.context=function(){return this._canvas?this._canvas.getContext("2d"):null},vn.dirty=function(t){var e=function(t,e){if(null==e)return t;for(var n=mn.clear().union(t);null!=e;e=e.mark.group)n.translate(e.x||0,e.y||0);return n}(t.bounds,t.mark.group);this._dirty.union(e)},vn._render=function(t){var e=this.context(),n=this._origin,i=this._width,r=this._height,o=this._dirty;return e.save(),this._redraw||o.empty()?(this._redraw=!1,o=_n(n,i,r).expand(1)):o=function(t,e,n){return e.expand(1).round(),t.pixelRatio%1&&e.scale(t.pixelRatio).round().scale(1/t.pixelRatio),e.translate(-n[0]%1,-n[1]%1),t.beginPath(),t.rect(e.x1,e.y1,e.width(),e.height()),t.clip(),e}(e,o.intersect(_n(n,i,r)),n),this.clear(-n[0],-n[1],i,r),this.draw(e,t,o),e.restore(),this._dirty.clear(),this},vn.draw=function(t,n,i){var r=je[n.marktype];n.clip&&function(t,n){var i=n.clip;t.save(),e.isFunction(i)?(t.beginPath(),i(t),t.clip()):te(t,n.group)}(t,n),r.draw.call(this,t,n,i),n.clip&&t.restore()},vn.clear=function(t,e,n,i){var r=this.context();r.clearRect(t,e,n,i),null!=this._bgcolor&&(r.fillStyle=this._bgcolor,r.fillRect(t,e,n,i))};var bn=e.inherits(xn,on);function kn(t,e){return function(n){var i=n.target.__data__;n.vegaType=n.type,i=Array.isArray(i)?i[0]:i,e.call(t._obj,n,i)}}bn.initialize=function(t,e,n){var i=this._svg;return i&&(i.removeEventListener("click",this._hrefHandler),i.removeEventListener("mousemove",this._tooltipHandler),i.removeEventListener("mouseout",this._tooltipHandler)),this._svg=i=t&&Ke(t,"svg"),i&&(i.addEventListener("click",this._hrefHandler),i.addEventListener("mousemove",this._tooltipHandler),i.addEventListener("mouseout",this._tooltipHandler)),on.prototype.initialize.call(this,t,e,n)},bn.canvas=function(){return this._svg},bn.on=function(t,e){var n=this.eventName(t),i=this._handlers;if(this._handlerIndex(i[n],t,e)<0){var r={type:t,handler:e,listener:kn(this,e)};(i[n]||(i[n]=[])).push(r),this._svg&&this._svg.addEventListener(n,r.listener)}return this},bn.off=function(t,e){var n=this.eventName(t),i=this._handlers[n],r=this._handlerIndex(i,t,e);return r>=0&&(this._svg&&this._svg.removeEventListener(n,i[r].listener),i.splice(r,1)),this};const wn=(t,e,n)=>({role:t,"aria-roledescription":e,"aria-label":n||void 0}),Tn=e.toSet(["axis-domain","axis-grid","axis-label","axis-tick","axis-title","legend-band","legend-entry","legend-gradient","legend-label","legend-title","legend-symbol","title"]),An={axis:{desc:"axis",caption:function(t){const e=t.datum,n=e.orient,i=e.title?Pn(t):null,r=t.context.scales[e.scale].value,o=r.type;return("left"===n||"right"===n?"Y":"X")+"-axis"+(i?` titled "${i}"`:"")+` for a ${s.isDiscrete(o)?"discrete":o} scale with `+s.domainCaption(r,t)}},legend:{desc:"legend",caption:function(t){const n=t.datum,i=n.title?Pn(t):null,r=((n.type||"")+" legend").trim(),o=n.scales,a=Object.keys(o),l=t.context.scales[o[a[0]]].value;return u=r,(u.length?u[0].toUpperCase()+u.slice(1):u)+(i?` titled "${i}"`:"")+` for ${function(t){return(t=t.map(t=>t+("fill"===t||"stroke"===t?" color":""))).length<2?t[0]:t.slice(0,-1).join(", ")+" and "+e.peek(t)}(a)} with ${s.domainCaption(l,t)}`;var u}},"title-text":{desc:"title",caption:t=>`Title text "${zn(t)}"`},"title-subtitle":{desc:"subtitle",caption:t=>`Subtitle text "${zn(t)}"`}},Mn={ariaRole:"role",ariaRoleDescription:"aria-roledescription",description:"aria-label"};function Cn(t,e){const n=!1===e.aria;if(t("aria-hidden",n||void 0),n||null==e.description)for(const e in Mn)t(Mn[e],void 0);else{const n=e.mark.marktype;t("aria-label",e.description),t("role",e.ariaRole||("group"===n?"graphics-object":"graphics-symbol")),t("aria-roledescription",e.ariaRoleDescription||n+" mark")}}function Rn(t){return!1===t.aria?{"aria-hidden":!0}:Tn[t.role]?null:An[t.role]?function(t,e){try{const n=t.items[0],i=e.caption||(()=>"");return wn(e.role||"graphics-symbol",e.desc,n.description||i(n))}catch(t){return null}}(t,An[t.role]):function(t){const e=t.marktype,n="group"===e||"text"===e||t.items.some(t=>null!=t.description&&!1!==t.aria);return wn(n?"graphics-object":"graphics-symbol",e+" mark container",t.description)}(t)}function zn(t){return e.array(t.text).join(" ")}function Pn(t){try{return e.array(e.peek(t.items).items[0].text).join(" ")}catch(t){return null}}function Sn(t,e,n){var i,r,o="<"+t;if(e)for(i in e)null!=(r=e[i])&&(o+=" "+i+'="'+r+'"');return n&&(o+=" "+n),o+">"}function Ln(t){return"</"+t+">"}var On={version:"1.1",xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink"},Nn={fill:"fill",fillOpacity:"fill-opacity",stroke:"stroke",strokeOpacity:"stroke-opacity",strokeWidth:"stroke-width",strokeCap:"stroke-linecap",strokeJoin:"stroke-linejoin",strokeDash:"stroke-dasharray",strokeDashOffset:"stroke-dashoffset",strokeMiterLimit:"stroke-miterlimit",opacity:"opacity",blend:"mix-blend-mode"},qn=On.xmlns;function Dn(t){ln.call(this,t),this._dirtyID=0,this._dirty=[],this._svg=null,this._root=null,this._defs=null}var En=e.inherits(Dn,ln),In=ln.prototype;function Bn(t,e,n){var i,r,o;if("radial"===e.gradient){var s=tn(t,n++,"pattern",qn);s.setAttribute("id","p_"+e.id),s.setAttribute("viewBox","0,0,1,1"),s.setAttribute("width","100%"),s.setAttribute("height","100%"),s.setAttribute("preserveAspectRatio","xMidYMid slice"),(s=tn(s,0,"rect",qn)).setAttribute("width","1"),s.setAttribute("height","1"),s.setAttribute("fill","url("+Yn()+"#"+e.id+")"),(t=tn(t,n++,"radialGradient",qn)).setAttribute("id",e.id),t.setAttribute("fx",e.x1),t.setAttribute("fy",e.y1),t.setAttribute("fr",e.r1),t.setAttribute("cx",e.x2),t.setAttribute("cy",e.y2),t.setAttribute("r",e.r2)}else(t=tn(t,n++,"linearGradient",qn)).setAttribute("id",e.id),t.setAttribute("x1",e.x1),t.setAttribute("x2",e.x2),t.setAttribute("y1",e.y1),t.setAttribute("y2",e.y2);for(i=0,r=e.stops.length;i<r;++i)(o=tn(t,i,"stop",qn)).setAttribute("offset",e.stops[i].offset),o.setAttribute("stop-color",e.stops[i].color);return en(t,i),n}function Vn(t,e,n){var i;return(t=tn(t,n,"clipPath",qn)).setAttribute("id",e.id),e.path?(i=tn(t,0,"path",qn)).setAttribute("d",e.path):((i=tn(t,0,"rect",qn)).setAttribute("x",0),i.setAttribute("y",0),i.setAttribute("width",e.width),i.setAttribute("height",e.height)),en(t,1),n+1}function Hn(t,e){for(;t&&t.dirty!==e;t=t.mark.group){if(t.dirty=e,!t.mark||t.mark.dirty===e)return;t.mark.dirty=e}}function jn(t,e,n,i,r){var o,s=t._svg;if(!s&&(s=Ze(o=e.ownerDocument,i,qn),t._svg=s,t.mark&&(s.__data__=t,s.__values__={fill:"default"},"g"===i))){var a=Ze(o,"path",qn);s.appendChild(a),a.__data__=t;var l=Ze(o,"g",qn);s.appendChild(l),l.__data__=t;var u=Ze(o,"path",qn);s.appendChild(u),u.__data__=t,u.__values__={fill:"default"}}return(s.ownerSVGElement!==r||function(t,e){return t.parentNode&&t.parentNode.childNodes.length>1&&t.previousSibling!=e}(s,n))&&e.insertBefore(s,n?n.nextSibling:e.firstChild),s}En.initialize=function(t,e,n,i){return t&&(this._svg=tn(t,0,"svg",qn),this._svg.setAttribute("class","marks"),en(t,1),this._root=tn(this._svg,0,"g",qn),en(this._svg,1)),this._defs={gradient:{},clipping:{}},this.background(this._bgcolor),In.initialize.call(this,t,e,n,i)},En.background=function(t){return arguments.length&&this._svg&&this._svg.style.setProperty("background-color",t),In.background.apply(this,arguments)},En.resize=function(t,e,n,i){return In.resize.call(this,t,e,n,i),this._svg&&(this._svg.setAttribute("width",this._width*this._scale),this._svg.setAttribute("height",this._height*this._scale),this._svg.setAttribute("viewBox","0 0 "+this._width+" "+this._height),this._root.setAttribute("transform","translate("+this._origin+")")),this._dirty=[],this},En.canvas=function(){return this._svg},En.svg=function(){if(!this._svg)return null;var t={class:"marks",width:this._width*this._scale,height:this._height*this._scale,viewBox:"0 0 "+this._width+" "+this._height};for(var e in On)t[e]=On[e];var n=this._bgcolor?Sn("rect",{width:this._width,height:this._height,style:"fill: "+this._bgcolor+";"})+Ln("rect"):"";return Sn("svg",t)+n+this._svg.innerHTML+Ln("svg")},En._render=function(t){return this._dirtyCheck()&&(this._dirtyAll&&this._resetDefs(),this.draw(this._root,t),en(this._root,1)),this.updateDefs(),this._dirty=[],++this._dirtyID,this},En.updateDefs=function(){var t,e=this._svg,n=this._defs,i=n.el,r=0;for(t in n.gradient)i||(n.el=i=tn(e,0,"defs",qn)),r=Bn(i,n.gradient[t],r);for(t in n.clipping)i||(n.el=i=tn(e,0,"defs",qn)),r=Vn(i,n.clipping[t],r);i&&(0===r?(e.removeChild(i),n.el=null):en(i,r))},En._resetDefs=function(){var t=this._defs;t.gradient={},t.clipping={}},En.dirty=function(t){t.dirty!==this._dirtyID&&(t.dirty=this._dirtyID,this._dirty.push(t))},En.isDirty=function(t){return this._dirtyAll||!t._svg||t.dirty===this._dirtyID},En._dirtyCheck=function(){this._dirtyAll=!0;var t=this._dirty;if(!t.length||!this._dirtyID)return!0;var e,n,i,r,o,s,a,l=++this._dirtyID;for(o=0,s=t.length;o<s;++o)(n=(e=t[o]).mark).marktype!==i&&(i=n.marktype,r=je[i]),n.zdirty&&n.dirty!==l&&(this._dirtyAll=!1,Hn(e,l),n.items.forEach((function(t){t.dirty=l}))),n.zdirty||(e.exit?(r.nested&&n.items.length?(a=n.items[0])._svg&&this._update(r,a._svg,a):e._svg&&(a=e._svg.parentNode)&&a.removeChild(e._svg),e._svg=null):(e=r.nested?n.items[0]:e)._update!==l&&(e._svg&&e._svg.ownerSVGElement?this._update(r,e._svg,e):(this._dirtyAll=!1,Hn(e,l)),e._update=l));return!this._dirtyAll},En.draw=function(t,e,n){if(!this.isDirty(e))return e._svg;var i,r=this,o=this._svg,s=je[e.marktype],a=!1===e.interactive?"none":null,l="g"===s.tag,u=null,c=0;(i=jn(e,t,n,"g",o)).setAttribute("class",nn(e));const h=Rn(e);for(const t in h)$n(i,t,h[t]);function f(t){var e=r.isDirty(t),n=jn(t,i,u,s.tag,o);e&&(r._update(s,n,t),l&&function(t,e,n){e=e.lastChild.previousSibling;var i,r=0;It(n,(function(n){i=t.draw(e,n,i),++r})),en(e,1+r)}(r,n,t)),u=n,++c}return l||i.style.setProperty("pointer-events",a),$n(i,"clip-path",e.clip?ne(r,e,e.group):null),s.nested?e.items.length&&f(e.items[0]):It(e,f),en(i,c),i};var Gn=null,Wn=null,Un={group:function(t,e,n){var i,r;Gn=i=e.childNodes[2],Wn=i.__values__,t.foreground(Fn,n,this),Wn=e.__values__,Gn=e.childNodes[1],t.content(Fn,n,this),Gn=r=e.childNodes[0],t.background(Fn,n,this);var o=!1===n.mark.interactive?"none":null;if(o!==Wn.events&&(i.style.setProperty("pointer-events",o),r.style.setProperty("pointer-events",o),Wn.events=o),n.strokeForeground&&n.stroke){const t=n.fill;i.style.removeProperty("display"),this.style(r,n),r.style.removeProperty("stroke"),t&&(n.fill=null),Wn=i.__values__,this.style(i,n),t&&(n.fill=t),Gn=null}else i.style.setProperty("display","none"),i.style.setProperty("fill","none")},image:function(t,e,n){!1===n.smooth?(Xn(e,"image-rendering","optimizeSpeed"),Xn(e,"image-rendering","pixelated")):Xn(e,"image-rendering",null)},text:function(t,n,i){var r,o,s,a,l=Oe(i);e.isArray(l)?(r=(o=l.map(t=>Ne(i,t))).join("\n"))!==Wn.text&&(en(n,0),s=n.ownerDocument,a=Le(i),o.forEach((t,e)=>{const r=Ze(s,"tspan",qn);r.__data__=i,r.textContent=t,e&&(r.setAttribute("x",0),r.setAttribute("dy",a)),n.appendChild(r)}),Wn.text=r):(o=Ne(i,l))!==Wn.text&&(n.textContent=o,Wn.text=o),Xn(n,"font-family",qe(i)),Xn(n,"font-size",Se(i)+"px"),Xn(n,"font-style",i.fontStyle),Xn(n,"font-variant",i.fontVariant),Xn(n,"font-weight",i.fontWeight)}};function Xn(t,e,n){n!==Wn[e]&&(null==n?t.style.removeProperty(e):t.style.setProperty(e,n+""),Wn[e]=n)}function Fn(t,e,n){e!==Wn[t]&&(n?function(t,e,n,i){null!=n?t.setAttributeNS(i,e,n):t.removeAttributeNS(i,e)}(Gn,t,e,n):$n(Gn,t,e),Wn[t]=e)}function $n(t,e,n){null!=n?t.setAttribute(e,n):t.removeAttribute(e)}function Yn(){var t;return"undefined"==typeof window?"":(t=window.location).hash?t.href.slice(0,-t.hash.length):t.href}function Jn(t){ln.call(this,t),this._text={head:"",bg:"",root:"",foot:"",defs:"",body:""},this._defs={gradient:{},clipping:{}}}En._update=function(t,e,n){Gn=e,Wn=e.__values__,t.attr(Fn,n,this),Cn(Fn,n);var i=Un[t.type];i&&i.call(this,t,e,n),Gn&&this.style(Gn,n)},En.style=function(t,e){if(null!=e)for(const n in Nn){let i=e[n];if("font"===n&&(i=qe(e)),i===Wn[n])continue;const r=Nn[n];null==i?"fill"===r?t.style.setProperty(r,"none"):t.style.removeProperty(r):(c(i)&&(i=h(i,this._defs.gradient,Yn())),t.style.setProperty(r,i+"")),Wn[n]=i}};var Qn,Zn=e.inherits(Jn,ln),Kn=ln.prototype;function ti(t,e,n,i){Qn[i||t]=e}function ei(t,e,n,i){if(null==t)return"";let r="";"bgrect"===n&&!1===e.interactive&&(r+="pointer-events: none; "),"bgfore"===n&&(!1===e.interactive&&(r+="pointer-events: none; "),r+="display: none; "),"image"===n&&!1===t.smooth&&(r+="image-rendering: optimizeSpeed; image-rendering: pixelated; "),"text"===n&&(r+="font-family: "+qe(t)+"; ",r+="font-size: "+Se(t)+"px; ",t.fontStyle&&(r+="font-style: "+t.fontStyle+"; "),t.fontVariant&&(r+="font-variant: "+t.fontVariant+"; "),t.fontWeight&&(r+="font-weight: "+t.fontWeight+"; "));for(const e in Nn){let n=t[e];const o=Nn[e];null==n?"fill"===o&&(r+="fill: none; "):"transparent"!==n||"fill"!==o&&"stroke"!==o?(c(n)&&(n=h(n,i.gradient,"")),r+=o+": "+n+"; "):r+=o+": none; "}return r?'style="'+r.trim()+'"':null}function ni(t){return t.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}Zn.resize=function(t,e,n,i){Kn.resize.call(this,t,e,n,i);var r=this._origin,o=this._text,s={class:"marks",width:this._width*this._scale,height:this._height*this._scale,viewBox:"0 0 "+this._width+" "+this._height};for(var a in On)s[a]=On[a];o.head=Sn("svg",s);var l=this._bgcolor;return"transparent"!==l&&"none"!==l||(l=null),o.bg=l?Sn("rect",{width:this._width,height:this._height,style:"fill: "+l+";"})+Ln("rect"):"",o.root=Sn("g",{transform:"translate("+r+")"}),o.foot=Ln("g")+Ln("svg"),this},Zn.background=function(){var t=Kn.background.apply(this,arguments);return arguments.length&&this._text.head&&this.resize(this._width,this._height,this._origin,this._scale),t},Zn.svg=function(){var t=this._text;return t.head+t.bg+t.defs+t.root+t.body+t.foot},Zn._render=function(t){return this._text.body=this.mark(t),this._text.defs=this.buildDefs(),this},Zn.buildDefs=function(){var t,e,n,i,r,o=this._defs,s="";for(e in o.gradient){for(r=(n=o.gradient[e]).stops,"radial"===n.gradient?(s+=Sn(i="pattern",{id:"p_"+e,viewBox:"0,0,1,1",width:"100%",height:"100%",preserveAspectRatio:"xMidYMid slice"}),s+=Sn("rect",{width:"1",height:"1",fill:"url(#"+e+")"})+Ln("rect"),s+=Ln(i),s+=Sn(i="radialGradient",{id:e,fx:n.x1,fy:n.y1,fr:n.r1,cx:n.x2,cy:n.y2,r:n.r2})):s+=Sn(i="linearGradient",{id:e,x1:n.x1,x2:n.x2,y1:n.y1,y2:n.y2}),t=0;t<r.length;++t)s+=Sn("stop",{offset:r[t].offset,"stop-color":r[t].color})+Ln("stop");s+=Ln(i)}for(e in o.clipping)n=o.clipping[e],s+=Sn("clipPath",{id:e}),n.path?s+=Sn("path",{d:n.path})+Ln("path"):s+=Sn("rect",{x:0,y:0,width:n.width,height:n.height})+Ln("rect"),s+=Ln("clipPath");return s.length>0?Sn("defs")+s+Ln("defs"):""},Zn.attributes=function(t,e){return Qn={},Array.isArray(t)?t.forEach(t=>t(ti,e,this)):t(ti,e,this),Qn},Zn.href=function(t){var e,n=this,i=t.href;if(i){if(e=n._hrefs&&n._hrefs[i])return e;n.sanitizeURL(i).then(t=>{t["xlink:href"]=t.href,t.href=null,(n._hrefs||(n._hrefs={}))[i]=t})}return null},Zn.mark=function(t){var n,i=this,r=je[t.marktype],o=r.tag,s=this._defs,a="";function l(l){var u=i.href(l);if(u&&(a+=Sn("a",u)),n="g"!==o?ei(l,t,o,s):null,a+=Sn(o,i.attributes([Cn,r.attr],l),n),"text"===o){const t=Oe(l);if(e.isArray(t)){const e={x:0,dy:Le(l)};for(let n=0;n<t.length;++n)a+=Sn("tspan",n?e:null)+ni(Ne(l,t[n]))+Ln("tspan")}else a+=ni(Ne(l,t))}else if("g"===o){const e=l.strokeForeground,n=l.fill,o=l.stroke;e&&o&&(l.stroke=null),a+=Sn("path",i.attributes(r.background,l),ei(l,t,"bgrect",s))+Ln("path"),a+=Sn("g",i.attributes(r.content,l))+i.markGroup(l)+Ln("g"),e&&o?(n&&(l.fill=null),l.stroke=o,a+=Sn("path",i.attributes(r.foreground,l),ei(l,t,"bgrect",s))+Ln("path"),n&&(l.fill=n)):a+=Sn("path",i.attributes(r.foreground,l),ei({},t,"bgfore",s))+Ln("path")}a+=Ln(o),u&&(a+=Ln("a"))}return"g"!==o&&!1===t.interactive&&(n='style="pointer-events: none;"'),a+=Sn("g",Object.assign({class:nn(t),"clip-path":t.clip?ne(i,t,t.group):null},Rn(t)),n),r.nested?t.items&&t.items.length&&l(t.items[0]):It(t,l),a+Ln("g")},Zn.markGroup=function(t){var e=this,n="";return It(t,(function(t){n+=e.mark(t)})),n};var ii={Canvas:"canvas",PNG:"png",SVG:"svg",None:"none"},ri={};function oi(t,e,n,i){if(function(t,e,n){return t.bounds&&e.intersects(t.bounds)&&("group"===t.marktype||!1!==t.interactive&&(!n||n(t)))}(t,e,n)){const r=t.items,o=t.marktype,s=r.length;let a=0;if("group"===o)for(;a<s;++a)si(r[a],e,n,i);else for(const t=je[o].isect;a<s;++a){let n=r[a];ai(n,e,t)&&i.push(n)}}return i}function si(t,e,n,i){n&&n(t.mark)&&ai(t,e,je.group.isect)&&i.push(t);const r=t.items,o=r&&r.length;if(o){const s=t.x||0,a=t.y||0;e.translate(-s,-a);for(let t=0;t<o;++t)oi(r[t],e,n,i);e.translate(s,a)}return i}function ai(t,e,n){const i=t.bounds;return e.encloses(i)||e.intersects(i)&&n(t,e)}ri.canvas=ri.png={renderer:pn,headless:pn,handler:cn},ri.svg={renderer:Dn,headless:Jn,handler:xn},ri.none={};var li=new a;function ui(t,n,i){return t===n||("path"===i?ci(t,n):t instanceof Date&&n instanceof Date?+t==+n:e.isNumber(t)&&e.isNumber(n)?Math.abs(t-n)<=1e-9:t&&n&&(e.isObject(t)||e.isObject(n))?null!=t&&null!=n&&function(t,e){var n,i,r=Object.keys(t),o=Object.keys(e);if(r.length!==o.length)return!1;for(r.sort(),o.sort(),i=r.length-1;i>=0;i--)if(r[i]!=o[i])return!1;for(i=r.length-1;i>=0;i--)if(n=r[i],!ui(t[n],e[n],n))return!1;return typeof t==typeof e}(t,n):t==n)}function ci(t,e){return ui(w(t),w(e))}t.Bounds=a,t.CanvasHandler=cn,t.CanvasRenderer=pn,t.Gradient=function(t,e){var n,i=[];return n={gradient:"linear",x1:t?t[0]:0,y1:t?t[1]:0,x2:e?e[0]:1,y2:e?e[1]:0,stops:i,stop:function(t,e){return i.push({offset:t,color:e}),n}}},t.GroupItem=g,t.Handler=on,t.Item=d,t.Marks=je,t.RenderType=ii,t.Renderer=ln,t.ResourceLoader=p,t.SVGHandler=xn,t.SVGRenderer=Dn,t.SVGStringRenderer=Jn,t.Scenegraph=Ye,t.boundClip=function(t){var n=t.clip;if(e.isFunction(n))n(dt(li.clear()));else{if(!n)return;li.set(0,0,t.group.width,t.group.height)}t.bounds.intersect(li)},t.boundContext=dt,t.boundItem=Ge,t.boundMark=Ue,t.boundStroke=lt,t.closeTag=Ln,t.domChild=tn,t.domClear=en,t.domCreate=Ze,t.domFind=Ke,t.font=De,t.fontFamily=qe,t.fontSize=Se,t.intersect=function(t,n,i){const r=[],o=(new a).union(n),s=t.marktype;return s?oi(t,o,i,r):"group"===s?si(t,o,i,r):e.error("Intersect scene must be mark node or group item.")},t.intersectBoxLine=Rt,t.intersectPath=Tt,t.intersectPoint=At,t.intersectRule=Ct,t.lineHeight=Le,t.multiLineOffset=function(t){const n=Oe(t);return(e.isArray(n)?n.length-1:0)*Le(t)},t.openTag=Sn,t.pathCurves=x,t.pathEqual=ci,t.pathParse=w,t.pathRectangle=F,t.pathRender=N,t.pathSymbols=I,t.pathTrail=$,t.point=rn,t.renderModule=function(t,e){return t=String(t||"").toLowerCase(),arguments.length>1?(ri[t]=e,this):ri[t]},t.resetSVGClipId=function(){ee=1},t.sceneEqual=ui,t.sceneFromJSON=$e,t.scenePickVisit=Bt,t.sceneToJSON=Fe,t.sceneVisit=It,t.sceneZOrder=Et,t.textMetrics=Ae,Object.defineProperty(t,"__esModule",{value:!0})}));
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("vega-util"),require("vega-canvas"),require("vega-loader"),require("d3-shape"),require("d3-path"),require("vega-scale")):"function"==typeof define&&define.amd?define(["exports","vega-util","vega-canvas","vega-loader","d3-shape","d3-path","vega-scale"],e):e((t=t||self).vega={},t.vega,t.vega,t.vega,t.d3,t.d3,t.vega)}(this,(function(t,e,n,i,r,o,s){"use strict";function a(t){this.clear(),t&&this.union(t)}var l=a.prototype;l.clone=function(){return new a(this)},l.clear=function(){return this.x1=+Number.MAX_VALUE,this.y1=+Number.MAX_VALUE,this.x2=-Number.MAX_VALUE,this.y2=-Number.MAX_VALUE,this},l.empty=function(){return this.x1===+Number.MAX_VALUE&&this.y1===+Number.MAX_VALUE&&this.x2===-Number.MAX_VALUE&&this.y2===-Number.MAX_VALUE},l.equals=function(t){return this.x1===t.x1&&this.y1===t.y1&&this.x2===t.x2&&this.y2===t.y2},l.set=function(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},l.add=function(t,e){return t<this.x1&&(this.x1=t),e<this.y1&&(this.y1=e),t>this.x2&&(this.x2=t),e>this.y2&&(this.y2=e),this},l.expand=function(t){return this.x1-=t,this.y1-=t,this.x2+=t,this.y2+=t,this},l.round=function(){return this.x1=Math.floor(this.x1),this.y1=Math.floor(this.y1),this.x2=Math.ceil(this.x2),this.y2=Math.ceil(this.y2),this},l.scale=function(t){return this.x1*=t,this.y1*=t,this.x2*=t,this.y2*=t,this},l.translate=function(t,e){return this.x1+=t,this.x2+=t,this.y1+=e,this.y2+=e,this},l.rotate=function(t,e,n){const i=this.rotatedPoints(t,e,n);return this.clear().add(i[0],i[1]).add(i[2],i[3]).add(i[4],i[5]).add(i[6],i[7])},l.rotatedPoints=function(t,e,n){var{x1:i,y1:r,x2:o,y2:s}=this,a=Math.cos(t),l=Math.sin(t),u=e-e*a+n*l,c=n-e*l-n*a;return[a*i-l*r+u,l*i+a*r+c,a*i-l*s+u,l*i+a*s+c,a*o-l*r+u,l*o+a*r+c,a*o-l*s+u,l*o+a*s+c]},l.union=function(t){return t.x1<this.x1&&(this.x1=t.x1),t.y1<this.y1&&(this.y1=t.y1),t.x2>this.x2&&(this.x2=t.x2),t.y2>this.y2&&(this.y2=t.y2),this},l.intersect=function(t){return t.x1>this.x1&&(this.x1=t.x1),t.y1>this.y1&&(this.y1=t.y1),t.x2<this.x2&&(this.x2=t.x2),t.y2<this.y2&&(this.y2=t.y2),this},l.encloses=function(t){return t&&this.x1<=t.x1&&this.x2>=t.x2&&this.y1<=t.y1&&this.y2>=t.y2},l.alignsWith=function(t){return t&&(this.x1==t.x1||this.x2==t.x2||this.y1==t.y1||this.y2==t.y2)},l.intersects=function(t){return t&&!(this.x2<t.x1||this.x1>t.x2||this.y2<t.y1||this.y1>t.y2)},l.contains=function(t,e){return!(t<this.x1||t>this.x2||e<this.y1||e>this.y2)},l.width=function(){return this.x2-this.x1},l.height=function(){return this.y2-this.y1};var u=0;function c(t){return t&&t.gradient}function h(t,e,n){let i=t.id,r=t.gradient,o="radial"===r?"p_":"";return i||(i=t.id="gradient_"+u++,"radial"===r?(t.x1=f(t.x1,.5),t.y1=f(t.y1,.5),t.r1=f(t.r1,0),t.x2=f(t.x2,.5),t.y2=f(t.y2,.5),t.r2=f(t.r2,.5),o="p_"):(t.x1=f(t.x1,0),t.y1=f(t.y1,0),t.x2=f(t.x2,1),t.y2=f(t.y2,0))),e[i]=t,"url("+(n||"")+"#"+o+i+")"}function f(t,e){return null!=t?t:e}function d(t){this.mark=t,this.bounds=this.bounds||new a}function g(t){d.call(this,t),this.items=this.items||[]}function p(t){this._pending=0,this._loader=t||i.loader()}e.inherits(g,d);var v=p.prototype;function y(t){t._pending+=1}function m(t){t._pending-=1}v.pending=function(){return this._pending},v.sanitizeURL=function(t){var e=this;return y(e),e._loader.sanitize(t,{context:"href"}).then((function(t){return m(e),t})).catch((function(){return m(e),null}))},v.loadImage=function(t){const i=this,r=n.image();return y(i),i._loader.sanitize(t,{context:"image"}).then((function(t){const n=t.href;if(!n||!r)throw{url:n};const o=new r,s=e.hasOwnProperty(t,"crossOrigin")?t.crossOrigin:"anonymous";return null!=s&&(o.crossOrigin=s),o.onload=()=>m(i),o.onerror=()=>m(i),o.src=n,o})).catch((function(t){return m(i),{complete:!1,width:0,height:0,src:t&&t.url||""}}))},v.ready=function(){var t=this;return new Promise((function(e){!function n(i){t.pending()?setTimeout((function(){n(!0)}),10):e(i)}(!1)}))};var _={basis:{curve:r.curveBasis},"basis-closed":{curve:r.curveBasisClosed},"basis-open":{curve:r.curveBasisOpen},bundle:{curve:r.curveBundle,tension:"beta",value:.85},cardinal:{curve:r.curveCardinal,tension:"tension",value:0},"cardinal-open":{curve:r.curveCardinalOpen,tension:"tension",value:0},"cardinal-closed":{curve:r.curveCardinalClosed,tension:"tension",value:0},"catmull-rom":{curve:r.curveCatmullRom,tension:"alpha",value:.5},"catmull-rom-closed":{curve:r.curveCatmullRomClosed,tension:"alpha",value:.5},"catmull-rom-open":{curve:r.curveCatmullRomOpen,tension:"alpha",value:.5},linear:{curve:r.curveLinear},"linear-closed":{curve:r.curveLinearClosed},monotone:{horizontal:r.curveMonotoneY,vertical:r.curveMonotoneX},natural:{curve:r.curveNatural},step:{curve:r.curveStep},"step-after":{curve:r.curveStepAfter},"step-before":{curve:r.curveStepBefore}};function x(t,n,i){var r=e.hasOwnProperty(_,t)&&_[t],o=null;return r&&(o=r.curve||r[n||"vertical"],r.tension&&null!=i&&(o=o[r.tension](i))),o}var b={m:2,l:2,h:1,v:1,c:6,s:4,q:4,t:2,a:7},k=[/([MLHVCSQTAZmlhvcsqtaz])/g,/###/,/(\d)([-+])/g,/\s|,|###/];function w(t){var e,n,i,r,o,s,a,l,u,c,h,f=[];for(l=0,c=(e=t.slice().replace(k[0],"###$1").split(k[1]).slice(1)).length;l<c;++l){for(i=(n=e[l]).slice(1).trim().replace(k[2],"$1###$2").split(k[3]),r=[s=n.charAt(0)],u=0,h=i.length;u<h;++u)(o=+i[u])===o&&r.push(o);if(a=b[s.toLowerCase()],r.length-1>a)for(u=1,h=r.length;u<h;u+=a)f.push([s].concat(r.slice(u,u+a)));else f.push(r)}return f}const T=Math.PI/180,A=Math.PI/2,M=2*Math.PI,C=Math.sqrt(3)/2;var R={},z={},P=[].join;function S(t){var e=P.call(t);if(z[e])return z[e];var n=t[0],i=t[1],r=t[2],o=t[3],s=t[4],a=t[5],l=t[6],u=t[7],c=u*s,h=-l*a,f=l*s,d=u*a,g=Math.cos(r),p=Math.sin(r),v=Math.cos(o),y=Math.sin(o),m=.5*(o-r),_=Math.sin(.5*m),x=8/3*_*_/Math.sin(m),b=n+g-x*p,k=i+p+x*g,w=n+v,T=i+y,A=w+x*y,M=T-x*v;return z[e]=[c*b+h*k,f*b+d*k,c*A+h*M,f*A+d*M,c*w+h*T,f*w+d*T]}var L=["l",0,0,0,0,0,0,0];function O(t,e,n){var i=L[0]=t[0];if("a"===i||"A"===i)L[1]=e*t[1],L[2]=n*t[2],L[3]=t[3],L[4]=t[4],L[5]=t[5],L[6]=e*t[6],L[7]=n*t[7];else if("h"===i||"H"===i)L[1]=e*t[1];else if("v"===i||"V"===i)L[1]=n*t[1];else for(var r=1,o=t.length;r<o;++r)L[r]=(r%2==1?e:n)*t[r];return L}function N(t,e,n,i,r,o){var s,a,l,u,c,h=null,f=0,d=0,g=0,p=0;null==n&&(n=0),null==i&&(i=0),null==r&&(r=1),null==o&&(o=r),t.beginPath&&t.beginPath();for(var v=0,y=e.length;v<y;++v){switch(s=e[v],1===r&&1===o||(s=O(s,r,o)),s[0]){case"l":f+=s[1],d+=s[2],t.lineTo(f+n,d+i);break;case"L":f=s[1],d=s[2],t.lineTo(f+n,d+i);break;case"h":f+=s[1],t.lineTo(f+n,d+i);break;case"H":f=s[1],t.lineTo(f+n,d+i);break;case"v":d+=s[1],t.lineTo(f+n,d+i);break;case"V":d=s[1],t.lineTo(f+n,d+i);break;case"m":f+=s[1],d+=s[2],t.moveTo(f+n,d+i);break;case"M":f=s[1],d=s[2],t.moveTo(f+n,d+i);break;case"c":a=f+s[5],l=d+s[6],g=f+s[3],p=d+s[4],t.bezierCurveTo(f+s[1]+n,d+s[2]+i,g+n,p+i,a+n,l+i),f=a,d=l;break;case"C":f=s[5],d=s[6],g=s[3],p=s[4],t.bezierCurveTo(s[1]+n,s[2]+i,g+n,p+i,f+n,d+i);break;case"s":a=f+s[3],l=d+s[4],g=2*f-g,p=2*d-p,t.bezierCurveTo(g+n,p+i,f+s[1]+n,d+s[2]+i,a+n,l+i),g=f+s[1],p=d+s[2],f=a,d=l;break;case"S":a=s[3],l=s[4],g=2*f-g,p=2*d-p,t.bezierCurveTo(g+n,p+i,s[1]+n,s[2]+i,a+n,l+i),f=a,d=l,g=s[1],p=s[2];break;case"q":a=f+s[3],l=d+s[4],g=f+s[1],p=d+s[2],t.quadraticCurveTo(g+n,p+i,a+n,l+i),f=a,d=l;break;case"Q":a=s[3],l=s[4],t.quadraticCurveTo(s[1]+n,s[2]+i,a+n,l+i),f=a,d=l,g=s[1],p=s[2];break;case"t":a=f+s[1],l=d+s[2],null===h[0].match(/[QqTt]/)?(g=f,p=d):"t"===h[0]?(g=2*f-u,p=2*d-c):"q"===h[0]&&(g=2*f-g,p=2*d-p),u=g,c=p,t.quadraticCurveTo(g+n,p+i,a+n,l+i),d=l,g=(f=a)+s[1],p=d+s[2];break;case"T":a=s[1],l=s[2],g=2*f-g,p=2*d-p,t.quadraticCurveTo(g+n,p+i,a+n,l+i),f=a,d=l;break;case"a":q(t,f+n,d+i,[s[1],s[2],s[3],s[4],s[5],s[6]+f+n,s[7]+d+i]),f+=s[6],d+=s[7];break;case"A":q(t,f+n,d+i,[s[1],s[2],s[3],s[4],s[5],s[6]+n,s[7]+i]),f=s[6],d=s[7];break;case"z":case"Z":t.closePath()}h=s}}function q(t,e,n,i){for(var r=function(t,e,n,i,r,o,s,a,l){var u=P.call(arguments);if(R[u])return R[u];var c=s*T,h=Math.sin(c),f=Math.cos(c),d=f*(a-t)*.5+h*(l-e)*.5,g=f*(l-e)*.5-h*(a-t)*.5,p=d*d/((n=Math.abs(n))*n)+g*g/((i=Math.abs(i))*i);p>1&&(n*=p=Math.sqrt(p),i*=p);var v=f/n,y=h/n,m=-h/i,_=f/i,x=v*a+y*l,b=m*a+_*l,k=v*t+y*e,w=m*t+_*e,C=(k-x)*(k-x)+(w-b)*(w-b),z=1/C-.25;z<0&&(z=0);var S=Math.sqrt(z);o==r&&(S=-S);var L=.5*(x+k)-S*(w-b),O=.5*(b+w)+S*(k-x),N=Math.atan2(b-O,x-L),q=Math.atan2(w-O,k-L),D=q-N;D<0&&1===o?D+=M:D>0&&0===o&&(D-=M);for(var E=Math.ceil(Math.abs(D/(A+.001))),I=[],B=0;B<E;++B){var V=N+B*D/E,H=N+(B+1)*D/E;I[B]=[L,O,V,H,n,i,h,f]}return R[u]=I}(i[5],i[6],i[0],i[1],i[3],i[4],i[2],e,n),o=0;o<r.length;++o){var s=S(r[o]);t.bezierCurveTo(s[0],s[1],s[2],s[3],s[4],s[5])}}var D=.5773502691896257,E={circle:{draw:function(t,e){var n=Math.sqrt(e)/2;t.moveTo(n,0),t.arc(0,0,n,0,M)}},cross:{draw:function(t,e){var n=Math.sqrt(e)/2,i=n/2.5;t.moveTo(-n,-i),t.lineTo(-n,i),t.lineTo(-i,i),t.lineTo(-i,n),t.lineTo(i,n),t.lineTo(i,i),t.lineTo(n,i),t.lineTo(n,-i),t.lineTo(i,-i),t.lineTo(i,-n),t.lineTo(-i,-n),t.lineTo(-i,-i),t.closePath()}},diamond:{draw:function(t,e){var n=Math.sqrt(e)/2;t.moveTo(-n,0),t.lineTo(0,-n),t.lineTo(n,0),t.lineTo(0,n),t.closePath()}},square:{draw:function(t,e){var n=Math.sqrt(e),i=-n/2;t.rect(i,i,n,n)}},arrow:{draw:function(t,e){var n=Math.sqrt(e)/2,i=n/7,r=n/2.5,o=n/8;t.moveTo(-i,n),t.lineTo(i,n),t.lineTo(i,-o),t.lineTo(r,-o),t.lineTo(0,-n),t.lineTo(-r,-o),t.lineTo(-i,-o),t.closePath()}},wedge:{draw:function(t,e){var n=Math.sqrt(e)/2,i=C*n,r=i-n*D,o=n/4;t.moveTo(0,-i-r),t.lineTo(-o,i-r),t.lineTo(o,i-r),t.closePath()}},triangle:{draw:function(t,e){var n=Math.sqrt(e)/2,i=C*n,r=i-n*D;t.moveTo(0,-i-r),t.lineTo(-n,i-r),t.lineTo(n,i-r),t.closePath()}},"triangle-up":{draw:function(t,e){var n=Math.sqrt(e)/2,i=C*n;t.moveTo(0,-i),t.lineTo(-n,i),t.lineTo(n,i),t.closePath()}},"triangle-down":{draw:function(t,e){var n=Math.sqrt(e)/2,i=C*n;t.moveTo(0,i),t.lineTo(-n,-i),t.lineTo(n,-i),t.closePath()}},"triangle-right":{draw:function(t,e){var n=Math.sqrt(e)/2,i=C*n;t.moveTo(i,0),t.lineTo(-i,-n),t.lineTo(-i,n),t.closePath()}},"triangle-left":{draw:function(t,e){var n=Math.sqrt(e)/2,i=C*n;t.moveTo(-i,0),t.lineTo(i,-n),t.lineTo(i,n),t.closePath()}},stroke:{draw:function(t,e){var n=Math.sqrt(e)/2;t.moveTo(-n,0),t.lineTo(n,0)}}};function I(t){return e.hasOwnProperty(E,t)?E[t]:function(t){if(!e.hasOwnProperty(B,t)){var n=w(t);B[t]={draw:function(t,e){N(t,n,0,0,Math.sqrt(e)/2)}}}return B[t]}(t)}var B={};const V=.448084975506;function H(t){return t.x}function j(t){return t.y}function G(t){return t.width}function W(t){return t.height}function U(t){return"function"==typeof t?t:()=>+t}function X(t,e,n){return Math.max(e,Math.min(t,n))}function F(){var t=H,e=j,n=G,i=W,r=U(0),s=r,a=r,l=r,u=null;function c(c,h,f){var d,g=null!=h?h:+t.call(this,c),p=null!=f?f:+e.call(this,c),v=+n.call(this,c),y=+i.call(this,c),m=Math.min(v,y)/2,_=X(+r.call(this,c),0,m),x=X(+s.call(this,c),0,m),b=X(+a.call(this,c),0,m),k=X(+l.call(this,c),0,m);if(u||(u=d=o.path()),_<=0&&x<=0&&b<=0&&k<=0)u.rect(g,p,v,y);else{var w=g+v,T=p+y;u.moveTo(g+_,p),u.lineTo(w-x,p),u.bezierCurveTo(w-V*x,p,w,p+V*x,w,p+x),u.lineTo(w,T-k),u.bezierCurveTo(w,T-V*k,w-V*k,T,w-k,T),u.lineTo(g+b,T),u.bezierCurveTo(g+V*b,T,g,T-V*b,g,T-b),u.lineTo(g,p+_),u.bezierCurveTo(g,p+V*_,g+V*_,p,g+_,p),u.closePath()}if(d)return u=null,d+""||null}return c.x=function(e){return arguments.length?(t=U(e),c):t},c.y=function(t){return arguments.length?(e=U(t),c):e},c.width=function(t){return arguments.length?(n=U(t),c):n},c.height=function(t){return arguments.length?(i=U(t),c):i},c.cornerRadius=function(t,e,n,i){return arguments.length?(r=U(t),s=null!=e?U(e):r,l=null!=n?U(n):r,a=null!=i?U(i):s,c):r},c.context=function(t){return arguments.length?(u=null==t?null:t,c):u},c}function $(){var t,e,n,i,r,s,a,l,u=null;function c(t,e,n){var i=n/2;if(r){var o=a-e,c=t-s;if(o||c){var h=Math.sqrt(o*o+c*c),f=(o/=h)*l,d=(c/=h)*l,g=Math.atan2(c,o);u.moveTo(s-f,a-d),u.lineTo(t-o*i,e-c*i),u.arc(t,e,i,g-Math.PI,g),u.lineTo(s+f,a+d),u.arc(s,a,l,g,g+Math.PI)}else u.arc(t,e,i,0,M);u.closePath()}else r=1;s=t,a=e,l=i}function h(s){var a,l,h,f=s.length,d=!1;for(null==u&&(u=h=o.path()),a=0;a<=f;++a)!(a<f&&i(l=s[a],a,s))===d&&(d=!d)&&(r=0),d&&c(+t(l,a,s),+e(l,a,s),+n(l,a,s));if(h)return u=null,h+""||null}return h.x=function(e){return arguments.length?(t=e,h):t},h.y=function(t){return arguments.length?(e=t,h):e},h.size=function(t){return arguments.length?(n=t,h):n},h.defined=function(t){return arguments.length?(i=t,h):i},h.context=function(t){return arguments.length?(u=null==t?null:t,h):u},h}function Y(t,e){return null!=t?t:e}const J=t=>t.x||0,Q=t=>t.y||0,Z=t=>!(!1===t.defined),K=r.arc().startAngle(t=>t.startAngle||0).endAngle(t=>t.endAngle||0).padAngle(t=>t.padAngle||0).innerRadius(t=>t.innerRadius||0).outerRadius(t=>t.outerRadius||0).cornerRadius(t=>t.cornerRadius||0),tt=r.area().x(J).y1(Q).y0(t=>(t.y||0)+(t.height||0)).defined(Z),et=r.area().y(Q).x1(J).x0(t=>(t.x||0)+(t.width||0)).defined(Z),nt=r.line().x(J).y(Q).defined(Z),it=F().x(J).y(Q).width(t=>t.width||0).height(t=>t.height||0).cornerRadius(t=>Y(t.cornerRadiusTopLeft,t.cornerRadius)||0,t=>Y(t.cornerRadiusTopRight,t.cornerRadius)||0,t=>Y(t.cornerRadiusBottomRight,t.cornerRadius)||0,t=>Y(t.cornerRadiusBottomLeft,t.cornerRadius)||0),rt=r.symbol().type(t=>I(t.shape||"circle")).size(t=>Y(t.size,64)),ot=$().x(J).y(Q).defined(Z).size(t=>t.size||1);function st(t){return t.cornerRadius||t.cornerRadiusTopLeft||t.cornerRadiusTopRight||t.cornerRadiusBottomRight||t.cornerRadiusBottomLeft}function at(t,e,n,i){return it.context(t)(e,n,i)}function lt(t,e,n){if(e.stroke&&0!==e.opacity&&0!==e.strokeOpacity){const i=null!=e.strokeWidth?+e.strokeWidth:1;t.expand(i+(n?function(t,e){return t.strokeJoin&&"miter"!==t.strokeJoin?0:e}(e,i):0))}return t}var ut,ct,ht,ft=M-1e-8;function dt(t){return ut=t,dt}function gt(){}function pt(t,e){ut.add(t,e)}function vt(t,e){pt(ct=t,ht=e)}function yt(t){pt(t,ut.y1)}function mt(t){pt(ut.x1,t)}function _t(t,e,n,i){const r=(t-e)/(t+n-2*e);0<r&&r<1&&i(t+(e-t)*r)}function xt(t,e,n,i,r){const o=i-t+3*e-3*n,s=t+n-2*e,a=t-e;let l,u=0,c=0;Math.abs(o)>1e-14?(l=s*s+a*o,l>=0&&(l=Math.sqrt(l),u=(-s+l)/o,c=(-s-l)/o)):u=.5*a/s,0<u&&u<1&&r(bt(u,t,e,n,i)),0<c&&c<1&&r(bt(c,t,e,n,i))}function bt(t,e,n,i,r){const o=1-t,s=o*o,a=t*t;return s*o*e+3*s*t*n+3*o*a*i+a*t*r}dt.beginPath=gt,dt.closePath=gt,dt.moveTo=vt,dt.lineTo=vt,dt.rect=function(t,e,n,i){pt(t+n,e+i),vt(t,e)},dt.quadraticCurveTo=function(t,e,n,i){_t(ct,t,n,yt),_t(ht,e,i,mt),vt(n,i)},dt.bezierCurveTo=function(t,e,n,i,r,o){xt(ct,t,n,r,yt),xt(ht,e,i,o,mt),vt(r,o)},dt.arc=function(t,e,n,i,r,o){if(ct=n*Math.cos(r)+t,ht=n*Math.sin(r)+e,Math.abs(r-i)>ft)pt(t-n,e-n),pt(t+n,e+n);else{const s=i=>pt(n*Math.cos(i)+t,n*Math.sin(i)+e);let a,l;if(s(i),s(r),r!==i)if((i%=M)<0&&(i+=M),(r%=M)<0&&(r+=M),r<i&&(o=!o,a=i,i=r,r=a),o)for(r-=M,a=i-i%A,l=0;l<4&&a>r;++l,a-=A)s(a);else for(a=i-i%A+A,l=0;l<4&&a<r;++l,a+=A)s(a)}};var kt=(kt=n.canvas(1,1))?kt.getContext("2d"):null;const wt=new a;function Tt(t){return function(e,n){if(!kt)return!0;t(kt,e),wt.clear().union(e.bounds).intersect(n).round();const{x1:i,y1:r,x2:o,y2:s}=wt;for(let t=r;t<=s;++t)for(let e=i;e<=o;++e)if(kt.isPointInPath(e,t))return!0;return!1}}function At(t,e){return e.contains(t.x||0,t.y||0)}function Mt(t,e){const n=t.x||0,i=t.y||0,r=t.width||0,o=t.height||0;return e.intersects(wt.set(n,i,n+r,i+o))}function Ct(t,e){const n=t.x||0,i=t.y||0;return Rt(e,n,i,null!=t.x2?t.x2:n,null!=t.y2?t.y2:i)}function Rt(t,e,n,i,r){const{x1:o,y1:s,x2:a,y2:l}=t,u=i-e,c=r-n;let h,f,d,g,p=0,v=1;for(g=0;g<4;++g){if(0===g&&(h=-u,f=-(o-e)),1===g&&(h=u,f=a-e),2===g&&(h=-c,f=-(s-n)),3===g&&(h=c,f=l-n),Math.abs(h)<1e-10&&f<0)return!1;if(d=f/h,h<0){if(d>v)return!1;d>p&&(p=d)}else if(h>0){if(d<p)return!1;d<v&&(v=d)}}return!0}function zt(t,e){t.globalCompositeOperation=e.blend||"source-over"}function Pt(t,e){return null==t?e:t}function St(t,e){const n=e.length;for(let i=0;i<n;++i)t.addColorStop(e[i].offset,e[i].color);return t}function Lt(t,e,i){return c(i)?function(t,e,i){const r=i.width(),o=i.height();let s;if("radial"===e.gradient)s=t.createRadialGradient(i.x1+Pt(e.x1,.5)*r,i.y1+Pt(e.y1,.5)*o,Math.max(r,o)*Pt(e.r1,0),i.x1+Pt(e.x2,.5)*r,i.y1+Pt(e.y2,.5)*o,Math.max(r,o)*Pt(e.r2,.5));else{const a=Pt(e.x1,0),l=Pt(e.y1,0),u=Pt(e.x2,1),c=Pt(e.y2,0);if(a!==u&&l!==c&&r!==o){const i=n.canvas(Math.ceil(r),Math.ceil(o)),s=i.getContext("2d");return s.scale(r,o),s.fillStyle=St(s.createLinearGradient(a,l,u,c),e.stops),s.fillRect(0,0,r,o),t.createPattern(i,"no-repeat")}s=t.createLinearGradient(i.x1+a*r,i.y1+l*o,i.x1+u*r,i.y1+c*o)}return St(s,e.stops)}(t,i,e.bounds):i}function Ot(t,e,n){return(n*=null==e.fillOpacity?1:e.fillOpacity)>0&&(t.globalAlpha=n,t.fillStyle=Lt(t,e,e.fill),!0)}var Nt=[];function qt(t,e,n){var i=null!=(i=e.strokeWidth)?i:1;return!(i<=0)&&((n*=null==e.strokeOpacity?1:e.strokeOpacity)>0&&(t.globalAlpha=n,t.strokeStyle=Lt(t,e,e.stroke),t.lineWidth=i,t.lineCap=e.strokeCap||"butt",t.lineJoin=e.strokeJoin||"miter",t.miterLimit=e.strokeMiterLimit||10,t.setLineDash&&(t.setLineDash(e.strokeDash||Nt),t.lineDashOffset=e.strokeDashOffset||0),!0))}function Dt(t,e){return t.zindex-e.zindex||t.index-e.index}function Et(t){if(!t.zdirty)return t.zitems;var e,n,i,r=t.items,o=[];for(n=0,i=r.length;n<i;++n)(e=r[n]).index=n,e.zindex&&o.push(e);return t.zdirty=!1,t.zitems=o.sort(Dt)}function It(t,e){var n,i,r=t.items;if(r&&r.length){var o=Et(t);if(o&&o.length){for(n=0,i=r.length;n<i;++n)r[n].zindex||e(r[n]);r=o}for(n=0,i=r.length;n<i;++n)e(r[n])}}function Bt(t,e){var n,i,r=t.items;if(!r||!r.length)return null;var o=Et(t);for(o&&o.length&&(r=o),i=r.length;--i>=0;)if(n=e(r[i]))return n;if(r===o)for(i=(r=t.items).length;--i>=0;)if(!r[i].zindex&&(n=e(r[i])))return n;return null}function Vt(t){return function(e,n,i){It(n,(function(n){i&&!i.intersects(n.bounds)||jt(t,e,n,n)}))}}function Ht(t){return function(e,n,i){!n.items.length||i&&!i.intersects(n.bounds)||jt(t,e,n.items[0],n.items)}}function jt(t,e,n,i){var r=null==n.opacity?1:n.opacity;0!==r&&(t(e,i)||(zt(e,n),n.fill&&Ot(e,n,r)&&e.fill(),n.stroke&&qt(e,n,r)&&e.stroke()))}function Gt(t){return t=t||e.truthy,function(e,n,i,r,o,s){return i*=e.pixelRatio,r*=e.pixelRatio,Bt(n,(function(n){var a=n.bounds;if((!a||a.contains(o,s))&&a)return t(e,n,i,r,o,s)?n:void 0}))}}function Wt(t,e){return function(n,i,r,o){var s,a,l=Array.isArray(i)?i[0]:i,u=null==e?l.fill:e,c=l.stroke&&n.isPointInStroke;return c&&(s=l.strokeWidth,a=l.strokeCap,n.lineWidth=null!=s?s:1,n.lineCap=null!=a?a:"butt"),!t(n,i)&&(u&&n.isPointInPath(r,o)||c&&n.isPointInStroke(r,o))}}function Ut(t){return Gt(Wt(t))}function Xt(t,e){return"translate("+t+","+e+")"}function Ft(t){return"rotate("+t+")"}function $t(t){return Xt(t.x||0,t.y||0)}function Yt(t){return Xt(t.x||0,t.y||0)+(t.angle?" "+Ft(t.angle):"")+(t.scaleX||t.scaleY?" "+(e=t.scaleX||1,n=t.scaleY||1,"scale("+e+","+n+")"):"");var e,n}function Jt(t,e,n){function i(t,n){var i=n.x||0,r=n.y||0,o=n.angle||0;t.translate(i,r),o&&t.rotate(o*=T),t.beginPath(),e(t,n),o&&t.rotate(-o),t.translate(-i,-r)}return{type:t,tag:"path",nested:!1,attr:function(t,n){t("transform",Yt(n)),t("d",e(null,n))},bound:function(t,n){var i=n.x||0,r=n.y||0;return e(dt(t),n),lt(t,n).translate(i,r),n.angle&&t.rotate(n.angle*T,i,r),t},draw:Vt(i),pick:Ut(i),isect:n||Tt(i)}}var Qt=Jt("arc",(function(t,e){return K.context(t)(e)}));function Zt(t,e,n){function i(t,n){t.beginPath(),e(t,n)}var r=Wt(i);return{type:t,tag:"path",nested:!0,attr:function(t,n){var i=n.mark.items;i.length&&t("d",e(null,i))},bound:function(t,n){var i=n.items;return 0===i.length?t:(e(dt(t),i),lt(t,i[0]))},draw:Ht(i),pick:function(t,e,n,i,o,s){var a=e.items,l=e.bounds;return!a||!a.length||l&&!l.contains(o,s)?null:(n*=t.pixelRatio,i*=t.pixelRatio,r(t,a,n,i)?a[0]:null)},isect:At,tip:n}}var Kt=Zt("area",(function(t,e){var n=e[0],i=n.interpolate||"linear";return("horizontal"===n.orient?et:tt).curve(x(i,n.orient,n.tension)).context(t)(e)}),(function(t,e){for(var n,i,r="horizontal"===t[0].orient?e[1]:e[0],o="horizontal"===t[0].orient?"y":"x",s=t.length,a=1/0;--s>=0;)!1!==t[s].defined&&(i=Math.abs(t[s][o]-r))<a&&(a=i,n=t[s]);return n}));function te(t,e){t.beginPath(),st(e)?at(t,e,0,0):t.rect(0,0,e.width||0,e.height||0),t.clip()}var ee=1;function ne(t,n,i){var r=n.clip,o=t._defs,s=n.clip_id||(n.clip_id="clip"+ee++),a=o.clipping[s]||(o.clipping[s]={id:s});return e.isFunction(r)?a.path=r(null):st(i)?a.path=at(null,i,0,0):(a.width=i.width||0,a.height=i.height||0),"url(#"+s+")"}function ie(t){var e=null!=(e=t.strokeWidth)?e:1;return null!=t.strokeOffset?t.strokeOffset:t.stroke&&e>.5&&e<1.5?.5-Math.abs(e-1):0}function re(t,e){var n=ie(e);t("d",at(null,e,n,n))}function oe(t,e,n,i){var r=ie(e);t.beginPath(),at(t,e,(n||0)+r,(i||0)+r)}var se=Wt(oe),ae=Wt(oe,!1);var le={type:"group",tag:"g",nested:!1,attr:function(t,e){t("transform",$t(e))},bound:function(t,e){if(!e.clip&&e.items)for(var n=e.items,i=0,r=n.length;i<r;++i)t.union(n[i].bounds);return(e.clip||e.width||e.height)&&!e.noBound&&t.add(0,0).add(e.width||0,e.height||0),lt(t,e),t.translate(e.x||0,e.y||0)},draw:function(t,e,n){var i=this;It(e,(function(e){var r=e.x||0,o=e.y||0,s=e.strokeForeground,a=null==e.opacity?1:e.opacity;(e.stroke||e.fill)&&a&&(oe(t,e,r,o),zt(t,e),e.fill&&Ot(t,e,a)&&t.fill(),e.stroke&&!s&&qt(t,e,a)&&t.stroke()),t.save(),t.translate(r,o),e.clip&&te(t,e),n&&n.translate(-r,-o),It(e,(function(e){i.draw(t,e,n)})),n&&n.translate(r,o),t.restore(),s&&e.stroke&&a&&(oe(t,e,r,o),zt(t,e),qt(t,e,a)&&t.stroke())}))},pick:function(t,e,n,i,r,o){if(e.bounds&&!e.bounds.contains(r,o)||!e.items)return null;var s=this,a=n*t.pixelRatio,l=i*t.pixelRatio;return Bt(e,(function(u){var c,h,f,d,g,p,v,y,m;if((!(y=u.bounds)||y.contains(r,o))&&(d=u.x||0,g=u.y||0,p=d+(u.width||0),v=g+(u.height||0),!(m=u.clip)||!(r<d||r>p||o<d||o>v)))return t.save(),t.translate(d,g),d=r-d,g=o-g,m&&st(u)&&!se(t,u,a,l)?(t.restore(),null):(h=u.strokeForeground,(f=!1!==e.interactive)&&h&&u.stroke&&ae(t,u,a,l)?(t.restore(),u):(!(c=Bt(u,(function(t){return function(t,e,n){return(!1!==t.interactive||"group"===t.marktype)&&t.bounds&&t.bounds.contains(e,n)}(t,d,g)?s.pick(t,n,i,d,g):null})))&&f&&(u.fill||!h&&u.stroke)&&se(t,u,a,l)&&(c=u),t.restore(),c||null))}))},isect:Mt,content:function(t,e,n){t("clip-path",e.clip?ne(n,e,e):null)},background:function(t,e){t("class","background"),t("aria-hidden",!0),re(t,e)},foreground:function(t,e){t("class","foreground"),t("aria-hidden",!0),e.strokeForeground?re(t,e):t("d","")}};function ue(t,e){var n=t.image;return(!n||t.url&&t.url!==n.url)&&(n={complete:!1,width:0,height:0},e.loadImage(t.url).then(e=>{t.image=e,t.image.url=t.url})),n}function ce(t,e){return null!=t.width?t.width:e&&e.width?!1!==t.aspect&&t.height?t.height*e.width/e.height:e.width:0}function he(t,e){return null!=t.height?t.height:e&&e.height?!1!==t.aspect&&t.width?t.width*e.height/e.width:e.height:0}function fe(t,e){return"center"===t?e/2:"right"===t?e:0}function de(t,e){return"middle"===t?e/2:"bottom"===t?e:0}var ge={type:"image",tag:"image",nested:!1,attr:function(t,e,n){var i=ue(e,n),r=e.x||0,o=e.y||0,s=ce(e,i),a=he(e,i),l=!1===e.aspect?"none":"xMidYMid";r-=fe(e.align,s),o-=de(e.baseline,a),!i.src&&i.toDataURL?t("href",i.toDataURL(),"http://www.w3.org/1999/xlink","xlink:href"):t("href",i.src||"","http://www.w3.org/1999/xlink","xlink:href"),t("transform",Xt(r,o)),t("width",s),t("height",a),t("preserveAspectRatio",l)},bound:function(t,e){var n=e.image,i=e.x||0,r=e.y||0,o=ce(e,n),s=he(e,n);return i-=fe(e.align,o),r-=de(e.baseline,s),t.set(i,r,i+o,r+s)},draw:function(t,e,n){var i=this;It(e,(function(e){if(!n||n.intersects(e.bounds)){var r,o,s,a,l=ue(e,i),u=e.x||0,c=e.y||0,h=ce(e,l),f=he(e,l);u-=fe(e.align,h),c-=de(e.baseline,f),!1!==e.aspect&&(o=l.width/l.height,s=e.width/e.height,o==o&&s==s&&o!==s&&(s<o?(c+=(f-(a=h/o))/2,f=a):(u+=(h-(a=f*o))/2,h=a))),(l.complete||l.toDataURL)&&(zt(t,e),t.globalAlpha=null!=(r=e.opacity)?r:1,t.imageSmoothingEnabled=!1!==e.smooth,t.drawImage(l,u,c,h,f))}}))},pick:Gt(),isect:e.truthy,get:ue,xOffset:fe,yOffset:de},pe=Zt("line",(function(t,e){var n=e[0],i=n.interpolate||"linear";return nt.curve(x(i,n.orient,n.tension)).context(t)(e)}),(function(t,e){for(var n,i,r=Math.pow(t[0].strokeWidth||1,2),o=t.length;--o>=0;)if(!1!==t[o].defined&&(n=t[o].x-e[0])*n+(i=t[o].y-e[1])*i<r)return t[o];return null}));function ve(t,e){var n=e.path;if(null==n)return!0;var i=e.x||0,r=e.y||0,o=e.scaleX||1,s=e.scaleY||1,a=(e.angle||0)*T,l=e.pathCache;l&&l.path===n||((e.pathCache=l=w(n)).path=n),a&&t.rotate&&t.translate?(t.translate(i,r),t.rotate(a),N(t,l,0,0,o,s),t.rotate(-a),t.translate(-i,-r)):N(t,l,i,r,o,s)}var ye={type:"path",tag:"path",nested:!1,attr:function(t,e){var n=e.scaleX||1,i=e.scaleY||1;1===n&&1===i||t("vector-effect","non-scaling-stroke"),t("transform",Yt(e)),t("d",e.path)},bound:function(t,e){return ve(dt(t),e)?t.set(0,0,0,0):lt(t,e,!0),e.angle&&t.rotate(e.angle*T,e.x||0,e.y||0),t},draw:Vt(ve),pick:Ut(ve),isect:Tt(ve)};function me(t,e){t.beginPath(),at(t,e)}var _e={type:"rect",tag:"path",nested:!1,attr:function(t,e){t("d",at(null,e))},bound:function(t,e){var n,i;return lt(t.set(n=e.x||0,i=e.y||0,n+e.width||0,i+e.height||0),e)},draw:Vt(me),pick:Ut(me),isect:Mt};function xe(t,e,n){var i,r,o,s;return!(!e.stroke||!qt(t,e,n))&&(i=e.x||0,r=e.y||0,o=null!=e.x2?e.x2:i,s=null!=e.y2?e.y2:r,t.beginPath(),t.moveTo(i,r),t.lineTo(o,s),!0)}var be={type:"rule",tag:"line",nested:!1,attr:function(t,e){t("transform",$t(e)),t("x2",null!=e.x2?e.x2-(e.x||0):0),t("y2",null!=e.y2?e.y2-(e.y||0):0)},bound:function(t,e){var n,i;return lt(t.set(n=e.x||0,i=e.y||0,null!=e.x2?e.x2:n,null!=e.y2?e.y2:i),e)},draw:function(t,e,n){It(e,(function(e){if(!n||n.intersects(e.bounds)){var i=null==e.opacity?1:e.opacity;i&&xe(t,e,i)&&(zt(t,e),t.stroke())}}))},pick:Gt((function(t,e,n,i){return!!t.isPointInStroke&&(xe(t,e,1)&&t.isPointInStroke(n,i))})),isect:Ct},ke=Jt("shape",(function(t,e){return(e.mark.shape||e.shape).context(t)(e)})),we=Jt("symbol",(function(t,e){return rt.context(t)(e)}),At);const Te=e.lruCache();var Ae={height:Se,measureWidth:ze,estimateWidth:Ce,width:Ce,canvas:Me};function Me(t){Ae.width=t&&kt?ze:Ce}function Ce(t,e){return Re(Ne(t,e),Se(t))}function Re(t,e){return~~(.8*t.length*e)}function ze(t,e){return Se(t)<=0||!(e=Ne(t,e))?0:Pe(e,De(t))}function Pe(t,e){const n=`(${e}) ${t}`;let i=Te.get(n);return void 0===i&&(kt.font=e,i=kt.measureText(t).width,Te.set(n,i)),i}function Se(t){return null!=t.fontSize?+t.fontSize||0:11}function Le(t){return null!=t.lineHeight?t.lineHeight:Se(t)+2}function Oe(t){return n=t.lineBreak&&t.text&&!e.isArray(t.text)?t.text.split(t.lineBreak):t.text,e.isArray(n)?n.length>1?n:n[0]:n;var n}function Ne(t,e){const n=null==e?"":(e+"").trim();return t.limit>0&&n.length?function(t,e){var n=+t.limit,i=function(t){if(Ae.width===ze){const e=De(t);return t=>Pe(t,e)}{const e=Se(t);return t=>Re(t,e)}}(t);if(i(e)<n)return e;var r,o=t.ellipsis||"…",s="rtl"===t.dir,a=0,l=e.length;if(n-=i(o),s){for(;a<l;)r=a+l>>>1,i(e.slice(r))>n?a=r+1:l=r;return o+e.slice(a)}for(;a<l;)r=1+(a+l>>>1),i(e.slice(0,r))<n?a=r:l=r-1;return e.slice(0,a)+o}(t,n):n}function qe(t,e){var n=t.font;return(e&&n?String(n).replace(/"/g,"'"):n)||"sans-serif"}function De(t,e){return(t.fontStyle?t.fontStyle+" ":"")+(t.fontVariant?t.fontVariant+" ":"")+(t.fontWeight?t.fontWeight+" ":"")+Se(t)+"px "+qe(t,e)}function Ee(t){var e=t.baseline,n=Se(t);return Math.round("top"===e?.79*n:"middle"===e?.3*n:"bottom"===e?-.21*n:"line-top"===e?.29*n+.5*Le(t):"line-bottom"===e?.29*n-.5*Le(t):0)}Me(!0);var Ie={left:"start",center:"middle",right:"end"},Be=new a;function Ve(t){var e,n=t.x||0,i=t.y||0,r=t.radius||0;return r&&(e=(t.theta||0)-A,n+=r*Math.cos(e),i+=r*Math.sin(e)),Be.x1=n,Be.y1=i,Be}function He(t,n,i){var r,o=Ae.height(n),s=n.align,a=Ve(n),l=a.x1,u=a.y1,c=n.dx||0,h=(n.dy||0)+Ee(n)-Math.round(.8*o),f=Oe(n);if(e.isArray(f)?(o+=Le(n)*(f.length-1),r=f.reduce((t,e)=>Math.max(t,Ae.width(n,e)),0)):r=Ae.width(n,f),"center"===s?c-=r/2:"right"===s&&(c-=r),t.set(c+=l,h+=u,c+r,h+o),n.angle&&!i)t.rotate(n.angle*T,l,u);else if(2===i)return t.rotatedPoints(n.angle*T,l,u);return t}var je={arc:Qt,area:Kt,group:le,image:ge,line:pe,path:ye,rect:_e,rule:be,shape:ke,symbol:we,text:{type:"text",tag:"text",nested:!1,attr:function(t,e){var n,i=e.dx||0,r=(e.dy||0)+Ee(e),o=Ve(e),s=o.x1,a=o.y1,l=e.angle||0;t("text-anchor",Ie[e.align]||"start"),l?(n=Xt(s,a)+" "+Ft(l),(i||r)&&(n+=" "+Xt(i,r))):n=Xt(s+i,a+r),t("transform",n)},bound:He,draw:function(t,n,i){It(n,(function(n){var r,o,s,a,l,u,c,h=null==n.opacity?1:n.opacity;if(!(i&&!i.intersects(n.bounds)||0===h||n.fontSize<=0||null==n.text||0===n.text.length)){if(t.font=De(n),t.textAlign=n.align||"left",o=(r=Ve(n)).x1,s=r.y1,n.angle&&(t.save(),t.translate(o,s),t.rotate(n.angle*T),o=s=0),o+=n.dx||0,s+=(n.dy||0)+Ee(n),u=Oe(n),zt(t,n),e.isArray(u))for(l=Le(n),a=0;a<u.length;++a)c=Ne(n,u[a]),n.fill&&Ot(t,n,h)&&t.fillText(c,o,s),n.stroke&&qt(t,n,h)&&t.strokeText(c,o,s),s+=l;else c=Ne(n,u),n.fill&&Ot(t,n,h)&&t.fillText(c,o,s),n.stroke&&qt(t,n,h)&&t.strokeText(c,o,s);n.angle&&t.restore()}}))},pick:Gt((function(t,e,n,i,r,o){if(e.fontSize<=0)return!1;if(!e.angle)return!0;var s=Ve(e),a=s.x1,l=s.y1,u=He(Be,e,1),c=-e.angle*T,h=Math.cos(c),f=Math.sin(c),d=h*r-f*o+(a-h*a+f*l),g=f*r+h*o+(l-f*a-h*l);return u.contains(d,g)})),isect:function(t,e){var n=He(Be,t,2);return Rt(e,n[0],n[1],n[2],n[3])||Rt(e,n[0],n[1],n[4],n[5])||Rt(e,n[4],n[5],n[6],n[7])||Rt(e,n[2],n[3],n[6],n[7])}},trail:Zt("trail",(function(t,e){return ot.context(t)(e)}),(function(t,e){for(var n,i,r=t.length;--r>=0;)if(!1!==t[r].defined&&(n=t[r].x-e[0])*n+(i=t[r].y-e[1])*i<(n=t[r].size||1)*n)return t[r];return null}))};function Ge(t,e,n){var i=je[t.mark.marktype],r=e||i.bound;return i.nested&&(t=t.mark),r(t.bounds||(t.bounds=new a),t,n)}var We={mark:null};function Ue(t,e,n){var i,r,o,s,l=je[t.marktype],u=l.bound,c=t.items,h=c&&c.length;if(l.nested)return h?o=c[0]:(We.mark=t,o=We),s=Ge(o,u,n),e=e&&e.union(s)||s;if(e=e||t.bounds&&t.bounds.clear()||new a,h)for(i=0,r=c.length;i<r;++i)e.union(Ge(c[i],u,n));return t.bounds=e}var Xe=["marktype","name","role","interactive","clip","items","zindex","x","y","width","height","align","baseline","fill","fillOpacity","opacity","blend","stroke","strokeOpacity","strokeWidth","strokeCap","strokeDash","strokeDashOffset","strokeForeground","strokeOffset","startAngle","endAngle","innerRadius","outerRadius","cornerRadius","padAngle","cornerRadiusTopLeft","cornerRadiusTopRight","cornerRadiusBottomLeft","cornerRadiusBottomRight","interpolate","tension","orient","defined","url","aspect","smooth","path","scaleX","scaleY","x2","y2","size","shape","text","angle","theta","radius","dir","dx","dy","ellipsis","limit","lineBreak","lineHeight","font","fontSize","fontWeight","fontStyle","fontVariant","description","aria","ariaRole","ariaRoleDescription"];function Fe(t,e){return JSON.stringify(t,Xe,e)}function $e(t){return function t(e){var n,i,r,o=e.marktype,s=e.items;if(s)for(i=0,r=s.length;i<r;++i)n=o?"mark":"group",s[i][n]=e,s[i].zindex&&(s[i][n].zdirty=!0),"group"===(o||n)&&t(s[i]);o&&Ue(e);return e}("string"==typeof t?JSON.parse(t):t)}function Ye(t){arguments.length?this.root=$e(t):(this.root=Qe({marktype:"group",name:"root",role:"frame"}),this.root.items=[new g(this.root)])}var Je=Ye.prototype;function Qe(t,e){const n={bounds:new a,clip:!!t.clip,group:e,interactive:!1!==t.interactive,items:[],marktype:t.marktype,name:t.name||void 0,role:t.role||void 0,zindex:t.zindex||0};return null!=t.aria&&(n.aria=t.aria),t.description&&(n.description=t.description),n}function Ze(t,e,n){return!t&&"undefined"!=typeof document&&document.createElement&&(t=document),t?n?t.createElementNS(n,e):t.createElement(e):null}function Ke(t,e){e=e.toLowerCase();for(var n=t.childNodes,i=0,r=n.length;i<r;++i)if(n[i].tagName.toLowerCase()===e)return n[i]}function tn(t,e,n,i){var r,o=t.childNodes[e];return o&&o.tagName.toLowerCase()===n.toLowerCase()||(r=o||null,o=Ze(t.ownerDocument,n,i),t.insertBefore(o,r)),o}function en(t,e){for(var n=t.childNodes,i=n.length;i>e;)t.removeChild(n[--i]);return t}function nn(t){return"mark-"+t.marktype+(t.role?" role-"+t.role:"")+(t.name?" "+t.name:"")}function rn(t,e){var n=e.getBoundingClientRect();return[t.clientX-n.left-(e.clientLeft||0),t.clientY-n.top-(e.clientTop||0)]}function on(t,e){this._active=null,this._handlers={},this._loader=t||i.loader(),this._tooltip=e||sn}function sn(t,e,n,i){t.element().setAttribute("title",i||"")}Je.toJSON=function(t){return Fe(this.root,t||0)},Je.mark=function(t,e,n){var i=Qe(t,e=e||this.root.items[0]);return e.items[n]=i,i.zindex&&(i.group.zdirty=!0),i};var an=on.prototype;function ln(t){this._el=null,this._bgcolor=null,this._loader=new p(t)}an.initialize=function(t,e,n){return this._el=t,this._obj=n||null,this.origin(e)},an.element=function(){return this._el},an.canvas=function(){return this._el&&this._el.firstChild},an.origin=function(t){return arguments.length?(this._origin=t||[0,0],this):this._origin.slice()},an.scene=function(t){return arguments.length?(this._scene=t,this):this._scene},an.on=function(){},an.off=function(){},an._handlerIndex=function(t,e,n){for(var i=t?t.length:0;--i>=0;)if(t[i].type===e&&(!n||t[i].handler===n))return i;return-1},an.handlers=function(t){var e,n=this._handlers,i=[];if(t)i.push.apply(i,n[this.eventName(t)]);else for(e in n)i.push.apply(i,n[e]);return i},an.eventName=function(t){var e=t.indexOf(".");return e<0?t:t.slice(0,e)},an.handleHref=function(t,e,n){this._loader.sanitize(n,{context:"href"}).then((function(e){var n=new MouseEvent(t.type,t),i=Ze(null,"a");for(var r in e)i.setAttribute(r,e[r]);i.dispatchEvent(n)})).catch((function(){}))},an.handleTooltip=function(t,e,n){if(e&&null!=e.tooltip){e=function(t,e,n,i){var r,o,s=t&&t.mark;if(s&&(r=je[s.marktype]).tip){for((o=rn(e,n))[0]-=i[0],o[1]-=i[1];t=t.mark.group;)o[0]-=t.x||0,o[1]-=t.y||0;t=r.tip(s.items,o)}return t}(e,t,this.canvas(),this._origin);var i=n&&e&&e.tooltip||null;this._tooltip.call(this._obj,this,t,e,i)}},an.getItemBoundingClientRect=function(t){if(e=this.canvas()){for(var e,n=e.getBoundingClientRect(),i=this._origin,r=t.bounds,o=r.x1+i[0]+n.left,s=r.y1+i[1]+n.top,a=r.width(),l=r.height();t.mark&&(t=t.mark.group);)o+=t.x||0,s+=t.y||0;return{x:o,y:s,width:a,height:l,left:o,top:s,right:o+a,bottom:s+l}}};var un=ln.prototype;un.initialize=function(t,e,n,i,r){return this._el=t,this.resize(e,n,i,r)},un.element=function(){return this._el},un.canvas=function(){return this._el&&this._el.firstChild},un.background=function(t){return 0===arguments.length?this._bgcolor:(this._bgcolor=t,this)},un.resize=function(t,e,n,i){return this._width=t,this._height=e,this._origin=n||[0,0],this._scale=i||1,this},un.dirty=function(){},un.render=function(t){var e=this;return e._call=function(){e._render(t)},e._call(),e._call=null,e},un._render=function(){},un.renderAsync=function(t){var e=this.render(t);return this._ready?this._ready.then((function(){return e})):Promise.resolve(e)},un._load=function(t,e){var n=this,i=n._loader[t](e);if(!n._ready){var r=n._call;n._ready=n._loader.ready().then((function(t){t&&r(),n._ready=null}))}return i},un.sanitizeURL=function(t){return this._load("sanitizeURL",t)},un.loadImage=function(t){return this._load("loadImage",t)};function cn(t,e){on.call(this,t,e),this._down=null,this._touch=null,this._first=!0}var hn=e.inherits(cn,on);function fn(t,e,n){return function(i){var r=this._active,o=this.pickEvent(i);o===r||(r&&r.exit||this.fire(n,i),this._active=o,this.fire(e,i)),this.fire(t,i)}}function dn(t){return function(e){this.fire(t,e),this._active=null}}hn.initialize=function(t,e,n){var i=this._canvas=t&&Ke(t,"canvas");if(i){var r=this;this.events.forEach((function(t){i.addEventListener(t,(function(e){hn[t]?hn[t].call(r,e):r.fire(t,e)}))}))}return on.prototype.initialize.call(this,t,e,n)},hn.canvas=function(){return this._canvas},hn.context=function(){return this._canvas.getContext("2d")},hn.events=["keydown","keypress","keyup","dragenter","dragleave","dragover","mousedown","mouseup","mousemove","mouseout","mouseover","click","dblclick","wheel","mousewheel","touchstart","touchmove","touchend"],hn.DOMMouseScroll=function(t){this.fire("mousewheel",t)},hn.mousemove=fn("mousemove","mouseover","mouseout"),hn.dragover=fn("dragover","dragenter","dragleave"),hn.mouseout=dn("mouseout"),hn.dragleave=dn("dragleave"),hn.mousedown=function(t){this._down=this._active,this.fire("mousedown",t)},hn.click=function(t){this._down===this._active&&(this.fire("click",t),this._down=null)},hn.touchstart=function(t){this._touch=this.pickEvent(t.changedTouches[0]),this._first&&(this._active=this._touch,this._first=!1),this.fire("touchstart",t,!0)},hn.touchmove=function(t){this.fire("touchmove",t,!0)},hn.touchend=function(t){this.fire("touchend",t,!0),this._touch=null},hn.fire=function(t,e,n){var i,r,o=n?this._touch:this._active,s=this._handlers[t];if(e.vegaType=t,"click"===t&&o&&o.href?this.handleHref(e,o,o.href):"mousemove"!==t&&"mouseout"!==t||this.handleTooltip(e,o,"mouseout"!==t),s)for(i=0,r=s.length;i<r;++i)s[i].handler.call(this._obj,e,o)},hn.on=function(t,e){var n=this.eventName(t),i=this._handlers;return this._handlerIndex(i[n],t,e)<0&&(i[n]||(i[n]=[])).push({type:t,handler:e}),this},hn.off=function(t,e){var n=this.eventName(t),i=this._handlers[n],r=this._handlerIndex(i,t,e);return r>=0&&i.splice(r,1),this},hn.pickEvent=function(t){var e=rn(t,this._canvas),n=this._origin;return this.pick(this._scene,e[0],e[1],e[0]-n[0],e[1]-n[1])},hn.pick=function(t,e,n,i,r){var o=this.context();return je[t.marktype].pick.call(this,o,t,e,n,i,r)};var gn="undefined"!=typeof window&&window.devicePixelRatio||1;function pn(t){ln.call(this,t),this._redraw=!1,this._dirty=new a}var vn=e.inherits(pn,ln),yn=ln.prototype,mn=new a;function _n(t,e,n){return mn.set(0,0,e,n).translate(-t[0],-t[1])}function xn(t,e){on.call(this,t,e);var n=this;n._hrefHandler=kn(n,(function(t,e){e&&e.href&&n.handleHref(t,e,e.href)})),n._tooltipHandler=kn(n,(function(t,e){n.handleTooltip(t,e,"mouseout"!==t.type)}))}vn.initialize=function(t,e,i,r,o,s){return this._options=s,this._canvas=n.canvas(1,1,s&&s.type),t&&(en(t,0).appendChild(this._canvas),this._canvas.setAttribute("class","marks")),yn.initialize.call(this,t,e,i,r,o)},vn.resize=function(t,e,n,i){return yn.resize.call(this,t,e,n,i),function(t,e,n,i,r,o){const s="undefined"!=typeof HTMLElement&&t instanceof HTMLElement&&null!=t.parentNode,a=t.getContext("2d"),l=s?gn:r;t.width=e*l,t.height=n*l;for(const t in o)a[t]=o[t];s&&1!==l&&(t.style.width=e+"px",t.style.height=n+"px"),a.pixelRatio=l,a.setTransform(l,0,0,l,l*i[0],l*i[1])}(this._canvas,this._width,this._height,this._origin,this._scale,this._options&&this._options.context),this._redraw=!0,this},vn.canvas=function(){return this._canvas},vn.context=function(){return this._canvas?this._canvas.getContext("2d"):null},vn.dirty=function(t){var e=function(t,e){if(null==e)return t;for(var n=mn.clear().union(t);null!=e;e=e.mark.group)n.translate(e.x||0,e.y||0);return n}(t.bounds,t.mark.group);this._dirty.union(e)},vn._render=function(t){var e=this.context(),n=this._origin,i=this._width,r=this._height,o=this._dirty;return e.save(),this._redraw||o.empty()?(this._redraw=!1,o=_n(n,i,r).expand(1)):o=function(t,e,n){return e.expand(1).round(),t.pixelRatio%1&&e.scale(t.pixelRatio).round().scale(1/t.pixelRatio),e.translate(-n[0]%1,-n[1]%1),t.beginPath(),t.rect(e.x1,e.y1,e.width(),e.height()),t.clip(),e}(e,o.intersect(_n(n,i,r)),n),this.clear(-n[0],-n[1],i,r),this.draw(e,t,o),e.restore(),this._dirty.clear(),this},vn.draw=function(t,n,i){var r=je[n.marktype];n.clip&&function(t,n){var i=n.clip;t.save(),e.isFunction(i)?(t.beginPath(),i(t),t.clip()):te(t,n.group)}(t,n),r.draw.call(this,t,n,i),n.clip&&t.restore()},vn.clear=function(t,e,n,i){var r=this.context();r.clearRect(t,e,n,i),null!=this._bgcolor&&(r.fillStyle=this._bgcolor,r.fillRect(t,e,n,i))};var bn=e.inherits(xn,on);function kn(t,e){return function(n){var i=n.target.__data__;n.vegaType=n.type,i=Array.isArray(i)?i[0]:i,e.call(t._obj,n,i)}}bn.initialize=function(t,e,n){var i=this._svg;return i&&(i.removeEventListener("click",this._hrefHandler),i.removeEventListener("mousemove",this._tooltipHandler),i.removeEventListener("mouseout",this._tooltipHandler)),this._svg=i=t&&Ke(t,"svg"),i&&(i.addEventListener("click",this._hrefHandler),i.addEventListener("mousemove",this._tooltipHandler),i.addEventListener("mouseout",this._tooltipHandler)),on.prototype.initialize.call(this,t,e,n)},bn.canvas=function(){return this._svg},bn.on=function(t,e){var n=this.eventName(t),i=this._handlers;if(this._handlerIndex(i[n],t,e)<0){var r={type:t,handler:e,listener:kn(this,e)};(i[n]||(i[n]=[])).push(r),this._svg&&this._svg.addEventListener(n,r.listener)}return this},bn.off=function(t,e){var n=this.eventName(t),i=this._handlers[n],r=this._handlerIndex(i,t,e);return r>=0&&(this._svg&&this._svg.removeEventListener(n,i[r].listener),i.splice(r,1)),this};const wn=(t,e,n)=>({role:t,"aria-roledescription":e,"aria-label":n||void 0}),Tn=e.toSet(["axis-domain","axis-grid","axis-label","axis-tick","axis-title","legend-band","legend-entry","legend-gradient","legend-label","legend-title","legend-symbol","title"]),An={axis:{desc:"axis",caption:function(t){const e=t.datum,n=e.orient,i=e.title?Pn(t):null,r=t.context.scales[e.scale].value,o=r.type;return("left"===n||"right"===n?"Y":"X")+"-axis"+(i?` titled '${i}'`:"")+` for a ${s.isDiscrete(o)?"discrete":o} scale with `+s.domainCaption(r,t)}},legend:{desc:"legend",caption:function(t){const n=t.datum,i=n.title?Pn(t):null,r=((n.type||"")+" legend").trim(),o=n.scales,a=Object.keys(o),l=t.context.scales[o[a[0]]].value;return u=r,(u.length?u[0].toUpperCase()+u.slice(1):u)+(i?` titled '${i}'`:"")+` for ${function(t){return(t=t.map(t=>t+("fill"===t||"stroke"===t?" color":""))).length<2?t[0]:t.slice(0,-1).join(", ")+" and "+e.peek(t)}(a)} with ${s.domainCaption(l,t)}`;var u}},"title-text":{desc:"title",caption:t=>`Title text '${zn(t)}'`},"title-subtitle":{desc:"subtitle",caption:t=>`Subtitle text '${zn(t)}'`}},Mn={ariaRole:"role",ariaRoleDescription:"aria-roledescription",description:"aria-label"};function Cn(t,e){const n=!1===e.aria;if(t("aria-hidden",n||void 0),n||null==e.description)for(const e in Mn)t(Mn[e],void 0);else{const n=e.mark.marktype;t("aria-label",e.description),t("role",e.ariaRole||("group"===n?"graphics-object":"graphics-symbol")),t("aria-roledescription",e.ariaRoleDescription||n+" mark")}}function Rn(t){return!1===t.aria?{"aria-hidden":!0}:Tn[t.role]?null:An[t.role]?function(t,e){try{const n=t.items[0],i=e.caption||(()=>"");return wn(e.role||"graphics-symbol",e.desc,n.description||i(n))}catch(t){return null}}(t,An[t.role]):function(t){const e=t.marktype,n="group"===e||"text"===e||t.items.some(t=>null!=t.description&&!1!==t.aria);return wn(n?"graphics-object":"graphics-symbol",e+" mark container",t.description)}(t)}function zn(t){return e.array(t.text).join(" ")}function Pn(t){try{return e.array(e.peek(t.items).items[0].text).join(" ")}catch(t){return null}}function Sn(t,e,n){var i,r,o="<"+t;if(e)for(i in e)null!=(r=e[i])&&(o+=" "+i+'="'+(r=(r+"").replace(/"/g,"&quot;"))+'"');return n&&(o+=" "+n),o+">"}function Ln(t){return"</"+t+">"}var On={version:"1.1",xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink"},Nn={fill:"fill",fillOpacity:"fill-opacity",stroke:"stroke",strokeOpacity:"stroke-opacity",strokeWidth:"stroke-width",strokeCap:"stroke-linecap",strokeJoin:"stroke-linejoin",strokeDash:"stroke-dasharray",strokeDashOffset:"stroke-dashoffset",strokeMiterLimit:"stroke-miterlimit",opacity:"opacity",blend:"mix-blend-mode"},qn=On.xmlns;function Dn(t){ln.call(this,t),this._dirtyID=0,this._dirty=[],this._svg=null,this._root=null,this._defs=null}var En=e.inherits(Dn,ln),In=ln.prototype;function Bn(t,e,n){var i,r,o;if("radial"===e.gradient){var s=tn(t,n++,"pattern",qn);s.setAttribute("id","p_"+e.id),s.setAttribute("viewBox","0,0,1,1"),s.setAttribute("width","100%"),s.setAttribute("height","100%"),s.setAttribute("preserveAspectRatio","xMidYMid slice"),(s=tn(s,0,"rect",qn)).setAttribute("width","1"),s.setAttribute("height","1"),s.setAttribute("fill","url("+Yn()+"#"+e.id+")"),(t=tn(t,n++,"radialGradient",qn)).setAttribute("id",e.id),t.setAttribute("fx",e.x1),t.setAttribute("fy",e.y1),t.setAttribute("fr",e.r1),t.setAttribute("cx",e.x2),t.setAttribute("cy",e.y2),t.setAttribute("r",e.r2)}else(t=tn(t,n++,"linearGradient",qn)).setAttribute("id",e.id),t.setAttribute("x1",e.x1),t.setAttribute("x2",e.x2),t.setAttribute("y1",e.y1),t.setAttribute("y2",e.y2);for(i=0,r=e.stops.length;i<r;++i)(o=tn(t,i,"stop",qn)).setAttribute("offset",e.stops[i].offset),o.setAttribute("stop-color",e.stops[i].color);return en(t,i),n}function Vn(t,e,n){var i;return(t=tn(t,n,"clipPath",qn)).setAttribute("id",e.id),e.path?(i=tn(t,0,"path",qn)).setAttribute("d",e.path):((i=tn(t,0,"rect",qn)).setAttribute("x",0),i.setAttribute("y",0),i.setAttribute("width",e.width),i.setAttribute("height",e.height)),en(t,1),n+1}function Hn(t,e){for(;t&&t.dirty!==e;t=t.mark.group){if(t.dirty=e,!t.mark||t.mark.dirty===e)return;t.mark.dirty=e}}function jn(t,e,n,i,r){var o,s=t._svg;if(!s&&(s=Ze(o=e.ownerDocument,i,qn),t._svg=s,t.mark&&(s.__data__=t,s.__values__={fill:"default"},"g"===i))){var a=Ze(o,"path",qn);s.appendChild(a),a.__data__=t;var l=Ze(o,"g",qn);s.appendChild(l),l.__data__=t;var u=Ze(o,"path",qn);s.appendChild(u),u.__data__=t,u.__values__={fill:"default"}}return(s.ownerSVGElement!==r||function(t,e){return t.parentNode&&t.parentNode.childNodes.length>1&&t.previousSibling!=e}(s,n))&&e.insertBefore(s,n?n.nextSibling:e.firstChild),s}En.initialize=function(t,e,n,i){return t&&(this._svg=tn(t,0,"svg",qn),this._svg.setAttribute("class","marks"),en(t,1),this._root=tn(this._svg,0,"g",qn),en(this._svg,1)),this._defs={gradient:{},clipping:{}},this.background(this._bgcolor),In.initialize.call(this,t,e,n,i)},En.background=function(t){return arguments.length&&this._svg&&this._svg.style.setProperty("background-color",t),In.background.apply(this,arguments)},En.resize=function(t,e,n,i){return In.resize.call(this,t,e,n,i),this._svg&&(this._svg.setAttribute("width",this._width*this._scale),this._svg.setAttribute("height",this._height*this._scale),this._svg.setAttribute("viewBox","0 0 "+this._width+" "+this._height),this._root.setAttribute("transform","translate("+this._origin+")")),this._dirty=[],this},En.canvas=function(){return this._svg},En.svg=function(){if(!this._svg)return null;var t={class:"marks",width:this._width*this._scale,height:this._height*this._scale,viewBox:"0 0 "+this._width+" "+this._height};for(var e in On)t[e]=On[e];var n=this._bgcolor?Sn("rect",{width:this._width,height:this._height,style:"fill: "+this._bgcolor+";"})+Ln("rect"):"";return Sn("svg",t)+n+this._svg.innerHTML+Ln("svg")},En._render=function(t){return this._dirtyCheck()&&(this._dirtyAll&&this._resetDefs(),this.draw(this._root,t),en(this._root,1)),this.updateDefs(),this._dirty=[],++this._dirtyID,this},En.updateDefs=function(){var t,e=this._svg,n=this._defs,i=n.el,r=0;for(t in n.gradient)i||(n.el=i=tn(e,0,"defs",qn)),r=Bn(i,n.gradient[t],r);for(t in n.clipping)i||(n.el=i=tn(e,0,"defs",qn)),r=Vn(i,n.clipping[t],r);i&&(0===r?(e.removeChild(i),n.el=null):en(i,r))},En._resetDefs=function(){var t=this._defs;t.gradient={},t.clipping={}},En.dirty=function(t){t.dirty!==this._dirtyID&&(t.dirty=this._dirtyID,this._dirty.push(t))},En.isDirty=function(t){return this._dirtyAll||!t._svg||t.dirty===this._dirtyID},En._dirtyCheck=function(){this._dirtyAll=!0;var t=this._dirty;if(!t.length||!this._dirtyID)return!0;var e,n,i,r,o,s,a,l=++this._dirtyID;for(o=0,s=t.length;o<s;++o)(n=(e=t[o]).mark).marktype!==i&&(i=n.marktype,r=je[i]),n.zdirty&&n.dirty!==l&&(this._dirtyAll=!1,Hn(e,l),n.items.forEach((function(t){t.dirty=l}))),n.zdirty||(e.exit?(r.nested&&n.items.length?(a=n.items[0])._svg&&this._update(r,a._svg,a):e._svg&&(a=e._svg.parentNode)&&a.removeChild(e._svg),e._svg=null):(e=r.nested?n.items[0]:e)._update!==l&&(e._svg&&e._svg.ownerSVGElement?this._update(r,e._svg,e):(this._dirtyAll=!1,Hn(e,l)),e._update=l));return!this._dirtyAll},En.draw=function(t,e,n){if(!this.isDirty(e))return e._svg;var i,r=this,o=this._svg,s=je[e.marktype],a=!1===e.interactive?"none":null,l="g"===s.tag,u=null,c=0;(i=jn(e,t,n,"g",o)).setAttribute("class",nn(e));const h=Rn(e);for(const t in h)$n(i,t,h[t]);function f(t){var e=r.isDirty(t),n=jn(t,i,u,s.tag,o);e&&(r._update(s,n,t),l&&function(t,e,n){e=e.lastChild.previousSibling;var i,r=0;It(n,(function(n){i=t.draw(e,n,i),++r})),en(e,1+r)}(r,n,t)),u=n,++c}return l||i.style.setProperty("pointer-events",a),$n(i,"clip-path",e.clip?ne(r,e,e.group):null),s.nested?e.items.length&&f(e.items[0]):It(e,f),en(i,c),i};var Gn=null,Wn=null,Un={group:function(t,e,n){var i,r;Gn=i=e.childNodes[2],Wn=i.__values__,t.foreground(Fn,n,this),Wn=e.__values__,Gn=e.childNodes[1],t.content(Fn,n,this),Gn=r=e.childNodes[0],t.background(Fn,n,this);var o=!1===n.mark.interactive?"none":null;if(o!==Wn.events&&(i.style.setProperty("pointer-events",o),r.style.setProperty("pointer-events",o),Wn.events=o),n.strokeForeground&&n.stroke){const t=n.fill;i.style.removeProperty("display"),this.style(r,n),r.style.removeProperty("stroke"),t&&(n.fill=null),Wn=i.__values__,this.style(i,n),t&&(n.fill=t),Gn=null}else i.style.setProperty("display","none"),i.style.setProperty("fill","none")},image:function(t,e,n){!1===n.smooth?(Xn(e,"image-rendering","optimizeSpeed"),Xn(e,"image-rendering","pixelated")):Xn(e,"image-rendering",null)},text:function(t,n,i){var r,o,s,a,l=Oe(i);e.isArray(l)?(r=(o=l.map(t=>Ne(i,t))).join("\n"))!==Wn.text&&(en(n,0),s=n.ownerDocument,a=Le(i),o.forEach((t,e)=>{const r=Ze(s,"tspan",qn);r.__data__=i,r.textContent=t,e&&(r.setAttribute("x",0),r.setAttribute("dy",a)),n.appendChild(r)}),Wn.text=r):(o=Ne(i,l))!==Wn.text&&(n.textContent=o,Wn.text=o),Xn(n,"font-family",qe(i)),Xn(n,"font-size",Se(i)+"px"),Xn(n,"font-style",i.fontStyle),Xn(n,"font-variant",i.fontVariant),Xn(n,"font-weight",i.fontWeight)}};function Xn(t,e,n){n!==Wn[e]&&(null==n?t.style.removeProperty(e):t.style.setProperty(e,n+""),Wn[e]=n)}function Fn(t,e,n){e!==Wn[t]&&(n?function(t,e,n,i){null!=n?t.setAttributeNS(i,e,n):t.removeAttributeNS(i,e)}(Gn,t,e,n):$n(Gn,t,e),Wn[t]=e)}function $n(t,e,n){null!=n?t.setAttribute(e,n):t.removeAttribute(e)}function Yn(){var t;return"undefined"==typeof window?"":(t=window.location).hash?t.href.slice(0,-t.hash.length):t.href}function Jn(t){ln.call(this,t),this._text={head:"",bg:"",root:"",foot:"",defs:"",body:""},this._defs={gradient:{},clipping:{}}}En._update=function(t,e,n){Gn=e,Wn=e.__values__,Cn(Fn,n),t.attr(Fn,n,this);var i=Un[t.type];i&&i.call(this,t,e,n),Gn&&this.style(Gn,n)},En.style=function(t,e){if(null!=e)for(const n in Nn){let i=e[n];if("font"===n&&(i=qe(e)),i===Wn[n])continue;const r=Nn[n];null==i?"fill"===r?t.style.setProperty(r,"none"):t.style.removeProperty(r):(c(i)&&(i=h(i,this._defs.gradient,Yn())),t.style.setProperty(r,i+"")),Wn[n]=i}};var Qn,Zn=e.inherits(Jn,ln),Kn=ln.prototype;function ti(t,e,n,i){Qn[i||t]=e}function ei(t,e,n,i){if(null==t)return"";let r="";"bgrect"===n&&!1===e.interactive&&(r+="pointer-events: none; "),"bgfore"===n&&(!1===e.interactive&&(r+="pointer-events: none; "),r+="display: none; "),"image"===n&&!1===t.smooth&&(r+="image-rendering: optimizeSpeed; image-rendering: pixelated; "),"text"===n&&(r+="font-family: "+qe(t)+"; ",r+="font-size: "+Se(t)+"px; ",t.fontStyle&&(r+="font-style: "+t.fontStyle+"; "),t.fontVariant&&(r+="font-variant: "+t.fontVariant+"; "),t.fontWeight&&(r+="font-weight: "+t.fontWeight+"; "));for(const e in Nn){let n=t[e];const o=Nn[e];null==n?"fill"===o&&(r+="fill: none; "):"transparent"!==n||"fill"!==o&&"stroke"!==o?(c(n)&&(n=h(n,i.gradient,"")),r+=o+": "+n+"; "):r+=o+": none; "}return r?'style="'+r.trim()+'"':null}function ni(t){return t.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}Zn.resize=function(t,e,n,i){Kn.resize.call(this,t,e,n,i);var r=this._origin,o=this._text,s={class:"marks",width:this._width*this._scale,height:this._height*this._scale,viewBox:"0 0 "+this._width+" "+this._height};for(var a in On)s[a]=On[a];o.head=Sn("svg",s);var l=this._bgcolor;return"transparent"!==l&&"none"!==l||(l=null),o.bg=l?Sn("rect",{width:this._width,height:this._height,style:"fill: "+l+";"})+Ln("rect"):"",o.root=Sn("g",{transform:"translate("+r+")"}),o.foot=Ln("g")+Ln("svg"),this},Zn.background=function(){var t=Kn.background.apply(this,arguments);return arguments.length&&this._text.head&&this.resize(this._width,this._height,this._origin,this._scale),t},Zn.svg=function(){var t=this._text;return t.head+t.bg+t.defs+t.root+t.body+t.foot},Zn._render=function(t){return this._text.body=this.mark(t),this._text.defs=this.buildDefs(),this},Zn.buildDefs=function(){var t,e,n,i,r,o=this._defs,s="";for(e in o.gradient){for(r=(n=o.gradient[e]).stops,"radial"===n.gradient?(s+=Sn(i="pattern",{id:"p_"+e,viewBox:"0,0,1,1",width:"100%",height:"100%",preserveAspectRatio:"xMidYMid slice"}),s+=Sn("rect",{width:"1",height:"1",fill:"url(#"+e+")"})+Ln("rect"),s+=Ln(i),s+=Sn(i="radialGradient",{id:e,fx:n.x1,fy:n.y1,fr:n.r1,cx:n.x2,cy:n.y2,r:n.r2})):s+=Sn(i="linearGradient",{id:e,x1:n.x1,x2:n.x2,y1:n.y1,y2:n.y2}),t=0;t<r.length;++t)s+=Sn("stop",{offset:r[t].offset,"stop-color":r[t].color})+Ln("stop");s+=Ln(i)}for(e in o.clipping)n=o.clipping[e],s+=Sn("clipPath",{id:e}),n.path?s+=Sn("path",{d:n.path})+Ln("path"):s+=Sn("rect",{x:0,y:0,width:n.width,height:n.height})+Ln("rect"),s+=Ln("clipPath");return s.length>0?Sn("defs")+s+Ln("defs"):""},Zn.attributes=function(t,e){return Qn={},Array.isArray(t)?t.forEach(t=>t(ti,e,this)):t(ti,e,this),Qn},Zn.href=function(t){var e,n=this,i=t.href;if(i){if(e=n._hrefs&&n._hrefs[i])return e;n.sanitizeURL(i).then(t=>{t["xlink:href"]=t.href,t.href=null,(n._hrefs||(n._hrefs={}))[i]=t})}return null},Zn.mark=function(t){var n,i=this,r=je[t.marktype],o=r.tag,s=this._defs,a="";function l(l){var u=i.href(l);if(u&&(a+=Sn("a",u)),n="g"!==o?ei(l,t,o,s):null,a+=Sn(o,i.attributes([Cn,r.attr],l),n),"text"===o){const t=Oe(l);if(e.isArray(t)){const e={x:0,dy:Le(l)};for(let n=0;n<t.length;++n)a+=Sn("tspan",n?e:null)+ni(Ne(l,t[n]))+Ln("tspan")}else a+=ni(Ne(l,t))}else if("g"===o){const e=l.strokeForeground,n=l.fill,o=l.stroke;e&&o&&(l.stroke=null),a+=Sn("path",i.attributes(r.background,l),ei(l,t,"bgrect",s))+Ln("path"),a+=Sn("g",i.attributes(r.content,l))+i.markGroup(l)+Ln("g"),e&&o?(n&&(l.fill=null),l.stroke=o,a+=Sn("path",i.attributes(r.foreground,l),ei(l,t,"bgrect",s))+Ln("path"),n&&(l.fill=n)):a+=Sn("path",i.attributes(r.foreground,l),ei({},t,"bgfore",s))+Ln("path")}a+=Ln(o),u&&(a+=Ln("a"))}return"g"!==o&&!1===t.interactive&&(n='style="pointer-events: none;"'),a+=Sn("g",Object.assign({class:nn(t),"clip-path":t.clip?ne(i,t,t.group):null},Rn(t)),n),r.nested?t.items&&t.items.length&&l(t.items[0]):It(t,l),a+Ln("g")},Zn.markGroup=function(t){var e=this,n="";return It(t,(function(t){n+=e.mark(t)})),n};var ii={Canvas:"canvas",PNG:"png",SVG:"svg",None:"none"},ri={};function oi(t,e,n,i){if(function(t,e,n){return t.bounds&&e.intersects(t.bounds)&&("group"===t.marktype||!1!==t.interactive&&(!n||n(t)))}(t,e,n)){const r=t.items,o=t.marktype,s=r.length;let a=0;if("group"===o)for(;a<s;++a)si(r[a],e,n,i);else for(const t=je[o].isect;a<s;++a){let n=r[a];ai(n,e,t)&&i.push(n)}}return i}function si(t,e,n,i){n&&n(t.mark)&&ai(t,e,je.group.isect)&&i.push(t);const r=t.items,o=r&&r.length;if(o){const s=t.x||0,a=t.y||0;e.translate(-s,-a);for(let t=0;t<o;++t)oi(r[t],e,n,i);e.translate(s,a)}return i}function ai(t,e,n){const i=t.bounds;return e.encloses(i)||e.intersects(i)&&n(t,e)}ri.canvas=ri.png={renderer:pn,headless:pn,handler:cn},ri.svg={renderer:Dn,headless:Jn,handler:xn},ri.none={};var li=new a;function ui(t,n,i){return t===n||("path"===i?ci(t,n):t instanceof Date&&n instanceof Date?+t==+n:e.isNumber(t)&&e.isNumber(n)?Math.abs(t-n)<=1e-9:t&&n&&(e.isObject(t)||e.isObject(n))?null!=t&&null!=n&&function(t,e){var n,i,r=Object.keys(t),o=Object.keys(e);if(r.length!==o.length)return!1;for(r.sort(),o.sort(),i=r.length-1;i>=0;i--)if(r[i]!=o[i])return!1;for(i=r.length-1;i>=0;i--)if(n=r[i],!ui(t[n],e[n],n))return!1;return typeof t==typeof e}(t,n):t==n)}function ci(t,e){return ui(w(t),w(e))}t.Bounds=a,t.CanvasHandler=cn,t.CanvasRenderer=pn,t.Gradient=function(t,e){var n,i=[];return n={gradient:"linear",x1:t?t[0]:0,y1:t?t[1]:0,x2:e?e[0]:1,y2:e?e[1]:0,stops:i,stop:function(t,e){return i.push({offset:t,color:e}),n}}},t.GroupItem=g,t.Handler=on,t.Item=d,t.Marks=je,t.RenderType=ii,t.Renderer=ln,t.ResourceLoader=p,t.SVGHandler=xn,t.SVGRenderer=Dn,t.SVGStringRenderer=Jn,t.Scenegraph=Ye,t.boundClip=function(t){var n=t.clip;if(e.isFunction(n))n(dt(li.clear()));else{if(!n)return;li.set(0,0,t.group.width,t.group.height)}t.bounds.intersect(li)},t.boundContext=dt,t.boundItem=Ge,t.boundMark=Ue,t.boundStroke=lt,t.closeTag=Ln,t.domChild=tn,t.domClear=en,t.domCreate=Ze,t.domFind=Ke,t.font=De,t.fontFamily=qe,t.fontSize=Se,t.intersect=function(t,n,i){const r=[],o=(new a).union(n),s=t.marktype;return s?oi(t,o,i,r):"group"===s?si(t,o,i,r):e.error("Intersect scene must be mark node or group item.")},t.intersectBoxLine=Rt,t.intersectPath=Tt,t.intersectPoint=At,t.intersectRule=Ct,t.lineHeight=Le,t.multiLineOffset=function(t){const n=Oe(t);return(e.isArray(n)?n.length-1:0)*Le(t)},t.openTag=Sn,t.pathCurves=x,t.pathEqual=ci,t.pathParse=w,t.pathRectangle=F,t.pathRender=N,t.pathSymbols=I,t.pathTrail=$,t.point=rn,t.renderModule=function(t,e){return t=String(t||"").toLowerCase(),arguments.length>1?(ri[t]=e,this):ri[t]},t.resetSVGClipId=function(){ee=1},t.sceneEqual=ui,t.sceneFromJSON=$e,t.scenePickVisit=Bt,t.sceneToJSON=Fe,t.sceneVisit=It,t.sceneZOrder=Et,t.textMetrics=Ae,Object.defineProperty(t,"__esModule",{value:!0})}));
{
"name": "vega-scenegraph",
"version": "4.7.0",
"version": "4.7.1",
"description": "Vega scenegraph and renderers.",

@@ -29,3 +29,3 @@ "license": "BSD-3-Clause",

},
"gitHead": "35e31c5c6b54db9dc3a577b5adad8d15ec274d32"
"gitHead": "8001ba35d26da0ad99cadecad86a85e6cb416b85"
}

@@ -532,8 +532,8 @@ import Renderer from './Renderer';

// apply aria-specific properties
ariaItemAttributes(emit, item);
// apply svg attributes
mdef.attr(emit, item, this);
// apply aria-specific properties
ariaItemAttributes(emit, item, this);
// some marks need special treatment

@@ -540,0 +540,0 @@ var extra = mark_extras[mdef.type];

@@ -40,7 +40,7 @@ import {domainCaption, isDiscrete} from 'vega-scale';

desc: 'title',
caption: item => `Title text "${titleCaption(item)}"`
caption: item => `Title text '${titleCaption(item)}'`
},
'title-subtitle': {
desc: 'subtitle',
caption: item => `Subtitle text "${titleCaption(item)}"`
caption: item => `Subtitle text '${titleCaption(item)}'`
}

@@ -129,3 +129,3 @@ };

return `${xy}-axis`
+ (title ? ` titled "${title}"` : '')
+ (title ? ` titled '${title}'` : '')
+ ` for a ${isDiscrete(type) ? 'discrete' : type} scale`

@@ -144,3 +144,3 @@ + ` with ${domainCaption(scale, item)}`;

return capitalize(type)
+ (title ? ` titled "${title}"` : '')
+ (title ? ` titled '${title}'` : '')
+ ` for ${channelCaption(props)} with ${domainCaption(scale, item)}`;

@@ -147,0 +147,0 @@ }

@@ -13,2 +13,3 @@ /**

if (val != null) {
val = (val + '').replace(/"/g, '&quot;');
s += ' ' + key + '="' + val + '"';

@@ -15,0 +16,0 @@ }

Sorry, the diff of this file is too big to display

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc