UNPKG

mermaid

Version:

Markdown-ish syntax for generating flowcharts, sequence diagrams, class diagrams, gantt charts and git graphs.

6 lines 3.34 MB
(function(JM,Ag){typeof exports=="object"&&typeof module<"u"?module.exports=Ag():typeof define=="function"&&define.amd?define(Ag):(JM=typeof globalThis<"u"?globalThis:JM||self,JM.mermaid=Ag())})(this,function(){var FWe,RWe;"use strict";function JM(i){for(var s=[],u=1;u<arguments.length;u++)s[u-1]=arguments[u];var d=Array.from(typeof i=="string"?[i]:i);d[d.length-1]=d[d.length-1].replace(/\r?\n([\t ]*)$/,"");var p=d.reduce(function(y,T){var _=T.match(/\n([\t ]+|(?!\s).)/g);return _?y.concat(_.map(function(A){var P,R;return(R=(P=A.match(/[\t ]/g))===null||P===void 0?void 0:P.length)!==null&&R!==void 0?R:0})):y},[]);if(p.length){var v=new RegExp(` [ ]{`+Math.min.apply(Math,p)+"}","g");d=d.map(function(y){return y.replace(v,` `)})}d[0]=d[0].replace(/^\r?\n/,"");var b=d[0];return s.forEach(function(y,T){var _=b.match(/(?:^|\n)( *)$/),A=_?_[1]:"",P=y;typeof y=="string"&&y.includes(` `)&&(P=String(y).split(` `).map(function(R,F){return F===0?R:""+A+R}).join(` `)),b+=P+d[T+1]}),b}var Ag=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function hC(i){return i&&i.__esModule&&Object.prototype.hasOwnProperty.call(i,"default")?i.default:i}var oBe={exports:{}};(function(i,s){(function(u,d){i.exports=d()})(Ag,function(){var u=1e3,d=6e4,p=36e5,v="millisecond",b="second",y="minute",T="hour",_="day",A="week",P="month",R="quarter",F="year",j="date",K="Invalid Date",ee=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,ie=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,oe={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(Fe){var Pe=["th","st","nd","rd"],je=Fe%100;return"["+Fe+(Pe[(je-20)%10]||Pe[je]||Pe[0])+"]"}},pe=function(Fe,Pe,je){var Ie=String(Fe);return!Ie||Ie.length>=Pe?Fe:""+Array(Pe+1-Ie.length).join(je)+Fe},be={s:pe,z:function(Fe){var Pe=-Fe.utcOffset(),je=Math.abs(Pe),Ie=Math.floor(je/60),Se=je%60;return(Pe<=0?"+":"-")+pe(Ie,2,"0")+":"+pe(Se,2,"0")},m:function Fe(Pe,je){if(Pe.date()<je.date())return-Fe(je,Pe);var Ie=12*(je.year()-Pe.year())+(je.month()-Pe.month()),Se=Pe.clone().add(Ie,P),Ce=je-Se<0,ke=Pe.clone().add(Ie+(Ce?-1:1),P);return+(-(Ie+(je-Se)/(Ce?Se-ke:ke-Se))||0)},a:function(Fe){return Fe<0?Math.ceil(Fe)||0:Math.floor(Fe)},p:function(Fe){return{M:P,y:F,w:A,d:_,D:j,h:T,m:y,s:b,ms:v,Q:R}[Fe]||String(Fe||"").toLowerCase().replace(/s$/,"")},u:function(Fe){return Fe===void 0}},ae="en",ne={};ne[ae]=oe;var se="$isDayjsObject",de=function(Fe){return Fe instanceof xe||!(!Fe||!Fe[se])},X=function Fe(Pe,je,Ie){var Se;if(!Pe)return ae;if(typeof Pe=="string"){var Ce=Pe.toLowerCase();ne[Ce]&&(Se=Ce),je&&(ne[Ce]=je,Se=Ce);var ke=Pe.split("-");if(!Se&&ke.length>1)return Fe(ke[0])}else{var Ke=Pe.name;ne[Ke]=Pe,Se=Ke}return!Ie&&Se&&(ae=Se),Se||!Ie&&ae},ge=function(Fe,Pe){if(de(Fe))return Fe.clone();var je=typeof Pe=="object"?Pe:{};return je.date=Fe,je.args=arguments,new xe(je)},W=be;W.l=X,W.i=de,W.w=function(Fe,Pe){return ge(Fe,{locale:Pe.$L,utc:Pe.$u,x:Pe.$x,$offset:Pe.$offset})};var xe=function(){function Fe(je){this.$L=X(je.locale,null,!0),this.parse(je),this.$x=this.$x||je.x||{},this[se]=!0}var Pe=Fe.prototype;return Pe.parse=function(je){this.$d=function(Ie){var Se=Ie.date,Ce=Ie.utc;if(Se===null)return new Date(NaN);if(W.u(Se))return new Date;if(Se instanceof Date)return new Date(Se);if(typeof Se=="string"&&!/Z$/i.test(Se)){var ke=Se.match(ee);if(ke){var Ke=ke[2]-1||0,Ft=(ke[7]||"0").substring(0,3);return Ce?new Date(Date.UTC(ke[1],Ke,ke[3]||1,ke[4]||0,ke[5]||0,ke[6]||0,Ft)):new Date(ke[1],Ke,ke[3]||1,ke[4]||0,ke[5]||0,ke[6]||0,Ft)}}return new Date(Se)}(je),this.init()},Pe.init=function(){var je=this.$d;this.$y=je.getFullYear(),this.$M=je.getMonth(),this.$D=je.getDate(),this.$W=je.getDay(),this.$H=je.getHours(),this.$m=je.getMinutes(),this.$s=je.getSeconds(),this.$ms=je.getMilliseconds()},Pe.$utils=function(){return W},Pe.isValid=function(){return this.$d.toString()!==K},Pe.isSame=function(je,Ie){var Se=ge(je);return this.startOf(Ie)<=Se&&Se<=this.endOf(Ie)},Pe.isAfter=function(je,Ie){return ge(je)<this.startOf(Ie)},Pe.isBefore=function(je,Ie){return this.endOf(Ie)<ge(je)},Pe.$g=function(je,Ie,Se){return W.u(je)?this[Ie]:this.set(Se,je)},Pe.unix=function(){return Math.floor(this.valueOf()/1e3)},Pe.valueOf=function(){return this.$d.getTime()},Pe.startOf=function(je,Ie){var Se=this,Ce=!!W.u(Ie)||Ie,ke=W.p(je),Ke=function(xt,Pt){var Qe=W.w(Se.$u?Date.UTC(Se.$y,Pt,xt):new Date(Se.$y,Pt,xt),Se);return Ce?Qe:Qe.endOf(_)},Ft=function(xt,Pt){return W.w(Se.toDate()[xt].apply(Se.toDate("s"),(Ce?[0,0,0,0]:[23,59,59,999]).slice(Pt)),Se)},Ne=this.$W,gn=this.$M,_t=this.$D,Et="set"+(this.$u?"UTC":"");switch(ke){case F:return Ce?Ke(1,0):Ke(31,11);case P:return Ce?Ke(1,gn):Ke(0,gn+1);case A:var Gt=this.$locale().weekStart||0,ln=(Ne<Gt?Ne+7:Ne)-Gt;return Ke(Ce?_t-ln:_t+(6-ln),gn);case _:case j:return Ft(Et+"Hours",0);case T:return Ft(Et+"Minutes",1);case y:return Ft(Et+"Seconds",2);case b:return Ft(Et+"Milliseconds",3);default:return this.clone()}},Pe.endOf=function(je){return this.startOf(je,!1)},Pe.$set=function(je,Ie){var Se,Ce=W.p(je),ke="set"+(this.$u?"UTC":""),Ke=(Se={},Se[_]=ke+"Date",Se[j]=ke+"Date",Se[P]=ke+"Month",Se[F]=ke+"FullYear",Se[T]=ke+"Hours",Se[y]=ke+"Minutes",Se[b]=ke+"Seconds",Se[v]=ke+"Milliseconds",Se)[Ce],Ft=Ce===_?this.$D+(Ie-this.$W):Ie;if(Ce===P||Ce===F){var Ne=this.clone().set(j,1);Ne.$d[Ke](Ft),Ne.init(),this.$d=Ne.set(j,Math.min(this.$D,Ne.daysInMonth())).$d}else Ke&&this.$d[Ke](Ft);return this.init(),this},Pe.set=function(je,Ie){return this.clone().$set(je,Ie)},Pe.get=function(je){return this[W.p(je)]()},Pe.add=function(je,Ie){var Se,Ce=this;je=Number(je);var ke=W.p(Ie),Ke=function(gn){var _t=ge(Ce);return W.w(_t.date(_t.date()+Math.round(gn*je)),Ce)};if(ke===P)return this.set(P,this.$M+je);if(ke===F)return this.set(F,this.$y+je);if(ke===_)return Ke(1);if(ke===A)return Ke(7);var Ft=(Se={},Se[y]=d,Se[T]=p,Se[b]=u,Se)[ke]||1,Ne=this.$d.getTime()+je*Ft;return W.w(Ne,this)},Pe.subtract=function(je,Ie){return this.add(-1*je,Ie)},Pe.format=function(je){var Ie=this,Se=this.$locale();if(!this.isValid())return Se.invalidDate||K;var Ce=je||"YYYY-MM-DDTHH:mm:ssZ",ke=W.z(this),Ke=this.$H,Ft=this.$m,Ne=this.$M,gn=Se.weekdays,_t=Se.months,Et=Se.meridiem,Gt=function(Pt,Qe,Dt,kt){return Pt&&(Pt[Qe]||Pt(Ie,Ce))||Dt[Qe].slice(0,kt)},ln=function(Pt){return W.s(Ke%12||12,Pt,"0")},xt=Et||function(Pt,Qe,Dt){var kt=Pt<12?"AM":"PM";return Dt?kt.toLowerCase():kt};return Ce.replace(ie,function(Pt,Qe){return Qe||function(Dt){switch(Dt){case"YY":return String(Ie.$y).slice(-2);case"YYYY":return W.s(Ie.$y,4,"0");case"M":return Ne+1;case"MM":return W.s(Ne+1,2,"0");case"MMM":return Gt(Se.monthsShort,Ne,_t,3);case"MMMM":return Gt(_t,Ne);case"D":return Ie.$D;case"DD":return W.s(Ie.$D,2,"0");case"d":return String(Ie.$W);case"dd":return Gt(Se.weekdaysMin,Ie.$W,gn,2);case"ddd":return Gt(Se.weekdaysShort,Ie.$W,gn,3);case"dddd":return gn[Ie.$W];case"H":return String(Ke);case"HH":return W.s(Ke,2,"0");case"h":return ln(1);case"hh":return ln(2);case"a":return xt(Ke,Ft,!0);case"A":return xt(Ke,Ft,!1);case"m":return String(Ft);case"mm":return W.s(Ft,2,"0");case"s":return String(Ie.$s);case"ss":return W.s(Ie.$s,2,"0");case"SSS":return W.s(Ie.$ms,3,"0");case"Z":return ke}return null}(Pt)||ke.replace(":","")})},Pe.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},Pe.diff=function(je,Ie,Se){var Ce,ke=this,Ke=W.p(Ie),Ft=ge(je),Ne=(Ft.utcOffset()-this.utcOffset())*d,gn=this-Ft,_t=function(){return W.m(ke,Ft)};switch(Ke){case F:Ce=_t()/12;break;case P:Ce=_t();break;case R:Ce=_t()/3;break;case A:Ce=(gn-Ne)/6048e5;break;case _:Ce=(gn-Ne)/864e5;break;case T:Ce=gn/p;break;case y:Ce=gn/d;break;case b:Ce=gn/u;break;default:Ce=gn}return Se?Ce:W.a(Ce)},Pe.daysInMonth=function(){return this.endOf(P).$D},Pe.$locale=function(){return ne[this.$L]},Pe.locale=function(je,Ie){if(!je)return this.$L;var Se=this.clone(),Ce=X(je,Ie,!0);return Ce&&(Se.$L=Ce),Se},Pe.clone=function(){return W.w(this.$d,this)},Pe.toDate=function(){return new Date(this.valueOf())},Pe.toJSON=function(){return this.isValid()?this.toISOString():null},Pe.toISOString=function(){return this.$d.toISOString()},Pe.toString=function(){return this.$d.toUTCString()},Fe}(),U=xe.prototype;return ge.prototype=U,[["$ms",v],["$s",b],["$m",y],["$H",T],["$W",_],["$M",P],["$y",F],["$D",j]].forEach(function(Fe){U[Fe[1]]=function(Pe){return this.$g(Pe,Fe[0],Fe[1])}}),ge.extend=function(Fe,Pe){return Fe.$i||(Fe(Pe,xe,ge),Fe.$i=!0),ge},ge.locale=X,ge.isDayjs=de,ge.unix=function(Fe){return ge(1e3*Fe)},ge.en=ne[ae],ge.Ls=ne,ge.p={},ge})})(oBe);var NAt=oBe.exports;const Lg=hC(NAt),g7={trace:0,debug:1,info:2,warn:3,error:4,fatal:5},Xe={trace:(...i)=>{},debug:(...i)=>{},info:(...i)=>{},warn:(...i)=>{},error:(...i)=>{},fatal:(...i)=>{}},fpe=function(i="fatal"){let s=g7.fatal;typeof i=="string"?(i=i.toLowerCase(),i in g7&&(s=g7[i])):typeof i=="number"&&(s=i),Xe.trace=()=>{},Xe.debug=()=>{},Xe.info=()=>{},Xe.warn=()=>{},Xe.error=()=>{},Xe.fatal=()=>{},s<=g7.fatal&&(Xe.fatal=console.error?console.error.bind(console,Lv("FATAL"),"color: orange"):console.log.bind(console,"\x1B[35m",Lv("FATAL"))),s<=g7.error&&(Xe.error=console.error?console.error.bind(console,Lv("ERROR"),"color: orange"):console.log.bind(console,"\x1B[31m",Lv("ERROR"))),s<=g7.warn&&(Xe.warn=console.warn?console.warn.bind(console,Lv("WARN"),"color: orange"):console.log.bind(console,"\x1B[33m",Lv("WARN"))),s<=g7.info&&(Xe.info=console.info?console.info.bind(console,Lv("INFO"),"color: lightblue"):console.log.bind(console,"\x1B[34m",Lv("INFO"))),s<=g7.debug&&(Xe.debug=console.debug?console.debug.bind(console,Lv("DEBUG"),"color: lightgreen"):console.log.bind(console,"\x1B[32m",Lv("DEBUG"))),s<=g7.trace&&(Xe.trace=console.debug?console.debug.bind(console,Lv("TRACE"),"color: lightgreen"):console.log.bind(console,"\x1B[32m",Lv("TRACE")))},Lv=i=>`%c${Lg().format("ss.SSS")} : ${i} : `;var p9={};(function(i){Object.defineProperty(i,"__esModule",{value:!0}),i.sanitizeUrl=i.BLANK_URL=void 0;var s=/^([^\w]*)(javascript|data|vbscript)/im,u=/&#(\w+)(^\w|;)?/g,d=/&(newline|tab);/gi,p=/[\u0000-\u001F\u007F-\u009F\u2000-\u200D\uFEFF]/gim,v=/^.+(:|&colon;)/gim,b=[".","/"];i.BLANK_URL="about:blank";function y(A){return b.indexOf(A[0])>-1}function T(A){var P=A.replace(p,"");return P.replace(u,function(R,F){return String.fromCharCode(F)})}function _(A){if(!A)return i.BLANK_URL;var P=T(A).replace(d,"").replace(p,"").trim();if(!P)return i.BLANK_URL;if(y(P))return P;var R=P.match(v);if(!R)return P;var F=R[0];return s.test(F)?i.BLANK_URL:P}i.sanitizeUrl=_})(p9);function DY(i,s){return i==null||s==null?NaN:i<s?-1:i>s?1:i>=s?0:NaN}function PAt(i,s){return i==null||s==null?NaN:s<i?-1:s>i?1:s>=i?0:NaN}function dpe(i){let s,u,d;i.length!==2?(s=DY,u=(y,T)=>DY(i(y),T),d=(y,T)=>i(y)-T):(s=i===DY||i===PAt?i:BAt,u=i,d=i);function p(y,T,_=0,A=y.length){if(_<A){if(s(T,T)!==0)return A;do{const P=_+A>>>1;u(y[P],T)<0?_=P+1:A=P}while(_<A)}return _}function v(y,T,_=0,A=y.length){if(_<A){if(s(T,T)!==0)return A;do{const P=_+A>>>1;u(y[P],T)<=0?_=P+1:A=P}while(_<A)}return _}function b(y,T,_=0,A=y.length){const P=p(y,T,_,A-1);return P>_&&d(y[P-1],T)>-d(y[P],T)?P-1:P}return{left:p,center:b,right:v}}function BAt(){return 0}function FAt(i){return i===null?NaN:+i}const RAt=dpe(DY).right;dpe(FAt).center;const jAt=RAt;class cBe extends Map{constructor(s,u=qAt){if(super(),Object.defineProperties(this,{_intern:{value:new Map},_key:{value:u}}),s!=null)for(const[d,p]of s)this.set(d,p)}get(s){return super.get(uBe(this,s))}has(s){return super.has(uBe(this,s))}set(s,u){return super.set($At(this,s),u)}delete(s){return super.delete(zAt(this,s))}}function uBe({_intern:i,_key:s},u){const d=s(u);return i.has(d)?i.get(d):u}function $At({_intern:i,_key:s},u){const d=s(u);return i.has(d)?i.get(d):(i.set(d,u),u)}function zAt({_intern:i,_key:s},u){const d=s(u);return i.has(d)&&(u=i.get(d),i.delete(d)),u}function qAt(i){return i!==null&&typeof i=="object"?i.valueOf():i}const HAt=Math.sqrt(50),VAt=Math.sqrt(10),UAt=Math.sqrt(2);function IY(i,s,u){const d=(s-i)/Math.max(0,u),p=Math.floor(Math.log10(d)),v=d/Math.pow(10,p),b=v>=HAt?10:v>=VAt?5:v>=UAt?2:1;let y,T,_;return p<0?(_=Math.pow(10,-p)/b,y=Math.round(i*_),T=Math.round(s*_),y/_<i&&++y,T/_>s&&--T,_=-_):(_=Math.pow(10,p)*b,y=Math.round(i/_),T=Math.round(s/_),y*_<i&&++y,T*_>s&&--T),T<y&&.5<=u&&u<2?IY(i,s,u*2):[y,T,_]}function GAt(i,s,u){if(s=+s,i=+i,u=+u,!(u>0))return[];if(i===s)return[i];const d=s<i,[p,v,b]=d?IY(s,i,u):IY(i,s,u);if(!(v>=p))return[];const y=v-p+1,T=new Array(y);if(d)if(b<0)for(let _=0;_<y;++_)T[_]=(v-_)/-b;else for(let _=0;_<y;++_)T[_]=(v-_)*b;else if(b<0)for(let _=0;_<y;++_)T[_]=(p+_)/-b;else for(let _=0;_<y;++_)T[_]=(p+_)*b;return T}function gpe(i,s,u){return s=+s,i=+i,u=+u,IY(i,s,u)[2]}function ppe(i,s,u){s=+s,i=+i,u=+u;const d=s<i,p=d?gpe(s,i,u):gpe(i,s,u);return(d?-1:1)*(p<0?1/-p:p)}function KAt(i,s){let u;if(s===void 0)for(const d of i)d!=null&&(u<d||u===void 0&&d>=d)&&(u=d);else{let d=-1;for(let p of i)(p=s(p,++d,i))!=null&&(u<p||u===void 0&&p>=p)&&(u=p)}return u}function WAt(i,s){let u;if(s===void 0)for(const d of i)d!=null&&(u>d||u===void 0&&d>=d)&&(u=d);else{let d=-1;for(let p of i)(p=s(p,++d,i))!=null&&(u>p||u===void 0&&p>=p)&&(u=p)}return u}function YAt(i,s,u){i=+i,s=+s,u=(p=arguments.length)<2?(s=i,i=0,1):p<3?1:+u;for(var d=-1,p=Math.max(0,Math.ceil((s-i)/u))|0,v=new Array(p);++d<p;)v[d]=i+d*u;return v}function XAt(i){return i}var OY=1,bpe=2,mpe=3,NY=4,lBe=1e-6;function QAt(i){return"translate("+i+",0)"}function JAt(i){return"translate(0,"+i+")"}function ZAt(i){return s=>+i(s)}function eLt(i,s){return s=Math.max(0,i.bandwidth()-s*2)/2,i.round()&&(s=Math.round(s)),u=>+i(u)+s}function tLt(){return!this.__axis}function hBe(i,s){var u=[],d=null,p=null,v=6,b=6,y=3,T=typeof window<"u"&&window.devicePixelRatio>1?0:.5,_=i===OY||i===NY?-1:1,A=i===NY||i===bpe?"x":"y",P=i===OY||i===mpe?QAt:JAt;function R(F){var j=d??(s.ticks?s.ticks.apply(s,u):s.domain()),K=p??(s.tickFormat?s.tickFormat.apply(s,u):XAt),ee=Math.max(v,0)+y,ie=s.range(),oe=+ie[0]+T,pe=+ie[ie.length-1]+T,be=(s.bandwidth?eLt:ZAt)(s.copy(),T),ae=F.selection?F.selection():F,ne=ae.selectAll(".domain").data([null]),se=ae.selectAll(".tick").data(j,s).order(),de=se.exit(),X=se.enter().append("g").attr("class","tick"),ge=se.select("line"),W=se.select("text");ne=ne.merge(ne.enter().insert("path",".tick").attr("class","domain").attr("stroke","currentColor")),se=se.merge(X),ge=ge.merge(X.append("line").attr("stroke","currentColor").attr(A+"2",_*v)),W=W.merge(X.append("text").attr("fill","currentColor").attr(A,_*ee).attr("dy",i===OY?"0em":i===mpe?"0.71em":"0.32em")),F!==ae&&(ne=ne.transition(F),se=se.transition(F),ge=ge.transition(F),W=W.transition(F),de=de.transition(F).attr("opacity",lBe).attr("transform",function(xe){return isFinite(xe=be(xe))?P(xe+T):this.getAttribute("transform")}),X.attr("opacity",lBe).attr("transform",function(xe){var U=this.parentNode.__axis;return P((U&&isFinite(U=U(xe))?U:be(xe))+T)})),de.remove(),ne.attr("d",i===NY||i===bpe?b?"M"+_*b+","+oe+"H"+T+"V"+pe+"H"+_*b:"M"+T+","+oe+"V"+pe:b?"M"+oe+","+_*b+"V"+T+"H"+pe+"V"+_*b:"M"+oe+","+T+"H"+pe),se.attr("opacity",1).attr("transform",function(xe){return P(be(xe)+T)}),ge.attr(A+"2",_*v),W.attr(A,_*ee).text(K),ae.filter(tLt).attr("fill","none").attr("font-size",10).attr("font-family","sans-serif").attr("text-anchor",i===bpe?"start":i===NY?"end":"middle"),ae.each(function(){this.__axis=be})}return R.scale=function(F){return arguments.length?(s=F,R):s},R.ticks=function(){return u=Array.from(arguments),R},R.tickArguments=function(F){return arguments.length?(u=F==null?[]:Array.from(F),R):u.slice()},R.tickValues=function(F){return arguments.length?(d=F==null?null:Array.from(F),R):d&&d.slice()},R.tickFormat=function(F){return arguments.length?(p=F,R):p},R.tickSize=function(F){return arguments.length?(v=b=+F,R):v},R.tickSizeInner=function(F){return arguments.length?(v=+F,R):v},R.tickSizeOuter=function(F){return arguments.length?(b=+F,R):b},R.tickPadding=function(F){return arguments.length?(y=+F,R):y},R.offset=function(F){return arguments.length?(T=+F,R):T},R}function nLt(i){return hBe(OY,i)}function rLt(i){return hBe(mpe,i)}var iLt={value:()=>{}};function fBe(){for(var i=0,s=arguments.length,u={},d;i<s;++i){if(!(d=arguments[i]+"")||d in u||/[\s.]/.test(d))throw new Error("illegal type: "+d);u[d]=[]}return new PY(u)}function PY(i){this._=i}function sLt(i,s){return i.trim().split(/^|\s+/).map(function(u){var d="",p=u.indexOf(".");if(p>=0&&(d=u.slice(p+1),u=u.slice(0,p)),u&&!s.hasOwnProperty(u))throw new Error("unknown type: "+u);return{type:u,name:d}})}PY.prototype=fBe.prototype={constructor:PY,on:function(i,s){var u=this._,d=sLt(i+"",u),p,v=-1,b=d.length;if(arguments.length<2){for(;++v<b;)if((p=(i=d[v]).type)&&(p=aLt(u[p],i.name)))return p;return}if(s!=null&&typeof s!="function")throw new Error("invalid callback: "+s);for(;++v<b;)if(p=(i=d[v]).type)u[p]=dBe(u[p],i.name,s);else if(s==null)for(p in u)u[p]=dBe(u[p],i.name,null);return this},copy:function(){var i={},s=this._;for(var u in s)i[u]=s[u].slice();return new PY(i)},call:function(i,s){if((p=arguments.length-2)>0)for(var u=new Array(p),d=0,p,v;d<p;++d)u[d]=arguments[d+2];if(!this._.hasOwnProperty(i))throw new Error("unknown type: "+i);for(v=this._[i],d=0,p=v.length;d<p;++d)v[d].value.apply(s,u)},apply:function(i,s,u){if(!this._.hasOwnProperty(i))throw new Error("unknown type: "+i);for(var d=this._[i],p=0,v=d.length;p<v;++p)d[p].value.apply(s,u)}};function aLt(i,s){for(var u=0,d=i.length,p;u<d;++u)if((p=i[u]).name===s)return p.value}function dBe(i,s,u){for(var d=0,p=i.length;d<p;++d)if(i[d].name===s){i[d]=iLt,i=i.slice(0,d).concat(i.slice(d+1));break}return u!=null&&i.push({name:s,value:u}),i}var vpe="http://www.w3.org/1999/xhtml";const gBe={svg:"http://www.w3.org/2000/svg",xhtml:vpe,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function BY(i){var s=i+="",u=s.indexOf(":");return u>=0&&(s=i.slice(0,u))!=="xmlns"&&(i=i.slice(u+1)),gBe.hasOwnProperty(s)?{space:gBe[s],local:i}:i}function oLt(i){return function(){var s=this.ownerDocument,u=this.namespaceURI;return u===vpe&&s.documentElement.namespaceURI===vpe?s.createElement(i):s.createElementNS(u,i)}}function cLt(i){return function(){return this.ownerDocument.createElementNS(i.space,i.local)}}function pBe(i){var s=BY(i);return(s.local?cLt:oLt)(s)}function uLt(){}function wpe(i){return i==null?uLt:function(){return this.querySelector(i)}}function lLt(i){typeof i!="function"&&(i=wpe(i));for(var s=this._groups,u=s.length,d=new Array(u),p=0;p<u;++p)for(var v=s[p],b=v.length,y=d[p]=new Array(b),T,_,A=0;A<b;++A)(T=v[A])&&(_=i.call(T,T.__data__,A,v))&&("__data__"in T&&(_.__data__=T.__data__),y[A]=_);return new xp(d,this._parents)}function bBe(i){return i==null?[]:Array.isArray(i)?i:Array.from(i)}function hLt(){return[]}function mBe(i){return i==null?hLt:function(){return this.querySelectorAll(i)}}function fLt(i){return function(){return bBe(i.apply(this,arguments))}}function dLt(i){typeof i=="function"?i=fLt(i):i=mBe(i);for(var s=this._groups,u=s.length,d=[],p=[],v=0;v<u;++v)for(var b=s[v],y=b.length,T,_=0;_<y;++_)(T=b[_])&&(d.push(i.call(T,T.__data__,_,b)),p.push(T));return new xp(d,p)}function vBe(i){return function(){return this.matches(i)}}function wBe(i){return function(s){return s.matches(i)}}var gLt=Array.prototype.find;function pLt(i){return function(){return gLt.call(this.children,i)}}function bLt(){return this.firstElementChild}function mLt(i){return this.select(i==null?bLt:pLt(typeof i=="function"?i:wBe(i)))}var vLt=Array.prototype.filter;function wLt(){return Array.from(this.children)}function yLt(i){return function(){return vLt.call(this.children,i)}}function xLt(i){return this.selectAll(i==null?wLt:yLt(typeof i=="function"?i:wBe(i)))}function kLt(i){typeof i!="function"&&(i=vBe(i));for(var s=this._groups,u=s.length,d=new Array(u),p=0;p<u;++p)for(var v=s[p],b=v.length,y=d[p]=[],T,_=0;_<b;++_)(T=v[_])&&i.call(T,T.__data__,_,v)&&y.push(T);return new xp(d,this._parents)}function yBe(i){return new Array(i.length)}function ELt(){return new xp(this._enter||this._groups.map(yBe),this._parents)}function FY(i,s){this.ownerDocument=i.ownerDocument,this.namespaceURI=i.namespaceURI,this._next=null,this._parent=i,this.__data__=s}FY.prototype={constructor:FY,appendChild:function(i){return this._parent.insertBefore(i,this._next)},insertBefore:function(i,s){return this._parent.insertBefore(i,s)},querySelector:function(i){return this._parent.querySelector(i)},querySelectorAll:function(i){return this._parent.querySelectorAll(i)}};function TLt(i){return function(){return i}}function CLt(i,s,u,d,p,v){for(var b=0,y,T=s.length,_=v.length;b<_;++b)(y=s[b])?(y.__data__=v[b],d[b]=y):u[b]=new FY(i,v[b]);for(;b<T;++b)(y=s[b])&&(p[b]=y)}function SLt(i,s,u,d,p,v,b){var y,T,_=new Map,A=s.length,P=v.length,R=new Array(A),F;for(y=0;y<A;++y)(T=s[y])&&(R[y]=F=b.call(T,T.__data__,y,s)+"",_.has(F)?p[y]=T:_.set(F,T));for(y=0;y<P;++y)F=b.call(i,v[y],y,v)+"",(T=_.get(F))?(d[y]=T,T.__data__=v[y],_.delete(F)):u[y]=new FY(i,v[y]);for(y=0;y<A;++y)(T=s[y])&&_.get(R[y])===T&&(p[y]=T)}function _Lt(i){return i.__data__}function ALt(i,s){if(!arguments.length)return Array.from(this,_Lt);var u=s?SLt:CLt,d=this._parents,p=this._groups;typeof i!="function"&&(i=TLt(i));for(var v=p.length,b=new Array(v),y=new Array(v),T=new Array(v),_=0;_<v;++_){var A=d[_],P=p[_],R=P.length,F=LLt(i.call(A,A&&A.__data__,_,d)),j=F.length,K=y[_]=new Array(j),ee=b[_]=new Array(j),ie=T[_]=new Array(R);u(A,P,K,ee,ie,F,s);for(var oe=0,pe=0,be,ae;oe<j;++oe)if(be=K[oe]){for(oe>=pe&&(pe=oe+1);!(ae=ee[pe])&&++pe<j;);be._next=ae||null}}return b=new xp(b,d),b._enter=y,b._exit=T,b}function LLt(i){return typeof i=="object"&&"length"in i?i:Array.from(i)}function MLt(){return new xp(this._exit||this._groups.map(yBe),this._parents)}function DLt(i,s,u){var d=this.enter(),p=this,v=this.exit();return typeof i=="function"?(d=i(d),d&&(d=d.selection())):d=d.append(i+""),s!=null&&(p=s(p),p&&(p=p.selection())),u==null?v.remove():u(v),d&&p?d.merge(p).order():p}function ILt(i){for(var s=i.selection?i.selection():i,u=this._groups,d=s._groups,p=u.length,v=d.length,b=Math.min(p,v),y=new Array(p),T=0;T<b;++T)for(var _=u[T],A=d[T],P=_.length,R=y[T]=new Array(P),F,j=0;j<P;++j)(F=_[j]||A[j])&&(R[j]=F);for(;T<p;++T)y[T]=u[T];return new xp(y,this._parents)}function OLt(){for(var i=this._groups,s=-1,u=i.length;++s<u;)for(var d=i[s],p=d.length-1,v=d[p],b;--p>=0;)(b=d[p])&&(v&&b.compareDocumentPosition(v)^4&&v.parentNode.insertBefore(b,v),v=b);return this}function NLt(i){i||(i=PLt);function s(P,R){return P&&R?i(P.__data__,R.__data__):!P-!R}for(var u=this._groups,d=u.length,p=new Array(d),v=0;v<d;++v){for(var b=u[v],y=b.length,T=p[v]=new Array(y),_,A=0;A<y;++A)(_=b[A])&&(T[A]=_);T.sort(s)}return new xp(p,this._parents).order()}function PLt(i,s){return i<s?-1:i>s?1:i>=s?0:NaN}function BLt(){var i=arguments[0];return arguments[0]=this,i.apply(null,arguments),this}function FLt(){return Array.from(this)}function RLt(){for(var i=this._groups,s=0,u=i.length;s<u;++s)for(var d=i[s],p=0,v=d.length;p<v;++p){var b=d[p];if(b)return b}return null}function jLt(){let i=0;for(const s of this)++i;return i}function $Lt(){return!this.node()}function zLt(i){for(var s=this._groups,u=0,d=s.length;u<d;++u)for(var p=s[u],v=0,b=p.length,y;v<b;++v)(y=p[v])&&i.call(y,y.__data__,v,p);return this}function qLt(i){return function(){this.removeAttribute(i)}}function HLt(i){return function(){this.removeAttributeNS(i.space,i.local)}}function VLt(i,s){return function(){this.setAttribute(i,s)}}function ULt(i,s){return function(){this.setAttributeNS(i.space,i.local,s)}}function GLt(i,s){return function(){var u=s.apply(this,arguments);u==null?this.removeAttribute(i):this.setAttribute(i,u)}}function KLt(i,s){return function(){var u=s.apply(this,arguments);u==null?this.removeAttributeNS(i.space,i.local):this.setAttributeNS(i.space,i.local,u)}}function WLt(i,s){var u=BY(i);if(arguments.length<2){var d=this.node();return u.local?d.getAttributeNS(u.space,u.local):d.getAttribute(u)}return this.each((s==null?u.local?HLt:qLt:typeof s=="function"?u.local?KLt:GLt:u.local?ULt:VLt)(u,s))}function xBe(i){return i.ownerDocument&&i.ownerDocument.defaultView||i.document&&i||i.defaultView}function YLt(i){return function(){this.style.removeProperty(i)}}function XLt(i,s,u){return function(){this.style.setProperty(i,s,u)}}function QLt(i,s,u){return function(){var d=s.apply(this,arguments);d==null?this.style.removeProperty(i):this.style.setProperty(i,d,u)}}function JLt(i,s,u){return arguments.length>1?this.each((s==null?YLt:typeof s=="function"?QLt:XLt)(i,s,u??"")):ZM(this.node(),i)}function ZM(i,s){return i.style.getPropertyValue(s)||xBe(i).getComputedStyle(i,null).getPropertyValue(s)}function ZLt(i){return function(){delete this[i]}}function eMt(i,s){return function(){this[i]=s}}function tMt(i,s){return function(){var u=s.apply(this,arguments);u==null?delete this[i]:this[i]=u}}function nMt(i,s){return arguments.length>1?this.each((s==null?ZLt:typeof s=="function"?tMt:eMt)(i,s)):this.node()[i]}function kBe(i){return i.trim().split(/^|\s+/)}function ype(i){return i.classList||new EBe(i)}function EBe(i){this._node=i,this._names=kBe(i.getAttribute("class")||"")}EBe.prototype={add:function(i){var s=this._names.indexOf(i);s<0&&(this._names.push(i),this._node.setAttribute("class",this._names.join(" ")))},remove:function(i){var s=this._names.indexOf(i);s>=0&&(this._names.splice(s,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(i){return this._names.indexOf(i)>=0}};function TBe(i,s){for(var u=ype(i),d=-1,p=s.length;++d<p;)u.add(s[d])}function CBe(i,s){for(var u=ype(i),d=-1,p=s.length;++d<p;)u.remove(s[d])}function rMt(i){return function(){TBe(this,i)}}function iMt(i){return function(){CBe(this,i)}}function sMt(i,s){return function(){(s.apply(this,arguments)?TBe:CBe)(this,i)}}function aMt(i,s){var u=kBe(i+"");if(arguments.length<2){for(var d=ype(this.node()),p=-1,v=u.length;++p<v;)if(!d.contains(u[p]))return!1;return!0}return this.each((typeof s=="function"?sMt:s?rMt:iMt)(u,s))}function oMt(){this.textContent=""}function cMt(i){return function(){this.textContent=i}}function uMt(i){return function(){var s=i.apply(this,arguments);this.textContent=s??""}}function lMt(i){return arguments.length?this.each(i==null?oMt:(typeof i=="function"?uMt:cMt)(i)):this.node().textContent}function hMt(){this.innerHTML=""}function fMt(i){return function(){this.innerHTML=i}}function dMt(i){return function(){var s=i.apply(this,arguments);this.innerHTML=s??""}}function gMt(i){return arguments.length?this.each(i==null?hMt:(typeof i=="function"?dMt:fMt)(i)):this.node().innerHTML}function pMt(){this.nextSibling&&this.parentNode.appendChild(this)}function bMt(){return this.each(pMt)}function mMt(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function vMt(){return this.each(mMt)}function wMt(i){var s=typeof i=="function"?i:pBe(i);return this.select(function(){return this.appendChild(s.apply(this,arguments))})}function yMt(){return null}function xMt(i,s){var u=typeof i=="function"?i:pBe(i),d=s==null?yMt:typeof s=="function"?s:wpe(s);return this.select(function(){return this.insertBefore(u.apply(this,arguments),d.apply(this,arguments)||null)})}function kMt(){var i=this.parentNode;i&&i.removeChild(this)}function EMt(){return this.each(kMt)}function TMt(){var i=this.cloneNode(!1),s=this.parentNode;return s?s.insertBefore(i,this.nextSibling):i}function CMt(){var i=this.cloneNode(!0),s=this.parentNode;return s?s.insertBefore(i,this.nextSibling):i}function SMt(i){return this.select(i?CMt:TMt)}function _Mt(i){return arguments.length?this.property("__data__",i):this.node().__data__}function AMt(i){return function(s){i.call(this,s,this.__data__)}}function LMt(i){return i.trim().split(/^|\s+/).map(function(s){var u="",d=s.indexOf(".");return d>=0&&(u=s.slice(d+1),s=s.slice(0,d)),{type:s,name:u}})}function MMt(i){return function(){var s=this.__on;if(s){for(var u=0,d=-1,p=s.length,v;u<p;++u)v=s[u],(!i.type||v.type===i.type)&&v.name===i.name?this.removeEventListener(v.type,v.listener,v.options):s[++d]=v;++d?s.length=d:delete this.__on}}}function DMt(i,s,u){return function(){var d=this.__on,p,v=AMt(s);if(d){for(var b=0,y=d.length;b<y;++b)if((p=d[b]).type===i.type&&p.name===i.name){this.removeEventListener(p.type,p.listener,p.options),this.addEventListener(p.type,p.listener=v,p.options=u),p.value=s;return}}this.addEventListener(i.type,v,u),p={type:i.type,name:i.name,value:s,listener:v,options:u},d?d.push(p):this.__on=[p]}}function IMt(i,s,u){var d=LMt(i+""),p,v=d.length,b;if(arguments.length<2){var y=this.node().__on;if(y){for(var T=0,_=y.length,A;T<_;++T)for(p=0,A=y[T];p<v;++p)if((b=d[p]).type===A.type&&b.name===A.name)return A.value}return}for(y=s?DMt:MMt,p=0;p<v;++p)this.each(y(d[p],s,u));return this}function SBe(i,s,u){var d=xBe(i),p=d.CustomEvent;typeof p=="function"?p=new p(s,u):(p=d.document.createEvent("Event"),u?(p.initEvent(s,u.bubbles,u.cancelable),p.detail=u.detail):p.initEvent(s,!1,!1)),i.dispatchEvent(p)}function OMt(i,s){return function(){return SBe(this,i,s)}}function NMt(i,s){return function(){return SBe(this,i,s.apply(this,arguments))}}function PMt(i,s){return this.each((typeof s=="function"?NMt:OMt)(i,s))}function*BMt(){for(var i=this._groups,s=0,u=i.length;s<u;++s)for(var d=i[s],p=0,v=d.length,b;p<v;++p)(b=d[p])&&(yield b)}var xpe=[null];function xp(i,s){this._groups=i,this._parents=s}function vF(){return new xp([[document.documentElement]],xpe)}function FMt(){return this}xp.prototype=vF.prototype={constructor:xp,select:lLt,selectAll:dLt,selectChild:mLt,selectChildren:xLt,filter:kLt,data:ALt,enter:ELt,exit:MLt,join:DLt,merge:ILt,selection:FMt,order:OLt,sort:NLt,call:BLt,nodes:FLt,node:RLt,size:jLt,empty:$Lt,each:zLt,attr:WLt,style:JLt,property:nMt,classed:aMt,text:lMt,html:gMt,raise:bMt,lower:vMt,append:wMt,insert:xMt,remove:EMt,clone:SMt,datum:_Mt,on:IMt,dispatch:PMt,[Symbol.iterator]:BMt};function Ir(i){return typeof i=="string"?new xp([[document.querySelector(i)]],[document.documentElement]):new xp([[i]],xpe)}function _Be(i){return typeof i=="string"?new xp([document.querySelectorAll(i)],[document.documentElement]):new xp([bBe(i)],xpe)}function wF(i,s,u){i.prototype=s.prototype=u,u.constructor=i}function RY(i,s){var u=Object.create(i.prototype);for(var d in s)u[d]=s[d];return u}function fC(){}var yF=.7,jY=1/yF,eD="\\s*([+-]?\\d+)\\s*",xF="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",R4="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",RMt=/^#([0-9a-f]{3,8})$/,jMt=new RegExp(`^rgb\\(${eD},${eD},${eD}\\)$`),$Mt=new RegExp(`^rgb\\(${R4},${R4},${R4}\\)$`),zMt=new RegExp(`^rgba\\(${eD},${eD},${eD},${xF}\\)$`),qMt=new RegExp(`^rgba\\(${R4},${R4},${R4},${xF}\\)$`),HMt=new RegExp(`^hsl\\(${xF},${R4},${R4}\\)$`),VMt=new RegExp(`^hsla\\(${xF},${R4},${R4},${xF}\\)$`),ABe={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};wF(fC,dC,{copy(i){return Object.assign(new this.constructor,this,i)},displayable(){return this.rgb().displayable()},hex:LBe,formatHex:LBe,formatHex8:UMt,formatHsl:GMt,formatRgb:MBe,toString:MBe});function LBe(){return this.rgb().formatHex()}function UMt(){return this.rgb().formatHex8()}function GMt(){return BBe(this).formatHsl()}function MBe(){return this.rgb().formatRgb()}function dC(i){var s,u;return i=(i+"").trim().toLowerCase(),(s=RMt.exec(i))?(u=s[1].length,s=parseInt(s[1],16),u===6?DBe(s):u===3?new Mg(s>>8&15|s>>4&240,s>>4&15|s&240,(s&15)<<4|s&15,1):u===8?$Y(s>>24&255,s>>16&255,s>>8&255,(s&255)/255):u===4?$Y(s>>12&15|s>>8&240,s>>8&15|s>>4&240,s>>4&15|s&240,((s&15)<<4|s&15)/255):null):(s=jMt.exec(i))?new Mg(s[1],s[2],s[3],1):(s=$Mt.exec(i))?new Mg(s[1]*255/100,s[2]*255/100,s[3]*255/100,1):(s=zMt.exec(i))?$Y(s[1],s[2],s[3],s[4]):(s=qMt.exec(i))?$Y(s[1]*255/100,s[2]*255/100,s[3]*255/100,s[4]):(s=HMt.exec(i))?PBe(s[1],s[2]/100,s[3]/100,1):(s=VMt.exec(i))?PBe(s[1],s[2]/100,s[3]/100,s[4]):ABe.hasOwnProperty(i)?DBe(ABe[i]):i==="transparent"?new Mg(NaN,NaN,NaN,0):null}function DBe(i){return new Mg(i>>16&255,i>>8&255,i&255,1)}function $Y(i,s,u,d){return d<=0&&(i=s=u=NaN),new Mg(i,s,u,d)}function IBe(i){return i instanceof fC||(i=dC(i)),i?(i=i.rgb(),new Mg(i.r,i.g,i.b,i.opacity)):new Mg}function kpe(i,s,u,d){return arguments.length===1?IBe(i):new Mg(i,s,u,d??1)}function Mg(i,s,u,d){this.r=+i,this.g=+s,this.b=+u,this.opacity=+d}wF(Mg,kpe,RY(fC,{brighter(i){return i=i==null?jY:Math.pow(jY,i),new Mg(this.r*i,this.g*i,this.b*i,this.opacity)},darker(i){return i=i==null?yF:Math.pow(yF,i),new Mg(this.r*i,this.g*i,this.b*i,this.opacity)},rgb(){return this},clamp(){return new Mg(gC(this.r),gC(this.g),gC(this.b),zY(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:OBe,formatHex:OBe,formatHex8:KMt,formatRgb:NBe,toString:NBe}));function OBe(){return`#${pC(this.r)}${pC(this.g)}${pC(this.b)}`}function KMt(){return`#${pC(this.r)}${pC(this.g)}${pC(this.b)}${pC((isNaN(this.opacity)?1:this.opacity)*255)}`}function NBe(){const i=zY(this.opacity);return`${i===1?"rgb(":"rgba("}${gC(this.r)}, ${gC(this.g)}, ${gC(this.b)}${i===1?")":`, ${i})`}`}function zY(i){return isNaN(i)?1:Math.max(0,Math.min(1,i))}function gC(i){return Math.max(0,Math.min(255,Math.round(i)||0))}function pC(i){return i=gC(i),(i<16?"0":"")+i.toString(16)}function PBe(i,s,u,d){return d<=0?i=s=u=NaN:u<=0||u>=1?i=s=NaN:s<=0&&(i=NaN),new A3(i,s,u,d)}function BBe(i){if(i instanceof A3)return new A3(i.h,i.s,i.l,i.opacity);if(i instanceof fC||(i=dC(i)),!i)return new A3;if(i instanceof A3)return i;i=i.rgb();var s=i.r/255,u=i.g/255,d=i.b/255,p=Math.min(s,u,d),v=Math.max(s,u,d),b=NaN,y=v-p,T=(v+p)/2;return y?(s===v?b=(u-d)/y+(u<d)*6:u===v?b=(d-s)/y+2:b=(s-u)/y+4,y/=T<.5?v+p:2-v-p,b*=60):y=T>0&&T<1?0:b,new A3(b,y,T,i.opacity)}function WMt(i,s,u,d){return arguments.length===1?BBe(i):new A3(i,s,u,d??1)}function A3(i,s,u,d){this.h=+i,this.s=+s,this.l=+u,this.opacity=+d}wF(A3,WMt,RY(fC,{brighter(i){return i=i==null?jY:Math.pow(jY,i),new A3(this.h,this.s,this.l*i,this.opacity)},darker(i){return i=i==null?yF:Math.pow(yF,i),new A3(this.h,this.s,this.l*i,this.opacity)},rgb(){var i=this.h%360+(this.h<0)*360,s=isNaN(i)||isNaN(this.s)?0:this.s,u=this.l,d=u+(u<.5?u:1-u)*s,p=2*u-d;return new Mg(Epe(i>=240?i-240:i+120,p,d),Epe(i,p,d),Epe(i<120?i+240:i-120,p,d),this.opacity)},clamp(){return new A3(FBe(this.h),qY(this.s),qY(this.l),zY(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){const i=zY(this.opacity);return`${i===1?"hsl(":"hsla("}${FBe(this.h)}, ${qY(this.s)*100}%, ${qY(this.l)*100}%${i===1?")":`, ${i})`}`}}));function FBe(i){return i=(i||0)%360,i<0?i+360:i}function qY(i){return Math.max(0,Math.min(1,i||0))}function Epe(i,s,u){return(i<60?s+(u-s)*i/60:i<180?u:i<240?s+(u-s)*(240-i)/60:s)*255}const YMt=Math.PI/180,XMt=180/Math.PI,HY=18,RBe=.96422,jBe=1,$Be=.82521,zBe=4/29,tD=6/29,qBe=3*tD*tD,QMt=tD*tD*tD;function HBe(i){if(i instanceof j4)return new j4(i.l,i.a,i.b,i.opacity);if(i instanceof p7)return VBe(i);i instanceof Mg||(i=IBe(i));var s=_pe(i.r),u=_pe(i.g),d=_pe(i.b),p=Tpe((.2225045*s+.7168786*u+.0606169*d)/jBe),v,b;return s===u&&u===d?v=b=p:(v=Tpe((.4360747*s+.3850649*u+.1430804*d)/RBe),b=Tpe((.0139322*s+.0971045*u+.7141733*d)/$Be)),new j4(116*p-16,500*(v-p),200*(p-b),i.opacity)}function JMt(i,s,u,d){return arguments.length===1?HBe(i):new j4(i,s,u,d??1)}function j4(i,s,u,d){this.l=+i,this.a=+s,this.b=+u,this.opacity=+d}wF(j4,JMt,RY(fC,{brighter(i){return new j4(this.l+HY*(i??1),this.a,this.b,this.opacity)},darker(i){return new j4(this.l-HY*(i??1),this.a,this.b,this.opacity)},rgb(){var i=(this.l+16)/116,s=isNaN(this.a)?i:i+this.a/500,u=isNaN(this.b)?i:i-this.b/200;return s=RBe*Cpe(s),i=jBe*Cpe(i),u=$Be*Cpe(u),new Mg(Spe(3.1338561*s-1.6168667*i-.4906146*u),Spe(-.9787684*s+1.9161415*i+.033454*u),Spe(.0719453*s-.2289914*i+1.4052427*u),this.opacity)}}));function Tpe(i){return i>QMt?Math.pow(i,1/3):i/qBe+zBe}function Cpe(i){return i>tD?i*i*i:qBe*(i-zBe)}function Spe(i){return 255*(i<=.0031308?12.92*i:1.055*Math.pow(i,1/2.4)-.055)}function _pe(i){return(i/=255)<=.04045?i/12.92:Math.pow((i+.055)/1.055,2.4)}function ZMt(i){if(i instanceof p7)return new p7(i.h,i.c,i.l,i.opacity);if(i instanceof j4||(i=HBe(i)),i.a===0&&i.b===0)return new p7(NaN,0<i.l&&i.l<100?0:NaN,i.l,i.opacity);var s=Math.atan2(i.b,i.a)*XMt;return new p7(s<0?s+360:s,Math.sqrt(i.a*i.a+i.b*i.b),i.l,i.opacity)}function Ape(i,s,u,d){return arguments.length===1?ZMt(i):new p7(i,s,u,d??1)}function p7(i,s,u,d){this.h=+i,this.c=+s,this.l=+u,this.opacity=+d}function VBe(i){if(isNaN(i.h))return new j4(i.l,0,0,i.opacity);var s=i.h*YMt;return new j4(i.l,Math.cos(s)*i.c,Math.sin(s)*i.c,i.opacity)}wF(p7,Ape,RY(fC,{brighter(i){return new p7(this.h,this.c,this.l+HY*(i??1),this.opacity)},darker(i){return new p7(this.h,this.c,this.l-HY*(i??1),this.opacity)},rgb(){return VBe(this).rgb()}}));const VY=i=>()=>i;function UBe(i,s){return function(u){return i+u*s}}function eDt(i,s,u){return i=Math.pow(i,u),s=Math.pow(s,u)-i,u=1/u,function(d){return Math.pow(i+d*s,u)}}function tDt(i,s){var u=s-i;return u?UBe(i,u>180||u<-180?u-360*Math.round(u/360):u):VY(isNaN(i)?s:i)}function nDt(i){return(i=+i)==1?kF:function(s,u){return u-s?eDt(s,u,i):VY(isNaN(s)?u:s)}}function kF(i,s){var u=s-i;return u?UBe(i,u):VY(isNaN(i)?s:i)}const UY=function i(s){var u=nDt(s);function d(p,v){var b=u((p=kpe(p)).r,(v=kpe(v)).r),y=u(p.g,v.g),T=u(p.b,v.b),_=kF(p.opacity,v.opacity);return function(A){return p.r=b(A),p.g=y(A),p.b=T(A),p.opacity=_(A),p+""}}return d.gamma=i,d}(1);function rDt(i,s){s||(s=[]);var u=i?Math.min(s.length,i.length):0,d=s.slice(),p;return function(v){for(p=0;p<u;++p)d[p]=i[p]*(1-v)+s[p]*v;return d}}function iDt(i){return ArrayBuffer.isView(i)&&!(i instanceof DataView)}function sDt(i,s){var u=s?s.length:0,d=i?Math.min(u,i.length):0,p=new Array(d),v=new Array(u),b;for(b=0;b<d;++b)p[b]=Dpe(i[b],s[b]);for(;b<u;++b)v[b]=s[b];return function(y){for(b=0;b<d;++b)v[b]=p[b](y);return v}}function aDt(i,s){var u=new Date;return i=+i,s=+s,function(d){return u.setTime(i*(1-d)+s*d),u}}function L3(i,s){return i=+i,s=+s,function(u){return i*(1-u)+s*u}}function oDt(i,s){var u={},d={},p;(i===null||typeof i!="object")&&(i={}),(s===null||typeof s!="object")&&(s={});for(p in s)p in i?u[p]=Dpe(i[p],s[p]):d[p]=s[p];return function(v){for(p in u)d[p]=u[p](v);return d}}var Lpe=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,Mpe=new RegExp(Lpe.source,"g");function cDt(i){return function(){return i}}function uDt(i){return function(s){return i(s)+""}}function GBe(i,s){var u=Lpe.lastIndex=Mpe.lastIndex=0,d,p,v,b=-1,y=[],T=[];for(i=i+"",s=s+"";(d=Lpe.exec(i))&&(p=Mpe.exec(s));)(v=p.index)>u&&(v=s.slice(u,v),y[b]?y[b]+=v:y[++b]=v),(d=d[0])===(p=p[0])?y[b]?y[b]+=p:y[++b]=p:(y[++b]=null,T.push({i:b,x:L3(d,p)})),u=Mpe.lastIndex;return u<s.length&&(v=s.slice(u),y[b]?y[b]+=v:y[++b]=v),y.length<2?T[0]?uDt(T[0].x):cDt(s):(s=T.length,function(_){for(var A=0,P;A<s;++A)y[(P=T[A]).i]=P.x(_);return y.join("")})}function Dpe(i,s){var u=typeof s,d;return s==null||u==="boolean"?VY(s):(u==="number"?L3:u==="string"?(d=dC(s))?(s=d,UY):GBe:s instanceof dC?UY:s instanceof Date?aDt:iDt(s)?rDt:Array.isArray(s)?sDt:typeof s.valueOf!="function"&&typeof s.toString!="function"||isNaN(s)?oDt:L3)(i,s)}function lDt(i,s){return i=+i,s=+s,function(u){return Math.round(i*(1-u)+s*u)}}var KBe=180/Math.PI,Ipe={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function WBe(i,s,u,d,p,v){var b,y,T;return(b=Math.sqrt(i*i+s*s))&&(i/=b,s/=b),(T=i*u+s*d)&&(u-=i*T,d-=s*T),(y=Math.sqrt(u*u+d*d))&&(u/=y,d/=y,T/=y),i*d<s*u&&(i=-i,s=-s,T=-T,b=-b),{translateX:p,translateY:v,rotate:Math.atan2(s,i)*KBe,skewX:Math.atan(T)*KBe,scaleX:b,scaleY:y}}var GY;function hDt(i){const s=new(typeof DOMMatrix=="function"?DOMMatrix:WebKitCSSMatrix)(i+"");return s.isIdentity?Ipe:WBe(s.a,s.b,s.c,s.d,s.e,s.f)}function fDt(i){return i==null||(GY||(GY=document.createElementNS("http://www.w3.org/2000/svg","g")),GY.setAttribute("transform",i),!(i=GY.transform.baseVal.consolidate()))?Ipe:(i=i.matrix,WBe(i.a,i.b,i.c,i.d,i.e,i.f))}function YBe(i,s,u,d){function p(_){return _.length?_.pop()+" ":""}function v(_,A,P,R,F,j){if(_!==P||A!==R){var K=F.push("translate(",null,s,null,u);j.push({i:K-4,x:L3(_,P)},{i:K-2,x:L3(A,R)})}else(P||R)&&F.push("translate("+P+s+R+u)}function b(_,A,P,R){_!==A?(_-A>180?A+=360:A-_>180&&(_+=360),R.push({i:P.push(p(P)+"rotate(",null,d)-2,x:L3(_,A)})):A&&P.push(p(P)+"rotate("+A+d)}function y(_,A,P,R){_!==A?R.push({i:P.push(p(P)+"skewX(",null,d)-2,x:L3(_,A)}):A&&P.push(p(P)+"skewX("+A+d)}function T(_,A,P,R,F,j){if(_!==P||A!==R){var K=F.push(p(F)+"scale(",null,",",null,")");j.push({i:K-4,x:L3(_,P)},{i:K-2,x:L3(A,R)})}else(P!==1||R!==1)&&F.push(p(F)+"scale("+P+","+R+")")}return function(_,A){var P=[],R=[];return _=i(_),A=i(A),v(_.translateX,_.translateY,A.translateX,A.translateY,P,R),b(_.rotate,A.rotate,P,R),y(_.skewX,A.skewX,P,R),T(_.scaleX,_.scaleY,A.scaleX,A.scaleY,P,R),_=A=null,function(F){for(var j=-1,K=R.length,ee;++j<K;)P[(ee=R[j]).i]=ee.x(F);return P.join("")}}}var dDt=YBe(hDt,"px, ","px)","deg)"),gDt=YBe(fDt,", ",")",")");function pDt(i){return function(s,u){var d=i((s=Ape(s)).h,(u=Ape(u)).h),p=kF(s.c,u.c),v=kF(s.l,u.l),b=kF(s.opacity,u.opacity);return function(y){return s.h=d(y),s.c=p(y),s.l=v(y),s.opacity=b(y),s+""}}}const bDt=pDt(tDt);var nD=0,EF=0,TF=0,XBe=1e3,KY,CF,WY=0,bC=0,YY=0,SF=typeof performance=="object"&&performance.now?performance:Date,QBe=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(i){setTimeout(i,17)};function Ope(){return bC||(QBe(mDt),bC=SF.now()+YY)}function mDt(){bC=0}function XY(){this._call=this._time=this._next=null}XY.prototype=JBe.prototype={constructor:XY,restart:function(i,s,u){if(typeof i!="function")throw new TypeError("callback is not a function");u=(u==null?Ope():+u)+(s==null?0:+s),!this._next&&CF!==this&&(CF?CF._next=this:KY=this,CF=this),this._call=i,this._time=u,Npe()},stop:function(){this._call&&(this._call=null,this._time=1/0,Npe())}};function JBe(i,s,u){var d=new XY;return d.restart(i,s,u),d}function vDt(){Ope(),++nD;for(var i=KY,s;i;)(s=bC-i._time)>=0&&i._call.call(void 0,s),i=i._next;--nD}function ZBe(){bC=(WY=SF.now())+YY,nD=EF=0;try{vDt()}finally{nD=0,yDt(),bC=0}}function wDt(){var i=SF.now(),s=i-WY;s>XBe&&(YY-=s,WY=i)}function yDt(){for(var i,s=KY,u,d=1/0;s;)s._call?(d>s._time&&(d=s._time),i=s,s=s._next):(u=s._next,s._next=null,s=i?i._next=u:KY=u);CF=i,Npe(d)}function Npe(i){if(!nD){EF&&(EF=clearTimeout(EF));var s=i-bC;s>24?(i<1/0&&(EF=setTimeout(ZBe,i-SF.now()-YY)),TF&&(TF=clearInterval(TF))):(TF||(WY=SF.now(),TF=setInterval(wDt,XBe)),nD=1,QBe(ZBe))}}function eFe(i,s,u){var d=new XY;return s=s==null?0:+s,d.restart(p=>{d.stop(),i(p+s)},s,u),d}var xDt=fBe("start","end","cancel","interrupt"),kDt=[],tFe=0,nFe=1,Ppe=2,QY=3,rFe=4,Bpe=5,JY=6;function ZY(i,s,u,d,p,v){var b=i.__transition;if(!b)i.__transition={};else if(u in b)return;EDt(i,u,{name:s,index:d,group:p,on:xDt,tween:kDt,time:v.time,delay:v.delay,duration:v.duration,ease:v.ease,timer:null,state:tFe})}function Fpe(i,s){var u=M3(i,s);if(u.state>tFe)throw new Error("too late; already scheduled");return u}function $4(i,s){var u=M3(i,s);if(u.state>QY)throw new Error("too late; already running");return u}function M3(i,s){var u=i.__transition;if(!u||!(u=u[s]))throw new Error("transition not found");return u}function EDt(i,s,u){var d=i.__transition,p;d[s]=u,u.timer=JBe(v,0,u.time);function v(_){u.state=nFe,u.timer.restart(b,u.delay,u.time),u.delay<=_&&b(_-u.delay)}function b(_){var A,P,R,F;if(u.state!==nFe)return T();for(A in d)if(F=d[A],F.name===u.name){if(F.state===QY)return eFe(b);F.state===rFe?(F.state=JY,F.timer.stop(),F.on.call("interrupt",i,i.__data__,F.index,F.group),delete d[A]):+A<s&&(F.state=JY,F.timer.stop(),F.on.call("cancel",i,i.__data__,F.index,F.group),delete d[A])}if(eFe(function(){u.state===QY&&(u.state=rFe,u.timer.restart(y,u.delay,u.time),y(_))}),u.state=Ppe,u.on.call("start",i,i.__data__,u.index,u.group),u.state===Ppe){for(u.state=QY,p=new Array(R=u.tween.length),A=0,P=-1;A<R;++A)(F=u.tween[A].value.call(i,i.__data__,u.index,u.group))&&(p[++P]=F);p.length=P+1}}function y(_){for(var A=_<u.duration?u.ease.call(null,_/u.duration):(u.timer.restart(T),u.state=Bpe,1),P=-1,R=p.length;++P<R;)p[P].call(i,A);u.state===Bpe&&(u.on.call("end",i,i.__data__,u.index,u.group),T())}function T(){u.state=JY,u.timer.stop(),delete d[s];for(var _ in d)return;delete i.__transition}}function TDt(i,s){var u=i.__transition,d,p,v=!0,b;if(u){s=s==null?null:s+"";for(b in u){if((d=u[b]).name!==s){v=!1;continue}p=d.state>Ppe&&d.state<Bpe,d.state=JY,d.timer.stop(),d.on.call(p?"interrupt":"cancel",i,i.__data__,d.index,d.group),delete u[b]}v&&delete i.__transition}}function CDt(i){return this.each(function(){TDt(this,i)})}function SDt(i,s){var u,d;return function(){var p=$4(this,i),v=p.tween;if(v!==u){d=u=v;for(var b=0,y=d.length;b<y;++b)if(d[b].name===s){d=d.slice(),d.splice(b,1);break}}p.tween=d}}function _Dt(i,s,u){var d,p;if(typeof u!="function")throw new Error;return function(){var v=$4(this,i),b=v.tween;if(b!==d){p=(d=b).slice();for(var y={name:s,value:u},T=0,_=p.length;T<_;++T)if(p[T].name===s){p[T]=y;break}T===_&&p.push(y)}v.tween=p}}function ADt(i,s){var u=this._id;if(i+="",arguments.length<2){for(var d=M3(this.node(),u).tween,p=0,v=d.length,b;p<v;++p)if((b=d[p]).name===i)return b.value;return null}return this.each((s==null?SDt:_Dt)(u,i,s))}function Rpe(i,s,u){var d=i._id;return i.each(function(){var p=$4(this,d);(p.value||(p.value={}))[s]=u.apply(this,arguments)}),function(p){return M3(p,d).value[s]}}function iFe(i,s){var u;return(typeof s=="number"?L3:s instanceof dC?UY:(u=dC(s))?(s=u,UY):GBe)(i,s)}function LDt(i){return function(){this.removeAttribute(i)}}function MDt(i){return function(){this.removeAttributeNS(i.space,i.local)}}function DDt(i,s,u){var d,p=u+"",v;return function(){var b=this.getAttribute(i);return b===p?null:b===d?v:v=s(d=b,u)}}function IDt(i,s,u){var d,p=u+"",v;return function(){var b=this.getAttributeNS(i.space,i.local);return b===p?null:b===d?v:v=s(d=b,u)}}function ODt(i,s,u){var d,p,v;return function(){var b,y=u(this),T;return y==null?void this.removeAttribute(i):(b=this.getAttribute(i),T=y+"",b===T?null:b===d&&T===p?v:(p=T,v=s(d=b,y)))}}function NDt(i,s,u){var d,p,v;return function(){var b,y=u(this),T;return y==null?void this.removeAttributeNS(i.space,i.local):(b=this.getAttributeNS(i.space,i.local),T=y+"",b===T?null:b===d&&T===p?v:(p=T,v=s(d=b,y)))}}function PDt(i,s){var u=BY(i),d=u==="transform"?gDt:iFe;return this.attrTween(i,typeof s=="function"?(u.local?NDt:ODt)(u,d,Rpe(this,"attr."+i,s)):s==null?(u.local?MDt:LDt)(u):(u.local?IDt:DDt)(u,d,s))}function BDt(i,s){return function(u){this.setAttribute(i,s.call(this,u))}}function FDt(i,s){return function(u){this.setAttributeNS(i.space,i.local,s.call(this,u))}}function RDt(i,s){var u,d;function p(){var v=s