@unovis/mcp 1.7.0-mcp.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +193 -0
- package/README.md +154 -0
- package/dist/cli.d.ts +2 -0
- package/dist/cli.js +109 -0
- package/dist/cli.js.map +1 -0
- package/dist/codegen/index.d.ts +14 -0
- package/dist/codegen/index.js +346 -0
- package/dist/codegen/index.js.map +1 -0
- package/dist/env/bbox.d.ts +13 -0
- package/dist/env/bbox.js +335 -0
- package/dist/env/bbox.js.map +1 -0
- package/dist/env/canvas.d.ts +9 -0
- package/dist/env/canvas.js +55 -0
- package/dist/env/canvas.js.map +1 -0
- package/dist/env/computed-style.d.ts +38 -0
- package/dist/env/computed-style.js +186 -0
- package/dist/env/computed-style.js.map +1 -0
- package/dist/env/fonts.d.ts +3 -0
- package/dist/env/fonts.js +103 -0
- package/dist/env/fonts.js.map +1 -0
- package/dist/env/index.d.ts +13 -0
- package/dist/env/index.js +121 -0
- package/dist/env/index.js.map +1 -0
- package/dist/env/raf-queue.d.ts +23 -0
- package/dist/env/raf-queue.js +51 -0
- package/dist/env/raf-queue.js.map +1 -0
- package/dist/env/size.d.ts +9 -0
- package/dist/env/size.js +30 -0
- package/dist/env/size.js.map +1 -0
- package/dist/html/document.d.ts +16 -0
- package/dist/html/document.js +95 -0
- package/dist/html/document.js.map +1 -0
- package/dist/index.d.ts +25 -0
- package/dist/index.js +18 -0
- package/dist/index.js.map +1 -0
- package/dist/recipes/area.d.ts +66 -0
- package/dist/recipes/area.js +76 -0
- package/dist/recipes/area.js.map +1 -0
- package/dist/recipes/bar.d.ts +67 -0
- package/dist/recipes/bar.js +69 -0
- package/dist/recipes/bar.js.map +1 -0
- package/dist/recipes/boxplot.d.ts +64 -0
- package/dist/recipes/boxplot.js +89 -0
- package/dist/recipes/boxplot.js.map +1 -0
- package/dist/recipes/chord.d.ts +41 -0
- package/dist/recipes/chord.js +72 -0
- package/dist/recipes/chord.js.map +1 -0
- package/dist/recipes/choropleth-regions.d.ts +49 -0
- package/dist/recipes/choropleth-regions.js +521 -0
- package/dist/recipes/choropleth-regions.js.map +1 -0
- package/dist/recipes/choropleth.d.ts +27 -0
- package/dist/recipes/choropleth.js +86 -0
- package/dist/recipes/choropleth.js.map +1 -0
- package/dist/recipes/donut.d.ts +25 -0
- package/dist/recipes/donut.js +51 -0
- package/dist/recipes/donut.js.map +1 -0
- package/dist/recipes/graph.d.ts +55 -0
- package/dist/recipes/graph.js +132 -0
- package/dist/recipes/graph.js.map +1 -0
- package/dist/recipes/heatmap.d.ts +21 -0
- package/dist/recipes/heatmap.js +79 -0
- package/dist/recipes/heatmap.js.map +1 -0
- package/dist/recipes/index.d.ts +5 -0
- package/dist/recipes/index.js +35 -0
- package/dist/recipes/index.js.map +1 -0
- package/dist/recipes/line.d.ts +69 -0
- package/dist/recipes/line.js +64 -0
- package/dist/recipes/line.js.map +1 -0
- package/dist/recipes/nested-donut.d.ts +22 -0
- package/dist/recipes/nested-donut.js +47 -0
- package/dist/recipes/nested-donut.js.map +1 -0
- package/dist/recipes/radial-bar.d.ts +25 -0
- package/dist/recipes/radial-bar.js +53 -0
- package/dist/recipes/radial-bar.js.map +1 -0
- package/dist/recipes/sankey.d.ts +41 -0
- package/dist/recipes/sankey.js +61 -0
- package/dist/recipes/sankey.js.map +1 -0
- package/dist/recipes/scatter.d.ts +68 -0
- package/dist/recipes/scatter.js +75 -0
- package/dist/recipes/scatter.js.map +1 -0
- package/dist/recipes/shared.d.ts +144 -0
- package/dist/recipes/shared.js +212 -0
- package/dist/recipes/shared.js.map +1 -0
- package/dist/recipes/timeline.d.ts +31 -0
- package/dist/recipes/timeline.js +123 -0
- package/dist/recipes/timeline.js.map +1 -0
- package/dist/recipes/treemap.d.ts +19 -0
- package/dist/recipes/treemap.js +43 -0
- package/dist/recipes/treemap.js.map +1 -0
- package/dist/recipes/types.d.ts +16 -0
- package/dist/recipes/types.js +2 -0
- package/dist/recipes/types.js.map +1 -0
- package/dist/render/headless.d.ts +62 -0
- package/dist/render/headless.js +158 -0
- package/dist/render/headless.js.map +1 -0
- package/dist/render/materialize.d.ts +35 -0
- package/dist/render/materialize.js +160 -0
- package/dist/render/materialize.js.map +1 -0
- package/dist/render/mutex.d.ts +9 -0
- package/dist/render/mutex.js +14 -0
- package/dist/render/mutex.js.map +1 -0
- package/dist/render/rasterize.d.ts +10 -0
- package/dist/render/rasterize.js +29 -0
- package/dist/render/rasterize.js.map +1 -0
- package/dist/render/renderer.d.ts +21 -0
- package/dist/render/renderer.js +66 -0
- package/dist/render/renderer.js.map +1 -0
- package/dist/render/spec.d.ts +95 -0
- package/dist/render/spec.js +15 -0
- package/dist/render/spec.js.map +1 -0
- package/dist/server.d.ts +4 -0
- package/dist/server.js +44 -0
- package/dist/server.js.map +1 -0
- package/dist/svg/collect-css.d.ts +14 -0
- package/dist/svg/collect-css.js +53 -0
- package/dist/svg/collect-css.js.map +1 -0
- package/dist/svg/css-vars.d.ts +17 -0
- package/dist/svg/css-vars.js +64 -0
- package/dist/svg/css-vars.js.map +1 -0
- package/dist/svg/header.d.ts +8 -0
- package/dist/svg/header.js +81 -0
- package/dist/svg/header.js.map +1 -0
- package/dist/svg/ids.d.ts +12 -0
- package/dist/svg/ids.js +94 -0
- package/dist/svg/ids.js.map +1 -0
- package/dist/svg/postprocess.d.ts +41 -0
- package/dist/svg/postprocess.js +135 -0
- package/dist/svg/postprocess.js.map +1 -0
- package/dist/tools/register.d.ts +12 -0
- package/dist/tools/register.js +127 -0
- package/dist/tools/register.js.map +1 -0
- package/dist/widget/bundle.js +1777 -0
- package/dist/widget/bundle.meta.json +3 -0
- package/dist/widget/entry.d.ts +34 -0
- package/dist/widget/entry.js +118 -0
- package/dist/widget/entry.js.map +1 -0
- package/dist/widget/interactions.d.ts +14 -0
- package/dist/widget/interactions.js +151 -0
- package/dist/widget/interactions.js.map +1 -0
- package/dist/widget/unovis-slim.d.ts +33 -0
- package/dist/widget/unovis-slim.js +34 -0
- package/dist/widget/unovis-slim.js.map +1 -0
- package/docs/README.md +56 -0
- package/docs/architecture.md +158 -0
- package/docs/chart-spec.md +148 -0
- package/docs/getting-started.md +175 -0
- package/docs/interactive.md +125 -0
- package/docs/output-types.md +170 -0
- package/docs/programmatic.md +234 -0
- package/docs/tools.md +273 -0
- package/docs/troubleshooting.md +140 -0
- package/fonts/README.md +19 -0
- package/package.json +73 -0
|
@@ -0,0 +1,1777 @@
|
|
|
1
|
+
"use strict";(()=>{var L3=Object.create;var Iv=Object.defineProperty;var E3=Object.getOwnPropertyDescriptor;var M3=Object.getOwnPropertyNames;var R3=Object.getPrototypeOf,P3=Object.prototype.hasOwnProperty;var C=(t,e)=>()=>(t&&(e=t(t=0)),e);var I3=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports),Wt=(t,e)=>{for(var n in e)Iv(t,n,{get:e[n],enumerable:!0})},N3=(t,e,n,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let o of M3(e))!P3.call(t,o)&&o!==n&&Iv(t,o,{get:()=>e[o],enumerable:!(r=E3(e,o))||r.enumerable});return t};var $3=(t,e,n)=>(n=t!=null?L3(R3(t)):{},N3(e||!t||!t.__esModule?Iv(n,"default",{value:t,enumerable:!0}):n,t));function VL(){for(var t=0,e=arguments.length,n={},r;t<e;++t){if(!(r=arguments[t]+"")||r in n||/[\s.]/.test(r))throw new Error("illegal type: "+r);n[r]=[]}return new cm(n)}function cm(t){this._=t}function $6(t,e){return t.trim().split(/^|\s+/).map(function(n){var r="",o=n.indexOf(".");if(o>=0&&(r=n.slice(o+1),n=n.slice(0,o)),n&&!e.hasOwnProperty(n))throw new Error("unknown type: "+n);return{type:n,name:r}})}function D6(t,e){for(var n=0,r=t.length,o;n<r;++n)if((o=t[n]).name===e)return o.value}function WL(t,e,n){for(var r=0,o=t.length;r<o;++r)if(t[r].name===e){t[r]=N6,t=t.slice(0,r).concat(t.slice(r+1));break}return n!=null&&t.push({name:e,value:n}),t}var N6,Vr,HL=C(()=>{N6={value:()=>{}};cm.prototype=VL.prototype={constructor:cm,on:function(t,e){var n=this._,r=$6(t+"",n),o,i=-1,a=r.length;if(arguments.length<2){for(;++i<a;)if((o=(t=r[i]).type)&&(o=D6(n[o],t.name)))return o;return}if(e!=null&&typeof e!="function")throw new Error("invalid callback: "+e);for(;++i<a;)if(o=(t=r[i]).type)n[o]=WL(n[o],t.name,e);else if(e==null)for(o in n)n[o]=WL(n[o],t.name,null);return this},copy:function(){var t={},e=this._;for(var n in e)t[n]=e[n].slice();return new cm(t)},call:function(t,e){if((o=arguments.length-2)>0)for(var n=new Array(o),r=0,o,i;r<o;++r)n[r]=arguments[r+2];if(!this._.hasOwnProperty(t))throw new Error("unknown type: "+t);for(i=this._[t],r=0,o=i.length;r<o;++r)i[r].value.apply(e,n)},apply:function(t,e,n){if(!this._.hasOwnProperty(t))throw new Error("unknown type: "+t);for(var r=this._[t],o=0,i=r.length;o<i;++o)r[o].value.apply(e,n)}};Vr=VL});var Ml=C(()=>{HL()});function os(){return ns||(UL(O6),ns=df.now()+dm)}function O6(){ns=0}function rs(){this._call=this._time=this._next=null}function Pl(t,e,n){var r=new rs;return r.restart(t,e,n),r}function qL(){os(),++Rl;for(var t=um,e;t;)(e=ns-t._time)>=0&&t._call.call(void 0,e),t=t._next;--Rl}function jL(){ns=(fm=df.now())+dm,Rl=uf=0;try{qL()}finally{Rl=0,B6(),ns=0}}function z6(){var t=df.now(),e=t-fm;e>YL&&(dm-=e,fm=t)}function B6(){for(var t,e=um,n,r=1/0;e;)e._call?(r>e._time&&(r=e._time),t=e,e=e._next):(n=e._next,e._next=null,e=t?t._next=n:um=n);ff=t,t_(r)}function t_(t){if(!Rl){uf&&(uf=clearTimeout(uf));var e=t-ns;e>24?(t<1/0&&(uf=setTimeout(jL,t-df.now()-dm)),cf&&(cf=clearInterval(cf))):(cf||(fm=df.now(),cf=setInterval(z6,YL)),Rl=1,UL(jL))}}var Rl,uf,cf,YL,um,ff,fm,ns,dm,df,UL,hm=C(()=>{Rl=0,uf=0,cf=0,YL=1e3,fm=0,ns=0,dm=0,df=typeof performance=="object"&&performance.now?performance:Date,UL=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(t){setTimeout(t,17)};rs.prototype=Pl.prototype={constructor:rs,restart:function(t,e,n){if(typeof t!="function")throw new TypeError("callback is not a function");n=(n==null?os():+n)+(e==null?0:+e),!this._next&&ff!==this&&(ff?ff._next=this:um=this,ff=this),this._call=t,this._time=n,t_()},stop:function(){this._call&&(this._call=null,this._time=1/0,t_())}}});function Il(t,e,n){var r=new rs;return e=e==null?0:+e,r.restart(o=>{r.stop(),t(o+e)},e,n),r}var XL=C(()=>{hm()});function e_(t,e,n){var r=new rs,o=e;return e==null?(r.restart(t,e,n),r):(r._restart=r.restart,r.restart=function(i,a,s){a=+a,s=s==null?os():+s,r._restart(function l(c){c+=o,r._restart(l,o+=a,s),i(c)},a,s)},r.restart(t,e,n),r)}var ZL=C(()=>{hm()});var Nl=C(()=>{hm();XL();ZL()});var $I=I3((NI,P0)=>{"use strict";(function(t){if(typeof e!="function"){var e=function(h){return h};e.nonNative=!0}let n=e("plaintext"),r=e("html"),o=e("comment"),i=/<(\w*)>/g,a=/<\/?([^\s\/>]+)/;function s(h,p,g){h=h||"",p=p||[],g=g||"";let m=c(p,g);return u(h,m)}function l(h,p){h=h||[],p=p||"";let g=c(h,p);return function(x){return u(x||"",g)}}s.init_streaming_mode=l;function c(h,p){return h=f(h),{allowable_tags:h,tag_replacement:p,state:n,tag_buffer:"",depth:0,in_quote_char:""}}function u(h,p){if(typeof h!="string")throw new TypeError("'html' parameter must be a string");let g=p.allowable_tags,m=p.tag_replacement,x=p.state,y=p.tag_buffer,_=p.depth,v=p.in_quote_char,b="";for(let w=0,A=h.length;w<A;w++){let L=h[w];if(x===n)switch(L){case"<":x=r,y+=L;break;default:b+=L;break}else if(x===r)switch(L){case"<":if(v)break;_++;break;case">":if(v)break;if(_){_--;break}v="",x=n,y+=">",g.has(d(y))?b+=y:b+=m,y="";break;case'"':case"'":L===v?v="":v=v||L,y+=L;break;case"-":y==="<!-"&&(x=o),y+=L;break;case" ":case`
|
|
2
|
+
`:if(y==="<"){x=n,b+="< ",y="";break}y+=L;break;default:y+=L;break}else if(x===o)switch(L){case">":y.slice(-2)=="--"&&(x=n),y="";break;default:y+=L;break}}return p.state=x,p.tag_buffer=y,p.depth=_,p.in_quote_char=v,b}function f(h){let p=new Set;if(typeof h=="string"){let g;for(;g=i.exec(h);)p.add(g[1])}else!e.nonNative&&typeof h[e.iterator]=="function"?p=new Set(h):typeof h.forEach=="function"&&h.forEach(p.add,p);return p}function d(h){let p=a.exec(h);return p?p[1].toLowerCase():null}typeof define=="function"&&define.amd?define(function(){return s}):typeof P0=="object"&&P0.exports?P0.exports=s:t.striptags=s})(NI)});function fY(t,e,n,r){var o=-1,i=t==null?0:t.length;for(r&&i&&(n=t[++o]);++o<i;)n=e(n,t[o],o,t);return n}var iN,aN=C(()=>{iN=fY});function dY(t){return function(e,n,r){for(var o=-1,i=Object(e),a=r(e),s=a.length;s--;){var l=a[t?s:++o];if(n(i[l],l,i)===!1)break}return e}}var sN,lN=C(()=>{sN=dY});var hY,G0,Ok=C(()=>{lN();hY=sN(),G0=hY});function pY(t,e){for(var n=-1,r=Array(t);++n<t;)r[n]=e(n);return r}var cN,uN=C(()=>{cN=pY});var mY,W0,zk=C(()=>{mY=typeof global=="object"&&global&&global.Object===Object&&global,W0=mY});var gY,xY,Ht,_n=C(()=>{zk();gY=typeof self=="object"&&self&&self.Object===Object&&self,xY=W0||gY||Function("return this")(),Ht=xY});var vY,rn,Es=C(()=>{_n();vY=Ht.Symbol,rn=vY});function bY(t){var e=yY.call(t,hh),n=t[hh];try{t[hh]=void 0;var r=!0}catch{}var o=_Y.call(t);return r&&(e?t[hh]=n:delete t[hh]),o}var fN,yY,_Y,hh,dN,hN=C(()=>{Es();fN=Object.prototype,yY=fN.hasOwnProperty,_Y=fN.toString,hh=rn?rn.toStringTag:void 0;dN=bY});function SY(t){return kY.call(t)}var wY,kY,pN,mN=C(()=>{wY=Object.prototype,kY=wY.toString;pN=SY});function TY(t){return t==null?t===void 0?AY:CY:gN&&gN in Object(t)?dN(t):pN(t)}var CY,AY,gN,Pn,aa=C(()=>{Es();hN();mN();CY="[object Null]",AY="[object Undefined]",gN=rn?rn.toStringTag:void 0;Pn=TY});function LY(t){return t!=null&&typeof t=="object"}var be,Lr=C(()=>{be=LY});function MY(t){return be(t)&&Pn(t)==EY}var EY,Bk,xN=C(()=>{aa();Lr();EY="[object Arguments]";Bk=MY});var vN,RY,PY,IY,Qr,Ec=C(()=>{xN();Lr();vN=Object.prototype,RY=vN.hasOwnProperty,PY=vN.propertyIsEnumerable,IY=Bk((function(){return arguments})())?Bk:function(t){return be(t)&&RY.call(t,"callee")&&!PY.call(t,"callee")},Qr=IY});var NY,Ct,Re=C(()=>{NY=Array.isArray,Ct=NY});function $Y(){return!1}var yN,_N=C(()=>{yN=$Y});var kN,bN,DY,wN,OY,zY,ir,Ms=C(()=>{_n();_N();kN=typeof exports=="object"&&exports&&!exports.nodeType&&exports,bN=kN&&typeof module=="object"&&module&&!module.nodeType&&module,DY=bN&&bN.exports===kN,wN=DY?Ht.Buffer:void 0,OY=wN?wN.isBuffer:void 0,zY=OY||yN,ir=zY});function GY(t,e){var n=typeof t;return e=e??BY,!!e&&(n=="number"||n!="symbol"&&FY.test(t))&&t>-1&&t%1==0&&t<e}var BY,FY,$o,Mc=C(()=>{BY=9007199254740991,FY=/^(?:0|[1-9]\d*)$/;$o=GY});function VY(t){return typeof t=="number"&&t>-1&&t%1==0&&t<=WY}var WY,Rc,V0=C(()=>{WY=9007199254740991;Rc=VY});function p8(t){return be(t)&&Rc(t.length)&&!!pe[Pn(t)]}var HY,jY,YY,UY,qY,XY,ZY,KY,QY,JY,t8,e8,n8,r8,o8,i8,a8,s8,l8,c8,u8,f8,d8,h8,pe,SN,CN=C(()=>{aa();V0();Lr();HY="[object Arguments]",jY="[object Array]",YY="[object Boolean]",UY="[object Date]",qY="[object Error]",XY="[object Function]",ZY="[object Map]",KY="[object Number]",QY="[object Object]",JY="[object RegExp]",t8="[object Set]",e8="[object String]",n8="[object WeakMap]",r8="[object ArrayBuffer]",o8="[object DataView]",i8="[object Float32Array]",a8="[object Float64Array]",s8="[object Int8Array]",l8="[object Int16Array]",c8="[object Int32Array]",u8="[object Uint8Array]",f8="[object Uint8ClampedArray]",d8="[object Uint16Array]",h8="[object Uint32Array]",pe={};pe[i8]=pe[a8]=pe[s8]=pe[l8]=pe[c8]=pe[u8]=pe[f8]=pe[d8]=pe[h8]=!0;pe[HY]=pe[jY]=pe[r8]=pe[YY]=pe[o8]=pe[UY]=pe[qY]=pe[XY]=pe[ZY]=pe[KY]=pe[QY]=pe[JY]=pe[t8]=pe[e8]=pe[n8]=!1;SN=p8});function m8(t){return function(e){return t(e)}}var sa,ph=C(()=>{sa=m8});var AN,mh,g8,Fk,x8,xi,H0=C(()=>{zk();AN=typeof exports=="object"&&exports&&!exports.nodeType&&exports,mh=AN&&typeof module=="object"&&module&&!module.nodeType&&module,g8=mh&&mh.exports===AN,Fk=g8&&W0.process,x8=(function(){try{var t=mh&&mh.require&&mh.require("util").types;return t||Fk&&Fk.binding&&Fk.binding("util")}catch{}})(),xi=x8});var TN,v8,Do,Pc=C(()=>{CN();ph();H0();TN=xi&&xi.isTypedArray,v8=TN?sa(TN):SN,Do=v8});function b8(t,e){var n=Ct(t),r=!n&&Qr(t),o=!n&&!r&&ir(t),i=!n&&!r&&!o&&Do(t),a=n||r||o||i,s=a?cN(t.length,String):[],l=s.length;for(var c in t)(e||_8.call(t,c))&&!(a&&(c=="length"||o&&(c=="offset"||c=="parent")||i&&(c=="buffer"||c=="byteLength"||c=="byteOffset")||$o(c,l)))&&s.push(c);return s}var y8,_8,j0,Gk=C(()=>{uN();Ec();Re();Ms();Mc();Pc();y8=Object.prototype,_8=y8.hasOwnProperty;j0=b8});function k8(t){var e=t&&t.constructor,n=typeof e=="function"&&e.prototype||w8;return t===n}var w8,la,gh=C(()=>{w8=Object.prototype;la=k8});function S8(t,e){return function(n){return t(e(n))}}var Y0,Wk=C(()=>{Y0=S8});var C8,LN,EN=C(()=>{Wk();C8=Y0(Object.keys,Object),LN=C8});function L8(t){if(!la(t))return LN(t);var e=[];for(var n in Object(t))T8.call(t,n)&&n!="constructor"&&e.push(n);return e}var A8,T8,Ic,U0=C(()=>{gh();EN();A8=Object.prototype,T8=A8.hasOwnProperty;Ic=L8});function E8(t){var e=typeof t;return t!=null&&(e=="object"||e=="function")}var Kt,Wn=C(()=>{Kt=E8});function N8(t){if(!Kt(t))return!1;var e=Pn(t);return e==R8||e==P8||e==M8||e==I8}var M8,R8,P8,I8,Jr,Nc=C(()=>{aa();Wn();M8="[object AsyncFunction]",R8="[object Function]",P8="[object GeneratorFunction]",I8="[object Proxy]";Jr=N8});function $8(t){return t!=null&&Rc(t.length)&&!Jr(t)}var on,Oo=C(()=>{Nc();V0();on=$8});function D8(t){return on(t)?j0(t):Ic(t)}var we,zo=C(()=>{Gk();U0();Oo();we=D8});function O8(t,e){return t&&G0(t,e,we)}var $c,q0=C(()=>{Ok();zo();$c=O8});function z8(t,e){return function(n,r){if(n==null)return n;if(!on(n))return t(n,r);for(var o=n.length,i=e?o:-1,a=Object(n);(e?i--:++i<o)&&r(a[i],i,a)!==!1;);return n}}var MN,RN=C(()=>{Oo();MN=z8});var B8,ca,xh=C(()=>{q0();RN();B8=MN($c),ca=B8});function F8(){this.__data__=[],this.size=0}var PN,IN=C(()=>{PN=F8});function G8(t,e){return t===e||t!==t&&e!==e}var Er,Rs=C(()=>{Er=G8});function W8(t,e){for(var n=t.length;n--;)if(Er(t[n][0],e))return n;return-1}var ua,vh=C(()=>{Rs();ua=W8});function j8(t){var e=this.__data__,n=ua(e,t);if(n<0)return!1;var r=e.length-1;return n==r?e.pop():H8.call(e,n,1),--this.size,!0}var V8,H8,NN,$N=C(()=>{vh();V8=Array.prototype,H8=V8.splice;NN=j8});function Y8(t){var e=this.__data__,n=ua(e,t);return n<0?void 0:e[n][1]}var DN,ON=C(()=>{vh();DN=Y8});function U8(t){return ua(this.__data__,t)>-1}var zN,BN=C(()=>{vh();zN=U8});function q8(t,e){var n=this.__data__,r=ua(n,t);return r<0?(++this.size,n.push([t,e])):n[r][1]=e,this}var FN,GN=C(()=>{vh();FN=q8});function Dc(t){var e=-1,n=t==null?0:t.length;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}var fa,yh=C(()=>{IN();$N();ON();BN();GN();Dc.prototype.clear=PN;Dc.prototype.delete=NN;Dc.prototype.get=DN;Dc.prototype.has=zN;Dc.prototype.set=FN;fa=Dc});function X8(){this.__data__=new fa,this.size=0}var WN,VN=C(()=>{yh();WN=X8});function Z8(t){var e=this.__data__,n=e.delete(t);return this.size=e.size,n}var HN,jN=C(()=>{HN=Z8});function K8(t){return this.__data__.get(t)}var YN,UN=C(()=>{YN=K8});function Q8(t){return this.__data__.has(t)}var qN,XN=C(()=>{qN=Q8});var J8,X0,ZN=C(()=>{_n();J8=Ht["__core-js_shared__"],X0=J8});function tU(t){return!!KN&&KN in t}var KN,QN,JN=C(()=>{ZN();KN=(function(){var t=/[^.]+$/.exec(X0&&X0.keys&&X0.keys.IE_PROTO||"");return t?"Symbol(src)_1."+t:""})();QN=tU});function rU(t){if(t!=null){try{return nU.call(t)}catch{}try{return t+""}catch{}}return""}var eU,nU,vi,Vk=C(()=>{eU=Function.prototype,nU=eU.toString;vi=rU});function fU(t){if(!Kt(t)||QN(t))return!1;var e=Jr(t)?uU:iU;return e.test(vi(t))}var oU,iU,aU,sU,lU,cU,uU,t$,e$=C(()=>{Nc();JN();Wn();Vk();oU=/[\\^$.*+?()[\]{}|]/g,iU=/^\[object .+?Constructor\]$/,aU=Function.prototype,sU=Object.prototype,lU=aU.toString,cU=sU.hasOwnProperty,uU=RegExp("^"+lU.call(cU).replace(oU,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");t$=fU});function dU(t,e){return t?.[e]}var n$,r$=C(()=>{n$=dU});function hU(t,e){var n=n$(t,e);return t$(n)?n:void 0}var Vn,da=C(()=>{e$();r$();Vn=hU});var pU,ha,Z0=C(()=>{da();_n();pU=Vn(Ht,"Map"),ha=pU});var mU,yi,_h=C(()=>{da();mU=Vn(Object,"create"),yi=mU});function gU(){this.__data__=yi?yi(null):{},this.size=0}var o$,i$=C(()=>{_h();o$=gU});function xU(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e}var a$,s$=C(()=>{a$=xU});function bU(t){var e=this.__data__;if(yi){var n=e[t];return n===vU?void 0:n}return _U.call(e,t)?e[t]:void 0}var vU,yU,_U,l$,c$=C(()=>{_h();vU="__lodash_hash_undefined__",yU=Object.prototype,_U=yU.hasOwnProperty;l$=bU});function SU(t){var e=this.__data__;return yi?e[t]!==void 0:kU.call(e,t)}var wU,kU,u$,f$=C(()=>{_h();wU=Object.prototype,kU=wU.hasOwnProperty;u$=SU});function AU(t,e){var n=this.__data__;return this.size+=this.has(t)?0:1,n[t]=yi&&e===void 0?CU:e,this}var CU,d$,h$=C(()=>{_h();CU="__lodash_hash_undefined__";d$=AU});function Oc(t){var e=-1,n=t==null?0:t.length;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}var Hk,p$=C(()=>{i$();s$();c$();f$();h$();Oc.prototype.clear=o$;Oc.prototype.delete=a$;Oc.prototype.get=l$;Oc.prototype.has=u$;Oc.prototype.set=d$;Hk=Oc});function TU(){this.size=0,this.__data__={hash:new Hk,map:new(ha||fa),string:new Hk}}var m$,g$=C(()=>{p$();yh();Z0();m$=TU});function LU(t){var e=typeof t;return e=="string"||e=="number"||e=="symbol"||e=="boolean"?t!=="__proto__":t===null}var x$,v$=C(()=>{x$=LU});function EU(t,e){var n=t.__data__;return x$(e)?n[typeof e=="string"?"string":"hash"]:n.map}var pa,bh=C(()=>{v$();pa=EU});function MU(t){var e=pa(this,t).delete(t);return this.size-=e?1:0,e}var y$,_$=C(()=>{bh();y$=MU});function RU(t){return pa(this,t).get(t)}var b$,w$=C(()=>{bh();b$=RU});function PU(t){return pa(this,t).has(t)}var k$,S$=C(()=>{bh();k$=PU});function IU(t,e){var n=pa(this,t),r=n.size;return n.set(t,e),this.size+=n.size==r?0:1,this}var C$,A$=C(()=>{bh();C$=IU});function zc(t){var e=-1,n=t==null?0:t.length;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}var Ps,K0=C(()=>{g$();_$();w$();S$();A$();zc.prototype.clear=m$;zc.prototype.delete=y$;zc.prototype.get=b$;zc.prototype.has=k$;zc.prototype.set=C$;Ps=zc});function $U(t,e){var n=this.__data__;if(n instanceof fa){var r=n.__data__;if(!ha||r.length<NU-1)return r.push([t,e]),this.size=++n.size,this;n=this.__data__=new Ps(r)}return n.set(t,e),this.size=n.size,this}var NU,T$,L$=C(()=>{yh();Z0();K0();NU=200;T$=$U});function Bc(t){var e=this.__data__=new fa(t);this.size=e.size}var Bo,wh=C(()=>{yh();VN();jN();UN();XN();L$();Bc.prototype.clear=WN;Bc.prototype.delete=HN;Bc.prototype.get=YN;Bc.prototype.has=qN;Bc.prototype.set=T$;Bo=Bc});function OU(t){return this.__data__.set(t,DU),this}var DU,E$,M$=C(()=>{DU="__lodash_hash_undefined__";E$=OU});function zU(t){return this.__data__.has(t)}var R$,P$=C(()=>{R$=zU});function Q0(t){var e=-1,n=t==null?0:t.length;for(this.__data__=new Ps;++e<n;)this.add(t[e])}var J0,jk=C(()=>{K0();M$();P$();Q0.prototype.add=Q0.prototype.push=E$;Q0.prototype.has=R$;J0=Q0});function BU(t,e){for(var n=-1,r=t==null?0:t.length;++n<r;)if(e(t[n],n,t))return!0;return!1}var I$,N$=C(()=>{I$=BU});function FU(t,e){return t.has(e)}var tx,Yk=C(()=>{tx=FU});function VU(t,e,n,r,o,i){var a=n&GU,s=t.length,l=e.length;if(s!=l&&!(a&&l>s))return!1;var c=i.get(t),u=i.get(e);if(c&&u)return c==e&&u==t;var f=-1,d=!0,h=n&WU?new J0:void 0;for(i.set(t,e),i.set(e,t);++f<s;){var p=t[f],g=e[f];if(r)var m=a?r(g,p,f,e,t,i):r(p,g,f,t,e,i);if(m!==void 0){if(m)continue;d=!1;break}if(h){if(!I$(e,function(x,y){if(!tx(h,y)&&(p===x||o(p,x,n,r,i)))return h.push(y)})){d=!1;break}}else if(!(p===g||o(p,g,n,r,i))){d=!1;break}}return i.delete(t),i.delete(e),d}var GU,WU,ex,Uk=C(()=>{jk();N$();Yk();GU=1,WU=2;ex=VU});var HU,Fc,qk=C(()=>{_n();HU=Ht.Uint8Array,Fc=HU});function jU(t){var e=-1,n=Array(t.size);return t.forEach(function(r,o){n[++e]=[o,r]}),n}var nx,Xk=C(()=>{nx=jU});function YU(t){var e=-1,n=Array(t.size);return t.forEach(function(r){n[++e]=r}),n}var Gc,rx=C(()=>{Gc=YU});function aq(t,e,n,r,o,i,a){switch(n){case iq:if(t.byteLength!=e.byteLength||t.byteOffset!=e.byteOffset)return!1;t=t.buffer,e=e.buffer;case oq:return!(t.byteLength!=e.byteLength||!i(new Fc(t),new Fc(e)));case XU:case ZU:case JU:return Er(+t,+e);case KU:return t.name==e.name&&t.message==e.message;case tq:case nq:return t==e+"";case QU:var s=nx;case eq:var l=r&UU;if(s||(s=Gc),t.size!=e.size&&!l)return!1;var c=a.get(t);if(c)return c==e;r|=qU,a.set(t,e);var u=ex(s(t),s(e),r,o,i,a);return a.delete(t),u;case rq:if(Zk)return Zk.call(t)==Zk.call(e)}return!1}var UU,qU,XU,ZU,KU,QU,JU,tq,eq,nq,rq,oq,iq,$$,Zk,D$,O$=C(()=>{Es();qk();Rs();Uk();Xk();rx();UU=1,qU=2,XU="[object Boolean]",ZU="[object Date]",KU="[object Error]",QU="[object Map]",JU="[object Number]",tq="[object RegExp]",eq="[object Set]",nq="[object String]",rq="[object Symbol]",oq="[object ArrayBuffer]",iq="[object DataView]",$$=rn?rn.prototype:void 0,Zk=$$?$$.valueOf:void 0;D$=aq});function sq(t,e){for(var n=-1,r=e.length,o=t.length;++n<r;)t[o+n]=e[n];return t}var Wc,ox=C(()=>{Wc=sq});function lq(t,e,n){var r=e(t);return Ct(t)?r:Wc(r,n(t))}var ix,Kk=C(()=>{ox();Re();ix=lq});function cq(t,e){for(var n=-1,r=t==null?0:t.length,o=0,i=[];++n<r;){var a=t[n];e(a,n,t)&&(i[o++]=a)}return i}var ax,Qk=C(()=>{ax=cq});function uq(){return[]}var sx,Jk=C(()=>{sx=uq});var fq,dq,z$,hq,Vc,lx=C(()=>{Qk();Jk();fq=Object.prototype,dq=fq.propertyIsEnumerable,z$=Object.getOwnPropertySymbols,hq=z$?function(t){return t==null?[]:(t=Object(t),ax(z$(t),function(e){return dq.call(t,e)}))}:sx,Vc=hq});function pq(t){return ix(t,we,Vc)}var kh,tS=C(()=>{Kk();lx();zo();kh=pq});function vq(t,e,n,r,o,i){var a=n&mq,s=kh(t),l=s.length,c=kh(e),u=c.length;if(l!=u&&!a)return!1;for(var f=l;f--;){var d=s[f];if(!(a?d in e:xq.call(e,d)))return!1}var h=i.get(t),p=i.get(e);if(h&&p)return h==e&&p==t;var g=!0;i.set(t,e),i.set(e,t);for(var m=a;++f<l;){d=s[f];var x=t[d],y=e[d];if(r)var _=a?r(y,x,d,e,t,i):r(x,y,d,t,e,i);if(!(_===void 0?x===y||o(x,y,n,r,i):_)){g=!1;break}m||(m=d=="constructor")}if(g&&!m){var v=t.constructor,b=e.constructor;v!=b&&"constructor"in t&&"constructor"in e&&!(typeof v=="function"&&v instanceof v&&typeof b=="function"&&b instanceof b)&&(g=!1)}return i.delete(t),i.delete(e),g}var mq,gq,xq,B$,F$=C(()=>{tS();mq=1,gq=Object.prototype,xq=gq.hasOwnProperty;B$=vq});var yq,cx,G$=C(()=>{da();_n();yq=Vn(Ht,"DataView"),cx=yq});var _q,ux,W$=C(()=>{da();_n();_q=Vn(Ht,"Promise"),ux=_q});var bq,ma,eS=C(()=>{da();_n();bq=Vn(Ht,"Set"),ma=bq});var wq,Is,nS=C(()=>{da();_n();wq=Vn(Ht,"WeakMap"),Is=wq});var V$,kq,H$,j$,Y$,U$,Sq,Cq,Aq,Tq,Lq,Ns,In,ga=C(()=>{G$();Z0();W$();eS();nS();aa();Vk();V$="[object Map]",kq="[object Object]",H$="[object Promise]",j$="[object Set]",Y$="[object WeakMap]",U$="[object DataView]",Sq=vi(cx),Cq=vi(ha),Aq=vi(ux),Tq=vi(ma),Lq=vi(Is),Ns=Pn;(cx&&Ns(new cx(new ArrayBuffer(1)))!=U$||ha&&Ns(new ha)!=V$||ux&&Ns(ux.resolve())!=H$||ma&&Ns(new ma)!=j$||Is&&Ns(new Is)!=Y$)&&(Ns=function(t){var e=Pn(t),n=e==kq?t.constructor:void 0,r=n?vi(n):"";if(r)switch(r){case Sq:return U$;case Cq:return V$;case Aq:return H$;case Tq:return j$;case Lq:return Y$}return e});In=Ns});function Rq(t,e,n,r,o,i){var a=Ct(t),s=Ct(e),l=a?X$:In(t),c=s?X$:In(e);l=l==q$?fx:l,c=c==q$?fx:c;var u=l==fx,f=c==fx,d=l==c;if(d&&ir(t)){if(!ir(e))return!1;a=!0,u=!1}if(d&&!u)return i||(i=new Bo),a||Do(t)?ex(t,e,n,r,o,i):D$(t,e,l,n,r,o,i);if(!(n&Eq)){var h=u&&Z$.call(t,"__wrapped__"),p=f&&Z$.call(e,"__wrapped__");if(h||p){var g=h?t.value():t,m=p?e.value():e;return i||(i=new Bo),o(g,m,n,r,i)}}return d?(i||(i=new Bo),B$(t,e,n,r,o,i)):!1}var Eq,q$,X$,fx,Mq,Z$,K$,Q$=C(()=>{wh();Uk();O$();F$();ga();Re();Ms();Pc();Eq=1,q$="[object Arguments]",X$="[object Array]",fx="[object Object]",Mq=Object.prototype,Z$=Mq.hasOwnProperty;K$=Rq});function J$(t,e,n,r,o){return t===e?!0:t==null||e==null||!be(t)&&!be(e)?t!==t&&e!==e:K$(t,e,n,r,J$,o)}var dx,rS=C(()=>{Q$();Lr();dx=J$});function Nq(t,e,n,r){var o=n.length,i=o,a=!r;if(t==null)return!i;for(t=Object(t);o--;){var s=n[o];if(a&&s[2]?s[1]!==t[s[0]]:!(s[0]in t))return!1}for(;++o<i;){s=n[o];var l=s[0],c=t[l],u=s[1];if(a&&s[2]){if(c===void 0&&!(l in t))return!1}else{var f=new Bo;if(r)var d=r(c,u,l,t,e,f);if(!(d===void 0?dx(u,c,Pq|Iq,r,f):d))return!1}}return!0}var Pq,Iq,tD,eD=C(()=>{wh();rS();Pq=1,Iq=2;tD=Nq});function $q(t){return t===t&&!Kt(t)}var hx,oS=C(()=>{Wn();hx=$q});function Dq(t){for(var e=we(t),n=e.length;n--;){var r=e[n],o=t[r];e[n]=[r,o,hx(o)]}return e}var nD,rD=C(()=>{oS();zo();nD=Dq});function Oq(t,e){return function(n){return n==null?!1:n[t]===e&&(e!==void 0||t in Object(n))}}var px,iS=C(()=>{px=Oq});function zq(t){var e=nD(t);return e.length==1&&e[0][2]?px(e[0][0],e[0][1]):function(n){return n===t||tD(n,t,e)}}var oD,iD=C(()=>{eD();rD();iS();oD=zq});function Fq(t){return typeof t=="symbol"||be(t)&&Pn(t)==Bq}var Bq,ar,$s=C(()=>{aa();Lr();Bq="[object Symbol]";ar=Fq});function Vq(t,e){if(Ct(t))return!1;var n=typeof t;return n=="number"||n=="symbol"||n=="boolean"||t==null||ar(t)?!0:Wq.test(t)||!Gq.test(t)||e!=null&&t in Object(e)}var Gq,Wq,Hc,mx=C(()=>{Re();$s();Gq=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Wq=/^\w*$/;Hc=Vq});function aS(t,e){if(typeof t!="function"||e!=null&&typeof e!="function")throw new TypeError(Hq);var n=function(){var r=arguments,o=e?e.apply(this,r):r[0],i=n.cache;if(i.has(o))return i.get(o);var a=t.apply(this,r);return n.cache=i.set(o,a)||i,a};return n.cache=new(aS.Cache||Ps),n}var Hq,aD,sD=C(()=>{K0();Hq="Expected a function";aS.Cache=Ps;aD=aS});function Yq(t){var e=aD(t,function(r){return n.size===jq&&n.clear(),r}),n=e.cache;return e}var jq,lD,cD=C(()=>{sD();jq=500;lD=Yq});var Uq,qq,Xq,uD,fD=C(()=>{cD();Uq=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,qq=/\\(\\)?/g,Xq=lD(function(t){var e=[];return t.charCodeAt(0)===46&&e.push(""),t.replace(Uq,function(n,r,o,i){e.push(o?i.replace(qq,"$1"):r||n)}),e}),uD=Xq});function Zq(t,e){for(var n=-1,r=t==null?0:t.length,o=Array(r);++n<r;)o[n]=e(t[n],n,t);return o}var Mr,jc=C(()=>{Mr=Zq});function pD(t){if(typeof t=="string")return t;if(Ct(t))return Mr(t,pD)+"";if(ar(t))return hD?hD.call(t):"";var e=t+"";return e=="0"&&1/t==-Kq?"-0":e}var Kq,dD,hD,mD,gD=C(()=>{Es();jc();Re();$s();Kq=1/0,dD=rn?rn.prototype:void 0,hD=dD?dD.toString:void 0;mD=pD});function Qq(t){return t==null?"":mD(t)}var gx,sS=C(()=>{gD();gx=Qq});function Jq(t,e){return Ct(t)?t:Hc(t,e)?[t]:uD(gx(t))}var xa,Sh=C(()=>{Re();mx();fD();sS();xa=Jq});function eX(t){if(typeof t=="string"||ar(t))return t;var e=t+"";return e=="0"&&1/t==-tX?"-0":e}var tX,Fo,Yc=C(()=>{$s();tX=1/0;Fo=eX});function nX(t,e){e=xa(e,t);for(var n=0,r=e.length;t!=null&&n<r;)t=t[Fo(e[n++])];return n&&n==r?t:void 0}var va,Ch=C(()=>{Sh();Yc();va=nX});function rX(t,e,n){var r=t==null?void 0:va(t,e);return r===void 0?n:r}var xD,vD=C(()=>{Ch();xD=rX});function oX(t,e){return t!=null&&e in Object(t)}var yD,_D=C(()=>{yD=oX});function iX(t,e,n){e=xa(e,t);for(var r=-1,o=e.length,i=!1;++r<o;){var a=Fo(e[r]);if(!(i=t!=null&&n(t,a)))break;t=t[a]}return i||++r!=o?i:(o=t==null?0:t.length,!!o&&Rc(o)&&$o(a,o)&&(Ct(t)||Qr(t)))}var xx,lS=C(()=>{Sh();Ec();Re();Mc();V0();Yc();xx=iX});function aX(t,e){return t!=null&&xx(t,e,yD)}var vx,cS=C(()=>{_D();lS();vx=aX});function cX(t,e){return Hc(t)&&hx(e)?px(Fo(t),e):function(n){var r=xD(n,t);return r===void 0&&r===e?vx(n,t):dx(e,r,sX|lX)}}var sX,lX,bD,wD=C(()=>{rS();vD();cS();mx();oS();iS();Yc();sX=1,lX=2;bD=cX});function uX(t){return t}var bn,_i=C(()=>{bn=uX});function fX(t){return function(e){return e?.[t]}}var yx,uS=C(()=>{yx=fX});function dX(t){return function(e){return va(e,t)}}var kD,SD=C(()=>{Ch();kD=dX});function hX(t){return Hc(t)?yx(Fo(t)):kD(t)}var CD,AD=C(()=>{uS();SD();mx();Yc();CD=hX});function pX(t){return typeof t=="function"?t:t==null?bn:typeof t=="object"?Ct(t)?bD(t[0],t[1]):oD(t):CD(t)}var We,to=C(()=>{iD();wD();_i();Re();AD();We=pX});function mX(t,e,n,r,o){return o(t,function(i,a,s){n=r?(r=!1,i):e(n,i,a,s)}),n}var TD,LD=C(()=>{TD=mX});function gX(t,e,n){var r=Ct(t)?iN:TD,o=arguments.length<3;return r(t,We(e,4),n,o,ca)}var eo,Ah=C(()=>{aN();xh();to();LD();Re();eo=gX});function xX(t,e){return Mr(e,function(n){return t[n]})}var ED,MD=C(()=>{jc();ED=xX});function vX(t){return t==null?[]:ED(t,we(t))}var Rr,_x=C(()=>{MD();zo();Rr=vX});function yX(t){return Ct(t)||Qr(t)||!!(RD&&t&&t[RD])}var RD,PD,ID=C(()=>{Es();Ec();Re();RD=rn?rn.isConcatSpreadable:void 0;PD=yX});function ND(t,e,n,r,o){var i=-1,a=t.length;for(n||(n=PD),o||(o=[]);++i<a;){var s=t[i];e>0&&n(s)?e>1?ND(s,e-1,n,r,o):Wc(o,s):r||(o[o.length]=s)}return o}var Uc,bx=C(()=>{ox();ID();Uc=ND});function _X(t,e,n){switch(n.length){case 0:return t.call(e);case 1:return t.call(e,n[0]);case 2:return t.call(e,n[0],n[1]);case 3:return t.call(e,n[0],n[1],n[2])}return t.apply(e,n)}var qc,wx=C(()=>{qc=_X});function bX(t,e,n){return e=$D(e===void 0?t.length-1:e,0),function(){for(var r=arguments,o=-1,i=$D(r.length-e,0),a=Array(i);++o<i;)a[o]=r[e+o];o=-1;for(var s=Array(e+1);++o<e;)s[o]=r[o];return s[e]=n(a),qc(t,this,s)}}var $D,kx,fS=C(()=>{wx();$D=Math.max;kx=bX});function wX(t){return function(){return t}}var sr,Xc=C(()=>{sr=wX});var kX,Zc,dS=C(()=>{da();kX=(function(){try{var t=Vn(Object,"defineProperty");return t({},"",{}),t}catch{}})(),Zc=kX});var SX,DD,OD=C(()=>{Xc();dS();_i();SX=Zc?function(t,e){return Zc(t,"toString",{configurable:!0,enumerable:!1,value:sr(e),writable:!0})}:bn,DD=SX});function LX(t){var e=0,n=0;return function(){var r=TX(),o=AX-(r-n);if(n=r,o>0){if(++e>=CX)return arguments[0]}else e=0;return t.apply(void 0,arguments)}}var CX,AX,TX,Sx,hS=C(()=>{CX=800,AX=16,TX=Date.now;Sx=LX});var EX,Kc,Cx=C(()=>{OD();hS();EX=Sx(DD),Kc=EX});function MX(t,e){return Kc(kx(t,e,bn),t+"")}var Go,Qc=C(()=>{_i();fS();Cx();Go=MX});function RX(t,e,n,r){for(var o=t.length,i=n+(r?1:-1);r?i--:++i<o;)if(e(t[i],i,t))return i;return-1}var Ax,pS=C(()=>{Ax=RX});function PX(t){return t!==t}var zD,BD=C(()=>{zD=PX});function IX(t,e,n){for(var r=n-1,o=t.length;++r<o;)if(t[r]===e)return r;return-1}var FD,GD=C(()=>{FD=IX});function NX(t,e,n){return e===e?FD(t,e,n):Ax(t,zD,n)}var WD,VD=C(()=>{pS();BD();GD();WD=NX});function $X(t,e){var n=t==null?0:t.length;return!!n&&WD(t,e,0)>-1}var Tx,mS=C(()=>{VD();Tx=$X});function DX(t,e,n){for(var r=-1,o=t==null?0:t.length;++r<o;)if(n(e,t[r]))return!0;return!1}var HD,jD=C(()=>{HD=DX});function OX(){}var Lx,gS=C(()=>{Lx=OX});var zX,BX,YD,UD=C(()=>{eS();gS();rx();zX=1/0,BX=ma&&1/Gc(new ma([,-0]))[1]==zX?function(t){return new ma(t)}:Lx,YD=BX});function GX(t,e,n){var r=-1,o=Tx,i=t.length,a=!0,s=[],l=s;if(n)a=!1,o=HD;else if(i>=FX){var c=e?null:YD(t);if(c)return Gc(c);a=!1,o=tx,l=new J0}else l=e?[]:s;t:for(;++r<i;){var u=t[r],f=e?e(u):u;if(u=n||u!==0?u:0,a&&f===f){for(var d=l.length;d--;)if(l[d]===f)continue t;e&&l.push(f),s.push(u)}else o(l,f,n)||(l!==s&&l.push(f),s.push(u))}return s}var FX,qD,XD=C(()=>{jk();mS();jD();Yk();UD();rx();FX=200;qD=GX});function WX(t){return be(t)&&on(t)}var Ex,xS=C(()=>{Oo();Lr();Ex=WX});var VX,ZD,KD=C(()=>{bx();Qc();XD();xS();VX=Go(function(t){return qD(Uc(t,1,Ex,!0))}),ZD=VX});function HX(t){return t===void 0}var te,Ds=C(()=>{te=HX});function jX(t,e){for(var n=-1,r=t==null?0:t.length;++n<r&&e(t[n],n,t)!==!1;);return t}var ya,Th=C(()=>{ya=jX});function YX(t){return typeof t=="function"?t:bn}var QD,JD=C(()=>{_i();QD=YX});function UX(t,e){var n=Ct(t)?ya:ca;return n(t,QD(e))}var V,ve=C(()=>{Th();xh();JD();Re();V=UX});var Os=C(()=>{ve()});function QX(t){if(t==null)return!0;if(on(t)&&(Ct(t)||typeof t=="string"||typeof t.splice=="function"||ir(t)||Do(t)||Qr(t)))return!t.length;var e=In(t);if(e==qX||e==XX)return!t.size;if(la(t))return!Ic(t).length;for(var n in t)if(KX.call(t,n))return!1;return!0}var qX,XX,ZX,KX,vS,tO=C(()=>{U0();ga();Ec();Re();Oo();Ms();gh();Pc();qX="[object Map]",XX="[object Set]",ZX=Object.prototype,KX=ZX.hasOwnProperty;vS=QX});function JX(t,e){var n=[];return ca(t,function(r,o,i){e(r,o,i)&&n.push(r)}),n}var eO,nO=C(()=>{xh();eO=JX});function t7(t,e){var n=Ct(t)?ax:eO;return n(t,We(e,3))}var wn,zs=C(()=>{Qk();nO();to();Re();wn=t7});function r7(t,e){return t!=null&&n7.call(t,e)}var e7,n7,rO,oO=C(()=>{e7=Object.prototype,n7=e7.hasOwnProperty;rO=r7});function o7(t,e){return t!=null&&xx(t,e,rO)}var ft,Ve=C(()=>{oO();lS();ft=o7});function dt(t){this._isDirected=ft(t,"directed")?t.directed:!0,this._isMultigraph=ft(t,"multigraph")?t.multigraph:!1,this._isCompound=ft(t,"compound")?t.compound:!1,this._label=void 0,this._defaultNodeLabelFn=sr(void 0),this._defaultEdgeLabelFn=sr(void 0),this._nodes={},this._isCompound&&(this._parent={},this._children={},this._children[Bs]={}),this._in={},this._preds={},this._out={},this._sucs={},this._edgeObjs={},this._edgeLabels={}}function aO(t,e){t[e]?t[e]++:t[e]=1}function sO(t,e){--t[e]||delete t[e]}function Lh(t,e,n,r){var o=""+e,i=""+n;if(!t&&o>i){var a=o;o=i,i=a}return o+iO+i+iO+(te(r)?i7:r)}function a7(t,e,n,r){var o=""+e,i=""+n;if(!t&&o>i){var a=o;o=i,i=a}var s={v:o,w:i};return r&&(s.name=r),s}function yS(t,e){return Lh(t,e.v,e.w,e.name)}var i7,Bs,iO,Mx=C(()=>{Ah();_x();KD();Ds();Os();tO();zs();zo();Nc();Xc();Ve();i7="\0",Bs="\0",iO="";dt.prototype._nodeCount=0;dt.prototype._edgeCount=0;dt.prototype.isDirected=function(){return this._isDirected};dt.prototype.isMultigraph=function(){return this._isMultigraph};dt.prototype.isCompound=function(){return this._isCompound};dt.prototype.setGraph=function(t){return this._label=t,this};dt.prototype.graph=function(){return this._label};dt.prototype.setDefaultNodeLabel=function(t){return Jr(t)||(t=sr(t)),this._defaultNodeLabelFn=t,this};dt.prototype.nodeCount=function(){return this._nodeCount};dt.prototype.nodes=function(){return we(this._nodes)};dt.prototype.sources=function(){var t=this;return wn(this.nodes(),function(e){return vS(t._in[e])})};dt.prototype.sinks=function(){var t=this;return wn(this.nodes(),function(e){return vS(t._out[e])})};dt.prototype.setNodes=function(t,e){var n=arguments,r=this;return V(t,function(o){n.length>1?r.setNode(o,e):r.setNode(o)}),this};dt.prototype.setNode=function(t,e){return ft(this._nodes,t)?(arguments.length>1&&(this._nodes[t]=e),this):(this._nodes[t]=arguments.length>1?e:this._defaultNodeLabelFn(t),this._isCompound&&(this._parent[t]=Bs,this._children[t]={},this._children[Bs][t]=!0),this._in[t]={},this._preds[t]={},this._out[t]={},this._sucs[t]={},++this._nodeCount,this)};dt.prototype.node=function(t){return this._nodes[t]};dt.prototype.hasNode=function(t){return ft(this._nodes,t)};dt.prototype.removeNode=function(t){var e=this;if(ft(this._nodes,t)){var n=function(r){e.removeEdge(e._edgeObjs[r])};delete this._nodes[t],this._isCompound&&(this._removeFromParentsChildList(t),delete this._parent[t],V(this.children(t),function(r){e.setParent(r)}),delete this._children[t]),V(we(this._in[t]),n),delete this._in[t],delete this._preds[t],V(we(this._out[t]),n),delete this._out[t],delete this._sucs[t],--this._nodeCount}return this};dt.prototype.setParent=function(t,e){if(!this._isCompound)throw new Error("Cannot set parent in a non-compound graph");if(te(e))e=Bs;else{e+="";for(var n=e;!te(n);n=this.parent(n))if(n===t)throw new Error("Setting "+e+" as parent of "+t+" would create a cycle");this.setNode(e)}return this.setNode(t),this._removeFromParentsChildList(t),this._parent[t]=e,this._children[e][t]=!0,this};dt.prototype._removeFromParentsChildList=function(t){delete this._children[this._parent[t]][t]};dt.prototype.parent=function(t){if(this._isCompound){var e=this._parent[t];if(e!==Bs)return e}};dt.prototype.children=function(t){if(te(t)&&(t=Bs),this._isCompound){var e=this._children[t];if(e)return we(e)}else{if(t===Bs)return this.nodes();if(this.hasNode(t))return[]}};dt.prototype.predecessors=function(t){var e=this._preds[t];if(e)return we(e)};dt.prototype.successors=function(t){var e=this._sucs[t];if(e)return we(e)};dt.prototype.neighbors=function(t){var e=this.predecessors(t);if(e)return ZD(e,this.successors(t))};dt.prototype.isLeaf=function(t){var e;return this.isDirected()?e=this.successors(t):e=this.neighbors(t),e.length===0};dt.prototype.filterNodes=function(t){var e=new this.constructor({directed:this._isDirected,multigraph:this._isMultigraph,compound:this._isCompound});e.setGraph(this.graph());var n=this;V(this._nodes,function(i,a){t(a)&&e.setNode(a,i)}),V(this._edgeObjs,function(i){e.hasNode(i.v)&&e.hasNode(i.w)&&e.setEdge(i,n.edge(i))});var r={};function o(i){var a=n.parent(i);return a===void 0||e.hasNode(a)?(r[i]=a,a):a in r?r[a]:o(a)}return this._isCompound&&V(e.nodes(),function(i){e.setParent(i,o(i))}),e};dt.prototype.setDefaultEdgeLabel=function(t){return Jr(t)||(t=sr(t)),this._defaultEdgeLabelFn=t,this};dt.prototype.edgeCount=function(){return this._edgeCount};dt.prototype.edges=function(){return Rr(this._edgeObjs)};dt.prototype.setPath=function(t,e){let n=this,r=arguments;return eo(t,function(o,i){return r.length>1?n.setEdge(o,i,e):n.setEdge(o,i),i}),this};dt.prototype.setEdge=function(){let t,e,n,r,o=!1,i=arguments[0];typeof i=="object"&&i!==null&&"v"in i?(t=i.v,e=i.w,n=i.name,arguments.length===2&&(r=arguments[1],o=!0)):(t=i,e=arguments[1],n=arguments[3],arguments.length>2&&(r=arguments[2],o=!0)),t=""+t,e=""+e,te(n)||(n=""+n);var a=Lh(this._isDirected,t,e,n);if(ft(this._edgeLabels,a))return o&&(this._edgeLabels[a]=r),this;if(!te(n)&&!this._isMultigraph)throw new Error("Cannot set a named edge when isMultigraph = false");this.setNode(t),this.setNode(e),this._edgeLabels[a]=o?r:this._defaultEdgeLabelFn(t,e,n);var s=a7(this._isDirected,t,e,n);return t=s.v,e=s.w,Object.freeze(s),this._edgeObjs[a]=s,aO(this._preds[e],t),aO(this._sucs[t],e),this._in[e][a]=s,this._out[t][a]=s,this._edgeCount++,this};dt.prototype.edge=function(t,e,n){var r=arguments.length===1?yS(this._isDirected,arguments[0]):Lh(this._isDirected,t,e,n);return this._edgeLabels[r]};dt.prototype.hasEdge=function(t,e,n){var r=arguments.length===1?yS(this._isDirected,arguments[0]):Lh(this._isDirected,t,e,n);return ft(this._edgeLabels,r)};dt.prototype.removeEdge=function(t,e,n){let r=arguments.length===1?yS(this._isDirected,arguments[0]):Lh(this._isDirected,t,e,n),o=this._edgeObjs[r];return o&&(t=o.v,e=o.w,delete this._edgeLabels[r],delete this._edgeObjs[r],sO(this._preds[e],t),sO(this._sucs[t],e),delete this._in[e][r],delete this._out[t][r],this._edgeCount--),this};dt.prototype.inEdges=function(t,e){var n=this._in[t];if(n){var r=Rr(n);return e?wn(r,function(o){return o.v===e}):r}};dt.prototype.outEdges=function(t,e){var n=this._out[t];if(n){var r=Rr(n);return e?wn(r,function(o){return o.w===e}):r}};dt.prototype.nodeEdges=function(t,e){var n=this.inEdges(t,e);if(n)return n.concat(this.outEdges(t,e))}});function s7(t,e){var n=-1,r=on(t)?Array(t.length):[];return ca(t,function(o,i,a){r[++n]=e(o,i,a)}),r}var Rx,_S=C(()=>{xh();Oo();Rx=s7});function l7(t,e){var n=Ct(t)?Mr:Rx;return n(t,We(e,3))}var $t,Pr=C(()=>{jc();to();_S();Re();$t=l7});function c7(t,e,n){e=="__proto__"&&Zc?Zc(t,e,{configurable:!0,enumerable:!0,value:n,writable:!0}):t[e]=n}var _a,Eh=C(()=>{dS();_a=c7});function d7(t,e,n){var r=t[e];(!(f7.call(t,e)&&Er(r,n))||n===void 0&&!(e in t))&&_a(t,e,n)}var u7,f7,ba,Mh=C(()=>{Eh();Rs();u7=Object.prototype,f7=u7.hasOwnProperty;ba=d7});function h7(t,e,n,r){var o=!n;n||(n={});for(var i=-1,a=e.length;++i<a;){var s=e[i],l=r?r(n[s],t[s],s,n,t):void 0;l===void 0&&(l=t[s]),o?_a(n,s,l):ba(n,s,l)}return n}var Wo,Jc=C(()=>{Mh();Eh();Wo=h7});function p7(t,e){return t&&Wo(e,we(e),t)}var lO,cO=C(()=>{Jc();zo();lO=p7});function m7(t){var e=[];if(t!=null)for(var n in Object(t))e.push(n);return e}var uO,fO=C(()=>{uO=m7});function v7(t){if(!Kt(t))return uO(t);var e=la(t),n=[];for(var r in t)r=="constructor"&&(e||!x7.call(t,r))||n.push(r);return n}var g7,x7,dO,hO=C(()=>{Wn();gh();fO();g7=Object.prototype,x7=g7.hasOwnProperty;dO=v7});function y7(t){return on(t)?j0(t,!0):dO(t)}var Ir,Fs=C(()=>{Gk();hO();Oo();Ir=y7});function _7(t,e){return t&&Wo(e,Ir(e),t)}var pO,mO=C(()=>{Jc();Fs();pO=_7});function w7(t,e){if(e)return t.slice();var n=t.length,r=vO?vO(n):new t.constructor(n);return t.copy(r),r}var yO,gO,b7,xO,vO,Px,bS=C(()=>{_n();yO=typeof exports=="object"&&exports&&!exports.nodeType&&exports,gO=yO&&typeof module=="object"&&module&&!module.nodeType&&module,b7=gO&&gO.exports===yO,xO=b7?Ht.Buffer:void 0,vO=xO?xO.allocUnsafe:void 0;Px=w7});function k7(t,e){var n=-1,r=t.length;for(e||(e=Array(r));++n<r;)e[n]=t[n];return e}var wa,Rh=C(()=>{wa=k7});function S7(t,e){return Wo(t,Vc(t),e)}var _O,bO=C(()=>{Jc();lx();_O=S7});var C7,ka,Ph=C(()=>{Wk();C7=Y0(Object.getPrototypeOf,Object),ka=C7});var A7,T7,Ix,wS=C(()=>{ox();Ph();lx();Jk();A7=Object.getOwnPropertySymbols,T7=A7?function(t){for(var e=[];t;)Wc(e,Vc(t)),t=ka(t);return e}:sx,Ix=T7});function L7(t,e){return Wo(t,Ix(t),e)}var wO,kO=C(()=>{Jc();wS();wO=L7});function E7(t){return ix(t,Ir,Ix)}var SO,CO=C(()=>{Kk();wS();Fs();SO=E7});function P7(t){var e=t.length,n=new t.constructor(e);return e&&typeof t[0]=="string"&&R7.call(t,"index")&&(n.index=t.index,n.input=t.input),n}var M7,R7,AO,TO=C(()=>{M7=Object.prototype,R7=M7.hasOwnProperty;AO=P7});function I7(t){var e=new t.constructor(t.byteLength);return new Fc(e).set(new Fc(t)),e}var tu,Nx=C(()=>{qk();tu=I7});function N7(t,e){var n=e?tu(t.buffer):t.buffer;return new t.constructor(n,t.byteOffset,t.byteLength)}var LO,EO=C(()=>{Nx();LO=N7});function D7(t){var e=new t.constructor(t.source,$7.exec(t));return e.lastIndex=t.lastIndex,e}var $7,MO,RO=C(()=>{$7=/\w*$/;MO=D7});function O7(t){return IO?Object(IO.call(t)):{}}var PO,IO,NO,$O=C(()=>{Es();PO=rn?rn.prototype:void 0,IO=PO?PO.valueOf:void 0;NO=O7});function z7(t,e){var n=e?tu(t.buffer):t.buffer;return new t.constructor(n,t.byteOffset,t.length)}var $x,kS=C(()=>{Nx();$x=z7});function oZ(t,e,n){var r=t.constructor;switch(e){case U7:return tu(t);case B7:case F7:return new r(+t);case q7:return LO(t,n);case X7:case Z7:case K7:case Q7:case J7:case tZ:case eZ:case nZ:case rZ:return $x(t,n);case G7:return new r;case W7:case j7:return new r(t);case V7:return MO(t);case H7:return new r;case Y7:return NO(t)}}var B7,F7,G7,W7,V7,H7,j7,Y7,U7,q7,X7,Z7,K7,Q7,J7,tZ,eZ,nZ,rZ,DO,OO=C(()=>{Nx();EO();RO();$O();kS();B7="[object Boolean]",F7="[object Date]",G7="[object Map]",W7="[object Number]",V7="[object RegExp]",H7="[object Set]",j7="[object String]",Y7="[object Symbol]",U7="[object ArrayBuffer]",q7="[object DataView]",X7="[object Float32Array]",Z7="[object Float64Array]",K7="[object Int8Array]",Q7="[object Int16Array]",J7="[object Int32Array]",tZ="[object Uint8Array]",eZ="[object Uint8ClampedArray]",nZ="[object Uint16Array]",rZ="[object Uint32Array]";DO=oZ});var zO,iZ,Vo,eu=C(()=>{Wn();zO=Object.create,iZ=(function(){function t(){}return function(e){if(!Kt(e))return{};if(zO)return zO(e);t.prototype=e;var n=new t;return t.prototype=void 0,n}})(),Vo=iZ});function aZ(t){return typeof t.constructor=="function"&&!la(t)?Vo(ka(t)):{}}var Dx,SS=C(()=>{eu();Ph();gh();Dx=aZ});function lZ(t){return be(t)&&In(t)==sZ}var sZ,BO,FO=C(()=>{ga();Lr();sZ="[object Map]";BO=lZ});var GO,cZ,WO,VO=C(()=>{FO();ph();H0();GO=xi&&xi.isMap,cZ=GO?sa(GO):BO,WO=cZ});function fZ(t){return be(t)&&In(t)==uZ}var uZ,HO,jO=C(()=>{ga();Lr();uZ="[object Set]";HO=fZ});var YO,dZ,UO,qO=C(()=>{jO();ph();H0();YO=xi&&xi.isSet,dZ=YO?sa(YO):HO,UO=dZ});function Ox(t,e,n,r,o,i){var a,s=e&hZ,l=e&pZ,c=e&mZ;if(n&&(a=o?n(t,r,o,i):n(t)),a!==void 0)return a;if(!Kt(t))return t;var u=Ct(t);if(u){if(a=AO(t),!s)return wa(t,a)}else{var f=In(t),d=f==ZO||f==_Z;if(ir(t))return Px(t,s);if(f==KO||f==XO||d&&!o){if(a=l||d?{}:Dx(t),!s)return l?wO(t,pO(a,t)):_O(t,lO(a,t))}else{if(!ce[f])return o?t:{};a=DO(t,f,s)}}i||(i=new Bo);var h=i.get(t);if(h)return h;i.set(t,a),UO(t)?t.forEach(function(m){a.add(Ox(m,e,n,m,t,i))}):WO(t)&&t.forEach(function(m,x){a.set(x,Ox(m,e,n,x,t,i))});var p=c?l?SO:kh:l?Ir:we,g=u?void 0:p(t);return ya(g||t,function(m,x){g&&(x=m,m=t[x]),ba(a,x,Ox(m,e,n,x,t,i))}),a}var hZ,pZ,mZ,XO,gZ,xZ,vZ,yZ,ZO,_Z,bZ,wZ,KO,kZ,SZ,CZ,AZ,TZ,LZ,EZ,MZ,RZ,PZ,IZ,NZ,$Z,DZ,OZ,zZ,ce,zx,CS=C(()=>{wh();Th();Mh();cO();mO();bS();Rh();bO();kO();tS();CO();ga();TO();OO();SS();Re();Ms();VO();Wn();qO();zo();Fs();hZ=1,pZ=2,mZ=4,XO="[object Arguments]",gZ="[object Array]",xZ="[object Boolean]",vZ="[object Date]",yZ="[object Error]",ZO="[object Function]",_Z="[object GeneratorFunction]",bZ="[object Map]",wZ="[object Number]",KO="[object Object]",kZ="[object RegExp]",SZ="[object Set]",CZ="[object String]",AZ="[object Symbol]",TZ="[object WeakMap]",LZ="[object ArrayBuffer]",EZ="[object DataView]",MZ="[object Float32Array]",RZ="[object Float64Array]",PZ="[object Int8Array]",IZ="[object Int16Array]",NZ="[object Int32Array]",$Z="[object Uint8Array]",DZ="[object Uint8ClampedArray]",OZ="[object Uint16Array]",zZ="[object Uint32Array]",ce={};ce[XO]=ce[gZ]=ce[LZ]=ce[EZ]=ce[xZ]=ce[vZ]=ce[MZ]=ce[RZ]=ce[PZ]=ce[IZ]=ce[NZ]=ce[bZ]=ce[wZ]=ce[KO]=ce[kZ]=ce[SZ]=ce[CZ]=ce[AZ]=ce[$Z]=ce[DZ]=ce[OZ]=ce[zZ]=!0;ce[yZ]=ce[ZO]=ce[TZ]=!1;zx=Ox});function FZ(t){return zx(t,BZ)}var BZ,QO,JO=C(()=>{CS();BZ=4;QO=FZ});var AS={};Wt(AS,{read:()=>HZ,write:()=>GZ});function GZ(t){var e={options:{directed:t.isDirected(),multigraph:t.isMultigraph(),compound:t.isCompound()},nodes:WZ(t),edges:VZ(t)};return te(t.graph())||(e.value=QO(t.graph())),e}function WZ(t){return $t(t.nodes(),function(e){let n=t.node(e),r=t.parent(e),o={v:e};return te(n)||(o.value=n),te(r)||(o.parent=r),o})}function VZ(t){return $t(t.edges(),function(e){let n=t.edge(e),r={v:e.v,w:e.w};return te(e.name)||(r.name=e.name),te(n)||(r.value=n),r})}function HZ(t){var e=new dt(t.options).setGraph(t.value);return V(t.nodes,function(n){e.setNode(n.v,n.value),n.parent&&e.setParent(n.v,n.parent)}),V(t.edges,function(n){e.setEdge({v:n.v,w:n.w,name:n.name},n.value)}),e}var tz=C(()=>{Os();Pr();JO();Ds();Mx()});function ez(t){let e={},n=[],r;function o(i){ft(e,i)||(e[i]=!0,r.push(i),V(t.successors(i),o),V(t.predecessors(i),o))}return V(t.nodes(),function(i){r=[],o(i),r.length&&n.push(r)}),n}var nz=C(()=>{Os();Ve()});function Nn(){this._arr=[],this._keyIndices={}}var TS=C(()=>{Ve();Nn.prototype.size=function(){return this._arr.length};Nn.prototype.keys=function(){return this._arr.map(function(t){return t.key})};Nn.prototype.has=function(t){return ft(this._keyIndices,t)};Nn.prototype.priority=function(t){var e=this._keyIndices[t];if(e!==void 0)return this._arr[e].priority};Nn.prototype.min=function(){if(this.size()===0)throw new Error("Queue underflow");return this._arr[0].key};Nn.prototype.add=function(t,e){var n=this._keyIndices;if(t=String(t),!ft(n,t)){var r=this._arr,o=r.length;return n[t]=o,r.push({key:t,priority:e}),this._decrease(o),!0}return!1};Nn.prototype.removeMin=function(){this._swap(0,this._arr.length-1);var t=this._arr.pop();return delete this._keyIndices[t.key],this._heapify(0),t.key};Nn.prototype.decrease=function(t,e){var n=this._keyIndices[t];if(e>this._arr[n].priority)throw new Error("New priority is greater than current priority. Key: "+t+" Old: "+this._arr[n].priority+" New: "+e);this._arr[n].priority=e,this._decrease(n)};Nn.prototype._heapify=function(t){let e=this._arr,n=2*t,r=n+1,o=t;n<e.length&&(o=e[n].priority<e[o].priority?n:o,r<e.length&&(o=e[r].priority<e[o].priority?r:o),o!==t&&(this._swap(t,o),this._heapify(o)))};Nn.prototype._decrease=function(t){for(var e=this._arr,n=e[t].priority,r;t!==0&&(r=t>>1,!(e[r].priority<n));)this._swap(t,r),t=r};Nn.prototype._swap=function(t,e){var n=this._arr,r=this._keyIndices,o=n[t],i=n[e];n[t]=i,n[e]=o,r[i.key]=t,r[o.key]=e}});function Bx(t,e,n,r){return YZ(t,String(e),n||jZ,r||function(o){return t.outEdges(o)})}function YZ(t,e,n,r){let o={},i=new Nn,a,s;var l=function(c){let u=c.v!==a?c.v:c.w,f=o[u],d=n(c),h=s.distance+d;if(d<0)throw new Error("dijkstra does not allow negative edge weights. Bad edge: "+c+" Weight: "+d);h<f.distance&&(f.distance=h,f.predecessor=a,i.decrease(u,h))};for(t.nodes().forEach(function(c){var u=c===e?0:Number.POSITIVE_INFINITY;o[c]={distance:u},i.add(c,u)});i.size()>0&&(a=i.removeMin(),s=o[a],s.distance!==Number.POSITIVE_INFINITY);)r(a).forEach(l);return o}var jZ,LS=C(()=>{Xc();TS();jZ=sr(1)});function UZ(t,e,n){var r=Ct(t),o=r||ir(t)||Do(t);if(e=We(e,4),n==null){var i=t&&t.constructor;o?n=r?new i:[]:Kt(t)?n=Jr(i)?Vo(ka(t)):{}:n={}}return(o?ya:$c)(t,function(a,s,l){return e(n,a,s,l)}),n}var rz,oz=C(()=>{Th();eu();q0();to();Ph();Re();Ms();Nc();Wn();Pc();rz=UZ});function iz(t,e,n){return rz(t.nodes(),function(r,o){r[o]=Bx(t,o,e,n)},{})}var az=C(()=>{oz();LS()});function Fx(t){let e=0,n=[],r={},o=[];function i(a){var s=r[a]={onStack:!0,lowlink:e,index:e++};if(n.push(a),t.successors(a).forEach(function(l){ft(r,l)?r[l].onStack&&(s.lowlink=Math.min(s.lowlink,r[l].index)):(i(l),s.lowlink=Math.min(s.lowlink,r[l].lowlink))}),s.lowlink===s.index){let l=[],c;do c=n.pop(),r[c].onStack=!1,l.push(c);while(a!==c);o.push(l)}}return t.nodes().forEach(function(a){ft(r,a)||i(a)}),o}var ES=C(()=>{Ve()});function sz(t){return wn(Fx(t),function(e){return e.length>1||e.length===1&&t.hasEdge(e[0],e[0])})}var lz=C(()=>{zs();ES()});function cz(t,e,n){return XZ(t,e||qZ,n||function(r){return t.outEdges(r)})}function XZ(t,e,n){let r={},o=t.nodes();return o.forEach(function(i){r[i]={},r[i][i]={distance:0},o.forEach(function(a){i!==a&&(r[i][a]={distance:Number.POSITIVE_INFINITY})}),n(i).forEach(function(a){let s=a.v===i?a.w:a.v,l=e(a);r[i][s]={distance:l,predecessor:i}})}),o.forEach(function(i){var a=r[i];o.forEach(function(s){var l=r[s];o.forEach(function(c){var u=l[i],f=a[c],d=l[c],h=u.distance+f.distance;h<d.distance&&(d.distance=h,d.predecessor=f.predecessor)})})}),r}var qZ,uz=C(()=>{Xc();qZ=sr(1)});function KZ(t){return typeof t=="string"||!Ct(t)&&be(t)&&Pn(t)==ZZ}var ZZ,fz,dz=C(()=>{aa();Re();Lr();ZZ="[object String]";fz=KZ});var QZ,hz,pz=C(()=>{uS();QZ=yx("length"),hz=QZ});function sK(t){return aK.test(t)}var JZ,tK,eK,nK,rK,oK,iK,aK,mz,gz=C(()=>{JZ="\\ud800-\\udfff",tK="\\u0300-\\u036f",eK="\\ufe20-\\ufe2f",nK="\\u20d0-\\u20ff",rK=tK+eK+nK,oK="\\ufe0e\\ufe0f",iK="\\u200d",aK=RegExp("["+iK+JZ+rK+oK+"]");mz=sK});function yK(t){for(var e=xz.lastIndex=0;xz.test(t);)++e;return e}var vz,lK,cK,uK,fK,dK,hK,MS,RS,pK,yz,_z,bz,mK,wz,kz,gK,xK,vK,xz,Sz,Cz=C(()=>{vz="\\ud800-\\udfff",lK="\\u0300-\\u036f",cK="\\ufe20-\\ufe2f",uK="\\u20d0-\\u20ff",fK=lK+cK+uK,dK="\\ufe0e\\ufe0f",hK="["+vz+"]",MS="["+fK+"]",RS="\\ud83c[\\udffb-\\udfff]",pK="(?:"+MS+"|"+RS+")",yz="[^"+vz+"]",_z="(?:\\ud83c[\\udde6-\\uddff]){2}",bz="[\\ud800-\\udbff][\\udc00-\\udfff]",mK="\\u200d",wz=pK+"?",kz="["+dK+"]?",gK="(?:"+mK+"(?:"+[yz,_z,bz].join("|")+")"+kz+wz+")*",xK=kz+wz+gK,vK="(?:"+[yz+MS+"?",MS,_z,bz,hK].join("|")+")",xz=RegExp(RS+"(?="+RS+")|"+vK+xK,"g");Sz=yK});function _K(t){return mz(t)?Sz(t):hz(t)}var Az,Tz=C(()=>{pz();gz();Cz();Az=_K});function kK(t){if(t==null)return 0;if(on(t))return fz(t)?Az(t):t.length;var e=In(t);return e==bK||e==wK?t.size:Ic(t).length}var bK,wK,Lz,Ez=C(()=>{U0();ga();Oo();dz();Tz();bK="[object Map]",wK="[object Set]";Lz=kK});function nu(t){let e={},n={},r=[];function o(i){if(ft(n,i))throw new Gx;ft(e,i)||(n[i]=!0,e[i]=!0,V(t.predecessors(i),o),delete n[i],r.push(i))}if(V(t.sinks(),o),Lz(e)!==t.nodeCount())throw new Gx;return r}function Gx(){}var PS=C(()=>{Ez();Os();Ve();Gx.prototype=new Error;nu.CycleException=Gx});function Mz(t){try{nu(t)}catch(e){if(e instanceof nu.CycleException)return!1;throw e}return!0}var Rz=C(()=>{PS()});function Wx(t,e,n){Ct(e)||(e=[e]);var r=(t.isDirected()?t.successors:t.neighbors).bind(t);let o=[],i={};return V(e,function(a){if(!t.hasNode(a))throw new Error("Graph does not have node: "+a);Pz(t,a,n==="post",i,r,o)}),o}function Pz(t,e,n,r,o,i){ft(r,e)||(r[e]=!0,n||i.push(e),V(o(e),function(a){Pz(t,a,n,r,o,i)}),n&&i.push(e))}var IS=C(()=>{Ve();Os();Re()});function Iz(t,e){return Wx(t,e,"post")}var Nz=C(()=>{IS()});function $z(t,e){return Wx(t,e,"pre")}var Dz=C(()=>{IS()});function Oz(t,e){let n=new dt,r={},o=new Nn,i;function a(l){let c=l.v===i?l.w:l.v,u=o.priority(c);if(u!==void 0){var f=e(l);f<u&&(r[c]=i,o.decrease(c,f))}}if(t.nodeCount()===0)return n;V(t.nodes(),function(l){o.add(l,Number.POSITIVE_INFINITY),n.setNode(l)}),o.decrease(t.nodes()[0],0);for(var s=!1;o.size()>0;){if(i=o.removeMin(),ft(r,i))n.setEdge(i,r[i]);else{if(s)throw new Error("Input graph is not connected: "+t);s=!0}t.nodeEdges(i).forEach(a)}return n}var zz=C(()=>{Ve();Os();Mx();TS()});var Ih={};Wt(Ih,{components:()=>ez,dijkstra:()=>Bx,dijkstraAll:()=>iz,findCycles:()=>sz,floydWarshall:()=>cz,isAcyclic:()=>Mz,postorder:()=>Iz,preorder:()=>$z,prim:()=>Oz,tarjan:()=>Fx,topsort:()=>nu});var Bz=C(()=>{nz();LS();az();lz();uz();Rz();Nz();Dz();zz();ES();PS()});var Fz={};Wt(Fz,{Graph:()=>dt,alg:()=>Ih,json:()=>AS});var Ho=C(()=>{Mx();tz();Bz()});function SK(t,e){var n={};return e=We(e,3),$c(t,function(r,o,i){_a(n,o,e(r,o,i))}),n}var ru,NS=C(()=>{Eh();q0();to();ru=SK});function CK(t){var e=t==null?0:t.length;return e?t[e-1]:void 0}var Gs,Vx=C(()=>{Gs=CK});function AK(t,e,n){if(!Kt(n))return!1;var r=typeof e;return(r=="number"?on(n)&&$o(e,n.length):r=="string"&&e in n)?Er(n[e],t):!1}var bi,Nh=C(()=>{Rs();Oo();Mc();Wn();bi=AK});var Gz,TK,LK,Wz,Vz=C(()=>{Qc();Rs();Nh();Fs();Gz=Object.prototype,TK=Gz.hasOwnProperty,LK=Go(function(t,e){t=Object(t);var n=-1,r=e.length,o=r>2?e[2]:void 0;for(o&&bi(e[0],e[1],o)&&(r=1);++n<r;)for(var i=e[n],a=Ir(i),s=-1,l=a.length;++s<l;){var c=a[s],u=t[c];(u===void 0||Er(u,Gz[c])&&!TK.call(t,c))&&(t[c]=i[c])}return t}),Wz=LK});function EK(t,e,n,r){if(!Kt(t))return t;e=xa(e,t);for(var o=-1,i=e.length,a=i-1,s=t;s!=null&&++o<i;){var l=Fo(e[o]),c=n;if(l==="__proto__"||l==="constructor"||l==="prototype")return t;if(o!=a){var u=s[l];c=r?r(u,l,s):void 0,c===void 0&&(c=Kt(u)?u:$o(e[o+1])?[]:{})}ba(s,l,c),s=s[l]}return t}var Hz,jz=C(()=>{Mh();Sh();Mc();Wn();Yc();Hz=EK});function MK(t,e,n){for(var r=-1,o=e.length,i={};++r<o;){var a=e[r],s=va(t,a);n(s,a)&&Hz(i,xa(a,t),s)}return i}var Yz,Uz=C(()=>{Ch();jz();Sh();Yz=MK});function RK(t,e){return Yz(t,e,function(n,r){return vx(t,r)})}var qz,Xz=C(()=>{Uz();cS();qz=RK});function PK(t){var e=t==null?0:t.length;return e?Uc(t,1):[]}var no,ou=C(()=>{bx();no=PK});function IK(t){return Kc(kx(t,void 0,no),t+"")}var Zz,Kz=C(()=>{ou();fS();Cx();Zz=IK});var NK,iu,$S=C(()=>{Xz();Kz();NK=Zz(function(t,e){return t==null?{}:qz(t,e)}),iu=NK});function $K(t,e,n){(n!==void 0&&!Er(t[e],n)||n===void 0&&!(e in t))&&_a(t,e,n)}var $h,DS=C(()=>{Eh();Rs();$h=$K});function GK(t){if(!be(t)||Pn(t)!=DK)return!1;var e=ka(t);if(e===null)return!0;var n=BK.call(e,"constructor")&&e.constructor;return typeof n=="function"&&n instanceof n&&Qz.call(n)==FK}var DK,OK,zK,Qz,BK,FK,Jz,tB=C(()=>{aa();Ph();Lr();DK="[object Object]",OK=Function.prototype,zK=Object.prototype,Qz=OK.toString,BK=zK.hasOwnProperty,FK=Qz.call(Object);Jz=GK});function WK(t,e){if(!(e==="constructor"&&typeof t[e]=="function")&&e!="__proto__")return t[e]}var Dh,OS=C(()=>{Dh=WK});function VK(t){return Wo(t,Ir(t))}var eB,nB=C(()=>{Jc();Fs();eB=VK});function HK(t,e,n,r,o,i,a){var s=Dh(t,n),l=Dh(e,n),c=a.get(l);if(c){$h(t,n,c);return}var u=i?i(s,l,n+"",t,e,a):void 0,f=u===void 0;if(f){var d=Ct(l),h=!d&&ir(l),p=!d&&!h&&Do(l);u=l,d||h||p?Ct(s)?u=s:Ex(s)?u=wa(s):h?(f=!1,u=Px(l,!0)):p?(f=!1,u=$x(l,!0)):u=[]:Jz(l)||Qr(l)?(u=s,Qr(s)?u=eB(s):(!Kt(s)||Jr(s))&&(u=Dx(l))):f=!1}f&&(a.set(l,u),o(u,l,r,i,a),a.delete(l)),$h(t,n,u)}var rB,oB=C(()=>{DS();bS();kS();Rh();SS();Ec();Re();xS();Ms();Nc();Wn();tB();Pc();OS();nB();rB=HK});function iB(t,e,n,r,o){t!==e&&G0(e,function(i,a){if(o||(o=new Bo),Kt(i))rB(t,e,a,n,iB,r,o);else{var s=r?r(Dh(t,a),i,a+"",t,e,o):void 0;s===void 0&&(s=i),$h(t,a,s)}},Ir)}var aB,sB=C(()=>{wh();DS();Ok();oB();Wn();Fs();OS();aB=iB});function jK(t){return Go(function(e,n){var r=-1,o=n.length,i=o>1?n[o-1]:void 0,a=o>2?n[2]:void 0;for(i=t.length>3&&typeof i=="function"?(o--,i):void 0,a&&bi(n[0],n[1],a)&&(i=o<3?void 0:i,o=1),e=Object(e);++r<o;){var s=n[r];s&&t(e,s,r,i)}return e})}var lB,cB=C(()=>{Qc();Nh();lB=jK});var YK,Oh,zS=C(()=>{sB();cB();YK=lB(function(t,e,n){aB(t,e,n)}),Oh=YK});function qK(t){var e=++UK;return gx(t)+e}var UK,au,Hx=C(()=>{sS();UK=0;au=qK});function KK(t,e,n,r){for(var o=-1,i=ZK(XK((e-t)/(n||1)),0),a=Array(i);i--;)a[r?i:++o]=t,t+=n;return a}var XK,ZK,uB,fB=C(()=>{XK=Math.ceil,ZK=Math.max;uB=KK});function JK(t){for(var e=t.length;e--&&QK.test(t.charAt(e)););return e}var QK,dB,hB=C(()=>{QK=/\s/;dB=JK});function eQ(t){return t&&t.slice(0,dB(t)+1).replace(tQ,"")}var tQ,pB,mB=C(()=>{hB();tQ=/^\s+/;pB=eQ});function aQ(t){if(typeof t=="number")return t;if(ar(t))return gB;if(Kt(t)){var e=typeof t.valueOf=="function"?t.valueOf():t;t=Kt(e)?e+"":e}if(typeof t!="string")return t===0?t:+t;t=pB(t);var n=rQ.test(t);return n||oQ.test(t)?iQ(t.slice(2),n?2:8):nQ.test(t)?gB:+t}var gB,nQ,rQ,oQ,iQ,xB,vB=C(()=>{mB();Wn();$s();gB=NaN,nQ=/^[-+]0x[0-9a-f]+$/i,rQ=/^0b[01]+$/i,oQ=/^0o[0-7]+$/i,iQ=parseInt;xB=aQ});function lQ(t){if(!t)return t===0?t:0;if(t=xB(t),t===yB||t===-yB){var e=t<0?-1:1;return e*sQ}return t===t?t:0}var yB,sQ,su,BS=C(()=>{vB();yB=1/0,sQ=17976931348623157e292;su=lQ});function cQ(t){return function(e,n,r){return r&&typeof r!="number"&&bi(e,n,r)&&(n=r=void 0),e=su(e),n===void 0?(n=e,e=0):n=su(n),r=r===void 0?e<n?1:-1:su(r),uB(e,n,r,t)}}var _B,bB=C(()=>{fB();Nh();BS();_B=cQ});var uQ,ro,lu=C(()=>{bB();uQ=_B(),ro=uQ});function zh(){let t={};t._next=t._prev=t,this._sentinel=t}function wB(t){t._prev._next=t._next,t._next._prev=t._prev,delete t._next,delete t._prev}function fQ(t,e){if(t!=="_next"&&t!=="_prev")return e}var kB=C(()=>{zh.prototype.dequeue=function(){let t=this._sentinel,e=t._prev;if(e!==t)return wB(e),e};zh.prototype.enqueue=function(t){let e=this._sentinel;t._prev&&t._next&&wB(t),t._next=e._next,e._next._prev=t,e._next=t,t._prev=e};zh.prototype.toString=function(){let t=[],e=this._sentinel,n=e._prev;for(;n!==e;)t.push(JSON.stringify(n,fQ)),n=n._prev;return"["+t.join(", ")+"]"}});function SB(t,e){if(t.nodeCount()<=1)return[];let n=pQ(t,e||dQ),r=hQ(n.graph,n.buckets,n.zeroIdx);return no($t(r,function(o){return t.outEdges(o.v,o.w)}),!0)}function hQ(t,e,n){let r=[],o=e[e.length-1],i=e[0],a;for(;t.nodeCount();){for(;a=i.dequeue();)FS(t,e,n,a);for(;a=o.dequeue();)FS(t,e,n,a);if(t.nodeCount()){for(let s=e.length-2;s>0;--s)if(a=e[s].dequeue(),a){r=r.concat(FS(t,e,n,a,!0));break}}}return r}function FS(t,e,n,r,o){let i=o?[]:void 0;return V(t.inEdges(r.v),function(a){let s=t.edge(a),l=t.node(a.v);o&&i.push({v:a.v,w:a.w}),l.out-=s,GS(e,n,l)}),V(t.outEdges(r.v),function(a){let s=t.edge(a),l=a.w,c=t.node(l);c.in-=s,GS(e,n,c)}),t.removeNode(r.v),i}function pQ(t,e){let n=new dt,r=0,o=0;V(t.nodes(),function(s){n.setNode(s,{v:s,in:0,out:0})}),V(t.edges(),function(s){let l=n.edge(s.v,s.w)||0,c=e(s),u=l+c;n.setEdge(s.v,s.w,u),o=Math.max(o,n.node(s.v).out+=c),r=Math.max(r,n.node(s.w).in+=c)});let i=ro(o+r+3).map(function(){return new zh}),a=r+1;return V(n.nodes(),function(s){GS(i,a,n.node(s))}),{graph:n,buckets:i,zeroIdx:a}}function GS(t,e,n){n.out?n.in?t[n.out-n.in+e].enqueue(n):t[t.length-1].enqueue(n):t[0].enqueue(n)}var dQ,CB=C(()=>{lu();ve();Pr();ou();Xc();Ho();kB();dQ=sr(1)});function mQ(t){let e=t.graph().acyclicer==="greedy"?SB(t,n(t)):gQ(t);V(e,function(r){let o=t.edge(r);t.removeEdge(r),o.forwardName=r.name,o.reversed=!0,t.setEdge(r.w,r.v,o,au("rev"))});function n(r){return function(o){return r.edge(o).weight}}}function gQ(t){let e=[],n={},r={};function o(i){ft(r,i)||(r[i]=!0,n[i]=!0,V(t.outEdges(i),function(a){ft(n,a.w)?e.push(a):o(a.w)}),delete n[i])}return V(t.nodes(),o),e}function xQ(t){V(t.edges(),function(e){let n=t.edge(e);if(n.reversed){t.removeEdge(e);let r=n.forwardName;delete n.reversed,delete n.forwardName,t.setEdge(e.w,e.v,n,r)}})}var WS,AB=C(()=>{Ve();Hx();ve();CB();WS={run:mQ,undo:xQ}});var vQ,VS,TB=C(()=>{_n();vQ=function(){return Ht.Date.now()},VS=vQ});function yQ(t,e,n){for(var r=-1,o=t.length;++r<o;){var i=t[r],a=e(i);if(a!=null&&(s===void 0?a===a&&!ar(a):n(a,s)))var s=a,l=i}return l}var Sa,Bh=C(()=>{$s();Sa=yQ});function _Q(t,e){return t>e}var jx,HS=C(()=>{jx=_Q});function bQ(t){return t&&t.length?Sa(t,bn,jx):void 0}var oo,cu=C(()=>{Bh();HS();_i();oo=bQ});function wQ(t,e){return t<e}var Yx,jS=C(()=>{Yx=wQ});function kQ(t){return t&&t.length?Sa(t,bn,Yx):void 0}var Ca,Ux=C(()=>{Bh();jS();_i();Ca=kQ});function SQ(t,e,n){for(var r=-1,o=t.length,i=e.length,a={};++r<o;){var s=r<i?e[r]:void 0;n(a,t[r],s)}return a}var LB,EB=C(()=>{LB=SQ});function CQ(t,e){return LB(t||[],e||[],ba)}var Fh,YS=C(()=>{Mh();EB();Fh=CQ});function MB(t,e,n,r){let o;do o=au(r);while(t.hasNode(o));return n.dummy=e,t.setNode(o,n),o}function US(t){let e=new dt().setGraph(t.graph());return V(t.nodes(),function(n){e.setNode(n,t.node(n))}),V(t.edges(),function(n){let r=e.edge(n.v,n.w)||{weight:0,minlen:1},o=t.edge(n);e.setEdge(n.v,n.w,{weight:r.weight+o.weight,minlen:Math.max(r.minlen,o.minlen)})}),e}function AQ(t){let e=new dt({multigraph:t.isMultigraph()}).setGraph(t.graph());return V(t.nodes(),function(n){t.children(n).length||e.setNode(n,t.node(n))}),V(t.edges(),function(n){e.setEdge(n,t.edge(n))}),e}function TQ(t){let e=$t(t.nodes(),function(n){let r={};return V(t.outEdges(n),function(o){r[o.w]=(r[o.w]||0)+t.edge(o).weight}),r});return Fh(t.nodes(),e)}function LQ(t){let e=$t(t.nodes(),function(n){let r={};return V(t.inEdges(n),function(o){r[o.v]=(r[o.v]||0)+t.edge(o).weight}),r});return Fh(t.nodes(),e)}function EQ(t,e){let n=t.x,r=t.y,o=e.x-n,i=e.y-r,a=t.width/2,s=t.height/2;if(!o&&!i)throw new Error("Not possible to find intersection inside of the rectangle");let l,c;return Math.abs(i)*a>Math.abs(o)*s?(i<0&&(s=-s),l=s*o/i,c=s):(o<0&&(a=-a),l=a,c=a*i/o),{x:n+l,y:r+c}}function MQ(t){let e=$t(ro(RB(t)+1),function(){return[]});return V(t.nodes(),function(n){let r=t.node(n),o=r.rank;te(o)||(e[o][r.order]=n)}),e}function qS(t){let e=Ca($t(t.nodes(),function(n){return t.node(n).rank}));V(t.nodes(),function(n){let r=t.node(n);ft(r,"rank")&&(r.rank-=e)})}function XS(t){let e=Ca($t(t.nodes(),function(i){return t.node(i).rank})),n=[];V(t.nodes(),function(i){let a=t.node(i).rank-e;n[a]||(n[a]=[]),n[a].push(i)});let r=0,o=t.graph().nodeRankFactor;V(n,function(i,a){te(i)&&a%o!==0?--r:r&&V(i,function(s){t.node(s).rank+=r})})}function RQ(t,e,n,r){let o={width:0,height:0};return arguments.length>=4&&(o.rank=n,o.order=r),MB(t,"border",o,e)}function RB(t){return oo($t(t.nodes(),function(e){let n=t.node(e).rank;if(!te(n))return n}))}function PQ(t,e){let n={lhs:[],rhs:[]};return V(t,function(r){e(r)?n.lhs.push(r):n.rhs.push(r)}),n}function IQ(t,e){let n=VS();try{return e()}finally{console.log(t+" time: "+(VS()-n)+"ms")}}function NQ(t,e){return e()}var ee,jo=C(()=>{TB();cu();Ve();Ux();Ds();lu();YS();Pr();ve();Hx();Ho();ee={addDummyNode:MB,simplify:US,asNonCompoundGraph:AQ,successorWeights:TQ,predecessorWeights:LQ,intersectRect:EQ,buildLayerMatrix:MQ,normalizeRanks:qS,removeEmptyRanks:XS,addBorderNode:RQ,maxRank:RB,partition:PQ,time:IQ,notime:NQ}});function $Q(t){t.graph().dummyChains=[],V(t.edges(),function(e){DQ(t,e)})}function DQ(t,e){let n=e.v,r=t.node(n).rank,o=e.w,i=t.node(o).rank,a=e.name,s=t.edge(e),l=s.labelRank;if(i===r+1)return;t.removeEdge(e);let c,u,f;for(f=0,++r;r<i;++f,++r)s.points=[],u={width:0,height:0,edgeLabel:s,edgeObj:e,rank:r},c=ee.addDummyNode(t,"edge",u,"_d"),r===l&&(u.width=s.width,u.height=s.height,u.dummy="edge-label",u.labelpos=s.labelpos),t.setEdge(n,c,{weight:s.weight},a),f===0&&t.graph().dummyChains.push(c),n=c;t.setEdge(n,o,{weight:s.weight},a)}function OQ(t){V(t.graph().dummyChains,function(e){let n=t.node(e),r=n.edgeLabel,o=null;for(t.setEdge(n.edgeObj,r);n.dummy;)o=t.successors(e)[0],t.removeNode(e),r.points.push({x:n.x,y:n.y}),n.dummy==="edge-label"&&(r.x=n.x,r.y=n.y,r.width=n.width,r.height=n.height),e=o,n=t.node(e)})}var ZS,PB=C(()=>{ve();jo();ZS={run:$Q,undo:OQ}});function Gh(t){let e={};function n(r){let o=t.node(r);if(ft(e,r))return o.rank;e[r]=!0;let i=Ca($t(t.outEdges(r),function(a){return n(a.w)-t.edge(a).minlen}))||0;return o.rank=i}V(t.sources(),n)}function Ws(t,e){return t.node(e.w).rank-t.node(e.v).rank-t.edge(e).minlen}var qx=C(()=>{ve();Pr();Ux();Ve()});function zQ(t,e){return t&&t.length?Sa(t,We(e,2),Yx):void 0}var Vs,Xx=C(()=>{Bh();to();jS();Vs=zQ});function Zx(t){let e=new dt({directed:!1}),n=t.nodes()[0],r=t.nodeCount();e.setNode(n,{});let o,i;for(;BQ(e,t)<r;)o=FQ(e,t),i=e.hasNode(o.v)?Ws(t,o):-Ws(t,o),GQ(e,t,i);return e}function BQ(t,e){function n(r){V(e.nodeEdges(r),function(o){let i=o.v,a=r===i?o.w:i;!t.hasNode(a)&&!Ws(e,o)&&(t.setNode(a,{}),t.setEdge(r,a,{}),n(a))})}return V(t.nodes(),n),t.nodeCount()}function FQ(t,e){return Vs(e.edges(),function(n){if(t.hasNode(n.v)!==t.hasNode(n.w))return Ws(e,n)})}function GQ(t,e,n){V(t.nodes(),function(r){e.node(r).rank+=n})}var KS=C(()=>{Xx();ve();Ho();qx()});function WQ(t){return function(e,n,r){var o=Object(e);if(!on(e)){var i=We(n,3);e=we(e),n=function(s){return i(o[s],s,o)}}var a=t(e,n,r);return a>-1?o[i?e[a]:a]:void 0}}var IB,NB=C(()=>{to();Oo();zo();IB=WQ});function VQ(t){var e=su(t),n=e%1;return e===e?n?e-n:e:0}var Wh,QS=C(()=>{BS();Wh=VQ});function jQ(t,e,n){var r=t==null?0:t.length;if(!r)return-1;var o=n==null?0:Wh(n);return o<0&&(o=HQ(r+o,0)),Ax(t,We(e,3),o)}var HQ,$B,DB=C(()=>{pS();to();QS();HQ=Math.max;$B=jQ});var YQ,Vh,JS=C(()=>{NB();DB();YQ=IB($B),Vh=YQ});function Aa(t){t=US(t),Gh(t);let e=Zx(t);eC(e),tC(e,t);let n,r;for(;n=FB(e);)r=GB(e,t,n),WB(e,t,n,r)}function tC(t,e){let n=qQ(t,t.nodes());n=n.slice(0,n.length-1),V(n,function(r){XQ(t,e,r)})}function XQ(t,e,n){let o=t.node(n).parent;t.edge(n,o).cutvalue=zB(t,e,n)}function zB(t,e,n){let o=t.node(n).parent,i=!0,a=e.edge(n,o),s=0;return a||(i=!1,a=e.edge(o,n)),s=a.weight,V(e.nodeEdges(n),function(l){let c=l.v===n,u=c?l.w:l.v;if(u!==o){let f=c===i,d=e.edge(l).weight;if(s+=f?d:-d,KQ(t,n,u)){let h=t.edge(n,u).cutvalue;s+=f?-h:h}}}),s}function eC(t,e){arguments.length<2&&(e=t.nodes()[0]),BB(t,{},1,e)}function BB(t,e,n,r,o){let i=n,a=t.node(r);return e[r]=!0,V(t.neighbors(r),function(s){ft(e,s)||(n=BB(t,e,n,s,r))}),a.low=i,a.lim=n++,o?a.parent=o:delete a.parent,n}function FB(t){return Vh(t.edges(),function(e){return t.edge(e).cutvalue<0})}function GB(t,e,n){let r=n.v,o=n.w;e.hasEdge(r,o)||(r=n.w,o=n.v);let i=t.node(r),a=t.node(o),s=i,l=!1;i.lim>a.lim&&(s=a,l=!0);let c=wn(e.edges(),function(u){return l===OB(t,t.node(u.v),s)&&l!==OB(t,t.node(u.w),s)});return Vs(c,function(u){return Ws(e,u)})}function WB(t,e,n,r){let o=n.v,i=n.w;t.removeEdge(o,i),t.setEdge(r.v,r.w,{}),eC(t),tC(t,e),ZQ(t,e)}function ZQ(t,e){let n=Vh(t.nodes(),function(o){return!e.node(o).parent}),r=UQ(t,n);r=r.slice(1),V(r,function(o){let i=t.node(o).parent,a=e.edge(o,i),s=!1;a||(a=e.edge(i,o),s=!0),e.node(o).rank=e.node(i).rank+(s?a.minlen:-a.minlen)})}function KQ(t,e,n){return t.hasEdge(e,n)}function OB(t,e,n){return n.low<=e.lim&&e.lim<=n.lim}var UQ,qQ,VB=C(()=>{Xx();zs();JS();Ve();ve();Ho();KS();qx();jo();({preorder:UQ,postorder:qQ}=Ih);Aa.initLowLimValues=eC;Aa.initCutValues=tC;Aa.calcCutValue=zB;Aa.leaveEdge=FB;Aa.enterEdge=GB;Aa.exchangeEdges=WB});function jB(t){switch(t.graph().ranker){case"network-simplex":HB(t);break;case"tight-tree":JQ(t);break;case"longest-path":QQ(t);break;default:HB(t)}}function JQ(t){Gh(t),Zx(t)}function HB(t){Aa(t)}var QQ,YB=C(()=>{qx();KS();VB();QQ=Gh});function UB(t){let e=eJ(t);V(t.graph().dummyChains,function(n){let r=t.node(n),o=r.edgeObj,i=tJ(t,e,o.v,o.w),a=i.path,s=i.lca,l=0,c=a[l],u=!0;for(;n!==o.w;){if(r=t.node(n),u){for(;(c=a[l])!==s&&t.node(c).maxRank<r.rank;)l++;c===s&&(u=!1)}if(!u){for(;l<a.length-1&&t.node(c=a[l+1]).minRank<=r.rank;)l++;c=a[l]}t.setParent(n,c),n=t.successors(n)[0]}})}function tJ(t,e,n,r){let o=[],i=[],a=Math.min(e[n].low,e[r].low),s=Math.max(e[n].lim,e[r].lim),l;l=n;do l=t.parent(l),o.push(l);while(l&&(e[l].low>a||s>e[l].lim));let c=l;for(l=r;(l=t.parent(l))!==c;)i.push(l);return{path:o.concat(i.reverse()),lca:c}}function eJ(t){let e={},n=0;function r(o){let i=n;V(t.children(o),r),e[o]={low:i,lim:n++}}return V(t.children(),r),e}var qB=C(()=>{ve()});function nJ(t){let e=ee.addDummyNode(t,"root",{},"_root"),n=rJ(t),r=oo(Rr(n))-1,o=2*r+1;t.graph().nestingRoot=e,V(t.edges(),function(a){t.edge(a).minlen*=o});let i=oJ(t)+1;V(t.children(),function(a){XB(t,e,o,i,r,n,a)}),t.graph().nodeRankFactor=o}function XB(t,e,n,r,o,i,a){let s=t.children(a);if(!s.length){a!==e&&t.setEdge(e,a,{weight:0,minlen:n});return}let l=ee.addBorderNode(t,"_bt"),c=ee.addBorderNode(t,"_bb"),u=t.node(a);t.setParent(l,a),u.borderTop=l,t.setParent(c,a),u.borderBottom=c,V(s,function(f){XB(t,e,n,r,o,i,f);let d=t.node(f),h=d.borderTop?d.borderTop:f,p=d.borderBottom?d.borderBottom:f,g=d.borderTop?r:2*r,m=h!==p?1:o-i[a]+1;t.setEdge(l,h,{weight:g,minlen:m,nestingEdge:!0}),t.setEdge(p,c,{weight:g,minlen:m,nestingEdge:!0})}),t.parent(a)||t.setEdge(e,l,{weight:0,minlen:o+i[a]})}function rJ(t){let e={};function n(r,o){let i=t.children(r);i&&i.length&&V(i,function(a){n(a,o+1)}),e[r]=o}return V(t.children(),function(r){n(r,1)}),e}function oJ(t){return eo(t.edges(),function(e,n){return e+t.edge(n).weight},0)}function iJ(t){let e=t.graph();t.removeNode(e.nestingRoot),delete e.nestingRoot,V(t.edges(),function(n){t.edge(n).nestingEdge&&t.removeEdge(n)})}var nC,ZB=C(()=>{Ah();ve();_x();cu();jo();nC={run:nJ,cleanup:iJ}});function QB(t){function e(n){let r=t.children(n),o=t.node(n);if(r.length&&V(r,e),ft(o,"minRank")){o.borderLeft=[],o.borderRight=[];for(let i=o.minRank,a=o.maxRank+1;i<a;++i)KB(t,"borderLeft","_bl",n,o,i),KB(t,"borderRight","_br",n,o,i)}}V(t.children(),e)}function KB(t,e,n,r,o,i){let a={width:0,height:0,rank:i,borderType:e},s=o[e][i-1],l=ee.addDummyNode(t,"border",a,n);o[e][i]=l,t.setParent(l,r),s&&t.setEdge(s,l,{weight:1})}var JB=C(()=>{Ve();ve();jo()});function aJ(t){let e=t.graph().rankdir.toLowerCase();(e==="lr"||e==="rl")&&eF(t)}function sJ(t){let e=t.graph().rankdir.toLowerCase();(e==="bt"||e==="rl")&&lJ(t),(e==="lr"||e==="rl")&&(cJ(t),eF(t))}function eF(t){V(t.nodes(),function(e){tF(t.node(e))}),V(t.edges(),function(e){tF(t.edge(e))})}function tF(t){let e=t.width;t.width=t.height,t.height=e}function lJ(t){V(t.nodes(),function(e){rC(t.node(e))}),V(t.edges(),function(e){let n=t.edge(e);V(n.points,rC),ft(n,"y")&&rC(n)})}function rC(t){t.y=-t.y}function cJ(t){V(t.nodes(),function(e){oC(t.node(e))}),V(t.edges(),function(e){let n=t.edge(e);V(n.points,oC),ft(n,"x")&&oC(n)})}function oC(t){let e=t.x;t.x=t.y,t.y=e}var iC,nF=C(()=>{Ve();ve();iC={adjust:aJ,undo:sJ}});function dJ(t){return zx(t,uJ|fJ)}var uJ,fJ,rF,oF=C(()=>{CS();uJ=1,fJ=4;rF=dJ});function hJ(t,e){var n=t.length;for(t.sort(e);n--;)t[n]=t[n].value;return t}var iF,aF=C(()=>{iF=hJ});function pJ(t,e){if(t!==e){var n=t!==void 0,r=t===null,o=t===t,i=ar(t),a=e!==void 0,s=e===null,l=e===e,c=ar(e);if(!s&&!c&&!i&&t>e||i&&a&&l&&!s&&!c||r&&a&&l||!n&&l||!o)return 1;if(!r&&!i&&!c&&t<e||c&&n&&o&&!r&&!i||s&&n&&o||!a&&o||!l)return-1}return 0}var sF,lF=C(()=>{$s();sF=pJ});function mJ(t,e,n){for(var r=-1,o=t.criteria,i=e.criteria,a=o.length,s=n.length;++r<a;){var l=sF(o[r],i[r]);if(l){if(r>=s)return l;var c=n[r];return l*(c=="desc"?-1:1)}}return t.index-e.index}var cF,uF=C(()=>{lF();cF=mJ});function gJ(t,e,n){e.length?e=Mr(e,function(i){return Ct(i)?function(a){return va(a,i.length===1?i[0]:i)}:i}):e=[bn];var r=-1;e=Mr(e,sa(We));var o=Rx(t,function(i,a,s){var l=Mr(e,function(c){return c(i)});return{criteria:l,index:++r,value:i}});return iF(o,function(i,a){return cF(i,a,n)})}var fF,dF=C(()=>{jc();Ch();to();_S();aF();ph();uF();_i();Re();fF=gJ});var xJ,wi,Hh=C(()=>{bx();dF();Qc();Nh();xJ=Go(function(t,e){if(t==null)return[];var n=e.length;return n>1&&bi(t,e[0],e[1])?e=[]:n>2&&bi(e[0],e[1],e[2])&&(e=[e[0]]),fF(t,Uc(e,1),[])}),wi=xJ});function hF(t){let e={},n=wn(t.nodes(),function(s){return!t.children(s).length}),r=oo($t(n,function(s){return t.node(s).rank})),o=$t(ro(r+1),function(){return[]});function i(s){if(ft(e,s))return;e[s]=!0;let l=t.node(s);o[l.rank].push(s),V(t.successors(s),i)}let a=wi(n,function(s){return t.node(s).rank});return V(a,i),o}var pF=C(()=>{Hh();ve();Ve();lu();Pr();cu();zs()});function mF(t,e){let n=0;for(let r=1;r<e.length;++r)n+=vJ(t,e[r-1],e[r]);return n}function vJ(t,e,n){let r=Fh(n,$t(n,function(c,u){return u})),o=no($t(e,function(c){let u=t.outEdges(c),f=$t(u,h=>({pos:r[h.w],weight:t.edge(h).weight}));return wi(f,"pos")}),!0),i=1;for(;i<n.length;)i<<=1;let a=2*i-1;i-=1;let s=$t(new Array(a),function(){return 0}),l=0;return V(o.forEach(function(c){let u=c.pos+i;s[u]+=c.weight;let f=0;for(;u>0;)u%2&&(f+=s[u+1]),u=u-1>>1,s[u]+=c.weight;l+=c.weight*f})),l}var gF=C(()=>{ve();Hh();ou();Pr();YS()});function xF(t,e){return $t(e,function(n){let r=t.inEdges(n);if(r.length){let o=eo(r,function(i,a){let s=t.edge(a),l=t.node(a.v);return{sum:i.sum+s.weight*l.order,weight:i.weight+s.weight}},{sum:0,weight:0});return{v:n,barycenter:o.sum/o.weight,weight:o.weight}}else return{v:n}})}var vF=C(()=>{Ah();Pr()});function yF(t,e){let n={};V(t,function(o,i){let a=n[o.v]={indegree:0,in:[],out:[],vs:[o.v],i};te(o.barycenter)||(a.barycenter=o.barycenter,a.weight=o.weight)}),V(e.edges(),function(o){let i=n[o.v],a=n[o.w];!te(i)&&!te(a)&&(a.indegree++,i.out.push(n[o.w]))});let r=wn(n,function(o){return!o.indegree});return yJ(r)}function yJ(t){let e=[];function n(i){return function(a){a.merged||(te(a.barycenter)||te(i.barycenter)||a.barycenter>=i.barycenter)&&_J(i,a)}}function r(i){return function(a){a.in.push(i),--a.indegree===0&&t.push(a)}}for(;t.length;){let i=t.pop();e.push(i),V(i.in.reverse(),n(i)),V(i.out,r(i))}let o=wn(e,function(i){return!i.merged});return $t(o,function(i){return iu(i,["vs","i","barycenter","weight"])})}function _J(t,e){let n=0,r=0;t.weight&&(n+=t.barycenter*t.weight,r+=t.weight),e.weight&&(n+=e.barycenter*e.weight,r+=e.weight),t.vs=e.vs.concat(t.vs),t.barycenter=n/r,t.weight=r,t.i=Math.min(e.i,t.i),e.merged=!0}var _F=C(()=>{$S();Pr();zs();Ds();ve()});function wF(t,e){let n=ee.partition(t,function(u){return ft(u,"barycenter")}),r=n.lhs,o=wi(n.rhs,function(u){return-u.i}),i=[],a=0,s=0,l=0;r.sort(bJ(!!e)),l=bF(i,o,l),V(r,function(u){l+=u.vs.length,i.push(u.vs),a+=u.barycenter*u.weight,s+=u.weight,l=bF(i,o,l)});let c={vs:no(i,!0)};return s&&(c.barycenter=a/s,c.weight=s),c}function bF(t,e,n){let r;for(;e.length&&(r=Gs(e)).i<=n;)e.pop(),t.push(r.vs),n++;return n}function bJ(t){return function(e,n){return e.barycenter<n.barycenter?-1:e.barycenter>n.barycenter?1:t?n.i-e.i:e.i-n.i}}var kF=C(()=>{Vx();ou();ve();Hh();Ve();jo()});function aC(t,e,n,r){let o=t.children(e),i=t.node(e),a=i?i.borderLeft:void 0,s=i?i.borderRight:void 0,l={};a&&(o=wn(o,function(d){return d!==a&&d!==s}));let c=xF(t,o);V(c,function(d){if(t.children(d.v).length){let h=aC(t,d.v,n,r);l[d.v]=h,ft(h,"barycenter")&&kJ(d,h)}});let u=yF(c,n);wJ(u,l);let f=wF(u,r);if(a&&(f.vs=no([a,f.vs,s],!0),t.predecessors(a).length)){let d=t.node(t.predecessors(a)[0]),h=t.node(t.predecessors(s)[0]);ft(f,"barycenter")||(f.barycenter=0,f.weight=0),f.barycenter=(f.barycenter*f.weight+d.order+h.order)/(f.weight+2),f.weight+=2}return f}function wJ(t,e){V(t,function(n){n.vs=no(n.vs.map(function(r){return e[r]?e[r].vs:r}),!0)})}function kJ(t,e){te(t.barycenter)?(t.barycenter=e.barycenter,t.weight=e.weight):(t.barycenter=(t.barycenter*t.weight+e.barycenter*e.weight)/(t.weight+e.weight),t.weight+=e.weight)}var SF=C(()=>{Ds();ou();Ve();ve();zs();vF();_F();kF()});function CF(t,e,n){let r=SJ(t),o=new dt({compound:!0}).setGraph({root:r}).setDefaultNodeLabel(function(i){return t.node(i)});return V(t.nodes(),function(i){let a=t.node(i),s=t.parent(i);(a.rank===e||a.minRank<=e&&e<=a.maxRank)&&(o.setNode(i),o.setParent(i,s||r),V(t[n](i),function(l){let c=l.v===i?l.w:l.v,u=o.edge(c,i),f=te(u)?0:u.weight;o.setEdge(c,i,{weight:t.edge(l).weight+f})}),ft(a,"minRank")&&o.setNode(i,{borderLeft:a.borderLeft[e],borderRight:a.borderRight[e]}))}),o}function SJ(t){let e;for(;t.hasNode(e=au("_root")););return e}var AF=C(()=>{Hx();Ve();Ds();ve();Ho()});function TF(t,e,n){let r={},o;V(n,function(i){let a=t.parent(i),s,l;for(;a;){if(s=t.parent(a),s?(l=r[s],r[s]=a):(l=o,o=a),l&&l!==a){e.setEdge(l,a);return}a=s}})}var LF=C(()=>{ve()});function RF(t){let e=ee.maxRank(t),n=EF(t,ro(1,e+1),"inEdges"),r=EF(t,ro(e-1,-1,-1),"outEdges"),o=hF(t);MF(t,o);let i=Number.POSITIVE_INFINITY,a;for(let s=0,l=0;l<4;++s,++l){CJ(s%2?n:r,s%4>=2),o=ee.buildLayerMatrix(t);let c=mF(t,o);c<i&&(l=0,a=rF(o),i=c)}MF(t,a)}function EF(t,e,n){return $t(e,function(r){return CF(t,r,n)})}function CJ(t,e){let n=new dt;V(t,function(r){let o=r.graph().root,i=aC(r,o,n,e);V(i.vs,function(a,s){r.node(a).order=s}),TF(r,n,i.vs)})}function MF(t,e){V(e,function(n){V(n,function(r,o){t.node(r).order=o})})}var PF=C(()=>{ve();Pr();oF();lu();Ho();pF();gF();SF();AF();LF();jo()});var AJ,uu,sC=C(()=>{nS();AJ=Is&&new Is,uu=AJ});var TJ,Kx,lC=C(()=>{_i();sC();TJ=uu?function(t,e){return uu.set(t,e),t}:bn,Kx=TJ});function LJ(t){return function(){var e=arguments;switch(e.length){case 0:return new t;case 1:return new t(e[0]);case 2:return new t(e[0],e[1]);case 3:return new t(e[0],e[1],e[2]);case 4:return new t(e[0],e[1],e[2],e[3]);case 5:return new t(e[0],e[1],e[2],e[3],e[4]);case 6:return new t(e[0],e[1],e[2],e[3],e[4],e[5]);case 7:return new t(e[0],e[1],e[2],e[3],e[4],e[5],e[6])}var n=Vo(t.prototype),r=t.apply(n,e);return Kt(r)?r:n}}var ki,jh=C(()=>{eu();Wn();ki=LJ});function MJ(t,e,n){var r=e&EJ,o=ki(t);function i(){var a=this&&this!==Ht&&this instanceof i?o:t;return a.apply(r?n:this,arguments)}return i}var EJ,IF,NF=C(()=>{jh();_n();EJ=1;IF=MJ});function PJ(t,e,n,r){for(var o=-1,i=t.length,a=n.length,s=-1,l=e.length,c=RJ(i-a,0),u=Array(l+c),f=!r;++s<l;)u[s]=e[s];for(;++o<a;)(f||o<i)&&(u[n[o]]=t[o]);for(;c--;)u[s++]=t[o++];return u}var RJ,Qx,cC=C(()=>{RJ=Math.max;Qx=PJ});function NJ(t,e,n,r){for(var o=-1,i=t.length,a=-1,s=n.length,l=-1,c=e.length,u=IJ(i-s,0),f=Array(u+c),d=!r;++o<u;)f[o]=t[o];for(var h=o;++l<c;)f[h+l]=e[l];for(;++a<s;)(d||o<i)&&(f[h+n[a]]=t[o++]);return f}var IJ,Jx,uC=C(()=>{IJ=Math.max;Jx=NJ});function $J(t,e){for(var n=t.length,r=0;n--;)t[n]===e&&++r;return r}var $F,DF=C(()=>{$F=$J});function DJ(){}var fu,tv=C(()=>{fu=DJ});function ev(t){this.__wrapped__=t,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=OJ,this.__views__=[]}var OJ,du,nv=C(()=>{eu();tv();OJ=4294967295;ev.prototype=Vo(fu.prototype);ev.prototype.constructor=ev;du=ev});var zJ,rv,fC=C(()=>{sC();gS();zJ=uu?function(t){return uu.get(t)}:Lx,rv=zJ});var BJ,dC,OF=C(()=>{BJ={},dC=BJ});function WJ(t){for(var e=t.name+"",n=dC[e],r=GJ.call(dC,e)?n.length:0;r--;){var o=n[r],i=o.func;if(i==null||i==t)return o.name}return e}var FJ,GJ,zF,BF=C(()=>{OF();FJ=Object.prototype,GJ=FJ.hasOwnProperty;zF=WJ});function ov(t,e){this.__wrapped__=t,this.__actions__=[],this.__chain__=!!e,this.__index__=0,this.__values__=void 0}var Yh,hC=C(()=>{eu();tv();ov.prototype=Vo(fu.prototype);ov.prototype.constructor=ov;Yh=ov});function VJ(t){if(t instanceof du)return t.clone();var e=new Yh(t.__wrapped__,t.__chain__);return e.__actions__=wa(t.__actions__),e.__index__=t.__index__,e.__values__=t.__values__,e}var FF,GF=C(()=>{nv();hC();Rh();FF=VJ});function iv(t){if(be(t)&&!Ct(t)&&!(t instanceof du)){if(t instanceof Yh)return t;if(jJ.call(t,"__wrapped__"))return FF(t)}return new Yh(t)}var HJ,jJ,WF,VF=C(()=>{nv();hC();tv();Re();Lr();GF();HJ=Object.prototype,jJ=HJ.hasOwnProperty;iv.prototype=fu.prototype;iv.prototype.constructor=iv;WF=iv});function YJ(t){var e=zF(t),n=WF[e];if(typeof n!="function"||!(e in du.prototype))return!1;if(t===n)return!0;var r=rv(n);return!!r&&t===r[0]}var HF,jF=C(()=>{nv();fC();BF();VF();HF=YJ});var UJ,av,pC=C(()=>{lC();hS();UJ=Sx(Kx),av=UJ});function ZJ(t){var e=t.match(qJ);return e?e[1].split(XJ):[]}var qJ,XJ,YF,UF=C(()=>{qJ=/\{\n\/\* \[wrapped with (.+)\] \*/,XJ=/,? & /;YF=ZJ});function QJ(t,e){var n=e.length;if(!n)return t;var r=n-1;return e[r]=(n>1?"& ":"")+e[r],e=e.join(n>2?", ":" "),t.replace(KJ,`{
|
|
3
|
+
/* [wrapped with `+e+`] */
|
|
4
|
+
`)}var KJ,qF,XF=C(()=>{KJ=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/;qF=QJ});function ctt(t,e){return ya(ltt,function(n){var r="_."+n[0];e&n[1]&&!Tx(t,r)&&t.push(r)}),t.sort()}var JJ,ttt,ett,ntt,rtt,ott,itt,att,stt,ltt,ZF,KF=C(()=>{Th();mS();JJ=1,ttt=2,ett=8,ntt=16,rtt=32,ott=64,itt=128,att=256,stt=512,ltt=[["ary",itt],["bind",JJ],["bindKey",ttt],["curry",ett],["curryRight",ntt],["flip",stt],["partial",rtt],["partialRight",ott],["rearg",att]];ZF=ctt});function utt(t,e,n){var r=e+"";return Kc(t,qF(r,ZF(YF(r),n)))}var sv,mC=C(()=>{UF();XF();Cx();KF();sv=utt});function mtt(t,e,n,r,o,i,a,s,l,c){var u=e&ptt,f=u?a:void 0,d=u?void 0:a,h=u?i:void 0,p=u?void 0:i;e|=u?QF:JF,e&=~(u?JF:QF),e&htt||(e&=~(ftt|dtt));var g=[t,e,o,h,f,p,d,s,l,c],m=n.apply(void 0,g);return HF(t)&&av(m,g),m.placeholder=r,sv(m,t,e)}var ftt,dtt,htt,ptt,QF,JF,lv,gC=C(()=>{jF();pC();mC();ftt=1,dtt=2,htt=4,ptt=8,QF=32,JF=64;lv=mtt});function gtt(t){var e=t;return e.placeholder}var hu,cv=C(()=>{hu=gtt});function vtt(t,e){for(var n=t.length,r=xtt(e.length,n),o=wa(t);r--;){var i=e[r];t[r]=$o(i,n)?o[i]:void 0}return t}var xtt,t5,e5=C(()=>{Rh();Mc();xtt=Math.min;t5=vtt});function ytt(t,e){for(var n=-1,r=t.length,o=0,i=[];++n<r;){var a=t[n];(a===e||a===n5)&&(t[n]=n5,i[o++]=n)}return i}var n5,Si,Uh=C(()=>{n5="__lodash_placeholder__";Si=ytt});function r5(t,e,n,r,o,i,a,s,l,c){var u=e&Stt,f=e&_tt,d=e&btt,h=e&(wtt|ktt),p=e&Ctt,g=d?void 0:ki(t);function m(){for(var x=arguments.length,y=Array(x),_=x;_--;)y[_]=arguments[_];if(h)var v=hu(m),b=$F(y,v);if(r&&(y=Qx(y,r,o,h)),i&&(y=Jx(y,i,a,h)),x-=b,h&&x<c){var w=Si(y,v);return lv(t,e,r5,m.placeholder,n,y,w,s,l,c-x)}var A=f?n:this,L=d?A[t]:t;return x=y.length,s?y=t5(y,s):p&&x>1&&y.reverse(),u&&l<x&&(y.length=l),this&&this!==Ht&&this instanceof m&&(L=g||ki(L)),L.apply(A,y)}return m}var _tt,btt,wtt,ktt,Stt,Ctt,uv,xC=C(()=>{cC();uC();DF();jh();gC();cv();e5();Uh();_n();_tt=1,btt=2,wtt=8,ktt=16,Stt=128,Ctt=512;uv=r5});function Att(t,e,n){var r=ki(t);function o(){for(var i=arguments.length,a=Array(i),s=i,l=hu(o);s--;)a[s]=arguments[s];var c=i<3&&a[0]!==l&&a[i-1]!==l?[]:Si(a,l);if(i-=c.length,i<n)return lv(t,e,uv,o.placeholder,void 0,a,c,void 0,void 0,n-i);var u=this&&this!==Ht&&this instanceof o?r:t;return qc(u,this,a)}return o}var o5,i5=C(()=>{wx();jh();xC();gC();cv();Uh();_n();o5=Att});function Ltt(t,e,n,r){var o=e&Ttt,i=ki(t);function a(){for(var s=-1,l=arguments.length,c=-1,u=r.length,f=Array(u+l),d=this&&this!==Ht&&this instanceof a?i:t;++c<u;)f[c]=r[c];for(;l--;)f[c++]=arguments[++s];return qc(d,o?n:this,f)}return a}var Ttt,a5,s5=C(()=>{wx();jh();_n();Ttt=1;a5=Ltt});function Ptt(t,e){var n=t[1],r=e[1],o=n|r,i=o<(vC|Ett|qh),a=r==qh&&n==c5||r==qh&&n==u5&&t[7].length<=e[8]||r==(qh|u5)&&e[7].length<=e[8]&&n==c5;if(!(i||a))return t;r&vC&&(t[2]=e[2],o|=n&vC?0:Mtt);var s=e[3];if(s){var l=t[3];t[3]=l?Qx(l,s,e[4]):s,t[4]=l?Si(t[3],l5):e[4]}return s=e[5],s&&(l=t[5],t[5]=l?Jx(l,s,e[6]):s,t[6]=l?Si(t[5],l5):e[6]),s=e[7],s&&(t[7]=s),r&qh&&(t[8]=t[8]==null?e[8]:Rtt(t[8],e[8])),t[9]==null&&(t[9]=e[9]),t[0]=e[0],t[1]=o,t}var l5,vC,Ett,Mtt,c5,qh,u5,Rtt,f5,d5=C(()=>{cC();uC();Uh();l5="__lodash_placeholder__",vC=1,Ett=2,Mtt=4,c5=8,qh=128,u5=256,Rtt=Math.min;f5=Ptt});function $tt(t,e,n,r,o,i,a,s){var l=e&Ntt;if(!l&&typeof t!="function")throw new TypeError(Itt);var c=r?r.length:0;if(c||(e&=~(bC|p5),r=o=void 0),a=a===void 0?a:m5(Wh(a),0),s=s===void 0?s:Wh(s),c-=o?o.length:0,e&p5){var u=r,f=o;r=o=void 0}var d=l?void 0:rv(t),h=[t,e,n,r,o,u,f,i,a,s];if(d&&f5(h,d),t=h[0],e=h[1],n=h[2],r=h[3],o=h[4],s=h[9]=h[9]===void 0?l?0:t.length:m5(h[9]-c,0),!s&&e&(yC|_C)&&(e&=~(yC|_C)),!e||e==h5)var p=IF(t,e,n);else e==yC||e==_C?p=o5(t,e,s):(e==bC||e==(h5|bC))&&!o.length?p=a5(t,e,n,r):p=uv.apply(void 0,h);var g=d?Kx:av;return sv(g(p,h),t,e)}var Itt,h5,Ntt,yC,_C,bC,p5,m5,g5,x5=C(()=>{lC();NF();i5();xC();s5();fC();d5();pC();mC();QS();Itt="Expected a function",h5=1,Ntt=2,yC=8,_C=16,bC=32,p5=64,m5=Math.max;g5=$tt});var Dtt,Ott,wC,v5,y5=C(()=>{Qc();x5();cv();Uh();Dtt=1,Ott=32,wC=Go(function(t,e,n){var r=Dtt;if(n.length){var o=Si(n,hu(wC));r|=Ott}return g5(t,r,e,n,o)});wC.placeholder={};v5=wC});function ztt(t,e){return t&&t.length?Sa(t,We(e,2),jx):void 0}var _5,b5=C(()=>{Bh();HS();to();_5=ztt});function Btt(t,e){return Mr(e,function(n){return[n,t[n]]})}var w5,k5=C(()=>{jc();w5=Btt});function Ftt(t){var e=-1,n=Array(t.size);return t.forEach(function(r){n[++e]=[r,r]}),n}var S5,C5=C(()=>{S5=Ftt});function Vtt(t){return function(e){var n=In(e);return n==Gtt?nx(e):n==Wtt?S5(e):w5(e,t(e))}}var Gtt,Wtt,A5,T5=C(()=>{k5();ga();Xk();C5();Gtt="[object Map]",Wtt="[object Set]";A5=Vtt});var Htt,kC,L5=C(()=>{T5();zo();Htt=A5(we),kC=Htt});function jtt(t,e){let n={};function r(o,i){let a=0,s=0,l=o.length,c=Gs(i);return V(i,function(u,f){let d=Utt(t,u),h=d?t.node(d).order:l;(d||u===c)&&(V(i.slice(s,f+1),function(p){V(t.predecessors(p),function(g){let m=t.node(g),x=m.order;(x<a||h<x)&&!(m.dummy&&t.node(p).dummy)&&M5(n,g,p)})}),s=f+1,a=h)}),i}return eo(e,r),n}function Ytt(t,e){let n={};function r(i,a,s,l,c){let u;V(ro(a,s),function(f){u=i[f],t.node(u).dummy&&V(t.predecessors(u),function(d){let h=t.node(d);h.dummy&&(h.order<l||h.order>c)&&M5(n,d,u)})})}function o(i,a){let s=-1,l,c=0;return V(a,function(u,f){if(t.node(u).dummy==="border"){let d=t.predecessors(u);d.length&&(l=t.node(d[0]).order,r(a,c,f,s,l),c=f,s=l)}r(a,c,a.length,l,i.length)}),a}return eo(e,o),n}function Utt(t,e){if(t.node(e).dummy)return Vh(t.predecessors(e),function(n){return t.node(n).dummy})}function M5(t,e,n){if(e>n){let o=e;e=n,n=o}let r=t[e];r||(t[e]=r={}),r[n]=!0}function qtt(t,e,n){if(e>n){let r=e;e=n,n=r}return ft(t[e],n)}function Xtt(t,e,n,r){let o={},i={},a={};return V(e,function(s){V(s,function(l,c){o[l]=l,i[l]=l,a[l]=c})}),V(e,function(s){let l=-1;V(s,function(c){let u=r(c);if(u.length){u=wi(u,function(d){return a[d]});let f=(u.length-1)/2;for(let d=Math.floor(f),h=Math.ceil(f);d<=h;++d){let p=u[d];i[c]===c&&l<a[p]&&!qtt(n,c,p)&&(i[p]=c,i[c]=o[c]=o[p],l=a[p])}}})}),{root:o,align:i}}function Ztt(t,e,n,r,o){let i={},a=Ktt(t,e,n,o),s={};function l(f){ft(s,f)||(s[f]=!0,i[f]=eo(a.inEdges(f),function(d,h){return l(h.v),Math.max(d,i[h.v]+a.edge(h))},0))}V(a.nodes(),l);let c=o?"borderLeft":"borderRight";function u(f){if(s[f]!==2){s[f]++;let d=t.node(f),h=eo(a.outEdges(f),function(p,g){return u(g.w),Math.min(p,i[g.w]-a.edge(g))},Number.POSITIVE_INFINITY);h!==Number.POSITIVE_INFINITY&&d.borderType!==c&&(i[f]=Math.max(i[f],h))}}return V(a.nodes(),u),V(r,function(f){i[f]=i[n[f]]}),i}function Ktt(t,e,n,r){let o=new dt,i=t.graph(),a=eet(i.nodesep,i.edgesep,r);return V(e,function(s){let l;V(s,function(c){let u=n[c];if(o.setNode(u),l){let f=n[l],d=o.edge(f,u);o.setEdge(f,u,Math.max(a(t,c,l),d||0))}l=c})}),o}function Qtt(t,e){return Vs(Rr(e),function(n){let r=(Vs(kC(n),i=>i[1]-E5(t,i[0])/2)||["k",0])[1];return(_5(kC(n),i=>i[1]+E5(t,i[0])/2)||["k",0])[1]-r})}function Jtt(t,e){let n=Rr(e),r=Ca(n),o=oo(n);V(["u","d"],function(i){V(["l","r"],function(a){let s=i+a,l=t[s];if(l===e)return;let c=Rr(l),u=a==="l"?r-Ca(c):o-oo(c);u&&(t[s]=ru(l,function(f){return f+u}))})})}function tet(t,e){return ru(t.ul,function(n,r){if(e)return t[e.toLowerCase()][r];{let o=wi($t(t,r));return(o[1]+o[2])/2}})}function R5(t){let e=ee.buildLayerMatrix(t),n=Oh(jtt(t,e),Ytt(t,e)),r={},o;V(["u","d"],function(a){o=a==="u"?e:Rr(e).reverse(),V(["l","r"],function(s){s==="r"&&(o=$t(o,function(f){return Rr(f).reverse()}));let l=v5(a==="u"?t.predecessors:t.successors,t),c=Xtt(t,o,n,l),u=Ztt(t,o,c.root,c.align,s==="r");s==="r"&&(u=ru(u,function(f){return-f})),r[a+s]=u})});let i=Qtt(t,r);return Jtt(r,i),tet(r,t.graph().align)}function eet(t,e,n){return function(r,o,i){let a=r.node(o),s=r.node(i),l=0,c;if(l+=a.width/2,ft(a,"labelpos"))switch(a.labelpos.toLowerCase()){case"l":c=-a.width/2;break;case"r":c=a.width/2;break}if(c&&(l+=n?c:-c),c=0,l+=(a.dummy?e:t)/2,l+=(s.dummy?e:t)/2,l+=s.width/2,ft(s,"labelpos"))switch(s.labelpos.toLowerCase()){case"l":c=s.width/2;break;case"r":c=-s.width/2;break}return c&&(l+=n?c:-c),c=0,l}}function E5(t,e){return t.node(e).width}var P5=C(()=>{y5();zS();Pr();NS();cu();Ux();b5();L5();_x();Xx();Hh();Ve();JS();lu();Ah();ve();Vx();Ho();jo()});function I5(t){t=ee.asNonCompoundGraph(t),net(t),V(R5(t),function(e,n){t.node(n).x=e})}function net(t){let e=ee.buildLayerMatrix(t),n=t.graph().ranksep,r=0;V(e,function(o){let i=oo($t(o,function(a){return t.node(a).height}));V(o,function(a){t.node(a).y=r+i/2}),r+=i+n})}var N5=C(()=>{Pr();cu();ve();jo();P5()});function AC(t,e){let n=e&&e.debugTiming?ee.time:ee.notime;n("layout",function(){let r=n(" buildLayoutGraph",function(){return pet(t)});n(" runLayout",function(){ret(r,n)}),n(" updateInputGraph",function(){oet(t,r)})})}function ret(t,e){e(" makeSpaceForEdgeLabels",function(){met(t)}),e(" removeSelfEdges",function(){Cet(t)}),e(" acyclic",function(){WS.run(t)}),e(" nestingGraph.run",function(){nC.run(t)}),e(" rank",function(){jB(ee.asNonCompoundGraph(t))}),e(" injectEdgeLabelProxies",function(){get(t)}),e(" removeEmptyRanks",function(){XS(t)}),e(" nestingGraph.cleanup",function(){nC.cleanup(t)}),e(" normalizeRanks",function(){qS(t)}),e(" assignRankMinMax",function(){xet(t)}),e(" removeEdgeLabelProxies",function(){vet(t)}),e(" normalize.run",function(){ZS.run(t)}),e(" parentDummyChains",function(){UB(t)}),e(" addBorderSegments",function(){QB(t)}),e(" order",function(){RF(t)}),e(" insertSelfEdges",function(){Aet(t)}),e(" adjustCoordinateSystem",function(){iC.adjust(t)}),e(" position",function(){I5(t)}),e(" positionSelfEdges",function(){Tet(t)}),e(" removeBorderNodes",function(){ket(t)}),e(" normalize.undo",function(){ZS.undo(t)}),e(" fixupEdgeLabelCoords",function(){bet(t)}),e(" undoCoordinateSystem",function(){iC.undo(t)}),e(" translateGraph",function(){yet(t)}),e(" assignNodeIntersects",function(){_et(t)}),e(" reversePoints",function(){wet(t)}),e(" acyclic.undo",function(){WS.undo(t)})}function oet(t,e){V(t.nodes(),function(n){let r=t.node(n),o=e.node(n);r&&(r.x=o.x,r.y=o.y,e.children(n).length&&(r.width=o.width,r.height=o.height))}),V(t.edges(),function(n){let r=t.edge(n),o=e.edge(n);r.points=o.points,ft(o,"x")&&(r.x=o.x,r.y=o.y)}),t.graph().width=e.graph().width,t.graph().height=e.graph().height}function pet(t){let e=new dt({multigraph:!0,compound:!0}),n=CC(t.graph());return e.setGraph(Oh({},aet,SC(n,iet),iu(n,set))),V(t.nodes(),function(r){let o=CC(t.node(r));e.setNode(r,Wz(SC(o,cet),uet)),e.setParent(r,t.parent(r))}),V(t.edges(),function(r){let o=CC(t.edge(r));e.setEdge(r,Oh({},det,SC(o,fet),iu(o,het)))}),e}function met(t){let e=t.graph();e.ranksep/=2,V(t.edges(),function(n){let r=t.edge(n);r.minlen*=2,r.labelpos.toLowerCase()!=="c"&&(e.rankdir==="TB"||e.rankdir==="BT"?r.width+=r.labeloffset:r.height+=r.labeloffset)})}function get(t){V(t.edges(),function(e){let n=t.edge(e);if(n.width&&n.height){let r=t.node(e.v),i={rank:(t.node(e.w).rank-r.rank)/2+r.rank,e};ee.addDummyNode(t,"edge-proxy",i,"_ep")}})}function xet(t){let e=0;V(t.nodes(),function(n){let r=t.node(n);r.borderTop&&(r.minRank=t.node(r.borderTop).rank,r.maxRank=t.node(r.borderBottom).rank,e=Math.max(e,r.maxRank))}),t.graph().maxRank=e}function vet(t){V(t.nodes(),function(e){let n=t.node(e);n.dummy==="edge-proxy"&&(t.edge(n.e).labelRank=n.rank,t.removeNode(e))})}function yet(t){let e=Number.POSITIVE_INFINITY,n=0,r=Number.POSITIVE_INFINITY,o=0,i=t.graph(),a=i.marginx||0,s=i.marginy||0;function l(c){let u=c.x,f=c.y,d=c.width,h=c.height;e=Math.min(e,u-d/2),n=Math.max(n,u+d/2),r=Math.min(r,f-h/2),o=Math.max(o,f+h/2)}V(t.nodes(),function(c){l(t.node(c))}),V(t.edges(),function(c){let u=t.edge(c);ft(u,"x")&&l(u)}),e-=a,r-=s,V(t.nodes(),function(c){let u=t.node(c);u.x-=e,u.y-=r}),V(t.edges(),function(c){let u=t.edge(c);V(u.points,function(f){f.x-=e,f.y-=r}),ft(u,"x")&&(u.x-=e),ft(u,"y")&&(u.y-=r)}),i.width=n-e+a,i.height=o-r+s}function _et(t){V(t.edges(),function(e){let n=t.edge(e),r=t.node(e.v),o=t.node(e.w),i=null,a=null;n.points?(i=n.points[0],a=n.points[n.points.length-1]):(n.points=[],i=o,a=r),n.points.unshift(ee.intersectRect(r,i)),n.points.push(ee.intersectRect(o,a))})}function bet(t){V(t.edges(),function(e){let n=t.edge(e);if(ft(n,"x"))switch((n.labelpos==="l"||n.labelpos==="r")&&(n.width-=n.labeloffset),n.labelpos){case"l":n.x-=n.width/2+n.labeloffset;break;case"r":n.x+=n.width/2+n.labeloffset;break}})}function wet(t){V(t.edges(),function(e){let n=t.edge(e);n.reversed&&n.points.reverse()})}function ket(t){V(t.nodes(),function(e){if(t.children(e).length){let n=t.node(e),r=t.node(n.borderTop),o=t.node(n.borderBottom),i=t.node(Gs(n.borderLeft)),a=t.node(Gs(n.borderRight));n.width=Math.abs(a.x-i.x),n.height=Math.abs(o.y-r.y),n.x=i.x+n.width/2,n.y=r.y+n.height/2}}),V(t.nodes(),function(e){t.node(e).dummy==="border"&&t.removeNode(e)})}function Cet(t){V(t.edges(),function(e){if(e.v===e.w){let n=t.node(e.v);n.selfEdges||(n.selfEdges=[]),n.selfEdges.push({e,label:t.edge(e)}),t.removeEdge(e)}})}function Aet(t){let e=ee.buildLayerMatrix(t);V(e,function(n){let r=0;V(n,function(o,i){let a=t.node(o);a.order=i+r,V(a.selfEdges,function(s){ee.addDummyNode(t,"selfedge",{width:s.label.width,height:s.label.height,rank:a.rank,order:i+ ++r,e:s.e,label:s.label},"_se")}),delete a.selfEdges})})}function Tet(t){V(t.nodes(),function(e){let n=t.node(e);if(n.dummy==="selfedge"){let r=t.node(n.e.v),o=r.x+r.width/2,i=r.y,a=n.x-o,s=r.height/2;t.setEdge(n.e,n.label),t.removeNode(e),n.label.points=[{x:o+2*a/3,y:i-s},{x:o+5*a/6,y:i-s},{x:o+a,y:i},{x:o+5*a/6,y:i+s},{x:o+2*a/3,y:i+s}],n.label.x=n.x,n.label.y=n.y}})}function SC(t,e){return ru(iu(t,e),Number)}function CC(t){let e={};return V(t,function(n,r){e[r.toLowerCase()]=n}),e}var iet,aet,set,cet,uet,fet,det,het,$5=C(()=>{NS();Vx();Vz();$S();zS();Ve();ve();Ho();AB();PB();YB();jo();qB();ZB();JB();nF();PF();N5();iet=["nodesep","edgesep","ranksep","marginx","marginy"],aet={ranksep:50,edgesep:20,nodesep:50,rankdir:"tb"},set=["acyclicer","ranker","rankdir","align"],cet=["width","height"],uet={width:0,height:0},fet=["minlen","weight","width","height","labeloffset"],det={minlen:1,weight:1,width:0,height:0,labeloffset:10,labelpos:"r"},het=["labelpos"]});var D5={};Wt(D5,{default:()=>Eet,layout:()=>Let});var Let,Eet,O5=C(()=>{$5();Let=AC,Eet={layout:AC}});function z5(t,e){var n,r=1;t==null&&(t=0),e==null&&(e=0);function o(){var i,a=n.length,s,l=0,c=0;for(i=0;i<a;++i)s=n[i],l+=s.x,c+=s.y;for(l=(l/a-t)*r,c=(c/a-e)*r,i=0;i<a;++i)s=n[i],s.x-=l,s.y-=c}return o.initialize=function(i){n=i},o.x=function(i){return arguments.length?(t=+i,o):t},o.y=function(i){return arguments.length?(e=+i,o):e},o.strength=function(i){return arguments.length?(r=+i,o):r},o}var B5=C(()=>{});function F5(t){let e=+this._x.call(null,t),n=+this._y.call(null,t);return G5(this.cover(e,n),e,n,t)}function G5(t,e,n,r){if(isNaN(e)||isNaN(n))return t;var o,i=t._root,a={data:r},s=t._x0,l=t._y0,c=t._x1,u=t._y1,f,d,h,p,g,m,x,y;if(!i)return t._root=a,t;for(;i.length;)if((g=e>=(f=(s+c)/2))?s=f:c=f,(m=n>=(d=(l+u)/2))?l=d:u=d,o=i,!(i=i[x=m<<1|g]))return o[x]=a,t;if(h=+t._x.call(null,i.data),p=+t._y.call(null,i.data),e===h&&n===p)return a.next=i,o?o[x]=a:t._root=a,t;do o=o?o[x]=new Array(4):t._root=new Array(4),(g=e>=(f=(s+c)/2))?s=f:c=f,(m=n>=(d=(l+u)/2))?l=d:u=d;while((x=m<<1|g)===(y=(p>=d)<<1|h>=f));return o[y]=i,o[x]=a,t}function W5(t){var e,n,r=t.length,o,i,a=new Array(r),s=new Array(r),l=1/0,c=1/0,u=-1/0,f=-1/0;for(n=0;n<r;++n)isNaN(o=+this._x.call(null,e=t[n]))||isNaN(i=+this._y.call(null,e))||(a[n]=o,s[n]=i,o<l&&(l=o),o>u&&(u=o),i<c&&(c=i),i>f&&(f=i));if(l>u||c>f)return this;for(this.cover(l,c).cover(u,f),n=0;n<r;++n)G5(this,a[n],s[n],t[n]);return this}var V5=C(()=>{});function H5(t,e){if(isNaN(t=+t)||isNaN(e=+e))return this;var n=this._x0,r=this._y0,o=this._x1,i=this._y1;if(isNaN(n))o=(n=Math.floor(t))+1,i=(r=Math.floor(e))+1;else{for(var a=o-n||1,s=this._root,l,c;n>t||t>=o||r>e||e>=i;)switch(c=(e<r)<<1|t<n,l=new Array(4),l[c]=s,s=l,a*=2,c){case 0:o=n+a,i=r+a;break;case 1:n=o-a,i=r+a;break;case 2:o=n+a,r=i-a;break;case 3:n=o-a,r=i-a;break}this._root&&this._root.length&&(this._root=s)}return this._x0=n,this._y0=r,this._x1=o,this._y1=i,this}var j5=C(()=>{});function Y5(){var t=[];return this.visit(function(e){if(!e.length)do t.push(e.data);while(e=e.next)}),t}var U5=C(()=>{});function q5(t){return arguments.length?this.cover(+t[0][0],+t[0][1]).cover(+t[1][0],+t[1][1]):isNaN(this._x0)?void 0:[[this._x0,this._y0],[this._x1,this._y1]]}var X5=C(()=>{});function an(t,e,n,r,o){this.node=t,this.x0=e,this.y0=n,this.x1=r,this.y1=o}var fv=C(()=>{});function Z5(t,e,n){var r,o=this._x0,i=this._y0,a,s,l,c,u=this._x1,f=this._y1,d=[],h=this._root,p,g;for(h&&d.push(new an(h,o,i,u,f)),n==null?n=1/0:(o=t-n,i=e-n,u=t+n,f=e+n,n*=n);p=d.pop();)if(!(!(h=p.node)||(a=p.x0)>u||(s=p.y0)>f||(l=p.x1)<o||(c=p.y1)<i))if(h.length){var m=(a+l)/2,x=(s+c)/2;d.push(new an(h[3],m,x,l,c),new an(h[2],a,x,m,c),new an(h[1],m,s,l,x),new an(h[0],a,s,m,x)),(g=(e>=x)<<1|t>=m)&&(p=d[d.length-1],d[d.length-1]=d[d.length-1-g],d[d.length-1-g]=p)}else{var y=t-+this._x.call(null,h.data),_=e-+this._y.call(null,h.data),v=y*y+_*_;if(v<n){var b=Math.sqrt(n=v);o=t-b,i=e-b,u=t+b,f=e+b,r=h.data}}return r}var K5=C(()=>{fv()});function Q5(t){if(isNaN(u=+this._x.call(null,t))||isNaN(f=+this._y.call(null,t)))return this;var e,n=this._root,r,o,i,a=this._x0,s=this._y0,l=this._x1,c=this._y1,u,f,d,h,p,g,m,x;if(!n)return this;if(n.length)for(;;){if((p=u>=(d=(a+l)/2))?a=d:l=d,(g=f>=(h=(s+c)/2))?s=h:c=h,e=n,!(n=n[m=g<<1|p]))return this;if(!n.length)break;(e[m+1&3]||e[m+2&3]||e[m+3&3])&&(r=e,x=m)}for(;n.data!==t;)if(o=n,!(n=n.next))return this;return(i=n.next)&&delete n.next,o?(i?o.next=i:delete o.next,this):e?(i?e[m]=i:delete e[m],(n=e[0]||e[1]||e[2]||e[3])&&n===(e[3]||e[2]||e[1]||e[0])&&!n.length&&(r?r[x]=n:this._root=n),this):(this._root=i,this)}function J5(t){for(var e=0,n=t.length;e<n;++e)this.remove(t[e]);return this}var tG=C(()=>{});function eG(){return this._root}var nG=C(()=>{});function rG(){var t=0;return this.visit(function(e){if(!e.length)do++t;while(e=e.next)}),t}var oG=C(()=>{});function iG(t){var e=[],n,r=this._root,o,i,a,s,l;for(r&&e.push(new an(r,this._x0,this._y0,this._x1,this._y1));n=e.pop();)if(!t(r=n.node,i=n.x0,a=n.y0,s=n.x1,l=n.y1)&&r.length){var c=(i+s)/2,u=(a+l)/2;(o=r[3])&&e.push(new an(o,c,u,s,l)),(o=r[2])&&e.push(new an(o,i,u,c,l)),(o=r[1])&&e.push(new an(o,c,a,s,u)),(o=r[0])&&e.push(new an(o,i,a,c,u))}return this}var aG=C(()=>{fv()});function sG(t){var e=[],n=[],r;for(this._root&&e.push(new an(this._root,this._x0,this._y0,this._x1,this._y1));r=e.pop();){var o=r.node;if(o.length){var i,a=r.x0,s=r.y0,l=r.x1,c=r.y1,u=(a+l)/2,f=(s+c)/2;(i=o[0])&&e.push(new an(i,a,s,u,f)),(i=o[1])&&e.push(new an(i,u,s,l,f)),(i=o[2])&&e.push(new an(i,a,f,u,c)),(i=o[3])&&e.push(new an(i,u,f,l,c))}n.push(r)}for(;r=n.pop();)t(r.node,r.x0,r.y0,r.x1,r.y1);return this}var lG=C(()=>{fv()});function cG(t){return t[0]}function uG(t){return arguments.length?(this._x=t,this):this._x}var fG=C(()=>{});function dG(t){return t[1]}function hG(t){return arguments.length?(this._y=t,this):this._y}var pG=C(()=>{});function Hs(t,e,n){var r=new TC(e??cG,n??dG,NaN,NaN,NaN,NaN);return t==null?r:r.addAll(t)}function TC(t,e,n,r,o,i){this._x=t,this._y=e,this._x0=n,this._y0=r,this._x1=o,this._y1=i,this._root=void 0}function mG(t){for(var e={data:t.data},n=e;t=t.next;)n=n.next={data:t.data};return e}var $n,gG=C(()=>{V5();j5();U5();X5();K5();tG();nG();oG();aG();lG();fG();pG();$n=Hs.prototype=TC.prototype;$n.copy=function(){var t=new TC(this._x,this._y,this._x0,this._y0,this._x1,this._y1),e=this._root,n,r;if(!e)return t;if(!e.length)return t._root=mG(e),t;for(n=[{source:e,target:t._root=new Array(4)}];e=n.pop();)for(var o=0;o<4;++o)(r=e.source[o])&&(r.length?n.push({source:r,target:e.target[o]=new Array(4)}):e.target[o]=mG(r));return t};$n.add=F5;$n.addAll=W5;$n.cover=H5;$n.data=Y5;$n.extent=q5;$n.find=Z5;$n.remove=Q5;$n.removeAll=J5;$n.root=eG;$n.size=rG;$n.visit=iG;$n.visitAfter=sG;$n.x=uG;$n.y=hG});var LC=C(()=>{gG()});function me(t){return function(){return t}}var js=C(()=>{});function io(t){return(t()-.5)*1e-6}var dv=C(()=>{});function Met(t){return t.x+t.vx}function Ret(t){return t.y+t.vy}function xG(t){var e,n,r,o=1,i=1;typeof t!="function"&&(t=me(t==null?1:+t));function a(){for(var c,u=e.length,f,d,h,p,g,m,x=0;x<i;++x)for(f=Hs(e,Met,Ret).visitAfter(s),c=0;c<u;++c)d=e[c],g=n[d.index],m=g*g,h=d.x+d.vx,p=d.y+d.vy,f.visit(y);function y(_,v,b,w,A){var L=_.data,E=_.r,I=g+E;if(L){if(L.index>d.index){var D=h-L.x-L.vx,F=p-L.y-L.vy,$=D*D+F*F;$<I*I&&(D===0&&(D=io(r),$+=D*D),F===0&&(F=io(r),$+=F*F),$=(I-($=Math.sqrt($)))/$*o,d.vx+=(D*=$)*(I=(E*=E)/(m+E)),d.vy+=(F*=$)*I,L.vx-=D*(I=1-I),L.vy-=F*I)}return}return v>h+I||w<h-I||b>p+I||A<p-I}}function s(c){if(c.data)return c.r=n[c.data.index];for(var u=c.r=0;u<4;++u)c[u]&&c[u].r>c.r&&(c.r=c[u].r)}function l(){if(e){var c,u=e.length,f;for(n=new Array(u),c=0;c<u;++c)f=e[c],n[f.index]=+t(f,c,e)}}return a.initialize=function(c,u){e=c,r=u,l()},a.iterations=function(c){return arguments.length?(i=+c,a):i},a.strength=function(c){return arguments.length?(o=+c,a):o},a.radius=function(c){return arguments.length?(t=typeof c=="function"?c:me(+c),l(),a):t},a}var vG=C(()=>{LC();js();dv()});function Pet(t){return t.index}function yG(t,e){var n=t.get(e);if(!n)throw new Error("node not found: "+e);return n}function _G(t){var e=Pet,n=f,r,o=me(30),i,a,s,l,c,u=1;t==null&&(t=[]);function f(m){return 1/Math.min(s[m.source.index],s[m.target.index])}function d(m){for(var x=0,y=t.length;x<u;++x)for(var _=0,v,b,w,A,L,E,I;_<y;++_)v=t[_],b=v.source,w=v.target,A=w.x+w.vx-b.x-b.vx||io(c),L=w.y+w.vy-b.y-b.vy||io(c),E=Math.sqrt(A*A+L*L),E=(E-i[_])/E*m*r[_],A*=E,L*=E,w.vx-=A*(I=l[_]),w.vy-=L*I,b.vx+=A*(I=1-I),b.vy+=L*I}function h(){if(a){var m,x=a.length,y=t.length,_=new Map(a.map((b,w)=>[e(b,w,a),b])),v;for(m=0,s=new Array(x);m<y;++m)v=t[m],v.index=m,typeof v.source!="object"&&(v.source=yG(_,v.source)),typeof v.target!="object"&&(v.target=yG(_,v.target)),s[v.source.index]=(s[v.source.index]||0)+1,s[v.target.index]=(s[v.target.index]||0)+1;for(m=0,l=new Array(y);m<y;++m)v=t[m],l[m]=s[v.source.index]/(s[v.source.index]+s[v.target.index]);r=new Array(y),p(),i=new Array(y),g()}}function p(){if(a)for(var m=0,x=t.length;m<x;++m)r[m]=+n(t[m],m,t)}function g(){if(a)for(var m=0,x=t.length;m<x;++m)i[m]=+o(t[m],m,t)}return d.initialize=function(m,x){a=m,c=x,h()},d.links=function(m){return arguments.length?(t=m,h(),d):t},d.id=function(m){return arguments.length?(e=m,d):e},d.iterations=function(m){return arguments.length?(u=+m,d):u},d.strength=function(m){return arguments.length?(n=typeof m=="function"?m:me(+m),p(),d):n},d.distance=function(m){return arguments.length?(o=typeof m=="function"?m:me(+m),g(),d):o},d}var bG=C(()=>{js();dv()});function wG(){let t=1;return()=>(t=(1664525*t+1013904223)%4294967296)/4294967296}var kG=C(()=>{});function SG(t){return t.x}function CG(t){return t.y}function AG(t){var e,n=1,r=.001,o=1-Math.pow(r,1/300),i=0,a=.6,s=new Map,l=Pl(f),c=Vr("tick","end"),u=wG();t==null&&(t=[]);function f(){d(),c.call("tick",e),n<r&&(l.stop(),c.call("end",e))}function d(g){var m,x=t.length,y;g===void 0&&(g=1);for(var _=0;_<g;++_)for(n+=(i-n)*o,s.forEach(function(v){v(n)}),m=0;m<x;++m)y=t[m],y.fx==null?y.x+=y.vx*=a:(y.x=y.fx,y.vx=0),y.fy==null?y.y+=y.vy*=a:(y.y=y.fy,y.vy=0);return e}function h(){for(var g=0,m=t.length,x;g<m;++g){if(x=t[g],x.index=g,x.fx!=null&&(x.x=x.fx),x.fy!=null&&(x.y=x.fy),isNaN(x.x)||isNaN(x.y)){var y=Iet*Math.sqrt(.5+g),_=g*Net;x.x=y*Math.cos(_),x.y=y*Math.sin(_)}(isNaN(x.vx)||isNaN(x.vy))&&(x.vx=x.vy=0)}}function p(g){return g.initialize&&g.initialize(t,u),g}return h(),e={tick:d,restart:function(){return l.restart(f),e},stop:function(){return l.stop(),e},nodes:function(g){return arguments.length?(t=g,h(),s.forEach(p),e):t},alpha:function(g){return arguments.length?(n=+g,e):n},alphaMin:function(g){return arguments.length?(r=+g,e):r},alphaDecay:function(g){return arguments.length?(o=+g,e):+o},alphaTarget:function(g){return arguments.length?(i=+g,e):i},velocityDecay:function(g){return arguments.length?(a=1-g,e):1-a},randomSource:function(g){return arguments.length?(u=g,s.forEach(p),e):u},force:function(g,m){return arguments.length>1?(m==null?s.delete(g):s.set(g,p(m)),e):s.get(g)},find:function(g,m,x){var y=0,_=t.length,v,b,w,A,L;for(x==null?x=1/0:x*=x,y=0;y<_;++y)A=t[y],v=g-A.x,b=m-A.y,w=v*v+b*b,w<x&&(L=A,x=w);return L},on:function(g,m){return arguments.length>1?(c.on(g,m),e):c.on(g)}}}var Iet,Net,EC=C(()=>{Ml();Nl();kG();Iet=10,Net=Math.PI*(3-Math.sqrt(5))});function TG(){var t,e,n,r,o=me(-30),i,a=1,s=1/0,l=.81;function c(h){var p,g=t.length,m=Hs(t,SG,CG).visitAfter(f);for(r=h,p=0;p<g;++p)e=t[p],m.visit(d)}function u(){if(t){var h,p=t.length,g;for(i=new Array(p),h=0;h<p;++h)g=t[h],i[g.index]=+o(g,h,t)}}function f(h){var p=0,g,m,x=0,y,_,v;if(h.length){for(y=_=v=0;v<4;++v)(g=h[v])&&(m=Math.abs(g.value))&&(p+=g.value,x+=m,y+=m*g.x,_+=m*g.y);h.x=y/x,h.y=_/x}else{g=h,g.x=g.data.x,g.y=g.data.y;do p+=i[g.data.index];while(g=g.next)}h.value=p}function d(h,p,g,m){if(!h.value)return!0;var x=h.x-e.x,y=h.y-e.y,_=m-p,v=x*x+y*y;if(_*_/l<v)return v<s&&(x===0&&(x=io(n),v+=x*x),y===0&&(y=io(n),v+=y*y),v<a&&(v=Math.sqrt(a*v)),e.vx+=x*h.value*r/v,e.vy+=y*h.value*r/v),!0;if(h.length||v>=s)return;(h.data!==e||h.next)&&(x===0&&(x=io(n),v+=x*x),y===0&&(y=io(n),v+=y*y),v<a&&(v=Math.sqrt(a*v)));do h.data!==e&&(_=i[h.data.index]*r/v,e.vx+=x*_,e.vy+=y*_);while(h=h.next)}return c.initialize=function(h,p){t=h,n=p,u()},c.strength=function(h){return arguments.length?(o=typeof h=="function"?h:me(+h),u(),c):o},c.distanceMin=function(h){return arguments.length?(a=h*h,c):Math.sqrt(a)},c.distanceMax=function(h){return arguments.length?(s=h*h,c):Math.sqrt(s)},c.theta=function(h){return arguments.length?(l=h*h,c):Math.sqrt(l)},c}var LG=C(()=>{LC();js();dv();EC()});function EG(t,e,n){var r,o=me(.1),i,a;typeof t!="function"&&(t=me(+t)),e==null&&(e=0),n==null&&(n=0);function s(c){for(var u=0,f=r.length;u<f;++u){var d=r[u],h=d.x-e||1e-6,p=d.y-n||1e-6,g=Math.sqrt(h*h+p*p),m=(a[u]-g)*i[u]*c/g;d.vx+=h*m,d.vy+=p*m}}function l(){if(r){var c,u=r.length;for(i=new Array(u),a=new Array(u),c=0;c<u;++c)a[c]=+t(r[c],c,r),i[c]=isNaN(a[c])?0:+o(r[c],c,r)}}return s.initialize=function(c){r=c,l()},s.strength=function(c){return arguments.length?(o=typeof c=="function"?c:me(+c),l(),s):o},s.radius=function(c){return arguments.length?(t=typeof c=="function"?c:me(+c),l(),s):t},s.x=function(c){return arguments.length?(e=+c,s):e},s.y=function(c){return arguments.length?(n=+c,s):n},s}var MG=C(()=>{js()});function RG(t){var e=me(.1),n,r,o;typeof t!="function"&&(t=me(t==null?0:+t));function i(s){for(var l=0,c=n.length,u;l<c;++l)u=n[l],u.vx+=(o[l]-u.x)*r[l]*s}function a(){if(n){var s,l=n.length;for(r=new Array(l),o=new Array(l),s=0;s<l;++s)r[s]=isNaN(o[s]=+t(n[s],s,n))?0:+e(n[s],s,n)}}return i.initialize=function(s){n=s,a()},i.strength=function(s){return arguments.length?(e=typeof s=="function"?s:me(+s),a(),i):e},i.x=function(s){return arguments.length?(t=typeof s=="function"?s:me(+s),a(),i):t},i}var PG=C(()=>{js()});function IG(t){var e=me(.1),n,r,o;typeof t!="function"&&(t=me(t==null?0:+t));function i(s){for(var l=0,c=n.length,u;l<c;++l)u=n[l],u.vy+=(o[l]-u.y)*r[l]*s}function a(){if(n){var s,l=n.length;for(r=new Array(l),o=new Array(l),s=0;s<l;++s)r[s]=isNaN(o[s]=+t(n[s],s,n))?0:+e(n[s],s,n)}}return i.initialize=function(s){n=s,a()},i.strength=function(s){return arguments.length?(e=typeof s=="function"?s:me(+s),a(),i):e},i.y=function(s){return arguments.length?(t=typeof s=="function"?s:me(+s),a(),i):t},i}var NG=C(()=>{js()});var $G={};Wt($G,{forceCenter:()=>z5,forceCollide:()=>xG,forceLink:()=>_G,forceManyBody:()=>TG,forceRadial:()=>EG,forceSimulation:()=>AG,forceX:()=>RG,forceY:()=>IG});var DG=C(()=>{B5();vG();bG();LG();MG();EC();PG();NG()});var OG={};Wt(OG,{default:()=>$et});var $et,zG=C(()=>{$et={}});var Mv={};Wt(Mv,{Area:()=>Rf,Axis:()=>yf,Boxplot:()=>md,BulletLegend:()=>Us,ChordDiagram:()=>Yd,Crosshair:()=>cp,Donut:()=>yd,Graph:()=>pu,GroupedBar:()=>If,Heatmap:()=>Bd,Line:()=>Ef,MapProjection:()=>Ag,NestedDonut:()=>mc,Plotband:()=>xd,Plotline:()=>vd,RadialBar:()=>kd,Sankey:()=>Od,Scatter:()=>Df,SingleContainer:()=>zl,StackedBar:()=>$f,Timeline:()=>dd,Tooltip:()=>lp,TopoJSONMap:()=>op,Treemap:()=>Gd,XYContainer:()=>El,XYLabels:()=>gd});var D3=!1;function O3(t){if(t.sheet)return t.sheet;for(var e=0;e<document.styleSheets.length;e++)if(document.styleSheets[e].ownerNode===t)return document.styleSheets[e]}function z3(t){var e=document.createElement("style");return e.setAttribute("data-emotion",t.key),t.nonce!==void 0&&e.setAttribute("nonce",t.nonce),e.appendChild(document.createTextNode("")),e.setAttribute("data-s",""),e}var d2=(function(){function t(n){var r=this;this._insertTag=function(o){var i;r.tags.length===0?r.insertionPoint?i=r.insertionPoint.nextSibling:r.prepend?i=r.container.firstChild:i=r.before:i=r.tags[r.tags.length-1].nextSibling,r.container.insertBefore(o,i),r.tags.push(o)},this.isSpeedy=n.speedy===void 0?!D3:n.speedy,this.tags=[],this.ctr=0,this.nonce=n.nonce,this.key=n.key,this.container=n.container,this.prepend=n.prepend,this.insertionPoint=n.insertionPoint,this.before=null}var e=t.prototype;return e.hydrate=function(r){r.forEach(this._insertTag)},e.insert=function(r){this.ctr%(this.isSpeedy?65e3:1)===0&&this._insertTag(z3(this));var o=this.tags[this.tags.length-1];if(this.isSpeedy){var i=O3(o);try{i.insertRule(r,i.cssRules.length)}catch{}}else o.appendChild(document.createTextNode(r));this.ctr++},e.flush=function(){this.tags.forEach(function(r){var o;return(o=r.parentNode)==null?void 0:o.removeChild(r)}),this.tags=[],this.ctr=0},t})();var sn="-ms-",wu="-moz-",Dt="-webkit-",fp="comm",Xs="rule",Zs="decl";var h2="@import";var dp="@keyframes";var p2="@layer";var m2=Math.abs,Ea=String.fromCharCode,g2=Object.assign;function x2(t,e){return Pe(t,0)^45?(((e<<2^Pe(t,0))<<2^Pe(t,1))<<2^Pe(t,2))<<2^Pe(t,3):0}function hp(t){return t.trim()}function Nv(t,e){return(t=e.exec(t))?t[0]:t}function It(t,e,n){return t.replace(e,n)}function ku(t,e){return t.indexOf(e)}function Pe(t,e){return t.charCodeAt(e)|0}function Ci(t,e,n){return t.slice(e,n)}function kn(t){return t.length}function Ks(t){return t.length}function Qs(t,e){return e.push(t),t}function $v(t,e){return t.map(e).join("")}var pp=1,Js=1,v2=0,Sn=0,$e=0,el="";function Su(t,e,n,r,o,i,a){return{value:t,root:e,parent:n,type:r,props:o,children:i,line:pp,column:Js,length:a,return:""}}function nl(t,e){return g2(Su("",null,null,"",null,null,0),t,{length:-t.length},e)}function y2(){return $e}function _2(){return $e=Sn>0?Pe(el,--Sn):0,Js--,$e===10&&(Js=1,pp--),$e}function Cn(){return $e=Sn<v2?Pe(el,Sn++):0,Js++,$e===10&&(Js=1,pp++),$e}function cr(){return Pe(el,Sn)}function Cu(){return Sn}function rl(t,e){return Ci(el,t,e)}function tl(t){switch(t){case 0:case 9:case 10:case 13:case 32:return 5;case 33:case 43:case 44:case 47:case 62:case 64:case 126:case 59:case 123:case 125:return 4;case 58:return 3;case 34:case 39:case 40:case 91:return 2;case 41:case 93:return 1}return 0}function mp(t){return pp=Js=1,v2=kn(el=t),Sn=0,[]}function gp(t){return el="",t}function ol(t){return hp(rl(Sn-1,Dv(t===91?t+2:t===40?t+1:t)))}function b2(t){for(;($e=cr())&&$e<33;)Cn();return tl(t)>2||tl($e)>3?"":" "}function w2(t,e){for(;--e&&Cn()&&!($e<48||$e>102||$e>57&&$e<65||$e>70&&$e<97););return rl(t,Cu()+(e<6&&cr()==32&&Cn()==32))}function Dv(t){for(;Cn();)switch($e){case t:return Sn;case 34:case 39:t!==34&&t!==39&&Dv($e);break;case 40:t===41&&Dv(t);break;case 92:Cn();break}return Sn}function k2(t,e){for(;Cn()&&t+$e!==57;)if(t+$e===84&&cr()===47)break;return"/*"+rl(e,Sn-1)+"*"+Ea(t===47?t:Cn())}function S2(t){for(;!tl(cr());)Cn();return rl(t,Sn)}function T2(t){return gp(xp("",null,null,null,[""],t=mp(t),0,[0],t))}function xp(t,e,n,r,o,i,a,s,l){for(var c=0,u=0,f=a,d=0,h=0,p=0,g=1,m=1,x=1,y=0,_="",v=o,b=i,w=r,A=_;m;)switch(p=y,y=Cn()){case 40:if(p!=108&&Pe(A,f-1)==58){ku(A+=It(ol(y),"&","&\f"),"&\f")!=-1&&(x=-1);break}case 34:case 39:case 91:A+=ol(y);break;case 9:case 10:case 13:case 32:A+=b2(p);break;case 92:A+=w2(Cu()-1,7);continue;case 47:switch(cr()){case 42:case 47:Qs(B3(k2(Cn(),Cu()),e,n),l);break;default:A+="/"}break;case 123*g:s[c++]=kn(A)*x;case 125*g:case 59:case 0:switch(y){case 0:case 125:m=0;case 59+u:x==-1&&(A=It(A,/\f/g,"")),h>0&&kn(A)-f&&Qs(h>32?A2(A+";",r,n,f-1):A2(It(A," ","")+";",r,n,f-2),l);break;case 59:A+=";";default:if(Qs(w=C2(A,e,n,c,u,o,s,_,v=[],b=[],f),i),y===123)if(u===0)xp(A,e,w,w,v,i,f,s,b);else switch(d===99&&Pe(A,3)===110?100:d){case 100:case 108:case 109:case 115:xp(t,w,w,r&&Qs(C2(t,w,w,0,0,o,s,_,o,v=[],f),b),o,b,f,s,r?v:b);break;default:xp(A,w,w,w,[""],b,0,s,b)}}c=u=h=0,g=x=1,_=A="",f=a;break;case 58:f=1+kn(A),h=p;default:if(g<1){if(y==123)--g;else if(y==125&&g++==0&&_2()==125)continue}switch(A+=Ea(y),y*g){case 38:x=u>0?1:(A+="\f",-1);break;case 44:s[c++]=(kn(A)-1)*x,x=1;break;case 64:cr()===45&&(A+=ol(Cn())),d=cr(),u=f=kn(_=A+=S2(Cu())),y++;break;case 45:p===45&&kn(A)==2&&(g=0)}}return i}function C2(t,e,n,r,o,i,a,s,l,c,u){for(var f=o-1,d=o===0?i:[""],h=Ks(d),p=0,g=0,m=0;p<r;++p)for(var x=0,y=Ci(t,f+1,f=m2(g=a[p])),_=t;x<h;++x)(_=hp(g>0?d[x]+" "+y:It(y,/&\f/g,d[x])))&&(l[m++]=_);return Su(t,e,n,o===0?Xs:s,l,c,u)}function B3(t,e,n){return Su(t,e,n,fp,Ea(y2()),Ci(t,2,-2),0)}function A2(t,e,n,r){return Su(t,e,n,Zs,Ci(t,0,r),Ci(t,r+1,-1),r)}function Ma(t,e){for(var n="",r=Ks(t),o=0;o<r;o++)n+=e(t[o],o,t,e)||"";return n}function L2(t,e,n,r){switch(t.type){case p2:if(t.children.length)break;case h2:case Zs:return t.return=t.return||t.value;case fp:return"";case dp:return t.return=t.value+"{"+Ma(t.children,r)+"}";case Xs:t.value=t.props.join(",")}return kn(n=Ma(t.children,r))?t.return=t.value+"{"+n+"}":""}function E2(t){var e=Ks(t);return function(n,r,o,i){for(var a="",s=0;s<e;s++)a+=t[s](n,r,o,i)||"";return a}}function M2(t){return function(e){e.root||(e=e.return)&&t(e)}}function R2(t){var e=Object.create(null);return function(n){return e[n]===void 0&&(e[n]=t(n)),e[n]}}var F3=function(e,n,r){for(var o=0,i=0;o=i,i=cr(),o===38&&i===12&&(n[r]=1),!tl(i);)Cn();return rl(e,Sn)},G3=function(e,n){var r=-1,o=44;do switch(tl(o)){case 0:o===38&&cr()===12&&(n[r]=1),e[r]+=F3(Sn-1,n,r);break;case 2:e[r]+=ol(o);break;case 4:if(o===44){e[++r]=cr()===58?"&\f":"",n[r]=e[r].length;break}default:e[r]+=Ea(o)}while(o=Cn());return e},W3=function(e,n){return gp(G3(mp(e),n))},P2=new WeakMap,V3=function(e){if(!(e.type!=="rule"||!e.parent||e.length<1)){for(var n=e.value,r=e.parent,o=e.column===r.column&&e.line===r.line;r.type!=="rule";)if(r=r.parent,!r)return;if(!(e.props.length===1&&n.charCodeAt(0)!==58&&!P2.get(r))&&!o){P2.set(e,!0);for(var i=[],a=W3(n,i),s=r.props,l=0,c=0;l<a.length;l++)for(var u=0;u<s.length;u++,c++)e.props[c]=i[l]?a[l].replace(/&\f/g,s[u]):s[u]+" "+a[l]}}},H3=function(e){if(e.type==="decl"){var n=e.value;n.charCodeAt(0)===108&&n.charCodeAt(2)===98&&(e.return="",e.value="")}};function I2(t,e){switch(x2(t,e)){case 5103:return Dt+"print-"+t+t;case 5737:case 4201:case 3177:case 3433:case 1641:case 4457:case 2921:case 5572:case 6356:case 5844:case 3191:case 6645:case 3005:case 6391:case 5879:case 5623:case 6135:case 4599:case 4855:case 4215:case 6389:case 5109:case 5365:case 5621:case 3829:return Dt+t+t;case 5349:case 4246:case 4810:case 6968:case 2756:return Dt+t+wu+t+sn+t+t;case 6828:case 4268:return Dt+t+sn+t+t;case 6165:return Dt+t+sn+"flex-"+t+t;case 5187:return Dt+t+It(t,/(\w+).+(:[^]+)/,Dt+"box-$1$2"+sn+"flex-$1$2")+t;case 5443:return Dt+t+sn+"flex-item-"+It(t,/flex-|-self/,"")+t;case 4675:return Dt+t+sn+"flex-line-pack"+It(t,/align-content|flex-|-self/,"")+t;case 5548:return Dt+t+sn+It(t,"shrink","negative")+t;case 5292:return Dt+t+sn+It(t,"basis","preferred-size")+t;case 6060:return Dt+"box-"+It(t,"-grow","")+Dt+t+sn+It(t,"grow","positive")+t;case 4554:return Dt+It(t,/([^-])(transform)/g,"$1"+Dt+"$2")+t;case 6187:return It(It(It(t,/(zoom-|grab)/,Dt+"$1"),/(image-set)/,Dt+"$1"),t,"")+t;case 5495:case 3959:return It(t,/(image-set\([^]*)/,Dt+"$1$`$1");case 4968:return It(It(t,/(.+:)(flex-)?(.*)/,Dt+"box-pack:$3"+sn+"flex-pack:$3"),/s.+-b[^;]+/,"justify")+Dt+t+t;case 4095:case 3583:case 4068:case 2532:return It(t,/(.+)-inline(.+)/,Dt+"$1$2")+t;case 8116:case 7059:case 5753:case 5535:case 5445:case 5701:case 4933:case 4677:case 5533:case 5789:case 5021:case 4765:if(kn(t)-1-e>6)switch(Pe(t,e+1)){case 109:if(Pe(t,e+4)!==45)break;case 102:return It(t,/(.+:)(.+)-([^]+)/,"$1"+Dt+"$2-$3$1"+wu+(Pe(t,e+3)==108?"$3":"$2-$3"))+t;case 115:return~ku(t,"stretch")?I2(It(t,"stretch","fill-available"),e)+t:t}break;case 4949:if(Pe(t,e+1)!==115)break;case 6444:switch(Pe(t,kn(t)-3-(~ku(t,"!important")&&10))){case 107:return It(t,":",":"+Dt)+t;case 101:return It(t,/(.+:)([^;!]+)(;|!.+)?/,"$1"+Dt+(Pe(t,14)===45?"inline-":"")+"box$3$1"+Dt+"$2$3$1"+sn+"$2box$3")+t}break;case 5936:switch(Pe(t,e+11)){case 114:return Dt+t+sn+It(t,/[svh]\w+-[tblr]{2}/,"tb")+t;case 108:return Dt+t+sn+It(t,/[svh]\w+-[tblr]{2}/,"tb-rl")+t;case 45:return Dt+t+sn+It(t,/[svh]\w+-[tblr]{2}/,"lr")+t}return Dt+t+sn+t+t}return t}var j3=function(e,n,r,o){if(e.length>-1&&!e.return)switch(e.type){case Zs:e.return=I2(e.value,e.length);break;case dp:return Ma([nl(e,{value:It(e.value,"@","@"+Dt)})],o);case Xs:if(e.length)return $v(e.props,function(i){switch(Nv(i,/(::plac\w+|:read-\w+)/)){case":read-only":case":read-write":return Ma([nl(e,{props:[It(i,/:(read-\w+)/,":"+wu+"$1")]})],o);case"::placeholder":return Ma([nl(e,{props:[It(i,/:(plac\w+)/,":"+Dt+"input-$1")]}),nl(e,{props:[It(i,/:(plac\w+)/,":"+wu+"$1")]}),nl(e,{props:[It(i,/:(plac\w+)/,sn+"input-$1")]})],o)}return""})}},Y3=[j3],N2=function(e){var n=e.key;if(n==="css"){var r=document.querySelectorAll("style[data-emotion]:not([data-s])");Array.prototype.forEach.call(r,function(g){var m=g.getAttribute("data-emotion");m.indexOf(" ")!==-1&&(document.head.appendChild(g),g.setAttribute("data-s",""))})}var o=e.stylisPlugins||Y3,i={},a,s=[];a=e.container||document.head,Array.prototype.forEach.call(document.querySelectorAll('style[data-emotion^="'+n+' "]'),function(g){for(var m=g.getAttribute("data-emotion").split(" "),x=1;x<m.length;x++)i[m[x]]=!0;s.push(g)});var l,c=[V3,H3];{var u,f=[L2,M2(function(g){u.insert(g)})],d=E2(c.concat(o,f)),h=function(m){return Ma(T2(m),d)};l=function(m,x,y,_){u=y,h(m?m+"{"+x.styles+"}":x.styles),_&&(p.inserted[x.name]=!0)}}var p={key:n,sheet:new d2({key:n,container:a,nonce:e.nonce,speedy:e.speedy,prepend:e.prepend,insertionPoint:e.insertionPoint}),nonce:e.nonce,inserted:i,registered:{},insert:l};return p.sheet.hydrate(s),p};function $2(t){for(var e=0,n,r=0,o=t.length;o>=4;++r,o-=4)n=t.charCodeAt(r)&255|(t.charCodeAt(++r)&255)<<8|(t.charCodeAt(++r)&255)<<16|(t.charCodeAt(++r)&255)<<24,n=(n&65535)*1540483477+((n>>>16)*59797<<16),n^=n>>>24,e=(n&65535)*1540483477+((n>>>16)*59797<<16)^(e&65535)*1540483477+((e>>>16)*59797<<16);switch(o){case 3:e^=(t.charCodeAt(r+2)&255)<<16;case 2:e^=(t.charCodeAt(r+1)&255)<<8;case 1:e^=t.charCodeAt(r)&255,e=(e&65535)*1540483477+((e>>>16)*59797<<16)}return e^=e>>>13,e=(e&65535)*1540483477+((e>>>16)*59797<<16),((e^e>>>15)>>>0).toString(36)}var D2={animationIterationCount:1,aspectRatio:1,borderImageOutset:1,borderImageSlice:1,borderImageWidth:1,boxFlex:1,boxFlexGroup:1,boxOrdinalGroup:1,columnCount:1,columns:1,flex:1,flexGrow:1,flexPositive:1,flexShrink:1,flexNegative:1,flexOrder:1,gridRow:1,gridRowEnd:1,gridRowSpan:1,gridRowStart:1,gridColumn:1,gridColumnEnd:1,gridColumnSpan:1,gridColumnStart:1,msGridRow:1,msGridRowSpan:1,msGridColumn:1,msGridColumnSpan:1,fontWeight:1,lineHeight:1,opacity:1,order:1,orphans:1,scale:1,tabSize:1,widows:1,zIndex:1,zoom:1,WebkitLineClamp:1,fillOpacity:1,floodOpacity:1,stopOpacity:1,strokeDasharray:1,strokeDashoffset:1,strokeMiterlimit:1,strokeOpacity:1,strokeWidth:1};var U3=!1,q3=/[A-Z]|^ms/g,X3=/_EMO_([^_]+?)_([^]*?)_EMO_/g,F2=function(e){return e.charCodeAt(1)===45},O2=function(e){return e!=null&&typeof e!="boolean"},Ov=R2(function(t){return F2(t)?t:t.replace(q3,"-$&").toLowerCase()}),z2=function(e,n){switch(e){case"animation":case"animationName":if(typeof n=="string")return n.replace(X3,function(r,o,i){return ao={name:o,styles:i,next:ao},o})}return D2[e]!==1&&!F2(e)&&typeof n=="number"&&n!==0?n+"px":n},Z3="Component selectors can only be used in conjunction with @emotion/babel-plugin, the swc Emotion plugin, or another Emotion-aware compiler transform.";function Au(t,e,n){if(n==null)return"";var r=n;if(r.__emotion_styles!==void 0)return r;switch(typeof n){case"boolean":return"";case"object":{var o=n;if(o.anim===1)return ao={name:o.name,styles:o.styles,next:ao},o.name;var i=n;if(i.styles!==void 0){var a=i.next;if(a!==void 0)for(;a!==void 0;)ao={name:a.name,styles:a.styles,next:ao},a=a.next;var s=i.styles+";";return s}return K3(t,e,n)}case"function":{if(t!==void 0){var l=ao,c=n(t);return ao=l,Au(t,e,c)}break}}var u=n;if(e==null)return u;var f=e[u];return f!==void 0?f:u}function K3(t,e,n){var r="";if(Array.isArray(n))for(var o=0;o<n.length;o++)r+=Au(t,e,n[o])+";";else for(var i in n){var a=n[i];if(typeof a!="object"){var s=a;e!=null&&e[s]!==void 0?r+=i+"{"+e[s]+"}":O2(s)&&(r+=Ov(i)+":"+z2(i,s)+";")}else{if(i==="NO_COMPONENT_SELECTOR"&&U3)throw new Error(Z3);if(Array.isArray(a)&&typeof a[0]=="string"&&(e==null||e[a[0]]===void 0))for(var l=0;l<a.length;l++)O2(a[l])&&(r+=Ov(i)+":"+z2(i,a[l])+";");else{var c=Au(t,e,a);switch(i){case"animation":case"animationName":{r+=Ov(i)+":"+c+";";break}default:r+=i+"{"+c+"}"}}}}return r}var B2=/label:\s*([^\s;{]+)\s*(;|$)/g,ao;function vp(t,e,n){if(t.length===1&&typeof t[0]=="object"&&t[0]!==null&&t[0].styles!==void 0)return t[0];var r=!0,o="";ao=void 0;var i=t[0];if(i==null||i.raw===void 0)r=!1,o+=Au(n,e,i);else{var a=i;o+=a[0]}for(var s=1;s<t.length;s++)if(o+=Au(n,e,t[s]),r){var l=i;o+=l[s]}B2.lastIndex=0;for(var c="",u;(u=B2.exec(o))!==null;)c+="-"+u[1];var f=$2(o)+c;return{name:f,styles:o,next:ao}}var Q3=!0;function zv(t,e,n){var r="";return n.split(" ").forEach(function(o){t[o]!==void 0?e.push(t[o]+";"):o&&(r+=o+" ")}),r}var J3=function(e,n,r){var o=e.key+"-"+n.name;(r===!1||Q3===!1)&&e.registered[o]===void 0&&(e.registered[o]=n.styles)},G2=function(e,n,r){J3(e,n,r);var o=e.key+"-"+n.name;if(e.inserted[n.name]===void 0){var i=n;do e.insert(n===i?"."+o:"",i,e.sheet,!0),i=i.next;while(i!==void 0)}};function W2(t,e){if(t.inserted[e.name]===void 0)return t.insert("",e,t.sheet,!0)}function V2(t,e,n){var r=[],o=zv(t,r,n);return r.length<2?n:o+e(r)}var H2=function(e){var n=N2(e);n.sheet.speedy=function(s){this.isSpeedy=s},n.compat=!0;var r=function(){for(var l=arguments.length,c=new Array(l),u=0;u<l;u++)c[u]=arguments[u];var f=vp(c,n.registered,void 0);return G2(n,f,!1),n.key+"-"+f.name},o=function(){for(var l=arguments.length,c=new Array(l),u=0;u<l;u++)c[u]=arguments[u];var f=vp(c,n.registered),d="animation-"+f.name;return W2(n,{name:f.name,styles:"@keyframes "+d+"{"+f.styles+"}"}),d},i=function(){for(var l=arguments.length,c=new Array(l),u=0;u<l;u++)c[u]=arguments[u];var f=vp(c,n.registered);W2(n,f)},a=function(){for(var l=arguments.length,c=new Array(l),u=0;u<l;u++)c[u]=arguments[u];return V2(n.registered,r,tW(c))};return{css:r,cx:a,injectGlobal:i,keyframes:o,hydrate:function(l){l.forEach(function(c){n.inserted[c]=!0})},flush:function(){n.registered={},n.inserted={},n.sheet.flush()},sheet:n.sheet,cache:n,getRegisteredStyles:zv.bind(null,n.registered),merge:V2.bind(null,n.registered,r)}},tW=function t(e){for(var n="",r=0;r<e.length;r++){var o=e[r];if(o!=null){var i=void 0;switch(typeof o){case"boolean":break;case"object":{if(Array.isArray(o))i=t(o);else{i="";for(var a in o)o[a]&&a&&(i&&(i+=" "),i+=a)}break}default:i=o}i&&(n&&(n+=" "),n+=i)}}return n};var so=H2({key:"css"}),jnt=so.flush,Ynt=so.hydrate,Unt=so.cx,qnt=so.merge,Xnt=so.getRegisteredStyles,Pt=so.injectGlobal,Znt=so.keyframes,M=so.css,Knt=so.sheet,Qnt=so.cache;function Dn(t,e){return t==null||e==null?NaN:t<e?-1:t>e?1:t>=e?0:NaN}function Bv(t,e){return t==null||e==null?NaN:e<t?-1:e>t?1:e>=t?0:NaN}function Ra(t){let e,n,r;t.length!==2?(e=Dn,n=(s,l)=>Dn(t(s),l),r=(s,l)=>t(s)-l):(e=t===Dn||t===Bv?t:eW,n=t,r=t);function o(s,l,c=0,u=s.length){if(c<u){if(e(l,l)!==0)return u;do{let f=c+u>>>1;n(s[f],l)<0?c=f+1:u=f}while(c<u)}return c}function i(s,l,c=0,u=s.length){if(c<u){if(e(l,l)!==0)return u;do{let f=c+u>>>1;n(s[f],l)<=0?c=f+1:u=f}while(c<u)}return c}function a(s,l,c=0,u=s.length){let f=o(s,l,c,u-1);return f>c&&r(s[f-1],l)>-r(s[f],l)?f-1:f}return{left:o,center:a,right:i}}function eW(){return 0}function Tu(t){return t===null?NaN:+t}var j2=Ra(Dn),yp=j2.right,Fv=j2.left,nW=Ra(Tu).center,Xo=yp;function Hn(t,e){let n,r;if(e===void 0)for(let o of t)o!=null&&(n===void 0?o>=o&&(n=r=o):(n>o&&(n=o),r<o&&(r=o)));else{let o=-1;for(let i of t)(i=e(i,++o,t))!=null&&(n===void 0?i>=i&&(n=r=i):(n>i&&(n=i),r<i&&(r=i)))}return[n,r]}var jn=class{constructor(){this._partials=new Float64Array(32),this._n=0}add(e){let n=this._partials,r=0;for(let o=0;o<this._n&&o<32;o++){let i=n[o],a=e+i,s=Math.abs(e)<Math.abs(i)?e-(a-i):i-(a-e);s&&(n[r++]=s),e=a}return n[r]=e,this._n=r+1,this}valueOf(){let e=this._partials,n=this._n,r,o,i,a=0;if(n>0){for(a=e[--n];n>0&&(r=a,o=e[--n],a=r+o,i=o-(a-r),!i););n>0&&(i<0&&e[n-1]<0||i>0&&e[n-1]>0)&&(o=i*2,r=a+o,o==r-a&&(a=r))}return a}};var Ai=class extends Map{constructor(e,n=iW){if(super(),Object.defineProperties(this,{_intern:{value:new Map},_key:{value:n}}),e!=null)for(let[r,o]of e)this.set(r,o)}get(e){return super.get(Y2(this,e))}has(e){return super.has(Y2(this,e))}set(e,n){return super.set(rW(this,e),n)}delete(e){return super.delete(oW(this,e))}};function Y2({_intern:t,_key:e},n){let r=e(n);return t.has(r)?t.get(r):n}function rW({_intern:t,_key:e},n){let r=e(n);return t.has(r)?t.get(r):(t.set(r,n),n)}function oW({_intern:t,_key:e},n){let r=e(n);return t.has(r)&&(n=t.get(r),t.delete(r)),n}function iW(t){return t!==null&&typeof t=="object"?t.valueOf():t}function Lu(t){return t}function lo(t,...e){return U2(t,Lu,Lu,e)}function Gv(t,...e){return U2(t,Lu,aW,e)}function aW(t){if(t.length!==1)throw new Error("duplicate key");return t[0]}function U2(t,e,n,r){return(function o(i,a){if(a>=r.length)return n(i);let s=new Ai,l=r[a++],c=-1;for(let u of i){let f=l(u,++c,i),d=s.get(f);d?d.push(u):s.set(f,[u])}for(let[u,f]of s)s.set(u,o(f,a));return e(s)})(t,0)}var sW=Math.sqrt(50),lW=Math.sqrt(10),cW=Math.sqrt(2);function _p(t,e,n){let r=(e-t)/Math.max(0,n),o=Math.floor(Math.log10(r)),i=r/Math.pow(10,o),a=i>=sW?10:i>=lW?5:i>=cW?2:1,s,l,c;return o<0?(c=Math.pow(10,-o)/a,s=Math.round(t*c),l=Math.round(e*c),s/c<t&&++s,l/c>e&&--l,c=-c):(c=Math.pow(10,o)*a,s=Math.round(t/c),l=Math.round(e/c),s*c<t&&++s,l*c>e&&--l),l<s&&.5<=n&&n<2?_p(t,e,n*2):[s,l,c]}function Pa(t,e,n){if(e=+e,t=+t,n=+n,!(n>0))return[];if(t===e)return[t];let r=e<t,[o,i,a]=r?_p(e,t,n):_p(t,e,n);if(!(i>=o))return[];let s=i-o+1,l=new Array(s);if(r)if(a<0)for(let c=0;c<s;++c)l[c]=(i-c)/-a;else for(let c=0;c<s;++c)l[c]=(i-c)*a;else if(a<0)for(let c=0;c<s;++c)l[c]=(o+c)/-a;else for(let c=0;c<s;++c)l[c]=(o+c)*a;return l}function Eu(t,e,n){return e=+e,t=+t,n=+n,_p(t,e,n)[2]}function il(t,e,n){e=+e,t=+t,n=+n;let r=e<t,o=r?Eu(e,t,n):Eu(t,e,n);return(r?-1:1)*(o<0?1/-o:o)}function rt(t,e){let n;if(e===void 0)for(let r of t)r!=null&&(n<r||n===void 0&&r>=r)&&(n=r);else{let r=-1;for(let o of t)(o=e(o,++r,t))!=null&&(n<o||n===void 0&&o>=o)&&(n=o)}return n}function bt(t,e){let n;if(e===void 0)for(let r of t)r!=null&&(n>r||n===void 0&&r>=r)&&(n=r);else{let r=-1;for(let o of t)(o=e(o,++r,t))!=null&&(n>o||n===void 0&&o>=o)&&(n=o)}return n}function Mu(t,e){let n,r=-1,o=-1;if(e===void 0)for(let i of t)++o,i!=null&&(n>i||n===void 0&&i>=i)&&(n=i,r=o);else for(let i of t)(i=e(i,++o,t))!=null&&(n>i||n===void 0&&i>=i)&&(n=i,r=o);return r}function Wv(t,e,n=Tu){if(!(!(r=t.length)||isNaN(e=+e))){if(e<=0||r<2)return+n(t[0],0,t);if(e>=1)return+n(t[r-1],r-1,t);var r,o=(r-1)*e,i=Math.floor(o),a=+n(t[i],i,t),s=+n(t[i+1],i+1,t);return a+(s-a)*(o-i)}}function Zo(t,e){let n=0,r=0;if(e===void 0)for(let o of t)o!=null&&(o=+o)>=o&&(++n,r+=o);else{let o=-1;for(let i of t)(i=e(i,++o,t))!=null&&(i=+i)>=i&&(++n,r+=i)}if(n)return r/n}function*uW(t){for(let e of t)yield*e}function Ti(t){return Array.from(uW(t))}function Yn(t,e,n){t=+t,e=+e,n=(o=arguments.length)<2?(e=t,t=0,1):o<3?1:+n;for(var r=-1,o=Math.max(0,Math.ceil((e-t)/n))|0,i=new Array(o);++r<o;)i[r]=t+r*n;return i}function bp(t,e=Dn){let n,r=!1;if(e.length===1){let o;for(let i of t){let a=e(i);(r?Dn(a,o)<0:Dn(a,a)===0)&&(n=i,o=a,r=!0)}}else for(let o of t)(r?e(o,n)<0:e(o,o)===0)&&(n=o,r=!0);return n}function Ko(t,e){let n=0;if(e===void 0)for(let r of t)(r=+r)&&(n+=r);else{let r=-1;for(let o of t)(o=+e(o,++r,t))&&(n+=o)}return n}function q2(t,e,n){var r=n||{},o=r.noTrailing,i=o===void 0?!1:o,a=r.noLeading,s=a===void 0?!1:a,l=r.debounceMode,c=l===void 0?void 0:l,u,f=!1,d=0;function h(){u&&clearTimeout(u)}function p(m){var x=m||{},y=x.upcomingOnly,_=y===void 0?!1:y;h(),f=!_}function g(){for(var m=arguments.length,x=new Array(m),y=0;y<m;y++)x[y]=arguments[y];var _=this,v=Date.now()-d;if(f)return;function b(){d=Date.now(),e.apply(_,x)}function w(){u=void 0}!s&&c&&!u&&b(),h(),c===void 0&&v>t?s?(d=Date.now(),i||(u=setTimeout(c?w:b,t))):b():i!==!0&&(u=setTimeout(c?w:b,c===void 0?t-v:t))}return g.cancel=p,g}var $r;(function(t){t.Left="left",t.Right="right",t.Auto="auto"})($r||($r={}));var tt=t=>typeof t=="number",ge=t=>typeof t=="function",Vv=t=>t===void 0,al=t=>t==null,Qo=t=>typeof t=="string",Ie=t=>Array.isArray(t),Pu=t=>t instanceof Object,wp=t=>t.constructor.name!=="Function"&&t.constructor.name!=="Object",Dr=t=>Pu(t)&&!Ie(t)&&!ge(t)&&!wp(t),Jo=t=>[Object,Array].includes((t||{}).constructor)&&!Object.entries(t||{}).length,An=(t,e,n=[],r=new Set)=>{if(Array.isArray(t)){if(!Array.isArray(e)||t.length!==e.length)return!1;if(r.has(t))return!0;r.add(t);for(let o=0;o<t.length;o++)if(!An(t[o],e[o],n,r))return!1;return!0}if(t instanceof Date&&e instanceof Date)return t.getTime()===e.getTime();if(typeof t=="object"&&t!==null&&e!==null){if(typeof e!="object")return!1;if(t===e)return!0;let o=Object.keys(t).filter(a=>!n.includes(a)),i=Object.keys(e).filter(a=>!n.includes(a));if(o.length!==i.length)return!1;if(r.has(t))return!0;r.add(t);for(let a of o)if(!An(t[a],e[a],n,r))return!1;return!0}return t===e},kp=(t,...e)=>t.filter(n=>!e.includes(n)),Li=t=>t.flat(),Or=(t,e=new Map)=>{if(typeof t!="object"||t===null)return t;if(t instanceof Date)return new Date(t.getTime());if(t instanceof Array){let n=[];e.set(t,n);for(let r of t)n.push(e.has(r)?e.get(r):Or(r,e));return n}if(wp(t))return t;if(t instanceof Object){let n={};e.set(t,n);let r=t;return Object.keys(t).reduce((o,i)=>(o[i]=e.has(r[i])?e.get(r[i]):Or(r[i],e),o),n),n}return t},He=(t,e,n=new Map)=>{if(!t||!e||t===e)return t;let r=wp(t)?t:Or(t);return n.has(e)?n.get(e):(n.set(e,r),Object.keys(e).forEach(o=>{o==="__proto__"||o==="constructor"||(Dr(t[o])&&Dr(e[o])?r[o]=He(t[o],e[o],n):wp(e)?r[o]=e:r[o]=Or(e[o]))}),r)};var co=(t,e)=>t.reduce((n,r,o,i,a=e(r,o))=>((n[a]||(n[a]=[])).push(r),n),{}),Hv=(t,e)=>t.concat().sort((n,r)=>e(n)>e(r)?1:e(r)>e(n)?-1:0),zr=(t,e,n)=>q2(e,t,n);function st(t,e,n){return ge(e)?e(t,n):e}function j(t,e,n){return st(t,e,n)}function z(t,e,n){return st(t,e,n)}function Un(t,e,n){return st(t,e,n)}function sl(t){return t.filter(e=>e&&!tt(e))}function mt(t,e,n){return Math.min(Math.max(t,e),n)}function jv(t){return Array.from(new Set(t))}function X2(t){return[...Array(t).keys()]}function Sp(t={},e={}){return Object.keys(e).reduce((n,r)=>t[r]===e[r]?n:Object.assign(Object.assign({},n),{[r]:e[r]}),{})}function Cp(t,...e){if(!t)return[void 0,void 0];if(Ie(e)){let n=0,r=0;return t.forEach((o,i)=>{let a=0,s=0;for(let l of e){let c=z(o,l,i)||0;c>=0?a+=c:s+=c}a>r&&(r=a),s<n&&(n=s)}),[n,r]}}function Yv(t,e,...n){let r=[],o=0,i=0;for(let a of n){let s=z(t,a,e)||0;s>=0?r.push(o+=s):r.push(i+=s)}return r}function Ap(t,e,n,r){let o=t.map((s,l)=>z(s,e,l)||0),i=n.map((s,l)=>{let c=Zo(t,(u,f)=>z(u,s,f)||0);return c===0&&Array.isArray(r)?r[l]:c<0}),a=n.map(()=>[]);return t.forEach((s,l)=>{let c=o[l],u=o[l];n.forEach((f,d)=>{let h=z(s,f,l)||0;h>=0?a[d].push([c,c+=h]):a[d].push([u,u+=h])})}),a.forEach((s,l)=>{s.isMostlyNegative=i[l]}),a}function Ia(t,...e){return t?bt(t,(r,o)=>bt(e,i=>z(r,i,o))):void 0}function Na(t,...e){return t?rt(t,(r,o)=>rt(e,i=>z(r,i,o))):void 0}function ur(t,...e){return[Ia(t,...e),Na(t,...e)]}function Ru(t,e,n,r=$r.Auto){if(t.length<=1)return t[0];let i=t.map((l,c)=>[l,c]).sort(([l,c],[u,f])=>z(l,n,c)-z(u,n,f)),a=i.map(([l,c])=>z(l,n,c)),s=r===$r.Right?Fv(a,e,0,t.length-1):yp(a,e,1,t.length);return r===$r.Right?i[s][0]:r===$r.Left?i[s-1][0]:e-a[s-1]>a[s]-e?i[s][0]:i[s-1][0]}function Z2(t,e,n,r,o,i=[],a=[],s){if(!t?.length||!o)return;let[l,c]=e,u,f=-1,d=1/0;for(let h=0;h<t.length;h++){let p=t[h],g=n(z(p,o,h));if(!isFinite(g))continue;let m=Math.pow(g-l,2);if(a.length){let x=z(p,s,h)||0,y=Yv(p,h,...a);for(let _=0;_<y.length;_++){if(!tt(z(p,a[_],_)))continue;let v=r(y[_]+x),b=m+Math.pow(v-c,2);b<d&&(d=b,u=p,f=h)}}for(let x=0;x<i.length;x++){let y=z(p,i[x],h);if(!tt(y))continue;let _=r(y),v=m+Math.pow(_-c,2);v<d&&(d=v,u=p,f=h)}}if(f!==-1)return{datum:u,index:f,distanceSq:d}}function Tp(t,e,n,r=!1){if(!n)return[];let o=t.filter((i,a)=>{let s=z(i,n,a);return s>=e[0]&&s<=e[1]});if(r){if(o.length===0){let f=Ru(t,e[0],n,$r.Left),d=Ru(t,e[1],n,$r.Right);return[f,d].filter(Boolean)}let i=o[0],a=o[o.length-1],s=t.findIndex(f=>f===i),l=t.findIndex(f=>f===a),c=Math.max(0,s-1),u=Math.min(t.length-1,l+1);return t.slice(c,u+1)}return o}function Iu(t,e){return t>=e[0]&&t<=e[1]||t>=e[1]&&t<=e[0]}var Nu=t=>t==null?[]:Array.isArray(t)?t:[t];function Uv(t){var e;t=String(t);let n=parseFloat(t),r=((e=t.match(/[\d.\-+]*\s*(.*)/))===null||e===void 0?void 0:e[1])||"";return[n,r]}function K2(){return typeof window<"u"&&typeof document<"u"}function qv(t,e){var n;let r=Uv(getComputedStyle(t).getPropertyValue(e));return r[0]*((n=pn(r[1],t))!==null&&n!==void 0?n:1)}function Q2(t,e){let n=document.createElement("div");n.style.height=`128${t}`,e.appendChild(n);let r=qv(n,"height")/128;return e.removeChild(n),r}var Lp=null;function $u(){return K2()?(Lp===null&&(Lp=96,Lp=Q2("in",document.body)),Lp):96}function pn(t,e){var n;if(!t&&t!==0)return null;if(!K2()){let a=Uv(String(t));if(!isNaN(a[0])){let s=((n=a[1])===null||n===void 0?void 0:n.toLowerCase())||"px";if(s==="px"||s==="")return a[0];if(s==="em"||s==="rem")return a[0]*16;if(s==="in")return a[0]*96;if(s==="cm")return a[0]*(96/2.54);if(s==="mm")return a[0]*(96/25.4);if(s==="pt")return a[0]*(96/72);if(s==="pc")return a[0]*(96/6)}return null}let r=document.body;e&&e!==window&&e!==document&&(r=e);let o=(String(t)||"px").trim().toLowerCase();switch(o){case"%":return r.clientHeight/100;case"ch":case"ex":return Q2(o,r);case"em":return qv(r,"font-size");case"rem":return qv(document.body,"font-size");case"vw":return window.innerWidth/100;case"vh":return window.innerHeight/100;case"vmin":return Math.min(window.innerWidth,window.innerHeight)/100;case"vmax":return Math.max(window.innerWidth,window.innerHeight)/100;case"in":return $u();case"cm":return $u()/2.54;case"mm":return $u()/25.4;case"pt":return $u()/72;case"pc":return $u()/6;case"px":return 1}let i=Uv(o);if(!isNaN(i[0])){if(i[1]){let a=pn(i[1],r);return typeof a=="number"?i[0]*a:null}return i[0]}return null}function ll(){let t=()=>Math.floor((1+crypto.getRandomValues(new Uint32Array(1))[0])*65536).toString(16).substring(1);return`${t()+t()}-${t()}-${t()}-${t()}-${t()}${t()}${t()}`}function tA(t){return(t||"").replace(/\W/g,"_")}function Ei(t){return Qo(t)?t.substring(0,6)==="var(--":!1}var J2=new WeakMap;function On(t,e){if(!Qo(t))return"";let n=t.substr(4,t.length-5),r=J2.get(e);if(r||(r=new Map,J2.set(e,r)),r.has(n))return r.get(n);let o=getComputedStyle(e).getPropertyValue(n);return r.set(n,o),o}function ue(t,e){let n=On(t,e);return pn(n)}function Du(t){return typeof t=="number"?t:pn(t)}function uo(t,e,n=0){let[r,o,i,a]=[t.x+n,t.y+t.height-2*n,t.x+t.width-2*n,t.y+n],[s,l,c,u]=[e.x+n,e.y+e.height-2*n,e.x+e.width-2*n,e.y+n];return!(o<u||l<a||i<s||c<r)}var Yt='html[data-theme="dark"],html.dark-theme,body.dark-theme,html.theme-dark,body.theme-dark';function $a(t,e,n){t.prototype=e.prototype=n,n.constructor=t}function cl(t,e){var n=Object.create(t.prototype);for(var r in e)n[r]=e[r];return n}function Mi(){}var Ou=.7,Rp=1/Ou,ul="\\s*([+-]?\\d+)\\s*",zu="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",fo="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",fW=/^#([0-9a-f]{3,8})$/,dW=new RegExp(`^rgb\\(${ul},${ul},${ul}\\)$`),hW=new RegExp(`^rgb\\(${fo},${fo},${fo}\\)$`),pW=new RegExp(`^rgba\\(${ul},${ul},${ul},${zu}\\)$`),mW=new RegExp(`^rgba\\(${fo},${fo},${fo},${zu}\\)$`),gW=new RegExp(`^hsl\\(${zu},${fo},${fo}\\)$`),xW=new RegExp(`^hsla\\(${zu},${fo},${fo},${zu}\\)$`),eA={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};$a(Mi,Ut,{copy(t){return Object.assign(new this.constructor,this,t)},displayable(){return this.rgb().displayable()},hex:nA,formatHex:nA,formatHex8:vW,formatHsl:yW,formatRgb:rA,toString:rA});function nA(){return this.rgb().formatHex()}function vW(){return this.rgb().formatHex8()}function yW(){return cA(this).formatHsl()}function rA(){return this.rgb().formatRgb()}function Ut(t){var e,n;return t=(t+"").trim().toLowerCase(),(e=fW.exec(t))?(n=e[1].length,e=parseInt(e[1],16),n===6?oA(e):n===3?new ln(e>>8&15|e>>4&240,e>>4&15|e&240,(e&15)<<4|e&15,1):n===8?Ep(e>>24&255,e>>16&255,e>>8&255,(e&255)/255):n===4?Ep(e>>12&15|e>>8&240,e>>8&15|e>>4&240,e>>4&15|e&240,((e&15)<<4|e&15)/255):null):(e=dW.exec(t))?new ln(e[1],e[2],e[3],1):(e=hW.exec(t))?new ln(e[1]*255/100,e[2]*255/100,e[3]*255/100,1):(e=pW.exec(t))?Ep(e[1],e[2],e[3],e[4]):(e=mW.exec(t))?Ep(e[1]*255/100,e[2]*255/100,e[3]*255/100,e[4]):(e=gW.exec(t))?sA(e[1],e[2]/100,e[3]/100,1):(e=xW.exec(t))?sA(e[1],e[2]/100,e[3]/100,e[4]):eA.hasOwnProperty(t)?oA(eA[t]):t==="transparent"?new ln(NaN,NaN,NaN,0):null}function oA(t){return new ln(t>>16&255,t>>8&255,t&255,1)}function Ep(t,e,n,r){return r<=0&&(t=e=n=NaN),new ln(t,e,n,r)}function Zv(t){return t instanceof Mi||(t=Ut(t)),t?(t=t.rgb(),new ln(t.r,t.g,t.b,t.opacity)):new ln}function fl(t,e,n,r){return arguments.length===1?Zv(t):new ln(t,e,n,r??1)}function ln(t,e,n,r){this.r=+t,this.g=+e,this.b=+n,this.opacity=+r}$a(ln,fl,cl(Mi,{brighter(t){return t=t==null?Rp:Math.pow(Rp,t),new ln(this.r*t,this.g*t,this.b*t,this.opacity)},darker(t){return t=t==null?Ou:Math.pow(Ou,t),new ln(this.r*t,this.g*t,this.b*t,this.opacity)},rgb(){return this},clamp(){return new ln(Oa(this.r),Oa(this.g),Oa(this.b),Pp(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:iA,formatHex:iA,formatHex8:_W,formatRgb:aA,toString:aA}));function iA(){return`#${Da(this.r)}${Da(this.g)}${Da(this.b)}`}function _W(){return`#${Da(this.r)}${Da(this.g)}${Da(this.b)}${Da((isNaN(this.opacity)?1:this.opacity)*255)}`}function aA(){let t=Pp(this.opacity);return`${t===1?"rgb(":"rgba("}${Oa(this.r)}, ${Oa(this.g)}, ${Oa(this.b)}${t===1?")":`, ${t})`}`}function Pp(t){return isNaN(t)?1:Math.max(0,Math.min(1,t))}function Oa(t){return Math.max(0,Math.min(255,Math.round(t)||0))}function Da(t){return t=Oa(t),(t<16?"0":"")+t.toString(16)}function sA(t,e,n,r){return r<=0?t=e=n=NaN:n<=0||n>=1?t=e=NaN:e<=0&&(t=NaN),new Br(t,e,n,r)}function cA(t){if(t instanceof Br)return new Br(t.h,t.s,t.l,t.opacity);if(t instanceof Mi||(t=Ut(t)),!t)return new Br;if(t instanceof Br)return t;t=t.rgb();var e=t.r/255,n=t.g/255,r=t.b/255,o=Math.min(e,n,r),i=Math.max(e,n,r),a=NaN,s=i-o,l=(i+o)/2;return s?(e===i?a=(n-r)/s+(n<r)*6:n===i?a=(r-e)/s+2:a=(e-n)/s+4,s/=l<.5?i+o:2-i-o,a*=60):s=l>0&&l<1?0:a,new Br(a,s,l,t.opacity)}function za(t,e,n,r){return arguments.length===1?cA(t):new Br(t,e,n,r??1)}function Br(t,e,n,r){this.h=+t,this.s=+e,this.l=+n,this.opacity=+r}$a(Br,za,cl(Mi,{brighter(t){return t=t==null?Rp:Math.pow(Rp,t),new Br(this.h,this.s,this.l*t,this.opacity)},darker(t){return t=t==null?Ou:Math.pow(Ou,t),new Br(this.h,this.s,this.l*t,this.opacity)},rgb(){var t=this.h%360+(this.h<0)*360,e=isNaN(t)||isNaN(this.s)?0:this.s,n=this.l,r=n+(n<.5?n:1-n)*e,o=2*n-r;return new ln(Xv(t>=240?t-240:t+120,o,r),Xv(t,o,r),Xv(t<120?t+240:t-120,o,r),this.opacity)},clamp(){return new Br(lA(this.h),Mp(this.s),Mp(this.l),Pp(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){let t=Pp(this.opacity);return`${t===1?"hsl(":"hsla("}${lA(this.h)}, ${Mp(this.s)*100}%, ${Mp(this.l)*100}%${t===1?")":`, ${t})`}`}}));function lA(t){return t=(t||0)%360,t<0?t+360:t}function Mp(t){return Math.max(0,Math.min(1,t||0))}function Xv(t,e,n){return(t<60?e+(n-e)*t/60:t<180?n:t<240?e+(n-e)*(240-t)/60:e)*255}var uA=Math.PI/180,fA=180/Math.PI;var Ip=18,dA=.96422,hA=1,pA=.82521,mA=4/29,dl=6/29,gA=3*dl*dl,bW=dl*dl*dl;function xA(t){if(t instanceof ho)return new ho(t.l,t.a,t.b,t.opacity);if(t instanceof ti)return vA(t);t instanceof ln||(t=Zv(t));var e=ty(t.r),n=ty(t.g),r=ty(t.b),o=Kv((.2225045*e+.7168786*n+.0606169*r)/hA),i,a;return e===n&&n===r?i=a=o:(i=Kv((.4360747*e+.3850649*n+.1430804*r)/dA),a=Kv((.0139322*e+.0971045*n+.7141733*r)/pA)),new ho(116*o-16,500*(i-o),200*(o-a),t.opacity)}function ey(t,e,n,r){return arguments.length===1?xA(t):new ho(t,e,n,r??1)}function ho(t,e,n,r){this.l=+t,this.a=+e,this.b=+n,this.opacity=+r}$a(ho,ey,cl(Mi,{brighter(t){return new ho(this.l+Ip*(t??1),this.a,this.b,this.opacity)},darker(t){return new ho(this.l-Ip*(t??1),this.a,this.b,this.opacity)},rgb(){var t=(this.l+16)/116,e=isNaN(this.a)?t:t+this.a/500,n=isNaN(this.b)?t:t-this.b/200;return e=dA*Qv(e),t=hA*Qv(t),n=pA*Qv(n),new ln(Jv(3.1338561*e-1.6168667*t-.4906146*n),Jv(-.9787684*e+1.9161415*t+.033454*n),Jv(.0719453*e-.2289914*t+1.4052427*n),this.opacity)}}));function Kv(t){return t>bW?Math.pow(t,1/3):t/gA+mA}function Qv(t){return t>dl?t*t*t:gA*(t-mA)}function Jv(t){return 255*(t<=.0031308?12.92*t:1.055*Math.pow(t,1/2.4)-.055)}function ty(t){return(t/=255)<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4)}function wW(t){if(t instanceof ti)return new ti(t.h,t.c,t.l,t.opacity);if(t instanceof ho||(t=xA(t)),t.a===0&&t.b===0)return new ti(NaN,0<t.l&&t.l<100?0:NaN,t.l,t.opacity);var e=Math.atan2(t.b,t.a)*fA;return new ti(e<0?e+360:e,Math.sqrt(t.a*t.a+t.b*t.b),t.l,t.opacity)}function Np(t,e,n,r){return arguments.length===1?wW(t):new ti(t,e,n,r??1)}function ti(t,e,n,r){this.h=+t,this.c=+e,this.l=+n,this.opacity=+r}function vA(t){if(isNaN(t.h))return new ho(t.l,0,0,t.opacity);var e=t.h*uA;return new ho(t.l,Math.cos(e)*t.c,Math.sin(e)*t.c,t.opacity)}$a(ti,Np,cl(Mi,{brighter(t){return new ti(this.h,this.c,this.l+Ip*(t??1),this.opacity)},darker(t){return new ti(this.h,this.c,this.l-Ip*(t??1),this.opacity)},rgb(){return vA(this).rgb()}}));var po=globalThis?.UNOVIS_COLORS||["#4D8CFD","#FF6B7E","#F4B83E","#A6CC74","#00C19A","#6859BE"],yA=globalThis?.UNOVIS_COLORS_DARK||["#4D8CFD","#FF6B7E","#FFC16D","#A6CC74","#00C19A","#7887E0"],Ri=t=>`--vis-${tt(t)?`color${t%po.length}`:t}`;function _A(t,e=.4){let n=za(t);return n.l=n.l*(1+e),n.formatHex()}function bA(t,e=.4,n=.6){let r=za(t);return r.s=r.s*(1-n),r.l=r.l*(1-e),r.formatHex()}var Pi;(function(t){t.StripesDiagonal="stripes-diagonal",t.Dots="dots",t.StripesVertical="stripes-vertical",t.Crosshatch="crosshatch",t.Waves="waves",t.Circles="circles"})(Pi||(Pi={}));var Ii;(function(t){t.Circle="circle",t.Triangle="triangle",t.Diamond="diamond",t.Arrow="arrow",t.Square="square",t.Star="star"})(Ii||(Ii={}));var mo=10,Bu=[{id:Pi.StripesDiagonal,svg:'<path d="M-1,1 l2,-2 M0,10 l10,-10 M9,11 l2,-2" stroke="#000"/>'},{id:Pi.Dots,svg:'<path d="m0-1.5a1 1 0 010 3m10-3a1 1 0 000 3M5 3.5a1 1 0 010 3 1 1 0 010-3M0 8.5 a1 1 0 010 3m10-3a1 1 0 000 3" fill"#000"/>'},{id:Pi.StripesVertical,svg:'<path d="M 5,-1 L5,11" stroke="#000"/>'},{id:Pi.Crosshatch,svg:'<path d="M0 0L10 10ZM10 0L0 10Z" stroke="#000"/>'},{id:Pi.Waves,svg:'<path d="M0 4Q2.5 1 5 4 7.5 7 10 4v2Q7.5 9 5 6 2.5 3 0 6Z" fill="#000"/>'},{id:Pi.Circles,svg:'<circle cx="5" cy="5" r="3" stroke="#000" fill="#fff"/>'}],hl=[{id:Ii.Circle,marker:'<circle cx="5" cy="5" r="5"/>',dashArray:[]},{id:Ii.Triangle,marker:'<path d="M5,0 L10,9 L0,9Z">',dashArray:[9,1]},{id:Ii.Diamond,marker:'<path d="M 0 5 L5 0 L 10 5 L 5 10 L 0 5Z">',dashArray:[2]},{id:Ii.Arrow,marker:'<path d="M4 0 0 0 6 5 0 10 4 10 10 5Z">',dashArray:[2,3,8,3]},{id:Ii.Square,marker:'<rect x="1" y="1" width="8" height="8"/>',dashArray:[6]},{id:Ii.Star,marker:'<path d="m2 9 3-9 3 9L0 3h10Z"/>',dashArray:[1,6]}],kW=new Map(Bu.map(t=>[t.id,t])),SW=new Map(hl.map(t=>[t.id,t]));function Ba(t){return`vis-${`pattern-${t.svg?"fill":"marker"}`}-${t.id}`}function ny(t){return`vis-pattern-fill-${t}`}function ry(t){return`vis-pattern-marker-${t}`}function oy(t){return`vis-pattern-marker-ctx-${t}`}function wA(t){var e,n;return(n=(e=kW.get(t))!==null&&e!==void 0?e:SW.get(t))!==null&&n!==void 0?n:null}var CW=t=>`<mask id="${ny(t.id)}">
|
|
5
|
+
<pattern id="vis-pattern-tile-${t.id}" viewBox="0 0 10 10" width="${mo}" height="${mo}" patternUnits="userSpaceOnUse">
|
|
6
|
+
<rect width="10" height="10" fill="#fff"/>
|
|
7
|
+
${t.svg}
|
|
8
|
+
</pattern>
|
|
9
|
+
<rect x="-100000" y="-100000" width="200000" height="200000" fill="url(#vis-pattern-tile-${t.id})"/>
|
|
10
|
+
</mask>`,AW=(t,e)=>`<marker id="${ry(t.id)}"
|
|
11
|
+
fill="var(${Ri(e)})"
|
|
12
|
+
markerUnits="userSpaceOnUse"
|
|
13
|
+
refX="5"
|
|
14
|
+
refY="5"
|
|
15
|
+
markerWidth="${mo}"
|
|
16
|
+
markerHeight="${mo}">
|
|
17
|
+
${t.marker}
|
|
18
|
+
</marker>`,TW=t=>`<marker id="${oy(t.id)}"
|
|
19
|
+
fill="context-stroke"
|
|
20
|
+
markerUnits="userSpaceOnUse"
|
|
21
|
+
refX="5"
|
|
22
|
+
refY="5"
|
|
23
|
+
markerWidth="${mo}"
|
|
24
|
+
markerHeight="${mo}">
|
|
25
|
+
${t.marker}
|
|
26
|
+
</marker>`;function kA(t,e,n){let r=document.createElementNS("http://www.w3.org/2000/svg","marker");return r.setAttribute("id",e),r.setAttribute("fill",n),r.setAttribute("markerUnits","userSpaceOnUse"),r.setAttribute("refX","5"),r.setAttribute("refY","5"),r.setAttribute("markerWidth",String(mo)),r.setAttribute("markerHeight",String(mo)),r.innerHTML=t.marker,r}function LW(){let t=hl.map((r,o)=>AW(r,o)).concat(hl.map(TW)),e=Bu.map(CW).concat(t).join(""),n=document.createElementNS("http://www.w3.org/2000/svg","svg");n.setAttribute("height","0"),n.setAttribute("width","0"),n.style.position="fixed",n.style.zIndex="-99999999",n.innerHTML=`<defs>${e}</defs>`,document.body.appendChild(n)}typeof window<"u"&&LW();function Se(t,e){switch(arguments.length){case 0:break;case 1:this.range(t);break;default:this.range(e).domain(t);break}return this}function $p(t,e){switch(arguments.length){case 0:break;case 1:{typeof t=="function"?this.interpolator(t):this.range(t);break}default:{this.domain(t),typeof e=="function"?this.interpolator(e):this.range(e);break}}return this}var iy=Symbol("implicit");function Fr(){var t=new Ai,e=[],n=[],r=iy;function o(i){let a=t.get(i);if(a===void 0){if(r!==iy)return r;t.set(i,a=e.push(i)-1)}return n[a%n.length]}return o.domain=function(i){if(!arguments.length)return e.slice();e=[],t=new Ai;for(let a of i)t.has(a)||t.set(a,e.push(a)-1);return o},o.range=function(i){return arguments.length?(n=Array.from(i),o):n.slice()},o.unknown=function(i){return arguments.length?(r=i,o):r},o.copy=function(){return Fr(e,n).unknown(r)},Se.apply(o,arguments),o}function Ni(){var t=Fr().unknown(void 0),e=t.domain,n=t.range,r=0,o=1,i,a,s=!1,l=0,c=0,u=.5;delete t.unknown;function f(){var d=e().length,h=o<r,p=h?o:r,g=h?r:o;i=(g-p)/Math.max(1,d-l+c*2),s&&(i=Math.floor(i)),p+=(g-p-i*(d-l))*u,a=i*(1-l),s&&(p=Math.round(p),a=Math.round(a));var m=Yn(d).map(function(x){return p+i*x});return n(h?m.reverse():m)}return t.domain=function(d){return arguments.length?(e(d),f()):e()},t.range=function(d){return arguments.length?([r,o]=d,r=+r,o=+o,f()):[r,o]},t.rangeRound=function(d){return[r,o]=d,r=+r,o=+o,s=!0,f()},t.bandwidth=function(){return a},t.step=function(){return i},t.round=function(d){return arguments.length?(s=!!d,f()):s},t.padding=function(d){return arguments.length?(l=Math.min(1,c=+d),f()):l},t.paddingInner=function(d){return arguments.length?(l=Math.min(1,d),f()):l},t.paddingOuter=function(d){return arguments.length?(c=+d,f()):c},t.align=function(d){return arguments.length?(u=Math.max(0,Math.min(1,d)),f()):u},t.copy=function(){return Ni(e(),[r,o]).round(s).paddingInner(l).paddingOuter(c).align(u)},Se.apply(f(),arguments)}function SA(t){var e=t.copy;return t.padding=t.paddingOuter,delete t.paddingInner,delete t.paddingOuter,t.copy=function(){return SA(e())},t}function ay(){return SA(Ni.apply(null,arguments).paddingInner(1))}function sy(t,e,n,r,o){var i=t*t,a=i*t;return((1-3*t+3*i-a)*e+(4-6*i+3*a)*n+(1+3*t+3*i-3*a)*r+a*o)/6}function CA(t){var e=t.length-1;return function(n){var r=n<=0?n=0:n>=1?(n=1,e-1):Math.floor(n*e),o=t[r],i=t[r+1],a=r>0?t[r-1]:2*o-i,s=r<e-1?t[r+2]:2*i-o;return sy((n-r/e)*e,a,o,i,s)}}function AA(t){var e=t.length;return function(n){var r=Math.floor(((n%=1)<0?++n:n)*e),o=t[(r+e-1)%e],i=t[r%e],a=t[(r+1)%e],s=t[(r+2)%e];return sy((n-r/e)*e,o,i,a,s)}}var Fu=t=>()=>t;function EW(t,e){return function(n){return t+n*e}}function MW(t,e,n){return t=Math.pow(t,n),e=Math.pow(e,n)-t,n=1/n,function(r){return Math.pow(t+r*e,n)}}function TA(t){return(t=+t)==1?Dp:function(e,n){return n-e?MW(e,n,t):Fu(isNaN(e)?n:e)}}function Dp(t,e){var n=e-t;return n?EW(t,n):Fu(isNaN(t)?e:t)}var Fa=(function t(e){var n=TA(e);function r(o,i){var a=n((o=fl(o)).r,(i=fl(i)).r),s=n(o.g,i.g),l=n(o.b,i.b),c=Dp(o.opacity,i.opacity);return function(u){return o.r=a(u),o.g=s(u),o.b=l(u),o.opacity=c(u),o+""}}return r.gamma=t,r})(1);function LA(t){return function(e){var n=e.length,r=new Array(n),o=new Array(n),i=new Array(n),a,s;for(a=0;a<n;++a)s=fl(e[a]),r[a]=s.r||0,o[a]=s.g||0,i[a]=s.b||0;return r=t(r),o=t(o),i=t(i),s.opacity=1,function(l){return s.r=r(l),s.g=o(l),s.b=i(l),s+""}}}var RW=LA(CA),PW=LA(AA);function EA(t,e){e||(e=[]);var n=t?Math.min(e.length,t.length):0,r=e.slice(),o;return function(i){for(o=0;o<n;++o)r[o]=t[o]*(1-i)+e[o]*i;return r}}function MA(t){return ArrayBuffer.isView(t)&&!(t instanceof DataView)}function RA(t,e){var n=e?e.length:0,r=t?Math.min(n,t.length):0,o=new Array(r),i=new Array(n),a;for(a=0;a<r;++a)o[a]=re(t[a],e[a]);for(;a<n;++a)i[a]=e[a];return function(s){for(a=0;a<r;++a)i[a]=o[a](s);return i}}function PA(t,e){var n=new Date;return t=+t,e=+e,function(r){return n.setTime(t*(1-r)+e*r),n}}function ye(t,e){return t=+t,e=+e,function(n){return t*(1-n)+e*n}}function IA(t,e){var n={},r={},o;(t===null||typeof t!="object")&&(t={}),(e===null||typeof e!="object")&&(e={});for(o in e)o in t?n[o]=re(t[o],e[o]):r[o]=e[o];return function(i){for(o in n)r[o]=n[o](i);return r}}var cy=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,ly=new RegExp(cy.source,"g");function IW(t){return function(){return t}}function NW(t){return function(e){return t(e)+""}}function Gu(t,e){var n=cy.lastIndex=ly.lastIndex=0,r,o,i,a=-1,s=[],l=[];for(t=t+"",e=e+"";(r=cy.exec(t))&&(o=ly.exec(e));)(i=o.index)>n&&(i=e.slice(n,i),s[a]?s[a]+=i:s[++a]=i),(r=r[0])===(o=o[0])?s[a]?s[a]+=o:s[++a]=o:(s[++a]=null,l.push({i:a,x:ye(r,o)})),n=ly.lastIndex;return n<e.length&&(i=e.slice(n),s[a]?s[a]+=i:s[++a]=i),s.length<2?l[0]?NW(l[0].x):IW(e):(e=l.length,function(c){for(var u=0,f;u<e;++u)s[(f=l[u]).i]=f.x(c);return s.join("")})}function re(t,e){var n=typeof e,r;return e==null||n==="boolean"?Fu(e):(n==="number"?ye:n==="string"?(r=Ut(e))?(e=r,Fa):Gu:e instanceof Ut?Fa:e instanceof Date?PA:MA(e)?EA:Array.isArray(e)?RA:typeof e.valueOf!="function"&&typeof e.toString!="function"||isNaN(e)?IA:ye)(t,e)}function Ga(t,e){return t=+t,e=+e,function(n){return Math.round(t*(1-n)+e*n)}}var NA=180/Math.PI,Op={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function uy(t,e,n,r,o,i){var a,s,l;return(a=Math.sqrt(t*t+e*e))&&(t/=a,e/=a),(l=t*n+e*r)&&(n-=t*l,r-=e*l),(s=Math.sqrt(n*n+r*r))&&(n/=s,r/=s,l/=s),t*r<e*n&&(t=-t,e=-e,l=-l,a=-a),{translateX:o,translateY:i,rotate:Math.atan2(e,t)*NA,skewX:Math.atan(l)*NA,scaleX:a,scaleY:s}}var zp;function $A(t){let e=new(typeof DOMMatrix=="function"?DOMMatrix:WebKitCSSMatrix)(t+"");return e.isIdentity?Op:uy(e.a,e.b,e.c,e.d,e.e,e.f)}function DA(t){return t==null?Op:(zp||(zp=document.createElementNS("http://www.w3.org/2000/svg","g")),zp.setAttribute("transform",t),(t=zp.transform.baseVal.consolidate())?(t=t.matrix,uy(t.a,t.b,t.c,t.d,t.e,t.f)):Op)}function OA(t,e,n,r){function o(c){return c.length?c.pop()+" ":""}function i(c,u,f,d,h,p){if(c!==f||u!==d){var g=h.push("translate(",null,e,null,n);p.push({i:g-4,x:ye(c,f)},{i:g-2,x:ye(u,d)})}else(f||d)&&h.push("translate("+f+e+d+n)}function a(c,u,f,d){c!==u?(c-u>180?u+=360:u-c>180&&(c+=360),d.push({i:f.push(o(f)+"rotate(",null,r)-2,x:ye(c,u)})):u&&f.push(o(f)+"rotate("+u+r)}function s(c,u,f,d){c!==u?d.push({i:f.push(o(f)+"skewX(",null,r)-2,x:ye(c,u)}):u&&f.push(o(f)+"skewX("+u+r)}function l(c,u,f,d,h,p){if(c!==f||u!==d){var g=h.push(o(h)+"scale(",null,",",null,")");p.push({i:g-4,x:ye(c,f)},{i:g-2,x:ye(u,d)})}else(f!==1||d!==1)&&h.push(o(h)+"scale("+f+","+d+")")}return function(c,u){var f=[],d=[];return c=t(c),u=t(u),i(c.translateX,c.translateY,u.translateX,u.translateY,f,d),a(c.rotate,u.rotate,f,d),s(c.skewX,u.skewX,f,d),l(c.scaleX,c.scaleY,u.scaleX,u.scaleY,f,d),c=u=null,function(h){for(var p=-1,g=d.length,m;++p<g;)f[(m=d[p]).i]=m.x(h);return f.join("")}}}var fy=OA($A,"px, ","px)","deg)"),dy=OA(DA,", ",")",")");var $W=1e-12;function zA(t){return((t=Math.exp(t))+1/t)/2}function DW(t){return((t=Math.exp(t))-1/t)/2}function OW(t){return((t=Math.exp(2*t))-1)/(t+1)}var hy=(function t(e,n,r){function o(i,a){var s=i[0],l=i[1],c=i[2],u=a[0],f=a[1],d=a[2],h=u-s,p=f-l,g=h*h+p*p,m,x;if(g<$W)x=Math.log(d/c)/e,m=function(A){return[s+A*h,l+A*p,c*Math.exp(e*A*x)]};else{var y=Math.sqrt(g),_=(d*d-c*c+r*g)/(2*c*n*y),v=(d*d-c*c-r*g)/(2*d*n*y),b=Math.log(Math.sqrt(_*_+1)-_),w=Math.log(Math.sqrt(v*v+1)-v);x=(w-b)/e,m=function(A){var L=A*x,E=zA(b),I=c/(n*y)*(E*OW(e*L+b)-DW(b));return[s+I*h,l+I*p,c*E/zA(e*L+b)]}}return m.duration=x*1e3*e/Math.SQRT2,m}return o.rho=function(i){var a=Math.max(.001,+i),s=a*a,l=s*s;return t(a,s,l)},o})(Math.SQRT2,2,4);function Bp(t,e){e===void 0&&(e=t,t=re);for(var n=0,r=e.length-1,o=e[0],i=new Array(r<0?0:r);n<r;)i[n]=t(o,o=e[++n]);return function(a){var s=Math.max(0,Math.min(r-1,Math.floor(a*=r)));return i[s](a-s)}}function py(t){return function(){return t}}function pl(t){return+t}var BA=[0,1];function cn(t){return t}function my(t,e){return(e-=t=+t)?function(n){return(n-t)/e}:py(isNaN(e)?NaN:.5)}function zW(t,e){var n;return t>e&&(n=t,t=e,e=n),function(r){return Math.max(t,Math.min(e,r))}}function BW(t,e,n){var r=t[0],o=t[1],i=e[0],a=e[1];return o<r?(r=my(o,r),i=n(a,i)):(r=my(r,o),i=n(i,a)),function(s){return i(r(s))}}function FW(t,e,n){var r=Math.min(t.length,e.length)-1,o=new Array(r),i=new Array(r),a=-1;for(t[r]<t[0]&&(t=t.slice().reverse(),e=e.slice().reverse());++a<r;)o[a]=my(t[a],t[a+1]),i[a]=n(e[a],e[a+1]);return function(s){var l=Xo(t,s,1,r)-1;return i[l](o[l](s))}}function go(t,e){return e.domain(t.domain()).range(t.range()).interpolate(t.interpolate()).clamp(t.clamp()).unknown(t.unknown())}function Wa(){var t=BA,e=BA,n=re,r,o,i,a=cn,s,l,c;function u(){var d=Math.min(t.length,e.length);return a!==cn&&(a=zW(t[0],t[d-1])),s=d>2?FW:BW,l=c=null,f}function f(d){return d==null||isNaN(d=+d)?i:(l||(l=s(t.map(r),e,n)))(r(a(d)))}return f.invert=function(d){return a(o((c||(c=s(e,t.map(r),ye)))(d)))},f.domain=function(d){return arguments.length?(t=Array.from(d,pl),u()):t.slice()},f.range=function(d){return arguments.length?(e=Array.from(d),u()):e.slice()},f.rangeRound=function(d){return e=Array.from(d),n=Ga,u()},f.clamp=function(d){return arguments.length?(a=d?!0:cn,u()):a!==cn},f.interpolate=function(d){return arguments.length?(n=d,u()):n},f.unknown=function(d){return arguments.length?(i=d,f):i},function(d,h){return r=d,o=h,u()}}function Wu(){return Wa()(cn,cn)}function FA(t){return Math.abs(t=Math.round(t))>=1e21?t.toLocaleString("en").replace(/,/g,""):t.toString(10)}function Va(t,e){if(!isFinite(t)||t===0)return null;var n=(t=e?t.toExponential(e-1):t.toExponential()).indexOf("e"),r=t.slice(0,n);return[r.length>1?r[0]+r.slice(2):r,+t.slice(n+1)]}function xo(t){return t=Va(Math.abs(t)),t?t[1]:NaN}function GA(t,e){return function(n,r){for(var o=n.length,i=[],a=0,s=t[0],l=0;o>0&&s>0&&(l+s+1>r&&(s=Math.max(1,r-l)),i.push(n.substring(o-=s,o+s)),!((l+=s+1)>r));)s=t[a=(a+1)%t.length];return i.reverse().join(e)}}function WA(t){return function(e){return e.replace(/[0-9]/g,function(n){return t[+n]})}}var GW=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function vo(t){if(!(e=GW.exec(t)))throw new Error("invalid format: "+t);var e;return new Fp({fill:e[1],align:e[2],sign:e[3],symbol:e[4],zero:e[5],width:e[6],comma:e[7],precision:e[8]&&e[8].slice(1),trim:e[9],type:e[10]})}vo.prototype=Fp.prototype;function Fp(t){this.fill=t.fill===void 0?" ":t.fill+"",this.align=t.align===void 0?">":t.align+"",this.sign=t.sign===void 0?"-":t.sign+"",this.symbol=t.symbol===void 0?"":t.symbol+"",this.zero=!!t.zero,this.width=t.width===void 0?void 0:+t.width,this.comma=!!t.comma,this.precision=t.precision===void 0?void 0:+t.precision,this.trim=!!t.trim,this.type=t.type===void 0?"":t.type+""}Fp.prototype.toString=function(){return this.fill+this.align+this.sign+this.symbol+(this.zero?"0":"")+(this.width===void 0?"":Math.max(1,this.width|0))+(this.comma?",":"")+(this.precision===void 0?"":"."+Math.max(0,this.precision|0))+(this.trim?"~":"")+this.type};function VA(t){t:for(var e=t.length,n=1,r=-1,o;n<e;++n)switch(t[n]){case".":r=o=n;break;case"0":r===0&&(r=n),o=n;break;default:if(!+t[n])break t;r>0&&(r=0);break}return r>0?t.slice(0,r)+t.slice(o+1):t}var Vu;function HA(t,e){var n=Va(t,e);if(!n)return Vu=void 0,t.toPrecision(e);var r=n[0],o=n[1],i=o-(Vu=Math.max(-8,Math.min(8,Math.floor(o/3)))*3)+1,a=r.length;return i===a?r:i>a?r+new Array(i-a+1).join("0"):i>0?r.slice(0,i)+"."+r.slice(i):"0."+new Array(1-i).join("0")+Va(t,Math.max(0,e+i-1))[0]}function gy(t,e){var n=Va(t,e);if(!n)return t+"";var r=n[0],o=n[1];return o<0?"0."+new Array(-o).join("0")+r:r.length>o+1?r.slice(0,o+1)+"."+r.slice(o+1):r+new Array(o-r.length+2).join("0")}var xy={"%":(t,e)=>(t*100).toFixed(e),b:t=>Math.round(t).toString(2),c:t=>t+"",d:FA,e:(t,e)=>t.toExponential(e),f:(t,e)=>t.toFixed(e),g:(t,e)=>t.toPrecision(e),o:t=>Math.round(t).toString(8),p:(t,e)=>gy(t*100,e),r:gy,s:HA,X:t=>Math.round(t).toString(16).toUpperCase(),x:t=>Math.round(t).toString(16)};function vy(t){return t}var jA=Array.prototype.map,YA=["y","z","a","f","p","n","\xB5","m","","k","M","G","T","P","E","Z","Y"];function UA(t){var e=t.grouping===void 0||t.thousands===void 0?vy:GA(jA.call(t.grouping,Number),t.thousands+""),n=t.currency===void 0?"":t.currency[0]+"",r=t.currency===void 0?"":t.currency[1]+"",o=t.decimal===void 0?".":t.decimal+"",i=t.numerals===void 0?vy:WA(jA.call(t.numerals,String)),a=t.percent===void 0?"%":t.percent+"",s=t.minus===void 0?"\u2212":t.minus+"",l=t.nan===void 0?"NaN":t.nan+"";function c(f,d){f=vo(f);var h=f.fill,p=f.align,g=f.sign,m=f.symbol,x=f.zero,y=f.width,_=f.comma,v=f.precision,b=f.trim,w=f.type;w==="n"?(_=!0,w="g"):xy[w]||(v===void 0&&(v=12),b=!0,w="g"),(x||h==="0"&&p==="=")&&(x=!0,h="0",p="=");var A=(d&&d.prefix!==void 0?d.prefix:"")+(m==="$"?n:m==="#"&&/[boxX]/.test(w)?"0"+w.toLowerCase():""),L=(m==="$"?r:/[%p]/.test(w)?a:"")+(d&&d.suffix!==void 0?d.suffix:""),E=xy[w],I=/[defgprs%]/.test(w);v=v===void 0?6:/[gprs]/.test(w)?Math.max(1,Math.min(21,v)):Math.max(0,Math.min(20,v));function D(F){var $=A,T=L,S,k,P;if(w==="c")T=E(F)+T,F="";else{F=+F;var N=F<0||1/F<0;if(F=isNaN(F)?l:E(Math.abs(F),v),b&&(F=VA(F)),N&&+F==0&&g!=="+"&&(N=!1),$=(N?g==="("?g:s:g==="-"||g==="("?"":g)+$,T=(w==="s"&&!isNaN(F)&&Vu!==void 0?YA[8+Vu/3]:"")+T+(N&&g==="("?")":""),I){for(S=-1,k=F.length;++S<k;)if(P=F.charCodeAt(S),48>P||P>57){T=(P===46?o+F.slice(S+1):F.slice(S))+T,F=F.slice(0,S);break}}}_&&!x&&(F=e(F,1/0));var R=$.length+F.length+T.length,O=R<y?new Array(y-R+1).join(h):"";switch(_&&x&&(F=e(O+F,O.length?y-T.length:1/0),O=""),p){case"<":F=$+F+T+O;break;case"=":F=$+O+F+T;break;case"^":F=O.slice(0,R=O.length>>1)+$+F+T+O.slice(R);break;default:F=O+$+F+T;break}return i(F)}return D.toString=function(){return f+""},D}function u(f,d){var h=Math.max(-8,Math.min(8,Math.floor(xo(d)/3)))*3,p=Math.pow(10,-h),g=c((f=vo(f),f.type="f",f),{suffix:YA[8+h/3]});return function(m){return g(p*m)}}return{format:c,formatPrefix:u}}var Gp,ml,Wp;yy({thousands:",",grouping:[3],currency:["$",""]});function yy(t){return Gp=UA(t),ml=Gp.format,Wp=Gp.formatPrefix,Gp}function _y(t){return Math.max(0,-xo(Math.abs(t)))}function by(t,e){return Math.max(0,Math.max(-8,Math.min(8,Math.floor(xo(e)/3)))*3-xo(Math.abs(t)))}function wy(t,e){return t=Math.abs(t),e=Math.abs(e)-t,Math.max(0,xo(e)-xo(t))+1}function ky(t,e,n,r){var o=il(t,e,n),i;switch(r=vo(r??",f"),r.type){case"s":{var a=Math.max(Math.abs(t),Math.abs(e));return r.precision==null&&!isNaN(i=by(o,a))&&(r.precision=i),Wp(r,a)}case"":case"e":case"g":case"p":case"r":{r.precision==null&&!isNaN(i=wy(o,Math.max(Math.abs(t),Math.abs(e))))&&(r.precision=i-(r.type==="e"));break}case"f":case"%":{r.precision==null&&!isNaN(i=_y(o))&&(r.precision=i-(r.type==="%")*2);break}}return ml(r)}function qn(t){var e=t.domain;return t.ticks=function(n){var r=e();return Pa(r[0],r[r.length-1],n??10)},t.tickFormat=function(n,r){var o=e();return ky(o[0],o[o.length-1],n??10,r)},t.nice=function(n){n==null&&(n=10);var r=e(),o=0,i=r.length-1,a=r[o],s=r[i],l,c,u=10;for(s<a&&(c=a,a=s,s=c,c=o,o=i,i=c);u-- >0;){if(c=Eu(a,s,n),c===l)return r[o]=a,r[i]=s,e(r);if(c>0)a=Math.floor(a/c)*c,s=Math.ceil(s/c)*c;else if(c<0)a=Math.ceil(a*c)/c,s=Math.floor(s*c)/c;else break;l=c}return t},t}function fr(){var t=Wu();return t.copy=function(){return go(t,fr())},Se.apply(t,arguments),qn(t)}function Hu(t){var e;function n(r){return r==null||isNaN(r=+r)?e:r}return n.invert=n,n.domain=n.range=function(r){return arguments.length?(t=Array.from(r,pl),n):t.slice()},n.unknown=function(r){return arguments.length?(e=r,n):e},n.copy=function(){return Hu(t).unknown(e)},t=arguments.length?Array.from(t,pl):[0,1],qn(n)}function ju(t,e){t=t.slice();var n=0,r=t.length-1,o=t[n],i=t[r],a;return i<o&&(a=n,n=r,r=a,a=o,o=i,i=a),t[n]=e.floor(o),t[r]=e.ceil(i),t}function qA(t){return Math.log(t)}function XA(t){return Math.exp(t)}function WW(t){return-Math.log(-t)}function VW(t){return-Math.exp(-t)}function HW(t){return isFinite(t)?+("1e"+t):t<0?0:t}function jW(t){return t===10?HW:t===Math.E?Math.exp:e=>Math.pow(t,e)}function YW(t){return t===Math.E?Math.log:t===10&&Math.log10||t===2&&Math.log2||(t=Math.log(t),e=>Math.log(e)/t)}function ZA(t){return(e,n)=>-t(-e,n)}function UW(t){let e=t(qA,XA),n=e.domain,r=10,o,i;function a(){return o=YW(r),i=jW(r),n()[0]<0?(o=ZA(o),i=ZA(i),t(WW,VW)):t(qA,XA),e}return e.base=function(s){return arguments.length?(r=+s,a()):r},e.domain=function(s){return arguments.length?(n(s),a()):n()},e.ticks=s=>{let l=n(),c=l[0],u=l[l.length-1],f=u<c;f&&([c,u]=[u,c]);let d=o(c),h=o(u),p,g,m=s==null?10:+s,x=[];if(!(r%1)&&h-d<m){if(d=Math.floor(d),h=Math.ceil(h),c>0){for(;d<=h;++d)for(p=1;p<r;++p)if(g=d<0?p/i(-d):p*i(d),!(g<c)){if(g>u)break;x.push(g)}}else for(;d<=h;++d)for(p=r-1;p>=1;--p)if(g=d>0?p/i(-d):p*i(d),!(g<c)){if(g>u)break;x.push(g)}x.length*2<m&&(x=Pa(c,u,m))}else x=Pa(d,h,Math.min(h-d,m)).map(i);return f?x.reverse():x},e.tickFormat=(s,l)=>{if(s==null&&(s=10),l==null&&(l=r===10?"s":","),typeof l!="function"&&(!(r%1)&&(l=vo(l)).precision==null&&(l.trim=!0),l=ml(l)),s===1/0)return l;let c=Math.max(1,r*s/e.ticks().length);return u=>{let f=u/i(Math.round(o(u)));return f*r<r-.5&&(f*=r),f<=c?l(u):""}},e.nice=()=>n(ju(n(),{floor:s=>i(Math.floor(o(s))),ceil:s=>i(Math.ceil(o(s)))})),e}function Yu(){let t=UW(Wa()).domain([1,10]);return t.copy=()=>go(t,Yu()).base(t.base()),Se.apply(t,arguments),t}function KA(t){return function(e){return Math.sign(e)*Math.log1p(Math.abs(e/t))}}function QA(t){return function(e){return Math.sign(e)*Math.expm1(Math.abs(e))*t}}function qW(t){var e=1,n=t(KA(e),QA(e));return n.constant=function(r){return arguments.length?t(KA(e=+r),QA(e)):e},qn(n)}function Uu(){var t=qW(Wa());return t.copy=function(){return go(t,Uu()).constant(t.constant())},Se.apply(t,arguments)}function JA(t){return function(e){return e<0?-Math.pow(-e,t):Math.pow(e,t)}}function XW(t){return t<0?-Math.sqrt(-t):Math.sqrt(t)}function ZW(t){return t<0?-t*t:t*t}function KW(t){var e=t(cn,cn),n=1;function r(){return n===1?t(cn,cn):n===.5?t(XW,ZW):t(JA(n),JA(1/n))}return e.exponent=function(o){return arguments.length?(n=+o,r()):n},qn(e)}function $i(){var t=KW(Wa());return t.copy=function(){return go(t,$i()).exponent(t.exponent())},Se.apply(t,arguments),t}function Sy(){return $i.apply(null,arguments).exponent(.5)}function qu(){var t=[],e=[],n=[],r;function o(){var a=0,s=Math.max(1,e.length);for(n=new Array(s-1);++a<s;)n[a-1]=Wv(t,a/s);return i}function i(a){return a==null||isNaN(a=+a)?r:e[Xo(n,a)]}return i.invertExtent=function(a){var s=e.indexOf(a);return s<0?[NaN,NaN]:[s>0?n[s-1]:t[0],s<n.length?n[s]:t[t.length-1]]},i.domain=function(a){if(!arguments.length)return t.slice();t=[];for(let s of a)s!=null&&!isNaN(s=+s)&&t.push(s);return t.sort(Dn),o()},i.range=function(a){return arguments.length?(e=Array.from(a),o()):e.slice()},i.unknown=function(a){return arguments.length?(r=a,i):r},i.quantiles=function(){return n.slice()},i.copy=function(){return qu().domain(t).range(e).unknown(r)},Se.apply(i,arguments)}function Ha(){var t=0,e=1,n=1,r=[.5],o=[0,1],i;function a(l){return l!=null&&l<=l?o[Xo(r,l,0,n)]:i}function s(){var l=-1;for(r=new Array(n);++l<n;)r[l]=((l+1)*e-(l-n)*t)/(n+1);return a}return a.domain=function(l){return arguments.length?([t,e]=l,t=+t,e=+e,s()):[t,e]},a.range=function(l){return arguments.length?(n=(o=Array.from(l)).length-1,s()):o.slice()},a.invertExtent=function(l){var c=o.indexOf(l);return c<0?[NaN,NaN]:c<1?[t,r[0]]:c>=n?[r[n-1],e]:[r[c-1],r[c]]},a.unknown=function(l){return arguments.length&&(i=l),a},a.thresholds=function(){return r.slice()},a.copy=function(){return Ha().domain([t,e]).range(o).unknown(i)},Se.apply(qn(a),arguments)}function ja(){var t=[.5],e=[0,1],n,r=1;function o(i){return i!=null&&i<=i?e[Xo(t,i,0,r)]:n}return o.domain=function(i){return arguments.length?(t=Array.from(i),r=Math.min(t.length,e.length-1),o):t.slice()},o.range=function(i){return arguments.length?(e=Array.from(i),r=Math.min(t.length,e.length-1),o):e.slice()},o.invertExtent=function(i){var a=e.indexOf(i);return[t[a-1],t[a]]},o.unknown=function(i){return arguments.length?(n=i,o):n},o.copy=function(){return ja().domain(t).range(e).unknown(n)},Se.apply(o,arguments)}var Cy=new Date,Ay=new Date;function Qt(t,e,n,r){function o(i){return t(i=arguments.length===0?new Date:new Date(+i)),i}return o.floor=i=>(t(i=new Date(+i)),i),o.ceil=i=>(t(i=new Date(i-1)),e(i,1),t(i),i),o.round=i=>{let a=o(i),s=o.ceil(i);return i-a<s-i?a:s},o.offset=(i,a)=>(e(i=new Date(+i),a==null?1:Math.floor(a)),i),o.range=(i,a,s)=>{let l=[];if(i=o.ceil(i),s=s==null?1:Math.floor(s),!(i<a)||!(s>0))return l;let c;do l.push(c=new Date(+i)),e(i,s),t(i);while(c<i&&i<a);return l},o.filter=i=>Qt(a=>{if(a>=a)for(;t(a),!i(a);)a.setTime(a-1)},(a,s)=>{if(a>=a)if(s<0)for(;++s<=0;)for(;e(a,-1),!i(a););else for(;--s>=0;)for(;e(a,1),!i(a););}),n&&(o.count=(i,a)=>(Cy.setTime(+i),Ay.setTime(+a),t(Cy),t(Ay),Math.floor(n(Cy,Ay))),o.every=i=>(i=Math.floor(i),!isFinite(i)||!(i>0)?null:i>1?o.filter(r?a=>r(a)%i===0:a=>o.count(0,a)%i===0):o)),o}var Xu=Qt(()=>{},(t,e)=>{t.setTime(+t+e)},(t,e)=>e-t);Xu.every=t=>(t=Math.floor(t),!isFinite(t)||!(t>0)?null:t>1?Qt(e=>{e.setTime(Math.floor(e/t)*t)},(e,n)=>{e.setTime(+e+n*t)},(e,n)=>(n-e)/t):Xu);var hst=Xu.range;var dr=Qt(t=>{t.setTime(t-t.getMilliseconds())},(t,e)=>{t.setTime(+t+e*1e3)},(t,e)=>(e-t)/1e3,t=>t.getUTCSeconds()),tT=dr.range;var gl=Qt(t=>{t.setTime(t-t.getMilliseconds()-t.getSeconds()*1e3)},(t,e)=>{t.setTime(+t+e*6e4)},(t,e)=>(e-t)/6e4,t=>t.getMinutes()),QW=gl.range,xl=Qt(t=>{t.setUTCSeconds(0,0)},(t,e)=>{t.setTime(+t+e*6e4)},(t,e)=>(e-t)/6e4,t=>t.getUTCMinutes()),JW=xl.range;var vl=Qt(t=>{t.setTime(t-t.getMilliseconds()-t.getSeconds()*1e3-t.getMinutes()*6e4)},(t,e)=>{t.setTime(+t+e*36e5)},(t,e)=>(e-t)/36e5,t=>t.getHours()),tV=vl.range,yl=Qt(t=>{t.setUTCMinutes(0,0,0)},(t,e)=>{t.setTime(+t+e*36e5)},(t,e)=>(e-t)/36e5,t=>t.getUTCHours()),eV=yl.range;var ei=Qt(t=>t.setHours(0,0,0,0),(t,e)=>t.setDate(t.getDate()+e),(t,e)=>(e-t-(e.getTimezoneOffset()-t.getTimezoneOffset())*6e4)/864e5,t=>t.getDate()-1),nV=ei.range,qa=Qt(t=>{t.setUTCHours(0,0,0,0)},(t,e)=>{t.setUTCDate(t.getUTCDate()+e)},(t,e)=>(e-t)/864e5,t=>t.getUTCDate()-1),rV=qa.range,Vp=Qt(t=>{t.setUTCHours(0,0,0,0)},(t,e)=>{t.setUTCDate(t.getUTCDate()+e)},(t,e)=>(e-t)/864e5,t=>Math.floor(t/864e5)),oV=Vp.range;function Xa(t){return Qt(e=>{e.setDate(e.getDate()-(e.getDay()+7-t)%7),e.setHours(0,0,0,0)},(e,n)=>{e.setDate(e.getDate()+n*7)},(e,n)=>(n-e-(n.getTimezoneOffset()-e.getTimezoneOffset())*6e4)/6048e5)}var ni=Xa(0),_l=Xa(1),nT=Xa(2),rT=Xa(3),Di=Xa(4),oT=Xa(5),iT=Xa(6),aT=ni.range,iV=_l.range,aV=nT.range,sV=rT.range,lV=Di.range,cV=oT.range,uV=iT.range;function Za(t){return Qt(e=>{e.setUTCDate(e.getUTCDate()-(e.getUTCDay()+7-t)%7),e.setUTCHours(0,0,0,0)},(e,n)=>{e.setUTCDate(e.getUTCDate()+n*7)},(e,n)=>(n-e)/6048e5)}var ri=Za(0),bl=Za(1),sT=Za(2),lT=Za(3),Oi=Za(4),cT=Za(5),uT=Za(6),fT=ri.range,fV=bl.range,dV=sT.range,hV=lT.range,pV=Oi.range,mV=cT.range,gV=uT.range;var wl=Qt(t=>{t.setDate(1),t.setHours(0,0,0,0)},(t,e)=>{t.setMonth(t.getMonth()+e)},(t,e)=>e.getMonth()-t.getMonth()+(e.getFullYear()-t.getFullYear())*12,t=>t.getMonth()),xV=wl.range,kl=Qt(t=>{t.setUTCDate(1),t.setUTCHours(0,0,0,0)},(t,e)=>{t.setUTCMonth(t.getUTCMonth()+e)},(t,e)=>e.getUTCMonth()-t.getUTCMonth()+(e.getUTCFullYear()-t.getUTCFullYear())*12,t=>t.getUTCMonth()),vV=kl.range;var Xn=Qt(t=>{t.setMonth(0,1),t.setHours(0,0,0,0)},(t,e)=>{t.setFullYear(t.getFullYear()+e)},(t,e)=>e.getFullYear()-t.getFullYear(),t=>t.getFullYear());Xn.every=t=>!isFinite(t=Math.floor(t))||!(t>0)?null:Qt(e=>{e.setFullYear(Math.floor(e.getFullYear()/t)*t),e.setMonth(0,1),e.setHours(0,0,0,0)},(e,n)=>{e.setFullYear(e.getFullYear()+n*t)});var yV=Xn.range,Zn=Qt(t=>{t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0)},(t,e)=>{t.setUTCFullYear(t.getUTCFullYear()+e)},(t,e)=>e.getUTCFullYear()-t.getUTCFullYear(),t=>t.getUTCFullYear());Zn.every=t=>!isFinite(t=Math.floor(t))||!(t>0)?null:Qt(e=>{e.setUTCFullYear(Math.floor(e.getUTCFullYear()/t)*t),e.setUTCMonth(0,1),e.setUTCHours(0,0,0,0)},(e,n)=>{e.setUTCFullYear(e.getUTCFullYear()+n*t)});var _V=Zn.range;function hT(t,e,n,r,o,i){let a=[[dr,1,1e3],[dr,5,5*1e3],[dr,15,15*1e3],[dr,30,30*1e3],[i,1,6e4],[i,5,5*6e4],[i,15,15*6e4],[i,30,30*6e4],[o,1,36e5],[o,3,3*36e5],[o,6,6*36e5],[o,12,12*36e5],[r,1,864e5],[r,2,2*864e5],[n,1,6048e5],[e,1,2592e6],[e,3,3*2592e6],[t,1,31536e6]];function s(c,u,f){let d=u<c;d&&([c,u]=[u,c]);let h=f&&typeof f.range=="function"?f:l(c,u,f),p=h?h.range(c,+u+1):[];return d?p.reverse():p}function l(c,u,f){let d=Math.abs(u-c)/f,h=Ra(([,,m])=>m).right(a,d);if(h===a.length)return t.every(il(c/31536e6,u/31536e6,f));if(h===0)return Xu.every(Math.max(il(c,u,f),1));let[p,g]=a[d/a[h-1][2]<a[h][2]/d?h-1:h];return p.every(g)}return[s,l]}var[Ty,Ly]=hT(Zn,kl,ri,Vp,yl,xl),[Ey,My]=hT(Xn,wl,ni,ei,vl,gl);function Ry(t){if(0<=t.y&&t.y<100){var e=new Date(-1,t.m,t.d,t.H,t.M,t.S,t.L);return e.setFullYear(t.y),e}return new Date(t.y,t.m,t.d,t.H,t.M,t.S,t.L)}function Py(t){if(0<=t.y&&t.y<100){var e=new Date(Date.UTC(-1,t.m,t.d,t.H,t.M,t.S,t.L));return e.setUTCFullYear(t.y),e}return new Date(Date.UTC(t.y,t.m,t.d,t.H,t.M,t.S,t.L))}function Ku(t,e,n){return{y:t,m:e,d:n,H:0,M:0,S:0,L:0}}function Iy(t){var e=t.dateTime,n=t.date,r=t.time,o=t.periods,i=t.days,a=t.shortDays,s=t.months,l=t.shortMonths,c=Qu(o),u=Ju(o),f=Qu(i),d=Ju(i),h=Qu(a),p=Ju(a),g=Qu(s),m=Ju(s),x=Qu(l),y=Ju(l),_={a:P,A:N,b:R,B:O,c:null,d:yT,e:yT,f:HV,g:tH,G:nH,H:GV,I:WV,j:VV,L:ST,m:jV,M:YV,p:W,q:Y,Q:wT,s:kT,S:UV,u:qV,U:XV,V:ZV,w:KV,W:QV,x:null,X:null,y:JV,Y:eH,Z:rH,"%":bT},v={a:J,A:nt,b:et,B:xt,c:null,d:_T,e:_T,f:sH,g:xH,G:yH,H:oH,I:iH,j:aH,L:AT,m:lH,M:cH,p:Z,q:vt,Q:wT,s:kT,S:uH,u:fH,U:dH,V:hH,w:pH,W:mH,x:null,X:null,y:gH,Y:vH,Z:_H,"%":bT},b={a:I,A:D,b:F,B:$,c:T,d:xT,e:xT,f:OV,g:gT,G:mT,H:vT,I:vT,j:IV,L:DV,m:PV,M:NV,p:E,q:RV,Q:BV,s:FV,S:$V,u:AV,U:TV,V:LV,w:CV,W:EV,x:S,X:k,y:gT,Y:mT,Z:MV,"%":zV};_.x=w(n,_),_.X=w(r,_),_.c=w(e,_),v.x=w(n,v),v.X=w(r,v),v.c=w(e,v);function w(X,at){return function(B){var H=[],lt=-1,ct=0,gt=X.length,ot,Q,yt;for(B instanceof Date||(B=new Date(+B));++lt<gt;)X.charCodeAt(lt)===37&&(H.push(X.slice(ct,lt)),(Q=pT[ot=X.charAt(++lt)])!=null?ot=X.charAt(++lt):Q=ot==="e"?" ":"0",(yt=at[ot])&&(ot=yt(B,Q)),H.push(ot),ct=lt+1);return H.push(X.slice(ct,lt)),H.join("")}}function A(X,at){return function(B){var H=Ku(1900,void 0,1),lt=L(H,X,B+="",0),ct,gt;if(lt!=B.length)return null;if("Q"in H)return new Date(H.Q);if("s"in H)return new Date(H.s*1e3+("L"in H?H.L:0));if(at&&!("Z"in H)&&(H.Z=0),"p"in H&&(H.H=H.H%12+H.p*12),H.m===void 0&&(H.m="q"in H?H.q:0),"V"in H){if(H.V<1||H.V>53)return null;"w"in H||(H.w=1),"Z"in H?(ct=Py(Ku(H.y,0,1)),gt=ct.getUTCDay(),ct=gt>4||gt===0?bl.ceil(ct):bl(ct),ct=qa.offset(ct,(H.V-1)*7),H.y=ct.getUTCFullYear(),H.m=ct.getUTCMonth(),H.d=ct.getUTCDate()+(H.w+6)%7):(ct=Ry(Ku(H.y,0,1)),gt=ct.getDay(),ct=gt>4||gt===0?_l.ceil(ct):_l(ct),ct=ei.offset(ct,(H.V-1)*7),H.y=ct.getFullYear(),H.m=ct.getMonth(),H.d=ct.getDate()+(H.w+6)%7)}else("W"in H||"U"in H)&&("w"in H||(H.w="u"in H?H.u%7:"W"in H?1:0),gt="Z"in H?Py(Ku(H.y,0,1)).getUTCDay():Ry(Ku(H.y,0,1)).getDay(),H.m=0,H.d="W"in H?(H.w+6)%7+H.W*7-(gt+5)%7:H.w+H.U*7-(gt+6)%7);return"Z"in H?(H.H+=H.Z/100|0,H.M+=H.Z%100,Py(H)):Ry(H)}}function L(X,at,B,H){for(var lt=0,ct=at.length,gt=B.length,ot,Q;lt<ct;){if(H>=gt)return-1;if(ot=at.charCodeAt(lt++),ot===37){if(ot=at.charAt(lt++),Q=b[ot in pT?at.charAt(lt++):ot],!Q||(H=Q(X,B,H))<0)return-1}else if(ot!=B.charCodeAt(H++))return-1}return H}function E(X,at,B){var H=c.exec(at.slice(B));return H?(X.p=u.get(H[0].toLowerCase()),B+H[0].length):-1}function I(X,at,B){var H=h.exec(at.slice(B));return H?(X.w=p.get(H[0].toLowerCase()),B+H[0].length):-1}function D(X,at,B){var H=f.exec(at.slice(B));return H?(X.w=d.get(H[0].toLowerCase()),B+H[0].length):-1}function F(X,at,B){var H=x.exec(at.slice(B));return H?(X.m=y.get(H[0].toLowerCase()),B+H[0].length):-1}function $(X,at,B){var H=g.exec(at.slice(B));return H?(X.m=m.get(H[0].toLowerCase()),B+H[0].length):-1}function T(X,at,B){return L(X,e,at,B)}function S(X,at,B){return L(X,n,at,B)}function k(X,at,B){return L(X,r,at,B)}function P(X){return a[X.getDay()]}function N(X){return i[X.getDay()]}function R(X){return l[X.getMonth()]}function O(X){return s[X.getMonth()]}function W(X){return o[+(X.getHours()>=12)]}function Y(X){return 1+~~(X.getMonth()/3)}function J(X){return a[X.getUTCDay()]}function nt(X){return i[X.getUTCDay()]}function et(X){return l[X.getUTCMonth()]}function xt(X){return s[X.getUTCMonth()]}function Z(X){return o[+(X.getUTCHours()>=12)]}function vt(X){return 1+~~(X.getUTCMonth()/3)}return{format:function(X){var at=w(X+="",_);return at.toString=function(){return X},at},parse:function(X){var at=A(X+="",!1);return at.toString=function(){return X},at},utcFormat:function(X){var at=w(X+="",v);return at.toString=function(){return X},at},utcParse:function(X){var at=A(X+="",!0);return at.toString=function(){return X},at}}}var pT={"-":"",_:" ",0:"0"},Ke=/^\s*\d+/,wV=/^%/,kV=/[\\^$*+?|[\]().{}]/g;function Ot(t,e,n){var r=t<0?"-":"",o=(r?-t:t)+"",i=o.length;return r+(i<n?new Array(n-i+1).join(e)+o:o)}function SV(t){return t.replace(kV,"\\$&")}function Qu(t){return new RegExp("^(?:"+t.map(SV).join("|")+")","i")}function Ju(t){return new Map(t.map((e,n)=>[e.toLowerCase(),n]))}function CV(t,e,n){var r=Ke.exec(e.slice(n,n+1));return r?(t.w=+r[0],n+r[0].length):-1}function AV(t,e,n){var r=Ke.exec(e.slice(n,n+1));return r?(t.u=+r[0],n+r[0].length):-1}function TV(t,e,n){var r=Ke.exec(e.slice(n,n+2));return r?(t.U=+r[0],n+r[0].length):-1}function LV(t,e,n){var r=Ke.exec(e.slice(n,n+2));return r?(t.V=+r[0],n+r[0].length):-1}function EV(t,e,n){var r=Ke.exec(e.slice(n,n+2));return r?(t.W=+r[0],n+r[0].length):-1}function mT(t,e,n){var r=Ke.exec(e.slice(n,n+4));return r?(t.y=+r[0],n+r[0].length):-1}function gT(t,e,n){var r=Ke.exec(e.slice(n,n+2));return r?(t.y=+r[0]+(+r[0]>68?1900:2e3),n+r[0].length):-1}function MV(t,e,n){var r=/^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(e.slice(n,n+6));return r?(t.Z=r[1]?0:-(r[2]+(r[3]||"00")),n+r[0].length):-1}function RV(t,e,n){var r=Ke.exec(e.slice(n,n+1));return r?(t.q=r[0]*3-3,n+r[0].length):-1}function PV(t,e,n){var r=Ke.exec(e.slice(n,n+2));return r?(t.m=r[0]-1,n+r[0].length):-1}function xT(t,e,n){var r=Ke.exec(e.slice(n,n+2));return r?(t.d=+r[0],n+r[0].length):-1}function IV(t,e,n){var r=Ke.exec(e.slice(n,n+3));return r?(t.m=0,t.d=+r[0],n+r[0].length):-1}function vT(t,e,n){var r=Ke.exec(e.slice(n,n+2));return r?(t.H=+r[0],n+r[0].length):-1}function NV(t,e,n){var r=Ke.exec(e.slice(n,n+2));return r?(t.M=+r[0],n+r[0].length):-1}function $V(t,e,n){var r=Ke.exec(e.slice(n,n+2));return r?(t.S=+r[0],n+r[0].length):-1}function DV(t,e,n){var r=Ke.exec(e.slice(n,n+3));return r?(t.L=+r[0],n+r[0].length):-1}function OV(t,e,n){var r=Ke.exec(e.slice(n,n+6));return r?(t.L=Math.floor(r[0]/1e3),n+r[0].length):-1}function zV(t,e,n){var r=wV.exec(e.slice(n,n+1));return r?n+r[0].length:-1}function BV(t,e,n){var r=Ke.exec(e.slice(n));return r?(t.Q=+r[0],n+r[0].length):-1}function FV(t,e,n){var r=Ke.exec(e.slice(n));return r?(t.s=+r[0],n+r[0].length):-1}function yT(t,e){return Ot(t.getDate(),e,2)}function GV(t,e){return Ot(t.getHours(),e,2)}function WV(t,e){return Ot(t.getHours()%12||12,e,2)}function VV(t,e){return Ot(1+ei.count(Xn(t),t),e,3)}function ST(t,e){return Ot(t.getMilliseconds(),e,3)}function HV(t,e){return ST(t,e)+"000"}function jV(t,e){return Ot(t.getMonth()+1,e,2)}function YV(t,e){return Ot(t.getMinutes(),e,2)}function UV(t,e){return Ot(t.getSeconds(),e,2)}function qV(t){var e=t.getDay();return e===0?7:e}function XV(t,e){return Ot(ni.count(Xn(t)-1,t),e,2)}function CT(t){var e=t.getDay();return e>=4||e===0?Di(t):Di.ceil(t)}function ZV(t,e){return t=CT(t),Ot(Di.count(Xn(t),t)+(Xn(t).getDay()===4),e,2)}function KV(t){return t.getDay()}function QV(t,e){return Ot(_l.count(Xn(t)-1,t),e,2)}function JV(t,e){return Ot(t.getFullYear()%100,e,2)}function tH(t,e){return t=CT(t),Ot(t.getFullYear()%100,e,2)}function eH(t,e){return Ot(t.getFullYear()%1e4,e,4)}function nH(t,e){var n=t.getDay();return t=n>=4||n===0?Di(t):Di.ceil(t),Ot(t.getFullYear()%1e4,e,4)}function rH(t){var e=t.getTimezoneOffset();return(e>0?"-":(e*=-1,"+"))+Ot(e/60|0,"0",2)+Ot(e%60,"0",2)}function _T(t,e){return Ot(t.getUTCDate(),e,2)}function oH(t,e){return Ot(t.getUTCHours(),e,2)}function iH(t,e){return Ot(t.getUTCHours()%12||12,e,2)}function aH(t,e){return Ot(1+qa.count(Zn(t),t),e,3)}function AT(t,e){return Ot(t.getUTCMilliseconds(),e,3)}function sH(t,e){return AT(t,e)+"000"}function lH(t,e){return Ot(t.getUTCMonth()+1,e,2)}function cH(t,e){return Ot(t.getUTCMinutes(),e,2)}function uH(t,e){return Ot(t.getUTCSeconds(),e,2)}function fH(t){var e=t.getUTCDay();return e===0?7:e}function dH(t,e){return Ot(ri.count(Zn(t)-1,t),e,2)}function TT(t){var e=t.getUTCDay();return e>=4||e===0?Oi(t):Oi.ceil(t)}function hH(t,e){return t=TT(t),Ot(Oi.count(Zn(t),t)+(Zn(t).getUTCDay()===4),e,2)}function pH(t){return t.getUTCDay()}function mH(t,e){return Ot(bl.count(Zn(t)-1,t),e,2)}function gH(t,e){return Ot(t.getUTCFullYear()%100,e,2)}function xH(t,e){return t=TT(t),Ot(t.getUTCFullYear()%100,e,2)}function vH(t,e){return Ot(t.getUTCFullYear()%1e4,e,4)}function yH(t,e){var n=t.getUTCDay();return t=n>=4||n===0?Oi(t):Oi.ceil(t),Ot(t.getUTCFullYear()%1e4,e,4)}function _H(){return"+0000"}function bT(){return"%"}function wT(t){return+t}function kT(t){return Math.floor(+t/1e3)}var Sl,Hp,LT,jp,ET;Ny({dateTime:"%x, %X",date:"%-m/%-d/%Y",time:"%-I:%M:%S %p",periods:["AM","PM"],days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],shortDays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],shortMonths:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]});function Ny(t){return Sl=Iy(t),Hp=Sl.format,LT=Sl.parse,jp=Sl.utcFormat,ET=Sl.utcParse,Sl}function bH(t){return new Date(t)}function wH(t){return t instanceof Date?+t:+new Date(+t)}function Yp(t,e,n,r,o,i,a,s,l,c){var u=Wu(),f=u.invert,d=u.domain,h=c(".%L"),p=c(":%S"),g=c("%I:%M"),m=c("%I %p"),x=c("%a %d"),y=c("%b %d"),_=c("%B"),v=c("%Y");function b(w){return(l(w)<w?h:s(w)<w?p:a(w)<w?g:i(w)<w?m:r(w)<w?o(w)<w?x:y:n(w)<w?_:v)(w)}return u.invert=function(w){return new Date(f(w))},u.domain=function(w){return arguments.length?d(Array.from(w,wH)):d().map(bH)},u.ticks=function(w){var A=d();return t(A[0],A[A.length-1],w??10)},u.tickFormat=function(w,A){return A==null?b:c(A)},u.nice=function(w){var A=d();return(!w||typeof w.range!="function")&&(w=e(A[0],A[A.length-1],w??10)),w?d(ju(A,w)):u},u.copy=function(){return go(u,Yp(t,e,n,r,o,i,a,s,l,c))},u}function Up(){return Se.apply(Yp(Ey,My,Xn,wl,ni,ei,vl,gl,dr,Hp).domain([new Date(2e3,0,1),new Date(2e3,0,2)]),arguments)}function qp(){return Se.apply(Yp(Ty,Ly,Zn,kl,ri,qa,yl,xl,dr,jp).domain([Date.UTC(2e3,0,1),Date.UTC(2e3,0,2)]),arguments)}function kH(){var t=0,e=1,n,r,o,i,a=cn,s=!1,l;function c(f){return f==null||isNaN(f=+f)?l:a(o===0?.5:(f=(i(f)-n)*o,s?Math.max(0,Math.min(1,f)):f))}c.domain=function(f){return arguments.length?([t,e]=f,n=i(t=+t),r=i(e=+e),o=n===r?0:1/(r-n),c):[t,e]},c.clamp=function(f){return arguments.length?(s=!!f,c):s},c.interpolator=function(f){return arguments.length?(a=f,c):a};function u(f){return function(d){var h,p;return arguments.length?([h,p]=d,a=f(h,p),c):[a(0),a(1)]}}return c.range=u(re),c.rangeRound=u(Ga),c.unknown=function(f){return arguments.length?(l=f,c):l},function(f){return i=f,n=f(t),r=f(e),o=n===r?0:1/(r-n),c}}function $y(t,e){return e.domain(t.domain()).interpolator(t.interpolator()).clamp(t.clamp()).unknown(t.unknown())}function tf(){var t=qn(kH()(cn));return t.copy=function(){return $y(t,tf())},$p.apply(t,arguments)}function SH(){var t=0,e=.5,n=1,r=1,o,i,a,s,l,c=cn,u,f=!1,d;function h(g){return isNaN(g=+g)?d:(g=.5+((g=+u(g))-i)*(r*g<r*i?s:l),c(f?Math.max(0,Math.min(1,g)):g))}h.domain=function(g){return arguments.length?([t,e,n]=g,o=u(t=+t),i=u(e=+e),a=u(n=+n),s=o===i?0:.5/(i-o),l=i===a?0:.5/(a-i),r=i<o?-1:1,h):[t,e,n]},h.clamp=function(g){return arguments.length?(f=!!g,h):f},h.interpolator=function(g){return arguments.length?(c=g,h):c};function p(g){return function(m){var x,y,_;return arguments.length?([x,y,_]=m,c=Bp(g,[x,y,_]),h):[c(0),c(.5),c(1)]}}return h.range=p(re),h.rangeRound=p(Ga),h.unknown=function(g){return arguments.length?(d=g,h):d},function(g){return u=g,o=g(t),i=g(e),a=g(n),s=o===i?0:.5/(i-o),l=i===a?0:.5/(a-i),r=i<o?-1:1,h}}function ef(){var t=qn(SH()(cn));return t.copy=function(){return $y(t,ef())},$p.apply(t,arguments)}var CH=Fr().range(Array.from({length:po.length},(t,e)=>`var(${Ri(e)})`)).domain(Array.from({length:po.length},(t,e)=>e));function K(t,e,n,r,o){var i;if(Array.isArray(e)&&isFinite(n))return e[n%e.length];let a;if(ge(e)?a=e(t,n,r):a=e,a)return a;let s=(i=o?.colorFn)!==null&&i!==void 0?i:CH;return r?s(r):tt(n)&&!o?.dontFallbackToCssVar?s(n%po.length):null}function AH(t){let e=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(t);return e?{r:parseInt(e[1],16),g:parseInt(e[2],16),b:parseInt(e[3],16)}:{r:0,g:0,b:0}}function Dy(t){return(.2126*t.r+.7152*t.g+.0722*t.b)/255}function zn(t){let e=AH(t);return Dy(e)}function Gr(t,e){var n;let r=Ei(t)?On(t,e):t;return(n=Ut(r))===null||n===void 0?void 0:n.formatHex()}function MT(t,e){var n;let r=(n=Ut(t))===null||n===void 0?void 0:n.rgb();if(!r||r.opacity===1)return r;let o=1-r.opacity,i=Ut(e??"#fff").rgb();return{r:Math.round((r.opacity*(r.r/255)+o*(i.r/255))*255),g:Math.round((r.opacity*(r.g/255)+o*(i.g/255))*255),b:Math.round((r.opacity*(r.b/255)+o*(i.b/255))*255)}}function RT(t,e){let n=Np(t);return n?n.brighter(e).formatHex():t}function PT(t,e=.55){let n=Gr(t,document.body);return n?zn(n)<e:!1}var xe="unovis-pattern-index",IT="unovis-pattern-defs";function Nt(t,e,n){let r=st(t,e,n);return r?wA(r):null}function Ft(t){return!t||!("svg"in t)?null:`url(#${ny(t.id)})`}var Oy;function TH(){var t;return Oy===void 0&&(Oy=typeof CSS<"u"&&!!(!((t=CSS.supports)===null||t===void 0)&&t.call(CSS,"fill","context-stroke"))),Oy}function LH(t,e){return`${ry(t)}-${tA(e.replace("#",""))}`}function EH(t){let e=t.querySelector(`defs.${IT}`);return e||(e=document.createElementNS("http://www.w3.org/2000/svg","defs"),e.setAttribute("class",IT),t.insertBefore(e,t.firstChild)),e}function Cl(t,e,n){var r,o;if(!t||!("marker"in t))return null;let i=!((r=t.dashArray)===null||r===void 0)&&r.length?t.dashArray.join(" "):null;if(TH())return{marker:`url(#${oy(t.id)})`,dashArray:i};let a=(o=n instanceof SVGElement?n.ownerSVGElement:null)!==null&&o!==void 0?o:n?.closest("svg");if(!a||!e)return{marker:null,dashArray:i};let s=Gr(e,a)||e,l=LH(t.id,s),c=EH(a);return c.querySelector(`#${CSS.escape(l)}`)||c.appendChild(kA(t,l,s)),{marker:`url(#${l})`,dashArray:i}}var Xp=globalThis?.UNOVIS_ICON_FONT_FAMILY||"FontAwesome",NT=globalThis?.UNOVIS_FONT_W2H_RATIO_DEFAULT||.5,zy=globalThis?.UNOVIS_TEXT_SEPARATOR_DEFAULT||[" ","-",".",","],By=globalThis?.UNOVIS_TEXT_HYPHEN_CHARACTER_DEFAULT||"-",Zp=globalThis?.UNOVIS_TEXT_DEFAULT_FONT_SIZE||12,Ka=globalThis?.UNOVIS_TEXT_DEFAULT||{text:"",fontSize:Zp,fontFamily:"var(--vis-font-family)",lineHeight:1.25,marginTop:0,marginBottom:0},lct=Pt`
|
|
27
|
+
:root {
|
|
28
|
+
label: vis-root-styles;
|
|
29
|
+
--vis-font-family: Inter, Arial, "Helvetica Neue", Helvetica, sans-serif;
|
|
30
|
+
--vis-font-wh-ratio: ${NT};
|
|
31
|
+
--vis-color-main: var(${Ri(0)});
|
|
32
|
+
--vis-color-main-light: ${_A(po[0])};
|
|
33
|
+
--vis-color-main-dark: ${bA(po[0])};
|
|
34
|
+
--vis-color-grey: #2a2a2a;
|
|
35
|
+
${po.map((t,e)=>`${Ri(e)}: ${t};`)}
|
|
36
|
+
${yA.map((t,e)=>`--vis-dark-color${e}: ${t};`)}
|
|
37
|
+
${Bu.map((t,e)=>`
|
|
38
|
+
--${Ba(t)}: url(#${Ba(t)});
|
|
39
|
+
--vis-pattern-fill${e}: var(--${Ba(t)});
|
|
40
|
+
`)}
|
|
41
|
+
${hl.map((t,e)=>{var n;return`
|
|
42
|
+
--${Ba(t)}: url(#${Ba(t)});
|
|
43
|
+
--vis-pattern-marker${e}: var(--${Ba(t)});
|
|
44
|
+
--vis-pattern-dasharray${e}: ${(n=t.dashArray)===null||n===void 0?void 0:n.join(" ")};
|
|
45
|
+
`})}
|
|
46
|
+
|
|
47
|
+
${Yt} {
|
|
48
|
+
${po.map((t,e)=>`${Ri(e)}: var(--vis-dark-color${e});`)}
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
body.theme-patterns {
|
|
52
|
+
${Bu.map((t,e)=>`path[${xe}="${e}"][style*="fill"]:not([style*="mask"]) {
|
|
53
|
+
mask: var(--vis-pattern-fill${e});
|
|
54
|
+
}`)}
|
|
55
|
+
${hl.map((t,e)=>`
|
|
56
|
+
path[${xe}="${e}"]:not([style*="fill"]):not([style*="marker"]) {
|
|
57
|
+
marker: var(--vis-pattern-marker${e});
|
|
58
|
+
stroke-dasharray: var(--vis-pattern-dasharray${e});
|
|
59
|
+
}
|
|
60
|
+
`)}
|
|
61
|
+
}
|
|
62
|
+
`;function zi(t=window?.document.body){return t?+On("var(--vis-font-wh-ratio)",t):NT}var Kp="http://www.w3.org/1999/xhtml",Fy={svg:"http://www.w3.org/2000/svg",xhtml:Kp,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function oi(t){var e=t+="",n=e.indexOf(":");return n>=0&&(e=t.slice(0,n))!=="xmlns"&&(t=t.slice(n+1)),Fy.hasOwnProperty(e)?{space:Fy[e],local:t}:t}function MH(t){return function(){var e=this.ownerDocument,n=this.namespaceURI;return n===Kp&&e.documentElement.namespaceURI===Kp?e.createElement(t):e.createElementNS(n,t)}}function RH(t){return function(){return this.ownerDocument.createElementNS(t.space,t.local)}}function Qp(t){var e=oi(t);return(e.local?RH:MH)(e)}function PH(){}function Qa(t){return t==null?PH:function(){return this.querySelector(t)}}function $T(t){typeof t!="function"&&(t=Qa(t));for(var e=this._groups,n=e.length,r=new Array(n),o=0;o<n;++o)for(var i=e[o],a=i.length,s=r[o]=new Array(a),l,c,u=0;u<a;++u)(l=i[u])&&(c=t.call(l,l.__data__,u,i))&&("__data__"in l&&(c.__data__=l.__data__),s[u]=c);return new Ce(r,this._parents)}function Gy(t){return t==null?[]:Array.isArray(t)?t:Array.from(t)}function IH(){return[]}function nf(t){return t==null?IH:function(){return this.querySelectorAll(t)}}function NH(t){return function(){return Gy(t.apply(this,arguments))}}function DT(t){typeof t=="function"?t=NH(t):t=nf(t);for(var e=this._groups,n=e.length,r=[],o=[],i=0;i<n;++i)for(var a=e[i],s=a.length,l,c=0;c<s;++c)(l=a[c])&&(r.push(t.call(l,l.__data__,c,a)),o.push(l));return new Ce(r,o)}function rf(t){return function(){return this.matches(t)}}function Jp(t){return function(e){return e.matches(t)}}var $H=Array.prototype.find;function DH(t){return function(){return $H.call(this.children,t)}}function OH(){return this.firstElementChild}function OT(t){return this.select(t==null?OH:DH(typeof t=="function"?t:Jp(t)))}var zH=Array.prototype.filter;function BH(){return Array.from(this.children)}function FH(t){return function(){return zH.call(this.children,t)}}function zT(t){return this.selectAll(t==null?BH:FH(typeof t=="function"?t:Jp(t)))}function BT(t){typeof t!="function"&&(t=rf(t));for(var e=this._groups,n=e.length,r=new Array(n),o=0;o<n;++o)for(var i=e[o],a=i.length,s=r[o]=[],l,c=0;c<a;++c)(l=i[c])&&t.call(l,l.__data__,c,i)&&s.push(l);return new Ce(r,this._parents)}function tm(t){return new Array(t.length)}function FT(){return new Ce(this._enter||this._groups.map(tm),this._parents)}function of(t,e){this.ownerDocument=t.ownerDocument,this.namespaceURI=t.namespaceURI,this._next=null,this._parent=t,this.__data__=e}of.prototype={constructor:of,appendChild:function(t){return this._parent.insertBefore(t,this._next)},insertBefore:function(t,e){return this._parent.insertBefore(t,e)},querySelector:function(t){return this._parent.querySelector(t)},querySelectorAll:function(t){return this._parent.querySelectorAll(t)}};function GT(t){return function(){return t}}function GH(t,e,n,r,o,i){for(var a=0,s,l=e.length,c=i.length;a<c;++a)(s=e[a])?(s.__data__=i[a],r[a]=s):n[a]=new of(t,i[a]);for(;a<l;++a)(s=e[a])&&(o[a]=s)}function WH(t,e,n,r,o,i,a){var s,l,c=new Map,u=e.length,f=i.length,d=new Array(u),h;for(s=0;s<u;++s)(l=e[s])&&(d[s]=h=a.call(l,l.__data__,s,e)+"",c.has(h)?o[s]=l:c.set(h,l));for(s=0;s<f;++s)h=a.call(t,i[s],s,i)+"",(l=c.get(h))?(r[s]=l,l.__data__=i[s],c.delete(h)):n[s]=new of(t,i[s]);for(s=0;s<u;++s)(l=e[s])&&c.get(d[s])===l&&(o[s]=l)}function VH(t){return t.__data__}function WT(t,e){if(!arguments.length)return Array.from(this,VH);var n=e?WH:GH,r=this._parents,o=this._groups;typeof t!="function"&&(t=GT(t));for(var i=o.length,a=new Array(i),s=new Array(i),l=new Array(i),c=0;c<i;++c){var u=r[c],f=o[c],d=f.length,h=HH(t.call(u,u&&u.__data__,c,r)),p=h.length,g=s[c]=new Array(p),m=a[c]=new Array(p),x=l[c]=new Array(d);n(u,f,g,m,x,h,e);for(var y=0,_=0,v,b;y<p;++y)if(v=g[y]){for(y>=_&&(_=y+1);!(b=m[_])&&++_<p;);v._next=b||null}}return a=new Ce(a,r),a._enter=s,a._exit=l,a}function HH(t){return typeof t=="object"&&"length"in t?t:Array.from(t)}function VT(){return new Ce(this._exit||this._groups.map(tm),this._parents)}function HT(t,e,n){var r=this.enter(),o=this,i=this.exit();return typeof t=="function"?(r=t(r),r&&(r=r.selection())):r=r.append(t+""),e!=null&&(o=e(o),o&&(o=o.selection())),n==null?i.remove():n(i),r&&o?r.merge(o).order():o}function jT(t){for(var e=t.selection?t.selection():t,n=this._groups,r=e._groups,o=n.length,i=r.length,a=Math.min(o,i),s=new Array(o),l=0;l<a;++l)for(var c=n[l],u=r[l],f=c.length,d=s[l]=new Array(f),h,p=0;p<f;++p)(h=c[p]||u[p])&&(d[p]=h);for(;l<o;++l)s[l]=n[l];return new Ce(s,this._parents)}function YT(){for(var t=this._groups,e=-1,n=t.length;++e<n;)for(var r=t[e],o=r.length-1,i=r[o],a;--o>=0;)(a=r[o])&&(i&&a.compareDocumentPosition(i)^4&&i.parentNode.insertBefore(a,i),i=a);return this}function UT(t){t||(t=jH);function e(f,d){return f&&d?t(f.__data__,d.__data__):!f-!d}for(var n=this._groups,r=n.length,o=new Array(r),i=0;i<r;++i){for(var a=n[i],s=a.length,l=o[i]=new Array(s),c,u=0;u<s;++u)(c=a[u])&&(l[u]=c);l.sort(e)}return new Ce(o,this._parents).order()}function jH(t,e){return t<e?-1:t>e?1:t>=e?0:NaN}function qT(){var t=arguments[0];return arguments[0]=this,t.apply(null,arguments),this}function XT(){return Array.from(this)}function ZT(){for(var t=this._groups,e=0,n=t.length;e<n;++e)for(var r=t[e],o=0,i=r.length;o<i;++o){var a=r[o];if(a)return a}return null}function KT(){let t=0;for(let e of this)++t;return t}function QT(){return!this.node()}function JT(t){for(var e=this._groups,n=0,r=e.length;n<r;++n)for(var o=e[n],i=0,a=o.length,s;i<a;++i)(s=o[i])&&t.call(s,s.__data__,i,o);return this}function YH(t){return function(){this.removeAttribute(t)}}function UH(t){return function(){this.removeAttributeNS(t.space,t.local)}}function qH(t,e){return function(){this.setAttribute(t,e)}}function XH(t,e){return function(){this.setAttributeNS(t.space,t.local,e)}}function ZH(t,e){return function(){var n=e.apply(this,arguments);n==null?this.removeAttribute(t):this.setAttribute(t,n)}}function KH(t,e){return function(){var n=e.apply(this,arguments);n==null?this.removeAttributeNS(t.space,t.local):this.setAttributeNS(t.space,t.local,n)}}function tL(t,e){var n=oi(t);if(arguments.length<2){var r=this.node();return n.local?r.getAttributeNS(n.space,n.local):r.getAttribute(n)}return this.each((e==null?n.local?UH:YH:typeof e=="function"?n.local?KH:ZH:n.local?XH:qH)(n,e))}function em(t){return t.ownerDocument&&t.ownerDocument.defaultView||t.document&&t||t.defaultView}function QH(t){return function(){this.style.removeProperty(t)}}function JH(t,e,n){return function(){this.style.setProperty(t,e,n)}}function t6(t,e,n){return function(){var r=e.apply(this,arguments);r==null?this.style.removeProperty(t):this.style.setProperty(t,r,n)}}function eL(t,e,n){return arguments.length>1?this.each((e==null?QH:typeof e=="function"?t6:JH)(t,e,n??"")):Bi(this.node(),t)}function Bi(t,e){return t.style.getPropertyValue(e)||em(t).getComputedStyle(t,null).getPropertyValue(e)}function e6(t){return function(){delete this[t]}}function n6(t,e){return function(){this[t]=e}}function r6(t,e){return function(){var n=e.apply(this,arguments);n==null?delete this[t]:this[t]=n}}function nL(t,e){return arguments.length>1?this.each((e==null?e6:typeof e=="function"?r6:n6)(t,e)):this.node()[t]}function rL(t){return t.trim().split(/^|\s+/)}function Wy(t){return t.classList||new oL(t)}function oL(t){this._node=t,this._names=rL(t.getAttribute("class")||"")}oL.prototype={add:function(t){var e=this._names.indexOf(t);e<0&&(this._names.push(t),this._node.setAttribute("class",this._names.join(" ")))},remove:function(t){var e=this._names.indexOf(t);e>=0&&(this._names.splice(e,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(t){return this._names.indexOf(t)>=0}};function iL(t,e){for(var n=Wy(t),r=-1,o=e.length;++r<o;)n.add(e[r])}function aL(t,e){for(var n=Wy(t),r=-1,o=e.length;++r<o;)n.remove(e[r])}function o6(t){return function(){iL(this,t)}}function i6(t){return function(){aL(this,t)}}function a6(t,e){return function(){(e.apply(this,arguments)?iL:aL)(this,t)}}function sL(t,e){var n=rL(t+"");if(arguments.length<2){for(var r=Wy(this.node()),o=-1,i=n.length;++o<i;)if(!r.contains(n[o]))return!1;return!0}return this.each((typeof e=="function"?a6:e?o6:i6)(n,e))}function s6(){this.textContent=""}function l6(t){return function(){this.textContent=t}}function c6(t){return function(){var e=t.apply(this,arguments);this.textContent=e??""}}function lL(t){return arguments.length?this.each(t==null?s6:(typeof t=="function"?c6:l6)(t)):this.node().textContent}function u6(){this.innerHTML=""}function f6(t){return function(){this.innerHTML=t}}function d6(t){return function(){var e=t.apply(this,arguments);this.innerHTML=e??""}}function cL(t){return arguments.length?this.each(t==null?u6:(typeof t=="function"?d6:f6)(t)):this.node().innerHTML}function h6(){this.nextSibling&&this.parentNode.appendChild(this)}function uL(){return this.each(h6)}function p6(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function fL(){return this.each(p6)}function dL(t){var e=typeof t=="function"?t:Qp(t);return this.select(function(){return this.appendChild(e.apply(this,arguments))})}function m6(){return null}function hL(t,e){var n=typeof t=="function"?t:Qp(t),r=e==null?m6:typeof e=="function"?e:Qa(e);return this.select(function(){return this.insertBefore(n.apply(this,arguments),r.apply(this,arguments)||null)})}function g6(){var t=this.parentNode;t&&t.removeChild(this)}function pL(){return this.each(g6)}function x6(){var t=this.cloneNode(!1),e=this.parentNode;return e?e.insertBefore(t,this.nextSibling):t}function v6(){var t=this.cloneNode(!0),e=this.parentNode;return e?e.insertBefore(t,this.nextSibling):t}function mL(t){return this.select(t?v6:x6)}function gL(t){return arguments.length?this.property("__data__",t):this.node().__data__}function y6(t){return function(e){t.call(this,e,this.__data__)}}function _6(t){return t.trim().split(/^|\s+/).map(function(e){var n="",r=e.indexOf(".");return r>=0&&(n=e.slice(r+1),e=e.slice(0,r)),{type:e,name:n}})}function b6(t){return function(){var e=this.__on;if(e){for(var n=0,r=-1,o=e.length,i;n<o;++n)i=e[n],(!t.type||i.type===t.type)&&i.name===t.name?this.removeEventListener(i.type,i.listener,i.options):e[++r]=i;++r?e.length=r:delete this.__on}}}function w6(t,e,n){return function(){var r=this.__on,o,i=y6(e);if(r){for(var a=0,s=r.length;a<s;++a)if((o=r[a]).type===t.type&&o.name===t.name){this.removeEventListener(o.type,o.listener,o.options),this.addEventListener(o.type,o.listener=i,o.options=n),o.value=e;return}}this.addEventListener(t.type,i,n),o={type:t.type,name:t.name,value:e,listener:i,options:n},r?r.push(o):this.__on=[o]}}function xL(t,e,n){var r=_6(t+""),o,i=r.length,a;if(arguments.length<2){var s=this.node().__on;if(s){for(var l=0,c=s.length,u;l<c;++l)for(o=0,u=s[l];o<i;++o)if((a=r[o]).type===u.type&&a.name===u.name)return u.value}return}for(s=e?w6:b6,o=0;o<i;++o)this.each(s(r[o],e,n));return this}function vL(t,e,n){var r=em(t),o=r.CustomEvent;typeof o=="function"?o=new o(e,n):(o=r.document.createEvent("Event"),n?(o.initEvent(e,n.bubbles,n.cancelable),o.detail=n.detail):o.initEvent(e,!1,!1)),t.dispatchEvent(o)}function k6(t,e){return function(){return vL(this,t,e)}}function S6(t,e){return function(){return vL(this,t,e.apply(this,arguments))}}function yL(t,e){return this.each((typeof e=="function"?S6:k6)(t,e))}function*_L(){for(var t=this._groups,e=0,n=t.length;e<n;++e)for(var r=t[e],o=0,i=r.length,a;o<i;++o)(a=r[o])&&(yield a)}var Vy=[null];function Ce(t,e){this._groups=t,this._parents=e}function bL(){return new Ce([[document.documentElement]],Vy)}function C6(){return this}Ce.prototype=bL.prototype={constructor:Ce,select:$T,selectAll:DT,selectChild:OT,selectChildren:zT,filter:BT,data:WT,enter:FT,exit:VT,join:HT,merge:jT,selection:C6,order:YT,sort:UT,call:qT,nodes:XT,node:ZT,size:KT,empty:QT,each:JT,attr:tL,style:eL,property:nL,classed:sL,text:lL,html:cL,raise:uL,lower:fL,append:dL,insert:hL,remove:pL,clone:mL,datum:gL,on:xL,dispatch:yL,[Symbol.iterator]:_L};var ii=bL;function U(t){return typeof t=="string"?new Ce([[document.querySelector(t)]],[document.documentElement]):new Ce([[t]],Vy)}function wL(t){let e;for(;e=t.sourceEvent;)t=e;return t}function oe(t,e){if(t=wL(t),e===void 0&&(e=t.currentTarget),e){var n=e.ownerSVGElement||e;if(n.createSVGPoint){var r=n.createSVGPoint();return r.x=t.clientX,r.y=t.clientY,r=r.matrixTransform(e.getScreenCTM().inverse()),[r.x,r.y]}if(e.getBoundingClientRect){var o=e.getBoundingClientRect();return[t.clientX-o.left-e.clientLeft,t.clientY-o.top-e.clientTop]}}return[t.pageX,t.pageY]}var Al;(function(t){t[t.SVG=0]="SVG",t[t.HTML=1]="HTML"})(Al||(Al={}));var Jt;(function(t){t.Fit="fit",t.Extend="extend",t.FitWidth="fit_width"})(Jt||(Jt={}));var hr=[];var kL=function(){return hr.some(function(t){return t.activeTargets.length>0})};var SL=function(){return hr.some(function(t){return t.skippedTargets.length>0})};var CL="ResizeObserver loop completed with undelivered notifications.",AL=function(){var t;typeof ErrorEvent=="function"?t=new ErrorEvent("error",{message:CL}):(t=document.createEvent("Event"),t.initEvent("error",!1,!1),t.message=CL),window.dispatchEvent(t)};var Ja;(function(t){t.BORDER_BOX="border-box",t.CONTENT_BOX="content-box",t.DEVICE_PIXEL_CONTENT_BOX="device-pixel-content-box"})(Ja||(Ja={}));var Wr=function(t){return Object.freeze(t)};var Hy=(function(){function t(e,n){this.inlineSize=e,this.blockSize=n,Wr(this)}return t})();var jy=(function(){function t(e,n,r,o){return this.x=e,this.y=n,this.width=r,this.height=o,this.top=this.y,this.left=this.x,this.bottom=this.top+this.height,this.right=this.left+this.width,Wr(this)}return t.prototype.toJSON=function(){var e=this,n=e.x,r=e.y,o=e.top,i=e.right,a=e.bottom,s=e.left,l=e.width,c=e.height;return{x:n,y:r,top:o,right:i,bottom:a,left:s,width:l,height:c}},t.fromRect=function(e){return new t(e.x,e.y,e.width,e.height)},t})();var af=function(t){return t instanceof SVGElement&&"getBBox"in t},nm=function(t){if(af(t)){var e=t.getBBox(),n=e.width,r=e.height;return!n&&!r}var o=t,i=o.offsetWidth,a=o.offsetHeight;return!(i||a||t.getClientRects().length)},Yy=function(t){var e;if(t instanceof Element)return!0;var n=(e=t?.ownerDocument)===null||e===void 0?void 0:e.defaultView;return!!(n&&t instanceof n.Element)},TL=function(t){switch(t.tagName){case"INPUT":if(t.type!=="image")break;case"VIDEO":case"AUDIO":case"EMBED":case"OBJECT":case"CANVAS":case"IFRAME":case"IMG":return!0}return!1};var ts=typeof window<"u"?window:{};var rm=new WeakMap,LL=/auto|scroll/,A6=/^tb|vertical/,T6=/msie|trident/i.test(ts.navigator&&ts.navigator.userAgent),_o=function(t){return parseFloat(t||"0")},Tl=function(t,e,n){return t===void 0&&(t=0),e===void 0&&(e=0),n===void 0&&(n=!1),new Hy((n?e:t)||0,(n?t:e)||0)},EL=Wr({devicePixelContentBoxSize:Tl(),borderBoxSize:Tl(),contentBoxSize:Tl(),contentRect:new jy(0,0,0,0)}),Uy=function(t,e){if(e===void 0&&(e=!1),rm.has(t)&&!e)return rm.get(t);if(nm(t))return rm.set(t,EL),EL;var n=getComputedStyle(t),r=af(t)&&t.ownerSVGElement&&t.getBBox(),o=!T6&&n.boxSizing==="border-box",i=A6.test(n.writingMode||""),a=!r&&LL.test(n.overflowY||""),s=!r&&LL.test(n.overflowX||""),l=r?0:_o(n.paddingTop),c=r?0:_o(n.paddingRight),u=r?0:_o(n.paddingBottom),f=r?0:_o(n.paddingLeft),d=r?0:_o(n.borderTopWidth),h=r?0:_o(n.borderRightWidth),p=r?0:_o(n.borderBottomWidth),g=r?0:_o(n.borderLeftWidth),m=f+c,x=l+u,y=g+h,_=d+p,v=s?t.offsetHeight-_-t.clientHeight:0,b=a?t.offsetWidth-y-t.clientWidth:0,w=o?m+y:0,A=o?x+_:0,L=r?r.width:_o(n.width)-w-b,E=r?r.height:_o(n.height)-A-v,I=L+m+b+y,D=E+x+v+_,F=Wr({devicePixelContentBoxSize:Tl(Math.round(L*devicePixelRatio),Math.round(E*devicePixelRatio),i),borderBoxSize:Tl(I,D,i),contentBoxSize:Tl(L,E,i),contentRect:new jy(f,l,L,E)});return rm.set(t,F),F},om=function(t,e,n){var r=Uy(t,n),o=r.borderBoxSize,i=r.contentBoxSize,a=r.devicePixelContentBoxSize;switch(e){case Ja.DEVICE_PIXEL_CONTENT_BOX:return a;case Ja.BORDER_BOX:return o;default:return i}};var qy=(function(){function t(e){var n=Uy(e);this.target=e,this.contentRect=n.contentRect,this.borderBoxSize=Wr([n.borderBoxSize]),this.contentBoxSize=Wr([n.contentBoxSize]),this.devicePixelContentBoxSize=Wr([n.devicePixelContentBoxSize])}return t})();var im=function(t){if(nm(t))return 1/0;for(var e=0,n=t.parentNode;n;)e+=1,n=n.parentNode;return e};var ML=function(){var t=1/0,e=[];hr.forEach(function(a){if(a.activeTargets.length!==0){var s=[];a.activeTargets.forEach(function(c){var u=new qy(c.target),f=im(c.target);s.push(u),c.lastReportedSize=om(c.target,c.observedBox),f<t&&(t=f)}),e.push(function(){a.callback.call(a.observer,s,a.observer)}),a.activeTargets.splice(0,a.activeTargets.length)}});for(var n=0,r=e;n<r.length;n++){var o=r[n];o()}return t};var Xy=function(t){hr.forEach(function(n){n.activeTargets.splice(0,n.activeTargets.length),n.skippedTargets.splice(0,n.skippedTargets.length),n.observationTargets.forEach(function(o){o.isActive()&&(im(o.target)>t?n.activeTargets.push(o):n.skippedTargets.push(o))})})};var RL=function(){var t=0;for(Xy(t);kL();)t=ML(),Xy(t);return SL()&&AL(),t>0};var Zy,PL=[],L6=function(){return PL.splice(0).forEach(function(t){return t()})},IL=function(t){if(!Zy){var e=0,n=document.createTextNode(""),r={characterData:!0};new MutationObserver(function(){return L6()}).observe(n,r),Zy=function(){n.textContent="".concat(e?e--:e++)}}PL.push(t),Zy()};var NL=function(t){IL(function(){requestAnimationFrame(t)})};var am=0,E6=function(){return!!am},M6=250,R6={attributes:!0,characterData:!0,childList:!0,subtree:!0},$L=["resize","load","transitionend","animationend","animationstart","animationiteration","keyup","keydown","mouseup","mousedown","mouseover","mouseout","blur","focus"],DL=function(t){return t===void 0&&(t=0),Date.now()+t},Ky=!1,P6=(function(){function t(){var e=this;this.stopped=!0,this.listener=function(){return e.schedule()}}return t.prototype.run=function(e){var n=this;if(e===void 0&&(e=M6),!Ky){Ky=!0;var r=DL(e);NL(function(){var o=!1;try{o=RL()}finally{if(Ky=!1,e=r-DL(),!E6())return;o?n.run(1e3):e>0?n.run(e):n.start()}})}},t.prototype.schedule=function(){this.stop(),this.run()},t.prototype.observe=function(){var e=this,n=function(){return e.observer&&e.observer.observe(document.body,R6)};document.body?n():ts.addEventListener("DOMContentLoaded",n)},t.prototype.start=function(){var e=this;this.stopped&&(this.stopped=!1,this.observer=new MutationObserver(this.listener),this.observe(),$L.forEach(function(n){return ts.addEventListener(n,e.listener,!0)}))},t.prototype.stop=function(){var e=this;this.stopped||(this.observer&&this.observer.disconnect(),$L.forEach(function(n){return ts.removeEventListener(n,e.listener,!0)}),this.stopped=!0)},t})(),sm=new P6,Qy=function(t){!am&&t>0&&sm.start(),am+=t,!am&&sm.stop()};var I6=function(t){return!af(t)&&!TL(t)&&getComputedStyle(t).display==="inline"},OL=(function(){function t(e,n){this.target=e,this.observedBox=n||Ja.CONTENT_BOX,this.lastReportedSize={inlineSize:0,blockSize:0}}return t.prototype.isActive=function(){var e=om(this.target,this.observedBox,!0);return I6(this.target)&&(this.lastReportedSize=e),this.lastReportedSize.inlineSize!==e.inlineSize||this.lastReportedSize.blockSize!==e.blockSize},t})();var zL=(function(){function t(e,n){this.activeTargets=[],this.skippedTargets=[],this.observationTargets=[],this.observer=e,this.callback=n}return t})();var lm=new WeakMap,BL=function(t,e){for(var n=0;n<t.length;n+=1)if(t[n].target===e)return n;return-1},sf=(function(){function t(){}return t.connect=function(e,n){var r=new zL(e,n);lm.set(e,r)},t.observe=function(e,n,r){var o=lm.get(e),i=o.observationTargets.length===0;BL(o.observationTargets,n)<0&&(i&&hr.push(o),o.observationTargets.push(new OL(n,r&&r.box)),Qy(1),sm.schedule())},t.unobserve=function(e,n){var r=lm.get(e),o=BL(r.observationTargets,n),i=r.observationTargets.length===1;o>=0&&(i&&hr.splice(hr.indexOf(r),1),r.observationTargets.splice(o,1),Qy(-1))},t.disconnect=function(e){var n=this,r=lm.get(e);r.observationTargets.slice().forEach(function(o){return n.unobserve(e,o.target)}),r.activeTargets.splice(0,r.activeTargets.length)},t})();var Jy=(function(){function t(e){if(arguments.length===0)throw new TypeError("Failed to construct 'ResizeObserver': 1 argument required, but only 0 present.");if(typeof e!="function")throw new TypeError("Failed to construct 'ResizeObserver': The callback provided as parameter 1 is not a function.");sf.connect(this,e)}return t.prototype.observe=function(e,n){if(arguments.length===0)throw new TypeError("Failed to execute 'observe' on 'ResizeObserver': 1 argument required, but only 0 present.");if(!Yy(e))throw new TypeError("Failed to execute 'observe' on 'ResizeObserver': parameter 1 is not of type 'Element");sf.observe(this,e,n)},t.prototype.unobserve=function(e){if(arguments.length===0)throw new TypeError("Failed to execute 'unobserve' on 'ResizeObserver': 1 argument required, but only 0 present.");if(!Yy(e))throw new TypeError("Failed to execute 'unobserve' on 'ResizeObserver': parameter 1 is not of type 'Element");sf.unobserve(this,e)},t.prototype.disconnect=function(){sf.disconnect(this)},t.toString=function(){return"function ResizeObserver () { [polyfill code] }"},t})();var FL=globalThis.ResizeObserver||Jy;var Ll={duration:void 0,margin:{top:0,bottom:0,left:0,right:0},padding:{top:0,bottom:0,left:0,right:0},sizing:Jt.Fit,width:void 0,height:void 0,svgDefs:void 0,ariaLabel:void 0,color:void 0};var es=class t{constructor(e){this._defaultConfig=Ll,this._isFirstRender=!0,this._renderAnimationFrameId=null,this._container=e;let n=U(this._container);n.attr("role","figure"),this.svg=n.append("svg").style("display","block").attr("xmlns","http://www.w3.org/2000/svg").attr("height",t.DEFAULT_CONTAINER_HEIGHT).attr("aria-hidden",!0),this._svgDefs=this.svg.append("defs"),this._svgDefsExternal=this.svg.append("defs"),this.element=this.svg.node()}updateContainer(e){var n;this.prevConfig=this.config,this.config=He(this._defaultConfig,e),e?.svgDefs!==((n=this.prevConfig)===null||n===void 0?void 0:n.svgDefs)&&(this._svgDefsExternal.selectAll("*").remove(),this._svgDefsExternal.html(e.svgDefs))}_preRender(){}_render(e){let{config:n}=this;U(this._container).attr("aria-label",n.ariaLabel),this._isFirstRender=!1}render(e=this.config.duration){let n=this.config.width||this.containerWidth,r=this.config.height||this.containerHeight;this.svg.attr("width",n).attr("height",r),this._resizeObserver||this._setUpResizeObserver(),cancelAnimationFrame(this._renderAnimationFrameId),this._renderAnimationFrameId=requestAnimationFrame(()=>{this._preRender(),this._render(e)})}get containerWidth(){return this.config.width?this.element.clientWidth||Du(this.config.width)||0:this._container.clientWidth||this._container.getBoundingClientRect().width}get containerHeight(){return this.config.height?this.element.clientHeight||Du(this.config.height)||0:this._container.clientHeight||this._container.getBoundingClientRect().height||t.DEFAULT_CONTAINER_HEIGHT}get width(){return mt(this.containerWidth-this.config.margin.left-this.config.margin.right,0,Number.POSITIVE_INFINITY)}get height(){return mt(this.containerHeight-this.config.margin.top-this.config.margin.bottom,0,Number.POSITIVE_INFINITY)}_removeAllChildren(){for(;this.element.firstChild;)this.element.removeChild(this.element.firstChild)}_onResize(){let{config:e}=this;(e.sizing===Jt.Fit||e.sizing===Jt.FitWidth)&&this.render(0)}_setUpResizeObserver(){if(this._resizeObserver)return;let e=this._container.getBoundingClientRect();this._containerSize={width:e.width,height:e.height},this._resizeObserver=new FL((n,r)=>{cancelAnimationFrame(this._resizeObserverAnimationFrameId),this._resizeObserverAnimationFrameId=requestAnimationFrame(()=>{let o=this._container.getBoundingClientRect(),i={width:o.width,height:o.height};!An(this._containerSize,i)&&i.width&&i.height&&(this._containerSize=i,this._onResize())})}),this._resizeObserver.observe(this._container)}destroy(){var e;cancelAnimationFrame(this._renderAnimationFrameId),cancelAnimationFrame(this._resizeObserverAnimationFrameId),(e=this._resizeObserver)===null||e===void 0||e.disconnect(),this.svg.remove()}};es.DEFAULT_CONTAINER_HEIGHT=300;var pr=class{constructor(e){this.data=e}get data(){return this._data}set data(e){this._data=e}};var kt;(function(t){t.X="x",t.Y="y"})(kt||(kt={}));var lf={scaleLinear:fr,scalePow:$i,scaleSqrt:Sy,scaleLog:Yu,scaleSymlog:Uu,scaleIdentity:Hu,scaleTime:Up,scaleUtc:qp,scaleSequential:tf,scaleDiverging:ef,scaleQuantize:Ha,scaleQuantile:qu,scaleThreshold:ja,scaleOrdinal:Fr,scaleBand:Ni,scalePoint:ay},_e;(function(t){t.X="x",t.Y="y"})(_e||(_e={}));var je;(function(t){t.West="west",t.East="east",t.North="north",t.South="south"})(je||(je={}));var GL=Object.assign(Object.assign({},Ll),{components:[],tooltip:void 0,crosshair:void 0,annotations:void 0,xAxis:void 0,yAxis:void 0,autoMargin:!0,xScale:void 0,xDomain:void 0,xDomainMinConstraint:void 0,xDomainMaxConstraint:void 0,xRange:void 0,yScale:void 0,yDomain:void 0,yDomainMinConstraint:void 0,yDomainMaxConstraint:void 0,yRange:void 0,yDirection:je.North,preventEmptyDomain:null,scaleByDomain:!1,clipPathExtend:2});var El=class extends es{constructor(e,n,r){var o,i;super(e),this._defaultConfig=GL,this.datamodel=new pr,this.config=this._defaultConfig,this._clipPathId=ll(),this._axisMargin={top:0,bottom:0,left:0,right:0},this._firstRender=!0,this._clipPath=this.svg.append("clipPath").attr("id",this._clipPathId),this._clipPath.append("rect");let a="saturate",s=window.location.href.replace(window.location.hash,"");this.svg.attr("class",M`
|
|
63
|
+
--highlight-filter-id: url(${s}#${a}); // defining a css variable
|
|
64
|
+
`),this._svgDefs.append("filter").attr("id",a).attr("filterUnits","objectBoundingBox").html('<feColorMatrix type="saturate" in="SourceGraphic" values="1.35"/>'),n&&this.updateContainer(n,!0),r&&this.setData(r,!0),(this.config.xAxis||this.config.yAxis||!((o=this.components)===null||o===void 0)&&o.some(l=>l.datamodel.data))&&this.render(),(i=document.fonts)===null||i===void 0||i.ready.then(()=>{this._firstRender||this._renderAxes(0)})}get components(){return this.config.components}get width(){let e=this._getMargin();return mt(this.containerWidth-e.left-e.right,0,Number.POSITIVE_INFINITY)}get height(){let e=this._getMargin();return mt(this.containerHeight-e.top-e.bottom,0,Number.POSITIVE_INFINITY)}setData(e,n){var r,o,i,a,s;let{components:l,config:c}=this;if(!e)return;this.datamodel.data=e,l.forEach(f=>{f.setData(e)}),(r=c.crosshair)===null||r===void 0||r.setData(e),(o=c.xAxis)===null||o===void 0||o.setData(e),(i=c.yAxis)===null||i===void 0||i.setData(e),!An(this.datamodel.data,e)&&((a=c.tooltip)===null||a===void 0||a.hide(),(s=c.crosshair)===null||s===void 0||s.hide()),n||this.render()}updateContainer(e,n){super.updateContainer(e),this._removeAllChildren(),this.setData(this.datamodel.data,!0),e.xAxis&&(this.config.xAxis.config.type=kt.X,this.element.appendChild(e.xAxis.element)),e.yAxis&&(this.config.yAxis.config.type=kt.Y,this.element.appendChild(e.yAxis.element));for(let a of this.components)this.element.appendChild(a.element);let r=e.tooltip;r&&(r.hasContainer()||r.setContainer(this._container),r.setComponents(this.components));let o=e.crosshair;o&&(o.setContainer(this.svg),o.tooltip=r,this.element.appendChild(o.element));let i=e.annotations;i&&this.element.appendChild(i.element),this.element.appendChild(this._clipPath.node()),this.element.appendChild(this._svgDefs.node()),this.element.appendChild(this._svgDefsExternal.node()),n||this.render()}updateComponents(e,n){let{config:r}=this;this.components.forEach((o,i)=>{e[i]&&o.setConfig(e[i])}),this._updateScales(...this.components,r.xAxis,r.yAxis,r.crosshair),n||this.render()}update(e,n,r){r&&(this.datamodel.data=r),e&&this.updateContainer(e,!0),n&&this.updateComponents(n,!0),this.render()}_preRender(){let{config:e}=this;super._preRender(),e.autoMargin&&this._setAutoMargin();let n=sl([...this.components,e.xAxis,e.yAxis,e.crosshair,e.annotations]),r=this._getMargin();for(let o of n)o.setSize(this.width,this.height,this.containerWidth,this.containerHeight),o.setContainerMargin(r),o.setColorFunction(e.color);this._updateScales(...this.components,e.xAxis,e.yAxis,e.crosshair)}_render(e){var n,r,o,i,a,s;let{config:l}=this;super._render();let c=this._getMargin();for(let d of this.components)d.g.attr("transform",`translate(${c.left},${c.top})`).style("clip-path",d.clippable?`url(#${this._clipPathId})`:null).style("-webkit-clip-path",d.clippable?`url(#${this._clipPathId})`:null),d.render(e);this._renderAxes(this._firstRender?0:e);let u=l.clipPathExtend;this._clipPath.select("rect").attr("x",-u).attr("y",-u).attr("width",this.width+2*u).attr("height",this.height+2*u),(n=l.tooltip)===null||n===void 0||n.update();let f=l.crosshair;if(f){let d=this.components.filter(_=>!_.stacked),h=this.components.filter(_=>_.stacked),p=d.map(_=>_.config.y),g=h.map(_=>_.config.y),m=(r=this.components.find(_=>_.config.baseline))===null||r===void 0?void 0:r.config,x=m?.baseline;f.accessors={x:(o=this.components[0])===null||o===void 0?void 0:o.config.x,y:Li(p),yStacked:Li(g),baseline:x};let y=[d.map(_=>_.config.colorKeys),h.map(_=>_.config.colorKeys)].flat(2);f.colorKeys=y,f.g.attr("transform",`translate(${c.left},${c.top})`).style("clip-path",`url(#${this._clipPathId})`).style("-webkit-clip-path",`url(#${this._clipPathId})`),f.render()}(i=l.annotations)===null||i===void 0||i.g.attr("transform",`translate(${c.left},${c.top})`),(a=l.annotations)===null||a===void 0||a.render(),this._firstRender=!1,(s=l.onRenderComplete)===null||s===void 0||s.call(l,this.svg.node(),c,this._getBleed(this.components),this.containerWidth,this.containerHeight,this.width,this.height)}_updateScales(...e){let n=sl(e||this.components);this._setScales(...n),this._updateScalesDomain(...n),this._updateScalesRange(...n)}_setScales(...e){let{config:n}=this;e&&(n.xScale&&e.forEach(r=>r.setScale(_e.X,n.xScale)),n.yScale&&e.forEach(r=>r.setScale(_e.Y,n.yScale)))}_updateScalesDomain(...e){let{config:n}=this;if(!e)return;let r=e.filter(o=>!o.config.excludeFromDomainCalculation);Object.values(_e).forEach(o=>{var i,a,s,l,c,u,f,d;let[h,p]=Hn(Ti(r.map(b=>b.getDataExtent(o,n.scaleByDomain)))),g=o===_e.Y?n.yDomain:n.xDomain,m=o===_e.Y?n.yDomainMinConstraint:n.xDomainMinConstraint,x=o===_e.Y?n.yDomainMaxConstraint:n.xDomainMaxConstraint,y=(a=(i=g?.[0])!==null&&i!==void 0?i:h)!==null&&a!==void 0?a:0,_=(l=(s=g?.[1])!==null&&s!==void 0?s:p)!==null&&l!==void 0?l:1,v=[mt(y,(c=m?.[0])!==null&&c!==void 0?c:Number.NEGATIVE_INFINITY,(u=m?.[1])!==null&&u!==void 0?u:Number.POSITIVE_INFINITY),mt(_,(f=x?.[0])!==null&&f!==void 0?f:Number.NEGATIVE_INFINITY,(d=x?.[1])!==null&&d!==void 0?d:Number.POSITIVE_INFINITY)];if(v[0]===v[1]){let b=r.some(w=>{var A;return((A=w.datamodel.data)===null||A===void 0?void 0:A.length)>0});(n.preventEmptyDomain||n.preventEmptyDomain===null&&(!b||o===_e.Y))&&(v[1]=v[0]+1)}e.forEach(b=>b.setScaleDomain(o,v))})}_updateScalesRange(...e){var n,r,o,i,a,s;let{config:l}=this;if(!e)return;let c=l.yDirection===je.South,u=[(n=l.padding.left)!==null&&n!==void 0?n:0,this.width-((r=l.padding.right)!==null&&r!==void 0?r:0)],f=[this.height-((o=l.padding.bottom)!==null&&o!==void 0?o:0),(i=l.padding.top)!==null&&i!==void 0?i:0];c&&f.reverse();for(let h of e)h.setSize(this.width,this.height,this.containerWidth,this.containerHeight),h.setScaleRange(_e.X,(a=l.xRange)!==null&&a!==void 0?a:u),h.setScaleRange(_e.Y,(s=l.yRange)!==null&&s!==void 0?s:f);let d=this._getBleed(e);for(let h of e)h.setScaleRange(_e.X,[u[0]+d.left,u[1]-d.right]),h.setScaleRange(_e.Y,c?[f[0]+d.top,f[1]-d.bottom]:[f[0]-d.bottom,f[1]+d.top])}_renderAxes(e){let{config:{xAxis:n,yAxis:r}}=this,o=this._getMargin();sl([n,r]).forEach(a=>{let s=a.getOffset(o);a.g.attr("transform",`translate(${s.left},${s.top})`),a.render(e)})}_setAutoMargin(){let{config:{xAxis:e,yAxis:n}}=this,r=sl([...this.components,e,n]);this._setScales(...r),this._updateScalesDomain(...r);let o=this._firstRender?2:1;for(let i=0;i<o;i+=1){let a={top:0,bottom:0,left:0,right:0};this._updateScalesRange(...r),sl([e,n]).forEach(l=>{l.preRender();let c=l.getRequiredMargin();a.top<c.top&&(a.top=c.top),a.bottom<c.bottom&&(a.bottom=c.bottom),a.left<c.left&&(a.left=c.left),a.right<c.right&&(a.right=c.right)}),this._axisMargin=a}}_getMargin(){let{config:{margin:e}}=this;return{top:e.top+this._axisMargin.top,bottom:e.bottom+this._axisMargin.bottom,left:e.left+this._axisMargin.left,right:e.right+this._axisMargin.right}}_getBleed(e){return e.map(n=>n.bleed).reduce((n,r)=>{for(let o of Object.keys(n)){let i=o;n[i]<r[i]&&(n[i]=r[i])}return n},{top:0,bottom:0,left:0,right:0})}destroy(){let{components:e,config:{tooltip:n,crosshair:r,annotations:o,xAxis:i,yAxis:a}}=this;super.destroy();for(let s of e)s?.destroy();n?.destroy(),r?.destroy(),o?.destroy(),i?.destroy(),a?.destroy()}};Ml();Nl();var F6=Vr("start","end","cancel","interrupt"),G6=[],JL=0,KL=1,mm=2,pm=3,QL=4,gm=5,hf=6;function Fi(t,e,n,r,o,i){var a=t.__transition;if(!a)t.__transition={};else if(n in a)return;W6(t,n,{name:e,index:r,group:o,on:F6,tween:G6,time:i.time,delay:i.delay,duration:i.duration,ease:i.ease,timer:null,state:JL})}function pf(t,e){var n=Ye(t,e);if(n.state>JL)throw new Error("too late; already scheduled");return n}function un(t,e){var n=Ye(t,e);if(n.state>pm)throw new Error("too late; already running");return n}function Ye(t,e){var n=t.__transition;if(!n||!(n=n[e]))throw new Error("transition not found");return n}function W6(t,e,n){var r=t.__transition,o;r[e]=n,n.timer=Pl(i,0,n.time);function i(c){n.state=KL,n.timer.restart(a,n.delay,n.time),n.delay<=c&&a(c-n.delay)}function a(c){var u,f,d,h;if(n.state!==KL)return l();for(u in r)if(h=r[u],h.name===n.name){if(h.state===pm)return Il(a);h.state===QL?(h.state=hf,h.timer.stop(),h.on.call("interrupt",t,t.__data__,h.index,h.group),delete r[u]):+u<e&&(h.state=hf,h.timer.stop(),h.on.call("cancel",t,t.__data__,h.index,h.group),delete r[u])}if(Il(function(){n.state===pm&&(n.state=QL,n.timer.restart(s,n.delay,n.time),s(c))}),n.state=mm,n.on.call("start",t,t.__data__,n.index,n.group),n.state===mm){for(n.state=pm,o=new Array(d=n.tween.length),u=0,f=-1;u<d;++u)(h=n.tween[u].value.call(t,t.__data__,n.index,n.group))&&(o[++f]=h);o.length=f+1}}function s(c){for(var u=c<n.duration?n.ease.call(null,c/n.duration):(n.timer.restart(l),n.state=gm,1),f=-1,d=o.length;++f<d;)o[f].call(t,u);n.state===gm&&(n.on.call("end",t,t.__data__,n.index,n.group),l())}function l(){n.state=hf,n.timer.stop(),delete r[e];for(var c in r)return;delete t.__transition}}function Bn(t,e){var n=t.__transition,r,o,i=!0,a;if(n){e=e==null?null:e+"";for(a in n){if((r=n[a]).name!==e){i=!1;continue}o=r.state>mm&&r.state<gm,r.state=hf,r.timer.stop(),r.on.call(o?"interrupt":"cancel",t,t.__data__,r.index,r.group),delete n[a]}i&&delete t.__transition}}function tE(t){return this.each(function(){Bn(this,t)})}function V6(t,e){var n,r;return function(){var o=un(this,t),i=o.tween;if(i!==n){r=n=i;for(var a=0,s=r.length;a<s;++a)if(r[a].name===e){r=r.slice(),r.splice(a,1);break}}o.tween=r}}function H6(t,e,n){var r,o;if(typeof n!="function")throw new Error;return function(){var i=un(this,t),a=i.tween;if(a!==r){o=(r=a).slice();for(var s={name:e,value:n},l=0,c=o.length;l<c;++l)if(o[l].name===e){o[l]=s;break}l===c&&o.push(s)}i.tween=o}}function eE(t,e){var n=this._id;if(t+="",arguments.length<2){for(var r=Ye(this.node(),n).tween,o=0,i=r.length,a;o<i;++o)if((a=r[o]).name===t)return a.value;return null}return this.each((e==null?V6:H6)(n,t,e))}function $l(t,e,n){var r=t._id;return t.each(function(){var o=un(this,r);(o.value||(o.value={}))[e]=n.apply(this,arguments)}),function(o){return Ye(o,r).value[e]}}function xm(t,e){var n;return(typeof e=="number"?ye:e instanceof Ut?Fa:(n=Ut(e))?(e=n,Fa):Gu)(t,e)}function j6(t){return function(){this.removeAttribute(t)}}function Y6(t){return function(){this.removeAttributeNS(t.space,t.local)}}function U6(t,e,n){var r,o=n+"",i;return function(){var a=this.getAttribute(t);return a===o?null:a===r?i:i=e(r=a,n)}}function q6(t,e,n){var r,o=n+"",i;return function(){var a=this.getAttributeNS(t.space,t.local);return a===o?null:a===r?i:i=e(r=a,n)}}function X6(t,e,n){var r,o,i;return function(){var a,s=n(this),l;return s==null?void this.removeAttribute(t):(a=this.getAttribute(t),l=s+"",a===l?null:a===r&&l===o?i:(o=l,i=e(r=a,s)))}}function Z6(t,e,n){var r,o,i;return function(){var a,s=n(this),l;return s==null?void this.removeAttributeNS(t.space,t.local):(a=this.getAttributeNS(t.space,t.local),l=s+"",a===l?null:a===r&&l===o?i:(o=l,i=e(r=a,s)))}}function nE(t,e){var n=oi(t),r=n==="transform"?dy:xm;return this.attrTween(t,typeof e=="function"?(n.local?Z6:X6)(n,r,$l(this,"attr."+t,e)):e==null?(n.local?Y6:j6)(n):(n.local?q6:U6)(n,r,e))}function K6(t,e){return function(n){this.setAttribute(t,e.call(this,n))}}function Q6(t,e){return function(n){this.setAttributeNS(t.space,t.local,e.call(this,n))}}function J6(t,e){var n,r;function o(){var i=e.apply(this,arguments);return i!==r&&(n=(r=i)&&Q6(t,i)),n}return o._value=e,o}function t4(t,e){var n,r;function o(){var i=e.apply(this,arguments);return i!==r&&(n=(r=i)&&K6(t,i)),n}return o._value=e,o}function rE(t,e){var n="attr."+t;if(arguments.length<2)return(n=this.tween(n))&&n._value;if(e==null)return this.tween(n,null);if(typeof e!="function")throw new Error;var r=oi(t);return this.tween(n,(r.local?J6:t4)(r,e))}function e4(t,e){return function(){pf(this,t).delay=+e.apply(this,arguments)}}function n4(t,e){return e=+e,function(){pf(this,t).delay=e}}function oE(t){var e=this._id;return arguments.length?this.each((typeof t=="function"?e4:n4)(e,t)):Ye(this.node(),e).delay}function r4(t,e){return function(){un(this,t).duration=+e.apply(this,arguments)}}function o4(t,e){return e=+e,function(){un(this,t).duration=e}}function iE(t){var e=this._id;return arguments.length?this.each((typeof t=="function"?r4:o4)(e,t)):Ye(this.node(),e).duration}function i4(t,e){if(typeof e!="function")throw new Error;return function(){un(this,t).ease=e}}function aE(t){var e=this._id;return arguments.length?this.each(i4(e,t)):Ye(this.node(),e).ease}function a4(t,e){return function(){var n=e.apply(this,arguments);if(typeof n!="function")throw new Error;un(this,t).ease=n}}function sE(t){if(typeof t!="function")throw new Error;return this.each(a4(this._id,t))}function lE(t){typeof t!="function"&&(t=rf(t));for(var e=this._groups,n=e.length,r=new Array(n),o=0;o<n;++o)for(var i=e[o],a=i.length,s=r[o]=[],l,c=0;c<a;++c)(l=i[c])&&t.call(l,l.__data__,c,i)&&s.push(l);return new Tn(r,this._parents,this._name,this._id)}function cE(t){if(t._id!==this._id)throw new Error;for(var e=this._groups,n=t._groups,r=e.length,o=n.length,i=Math.min(r,o),a=new Array(r),s=0;s<i;++s)for(var l=e[s],c=n[s],u=l.length,f=a[s]=new Array(u),d,h=0;h<u;++h)(d=l[h]||c[h])&&(f[h]=d);for(;s<r;++s)a[s]=e[s];return new Tn(a,this._parents,this._name,this._id)}function s4(t){return(t+"").trim().split(/^|\s+/).every(function(e){var n=e.indexOf(".");return n>=0&&(e=e.slice(0,n)),!e||e==="start"})}function l4(t,e,n){var r,o,i=s4(e)?pf:un;return function(){var a=i(this,t),s=a.on;s!==r&&(o=(r=s).copy()).on(e,n),a.on=o}}function uE(t,e){var n=this._id;return arguments.length<2?Ye(this.node(),n).on.on(t):this.each(l4(n,t,e))}function c4(t){return function(){var e=this.parentNode;for(var n in this.__transition)if(+n!==t)return;e&&e.removeChild(this)}}function fE(){return this.on("end.remove",c4(this._id))}function dE(t){var e=this._name,n=this._id;typeof t!="function"&&(t=Qa(t));for(var r=this._groups,o=r.length,i=new Array(o),a=0;a<o;++a)for(var s=r[a],l=s.length,c=i[a]=new Array(l),u,f,d=0;d<l;++d)(u=s[d])&&(f=t.call(u,u.__data__,d,s))&&("__data__"in u&&(f.__data__=u.__data__),c[d]=f,Fi(c[d],e,n,d,c,Ye(u,n)));return new Tn(i,this._parents,e,n)}function hE(t){var e=this._name,n=this._id;typeof t!="function"&&(t=nf(t));for(var r=this._groups,o=r.length,i=[],a=[],s=0;s<o;++s)for(var l=r[s],c=l.length,u,f=0;f<c;++f)if(u=l[f]){for(var d=t.call(u,u.__data__,f,l),h,p=Ye(u,n),g=0,m=d.length;g<m;++g)(h=d[g])&&Fi(h,e,n,g,d,p);i.push(d),a.push(u)}return new Tn(i,a,e,n)}var u4=ii.prototype.constructor;function pE(){return new u4(this._groups,this._parents)}function f4(t,e){var n,r,o;return function(){var i=Bi(this,t),a=(this.style.removeProperty(t),Bi(this,t));return i===a?null:i===n&&a===r?o:o=e(n=i,r=a)}}function mE(t){return function(){this.style.removeProperty(t)}}function d4(t,e,n){var r,o=n+"",i;return function(){var a=Bi(this,t);return a===o?null:a===r?i:i=e(r=a,n)}}function h4(t,e,n){var r,o,i;return function(){var a=Bi(this,t),s=n(this),l=s+"";return s==null&&(l=s=(this.style.removeProperty(t),Bi(this,t))),a===l?null:a===r&&l===o?i:(o=l,i=e(r=a,s))}}function p4(t,e){var n,r,o,i="style."+e,a="end."+i,s;return function(){var l=un(this,t),c=l.on,u=l.value[i]==null?s||(s=mE(e)):void 0;(c!==n||o!==u)&&(r=(n=c).copy()).on(a,o=u),l.on=r}}function gE(t,e,n){var r=(t+="")=="transform"?fy:xm;return e==null?this.styleTween(t,f4(t,r)).on("end.style."+t,mE(t)):typeof e=="function"?this.styleTween(t,h4(t,r,$l(this,"style."+t,e))).each(p4(this._id,t)):this.styleTween(t,d4(t,r,e),n).on("end.style."+t,null)}function m4(t,e,n){return function(r){this.style.setProperty(t,e.call(this,r),n)}}function g4(t,e,n){var r,o;function i(){var a=e.apply(this,arguments);return a!==o&&(r=(o=a)&&m4(t,a,n)),r}return i._value=e,i}function xE(t,e,n){var r="style."+(t+="");if(arguments.length<2)return(r=this.tween(r))&&r._value;if(e==null)return this.tween(r,null);if(typeof e!="function")throw new Error;return this.tween(r,g4(t,e,n??""))}function x4(t){return function(){this.textContent=t}}function v4(t){return function(){var e=t(this);this.textContent=e??""}}function vE(t){return this.tween("text",typeof t=="function"?v4($l(this,"text",t)):x4(t==null?"":t+""))}function y4(t){return function(e){this.textContent=t.call(this,e)}}function _4(t){var e,n;function r(){var o=t.apply(this,arguments);return o!==n&&(e=(n=o)&&y4(o)),e}return r._value=t,r}function yE(t){var e="text";if(arguments.length<1)return(e=this.tween(e))&&e._value;if(t==null)return this.tween(e,null);if(typeof t!="function")throw new Error;return this.tween(e,_4(t))}function _E(){for(var t=this._name,e=this._id,n=vm(),r=this._groups,o=r.length,i=0;i<o;++i)for(var a=r[i],s=a.length,l,c=0;c<s;++c)if(l=a[c]){var u=Ye(l,e);Fi(l,t,n,c,a,{time:u.time+u.delay+u.duration,delay:0,duration:u.duration,ease:u.ease})}return new Tn(r,this._parents,t,n)}function bE(){var t,e,n=this,r=n._id,o=n.size();return new Promise(function(i,a){var s={value:a},l={value:function(){--o===0&&i()}};n.each(function(){var c=un(this,r),u=c.on;u!==t&&(e=(t=u).copy(),e._.cancel.push(s),e._.interrupt.push(s),e._.end.push(l)),c.on=e}),o===0&&i()})}var b4=0;function Tn(t,e,n,r){this._groups=t,this._parents=e,this._name=n,this._id=r}function wE(t){return ii().transition(t)}function vm(){return++b4}var ai=ii.prototype;Tn.prototype=wE.prototype={constructor:Tn,select:dE,selectAll:hE,selectChild:ai.selectChild,selectChildren:ai.selectChildren,filter:lE,merge:cE,selection:pE,transition:_E,call:ai.call,nodes:ai.nodes,node:ai.node,size:ai.size,empty:ai.empty,each:ai.each,on:uE,attr:nE,attrTween:rE,style:gE,styleTween:xE,text:vE,textTween:yE,remove:fE,tween:eE,delay:oE,duration:iE,ease:aE,easeVarying:sE,end:bE,[Symbol.iterator]:ai[Symbol.iterator]};var Dl=t=>+t;function Ol(t){return((t*=2)<=1?t*t*t:(t-=2)*t*t+2)/2}Nl();var w4={time:null,delay:0,duration:250,ease:Ol};function k4(t,e){for(var n;!(n=t.__transition)||!(n=n[e]);)if(!(t=t.parentNode))throw new Error(`transition ${e} not found`);return n}function kE(t){var e,n;t instanceof Tn?(e=t._id,t=t._name):(e=vm(),(n=w4).time=os(),t=t==null?null:t+"");for(var r=this._groups,o=r.length,i=0;i<o;++i)for(var a=r[i],s=a.length,l,c=0;c<s;++c)(l=a[c])&&Fi(l,t,e,c,a,n||k4(l,e));return new Tn(r,this._parents,t,e)}ii.prototype.interrupt=tE;ii.prototype.transition=kE;function G(t,e,n){if(t.nodes().forEach(r=>Bn(r)),e){let r=t.transition().duration(e);return n&&r.ease(n),r}else return t}var SE=Object.assign(Object.assign({},Ll),{tooltip:void 0,annotations:void 0});var zl=class extends es{constructor(e,n,r){var o;super(e),this._defaultConfig=SE,this.config=this._defaultConfig,n&&(this.updateContainer(n,!0),this.component=n.component),r&&this.setData(r,!0),!((o=this.component)===null||o===void 0)&&o.datamodel.data&&this.render()}setData(e,n){var r;let{config:o}=this;this.component&&this.component.setData(e),n||this.render(),(r=o.tooltip)===null||r===void 0||r.hide()}updateContainer(e,n){super.updateContainer(e),this._removeAllChildren(),this.component=e.component,e.sizing&&(this.component.sizing=e.sizing),this.element.appendChild(this.component.element);let r=e.tooltip;r&&(r.hasContainer()||r.setContainer(this._container),r.setComponents([this.component]));let o=e.annotations;o&&this.element.appendChild(o.element),this.element.appendChild(this._svgDefs.node()),this.element.appendChild(this._svgDefsExternal.node()),n||this.render()}updateComponent(e,n){this.component.setConfig(e),n||this.render()}update(e,n,r){e&&this.updateContainer(e,!0),n&&this.updateComponent(n,!0),r&&this.setData(r,!0),this.render()}getFitWidthScale(){let{config:e,component:n}=this,r=n;if(!r.getWidth)return 1;let o=r.getWidth()+e.margin.left+e.margin.right;return this.width/o}_preRender(){var e,n;let{config:r}=this;super._preRender(),this.component.setSize(this.width,this.height,this.containerWidth,this.containerHeight),this.component.setContainerMargin(r.margin),this.component.setColorFunction(r.color),(e=r.annotations)===null||e===void 0||e.setSize(this.width,this.height,this.containerWidth,this.containerHeight),(n=r.annotations)===null||n===void 0||n.setContainerMargin(r.margin)}_render(e){var n,r;let{config:o,component:i}=this;super._render(e),i.g.attr("transform",`translate(${o.margin.left},${o.margin.top})`),i.render(e),(n=o.annotations)===null||n===void 0||n.render(e),o.tooltip&&o.tooltip.update(),(r=o.onRenderComplete)===null||r===void 0||r.call(o,this.svg.node(),o.margin,this.containerWidth,this.containerHeight,this.width,this.height)}render(e=this.config.duration){let{config:n,component:r}=this;if(n.sizing===Jt.Extend||n.sizing===Jt.FitWidth){let o=n.sizing===Jt.FitWidth,i=r,a=i.getWidth()+n.margin.left+n.margin.right,s=i.getHeight()+n.margin.top+n.margin.bottom,l=o?this.getFitWidthScale():1,c=this.svg.attr("width"),u=this.svg.attr("height"),f=a*l,d=s*l,h=c||u;G(this.svg,h?e:0).attr("width",f).attr("height",d).attr("viewBox",`0 0 ${a} ${o?d:s}`).attr("preserveAspectRatio","xMinYMin")}else this.svg.attr("width",this.config.width||this.containerWidth).attr("height",this.config.height||this.containerHeight);this._resizeObserver||this._setUpResizeObserver(),cancelAnimationFrame(this._renderAnimationFrameId),this._renderAnimationFrameId=requestAnimationFrame(()=>{this._preRender(),this._render(e)})}_onResize(){var e;let{config:n}=this;super._onResize(),(e=n.tooltip)===null||e===void 0||e.hide()}destroy(){var e,n;let{component:r,config:o}=this;super.destroy(),r?.destroy(),(e=o.tooltip)===null||e===void 0||e.destroy(),(n=o.annotations)===null||n===void 0||n.destroy()}};function CE(t){return t}var ym=1,_m=2,n_=3,mf=4,AE=1e-6;function S4(t){return"translate("+t+",0)"}function C4(t){return"translate(0,"+t+")"}function A4(t){return e=>+t(e)}function T4(t,e){return e=Math.max(0,t.bandwidth()-e*2)/2,t.round()&&(e=Math.round(e)),n=>+t(n)+e}function L4(){return!this.__axis}function bm(t,e){var n=[],r=null,o=null,i=6,a=6,s=3,l=typeof window<"u"&&window.devicePixelRatio>1?0:.5,c=t===ym||t===mf?-1:1,u=t===mf||t===_m?"x":"y",f=t===ym||t===n_?S4:C4;function d(h){var p=r??(e.ticks?e.ticks.apply(e,n):e.domain()),g=o??(e.tickFormat?e.tickFormat.apply(e,n):CE),m=Math.max(i,0)+s,x=e.range(),y=+x[0]+l,_=+x[x.length-1]+l,v=(e.bandwidth?T4:A4)(e.copy(),l),b=h.selection?h.selection():h,w=b.selectAll(".domain").data([null]),A=b.selectAll(".tick").data(p,e).order(),L=A.exit(),E=A.enter().append("g").attr("class","tick"),I=A.select("line"),D=A.select("text");w=w.merge(w.enter().insert("path",".tick").attr("class","domain").attr("stroke","currentColor")),A=A.merge(E),I=I.merge(E.append("line").attr("stroke","currentColor").attr(u+"2",c*i)),D=D.merge(E.append("text").attr("fill","currentColor").attr(u,c*m).attr("dy",t===ym?"0em":t===n_?"0.71em":"0.32em")),h!==b&&(w=w.transition(h),A=A.transition(h),I=I.transition(h),D=D.transition(h),L=L.transition(h).attr("opacity",AE).attr("transform",function(F){return isFinite(F=v(F))?f(F+l):this.getAttribute("transform")}),E.attr("opacity",AE).attr("transform",function(F){var $=this.parentNode.__axis;return f(($&&isFinite($=$(F))?$:v(F))+l)})),L.remove(),w.attr("d",t===mf||t===_m?a?"M"+c*a+","+y+"H"+l+"V"+_+"H"+c*a:"M"+l+","+y+"V"+_:a?"M"+y+","+c*a+"V"+l+"H"+_+"V"+c*a:"M"+y+","+l+"H"+_),A.attr("opacity",1).attr("transform",function(F){return f(v(F)+l)}),I.attr(u+"2",c*i),D.attr(u,c*m).text(g),b.filter(L4).attr("fill","none").attr("font-size",10).attr("font-family","sans-serif").attr("text-anchor",t===_m?"start":t===mf?"end":"middle"),b.each(function(){this.__axis=v})}return d.scale=function(h){return arguments.length?(e=h,d):e},d.ticks=function(){return n=Array.from(arguments),d},d.tickArguments=function(h){return arguments.length?(n=h==null?[]:Array.from(h),d):n.slice()},d.tickValues=function(h){return arguments.length?(r=h==null?null:Array.from(h),d):r&&r.slice()},d.tickFormat=function(h){return arguments.length?(o=h,d):o},d.tickSize=function(h){return arguments.length?(i=a=+h,d):i},d.tickSizeInner=function(h){return arguments.length?(i=+h,d):i},d.tickSizeOuter=function(h){return arguments.length?(a=+h,d):a},d.tickPadding=function(h){return arguments.length?(s=+h,d):s},d.offset=function(h){return arguments.length?(l=+h,d):l},d}function r_(t){return bm(ym,t)}function o_(t){return bm(_m,t)}function i_(t){return bm(n_,t)}function a_(t){return bm(mf,t)}var Ae={duration:600,events:{},attributes:{}};var Te=class{constructor(e=Al.SVG){var n,r;this.type=Al.SVG,this.datamodel=new pr,this.sizing=Jt.Fit,this.events={},this._defaultConfig=Ae,this._width=400,this._height=200,this._containerWidth=void 0,this._containerHeight=void 0,this._containerMargin={top:0,bottom:0,left:0,right:0},this._colorFunction=void 0,this._setUpComponentEventsThrottled=zr(this._setUpComponentEvents,500),this._setCustomAttributesThrottled=zr(this._setCustomAttributes,500),e===Al.SVG?this.element=document.createElementNS("http://www.w3.org/2000/svg","g"):this.element=document.createElement("div"),this.uid=ll(),this.g=U(this.element);let o=(r=(n=this.constructor)===null||n===void 0?void 0:n.selectors)===null||r===void 0?void 0:r.root;o&&this.g.attr("class",o)}setContainerMargin(e){this._containerMargin=e}setColorFunction(e){this._colorFunction=e}setConfig(e){this.prevConfig=this.config,this.config=He(this._defaultConfig,e)}setData(e){this.datamodel.data=e}setSize(e,n,r,o){isFinite(e)&&(this._width=e),isFinite(n)&&(this._height=n),isFinite(r)&&(this._containerWidth=r),isFinite(o)&&(this._containerHeight=o)}render(e=this.config.duration){this._render(e);let n="animating";e&&(this.g.attr(n,""),this.g.transition(n).duration(e).on("end interrupt",()=>{this.g.attr(n,null)})),this._setUpComponentEventsThrottled(),this._setCustomAttributesThrottled()}get bleed(){return{top:0,bottom:0,left:0,right:0}}_render(e=this.config.duration){}_setCustomAttributes(){let e=this.config.attributes;Object.keys(e).forEach(n=>{Object.keys(e[n]).forEach(r=>{this.g.selectAll(`.${n}`).attr(r,e[n][r])})})}_setUpComponentEvents(){this._bindEvents(this.events),this._bindEvents(this.config.events,".user")}_mapEventDatum(e,n){return{datum:e,index:n}}_bindEvents(e=this.events,n=""){Object.keys(e).forEach(r=>{Object.keys(e[r]).forEach(o=>{let i=this.g.selectAll(`.${r}`);i.on(o+n,(a,s)=>{let l=i.nodes(),c=l.indexOf(a.currentTarget),u=e[r][o],{datum:f,index:d}=this._mapEventDatum(s,c);return u?.(f,a,d,l)})})})}destroy(){var e;(e=this.g)===null||e===void 0||e.remove(),this.element=void 0}isDestroyed(){return!this.element}};var Fn=class extends pr{constructor(e){super(e)}get data(){var e;return(e=this._data)!==null&&e!==void 0?e:[]}set data(e){Array.isArray(e)&&(this._data=e)}};var ie=Object.assign(Object.assign({},Ae),{x:void 0,y:void 0,id:(t,e)=>{var n;return(n=t.id)!==null&&n!==void 0?n:`${e}`},color:t=>t.color,xScale:void 0,yScale:void 0,excludeFromDomainCalculation:!1});var ae=class extends Te{constructor(){super(...arguments),this.datamodel=new Fn,this.clippable=!0,this.stacked=!1,this._defaultConfig=ie,this._xScale=lf.scaleLinear(),this._yScale=lf.scaleLinear()}get xScale(){return this.config.xScale||this._xScale}get yScale(){return this.config.yScale||this._yScale}setConfig(e){var n,r;!((n=this.config)===null||n===void 0)&&n.xScale&&(e.xScale=this.config.xScale),!((r=this.config)===null||r===void 0)&&r.yScale&&(e.yScale=this.config.yScale),super.setConfig(e)}setScaleDomain(e,n){var r,o;e===_e.X&&((r=this._xScale)===null||r===void 0||r.domain(n)),e===_e.Y&&((o=this._yScale)===null||o===void 0||o.domain(n))}setScaleRange(e,n){var r,o;e===_e.X&&((r=this._xScale)===null||r===void 0||r.range(n)),e===_e.Y&&((o=this._yScale)===null||o===void 0||o.range(n))}setScale(e,n){n&&e===_e.X&&(this._xScale=n),n&&e===_e.Y&&(this._yScale=n)}getDataExtent(e,n){let{config:r,datamodel:o}=this;switch(e){case _e.X:return this.getXDataExtent();case _e.Y:return this.getYDataExtent(n);default:return ur(o.data,r[e])}}getXDataExtent(){let{config:e,datamodel:n}=this;return ur(n.data,e.x)}getYDataExtent(e){let{config:n,datamodel:r}=this,o=this.xScale.domain(),i=e?Tp(r.data,o,n.x,!0):r.data,a=Ie(n.y)?n.y:[n.y];return ur(i,...a)}};var q;(function(t){t.Top="top",t.Bottom="bottom",t.Left="left",t.Right="right",t.Center="center",t.Auto="auto"})(q||(q={}));var TE;(function(t){t.Absolute="absolute",t.Fixed="fixed"})(TE||(TE={}));var Ln;(function(t){t.Inside="inside",t.Outside="outside",t.Center="center"})(Ln||(Ln={}));var bo;(function(t){t.Horizontal="horizontal",t.Vertical="vertical"})(bo||(bo={}));var Ue;(function(t){t.Start="start",t.Middle="middle",t.End="end"})(Ue||(Ue={}));var Le;(function(t){t.Top="top",t.Middle="middle",t.Bottom="bottom"})(Le||(Le={}));var De;(function(t){t.Wrap="wrap",t.Trim="trim"})(De||(De={}));var qe;(function(t){t.Left="left",t.Center="center",t.Right="right"})(qe||(qe={}));function LE(t){switch(t){case qe.Center:return"middle";case qe.Right:return"end";case qe.Left:default:return"start"}}function wm(t,e,n){if(t.size>=5e3&&!t.has(e)){let r=t.keys().next().value;r!==void 0&&t.delete(r)}t.set(e,n)}var s_,l_,c_,u_,f_,EE="",gf=new Map,d_=new WeakMap,h_=new Map,Bl=(l_=(s_=globalThis?.document)===null||s_===void 0?void 0:s_.createElement("canvas").getContext("2d"))!==null&&l_!==void 0?l_:null,ME=(t,e)=>`${e}${EE}${t}`;function E4(){gf.clear(),h_.clear()}(f_=(u_=(c_=globalThis?.document)===null||c_===void 0?void 0:c_.fonts)===null||u_===void 0?void 0:u_.ready)===null||f_===void 0||f_.then(E4);function Oe(t,e,n=zi()){return t.length*e*n||0}function RE(t,e){var n,r;if(Bl)return Bl.font!==e&&(Bl.font=e),Bl.measureText(t).width;let o=(n=/(\d*\.?\d+)(px|pt|pc|rem|em|ex|ch|cm|mm|in|vmin|vmax|vw|vh|%)/.exec(e))===null||n===void 0?void 0:n[0],i=(r=pn(o))!==null&&r!==void 0?r:Zp;return Oe(t,i,zi())}function M4(t){let e="",n=t;for(;n&&(e+=`${EE}${n.getAttribute("class")||""};${n.getAttribute("style")||""}`,n.localName!=="svg");)n=n.parentElement;return e}function PE(t){let e=d_.get(t);if(e)return e;let n=M4(t);if(e=h_.get(n),e)return d_.set(t,e),e;let r=window.getComputedStyle(t),o=r.fontSize||`${Zp}px`;return e={font:`${r.fontStyle||"normal"} ${r.fontWeight||"normal"} ${o} ${r.fontFamily||"sans-serif"}`,fontSizePx:pn(o)},wm(h_,n,e),d_.set(t,e),e}function xf(t){return PE(t).fontSizePx}function wo(t){let e=t.textContent||"",{font:n}=PE(t),r=ME(e,n),o=gf.get(r);if(o!==void 0)return o;let i=Bl?RE(e,n):t.getComputedTextLength();return wm(gf,r,i),i}function is(t,e,n){let r=typeof n=="number"?`${n}px`:n,o=`${r} ${e}`,i=ME(t,o),a=gf.get(i);if(a!==void 0)return a;let s;if(!Bl&&globalThis.document){let l="http://www.w3.org/2000/svg",c=document.createElementNS(l,"svg"),u=document.createElementNS(l,"text");u.textContent=t,u.setAttribute("font-size",r),u.setAttribute("font-family",e),c.appendChild(u),document.body.appendChild(c),s=u.getComputedTextLength(),document.body.removeChild(c)}else s=RE(t,o);return wm(gf,i,s),s}var km=t=>{switch(t){case qe.Left:return"start";case qe.Right:return"end";case qe.Center:return"middle";default:return null}};function NE(t){return t.replace(/-([a-z])/g,(e,n)=>n.toUpperCase())}function R4(t,e=15){return t?t.length>e?`\u2026${t.substr(t.length-e,e)}`:t:""}function p_(t,e=15){if(!t)return"";let n=Math.floor((e-3)/2);return t.length>e?`${t.substr(0,n)}\u2026${t.substr(-n,n)}`:t}function P4(t,e=15){return t?t.length>e?`${t.substr(0,e)}\u2026`:t:""}function si(t,e=15,n=Ue.Middle){if(!t)return"";let r=P4(t,e);return n===Ue.Start?r=R4(t,e):n===Ue.Middle&&(r=p_(t,e)),r}function $E(t,e=[" "]){let n=[t];for(let r=0;r<e.length;r++){let o=e[r];n.forEach((i,a)=>{let s=i.split(o),l=s.map((c,u)=>`${c}${u===s.length-1?"":o}`);n[a]=l}),n=Li(n)}return n}function En(t,e,n=[" ","-",".",","]){let r=t.text();if(!r)return;let o=Ie(n)?n:[n],i=$E(r,o),a=parseFloat(t.attr("x"))||0;t.text("");let s=t.append("tspan").attr("x",a),l=`${i[0]}`;s.text(l),i.forEach((c,u)=>{if(u===0)return;let f=`${l}${c}`;s.text(f),wo(s.node())>e?(s.text(l.trim()),s=t.append("tspan").attr("x",a).attr("dy","1.2em").text(c),l=c):l+=c})}function Kn(t,e,n,r,o,i){var a;e===void 0&&(e=50),n===void 0&&(n=Ue.Middle),r===void 0&&(r=!1),o===void 0&&(o=pn(((a=window.getComputedStyle(t.node()))===null||a===void 0?void 0:a.fontSize)||Ka.fontSize)),i===void 0&&(i=zi());let s=t.text()||"",l=s.length;if(!l)return!1;if(r){let h=Oe(s,o,i),g=Math.ceil(l*e/(1.1*h));return g<l?(t.text(si(s,g,n)),!0):!1}let c=t.node();if(wo(c)<=e)return!1;let u=0,f=l,d=0;for(;u<=f;){let h=u+f>>1;t.text(si(s,h,n)),wo(c)<=e?(d=h,u=h+1):f=h-1}return t.text(si(s,d,n)),!0}function m_(t,e,n=.32,r=!1,o){o=o||zi();let i=t.selectAll("tspan"),a=i.size()||1,s=t.text()?.85*e*a*(1+n)-n:0,l=0;if(i.empty()){let c=t.text();l=r?Oe(c,e,o):wo(t.node())}else for(let c of i.nodes()){let u=c.textContent,f=r?Oe(u,e,o):wo(c);f>l&&(l=f)}return{width:l,height:s}}function I4(t,e=void 0,n=!0,r=zy,o=!1){var i,a,s;let l=`${t.text}`;if(!l)return[];let c=(i=t.fontSize)!==null&&i!==void 0?i:Ka.fontSize,u=(a=t.fontFamily)!==null&&a!==void 0?a:Ka.fontFamily,f=(s=t.fontWidthToHeightRatio)!==null&&s!==void 0?s:Ka.fontWidthToHeightRatio,d=Array.isArray(r)?r:[r];return l.split(`
|
|
65
|
+
`).map(p=>{let g=[];if(!e)return[p];let m=$E(p,d),x="";for(let y=0;y<m.length;y+=1){(n?Oe(x+m[y],c,f):is(x+m[y],u,c))<e||y===0?x+=m[y]:(g.push(x.trim()),x=m[y]);let v=2;if(o)for(;x.trim().length>v&&(n?Oe(x,c,f):is(x,u,c))>e;){let w=x.trim().length-v;for(;w>0;){let A=`${x.substring(0,w)}${By}`;if((n?Oe(A,c,f):is(A,u,c))<=e||w===1){g.push(A.trim()),x=x.substring(w);break}w--}}}return x&&g.push(x.trim()),g}).flat()}function N4(t,e=void 0,n=void 0,r=!0,o=zy,i=!1){let a=Array.isArray(t)?t.map(f=>He(Ka,f)):[He(Ka,t)],s=a.map(f=>I4(f,e,r,o,i)),l=a[0],c=-l.fontSize*(l.lineHeight-1),u=[];return a.forEach((f,d)=>{var h;let p=s[d],g=d>0?u[d-1]:void 0,m=g?g.marginBottom:0,x=f.marginTop,y=Math.max(m,x);c+=y;let _=f.fontSize*f.lineHeight,v=0;for(let b=0;b<p.length;b+=1){let w=p[b];c+=_;let A=`${w} \u2026`,L=r?Oe(A,f.fontSize,f.fontWidthToHeightRatio):is(A,f.fontFamily,f.fontSize);if(v=Math.max(L,v),n&&c+_>n&&b!==p.length-1){w.charAt(w.length-1)===By&&(w=w.substr(0,p[b].length-1)),L<e?p[b]=A:p[b]=`${p[b].substr(0,p[b].length-2)}\u2026`,p=p.slice(0,b+1);break}}u.push(Object.assign(Object.assign({},f),{_lines:p,_estimatedHeight:c-(g?._estimatedHeight||0),_maxWidth:Math.max(v,(h=g?._maxWidth)!==null&&h!==void 0?h:0)}))}),u}var IE="http://www.w3.org/2000/svg";function $4(t,e=0,n,r){return t.map((o,i)=>{let a=i>0?t[i-1]:void 0,s=a?a.marginBottom/a.fontSize:0,l=o.marginTop/o.fontSize,c=Math.max(s,l),u=document.createElementNS(IE,"tspan");return o.fontSize&&u.setAttribute("font-size",`${o.fontSize}`),o.fontFamily&&u.setAttribute("font-family",`${o.fontFamily}`),o.fontWeight&&u.setAttribute("font-weight",`${o.fontWeight}`),o.color&&u.setAttribute("fill",`${o.color}`),i===0&&n&&u.setAttribute("y",`${n}`),o._lines.forEach((f,d)=>{let h;i===0&&d===0?h=c:d===0?h=c+o.lineHeight:h=o.lineHeight;let p=document.createElementNS(IE,"tspan");p.setAttribute("x",`${e}`),p.setAttribute("dy",`${h}em`),p.setAttribute("dominant-baseline",r??"auto"),p.textContent=f.length?f:"\xA0",u.appendChild(p)}),u})}function D4(t){return Ko(t,e=>e._estimatedHeight)}var DE=["text","tspan","textPath","altGlyph","altGlyphDef","altGlyphItem","glyphRef","textRef","textArea"];function OE(t,e,n,r){var o,i;let a=N4(e,n.width,void 0,n.fastMode,n.separator,n.wordBreak),s=(o=n.x)!==null&&o!==void 0?o:+t.getAttribute("x"),l=(i=n.y)!==null&&i!==void 0?i:+t.getAttribute("y"),c=s??0,u=l??0;if(n.textAlign&&t.setAttribute("text-anchor",LE(n.textAlign)),n.verticalAlign&&n.verticalAlign!==Le.Top){let f=D4(a),d=n.verticalAlign===Le.Middle?-f/2:n.verticalAlign===Le.Bottom?-f:0;u+=d}n.textRotationAngle?t.setAttribute("transform",`rotate(${n.textRotationAngle===0||n.textRotationAngle?n.textRotationAngle:0} ${c} ${u})`):t.removeAttribute("transform"),t.textContent="";for(let f of $4(a,c,u,r))t.appendChild(f)}function O4(t,e={}){let{tolerance:n=0,priorities:r}=e,o=t.length,i=new Array(o).fill(!0);if(o<2)return i;let a=1/0,s=-1/0,l=1/0,c=-1/0;for(let m of t){let x=m.x+m.width/2,y=m.y+m.height/2;x<a&&(a=x),x>s&&(s=x),y<l&&(l=y),y>c&&(c=y)}let u=s-a>=c-l,f=m=>u?m.x:m.y,d=m=>u?m.x+m.width:m.y+m.height,h=m=>{var x;return(x=r?.[m])!==null&&x!==void 0?x:0},p=t.map((m,x)=>x).sort((m,x)=>f(t[m])-f(t[x])),g=[];for(let m of p){let x=f(t[m]);for(let v=g.length-1;v>=0;v-=1)d(t[g[v]])-3*n<x&&g.splice(v,1);let y=[],_=!1;for(let v of g)if(uo(t[m],t[v],n)){if(h(v)>=h(m)){_=!0;break}y.push(v)}if(_)i[m]=!1;else{for(let v of y)i[v]=!1,g.splice(g.indexOf(v),1);g.push(m)}}return i}function vf(t,e={}){let n=t.nodes();if(n.length<2){t.style("opacity",null);return}let r=n.map(i=>{let{x:a,y:s,width:l,height:c}=i.getBoundingClientRect();return{x:a,y:s,width:l,height:c}}),o=O4(r,e);n.forEach((i,a)=>U(i).style("opacity",o[a]?1:0))}var zE=Object.assign(Object.assign({},ie),{position:void 0,type:void 0,label:void 0,labelFontSize:null,labelTextFitMode:De.Wrap,labelTextTrimType:Ue.Middle,gridLine:!0,tickLine:!0,domainLine:!0,numTicks:void 0,minMaxTicksOnly:!1,minMaxTicksOnlyWhenWidthIsLess:250,minMaxTicksOnlyShowGridLines:!1,tickTextWidth:void 0,tickTextSeparator:void 0,tickTextForceWordBreak:!1,tickTextTrimType:Ue.Middle,tickTextFitMode:De.Wrap,tickTextFontSize:null,tickTextAlign:void 0,tickTextColor:null,tickTextAngle:void 0,labelMargin:8,labelColor:null,tickFormat:void 0,tickValues:void 0,fullSize:!0,tickPadding:8,tickSize:6,tickTextHideOverlapping:void 0});var w_={};Wt(w_,{axis:()=>x_,cssVarDefaults:()=>g_,grid:()=>v_,hideDomain:()=>Cm,hideTickLine:()=>Sm,label:()=>Am,root:()=>BE,tick:()=>y_,tickLabel:()=>__,tickLabelHideable:()=>b_,tickTextExiting:()=>Fl,variables:()=>fe});function ze(t,e){let n="--vis-",r=Object.entries(t);return Object.fromEntries(r.map(([o])=>[NE(o.replace(e??n,"")),o]))}function Be(t,e){Pt({":root":t,[`${Yt} .${e}`]:Object.keys(t).filter(n=>n.includes("--vis-dark")).map(n=>({[n.replace("--vis-dark","--vis")]:`var(${n})`}))})}function Qe(t){return`var(${t})`}var BE=M`
|
|
66
|
+
label: axis-component;
|
|
67
|
+
`,g_={"--vis-axis-font-family":void 0,"--vis-axis-tick-color":"#e8e9ef","--vis-axis-domain-color":void 0,"--vis-axis-domain-line-dasharray":void 0,"--vis-axis-grid-color":"#e8e9ef","--vis-axis-grid-line-width":"1px","--vis-axis-grid-line-dasharray":"none","--vis-axis-grid-opacity":"1","--vis-axis-grid-transition":"none","--vis-axis-label-font-size":"14px","--vis-axis-label-color":"#6c778c","--vis-axis-label-weight":"500","--vis-axis-tick-label-color":"#6c778c","--vis-axis-tick-label-font-size":"12px","--vis-axis-tick-label-weight":"500","--vis-axis-tick-label-cursor":"default","--vis-axis-tick-label-text-decoration":"none","--vis-axis-tick-line-width":"1px","--vis-axis-tick-label-hide-transition":"opacity 400ms ease-in-out","--vis-axis-domain-line-width":void 0,"--vis-dark-axis-tick-color":"#6c778c","--vis-dark-axis-domain-color":void 0,"--vis-dark-axis-tick-label-color":"#e8e9ef","--vis-dark-axis-grid-color":"#6c778c","--vis-dark-axis-label-color":"#fefefe"},fe=ze(g_);Be(g_,BE);var Sm=M`
|
|
68
|
+
label: hide-tick-line;
|
|
69
|
+
`,Cm=M`
|
|
70
|
+
label: hide-domain;
|
|
71
|
+
`,x_=M`
|
|
72
|
+
label: axis;
|
|
73
|
+
|
|
74
|
+
user-select: none;
|
|
75
|
+
|
|
76
|
+
.domain {
|
|
77
|
+
stroke: var(${fe.axisDomainColor}, var(${fe.axisTickColor}));
|
|
78
|
+
stroke-width: var(${fe.axisDomainLineWidth}, var(${fe.axisGridLineWidth}));
|
|
79
|
+
stroke-dasharray: var(${fe.axisDomainLineDasharray}, var(${fe.axisGridLineDasharray}));
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
&${`.${Sm}`} {
|
|
83
|
+
.tick > line {
|
|
84
|
+
opacity: 0;
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
&${`.${Cm}`} {
|
|
89
|
+
.domain {
|
|
90
|
+
opacity: 0;
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
`,v_=M`
|
|
94
|
+
label: grid;
|
|
95
|
+
|
|
96
|
+
.domain {
|
|
97
|
+
opacity: 0;
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
line {
|
|
101
|
+
stroke: var(${fe.axisGridColor});
|
|
102
|
+
stroke-width: var(${fe.axisGridLineWidth});
|
|
103
|
+
stroke-dasharray: var(${fe.axisGridLineDasharray});
|
|
104
|
+
opacity: var(${fe.axisGridOpacity});
|
|
105
|
+
transition: var(${fe.axisGridTransition});
|
|
106
|
+
}
|
|
107
|
+
`,y_=M`
|
|
108
|
+
label: tick;
|
|
109
|
+
|
|
110
|
+
stroke: none;
|
|
111
|
+
font-size: var(${fe.axisTickLabelFontSize});
|
|
112
|
+
font-weight: var(${fe.axisTickLabelWeight});
|
|
113
|
+
|
|
114
|
+
line {
|
|
115
|
+
stroke: var(${fe.axisTickColor});
|
|
116
|
+
stroke-width: var(${fe.axisTickLineWidth});
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
text {
|
|
120
|
+
fill: var(${fe.axisTickLabelColor});
|
|
121
|
+
cursor: var(${fe.axisTickLabelCursor});
|
|
122
|
+
font-family: var(${fe.axisFontFamily}, var(--vis-font-family));
|
|
123
|
+
text-decoration: var(${fe.axisTickLabelTextDecoration});
|
|
124
|
+
stroke: none;
|
|
125
|
+
}
|
|
126
|
+
`,Fl=M`
|
|
127
|
+
label: tick-text-exiting;
|
|
128
|
+
`,Am=M`
|
|
129
|
+
label: label;
|
|
130
|
+
fill: var(${fe.axisLabelColor});
|
|
131
|
+
font-size: var(${fe.axisLabelFontSize});
|
|
132
|
+
font-weight: var(${fe.axisLabelWeight});
|
|
133
|
+
font-family: var(${fe.axisFontFamily}, var(--vis-font-family));
|
|
134
|
+
text-anchor: middle;
|
|
135
|
+
`,__=M`
|
|
136
|
+
label: tick-label;
|
|
137
|
+
`,b_=M`
|
|
138
|
+
label: tick-label-hideable;
|
|
139
|
+
opacity: 0;
|
|
140
|
+
transition: var(${fe.axisTickLabelHideTransition});
|
|
141
|
+
`;var yf=class extends ae{constructor(e){super(),this._defaultConfig=zE,this.config=this._defaultConfig,this._defaultNumTicks=3,this.events={},e&&this.setConfig(e),this.g.attr("axis-type",this.config.type),this.axisGroup=this.g.append("g"),this.gridGroup=this.g.append("g").attr("class",v_)}preRender(){let{config:e}=this,n=this.g.append("g").attr("opacity",0);this._renderAxis(n,0),e.tickTextAlign&&this._alignTickLabels(n),this._axisRawBBox=n.node().getBBox(),this._renderAxisLabel(n),this._axisSizeBBox=this._getAxisSize(n),this._requiredMargin=this._getRequiredMargin(this._axisSizeBBox),n.remove()}getPosition(){let{config:{type:e,position:n}}=this;return n??(e===kt.X?q.Bottom:q.Left)}_getAxisSize(e){return e.node().getBBox()}_getRequiredMargin(e=this._axisSizeBBox){let{config:{type:n,position:r}}=this;switch(n){case kt.X:{let i=this._axisSizeBBox.x+this._axisSizeBBox.width,a=this._axisSizeBBox.x<0?Math.abs(this._axisSizeBBox.x):0,s=i-this._width>1?i-this._width:0;switch(r){case q.Top:return{top:e.height,left:a,right:s};case q.Bottom:default:return{bottom:e.height,left:a,right:s}}}case kt.Y:{let o=e.height>this._height?(e.height-this._height)/2:0,i=o,a=o;switch(r){case q.Right:return{right:e.width,top:i,bottom:a};case q.Left:default:return{left:e.width,top:i,bottom:a}}}}}getRequiredMargin(){return this._requiredMargin}getOffset(e){let{config:{type:n,position:r}}=this;switch(n){case kt.X:switch(r){case q.Top:return{top:e.top,left:e.left};case q.Bottom:default:return{top:e.top+this._height,left:e.left}}case kt.Y:switch(r){case q.Right:return{top:e.top,left:e.left+this._width};case q.Left:default:return{top:e.top,left:e.left}}}}_render(e=this.config.duration,n=this.axisGroup){let{config:r}=this;if(this._renderAxis(n,e),this._renderAxisLabel(n),r.gridLine){let o=this._buildGrid();this.gridGroup.selectAll("*").interrupt(),G(this.gridGroup,e).call(o).style("opacity",1)}else G(this.gridGroup,e).style("opacity",0);r.tickTextAlign&&this._alignTickLabels(),this._resolveTickLabelOverlap(n)}_getAxisGen(){let{config:e}=this;switch(e.type){case kt.X:switch(e.position){case q.Top:return r_(this.xScale);case q.Bottom:default:return i_(this.xScale)}case kt.Y:switch(e.position){case q.Right:return o_(this.yScale);case q.Left:default:return a_(this.yScale)}}}_buildAxis(){let{config:{tickPadding:e,tickSize:n}}=this,r=Array.isArray(n)?n[0]:n,o=Array.isArray(n)?n[1]:n,i=this._getNumTicks(),a=this._getAxisGen();return a.ticks(i).tickPadding(e).tickSizeInner(r).tickSizeOuter(o),a}_buildGrid(){let{config:e}=this,n=this._getAxisGen();n.tickSize(e.type===kt.X?-this._height:-this._width).tickSizeOuter(0).tickFormat(()=>"");let r=this._getNumTicks()*2,o=n.scale(),i=o.domain(),a=()=>{if(!e.minMaxTicksOnlyShowGridLines)return i;let l=o.ticks(r);if(l.length<2)return i;let c=+l[1]-+l[0],u=i[1];return+u-+l[l.length-1]>c/2?[...l,u]:l},s=e.tickValues?this._getConfiguredTickValues():this._shouldRenderMinMaxTicksOnly()?a():o.ticks(r);return n.tickValues(s),n}_renderAxis(e=this.axisGroup,n=this.config.duration){let{config:r}=this,o=this._buildAxis(),i=o.scale(),a=r.tickValues?this._getConfiguredTickValues():this._shouldRenderMinMaxTicksOnly()?i.domain():i.ticks(this._getNumTicks()),s=a.length;o.tickValues(a),e.selectAll("*").interrupt();let l=G(e,n).call(o);e.selectAll("text").attr("dy",null).attr("y",null),l.on("end",()=>{this._resolveTickLabelOverlap(e)}),e.selectAll("g.tick").classed(y_,!0).style("font-size",r.tickTextFontSize);let u=e.selectAll("g.tick > text").filter(p=>a.some(g=>An(p,g))).classed(__,!0).classed(b_,!!r.tickTextHideOverlapping).classed(Fl,!1).style("fill",r.tickTextColor);e.selectAll("g.tick > text").filter(p=>!a.some(g=>An(p,g))).classed(Fl,!0),u.nodes().forEach(p=>Bn(p));let f=o.tickSize(),d=this.getPosition(),h=r.tickTextWidth||(r.type===kt.X?this._containerWidth/(s+1):this._containerWidth/5);if(u.each((p,g,m)=>{var x,y;let _=(y=(x=r.tickFormat)===null||x===void 0?void 0:x.call(r,p,g,a))!==null&&y!==void 0?y:`${p}`,v=m[g];if(!this._tickTextStyleCached){let I=getComputedStyle(v);this._tickTextStyleCached={fontSize:Number.parseFloat(I.fontSize),fontFamily:I.fontFamily,fontWidthToHeightRatio:zi()}}let[b,w]=this._getTickTextOffset(d,f,this._tickTextStyleCached.fontSize),A={verticalAlign:r.type===kt.X?Le.Top:Le.Middle,width:h,textRotationAngle:r.tickTextAngle,separator:r.tickTextSeparator,wordBreak:r.tickTextForceWordBreak,x:b,y:w};if(r.tickTextFitMode===De.Trim){let I=U(v).text(_);Kn(I,h,r.tickTextTrimType),_=U(v).text()}let L=Object.assign({text:_},this._tickTextStyleCached),E=r.type===kt.X?"central":"hanging";OE(v,L,A,E)}),e.classed(x_,!0).classed(Sm,!r.tickLine).classed(Cm,!r.domainLine),r.fullSize){let p=this._getFullDomainPath(0);G(e.select(".domain"),n).attr("d",p)}}_resolveTickLabelOverlap(e=this.axisGroup){let{config:n}=this,r=e.selectAll(`g.tick > text:not(.${Fl})`);if(!n.tickTextHideOverlapping){r.style("opacity",null);return}cancelAnimationFrame(this._collideTickLabelsAnimFrameId),this._collideTickLabelsAnimFrameId=requestAnimationFrame(()=>{vf(r,{tolerance:-5})})}_getNumTicks(){let{config:{type:e,numTicks:n}}=this;if(n)return n;if(e===kt.X){let r=this.xScale.range(),o=r[1]-r[0];return Math.floor(o/175)}if(e===kt.Y){let r=this.yScale.range(),o=Math.abs(r[0]-r[1]);return Math.pow(o,.85)/25}return this._defaultNumTicks}_getConfiguredTickValues(){let{config:e}=this,n=e.type===kt.X?this.xScale:this.yScale,r=n?.domain();return e.tickValues?e.tickValues.filter(o=>o>=r[0]&&o<=r[1]):null}_shouldRenderMinMaxTicksOnly(){let{config:e}=this;return e.minMaxTicksOnly||e.type===kt.X&&this._width<e.minMaxTicksOnlyWhenWidthIsLess}_getFullDomainPath(e=0){let{config:{type:n}}=this;switch(n){case kt.X:return`M0.5, ${e} V0.5 H${this._width+.5} V${e}`;case kt.Y:return`M${-e}, ${this._height+.5} H0.5 V0.5 H${-e}`}}_renderAxisLabel(e=this.axisGroup){var n;let{type:r,label:o,labelMargin:i,labelFontSize:a,labelTextFitMode:s}=this.config;if(e.selectAll(`.${Am}`).remove(),!o)return;let l=this.getPosition(),{width:c,height:u}=(n=this._axisRawBBox)!==null&&n!==void 0?n:e.node().getBBox(),f=r===kt.Y?-90:0,d=e.append("text").attr("class",Am).attr("dy",`${this._getLabelDY()}em`).style("font-size",a).style("fill",this.config.labelColor);d.text(o);let h=!1;if(s===De.Wrap){let v=r===kt.Y?this._height:this._width;wo(d.node())>v&&(En(d,v),h=!0)}let p=c,g=u;if(s===De.Wrap){let v=d.node().getBBox();p=v.width,g=v.height}else{let v=r===kt.X?p:g;Kn(d,v,this.config.labelTextTrimType);let b=d.node().getBBox();p=b.width,g=b.height}let m=r===kt.X?this._width/2:r===kt.Y&&s===De.Wrap&&h?l===q.Left?-c-g/2-10:c:Math.pow(-1,+(l===q.Left))*c,x=r===kt.Y?this._height/2:r===kt.X&&s===De.Wrap?l===q.Top?-u-g/2:u:Math.pow(-1,+(l===q.Top))*u,y=r===kt.X?0:Math.pow(-1,+(l===q.Left))*i,_=r===kt.X?Math.pow(-1,+(l===q.Top))*i:0;d.attr("transform",`translate(${m+y},${x+_}) rotate(${f})`)}_getLabelDY(){let{type:e,position:n}=this.config;switch(e){case kt.X:switch(n){case q.Top:return 0;case q.Bottom:default:return .75}case kt.Y:switch(n){case q.Right:return .75;case q.Left:default:return-.25}}}_getTickTextOffset(e,n,r){var o;let{config:i}=this,a=((o=i.tickTextAngle)!==null&&o!==void 0?o:0)/180*Math.PI,s=n+i.tickPadding;if(i.type===kt.X){let l=e===q.Bottom?1:-1;return[l*s*Math.sin(a),l*(s+r/2)*Math.cos(a)]}else{let l=e===q.Right?1:-1;return[l*s*Math.cos(a),l*s*Math.sin(a)]}}_alignTickLabels(e=this.axisGroup){let{config:{type:n,tickTextAlign:r,tickTextAngle:o,position:i}}=this,a=e.selectAll(`g.tick > text:not(.${Fl})`),s=a.data();a.each((l,c,u)=>{let f=u[c],d=s[c],h=n===kt.X?[this.xScale(d),0]:[0,this.yScale(d)],p=ge(r)?r(d,c,s,h,this._width,this._height):r,g=km(p),m=n===kt.X?0:this._getYTickTextTranslate(p,i),x=o?`translate(${m},0) rotate(${o})`:`translate(${m},0)`;U(f).attr("transform",x).attr("text-anchor",g)})}_getYTickTextTranslate(e,n=q.Left){var r,o,i,a;let s=this.config.tickPadding+1,l=((a=(o=(r=this._axisRawBBox)===null||r===void 0?void 0:r.width)!==null&&o!==void 0?o:(i=this.axisGroup.node())===null||i===void 0?void 0:i.getBBox().width)!==null&&a!==void 0?a:0)-s;switch(e){case qe.Left:return n===q.Left?l*-1:0;case qe.Right:return n===q.Left?0:l;case qe.Center:return n===q.Left?l*-.5:l*.5;default:return 0}}};yf.selectors=w_;function Lt(t){return function(){return t}}var k_=Math.abs,fn=Math.atan2,Hr=Math.cos,FE=Math.max,Tm=Math.min,mn=Math.sin,de=Math.sqrt,Je=1e-12,jr=Math.PI,_f=jr/2,mr=2*jr;function GE(t){return t>1?0:t<-1?jr:Math.acos(t)}function S_(t){return t>=1?_f:t<=-1?-_f:Math.asin(t)}var C_=Math.PI,A_=2*C_,as=1e-6,z4=A_-as;function WE(t){this._+=t[0];for(let e=1,n=t.length;e<n;++e)this._+=arguments[e]+t[e]}function B4(t){let e=Math.floor(t);if(!(e>=0))throw new Error(`invalid digits: ${t}`);if(e>15)return WE;let n=10**e;return function(r){this._+=r[0];for(let o=1,i=r.length;o<i;++o)this._+=Math.round(arguments[o]*n)/n+r[o]}}var ss=class{constructor(e){this._x0=this._y0=this._x1=this._y1=null,this._="",this._append=e==null?WE:B4(e)}moveTo(e,n){this._append`M${this._x0=this._x1=+e},${this._y0=this._y1=+n}`}closePath(){this._x1!==null&&(this._x1=this._x0,this._y1=this._y0,this._append`Z`)}lineTo(e,n){this._append`L${this._x1=+e},${this._y1=+n}`}quadraticCurveTo(e,n,r,o){this._append`Q${+e},${+n},${this._x1=+r},${this._y1=+o}`}bezierCurveTo(e,n,r,o,i,a){this._append`C${+e},${+n},${+r},${+o},${this._x1=+i},${this._y1=+a}`}arcTo(e,n,r,o,i){if(e=+e,n=+n,r=+r,o=+o,i=+i,i<0)throw new Error(`negative radius: ${i}`);let a=this._x1,s=this._y1,l=r-e,c=o-n,u=a-e,f=s-n,d=u*u+f*f;if(this._x1===null)this._append`M${this._x1=e},${this._y1=n}`;else if(d>as)if(!(Math.abs(f*l-c*u)>as)||!i)this._append`L${this._x1=e},${this._y1=n}`;else{let h=r-a,p=o-s,g=l*l+c*c,m=h*h+p*p,x=Math.sqrt(g),y=Math.sqrt(d),_=i*Math.tan((C_-Math.acos((g+d-m)/(2*x*y)))/2),v=_/y,b=_/x;Math.abs(v-1)>as&&this._append`L${e+v*u},${n+v*f}`,this._append`A${i},${i},0,0,${+(f*h>u*p)},${this._x1=e+b*l},${this._y1=n+b*c}`}}arc(e,n,r,o,i,a){if(e=+e,n=+n,r=+r,a=!!a,r<0)throw new Error(`negative radius: ${r}`);let s=r*Math.cos(o),l=r*Math.sin(o),c=e+s,u=n+l,f=1^a,d=a?o-i:i-o;this._x1===null?this._append`M${c},${u}`:(Math.abs(this._x1-c)>as||Math.abs(this._y1-u)>as)&&this._append`L${c},${u}`,r&&(d<0&&(d=d%A_+A_),d>z4?this._append`A${r},${r},0,1,${f},${e-s},${n-l}A${r},${r},0,1,${f},${this._x1=c},${this._y1=u}`:d>as&&this._append`A${r},${r},0,${+(d>=C_)},${f},${this._x1=e+r*Math.cos(i)},${this._y1=n+r*Math.sin(i)}`)}rect(e,n,r,o){this._append`M${this._x0=this._x1=+e},${this._y0=this._y1=+n}h${r=+r}v${+o}h${-r}Z`}toString(){return this._}};function Lm(){return new ss}Lm.prototype=ss.prototype;function Gi(t){let e=3;return t.digits=function(n){if(!arguments.length)return e;if(n==null)e=null;else{let r=Math.floor(n);if(!(r>=0))throw new RangeError(`invalid digits: ${n}`);e=r}return t},()=>new ss(e)}function F4(t){return t.innerRadius}function G4(t){return t.outerRadius}function W4(t){return t.startAngle}function V4(t){return t.endAngle}function H4(t){return t&&t.padAngle}function j4(t,e,n,r,o,i,a,s){var l=n-t,c=r-e,u=a-o,f=s-i,d=f*l-u*c;if(!(d*d<Je))return d=(u*(e-i)-f*(t-o))/d,[t+d*l,e+d*c]}function Em(t,e,n,r,o,i,a){var s=t-n,l=e-r,c=(a?i:-i)/de(s*s+l*l),u=c*l,f=-c*s,d=t+u,h=e+f,p=n+u,g=r+f,m=(d+p)/2,x=(h+g)/2,y=p-d,_=g-h,v=y*y+_*_,b=o-i,w=d*g-p*h,A=(_<0?-1:1)*de(FE(0,b*b*v-w*w)),L=(w*_-y*A)/v,E=(-w*y-_*A)/v,I=(w*_+y*A)/v,D=(-w*y+_*A)/v,F=L-m,$=E-x,T=I-m,S=D-x;return F*F+$*$>T*T+S*S&&(L=I,E=D),{cx:L,cy:E,x01:-u,y01:-f,x11:L*(o/b-1),y11:E*(o/b-1)}}function Qn(){var t=F4,e=G4,n=Lt(0),r=null,o=W4,i=V4,a=H4,s=null,l=Gi(c);function c(){var u,f,d=+t.apply(this,arguments),h=+e.apply(this,arguments),p=o.apply(this,arguments)-_f,g=i.apply(this,arguments)-_f,m=k_(g-p),x=g>p;if(s||(s=u=l()),h<d&&(f=h,h=d,d=f),!(h>Je))s.moveTo(0,0);else if(m>mr-Je)s.moveTo(h*Hr(p),h*mn(p)),s.arc(0,0,h,p,g,!x),d>Je&&(s.moveTo(d*Hr(g),d*mn(g)),s.arc(0,0,d,g,p,x));else{var y=p,_=g,v=p,b=g,w=m,A=m,L=a.apply(this,arguments)/2,E=L>Je&&(r?+r.apply(this,arguments):de(d*d+h*h)),I=Tm(k_(h-d)/2,+n.apply(this,arguments)),D=I,F=I,$,T;if(E>Je){var S=S_(E/d*mn(L)),k=S_(E/h*mn(L));(w-=S*2)>Je?(S*=x?1:-1,v+=S,b-=S):(w=0,v=b=(p+g)/2),(A-=k*2)>Je?(k*=x?1:-1,y+=k,_-=k):(A=0,y=_=(p+g)/2)}var P=h*Hr(y),N=h*mn(y),R=d*Hr(b),O=d*mn(b);if(I>Je){var W=h*Hr(_),Y=h*mn(_),J=d*Hr(v),nt=d*mn(v),et;if(m<jr)if(et=j4(P,N,J,nt,W,Y,R,O)){var xt=P-et[0],Z=N-et[1],vt=W-et[0],X=Y-et[1],at=1/mn(GE((xt*vt+Z*X)/(de(xt*xt+Z*Z)*de(vt*vt+X*X)))/2),B=de(et[0]*et[0]+et[1]*et[1]);D=Tm(I,(d-B)/(at-1)),F=Tm(I,(h-B)/(at+1))}else D=F=0}A>Je?F>Je?($=Em(J,nt,P,N,h,F,x),T=Em(W,Y,R,O,h,F,x),s.moveTo($.cx+$.x01,$.cy+$.y01),F<I?s.arc($.cx,$.cy,F,fn($.y01,$.x01),fn(T.y01,T.x01),!x):(s.arc($.cx,$.cy,F,fn($.y01,$.x01),fn($.y11,$.x11),!x),s.arc(0,0,h,fn($.cy+$.y11,$.cx+$.x11),fn(T.cy+T.y11,T.cx+T.x11),!x),s.arc(T.cx,T.cy,F,fn(T.y11,T.x11),fn(T.y01,T.x01),!x))):(s.moveTo(P,N),s.arc(0,0,h,y,_,!x)):s.moveTo(P,N),!(d>Je)||!(w>Je)?s.lineTo(R,O):D>Je?($=Em(R,O,W,Y,d,-D,x),T=Em(P,N,J,nt,d,-D,x),s.lineTo($.cx+$.x01,$.cy+$.y01),D<I?s.arc($.cx,$.cy,D,fn($.y01,$.x01),fn(T.y01,T.x01),!x):(s.arc($.cx,$.cy,D,fn($.y01,$.x01),fn($.y11,$.x11),!x),s.arc(0,0,d,fn($.cy+$.y11,$.cx+$.x11),fn(T.cy+T.y11,T.cx+T.x11),x),s.arc(T.cx,T.cy,D,fn(T.y11,T.x11),fn(T.y01,T.x01),!x))):s.arc(0,0,d,b,v,x)}if(s.closePath(),u)return s=null,u+""||null}return c.centroid=function(){var u=(+t.apply(this,arguments)+ +e.apply(this,arguments))/2,f=(+o.apply(this,arguments)+ +i.apply(this,arguments))/2-jr/2;return[Hr(f)*u,mn(f)*u]},c.innerRadius=function(u){return arguments.length?(t=typeof u=="function"?u:Lt(+u),c):t},c.outerRadius=function(u){return arguments.length?(e=typeof u=="function"?u:Lt(+u),c):e},c.cornerRadius=function(u){return arguments.length?(n=typeof u=="function"?u:Lt(+u),c):n},c.padRadius=function(u){return arguments.length?(r=u==null?null:typeof u=="function"?u:Lt(+u),c):r},c.startAngle=function(u){return arguments.length?(o=typeof u=="function"?u:Lt(+u),c):o},c.endAngle=function(u){return arguments.length?(i=typeof u=="function"?u:Lt(+u),c):i},c.padAngle=function(u){return arguments.length?(a=typeof u=="function"?u:Lt(+u),c):a},c.context=function(u){return arguments.length?(s=u??null,c):s},c}var Zgt=Array.prototype.slice;function Gl(t){return typeof t=="object"&&"length"in t?t:Array.from(t)}function VE(t){this._context=t}VE.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;default:this._context.lineTo(t,e);break}}};function li(t){return new VE(t)}function Mm(t){return t[0]}function Rm(t){return t[1]}function ci(t,e){var n=Lt(!0),r=null,o=li,i=null,a=Gi(s);t=typeof t=="function"?t:t===void 0?Mm:Lt(t),e=typeof e=="function"?e:e===void 0?Rm:Lt(e);function s(l){var c,u=(l=Gl(l)).length,f,d=!1,h;for(r==null&&(i=o(h=a())),c=0;c<=u;++c)!(c<u&&n(f=l[c],c,l))===d&&((d=!d)?i.lineStart():i.lineEnd()),d&&i.point(+t(f,c,l),+e(f,c,l));if(h)return i=null,h+""||null}return s.x=function(l){return arguments.length?(t=typeof l=="function"?l:Lt(+l),s):t},s.y=function(l){return arguments.length?(e=typeof l=="function"?l:Lt(+l),s):e},s.defined=function(l){return arguments.length?(n=typeof l=="function"?l:Lt(!!l),s):n},s.curve=function(l){return arguments.length?(o=l,r!=null&&(i=o(r)),s):o},s.context=function(l){return arguments.length?(l==null?r=i=null:i=o(r=l),s):r},s}function bf(t,e,n){var r=null,o=Lt(!0),i=null,a=li,s=null,l=Gi(c);t=typeof t=="function"?t:t===void 0?Mm:Lt(+t),e=typeof e=="function"?e:e===void 0?Lt(0):Lt(+e),n=typeof n=="function"?n:n===void 0?Rm:Lt(+n);function c(f){var d,h,p,g=(f=Gl(f)).length,m,x=!1,y,_=new Array(g),v=new Array(g);for(i==null&&(s=a(y=l())),d=0;d<=g;++d){if(!(d<g&&o(m=f[d],d,f))===x)if(x=!x)h=d,s.areaStart(),s.lineStart();else{for(s.lineEnd(),s.lineStart(),p=d-1;p>=h;--p)s.point(_[p],v[p]);s.lineEnd(),s.areaEnd()}x&&(_[d]=+t(m,d,f),v[d]=+e(m,d,f),s.point(r?+r(m,d,f):_[d],n?+n(m,d,f):v[d]))}if(y)return s=null,y+""||null}function u(){return ci().defined(o).curve(a).context(i)}return c.x=function(f){return arguments.length?(t=typeof f=="function"?f:Lt(+f),r=null,c):t},c.x0=function(f){return arguments.length?(t=typeof f=="function"?f:Lt(+f),c):t},c.x1=function(f){return arguments.length?(r=f==null?null:typeof f=="function"?f:Lt(+f),c):r},c.y=function(f){return arguments.length?(e=typeof f=="function"?f:Lt(+f),n=null,c):e},c.y0=function(f){return arguments.length?(e=typeof f=="function"?f:Lt(+f),c):e},c.y1=function(f){return arguments.length?(n=f==null?null:typeof f=="function"?f:Lt(+f),c):n},c.lineX0=c.lineY0=function(){return u().x(t).y(e)},c.lineY1=function(){return u().x(t).y(n)},c.lineX1=function(){return u().x(r).y(e)},c.defined=function(f){return arguments.length?(o=typeof f=="function"?f:Lt(!!f),c):o},c.curve=function(f){return arguments.length?(a=f,i!=null&&(s=a(i)),c):a},c.context=function(f){return arguments.length?(f==null?i=s=null:s=a(i=f),c):i},c}function HE(t,e){return e<t?-1:e>t?1:e>=t?0:NaN}function jE(t){return t}function ui(){var t=jE,e=HE,n=null,r=Lt(0),o=Lt(mr),i=Lt(0);function a(s){var l,c=(s=Gl(s)).length,u,f,d=0,h=new Array(c),p=new Array(c),g=+r.apply(this,arguments),m=Math.min(mr,Math.max(-mr,o.apply(this,arguments)-g)),x,y=Math.min(Math.abs(m)/c,i.apply(this,arguments)),_=y*(m<0?-1:1),v;for(l=0;l<c;++l)(v=p[h[l]=l]=+t(s[l],l,s))>0&&(d+=v);for(e!=null?h.sort(function(b,w){return e(p[b],p[w])}):n!=null&&h.sort(function(b,w){return n(s[b],s[w])}),l=0,f=d?(m-c*_)/d:0;l<c;++l,g=x)u=h[l],v=p[u],x=g+(v>0?v*f:0)+_,p[u]={data:s[u],index:l,value:v,startAngle:g,endAngle:x,padAngle:y};return p}return a.value=function(s){return arguments.length?(t=typeof s=="function"?s:Lt(+s),a):t},a.sortValues=function(s){return arguments.length?(e=s,n=null,a):e},a.sort=function(s){return arguments.length?(n=s,e=null,a):n},a.startAngle=function(s){return arguments.length?(r=typeof s=="function"?s:Lt(+s),a):r},a.endAngle=function(s){return arguments.length?(o=typeof s=="function"?s:Lt(+s),a):o},a.padAngle=function(s){return arguments.length?(i=typeof s=="function"?s:Lt(+s),a):i},a}var T_=Wl(li);function YE(t){this._curve=t}YE.prototype={areaStart:function(){this._curve.areaStart()},areaEnd:function(){this._curve.areaEnd()},lineStart:function(){this._curve.lineStart()},lineEnd:function(){this._curve.lineEnd()},point:function(t,e){this._curve.point(e*Math.sin(t),e*-Math.cos(t))}};function Wl(t){function e(n){return new YE(t(n))}return e._curve=t,e}function wf(t){var e=t.curve;return t.angle=t.x,delete t.x,t.radius=t.y,delete t.y,t.curve=function(n){return arguments.length?e(Wl(n)):e()._curve},t}function Pm(){var t=bf().curve(T_),e=t.curve,n=t.lineX0,r=t.lineX1,o=t.lineY0,i=t.lineY1;return t.angle=t.x,delete t.x,t.startAngle=t.x0,delete t.x0,t.endAngle=t.x1,delete t.x1,t.radius=t.y,delete t.y,t.innerRadius=t.y0,delete t.y0,t.outerRadius=t.y1,delete t.y1,t.lineStartAngle=function(){return wf(n())},delete t.lineX0,t.lineEndAngle=function(){return wf(r())},delete t.lineX1,t.lineInnerRadius=function(){return wf(o())},delete t.lineY0,t.lineOuterRadius=function(){return wf(i())},delete t.lineY1,t.curve=function(a){return arguments.length?e(Wl(a)):e()._curve},t}var kf={draw(t,e){let n=de(e/jr);t.moveTo(n,0),t.arc(0,0,n,0,mr)}};var L_={draw(t,e){let n=de(e/5)/2;t.moveTo(-3*n,-n),t.lineTo(-n,-n),t.lineTo(-n,-3*n),t.lineTo(n,-3*n),t.lineTo(n,-n),t.lineTo(3*n,-n),t.lineTo(3*n,n),t.lineTo(n,n),t.lineTo(n,3*n),t.lineTo(-n,3*n),t.lineTo(-n,n),t.lineTo(-3*n,n),t.closePath()}};var UE=de(1/3),Y4=UE*2,E_={draw(t,e){let n=de(e/Y4),r=n*UE;t.moveTo(0,-n),t.lineTo(r,0),t.lineTo(0,n),t.lineTo(-r,0),t.closePath()}};var M_={draw(t,e){let n=de(e),r=-n/2;t.rect(r,r,n,n)}};var U4=.8908130915292852,qE=mn(jr/10)/mn(7*jr/10),q4=mn(mr/10)*qE,X4=-Hr(mr/10)*qE,R_={draw(t,e){let n=de(e*U4),r=q4*n,o=X4*n;t.moveTo(0,-n),t.lineTo(r,o);for(let i=1;i<5;++i){let a=mr*i/5,s=Hr(a),l=mn(a);t.lineTo(l*n,-s*n),t.lineTo(s*r-l*o,l*r+s*o)}t.closePath()}};var P_=de(3),I_={draw(t,e){let n=-de(e/(P_*3));t.moveTo(0,n*2),t.lineTo(-P_*n,-n),t.lineTo(P_*n,-n),t.closePath()}};var gr=-.5,xr=de(3)/2,N_=1/de(12),Z4=(N_/2+1)*3,$_={draw(t,e){let n=de(e/Z4),r=n/2,o=n*N_,i=r,a=n*N_+n,s=-i,l=a;t.moveTo(r,o),t.lineTo(i,a),t.lineTo(s,l),t.lineTo(gr*r-xr*o,xr*r+gr*o),t.lineTo(gr*i-xr*a,xr*i+gr*a),t.lineTo(gr*s-xr*l,xr*s+gr*l),t.lineTo(gr*r+xr*o,gr*o-xr*r),t.lineTo(gr*i+xr*a,gr*a-xr*i),t.lineTo(gr*s+xr*l,gr*l-xr*s),t.closePath()}};function Vl(t,e){let n=null,r=Gi(o);t=typeof t=="function"?t:Lt(t||kf),e=typeof e=="function"?e:Lt(e===void 0?64:+e);function o(){let i;if(n||(n=i=r()),t.apply(this,arguments).draw(n,+e.apply(this,arguments)),i)return n=null,i+""||null}return o.type=function(i){return arguments.length?(t=typeof i=="function"?i:Lt(i),o):t},o.size=function(i){return arguments.length?(e=typeof i=="function"?i:Lt(+i),o):e},o.context=function(i){return arguments.length?(n=i??null,o):n},o}function vr(){}function Hl(t,e,n){t._context.bezierCurveTo((2*t._x0+t._x1)/3,(2*t._y0+t._y1)/3,(t._x0+2*t._x1)/3,(t._y0+2*t._y1)/3,(t._x0+4*t._x1+e)/6,(t._y0+4*t._y1+n)/6)}function Sf(t){this._context=t}Sf.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){switch(this._point){case 3:Hl(this,this._x1,this._y1);case 2:this._context.lineTo(this._x1,this._y1);break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;break;case 2:this._point=3,this._context.lineTo((5*this._x0+this._x1)/6,(5*this._y0+this._y1)/6);default:Hl(this,t,e);break}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e}};function D_(t){return new Sf(t)}function XE(t){this._context=t}XE.prototype={areaStart:vr,areaEnd:vr,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._y0=this._y1=this._y2=this._y3=this._y4=NaN,this._point=0},lineEnd:function(){switch(this._point){case 1:{this._context.moveTo(this._x2,this._y2),this._context.closePath();break}case 2:{this._context.moveTo((this._x2+2*this._x3)/3,(this._y2+2*this._y3)/3),this._context.lineTo((this._x3+2*this._x2)/3,(this._y3+2*this._y2)/3),this._context.closePath();break}case 3:{this.point(this._x2,this._y2),this.point(this._x3,this._y3),this.point(this._x4,this._y4);break}}},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._x2=t,this._y2=e;break;case 1:this._point=2,this._x3=t,this._y3=e;break;case 2:this._point=3,this._x4=t,this._y4=e,this._context.moveTo((this._x0+4*this._x1+t)/6,(this._y0+4*this._y1+e)/6);break;default:Hl(this,t,e);break}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e}};function O_(t){return new XE(t)}function ZE(t){this._context=t}ZE.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===3)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3;var n=(this._x0+4*this._x1+t)/6,r=(this._y0+4*this._y1+e)/6;this._line?this._context.lineTo(n,r):this._context.moveTo(n,r);break;case 3:this._point=4;default:Hl(this,t,e);break}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e}};function z_(t){return new ZE(t)}function KE(t,e){this._basis=new Sf(t),this._beta=e}KE.prototype={lineStart:function(){this._x=[],this._y=[],this._basis.lineStart()},lineEnd:function(){var t=this._x,e=this._y,n=t.length-1;if(n>0)for(var r=t[0],o=e[0],i=t[n]-r,a=e[n]-o,s=-1,l;++s<=n;)l=s/n,this._basis.point(this._beta*t[s]+(1-this._beta)*(r+l*i),this._beta*e[s]+(1-this._beta)*(o+l*a));this._x=this._y=null,this._basis.lineEnd()},point:function(t,e){this._x.push(+t),this._y.push(+e)}};var B_=(function t(e){function n(r){return e===1?new Sf(r):new KE(r,e)}return n.beta=function(r){return t(+r)},n})(.85);function jl(t,e,n){t._context.bezierCurveTo(t._x1+t._k*(t._x2-t._x0),t._y1+t._k*(t._y2-t._y0),t._x2+t._k*(t._x1-e),t._y2+t._k*(t._y1-n),t._x2,t._y2)}function Im(t,e){this._context=t,this._k=(1-e)/6}Im.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x2,this._y2);break;case 3:jl(this,this._x1,this._y1);break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2,this._x1=t,this._y1=e;break;case 2:this._point=3;default:jl(this,t,e);break}this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}};var Cf=(function t(e){function n(r){return new Im(r,e)}return n.tension=function(r){return t(+r)},n})(0);function Nm(t,e){this._context=t,this._k=(1-e)/6}Nm.prototype={areaStart:vr,areaEnd:vr,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._x5=this._y0=this._y1=this._y2=this._y3=this._y4=this._y5=NaN,this._point=0},lineEnd:function(){switch(this._point){case 1:{this._context.moveTo(this._x3,this._y3),this._context.closePath();break}case 2:{this._context.lineTo(this._x3,this._y3),this._context.closePath();break}case 3:{this.point(this._x3,this._y3),this.point(this._x4,this._y4),this.point(this._x5,this._y5);break}}},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._x3=t,this._y3=e;break;case 1:this._point=2,this._context.moveTo(this._x4=t,this._y4=e);break;case 2:this._point=3,this._x5=t,this._y5=e;break;default:jl(this,t,e);break}this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}};var Af=(function t(e){function n(r){return new Nm(r,e)}return n.tension=function(r){return t(+r)},n})(0);function $m(t,e){this._context=t,this._k=(1-e)/6}$m.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===3)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3,this._line?this._context.lineTo(this._x2,this._y2):this._context.moveTo(this._x2,this._y2);break;case 3:this._point=4;default:jl(this,t,e);break}this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}};var F_=(function t(e){function n(r){return new $m(r,e)}return n.tension=function(r){return t(+r)},n})(0);function Tf(t,e,n){var r=t._x1,o=t._y1,i=t._x2,a=t._y2;if(t._l01_a>Je){var s=2*t._l01_2a+3*t._l01_a*t._l12_a+t._l12_2a,l=3*t._l01_a*(t._l01_a+t._l12_a);r=(r*s-t._x0*t._l12_2a+t._x2*t._l01_2a)/l,o=(o*s-t._y0*t._l12_2a+t._y2*t._l01_2a)/l}if(t._l23_a>Je){var c=2*t._l23_2a+3*t._l23_a*t._l12_a+t._l12_2a,u=3*t._l23_a*(t._l23_a+t._l12_a);i=(i*c+t._x1*t._l23_2a-e*t._l12_2a)/u,a=(a*c+t._y1*t._l23_2a-n*t._l12_2a)/u}t._context.bezierCurveTo(r,o,i,a,t._x2,t._y2)}function QE(t,e){this._context=t,this._alpha=e}QE.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x2,this._y2);break;case 3:this.point(this._x2,this._y2);break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){if(t=+t,e=+e,this._point){var n=this._x2-t,r=this._y2-e;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(n*n+r*r,this._alpha))}switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;break;case 2:this._point=3;default:Tf(this,t,e);break}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}};var G_=(function t(e){function n(r){return e?new QE(r,e):new Im(r,0)}return n.alpha=function(r){return t(+r)},n})(.5);function JE(t,e){this._context=t,this._alpha=e}JE.prototype={areaStart:vr,areaEnd:vr,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._x5=this._y0=this._y1=this._y2=this._y3=this._y4=this._y5=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){switch(this._point){case 1:{this._context.moveTo(this._x3,this._y3),this._context.closePath();break}case 2:{this._context.lineTo(this._x3,this._y3),this._context.closePath();break}case 3:{this.point(this._x3,this._y3),this.point(this._x4,this._y4),this.point(this._x5,this._y5);break}}},point:function(t,e){if(t=+t,e=+e,this._point){var n=this._x2-t,r=this._y2-e;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(n*n+r*r,this._alpha))}switch(this._point){case 0:this._point=1,this._x3=t,this._y3=e;break;case 1:this._point=2,this._context.moveTo(this._x4=t,this._y4=e);break;case 2:this._point=3,this._x5=t,this._y5=e;break;default:Tf(this,t,e);break}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}};var W_=(function t(e){function n(r){return e?new JE(r,e):new Nm(r,0)}return n.alpha=function(r){return t(+r)},n})(.5);function tM(t,e){this._context=t,this._alpha=e}tM.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===3)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){if(t=+t,e=+e,this._point){var n=this._x2-t,r=this._y2-e;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(n*n+r*r,this._alpha))}switch(this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3,this._line?this._context.lineTo(this._x2,this._y2):this._context.moveTo(this._x2,this._y2);break;case 3:this._point=4;default:Tf(this,t,e);break}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}};var V_=(function t(e){function n(r){return e?new tM(r,e):new $m(r,0)}return n.alpha=function(r){return t(+r)},n})(.5);function eM(t){this._context=t}eM.prototype={areaStart:vr,areaEnd:vr,lineStart:function(){this._point=0},lineEnd:function(){this._point&&this._context.closePath()},point:function(t,e){t=+t,e=+e,this._point?this._context.lineTo(t,e):(this._point=1,this._context.moveTo(t,e))}};function H_(t){return new eM(t)}function nM(t){return t<0?-1:1}function rM(t,e,n){var r=t._x1-t._x0,o=e-t._x1,i=(t._y1-t._y0)/(r||o<0&&-0),a=(n-t._y1)/(o||r<0&&-0),s=(i*o+a*r)/(r+o);return(nM(i)+nM(a))*Math.min(Math.abs(i),Math.abs(a),.5*Math.abs(s))||0}function oM(t,e){var n=t._x1-t._x0;return n?(3*(t._y1-t._y0)/n-e)/2:e}function j_(t,e,n){var r=t._x0,o=t._y0,i=t._x1,a=t._y1,s=(i-r)/3;t._context.bezierCurveTo(r+s,o+s*e,i-s,a-s*n,i,a)}function Dm(t){this._context=t}Dm.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=this._t0=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x1,this._y1);break;case 3:j_(this,this._t0,oM(this,this._t0));break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){var n=NaN;if(t=+t,e=+e,!(t===this._x1&&e===this._y1)){switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;break;case 2:this._point=3,j_(this,oM(this,n=rM(this,t,e)),n);break;default:j_(this,this._t0,n=rM(this,t,e));break}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e,this._t0=n}}};function iM(t){this._context=new aM(t)}(iM.prototype=Object.create(Dm.prototype)).point=function(t,e){Dm.prototype.point.call(this,e,t)};function aM(t){this._context=t}aM.prototype={moveTo:function(t,e){this._context.moveTo(e,t)},closePath:function(){this._context.closePath()},lineTo:function(t,e){this._context.lineTo(e,t)},bezierCurveTo:function(t,e,n,r,o,i){this._context.bezierCurveTo(e,t,r,n,i,o)}};function Y_(t){return new Dm(t)}function U_(t){return new iM(t)}function lM(t){this._context=t}lM.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=[],this._y=[]},lineEnd:function(){var t=this._x,e=this._y,n=t.length;if(n)if(this._line?this._context.lineTo(t[0],e[0]):this._context.moveTo(t[0],e[0]),n===2)this._context.lineTo(t[1],e[1]);else for(var r=sM(t),o=sM(e),i=0,a=1;a<n;++i,++a)this._context.bezierCurveTo(r[0][i],o[0][i],r[1][i],o[1][i],t[a],e[a]);(this._line||this._line!==0&&n===1)&&this._context.closePath(),this._line=1-this._line,this._x=this._y=null},point:function(t,e){this._x.push(+t),this._y.push(+e)}};function sM(t){var e,n=t.length-1,r,o=new Array(n),i=new Array(n),a=new Array(n);for(o[0]=0,i[0]=2,a[0]=t[0]+2*t[1],e=1;e<n-1;++e)o[e]=1,i[e]=4,a[e]=4*t[e]+2*t[e+1];for(o[n-1]=2,i[n-1]=7,a[n-1]=8*t[n-1]+t[n],e=1;e<n;++e)r=o[e]/i[e-1],i[e]-=r,a[e]-=r*a[e-1];for(o[n-1]=a[n-1]/i[n-1],e=n-2;e>=0;--e)o[e]=(a[e]-o[e+1])/i[e];for(i[n-1]=(t[n]+o[n-1])/2,e=0;e<n-1;++e)i[e]=2*t[e+1]-o[e+1];return[o,i]}function q_(t){return new lM(t)}function Om(t,e){this._context=t,this._t=e}Om.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=this._y=NaN,this._point=0},lineEnd:function(){0<this._t&&this._t<1&&this._point===2&&this._context.lineTo(this._x,this._y),(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line>=0&&(this._t=1-this._t,this._line=1-this._line)},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;default:{if(this._t<=0)this._context.lineTo(this._x,e),this._context.lineTo(t,e);else{var n=this._x*(1-this._t)+t*this._t;this._context.lineTo(n,this._y),this._context.lineTo(n,e)}break}}this._x=t,this._y=e}};function X_(t){return new Om(t,.5)}function Z_(t){return new Om(t,0)}function K_(t){return new Om(t,1)}function cM(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(o){return Object.getOwnPropertyDescriptor(t,o).enumerable})),n.push.apply(n,r)}return n}function Q4(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?cM(Object(n),!0).forEach(function(r){J4(t,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):cM(Object(n)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(n,r))})}return t}function Lf(t){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Lf=function(e){return typeof e}:Lf=function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Lf(t)}function J4(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function zm(){return zm=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},zm.apply(this,arguments)}function tj(t,e){if(t){if(typeof t=="string")return uM(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);if(n==="Object"&&t.constructor&&(n=t.constructor.name),n==="Map"||n==="Set")return Array.from(t);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return uM(t,e)}}function uM(t,e){(e==null||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function hM(t,e){var n=typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=tj(t))||e&&t&&typeof t.length=="number"){n&&(t=n);var r=0,o=function(){};return{s:o,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(l){throw l},f:o}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
|
|
142
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var i=!0,a=!1,s;return{s:function(){n=n.call(t)},n:function(){var l=n.next();return i=l.done,l},e:function(l){a=!0,s=l},f:function(){try{!i&&n.return!=null&&n.return()}finally{if(a)throw s}}}}function ej(t,e){var n=[],r=[];function o(i,a){if(i.length===1)n.push(i[0]),r.push(i[0]);else{for(var s=Array(i.length-1),l=0;l<s.length;l++)l===0&&n.push(i[0]),l===s.length-1&&r.push(i[l+1]),s[l]=[(1-a)*i[l][0]+a*i[l+1][0],(1-a)*i[l][1]+a*i[l+1][1]];o(s,a)}}return t.length&&o(t,e),{left:n,right:r.reverse()}}function nj(t){var e={};return t.length===4&&(e.x2=t[2][0],e.y2=t[2][1]),t.length>=3&&(e.x1=t[1][0],e.y1=t[1][1]),e.x=t[t.length-1][0],e.y=t[t.length-1][1],t.length===4?e.type="C":t.length===3?e.type="Q":e.type="L",e}function rj(t,e){e=e||2;for(var n=[],r=t,o=1/e,i=0;i<e-1;i++){var a=o/(1-o*i),s=ej(r,a);n.push(s.left),r=s.right}return n.push(r),n}function oj(t,e,n){var r=[[t.x,t.y]];return e.x1!=null&&r.push([e.x1,e.y1]),e.x2!=null&&r.push([e.x2,e.y2]),r.push([e.x,e.y]),rj(r,n).map(nj)}var ij=/[MLCSTQAHVZmlcstqahv]|-?[\d.e+-]+/g,Yl={M:["x","y"],L:["x","y"],H:["x"],V:["y"],C:["x1","y1","x2","y2","x","y"],S:["x2","y2","x","y"],Q:["x1","y1","x","y"],T:["x","y"],A:["rx","ry","xAxisRotation","largeArcFlag","sweepFlag","x","y"],Z:[]};Object.keys(Yl).forEach(function(t){Yl[t.toLowerCase()]=Yl[t]});function Q_(t,e){for(var n=Array(t),r=0;r<t;r++)n[r]=e;return n}function aj(t){return"".concat(t.type).concat(Yl[t.type].map(function(e){return t[e]}).join(","))}function sj(t,e){var n={x1:"x",y1:"y",x2:"x",y2:"y"},r=["xAxisRotation","largeArcFlag","sweepFlag"];if(t.type!==e.type&&e.type.toUpperCase()!=="M"){var o={};Object.keys(e).forEach(function(i){var a=e[i],s=t[i];s===void 0&&(r.includes(i)?s=a:(s===void 0&&n[i]&&(s=t[n[i]]),s===void 0&&(s=0))),o[i]=s}),o.type=e.type,t=o}return t}function lj(t,e,n){var r=[];if(e.type==="L"||e.type==="Q"||e.type==="C")r=r.concat(oj(t,e,n));else{var o=zm({},t);o.type==="M"&&(o.type="L"),r=r.concat(Q_(n-1).map(function(){return o})),r.push(e)}return r}function fM(t,e,n){var r=t.length-1,o=e.length-1,i=r/o,a=Q_(o).reduce(function(l,c,u){var f=Math.floor(i*u);if(n&&f<t.length-1&&n(t[f],t[f+1])){var d=i*u%1<.5;l[f]&&(d?f>0?f-=1:f<t.length-1&&(f+=1):f<t.length-1?f+=1:f>0&&(f-=1))}return l[f]=(l[f]||0)+1,l},[]),s=a.reduce(function(l,c,u){if(u===t.length-1){var f=Q_(c,zm({},t[t.length-1]));return f[0].type==="M"&&f.forEach(function(d){d.type="L"}),l.concat(f)}return l.concat(lj(t[u],t[u+1],c))},[]);return s.unshift(t[0]),s}function dM(t){for(var e=(t||"").match(ij)||[],n=[],r,o,i=0;i<e.length;++i)if(r=Yl[e[i]],r){o={type:e[i]};for(var a=0;a<r.length;++a)o[r[a]]=+e[i+a+1];i+=r.length,n.push(o)}return n}function cj(t,e,n){var r=t==null?[]:t.slice(),o=e==null?[]:e.slice(),i=Lf(n)==="object"?n:{excludeSegment:n,snapEndsToInput:!0},a=i.excludeSegment,s=i.snapEndsToInput;if(!r.length&&!o.length)return function(){return[]};var l=(r.length===0||r[r.length-1].type==="Z")&&(o.length===0||o[o.length-1].type==="Z");r.length>0&&r[r.length-1].type==="Z"&&r.pop(),o.length>0&&o[o.length-1].type==="Z"&&o.pop(),r.length?o.length||o.push(r[0]):r.push(o[0]);var c=Math.abs(o.length-r.length);c!==0&&(o.length>r.length?r=fM(r,o,a):o.length<r.length&&(o=fM(o,r,a))),r=r.map(function(f,d){return sj(f,o[d])});var u=r.map(function(f){return Q4({},f)});return l&&(u.push({type:"Z"}),r.push({type:"Z"})),function(d){if(d===1&&s)return e??[];if(d===0)return r;for(var h=0;h<u.length;++h){var p=r[h],g=o[h],m=u[h],x=hM(Yl[m.type]),y;try{for(x.s();!(y=x.n()).done;){var _=y.value;m[_]=(1-d)*p[_]+d*g[_],(_==="largeArcFlag"||_==="sweepFlag")&&(m[_]=Math.round(m[_]))}}catch(v){x.e(v)}finally{x.f()}}return u}}function ls(t,e,n){var r=dM(t),o=dM(e),i=Lf(n)==="object"?n:{excludeSegment:n,snapEndsToInput:!0},a=i.excludeSegment,s=i.snapEndsToInput;if(!r.length&&!o.length)return function(){return""};var l=cj(r,o,{excludeSegment:a,snapEndsToInput:s});return function(u){if(u===1&&s)return e??"";var f=l(u),d="",h=hM(f),p;try{for(h.s();!(p=h.n()).done;){var g=p.value;d+=aj(g)}}catch(m){h.e(m)}finally{h.f()}return d}}var se;(function(t){t.Basis="basis",t.BasisClosed="basisClosed",t.BasisOpen="basisOpen",t.Bundle="bundle",t.Cardinal="cardinal",t.CardinalClosed="cardinalClosed",t.CardinalOpen="cardinalOpen",t.CatmullRom="catmullRom",t.CatmullRomClosed="catmullRomClosed",t.CatmullRomOpen="catmullRomOpen",t.Linear="linear",t.LinearClosed="linearClosed",t.MonotoneX="monotoneX",t.MonotoneY="monotoneY",t.Natural="natural",t.Step="step",t.StepAfter="stepAfter",t.StepBefore="stepBefore"})(se||(se={}));var Wi={[se.Basis]:D_,[se.BasisClosed]:O_,[se.BasisOpen]:z_,[se.Bundle]:B_,[se.Cardinal]:Cf,[se.CardinalClosed]:Af,[se.CardinalOpen]:F_,[se.CatmullRom]:G_,[se.CatmullRomClosed]:W_,[se.CatmullRomOpen]:V_,[se.Linear]:li,[se.LinearClosed]:H_,[se.MonotoneX]:Y_,[se.MonotoneY]:U_,[se.Natural]:q_,[se.Step]:X_,[se.StepAfter]:K_,[se.StepBefore]:Z_};var pM=Object.assign(Object.assign({},ie),{curveType:se.MonotoneX,lineWidth:2,lineDashArray:void 0,fallbackValue:void 0,highlightOnHover:!1,cursor:null,interpolateMissingData:!1});var J_={};Wt(J_,{dim:()=>Gm,globalStyles:()=>uj,interpolatedPath:()=>Wm,line:()=>Ul,linePath:()=>Bm,lineSelectionHelper:()=>Fm,root:()=>fj});var uj=Pt`
|
|
143
|
+
:root {
|
|
144
|
+
--vis-line-cursor: default;
|
|
145
|
+
--vis-line-stroke-dasharray: none;
|
|
146
|
+
--vis-line-stroke-dashoffset: 0;
|
|
147
|
+
|
|
148
|
+
--vis-line-gapfill-stroke-dasharray: 2 3;
|
|
149
|
+
--vis-line-gapfill-stroke-opacity: 0.8;
|
|
150
|
+
--vis-line-gapfill-stroke-dashoffset: 0;
|
|
151
|
+
}
|
|
152
|
+
`,fj=M`
|
|
153
|
+
label: line-component;
|
|
154
|
+
`,Ul=M`
|
|
155
|
+
label: line;
|
|
156
|
+
transition: opacity 200ms;
|
|
157
|
+
cursor: var(--vis-line-cursor);
|
|
158
|
+
`,Bm=M`
|
|
159
|
+
label: linePath;
|
|
160
|
+
fill: none;
|
|
161
|
+
stroke-dasharray: var(--vis-line-stroke-dasharray);
|
|
162
|
+
stroke-dashoffset: var(--vis-line-stroke-dashoffset);
|
|
163
|
+
`,Fm=M`
|
|
164
|
+
label: lineSelectionHelper;
|
|
165
|
+
fill: none;
|
|
166
|
+
stroke: rgba(0, 0, 0, 0);
|
|
167
|
+
stroke-width: 8px;
|
|
168
|
+
`,Gm=M`
|
|
169
|
+
opacity: 0.2;
|
|
170
|
+
`,Wm=M`
|
|
171
|
+
label: interpolated-path;
|
|
172
|
+
fill: none;
|
|
173
|
+
stroke-dasharray: var(--vis-line-gapfill-stroke-dasharray);
|
|
174
|
+
stroke-dashoffset: var(--vis-line-gapfill-stroke-dashoffset);
|
|
175
|
+
stroke-opacity: var(--vis-line-gapfill-stroke-opacity);
|
|
176
|
+
`;var Ef=class t extends ae{constructor(e){super(),this._defaultConfig=pM,this.config=this._defaultConfig,this.curve=Wi[se.MonotoneX],this.events={[t.selectors.line]:{mouseover:this._highlight.bind(this),mouseleave:this._resetHighlight.bind(this)}},e&&this.setConfig(e)}get bleed(){let{config:{lineWidth:e}}=this,n=this.yScale.domain(),o=(this.yScale.range()[0]>this.yScale.range()[1]?je.North:je.South)===je.South,i=e>3,a=e>=10;return{top:!a&&(!o&&n[1]===0||o&&n[0]===0)?0:e/2,bottom:!a&&(!o&&n[0]===0||o&&n[1]===0)?0:e/2,left:i?e/2:0,right:i?e/2:0}}_render(e){super._render(e);let{config:n,datamodel:{data:r}}=this,o=tt(e)?e:n.duration,i={colorFn:this._colorFunction};this.curve=Wi[n.curveType],this.lineGen=ci().x(d=>d.x).y(d=>d.y).defined(d=>d.defined).curve(this.curve);let a=Ie(n.y)?n.y:[n.y],s=r.map((d,h)=>this.xScale(z(d,n.x,h))),l=a.map(d=>{let h=r.map((y,_)=>{let v=z(y,d,_),b=(tt(v)||v===null)&&isFinite(v)?v:n.fallbackValue,w=n.interpolateMissingData?(tt(v)||v===null)&&isFinite(v):isFinite(b);return{x:s[_],y:this.yScale(b??0),defined:w,value:b}}),p=h.reduce((y,_)=>_.defined||y,!1),g=!1,m=h.reduce((y,_,v)=>{!_.defined&&isFinite(n.fallbackValue)&&y.push(Object.assign(Object.assign({},_),{defined:!0})),!_.defined&&!g&&(g=!0);let b=v>0&&!h[v-1].defined||v<h.length-1&&!h[v+1].defined;return _.defined&&b&&(g||y.push(Object.assign(Object.assign({},_),{defined:!1})),y.push(_),g=!1),y},[]),x=p&&h.some(y=>y.value!==null);return{values:h,defined:p,gaps:m,visible:x}}),c=this.g.selectAll(`.${Ul}`).data(l),u=c.enter().append("g").attr("class",Ul);u.append("path").attr("class",Bm).attr(xe,(d,h)=>h).attr("stroke",(d,h)=>{var p;return K(r,n.color,h,(p=n.colorKeys)===null||p===void 0?void 0:p[h],i)}).attr("stroke-opacity",0).attr("stroke-width",n.lineWidth),u.append("path").attr("class",Fm).attr("d",this._emptyPath()),u.append("path").attr("class",Wm).attr("d",this._emptyPath()).style("opacity",0);let f=u.merge(c);f.style("cursor",(d,h)=>j(r,n.cursor,h)),f.each((d,h,p)=>{var g,m,x,y,_;let v=U(p[h]),b=v.select(`.${Bm}`),w=v.select(`.${Fm}`),A=v.select(`.${Wm}`),L=d.visible,E=K(r,n.color,h,(g=n.colorKeys)===null||g===void 0?void 0:g[h],i),I=Cl(Nt(r,n.pattern,h),E,b.node()),D=st(r,n.lineDashArray,h),F=(x=(m=D?.join(" "))!==null&&m!==void 0?m:I?.dashArray)!==null&&x!==void 0?x:null;b.style("marker",(y=I?.marker)!==null&&y!==void 0?y:null);let $=G(b,o).attr("stroke",E).attr("stroke-width",n.lineWidth).attr("stroke-opacity",L?1:0).style("stroke-dasharray",F),T=d.values.some(k=>!k.defined),S=this.lineGen(d.values);if(o&&!T){let k=b.attr("d")||this._emptyPath(),P=S||this._emptyPath();$.attrTween("d",()=>ls(k,P))}else d.visible&&$.attr("d",S);w.attr("d",S).attr("visibility",L?null:"hidden"),T&&n.interpolateMissingData?G(A,o).attr("d",this.lineGen(d.gaps)).attr("stroke",K(r,n.color,h,(_=n.colorKeys)===null||_===void 0?void 0:_[h],i)).attr("stroke-width",n.lineWidth-1).style("opacity",1):A.transition().duration(o).style("opacity",0)}),G(c.exit(),o).style("opacity",0).remove()}_emptyPath(){let e=this.xScale.range(),n=this.yScale.range();return`M${e[0]},${n[0]} L${e[1]},${n[0]}`}_highlight(e){let{config:n}=this;n.highlightOnHover&&this.g.selectAll(`.${Ul}`).classed(Gm,r=>r!==e)}_resetHighlight(){let{config:e}=this;e.highlightOnHover&&this.g.selectAll(`.${Ul}`).classed(Gm,!1)}};Ef.selectors=J_;var mM=Object.assign(Object.assign({},ie),{color:void 0,curveType:se.MonotoneX,baseline:()=>0,opacity:1,cursor:null,line:!1,lineColor:void 0,lineWidth:2,lineDashArray:void 0,minHeight1Px:!1,minHeight:void 0,stackMinHeight:!1});var tb={};Wt(tb,{area:()=>Mf,areaLinePath:()=>Vm,globalStyles:()=>dj,root:()=>gM});var gM=M`
|
|
177
|
+
label: area-component;
|
|
178
|
+
`,dj=Pt`
|
|
179
|
+
:root {
|
|
180
|
+
--vis-area-cursor: default;
|
|
181
|
+
--vis-area-fill-opacity: 1;
|
|
182
|
+
--vis-area-stroke-color: none;
|
|
183
|
+
--vis-area-stroke-width: 0px;
|
|
184
|
+
--vis-area-stroke-dasharray: none;
|
|
185
|
+
--vis-area-stroke-opacity: 1;
|
|
186
|
+
--vis-area-hover-fill-opacity: none;
|
|
187
|
+
--vis-area-hover-stroke-width: none;
|
|
188
|
+
|
|
189
|
+
/* Dark Theme */
|
|
190
|
+
--vis-dark-area-stroke-color: none;
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
${Yt} ${`.${gM}`} {
|
|
194
|
+
--vis-area-fill-opacity: 0.5;
|
|
195
|
+
--vis-area-stroke-color: var(--vis-dark-area-stroke-color);
|
|
196
|
+
}
|
|
197
|
+
|
|
198
|
+
`,Mf=M`
|
|
199
|
+
label: area;
|
|
200
|
+
cursor: var(--vis-area-cursor);
|
|
201
|
+
fill-opacity: var(--vis-area-fill-opacity);
|
|
202
|
+
stroke-width: var(--vis-area-stroke-width);
|
|
203
|
+
stroke-dasharray: var(--vis-area-stroke-dasharray);
|
|
204
|
+
stroke: var(--vis-area-stroke-color);
|
|
205
|
+
stroke-opacity: var(--vis-area-stroke-opacity);
|
|
206
|
+
|
|
207
|
+
&:hover {
|
|
208
|
+
fill-opacity: var(--vis-area-hover-fill-opacity);
|
|
209
|
+
stroke-width: var(--vis-area-hover-stroke-width);
|
|
210
|
+
}
|
|
211
|
+
`,Vm=M`
|
|
212
|
+
label: areaLinePath;
|
|
213
|
+
fill: none;
|
|
214
|
+
stroke-dasharray: var(--vis-line-stroke-dasharray);
|
|
215
|
+
stroke-dashoffset: var(--vis-line-stroke-dashoffset);
|
|
216
|
+
`;var Rf=class t extends ae{constructor(e){super(),this._defaultConfig=mM,this.config=this._defaultConfig,this.stacked=!0,this.events={[t.selectors.area]:{}},e&&this.setConfig(e),this.stacked=Array.isArray(this.config.y)}get bleed(){let{config:{line:e,lineWidth:n}}=this;if(!e)return{top:0,bottom:0,left:0,right:0};let r=this.yScale.domain(),i=(this.yScale.range()[0]>this.yScale.range()[1]?je.North:je.South)===je.South,a=n>3,s=n>=10;return{top:!s&&(!i&&r[1]===0||i&&r[0]===0)?0:n/2,bottom:!s&&(!i&&r[0]===0||i&&r[1]===0)?0:n/2,left:a?n/2:0,right:a?n/2:0}}_render(e){super._render(e);let{config:n,datamodel:{data:r}}=this,o=tt(e)?e:n.duration,i={colorFn:this._colorFunction},a=Wi[n.curveType];this._areaGen=bf().x(v=>v.x).y0(v=>v.y0).y1(v=>v.y1).curve(a);let s=Ie(n.y)?n.y:[n.y],l=r.map((v,b)=>this.xScale(z(v,n.x,b))),c=Ap(r,n.baseline,s,this._prevNegative);this._prevNegative=c.map(v=>!!v.isMostlyNegative);let u=this.yScale.range(),f=Math.min(u[0],u[1]),d=Math.max(u[0],u[1]),h=[],p=c.map(v=>v.map((b,w)=>{var A,L;let E=l[w],I=mt(this.yScale(b[0]),f,d),D=mt(this.yScale(b[1]),f,d),F=D>I,$=n.stackMinHeight&&h[w]||0,T=F?I+$:I-$,S=F?D+$:D-$,k=0;return(n.minHeight||n.minHeight1Px)&&Math.abs(S-T)<((A=n.minHeight)!==null&&A!==void 0?A:1)&&(k=((L=n.minHeight)!==null&&L!==void 0?L:1)-Math.abs(S-T),n.stackMinHeight&&(h[w]=$+k)),{x:E,y0:T,y1:F?S+k:S-k}})),g=p.length-1,m=[...p].reverse(),x=this.g.selectAll(`.${Mf}`).data(m),y=x.enter().append("path").attr("class",Mf).attr("d",v=>this._areaGen(v)||this._emptyPath()).attr(xe,(v,b)=>g-b).style("opacity",0).style("fill",(v,b)=>{var w;return K(r,n.color,g-b,(w=n.colorKeys)===null||w===void 0?void 0:w[g-b],i)}).style("mask",(v,b)=>Ft(Nt(r,n.pattern,g-b))),_=G(y.merge(x),o).style("opacity",(v,b)=>v.some(A=>A.y0-A.y1!==0)?z(r,n.opacity,g-b):0).style("fill",(v,b)=>{var w;return K(r,n.color,g-b,(w=n.colorKeys)===null||w===void 0?void 0:w[g-b],i)}).style("mask",(v,b)=>Ft(Nt(r,n.pattern,g-b))).style("cursor",(v,b)=>j(r,n.cursor,g-b));o?_.attrTween("d",(b,w,A)=>{let L=U(A[w]).attr("d"),E=this._areaGen(b)||this._emptyPath();return ls(L,E)}):_.attr("d",v=>this._areaGen(v)||this._emptyPath()),G(x.exit(),o).style("opacity",0).remove(),this._renderLines(o,n.line?p:[])}_renderLines(e,n){var r;let{config:o,datamodel:{data:i}}=this,a={colorFn:this._colorFunction},s=n.length-1,l=[...n].reverse(),c=(r=o.lineColor)!==null&&r!==void 0?r:o.color,u=this.g.selectAll(`.${Vm}`).data(l),f=this.g.selectAll(`.${Mf}`).nodes(),d=y=>{var _;return K(i,c,s-y,(_=o.colorKeys)===null||_===void 0?void 0:_[s-y],a)},h=(y,_)=>Cl(Nt(i,o.linePattern,s-y),d(y),_),p=y=>{var _,v,b,w;return(w=(v=(_=st(i,o.lineDashArray,y))===null||_===void 0?void 0:_.join(" "))!==null&&v!==void 0?v:(b=h(y))===null||b===void 0?void 0:b.dashArray)!==null&&w!==void 0?w:null},g=u.enter().insert("path",(y,_)=>f[_+1]).attr("class",Vm).attr(xe,(y,_)=>s-_).attr("stroke",(y,_)=>d(_)).attr("stroke-width",o.lineWidth).attr("stroke-opacity",0).style("marker",function(y,_){var v,b;return(b=(v=h(_,this))===null||v===void 0?void 0:v.marker)!==null&&b!==void 0?b:null}),m=G(g.merge(u),e).attr("stroke",(y,_)=>d(_)).attr("stroke-width",o.lineWidth).attr("stroke-opacity",1).attr("cursor",(y,_)=>j(i,o.cursor,s-_)).style("marker",(y,_,v)=>{var b,w;return(w=(b=h(_,v[_]))===null||b===void 0?void 0:b.marker)!==null&&w!==void 0?w:null}).style("stroke-dasharray",(y,_)=>p(_)),x=Wi[o.curveType];this._lineGen=ci().x(y=>y.x).y(y=>y.y1).curve(x),e?m.attrTween("d",(_,v,b)=>{let w=U(b[v]).attr("d")||this._emptyLinePath(),A=this._lineGen(_)||this._emptyLinePath();return ls(w,A)}):m.attr("d",y=>this._lineGen(y)||this._emptyLinePath()),G(u.exit(),e).style("opacity",0).remove()}getYDataExtent(e){let{config:n,datamodel:r}=this,o=Ie(n.y)?n.y:[n.y],i=this.xScale.domain(),a=e?Tp(r.data,i,n.x,!0):r.data;return Cp(a,n.baseline,...o)}_emptyPath(){let e=this.xScale.range(),n=this.yScale.domain(),r=this.yScale((n[0]+n[1])/2),o=r;return this._areaGen([{y0:r,y1:o,x:e[0]},{y0:r,y1:o,x:e[1]}])}_emptyLinePath(){let e=this.xScale.range(),n=this.yScale.range();return`M${e[0]},${n[0]} L${e[1]},${n[0]}`}};Rf.selectors=tb;function Vi({x:t,y:e,w:n,h:r,tl:o=!1,tr:i=!1,bl:a=!1,br:s=!1,r:l=0}){let c;c=`M${t+l},${e}h${n-2*l}`;let u=i?l:0,f=i?0:l;return c+=`a${u},${u} 0 0 1 ${u},${u}`,c+=`h${f}v${f}`,c+=`v${r-2*l}`,u=s?l:0,f=s?0:l,c+=`a${u},${u} 0 0 1 ${-u},${u}`,c+=`v${f}h${-f}`,c+=`h${2*l-n}`,u=a?l:0,f=a?0:l,c+=`a${u},${u} 0 0 1 ${-u},${-u}`,c+=`h${-f}v${-f}`,c+=`v${2*l-r}`,u=o?l:0,f=o?0:l,c+=`a${u},${u} 0 0 1 ${u},${-u}`,c+=`v${-f}h${f}`,c+="z",c}function fi(t,e=6,n=2*Math.PI,r=!1){let o=e===4?Math.sqrt(.5)*t:t/3.6*2,i=e===4?Math.PI/4:0,a=n-i,s=(a<0?n:a)/(2*Math.PI),l=Math.ceil(e*s),c=1/e*Math.PI*2,u=(Math.PI-c)/2,f=Yn(l+(a>=0?1:0)).map((h,p)=>{let g=p===l||l===1&&a<0,m=g&&s*e%1||1;a<0&&(m+=.5);let x=c*(p-1+m),y;if(g){let _=Math.PI-u-c*m;y=o*Math.sin(u)/Math.sin(_)}else y=o;return{x:Math.sin(x+i)*y,y:-Math.cos(x+i)*y}});if(e===4){let h=c*-.5,p=Math.PI*.5,g=o*Math.sin(u)/Math.sin(p);f.unshift({x:Math.sin(h+i)*g,y:-Math.cos(h+i)*g})}return ci().x(h=>h.x).y(h=>h.y).curve((r?Cf:Af).tension(.95))(f)}function xM(t,e,n){return`
|
|
217
|
+
M ${t} ${e}
|
|
218
|
+
m ${-n}, 0
|
|
219
|
+
a ${n},${n} 0 1,1 ${n*2},0
|
|
220
|
+
a ${n},${n} 0 1,1 ${-n*2},0`}function vM({x:t,y:e,w:n,h:r,r:o=0,score:i=1}){let a,c=i,u=bt([n*.5*(c/.125)+o,n*.5-o]);if(a=`M${t+n*.5},${e}h${u}`,c=i-1/8,c>0){a+=`a${o},${o} 0 0 1 ${o},${o}`;let f=mt(r*(c/.25)-o,0,r-2*o);a+=`v${f}`}if(c=i-3/8,c>0){a+=`a${o},${o} 0 0 1 ${-o},${o}`;let f=mt(o-n*(c/.25),2*o-n,0);a+=`h${f}`}if(c=i-5/8,c>0){a+=`a${o},${o} 0 0 1 ${-o},${-o}`;let f=mt(o-r*(c/.25),2*o-r,0);a+=`v${f}`}if(c=i-7/8,c>0){a+=`a${o},${o} 0 0 1 ${o},${-o}`;let f=rt([n*.5*(c/.125)-o,0]);a+=`h${f}`}return a}function yM(t,e){return t.toString().replace(/L(?<x>-?\d*\.?\d*),(?<y>-?\d+\.?\d*)/gm,(n,r,o)=>`A ${e} ${e} 0 0 0 ${r} ${o}`)}function _M(t,e=8,n=6,r=5){if(t.length<2)return"";let o=0;for(let I=0;I<t.length-1;I++){let[D,F]=t[I],[$,T]=t[I+1];o+=Math.sqrt(Math.pow($-D,2)+Math.pow(T-F,2))}if(o===0)return"";let i=e,a=n,s=e*2;if(o<s){let I=o/s;i*=I,a*=I}i=Math.min(i/2,o);let[l,c]=t[t.length-1],[u,f]=t[t.length-2],d=l-u,h=c-f,p=Math.sqrt(d*d+h*h),g=d/p,m=h/p,x=l-i*g,y=c-i*m,_=-m,v=g,b=x+a/2*_,w=y+a/2*v,A=x-a/2*_,L=y-a/2*v,E=[];if(t.length===2){let[I,D]=t[0],F=Math.min(r,p/3),$=I+g*F,T=D+m*F+v*F*.5,S=x-g*F,k=y-m*F+v*F*.5;E.push(`M${I},${D}`),E.push(`C${$},${T} ${S},${k} ${l},${c}`)}else{E.push(`M${t[0][0]},${t[0][1]}`);for(let I=0;I<t.length-2;I++){let[D,F]=t[I],[$,T]=t[I+1],[S,k]=t[I+2],P=$-D,N=T-F,R=S-$,O=k-T,W=Math.sqrt(P*P+N*N),Y=Math.sqrt(R*R+O*O),J=P/W,nt=N/W,et=R/Y,xt=O/Y,Z=Math.min(W,Y),vt=Math.min(r,Z/3),X=$-J*vt,at=T-nt*vt,B=$+et*vt,H=T+xt*vt;E.push(`L${X},${at}`),E.push(`C${$},${T} ${$},${T} ${B},${H}`)}E.push(`L${l},${c}`)}return E.push(`M${b},${w} L${l},${c} L${A},${L}`),E.join(" ")}var bM=Object.assign(Object.assign({},ie),{color:void 0,pattern:void 0,groupMaxWidth:void 0,groupWidth:void 0,dataStep:void 0,groupPadding:.05,barPadding:0,roundedCorners:2,barMinHeight:2,cursor:null,orientation:bo.Vertical});var nb={};Wt(nb,{bar:()=>Pf,barGroup:()=>Hm,barGroupExit:()=>eb,globalStyles:()=>hj,root:()=>wM});var wM=M`
|
|
221
|
+
label: grouped-bar-component;
|
|
222
|
+
`,hj=Pt`
|
|
223
|
+
:root {
|
|
224
|
+
--vis-grouped-bar-cursor: default;
|
|
225
|
+
--vis-grouped-bar-fill-color: var(--vis-color-main);
|
|
226
|
+
--vis-grouped-bar-stroke-color: none;
|
|
227
|
+
--vis-grouped-bar-stroke-width: 0px;
|
|
228
|
+
--vis-grouped-bar-hover-stroke-width: 1px;
|
|
229
|
+
--vis-grouped-bar-hover-stroke-color: none;
|
|
230
|
+
|
|
231
|
+
|
|
232
|
+
/* Dark Theme */
|
|
233
|
+
--vis-dark-grouped-bar-stroke-color: none;
|
|
234
|
+
}
|
|
235
|
+
|
|
236
|
+
${Yt} ${`.${wM}`} {
|
|
237
|
+
--vis-grouped-bar-stroke-color: var(--vis-dark-grouped-bar-stroke-color);
|
|
238
|
+
}
|
|
239
|
+
`,Pf=M`
|
|
240
|
+
label: bar;
|
|
241
|
+
fill: var(--vis-grouped-bar-fill-color);
|
|
242
|
+
stroke: var(--vis-grouped-bar-stroke-color);
|
|
243
|
+
stroke-width: var(--vis-grouped-bar-stroke-width);
|
|
244
|
+
cursor: var(--vis-grouped-bar-cursor);
|
|
245
|
+
|
|
246
|
+
&:hover {
|
|
247
|
+
stroke-width: var(--vis-grouped-bar-hover-stroke-width);
|
|
248
|
+
stroke: var(--vis-grouped-bar-hover-stroke-color);
|
|
249
|
+
}
|
|
250
|
+
`,Hm=M`
|
|
251
|
+
label: barGroup;
|
|
252
|
+
`,eb=M`
|
|
253
|
+
label: barGroupExit;
|
|
254
|
+
`;var If=class extends ae{constructor(e){super(),this._defaultConfig=bM,this.config=this._defaultConfig,this.getAccessors=()=>Ie(this.config.y)?this.config.y:[this.config.y],this.events={},this._barData=[],e&&this.setConfig(e)}get bleed(){if(this._barData=this._getVisibleData(),this._barData.length===0)return{top:0,bottom:0,left:0,right:0};let e=!this.isVertical()&&this.dataScale.range()[0]>this.dataScale.range()[1],n=this.dataScale.domain(),r=this._getGroupWidth()/2,o=this._barData.map((h,p)=>z(h,this.config.x,p)),i=bt(o),a=rt(o),s=this.dataScale(i),l=this.dataScale(a),c=this.dataScale.invert(s+(e?r:-r)),u=this.dataScale.invert(l+(e?-r:r)),f=c<=n[0]?this.dataScale(n[0])-this.dataScale(c):0,d=u>n[1]?this.dataScale(u)-this.dataScale(n[1]):0;return{top:this.isVertical()?0:e?-d:f,bottom:this.isVertical()?0:e?-f:d,left:this.isVertical()?f:0,right:this.isVertical()?d:0}}get dataScale(){return this.isVertical()?this.xScale:this.yScale}get valueScale(){return this.isVertical()?this.yScale:this.xScale}isVertical(){return this.config.orientation===bo.Vertical}_render(e){let{config:n}=this,r=tt(e)?e:n.duration,o={colorFn:this._colorFunction},i=this._getGroupWidth(),a=this.getAccessors(),s=[-i/2,i/2],l=Ni().domain(Yn(a.length)).range(s).paddingInner(n.barPadding).paddingOuter(n.barPadding),c=this.g.selectAll(`.${Hm}`).data(this._barData,(_,v)=>{var b;return`${(b=j(_,n.id,v))!==null&&b!==void 0?b:v}`}),u=(_,v)=>{let b=this.dataScale(z(_,n.x,v)),w=this.isVertical()?b:0,A=this.isVertical()?0:b;return`translate(${w},${A})`},d=c.enter().append("g").attr("class",Hm).attr("transform",u).style("opacity",1).merge(c);G(d,r).attr("transform",u).style("opacity",1);let h=c.exit().attr("class",eb);G(h,r).style("opacity",0).remove(),G(h.selectAll(`.${Pf}`),r).attr("transform",(_,v,b)=>this.isVertical()?`translate(0,${this.yScale(0)}) scale(1,0)`:`translate(${this.xScale(0)},0) scale(0,1)`);let p=l.bandwidth(),g=d.selectAll(`.${Pf}`).data(_=>a.map(()=>_)),m=this._getValueAxisDirection(),y=g.enter().append("path").attr("class",Pf).attr("d",(_,v)=>{let b=l(v),w=this.valueScale(0),A=p;return this._getBarPath(b,w,A,0,!1,m)}).attr(xe,(_,v)=>v).style("fill",(_,v)=>{var b;return K(_,n.color,v,(b=n.colorKeys)===null||b===void 0?void 0:b[v],o)}).style("mask",(_,v)=>Ft(Nt(_,n.pattern,v))).merge(g);y.style("mask",(_,v)=>Ft(Nt(_,n.pattern,v))),G(y,r).attr("d",(_,v)=>{let b=l(v),w=p,A=z(_,a[v]),L=A<0,E=L?this.valueScale(0):this.valueScale(A||0),I=Math.abs(this.valueScale(0)-this.valueScale(A))||0;if(I<n.barMinHeight){let D=m===je.North?-1:1;E=this.valueScale(0)+D*n.barMinHeight,I=n.barMinHeight}return this._getBarPath(b,E,w,I,L,m)}).style("fill",(_,v)=>{var b;return K(_,n.color,v,(b=n.colorKeys)===null||b===void 0?void 0:b[v],o)}).style("cursor",(_,v)=>j(_,n.cursor,v)),G(g.exit(),r).remove()}_getValueAxisDirection(){return this.valueScale.range()[0]>this.valueScale.range()[1]?je.North:je.South}_getVisibleData(){let{config:e,datamodel:{data:n}}=this,r=this._getGroupWidth(),o=n.length<2?0:r/2,i=this.dataScale,a=Math.abs(i.invert(o)-i.invert(0));return n?.filter((l,c)=>{let u=z(l,e.x,c),f=i.domain(),d=+f[0],h=+f[1];return u>=d-a&&u<=h+a})}_getBarPath(e,n,r,o,i,a){let{config:s}=this,l=s.roundedCorners?tt(s.roundedCorners)?+s.roundedCorners:r/2:0,c=mt(l,0,Math.min(o,r)/2),u=a===je.North,f=this.isVertical()&&i!==u,d=this.isVertical()&&i===u,h=!this.isVertical()&&i,p=!this.isVertical()&&!i;return Vi({x:this.isVertical()?e:n+(u?0:-o),y:this.isVertical()?n+(u?0:-o):e,w:this.isVertical()?r:o,h:this.isVertical()?o:r,tl:f||h,tr:f||p,bl:d||h,br:d||p,r:c})}_getGroupWidth(){let{config:e,datamodel:{data:n}}=this;if(Jo(n))return 0;if(e.groupWidth)return bt([e.groupWidth,e.groupMaxWidth]);let r=this.dataScale.bandwidth,o=this.dataScale.domain?this.dataScale.domain():[],a=1+(r?o.length:o[1]-o[0])/e.dataStep||!r&&n.filter((c,u)=>{let f=z(c,e.x,u);return f>=o[0]&&f<=o[1]}).length||n.length;!r&&a>=2&&(a+=1);let l=(a<2?1:1-e.groupPadding)*(this.isVertical()?this._width:this._height)/a;return bt([l,e.groupMaxWidth])}getValueScaleExtent(e){let{datamodel:n}=this,r=this.getAccessors(),o=e?this._getVisibleData():n.data,i=Ia(o,...r),a=Na(o,...r);return[i>0?0:i,a<0?0:a]}getDataScaleExtent(){let{config:e,datamodel:n}=this;return ur(n.data,e.x)}getYDataExtent(e){return this.isVertical()?this.getValueScaleExtent(e):this.getDataScaleExtent()}getXDataExtent(){return this.isVertical()?this.getDataScaleExtent():this.getValueScaleExtent(!1)}};If.selectors=nb;var kM=Object.assign(Object.assign({},ie),{color:void 0,pattern:void 0,barMaxWidth:void 0,barWidth:void 0,dataStep:void 0,barPadding:0,roundedCorners:2,cursor:null,barMinHeight1Px:!1,barMinHeightZeroValue:null,orientation:bo.Vertical});var ob={};Wt(ob,{bar:()=>Nf,barGroup:()=>jm,barGroupExit:()=>rb,globalStyles:()=>pj,root:()=>SM});var SM=M`
|
|
255
|
+
label: stacked-bar-component;
|
|
256
|
+
`,pj=Pt`
|
|
257
|
+
:root {
|
|
258
|
+
--vis-stacked-bar-cursor: default;
|
|
259
|
+
--vis-stacked-bar-fill-color: var(--vis-color-main);
|
|
260
|
+
--vis-stacked-bar-stroke-color: none;
|
|
261
|
+
--vis-stacked-bar-stroke-width: 0px;
|
|
262
|
+
--vis-stacked-bar-hover-stroke-width: none;
|
|
263
|
+
--vis-stacked-bar-hover-stroke-color: none;
|
|
264
|
+
|
|
265
|
+
/* Dark Theme */
|
|
266
|
+
--vis-dark-stacked-bar-stroke-color: none;
|
|
267
|
+
}
|
|
268
|
+
|
|
269
|
+
${Yt} ${`.${SM}`} {
|
|
270
|
+
--vis-stacked-bar-stroke-color: var(--vis-dark-stacked-bar-stroke-color);
|
|
271
|
+
}
|
|
272
|
+
`,Nf=M`
|
|
273
|
+
label: bar;
|
|
274
|
+
fill: var(--vis-stacked-bar-fill-color);
|
|
275
|
+
stroke: var(--vis-stacked-bar-stroke-color);
|
|
276
|
+
stroke-width: var(--vis-stacked-bar-stroke-width);
|
|
277
|
+
cursor: var(--vis-stacked-bar-cursor);
|
|
278
|
+
|
|
279
|
+
&:hover {
|
|
280
|
+
stroke-width: var(--vis-stacked-bar-hover-stroke-width);
|
|
281
|
+
stroke: var(--vis-stacked-bar-hover-stroke-color);
|
|
282
|
+
}
|
|
283
|
+
`,jm=M`
|
|
284
|
+
label: barGroup;
|
|
285
|
+
`,rb=M`
|
|
286
|
+
label: barGroupExit;
|
|
287
|
+
`;var $f=class extends ae{constructor(e){super(),this._defaultConfig=kM,this.config=this._defaultConfig,this.getAccessors=()=>Ie(this.config.y)?this.config.y:[this.config.y],this.stacked=!0,this.events={},this._barData=[],e&&this.setConfig(e)}get bleed(){if(this._barData=this._getVisibleData(),this._barData.length===0)return{top:0,bottom:0,left:0,right:0};let e=!this.isVertical()&&this.dataScale.range()[0]>this.dataScale.range()[1],n=this.dataScale.domain(),r=this._getBarWidth()/2,o=this._barData.map((h,p)=>z(h,this.config.x,p)),i=bt(o),a=rt(o),s=this.dataScale(i),l=this.dataScale(a),c=this.dataScale.invert(s+(e?r:-r)),u=this.dataScale.invert(l+(e?-r:r)),f=c<=n[0]?this.dataScale(n[0])-this.dataScale(c):0,d=u>n[1]?this.dataScale(u)-this.dataScale(n[1]):0;return{top:this.isVertical()?0:e?-d:f,bottom:this.isVertical()?0:e?-f:d,left:this.isVertical()?f:0,right:this.isVertical()?d:0}}get dataScale(){return this.isVertical()?this.xScale:this.yScale}get valueScale(){return this.isVertical()?this.yScale:this.xScale}isVertical(){return this.config.orientation===bo.Vertical}_render(e){let{config:n}=this,r=tt(e)?e:n.duration,o={colorFn:this._colorFunction},i=this.getAccessors(),a=Ap(this._barData,0,i,this._prevNegative);this._prevNegative=a.map(g=>!!g.isMostlyNegative);let s=this.g.selectAll(`.${jm}`).data(this._barData,(g,m)=>{var x;return`${(x=j(g,n.id,m))!==null&&x!==void 0?x:m}`}),l=(g,m)=>{let x=this.dataScale(z(g,n.x,m)),y=this.isVertical()?x:0,_=this.isVertical()?0:x;return`translate(${y},${_})`},u=s.enter().append("g").attr("class",jm).attr("transform",l).style("opacity",1).merge(s);G(u,r).attr("transform",l).style("opacity",1);let f=s.exit().attr("class",rb);G(f,r).style("opacity",0).remove().on("interrupt",function(){this.remove()}),G(f.selectAll(`.${Nf}`),r).attr("transform",this.isVertical()?`translate(0,${this._height/3})`:`translate(${this._width/6},0)`);let d=u.selectAll(`.${Nf}`).data((g,m)=>{let x=a.map((y,_)=>({datum:g,index:m,stacked:y[m],stackIndex:_})).filter(y=>y.stacked[0]!==y.stacked[1]);return x.forEach((y,_)=>{y.isEnding=_===x.length-1||_<=x.length-1&&x[_+1].stacked[0]!==y.stacked[1]}),x},g=>g.stackIndex),p=d.enter().append("path").attr("class",Nf).attr("d",g=>this._getBarPath(g,!0)).attr(xe,g=>g.stackIndex).style("fill",g=>{var m;return K(g.datum,n.color,g.stackIndex,(m=n.colorKeys)===null||m===void 0?void 0:m[g.stackIndex],o)}).style("mask",g=>Ft(Nt(g.datum,n.pattern,g.stackIndex))).merge(d);p.style("mask",g=>Ft(Nt(g.datum,n.pattern,g.stackIndex))),G(p,r).attr("d",g=>this._getBarPath(g)).style("fill",g=>{var m;return K(g.datum,n.color,g.stackIndex,(m=n.colorKeys)===null||m===void 0?void 0:m[g.stackIndex],o)}).style("cursor",g=>j(g.datum,n.cursor,g.stackIndex)),G(d.exit(),r).style("opacity",0).remove().on("interrupt",function(){this.remove()})}_getBarWidth(){let{config:e,datamodel:{data:n}}=this;if(Jo(n))return 0;if(e.barWidth)return bt([e.barWidth,e.barMaxWidth]);let r=this.dataScale.bandwidth,o=this.dataScale.domain?this.dataScale.domain():[],a=1+(r?o.length:o[1]-o[0])/e.dataStep||!r&&n.filter((c,u)=>{let f=z(c,e.x,u);return f>=o[0]&&f<=o[1]}).length||n.length;!r&&a>=2&&(a+=1);let l=(a<2?1:1-e.barPadding)*(this.isVertical()?this._width:this._height)/a;return bt([l,e.barMaxWidth])}_getVisibleData(){let{config:e,datamodel:{data:n}}=this,r=this._getBarWidth(),o=n.length<2?0:r/2,i=this.dataScale,a=Math.abs(i.invert(o)-i.invert(0));return n?.filter((l,c)=>{let u=z(l,e.x,c),f=i.domain(),d=+f[0],h=+f[1];return u>=d-a&&u<=h+a})}_getBarPath(e,n=!1){let{config:r}=this,o=this.getAccessors(),i=this._getBarWidth(),a=e.stacked[1]<0,s=e.isEnding,l=z(e.datum,o[e.stackIndex],e.index),c=n?0:Math.abs(this.valueScale(e.stacked[0])-this.valueScale(e.stacked[1])),u=!n&&r.barMinHeight1Px&&c<1&&isFinite(l)&&l!==r.barMinHeightZeroValue?1:c,f=n?this.valueScale(0):this.valueScale(a?e.stacked[0]:e.stacked[1])-(c<1&&r.barMinHeight1Px?1:0),d=-i/2,h=i,p=r.roundedCorners?tt(r.roundedCorners)?+r.roundedCorners:h/2:0,g=mt(p,0,Math.min(c,h)/2),m=this.yScale.range()[0]>this.yScale.range()[1];return Vi({x:this.isVertical()?d:f-u,y:this.isVertical()?f+(m?0:-u):d,w:this.isVertical()?h:u,h:this.isVertical()?u:h,tl:s&&(this.isVertical()?!a&&m||a&&!m:a),tr:s&&(this.isVertical()?!a&&m||a&&!m:!a),br:s&&(this.isVertical()?a&&m||!a&&!m:!a),bl:s&&(this.isVertical()?a&&m||!a&&!m:a),r:g})}_mapEventDatum(e){return{datum:Object.assign(Object.assign({},e),e.datum),index:e.index}}getValueScaleExtent(e){let{datamodel:n}=this,r=this.getAccessors(),o=e?this._getVisibleData():n.data;return Cp(o,...r)}getDataScaleExtent(){let{config:e,datamodel:n}=this;return ur(n.data,e.x)}getYDataExtent(e){return this.isVertical()?this.getValueScaleExtent(e):this.getDataScaleExtent()}getXDataExtent(){return this.isVertical()?this.getDataScaleExtent():this.getValueScaleExtent(!1)}};$f.selectors=ob;var Jn;(function(t){t.Circle="circle",t.Cross="cross",t.Diamond="diamond",t.Square="square",t.Star="star",t.Triangle="triangle",t.Wye="wye"})(Jn||(Jn={}));var Ym={[Jn.Circle]:kf,[Jn.Cross]:L_,[Jn.Diamond]:E_,[Jn.Square]:M_,[Jn.Star]:R_,[Jn.Triangle]:I_,[Jn.Wye]:$_};var CM=Object.assign(Object.assign({},ie),{color:t=>t.color,pattern:void 0,size:10,sizeScale:lf.scaleSqrt(),sizeRange:void 0,shape:Jn.Circle,label:void 0,labelColor:void 0,labelPosition:q.Bottom,labelHideOverlapping:!0,cursor:null,labelTextBrightnessRatio:.65,strokeColor:void 0,strokeWidth:void 0});function AM(t){return t!==q.Top&&t!==q.Bottom&&t!==q.Left&&t!==q.Right}function ib(t,e){return e?.7*t/Math.pow(e,.5):0}function ab(t,e,n=5){switch(t){case q.Top:return[0,-e/2-n];case q.Bottom:return[0,e/2+n];case q.Left:return[-e/2-n,0];case q.Right:return[e/2+n,0];default:return[0,0]}}function Um(t,e,n,r,o){var i;let a=n(t._point.xValue),s=r(t._point.yValue),l=t._point.sizePx,c=(i=t._point.label)!==null&&i!==void 0?i:"",u=c.length,f=ib(l,u),d=Oe(c,AM(e)?f:o,.6),h=o,p=ab(e,l),g=e===q.Left?-d:e===q.Right?0:-d/2,m=e===q.Top?-h:e===q.Bottom?0:-h/2;return{x:a+p[0]+g,y:s+p[1]+m,width:d,height:h}}function TM(t,e,n,r){t.each((o,i,a)=>{let s=a[i];s._labelVisible=!0}),t.each((o,i,a)=>{let s=a[i],l=st(o,e.labelPosition,o._point.pointIndex);if(!s._labelVisible||AM(l))return;let c=U(s).select("text"),u=xf(c.node()),f=Um(o,l,n,r,u);for(let d=0;d<a.length;d+=1){if(i===d)continue;let h=a[d],p=U(h),g=p.select("text"),m=p.datum(),x=[n(m._point.xValue),r(m._point.yValue)],y=m._point.sizePx/2,_={x:x[0]-y,y:x[1]-y,width:2*y,height:2*y},v=uo(f,_,2),b=h._labelVisible;if(!v&&b){let w=xf(g.node()),A=st(m,e.labelPosition,m._point.pointIndex),L=Um(m,A,n,r,w);v=uo(f,L,.25)}if(v)if(s._forceShowLabel)h._labelVisible=!1;else{s._labelVisible=!1;break}}}),t.each((o,i,a)=>{let s=a[i];U(s).select("text").attr("opacity",s._labelVisible?1:0)})}function LM(t,e,n){t.attr("transform",r=>`translate(${r._point.xValue},${r._point.yValue})`),t.append("path").attr(xe,r=>r._point.groupIndex).style("fill",r=>r._point.color).style("mask",r=>r._point.mask),t.append("text").style("pointer-events","none"),t.attr("transform",r=>`translate(${e(r._point.xValue)},${n(r._point.yValue)}) scale(0)`)}function EM(t,e,n,r,o){let i=Vl();t.each((a,s,l)=>{var c,u,f,d;let h=U(l[s]),p=h.select("text"),g=h.select("path"),m=a._point.sizePx,x=a._point.color,y=(c=a._point.strokeColor)!==null&&c!==void 0?c:null,_=(u=a._point.strokeWidthPx)!==null&&u!==void 0?u:null;g.attr("d",()=>a._point.shape?i.size(Math.PI*m*m/4).type(Ym[a._point.shape])():null),G(g,o).style("fill",x).style("mask",a._point.mask).style("stroke",y).style("stroke-width",`${_}px`);let v=a._point.labelPosition,b=v!==q.Top&&v!==q.Bottom&&v!==q.Left&&v!==q.Right,w=(f=a._point.label)!==null&&f!==void 0?f:"",A=w.length,L=ib(m,A),E=a._point.labelColor;if(!E&&b){let D=x||"var(--vis-scatter-fill-color)",F=(d=Ut(Ei(D)?On(D,h.node()):D))===null||d===void 0?void 0:d.hex();E=zn(F)>e.labelTextBrightnessRatio?"var(--vis-scatter-point-label-text-color-dark)":"var(--vis-scatter-point-label-text-color-light)"}let I=ab(v,m);p.html(w).attr("x",I[0]).attr("y",I[1]).style("font-size",b?L:null).style("text-anchor",()=>{switch(v){case q.Right:return null;case q.Left:return"end";default:return"middle"}}).style("dominant-baseline",()=>{switch(v){case q.Top:return null;case q.Bottom:return"hanging";default:return"central"}}),G(p,o).style("fill",E),g.style("cursor",a._point.cursor)}),G(t,o).attr("transform",a=>`translate(${n(a._point.xValue)},${r(a._point.yValue)}) scale(1)`)}function MM(t,e,n,r){G(t,r).attr("transform",o=>`translate(${e(o._point.xValue)},${n(o._point.yValue)}) scale(0)`).remove()}var lb={};Wt(lb,{globalStyles:()=>mj,point:()=>Xm,pointGroup:()=>qm,pointGroupExit:()=>sb,root:()=>gj});var mj=Pt`
|
|
288
|
+
:root {
|
|
289
|
+
--vis-scatter-cursor: default;
|
|
290
|
+
--vis-scatter-fill-color: var(--vis-color-main);
|
|
291
|
+
--vis-scatter-stroke-color: 'none';
|
|
292
|
+
--vis-scatter-stroke-width: 1px;
|
|
293
|
+
--vis-scatter-fill-opacity: 1;
|
|
294
|
+
--vis-scatter-stroke-opacity: 1;
|
|
295
|
+
--vis-scatter-hover-stroke-width: 2px;
|
|
296
|
+
|
|
297
|
+
--vis-scatter-point-label-text-color-dark: #5b5f6d;
|
|
298
|
+
--vis-scatter-point-label-text-color-light: #fff;
|
|
299
|
+
--vis-scatter-point-label-text-font-weight: 500;
|
|
300
|
+
--vis-scatter-point-label-text-font-size: 12px;
|
|
301
|
+
// Undefined by default to allow proper fallback to var(--vis-font-family)
|
|
302
|
+
/* --vis-scatter-point-label-text-font-family: */
|
|
303
|
+
}
|
|
304
|
+
`,gj=M`
|
|
305
|
+
label: scatter-component;
|
|
306
|
+
`,qm=M`
|
|
307
|
+
label: point-group;
|
|
308
|
+
`,sb=M`
|
|
309
|
+
label: point-group-exit;
|
|
310
|
+
`,Xm=M`
|
|
311
|
+
label: point;
|
|
312
|
+
|
|
313
|
+
> path {
|
|
314
|
+
cursor: var(--vis-scatter-cursor);
|
|
315
|
+
fill: var(--vis-scatter-fill-color);
|
|
316
|
+
fill-opacity: var(--vis-scatter-fill-opacity);
|
|
317
|
+
stroke-opacity: var(--vis-scatter-stroke-opacity);
|
|
318
|
+
stroke-width: var(--vis-scatter-stroke-width);
|
|
319
|
+
stroke: var(--vis-scatter-stroke-color);
|
|
320
|
+
|
|
321
|
+
&:hover {
|
|
322
|
+
stroke-width: var(--vis-scatter-hover-stroke-width);
|
|
323
|
+
}
|
|
324
|
+
}
|
|
325
|
+
|
|
326
|
+
> text {
|
|
327
|
+
font-weight: var(--vis-scatter-point-label-text-font-weight);
|
|
328
|
+
font-size: var(--vis-scatter-point-label-text-font-size);
|
|
329
|
+
font-family: var(--vis-scatter-point-label-text-font-family, var(--vis-font-family));
|
|
330
|
+
fill: var(--vis-scatter-point-label-text-color-dark);
|
|
331
|
+
user-select: none;
|
|
332
|
+
}
|
|
333
|
+
`;var Df=class t extends ae{constructor(e){super(),this._defaultConfig=CM,this.config=this._defaultConfig,this.events={[t.selectors.point]:{mouseenter:this._onPointMouseOver.bind(this),mouseleave:this._onPointMouseOut.bind(this)}},this._pointData=[],e&&this.setConfig(e)}setConfig(e){super.setConfig(e),this._updateSizeScale()}setData(e){super.setData(e),this._updateSizeScale()}get bleed(){this._pointData=this._getOnScreenData();let e=Li(this._pointData),n=bt(this.yScale.range()),r=rt(this.yScale.range()),o=this.xScale.range()[0],i=this.xScale.range()[1],a=ue("var(--vis-scatter-point-label-text-font-size)",this.element),s=e.reduce((h,p)=>{let g=this.xScale(p._point.xValue),m=this.yScale(p._point.yValue),x=p._point.sizePx/2;if(h.minX=Math.min(h.minX,g-x),h.maxX=Math.max(h.maxX,g+x),h.minY=Math.min(h.minY,m-x),h.maxY=Math.max(h.maxY,m+x),p._point.label){let y=Um(p,p._point.labelPosition,this.xScale,this.yScale,a);h.minX=Math.min(h.minX,y.x),h.maxX=Math.max(h.maxX,y.x+y.width),h.minY=Math.min(h.minY,y.y),h.maxY=Math.max(h.maxY,y.y+y.height)}return h},{minX:Number.POSITIVE_INFINITY,maxX:Number.NEGATIVE_INFINITY,minY:Number.POSITIVE_INFINITY,maxY:Number.NEGATIVE_INFINITY}),l=1.2,c=s.minY<n?l*(n-s.minY):0,u=s.maxY>r?l*(s.maxY-r):0,f=s.minX<o?l*(o-s.minX):0,d=s.maxX>i?l*(s.maxX-i):0;return{top:c,bottom:u,left:f,right:d}}_render(e){let{config:n}=this,r=tt(e)?e:n.duration,o=this.g.selectAll(`.${qm}`).data(this._pointData),a=o.enter().append("g").attr("class",qm).merge(o);G(a,r).style("opacity",1);let s=o.exit().attr("class",sb);G(s,r).style("opacity",0).remove();let l=a.selectAll(`.${Xm}`).data(u=>u,u=>{var f;return`${(f=j(u,n.id,u._point.pointIndex))!==null&&f!==void 0?f:u._point.pointIndex}`}),c=l.enter().append("g").attr("class",Xm);LM(c,this.xScale,this.yScale),this._points=c.merge(l),EM(this._points,n,this.xScale,this.yScale,r),MM(l.exit(),this.xScale,this.yScale,r),this._resolveLabelOverlap()}_resolveLabelOverlap(){if(this.config.label){if(!this.config.labelHideOverlapping){this._points.selectAll("text").attr("opacity",null);return}cancelAnimationFrame(this._collideLabelsAnimFrameId),this._collideLabelsAnimFrameId=requestAnimationFrame(()=>{let e=this._points.filter(n=>!!n._point.label);TM(e,this.config,this.xScale,this.yScale)})}}_updateSizeScale(){var e;let{config:n,datamodel:r}=this;this._sizeScale=n.sizeScale.copy(),this._sizeScale.domain(ur(r.data,n.size)),this._sizeScale.range((e=n.sizeRange)!==null&&e!==void 0?e:[0,0])}_getOnScreenData(){let{config:e,datamodel:{data:n}}=this,r=this.xScale.domain().map(d=>+d),o=this.yScale.domain().map(d=>+d),i=Ie(e.y)?e.y:[e.y],a=rt(Li(i.map((d,h)=>n?.map(p=>z(p,e.size,h))))),s=e.sizeRange?this._sizeScale(a):a,l=this.xScale.invert(s)-this.xScale.invert(0),c=Math.abs(this.yScale.invert(s)-this.yScale.invert(0)),u={colorFn:this._colorFunction},f=Object.assign(Object.assign({},u),{dontFallbackToCssVar:!0});return i.map((d,h)=>{var p;return(p=n?.reduce((g,m,x)=>{var y,_,v;let b=z(m,e.x,x),w=z(m,d,h);if(b==null||w==null)return g;let A=z(m,e.size,x),L=e.sizeRange?this._sizeScale(A):A,E=this.xScale.invert(L)-this.xScale.invert(0),I=Math.abs(this.yScale.invert(L)-this.yScale.invert(0));return b-E/2>=r[0]-l/2&&b+E/2<=r[1]+l/2&&w-I/2>=o[0]-c/2&&w+I/2<=o[1]+c/2&&g.push(Object.assign(Object.assign({},m),{_point:{xValue:b,yValue:w,sizePx:L,color:K(m,e.color,h,(y=e.colorKeys)===null||y===void 0?void 0:y[h],u),mask:Ft(Nt(m,e.pattern,h)),strokeColor:K(m,e.strokeColor,h,(_=e.colorKeys)===null||_===void 0?void 0:_[h],f),strokeWidthPx:z(m,e.strokeWidth,h),shape:j(m,e.shape,h),label:j(m,e.label,h),labelColor:K(m,e.labelColor,h,(v=e.colorKeys)===null||v===void 0?void 0:v[h],f),labelPosition:st(m,e.labelPosition,x),cursor:j(m,e.cursor,h),groupIndex:h,pointIndex:x}})),g},[]))!==null&&p!==void 0?p:[]})}_mapEventDatum(e){return{datum:e,index:e._point.pointIndex}}_onPointMouseOver(e,n){let r=U(n.target),o=r.node();o&&(o._forceShowLabel=!0),r.raise(),this._resolveLabelOverlap()}_onPointMouseOut(e,n){let r=U(n.target).node();r&&delete r._forceShowLabel,this._resolveLabelOverlap()}};Df.selectors=lb;Ml();var RM={passive:!1},cs={capture:!0,passive:!1};function Zm(t){t.stopImmediatePropagation()}function Hi(t){t.preventDefault(),t.stopImmediatePropagation()}function us(t){var e=t.document.documentElement,n=U(t).on("dragstart.drag",Hi,cs);"onselectstart"in e?n.on("selectstart.drag",Hi,cs):(e.__noselect=e.style.MozUserSelect,e.style.MozUserSelect="none")}function fs(t,e){var n=t.document.documentElement,r=U(t).on("dragstart.drag",null);e&&(r.on("click.drag",Hi,cs),setTimeout(function(){r.on("click.drag",null)},0)),"onselectstart"in n?r.on("selectstart.drag",null):(n.style.MozUserSelect=n.__noselect,delete n.__noselect)}var Of=t=>()=>t;function zf(t,{sourceEvent:e,subject:n,target:r,identifier:o,active:i,x:a,y:s,dx:l,dy:c,dispatch:u}){Object.defineProperties(this,{type:{value:t,enumerable:!0,configurable:!0},sourceEvent:{value:e,enumerable:!0,configurable:!0},subject:{value:n,enumerable:!0,configurable:!0},target:{value:r,enumerable:!0,configurable:!0},identifier:{value:o,enumerable:!0,configurable:!0},active:{value:i,enumerable:!0,configurable:!0},x:{value:a,enumerable:!0,configurable:!0},y:{value:s,enumerable:!0,configurable:!0},dx:{value:l,enumerable:!0,configurable:!0},dy:{value:c,enumerable:!0,configurable:!0},_:{value:u}})}zf.prototype.on=function(){var t=this._.on.apply(this._,arguments);return t===this._?this:t};function xj(t){return!t.ctrlKey&&!t.button}function vj(){return this.parentNode}function yj(t,e){return e??{x:t.x,y:t.y}}function _j(){return navigator.maxTouchPoints||"ontouchstart"in this}function Bf(){var t=xj,e=vj,n=yj,r=_j,o={},i=Vr("start","drag","end"),a=0,s,l,c,u,f=0;function d(v){v.on("mousedown.drag",h).filter(r).on("touchstart.drag",m).on("touchmove.drag",x,RM).on("touchend.drag touchcancel.drag",y).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function h(v,b){if(!(u||!t.call(this,v,b))){var w=_(this,e.call(this,v,b),v,b,"mouse");w&&(U(v.view).on("mousemove.drag",p,cs).on("mouseup.drag",g,cs),us(v.view),Zm(v),c=!1,s=v.clientX,l=v.clientY,w("start",v))}}function p(v){if(Hi(v),!c){var b=v.clientX-s,w=v.clientY-l;c=b*b+w*w>f}o.mouse("drag",v)}function g(v){U(v.view).on("mousemove.drag mouseup.drag",null),fs(v.view,c),Hi(v),o.mouse("end",v)}function m(v,b){if(t.call(this,v,b)){var w=v.changedTouches,A=e.call(this,v,b),L=w.length,E,I;for(E=0;E<L;++E)(I=_(this,A,v,b,w[E].identifier,w[E]))&&(Zm(v),I("start",v,w[E]))}}function x(v){var b=v.changedTouches,w=b.length,A,L;for(A=0;A<w;++A)(L=o[b[A].identifier])&&(Hi(v),L("drag",v,b[A]))}function y(v){var b=v.changedTouches,w=b.length,A,L;for(u&&clearTimeout(u),u=setTimeout(function(){u=null},500),A=0;A<w;++A)(L=o[b[A].identifier])&&(Zm(v),L("end",v,b[A]))}function _(v,b,w,A,L,E){var I=i.copy(),D=oe(E||w,b),F,$,T;if((T=n.call(v,new zf("beforestart",{sourceEvent:w,target:d,identifier:L,active:a,x:D[0],y:D[1],dx:0,dy:0,dispatch:I}),A))!=null)return F=T.x-D[0]||0,$=T.y-D[1]||0,function S(k,P,N){var R=D,O;switch(k){case"start":o[L]=S,O=a++;break;case"end":delete o[L],--a;case"drag":D=oe(N||P,b),O=a;break}I.call(k,v,new zf(k,{sourceEvent:P,subject:T,target:d,identifier:L,active:O,x:D[0]+F,y:D[1]+$,dx:D[0]-R[0],dy:D[1]-R[1],dispatch:I}),A)}}return d.filter=function(v){return arguments.length?(t=typeof v=="function"?v:Of(!!v),d):t},d.container=function(v){return arguments.length?(e=typeof v=="function"?v:Of(v),d):e},d.subject=function(v){return arguments.length?(n=typeof v=="function"?v:Of(v),d):n},d.touchable=function(v){return arguments.length?(r=typeof v=="function"?v:Of(!!v),d):r},d.on=function(){var v=i.on.apply(i,arguments);return v===i?d:v},d.clickDistance=function(v){return arguments.length?(f=(v=+v)*v,d):Math.sqrt(f)},d}var Ee;(function(t){t.Along="along",t.Perpendicular="perpendicular"})(Ee||(Ee={}));var ht=1e-6,Km=1e-12,wt=Math.PI,qt=wt/2,cb=wt/4,tn=wt*2,Xe=180/wt,Xt=wt/180,At=Math.abs,yr=Math.atan,dn=Math.atan2,pt=Math.cos;var Qm=Math.exp;var ds=Math.log,Jm=Math.pow,ut=Math.sin,gn=Math.sign||function(t){return t>0?1:t<0?-1:0},le=Math.sqrt,ql=Math.tan;function tg(t){return t>1?0:t<-1?wt:Math.acos(t)}function Me(t){return t>1?qt:t<-1?-qt:Math.asin(t)}function en(){}function eg(t,e){t&&IM.hasOwnProperty(t.type)&&IM[t.type](t,e)}var PM={Feature:function(t,e){eg(t.geometry,e)},FeatureCollection:function(t,e){for(var n=t.features,r=-1,o=n.length;++r<o;)eg(n[r].geometry,e)}},IM={Sphere:function(t,e){e.sphere()},Point:function(t,e){t=t.coordinates,e.point(t[0],t[1],t[2])},MultiPoint:function(t,e){for(var n=t.coordinates,r=-1,o=n.length;++r<o;)t=n[r],e.point(t[0],t[1],t[2])},LineString:function(t,e){ub(t.coordinates,e,0)},MultiLineString:function(t,e){for(var n=t.coordinates,r=-1,o=n.length;++r<o;)ub(n[r],e,0)},Polygon:function(t,e){NM(t.coordinates,e)},MultiPolygon:function(t,e){for(var n=t.coordinates,r=-1,o=n.length;++r<o;)NM(n[r],e)},GeometryCollection:function(t,e){for(var n=t.geometries,r=-1,o=n.length;++r<o;)eg(n[r],e)}};function ub(t,e,n){var r=-1,o=t.length-n,i;for(e.lineStart();++r<o;)i=t[r],e.point(i[0],i[1],i[2]);e.lineEnd()}function NM(t,e){var n=-1,r=t.length;for(e.polygonStart();++n<r;)ub(t[n],e,1);e.polygonEnd()}function ji(t,e){t&&PM.hasOwnProperty(t.type)?PM[t.type](t,e):eg(t,e)}function Ff(t){return[dn(t[1],t[0]),Me(t[2])]}function ko(t){var e=t[0],n=t[1],r=pt(n);return[r*pt(e),r*ut(e),ut(n)]}function Gf(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]}function Xl(t,e){return[t[1]*e[2]-t[2]*e[1],t[2]*e[0]-t[0]*e[2],t[0]*e[1]-t[1]*e[0]]}function ng(t,e){t[0]+=e[0],t[1]+=e[1],t[2]+=e[2]}function Wf(t,e){return[t[0]*e,t[1]*e,t[2]*e]}function Vf(t){var e=le(t[0]*t[0]+t[1]*t[1]+t[2]*t[2]);t[0]/=e,t[1]/=e,t[2]/=e}function Hf(t,e){function n(r,o){return r=t(r,o),e(r[0],r[1])}return t.invert&&e.invert&&(n.invert=function(r,o){return r=e.invert(r,o),r&&t.invert(r[0],r[1])}),n}function fb(t,e){return At(t)>wt&&(t-=Math.round(t/tn)*tn),[t,e]}fb.invert=fb;function db(t,e,n){return(t%=tn)?e||n?Hf(DM(t),OM(e,n)):DM(t):e||n?OM(e,n):fb}function $M(t){return function(e,n){return e+=t,At(e)>wt&&(e-=Math.round(e/tn)*tn),[e,n]}}function DM(t){var e=$M(t);return e.invert=$M(-t),e}function OM(t,e){var n=pt(t),r=ut(t),o=pt(e),i=ut(e);function a(s,l){var c=pt(l),u=pt(s)*c,f=ut(s)*c,d=ut(l),h=d*n+u*r;return[dn(f*o-h*i,u*n-d*r),Me(h*o+f*i)]}return a.invert=function(s,l){var c=pt(l),u=pt(s)*c,f=ut(s)*c,d=ut(l),h=d*o-f*i;return[dn(f*o+d*i,u*n+h*r),Me(h*n-u*r)]},a}function zM(t){t=db(t[0]*Xt,t[1]*Xt,t.length>2?t[2]*Xt:0);function e(n){return n=t(n[0]*Xt,n[1]*Xt),n[0]*=Xe,n[1]*=Xe,n}return e.invert=function(n){return n=t.invert(n[0]*Xt,n[1]*Xt),n[0]*=Xe,n[1]*=Xe,n},e}function FM(t,e,n,r,o,i){if(n){var a=pt(e),s=ut(e),l=r*n;o==null?(o=e+r*tn,i=e-l/2):(o=BM(a,o),i=BM(a,i),(r>0?o<i:o>i)&&(o+=r*tn));for(var c,u=o;r>0?u>i:u<i;u-=l)c=Ff([a,-s*pt(u),-s*ut(u)]),t.point(c[0],c[1])}}function BM(t,e){e=ko(e),e[0]-=t,Vf(e);var n=tg(-e[1]);return((-e[2]<0?-n:n)+tn-ht)%tn}function rg(){var t=[],e;return{point:function(n,r,o){e.push([n,r,o])},lineStart:function(){t.push(e=[])},lineEnd:en,rejoin:function(){t.length>1&&t.push(t.pop().concat(t.shift()))},result:function(){var n=t;return t=[],e=null,n}}}function Zl(t,e){return At(t[0]-e[0])<ht&&At(t[1]-e[1])<ht}function og(t,e,n,r){this.x=t,this.z=e,this.o=n,this.e=r,this.v=!1,this.n=this.p=null}function ig(t,e,n,r,o){var i=[],a=[],s,l;if(t.forEach(function(p){if(!((g=p.length-1)<=0)){var g,m=p[0],x=p[g],y;if(Zl(m,x)){if(!m[2]&&!x[2]){for(o.lineStart(),s=0;s<g;++s)o.point((m=p[s])[0],m[1]);o.lineEnd();return}x[0]+=2*ht}i.push(y=new og(m,p,null,!0)),a.push(y.o=new og(m,null,y,!1)),i.push(y=new og(x,p,null,!1)),a.push(y.o=new og(x,null,y,!0))}}),!!i.length){for(a.sort(e),GM(i),GM(a),s=0,l=a.length;s<l;++s)a[s].e=n=!n;for(var c=i[0],u,f;;){for(var d=c,h=!0;d.v;)if((d=d.n)===c)return;u=d.z,o.lineStart();do{if(d.v=d.o.v=!0,d.e){if(h)for(s=0,l=u.length;s<l;++s)o.point((f=u[s])[0],f[1]);else r(d.x,d.n.x,1,o);d=d.n}else{if(h)for(u=d.p.z,s=u.length-1;s>=0;--s)o.point((f=u[s])[0],f[1]);else r(d.x,d.p.x,-1,o);d=d.p}d=d.o,u=d.z,h=!h}while(!d.v);o.lineEnd()}}}function GM(t){if(e=t.length){for(var e,n=0,r=t[0],o;++n<e;)r.n=o=t[n],o.p=r,r=o;r.n=o=t[0],o.p=r}}function hb(t){return At(t[0])<=wt?t[0]:gn(t[0])*((At(t[0])+wt)%tn-wt)}function WM(t,e){var n=hb(e),r=e[1],o=ut(r),i=[ut(n),-pt(n),0],a=0,s=0,l=new jn;o===1?r=qt+ht:o===-1&&(r=-qt-ht);for(var c=0,u=t.length;c<u;++c)if(d=(f=t[c]).length)for(var f,d,h=f[d-1],p=hb(h),g=h[1]/2+cb,m=ut(g),x=pt(g),y=0;y<d;++y,p=v,m=w,x=A,h=_){var _=f[y],v=hb(_),b=_[1]/2+cb,w=ut(b),A=pt(b),L=v-p,E=L>=0?1:-1,I=E*L,D=I>wt,F=m*w;if(l.add(dn(F*E*ut(I),x*A+F*pt(I))),a+=D?L+E*tn:L,D^p>=n^v>=n){var $=Xl(ko(h),ko(_));Vf($);var T=Xl(i,$);Vf(T);var S=(D^L>=0?-1:1)*Me(T[2]);(r>S||r===S&&($[0]||$[1]))&&(s+=D^L>=0?1:-1)}}return(a<-ht||a<ht&&l<-Km)^s&1}function ag(t,e,n,r){return function(o){var i=e(o),a=rg(),s=e(a),l=!1,c,u,f,d={point:h,lineStart:g,lineEnd:m,polygonStart:function(){d.point=x,d.lineStart=y,d.lineEnd=_,u=[],c=[]},polygonEnd:function(){d.point=h,d.lineStart=g,d.lineEnd=m,u=Ti(u);var v=WM(c,r);u.length?(l||(o.polygonStart(),l=!0),ig(u,wj,v,n,o)):v&&(l||(o.polygonStart(),l=!0),o.lineStart(),n(null,null,1,o),o.lineEnd()),l&&(o.polygonEnd(),l=!1),u=c=null},sphere:function(){o.polygonStart(),o.lineStart(),n(null,null,1,o),o.lineEnd(),o.polygonEnd()}};function h(v,b){t(v,b)&&o.point(v,b)}function p(v,b){i.point(v,b)}function g(){d.point=p,i.lineStart()}function m(){d.point=h,i.lineEnd()}function x(v,b){f.push([v,b]),s.point(v,b)}function y(){s.lineStart(),f=[]}function _(){x(f[0][0],f[0][1]),s.lineEnd();var v=s.clean(),b=a.result(),w,A=b.length,L,E,I;if(f.pop(),c.push(f),f=null,!!A){if(v&1){if(E=b[0],(L=E.length-1)>0){for(l||(o.polygonStart(),l=!0),o.lineStart(),w=0;w<L;++w)o.point((I=E[w])[0],I[1]);o.lineEnd()}return}A>1&&v&2&&b.push(b.pop().concat(b.shift())),u.push(b.filter(bj))}}return d}}function bj(t){return t.length>1}function wj(t,e){return((t=t.x)[0]<0?t[1]-qt-ht:qt-t[1])-((e=e.x)[0]<0?e[1]-qt-ht:qt-e[1])}var pb=ag(function(){return!0},kj,Cj,[-wt,-qt]);function kj(t){var e=NaN,n=NaN,r=NaN,o;return{lineStart:function(){t.lineStart(),o=1},point:function(i,a){var s=i>0?wt:-wt,l=At(i-e);At(l-wt)<ht?(t.point(e,n=(n+a)/2>0?qt:-qt),t.point(r,n),t.lineEnd(),t.lineStart(),t.point(s,n),t.point(i,n),o=0):r!==s&&l>=wt&&(At(e-r)<ht&&(e-=r*ht),At(i-s)<ht&&(i-=s*ht),n=Sj(e,n,i,a),t.point(r,n),t.lineEnd(),t.lineStart(),t.point(s,n),o=0),t.point(e=i,n=a),r=s},lineEnd:function(){t.lineEnd(),e=n=NaN},clean:function(){return 2-o}}}function Sj(t,e,n,r){var o,i,a=ut(t-n);return At(a)>ht?yr((ut(e)*(i=pt(r))*ut(n)-ut(r)*(o=pt(e))*ut(t))/(o*i*a)):(e+r)/2}function Cj(t,e,n,r){var o;if(t==null)o=n*qt,r.point(-wt,o),r.point(0,o),r.point(wt,o),r.point(wt,0),r.point(wt,-o),r.point(0,-o),r.point(-wt,-o),r.point(-wt,0),r.point(-wt,o);else if(At(t[0]-e[0])>ht){var i=t[0]<e[0]?wt:-wt;o=n*i/2,r.point(-i,o),r.point(0,o),r.point(i,o)}else r.point(e[0],e[1])}function VM(t){var e=pt(t),n=2*Xt,r=e>0,o=At(e)>ht;function i(u,f,d,h){FM(h,t,n,d,u,f)}function a(u,f){return pt(u)*pt(f)>e}function s(u){var f,d,h,p,g;return{lineStart:function(){p=h=!1,g=1},point:function(m,x){var y=[m,x],_,v=a(m,x),b=r?v?0:c(m,x):v?c(m+(m<0?wt:-wt),x):0;if(!f&&(p=h=v)&&u.lineStart(),v!==h&&(_=l(f,y),(!_||Zl(f,_)||Zl(y,_))&&(y[2]=1)),v!==h)g=0,v?(u.lineStart(),_=l(y,f),u.point(_[0],_[1])):(_=l(f,y),u.point(_[0],_[1],2),u.lineEnd()),f=_;else if(o&&f&&r^v){var w;!(b&d)&&(w=l(y,f,!0))&&(g=0,r?(u.lineStart(),u.point(w[0][0],w[0][1]),u.point(w[1][0],w[1][1]),u.lineEnd()):(u.point(w[1][0],w[1][1]),u.lineEnd(),u.lineStart(),u.point(w[0][0],w[0][1],3)))}v&&(!f||!Zl(f,y))&&u.point(y[0],y[1]),f=y,h=v,d=b},lineEnd:function(){h&&u.lineEnd(),f=null},clean:function(){return g|(p&&h)<<1}}}function l(u,f,d){var h=ko(u),p=ko(f),g=[1,0,0],m=Xl(h,p),x=Gf(m,m),y=m[0],_=x-y*y;if(!_)return!d&&u;var v=e*x/_,b=-e*y/_,w=Xl(g,m),A=Wf(g,v),L=Wf(m,b);ng(A,L);var E=w,I=Gf(A,E),D=Gf(E,E),F=I*I-D*(Gf(A,A)-1);if(!(F<0)){var $=le(F),T=Wf(E,(-I-$)/D);if(ng(T,A),T=Ff(T),!d)return T;var S=u[0],k=f[0],P=u[1],N=f[1],R;k<S&&(R=S,S=k,k=R);var O=k-S,W=At(O-wt)<ht,Y=W||O<ht;if(!W&&N<P&&(R=P,P=N,N=R),Y?W?P+N>0^T[1]<(At(T[0]-S)<ht?P:N):P<=T[1]&&T[1]<=N:O>wt^(S<=T[0]&&T[0]<=k)){var J=Wf(E,(-I+$)/D);return ng(J,A),[T,Ff(J)]}}}function c(u,f){var d=r?t:wt-t,h=0;return u<-d?h|=1:u>d&&(h|=2),f<-d?h|=4:f>d&&(h|=8),h}return ag(a,s,i,r?[0,-t]:[-wt,t-wt])}function HM(t,e,n,r,o,i){var a=t[0],s=t[1],l=e[0],c=e[1],u=0,f=1,d=l-a,h=c-s,p;if(p=n-a,!(!d&&p>0)){if(p/=d,d<0){if(p<u)return;p<f&&(f=p)}else if(d>0){if(p>f)return;p>u&&(u=p)}if(p=o-a,!(!d&&p<0)){if(p/=d,d<0){if(p>f)return;p>u&&(u=p)}else if(d>0){if(p<u)return;p<f&&(f=p)}if(p=r-s,!(!h&&p>0)){if(p/=h,h<0){if(p<u)return;p<f&&(f=p)}else if(h>0){if(p>f)return;p>u&&(u=p)}if(p=i-s,!(!h&&p<0)){if(p/=h,h<0){if(p>f)return;p>u&&(u=p)}else if(h>0){if(p<u)return;p<f&&(f=p)}return u>0&&(t[0]=a+u*d,t[1]=s+u*h),f<1&&(e[0]=a+f*d,e[1]=s+f*h),!0}}}}}var jf=1e9,sg=-jf;function mb(t,e,n,r){function o(c,u){return t<=c&&c<=n&&e<=u&&u<=r}function i(c,u,f,d){var h=0,p=0;if(c==null||(h=a(c,f))!==(p=a(u,f))||l(c,u)<0^f>0)do d.point(h===0||h===3?t:n,h>1?r:e);while((h=(h+f+4)%4)!==p);else d.point(u[0],u[1])}function a(c,u){return At(c[0]-t)<ht?u>0?0:3:At(c[0]-n)<ht?u>0?2:1:At(c[1]-e)<ht?u>0?1:0:u>0?3:2}function s(c,u){return l(c.x,u.x)}function l(c,u){var f=a(c,1),d=a(u,1);return f!==d?f-d:f===0?u[1]-c[1]:f===1?c[0]-u[0]:f===2?c[1]-u[1]:u[0]-c[0]}return function(c){var u=c,f=rg(),d,h,p,g,m,x,y,_,v,b,w,A={point:L,lineStart:F,lineEnd:$,polygonStart:I,polygonEnd:D};function L(S,k){o(S,k)&&u.point(S,k)}function E(){for(var S=0,k=0,P=h.length;k<P;++k)for(var N=h[k],R=1,O=N.length,W=N[0],Y,J,nt=W[0],et=W[1];R<O;++R)Y=nt,J=et,W=N[R],nt=W[0],et=W[1],J<=r?et>r&&(nt-Y)*(r-J)>(et-J)*(t-Y)&&++S:et<=r&&(nt-Y)*(r-J)<(et-J)*(t-Y)&&--S;return S}function I(){u=f,d=[],h=[],w=!0}function D(){var S=E(),k=w&&S,P=(d=Ti(d)).length;(k||P)&&(c.polygonStart(),k&&(c.lineStart(),i(null,null,1,c),c.lineEnd()),P&&ig(d,s,S,i,c),c.polygonEnd()),u=c,d=h=p=null}function F(){A.point=T,h&&h.push(p=[]),b=!0,v=!1,y=_=NaN}function $(){d&&(T(g,m),x&&v&&f.rejoin(),d.push(f.result())),A.point=L,v&&u.lineEnd()}function T(S,k){var P=o(S,k);if(h&&p.push([S,k]),b)g=S,m=k,x=P,b=!1,P&&(u.lineStart(),u.point(S,k));else if(P&&v)u.point(S,k);else{var N=[y=Math.max(sg,Math.min(jf,y)),_=Math.max(sg,Math.min(jf,_))],R=[S=Math.max(sg,Math.min(jf,S)),k=Math.max(sg,Math.min(jf,k))];HM(N,R,t,e,n,r)?(v||(u.lineStart(),u.point(N[0],N[1])),u.point(R[0],R[1]),P||u.lineEnd(),w=!1):P&&(u.lineStart(),u.point(S,k),w=!1)}y=S,_=k,v=P}return A}}var Yf=t=>t;var gb=new jn,xb=new jn,jM,YM,vb,yb,Yi={point:en,lineStart:en,lineEnd:en,polygonStart:function(){Yi.lineStart=Aj,Yi.lineEnd=Lj},polygonEnd:function(){Yi.lineStart=Yi.lineEnd=Yi.point=en,gb.add(At(xb)),xb=new jn},result:function(){var t=gb/2;return gb=new jn,t}};function Aj(){Yi.point=Tj}function Tj(t,e){Yi.point=UM,jM=vb=t,YM=yb=e}function UM(t,e){xb.add(yb*t-vb*e),vb=t,yb=e}function Lj(){UM(jM,YM)}var _b=Yi;var Kl=1/0,lg=Kl,Uf=-Kl,cg=Uf,Ej={point:Mj,lineStart:en,lineEnd:en,polygonStart:en,polygonEnd:en,result:function(){var t=[[Kl,lg],[Uf,cg]];return Uf=cg=-(lg=Kl=1/0),t}};function Mj(t,e){t<Kl&&(Kl=t),t>Uf&&(Uf=t),e<lg&&(lg=e),e>cg&&(cg=e)}var Ql=Ej;var bb=0,wb=0,qf=0,ug=0,fg=0,Jl=0,kb=0,Sb=0,Xf=0,ZM,KM,So,Co,Yr={point:hs,lineStart:qM,lineEnd:XM,polygonStart:function(){Yr.lineStart=Ij,Yr.lineEnd=Nj},polygonEnd:function(){Yr.point=hs,Yr.lineStart=qM,Yr.lineEnd=XM},result:function(){var t=Xf?[kb/Xf,Sb/Xf]:Jl?[ug/Jl,fg/Jl]:qf?[bb/qf,wb/qf]:[NaN,NaN];return bb=wb=qf=ug=fg=Jl=kb=Sb=Xf=0,t}};function hs(t,e){bb+=t,wb+=e,++qf}function qM(){Yr.point=Rj}function Rj(t,e){Yr.point=Pj,hs(So=t,Co=e)}function Pj(t,e){var n=t-So,r=e-Co,o=le(n*n+r*r);ug+=o*(So+t)/2,fg+=o*(Co+e)/2,Jl+=o,hs(So=t,Co=e)}function XM(){Yr.point=hs}function Ij(){Yr.point=$j}function Nj(){QM(ZM,KM)}function $j(t,e){Yr.point=QM,hs(ZM=So=t,KM=Co=e)}function QM(t,e){var n=t-So,r=e-Co,o=le(n*n+r*r);ug+=o*(So+t)/2,fg+=o*(Co+e)/2,Jl+=o,o=Co*t-So*e,kb+=o*(So+t),Sb+=o*(Co+e),Xf+=o*3,hs(So=t,Co=e)}var Cb=Yr;function dg(t){this._context=t}dg.prototype={_radius:4.5,pointRadius:function(t){return this._radius=t,this},polygonStart:function(){this._line=0},polygonEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){this._line===0&&this._context.closePath(),this._point=NaN},point:function(t,e){switch(this._point){case 0:{this._context.moveTo(t,e),this._point=1;break}case 1:{this._context.lineTo(t,e);break}default:{this._context.moveTo(t+this._radius,e),this._context.arc(t,e,this._radius,0,tn);break}}},result:en};var Tb=new jn,Ab,JM,tR,Zf,Kf,hg={point:en,lineStart:function(){hg.point=Dj},lineEnd:function(){Ab&&eR(JM,tR),hg.point=en},polygonStart:function(){Ab=!0},polygonEnd:function(){Ab=null},result:function(){var t=+Tb;return Tb=new jn,t}};function Dj(t,e){hg.point=eR,JM=Zf=t,tR=Kf=e}function eR(t,e){Zf-=t,Kf-=e,Tb.add(le(Zf*Zf+Kf*Kf)),Zf=t,Kf=e}var Lb=hg;var nR,pg,rR,oR,tc=class{constructor(e){this._append=e==null?iR:Oj(e),this._radius=4.5,this._=""}pointRadius(e){return this._radius=+e,this}polygonStart(){this._line=0}polygonEnd(){this._line=NaN}lineStart(){this._point=0}lineEnd(){this._line===0&&(this._+="Z"),this._point=NaN}point(e,n){switch(this._point){case 0:{this._append`M${e},${n}`,this._point=1;break}case 1:{this._append`L${e},${n}`;break}default:{if(this._append`M${e},${n}`,this._radius!==rR||this._append!==pg){let r=this._radius,o=this._;this._="",this._append`m0,${r}a${r},${r} 0 1,1 0,${-2*r}a${r},${r} 0 1,1 0,${2*r}z`,rR=r,pg=this._append,oR=this._,this._=o}this._+=oR;break}}}result(){let e=this._;return this._="",e.length?e:null}};function iR(t){let e=1;this._+=t[0];for(let n=t.length;e<n;++e)this._+=arguments[e]+t[e]}function Oj(t){let e=Math.floor(t);if(!(e>=0))throw new RangeError(`invalid digits: ${t}`);if(e>15)return iR;if(e!==nR){let n=10**e;nR=e,pg=function(o){let i=1;this._+=o[0];for(let a=o.length;i<a;++i)this._+=Math.round(arguments[i]*n)/n+o[i]}}return pg}function Eb(t,e){let n=3,r=4.5,o,i;function a(s){return s&&(typeof r=="function"&&i.pointRadius(+r.apply(this,arguments)),ji(s,o(i))),i.result()}return a.area=function(s){return ji(s,o(_b)),_b.result()},a.measure=function(s){return ji(s,o(Lb)),Lb.result()},a.bounds=function(s){return ji(s,o(Ql)),Ql.result()},a.centroid=function(s){return ji(s,o(Cb)),Cb.result()},a.projection=function(s){return arguments.length?(o=s==null?(t=null,Yf):(t=s).stream,a):t},a.context=function(s){return arguments.length?(i=s==null?(e=null,new tc(n)):new dg(e=s),typeof r!="function"&&i.pointRadius(r),a):e},a.pointRadius=function(s){return arguments.length?(r=typeof s=="function"?s:(i.pointRadius(+s),+s),a):r},a.digits=function(s){if(!arguments.length)return n;if(s==null)n=null;else{let l=Math.floor(s);if(!(l>=0))throw new RangeError(`invalid digits: ${s}`);n=l}return e===null&&(i=new tc(n)),a},a.projection(t).digits(n).context(e)}function Qf(t){return function(e){var n=new Mb;for(var r in t)n[r]=t[r];return n.stream=e,n}}function Mb(){}Mb.prototype={constructor:Mb,point:function(t,e){this.stream.point(t,e)},sphere:function(){this.stream.sphere()},lineStart:function(){this.stream.lineStart()},lineEnd:function(){this.stream.lineEnd()},polygonStart:function(){this.stream.polygonStart()},polygonEnd:function(){this.stream.polygonEnd()}};function Rb(t,e,n){var r=t.clipExtent&&t.clipExtent();return t.scale(150).translate([0,0]),r!=null&&t.clipExtent(null),ji(n,t.stream(Ql)),e(Ql.result()),r!=null&&t.clipExtent(r),t}function Jf(t,e,n){return Rb(t,function(r){var o=e[1][0]-e[0][0],i=e[1][1]-e[0][1],a=Math.min(o/(r[1][0]-r[0][0]),i/(r[1][1]-r[0][1])),s=+e[0][0]+(o-a*(r[1][0]+r[0][0]))/2,l=+e[0][1]+(i-a*(r[1][1]+r[0][1]))/2;t.scale(150*a).translate([s,l])},n)}function mg(t,e,n){return Jf(t,[[0,0],e],n)}function gg(t,e,n){return Rb(t,function(r){var o=+e,i=o/(r[1][0]-r[0][0]),a=(o-i*(r[1][0]+r[0][0]))/2,s=-i*r[0][1];t.scale(150*i).translate([a,s])},n)}function xg(t,e,n){return Rb(t,function(r){var o=+e,i=o/(r[1][1]-r[0][1]),a=-i*r[0][0],s=(o-i*(r[1][1]+r[0][1]))/2;t.scale(150*i).translate([a,s])},n)}var aR=16,zj=pt(30*Xt);function Pb(t,e){return+e?Fj(t,e):Bj(t)}function Bj(t){return Qf({point:function(e,n){e=t(e,n),this.stream.point(e[0],e[1])}})}function Fj(t,e){function n(r,o,i,a,s,l,c,u,f,d,h,p,g,m){var x=c-r,y=u-o,_=x*x+y*y;if(_>4*e&&g--){var v=a+d,b=s+h,w=l+p,A=le(v*v+b*b+w*w),L=Me(w/=A),E=At(At(w)-1)<ht||At(i-f)<ht?(i+f)/2:dn(b,v),I=t(E,L),D=I[0],F=I[1],$=D-r,T=F-o,S=y*$-x*T;(S*S/_>e||At((x*$+y*T)/_-.5)>.3||a*d+s*h+l*p<zj)&&(n(r,o,i,a,s,l,D,F,E,v/=A,b/=A,w,g,m),m.point(D,F),n(D,F,E,v,b,w,c,u,f,d,h,p,g,m))}}return function(r){var o,i,a,s,l,c,u,f,d,h,p,g,m={point:x,lineStart:y,lineEnd:v,polygonStart:function(){r.polygonStart(),m.lineStart=b},polygonEnd:function(){r.polygonEnd(),m.lineStart=y}};function x(L,E){L=t(L,E),r.point(L[0],L[1])}function y(){f=NaN,m.point=_,r.lineStart()}function _(L,E){var I=ko([L,E]),D=t(L,E);n(f,d,u,h,p,g,f=D[0],d=D[1],u=L,h=I[0],p=I[1],g=I[2],aR,r),r.point(f,d)}function v(){m.point=x,r.lineEnd()}function b(){y(),m.point=w,m.lineEnd=A}function w(L,E){_(o=L,E),i=f,a=d,s=h,l=p,c=g,m.point=_}function A(){n(f,d,u,h,p,g,i,a,o,s,l,c,aR,r),m.lineEnd=v,v()}return m}}var Gj=Qf({point:function(t,e){this.stream.point(t*Xt,e*Xt)}});function Wj(t){return Qf({point:function(e,n){var r=t(e,n);return this.stream.point(r[0],r[1])}})}function Vj(t,e,n,r,o){function i(a,s){return a*=r,s*=o,[e+t*a,n-t*s]}return i.invert=function(a,s){return[(a-e)/t*r,(n-s)/t*o]},i}function sR(t,e,n,r,o,i){if(!i)return Vj(t,e,n,r,o);var a=pt(i),s=ut(i),l=a*t,c=s*t,u=a/t,f=s/t,d=(s*n-a*e)/t,h=(s*e+a*n)/t;function p(g,m){return g*=r,m*=o,[l*g-c*m+e,n-c*g-l*m]}return p.invert=function(g,m){return[r*(u*g-f*m+d),o*(h-f*g-u*m)]},p}function Et(t){return _r(function(){return t})()}function _r(t){var e,n=150,r=480,o=250,i=0,a=0,s=0,l=0,c=0,u,f=0,d=1,h=1,p=null,g=pb,m=null,x,y,_,v=Yf,b=.5,w,A,L,E,I;function D(S){return L(S[0]*Xt,S[1]*Xt)}function F(S){return S=L.invert(S[0],S[1]),S&&[S[0]*Xe,S[1]*Xe]}D.stream=function(S){return E&&I===S?E:E=Gj(Wj(u)(g(w(v(I=S)))))},D.preclip=function(S){return arguments.length?(g=S,p=void 0,T()):g},D.postclip=function(S){return arguments.length?(v=S,m=x=y=_=null,T()):v},D.clipAngle=function(S){return arguments.length?(g=+S?VM(p=S*Xt):(p=null,pb),T()):p*Xe},D.clipExtent=function(S){return arguments.length?(v=S==null?(m=x=y=_=null,Yf):mb(m=+S[0][0],x=+S[0][1],y=+S[1][0],_=+S[1][1]),T()):m==null?null:[[m,x],[y,_]]},D.scale=function(S){return arguments.length?(n=+S,$()):n},D.translate=function(S){return arguments.length?(r=+S[0],o=+S[1],$()):[r,o]},D.center=function(S){return arguments.length?(i=S[0]%360*Xt,a=S[1]%360*Xt,$()):[i*Xe,a*Xe]},D.rotate=function(S){return arguments.length?(s=S[0]%360*Xt,l=S[1]%360*Xt,c=S.length>2?S[2]%360*Xt:0,$()):[s*Xe,l*Xe,c*Xe]},D.angle=function(S){return arguments.length?(f=S%360*Xt,$()):f*Xe},D.reflectX=function(S){return arguments.length?(d=S?-1:1,$()):d<0},D.reflectY=function(S){return arguments.length?(h=S?-1:1,$()):h<0},D.precision=function(S){return arguments.length?(w=Pb(A,b=S*S),T()):le(b)},D.fitExtent=function(S,k){return Jf(D,S,k)},D.fitSize=function(S,k){return mg(D,S,k)},D.fitWidth=function(S,k){return gg(D,S,k)},D.fitHeight=function(S,k){return xg(D,S,k)};function $(){var S=sR(n,0,0,d,h,f).apply(null,e(i,a)),k=sR(n,r-S[0],o-S[1],d,h,f);return u=db(s,l,c),A=Hf(e,k),L=Hf(u,A),w=Pb(A,b),T()}function T(){return E=I=null,D}return function(){return e=t.apply(this,arguments),D.invert=e.invert&&F,$()}}function ec(t){var e=0,n=wt/3,r=_r(t),o=r(e,n);return o.parallels=function(i){return arguments.length?r(e=i[0]*Xt,n=i[1]*Xt):[e*Xe,n*Xe]},o}function lR(t){var e=pt(t);function n(r,o){return[r*e,ut(o)/e]}return n.invert=function(r,o){return[r/e,Me(o*e)]},n}function cR(t,e){var n=ut(t),r=(n+ut(e))/2;if(At(r)<ht)return lR(t);var o=1+n*(2*r-n),i=le(o)/r;function a(s,l){var c=le(o-2*r*ut(l))/r;return[c*ut(s*=r),i-c*pt(s)]}return a.invert=function(s,l){var c=i-l,u=dn(s,At(c))*gn(c);return c*r<0&&(u-=wt*gn(s)*gn(c)),[u/r,Me((o-(s*s+c*c)*r*r)/(2*r))]},a}function Ui(){return ec(cR).scale(155.424).center([0,33.6442])}function td(){return Ui().parallels([29.5,45.5]).scale(1070).translate([480,250]).rotate([96,0]).center([-.6,38.7])}function Hj(t){var e=t.length;return{point:function(n,r){for(var o=-1;++o<e;)t[o].point(n,r)},sphere:function(){for(var n=-1;++n<e;)t[n].sphere()},lineStart:function(){for(var n=-1;++n<e;)t[n].lineStart()},lineEnd:function(){for(var n=-1;++n<e;)t[n].lineEnd()},polygonStart:function(){for(var n=-1;++n<e;)t[n].polygonStart()},polygonEnd:function(){for(var n=-1;++n<e;)t[n].polygonEnd()}}}function Ib(){var t,e,n=td(),r,o=Ui().rotate([154,0]).center([-2,58.5]).parallels([55,65]),i,a=Ui().rotate([157,0]).center([-3,19.9]).parallels([8,18]),s,l,c={point:function(d,h){l=[d,h]}};function u(d){var h=d[0],p=d[1];return l=null,r.point(h,p),l||(i.point(h,p),l)||(s.point(h,p),l)}u.invert=function(d){var h=n.scale(),p=n.translate(),g=(d[0]-p[0])/h,m=(d[1]-p[1])/h;return(m>=.12&&m<.234&&g>=-.425&&g<-.214?o:m>=.166&&m<.234&&g>=-.214&&g<-.115?a:n).invert(d)},u.stream=function(d){return t&&e===d?t:t=Hj([n.stream(e=d),o.stream(d),a.stream(d)])},u.precision=function(d){return arguments.length?(n.precision(d),o.precision(d),a.precision(d),f()):n.precision()},u.scale=function(d){return arguments.length?(n.scale(d),o.scale(d*.35),a.scale(d),u.translate(n.translate())):n.scale()},u.translate=function(d){if(!arguments.length)return n.translate();var h=n.scale(),p=+d[0],g=+d[1];return r=n.translate(d).clipExtent([[p-.455*h,g-.238*h],[p+.455*h,g+.238*h]]).stream(c),i=o.translate([p-.307*h,g+.201*h]).clipExtent([[p-.425*h+ht,g+.12*h+ht],[p-.214*h-ht,g+.234*h-ht]]).stream(c),s=a.translate([p-.205*h,g+.212*h]).clipExtent([[p-.214*h+ht,g+.166*h+ht],[p-.115*h-ht,g+.234*h-ht]]).stream(c),f()},u.fitExtent=function(d,h){return Jf(u,d,h)},u.fitSize=function(d,h){return mg(u,d,h)},u.fitWidth=function(d,h){return gg(u,d,h)},u.fitHeight=function(d,h){return xg(u,d,h)};function f(){return t=e=null,u}return u.scale(1070)}function vg(t){return function(e,n){var r=pt(e),o=pt(n),i=t(r*o);return i===1/0?[2,0]:[i*o*ut(e),i*ut(n)]}}function Ao(t){return function(e,n){var r=le(e*e+n*n),o=t(r),i=ut(o),a=pt(o);return[dn(e*i,r*a),Me(r&&n*i/r)]}}var Nb=vg(function(t){return le(2/(1+t))});Nb.invert=Ao(function(t){return 2*Me(t/2)});function $b(){return Et(Nb).scale(124.75).clipAngle(180-.001)}var Db=vg(function(t){return(t=tg(t))&&t/ut(t)});Db.invert=Ao(function(t){return t});function Ob(){return Et(Db).scale(79.4188).clipAngle(180-.001)}function nc(t,e){return[t,ds(ql((qt+e)/2))]}nc.invert=function(t,e){return[t,2*yr(Qm(e))-qt]};function zb(){return Bb(nc).scale(961/tn)}function Bb(t){var e=Et(t),n=e.center,r=e.scale,o=e.translate,i=e.clipExtent,a=null,s,l,c;e.scale=function(f){return arguments.length?(r(f),u()):r()},e.translate=function(f){return arguments.length?(o(f),u()):o()},e.center=function(f){return arguments.length?(n(f),u()):n()},e.clipExtent=function(f){return arguments.length?(f==null?a=s=l=c=null:(a=+f[0][0],s=+f[0][1],l=+f[1][0],c=+f[1][1]),u()):a==null?null:[[a,s],[l,c]]};function u(){var f=wt*r(),d=e(zM(e.rotate()).invert([0,0]));return i(a==null?[[d[0]-f,d[1]-f],[d[0]+f,d[1]+f]]:t===nc?[[Math.max(d[0]-f,a),s],[Math.min(d[0]+f,l),c]]:[[a,Math.max(d[1]-f,s)],[l,Math.min(d[1]+f,c)]])}return u()}function yg(t){return ql((qt+t)/2)}function uR(t,e){var n=pt(t),r=t===e?ut(t):ds(n/pt(e))/ds(yg(e)/yg(t)),o=n*Jm(yg(t),r)/r;if(!r)return nc;function i(a,s){o>0?s<-qt+ht&&(s=-qt+ht):s>qt-ht&&(s=qt-ht);var l=o/Jm(yg(s),r);return[l*ut(r*a),o-l*pt(r*a)]}return i.invert=function(a,s){var l=o-s,c=gn(r)*le(a*a+l*l),u=dn(a,At(l))*gn(l);return l*r<0&&(u-=wt*gn(a)*gn(l)),[u/r,2*yr(Jm(o/c,1/r))-qt]},i}function Fb(){return ec(uR).scale(109.5).parallels([30,30])}function rc(t,e){return[t,e]}rc.invert=rc;function Gb(){return Et(rc).scale(152.63)}function fR(t,e){var n=pt(t),r=t===e?ut(t):(n-pt(e))/(e-t),o=n/r+t;if(At(r)<ht)return rc;function i(a,s){var l=o-s,c=r*a;return[l*ut(c),o-l*pt(c)]}return i.invert=function(a,s){var l=o-s,c=dn(a,At(l))*gn(l);return l*r<0&&(c-=wt*gn(a)*gn(l)),[c/r,o-gn(r)*le(a*a+l*l)]},i}function Wb(){return ec(fR).scale(131.154).center([0,13.9389])}var ed=1.340264,nd=-.081106,rd=893e-6,od=.003796,_g=le(3)/2,jj=12;function Vb(t,e){var n=Me(_g*ut(e)),r=n*n,o=r*r*r;return[t*pt(n)/(_g*(ed+3*nd*r+o*(7*rd+9*od*r))),n*(ed+nd*r+o*(rd+od*r))]}Vb.invert=function(t,e){for(var n=e,r=n*n,o=r*r*r,i=0,a,s,l;i<jj&&(s=n*(ed+nd*r+o*(rd+od*r))-e,l=ed+3*nd*r+o*(7*rd+9*od*r),n-=a=s/l,r=n*n,o=r*r*r,!(At(a)<Km));++i);return[_g*t*(ed+3*nd*r+o*(7*rd+9*od*r))/pt(n),Me(ut(n)/_g)]};function Hb(){return Et(Vb).scale(177.158)}function jb(t,e){var n=pt(e),r=pt(t)*n;return[n*ut(t)/r,ut(e)/r]}jb.invert=Ao(yr);function Yb(){return Et(jb).scale(144.049).clipAngle(60)}function Ub(t,e){var n=e*e,r=n*n;return[t*(.8707-.131979*n+r*(-.013791+r*(.003971*n-.001529*r))),e*(1.007226+n*(.015085+r*(-.044475+.028874*n-.005916*r)))]}Ub.invert=function(t,e){var n=e,r=25,o;do{var i=n*n,a=i*i;n-=o=(n*(1.007226+i*(.015085+a*(-.044475+.028874*i-.005916*a)))-e)/(1.007226+i*(.015085*3+a*(-.044475*7+.028874*9*i-.005916*11*a)))}while(At(o)>ht&&--r>0);return[t/(.8707+(i=n*n)*(-.131979+i*(-.013791+i*i*i*(.003971-.001529*i)))),n]};function qb(){return Et(Ub).scale(175.295)}function Xb(t,e){return[pt(e)*ut(t),ut(e)]}Xb.invert=Ao(Me);function Zb(){return Et(Xb).scale(249.5).clipAngle(90+ht)}function Kb(t,e){var n=pt(e),r=1+pt(t)*n;return[n*ut(t)/r,ut(e)/r]}Kb.invert=Ao(function(t){return 2*yr(t)});function Qb(){return Et(Kb).scale(250).clipAngle(142)}function Jb(t,e){return[ds(ql((qt+e)/2)),-t]}Jb.invert=function(t,e){return[-e,2*yr(Qm(t))-qt]};function t1(){var t=Bb(Jb),e=t.center,n=t.rotate;return t.center=function(r){return arguments.length?e([-r[1],r[0]]):(r=e(),[r[1],-r[0]])},t.rotate=function(r){return arguments.length?n([r[0],r[1],r.length>2?r[2]+90:90]):(r=n(),[r[0],r[1],r[2]-90])},n([0,0,90]).scale(159.155)}var Zt=Math.abs,oc=Math.atan,bg=Math.atan2;var St=Math.cos,dR=Math.exp,wg=Math.floor,id=Math.log,hR=Math.max,qi=Math.min;var Xi=Math.sign||function(t){return t>0?1:t<0?-1:0},Tt=Math.sin,br=Math.tan,xn=1e-6,ps=1e-12,_t=Math.PI,di=_t/2,hi=_t/4;var wr=Vt(2),ad=Vt(_t),e1=_t*2,pi=180/_t,tr=_t/180;function pR(t){return t?t/Math.sin(t):1}function Zi(t){return t>1?di:t<-1?-di:Math.asin(t)}function n1(t){return t>1?0:t<-1?_t:Math.acos(t)}function Vt(t){return t>0?Math.sqrt(t):0}function r1(t,e){var n=St(e),r=pR(n1(n*St(t/=2)));return[2*n*Tt(t)*r,Tt(e)*r]}r1.invert=function(t,e){if(!(t*t+4*e*e>_t*_t+xn)){var n=t,r=e,o=25;do{var i=Tt(n),a=Tt(n/2),s=St(n/2),l=Tt(r),c=St(r),u=Tt(2*r),f=l*l,d=c*c,h=a*a,p=1-d*s*s,g=p?n1(c*s)*Vt(m=1/p):m=0,m,x=2*g*c*a-t,y=g*l-e,_=m*(d*h+g*c*s*f),v=m*(.5*i*u-g*2*l*a),b=m*.25*(u*a-g*l*d*i),w=m*(f*s+g*h*c),A=v*b-w*_;if(!A)break;var L=(y*v-x*w)/A,E=(x*b-y*_)/A;n-=L,r-=E}while((Zt(L)>xn||Zt(E)>xn)&&--o>0);return[n,r]}};function o1(){return Et(r1).scale(152.63)}function mR(t){var e=Tt(t),n=St(t),r=t>=0?1:-1,o=br(r*t),i=(1+e-n)/2;function a(s,l){var c=St(l),u=St(s/=2);return[(1+c)*Tt(s),(r*l>-bg(u,o)-.001?0:-r*10)+i+Tt(l)*n-(1+c)*e*u]}return a.invert=function(s,l){var c=0,u=0,f=50;do{var d=St(c),h=Tt(c),p=St(u),g=Tt(u),m=1+p,x=m*h-s,y=i+g*n-m*e*d-l,_=m*d/2,v=-h*g,b=e*m*h/2,w=n*p+e*d*g,A=v*b-w*_,L=(y*v-x*w)/A/2,E=(x*b-y*_)/A;Zt(E)>2&&(E/=2),c-=L,u-=E}while((Zt(L)>xn||Zt(E)>xn)&&--f>0);return r*u>-bg(St(c),o)-.001?[c*2,u]:null},a}function i1(){var t=20*tr,e=t>=0?1:-1,n=br(e*t),r=_r(mR),o=r(t),i=o.stream;return o.parallel=function(a){return arguments.length?(n=br((e=(t=a*tr)>=0?1:-1)*t),r(t)):t*pi},o.stream=function(a){var s=o.rotate(),l=i(a),c=(o.rotate([0,0]),i(a)),u=o.precision();return o.rotate(s),l.sphere=function(){c.polygonStart(),c.lineStart();for(var f=e*-180;e*f<180;f+=e*90)c.point(f,e*90);if(t)for(;e*(f-=3*e*u)>=-180;)c.point(f,e*-bg(St(f*tr/2),n)*pi);c.lineEnd(),c.polygonEnd()},l},o.scale(218.695).center([0,28.0974])}var a1=Vt(8),Yj=id(1+wr);function s1(t,e){var n=Zt(e);return n<hi?[t,id(br(hi+e/2))]:[t*St(n)*(2*wr-1/Tt(n)),Xi(e)*(2*wr*(n-hi)-id(br(n/2)))]}s1.invert=function(t,e){if((i=Zt(e))<Yj)return[t,2*oc(dR(e))-di];var n=hi,r=25,o,i;do{var a=St(n/2),s=br(n/2);n-=o=(a1*(n-hi)-id(s)-i)/(a1-a*a/(2*s))}while(Zt(o)>ps&&--r>0);return[t/(St(n)*(a1-1/Tt(n))),Xi(e)*n]};function l1(){return Et(s1).scale(112.314)}function sd(t,e,n){var r=100,o,i,a;n=n===void 0?0:+n,e=+e;do i=t(n),a=t(n+xn),i===a&&(a=i+xn),n-=o=-1*xn*(i-e)/(i-a);while(r-- >0&&Zt(o)>xn);return r<0?NaN:n}function c1(t,e){var n=t*Tt(e),r=30,o;do e-=o=(e+Tt(e)-n)/(1+St(e));while(Zt(o)>xn&&--r>0);return e/2}function u1(t,e,n){function r(o,i){return[t*o*St(i=c1(n,i)),e*Tt(i)]}return r.invert=function(o,i){return i=Zi(i/e),[o/(t*St(i)),Zi((2*i+Tt(2*i))/n)]},r}var Wwt=u1(wr/di,wr,_t);var kg=2.00276,gR=1.11072;function f1(t,e){var n=c1(_t,e);return[kg*t/(1/St(e)+gR/St(n)),(e+wr*Tt(n))/kg]}f1.invert=function(t,e){var n=kg*e,r=e<0?-hi:hi,o=25,i,a;do a=n-wr*Tt(r),r-=i=(Tt(2*r)+2*r-_t*Tt(a))/(2*St(2*r)+2+_t*St(a)*wr*St(r));while(Zt(i)>xn&&--o>0);return a=n-wr*Tt(r),[t*(1/St(a)+gR/St(r))/kg,a]};function d1(){return Et(f1).scale(160.857)}function xR(t){var e=0,n=_r(t),r=n(e);return r.parallel=function(o){return arguments.length?n(e=o*tr):e*pi},r}var vR=u1(1,4/_t,_t);function h1(){return Et(vR).scale(152.63)}var Sg=Vt(3);function p1(t,e){return[Sg*t*(2*St(2*e/3)-1)/ad,Sg*ad*Tt(e/3)]}p1.invert=function(t,e){var n=3*Zi(e/(Sg*ad));return[ad*t/(Sg*(2*St(2*n/3)-1)),n]};function m1(){return Et(p1).scale(156.19)}function yR(t){var e=St(t);function n(r,o){return[r*e,(1+e)*br(o/2)]}return n.invert=function(r,o){return[r/e,oc(o/(1+e))*2]},n}function g1(){return xR(yR).scale(124.75)}function x1(t,e){var n=Vt(8/(3*_t));return[n*t*(1-Zt(e)/_t),n*e]}x1.invert=function(t,e){var n=Vt(8/(3*_t)),r=e/n;return[t/(n*(1-Zt(r)/_t)),r]};function v1(){return Et(x1).scale(165.664)}function y1(t,e){var n=Vt(_t*(4+_t));return[2/n*t*(1+Vt(1-4*e*e/(_t*_t))),4/n*e]}y1.invert=function(t,e){var n=Vt(_t*(4+_t))/2;return[t*n/(1+Vt(1-e*e*(4+_t)/(4*_t))),e*n/2]};function _1(){return Et(y1).scale(180.739)}var Cg=St(35*tr);function b1(t,e){var n=br(e/2);return[t*Cg*Vt(1-n*n),(1+Cg)*n]}b1.invert=function(t,e){var n=e/(1+Cg);return[t&&t/(Cg*Vt(1-n*n)),2*oc(n)]};function w1(){return Et(b1).scale(137.152)}function _R(t){var e=1-t,n=i(_t,0)[0]-i(-_t,0)[0],r=i(0,di)[1]-i(0,-di)[1],o=Vt(2*r/n);function i(l,c){var u=St(c),f=Tt(c);return[u/(e+t*u)*l,e*c+t*f]}function a(l,c){var u=i(l,c);return[u[0]*o,u[1]/o]}function s(l){return a(0,l)[1]}return a.invert=function(l,c){var u=sd(s,c),f=l/o*(t+e/St(u));return[f,u]},a}function k1(){var t=.5,e=_r(_R),n=e(t);return n.alpha=function(r){return arguments.length?e(t=+r):t},n.scale(168.725)}function bR(t,e,n,r){var o=Vt(4*_t/(2*n+(1+t-e/2)*Tt(2*n)+(t+e)/2*Tt(4*n)+e/2*Tt(6*n))),i=Vt(r*Tt(n)*Vt((1+t*St(2*n)+e*St(4*n))/(1+t+e))),a=n*l(1);function s(f){return Vt(1+t*St(2*f)+e*St(4*f))}function l(f){var d=f*n;return(2*d+(1+t-e/2)*Tt(2*d)+(t+e)/2*Tt(4*d)+e/2*Tt(6*d))/n}function c(f){return s(f)*Tt(f)}var u=function(f,d){var h=n*sd(l,a*Tt(d)/n,d/_t);isNaN(h)&&(h=n*Xi(d));var p=o*s(h);return[p*i*f/_t*St(h),p/i*Tt(h)]};return u.invert=function(f,d){var h=sd(c,d*i/o);return[f*_t/(St(h)*o*i*s(h)),Zi(n*l(h/n)/a)]},n===0&&(o=Vt(r/_t),u=function(f,d){return[f*o,Tt(d)/o]},u.invert=function(f,d){return[f/o,Zi(d*o)]}),u}function S1(){var t=1,e=0,n=45*tr,r=2,o=_r(bR),i=o(t,e,n,r);return i.a=function(a){return arguments.length?o(t=+a,e,n,r):t},i.b=function(a){return arguments.length?o(t,e=+a,n,r):e},i.psiMax=function(a){return arguments.length?o(t,e,n=+a*tr,r):n*pi},i.ratio=function(a){return arguments.length?o(t,e,n,r=+a):r},i.scale(180.739)}function C1(t,e){return[3/e1*t*Vt(_t*_t/3-e*e),e]}C1.invert=function(t,e){return[e1/3*t/Vt(_t*_t/3-e*e),e]};function A1(){return Et(C1).scale(158.837)}function T1(t,e){var n=e*e,r=n*n,o=n*r;return[t*(.84719-.13063*n+o*o*(-.04515+.05494*n-.02326*r+.00331*o)),e*(1.01183+r*r*(-.02625+.01926*n-.00396*r))]}T1.invert=function(t,e){var n=e,r=25,o,i,a,s;do i=n*n,a=i*i,n-=o=(n*(1.01183+a*a*(-.02625+.01926*i-.00396*a))-e)/(1.01183+a*a*(9*-.02625+11*.01926*i+13*-.00396*a));while(Zt(o)>ps&&--r>0);return i=n*n,a=i*i,s=i*a,[t/(.84719-.13063*i+s*s*(-.04515+.05494*i-.02326*a+.00331*s)),n]};function L1(){return Et(T1).scale(175.295)}var er=[[.9986,-.062],[1,0],[.9986,.062],[.9954,.124],[.99,.186],[.9822,.248],[.973,.31],[.96,.372],[.9427,.434],[.9216,.4958],[.8962,.5571],[.8679,.6176],[.835,.6769],[.7986,.7346],[.7597,.7903],[.7186,.8435],[.6732,.8936],[.6213,.9394],[.5722,.9761],[.5322,1]];er.forEach(function(t){t[1]*=1.593415793900743});function E1(t,e){var n=qi(18,Zt(e)*36/_t),r=wg(n),o=n-r,i=(f=er[r])[0],a=f[1],s=(f=er[++r])[0],l=f[1],c=(f=er[qi(19,++r)])[0],u=f[1],f;return[t*(s+o*(c-i)/2+o*o*(c-2*s+i)/2),Xi(e)*(l+o*(u-a)/2+o*o*(u-2*l+a)/2)]}E1.invert=function(t,e){var n=e*90,r=qi(18,Zt(n/5)),o=hR(0,wg(r));do{var i=er[o][1],a=er[o+1][1],s=er[qi(19,o+2)][1],l=s-i,c=s-2*a+i,u=2*(Zt(e)-a)/l,f=c/l,d=u*(1-f*u*(1-2*f*u));if(d>=0||o===1){n=(e>=0?5:-5)*(d+r);var h=50,p;do r=qi(18,Zt(n)/5),o=wg(r),d=r-o,i=er[o][1],a=er[o+1][1],s=er[qi(19,o+2)][1],n-=(p=Xi(e)*(a+d*(s-i)/2+d*d*(s-2*a+i)/2)-e)*pi;while(Zt(p)>ps&&--h>0);break}}while(--o>=0);var g=er[o][0],m=er[o+1][0],x=er[qi(19,o+2)][0];return[t/(m+d*(x-g)/2+d*d*(x-2*m+g)/2),n*tr]};function M1(){return Et(E1).scale(152.63)}var Ki;(function(t){t.Center="center",t.Bottom="bottom"})(Ki||(Ki={}));var Bt;(function(t){t.Square="square",t.Circle="circle",t.Triangle="triangle",t.Ring="ring"})(Bt||(Bt={}));var zt;(function(t){t.Mercator="Mercator",t.Equirectangular="Equirectangular",t.AzimuthalEqualArea="AzimuthalEqualArea",t.AzimuthalEquidistant="AzimuthalEquidistant",t.Gnomonic="Gnomonic",t.Orthographic="Orthographic",t.Stereographic="Stereographic",t.EqualEarth="EqualEarth",t.AlbersUsa="AlbersUsa",t.Albers="Albers",t.ConicConformal="ConicConformal",t.ConicEqualArea="ConicEqualArea",t.ConicEquidistant="ConicEquidistant",t.TransverseMercator="TransverseMercator",t.NaturalEarth1="NaturalEarth1",t.Bromley="Bromley",t.NaturalEarth2="NaturalEarth2",t.Kavrayskiy7="Kavrayskiy7",t.Hufnagel="Hufnagel",t.FoucautSinusoidal="FoucautSinusoidal",t.Eckert1="Eckert1",t.Eckert3="Eckert3",t.Boggs="Boggs",t.CylindricalStereographic="CylindricalStereographic",t.Craster="Craster",t.Baker="Baker",t.Armadillo="Armadillo",t.Aitoff="Aitoff",t.Fahey="Fahey",t.Robinson="Robinson"})(zt||(zt={}));var Ag={[zt.Mercator]:zb,[zt.Equirectangular]:Gb,[zt.AzimuthalEqualArea]:$b,[zt.AzimuthalEquidistant]:Ob,[zt.Gnomonic]:Yb,[zt.Orthographic]:Zb,[zt.Stereographic]:Qb,[zt.EqualEarth]:Hb,[zt.AlbersUsa]:Ib,[zt.Albers]:td,[zt.ConicConformal]:Fb,[zt.ConicEqualArea]:Ui,[zt.ConicEquidistant]:Wb,[zt.TransverseMercator]:t1,[zt.NaturalEarth1]:qb,[zt.Bromley]:h1,[zt.NaturalEarth2]:L1,[zt.Kavrayskiy7]:A1,[zt.Hufnagel]:S1,[zt.FoucautSinusoidal]:k1,[zt.Eckert1]:v1,[zt.Eckert3]:_1,[zt.Boggs]:d1,[zt.CylindricalStereographic]:g1,[zt.Craster]:m1,[zt.Baker]:l1,[zt.Armadillo]:i1,[zt.Aitoff]:o1,[zt.Fahey]:w1,[zt.Robinson]:M1};var Ze;(function(t){t.Circular="circular",t.Concentric="concentric",t.Parallel="parallel",t.ParallelHorizontal="parallel horizontal",t.Dagre="dagre",t.Force="force",t.Elk="elk",t.Precalculated="precalculated"})(Ze||(Ze={}));var ic;(function(t){t.Dashed="dashed",t.Solid="solid"})(ic||(ic={}));var Qi;(function(t){t.Single="single",t.Double="double"})(Qi||(Qi={}));var he;(function(t){t.Circle="circle",t.Square="square",t.Hexagon="hexagon",t.Triangle="triangle"})(he||(he={}));var Ji;(function(t){t.None="none",t.Greyout="greyout",t.GreyoutNonConnected="greyout-non-connected"})(Ji||(Ji={}));var To;(function(t){t.Center="center",t.Top="top",t.Bottom="bottom",t.Left="left",t.Right="right"})(To||(To={}));function ld(t,e){let n;if(e===void 0)for(let r of t)r!=null&&(n<r||n===void 0&&r>=r)&&(n=r);else{let r=-1;for(let o of t)(o=e(o,++r,t))!=null&&(n<o||n===void 0&&o>=o)&&(n=o)}return n}function ac(t,e){let n;if(e===void 0)for(let r of t)r!=null&&(n>r||n===void 0&&r>=r)&&(n=r);else{let r=-1;for(let o of t)(o=e(o,++r,t))!=null&&(n>o||n===void 0&&o>=o)&&(n=o)}return n}function sc(t,e){let n=0;if(e===void 0)for(let r of t)(r=+r)&&(n+=r);else{let r=-1;for(let o of t)(o=+e(o,++r,t))&&(n+=o)}return n}function Uj(t){return t.target.depth}function R1(t){return t.depth}function P1(t,e){return e-1-t.height}function cd(t,e){return t.sourceLinks.length?t.depth:e-1}function I1(t){return t.targetLinks.length?t.depth:t.sourceLinks.length?ac(t.sourceLinks,Uj)-1:0}function lc(t){return function(){return t}}function wR(t,e){return Tg(t.source,e.source)||t.index-e.index}function kR(t,e){return Tg(t.target,e.target)||t.index-e.index}function Tg(t,e){return t.y0-e.y0}function N1(t){return t.value}function qj(t){return t.index}function Xj(t){return t.nodes}function Zj(t){return t.links}function SR(t,e){let n=t.get(e);if(!n)throw new Error("missing: "+e);return n}function CR({nodes:t}){for(let e of t){let n=e.y0,r=n;for(let o of e.sourceLinks)o.y0=n+o.width/2,n+=o.width;for(let o of e.targetLinks)o.y1=r+o.width/2,r+=o.width}}function Lg(){let t=0,e=0,n=1,r=1,o=24,i=8,a,s=qj,l=cd,c,u,f=Xj,d=Zj,h=6;function p(){let S={nodes:f.apply(null,arguments),links:d.apply(null,arguments)};return g(S),m(S),x(S),y(S),b(S),CR(S),S}p.update=function(S){return CR(S),S},p.nodeId=function(S){return arguments.length?(s=typeof S=="function"?S:lc(S),p):s},p.nodeAlign=function(S){return arguments.length?(l=typeof S=="function"?S:lc(S),p):l},p.nodeSort=function(S){return arguments.length?(c=S,p):c},p.nodeWidth=function(S){return arguments.length?(o=+S,p):o},p.nodePadding=function(S){return arguments.length?(i=a=+S,p):i},p.nodes=function(S){return arguments.length?(f=typeof S=="function"?S:lc(S),p):f},p.links=function(S){return arguments.length?(d=typeof S=="function"?S:lc(S),p):d},p.linkSort=function(S){return arguments.length?(u=S,p):u},p.size=function(S){return arguments.length?(t=e=0,n=+S[0],r=+S[1],p):[n-t,r-e]},p.extent=function(S){return arguments.length?(t=+S[0][0],n=+S[1][0],e=+S[0][1],r=+S[1][1],p):[[t,e],[n,r]]},p.iterations=function(S){return arguments.length?(h=+S,p):h};function g({nodes:S,links:k}){for(let[N,R]of S.entries())R.index=N,R.sourceLinks=[],R.targetLinks=[];let P=new Map(S.map((N,R)=>[s(N,R,S),N]));for(let[N,R]of k.entries()){R.index=N;let{source:O,target:W}=R;typeof O!="object"&&(O=R.source=SR(P,O)),typeof W!="object"&&(W=R.target=SR(P,W)),O.sourceLinks.push(R),W.targetLinks.push(R)}if(u!=null)for(let{sourceLinks:N,targetLinks:R}of S)N.sort(u),R.sort(u)}function m({nodes:S}){for(let k of S)k.value=k.fixedValue===void 0?Math.max(sc(k.sourceLinks,N1),sc(k.targetLinks,N1)):k.fixedValue}function x({nodes:S}){let k=S.length,P=new Set(S),N=new Set,R=0;for(;P.size;){for(let O of P){O.depth=R;for(let{target:W}of O.sourceLinks)N.add(W)}if(++R>k)throw new Error("circular link");P=N,N=new Set}}function y({nodes:S}){let k=S.length,P=new Set(S),N=new Set,R=0;for(;P.size;){for(let O of P){O.height=R;for(let{source:W}of O.targetLinks)N.add(W)}if(++R>k)throw new Error("circular link");P=N,N=new Set}}function _({nodes:S}){let k=ld(S,R=>R.depth)+1,P=(n-t-o)/(k-1),N=new Array(k);for(let R of S){let O=Math.max(0,Math.min(k-1,Math.floor(l.call(null,R,k))));R.layer=O,R.x0=t+O*P,R.x1=R.x0+o,N[O]?N[O].push(R):N[O]=[R]}if(c)for(let R of N)R.sort(c);return N}function v(S){let k=ac(S,P=>(r-e-(P.length-1)*a)/sc(P,N1));for(let P of S){let N=e;for(let R of P){R.y0=N,R.y1=N+R.value*k,N=R.y1+a;for(let O of R.sourceLinks)O.width=O.value*k}N=(r-N+a)/(P.length+1);for(let R=0;R<P.length;++R){let O=P[R];O.y0+=N*(R+1),O.y1+=N*(R+1)}F(P)}}function b(S){let k=_(S);a=Math.min(i,(r-e)/(ld(k,P=>P.length)-1)),v(k);for(let P=0;P<h;++P){let N=Math.pow(.99,P),R=Math.max(1-N,(P+1)/h);A(k,N,R),w(k,N,R)}}function w(S,k,P){for(let N=1,R=S.length;N<R;++N){let O=S[N];for(let W of O){let Y=0,J=0;for(let{source:et,value:xt}of W.targetLinks){let Z=xt*(W.layer-et.layer);Y+=$(et,W)*Z,J+=Z}if(!(J>0))continue;let nt=(Y/J-W.y0)*k;W.y0+=nt,W.y1+=nt,D(W)}c===void 0&&O.sort(Tg),L(O,P)}}function A(S,k,P){for(let N=S.length,R=N-2;R>=0;--R){let O=S[R];for(let W of O){let Y=0,J=0;for(let{target:et,value:xt}of W.sourceLinks){let Z=xt*(et.layer-W.layer);Y+=T(W,et)*Z,J+=Z}if(!(J>0))continue;let nt=(Y/J-W.y0)*k;W.y0+=nt,W.y1+=nt,D(W)}c===void 0&&O.sort(Tg),L(O,P)}}function L(S,k){let P=S.length>>1,N=S[P];I(S,N.y0-a,P-1,k),E(S,N.y1+a,P+1,k),I(S,r,S.length-1,k),E(S,e,0,k)}function E(S,k,P,N){for(;P<S.length;++P){let R=S[P],O=(k-R.y0)*N;O>1e-6&&(R.y0+=O,R.y1+=O),k=R.y1+a}}function I(S,k,P,N){for(;P>=0;--P){let R=S[P],O=(R.y1-k)*N;O>1e-6&&(R.y0-=O,R.y1-=O),k=R.y0-a}}function D({sourceLinks:S,targetLinks:k}){if(u===void 0){for(let{source:{sourceLinks:P}}of k)P.sort(kR);for(let{target:{targetLinks:P}}of S)P.sort(wR)}}function F(S){if(u===void 0)for(let{sourceLinks:k,targetLinks:P}of S)k.sort(kR),P.sort(wR)}function $(S,k){let P=S.y0-(S.sourceLinks.length-1)*a/2;for(let{target:N,width:R}of S.sourceLinks){if(N===k)break;P+=R+a}for(let{source:N,width:R}of k.targetLinks){if(N===S)break;P-=R}return P}function T(S,k){let P=k.y0-(k.targetLinks.length-1)*a/2;for(let{source:N,width:R}of k.targetLinks){if(N===S)break;P+=R+a}for(let{target:N,width:R}of S.sourceLinks){if(N===k)break;P-=R}return P}return p}var Lo;(function(t){t.Inline="inline",t.Below="below"})(Lo||(Lo={}));var nr;(function(t){t.Left="left",t.Right="right",t.Center="center",t.Justify="justify"})(nr||(nr={}));var AR={[nr.Left]:R1,[nr.Right]:P1,[nr.Center]:I1,[nr.Justify]:cd},cc;(function(t){t.Default="default",t.ToAncestor="to ancestor"})(cc||(cc={}));var uc;(function(t){t.Default="default",t.FromAncestor="from ancestor"})(uc||(uc={}));var kr;(function(t){t.XY="xy",t.X="x",t.Y="y"})(kr||(kr={}));var ud;(function(t){t.TopLeft="top-left",t.Center="center"})(ud||(ud={}));var Mn=Object.assign(Object.assign({},Jn),{Line:"line"}),fc;(function(t){t.Horizontal="horizontal",t.Vertical="vertical"})(fc||(fc={}));var Sr;(function(t){t.AbsolutePx="absolute_px",t.AbsolutePercentage="absolute_percentage",t.DataSpace="data_space"})(Sr||(Sr={}));var ms;(function(t){t.Inwards="inwards",t.Outwards="outwards"})(ms||(ms={}));var Eo;(function(t){t.Along="along",t.Perpendicular="perpendicular",t.Straight="straight"})(Eo||(Eo={}));var Eg;(function(t){t.Solid="solid",t.Dash="dash",t.DashDot="dashDot",t.Dot="dot",t.LongDash="longDash",t.LongDashDot="longDashDot",t.LongDashDotDot="longDashDotDot",t.ShortDash="shortDash",t.ShortDashDot="shortDashDot",t.ShortDashDotDot="shortDashDotDot",t.ShortDot="shortDot"})(Eg||(Eg={}));var Rt;(function(t){t.TopLeft="top-left",t.Top="top",t.TopRight="top-right",t.Right="right",t.BottomRight="bottom-right",t.Bottom="bottom",t.BottomLeft="bottom-left",t.Left="left"})(Rt||(Rt={}));var dc;(function(t){t.Horizontal="horizontal",t.Vertical="vertical"})(dc||(dc={}));var it;(function(t){t.TopLeftInside="top-left-inside",t.TopLeftOutside="top-left-outside",t.TopInside="top-inside",t.TopOutside="top-outside",t.TopRightInside="top-right-inside",t.TopRightOutside="top-right-outside",t.RightInside="right-inside",t.RightOutside="right-outside",t.BottomRightInside="bottom-right-inside",t.BottomRightOutside="bottom-right-outside",t.BottomInside="bottom-inside",t.BottomOutside="bottom-outside",t.BottomLeftInside="bottom-left-inside",t.BottomLeftOutside="bottom-left-outside",t.LeftInside="left-inside",t.LeftOutside="left-outside"})(it||(it={}));var Mg;(function(t){t.Horizontal="horizontal",t.Vertical="vertical"})(Mg||(Mg={}));var gs;(function(t){t.Column="column",t.Row="row"})(gs||(gs={}));var TR=Object.assign(Object.assign({},ie),{id:void 0,cursor:void 0,type:t=>t.type,length:t=>t.length,color:t=>t.color,pattern:void 0,lineRow:void 0,lineDuration:void 0,lineWidth:8,lineCap:!1,lineCursor:void 0,showEmptySegments:!1,showEmptySegmentsCorrectPosition:!0,lineStartIcon:void 0,lineStartIconColor:void 0,lineStartIconSize:void 0,lineStartIconArrangement:Ln.Inside,lineEndIcon:void 0,lineEndIconColor:void 0,lineEndIconSize:void 0,lineEndIconArrangement:Ln.Inside,rowHeight:22,alternatingRowColors:!0,showLabels:!1,labelWidth:void 0,maxLabelWidth:120,showRowLabels:void 0,rowLabelFormatter:void 0,rowIcon:void 0,rowLabelStyle:void 0,rowLabelWidth:void 0,rowMaxLabelWidth:void 0,rowLabelTextAlign:qe.Right,rowLabelTrimMode:Ue.Middle,rowLabelMargin:[0,6],rowFillEmptySpace:!0,arrows:void 0,animationLineEnterPosition:void 0,onScroll:void 0});var Y1={};Wt(Y1,{arrow:()=>$g,arrows:()=>z1,background:()=>D1,cssVarDefaults:()=>$1,label:()=>fd,labelBackground:()=>Og,labels:()=>H1,line:()=>Pg,lineEndIcon:()=>Ng,lineGroup:()=>Rg,lineStartIcon:()=>Ig,lines:()=>O1,root:()=>LR,row:()=>Dg,rowIcon:()=>zg,rowIcons:()=>j1,rowOdd:()=>F1,rows:()=>B1,scrollbar:()=>G1,scrollbarBackground:()=>V1,scrollbarHandle:()=>W1,variables:()=>Kj});var LR=M`
|
|
334
|
+
label: timeline-component;
|
|
335
|
+
`,$1={"--vis-timeline-row-even-fill-color":"#FFFFFF","--vis-timeline-row-odd-fill-color":"#F7FAFC","--vis-timeline-row-background-opacity":"1","--vis-timeline-scrollbar-background-color":"#E6E9F3","--vis-timeline-scrollbar-color":"#9EA7B8","--vis-timeline-label-font-size":"12px","--vis-timeline-label-color":"#6C778C","--vis-timeline-label-user-select":"none","--vis-timeline-label-pointer-events":"all","--vis-timeline-arrow-color":"#6C778C","--vis-timeline-arrow-stroke-width":"1.5","--vis-timeline-cursor":"default","--vis-timeline-line-color":"var(--vis-color-main)","--vis-timeline-line-stroke-color":void 0,"--vis-timeline-line-stroke-width":"0","--vis-timeline-line-hover-stroke-width":"0","--vis-timeline-line-hover-stroke-color":"#6C778C","--vis-timeline-row-icon-cursor":"default","--vis-dark-timeline-row-even-fill-color":"#292B34","--vis-dark-timeline-row-odd-fill-color":"#333742","--vis-dark-timeline-scrollbar-background-color":"#292B34","--vis-dark-timeline-scrollbar-color":"#6C778C","--vis-dark-timeline-label-color":"#EFF5F8","--vis-dark-timeline-arrow-color":"#EFF5F8","--vis-dark-timeline-line-hover-stroke-color":"#EFF5F8"},Kj=ze($1);Be($1,LR);var D1=M`
|
|
336
|
+
label: background;
|
|
337
|
+
`,O1=M`
|
|
338
|
+
label: lines;
|
|
339
|
+
`,Rg=M`
|
|
340
|
+
label: line-group;
|
|
341
|
+
`,Pg=M`
|
|
342
|
+
label: line;
|
|
343
|
+
fill: var(--vis-timeline-line-color);
|
|
344
|
+
cursor: var(--vis-timeline-cursor);
|
|
345
|
+
|
|
346
|
+
stroke: var(--vis-timeline-line-stroke-color, var(--vis-timeline-row-even-fill-color));
|
|
347
|
+
stroke-width: var(--vis-timeline-line-stroke-width);
|
|
348
|
+
|
|
349
|
+
&.odd {
|
|
350
|
+
stroke: var(--vis-timeline-line-stroke-color, var(--vis-timeline-row-odd-fill-color));
|
|
351
|
+
}
|
|
352
|
+
|
|
353
|
+
:hover {
|
|
354
|
+
stroke-width: var(--vis-timeline-line-hover-stroke-width);
|
|
355
|
+
stroke: var(--vis-timeline-line-hover-stroke-color);
|
|
356
|
+
}
|
|
357
|
+
`,Ig=M`
|
|
358
|
+
label: line-start-icon;
|
|
359
|
+
`,Ng=M`
|
|
360
|
+
label: line-end-icon;
|
|
361
|
+
`,z1=M`
|
|
362
|
+
label: arrows;
|
|
363
|
+
`,$g=M`
|
|
364
|
+
label: arrow;
|
|
365
|
+
fill: none;
|
|
366
|
+
stroke: var(--vis-timeline-arrow-color);
|
|
367
|
+
stroke-width: var(--vis-timeline-arrow-stroke-width);
|
|
368
|
+
`,B1=M`
|
|
369
|
+
label: rows;
|
|
370
|
+
`,Dg=M`
|
|
371
|
+
label: row;
|
|
372
|
+
fill: var(--vis-timeline-row-even-fill-color);
|
|
373
|
+
opacity: var(--vis-timeline-row-background-opacity);
|
|
374
|
+
`,F1=M`
|
|
375
|
+
label: row-odd;
|
|
376
|
+
fill: var(--vis-timeline-row-odd-fill-color);
|
|
377
|
+
`,G1=M`
|
|
378
|
+
label: scroll-bar;
|
|
379
|
+
`,W1=M`
|
|
380
|
+
label: scroll-bar-handle;
|
|
381
|
+
fill: var(--vis-timeline-scrollbar-color);
|
|
382
|
+
`,V1=M`
|
|
383
|
+
label: scroll-bar-background;
|
|
384
|
+
fill: var(--vis-timeline-scrollbar-background-color);
|
|
385
|
+
`,H1=M`
|
|
386
|
+
label: labels;
|
|
387
|
+
`,fd=M`
|
|
388
|
+
label: label;
|
|
389
|
+
dominant-baseline: middle;
|
|
390
|
+
font-size: var(--vis-timeline-label-font-size);
|
|
391
|
+
fill: var(--vis-timeline-label-color);
|
|
392
|
+
text-anchor: end;
|
|
393
|
+
user-select: var(--vis-timeline-label-user-select);
|
|
394
|
+
pointer-events: var(--vis-timeline-label-pointer-events);
|
|
395
|
+
`,Og=M`
|
|
396
|
+
label: label-background;
|
|
397
|
+
fill: transparent;
|
|
398
|
+
pointer-events: all;
|
|
399
|
+
`,j1=M`
|
|
400
|
+
label: row-icons;
|
|
401
|
+
`,zg=M`
|
|
402
|
+
label: row-icon;
|
|
403
|
+
cursor: var(--vis-timeline-row-icon-cursor);
|
|
404
|
+
`;var U1=(t,e,n,r,o,i)=>{if(!j(t,n,e))return 0;let s=z(t,r,e)||i/2,l=st(t,o,e);return l===Ln.Outside?s:l===Ln.Center?s/2:0};var dd=class t extends ae{constructor(e){super(),this._defaultConfig=TR,this.config=this._defaultConfig,this.events={[t.selectors.background]:{wheel:this._onMouseWheel.bind(this)},[t.selectors.label]:{wheel:this._onMouseWheel.bind(this)},[t.selectors.labelBackground]:{wheel:this._onMouseWheel.bind(this)},[t.selectors.rows]:{wheel:this._onMouseWheel.bind(this)},[t.selectors.line]:{wheel:this._onMouseWheel.bind(this)}},this._scrollBarWidth=5,this._scrollDistance=0,this._scrollBarMargin=5,this._maxScroll=0,this._scrollbarHeight=0,this._labelWidth=0,this._lineIconBleed=[0,0],this._lineBleed=[0,0],this._clipPathId=ll(),e&&this.setConfig(e),this._background=this.g.append("rect").attr("class",D1),this._clipPath=this.g.append("clipPath").attr("id",this._clipPathId),this._clipPath.append("rect"),this._rowsGroup=this.g.append("g").attr("class",B1).style("clip-path",`url(#${this._clipPathId})`),this._arrowsGroup=this.g.append("g").attr("class",z1).style("clip-path",`url(#${this._clipPathId})`),this._linesGroup=this.g.append("g").attr("class",O1).style("clip-path",`url(#${this._clipPathId})`),this._labelsGroup=this.g.append("g").attr("class",H1),this._rowIconsGroup=this.g.append("g").attr("class",j1),this._scrollBarGroup=this.g.append("g").attr("class",G1),this._scrollBarBackground=this._scrollBarGroup.append("rect").attr("class",V1),this._scrollBarHandle=this._scrollBarGroup.append("rect").attr("class",W1);let n=Bf().on("drag",this._onScrollbarDrag.bind(this));this._scrollBarHandle.call(n)}setConfig(e){super.setConfig(e)}setData(e){super.setData(e)}get bleed(){var e,n,r;let{config:o,datamodel:{data:i}}=this,a=this._getRowLabels(i),s=o.rowHeight||this._height/(a.length||1),l=a.some(w=>w.iconHref),c=rt(a.map(w=>w.iconSize||0));if((e=o.showRowLabels)!==null&&e!==void 0?e:o.showLabels){let[w,A]=this._getRowLabelMargin();if((n=o.rowLabelWidth)!==null&&n!==void 0?n:o.labelWidth)this._labelWidth=((r=o.rowLabelWidth)!==null&&r!==void 0?r:o.labelWidth)+w+A;else{let L=a.map(I=>{var D;return this._labelsGroup.append("text").attr("class",fd).text(I.formattedLabel||"").call(Kn,(D=o.rowMaxLabelWidth)!==null&&D!==void 0?D:o.maxLabelWidth,o.rowLabelTrimMode)}),E=rt(L.map(I=>I.node().getBBox().width))||0;L.forEach(I=>I.remove()),this._labelWidth=E?E+w+A:0}}let u=bt(i,(w,A)=>z(w,o.x,A)),f=i.filter((w,A)=>z(w,o.x,A)===u),d=Mu(f,(w,A)=>this._getLineDuration(w,A)),h=i.findIndex(w=>w===f[d]),p=i[h],g=rt(i,(w,A)=>z(w,o.x,A)+this._getLineDuration(w,A)),m=i.filter((w,A)=>z(w,o.x,A)+this._getLineDuration(w,A)===g),x=Mu(m,(w,A)=>this._getLineDuration(w,A)),y=i.findIndex(w=>w===m[x]),_=i[y],v=[1,1];if(o.showEmptySegments&&o.lineCap&&p&&_){let w=z(p,o.x,h),A=z(p,o.x,h)+this._getLineDuration(p,h),L=z(_,o.x,y),E=z(_,o.x,y)+this._getLineDuration(_,y),I=E-w,D=this._getLineWidth(p,h,s),F=this._getLineWidth(_,y,s);(A-w)/I*this._width<D&&(v[0]=o.showEmptySegmentsCorrectPosition?D/2:0),(E-L)/I*this._width<F&&(v[1]=o.showEmptySegmentsCorrectPosition?F/2:F)}this._lineBleed=v;let b=[0,0];return o.lineStartIcon&&(b[0]=rt(i,(w,A)=>U1(w,A,o.lineStartIcon,o.lineStartIconSize,o.lineStartIconArrangement,s))||0),o.lineEndIcon&&(b[1]=rt(i,(w,A)=>U1(w,A,o.lineEndIcon,o.lineEndIconSize,o.lineEndIconArrangement,s))||0),this._lineIconBleed=b,{top:0,bottom:0,left:this._labelWidth+b[0]+(l?c:0)+v[0],right:this._scrollBarWidth+this._scrollBarMargin+b[1]+v[1]}}_render(e){var n,r,o;super._render(e);let{config:i,datamodel:{data:a}}=this,s=tt(e)?e:i.duration,l=this.xScale.range(),c=this.yScale.range(),u=Math.min(...c),f=Math.abs(c[1]-c[0]),d=this._getRowLabels(a),h=d.length,p=i.rowHeight||f/(h||1),g=Fr().range(X2(h)).domain(d.map(B=>B.label)),m=this._prepareLinesData(a,g,p),x={colorFn:this._colorFunction};this._background.attr("width",this._width).attr("height",this._height).attr("opacity",0);let y=this._rowIconsGroup.selectAll(`.${zg}`).data(d.filter(B=>B.iconSize),B=>B?.label),_=y.enter().append("use").attr("class",zg).attr("x",0).attr("width",B=>B.iconSize).attr("height",B=>B.iconSize).attr("y",B=>u+(g(B.label)+.5)*p-B.iconSize/2).style("color",B=>B.iconColor).style("opacity",0);G(_.merge(y),s).attr("href",B=>B.iconHref).attr("x",0).attr("y",B=>u+(g(B.label)+.5)*p-B.iconSize/2).attr("width",B=>B.iconSize).attr("height",B=>B.iconSize).style("color",B=>B.iconColor).style("opacity",1),G(y.exit(),s).style("opacity",0).remove();let v=this._labelsGroup.selectAll(`.${fd}`).data(((n=i.showRowLabels)!==null&&n!==void 0?n:i.showLabels)?d:[],B=>B?.label),[b,w]=this._getRowLabelMargin(),A=i.rowLabelTextAlign===qe.Center?this._labelWidth/2:i.rowLabelTextAlign===qe.Left?this._labelWidth-b:w,L=l[0]-this._lineBleed[0]-this._lineIconBleed[0],E=L-A,I=this._labelsGroup.selectAll(`.${Og}`).data(((r=i.showRowLabels)!==null&&r!==void 0?r:i.showLabels)?d:[],B=>B?.label);I.enter().append("rect").attr("class",Og).attr("x",L-this._labelWidth).attr("y",B=>u+g(B.label)*p).attr("width",this._labelWidth).attr("height",p).merge(I).attr("x",L-this._labelWidth).attr("y",B=>u+g(B.label)*p).attr("width",this._labelWidth).attr("height",p),I.exit().remove();let $=v.enter().append("text").attr("class",fd).attr("x",E).attr("y",B=>u+(g(B.label)+.5)*p).style("opacity",0).merge(v).text(B=>B.formattedLabel).each((B,H,lt)=>{var ct,gt;let ot=U(lt[H]),Q=((ct=i.rowLabelWidth)!==null&&ct!==void 0?ct:i.labelWidth)||((gt=i.rowMaxLabelWidth)!==null&>!==void 0?gt:i.maxLabelWidth);Kn(ot,Q,i.rowLabelTrimMode);let yt=st(B,i.rowLabelStyle);if(Dr(yt))for(let[ne,Ne]of Object.entries(yt))ot.style(ne,Ne)}).style("text-anchor",km(i.rowLabelTextAlign));G($,s).attr("x",E).attr("y",B=>u+(g(B.label)+.5)*p).style("opacity",1),G(v.exit(),s).style("opacity",0).remove();let T=l[1]-l[0]+this._lineIconBleed[0]+this._lineIconBleed[1]+this._lineBleed[0]+this._lineBleed[1],S=i.rowFillEmptySpace?Math.max(Math.floor(f/p),h):h,k=Array(S).fill(null).map((B,H)=>d[H]),P=this._rowsGroup.selectAll(`.${Dg}`).data(k),R=P.enter().append("rect").attr("class",Dg).attr("x",L).attr("width",T).attr("y",(B,H)=>u+H*p).attr("height",p).style("opacity",0).merge(P).classed(F1,i.alternatingRowColors?(B,H)=>!(H%2):null);G(R,s).attr("x",L).attr("width",T).attr("y",(B,H)=>u+H*p).attr("height",p).style("opacity",1),G(P.exit(),s).style("opacity",0).remove();let O=this._linesGroup.selectAll(`.${Rg}`).data(m,B=>B._id),W=O.enter().append("g").attr("class",Rg).style("opacity",0).attr("transform",(B,H)=>{var lt,ct;let gt=ge(i.animationLineEnterPosition)?i.animationLineEnterPosition(B,H,m):i.animationLineEnterPosition,[ot,Q]=[(lt=gt?.[0])!==null&<!==void 0?lt:B._xPx,(ct=gt?.[1])!==null&&ct!==void 0?ct:B._yPx];return`translate(${ot}, ${Q})`});W.append("rect").attr("class",Pg).attr(xe,(B,H)=>g(this._getRecordKey(B,H))).style("fill",(B,H)=>K(B,i.color,g(this._getRecordKey(B,H)),void 0,x)).style("mask",(B,H)=>Ft(Nt(B,i.pattern,g(this._getRecordKey(B,H))))).call(this._renderLines.bind(this),p),W.append("use").attr("class",Ig),W.append("use").attr("class",Ng);let Y=W.merge(O);G(Y,s).attr("transform",B=>`translate(${B._xPx+B._xOffsetPx}, ${B._yPx})`).style("opacity",1);let J=Y.selectAll(`.${Pg}`).data(B=>[B]);G(J,s).style("fill",(B,H)=>K(B,i.color,g(this._getRecordKey(B,H)),void 0,x)).style("mask",(B,H)=>Ft(Nt(B,i.pattern,g(this._getRecordKey(B,H))))).style("cursor",(B,H)=>{var lt;return j(B,(lt=i.lineCursor)!==null&<!==void 0?lt:i.cursor,H)}).call(this._renderLines.bind(this),p),Y.selectAll(`.${Ig}`).data(B=>[B]).attr("href",(B,H)=>j(B,i.lineStartIcon,H)).attr("x",B=>{let H=B._startIconSize,lt=B._startIconArrangement;return lt===Ln.Inside?0:lt===Ln.Center?-H/2:-H}).attr("y",B=>-(B._startIconSize-B._height)/2||0).attr("width",B=>B._startIconSize).attr("height",B=>B._startIconSize).style("color",B=>B._startIconColor),Y.selectAll(`.${Ng}`).data(B=>[B]).attr("href",(B,H)=>j(B,i.lineEndIcon,H)).attr("x",B=>{let H=B._lengthCorrected,lt=B._endIconSize,ct=B._endIconArrangement,gt=ct===Ln.Inside?-lt:ct===Ln.Center?-lt/2:0;return H+gt}).attr("y",B=>-((B._endIconSize-B._height)/2)||0).attr("width",B=>B._endIconSize).attr("height",B=>B._endIconSize).style("color",B=>B._endIconColor);let nt=O.exit();G(nt,s).style("opacity",0).attr("transform",(B,H)=>{var lt,ct;let gt=ge(i.animationLineExitPosition)?i.animationLineExitPosition(B,H,m):i.animationLineExitPosition,[ot,Q]=[(lt=gt?.[0])!==null&<!==void 0?lt:B._xPx,(ct=gt?.[1])!==null&&ct!==void 0?ct:B._yPx];return`translate(${ot}, ${Q})`}).remove();let et=this._prepareArrowsData(a,g,p),xt=this._arrowsGroup.selectAll(`.${$g}`).data(et??[],B=>B.id),Z=xt.enter().append("path").attr("class",$g).style("opacity",0);G(Z.merge(xt),s).attr("d",B=>{var H,lt;return _M(B._points,(H=B.arrowHeadLength)!==null&&H!==void 0?H:8,(lt=B.arrowHeadWidth)!==null&<!==void 0?lt:6)}).style("opacity",1),G(xt.exit(),s).style("opacity",0).remove();let vt=k.length*p;this._scrollbarHeight=f*f/vt||0,this._maxScroll=Math.max(vt-f,0),this._scrollBarGroup.attr("transform",`translate(${this._width-this._scrollBarWidth}, ${u})`).attr("opacity",this._maxScroll?1:0),this._scrollBarBackground.attr("width",this._scrollBarWidth).attr("height",this._height).attr("rx",this._scrollBarWidth/2).attr("ry",this._scrollBarWidth/2),this._scrollBarHandle.attr("width",this._scrollBarWidth).attr("height",this._scrollbarHeight).attr("rx",this._scrollBarWidth/2).attr("ry",this._scrollBarWidth/2),this._updateScrollPosition(0);let X=(o=rt(et??[],B=>{var H;return(H=B.arrowHeadWidth)!==null&&H!==void 0?H:6}))!==null&&o!==void 0?o:0,at=this._clipPath.select("rect");G(at,at.attr("width")?s:0).attr("x",L-X/2).attr("width",T+X).attr("height",this._height)}_getRowLabelMargin(){let e=this.config.rowLabelMargin;return Array.isArray(e)?e:[e,e]}_getLineLength(e,n){var r,o;let{config:i,xScale:a}=this,s=z(e,i.x,n),l=(o=z(e,(r=i.lineDuration)!==null&&r!==void 0?r:i.length,n))!==null&&o!==void 0?o:0;return a(s+l)-a(s)}_getLineWidth(e,n,r){var o;let{config:i}=this;return(o=z(e,i.lineWidth,n))!==null&&o!==void 0?o:Math.max(Math.floor(r/2),1)}_getLineDuration(e,n){var r,o;let{config:i}=this;return(o=z(e,(r=i.lineDuration)!==null&&r!==void 0?r:i.length,n))!==null&&o!==void 0?o:0}_prepareLinesData(e,n,r){let{config:o,xScale:i,yScale:a}=this,s=a.range(),l=Math.min(...s);return e.map((c,u)=>{var f,d,h,p,g;let m=(f=j(c,o.id,u))!==null&&f!==void 0?f:[this._getRecordKey(c,u),z(c,o.x,u)].join("-"),x=this._getLineWidth(c,u,r),y=this._getLineLength(c,u);y<0&&console.warn("Unovis | Timeline: Line segments should not have negative lengths. Setting to 0.");let _=o.showEmptySegments?Math.max(o.lineCap?x:1,y):Math.max(0,y),v=i(z(c,o.x,u)),b=l+n(this._getRecordKey(c,u))*r+(r-x)/2,A=o.showEmptySegments&&o.showEmptySegmentsCorrectPosition&&o.lineCap&&y<x?-(_-y)/2:0;return Object.assign(Object.assign({},c),{_id:m,_xPx:v,_yPx:b,_xOffsetPx:A,_length:y,_height:x,_lengthCorrected:_,_startIconSize:(d=z(c,o.lineStartIconSize,u))!==null&&d!==void 0?d:x,_endIconSize:(h=z(c,o.lineEndIconSize,u))!==null&&h!==void 0?h:x,_startIconColor:j(c,o.lineStartIconColor,u),_endIconColor:j(c,o.lineEndIconColor,u),_startIconArrangement:(p=st(c,o.lineStartIconArrangement,u))!==null&&p!==void 0?p:Ln.Outside,_endIconArrangement:(g=st(c,o.lineEndIconArrangement,u))!==null&&g!==void 0?g:Ln.Outside})})}_prepareArrowsData(e,n,r){var o;let{config:i}=this;return(o=i.arrows)===null||o===void 0?void 0:o.map(s=>{var l,c,u,f,d;let h=e.findIndex((R,O)=>j(R,i.id,O)===s.lineSourceId),p=e.findIndex((R,O)=>j(R,i.id,O)===s.lineTargetId),g=e[h],m=e[p];if(!g||!m){console.warn("Unovis | Timeline: Arrow references a non-existent line. Skipping...",s);return}let x=n(this._getRecordKey(g,h))*r+r/2,y=n(this._getRecordKey(m,p))*r+r/2,_=this._getLineWidth(g,h,r),v=this._getLineWidth(m,p,r),b=(s.xSource?this.xScale(s.xSource):this.xScale(z(g,i.x,h))+this._getLineLength(g,h))+((l=s.xSourceOffsetPx)!==null&&l!==void 0?l:0),w=this._getLineLength(m,p),A=i.showEmptySegments&&i.lineCap&&w<v,L=this.xScale(z(m,i.x,p))+(A?-v/2:0),E=(s.xTarget?this.xScale(s.xTarget):L)+((c=s.xTargetOffsetPx)!==null&&c!==void 0?c:0),I=E<L||E>L,D=(u=s.lineSourceMarginPx)!==null&&u!==void 0?u:3,F=(f=s.lineTargetMarginPx)!==null&&f!==void 0?f:3,$=x<y?x+_/2+D:x-_/2-D,T=x<y?y-v/2-F:y+v/2+F,S=(d=s.arrowHeadLength)!==null&&d!==void 0?d:8,k=b<E&&!I,P=S+(k?F:0),N=[[b,$]];if(Math.abs(E-b)>P)if(k)N.push([b,($+y)/2]),N.push([b,y]),N.push([E-F,y]);else{let R=Math.sign(y-x)*(r/4);N.push([b,T-R]),N.push([E,T-R]),N.push([E,T])}else{let R=(T-$)/4;N.push([b,$+R]),N.push([b,$+3*R]),N.push([b,T])}return Object.assign(Object.assign({},s),{_points:N})}).filter(Boolean)}_renderLines(e){let{config:n}=this;e.attr("width",r=>r._lengthCorrected).attr("height",r=>r._height).attr("rx",r=>n.lineCap?r._height/2:null)}_onScrollbarDrag(e){let n=this.yScale.range(),r=Math.abs(n[1]-n[0]);this._updateScrollPosition(e.dy*this._maxScroll/(r-this._scrollbarHeight))}_onMouseWheel(e,n){var r;let{config:o}=this;this._updateScrollPosition(n?.deltaY),this._scrollDistance>0&&this._scrollDistance<this._maxScroll&&n?.preventDefault(),(r=o.onScroll)===null||r===void 0||r.call(o,this._scrollDistance);let i=new Event("mousemove");this.element.dispatchEvent(i)}_updateScrollPosition(e){let n=this.yScale.range(),r=Math.abs(n[1]-n[0]);this._scrollDistance+=e,this._scrollDistance=Math.max(0,this._scrollDistance),this._scrollDistance=Math.min(this._maxScroll,this._scrollDistance),this._clipPath.attr("transform",`translate(0,${this._scrollDistance})`),this._linesGroup.attr("transform",`translate(0,${-this._scrollDistance})`),this._rowsGroup.attr("transform",`translate(0,${-this._scrollDistance})`),this._labelsGroup.attr("transform",`translate(0,${-this._scrollDistance})`),this._rowIconsGroup.attr("transform",`translate(0,${-this._scrollDistance})`),this._arrowsGroup.attr("transform",`translate(0,${-this._scrollDistance})`);let o=this._scrollDistance/this._maxScroll*(r-this._scrollbarHeight)||0;this._scrollBarHandle.attr("y",o)}_getRecordKey(e,n){var r;return j(e,(r=this.config.lineRow)!==null&&r!==void 0?r:this.config.type)||`__${n}`}_getRowLabels(e){let n=co(e,(o,i)=>{var a;return j(o,(a=this.config.lineRow)!==null&&a!==void 0?a:this.config.type)||`${i+1}`});return Object.entries(n).map(([o,i],a)=>{var s,l,c,u,f;let d=(l=(s=this.config).rowIcon)===null||l===void 0?void 0:l.call(s,o,i,a);return{label:o,formattedLabel:(f=(u=(c=this.config).rowLabelFormatter)===null||u===void 0?void 0:u.call(c,o,i,a))!==null&&f!==void 0?f:o,iconHref:d?.href,iconSize:d?.size,iconColor:d?.color,data:i}})}getXDataExtent(){let{config:e,datamodel:n}=this,r=Ia(n.data,e.x),o=Na(n.data,(i,a)=>{var s,l;return z(i,e.x,a)+((l=z(i,(s=e.lineDuration)!==null&&s!==void 0?s:e.length,a))!==null&&l!==void 0?l:0)});return[r,o]}};dd.selectors=Y1;var ER=Object.assign(Object.assign({},ie),{color:void 0,median:void 0,quartiles:void 0,whiskers:void 0,barWidth:void 0,barMaxWidth:void 0,dataStep:void 0,barPadding:.25,roundedCorners:2,cursor:null});var Z1={};Wt(Z1,{box:()=>Fg,boxGroup:()=>Bg,boxGroupExit:()=>X1,cssVarDefaults:()=>q1,median:()=>Gg,root:()=>MR,variables:()=>Cr,whisker:()=>hd,whiskerCap:()=>pd});var MR=M`
|
|
405
|
+
label: boxplot-component;
|
|
406
|
+
`,q1={"--vis-boxplot-cursor":"default","--vis-boxplot-fill-color":"var(--vis-color-main)","--vis-boxplot-fill-opacity":"0.2","--vis-boxplot-stroke-color":"var(--vis-color-main)","--vis-boxplot-stroke-width":"1.5px","--vis-boxplot-median-stroke-color":"var(--vis-color-main)","--vis-boxplot-median-stroke-width":"1.5px","--vis-boxplot-whisker-stroke-color":"var(--vis-color-main)","--vis-boxplot-whisker-stroke-width":"1.5px","--vis-dark-boxplot-fill-color":"var(--vis-color-main)","--vis-dark-boxplot-stroke-color":"var(--vis-color-main)","--vis-dark-boxplot-median-stroke-color":"var(--vis-color-main)","--vis-dark-boxplot-whisker-stroke-color":"var(--vis-color-main)"},Cr=ze(q1);Be(q1,MR);var Bg=M`
|
|
407
|
+
label: boxGroup;
|
|
408
|
+
`,X1=M`
|
|
409
|
+
label: boxGroupExit;
|
|
410
|
+
`,Fg=M`
|
|
411
|
+
label: box;
|
|
412
|
+
fill: var(${Cr.boxplotFillColor});
|
|
413
|
+
fill-opacity: var(${Cr.boxplotFillOpacity});
|
|
414
|
+
stroke: var(${Cr.boxplotStrokeColor});
|
|
415
|
+
stroke-width: var(${Cr.boxplotStrokeWidth});
|
|
416
|
+
cursor: var(${Cr.boxplotCursor});
|
|
417
|
+
`,Gg=M`
|
|
418
|
+
label: median;
|
|
419
|
+
stroke: var(${Cr.boxplotMedianStrokeColor});
|
|
420
|
+
stroke-width: var(${Cr.boxplotMedianStrokeWidth});
|
|
421
|
+
`,hd=M`
|
|
422
|
+
label: whisker;
|
|
423
|
+
stroke: var(${Cr.boxplotWhiskerStrokeColor});
|
|
424
|
+
stroke-width: var(${Cr.boxplotWhiskerStrokeWidth});
|
|
425
|
+
`,pd=M`
|
|
426
|
+
label: whiskerCap;
|
|
427
|
+
stroke: var(${Cr.boxplotWhiskerStrokeColor});
|
|
428
|
+
stroke-width: var(${Cr.boxplotWhiskerStrokeWidth});
|
|
429
|
+
`;var md=class extends ae{constructor(e){super(),this._defaultConfig=ER,this.config=this._defaultConfig,this.events={},this._boxData=[],e&&this.setConfig(e)}get bleed(){if(this._boxData=this._getVisibleData(),this._boxData.length===0)return{top:0,bottom:0,left:0,right:0};let e=this.xScale.domain(),n=this._getBarWidth()/2,r=this._boxData.map((h,p)=>z(h,this.config.x,p)),o=bt(r),i=rt(r),a=this.xScale(o),s=this.xScale(i),l=this.xScale.invert(a-n),c=this.xScale.invert(s+n),u=l<=e[0]?this.xScale(e[0])-this.xScale(l):0,f=c>e[1]?this.xScale(c)-this.xScale(e[1]):0,d=2;return{top:0,bottom:0,left:u+d,right:f+d}}_render(e){let{config:n}=this,r=tt(e)?e:n.duration,o=this._getBarWidth();Jo(this._boxData)&&(this._boxData=this._getVisibleData());let i=this._boxData.map((f,d)=>({datum:f,index:d,median:z(f,n.median,d),quartiles:st(f,n.quartiles,d),whiskers:st(f,n.whiskers,d)})),a=this.g.selectAll(`.${Bg}`).data(i,f=>{var d;return`${(d=j(f.datum,n.id,f.index))!==null&&d!==void 0?d:f.index}`}),s=f=>`translate(${this.xScale(z(f.datum,n.x,f.index))},0)`,l=a.enter().append("g").attr("class",Bg).attr("transform",s).style("opacity",0);l.append("path").attr("class",Fg),l.append("line").attr("class",hd).attr("data-end","lower"),l.append("line").attr("class",hd).attr("data-end","upper"),l.append("line").attr("class",pd).attr("data-end","lower"),l.append("line").attr("class",pd).attr("data-end","upper"),l.append("line").attr("class",Gg),l.each((f,d,h)=>{this._renderBox(U(h[d]),f,o,0)});let c=l.merge(a);G(c,r).attr("transform",s).style("opacity",1),a.each((f,d,h)=>{this._renderBox(U(h[d]),f,o,r)});let u=a.exit().attr("class",X1);G(u,r).style("opacity",0).remove().on("interrupt",function(){this.remove()})}_renderBox(e,n,r,o){let{config:i}=this,a=-r/2,s=r/2,l=Array.isArray(n.quartiles)&&Number.isFinite(n.quartiles[0])&&Number.isFinite(n.quartiles[1]),c=Number.isFinite(n.median),u=l&&Array.isArray(n.whiskers)&&Number.isFinite(n.whiskers[0])&&Number.isFinite(n.whiskers[1]),f=i.color?K(n.datum,i.color,n.index):null,d=e.select(`.${Fg}`).style("fill",f).style("stroke",f),h=G(d,o).style("opacity",l?1:0);if(l){let _=this.yScale(n.quartiles[1]),v=this.yScale(n.quartiles[0]),b=Math.abs(v-_),w=i.roundedCorners?tt(i.roundedCorners)?+i.roundedCorners:r/2:0,A=mt(w,0,Math.min(b,r)/2);h.attr("d",Vi({x:a,y:Math.min(_,v),w:r,h:b,tl:!0,tr:!0,bl:!0,br:!0,r:A}))}let p=G(e.select(`.${Gg}`).style("stroke",f),o).style("opacity",c?1:0);if(c){let _=this.yScale(n.median);p.attr("x1",a).attr("x2",a+r).attr("y1",_).attr("y2",_)}let g=u?this.yScale(n.whiskers[0]):0,m=u?this.yScale(n.whiskers[1]):0,x=l?this.yScale(n.quartiles[0]):0,y=l?this.yScale(n.quartiles[1]):0;e.selectAll(`.${hd}`).each((_,v,b)=>{let w=U(b[v]).style("stroke",f),A=w.attr("data-end")==="lower",L=G(w,o).style("opacity",u?1:0);u&&L.attr("x1",0).attr("x2",0).attr("y1",A?x:y).attr("y2",A?g:m)}),e.selectAll(`.${pd}`).each((_,v,b)=>{let w=U(b[v]).style("stroke",f),A=w.attr("data-end")==="lower",L=G(w,o).style("opacity",u?1:0);if(u){let E=A?g:m;L.attr("x1",-s/2).attr("x2",s/2).attr("y1",E).attr("y2",E)}})}_getBarWidth(){let{config:e,datamodel:{data:n}}=this;if(Jo(n))return 0;if(e.barWidth)return bt([e.barWidth,e.barMaxWidth]);let r=this.xScale.domain(),i=1+(r[1]-r[0])/e.dataStep||n.filter((l,c)=>{let u=z(l,e.x,c);return u>=r[0]&&u<=r[1]}).length||n.length;i>=2&&(i+=1);let s=(i<2?1:1-e.barPadding)*this._width/i;return bt([s,e.barMaxWidth])}_getVisibleData(){let{config:e,datamodel:{data:n}}=this,r=this.xScale.domain(),o=+r[0],i=+r[1];return n?.filter((a,s)=>{let l=z(a,e.x,s);return l>=o&&l<=i})}getValueScaleExtent(e){let{config:n,datamodel:r}=this,o=e?this._getVisibleData():r.data,i=[n.median,(a,s)=>{var l;return(l=st(a,n.quartiles,s))===null||l===void 0?void 0:l[0]},(a,s)=>{var l;return(l=st(a,n.quartiles,s))===null||l===void 0?void 0:l[1]},(a,s)=>{var l;return(l=st(a,n.whiskers,s))===null||l===void 0?void 0:l[0]},(a,s)=>{var l;return(l=st(a,n.whiskers,s))===null||l===void 0?void 0:l[1]}];return[Ia(o,...i),Na(o,...i)]}getDataScaleExtent(){let{config:e,datamodel:n}=this;return ur(n.data,e.x)}getYDataExtent(e){return this.getValueScaleExtent(e)}getXDataExtent(){return this.getDataScaleExtent()}};md.selectors=Z1;var RR=Object.assign(Object.assign({},ie),{color:t=>t.color,y:void 0,xPositioning:Sr.DataSpace,yPositioning:Sr.DataSpace,labelFontSize:void 0,label:void 0,backgroundColor:void 0,cursor:null,labelTextBrightnessRatio:.65,clustering:!0,clusterLabel:t=>t.length.toString(),clusterFontSize:void 0,clusterBackgroundColor:void 0,clusterCursor:void 0,clusterLabelColor:null});function IR(t){t.attr("transform",e=>`translate(${e._screen.x},${e._screen.y})`),t.append("rect").style("fill",e=>e._screen.backgroundColor),t.append("text").style("text-anchor","middle").style("dominant-baseline","central").style("fill",e=>e._screen.backgroundColor).style("pointer-events","none"),t.attr("transform",e=>`translate(${e._screen.x},${e._screen.y}) scale(0)`)}function NR(t,e,n){t.each((r,o,i)=>{var a,s;let l=U(i[o]),c=l.select("text"),u=l.select("rect"),f=r._screen.backgroundColor,d=(a=r._screen.labelText)!==null&&a!==void 0?a:"",h=r._screen.fontSize,p=r._screen.labelColor,g=h*1.7,m=h*d.length*.7;if(m<g&&(m=g),G(u,n).attr("width",m).attr("height",g).attr("x",-m/2).attr("y",-g/2).attr("rx",h).attr("ry",h).style("fill",f),!p){let x=(s=Ut(Ei(f)?On(f,l.node()):f))===null||s===void 0?void 0:s.hex();p=zn(x)>e.labelTextBrightnessRatio?"var(--vis-xy-label-text-color-dark)":"var(--vis-xy-label-text-color-light)"}c.html(d).attr("font-size",h),G(c,n).style("fill",p),u.style("cursor",r._screen.cursor)}),G(t,n).attr("transform",r=>`translate(${r._screen.x},${r._screen.y}) scale(1)`)}function $R(t,e){G(t,e).attr("transform",n=>`translate(${n._screen.x},${n._screen.y}) scale(0)`).remove()}function PR(t,e,n){var r;switch(e){case Sr.DataSpace:return(r=n(t))!==null&&r!==void 0?r:0;case Sr.AbsolutePx:return t;case Sr.AbsolutePercentage:{let o=n.range();return o[0]+(o[1]-o[0])*t/100}}}function K1(t,e,n,r,o,i,a){var s,l,c,u;let f={colorFn:a},d=Array.isArray(t),h=d?(s=z(t,n.clusterFontSize))!==null&&s!==void 0?s:ue("var(--vis-xy-label-cluster-font-size)",e):(l=z(t,n.labelFontSize))!==null&&l!==void 0?l:ue("var(--vis-xy-label-font-size)",e),p=(d?j(t,n.clusterLabel):j(t,n.label))||"",g=h*1.7,m=h*p.length*.7;m<g&&(m=g);let x=d?Zo(t,_=>_._screen.x):PR(z(t,n.x),st(t,n.xPositioning),r),y=d?Zo(t,_=>_._screen.y):PR(z(t,n.y),st(t,n.yPositioning),o);return{x,y,fontSize:h,labelText:p,labelColor:d?K(t,n.clusterLabelColor):K(t,n.color,i,(c=n.colorKeys)===null||c===void 0?void 0:c[i],f),backgroundColor:d?K(t,n.clusterBackgroundColor):K(t,n.backgroundColor,i,(u=n.colorKeys)===null||u===void 0?void 0:u[i],f),cursor:d?j(t,n.clusterCursor):j(t,n.cursor),width:m,height:g}}var tw={};Wt(tw,{cluster:()=>Q1,globalStyles:()=>e9,label:()=>J1,labelGroup:()=>Wg,root:()=>n9});var e9=Pt`
|
|
430
|
+
:root {
|
|
431
|
+
--vis-xy-label-cursor: default;
|
|
432
|
+
// Undefined by default to allow proper fallback to var(--vis-color-main)
|
|
433
|
+
/* --vis-xy-label-fill-color */
|
|
434
|
+
--vis-xy-label-stroke-color: none;
|
|
435
|
+
--vis-xy-label-stroke-width: 0px;
|
|
436
|
+
--vis-xy-label-fill-opacity: 1;
|
|
437
|
+
--vis-xy-label-stroke-opacity: 1;
|
|
438
|
+
--vis-xy-label-hover-stroke-width: 1px;
|
|
439
|
+
--vis-xy-label-font-size: 12px;
|
|
440
|
+
--vis-xy-label-cluster-font-size: 14px;
|
|
441
|
+
|
|
442
|
+
--vis-xy-label-text-color-dark: #5b5f6d;
|
|
443
|
+
--vis-xy-label-text-color-light: #fff;
|
|
444
|
+
--vis-xy-label-text-font-weight: 500;
|
|
445
|
+
}
|
|
446
|
+
`,n9=M`
|
|
447
|
+
label: xy-labels-component;
|
|
448
|
+
`,Wg=M`
|
|
449
|
+
label: label-g;
|
|
450
|
+
|
|
451
|
+
> rect, text {
|
|
452
|
+
cursor: var(--vis-xy-label-cursor);
|
|
453
|
+
fill: var(--vis-xy-label-fill-color, var(--vis-color-main));
|
|
454
|
+
fill-opacity: var(--vis-xy-label-fill-opacity);
|
|
455
|
+
stroke-opacity: var(--vis-xy-label-stroke-opacity);
|
|
456
|
+
}
|
|
457
|
+
|
|
458
|
+
> text {
|
|
459
|
+
font-weight: var(--vis-xy-label-text-font-weight);
|
|
460
|
+
user-select: none;
|
|
461
|
+
}
|
|
462
|
+
|
|
463
|
+
> rect {
|
|
464
|
+
stroke-width: var(--vis-xy-label-stroke-width);
|
|
465
|
+
stroke: var(--vis-xy-label-stroke-color);
|
|
466
|
+
|
|
467
|
+
&:hover {
|
|
468
|
+
stroke-width: var(--vis-xy-label-hover-stroke-width);
|
|
469
|
+
}
|
|
470
|
+
}
|
|
471
|
+
`,Q1=M`
|
|
472
|
+
label: cluster;
|
|
473
|
+
`,J1=M`
|
|
474
|
+
label: label;
|
|
475
|
+
`;var gd=class t extends ae{constructor(e){super(),this.clippable=!1,this._defaultConfig=RR,this.config=this._defaultConfig,this.events={[t.selectors.label]:{}},e&&this.setConfig(e)}_render(e){let{config:n}=this,r=tt(e)?e:n.duration,o=this.g.selectAll(`.${Wg}`).data(this._getDataToRender()),i=o.exit();$R(i,r),o.enter().append("g").attr("class",Wg).call(IR).merge(o).classed(Q1,l=>!!l.records).classed(J1,l=>!l.records).call(NR,n,r)}_getDataToRender(){var e,n;let{config:r,datamodel:o}=this,i=this.xScale.range(),a=this.yScale.range(),s=(n=(e=o.data)===null||e===void 0?void 0:e.reduce((l,c,u)=>{let f=st(c,r.xPositioning),d=st(c,r.yPositioning),h=K1(c,this.element,r,this.xScale,this.yScale,u,this._colorFunction);return(f!==Sr.DataSpace||Iu(h.x,i))&&(d!==Sr.DataSpace||Iu(h.y,a))&&l.push(Object.assign(Object.assign({},c),{_screen:h})),l},[]))!==null&&n!==void 0?n:[];return r.clustering?this._getClusteredLabels(s):s}_getClusteredLabels(e){let n=[...e],r=new Map;for(let i=0;i<n.length;i+=1){let a=n[i];for(let s=i+1;s<n.length;s+=1){let l=n[s];uo(a._screen,l._screen)&&(r.has(a)||r.set(a,[a]),r.get(a).push(l),n.splice(s,1),s-=1)}r.has(a)&&(n.splice(i,1),i-=1)}let o=Array.from(r.values()).map(i=>({_screen:K1(i,this.element,this.config,this.xScale,this.yScale,void 0,this._colorFunction),records:i}));return[...n,...o]}};gd.selectors=tw;var DR={[it.TopLeftOutside]:({startX:t,offsetX:e,offsetY:n})=>({x:t-e,y:n,textAnchor:"end",dominantBaseline:"text-before-edge"}),[it.TopLeftInside]:({startX:t,offsetX:e,offsetY:n})=>({x:t+e,y:n,textAnchor:"start",dominantBaseline:"text-before-edge"}),[it.TopOutside]:({startX:t,width:e,offsetY:n})=>({x:t+e/2,y:n,textAnchor:"middle",dominantBaseline:"text-before-edge"}),[it.TopInside]:({startX:t,width:e,offsetY:n})=>({x:t+e/2,y:n,textAnchor:"middle",dominantBaseline:"text-before-edge"}),[it.TopRightOutside]:({startX:t,width:e,offsetX:n,offsetY:r})=>({x:t+e+n,y:r,textAnchor:"start",dominantBaseline:"text-before-edge"}),[it.TopRightInside]:({startX:t,width:e,offsetX:n,offsetY:r})=>({x:t+e-n,y:r,textAnchor:"end",dominantBaseline:"text-before-edge"}),[it.RightOutside]:({startX:t,width:e,height:n,offsetX:r})=>({x:t+e+r,y:n/2,textAnchor:"start",dominantBaseline:"middle"}),[it.RightInside]:({startX:t,width:e,height:n,offsetX:r})=>({x:t+e-r,y:n/2,textAnchor:"end",dominantBaseline:"middle"}),[it.BottomRightOutside]:({startX:t,width:e,height:n,offsetX:r,offsetY:o})=>({x:t+e+r,y:n-o,textAnchor:"start",dominantBaseline:"text-after-edge"}),[it.BottomRightInside]:({startX:t,width:e,height:n,offsetX:r,offsetY:o})=>({x:t+e-r,y:n-o,textAnchor:"end",dominantBaseline:"text-after-edge"}),[it.BottomOutside]:({startX:t,width:e,height:n,offsetY:r})=>({x:t+e/2,y:n-r,textAnchor:"middle",dominantBaseline:"text-after-edge"}),[it.BottomInside]:({startX:t,width:e,height:n,offsetY:r})=>({x:t+e/2,y:n-r,textAnchor:"middle",dominantBaseline:"text-after-edge"}),[it.BottomLeftOutside]:({startX:t,height:e,offsetX:n,offsetY:r})=>({x:t-n,y:e-r,textAnchor:"end",dominantBaseline:"text-after-edge"}),[it.BottomLeftInside]:({startX:t,height:e,offsetX:n,offsetY:r})=>({x:t+n,y:e-r,textAnchor:"start",dominantBaseline:"text-after-edge"}),[it.LeftOutside]:({startX:t,height:e,offsetX:n})=>({x:t-n,y:e/2,textAnchor:"end",dominantBaseline:"middle"}),[it.LeftInside]:({startX:t,height:e,offsetX:n})=>({x:t+n,y:e/2,textAnchor:"start",dominantBaseline:"middle"})},OR={[it.TopLeftOutside]:({startX:t,offsetX:e,offsetY:n})=>({x:t-e,y:n,textAnchor:"end",dominantBaseline:"text-after-edge"}),[it.TopLeftInside]:({startX:t,offsetX:e,offsetY:n})=>({x:t+e,y:n,textAnchor:"end",dominantBaseline:"text-before-edge"}),[it.TopOutside]:({startX:t,width:e,offsetY:n})=>({x:t+e/2,y:n,textAnchor:"end",dominantBaseline:"middle"}),[it.TopInside]:({startX:t,width:e,offsetY:n})=>({x:t+e/2,y:n,textAnchor:"end",dominantBaseline:"middle"}),[it.TopRightOutside]:({startX:t,width:e,offsetX:n,offsetY:r})=>({x:t+e+n,y:r,textAnchor:"end",dominantBaseline:"text-before-edge"}),[it.TopRightInside]:({startX:t,width:e,offsetX:n,offsetY:r})=>({x:t+e-n,y:r,textAnchor:"end",dominantBaseline:"text-after-edge"}),[it.RightOutside]:({startX:t,width:e,height:n,offsetX:r})=>({x:t+e+r,y:n/2,textAnchor:"middle",dominantBaseline:"text-before-edge"}),[it.RightInside]:({startX:t,width:e,height:n,offsetX:r})=>({x:t+e-r,y:n/2,textAnchor:"middle",dominantBaseline:"text-after-edge"}),[it.BottomRightOutside]:({startX:t,width:e,height:n,offsetX:r,offsetY:o})=>({x:t+e+r,y:n-o,textAnchor:"start",dominantBaseline:"text-before-edge"}),[it.BottomRightInside]:({startX:t,width:e,height:n,offsetX:r,offsetY:o})=>({x:t+e-r,y:n-o,textAnchor:"start",dominantBaseline:"text-after-edge"}),[it.BottomOutside]:({startX:t,width:e,height:n,offsetY:r})=>({x:t+e/2,y:n-r,textAnchor:"start",dominantBaseline:"middle"}),[it.BottomInside]:({startX:t,width:e,height:n,offsetY:r})=>({x:t+e/2,y:n-r,textAnchor:"start",dominantBaseline:"middle"}),[it.BottomLeftOutside]:({startX:t,height:e,offsetX:n,offsetY:r})=>({x:t-n,y:e-r,textAnchor:"start",dominantBaseline:"text-after-edge"}),[it.BottomLeftInside]:({startX:t,height:e,offsetX:n,offsetY:r})=>({x:t+n,y:e-r,textAnchor:"start",dominantBaseline:"text-before-edge"}),[it.LeftOutside]:({startX:t,height:e,offsetX:n})=>({x:t-n,y:e/2,textAnchor:"middle",dominantBaseline:"text-after-edge"}),[it.LeftInside]:({startX:t,height:e,offsetX:n})=>({x:t+n,y:e/2,textAnchor:"middle",dominantBaseline:"text-before-edge"})},zR={[it.TopLeftOutside]:({startY:t,offsetX:e,offsetY:n})=>({x:e,y:t-n,textAnchor:"start",dominantBaseline:"text-after-edge"}),[it.TopLeftInside]:({startY:t,offsetX:e,offsetY:n})=>({x:e,y:t+n,textAnchor:"start",dominantBaseline:"text-before-edge"}),[it.TopOutside]:({startX:t,width:e,startY:n,offsetY:r})=>({x:t+e/2,y:n-r,textAnchor:"middle",dominantBaseline:"text-after-edge"}),[it.TopInside]:({startX:t,width:e,startY:n,offsetY:r})=>({x:t+e/2,y:n+r,textAnchor:"middle",dominantBaseline:"text-before-edge"}),[it.TopRightOutside]:({startY:t,width:e,offsetX:n,offsetY:r})=>({x:e-n,y:t-r,textAnchor:"end",dominantBaseline:"text-after-edge"}),[it.TopRightInside]:({startY:t,width:e,offsetX:n,offsetY:r})=>({x:e-n,y:t+r,textAnchor:"end",dominantBaseline:"text-before-edge"}),[it.RightOutside]:({startY:t,height:e,width:n,offsetX:r})=>({x:n-r,y:t+e/2,textAnchor:"end",dominantBaseline:"middle"}),[it.RightInside]:({startY:t,height:e,width:n,offsetX:r})=>({x:n-r,y:t+e/2,textAnchor:"end",dominantBaseline:"middle"}),[it.BottomRightOutside]:({startY:t,height:e,width:n,offsetX:r,offsetY:o})=>({x:n-r,y:t+e+o,textAnchor:"end",dominantBaseline:"text-before-edge"}),[it.BottomRightInside]:({startY:t,height:e,width:n,offsetX:r,offsetY:o})=>({x:n-r,y:t+e-o,textAnchor:"end",dominantBaseline:"text-after-edge"}),[it.BottomOutside]:({startX:t,width:e,startY:n,height:r,offsetY:o})=>({x:t+e/2,y:n+r+o,textAnchor:"middle",dominantBaseline:"text-before-edge"}),[it.BottomInside]:({startX:t,width:e,startY:n,height:r,offsetY:o})=>({x:t+e/2,y:n+r-o,textAnchor:"middle",dominantBaseline:"text-after-edge"}),[it.BottomLeftOutside]:({startY:t,height:e,offsetX:n,offsetY:r})=>({x:n,y:t+e+r,textAnchor:"start",dominantBaseline:"text-before-edge"}),[it.BottomLeftInside]:({startY:t,height:e,offsetX:n,offsetY:r})=>({x:n,y:t+e-r,textAnchor:"start",dominantBaseline:"text-after-edge"}),[it.LeftOutside]:({startY:t,height:e,offsetX:n})=>({x:n,y:t+e/2,textAnchor:"start",dominantBaseline:"middle"}),[it.LeftInside]:({startY:t,height:e,offsetX:n})=>({x:n,y:t+e/2,textAnchor:"start",dominantBaseline:"middle"})},BR={[it.TopLeftOutside]:({startY:t,offsetX:e,offsetY:n})=>({x:e,y:t-n,textAnchor:"start",dominantBaseline:"text-after-edge",rotation:-90}),[it.TopLeftInside]:({startY:t,offsetX:e,offsetY:n})=>({x:e,y:t+n,textAnchor:"end",dominantBaseline:"text-before-edge",rotation:-90}),[it.TopOutside]:({startX:t,width:e,startY:n,offsetY:r})=>({x:t+e/2,y:n-r,textAnchor:"end",dominantBaseline:"middle",rotation:-90}),[it.TopInside]:({startX:t,width:e,startY:n,offsetY:r})=>({x:t+e/2,y:n+r,textAnchor:"end",dominantBaseline:"middle",rotation:-90}),[it.TopRightOutside]:({startY:t,width:e,offsetX:n,offsetY:r})=>({x:e-n,y:t-r,textAnchor:"start",dominantBaseline:"text-after-edge",rotation:-90}),[it.TopRightInside]:({startY:t,width:e,offsetX:n,offsetY:r})=>({x:e-n,y:t+r,textAnchor:"end",dominantBaseline:"text-after-edge",rotation:-90}),[it.RightOutside]:({startY:t,height:e,width:n,offsetX:r})=>({x:n-r,y:t+e/2,textAnchor:"middle",dominantBaseline:"text-after-edge",rotation:-90}),[it.RightInside]:({startY:t,height:e,width:n,offsetX:r})=>({x:n-r,y:t+e/2,textAnchor:"middle",dominantBaseline:"text-after-edge",rotation:-90}),[it.BottomRightOutside]:({startY:t,height:e,width:n,offsetX:r,offsetY:o})=>({x:n-r,y:t+e+o,textAnchor:"start",dominantBaseline:"text-before-edge",rotation:-90}),[it.BottomRightInside]:({startY:t,height:e,width:n,offsetX:r,offsetY:o})=>({x:n-r,y:t+e-o,textAnchor:"start",dominantBaseline:"text-after-edge",rotation:-90}),[it.BottomOutside]:({startX:t,width:e,startY:n,height:r,offsetY:o})=>({x:t+e/2,y:n+r+o,textAnchor:"start",dominantBaseline:"middle",rotation:-90}),[it.BottomInside]:({startX:t,width:e,startY:n,height:r,offsetY:o})=>({x:t+e/2,y:n+r-o,textAnchor:"start",dominantBaseline:"middle",rotation:-90}),[it.BottomLeftOutside]:({startY:t,height:e,offsetX:n,offsetY:r})=>({x:n,y:t+e+r,textAnchor:"end",dominantBaseline:"text-before-edge",rotation:-90}),[it.BottomLeftInside]:({startY:t,height:e,offsetX:n,offsetY:r})=>({x:n,y:t+e-r,textAnchor:"start",dominantBaseline:"text-before-edge",rotation:-90}),[it.LeftOutside]:({startY:t,height:e,offsetX:n})=>({x:n,y:t+e/2,textAnchor:"middle",dominantBaseline:"text-before-edge",rotation:-90}),[it.LeftInside]:({startY:t,height:e,offsetX:n})=>({x:n,y:t+e/2,textAnchor:"middle",dominantBaseline:"text-before-edge",rotation:-90})};var FR=Object.assign(Object.assign({},ie),{axis:kt.Y,from:0,to:0,color:void 0,duration:300,labelPosition:it.TopLeftOutside,labelOffsetX:14,labelOffsetY:14,labelOrientation:Mg.Horizontal});var rw={};Wt(rw,{globalStyles:()=>r9,label:()=>nw,plotband:()=>ew,root:()=>o9});var r9=Pt`
|
|
476
|
+
:root {
|
|
477
|
+
--vis-plotband-color: rgba(255, 255, 90, 0.2);
|
|
478
|
+
--vis-plotband-label-font-size: 12px;
|
|
479
|
+
--vis-plotband-label-color: #000;
|
|
480
|
+
|
|
481
|
+
--vis-dark-plotband-color: rgba(220, 220, 90, 0.2);
|
|
482
|
+
--vis-dark-plotband-label-color: #e5e9f7;
|
|
483
|
+
}
|
|
484
|
+
|
|
485
|
+
${Yt} {
|
|
486
|
+
--vis-plotband-color: var(--vis-dark-plotband-color);
|
|
487
|
+
--vis-plotband-label-color: var(--vis-dark-tooltip-text-color);
|
|
488
|
+
}
|
|
489
|
+
`,o9=M`
|
|
490
|
+
label: plotband-component;
|
|
491
|
+
`,ew=M`
|
|
492
|
+
label: plotband-area;
|
|
493
|
+
transition: opacity 200ms;
|
|
494
|
+
cursor: var(--vis-line-cursor);
|
|
495
|
+
fill: var(--vis-plotband-color);
|
|
496
|
+
`,nw=M`
|
|
497
|
+
label: plotline-label;
|
|
498
|
+
|
|
499
|
+
user-select: none;
|
|
500
|
+
text-anchor: middle;
|
|
501
|
+
pointer-events: none;
|
|
502
|
+
font-size: var(--vis-plotband-label-font-size);
|
|
503
|
+
fill: var(--vis-plotband-label-color);
|
|
504
|
+
`;var xd=class extends ae{constructor(e){super(),this._defaultConfig=FR,e&&this.setConfig(e),this.plotband=this.g.append("rect").attr("class",ew),this.label=this.g.append("text").attr("class",nw)}_render(e){super._render(e);let{config:n}=this;if(this.from=n.from,this.to=n.to,this.plotband.style("fill",n.color),this.from==null||this.to==null)return;let r=0,o=0,i=0,a=0;if(n.axis==="y"){let s=this.yScale(this.from),l=this.yScale(this.to);o=Math.min(s,l),a=Math.abs(s-l),r=0,i=this._width}else{let s=this.xScale(this.from),l=this.xScale(this.to);r=Math.min(s,l),i=Math.abs(s-l),o=0,a=this._height}if(G(this.plotband,n.duration).attr("x",r).attr("y",o).attr("width",i).attr("height",a),n.labelText){let s=this.computeLabel(n.axis,r,o,i,a,n.labelPosition,n.labelOffsetX,n.labelOffsetY,n.labelOrientation);this.label.attr("dominant-baseline",s.dominantBaseline).attr("transform",s.transform).style("text-anchor",s.textAnchor).style("fill",n.labelColor).style("font-size",n.labelSize?`${n.labelSize}px`:void 0),G(this.label,n.duration).text(n.labelText).attr("x",s.x).attr("y",s.y)}G(this.plotband.exit()).style("opacity",0).remove()}computeLabel(e,n,r,o,i,a,s,l,c){let u=c==="vertical",f=u?-90:0,d={startX:n,startY:r,width:o,height:i,offsetX:s,offsetY:l},h;e===kt.X?h=(u?OR:DR)[a](d):h=(u?BR:zR)[a](d);let{x:p,y:g,textAnchor:m,dominantBaseline:x}=h,y=f!==0?`rotate(${f}, ${p}, ${g})`:"";return{x:p,y:g,rotation:f,textAnchor:m,transform:y,dominantBaseline:x}}};xd.selectors=rw;var GR={solid:"none",shortDash:"6,2",shortDot:"2,2",shortDashDot:"6,2,2,2",shortDashDotDot:"6,2,2,2,2,2",dot:"2,6",dash:"8,6",longDash:"16,6",dashDot:"8,6,2,6",longDashDot:"16,6,2,6",longDashDotDot:"16,6,2,6,2,6"},WR={[Rt.TopLeft]:({width:t,offsetX:e,offsetY:n})=>({x:t-e,y:n,textAnchor:"end",dominantBaseline:"text-before-edge"}),[Rt.Top]:({width:t,offsetY:e})=>({x:t,y:e,textAnchor:"middle",dominantBaseline:"text-before-edge"}),[Rt.TopRight]:({width:t,offsetX:e,offsetY:n})=>({x:t+e,y:n,textAnchor:"start",dominantBaseline:"text-before-edge"}),[Rt.Right]:({width:t,height:e,offsetX:n})=>({x:t+n,y:e/2,textAnchor:"start",dominantBaseline:"middle"}),[Rt.BottomRight]:({width:t,height:e,offsetX:n,offsetY:r})=>({x:t+n,y:e-r,textAnchor:"start",dominantBaseline:"text-after-edge"}),[Rt.Bottom]:({width:t,height:e,offsetY:n})=>({x:t,y:e-n,textAnchor:"middle",dominantBaseline:"text-after-edge"}),[Rt.BottomLeft]:({width:t,height:e,offsetX:n,offsetY:r})=>({x:t-n,y:e-r,textAnchor:"end",dominantBaseline:"text-after-edge"}),[Rt.Left]:({width:t,height:e,offsetX:n})=>({x:t-n,y:e/2,textAnchor:"end",dominantBaseline:"middle"})},VR={[Rt.TopLeft]:({width:t,offsetX:e,offsetY:n})=>({x:t-e,y:n,textAnchor:"end",dominantBaseline:"text-after-edge"}),[Rt.Top]:({width:t,offsetY:e})=>({x:t,y:e,textAnchor:"end",dominantBaseline:"middle"}),[Rt.TopRight]:({width:t,offsetX:e,offsetY:n})=>({x:t+e,y:n,textAnchor:"end",dominantBaseline:"text-before-edge"}),[Rt.Right]:({width:t,height:e,offsetX:n})=>({x:t+n,y:e/2,textAnchor:"middle",dominantBaseline:"text-before-edge"}),[Rt.BottomRight]:({width:t,height:e,offsetX:n,offsetY:r})=>({x:t+n,y:e-r,textAnchor:"start",dominantBaseline:"text-before-edge"}),[Rt.Bottom]:({width:t,height:e,offsetY:n})=>({x:t,y:e-n,textAnchor:"start",dominantBaseline:"middle"}),[Rt.BottomLeft]:({width:t,height:e,offsetX:n,offsetY:r})=>({x:t-n,y:e-r,textAnchor:"start",dominantBaseline:"text-after-edge"}),[Rt.Left]:({width:t,height:e,offsetX:n})=>({x:t-n,y:e/2,textAnchor:"middle",dominantBaseline:"text-after-edge"})},HR={[Rt.TopLeft]:({offsetX:t,height:e,offsetY:n})=>({x:t,y:e-n,textAnchor:"start",dominantBaseline:"text-after-edge"}),[Rt.Top]:({width:t,height:e,offsetY:n})=>({x:t/2,y:e-n,textAnchor:"middle",dominantBaseline:"text-after-edge"}),[Rt.TopRight]:({width:t,offsetX:e,height:n,offsetY:r})=>({x:t-e,y:n-r,textAnchor:"end",dominantBaseline:"text-after-edge"}),[Rt.Right]:({width:t,offsetX:e,height:n})=>({x:t-e,y:n,textAnchor:"end",dominantBaseline:"middle"}),[Rt.BottomRight]:({width:t,offsetX:e,height:n,offsetY:r})=>({x:t-e,y:n+r,textAnchor:"end",dominantBaseline:"text-before-edge"}),[Rt.Bottom]:({width:t,height:e,offsetY:n})=>({x:t/2,y:e+n,textAnchor:"middle",dominantBaseline:"text-before-edge"}),[Rt.BottomLeft]:({offsetX:t,height:e,offsetY:n})=>({x:t,y:e+n,textAnchor:"start",dominantBaseline:"text-before-edge"}),[Rt.Left]:({offsetX:t,height:e})=>({x:t,y:e,textAnchor:"start",dominantBaseline:"middle"})},jR={[Rt.TopLeft]:({offsetX:t,height:e,offsetY:n})=>({x:t,y:e-n,textAnchor:"start",dominantBaseline:"text-before-edge"}),[Rt.Top]:({width:t,height:e,offsetY:n})=>({x:t/2,y:e-n,textAnchor:"start",dominantBaseline:"central"}),[Rt.TopRight]:({width:t,offsetX:e,height:n,offsetY:r})=>({x:t-e,y:n-r,textAnchor:"start",dominantBaseline:"text-after-edge"}),[Rt.Right]:({width:t,offsetX:e,height:n})=>({x:t-e,y:n,textAnchor:"middle",dominantBaseline:"text-after-edge"}),[Rt.BottomRight]:({width:t,offsetX:e,height:n,offsetY:r})=>({x:t-e,y:n+r,textAnchor:"end",dominantBaseline:"text-after-edge"}),[Rt.Bottom]:({width:t,height:e,offsetY:n})=>({x:t/2,y:e+n,textAnchor:"end",dominantBaseline:"central"}),[Rt.BottomLeft]:({offsetX:t,height:e,offsetY:n})=>({x:t,y:e+n,textAnchor:"end",dominantBaseline:"text-before-edge"}),[Rt.Left]:({offsetX:t,height:e})=>({x:t,y:e,textAnchor:"middle",dominantBaseline:"text-before-edge"})};var YR=Object.assign(Object.assign({},ie),{lineWidth:2,axis:kt.Y,value:0,duration:300,color:void 0,lineStyle:Eg.Solid,labelPosition:Rt.TopRight,labelOffsetX:14,labelOffsetY:14,labelOrientation:dc.Horizontal});var aw={};Wt(aw,{globalStyles:()=>i9,label:()=>iw,plotline:()=>ow,root:()=>a9});var i9=Pt`
|
|
505
|
+
:root {
|
|
506
|
+
--vis-plotline-color: rgb(226, 32, 58);
|
|
507
|
+
--vis-plotline-width: 2;
|
|
508
|
+
--vis-plotline-dasharray: none;
|
|
509
|
+
--vis-plotline-stroke-dashoffset: 0;
|
|
510
|
+
--vis-plotline-label-font-size: 12px;
|
|
511
|
+
--vis-plotline-label-color: #000;
|
|
512
|
+
|
|
513
|
+
--vis-dark-plotline-label-color: #e5e9f7;
|
|
514
|
+
}
|
|
515
|
+
|
|
516
|
+
${Yt} {
|
|
517
|
+
--vis-plotline-label-color: var(--vis-dark-tooltip-text-color);
|
|
518
|
+
}
|
|
519
|
+
`,a9=M`
|
|
520
|
+
label: plotline-component;
|
|
521
|
+
`,ow=M`
|
|
522
|
+
label: plotline;
|
|
523
|
+
transition: opacity 200ms;
|
|
524
|
+
stroke-linecap: round;
|
|
525
|
+
stroke-linejoin: round;
|
|
526
|
+
stroke: var(--vis-plotline-color);
|
|
527
|
+
stroke-width: var(--vis-plotline-width);
|
|
528
|
+
stroke-dasharray: var(--vis-plotline-dasharray);
|
|
529
|
+
stroke-dashoffset: var(--vis-plotline-stroke-dashoffset);
|
|
530
|
+
`,iw=M`
|
|
531
|
+
label: plotline-label;
|
|
532
|
+
text-anchor: middle;
|
|
533
|
+
/* dominant-baseline: middle; */
|
|
534
|
+
pointer-events: none;
|
|
535
|
+
font-size: var(--vis-plotline-label-font-size);
|
|
536
|
+
fill: var(--vis-plotline-label-color);
|
|
537
|
+
`;var vd=class extends ae{constructor(e){super(),this._defaultConfig=YR,e&&this.setConfig(e),this.plotline=this.g.append("line").attr("class",ow),this.label=this.g.append("text").attr("class",iw)}_render(e){super._render(e);let{config:n}=this;this.value=n.value;let r;typeof n?.lineStyle=="string"?r=GR[n.lineStyle]:Array.isArray(n.lineStyle)?r=n.lineStyle.join(","):r="none",this.value=n.value,this.plotline.attr("stroke-opacity",1).style("stroke-width",n.lineWidth).style("stroke-dasharray",r).style("stroke",n.color);let o=0,i=0,a=0,s=0;if(n.axis===kt.Y?(a=this.yScale(this.value),s=this.yScale(this.value),o=0,i=this._width):(a=0,s=this._height,o=this.xScale(this.value),i=this.xScale(this.value)),G(this.plotline,n.duration).attr("x1",o).attr("x2",i).attr("y1",a).attr("y2",s),n.labelText){let l=this.computeLabel(n.axis,i,s,n.labelPosition,n.labelOffsetX,n.labelOffsetY,n.labelOrientation);this.label.text(n.labelText).attr("transform",l.transform).attr("dominant-baseline",l.dominantBaseline).style("fill",n.labelColor).style("text-anchor",l.textAnchor).style("font-size",n.labelSize?`${n.labelSize}px`:void 0),G(this.label,n.duration).attr("x",l.x).attr("y",l.y)}G(this.plotline.exit()).style("opacity",0).remove()}computeLabel(e,n,r,o,i,a,s){let l=s===dc.Vertical,c=l?-90:0,u;e===kt.X?u=(l?VR:WR)[o]({width:n,height:r,offsetX:i,offsetY:a}):u=(l?jR:HR)[o]({width:n,height:r,offsetX:i,offsetY:a});let f=c?`rotate(${c}, ${u.x}, ${u.y})`:"";return Object.assign(Object.assign({},u),{rotation:c,transform:f})}};vd.selectors=aw;var UR=Object.assign(Object.assign({},Ae),{id:(t,e)=>{var n;return(n=t.id)!==null&&n!==void 0?n:e},value:void 0,angleRange:[0,2*Math.PI],padAngle:0,sortFunction:void 0,cornerRadius:0,color:void 0,pattern:void 0,radius:void 0,arcWidth:20,centralLabel:void 0,centralSubLabel:void 0,centralSubLabelWrap:!0,showEmptySegments:!1,emptySegmentAngle:.5*Math.PI/180,showBackground:!0,backgroundAngleRange:void 0,centralLabelOffsetX:void 0,centralLabelOffsetY:void 0});function qR(t,e){t.attr(xe,n=>n.index).style("fill",n=>K(n.data,e.color,n.index)).style("mask",n=>Ft(Nt(n.data,e.pattern,n.index))).style("opacity",0).each((n,r,o)=>{let i=o[r],a=(n.startAngle+n.endAngle)/2,s=(n.endAngle-n.startAngle)/2;i._animState={startAngle:a-s,endAngle:a+s,innerRadius:n.innerRadius,outerRadius:n.outerRadius,padAngle:n.padAngle}})}function XR(t,e,n,r){t.style("transition",`fill ${r}ms`).attr(xe,i=>i.index).style("fill",i=>K(i.data,e.color,i.index)).style("mask",i=>Ft(Nt(i.data,e.pattern,i.index)));let o=i=>e.showEmptySegments||i.value?1:0;r?G(t,r).style("opacity",o).attrTween("d",(a,s,l)=>{let c=l[s],u={startAngle:a.startAngle,endAngle:a.endAngle,innerRadius:a.innerRadius,outerRadius:a.outerRadius,padAngle:a.padAngle},f=re(c._animState,u);return d=>(c._animState=f(d),n(c._animState))}):t.attr("d",n).style("opacity",o)}function ZR(t,e){G(t,e).style("opacity",0).remove()}var sw=Array.from({length:4},(t,e)=>{let n=-Math.PI/2+e*Math.PI/2;return[n,n+Math.PI]}),[_2t,b2t,w2t,k2t]=sw;var dw={};Wt(dw,{background:()=>lw,centralLabel:()=>uw,centralSubLabel:()=>fw,root:()=>KR,segment:()=>Vg,segmentExit:()=>cw,variables:()=>s9});var KR=M`
|
|
538
|
+
label: donut-component;
|
|
539
|
+
`,s9=Pt`
|
|
540
|
+
:root {
|
|
541
|
+
--vis-donut-central-label-font-size: 16px;
|
|
542
|
+
--vis-donut-central-label-text-color: #5b5f6d;
|
|
543
|
+
// Undefined by default to allow proper fallback to var(--vis-font-family)
|
|
544
|
+
/* --vis-donut-central-label-font-family: */
|
|
545
|
+
--vis-donut-central-label-font-weight: 600;
|
|
546
|
+
|
|
547
|
+
--vis-donut-central-sub-label-font-size: 12px;
|
|
548
|
+
--vis-donut-central-sub-label-text-color: #5b5f6d;
|
|
549
|
+
// Undefined by default to allow proper fallback to var(--vis-font-family)
|
|
550
|
+
/* --vis-donut-central-sub-label-font-family: */
|
|
551
|
+
--vis-donut-central-sub-label-font-weight: 500;
|
|
552
|
+
|
|
553
|
+
--vis-donut-background-color: #E7E9F3;
|
|
554
|
+
--vis-donut-segment-stroke-width: 0;
|
|
555
|
+
// The line segment color variable is not defined by default
|
|
556
|
+
// to allow it to fallback to the donut background color
|
|
557
|
+
/* --vis-donut-segment-stroke-color: none; */
|
|
558
|
+
|
|
559
|
+
--vis-dark-donut-central-label-text-color: #C2BECE;
|
|
560
|
+
--vis-dark-donut-central-sub-label-text-color: #C2BECE;
|
|
561
|
+
--vis-dark-donut-background-color: #18160C;
|
|
562
|
+
}
|
|
563
|
+
|
|
564
|
+
${Yt} ${`.${KR}`} {
|
|
565
|
+
--vis-donut-central-label-text-color: var(--vis-dark-donut-central-label-text-color);
|
|
566
|
+
--vis-donut-central-sub-label-text-color: var(--vis-dark-donut-central-sub-label-text-color);
|
|
567
|
+
--vis-donut-background-color: var(--vis-dark-donut-background-color);
|
|
568
|
+
}
|
|
569
|
+
`,lw=M`
|
|
570
|
+
label: background;
|
|
571
|
+
fill: var(--vis-donut-background-color);
|
|
572
|
+
`,Vg=M`
|
|
573
|
+
label: segment;
|
|
574
|
+
stroke-width: var(--vis-donut-segment-stroke-width);
|
|
575
|
+
stroke: var(--vis-donut-segment-stroke-color, var(--vis-donut-background-color));
|
|
576
|
+
`,cw=M`
|
|
577
|
+
label: segment-exit;
|
|
578
|
+
`,uw=M`
|
|
579
|
+
label: central-label;
|
|
580
|
+
text-anchor: middle;
|
|
581
|
+
dominant-baseline: middle;
|
|
582
|
+
font-size: var(--vis-donut-central-label-font-size);
|
|
583
|
+
font-family: var(--vis-donut-central-label-font-family, var(--vis-font-family));
|
|
584
|
+
font-weight: var(--vis-donut-central-label-font-weight);
|
|
585
|
+
fill: var(--vis-donut-central-label-text-color);
|
|
586
|
+
`,fw=M`
|
|
587
|
+
label: central-label;
|
|
588
|
+
text-anchor: middle;
|
|
589
|
+
dominant-baseline: middle;
|
|
590
|
+
font-size: var(--vis-donut-central-sub-label-font-size);
|
|
591
|
+
font-family: var(--vis-donut-central-sub-label-font-family, var(--vis-font-family));
|
|
592
|
+
font-weight: var(--vis-donut-central-sub-label-font-weight);
|
|
593
|
+
fill: var(--vis-donut-central-sub-label-text-color);
|
|
594
|
+
`;var yd=class extends Te{constructor(e){super(),this._defaultConfig=UR,this.config=this._defaultConfig,this.datamodel=new Fn,this.arcGen=Qn(),this.events={},e&&this.setConfig(e),this.arcBackground=this.g.append("path"),this.arcGroup=this.g.append("g"),this.centralLabel=this.g.append("text").attr("class",uw),this.centralSubLabel=this.g.append("text").attr("class",fw)}get bleed(){return{top:0,bottom:0,left:0,right:0}}_render(e){var n,r,o,i,a,s,l,c,u,f,d,h,p,g;let{config:m,datamodel:x,bleed:y}=this,_=x.data.map((Z,vt)=>({index:vt,datum:Z})).filter(Z=>m.showEmptySegments||z(Z.datum,m.value,Z.index)),v=tt(e)?e:m.duration,[b,w,A,L]=sw.map(Z=>m.angleRange&&m.angleRange[0]===Z[0]&&m.angleRange[1]===Z[1]),E=b||A,I=w||L,D=this._width*(I?2:1),F=this._height*(E?2:1),$=m.radius||Math.min(D-y.left-y.right,F-y.top-y.bottom)/2,T=m.arcWidth===0?0:mt($-m.arcWidth,0,$-1),S=this._height/2+(b?$/2:A?-$/2:0),k=this._width/2+(L?$/2:w?-$/2:0),P=`translate(${k},${S})`;this.arcGroup.attr("transform",P),this.arcGen.startAngle(Z=>Z.startAngle).endAngle(Z=>Z.endAngle).innerRadius(Z=>Z.innerRadius).outerRadius(Z=>Z.outerRadius).padAngle(Z=>Z.padAngle).cornerRadius(m.cornerRadius);let R=ui().startAngle((r=(n=m.angleRange)===null||n===void 0?void 0:n[0])!==null&&r!==void 0?r:0).endAngle((i=(o=m.angleRange)===null||o===void 0?void 0:o[1])!==null&&i!==void 0?i:2*Math.PI).padAngle(m.padAngle).value(Z=>z(Z.datum,m.value,Z.index)||0).sort((Z,vt)=>{var X;return(X=m.sortFunction)===null||X===void 0?void 0:X.call(m,Z.datum,vt.datum)})(_).map(Z=>{let vt=Object.assign(Object.assign({},Z),{data:Z.data.datum,index:Z.data.index,innerRadius:T,outerRadius:$});return m.showEmptySegments&&Z.endAngle-Z.startAngle-Z.padAngle<=Number.EPSILON&&(vt.endAngle=Z.startAngle+Math.max(m.emptySegmentAngle,m.padAngle),vt.padAngle=Z.padAngle/2),vt}),O=this.arcGroup.selectAll(`.${Vg}`).data(R,Z=>m.id(Z.data,Z.index)),W=O.enter().append("path").attr("class",Vg).call(qR,m),Y=O.merge(W);Y.call(XR,m,this.arcGen,v),Y.sort((Z,vt)=>vt.value-Z.value),O.exit().attr("class",cw).call(ZR,v);let J=w?"start":L?"end":"middle";this.centralLabel.attr("dy",m.centralSubLabel?"-0.55em":null).style("text-anchor",J).text((a=m.centralLabel)!==null&&a!==void 0?a:null),this.centralSubLabel.attr("dy",m.centralLabel?"0.55em":null).style("text-anchor",J).text((s=m.centralSubLabel)!==null&&s!==void 0?s:null),m.centralSubLabelWrap&&En(this.centralSubLabel,T*1.9);let nt=(m.centralLabelOffsetX||0)+k,et=(m.centralLabelOffsetY||0)+S;E&&m.centralLabelOffsetX===void 0&&m.centralLabelOffsetY===void 0&&(et=(b?-this.centralSubLabel.node().getBoundingClientRect().height:A?this.centralLabel.node().getBoundingClientRect().height:0)+S);let xt=`translate(${nt},${et})`;this.centralLabel.attr("transform",xt),this.centralSubLabel.attr("transform",xt),this.arcBackground.attr("class",lw).attr("visibility",m.showBackground?null:"hidden").attr("transform",P),G(this.arcBackground,v).attr("d",this.arcGen({startAngle:(f=(c=(l=m.backgroundAngleRange)===null||l===void 0?void 0:l[0])!==null&&c!==void 0?c:(u=m.angleRange)===null||u===void 0?void 0:u[0])!==null&&f!==void 0?f:0,endAngle:(g=(h=(d=m.backgroundAngleRange)===null||d===void 0?void 0:d[1])!==null&&h!==void 0?h:(p=m.angleRange)===null||p===void 0?void 0:p[1])!==null&&g!==void 0?g:2*Math.PI,innerRadius:T,outerRadius:$}))}};yd.selectors=dw;function l9(t){var e=0,n=t.children,r=n&&n.length;if(!r)e=1;else for(;--r>=0;)e+=n[r].value;t.value=e}function QR(){return this.eachAfter(l9)}function JR(t,e){let n=-1;for(let r of this)t.call(e,r,++n,this);return this}function tP(t,e){for(var n=this,r=[n],o,i,a=-1;n=r.pop();)if(t.call(e,n,++a,this),o=n.children)for(i=o.length-1;i>=0;--i)r.push(o[i]);return this}function eP(t,e){for(var n=this,r=[n],o=[],i,a,s,l=-1;n=r.pop();)if(o.push(n),i=n.children)for(a=0,s=i.length;a<s;++a)r.push(i[a]);for(;n=o.pop();)t.call(e,n,++l,this);return this}function nP(t,e){let n=-1;for(let r of this)if(t.call(e,r,++n,this))return r}function rP(t){return this.eachAfter(function(e){for(var n=+t(e.data)||0,r=e.children,o=r&&r.length;--o>=0;)n+=r[o].value;e.value=n})}function oP(t){return this.eachBefore(function(e){e.children&&e.children.sort(t)})}function iP(t){for(var e=this,n=c9(e,t),r=[e];e!==n;)e=e.parent,r.push(e);for(var o=r.length;t!==n;)r.splice(o,0,t),t=t.parent;return r}function c9(t,e){if(t===e)return t;var n=t.ancestors(),r=e.ancestors(),o=null;for(t=n.pop(),e=r.pop();t===e;)o=t,t=n.pop(),e=r.pop();return o}function aP(){for(var t=this,e=[t];t=t.parent;)e.push(t);return e}function sP(){return Array.from(this)}function lP(){var t=[];return this.eachBefore(function(e){e.children||t.push(e)}),t}function cP(){var t=this,e=[];return t.each(function(n){n!==t&&e.push({source:n.parent,target:n})}),e}function*uP(){var t=this,e,n=[t],r,o,i;do for(e=n.reverse(),n=[];t=e.pop();)if(yield t,r=t.children)for(o=0,i=r.length;o<i;++o)n.push(r[o]);while(n.length)}function Ur(t,e){t instanceof Map?(t=[void 0,t],e===void 0&&(e=d9)):e===void 0&&(e=f9);for(var n=new _d(t),r,o=[n],i,a,s,l;r=o.pop();)if((a=e(r.data))&&(l=(a=Array.from(a)).length))for(r.children=a,s=l-1;s>=0;--s)o.push(i=a[s]=new _d(a[s])),i.parent=r,i.depth=r.depth+1;return n.eachBefore(p9)}function u9(){return Ur(this).eachBefore(h9)}function f9(t){return t.children}function d9(t){return Array.isArray(t)?t[1]:null}function h9(t){t.data.value!==void 0&&(t.value=t.data.value),t.data=t.data.data}function p9(t){var e=0;do t.height=e;while((t=t.parent)&&t.height<++e)}function _d(t){this.data=t,this.depth=this.height=0,this.parent=null}_d.prototype=Ur.prototype={constructor:_d,count:QR,each:JR,eachAfter:eP,eachBefore:tP,find:nP,sum:rP,sort:oP,path:iP,ancestors:aP,descendants:sP,leaves:lP,links:cP,copy:u9,[Symbol.iterator]:uP};function fP(t){if(typeof t!="function")throw new Error;return t}function hc(){return 0}function pc(t){return function(){return t}}function dP(){let t=1;return()=>(t=(1664525*t+1013904223)%4294967296)/4294967296}function hP(t){return typeof t=="object"&&"length"in t?t:Array.from(t)}function pP(t,e){let n=t.length,r,o;for(;n;)o=e()*n--|0,r=t[n],t[n]=t[o],t[o]=r;return t}function mP(t,e){for(var n=0,r=(t=pP(Array.from(t),e)).length,o=[],i,a;n<r;)i=t[n],a&&gP(a,i)?++n:(a=g9(o=m9(o,i)),n=0);return a}function m9(t,e){var n,r;if(hw(e,t))return[e];for(n=0;n<t.length;++n)if(Hg(e,t[n])&&hw(bd(t[n],e),t))return[t[n],e];for(n=0;n<t.length-1;++n)for(r=n+1;r<t.length;++r)if(Hg(bd(t[n],t[r]),e)&&Hg(bd(t[n],e),t[r])&&Hg(bd(t[r],e),t[n])&&hw(xP(t[n],t[r],e),t))return[t[n],t[r],e];throw new Error}function Hg(t,e){var n=t.r-e.r,r=e.x-t.x,o=e.y-t.y;return n<0||n*n<r*r+o*o}function gP(t,e){var n=t.r-e.r+Math.max(t.r,e.r,1)*1e-9,r=e.x-t.x,o=e.y-t.y;return n>0&&n*n>r*r+o*o}function hw(t,e){for(var n=0;n<e.length;++n)if(!gP(t,e[n]))return!1;return!0}function g9(t){switch(t.length){case 1:return x9(t[0]);case 2:return bd(t[0],t[1]);case 3:return xP(t[0],t[1],t[2])}}function x9(t){return{x:t.x,y:t.y,r:t.r}}function bd(t,e){var n=t.x,r=t.y,o=t.r,i=e.x,a=e.y,s=e.r,l=i-n,c=a-r,u=s-o,f=Math.sqrt(l*l+c*c);return{x:(n+i+l/f*u)/2,y:(r+a+c/f*u)/2,r:(f+o+s)/2}}function xP(t,e,n){var r=t.x,o=t.y,i=t.r,a=e.x,s=e.y,l=e.r,c=n.x,u=n.y,f=n.r,d=r-a,h=r-c,p=o-s,g=o-u,m=l-i,x=f-i,y=r*r+o*o-i*i,_=y-a*a-s*s+l*l,v=y-c*c-u*u+f*f,b=h*p-d*g,w=(p*v-g*_)/(b*2)-r,A=(g*m-p*x)/b,L=(h*_-d*v)/(b*2)-o,E=(d*x-h*m)/b,I=A*A+E*E-1,D=2*(i+w*A+L*E),F=w*w+L*L-i*i,$=-(Math.abs(I)>1e-6?(D+Math.sqrt(D*D-4*I*F))/(2*I):F/D);return{x:r+w+A*$,y:o+L+E*$,r:$}}function vP(t,e,n){var r=t.x-e.x,o,i,a=t.y-e.y,s,l,c=r*r+a*a;c?(i=e.r+n.r,i*=i,l=t.r+n.r,l*=l,i>l?(o=(c+l-i)/(2*c),s=Math.sqrt(Math.max(0,l/c-o*o)),n.x=t.x-o*r-s*a,n.y=t.y-o*a+s*r):(o=(c+i-l)/(2*c),s=Math.sqrt(Math.max(0,i/c-o*o)),n.x=e.x+o*r-s*a,n.y=e.y+o*a+s*r)):(n.x=e.x+n.r,n.y=e.y)}function yP(t,e){var n=t.r+e.r-1e-6,r=e.x-t.x,o=e.y-t.y;return n>0&&n*n>r*r+o*o}function _P(t){var e=t._,n=t.next._,r=e.r+n.r,o=(e.x*n.r+n.x*e.r)/r,i=(e.y*n.r+n.y*e.r)/r;return o*o+i*i}function jg(t){this._=t,this.next=null,this.previous=null}function v9(t,e){if(!(i=(t=hP(t)).length))return 0;var n,r,o,i,a,s,l,c,u,f,d;if(n=t[0],n.x=0,n.y=0,!(i>1))return n.r;if(r=t[1],n.x=-r.r,r.x=n.r,r.y=0,!(i>2))return n.r+r.r;vP(r,n,o=t[2]),n=new jg(n),r=new jg(r),o=new jg(o),n.next=o.previous=r,r.next=n.previous=o,o.next=r.previous=n;t:for(l=3;l<i;++l){vP(n._,r._,o=t[l]),o=new jg(o),c=r.next,u=n.previous,f=r._.r,d=n._.r;do if(f<=d){if(yP(c._,o._)){r=c,n.next=r,r.previous=n,--l;continue t}f+=c._.r,c=c.next}else{if(yP(u._,o._)){n=u,n.next=r,r.previous=n,--l;continue t}d+=u._.r,u=u.previous}while(c!==u.next);for(o.previous=n,o.next=r,n.next=r.previous=r=o,a=_P(n);(o=o.next)!==r;)(s=_P(o))<a&&(n=o,a=s);r=n.next}for(n=[r._],o=r;(o=o.next)!==r;)n.push(o._);for(o=mP(n,e),l=0;l<i;++l)n=t[l],n.x-=o.x,n.y-=o.y;return o.r}function pw(t){return v9(t,dP()),t}function Yg(t){t.x0=Math.round(t.x0),t.y0=Math.round(t.y0),t.x1=Math.round(t.x1),t.y1=Math.round(t.y1)}function Ug(t,e,n,r,o){for(var i=t.children,a,s=-1,l=i.length,c=t.value&&(r-e)/t.value;++s<l;)a=i[s],a.y0=n,a.y1=o,a.x0=e,a.x1=e+=a.value*c}function wd(){var t=1,e=1,n=0,r=!1;function o(a){var s=a.height+1;return a.x0=a.y0=n,a.x1=t,a.y1=e/s,a.eachBefore(i(e,s)),r&&a.eachBefore(Yg),a}function i(a,s){return function(l){l.children&&Ug(l,l.x0,a*(l.depth+1)/s,l.x1,a*(l.depth+2)/s);var c=l.x0,u=l.y0,f=l.x1-n,d=l.y1-n;f<c&&(c=f=(c+f)/2),d<u&&(u=d=(u+d)/2),l.x0=c,l.y0=u,l.x1=f,l.y1=d}}return o.round=function(a){return arguments.length?(r=!!a,o):r},o.size=function(a){return arguments.length?(t=+a[0],e=+a[1],o):[t,e]},o.padding=function(a){return arguments.length?(n=+a,o):n},o}function bP(t,e,n,r,o){for(var i=t.children,a,s=-1,l=i.length,c=t.value&&(o-n)/t.value;++s<l;)a=i[s],a.x0=e,a.x1=r,a.y0=n,a.y1=n+=a.value*c}var y9=(1+Math.sqrt(5))/2;function _9(t,e,n,r,o,i){for(var a=[],s=e.children,l,c,u=0,f=0,d=s.length,h,p,g=e.value,m,x,y,_,v,b,w;u<d;){h=o-n,p=i-r;do m=s[f++].value;while(!m&&f<d);for(x=y=m,b=Math.max(p/h,h/p)/(g*t),w=m*m*b,v=Math.max(y/w,w/x);f<d;++f){if(m+=c=s[f].value,c<x&&(x=c),c>y&&(y=c),w=m*m*b,_=Math.max(y/w,w/x),_>v){m-=c;break}v=_}a.push(l={value:m,dice:h<p,children:s.slice(u,f)}),l.dice?Ug(l,n,r,o,g?r+=p*m/g:i):bP(l,n,r,g?n+=h*m/g:o,i),g-=m,u=f}return a}var wP=(function t(e){function n(r,o,i,a,s){_9(e,r,o,i,a,s)}return n.ratio=function(r){return t((r=+r)>1?r:1)},n})(y9);function mw(){var t=wP,e=!1,n=1,r=1,o=[0],i=hc,a=hc,s=hc,l=hc,c=hc;function u(d){return d.x0=d.y0=0,d.x1=n,d.y1=r,d.eachBefore(f),o=[0],e&&d.eachBefore(Yg),d}function f(d){var h=o[d.depth],p=d.x0+h,g=d.y0+h,m=d.x1-h,x=d.y1-h;m<p&&(p=m=(p+m)/2),x<g&&(g=x=(g+x)/2),d.x0=p,d.y0=g,d.x1=m,d.y1=x,d.children&&(h=o[d.depth+1]=i(d)/2,p+=c(d)-h,g+=a(d)-h,m-=s(d)-h,x-=l(d)-h,m<p&&(p=m=(p+m)/2),x<g&&(g=x=(g+x)/2),t(d,p,g,m,x))}return u.round=function(d){return arguments.length?(e=!!d,u):e},u.size=function(d){return arguments.length?(n=+d[0],r=+d[1],u):[n,r]},u.tile=function(d){return arguments.length?(t=fP(d),u):t},u.padding=function(d){return arguments.length?u.paddingInner(d).paddingOuter(d):u.paddingInner()},u.paddingInner=function(d){return arguments.length?(i=typeof d=="function"?d:pc(+d),u):i},u.paddingOuter=function(d){return arguments.length?u.paddingTop(d).paddingRight(d).paddingBottom(d).paddingLeft(d):u.paddingTop()},u.paddingTop=function(d){return arguments.length?(a=typeof d=="function"?d:pc(+d),u):a},u.paddingRight=function(d){return arguments.length?(s=typeof d=="function"?d:pc(+d),u):s},u.paddingBottom=function(d){return arguments.length?(l=typeof d=="function"?d:pc(+d),u):l},u.paddingLeft=function(d){return arguments.length?(c=typeof d=="function"?d:pc(+d),u):c},u}var kP=Object.assign(Object.assign({},Ae),{angleRange:[0,2*Math.PI],centralLabel:void 0,centralSubLabel:void 0,centralSubLabelWrap:!0,cornerRadius:0,direction:ms.Inwards,emptySegmentAngle:Math.PI/180,hideOverflowingSegmentLabels:!0,layers:[],layerPadding:0,layerSettings:void 0,segmentColor:void 0,segmentPattern:void 0,segmentLabel:void 0,segmentLabelColor:void 0,showBackground:!1,showEmptySegments:!1,showSegmentLabels:!0,sort:void 0,value:void 0});function SP(t,e){t.attr(xe,n=>n._index).style("fill",n=>{var r,o;return(r=K(n,e.segmentColor))!==null&&r!==void 0?r:(o=n._state)===null||o===void 0?void 0:o.fill}).style("mask",n=>Ft(Nt(n,e.segmentPattern,n._index))).style("opacity",0).each((n,r,o)=>{let i=o[r],a=(n.x0+n.x1)/2,s=(n.x1-n.x0)/2;i._animState={x0:a-s,x1:a+s,y0:n.y0,y1:n.y1}})}function CP(t,e,n,r){t.style("transition",`fill ${r}ms`).attr(xe,o=>o._index).style("fill",o=>o._state.fill).style("fill-opacity",o=>o._state.fillOpacity).style("mask",o=>Ft(Nt(o,e.segmentPattern,o._index))),r?G(t,r).style("opacity",1).attrTween("d",(i,a,s)=>{let l=s[a],c={x0:i.x0,x1:i.x1,y0:i.y0,y1:i.y1},u=re(l._animState,c);return f=>(l._animState=u(f),n(l._animState))}):t.attr("d",n).style("opacity",1)}function AP(t,e){G(t,e).style("opacity",0).remove()}var yw={};Wt(yw,{background:()=>qg,centralLabel:()=>xw,centralSubLabel:()=>vw,root:()=>LP,segment:()=>Xg,segmentArc:()=>Kg,segmentExit:()=>Zg,segmentLabel:()=>Qg,segmentsGroup:()=>gw,variables:()=>mi});var TP={"--vis-nested-donut-font-family":void 0,"--vis-nested-donut-background-color":"#E7E9F3","--vis-nested-donut-central-label-font-size":"16px","--vis-nested-donut-central-label-font-weight":600,"--vis-nested-donut-central-label-text-color":"#5b5f6d","--vis-nested-donut-central-sublabel-font-size":"12px;","--vis-nested-donut-central-sublabel-font-weight":500,"--vis-nested-donut-central-sublabel-text-color":"#5b5f6d","--vis-nested-donut-segment-stroke-width":"1px","--vis-nested-donut-segment-stroke-color":"var(--vis-nested-donut-background-color)","--vis-nested-donut-segment-label-text-color-light":"#5b5f6d","--vis-nested-donut-segment-label-text-color-dark":"#fff","--vis-nested-donut-segment-label-font-size":"1em","--vis-dark-nested-donut-background-color":"#18160C","--vis-dark-nested-donut-central-label-text-color":"#fff","--vis-dark-nested-donut-central-sublabel-text-color":"#fff"},LP=M`
|
|
595
|
+
label: nested-donut-component;
|
|
596
|
+
`,gw=M`
|
|
597
|
+
label: nested-donut-segments-group;
|
|
598
|
+
`,mi=ze(TP);Be(TP,LP);var qg=M`
|
|
599
|
+
label: background;
|
|
600
|
+
fill: var(--vis-nested-donut-background-color);
|
|
601
|
+
stroke-width: var(--vis-nested-donut-segment-stroke-width);
|
|
602
|
+
stroke: var(--vis-nested-donut-segment-stroke-color);
|
|
603
|
+
`,Xg=M`
|
|
604
|
+
label: segment;
|
|
605
|
+
`,Zg=M`
|
|
606
|
+
label: segment-exit;
|
|
607
|
+
`,Kg=M`
|
|
608
|
+
label: segment-arc;
|
|
609
|
+
stroke-width: var(--vis-nested-donut-segment-stroke-width);
|
|
610
|
+
stroke: var(--vis-nested-donut-segment-stroke-color);
|
|
611
|
+
`,Qg=M`
|
|
612
|
+
label: segment-label;
|
|
613
|
+
text-anchor: middle;
|
|
614
|
+
dominant-baseline: middle;
|
|
615
|
+
user-select: none;
|
|
616
|
+
font-size: var(--vis-nested-donut-segment-label-font-size);
|
|
617
|
+
`,xw=M`
|
|
618
|
+
label: central-label;
|
|
619
|
+
text-anchor: middle;
|
|
620
|
+
dominant-baseline: middle;
|
|
621
|
+
font-size: var(--vis-nested-donut-central-label-font-size);
|
|
622
|
+
font-family: var(--vis-nested-donut-central-label-font-family, var(--vis-font-family));
|
|
623
|
+
font-weight: var(--vis-nested-donut-central-label-font-weight);
|
|
624
|
+
fill: var(--vis-nested-donut-central-label-text-color);
|
|
625
|
+
`,vw=M`
|
|
626
|
+
label: central-sub-label;
|
|
627
|
+
text-anchor: middle;
|
|
628
|
+
dominant-baseline: middle;
|
|
629
|
+
font-size: var(--vis-nested-donut-central-sublabel-font-size);
|
|
630
|
+
font-family: var(--vis-nested-donut-central-sublabel-font-family, var(--vis-font-family));
|
|
631
|
+
font-weight: var(--vis-nested-donut-central-sublabel-font-weight);
|
|
632
|
+
fill: var(--vis-nested-donut-central-sublabel-text-color);
|
|
633
|
+
`;function b9(t,e){var n;let r=(n=Ut(t._state.fill))!==null&&n!==void 0?n:Ut(Gr(t._state.fill,e)),o=r?.rgb(),i=o&&t._state.fillOpacity?MT(`rgba(${o.r},${o.g},${o.b},${t._state.fillOpacity})`,Gr(Qe(mi.nestedDonutBackgroundColor),e)):o,a=i?Dy(i):0;return Qe(a>.65?mi.nestedDonutSegmentLabelTextColorLight:mi.nestedDonutSegmentLabelTextColorDark)}function EP(t,e){let n=`translate(${e.centroid(t)})`,r=180/Math.PI*(e.startAngle()(t)+e.endAngle()(t))/2-90;switch(t._layer.labelAlignment){case Eo.Along:return`${n} rotate(${r+90})`;case Eo.Perpendicular:return`${n} rotate(${r>90?r-180:r})`;default:return`${n}`}}function w9(t){let e=t.y1-t.y0,n=t._layer._innerRadius*(t.x1-t.x0),r=Math.max(Math.abs(Math.cos(t.x0+(t.x1-t.x0)/2-Math.PI/2)*e),e);switch(t._layer.labelAlignment){case Eo.Perpendicular:return{width:e,height:n};case Eo.Along:return{width:n,height:e};case Eo.Straight:return{width:r,height:r}}}function MP(t,e){t.attr("transform",n=>EP(n,e)).style("visibility",null).style("opacity",0)}function RP(t,e,n,r){t.text(o=>{var i;return(i=j(o,e.segmentLabel))!==null&&i!==void 0?i:o.data.key}).style("transition",`fill ${r}ms`).style("fill",(o,i,a)=>{var s;return(s=K(o,e.segmentLabelColor))!==null&&s!==void 0?s:b9(o,a[i])}).each((o,i,a)=>{let s=w9(o),l=U(a[i]).call(En,s.width),{width:c,height:u}=l.node().getBBox();if(e.hideOverflowingSegmentLabels&&(c>s.width||u>s.height))l.attr("visibility","hidden");else{let f=ue(Qe(mi.nestedDonutSegmentLabelFontSize),a[i]),d=l.selectChildren().size()-1;l.attr("dy",-f/2*d)}}),G(t,r).attr("transform",o=>EP(o,n)).style("opacity",1)}function PP(t,e){G(t,e).style("opacity",0).remove()}var mc=class extends Te{constructor(e){super(),this._defaultConfig=kP,this.config=this._defaultConfig,this.datamodel=new Fn,this.arcGen=Qn(),this.colorScale=fr(),this.events={},e&&this.setConfig(e),this.arcBackground=this.g.append("g"),this.arcGroup=this.g.append("g").attr("class",gw),this.centralLabel=this.g.append("text").attr("class",xw),this.centralSubLabel=this.g.append("text").attr("class",vw)}_render(e){var n,r;let{config:o}=this,i=tt(e)?e:o.duration;if(o.layers===void 0||o.layers.length===0){console.warn("Unovis | Nested Donut: No layers defined.");return}let a=this._getLayerSettings(),s=this._getHierarchyData(a);this.arcGen.startAngle(g=>g.x0).endAngle(g=>g.x1).innerRadius(g=>g.y0).outerRadius(g=>g.y1).cornerRadius(o.cornerRadius),this.arcGroup.attr("transform",`translate(${this._width/2},${this._height/2})`),this.arcBackground.attr("transform",`translate(${this._width/2},${this._height/2})`),this.centralLabel.attr("transform",`translate(${this._width/2},${this._height/2})`),this.centralSubLabel.attr("transform",`translate(${this._width/2},${this._height/2})`);let l=this.arcBackground.selectAll(`.${qg}`).data(a,g=>g._id),c=l.enter().append("path").attr("class",qg).attr("visibility",o.showBackground?null:"hidden"),u=l.merge(c).style("transition",`fill ${i}ms`).style("fill",g=>g.backgroundColor);G(u,i).attr("d",g=>{var m,x,y,_;return this.arcGen({x0:(x=(m=o.angleRange)===null||m===void 0?void 0:m[0])!==null&&x!==void 0?x:0,x1:(_=(y=o.angleRange)===null||y===void 0?void 0:y[1])!==null&&_!==void 0?_:2*Math.PI,y0:g._innerRadius,y1:g._outerRadius})}),G(l.exit(),i).style("opacity",0).remove();let f=this.arcGroup.selectAll(`${Xg}`).data(s,g=>g._id),d=f.enter().append("g").attr("class",Xg);f.merge(d),G(f.exit(),i).attr("class",Zg).style("opacity",0).remove();let h=this.arcGroup.selectAll(`.${Kg}`).data(s,g=>g._id),p=d.append("path").attr("class",Kg).call(SP,o);if(h.merge(p).call(CP,o,this.arcGen,i),h.exit().attr("class",Zg).call(AP,i),o.showSegmentLabels){let g=this.arcGroup.selectAll(`.${Qg}`).data(s,x=>x._id),m=d.append("text").attr("class",Qg).call(MP,this.arcGen);g.merge(m).call(RP,o,this.arcGen,i),g.exit().call(PP,i)}this.centralLabel.attr("dy",o.centralSubLabel?"-0.55em":null).text((n=o.centralLabel)!==null&&n!==void 0?n:null),this.centralSubLabel.attr("dy",o.centralLabel?"0.55em":null).text((r=o.centralSubLabel)!==null&&r!==void 0?r:null),o.centralSubLabelWrap&&En(this.centralSubLabel,a[0]._innerRadius*1.9,Le.Top)}_getHierarchyData(e){var n;let{config:r,datamodel:{data:o}}=this,i=(n=r.layers)===null||n===void 0?void 0:n.map(u=>f=>j(o[f],u,f)),a=lo(o.keys(),...i),s=r.value!==void 0?Ur(a).sum(u=>typeof u=="number"&&z(o[u],r.value,u)):Ur(a).count(),l=wd().size([r.angleRange[1],1])(s);return l.each(u=>{var f,d,h;let p=u;u.data={key:p.data[0],values:Array.isArray(p.data[1])?p.data[1].map(g=>o[g]):[],root:(h=(d=(f=u.parent)===null||f===void 0?void 0:f.data)===null||d===void 0?void 0:d.root)!==null&&h!==void 0?h:p.data[0]},u._id=`root${l.path(u).map(g=>g.data.key).join("->")}`,Iu(u.depth-1,[0,e.length-1])&&(u._layer=e[u.depth-1],u.y0=u._layer._innerRadius,u.y1=u._layer._outerRadius)}).eachBefore(u=>{var f,d,h,p;if(!u.children||u.depth===s.height-1)return;let g=ui().startAngle(u.parent?u.x0:(f=r.angleRange)===null||f===void 0?void 0:f[0]).endAngle(u.parent?u.x1:(d=r.angleRange)===null||d===void 0?void 0:d[1]).value(x=>r.showEmptySegments&&x.value===0?r.emptySegmentAngle:x.x1-x.x0).sort(r.sort)(u.children),m=fr().domain([-1,u.children.length]).range([(p=(h=u._state)===null||h===void 0?void 0:h.fillOpacity)!==null&&p!==void 0?p:1,0]);u.children.forEach((x,y)=>{x._index=y,x.x0=g[y].startAngle,x.x1=g[y].endAngle;let _=K(x,r.segmentColor,g[y].index,void 0,{dontFallbackToCssVar:x.depth!==1});x._state={fill:_??u._state.fill,fillOpacity:_===null?m(g[y].index):null}})}).eachAfter(u=>{var f;(f=u.children)===null||f===void 0||f.forEach(d=>u.data.values.push(...d.data.values))}),l.descendants().filter(u=>{var f;return((f=u.parent)===null||f===void 0?void 0:f.value)&&u.data.key})}_getLayerSettings(){let{direction:e,layers:n,layerPadding:r,layerSettings:o}=this.config,i=Math.min(this._width,this._height)/2,a={backgroundColor:Qe(mi.nestedDonutBackgroundColor),labelAlignment:Eo.Perpendicular,width:i*.75/n.length},s=n.reduceRight((l,c,u)=>{let f=e===ms.Outwards?u:l.length,d=He(a,st(f,o)),h=l.length?l[0]._innerRadius-r:i,p=Du(d.width);return p===null&&console.warn(`Unovis | Nested Donut: Could not parse width ${d.width}. Setting to default.`),l.unshift(Object.assign(Object.assign({},d),{_id:f,_outerRadius:h,_innerRadius:h-(p??a.width)})),l},new Array);return e===ms.Inwards?s.reverse():s}};mc.selectors=yw;mc.cssVariables=mi;var IP=Object.assign(Object.assign({},Ae),{id:(t,e)=>{var n;return(n=t.id)!==null&&n!==void 0?n:e},value:void 0,maxValue:void 0,angleRange:[0,2*Math.PI],padAngle:0,sortFunction:void 0,cornerRadius:0,color:void 0,radius:void 0,trackWidth:16,trackPadding:4,reverseOrder:!1,centralLabel:void 0,centralSubLabel:void 0,centralSubLabelWrap:!0,centralLabelOffsetX:void 0,centralLabelOffsetY:void 0,showBackground:!0,backgroundAngleRange:void 0});function NP(t,e){t.style("fill",n=>K(n.data,e.color,n.index)).style("opacity",0).each((n,r,o)=>{let i=o[r];i._animState={startAngle:n.startAngle,endAngle:n.startAngle,innerRadius:n.innerRadius,outerRadius:n.outerRadius,padAngle:n.padAngle}})}function $P(t,e,n,r){t.style("transition",`fill ${r}ms`).style("fill",i=>K(i.data,e.color,i.index));let o=i=>i.value||i.endAngle!==i.startAngle?1:0;r?G(t,r).style("opacity",o).attrTween("d",(a,s,l)=>{let c=l[s],u={startAngle:a.startAngle,endAngle:a.endAngle,innerRadius:a.innerRadius,outerRadius:a.outerRadius,padAngle:a.padAngle},f=re(c._animState,u);return d=>(c._animState=f(d),n(c._animState))}):t.attr("d",n).style("opacity",o)}function DP(t,e){G(t,e).style("opacity",0).remove()}function OP(t,e){let n=e-t;if(Math.abs(n)>=2*Math.PI)return{xMin:-1,xMax:1,yMin:-1,yMax:1};let r=Math.min(t,e),o=Math.max(t,e),i=0,a=0,s=0,l=0,c=(f,d)=>{f<i&&(i=f),f>a&&(a=f),d<s&&(s=d),d>l&&(l=d)};c(Math.sin(t),-Math.cos(t)),c(Math.sin(e),-Math.cos(e));let u=f=>{let d=Math.ceil((r-f)/(2*Math.PI)),h=Math.floor((o-f)/(2*Math.PI));return d<=h};return u(Math.PI/2)&&(a=1),u(-Math.PI/2)&&(i=-1),u(0)&&(s=-1),u(Math.PI)&&(l=1),{xMin:i,xMax:a,yMin:s,yMax:l}}var Sw={};Wt(Sw,{background:()=>Jg,bar:()=>t0,barExit:()=>bw,centralLabel:()=>ww,centralSubLabel:()=>kw,cssVarDefaults:()=>_w,root:()=>zP,variables:()=>nn});var zP=M`
|
|
634
|
+
label: radial-bar-component;
|
|
635
|
+
`,_w={"--vis-radial-bar-central-label-font-size":"24px","--vis-radial-bar-central-label-text-color":"#5b5f6d","--vis-radial-bar-central-label-font-family":void 0,"--vis-radial-bar-central-label-font-weight":"600","--vis-radial-bar-central-label-text-anchor":"middle","--vis-radial-bar-central-sub-label-font-size":"12px","--vis-radial-bar-central-sub-label-text-color":"#5b5f6d","--vis-radial-bar-central-sub-label-font-family":void 0,"--vis-radial-bar-central-sub-label-font-weight":"500","--vis-radial-bar-central-sub-label-text-anchor":"middle","--vis-radial-bar-background-color":"#E7E9F3","--vis-radial-bar-bar-stroke-width":"0","--vis-radial-bar-bar-stroke-color":void 0,"--vis-dark-radial-bar-central-label-text-color":"#C2BECE","--vis-dark-radial-bar-central-sub-label-text-color":"#C2BECE","--vis-dark-radial-bar-background-color":"#444444"},nn=ze(_w);Be(_w,zP);var Jg=M`
|
|
636
|
+
label: background;
|
|
637
|
+
fill: var(${nn.radialBarBackgroundColor});
|
|
638
|
+
`,t0=M`
|
|
639
|
+
label: bar;
|
|
640
|
+
stroke-width: var(${nn.radialBarBarStrokeWidth});
|
|
641
|
+
stroke: var(${nn.radialBarBarStrokeColor}, var(${nn.radialBarBackgroundColor}));
|
|
642
|
+
`,bw=M`
|
|
643
|
+
label: bar-exit;
|
|
644
|
+
`,ww=M`
|
|
645
|
+
label: central-label;
|
|
646
|
+
text-anchor: var(${nn.radialBarCentralLabelTextAnchor});
|
|
647
|
+
dominant-baseline: middle;
|
|
648
|
+
font-size: var(${nn.radialBarCentralLabelFontSize});
|
|
649
|
+
font-family: var(${nn.radialBarCentralLabelFontFamily}, var(--vis-font-family));
|
|
650
|
+
font-weight: var(${nn.radialBarCentralLabelFontWeight});
|
|
651
|
+
fill: var(${nn.radialBarCentralLabelTextColor});
|
|
652
|
+
`,kw=M`
|
|
653
|
+
label: central-sub-label;
|
|
654
|
+
text-anchor: var(${nn.radialBarCentralSubLabelTextAnchor});
|
|
655
|
+
dominant-baseline: middle;
|
|
656
|
+
font-size: var(${nn.radialBarCentralSubLabelFontSize});
|
|
657
|
+
font-family: var(${nn.radialBarCentralSubLabelFontFamily}, var(--vis-font-family));
|
|
658
|
+
font-weight: var(${nn.radialBarCentralSubLabelFontWeight});
|
|
659
|
+
fill: var(${nn.radialBarCentralSubLabelTextColor});
|
|
660
|
+
`;var kd=class extends Te{constructor(e){super(),this._defaultConfig=IP,this.config=this._defaultConfig,this.datamodel=new Fn,this.arcGen=Qn(),this.events={},e&&this.setConfig(e),this.trackGroup=this.g.append("g"),this.barGroup=this.g.append("g"),this.centralLabel=this.g.append("text").attr("class",ww),this.centralSubLabel=this.g.append("text").attr("class",kw)}get bleed(){return{top:0,bottom:0,left:0,right:0}}_render(e){var n,r,o,i,a,s,l,c,u,f;let{config:d,datamodel:h,bleed:p}=this,g=h.data.map((ot,Q)=>({index:Q,datum:ot}));d.sortFunction&&g.sort((ot,Q)=>d.sortFunction(ot.datum,Q.datum));let m=tt(e)?e:d.duration,x=this._width,y=this._height,_=x-p.left-p.right,v=y-p.top-p.bottom,b=(r=(n=d.angleRange)===null||n===void 0?void 0:n[0])!==null&&r!==void 0?r:0,w=(i=(o=d.angleRange)===null||o===void 0?void 0:o[1])!==null&&i!==void 0?i:2*Math.PI,A=w-b,L=OP(b,w),E=L.xMax-L.xMin,I=L.yMax-L.yMin,D=(a=d.radius)!==null&&a!==void 0?a:Math.min(_/E,v/I),F=(L.xMin+L.xMax)/2,$=(L.yMin+L.yMax)/2,T=p.left+_/2-F*D,S=p.top+v/2-$*D,k=g.length,P=Math.max(0,d.trackWidth),N=Math.max(0,d.trackPadding),R=P*k+N*Math.max(0,k-1),O=R>D?D/Math.max(1,k):P+N,W=R>D?mt(O-N,1,O):P,Y=g.map(ot=>{var Q;return(Q=z(ot.datum,d.value,ot.index))!==null&&Q!==void 0?Q:0}),J=(s=rt(Y))!==null&&s!==void 0?s:0,nt=g.map(ot=>{let Q=d.maxValue;if(Array.isArray(Q)){let ne=Q[ot.index];return(tt(ne)?ne:J)||1}let yt=z(ot.datum,Q,ot.index);return(yt??J)||1}),et=g.map((ot,Q)=>{let yt=d.reverseOrder?k-1-Q:Q,ne=D-yt*O,Ne=mt(ne-W,0,ne-1),Uo=Y[Q],qo=nt[Q],Rv=mt(Uo/qo,0,1);return{data:ot.datum,index:ot.index,ringIndex:yt,value:Uo,startAngle:b,endAngle:b+Rv*A,innerRadius:Ne,outerRadius:ne,padAngle:d.padAngle}}),xt=`translate(${T},${S})`;this.barGroup.attr("transform",xt),this.trackGroup.attr("transform",xt),this.arcGen.startAngle(ot=>ot.startAngle).endAngle(ot=>ot.endAngle).innerRadius(ot=>ot.innerRadius).outerRadius(ot=>ot.outerRadius).padAngle(ot=>ot.padAngle).cornerRadius(d.cornerRadius);let Z=(c=(l=d.backgroundAngleRange)===null||l===void 0?void 0:l[0])!==null&&c!==void 0?c:b,vt=(f=(u=d.backgroundAngleRange)===null||u===void 0?void 0:u[1])!==null&&f!==void 0?f:w,X=this.trackGroup.selectAll(`.${Jg}`).data(d.showBackground?et:[],ot=>d.id(ot.data,ot.index)),at=X.enter().append("path").attr("class",Jg).style("opacity",0),B=X.merge(at);G(B,m).style("opacity",1).attr("d",ot=>this.arcGen({startAngle:Z,endAngle:vt,innerRadius:ot.innerRadius,outerRadius:ot.outerRadius,padAngle:ot.padAngle})),G(X.exit(),m).style("opacity",0).remove();let H=this.barGroup.selectAll(`.${t0}`).data(et,ot=>d.id(ot.data,ot.index)),lt=H.enter().append("path").attr("class",t0).call(NP,d);H.merge(lt).call($P,d,this.arcGen,m),H.exit().attr("class",bw).call(DP,m);let gt=et.length?Math.min(...et.map(ot=>ot.innerRadius)):D;this._renderCentralLabels(T,S,gt)}_renderCentralLabels(e,n,r){var o,i;let{config:a}=this;this.centralLabel.text((o=a.centralLabel)!==null&&o!==void 0?o:null),this.centralSubLabel.text((i=a.centralSubLabel)!==null&&i!==void 0?i:null),a.centralSubLabelWrap&&En(this.centralSubLabel,r*1.9);let s=!!a.centralLabel,l=!!a.centralSubLabel,c=s?ue(Qe(nn.radialBarCentralLabelFontSize),this.element):0,u=l?ue(Qe(nn.radialBarCentralSubLabelFontSize),this.element):0,d=this.centralSubLabel.node().childElementCount||(l?1:0),h=u*1.2,p=d>0?u+(d-1)*h:0,g=s&&l?u*.25:0,m=(s?c:0)+g+p,x=-m/2+c/2,y=-m/2+(s?c+g:0)+u/2;this.centralLabel.attr("y",s?x:null).attr("dy",null),this.centralSubLabel.attr("y",l?y:null).attr("dy",null);let _=(a.centralLabelOffsetX||0)+e,v=(a.centralLabelOffsetY||0)+n,b=`translate(${_},${v})`;this.centralLabel.attr("transform",b),this.centralSubLabel.attr("transform",b)}};kd.selectors=Sw;Ml();var Sd=t=>()=>t;function Cw(t,{sourceEvent:e,target:n,transform:r,dispatch:o}){Object.defineProperties(this,{type:{value:t,enumerable:!0,configurable:!0},sourceEvent:{value:e,enumerable:!0,configurable:!0},target:{value:n,enumerable:!0,configurable:!0},transform:{value:r,enumerable:!0,configurable:!0},_:{value:o}})}function qr(t,e,n){this.k=t,this.x=e,this.y=n}qr.prototype={constructor:qr,scale:function(t){return t===1?this:new qr(this.k*t,this.x,this.y)},translate:function(t,e){return t===0&e===0?this:new qr(this.k,this.x+this.k*t,this.y+this.k*e)},apply:function(t){return[t[0]*this.k+this.x,t[1]*this.k+this.y]},applyX:function(t){return t*this.k+this.x},applyY:function(t){return t*this.k+this.y},invert:function(t){return[(t[0]-this.x)/this.k,(t[1]-this.y)/this.k]},invertX:function(t){return(t-this.x)/this.k},invertY:function(t){return(t-this.y)/this.k},rescaleX:function(t){return t.copy().domain(t.range().map(this.invertX,this).map(t.invert,t))},rescaleY:function(t){return t.copy().domain(t.range().map(this.invertY,this).map(t.invert,t))},toString:function(){return"translate("+this.x+","+this.y+") scale("+this.k+")"}};var hn=new qr(1,0,0);ta.prototype=qr.prototype;function ta(t){for(;!t.__zoom;)if(!(t=t.parentNode))return hn;return t.__zoom}function e0(t){t.stopImmediatePropagation()}function gc(t){t.preventDefault(),t.stopImmediatePropagation()}function k9(t){return(!t.ctrlKey||t.type==="wheel")&&!t.button}function S9(){var t=this;return t instanceof SVGElement?(t=t.ownerSVGElement||t,t.hasAttribute("viewBox")?(t=t.viewBox.baseVal,[[t.x,t.y],[t.x+t.width,t.y+t.height]]):[[0,0],[t.width.baseVal.value,t.height.baseVal.value]]):[[0,0],[t.clientWidth,t.clientHeight]]}function BP(){return this.__zoom||hn}function C9(t){return-t.deltaY*(t.deltaMode===1?.05:t.deltaMode?1:.002)*(t.ctrlKey?10:1)}function A9(){return navigator.maxTouchPoints||"ontouchstart"in this}function T9(t,e,n){var r=t.invertX(e[0][0])-n[0][0],o=t.invertX(e[1][0])-n[1][0],i=t.invertY(e[0][1])-n[0][1],a=t.invertY(e[1][1])-n[1][1];return t.translate(o>r?(r+o)/2:Math.min(0,r)||Math.max(0,o),a>i?(i+a)/2:Math.min(0,i)||Math.max(0,a))}function xs(){var t=k9,e=S9,n=T9,r=C9,o=A9,i=[0,1/0],a=[[-1/0,-1/0],[1/0,1/0]],s=250,l=hy,c=Vr("start","zoom","end"),u,f,d,h=500,p=150,g=0,m=10;function x(T){T.property("__zoom",BP).on("wheel.zoom",L,{passive:!1}).on("mousedown.zoom",E).on("dblclick.zoom",I).filter(o).on("touchstart.zoom",D).on("touchmove.zoom",F).on("touchend.zoom touchcancel.zoom",$).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}x.transform=function(T,S,k,P){var N=T.selection?T.selection():T;N.property("__zoom",BP),T!==N?b(T,S,k,P):N.interrupt().each(function(){w(this,arguments).event(P).start().zoom(null,typeof S=="function"?S.apply(this,arguments):S).end()})},x.scaleBy=function(T,S,k,P){x.scaleTo(T,function(){var N=this.__zoom.k,R=typeof S=="function"?S.apply(this,arguments):S;return N*R},k,P)},x.scaleTo=function(T,S,k,P){x.transform(T,function(){var N=e.apply(this,arguments),R=this.__zoom,O=k==null?v(N):typeof k=="function"?k.apply(this,arguments):k,W=R.invert(O),Y=typeof S=="function"?S.apply(this,arguments):S;return n(_(y(R,Y),O,W),N,a)},k,P)},x.translateBy=function(T,S,k,P){x.transform(T,function(){return n(this.__zoom.translate(typeof S=="function"?S.apply(this,arguments):S,typeof k=="function"?k.apply(this,arguments):k),e.apply(this,arguments),a)},null,P)},x.translateTo=function(T,S,k,P,N){x.transform(T,function(){var R=e.apply(this,arguments),O=this.__zoom,W=P==null?v(R):typeof P=="function"?P.apply(this,arguments):P;return n(hn.translate(W[0],W[1]).scale(O.k).translate(typeof S=="function"?-S.apply(this,arguments):-S,typeof k=="function"?-k.apply(this,arguments):-k),R,a)},P,N)};function y(T,S){return S=Math.max(i[0],Math.min(i[1],S)),S===T.k?T:new qr(S,T.x,T.y)}function _(T,S,k){var P=S[0]-k[0]*T.k,N=S[1]-k[1]*T.k;return P===T.x&&N===T.y?T:new qr(T.k,P,N)}function v(T){return[(+T[0][0]+ +T[1][0])/2,(+T[0][1]+ +T[1][1])/2]}function b(T,S,k,P){T.on("start.zoom",function(){w(this,arguments).event(P).start()}).on("interrupt.zoom end.zoom",function(){w(this,arguments).event(P).end()}).tween("zoom",function(){var N=this,R=arguments,O=w(N,R).event(P),W=e.apply(N,R),Y=k==null?v(W):typeof k=="function"?k.apply(N,R):k,J=Math.max(W[1][0]-W[0][0],W[1][1]-W[0][1]),nt=N.__zoom,et=typeof S=="function"?S.apply(N,R):S,xt=l(nt.invert(Y).concat(J/nt.k),et.invert(Y).concat(J/et.k));return function(Z){if(Z===1)Z=et;else{var vt=xt(Z),X=J/vt[2];Z=new qr(X,Y[0]-vt[0]*X,Y[1]-vt[1]*X)}O.zoom(null,Z)}})}function w(T,S,k){return!k&&T.__zooming||new A(T,S)}function A(T,S){this.that=T,this.args=S,this.active=0,this.sourceEvent=null,this.extent=e.apply(T,S),this.taps=0}A.prototype={event:function(T){return T&&(this.sourceEvent=T),this},start:function(){return++this.active===1&&(this.that.__zooming=this,this.emit("start")),this},zoom:function(T,S){return this.mouse&&T!=="mouse"&&(this.mouse[1]=S.invert(this.mouse[0])),this.touch0&&T!=="touch"&&(this.touch0[1]=S.invert(this.touch0[0])),this.touch1&&T!=="touch"&&(this.touch1[1]=S.invert(this.touch1[0])),this.that.__zoom=S,this.emit("zoom"),this},end:function(){return--this.active===0&&(delete this.that.__zooming,this.emit("end")),this},emit:function(T){var S=U(this.that).datum();c.call(T,this.that,new Cw(T,{sourceEvent:this.sourceEvent,target:x,type:T,transform:this.that.__zoom,dispatch:c}),S)}};function L(T,...S){if(!t.apply(this,arguments))return;var k=w(this,S).event(T),P=this.__zoom,N=Math.max(i[0],Math.min(i[1],P.k*Math.pow(2,r.apply(this,arguments)))),R=oe(T);if(k.wheel)(k.mouse[0][0]!==R[0]||k.mouse[0][1]!==R[1])&&(k.mouse[1]=P.invert(k.mouse[0]=R)),clearTimeout(k.wheel);else{if(P.k===N)return;k.mouse=[R,P.invert(R)],Bn(this),k.start()}gc(T),k.wheel=setTimeout(O,p),k.zoom("mouse",n(_(y(P,N),k.mouse[0],k.mouse[1]),k.extent,a));function O(){k.wheel=null,k.end()}}function E(T,...S){if(d||!t.apply(this,arguments))return;var k=T.currentTarget,P=w(this,S,!0).event(T),N=U(T.view).on("mousemove.zoom",Y,!0).on("mouseup.zoom",J,!0),R=oe(T,k),O=T.clientX,W=T.clientY;us(T.view),e0(T),P.mouse=[R,this.__zoom.invert(R)],Bn(this),P.start();function Y(nt){if(gc(nt),!P.moved){var et=nt.clientX-O,xt=nt.clientY-W;P.moved=et*et+xt*xt>g}P.event(nt).zoom("mouse",n(_(P.that.__zoom,P.mouse[0]=oe(nt,k),P.mouse[1]),P.extent,a))}function J(nt){N.on("mousemove.zoom mouseup.zoom",null),fs(nt.view,P.moved),gc(nt),P.event(nt).end()}}function I(T,...S){if(t.apply(this,arguments)){var k=this.__zoom,P=oe(T.changedTouches?T.changedTouches[0]:T,this),N=k.invert(P),R=k.k*(T.shiftKey?.5:2),O=n(_(y(k,R),P,N),e.apply(this,S),a);gc(T),s>0?U(this).transition().duration(s).call(b,O,P,T):U(this).call(x.transform,O,P,T)}}function D(T,...S){if(t.apply(this,arguments)){var k=T.touches,P=k.length,N=w(this,S,T.changedTouches.length===P).event(T),R,O,W,Y;for(e0(T),O=0;O<P;++O)W=k[O],Y=oe(W,this),Y=[Y,this.__zoom.invert(Y),W.identifier],N.touch0?!N.touch1&&N.touch0[2]!==Y[2]&&(N.touch1=Y,N.taps=0):(N.touch0=Y,R=!0,N.taps=1+!!u);u&&(u=clearTimeout(u)),R&&(N.taps<2&&(f=Y[0],u=setTimeout(function(){u=null},h)),Bn(this),N.start())}}function F(T,...S){if(this.__zooming){var k=w(this,S).event(T),P=T.changedTouches,N=P.length,R,O,W,Y;for(gc(T),R=0;R<N;++R)O=P[R],W=oe(O,this),k.touch0&&k.touch0[2]===O.identifier?k.touch0[0]=W:k.touch1&&k.touch1[2]===O.identifier&&(k.touch1[0]=W);if(O=k.that.__zoom,k.touch1){var J=k.touch0[0],nt=k.touch0[1],et=k.touch1[0],xt=k.touch1[1],Z=(Z=et[0]-J[0])*Z+(Z=et[1]-J[1])*Z,vt=(vt=xt[0]-nt[0])*vt+(vt=xt[1]-nt[1])*vt;O=y(O,Math.sqrt(Z/vt)),W=[(J[0]+et[0])/2,(J[1]+et[1])/2],Y=[(nt[0]+xt[0])/2,(nt[1]+xt[1])/2]}else if(k.touch0)W=k.touch0[0],Y=k.touch0[1];else return;k.zoom("touch",n(_(O,W,Y),k.extent,a))}}function $(T,...S){if(this.__zooming){var k=w(this,S).event(T),P=T.changedTouches,N=P.length,R,O;for(e0(T),d&&clearTimeout(d),d=setTimeout(function(){d=null},h),R=0;R<N;++R)O=P[R],k.touch0&&k.touch0[2]===O.identifier?delete k.touch0:k.touch1&&k.touch1[2]===O.identifier&&delete k.touch1;if(k.touch1&&!k.touch0&&(k.touch0=k.touch1,delete k.touch1),k.touch0)k.touch0[1]=this.__zoom.invert(k.touch0[0]);else if(k.end(),k.taps===2&&(O=oe(O,this),Math.hypot(f[0]-O[0],f[1]-O[1])<m)){var W=U(this).on("dblclick.zoom");W&&W.apply(this,arguments)}}}return x.wheelDelta=function(T){return arguments.length?(r=typeof T=="function"?T:Sd(+T),x):r},x.filter=function(T){return arguments.length?(t=typeof T=="function"?T:Sd(!!T),x):t},x.touchable=function(T){return arguments.length?(o=typeof T=="function"?T:Sd(!!T),x):o},x.extent=function(T){return arguments.length?(e=typeof T=="function"?T:Sd([[+T[0][0],+T[0][1]],[+T[1][0],+T[1][1]]]),x):e},x.scaleExtent=function(T){return arguments.length?(i[0]=+T[0],i[1]=+T[1],x):[i[0],i[1]]},x.translateExtent=function(T){return arguments.length?(a[0][0]=+T[0][0],a[1][0]=+T[1][0],a[0][1]=+T[0][1],a[1][1]=+T[1][1],x):[[a[0][0],a[0][1]],[a[1][0],a[1][1]]]},x.constrain=function(T){return arguments.length?(n=T,x):n},x.duration=function(T){return arguments.length?(s=+T,x):s},x.interpolate=function(T){return arguments.length?(l=T,x):l},x.on=function(){var T=c.on.apply(c,arguments);return T===c?x:T},x.clickDistance=function(T){return arguments.length?(g=(T=+T)*T,x):Math.sqrt(g)},x.tapDistance=function(T){return arguments.length?(m=+T,x):m},x}var ea=class extends pr{constructor(){super(...arguments),this._nodes=[],this._links=[],this._inputNodesMap=new Map,this._nodesMap=new Map,this.nodeId=e=>Qo(e.id)||isFinite(e.id)?`${e.id}`:void 0,this.linkId=e=>Qo(e.id)||isFinite(e.id)?`${e.id}`:void 0}getNodeById(e){return this._nodesMap.get(e)}get data(){return this._data}set data(e){var n,r;if(!e)return;this._data=e;let o=this.nodes,i=this.links;this._inputNodesMap.clear(),this._nodesMap.clear();let a=Or((n=e?.nodes)!==null&&n!==void 0?n:[]),s=Or((r=e?.links)!==null&&r!==void 0?r:[]);this.transferState(a,o,this.nodeId),this.transferState(s,i,this.linkId),a.forEach((l,c)=>{l._index=c,l._id=this.nodeId(l)||`${c}`,this._inputNodesMap.set(l,e.nodes[c]),this._nodesMap.set(l._id,l)}),ge(this.nodeSort)&&a.sort(this.nodeSort),s.forEach((l,c)=>{l._indexGlobal=c,l.source=this.findNode(a,l.source),l.target=this.findNode(a,l.target)}),s.forEach((l,c)=>{if(!Vv(l._index)&&!Vv(l._neighbours))return;let u=s.filter(f=>l.source===f.source&&l.target===f.target||l.source===f.target&&l.target===f.source);u.forEach((f,d)=>{var h,p;f._index=d,f._id=this.linkId(f)||`${(h=f.source)===null||h===void 0?void 0:h._id}-${(p=f.target)===null||p===void 0?void 0:p._id}-${d}`,f._neighbours=u.length,f._direction=l.source===f.source&&l.target===f.target?1:-1})}),a.forEach(l=>{l.links=s.filter(c=>c.source===l||c.target===l),l._isConnected=l.links.length!==0}),this._nonConnectedNodes=a.filter(l=>!l._isConnected),this._connectedNodes=kp(a,...this._nonConnectedNodes),this._nodes=a,this._links=s.filter(l=>l.source===l.target?(console.warn(`Unovis | Graph Data Model: Skipping link ${l._id} because it has the same source and target`),!1):l.source&&l.target)}get nodes(){return this._nodes}get links(){return this._links}get connectedNodes(){return this._connectedNodes}get nonConnectedNodes(){return this._nonConnectedNodes}findNode(e,n){let r;return tt(n)?r=e[n]:Qo(n)?r=e.find(o=>this.nodeId(o)===n):Pu(n)&&(r=e.find(o=>An(this._inputNodesMap.get(o),n))),r||console.warn(`Unovis | Graph Data Model: Node ${n} is missing from the nodes list`),r}transferState(e,n,r){for(let o of e){let i=n.find(a=>r(a)===r(o));i?o._state=Object.assign({},i._state):o._state={}}}setNodeStateById(e,n){let r=this.getNodeById(e);if(!r){console.warn(`Unovis | Graph Data Model: Node ${e} not found`);return}r._state=n}};var FP=Object.assign(Object.assign({},Ae),{heightNormalizationCoeff:1/16,zoomScale:void 0,zoomPan:void 0,enableZoom:!1,zoomExtent:[1,5],zoomMode:kr.Y,disableZoomModifierKeys:!1,exitTransitionType:cc.Default,enterTransitionType:uc.Default,id:(t,e)=>{var n;return(n=t._id)!==null&&n!==void 0?n:`${e}`},highlightSubtreeOnHover:!1,highlightDuration:300,highlightDelay:1e3,iterations:32,nodeSort:void 0,nodeWidth:25,nodeAlign:nr.Justify,nodeHorizontalSpacing:150,nodeMinHeight:20,nodeMaxHeight:100,nodePadding:2,nodeColor:t=>t.color,nodePattern:void 0,nodeFixedValue:t=>t.fixedValue,showSingleNode:!0,nodeCursor:void 0,nodeIcon:void 0,nodeIconColor:void 0,label:t=>t.label,labelPosition:q.Auto,labelVerticalAlign:Le.Middle,labelBackground:!1,labelTextSeparator:[" ","-"],labelTextDecoration:void 0,labelFit:De.Trim,labelTrimMode:Ue.Middle,labelForceWordBreak:!0,labelFontSize:void 0,labelCursor:void 0,labelColor:void 0,labelMaxWidth:void 0,labelMaxWidthTakeAvailableSpace:!1,labelMaxWidthTakeAvailableSpaceTolerance:void 0,labelExpandTrimmedOnHover:!0,labelVisibility:void 0,subLabel:void 0,subLabelFontSize:void 0,subLabelColor:void 0,subLabelPlacement:Lo.Below,subLabelToLabelInlineWidthRatio:.4,subLabelTextDecoration:void 0,linkValue:t=>t.value,linkColor:t=>t.color,linkPattern:void 0,linkCursor:void 0,onZoom:void 0,onLayoutCalculated:void 0,selectedNodeIds:void 0,init:function(){return this.linkSort=(t,e)=>z(e,this.linkValue)-z(t,this.linkValue),delete this.init,this}}).init();var Rw={};Wt(Rw,{SANKEY_ICON_SIZE:()=>n0,background:()=>Mw,cssVarDefaults:()=>Aw,forceShow:()=>Rd,hidden:()=>Md,label:()=>Td,labelBackground:()=>Ed,labelGroup:()=>xc,labelTrimmed:()=>Ad,link:()=>Cd,linkPath:()=>r0,linkSelectionHelper:()=>o0,links:()=>Tw,node:()=>i0,nodeExit:()=>Ew,nodeGroup:()=>Pd,nodeIcon:()=>a0,nodeSelectionRect:()=>s0,nodes:()=>Lw,root:()=>GP,sublabel:()=>Ld,variables:()=>Gt});var n0=22,GP=M`
|
|
661
|
+
label: sankey-component;
|
|
662
|
+
`,Aw={"--vis-sankey-link-cursor":"default","--vis-sankey-link-color":"var(--vis-color-main-light)","--vis-sankey-link-opacity":"0.5","--vis-sankey-link-hover-opacity":"1.0","--vis-sankey-node-cursor":"default","--vis-sankey-node-color":"var(--vis-color-main)","--vis-sankey-node-label-color":"#575c65","--vis-sankey-node-opacity":"0.9","--vis-sankey-node-hover-opacity":"1.0","--vis-sankey-node-selection-stroke-width":"1.5px","--vis-sankey-node-selection-stroke-opacity":"0.6","--vis-sankey-node-selection-border-radius":"2px","--vis-sankey-node-label-background-fill-color":"#ffffff","--vis-sankey-node-label-background-stroke-color":"#eaeaea","--vis-sankey-node-label-background-opacity":"0.9","--vis-sankey-node-label-cursor":"default","--vis-sankey-node-label-font-weight":"600","--vis-sankey-node-label-font-size":"12px","--vis-sankey-node-label-text-decoration":"none","--vis-sankey-node-sublabel-font-size":"10px","--vis-sankey-node-sublabel-font-weight":"500","--vis-sankey-icon-size":`${n0}px`,"--vis-sankey-icon-color":"#ffffff","--vis-sankey-icon-stroke-opacity":"0.6","--vis-sankey-icon-font-family":Xp,"--vis-dark-sankey-link-color":"var(--vis-color-main-dark)","--vis-dark-sankey-node-color":"var(--vis-color-main)","--vis-dark-sankey-node-label-color":"#eaeaea","--vis-dark-sankey-node-label-background-fill-color":"#292b34","--vis-dark-sankey-node-label-background-stroke-color":"#575c65","--vis-dark-sankey-icon-color":"#292b34"},Gt=ze(Aw);Be(Aw,GP);var Tw=M`
|
|
663
|
+
label: links;
|
|
664
|
+
`,Lw=M`
|
|
665
|
+
label: nodes;
|
|
666
|
+
`,Cd=M`
|
|
667
|
+
label: link;
|
|
668
|
+
|
|
669
|
+
path {
|
|
670
|
+
cursor: var(${Gt.sankeyLinkCursor});
|
|
671
|
+
fill: var(${Gt.sankeyLinkColor});
|
|
672
|
+
fill-opacity: var(${Gt.sankeyLinkOpacity});
|
|
673
|
+
}
|
|
674
|
+
|
|
675
|
+
&:hover {
|
|
676
|
+
path {
|
|
677
|
+
fill-opacity: var(${Gt.sankeyLinkHoverOpacity});
|
|
678
|
+
}
|
|
679
|
+
}
|
|
680
|
+
`,r0=M`
|
|
681
|
+
label: visible;
|
|
682
|
+
`,o0=M`
|
|
683
|
+
label: transparent;
|
|
684
|
+
opacity: 0;
|
|
685
|
+
`,xc=M`
|
|
686
|
+
label: label-group;
|
|
687
|
+
cursor: var(${Gt.sankeyNodeLabelCursor});
|
|
688
|
+
`,Ad=M`
|
|
689
|
+
label: label-trimmed;
|
|
690
|
+
`,Td=M`
|
|
691
|
+
label: label;
|
|
692
|
+
dominant-baseline: hanging;
|
|
693
|
+
|
|
694
|
+
fill: var(${Gt.sankeyNodeLabelColor});
|
|
695
|
+
text-decoration: var(${Gt.sankeyNodeLabelTextDecoration});
|
|
696
|
+
font-weight: var(${Gt.sankeyNodeLabelFontWeight});
|
|
697
|
+
user-select: none;
|
|
698
|
+
|
|
699
|
+
&, tspan {
|
|
700
|
+
font-family: var(--vis-sankey-label-font-family, var(--vis-font-family));
|
|
701
|
+
dominant-baseline: hanging;
|
|
702
|
+
}
|
|
703
|
+
`,Ld=M`
|
|
704
|
+
label: sub-label;
|
|
705
|
+
dominant-baseline: hanging;
|
|
706
|
+
|
|
707
|
+
fill: var(${Gt.sankeyNodeLabelColor});
|
|
708
|
+
user-select: none;
|
|
709
|
+
|
|
710
|
+
&, tspan {
|
|
711
|
+
font-family: var(--vis-sankey-label-font-family, var(--vis-font-family));
|
|
712
|
+
font-weight: var(${Gt.sankeyNodeSublabelFontWeight});
|
|
713
|
+
dominant-baseline: hanging;
|
|
714
|
+
}
|
|
715
|
+
`,Ed=M`
|
|
716
|
+
label: label-background;
|
|
717
|
+
stroke: var(${Gt.sankeyNodeLabelBackgroundStrokeColor});
|
|
718
|
+
fill: var(${Gt.sankeyNodeLabelBackgroundFillColor});
|
|
719
|
+
opacity: var(${Gt.sankeyNodeLabelBackgroundOpacity});
|
|
720
|
+
`,Md=M`
|
|
721
|
+
label: hidden;
|
|
722
|
+
visibility: hidden;
|
|
723
|
+
`,Rd=M`
|
|
724
|
+
label: forceShow;
|
|
725
|
+
visibility: visible;
|
|
726
|
+
`,Pd=M`
|
|
727
|
+
label: node-group;
|
|
728
|
+
`,i0=M`
|
|
729
|
+
label: node;
|
|
730
|
+
|
|
731
|
+
cursor: var(${Gt.sankeyNodeCursor});
|
|
732
|
+
fill: var(${Gt.sankeyNodeColor});
|
|
733
|
+
opacity: var(${Gt.sankeyNodeOpacity});
|
|
734
|
+
|
|
735
|
+
&:hover {
|
|
736
|
+
opacity: var(${Gt.sankeyNodeHoverOpacity});
|
|
737
|
+
}
|
|
738
|
+
`,a0=M`
|
|
739
|
+
label: icon;
|
|
740
|
+
|
|
741
|
+
font-family: var(${Gt.sankeyIconFontFamily});
|
|
742
|
+
text-anchor: middle;
|
|
743
|
+
font-size: var(${Gt.sankeyIconSize});
|
|
744
|
+
fill: var(${Gt.sankeyIconColor});
|
|
745
|
+
stroke: var(${Gt.sankeyNodeColor});
|
|
746
|
+
stroke-opacity: var(${Gt.sankeyIconStrokeOpacity});
|
|
747
|
+
user-select: none;
|
|
748
|
+
pointer-events: none;
|
|
749
|
+
dominant-baseline: central;
|
|
750
|
+
`,Ew=M`
|
|
751
|
+
label: node-exit;
|
|
752
|
+
`,s0=M`
|
|
753
|
+
label: node-selection-rect;
|
|
754
|
+
fill: none;
|
|
755
|
+
stroke: var(${Gt.sankeyNodeColor});
|
|
756
|
+
stroke-width: var(${Gt.sankeyNodeSelectionStrokeWidth});
|
|
757
|
+
stroke-opacity: var(${Gt.sankeyNodeSelectionStrokeOpacity});
|
|
758
|
+
rx: var(${Gt.sankeyNodeSelectionBorderRadius});
|
|
759
|
+
ry: var(${Gt.sankeyNodeSelectionBorderRadius});
|
|
760
|
+
`,Mw=M`
|
|
761
|
+
label: background;
|
|
762
|
+
`;function l0({x0:t,x1:e,y0:n,y1:r,width:o}){let i=n-o/2,a=r-o/2,s=n+o/2,l=r+o/2,c=(t+e)/2;return`
|
|
763
|
+
M ${t}, ${i}
|
|
764
|
+
|
|
765
|
+
C ${c}, ${i}
|
|
766
|
+
${c}, ${a}
|
|
767
|
+
${e}, ${a}
|
|
768
|
+
|
|
769
|
+
L ${e}, ${l}
|
|
770
|
+
|
|
771
|
+
C ${c}, ${l}
|
|
772
|
+
${c}, ${s}
|
|
773
|
+
${t}, ${s}
|
|
774
|
+
z
|
|
775
|
+
`}function Pw(t){return{x0:t.source.x1,x1:t.target.x0,y0:t.y0,y1:t.y1,width:Math.max(1,t.width)}}function WP(t){t.append("path").attr("class",r0).attr("d",(e,n,r)=>(r[n]._animState=Pw(e),l0(r[n]._animState))),t.append("path").attr("class",o0),t.style("opacity",0)}function VP(t,e,n){G(t,n).style("opacity",i=>i._state.greyout?.2:1);let r=t.select(`.${r0}`).style("cursor",i=>j(i,e.linkCursor)),o=G(r,n).style("fill",i=>K(i,e.linkColor)).style("mask",i=>Ft(Nt(i,e.linkPattern)));n?o.attrTween("d",(i,a,s)=>{let l=s[a]._animState,c=Pw(i),u={x0:ye(l.x0,c.x0),x1:ye(l.x1,c.x1),y0:ye(l.y0,c.y0),y1:ye(l.y1,c.y1),width:ye(l.width,c.width)};return function(f){let d={x0:u.x0(f),x1:u.x1(f),y0:u.y0(f),y1:u.y1(f),width:u.width(f)};return s[a]._animState=d,l0(d)}}):r.attr("d",(i,a,s)=>(s[a]._animState=Pw(i),l0(s[a]._animState))),t.select(`.${o0}`).attr("d",i=>l0({x0:i.source.x1,x1:i.target.x0,y0:i.y0,y1:i.y1,width:Math.max(10,i.width)})).style("cursor",i=>j(i,e.linkCursor))}function Iw(t){t.remove()}var Id=10,Nd=6.5;function $d(t,e){var n;return(n=t.labelFontSize)!==null&&n!==void 0?n:ue(Qe(Gt.sankeyNodeLabelFontSize),e)}function Dd(t,e){var n;return(n=t.subLabelFontSize)!==null&&n!==void 0?n:ue(Qe(Gt.sankeyNodeSublabelFontSize),e)}function c0(t,e,n,r){var o,i;let c=e.subLabelPlacement===Lo.Inline,u=`${(o=j(t,e.label))!==null&&o!==void 0?o:""}`,f=`${(i=j(t,e.subLabel))!==null&&i!==void 0?i:""}`,d=1.1*Oe(u,n),h=1.1*Oe(f,r);return c?8+(d+h):2+Math.max(d,h)}function L9(t,e,n,r=5,o=8){let i=e/2,a=o/2;return n===q.Left?`
|
|
776
|
+
M 0 0
|
|
777
|
+
${`L 0 ${i-a} L ${+r} ${i} L 0 ${i+a}`}
|
|
778
|
+
L 0 ${e}
|
|
779
|
+
L ${-t} ${e}
|
|
780
|
+
L ${-t} 0
|
|
781
|
+
L 0 0 `:`
|
|
782
|
+
M 0 0
|
|
783
|
+
${`L 0 ${i-a} L ${-r} ${i} L 0 ${i+a}`}
|
|
784
|
+
L 0 ${e}
|
|
785
|
+
L ${t} ${e}
|
|
786
|
+
L ${t} 0
|
|
787
|
+
L 0 0 `}function vs(t,e,n){let r=st(t,n);return(r===q.Auto||!r)&&(r=t.x1<e/2?q.Left:q.Right),r}function E9(t,e,n){switch(vs(t,n,e.labelPosition)){case q.Right:return e.nodeWidth+Id;case q.Left:default:return-Id}}function M9(t,e,n){let r=t.y1-t.y0;if(n.labelBackground&&r<e)return(r-e)/2;switch(n.labelVerticalAlign){case Le.Bottom:return r-e;case Le.Middle:return r/2-e/2;case Le.Top:default:return 0}}function R9(t,e,n){switch(vs(t,n,e.labelPosition)){case q.Right:return"start";case q.Left:default:return"end"}}function P9(t,e,n){let r=e.subLabelPlacement===Lo.Inline;switch(vs(t,n,e.labelPosition)){case q.Right:return r?"end":"start";case q.Left:default:return r?"start":"end"}}function I9(t,e,n,r,o,i){var a,s;let l=2*Id+2*Nd;return o===0?mt(r/2-l,0,(a=e.labelMaxWidth)!==null&&a!==void 0?a:1/0):t.layer===0&&n===q.Left?i.left-l:t.layer===o&&n===q.Right?i.right-l:mt(r-l,0,(s=e.labelMaxWidth)!==null&&s!==void 0?s:1/0)}function u0(t,e,n,r,o,i,a,s,l=!1){let c=t.select(`.${Td}`),u=n.labelBackground||l,f=t.select(`.${Ld}`),d=u?Nd:0,h=n.subLabelPlacement===Lo.Inline,p=n.labelForceWordBreak?"":n.labelTextSeparator,g=.32,m=vs(e,r,n.labelPosition),x=m===q.Left?-1:1,y=j(e,n.label),_=j(e,n.subLabel),v=!1,b=$d(n,t.node()),w=Dd(n,t.node()),A=_?b-w:0,L=d+(h&&A<0?-.6*A:0);c.text(y).attr("font-size",b).style("text-decoration",j(e,n.labelTextDecoration)).style("fill",K(e,n.labelColor)).attr("transform",`translate(${x*d},${L})`).style("cursor",J=>j(J,n.labelCursor));let E=I9(e,n,m,i,a,s),I=h?E*(1-(_?n.subLabelToLabelInlineWidthRatio:0)):E;n.labelFit===De.Wrap||l?En(c,I,p):v=Kn(c,I,n.labelTrimMode);let D=m_(c,b,g),F=x*(d+(h?E:0)),T=d+(h?A>0?.6*A:0:D.height+0);f.text(_).attr("font-size",w).style("text-decoration",j(e,n.subLabelTextDecoration)).style("fill",K(e,n.subLabelColor)).attr("transform",`translate(${F},${T})`).style("cursor",J=>j(J,n.labelCursor));let S=h?E*n.subLabelToLabelInlineWidthRatio:E;n.labelFit===De.Wrap||l?En(f,S,p):v=Kn(f,S,n.labelTrimMode)||v,t.classed(Ad,v);let k=m_(f,w,g),P=(h?Math.max(D.height,k.height):D.height+k.height)+2*d;t.select(`.${Ed}`).attr("d",()=>{if(!u)return null;let J=c0(e,n,b,w);return L9(Math.min(E,J)+2*d,P,m)});let R=R9(e,n,r),O=P9(e,n,r),W=E9(e,n,r),Y=M9(e,P,n);return c.attr("text-anchor",R),f.attr("text-anchor",O),t.attr("transform",`translate(${W},${Y})`),{x:e.x0+W,y:e.y0+Y,width:E,height:P,layer:e.layer,selection:t}}var Mo=3;function HP(t,e,n,r){let{enterTransitionType:o}=e;t.append("rect").attr("class",s0).attr("width",e.nodeWidth+Mo*2).attr("height",a=>a.y1-a.y0+Mo*2).attr("x",-Mo).attr("y",-Mo).style("stroke",a=>K(a,e.nodeColor)).style("opacity",0),t.append("rect").attr("class",i0).attr("width",e.nodeWidth).attr("height",a=>a.y1-a.y0).style("fill",a=>K(a,e.nodeColor)).style("mask",a=>Ft(Nt(a,e.nodePattern)));let i=t.append("g").attr("class",xc);i.append("path").attr("class",Ed),i.append("text").attr("class",Td),i.append("text").attr("class",Ld),t.append("text").attr("class",a0).attr("text-anchor","middle"),t.attr("transform",a=>{var s;let l=o===uc.FromAncestor&&(!((s=a.targetLinks)===null||s===void 0)&&s[0])?a.targetLinks[0].source.x0:a.x0;return`translate(${t.size()===1?n*.5-r.left:l}, ${a.y0})`}).style("opacity",0)}function N9(t,e,n,r,o){if(o)return t.x0;switch(e.nodeAlign){case nr.Left:return t.x0;case nr.Right:return n-r.right;case nr.Center:case nr.Justify:default:return n*.5-r.left}}function Nw(t,e,n,r,o){let i=r.labelMaxWidthTakeAvailableSpaceTolerance;if(!tt(i)){let s=$d(r,t.node()),l=Dd(r,t.node()),c=j(e,r.subLabel)&&r.subLabelPlacement!==Lo.Inline;i=(s+l)/(c?2:4)}let a=n.find(s=>s.layer>e.layer&&s.x0>=e.x1&&s.y1>=e.y0-i&&s.y0<=e.y1+i);return(a?a.x0:o)-e.x1}function jP(t,e,n,r,o,i,a){G(t,i).attr("transform",c=>`translate(${N9(c,e,n,r,o)},${c.y0})`).style("opacity",c=>c._state.greyout?.2:1),G(t.select(`.${s0}`),i).attr("width",e.nodeWidth+Mo*2).attr("height",c=>c.y1-c.y0+Mo*2).attr("x",-Mo).attr("y",-Mo).style("stroke",c=>K(c,e.nodeColor)).style("opacity",c=>{var u;return!((u=e.selectedNodeIds)===null||u===void 0)&&u.includes(c.id)?1:0}),G(t.select(`.${i0}`),i).attr("width",e.nodeWidth).attr("height",c=>c.y1-c.y0).style("cursor",c=>j(c,e.nodeCursor)).style("fill",c=>K(c,e.nodeColor)).style("mask",c=>Ft(Nt(c,e.nodePattern)));let s=rt(t.data(),c=>c.layer);$9(t,e,n,i,a,s,r);let l=t.select(`.${a0}`);e.nodeIcon?(l.each((c,u,f)=>{let d=U(f[u]),h=c.y1-c.y0,p=K(c,e.nodeIconColor),g=h>2?null:"hidden",m=h<n0?`${h*.65}px`:null;d.attr("visibility",g).style("stroke",p).style("fill",p).style("font-size",m).html(j(c,e.nodeIcon))}),G(l,i).attr("x",e.nodeWidth/2).attr("y",c=>(c.y1-c.y0)/2)):l.attr("visibility","hidden")}function $9(t,e,n,r,o,i,a){var s;let c=t.select(`.${xc}`).nodes()||[],u=t.data(),f=c.map(d=>{let h=U(d),p=h.datum(),g=e.labelMaxWidthTakeAvailableSpace?Nw(h,p,u,e,n):o;return u0(h,p,e,n,r,g,i,a)});if(e.labelVisibility)for(let d of f){let h=d.selection.datum(),p={x:d.x,y:d.y,width:d.width,height:d.height};d.hidden=!e.labelVisibility(h,p,!1)}else{let d=Math.max(...f.map(h=>h.layer));for(let h=0;h<=d;h+=1){let p=f.filter(m=>m.layer===h);p.sort((m,x)=>m.y-x.y);let g=0;for(let m=1;m<p.length;m+=1){let x=p[g],y=p[m],_=y.y<x.y+x.height,v=y.selection.datum();_&&(!((s=e.selectedNodeIds)===null||s===void 0)&&s.includes(v.id)?x.hidden=!0:y.hidden=!0),y.hidden||(g=m)}}}for(let d of f)d.selection.classed(Md,d.hidden).classed(Rd,!1)}function $w(t,e,n){let{exitTransitionType:r}=e;t.each((o,i,a)=>{var s;let l=U(a[i]),c=G(l,n);r===cc.ToAncestor&&(!((s=o.targetLinks)===null||s===void 0)&&s[0])&&c.attr("transform",`translate(${o.targetLinks[0].source.x0},${o.y0})`),c.style("opacity",0).remove()})}function YP(t,e,n,r,o,i,a){let s=n.raise().select(`.${xc}`),l=r.labelMaxWidthTakeAvailableSpace?Nw(n,t,e,r,o):i,c=rt(e,u=>u.layer);(r.labelExpandTrimmedOnHover&&s.classed(Ad)||s.classed(Md))&&u0(s,t,r,o,0,l,c,a,!0),s.classed(Rd,!0)}function UP(t,e,n,r,o,i,a){let s=n.select(`.${xc}`),l=r.labelMaxWidthTakeAvailableSpace?Nw(n,t,e,r,o):i;if(r.labelExpandTrimmedOnHover||s.classed(Md)){let c=rt(e,u=>u.layer);u0(s,t,r,o,0,l,c,a,!1)}s.classed(Rd,!1)}var Od=class t extends Te{constructor(e){var n;super(),this._defaultConfig=FP,this.config=this._defaultConfig,this.datamodel=new ea,this._prevWidth=void 0,this._extendedWidth=void 0,this._extendedHeight=void 0,this._extendedHeightIncreased=void 0,this._extendedWidthIncreased=void 0,this._sankey=Lg(),this._highlightTimeoutId=null,this._highlightActive=!1,this._zoomScale=[1,1],this._pan=[0,0],this._prevZoomTransform={x:0,y:0,k:1},this._animationFrameId=null,this._bleedCached=null,this.events={[t.selectors.nodeGroup]:{mouseenter:this._onNodeMouseOver.bind(this),mouseleave:this._onNodeMouseOut.bind(this)},[t.selectors.node]:{mouseenter:this._onNodeRectMouseOver.bind(this),mouseleave:this._onNodeRectMouseOut.bind(this)},[t.selectors.link]:{mouseenter:this._onLinkMouseOver.bind(this),mouseleave:this._onLinkMouseOut.bind(this)}},e&&this.setConfig(e),this._gNode=this.g.node(),this._backgroundRect=this.g.append("rect").attr("class",Mw).style("pointer-events","all"),this._linksGroup=this.g.append("g").attr("class",Tw),this._nodesGroup=this.g.append("g").attr("class",Lw),this._zoomScale=(n=this.config.zoomScale)!==null&&n!==void 0?n:[1,1],this._zoomBehavior=xs().scaleExtent(this.config.zoomExtent).on("zoom",r=>this._onZoom(r)),this.config.enableZoom&&this.g.call(this._zoomBehavior)}get bleed(){let{config:e,datamodel:{nodes:n,links:r}}=this,o={top:0,bottom:0,left:0,right:0};if(n.length){let i=$d(e,this.element),a=Dd(e,this.element),s=1e3;this._populateLinkAndNodeValues(),this._sankey.size([s,s]),this._sankey({nodes:n,links:r});let l=i*2.5+2*Nd,c=rt(n,A=>A.layer),u=n.filter(A=>A.layer===0),f=n.filter(A=>A.layer===c),d=this._getLayerSpacing(n),h=0,p=Math.min(this._width/6,d),g=e.labelMaxWidth||p,m=2*Id+2*Nd,x=u.some(A=>vs(A,s,e.labelPosition)===q.Left);if(x){let A=rt(u,L=>c0(L,e,i,a));h=bt([g,A])+m}let y=0,_=f.some(A=>vs(A,s,e.labelPosition)===q.Right);if(_){let A=rt(f,L=>c0(L,e,i,a));y=bt([g,A])+m}let v=e.labelVerticalAlign===Le.Top?0:e.labelVerticalAlign===Le.Bottom?l:l/3,b=e.labelVerticalAlign===Le.Top?l:e.labelVerticalAlign===Le.Bottom?0:l/3,w=e.selectedNodeIds?1+Mo:0;o={top:w+v,bottom:w+b,left:h+(x?0:w),right:y+(_?0:w)}}return this._bleedCached=o,o}setData(e){super.setData(e),(this.sizing!==Jt.Fit||!this._hasLinks())&&this._preCalculateComponentSize(),this._bleedCached=null}setConfig(e){super.setConfig(e),this.config.zoomScale!==void 0?this._zoomScale=this.config.zoomScale:this.prevConfig.zoomScale!==void 0&&(this._zoomScale=[1,1],this._pan=[0,0]),this.config.zoomPan!==void 0?this._pan=this.config.zoomPan:this.prevConfig.zoomPan!==void 0&&(this._pan=[0,0]),(this.sizing!==Jt.Fit||!this._hasLinks())&&this._preCalculateComponentSize();let n=((r,o)=>j(r,this.config.id,o));this._sankey.linkSort(this.config.linkSort),this._sankey.nodeId(n).nodeWidth(this.config.nodeWidth).nodePadding(this.config.nodePadding).nodeAlign(AR[this.config.nodeAlign]).nodeSort(this.config.nodeSort).iterations(this.config.iterations),this._zoomBehavior&&(this._zoomBehavior.scaleExtent(this.config.zoomExtent),this.config.enableZoom?this.g.call(this._zoomBehavior):this.g.on(".zoom",null)),this._bleedCached=null}_render(e){var n;let{config:r,datamodel:{nodes:o,links:i}}=this,a=this._prevWidth!==this._width;this._prevWidth=this._width;let s=a||!this._bleedCached?this.bleed:this._bleedCached,l=tt(e)?e:r.duration;(o.length===0||o.length===1&&i.length>0||o.length===1&&!r.showSingleNode||o.length>1&&i.length===0)&&(this._linksGroup.selectAll(`.${Cd}`).call(Iw,l),this._nodesGroup.selectAll(`.${Pd}`).call($w,r,l)),this._prepareLayout(),(n=r.onLayoutCalculated)===null||n===void 0||n.call(r,o,i,this.getSankeyDepth(),this.getWidth(),this.getHeight(),s);let c=this._linksGroup.selectAll(`.${Cd}`).data(i,(g,m)=>{var x;return(x=r.id(g,m))!==null&&x!==void 0?x:`${g.source.id}-${g.target.id}`}),u=c.enter().append("g").attr("class",Cd);u.call(WP),c.merge(u).call(VP,r,l),c.exit().call(Iw),o.sort((g,m)=>g.x0-m.x0);let f=this._getLayerSpacing(o),d=this._nodesGroup.selectAll(`.${Pd}`).data(o,(g,m)=>{var x;return(x=r.id(g,m))!==null&&x!==void 0?x:m}),h=d.enter().append("g").attr("class",Pd),p=this._getScaledWidth();h.call(HP,this.config,p,s),d.merge(h).call(jP,r,p,s,this._hasLinks(),l,f),d.exit().attr("class",Ew).call($w,r,l),this._applyPanTransform(l,s),this._backgroundRect.attr("width",this.getWidth()).attr("height",this.getHeight()).attr("opacity",0)}_applyPanTransform(e,n){var r;let o=(r=this.config.zoomPan)!==null&&r!==void 0?r:this._pan,i=n.left+o[0],a=n.top+o[1];G(this._linksGroup,e).attr("transform",`translate(${i},${a})`),G(this._nodesGroup,e).attr("transform",`translate(${i},${a})`)}_scheduleRender(e){this._animationFrameId==null&&(this._animationFrameId=requestAnimationFrame(()=>{this._render(e),this._animationFrameId=null}))}_getConstrainedPan(e,n=[1,1]){var r,o,i,a,s;let l=(r=this._bleedCached)!==null&&r!==void 0?r:this.bleed,c=this.datamodel.nodes,u=n[0]*((o=bt(c,y=>y.x0))!==null&&o!==void 0?o:0),f=n[1]*((i=bt(c,y=>y.y0))!==null&&i!==void 0?i:0),d=n[0]*((a=rt(c,y=>y.x1))!==null&&a!==void 0?a:0),h=n[1]*((s=rt(c,y=>y.y1))!==null&&s!==void 0?s:0),p=this.getWidth()-l.left-l.right,g=this.getHeight()-l.top-l.bottom,m=mt(e[0],p-d,u),x=mt(e[1],g-h,f);return[m,x]}setZoomScale(e,n,r=this.config.duration,o=ud.TopLeft){var i,a;if(this.config.zoomScale!==void 0)return;let[s,l]=this._zoomScale,c=[e/s,n/l],[u,f]=this.config.zoomExtent;tt(e)&&(this._zoomScale[0]=Math.min(f,Math.max(u,e))),tt(n)&&(this._zoomScale[1]=Math.min(f,Math.max(u,n)));let d=Math.sqrt(((i=this._zoomScale[0])!==null&&i!==void 0?i:1)*((a=this._zoomScale[1])!==null&&a!==void 0?a:1)),h=hn.scale(d);if(this._gNode.__zoom=h,this._prevZoomTransform.k=d,o===ud.Center){let p=this.getWidth()/2,g=this.getHeight()/2;this._pan[0]=p-(p-this._pan[0])*(this._zoomScale[0]/s),this._pan[1]=g-(g-this._pan[1])*(this._zoomScale[1]/l)}this._pan=this._getConstrainedPan(this._pan,c),this._prevZoomTransform.x=0,this._prevZoomTransform.y=0,this._render(r)}getZoomScale(){if(this.config.zoomPan===void 0)return[this._zoomScale[0]||1,this._zoomScale[1]||1]}setPan(e,n,r=this.config.duration,o=!1){let i=[e??0,n??0];this._pan=o?this._getConstrainedPan(i):i,this._prevZoomTransform.x=0,this._prevZoomTransform.y=0,this._scheduleRender(r)}getPan(){return this._pan}fitView(e=this.config.duration){var n,r;this._zoomScale=(n=this.config.zoomScale)!==null&&n!==void 0?n:[1,1],this._pan=(r=this.config.zoomPan)!==null&&r!==void 0?r:[0,0];let o=Math.sqrt(this._zoomScale[0]*this._zoomScale[1]),i=hn.scale(o);this._gNode.__zoom=i,this._prevZoomTransform.k=o,this._prevZoomTransform.x=0,this._prevZoomTransform.y=0,this._render(e)}_onZoom(e){var n,r,o,i,a,s,l,c,u,f;let{datamodel:d,config:h}=this;if(h.zoomScale||h.zoomPan)return;let p=d.nodes,g=e.transform,m=e.sourceEvent,x=h.zoomMode||kr.XY,y=(n=this._bleedCached)!==null&&n!==void 0?n:this.bleed,_=(r=bt(p,w=>w.x0))!==null&&r!==void 0?r:0,v=(o=bt(p,w=>w.y0))!==null&&o!==void 0?o:0;if(Math.abs(g.k-this._prevZoomTransform.k)>1e-6){let w=g.k/this._prevZoomTransform.k,A=!h.disableZoomModifierKeys&&!!m?.metaKey,L=!A&&!h.disableZoomModifierKeys&&!!m?.altKey,E=A||x===kr.X,I=L||x===kr.Y,[D,F]=this._zoomScale,$=I?D:mt(D*w,h.zoomExtent[0],h.zoomExtent[1]),T=E?F:mt(F*w,h.zoomExtent[0],h.zoomExtent[1]);this._zoomScale=[$,T];let S=m?oe(m,this.g.node()):[this._width/2,this._height/2],k=(a=(i=h.zoomPan)===null||i===void 0?void 0:i[0])!==null&&a!==void 0?a:this._pan[0],P=(l=(s=h.zoomPan)===null||s===void 0?void 0:s[1])!==null&&l!==void 0?l:this._pan[1],N=_+(S[0]-y.left-k-_)/D,R=v+(S[1]-y.top-P-v)/F;!I&&!isFinite((c=h.zoomPan)===null||c===void 0?void 0:c[0])&&x!==kr.Y&&(this._pan[0]=S[0]-y.left-(_+(N-_)*$)),!E&&!isFinite((u=h.zoomPan)===null||u===void 0?void 0:u[1])&&x!==kr.X&&(this._pan[1]=S[1]-y.top-(v+(R-v)*T))}else{let w=g.x-this._prevZoomTransform.x,A=g.y-this._prevZoomTransform.y;x!==kr.Y&&(this._pan[0]+=w),x!==kr.X&&(this._pan[1]+=A)}this._pan=this._getConstrainedPan(this._pan),this._prevZoomTransform.k=g.k,this._prevZoomTransform.x=g.x,this._prevZoomTransform.y=g.y,(f=h.onZoom)===null||f===void 0||f.call(h,this._zoomScale[0],this._zoomScale[1],this._pan[0],this._pan[1],h.zoomExtent,e),this._scheduleRender(0)}_populateLinkAndNodeValues(){let{config:e,datamodel:n}=this,r=n.nodes;n.links.forEach((i,a)=>{i.value=z(i,s=>z(s,e.linkValue,a))}),r.forEach((i,a)=>{i.fixedValue=z(i,e.nodeFixedValue,a)})}_preCalculateComponentSize(){let{bleed:e,config:n,datamodel:r}=this,o=r.nodes;o.length&&(this._populateLinkAndNodeValues(),this._sankey(r));let i=Hn(o,f=>f.value||void 0),a=[n.nodeMinHeight,n.nodeMaxHeight],s=fr().domain(i).range(a).clamp(!0);o.forEach(f=>{f._state.precalculatedHeight=s(f.value)||n.nodeMinHeight});let l=co(o,f=>f.layer),c=Object.values(l).map(f=>Ko(f.map(d=>d._state.precalculatedHeight+n.nodePadding))-n.nodePadding),u=rt(c)||n.nodeMinHeight;this._extendedHeight=u+e.top+e.bottom,this._extendedWidth=Math.max(0,(n.nodeWidth+n.nodeHorizontalSpacing)*Object.keys(l).length-n.nodeHorizontalSpacing+e.left+e.right)}_prepareLayout(){var e,n,r;let{config:o,datamodel:i}=this,a=(e=this._bleedCached)!==null&&e!==void 0?e:this.bleed,s=this.sizing===Jt.Extend,l=this.sizing===Jt.Fit?this._height:this._extendedHeight,c=this.sizing===Jt.Fit?this._width:this._extendedWidth;this._sankey.size([Math.max(c-a.left-a.right,0),Math.max(l-a.top-a.bottom,0)]);let u=i.nodes,f=i.links;if(!this._hasLinks()){let d=0,h=Ko(u,p=>p._state.precalculatedHeight||1);for(let p of u){let g=this.getHeight()-a.top-a.bottom,m=p._state.precalculatedHeight||1,x=s?m:(g-o.nodePadding*(u.length-1))*m/h;p.width=Math.max(10,o.nodeWidth),p.x0=0,p.x1=p.width,p.y0=d,p.y1=d+Math.max(1,x),p.layer=0,d=p.y1+o.nodePadding}if(this._applyLayoutScaling(),s){let p=rt(u,m=>m.y1)||0,g=rt(u,m=>m.x1)||0;this._extendedHeightIncreased=p+a.top+a.bottom,this._extendedWidthIncreased=g+a.left+a.right}else this._extendedHeightIncreased=void 0,this._extendedWidthIncreased=void 0;return}this._populateLinkAndNodeValues(),this._sankey({nodes:u,links:f});for(let d of u){let h=s&&!(!((n=d.sourceLinks)===null||n===void 0)&&n.length)&&!(!((r=d.targetLinks)===null||r===void 0)&&r.length),p=Math.max(h?o.nodeMinHeight:1,d.y1-d.y0),g=(d.y0+d.y1)/2;d.y0=g-p/2,d.y1=g+p/2}if(this._applyLayoutScaling(),s){let d=rt(u,p=>p.y1)||0,h=rt(u,p=>p.x1)||0;this._extendedHeightIncreased=d+a.top+a.bottom,this._extendedWidthIncreased=h+a.left+a.right}}_applyLayoutScaling(){var e,n;let{datamodel:r}=this,o=r.nodes,i=r.links,[a,s]=this._zoomScale;if((a===1||!isFinite(a))&&(s===1||!isFinite(s)))return;let l=(e=bt(o,f=>f.x0))!==null&&e!==void 0?e:0,c=new Map(o.map(f=>[f,{x0:f.x0,x1:f.x1,y0:f.y0,y1:f.y1}])),u=new Map(i.map(f=>[f,{y0:f.y0,y1:f.y1}]));if(isFinite(a)&&a!==1)for(let f of o){let d=f.width||f.x1-f.x0,h=f.x0-l;f.x0=l+h*a,f.x1=f.x0+d}if(isFinite(s)&&s!==1){let f=(n=bt(o,d=>d.y0))!==null&&n!==void 0?n:0;for(let d of o){let h=d.y1-d.y0,p=d.y0-f;d.y0=f+p*s,d.y1=d.y0+h}for(let d of i){let h=u.get(d),p=c.get(d.source),g=c.get(d.target),m=d.source.y0-p.y0,x=d.target.y0-g.y0;d.y0=h.y0+m,d.y1=h.y1+x}}}getWidth(){return this.sizing===Jt.Fit?this._width:Math.max(this._extendedWidthIncreased||0,this._extendedWidth||0)}getHeight(){return this.sizing===Jt.Fit?this._height:Math.max(this._extendedHeightIncreased||0,this._extendedHeight||0)}getLayoutWidth(){return this.sizing===Jt.Fit?this._width:this._extendedWidthIncreased||this._extendedWidth}getLayoutHeight(){return this.sizing===Jt.Fit?this._height:this._extendedHeightIncreased||this._extendedHeight}getSankeyDepth(){let{datamodel:e}=this;return rt(e.nodes,n=>n.layer)}getColumnCenters(){return this.getLayerXCenters()}getLayerXCenters(){let{datamodel:e}=this;return e.nodes.reduce((o,i)=>{let a=i.layer;return isFinite(o[a])||(o[a]=(i.x0+i.x1)/2),o},[])}getLayerYCenters(){let{datamodel:e}=this,n=e.nodes,r=co(n,i=>i.layer),o=[];return Object.values(r).forEach((i,a)=>{let s=Math.min(...i.map(c=>c.y0)),l=Math.max(...i.map(c=>c.y1));o[a]=(s+l)/2}),o}highlightSubtree(e){let{config:n,datamodel:r}=this;clearTimeout(this._highlightTimeoutId),this._highlightTimeoutId=setTimeout(()=>{for(let o of r.nodes)o._state.greyout=!0;for(let o of r.links)o._state.greyout=!0;this.recursiveSetSubtreeState(e,"sourceLinks","target","greyout",!1),this.recursiveSetSubtreeState(e,"targetLinks","source","greyout",!1),this._render(n.highlightDuration),this._highlightActive=!0},n.highlightDelay)}recursiveSetSubtreeState(e,n,r,o,i){e._state[o]=i;for(let a of e[n])a._state[o]=i,this.recursiveSetSubtreeState(a[r],n,r,o,i)}disableHighlight(){let{config:e,datamodel:n}=this;if(clearTimeout(this._highlightTimeoutId),this._highlightActive){this._highlightActive=!1;for(let r of n.nodes)r._state.greyout=!1;for(let r of n.links)r._state.greyout=!1;this._render(e.highlightDuration)}}_hasLinks(){let{datamodel:e}=this;return e.links.length>0}_getLayerSpacing(e){let{config:n}=this;if(!e?.length)return 0;let r=e.find(i=>i.layer===0),o=e.find(i=>i.layer===r.layer+1);return o?o.x0-(r.x0+n.nodeWidth):this._width-r.x1}_getScaledWidth(){return(this.sizing===Jt.Fit?this._width:this._extendedWidth)*this._zoomScale[0]}_onNodeMouseOver(e,n){var r;let{datamodel:o}=this,i=(r=this._bleedCached)!==null&&r!==void 0?r:this.bleed,a=U(n.currentTarget),s=this._getScaledWidth();YP(e,o.nodes,a,this.config,s,this._getLayerSpacing(this.datamodel.nodes),i)}_onNodeMouseOut(e,n){var r;let{datamodel:o}=this,i=(r=this._bleedCached)!==null&&r!==void 0?r:this.bleed,a=U(n.currentTarget),s=this._getScaledWidth();UP(e,o.nodes,a,this.config,s,this._getLayerSpacing(this.datamodel.nodes),i)}_onNodeRectMouseOver(e){let{config:n}=this;n.highlightSubtreeOnHover&&this.highlightSubtree(e)}_onNodeRectMouseOut(){this.disableHighlight()}_onLinkMouseOver(e){let{config:n}=this;n.highlightSubtreeOnHover&&this.highlightSubtree(e.target)}_onLinkMouseOut(){this.disableHighlight()}};Od.selectors=Rw;var qP=Object.assign(Object.assign({},Ae),{value:void 0,color:void 0,colorRange:void 0,colorDomain:void 0,numRows:void 0,numColumns:void 0,layout:gs.Column,offset:0,cellSize:void 0,cellPadding:2,cellCornerRadius:2,cursor:null,columnLabel:void 0,rowLabel:void 0,labelHideOverlapping:!0});function zd(t){return t==null?null:Array.isArray(t)?t:[t,t]}function XP(t,e,n,r,o){let[i,a]=zd(t);return{width:o.left+e*i+Math.max(0,e-1)*r+o.right,height:o.top+n*a+Math.max(0,n-1)*r+o.bottom}}function ZP(t,e,n,r,o,i){let a=zd(t);return a?{cellWidth:a[0],cellHeight:a[1]}:{cellWidth:Math.max(0,(e-(r-1)*i)/r),cellHeight:Math.max(0,(n-(o-1)*i)/o)}}function KP(t,e,n,r){let o=Math.max(0,t);if(e===gs.Row){let s=Math.max(1,r??7);return{rows:Math.max(1,n??(Math.ceil(o/s)||1)),columns:s}}let i=Math.max(1,n??7),a=Math.max(1,r??(Math.ceil(o/i)||1));return{rows:i,columns:a}}function QP(t,e,n,r){return e===gs.Row?{row:Math.floor(t/r),column:t%r}:{row:t%n,column:Math.floor(t/n)}}var Gw={};Wt(Gw,{cell:()=>f0,cellEmpty:()=>zw,columnLabel:()=>Bw,cssVarDefaults:()=>Dw,defaultColorRange:()=>Ow,label:()=>d0,root:()=>JP,rowLabel:()=>Fw,variables:()=>rr});var JP=M`
|
|
788
|
+
label: heatmap-component;
|
|
789
|
+
`,Dw={"--vis-heatmap-cell-fill-color":"#ebedf0","--vis-heatmap-cell-stroke-color":"transparent","--vis-heatmap-cell-stroke-width":"0px","--vis-heatmap-cell-cursor":"default","--vis-heatmap-color-1":"#9be9a8","--vis-heatmap-color-2":"#40c463","--vis-heatmap-color-3":"#30a14e","--vis-heatmap-color-4":"#216e39","--vis-heatmap-label-color":"#6e7781","--vis-heatmap-label-font-size":"12px","--vis-heatmap-label-font-family":void 0,"--vis-heatmap-label-font-weight":"400","--vis-dark-heatmap-cell-fill-color":"#161b22","--vis-dark-heatmap-color-1":"#0e4429","--vis-dark-heatmap-color-2":"#006d32","--vis-dark-heatmap-color-3":"#26a641","--vis-dark-heatmap-color-4":"#39d353","--vis-dark-heatmap-label-color":"#7d8590"},rr=ze(Dw);Be(Dw,JP);var Ow=["var(--vis-heatmap-color-1)","var(--vis-heatmap-color-2)","var(--vis-heatmap-color-3)","var(--vis-heatmap-color-4)"],f0=M`
|
|
790
|
+
label: cell;
|
|
791
|
+
stroke: var(${rr.heatmapCellStrokeColor});
|
|
792
|
+
stroke-width: var(${rr.heatmapCellStrokeWidth});
|
|
793
|
+
cursor: var(${rr.heatmapCellCursor});
|
|
794
|
+
`,zw=M`
|
|
795
|
+
label: cell-empty;
|
|
796
|
+
fill: var(${rr.heatmapCellFillColor});
|
|
797
|
+
`,d0=M`
|
|
798
|
+
label: label;
|
|
799
|
+
fill: var(${rr.heatmapLabelColor});
|
|
800
|
+
font-size: var(${rr.heatmapLabelFontSize});
|
|
801
|
+
font-family: var(${rr.heatmapLabelFontFamily}, var(--vis-font-family));
|
|
802
|
+
font-weight: var(${rr.heatmapLabelFontWeight});
|
|
803
|
+
`,Bw=M`
|
|
804
|
+
label: column-label;
|
|
805
|
+
text-anchor: start;
|
|
806
|
+
dominant-baseline: alphabetic;
|
|
807
|
+
`,Fw=M`
|
|
808
|
+
label: row-label;
|
|
809
|
+
text-anchor: end;
|
|
810
|
+
dominant-baseline: middle;
|
|
811
|
+
`;var Bd=class extends Te{constructor(e){super(),this._defaultConfig=qP,this.config=this._defaultConfig,this.datamodel=new Fn,this.events={},this._labelPadding=6,e&&this.setConfig(e),this.cellsGroup=this.g.append("g"),this.columnLabelsGroup=this.g.append("g"),this.rowLabelsGroup=this.g.append("g")}get bleed(){let{config:e}=this,n=this._getLabelFontSize(),{rows:r}=this._getGridSize(),o=0;if(e.rowLabel){let a=On(Qe(rr.heatmapLabelFontFamily),this.element)||On("var(--vis-font-family)",this.element),s=0;for(let l=0;l<r;l+=1){let c=e.rowLabel(l);c&&(s=Math.max(s,is(c,a,n)))}s&&(o=s+this._labelPadding)}return{top:e.columnLabel?n+this._labelPadding:0,bottom:0,left:o,right:0}}getWidth(){return this._usesExtendedCellSize()?this._getIntrinsicSize().width:this._width}getHeight(){return this._usesExtendedCellSize()?this._getIntrinsicSize().height:this._height}_render(e){var n,r,o;let{config:i,datamodel:a,bleed:s}=this,l=tt(e)?e:i.duration,c=a.data,{rows:u,columns:f}=this._getGridSize(),d=i.offset||0,h=(n=i.cellPadding)!==null&&n!==void 0?n:0,p=this._width-s.left-s.right,g=this._height-s.top-s.bottom,{cellWidth:m,cellHeight:x}=ZP(i.cellSize,p,g,f,u,h),y=m+h,_=x+h,v=i.cellCornerRadius===!0?2:i.cellCornerRadius||0,b=[],w=c.map((R,O)=>{let W=z(R,i.value,O);tt(W)&&b.push(W);let Y=O+d,{row:J,column:nt}=QP(Y,i.layout,u,f);return{datum:R,index:O,gridIndex:Y,row:J,column:nt,value:W,x:s.left+nt*y,y:s.top+J*_,width:m,height:x}}),A=(r=i.colorRange)!==null&&r!==void 0?r:Ow,L=Hn(b),E=(o=i.colorDomain)!==null&&o!==void 0?o:tt(L[0])&&tt(L[1])?[L[0],L[1]]:[0,1],I=Ha().domain(E).range(A),D=Qe(rr.heatmapCellFillColor),F=R=>{if(i.color!=null){let O=K(R.datum,i.color,R.index,!0);if(O)return O}return tt(R.value)?I(R.value):D},$=R=>{let O=mt(v,0,Math.min(R.width,R.height)/2);return Vi({x:R.x,y:R.y,w:R.width,h:R.height,r:O,tl:!0,tr:!0,bl:!0,br:!0})},T=this.cellsGroup.selectAll(`.${f0}`).data(w,R=>`${R.row}-${R.column}`),k=T.enter().append("path").attr("class",f0).attr("d",$).style("fill",F).style("opacity",0).merge(T);k.classed(zw,R=>!tt(R.value)).style("transition",l?`fill ${l}ms`:null).style("fill",F),i.cursor&&k.style("cursor",R=>j(R.datum,i.cursor,R.index)),G(k,l).attr("d",$).style("opacity",1),G(T.exit(),l).style("opacity",0).remove();let P=this._renderColumnLabels(f,y),N=this._renderRowLabels(u,_,x);this._resolveLabelOverlap(P,N)}_renderColumnLabels(e,n){let{config:r,bleed:o}=this,i=r.columnLabel,a=i?Yn(e).map(f=>({column:f,label:i(f)})).filter(f=>f.label!=null&&f.label!==""):[],s=this.columnLabelsGroup.selectAll("g").data(a,f=>`${f.column}`),l=s.enter().append("g").style("opacity",0);l.append("text").attr("class",`${d0} ${Bw}`);let c=l.merge(s),u=c.select("text");return u.attr("x",f=>o.left+f.column*n).attr("y",Math.max(0,o.top-this._labelPadding)).text(f=>f.label),G(c,this.config.duration).style("opacity",1),G(s.exit(),this.config.duration).style("opacity",0).remove(),u}_renderRowLabels(e,n,r){let{config:o,bleed:i}=this,a=o.rowLabel,s=a?Yn(e).map(d=>({row:d,label:a(d)})).filter(d=>d.label!=null&&d.label!==""):[],l=this.rowLabelsGroup.selectAll("g").data(s,d=>`${d.row}`),c=l.enter().append("g").style("opacity",0);c.append("text").attr("class",`${d0} ${Fw}`);let u=c.merge(l),f=u.select("text");return f.attr("x",Math.max(0,i.left-this._labelPadding)).attr("y",d=>i.top+d.row*n+r/2).text(d=>d.label),G(u,this.config.duration).style("opacity",1),G(l.exit(),this.config.duration).style("opacity",0).remove(),f}_resolveLabelOverlap(e,n){if(!this.config.labelHideOverlapping){e.style("opacity",null),n.style("opacity",null);return}cancelAnimationFrame(this._labelCollisionAnimFrameId),this._labelCollisionAnimFrameId=requestAnimationFrame(()=>{vf(e,{tolerance:-2}),vf(n,{tolerance:-2})})}_usesExtendedCellSize(){return(this.sizing===Jt.Extend||this.sizing===Jt.FitWidth)&&zd(this.config.cellSize)!=null}_getIntrinsicSize(){var e;let{config:n}=this,r=zd(n.cellSize);if(!r)return{width:this._width,height:this._height};let{columns:o,rows:i}=this._getGridSize(),a=(e=n.cellPadding)!==null&&e!==void 0?e:0;return XP(r,o,i,a,this.bleed)}_getGridSize(){let{config:e,datamodel:n}=this,r=n.data.length+(e.offset||0);return KP(r,e.layout,e.numRows,e.numColumns)}_getLabelFontSize(){return ue(Qe(rr.heatmapLabelFontSize),this.element)||12}_mapEventDatum(e,n){var r;return{datum:e?.datum,index:(r=e?.index)!==null&&r!==void 0?r:n}}};Bd.selectors=Gw;var tI=Object.assign(Object.assign({},Ae),{id:(t,e)=>{var n;return(n=t.id)!==null&&n!==void 0?n:e},value:void 0,tileColor:void 0,layers:[],tileFunction:void 0,tileSort:void 0,tilePadding:2,tilePaddingTop:void 0,tileShowHtmlTooltip:!0,labelInternalNodes:!1,labelOffsetX:4,labelOffsetY:4,labelFit:De.Wrap,labelTrimMode:Ue.Middle,tileBorderRadius:2,tileBorderRadiusFactor:1/8,enableLightnessVariance:!1,enableTileLabelFontSizeVariation:!0,tileLabelSmallFontSize:8,tileLabelMediumFontSize:12,tileLabelLargeFontSize:22,showTileClickAffordance:!1,lightnessVariationAmount:.08,minTileSizeForLabel:20,numberFormat:t=>`${t}`,tileLabel:function(t){return`${t.data.key}: ${this.numberFormat(t.value)}`}});var jw={};Wt(jw,{clickableTile:()=>Vw,internalLabel:()=>Hw,label:()=>g0,labelGroup:()=>Fd,root:()=>nI,tile:()=>p0,tileExiting:()=>m0,tileForeground:()=>D9,tileGroup:()=>h0,tiles:()=>Ww,variables:()=>Ro});var eI={"--vis-treemap-tile-stroke-color":"#fff","--vis-treemap-tile-stroke-width":"2px","--vis-treemap-tile-hover-stroke-color":"#fff","--vis-treemap-tile-hover-stroke-opacity":0,"--vis-treemap-label-opacity":.8,"--vis-treemap-label-font-weight":"normal","--vis-treemap-label-text-color":"#000","--vis-treemap-label-text-color-light":"#fff","--vis-treemap-label-font-size":"12px"},nI=M`
|
|
812
|
+
label: treemap-component;
|
|
813
|
+
`,Ro=ze(eI);Be(eI,nI);var Ww=M`
|
|
814
|
+
label: g-tiles;
|
|
815
|
+
`,h0=M`
|
|
816
|
+
label: tile-group;
|
|
817
|
+
`,p0=M`
|
|
818
|
+
label: tile;
|
|
819
|
+
stroke: var(${Ro.treemapTileHoverStrokeColor});
|
|
820
|
+
stroke-opacity: 0;
|
|
821
|
+
|
|
822
|
+
&:hover {
|
|
823
|
+
stroke-opacity: var(${Ro.treemapTileHoverStrokeOpacity})
|
|
824
|
+
}
|
|
825
|
+
`,m0=M`
|
|
826
|
+
label: tile-exiting;
|
|
827
|
+
pointer-events: none;
|
|
828
|
+
`,Vw=M`
|
|
829
|
+
label: clickable-tile;
|
|
830
|
+
cursor: pointer;
|
|
831
|
+
`,D9=M`
|
|
832
|
+
label: tile-foreground;
|
|
833
|
+
`,g0=M`
|
|
834
|
+
label: label;
|
|
835
|
+
text-anchor: start;
|
|
836
|
+
dominant-baseline: hanging;
|
|
837
|
+
user-select: none;
|
|
838
|
+
pointer-events: none;
|
|
839
|
+
font-size: var(${Ro.treemapLabelFontSize});
|
|
840
|
+
opacity: var(${Ro.treemapLabelOpacity});
|
|
841
|
+
fill: var(${Ro.treemapLabelTextColor});
|
|
842
|
+
font-weight: var(${Ro.treemapLabelFontWeight});
|
|
843
|
+
`,Hw=M`
|
|
844
|
+
label: internal-label;
|
|
845
|
+
font-weight: 500;
|
|
846
|
+
`,Fd=M`
|
|
847
|
+
label: label-group;
|
|
848
|
+
`;var Gd=class extends Te{constructor(e){super(),this._defaultConfig=tI,this.config=this._defaultConfig,this.datamodel=new Fn,e&&this.setConfig(e),this.tiles=this.g.append("g").attr("class",Ww)}_render(e){var n;super._render(e);let{config:r,datamodel:{data:o},_width:i,_height:a}=this,s=tt(e)?e:r.duration;if(!(!((n=r.layers)===null||n===void 0)&&n.length)){console.warn("Unovis | Treemap: No layers defined");return}let l=r.layers.map(k=>P=>j(o[P],k,P)),c=lo(o.keys(),...l),u=Ur(c);r.value?u.sum(k=>tt(k)&&z(o[k],r.value,k)):u.count(),u.each(k=>{!k.children&&k.parent&&(k.parent.children=null)});let f=u;f.each((k,P)=>{let N=k,R=k,O=!R.children,W={key:R.data[0],isLeaf:O};O&&(W.index=R.data[1][0],W.datum=o[W.index]),N.data=W,N._id=`node-${P}`,N.topLevelParent=this._getTopLevelParent(N)}),(r.tileSort||r.tileSort===null)&&f.sort(r.tileSort);let d=mw().size([i,a]).round(!0).padding(r.tilePadding);r.tileFunction&&d.tile(r.tileFunction),this.config.tilePaddingTop!==void 0&&d.paddingTop(k=>k.parent?r.tilePaddingTop:0);let p=d(f).descendants(),g=rt(p,k=>k.depth),m=fr().domain([1,g]).range([0,1]),x=p.filter(k=>!k.children).map(k=>k.value),y=Math.sqrt(rt(x))||0,_=ja().domain([y/3,y*2/3]).range([r.tileLabelSmallFontSize,r.tileLabelMediumFontSize,r.tileLabelLargeFontSize]),v=p.filter(k=>k.depth>0),b=v.filter(k=>k.depth===1),w=v.filter(k=>k.depth>1);b.forEach((k,P)=>{k._fill=K(k,r.tileColor,P)}),w.forEach((k,P)=>{var N;let R=K(k,r.tileColor,P,void 0,{dontFallbackToCssVar:!0});if(R){k._fill=R;return}let O=za(Gr((N=k.parent)===null||N===void 0?void 0:N._fill,this.element));if(r.enableLightnessVariance&&!k.children&&k.parent){let W=k.parent.children,Y=this._getTileLightness(k,W);O.l=Math.min(1,O.l+Y)}k._fill=RT(O.toString(),m(k.depth))});let A=this.tiles.selectAll(`g.${h0}:not(.${m0})`).data(v,k=>`${k.data.key}-${k.depth}`),L=A.enter().append("g").attr("class",h0);L.append("clipPath").append("rect").attr("rx",k=>this._getTileBorderRadius(k)).attr("ry",k=>this._getTileBorderRadius(k));let E=L.append("rect").classed(p0,!0).classed(Vw,k=>r.showTileClickAffordance&&!k.children).attr("rx",k=>this._getTileBorderRadius(k)).attr("ry",k=>this._getTileBorderRadius(k)).attr("x",k=>k.x0).attr("y",k=>k.y0).attr("width",this._getTileWidth).attr("height",this._getTileHeight).style("fill",k=>k._fill).style("opacity",0).style("cursor",r.showTileClickAffordance?k=>k.children?null:"pointer":null);r.tileShowHtmlTooltip&&E.append("title"),L.append("g").attr("class",Fd).attr("transform",k=>`translate(${k.x0+r.labelOffsetX},${k.y0+r.labelOffsetY})`).style("opacity",0).append("text").attr("class",g0).attr("x",0).attr("y",0);let I=A.merge(L);I.select("clipPath").attr("id",k=>`clip-${this.uid}-${k._id}`),I.select("clipPath rect").attr("width",k=>Math.max(this._getTileWidth(k)-2*r.labelOffsetX,0)).attr("height",k=>Math.max(this._getTileHeight(k)-2*r.labelOffsetY,0));let D=I.select(`rect.${p0}`);G(D,s).style("fill",k=>k._fill).style("opacity",1).attr("x",k=>k.x0).attr("y",k=>k.y0).attr("width",this._getTileWidth).attr("height",this._getTileHeight);let F=D.select("title");r.tileShowHtmlTooltip?F.text(k=>r.tileLabel(k)):F.remove();let $=I.select(`g.${Fd}`).attr("clip-path",k=>`url(#clip-${this.uid}-${k._id})`);G($,s).attr("transform",k=>`translate(${k.x0+r.labelOffsetX},${k.y0+r.labelOffsetY})`).style("opacity",1);let T=I.select(`g.${Fd} text`);T.text(k=>{let P=r.labelInternalNodes?!0:!k.children,N=this._isTileLargeEnough(k);return P&&N&&ge(r.tileLabel)?r.tileLabel(k):null}).property("font-size-px",k=>{var P;let N=Math.sqrt((P=k.value)!==null&&P!==void 0?P:0);return r.enableTileLabelFontSizeVariation&&!k.children?_(N):null}).style("font-size",(k,P,N)=>`${U(N[P]).property("font-size-px")}px`).style("fill",k=>Qe(PT(k._fill)?Ro.treemapLabelTextColorLight:Ro.treemapLabelTextColor)),T.each((k,P,N)=>{var R;let O=!k.children,W=N[P];if(!W.textContent)return;let Y=U(W),J=k.x1-k.x0-((R=r.labelOffsetX)!==null&&R!==void 0?R:0)*2;r.labelFit===De.Wrap&&O?En(Y,J):Kn(Y,J,r.labelTrimMode)}),I.select(`text.${g0}`).classed(Hw,k=>!!k.children);let S=A.exit().classed(m0,!0);G(S,s).style("opacity",0).remove()}_isTileLargeEnough(e){let n=this._getTileWidth(e),r=this._getTileHeight(e);return n>=this.config.minTileSizeForLabel&&r>=this.config.minTileSizeForLabel}_getTopLevelParent(e){if(e.depth===1)return e;if(e.depth>1){let n=e.parent;for(;n&&n.depth>1;)n=n.parent;return n?.depth===1?n:void 0}}_getTileLightness(e,n){let[r,o]=Hn(n,i=>i.value);return r===o||!e.value?0:this.config.lightnessVariationAmount*((o-e.value)/(o-r))}_getTileBorderRadius(e){return Math.min(this.config.tileBorderRadius,this._getTileWidth(e)*this.config.tileBorderRadiusFactor)}_getTileHeight(e){return Math.max(e.y1-e.y0,.5)}_getTileWidth(e){return Math.max(e.x1-e.x0,.5)}};Gd.selectors=jw;var rI=Object.assign(Object.assign({},Ae),{duration:800,highlightedNodeId:void 0,highlightedLinkIds:[],linkColor:void 0,linkPattern:void 0,linkValue:t=>t.value,nodeLevels:[],nodeWidth:15,nodeColor:t=>t.color,nodePattern:void 0,nodeLabel:t=>{var e;return(e=t.label)!==null&&e!==void 0?e:t.key},nodeLabelColor:void 0,nodeLabelAlignment:Ee.Along,padAngle:.02,cornerRadius:2,angleRange:[0,2*Math.PI],radiusScaleExponent:2});function oI(t){t.style("opacity",0).each((e,n,r)=>{let o=r[n],i=(e.x0+e.x1)/2,a=(e.x1-e.x0)/2;o._animState={x0:i-a*.8,x1:i+a*.8,y0:e.y0,y1:e.y1}})}function iI(t,e,n,r){let o=i=>K(i.data,e.nodeColor,i.height);t.attr("id",i=>i.uid).style("transition",`fill ${r}ms`).style("fill",o).style("stroke",o).style("mask",i=>Ft(Nt(i.data,e.nodePattern,i.height))),r?G(t,r).style("opacity",1).attrTween("d",(a,s,l)=>{let c=l[s],u={x0:a.x0,x1:a.x1,y0:a.y0,y1:a.y1},f=re(c._animState,u);return d=>(c._animState=f(d),n(c._animState))}):t.attr("d",i=>n(i)).style("opacity",1)}function aI(t,e){G(t,e).style("opacity",0).remove()}var Kw={};Wt(Kw,{background:()=>Yw,highlightedLink:()=>Vd,highlightedNode:()=>Wd,label:()=>x0,labelExit:()=>Zw,labelText:()=>v0,labels:()=>Xw,link:()=>yc,links:()=>qw,node:()=>vc,nodes:()=>Uw,root:()=>sI,transparent:()=>y0,variables:()=>O9});var sI=M`
|
|
849
|
+
label: chord-diagram-component;
|
|
850
|
+
`,O9=Pt`
|
|
851
|
+
:root {
|
|
852
|
+
--vis-chord-diagram-link-fill-color: #cad5f6;
|
|
853
|
+
--vis-chord-diagram-link-stroke-color: #777777;
|
|
854
|
+
--vis-chord-diagram-link-opacity: 0.5;
|
|
855
|
+
--vis-chord-diagram-link-stroke-opacity: 0.15;
|
|
856
|
+
--vis-chord-diagram-link-highlighted-opacity: 0.9;
|
|
857
|
+
--vis-chord-diagram-link-dimmed-opacity: 0.25;
|
|
858
|
+
|
|
859
|
+
--vis-chord-diagram-node-highlighted-opacity: 0.9;
|
|
860
|
+
--vis-chord-diagram-node-dimmed-opacity: 0.25;
|
|
861
|
+
|
|
862
|
+
--vis-chord-diagram-label-text-fill-color-bright: #ffffff;
|
|
863
|
+
--vis-chord-diagram-label-text-fill-color-dark: #a5abb2;
|
|
864
|
+
--vis-chord-diagram-label-text-font-size: 1em;
|
|
865
|
+
|
|
866
|
+
--vis-dark-chord-diagram-link-fill-color: #575c65;
|
|
867
|
+
}
|
|
868
|
+
|
|
869
|
+
${Yt} ${`.${sI}`} {
|
|
870
|
+
--vis-chord-diagram-link-fill-color: var(--vis-dark-chord-diagram-link-fill-color);
|
|
871
|
+
}
|
|
872
|
+
`,Yw=M`
|
|
873
|
+
label: background;
|
|
874
|
+
`,Uw=M`
|
|
875
|
+
label: nodes;
|
|
876
|
+
`,qw=M`
|
|
877
|
+
label: links;
|
|
878
|
+
`,Xw=M`
|
|
879
|
+
label: labels;
|
|
880
|
+
`,vc=M`
|
|
881
|
+
label: node;
|
|
882
|
+
stroke-width: 0;
|
|
883
|
+
fill: var(--vis-color-main);
|
|
884
|
+
stroke: var(--vis-color-main);
|
|
885
|
+
transition: .1s fill-opacity;
|
|
886
|
+
`,Wd=M`
|
|
887
|
+
label: highlighted;
|
|
888
|
+
fill-opacity: var(--vis-chord-diagram-node-highlighted-opacity);
|
|
889
|
+
stroke-width: 1.5;
|
|
890
|
+
`,x0=M`
|
|
891
|
+
label: label;
|
|
892
|
+
`,v0=M`
|
|
893
|
+
label: label-text;
|
|
894
|
+
|
|
895
|
+
dominant-baseline: middle;
|
|
896
|
+
user-select: none;
|
|
897
|
+
font-size: var(--vis-chord-diagram-label-text-font-size);
|
|
898
|
+
|
|
899
|
+
> textPath {
|
|
900
|
+
dominant-baseline: central;
|
|
901
|
+
}
|
|
902
|
+
`,Zw=M`
|
|
903
|
+
label: label-exit;
|
|
904
|
+
`,yc=M`
|
|
905
|
+
label: link;
|
|
906
|
+
|
|
907
|
+
fill: var(--vis-chord-diagram-link-fill-color);
|
|
908
|
+
fill-opacity: var(--vis-chord-diagram-link-opacity);
|
|
909
|
+
stroke: var(--vis-chord-diagram-link-stroke-color);
|
|
910
|
+
stroke-opacity: var(--vis-chord-diagram-link-stroke-opacity);
|
|
911
|
+
transition: .1s fill-opacity;
|
|
912
|
+
`,Vd=M`
|
|
913
|
+
label: highlighted;
|
|
914
|
+
fill-opacity: var(--vis-chord-diagram-link-highlighted-opacity);
|
|
915
|
+
`,y0=M`
|
|
916
|
+
label: transparent;
|
|
917
|
+
|
|
918
|
+
${`.${yc}`}:not(${`.${Vd}`}) {
|
|
919
|
+
fill-opacity: var(--vis-chord-diagram-link-dimmed-opacity);
|
|
920
|
+
}
|
|
921
|
+
|
|
922
|
+
${`.${vc}`}:not(${`.${Wd}`}) {
|
|
923
|
+
fill-opacity: var(--vis-chord-diagram-node-dimmed-opacity);
|
|
924
|
+
}
|
|
925
|
+
`;var Hd=3;function z9(t,e){var n;switch((n=st(t.data,e.nodeLabelAlignment))!==null&&n!==void 0?n:Ee.Along){case Ee.Perpendicular:return K(t.data,e.nodeColor,t.height);case Ee.Along:{let o=K(t.data,e.nodeColor,t.height),i=Ut(o);return(i?zn(i.hex()):0)>.65?"var(--vis-chord-diagram-label-text-fill-color-dark)":"var(--vis-chord-diagram-label-text-fill-color-bright)"}}}function B9(t,e){var n;switch((n=st(t.data,e.nodeLabelAlignment))!==null&&n!==void 0?n:Ee.Along){case Ee.Perpendicular:return(t.x0+t.x1)/2*180/Math.PI<180?"start":"end";case Ee.Along:return null}}function lI(t,e,n){var r;switch((r=st(t.data,e.nodeLabelAlignment))!==null&&r!==void 0?r:Ee.Along){case Ee.Perpendicular:{let i=n(t.y1)+Hd,s=(t.x0+t.x1)/2-Math.PI/2,l=i*Math.cos(s),c=i*Math.sin(s);return`translate(${l}, ${c})`}case Ee.Along:return null}}function cI(t,e,n){t.style("opacity",0).attr("transform",r=>lI(r,e,n)),t.append("text").attr("class",v0).style("fill",r=>K(r.data,e.nodeColor,r.height))}function uI(t,e,n,r,o){let{nodeLabel:i,nodeLabelColor:a,nodeWidth:s}=e;G(t,o).attr("transform",c=>lI(c,e,r)).style("opacity",1);let l=t.select(`.${v0}`);l.selectAll("textPath").remove(),l.text(c=>j(c.data,i)).style("transition",`fill ${o}ms`).style("fill",c=>{var u;return(u=K(c.data,a))!==null&&u!==void 0?u:z9(c,e)}).style("text-anchor",c=>B9(c,e)).each((c,u,f)=>{var d;let h=(d=st(c.data,e.nodeLabelAlignment))!==null&&d!==void 0?d:Ee.Along,p=c.x1-c.x0-z(c.data,e.padAngle)*2,m=(r(c.y1)-z(c,e.nodeWidth)/2)*p,x=h===Ee.Along?m:n-Hd*2,y=U(f[u]).call(Kn,x).attr("dx",h===Ee.Along?Hd:null).attr("dy",h===Ee.Along?z(c.data,s)/2:null),_=wo(y.node()),v=y.text();h===Ee.Along&&(y.text(""),_<=x&&y.append("textPath").attr("href",`#${c.uid}`).text(v))}),G(l,o).attr("transform",c=>{if(st(c.data,e.nodeLabelAlignment)!==Ee.Perpendicular)return null;let d=(c.x0+c.x1)/2*180/Math.PI;return`rotate(${d<180?d-90:d+90})`})}function fI(t,e){G(t,e).style("opacity",0).remove()}function F9(t){let{height:e,depth:n}=t;if(e>0){let r=t.data,o=t;o.data={key:r[0],values:r[1],depth:n,height:e,ancestors:o.ancestors().map(i=>i.data.key)}}}function dI(t,e,n=[]){let r=n.map(a=>s=>s[a]),o=n.length?lo(t,...r):{key:"root",children:t};return Ur(o).sum(a=>z(a,e)).each(F9)}function hI(t,e,n=.95){if(!t.children)return;let r=t.value>0,o=t.x1-t.x0,i=o*(t.y0===0?1:n),a=o-i,s=r?e:i/t.children.length,l=ui().startAngle(t.x0+a/2).endAngle(t.x1-a/2).padAngle(s).value(c=>r?c.value:1).sort((c,u)=>t.children.indexOf(c)-t.children.indexOf(u))(t.children);t.children.forEach((c,u)=>{let f=l[u].startAngle,d=l[u].endAngle,h=(d-f)*(1-n),p=(f+d)/2;c.x0=r?f+h/2:p-e/2,c.x1=r?d-h/2:p+e/2})}function pI(t,e,n){let r=co(e,c=>c.source._id),o=co(e,c=>c.target._id),i=t.leaves(),a=Gv(i,c=>c.data._id),s=(c,u,f,d=[])=>(d[c.height]=c,d[f*2-u.height]=u,c.parent&&u.parent&&s(c.parent,u.parent,f,d),d),l=(c,u,f,d)=>{c.forEach(h=>{var p;h._state.points||(h._state.points=[]);let g=a.get(h.source._id),m=a.get(h.target._id),y=s(u==="out"?g:m,u==="out"?m:g,d)[f],_=y.x1-y.x0-n,v=(p=y._prevX1)!==null&&p!==void 0?p:y.x0+n/2,b=v+_*h._state.value/y.value;y._prevX1=b;let w=u==="out"?f:d*2-1-f;h._state.points[w]={a0:v,a1:b,r:y.y1}})};return i.forEach(c=>{let u=r[c.data._id]||[],f=o[c.data._id]||[];for(let d=0;d<c.depth;d+=1)l(u,"out",d,c.depth),l(f,"in",d,c.depth)}),e.map(c=>({source:a.get(c.source._id),target:a.get(c.target._id),data:c,points:c._state.points,_state:{}}))}var Qw=Math.abs,ys=Math.cos,_s=Math.sin,mI=Math.PI,jd=mI/2,IMt=mI*2;var _0=1e-12;var gI=Array.prototype.slice;function na(t){return function(){return t}}function G9(t){return t.source}function W9(t){return t.target}function xI(t){return t.radius}function V9(t){return t.startAngle}function H9(t){return t.endAngle}function j9(){return 0}function Y9(t){var e=G9,n=W9,r=xI,o=xI,i=V9,a=H9,s=j9,l=null;function c(){var u,f=e.apply(this,arguments),d=n.apply(this,arguments),h=s.apply(this,arguments)/2,p=gI.call(arguments),g=+r.apply(this,(p[0]=f,p)),m=i.apply(this,p)-jd,x=a.apply(this,p)-jd,y=+o.apply(this,(p[0]=d,p)),_=i.apply(this,p)-jd,v=a.apply(this,p)-jd;if(l||(l=u=Lm()),h>_0&&(Qw(x-m)>h*2+_0?x>m?(m+=h,x-=h):(m-=h,x+=h):m=x=(m+x)/2,Qw(v-_)>h*2+_0?v>_?(_+=h,v-=h):(_-=h,v+=h):_=v=(_+v)/2),l.moveTo(g*ys(m),g*_s(m)),l.arc(0,0,g,m,x),m!==_||x!==v)if(t){var b=+t.apply(this,arguments),w=y-b,A=(_+v)/2;l.quadraticCurveTo(0,0,w*ys(_),w*_s(_)),l.lineTo(y*ys(A),y*_s(A)),l.lineTo(w*ys(v),w*_s(v))}else l.quadraticCurveTo(0,0,y*ys(_),y*_s(_)),l.arc(0,0,y,_,v);if(l.quadraticCurveTo(0,0,g*ys(m),g*_s(m)),l.closePath(),u)return l=null,u+""||null}return t&&(c.headRadius=function(u){return arguments.length?(t=typeof u=="function"?u:na(+u),c):t}),c.radius=function(u){return arguments.length?(r=o=typeof u=="function"?u:na(+u),c):r},c.sourceRadius=function(u){return arguments.length?(r=typeof u=="function"?u:na(+u),c):r},c.targetRadius=function(u){return arguments.length?(o=typeof u=="function"?u:na(+u),c):o},c.startAngle=function(u){return arguments.length?(i=typeof u=="function"?u:na(+u),c):i},c.endAngle=function(u){return arguments.length?(a=typeof u=="function"?u:na(+u),c):a},c.padAngle=function(u){return arguments.length?(s=typeof u=="function"?u:na(+u),c):s},c.source=function(u){return arguments.length?(e=u,c):e},c.target=function(u){return arguments.length?(n=u,c):n},c.context=function(u){return arguments.length?(l=u??null,c):l},c}function Jw(){return Y9()}function tk(){return"M0,0 L0,0"}var U9=Jw().source(t=>t[0]).target(t=>t[t.length-1]).startAngle(t=>t.a0).endAngle(t=>t.a1),q9=Pm().curve(Wi.catmullRom.alpha(.5)).startAngle((t,e,n)=>e<n.length/2?t.a1:t.a0).endAngle((t,e,n)=>e<n.length/2?t.a0:t.a1);function ek(t,e){var n;let r=t.length===2?U9:q9;r.radius(l=>e(l.r));let o=r(t);if(t.length===2)return o;let i=o.slice(0,-1),a=i.concat(`L${(n=i.match(/M-?\d*\.?\d*[,\s*]-?\d*\.?\d*/))===null||n===void 0?void 0:n[0].slice(1)}`),s=Math.max(e(t[0].r),0);return yM(a,s)}function vI(t,e){t.attr("d",n=>ek(n.points,e)||tk()).style("opacity",0)}function yI(t,e,n,r){t.style("transition",`fill ${r}ms`).style("fill",i=>K(i.data,e.linkColor)).style("stroke",i=>K(i.data,e.linkColor)).style("mask",i=>Ft(Nt(i.data,e.linkPattern)));let o=G(t,r).style("opacity",1);r?o.attrTween("d",(i,a,s)=>{let l=U(s[a]).attr("d"),c=ek(i.points,n)||tk();return ls(l,c)}):o.attr("d",i=>ek(i.points,n)||tk())}function _I(t,e){G(t,e).style("opacity",0).remove()}var Yd=class t extends Te{constructor(e){super(),this._defaultConfig=rI,this.config=this._defaultConfig,this.datamodel=new ea,this.arcGen=Qn(),this.radiusScale=$i(),this.events={[t.selectors.node]:{mouseover:this._onNodeMouseOver.bind(this),mouseout:this._onNodeMouseOut.bind(this)},[t.selectors.link]:{mouseover:this._onLinkMouseOver.bind(this),mouseout:this._onLinkMouseOut.bind(this)},[t.selectors.label]:{mouseover:this._onNodeMouseOver.bind(this),mouseout:this._onNodeMouseOut.bind(this)}},this._nodes=[],this._links=[],e&&this.setConfig(e),this.background=this.g.append("rect").attr("class",Yw),this.linkGroup=this.g.append("g").attr("class",qw),this.nodeGroup=this.g.append("g").attr("class",Uw),this.labelGroup=this.g.append("g").attr("class",Xw)}get _forceHighlight(){var e;return this.config.highlightedNodeId!==void 0||((e=this.config.highlightedLinkIds)===null||e===void 0?void 0:e.length)>0}get bleed(){let{config:e}=this,n=Hd*2,r=0,o=0,i=0,a=0;return this._nodes.forEach(s=>{var l;let c=st(s.data,e.nodeLabelAlignment);if(s.height===0&&c===Ee.Perpendicular){let u=(l=j(s.data,e.nodeLabel))!==null&&l!==void 0?l:"",f=ue("var(--vis-chord-diagram-label-text-font-size)",this.element),d=Oe(u,f),[h,p]=this.arcGen.centroid(s);h<0?a=Math.max(a,d):i=Math.max(i,d),p<0?r=Math.max(r,d):o=Math.max(o,d)}}),a+=n,i+=n,o+=n,r+=n,{top:r,bottom:o,left:a,right:i}}setSize(e,n,r,o){super.setSize(e,n,r,o),this.radiusScale.exponent(this.config.radiusScaleExponent).range([0,Math.min(e,n)/2])}setData(e){super.setData(e),this._layoutData()}_layoutData(){let{nodes:e}=this.datamodel,{links:n}=this.datamodel,{padAngle:r,linkValue:o,nodeLevels:i}=this.config;e.forEach(c=>{delete c._state.value}),n.forEach(c=>{delete c._state.points,c._state.value=z(c,o),c.source._state.value=(c.source._state.value||0)+z(c,o),c.target._state.value=(c.target._state.value||0)+z(c,o)}),n=n.filter(c=>c._state.value);let a=dI(e,c=>{var u;return(u=c._state)===null||u===void 0?void 0:u.value},i),s=wd().size([this.config.angleRange[1],1])(a);s.each((c,u)=>{hI(c,r),c.uid=`${this.uid.substr(0,4)}-${u}`,c.x0=Number.isNaN(c.x0)?0:c.x0,c.x1=Number.isNaN(c.x1)?0:c.x1,c._state={}});let l=s.descendants();this._rootNode=l.find(c=>c.depth===0),this._nodes=l.filter(c=>c.depth!==0),this._links=pI(s,n,r)}_render(e){var n;super._render(e);let{config:r,bleed:o}=this;this._layoutData();let i=tt(e)?e:r.duration,a=Math.min(this._width,this._height),s=a/2-rt([o.top,o.bottom,o.left,o.right]),l=1+((n=r.nodeLevels)===null||n===void 0?void 0:n.length),c=r.nodeWidth*l,u=s>c?r.nodeWidth:Math.max(s/l,0);this.radiusScale.range([0,Math.max(s,0)]),this.arcGen.startAngle(b=>b.x0+r.padAngle/2-(b.value?0:Math.PI/360)).endAngle(b=>b.x1-r.padAngle/2+(b.value?0:Math.PI/360)).cornerRadius(b=>z(b.data,r.cornerRadius)).innerRadius(b=>Math.max(this.radiusScale(b.y1)-u,0)).outerRadius(b=>this.radiusScale(b.y1)),this.g.classed(y0,this._forceHighlight),this.background.attr("width",this._width).attr("height",this._height).style("opacity",0),this.nodeGroup.attr("transform",`translate(${this._width/2},${this._height/2})`),this.labelGroup.attr("transform",`translate(${this._width/2},${this._height/2})`),this.linkGroup.attr("transform",`translate(${this._width/2},${this._height/2})`);let f=this.linkGroup.selectAll(`.${yc}`).data(this._links,b=>String(b.data._id)),d=f.enter().append("path").attr("class",yc).call(vI,this.radiusScale);f.merge(d).classed(Vd,b=>{var w,A;let L=(w=b.data.id)!==null&&w!==void 0?w:b.data._indexGlobal;return(A=r.highlightedLinkIds)===null||A===void 0?void 0:A.includes(L)}).call(yI,r,this.radiusScale,i),f.exit().call(_I,i);let p=this.nodeGroup.selectAll(`.${vc}`).data(this._nodes,b=>String(b.uid)),g=p.enter().append("path").attr("class",vc).call(oI,r);p.merge(g).classed(Wd,b=>r.highlightedNodeId===b.data._id).call(iI,r,this.arcGen,i,this.bleed),p.exit().call(aI,i);let x=a-s,y=this.labelGroup.selectAll(`.${x0}`).data(this._nodes,b=>String(b.uid)),_=y.enter().append("g").attr("class",x0).call(cI,r,this.radiusScale);y.merge(_).call(uI,r,x,this.radiusScale,i),y.exit().attr("class",Zw).call(fI,i)}_onNodeMouseOver(e){let n;if(e.children){let r=e.leaves();n=this._links.filter(o=>r.find(i=>o.source.data.id===i.data.id||o.target.data.id===i.data.id))}else{let r=e;n=this._links.filter(o=>o.source.data.id===r.data.id||o.target.data.id===r.data.id)}n.length||(e._state.hovered=!0),this._highlightOnHover(n)}_onNodeMouseOut(){this._highlightOnHover()}_onLinkMouseOver(e){this._highlightOnHover([e])}_onLinkMouseOut(){this._highlightOnHover()}_highlightOnHover(e){this._forceHighlight||(e?e.forEach(n=>{n._state.hovered=!0;let r=n.source.path(this._rootNode),o=n.target.path(this._rootNode);r.forEach(i=>{i.depth&&(i._state.hovered=!0)}),o.forEach(i=>{i.depth&&(i._state.hovered=!0)})}):(this._nodes.forEach(n=>{delete n._state.hovered}),this._links.forEach(n=>{delete n._state.hovered})),this.nodeGroup.selectAll(`.${vc}`).classed(Wd,n=>n._state.hovered),this.linkGroup.selectAll(`.${yc}`).classed(Vd,n=>n._state.hovered),this.g.classed(y0,!!e))}};Yd.selectors=Kw;function _c(t,e,n,r){function o(i){return i instanceof n?i:new n(function(a){a(i)})}return new(n||(n=Promise))(function(i,a){function s(u){try{c(r.next(u))}catch(f){a(f)}}function l(u){try{c(r.throw(u))}catch(f){a(f)}}function c(u){u.done?i(u.value):o(u.value).then(s,l)}c((r=r.apply(t,e||[])).next())})}Ml();var b0=t=>()=>t;function nk(t,{sourceEvent:e,target:n,selection:r,mode:o,dispatch:i}){Object.defineProperties(this,{type:{value:t,enumerable:!0,configurable:!0},sourceEvent:{value:e,enumerable:!0,configurable:!0},target:{value:n,enumerable:!0,configurable:!0},selection:{value:r,enumerable:!0,configurable:!0},mode:{value:o,enumerable:!0,configurable:!0},_:{value:i}})}function bI(t){t.stopImmediatePropagation()}function w0(t){t.preventDefault(),t.stopImmediatePropagation()}var wI={name:"drag"},rk={name:"space"},bc={name:"handle"},wc={name:"center"},{abs:kI,max:vn,min:yn}=Math;function SI(t){return[+t[0],+t[1]]}function sk(t){return[SI(t[0]),SI(t[1])]}var ok={name:"x",handles:["w","e"].map(Ud),input:function(t,e){return t==null?null:[[+t[0],e[0][1]],[+t[1],e[1][1]]]},output:function(t){return t&&[t[0][0],t[1][0]]}},ik={name:"y",handles:["n","s"].map(Ud),input:function(t,e){return t==null?null:[[e[0][0],+t[0]],[e[1][0],+t[1]]]},output:function(t){return t&&[t[0][1],t[1][1]]}},X9={name:"xy",handles:["n","w","e","s","nw","ne","sw","se"].map(Ud),input:function(t){return t==null?null:sk(t)},output:function(t){return t}},gi={overlay:"crosshair",selection:"move",n:"ns-resize",e:"ew-resize",s:"ns-resize",w:"ew-resize",nw:"nwse-resize",ne:"nesw-resize",se:"nwse-resize",sw:"nesw-resize"},CI={e:"w",w:"e",nw:"ne",ne:"nw",se:"sw",sw:"se"},AI={n:"s",s:"n",nw:"sw",ne:"se",se:"ne",sw:"nw"},Z9={overlay:1,selection:1,n:null,e:1,s:null,w:-1,nw:-1,ne:1,se:1,sw:-1},K9={overlay:1,selection:1,n:-1,e:null,s:1,w:null,nw:-1,ne:-1,se:1,sw:1};function Ud(t){return{type:t}}function Q9(t){return!t.ctrlKey&&!t.button}function J9(){var t=this.ownerSVGElement||this;return t.hasAttribute("viewBox")?(t=t.viewBox.baseVal,[[t.x,t.y],[t.x+t.width,t.y+t.height]]):[[0,0],[t.width.baseVal.value,t.height.baseVal.value]]}function tY(){return navigator.maxTouchPoints||"ontouchstart"in this}function ak(t){for(;!t.__brush;)if(!(t=t.parentNode))return;return t.__brush}function eY(t){return t[0][0]===t[1][0]||t[0][1]===t[1][1]}function lk(){return nY(X9)}function nY(t){var e=J9,n=Q9,r=tY,o=!0,i=Vr("start","brush","end"),a=6,s;function l(m){var x=m.property("__brush",g).selectAll(".overlay").data([Ud("overlay")]);x.enter().append("rect").attr("class","overlay").attr("pointer-events","all").attr("cursor",gi.overlay).merge(x).each(function(){var _=ak(this).extent;U(this).attr("x",_[0][0]).attr("y",_[0][1]).attr("width",_[1][0]-_[0][0]).attr("height",_[1][1]-_[0][1])}),m.selectAll(".selection").data([Ud("selection")]).enter().append("rect").attr("class","selection").attr("cursor",gi.selection).attr("fill","#777").attr("fill-opacity",.3).attr("stroke","#fff").attr("shape-rendering","crispEdges");var y=m.selectAll(".handle").data(t.handles,function(_){return _.type});y.exit().remove(),y.enter().append("rect").attr("class",function(_){return"handle handle--"+_.type}).attr("cursor",function(_){return gi[_.type]}),m.each(c).attr("fill","none").attr("pointer-events","all").on("mousedown.brush",d).filter(r).on("touchstart.brush",d).on("touchmove.brush",h).on("touchend.brush touchcancel.brush",p).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}l.move=function(m,x,y){m.tween?m.on("start.brush",function(_){u(this,arguments).beforestart().start(_)}).on("interrupt.brush end.brush",function(_){u(this,arguments).end(_)}).tween("brush",function(){var _=this,v=_.__brush,b=u(_,arguments),w=v.selection,A=t.input(typeof x=="function"?x.apply(this,arguments):x,v.extent),L=re(w,A);function E(I){v.selection=I===1&&A===null?null:L(I),c.call(_),b.brush()}return w!==null&&A!==null?E:E(1)}):m.each(function(){var _=this,v=arguments,b=_.__brush,w=t.input(typeof x=="function"?x.apply(_,v):x,b.extent),A=u(_,v).beforestart();Bn(_),b.selection=w===null?null:w,c.call(_),A.start(y).brush(y).end(y)})},l.clear=function(m,x){l.move(m,null,x)};function c(){var m=U(this),x=ak(this).selection;x?(m.selectAll(".selection").style("display",null).attr("x",x[0][0]).attr("y",x[0][1]).attr("width",x[1][0]-x[0][0]).attr("height",x[1][1]-x[0][1]),m.selectAll(".handle").style("display",null).attr("x",function(y){return y.type[y.type.length-1]==="e"?x[1][0]-a/2:x[0][0]-a/2}).attr("y",function(y){return y.type[0]==="s"?x[1][1]-a/2:x[0][1]-a/2}).attr("width",function(y){return y.type==="n"||y.type==="s"?x[1][0]-x[0][0]+a:a}).attr("height",function(y){return y.type==="e"||y.type==="w"?x[1][1]-x[0][1]+a:a})):m.selectAll(".selection,.handle").style("display","none").attr("x",null).attr("y",null).attr("width",null).attr("height",null)}function u(m,x,y){var _=m.__brush.emitter;return _&&(!y||!_.clean)?_:new f(m,x,y)}function f(m,x,y){this.that=m,this.args=x,this.state=m.__brush,this.active=0,this.clean=y}f.prototype={beforestart:function(){return++this.active===1&&(this.state.emitter=this,this.starting=!0),this},start:function(m,x){return this.starting?(this.starting=!1,this.emit("start",m,x)):this.emit("brush",m),this},brush:function(m,x){return this.emit("brush",m,x),this},end:function(m,x){return--this.active===0&&(delete this.state.emitter,this.emit("end",m,x)),this},emit:function(m,x,y){var _=U(this.that).datum();i.call(m,this.that,new nk(m,{sourceEvent:x,target:l,selection:t.output(this.state.selection),mode:y,dispatch:i}),_)}};function d(m){if(s&&!m.touches||!n.apply(this,arguments))return;var x=this,y=m.target.__data__.type,_=(o&&m.metaKey?y="overlay":y)==="selection"?wI:o&&m.altKey?wc:bc,v=t===ik?null:Z9[y],b=t===ok?null:K9[y],w=ak(x),A=w.extent,L=w.selection,E=A[0][0],I,D,F=A[0][1],$,T,S=A[1][0],k,P,N=A[1][1],R,O,W=0,Y=0,J,nt=v&&b&&o&&m.shiftKey,et,xt,Z=Array.from(m.touches||[m],Q=>{let yt=Q.identifier;return Q=oe(Q,x),Q.point0=Q.slice(),Q.identifier=yt,Q});Bn(x);var vt=u(x,arguments,!0).beforestart();if(y==="overlay"){L&&(J=!0);let Q=[Z[0],Z[1]||Z[0]];w.selection=L=[[I=t===ik?E:yn(Q[0][0],Q[1][0]),$=t===ok?F:yn(Q[0][1],Q[1][1])],[k=t===ik?S:vn(Q[0][0],Q[1][0]),R=t===ok?N:vn(Q[0][1],Q[1][1])]],Z.length>1&<(m)}else I=L[0][0],$=L[0][1],k=L[1][0],R=L[1][1];D=I,T=$,P=k,O=R;var X=U(x).attr("pointer-events","none"),at=X.selectAll(".overlay").attr("cursor",gi[y]);if(m.touches)vt.moved=H,vt.ended=ct;else{var B=U(m.view).on("mousemove.brush",H,!0).on("mouseup.brush",ct,!0);o&&B.on("keydown.brush",gt,!0).on("keyup.brush",ot,!0),us(m.view)}c.call(x),vt.start(m,_.name);function H(Q){for(let yt of Q.changedTouches||[Q])for(let ne of Z)ne.identifier===yt.identifier&&(ne.cur=oe(yt,x));if(nt&&!et&&!xt&&Z.length===1){let yt=Z[0];kI(yt.cur[0]-yt[0])>kI(yt.cur[1]-yt[1])?xt=!0:et=!0}for(let yt of Z)yt.cur&&(yt[0]=yt.cur[0],yt[1]=yt.cur[1]);J=!0,w0(Q),lt(Q)}function lt(Q){let yt=Z[0],ne=yt.point0;var Ne;switch(W=yt[0]-ne[0],Y=yt[1]-ne[1],_){case rk:case wI:{v&&(W=vn(E-I,yn(S-k,W)),D=I+W,P=k+W),b&&(Y=vn(F-$,yn(N-R,Y)),T=$+Y,O=R+Y);break}case bc:{Z[1]?(v&&(D=vn(E,yn(S,Z[0][0])),P=vn(E,yn(S,Z[1][0])),v=1),b&&(T=vn(F,yn(N,Z[0][1])),O=vn(F,yn(N,Z[1][1])),b=1)):(v<0?(W=vn(E-I,yn(S-I,W)),D=I+W,P=k):v>0&&(W=vn(E-k,yn(S-k,W)),D=I,P=k+W),b<0?(Y=vn(F-$,yn(N-$,Y)),T=$+Y,O=R):b>0&&(Y=vn(F-R,yn(N-R,Y)),T=$,O=R+Y));break}case wc:{v&&(D=vn(E,yn(S,I-W*v)),P=vn(E,yn(S,k+W*v))),b&&(T=vn(F,yn(N,$-Y*b)),O=vn(F,yn(N,R+Y*b)));break}}P<D&&(v*=-1,Ne=I,I=k,k=Ne,Ne=D,D=P,P=Ne,y in CI&&at.attr("cursor",gi[y=CI[y]])),O<T&&(b*=-1,Ne=$,$=R,R=Ne,Ne=T,T=O,O=Ne,y in AI&&at.attr("cursor",gi[y=AI[y]])),w.selection&&(L=w.selection),et&&(D=L[0][0],P=L[1][0]),xt&&(T=L[0][1],O=L[1][1]),(L[0][0]!==D||L[0][1]!==T||L[1][0]!==P||L[1][1]!==O)&&(w.selection=[[D,T],[P,O]],c.call(x),vt.brush(Q,_.name))}function ct(Q){if(bI(Q),Q.touches){if(Q.touches.length)return;s&&clearTimeout(s),s=setTimeout(function(){s=null},500)}else fs(Q.view,J),B.on("keydown.brush keyup.brush mousemove.brush mouseup.brush",null);X.attr("pointer-events","all"),at.attr("cursor",gi.overlay),w.selection&&(L=w.selection),eY(L)&&(w.selection=null,c.call(x)),vt.end(Q,_.name)}function gt(Q){switch(Q.keyCode){case 16:{nt=v&&b;break}case 18:{_===bc&&(v&&(k=P-W*v,I=D+W*v),b&&(R=O-Y*b,$=T+Y*b),_=wc,lt(Q));break}case 32:{(_===bc||_===wc)&&(v<0?k=P-W:v>0&&(I=D-W),b<0?R=O-Y:b>0&&($=T-Y),_=rk,at.attr("cursor",gi.selection),lt(Q));break}default:return}w0(Q)}function ot(Q){switch(Q.keyCode){case 16:{nt&&(et=xt=nt=!1,lt(Q));break}case 18:{_===wc&&(v<0?k=P:v>0&&(I=D),b<0?R=O:b>0&&($=T),_=bc,lt(Q));break}case 32:{_===rk&&(Q.altKey?(v&&(k=P-W*v,I=D+W*v),b&&(R=O-Y*b,$=T+Y*b),_=wc):(v<0?k=P:v>0&&(I=D),b<0?R=O:b>0&&($=T),_=bc),at.attr("cursor",gi[y]),lt(Q));break}default:return}w0(Q)}}function h(m){u(this,arguments).moved(m)}function p(m){u(this,arguments).ended(m)}function g(){var m=this.__brush||{selection:null};return m.extent=sk(e.apply(this,arguments)),m.dim=t,m}return l.extent=function(m){return arguments.length?(e=typeof m=="function"?m:b0(sk(m)),l):e},l.filter=function(m){return arguments.length?(n=typeof m=="function"?m:b0(!!m),l):n},l.touchable=function(m){return arguments.length?(r=typeof m=="function"?m:b0(!!m),l):r},l.handleSize=function(m){return arguments.length?(a=+m,l):a},l.keyModifiers=function(m){return arguments.length?(o=!!m,l):o},l.on=function(){var m=i.on.apply(i,arguments);return m===i?l:m},l}Nl();var TI=Object.assign(Object.assign({},Ae),{duration:1e3,zoomScaleExtent:[.35,1.25],disableZoom:!1,zoomEventFilter:void 0,disableDrag:!1,disableBrush:!1,zoomThrottledUpdateNodeThreshold:100,layoutType:Ze.Force,layoutAutofit:!0,layoutAutofitTolerance:8,layoutNonConnectedAside:!1,fitViewPadding:50,fitViewAlign:To.Center,layoutGroupOrder:[],layoutParallelNodeSpacing:void 0,layoutParallelSubGroupsPerRow:1,layoutParallelNodesPerColumn:6,layoutParallelGroupSpacing:void 0,layoutParallelSubGroupSpacing:40,layoutParallelSortConnectionsByGroup:void 0,layoutNodeGroup:t=>t.group,layoutParallelNodeSubGroup:t=>t.subgroup,forceLayoutSettings:{linkDistance:60,linkStrength:.45,charge:-500,forceXStrength:.15,forceYStrength:.25,numIterations:void 0,fixNodePositionAfterSimulation:!1},dagreLayoutSettings:{rankdir:"BT",ranker:"longest-path"},layoutElkSettings:void 0,layoutElkNodeGroups:void 0,layoutElkGetNodeShape:void 0,linkFlowAnimDuration:2e4,linkFlowParticleSize:2,linkFlowParticleSpeed:void 0,linkWidth:1,linkStyle:ic.Solid,linkBandWidth:0,linkArrow:void 0,linkStroke:void 0,linkFlow:!1,linkLabel:void 0,linkLabelShiftFromCenter:!0,linkNeighborSpacing:8,linkDisabled:!1,linkCurvature:0,linkHighlightOnHover:!0,linkSourcePointOffset:void 0,linkTargetPointOffset:void 0,selectedLinkId:void 0,nodeSize:30,nodeStrokeWidth:3,nodeShape:he.Circle,nodeGaugeValue:0,nodeIcon:t=>t.icon,nodeIconSize:void 0,nodeLabel:t=>t.label,nodeLabelTrim:!0,nodeLabelTrimLength:15,nodeLabelTrimMode:Ue.Middle,nodeSubLabel:"",nodeSubLabelTrim:!0,nodeSubLabelTrimLength:15,nodeSubLabelTrimMode:Ue.Middle,nodeSideLabels:void 0,nodeBottomIcon:void 0,nodeDisabled:!1,nodeFill:t=>t.fill,nodeGaugeFill:void 0,nodeStroke:t=>t.stroke,nodeEnterPosition:void 0,nodeEnterScale:.75,nodeExitPosition:void 0,nodeExitScale:.75,nodeSort:void 0,nodeSelectionHighlightMode:Ji.GreyoutNonConnected,nodeGaugeAnimDuration:1500,selectedNodeId:void 0,selectedNodeIds:void 0,panels:void 0,onNodeDragStart:void 0,onNodeDrag:void 0,onNodeDragEnd:void 0,onZoom:void 0,onZoomStart:void 0,onZoomEnd:void 0,onLayoutCalculated:void 0,onNodeSelectionBrush:void 0,onNodeSelectionDrag:void 0,onRenderComplete:void 0,shouldDataUpdate:(t,e)=>!An(t,e)});var dk={};Wt(dk,{brushable:()=>bs,brushed:()=>Cc,customNode:()=>Kd,draggable:()=>uk,gNode:()=>Ar,gNodeExit:()=>Zd,greyedOutNode:()=>Qd,label:()=>Xr,labelBackground:()=>ck,labelText:()=>ws,labelTextContent:()=>qd,node:()=>Rn,nodeBottomIcon:()=>S0,nodeGauge:()=>Zr,nodeIcon:()=>kc,nodeIsDragged:()=>C0,nodePolygon:()=>fk,nodeSelection:()=>Po,nodeSelectionActive:()=>Sc,nodes:()=>k0,sideLabel:()=>Ss,sideLabelBackground:()=>ks,sideLabelGroup:()=>Xd,sideLabelsGroup:()=>T0,subLabelTextContent:()=>A0,variables:()=>rY});var k0=M`
|
|
926
|
+
label: nodes;
|
|
927
|
+
`,rY=Pt`
|
|
928
|
+
:root {
|
|
929
|
+
/* Node Fill */
|
|
930
|
+
--vis-graph-node-stroke-color: rgb(206, 211, 222);
|
|
931
|
+
--vis-graph-node-fill-color: #fff;
|
|
932
|
+
--vis-graph-node-gauge-color: #adb4c2;
|
|
933
|
+
--vis-graph-node-selection-color: #acb3b8;
|
|
934
|
+
|
|
935
|
+
--vis-dark-graph-node-stroke-color: rgba(30,30,30,.25);
|
|
936
|
+
--vis-dark-graph-node-fill-color: #494b56;
|
|
937
|
+
--vis-dark-graph-node-gauge-color: #989aa3;
|
|
938
|
+
--vis-dark-graph-node-selection-color: #494b56;
|
|
939
|
+
|
|
940
|
+
/* Node Central Icon */
|
|
941
|
+
--vis-graph-node-icon-fill-color-bright: #ffffff;
|
|
942
|
+
--vis-graph-node-icon-fill-color-dark: var(--vis-color-grey);
|
|
943
|
+
--vis-graph-node-icon-fill-color: #9ea7b8;
|
|
944
|
+
|
|
945
|
+
--vis-dark-graph-node-icon-fill-color: var(--vis-graph-node-icon-fill-color-bright);
|
|
946
|
+
|
|
947
|
+
/* Node Bottom Icon */
|
|
948
|
+
--vis-graph-node-bottom-icon-font-size: 14pt;
|
|
949
|
+
--vis-graph-node-bottom-icon-fill-color: #a0a6ad;
|
|
950
|
+
--vis-graph-node-bottom-icon-stroke-color: #fff;
|
|
951
|
+
--vis-graph-node-bottom-icon-stroke-width: 2px;
|
|
952
|
+
|
|
953
|
+
--vis-dark-graph-node-bottom-icon-fill-color: #a0a6ad;
|
|
954
|
+
--vis-dark-graph-node-bottom-icon-stroke-color: #fff;
|
|
955
|
+
|
|
956
|
+
/* Node Label */
|
|
957
|
+
--vis-graph-node-label-font-size: 9pt;
|
|
958
|
+
--vis-graph-node-label-background: #ffffff;
|
|
959
|
+
--vis-graph-node-label-text-color: #0F1E57;
|
|
960
|
+
--vis-graph-node-sublabel-text-color: #989aa3;
|
|
961
|
+
--vis-graph-node-sublabel-font-size: 8pt;
|
|
962
|
+
// Undefined by default to allow proper fallback to var(--vis-font-family)
|
|
963
|
+
/* --vis-graph-node-label-font-family: */
|
|
964
|
+
|
|
965
|
+
--vis-dark-graph-node-label-background: var(--vis-color-grey);
|
|
966
|
+
--vis-dark-graph-node-label-text-color: #ffffff;
|
|
967
|
+
--vis-dark-graph-node-sublabel-text-color: #989aa3;
|
|
968
|
+
|
|
969
|
+
/* Node Side Labels (circular labels)*/
|
|
970
|
+
--vis-graph-node-side-label-background-fill-color: #a0a9af;
|
|
971
|
+
--vis-graph-node-side-label-background-stroke-color: #ffffff;
|
|
972
|
+
--vis-graph-node-side-label-fill-color-bright: #ffffff;
|
|
973
|
+
--vis-graph-node-side-label-fill-color-dark: #494b56;
|
|
974
|
+
|
|
975
|
+
--vis-dark-graph-node-side-label-background-fill-color: #989aa3;
|
|
976
|
+
--vis-dark-graph-node-side-label-background-stroke-color: var(--vis-color-grey);
|
|
977
|
+
--vis-dark-graph-node-side-label-fill-color-bright: #f1f4f7;
|
|
978
|
+
--vis-dark-graph-node-side-label-fill-color-dark: var(--vis-color-grey);
|
|
979
|
+
|
|
980
|
+
/* Greyout */
|
|
981
|
+
--vis-graph-node-greyout-opacity: 0.9;
|
|
982
|
+
--vis-graph-node-greyout-filter: none;
|
|
983
|
+
--vis-graph-node-greyout-color: #ebeff7;
|
|
984
|
+
--vis-graph-node-icon-greyout-color: #c6cad1;
|
|
985
|
+
--vis-graph-node-side-label-background-greyout-color: #f1f4f7;
|
|
986
|
+
|
|
987
|
+
--vis-dark-graph-node-greyout-color: #494b56;
|
|
988
|
+
--vis-dark-graph-node-icon-greyout-color: var(--vis-color-grey);
|
|
989
|
+
--vis-dark-graph-node-side-label-background-greyout-color: #494B56;
|
|
990
|
+
|
|
991
|
+
/* Brushed */
|
|
992
|
+
--vis-graph-brushed-node-stroke-color: var(--vis-color-main);
|
|
993
|
+
--vis-graph-brushed-node-label-text-color: var(--vis-color-main);
|
|
994
|
+
--vis-graph-brushed-node-icon-fill-color: var(--vis-color-main);
|
|
995
|
+
|
|
996
|
+
/* Misc */
|
|
997
|
+
--vis-graph-node-dominant-baseline: middle;
|
|
998
|
+
}
|
|
999
|
+
|
|
1000
|
+
${Yt} ${`.${k0}`} {
|
|
1001
|
+
--vis-graph-node-stroke-color: var(--vis-dark-graph-node-stroke-color);
|
|
1002
|
+
--vis-graph-node-fill-color: var(--vis-dark-graph-node-fill-color);
|
|
1003
|
+
--vis-graph-node-gauge-color: var(--vis-dark-graph-node-gauge-color);
|
|
1004
|
+
--vis-graph-node-selection-color: var(--vis-dark-graph-node-selection-color);
|
|
1005
|
+
|
|
1006
|
+
--vis-graph-node-icon-fill-color: var(--vis-dark-graph-node-icon-fill-color);
|
|
1007
|
+
|
|
1008
|
+
--vis-graph-node-bottom-icon-fill-color: var(--vis-dark-graph-node-bottom-icon-fill-color);
|
|
1009
|
+
--vis-graph-node-bottom-icon-stroke-color: var(--vis-dark-graph-node-bottom-icon-stroke-color);
|
|
1010
|
+
|
|
1011
|
+
--vis-graph-node-label-background: var(--vis-dark-graph-node-label-background);
|
|
1012
|
+
--vis-graph-node-label-text-color: var(--vis-dark-graph-node-label-text-color);
|
|
1013
|
+
--vis-graph-node-sublabel-text-color: var(--vis-dark-graph-node-sublabel-text-color);
|
|
1014
|
+
|
|
1015
|
+
--vis-graph-node-side-label-background-fill-color: var(--vis-dark-graph-node-side-label-background-fill-color);
|
|
1016
|
+
--vis-graph-node-side-label-background-stroke-color: var(--vis-dark-graph-side-label-background-stroke-color);
|
|
1017
|
+
--vis-graph-node-side-label-fill-color-bright: var(--vis-dark-graph-node-side-label-fill-color-bright);
|
|
1018
|
+
--vis-graph-node-side-label-fill-color-dark: var(vis-dark-graph-node-side-label-fill-color-dark);
|
|
1019
|
+
|
|
1020
|
+
--vis-graph-node-greyout-color: var(--vis-dark-graph-node-greyout-color);
|
|
1021
|
+
--vis-graph-node-icon-greyout-color: var(--vis-dark-graph-node-icon-greyout-color);
|
|
1022
|
+
--vis-graph-node-side-label-background-greyout-color: var(--vis-dark-graph-node-side-label-background-greyout-color);
|
|
1023
|
+
}
|
|
1024
|
+
`,bs=M`
|
|
1025
|
+
label: brushable;
|
|
1026
|
+
`,Rn=M`
|
|
1027
|
+
label: node-shape;
|
|
1028
|
+
|
|
1029
|
+
stroke: var(--vis-graph-node-stroke-color);
|
|
1030
|
+
fill: var(--vis-graph-node-fill-color);
|
|
1031
|
+
|
|
1032
|
+
:not(.${bs}) {
|
|
1033
|
+
transition: .4s fill, 4s stroke;
|
|
1034
|
+
}
|
|
1035
|
+
`,kc=M`
|
|
1036
|
+
label: icon;
|
|
1037
|
+
|
|
1038
|
+
font-family: var(--vis-graph-icon-font-family), var(--vis-font-family);
|
|
1039
|
+
dominant-baseline: var(--vis-graph-node-dominant-baseline);
|
|
1040
|
+
text-anchor: middle;
|
|
1041
|
+
pointer-events: none;
|
|
1042
|
+
fill: var(--vis-graph-node-icon-fill-color);
|
|
1043
|
+
|
|
1044
|
+
:not(.${bs}) {
|
|
1045
|
+
transition: .4s all;
|
|
1046
|
+
}
|
|
1047
|
+
`,S0=M`
|
|
1048
|
+
label: node-bottom-icon;
|
|
1049
|
+
font-family: var(--vis-graph-icon-font-family), var(--vis-font-family);
|
|
1050
|
+
font-size: var(--vis-graph-node-bottom-icon-font-size);
|
|
1051
|
+
dominant-baseline: var(--vis-graph-node-dominant-baseline);
|
|
1052
|
+
text-anchor: middle;
|
|
1053
|
+
pointer-events: none;
|
|
1054
|
+
fill: var(--vis-graph-node-bottom-icon-fill-color);
|
|
1055
|
+
stroke: var(--vis-graph-node-bottom-icon-stroke-color);
|
|
1056
|
+
stroke-width: var(--vis-graph-node-bottom-icon-stroke-width);
|
|
1057
|
+
|
|
1058
|
+
:not(.${bs}) {
|
|
1059
|
+
transition: .4s all;
|
|
1060
|
+
}
|
|
1061
|
+
`,C0=M`
|
|
1062
|
+
label: dragged;
|
|
1063
|
+
`,Xr=M`
|
|
1064
|
+
label: label;
|
|
1065
|
+
|
|
1066
|
+
text-anchor: middle;
|
|
1067
|
+
font-weight: 300;
|
|
1068
|
+
font-size: var(--vis-graph-node-label-font-size);
|
|
1069
|
+
`,ck=M`
|
|
1070
|
+
label: background;
|
|
1071
|
+
|
|
1072
|
+
opacity: 0.9;
|
|
1073
|
+
-webkit-backdrop-filter: blur(2px);
|
|
1074
|
+
backdrop-filter: blur(2px);
|
|
1075
|
+
fill: var(--vis-graph-node-label-background);
|
|
1076
|
+
`,ws=M`
|
|
1077
|
+
label: label-text;
|
|
1078
|
+
`,qd=M`
|
|
1079
|
+
label: label-text-content;
|
|
1080
|
+
|
|
1081
|
+
fill: var(--vis-graph-node-label-text-color);
|
|
1082
|
+
font-family: var(--vis-graph-node-label-font-family, var(--vis-font-family));
|
|
1083
|
+
`,A0=M`
|
|
1084
|
+
label: sublabel-text-content;
|
|
1085
|
+
|
|
1086
|
+
fill: var(--vis-graph-node-sublabel-text-color);
|
|
1087
|
+
font-family: var(--vis-graph-node-label-font-family, var(--vis-font-family));
|
|
1088
|
+
font-size: var(--vis-graph-node-sublabel-font-size);
|
|
1089
|
+
`,T0=M`
|
|
1090
|
+
label: side-labels-group;
|
|
1091
|
+
`,ks=M`
|
|
1092
|
+
label: side-label-background;
|
|
1093
|
+
|
|
1094
|
+
stroke-opacity: 0.8;
|
|
1095
|
+
stroke: var(--vis-graph-node-side-label-background-stroke-color);
|
|
1096
|
+
fill: var(--vis-graph-node-side-label-background-fill-color);
|
|
1097
|
+
`,Ss=M`
|
|
1098
|
+
label: side-label;
|
|
1099
|
+
|
|
1100
|
+
font-family: var(--vis-graph-icon-font-family), var(--vis-font-family);
|
|
1101
|
+
dominant-baseline: var(--vis-graph-node-dominant-baseline);
|
|
1102
|
+
text-anchor: middle;
|
|
1103
|
+
font-size: 16px;
|
|
1104
|
+
fill: var(--vis-graph-node-side-label-fill-color-bright);
|
|
1105
|
+
`,Xd=M`
|
|
1106
|
+
label: side-label-group;
|
|
1107
|
+
cursor: default;
|
|
1108
|
+
`,Ar=M`
|
|
1109
|
+
label: g-node;
|
|
1110
|
+
|
|
1111
|
+
transition: .25s opacity;
|
|
1112
|
+
`,uk=M`
|
|
1113
|
+
label: draggable;
|
|
1114
|
+
|
|
1115
|
+
&:hover {
|
|
1116
|
+
cursor: grab;
|
|
1117
|
+
}
|
|
1118
|
+
|
|
1119
|
+
&${`.${C0}`} {
|
|
1120
|
+
cursor: grabbing;
|
|
1121
|
+
}
|
|
1122
|
+
`,Zd=M`
|
|
1123
|
+
label: g-node-exit;
|
|
1124
|
+
pointer-events: none;
|
|
1125
|
+
`,Sc=M`
|
|
1126
|
+
label: active;
|
|
1127
|
+
`,Po=M`
|
|
1128
|
+
label: node-selection;
|
|
1129
|
+
|
|
1130
|
+
fill: none;
|
|
1131
|
+
stroke-width: 1;
|
|
1132
|
+
stroke-dasharray: 3 3;
|
|
1133
|
+
opacity: 0;
|
|
1134
|
+
transition: 350ms cubic-bezier(0.165, 0.840, 0.440, 1.000);
|
|
1135
|
+
transform: scale(.5);
|
|
1136
|
+
fill: var(--vis-graph-node-selection-color);
|
|
1137
|
+
fill-opacity: 0.1;
|
|
1138
|
+
stroke: var(--vis-graph-node-selection-color);
|
|
1139
|
+
stroke-opacity: 0.75;
|
|
1140
|
+
|
|
1141
|
+
&${`.${Sc}`} {
|
|
1142
|
+
opacity: 1;
|
|
1143
|
+
transform: scale(1.2);
|
|
1144
|
+
}
|
|
1145
|
+
`,Zr=M`
|
|
1146
|
+
label: node-gauge;
|
|
1147
|
+
|
|
1148
|
+
fill: var(--vis-graph-node-gauge-color);
|
|
1149
|
+
transition: .4s fill;
|
|
1150
|
+
`,fk=M`
|
|
1151
|
+
label: polygon;
|
|
1152
|
+
|
|
1153
|
+
${`.${Zr}`} {
|
|
1154
|
+
fill-opacity: 0;
|
|
1155
|
+
stroke-linecap: round;
|
|
1156
|
+
pointer-events: none;
|
|
1157
|
+
}
|
|
1158
|
+
`,Kd=M`
|
|
1159
|
+
label: custom-node;
|
|
1160
|
+
|
|
1161
|
+
stroke-width: 0;
|
|
1162
|
+
`,Qd=M`
|
|
1163
|
+
label: greyed-out;
|
|
1164
|
+
opacity: var(--vis-graph-node-greyout-opacity);
|
|
1165
|
+
filter: var(--vis-graph-node-greyout-filter);
|
|
1166
|
+
|
|
1167
|
+
${`.${Rn}`} {
|
|
1168
|
+
fill: var(--vis-graph-node-greyout-color) !important;
|
|
1169
|
+
stroke: var(--vis-graph-node-greyout-color) !important;
|
|
1170
|
+
}
|
|
1171
|
+
|
|
1172
|
+
${`.${kc}`} {
|
|
1173
|
+
fill: var(--vis-graph-node-icon-greyout-color) !important;
|
|
1174
|
+
}
|
|
1175
|
+
|
|
1176
|
+
${`.${Zr}`} {
|
|
1177
|
+
fill: var(--vis-graph-node-greyout-color) !important;
|
|
1178
|
+
stroke: var(--vis-graph-node-greyout-color) !important;
|
|
1179
|
+
}
|
|
1180
|
+
|
|
1181
|
+
${`.${Xr}`} {
|
|
1182
|
+
opacity: 0.5;
|
|
1183
|
+
}
|
|
1184
|
+
|
|
1185
|
+
${`.${ks}`} {
|
|
1186
|
+
fill: var(--vis-graph-node-side-label-background-greyout-color) !important;
|
|
1187
|
+
stroke-opacity: 0.5;
|
|
1188
|
+
}
|
|
1189
|
+
|
|
1190
|
+
${`.${Ss}`} {
|
|
1191
|
+
fill: var(--vis-graph-node-side-label-fill-color-bright) !important;
|
|
1192
|
+
opacity: 0.25;
|
|
1193
|
+
}
|
|
1194
|
+
`,Cc=M`
|
|
1195
|
+
label: brushed-node;
|
|
1196
|
+
|
|
1197
|
+
${`.${Rn}`} {
|
|
1198
|
+
stroke: var(--vis-graph-brushed-node-stroke-color);
|
|
1199
|
+
}
|
|
1200
|
+
${`.${kc}`} {
|
|
1201
|
+
fill: var(--vis-graph-brushed-node-icon-fill-color);
|
|
1202
|
+
}
|
|
1203
|
+
${`.${qd}`} {
|
|
1204
|
+
fill: var(--vis-graph-brushed-node-label-text-color);
|
|
1205
|
+
}
|
|
1206
|
+
`;var hk=M`
|
|
1207
|
+
label: links;
|
|
1208
|
+
`,jRt=Pt`
|
|
1209
|
+
:root {
|
|
1210
|
+
--vis-graph-link-stroke-color: #e6e9f3;
|
|
1211
|
+
--vis-graph-link-stroke-opacity: 1.0;
|
|
1212
|
+
--vis-graph-link-greyout-opacity: 0.3;
|
|
1213
|
+
--vis-graph-link-dashed-stroke-dasharray: 6 6;
|
|
1214
|
+
|
|
1215
|
+
--vis-graph-link-label-font-size: 9pt;
|
|
1216
|
+
--vis-graph-link-label-background: #e6e9f3;
|
|
1217
|
+
--vis-graph-link-label-text-color-dark: #18181B;
|
|
1218
|
+
--vis-graph-link-label-text-color-bright: #fff;
|
|
1219
|
+
--vis-graph-link-label-text-color: var(--vis-graph-link-label-text-color-dark);
|
|
1220
|
+
|
|
1221
|
+
--vis-graph-link-band-opacity: 0.35;
|
|
1222
|
+
--vis-graph-link-support-stroke-width: 10px;
|
|
1223
|
+
--vis-graph-link-flow-opacity: 1;
|
|
1224
|
+
|
|
1225
|
+
--vis-dark-graph-link-stroke-color: #494b56;
|
|
1226
|
+
--vis-dark-graph-link-label-background: #3f3f45;
|
|
1227
|
+
--vis-dark-graph-link-label-text-color: var(--vis-graph-link-label-text-color-bright);
|
|
1228
|
+
|
|
1229
|
+
|
|
1230
|
+
--vis-graph-link-dominant-baseline: middle;
|
|
1231
|
+
}
|
|
1232
|
+
|
|
1233
|
+
${Yt} ${`.${hk}`} {
|
|
1234
|
+
--vis-graph-link-stroke-color: var(--vis-dark-graph-link-stroke-color);
|
|
1235
|
+
--vis-graph-link-label-stroke-color: var(--vis-dark-graph-link-label-stroke-color);
|
|
1236
|
+
--vis-graph-link-label-text-color: var(--vis-dark-graph-link-label-text-color);
|
|
1237
|
+
--vis-graph-link-label-background: var(--vis-dark-graph-link-label-background);
|
|
1238
|
+
}
|
|
1239
|
+
`,Cs=M`
|
|
1240
|
+
label: link-support;
|
|
1241
|
+
|
|
1242
|
+
fill: none;
|
|
1243
|
+
stroke-linecap: round;
|
|
1244
|
+
stroke-width: var(--vis-graph-link-support-stroke-width);
|
|
1245
|
+
stroke-opacity: 0;
|
|
1246
|
+
stroke: var(--vis-graph-link-stroke-color);
|
|
1247
|
+
transition: stroke-opacity 0.2s;
|
|
1248
|
+
`,Io=M`
|
|
1249
|
+
label: link;
|
|
1250
|
+
|
|
1251
|
+
fill: none;
|
|
1252
|
+
stroke: var(--vis-graph-link-stroke-color);
|
|
1253
|
+
stroke-opacity: var(--vis-graph-link-stroke-opacity);
|
|
1254
|
+
transition: stroke 800ms;
|
|
1255
|
+
stroke-linecap: round;
|
|
1256
|
+
pointer-events: none;
|
|
1257
|
+
`,LI=M`
|
|
1258
|
+
label: dashed;
|
|
1259
|
+
|
|
1260
|
+
${`.${Io}`} {
|
|
1261
|
+
stroke-dasharray: var(--vis-graph-link-dashed-stroke-dasharray);
|
|
1262
|
+
}
|
|
1263
|
+
`,pk=M`
|
|
1264
|
+
label: link-arrow;
|
|
1265
|
+
fill: var(--vis-graph-link-stroke-color);
|
|
1266
|
+
`,Tr=M`
|
|
1267
|
+
label: g-link;
|
|
1268
|
+
`,L0=M`
|
|
1269
|
+
label: g-link-exit;
|
|
1270
|
+
pointer-events: none;
|
|
1271
|
+
`,E0=M`
|
|
1272
|
+
label: greyed-out;
|
|
1273
|
+
opacity: var(--vis-graph-link-greyout-opacity);
|
|
1274
|
+
`,Ac=M`
|
|
1275
|
+
label: link-band;
|
|
1276
|
+
|
|
1277
|
+
stroke-opacity: var(--vis-graph-link-band-opacity);
|
|
1278
|
+
pointer-events: none;
|
|
1279
|
+
stroke: var(--vis-graph-node-stroke-color);
|
|
1280
|
+
fill: none;
|
|
1281
|
+
`,Jd=M`
|
|
1282
|
+
label: flow-group;
|
|
1283
|
+
|
|
1284
|
+
pointer-events: none;
|
|
1285
|
+
`,ra=M`
|
|
1286
|
+
label: flow-circle;
|
|
1287
|
+
|
|
1288
|
+
fill: var(--vis-graph-link-stroke-color);
|
|
1289
|
+
opacity: var(--vis-graph-link-flow-opacity);
|
|
1290
|
+
`,th=M`
|
|
1291
|
+
label: label-group;
|
|
1292
|
+
`,mk=M`
|
|
1293
|
+
label: label-background;
|
|
1294
|
+
|
|
1295
|
+
fill: var(--vis-graph-link-label-background);
|
|
1296
|
+
`,M0=M`
|
|
1297
|
+
label: label-content;
|
|
1298
|
+
|
|
1299
|
+
font-size: var(--vis-graph-link-label-font-size);
|
|
1300
|
+
font-family: var(--vis-font-family);
|
|
1301
|
+
fill: var(--vis-graph-link-label-text-color);
|
|
1302
|
+
text-anchor: middle;
|
|
1303
|
+
dominant-baseline: var(--vis-graph-link-dominant-baseline);
|
|
1304
|
+
user-select: none;
|
|
1305
|
+
`;var KRt=Pt`
|
|
1306
|
+
:root {
|
|
1307
|
+
--vis-graph-icon-font-family: ${Xp};
|
|
1308
|
+
|
|
1309
|
+
/* Brush */
|
|
1310
|
+
--vis-graph-brush-selection-opacity: 0.2;
|
|
1311
|
+
}
|
|
1312
|
+
`,EI=M`
|
|
1313
|
+
label: graph-component;
|
|
1314
|
+
`,gk=M`
|
|
1315
|
+
label: background;
|
|
1316
|
+
`,xk=M`
|
|
1317
|
+
label: graph-group;
|
|
1318
|
+
`,MI=M`
|
|
1319
|
+
label: brush;
|
|
1320
|
+
|
|
1321
|
+
:not(.active) {
|
|
1322
|
+
display: none;
|
|
1323
|
+
}
|
|
1324
|
+
|
|
1325
|
+
.active {
|
|
1326
|
+
.selection {
|
|
1327
|
+
fill-opacity: 0;
|
|
1328
|
+
stroke: none;
|
|
1329
|
+
}
|
|
1330
|
+
|
|
1331
|
+
.handle {
|
|
1332
|
+
display: none;
|
|
1333
|
+
}
|
|
1334
|
+
}
|
|
1335
|
+
`,RI=M`
|
|
1336
|
+
label: zoom-out-level-1;
|
|
1337
|
+
|
|
1338
|
+
${`.${Xr}`} {
|
|
1339
|
+
rect {
|
|
1340
|
+
stroke: none;
|
|
1341
|
+
}
|
|
1342
|
+
}
|
|
1343
|
+
`,eh=M`
|
|
1344
|
+
label: zoom-out-level-2;
|
|
1345
|
+
|
|
1346
|
+
${`.${Xr}`} {
|
|
1347
|
+
visibility: visible;
|
|
1348
|
+
}
|
|
1349
|
+
|
|
1350
|
+
${`.${Zr}`} {
|
|
1351
|
+
visibility: visible;
|
|
1352
|
+
}
|
|
1353
|
+
|
|
1354
|
+
${`.${Rn}`} {
|
|
1355
|
+
stroke-width: 4px;
|
|
1356
|
+
}
|
|
1357
|
+
|
|
1358
|
+
rect${`.${Rn}`} {
|
|
1359
|
+
stroke-width: 2px;
|
|
1360
|
+
}
|
|
1361
|
+
|
|
1362
|
+
${`.${Tr}`} {
|
|
1363
|
+
animation: none;
|
|
1364
|
+
stroke-dasharray: none;
|
|
1365
|
+
}
|
|
1366
|
+
|
|
1367
|
+
${`.${ra}`} {
|
|
1368
|
+
display: none;
|
|
1369
|
+
}
|
|
1370
|
+
|
|
1371
|
+
${`.${Po}`} {
|
|
1372
|
+
&${`.${Sc}`} {
|
|
1373
|
+
transform: scale(1.15);
|
|
1374
|
+
}
|
|
1375
|
+
}
|
|
1376
|
+
`;var vk=M`
|
|
1377
|
+
label: panels;
|
|
1378
|
+
`,ePt=Pt`
|
|
1379
|
+
:root {
|
|
1380
|
+
--vis-graph-panel-border-color: #E6E9F3;
|
|
1381
|
+
--vis-graph-panel-border-opacity: 0.9;
|
|
1382
|
+
--vis-graph-panel-fill-color: #ffffff;
|
|
1383
|
+
|
|
1384
|
+
--vis-graph-panel-label-color: #6c778c;
|
|
1385
|
+
--vis-graph-panel-label-background: #ffffff;
|
|
1386
|
+
|
|
1387
|
+
// Undefined by default to allow proper fallback to var(--vis-font-family)
|
|
1388
|
+
/* --vis-graph-panel-label-font-family: */
|
|
1389
|
+
--vis-graph-panel-label-font-size: 10pt;
|
|
1390
|
+
--vis-graph-panel-label-font-weight: 300;
|
|
1391
|
+
|
|
1392
|
+
--vis-graph-panel-dashed-outline-color: #b7b7b7;
|
|
1393
|
+
|
|
1394
|
+
--vis-graph-panel-side-icon-symbol-color: #9ea7b8;
|
|
1395
|
+
--vis-graph-panel-side-icon-shape-fill-color: #ffffff;
|
|
1396
|
+
|
|
1397
|
+
--vis-dark-graph-panel-border-color: var(--vis-color-grey);
|
|
1398
|
+
--vis-dark-graph-panel-fill-color: #292b34;
|
|
1399
|
+
--vis-dark-graph-panel-label-color: #E6E9F3;
|
|
1400
|
+
--vis-dark-graph-panel-label-background: var(--vis-color-grey);
|
|
1401
|
+
--vis-dark-graph-panel-side-icon-symbol-color: #ffffff;
|
|
1402
|
+
--vis-dark-graph-panel-side-icon-shape-fill-color: #6c778c;
|
|
1403
|
+
--vis-dark-graph-panel-border-color: #a0a6ad;
|
|
1404
|
+
}
|
|
1405
|
+
|
|
1406
|
+
${Yt} ${`.${vk}`} {
|
|
1407
|
+
--vis-graph-panel-border-color: var(--vis-dark-graph-panel-border-color);
|
|
1408
|
+
--vis-graph-panel-fill-color: var(--vis-dark-graph-panel-fill-color);
|
|
1409
|
+
--vis-graph-panel-label-color: var(--vis-dark-graph-panel-label-color);
|
|
1410
|
+
--vis-graph-panel-label-background: var(--vis-dark-graph-panel-label-background);
|
|
1411
|
+
--vis-graph-panel-side-icon-symbol-color: var(--vis-dark-graph-panel-side-icon-symbol-color);
|
|
1412
|
+
--vis-graph-panel-side-icon-shape-fill-color: var(--vis-dark-graph-panel-side-icon-shape-fill-color);
|
|
1413
|
+
--vis-graph-panel-border-color: var(--vis-dark-graph-panel-border-color);
|
|
1414
|
+
}
|
|
1415
|
+
`,R0=M`
|
|
1416
|
+
label: g-panel;
|
|
1417
|
+
`,nh=M`
|
|
1418
|
+
label: panel;
|
|
1419
|
+
|
|
1420
|
+
stroke: var(--vis-graph-panel-border-color);
|
|
1421
|
+
stroke-opacity: var(--vis-graph-panel-border-opacity);
|
|
1422
|
+
fill: var(--vis-graph-panel-fill-color);
|
|
1423
|
+
`,rh=M`
|
|
1424
|
+
label: label;
|
|
1425
|
+
|
|
1426
|
+
fill: var(--vis-graph-panel-label-color);
|
|
1427
|
+
`,PI=M`
|
|
1428
|
+
label: background;
|
|
1429
|
+
|
|
1430
|
+
opacity: 0.9;
|
|
1431
|
+
-webkit-backdrop-filter: blur(2px);
|
|
1432
|
+
backdrop-filter: blur(2px);
|
|
1433
|
+
fill: var(--vis-graph-panel-label-background);
|
|
1434
|
+
stroke: none;
|
|
1435
|
+
`,As=M`
|
|
1436
|
+
label: label-text;
|
|
1437
|
+
|
|
1438
|
+
text-anchor: middle;
|
|
1439
|
+
font-size: var(--vis-graph-panel-label-font-size);
|
|
1440
|
+
font-weight: var(--vis-graph-panel-label-font-weight);;
|
|
1441
|
+
cursor: default;
|
|
1442
|
+
stroke: none;
|
|
1443
|
+
font-family: var(--vis-graph-panel-label-font-family, var(--vis-font-family));
|
|
1444
|
+
`,yk=M`
|
|
1445
|
+
label: active;
|
|
1446
|
+
`,oh=M`
|
|
1447
|
+
label: panel-selection-outline;
|
|
1448
|
+
|
|
1449
|
+
opacity: 0;
|
|
1450
|
+
stroke-width: 1;
|
|
1451
|
+
stroke-dasharray: 3 3;
|
|
1452
|
+
fill: var(--vis-graph-node-selection-color);
|
|
1453
|
+
fill-opacity: 0.1;
|
|
1454
|
+
stroke: var(--vis-graph-panel-dashed-outline-color);
|
|
1455
|
+
stroke-opacity: 0;
|
|
1456
|
+
|
|
1457
|
+
&${`.${yk}`} {
|
|
1458
|
+
opacity: 1;
|
|
1459
|
+
stroke-opacity: 0.75;
|
|
1460
|
+
}
|
|
1461
|
+
`,nPt=M`
|
|
1462
|
+
label: greyout;
|
|
1463
|
+
opacity: 0.4;
|
|
1464
|
+
`,ih=M`
|
|
1465
|
+
label: side-icon-group;
|
|
1466
|
+
`,ah=M`
|
|
1467
|
+
label: side-icon-shape;
|
|
1468
|
+
|
|
1469
|
+
fill: var(--vis-graph-panel-side-icon-shape-fill-color);
|
|
1470
|
+
stroke-width: 2px;
|
|
1471
|
+
`,II=M`
|
|
1472
|
+
label: side-icon-custom;
|
|
1473
|
+
`,sh=M`
|
|
1474
|
+
label: side-label-icon-text;
|
|
1475
|
+
font-family: var(--vis-graph-icon-font-family), var(--vis-font-family);
|
|
1476
|
+
fill: var(--vis-graph-panel-side-icon-symbol-color);
|
|
1477
|
+
stroke: none;
|
|
1478
|
+
dominant-baseline: middle;
|
|
1479
|
+
text-anchor: middle;
|
|
1480
|
+
pointer-events: none;
|
|
1481
|
+
cursor: default;
|
|
1482
|
+
`;var DI=$3($I(),1);var OI=["svg","g","path","rect","circle","ellipse","line","polyline","polygon","defs","clipPath","use","symbol","image","marker","style","mask",...DE];function zI(t,e=OI){return(0,DI.default)(t,e)}function lh(t){let e=new RegExp(`<(${OI.join("|")})\\b`,"i"),n=/\b(d|fill|stroke|transform|viewBox)=/i;return e.test(t)||n.test(t)}var N0=30,BI=10,I0=4;function Gn(t,e,n){return z(t,e,n)||N0}function FI(t,e){t._animState={endAngle:0,nodeIndex:e}}function GI(t,e,n,r){var o;let{nodeStrokeWidth:i,nodeSize:a,nodeGaugeValue:s}=e;r._animState||FI(r,t._index);let l=re(r._animState,{endAngle:2*Math.PI*((o=z(t,s,t._index))!==null&&o!==void 0?o:0)/100,nodeIndex:t._index,nodeSize:Gn(t,a,t._index),borderWidth:z(t,i,t._index)});return r._animState=l(0),c=>(r._animState=l(c),n(r._animState))}function $0(t,e,n,r){var o;let{nodeShape:i,nodeGaugeValue:a}=e,s=Gn(t,e.nodeSize,t._index),l;switch(j(t,i,t._index)){case he.Square:l=4;break;case he.Triangle:l=3;break;case he.Hexagon:default:l=6}r._animState||FI(r,t._index);let c=re(r._animState,{endAngle:2*Math.PI*((o=z(t,a,t._index))!==null&&o!==void 0?o:0)/100,nodeIndex:t._index});return r._animState=c(0),u=>(r._animState=c(u),l===4?vM({x:-s/2,y:-s/2,w:s,h:s,r:5,score:r._animState.endAngle/(2*Math.PI)}):n(s,l,r._animState.endAngle,!0))}function oa(t,e,n){let r=Jo(e),i=t.select(`.${n}`).node().getBBox();return t.select("rect").attr("visibility",r?"hidden":null).attr("rx",4).attr("ry",4).attr("x",-i.width/2-BI).attr("y","-0.64em").attr("width",i.width+2*BI).attr("height",i.height+2*I0).style("transform",`translateY(${-I0}px)`)}function Fe(t){return t._state&&!al(t._state.fx)?t._state.fx:t.x}function Ge(t){return t._state&&!al(t._state.fy)?t._state.fy:t.y}function D0(t){return typeof t=="number"?t:N0}function Kr(t,e){return rt(t||[],(n,r)=>Gn(n,e,r))||N0}function _k(t,e){return Zo(t||[],(n,r)=>Gn(n,e,r))||N0}function bk(t,e){if(!t.color)return null;let n=Gr(t.color,e);return zn(n)>.65?"var(--vis-graph-node-side-label-fill-color-dark)":"var(--vis-graph-node-side-label-fill-color-bright)"}function ch(t,e,n){var r;return(r=K(t,e,n,void 0,{dontFallbackToCssVar:!0}))!==null&&r!==void 0?r:null}function WI(t,e,n,r){let o=ch(t,e,n);if(!o)return null;let i=Gr(o,r);return zn(i)>.65?"var(--vis-graph-node-icon-fill-color-dark)":"var(--vis-graph-node-icon-fill-color-bright)"}function uh(t){return/^#[^]+/.test(t)}function Ts(t,e,n,r,o,i=":last-child"){t.each((a,s,l)=>{let c=U(l[s]),u=j(a,e,o),f,d=lh(u);if(d)f=c.insert("g",i).html(zI(u));else switch(u){case he.Square:f=c.insert("rect",i).attr("rx",5).attr("ry",5);break;case he.Hexagon:case he.Triangle:f=c.insert("path",i);break;case he.Circle:default:f=c.insert("circle",i)}return f.classed(r,d),f.attr("class",n)})}function fh(t,e,n,r){if(t.size()===0)return;let o=t.datum(),i=Gn(o,n,r);t.filter("circle").attr("r",i/2),t.filter("rect").attr("width",i).attr("height",i).attr("x",-i/2).attr("y",-i/2),t.filter("path").attr("d",()=>{let a;switch(j(o,e,r)){case he.Square:a=4;break;case he.Triangle:a=3;break;case he.Hexagon:default:a=6}return fi(i,a)}),t.filter("g").filter(()=>!lh(j(o,e,r))).html(j(o,e,r)),t.filter("g").each((a,s,l)=>{let c=U(l[s]),u=c.node().getBBox();c.attr("transform",`translate(${-u.width/2},${-u.height/2})`)})}var or;(function(t){t[t.Level0=1]="Level0",t[t.Level1=.6]="Level1",t[t.Level2=.4]="Level2",t[t.Level3=.2]="Level3"})(or||(or={}));var wk=10;function VI(t,e,n,r=1){t.each((o,i,a)=>{let s=a[i],l=U(s);if(l.attr("transform",(f,d)=>{var h,p,g;let m=st(f,e.nodeEnterPosition,d),x=(h=z(f,e.nodeEnterScale,d))!==null&&h!==void 0?h:0,y=(p=m?.[0])!==null&&p!==void 0?p:Fe(f),_=(g=m?.[1])!==null&&g!==void 0?g:Ge(f);return`translate(${y}, ${_}) scale(${x})`}).attr("opacity",0),e.nodeEnterCustomRenderFunction)e.nodeEnterCustomRenderFunction(o,l,e,n,r);else{let f=j(o,e.nodeShape,o._index);s.nodeShape=f,Ts(l,f,Rn,Kd,o._index),Ts(l,f,Po,Kd,o._index),l.append("path").attr("class",Zr),l.append("g").attr("class",kc),l.append("g").attr("class",T0),l.append("text").attr("class",S0)}let c=l.append("g").attr("class",Xr);c.append("rect").attr("class",ck);let u=c.append("text").attr("class",ws).attr("dy","0.32em");u.append("tspan").attr("class",qd),u.append("tspan").attr("class",A0).attr("dy","1.1em").attr("x","0")})}function Tc(t,e,n,r=1){let{nodeDisabled:o}=e;e.nodePartialUpdateCustomRenderFunction||e.nodeEnterCustomRenderFunction?t.each((i,a,s)=>{var l;let c=U(s[a]);(l=e.nodePartialUpdateCustomRenderFunction)===null||l===void 0||l.call(e,i,c,e,n,r)}):t.each((i,a,s)=>{let l=U(s[a]),c=Un(i,o,i._index)||i._state.greyout;l.classed(Qd,c&&!i._state.brushed).classed(uk,!e.disableDrag),l.selectAll(`.${Po}`).classed(Sc,i._state.selected||i._state.brushed),l.selectAll(`.${Ss}`).style("fill",f=>c?null:bk(f,t.node())),l.selectAll(`.${ks}`).style("fill",f=>c?null:f.color)})}function kk(t,e){return G(t,e).attr("transform",n=>`translate(${Fe(n)}, ${Ge(n)}) scale(1)`).attr("opacity",1)}function Lc(t,e,n,r=1){let{nodeGaugeAnimDuration:o,nodeStrokeWidth:i,nodeShape:a,nodeSize:s,nodeGaugeValue:l,nodeGaugeFill:c,nodeIcon:u,nodeIconSize:f,nodeLabel:d,nodeLabelTrim:h,nodeLabelTrimMode:p,nodeLabelTrimLength:g,nodeSubLabel:m,nodeSubLabelTrim:x,nodeSubLabelTrimMode:y,nodeSubLabelTrimLength:_,nodeSideLabels:v,nodeStroke:b,nodeFill:w,nodeBottomIcon:A}=e,L=kk(t,n);return e.nodeUpdateCustomRenderFunction?(t.each((E,I,D)=>{let F=U(D[I]);e.nodeUpdateCustomRenderFunction(E,F,e,n,r)}),Tc(t,e,n,r),L):(t.each((E,I,D)=>{let F=D[I],$=U(F),T=j(E,a,E._index);F.nodeShape!==T&&($.select(`.${Rn}`).remove(),Ts($,a,Rn,Kd,E._index,`.${Po}`),$.select(`.${Po}`).remove(),Ts($,T,Po,null,E._index,`.${Zr}`),F.nodeShape=T)}),t.each((E,I,D)=>{var F,$,T;let S=D[I],k=U(S),P=k.select(`.${Rn}`),N=k.select(`.${Zr}`),R=k.select(`.${kc}`),O=k.select(`.${T0}`),W=k.select(`.${Xr}`),Y=W.select(`.${qd}`),J=W.select(`.${A0}`),nt=k.select(`.${S0}`),et=k.select(`.${Po}`),xt=Gn(E,s,E._index),Z=Qn().innerRadius(Mt=>Mt.nodeSize/2-Mt.borderWidth/2).outerRadius(Mt=>Mt.nodeSize/2+Mt.borderWidth/2).startAngle(0*(Math.PI/180)).endAngle(Mt=>Mt.endAngle);k.classed(eh,r<or.Level2).classed(C0,Mt=>Mt._state.isDragged),k.classed(fk,()=>{let Mt=j(E,a,E._index);return Mt===he.Triangle||Mt===he.Hexagon||Mt===he.Square}),P.call(fh,a,s,E._index).attr("stroke-width",(F=z(E,i,E._index))!==null&&F!==void 0?F:0).style("fill",ch(E,w,E._index)).style("stroke",($=K(E,b,E._index,void 0,{dontFallbackToCssVar:!0}))!==null&&$!==void 0?$:null);let vt=P.node().getBBox();N.attr("stroke-width",z(E,i,E._index)).style("display",z(E,l,E._index)?null:"none").style("fill",ch(E,c,E._index)).style("stroke",ch(E,c,E._index)).style("stroke-opacity",Mt=>j(Mt,a,Mt._index)===he.Circle?0:null),N.transition().duration(o).attrTween("d",(Mt,ke,lr)=>{switch(j(Mt,a,Mt._index)){case he.Circle:return GI(Mt,e,Z,lr[ke]);case he.Hexagon:return $0(Mt,e,fi,lr[ke]);case he.Square:return $0(Mt,e,fi,lr[ke]);case he.Triangle:return $0(Mt,e,fi,lr[ke]);default:return null}}),fh(et,a,s,E._index);let X=S.nodeIcon,at=j(E,u,E._index),B=(T=z(E,f,E._index))!==null&&T!==void 0?T:2.5*Math.sqrt(xt),H=WI(E,w,E._index,t.node()),lt=uh(at);X!==at&&(R.selectAll("*").remove(),R.append(lt?"use":"text"),S.nodeIcon=at),lt?R.select("use").attr("href",at).attr("x",-B/2).attr("y",-B/2).attr("width",B).attr("height",B).style("fill",H):R.select("text").style("font-size",`${B}px`).attr("dy","0.1em").style("fill",H).html(at);let ct=st(E,v,E._index)||[],gt=O.selectAll("g").data(ct),ot=gt.enter().append("g").attr("class",Xd);ot.append("circle").attr("class",ks).attr("r",Mt=>{var ke;return(ke=Mt.radius)!==null&&ke!==void 0?ke:wk}),ot.append("text").attr("class",Ss);let Q=gt.merge(ot).style("cursor",Mt=>{var ke;return(ke=Mt.cursor)!==null&&ke!==void 0?ke:null});Q.select(`.${Ss}`).html(Mt=>Mt.text).attr("dy","0.1em").style("fill",Mt=>{var ke;return(ke=Mt.textColor)!==null&&ke!==void 0?ke:bk(Mt,t.node())}).style("font-size",Mt=>{var ke,lr;return(ke=Mt.fontSize)!==null&&ke!==void 0?ke:`${(2+((lr=Mt.radius)!==null&&lr!==void 0?lr:wk))/Math.pow(Mt.text.toString().length,.3)}px`}),Q.select(`.${ks}`).style("fill",Mt=>Mt.color),Q.attr("transform",(Mt,ke)=>{var lr;if(ct.length===1)return`translate(${xt/2.5}, ${-xt/2.5})`;let Pv=1.05*xt/2,f2=ke*1.15*2*Math.atan2((lr=Mt.radius)!==null&&lr!==void 0?lr:wk,Pv)-Math.PI/3;return`translate(${Pv*Math.cos(f2)}, ${Pv*Math.sin(f2)})`}),gt.exit().remove();let yt=j(E,d,E._index),ne=j(E,m,E._index),Ne=Un(E,h,E._index)?si(yt,z(E,g,E._index),st(E,p,E._index)):yt,Uo=Un(E,x,E._index)?si(ne,z(E,_,E._index),st(E,y,E._index)):ne;Y.text(Ne),J.text(Uo),k.on("mouseenter",()=>{Y.text(yt),J.text(ne),oa(W,yt,ws),k.raise()}).on("mouseleave",()=>{Y.text(Ne),J.text(Uo),oa(W,Ne,ws)});let qo=ue("var(--vis-graph-node-label-font-size)",S)||12,Rv=I0+1.25*Math.pow(qo,1.03),u2=lh(j(E,a,E._index))?vt.height:xt;W.attr("transform",`translate(0, ${u2/2+Rv})`),r>=or.Level3&&oa(W,j(E,d,E._index),ws),nt.html(j(E,A,E._index)).attr("transform",`translate(0, ${u2/2})`)}),Tc(t,e,n,r),L)}function HI(t,e,n,r=1){G(t,n/2).attr("opacity",0).attr("transform",(o,i)=>{var a,s,l;let c=st(o,e.nodeExitPosition,i),u=(a=z(o,e.nodeExitScale,i))!==null&&a!==void 0?a:0,f=(s=c?.[0])!==null&&s!==void 0?s:Fe(o),d=(l=c?.[1])!==null&&l!==void 0?l:Ge(o);return`translate(${f}, ${d}) scale(${u})`}).remove(),e.nodeExitCustomRenderFunction&&t.each((o,i,a)=>{let s=U(a[i]);e.nodeExitCustomRenderFunction(o,s,e,n,r)})}function oY(t,e){let{nodeLabel:n}=e;t.each((r,o,i)=>{let s=U(i[o]).select(`.${Xr}`);oa(s,j(r,n,o),ws)})}var iY=zr(oY,1e3);function Sk(t,e,n){e.nodeOnZoomCustomRenderFunction||e.nodeEnterCustomRenderFunction?t.each((r,o,i)=>{var a;let s=U(i[o]);(a=e.nodeOnZoomCustomRenderFunction)===null||a===void 0||a.call(e,r,s,e,n)}):(t.classed(RI,n<or.Level1),t.classed(eh,n<or.Level2),t.selectAll(`${ks}`).attr("transform",`scale(${1/Math.pow(n,.35)})`),t.selectAll(`.${Ss}`).attr("transform",`scale(${1/Math.pow(n,.45)})`),n>=or.Level3&&t.call(iY,e))}var jI=zr(Sk,500);var ia=9,O0=7;function aY(t,e){let n=t.source,r=t.target,o=Math.atan2(Ge(r)-Ge(n),Fe(r)-Fe(n))-Math.PI/2,i=Math.cos(o)*e*t._direction*(t._index-(t._neighbours-1)/2),a=Math.sin(o)*e*t._direction*(t._index-(t._neighbours-1)/2);return{dx:i,dy:a}}function Ck(t,e){let{dx:n,dy:r}=aY(t,e);return`translate(${n}, ${r})`}function Ak(t,e,n){return z(t,n.linkWidth,t._indexGlobal)/Math.pow(e,.5)}function dh(t,e,n){let{nodeSize:r,linkBandWidth:o}=n,i=z(t.source,r,t.source._index),a=z(t.target,r,t.target._index),s=Math.min(i,a);return Math.min(s,z(t,o,t._indexGlobal)/Math.pow(e||1,.5))||0}function Tk(t,e){var n;let{linkStroke:r}=e;return((n=K(t,r,t._indexGlobal,void 0,{dontFallbackToCssVar:!0}))!==null&&n!==void 0?n:"var(--vis-graph-link-stroke-color)")||null}function Lk(t,e){let n=st(t,e.linkArrow,t._indexGlobal);if(n)return n===Qi.Double?n:Qi.Single}function YI(){return`M${-ia/2},${-O0/2} V${O0/2} L${ia/2},0 Z`}function UI(){return`M${-ia/2},0 L${ia/2},${-O0/2} L${ia*1.5},0 L${ia/2},${O0/2} Z`}function qI(t){if(!t.color)return null;let e=Ut(t.color).hex();return zn(e)>.65?"var(--vis-graph-link-label-text-color-dark)":"var(--vis-graph-link-label-text-color-bright)"}function XI(t){t.attr("opacity",0),t.append("path").attr("class",Cs),t.append("path").attr("class",Io),t.append("path").attr("class",Ac),t.append("use").attr("class",pk),t.append("g").attr("class",Jd).style("opacity",0).selectAll(`.${ra}`).data(Yn(0,6)).enter().append("circle").attr("class",ra)}function Ek(t,e,n){let r=(o,i)=>Un(o,e.linkDisabled,i)||o._state.greyout;t.classed(E0,(o,i)=>r(o,i)),t.each((o,i,a)=>{let s=a[i],l=U(s);l.select(`.${Io}`),l.select(`.${Ac}`),l.select(`.${Cs}`).style("stroke-opacity",o._state.hovered||o._state.selected?.2:0).style("stroke-width",o._state.selected?dh(o,n,e)+5:o._state.hovered?dh(o,n,e)+10:null)})}function Mk(t,e,n,r=1,o,i){return t.each((a,s,l)=>{var c;let u=l[s],f=U(u),d=f.select(`.${Io}`),h=f.select(`.${Ac}`),p=f.select(`.${Cs}`),g=f.select(`.${pk}`),m=Tk(a,e),x=Ck(a,e.linkNeighborSpacing),y=Nu(st(a,e.linkLabel,a._indexGlobal)),_=st(a,e.linkSourcePointOffset,s),v=st(a,e.linkTargetPointOffset,s),b=Fe(a.source)+(_?.[0]||0),w=Ge(a.source)+(_?.[1]||0),A=Fe(a.target)+(v?.[0]||0),L=Ge(a.target)+(v?.[1]||0),E=(c=z(a,e.linkCurvature,s))!==null&&c!==void 0?c:0,I=b+(A-b)*.5*E,D=w+(L-w)*0*E,F=b+(A-b)*.5*E,$=w+(L-w)*1*E,T=`M${b},${w} C${I},${D} ${F},${$} ${A},${L}`,S=p.attr("d",T).node(),k=i.get(T),P=k??S.getTotalLength();k||i.set(T,P),p.style("stroke",m).attr("transform",x),d.attr("class",Io).style("stroke-width",Ak(a,r,e)).style("stroke",m).attr("transform",x),G(d,n).attr("d",T),h.attr("class",Ac).attr("transform",x).style("stroke-width",dh(a,r,e)).style("stroke",m),G(h,n).attr("d",T);let N=Lk(a,e);if(N){let R=P*(y.length?.65:.5),O=S.getPointAtLength(R),W=S.getPointAtLength(R+1),Y=Math.atan2(W.y-O.y,W.x-O.x)*(180/Math.PI),J=g.attr("href");g.attr("href",`#${o(N)}`),G(g,J?n:0).attr("fill",m).attr("transform",`translate(${O.x}, ${O.y}) rotate(${Y})`)}else g.attr("href",null)})}function z0(t,e,n,r=1,o,i){let{linkStyle:a,linkFlow:s,linkLabel:l,linkLabelShiftFromCenter:c}=e;t.size()&&(t.classed(LI,u=>st(u,a,u._indexGlobal)===ic.Dashed),Mk(t,e,n,r,o,i),t.each((u,f,d)=>{let h=d[f],p=U(h),g=p.select(`.${Jd}`),x=p.select(`.${Cs}`).node(),y=Tk(u,e),_=Ck(u,e.linkNeighborSpacing),v=Nu(st(u,l,u._indexGlobal)),b=z(u,e.linkFlowParticleSize,u._indexGlobal);g.attr("transform",_).style("display",Un(u,s,u._indexGlobal)?null:"none"),g.selectAll(`.${ra}`).attr("r",b/Math.sqrt(r)).style("fill",y),G(g,n).style("opacity",r<or.Level2?0:1);let w=v.map(S=>{var k,P,N;let R=((k=S.text)===null||k===void 0?void 0:k.toString())||"",O=uh(R),W=(P=pn(S.fontSize))!==null&&P!==void 0?P:ue("var(--vis-graph-link-label-font-size)",p.node()),Y=R.length<=2||O,J=4,nt=Y?J:8,et=Oe(R,W);return Object.assign(Object.assign({},S),{_shouldRenderUseElement:O,_fontSizePx:W,_shouldBeRenderedAsCircle:Y,_paddingVertical:J,_paddingHorizontal:nt,_estimatedWidthPx:et,_borderRadius:(N=S.radius)!==null&&N!==void 0?N:Y?W:4,_backgroundWidth:(Y?W:et)+nt*2,_backgroundHeight:W+J*2})}),A=p.selectAll(`.${th}`).data(w,S=>S.text),L=A.enter().append("g").attr("class",th);L.each((S,k,P)=>{var N;let R=U(P[k]);R.append("rect").attr("class",mk);let O=S?(N=S.text)===null||N===void 0?void 0:N.toString():void 0,W=uh(O);R.select(`.${M0}`).remove(),R.append(W?"use":"text").attr("class",M0)}),L.style("opacity",0);let E=A.merge(L),I=1,D=-Ko(w,S=>S._backgroundWidth+I)/2,F=i.get(x.getAttribute("d")),$=F??x.getTotalLength(),T=Lk(u,e);E.each((S,k,P)=>{var N,R;let O=P[k],W=U(O),Y=(N=S.text)===null||N===void 0?void 0:N.toString(),J=W.select(`.${M0}`),nt=T?ia*2:0,et=Un(u,c,u._indexGlobal)?-nt+4:0,xt=x.getPointAtLength($/2+et+D+S._backgroundWidth/2),Z=`translate(${xt.x}, ${xt.y})`,vt=W.select(`.${mk}`);W.attr("transform")||W.attr("transform",`${Z} scale(0)`);let X=(R=S.textColor)!==null&&R!==void 0?R:qI(S);S._shouldRenderUseElement?J.attr("href",Y).attr("x",-S._fontSizePx/2).attr("y",-S._fontSizePx/2).attr("width",S._fontSizePx).attr("height",S._fontSizePx).style("color",X):J.text(Y).attr("dy","0.1em").style("font-size",S._fontSizePx).style("fill",X),W.attr("hidden",null).style("cursor",S.cursor),G(W,n).attr("transform",`${Z} scale(1)`).style("opacity",1),vt.attr("x",-S._backgroundWidth/2).attr("y",-S._backgroundHeight/2).attr("width",S._backgroundWidth).attr("height",S._backgroundHeight).attr("rx",S._borderRadius).style("fill",S.color),D+=S._backgroundWidth+I}),G(A.exit(),n).style("opacity",0).remove()}),n>0?(t.attr("pointer-events","none"),G(t,n).attr("opacity",1).on("end interrupt",(f,d,h)=>{U(h[d]).attr("pointer-events","stroke").attr("opacity",1)})):t.attr("opacity",1),Ek(t,e,r))}function ZI(t,e,n){G(t,n/2).attr("opacity",0).remove()}function Rk(t,e,n,r){let{linkFlow:o}=e;n<or.Level2||t.each((i,a,s)=>{let l=s[a],c=U(l),u=c.select(`.${Jd}`),f=c.select(`.${Io}`).node(),d=r.get(f.getAttribute("d")),h=d??f.getTotalLength();if(!Un(i,o,i._indexGlobal)||!h)return;let p=i._state.flowAnimDistanceRelative,g=u.selectAll(`.${ra}`);g.attr("transform",m=>{let x=(p+ +m/(g.size()-1))%1,y=f.getPointAtLength(x*h);return`translate(${y.x}, ${y.y})`})})}function Pk(t,e,n){t.classed(eh,n<or.Level2),t.select(`.${Jd}`).style("opacity",n<or.Level2?0:1),t.each((i,a,s)=>{let l=z(i,e.linkFlowParticleSize,i._indexGlobal)/Math.sqrt(n);U(s[a]).selectAll(`.${ra}`).attr("r",l)}),t.selectAll(`.${Io}`).style("stroke-width",i=>Ak(i,n,e)),t.selectAll(`.${Ac}`).style("stroke-width",i=>dh(i,n,e))}var KI=zr(Pk,500);var B0=15,sY=16,No=5,Ik=25;function lY(t){var e,n,r,o;let i=Dr(t);return{left:(e=i?t.left:t)!==null&&e!==void 0?e:B0,right:(n=i?t.right:t)!==null&&n!==void 0?n:B0,top:(r=i?t.top:t)!==null&&r!==void 0?r:B0,bottom:(o=i?t.bottom:t)!==null&&o!==void 0?o:B0}}function QI(t){return(t??[]).map(n=>Object.assign(Object.assign({},n),{_padding:lY(n.padding)}))}function JI(t,e,n){t&&e.forEach(r=>{let o=t.filter(i=>i.nodes&&i.nodes.includes(r._id));r._panels=o})}function cY(t,e,n,r){let o=e.select(`.${Rn}`);if(o.empty())return;let i=40,a=110,s=10,l;o.each((c,u)=>{let f=Gn(c,n,u),d=Math.max(f,a),h=f+s+i,p=10,g={x1:Fe(c)-d/2,y1:Ge(c)-h/2+p,x2:Fe(c)+d/2,y2:Ge(c)+h/2+p};l?(l.x1>g.x1&&(l.x1=g.x1),l.y1>g.y1&&(l.y1=g.y1),l.x2<g.x2&&(l.x2=g.x2),l.y2<g.y2&&(l.y2=g.y2)):l=Object.assign({},g)}),t._x=l.x1-t._padding.left,t._y=l.y1-t._padding.top,t._width=l.x2-l.x1+t._padding.left+t._padding.right,t._height=l.y2-l.y1+t._padding.top+t._padding.bottom,t._disabled=o.data().map((c,u)=>Un(c,r,c._index)||c._state.greyout).every(c=>c)}function uY(t,e){t._numNodes=e.size()}function tN(t,e,n){let{layoutNonConnectedAside:r}=n;e&&e.forEach(o=>{let i=t.filter(a=>(!r||a._isConnected)&&o.nodes.includes(a._id));cY(o,i,n.nodeSize,n.nodeDisabled)})}function eN(t,e,n){let{layoutNonConnectedAside:r}=n;e&&e.forEach(o=>{let i=t.filter(a=>(!r||a._isConnected)&&o.nodes.includes(a._id));uY(o,i)})}function Nk(t){let e=t._width/2,n=sY+(t.dashedOutline?No:0),r=t.labelPosition===q.Bottom?t._height+n:-n;return`translate(${e}, ${r})`}function nN(t){t.attr("transform",r=>`translate(${r._x}, ${r._y})`).style("opacity",0),t.append("rect").attr("class",oh).attr("rx",9).attr("ry",9).attr("width",r=>r._width).attr("height",r=>r._height),t.append("rect").attr("class",nh).attr("rx",7).attr("ry",7).attr("width",r=>r._width).attr("height",r=>r._height);let e=t.append("g").attr("class",rh).attr("transform",Nk);e.append("rect").attr("class",PI),e.append("text").attr("class",As).attr("dy","0.32em");let n=t.append("g").attr("class",ih).attr("transform",(r,o,i)=>{let a=-No,s=-No;return`translate(${r._width+a}, ${-s})`});Ts(n,r=>r.sideIconShape,ah,II),n.append("text").attr("class",sh)}function rN(t,e,n){G(t,n).attr("transform",s=>`translate(${s._x}, ${s._y})`).style("opacity",s=>s._disabled?.4:1);let r=t.selectAll(`.${nh}`).data(s=>[s]);G(r,n).attr("width",s=>s._width).attr("height",s=>s._height).style("stroke",s=>s.borderColor).style("fill",s=>s.fillColor).style("stroke-width",s=>s.borderWidth);let o=t.select(`.${oh}`).classed(yk,s=>s.dashedOutline);G(o,n).attr("x",s=>-No).attr("y",s=>-No).attr("width",s=>s._width+No*2).attr("height",s=>s._height+No*2);let i=t.select(`.${ih}`);i.select(`.${ah}`).call(fh,s=>s.sideIconShape,s=>{var l;return(l=s.sideIconShapeSize)!==null&&l!==void 0?l:Ik}).style("stroke",s=>s.sideIconShapeStroke).style("cursor",s=>{var l;return(l=s.sideIconCursor)!==null&&l!==void 0?l:null}).style("opacity",s=>s.sideIconShape?1:0),i.select(`.${sh}`).html(s=>s.sideIconSymbol).attr("dy",1).style("fill",s=>s.sideIconSymbolColor).style("font-size",s=>{var l,c;return(l=s.sideIconFontSize)!==null&&l!==void 0?l:((c=s.sideIconShapeSize)!==null&&c!==void 0?c:Ik)/2.5}),G(i,n).attr("transform",s=>{let l=-No,c=-No;return`translate(${s._width+l}, ${-c})`});let a=t.select(`.${rh}`);a.select(`.${As}`).text(s=>si(s.label,s.labelTrimLength,s.labelTrimMode)),G(a,n).attr("transform",Nk),a.on("mouseover",(s,l)=>{let c=U(s.currentTarget),u=l.label;c.select("text").text(u),oa(c,u,As)}).on("mouseleave",(s,l)=>{let c=U(s.currentTarget),u=si(l.label,l.labelTrimLength,l.labelTrimMode);c.select("text").text(u),oa(c,u,As)})}function oN(t,e,n){G(t,n/2).style("opacity",0).remove()}var F0={hierarchyHandling:"INCLUDE_CHILDREN","nodePlacement.strategy":"NETWORK_SIMPLEX","elk.padding":"[top=15.0,left=15.0,bottom=15.0,right=15.0]","spacing.nodeNodeBetweenLayers":"50","spacing.edgeNodeBetweenLayers":"50","spacing.nodeNode":"10"};function Ls(t,e,n,r,o=0){t.forEach((i,a)=>{let s=n/2+a*n,l=r?Math.floor(s/r):0;i.y=e+l*n||0,i.x=r?s%r+o:s+o})}function $k(t,e){return t instanceof Map?Array.from(t.entries()).map(([r,o])=>{let i=$k(o,e);if(r){let a=Dr(e)?He(F0,e):He(F0,st(r,e));return{id:r,layoutOptions:a,children:i}}else return i}).flat():t}function Dk(t){var e,n;let r=t.x,o=t.y;(e=t.edges)===null||e===void 0||e.forEach(i=>{var a,s;(a=i.sections)===null||a===void 0||a.forEach(l=>{var c;l.startPoint.x+=r,l.startPoint.y+=o,l.endPoint.x+=r,l.endPoint.y+=o,(c=l.bendPoints)===null||c===void 0||c.forEach(u=>{u.x+=r,u.y+=o})}),(s=i.labels)===null||s===void 0||s.forEach(l=>{l.x+=r,l.y+=o})}),(n=t.children)===null||n===void 0||n.forEach(i=>{i.x+=r,i.y+=o,Dk(i)})}function BG(t,e,n,r){let{nonConnectedNodes:o,connectedNodes:i,nodes:a}=t,{layoutNonConnectedAside:s,nodeSize:l}=e,c=n,u=r,f=s?i:a,d=Kr(f,l),h=u/d,p=h<f.length/2?f.length/2/h:1,g=c/d,m=g<f.length/2?f.length/2/g:1,x=Math.max(m,p);if(f.forEach((y,_)=>{let v=x*c/2,b=x*u/2,w=2*_*Math.PI/f.length;y.x=c/2+v*Math.cos(w),y.y=u/2+b*Math.sin(w)}),s){let y=Kr(o,l),_=rt(i.map(A=>A.y)),v=rt(i.map(A=>A.x)),b=bt(i.map(A=>A.x)),w=v-b;Ls(o,_+y*3,y*2.25,Math.max(w,n),b)}}function MC(t,e,n,r,o){var i,a,s,l;let{nonConnectedNodes:c,connectedNodes:u,nodes:f}=t,{layoutNonConnectedAside:d,layoutGroupOrder:h,layoutParallelSortConnectionsByGroup:p,layoutParallelNodesPerColumn:g,layoutParallelSubGroupsPerRow:m,nodeSize:x,layoutNodeGroup:y,layoutParallelNodeSubGroup:_,layoutParallelGroupSpacing:v,layoutParallelNodeSpacing:b,layoutParallelSubGroupSpacing:w}=e,A=n-D0(x),L=r-D0(x)-(c.length?D0(x)*5:0),E=d?u:f,I=jv(E.map(O=>j(O,y,O._index))),F=Hv(I,O=>h.indexOf(O)).map(O=>{let W=E.filter(nt=>j(nt,y,nt._index)===O),Y=co(W,nt=>j(nt,_,nt._index)),J=Object.keys(Y).map(nt=>({nodes:Y[nt],name:nt}));return{name:O,nodes:W,subgroups:J}}),$=F.find(O=>O.name===p);if($){let O={},W=0;$.subgroups.forEach(Y=>{Y.nodes.forEach(J=>{J.links.forEach(nt=>{let et=nt?.target._id;O[et]=W,W=W+1})})}),kp(F,$).forEach(Y=>{Y.subgroups.forEach(J=>{J.nodes.sort((nt,et)=>(O[nt._id]||0)-(O[et._id]||0))})})}let T=rt(F,O=>{var W;return(W=O.nodes)===null||W===void 0?void 0:W.length}),S=40,k=10,P=w??0,N=Kr(E,x),R=Ie(b)?b:[b,b];if(o==="horizontal"){let O=2*N+k,W=3.5*N+k,Y=(i=R[0])!==null&&i!==void 0?i:mt(A/(T-1),O,W),J=N*4+S,nt=N*1.5+S,et=v??mt(L/(F.length-1),nt,J),xt=(a=R[1])!==null&&a!==void 0?a:N+S+k,Z=F.length<2?r/2:0;F.forEach(vt=>{let X=0,at=0,B=0,H=0,lt=0,ct=0;vt.subgroups.forEach(gt=>{let ot=Math.ceil(gt.nodes.length/g),Q=0,yt=X,ne=Z+at;gt.nodes.forEach(qo=>{yt=yt+Y,qo.x=yt,qo.y=ne,H=Math.max(H,yt),Q=Q+1,Q>=g&&(Q=0,ne+=xt,yt=X)});let Ne=Math.min(gt.nodes.length,g)*Y,Uo=ot*xt;B=Math.max(B,Ne),at=at+Uo+P,ct=ct+1,ct>=m&&(ct=0,at=0,X=X+B+P,B=0),lt=Math.max(lt,ne)}),vt.subgroups.forEach(gt=>{gt.nodes.forEach(ot=>{ot.x-=H/2})}),H=0,Z=lt+et})}else{let O=6*N+k,W=10*N+k,Y=v??mt(A/(T-1),O,W),J=N*2+S,nt=N*1.5+S,et=(s=R[1])!==null&&s!==void 0?s:mt(L/(F.length-1),nt,J),xt=(l=R[0])!==null&&l!==void 0?l:N*2,Z=F.length<2?n/2:0;F.forEach(vt=>{let X=0,at=0,B=0,H=0,lt=0,ct=0;vt.subgroups.forEach(gt=>{let ot=Math.ceil(gt.nodes.length/g),Q=0,yt=X,ne=Z+at;gt.nodes.forEach(qo=>{yt=yt+et,qo.x=ne,qo.y=yt,lt=Math.max(lt,yt),Q=Q+1,Q>=g&&(Q=0,ne+=xt,yt=X)});let Ne=Math.min(gt.nodes.length,g)*et,Uo=ot*xt;B=Math.max(B,Ne),at=at+Uo+P,ct=ct+1,ct>=m&&(ct=0,at=0,X=X+B+P,B=0),H=Math.max(H,ne)}),vt.subgroups.forEach(gt=>{gt.nodes.forEach(ot=>{ot.y-=lt/2})}),lt=0,Z=H+Y})}if(d){let O=Kr(c,x),W=rt(u.map(et=>et.y))||0,Y=rt(u.map(et=>et.x))||0,J=bt(u.map(et=>et.x))||0,nt=Y-J||n;Ls(c,W+O*3,O*2.25,Math.max(nt,n))}}function FG(t,e,n){return _c(this,void 0,void 0,function*(){let{nonConnectedNodes:r,connectedNodes:o,nodes:i,links:a}=t,{nodeSize:s,layoutNonConnectedAside:l,dagreLayoutSettings:c,nodeStrokeWidth:u,nodeLabel:f}=e,{Graph:d}=yield Promise.resolve().then(()=>(Ho(),Fz)),{layout:h}=yield Promise.resolve().then(()=>(O5(),D5)),p=new d;p.setGraph(c),p.setDefaultEdgeLabel(()=>({}));let g=40;if((l?o:i).forEach(x=>{p.setNode(`${x._index}`,{label:j(x,f,x._index),width:z(x,s,x._index)*1.5+z(x,u,x._index),height:g+z(x,s,x._index)*1.5,originalNode:x})}),a.forEach(x=>{p.setEdge(`${x.source._index}`,`${x.target._index}`)}),h(p),p.nodes().forEach(x=>{let y=p.node(x);y.originalNode.x=y.x,y.originalNode.y=y.y}),l){let x=Kr(r,s),y=rt(o.map(w=>w.y)),_=rt(o.map(w=>w.x)),v=bt(o.map(w=>w.x)),b=_-v;Ls(r,y+x*3,x*2.25,Math.max(b,n),0)}})}function GG(t,e,n,r){var o,i;let{nonConnectedNodes:a,connectedNodes:s,nodes:l}=t,{layoutNonConnectedAside:c,layoutGroupOrder:u,nodeSize:f,layoutNodeGroup:d}=e,h=c?s:l,p=jv(h.map(_=>j(_,d,_._index))),m=Hv(p,_=>u.indexOf(_)).map(_=>({name:_,nodes:h.filter(v=>j(v,d,v._index)===_)})),x=2*_k((i=(o=m[0])===null||o===void 0?void 0:o.nodes)!==null&&i!==void 0?i:[],f),y=n/r;if(m.forEach((_,v)=>{let b=_k(_.nodes,f),w=1.1*b*_.nodes.length/Math.PI;x<w&&(x=w),_.nodes.forEach((L,E)=>{if(v===0&&_.nodes.length===1)L.x=n/2,L.y=r/2;else{let I=0;v===0&&_.nodes.length===3&&(I=Math.PI/6),v===0&&_.nodes.length===4&&(I=Math.PI/4);let D=2*E*Math.PI/_.nodes.length+v*Math.PI/12+I;L.x=n/2+x*Math.cos(D)*y,L.y=r/2+x*Math.sin(D)}});let A=b*3;x+=A}),c){let _=Kr(a,f),v=rt(s.map(L=>L.y)),b=rt(s.map(L=>L.x)),w=bt(s.map(L=>L.x)),A=b-w;Ls(a,v+_*3,_*2.25,A,w)}}function WG(t,e,n){var r;return _c(this,void 0,void 0,function*(){let{layoutNonConnectedAside:o,forceLayoutSettings:i,nodeSize:a}=e,{forceSimulation:s,forceLink:l,forceManyBody:c,forceX:u,forceY:f,forceCollide:d}=yield Promise.resolve().then(()=>(DG(),$G)),{nonConnectedNodes:h,connectedNodes:p,nodes:g,links:m}=t;i.fixNodePositionAfterSimulation?g.forEach(_=>{_.fx=al(_._state.fx)?void 0:_._state.fx,_.fy=al(_._state.fy)?void 0:_._state.fy}):g.forEach(_=>{delete _._state.fx,delete _._state.fy});let x=s(o?p:g).force("link",l(m).id(_=>String(_._id)).distance((_,v)=>ge(i.linkDistance)?i.linkDistance(_,v):i.linkDistance).strength((_,v)=>ge(i.linkStrength)?i.linkStrength(_,v):i.linkStrength)).force("charge",c().strength((_,v)=>{if(ge(i.charge))return i.charge(_,v);{let b=m.reduce((w,A)=>w+ +(A.source===_||A.target===_),0);return i.charge*Math.sqrt(b)}})).force("x",u().strength(i.forceXStrength)).force("y",f().strength(i.forceYStrength)).force("collide",d().radius((_,v)=>Gn(_,a,v)).iterations(1)).stop(),y=(r=i.numIterations)!==null&&r!==void 0?r:Math.ceil(Math.log(x.alphaMin())/Math.log(1-x.alphaDecay()));for(let _=0,v=y;_<v;++_)x.tick();if(i.fixNodePositionAfterSimulation&&g.forEach(_=>{delete _.fx,delete _.fy,_._state.fx=_.x,_._state.fy=_.y}),o){let _=Kr(h,a),v=rt(p.map(L=>L.y)),b=rt(p.map(L=>L.x)),w=bt(p.map(L=>L.x)),A=b-w;Ls(h,v+_*6,_*2.25,Math.max(A,n),w)}})}function VG(t,e,n){return _c(this,void 0,void 0,function*(){let r=(yield Promise.resolve().then(()=>(zG(),OG))).default,o=new r,i=30,a=t.nodes.map((f,d)=>Object.assign(Object.assign(Object.assign({},f),{id:f._id,width:z(f,e.nodeSize,f._index)+z(f,e.nodeStrokeWidth,f._index),height:z(f,e.nodeSize,f._index)+i}),e.layoutElkGetNodeShape?e.layoutElkGetNodeShape(f,d):{})),s;if(e.layoutElkNodeGroups){let f=e.layoutElkNodeGroups.map(h=>p=>j(p,h,p._index)),d=lo(a,...f);s=$k(d,e.layoutElkSettings)}else s=a;let l="root",c={id:l,layoutOptions:He(F0,st(l,e.layoutElkSettings)),children:s,edges:t.links.map(f=>({id:f._id,sources:[f.source._id],targets:[f.target._id]}))},u=yield o.layout(c);if(Dk(u),a.forEach((f,d)=>{let h=t.nodes.find(p=>p._id===f.id);h&&(h.x=f.x+f.width/2,h.y=f.y+f.height/2)}),e.layoutNonConnectedAside){let f=Kr(t.nonConnectedNodes,e.nodeSize),d=rt(t.connectedNodes.map(m=>m.y))||0,h=rt(t.connectedNodes.map(m=>m.x))||0,p=bt(t.connectedNodes.map(m=>m.x))||0,g=h-p||n;Ls(t.nonConnectedNodes,d+f*3,f*2.25,Math.max(g,n))}})}var pu=class t extends Te{constructor(e){super(),this._defaultConfig=TI,this.config=this._defaultConfig,this.datamodel=new ea,this._isFirstRender=!0,this._shouldRecalculateLayout=!1,this._shouldSetPanels=!1,this._isAutoFitDisabled=!1,this._isDragging=!1,this._linkPathLengthMap=new Map,this._linkFlowFrameElapsed=0,this.events={[t.selectors.background]:{click:this._onBackgroundClick.bind(this)},[t.selectors.node]:{click:this._onNodeClick.bind(this),mouseover:this._onNodeMouseOver.bind(this),mouseout:this._onNodeMouseOut.bind(this)},[t.selectors.link]:{click:this._onLinkClick.bind(this),mouseover:this._onLinkMouseOver.bind(this),mouseout:this._onLinkMouseOut.bind(this)}},e&&this.setConfig(e),this._backgroundRect=this.g.append("rect").attr("class",gk),this._graphGroup=this.g.append("g").attr("class",xk),this._brush=this.g.append("g").attr("class",MI),this._zoomBehavior=xs().scaleExtent(this.config.zoomScaleExtent).on("zoom",n=>this._onZoom(n.transform,n)).on("start",n=>this._onZoomStart(n.transform,n)).on("end",n=>this._onZoomEnd(n.transform,n)),this._brushBehavior=lk().on("start brush end",this._onBrush.bind(this)).filter(n=>n.shiftKey).keyModifiers(!1),this._panelsGroup=this._graphGroup.append("g").attr("class",vk),this._linksGroup=this._graphGroup.append("g").attr("class",hk),this._nodesGroup=this._graphGroup.append("g").attr("class",k0),this._defs=this._graphGroup.append("defs"),this._getLinkArrowDefId=this._getLinkArrowDefId.bind(this)}get selectedNode(){var e;return(e=this._selectedNodes)===null||e===void 0?void 0:e[0]}get selectedNodes(){return this._selectedNodes}get selectedLink(){return this._selectedLink}setData(e){let{config:n}=this;n.shouldDataUpdate(this.datamodel.data,e,this.datamodel)&&(this.datamodel.nodeSort=n.nodeSort,this.datamodel.data=e,this._shouldRecalculateLayout=!0,n.layoutAutofit&&(this._shouldFitLayout=!0),this._shouldSetPanels=!0,this._addSVGDefs())}setConfig(e){super.setConfig(e);let n=this._shouldLayoutRecalculate();this._shouldRecalculateLayout=this._shouldRecalculateLayout||n,this._shouldFitLayout=this._shouldFitLayout||n,this._shouldFitLayout&&(this._isAutoFitDisabled=!1),this._shouldSetPanels=!0}get bleed(){let e=this.config.fitViewPadding;return tt(e)?{top:e,bottom:e,left:e,right:e}:e}_render(e){let{config:{disableBrush:n,disableZoom:r,duration:o,layoutAutofit:i,zoomEventFilter:a},datamodel:s}=this;if(!s.nodes&&!s.links)return;let l=tt(e)?e:o;this._backgroundRect.attr("width",this._width).attr("height",this._height).attr("opacity",0),(this._prevWidth!==this._width||this._prevHeight!==this._height)&&i&&(this._shouldFitLayout=!0,this._prevWidth=this._width,this._prevHeight=this._height),n?(this._brush.on(".brush",null),U(window).on("keydown.unovis-graph",null).on("keyup.unovis-graph",null),this._brush.classed("active")&&this._clearBrush()):(this._brushBehavior.extent([[0,0],[this._width,this._height]]),this._brush.call(this._brushBehavior),U(window).on("keydown.unovis-graph",c=>c.key==="Shift"&&this._activateBrush()).on("keyup.unovis-graph",c=>c.key==="Shift"&&this._clearBrush()),this._zoomBehavior.filter(c=>!c.shiftKey)),(this._shouldRecalculateLayout||!this._layoutCalculationPromise)&&(this._layoutCalculationPromise=this._calculateLayout(),this._layoutCalculationPromise.then(()=>{var c,u;(u=(c=this.config).onLayoutCalculated)===null||u===void 0||u.call(c,s.nodes,s.links)})),this._zoomBehavior.filter(ge(a)?a:c=>(!c.ctrlKey||c.type==="wheel")&&!c.button&&!c.shiftKey),this._layoutCalculationPromise.then(()=>{var c,u,f;if(!this.isDestroyed()){if(this._initPanelsData(),this._isFirstRender?(this._fit(),this._shouldFitLayout=!1):this._shouldFitLayout&&!this._isAutoFitDisabled&&(this._fit(o),this._shouldFitLayout=!1),this._resetSelectionGreyoutState(),this.config.selectedNodeId||this.config.selectedNodeIds){let h=((c=this.config.selectedNodeIds)!==null&&c!==void 0?c:[this.config.selectedNodeId]).map(p=>s.getNodeById(p));this._setNodeSelectionState(h)}if(this.config.selectedLinkId){let d=s.links.find(h=>h.id===this.config.selectedLinkId);this._setLinkSelectionState(d)}this._drawNodes(l),this._drawLinks(l),this._timer||(this._timer=e_(this._onLinkFlowTimerFrame.bind(this),35)),r?this.g.on(".zoom",null):this.g.call(this._zoomBehavior).on("dblclick.zoom",null),this._setUpComponentEventsThrottled(),this._setCustomAttributesThrottled(),(f=(u=this.config).onRenderComplete)===null||f===void 0||f.call(u,this.g,s.nodes,s.links,this.config,l,this._scale,this._containerWidth,this._containerHeight),this._isFirstRender=!1}})}_drawNodes(e){let{config:n,datamodel:r}=this,o=r.nodes,i=this._nodesGroup.selectAll(`.${Ar}:not(.${Zd})`).data(o,f=>String(f._id)),a=i.enter().append("g").attr("class",Ar).call(VI,n,e,this._scale),s=i.merge(a),l=Lc(s,n,e,this._scale);this._drawPanels(l,e),i.exit().classed(Zd,!0).call(HI,n,e,this._scale);let u=this;if(n.disableDrag)s.on(".drag",null);else{let f=Bf().on("start drag end",function(d,h){u._handleDrag(h,d,U(this))});s.call(f)}}_drawLinks(e){let{config:n,datamodel:{links:r}}=this,o=this._linksGroup.selectAll(`.${Tr}:not(.${L0}`).data(r,l=>String(l._id)),i=o.enter().append("g").attr("class",Tr).call(XI,n,e);o.merge(i).call(z0,n,e,this._scale,this._getLinkArrowDefId,this._linkPathLengthMap),o.exit().attr("class",L0).call(ZI,n,e)}_drawPanels(e,n){var r;let{config:o}=this;if(G(this._panelsGroup,n/2).style("opacity",!((r=o.panels)===null||r===void 0)&&r.length?1:0),!this._panels)return;let i=e.duration?e.selection():e;eN(i,this._panels,o),tN(i,this._panels,o);let a=this._panels.filter(f=>f._numNodes),s=this._panelsGroup.selectAll(`.${R0}`).data(a,f=>f.label);s.exit().call(oN,o,n);let c=s.enter().append("g").attr("class",R0).call(nN,i),u=s.merge(c);this._updatePanels(u,n)}_updatePanels(e,n){let{config:r}=this;this._panels&&e.call(rN,r,n)}_calculateLayout(){return _c(this,void 0,void 0,function*(){let{config:e,datamodel:n}=this;if(this._currentLayoutType!==e.layoutType)for(let r of n.nodes)delete r._state.fx,delete r._state.fy;switch(e.layoutType){case Ze.Precalculated:break;case Ze.Parallel:MC(n,e,this._width,this._height);break;case Ze.ParallelHorizontal:MC(n,e,this._width,this._height,"horizontal");break;case Ze.Dagre:yield FG(n,e,this._width);break;case Ze.Force:yield WG(n,e,this._width);break;case Ze.Concentric:GG(n,e,this._width,this._height);break;case Ze.Elk:yield VG(n,e,this._width);break;case Ze.Circular:default:BG(n,e,this._width,this._height);break}this._initPanelsData(),this._shouldRecalculateLayout=!1,this._currentLayoutType=e.layoutType})}_initPanelsData(){let{config:e,datamodel:n}=this;this._shouldSetPanels&&(this._panels=QI(e.panels),JI(this._panels,n.nodes,this.config),this._shouldSetPanels=!1)}_fit(e=0,n,r=this.config.fitViewAlign){if(this.isDestroyed())return;let{datamodel:o,config:{nodeSize:i}}=this,a=n?.length?o.nodes.filter(f=>n.includes(f.id)):o.nodes,s=Kr(a,i),l=[bt(a,f=>Fe(f)-s/2-(rt((f._panels||[]).map(d=>d._padding.left))||0)),rt(a,f=>Fe(f)+s/2+(rt((f._panels||[]).map(d=>d._padding.right))||0))],c=[bt(a,f=>Ge(f)-s/2-(rt((f._panels||[]).map(d=>d._padding.top))||0)),rt(a,f=>Ge(f)+s/2+(rt((f._panels||[]).map(d=>d._padding.bottom))||0))];if(l.some(f=>f===void 0)||c.some(f=>f===void 0)){console.warn("Unovis | Graph: Some of the node coordinates are undefined. This can happen if you try to fit the graph before the layout has been calculated.");return}let u=this._getTransform(l,c,r);G(this.g,e).call(this._zoomBehavior.transform,u),this._onZoom(u)}_getTransform(e,n,r){let{zoomScaleExtent:o}=this.config,{left:i,top:a,right:s,bottom:l}=this.bleed,c=this._width,u=this._height,f=c/(e[1]-e[0]+(i||0)+(s||0)),d=u/(n[1]-n[0]+(a||0)+(l||0)),h=mt(bt([f,d]),o[0],o[1]),p,g;switch(r){case To.Left:p=i-e[0]*h,g=this._height/2-(n[0]+(n[1]-n[0])/2)*h;break;case To.Right:p=this._width-(e[1]-e[0])*h-s,g=this._height/2-(n[0]+(n[1]-n[0])/2)*h;break;case To.Top:p=this._width/2-(e[0]+(e[1]-e[0])/2)*h,g=a-n[0]*h;break;case To.Bottom:p=this._width/2-(e[0]+(e[1]-e[0])/2)*h,g=this._height-(n[1]-n[0])*h-l;break;case To.Center:default:p=this._width/2-(e[0]+(e[1]-e[0])/2)*h,g=this._height/2-(n[0]+(n[1]-n[0])/2)*h}return hn.translate(p,g).scale(h)}_setNodeSelectionState(e){let{config:n,datamodel:r}=this;for(let o of r.nodes)o._state.selected=!1,n.nodeSelectionHighlightMode!==Ji.None&&(o._state.greyout=!0);for(let o of r.links)o._state.selected=!1,n.nodeSelectionHighlightMode!==Ji.None&&(o._state.greyout=!0);this._selectedNodes=e.filter(o=>{let i=!!o;return i||console.warn("Unovis | Graph: Select Node: Not found"),i});for(let o of this._selectedNodes)o._state.selected=!0,o._state.greyout=!1;n.nodeSelectionHighlightMode===Ji.GreyoutNonConnected&&r.links.filter(i=>this._selectedNodes.includes(i.source)||this._selectedNodes.includes(i.target)).forEach(i=>{i.source._state.greyout=!1,i.target._state.greyout=!1,i._state.greyout=!1})}_setLinkSelectionState(e){let{datamodel:{nodes:n,links:r}}=this;e||console.warn("Unovis: Graph: Select Link: Not found"),this._selectedLink=e;let o=e?.source,i=e?.target;n.forEach(a=>{a._state.selected=!1,a._state.greyout=!0,(i?._id===a._id||o?._id===a._id)&&(e._state.greyout=!1)}),r.forEach(a=>{a._state.greyout=!0;let s=a.source,l=a.target;s._id===o?._id&&l._id===i?._id&&(s._state.greyout=!1,l._state.greyout=!1,a._state.greyout=!1)}),r.forEach(a=>{delete a._state.selected}),e&&(e._state.selected=!0)}_resetSelectionGreyoutState(){let{datamodel:{nodes:e,links:n}}=this;this._selectedNodes=[],this._selectedLink=void 0,e.forEach(r=>{delete r._state.selected,delete r._state.greyout}),n.forEach(r=>{delete r._state.greyout,delete r._state.selected})}_updateNodesLinksPartial(){let{config:e}=this;this._linksGroup.selectAll(`.${Tr}`).call(Ek,e,this._scale),this._nodesGroup.selectAll(`.${Ar}`).call(Tc,e,e.duration,this._scale)}_onBackgroundClick(){this._resetSelectionGreyoutState(),this._updateNodesLinksPartial()}_onNodeClick(e){}_onNodeMouseOut(e){this._updateNodesLinksPartial()}_onNodeMouseOver(e){this._updateNodesLinksPartial()}_onLinkClick(e){}_onLinkMouseOver(e){this._isDragging||(this.config.linkHighlightOnHover&&(e._state.hovered=!0),this._updateNodesLinksPartial())}_onLinkMouseOut(e){this._isDragging||(delete e._state.hovered,this._updateNodesLinksPartial())}_onLinkFlowTimerFrame(e=0){let{config:n,datamodel:{links:r}}=this;if(!r.some((s,l)=>Un(s,n.linkFlow,l)))return;let i=e-this._linkFlowFrameElapsed,a=this._linksGroup.selectAll(`.${Tr}`);a.each((s,l,c)=>{var u;let f=z(s,n.linkFlowParticleSpeed,s._indexGlobal),d=c[l].querySelector(`.${Cs}`),h=d?(u=this._linkPathLengthMap.get(d.getAttribute("d")))!==null&&u!==void 0?u:d.getTotalLength():0;if(h<=0)return;let p=f||h/z(s,n.linkFlowAnimDuration,s._indexGlobal)*1e3;s._state.flowAnimDistancePx=(s._state.flowAnimDistancePx||0)+i/1e3*p,s._state.flowAnimDistanceRelative=s._state.flowAnimDistancePx%h/h}),this._linkFlowFrameElapsed=e,Rk(a,this.config,this._scale,this._linkPathLengthMap)}_onZoom(e,n){let{config:r,datamodel:{nodes:o}}=this,i=e||n.transform;this._scale=i.k,this._graphGroup.attr("transform",i.toString()),ge(r.onZoom)&&r.onZoom(this._scale,r.zoomScaleExtent,n,i),this._initialTransform||(this._initialTransform=i),n?.sourceEvent&&(Object.keys(i).reduce((s,l)=>{let c=i[l],u=this._initialTransform[l],f=Math.abs(c-u),d=l==="k"?20*f:f/15;return s+=d,s},0)>r.layoutAutofitTolerance?this._isAutoFitDisabled=!0:this._isAutoFitDisabled=!1),this._nodesGroup.selectAll(`.${Ar}`).call(o.length>r.zoomThrottledUpdateNodeThreshold?jI:Sk,r,this._scale),this._linksGroup.selectAll(`.${Tr}`).call(o.length>r.zoomThrottledUpdateNodeThreshold?KI:Pk,r,this._scale,this._getLinkArrowDefId)}_onZoomStart(e,n){let{config:r}=this,o=e||n.transform;this._scale=o.k,ge(r.onZoomStart)&&r.onZoomStart(this._scale,r.zoomScaleExtent,n,o)}_onZoomEnd(e,n){let{config:r}=this,o=e||n.transform;this._scale=o.k,ge(r.onZoomEnd)&&r.onZoomEnd(this._scale,r.zoomScaleExtent,n,o)}_updateNodePosition(e,n,r){var o,i;let a=ta(this.g.node()),s=a.k,l=(i=(o=this._panels)===null||o===void 0?void 0:o.filter(p=>p.nodes.includes(e._id)))!==null&&i!==void 0?i:[],c=Gn(e,this.config.nodeSize,e._index),u=bt([(this._height-a.y)/s,...l.map(p=>p._y+p._height)])-c/2,f=bt([(this._width-a.x)/s,...l.map(p=>p._x+p._width)])-c/2,d=rt([-a.y/s,...l.map(p=>p._y)])+c/2,h=rt([-a.x/s,...l.map(p=>p._x)])+c/2;r<d?r=d:r>u&&(r=u),n<h?n=h:n>f&&(n=f),Math.sqrt(Math.pow(n-e.x,2)+Math.pow(r-e.y,2))<15&&(n=e.x,r=e.y),e._state.fx=n,e._state.fy=r,e._state.fx===e.x&&delete e._state.fx,e._state.fy===e.y&&delete e._state.fy}_onBrush(e){var n;if(!e.selection||!e.sourceEvent)return;let{config:r}=this,o=ta(this._graphGroup.node()),[i,a]=o.invert(e.selection[0]),[s,l]=o.invert(e.selection[1]);this._nodesGroup.selectAll(`.${Ar}`).each(u=>{let f=Fe(u),d=Ge(u);u._state.brushed=f>=i&&f<=s&&d>=a&&d<=l}).classed(Cc,u=>u._state.brushed);let c=this._nodesGroup.selectAll(`.${Cc}`).call(Tc,r,0,this._scale);this._brush.classed("active",e.type!=="end"),(n=r.onNodeSelectionBrush)===null||n===void 0||n.call(r,c.data(),e)}_handleDrag(e,n,r){if(n.sourceEvent.shiftKey&&e._state.brushed)this._dragSelectedNodes(n);else if(!n.sourceEvent.shiftKey)switch(n.type){case"start":this._onDragStarted(e,n,r);break;case"drag":this._onDragged(e,n);break;case"end":this._onDragEnded(e,n,r);break}}_onDragStarted(e,n,r){var o;let{config:i}=this;this._isDragging=!0,e._state.isDragged=!0,r.call(Lc,i,0,this._scale),(o=i.onNodeDragStart)===null||o===void 0||o.call(i,e,n)}_onDragged(e,n){var r;let{config:o}=this,a=ta(this.g.node()).k,[s,l]=oe(n,this._graphGroup.node());this._updateNodePosition(e,s,l),this._nodesGroup.selectAll(`.${Ar}`).filter(p=>p._id===e._id).call(Lc,o,0,a);let d=this._linksGroup.selectAll(`.${Tr}`).filter(p=>{let g=p.source,m=p.target;return g._id===e._id||m._id===e._id});d.call(z0,o,0,a,this._getLinkArrowDefId,this._linkPathLengthMap);let h=d.filter(p=>p._state.greyout);h.size()&&Rk(h,o,this._scale,this._linkPathLengthMap),(r=o.onNodeDrag)===null||r===void 0||r.call(o,e,n)}_onDragEnded(e,n,r){var o;let{config:i}=this;this._isDragging=!1,e._state.isDragged=!1,r.call(Lc,i,0,this._scale),(o=i.onNodeDragEnd)===null||o===void 0||o.call(i,e,n)}_dragSelectedNodes(e){var n,r;let{config:o}=this,i=oe(e,this._graphGroup.node()),a=G(this._nodesGroup.selectAll(`.${Cc}`));if(e.type==="start")this._groupDragInit=i,this._isDragging=!0,a.each(s=>{s.x=Fe(s),s.y=Ge(s),s._state.isDragged=!0});else if(e.type==="drag"){let s=i[0]-this._groupDragInit[0],l=i[1]-this._groupDragInit[1];a.each(u=>this._updateNodePosition(u,u.x+s,u.y+l)),G(this._linksGroup.selectAll(`.${Tr}`).filter(u=>{var f,d,h,p;return((d=(f=u.source)===null||f===void 0?void 0:f._state)===null||d===void 0?void 0:d.isDragged)||((p=(h=u.target)===null||h===void 0?void 0:h._state)===null||p===void 0?void 0:p.isDragged)})).call(z0,this.config,0,this._scale,this._getLinkArrowDefId,this._linkPathLengthMap)}else this._isDragging=!1,a.each(s=>{s._state.isDragged=!1});a.call(Lc,o,0,this._scale),(r=(n=this.config).onNodeSelectionDrag)===null||r===void 0||r.call(n,a.data(),e)}_activateBrush(){this._brush.classed("active",!0),this._nodesGroup.selectAll(`.${Ar}`).classed(bs,!0)}_clearBrush(){var e;this._brush.classed("active",!1).call((e=this._brushBehavior)===null||e===void 0?void 0:e.clear),this._nodesGroup.selectAll(`.${Ar}`).classed(bs,!1).classed(Cc,!1).each(n=>{n._state.brushed=!1}).call(Tc,this.config,0,this._scale)}_shouldLayoutRecalculate(){let{prevConfig:e,config:n}=this;if(e.layoutType!==n.layoutType||e.layoutNonConnectedAside!==n.layoutNonConnectedAside)return!0;if(e.layoutType===Ze.Force){let r=Sp(e.forceLayoutSettings,n.forceLayoutSettings);if(Object.keys(r).length)return!0}if(e.layoutType===Ze.Dagre){let r=Sp(e.dagreLayoutSettings,n.dagreLayoutSettings);if(Object.keys(r).length)return!0}if(e.layoutType===Ze.Elk)if(Dr(e.layoutElkSettings)&&Dr(n.layoutElkSettings)){let r=Sp(e.layoutElkSettings,n.layoutElkSettings);return!!Object.keys(r).length}else return e.layoutElkSettings!==n.layoutElkSettings;return(e.layoutType===Ze.Parallel||e.layoutType===Ze.ParallelHorizontal||e.layoutType===Ze.Concentric)&&(!An(e.layoutGroupOrder,n.layoutGroupOrder)||e.layoutParallelNodesPerColumn!==n.layoutParallelNodesPerColumn||e.layoutParallelSortConnectionsByGroup!==n.layoutParallelSortConnectionsByGroup)}_getLinkArrowDefId(e){return e?`${this.uid}-${e}`:null}_addSVGDefs(){this._defs.selectAll("*").remove(),this._defs.append("path").attr("d",YI()).attr("id",this._getLinkArrowDefId(Qi.Single)),this._defs.append("path").attr("d",UI()).attr("id",this._getLinkArrowDefId(Qi.Double))}zoomIn(e=.3){let n=1+e;G(this.g,this.config.duration/2).call(this._zoomBehavior.scaleBy,n)}zoomOut(e=.3){let n=1-e;G(this.g,this.config.duration/2).call(this._zoomBehavior.scaleBy,n)}setZoom(e){G(this.g,this.config.duration/2).call(this._zoomBehavior.scaleTo,e)}getZoom(){return ta(this.g.node()).k}fitView(e=this.config.duration,n,r){var o;(o=this._layoutCalculationPromise)===null||o===void 0||o.then(()=>{this._fit(e,n,r)})}fitViewToBounds(e,n,r=this.config.duration,o=this.config.fitViewAlign){let{datamodel:{nodes:i}}=this;if(!e&&!n){console.warn("Unovis | Graph: At least one extent (x or y) must be provided.");return}let a=i.filter(l=>{let c=Fe(l),u=Ge(l);return(!e||c!==void 0&&c>=e[0]&&c<=e[1])&&(!n||u>=n[0]&&u<=n[1])});if((!e||!n)&&!a.length){console.warn(`Unovis | Graph: No nodes found within provided extent [${e}], [${n}].`);return}let s=this._getTransform(e??Hn(a,l=>Fe(l)),n??Hn(a,l=>Ge(l)),o);G(this.g,r).call(this._zoomBehavior.transform,s),this._onZoom(s)}resetAutofitState(){this._isAutoFitDisabled=!1}getNodesCoordinates(){let{datamodel:{nodes:e}}=this;return e.map(n=>({id:n._id,x:n.x,y:n.y}))}getNodeCoordinatesById(e){let{datamodel:{nodes:n}}=this,r=n.find(o=>o._id===e);if(r)return{id:r._id,x:r.x,y:r.y};console.warn(`Unovis | Graph: Node ${e} not found`)}setNodeStateById(e,n){this.datamodel.setNodeStateById(e,n)}updateNodePositions(e){let{config:n}=this,r=tt(e)?e:n.duration,o=this._linksGroup.selectAll(`.${Tr}:not(.${L0}`);Mk(o,n,r,this._scale,this._getLinkArrowDefId,this._linkPathLengthMap);let i=this._nodesGroup.selectAll(`.${Ar}:not(.${Zd})`);kk(i,r)}};pu.selectors={root:EI,graphGroup:xk,background:gk,node:Ar,nodeShape:Rn,nodeGauge:Zr,nodeSideLabel:Xd,nodeLabel:Xr,dimmedNode:Qd,link:Tr,linkLine:Io,linkLabel:th,dimmedLink:E0,panel:R0,panelRect:nh,panelSelection:oh,panelLabel:rh,panelLabelText:As,panelSideIcon:ih,panelSideIconShape:ah,panelSideIconSymbol:sh};pu.nodeSelectors=dk;Nl();function RC(t){return t}function hv(t){if(t==null)return RC;var e,n,r=t.scale[0],o=t.scale[1],i=t.translate[0],a=t.translate[1];return function(s,l){l||(e=n=0);var c=2,u=s.length,f=new Array(u);for(f[0]=(e+=s[0])*r+i,f[1]=(n+=s[1])*o+a;c<u;)f[c]=s[c],++c;return f}}function HG(t,e){for(var n,r=t.length,o=r-e;o<--r;)n=t[o],t[o++]=t[r],t[r]=n}function PC(t,e){return typeof e=="string"&&(e=t.objects[e]),e.type==="GeometryCollection"?{type:"FeatureCollection",features:e.geometries.map(function(n){return jG(t,n)})}:jG(t,e)}function jG(t,e){var n=e.id,r=e.bbox,o=e.properties==null?{}:e.properties,i=IC(t,e);return n==null&&r==null?{type:"Feature",properties:o,geometry:i}:r==null?{type:"Feature",id:n,properties:o,geometry:i}:{type:"Feature",id:n,bbox:r,properties:o,geometry:i}}function IC(t,e){var n=hv(t.transform),r=t.arcs;function o(u,f){f.length&&f.pop();for(var d=r[u<0?~u:u],h=0,p=d.length;h<p;++h)f.push(n(d[h],h));u<0&&HG(f,p)}function i(u){return n(u)}function a(u){for(var f=[],d=0,h=u.length;d<h;++d)o(u[d],f);return f.length<2&&f.push(f[0]),f}function s(u){for(var f=a(u);f.length<4;)f.push(f[0]);return f}function l(u){return u.map(s)}function c(u){var f=u.type,d;switch(f){case"GeometryCollection":return{type:f,geometries:u.geometries.map(c)};case"Point":d=i(u.coordinates);break;case"MultiPoint":d=u.coordinates.map(i);break;case"LineString":d=a(u.arcs);break;case"MultiLineString":d=u.arcs.map(a);break;case"Polygon":d=l(u.arcs);break;case"MultiPolygon":d=u.arcs.map(l);break;default:return null}return{type:f,coordinates:d}}return c(e)}var pv=class extends pr{constructor(){super(...arguments),this._areas=[],this._points=[],this._links=[],this.pointId=e=>e.id,this.linkSource=e=>e.source,this.linkTarget=e=>e.target}get data(){return this._data}set data(e){var n,r,o;e&&(this._data=e,this._areas=Or((n=e?.areas)!==null&&n!==void 0?n:[]),this._points=Or((r=e?.points)!==null&&r!==void 0?r:[]),this._links=Or((o=e?.links)!==null&&o!==void 0?o:[]).reduce((i,a)=>{let s=this.findPoint(this.points,this.linkSource(a)),l=this.findPoint(this.points,this.linkTarget(a));return s&&l&&i.push({source:s,target:l}),i},[]))}get areas(){return this._areas}get points(){return this._points}get links(){return this._links}findPoint(e,n){let r;return tt(n)?r=e[n]:Qo(n)?r=e.find((o,i)=>this.pointId(o,i)===n):Pu(n)&&(r=e.find(o=>o===n)),r||console.warn(`Point ${n} is missing from the points list`),r}};var YG=Object.assign(Object.assign({},Ae),{projection:void 0,duration:1500,topojson:void 0,mapFeatureName:"countries",mapFitToPoints:!1,zoomExtent:[.5,12],zoomDuration:400,disableZoom:!1,zoomFactor:void 0,zoomToLocation:void 0,linkWidth:t=>{var e;return(e=t.width)!==null&&e!==void 0?e:1},linkColor:t=>{var e;return(e=t.color)!==null&&e!==void 0?e:null},linkCursor:null,linkId:(t,e)=>{var n;return`${(n=t.id)!==null&&n!==void 0?n:e}`},linkSource:t=>t.source,linkTarget:t=>t.target,sourceLongitude:t=>t.sourceLongitude,sourceLatitude:t=>t.sourceLatitude,targetLongitude:t=>t.targetLongitude,targetLatitude:t=>t.targetLatitude,sourcePointRadius:3,sourcePointColor:"#88919f",flowParticleColor:"#949dad",flowParticleRadius:1.1,flowParticleSpeed:.07,flowParticleDensity:.6,enableFlowAnimation:!1,onSourcePointClick:void 0,onSourcePointMouseEnter:void 0,onSourcePointMouseLeave:void 0,areaId:t=>{var e;return(e=t.id)!==null&&e!==void 0?e:""},areaColor:t=>{var e;return(e=t.color)!==null&&e!==void 0?e:null},areaCursor:null,areaLabel:void 0,longitude:t=>t.longitude,latitude:t=>t.latitude,pointColor:t=>{var e;return(e=t.color)!==null&&e!==void 0?e:null},pointRadius:t=>{var e;return(e=t.radius)!==null&&e!==void 0?e:8},pointStrokeWidth:t=>{var e;return(e=t.strokeWidth)!==null&&e!==void 0?e:0},pointShape:()=>Bt.Circle,pointRingWidth:t=>{var e;return(e=t.ringWidth)!==null&&e!==void 0?e:2},pointCursor:null,pointLabel:void 0,pointLabelColor:void 0,pointLabelPosition:Ki.Center,pointBottomLabel:void 0,pointLabelTextBrightnessRatio:.65,pointId:t=>t.id,clusterColor:void 0,clusterRadius:void 0,clusterLabel:t=>`${t.pointCount}`,clusterLabelColor:void 0,clusterBottomLabel:"",clusterRingWidth:2,clusterBackground:!0,clusterExpandOnClick:!0,clusteringDistance:55,clustering:!1,heatmapMode:!1,heatmapModeBlurStdDeviation:8,heatmapModeZoomLevelThreshold:2.5,colorMap:{}});function Zh(t,e,n,r,o,i){if(o-r<=n)return;let a=r+o>>1;UG(t,e,a,r,o,i%2),Zh(t,e,n,r,a-1,i+1),Zh(t,e,n,a+1,o,i+1)}function UG(t,e,n,r,o,i){for(;o>r;){if(o-r>600){let c=o-r+1,u=n-r+1,f=Math.log(c),d=.5*Math.exp(2*f/3),h=.5*Math.sqrt(f*d*(c-d)/c)*(u-c/2<0?-1:1),p=Math.max(r,Math.floor(n-u*d/c+h)),g=Math.min(o,Math.floor(n+(c-u)*d/c+h));UG(t,e,n,p,g,i)}let a=e[2*n+i],s=r,l=o;for(Xh(t,e,r,n),e[2*o+i]>a&&Xh(t,e,r,o);s<l;){for(Xh(t,e,s,l),s++,l--;e[2*s+i]<a;)s++;for(;e[2*l+i]>a;)l--}e[2*r+i]===a?Xh(t,e,r,l):(l++,Xh(t,e,l,o)),l<=n&&(r=l+1),n<=l&&(o=l-1)}}function Xh(t,e,n,r){NC(t,n,r),NC(e,2*n,2*r),NC(e,2*n+1,2*r+1)}function NC(t,e,n){let r=t[e];t[e]=t[n],t[n]=r}function $C(t,e,n,r,o,i,a){let s=[0,t.length-1,0],l=[],c,u;for(;s.length;){let f=s.pop(),d=s.pop(),h=s.pop();if(d-h<=a){for(let m=h;m<=d;m++)c=e[2*m],u=e[2*m+1],c>=n&&c<=o&&u>=r&&u<=i&&l.push(t[m]);continue}let p=Math.floor((h+d)/2);c=e[2*p],u=e[2*p+1],c>=n&&c<=o&&u>=r&&u<=i&&l.push(t[p]);let g=(f+1)%2;(f===0?n<=c:r<=u)&&(s.push(h),s.push(p-1),s.push(g)),(f===0?o>=c:i>=u)&&(s.push(p+1),s.push(d),s.push(g))}return l}function DC(t,e,n,r,o,i){let a=[0,t.length-1,0],s=[],l=o*o;for(;a.length;){let c=a.pop(),u=a.pop(),f=a.pop();if(u-f<=i){for(let m=f;m<=u;m++)qG(e[2*m],e[2*m+1],n,r)<=l&&s.push(t[m]);continue}let d=Math.floor((f+u)/2),h=e[2*d],p=e[2*d+1];qG(h,p,n,r)<=l&&s.push(t[d]);let g=(c+1)%2;(c===0?n-o<=h:r-o<=p)&&(a.push(f),a.push(d-1),a.push(g)),(c===0?n+o>=h:r+o>=p)&&(a.push(d+1),a.push(u),a.push(g))}return s}function qG(t,e,n,r){let o=t-n,i=e-r;return o*o+i*i}var Bet=t=>t[0],Fet=t=>t[1],mu=class{constructor(e,n=Bet,r=Fet,o=64,i=Float64Array){this.nodeSize=o,this.points=e;let a=e.length<65536?Uint16Array:Uint32Array,s=this.ids=new a(e.length),l=this.coords=new i(e.length*2);for(let c=0;c<e.length;c++)s[c]=c,l[2*c]=n(e[c]),l[2*c+1]=r(e[c]);Zh(s,l,o,0,s.length-1,0)}range(e,n,r,o){return $C(this.ids,this.coords,e,n,r,o,this.nodeSize)}within(e,n,r){return DC(this.ids,this.coords,e,n,r,this.nodeSize)}};var Get={minZoom:0,maxZoom:16,minPoints:2,radius:40,extent:512,nodeSize:64,log:!1,generateId:!1,reduce:null,map:t=>t},xv=Math.fround||(t=>(e=>(t[0]=+e,t[0])))(new Float32Array(1)),Qh=class{constructor(e){this.options=Kh(Object.create(Get),e),this.trees=new Array(this.options.maxZoom+1)}load(e){let{log:n,minZoom:r,maxZoom:o,nodeSize:i}=this.options;n&&console.time("total time");let a=`prepare ${e.length} points`;n&&console.time(a),this.points=e;let s=[];for(let l=0;l<e.length;l++)e[l].geometry&&s.push(Vet(e[l],l));this.trees[o+1]=new mu(s,ZG,KG,i,Float32Array),n&&console.timeEnd(a);for(let l=o;l>=r;l--){let c=+Date.now();s=this._cluster(s,l),this.trees[l]=new mu(s,ZG,KG,i,Float32Array),n&&console.log("z%d: %d clusters in %dms",l,s.length,+Date.now()-c)}return n&&console.timeEnd("total time"),this}getClusters(e,n){let r=((e[0]+180)%360+360)%360-180,o=Math.max(-90,Math.min(90,e[1])),i=e[2]===180?180:((e[2]+180)%360+360)%360-180,a=Math.max(-90,Math.min(90,e[3]));if(e[2]-e[0]>=360)r=-180,i=180;else if(r>i){let u=this.getClusters([r,o,180,a],n),f=this.getClusters([-180,o,i,a],n);return u.concat(f)}let s=this.trees[this._limitZoom(n)],l=s.range(mv(r),gv(a),mv(i),gv(o)),c=[];for(let u of l){let f=s.points[u];c.push(f.numPoints?XG(f):this.points[f.index])}return c}getChildren(e){let n=this._getOriginId(e),r=this._getOriginZoom(e),o="No cluster with the specified id.",i=this.trees[r];if(!i)throw new Error(o);let a=i.points[n];if(!a)throw new Error(o);let s=this.options.radius/(this.options.extent*Math.pow(2,r-1)),l=i.within(a.x,a.y,s),c=[];for(let u of l){let f=i.points[u];f.parentId===e&&c.push(f.numPoints?XG(f):this.points[f.index])}if(c.length===0)throw new Error(o);return c}getLeaves(e,n,r){n=n||10,r=r||0;let o=[];return this._appendLeaves(o,e,n,r,0),o}getTile(e,n,r){let o=this.trees[this._limitZoom(e)],i=Math.pow(2,e),{extent:a,radius:s}=this.options,l=s/a,c=(r-l)/i,u=(r+1+l)/i,f={features:[]};return this._addTileFeatures(o.range((n-l)/i,c,(n+1+l)/i,u),o.points,n,r,i,f),n===0&&this._addTileFeatures(o.range(1-l/i,c,1,u),o.points,i,r,i,f),n===i-1&&this._addTileFeatures(o.range(0,c,l/i,u),o.points,-1,r,i,f),f.features.length?f:null}getClusterExpansionZoom(e){let n=this._getOriginZoom(e)-1;for(;n<=this.options.maxZoom;){let r=this.getChildren(e);if(n++,r.length!==1)break;e=r[0].properties.cluster_id}return n}_appendLeaves(e,n,r,o,i){let a=this.getChildren(n);for(let s of a){let l=s.properties;if(l&&l.cluster?i+l.point_count<=o?i+=l.point_count:i=this._appendLeaves(e,l.cluster_id,r,o,i):i<o?i++:e.push(s),e.length===r)break}return i}_addTileFeatures(e,n,r,o,i,a){for(let s of e){let l=n[s],c=l.numPoints,u,f,d;if(c)u=QG(l),f=l.x,d=l.y;else{let g=this.points[l.index];u=g.properties,f=mv(g.geometry.coordinates[0]),d=gv(g.geometry.coordinates[1])}let h={type:1,geometry:[[Math.round(this.options.extent*(f*i-r)),Math.round(this.options.extent*(d*i-o))]],tags:u},p;c?p=l.id:this.options.generateId?p=l.index:this.points[l.index].id&&(p=this.points[l.index].id),p!==void 0&&(h.id=p),a.features.push(h)}}_limitZoom(e){return Math.max(this.options.minZoom,Math.min(Math.floor(+e),this.options.maxZoom+1))}_cluster(e,n){let r=[],{radius:o,extent:i,reduce:a,minPoints:s}=this.options,l=o/(i*Math.pow(2,n));for(let c=0;c<e.length;c++){let u=e[c];if(u.zoom<=n)continue;u.zoom=n;let f=this.trees[n+1],d=f.within(u.x,u.y,l),h=u.numPoints||1,p=h;for(let g of d){let m=f.points[g];m.zoom>n&&(p+=m.numPoints||1)}if(p>h&&p>=s){let g=u.x*h,m=u.y*h,x=a&&h>1?this._map(u,!0):null,y=(c<<5)+(n+1)+this.points.length;for(let _ of d){let v=f.points[_];if(v.zoom<=n)continue;v.zoom=n;let b=v.numPoints||1;g+=v.x*b,m+=v.y*b,v.parentId=y,a&&(x||(x=this._map(u,!0)),a(x,this._map(v)))}u.parentId=y,r.push(Wet(g/p,m/p,y,p,x))}else if(r.push(u),p>1)for(let g of d){let m=f.points[g];m.zoom<=n||(m.zoom=n,r.push(m))}}return r}_getOriginId(e){return e-this.points.length>>5}_getOriginZoom(e){return(e-this.points.length)%32}_map(e,n){if(e.numPoints)return n?Kh({},e.properties):e.properties;let r=this.points[e.index].properties,o=this.options.map(r);return n&&o===r?Kh({},o):o}};function Wet(t,e,n,r,o){return{x:xv(t),y:xv(e),zoom:1/0,id:n,parentId:-1,numPoints:r,properties:o}}function Vet(t,e){let[n,r]=t.geometry.coordinates;return{x:xv(mv(n)),y:xv(gv(r)),zoom:1/0,index:e,parentId:-1}}function XG(t){return{type:"Feature",id:t.id,properties:QG(t),geometry:{type:"Point",coordinates:[Het(t.x),jet(t.y)]}}}function QG(t){let e=t.numPoints,n=e>=1e4?`${Math.round(e/1e3)}k`:e>=1e3?`${Math.round(e/100)/10}k`:e;return Kh(Kh({},t.properties),{cluster:!0,cluster_id:t.id,point_count:e,point_count_abbreviated:n})}function mv(t){return t/360+.5}function gv(t){let e=Math.sin(t*Math.PI/180),n=.5-.25*Math.log((1+e)/(1-e))/Math.PI;return n<0?0:n>1?1:n}function Het(t){return(t-.5)*360}function jet(t){let e=(180-t*360)*Math.PI/180;return 360*Math.atan(Math.exp(e))/Math.PI-90}function Kh(t,e){for(let n in e)t[n]=e[n];return t}function ZG(t){return t.x}function KG(t){return t.y}function Jh(t,e,n){let r=z(t,n);return[z(t,e),r]}function vv(t,e,n){if(!e||!t)return"M0,0,l0,0z";let r=3,o=n||0,i={x:t[0],y:t[1]},a={x:e[0],y:e[1]},s={x:(a.x-i.x)/r,y:(a.y-i.y)/r},l={x:(i.x-a.x)/r,y:(i.y-a.y)/r},c=.16667*Math.PI*(1+o);i.x<a.x&&(c=-c);let u=Math.cos(c),f=Math.sin(c),d=Math.cos(-c),h=Math.sin(-c),p={x:u*s.x-f*s.y,y:f*s.x+u*s.y},g={x:d*l.x-h*l.y,y:h*l.x+d*l.y};return`M${i.x},${i.y} C${i.x+p.x},${i.y+p.y} ${a.x+g.x},${a.y+g.y} ${a.x},${a.y}`}function Ys({x:t,y:e},n,r){switch(r){case Bt.Triangle:return fi(n*2,3);case Bt.Square:return fi(n*2,4);case Bt.Circle:case Bt.Ring:default:return xM(t,e,n)}}function t3(t,e){if(t.size()===0)return;let n=t.nodes(),r=t.data();n.forEach(a=>{a._labelVisible=!0});let o=n.length>0?xf(n[0]):12,i=a=>{let[s,l]=a.centroid,c=a.labelText||"",u=Oe(c,o,.6),f=o;return{x:s-u/2,y:l-f/2,width:u,height:f}};n.forEach((a,s)=>{let l=r[s];if(!a._labelVisible)return;let c=i(l);for(let u=0;u<n.length;u++){if(s===u)continue;let f=n[u],d=r[u];if(!f._labelVisible)continue;let h=i(d);if(uo(c,h,.25))if(l.area>=d.area)f._labelVisible=!1;else{a._labelVisible=!1;break}}}),G(t,e).style("opacity",(a,s)=>n[s]._labelVisible?1:0)}function JG(t){var e,n;let r=t.getBBox(),o=(n=(e=t).getScreenCTM)===null||n===void 0?void 0:n.call(e);if(!o||!t.ownerSVGElement)return{x:r.x,y:r.y,width:r.width,height:r.height};let i=t.ownerSVGElement.createSVGPoint(),s=[[r.x,r.y],[r.x+r.width,r.y],[r.x,r.y+r.height],[r.x+r.width,r.y+r.height]].map(([u,f])=>(i.x=u,i.y=f,i.matrixTransform(o))),l=s.map(u=>u.x),c=s.map(u=>u.y);return{x:Math.min(...l),y:Math.min(...c),width:Math.max(...l)-Math.min(...l),height:Math.max(...c)-Math.min(...c)}}function e3(t,e){if(t.size()===0)return;let n=t.nodes(),r=t.data();n.forEach((o,i)=>{let a=r[i];o._labelVisible=!a.expandedClusterPoint}),n.forEach((o,i)=>{if(!o._labelVisible)return;let a=r[i],s;try{s=JG(o)}catch{return}for(let l=0;l<n.length;l++){if(i===l)continue;let c=n[l];if(!c._labelVisible)continue;let u=r[l],f;try{f=JG(c)}catch{continue}if(uo(s,f,2))if(a.radius>=u.radius)c._labelVisible=!1;else{o._labelVisible=!1;break}}}),G(t,e).attr("visibility",(o,i)=>n[i]._labelVisible?null:"hidden").style("opacity",(o,i)=>n[i]._labelVisible?1:0)}function yv(t,e){return!e||Object.keys(e).length===0?[]:Object.keys(e).map(n=>{let o=e[n],i=Number(t[n])||0;return{name:n,value:i,color:o?.color||"#000",className:o?.className}})}function Yet(t,e,n,r){let o=z(t,n),i=z(t,r);return{type:"Feature",properties:Object.assign(Object.assign({},t),{_index:e}),geometry:{type:"Point",coordinates:[i,o]}}}function n3(t,e,n=24){let{colorMap:r,pointShape:o,latitude:i,longitude:a,clusteringDistance:s}=e;return new Qh({radius:s,maxZoom:n,minZoom:0,map:l=>{let u={shape:j(l,o)},f=l;for(let d of Object.keys(r||{}))u[d]=f[d]||0;return u},reduce:(l,c)=>{var u,f;l.shape=l.shape===c.shape?l.shape:Bt.Circle,l.value=((u=l.value)!==null&&u!==void 0?u:0)+((f=c.value)!==null&&f!==void 0?f:0);for(let d of Object.keys(r||{}))l[d]+=c[d]}}).load(t.map((l,c)=>Yet(l,c,i,a)))}function OC(t,e,n){var r,o;let i=!e,a=i?1+2*Math.pow(n,.8):z(t.properties,e),s=t.properties.cluster,l=s?t.properties:null,c=(o=(r=l?.point_count)!==null&&r!==void 0?r:t.properties.pointCount)!==null&&o!==void 0?o:1;return s&&i?Math.max(Math.pow(c,.35)*a,a*1.1):a}function _v(t,e,n,r,o){var i,a;let s=t.properties.cluster,l=n(t.geometry.coordinates),c=l[0],u=l[1],f=s?`cluster-${t.id}`:(a=(i=t.id!==void 0?String(t.id):void 0)!==null&&i!==void 0?i:j(t.properties,r.pointId))!==null&&a!==void 0?a:t.geometry.coordinates.join(""),d=K(t.properties,s?r.clusterColor:r.pointColor),h=OC(t,s?r.clusterRadius:r.pointRadius,o),p=s?Bt.Circle:j(t.properties,r.pointShape)||Bt.Circle,g=p===Bt.Ring,m=yv(t.properties,r.colorMap),x=rt(m,E=>E.value),y=m.map(E=>E.value).indexOf(x||0),_=m[y??0],v=s||g?d:d??_?.color,b={x1:c-h,y1:u-h,x2:c+h,y2:u+h},w=Ys({x:0,y:0},h,p);return Object.assign(Object.assign({},t),{id:f,bbox:b,radius:h,donutData:m,path:w,color:v,isCluster:s,clusterIndex:s?t.properties.clusterIndex:void 0,_zIndex:0})}function r3(t,e,n){let r=t.getClusters(e,n);for(let o of r){let i=o;if(i.properties.cluster){let s=i.properties;i.properties.clusterId=s.cluster_id,i.properties.pointCount=s.point_count,i.properties.pointCountAbbreviated=s.point_count_abbreviated,i.properties.clusterIndex=t,i.properties.clusterPoints=t.getLeaves(s.cluster_id,1/0).map(l=>l.properties)}}return r}var zC=(t,e=12)=>mt(1+t*1.5,t,e);function o3(t){let{points:e}=t,n=bt(e.map(a=>a.dx-a.packedRadius)),r=rt(e.map(a=>a.dx+a.packedRadius)),o=bt(e.map(a=>a.dy-a.packedRadius)),i=rt(e.map(a=>a.dy+a.packedRadius));return Math.sqrt(Math.pow(r-n,2)+Math.pow(i-o,2))*.5}var i3=ui().sort(null).value(t=>t.value);function a3(t,e,n,r=2,o=1,i=.05){i3.padAngle(i);let a=i3(e.filter(u=>u.value)),s=r>=n,l=Qn().innerRadius(s?0:n-r/2).outerRadius(s?n:n+r/2),c=t.selectAll("path").data(a);c.exit().remove(),c.enter().append("path").merge(c).attr("class",u=>{var f;return(f=u.data.className)!==null&&f!==void 0?f:null}).attr("d",l).style("fill",u=>{var f;return(f=u.data.color)!==null&&f!==void 0?f:null}).style("stroke",u=>{var f;return(f=u.data.color)!==null&&f!==void 0?f:null}).style("stroke-width",o)}function s3(t,e,n,r){t.attr("width","100%").attr("height","100%").attr("transform",`translate(${-(e??0)}, ${-(n??0)})`).style("cursor","default").on("click",()=>{r()})}var qC={};Wt(qC,{areaLabel:()=>gu,background:()=>GC,clusterBackground:()=>yu,clusterBackgroundCircle:()=>VC,clusterDonut:()=>np,cssVarDefaults:()=>BC,feature:()=>wv,features:()=>FC,flowParticle:()=>_u,flowParticles:()=>YC,link:()=>Sv,links:()=>jC,point:()=>xu,pointBottomLabel:()=>vu,pointDonut:()=>ep,pointLabel:()=>tp,pointPathRing:()=>bv,pointSelection:()=>rp,pointSelectionRing:()=>HC,pointShape:()=>kv,points:()=>WC,root:()=>l3,sourcePoint:()=>Cv,sourcePoints:()=>UC,variables:()=>jt});var BC={"--vis-map-feature-color":"#dce3eb","--vis-map-boundary-color":"#ffffff","--vis-map-point-label-text-color-dark":"#5b5f6d","--vis-map-point-label-text-color-light":"#fff","--vis-map-point-label-font-family":void 0,"--vis-map-point-label-font-weight":"600","--vis-map-point-label-font-size":"12px","--vis-map-area-label-text-color":"#5b5f6d","--vis-map-area-label-font-weight":"600","--vis-map-area-label-font-size":"12px","--vis-map-area-label-font-family":void 0,"--vis-map-point-bottom-label-text-color":"#5b5f6d","--vis-map-point-bottom-label-font-size":"10px","--vis-map-point-bottom-label-font-weight":"600","--vis-map-point-default-fill-color":"#B9BEC3","--vis-map-point-ring-fill-color":"#ffffff","--vis-map-point-default-stroke-color":"#959da3","--vis-map-point-default-stroke-width":"0px","--vis-map-cluster-default-fill-color":"#fff","--vis-map-cluster-default-stroke-color":"#B9BEC3","--vis-map-cluster-default-stroke-width":"1.5px","--vis-map-cluster-donut-fill-color":"#959da3","--vis-map-cluster-expanded-background-fill-color":"#fff","--vis-dark-map-feature-color":"#5b5f6d","--vis-dark-map-boundary-color":"#2a2a2a","--vis-dark-map-point-label-text-color-dark":"#fff","--vis-dark-map-point-label-text-color-light":"#5b5f6d","--vis-dark-map-area-label-text-color":"#fff","--vis-dark-map-point-bottom-label-text-color":"#fff","--vis-dark-map-point-default-fill-color":"#B9BEC3","--vis-dark-map-point-default-stroke-color":"#959da3","--vis-dark-map-point-ring-fill-color":"#5b5f6d","--vis-dark-map-cluster-default-fill-color":"#5b5f6d","--vis-dark-map-cluster-default-stroke-color":"#B9BEC3","--vis-dark-map-cluster-donut-fill-color":"#959da3","--vis-dark-map-cluster-expanded-background-fill-color":"#2a2a2a"},l3=M`
|
|
1483
|
+
label: topojson-map-component;
|
|
1484
|
+
|
|
1485
|
+
&.draggable {
|
|
1486
|
+
&:active {
|
|
1487
|
+
cursor: grabbing;
|
|
1488
|
+
cursor: -moz-grabbing;
|
|
1489
|
+
cursor: -webkit-grabbing;
|
|
1490
|
+
}
|
|
1491
|
+
}
|
|
1492
|
+
`,jt=ze(BC);Be(BC,l3);var bv=M`
|
|
1493
|
+
label: point-path-ring;
|
|
1494
|
+
fill: var(${jt.mapPointRingFillColor});
|
|
1495
|
+
`,FC=M`
|
|
1496
|
+
label: features;
|
|
1497
|
+
`,wv=M`
|
|
1498
|
+
label: feature;
|
|
1499
|
+
fill: var(${jt.mapFeatureColor});
|
|
1500
|
+
stroke: var(${jt.mapBoundaryColor});
|
|
1501
|
+
stroke-opacity: 0.5;
|
|
1502
|
+
`,gu=M`
|
|
1503
|
+
label: area-label;
|
|
1504
|
+
|
|
1505
|
+
text-anchor: middle;
|
|
1506
|
+
cursor: default;
|
|
1507
|
+
pointer-events: none;
|
|
1508
|
+
|
|
1509
|
+
font-size: var(${jt.mapAreaLabelFontSize});
|
|
1510
|
+
font-family: var(${jt.mapAreaLabelFontFamily}, var(--vis-font-family));
|
|
1511
|
+
font-weight: var(${jt.mapAreaLabelFontWeight});
|
|
1512
|
+
fill: var(${jt.mapAreaLabelTextColor});
|
|
1513
|
+
`,GC=M`
|
|
1514
|
+
label: background;
|
|
1515
|
+
|
|
1516
|
+
fill-opacity: 0;
|
|
1517
|
+
pointer-events: all;
|
|
1518
|
+
`,WC=M`
|
|
1519
|
+
label: points;
|
|
1520
|
+
`,VC=M`
|
|
1521
|
+
label: cluster-background-circle;
|
|
1522
|
+
`,xu=M`
|
|
1523
|
+
label: point;
|
|
1524
|
+
`,kv=M`
|
|
1525
|
+
label: point-shape;
|
|
1526
|
+
|
|
1527
|
+
stroke-opacity: 0.4;
|
|
1528
|
+
pointer-events: fill;
|
|
1529
|
+
transition: .3s transform;
|
|
1530
|
+
|
|
1531
|
+
&:active {
|
|
1532
|
+
cursor: default;
|
|
1533
|
+
}
|
|
1534
|
+
|
|
1535
|
+
&:hover {
|
|
1536
|
+
transform: scale(1.1);
|
|
1537
|
+
}
|
|
1538
|
+
`,tp=M`
|
|
1539
|
+
label: label;
|
|
1540
|
+
|
|
1541
|
+
text-anchor: middle;
|
|
1542
|
+
cursor: default;
|
|
1543
|
+
pointer-events:none;
|
|
1544
|
+
|
|
1545
|
+
font-size: var(${jt.mapPointLabelFontSize});
|
|
1546
|
+
font-family: var(${jt.mapPointLabelFontFamily}, var(--vis-font-family));
|
|
1547
|
+
font-weight: var(${jt.mapPointLabelFontWeight});
|
|
1548
|
+
fill: var(${jt.mapPointDefaultFillColor});
|
|
1549
|
+
stroke-width: var(${jt.mapPointDefaultStrokeWidth});
|
|
1550
|
+
`,vu=M`
|
|
1551
|
+
label: point-bottom-label;
|
|
1552
|
+
|
|
1553
|
+
text-anchor: middle;
|
|
1554
|
+
cursor: default;
|
|
1555
|
+
pointer-events:none;
|
|
1556
|
+
|
|
1557
|
+
font-size: var(${jt.mapPointBottomLabelFontSize});
|
|
1558
|
+
font-family: var(${jt.mapPointLabelFontFamily}, var(--vis-font-family));
|
|
1559
|
+
font-weight: var(${jt.mapPointBottomLabelFontWeight}, 600);
|
|
1560
|
+
fill: var(${jt.mapPointBottomLabelTextColor});
|
|
1561
|
+
`,ep=M`
|
|
1562
|
+
label: point-donut;
|
|
1563
|
+
transition: .3s transform;
|
|
1564
|
+
|
|
1565
|
+
path {
|
|
1566
|
+
stroke-opacity: 0.8;
|
|
1567
|
+
}
|
|
1568
|
+
|
|
1569
|
+
&:hover {
|
|
1570
|
+
transform: scale(1.1);
|
|
1571
|
+
}
|
|
1572
|
+
`,np=M`
|
|
1573
|
+
label: cluster-donut;
|
|
1574
|
+
transform: scale(1);
|
|
1575
|
+
transition: .3s transform;
|
|
1576
|
+
|
|
1577
|
+
path {
|
|
1578
|
+
stroke-opacity: 0.8;
|
|
1579
|
+
}
|
|
1580
|
+
|
|
1581
|
+
&:hover {
|
|
1582
|
+
transform: scale(1.1);
|
|
1583
|
+
filter: drop-shadow(0 0 2px var(${jt.mapClusterDefaultStrokeColor})) drop-shadow(0 0 4px var(${jt.mapClusterDefaultStrokeColor}));
|
|
1584
|
+
}
|
|
1585
|
+
`,yu=M`
|
|
1586
|
+
label: cluster-background;
|
|
1587
|
+
fill: var(${jt.mapClusterDefaultFillColor});
|
|
1588
|
+
stroke: none;
|
|
1589
|
+
pointer-events: all;
|
|
1590
|
+
`,HC=M`
|
|
1591
|
+
label: point-selection-ring;
|
|
1592
|
+
stroke: var(${jt.mapPointDefaultFillColor});
|
|
1593
|
+
`,rp=M`
|
|
1594
|
+
label: point-selection;
|
|
1595
|
+
|
|
1596
|
+
opacity: 0;
|
|
1597
|
+
transform: scale(1);
|
|
1598
|
+
|
|
1599
|
+
&.active {
|
|
1600
|
+
transition: all 400ms cubic-bezier(0.230, 1.000, 0.320, 1.000);
|
|
1601
|
+
opacity: 1;
|
|
1602
|
+
transform: scale(1.25);
|
|
1603
|
+
}
|
|
1604
|
+
`,jC=M`
|
|
1605
|
+
label: links;
|
|
1606
|
+
`,Sv=M`
|
|
1607
|
+
label: link;
|
|
1608
|
+
|
|
1609
|
+
fill: none;
|
|
1610
|
+
stroke-opacity: .50;
|
|
1611
|
+
stroke-linecap: round;
|
|
1612
|
+
|
|
1613
|
+
&:hover {
|
|
1614
|
+
stroke-opacity: .90;
|
|
1615
|
+
}
|
|
1616
|
+
`,YC=M`
|
|
1617
|
+
label: flow-particles;
|
|
1618
|
+
`,_u=M`
|
|
1619
|
+
label: flow-particle;
|
|
1620
|
+
|
|
1621
|
+
pointer-events: none;
|
|
1622
|
+
`,UC=M`
|
|
1623
|
+
label: source-points;
|
|
1624
|
+
`,Cv=M`
|
|
1625
|
+
label: source-point;
|
|
1626
|
+
|
|
1627
|
+
cursor: pointer;
|
|
1628
|
+
stroke-opacity: 0.8;
|
|
1629
|
+
|
|
1630
|
+
&:hover {
|
|
1631
|
+
stroke-opacity: 1;
|
|
1632
|
+
}
|
|
1633
|
+
`;function c3(t,e,n,r,o,i){var a,s,l;let c=t.select(`.${rp}`);if(e){let u=j(e.properties,r.pointId),f=n.find(h=>e.isCluster?h.id===e.id:u&&j(h.properties,r.pointId)===u),d=o((f??e).geometry.coordinates);if(d){let h=((a=f?.dx)!==null&&a!==void 0?a:0)/i,p=((s=f?.dy)!==null&&s!==void 0?s:0)/i;t.attr("transform",`translate(${d[0]+h},${d[1]+p})`)}c.classed("active",!!f).attr("d",f?.path||null).style("fill","transparent").style("stroke-width",1).style("stroke",(l=f||e)===null||l===void 0?void 0:l.color).style("transform",`scale(${1.25/i})`)}else c.classed("active",!1)}function u3(t){var e;let{config:n,datamodel:r}=t,o=((e=r.data)===null||e===void 0?void 0:e.links)||[];t._flowParticles=[],t._sourcePoints=[],!(!o||o.length===0)&&o.forEach((i,a)=>{var s,l;let c,u,f,d;if(n.sourceLongitude&&n.sourceLatitude)c=z(i,n.sourceLongitude),u=z(i,n.sourceLatitude);else{let L=(s=n.linkSource)===null||s===void 0?void 0:s.call(n,i);if(typeof L=="object"&&L!==null)c=z(L,n.longitude),u=z(L,n.latitude);else return}if(n.targetLongitude&&n.targetLatitude)f=z(i,n.targetLongitude),d=z(i,n.targetLatitude);else{let L=(l=n.linkTarget)===null||l===void 0?void 0:l.call(n,i);if(typeof L=="object"&&L!==null)f=z(L,n.longitude),d=z(L,n.latitude);else return}if(!tt(c)||!tt(u)||!tt(f)||!tt(d))return;let h=t._projection([c,u]);if(h){let L={lat:u,lon:c,x:h[0],y:h[1],radius:z(i,n.sourcePointRadius),color:K(i,n.sourcePointColor,a),flowData:i};t._sourcePoints.push(L)}let p=t._projection([c,u]),g=t._projection([f,d]);if(!p||!g)return;let m=vv(p,g),x=document.createElementNS("http://www.w3.org/2000/svg","path");x.setAttribute("d",m);let y=x.getTotalLength(),_=Math.sqrt(Math.pow(d-u,2)+Math.pow(f-c,2)),v=Math.max(1,Math.round(_*z(i,n.flowParticleDensity))),b=z(i,n.flowParticleSpeed),w=z(i,n.flowParticleRadius),A=K(i,n.flowParticleColor,a);for(let L=0;L<v;L+=1){let E=L/v,I=x.getPointAtLength(E*y),D={x:I.x,y:I.y,velocity:b,radius:w,color:A,progress:E,arcPath:m,pathLength:y,id:`${j(i,n.linkId,a)||a}-${L}`,flowData:void 0};t._flowParticles.push(D)}})}function f3(t){if(t._flowParticles.length===0)return;let e=t._currentZoomLevel||1;t._flowParticles.forEach(n=>{if(n.progress+=n.velocity*.01,n.progress>1&&(n.progress=0),n.arcPath&&typeof n.pathLength=="number"){let r=document.createElementNS("http://www.w3.org/2000/svg","path");r.setAttribute("d",n.arcPath);let o=r.getPointAtLength(n.progress*n.pathLength);n.x=o.x,n.y=o.y}}),t._flowParticlesGroup.selectAll(`.${_u}`).attr("cx",(n,r)=>{var o;return((o=t._flowParticles[r])===null||o===void 0?void 0:o.x)||0}).attr("cy",(n,r)=>{var o;return((o=t._flowParticles[r])===null||o===void 0?void 0:o.y)||0}).attr("r",(n,r)=>{var o;return(((o=t._flowParticles[r])===null||o===void 0?void 0:o.radius)||1)/e})}var XC=22,op=class t extends Te{constructor(e,n){super(),this._defaultConfig=YG,this.config=this._defaultConfig,this.datamodel=new pv,this._firstRender=!0,this._isResizing=!1,this._initialScale=void 0,this._currentZoomLevel=void 0,this._transform=hn,this._path=Eb(),this._isZooming=!1,this._clusterIndex=null,this._expandedCluster=null,this._collapsedCluster=null,this._collapsedClusterPointIds=null,this._prevZoomToLocation=void 0,this._eventInitiatedByComponent=!1,this._zoomBehavior=xs(),this._backgroundRect=this.g.append("rect").attr("class",GC),this._featuresGroup=this.g.append("g").attr("class",FC),this._areaLabelsGroup=this.g.append("g").attr("class",gu),this._linksGroup=this.g.append("g").attr("class",jC),this._clusterBackgroundGroup=this.g.append("g").attr("class",yu),this._flowParticlesGroup=this.g.append("g").attr("class",YC),this._pointsGroup=this.g.append("g").attr("class",WC),this._pointSelectionRing=this._pointsGroup.append("g").attr("class",HC).call(r=>r.append("path").attr("class",rp)),this._sourcePointsGroup=this.g.append("g").attr("class",UC),this._selectedPoint=null,this._flowParticles=[],this._sourcePoints=[],this._animationId=null,this.events={[t.selectors.point]:{},[t.selectors.feature]:{}},this._zoomBehavior.on("zoom",this._onZoom.bind(this)).on("end",this._onZoomEnd.bind(this)),e&&this.setConfig(e),n&&this.setData(n),this.g.append("defs").append("filter").attr("id","heatmapFilter").html(`
|
|
1634
|
+
<feGaussianBlur in="SourceGraphic" stdDeviation="${this.config.heatmapModeBlurStdDeviation}" color-interpolation-filters="sRGB" result="blur"></feGaussianBlur>
|
|
1635
|
+
<feColorMatrix class="blurValues" in="blur" mode="matrix" values="1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 20 -4"></feColorMatrix>
|
|
1636
|
+
`)}setData(e){var n;let{config:r}=this;if(this.datamodel.pointId=r.pointId,this.datamodel.linkSource=r.linkSource,this.datamodel.linkTarget=r.linkTarget,this.datamodel.data=e,this._resetExpandedCluster(),r.clustering&&(!((n=e.points)===null||n===void 0)&&n.length)){let o=e.points.filter(s=>{let l=z(s,r.latitude),c=z(s,r.longitude);return tt(l)&&tt(c)}),i=this.config.zoomExtent,a=Array.isArray(i)?Math.min(i[1],XC):16;this._clusterIndex=n3(o,this.config,a)}else this._clusterIndex=null;this._firstRender=this._firstRender||r.mapFitToPoints}setConfig(e){var n;super.setConfig(e);let r=(n=this.config.projection)!==null&&n!==void 0?n:Ag.Kavrayskiy7();this._projection&&r.scale(this._projection.scale()).translate(this._projection.translate()),this._projection=r}_render(e){let{config:n}=this,r=tt(e)?e:n.duration;if(this._renderBackground(),this._renderMap(r),this._renderAreaLabels(r),this._renderGroups(r),this._renderLinks(r),this._renderClusterBackground(r),this._renderPoints(r),n.enableFlowAnimation?(this._initFlowFeatures(),this._renderSourcePoints(r),this._renderFlowParticles(r),this._startFlowAnimation()):this._stopFlowAnimation(),r&&!n.disableZoom&&(this.g.on(".zoom",null),Il(()=>{this.g.call(this._zoomBehavior)},r)),this.g.classed("draggable",!n.disableZoom),this._firstRender=!1,n.zoomToLocation){if(!this._prevZoomToLocation||this._prevZoomToLocation.coordinates[0]!==n.zoomToLocation.coordinates[0]||this._prevZoomToLocation.coordinates[1]!==n.zoomToLocation.coordinates[1]||this._prevZoomToLocation.zoomLevel!==n.zoomToLocation.zoomLevel||this._prevZoomToLocation.expandCluster!==n.zoomToLocation.expandCluster){if(this._prevZoomToLocation=Object.assign({},n.zoomToLocation),n.zoomToLocation.expandCluster){let i=this._findClusterAtCoordinates(n.zoomToLocation.coordinates);i&&this._expandCluster(i)}this._zoomToLocation(n.zoomToLocation.coordinates,n.zoomToLocation.zoomLevel)}}else this._prevZoomToLocation=void 0;this._isZooming||this._runCollisionDetection()}_renderBackground(){s3(this._backgroundRect,this.bleed.left,this.bleed.top,()=>this._collapseExpandedCluster())}_renderGroups(e){let n=this._transform.toString();G(this._featuresGroup,e).attr("transform",n).attr("stroke-width",1/this._currentZoomLevel),G(this._areaLabelsGroup,e).attr("transform",n),G(this._linksGroup,e).attr("transform",n),G(this._clusterBackgroundGroup,e).attr("transform",n),G(this._pointsGroup,e).attr("transform",n),G(this._sourcePointsGroup,e).attr("transform",n),G(this._flowParticlesGroup,e).attr("transform",n)}_renderMap(e){var n,r,o,i,a;let{bleed:s,config:l,datamodel:c}=this;this.g.attr("transform",`translate(${s.left}, ${s.top})`);let u=l.topojson,f=l.mapFeatureName,d=(n=u?.objects)===null||n===void 0?void 0:n[f];if(!d)return;this._featureCollection=PC(u,d);let h=(o=(r=this._featureCollection)===null||r===void 0?void 0:r.features)!==null&&o!==void 0?o:[];if(this._firstRender){this._projection.fitExtent([[0,0],[this._width,this._height]],this._featureCollection),l.mapFitToPoints&&this._fitToPoints(),this._initialScale=this._projection.scale(),this._center=this._projection.translate();let y=l.zoomExtent;this._zoomBehavior.scaleExtent([y[0]*this._initialScale,y[1]*this._initialScale]),this._currentZoomLevel=l.zoomFactor||1,(a=(i=this.g.node())===null||i===void 0?void 0:i.parentElement)===null||a===void 0||a.style.setProperty("--vis-map-current-zoom-level",String(this._currentZoomLevel)),l.disableZoom||(this.g.call(this._zoomBehavior),this._applyZoom());let _=this._currentZoomLevel,v=this._projection.translate();this._transform=hn.translate(this._center[0]-v[0]*_,this._center[1]-v[1]*_).scale(_),this._prevWidth=this._width,this._prevHeight=this._height}(this._prevWidth!==this._width||this._prevHeight!==this._height)&&this._onResize(),this._path.projection(this._projection),c.areas.forEach(y=>{let _=h.find(v=>v.id.toString()===j(y,l.areaId).toString());_?_.data=y:this._firstRender&&console.warn(`Can't find feature by area code ${j(y,l.areaId)}`)});let g=this._featuresGroup.selectAll(`.${wv}`).data(h),x=g.enter().append("path").attr("class",wv).merge(g);G(x,e).attr("d",this._path).style("cursor",y=>y.data?j(y.data,l.areaCursor):null),x.style("fill",(y,_)=>y.data?K(y.data,l.areaColor,_):null),x.on("click",()=>{this._collapseExpandedCluster()}),g.exit().remove()}_renderAreaLabels(e){var n,r;let{config:o}=this;if(!o.areaLabel){this._areaLabelsGroup.selectAll("*").remove();return}let a=((r=(n=this._featureCollection)===null||n===void 0?void 0:n.features)!==null&&r!==void 0?r:[]).map(u=>{var f;let d=u.data||u.properties,h=d?j(d,o.areaLabel):null;if(!h)return null;let p=this._path.centroid(u);if(!p||p.some(x=>!isFinite(x)))return null;let g=this._path.bounds(u),m=(g[1][0]-g[0][0])*(g[1][1]-g[0][1]);return{feature:u,centroid:p,area:m,labelText:h,id:u.data?j(u.data,o.areaId):(f=u.id)===null||f===void 0?void 0:f.toString()}}).filter(Boolean).sort((u,f)=>f.area-u.area),s=this._areaLabelsGroup.selectAll(`.${gu}`).data(a,u=>u.id||""),c=s.enter().append("text").attr("class",gu).attr("transform",u=>`translate(${u.centroid[0]},${u.centroid[1]})`).style("opacity",0).style("pointer-events","none").merge(s);c.text(u=>u.labelText).attr("transform",u=>`translate(${u.centroid[0]},${u.centroid[1]})`).style("font-size",`calc(var(${jt.mapPointLabelFontSize}) / ${this._currentZoomLevel})`).style("text-anchor","middle").style("dominant-baseline","middle"),G(s.exit(),e).style("opacity",0).remove(),this._isZooming||G(c,e).style("opacity",1)}_renderClusterBackground(e){let{config:n}=this,r=this._currentZoomLevel||1;if(this._clusterBackgroundGroup.selectAll("circle").remove(),this._expandedCluster&&n.clusterBackground){let o=this._expandedCluster.cluster,i=this._projection(o.geometry.coordinates),s=o3(this._expandedCluster)/r;this._clusterBackgroundGroup.append("circle").attr("class",VC).attr("cx",i[0]).attr("cy",i[1]).attr("r",0).style("fill",`var(${jt.mapClusterExpandedBackgroundFillColor})`).style("opacity",0).style("cursor","pointer").on("click",()=>{this._collapseExpandedCluster()}).transition().duration(e).attr("r",s).style("opacity",.7)}}_renderLinks(e){let{config:n,datamodel:r}=this,o=r.links,i=this._linksGroup.selectAll(`.${Sv}`).data(o,(s,l)=>j(s,n.linkId,l)),a=i.enter().append("path").attr("class",Sv).style("stroke-width",0);G(a.merge(i),e).attr("d",s=>{let l=this._projection(Jh(s.source,n.longitude,n.latitude)),c=this._projection(Jh(s.target,n.longitude,n.latitude));return vv(l,c)}).style("stroke-width",s=>z(s,n.linkWidth)/this._currentZoomLevel).style("cursor",s=>j(s,n.linkCursor)).style("stroke",(s,l)=>K(s,n.linkColor,l)),i.exit().remove()}_shouldFilterPointOrCluster(e,n){let{config:r}=this;if(e.properties.cluster){let i=e.properties.clusterId;return this._clusterIndex.getLeaves(i,1/0).some(s=>n.has(j(s.properties,r.pointId)))}let o=j(e.properties,r.pointId);return n.has(o)}_getPointData(){let{config:e,datamodel:n}=this;if(!e.clustering||!this._clusterIndex)return n.points.map((s,l)=>{let c=this._projection(Jh(s,e.longitude,e.latitude)),u=z(s,e.pointRadius),f=j(s,e.pointShape)||Bt.Circle,d=yv(s,e.colorMap),h=K(s,e.pointColor,l);return{geometry:{type:"Point",coordinates:Jh(s,e.longitude,e.latitude)},bbox:{x1:c[0]-u,y1:c[1]-u,x2:c[0]+u,y2:c[1]+u},radius:u,path:Ys({x:0,y:0},u,f),color:h,id:j(s,e.pointId,l),properties:s,donutData:d,isCluster:!1,_zIndex:0}});let r=[-180,-90,180,90],o=this._currentZoomLevel||1,i=Math.max(0,Math.min(Math.round(o),XC)),a=r3(this._clusterIndex,r,i);if(this._expandedCluster){let s=this._expandedCluster.cluster.properties.clusterId;a=a.filter(c=>{let u=c.properties;return!(u.cluster&&u.clusterId===s)});let l=new Set(this._expandedCluster.points.map(c=>c.id.toString()));a=a.filter(c=>!this._shouldFilterPointOrCluster(_v(c,0,this._projection,this.config,this._currentZoomLevel||1),l)),a=a.concat(this._expandedCluster.points)}if(this._collapsedCluster){let s=this._collapsedCluster.properties.clusterId;a.some(c=>{let u=c.properties;return u.cluster&&u.clusterId===s})?(this._collapsedCluster=null,this._collapsedClusterPointIds=null):(a=a.filter(c=>!this._shouldFilterPointOrCluster(_v(c,0,this._projection,this.config,this._currentZoomLevel||1),this._collapsedClusterPointIds)),a.push(this._collapsedCluster))}return a.map((s,l)=>_v(s,l,this._projection,this.config,this._currentZoomLevel||1))}_renderPoints(e){let{config:n}=this,r=this._getPointData(),o=this._currentZoomLevel||1;this._expandedCluster&&n.clusterBackground&&r.forEach(f=>{let d=f;d._zIndex=d.expandedClusterPoint?2:0});let i=this._pointsGroup.selectAll(`.${xu}`).data(r,(f,d)=>{var h,p;return(p=(h=f.id)===null||h===void 0?void 0:h.toString())!==null&&p!==void 0?p:`point-${d}`}),a=i.enter().append("g").attr("class",xu).attr("transform",f=>{var d,h;let p=this._projection(f.geometry.coordinates),g=f,m=((d=g.dx)!==null&&d!==void 0?d:0)/o,x=((h=g.dy)!==null&&h!==void 0?h:0)/o;return`translate(${p[0]+m},${p[1]+x})`}).style("opacity",1e-6);a.append("path").attr("class",kv).attr("d",f=>{let d=f.radius/o,h=j(f.properties,n.pointShape)||Bt.Circle;return Ys({x:0,y:0},d,h)}).style("fill",f=>(j(f.properties,n.pointShape)||Bt.Circle)===Bt.Ring?"none":f.color).style("stroke",f=>f.color).style("stroke-width",f=>((j(f.properties,n.pointShape)||Bt.Circle)===Bt.Ring?z(f.properties,n.pointRingWidth):z(f.properties,n.pointStrokeWidth))/o),a.append("g").attr("class",f=>f.isCluster?np:ep).attr("data-point-id",(f,d)=>j(f.properties,n.pointId,d)).each(function(f){f.isCluster&&f.donutData.length>0&&U(this).append("circle").attr("class",yu).attr("r",0)}),a.append("path").attr("class",bv).attr("d","M0,0").style("display",f=>j(f.properties,n.pointShape)===Bt.Ring?null:"none"),a.append("text").attr("class",tp).attr("dy","0.32em").style("opacity",0),a.append("text").attr("class",vu).style("opacity",0);let l=a.merge(i);G(l,e).attr("transform",f=>{var d,h;let p=this._projection(f.geometry.coordinates),g=f,m=((d=g.dx)!==null&&d!==void 0?d:0)/o,x=((h=g.dy)!==null&&h!==void 0?h:0)/o;return`translate(${p[0]+m},${p[1]+x})`}).style("cursor",f=>{var d;let h=f;return h.expandedClusterPoint?(d=j(h.properties,n.pointCursor))!==null&&d!==void 0?d:"default":f.isCluster?"pointer":j(f.properties,n.pointCursor)}).style("opacity",1),l.on("click",(f,d)=>{this._onPointClick(d,f)}),l.selectAll(`.${ep}, .${np}`).each(function(f){let d=U(this),h=j(f.properties,n.pointShape),p=h===Bt.Ring,g=h===Bt.Circle||p||f.isCluster||!h;if(f.isCluster&&f.donutData.length>0){let m=f.radius/o,x=d.select(`.${yu}`);x.empty()?d.insert("circle",":first-child").attr("class",yu).attr("r",m):x.attr("r",m)}if(f.donutData.length>0){let m=(g?f.radius:0)/o,x=f.isCluster?2/o:g?f.radius/o:0,y=.5/o;a3(d,f.donutData,m,x,y,.05)}else d.selectAll("*").remove();d.attr("class",f.isCluster?np:ep)}),G(l.select(`.${kv}`),e).attr("d",f=>{let d=f.radius/o,h=j(f.properties,n.pointShape)||Bt.Circle;return Ys({x:0,y:0},d,h)}).style("fill",f=>{let p=(j(f.properties,n.pointShape)||Bt.Circle)===Bt.Ring,g=f.donutData.length>0,m=f;return m.expandedClusterPoint?m.clusterColor||m.expandedClusterPoint.color:p?"none":g&&f.isCluster?"transparent":f.color}).style("stroke",f=>{let d=f;return d.expandedClusterPoint?d.clusterColor||d.expandedClusterPoint.color:f.color}).style("stroke-width",f=>((j(f.properties,n.pointShape)||Bt.Circle)===Bt.Ring?z(f.properties,n.pointRingWidth):z(f.properties,n.pointStrokeWidth))/o),G(l.select(`.${bv}`),e).attr("d",f=>{if(j(f.properties,n.pointShape)!==Bt.Ring)return"";let h=f.radius/o;return Ys({x:0,y:0},h,Bt.Circle)}).style("display",f=>j(f.properties,n.pointShape)===Bt.Ring?null:"none");let c=l.select(`.${tp}`);c.text(f=>{var d,h;return f.isCluster?(d=j(f.properties,n.clusterLabel))!==null&&d!==void 0?d:"":(h=j(f.properties,n.pointLabel))!==null&&h!==void 0?h:""}).style("font-size",f=>{if(n.pointLabelPosition===Ki.Bottom)return`calc(var(${jt.mapPointLabelFontSize}) / ${o})`;let d=f.isCluster?f.radius/o:z(f.properties,n.pointRadius,0)/o,p=(f.isCluster?j(f.properties,n.clusterLabel)||"":j(f.properties,n.pointLabel)||"").length,g=d/Math.pow(p,.4);return mt(g,g,16)}).attr("y",f=>f.donutData.length>0||n.pointLabelPosition===Ki.Center?null:f.isCluster?f.radius/o:z(f.properties,n.pointRadius,0)/o).attr("dy",f=>f.donutData.length>0||n.pointLabelPosition===Ki.Center?"0.32em":"1em"),G(c,e).style("fill",(f,d)=>{var h;if(f.donutData.length>0)return f.isCluster?`var(${jt.mapPointLabelTextColorDark})`:`var(${jt.mapPointLabelTextColorLight})`;{if(n.pointLabelColor){let x=K(f.properties,n.pointLabelColor,d);if(x)return x}let p=K(f.properties,n.pointColor,d),g=(h=Ut(Ei(p)?On(p,this.element):p))===null||h===void 0?void 0:h.hex();return g?zn(g)>n.pointLabelTextBrightnessRatio?`var(${jt.mapPointLabelTextColorDark})`:`var(${jt.mapPointLabelTextColorLight})`:null}}).style("opacity",1).style("pointer-events","none").attr("visibility",f=>(f.isCluster?!!j(f.properties,n.clusterLabel):!!j(f.properties,n.pointLabel))?null:"hidden");let u=l.select(`.${vu}`);u.attr("visibility",f=>f.expandedClusterPoint?"hidden":null).text(f=>{var d,h;let p=f.isCluster?(d=j(f.properties,n.clusterBottomLabel))!==null&&d!==void 0?d:"":(h=j(f.properties,n.pointBottomLabel))!==null&&h!==void 0?h:"";return p_(p,15)}).attr("y",f=>(f.isCluster?f.radius/this._currentZoomLevel:z(f.properties,n.pointRadius)/this._currentZoomLevel)+10/this._currentZoomLevel).attr("dy","0.32em").style("font-size",`calc(var(${jt.mapPointBottomLabelFontSize}) / ${this._currentZoomLevel})`),G(u,e).style("opacity",f=>f.expandedClusterPoint?0:1),this._expandedCluster&&n.clusterBackground&&this._pointsGroup.selectAll(`.${xu}`).sort((f,d)=>f._zIndex-d._zIndex),i.exit().remove(),this._pointsGroup.style("filter",n.heatmapMode&&this._currentZoomLevel<n.heatmapModeZoomLevelThreshold?"url(#heatmapFilter)":null),this._pointsGroup.selectAll(`.${tp}`).style("display",n.heatmapMode&&this._currentZoomLevel<n.heatmapModeZoomLevelThreshold?"none":null),this._pointsGroup.selectAll(`.${vu}`).style("display",n.heatmapMode&&this._currentZoomLevel<n.heatmapModeZoomLevelThreshold?"none":null),c3(this._pointSelectionRing,this._selectedPoint,r,this.config,this._projection,o),this._setUpComponentEventsThrottled(),this._setCustomAttributesThrottled()}_fitToPoints(e,n=.1){var r,o,i,a;let{config:s,datamodel:l}=this,c=e||l.points;if(c.length===0&&!(!((o=(r=l.data)===null||r===void 0?void 0:r.links)===null||o===void 0)&&o.length))return;let u=c.map(d=>[z(d,h=>z(h,s.longitude)),z(d,h=>z(h,s.latitude))]).filter(([d,h])=>tt(d)&&tt(h)),f=(a=(i=l.data)===null||i===void 0?void 0:i.links)!==null&&a!==void 0?a:[];for(let d=0;d<f.length;d+=1){let h=f[d],p=z(h,s.sourceLongitude,d),g=z(h,s.sourceLatitude,d),m=z(h,s.targetLongitude,d),x=z(h,s.targetLatitude,d);tt(p)&&tt(g)&&u.push([p,g]),tt(m)&&tt(x)&&u.push([m,x])}if(u.length!==0){if(u.length===1)this._projection.center(u[0]),this._projection.translate([this._width/2,this._height/2]);else{let d={type:"FeatureCollection",features:[{type:"Feature",properties:{},geometry:{type:"MultiPoint",coordinates:u}}]};this._projection.fitExtent([[this._width*n,this._height*n],[this._width*(1-n),this._height*(1-n)]],d);let h=s.zoomExtent[1]*this._initialScale,p=this._projection.scale();if(p>h){let g=this._projection.translate(),m=h/p;this._projection.scale(h),this._projection.translate([this._width/2-(this._width/2-g[0])*m,this._height/2-(this._height/2-g[1])*m])}}this._center=this._projection.translate()}}_applyZoom(){var e;let n=(e=this._center)!==null&&e!==void 0?e:this._projection.translate(),r=this._initialScale*this._currentZoomLevel;this._zoomBehavior.extent([[0,0],[this._width,this._height]]),this.g.call(this._zoomBehavior.transform,hn.translate(n[0],n[1]).scale(r)),this._isZooming=!0,this._onZoomEnd()}_onResize(){this._isResizing=!0;let e=this._projection.translate();if(this._projection.fitExtent([[0,0],[this._width,this._height]],this._featureCollection),this._initialScale=this._projection.scale(),this._selectedPoint){let n=this._selectedPoint.geometry.coordinates,r=this._projection(n),o=this._projection.translate();if(r){let i=this._currentZoomLevel;this._center=[this._width/2-(r[0]-o[0])*i,this._height/2-(r[1]-o[1])*i]}}else this._center=[this._projection.translate()[0]*this._center[0]/e[0],this._projection.translate()[1]*this._center[1]/e[1]];this._applyZoom(),this._isResizing=!1,this._prevWidth=this._width,this._prevHeight=this._height}_onZoom(e){var n,r,o,i;if(this._firstRender){this._currentZoomLevel=e?.transform.k/this._initialScale||1,(r=(n=this.g.node())===null||n===void 0?void 0:n.parentElement)===null||r===void 0||r.style.setProperty("--vis-map-current-zoom-level",String(this._currentZoomLevel));return}let a=!!e.sourceEvent,s=!e?.sourceEvent&&!this._isResizing,l=this._isResizing&&!e?.sourceEvent;this._isZooming=!0,this._zoomEndTimeoutId&&clearTimeout(this._zoomEndTimeoutId),a&&!this._eventInitiatedByComponent&&(this._resetExpandedCluster(),this._collapsedCluster=null,this._collapsedClusterPointIds=null),window.cancelAnimationFrame(this._animFrameId),this._animFrameId=window.requestAnimationFrame(this._onZoomHandler.bind(this,e.transform,a,s,l)),a&&(this._center=[e.transform.x,e.transform.y]),this._currentZoomLevel=e?.transform.k/this._initialScale||1,(i=(o=this.g.node())===null||o===void 0?void 0:o.parentElement)===null||i===void 0||i.style.setProperty("--vis-map-current-zoom-level",String(this._currentZoomLevel)),this._onZoomEnd()}_onZoomEnd(){this._zoomEndTimeoutId&&clearTimeout(this._zoomEndTimeoutId),this._zoomEndTimeoutId=setTimeout(()=>{this._isZooming=!1,this._runCollisionDetection()},150)}_runCollisionDetection(){window.cancelAnimationFrame(this._collisionDetectionAnimFrameId),this._collisionDetectionAnimFrameId=window.requestAnimationFrame(()=>{let e=this.config.duration,n=this._areaLabelsGroup.selectAll(`.${gu}`);t3(n,e);let r=this._pointsGroup.selectAll(`.${xu} .${vu}`);e3(r,e)})}_onZoomHandler(e,n,r,o=!1){let i=e.k/this._initialScale||1,a=this._projection.translate();this._transform=hn.translate(e.x-a[0]*i,e.y-a[1]*i).scale(i);let s=r||o?this.config.zoomDuration:n?0:null;this._renderGroups(s),this._renderAreaLabels(s),this._renderLinks(s),this._renderClusterBackground(s),this._renderPoints(s),this._renderSourcePoints(s)}zoomIn(e=.5){this._isZooming||(this._resetExpandedCluster(),this.setZoom(this._currentZoomLevel+e))}zoomOut(e=.5){this._isZooming||(this._resetExpandedCluster(),this.setZoom(this._currentZoomLevel-e))}setZoom(e){var n,r;let{config:o}=this,i=mt(e,o.zoomExtent[0],o.zoomExtent[1]),a=this._initialScale*this._currentZoomLevel,s=this._initialScale*i;if(a>0&&isFinite(a)&&isFinite(s)){let l=s/a;this._center[0]=(this._width/2-this.bleed.left)*(1-l)+this._center[0]*l,this._center[1]=(this._height/2-this.bleed.top)*(1-l)+this._center[1]*l}this._currentZoomLevel=i,(r=(n=this.g.node())===null||n===void 0?void 0:n.parentElement)===null||r===void 0||r.style.setProperty("--vis-map-current-zoom-level",String(this._currentZoomLevel)),this._transform=hn.translate(this._center[0]*(1-this._currentZoomLevel),this._center[1]*(1-this._currentZoomLevel)).scale(this._currentZoomLevel),this._applyZoom()}fitView(){var e,n,r,o,i;let{config:a}=this;this._resetExpandedCluster(),a.mapFitToPoints?(this._fitToPoints(),this._initialScale=this._projection.scale(),this._currentZoomLevel=1,(n=(e=this.g.node())===null||e===void 0?void 0:e.parentElement)===null||n===void 0||n.style.setProperty("--vis-map-current-zoom-level","1"),this._center=this._projection.translate(),this._applyZoom()):(this._projection.fitExtent([[0,0],[this._width,this._height]],this._featureCollection),this._currentZoomLevel=((r=this._projection)===null||r===void 0?void 0:r.scale())/this._initialScale||1,(i=(o=this.g.node())===null||o===void 0?void 0:o.parentElement)===null||i===void 0||i.style.setProperty("--vis-map-current-zoom-level",String(this._currentZoomLevel)),this._center=this._projection.translate(),this._applyZoom())}_initFlowFeatures(){u3(this)}_renderSourcePoints(e){let{config:n}=this,r=this._sourcePointsGroup.selectAll(`.${Cv}`).data(this._sourcePoints,(i,a)=>`${i.flowData}-${a}`),o=r.enter().append("circle").attr("class",Cv).attr("cx",i=>i.x).attr("cy",i=>i.y).attr("r",i=>i.radius/this._currentZoomLevel).style("fill",i=>i.color).style("stroke",i=>i.color).style("stroke-width",0).style("opacity",0).on("click",(i,a)=>{var s;i.stopPropagation(),(s=n.onSourcePointClick)===null||s===void 0||s.call(n,a.flowData,a.x,a.y,i)}).on("mouseenter",(i,a)=>{var s;(s=n.onSourcePointMouseEnter)===null||s===void 0||s.call(n,a.flowData,a.x,a.y,i)}).on("mouseleave",(i,a)=>{var s;(s=n.onSourcePointMouseLeave)===null||s===void 0||s.call(n,a.flowData,i)});G(o.merge(r),e).attr("cx",i=>i.x).attr("cy",i=>i.y).attr("r",i=>i.radius/this._currentZoomLevel).style("opacity",1),r.exit().remove()}_renderFlowParticles(e){let n=this._flowParticlesGroup.selectAll(`.${_u}`).data(this._flowParticles,o=>o.id),r=n.enter().append("circle").attr("class",_u).attr("r",0).style("opacity",0);G(r.merge(n),e).attr("cx",o=>o.x).attr("cy",o=>o.y).attr("r",o=>o.radius/(this._currentZoomLevel||1)).style("fill",o=>o.color).style("opacity",.8),n.exit().remove()}_startFlowAnimation(){this._animationId||this._animateFlow()}_animateFlow(){this.config.enableFlowAnimation&&(this._animationId=requestAnimationFrame(()=>{this._updateFlowParticles(),this._animateFlow()}))}_stopFlowAnimation(){this._animationId&&(cancelAnimationFrame(this._animationId),this._animationId=null)}_updateFlowParticles(){f3({_flowParticles:this._flowParticles,_currentZoomLevel:this._currentZoomLevel,_flowParticlesGroup:this._flowParticlesGroup})}_onPointClick(e,n){var r;let{config:o}=this;if(n.stopPropagation(),!e.expandedClusterPoint&&e.isCluster&&e.properties.cluster){let a=this._currentZoomLevel||1,s=e.geometry.coordinates,l=o.zoomExtent,c=(r=l?.[1])!==null&&r!==void 0?r:12;if(o.clusterExpandOnClick){let u=zC(a,c);this._expandCluster(e),this._zoomToLocation(s,u)}else{let u=zC(a,c);this._zoomToLocation(s,u)}}}_findClusterAtCoordinates(e){let n=this._getPointData(),[r,o]=e,i=n.filter(l=>l.isCluster);if(i.length===0)return;let a,s=1/0;for(let l of i){let[c,u]=l.geometry.coordinates,f=Math.sqrt(Math.pow(c-r,2)+Math.pow(u-o,2));f<s&&(s=f,a=l)}return a}_expandCluster(e){let{config:n}=this;if(!e.clusterIndex){console.error("Cannot expand cluster - no clusterIndex!");return}this._collapsedCluster&&`cluster-${this._collapsedCluster.id}`===e.id&&(this._collapsedCluster=null,this._collapsedClusterPointIds=null);let r=1,o=e.properties.clusterId,i=e.clusterIndex.getLeaves(o,1/0),a=Array.isArray(n.zoomExtent)?Math.min(n.zoomExtent[1],XC):16,s=Math.min(this._currentZoomLevel||1,a),l=i.map(u=>({x:null,y:null,r:OC(u,n.pointRadius,s)+r}));pw(l);let c=i.map((u,f)=>{var d;let h=u.properties,p=z(h,n.pointRadius)||8,g=j(h,n.pointShape)||Bt.Circle,m=[],x=K(h,n.pointColor),y=yv(h,n.colorMap),_=y.length?Math.max(...y.map(w=>w.value)):0,v=y.find(w=>w.value===_)||y[0],b=(d=x??v?.color)!==null&&d!==void 0?d:e.color;return{geometry:{type:"Point",coordinates:e.geometry.coordinates},bbox:{x1:0,y1:0,x2:0,y2:0},radius:p,path:Ys({x:0,y:0},p,g),color:b,id:j(h,n.pointId,f)||`${o}-${f}`,properties:h,donutData:m,isCluster:!1,_zIndex:1,expandedClusterPoint:e,clusterColor:b,dx:l[f].x,dy:l[f].y,packedRadius:l[f].r}});return this._resetExpandedCluster(),this._expandedCluster={cluster:e,points:c},this._renderClusterBackground(n.duration/2),this._renderPoints(n.duration/2),this._setUpComponentEventsThrottled(),this._setCustomAttributesThrottled(),i.map(u=>u.properties)}_zoomToLocation(e,n){let{config:r}=this,o=mt(n,r.zoomExtent[0],r.zoomExtent[1]),i=this._projection(e);if(!i)return;let a=this._width/2,s=this._height/2,l=this._initialScale*o,c=this._projection.translate(),u=a+(c[0]-i[0])*(l/this._initialScale),f=s+(c[1]-i[1])*(l/this._initialScale),d=hn.translate(u,f).scale(l);this._currentZoomLevel=o,this._center=[u,f],this._eventInitiatedByComponent=!0,this.g.transition().duration(r.zoomDuration).ease(Ol).call(this._zoomBehavior.transform,d).on("end",()=>{this._eventInitiatedByComponent=!1})}_collapseExpandedCluster(){this._expandedCluster&&(this._resetExpandedCluster(),this._renderClusterBackground(this.config.duration),this._renderPoints(this.config.duration))}_resetExpandedCluster(){var e;if(this._expandedCluster){let n=this._expandedCluster.cluster,r=new Set(this._expandedCluster.points.map(i=>j(i.properties,this.config.pointId))),o={type:"Feature",id:n.properties.clusterId,properties:Object.assign(Object.assign({},n.properties),{clusterIndex:n.clusterIndex}),geometry:n.geometry};this._collapsedCluster=o,this._collapsedClusterPointIds=r,(e=this._expandedCluster.points)===null||e===void 0||e.forEach(i=>{let a=i;delete a.expandedClusterPoint,delete a.clusterColor,delete a.dx,delete a.dy}),this._expandedCluster=null}}selectPointById(e){let{config:n}=this,o=this._getPointData().find(i=>j(i.properties,n.pointId)===e);o?(this._selectedPoint=o,this._renderPoints(n.duration)):console.warn(`Unovis | TopoJSON Map: Point with id ${e} not found`)}getSelectedPointId(){var e;return(e=this._selectedPoint)===null||e===void 0?void 0:e.id}unselectPoint(){this._selectedPoint=null,this._renderPoints(this.config.duration)}destroy(){window.cancelAnimationFrame(this._animFrameId),this._stopFlowAnimation(),window.cancelAnimationFrame(this._collisionDetectionAnimFrameId),this._zoomEndTimeoutId&&clearTimeout(this._zoomEndTimeoutId)}};op.selectors=qC;var d3={components:[],container:void 0,followCursor:!0,allowHover:!1,horizontalPlacement:q.Auto,horizontalShift:0,verticalPlacement:q.Top,verticalShift:0,attributes:{},triggers:{},className:void 0,showDelay:void 0,hideDelay:void 0};var QC={};Wt(QC,{hidden:()=>sp,nonInteractive:()=>KC,positionFixed:()=>ZC,root:()=>ip,show:()=>ap,tooltip:()=>Uet,variables:()=>qet});var ip=M`
|
|
1637
|
+
label: tooltip;
|
|
1638
|
+
display: inline-block;
|
|
1639
|
+
left: 0;
|
|
1640
|
+
bottom: 0;
|
|
1641
|
+
min-width: max-content;
|
|
1642
|
+
position: absolute;
|
|
1643
|
+
opacity: 0;
|
|
1644
|
+
transition: opacity;
|
|
1645
|
+
transition-duration: var(--vis-tooltip-transition-duration);
|
|
1646
|
+
z-index: 999999;
|
|
1647
|
+
padding: var(--vis-tooltip-padding);
|
|
1648
|
+
color: var(--vis-tooltip-text-color);
|
|
1649
|
+
border-radius: var(--vis-tooltip-border-radius);
|
|
1650
|
+
box-shadow: var(--vis-tooltip-box-shadow);
|
|
1651
|
+
border: solid 1px var(--vis-tooltip-border-color);
|
|
1652
|
+
background-color: var(--vis-tooltip-background-color);
|
|
1653
|
+
backdrop-filter: var(--vis-tooltip-backdrop-filter);
|
|
1654
|
+
`,Uet=ip,qet=Pt`
|
|
1655
|
+
:root {
|
|
1656
|
+
--vis-tooltip-background-color: rgba(255, 255, 255, 0.95);
|
|
1657
|
+
--vis-tooltip-border-color: #e5e9f7;
|
|
1658
|
+
--vis-tooltip-text-color: #000;
|
|
1659
|
+
--vis-tooltip-shadow-color: rgba(172, 179, 184, 0.35);
|
|
1660
|
+
--vis-tooltip-backdrop-filter: none;
|
|
1661
|
+
--vis-tooltip-padding: 10px 15px;
|
|
1662
|
+
--vis-tooltip-border-radius: 5px;
|
|
1663
|
+
--vis-tooltip-transition-duration: 300ms;
|
|
1664
|
+
--vis-tooltip-box-shadow: none;
|
|
1665
|
+
|
|
1666
|
+
--vis-dark-tooltip-background-color: rgba(30,30,30, 0.95);
|
|
1667
|
+
--vis-dark-tooltip-text-color: #e5e9f7;
|
|
1668
|
+
--vis-dark-tooltip-border-color: var(--vis-color-grey);
|
|
1669
|
+
--vis-dark-tooltip-shadow-color: rgba(0,0,0, 0.95);
|
|
1670
|
+
}
|
|
1671
|
+
|
|
1672
|
+
${Yt} ${`.${ip}`} {
|
|
1673
|
+
--vis-tooltip-background-color: var(--vis-dark-tooltip-background-color);
|
|
1674
|
+
--vis-tooltip-text-color: var(--vis-dark-tooltip-text-color);
|
|
1675
|
+
--vis-tooltip-border-color: var(--vis-dark-tooltip-border-color);
|
|
1676
|
+
--vis-tooltip-shadow-color: var(--vis-dark-tooltip-shadow-color);
|
|
1677
|
+
}
|
|
1678
|
+
|
|
1679
|
+
${Yt} {
|
|
1680
|
+
--vis-tooltip-background-color: rgba(30,30,30, 0.95);
|
|
1681
|
+
--vis-tooltip-text-color: #e5e9f7;
|
|
1682
|
+
--vis-tooltip-border-color: var(--vis-color-grey);
|
|
1683
|
+
--vis-tooltip-shadow-color: rgba(0,0,0, 0.95);
|
|
1684
|
+
}
|
|
1685
|
+
`,ZC=M`
|
|
1686
|
+
bottom: unset;
|
|
1687
|
+
position: fixed;
|
|
1688
|
+
`,ap=M`
|
|
1689
|
+
opacity: 1;
|
|
1690
|
+
`,sp=M`
|
|
1691
|
+
display: none;
|
|
1692
|
+
`,KC=M`
|
|
1693
|
+
label: non-interactive;
|
|
1694
|
+
pointer-events: none;
|
|
1695
|
+
user-select: none;
|
|
1696
|
+
`;var lp=class{constructor(e={}){this._defaultConfig=d3,this.config=this._defaultConfig,this._setUpEventsThrottled=zr(this._setUpEvents,500),this._setContainerPositionThrottled=zr(this._setContainerPosition,500),this._isShown=!1,this.element=document.createElement("div"),this.div=U(this.element).attr("class",ip).classed(ap,!1).classed(sp,!0),this.setConfig(e),this.components=this.config.components,this._mutationObserver=new MutationObserver(()=>{this._isShown&&(!this.config.followCursor&&this._hoveredElement?this.placeByElement(this._hoveredElement):this._position&&this.place({x:this._position[0],y:this._position[1]}))}),this._mutationObserver.observe(this.div.node(),{childList:!0,subtree:!0})}setConfig(e){var n;this.prevConfig=this.config,this.config=He(this._defaultConfig,e),this.prevConfig.horizontalPlacement!==this.config.horizontalPlacement&&this.overrideHorizontalPlacement(void 0),this.config.container&&this.config.container!==((n=this.prevConfig)===null||n===void 0?void 0:n.container)&&this.setContainer(this.config.container),this._setUpAttributes()}setContainer(e){var n;(n=this.element.parentNode)===null||n===void 0||n.removeChild(this.element),this._container=e,this._container.appendChild(this.element),this._setContainerPositionThrottled()}getContainer(){return this._container}hasContainer(){return!!this._container&&this._container.isConnected}setComponents(e){this.components=e}update(){this._container&&this._setUpEventsThrottled()}show(e,n){this.render(e),this.place(n)}_hide(){this.div.classed(ap,!1).on("transitionend",()=>{this.div.classed(sp,!this._isShown)}),this._isShown=!1}hide(){window.clearTimeout(this._showDelayTimeoutId),this.config.hideDelay?(window.clearTimeout(this._hideDelayTimeoutId),this._hideDelayTimeoutId=setTimeout(()=>this._hide(),this.config.hideDelay)):this._hide()}_display(){window.clearTimeout(this._hideDelayTimeoutId),this.div.classed(sp,!1).classed(ap,!0),this._isShown=!0}display(){this._isShown||(this.config.showDelay?(window.clearTimeout(this._showDelayTimeoutId),this._showDelayTimeoutId=setTimeout(()=>{this._display(),this.place({x:this._position[0],y:this._position[1]})},this.config.showDelay)):this._display())}place(e){if(this._position=[e.x,e.y],!this.hasContainer()){console.warn("Unovis | Tooltip: Container was not set or is not initialized yet");return}let{config:n}=this,r=this.element.offsetWidth,o=this.element.offsetHeight,i=this._overriddenHorizontalPlacement||(n.horizontalPlacement===q.Auto?q.Center:n.horizontalPlacement),a=n.verticalPlacement===q.Auto?e.y-o<0?q.Bottom:q.Top:n.verticalPlacement,s=5,l=i===q.Left?-r-s-n.horizontalShift:i===q.Center?-r/2:s+n.horizontalShift,c=a===q.Bottom?s+n.verticalShift:a===q.Center?-o/2:-s-n.verticalShift-o,[u,f]=this._constraintPosToContainer(e.x+l,e.y+c,r,o);this._applyPosition(u,f,o)}placeByElement(e){let{config:n}=this;this._hoveredElement=e;let r=5,o=this.element.offsetWidth,i=this.element.offsetHeight,a=this.isContainerBody(),s=a?window.innerWidth:this._container.scrollWidth,l=e.getBoundingClientRect(),c=a?[l.x,l.y]:oe({clientX:l.x,clientY:l.y,pageX:l.x,pageY:l.y},this._container),u=this._overriddenHorizontalPlacement||(n.horizontalPlacement===q.Auto?c[0]-o<0?q.Right:c[0]+o>s?q.Left:q.Center:n.horizontalPlacement),f=0;switch(u){case q.Left:f=-o-r-n.horizontalShift;break;case q.Right:f=l.width+r+n.horizontalShift;break;case q.Center:default:f=(-o+l.width)/2;break}let d=n.verticalPlacement===q.Auto?u!==q.Center?q.Center:c[1]-i<0?q.Bottom:q.Top:n.verticalPlacement,h=-i;switch(d){case q.Center:h+=(i+l.height)/2;break;case q.Bottom:h+=i+l.height+r+n.verticalShift;break;case q.Top:default:h+=-r-n.verticalShift;break}let[p,g]=this._constraintPosToContainer(c[0]+f,c[1]+h,o,i);this._applyPosition(p,g,i)}isContainerBody(){return this._container===document.body}overrideHorizontalPlacement(e){this._overriddenHorizontalPlacement=e}render(e){var n;let{config:r,prevConfig:o}=this;e instanceof HTMLElement?this.div.select(":first-child").node()!==e&&this.div.html("").append(()=>e):e!=null&&e!==""&&this.div.html(e),this.div.classed((n=r.className)!==null&&n!==void 0?n:"",!!r.className).classed(KC,!r.allowHover),o?.className&&o.className!==r.className&&this.div.classed(o.className,!1),this.display()}_applyPosition(e,n,r){let o=this.isContainerBody(),i=o?window.innerHeight:this._container.scrollHeight;this.div.classed(ZC,o).style("top",o?`${n}px`:"unset").style("bottom",o?"unset":`${i-n-r}px`).style("left",`${e}px`)}_constraintPosToContainer(e,n,r,o){let i=this.isContainerBody(),a=i?window.innerHeight:this._container.scrollHeight,s=i?window.innerWidth:this._container.scrollWidth,l=10,c=e>s-r-l,u=e<l,f=c?s-r-l:u?l:e,d=10,h=n>a-o-d,p=n<d,g=h?a-o-d:p?d:n;return[s<r?0:f,a<o?0:g]}_setContainerPosition(){var e;this._container!==document.body&&((e=getComputedStyle(this._container))===null||e===void 0?void 0:e.position)==="static"&&(this._container.style.position="relative")}_setUpEvents(){let{config:e}=this;this.components.forEach(n=>{let r=U(n.element);r.on("mousemove.tooltip",o=>{let{config:i}=this,a=o.composedPath&&o.composedPath()||o.path||[o.target];for(let s of Object.keys(i.triggers)){let l=i.triggers[s];if(!l)continue;let c=r.selectAll(`.${s}`).nodes();for(let u of a){if(u===r.node())break;if(u.classList.contains(s)){let f=c.indexOf(u),d=U(u).datum(),h=l(d,f,c),[p,g]=this.isContainerBody()?[o.clientX,o.clientY]:oe(o,this._container);h===null?this.hide():(this.render(h),i.followCursor?this.place({x:p,y:g}):this.placeByElement(u)),o.stopPropagation();return}}}this._isShown&&this.hide()}).on("mouseleave.tooltip",o=>{o.stopPropagation(),this.hide()})}),e.allowHover?this.div.on("mouseenter.tooltip",this._display.bind(this)).on("mouseleave.tooltip",this.hide.bind(this)):this.div.on("mouseenter.tooltip",null).on("mouseleave.tooltip",null)}_setUpAttributes(){let e=this.config.attributes;e&&Object.keys(e).forEach(n=>{this.div.attr(n,e[n])})}destroy(){var e;this._mutationObserver.disconnect(),window.clearTimeout(this._hideDelayTimeoutId),window.clearTimeout(this._showDelayTimeoutId),(e=this.div)===null||e===void 0||e.remove()}};lp.selectors=QC;var bu;(function(t){t.X="x",t.XY="xy"})(bu||(bu={}));var h3=Object.assign(Object.assign({},ie),{yStacked:void 0,baseline:null,duration:100,tooltip:void 0,template:(t,e,n,r)=>"",hideWhenFarFromPointer:!0,hideWhenFarFromPointerDistance:100,snapToData:!0,snapMode:bu.X,getCircles:void 0,color:void 0,strokeColor:void 0,strokeWidth:void 0,circleRadius:4,showHorizontalLine:!1,onCrosshairMove:void 0,forceShowAt:void 0,skipRangeCheck:!1,visibilityThreshold:.35});var r2={};Wt(r2,{circle:()=>n2,cssVarDefaults:()=>JC,line:()=>t2,lineHorizontal:()=>e2,root:()=>p3,variables:()=>Nr});var p3=M`
|
|
1697
|
+
label: crosshair-component;
|
|
1698
|
+
`,JC={"--vis-crosshair-line-stroke-color":"#888","--vis-crosshair-line-stroke-width":"1px","--vis-crosshair-line-stroke-opacity":"1","--vis-crosshair-line-stroke-dasharray":"none","--vis-crosshair-circle-stroke-color":"#fff","--vis-crosshair-circle-stroke-width":"1px","--vis-crosshair-circle-stroke-opacity":"0.75"},Nr=ze(JC);Be(JC,p3);var t2=M`
|
|
1699
|
+
stroke: var(${Nr.crosshairLineStrokeColor});
|
|
1700
|
+
stroke-width: var(${Nr.crosshairLineStrokeWidth});
|
|
1701
|
+
stroke-opacity: var(${Nr.crosshairLineStrokeOpacity});
|
|
1702
|
+
stroke-dasharray: var(${Nr.crosshairLineStrokeDasharray});
|
|
1703
|
+
pointer-events: none;
|
|
1704
|
+
`,e2=M`
|
|
1705
|
+
stroke: var(${Nr.crosshairLineStrokeColor});
|
|
1706
|
+
stroke-width: var(${Nr.crosshairLineStrokeWidth});
|
|
1707
|
+
stroke-opacity: var(${Nr.crosshairLineStrokeOpacity});
|
|
1708
|
+
stroke-dasharray: var(${Nr.crosshairLineStrokeDasharray});
|
|
1709
|
+
pointer-events: none;
|
|
1710
|
+
`,n2=M`
|
|
1711
|
+
stroke: var(${Nr.crosshairCircleStrokeColor});
|
|
1712
|
+
stroke-width: var(${Nr.crosshairCircleStrokeWidth});
|
|
1713
|
+
stroke-opacity: var(${Nr.crosshairCircleStrokeOpacity});
|
|
1714
|
+
pointer-events: none;
|
|
1715
|
+
`;var cp=class extends ae{constructor(e){super(),this.clippable=!0,this._defaultConfig=h3,this.config=this._defaultConfig,this._xPx=void 0,this._yPx=void 0,this._mouseEvent=void 0,this._animFrameId=null,this._accessors={x:void 0,y:void 0,yStacked:void 0,baseline:void 0},this._colorKeys=[],e&&this.setConfig(e),this.g.style("opacity",0),this.line=this.g.append("line").attr("class",t2),this.lineHorizontal=this.g.append("line").attr("class",e2).style("display","none")}set colorKeys(e){this._colorKeys=e}get colorKeys(){var e;return(e=this.config.colorKeys)!==null&&e!==void 0?e:this._colorKeys}set accessors(e){this._accessors=e}get accessors(){var e;let{config:n}=this,r=!!(n.x||n.y||n.yStacked),o=r?n.x:this._accessors.x,i=r?n.y:this._accessors.y,a=i?Ie(i)?i:[i]:void 0,s=r?n.yStacked:this._accessors.yStacked,l=(e=n.baseline)!==null&&e!==void 0?e:this._accessors.baseline;return{x:o,y:a,yStacked:s,baseline:l}}_isContainerInViewport(){var e;if(!(!((e=this.container)===null||e===void 0)&&e.node()))return!1;let n=this.container.node().getBoundingClientRect(),r=window.innerWidth||document.documentElement.clientWidth,o=window.innerHeight||document.documentElement.clientHeight,i=Math.max(0,Math.min(n.right,r)-Math.max(n.left,0)),a=Math.max(0,Math.min(n.bottom,o)-Math.max(n.top,0)),s=n.width*n.height,l=i*a;return s>0&&l/s>=this.config.visibilityThreshold}get bleed(){let{config:{circleRadius:e}}=this;return{top:e,left:e,right:e}}setContainer(e){this.container!==e&&(this.container=e,this.container.on("mousemove.crosshair",this._onMouseMove.bind(this)),this.container.on("mouseout.crosshair",this._onMouseOut.bind(this)),this.container.on("wheel.crosshair",this._onWheel.bind(this)))}_render(e){var n,r,o,i,a;let{config:s,datamodel:l}=this,c=tt(e)?e:s.duration,u=s.forceShowAt!==void 0,f=u?this.xScale(s.forceShowAt):this._xPx,d=this.xScale.invert(f),h=!((n=l.data)===null||n===void 0)&&n.length&&this.accessors.x?l.data.indexOf(Ru(l.data,d,this.accessors.x,$r.Left)):void 0,p,g,m;if(s.snapToData)if(!this.accessors.y&&!this.accessors.yStacked&&(!((r=l.data)===null||r===void 0)&&r.length)&&console.warn("Unovis | Crosshair: Y accessors have not been configured. Please check if they're present in the configuration object"),!(!((o=l.data)===null||o===void 0)&&o.length)&&this._mouseEvent&&console.warn("Unovis | Crosshair: No data to snap to. Make sure the data has been passed to the container or to the crosshair itself"),s.snapMode===bu.XY&&!u&&this._yPx!==void 0){let T=Z2(l.data,[this._xPx,this._yPx],this.xScale,this.yScale,this.accessors.x,this.accessors.y,this.accessors.yStacked,this.accessors.baseline);T&&(p=T.datum,g=T.index,m=T.distanceSq)}else p=Ru(l.data,d,this.accessors.x),g=l.data.indexOf(p);let x=this.xScale.range(),y=this.yScale.range(),_=s.snapToData&&p?mt(Math.round(this.xScale(z(p,this.accessors.x,g))),0,this._width):mt(f,x[0],x[1]),v=f>=x[0]&&f<=x[1],b=this._yPx>=Math.min(y[0],y[1])&&this._yPx<=Math.max(y[0],y[1]),w=s.skipRangeCheck?!!this._xPx:this._xPx?v&&b:v,A=m!==void 0?Math.sqrt(m):Math.abs(_-+f);s.hideWhenFarFromPointer&&A>=s.hideWhenFarFromPointerDistance&&(w=!1);let L=(i=s.tooltip)!==null&&i!==void 0?i:this.tooltip;if(w&&L&&this._isContainerInViewport()){let $=L.getContainer()||this.container.node(),T=L.isContainerBody(),S=this.accessors.x&&p!==void 0?z(p,this.accessors.x,g):void 0,k=S??d;if(u){let P=this.container.node().getBoundingClientRect(),N=(T?f+P.left:f)+this._containerMargin.left,R=this._height/2+(T?P.top:0),O=[N,R];this._showTooltip(p,k,O,h)}else if(this._mouseEvent){let P=T?[this._mouseEvent.clientX,this._mouseEvent.clientY]:oe(this._mouseEvent,$);this._showTooltip(p,k,P,h)}}else this._hideTooltip();if(this._mouseEvent&&((a=s.onCrosshairMove)===null||a===void 0||a.call(s,w?this.xScale.invert(this._xPx):void 0,p,g,this._mouseEvent),this._mouseEvent=void 0),G(this.g,c).style("opacity",w?1:0),!isFinite(f))return;let E=ge(s.getCircles)?s.getCircles(d,l.data,this.yScale,h):this.getCircleData(p,g);this.line.attr("y1",0).attr("y2",this._height),G(this.line,c,Dl).attr("x1",_).attr("x2",_);let I=s.showHorizontalLine?this.getLineHorizontalY(E):void 0;this.lineHorizontal.style("display",I===void 0?"none":null).attr("x1",0).attr("x2",this._width),I!==void 0&&G(this.lineHorizontal,c,Dl).attr("y1",I).attr("y2",I);let D=this.g.selectAll("circle").data(E,($,T)=>{var S;return(S=$.id)!==null&&S!==void 0?S:T}),F=D.enter().append("circle").attr("class",n2).attr("r",0).attr("cx",_).attr("cy",$=>$.y).style("fill",$=>$.color).style("stroke",$=>$.strokeColor).style("stroke-width",$=>$.strokeWidth);G(F.merge(D),c,Dl).attr("cx",_).attr("cy",$=>$.y).attr("r",s.circleRadius).style("opacity",$=>$.opacity).style("fill",$=>$.color).style("stroke",$=>$.strokeColor).style("stroke-width",$=>$.strokeWidth),G(D.exit(),c,Dl).attr("r",0).style("opacity",0).remove().on("interrupt",function(){this.remove()})}hide(e){window.cancelAnimationFrame(this._animFrameId),this._animFrameId=window.requestAnimationFrame(()=>{var n,r;this._xPx=void 0,this._yPx=void 0,this._mouseEvent=void 0,(r=(n=this.config).onCrosshairMove)===null||r===void 0||r.call(n,void 0,void 0,void 0,e),this._render()})}_onMouseMove(e){var n;let{datamodel:r,element:o}=this;!this.accessors.x&&(!((n=r.data)===null||n===void 0)&&n.length)&&console.warn("Unovis | Crosshair: X accessor function has not been configured. Please check if it's present in the configuration object");let[i,a]=oe(e,o);this._xPx=i,this._yPx=a,this._mouseEvent=e,window.cancelAnimationFrame(this._animFrameId),this._animFrameId=window.requestAnimationFrame(()=>{this._render()})}_onMouseOut(e){var n;(!e||!(!((n=this.container)===null||n===void 0)&&n.node().contains(e.relatedTarget)))&&this.hide(e)}_onWheel(e){this.hide(e)}_showTooltip(e,n,r,o){var i;let{config:a,datamodel:s}=this,l=(i=a.tooltip)!==null&&i!==void 0?i:this.tooltip;if(!l||!r)return;let[c,u]=r,f=a.template(e,n,s.data,o);if(l.config.followCursor=!0,!l.config.horizontalPlacement||l.config.horizontalPlacement===q.Auto){let d=l.isContainerBody()?c-this.container.node().getBoundingClientRect().left:c;l.overrideHorizontalPlacement(d>this._containerWidth/2?q.Left:q.Right)}f&&l.show(f,{x:c,y:u})}_hideTooltip(){var e;let{config:n}=this,r=(e=n.tooltip)!==null&&e!==void 0?e:this.tooltip;r?.hide()}getYDataExtent(){return[void 0,void 0]}getLineHorizontalY(e){var n;let r=this._yPx,o=e.filter(a=>a.opacity!==0&&isFinite(a.y)).map(a=>a.y),i=(n=r===void 0?o[0]:bp(o,a=>Math.abs(a-r)))!==null&&n!==void 0?n:r;return isFinite(i)?mt(Math.round(i),0,this._height):void 0}getCircleData(e,n){var r,o;let{config:i}=this,a={colorFn:this._colorFunction},s=this.colorKeys;if(i.snapToData&&e){let l=(r=this.accessors.y)!==null&&r!==void 0?r:[],c=(o=this.accessors.yStacked)!==null&&o!==void 0?o:[],u=z(e,this.accessors.baseline,n)||0,f=Yv(e,n,...c).map((h,p)=>({id:`stacked-${p}`,y:this.yScale(h+u),opacity:tt(z(e,c[p],p))?1:0,color:K(e,i.color,p,s?.[p],a),strokeColor:i.strokeColor?K(e,i.strokeColor,p,s?.[p],a):void 0,strokeWidth:i.strokeWidth?z(e,i.strokeWidth,p):void 0})),d=l.map((h,p)=>{let g=z(e,h,n);return{id:`regular-${p}`,y:this.yScale(g),opacity:tt(g)?1:0,color:K(e,i.color,f.length+p,s?.[f.length+p],a),strokeColor:i.strokeColor?K(e,i.strokeColor,p,s?.[p],a):void 0,strokeWidth:i.strokeWidth?z(e,i.strokeWidth,p):void 0}});return f.concat(d).filter(h=>tt(h.y))}return[]}};cp.selectors=r2;var m3={items:[],labelClassName:"",onLegendItemClick:void 0,labelFontSize:null,labelMaxWidth:null,bulletSize:null,bulletSpacing:4,bulletShape:t=>{var e;return(e=t.shape)!==null&&e!==void 0?e:Mn.Circle},orientation:fc.Horizontal,renderIntoProvidedDomNode:!1};var Av=mo*3,Xet={[Mn.Circle]:Math.PI/4,[Mn.Cross]:5/9,[Mn.Diamond]:Math.sqrt(3)/6,[Mn.Square]:1,[Mn.Star]:.3,[Mn.Triangle]:Math.sqrt(3)/4,[Mn.Wye]:5/11};function o2(t,e,n){return e<1?0:t*e+n*(e-1)}function g3(t){t.each((e,n,r)=>{U(r[n]).append("svg").attr("width","100%").attr("height","100%").append("path")})}function x3(t,e,n,r){let o={colorFn:r};t.each((i,a,s)=>{var l;let c=j(i,e.bulletShape,a),u=Nu((l=i.color)!==null&&l!==void 0?l:K(i,n,a,i.colorKey,o)),f=u.length,d=Av,h=pn(e.bulletSize)||ue("var(--vis-legend-bullet-size)",s[a]),p=e.bulletSpacing*(Av/h),g=o2(d,f,p),m=c===Mn.Line?Av/2.5:Av,x=U(s[a]).select("svg").attr("viewBox",`0 0 ${g} ${m}`);x.selectAll("path").remove();let y=i.inactive?"var(--vis-legend-bullet-inactive-opacity)":1,_=Nt(i,i.pattern,a),v=Ft(_),b=x.node();u.forEach((w,A)=>{var L,E;let I=x.append("path").attr(xe,a),D=Cl(_,w,b);if(c===Mn.Line){let F=A*(d+p),$=F+d;I.attr("d",`M${F},${m/2} L${$},${m/2}`).attr("transform",null).style("opacity",y).style("stroke",w).style("stroke-width","3px").style("fill",null).style("fill-opacity",null).style("marker",(L=D?.marker)!==null&&L!==void 0?L:null).style("stroke-dasharray",(E=D?.dashArray)!==null&&E!==void 0?E:null).style("marker-start","none").style("marker-end","none")}else{let F=Vl().type(Ym[c]).size(d*m*Xet[c]),$=(d-2)/d,T=m/2;switch(c){case Mn.Triangle:T+=m/8;break;case Mn.Star:T+=m/16;break;case Mn.Wye:T-=m/16;break}let S=A*(d+p)+d/2;I.attr("d",F).attr("transform",`translate(${S}, ${Math.round(T)}) scale(${$})`).style("stroke",w).style("stroke-width","1px").style("opacity",null).style("fill",w).style("fill-opacity",y).style("mask",v)}})})}var s2={};Wt(s2,{bullet:()=>Ev,clickable:()=>a2,item:()=>up,itemVertical:()=>i2,label:()=>Lv,root:()=>Tv,variables:()=>Zet});var Tv=M`
|
|
1716
|
+
label: bullet-legend-component;
|
|
1717
|
+
`,Zet=Pt`
|
|
1718
|
+
:root {
|
|
1719
|
+
// Undefined by default to allow proper fallback to var(--vis-font-family)
|
|
1720
|
+
/* --vis-legend-font-family: */
|
|
1721
|
+
|
|
1722
|
+
--vis-legend-label-color: #6c778c;
|
|
1723
|
+
--vis-legend-label-max-width: 300px;
|
|
1724
|
+
--vis-legend-label-font-size: 12px;
|
|
1725
|
+
--vis-legend-bullet-size: 9px;
|
|
1726
|
+
--vis-legend-bullet-inactive-opacity: 0.15;
|
|
1727
|
+
--vis-legend-item-spacing: 20px;
|
|
1728
|
+
--vis-legend-vertical-item-spacing: 5px;
|
|
1729
|
+
--vis-legend-bullet-label-spacing: 8px;
|
|
1730
|
+
|
|
1731
|
+
--vis-dark-legend-label-color: #eee;
|
|
1732
|
+
}
|
|
1733
|
+
|
|
1734
|
+
${Yt} ${`.${Tv}`} {
|
|
1735
|
+
--vis-legend-label-color: var(--vis-dark-legend-label-color);
|
|
1736
|
+
}
|
|
1737
|
+
|
|
1738
|
+
body.theme-patterns {
|
|
1739
|
+
--vis-legend-bullet-size: 14px;
|
|
1740
|
+
}
|
|
1741
|
+
`,up=M`
|
|
1742
|
+
label: legendItem;
|
|
1743
|
+
display: inline-flex;
|
|
1744
|
+
align-items: center;
|
|
1745
|
+
font-family: var(--vis-legend-font-family, var(--vis-font-family));
|
|
1746
|
+
margin-right: var(--vis-legend-item-spacing);
|
|
1747
|
+
white-space: nowrap;
|
|
1748
|
+
cursor: default;
|
|
1749
|
+
user-select: none;
|
|
1750
|
+
max-width: min-content;
|
|
1751
|
+
`,i2=M`
|
|
1752
|
+
label: legendItemVertical;
|
|
1753
|
+
display: flex;
|
|
1754
|
+
margin-top: var(--vis-legend-vertical-item-spacing);
|
|
1755
|
+
`,a2=M`
|
|
1756
|
+
cursor: pointer;
|
|
1757
|
+
`,Lv=M`
|
|
1758
|
+
label: legendItemLabel;
|
|
1759
|
+
font-size: var(--vis-legend-label-font-size);
|
|
1760
|
+
display: inline-block;
|
|
1761
|
+
vertical-align: middle;
|
|
1762
|
+
color: var(--vis-legend-label-color);
|
|
1763
|
+
max-width: var(--vis-legend-label-max-width);
|
|
1764
|
+
text-overflow: ellipsis;
|
|
1765
|
+
overflow: hidden;
|
|
1766
|
+
white-space: nowrap;
|
|
1767
|
+
`,Ev=M`
|
|
1768
|
+
flex: 0 0 auto;
|
|
1769
|
+
label: legendItemBullet;
|
|
1770
|
+
margin-right: var(--vis-legend-bullet-label-spacing);
|
|
1771
|
+
height: var(--vis-legend-bullet-size);
|
|
1772
|
+
width: var(--vis-legend-bullet-size);
|
|
1773
|
+
|
|
1774
|
+
svg {
|
|
1775
|
+
display: block;
|
|
1776
|
+
}
|
|
1777
|
+
`;var Us=class{constructor(e,n){this._defaultConfig=m3,this.config=this._defaultConfig,this._colorAccessor=r=>r.color,this._container=e,this.div=n?.renderIntoProvidedDomNode?U(this._container):U(this._container).append("div"),this.div.classed(Tv,!0),this.element=this.div.node(),n&&this.setConfig(n)}setConfig(e){this.prevConfig=this.config,this.config=He(this._defaultConfig,e),this.render()}update(e){this.setConfig(e)}render(){let{config:e}=this,n=this.div.selectAll(`.${up}`).data(e.items),r=n.enter().append("div").on("click",this._onItemClick.bind(this)),o=r.merge(n);o.attr("class",i=>{var a;return`${up} ${(a=i.className)!==null&&a!==void 0?a:""}`}).classed(i2,e.orientation===fc.Vertical).classed(a2,i=>!!e.onLegendItemClick&&this._isItemClickable(i)).attr("title",i=>i.name).style("display",i=>i.hidden?"none":null),r.append("span").attr("class",Ev).call(g3),o.select(`.${Ev}`).style("width",function(i){let s=(Array.isArray(i.color)?i.color:[i.color]).length,l=e.bulletSize?pn(e.bulletSize):ue("var(--vis-legend-bullet-size)",this)||9,c=e.bulletSpacing;return`${o2(l,s,c)}px`}).style("height",e.bulletSize).style("box-sizing","content-box").call(x3,this.config,this._colorAccessor,e.color),r.append("span").attr("class",Lv).classed(e.labelClassName,!0).style("max-width",e.labelMaxWidth).style("font-size",e.labelFontSize),o.select(`.${Lv}`).text(i=>i.name),n.exit().remove()}_isItemClickable(e){return e.pointer===void 0?!0:e.pointer}_onItemClick(e,n){let{config:{onLegendItemClick:r}}=this,i=this.div.selectAll(`.${up}`).nodes().indexOf(e.currentTarget);r&&r(n,i)}destroy(){this.element!==this._container&&this.div.remove()}};Us.selectors=s2;var v3=t=>typeof t!="object"||t===null||Array.isArray(t)?!1:Object.keys(t).some(n=>["$field","$index","$const","$dateTickFormat","$numTickFormat","$lookup","$format","$mapField"].includes(n));var qs=class extends Error{},Ket=t=>{if(t==null||t==="")return;let e=Number(t);return Number.isNaN(e)?void 0:e},Qet=t=>{if(t==null||t==="")return;if(typeof t=="number")return t;let e=new Date(t).getTime();return Number.isNaN(e)?void 0:e},Jet=t=>{let e=typeof t=="number"?t:Number(t);if(!Number.isFinite(e))return String(t);let n=new Date(e),r=n.getUTCHours()===0&&n.getUTCMinutes()===0?n.getUTCDate()===1?{year:"numeric",month:"short"}:{month:"short",day:"numeric"}:{hour:"2-digit",minute:"2-digit"};return n.toLocaleString("en-US",{...r,timeZone:"UTC"})},y3=t=>{let e=Number(t);return Number.isFinite(e)?e.toLocaleString("en-US",{maximumFractionDigits:6}):String(t)};function tnt(t){if("$field"in t){let{$field:e,as:n}=t;return n==="number"?r=>Ket(r?.[e]):n==="date"?r=>Qet(r?.[e]):r=>r?.[e]}if("$index"in t)return(e,n)=>n;if("$const"in t)return()=>t.$const;if("$dateTickFormat"in t)return Jet;if("$numTickFormat"in t)return y3;if("$lookup"in t){let e=t.$lookup;return n=>e[Math.round(Number(n))%e.length]??String(n)}if("$format"in t){let{field:e,prefix:n="",suffix:r=""}=t.$format;return o=>{let i=o?.[e];return i==null?"":`${n}${y3(i)}${r}`}}if("$mapField"in t){let{field:e,mapping:n,fallback:r}=t.$mapField;return o=>n[String(o?.[e])]??r}return t}function Ta(t){if(v3(t))return tnt(t);if(Array.isArray(t))return t.map(Ta);if(typeof t=="object"&&t!==null){let e={};for(let[n,r]of Object.entries(t))e[n]=Ta(r);return e}return t}var b3=new Set(["Line","Area","GroupedBar","StackedBar","Scatter","Timeline","Boxplot","XYLabels","Plotband","Plotline"]),ent=new Set(["Donut","NestedDonut","RadialBar","Sankey","Heatmap","Treemap","ChordDiagram","Graph","TopoJSONMap"]),nnt=new Set(["Graph"]);function _3(t,e,n){if(!(b3.has(e.type)||ent.has(e.type)))throw new qs(`Unsupported component type: ${e.type}`);let o=t[e.type];if(!o)throw new qs(`Component ${e.type} is not available in this @unovis/ts build`);let i=Ta(e.config);i.duration=n.duration??0,nnt.has(e.type)&&n.onComponentComplete&&(i.onRenderComplete=n.onComponentComplete);let a=i.projection;if(a?.$mapProjection){let l=t.MapProjection?.[a.$mapProjection];if(!l)throw new qs(`Unknown map projection: ${a.$mapProjection}`);i.projection=l()}return new o(i)}function w3(t,e,n={}){let r=Ta(e.containerConfig??{}),o=n.duration??0,i=n.responsive?{}:{width:e.width,height:e.height};if(e.container==="xy"){let s=e.components.map(c=>{if(!b3.has(c.type))throw new qs(`${c.type} cannot be used in an XY container`);return _3(t,c,n)}),l=(c,u)=>{if(c)return new t.Axis({...Ta(c),type:u,duration:o})};return{containerType:"xy",containerConfig:{...r,components:s,xAxis:l(e.xAxis,"x"),yAxis:l(e.yAxis,"y"),...i,duration:o,onRenderComplete:n.onRenderComplete},data:e.data}}if(e.components.length!==1)throw new qs("single container requires exactly one component");let a=_3(t,e.components[0],n);return{containerType:"single",containerConfig:{...r,component:a,...i,duration:o,onRenderComplete:n.onRenderComplete},data:e.data}}var l2=t=>String(t).replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,"""),rnt=t=>t==null?"\u2014":typeof t=="number"?t.toLocaleString("en-US",{maximumFractionDigits:6}):l2(t),La=(t,e)=>`<div class="uv-tt-row"><span class="uv-tt-key">${l2(t)}</span><span class="uv-tt-val">${rnt(e)}</span></div>`,Yo=t=>`<div class="uv-tt-title">${l2(t)}</div>`;function k3(t){let e=[],n=r=>{if(Array.isArray(r)){r.forEach(n);return}if(typeof r=="object"&&r!==null){let o=r;if(typeof o.$field=="string"){e.includes(o.$field)||e.push(o.$field);return}Object.values(r).forEach(n)}};return n(t),e}var ont=t=>Object.entries(t??{}).filter(([e,n])=>!e.startsWith("_")&&(n===null||typeof n!="object"));function int(t,e){return n=>{if(!n)return"";let r=e&&n[e]!==void 0?Yo(n[e]):"",o=t.length?t.filter(i=>n[i]!==void 0).map(i=>La(i,n[i])):ont(n).map(([i,a])=>La(i,a));return`${r}${o.join("")}`||Yo("no data")}}function S3(t,e){let n={},r={};for(let s of e.components){let l=k3(s.config),c=int(l);switch(s.type){case"Line":case"Area":break;case"GroupedBar":case"StackedBar":{let u=s.type==="StackedBar"?t.StackedBar:t.GroupedBar;r[u.selectors.bar]=c;break}case"Scatter":r[t.Scatter.selectors.point]=c;break;case"Boxplot":r[t.Boxplot.selectors.box]=c;break;case"Timeline":r[t.Timeline.selectors.line]=c;break;case"Donut":r[t.Donut.selectors.segment]=u=>c(u?.data??u);break;case"NestedDonut":r[t.NestedDonut.selectors.segment]=u=>`${Yo(u?.data?.key??"")}${La("value",u?.value??u?.data?.value)}`;break;case"RadialBar":r[t.RadialBar.selectors.segment]=u=>c(u?.data??u);break;case"Heatmap":r[t.Heatmap.selectors.node]=c;break;case"Treemap":r[t.Treemap.selectors.tile]=u=>`${Yo(u?.data?.key??u?.key??"")}${La("value",u?.value)}`;break;case"Sankey":r[t.Sankey.selectors.node]=u=>`${Yo(u?.label??u?.id??"")}${La("total",u?.value)}`,r[t.Sankey.selectors.link]=u=>`${Yo(`${u?.source?.label??u?.source?.id??""} \u2192 ${u?.target?.label??u?.target?.id??""}`)}${La("value",u?.value)}`;break;case"ChordDiagram":r[t.ChordDiagram.selectors.node]=u=>Yo(u?.data?.label??u?.key??"");break;case"Graph":r[t.Graph.selectors.node]=u=>c(u?._state?u:u?.data??u),r[t.Graph.selectors.link]=u=>Yo(`${u?.source?.id??""} \u2192 ${u?.target?.id??""}`);break;case"TopoJSONMap":r[t.TopoJSONMap.selectors.feature]=u=>{let f=u?.data??u;return!f?.id&&!f?.name?"":`${Yo(f.name??f.id)}${f.value!==void 0?La("value",f.value):""}`};break}}let o=e.components.find(s=>s.type==="Line"||s.type==="Area"),i=e.container==="xy"&&!!o;if((Object.keys(r).length||i)&&(n.tooltip=new t.Tooltip({triggers:r,horizontalPlacement:"center"})),i&&o){let s=Ta(o.config.x),l=k3(o.config).filter(f=>f!==o.config.x?.$field),c=e.legend?.map(f=>f.name)??l,u=o.config.x?.$field;n.crosshair=new t.Crosshair({x:s,y:Ta(o.config.y),template:f=>{let d=u&&f?.[u]!==void 0?Yo(f[u]):"",h=l.map((p,g)=>La(c[g]??p,f?.[p]));return`${d}${h.join("")}`}})}let a=e.legend?.length?e.legend.map(s=>({name:s.name,color:s.color})):void 0;return{containerConfig:n,legendItems:a}}var C3="data-theme";function ant(t){let e=document.documentElement;t==="dark"?e.setAttribute(C3,"dark"):e.removeAttribute(C3)}function snt(t,e){e?.forEach((n,r)=>{t.style.setProperty(`--vis-color${r}`,n),t.style.setProperty(`--vis-dark-color${r}`,n)})}function c2(t,e,n={}){if(e.innerHTML="",e.classList.add("uv-root"),ant(t.theme),snt(e,t.colors),n.showTitle!==!1&&t.title){let f=document.createElement("div");f.className="uv-title",f.textContent=t.title,e.appendChild(f)}let r=Mv,{containerConfig:o,legendItems:i}=S3(r,t),a;if(i?.length){let f=document.createElement("div");f.className="uv-legend",e.appendChild(f),a=new Us(f,{items:i})}let s=document.createElement("div");s.className="uv-chart",e.appendChild(s);let l=w3(r,t,{duration:n.duration??400,responsive:!0}),c={...l.containerConfig,...o},u=l.containerType==="xy"?new El(s,c,l.data):new zl(s,c,l.data);return{element:e,destroy:()=>{try{u.destroy(),a?.destroy?.()}finally{e.innerHTML=""}}}}function T3(){let t=document.getElementById("uv-embed-root")??document.body,e,n=()=>{window.parent?.postMessage({type:"unovis:size",width:t.scrollWidth,height:t.scrollHeight},"*")};window.addEventListener("message",r=>{let o=r.data;if(!(o?.type!=="unovis:render"||!o.spec)){e?.destroy();try{e=c2(o.spec,t,o.options??{}),n()}catch(i){t.innerHTML=`<div class="uv-error">${String(i instanceof Error?i.message:i)}</div>`}}}),window.parent?.postMessage({type:"unovis:ready"},"*")}function A3(){let t=document.getElementById("uv-spec"),e=document.getElementById("uv-options"),n=document.getElementById("uv-root");if(!(!t?.textContent||!n))try{let r=e?.textContent?JSON.parse(e.textContent):{};c2(JSON.parse(t.textContent),n,r)}catch(r){n.innerHTML=`<div class="uv-error">Failed to render chart: ${String(r instanceof Error?r.message:r)}</div>`}}window.UnovisChart={render:c2,startEmbed:T3,unovis:Mv};window.location.hash==="#embed"?T3():document.readyState==="loading"?document.addEventListener("DOMContentLoaded",A3):A3();})();
|