@asyncapi/studio
Version:
One place that allows you to develop an AsyncAPI document, validate it, convert it to the latest version, preview the documentation and visualize the events flow.
1 lines • 493 kB
JavaScript
exports.id=2258,exports.ids=[2258],exports.modules={74547:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.BLANK_URL=e.relativeFirstCharacters=e.whitespaceEscapeCharsRegex=e.urlSchemeRegex=e.ctrlCharactersRegex=e.htmlCtrlEntityRegex=e.htmlEntitiesRegex=e.invalidProtocolRegex=void 0,e.invalidProtocolRegex=/^([^\w]*)(javascript|data|vbscript)/im,e.htmlEntitiesRegex=/&#(\w+)(^\w|;)?/g,e.htmlCtrlEntityRegex=/&(newline|tab);/gi,e.ctrlCharactersRegex=/[\u0000-\u001F\u007F-\u009F\u2000-\u200D\uFEFF]/gim,e.urlSchemeRegex=/^.+(:|:)/gim,e.whitespaceEscapeCharsRegex=/(\\|%5[cC])((%(6[eE]|72|74))|[nrt])/g,e.relativeFirstCharacters=[".","/"],e.BLANK_URL="about:blank"},84414:(t,e,r)=>{"use strict";e.N=function(t){if(!t)return i.BLANK_URL;var e,r=a(t.trim());do e=(r=a(r=r.replace(i.ctrlCharactersRegex,"").replace(i.htmlEntitiesRegex,function(t,e){return String.fromCharCode(e)}).replace(i.htmlCtrlEntityRegex,"").replace(i.ctrlCharactersRegex,"").replace(i.whitespaceEscapeCharsRegex,"").trim())).match(i.ctrlCharactersRegex)||r.match(i.htmlEntitiesRegex)||r.match(i.htmlCtrlEntityRegex)||r.match(i.whitespaceEscapeCharsRegex);while(e&&e.length>0);var n=r;if(!n)return i.BLANK_URL;if(i.relativeFirstCharacters.indexOf(n[0])>-1)return n;var o=n.trimStart(),s=o.match(i.urlSchemeRegex);if(!s)return n;var l=s[0].toLowerCase().trim();if(i.invalidProtocolRegex.test(l))return i.BLANK_URL;var h=o.replace(/\\/g,"/");if("mailto:"===l||l.includes("://"))return h;if("http:"===l||"https:"===l){if(!URL.canParse(h))return i.BLANK_URL;var c=new URL(h);return c.protocol=c.protocol.toLowerCase(),c.hostname=c.hostname.toLowerCase(),c.toString()}return h};var i=r(74547);function a(t){try{return decodeURIComponent(t)}catch(e){return t}}},60211:function(t){var e;e=function(){"use strict";var t="millisecond",e="second",r="minute",i="hour",a="week",n="month",o="quarter",s="year",l="date",h="Invalid Date",c=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,d=/\[([^\]]+)]|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,u=function(t,e,r){var i=String(t);return!i||i.length>=e?t:""+Array(e+1-i.length).join(r)+t},p="en",f={};f[p]={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(t){var e=["th","st","nd","rd"],r=t%100;return"["+t+(e[(r-20)%10]||e[r]||"th")+"]"}};var g="$isDayjsObject",y=function(t){return t instanceof k||!(!t||!t[g])},m=function t(e,r,i){var a;if(!e)return p;if("string"==typeof e){var n=e.toLowerCase();f[n]&&(a=n),r&&(f[n]=r,a=n);var o=e.split("-");if(!a&&o.length>1)return t(o[0])}else{var s=e.name;f[s]=e,a=s}return!i&&a&&(p=a),a||!i&&p},x=function(t,e){if(y(t))return t.clone();var r="object"==typeof e?e:{};return r.date=t,r.args=arguments,new k(r)},b={s:u,z:function(t){var e=-t.utcOffset(),r=Math.abs(e);return(e<=0?"+":"-")+u(Math.floor(r/60),2,"0")+":"+u(r%60,2,"0")},m:function t(e,r){if(e.date()<r.date())return-t(r,e);var i=12*(r.year()-e.year())+(r.month()-e.month()),a=e.clone().add(i,n),o=r-a<0,s=e.clone().add(i+(o?-1:1),n);return+(-(i+(r-a)/(o?a-s:s-a))||0)},a:function(t){return t<0?Math.ceil(t)||0:Math.floor(t)},p:function(h){return({M:n,y:s,w:a,d:"day",D:l,h:i,m:r,s:e,ms:t,Q:o})[h]||String(h||"").toLowerCase().replace(/s$/,"")},u:function(t){return void 0===t}};b.l=m,b.i=y,b.w=function(t,e){return x(t,{locale:e.$L,utc:e.$u,x:e.$x,$offset:e.$offset})};var k=function(){function u(t){this.$L=m(t.locale,null,!0),this.parse(t),this.$x=this.$x||t.x||{},this[g]=!0}var p=u.prototype;return p.parse=function(t){this.$d=function(t){var e=t.date,r=t.utc;if(null===e)return new Date(NaN);if(b.u(e))return new Date;if(e instanceof Date)return new Date(e);if("string"==typeof e&&!/Z$/i.test(e)){var i=e.match(c);if(i){var a=i[2]-1||0,n=(i[7]||"0").substring(0,3);return r?new Date(Date.UTC(i[1],a,i[3]||1,i[4]||0,i[5]||0,i[6]||0,n)):new Date(i[1],a,i[3]||1,i[4]||0,i[5]||0,i[6]||0,n)}}return new Date(e)}(t),this.init()},p.init=function(){var t=this.$d;this.$y=t.getFullYear(),this.$M=t.getMonth(),this.$D=t.getDate(),this.$W=t.getDay(),this.$H=t.getHours(),this.$m=t.getMinutes(),this.$s=t.getSeconds(),this.$ms=t.getMilliseconds()},p.$utils=function(){return b},p.isValid=function(){return this.$d.toString()!==h},p.isSame=function(t,e){var r=x(t);return this.startOf(e)<=r&&r<=this.endOf(e)},p.isAfter=function(t,e){return x(t)<this.startOf(e)},p.isBefore=function(t,e){return this.endOf(e)<x(t)},p.$g=function(t,e,r){return b.u(t)?this[e]:this.set(r,t)},p.unix=function(){return Math.floor(this.valueOf()/1e3)},p.valueOf=function(){return this.$d.getTime()},p.startOf=function(t,o){var h=this,c=!!b.u(o)||o,d=b.p(t),u=function(t,e){var r=b.w(h.$u?Date.UTC(h.$y,e,t):new Date(h.$y,e,t),h);return c?r:r.endOf("day")},p=function(t,e){return b.w(h.toDate()[t].apply(h.toDate("s"),(c?[0,0,0,0]:[23,59,59,999]).slice(e)),h)},f=this.$W,g=this.$M,y=this.$D,m="set"+(this.$u?"UTC":"");switch(d){case s:return c?u(1,0):u(31,11);case n:return c?u(1,g):u(0,g+1);case a:var x=this.$locale().weekStart||0,k=(f<x?f+7:f)-x;return u(c?y-k:y+(6-k),g);case"day":case l:return p(m+"Hours",0);case i:return p(m+"Minutes",1);case r:return p(m+"Seconds",2);case e:return p(m+"Milliseconds",3);default:return this.clone()}},p.endOf=function(t){return this.startOf(t,!1)},p.$set=function(a,o){var h,c=b.p(a),d="set"+(this.$u?"UTC":""),u=((h={}).day=d+"Date",h[l]=d+"Date",h[n]=d+"Month",h[s]=d+"FullYear",h[i]=d+"Hours",h[r]=d+"Minutes",h[e]=d+"Seconds",h[t]=d+"Milliseconds",h)[c],p="day"===c?this.$D+(o-this.$W):o;if(c===n||c===s){var f=this.clone().set(l,1);f.$d[u](p),f.init(),this.$d=f.set(l,Math.min(this.$D,f.daysInMonth())).$d}else u&&this.$d[u](p);return this.init(),this},p.set=function(t,e){return this.clone().$set(t,e)},p.get=function(t){return this[b.p(t)]()},p.add=function(t,o){var l,h=this;t=Number(t);var c=b.p(o),d=function(e){var r=x(h);return b.w(r.date(r.date()+Math.round(e*t)),h)};if(c===n)return this.set(n,this.$M+t);if(c===s)return this.set(s,this.$y+t);if("day"===c)return d(1);if(c===a)return d(7);var u=((l={})[r]=6e4,l[i]=36e5,l[e]=1e3,l)[c]||1,p=this.$d.getTime()+t*u;return b.w(p,this)},p.subtract=function(t,e){return this.add(-1*t,e)},p.format=function(t){var e=this,r=this.$locale();if(!this.isValid())return r.invalidDate||h;var i=t||"YYYY-MM-DDTHH:mm:ssZ",a=b.z(this),n=this.$H,o=this.$m,s=this.$M,l=r.weekdays,c=r.months,u=r.meridiem,p=function(t,r,a,n){return t&&(t[r]||t(e,i))||a[r].slice(0,n)},f=function(t){return b.s(n%12||12,t,"0")},g=u||function(t,e,r){var i=t<12?"AM":"PM";return r?i.toLowerCase():i};return i.replace(d,function(t,i){return i||function(t){switch(t){case"YY":return String(e.$y).slice(-2);case"YYYY":return b.s(e.$y,4,"0");case"M":return s+1;case"MM":return b.s(s+1,2,"0");case"MMM":return p(r.monthsShort,s,c,3);case"MMMM":return p(c,s);case"D":return e.$D;case"DD":return b.s(e.$D,2,"0");case"d":return String(e.$W);case"dd":return p(r.weekdaysMin,e.$W,l,2);case"ddd":return p(r.weekdaysShort,e.$W,l,3);case"dddd":return l[e.$W];case"H":return String(n);case"HH":return b.s(n,2,"0");case"h":return f(1);case"hh":return f(2);case"a":return g(n,o,!0);case"A":return g(n,o,!1);case"m":return String(o);case"mm":return b.s(o,2,"0");case"s":return String(e.$s);case"ss":return b.s(e.$s,2,"0");case"SSS":return b.s(e.$ms,3,"0");case"Z":return a}return null}(t)||a.replace(":","")})},p.utcOffset=function(){return-(15*Math.round(this.$d.getTimezoneOffset()/15))},p.diff=function(t,l,h){var c,d=this,u=b.p(l),p=x(t),f=(p.utcOffset()-this.utcOffset())*6e4,g=this-p,y=function(){return b.m(d,p)};switch(u){case s:c=y()/12;break;case n:c=y();break;case o:c=y()/3;break;case a:c=(g-f)/6048e5;break;case"day":c=(g-f)/864e5;break;case i:c=g/36e5;break;case r:c=g/6e4;break;case e:c=g/1e3;break;default:c=g}return h?c:b.a(c)},p.daysInMonth=function(){return this.endOf(n).$D},p.$locale=function(){return f[this.$L]},p.locale=function(t,e){if(!t)return this.$L;var r=this.clone(),i=m(t,e,!0);return i&&(r.$L=i),r},p.clone=function(){return b.w(this.$d,this)},p.toDate=function(){return new Date(this.valueOf())},p.toJSON=function(){return this.isValid()?this.toISOString():null},p.toISOString=function(){return this.$d.toISOString()},p.toString=function(){return this.$d.toUTCString()},u}(),C=k.prototype;return x.prototype=C,[["$ms",t],["$s",e],["$m",r],["$H",i],["$W","day"],["$M",n],["$y",s],["$D",l]].forEach(function(t){C[t[1]]=function(e){return this.$g(e,t[0],t[1])}}),x.extend=function(t,e){return t.$i||(t(e,k,x),t.$i=!0),x},x.locale=m,x.isDayjs=y,x.unix=function(t){return x(1e3*t)},x.en=f[p],x.Ls=f,x.p={},x},t.exports=e()},28646:(t,e,r)=>{"use strict";function i(t,e,r){if(t&&t.length){let[i,a]=e,n=Math.PI/180*r,o=Math.cos(n),s=Math.sin(n);for(let e of t){let[t,r]=e;e[0]=(t-i)*o-(r-a)*s+i,e[1]=(t-i)*s+(r-a)*o+a}}}function a(t,e){var r;let a=e.hachureAngle+90,n=e.hachureGap;n<0&&(n=4*e.strokeWidth),n=Math.round(Math.max(n,.1));let o=1;return e.roughness>=1&&((null===(r=e.randomizer)||void 0===r?void 0:r.next())||Math.random())>.7&&(o=n),function(t,e,r,a=1){let n=t[0]&&t[0][0]&&"number"==typeof t[0][0]?[t]:t,o=[0,0];if(r)for(let t of n)i(t,o,r);let s=function(t,e,r){let i=[];for(let e of t){var a,n;let t=[...e];a=t[0],n=t[t.length-1],a[0]===n[0]&&a[1]===n[1]||t.push([t[0][0],t[0][1]]),t.length>2&&i.push(t)}let o=[];e=Math.max(e,.1);let s=[];for(let t of i)for(let e=0;e<t.length-1;e++){let r=t[e],i=t[e+1];if(r[1]!==i[1]){let t=Math.min(r[1],i[1]);s.push({ymin:t,ymax:Math.max(r[1],i[1]),x:t===r[1]?r[0]:i[0],islope:(i[0]-r[0])/(i[1]-r[1])})}}if(s.sort((t,e)=>t.ymin<e.ymin?-1:t.ymin>e.ymin?1:t.x<e.x?-1:t.x>e.x?1:t.ymax===e.ymax?0:(t.ymax-e.ymax)/Math.abs(t.ymax-e.ymax)),!s.length)return o;let l=[],h=s[0].ymin,c=0;for(;l.length||s.length;){if(s.length){let t=-1;for(let e=0;e<s.length&&!(s[e].ymin>h);e++)t=e;s.splice(0,t+1).forEach(t=>{l.push({s:h,edge:t})})}if((l=l.filter(t=>!(t.edge.ymax<=h))).sort((t,e)=>t.edge.x===e.edge.x?0:(t.edge.x-e.edge.x)/Math.abs(t.edge.x-e.edge.x)),(1!==r||c%e==0)&&l.length>1)for(let t=0;t<l.length;t+=2){let e=t+1;if(e>=l.length)break;let r=l[t].edge,i=l[e].edge;o.push([[Math.round(r.x),h],[Math.round(i.x),h]])}h+=r,l.forEach(t=>{t.edge.x=t.edge.x+r*t.edge.islope}),c++}return o}(n,Math.max(e,.1),a);if(r){for(let t of n)i(t,o,-r);!function(t,e,r){let a=[];t.forEach(t=>a.push(...t)),i(a,e,r)}(s,o,-r)}return s}(t,n,a,o||1)}r.d(e,{Z:()=>V});class n{constructor(t){this.helper=t}fillPolygons(t,e){return this._fillPolygons(t,e)}_fillPolygons(t,e){let r=a(t,e);return{type:"fillSketch",ops:this.renderLines(r,e)}}renderLines(t,e){let r=[];for(let i of t)r.push(...this.helper.doubleLineOps(i[0][0],i[0][1],i[1][0],i[1][1],e));return r}}function o(t){let e=t[0],r=t[1];return Math.sqrt(Math.pow(e[0]-r[0],2)+Math.pow(e[1]-r[1],2))}class s extends n{fillPolygons(t,e){let r=e.hachureGap;r<0&&(r=4*e.strokeWidth);let i=a(t,Object.assign({},e,{hachureGap:r=Math.max(r,.1)})),n=Math.PI/180*e.hachureAngle,s=[],l=.5*r*Math.cos(n),h=.5*r*Math.sin(n);for(let[t,e]of i)o([t,e])&&s.push([[t[0]-l,t[1]+h],[...e]],[[t[0]+l,t[1]-h],[...e]]);return{type:"fillSketch",ops:this.renderLines(s,e)}}}class l extends n{fillPolygons(t,e){let r=this._fillPolygons(t,e),i=Object.assign({},e,{hachureAngle:e.hachureAngle+90}),a=this._fillPolygons(t,i);return r.ops=r.ops.concat(a.ops),r}}class h{constructor(t){this.helper=t}fillPolygons(t,e){let r=a(t,e=Object.assign({},e,{hachureAngle:0}));return this.dotsOnLines(r,e)}dotsOnLines(t,e){let r=[],i=e.hachureGap;i<0&&(i=4*e.strokeWidth),i=Math.max(i,.1);let a=e.fillWeight;a<0&&(a=e.strokeWidth/2);let n=i/4;for(let s of t){let t=o(s),l=Math.ceil(t/i)-1,h=t-l*i,c=(s[0][0]+s[1][0])/2-i/4,d=Math.min(s[0][1],s[1][1]);for(let t=0;t<l;t++){let o=c-n+2*Math.random()*n,s=d+h+t*i-n+2*Math.random()*n,l=this.helper.ellipse(o,s,a,a,e);r.push(...l.ops)}}return{type:"fillSketch",ops:r}}}class c{constructor(t){this.helper=t}fillPolygons(t,e){let r=a(t,e);return{type:"fillSketch",ops:this.dashedLine(r,e)}}dashedLine(t,e){let r=e.dashOffset<0?e.hachureGap<0?4*e.strokeWidth:e.hachureGap:e.dashOffset,i=e.dashGap<0?e.hachureGap<0?4*e.strokeWidth:e.hachureGap:e.dashGap,a=[];return t.forEach(t=>{let n=o(t),s=Math.floor(n/(r+i)),l=(n+i-s*(r+i))/2,h=t[0],c=t[1];h[0]>c[0]&&(h=t[1],c=t[0]);let d=Math.atan((c[1]-h[1])/(c[0]-h[0]));for(let t=0;t<s;t++){let n=t*(r+i),o=n+r,s=[h[0]+n*Math.cos(d)+l*Math.cos(d),h[1]+n*Math.sin(d)+l*Math.sin(d)],c=[h[0]+o*Math.cos(d)+l*Math.cos(d),h[1]+o*Math.sin(d)+l*Math.sin(d)];a.push(...this.helper.doubleLineOps(s[0],s[1],c[0],c[1],e))}}),a}}class d{constructor(t){this.helper=t}fillPolygons(t,e){let r=e.hachureGap<0?4*e.strokeWidth:e.hachureGap,i=e.zigzagOffset<0?r:e.zigzagOffset,n=a(t,e=Object.assign({},e,{hachureGap:r+i}));return{type:"fillSketch",ops:this.zigzagLines(n,i,e)}}zigzagLines(t,e,r){let i=[];return t.forEach(t=>{let a=Math.round(o(t)/(2*e)),n=t[0],s=t[1];n[0]>s[0]&&(n=t[1],s=t[0]);let l=Math.atan((s[1]-n[1])/(s[0]-n[0]));for(let t=0;t<a;t++){let a=2*t*e,o=2*(t+1)*e,s=Math.sqrt(2*Math.pow(e,2)),h=[n[0]+a*Math.cos(l),n[1]+a*Math.sin(l)],c=[n[0]+o*Math.cos(l),n[1]+o*Math.sin(l)],d=[h[0]+s*Math.cos(l+Math.PI/4),h[1]+s*Math.sin(l+Math.PI/4)];i.push(...this.helper.doubleLineOps(h[0],h[1],d[0],d[1],r),...this.helper.doubleLineOps(d[0],d[1],c[0],c[1],r))}}),i}}let u={};class p{constructor(t){this.seed=t}next(){return this.seed?(2147483648-1&(this.seed=Math.imul(48271,this.seed)))/2147483648:Math.random()}}let f={A:7,a:7,C:6,c:6,H:1,h:1,L:2,l:2,M:2,m:2,Q:4,q:4,S:4,s:4,T:2,t:2,V:1,v:1,Z:0,z:0};function g(t){let e=[],r=function(t){let e=[];for(;""!==t;)if(t.match(/^([ \t\r\n,]+)/))t=t.substr(RegExp.$1.length);else if(t.match(/^([aAcChHlLmMqQsStTvVzZ])/))e[e.length]={type:0,text:RegExp.$1},t=t.substr(RegExp.$1.length);else{if(!t.match(/^(([-+]?[0-9]+(\.[0-9]*)?|[-+]?\.[0-9]+)([eE][-+]?[0-9]+)?)/))return[];e[e.length]={type:1,text:`${parseFloat(RegExp.$1)}`},t=t.substr(RegExp.$1.length)}return e[e.length]={type:2,text:""},e}(t),i="BOD",a=0,n=r[0];for(;2!==n.type;){let o=0,s=[];if("BOD"===i){if("M"!==n.text&&"m"!==n.text)return g("M0,0"+t);a++,o=f[n.text],i=n.text}else 1===n.type?o=f[i]:(a++,o=f[n.text],i=n.text);if(!(a+o<r.length))throw Error("Path data ended short");for(let t=a;t<a+o;t++){let e=r[t];if(1!==e.type)throw Error("Param not a number: "+i+","+e.text);s[s.length]=+e.text}if("number"!=typeof f[i])throw Error("Bad segment: "+i);{let t={key:i,data:s};e.push(t),a+=o,n=r[a],"M"===i&&(i="L"),"m"===i&&(i="l")}}return e}function y(t){let e=0,r=0,i=0,a=0,n=[];for(let{key:o,data:s}of t)switch(o){case"M":n.push({key:"M",data:[...s]}),[e,r]=s,[i,a]=s;break;case"m":e+=s[0],r+=s[1],n.push({key:"M",data:[e,r]}),i=e,a=r;break;case"L":n.push({key:"L",data:[...s]}),[e,r]=s;break;case"l":e+=s[0],r+=s[1],n.push({key:"L",data:[e,r]});break;case"C":n.push({key:"C",data:[...s]}),e=s[4],r=s[5];break;case"c":{let t=s.map((t,i)=>i%2?t+r:t+e);n.push({key:"C",data:t}),e=t[4],r=t[5];break}case"Q":n.push({key:"Q",data:[...s]}),e=s[2],r=s[3];break;case"q":{let t=s.map((t,i)=>i%2?t+r:t+e);n.push({key:"Q",data:t}),e=t[2],r=t[3];break}case"A":n.push({key:"A",data:[...s]}),e=s[5],r=s[6];break;case"a":e+=s[5],r+=s[6],n.push({key:"A",data:[s[0],s[1],s[2],s[3],s[4],e,r]});break;case"H":n.push({key:"H",data:[...s]}),e=s[0];break;case"h":e+=s[0],n.push({key:"H",data:[e]});break;case"V":n.push({key:"V",data:[...s]}),r=s[0];break;case"v":r+=s[0],n.push({key:"V",data:[r]});break;case"S":n.push({key:"S",data:[...s]}),e=s[2],r=s[3];break;case"s":{let t=s.map((t,i)=>i%2?t+r:t+e);n.push({key:"S",data:t}),e=t[2],r=t[3];break}case"T":n.push({key:"T",data:[...s]}),e=s[0],r=s[1];break;case"t":e+=s[0],r+=s[1],n.push({key:"T",data:[e,r]});break;case"Z":case"z":n.push({key:"Z",data:[]}),e=i,r=a}return n}function m(t){let e=[],r="",i=0,a=0,n=0,o=0,s=0,l=0;for(let{key:h,data:c}of t){switch(h){case"M":e.push({key:"M",data:[...c]}),[i,a]=c,[n,o]=c;break;case"C":e.push({key:"C",data:[...c]}),i=c[4],a=c[5],s=c[2],l=c[3];break;case"L":e.push({key:"L",data:[...c]}),[i,a]=c;break;case"H":i=c[0],e.push({key:"L",data:[i,a]});break;case"V":a=c[0],e.push({key:"L",data:[i,a]});break;case"S":{let t=0,n=0;"C"===r||"S"===r?(t=i+(i-s),n=a+(a-l)):(t=i,n=a),e.push({key:"C",data:[t,n,...c]}),s=c[0],l=c[1],i=c[2],a=c[3];break}case"T":{let[t,n]=c,o=0,h=0;"Q"===r||"T"===r?(o=i+(i-s),h=a+(a-l)):(o=i,h=a);let d=i+2*(o-i)/3,u=a+2*(h-a)/3,p=t+2*(o-t)/3,f=n+2*(h-n)/3;e.push({key:"C",data:[d,u,p,f,t,n]}),s=o,l=h,i=t,a=n;break}case"Q":{let[t,r,n,o]=c,h=i+2*(t-i)/3,d=a+2*(r-a)/3,u=n+2*(t-n)/3,p=o+2*(r-o)/3;e.push({key:"C",data:[h,d,u,p,n,o]}),s=t,l=r,i=n,a=o;break}case"A":{let t=Math.abs(c[0]),r=Math.abs(c[1]),n=c[2],o=c[3],s=c[4],l=c[5],h=c[6];0===t||0===r?(e.push({key:"C",data:[i,a,l,h,l,h]}),i=l,a=h):(i!==l||a!==h)&&((function t(e,r,i,a,n,o,s,l,h,c){let d=Math.PI*s/180,u=[],p=0,f=0,g=0,y=0;if(c)[p,f,g,y]=c;else{[e,r]=x(e,r,-d),[i,a]=x(i,a,-d);let t=(e-i)/2,s=(r-a)/2,c=t*t/(n*n)+s*s/(o*o);c>1&&(n*=c=Math.sqrt(c),o*=c);let u=n*n,m=o*o,b=(l===h?-1:1)*Math.sqrt(Math.abs((u*m-u*s*s-m*t*t)/(u*s*s+m*t*t)));g=b*n*s/o+(e+i)/2,y=-(b*o)*t/n+(r+a)/2,p=Math.asin(parseFloat(((r-y)/o).toFixed(9))),f=Math.asin(parseFloat(((a-y)/o).toFixed(9))),e<g&&(p=Math.PI-p),i<g&&(f=Math.PI-f),p<0&&(p=2*Math.PI+p),f<0&&(f=2*Math.PI+f),h&&p>f&&(p-=2*Math.PI),!h&&f>p&&(f-=2*Math.PI)}let m=f-p;if(Math.abs(m)>120*Math.PI/180){let e=f,r=i,l=a;u=t(i=g+n*Math.cos(f=h&&f>p?p+120*Math.PI/180*1:p+-(120*Math.PI/180*1)),a=y+o*Math.sin(f),r,l,n,o,s,0,h,[f,e,g,y])}m=f-p;let b=Math.cos(p),k=Math.cos(f),C=Math.tan(m/4),w=4/3*n*C,_=4/3*o*C,v=[e,r],T=[e+w*Math.sin(p),r-_*b],S=[i+w*Math.sin(f),a-_*k],M=[i,a];if(T[0]=2*v[0]-T[0],T[1]=2*v[1]-T[1],c)return[T,S,M].concat(u);{u=[T,S,M].concat(u);let t=[];for(let e=0;e<u.length;e+=3){let r=x(u[e][0],u[e][1],d),i=x(u[e+1][0],u[e+1][1],d),a=x(u[e+2][0],u[e+2][1],d);t.push([r[0],r[1],i[0],i[1],a[0],a[1]])}return t}})(i,a,l,h,t,r,n,o,s).forEach(function(t){e.push({key:"C",data:t})}),i=l,a=h);break}case"Z":e.push({key:"Z",data:[]}),i=n,a=o}r=h}return e}function x(t,e,r){return[t*Math.cos(r)-e*Math.sin(r),t*Math.sin(r)+e*Math.cos(r)]}let b={randOffset:function(t,e){return F(t,e)},randOffsetWithRange:function(t,e,r){return W(t,e,r)},ellipse:function(t,e,r,i,a){let n=_(r,i,a);return v(t,e,a,n).opset},doubleLineOps:function(t,e,r,i,a){return $(t,e,r,i,a,!0)}};function k(t,e,r,i,a){return{type:"path",ops:$(t,e,r,i,a)}}function C(t,e,r){let i=(t||[]).length;if(i>2){let a=[];for(let e=0;e<i-1;e++)a.push(...$(t[e][0],t[e][1],t[e+1][0],t[e+1][1],r));return e&&a.push(...$(t[i-1][0],t[i-1][1],t[0][0],t[0][1],r)),{type:"path",ops:a}}return 2===i?k(t[0][0],t[0][1],t[1][0],t[1][1],r):{type:"path",ops:[]}}function w(t,e){if(t.length){let r="number"==typeof t[0][0]?[t]:t,i=D(r[0],1*(1+.2*e.roughness),e),a=e.disableMultiStroke?[]:D(r[0],1.5*(1+.22*e.roughness),L(e));for(let t=1;t<r.length;t++){let n=r[t];if(n.length){let t=D(n,1*(1+.2*e.roughness),e),r=e.disableMultiStroke?[]:D(n,1.5*(1+.22*e.roughness),L(e));for(let e of t)"move"!==e.op&&i.push(e);for(let t of r)"move"!==t.op&&a.push(t)}}return{type:"path",ops:i.concat(a)}}return{type:"path",ops:[]}}function _(t,e,r){let i=Math.sqrt(2*Math.PI*Math.sqrt((Math.pow(t/2,2)+Math.pow(e/2,2))/2)),a=2*Math.PI/Math.ceil(Math.max(r.curveStepCount,r.curveStepCount/Math.sqrt(200)*i)),n=Math.abs(t/2),o=Math.abs(e/2),s=1-r.curveFitting;return n+=F(n*s,r),o+=F(o*s,r),{increment:a,rx:n,ry:o}}function v(t,e,r,i){let[a,n]=Z(i.increment,t,e,i.rx,i.ry,1,i.increment*W(.1,W(.4,1,r),r),r),o=O(a,null,r);if(!r.disableMultiStroke&&0!==r.roughness){let[a]=Z(i.increment,t,e,i.rx,i.ry,1.5,0,r),n=O(a,null,r);o=o.concat(n)}return{estimatedPoints:n,opset:{type:"path",ops:o}}}function T(t,e,r,i,a,n,o,s,l){let h=Math.abs(r/2),c=Math.abs(i/2);h+=F(.01*h,l),c+=F(.01*c,l);let d=a,u=n;for(;d<0;)d+=2*Math.PI,u+=2*Math.PI;u-d>2*Math.PI&&(d=0,u=2*Math.PI);let p=Math.min(2*Math.PI/l.curveStepCount/2,(u-d)/2),f=I(p,t,e,h,c,d,u,1,l);if(!l.disableMultiStroke){let r=I(p,t,e,h,c,d,u,1.5,l);f.push(...r)}return o&&(s?f.push(...$(t,e,t+h*Math.cos(d),e+c*Math.sin(d),l),...$(t,e,t+h*Math.cos(u),e+c*Math.sin(u),l)):f.push({op:"lineTo",data:[t,e]},{op:"lineTo",data:[t+h*Math.cos(d),e+c*Math.sin(d)]})),{type:"path",ops:f}}function S(t,e){let r=m(y(g(t))),i=[],a=[0,0],n=[0,0];for(let{key:t,data:o}of r)switch(t){case"M":n=[o[0],o[1]],a=[o[0],o[1]];break;case"L":i.push(...$(n[0],n[1],o[0],o[1],e)),n=[o[0],o[1]];break;case"C":{let[t,r,a,s,l,h]=o;i.push(...function(t,e,r,i,a,n,o,s){let l=[],h=[s.maxRandomnessOffset||1,(s.maxRandomnessOffset||1)+.3],c=[0,0],d=s.disableMultiStroke?1:2,u=s.preserveVertices;for(let p=0;p<d;p++)0===p?l.push({op:"move",data:[o[0],o[1]]}):l.push({op:"move",data:[o[0]+(u?0:F(h[0],s)),o[1]+(u?0:F(h[0],s))]}),c=u?[a,n]:[a+F(h[p],s),n+F(h[p],s)],l.push({op:"bcurveTo",data:[t+F(h[p],s),e+F(h[p],s),r+F(h[p],s),i+F(h[p],s),c[0],c[1]]});return l}(t,r,a,s,l,h,n,e)),n=[l,h];break}case"Z":i.push(...$(n[0],n[1],a[0],a[1],e)),n=[a[0],a[1]]}return{type:"path",ops:i}}function M(t,e){let r=[];for(let i of t)if(i.length){let t=e.maxRandomnessOffset||0,a=i.length;if(a>2){r.push({op:"move",data:[i[0][0]+F(t,e),i[0][1]+F(t,e)]});for(let n=1;n<a;n++)r.push({op:"lineTo",data:[i[n][0]+F(t,e),i[n][1]+F(t,e)]})}}return{type:"fillPath",ops:r}}function B(t,e){return(function(t,e){let r=t.fillStyle||"hachure";if(!u[r])switch(r){case"zigzag":u[r]||(u[r]=new s(e));break;case"cross-hatch":u[r]||(u[r]=new l(e));break;case"dots":u[r]||(u[r]=new h(e));break;case"dashed":u[r]||(u[r]=new c(e));break;case"zigzag-line":u[r]||(u[r]=new d(e));break;default:u[r="hachure"]||(u[r]=new n(e))}return u[r]})(e,b).fillPolygons(t,e)}function L(t){let e=Object.assign({},t);return e.randomizer=void 0,t.seed&&(e.seed=t.seed+1),e}function A(t){return t.randomizer||(t.randomizer=new p(t.seed||0)),t.randomizer.next()}function W(t,e,r,i=1){return r.roughness*i*(A(r)*(e-t)+t)}function F(t,e,r=1){return W(-t,t,e,r)}function $(t,e,r,i,a,n=!1){let o=n?a.disableMultiStrokeFill:a.disableMultiStroke,s=E(t,e,r,i,a,!0,!1);if(o)return s;let l=E(t,e,r,i,a,!0,!0);return s.concat(l)}function E(t,e,r,i,a,n,o){let s=Math.pow(t-r,2)+Math.pow(e-i,2),l=Math.sqrt(s),h=1;h=l<200?1:l>500?.4:-.0016668*l+1.233334;let c=a.maxRandomnessOffset||0;c*c*100>s&&(c=l/10);let d=c/2,u=.2+.2*A(a),p=a.bowing*a.maxRandomnessOffset*(i-e)/200,f=a.bowing*a.maxRandomnessOffset*(t-r)/200;p=F(p,a,h),f=F(f,a,h);let g=[],y=()=>F(d,a,h),m=()=>F(c,a,h),x=a.preserveVertices;return n&&(o?g.push({op:"move",data:[t+(x?0:y()),e+(x?0:y())]}):g.push({op:"move",data:[t+(x?0:F(c,a,h)),e+(x?0:F(c,a,h))]})),o?g.push({op:"bcurveTo",data:[p+t+(r-t)*u+y(),f+e+(i-e)*u+y(),p+t+2*(r-t)*u+y(),f+e+2*(i-e)*u+y(),r+(x?0:y()),i+(x?0:y())]}):g.push({op:"bcurveTo",data:[p+t+(r-t)*u+m(),f+e+(i-e)*u+m(),p+t+2*(r-t)*u+m(),f+e+2*(i-e)*u+m(),r+(x?0:m()),i+(x?0:m())]}),g}function D(t,e,r){if(!t.length)return[];let i=[];i.push([t[0][0]+F(e,r),t[0][1]+F(e,r)]),i.push([t[0][0]+F(e,r),t[0][1]+F(e,r)]);for(let a=1;a<t.length;a++)i.push([t[a][0]+F(e,r),t[a][1]+F(e,r)]),a===t.length-1&&i.push([t[a][0]+F(e,r),t[a][1]+F(e,r)]);return O(i,null,r)}function O(t,e,r){let i=t.length,a=[];if(i>3){let n=[],o=1-r.curveTightness;a.push({op:"move",data:[t[1][0],t[1][1]]});for(let e=1;e+2<i;e++){let r=t[e];n[0]=[r[0],r[1]],n[1]=[r[0]+(o*t[e+1][0]-o*t[e-1][0])/6,r[1]+(o*t[e+1][1]-o*t[e-1][1])/6],n[2]=[t[e+1][0]+(o*t[e][0]-o*t[e+2][0])/6,t[e+1][1]+(o*t[e][1]-o*t[e+2][1])/6],n[3]=[t[e+1][0],t[e+1][1]],a.push({op:"bcurveTo",data:[n[1][0],n[1][1],n[2][0],n[2][1],n[3][0],n[3][1]]})}if(e&&2===e.length){let t=r.maxRandomnessOffset;a.push({op:"lineTo",data:[e[0]+F(t,r),e[1]+F(t,r)]})}}else 3===i?(a.push({op:"move",data:[t[1][0],t[1][1]]}),a.push({op:"bcurveTo",data:[t[1][0],t[1][1],t[2][0],t[2][1],t[2][0],t[2][1]]})):2===i&&a.push(...E(t[0][0],t[0][1],t[1][0],t[1][1],r,!0,!0));return a}function Z(t,e,r,i,a,n,o,s){let l=[],h=[];if(0===s.roughness){t/=4,h.push([e+i*Math.cos(-t),r+a*Math.sin(-t)]);for(let n=0;n<=2*Math.PI;n+=t){let t=[e+i*Math.cos(n),r+a*Math.sin(n)];l.push(t),h.push(t)}h.push([e+1*i,r+0*a]),h.push([e+i*Math.cos(t),r+a*Math.sin(t)])}else{let c=F(.5,s)-Math.PI/2;h.push([F(n,s)+e+.9*i*Math.cos(c-t),F(n,s)+r+.9*a*Math.sin(c-t)]);let d=2*Math.PI+c-.01;for(let o=c;o<d;o+=t){let t=[F(n,s)+e+i*Math.cos(o),F(n,s)+r+a*Math.sin(o)];l.push(t),h.push(t)}h.push([F(n,s)+e+i*Math.cos(c+2*Math.PI+.5*o),F(n,s)+r+a*Math.sin(c+2*Math.PI+.5*o)]),h.push([F(n,s)+e+.98*i*Math.cos(c+o),F(n,s)+r+.98*a*Math.sin(c+o)]),h.push([F(n,s)+e+.9*i*Math.cos(c+.5*o),F(n,s)+r+.9*a*Math.sin(c+.5*o)])}return[h,l]}function I(t,e,r,i,a,n,o,s,l){let h=n+F(.1,l),c=[];c.push([F(s,l)+e+.9*i*Math.cos(h-t),F(s,l)+r+.9*a*Math.sin(h-t)]);for(let n=h;n<=o;n+=t)c.push([F(s,l)+e+i*Math.cos(n),F(s,l)+r+a*Math.sin(n)]);return c.push([e+i*Math.cos(o),r+a*Math.sin(o)]),c.push([e+i*Math.cos(o),r+a*Math.sin(o)]),O(c,null,l)}function q(t,e=0){let r=t.length;if(r<3)throw Error("A curve must have at least three points.");let i=[];if(3===r)i.push([...t[0]],[...t[1]],[...t[2]],[...t[2]]);else{let r=[];r.push(t[0],t[0]);for(let e=1;e<t.length;e++)r.push(t[e]),e===t.length-1&&r.push(t[e]);let a=[],n=1-e;i.push([...r[0]]);for(let t=1;t+2<r.length;t++){let e=r[t];a[0]=[e[0],e[1]],a[1]=[e[0]+(n*r[t+1][0]-n*r[t-1][0])/6,e[1]+(n*r[t+1][1]-n*r[t-1][1])/6],a[2]=[r[t+1][0]+(n*r[t][0]-n*r[t+2][0])/6,r[t+1][1]+(n*r[t][1]-n*r[t+2][1])/6],a[3]=[r[t+1][0],r[t+1][1]],i.push(a[1],a[2],a[3])}}return i}function R(t,e){return Math.pow(t[0]-e[0],2)+Math.pow(t[1]-e[1],2)}function N(t,e,r){return[t[0]+(e[0]-t[0])*r,t[1]+(e[1]-t[1])*r]}function z(t,e,r,i,a){let n=a||[],o=t[e],s=t[r-1],l=0,h=1;for(let i=e+1;i<r-1;++i){let e=function(t,e,r){let i=R(e,r);if(0===i)return R(t,e);let a=((t[0]-e[0])*(r[0]-e[0])+(t[1]-e[1])*(r[1]-e[1]))/i;return R(t,N(e,r,a=Math.max(0,Math.min(1,a))))}(t[i],o,s);e>l&&(l=e,h=i)}return Math.sqrt(l)>i?(z(t,e,h+1,i,n),z(t,h,r,i,n)):(n.length||n.push(o),n.push(s)),n}function P(t,e=.15,r){let i=[],a=(t.length-1)/3;for(let r=0;r<a;r++)!function t(e,r,i,a){let n=a||[];if(function(t,e){let r=t[e+0],i=t[e+1],a=t[e+2],n=t[e+3],o=3*i[0]-2*r[0]-n[0];o*=o;let s=3*i[1]-2*r[1]-n[1];s*=s;let l=3*a[0]-2*n[0]-r[0];l*=l;let h=3*a[1]-2*n[1]-r[1];return h*=h,o<l&&(o=l),s<h&&(s=h),o+s}(e,r)<i){let t=e[r+0];n.length?Math.sqrt(R(n[n.length-1],t))>1&&n.push(t):n.push(t),n.push(e[r+3])}else{let a=e[r+0],o=e[r+1],s=e[r+2],l=e[r+3],h=N(a,o,.5),c=N(o,s,.5),d=N(s,l,.5),u=N(h,c,.5),p=N(c,d,.5),f=N(u,p,.5);t([a,h,u,f],0,i,n),t([f,p,d,l],0,i,n)}return n}(t,3*r,e,i);return r&&r>0?z(i,0,i.length,r):i}let j="none";class U{constructor(t){this.defaultOptions={maxRandomnessOffset:2,roughness:1,bowing:1,stroke:"#000",strokeWidth:1,curveTightness:0,curveFitting:.95,curveStepCount:9,fillStyle:"hachure",fillWeight:-1,hachureAngle:-41,hachureGap:-1,dashOffset:-1,dashGap:-1,zigzagOffset:-1,seed:0,disableMultiStroke:!1,disableMultiStrokeFill:!1,preserveVertices:!1,fillShapeRoughnessGain:.8},this.config=t||{},this.config.options&&(this.defaultOptions=this._o(this.config.options))}static newSeed(){return Math.floor(2147483648*Math.random())}_o(t){return t?Object.assign({},this.defaultOptions,t):this.defaultOptions}_d(t,e,r){return{shape:t,sets:e||[],options:r||this.defaultOptions}}line(t,e,r,i,a){let n=this._o(a);return this._d("line",[k(t,e,r,i,n)],n)}rectangle(t,e,r,i,a){let n=this._o(a),o=[],s=C([[t,e],[t+r,e],[t+r,e+i],[t,e+i]],!0,n);if(n.fill){let a=[[t,e],[t+r,e],[t+r,e+i],[t,e+i]];"solid"===n.fillStyle?o.push(M([a],n)):o.push(B([a],n))}return n.stroke!==j&&o.push(s),this._d("rectangle",o,n)}ellipse(t,e,r,i,a){let n=this._o(a),o=[],s=_(r,i,n),l=v(t,e,n,s);if(n.fill){if("solid"===n.fillStyle){let r=v(t,e,n,s).opset;r.type="fillPath",o.push(r)}else o.push(B([l.estimatedPoints],n))}return n.stroke!==j&&o.push(l.opset),this._d("ellipse",o,n)}circle(t,e,r,i){let a=this.ellipse(t,e,r,r,i);return a.shape="circle",a}linearPath(t,e){let r=this._o(e);return this._d("linearPath",[C(t,!1,r)],r)}arc(t,e,r,i,a,n,o=!1,s){let l=this._o(s),h=[],c=T(t,e,r,i,a,n,o,!0,l);if(o&&l.fill){if("solid"===l.fillStyle){let o=Object.assign({},l);o.disableMultiStroke=!0;let s=T(t,e,r,i,a,n,!0,!1,o);s.type="fillPath",h.push(s)}else h.push(function(t,e,r,i,a,n,o){let s=Math.abs(r/2),l=Math.abs(i/2);s+=F(.01*s,o),l+=F(.01*l,o);let h=a,c=n;for(;h<0;)h+=2*Math.PI,c+=2*Math.PI;c-h>2*Math.PI&&(h=0,c=2*Math.PI);let d=(c-h)/o.curveStepCount,u=[];for(let r=h;r<=c;r+=d)u.push([t+s*Math.cos(r),e+l*Math.sin(r)]);return u.push([t+s*Math.cos(c),e+l*Math.sin(c)]),u.push([t,e]),B([u],o)}(t,e,r,i,a,n,l))}return l.stroke!==j&&h.push(c),this._d("arc",h,l)}curve(t,e){let r=this._o(e),i=[],a=w(t,r);if(r.fill&&r.fill!==j){if("solid"===r.fillStyle){let e=w(t,Object.assign(Object.assign({},r),{disableMultiStroke:!0,roughness:r.roughness?r.roughness+r.fillShapeRoughnessGain:0}));i.push({type:"fillPath",ops:this._mergedShape(e.ops)})}else{let e=[];if(t.length)for(let i of"number"==typeof t[0][0]?[t]:t)i.length<3?e.push(...i):3===i.length?e.push(...P(q([i[0],i[0],i[1],i[2]]),10,(1+r.roughness)/2)):e.push(...P(q(i),10,(1+r.roughness)/2));e.length&&i.push(B([e],r))}}return r.stroke!==j&&i.push(a),this._d("curve",i,r)}polygon(t,e){let r=this._o(e),i=[],a=C(t,!0,r);return r.fill&&("solid"===r.fillStyle?i.push(M([t],r)):i.push(B([t],r))),r.stroke!==j&&i.push(a),this._d("polygon",i,r)}path(t,e){let r=this._o(e),i=[];if(!t)return this._d("path",i,r);t=(t||"").replace(/\n/g," ").replace(/(-\s)/g,"-").replace("/(ss)/g"," ");let a=r.fill&&"transparent"!==r.fill&&r.fill!==j,n=r.stroke!==j,o=!!(r.simplification&&r.simplification<1),s=function(t,e,r){let i=m(y(g(t))),a=[],n=[],o=[0,0],s=[],l=()=>{s.length>=4&&n.push(...P(s,1)),s=[]},h=()=>{l(),n.length&&(a.push(n),n=[])};for(let{key:t,data:e}of i)switch(t){case"M":h(),o=[e[0],e[1]],n.push(o);break;case"L":l(),n.push([e[0],e[1]]);break;case"C":if(!s.length){let t=n.length?n[n.length-1]:o;s.push([t[0],t[1]])}s.push([e[0],e[1]]),s.push([e[2],e[3]]),s.push([e[4],e[5]]);break;case"Z":l(),n.push([o[0],o[1]])}if(h(),!r)return a;let c=[];for(let t of a){let e=z(t,0,t.length,r);e.length&&c.push(e)}return c}(t,0,o?4-4*(r.simplification||1):(1+r.roughness)/2),l=S(t,r);if(a){if("solid"===r.fillStyle){if(1===s.length){let e=S(t,Object.assign(Object.assign({},r),{disableMultiStroke:!0,roughness:r.roughness?r.roughness+r.fillShapeRoughnessGain:0}));i.push({type:"fillPath",ops:this._mergedShape(e.ops)})}else i.push(M(s,r))}else i.push(B(s,r))}return n&&(o?s.forEach(t=>{i.push(C(t,!1,r))}):i.push(l)),this._d("path",i,r)}opsToPath(t,e){let r="";for(let i of t.ops){let t="number"==typeof e&&e>=0?i.data.map(t=>+t.toFixed(e)):i.data;switch(i.op){case"move":r+=`M${t[0]} ${t[1]} `;break;case"bcurveTo":r+=`C${t[0]} ${t[1]}, ${t[2]} ${t[3]}, ${t[4]} ${t[5]} `;break;case"lineTo":r+=`L${t[0]} ${t[1]} `}}return r.trim()}toPaths(t){let e=t.sets||[],r=t.options||this.defaultOptions,i=[];for(let t of e){let e=null;switch(t.type){case"path":e={d:this.opsToPath(t),stroke:r.stroke,strokeWidth:r.strokeWidth,fill:j};break;case"fillPath":e={d:this.opsToPath(t),stroke:j,strokeWidth:0,fill:r.fill||j};break;case"fillSketch":e=this.fillSketch(t,r)}e&&i.push(e)}return i}fillSketch(t,e){let r=e.fillWeight;return r<0&&(r=e.strokeWidth/2),{d:this.opsToPath(t),stroke:e.fill||j,strokeWidth:r,fill:j}}_mergedShape(t){return t.filter((t,e)=>0===e||"move"!==t.op)}}class H{constructor(t,e){this.canvas=t,this.ctx=this.canvas.getContext("2d"),this.gen=new U(e)}draw(t){let e=t.sets||[],r=t.options||this.getDefaultOptions(),i=this.ctx,a=t.options.fixedDecimalPlaceDigits;for(let n of e)switch(n.type){case"path":i.save(),i.strokeStyle="none"===r.stroke?"transparent":r.stroke,i.lineWidth=r.strokeWidth,r.strokeLineDash&&i.setLineDash(r.strokeLineDash),r.strokeLineDashOffset&&(i.lineDashOffset=r.strokeLineDashOffset),this._drawToContext(i,n,a),i.restore();break;case"fillPath":{i.save(),i.fillStyle=r.fill||"";let e="curve"===t.shape||"polygon"===t.shape||"path"===t.shape?"evenodd":"nonzero";this._drawToContext(i,n,a,e),i.restore();break}case"fillSketch":this.fillSketch(i,n,r)}}fillSketch(t,e,r){let i=r.fillWeight;i<0&&(i=r.strokeWidth/2),t.save(),r.fillLineDash&&t.setLineDash(r.fillLineDash),r.fillLineDashOffset&&(t.lineDashOffset=r.fillLineDashOffset),t.strokeStyle=r.fill||"",t.lineWidth=i,this._drawToContext(t,e,r.fixedDecimalPlaceDigits),t.restore()}_drawToContext(t,e,r,i="nonzero"){for(let i of(t.beginPath(),e.ops)){let e="number"==typeof r&&r>=0?i.data.map(t=>+t.toFixed(r)):i.data;switch(i.op){case"move":t.moveTo(e[0],e[1]);break;case"bcurveTo":t.bezierCurveTo(e[0],e[1],e[2],e[3],e[4],e[5]);break;case"lineTo":t.lineTo(e[0],e[1])}}"fillPath"===e.type?t.fill(i):t.stroke()}get generator(){return this.gen}getDefaultOptions(){return this.gen.defaultOptions}line(t,e,r,i,a){let n=this.gen.line(t,e,r,i,a);return this.draw(n),n}rectangle(t,e,r,i,a){let n=this.gen.rectangle(t,e,r,i,a);return this.draw(n),n}ellipse(t,e,r,i,a){let n=this.gen.ellipse(t,e,r,i,a);return this.draw(n),n}circle(t,e,r,i){let a=this.gen.circle(t,e,r,i);return this.draw(a),a}linearPath(t,e){let r=this.gen.linearPath(t,e);return this.draw(r),r}polygon(t,e){let r=this.gen.polygon(t,e);return this.draw(r),r}arc(t,e,r,i,a,n,o=!1,s){let l=this.gen.arc(t,e,r,i,a,n,o,s);return this.draw(l),l}curve(t,e){let r=this.gen.curve(t,e);return this.draw(r),r}path(t,e){let r=this.gen.path(t,e);return this.draw(r),r}}let Y="http://www.w3.org/2000/svg";class G{constructor(t,e){this.svg=t,this.gen=new U(e)}draw(t){let e=t.sets||[],r=t.options||this.getDefaultOptions(),i=this.svg.ownerDocument||window.document,a=i.createElementNS(Y,"g"),n=t.options.fixedDecimalPlaceDigits;for(let o of e){let e=null;switch(o.type){case"path":(e=i.createElementNS(Y,"path")).setAttribute("d",this.opsToPath(o,n)),e.setAttribute("stroke",r.stroke),e.setAttribute("stroke-width",r.strokeWidth+""),e.setAttribute("fill","none"),r.strokeLineDash&&e.setAttribute("stroke-dasharray",r.strokeLineDash.join(" ").trim()),r.strokeLineDashOffset&&e.setAttribute("stroke-dashoffset",`${r.strokeLineDashOffset}`);break;case"fillPath":(e=i.createElementNS(Y,"path")).setAttribute("d",this.opsToPath(o,n)),e.setAttribute("stroke","none"),e.setAttribute("stroke-width","0"),e.setAttribute("fill",r.fill||""),"curve"!==t.shape&&"polygon"!==t.shape||e.setAttribute("fill-rule","evenodd");break;case"fillSketch":e=this.fillSketch(i,o,r)}e&&a.appendChild(e)}return a}fillSketch(t,e,r){let i=r.fillWeight;i<0&&(i=r.strokeWidth/2);let a=t.createElementNS(Y,"path");return a.setAttribute("d",this.opsToPath(e,r.fixedDecimalPlaceDigits)),a.setAttribute("stroke",r.fill||""),a.setAttribute("stroke-width",i+""),a.setAttribute("fill","none"),r.fillLineDash&&a.setAttribute("stroke-dasharray",r.fillLineDash.join(" ").trim()),r.fillLineDashOffset&&a.setAttribute("stroke-dashoffset",`${r.fillLineDashOffset}`),a}get generator(){return this.gen}getDefaultOptions(){return this.gen.defaultOptions}opsToPath(t,e){return this.gen.opsToPath(t,e)}line(t,e,r,i,a){let n=this.gen.line(t,e,r,i,a);return this.draw(n)}rectangle(t,e,r,i,a){let n=this.gen.rectangle(t,e,r,i,a);return this.draw(n)}ellipse(t,e,r,i,a){let n=this.gen.ellipse(t,e,r,i,a);return this.draw(n)}circle(t,e,r,i){let a=this.gen.circle(t,e,r,i);return this.draw(a)}linearPath(t,e){let r=this.gen.linearPath(t,e);return this.draw(r)}polygon(t,e){let r=this.gen.polygon(t,e);return this.draw(r)}arc(t,e,r,i,a,n,o=!1,s){let l=this.gen.arc(t,e,r,i,a,n,o,s);return this.draw(l)}curve(t,e){let r=this.gen.curve(t,e);return this.draw(r)}path(t,e){let r=this.gen.path(t,e);return this.draw(r)}}var V={canvas:(t,e)=>new H(t,e),svg:(t,e)=>new G(t,e),generator:t=>new U(t),newSeed:()=>U.newSeed()}},71760:(t,e,r)=>{"use strict";function i(t){for(var e=[],r=1;r<arguments.length;r++)e[r-1]=arguments[r];var i=Array.from("string"==typeof t?[t]:t);i[i.length-1]=i[i.length-1].replace(/\r?\n([\t ]*)$/,"");var a=i.reduce(function(t,e){var r=e.match(/\n([\t ]+|(?!\s).)/g);return r?t.concat(r.map(function(t){var e,r;return null!==(r=null===(e=t.match(/[\t ]/g))||void 0===e?void 0:e.length)&&void 0!==r?r:0})):t},[]);if(a.length){var n=RegExp("\n[ ]{"+Math.min.apply(Math,a)+"}","g");i=i.map(function(t){return t.replace(n,"\n")})}i[0]=i[0].replace(/^\r?\n/,"");var o=i[0];return e.forEach(function(t,e){var r=o.match(/(?:^|\n)( *)$/),a=r?r[1]:"",n=t;"string"==typeof t&&t.includes("\n")&&(n=String(t).split("\n").map(function(t,e){return 0===e?t:""+a+t}).join("\n")),o+=n+i[e+1]}),o}r.d(e,{Z:()=>i})},25329:(t,e,r)=>{"use strict";function i(t,e){let r;if(void 0===e)for(let e of t)null!=e&&(r<e||void 0===r&&e>=e)&&(r=e);else{let i=-1;for(let a of t)null!=(a=e(a,++i,t))&&(r<a||void 0===r&&a>=a)&&(r=a)}return r}function a(t,e){let r;if(void 0===e)for(let e of t)null!=e&&(r>e||void 0===r&&e>=e)&&(r=e);else{let i=-1;for(let a of t)null!=(a=e(a,++i,t))&&(r>a||void 0===r&&a>=a)&&(r=a)}return r}function n(t){return t}function o(t){return"translate("+t+",0)"}function s(t){return"translate(0,"+t+")"}function l(){return!this.__axis}function h(t,e){var r=[],i=null,a=null,h=6,c=6,d=3,u="undefined"!=typeof window&&window.devicePixelRatio>1?0:.5,p=1===t||4===t?-1:1,f=4===t||2===t?"x":"y",g=1===t||3===t?o:s;function y(o){var s=null==i?e.ticks?e.ticks.apply(e,r):e.domain():i,y=null==a?e.tickFormat?e.tickFormat.apply(e,r):n:a,m=Math.max(h,0)+d,x=e.range(),b=+x[0]+u,k=+x[x.length-1]+u,C=(e.bandwidth?function(t,e){return e=Math.max(0,t.bandwidth()-2*e)/2,t.round()&&(e=Math.round(e)),r=>+t(r)+e}:function(t){return e=>+t(e)})(e.copy(),u),w=o.selection?o.selection():o,_=w.selectAll(".domain").data([null]),v=w.selectAll(".tick").data(s,e).order(),T=v.exit(),S=v.enter().append("g").attr("class","tick"),M=v.select("line"),B=v.select("text");_=_.merge(_.enter().insert("path",".tick").attr("class","domain").attr("stroke","currentColor")),v=v.merge(S),M=M.merge(S.append("line").attr("stroke","currentColor").attr(f+"2",p*h)),B=B.merge(S.append("text").attr("fill","currentColor").attr(f,p*m).attr("dy",1===t?"0em":3===t?"0.71em":"0.32em")),o!==w&&(_=_.transition(o),v=v.transition(o),M=M.transition(o),B=B.transition(o),T=T.transition(o).attr("opacity",1e-6).attr("transform",function(t){return isFinite(t=C(t))?g(t+u):this.getAttribute("transform")}),S.attr("opacity",1e-6).attr("transform",function(t){var e=this.parentNode.__axis;return g((e&&isFinite(e=e(t))?e:C(t))+u)})),T.remove(),_.attr("d",4===t||2===t?c?"M"+p*c+","+b+"H"+u+"V"+k+"H"+p*c:"M"+u+","+b+"V"+k:c?"M"+b+","+p*c+"V"+u+"H"+k+"V"+p*c:"M"+b+","+u+"H"+k),v.attr("opacity",1).attr("transform",function(t){return g(C(t)+u)}),M.attr(f+"2",p*h),B.attr(f,p*m).text(y),w.filter(l).attr("fill","none").attr("font-size",10).attr("font-family","sans-serif").attr("text-anchor",2===t?"start":4===t?"end":"middle"),w.each(function(){this.__axis=C})}return y.scale=function(t){return arguments.length?(e=t,y):e},y.ticks=function(){return r=Array.from(arguments),y},y.tickArguments=function(t){return arguments.length?(r=null==t?[]:Array.from(t),y):r.slice()},y.tickValues=function(t){return arguments.length?(i=null==t?null:Array.from(t),y):i&&i.slice()},y.tickFormat=function(t){return arguments.length?(a=t,y):a},y.tickSize=function(t){return arguments.length?(h=c=+t,y):h},y.tickSizeInner=function(t){return arguments.length?(h=+t,y):h},y.tickSizeOuter=function(t){return arguments.length?(c=+t,y):c},y.tickPadding=function(t){return arguments.length?(d=+t,y):d},y.offset=function(t){return arguments.length?(u=+t,y):u},y}function c(t){return h(1,t)}function d(t){return h(3,t)}r.d(e,{Nb1:()=>r0,LLu:()=>d,F5q:()=>c,$0Z:()=>ii,Dts:()=>io,WQY:()=>il,qpX:()=>ic,u93:()=>id,tFB:()=>ip,YY7:()=>im,OvA:()=>ib,dCK:()=>iC,zgE:()=>iv,fGX:()=>iS,$m7:()=>iB,c_6:()=>r5,fxm:()=>iA,FdL:()=>iZ,ak_:()=>iI,SxZ:()=>iN,eA_:()=>iP,jsv:()=>iU,iJ:()=>ij,WUZ:()=>C,bT9:()=>E,JHv:()=>tc,jvg:()=>r4,Fp7:()=>i,VV$:()=>a,ve8:()=>r7,tiA:()=>function t(){var e,r,i=ty().unknown(void 0),a=i.domain,n=i.range,o=0,s=1,l=!1,h=0,c=0,d=.5;function u(){var t=a().length,i=s<o,u=i?s:o,p=i?o:s;e=(p-u)/Math.max(1,t-h+2*c),l&&(e=Math.floor(e)),u+=(p-u-e*(t-h))*d,r=e*(1-h),l&&(u=Math.round(u),r=Math.round(r));var f=(function(t,e,r){t=+t,e=+e,r=(a=arguments.length)<2?(e=t,t=0,1):a<3?1:+r;for(var i=-1,a=0|Math.max(0,Math.ceil((e-t)/r)),n=Array(a);++i<a;)n[i]=t+i*r;return n})(t).map(function(t){return u+e*t});return n(i?f.reverse():f)}return delete i.unknown,i.domain=function(t){return arguments.length?(a(t),u()):a()},i.range=function(t){return arguments.length?([o,s]=t,o=+o,s=+s,u()):[o,s]},i.rangeRound=function(t){return[o,s]=t,o=+o,s=+s,l=!0,u()},i.bandwidth=function(){return r},i.step=function(){return e},i.round=function(t){return arguments.length?(l=!!t,u()):l},i.padding=function(t){return arguments.length?(h=Math.min(1,c=+t),u()):h},i.paddingInner=function(t){return arguments.length?(h=Math.min(1,t),u()):h},i.paddingOuter=function(t){return arguments.length?(c=+t,u()):c},i.align=function(t){return arguments.length?(d=Math.max(0,Math.min(1,t)),u()):d},i.copy=function(){return t(a(),[o,s]).round(l).paddingInner(h).paddingOuter(c).align(d)},td.apply(u(),arguments)},BYU:()=>function t(){var e,r=tN();return r.copy=function(){return tR(r,t())},td.apply(r,arguments),e=r.domain,r.ticks=function(t){var r=e();return function(t,e,r){if(e=+e,t=+t,!((r=+r)>0))return[];if(t===e)return[t];let i=e<t,[a,n,o]=i?tk(e,t,r):tk(t,e,r);if(!(n>=a))return[];let s=n-a+1,l=Array(s);if(i){if(o<0)for(let t=0;t<s;++t)l[t]=-((n-t)/o);else for(let t=0;t<s;++t)l[t]=(n-t)*o}else if(o<0)for(let t=0;t<s;++t)l[t]=-((a+t)/o);else for(let t=0;t<s;++t)l[t]=(a+t)*o;return l}(r[0],r[r.length-1],null==t?10:t)},r.tickFormat=function(t,r){var i=e();return function(t,e,r,i){var a,n,o=tw(t,e,r);switch((i=S(null==i?",f":i)).type){case"s":var s=Math.max(Math.abs(t),Math.abs(e));return null!=i.precision||isNaN(n=Math.max(0,3*Math.max(-8,Math.min(8,Math.floor(x(s)/3)))-x(Math.abs(o))))||(i.precision=n),w(i,s);case"":case"e":case"g":case"p":case"r":null!=i.precision||isNaN(n=Math.max(0,x(Math.abs(Math.max(Math.abs(t),Math.abs(e)))-(a=Math.abs(a=o)))-x(a))+1)||(i.precision=n-("e"===i.type));break;case"f":case"%":null!=i.precision||isNaN(n=Math.max(0,-x(Math.abs(o))))||(i.precision=n-("%"===i.type)*2)}return C(i)}(i[0],i[i.length-1],null==t?10:t,r)},r.nice=function(t){null==t&&(t=10);var i,a,n=e(),o=0,s=n.length-1,l=n[o],h=n[s],c=10;for(h<l&&(a=l,l=h,h=a,a=o,o=s,s=a);c-- >0;){if((a=tC(l,h,t))===i)return n[o]=l,n[s]=h,e(n);if(a>0)l=Math.floor(l/a)*a,h=Math.ceil(h/a)*a;else if(a<0)l=Math.ceil(l*a)/a,h=Math.floor(h*a)/a;else break;i=a}return r},r},PKp:()=>ty,Xf:()=>rM,K2I:()=>rB,Ys:()=>rL.Z,rr1:()=>tQ,i$Z:()=>v,y2j:()=>t4,WQD:()=>tV,U8T:()=>tU,Z_i:()=>tY,Ox9:()=>t2,F0B:()=>eo,LqH:()=>t8,S1K:()=>tH,Zyz:()=>t1,Igq:()=>t6,YDX:()=>t5,EFj:()=>t3,pNI:()=>j}),r(49277);let{abs:u,max:p,min:f}=Math;function g(t){return[+t[0],+t[1]]}function y(t){return{type:t}}["w","e"].map(y),["n","s"].map(y),["n","w","e","s","nw","ne","sw","se"].map(y);function m(t,e){if(!isFinite(t)||0===t)return null;var r=(t=e?t.toExponential(e-1):t.toExponential()).indexOf("e"),i=t.slice(0,r);return[i.length>1?i[0]+i.slice(2):i,+t.slice(r+1)]}function x(t){return(t=m(Math.abs(t)))?t[1]:NaN}var b,k,C,w,_,v,T=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function S(t){var e;if(!(e=T.exec(t)))throw Error("invalid format: "+t);return new M({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]})}function M(t){this.fill=void 0===t.fill?" ":t.fill+"",this.align=void 0===t.align?">":t.align+"",this.sign=void 0===t.sign?"-":t.sign+"",this.symbol=void 0===t.symbol?"":t.symbol+"",this.zero=!!t.zero,this.width=void 0===t.width?void 0:+t.width,this.comma=!!t.comma,this.precision=void 0===t.precision?void 0:+t.precision,this.trim=!!t.trim,this.type=void 0===t.type?"":t.type+""}function B(t,e){var r=m(t,e);if(!r)return t+"";var i=r[0],a=r[1];return a<0?"0."+Array(-a).join("0")+i:i.length>a+1?i.slice(0,a+1)+"."+i.slice(a+1):i+Array(a-i.length+2).join("0")}S.prototype=M.prototype,M.prototype.toString=function(){return this.fill+this.align+this.sign+this.symbol+(this.zero?"0":"")+(void 0===this.width?"":Math.max(1,0|this.width))+(this.comma?",":"")+(void 0===this.precision?"":"."+Math.max(0,0|this.precision))+(this.trim?"~":"")+this.type};let L={"%":(t,e)=>(100*t).toFixed(e),b:t=>Math.round(t).toString(2),c:t=>t+"",d:function(t){return Math.abs(t=Math.round(t))>=1e21?t.toLocaleString("en").replace(/,/g,""):t.toString(10)},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)=>B(100*t,e),r:B,s:function(t,e){var r=m(t,e);if(!r)return b=void 0,t.toPrecision(e);var i=r[0],a=r[1],n=a-(b=3*Math.max(-8,Math.min(8,Math.floor(a/3))))+1,o=i.length;return n===o?i:n>o?i+Array(n-o+1).join("0"):n>0?i.slice(0,n)+"."+i.slice(n):"0."+Array(1-n).join("0")+m(t,Math.max(0,e+n-1))[0]},X:t=>Math.round(t).toString(16).toUpperCase(),x:t=>Math.round(t).toString(16)};function A(t){return t}var W=Array.prototype.map,F=["y","z","a","f","p","n","\xb5","m","","k","M","G","T","P","E","Z","Y"];function $(t){var e=0,r=t.children,i=r&&r.length;if(i)for(;--i>=0;)e+=r[i].value;else e=1;t.value=e}function E(t,e){t instanceof Map?(t=[void 0,t],void 0===e&&(e=O)):void 0===e&&(e=D);for(var r,i,a,n,o,s=new q(t),l=[s];r=l.pop();)if((a=e(r.data))&&(o=(a=Array.from(a)).length))for(r.children=a,n=o-1;n>=0;--n)l.push(i=a[n]=new q(a[n])),i.parent=r,i.depth=r.depth+1;return s.eachBefore(I)}function D(t){return t.children}function O(t){return Array.isArray(t)?t[1]:null}function Z(t){void 0!==t.data.value&&(t.value=t.data.value),t.data=t.data.data}function I(t){var e=0;do t.height=e;while((t=t.parent)&&t.height<++e)}function q(t){this.data=t,this.depth=this.height=0,this.parent=null}function R(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)}C=(k=function(t){var e,r,i,a=void 0===t.grouping||void 0===t.thousands?A:(e=W.call(t.grouping,Number),r=t.thousands+"",function(t,i){for(var a=t.length,n=[],o=0,s=e[0],l=0;a>0&&s>0&&(l+s+1>i&&(s=Math.max(1,i-l)),n.push(t.substring(a-=s,a+s)),!((l+=s+1)>i));)s=e[o=(o+1)%e.length];return n.reverse().join(r)}),n=void 0===t.currency?"":t.currency[0]+"",o=void 0===t.currency?"":t.currency[1]+"",s=void 0===t.decimal?".":t.decimal+"",l=void 0===t.numerals?A:(i=W.call(t.numerals,String),function(t){return t.replace(/[0-9]/g,function(t){return i[+t]})}),h=void 0===t.percent?"%":t.percent+"",c=void 0===t.minus?"−":t.minus+"",d=void 0===t.nan?"NaN":t.nan+"";function u(t,e){var r=(t=S(t)).fill,i=t.align,u=t.sign,p=t.symbol,f=t.zero,g=t.width,y=t.comma,m=t.precision,x=t.trim,k=t.type;"n"===k?(y=!0,k="g"):L[k]||(void 0===m&&(m=12),x=!0,k="g"),(f||"0"===r&&"="===i)&&(f=!0,r="0",i="=");var C=(e&&void 0!==e.prefix?e.prefix:"")+("$"===p?n:"#"===p&&/[boxX]/.test(k)?"0"+k.toLowerCase():""),w=("$"===p?o:/[%p]/.test(k)?h:"")+(e&&void 0!==e.suffix?e.suffix:""),_=L[k],v=/[defgprs%]/.test(k);function T(t){var e,n,o,h=C,p=w;if("c"===k)p=_(t)+p,t="";else{var T=(t=+t)<0||1/t<0;if(t=isNaN(t)?d:_(Math.abs(t),m),x&&(t=function(t){t:for(var e,r=t.length,i=1,a=-1;i<r;++i)switch(t[i]){case".":a=e=i;break;case"0":0===a&&(a=i),e=i;break;default:if(!+t[i])break t;a>0&&(a=0)}return a>0?t.slice(0,a)+t.slice(e+1):t}(t)),T&&0==+t&&"+"!==u&&(T=!1),h=(T?"("===u?u:c:"-"===u||"("===u?"":u)+h,p=("s"!==k||isNaN(t)||void 0===b?"":F[8+b/3])+p+(T&&"("===u?")":""),v){for(e=-1,n=t.length;++e<n;)if(48>(o=t.charCodeAt(e))||o>57){p=(46===o?s+t.slice(e+1):t.slice(e))+p,t=t.slice(0,e);break}}}y&&!f&&(t=a(t,1/0));var S=h.length+t.length+p.length,M=S<g?Array(g-S+1).join(r):"";switch(y&&f&&(t=a(M+t,M.length?g-p.length:1/0),M=""),i){case"<":t=h+t+p+M;break;case"=":t=h+M+t+p;break;case"^":t=M.slice(0,S=M.length>>1)+h+t+p+M.slice(S);break;default:t=M+h+t+p}return l(t)}return m=void 0===m?6:/[gprs]/.test(k)?Math.max(1,Math.min(21,m)):Math.max(0,Math.min(20,m)),T.toString=function(){return t+""},T}return{format:u,formatPrefix:function(t,e){var r=3*Math.max(-8,Math.min(8,Math.floor(x(e)/3))),i=Math.pow(10,-r),a=u(((t=S(t)).type="f",t),{suffix:F[8+r/3]});return function(t){return a(i*t)}}}}({thousands:",",grouping:[3],currency:["$",""]})).format,w=k.formatPrefix,q.prototype=E.prototype={constructor:q,count:function(){return this.eachAfter($)},each:function(t,e){let r=-1;for(let i of this)t.call(e,i,++r,this);return this},eachAfter:function(t,e){for(var r,i,a,n=this,o=[n],s=[],l=-1;n=o.pop();)if(s.push(n),r=n.children)for(i=0,a=r.length;i<a;++i)o.push(r[i]);for(;n=s.pop();)t.call(e,n,++l,this);return this},eachBefore:function(t,e){for(var r,i,a=this,n=[a],o=-1;a=n.pop();)if(t.call(e,a,++o,this),r=a.children)for(i=r.length-1;i>=0;--i)n.push(r[i]);return this},find:function(t,e){let r=-1;for(let i of this)if(t.call(e,i,++r,this))return i},sum:function(t){return this.eachAfter(function(e){for(var r=+t(e.data)||0,i=e.children,a=i&&i.length;--a>=0;)r+=i[a].value;e.value=r})},sort:function(t){return this.eachBefore(function(e){e.children&&e.children.sort(t)})},path:function(t){for(var e=this,r=function(t,e){if(t===e)return t;var r=t.ancestors(),i=e.ancestors(),a=null;for(t=r.pop(),e=i.pop();t===e;)a=t,t=r.pop(),e=i.pop();return a}(e,t),i=[e];e!==r;)i.push(e=e.parent);for(var a=i.length;t!==r;)i.splice(a,0,t),t=t.parent;return i},ancestors:function(){for(var t=this,e=[t];t=t.parent;)e.push(t);return e},descendants:function(){return Array.from(this)},leaves:function(){var t=[];return this.eachBefore(function(e){e.children||t.push(e)}),t},links:function(){var t=this,e=[];return t.each(function(r){r!==t&&e.push({source:r.parent,target:r})}),e},copy:function(){return E(this).eachBefore(Z)},[Symbol.iterator]:function*(){var t,e,r,i,a=this,n=[a];do for(t=n.reverse(),n=[];a=t.pop();)if(yield a,e=a.children)for(r=0,i=e.length;r<i;++r)n.push(e[r]);while(n.length)}};let N=function t(e){function r(t,r,i,a,n){!function(t,e,r,i,a,n){for(var o,s,l,h,c,d,u,p,f,g,y,m=[],x=e.children,b=0,k=0,C=x.length,w=e.value;b<C;)