1import{r as I,a3 as $,a2 as Lt,Z as g,aC as B,aD as fn,p as de,aE as Xe,f as Lr,Y as U,aF as Pr,aG as Ir}from"./vendor-mui-BWh-6WAH.js";import{L as Pt,F as dn,N as Fr,O as Gr,U as Ht,r as Ke,D as pn,M as xt,A as Nt,o as Ye,a as je,v as Wn,k as Vn,e as Xn,P as Br,n as qr,q as Hr,u as Ur,z as Wr,C as Vr,d as Xr,T as Kr,Q as Yr}from"./index-Df_dD346.js";import{A as jr}from"./Alert-BAw8wunK.js";import{M as Qr}from"./ManageTabs-DB8fsbbu.js";import{T as Zr}from"./TwoColumnBox-HLeEW0cA.js";import{B as Jr}from"./BreadCrumbs-BK-2gjVo.js";import{S as ti}from"./Select-BWSf6Xh4.js";import{D as ei}from"./DataTable-DudIJPjE.js";import{S as ni}from"./vendor-sweetalert2-CokzRhbv.js";import{S as mn,D as gn,T as ri}from"./InputFields-CYxZ5HcB.js";import{H as ii,m as ai,p as oi}from"./Autocomplete-CFu4FUqx.js";import{R as yn}from"./ChipsArray-CRgOwOBY.js";import{g as si,a as li}from"./__commonjsHelpers__-BosuxZz1.js";import"./vendor-mui-datatables-5emXELfe.js";import"./index.es-CLmToPHp.js";import"./CheckBox-BcghMeM6.js";const ve="tagTable",_n="tagView",vn="tagEdit",ui=[{id:"1",name:"All Generations"},{id:"2",name:"Generation 1"},{id:"3",name:"Generation 2"},{id:"4",name:"Generation 3"},{id:"5",name:"Generation 4"},{id:"6",name:"Generation 5"}],Kn="SWITCH_TABS",Yn="FETCH_DATA";function wn(t){return{type:Kn,payload:t}}function rt(t){return{type:Yn,payload:t}}const ci="_group_v8sqb_1",hi="_label_v8sqb_7",fi="_cell_v8sqb_11",di="_list_v8sqb_19",pt={group:ci,label:hi,cell:fi,list:di};function pi(){const t=I.useContext(gt),{state:e,dispatch:n}=t,{tableData:r}=e.manageTags,[i,a]=I.useState([]);I.useEffect(()=>{r.gen===0?a(r.tags):a(r.tags.filter(c=>Number(c.gen)===r.gen))},[r.gen]);const o=c=>{n(rt({...e,manageTags:{...e.manageTags,tableData:{...r,gen:c-1}}}))},l=c=>{if(!c)return g("div",{className:pt.cell,children:"N/A"});const f=c.split(","),h=f.slice(0,4);return f.length>h.length&&h.push("..."),g("ul",{className:pt.list,children:h.map((d,x)=>g("li",{children:d},x))})},u=(c,f="30px")=>g("div",{style:{color:"white",paddingRight:f},children:c.label}),s=[{label:"Tag",name:"displayName",options:{customBodyRender:c=>g("div",{className:pt.cell,children:c}),customHeadLabelRender:u}},{label:"Keywords",name:"keywords",options:{customBodyRender:l,customHeadLabelRender:u}},{label:"Immediate Parent",name:"parentDisplayName",options:{customBodyRender:c=>g("div",{className:pt.cell,children:c||"N/A"}),customHeadLabelRender:u}},{label:"Immediate Child",name:"children",options:{customBodyRender:l,customHeadLabelRender:u}},{label:"Problems",name:"problemCount",options:{customBodyRender:c=>g("div",{className:pt.cell,children:c}),customHeadLabelRender:u}},{label:"Contests",name:"contestCount",options:{customBodyRender:c=>g("div",{className:pt.cell,children:c}),customHeadLabelRender:u}},{label:"View",name:"tag",options:{customBodyRender:c=>g(Pt,{to:`/manage/tags/${c}`,style:{padding:"5px"},children:g(dn,{icon:Fr})}),customHeadLabelRender:c=>u(c,"10px"),sort:!1}},{label:"Edit",name:"tag",options:{customBodyRender:c=>g(Pt,{to:`/manage/tags/${c}/edit`,style:{padding:"5px"},children:g(dn,{icon:Gr})}),customHeadLabelRender:c=>u(c,"10px"),sort:!1}}];return $(Lt,{children:[$("div",{className:pt.group,children:[g("label",{className:pt.label,children:" Select Tag Type :"}),g(ti,{options:ui,handleChange:o,selectedKey:r.gen+1,required:!0})]}),g(ei,{columns:s,data:i,noRecordsMessage:r.gen===-1?"Select a generation to view the tags.":"No tags found",title:""})]})}const mi="_inputLabel_o5b32_1",gi="_labelText_o5b32_7",yi="_formRow_o5b32_12",q={inputLabel:mi,labelText:gi,formRow:yi},Vt=()=>{};function Qe({state:t,allTags:e,handleNameChange:n=Vt,handleDescriptionChange:r=Vt,handleKeywordsChange:i=Vt,handleParentSelect:a=Vt,type:o="view"}){const[l,u]=I.useState([]);I.useEffect(()=>{const h=d=>{const x=e.filter(C=>Number(C.gen)<5&&C.tag!==d).map(C=>({tag:C.tag,displayName:C.displayName,gen:Number(C.gen)}));u(x)};if(e){const d=t&&t.tag?t.tag:"";h(d)}},[e]);const s=(h,d)=>{d?a(d.tag,d.gen+1):a("",1)},c=(h,{inputValue:d})=>{const x=ai(h.displayName,d),C=oi(h.displayName,x);return $("div",{children:[C.map((A,T)=>g("span",{style:{fontWeight:A.highlight?700:400},children:A.text},T)),$("span",{children:[" (","Gen:"," ",h.gen,")"]})]})},f={opacity:1,cursor:"not-allowed",backgroundColor:"#eee"};return $(Lt,{children:[$(B,{container:!0,className:q.formRow,children:[g(B,{container:!0,item:!0,xs:2,children:g("h4",{className:q.labelText,children:"Tag displayed as: *"})}),$(B,{container:!0,item:!0,xs:4,children:[g(mn,{props:{maxLength:60,pattern:"[A-Za-z0-9-_'+& ]{1,60}"}
1,type:"text",value:t&&t.displayName?t.displayName:"",required:!0,handleChange:n,disabled:o!=="add",defaultStyles:o!=="add"?f:{}}),o==="add"?$("label",{className:q.inputLabel,children:["Tag name can only contain alphanumeric characters, space, and the following special characters:",g("br",{}),"[",g("b",{children:" - _ ' + & "}),"]"]}):null]})]}),$(B,{container:!0,className:q.formRow,children:[g(B,{container:!0,item:!0,xs:2,children:g("h4",{className:q.labelText,children:"Tag id:"})}),$(B,{container:!0,item:!0,xs:4,children:[g(gn,{value:t&&t.tag?t.tag:""}),o==="add"?g("label",{className:q.inputLabel,children:"Tag id is auto computed using tag display name"}):null]})]}),$(B,{container:!0,className:q.formRow,children:[g(B,{container:!0,item:!0,xs:2,children:g("h4",{className:q.labelText,children:"Tag description:"})}),g(B,{container:!0,item:!0,xs:6,children:g(ri,{props:{maxLength:255},rows:3,value:t&&t.description?t.description:"",handleChange:r,disabled:o==="view",defaultStyles:{height:"auto",...o==="view"?f:{}}})})]}),$(B,{container:!0,className:q.formRow,children:[g(B,{container:!0,item:!0,xs:2,children:g("h4",{className:q.labelText,children:"Tag type:"})}),$(B,{container:!0,item:!0,xs:4,children:[g(gn,{value:`Generation ${t&&t.gen?t.gen:1}`}),o!=="view"?g("label",{className:q.inputLabel,children:"Tag type is auto computed using parent's generation"}):null]})]}),$(B,{container:!0,className:q.formRow,children:[g(B,{container:!0,item:!0,xs:2,children:g("h4",{className:q.labelText,children:"Keywords:"})}),$(B,{container:!0,item:!0,xs:4,children:[g(mn,{props:{maxLength:255},type:"text",value:t&&t.keywords?t.keywords:"",handleChange:i,disabled:o==="view",defaultStyles:o==="view"?f:{}}),o!=="view"?g("label",{className:q.inputLabel,children:"Enter a comma separated list of keywords"}):null]})]}),$(B,{container:!0,className:q.formRow,children:[g(B,{container:!0,item:!0,xs:2,children:g("h4",{className:q.labelText,children:"Parent tag:"})}),$(B,{container:!0,item:!0,xs:5,children:[g(ii,{id:"parent-autocomplete",data:l,column:"displayName",value:l?l.find(h=>h.tag===t.parent):null,listRenderer:c,handleChange:s,disabled:o==="view",defaultStyles:o==="view"?f:{}}),o!=="view"?g("label",{className:q.inputLabel,children:"For generation 1 tag, the parent should be empty"}):null]})]}),o!=="add"?$(Lt,{children:[$(B,{container:!0,className:q.formRow,children:[g(B,{container:!0,item:!0,xs:2,children:g("h4",{className:q.labelText,children:"Child Tag(s):"})}),$(B,{container:!0,item:!0,xs:6,children:[t&&t.children?g(yn,{chipData:t.children,column:"displayName",isLink:!0,makeLink:h=>`/manage/tags/${h.tag}`}):g(fn,{variant:"outlined",component:"ul",style:{minHeight:"50px",minWidth:"100%"}}),g("label",{className:q.inputLabel,children:"Child tags are auto computed using parent relationships"})]})]}),$(B,{container:!0,className:q.formRow,children:[g(B,{container:!0,item:!0,xs:2,children:g("h4",{className:q.labelText,children:"Related Tag(s):"})}),$(B,{container:!0,item:!0,xs:6,children:[t&&t.relatedTags?g(yn,{chipData:t.relatedTags,column:"displayName",isLink:!0,makeLink:h=>`/manage/tags/${h.tag}`}):g(fn,{variant:"outlined",component:"ul",style:{minHeight:"50px",minWidth:"100%"}}),g("label",{className:q.inputLabel,children:"Related tags are the siblings of a tag. They are auto computed using parent relationships."})]})]})]}):null]})}const _i="_form_tdut7_1",vi="_formGroup_tdut7_6",wi="_mainGroup_tdut7_12",bi="_title_tdut7_16",Ti="_rightGroup_tdut7_22",Mt={form:_i,formGroup:vi,mainGroup:wi,title:bi,rightGroup:Ti};function xi(){const t=I.useContext(gt),{state:e,dispatch:n}=t,{tagData:r}=e.manageTags,i=I.useContext(Ht),{dispatch:a}=i,o=Ke(),l=()=>{ni.fire({html:`<div style="text-align: left"> 2 Please confirm that you want to delete the following tag: 3 <br /><br /><b>${r.displayName}</b><br /><br /> 4 <p style="color: red; font-size: 14px;"> 5 Note that this operation cannot be undone. 6 </p> 7 </div>`,icon:"warning",showCancelButton:!0,showCloseButton:!0,confirmButtonText:"Confirm"}).then(async u=>
7{if(u.value){await a(xt(!0,"ajax"));try{const s=await Nt.delete(`api/manage/tags/${r.tag}`);await n(rt({...e,allTags:e.allTags.filter(c=>c.tag!==r.tag)})),await Ye(s),o("/manage/tags")}catch(s){await je(s)}finally{await a(xt(!1))}}})};return $("div",{className:Mt.form,children:[$("div",{className:Mt.formGroup,children:[$("div",{children:[g("h4",{className:Mt.title,children:"View Tag"}),$(Pt,{to:"/manage/tags",children:["< ","Back to Tags Selection"]})]}),$("div",{className:Mt.rightGroup,children:[g(pn,{type:"edit",defaultStyles:{color:"#333333"},handleClick:()=>o(`/manage/tags/${r.tag}/edit`)}),g(pn,{type:"delete",defaultStyles:{color:"#333333"},handleClick:l})]})]}),g("div",{className:Mt.mainGroup,children:g(Qe,{state:r,allTags:e.allTags})})]})}const Ni="_form_xzj50_1",Ci="_formGroup_xzj50_6",Ei="_title_xzj50_12",Si="_mainGroup_xzj50_18",Mi="_submitButton_xzj50_22",Dt={form:Ni,formGroup:Ci,title:Ei,mainGroup:Si,submitButton:Mi};function Di(){const t=I.useContext(gt),{state:e,dispatch:n}=t,{tagData:r}=e.manageTags,i=I.useContext(Ht),{dispatch:a}=i,o=Ke(),l=c=>{n(rt({...e,manageTags:{...e.manageTags,tagData:{...r,...c}}}))},u=(c,f)=>{n(rt({...e,manageTags:{...e.manageTags,tagData:{...r,gen:f,parent:c}}}))},s=async c=>{c.preventDefault(),await a(xt(!0,"ajax"));try{const f=await Nt.put("/api/manage/tags",{tag:r.tag,displayName:r.displayName,description:r.description,keywords:r.keywords,parent:r.parent}),{data:h}=f.data,d=e.allTags.filter(x=>x.tag!==r.tag);await n(rt({...e,allTags:[...d,h]})),Ye(f),o(`/manage/tags/${r.tag}`)}catch(f){je(f)}finally{await a(xt(!1))}};return $("form",{className:Dt.form,onSubmit:s,children:[g("div",{className:Dt.formGroup,children:$("div",{children:[g("h4",{className:Dt.title,children:"Edit Tag"}),$(Pt,{to:"/manage/tags",children:["< ","Back to Tags Selection"]})]})}),$("div",{className:Dt.mainGroup,children:[g(Qe,{type:"edit",state:r,allTags:e.allTags,handleDescriptionChange:c=>l({description:c}),handleKeywordsChange:c=>l({keywords:c}),handleParentSelect:u}),g("div",{className:Dt.submitButton,children:g(Wn,{type:"primary",title:"Update Tag"})})]})]})}function Ai({params:t}){const e=I.useContext(gt),{state:n,dispatch:r}=e,i=I.useContext(Ht),{dispatch:a}=i,[o,l]=I.useState(ve),[u,s]=I.useState(!1);return I.useEffect(()=>{(async()=>{try{if(s(!0),t.tag){const h=await Nt.get(`/api/manage/tags/${t.tag}`),{data:d}=h.data;switch(await r(rt({...n,manageTags:{...n.manageTags,tagData:d}})),t.action){case"edit":l(vn);break;case"view":default:l(_n)}}else{const h=await Nt.get("/api/manage/tags/tag-table"),{data:d}=h.data;await r(rt({...n,manageTags:{...n.manageTags,tableData:{...n.manageTags.tableData,tags:d}}})),l(ve)}s(!1)}catch(h){await a(Xn(h))}})()},[t.tag,t.action]),u?g(Vn,{}):(()=>{switch(o){case ve:return g(pi,{});case _n:return g(xi,{});case vn:return g(Di,{});default:return g("h5",{children:"Not Found"})}})()}const ki="_form_13084_1",Oi="_formGroup_13084_6",Ri="_submitButton_13084_12",$i="_title_13084_16",zi="_mainGroup_13084_22",At={form:ki,formGroup:Oi,submitButton:Ri,title:$i,mainGroup:zi};function Li(){const t=I.useContext(gt),{state:e,dispatch:n}=t,r=e.addTag,i=I.useContext(Ht),{dispatch:a}=i,o=s=>{n(rt({...e,addTag:{...r,...s}}))},l=(s,c)=>{n(rt({...e,addTag:{...r,gen:c,parent:s}}))},u=async s=>{s.preventDefault(),await a(xt(!0,"ajax"));try{const c=await Nt.post("/api/manage/tags",{tag:r.tag,displayName:r.displayName,description:r.description,keywords:r.keywords,parent:r.parent}),{data:f}=c.data;await n(rt({...e,allTags:[...e.allTags,f],addTag:{tag:"",displayName:"",description:"",gen:1,keywords:"",parent:""}})),Ye(c)}catch(c){je(c)}finally{await a(xt(!1))}};return $("form",{className:At.form,onSubmit:u,children:[$("div",{className:At.formGroup,children:[g("h4",{className:At.title,children:"Add Tag"}),$(Pt,{to:"/manage/tags",children:["< ","Back to Tags Selection"]})]}),$("div",{className:At.mainGroup,children:[g(Qe,{state:r,allTags:e.allTags,handleNameChange:s=>o({displayName:s,tag:Br(s)}),handleDescriptionChange:s=>o({description:s}),handleKeywordsChange:s=>o({keywords:s}),handleParentSelect:l,type:"add"}),g("div",{className:At.submitButton,children:g(Wn,{title:"Add tag",type:"primary"})})]})]})}function Pi(t){var e=0,n=t.children,r=n&&n.length;if(!r)e=1;else for(;--r>=0;)e+=n[r].value;t.value=e}function Ii(){return this.eachAfter(Pi)}function Fi(t){var e=this,n,r=[e],i,a,o;do for(n=r.reverse(),r=[];e=n.pop();)if(t(e),i=e.children,i)for(a=0,o=i.length;a<o;++a)r.push(i[a]);while(r.length);return this}function Gi(t){for(var e=this,n=[e],r,i;e=n.pop();)if(t(e),r=e.children,r)for(i=r.length-1;i>=0;--i)n.push(r[i]);return this}function Bi(t){for(var e=this,n=[e],r=[],i,a,o;e=n.pop();)if(r.push(e),i=e.children,i)for(a=0,o=i.length;a<o;++a)n.push(i[a]);for(;e=r.pop();)t(e);return this}function qi(t){return this.eachAfter(function(e){for(var n=+t(e.data)||0,r=e.children,i=r&&r.length;--i>=0;)n+=r[i].value;e.value=n})}function Hi(t){return this.eachBefore(function(e){e.children&&e.children.sort(t)})}function Ui(t){for(var e=this,n=Wi(e,t),r=[e];e!==n;)e=e.parent,r.push(e);for(var i=r.length;t!==n;)r.splice(i,0,t),t=t.parent;return r}function Wi(t,e){if(t===e)return t;var n=t.ancestors(),r=e.ancestors(),i=null;for(t=n.pop(),e=r.pop();t===e;)i=t,t=n.pop(),e=r.pop();return i}function Vi(){for(var t=this,e=[t];t=t.parent;)e.push(t);return e}function Xi(){var t=[];return this.each(function(e){t.push(e)}),t}function Ki(){var t=[];return this.eachBefore(function(e){e.children||t.push(e)}),t}function Yi(){var t=this,e=[];return t.each(function(n){n!==t&&e.push({source:n.parent,target:n})}),e}function Ze(t,e){var n=new It(t),r=+t.value&&(n.value=t.value),i,a=[n],o,l,u,s;for(e==null&&(e=Qi);i=a.pop();)if(r&&(i.value=+i.data.value),(l=e(i.data))&&(s=l.length))for(i.children=new Array(s),u=s-1;u>=0;
7--u)a.push(o=i.children[u]=new It(l[u])),o.parent=i,o.depth=i.depth+1;return n.eachBefore(Ji)}function ji(){return Ze(this).eachBefore(Zi)}function Qi(t){return t.children}function Zi(t){t.data=t.data.data}function Ji(t){var e=0;do t.height=e;while((t=t.parent)&&t.height<++e)}function It(t){this.data=t,this.depth=this.height=0,this.parent=null}It.prototype=Ze.prototype={constructor:It,count:Ii,each:Fi,eachAfter:Bi,eachBefore:Gi,sum:qi,sort:Hi,path:Ui,ancestors:Vi,descendants:Xi,leaves:Ki,links:Yi,copy:ji};function ta(t,e){return t.parent===e.parent?1:2}function we(t){var e=t.children;return e?e[0]:t.t}function be(t){var e=t.children;return e?e[e.length-1]:t.t}function ea(t,e,n){var r=n/(e.i-t.i);e.c-=r,e.s+=n,t.c+=r,e.z+=n,e.m+=n}function na(t){for(var e=0,n=0,r=t.children,i=r.length,a;--i>=0;)a=r[i],a.z+=e,a.m+=e,e+=a.s+(n+=a.c)}function ra(t,e,n){return t.a.parent===e.parent?t.a:n}function te(t,e){this._=t,this.parent=null,this.children=null,this.A=null,this.a=this,this.z=0,this.m=0,this.c=0,this.s=0,this.t=null,this.i=e}te.prototype=Object.create(It.prototype);function ia(t){for(var e=new te(t,0),n,r=[e],i,a,o,l;n=r.pop();)if(a=n._.children)for(n.children=new Array(l=a.length),o=l-1;o>=0;--o)r.push(i=n.children[o]=new te(a[o],o)),i.parent=n;return(e.parent=new te(null,0)).children=[e],e}function aa(){var t=ta,e=1,n=1,r=null;function i(s){var c=ia(s);if(c.eachAfter(a),c.parent.m=-c.z,c.eachBefore(o),r)s.eachBefore(u);else{var f=s,h=s,d=s;s.eachBefore(function(_){_.x<f.x&&(f=_),_.x>h.x&&(h=_),_.depth>d.depth&&(d=_)});var x=f===h?1:t(f,h)/2,C=x-f.x,A=e/(h.x+x+C),T=n/(d.depth||1);s.eachBefore(function(_){_.x=(_.x+C)*A,_.y=_.depth*T})}return s}function a(s){var c=s.children,f=s.parent.children,h=s.i?f[s.i-1]:null;if(c){na(s);var d=(c[0].z+c[c.length-1].z)/2;h?(s.z=h.z+t(s._,h._),s.m=s.z-d):s.z=d}else h&&(s.z=h.z+t(s._,h._));s.parent.A=l(s,h,s.parent.A||f[0])}function o(s){s._.x=s.z+s.parent.m,s.m+=s.parent.m}function l(s,c,f){if(c){for(var h=s,d=s,x=c,C=h.parent.children[0],A=h.m,T=d.m,_=x.m,b=C.m,M;x=be(x),h=we(h),x&&h;)C=we(C),d=be(d),d.a=s,M=x.z+_-h.z-A+t(x._,h._),M>0&&(ea(ra(x,s,f),s,M),A+=M,T+=M),_+=x.m,A+=h.m,b+=C.m,T+=d.m;x&&!be(d)&&(d.t=x,d.m+=_-T),h&&!we(C)&&(C.t=h,C.m+=A-b,f=s)}return f}function u(s){s.x*=e,s.y=s.depth*n}return i.separation=function(s){return arguments.length?(t=s,i):t},i.size=function(s){return arguments.length?(r=!1,e=+s[0],n=+s[1],i):r?null:[e,n]},i.nodeSize=function(s){return arguments.length?(r=!0,e=+s[0],n=+s[1],i):r?[e,n]:null},i}var De="http://www.w3.org/1999/xhtml";const bn={svg:"http://www.w3.org/2000/svg",xhtml:De,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function pe(t){var e=t+="",n=e.indexOf(":");return n>=0&&(e=t.slice(0,n))!=="xmlns"&&(t=t.slice(n+1)),bn.hasOwnProperty(e)?{space:bn[e],local:t}:t}function oa(t){return function(){var e=this.ownerDocument,n=this.namespaceURI;return n===De&&e.documentElement.namespaceURI===De?e.createElement(t):e.createElementNS(n,t)}}function sa(t){return function(){return this.ownerDocument.createElementNS(t.space,t.local)}}function jn(t){var e=pe(t);return(e.local?sa:oa)(e)}function la(){}function Je(t){return t==null?la:function(){return this.querySelector(t)}}function ua(t){typeof t!="function"&&(t=Je(t));for(var e=this._groups,n=e.length,r=new Array(n),i=0;i<n;++i)for(var a=e[i],o=a.length,l=r[i]=new Array(o),u,s,c=0;c<o;++c)(u=a[c])&&(s=t.call(u,u.__data__,c,a))&&("__data__"in u&&(s.__data__=u.__data__),l[c]=s);return new J(r,this._parents)}function ca(t){return t==null?[]:Array.isArray(t)?t:Array.from(t)}function ha(){return[]}function Qn(t){return t==null?ha:function(){return this.querySelectorAll(t)}}function fa(t){return function(){return ca(t.apply(this,arguments))}}function da(t){typeof t=="function"?t=fa(t):t=Qn(t);for(var e=this._groups,n=e.length,r=[],i=[],a=0;a<n;++a)for(var o=e[a],l=o.length,u,s=0;s<l;++s)(u=o[s])&&(r.push(t.call(u,u.__data__,s,o)),i.push(u));return new J(r,i)}function Zn(t){return function(){return this.matches(t)}}function Jn(t){return function(e){return e.matches(t)}}var pa=Array.prototype.find;function ma(t){return function(){return pa.call(this.children,t)}}function ga(){return this.firstElementChild}function ya(t){return this.select(t==null?ga:ma(typeof t=="function"?t:Jn(t)))}var _a=Array.prototype.filter;function va(){return Array.from(this.children)}function wa(t){return function(){return _a.call(this.children,t)}}function ba(t){return this.selectAll(t==null?va:wa(typeof t=="function"?t:Jn(t)))}function Ta(t){typeof t!="function"&&(t=Zn(t));for(var e=this._groups,n=e.length,r=new Array(n),i=0;i<n;++i)for(var a=e[i],o=a.length,l=r[i]=[],u,s=0;s<o;++s)(u=a[s])&&t.call(u,u.__data__,s,a)&&l.push(u);
vendor: 5,838 bytes, line 7
7return new J(r,this._parents)}function tr(t){return new Array(t.length)}function xa(){return new J(this._enter||this._groups.map(tr),this._parents)}function ae(t,e){this.ownerDocument=t.ownerDocument,this.namespaceURI=t.namespaceURI,this._next=null,this._parent=t,this.__data__=e}ae.prototype={constructor:ae,appendChild:function(t){return this._parent.insertBefore(t,this._next)},insertBefore:function(t,e){return this._parent.insertBefore(t,e)},querySelector:function(t){return this._parent.querySelector(t)},querySelectorAll:function(t){return this._parent.querySelectorAll(t)}};function Na(t){return function(){return t}}function Ca(t,e,n,r,i,a){for(var o=0,l,u=e.length,s=a.length;o<s;++o)(l=e[o])?(l.__data__=a[o],r[o]=l):n[o]=new ae(t,a[o]);for(;o<u;++o)(l=e[o])&&(i[o]=l)}function Ea(t,e,n,r,i,a,o){var l,u,s=new Map,c=e.length,f=a.length,h=new Array(c),d;for(l=0;l<c;++l)(u=e[l])&&(h[l]=d=o.call(u,u.__data__,l,e)+"",s.has(d)?i[l]=u:s.set(d,u));for(l=0;l<f;++l)d=o.call(t,a[l],l,a)+"",(u=s.get(d))?(r[l]=u,u.__data__=a[l],s.delete(d)):n[l]=new ae(t,a[l]);for(l=0;l<c;++l)(u=e[l])&&s.get(h[l])===u&&(i[l]=u)}function Sa(t){return t.__data__}function Ma(t,e){if(!arguments.length)return Array.from(this,Sa);var n=e?Ea:Ca,r=this._parents,i=this._groups;typeof t!="function"&&(t=Na(t));for(var a=i.length,o=new Array(a),l=new Array(a),u=new Array(a),s=0;s<a;++s){var c=r[s],f=i[s],h=f.length,d=Da(t.call(c,c&&c.__data__,s,r)),x=d.length,C=l[s]=new Array(x),A=o[s]=new Array(x),T=u[s]=new Array(h);n(c,f,C,A,T,d,e);for(var _=0,b=0,M,v;_<x;++_)if(M=C[_]){for(_>=b&&(b=_+1);!(v=A[b])&&++b<x;);M._next=v||null}}return o=new J(o,r),o._enter=l,o._exit=u,o}function Da(t){return typeof t=="object"&&"length"in t?t:Array.from(t)}function Aa(){return new J(this._exit||this._groups.map(tr),this._parents)}function ka(t,e,n){var r=this.enter(),i=this,a=this.exit();return typeof t=="function"?(r=t(r),r&&(r=r.selection())):r=r.append(t+""),e!=null&&(i=e(i),i&&(i=i.selection())),n==null?a.remove():n(a),r&&i?r.merge(i).order():i}function Oa(t){for(var e=t.selection?t.selection():t,n=this._groups,r=e._groups,i=n.length,a=r.length,o=Math.min(i,a),l=new Array(i),u=0;u<o;++u)for(var s=n[u],c=r[u],f=s.length,h=l[u]=new Array(f),d,x=0;x<f;++x)(d=s[x]||c[x])&&(h[x]=d);for(;u<i;++u)l[u]=n[u];return new J(l,this._parents)}function Ra(){for(var t=this._groups,e=-1,n=t.length;++e<n;)for(var r=t[e],i=r.length-1,a=r[i],o;--i>=0;)(o=r[i])&&(a&&o.compareDocumentPosition(a)^4&&a.parentNode.insertBefore(o,a),a=o);return this}function $a(t){t||(t=za);function e(f,h){return f&&h?t(f.__data__,h.__data__):!f-!h}for(var n=this._groups,r=n.length,i=new Array(r),a=0;a<r;++a){for(var o=n[a],l=o.length,u=i[a]=new Array(l),s,c=0;c<l;++c)(s=o[c])&&(u[c]=s);u.sort(e)}return new J(i,this._parents).order()}function za(t,e){return t<e?-1:t>e?1:t>=e?0:NaN}function La(){var t=arguments[0];return arguments[0]=this,t.apply(null,arguments),this}function Pa(){return Array.from(this)}function Ia(){for(var t=this._groups,e=0,n=t.length;e<n;++e)for(var r=t[e],i=0,a=r.length;i<a;++i){var o=r[i];if(o)return o}return null}function Fa(){let t=0;for(const e of this)++t;return t}function Ga(){return!this.node()}function Ba(t){for(var e=this._groups,n=0,r=e.length;n<r;++n)for(var i=e[n],a=0,o=i.length,l;a<o;++a)(l=i[a])&&t.call(l,l.__data__,a,i);return this}function qa(t){return function(){this.removeAttribute(t)}}function Ha(t){return function(){this.removeAttributeNS(t.space,t.local)}}function Ua(t,e){return function(){this.setAttribute(t,e)}}function Wa(t,e){return function(){this.setAttributeNS(t.space,t.local,e)}}function Va(t,e){return function(){var n=e.apply(this,arguments);n==null?this.removeAttribute(t):this.setAttribute(t,n)}}function Xa(t,e){return function(){var n=e.apply(this,arguments);n==null?this.removeAttributeNS(t.space,t.local):this.setAttributeNS(t.space,t.local,n)}}function Ka(t,e){var n=pe(t);if(arguments.length<2){var r=this.node();return n.local?r.getAttributeNS(n.space,n.local):r.getAttribute(n)}return this.each((e==null?n.local?Ha:qa:typeof e=="function"?n.local?Xa:Va:n.local?Wa:Ua)(n,e))}function er(t){return t.ownerDocument&&t.ownerDocument.defaultView||t.document&&t||t.defaultView}function Ya(t){return function(){this.style.removeProperty(t)}}function ja(t,e,n){return function(){this.style.setProperty(t,e,n)}}function Qa(t,e,n){return function(){var r=e.apply(this,arguments);r==null?this.style.removeProperty(t):this.style.setProperty(t,r,n)}}function Za(t,e,n){return arguments.length>1?this.each((e==null?Ya:typeof e=="function"?Qa:ja)(t,e,n??"")):Ct(this.node(),t)}function Ct(t,e){return t.style.getPropertyValue(e)||er(t).getComputedStyle(t,null).getPropertyValue(e)}function Ja(t){return function(){delete this[t]}}function to(t,e){return function(){this[t]=e}}function eo(t,e){return function(){var n=e.apply(this,arguments);n==null?delete this[t]:this[t]=n}}function no(t,e){return arguments.length>1?this.each((e==null?Ja:typeof e=="function"?eo:to)(t,e)):this.node()[t]}function nr(t){return t.trim().split(/^|\s+/)}function tn(t){return t.classList||new rr(t)}function rr(t){this._node=t,this._names=nr(t.getAttribute("class")||"")}rr.prototype={add:function(t){var e=this._names.indexOf(t);e<0&&(this._names.push(t),this._node.setAttribute("class",this._names.join(" ")))},remove:function(t){var e=this._names.indexOf(t);e>=0&&(this._names.splice(e,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(t){return this._names.indexOf(t)>=0}};function ir(t,e){for(var n=tn(t),r=-1,i=e.length;++r<i;)n.add(e[r])}function ar(t,e){for(var n=tn(t),r=-1,i=e.length;++r<i;)n.remove(e[r])}function ro(t){return function(){ir(this,t)}}function io(t){return function(){ar(this,t)}}function ao(t,e){return function(){(e.apply(this,arguments)?ir:ar)(this,t)}}function oo(t,e){var n=nr(t+"");
vendor: 13,755 bytes, line 7
7if(arguments.length<2){for(var r=tn(this.node()),i=-1,a=n.length;++i<a;)if(!r.contains(n[i]))return!1;return!0}return this.each((typeof e=="function"?ao:e?ro:io)(n,e))}function so(){this.textContent=""}function lo(t){return function(){this.textContent=t}}function uo(t){return function(){var e=t.apply(this,arguments);this.textContent=e??""}}function co(t){return arguments.length?this.each(t==null?so:(typeof t=="function"?uo:lo)(t)):this.node().textContent}function ho(){this.innerHTML=""}function fo(t){return function(){this.innerHTML=t}}function po(t){return function(){var e=t.apply(this,arguments);this.innerHTML=e??""}}function mo(t){return arguments.length?this.each(t==null?ho:(typeof t=="function"?po:fo)(t)):this.node().innerHTML}function go(){this.nextSibling&&this.parentNode.appendChild(this)}function yo(){return this.each(go)}function _o(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function vo(){return this.each(_o)}function wo(t){var e=typeof t=="function"?t:jn(t);return this.select(function(){return this.appendChild(e.apply(this,arguments))})}function bo(){return null}function To(t,e){var n=typeof t=="function"?t:jn(t),r=e==null?bo:typeof e=="function"?e:Je(e);return this.select(function(){return this.insertBefore(n.apply(this,arguments),r.apply(this,arguments)||null)})}function xo(){var t=this.parentNode;t&&t.removeChild(this)}function No(){return this.each(xo)}function Co(){var t=this.cloneNode(!1),e=this.parentNode;return e?e.insertBefore(t,this.nextSibling):t}function Eo(){var t=this.cloneNode(!0),e=this.parentNode;return e?e.insertBefore(t,this.nextSibling):t}function So(t){return this.select(t?Eo:Co)}function Mo(t){return arguments.length?this.property("__data__",t):this.node().__data__}function Do(t){return function(e){t.call(this,e,this.__data__)}}function Ao(t){return t.trim().split(/^|\s+/).map(function(e){var n="",r=e.indexOf(".");return r>=0&&(n=e.slice(r+1),e=e.slice(0,r)),{type:e,name:n}})}function ko(t){return function(){var e=this.__on;if(e){for(var n=0,r=-1,i=e.length,a;n<i;++n)a=e[n],(!t.type||a.type===t.type)&&a.name===t.name?this.removeEventListener(a.type,a.listener,a.options):e[++r]=a;++r?e.length=r:delete this.__on}}}function Oo(t,e,n){return function(){var r=this.__on,i,a=Do(e);if(r){for(var o=0,l=r.length;o<l;++o)if((i=r[o]).type===t.type&&i.name===t.name){this.removeEventListener(i.type,i.listener,i.options),this.addEventListener(i.type,i.listener=a,i.options=n),i.value=e;return}}this.addEventListener(t.type,a,n),i={type:t.type,name:t.name,value:e,listener:a,options:n},r?r.push(i):this.__on=[i]}}function Ro(t,e,n){var r=Ao(t+""),i,a=r.length,o;if(arguments.length<2){var l=this.node().__on;if(l){for(var u=0,s=l.length,c;u<s;++u)for(i=0,c=l[u];i<a;++i)if((o=r[i]).type===c.type&&o.name===c.name)return c.value}return}for(l=e?Oo:ko,i=0;i<a;++i)this.each(l(r[i],e,n));return this}function or(t,e,n){var r=er(t),i=r.CustomEvent;typeof i=="function"?i=new i(e,n):(i=r.document.createEvent("Event"),n?(i.initEvent(e,n.bubbles,n.cancelable),i.detail=n.detail):i.initEvent(e,!1,!1)),t.dispatchEvent(i)}function $o(t,e){return function(){return or(this,t,e)}}function zo(t,e){return function(){return or(this,t,e.apply(this,arguments))}}function Lo(t,e){return this.each((typeof e=="function"?zo:$o)(t,e))}function*Po(){for(var t=this._groups,e=0,n=t.length;e<n;++e)for(var r=t[e],i=0,a=r.length,o;i<a;++i)(o=r[i])&&(yield o)}var sr=[null];function J(t,e){this._groups=t,this._parents=e}function Ut(){return new J([[document.documentElement]],sr)}function Io(){return this}J.prototype=Ut.prototype={constructor:J,select:ua,selectAll:da,selectChild:ya,selectChildren:ba,filter:Ta,data:Ma,enter:xa,exit:Aa,join:ka,merge:Oa,selection:Io,order:Ra,sort:$a,call:La,nodes:Pa,node:Ia,size:Fa,empty:Ga,each:Ba,attr:Ka,style:Za,property:no,classed:oo,text:co,html:mo,raise:yo,lower:vo,append:wo,insert:To,remove:No,clone:So,datum:Mo,on:Ro,dispatch:Lo,[Symbol.iterator]:Po};function Y(t){return typeof t=="string"?new J([[document.querySelector(t)]],[document.documentElement]):new J([[t]],sr)}function Fo(t){let e;for(;e=t.sourceEvent;)t=e;return t}function yt(t,e){if(t=Fo(t),e===void 0&&(e=t.currentTarget),e){var n=e.ownerSVGElement||e;if(n.createSVGPoint){var r=n.createSVGPoint();return r.x=t.clientX,r.y=t.clientY,r=r.matrixTransform(e.getScreenCTM().inverse()),[r.x,r.y]}if(e.getBoundingClientRect){var i=e.getBoundingClientRect();return[t.clientX-i.left-e.clientLeft,t.clientY-i.top-e.clientTop]}}return[t.pageX,t.pageY]}var Go={value:()=>{}};function en(){for(var t=0,e=arguments.length,n={},r;t<e;++t){if(!(r=arguments[t]+"")||r in n||/[\s.]/.test(r))throw new Error("illegal type: "+r);n[r]=[]}return new ee(n)}function ee(t){this._=t}function Bo(t,e){return t.trim().split(/^|\s+/).map(function(n){var r="",i=n.indexOf(".");if(i>=0&&(r=n.slice(i+1),n=n.slice(0,i)),n&&!e.hasOwnProperty(n))throw new Error("unknown type: "+n);return{type:n,name:r}})}ee.prototype=en.prototype={constructor:ee,on:function(t,e){var n=this._,r=Bo(t+"",n),i,a=-1,o=r.length;if(arguments.length<2){for(;++a<o;)if((i=(t=r[a]).type)&&(i=qo(n[i],t.name)))return i;return}if(e!=null&&typeof e!="function")throw new Error("invalid callback: "+e);for(;++a<o;)if(i=(t=r[a]).type)n[i]=Tn(n[i],t.name,e);else if(e==null)for(i in n)n[i]=Tn(n[i],t.name,null);return this},copy:function(){var t={},e=this._;for(var n in e)t[n]=e[n].slice();return new ee(t)},call:function(t,e){if((i=arguments.length-2)>0)for(var n=new Array(i),r=0,i,a;r<i;++r)n[r]=arguments[r+2];if(!this._.hasOwnProperty(t))throw new Error("unknown type: "+t);for(a=this._[t],r=0,i=a.length;r<i;++r)a[r].value.apply(e,n)},apply:function(t,e,n){if(!this._.hasOwnProperty(t))throw new Error("unknown type: "+t);for(var r=this._[t],i=0,a=r.length;i<a;++i)r[i].value.apply(e,n)}};function qo(t,e){for(var n=0,r=t.length,i;n<r;++n)if((i=t[n]).name===e)return i.value}function Tn(t,e,n){for(var r=0,i=t.length;r<i;++r)if(t[r].name===e){t[r]=Go,t=t.slice(0,r).concat(t.slice(r+1));break}return n!=null&&t.push({name:e,value:n}),t}const Ae={capture:!0,passive:!1};function ke(t){t.preventDefault(),t.stopImmediatePropagation()}function Ho(t){var e=t.document.documentElement,n=Y(t).on("dragstart.drag",ke,Ae);"onselectstart"in e?n.on("selectstart.drag",ke,Ae):(e.__noselect=e.style.MozUserSelect,e.style.MozUserSelect="none")}function Uo(t,e){var n=t.document.documentElement,r=Y(t).on("dragstart.drag",null);e&&(r.on("click.drag",ke,Ae),setTimeout(function(){r.on("click.drag",null)},0)),"onselectstart"in n?r.on("selectstart.drag",null):(n.style.MozUserSelect=n.__noselect,delete n.__noselect)}function nn(t,e,n){t.prototype=e.prototype=n,n.constructor=t}function lr(t,e){var n=Object.create(t.prototype);for(var r in e)n[r]=e[r];return n}function Wt(){}var Ft=.7,oe=1/Ft,Tt="\\s*([+-]?\\d+)\\s*",Gt="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",st="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",Wo=/^#([0-9a-f]{3,8})$/,Vo=new RegExp(`^rgb\\(${Tt},${Tt},${Tt}\\)$`),Xo=new RegExp(`^rgb\\(${st},${st},${st}\\)$`),Ko=new RegExp(`^rgba\\(${Tt},${Tt},${Tt},${Gt}\\)$`),Yo=new RegExp(`^rgba\\(${st},${st},${st},${Gt}\\)$`),jo=new RegExp(`^hsl\\(${Gt},${st},${st}\\)$`),Qo=new RegExp(`^hsla\\(${Gt},${st},${st},${Gt}\\)$`),xn={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};nn(Wt,Bt,{copy(t){return Object.assign(new this.constructor,this,t)},displayable(){return this.rgb().displayable()},hex:Nn,formatHex:Nn,formatHex8:Zo,formatHsl:Jo,formatRgb:Cn,toString:Cn});function Nn(){return this.rgb().formatHex()}function Zo(){return this.rgb().formatHex8()}function Jo(){return ur(this).formatHsl()}function Cn(){return this.rgb().formatRgb()}function Bt(t){var e,n;return t=(t+"").trim().toLowerCase(),(e=Wo.exec(t))?(n=e[1].length,e=parseInt(e[1],16),n===6?En(e):n===3?new j(e>>8&15|e>>4&240,e>>4&15|e&240,(e&15)<<4|e&15,1):n===8?Xt(e>>24&255,e>>16&255,e>>8&255,(e&255)/255):n===4?Xt(e>>12&15|e>>8&240,e>>8&15|e>>4&240,e>>4&15|e&240,((e&15)<<4|e&15)/255):null):(e=Vo.exec(t))?new j(e[1],e[2],e[3],1):(e=Xo.exec(t))?new j(e[1]*255/100,e[2]*255/100,e[3]*255/100,1):(e=Ko.exec(t))?Xt(e[1],e[2],e[3],e[4]):(e=Yo.exec(t))?Xt(e[1]*255/100,e[2]*255/100,e[3]*255/100,e[4]):(e=jo.exec(t))?Dn(e[1],e[2]/100,e[3]/100,1):(e=Qo.exec(t))?Dn(e[1],e[2]/100,e[3]/100,e[4]):xn.hasOwnProperty(t)?En(xn[t]):t==="transparent"?new j(NaN,NaN,NaN,0):null}function En(t){return new j(t>>16&255,t>>8&255,t&255,1)}function Xt(t,e,n,r){return r<=0&&(t=e=n=NaN),new j(t,e,n,r)}function ts(t){return t instanceof Wt||(t=Bt(t)),t?(t=t.rgb(),new j(t.r,t.g,t.b,t.opacity)):new j}function Oe(t,e,n,r){return arguments.length===1?ts(t):new j(t,e,n,r??1)}function j(t,e,n,r){this.r=+t,this.g=+e,this.b=+n,this.opacity=+r}nn(j,Oe,lr(Wt,{brighter(t){return t=t==null?oe:Math.pow(oe,t),new j(this.r*t,this.g*t,this.b*t,this.opacity)},darker(t){return t=t==null?Ft:Math.pow(Ft,t),new j(this.r*t,this.g*t,this.b*t,this.opacity)},rgb(){return this},clamp(){return new j(wt(this.r),wt(this.g),wt(this.b),se(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:Sn,formatHex:Sn,formatHex8:es,formatRgb:Mn,toString:Mn}));function Sn(){return`#${vt(this.r)}${vt(this.g)}${vt(this.b)}`}function es(){return`#${vt(this.r)}${vt(this.g)}${vt(this.b)}${vt((isNaN(this.opacity)?1:this.opacity)*255)}`}function Mn(){const t=se(this.opacity);return`${t===1?"rgb(":"rgba("}${wt(this.r)}, ${wt(this.g)}, ${wt(this.b)}${t===1?")":`, ${t})`}`}function se(t){return isNaN(t)?1:Math.max(0,Math.min(1,t))}function wt(t){return Math.max(0,Math.min(255,Math.round(t)||0))}function vt(t){return t=wt(t),(t<16?"0":"")+t.toString(16)}function Dn(t,e,n,r){return r<=0?t=e=n=NaN:n<=0||n>=1?t=e=NaN:e<=0&&(t=NaN),new nt(t,e,n,r)}function ur(t){if(t instanceof nt)return new nt(t.h,t.s,t.l,t.opacity);if(t instanceof Wt||(t=Bt(t)),!t)return new nt;if(t instanceof nt)return t;t=t.rgb();var e=t.r/255,n=t.g/255,r=t.b/255,i=Math.min(e,n,r),a=Math.max(e,n,r),o=NaN,l=a-i,u=(a+i)/2;return l?(e===a?o=(n-r)/l+(n<r)*6:n===a?o=(r-e)/l+2:o=(e-n)/l+4,l/=u<.5?a+i:2-a-i,o*=60):l=u>0&&u<1?0:o,new nt(o,l,u,t.opacity)}function ns(t,e,n,r){return arguments.length===1?ur(t):new nt(t,e,n,r??1)}function nt(t,e,n,r){this.h=+t,this.s=+e,this.l=+n,this.opacity=+r}nn(nt,ns,lr(Wt,{brighter(t){return t=t==null?oe:Math.pow(oe,t),new nt(this.h,this.s,this.l*t,this.opacity)},darker(t){return t=t==null?Ft:Math.pow(Ft,t),new nt(this.h,this.s,this.l*t,this.opacity)},rgb(){var t=this.h%360+(this.h<0)*360,e=isNaN(t)||isNaN(this.s)?0:this.s,n=this.l,r=n+(n<.5?n:1-n)*e,i=2*n-r;return new j(Te(t>=240?t-240:t+120,i,r),Te(t,i,r),Te(t<120?t+240:t-120,i,r),this.opacity)},clamp(){return new nt(An(this.h),Kt(this.s),Kt(this.l),se(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 t=se(this.opacity);return`${t===1?"hsl(":"hsla("}${An(this.h)}, ${Kt(this.s)*100}%, ${Kt(this.l)*100}%${t===1?")":`, ${t})`}`}}));function An(t){return t=(t||0)%360,t<0?t+360:t}
vendor: 2,474 bytes, line 7
7function Kt(t){return Math.max(0,Math.min(1,t||0))}function Te(t,e,n){return(t<60?e+(n-e)*t/60:t<180?n:t<240?e+(n-e)*(240-t)/60:e)*255}const cr=t=>()=>t;function rs(t,e){return function(n){return t+n*e}}function is(t,e,n){return t=Math.pow(t,n),e=Math.pow(e,n)-t,n=1/n,function(r){return Math.pow(t+r*e,n)}}function as(t){return(t=+t)==1?hr:function(e,n){return n-e?is(e,n,t):cr(isNaN(e)?n:e)}}function hr(t,e){var n=e-t;return n?rs(t,n):cr(isNaN(t)?e:t)}const kn=function t(e){var n=as(e);function r(i,a){var o=n((i=Oe(i)).r,(a=Oe(a)).r),l=n(i.g,a.g),u=n(i.b,a.b),s=hr(i.opacity,a.opacity);return function(c){return i.r=o(c),i.g=l(c),i.b=u(c),i.opacity=s(c),i+""}}return r.gamma=t,r}(1);function mt(t,e){return t=+t,e=+e,function(n){return t*(1-n)+e*n}}var Re=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,xe=new RegExp(Re.source,"g");function os(t){return function(){return t}}function ss(t){return function(e){return t(e)+""}}function ls(t,e){var n=Re.lastIndex=xe.lastIndex=0,r,i,a,o=-1,l=[],u=[];for(t=t+"",e=e+"";(r=Re.exec(t))&&(i=xe.exec(e));)(a=i.index)>n&&(a=e.slice(n,a),l[o]?l[o]+=a:l[++o]=a),(r=r[0])===(i=i[0])?l[o]?l[o]+=i:l[++o]=i:(l[++o]=null,u.push({i:o,x:mt(r,i)})),n=xe.lastIndex;return n<e.length&&(a=e.slice(n),l[o]?l[o]+=a:l[++o]=a),l.length<2?u[0]?ss(u[0].x):os(e):(e=u.length,function(s){for(var c=0,f;c<e;++c)l[(f=u[c]).i]=f.x(s);return l.join("")})}var On=180/Math.PI,$e={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function fr(t,e,n,r,i,a){var o,l,u;return(o=Math.sqrt(t*t+e*e))&&(t/=o,e/=o),(u=t*n+e*r)&&(n-=t*u,r-=e*u),(l=Math.sqrt(n*n+r*r))&&(n/=l,r/=l,u/=l),t*r<e*n&&(t=-t,e=-e,u=-u,o=-o),{translateX:i,translateY:a,rotate:Math.atan2(e,t)*On,skewX:Math.atan(u)*On,scaleX:o,scaleY:l}}var Yt;function us(t){const e=new(typeof DOMMatrix=="function"?DOMMatrix:WebKitCSSMatrix)(t+"");return e.isIdentity?$e:fr(e.a,e.b,e.c,e.d,e.e,e.f)}function cs(t){return t==null||(Yt||(Yt=document.createElementNS("http://www.w3.org/2000/svg","g")),Yt.setAttribute("transform",t),!(t=Yt.transform.baseVal.consolidate()))?$e:(t=t.matrix,fr(t.a,t.b,t.c,t.d,t.e,t.f))}function dr(t,e,n,r){function i(s){return s.length?s.pop()+" ":""}function a(s,c,f,h,d,x){if(s!==f||c!==h){var C=d.push("translate(",null,e,null,n);x.push({i:C-4,x:mt(s,f)},{i:C-2,x:mt(c,h)})}else(f||h)&&d.push("translate("+f+e+h+n)}function o(s,c,f,h){s!==c?(s-c>180?c+=360:c-s>180&&(s+=360),h.push({i:f.push(i(f)+"rotate(",null,r)-2,x:mt(s,c)})):c&&f.push(i(f)+"rotate("+c+r)}
vendor: 19,891 bytes, line 7
7function l(s,c,f,h){s!==c?h.push({i:f.push(i(f)+"skewX(",null,r)-2,x:mt(s,c)}):c&&f.push(i(f)+"skewX("+c+r)}function u(s,c,f,h,d,x){if(s!==f||c!==h){var C=d.push(i(d)+"scale(",null,",",null,")");x.push({i:C-4,x:mt(s,f)},{i:C-2,x:mt(c,h)})}else(f!==1||h!==1)&&d.push(i(d)+"scale("+f+","+h+")")}return function(s,c){var f=[],h=[];return s=t(s),c=t(c),a(s.translateX,s.translateY,c.translateX,c.translateY,f,h),o(s.rotate,c.rotate,f,h),l(s.skewX,c.skewX,f,h),u(s.scaleX,s.scaleY,c.scaleX,c.scaleY,f,h),s=c=null,function(d){for(var x=-1,C=h.length,A;++x<C;)f[(A=h[x]).i]=A.x(d);return f.join("")}}}var hs=dr(us,"px, ","px)","deg)"),fs=dr(cs,", ",")",")"),ds=1e-12;function Rn(t){return((t=Math.exp(t))+1/t)/2}function ps(t){return((t=Math.exp(t))-1/t)/2}function ms(t){return((t=Math.exp(2*t))-1)/(t+1)}const gs=function t(e,n,r){function i(a,o){var l=a[0],u=a[1],s=a[2],c=o[0],f=o[1],h=o[2],d=c-l,x=f-u,C=d*d+x*x,A,T;if(C<ds)T=Math.log(h/s)/e,A=function(y){return[l+y*d,u+y*x,s*Math.exp(e*y*T)]};else{var _=Math.sqrt(C),b=(h*h-s*s+r*C)/(2*s*n*_),M=(h*h-s*s-r*C)/(2*h*n*_),v=Math.log(Math.sqrt(b*b+1)-b),N=Math.log(Math.sqrt(M*M+1)-M);T=(N-v)/e,A=function(y){var w=y*T,k=Rn(v),D=s/(n*_)*(k*ms(e*w+v)-ps(v));return[l+D*d,u+D*x,s*k/Rn(e*w+v)]}}return A.duration=T*1e3*e/Math.SQRT2,A}return i.rho=function(a){var o=Math.max(.001,+a),l=o*o,u=l*l;return t(o,l,u)},i}(Math.SQRT2,2,4);var Et=0,Rt=0,kt=0,pr=1e3,le,$t,ue=0,bt=0,me=0,qt=typeof performance=="object"&&performance.now?performance:Date,mr=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(t){setTimeout(t,17)};function rn(){return bt||(mr(ys),bt=qt.now()+me)}function ys(){bt=0}function ce(){this._call=this._time=this._next=null}ce.prototype=gr.prototype={constructor:ce,restart:function(t,e,n){if(typeof t!="function")throw new TypeError("callback is not a function");n=(n==null?rn():+n)+(e==null?0:+e),!this._next&&$t!==this&&($t?$t._next=this:le=this,$t=this),this._call=t,this._time=n,ze()},stop:function(){this._call&&(this._call=null,this._time=1/0,ze())}};function gr(t,e,n){var r=new ce;return r.restart(t,e,n),r}function _s(){rn(),++Et;for(var t=le,e;t;)(e=bt-t._time)>=0&&t._call.call(void 0,e),t=t._next;--Et}function $n(){bt=(ue=qt.now())+me,Et=Rt=0;try{_s()}finally{Et=0,ws(),bt=0}}function vs(){var t=qt.now(),e=t-ue;e>pr&&(me-=e,ue=t)}function ws(){for(var t,e=le,n,r=1/0;e;)e._call?(r>e._time&&(r=e._time),t=e,e=e._next):(n=e._next,e._next=null,e=t?t._next=n:le=n);$t=t,ze(r)}function ze(t){if(!Et){Rt&&(Rt=clearTimeout(Rt));var e=t-bt;e>24?(t<1/0&&(Rt=setTimeout($n,t-qt.now()-me)),kt&&(kt=clearInterval(kt))):(kt||(ue=qt.now(),kt=setInterval(vs,pr)),Et=1,mr($n))}}function zn(t,e,n){var r=new ce;return e=e==null?0:+e,r.restart(i=>{r.stop(),t(i+e)},e,n),r}var bs=en("start","end","cancel","interrupt"),Ts=[],yr=0,Ln=1,Le=2,ne=3,Pn=4,Pe=5,re=6;function ge(t,e,n,r,i,a){var o=t.__transition;if(!o)t.__transition={};else if(n in o)return;xs(t,n,{name:e,index:r,group:i,on:bs,tween:Ts,time:a.time,delay:a.delay,duration:a.duration,ease:a.ease,timer:null,state:yr})}function an(t,e){var n=it(t,e);if(n.state>yr)throw new Error("too late; already scheduled");return n}function lt(t,e){var n=it(t,e);if(n.state>ne)throw new Error("too late; already running");return n}function it(t,e){var n=t.__transition;if(!n||!(n=n[e]))throw new Error("transition not found");return n}function xs(t,e,n){var r=t.__transition,i;r[e]=n,n.timer=gr(a,0,n.time);function a(s){n.state=Ln,n.timer.restart(o,n.delay,n.time),n.delay<=s&&o(s-n.delay)}function o(s){var c,f,h,d;if(n.state!==Ln)return u();for(c in r)if(d=r[c],d.name===n.name){if(d.state===ne)return zn(o);d.state===Pn?(d.state=re,d.timer.stop(),d.on.call("interrupt",t,t.__data__,d.index,d.group),delete r[c]):+c<e&&(d.state=re,d.timer.stop(),d.on.call("cancel",t,t.__data__,d.index,d.group),delete r[c])}if(zn(function(){n.state===ne&&(n.state=Pn,n.timer.restart(l,n.delay,n.time),l(s))}),n.state=Le,n.on.call("start",t,t.__data__,n.index,n.group),n.state===Le){for(n.state=ne,i=new Array(h=n.tween.length),c=0,f=-1;c<h;++c)(d=n.tween[c].value.call(t,t.__data__,n.index,n.group))&&(i[++f]=d);i.length=f+1}}function l(s){for(var c=s<n.duration?n.ease.call(null,s/n.duration):(n.timer.restart(u),n.state=Pe,1),f=-1,h=i.length;++f<h;)i[f].call(t,c);n.state===Pe&&(n.on.call("end",t,t.__data__,n.index,n.group),u())}function u(){n.state=re,n.timer.stop(),delete r[e];for(var s in r)return;delete t.__transition}}function ie(t,e){var n=t.__transition,r,i,a=!0,o;if(n){e=e==null?null:e+"";for(o in n){if((r=n[o]).name!==e){a=!1;continue}i=r.state>Le&&r.state<Pe,r.state=re,r.timer.stop(),r.on.call(i?"interrupt":"cancel",t,t.__data__,r.index,r.group),delete n[o]}a&&delete t.__transition}}function Ns(t){return this.each(function(){ie(this,t)})}function Cs(t,e){var n,r;return function(){var i=lt(this,t),a=i.tween;if(a!==n){r=n=a;for(var o=0,l=r.length;o<l;++o)if(r[o].name===e){r=r.slice(),r.splice(o,1);break}}i.tween=r}}function Es(t,e,n){var r,i;if(typeof n!="function")throw new Error;return function(){var a=lt(this,t),o=a.tween;if(o!==r){i=(r=o).slice();for(var l={name:e,value:n},u=0,s=i.length;u<s;++u)if(i[u].name===e){i[u]=l;break}u===s&&i.push(l)}a.tween=i}}function Ss(t,e){var n=this._id;if(t+="",arguments.length<2){for(var r=it(this.node(),n).tween,i=0,a=r.length,o;i<a;++i)if((o=r[i]).name===t)return o.value;return null}return this.each((e==null?Cs:Es)(n,t,e))}function on(t,e,n){var r=t._id;return t.each(function(){var i=lt(this,r);(i.value||(i.value={}))[e]=n.apply(this,arguments)}),function(i){return it(i,r).value[e]}}function _r(t,e){var n;return(typeof e=="number"?mt:e instanceof Bt?kn:(n=Bt(e))?(e=n,kn):ls)(t,e)}function Ms(t){return function(){this.removeAttribute(t)}}function Ds(t){return function(){this.removeAttributeNS(t.space,t.local)}}function As(t,e,n){var r,i=n+"",a;return function(){var o=this.getAttribute(t);return o===i?null:o===r?a:a=e(r=o,n)}}function ks(t,e,n){var r,i=n+"",a;return function(){var o=this.getAttributeNS(t.space,t.local);return o===i?null:o===r?a:a=e(r=o,n)}}function Os(t,e,n){var r,i,a;return function(){var o,l=n(this),u;return l==null?void this.removeAttribute(t):(o=this.getAttribute(t),u=l+"",o===u?null:o===r&&u===i?a:(i=u,a=e(r=o,l)))}}function Rs(t,e,n){var r,i,a;return function(){var o,l=n(this),u;return l==null?void this.removeAttributeNS(t.space,t.local):(o=this.getAttributeNS(t.space,t.local),u=l+"",o===u?null:o===r&&u===i?a:(i=u,a=e(r=o,l)))}}function $s(t,e){var n=pe(t),r=n==="transform"?fs:_r;return this.attrTween(t,typeof e=="function"?(n.local?Rs:Os)(n,r,on(this,"attr."+t,e)):e==null?(n.local?Ds:Ms)(n):(n.local?ks:As)(n,r,e))}function zs(t,e){return function(n){this.setAttribute(t,e.call(this,n))}}function Ls(t,e){return function(n){this.setAttributeNS(t.space,t.local,e.call(this,n))}}function Ps(t,e){var n,r;function i(){var a=e.apply(this,arguments);return a!==r&&(n=(r=a)&&Ls(t,a)),n}return i._value=e,i}function Is(t,e){var n,r;function i(){var a=e.apply(this,arguments);return a!==r&&(n=(r=a)&&zs(t,a)),n}return i._value=e,i}function Fs(t,e){var n="attr."+t;if(arguments.length<2)return(n=this.tween(n))&&n._value;if(e==null)return this.tween(n,null);if(typeof e!="function")throw new Error;var r=pe(t);return this.tween(n,(r.local?Ps:Is)(r,e))}function Gs(t,e){return function(){an(this,t).delay=+e.apply(this,arguments)}}function Bs(t,e){return e=+e,function(){an(this,t).delay=e}}function qs(t){var e=this._id;return arguments.length?this.each((typeof t=="function"?Gs:Bs)(e,t)):it(this.node(),e).delay}function Hs(t,e){return function(){lt(this,t).duration=+e.apply(this,arguments)}}function Us(t,e){return e=+e,function(){lt(this,t).duration=e}}function Ws(t){var e=this._id;return arguments.length?this.each((typeof t=="function"?Hs:Us)(e,t)):it(this.node(),e).duration}function Vs(t,e){if(typeof e!="function")throw new Error;return function(){lt(this,t).ease=e}}function Xs(t){var e=this._id;return arguments.length?this.each(Vs(e,t)):it(this.node(),e).ease}function Ks(t,e){return function(){var n=e.apply(this,arguments);if(typeof n!="function")throw new Error;lt(this,t).ease=n}}function Ys(t){if(typeof t!="function")throw new Error;return this.each(Ks(this._id,t))}function js(t){typeof t!="function"&&(t=Zn(t));for(var e=this._groups,n=e.length,r=new Array(n),i=0;i<n;++i)for(var a=e[i],o=a.length,l=r[i]=[],u,s=0;s<o;++s)(u=a[s])&&t.call(u,u.__data__,s,a)&&l.push(u);return new dt(r,this._parents,this._name,this._id)}function Qs(t){if(t._id!==this._id)throw new Error;for(var e=this._groups,n=t._groups,r=e.length,i=n.length,a=Math.min(r,i),o=new Array(r),l=0;l<a;++l)for(var u=e[l],s=n[l],c=u.length,f=o[l]=new Array(c),h,d=0;d<c;++d)(h=u[d]||s[d])&&(f[d]=h);for(;l<r;++l)o[l]=e[l];return new dt(o,this._parents,this._name,this._id)}function Zs(t){return(t+"").trim().split(/^|\s+/).every(function(e){var n=e.indexOf(".");return n>=0&&(e=e.slice(0,n)),!e||e==="start"})}function Js(t,e,n){var r,i,a=Zs(e)?an:lt;return function(){var o=a(this,t),l=o.on;l!==r&&(i=(r=l).copy()).on(e,n),o.on=i}}function tl(t,e){var n=this._id;return arguments.length<2?it(this.node(),n).on.on(t):this.each(Js(n,t,e))}function el(t){return function(){var e=this.parentNode;for(var n in this.__transition)if(+n!==t)return;e&&e.removeChild(this)}}function nl(){return this.on("end.remove",el(this._id))}function rl(t){var e=this._name,n=this._id;typeof t!="function"&&(t=Je(t));for(var r=this._groups,i=r.length,a=new Array(i),o=0;o<i;++o)for(var l=r[o],u=l.length,s=a[o]=new Array(u),c,f,h=0;h<u;++h)(c=l[h])&&(f=t.call(c,c.__data__,h,l))&&("__data__"in c&&(f.__data__=c.__data__),s[h]=f,ge(s[h],e,n,h,s,it(c,n)));return new dt(a,this._parents,e,n)}function il(t){var e=this._name,n=this._id;typeof t!="function"&&(t=Qn(t));for(var r=this._groups,i=r.length,a=[],o=[],l=0;l<i;++l)for(var u=r[l],s=u.length,c,f=0;f<s;++f)if(c=u[f]){for(var h=t.call(c,c.__data__,f,u),d,x=it(c,n),C=0,A=h.length;C<A;++C)(d=h[C])&&ge(d,e,n,C,h,x);a.push(h),o.push(c)}return new dt(a,o,e,n)}var al=Ut.prototype.constructor;function ol(){return new al(this._groups,this._parents)}function sl(t,e){var n,r,i;return function(){var a=Ct(this,t),o=(this.style.removeProperty(t),Ct(this,t));return a===o?null:a===n&&o===r?i:i=e(n=a,r=o)}}function vr(t){return function(){this.style.removeProperty(t)}}function ll(t,e,n){var r,i=n+"",a;return function(){var o=Ct(this,t);return o===i?null:o===r?a:a=e(r=o,n)}}function ul(t,e,n){var r,i,a;return function(){var o=Ct(this,t),l=n(this),u=l+"";return l==null&&(u=l=(this.style.removeProperty(t),Ct(this,t))),o===u?null:o===r&&u===i?a:(i=u,a=e(r=o,l))}}function cl(t,e){var n,r,i,a="style."+e,o="end."+a,l;return function(){var u=lt(this,t),s=u.on,c=u.value[a]==null?l||(l=vr(e)):void 0;(s!==n||i!==c)&&(r=(n=s).copy()).on(o,i=c),u.on=r}}function hl(t,e,n){var r=(t+="")=="transform"?hs:_r;return e==null?this.styleTween(t,sl(t,r)).on("end.style."+t,vr(t)):typeof e=="function"?this.styleTween(t,ul(t,r,on(this,"style."+t,e))).each(cl(this._id,t)):this.styleTween(t,ll(t,r,e),n).on("end.style."+t,null)}function fl(t,e,n){return function(r){this.style.setProperty(t,e.call(this,r),n)}}function dl(t,e,n){var r,i;function a(){var o=e.apply(this,arguments);return o!==i&&(r=(i=o)&&fl(t,o,n)),r}return a._value=e,a}function pl(t,e,n){var r="style."+(t+="");if(arguments.length<2)return(r=this.tween(r))&&r._value;if(e==null)return this.tween(r,null);if(typeof e!="function")throw new Error;return this.tween(r,dl(t,e,n??""))}function ml(t){return function(){this.textContent=t}}function gl(t){return function(){var e=t(this);this.textContent=e??""}}function yl(t){return this.tween("text",typeof t=="function"?gl(on(this,"text",t)):ml(t==null?"":t+""))}function _l(t){return function(e){this.textContent=t.call(this,e)}}function vl(t){var e,n;function r(){var i=t.apply(this,arguments);return i!==n&&(e=(n=i)&&_l(i)),e}return r._value=t,r}function wl(t){var e="text";if(arguments.length<1)return(e=this.tween(e))&&e._value;if(t==null)return this.tween(e,null);if(typeof t!="function")throw new Error;return this.tween(e,vl(t))}function bl(){for(var t=this._name,e=this._id,n=wr(),r=this._groups,i=r.length,a=0;a<i;++a)for(var o=r[a],l=o.length,u,s=0;s<l;++s)if(u=o[s]){var c=it(u,e);ge(u,t,n,s,o,{time:c.time+c.delay+c.duration,delay:0,duration:c.duration,ease:c.ease})}return new dt(r,this._parents,t,n)}function Tl(){var t,e,n=this,r=n._id,i=n.size();return new Promise(function(a,o){var l={value:o},u={value:function(){--i===0&&a()}};n.each(function(){var s=lt(this,r),c=s.on;c!==t&&(e=(t=c).copy(),e._.cancel.push(l),e._.interrupt.push(l),e._.end.push(u)),s.on=e}),i===0&&a()})}var xl=0;function dt(t,e,n,r){this._groups=t,this._parents=e,this._name=n,this._id=r}function wr(){return++xl}var ht=Ut.prototype;dt.prototype={constructor:dt,select:rl,selectAll:il,selectChild:ht.selectChild,selectChildren:ht.selectChildren,filter:js,merge:Qs,selection:ol,transition:bl,call:ht.call,nodes:ht.nodes,node:ht.node,size:ht.size,empty:ht.empty,each:ht.each,on:tl,attr:$s,attrTween:Fs,style:hl,styleTween:pl,text:yl,textTween:wl,remove:nl,tween:Ss,delay:qs,duration:Ws,ease:Xs,easeVarying:Ys,end:Tl,[Symbol.iterator]:ht[Symbol.iterator]};function Nl(t){return((t*=2)<=1?t*t*t:(t-=2)*t*t+2)/2}var Cl={time:null,delay:0,duration:250,ease:Nl};function El(t,e){for(var n;!(n=t.__transition)||!(n=n[e]);)if(!(t=t.parentNode))throw new Error(`transition ${e} not found`);return n}function Sl(t){var e,n;t instanceof dt?(e=t._id,t=t._name):(e=wr(),(n=Cl).time=rn(),t=t==null?null:t+"");for(var r=this._groups,i=r.length,a=0;a<i;++a)for(var o=r[a],l=o.length,u,s=0;s<l;++s)(u=o[s])&&ge(u,t,e,s,o,n||El(u,e));return new dt(r,this._parents,t,e)}Ut.prototype.interrupt=Ns;Ut.prototype.transition=Sl;const jt=t=>()=>t;function Ml(t,{sourceEvent:e,target:n,transform:r,dispatch:i}){Object.defineProperties(this,{type:{value:t,enumerable:!0,configurable:!0},sourceEvent:{value:e,enumerable:!0,configurable:!0},target:{value:n,enumerable:!0,configurable:!0},transform:{value:r,enumerable:!0,configurable:!0},_:{value:i}})}function ft(t,e,n){this.k=t,this.x=e,this.y=n}ft.prototype={constructor:ft,scale:function(t){return t===1?this:new ft(this.k*t,this.x,this.y)},translate:function(t,e){return t===0&e===0?this:new ft(this.k,this.x+this.k*t,this.y+this.k*e)},apply:function(t){return[t[0]*this.k+this.x,t[1]*this.k+this.y]},applyX:function(t){return t*this.k+this.x},applyY:function(t){return t*this.k+this.y},invert:function(t){return[(t[0]-this.x)/this.k,(t[1]-this.y)/this.k]},invertX:function(t){return(t-this.x)/this.k},invertY:function(t){return(t-this.y)/this.k},rescaleX:function(t){return t.copy().domain(t.range().map(this.invertX,this).map(t.invert,t))},rescaleY:function(t){return t.copy().domain(t.range().map(this.invertY,this).map(t.invert,t))},toString:function(){return"translate("+this.x+","+this.y+") scale("+this.k+")"}};var he=new ft(1,0,0);ft.prototype;function Ne(t){t.stopImmediatePropagation()}function Ot(t){t.preventDefault(),t.stopImmediatePropagation()}function Dl(t){return(!t.ctrlKey||t.type==="wheel")&&!t.button}function Al(){var t=this;return t instanceof SVGElement?(t=t.ownerSVGElement||t,t.hasAttribute("viewBox")?(t=t.viewBox.baseVal,[[t.x,t.y],[t.x+t.width,t.y+t.height]]):[[0,0],[t.width.baseVal.value,t.height.baseVal.value]]):[[0,0],[t.clientWidth,t.clientHeight]]}function In(){return this.__zoom||he}function kl(t){return-t.deltaY*(t.deltaMode===1?.05:t.deltaMode?1:.002)*(t.ctrlKey?10:1)}function Ol(){return navigator.maxTouchPoints||"ontouchstart"in this}function Rl(t,e,n){var r=t.invertX(e[0][0])-n[0][0],i=t.invertX(e[1][0])-n[1][0],a=t.invertY(e[0][1])-n[0][1],o=t.invertY(e[1][1])-n[1][1];return t.translate(i>r?(r+i)/2:Math.min(0,r)||Math.max(0,i),o>a?(a+o)/2:Math.min(0,a)||Math.max(0,o))}function Ce(){var t=Dl,e=Al,n=Rl,r=kl,i=Ol,a=[0,1/0],o=[[-1/0,-1/0],[1/0,1/0]],l=250,u=gs,s=en("start","zoom","end"),c,f,h,d=500,x=150,C=0,A=10;function T(p){p.property("__zoom",In).on("wheel.zoom",w,{passive:!1}).on("mousedown.zoom",k).on("dblclick.zoom",D).filter(i).on("touchstart.zoom",L).on("touchmove.zoom",F).on("touchend.zoom touchcancel.zoom",W).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}T.transform=function(p,E,m,S){var O=p.selection?p.selection():p;O.property("__zoom",In),p!==O?v(p,E,m,S):O.interrupt().each(function(){N(this,arguments).event(S).start().zoom(null,typeof E=="function"?E.apply(this,arguments):E).end()})},T.scaleBy=function(p,E,m,S){T.scaleTo(p,function(){var O=this.__zoom.k,R=typeof E=="function"?E.apply(this,arguments):E;return O*R},m,S)},T.scaleTo=function(p,E,m,S){T.transform(p,function(){var O=e.apply(this,arguments),R=this.__zoom,z=m==null?M(O):typeof m=="function"?m.apply(this,arguments):m,G=R.invert(z),H=typeof E=="function"?E.apply(this,arguments):E;return n(b(_(R,H),z,G),O,o)},m,S)},T.translateBy=function(p,E,m,S){T.transform(p,function(){return n(this.__zoom.translate(typeof E=="function"?E.apply(this,arguments):E,typeof m=="function"?m.apply(this,arguments):m),e.apply(this,arguments),o)},null,S)},T.translateTo=function(p,E,m,S,O){T.transform(p,function(){var R=e.apply(this,arguments),z=this.__zoom,G=S==null?M(R):typeof S=="function"?S.apply(this,arguments):S;return n(he.translate(G[0],G[1]).scale(z.k).translate(typeof E=="function"?-E.apply(this,arguments):-E,typeof m=="function"?-m.apply(this,arguments):-m),R,o)},S,O)};function _(p,E){return E=Math.max(a[0],Math.min(a[1],E)),E===p.k?p:new ft(E,p.x,p.y)}function b(p,E,m){var S=E[0]-m[0]*p.k,O=E[1]-m[1]*p.k;return S===p.x&&O===p.y?p:new ft(p.k,S,O)}function M(p){return[(+p[0][0]+ +p[1][0])/2,(+p[0][1]+ +p[1][1])/2]}function v(p,E,m,S){p.on("start.zoom",function(){N(this,arguments).event(S).start()}).on("interrupt.zoom end.zoom",function(){N(this,arguments).event(S).end()}).tween("zoom",function(){var O=this,R=arguments,z=N(O,R).event(S),G=e.apply(O,R),H=m==null?M(G):typeof m=="function"?m.apply(O,R):m,at=Math.max(G[1][0]-G[0][0],G[1][1]-G[0][1]),V=O.__zoom,tt=typeof E=="function"?E.apply(O,R):E,ut=u(V.invert(H).concat(at/V.k),tt.invert(H).concat(at/tt.k));return function(et){if(et===1)et=tt;else{var ct=ut(et),_e=at/ct[2];et=new ft(_e,H[0]-ct[0]*_e,H[1]-ct[1]*_e)}z.zoom(null,et)}})}function N(p,E,m){return!m&&p.__zooming||new y(p,E)}function y(p,E){this.that=p,this.args=E,this.active=0,this.sourceEvent=null,this.extent=e.apply(p,E),this.taps=0}y.prototype={event:function(p){return p&&(this.sourceEvent=p),this},start:function(){return++this.active===1&&(this.that.__zooming=this,this.emit("start")),this},zoom:function(p,E){return this.mouse&&p!=="mouse"&&(this.mouse[1]=E.invert(this.mouse[0])),this.touch0&&p!=="touch"&&(this.touch0[1]=E.invert(this.touch0[0])),this.touch1&&p!=="touch"&&(this.touch1[1]=E.invert(this.touch1[0])),this.that.__zoom=E,this.emit("zoom"),this},end:function(){return--this.active===0&&(delete this.that.__zooming,this.emit("end")),this},emit:function(p){var E=Y(this.that).datum();s.call(p,this.that,new Ml(p,{sourceEvent:this.sourceEvent,target:T,transform:this.that.__zoom,dispatch:s}),E)}};function w(p,...E){if(!t.apply(this,arguments))return;var m=N(this,E).event(p),S=this.__zoom,O=Math.max(a[0],Math.min(a[1],S.k*Math.pow(2,r.apply(this,arguments)))),R=yt(p);if(m.wheel)(m.mouse[0][0]!==R[0]||m.mouse[0][1]!==R[1])&&(m.mouse[1]=S.invert(m.mouse[0]=R)),clearTimeout(m.wheel);else{if(S.k===O)return;m.mouse=[R,S.invert(R)],ie(this),m.start()}Ot(p),m.wheel=setTimeout(z,x),m.zoom("mouse",n(b(_(S,O),m.mouse[0],m.mouse[1]),m.extent,o));function z(){m.wheel=null,m.end()}}function k(p,...E){if(h||!t.apply(this,arguments))return;var m=p.currentTarget,S=N(this,E,!0).event(p),O=Y(p.view).on("mousemove.zoom",H,!0).on("mouseup.zoom",at,!0),R=yt(p,m),z=p.clientX,G=p.clientY;Ho(p.view),Ne(p),S.mouse=[R,this.__zoom.invert(R)],ie(this),S.start();function H(V){if(Ot(V),!S.moved){var tt=V.clientX-z,ut=V.clientY-G;S.moved=tt*tt+ut*ut>C}
7S.event(V).zoom("mouse",n(b(S.that.__zoom,S.mouse[0]=yt(V,m),S.mouse[1]),S.extent,o))}function at(V){O.on("mousemove.zoom mouseup.zoom",null),Uo(V.view,S.moved),Ot(V),S.event(V).end()}}function D(p,...E){if(t.apply(this,arguments)){var m=this.__zoom,S=yt(p.changedTouches?p.changedTouches[0]:p,this),O=m.invert(S),R=m.k*(p.shiftKey?.5:2),z=n(b(_(m,R),S,O),e.apply(this,E),o);Ot(p),l>0?Y(this).transition().duration(l).call(v,z,S,p):Y(this).call(T.transform,z,S,p)}}function L(p,...E){if(t.apply(this,arguments)){var m=p.touches,S=m.length,O=N(this,E,p.changedTouches.length===S).event(p),R,z,G,H;for(Ne(p),z=0;z<S;++z)G=m[z],H=yt(G,this),H=[H,this.__zoom.invert(H),G.identifier],O.touch0?!O.touch1&&O.touch0[2]!==H[2]&&(O.touch1=H,O.taps=0):(O.touch0=H,R=!0,O.taps=1+!!c);c&&(c=clearTimeout(c)),R&&(O.taps<2&&(f=H[0],c=setTimeout(function(){c=null},d)),ie(this),O.start())}}function F(p,...E){if(this.__zooming){var m=N(this,E).event(p),S=p.changedTouches,O=S.length,R,z,G,H;for(Ot(p),R=0;R<O;++R)z=S[R],G=yt(z,this),m.touch0&&m.touch0[2]===z.identifier?m.touch0[0]=G:m.touch1&&m.touch1[2]===z.identifier&&(m.touch1[0]=G);if(z=m.that.__zoom,m.touch1){var at=m.touch0[0],V=m.touch0[1],tt=m.touch1[0],ut=m.touch1[1],et=(et=tt[0]-at[0])*et+(et=tt[1]-at[1])*et,ct=(ct=ut[0]-V[0])*ct+(ct=ut[1]-V[1])*ct;z=_(z,Math.sqrt(et/ct)),G=[(at[0]+tt[0])/2,(at[1]+tt[1])/2],H=[(V[0]+ut[0])/2,(V[1]+ut[1])/2]}else if(m.touch0)G=m.touch0[0],H=m.touch0[1];else return;m.zoom("touch",n(b(z,G,H),m.extent,o))}}function W(p,...E){if(this.__zooming){var m=N(this,E).event(p),S=p.changedTouches,O=S.length,R,z;for(Ne(p),h&&clearTimeout(h),h=setTimeout(function(){h=null},d),R=0;R<O;++R)z=S[R],m.touch0&&m.touch0[2]===z.identifier?delete m.touch0:m.touch1&&m.touch1[2]===z.identifier&&delete m.touch1;if(m.touch1&&!m.touch0&&(m.touch0=m.touch1,delete m.touch1),m.touch0)m.touch0[1]=this.__zoom.invert(m.touch0[0]);else if(m.end(),m.taps===2&&(z=yt(z,this),Math.hypot(f[0]-z[0],f[1]-z[1])<A)){var G=Y(this).on("dblclick.zoom");G&&G.apply(this,arguments)}}}return T.wheelDelta=function(p){return arguments.length?(r=typeof p=="function"?p:jt(+p),T):r},T.filter=function(p){return arguments.length?(t=typeof p=="function"?p:jt(!!p),T):t},T.touchable=function(p){return arguments.length?(i=typeof p=="function"?p:jt(!!p),T):i},T.extent=function(p){return arguments.length?(e=typeof p=="function"?p:jt([[+p[0][0],+p[0][1]],[+p[1][0],+p[1][1]]]),T):e},T.scaleExtent=function(p){return arguments.length?(a[0]=+p[0],a[1]=+p[1],T):[a[0],a[1]]},T.translateExtent=function(p){return arguments.length?(o[0][0]=+p[0][0],o[1][0]=+p[1][0],o[0][1]=+p[0][1],o[1][1]=+p[1][1],T):[[o[0][0],o[0][1]],[o[1][0],o[1][1]]]},T.constrain=function(p){return arguments.length?(n=p,T):n},T.duration=function(p){return arguments.length?(l=+p,T):l},T.interpolate=function(p){return arguments.length?(u=p,T):u},T.on=function(){var p=s.on.apply(s,arguments);return p===s?T:p},T.clickDistance=function(p){return arguments.length?(C=(p=+p)*p,T):Math.sqrt(C)},T.tapDistance=function(p){return arguments.length?(A=+p,T):A},T}var Fn=Object.prototype.hasOwnProperty;function zt(t,e){var n,r;if(t===e)return!0;if(t&&e&&(n=t.constructor)===e.constructor){if(n===Date)return t.getTime()===e.getTime();if(n===RegExp)return t.toString()===e.toString();if(n===Array){if((r=t.length)===e.length)for(;r--&&zt(t[r],e[r]););return r===-1}if(!n||typeof t=="object"){r=0;for(n in t)if(Fn.call(t,n)&&++r&&!Fn.call(e,n)||!(n in e)||!zt(t[n],e[n]))return!1;return Object.keys(e).length===r}}return t!==t&&e!==e}var br={exports:{}};(function(t){var e=function(){function n(h,d){return d!=null&&h instanceof d}var r;try{r=Map}catch{r=function(){}}var i;try{i=Set}catch{i=function(){}}var a;try{a=Promise}catch{a=function(){}}function o(h,d,x,C,A){typeof d=="object"&&(x=d.depth,C=d.prototype,A=d.includeNonEnumerable,d=d.circular);var T=[],_=[],b=typeof Buffer<"u";typeof d>"u"&&(d=!0),typeof x>"u"&&(x=1/0);function M(v,N){if(v===null)return null;if(N===0)return v;var y,w;if(typeof v!="object")return v;if(n(v,r))y=new r;else if(n(v,i))y=new i;else if(n(v,a))y=new a(function(S,O){v.then(function(R){S(M(R,N-1))},function(R){O(M(R,N-1))})});else if(o.__isArray(v))y=[];else if(o.__isRegExp(v))y=new RegExp(v.source,f(v)),v.lastIndex&&(y.lastIndex=v.lastIndex);else if(o.__isDate(v))y=new Date(v.getTime());else{if(b&&Buffer.isBuffer(v))return Buffer.allocUnsafe?y=Buffer.allocUnsafe(v.length):y=new Buffer(v.length),v.copy(y),y;n(v,Error)?y=Object.create(v):typeof C>"u"?(w=Object.getPrototypeOf(v),y=Object.create(w)):(y=Object.create(C),w=C)}if(d){var k=T.indexOf(v);if(k!=-1)return _[k];T.push(v),_.push(y)}n(v,r)&&v.forEach(function(S,O){var R=M(O,N-1),z=M(S,N-1);y.set(R,z)}),n(v,i)&&v.forEach(function(S){var O=M(S,N-1);y.add(O)});for(var D in v){var L;w&&(L=Object.getOwnPropertyDescriptor(w,D)),!(L&&L.set==null)&&(y[D]=M(v[D],N-1))}if(Object.getOwnPropertySymbols)for(var F=Object.getOwnPropertySymbols(v),D=0;D<F.length;D++){var W=F[D],p=Object.getOwnPropertyDescriptor(v,W);p&&!p.enumerable&&!A||(y[W]=M(v[W],N-1),p.enumerable||Object.defineProperty(y,W,{enumerable:!1}))}if(A)for(var E=Object.getOwnPropertyNames(v),D=0;D<E.length;D++){var m=E[D],p=Object.getOwnPropertyDescriptor(v,m);p&&p.enumerable||(y[m]=M(v[m],N-1),Object.defineProperty(y,m,{enumerable:!1}))}return y}return M(h,x)}o.clonePrototype=function(d){if(d===null)return null;var x=function(){};return x.prototype=d,new x};function l(h){return Object.prototype.toString.call(h)}o.__objToStr=l;function u(h){return typeof h=="object"&&l(h)==="[object Date]"}o.__isDate=u;function s(h){return typeof h=="object"&&l(h)==="[object Array]"}o.__isArray=s;function c(h){return typeof h=="object"&&l(h)==="[object RegExp]"}o.__isRegExp=c;function f(h){var d="";return h.global&&(d+="g"),h.ignoreCase&&(d+="i"),h.multiline&&(d+="m"),d}return o.__getRegExpFlags=f,o}();t.exports&&(t.exports=e)})(br);var $l=br.exports;const K=si($l);var Qt,zl=new Uint8Array(16);function Ll(){if(!Qt&&(Qt=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||typeof msCrypto<"u"&&typeof msCrypto.getRandomValues=="function"&&msCrypto.getRandomValues.bind(msCrypto),!Qt))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return Qt(zl)}const Pl=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i;function Il(t){return typeof t=="string"&&Pl.test(t)}var X=[];for(var Ee=0;Ee<256;++Ee)X.push((Ee+256).toString(16).substr(1));function Fl(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,n=(X[t[e+0]]+X[t[e+1]]+X[t[e+2]]+X[t[e+3]]+"-"+X[t[e+4]]+X[t[e+5]]+"-"+X[t[e+6]]+X[t[e+7]]+"-"+X[t[e+8]]+X[t[e+9]]+"-"+X[t[e+10]]+X[t[e+11]]+X[t[e+12]]+X[t[e+13]]+X[t[e+14]]+X[t[e+15]]).toLowerCase();
7if(!Il(n))throw TypeError("Stringified UUID is invalid");return n}function Se(t,e,n){t=t||{};var r=t.random||(t.rng||Ll)();return r[6]=r[6]&15|64,r[8]=r[8]&63|128,Fl(r)}var Ie={exports:{}},Fe={exports:{}},Gl=function(){for(var e=arguments.length,n=[],r=0;r<e;r++)n[r]=arguments[r];if(n=n.filter(function(i){return i!=null}),n.length!==0)return n.length===1?n[0]:n.reduce(function(i,a){return function(){i.apply(this,arguments),a.apply(this,arguments)}})},Bl=function(){},ql=Bl;function Tr(){var t=this.constructor.getDerivedStateFromProps(this.props,this.state);t!=null&&this.setState(t)}function xr(t){function e(n){var r=this.constructor.getDerivedStateFromProps(t,n);return r??null}this.setState(e.bind(this))}function Nr(t,e){try{var n=this.props,r=this.state;this.props=t,this.state=e,this.__reactInternalSnapshotFlag=!0,this.__reactInternalSnapshot=this.getSnapshotBeforeUpdate(n,r)}finally{this.props=n,this.state=r}}Tr.__suppressDeprecationWarning=!0;xr.__suppressDeprecationWarning=!0;Nr.__suppressDeprecationWarning=!0;function Hl(t){var e=t.prototype;if(!e||!e.isReactComponent)throw new Error("Can only polyfill class components");if(typeof t.getDerivedStateFromProps!="function"&&typeof e.getSnapshotBeforeUpdate!="function")return t;var n=null,r=null,i=null;if(typeof e.componentWillMount=="function"?n="componentWillMount":typeof e.UNSAFE_componentWillMount=="function"&&(n="UNSAFE_componentWillMount"),typeof e.componentWillReceiveProps=="function"?r="componentWillReceiveProps":typeof e.UNSAFE_componentWillReceiveProps=="function"&&(r="UNSAFE_componentWillReceiveProps"),typeof e.componentWillUpdate=="function"?i="componentWillUpdate":typeof e.UNSAFE_componentWillUpdate=="function"&&(i="UNSAFE_componentWillUpdate"),n!==null||r!==null||i!==null){var a=t.displayName||t.name,o=typeof t.getDerivedStateFromProps=="function"?"getDerivedStateFromProps()":"getSnapshotBeforeUpdate()";throw Error(`Unsafe legacy lifecycles will not be called for components using new component APIs. 8 9`+a+" uses "+o+" but also contains the following legacy lifecycles:"+(n!==null?` 10 `+n:"")+(r!==null?` 11 `+r:"")+(i!==null?` 12 `+i:"")+` 13 14The above lifecycles should be removed. Learn more about this warning here: 15https://fb.me/react-async-component-lifecycle-hooks`)}if(typeof t.getDerivedStateFromProps=="function"&&(e.componentWillMount=Tr,e.componentWillReceiveProps=xr),typeof e.getSnapshotBeforeUpdate=="function"){if(typeof e.componentDidUpdate!="function")throw new Error("Cannot polyfill getSnapshotBeforeUpdate() for components that do not define componentDidUpdate() on the prototype");e.componentWillUpdate=Nr;var l=e.componentDidUpdate;e.componentDidUpdate=function(s,c,f){var h=this.__reactInternalSnapshotFlag?this.__reactInternalSnapshot:f;l.call(this,s,c,h)}}return t}const Ul=Object.freeze(Object.defineProperty({__proto__:null,polyfill:Hl},Symbol.toStringTag,{value:"Module"})),Wl=li(Ul);var ye={};ye.__esModule=!0;ye.getChildMapping=Xl;ye.mergeChildMappings=Kl;var Vl=I;function Xl(t){if(!t)return t;var e={};return Vl.Children.map(t,function(n){return n}).forEach(function(n){e[n.key]=n}),e}function Kl(t,e){t=t||{},e=e||{};function n(c){return e.hasOwnProperty(c)?e[c]:t[c]}var r={},i=[];for(var a in t)e.hasOwnProperty(a)?i.length&&(r[a]=i,i=[]):i.push(a);var o=void 0,l={};for(var u in e){if(r.hasOwnProperty(u))for(o=0;o<r[u].length;o++){var s=r[u][o];l[r[u][o]]=n(s)}l[u]=n(u)}for(o=0;o<i.length;o++)l[i[o]]=n(i[o]);return l}(function(t,e){e.__esModule=!0;var n=Object.assign||function(_){for(var b=1;b<arguments.length;b++){var M=arguments[b];for(var v in M)Object.prototype.hasOwnProperty.call(M,v)&&(_[v]=M[v])}return _},r=Gl,i=h(r),a=I,o=h(a),l=de,u=h(l),s=ql;h(s);var c=Wl,f=ye;function h(_){return _&&_.__esModule?_:{default:_}}function d(_,b){if(!(_ instanceof b))throw new TypeError("Cannot call a class as a function")}function x(_,b){if(!_)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return b&&(typeof b=="object"||typeof b=="function")?b:_}function C(_,b){if(typeof b!="function"&&b!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof b);_.prototype=Object.create(b&&b.prototype,{constructor:{value:_,enumerable:!1,writable:!0,configurable:!0}}),b&&(Object.setPrototypeOf?Object.setPrototypeOf(_,b):_.__proto__=b)}u.default.any,u.default.func,u.default.node;var A={component:"span",childFactory:function(b){return b}},T=function(_){C(b,_);function b(M,v){d(this,b);var N=x(this,_.call(this,M,v));return N.performAppear=function(y,w){N.currentlyTransitioningKeys[y]=!0,w.componentWillAppear?w.componentWillAppear(N._handleDoneAppearing.bind(N,y,w)):N._handleDoneAppearing(y,w)}
15,N._handleDoneAppearing=function(y,w){w&&w.componentDidAppear&&w.componentDidAppear(),delete N.currentlyTransitioningKeys[y];var k=(0,f.getChildMapping)(N.props.children);(!k||!k.hasOwnProperty(y))&&N.performLeave(y,w)},N.performEnter=function(y,w){N.currentlyTransitioningKeys[y]=!0,w.componentWillEnter?w.componentWillEnter(N._handleDoneEntering.bind(N,y,w)):N._handleDoneEntering(y,w)},N._handleDoneEntering=function(y,w){w&&w.componentDidEnter&&w.componentDidEnter(),delete N.currentlyTransitioningKeys[y];var k=(0,f.getChildMapping)(N.props.children);(!k||!k.hasOwnProperty(y))&&N.performLeave(y,w)},N.performLeave=function(y,w){N.currentlyTransitioningKeys[y]=!0,w&&w.componentWillLeave?w.componentWillLeave(N._handleDoneLeaving.bind(N,y,w)):N._handleDoneLeaving(y,w)},N._handleDoneLeaving=function(y,w){w&&w.componentDidLeave&&w.componentDidLeave(),delete N.currentlyTransitioningKeys[y];var k=(0,f.getChildMapping)(N.props.children);k&&k.hasOwnProperty(y)?N.keysToEnter.push(y):N.setState(function(D){var L=n({},D.children);return delete L[y],{children:L}})},N.childRefs=Object.create(null),N.currentlyTransitioningKeys={},N.keysToEnter=[],N.keysToLeave=[],N.state={children:(0,f.getChildMapping)(M.children)},N}return b.prototype.componentDidMount=function(){var v=this.state.children;for(var N in v)v[N]&&this.performAppear(N,this.childRefs[N])},b.getDerivedStateFromProps=function(v,N){var y=(0,f.getChildMapping)(v.children),w=N.children;return{children:(0,f.mergeChildMappings)(w,y)}},b.prototype.componentDidUpdate=function(v,N){var y=this,w=(0,f.getChildMapping)(this.props.children),k=N.children;for(var D in w){var L=k&&k.hasOwnProperty(D);w[D]&&!L&&!this.currentlyTransitioningKeys[D]&&this.keysToEnter.push(D)}for(var F in k){var W=w&&w.hasOwnProperty(F);k[F]&&!W&&!this.currentlyTransitioningKeys[F]&&this.keysToLeave.push(F)}var p=this.keysToEnter;this.keysToEnter=[],p.forEach(function(m){return y.performEnter(m,y.childRefs[m])});var E=this.keysToLeave;this.keysToLeave=[],E.forEach(function(m){return y.performLeave(m,y.childRefs[m])})},b.prototype.render=function(){var v=this,N=[],y=function(L){var F=v.state.children[L];if(F){var W=typeof F.ref!="string",p=v.props.childFactory(F),E=function(S){v.childRefs[L]=S};p===F&&W&&(E=(0,i.default)(F.ref,E)),N.push(o.default.cloneElement(p,{key:L,ref:E}))}};for(var w in this.state.children)y(w);var k=n({},this.props);return delete k.transitionLeave,delete k.transitionName,delete k.transitionAppear,delete k.transitionEnter,delete k.childFactory,delete k.transitionLeaveTimeout,delete k.transitionEnterTimeout,delete k.transitionAppearTimeout,delete k.component,o.default.createElement(this.props.component,k,N)},b}(o.default.Component);T.displayName="TransitionGroup",T.propTypes={},T.defaultProps=A,e.default=(0,c.polyfill)(T),t.exports=e.default})(Fe,Fe.exports);var Cr=Fe.exports,Ge={exports:{}},Be={exports:{}},Zt={exports:{}},Gn;function Yl(){return Gn||(Gn=1,function(t,e){e.__esModule=!0,e.default=n;function n(r,i){return r.classList?!!i&&r.classList.contains(i):(" "+(r.className.baseVal||r.className)+" ").indexOf(" "+i+" ")!==-1}t.exports=e.default}(Zt,Zt.exports)),Zt.exports}(function(t,e){var n=Xe;e.__esModule=!0,e.default=i;var r=n(Yl());function i(a,o){a.classList?a.classList.add(o):(0,r.default)(a,o)||(typeof a.className=="string"?a.className=a.className+" "+o:a.setAttribute("class",(a.className&&a.className.baseVal||"")+" "+o))}t.exports=e.default})(Be,Be.exports);var jl=Be.exports;function Bn(t,e){return t.replace(new RegExp("(^|\\s)"+e+"(?:\\s|$)","g"),"$1").replace(/\s+/g," ").replace(/^\s*|\s*$/g,"")}var Ql=function(e,n){e.classList?e.classList.remove(n):typeof e.className=="string"?e.className=Bn(e.className,n):e.setAttribute("class",Bn(e.className&&e.className.baseVal||"",n))},qe={exports:{}},Jt={exports:{}},qn;function Er(){return qn||(qn=1,function(t,e){e.__esModule=!0,e.default=void 0;var n=!!(typeof window<"u"&&window.document&&window.document.createElement);e.default=n,t.exports=e.default}(Jt,Jt.exports)),Jt.exports}(function(t,e){var n=Xe;e.__esModule=!0,e.default=void 0;var r=n(Er()),i=["","webkit","moz","o","ms"],a="clearTimeout",o=c,l,u=function(d,x){return d+(d?x[0].toUpperCase()+x.substr(1):x)+"AnimationFrame"};r.default&&i.some(function(h){var d=u(h,"request");
15if(d in window)return a=u(h,"cancel"),o=function(C){return window[d](C)}});var s=new Date().getTime();function c(h){var d=new Date().getTime(),x=Math.max(0,16-(d-s)),C=setTimeout(h,x);return s=d,C}l=function(d){return o(d)},l.cancel=function(h){window[a]&&typeof window[a]=="function"&&window[a](h)};var f=l;e.default=f,t.exports=e.default})(qe,qe.exports);var Zl=qe.exports,P={},Jl=Xe;P.__esModule=!0;P.default=P.animationEnd=P.animationDelay=P.animationTiming=P.animationDuration=P.animationName=P.transitionEnd=P.transitionDuration=P.transitionDelay=P.transitionTiming=P.transitionProperty=P.transform=void 0;var tu=Jl(Er()),fe="transform";P.transform=fe;var ot,sn,Sr;P.animationEnd=Sr;P.transitionEnd=sn;var ln,un,cn,hn;P.transitionDelay=hn;P.transitionTiming=cn;P.transitionDuration=un;P.transitionProperty=ln;var Mr,Dr,Ar,kr;P.animationDelay=kr;P.animationTiming=Ar;P.animationDuration=Dr;P.animationName=Mr;if(tu.default){var Me=nu();ot=Me.prefix,P.transitionEnd=sn=Me.transitionEnd,P.animationEnd=Sr=Me.animationEnd,P.transform=fe=ot+"-"+fe,P.transitionProperty=ln=ot+"-transition-property",P.transitionDuration=un=ot+"-transition-duration",P.transitionDelay=hn=ot+"-transition-delay",P.transitionTiming=cn=ot+"-transition-timing-function",P.animationName=Mr=ot+"-animation-name",P.animationDuration=Dr=ot+"-animation-duration",P.animationTiming=Ar=ot+"-animation-delay",P.animationDelay=kr=ot+"-animation-timing-function"}var eu={transform:fe,end:sn,property:ln,timing:cn,delay:hn,duration:un};P.default=eu;function nu(){for(var t=document.createElement("div").style,e={O:function(s){return"o"+s.toLowerCase()},Moz:function(s){return s.toLowerCase()},Webkit:function(s){return"webkit"+s},ms:function(s){return"MS"+s}},n=Object.keys(e),r,i,a="",o=0;o<n.length;o++){var l=n[o];if(l+"TransitionProperty"in t){a="-"+l.toLowerCase(),r=e[l]("TransitionEnd"),i=e[l]("AnimationEnd");break}}return!r&&"transitionProperty"in t&&(r="transitionend"),!i&&"animationName"in t&&(i="animationend"),t=null,{animationEnd:i,transitionEnd:r,prefix:a}}var St={};St.__esModule=!0;St.nameShape=void 0;St.transitionTimeout=au;var ru=I;Or(ru);var iu=de,Q=Or(iu);function Or(t){return t&&t.__esModule?t:{default:t}}function au(t){var e="transition"+t+"Timeout",n="transition"+t;return function(r){if(r[n]){if(r[e]==null)return new Error(e+" wasn't supplied to CSSTransitionGroup: this can cause unreliable animations and won't be supported in a future version of React. See https://fb.me/react-animation-transition-group-timeout for more information.");if(typeof r[e]!="number")return new Error(e+" must be a number (in milliseconds)")}return null}}St.nameShape=Q.default.oneOfType([Q.default.string,Q.default.shape({enter:Q.default.string,leave:Q.default.string,active:Q.default.string}),Q.default.shape({enter:Q.default.string,enterActive:Q.default.string,leave:Q.default.string,leaveActive:Q.default.string,appear:Q.default.string,appearActive:Q.default.string})]);(function(t,e){e.__esModule=!0;var n=Object.assign||function(y){for(var w=1;w<arguments.length;w++){var k=arguments[w];for(var D in k)Object.prototype.hasOwnProperty.call(k,D)&&(y[D]=k[D])}return y},r=jl,i=A(r),a=Ql,o=A(a),l=Zl,u=A(l),s=P,c=I,f=A(c),h=de,d=A(h),x=Lr,C=St;function A(y){return y&&y.__esModule?y:{default:y}}function T(y,w){if(!(y instanceof w))throw new TypeError("Cannot call a class as a function")}function _(y,w){if(!y)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return w&&(typeof w=="object"||typeof w=="function")?w:y}function b(y,w){if(typeof w!="function"&&w!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof w);y.prototype=Object.create(w&&w.prototype,{constructor:{value:y,enumerable:!1,writable:!0,configurable:!0}}),w&&(Object.setPrototypeOf?Object.setPrototypeOf(y,w):y.__proto__=w)}var M=[];s.transitionEnd&&M.push(s.transitionEnd),s.animationEnd&&M.push(s.animationEnd);function v(y,w){return M.length?M.forEach(function(k){return y.addEventListener(k,w,!1)}):setTimeout(w,0),function(){M.length&&M.forEach(function(k){return y.removeEventListener(k,w,!1)})}}d.default.node,C.nameShape.isRequired,d.default.bool,d.default.bool,d.default.bool,d.default.number,d.default.number,d.default.number;var N=function(y){b(w,y);function w(k,D){T(this,w);var L=_(this,y.call(this,k,D));return L.componentWillAppear=function(F){L.props.appear?L.transition("appear",F,L.props.appearTimeout):F()},L.componentWillEnter=function(F){L.props.enter?L.transition("enter",F,L.props.enterTimeout):F()},L.componentWillLeave=function(F){L.props.leave?L.transition("leave",F,L.props.leaveTimeout):F()},L.classNameAndNodeQueue=[],L.transitionTimeouts=[],L}return w.prototype.componentWillUnmount=function(){this.unmounted=!0,this.timeout&&clearTimeout(this.timeout),this.transitionTimeouts.forEac
15h(function(D){clearTimeout(D)}),this.classNameAndNodeQueue.length=0},w.prototype.transition=function(D,L,F){var W=(0,x.findDOMNode)(this);if(!W){L&&L();return}var p=this.props.name[D]||this.props.name+"-"+D,E=this.props.name[D+"Active"]||p+"-active",m=null,S=void 0;(0,i.default)(W,p),this.queueClassAndNode(E,W);var O=function(z){z&&z.target!==W||(clearTimeout(m),S&&S(),(0,o.default)(W,p),(0,o.default)(W,E),S&&S(),L&&L())};F?(m=setTimeout(O,F),this.transitionTimeouts.push(m)):s.transitionEnd&&(S=v(W,O))},w.prototype.queueClassAndNode=function(D,L){var F=this;this.classNameAndNodeQueue.push({className:D,node:L}),this.rafHandle||(this.rafHandle=(0,u.default)(function(){return F.flushClassNameAndNodeQueue()}))},w.prototype.flushClassNameAndNodeQueue=function(){this.unmounted||this.classNameAndNodeQueue.forEach(function(D){D.node.scrollTop,(0,i.default)(D.node,D.className)}),this.classNameAndNodeQueue.length=0,this.rafHandle=null},w.prototype.render=function(){var D=n({},this.props);return delete D.name,delete D.appear,delete D.enter,delete D.leave,delete D.appearTimeout,delete D.enterTimeout,delete D.leaveTimeout,delete D.children,f.default.cloneElement(f.default.Children.only(this.props.children),D)},w}(f.default.Component);N.displayName="CSSTransitionGroupChild",N.propTypes={},e.default=N,t.exports=e.default})(Ge,Ge.exports);var ou=Ge.exports;(function(t,e){e.__esModule=!0;var n=Object.assign||function(_){for(var b=1;b<arguments.length;b++){var M=arguments[b];for(var v in M)Object.prototype.hasOwnProperty.call(M,v)&&(_[v]=M[v])}return _},r=I,i=h(r),a=de,o=h(a),l=Cr,u=h(l),s=ou,c=h(s),f=St;function h(_){return _&&_.__esModule?_:{default:_}}function d(_,b){if(!(_ instanceof b))throw new TypeError("Cannot call a class as a function")}function x(_,b){if(!_)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return b&&(typeof b=="object"||typeof b=="function")?b:_}function C(_,b){if(typeof b!="function"&&b!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof b);_.prototype=Object.create(b&&b.prototype,{constructor:{value:_,enumerable:!1,writable:!0,configurable:!0}}),b&&(Object.setPrototypeOf?Object.setPrototypeOf(_,b):_.__proto__=b)}f.nameShape.isRequired,o.default.bool,o.default.bool,o.default.bool,(0,f.transitionTimeout)("Appear"),(0,f.transitionTimeout)("Enter"),(0,f.transitionTimeout)("Leave");var A={transitionAppear:!1,transitionEnter:!0,transitionLeave:!0},T=function(_){C(b,_);function b(){var M,v,N;d(this,b);for(var y=arguments.length,w=Array(y),k=0;k<y;k++)w[k]=arguments[k];return N=(M=(v=x(this,_.call.apply(_,[this].concat(w))),v),v._wrapChild=function(D){return i.default.createElement(c.default,{name:v.props.transitionName,appear:v.props.transitionAppear,enter:v.props.transitionEnter,leave:v.props.transitionLeave,appearTimeout:v.props.transitionAppearTimeout,enterTimeout:v.props.transitionEnterTimeout,leaveTimeout:v.props.transitionLeaveTimeout},D)},M),x(v,N)}return b.prototype.render=function(){return i.default.createElement(u.default,n({},this.props,{childFactory:this._wrapChild}))},b}(i.default.Component);T.displayName="CSSTransitionGroup",T.propTypes={},T.defaultProps=A,e.default=T,t.exports=e.default})(Ie,Ie.exports);var su=Ie.exports,lu=su,uu=Rr(lu),cu=Cr,hu=Rr(cu);function Rr(t){return t&&t.__esModule?t:{default:t}}var fu={TransitionGroup:hu.default,CSSTransitionGroup:uu.default};const du=t=>t.enableLegacyTransitions?U.createElement(fu.TransitionGroup,{component:t.component,className:t.className,transform:t.transform},t.children):U.createElement("g",{className:t.className,transform:t.transform},t.children),pu=15,Hn={title:{textAnchor:"start",x:40},attribute:{x:40,dy:"1.2em"}},mu=({nodeDatum:t,toggleNode:e,onNodeClick:n,onNodeMouseOver:r,onNodeMouseOut:i})=>U.createElement(U.Fragment,null,U.createElement("circle",{r:pu,onClick:a=>{e(),n(a)},onMouseOver:r,onMouseOut:i}),U.createElement("g",{className:"rd3t-label"},U.createElement("text",Object.assign({className:"rd3t-label__title"},Hn.title),t.name),U.createElement("text",{className:"rd3t-label__attributes"},t.attributes&&Object.entries(t.attributes).map(([a,o],l)=>U.createElement("tspan",Object.assign({key:`${a}-${l}`},Hn.attribute),a,": ",typeof o=="boolean"?o.toString():o)))));class gu extends U.Component{constructor(){super(...arguments),this.nodeRef=null,this.state={transform:this.setTransform(this.props.position,this.props.parent,this.props.orientation,!0),initialStyle:{opacity:0}
15,wasClicked:!1},this.shouldNodeTransform=(e,n,r,i)=>n.subscriptions!==e.subscriptions||n.position.x!==e.position.x||n.position.y!==e.position.y||n.orientation!==e.orientation||i.wasClicked!==r.wasClicked,this.renderNodeElement=()=>{const{data:e,hierarchyPointNode:n,renderCustomNodeElement:r}=this.props,i=typeof r=="function"?r:mu,a={hierarchyPointNode:n,nodeDatum:e,toggleNode:this.handleNodeToggle,onNodeClick:this.handleOnClick,onNodeMouseOver:this.handleOnMouseOver,onNodeMouseOut:this.handleOnMouseOut,addChildren:this.handleAddChildren};return i(a)},this.handleNodeToggle=()=>{this.setState({wasClicked:!0}),this.props.onNodeToggle(this.props.data.__rd3t.id)},this.handleOnClick=e=>{this.setState({wasClicked:!0}),this.props.onNodeClick(this.props.hierarchyPointNode,e)},this.handleOnMouseOver=e=>{this.props.onNodeMouseOver(this.props.hierarchyPointNode,e)},this.handleOnMouseOut=e=>{this.props.onNodeMouseOut(this.props.hierarchyPointNode,e)},this.handleAddChildren=e=>{this.props.handleAddChildrenToNode(this.props.data.__rd3t.id,e)}}componentDidMount(){this.commitTransform()}componentDidUpdate(){this.state.wasClicked&&(this.props.centerNode(this.props.hierarchyPointNode),this.setState({wasClicked:!1})),this.commitTransform()}shouldComponentUpdate(e,n){return this.shouldNodeTransform(this.props,e,this.state,n)}setTransform(e,n,r,i=!1){if(i){const a=n!=null,o=a?n.x:0,l=a?n.y:0;return r==="horizontal"?`translate(${l},${o})`:`translate(${o},${l})`}return r==="horizontal"?`translate(${e.y},${e.x})`:`translate(${e.x},${e.y})`}applyTransform(e,n,r=1,i=()=>{}){this.props.enableLegacyTransitions?Y(this.nodeRef).transition().duration(n).attr("transform",e).style("opacity",r).on("end",i):(Y(this.nodeRef).attr("transform",e).style("opacity",r),i())}commitTransform(){const{orientation:e,transitionDuration:n,position:r,parent:i}=this.props,a=this.setTransform(r,i,e);this.applyTransform(a,n)}componentWillLeave(e){const{orientation:n,transitionDuration:r,position:i,parent:a}=this.props,o=this.setTransform(i,a,n,!0);this.applyTransform(o,r,0,e)}render(){const{data:e,nodeClassName:n}=this.props;return U.createElement("g",{id:e.__rd3t.id,ref:r=>{this.nodeRef=r},style:this.state.initialStyle,className:[e.children&&e.children.length>0?"rd3t-node":"rd3t-leaf-node",n].join(" ").trim(),transform:this.state.transform},this.renderNodeElement())}}var He=Math.PI,Ue=2*He,_t=1e-6,yu=Ue-_t;function We(){this._x0=this._y0=this._x1=this._y1=null,this._=""}function $r(){return new We}We.prototype=$r.prototype={constructor:We,moveTo:function(t,e){this._+="M"+(this._x0=this._x1=+t)+","+(this._y0=this._y1=+e)},closePath:function(){this._x1!==null&&(this._x1=this._x0,this._y1=this._y0,this._+="Z")},lineTo:function(t,e){this._+="L"+(this._x1=+t)+","+(this._y1=+e)},quadraticCurveTo:function(t,e,n,r){this._+="Q"+ +t+","+ +e+","+(this._x1=+n)+","+(this._y1=+r)},bezierCurveTo:function(t,e,n,r,i,a){this._+="C"+ +t+","+ +e+","+ +n+","+ +r+","+(this._x1=+i)+","+(this._y1=+a)},arcTo:function(t,e,n,r,i){t=+t,e=+e,n=+n,r=+r,i=+i;var a=this._x1,o=this._y1,l=n-t,u=r-e,s=a-t,c=o-e,f=s*s+c*c;if(i<0)throw new Error("negative radius: "+i);if(this._x1===null)this._+="M"+(this._x1=t)+","+(this._y1=e);else if(f>_t)if(!(Math.abs(c*l-u*s)>_t)||!i)this._+="L"+(this._x1=t)+","+(this._y1=e);else{var h=n-a,d=r-o,x=l*l+u*u,C=h*h+d*d,A=Math.sqrt(x),T=Math.sqrt(f),_=i*Math.tan((He-Math.acos((x+f-C)/(2*A*T)))/2),b=_/T,M=_/A;Math.abs(b-1)>_t&&(this._+="L"+(t+b*s)+","+(e+b*c)),this._+="A"+i+","+i+",0,0,"+ +(c*h>s*d)+","+(this._x1=t+M*l)+","+(this._y1=e+M*u)}},arc:function(t,e,n,r,i,a){t=+t,e=+e,n=+n,a=!!a;var o=n*Math.cos(r),l=n*Math.sin(r),u=t+o,s=e+l,c=1^a,f=a?r-i:i-r;if(n<0)throw new Error("negative radius: "+n);this._x1===null?this._+="M"+u+","+s:(Math.abs(this._x1-u)>_t||Math.abs(this._y1-s)>_t)&&(this._+="L"+u+","+s),n&&(f<0&&(f=f%Ue+Ue),f>yu?this._+="A"+n+","+n+",0,1,"+c+","+(t-o)+","+(e-l)+"A"+n+","+n+",0,1,"+c+","+(this._x1=u)+","+(this._y1=s):f>_t&&(this._+="A"+n+","+n+",0,"+ +(f>=He)+","+c+","+(this._x1=t+n*Math.cos(i))+","+(this._y1=e+n*Math.sin(i))))},rect:function(t,e,n,r){this._+="M"+(this._x0=this._x1=+t)+","+(this._y0=this._y1=+e)+"h"+ +n+"v"+ +r+"h"+-n+"Z"},toString:function(){return this._}};function Un(t){return function(){return t}}function _u(t){return t[0]}function vu(t){return t[1]}var wu=Array.prototype.slice;function bu(t){return t.source}function Tu(t){return t.target}function zr(t){var e=bu,n=Tu,r=_u,i=vu,a=null;function o(){var l,u=wu.call(arguments),s=e.apply(this,u),c=n.apply(this,u);if(a||(a=l=$r()),t(a,+r.apply(this,(u[0]=s,u)),+i.apply(this,u),+r.apply(this,(u[0]=c,u)),+i.apply(this,u)),l)return a=null,l+""||null}return o.source=function(l){return arguments.length?(e=l,o):e},o.target=function(l){return arguments.length?(n=l,o):n},o.x=function(l){return arguments.length?(r=typeof l=="function"?l:Un(+l),o):r},o.y=function(l){return arguments.length?(i=typeof l=="function"?l:Un(+l),o):i},o.context=function(l){return arguments.length?(a=l??null,o):a},o}function xu(t,e,n,r,i){t.moveTo(e,n),t.bezierCurveTo(e=(e+r)/2,n,e,i,r,i)}function Nu(t,e,n,r,i){t.moveTo(e,n),t.bezierCurveTo(e,n=(n+i)/2,r,n,r,i)}function Cu(){return zr(xu)}function Eu(){return zr(Nu)}class Su extends U.PureComponent{constructor(){super(...arguments),this.linkRef=null,this.state={initialStyle:{opacity:0}
15},this.handleOnClick=e=>{this.props.onClick(this.props.linkData.source,this.props.linkData.target,e)},this.handleOnMouseOver=e=>{this.props.onMouseOver(this.props.linkData.source,this.props.linkData.target,e)},this.handleOnMouseOut=e=>{this.props.onMouseOut(this.props.linkData.source,this.props.linkData.target,e)}}componentDidMount(){this.applyOpacity(1,this.props.transitionDuration)}componentWillLeave(e){this.applyOpacity(0,this.props.transitionDuration,e)}applyOpacity(e,n,r=()=>{}){this.props.enableLegacyTransitions?Y(this.linkRef).transition().duration(n).style("opacity",e).on("end",r):(Y(this.linkRef).style("opacity",e),r())}drawStepPath(e,n){const{source:r,target:i}=e,a=i.y-r.y;return n==="horizontal"?`M${r.y},${r.x} H${r.y+a/2} V${i.x} H${i.y}`:`M${r.x},${r.y} V${r.y+a/2} H${i.x} V${i.y}`}drawDiagonalPath(e,n){const{source:r,target:i}=e;return n==="horizontal"?Cu()({source:[r.y,r.x],target:[i.y,i.x]}):Eu()({source:[r.x,r.y],target:[i.x,i.y]})}drawStraightPath(e,n){const{source:r,target:i}=e;return n==="horizontal"?`M${r.y},${r.x}L${i.y},${i.x}`:`M${r.x},${r.y}L${i.x},${i.y}`}drawElbowPath(e,n){return n==="horizontal"?`M${e.source.y},${e.source.x}V${e.target.x}H${e.target.y}`:`M${e.source.x},${e.source.y}V${e.target.y}H${e.target.x}`}drawPath(){const{linkData:e,orientation:n,pathFunc:r}=this.props;return typeof r=="function"?r(e,n):r==="elbow"?this.drawElbowPath(e,n):r==="straight"?this.drawStraightPath(e,n):r==="step"?this.drawStepPath(e,n):this.drawDiagonalPath(e,n)}getClassNames(){const{linkData:e,orientation:n,pathClassFunc:r}=this.props,i=["rd3t-link"];return typeof r=="function"&&i.push(r(e,n)),i.join(" ").trim()}render(){const{linkData:e}=this.props;return U.createElement("path",{ref:n=>{this.linkRef=n},style:Object.assign({},this.state.initialStyle),className:this.getClassNames(),d:this.drawPath(),onClick:this.handleOnClick,onMouseOver:this.handleOnMouseOver,onMouseOut:this.handleOnMouseOut,"data-source-id":e.source.id,"data-target-id":e.target.id})}}const Mu=` 16/* Tree */ 17.rd3t-tree-container { 18 width: 100%; 19 height: 100%; 20} 21 22.rd3t-grabbable { 23 cursor: move; /* fallback if grab cursor is unsupported */ 24 cursor: grab; 25 cursor: -moz-grab; 26 cursor: -webkit-grab; 27} 28.rd3t-grabbable:active { 29 cursor: grabbing; 30 cursor: -moz-grabbing; 31 cursor: -webkit-grabbing; 32} 33 34/* Node */ 35.rd3t-node { 36 cursor: pointer; 37 fill: #777; 38 stroke: #000; 39 stroke-width: 2; 40} 41 42.rd3t-leaf-node { 43 cursor: pointer; 44 fill: transparent; 45 stroke: #000; 46 stroke-width: 1; 47} 48 49.rd3t-label__title { 50 fill: #000; 51 stroke: none; 52 font-weight: bolder; 53} 54 55.rd3t-label__attributes { 56 fill: #777; 57 stroke: none; 58 font-weight: bolder; 59 font-size: smaller; 60} 61 62/* Link */ 63.rd3t-link { 64 fill: none; 65 stroke: #000; 66} 67`;class Z extends U.Component{constructor(){super(...arguments),this.state={dataRef:this.props.data,data:Z.assignInternalProperties(K(this.props.data)),d3:Z.calculateD3Geometry(this.props),isTransitioning:!1,isInitialRenderForDataset:!0,dataKey:this.props.dataKey},this.internalState={targetNode:null,isTransitioning:!1},this.svgInstanceRef=`rd3t-svg-${Se()}`,this.gInstanceRef=`rd3t-g-${Se()}`,this.handleNodeToggle=e=>{const n=K(this.state.data),i=this.findNodesById(e,n,[])[0];this.props.collapsible&&!this.state.isTransitioning&&(i.__rd3t.collapsed?(Z.expandNode(i),this.props.shouldCollapseNeighborNodes&&this.collapseNeighborNodes(i,n)):Z.collapseNode(i),this.props.enableLegacyTransitions?(this.setState({data:n,isTransitioning:!0}),setTimeout(()=>this.setState({isTransitioning:!1}),this.props.transitionDuration+10)):this.setState({data:n}),this.internalState.targetNode=i)},this.handleAddChildrenToNode=(e,n)=>{const r=K(this.state.data),i=this.findNodesById(e,r,[]);if(i.length>0){const a=i[0],o=a.__rd3t.depth,l=K(n).map(u=>Z.assignInternalProperties([u],o+1));a.children.push(...l.flat()),this.setState({data:r})}},this.handleOnNodeClickCb=(e,n)=>{const{onNodeClick:r}=this.props;r&&typeof r=="function"&&(n.persist(),r(K(e),n))},this.handleOnLinkClickCb=(e,n,r)=>{const{onLinkClick:i}=this.props;i&&typeof i=="function"&&(r.persist(),i(K(e),K(n),r))},this.handleOnNodeMouseOverCb=(e,n)=>{const{onNodeMouseOver:r}=this.props;r&&typeof r=="function"&&(n.persist(),r(K(e),n))},this.handleOnLinkMouseOverCb=(e,n,r)=>{const{onLinkMouseOver:i}=this.props;i&&typeof i=="function"&&(r.persist(),i(K(e),K(n),r))},this.handleOnNodeMouseOutCb=(e,n)=>{const{onNodeMouseOut:r}=this.props;r&&typeof r=="function"&&(n.persist(),r(K(e),n))},this.handleOnLinkMouseOutCb=(e,n,r)=>{const{onLinkMouseOut:i}=this.props;i&&typeof i=="function"&&(r.persist(),i(K(e),K(n),r))},this.centerNode=e=>{const{dimensions:n,orientation:r,zoom:i,centeringTransitionDuration:a}=this.props;if(n){const o=Y(`.${this.gInstanceRef}`),l=Y(`.${this.svgInstanceRef}`),u=this.state.d3.scale;let s,c;r==="horizontal"?(c=-e.x*u+n.height/2,s=-e.y*u+n.width/2):(s=-e.x*u+n.width/2,c=-e.y*u+n.height/2),o.transition().duration(a).attr("transform","translate("+s+","+c+")scale("+u+")"),l.call(Ce().transform,he.translate(s,c).scale(i))}},this.getNodeClassName=(e,n)=>{const{rootNodeClassName:r,branchNodeClassName:i,leafNodeClassName:a}=this.props;return e!=null?n.children?i:a:r}}static getDerivedStateFromProps(e,n){let r=null;const i=!e.dataKey||n.dataKey!==e.dataKey;e.data!==n.dataRef&&i&&(r={dataRef:e.data,data:Z.assignInternalProperties(K(e.data)),isInitialRenderForDataset:!0,dataKey:e.dataKey});const a=Z.calculateD3Geometry(e);return zt(a,n.d3)||(r=r||{},r.d3=a),r}componentDidMount(){this.bindZoomListener(this.props),this.setState({isInitialRenderForDataset:!1})}componentDidUpdate(e){this.props.data!==e.data&&this.setState({isInitialRenderForDataset:!1}),(!zt(this.props.translate,e.translate)||!zt(this.props.scaleExtent,e.scaleExtent)||this.props.zoomable!==e.zoomable||this.props.draggable!==e.draggable||this.props.zoom!==e.zoom||this.props.enableLegacyTransitions!==e.enableLegacyTransitions)&&this.bindZoomListener(this.props),typeof this.props.onUpdate=="function"&&this.props.onUpdate({no
67de:this.internalState.targetNode?K(this.internalState.targetNode):null,zoom:this.state.d3.scale,translate:this.state.d3.translate}),this.internalState.targetNode=null}setInitialTreeDepth(e,n){e.forEach(r=>{r.data.__rd3t.collapsed=r.depth>=n})}bindZoomListener(e){const{zoomable:n,scaleExtent:r,translate:i,zoom:a,onUpdate:o,hasInteractiveNodes:l}=e,u=Y(`.${this.svgInstanceRef}`),s=Y(`.${this.gInstanceRef}`);u.call(Ce().transform,he.translate(i.x,i.y).scale(a)),u.call(Ce().scaleExtent(n?[r.min,r.max]:[a,a]).filter(c=>l?c.target.classList.contains(this.svgInstanceRef)||c.target.classList.contains(this.gInstanceRef)||c.shiftKey:!0).on("zoom",c=>{!this.props.draggable&&["mousemove","touchmove","dblclick"].includes(c.sourceEvent.type)||(s.attr("transform",c.transform),typeof o=="function"&&(o({node:null,zoom:c.transform.k,translate:{x:c.transform.x,y:c.transform.y}}),this.state.d3.scale=c.transform.k,this.state.d3.translate={x:c.transform.x,y:c.transform.y}))}))}static assignInternalProperties(e,n=0){return(Array.isArray(e)?e:[e]).map(i=>{const a=i;return a.__rd3t={id:null,depth:null,collapsed:!1},a.__rd3t.id=Se(),a.__rd3t.depth=n,a.children&&a.children.length>0&&(a.children=Z.assignInternalProperties(a.children,n+1)),a})}findNodesById(e,n,r){return r.length>0||(r=r.concat(n.filter(i=>
67i.__rd3t.id===e)),n.forEach(i=>{i.children&&i.children.length>0&&(r=this.findNodesById(e,i.children,r))})),r}findNodesAtDepth(e,n,r){return r=r.concat(n.filter(i=>i.__rd3t.depth===e)),n.forEach(i=>{i.children&&i.children.length>0&&(r=this.findNodesAtDepth(e,i.children,r))}),r}static collapseNode(e){e.__rd3t.collapsed=!0,e.children&&e.children.length>0&&e.children.forEach(n=>{Z.collapseNode(n)})}static expandNode(e){e.__rd3t.collapsed=!1}collapseNeighborNodes(e,n){this.findNodesAtDepth(e.__rd3t.depth,n,[]).filter(i=>i.__rd3t.id!==e.__rd3t.id).forEach(i=>Z.collapseNode(i))}generateTree(){const{initialDepth:e,depthFactor:n,separation:r,nodeSize:i,orientation:a}=this.props,{isInitialRenderForDataset:o}=this.state,u=aa().nodeSize(a==="horizontal"?[i.y,i.x]:[i.x,i.y]).separation((f,h)=>f.parent.data.__rd3t.id===h.parent.data.__rd3t.id?r.siblings:r.nonSiblings)(Ze(this.state.data[0],f=>f.__rd3t.collapsed?null:f.children));let s=u.descendants();const c=u.links();return e!==void 0&&o&&this.setInitialTreeDepth(s,e),n&&s.forEach(f=>{f.y=f.depth*n}),{nodes:s,links:c}}static calculateD3Geometry(e){let n;return e.zoom>e.scaleExtent.max?n=e.scaleExtent.max:e.zoom<e.scaleExtent.min?n=e.scaleExtent.min:n=e.zoom,{translate:e.translate,scale:n}}render(){const{nodes:e,links:n}=this.generateTree(),{renderCustomNodeElement:r,orientation:i,pathFunc:a,transitionDuration:o,nodeSize:l,depthFactor:u,initialDepth:s,separation:c,enableLegacyTransitions:f,svgClassName:h,pathClassFunc:d}=this.props,{translate:x,scale:C}=this.state.d3,A=Object.assign(Object.assign(Object.assign({},l),c),{depthFactor:u,initialDepth:s});return U.createElement("div",{className:"rd3t-tree-container rd3t-grabbable"},U.createElement("style",null,Mu),U.createElement("svg",{className:`rd3t-svg ${this.svgInstanceRef} ${h}`,width:"100%",height:"100%"},U.createElement(du,{enableLegacyTransitions:f,component:"g",className:`rd3t-g ${this.gInstanceRef}`,transform:`translate(${x.x},${x.y}) scale(${C})`},n.map((T,_)=>U.createElement(Su,{key:"link-"+_,orientation:i,pathFunc:a,pathClassFunc:d,linkData:T,onClick:this.handleOnLinkClickCb,onMouseOver:this.handleOnLinkMouseOverCb,onMouseOut:this.handleOnLinkMouseOutCb,enableLegacyTransitions:f,transitionDuration:o})),e.map((T,_)=>{const{data:b,x:M,y:v,parent:N}=T;return U.createElement(gu,{key:"node-"+_,data:b,position:{x:M,y:v},hierarchyPointNode:T,parent:N,nodeClassName:this.getNodeClassName(N,b),renderCustomNodeElement:r,nodeSize:l,orientation:i,enableLegacyTransitions:f,transitionDuration:o,onNodeToggle:this.handleNodeToggle,onNodeClick:this.handleOnNodeClickCb,onNodeMouseOver:this.handleOnNodeMouseOverCb,onNodeMouseOut:this.handleOnNodeMouseOutCb,handleAddChildrenToNode:this.handleAddChildrenToNode,subscriptions:A,centerNode:this.centerNode})}))))}}Z.defaultProps={onNodeClick:void 0,onNodeMouseOver:void 0,onNodeMouseOut:void 0,onLinkClick:void 0,onLinkMouseOver:void 0,onLinkMouseOut:void 0,onUpdate:void 0,orientation:"horizontal",translate:{x:0,y:0},pathFunc:"diagonal",pathClassFunc:void 0,transitionDuration:500,depthFactor:void 0,collapsible:!0,initialDepth:void 0,zoomable:!0,draggable:!0,zoom:1,scaleExtent:{min:.1,max:1},nodeSize:{x:140,y:140},separation:{siblings:1,nonSiblings:2},shouldCollapseNeighborNodes:!1,svgClassName:"",rootNodeClassName:"",branchNodeClassName:"",leafNodeClassName:"",renderCustomNodeElement:void 0,enableLegacyTransitions:!1,hasInteractiveNodes:!1,dimensions:void 0,centeringTransitionDuration:800,dataKey:void 0};const Du="_zoomControls_1ehjd_1",Au="_link_1ehjd_17",ku="_iconDiv_1ehjd_25",Ve={zoomControls:Du,link:Au,iconDiv:ku},Ou={width:"100%",height:"680px",position:"relative"},Ru=({nodeDatum:t,toggleNode:e,foreignObjectProps:n})=>g("g",{children:g("foreignObject",{...n,children:$("div",{style:{border:"1px solid black",backgroundColor:"#dedede",margin:"0 20px"},children:[t.link?g(qr,{className:Ve.link,href:t.link,value:t.name,newTab:!0,icon:!0}):g("h3",{style:{textAlign:"center"},children:t.name}),t.children&&t.children.length?g("div",{onClick:e,className:Ve.iconDiv,children:t.__rd3t.collapsed?g(Pr,{}):g(Ir,{})}):null]})})});function $u({data:t,initialZoom:e=.65}){const n={x:200,y:200},r={width:n.x,height:n.y,x:-100},[i,a]=I.useState({x:0,y:0}),[o,l]=I.useState(e),[u,s]=I.useState({x:0,y:0}),c=I.useCallback(C=>{if(C!==null){const{width:A,height:T}=C.getBoundingClientRect();s({x:A/2,y:T/4}),a({x:A/2,y:T/4})}},[t]),f={max:2,min:.1},h=()=>l(Math.min(f.max,o+.1)),d=()=>l(Math.max(f.min,o-.1)),x=()=>{l(e),s(i)};return $("div",{style:Ou,ref:c,children:[g("svg",{style:{position:"absolute",left:0,width:140,height:50},children:$("g",{className:Ve.zoomControls,transform:"translate(10, 10)",children:[$("g",{id:"zoom-in",transform:"translate(0, 0)",onClick:h,children:[g("rect",{width:"30",height:"30"}),g("line",{x1:"5",y1:"15",x2:"25",y2:"15"}),g("line",{x1:"15",y1:"5",x2:"15",y2:"25"})]}),$("g",{id:"zoom-out",transform:"translate(30, 0)",onClick:d,children:[g("rect",{width:"30",height:"30"}),g("line",{x1:"5",y1:"15",x2:"25",y2:"15"})]}),$("g",{id:"reset",transform:"translate(60, 0)",onClick:x,children:[g("rect",{width:"60",height:"30"}),g("text",{x:"10",y:"20",fill:"#596877",children:"Reset"})]})]})}),g(Z,{data:t,translate:u,nodeSize:n,renderCustomNodeElement:C=>Ru({...C,foreignObjectProps:r}),orientation:"vertical",pathFunc:"step",zoom:o,scaleExtent:f,onUpdate:C=>{l(C.zoom),s(C.translate)},initialDepth:1})]})}const zu={display:"flex",alignItems:"center",justifyContent:"center",height:"680px",paddingBottom:"200px"},Lu=t=>{const e=(a,o)=>({name:a,link:o,children:[]}),n=a=>t.filter(o=>o.parent===a),r=e("All Tags",null),i=a=>{const o=e(a.displayName,`/manage/tags/${a.tag}`);return n(a.tag).forEach(l=>{const u=i(l);o.children.push(u)}),o};return t.filter(a=>
67+a.gen==1).forEach(a=>{r.children.push(i(a))}),r};function Pu(){const t=I.useContext(gt),{state:e}=t,[n,r]=I.useState(),i=Lu(e.allTags);return I.useEffect(()=>{setTimeout(()=>{r(g($u,{data:i}))},0)},[]),g(Lt,{children:n||g("div",{style:zu,children:"Loading. Please wait..."})})}const Iu=(t,e)=>{switch(t){case"manage_tags":return g(Ai,{params:e});case"add_tag":return g(Li,{});case"tag_tree":return g(Pu,{});case"loader":return g(Vn,{});default:return g("h1",{children:"Not Found"})}};function Fu({params:t}){const e=I.useContext(gt),{activeTab:n}=e.state;return Iu(n,t)}const Gu={activeTab:"loader",allTags:[],manageTags:{tableData:{tags:[],gen:-1},tagData:{}},addTag:{tag:"",displayName:"",description:"",gen:1,keywords:"",parent:""}},Bu=(t,e)=>{switch(e.type){case Kn:return{...t,activeTab:e.payload};case Yn:return{...t,...e.payload};default:return t}},qu=()=>[{link:"/",name:"Home"},{link:null,name:"Manage Tags"}],Hu=t=>{const{isHYCAdmin:e}=t,n=[["Manage Tags",e],["Add Tag",e],["Tag Tree",e]],r=[];return n.forEach(([i,a])=>{a&&r.push({id:i.toLowerCase().replace(/[\W]+/g,"_"),name:i})}),r},gt=U.createContext();function oc(){const[t,e]=I.useReducer(Bu,Gu),[n,r]=I.useState([]),i=I.useContext(Ht),a=Ke(),o=Hr(),l=Ur(),{alertOpen:u,alertMessage:s,alertType:c,userData:f}=i.state,h=i.dispatch,d=Wr.parse(o.search);return I.useEffect(()=>{(async()=>{try{const A=await Nt.get("/api/manage/tags"),{data:T}=A.data;await e(rt({...t,allTags:T}));const _=Hu(f.user);await r(_),await h(Xr("Tag Management System"))}catch(A){await h(Xn(A))}finally{await h(Kr(!1))}})()},[]),I.useEffect(()=>{n.length&&e(wn(Vr(n,d)))},[d.tab,n]),$(gt.Provider,{value:{state:t,dispatch:e},children:[g(Jr,{data:qu()}),g(Zr,{leftColumn:g(Qr,{fields:n,handleTabChange:C=>{a({pathname:"/manage/tags",search:`?tab=${C}`}),e(wn(C))},activeTab:t.activeTab,name:"Tag Management System"}),leftMaxWidth:"240px",rightColumn:$(Lt,{children:[g(jr,{alertOpen:u,alertMessage:s,alertType:c,alertClose:()=>h(Yr(!1,""))}),g(Fu,{params:l})]})})]})}export{gt as ManageTagsContext,oc as default};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.