diff --git a/assets/index.d67f3799.js b/assets/index.cd3a1906.js similarity index 75% rename from assets/index.d67f3799.js rename to assets/index.cd3a1906.js index 1701694..b3b2c29 100644 --- a/assets/index.d67f3799.js +++ b/assets/index.cd3a1906.js @@ -1,21 +1,21 @@ -var W0=Object.defineProperty;var O0=(e,t,n)=>t in e?W0(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var N=(e,t,n)=>(O0(e,typeof t!="symbol"?t+"":t,n),n),s1=(e,t,n)=>{if(!t.has(e))throw TypeError("Cannot "+n)};var Fa=(e,t,n)=>(s1(e,t,"read from private field"),n?n.call(e):t.get(e)),ye=(e,t,n)=>{if(t.has(e))throw TypeError("Cannot add the same private member more than once");t instanceof WeakSet?t.add(e):t.set(e,n)};var se=(e,t,n)=>(s1(e,t,"access private method"),n);(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const i of document.querySelectorAll('link[rel="modulepreload"]'))r(i);new MutationObserver(i=>{for(const s of i)if(s.type==="childList")for(const a of s.addedNodes)a.tagName==="LINK"&&a.rel==="modulepreload"&&r(a)}).observe(document,{childList:!0,subtree:!0});function n(i){const s={};return i.integrity&&(s.integrity=i.integrity),i.referrerpolicy&&(s.referrerPolicy=i.referrerpolicy),i.crossorigin==="use-credentials"?s.credentials="include":i.crossorigin==="anonymous"?s.credentials="omit":s.credentials="same-origin",s}function r(i){if(i.ep)return;i.ep=!0;const s=n(i);fetch(i.href,s)}})();function pe(){}const Ca=e=>e;function x(e,t,n,r,i){e.__svelte_meta={loc:{file:t,line:n,column:r,char:i}}}function Fc(e){return e()}function a1(){return Object.create(null)}function Re(e){e.forEach(Fc)}function Br(e){return typeof e=="function"}function tt(e,t){return e!=e?t==t:e!==t||e&&typeof e=="object"||typeof e=="function"}let Zi;function Vr(e,t){return Zi||(Zi=document.createElement("a")),Zi.href=t,e===Zi.href}function G0(e){return Object.keys(e).length===0}const Pc=typeof window<"u";let fl=Pc?()=>window.performance.now():()=>Date.now(),dl=Pc?e=>requestAnimationFrame(e):pe;const Cr=new Set;function Rc(e){Cr.forEach(t=>{t.c(e)||(Cr.delete(t),t.f())}),Cr.size!==0&&dl(Rc)}function pl(e){let t;return Cr.size===0&&dl(Rc),{promise:new Promise(n=>{Cr.add(t={c:e,f:n})}),abort(){Cr.delete(t)}}}function Ic(e,t){e.appendChild(t)}function Ec(e){if(!e)return document;const t=e.getRootNode?e.getRootNode():e.ownerDocument;return t&&t.host?t:e.ownerDocument}function Y0(e){const t=L("style");return B0(Ec(e),t),t.sheet}function B0(e,t){return Ic(e.head||e,t),t.sheet}function zc(e,t,n){e.insertBefore(t,n||null)}function Sa(e){e.parentNode.removeChild(e)}function ln(e,t){for(let n=0;ne.removeEventListener(t,n,r)}function Wc(e,t,n){n==null?e.removeAttribute(t):e.getAttribute(t)!==n&&e.setAttribute(t,n)}function ji(e,t,n){t in e?e[t]=typeof e[t]=="boolean"&&n===""?!0:n:Wc(e,t,n)}function Z0(e){return Array.from(e.childNodes)}function xs(e,t){e.value=t==null?"":t}function vr(e,t,n,r){n===null?e.style.removeProperty(t):e.style.setProperty(t,n,r?"important":"")}function ge(e,t,n){e.classList[n?"add":"remove"](t)}function gl(e,t,{bubbles:n=!1,cancelable:r=!1}={}){const i=document.createEvent("CustomEvent");return i.initCustomEvent(e,n,r,t),i}class Jn{constructor(t=!1){this.is_svg=!1,this.is_svg=t,this.e=this.n=null}c(t){this.h(t)}m(t,n,r=null){this.e||(this.is_svg?this.e=Dn(n.nodeName):this.e=L(n.nodeName),this.t=n,this.c(t)),this.i(r)}h(t){this.e.innerHTML=t,this.n=Array.from(this.e.childNodes)}i(t){for(let n=0;n>>0}function X0(e,t){const n={stylesheet:Y0(t),rules:{}};return Ls.set(e,n),n}function ml(e,t,n,r,i,s,a,o=0){const c=16.666/r;let l=`{ +var E0=Object.defineProperty;var z0=(e,t,n)=>t in e?E0(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var N=(e,t,n)=>(z0(e,typeof t!="symbol"?t+"":t,n),n),i1=(e,t,n)=>{if(!t.has(e))throw TypeError("Cannot "+n)};var Ha=(e,t,n)=>(i1(e,t,"read from private field"),n?n.call(e):t.get(e)),ye=(e,t,n)=>{if(t.has(e))throw TypeError("Cannot add the same private member more than once");t instanceof WeakSet?t.add(e):t.set(e,n)};var se=(e,t,n)=>(i1(e,t,"access private method"),n);(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const i of document.querySelectorAll('link[rel="modulepreload"]'))r(i);new MutationObserver(i=>{for(const s of i)if(s.type==="childList")for(const a of s.addedNodes)a.tagName==="LINK"&&a.rel==="modulepreload"&&r(a)}).observe(document,{childList:!0,subtree:!0});function n(i){const s={};return i.integrity&&(s.integrity=i.integrity),i.referrerpolicy&&(s.referrerPolicy=i.referrerpolicy),i.crossorigin==="use-credentials"?s.credentials="include":i.crossorigin==="anonymous"?s.credentials="omit":s.credentials="same-origin",s}function r(i){if(i.ep)return;i.ep=!0;const s=n(i);fetch(i.href,s)}})();function pe(){}const ba=e=>e;function x(e,t,n,r,i){e.__svelte_meta={loc:{file:t,line:n,column:r,char:i}}}function Hc(e){return e()}function s1(){return Object.create(null)}function Re(e){e.forEach(Hc)}function Yr(e){return typeof e=="function"}function tt(e,t){return e!=e?t==t:e!==t||e&&typeof e=="object"||typeof e=="function"}let Zi;function Ar(e,t){return Zi||(Zi=document.createElement("a")),Zi.href=t,e===Zi.href}function W0(e){return Object.keys(e).length===0}const Fc=typeof window<"u";let hl=Fc?()=>window.performance.now():()=>Date.now(),fl=Fc?e=>requestAnimationFrame(e):pe;const br=new Set;function Pc(e){br.forEach(t=>{t.c(e)||(br.delete(t),t.f())}),br.size!==0&&fl(Pc)}function dl(e){let t;return br.size===0&&fl(Pc),{promise:new Promise(n=>{br.add(t={c:e,f:n})}),abort(){br.delete(t)}}}function Rc(e,t){e.appendChild(t)}function Ic(e){if(!e)return document;const t=e.getRootNode?e.getRootNode():e.ownerDocument;return t&&t.host?t:e.ownerDocument}function O0(e){const t=L("style");return G0(Ic(e),t),t.sheet}function G0(e,t){return Rc(e.head||e,t),t.sheet}function Ec(e,t,n){e.insertBefore(t,n||null)}function Ca(e){e.parentNode.removeChild(e)}function ln(e,t){for(let n=0;ne.removeEventListener(t,n,r)}function B0(e,t,n){n==null?e.removeAttribute(t):e.getAttribute(t)!==n&&e.setAttribute(t,n)}function U0(e){return Array.from(e.childNodes)}function _s(e,t){e.value=t==null?"":t}function wr(e,t,n,r){n===null?e.style.removeProperty(t):e.style.setProperty(t,n,r?"important":"")}function ge(e,t,n){e.classList[n?"add":"remove"](t)}function pl(e,t,{bubbles:n=!1,cancelable:r=!1}={}){const i=document.createEvent("CustomEvent");return i.initCustomEvent(e,n,r,t),i}class Jn{constructor(t=!1){this.is_svg=!1,this.is_svg=t,this.e=this.n=null}c(t){this.h(t)}m(t,n,r=null){this.e||(this.is_svg?this.e=Dn(n.nodeName):this.e=L(n.nodeName),this.t=n,this.c(t)),this.i(r)}h(t){this.e.innerHTML=t,this.n=Array.from(this.e.childNodes)}i(t){for(let n=0;n>>0}function j0(e,t){const n={stylesheet:O0(t),rules:{}};return xs.set(e,n),n}function gl(e,t,n,r,i,s,a,o=0){const c=16.666/r;let l=`{ `;for(let m=0;m<=1;m+=c){const v=t+(n-t)*s(m);l+=m*100+`%{${a(v,1-v)}} `}const u=l+`100% {${a(n,1-n)}} -}`,f=`__svelte_${j0(u)}_${o}`,h=Ec(e),{stylesheet:p,rules:g}=Ls.get(h)||X0(h,e);g[f]||(g[f]=!0,p.insertRule(`@keyframes ${f} ${u}`,p.cssRules.length));const d=e.style.animation||"";return e.style.animation=`${d?`${d}, `:""}${f} ${r}ms linear ${i}ms 1 both`,ks+=1,f}function Ts(e,t){const n=(e.style.animation||"").split(", "),r=n.filter(t?s=>s.indexOf(t)<0:s=>s.indexOf("__svelte")===-1),i=n.length-r.length;i&&(e.style.animation=r.join(", "),ks-=i,ks||q0())}function q0(){dl(()=>{ks||(Ls.forEach(e=>{const{ownerNode:t}=e.stylesheet;t&&Sa(t)}),Ls.clear())})}function J0(e,t,n,r){if(!t)return pe;const i=e.getBoundingClientRect();if(t.left===i.left&&t.right===i.right&&t.top===i.top&&t.bottom===i.bottom)return pe;const{delay:s=0,duration:a=300,easing:o=Ca,start:c=fl()+s,end:l=c+a,tick:u=pe,css:f}=n(e,{from:t,to:i},r);let h=!0,p=!1,g;function d(){f&&(g=ml(e,0,1,a,s,o,f)),s||(p=!0)}function m(){f&&Ts(e,g),h=!1}return pl(v=>{if(!p&&v>=c&&(p=!0),p&&v>=l&&(u(1,0),m()),!h)return!1;if(p){const S=v-c,b=0+1*o(S/a);u(b,1-b)}return!0}),d(),u(0,1),m}function Q0(e){const t=getComputedStyle(e);if(t.position!=="absolute"&&t.position!=="fixed"){const{width:n,height:r}=t,i=e.getBoundingClientRect();e.style.position="absolute",e.style.width=n,e.style.height=r,Oc(e,i)}}function Oc(e,t){const n=e.getBoundingClientRect();if(t.left!==n.left||t.top!==n.top){const r=getComputedStyle(e),i=r.transform==="none"?"":r.transform;e.style.transform=`${i} translate(${t.left-n.left}px, ${t.top-n.top}px)`}}let wi;function mi(e){wi=e}function Ri(){if(!wi)throw new Error("Function called outside component initialization");return wi}function Ne(e){Ri().$$.on_mount.push(e)}function Ms(e){Ri().$$.on_destroy.push(e)}function o1(){const e=Ri();return(t,n,{cancelable:r=!1}={})=>{const i=e.$$.callbacks[t];if(i){const s=gl(t,n,{cancelable:r});return i.slice().forEach(a=>{a.call(e,s)}),!s.defaultPrevented}return!0}}function K0(e,t){return Ri().$$.context.set(e,t),t}function $0(e){return Ri().$$.context.get(e)}const hi=[],Je=[],hs=[],l1=[],Gc=Promise.resolve();let oo=!1;function Yc(){oo||(oo=!0,Gc.then(Bc))}function yl(){return Yc(),Gc}function Dr(e){hs.push(e)}const Pa=new Set;let Xi=0;function Bc(){const e=wi;do{for(;Xi{ri=null})),ri}function As(e,t,n){e.dispatchEvent(gl(`${t?"intro":"outro"}${n}`))}const fs=new Set;let An;function Nn(){An={r:0,c:[],p:An}}function Hn(){An.r||Re(An.c),An=An.p}function _e(e,t){e&&e.i&&(fs.delete(e),e.i(t))}function Me(e,t,n,r){if(e&&e.o){if(fs.has(e))return;fs.add(e),An.c.push(()=>{fs.delete(e),r&&(n&&e.d(1),r())}),e.o(t)}else r&&r()}const Zc={duration:0};function th(e,t,n){let r=t(e,n),i=!1,s,a,o=0;function c(){s&&Ts(e,s)}function l(){const{delay:f=0,duration:h=300,easing:p=Ca,tick:g=pe,css:d}=r||Zc;d&&(s=ml(e,0,1,h,f,p,d,o++)),g(0,1);const m=fl()+f,v=m+h;a&&a.abort(),i=!0,Dr(()=>As(e,!0,"start")),a=pl(S=>{if(i){if(S>=v)return g(1,0),As(e,!0,"end"),c(),i=!1;if(S>=m){const b=p((S-m)/h);g(b,1-b)}}return i})}let u=!1;return{start(){u||(u=!0,Ts(e),Br(r)?(r=r(),Uc().then(l)):l())},invalidate(){u=!1},end(){i&&(c(),i=!1)}}}function wl(e,t,n){let r=t(e,n),i=!0,s;const a=An;a.r+=1;function o(){const{delay:c=0,duration:l=300,easing:u=Ca,tick:f=pe,css:h}=r||Zc;h&&(s=ml(e,1,0,l,c,u,h));const p=fl()+c,g=p+l;Dr(()=>As(e,!1,"start")),pl(d=>{if(i){if(d>=g)return f(0,1),As(e,!1,"end"),--a.r||Re(a.c),!1;if(d>=p){const m=u((d-p)/l);f(1-m,m)}}return i})}return Br(r)?Uc().then(()=>{r=r(),o()}):o(),{end(c){c&&r.tick&&r.tick(1,0),i&&(s&&Ts(e,s),i=!1)}}}const vl=typeof window<"u"?window:typeof globalThis<"u"?globalThis:global;function jc(e,t){Me(e,1,1,()=>{t.delete(e.key)})}function nh(e,t){e.f(),jc(e,t)}function Xc(e,t,n,r,i,s,a,o,c,l,u,f){let h=e.length,p=s.length,g=h;const d={};for(;g--;)d[e[g].key]=g;const m=[],v=new Map,S=new Map;for(g=p;g--;){const H=f(i,s,g),I=n(H);let M=a.get(I);M?r&&M.p(H,t):(M=l(I,H),M.c()),v.set(I,m[g]=M),I in d&&S.set(I,Math.abs(g-d[I]))}const b=new Set,_=new Set;function k(H){_e(H,1),H.m(o,u),a.set(H.key,H),u=H.first,p--}for(;h&&p;){const H=m[p-1],I=e[h-1],M=H.key,V=I.key;H===I?(u=H.first,h--,p--):v.has(V)?!a.has(M)||b.has(M)?k(H):_.has(V)?h--:S.get(M)>S.get(V)?(_.add(M),k(H)):(b.add(V),h--):(c(I,a),h--)}for(;h--;){const H=e[h];v.has(H.key)||c(H,a)}for(;p;)k(m[p-1]);return m}function Vs(e,t,n,r){const i=new Set;for(let s=0;s{const a=e.$$.on_mount.map(Fc).filter(Br);e.$$.on_destroy?e.$$.on_destroy.push(...a):Re(a),e.$$.on_mount=[]}),s.forEach(Dr)}function pt(e,t){const n=e.$$;n.fragment!==null&&(Re(n.on_destroy),n.fragment&&n.fragment.d(t),n.on_destroy=n.fragment=null,n.ctx=[])}function rh(e,t){e.$$.dirty[0]===-1&&(hi.push(e),Yc(),e.$$.dirty.fill(0)),e.$$.dirty[t/31|0]|=1<{const g=p.length?p[0]:h;return l.ctx&&i(l.ctx[f],l.ctx[f]=g)&&(!l.skip_bound&&l.bound[f]&&l.bound[f](g),u&&rh(e,f)),h}):[],l.update(),u=!0,Re(l.before_update),l.fragment=r?r(l.ctx):!1,t.target){if(t.hydrate){const f=Z0(t.target);l.fragment&&l.fragment.l(f),f.forEach(Sa)}else l.fragment&&l.fragment.c();t.intro&&_e(e.$$.fragment),dt(e,t.target,t.anchor,t.customElement),Bc()}mi(c)}class ih{$destroy(){pt(this,1),this.$destroy=pe}$on(t,n){if(!Br(n))return pe;const r=this.$$.callbacks[t]||(this.$$.callbacks[t]=[]);return r.push(n),()=>{const i=r.indexOf(n);i!==-1&&r.splice(i,1)}}$set(t){this.$$set&&!G0(t)&&(this.$$.skip_bound=!0,this.$$set(t),this.$$.skip_bound=!1)}}function te(e,t){document.dispatchEvent(gl(e,Object.assign({version:"3.52.0"},t),{bubbles:!0}))}function y(e,t){te("SvelteDOMInsert",{target:e,node:t}),Ic(e,t)}function ae(e,t,n){te("SvelteDOMInsert",{target:e,node:t,anchor:n}),zc(e,t,n)}function ee(e){te("SvelteDOMRemove",{node:e}),Sa(e)}function he(e,t,n,r,i,s){const a=r===!0?["capture"]:r?Array.from(Object.keys(r)):[];i&&a.push("preventDefault"),s&&a.push("stopPropagation"),te("SvelteDOMAddEventListener",{node:e,event:t,handler:n,modifiers:a});const o=U0(e,t,n,r);return()=>{te("SvelteDOMRemoveEventListener",{node:e,event:t,handler:n,modifiers:a}),o()}}function w(e,t,n){Wc(e,t,n),n==null?te("SvelteDOMRemoveAttribute",{node:e,attribute:t}):te("SvelteDOMSetAttribute",{node:e,attribute:t,value:n})}function Ee(e,t){t=""+t,e.wholeText!==t&&(te("SvelteDOMSetData",{node:e,data:t}),e.data=t)}function De(e){if(typeof e!="string"&&!(e&&typeof e=="object"&&"length"in e)){let t="{#each} only iterates over array-like objects.";throw typeof Symbol=="function"&&e&&Symbol.iterator in e&&(t+=" You can use a spread to convert this iterable into an array."),new Error(t)}}function St(e,t,n){for(const r of Object.keys(t))~n.indexOf(r)||console.warn(`<${e}> received an unexpected slot "${r}".`)}class _t extends ih{constructor(t){if(!t||!t.target&&!t.$$inline)throw new Error("'target' is a required option");super()}$destroy(){super.$destroy(),this.$destroy=()=>{console.warn("Component was already destroyed")}}$capture_state(){}$inject_state(){}}function sh(e){return e<.5?4*e*e*e:.5*Math.pow(2*e-2,3)+1}function qc(e){const t=e-1;return t*t*t+1}function Ii(e,{delay:t=0,duration:n=400,easing:r=Ca}={}){const i=+getComputedStyle(e).opacity;return{delay:t,duration:n,easing:r,css:s=>`opacity: ${s*i}`}}function lo(e,{delay:t=0,duration:n=400,easing:r=qc,x:i=0,y:s=0,opacity:a=0}={}){const o=getComputedStyle(e),c=+o.opacity,l=o.transform==="none"?"":o.transform,u=c*(1-a);return{delay:t,duration:n,easing:r,css:(f,h)=>` +}`,f=`__svelte_${Z0(u)}_${o}`,h=Ic(e),{stylesheet:p,rules:g}=xs.get(h)||j0(h,e);g[f]||(g[f]=!0,p.insertRule(`@keyframes ${f} ${u}`,p.cssRules.length));const d=e.style.animation||"";return e.style.animation=`${d?`${d}, `:""}${f} ${r}ms linear ${i}ms 1 both`,Ls+=1,f}function ks(e,t){const n=(e.style.animation||"").split(", "),r=n.filter(t?s=>s.indexOf(t)<0:s=>s.indexOf("__svelte")===-1),i=n.length-r.length;i&&(e.style.animation=r.join(", "),Ls-=i,Ls||X0())}function X0(){fl(()=>{Ls||(xs.forEach(e=>{const{ownerNode:t}=e.stylesheet;t&&Ca(t)}),xs.clear())})}function q0(e,t,n,r){if(!t)return pe;const i=e.getBoundingClientRect();if(t.left===i.left&&t.right===i.right&&t.top===i.top&&t.bottom===i.bottom)return pe;const{delay:s=0,duration:a=300,easing:o=ba,start:c=hl()+s,end:l=c+a,tick:u=pe,css:f}=n(e,{from:t,to:i},r);let h=!0,p=!1,g;function d(){f&&(g=gl(e,0,1,a,s,o,f)),s||(p=!0)}function m(){f&&ks(e,g),h=!1}return dl(v=>{if(!p&&v>=c&&(p=!0),p&&v>=l&&(u(1,0),m()),!h)return!1;if(p){const S=v-c,b=0+1*o(S/a);u(b,1-b)}return!0}),d(),u(0,1),m}function J0(e){const t=getComputedStyle(e);if(t.position!=="absolute"&&t.position!=="fixed"){const{width:n,height:r}=t,i=e.getBoundingClientRect();e.style.position="absolute",e.style.width=n,e.style.height=r,zc(e,i)}}function zc(e,t){const n=e.getBoundingClientRect();if(t.left!==n.left||t.top!==n.top){const r=getComputedStyle(e),i=r.transform==="none"?"":r.transform;e.style.transform=`${i} translate(${t.left-n.left}px, ${t.top-n.top}px)`}}let wi;function mi(e){wi=e}function Ri(){if(!wi)throw new Error("Function called outside component initialization");return wi}function Ne(e){Ri().$$.on_mount.push(e)}function Ts(e){Ri().$$.on_destroy.push(e)}function a1(){const e=Ri();return(t,n,{cancelable:r=!1}={})=>{const i=e.$$.callbacks[t];if(i){const s=pl(t,n,{cancelable:r});return i.slice().forEach(a=>{a.call(e,s)}),!s.defaultPrevented}return!0}}function Q0(e,t){return Ri().$$.context.set(e,t),t}function K0(e){return Ri().$$.context.get(e)}const hi=[],Je=[],us=[],o1=[],Wc=Promise.resolve();let ao=!1;function Oc(){ao||(ao=!0,Wc.then(Gc))}function ml(){return Oc(),Wc}function Vr(e){us.push(e)}const Fa=new Set;let ji=0;function Gc(){const e=wi;do{for(;ji{ni=null})),ni}function Ms(e,t,n){e.dispatchEvent(pl(`${t?"intro":"outro"}${n}`))}const hs=new Set;let An;function Nn(){An={r:0,c:[],p:An}}function Hn(){An.r||Re(An.c),An=An.p}function _e(e,t){e&&e.i&&(hs.delete(e),e.i(t))}function Me(e,t,n,r){if(e&&e.o){if(hs.has(e))return;hs.add(e),An.c.push(()=>{hs.delete(e),r&&(n&&e.d(1),r())}),e.o(t)}else r&&r()}const Bc={duration:0};function eh(e,t,n){let r=t(e,n),i=!1,s,a,o=0;function c(){s&&ks(e,s)}function l(){const{delay:f=0,duration:h=300,easing:p=ba,tick:g=pe,css:d}=r||Bc;d&&(s=gl(e,0,1,h,f,p,d,o++)),g(0,1);const m=hl()+f,v=m+h;a&&a.abort(),i=!0,Vr(()=>Ms(e,!0,"start")),a=dl(S=>{if(i){if(S>=v)return g(1,0),Ms(e,!0,"end"),c(),i=!1;if(S>=m){const b=p((S-m)/h);g(b,1-b)}}return i})}let u=!1;return{start(){u||(u=!0,ks(e),Yr(r)?(r=r(),Yc().then(l)):l())},invalidate(){u=!1},end(){i&&(c(),i=!1)}}}function yl(e,t,n){let r=t(e,n),i=!0,s;const a=An;a.r+=1;function o(){const{delay:c=0,duration:l=300,easing:u=ba,tick:f=pe,css:h}=r||Bc;h&&(s=gl(e,1,0,l,c,u,h));const p=hl()+c,g=p+l;Vr(()=>Ms(e,!1,"start")),dl(d=>{if(i){if(d>=g)return f(0,1),Ms(e,!1,"end"),--a.r||Re(a.c),!1;if(d>=p){const m=u((d-p)/l);f(1-m,m)}}return i})}return Yr(r)?Yc().then(()=>{r=r(),o()}):o(),{end(c){c&&r.tick&&r.tick(1,0),i&&(s&&ks(e,s),i=!1)}}}const wl=typeof window<"u"?window:typeof globalThis<"u"?globalThis:global;function Uc(e,t){Me(e,1,1,()=>{t.delete(e.key)})}function th(e,t){e.f(),Uc(e,t)}function Zc(e,t,n,r,i,s,a,o,c,l,u,f){let h=e.length,p=s.length,g=h;const d={};for(;g--;)d[e[g].key]=g;const m=[],v=new Map,S=new Map;for(g=p;g--;){const H=f(i,s,g),I=n(H);let M=a.get(I);M?r&&M.p(H,t):(M=l(I,H),M.c()),v.set(I,m[g]=M),I in d&&S.set(I,Math.abs(g-d[I]))}const b=new Set,_=new Set;function k(H){_e(H,1),H.m(o,u),a.set(H.key,H),u=H.first,p--}for(;h&&p;){const H=m[p-1],I=e[h-1],M=H.key,V=I.key;H===I?(u=H.first,h--,p--):v.has(V)?!a.has(M)||b.has(M)?k(H):_.has(V)?h--:S.get(M)>S.get(V)?(_.add(M),k(H)):(b.add(V),h--):(c(I,a),h--)}for(;h--;){const H=e[h];v.has(H.key)||c(H,a)}for(;p;)k(m[p-1]);return m}function As(e,t,n,r){const i=new Set;for(let s=0;s{const a=e.$$.on_mount.map(Hc).filter(Yr);e.$$.on_destroy?e.$$.on_destroy.push(...a):Re(a),e.$$.on_mount=[]}),s.forEach(Vr)}function pt(e,t){const n=e.$$;n.fragment!==null&&(Re(n.on_destroy),n.fragment&&n.fragment.d(t),n.on_destroy=n.fragment=null,n.ctx=[])}function nh(e,t){e.$$.dirty[0]===-1&&(hi.push(e),Oc(),e.$$.dirty.fill(0)),e.$$.dirty[t/31|0]|=1<{const g=p.length?p[0]:h;return l.ctx&&i(l.ctx[f],l.ctx[f]=g)&&(!l.skip_bound&&l.bound[f]&&l.bound[f](g),u&&nh(e,f)),h}):[],l.update(),u=!0,Re(l.before_update),l.fragment=r?r(l.ctx):!1,t.target){if(t.hydrate){const f=U0(t.target);l.fragment&&l.fragment.l(f),f.forEach(Ca)}else l.fragment&&l.fragment.c();t.intro&&_e(e.$$.fragment),dt(e,t.target,t.anchor,t.customElement),Gc()}mi(c)}class rh{$destroy(){pt(this,1),this.$destroy=pe}$on(t,n){if(!Yr(n))return pe;const r=this.$$.callbacks[t]||(this.$$.callbacks[t]=[]);return r.push(n),()=>{const i=r.indexOf(n);i!==-1&&r.splice(i,1)}}$set(t){this.$$set&&!W0(t)&&(this.$$.skip_bound=!0,this.$$set(t),this.$$.skip_bound=!1)}}function ee(e,t){document.dispatchEvent(pl(e,Object.assign({version:"3.52.0"},t),{bubbles:!0}))}function y(e,t){ee("SvelteDOMInsert",{target:e,node:t}),Rc(e,t)}function ae(e,t,n){ee("SvelteDOMInsert",{target:e,node:t,anchor:n}),Ec(e,t,n)}function ne(e){ee("SvelteDOMRemove",{node:e}),Ca(e)}function he(e,t,n,r,i,s){const a=r===!0?["capture"]:r?Array.from(Object.keys(r)):[];i&&a.push("preventDefault"),s&&a.push("stopPropagation"),ee("SvelteDOMAddEventListener",{node:e,event:t,handler:n,modifiers:a});const o=Y0(e,t,n,r);return()=>{ee("SvelteDOMRemoveEventListener",{node:e,event:t,handler:n,modifiers:a}),o()}}function w(e,t,n){B0(e,t,n),n==null?ee("SvelteDOMRemoveAttribute",{node:e,attribute:t}):ee("SvelteDOMSetAttribute",{node:e,attribute:t,value:n})}function Ee(e,t){t=""+t,e.wholeText!==t&&(ee("SvelteDOMSetData",{node:e,data:t}),e.data=t)}function De(e){if(typeof e!="string"&&!(e&&typeof e=="object"&&"length"in e)){let t="{#each} only iterates over array-like objects.";throw typeof Symbol=="function"&&e&&Symbol.iterator in e&&(t+=" You can use a spread to convert this iterable into an array."),new Error(t)}}function St(e,t,n){for(const r of Object.keys(t))~n.indexOf(r)||console.warn(`<${e}> received an unexpected slot "${r}".`)}class _t extends rh{constructor(t){if(!t||!t.target&&!t.$$inline)throw new Error("'target' is a required option");super()}$destroy(){super.$destroy(),this.$destroy=()=>{console.warn("Component was already destroyed")}}$capture_state(){}$inject_state(){}}function ih(e){return e<.5?4*e*e*e:.5*Math.pow(2*e-2,3)+1}function jc(e){const t=e-1;return t*t*t+1}function Ii(e,{delay:t=0,duration:n=400,easing:r=ba}={}){const i=+getComputedStyle(e).opacity;return{delay:t,duration:n,easing:r,css:s=>`opacity: ${s*i}`}}function oo(e,{delay:t=0,duration:n=400,easing:r=jc,x:i=0,y:s=0,opacity:a=0}={}){const o=getComputedStyle(e),c=+o.opacity,l=o.transform==="none"?"":o.transform,u=c*(1-a);return{delay:t,duration:n,easing:r,css:(f,h)=>` transform: ${l} translate(${(1-f)*i}px, ${(1-f)*s}px); - opacity: ${c-u*h}`}}const ur=[];function Ei(e,t=pe){let n;const r=new Set;function i(o){if(tt(e,o)&&(e=o,n)){const c=!ur.length;for(const l of r)l[1](),ur.push(l,e);if(c){for(let l=0;l{r.delete(l),r.size===0&&(n(),n=null)}}return{set:i,update:s,subscribe:a}}var Qn=(e=>(e[e.DepthChanged=0]="DepthChanged",e.None="",e))(Qn||{});const Nr=()=>({shown:!1,favTrees:[]}),bl=()=>({depthMax:0,depthLow:0,depthHigh:0,depthColors:[],action:""}),Cl=()=>({featureMap:new Map,treeMap:new Map,treeID:0,ancestorFs:[],show:!1,x:20,y:20,getFeatureColor:null}),Hr=()=>({shown:!1,curAccuracyLow:0,curAccuracyHigh:1,curMinSampleLow:0,curMinSampleHigh:100,curHeightRange:new Set([]),curDepthFeatures:new Map,curAllFeatures:new Set([]),treeDepthFeaturesMap:null,treeHeightMap:null,treeMinSampleMap:null,featureMap:new Map,getFeatureColor:null,featureOrder:[],updatePlots:null}),Fr=()=>({pinnedTrees:[],lastActiveTreeID:null,getFeatureColor:null,getFeatureInfo:null}),c1=()=>Ei(Nr()),u1=()=>Ei(bl()),h1=()=>Ei(Cl()),f1=()=>Ei(Fr()),d1=()=>Ei(Hr());var co="http://www.w3.org/1999/xhtml";const p1={svg:"http://www.w3.org/2000/svg",xhtml:co,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function _a(e){var t=e+="",n=t.indexOf(":");return n>=0&&(t=e.slice(0,n))!=="xmlns"&&(e=e.slice(n+1)),p1.hasOwnProperty(t)?{space:p1[t],local:e}:e}function ah(e){return function(){var t=this.ownerDocument,n=this.namespaceURI;return n===co&&t.documentElement.namespaceURI===co?t.createElement(e):t.createElementNS(n,e)}}function oh(e){return function(){return this.ownerDocument.createElementNS(e.space,e.local)}}function Jc(e){var t=_a(e);return(t.local?oh:ah)(t)}function lh(){}function Sl(e){return e==null?lh:function(){return this.querySelector(e)}}function ch(e){typeof e!="function"&&(e=Sl(e));for(var t=this._groups,n=t.length,r=new Array(n),i=0;i=b&&(b=S+1);!(k=m[b])&&++b=0;)(a=r[i])&&(s&&a.compareDocumentPosition(s)^4&&s.parentNode.insertBefore(a,s),s=a);return this}function Hh(e){e||(e=Fh);function t(f,h){return f&&h?e(f.__data__,h.__data__):!f-!h}for(var n=this._groups,r=n.length,i=new Array(r),s=0;st?1:e>=t?0:NaN}function Ph(){var e=arguments[0];return arguments[0]=this,e.apply(null,arguments),this}function Rh(){return Array.from(this)}function Ih(){for(var e=this._groups,t=0,n=e.length;t1?this.each((t==null?Xh:typeof t=="function"?Jh:qh)(e,t,n==null?"":n)):Pr(this.node(),e)}function Pr(e,t){return e.style.getPropertyValue(t)||nu(e).getComputedStyle(e,null).getPropertyValue(t)}function Kh(e){return function(){delete this[e]}}function $h(e,t){return function(){this[e]=t}}function e3(e,t){return function(){var n=t.apply(this,arguments);n==null?delete this[e]:this[e]=n}}function t3(e,t){return arguments.length>1?this.each((t==null?Kh:typeof t=="function"?e3:$h)(e,t)):this.node()[e]}function ru(e){return e.trim().split(/^|\s+/)}function _l(e){return e.classList||new iu(e)}function iu(e){this._node=e,this._names=ru(e.getAttribute("class")||"")}iu.prototype={add:function(e){var t=this._names.indexOf(e);t<0&&(this._names.push(e),this._node.setAttribute("class",this._names.join(" ")))},remove:function(e){var t=this._names.indexOf(e);t>=0&&(this._names.splice(t,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(e){return this._names.indexOf(e)>=0}};function su(e,t){for(var n=_l(e),r=-1,i=t.length;++r=0&&(n=t.slice(r+1),t=t.slice(0,r)),{type:t,name:n}})}function A3(e){return function(){var t=this.__on;if(!!t){for(var n=0,r=-1,i=t.length,s;nt?1:e>=t?0:NaN}function O3(e,t){return e==null||t==null?NaN:te?1:t>=e?0:NaN}function lu(e){let t,n,r;e.length!==2?(t=ds,n=(o,c)=>ds(e(o),c),r=(o,c)=>e(o)-c):(t=e===ds||e===O3?e:G3,n=e,r=e);function i(o,c,l=0,u=o.length){if(l>>1;n(o[f],c)<0?l=f+1:u=f}while(l>>1;n(o[f],c)<=0?l=f+1:u=f}while(ll&&r(o[f-1],c)>-r(o[f],c)?f-1:f}return{left:i,center:a,right:s}}function G3(){return 0}function Y3(e){return e===null?NaN:+e}const B3=lu(ds),U3=B3.right;lu(Y3).center;const cu=U3;function Z3(e,t){let n=0;if(t===void 0)for(let r of e)r!=null&&(r=+r)>=r&&++n;else{let r=-1;for(let i of e)(i=t(i,++r,e))!=null&&(i=+i)>=i&&++n}return n}function ps(e,t){let n,r;if(t===void 0)for(const i of e)i!=null&&(n===void 0?i>=i&&(n=r=i):(n>i&&(n=i),r=s&&(n=r=s):(n>s&&(n=s),re}var uo=Math.sqrt(50),ho=Math.sqrt(10),fo=Math.sqrt(2);function Ns(e,t,n){var r,i=-1,s,a,o;if(t=+t,e=+e,n=+n,e===t&&n>0)return[e];if((r=t0){let c=Math.round(e/o),l=Math.round(t/o);for(c*ot&&--l,a=new Array(s=l-c+1);++it&&--l,a=new Array(s=l-c+1);++i=0?(s>=uo?10:s>=ho?5:s>=fo?2:1)*Math.pow(10,i):-Math.pow(10,-i)/(s>=uo?10:s>=ho?5:s>=fo?2:1)}function $3(e,t,n){var r=Math.abs(t-e)/Math.max(0,n),i=Math.pow(10,Math.floor(Math.log(r)/Math.LN10)),s=r/i;return s>=uo?i*=10:s>=ho?i*=5:s>=fo&&(i*=2),t0?(e=Math.floor(e/i)*i,t=Math.ceil(t/i)*i):i<0&&(e=Math.ceil(e*i)/i,t=Math.floor(t*i)/i),r=i}}function t6(e){return Math.ceil(Math.log(Z3(e))/Math.LN2)+1}function n6(){var e=J3,t=ps,n=t6;function r(i){Array.isArray(i)||(i=Array.from(i));var s,a=i.length,o,c,l=new Array(a);for(s=0;s=h)if(v>=h&&t===ps){const b=vi(f,h,S);isFinite(b)&&(b>0?h=(Math.floor(h/b)+1)*b:b<0&&(h=(Math.ceil(h*-b)+1)/-b))}else p.pop()}for(var g=p.length;p[0]<=f;)p.shift(),--g;for(;p[g-1]>h;)p.pop(),--g;var d=new Array(g+1),m;for(s=0;s<=g;++s)m=d[s]=[],m.x0=s>0?p[s-1]:f,m.x1=s0)for(s=0;s=r)&&(n=r);else{let r=-1;for(let i of e)(i=t(i,++r,e))!=null&&(n=i)&&(n=i)}return n}function i6(e,t){let n,r=-1,i=-1;if(t===void 0)for(const s of e)++i,s!=null&&(n=s)&&(n=s,r=i);else for(let s of e)(s=t(s,++i,e))!=null&&(n=s)&&(n=s,r=i);return r}function s6(e,t){let n;if(t===void 0)for(const r of e)r!=null&&(n>r||n===void 0&&r>=r)&&(n=r);else{let r=-1;for(let i of e)(i=t(i,++r,e))!=null&&(n>i||n===void 0&&i>=i)&&(n=i)}return n}function a6(e,t){let n,r=-1,i=-1;if(t===void 0)for(const s of e)++i,s!=null&&(n>s||n===void 0&&s>=s)&&(n=s,r=i);else for(let s of e)(s=t(s,++i,e))!=null&&(n>s||n===void 0&&s>=s)&&(n=s,r=i);return r}function o6(e,t,n){e=+e,t=+t,n=(i=arguments.length)<2?(t=e,e=0,1):i<3?1:+n;for(var r=-1,i=Math.max(0,Math.ceil((t-e)/n))|0,s=new Array(i);++r>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):n===8?Ji(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):n===4?Ji(t>>12&15|t>>8&240,t>>8&15|t>>4&240,t>>4&15|t&240,((t&15)<<4|t&15)/255):null):(t=h6.exec(e))?new ze(t[1],t[2],t[3],1):(t=f6.exec(e))?new ze(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=d6.exec(e))?Ji(t[1],t[2],t[3],t[4]):(t=p6.exec(e))?Ji(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=g6.exec(e))?x1(t[1],t[2]/100,t[3]/100,1):(t=m6.exec(e))?x1(t[1],t[2]/100,t[3]/100,t[4]):w1.hasOwnProperty(e)?C1(w1[e]):e==="transparent"?new ze(NaN,NaN,NaN,0):null}function C1(e){return new ze(e>>16&255,e>>8&255,e&255,1)}function Ji(e,t,n,r){return r<=0&&(e=t=n=NaN),new ze(e,t,n,r)}function Tl(e){return e instanceof Rn||(e=Fn(e)),e?(e=e.rgb(),new ze(e.r,e.g,e.b,e.opacity)):new ze}function po(e,t,n,r){return arguments.length===1?Tl(e):new ze(e,t,n,r==null?1:r)}function ze(e,t,n,r){this.r=+e,this.g=+t,this.b=+n,this.opacity=+r}Zr(ze,po,Wi(Rn,{brighter(e){return e=e==null?Rr:Math.pow(Rr,e),new ze(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?tr:Math.pow(tr,e),new ze(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new ze($n(this.r),$n(this.g),$n(this.b),Hs(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:S1,formatHex:S1,formatHex8:v6,formatRgb:_1,toString:_1}));function S1(){return`#${Kn(this.r)}${Kn(this.g)}${Kn(this.b)}`}function v6(){return`#${Kn(this.r)}${Kn(this.g)}${Kn(this.b)}${Kn((isNaN(this.opacity)?1:this.opacity)*255)}`}function _1(){const e=Hs(this.opacity);return`${e===1?"rgb(":"rgba("}${$n(this.r)}, ${$n(this.g)}, ${$n(this.b)}${e===1?")":`, ${e})`}`}function Hs(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function $n(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function Kn(e){return e=$n(e),(e<16?"0":"")+e.toString(16)}function x1(e,t,n,r){return r<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new Et(e,t,n,r)}function hu(e){if(e instanceof Et)return new Et(e.h,e.s,e.l,e.opacity);if(e instanceof Rn||(e=Fn(e)),!e)return new Et;if(e instanceof Et)return e;e=e.rgb();var t=e.r/255,n=e.g/255,r=e.b/255,i=Math.min(t,n,r),s=Math.max(t,n,r),a=NaN,o=s-i,c=(s+i)/2;return o?(t===s?a=(n-r)/o+(n0&&c<1?0:a,new Et(a,o,c,e.opacity)}function fu(e,t,n,r){return arguments.length===1?hu(e):new Et(e,t,n,r==null?1:r)}function Et(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}Zr(Et,fu,Wi(Rn,{brighter(e){return e=e==null?Rr:Math.pow(Rr,e),new Et(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?tr:Math.pow(tr,e),new Et(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=this.h%360+(this.h<0)*360,t=isNaN(e)||isNaN(this.s)?0:this.s,n=this.l,r=n+(n<.5?n:1-n)*t,i=2*n-r;return new ze(Ra(e>=240?e-240:e+120,i,r),Ra(e,i,r),Ra(e<120?e+240:e-120,i,r),this.opacity)},clamp(){return new Et(L1(this.h),Qi(this.s),Qi(this.l),Hs(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 e=Hs(this.opacity);return`${e===1?"hsl(":"hsla("}${L1(this.h)}, ${Qi(this.s)*100}%, ${Qi(this.l)*100}%${e===1?")":`, ${e})`}`}}));function L1(e){return e=(e||0)%360,e<0?e+360:e}function Qi(e){return Math.max(0,Math.min(1,e||0))}function Ra(e,t,n){return(e<60?t+(n-t)*e/60:e<180?n:e<240?t+(n-t)*(240-e)/60:t)*255}const du=Math.PI/180,pu=180/Math.PI,Fs=18,gu=.96422,mu=1,yu=.82521,wu=4/29,_r=6/29,vu=3*_r*_r,b6=_r*_r*_r;function bu(e){if(e instanceof Jt)return new Jt(e.l,e.a,e.b,e.opacity);if(e instanceof jt)return Su(e);e instanceof ze||(e=Tl(e));var t=Wa(e.r),n=Wa(e.g),r=Wa(e.b),i=Ia((.2225045*t+.7168786*n+.0606169*r)/mu),s,a;return t===n&&n===r?s=a=i:(s=Ia((.4360747*t+.3850649*n+.1430804*r)/gu),a=Ia((.0139322*t+.0971045*n+.7141733*r)/yu)),new Jt(116*i-16,500*(s-i),200*(i-a),e.opacity)}function C6(e,t,n,r){return arguments.length===1?bu(e):new Jt(e,t,n,r==null?1:r)}function Jt(e,t,n,r){this.l=+e,this.a=+t,this.b=+n,this.opacity=+r}Zr(Jt,C6,Wi(Rn,{brighter(e){return new Jt(this.l+Fs*(e==null?1:e),this.a,this.b,this.opacity)},darker(e){return new Jt(this.l-Fs*(e==null?1:e),this.a,this.b,this.opacity)},rgb(){var e=(this.l+16)/116,t=isNaN(this.a)?e:e+this.a/500,n=isNaN(this.b)?e:e-this.b/200;return t=gu*Ea(t),e=mu*Ea(e),n=yu*Ea(n),new ze(za(3.1338561*t-1.6168667*e-.4906146*n),za(-.9787684*t+1.9161415*e+.033454*n),za(.0719453*t-.2289914*e+1.4052427*n),this.opacity)}}));function Ia(e){return e>b6?Math.pow(e,1/3):e/vu+wu}function Ea(e){return e>_r?e*e*e:vu*(e-wu)}function za(e){return 255*(e<=.0031308?12.92*e:1.055*Math.pow(e,1/2.4)-.055)}function Wa(e){return(e/=255)<=.04045?e/12.92:Math.pow((e+.055)/1.055,2.4)}function Cu(e){if(e instanceof jt)return new jt(e.h,e.c,e.l,e.opacity);if(e instanceof Jt||(e=bu(e)),e.a===0&&e.b===0)return new jt(NaN,0()=>e;function xu(e,t){return function(n){return e+n*t}}function L6(e,t,n){return e=Math.pow(e,n),t=Math.pow(t,n)-e,n=1/n,function(r){return Math.pow(e+r*t,n)}}function k6(e,t){var n=t-e;return n?xu(e,n>180||n<-180?n-360*Math.round(n/360):n):La(isNaN(e)?t:e)}function T6(e){return(e=+e)==1?xr:function(t,n){return n-t?L6(t,n,e):La(isNaN(t)?n:t)}}function xr(e,t){var n=t-e;return n?xu(e,n):La(isNaN(e)?t:e)}const Ps=function e(t){var n=T6(t);function r(i,s){var a=n((i=po(i)).r,(s=po(s)).r),o=n(i.g,s.g),c=n(i.b,s.b),l=xr(i.opacity,s.opacity);return function(u){return i.r=a(u),i.g=o(u),i.b=c(u),i.opacity=l(u),i+""}}return r.gamma=e,r}(1);function M6(e,t){t||(t=[]);var n=e?Math.min(t.length,e.length):0,r=t.slice(),i;return function(s){for(i=0;in&&(s=t.slice(n,s),o[a]?o[a]+=s:o[++a]=s),(r=r[0])===(i=i[0])?o[a]?o[a]+=i:o[++a]=i:(o[++a]=null,c.push({i:a,x:Rt(r,i)})),n=Oa.lastIndex;return n180?u+=360:u-l>180&&(l+=360),h.push({i:f.push(i(f)+"rotate(",null,r)-2,x:Rt(l,u)})):u&&f.push(i(f)+"rotate("+u+r)}function o(l,u,f,h){l!==u?h.push({i:f.push(i(f)+"skewX(",null,r)-2,x:Rt(l,u)}):u&&f.push(i(f)+"skewX("+u+r)}function c(l,u,f,h,p,g){if(l!==f||u!==h){var d=p.push(i(p)+"scale(",null,",",null,")");g.push({i:d-4,x:Rt(l,f)},{i:d-2,x:Rt(u,h)})}else(f!==1||h!==1)&&p.push(i(p)+"scale("+f+","+h+")")}return function(l,u){var f=[],h=[];return l=e(l),u=e(u),s(l.translateX,l.translateY,u.translateX,u.translateY,f,h),a(l.rotate,u.rotate,f,h),o(l.skewX,u.skewX,f,h),c(l.scaleX,l.scaleY,u.scaleX,u.scaleY,f,h),l=u=null,function(p){for(var g=-1,d=h.length,m;++gt&&(n=e,e=t,t=n),function(r){return Math.max(e,Math.min(t,r))}}function X6(e,t,n){var r=e[0],i=e[1],s=t[0],a=t[1];return i2?q6:X6,c=l=null,f}function f(h){return h==null||isNaN(h=+h)?s:(c||(c=o(e.map(r),t,n)))(r(a(h)))}return f.invert=function(h){return a(i((l||(l=o(t,e.map(r),Rt)))(h)))},f.domain=function(h){return arguments.length?(e=Array.from(h,Z6),u()):e.slice()},f.range=function(h){return arguments.length?(t=Array.from(h),u()):t.slice()},f.rangeRound=function(h){return t=Array.from(h),n=P6,u()},f.clamp=function(h){return arguments.length?(a=h?!0:Xt,u()):a!==Xt},f.interpolate=function(h){return arguments.length?(n=h,u()):n},f.unknown=function(h){return arguments.length?(s=h,f):s},function(h,p){return r=h,i=p,u()}}function J6(){return Dl()(Xt,Xt)}function Q6(e){return Math.abs(e=Math.round(e))>=1e21?e.toLocaleString("en").replace(/,/g,""):e.toString(10)}function Rs(e,t){if((n=(e=t?e.toExponential(t-1):e.toExponential()).indexOf("e"))<0)return null;var n,r=e.slice(0,n);return[r.length>1?r[0]+r.slice(2):r,+e.slice(n+1)]}function Ir(e){return e=Rs(Math.abs(e)),e?e[1]:NaN}function K6(e,t){return function(n,r){for(var i=n.length,s=[],a=0,o=e[0],c=0;i>0&&o>0&&(c+o+1>r&&(o=Math.max(1,r-c)),s.push(n.substring(i-=o,i+o)),!((c+=o+1)>r));)o=e[a=(a+1)%e.length];return s.reverse().join(t)}}function $6(e){return function(t){return t.replace(/[0-9]/g,function(n){return e[+n]})}}var e5=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function Si(e){if(!(t=e5.exec(e)))throw new Error("invalid format: "+e);var t;return new Nl({fill:t[1],align:t[2],sign:t[3],symbol:t[4],zero:t[5],width:t[6],comma:t[7],precision:t[8]&&t[8].slice(1),trim:t[9],type:t[10]})}Si.prototype=Nl.prototype;function Nl(e){this.fill=e.fill===void 0?" ":e.fill+"",this.align=e.align===void 0?">":e.align+"",this.sign=e.sign===void 0?"-":e.sign+"",this.symbol=e.symbol===void 0?"":e.symbol+"",this.zero=!!e.zero,this.width=e.width===void 0?void 0:+e.width,this.comma=!!e.comma,this.precision=e.precision===void 0?void 0:+e.precision,this.trim=!!e.trim,this.type=e.type===void 0?"":e.type+""}Nl.prototype.toString=function(){return this.fill+this.align+this.sign+this.symbol+(this.zero?"0":"")+(this.width===void 0?"":Math.max(1,this.width|0))+(this.comma?",":"")+(this.precision===void 0?"":"."+Math.max(0,this.precision|0))+(this.trim?"~":"")+this.type};function t5(e){e:for(var t=e.length,n=1,r=-1,i;n0&&(r=0);break}return r>0?e.slice(0,r)+e.slice(i+1):e}var Vu;function n5(e,t){var n=Rs(e,t);if(!n)return e+"";var r=n[0],i=n[1],s=i-(Vu=Math.max(-8,Math.min(8,Math.floor(i/3)))*3)+1,a=r.length;return s===a?r:s>a?r+new Array(s-a+1).join("0"):s>0?r.slice(0,s)+"."+r.slice(s):"0."+new Array(1-s).join("0")+Rs(e,Math.max(0,t+s-1))[0]}function N1(e,t){var n=Rs(e,t);if(!n)return e+"";var r=n[0],i=n[1];return i<0?"0."+new Array(-i).join("0")+r:r.length>i+1?r.slice(0,i+1)+"."+r.slice(i+1):r+new Array(i-r.length+2).join("0")}const H1={"%":(e,t)=>(e*100).toFixed(t),b:e=>Math.round(e).toString(2),c:e=>e+"",d:Q6,e:(e,t)=>e.toExponential(t),f:(e,t)=>e.toFixed(t),g:(e,t)=>e.toPrecision(t),o:e=>Math.round(e).toString(8),p:(e,t)=>N1(e*100,t),r:N1,s:n5,X:e=>Math.round(e).toString(16).toUpperCase(),x:e=>Math.round(e).toString(16)};function F1(e){return e}var P1=Array.prototype.map,R1=["y","z","a","f","p","n","\xB5","m","","k","M","G","T","P","E","Z","Y"];function r5(e){var t=e.grouping===void 0||e.thousands===void 0?F1:K6(P1.call(e.grouping,Number),e.thousands+""),n=e.currency===void 0?"":e.currency[0]+"",r=e.currency===void 0?"":e.currency[1]+"",i=e.decimal===void 0?".":e.decimal+"",s=e.numerals===void 0?F1:$6(P1.call(e.numerals,String)),a=e.percent===void 0?"%":e.percent+"",o=e.minus===void 0?"\u2212":e.minus+"",c=e.nan===void 0?"NaN":e.nan+"";function l(f){f=Si(f);var h=f.fill,p=f.align,g=f.sign,d=f.symbol,m=f.zero,v=f.width,S=f.comma,b=f.precision,_=f.trim,k=f.type;k==="n"?(S=!0,k="g"):H1[k]||(b===void 0&&(b=12),_=!0,k="g"),(m||h==="0"&&p==="=")&&(m=!0,h="0",p="=");var H=d==="$"?n:d==="#"&&/[boxX]/.test(k)?"0"+k.toLowerCase():"",I=d==="$"?r:/[%p]/.test(k)?a:"",M=H1[k],V=/[defgprs%]/.test(k);b=b===void 0?6:/[gprs]/.test(k)?Math.max(1,Math.min(21,b)):Math.max(0,Math.min(20,b));function E(F){var R=H,A=I,C,T,D;if(k==="c")A=M(F)+A,F="";else{F=+F;var P=F<0||1/F<0;if(F=isNaN(F)?c:M(Math.abs(F),b),_&&(F=t5(F)),P&&+F==0&&g!=="+"&&(P=!1),R=(P?g==="("?g:o:g==="-"||g==="("?"":g)+R,A=(k==="s"?R1[8+Vu/3]:"")+A+(P&&g==="("?")":""),V){for(C=-1,T=F.length;++CD||D>57){A=(D===46?i+F.slice(C+1):F.slice(C))+A,F=F.slice(0,C);break}}}S&&!m&&(F=t(F,1/0));var G=R.length+F.length+A.length,Y=G>1)+R+F+A+Y.slice(G);break;default:F=Y+R+F+A;break}return s(F)}return E.toString=function(){return f+""},E}function u(f,h){var p=l((f=Si(f),f.type="f",f)),g=Math.max(-8,Math.min(8,Math.floor(Ir(h)/3)))*3,d=Math.pow(10,-g),m=R1[8+g/3];return function(v){return p(d*v)+m}}return{format:l,formatPrefix:u}}var $i,ka,Du;i5({thousands:",",grouping:[3],currency:["$",""]});function i5(e){return $i=r5(e),ka=$i.format,Du=$i.formatPrefix,$i}function s5(e){return Math.max(0,-Ir(Math.abs(e)))}function a5(e,t){return Math.max(0,Math.max(-8,Math.min(8,Math.floor(Ir(t)/3)))*3-Ir(Math.abs(e)))}function o5(e,t){return e=Math.abs(e),t=Math.abs(t)-e,Math.max(0,Ir(t)-Ir(e))+1}function l5(e,t,n,r){var i=$3(e,t,n),s;switch(r=Si(r==null?",f":r),r.type){case"s":{var a=Math.max(Math.abs(e),Math.abs(t));return r.precision==null&&!isNaN(s=a5(i,a))&&(r.precision=s),Du(r,a)}case"":case"e":case"g":case"p":case"r":{r.precision==null&&!isNaN(s=o5(i,Math.max(Math.abs(e),Math.abs(t))))&&(r.precision=s-(r.type==="e"));break}case"f":case"%":{r.precision==null&&!isNaN(s=s5(i))&&(r.precision=s-(r.type==="%")*2);break}}return ka(r)}function Nu(e){var t=e.domain;return e.ticks=function(n){var r=t();return Ns(r[0],r[r.length-1],n==null?10:n)},e.tickFormat=function(n,r){var i=t();return l5(i[0],i[i.length-1],n==null?10:n,r)},e.nice=function(n){n==null&&(n=10);var r=t(),i=0,s=r.length-1,a=r[i],o=r[s],c,l,u=10;for(o0;){if(l=vi(a,o,n),l===c)return r[i]=a,r[s]=o,t(r);if(l>0)a=Math.floor(a/l)*l,o=Math.ceil(o/l)*l;else if(l<0)a=Math.ceil(a*l)/l,o=Math.floor(o*l)/l;else break;c=l}return e},e}function Hu(){var e=J6();return e.copy=function(){return Vl(e,Hu())},zi.apply(e,arguments),Nu(e)}function c5(e,t){e=e.slice();var n=0,r=e.length-1,i=e[n],s=e[r],a;return sMath.pow(e,t)}function p5(e){return e===Math.E?Math.log:e===10&&Math.log10||e===2&&Math.log2||(e=Math.log(e),t=>Math.log(t)/e)}function z1(e){return(t,n)=>-e(-t,n)}function g5(e){const t=e(I1,E1),n=t.domain;let r=10,i,s;function a(){return i=p5(r),s=d5(r),n()[0]<0?(i=z1(i),s=z1(s),e(u5,h5)):e(I1,E1),t}return t.base=function(o){return arguments.length?(r=+o,a()):r},t.domain=function(o){return arguments.length?(n(o),a()):n()},t.ticks=o=>{const c=n();let l=c[0],u=c[c.length-1];const f=u0){for(;h<=p;++h)for(g=1;gu)break;v.push(d)}}else for(;h<=p;++h)for(g=r-1;g>=1;--g)if(d=h>0?g/s(-h):g*s(h),!(du)break;v.push(d)}v.length*2{if(o==null&&(o=10),c==null&&(c=r===10?"s":","),typeof c!="function"&&(!(r%1)&&(c=Si(c)).precision==null&&(c.trim=!0),c=ka(c)),o===1/0)return c;const l=Math.max(1,r*o/t.ticks().length);return u=>{let f=u/s(Math.round(i(u)));return f*rn(c5(n(),{floor:o=>s(Math.floor(i(o))),ceil:o=>s(Math.ceil(i(o)))})),t}function Fu(){const e=g5(Dl()).domain([1,10]);return e.copy=()=>Vl(e,Fu()).base(e.base()),zi.apply(e,arguments),e}function W1(e){return function(t){return t<0?-Math.pow(-t,e):Math.pow(t,e)}}function m5(e){return e<0?-Math.sqrt(-e):Math.sqrt(e)}function y5(e){return e<0?-e*e:e*e}function w5(e){var t=e(Xt,Xt),n=1;function r(){return n===1?e(Xt,Xt):n===.5?e(m5,y5):e(W1(n),W1(1/n))}return t.exponent=function(i){return arguments.length?(n=+i,r()):n},Nu(t)}function Hl(){var e=w5(Dl());return e.copy=function(){return Vl(e,Hl()).exponent(e.exponent())},zi.apply(e,arguments),e}function v5(){return Hl.apply(null,arguments).exponent(.5)}var Ga=new Date,Ya=new Date;function fn(e,t,n,r){function i(s){return e(s=arguments.length===0?new Date:new Date(+s)),s}return i.floor=function(s){return e(s=new Date(+s)),s},i.ceil=function(s){return e(s=new Date(s-1)),t(s,1),e(s),s},i.round=function(s){var a=i(s),o=i.ceil(s);return s-a0))return c;do c.push(l=new Date(+s)),t(s,o),e(s);while(l=a)for(;e(a),!s(a);)a.setTime(a-1)},function(a,o){if(a>=a)if(o<0)for(;++o<=0;)for(;t(a,-1),!s(a););else for(;--o>=0;)for(;t(a,1),!s(a););})},n&&(i.count=function(s,a){return Ga.setTime(+s),Ya.setTime(+a),e(Ga),e(Ya),Math.floor(n(Ga,Ya))},i.every=function(s){return s=Math.floor(s),!isFinite(s)||!(s>0)?null:s>1?i.filter(r?function(a){return r(a)%s===0}:function(a){return i.count(0,a)%s===0}):i}),i}const b5=1e3,Fl=b5*60,C5=Fl*60,Pl=C5*24,Pu=Pl*7;var Ru=fn(e=>e.setHours(0,0,0,0),(e,t)=>e.setDate(e.getDate()+t),(e,t)=>(t-e-(t.getTimezoneOffset()-e.getTimezoneOffset())*Fl)/Pl,e=>e.getDate()-1);const Iu=Ru;Ru.range;function rr(e){return fn(function(t){t.setDate(t.getDate()-(t.getDay()+7-e)%7),t.setHours(0,0,0,0)},function(t,n){t.setDate(t.getDate()+n*7)},function(t,n){return(n-t-(n.getTimezoneOffset()-t.getTimezoneOffset())*Fl)/Pu})}var Eu=rr(0),Is=rr(1),S5=rr(2),_5=rr(3),Er=rr(4),x5=rr(5),L5=rr(6);Eu.range;Is.range;S5.range;_5.range;Er.range;x5.range;L5.range;var Rl=fn(function(e){e.setMonth(0,1),e.setHours(0,0,0,0)},function(e,t){e.setFullYear(e.getFullYear()+t)},function(e,t){return t.getFullYear()-e.getFullYear()},function(e){return e.getFullYear()});Rl.every=function(e){return!isFinite(e=Math.floor(e))||!(e>0)?null:fn(function(t){t.setFullYear(Math.floor(t.getFullYear()/e)*e),t.setMonth(0,1),t.setHours(0,0,0,0)},function(t,n){t.setFullYear(t.getFullYear()+n*e)})};const _i=Rl;Rl.range;var zu=fn(function(e){e.setUTCHours(0,0,0,0)},function(e,t){e.setUTCDate(e.getUTCDate()+t)},function(e,t){return(t-e)/Pl},function(e){return e.getUTCDate()-1});const Wu=zu;zu.range;function ir(e){return fn(function(t){t.setUTCDate(t.getUTCDate()-(t.getUTCDay()+7-e)%7),t.setUTCHours(0,0,0,0)},function(t,n){t.setUTCDate(t.getUTCDate()+n*7)},function(t,n){return(n-t)/Pu})}var Ou=ir(0),Es=ir(1),k5=ir(2),T5=ir(3),zr=ir(4),M5=ir(5),A5=ir(6);Ou.range;Es.range;k5.range;T5.range;zr.range;M5.range;A5.range;var Il=fn(function(e){e.setUTCMonth(0,1),e.setUTCHours(0,0,0,0)},function(e,t){e.setUTCFullYear(e.getUTCFullYear()+t)},function(e,t){return t.getUTCFullYear()-e.getUTCFullYear()},function(e){return e.getUTCFullYear()});Il.every=function(e){return!isFinite(e=Math.floor(e))||!(e>0)?null:fn(function(t){t.setUTCFullYear(Math.floor(t.getUTCFullYear()/e)*e),t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0)},function(t,n){t.setUTCFullYear(t.getUTCFullYear()+n*e)})};const xi=Il;Il.range;function Ba(e){if(0<=e.y&&e.y<100){var t=new Date(-1,e.m,e.d,e.H,e.M,e.S,e.L);return t.setFullYear(e.y),t}return new Date(e.y,e.m,e.d,e.H,e.M,e.S,e.L)}function Ua(e){if(0<=e.y&&e.y<100){var t=new Date(Date.UTC(-1,e.m,e.d,e.H,e.M,e.S,e.L));return t.setUTCFullYear(e.y),t}return new Date(Date.UTC(e.y,e.m,e.d,e.H,e.M,e.S,e.L))}function ii(e,t,n){return{y:e,m:t,d:n,H:0,M:0,S:0,L:0}}function V5(e){var t=e.dateTime,n=e.date,r=e.time,i=e.periods,s=e.days,a=e.shortDays,o=e.months,c=e.shortMonths,l=si(i),u=ai(i),f=si(s),h=ai(s),p=si(a),g=ai(a),d=si(o),m=ai(o),v=si(c),S=ai(c),b={a:P,A:G,b:Y,B:U,c:null,d:Z1,e:Z1,f:$5,g:c4,G:h4,H:J5,I:Q5,j:K5,L:Gu,m:e4,M:t4,p:X,q:J,Q:q1,s:J1,S:n4,u:r4,U:i4,V:s4,w:a4,W:o4,x:null,X:null,y:l4,Y:u4,Z:f4,"%":X1},_={a:me,A:K,b:Q,B,c:null,d:j1,e:j1,f:m4,g:k4,G:M4,H:d4,I:p4,j:g4,L:Bu,m:y4,M:w4,p:ie,q:fe,Q:q1,s:J1,S:v4,u:b4,U:C4,V:S4,w:_4,W:x4,x:null,X:null,y:L4,Y:T4,Z:A4,"%":X1},k={a:E,A:F,b:R,B:A,c:C,d:B1,e:B1,f:Z5,g:Y1,G:G1,H:U1,I:U1,j:G5,L:U5,m:O5,M:Y5,p:V,q:W5,Q:X5,s:q5,S:B5,u:P5,U:R5,V:I5,w:F5,W:E5,x:T,X:D,y:Y1,Y:G1,Z:z5,"%":j5};b.x=H(n,b),b.X=H(r,b),b.c=H(t,b),_.x=H(n,_),_.X=H(r,_),_.c=H(t,_);function H(j,$){return function(oe){var O=[],we=-1,de=0,xe=j.length,Le,Z,ue;for(oe instanceof Date||(oe=new Date(+oe));++we53)return null;"w"in O||(O.w=1),"Z"in O?(de=Ua(ii(O.y,0,1)),xe=de.getUTCDay(),de=xe>4||xe===0?Es.ceil(de):Es(de),de=Wu.offset(de,(O.V-1)*7),O.y=de.getUTCFullYear(),O.m=de.getUTCMonth(),O.d=de.getUTCDate()+(O.w+6)%7):(de=Ba(ii(O.y,0,1)),xe=de.getDay(),de=xe>4||xe===0?Is.ceil(de):Is(de),de=Iu.offset(de,(O.V-1)*7),O.y=de.getFullYear(),O.m=de.getMonth(),O.d=de.getDate()+(O.w+6)%7)}else("W"in O||"U"in O)&&("w"in O||(O.w="u"in O?O.u%7:"W"in O?1:0),xe="Z"in O?Ua(ii(O.y,0,1)).getUTCDay():Ba(ii(O.y,0,1)).getDay(),O.m=0,O.d="W"in O?(O.w+6)%7+O.W*7-(xe+5)%7:O.w+O.U*7-(xe+6)%7);return"Z"in O?(O.H+=O.Z/100|0,O.M+=O.Z%100,Ua(O)):Ba(O)}}function M(j,$,oe,O){for(var we=0,de=$.length,xe=oe.length,Le,Z;we=xe)return-1;if(Le=$.charCodeAt(we++),Le===37){if(Le=$.charAt(we++),Z=k[Le in O1?$.charAt(we++):Le],!Z||(O=Z(j,oe,O))<0)return-1}else if(Le!=oe.charCodeAt(O++))return-1}return O}function V(j,$,oe){var O=l.exec($.slice(oe));return O?(j.p=u.get(O[0].toLowerCase()),oe+O[0].length):-1}function E(j,$,oe){var O=p.exec($.slice(oe));return O?(j.w=g.get(O[0].toLowerCase()),oe+O[0].length):-1}function F(j,$,oe){var O=f.exec($.slice(oe));return O?(j.w=h.get(O[0].toLowerCase()),oe+O[0].length):-1}function R(j,$,oe){var O=v.exec($.slice(oe));return O?(j.m=S.get(O[0].toLowerCase()),oe+O[0].length):-1}function A(j,$,oe){var O=d.exec($.slice(oe));return O?(j.m=m.get(O[0].toLowerCase()),oe+O[0].length):-1}function C(j,$,oe){return M(j,t,$,oe)}function T(j,$,oe){return M(j,n,$,oe)}function D(j,$,oe){return M(j,r,$,oe)}function P(j){return a[j.getDay()]}function G(j){return s[j.getDay()]}function Y(j){return c[j.getMonth()]}function U(j){return o[j.getMonth()]}function X(j){return i[+(j.getHours()>=12)]}function J(j){return 1+~~(j.getMonth()/3)}function me(j){return a[j.getUTCDay()]}function K(j){return s[j.getUTCDay()]}function Q(j){return c[j.getUTCMonth()]}function B(j){return o[j.getUTCMonth()]}function ie(j){return i[+(j.getUTCHours()>=12)]}function fe(j){return 1+~~(j.getUTCMonth()/3)}return{format:function(j){var $=H(j+="",b);return $.toString=function(){return j},$},parse:function(j){var $=I(j+="",!1);return $.toString=function(){return j},$},utcFormat:function(j){var $=H(j+="",_);return $.toString=function(){return j},$},utcParse:function(j){var $=I(j+="",!0);return $.toString=function(){return j},$}}}var O1={"-":"",_:" ",0:"0"},We=/^\s*\d+/,D5=/^%/,N5=/[\\^$*+?|[\]().{}]/g;function Ce(e,t,n){var r=e<0?"-":"",i=(r?-e:e)+"",s=i.length;return r+(s[t.toLowerCase(),n]))}function F5(e,t,n){var r=We.exec(t.slice(n,n+1));return r?(e.w=+r[0],n+r[0].length):-1}function P5(e,t,n){var r=We.exec(t.slice(n,n+1));return r?(e.u=+r[0],n+r[0].length):-1}function R5(e,t,n){var r=We.exec(t.slice(n,n+2));return r?(e.U=+r[0],n+r[0].length):-1}function I5(e,t,n){var r=We.exec(t.slice(n,n+2));return r?(e.V=+r[0],n+r[0].length):-1}function E5(e,t,n){var r=We.exec(t.slice(n,n+2));return r?(e.W=+r[0],n+r[0].length):-1}function G1(e,t,n){var r=We.exec(t.slice(n,n+4));return r?(e.y=+r[0],n+r[0].length):-1}function Y1(e,t,n){var r=We.exec(t.slice(n,n+2));return r?(e.y=+r[0]+(+r[0]>68?1900:2e3),n+r[0].length):-1}function z5(e,t,n){var r=/^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(t.slice(n,n+6));return r?(e.Z=r[1]?0:-(r[2]+(r[3]||"00")),n+r[0].length):-1}function W5(e,t,n){var r=We.exec(t.slice(n,n+1));return r?(e.q=r[0]*3-3,n+r[0].length):-1}function O5(e,t,n){var r=We.exec(t.slice(n,n+2));return r?(e.m=r[0]-1,n+r[0].length):-1}function B1(e,t,n){var r=We.exec(t.slice(n,n+2));return r?(e.d=+r[0],n+r[0].length):-1}function G5(e,t,n){var r=We.exec(t.slice(n,n+3));return r?(e.m=0,e.d=+r[0],n+r[0].length):-1}function U1(e,t,n){var r=We.exec(t.slice(n,n+2));return r?(e.H=+r[0],n+r[0].length):-1}function Y5(e,t,n){var r=We.exec(t.slice(n,n+2));return r?(e.M=+r[0],n+r[0].length):-1}function B5(e,t,n){var r=We.exec(t.slice(n,n+2));return r?(e.S=+r[0],n+r[0].length):-1}function U5(e,t,n){var r=We.exec(t.slice(n,n+3));return r?(e.L=+r[0],n+r[0].length):-1}function Z5(e,t,n){var r=We.exec(t.slice(n,n+6));return r?(e.L=Math.floor(r[0]/1e3),n+r[0].length):-1}function j5(e,t,n){var r=D5.exec(t.slice(n,n+1));return r?n+r[0].length:-1}function X5(e,t,n){var r=We.exec(t.slice(n));return r?(e.Q=+r[0],n+r[0].length):-1}function q5(e,t,n){var r=We.exec(t.slice(n));return r?(e.s=+r[0],n+r[0].length):-1}function Z1(e,t){return Ce(e.getDate(),t,2)}function J5(e,t){return Ce(e.getHours(),t,2)}function Q5(e,t){return Ce(e.getHours()%12||12,t,2)}function K5(e,t){return Ce(1+Iu.count(_i(e),e),t,3)}function Gu(e,t){return Ce(e.getMilliseconds(),t,3)}function $5(e,t){return Gu(e,t)+"000"}function e4(e,t){return Ce(e.getMonth()+1,t,2)}function t4(e,t){return Ce(e.getMinutes(),t,2)}function n4(e,t){return Ce(e.getSeconds(),t,2)}function r4(e){var t=e.getDay();return t===0?7:t}function i4(e,t){return Ce(Eu.count(_i(e)-1,e),t,2)}function Yu(e){var t=e.getDay();return t>=4||t===0?Er(e):Er.ceil(e)}function s4(e,t){return e=Yu(e),Ce(Er.count(_i(e),e)+(_i(e).getDay()===4),t,2)}function a4(e){return e.getDay()}function o4(e,t){return Ce(Is.count(_i(e)-1,e),t,2)}function l4(e,t){return Ce(e.getFullYear()%100,t,2)}function c4(e,t){return e=Yu(e),Ce(e.getFullYear()%100,t,2)}function u4(e,t){return Ce(e.getFullYear()%1e4,t,4)}function h4(e,t){var n=e.getDay();return e=n>=4||n===0?Er(e):Er.ceil(e),Ce(e.getFullYear()%1e4,t,4)}function f4(e){var t=e.getTimezoneOffset();return(t>0?"-":(t*=-1,"+"))+Ce(t/60|0,"0",2)+Ce(t%60,"0",2)}function j1(e,t){return Ce(e.getUTCDate(),t,2)}function d4(e,t){return Ce(e.getUTCHours(),t,2)}function p4(e,t){return Ce(e.getUTCHours()%12||12,t,2)}function g4(e,t){return Ce(1+Wu.count(xi(e),e),t,3)}function Bu(e,t){return Ce(e.getUTCMilliseconds(),t,3)}function m4(e,t){return Bu(e,t)+"000"}function y4(e,t){return Ce(e.getUTCMonth()+1,t,2)}function w4(e,t){return Ce(e.getUTCMinutes(),t,2)}function v4(e,t){return Ce(e.getUTCSeconds(),t,2)}function b4(e){var t=e.getUTCDay();return t===0?7:t}function C4(e,t){return Ce(Ou.count(xi(e)-1,e),t,2)}function Uu(e){var t=e.getUTCDay();return t>=4||t===0?zr(e):zr.ceil(e)}function S4(e,t){return e=Uu(e),Ce(zr.count(xi(e),e)+(xi(e).getUTCDay()===4),t,2)}function _4(e){return e.getUTCDay()}function x4(e,t){return Ce(Es.count(xi(e)-1,e),t,2)}function L4(e,t){return Ce(e.getUTCFullYear()%100,t,2)}function k4(e,t){return e=Uu(e),Ce(e.getUTCFullYear()%100,t,2)}function T4(e,t){return Ce(e.getUTCFullYear()%1e4,t,4)}function M4(e,t){var n=e.getUTCDay();return e=n>=4||n===0?zr(e):zr.ceil(e),Ce(e.getUTCFullYear()%1e4,t,4)}function A4(){return"+0000"}function X1(){return"%"}function q1(e){return+e}function J1(e){return Math.floor(+e/1e3)}var hr,Zu;V4({dateTime:"%x, %X",date:"%-m/%-d/%Y",time:"%-I:%M:%S %p",periods:["AM","PM"],days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],shortDays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],shortMonths:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]});function V4(e){return hr=V5(e),Zu=hr.format,hr.parse,hr.utcFormat,hr.utcParse,hr}function D4(e){for(var t=e.length/6|0,n=new Array(t),r=0;r1)&&(e-=Math.floor(e));var t=Math.abs(e-.5);return es.h=360*e-100,es.s=1.5-1.5*t,es.l=.8-.9*t,es+""}var Wr=0,fi=0,oi=0,ju=1e3,zs,di,Ws=0,nr=0,Ta=0,Li=typeof performance=="object"&&performance.now?performance:Date,Xu=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(e){setTimeout(e,17)};function El(){return nr||(Xu(F4),nr=Li.now()+Ta)}function F4(){nr=0}function Os(){this._call=this._time=this._next=null}Os.prototype=qu.prototype={constructor:Os,restart:function(e,t,n){if(typeof e!="function")throw new TypeError("callback is not a function");n=(n==null?El():+n)+(t==null?0:+t),!this._next&&di!==this&&(di?di._next=this:zs=this,di=this),this._call=e,this._time=n,wo()},stop:function(){this._call&&(this._call=null,this._time=1/0,wo())}};function qu(e,t,n){var r=new Os;return r.restart(e,t,n),r}function P4(){El(),++Wr;for(var e=zs,t;e;)(t=nr-e._time)>=0&&e._call.call(void 0,t),e=e._next;--Wr}function Q1(){nr=(Ws=Li.now())+Ta,Wr=fi=0;try{P4()}finally{Wr=0,I4(),nr=0}}function R4(){var e=Li.now(),t=e-Ws;t>ju&&(Ta-=t,Ws=e)}function I4(){for(var e,t=zs,n,r=1/0;t;)t._call?(r>t._time&&(r=t._time),e=t,t=t._next):(n=t._next,t._next=null,t=e?e._next=n:zs=n);di=e,wo(r)}function wo(e){if(!Wr){fi&&(fi=clearTimeout(fi));var t=e-nr;t>24?(e<1/0&&(fi=setTimeout(Q1,e-Li.now()-Ta)),oi&&(oi=clearInterval(oi))):(oi||(Ws=Li.now(),oi=setInterval(R4,ju)),Wr=1,Xu(Q1))}}function vo(e,t,n){var r=new Os;return t=t==null?0:+t,r.restart(i=>{r.stop(),e(i+t)},t,n),r}var E4={value:()=>{}};function Gi(){for(var e=0,t=arguments.length,n={},r;e=0&&(r=n.slice(i+1),n=n.slice(0,i)),n&&!t.hasOwnProperty(n))throw new Error("unknown type: "+n);return{type:n,name:r}})}gs.prototype=Gi.prototype={constructor:gs,on:function(e,t){var n=this._,r=z4(e+"",n),i,s=-1,a=r.length;if(arguments.length<2){for(;++s0)for(var n=new Array(i),r=0,i,s;rJu)throw new Error("too late; already scheduled");return n}function Qt(e,t){var n=zt(e,t);if(n.state>ms)throw new Error("too late; already running");return n}function zt(e,t){var n=e.__transition;if(!n||!(n=n[t]))throw new Error("transition not found");return n}function Y4(e,t,n){var r=e.__transition,i;r[t]=n,n.timer=qu(s,0,n.time);function s(l){n.state=$1,n.timer.restart(a,n.delay,n.time),n.delay<=l&&a(l-n.delay)}function a(l){var u,f,h,p;if(n.state!==$1)return c();for(u in r)if(p=r[u],p.name===n.name){if(p.state===ms)return vo(a);p.state===ec?(p.state=ys,p.timer.stop(),p.on.call("interrupt",e,e.__data__,p.index,p.group),delete r[u]):+ubo&&r.state=0&&(t=t.slice(0,n)),!t||t==="start"})}function bf(e,t,n){var r,i,s=vf(t)?zl:Qt;return function(){var a=s(this,e),o=a.on;o!==r&&(i=(r=o).copy()).on(t,n),a.on=i}}function Cf(e,t){var n=this._id;return arguments.length<2?zt(this.node(),n).on.on(e):this.each(bf(n,e,t))}function Sf(e){return function(){var t=this.parentNode;for(var n in this.__transition)if(+n!==e)return;t&&t.removeChild(this)}}function _f(){return this.on("end.remove",Sf(this._id))}function xf(e){var t=this._name,n=this._id;typeof e!="function"&&(e=Sl(e));for(var r=this._groups,i=r.length,s=new Array(i),a=0;a+e;function Zf(e){return((e*=2)<=1?e*e:--e*(2-e)+1)/2}function t2(e){return((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2}var Ol=3;(function e(t){t=+t;function n(r){return Math.pow(r,t)}return n.exponent=e,n})(Ol);(function e(t){t=+t;function n(r){return 1-Math.pow(1-r,t)}return n.exponent=e,n})(Ol);var jf=function e(t){t=+t;function n(r){return((r*=2)<=1?Math.pow(r,t):2-Math.pow(2-r,t))/2}return n.exponent=e,n}(Ol);function Gs(e){return(Math.pow(2,-10*e)-.0009765625)*1.0009775171065494}var Or=2*Math.PI,Gl=1,Yl=.3;(function e(t,n){var r=Math.asin(1/(t=Math.max(1,t)))*(n/=Or);function i(s){return t*Gs(- --s)*Math.sin((r-s)/n)}return i.amplitude=function(s){return e(s,n*Or)},i.period=function(s){return e(t,s)},i})(Gl,Yl);var Xf=function e(t,n){var r=Math.asin(1/(t=Math.max(1,t)))*(n/=Or);function i(s){return 1-t*Gs(s=+s)*Math.sin((s+r)/n)}return i.amplitude=function(s){return e(s,n*Or)},i.period=function(s){return e(t,s)},i}(Gl,Yl);(function e(t,n){var r=Math.asin(1/(t=Math.max(1,t)))*(n/=Or);function i(s){return((s=s*2-1)<0?t*Gs(-s)*Math.sin((r-s)/n):2-t*Gs(s)*Math.sin((r+s)/n))/2}return i.amplitude=function(s){return e(s,n*Or)},i.period=function(s){return e(t,s)},i})(Gl,Yl);var qf={time:null,delay:0,duration:250,ease:t2};function Jf(e,t){for(var n;!(n=e.__transition)||!(n=n[t]);)if(!(e=e.parentNode))throw new Error(`transition ${t} not found`);return n}function Qf(e){var t,n;e instanceof hn?(t=e._id,e=e._name):(t=e2(),(n=qf).time=El(),e=e==null?null:e+"");for(var r=this._groups,i=r.length,s=0;s+e(t)}function n8(e,t){return t=Math.max(0,e.bandwidth()-t*2)/2,e.round()&&(t=Math.round(t)),n=>+e(n)+t}function r8(){return!this.__axis}function n2(e,t){var n=[],r=null,i=null,s=6,a=6,o=3,c=typeof window<"u"&&window.devicePixelRatio>1?0:.5,l=e===Za||e===pi?-1:1,u=e===pi||e===ja?"x":"y",f=e===Za||e===So?$f:e8;function h(p){var g=r==null?t.ticks?t.ticks.apply(t,n):t.domain():r,d=i==null?t.tickFormat?t.tickFormat.apply(t,n):Kf:i,m=Math.max(s,0)+o,v=t.range(),S=+v[0]+c,b=+v[v.length-1]+c,_=(t.bandwidth?n8:t8)(t.copy(),c),k=p.selection?p.selection():p,H=k.selectAll(".domain").data([null]),I=k.selectAll(".tick").data(g,t).order(),M=I.exit(),V=I.enter().append("g").attr("class","tick"),E=I.select("line"),F=I.select("text");H=H.merge(H.enter().insert("path",".tick").attr("class","domain").attr("stroke","currentColor")),I=I.merge(V),E=E.merge(V.append("line").attr("stroke","currentColor").attr(u+"2",l*s)),F=F.merge(V.append("text").attr("fill","currentColor").attr(u,l*m).attr("dy",e===Za?"0em":e===So?"0.71em":"0.32em")),p!==k&&(H=H.transition(p),I=I.transition(p),E=E.transition(p),F=F.transition(p),M=M.transition(p).attr("opacity",tc).attr("transform",function(R){return isFinite(R=_(R))?f(R+c):this.getAttribute("transform")}),V.attr("opacity",tc).attr("transform",function(R){var A=this.parentNode.__axis;return f((A&&isFinite(A=A(R))?A:_(R))+c)})),M.remove(),H.attr("d",e===pi||e===ja?a?"M"+l*a+","+S+"H"+c+"V"+b+"H"+l*a:"M"+c+","+S+"V"+b:a?"M"+S+","+l*a+"V"+c+"H"+b+"V"+l*a:"M"+S+","+c+"H"+b),I.attr("opacity",1).attr("transform",function(R){return f(_(R)+c)}),E.attr(u+"2",l*s),F.attr(u,l*m).text(d),k.filter(r8).attr("fill","none").attr("font-size",10).attr("font-family","sans-serif").attr("text-anchor",e===ja?"start":e===pi?"end":"middle"),k.each(function(){this.__axis=_})}return h.scale=function(p){return arguments.length?(t=p,h):t},h.ticks=function(){return n=Array.from(arguments),h},h.tickArguments=function(p){return arguments.length?(n=p==null?[]:Array.from(p),h):n.slice()},h.tickValues=function(p){return arguments.length?(r=p==null?null:Array.from(p),h):r&&r.slice()},h.tickFormat=function(p){return arguments.length?(i=p,h):i},h.tickSize=function(p){return arguments.length?(s=a=+p,h):s},h.tickSizeInner=function(p){return arguments.length?(s=+p,h):s},h.tickSizeOuter=function(p){return arguments.length?(a=+p,h):a},h.tickPadding=function(p){return arguments.length?(o=+p,h):o},h.offset=function(p){return arguments.length?(c=+p,h):c},h}function i8(e){return n2(So,e)}function s8(e){return n2(pi,e)}const _o=Math.PI,xo=2*_o,Xn=1e-6,a8=xo-Xn;function Lo(){this._x0=this._y0=this._x1=this._y1=null,this._=""}function Yi(){return new Lo}Lo.prototype=Yi.prototype={constructor:Lo,moveTo:function(e,t){this._+="M"+(this._x0=this._x1=+e)+","+(this._y0=this._y1=+t)},closePath:function(){this._x1!==null&&(this._x1=this._x0,this._y1=this._y0,this._+="Z")},lineTo:function(e,t){this._+="L"+(this._x1=+e)+","+(this._y1=+t)},quadraticCurveTo:function(e,t,n,r){this._+="Q"+ +e+","+ +t+","+(this._x1=+n)+","+(this._y1=+r)},bezierCurveTo:function(e,t,n,r,i,s){this._+="C"+ +e+","+ +t+","+ +n+","+ +r+","+(this._x1=+i)+","+(this._y1=+s)},arcTo:function(e,t,n,r,i){e=+e,t=+t,n=+n,r=+r,i=+i;var s=this._x1,a=this._y1,o=n-e,c=r-t,l=s-e,u=a-t,f=l*l+u*u;if(i<0)throw new Error("negative radius: "+i);if(this._x1===null)this._+="M"+(this._x1=e)+","+(this._y1=t);else if(f>Xn)if(!(Math.abs(u*o-c*l)>Xn)||!i)this._+="L"+(this._x1=e)+","+(this._y1=t);else{var h=n-s,p=r-a,g=o*o+c*c,d=h*h+p*p,m=Math.sqrt(g),v=Math.sqrt(f),S=i*Math.tan((_o-Math.acos((g+f-d)/(2*m*v)))/2),b=S/v,_=S/m;Math.abs(b-1)>Xn&&(this._+="L"+(e+b*l)+","+(t+b*u)),this._+="A"+i+","+i+",0,0,"+ +(u*h>l*p)+","+(this._x1=e+_*o)+","+(this._y1=t+_*c)}},arc:function(e,t,n,r,i,s){e=+e,t=+t,n=+n,s=!!s;var a=n*Math.cos(r),o=n*Math.sin(r),c=e+a,l=t+o,u=1^s,f=s?r-i:i-r;if(n<0)throw new Error("negative radius: "+n);this._x1===null?this._+="M"+c+","+l:(Math.abs(this._x1-c)>Xn||Math.abs(this._y1-l)>Xn)&&(this._+="L"+c+","+l),n&&(f<0&&(f=f%xo+xo),f>a8?this._+="A"+n+","+n+",0,1,"+u+","+(e-a)+","+(t-o)+"A"+n+","+n+",0,1,"+u+","+(this._x1=c)+","+(this._y1=l):f>Xn&&(this._+="A"+n+","+n+",0,"+ +(f>=_o)+","+u+","+(this._x1=e+n*Math.cos(i))+","+(this._y1=t+n*Math.sin(i))))},rect:function(e,t,n,r){this._+="M"+(this._x0=this._x1=+e)+","+(this._y0=this._y1=+t)+"h"+ +n+"v"+ +r+"h"+-n+"Z"},toString:function(){return this._}};function qe(e){return function(){return e}}const nc=Math.abs,Ze=Math.atan2,jn=Math.cos,o8=Math.max,Xa=Math.min,Ut=Math.sin,br=Math.sqrt,ht=1e-12,ki=Math.PI,Ys=ki/2,l8=2*ki;function c8(e){return e>1?0:e<-1?ki:Math.acos(e)}function rc(e){return e>=1?Ys:e<=-1?-Ys:Math.asin(e)}function u8(e){return e.innerRadius}function h8(e){return e.outerRadius}function f8(e){return e.startAngle}function d8(e){return e.endAngle}function p8(e){return e&&e.padAngle}function g8(e,t,n,r,i,s,a,o){var c=n-e,l=r-t,u=a-i,f=o-s,h=f*c-u*l;if(!(h*hC*C+T*T&&(M=E,V=F),{cx:M,cy:V,x01:-u,y01:-f,x11:M*(i/k-1),y11:V*(i/k-1)}}function m8(){var e=u8,t=h8,n=qe(0),r=null,i=f8,s=d8,a=p8,o=null;function c(){var l,u,f=+e.apply(this,arguments),h=+t.apply(this,arguments),p=i.apply(this,arguments)-Ys,g=s.apply(this,arguments)-Ys,d=nc(g-p),m=g>p;if(o||(o=l=Yi()),hht))o.moveTo(0,0);else if(d>l8-ht)o.moveTo(h*jn(p),h*Ut(p)),o.arc(0,0,h,p,g,!m),f>ht&&(o.moveTo(f*jn(g),f*Ut(g)),o.arc(0,0,f,g,p,m));else{var v=p,S=g,b=p,_=g,k=d,H=d,I=a.apply(this,arguments)/2,M=I>ht&&(r?+r.apply(this,arguments):br(f*f+h*h)),V=Xa(nc(h-f)/2,+n.apply(this,arguments)),E=V,F=V,R,A;if(M>ht){var C=rc(M/f*Ut(I)),T=rc(M/h*Ut(I));(k-=C*2)>ht?(C*=m?1:-1,b+=C,_-=C):(k=0,b=_=(p+g)/2),(H-=T*2)>ht?(T*=m?1:-1,v+=T,S-=T):(H=0,v=S=(p+g)/2)}var D=h*jn(v),P=h*Ut(v),G=f*jn(_),Y=f*Ut(_);if(V>ht){var U=h*jn(S),X=h*Ut(S),J=f*jn(b),me=f*Ut(b),K;if(dht?F>ht?(R=ts(J,me,D,P,h,F,m),A=ts(U,X,G,Y,h,F,m),o.moveTo(R.cx+R.x01,R.cy+R.y01),Fht)||!(k>ht)?o.lineTo(G,Y):E>ht?(R=ts(G,Y,U,X,f,-E,m),A=ts(D,P,J,me,f,-E,m),o.lineTo(R.cx+R.x01,R.cy+R.y01),E=0&&(this._t=1-this._t,this._line=1-this._line)},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;default:{if(this._t<=0)this._context.lineTo(this._x,t),this._context.lineTo(e,t);else{var n=this._x*(1-this._t)+e*this._t;this._context.lineTo(n,this._y),this._context.lineTo(n,t)}break}}this._x=e,this._y=t}};function V8(e){return new h2(e,1)}function D8(e){var t=0,n=e.children,r=n&&n.length;if(!r)t=1;else for(;--r>=0;)t+=n[r].value;e.value=t}function N8(){return this.eachAfter(D8)}function H8(e,t){let n=-1;for(const r of this)e.call(t,r,++n,this);return this}function F8(e,t){for(var n=this,r=[n],i,s,a=-1;n=r.pop();)if(e.call(t,n,++a,this),i=n.children)for(s=i.length-1;s>=0;--s)r.push(i[s]);return this}function P8(e,t){for(var n=this,r=[n],i=[],s,a,o,c=-1;n=r.pop();)if(i.push(n),s=n.children)for(a=0,o=s.length;a=0;)n+=r[i].value;t.value=n})}function E8(e){return this.eachBefore(function(t){t.children&&t.children.sort(e)})}function z8(e){for(var t=this,n=W8(t,e),r=[t];t!==n;)t=t.parent,r.push(t);for(var i=r.length;e!==n;)r.splice(i,0,e),e=e.parent;return r}function W8(e,t){if(e===t)return e;var n=e.ancestors(),r=t.ancestors(),i=null;for(e=n.pop(),t=r.pop();e===t;)i=e,e=n.pop(),t=r.pop();return i}function O8(){for(var e=this,t=[e];e=e.parent;)t.push(e);return t}function G8(){return Array.from(this)}function Y8(){var e=[];return this.eachBefore(function(t){t.children||e.push(t)}),e}function B8(){var e=this,t=[];return e.each(function(n){n!==e&&t.push({source:n.parent,target:n})}),t}function*U8(){var e=this,t,n=[e],r,i,s;do for(t=n.reverse(),n=[];e=t.pop();)if(yield e,r=e.children)for(i=0,s=r.length;i=0;--o)i.push(s=a[o]=new Ti(a[o])),s.parent=r,s.depth=r.depth+1;return n.eachBefore(J8)}function Z8(){return Bl(this).eachBefore(q8)}function j8(e){return e.children}function X8(e){return Array.isArray(e)?e[1]:null}function q8(e){e.data.value!==void 0&&(e.value=e.data.value),e.data=e.data.data}function J8(e){var t=0;do e.height=t;while((e=e.parent)&&e.height<++t)}function Ti(e){this.data=e,this.depth=this.height=0,this.parent=null}Ti.prototype=Bl.prototype={constructor:Ti,count:N8,each:H8,eachAfter:P8,eachBefore:F8,find:R8,sum:I8,sort:E8,path:z8,ancestors:O8,descendants:G8,leaves:Y8,links:B8,copy:Z8,[Symbol.iterator]:U8};function Q8(e){e.x0=Math.round(e.x0),e.y0=Math.round(e.y0),e.x1=Math.round(e.x1),e.y1=Math.round(e.y1)}function K8(e,t,n,r,i){for(var s=e.children,a,o=-1,c=s.length,l=e.value&&(r-t)/e.value;++o=0;)s=r[i],s.z+=t,s.m+=t,t+=s.s+(n+=s.c)}function r7(e,t,n){return e.a.parent===t.parent?e.a:n}function ws(e,t){this._=e,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=t}ws.prototype=Object.create(Ti.prototype);function i7(e){for(var t=new ws(e,0),n,r=[t],i,s,a,o;n=r.pop();)if(s=n._.children)for(n.children=new Array(o=s.length),a=o-1;a>=0;--a)r.push(i=n.children[a]=new ws(s[a],a)),i.parent=n;return(t.parent=new ws(null,0)).children=[t],t}function s7(){var e=e7,t=1,n=1,r=null;function i(l){var u=i7(l);if(u.eachAfter(s),u.parent.m=-u.z,u.eachBefore(a),r)l.eachBefore(c);else{var f=l,h=l,p=l;l.eachBefore(function(S){S.xh.x&&(h=S),S.depth>p.depth&&(p=S)});var g=f===h?1:e(f,h)/2,d=g-f.x,m=t/(h.x+g+d),v=n/(p.depth||1);l.eachBefore(function(S){S.x=(S.x+d)*m,S.y=S.depth*v})}return l}function s(l){var u=l.children,f=l.parent.children,h=l.i?f[l.i-1]:null;if(u){n7(l);var p=(u[0].z+u[u.length-1].z)/2;h?(l.z=h.z+e(l._,h._),l.m=l.z-p):l.z=p}else h&&(l.z=h.z+e(l._,h._));l.parent.A=o(l,h,l.parent.A||f[0])}function a(l){l._.x=l.z+l.parent.m,l.m+=l.parent.m}function o(l,u,f){if(u){for(var h=l,p=l,g=u,d=h.parent.children[0],m=h.m,v=p.m,S=g.m,b=d.m,_;g=Qa(g),h=Ja(h),g&&h;)d=Ja(d),p=Qa(p),p.a=l,_=g.z+S-h.z-m+e(g._,h._),_>0&&(t7(r7(g,l,f),l,_),m+=_,v+=_),S+=g.m,m+=h.m,b+=d.m,v+=p.m;g&&!Qa(p)&&(p.t=g,p.m+=S-v),h&&!Ja(d)&&(d.t=h,d.m+=m-b,f=l)}return f}function c(l){l.x*=t,l.y=l.depth*n}return i.separation=function(l){return arguments.length?(e=l,i):e},i.size=function(l){return arguments.length?(r=!1,t=+l[0],n=+l[1],i):r?null:[t,n]},i.nodeSize=function(l){return arguments.length?(r=!0,t=+l[0],n=+l[1],i):r?[t,n]:null},i}const a7={passive:!1},Mi={capture:!0,passive:!1};function Ka(e){e.stopImmediatePropagation()}function kr(e){e.preventDefault(),e.stopImmediatePropagation()}function Ul(e){var t=e.document.documentElement,n=$e(e).on("dragstart.drag",kr,Mi);"onselectstart"in t?n.on("selectstart.drag",kr,Mi):(t.__noselect=t.style.MozUserSelect,t.style.MozUserSelect="none")}function Zl(e,t){var n=e.document.documentElement,r=$e(e).on("dragstart.drag",null);t&&(r.on("click.drag",kr,Mi),setTimeout(function(){r.on("click.drag",null)},0)),"onselectstart"in n?r.on("selectstart.drag",null):(n.style.MozUserSelect=n.__noselect,delete n.__noselect)}const ns=e=>()=>e;function ko(e,{sourceEvent:t,subject:n,target:r,identifier:i,active:s,x:a,y:o,dx:c,dy:l,dispatch:u}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:t,enumerable:!0,configurable:!0},subject:{value:n,enumerable:!0,configurable:!0},target:{value:r,enumerable:!0,configurable:!0},identifier:{value:i,enumerable:!0,configurable:!0},active:{value:s,enumerable:!0,configurable:!0},x:{value:a,enumerable:!0,configurable:!0},y:{value:o,enumerable:!0,configurable:!0},dx:{value:c,enumerable:!0,configurable:!0},dy:{value:l,enumerable:!0,configurable:!0},_:{value:u}})}ko.prototype.on=function(){var e=this._.on.apply(this._,arguments);return e===this._?this:e};function o7(e){return!e.ctrlKey&&!e.button}function l7(){return this.parentNode}function c7(e,t){return t==null?{x:e.x,y:e.y}:t}function u7(){return navigator.maxTouchPoints||"ontouchstart"in this}function h7(){var e=o7,t=l7,n=c7,r=u7,i={},s=Gi("start","drag","end"),a=0,o,c,l,u,f=0;function h(_){_.on("mousedown.drag",p).filter(r).on("touchstart.drag",m).on("touchmove.drag",v,a7).on("touchend.drag touchcancel.drag",S).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function p(_,k){if(!(u||!e.call(this,_,k))){var H=b(this,t.call(this,_,k),_,k,"mouse");!H||($e(_.view).on("mousemove.drag",g,Mi).on("mouseup.drag",d,Mi),Ul(_.view),Ka(_),l=!1,o=_.clientX,c=_.clientY,H("start",_))}}function g(_){if(kr(_),!l){var k=_.clientX-o,H=_.clientY-c;l=k*k+H*H>f}i.mouse("drag",_)}function d(_){$e(_.view).on("mousemove.drag mouseup.drag",null),Zl(_.view,l),kr(_),i.mouse("end",_)}function m(_,k){if(!!e.call(this,_,k)){var H=_.changedTouches,I=t.call(this,_,k),M=H.length,V,E;for(V=0;V()=>e;function f7(e,{sourceEvent:t,target:n,selection:r,mode:i,dispatch:s}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:t,enumerable:!0,configurable:!0},target:{value:n,enumerable:!0,configurable:!0},selection:{value:r,enumerable:!0,configurable:!0},mode:{value:i,enumerable:!0,configurable:!0},_:{value:s}})}function d7(e){e.stopImmediatePropagation()}function eo(e){e.preventDefault(),e.stopImmediatePropagation()}var lc={name:"drag"},to={name:"space"},fr={name:"handle"},dr={name:"center"};const{abs:cc,max:je,min:Xe}=Math;function uc(e){return[+e[0],+e[1]]}function To(e){return[uc(e[0]),uc(e[1])]}var no={name:"x",handles:["w","e"].map(Ai),input:function(e,t){return e==null?null:[[+e[0],t[0][1]],[+e[1],t[1][1]]]},output:function(e){return e&&[e[0][0],e[1][0]]}},ro={name:"y",handles:["n","s"].map(Ai),input:function(e,t){return e==null?null:[[t[0][0],+e[0]],[t[1][0],+e[1]]]},output:function(e){return e&&[e[0][1],e[1][1]]}},p7={name:"xy",handles:["n","w","e","s","nw","ne","sw","se"].map(Ai),input:function(e){return e==null?null:To(e)},output:function(e){return e}},an={overlay:"crosshair",selection:"move",n:"ns-resize",e:"ew-resize",s:"ns-resize",w:"ew-resize",nw:"nwse-resize",ne:"nesw-resize",se:"nwse-resize",sw:"nesw-resize"},hc={e:"w",w:"e",nw:"ne",ne:"nw",se:"sw",sw:"se"},fc={n:"s",s:"n",nw:"sw",ne:"se",se:"ne",sw:"nw"},g7={overlay:1,selection:1,n:null,e:1,s:null,w:-1,nw:-1,ne:1,se:1,sw:-1},m7={overlay:1,selection:1,n:-1,e:null,s:1,w:null,nw:-1,ne:-1,se:1,sw:1};function Ai(e){return{type:e}}function y7(e){return!e.ctrlKey&&!e.button}function w7(){var e=this.ownerSVGElement||this;return e.hasAttribute("viewBox")?(e=e.viewBox.baseVal,[[e.x,e.y],[e.x+e.width,e.y+e.height]]):[[0,0],[e.width.baseVal.value,e.height.baseVal.value]]}function v7(){return navigator.maxTouchPoints||"ontouchstart"in this}function io(e){for(;!e.__brush;)if(!(e=e.parentNode))return;return e.__brush}function b7(e){return e[0][0]===e[1][0]||e[0][1]===e[1][1]}function C7(){return S7(p7)}function S7(e){var t=w7,n=y7,r=v7,i=!0,s=Gi("start","brush","end"),a=6,o;function c(m){var v=m.property("__brush",d).selectAll(".overlay").data([Ai("overlay")]);v.enter().append("rect").attr("class","overlay").attr("pointer-events","all").attr("cursor",an.overlay).merge(v).each(function(){var b=io(this).extent;$e(this).attr("x",b[0][0]).attr("y",b[0][1]).attr("width",b[1][0]-b[0][0]).attr("height",b[1][1]-b[0][1])}),m.selectAll(".selection").data([Ai("selection")]).enter().append("rect").attr("class","selection").attr("cursor",an.selection).attr("fill","#777").attr("fill-opacity",.3).attr("stroke","#fff").attr("shape-rendering","crispEdges");var S=m.selectAll(".handle").data(e.handles,function(b){return b.type});S.exit().remove(),S.enter().append("rect").attr("class",function(b){return"handle handle--"+b.type}).attr("cursor",function(b){return an[b.type]}),m.each(l).attr("fill","none").attr("pointer-events","all").on("mousedown.brush",h).filter(r).on("touchstart.brush",h).on("touchmove.brush",p).on("touchend.brush touchcancel.brush",g).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}c.move=function(m,v,S){m.tween?m.on("start.brush",function(b){u(this,arguments).beforestart().start(b)}).on("interrupt.brush end.brush",function(b){u(this,arguments).end(b)}).tween("brush",function(){var b=this,_=b.__brush,k=u(b,arguments),H=_.selection,I=e.input(typeof v=="function"?v.apply(this,arguments):v,_.extent),M=Oi(H,I);function V(E){_.selection=E===1&&I===null?null:M(E),l.call(b),k.brush()}return H!==null&&I!==null?V:V(1)}):m.each(function(){var b=this,_=arguments,k=b.__brush,H=e.input(typeof v=="function"?v.apply(b,_):v,k.extent),I=u(b,_).beforestart();Lr(b),k.selection=H===null?null:H,l.call(b),I.start(S).brush(S).end(S)})},c.clear=function(m,v){c.move(m,null,v)};function l(){var m=$e(this),v=io(this).selection;v?(m.selectAll(".selection").style("display",null).attr("x",v[0][0]).attr("y",v[0][1]).attr("width",v[1][0]-v[0][0]).attr("height",v[1][1]-v[0][1]),m.selectAll(".handle").style("display",null).attr("x",function(S){return S.type[S.type.length-1]==="e"?v[1][0]-a/2:v[0][0]-a/2}).attr("y",function(S){return S.type[0]==="s"?v[1][1]-a/2:v[0][1]-a/2}).attr("width",function(S){return S.type==="n"||S.type==="s"?v[1][0]-v[0][0]+a:a}).attr("height",function(S){return S.type==="e"||S.type==="w"?v[1][1]-v[0][1]+a:a})):m.selectAll(".selection,.handle").style("display","none").attr("x",null).attr("y",null).attr("width",null).attr("height",null)}function u(m,v,S){var b=m.__brush.emitter;return b&&(!S||!b.clean)?b:new f(m,v,S)}function f(m,v,S){this.that=m,this.args=v,this.state=m.__brush,this.active=0,this.clean=S}f.prototype={beforestart:function(){return++this.active===1&&(this.state.emitter=this,this.starting=!0),this},start:function(m,v){return this.starting?(this.starting=!1,this.emit("start",m,v)):this.emit("brush",m),this},brush:function(m,v){return this.emit("brush",m,v),this},end:function(m,v){return--this.active===0&&(delete this.state.emitter,this.emit("end",m,v)),this},emit:function(m,v,S){var b=$e(this.that).datum();s.call(m,this.that,new f7(m,{sourceEvent:v,target:c,selection:e.output(this.state.selection),mode:S,dispatch:s}),b)}};function h(m){if(o&&!m.touches||!n.apply(this,arguments))return;var v=this,S=m.target.__data__.type,b=(i&&m.metaKey?S="overlay":S)==="selection"?lc:i&&m.altKey?dr:fr,_=e===ro?null:g7[S],k=e===no?null:m7[S],H=io(v),I=H.extent,M=H.selection,V=I[0][0],E,F,R=I[0][1],A,C,T=I[1][0],D,P,G=I[1][1],Y,U,X=0,J=0,me,K=_&&k&&i&&m.shiftKey,Q,B,ie=Array.from(m.touches||[m],Z=>{const ue=Z.identifier;return Z=Pt(Z,v),Z.point0=Z.slice(),Z.identifier=ue,Z});Lr(v);var fe=u(v,arguments,!0).beforestart();if(S==="overlay"){M&&(me=!0);const Z=[ie[0],ie[1]||ie[0]];H.selection=M=[[E=e===ro?V:Xe(Z[0][0],Z[1][0]),A=e===no?R:Xe(Z[0][1],Z[1][1])],[D=e===ro?T:je(Z[0][0],Z[1][0]),Y=e===no?G:je(Z[0][1],Z[1][1])]],ie.length>1&&we(m)}else E=M[0][0],A=M[0][1],D=M[1][0],Y=M[1][1];F=E,C=A,P=D,U=Y;var j=$e(v).attr("pointer-events","none"),$=j.selectAll(".overlay").attr("cursor",an[S]);if(m.touches)fe.moved=O,fe.ended=de;else{var oe=$e(m.view).on("mousemove.brush",O,!0).on("mouseup.brush",de,!0);i&&oe.on("keydown.brush",xe,!0).on("keyup.brush",Le,!0),Ul(m.view)}l.call(v),fe.start(m,b.name);function O(Z){for(const ue of Z.changedTouches||[Z])for(const He of ie)He.identifier===ue.identifier&&(He.cur=Pt(ue,v));if(K&&!Q&&!B&&ie.length===1){const ue=ie[0];cc(ue.cur[0]-ue[0])>cc(ue.cur[1]-ue[1])?B=!0:Q=!0}for(const ue of ie)ue.cur&&(ue[0]=ue.cur[0],ue[1]=ue.cur[1]);me=!0,eo(Z),we(Z)}function we(Z){const ue=ie[0],He=ue.point0;var ke;switch(X=ue[0]-He[0],J=ue[1]-He[1],b){case to:case lc:{_&&(X=je(V-E,Xe(T-D,X)),F=E+X,P=D+X),k&&(J=je(R-A,Xe(G-Y,J)),C=A+J,U=Y+J);break}case fr:{ie[1]?(_&&(F=je(V,Xe(T,ie[0][0])),P=je(V,Xe(T,ie[1][0])),_=1),k&&(C=je(R,Xe(G,ie[0][1])),U=je(R,Xe(G,ie[1][1])),k=1)):(_<0?(X=je(V-E,Xe(T-E,X)),F=E+X,P=D):_>0&&(X=je(V-D,Xe(T-D,X)),F=E,P=D+X),k<0?(J=je(R-A,Xe(G-A,J)),C=A+J,U=Y):k>0&&(J=je(R-Y,Xe(G-Y,J)),C=A,U=Y+J));break}case dr:{_&&(F=je(V,Xe(T,E-X*_)),P=je(V,Xe(T,D+X*_))),k&&(C=je(R,Xe(G,A-J*k)),U=je(R,Xe(G,Y+J*k)));break}}P0&&(E=F-X),k<0?Y=U-J:k>0&&(A=C-J),b=to,$.attr("cursor",an.selection),we(Z));break}default:return}eo(Z)}function Le(Z){switch(Z.keyCode){case 16:{K&&(Q=B=K=!1,we(Z));break}case 18:{b===dr&&(_<0?D=P:_>0&&(E=F),k<0?Y=U:k>0&&(A=C),b=fr,we(Z));break}case 32:{b===to&&(Z.altKey?(_&&(D=P-X*_,E=F+X*_),k&&(Y=U-J*k,A=C+J*k),b=dr):(_<0?D=P:_>0&&(E=F),k<0?Y=U:k>0&&(A=C),b=fr),$.attr("cursor",an[S]),we(Z));break}default:return}eo(Z)}}function p(m){u(this,arguments).moved(m)}function g(m){u(this,arguments).ended(m)}function d(){var m=this.__brush||{selection:null};return m.extent=To(t.apply(this,arguments)),m.dim=e,m}return c.extent=function(m){return arguments.length?(t=typeof m=="function"?m:$a(To(m)),c):t},c.filter=function(m){return arguments.length?(n=typeof m=="function"?m:$a(!!m),c):n},c.touchable=function(m){return arguments.length?(r=typeof m=="function"?m:$a(!!m),c):r},c.handleSize=function(m){return arguments.length?(a=+m,c):a},c.keyModifiers=function(m){return arguments.length?(i=!!m,c):i},c.on=function(){var m=s.on.apply(s,arguments);return m===s?c:m},c}const rs=e=>()=>e;function _7(e,{sourceEvent:t,target:n,transform:r,dispatch:i}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:t,enumerable:!0,configurable:!0},target:{value:n,enumerable:!0,configurable:!0},transform:{value:r,enumerable:!0,configurable:!0},_:{value:i}})}function un(e,t,n){this.k=e,this.x=t,this.y=n}un.prototype={constructor:un,scale:function(e){return e===1?this:new un(this.k*e,this.x,this.y)},translate:function(e,t){return e===0&t===0?this:new un(this.k,this.x+this.k*e,this.y+this.k*t)},apply:function(e){return[e[0]*this.k+this.x,e[1]*this.k+this.y]},applyX:function(e){return e*this.k+this.x},applyY:function(e){return e*this.k+this.y},invert:function(e){return[(e[0]-this.x)/this.k,(e[1]-this.y)/this.k]},invertX:function(e){return(e-this.x)/this.k},invertY:function(e){return(e-this.y)/this.k},rescaleX:function(e){return e.copy().domain(e.range().map(this.invertX,this).map(e.invert,e))},rescaleY:function(e){return e.copy().domain(e.range().map(this.invertY,this).map(e.invert,e))},toString:function(){return"translate("+this.x+","+this.y+") scale("+this.k+")"}};var jl=new un(1,0,0);un.prototype;function so(e){e.stopImmediatePropagation()}function li(e){e.preventDefault(),e.stopImmediatePropagation()}function x7(e){return(!e.ctrlKey||e.type==="wheel")&&!e.button}function L7(){var e=this;return e instanceof SVGElement?(e=e.ownerSVGElement||e,e.hasAttribute("viewBox")?(e=e.viewBox.baseVal,[[e.x,e.y],[e.x+e.width,e.y+e.height]]):[[0,0],[e.width.baseVal.value,e.height.baseVal.value]]):[[0,0],[e.clientWidth,e.clientHeight]]}function dc(){return this.__zoom||jl}function k7(e){return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*(e.ctrlKey?10:1)}function T7(){return navigator.maxTouchPoints||"ontouchstart"in this}function M7(e,t,n){var r=e.invertX(t[0][0])-n[0][0],i=e.invertX(t[1][0])-n[1][0],s=e.invertY(t[0][1])-n[0][1],a=e.invertY(t[1][1])-n[1][1];return e.translate(i>r?(r+i)/2:Math.min(0,r)||Math.max(0,i),a>s?(s+a)/2:Math.min(0,s)||Math.max(0,a))}function A7(){var e=x7,t=L7,n=M7,r=k7,i=T7,s=[0,1/0],a=[[-1/0,-1/0],[1/0,1/0]],o=250,c=Y6,l=Gi("start","zoom","end"),u,f,h,p=500,g=150,d=0,m=10;function v(C){C.property("__zoom",dc).on("wheel.zoom",M,{passive:!1}).on("mousedown.zoom",V).on("dblclick.zoom",E).filter(i).on("touchstart.zoom",F).on("touchmove.zoom",R).on("touchend.zoom touchcancel.zoom",A).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}v.transform=function(C,T,D,P){var G=C.selection?C.selection():C;G.property("__zoom",dc),C!==G?k(C,T,D,P):G.interrupt().each(function(){H(this,arguments).event(P).start().zoom(null,typeof T=="function"?T.apply(this,arguments):T).end()})},v.scaleBy=function(C,T,D,P){v.scaleTo(C,function(){var G=this.__zoom.k,Y=typeof T=="function"?T.apply(this,arguments):T;return G*Y},D,P)},v.scaleTo=function(C,T,D,P){v.transform(C,function(){var G=t.apply(this,arguments),Y=this.__zoom,U=D==null?_(G):typeof D=="function"?D.apply(this,arguments):D,X=Y.invert(U),J=typeof T=="function"?T.apply(this,arguments):T;return n(b(S(Y,J),U,X),G,a)},D,P)},v.translateBy=function(C,T,D,P){v.transform(C,function(){return n(this.__zoom.translate(typeof T=="function"?T.apply(this,arguments):T,typeof D=="function"?D.apply(this,arguments):D),t.apply(this,arguments),a)},null,P)},v.translateTo=function(C,T,D,P,G){v.transform(C,function(){var Y=t.apply(this,arguments),U=this.__zoom,X=P==null?_(Y):typeof P=="function"?P.apply(this,arguments):P;return n(jl.translate(X[0],X[1]).scale(U.k).translate(typeof T=="function"?-T.apply(this,arguments):-T,typeof D=="function"?-D.apply(this,arguments):-D),Y,a)},P,G)};function S(C,T){return T=Math.max(s[0],Math.min(s[1],T)),T===C.k?C:new un(T,C.x,C.y)}function b(C,T,D){var P=T[0]-D[0]*C.k,G=T[1]-D[1]*C.k;return P===C.x&&G===C.y?C:new un(C.k,P,G)}function _(C){return[(+C[0][0]+ +C[1][0])/2,(+C[0][1]+ +C[1][1])/2]}function k(C,T,D,P){C.on("start.zoom",function(){H(this,arguments).event(P).start()}).on("interrupt.zoom end.zoom",function(){H(this,arguments).event(P).end()}).tween("zoom",function(){var G=this,Y=arguments,U=H(G,Y).event(P),X=t.apply(G,Y),J=D==null?_(X):typeof D=="function"?D.apply(G,Y):D,me=Math.max(X[1][0]-X[0][0],X[1][1]-X[0][1]),K=G.__zoom,Q=typeof T=="function"?T.apply(G,Y):T,B=c(K.invert(J).concat(me/K.k),Q.invert(J).concat(me/Q.k));return function(ie){if(ie===1)ie=Q;else{var fe=B(ie),j=me/fe[2];ie=new un(j,J[0]-fe[0]*j,J[1]-fe[1]*j)}U.zoom(null,ie)}})}function H(C,T,D){return!D&&C.__zooming||new I(C,T)}function I(C,T){this.that=C,this.args=T,this.active=0,this.sourceEvent=null,this.extent=t.apply(C,T),this.taps=0}I.prototype={event:function(C){return C&&(this.sourceEvent=C),this},start:function(){return++this.active===1&&(this.that.__zooming=this,this.emit("start")),this},zoom:function(C,T){return this.mouse&&C!=="mouse"&&(this.mouse[1]=T.invert(this.mouse[0])),this.touch0&&C!=="touch"&&(this.touch0[1]=T.invert(this.touch0[0])),this.touch1&&C!=="touch"&&(this.touch1[1]=T.invert(this.touch1[0])),this.that.__zoom=T,this.emit("zoom"),this},end:function(){return--this.active===0&&(delete this.that.__zooming,this.emit("end")),this},emit:function(C){var T=$e(this.that).datum();l.call(C,this.that,new _7(C,{sourceEvent:this.sourceEvent,target:v,type:C,transform:this.that.__zoom,dispatch:l}),T)}};function M(C,...T){if(!e.apply(this,arguments))return;var D=H(this,T).event(C),P=this.__zoom,G=Math.max(s[0],Math.min(s[1],P.k*Math.pow(2,r.apply(this,arguments)))),Y=Pt(C);if(D.wheel)(D.mouse[0][0]!==Y[0]||D.mouse[0][1]!==Y[1])&&(D.mouse[1]=P.invert(D.mouse[0]=Y)),clearTimeout(D.wheel);else{if(P.k===G)return;D.mouse=[Y,P.invert(Y)],Lr(this),D.start()}li(C),D.wheel=setTimeout(U,g),D.zoom("mouse",n(b(S(P,G),D.mouse[0],D.mouse[1]),D.extent,a));function U(){D.wheel=null,D.end()}}function V(C,...T){if(h||!e.apply(this,arguments))return;var D=C.currentTarget,P=H(this,T,!0).event(C),G=$e(C.view).on("mousemove.zoom",J,!0).on("mouseup.zoom",me,!0),Y=Pt(C,D),U=C.clientX,X=C.clientY;Ul(C.view),so(C),P.mouse=[Y,this.__zoom.invert(Y)],Lr(this),P.start();function J(K){if(li(K),!P.moved){var Q=K.clientX-U,B=K.clientY-X;P.moved=Q*Q+B*B>d}P.event(K).zoom("mouse",n(b(P.that.__zoom,P.mouse[0]=Pt(K,D),P.mouse[1]),P.extent,a))}function me(K){G.on("mousemove.zoom mouseup.zoom",null),Zl(K.view,P.moved),li(K),P.event(K).end()}}function E(C,...T){if(!!e.apply(this,arguments)){var D=this.__zoom,P=Pt(C.changedTouches?C.changedTouches[0]:C,this),G=D.invert(P),Y=D.k*(C.shiftKey?.5:2),U=n(b(S(D,Y),P,G),t.apply(this,T),a);li(C),o>0?$e(this).transition().duration(o).call(k,U,P,C):$e(this).call(v.transform,U,P,C)}}function F(C,...T){if(!!e.apply(this,arguments)){var D=C.touches,P=D.length,G=H(this,T,C.changedTouches.length===P).event(C),Y,U,X,J;for(so(C),U=0;UMath.round((e+Number.EPSILON)*10**t)/10**t,V7=(e,t=null,n="download.json")=>{const r="data:text/json;charset=utf-8,"+encodeURIComponent(JSON.stringify(e));let i=t,s=!1;t===null&&(i=document.createElement("a"),i.style.display="none",s=!0),i==null||i.setAttribute("href",r),i==null||i.setAttribute("download",`${n}`),i==null||i.click(),s&&(i==null||i.remove())},pc=e=>{const t=e[0],n=e[1],r=e[2],i=[t,n,r].map(s=>(s/=255,s<=.03928?s/12.92:Math.pow((s+.055)/1.055,2.4)));return i[0]*.2126+i[1]*.7152+i[2]*.0722},Yr=(e,t)=>{const n=pc(e),r=pc(t);return n>r?(r+.05)/(n+.05):(n+.05)/(r+.05)},gc=(e,t)=>e.size===t.size&&[...e].every(n=>t.has(n));class mc{constructor(t,n,r,i){N(this,"favoritesStore");N(this,"favoritesStoreValue");N(this,"searchStore");N(this,"searchStoreValue");N(this,"sunburstStore");N(this,"sunburstStoreValue");N(this,"handlerUpdated");N(this,"favoritesClicked",()=>{this.favoritesStoreValue.shown=!this.favoritesStoreValue.shown,this.favoritesStore.set(this.favoritesStoreValue),this.favoritesStoreValue.shown&&this.searchStoreValue.shown&&(this.searchStoreValue.shown=!1,this.searchStore.set(this.searchStoreValue))});N(this,"searchClicked",()=>{this.searchStoreValue.shown=!this.searchStoreValue.shown,this.searchStore.set(this.searchStoreValue),this.searchStoreValue.shown&&this.favoritesStoreValue.shown&&(this.favoritesStoreValue.shown=!1,this.favoritesStore.set(this.favoritesStoreValue))});N(this,"depthBoxClicked",t=>{tthis.sunburstStoreValue.depthHigh?(this.sunburstStoreValue.depthHigh=t,this.sunburstStoreValue.action=Qn.DepthChanged,this.sunburstStore.set(this.sunburstStoreValue)):this.sunburstStoreValue.depthLow{const n=this.sunburstStoreValue.depthColors[t-1];let r="inherit";if(n===null||n==="")return"";{const i=[252,252,252],s=[74,74,74],a=z.color(n).rgb(),o=[a.r,a.g,a.b];Yr(i,o){r.delete(l),r.size===0&&(n(),n=null)}}return{set:i,update:s,subscribe:a}}var Qn=(e=>(e[e.DepthChanged=0]="DepthChanged",e.None="",e))(Qn||{});const Dr=()=>({shown:!1,favTrees:[]}),vl=()=>({depthMax:0,depthLow:0,depthHigh:0,depthColors:[],action:""}),bl=()=>({featureMap:new Map,treeMap:new Map,treeID:0,ancestorFs:[],show:!1,x:20,y:20,getFeatureColor:null}),Nr=()=>({shown:!1,curAccuracyLow:0,curAccuracyHigh:1,curMinSampleLow:0,curMinSampleHigh:100,curHeightRange:new Set([]),curDepthFeatures:new Map,curAllFeatures:new Set([]),treeDepthFeaturesMap:null,treeHeightMap:null,treeMinSampleMap:null,featureMap:new Map,getFeatureColor:null,featureOrder:[],updatePlots:null}),Hr=()=>({pinnedTrees:[],lastActiveTreeID:null,getFeatureColor:null,getFeatureInfo:null}),l1=()=>Ei(Dr()),c1=()=>Ei(vl()),u1=()=>Ei(bl()),h1=()=>Ei(Hr()),f1=()=>Ei(Nr());var lo="http://www.w3.org/1999/xhtml";const d1={svg:"http://www.w3.org/2000/svg",xhtml:lo,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function Sa(e){var t=e+="",n=t.indexOf(":");return n>=0&&(t=e.slice(0,n))!=="xmlns"&&(e=e.slice(n+1)),d1.hasOwnProperty(t)?{space:d1[t],local:e}:e}function sh(e){return function(){var t=this.ownerDocument,n=this.namespaceURI;return n===lo&&t.documentElement.namespaceURI===lo?t.createElement(e):t.createElementNS(n,e)}}function ah(e){return function(){return this.ownerDocument.createElementNS(e.space,e.local)}}function Xc(e){var t=Sa(e);return(t.local?ah:sh)(t)}function oh(){}function Cl(e){return e==null?oh:function(){return this.querySelector(e)}}function lh(e){typeof e!="function"&&(e=Cl(e));for(var t=this._groups,n=t.length,r=new Array(n),i=0;i=b&&(b=S+1);!(k=m[b])&&++b=0;)(a=r[i])&&(s&&a.compareDocumentPosition(s)^4&&s.parentNode.insertBefore(a,s),s=a);return this}function Nh(e){e||(e=Hh);function t(f,h){return f&&h?e(f.__data__,h.__data__):!f-!h}for(var n=this._groups,r=n.length,i=new Array(r),s=0;st?1:e>=t?0:NaN}function Fh(){var e=arguments[0];return arguments[0]=this,e.apply(null,arguments),this}function Ph(){return Array.from(this)}function Rh(){for(var e=this._groups,t=0,n=e.length;t1?this.each((t==null?jh:typeof t=="function"?qh:Xh)(e,t,n==null?"":n)):Fr(this.node(),e)}function Fr(e,t){return e.style.getPropertyValue(t)||eu(e).getComputedStyle(e,null).getPropertyValue(t)}function Qh(e){return function(){delete this[e]}}function Kh(e,t){return function(){this[e]=t}}function $h(e,t){return function(){var n=t.apply(this,arguments);n==null?delete this[e]:this[e]=n}}function e3(e,t){return arguments.length>1?this.each((t==null?Qh:typeof t=="function"?$h:Kh)(e,t)):this.node()[e]}function tu(e){return e.trim().split(/^|\s+/)}function Sl(e){return e.classList||new nu(e)}function nu(e){this._node=e,this._names=tu(e.getAttribute("class")||"")}nu.prototype={add:function(e){var t=this._names.indexOf(e);t<0&&(this._names.push(e),this._node.setAttribute("class",this._names.join(" ")))},remove:function(e){var t=this._names.indexOf(e);t>=0&&(this._names.splice(t,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(e){return this._names.indexOf(e)>=0}};function ru(e,t){for(var n=Sl(e),r=-1,i=t.length;++r=0&&(n=t.slice(r+1),t=t.slice(0,r)),{type:t,name:n}})}function M3(e){return function(){var t=this.__on;if(!!t){for(var n=0,r=-1,i=t.length,s;nt?1:e>=t?0:NaN}function W3(e,t){return e==null||t==null?NaN:te?1:t>=e?0:NaN}function au(e){let t,n,r;e.length!==2?(t=fs,n=(o,c)=>fs(e(o),c),r=(o,c)=>e(o)-c):(t=e===fs||e===W3?e:O3,n=e,r=e);function i(o,c,l=0,u=o.length){if(l>>1;n(o[f],c)<0?l=f+1:u=f}while(l>>1;n(o[f],c)<=0?l=f+1:u=f}while(ll&&r(o[f-1],c)>-r(o[f],c)?f-1:f}return{left:i,center:a,right:s}}function O3(){return 0}function G3(e){return e===null?NaN:+e}const Y3=au(fs),B3=Y3.right;au(G3).center;const ou=B3;function U3(e,t){let n=0;if(t===void 0)for(let r of e)r!=null&&(r=+r)>=r&&++n;else{let r=-1;for(let i of e)(i=t(i,++r,e))!=null&&(i=+i)>=i&&++n}return n}function ds(e,t){let n,r;if(t===void 0)for(const i of e)i!=null&&(n===void 0?i>=i&&(n=r=i):(n>i&&(n=i),r=s&&(n=r=s):(n>s&&(n=s),re}var co=Math.sqrt(50),uo=Math.sqrt(10),ho=Math.sqrt(2);function Ds(e,t,n){var r,i=-1,s,a,o;if(t=+t,e=+e,n=+n,e===t&&n>0)return[e];if((r=t0){let c=Math.round(e/o),l=Math.round(t/o);for(c*ot&&--l,a=new Array(s=l-c+1);++it&&--l,a=new Array(s=l-c+1);++i=0?(s>=co?10:s>=uo?5:s>=ho?2:1)*Math.pow(10,i):-Math.pow(10,-i)/(s>=co?10:s>=uo?5:s>=ho?2:1)}function K3(e,t,n){var r=Math.abs(t-e)/Math.max(0,n),i=Math.pow(10,Math.floor(Math.log(r)/Math.LN10)),s=r/i;return s>=co?i*=10:s>=uo?i*=5:s>=ho&&(i*=2),t0?(e=Math.floor(e/i)*i,t=Math.ceil(t/i)*i):i<0&&(e=Math.ceil(e*i)/i,t=Math.floor(t*i)/i),r=i}}function e6(e){return Math.ceil(Math.log(U3(e))/Math.LN2)+1}function t6(){var e=q3,t=ds,n=e6;function r(i){Array.isArray(i)||(i=Array.from(i));var s,a=i.length,o,c,l=new Array(a);for(s=0;s=h)if(v>=h&&t===ds){const b=vi(f,h,S);isFinite(b)&&(b>0?h=(Math.floor(h/b)+1)*b:b<0&&(h=(Math.ceil(h*-b)+1)/-b))}else p.pop()}for(var g=p.length;p[0]<=f;)p.shift(),--g;for(;p[g-1]>h;)p.pop(),--g;var d=new Array(g+1),m;for(s=0;s<=g;++s)m=d[s]=[],m.x0=s>0?p[s-1]:f,m.x1=s0)for(s=0;s=r)&&(n=r);else{let r=-1;for(let i of e)(i=t(i,++r,e))!=null&&(n=i)&&(n=i)}return n}function r6(e,t){let n,r=-1,i=-1;if(t===void 0)for(const s of e)++i,s!=null&&(n=s)&&(n=s,r=i);else for(let s of e)(s=t(s,++i,e))!=null&&(n=s)&&(n=s,r=i);return r}function i6(e,t){let n;if(t===void 0)for(const r of e)r!=null&&(n>r||n===void 0&&r>=r)&&(n=r);else{let r=-1;for(let i of e)(i=t(i,++r,e))!=null&&(n>i||n===void 0&&i>=i)&&(n=i)}return n}function s6(e,t){let n,r=-1,i=-1;if(t===void 0)for(const s of e)++i,s!=null&&(n>s||n===void 0&&s>=s)&&(n=s,r=i);else for(let s of e)(s=t(s,++i,e))!=null&&(n>s||n===void 0&&s>=s)&&(n=s,r=i);return r}function a6(e,t,n){e=+e,t=+t,n=(i=arguments.length)<2?(t=e,e=0,1):i<3?1:+n;for(var r=-1,i=Math.max(0,Math.ceil((t-e)/n))|0,s=new Array(i);++r>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):n===8?qi(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):n===4?qi(t>>12&15|t>>8&240,t>>8&15|t>>4&240,t>>4&15|t&240,((t&15)<<4|t&15)/255):null):(t=u6.exec(e))?new ze(t[1],t[2],t[3],1):(t=h6.exec(e))?new ze(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=f6.exec(e))?qi(t[1],t[2],t[3],t[4]):(t=d6.exec(e))?qi(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=p6.exec(e))?_1(t[1],t[2]/100,t[3]/100,1):(t=g6.exec(e))?_1(t[1],t[2]/100,t[3]/100,t[4]):y1.hasOwnProperty(e)?b1(y1[e]):e==="transparent"?new ze(NaN,NaN,NaN,0):null}function b1(e){return new ze(e>>16&255,e>>8&255,e&255,1)}function qi(e,t,n,r){return r<=0&&(e=t=n=NaN),new ze(e,t,n,r)}function kl(e){return e instanceof Rn||(e=Fn(e)),e?(e=e.rgb(),new ze(e.r,e.g,e.b,e.opacity)):new ze}function fo(e,t,n,r){return arguments.length===1?kl(e):new ze(e,t,n,r==null?1:r)}function ze(e,t,n,r){this.r=+e,this.g=+t,this.b=+n,this.opacity=+r}Ur(ze,fo,Wi(Rn,{brighter(e){return e=e==null?Pr:Math.pow(Pr,e),new ze(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?tr:Math.pow(tr,e),new ze(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new ze($n(this.r),$n(this.g),$n(this.b),Ns(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:C1,formatHex:C1,formatHex8:w6,formatRgb:S1,toString:S1}));function C1(){return`#${Kn(this.r)}${Kn(this.g)}${Kn(this.b)}`}function w6(){return`#${Kn(this.r)}${Kn(this.g)}${Kn(this.b)}${Kn((isNaN(this.opacity)?1:this.opacity)*255)}`}function S1(){const e=Ns(this.opacity);return`${e===1?"rgb(":"rgba("}${$n(this.r)}, ${$n(this.g)}, ${$n(this.b)}${e===1?")":`, ${e})`}`}function Ns(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function $n(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function Kn(e){return e=$n(e),(e<16?"0":"")+e.toString(16)}function _1(e,t,n,r){return r<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new Et(e,t,n,r)}function cu(e){if(e instanceof Et)return new Et(e.h,e.s,e.l,e.opacity);if(e instanceof Rn||(e=Fn(e)),!e)return new Et;if(e instanceof Et)return e;e=e.rgb();var t=e.r/255,n=e.g/255,r=e.b/255,i=Math.min(t,n,r),s=Math.max(t,n,r),a=NaN,o=s-i,c=(s+i)/2;return o?(t===s?a=(n-r)/o+(n0&&c<1?0:a,new Et(a,o,c,e.opacity)}function uu(e,t,n,r){return arguments.length===1?cu(e):new Et(e,t,n,r==null?1:r)}function Et(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}Ur(Et,uu,Wi(Rn,{brighter(e){return e=e==null?Pr:Math.pow(Pr,e),new Et(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?tr:Math.pow(tr,e),new Et(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=this.h%360+(this.h<0)*360,t=isNaN(e)||isNaN(this.s)?0:this.s,n=this.l,r=n+(n<.5?n:1-n)*t,i=2*n-r;return new ze(Pa(e>=240?e-240:e+120,i,r),Pa(e,i,r),Pa(e<120?e+240:e-120,i,r),this.opacity)},clamp(){return new Et(x1(this.h),Ji(this.s),Ji(this.l),Ns(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 e=Ns(this.opacity);return`${e===1?"hsl(":"hsla("}${x1(this.h)}, ${Ji(this.s)*100}%, ${Ji(this.l)*100}%${e===1?")":`, ${e})`}`}}));function x1(e){return e=(e||0)%360,e<0?e+360:e}function Ji(e){return Math.max(0,Math.min(1,e||0))}function Pa(e,t,n){return(e<60?t+(n-t)*e/60:e<180?n:e<240?t+(n-t)*(240-e)/60:t)*255}const hu=Math.PI/180,fu=180/Math.PI,Hs=18,du=.96422,pu=1,gu=.82521,mu=4/29,Sr=6/29,yu=3*Sr*Sr,v6=Sr*Sr*Sr;function wu(e){if(e instanceof Jt)return new Jt(e.l,e.a,e.b,e.opacity);if(e instanceof jt)return bu(e);e instanceof ze||(e=kl(e));var t=za(e.r),n=za(e.g),r=za(e.b),i=Ra((.2225045*t+.7168786*n+.0606169*r)/pu),s,a;return t===n&&n===r?s=a=i:(s=Ra((.4360747*t+.3850649*n+.1430804*r)/du),a=Ra((.0139322*t+.0971045*n+.7141733*r)/gu)),new Jt(116*i-16,500*(s-i),200*(i-a),e.opacity)}function b6(e,t,n,r){return arguments.length===1?wu(e):new Jt(e,t,n,r==null?1:r)}function Jt(e,t,n,r){this.l=+e,this.a=+t,this.b=+n,this.opacity=+r}Ur(Jt,b6,Wi(Rn,{brighter(e){return new Jt(this.l+Hs*(e==null?1:e),this.a,this.b,this.opacity)},darker(e){return new Jt(this.l-Hs*(e==null?1:e),this.a,this.b,this.opacity)},rgb(){var e=(this.l+16)/116,t=isNaN(this.a)?e:e+this.a/500,n=isNaN(this.b)?e:e-this.b/200;return t=du*Ia(t),e=pu*Ia(e),n=gu*Ia(n),new ze(Ea(3.1338561*t-1.6168667*e-.4906146*n),Ea(-.9787684*t+1.9161415*e+.033454*n),Ea(.0719453*t-.2289914*e+1.4052427*n),this.opacity)}}));function Ra(e){return e>v6?Math.pow(e,1/3):e/yu+mu}function Ia(e){return e>Sr?e*e*e:yu*(e-mu)}function Ea(e){return 255*(e<=.0031308?12.92*e:1.055*Math.pow(e,1/2.4)-.055)}function za(e){return(e/=255)<=.04045?e/12.92:Math.pow((e+.055)/1.055,2.4)}function vu(e){if(e instanceof jt)return new jt(e.h,e.c,e.l,e.opacity);if(e instanceof Jt||(e=wu(e)),e.a===0&&e.b===0)return new jt(NaN,0()=>e;function Su(e,t){return function(n){return e+n*t}}function x6(e,t,n){return e=Math.pow(e,n),t=Math.pow(t,n)-e,n=1/n,function(r){return Math.pow(e+r*t,n)}}function L6(e,t){var n=t-e;return n?Su(e,n>180||n<-180?n-360*Math.round(n/360):n):xa(isNaN(e)?t:e)}function k6(e){return(e=+e)==1?_r:function(t,n){return n-t?x6(t,n,e):xa(isNaN(t)?n:t)}}function _r(e,t){var n=t-e;return n?Su(e,n):xa(isNaN(e)?t:e)}const Fs=function e(t){var n=k6(t);function r(i,s){var a=n((i=fo(i)).r,(s=fo(s)).r),o=n(i.g,s.g),c=n(i.b,s.b),l=_r(i.opacity,s.opacity);return function(u){return i.r=a(u),i.g=o(u),i.b=c(u),i.opacity=l(u),i+""}}return r.gamma=e,r}(1);function T6(e,t){t||(t=[]);var n=e?Math.min(t.length,e.length):0,r=t.slice(),i;return function(s){for(i=0;in&&(s=t.slice(n,s),o[a]?o[a]+=s:o[++a]=s),(r=r[0])===(i=i[0])?o[a]?o[a]+=i:o[++a]=i:(o[++a]=null,c.push({i:a,x:Rt(r,i)})),n=Wa.lastIndex;return n180?u+=360:u-l>180&&(l+=360),h.push({i:f.push(i(f)+"rotate(",null,r)-2,x:Rt(l,u)})):u&&f.push(i(f)+"rotate("+u+r)}function o(l,u,f,h){l!==u?h.push({i:f.push(i(f)+"skewX(",null,r)-2,x:Rt(l,u)}):u&&f.push(i(f)+"skewX("+u+r)}function c(l,u,f,h,p,g){if(l!==f||u!==h){var d=p.push(i(p)+"scale(",null,",",null,")");g.push({i:d-4,x:Rt(l,f)},{i:d-2,x:Rt(u,h)})}else(f!==1||h!==1)&&p.push(i(p)+"scale("+f+","+h+")")}return function(l,u){var f=[],h=[];return l=e(l),u=e(u),s(l.translateX,l.translateY,u.translateX,u.translateY,f,h),a(l.rotate,u.rotate,f,h),o(l.skewX,u.skewX,f,h),c(l.scaleX,l.scaleY,u.scaleX,u.scaleY,f,h),l=u=null,function(p){for(var g=-1,d=h.length,m;++gt&&(n=e,e=t,t=n),function(r){return Math.max(e,Math.min(t,r))}}function j6(e,t,n){var r=e[0],i=e[1],s=t[0],a=t[1];return i2?X6:j6,c=l=null,f}function f(h){return h==null||isNaN(h=+h)?s:(c||(c=o(e.map(r),t,n)))(r(a(h)))}return f.invert=function(h){return a(i((l||(l=o(t,e.map(r),Rt)))(h)))},f.domain=function(h){return arguments.length?(e=Array.from(h,U6),u()):e.slice()},f.range=function(h){return arguments.length?(t=Array.from(h),u()):t.slice()},f.rangeRound=function(h){return t=Array.from(h),n=F6,u()},f.clamp=function(h){return arguments.length?(a=h?!0:Xt,u()):a!==Xt},f.interpolate=function(h){return arguments.length?(n=h,u()):n},f.unknown=function(h){return arguments.length?(s=h,f):s},function(h,p){return r=h,i=p,u()}}function q6(){return Vl()(Xt,Xt)}function J6(e){return Math.abs(e=Math.round(e))>=1e21?e.toLocaleString("en").replace(/,/g,""):e.toString(10)}function Ps(e,t){if((n=(e=t?e.toExponential(t-1):e.toExponential()).indexOf("e"))<0)return null;var n,r=e.slice(0,n);return[r.length>1?r[0]+r.slice(2):r,+e.slice(n+1)]}function Rr(e){return e=Ps(Math.abs(e)),e?e[1]:NaN}function Q6(e,t){return function(n,r){for(var i=n.length,s=[],a=0,o=e[0],c=0;i>0&&o>0&&(c+o+1>r&&(o=Math.max(1,r-c)),s.push(n.substring(i-=o,i+o)),!((c+=o+1)>r));)o=e[a=(a+1)%e.length];return s.reverse().join(t)}}function K6(e){return function(t){return t.replace(/[0-9]/g,function(n){return e[+n]})}}var $6=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function Si(e){if(!(t=$6.exec(e)))throw new Error("invalid format: "+e);var t;return new Dl({fill:t[1],align:t[2],sign:t[3],symbol:t[4],zero:t[5],width:t[6],comma:t[7],precision:t[8]&&t[8].slice(1),trim:t[9],type:t[10]})}Si.prototype=Dl.prototype;function Dl(e){this.fill=e.fill===void 0?" ":e.fill+"",this.align=e.align===void 0?">":e.align+"",this.sign=e.sign===void 0?"-":e.sign+"",this.symbol=e.symbol===void 0?"":e.symbol+"",this.zero=!!e.zero,this.width=e.width===void 0?void 0:+e.width,this.comma=!!e.comma,this.precision=e.precision===void 0?void 0:+e.precision,this.trim=!!e.trim,this.type=e.type===void 0?"":e.type+""}Dl.prototype.toString=function(){return this.fill+this.align+this.sign+this.symbol+(this.zero?"0":"")+(this.width===void 0?"":Math.max(1,this.width|0))+(this.comma?",":"")+(this.precision===void 0?"":"."+Math.max(0,this.precision|0))+(this.trim?"~":"")+this.type};function e5(e){e:for(var t=e.length,n=1,r=-1,i;n0&&(r=0);break}return r>0?e.slice(0,r)+e.slice(i+1):e}var Mu;function t5(e,t){var n=Ps(e,t);if(!n)return e+"";var r=n[0],i=n[1],s=i-(Mu=Math.max(-8,Math.min(8,Math.floor(i/3)))*3)+1,a=r.length;return s===a?r:s>a?r+new Array(s-a+1).join("0"):s>0?r.slice(0,s)+"."+r.slice(s):"0."+new Array(1-s).join("0")+Ps(e,Math.max(0,t+s-1))[0]}function D1(e,t){var n=Ps(e,t);if(!n)return e+"";var r=n[0],i=n[1];return i<0?"0."+new Array(-i).join("0")+r:r.length>i+1?r.slice(0,i+1)+"."+r.slice(i+1):r+new Array(i-r.length+2).join("0")}const N1={"%":(e,t)=>(e*100).toFixed(t),b:e=>Math.round(e).toString(2),c:e=>e+"",d:J6,e:(e,t)=>e.toExponential(t),f:(e,t)=>e.toFixed(t),g:(e,t)=>e.toPrecision(t),o:e=>Math.round(e).toString(8),p:(e,t)=>D1(e*100,t),r:D1,s:t5,X:e=>Math.round(e).toString(16).toUpperCase(),x:e=>Math.round(e).toString(16)};function H1(e){return e}var F1=Array.prototype.map,P1=["y","z","a","f","p","n","\xB5","m","","k","M","G","T","P","E","Z","Y"];function n5(e){var t=e.grouping===void 0||e.thousands===void 0?H1:Q6(F1.call(e.grouping,Number),e.thousands+""),n=e.currency===void 0?"":e.currency[0]+"",r=e.currency===void 0?"":e.currency[1]+"",i=e.decimal===void 0?".":e.decimal+"",s=e.numerals===void 0?H1:K6(F1.call(e.numerals,String)),a=e.percent===void 0?"%":e.percent+"",o=e.minus===void 0?"\u2212":e.minus+"",c=e.nan===void 0?"NaN":e.nan+"";function l(f){f=Si(f);var h=f.fill,p=f.align,g=f.sign,d=f.symbol,m=f.zero,v=f.width,S=f.comma,b=f.precision,_=f.trim,k=f.type;k==="n"?(S=!0,k="g"):N1[k]||(b===void 0&&(b=12),_=!0,k="g"),(m||h==="0"&&p==="=")&&(m=!0,h="0",p="=");var H=d==="$"?n:d==="#"&&/[boxX]/.test(k)?"0"+k.toLowerCase():"",I=d==="$"?r:/[%p]/.test(k)?a:"",M=N1[k],V=/[defgprs%]/.test(k);b=b===void 0?6:/[gprs]/.test(k)?Math.max(1,Math.min(21,b)):Math.max(0,Math.min(20,b));function E(F){var R=H,A=I,C,T,D;if(k==="c")A=M(F)+A,F="";else{F=+F;var P=F<0||1/F<0;if(F=isNaN(F)?c:M(Math.abs(F),b),_&&(F=e5(F)),P&&+F==0&&g!=="+"&&(P=!1),R=(P?g==="("?g:o:g==="-"||g==="("?"":g)+R,A=(k==="s"?P1[8+Mu/3]:"")+A+(P&&g==="("?")":""),V){for(C=-1,T=F.length;++CD||D>57){A=(D===46?i+F.slice(C+1):F.slice(C))+A,F=F.slice(0,C);break}}}S&&!m&&(F=t(F,1/0));var G=R.length+F.length+A.length,Y=G>1)+R+F+A+Y.slice(G);break;default:F=Y+R+F+A;break}return s(F)}return E.toString=function(){return f+""},E}function u(f,h){var p=l((f=Si(f),f.type="f",f)),g=Math.max(-8,Math.min(8,Math.floor(Rr(h)/3)))*3,d=Math.pow(10,-g),m=P1[8+g/3];return function(v){return p(d*v)+m}}return{format:l,formatPrefix:u}}var Ki,La,Au;r5({thousands:",",grouping:[3],currency:["$",""]});function r5(e){return Ki=n5(e),La=Ki.format,Au=Ki.formatPrefix,Ki}function i5(e){return Math.max(0,-Rr(Math.abs(e)))}function s5(e,t){return Math.max(0,Math.max(-8,Math.min(8,Math.floor(Rr(t)/3)))*3-Rr(Math.abs(e)))}function a5(e,t){return e=Math.abs(e),t=Math.abs(t)-e,Math.max(0,Rr(t)-Rr(e))+1}function o5(e,t,n,r){var i=K3(e,t,n),s;switch(r=Si(r==null?",f":r),r.type){case"s":{var a=Math.max(Math.abs(e),Math.abs(t));return r.precision==null&&!isNaN(s=s5(i,a))&&(r.precision=s),Au(r,a)}case"":case"e":case"g":case"p":case"r":{r.precision==null&&!isNaN(s=a5(i,Math.max(Math.abs(e),Math.abs(t))))&&(r.precision=s-(r.type==="e"));break}case"f":case"%":{r.precision==null&&!isNaN(s=i5(i))&&(r.precision=s-(r.type==="%")*2);break}}return La(r)}function Vu(e){var t=e.domain;return e.ticks=function(n){var r=t();return Ds(r[0],r[r.length-1],n==null?10:n)},e.tickFormat=function(n,r){var i=t();return o5(i[0],i[i.length-1],n==null?10:n,r)},e.nice=function(n){n==null&&(n=10);var r=t(),i=0,s=r.length-1,a=r[i],o=r[s],c,l,u=10;for(o0;){if(l=vi(a,o,n),l===c)return r[i]=a,r[s]=o,t(r);if(l>0)a=Math.floor(a/l)*l,o=Math.ceil(o/l)*l;else if(l<0)a=Math.ceil(a*l)/l,o=Math.floor(o*l)/l;else break;c=l}return e},e}function Du(){var e=q6();return e.copy=function(){return Al(e,Du())},zi.apply(e,arguments),Vu(e)}function l5(e,t){e=e.slice();var n=0,r=e.length-1,i=e[n],s=e[r],a;return sMath.pow(e,t)}function d5(e){return e===Math.E?Math.log:e===10&&Math.log10||e===2&&Math.log2||(e=Math.log(e),t=>Math.log(t)/e)}function E1(e){return(t,n)=>-e(-t,n)}function p5(e){const t=e(R1,I1),n=t.domain;let r=10,i,s;function a(){return i=d5(r),s=f5(r),n()[0]<0?(i=E1(i),s=E1(s),e(c5,u5)):e(R1,I1),t}return t.base=function(o){return arguments.length?(r=+o,a()):r},t.domain=function(o){return arguments.length?(n(o),a()):n()},t.ticks=o=>{const c=n();let l=c[0],u=c[c.length-1];const f=u0){for(;h<=p;++h)for(g=1;gu)break;v.push(d)}}else for(;h<=p;++h)for(g=r-1;g>=1;--g)if(d=h>0?g/s(-h):g*s(h),!(du)break;v.push(d)}v.length*2{if(o==null&&(o=10),c==null&&(c=r===10?"s":","),typeof c!="function"&&(!(r%1)&&(c=Si(c)).precision==null&&(c.trim=!0),c=La(c)),o===1/0)return c;const l=Math.max(1,r*o/t.ticks().length);return u=>{let f=u/s(Math.round(i(u)));return f*rn(l5(n(),{floor:o=>s(Math.floor(i(o))),ceil:o=>s(Math.ceil(i(o)))})),t}function Nu(){const e=p5(Vl()).domain([1,10]);return e.copy=()=>Al(e,Nu()).base(e.base()),zi.apply(e,arguments),e}function z1(e){return function(t){return t<0?-Math.pow(-t,e):Math.pow(t,e)}}function g5(e){return e<0?-Math.sqrt(-e):Math.sqrt(e)}function m5(e){return e<0?-e*e:e*e}function y5(e){var t=e(Xt,Xt),n=1;function r(){return n===1?e(Xt,Xt):n===.5?e(g5,m5):e(z1(n),z1(1/n))}return t.exponent=function(i){return arguments.length?(n=+i,r()):n},Vu(t)}function Nl(){var e=y5(Vl());return e.copy=function(){return Al(e,Nl()).exponent(e.exponent())},zi.apply(e,arguments),e}function w5(){return Nl.apply(null,arguments).exponent(.5)}var Oa=new Date,Ga=new Date;function fn(e,t,n,r){function i(s){return e(s=arguments.length===0?new Date:new Date(+s)),s}return i.floor=function(s){return e(s=new Date(+s)),s},i.ceil=function(s){return e(s=new Date(s-1)),t(s,1),e(s),s},i.round=function(s){var a=i(s),o=i.ceil(s);return s-a0))return c;do c.push(l=new Date(+s)),t(s,o),e(s);while(l=a)for(;e(a),!s(a);)a.setTime(a-1)},function(a,o){if(a>=a)if(o<0)for(;++o<=0;)for(;t(a,-1),!s(a););else for(;--o>=0;)for(;t(a,1),!s(a););})},n&&(i.count=function(s,a){return Oa.setTime(+s),Ga.setTime(+a),e(Oa),e(Ga),Math.floor(n(Oa,Ga))},i.every=function(s){return s=Math.floor(s),!isFinite(s)||!(s>0)?null:s>1?i.filter(r?function(a){return r(a)%s===0}:function(a){return i.count(0,a)%s===0}):i}),i}const v5=1e3,Hl=v5*60,b5=Hl*60,Fl=b5*24,Hu=Fl*7;var Fu=fn(e=>e.setHours(0,0,0,0),(e,t)=>e.setDate(e.getDate()+t),(e,t)=>(t-e-(t.getTimezoneOffset()-e.getTimezoneOffset())*Hl)/Fl,e=>e.getDate()-1);const Pu=Fu;Fu.range;function rr(e){return fn(function(t){t.setDate(t.getDate()-(t.getDay()+7-e)%7),t.setHours(0,0,0,0)},function(t,n){t.setDate(t.getDate()+n*7)},function(t,n){return(n-t-(n.getTimezoneOffset()-t.getTimezoneOffset())*Hl)/Hu})}var Ru=rr(0),Rs=rr(1),C5=rr(2),S5=rr(3),Ir=rr(4),_5=rr(5),x5=rr(6);Ru.range;Rs.range;C5.range;S5.range;Ir.range;_5.range;x5.range;var Pl=fn(function(e){e.setMonth(0,1),e.setHours(0,0,0,0)},function(e,t){e.setFullYear(e.getFullYear()+t)},function(e,t){return t.getFullYear()-e.getFullYear()},function(e){return e.getFullYear()});Pl.every=function(e){return!isFinite(e=Math.floor(e))||!(e>0)?null:fn(function(t){t.setFullYear(Math.floor(t.getFullYear()/e)*e),t.setMonth(0,1),t.setHours(0,0,0,0)},function(t,n){t.setFullYear(t.getFullYear()+n*e)})};const _i=Pl;Pl.range;var Iu=fn(function(e){e.setUTCHours(0,0,0,0)},function(e,t){e.setUTCDate(e.getUTCDate()+t)},function(e,t){return(t-e)/Fl},function(e){return e.getUTCDate()-1});const Eu=Iu;Iu.range;function ir(e){return fn(function(t){t.setUTCDate(t.getUTCDate()-(t.getUTCDay()+7-e)%7),t.setUTCHours(0,0,0,0)},function(t,n){t.setUTCDate(t.getUTCDate()+n*7)},function(t,n){return(n-t)/Hu})}var zu=ir(0),Is=ir(1),L5=ir(2),k5=ir(3),Er=ir(4),T5=ir(5),M5=ir(6);zu.range;Is.range;L5.range;k5.range;Er.range;T5.range;M5.range;var Rl=fn(function(e){e.setUTCMonth(0,1),e.setUTCHours(0,0,0,0)},function(e,t){e.setUTCFullYear(e.getUTCFullYear()+t)},function(e,t){return t.getUTCFullYear()-e.getUTCFullYear()},function(e){return e.getUTCFullYear()});Rl.every=function(e){return!isFinite(e=Math.floor(e))||!(e>0)?null:fn(function(t){t.setUTCFullYear(Math.floor(t.getUTCFullYear()/e)*e),t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0)},function(t,n){t.setUTCFullYear(t.getUTCFullYear()+n*e)})};const xi=Rl;Rl.range;function Ya(e){if(0<=e.y&&e.y<100){var t=new Date(-1,e.m,e.d,e.H,e.M,e.S,e.L);return t.setFullYear(e.y),t}return new Date(e.y,e.m,e.d,e.H,e.M,e.S,e.L)}function Ba(e){if(0<=e.y&&e.y<100){var t=new Date(Date.UTC(-1,e.m,e.d,e.H,e.M,e.S,e.L));return t.setUTCFullYear(e.y),t}return new Date(Date.UTC(e.y,e.m,e.d,e.H,e.M,e.S,e.L))}function ri(e,t,n){return{y:e,m:t,d:n,H:0,M:0,S:0,L:0}}function A5(e){var t=e.dateTime,n=e.date,r=e.time,i=e.periods,s=e.days,a=e.shortDays,o=e.months,c=e.shortMonths,l=ii(i),u=si(i),f=ii(s),h=si(s),p=ii(a),g=si(a),d=ii(o),m=si(o),v=ii(c),S=si(c),b={a:P,A:G,b:Y,B:U,c:null,d:U1,e:U1,f:K5,g:l4,G:u4,H:q5,I:J5,j:Q5,L:Wu,m:$5,M:e4,p:X,q:J,Q:X1,s:q1,S:t4,u:n4,U:r4,V:i4,w:s4,W:a4,x:null,X:null,y:o4,Y:c4,Z:h4,"%":j1},_={a:me,A:K,b:Q,B,c:null,d:Z1,e:Z1,f:g4,g:L4,G:T4,H:f4,I:d4,j:p4,L:Gu,m:m4,M:y4,p:ie,q:fe,Q:X1,s:q1,S:w4,u:v4,U:b4,V:C4,w:S4,W:_4,x:null,X:null,y:x4,Y:k4,Z:M4,"%":j1},k={a:E,A:F,b:R,B:A,c:C,d:Y1,e:Y1,f:U5,g:G1,G:O1,H:B1,I:B1,j:O5,L:B5,m:W5,M:G5,p:V,q:z5,Q:j5,s:X5,S:Y5,u:F5,U:P5,V:R5,w:H5,W:I5,x:T,X:D,y:G1,Y:O1,Z:E5,"%":Z5};b.x=H(n,b),b.X=H(r,b),b.c=H(t,b),_.x=H(n,_),_.X=H(r,_),_.c=H(t,_);function H(j,$){return function(oe){var O=[],we=-1,de=0,xe=j.length,Le,Z,ue;for(oe instanceof Date||(oe=new Date(+oe));++we53)return null;"w"in O||(O.w=1),"Z"in O?(de=Ba(ri(O.y,0,1)),xe=de.getUTCDay(),de=xe>4||xe===0?Is.ceil(de):Is(de),de=Eu.offset(de,(O.V-1)*7),O.y=de.getUTCFullYear(),O.m=de.getUTCMonth(),O.d=de.getUTCDate()+(O.w+6)%7):(de=Ya(ri(O.y,0,1)),xe=de.getDay(),de=xe>4||xe===0?Rs.ceil(de):Rs(de),de=Pu.offset(de,(O.V-1)*7),O.y=de.getFullYear(),O.m=de.getMonth(),O.d=de.getDate()+(O.w+6)%7)}else("W"in O||"U"in O)&&("w"in O||(O.w="u"in O?O.u%7:"W"in O?1:0),xe="Z"in O?Ba(ri(O.y,0,1)).getUTCDay():Ya(ri(O.y,0,1)).getDay(),O.m=0,O.d="W"in O?(O.w+6)%7+O.W*7-(xe+5)%7:O.w+O.U*7-(xe+6)%7);return"Z"in O?(O.H+=O.Z/100|0,O.M+=O.Z%100,Ba(O)):Ya(O)}}function M(j,$,oe,O){for(var we=0,de=$.length,xe=oe.length,Le,Z;we=xe)return-1;if(Le=$.charCodeAt(we++),Le===37){if(Le=$.charAt(we++),Z=k[Le in W1?$.charAt(we++):Le],!Z||(O=Z(j,oe,O))<0)return-1}else if(Le!=oe.charCodeAt(O++))return-1}return O}function V(j,$,oe){var O=l.exec($.slice(oe));return O?(j.p=u.get(O[0].toLowerCase()),oe+O[0].length):-1}function E(j,$,oe){var O=p.exec($.slice(oe));return O?(j.w=g.get(O[0].toLowerCase()),oe+O[0].length):-1}function F(j,$,oe){var O=f.exec($.slice(oe));return O?(j.w=h.get(O[0].toLowerCase()),oe+O[0].length):-1}function R(j,$,oe){var O=v.exec($.slice(oe));return O?(j.m=S.get(O[0].toLowerCase()),oe+O[0].length):-1}function A(j,$,oe){var O=d.exec($.slice(oe));return O?(j.m=m.get(O[0].toLowerCase()),oe+O[0].length):-1}function C(j,$,oe){return M(j,t,$,oe)}function T(j,$,oe){return M(j,n,$,oe)}function D(j,$,oe){return M(j,r,$,oe)}function P(j){return a[j.getDay()]}function G(j){return s[j.getDay()]}function Y(j){return c[j.getMonth()]}function U(j){return o[j.getMonth()]}function X(j){return i[+(j.getHours()>=12)]}function J(j){return 1+~~(j.getMonth()/3)}function me(j){return a[j.getUTCDay()]}function K(j){return s[j.getUTCDay()]}function Q(j){return c[j.getUTCMonth()]}function B(j){return o[j.getUTCMonth()]}function ie(j){return i[+(j.getUTCHours()>=12)]}function fe(j){return 1+~~(j.getUTCMonth()/3)}return{format:function(j){var $=H(j+="",b);return $.toString=function(){return j},$},parse:function(j){var $=I(j+="",!1);return $.toString=function(){return j},$},utcFormat:function(j){var $=H(j+="",_);return $.toString=function(){return j},$},utcParse:function(j){var $=I(j+="",!0);return $.toString=function(){return j},$}}}var W1={"-":"",_:" ",0:"0"},We=/^\s*\d+/,V5=/^%/,D5=/[\\^$*+?|[\]().{}]/g;function Ce(e,t,n){var r=e<0?"-":"",i=(r?-e:e)+"",s=i.length;return r+(s[t.toLowerCase(),n]))}function H5(e,t,n){var r=We.exec(t.slice(n,n+1));return r?(e.w=+r[0],n+r[0].length):-1}function F5(e,t,n){var r=We.exec(t.slice(n,n+1));return r?(e.u=+r[0],n+r[0].length):-1}function P5(e,t,n){var r=We.exec(t.slice(n,n+2));return r?(e.U=+r[0],n+r[0].length):-1}function R5(e,t,n){var r=We.exec(t.slice(n,n+2));return r?(e.V=+r[0],n+r[0].length):-1}function I5(e,t,n){var r=We.exec(t.slice(n,n+2));return r?(e.W=+r[0],n+r[0].length):-1}function O1(e,t,n){var r=We.exec(t.slice(n,n+4));return r?(e.y=+r[0],n+r[0].length):-1}function G1(e,t,n){var r=We.exec(t.slice(n,n+2));return r?(e.y=+r[0]+(+r[0]>68?1900:2e3),n+r[0].length):-1}function E5(e,t,n){var r=/^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(t.slice(n,n+6));return r?(e.Z=r[1]?0:-(r[2]+(r[3]||"00")),n+r[0].length):-1}function z5(e,t,n){var r=We.exec(t.slice(n,n+1));return r?(e.q=r[0]*3-3,n+r[0].length):-1}function W5(e,t,n){var r=We.exec(t.slice(n,n+2));return r?(e.m=r[0]-1,n+r[0].length):-1}function Y1(e,t,n){var r=We.exec(t.slice(n,n+2));return r?(e.d=+r[0],n+r[0].length):-1}function O5(e,t,n){var r=We.exec(t.slice(n,n+3));return r?(e.m=0,e.d=+r[0],n+r[0].length):-1}function B1(e,t,n){var r=We.exec(t.slice(n,n+2));return r?(e.H=+r[0],n+r[0].length):-1}function G5(e,t,n){var r=We.exec(t.slice(n,n+2));return r?(e.M=+r[0],n+r[0].length):-1}function Y5(e,t,n){var r=We.exec(t.slice(n,n+2));return r?(e.S=+r[0],n+r[0].length):-1}function B5(e,t,n){var r=We.exec(t.slice(n,n+3));return r?(e.L=+r[0],n+r[0].length):-1}function U5(e,t,n){var r=We.exec(t.slice(n,n+6));return r?(e.L=Math.floor(r[0]/1e3),n+r[0].length):-1}function Z5(e,t,n){var r=V5.exec(t.slice(n,n+1));return r?n+r[0].length:-1}function j5(e,t,n){var r=We.exec(t.slice(n));return r?(e.Q=+r[0],n+r[0].length):-1}function X5(e,t,n){var r=We.exec(t.slice(n));return r?(e.s=+r[0],n+r[0].length):-1}function U1(e,t){return Ce(e.getDate(),t,2)}function q5(e,t){return Ce(e.getHours(),t,2)}function J5(e,t){return Ce(e.getHours()%12||12,t,2)}function Q5(e,t){return Ce(1+Pu.count(_i(e),e),t,3)}function Wu(e,t){return Ce(e.getMilliseconds(),t,3)}function K5(e,t){return Wu(e,t)+"000"}function $5(e,t){return Ce(e.getMonth()+1,t,2)}function e4(e,t){return Ce(e.getMinutes(),t,2)}function t4(e,t){return Ce(e.getSeconds(),t,2)}function n4(e){var t=e.getDay();return t===0?7:t}function r4(e,t){return Ce(Ru.count(_i(e)-1,e),t,2)}function Ou(e){var t=e.getDay();return t>=4||t===0?Ir(e):Ir.ceil(e)}function i4(e,t){return e=Ou(e),Ce(Ir.count(_i(e),e)+(_i(e).getDay()===4),t,2)}function s4(e){return e.getDay()}function a4(e,t){return Ce(Rs.count(_i(e)-1,e),t,2)}function o4(e,t){return Ce(e.getFullYear()%100,t,2)}function l4(e,t){return e=Ou(e),Ce(e.getFullYear()%100,t,2)}function c4(e,t){return Ce(e.getFullYear()%1e4,t,4)}function u4(e,t){var n=e.getDay();return e=n>=4||n===0?Ir(e):Ir.ceil(e),Ce(e.getFullYear()%1e4,t,4)}function h4(e){var t=e.getTimezoneOffset();return(t>0?"-":(t*=-1,"+"))+Ce(t/60|0,"0",2)+Ce(t%60,"0",2)}function Z1(e,t){return Ce(e.getUTCDate(),t,2)}function f4(e,t){return Ce(e.getUTCHours(),t,2)}function d4(e,t){return Ce(e.getUTCHours()%12||12,t,2)}function p4(e,t){return Ce(1+Eu.count(xi(e),e),t,3)}function Gu(e,t){return Ce(e.getUTCMilliseconds(),t,3)}function g4(e,t){return Gu(e,t)+"000"}function m4(e,t){return Ce(e.getUTCMonth()+1,t,2)}function y4(e,t){return Ce(e.getUTCMinutes(),t,2)}function w4(e,t){return Ce(e.getUTCSeconds(),t,2)}function v4(e){var t=e.getUTCDay();return t===0?7:t}function b4(e,t){return Ce(zu.count(xi(e)-1,e),t,2)}function Yu(e){var t=e.getUTCDay();return t>=4||t===0?Er(e):Er.ceil(e)}function C4(e,t){return e=Yu(e),Ce(Er.count(xi(e),e)+(xi(e).getUTCDay()===4),t,2)}function S4(e){return e.getUTCDay()}function _4(e,t){return Ce(Is.count(xi(e)-1,e),t,2)}function x4(e,t){return Ce(e.getUTCFullYear()%100,t,2)}function L4(e,t){return e=Yu(e),Ce(e.getUTCFullYear()%100,t,2)}function k4(e,t){return Ce(e.getUTCFullYear()%1e4,t,4)}function T4(e,t){var n=e.getUTCDay();return e=n>=4||n===0?Er(e):Er.ceil(e),Ce(e.getUTCFullYear()%1e4,t,4)}function M4(){return"+0000"}function j1(){return"%"}function X1(e){return+e}function q1(e){return Math.floor(+e/1e3)}var hr,Bu;A4({dateTime:"%x, %X",date:"%-m/%-d/%Y",time:"%-I:%M:%S %p",periods:["AM","PM"],days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],shortDays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],shortMonths:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]});function A4(e){return hr=A5(e),Bu=hr.format,hr.parse,hr.utcFormat,hr.utcParse,hr}function V4(e){for(var t=e.length/6|0,n=new Array(t),r=0;r1)&&(e-=Math.floor(e));var t=Math.abs(e-.5);return $i.h=360*e-100,$i.s=1.5-1.5*t,$i.l=.8-.9*t,$i+""}var zr=0,fi=0,ai=0,Uu=1e3,Es,di,zs=0,nr=0,ka=0,Li=typeof performance=="object"&&performance.now?performance:Date,Zu=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(e){setTimeout(e,17)};function Il(){return nr||(Zu(H4),nr=Li.now()+ka)}function H4(){nr=0}function Ws(){this._call=this._time=this._next=null}Ws.prototype=ju.prototype={constructor:Ws,restart:function(e,t,n){if(typeof e!="function")throw new TypeError("callback is not a function");n=(n==null?Il():+n)+(t==null?0:+t),!this._next&&di!==this&&(di?di._next=this:Es=this,di=this),this._call=e,this._time=n,yo()},stop:function(){this._call&&(this._call=null,this._time=1/0,yo())}};function ju(e,t,n){var r=new Ws;return r.restart(e,t,n),r}function F4(){Il(),++zr;for(var e=Es,t;e;)(t=nr-e._time)>=0&&e._call.call(void 0,t),e=e._next;--zr}function J1(){nr=(zs=Li.now())+ka,zr=fi=0;try{F4()}finally{zr=0,R4(),nr=0}}function P4(){var e=Li.now(),t=e-zs;t>Uu&&(ka-=t,zs=e)}function R4(){for(var e,t=Es,n,r=1/0;t;)t._call?(r>t._time&&(r=t._time),e=t,t=t._next):(n=t._next,t._next=null,t=e?e._next=n:Es=n);di=e,yo(r)}function yo(e){if(!zr){fi&&(fi=clearTimeout(fi));var t=e-nr;t>24?(e<1/0&&(fi=setTimeout(J1,e-Li.now()-ka)),ai&&(ai=clearInterval(ai))):(ai||(zs=Li.now(),ai=setInterval(P4,Uu)),zr=1,Zu(J1))}}function wo(e,t,n){var r=new Ws;return t=t==null?0:+t,r.restart(i=>{r.stop(),e(i+t)},t,n),r}var I4={value:()=>{}};function Gi(){for(var e=0,t=arguments.length,n={},r;e=0&&(r=n.slice(i+1),n=n.slice(0,i)),n&&!t.hasOwnProperty(n))throw new Error("unknown type: "+n);return{type:n,name:r}})}ps.prototype=Gi.prototype={constructor:ps,on:function(e,t){var n=this._,r=E4(e+"",n),i,s=-1,a=r.length;if(arguments.length<2){for(;++s0)for(var n=new Array(i),r=0,i,s;rXu)throw new Error("too late; already scheduled");return n}function Qt(e,t){var n=zt(e,t);if(n.state>gs)throw new Error("too late; already running");return n}function zt(e,t){var n=e.__transition;if(!n||!(n=n[t]))throw new Error("transition not found");return n}function G4(e,t,n){var r=e.__transition,i;r[t]=n,n.timer=ju(s,0,n.time);function s(l){n.state=K1,n.timer.restart(a,n.delay,n.time),n.delay<=l&&a(l-n.delay)}function a(l){var u,f,h,p;if(n.state!==K1)return c();for(u in r)if(p=r[u],p.name===n.name){if(p.state===gs)return wo(a);p.state===$1?(p.state=ms,p.timer.stop(),p.on.call("interrupt",e,e.__data__,p.index,p.group),delete r[u]):+uvo&&r.state=0&&(t=t.slice(0,n)),!t||t==="start"})}function vf(e,t,n){var r,i,s=wf(t)?El:Qt;return function(){var a=s(this,e),o=a.on;o!==r&&(i=(r=o).copy()).on(t,n),a.on=i}}function bf(e,t){var n=this._id;return arguments.length<2?zt(this.node(),n).on.on(e):this.each(vf(n,e,t))}function Cf(e){return function(){var t=this.parentNode;for(var n in this.__transition)if(+n!==e)return;t&&t.removeChild(this)}}function Sf(){return this.on("end.remove",Cf(this._id))}function _f(e){var t=this._name,n=this._id;typeof e!="function"&&(e=Cl(e));for(var r=this._groups,i=r.length,s=new Array(i),a=0;a+e;function Uf(e){return((e*=2)<=1?e*e:--e*(2-e)+1)/2}function $u(e){return((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2}var Wl=3;(function e(t){t=+t;function n(r){return Math.pow(r,t)}return n.exponent=e,n})(Wl);(function e(t){t=+t;function n(r){return 1-Math.pow(1-r,t)}return n.exponent=e,n})(Wl);var Zf=function e(t){t=+t;function n(r){return((r*=2)<=1?Math.pow(r,t):2-Math.pow(2-r,t))/2}return n.exponent=e,n}(Wl);function Os(e){return(Math.pow(2,-10*e)-.0009765625)*1.0009775171065494}var Wr=2*Math.PI,Ol=1,Gl=.3;(function e(t,n){var r=Math.asin(1/(t=Math.max(1,t)))*(n/=Wr);function i(s){return t*Os(- --s)*Math.sin((r-s)/n)}return i.amplitude=function(s){return e(s,n*Wr)},i.period=function(s){return e(t,s)},i})(Ol,Gl);var jf=function e(t,n){var r=Math.asin(1/(t=Math.max(1,t)))*(n/=Wr);function i(s){return 1-t*Os(s=+s)*Math.sin((s+r)/n)}return i.amplitude=function(s){return e(s,n*Wr)},i.period=function(s){return e(t,s)},i}(Ol,Gl);(function e(t,n){var r=Math.asin(1/(t=Math.max(1,t)))*(n/=Wr);function i(s){return((s=s*2-1)<0?t*Os(-s)*Math.sin((r-s)/n):2-t*Os(s)*Math.sin((r+s)/n))/2}return i.amplitude=function(s){return e(s,n*Wr)},i.period=function(s){return e(t,s)},i})(Ol,Gl);var Xf={time:null,delay:0,duration:250,ease:$u};function qf(e,t){for(var n;!(n=e.__transition)||!(n=n[t]);)if(!(e=e.parentNode))throw new Error(`transition ${t} not found`);return n}function Jf(e){var t,n;e instanceof hn?(t=e._id,e=e._name):(t=Ku(),(n=Xf).time=Il(),e=e==null?null:e+"");for(var r=this._groups,i=r.length,s=0;s+e(t)}function t8(e,t){return t=Math.max(0,e.bandwidth()-t*2)/2,e.round()&&(t=Math.round(t)),n=>+e(n)+t}function n8(){return!this.__axis}function e2(e,t){var n=[],r=null,i=null,s=6,a=6,o=3,c=typeof window<"u"&&window.devicePixelRatio>1?0:.5,l=e===Ua||e===pi?-1:1,u=e===pi||e===Za?"x":"y",f=e===Ua||e===Co?Kf:$f;function h(p){var g=r==null?t.ticks?t.ticks.apply(t,n):t.domain():r,d=i==null?t.tickFormat?t.tickFormat.apply(t,n):Qf:i,m=Math.max(s,0)+o,v=t.range(),S=+v[0]+c,b=+v[v.length-1]+c,_=(t.bandwidth?t8:e8)(t.copy(),c),k=p.selection?p.selection():p,H=k.selectAll(".domain").data([null]),I=k.selectAll(".tick").data(g,t).order(),M=I.exit(),V=I.enter().append("g").attr("class","tick"),E=I.select("line"),F=I.select("text");H=H.merge(H.enter().insert("path",".tick").attr("class","domain").attr("stroke","currentColor")),I=I.merge(V),E=E.merge(V.append("line").attr("stroke","currentColor").attr(u+"2",l*s)),F=F.merge(V.append("text").attr("fill","currentColor").attr(u,l*m).attr("dy",e===Ua?"0em":e===Co?"0.71em":"0.32em")),p!==k&&(H=H.transition(p),I=I.transition(p),E=E.transition(p),F=F.transition(p),M=M.transition(p).attr("opacity",ec).attr("transform",function(R){return isFinite(R=_(R))?f(R+c):this.getAttribute("transform")}),V.attr("opacity",ec).attr("transform",function(R){var A=this.parentNode.__axis;return f((A&&isFinite(A=A(R))?A:_(R))+c)})),M.remove(),H.attr("d",e===pi||e===Za?a?"M"+l*a+","+S+"H"+c+"V"+b+"H"+l*a:"M"+c+","+S+"V"+b:a?"M"+S+","+l*a+"V"+c+"H"+b+"V"+l*a:"M"+S+","+c+"H"+b),I.attr("opacity",1).attr("transform",function(R){return f(_(R)+c)}),E.attr(u+"2",l*s),F.attr(u,l*m).text(d),k.filter(n8).attr("fill","none").attr("font-size",10).attr("font-family","sans-serif").attr("text-anchor",e===Za?"start":e===pi?"end":"middle"),k.each(function(){this.__axis=_})}return h.scale=function(p){return arguments.length?(t=p,h):t},h.ticks=function(){return n=Array.from(arguments),h},h.tickArguments=function(p){return arguments.length?(n=p==null?[]:Array.from(p),h):n.slice()},h.tickValues=function(p){return arguments.length?(r=p==null?null:Array.from(p),h):r&&r.slice()},h.tickFormat=function(p){return arguments.length?(i=p,h):i},h.tickSize=function(p){return arguments.length?(s=a=+p,h):s},h.tickSizeInner=function(p){return arguments.length?(s=+p,h):s},h.tickSizeOuter=function(p){return arguments.length?(a=+p,h):a},h.tickPadding=function(p){return arguments.length?(o=+p,h):o},h.offset=function(p){return arguments.length?(c=+p,h):c},h}function r8(e){return e2(Co,e)}function i8(e){return e2(pi,e)}const So=Math.PI,_o=2*So,Xn=1e-6,s8=_o-Xn;function xo(){this._x0=this._y0=this._x1=this._y1=null,this._=""}function Yi(){return new xo}xo.prototype=Yi.prototype={constructor:xo,moveTo:function(e,t){this._+="M"+(this._x0=this._x1=+e)+","+(this._y0=this._y1=+t)},closePath:function(){this._x1!==null&&(this._x1=this._x0,this._y1=this._y0,this._+="Z")},lineTo:function(e,t){this._+="L"+(this._x1=+e)+","+(this._y1=+t)},quadraticCurveTo:function(e,t,n,r){this._+="Q"+ +e+","+ +t+","+(this._x1=+n)+","+(this._y1=+r)},bezierCurveTo:function(e,t,n,r,i,s){this._+="C"+ +e+","+ +t+","+ +n+","+ +r+","+(this._x1=+i)+","+(this._y1=+s)},arcTo:function(e,t,n,r,i){e=+e,t=+t,n=+n,r=+r,i=+i;var s=this._x1,a=this._y1,o=n-e,c=r-t,l=s-e,u=a-t,f=l*l+u*u;if(i<0)throw new Error("negative radius: "+i);if(this._x1===null)this._+="M"+(this._x1=e)+","+(this._y1=t);else if(f>Xn)if(!(Math.abs(u*o-c*l)>Xn)||!i)this._+="L"+(this._x1=e)+","+(this._y1=t);else{var h=n-s,p=r-a,g=o*o+c*c,d=h*h+p*p,m=Math.sqrt(g),v=Math.sqrt(f),S=i*Math.tan((So-Math.acos((g+f-d)/(2*m*v)))/2),b=S/v,_=S/m;Math.abs(b-1)>Xn&&(this._+="L"+(e+b*l)+","+(t+b*u)),this._+="A"+i+","+i+",0,0,"+ +(u*h>l*p)+","+(this._x1=e+_*o)+","+(this._y1=t+_*c)}},arc:function(e,t,n,r,i,s){e=+e,t=+t,n=+n,s=!!s;var a=n*Math.cos(r),o=n*Math.sin(r),c=e+a,l=t+o,u=1^s,f=s?r-i:i-r;if(n<0)throw new Error("negative radius: "+n);this._x1===null?this._+="M"+c+","+l:(Math.abs(this._x1-c)>Xn||Math.abs(this._y1-l)>Xn)&&(this._+="L"+c+","+l),n&&(f<0&&(f=f%_o+_o),f>s8?this._+="A"+n+","+n+",0,1,"+u+","+(e-a)+","+(t-o)+"A"+n+","+n+",0,1,"+u+","+(this._x1=c)+","+(this._y1=l):f>Xn&&(this._+="A"+n+","+n+",0,"+ +(f>=So)+","+u+","+(this._x1=e+n*Math.cos(i))+","+(this._y1=t+n*Math.sin(i))))},rect:function(e,t,n,r){this._+="M"+(this._x0=this._x1=+e)+","+(this._y0=this._y1=+t)+"h"+ +n+"v"+ +r+"h"+-n+"Z"},toString:function(){return this._}};function qe(e){return function(){return e}}const tc=Math.abs,Ze=Math.atan2,jn=Math.cos,a8=Math.max,ja=Math.min,Ut=Math.sin,vr=Math.sqrt,ht=1e-12,ki=Math.PI,Gs=ki/2,o8=2*ki;function l8(e){return e>1?0:e<-1?ki:Math.acos(e)}function nc(e){return e>=1?Gs:e<=-1?-Gs:Math.asin(e)}function c8(e){return e.innerRadius}function u8(e){return e.outerRadius}function h8(e){return e.startAngle}function f8(e){return e.endAngle}function d8(e){return e&&e.padAngle}function p8(e,t,n,r,i,s,a,o){var c=n-e,l=r-t,u=a-i,f=o-s,h=f*c-u*l;if(!(h*hC*C+T*T&&(M=E,V=F),{cx:M,cy:V,x01:-u,y01:-f,x11:M*(i/k-1),y11:V*(i/k-1)}}function g8(){var e=c8,t=u8,n=qe(0),r=null,i=h8,s=f8,a=d8,o=null;function c(){var l,u,f=+e.apply(this,arguments),h=+t.apply(this,arguments),p=i.apply(this,arguments)-Gs,g=s.apply(this,arguments)-Gs,d=tc(g-p),m=g>p;if(o||(o=l=Yi()),hht))o.moveTo(0,0);else if(d>o8-ht)o.moveTo(h*jn(p),h*Ut(p)),o.arc(0,0,h,p,g,!m),f>ht&&(o.moveTo(f*jn(g),f*Ut(g)),o.arc(0,0,f,g,p,m));else{var v=p,S=g,b=p,_=g,k=d,H=d,I=a.apply(this,arguments)/2,M=I>ht&&(r?+r.apply(this,arguments):vr(f*f+h*h)),V=ja(tc(h-f)/2,+n.apply(this,arguments)),E=V,F=V,R,A;if(M>ht){var C=nc(M/f*Ut(I)),T=nc(M/h*Ut(I));(k-=C*2)>ht?(C*=m?1:-1,b+=C,_-=C):(k=0,b=_=(p+g)/2),(H-=T*2)>ht?(T*=m?1:-1,v+=T,S-=T):(H=0,v=S=(p+g)/2)}var D=h*jn(v),P=h*Ut(v),G=f*jn(_),Y=f*Ut(_);if(V>ht){var U=h*jn(S),X=h*Ut(S),J=f*jn(b),me=f*Ut(b),K;if(dht?F>ht?(R=es(J,me,D,P,h,F,m),A=es(U,X,G,Y,h,F,m),o.moveTo(R.cx+R.x01,R.cy+R.y01),Fht)||!(k>ht)?o.lineTo(G,Y):E>ht?(R=es(G,Y,U,X,f,-E,m),A=es(D,P,J,me,f,-E,m),o.lineTo(R.cx+R.x01,R.cy+R.y01),E=0&&(this._t=1-this._t,this._line=1-this._line)},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;default:{if(this._t<=0)this._context.lineTo(this._x,t),this._context.lineTo(e,t);else{var n=this._x*(1-this._t)+e*this._t;this._context.lineTo(n,this._y),this._context.lineTo(n,t)}break}}this._x=e,this._y=t}};function A8(e){return new c2(e,1)}function V8(e){var t=0,n=e.children,r=n&&n.length;if(!r)t=1;else for(;--r>=0;)t+=n[r].value;e.value=t}function D8(){return this.eachAfter(V8)}function N8(e,t){let n=-1;for(const r of this)e.call(t,r,++n,this);return this}function H8(e,t){for(var n=this,r=[n],i,s,a=-1;n=r.pop();)if(e.call(t,n,++a,this),i=n.children)for(s=i.length-1;s>=0;--s)r.push(i[s]);return this}function F8(e,t){for(var n=this,r=[n],i=[],s,a,o,c=-1;n=r.pop();)if(i.push(n),s=n.children)for(a=0,o=s.length;a=0;)n+=r[i].value;t.value=n})}function I8(e){return this.eachBefore(function(t){t.children&&t.children.sort(e)})}function E8(e){for(var t=this,n=z8(t,e),r=[t];t!==n;)t=t.parent,r.push(t);for(var i=r.length;e!==n;)r.splice(i,0,e),e=e.parent;return r}function z8(e,t){if(e===t)return e;var n=e.ancestors(),r=t.ancestors(),i=null;for(e=n.pop(),t=r.pop();e===t;)i=e,e=n.pop(),t=r.pop();return i}function W8(){for(var e=this,t=[e];e=e.parent;)t.push(e);return t}function O8(){return Array.from(this)}function G8(){var e=[];return this.eachBefore(function(t){t.children||e.push(t)}),e}function Y8(){var e=this,t=[];return e.each(function(n){n!==e&&t.push({source:n.parent,target:n})}),t}function*B8(){var e=this,t,n=[e],r,i,s;do for(t=n.reverse(),n=[];e=t.pop();)if(yield e,r=e.children)for(i=0,s=r.length;i=0;--o)i.push(s=a[o]=new Ti(a[o])),s.parent=r,s.depth=r.depth+1;return n.eachBefore(q8)}function U8(){return Yl(this).eachBefore(X8)}function Z8(e){return e.children}function j8(e){return Array.isArray(e)?e[1]:null}function X8(e){e.data.value!==void 0&&(e.value=e.data.value),e.data=e.data.data}function q8(e){var t=0;do e.height=t;while((e=e.parent)&&e.height<++t)}function Ti(e){this.data=e,this.depth=this.height=0,this.parent=null}Ti.prototype=Yl.prototype={constructor:Ti,count:D8,each:N8,eachAfter:F8,eachBefore:H8,find:P8,sum:R8,sort:I8,path:E8,ancestors:W8,descendants:O8,leaves:G8,links:Y8,copy:U8,[Symbol.iterator]:B8};function J8(e){e.x0=Math.round(e.x0),e.y0=Math.round(e.y0),e.x1=Math.round(e.x1),e.y1=Math.round(e.y1)}function Q8(e,t,n,r,i){for(var s=e.children,a,o=-1,c=s.length,l=e.value&&(r-t)/e.value;++o=0;)s=r[i],s.z+=t,s.m+=t,t+=s.s+(n+=s.c)}function n7(e,t,n){return e.a.parent===t.parent?e.a:n}function ys(e,t){this._=e,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=t}ys.prototype=Object.create(Ti.prototype);function r7(e){for(var t=new ys(e,0),n,r=[t],i,s,a,o;n=r.pop();)if(s=n._.children)for(n.children=new Array(o=s.length),a=o-1;a>=0;--a)r.push(i=n.children[a]=new ys(s[a],a)),i.parent=n;return(t.parent=new ys(null,0)).children=[t],t}function i7(){var e=$8,t=1,n=1,r=null;function i(l){var u=r7(l);if(u.eachAfter(s),u.parent.m=-u.z,u.eachBefore(a),r)l.eachBefore(c);else{var f=l,h=l,p=l;l.eachBefore(function(S){S.xh.x&&(h=S),S.depth>p.depth&&(p=S)});var g=f===h?1:e(f,h)/2,d=g-f.x,m=t/(h.x+g+d),v=n/(p.depth||1);l.eachBefore(function(S){S.x=(S.x+d)*m,S.y=S.depth*v})}return l}function s(l){var u=l.children,f=l.parent.children,h=l.i?f[l.i-1]:null;if(u){t7(l);var p=(u[0].z+u[u.length-1].z)/2;h?(l.z=h.z+e(l._,h._),l.m=l.z-p):l.z=p}else h&&(l.z=h.z+e(l._,h._));l.parent.A=o(l,h,l.parent.A||f[0])}function a(l){l._.x=l.z+l.parent.m,l.m+=l.parent.m}function o(l,u,f){if(u){for(var h=l,p=l,g=u,d=h.parent.children[0],m=h.m,v=p.m,S=g.m,b=d.m,_;g=Ja(g),h=qa(h),g&&h;)d=qa(d),p=Ja(p),p.a=l,_=g.z+S-h.z-m+e(g._,h._),_>0&&(e7(n7(g,l,f),l,_),m+=_,v+=_),S+=g.m,m+=h.m,b+=d.m,v+=p.m;g&&!Ja(p)&&(p.t=g,p.m+=S-v),h&&!qa(d)&&(d.t=h,d.m+=m-b,f=l)}return f}function c(l){l.x*=t,l.y=l.depth*n}return i.separation=function(l){return arguments.length?(e=l,i):e},i.size=function(l){return arguments.length?(r=!1,t=+l[0],n=+l[1],i):r?null:[t,n]},i.nodeSize=function(l){return arguments.length?(r=!0,t=+l[0],n=+l[1],i):r?[t,n]:null},i}const s7={passive:!1},Mi={capture:!0,passive:!1};function Qa(e){e.stopImmediatePropagation()}function Lr(e){e.preventDefault(),e.stopImmediatePropagation()}function Bl(e){var t=e.document.documentElement,n=$e(e).on("dragstart.drag",Lr,Mi);"onselectstart"in t?n.on("selectstart.drag",Lr,Mi):(t.__noselect=t.style.MozUserSelect,t.style.MozUserSelect="none")}function Ul(e,t){var n=e.document.documentElement,r=$e(e).on("dragstart.drag",null);t&&(r.on("click.drag",Lr,Mi),setTimeout(function(){r.on("click.drag",null)},0)),"onselectstart"in n?r.on("selectstart.drag",null):(n.style.MozUserSelect=n.__noselect,delete n.__noselect)}const ts=e=>()=>e;function Lo(e,{sourceEvent:t,subject:n,target:r,identifier:i,active:s,x:a,y:o,dx:c,dy:l,dispatch:u}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:t,enumerable:!0,configurable:!0},subject:{value:n,enumerable:!0,configurable:!0},target:{value:r,enumerable:!0,configurable:!0},identifier:{value:i,enumerable:!0,configurable:!0},active:{value:s,enumerable:!0,configurable:!0},x:{value:a,enumerable:!0,configurable:!0},y:{value:o,enumerable:!0,configurable:!0},dx:{value:c,enumerable:!0,configurable:!0},dy:{value:l,enumerable:!0,configurable:!0},_:{value:u}})}Lo.prototype.on=function(){var e=this._.on.apply(this._,arguments);return e===this._?this:e};function a7(e){return!e.ctrlKey&&!e.button}function o7(){return this.parentNode}function l7(e,t){return t==null?{x:e.x,y:e.y}:t}function c7(){return navigator.maxTouchPoints||"ontouchstart"in this}function u7(){var e=a7,t=o7,n=l7,r=c7,i={},s=Gi("start","drag","end"),a=0,o,c,l,u,f=0;function h(_){_.on("mousedown.drag",p).filter(r).on("touchstart.drag",m).on("touchmove.drag",v,s7).on("touchend.drag touchcancel.drag",S).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function p(_,k){if(!(u||!e.call(this,_,k))){var H=b(this,t.call(this,_,k),_,k,"mouse");!H||($e(_.view).on("mousemove.drag",g,Mi).on("mouseup.drag",d,Mi),Bl(_.view),Qa(_),l=!1,o=_.clientX,c=_.clientY,H("start",_))}}function g(_){if(Lr(_),!l){var k=_.clientX-o,H=_.clientY-c;l=k*k+H*H>f}i.mouse("drag",_)}function d(_){$e(_.view).on("mousemove.drag mouseup.drag",null),Ul(_.view,l),Lr(_),i.mouse("end",_)}function m(_,k){if(!!e.call(this,_,k)){var H=_.changedTouches,I=t.call(this,_,k),M=H.length,V,E;for(V=0;V()=>e;function h7(e,{sourceEvent:t,target:n,selection:r,mode:i,dispatch:s}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:t,enumerable:!0,configurable:!0},target:{value:n,enumerable:!0,configurable:!0},selection:{value:r,enumerable:!0,configurable:!0},mode:{value:i,enumerable:!0,configurable:!0},_:{value:s}})}function f7(e){e.stopImmediatePropagation()}function $a(e){e.preventDefault(),e.stopImmediatePropagation()}var oc={name:"drag"},eo={name:"space"},fr={name:"handle"},dr={name:"center"};const{abs:lc,max:je,min:Xe}=Math;function cc(e){return[+e[0],+e[1]]}function ko(e){return[cc(e[0]),cc(e[1])]}var to={name:"x",handles:["w","e"].map(Ai),input:function(e,t){return e==null?null:[[+e[0],t[0][1]],[+e[1],t[1][1]]]},output:function(e){return e&&[e[0][0],e[1][0]]}},no={name:"y",handles:["n","s"].map(Ai),input:function(e,t){return e==null?null:[[t[0][0],+e[0]],[t[1][0],+e[1]]]},output:function(e){return e&&[e[0][1],e[1][1]]}},d7={name:"xy",handles:["n","w","e","s","nw","ne","sw","se"].map(Ai),input:function(e){return e==null?null:ko(e)},output:function(e){return e}},an={overlay:"crosshair",selection:"move",n:"ns-resize",e:"ew-resize",s:"ns-resize",w:"ew-resize",nw:"nwse-resize",ne:"nesw-resize",se:"nwse-resize",sw:"nesw-resize"},uc={e:"w",w:"e",nw:"ne",ne:"nw",se:"sw",sw:"se"},hc={n:"s",s:"n",nw:"sw",ne:"se",se:"ne",sw:"nw"},p7={overlay:1,selection:1,n:null,e:1,s:null,w:-1,nw:-1,ne:1,se:1,sw:-1},g7={overlay:1,selection:1,n:-1,e:null,s:1,w:null,nw:-1,ne:-1,se:1,sw:1};function Ai(e){return{type:e}}function m7(e){return!e.ctrlKey&&!e.button}function y7(){var e=this.ownerSVGElement||this;return e.hasAttribute("viewBox")?(e=e.viewBox.baseVal,[[e.x,e.y],[e.x+e.width,e.y+e.height]]):[[0,0],[e.width.baseVal.value,e.height.baseVal.value]]}function w7(){return navigator.maxTouchPoints||"ontouchstart"in this}function ro(e){for(;!e.__brush;)if(!(e=e.parentNode))return;return e.__brush}function v7(e){return e[0][0]===e[1][0]||e[0][1]===e[1][1]}function b7(){return C7(d7)}function C7(e){var t=y7,n=m7,r=w7,i=!0,s=Gi("start","brush","end"),a=6,o;function c(m){var v=m.property("__brush",d).selectAll(".overlay").data([Ai("overlay")]);v.enter().append("rect").attr("class","overlay").attr("pointer-events","all").attr("cursor",an.overlay).merge(v).each(function(){var b=ro(this).extent;$e(this).attr("x",b[0][0]).attr("y",b[0][1]).attr("width",b[1][0]-b[0][0]).attr("height",b[1][1]-b[0][1])}),m.selectAll(".selection").data([Ai("selection")]).enter().append("rect").attr("class","selection").attr("cursor",an.selection).attr("fill","#777").attr("fill-opacity",.3).attr("stroke","#fff").attr("shape-rendering","crispEdges");var S=m.selectAll(".handle").data(e.handles,function(b){return b.type});S.exit().remove(),S.enter().append("rect").attr("class",function(b){return"handle handle--"+b.type}).attr("cursor",function(b){return an[b.type]}),m.each(l).attr("fill","none").attr("pointer-events","all").on("mousedown.brush",h).filter(r).on("touchstart.brush",h).on("touchmove.brush",p).on("touchend.brush touchcancel.brush",g).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}c.move=function(m,v,S){m.tween?m.on("start.brush",function(b){u(this,arguments).beforestart().start(b)}).on("interrupt.brush end.brush",function(b){u(this,arguments).end(b)}).tween("brush",function(){var b=this,_=b.__brush,k=u(b,arguments),H=_.selection,I=e.input(typeof v=="function"?v.apply(this,arguments):v,_.extent),M=Oi(H,I);function V(E){_.selection=E===1&&I===null?null:M(E),l.call(b),k.brush()}return H!==null&&I!==null?V:V(1)}):m.each(function(){var b=this,_=arguments,k=b.__brush,H=e.input(typeof v=="function"?v.apply(b,_):v,k.extent),I=u(b,_).beforestart();xr(b),k.selection=H===null?null:H,l.call(b),I.start(S).brush(S).end(S)})},c.clear=function(m,v){c.move(m,null,v)};function l(){var m=$e(this),v=ro(this).selection;v?(m.selectAll(".selection").style("display",null).attr("x",v[0][0]).attr("y",v[0][1]).attr("width",v[1][0]-v[0][0]).attr("height",v[1][1]-v[0][1]),m.selectAll(".handle").style("display",null).attr("x",function(S){return S.type[S.type.length-1]==="e"?v[1][0]-a/2:v[0][0]-a/2}).attr("y",function(S){return S.type[0]==="s"?v[1][1]-a/2:v[0][1]-a/2}).attr("width",function(S){return S.type==="n"||S.type==="s"?v[1][0]-v[0][0]+a:a}).attr("height",function(S){return S.type==="e"||S.type==="w"?v[1][1]-v[0][1]+a:a})):m.selectAll(".selection,.handle").style("display","none").attr("x",null).attr("y",null).attr("width",null).attr("height",null)}function u(m,v,S){var b=m.__brush.emitter;return b&&(!S||!b.clean)?b:new f(m,v,S)}function f(m,v,S){this.that=m,this.args=v,this.state=m.__brush,this.active=0,this.clean=S}f.prototype={beforestart:function(){return++this.active===1&&(this.state.emitter=this,this.starting=!0),this},start:function(m,v){return this.starting?(this.starting=!1,this.emit("start",m,v)):this.emit("brush",m),this},brush:function(m,v){return this.emit("brush",m,v),this},end:function(m,v){return--this.active===0&&(delete this.state.emitter,this.emit("end",m,v)),this},emit:function(m,v,S){var b=$e(this.that).datum();s.call(m,this.that,new h7(m,{sourceEvent:v,target:c,selection:e.output(this.state.selection),mode:S,dispatch:s}),b)}};function h(m){if(o&&!m.touches||!n.apply(this,arguments))return;var v=this,S=m.target.__data__.type,b=(i&&m.metaKey?S="overlay":S)==="selection"?oc:i&&m.altKey?dr:fr,_=e===no?null:p7[S],k=e===to?null:g7[S],H=ro(v),I=H.extent,M=H.selection,V=I[0][0],E,F,R=I[0][1],A,C,T=I[1][0],D,P,G=I[1][1],Y,U,X=0,J=0,me,K=_&&k&&i&&m.shiftKey,Q,B,ie=Array.from(m.touches||[m],Z=>{const ue=Z.identifier;return Z=Pt(Z,v),Z.point0=Z.slice(),Z.identifier=ue,Z});xr(v);var fe=u(v,arguments,!0).beforestart();if(S==="overlay"){M&&(me=!0);const Z=[ie[0],ie[1]||ie[0]];H.selection=M=[[E=e===no?V:Xe(Z[0][0],Z[1][0]),A=e===to?R:Xe(Z[0][1],Z[1][1])],[D=e===no?T:je(Z[0][0],Z[1][0]),Y=e===to?G:je(Z[0][1],Z[1][1])]],ie.length>1&&we(m)}else E=M[0][0],A=M[0][1],D=M[1][0],Y=M[1][1];F=E,C=A,P=D,U=Y;var j=$e(v).attr("pointer-events","none"),$=j.selectAll(".overlay").attr("cursor",an[S]);if(m.touches)fe.moved=O,fe.ended=de;else{var oe=$e(m.view).on("mousemove.brush",O,!0).on("mouseup.brush",de,!0);i&&oe.on("keydown.brush",xe,!0).on("keyup.brush",Le,!0),Bl(m.view)}l.call(v),fe.start(m,b.name);function O(Z){for(const ue of Z.changedTouches||[Z])for(const He of ie)He.identifier===ue.identifier&&(He.cur=Pt(ue,v));if(K&&!Q&&!B&&ie.length===1){const ue=ie[0];lc(ue.cur[0]-ue[0])>lc(ue.cur[1]-ue[1])?B=!0:Q=!0}for(const ue of ie)ue.cur&&(ue[0]=ue.cur[0],ue[1]=ue.cur[1]);me=!0,$a(Z),we(Z)}function we(Z){const ue=ie[0],He=ue.point0;var ke;switch(X=ue[0]-He[0],J=ue[1]-He[1],b){case eo:case oc:{_&&(X=je(V-E,Xe(T-D,X)),F=E+X,P=D+X),k&&(J=je(R-A,Xe(G-Y,J)),C=A+J,U=Y+J);break}case fr:{ie[1]?(_&&(F=je(V,Xe(T,ie[0][0])),P=je(V,Xe(T,ie[1][0])),_=1),k&&(C=je(R,Xe(G,ie[0][1])),U=je(R,Xe(G,ie[1][1])),k=1)):(_<0?(X=je(V-E,Xe(T-E,X)),F=E+X,P=D):_>0&&(X=je(V-D,Xe(T-D,X)),F=E,P=D+X),k<0?(J=je(R-A,Xe(G-A,J)),C=A+J,U=Y):k>0&&(J=je(R-Y,Xe(G-Y,J)),C=A,U=Y+J));break}case dr:{_&&(F=je(V,Xe(T,E-X*_)),P=je(V,Xe(T,D+X*_))),k&&(C=je(R,Xe(G,A-J*k)),U=je(R,Xe(G,Y+J*k)));break}}P0&&(E=F-X),k<0?Y=U-J:k>0&&(A=C-J),b=eo,$.attr("cursor",an.selection),we(Z));break}default:return}$a(Z)}function Le(Z){switch(Z.keyCode){case 16:{K&&(Q=B=K=!1,we(Z));break}case 18:{b===dr&&(_<0?D=P:_>0&&(E=F),k<0?Y=U:k>0&&(A=C),b=fr,we(Z));break}case 32:{b===eo&&(Z.altKey?(_&&(D=P-X*_,E=F+X*_),k&&(Y=U-J*k,A=C+J*k),b=dr):(_<0?D=P:_>0&&(E=F),k<0?Y=U:k>0&&(A=C),b=fr),$.attr("cursor",an[S]),we(Z));break}default:return}$a(Z)}}function p(m){u(this,arguments).moved(m)}function g(m){u(this,arguments).ended(m)}function d(){var m=this.__brush||{selection:null};return m.extent=ko(t.apply(this,arguments)),m.dim=e,m}return c.extent=function(m){return arguments.length?(t=typeof m=="function"?m:Ka(ko(m)),c):t},c.filter=function(m){return arguments.length?(n=typeof m=="function"?m:Ka(!!m),c):n},c.touchable=function(m){return arguments.length?(r=typeof m=="function"?m:Ka(!!m),c):r},c.handleSize=function(m){return arguments.length?(a=+m,c):a},c.keyModifiers=function(m){return arguments.length?(i=!!m,c):i},c.on=function(){var m=s.on.apply(s,arguments);return m===s?c:m},c}const ns=e=>()=>e;function S7(e,{sourceEvent:t,target:n,transform:r,dispatch:i}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:t,enumerable:!0,configurable:!0},target:{value:n,enumerable:!0,configurable:!0},transform:{value:r,enumerable:!0,configurable:!0},_:{value:i}})}function un(e,t,n){this.k=e,this.x=t,this.y=n}un.prototype={constructor:un,scale:function(e){return e===1?this:new un(this.k*e,this.x,this.y)},translate:function(e,t){return e===0&t===0?this:new un(this.k,this.x+this.k*e,this.y+this.k*t)},apply:function(e){return[e[0]*this.k+this.x,e[1]*this.k+this.y]},applyX:function(e){return e*this.k+this.x},applyY:function(e){return e*this.k+this.y},invert:function(e){return[(e[0]-this.x)/this.k,(e[1]-this.y)/this.k]},invertX:function(e){return(e-this.x)/this.k},invertY:function(e){return(e-this.y)/this.k},rescaleX:function(e){return e.copy().domain(e.range().map(this.invertX,this).map(e.invert,e))},rescaleY:function(e){return e.copy().domain(e.range().map(this.invertY,this).map(e.invert,e))},toString:function(){return"translate("+this.x+","+this.y+") scale("+this.k+")"}};var Zl=new un(1,0,0);un.prototype;function io(e){e.stopImmediatePropagation()}function oi(e){e.preventDefault(),e.stopImmediatePropagation()}function _7(e){return(!e.ctrlKey||e.type==="wheel")&&!e.button}function x7(){var e=this;return e instanceof SVGElement?(e=e.ownerSVGElement||e,e.hasAttribute("viewBox")?(e=e.viewBox.baseVal,[[e.x,e.y],[e.x+e.width,e.y+e.height]]):[[0,0],[e.width.baseVal.value,e.height.baseVal.value]]):[[0,0],[e.clientWidth,e.clientHeight]]}function fc(){return this.__zoom||Zl}function L7(e){return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*(e.ctrlKey?10:1)}function k7(){return navigator.maxTouchPoints||"ontouchstart"in this}function T7(e,t,n){var r=e.invertX(t[0][0])-n[0][0],i=e.invertX(t[1][0])-n[1][0],s=e.invertY(t[0][1])-n[0][1],a=e.invertY(t[1][1])-n[1][1];return e.translate(i>r?(r+i)/2:Math.min(0,r)||Math.max(0,i),a>s?(s+a)/2:Math.min(0,s)||Math.max(0,a))}function M7(){var e=_7,t=x7,n=T7,r=L7,i=k7,s=[0,1/0],a=[[-1/0,-1/0],[1/0,1/0]],o=250,c=G6,l=Gi("start","zoom","end"),u,f,h,p=500,g=150,d=0,m=10;function v(C){C.property("__zoom",fc).on("wheel.zoom",M,{passive:!1}).on("mousedown.zoom",V).on("dblclick.zoom",E).filter(i).on("touchstart.zoom",F).on("touchmove.zoom",R).on("touchend.zoom touchcancel.zoom",A).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}v.transform=function(C,T,D,P){var G=C.selection?C.selection():C;G.property("__zoom",fc),C!==G?k(C,T,D,P):G.interrupt().each(function(){H(this,arguments).event(P).start().zoom(null,typeof T=="function"?T.apply(this,arguments):T).end()})},v.scaleBy=function(C,T,D,P){v.scaleTo(C,function(){var G=this.__zoom.k,Y=typeof T=="function"?T.apply(this,arguments):T;return G*Y},D,P)},v.scaleTo=function(C,T,D,P){v.transform(C,function(){var G=t.apply(this,arguments),Y=this.__zoom,U=D==null?_(G):typeof D=="function"?D.apply(this,arguments):D,X=Y.invert(U),J=typeof T=="function"?T.apply(this,arguments):T;return n(b(S(Y,J),U,X),G,a)},D,P)},v.translateBy=function(C,T,D,P){v.transform(C,function(){return n(this.__zoom.translate(typeof T=="function"?T.apply(this,arguments):T,typeof D=="function"?D.apply(this,arguments):D),t.apply(this,arguments),a)},null,P)},v.translateTo=function(C,T,D,P,G){v.transform(C,function(){var Y=t.apply(this,arguments),U=this.__zoom,X=P==null?_(Y):typeof P=="function"?P.apply(this,arguments):P;return n(Zl.translate(X[0],X[1]).scale(U.k).translate(typeof T=="function"?-T.apply(this,arguments):-T,typeof D=="function"?-D.apply(this,arguments):-D),Y,a)},P,G)};function S(C,T){return T=Math.max(s[0],Math.min(s[1],T)),T===C.k?C:new un(T,C.x,C.y)}function b(C,T,D){var P=T[0]-D[0]*C.k,G=T[1]-D[1]*C.k;return P===C.x&&G===C.y?C:new un(C.k,P,G)}function _(C){return[(+C[0][0]+ +C[1][0])/2,(+C[0][1]+ +C[1][1])/2]}function k(C,T,D,P){C.on("start.zoom",function(){H(this,arguments).event(P).start()}).on("interrupt.zoom end.zoom",function(){H(this,arguments).event(P).end()}).tween("zoom",function(){var G=this,Y=arguments,U=H(G,Y).event(P),X=t.apply(G,Y),J=D==null?_(X):typeof D=="function"?D.apply(G,Y):D,me=Math.max(X[1][0]-X[0][0],X[1][1]-X[0][1]),K=G.__zoom,Q=typeof T=="function"?T.apply(G,Y):T,B=c(K.invert(J).concat(me/K.k),Q.invert(J).concat(me/Q.k));return function(ie){if(ie===1)ie=Q;else{var fe=B(ie),j=me/fe[2];ie=new un(j,J[0]-fe[0]*j,J[1]-fe[1]*j)}U.zoom(null,ie)}})}function H(C,T,D){return!D&&C.__zooming||new I(C,T)}function I(C,T){this.that=C,this.args=T,this.active=0,this.sourceEvent=null,this.extent=t.apply(C,T),this.taps=0}I.prototype={event:function(C){return C&&(this.sourceEvent=C),this},start:function(){return++this.active===1&&(this.that.__zooming=this,this.emit("start")),this},zoom:function(C,T){return this.mouse&&C!=="mouse"&&(this.mouse[1]=T.invert(this.mouse[0])),this.touch0&&C!=="touch"&&(this.touch0[1]=T.invert(this.touch0[0])),this.touch1&&C!=="touch"&&(this.touch1[1]=T.invert(this.touch1[0])),this.that.__zoom=T,this.emit("zoom"),this},end:function(){return--this.active===0&&(delete this.that.__zooming,this.emit("end")),this},emit:function(C){var T=$e(this.that).datum();l.call(C,this.that,new S7(C,{sourceEvent:this.sourceEvent,target:v,type:C,transform:this.that.__zoom,dispatch:l}),T)}};function M(C,...T){if(!e.apply(this,arguments))return;var D=H(this,T).event(C),P=this.__zoom,G=Math.max(s[0],Math.min(s[1],P.k*Math.pow(2,r.apply(this,arguments)))),Y=Pt(C);if(D.wheel)(D.mouse[0][0]!==Y[0]||D.mouse[0][1]!==Y[1])&&(D.mouse[1]=P.invert(D.mouse[0]=Y)),clearTimeout(D.wheel);else{if(P.k===G)return;D.mouse=[Y,P.invert(Y)],xr(this),D.start()}oi(C),D.wheel=setTimeout(U,g),D.zoom("mouse",n(b(S(P,G),D.mouse[0],D.mouse[1]),D.extent,a));function U(){D.wheel=null,D.end()}}function V(C,...T){if(h||!e.apply(this,arguments))return;var D=C.currentTarget,P=H(this,T,!0).event(C),G=$e(C.view).on("mousemove.zoom",J,!0).on("mouseup.zoom",me,!0),Y=Pt(C,D),U=C.clientX,X=C.clientY;Bl(C.view),io(C),P.mouse=[Y,this.__zoom.invert(Y)],xr(this),P.start();function J(K){if(oi(K),!P.moved){var Q=K.clientX-U,B=K.clientY-X;P.moved=Q*Q+B*B>d}P.event(K).zoom("mouse",n(b(P.that.__zoom,P.mouse[0]=Pt(K,D),P.mouse[1]),P.extent,a))}function me(K){G.on("mousemove.zoom mouseup.zoom",null),Ul(K.view,P.moved),oi(K),P.event(K).end()}}function E(C,...T){if(!!e.apply(this,arguments)){var D=this.__zoom,P=Pt(C.changedTouches?C.changedTouches[0]:C,this),G=D.invert(P),Y=D.k*(C.shiftKey?.5:2),U=n(b(S(D,Y),P,G),t.apply(this,T),a);oi(C),o>0?$e(this).transition().duration(o).call(k,U,P,C):$e(this).call(v.transform,U,P,C)}}function F(C,...T){if(!!e.apply(this,arguments)){var D=C.touches,P=D.length,G=H(this,T,C.changedTouches.length===P).event(C),Y,U,X,J;for(io(C),U=0;UMath.round((e+Number.EPSILON)*10**t)/10**t,A7=(e,t=null,n="download.json")=>{const r="data:text/json;charset=utf-8,"+encodeURIComponent(JSON.stringify(e));let i=t,s=!1;t===null&&(i=document.createElement("a"),i.style.display="none",s=!0),i==null||i.setAttribute("href",r),i==null||i.setAttribute("download",`${n}`),i==null||i.click(),s&&(i==null||i.remove())},dc=e=>{const t=e[0],n=e[1],r=e[2],i=[t,n,r].map(s=>(s/=255,s<=.03928?s/12.92:Math.pow((s+.055)/1.055,2.4)));return i[0]*.2126+i[1]*.7152+i[2]*.0722},Gr=(e,t)=>{const n=dc(e),r=dc(t);return n>r?(r+.05)/(n+.05):(n+.05)/(r+.05)},pc=(e,t)=>e.size===t.size&&[...e].every(n=>t.has(n));class gc{constructor(t,n,r,i){N(this,"favoritesStore");N(this,"favoritesStoreValue");N(this,"searchStore");N(this,"searchStoreValue");N(this,"sunburstStore");N(this,"sunburstStoreValue");N(this,"handlerUpdated");N(this,"favoritesClicked",()=>{this.favoritesStoreValue.shown=!this.favoritesStoreValue.shown,this.favoritesStore.set(this.favoritesStoreValue),this.favoritesStoreValue.shown&&this.searchStoreValue.shown&&(this.searchStoreValue.shown=!1,this.searchStore.set(this.searchStoreValue))});N(this,"searchClicked",()=>{this.searchStoreValue.shown=!this.searchStoreValue.shown,this.searchStore.set(this.searchStoreValue),this.searchStoreValue.shown&&this.favoritesStoreValue.shown&&(this.favoritesStoreValue.shown=!1,this.favoritesStore.set(this.favoritesStoreValue))});N(this,"depthBoxClicked",t=>{tthis.sunburstStoreValue.depthHigh?(this.sunburstStoreValue.depthHigh=t,this.sunburstStoreValue.action=Qn.DepthChanged,this.sunburstStore.set(this.sunburstStoreValue)):this.sunburstStoreValue.depthLow{const n=this.sunburstStoreValue.depthColors[t-1];let r="inherit";if(n===null||n==="")return"";{const i=[252,252,252],s=[74,74,74],a=z.color(n).rgb(),o=[a.r,a.g,a.b];Gr(i,o){this.favoritesStoreValue=s,this.handlerUpdated()}),this.sunburstStore=r,this.sunburstStoreValue=bl(),this.sunburstStore.subscribe(s=>{this.sunburstStoreValue=s,this.handlerUpdated()}),this.searchStore=i,this.searchStoreValue=Hr(),this.searchStore.subscribe(s=>{this.searchStoreValue=s,this.handlerUpdated()})}}const f2='',d2='',p2=` + `});this.handlerUpdated=t,this.favoritesStore=n,this.favoritesStoreValue=Dr(),this.favoritesStore.subscribe(s=>{this.favoritesStoreValue=s,this.handlerUpdated()}),this.sunburstStore=r,this.sunburstStoreValue=vl(),this.sunburstStore.subscribe(s=>{this.sunburstStoreValue=s,this.handlerUpdated()}),this.searchStore=i,this.searchStoreValue=Nr(),this.searchStore.subscribe(s=>{this.searchStoreValue=s,this.handlerUpdated()})}}const u2='',h2='',f2=` -`;const Ke="src/components/toolbar/Toolbar.svelte";function yc(e,t,n){const r=e.slice();return r[13]=t[n],r}function wc(e,t,n){const r=e.slice();return r[13]=t[n],r}function Mo(e){let t;const n={c:function(){var i,s;t=L("div"),w(t,"class","depth-line s-JBVBfphpN2RX"),ge(t,"in-range",e[13]+2<=((i=e[2])==null?void 0:i.sunburstStoreValue.depthHigh)&&e[13]+2>((s=e[2])==null?void 0:s.sunburstStoreValue.depthLow)),x(t,Ke,223,10,5195)},m:function(i,s){ae(i,t,s)},p:function(i,s){var a,o;s&4&&ge(t,"in-range",i[13]+2<=((a=i[2])==null?void 0:a.sunburstStoreValue.depthHigh)&&i[13]+2>((o=i[2])==null?void 0:o.sunburstStoreValue.depthLow))},d:function(i){i&&ee(t)}};return te("SvelteRegisterBlock",{block:n,id:Mo.name,type:"each",source:"(223:8) {#each [...Array(Math.max(handler?.sunburstStoreValue.depthMax - 1, 0)).keys()] as i}",ctx:e}),n}function Ao(e){let t,n=e[13]+1+"",r,i,s,a,o;function c(){return e[6](e[13])}const l={c:function(){var f,h,p,g;t=L("div"),r=ce(n),i=W(),w(t,"class","depth-box s-JBVBfphpN2RX"),w(t,"style",s=(f=e[2])==null?void 0:f.getDepthBoxStyle(e[13]+1)),ge(t,"in-range",e[13]+1<=((h=e[2])==null?void 0:h.sunburstStoreValue.depthHigh)&&e[13]+1>=((p=e[2])==null?void 0:p.sunburstStoreValue.depthLow)),ge(t,"no-hover",e[13]+1===((g=e[2])==null?void 0:g.sunburstStoreValue.depthHigh)),x(t,Ke,232,8,5495)},m:function(f,h){ae(f,t,h),y(t,r),y(t,i),a||(o=he(t,"click",c,!1,!1,!1),a=!0)},p:function(f,h){var p,g,d,m;e=f,h&4&&n!==(n=e[13]+1+"")&&Ee(r,n),h&4&&s!==(s=(p=e[2])==null?void 0:p.getDepthBoxStyle(e[13]+1))&&w(t,"style",s),h&4&&ge(t,"in-range",e[13]+1<=((g=e[2])==null?void 0:g.sunburstStoreValue.depthHigh)&&e[13]+1>=((d=e[2])==null?void 0:d.sunburstStoreValue.depthLow)),h&4&&ge(t,"no-hover",e[13]+1===((m=e[2])==null?void 0:m.sunburstStoreValue.depthHigh))},d:function(f){f&&ee(t),a=!1,o()}};return te("SvelteRegisterBlock",{block:l,id:Ao.name,type:"each",source:"(232:6) {#each [...Array(handler?.sunburstStoreValue.depthMax).keys()] as i}",ctx:e}),l}function Vo(e){var T,D;let t,n,r,i=e[0]<600?"Depth":"Show Depth",s,a,o,c,l,u,f,h,p,g,d,m,v,S,b,_,k,H,I,M,V,E=[...Array(Math.max(((T=e[2])==null?void 0:T.sunburstStoreValue.depthMax)-1,0)).keys()];De(E);let F=[];for(let P=0;P8&&e[0]<650),x(S,Ke,260,6,6293),w(h,"class","tool-button s-JBVBfphpN2RX"),ge(h,"shown",(Y=e[2])==null?void 0:Y.favoritesStoreValue.shown),x(h,Ke,247,4,5952),w(k,"class","svg-icon s-JBVBfphpN2RX"),x(k,Ke,276,6,6646),w(I,"class","button-text s-JBVBfphpN2RX"),ge(I,"no-display",((U=e[2])==null?void 0:U.sunburstStoreValue.depthMax)>8&&e[0]<650),x(I,Ke,279,6,6717),w(_,"class","tool-button s-JBVBfphpN2RX"),ge(_,"shown",(X=e[2])==null?void 0:X.searchStoreValue.shown),x(_,Ke,269,4,6484),w(f,"class","tools s-JBVBfphpN2RX"),x(f,Ke,246,2,5928),w(t,"class","toolbar s-JBVBfphpN2RX"),x(t,Ke,214,0,4855)},l:function(G){throw new Error("options.hydrate only works if the component was compiled with the `hydratable: true` option")},m:function(G,Y){ae(G,t,Y),y(t,n),y(n,r),y(r,s),y(n,a),y(n,o),y(o,c);for(let U=0;U8&&G[0]<650),Y&4&&ge(h,"shown",(me=G[2])==null?void 0:me.favoritesStoreValue.shown),Y&5&&ge(I,"no-display",((K=G[2])==null?void 0:K.sunburstStoreValue.depthMax)>8&&G[0]<650),Y&4&&ge(_,"shown",(Q=G[2])==null?void 0:Q.searchStoreValue.shown)},i:pe,o:pe,d:function(G){G&&ee(t),ln(F,G),ln(A,G),e[9](null),M=!1,Re(V)}};return te("SvelteRegisterBlock",{block:C,id:Vo.name,type:"component",source:"",ctx:e}),C}function D7(e,t,n){let{$$slots:r={},$$scope:i}=t;St("Toolbar",r,[]);let{favoritesStore:s=null}=t,{sunburstStore:a=null}=t,{searchStore:o=null}=t,{sunburstWidth:c=650}=t,l=null,u=!1,f=null;Ne(()=>{u=!0});const h=()=>{n(2,f)},p=()=>{s&&a&&o&&n(2,f=new mc(h,s,a,o))},g=["favoritesStore","sunburstStore","searchStore","sunburstWidth"];Object.keys(t).forEach(b=>{!~g.indexOf(b)&&b.slice(0,2)!=="$$"&&b!=="slot"&&console.warn(` was created with unknown prop '${b}'`)});const d=b=>f==null?void 0:f.depthBoxClicked(b+1),m=()=>{f==null||f.favoritesClicked()},v=()=>{f==null||f.searchClicked()};function S(b){Je[b?"unshift":"push"](()=>{l=b,n(1,l)})}return e.$$set=b=>{"favoritesStore"in b&&n(3,s=b.favoritesStore),"sunburstStore"in b&&n(4,a=b.sunburstStore),"searchStore"in b&&n(5,o=b.searchStore),"sunburstWidth"in b&&n(0,c=b.sunburstWidth)},e.$capture_state=()=>({onMount:Ne,ToolbarEventHandler:mc,iconSearch:f2,iconHeart:d2,iconHeartSolid:p2,favoritesStore:s,sunburstStore:a,searchStore:o,sunburstWidth:c,component:l,mounted:u,handler:f,handlerUpdated:h,initView:p}),e.$inject_state=b=>{"favoritesStore"in b&&n(3,s=b.favoritesStore),"sunburstStore"in b&&n(4,a=b.sunburstStore),"searchStore"in b&&n(5,o=b.searchStore),"sunburstWidth"in b&&n(0,c=b.sunburstWidth),"component"in b&&n(1,l=b.component),"mounted"in b&&(u=b.mounted),"handler"in b&&n(2,f=b.handler)},t&&"$$inject"in t&&e.$inject_state(t.$$inject),e.$$.update=()=>{e.$$.dirty&56&&s&&a&&o&&p()},[c,l,f,s,a,o,d,m,v,S]}class g2 extends _t{constructor(t){super(t),Ct(this,t,D7,Vo,tt,{favoritesStore:3,sunburstStore:4,searchStore:5,sunburstWidth:0}),te("SvelteRegisterComponent",{component:this,tagName:"Toolbar",options:t,id:Vo.name})}get favoritesStore(){throw new Error(": Props cannot be read directly from the component instance unless compiling with 'accessors: true' or ''")}set favoritesStore(t){throw new Error(": Props cannot be set directly on the component instance unless compiling with 'accessors: true' or ''")}get sunburstStore(){throw new Error(": Props cannot be read directly from the component instance unless compiling with 'accessors: true' or ''")}set sunburstStore(t){throw new Error(": Props cannot be set directly on the component instance unless compiling with 'accessors: true' or ''")}get searchStore(){throw new Error(": Props cannot be read directly from the component instance unless compiling with 'accessors: true' or ''")}set searchStore(t){throw new Error(": Props cannot be set directly on the component instance unless compiling with 'accessors: true' or ''")}get sunburstWidth(){throw new Error(": Props cannot be read directly from the component instance unless compiling with 'accessors: true' or ''")}set sunburstWidth(t){throw new Error(": Props cannot be set directly on the component instance unless compiling with 'accessors: true' or ''")}}const vs={sunburstWidth:650,treeWindowWidth:150,treeWindowHeaderHeight:26,treeWindowHeight:0,toolbarHeight:36},N7={mouseenterDelay:300};vs.treeWindowHeight=vs.treeWindowHeaderHeight+vs.treeWindowWidth;const H7={"red-50":"hsl(350, 100.0%, 96.08%)","red-100":"hsl(354, 100.0%, 90.2%)","red-200":"hsl(0, 72.65%, 77.06%)","red-300":"hsl(0, 68.67%, 67.45%)","red-400":"hsl(1, 83.25%, 62.55%)","red-500":"hsl(4, 89.62%, 58.43%)","red-600":"hsl(1, 77.19%, 55.29%)","red-700":"hsl(0, 65.08%, 50.59%)","red-800":"hsl(0, 66.39%, 46.67%)","red-900":"hsl(0, 73.46%, 41.37%)","red-a100":"hsl(4, 100.0%, 75.1%)","red-a200":"hsl(0, 100.0%, 66.08%)","red-a400":"hsl(348, 100.0%, 54.51%)","red-a700":"hsl(0, 100.0%, 41.76%)","pink-50":"hsl(340, 80.0%, 94.12%)","pink-100":"hsl(339, 81.33%, 85.29%)","pink-200":"hsl(339, 82.11%, 75.88%)","pink-300":"hsl(339, 82.56%, 66.27%)","pink-400":"hsl(339, 81.9%, 58.82%)","pink-500":"hsl(339, 82.19%, 51.57%)","pink-600":"hsl(338, 77.78%, 47.65%)","pink-700":"hsl(336, 77.98%, 42.75%)","pink-800":"hsl(333, 79.27%, 37.84%)","pink-900":"hsl(328, 81.33%, 29.41%)","pink-a100":"hsl(339, 100.0%, 75.1%)","pink-a200":"hsl(339, 100.0%, 62.55%)","pink-a400":"hsl(338, 100.0%, 48.04%)","pink-a700":"hsl(333, 84.11%, 41.96%)","purple-50":"hsl(292, 44.44%, 92.94%)","purple-100":"hsl(291, 46.07%, 82.55%)","purple-200":"hsl(291, 46.94%, 71.18%)","purple-300":"hsl(291, 46.6%, 59.61%)","purple-400":"hsl(291, 46.61%, 50.78%)","purple-500":"hsl(291, 63.72%, 42.16%)","purple-600":"hsl(287, 65.05%, 40.39%)","purple-700":"hsl(282, 67.88%, 37.84%)","purple-800":"hsl(277, 70.17%, 35.49%)","purple-900":"hsl(267, 75.0%, 31.37%)","purple-a100":"hsl(291, 95.38%, 74.51%)","purple-a200":"hsl(291, 95.9%, 61.76%)","purple-a400":"hsl(291, 100.0%, 48.82%)","purple-a700":"hsl(280, 100.0%, 50.0%)","deep-purple-50":"hsl(264, 45.45%, 93.53%)","deep-purple-100":"hsl(261, 45.68%, 84.12%)","deep-purple-200":"hsl(261, 46.27%, 73.73%)","deep-purple-300":"hsl(261, 46.81%, 63.14%)","deep-purple-400":"hsl(261, 46.72%, 55.1%)","deep-purple-500":"hsl(261, 51.87%, 47.25%)","deep-purple-600":"hsl(259, 53.91%, 45.1%)","deep-purple-700":"hsl(257, 57.75%, 41.76%)","deep-purple-800":"hsl(254, 60.8%, 39.02%)","deep-purple-900":"hsl(251, 68.79%, 33.92%)","deep-purple-a100":"hsl(261, 100.0%, 76.67%)","deep-purple-a200":"hsl(255, 100.0%, 65.1%)","deep-purple-a400":"hsl(258, 100.0%, 56.08%)","deep-purple-a700":"hsl(265, 100.0%, 45.88%)","indigo-50":"hsl(231, 43.75%, 93.73%)","indigo-100":"hsl(231, 45.0%, 84.31%)","indigo-200":"hsl(230, 44.36%, 73.92%)","indigo-300":"hsl(230, 44.09%, 63.53%)","indigo-400":"hsl(230, 44.25%, 55.69%)","indigo-500":"hsl(230, 48.36%, 47.84%)","indigo-600":"hsl(231, 50.0%, 44.71%)","indigo-700":"hsl(231, 53.62%, 40.59%)","indigo-800":"hsl(232, 57.22%, 36.67%)","indigo-900":"hsl(234, 65.79%, 29.8%)","indigo-a100":"hsl(230, 100.0%, 77.45%)","indigo-a200":"hsl(230, 98.84%, 66.08%)","indigo-a400":"hsl(230, 98.97%, 61.76%)","indigo-a700":"hsl(230, 99.04%, 59.22%)","blue-50":"hsl(205, 86.67%, 94.12%)","blue-100":"hsl(207, 88.89%, 85.88%)","blue-200":"hsl(206, 89.74%, 77.06%)","blue-300":"hsl(206, 89.02%, 67.84%)","blue-400":"hsl(206, 89.95%, 60.98%)","blue-500":"hsl(206, 89.74%, 54.12%)","blue-600":"hsl(208, 79.28%, 50.78%)","blue-700":"hsl(209, 78.72%, 46.08%)","blue-800":"hsl(211, 80.28%, 41.76%)","blue-900":"hsl(216, 85.06%, 34.12%)","blue-a100":"hsl(217, 100.0%, 75.49%)","blue-a200":"hsl(217, 100.0%, 63.33%)","blue-a400":"hsl(217, 100.0%, 58.04%)","blue-a700":"hsl(224, 100.0%, 58.04%)","light-blue-50":"hsl(198, 93.55%, 93.92%)","light-blue-100":"hsl(198, 92.41%, 84.51%)","light-blue-200":"hsl(198, 92.37%, 74.31%)","light-blue-300":"hsl(198, 91.3%, 63.92%)","light-blue-400":"hsl(198, 91.93%, 56.27%)","light-blue-500":"hsl(198, 97.57%, 48.43%)","light-blue-600":"hsl(199, 97.41%, 45.49%)","light-blue-700":"hsl(201, 98.1%, 41.37%)","light-blue-800":"hsl(202, 97.91%, 37.45%)","light-blue-900":"hsl(206, 98.72%, 30.59%)","light-blue-a100":"hsl(198, 100.0%, 75.1%)","light-blue-a200":"hsl(198, 100.0%, 62.55%)","light-blue-a400":"hsl(198, 100.0%, 50.0%)","light-blue-a700":"hsl(202, 100.0%, 45.88%)","cyan-50":"hsl(186, 72.22%, 92.94%)","cyan-100":"hsl(186, 71.11%, 82.35%)","cyan-200":"hsl(186, 71.62%, 70.98%)","cyan-300":"hsl(186, 71.15%, 59.22%)","cyan-400":"hsl(186, 70.87%, 50.2%)","cyan-500":"hsl(186, 100.0%, 41.57%)","cyan-600":"hsl(186, 100.0%, 37.84%)","cyan-700":"hsl(185, 100.0%, 32.75%)","cyan-800":"hsl(185, 100.0%, 28.04%)","cyan-900":"hsl(182, 100.0%, 19.61%)","cyan-a100":"hsl(180, 100.0%, 75.88%)","cyan-a200":"hsl(180, 100.0%, 54.71%)","cyan-a400":"hsl(186, 100.0%, 50.0%)","cyan-a700":"hsl(187, 100.0%, 41.57%)","teal-50":"hsl(176, 40.91%, 91.37%)","teal-100":"hsl(174, 41.28%, 78.63%)","teal-200":"hsl(174, 41.9%, 64.9%)","teal-300":"hsl(174, 41.83%, 50.78%)","teal-400":"hsl(174, 62.75%, 40.0%)","teal-500":"hsl(174, 100.0%, 29.41%)","teal-600":"hsl(173, 100.0%, 26.86%)","teal-700":"hsl(173, 100.0%, 23.73%)","teal-800":"hsl(172, 100.0%, 20.59%)","teal-900":"hsl(169, 100.0%, 15.1%)","teal-a100":"hsl(166, 100.0%, 82.75%)","teal-a200":"hsl(165, 100.0%, 69.61%)","teal-a400":"hsl(165, 82.26%, 51.37%)","teal-a700":"hsl(171, 100.0%, 37.45%)","green-50":"hsl(124, 39.39%, 93.53%)","green-100":"hsl(121, 37.5%, 84.31%)","green-200":"hsl(122, 37.4%, 74.31%)","green-300":"hsl(122, 38.46%, 64.31%)","green-400":"hsl(122, 38.46%, 56.67%)","green-500":"hsl(122, 39.44%, 49.22%)","green-600":"hsl(122, 40.97%, 44.51%)","green-700":"hsl(122, 43.43%, 38.82%)","green-800":"hsl(123, 46.2%, 33.53%)","green-900":"hsl(124, 55.37%, 23.73%)","green-a100":"hsl(136, 77.22%, 84.51%)","green-a200":"hsl(150, 81.82%, 67.65%)","green-a400":"hsl(150, 100.0%, 45.1%)","green-a700":"hsl(144, 100.0%, 39.22%)","light-green-50":"hsl(88, 51.72%, 94.31%)","light-green-100":"hsl(87, 50.68%, 85.69%)","light-green-200":"hsl(88, 50.0%, 76.47%)","light-green-300":"hsl(87, 50.0%, 67.06%)","light-green-400":"hsl(87, 50.24%, 59.8%)","light-green-500":"hsl(87, 50.21%, 52.75%)","light-green-600":"hsl(89, 46.12%, 48.04%)","light-green-700":"hsl(92, 47.91%, 42.16%)","light-green-800":"hsl(95, 49.46%, 36.47%)","light-green-900":"hsl(103, 55.56%, 26.47%)","light-green-a100":"hsl(87, 100.0%, 78.24%)","light-green-a200":"hsl(87, 100.0%, 67.45%)","light-green-a400":"hsl(92, 100.0%, 50.59%)","light-green-a700":"hsl(96, 81.15%, 47.84%)","lime-50":"hsl(65, 71.43%, 94.51%)","lime-100":"hsl(64, 69.01%, 86.08%)","lime-200":"hsl(65, 70.69%, 77.25%)","lime-300":"hsl(65, 70.37%, 68.24%)","lime-400":"hsl(65, 69.7%, 61.18%)","lime-500":"hsl(65, 69.96%, 54.31%)","lime-600":"hsl(63, 59.68%, 49.61%)","lime-700":"hsl(62, 61.43%, 43.73%)","lime-800":"hsl(59, 62.89%, 38.04%)","lime-900":"hsl(53, 69.93%, 30.0%)","lime-a100":"hsl(65, 100.0%, 75.29%)","lime-a200":"hsl(65, 100.0%, 62.75%)","lime-a400":"hsl(73, 100.0%, 50.0%)","lime-a700":"hsl(75, 100.0%, 45.88%)","yellow-50":"hsl(55, 100.0%, 95.29%)","yellow-100":"hsl(53, 100.0%, 88.43%)","yellow-200":"hsl(53, 100.0%, 80.78%)","yellow-300":"hsl(53, 100.0%, 73.14%)","yellow-400":"hsl(53, 100.0%, 67.25%)","yellow-500":"hsl(53, 100.0%, 61.57%)","yellow-600":"hsl(48, 98.04%, 60.0%)","yellow-700":"hsl(42, 96.26%, 58.04%)","yellow-800":"hsl(37, 94.64%, 56.08%)","yellow-900":"hsl(28, 91.74%, 52.55%)","yellow-a100":"hsl(60, 100.0%, 77.65%)","yellow-a200":"hsl(60, 100.0%, 50.0%)","yellow-a400":"hsl(55, 100.0%, 50.0%)","yellow-a700":"hsl(50, 100.0%, 50.0%)","amber-50":"hsl(46, 100.0%, 94.12%)","amber-100":"hsl(45, 100.0%, 85.1%)","amber-200":"hsl(45, 100.0%, 75.49%)","amber-300":"hsl(45, 100.0%, 65.49%)","amber-400":"hsl(45, 100.0%, 57.84%)","amber-500":"hsl(45, 100.0%, 51.37%)","amber-600":"hsl(42, 100.0%, 50.0%)","amber-700":"hsl(37, 100.0%, 50.0%)","amber-800":"hsl(33, 100.0%, 50.0%)","amber-900":"hsl(26, 100.0%, 50.0%)","amber-a100":"hsl(47, 100.0%, 74.9%)","amber-a200":"hsl(47, 100.0%, 62.55%)","amber-a400":"hsl(46, 100.0%, 50.0%)","amber-a700":"hsl(40, 100.0%, 50.0%)","orange-50":"hsl(36, 100.0%, 93.92%)","orange-100":"hsl(35, 100.0%, 84.9%)","orange-200":"hsl(35, 100.0%, 75.1%)","orange-300":"hsl(35, 100.0%, 65.1%)","orange-400":"hsl(35, 100.0%, 57.45%)","orange-500":"hsl(35, 100.0%, 50.0%)","orange-600":"hsl(33, 100.0%, 49.22%)","orange-700":"hsl(30, 100.0%, 48.04%)","orange-800":"hsl(27, 100.0%, 46.86%)","orange-900":"hsl(21, 100.0%, 45.1%)","orange-a100":"hsl(38, 100.0%, 75.1%)","orange-a200":"hsl(33, 100.0%, 62.55%)","orange-a400":"hsl(34, 100.0%, 50.0%)","orange-a700":"hsl(25, 100.0%, 50.0%)","deep-orange-50":"hsl(5, 71.43%, 94.51%)","deep-orange-100":"hsl(14, 100.0%, 86.86%)","deep-orange-200":"hsl(14, 100.0%, 78.43%)","deep-orange-300":"hsl(14, 100.0%, 69.8%)","deep-orange-400":"hsl(14, 100.0%, 63.14%)","deep-orange-500":"hsl(14, 100.0%, 56.67%)","deep-orange-600":"hsl(14, 90.68%, 53.73%)","deep-orange-700":"hsl(14, 80.39%, 50.0%)","deep-orange-800":"hsl(14, 82.28%, 46.47%)","deep-orange-900":"hsl(14, 88.18%, 39.8%)","deep-orange-a100":"hsl(14, 100.0%, 75.1%)","deep-orange-a200":"hsl(14, 100.0%, 62.55%)","deep-orange-a400":"hsl(14, 100.0%, 50.0%)","deep-orange-a700":"hsl(11, 100.0%, 43.33%)","brown-50":"hsl(19, 15.79%, 92.55%)","brown-100":"hsl(16, 15.79%, 81.37%)","brown-200":"hsl(14, 15.19%, 69.02%)","brown-300":"hsl(15, 15.32%, 56.47%)","brown-400":"hsl(15, 17.5%, 47.06%)","brown-500":"hsl(15, 25.39%, 37.84%)","brown-600":"hsl(15, 25.29%, 34.12%)","brown-700":"hsl(14, 25.68%, 29.02%)","brown-800":"hsl(11, 25.81%, 24.31%)","brown-900":"hsl(8, 27.84%, 19.02%)","gray-50":"hsl(0, 0.0%, 98.04%)","gray-100":"hsl(0, 0.0%, 96.08%)","gray-200":"hsl(0, 0.0%, 93.33%)","gray-300":"hsl(0, 0.0%, 87.84%)","gray-400":"hsl(0, 0.0%, 74.12%)","gray-500":"hsl(0, 0.0%, 61.96%)","gray-600":"hsl(0, 0.0%, 45.88%)","gray-700":"hsl(0, 0.0%, 38.04%)","gray-800":"hsl(0, 0.0%, 25.88%)","gray-900":"hsl(0, 0.0%, 12.94%)","blue-gray-50":"hsl(204, 15.15%, 93.53%)","blue-gray-100":"hsl(198, 15.66%, 83.73%)","blue-gray-200":"hsl(199, 15.33%, 73.14%)","blue-gray-300":"hsl(199, 15.63%, 62.35%)","blue-gray-400":"hsl(200, 15.38%, 54.12%)","blue-gray-500":"hsl(199, 18.3%, 46.08%)","blue-gray-600":"hsl(198, 18.45%, 40.39%)","blue-gray-700":"hsl(199, 18.34%, 33.14%)","blue-gray-800":"hsl(199, 17.91%, 26.27%)","blue-gray-900":"hsl(199, 19.15%, 18.43%)","blue-gray-1000":"hsl(199, 20.93%, 8.43%)"},Te={colors:H7,layout:vs,time:N7};var Mt=(e=>(e[e.left=0]="left",e[e.middle=1]="middle",e[e.right=2]="right",e))(Mt||{}),gr=(e=>(e[e.First=0]="First",e[e.Second=1]="Second",e[e.Both=2]="Both",e))(gr||{}),gi=(e=>(e[e.PairArray=0]="PairArray",e[e.PairString=1]="PairString",e))(gi||{}),It=(e=>(e[e.SectorArc=0]="SectorArc",e[e.MidLine=1]="MidLine",e))(It||{});const F7=[[" ",19.3],["!",34.3],['"',39.7],["#",58],["$",58],["%",78.6],["&",70.3],["'",23],["(",30],[")",30],["*",40],["+",58],[",",21.2],["-",34.7],[".",21.2],["/",37.3],["0",58],["1",58],["2",58],["3",58],["4",58],["5",58],["6",58],["7",58],["8",58],["9",58],[":",25.2],[";",25.2],["<",58],["=",58],[">",58],["?",39.8],["@",82.2],["A",68],["B",64.7],["C",68.5],["D",75.3],["E",58.1],["F",56.6],["G",73.4],["H",75.6],["I",30.7],["J",44.4],["K",68.1],["L",51.4],["M",92],["N",75.6],["O",79.8],["P",61.1],["Q",79.8],["R",64.4],["S",53],["T",59],["U",73],["V",68],["W",101.9],["X",64.3],["Y",62.9],["Z",62.4],["[",30],["\\",37.5],["]",30],["^",58],["_",39.4],["`",30.7],["a",50.7],["b",55.9],["c",46.7],["d",55.9],["e",52.4],["f",33.7],["g",51.1],["h",55.6],["i",25.6],["j",25.4],["k",52.4],["l",25.6],["m",82.1],["n",55.6],["o",55.6],["p",55.2],["q",55.9],["r",40.3],["s",43.4],["t",37.3],["u",55.6],["v",51.2],["w",76.6],["x",50.4],["y",51.2],["z",46.2],["{",30],["|",30],["}",30],["~",58],["_median",55.9]],P7=[['"&',-9.1],['",',-11.4],['"-',-8.9],['".',-11.4],['"/',-9.1],['"@',-2.3],['"A',-9.1],['"C',-2.3],['"G',-2.3],['"O',-2.3],['"Q',-2.3],['"V',2.4],['"W',2.4],['"Y',1.5],['"\\',2.4],['"a',-3.2],['"c',-4.6],['"d',-4.6],['"e',-4.6],['"o',-4.6],['"q',-4.6],["'&",-9.1],["',",-11.4],["'-",-8.9],["'.",-11.4],["'/",-9.1],["'@",-2.3],["'A",-9.1],["'C",-2.3],["'G",-2.3],["'O",-2.3],["'Q",-2.3],["'V",2.4],["'W",2.4],["'Y",1.5],["'\\",2.4],["'a",-3.2],["'c",-4.6],["'d",-4.6],["'e",-4.6],["'o",-4.6],["'q",-4.6],["(@",-2],["(C",-2],["(G",-2],["(O",-2],["(Q",-2],["(c",-1.6],["(d",-1.6],["(e",-1.6],["(o",-1.6],["(q",-1.6],["*&",-9.1],["*,",-11.4],["*-",-8.9],["*.",-11.4],["*/",-9.1],["*@",-2.3],["*A",-9.1],["*C",-2.3],["*G",-2.3],["*O",-2.3],["*Q",-2.3],["*V",2.4],["*W",2.4],["*Y",1.5],["*\\",2.4],["*a",-3.2],["*c",-4.6],["*d",-4.6],["*e",-4.6],["*o",-4.6],["*q",-4.6],[',"',-11.4],[",'",-11.4],[",*",-11.4],[",-",-6.8],[",@",-2.8],[",C",-2.8],[",G",-2.8],[",O",-2.8],[",Q",-2.8],[",T",-9],[",V",-9],[",W",-6.1],[",Y",-7.6],[",\\",-9],[",v",-6.6],[",w",-3.1],[",y",-6.6],['-"',-8.9],["-&",-2.6],["-'",-8.9],["-*",-8.9],["-,",-6.8],["-.",-6.8],["-/",-2.6],["-A",-2.6],["-T",-9],["-V",-5.6],["-W",-1.6],["-X",-3.1],["-Y",-8],["-Z",-2.3],["-\\",-5.6],['."',-11.4],[".'",-11.4],[".*",-11.4],[".-",-6.8],[".@",-2.8],[".C",-2.8],[".G",-2.8],[".O",-2.8],[".Q",-2.8],[".T",-9],[".V",-9],[".W",-6.1],[".Y",-7.6],[".\\",-9],[".v",-6.6],[".w",-3.1],[".y",-6.6],['/"',2.4],["/&",-6.8],["/'",2.4],["/*",2.4],["/,",-9.6],["/-",-5.6],["/.",-9.6],["//",-6.8],["/:",-4.4],["/;",-4.4],["/?",2.4],["/@",-2.6],["/A",-6.8],["/C",-2.6],["/G",-2.6],["/J",-7.6],["/O",-2.6],["/Q",-2.6],["/a",-5.8],["/c",-5.8],["/d",-5.8],["/e",-5.8],["/f",-1.5],["/g",-6.8],["/m",-4.4],["/n",-4.4],["/o",-5.8],["/p",-4.4],["/q",-5.8],["/r",-4.4],["/s",-5.3],["/t",-2.1],["/u",-4.4],["/v",-2.4],["/x",-2.6],["/y",-2.4],["/z",-4.1],['@"',-2.3],["@&",-2.1],["@'",-2.3],["@)",-2],["@*",-2.3],["@,",-2.8],["@.",-2.8],["@/",-2.1],["@A",-2.1],["@T",-4.9],["@V",-2.6],["@X",-1.5],["@Y",-4],["@Z",-3.5],["@\\",-2.6],["@]",-2],["@}",-2],['A"',-9.1],["A'",-9.1],["A*",-9.1],["A-",-2.6],["A?",-2.8],["A@",-2.1],["AC",-2.1],["AG",-2.1],["AJ",2.5],["AO",-2.1],["AQ",-2.1],["AT",-6.6],["AU",-2.8],["AV",-6.8],["AW",-4.2],["AY",-8.2],["A\\",-6.8],["Av",-4.1],["Ay",-4.1],["C-",-7.5],['D"',-2.3],["D&",-2.1],["D'",-2.3],["D)",-2],["D*",-2.3],["D,",-2.8],["D.",-2.8],["D/",-2.1],["DA",-2.1],["DT",-4.9],["DV",-2.6],["DX",-1.5],["DY",-4],["DZ",-3.5],["D\\",-2.6],["D]",-2],["D}",-2],["F&",-6.6],["F,",-9],["F.",-9],["F/",-6.6],["F:",-3],["F;",-3],["F?",1.5],["FA",-6.6],["FJ",-9.9],["Fc",-3.5],["Fd",-3.5],["Fe",-3.5],["Fm",-3],["Fn",-3],["Fo",-3.5],["Fp",-3],["Fq",-3.5],["Fr",-3],["Fu",-3],["J&",-2.8],["J,",-2.5],["J.",-2.5],["J/",-2.8],["JA",-2.8],["K-",-3.1],["K@",-1.5],["KC",-1.5],["KG",-1.5],["KO",-1.5],["KQ",-1.5],["Kc",-1.8],["Kd",-1.8],["Ke",-1.8],["Kf",-2.6],["Ko",-1.8],["Kq",-1.8],["Kt",-4.1],["Kv",-3.3],["Kw",-2.8],["Ky",-3.3],['L"',-14.5],["L'",-14.5],["L*",-14.5],["L,",2.7],["L-",-9.9],["L.",2.7],["L?",-2.5],["L@",-4],["LC",-4],["LG",-4],["LO",-4],["LQ",-4],["LT",-8.6],["LV",-9.1],["LW",-7.6],["LY",-10.6],["L\\",-9.1],["Lc",-1.8],["Ld",-1.8],["Le",-1.8],["Lo",-1.8],["Lq",-1.8],["Lv",-5.4],["Lw",-4],["Ly",-5.4],['O"',-2.3],["O&",-2.1],["O'",-2.3],["O)",-2],["O*",-2.3],["O,",-2.8],["O.",-2.8],["O/",-2.1],["OA",-2.1],["OT",-4.9],["OV",-2.6],["OX",-1.5],["OY",-4],["OZ",-3.5],["O\\",-2.6],["O]",-2],["O}",-2],["P&",-6.9],["P,",-12.4],["P.",-12.4],["P/",-6.9],["PA",-6.9],["PJ",-9.1],["Pa",-2.5],["Pc",-1.5],["Pd",-1.5],["Pe",-1.5],["Po",-1.5],["Pq",-1.5],['Q"',-2.3],["Q&",-2.1],["Q'",-2.3],["Q)",-2],["Q*",-2.3],["Q,",-2.8],["Q.",-2.8],["Q/",-2.1],["QA",-2.1],["QT",-4.9],["QV",-2.6],["QX",-1.5],["QY",-4],["QZ",-3.5],["Q\\",-2.6],["Q]",-2],["Q}",-2],["R@",-2.3],["RC",-2.3],["RG",-2.3],["RO",-2.3],["RQ",-2.3],["RT",-2.6],["RU",-2.1],["T&",-6.6],["T,",-9],["T-",-9],["T.",-9],["T/",-6.6],["T:",-8],["T;",-8],["T@",-4.9],["TA",-6.6],["TC",-4.9],["TG",-4.9],["TJ",-10],["TO",-4.9],["TQ",-4.9],["Ta",-12.5],["Tc",-10.5],["Td",-10.5],["Te",-10.5],["Tg",-9.4],["Tm",-8],["Tn",-8],["To",-10.5],["Tp",-8],["Tq",-10.5],["Tr",-8],["Ts",-8.1],["Tu",-8],["Tv",-9],["Tw",-7],["Tx",-7.2],["Ty",-9],["Tz",-6],["U&",-2.8],["U,",-2.5],["U.",-2.5],["U/",-2.8],["UA",-2.8],['V"',2.4],["V&",-6.8],["V'",2.4],["V*",2.4],["V,",-9.6],["V-",-5.6],["V.",-9.6],["V/",-6.8],["V:",-4.4],["V;",-4.4],["V?",2.4],["V@",-2.6],["VA",-6.8],["VC",-2.6],["VG",-2.6],["VJ",-7.6],["VO",-2.6],["VQ",-2.6],["Va",-5.8],["Vc",-5.8],["Vd",-5.8],["Ve",-5.8],["Vf",-1.5],["Vg",-6.8],["Vm",-4.4],["Vn",-4.4],["Vo",-5.8],["Vp",-4.4],["Vq",-5.8],["Vr",-4.4],["Vs",-5.3],["Vt",-2.1],["Vu",-4.4],["Vv",-2.4],["Vx",-2.6],["Vy",-2.4],["Vz",-4.1],['W"',2.4],["W&",-4.7],["W'",2.4],["W*",2.4],["W,",-6.1],["W-",-1.6],["W.",-6.1],["W/",-4.7],["W?",1.7],["WA",-4.7],["WJ",-5.1],["Wa",-4.4],["Wc",-1.6],["Wd",-1.6],["We",-1.6],["Wg",-4.9],["Wo",-1.6],["Wq",-1.6],["Ws",-2.3],["X-",-3.1],["X@",-1.5],["XC",-1.5],["XG",-1.5],["XO",-1.5],["XQ",-1.5],["Xc",-1.8],["Xd",-1.8],["Xe",-1.8],["Xf",-2.6],["Xo",-1.8],["Xq",-1.8],["Xt",-4.1],["Xv",-3.3],["Xw",-2.8],["Xy",-3.3],['Y"',1.5],["Y&",-8.2],["Y'",1.5],["Y*",1.5],["Y,",-7.6],["Y-",-8],["Y.",-7.6],["Y/",-8.2],["Y:",-6.1],["Y;",-6.1],["Y?",1.7],["Y@",-4],["YA",-8.2],["YC",-4],["YG",-4],["YJ",-10],["YO",-4],["YQ",-4],["Ya",-6.4],["Yc",-8],["Yd",-8],["Ye",-8],["Yg",-8.6],["Ym",-6.1],["Yn",-6.1],["Yo",-8],["Yp",-6.1],["Yq",-8],["Yr",-6.1],["Ys",-6.4],["Yu",-6.1],["Yv",-5],["Yw",-4.6],["Yx",-6.6],["Yy",-5],["Z-",-3.5],["Z?",1.7],["Z@",-2.9],["ZC",-2.9],["ZG",-2.9],["ZO",-2.9],["ZQ",-2.9],["Zc",-1.9],["Zd",-1.9],["Ze",-1.9],["Zo",-1.9],["Zq",-1.9],["Zs",-1.4],["Zv",-2],["Zy",-2],["[@",-2],["[C",-2],["[G",-2],["[O",-2],["[Q",-2],["[c",-1.6],["[d",-1.6],["[e",-1.6],["[o",-1.6],["[q",-1.6],['\\"',-9.1],["\\'",-9.1],["\\*",-9.1],["\\-",-2.6],["\\?",-2.8],["\\@",-2.1],["\\C",-2.1],["\\G",-2.1],["\\J",2.5],["\\O",-2.1],["\\Q",-2.1],["\\T",-6.6],["\\U",-2.8],["\\V",-6.8],["\\W",-4.2],["\\Y",-8.2],["\\\\",-6.8],["\\v",-4.1],["\\y",-4.1],['a"',-3.6],["a'",-3.6],["a*",-3.6],["av",-1.6],["aw",-.8],["ay",-1.6],['b"',-4.6],["b'",-4.6],["b)",-1.6],["b*",-4.6],["bV",-5.8],["bW",-1.6],["b\\",-5.8],["b]",-1.6],["bv",-1.3],["bx",-3],["by",-1.3],["b}",-1.6],['e"',-4.6],["e'",-4.6],["e)",-1.6],["e*",-4.6],["eV",-5.8],["eW",-1.6],["e\\",-5.8],["e]",-1.6],["ev",-1.3],["ex",-3],["ey",-1.3],["e}",-1.6],['f"',3.4],["f'",3.4],["f*",3.4],["f,",-6.5],["f.",-6.5],["fi",-2.3],['h"',-3.6],["h'",-3.6],["h*",-3.6],["hv",-1.6],["hw",-.8],["hy",-1.6],["kc",-3],["kd",-3],["ke",-3],["ko",-3],["kq",-3],['m"',-3.6],["m'",-3.6],["m*",-3.6],["mv",-1.6],["mw",-.8],["my",-1.6],['n"',-3.6],["n'",-3.6],["n*",-3.6],["nv",-1.6],["nw",-.8],["ny",-1.6],['o"',-4.6],["o'",-4.6],["o)",-1.6],["o*",-4.6],["oV",-5.8],["oW",-1.6],["o\\",-5.8],["o]",-1.6],["ov",-1.3],["ox",-3],["oy",-1.3],["o}",-1.6],['p"',-4.6],["p'",-4.6],["p)",-1.6],["p*",-4.6],["pV",-5.8],["pW",-1.6],["p\\",-5.8],["p]",-1.6],["pv",-1.3],["px",-3],["py",-1.3],["p}",-1.6],["r,",-6.6],["r.",-6.6],["ra",-1.9],["v&",-4.1],["v,",-6.6],["v.",-6.6],["v/",-4.1],["vA",-4.1],["vc",-1.3],["vd",-1.3],["ve",-1.3],["vo",-1.3],["vq",-1.3],["w,",-3.1],["w.",-3.1],["xc",-3],["xd",-3],["xe",-3],["xo",-3],["xq",-3],["y&",-4.1],["y,",-6.6],["y.",-6.6],["y/",-4.1],["yA",-4.1],["yc",-1.3],["yd",-1.3],["ye",-1.3],["yo",-1.3],["yq",-1.3],["{@",-2],["{C",-2],["{G",-2],["{O",-2],["{Q",-2],["{c",-1.6],["{d",-1.6],["{e",-1.6],["{o",-1.6],["{q",-1.6]],R7={textWidth:F7,kerningWidth:P7},I7=(e,t,n=16)=>{const r=new Map(e.textWidth),i=new Map(e.kerningWidth),s=[...t];let a=0;for(const[o,c]of s.entries())a+=r.get(c)||r.get("_median"),o!==s.length-1&&(a+=i.get(`${c}${s[o+1]}`)||0);return a/(100/n)},ft=(e,t=16)=>I7(R7,e,t),is=Math.PI/2,m2=20;function E7(e,t){switch(t){case It.SectorArc:{const n=[this.xScale(e.x0)-is,this.xScale(e.x1)-is],r=Math.max(0,(this.yScale(e.y0)+this.yScale(e.y1))/2),i=(n[0]+n[1])/2,s=i>0&&i=Math.PI/2&&r<=Math.PI*3/2?(u.moveTo(c,l),u.lineTo(a,o)):(u.moveTo(a,o),u.lineTo(c,l)),u.toString()}}}function z7(e,t=16,n=null,r=0){n==null&&(n=this.getFeatureInfo(e.data.f).nameValue);const i=ft(n,t),s=this.xScale(e.x1)-this.xScale(e.x0),a=Math.max(0,(this.yScale(e.y0)+this.yScale(e.y1))/2),o=s*a;return i<=o-r}const Xl=(e,t)=>{const n=z.color(e(t.data.f));let r="currentcolor";if(n!==null){const i=[252,252,252],s=[74,74,74],a=z.color(n).rgb(),o=[a.r,a.g,a.b];Yr(i,o)Xl(this.getFeatureColor,l)),o=this.textFontScale(this.sunburstStoreValue.depthHigh-this.sunburstStoreValue.depthLow),c=(l,u)=>{const f=this.getFeatureInfo(l.data.f);let h=f.nameValue,p=ft(h,16*o);if(p>u)for(h=f.shortValue,p=ft(h,16*o);p>u;)h=h.replace("...",""),h=h.slice(0,h.length-1),h=`${h}...`,p=ft(h,16*o);return h};a.filter(l=>l.depth===1).style("font-size",`${o}rem`).text(l=>c(l,i*2-10)),a.filter(l=>l.depth!==1).style("font-size",`${o}rem`).append("textPath").attr("startOffset","50%").attr("xlink:href",l=>`#mid-circle-text-arc-${l.depth}`).text(l=>c(l,i*(l.depth-.5)*s))}function O7(){const e=this.svg.select("g.arc-group"),t=this.svg.select("g.text-group");let n=e.selectAll(`g.arc-${this.xScale.domain()[0]===0&&this.xScale.domain()[1]===1?this.sunburstStoreValue.depthLow:this.sunburstStoreValue.depthLow+1}`);n=n.sort((f,h)=>f.x0-h.x0),n=n.filter(f=>f.x0>=this.xScale.domain()[0]&&f.x1<=this.xScale.domain()[1]&&f.data.f!=="_");const r=t.selectAll("g.text-group").data(n.data()).join("g").attr("class","text-group");r.append("path").attr("class","text-arc").attr("id",(f,h)=>`text-arc-${h}`).attr("d",f=>this.textArc(f,It.SectorArc)),r.append("path").attr("class","text-line").attr("id",(f,h)=>`text-line-${h}`).attr("d",f=>this.textArc(f,It.MidLine));const i=r.append("text").attr("class","feature-name");i.style("fill",f=>Xl(this.getFeatureColor,f));const s=new Set,a=new Map;if(i.size()===0)return;const o=this.yScale(i.datum().y1)-this.yScale(i.datum().y0)-15,c=this.textFontScale(this.sunburstStoreValue.depthHigh-this.sunburstStoreValue.depthLow),l=i.style("font-size",`${c}rem`).append("textPath").attr("startOffset","50%").attr("xlink:href",(f,h)=>{const p=this.getFeatureInfo(f.data.f);let g=p.nameValue,d=!1;return s.has(p.name)&&(g=p.value,d=!0),s.add(p.name),ft(g,16*c){const p=this.getFeatureInfo(f.data.f);let g=p.nameValue,d=!1;if(s.has(p.name)&&(g=p.value,d=!0),a.get(h)===It.MidLine){if(this.yScale(f.y1)*(this.xScale(f.x1)-this.xScale(f.x0))o&&!d)for(g=p.shortValue,v=ft(g,16*c);v>o;)g=g.replace("...",""),g=g.slice(0,g.length-1),g=`${g}...`,v=ft(g,16*c)}return s.add(p.name),g});const u=new Set;Array.from(this.featureMap.entries()).forEach(f=>{s.has(f[1][0])||u.add(f[0])}),this.drawSecondaryText(u)}function G7(e){const t=this.svg.select("g.arc-group"),n=this.svg.select("g.text-group");let r=t.selectAll(`g.arc-${this.xScale.domain()[0]===0&&this.xScale.domain()[1]===1?this.sunburstStoreValue.depthLow+1:this.sunburstStoreValue.depthLow+2}`);if(r=r.filter(f=>f.x0>=this.xScale.domain()[0]&&f.x1<=this.xScale.domain()[1]&&e.has(+f.data.f)),r.size()===0)return;r=r.sort((f,h)=>f.x0-h.x0);const i=n.selectAll("g.s-text-group").data(r.data()).join("g").attr("class","text-group");i.append("path").attr("class","text-arc").attr("id",(f,h)=>`s-text-arc-${h}`).attr("d",f=>this.textArc(f,It.SectorArc)),i.append("path").attr("class","text-line").attr("id",(f,h)=>`s-text-line-${h}`).attr("d",f=>this.textArc(f,It.MidLine));const s=i.append("text").attr("class","feature-name"),a=this.yScale(s.datum().y1)-this.yScale(s.datum().y0)-15,o=this.textFontScale(this.sunburstStoreValue.depthHigh-this.sunburstStoreValue.depthLow);s.style("fill",f=>Xl(this.getFeatureColor,f));const c=new Set([]),l=s.style("font-size",`${o}rem`).append("textPath").attr("startOffset","50%").attr("xlink:href",(f,h)=>{const g=this.getFeatureInfo(f.data.f).nameValue;return ft(g,16*o){if(u.has(f.data.f))return"";const p=this.getFeatureInfo(f.data.f);let g=p.nameValue;if(this.yScale(f.y1)*(this.xScale(f.x1)-this.xScale(f.x0))a)for(g=p.shortValue,m=ft(g,16*o);m>a;)g=g.replace("...",""),g=g.slice(0,g.length-1),g=`${g}...`,m=ft(g,16*o)}return u.add(f.data.f),g})}function Y7(){this.svg.select(".text-group").selectAll("*").remove(),this.svg.selectAll("text.feature-name").remove()}let yi=null,bs=null,y2=new Date().getTime();function B7(e,t){if(e.stopPropagation(),e.preventDefault(),t!==null&&t.data.f==="_")return;let n={x0:0,x1:1,y0:0,y1:1},r=t;const i=this.xScale.domain(),s=this.yScale.domain(),a=this.sunburstStoreValue.depthHigh-this.sunburstStoreValue.depthLow;if(t===null||t.x0==i[0]&&t.x1==i[1]){const l=this.arcDomainStack.pop();l!==void 0?(r=l.node,n=l,this.sunburstStoreValue.depthLow=r.depth===0?1:r.depth,this.sunburstStoreValue.depthHigh=Math.min(this.sunburstStoreValue.depthLow+l.depthGap,this.sunburstStoreValue.depthMax)):console.error("No more arc domain from the stack to pop!")}else{const l=1/(this.sunburstStoreValue.depthMax+1);this.sunburstStoreValue.depthLow=t.depth,this.sunburstStoreValue.depthHigh=Math.min(t.depth+a,this.sunburstStoreValue.depthMax),n={x0:t.x0,x1:t.x1,y0:t.y0,y1:t.y0+l*(this.sunburstStoreValue.depthHigh-this.sunburstStoreValue.depthLow+1)};const u={x0:i[0],x1:i[1],y0:s[0],y1:s[1],node:this.curHeadNode,depthGap:a};this.arcDomainStack.push(u)}const o=new Array(this.sunburstStoreValue.depthMax).fill("");r.ancestors().forEach(l=>{if(l.depth>0){const u=this.getFeatureColor(l.data.f);o[l.depth-1]=u}}),this.sunburstStoreValue.depthColors=o,this.sunburstStore.set(this.sunburstStoreValue),this.curHeadNode=r,this.sunburstUpdated(),this.arcZoom(n)}function U7(e,t){if(e.currentTarget===null)return;t.ancestors().filter(r=>r.depth>0).forEach(r=>{const i=this.svg.select(`path#arc-${r.data.nid}`);z.select(i.node().parentElement).raise(),i.classed("highlighted",!0)})}function Z7(e,t){if(e.currentTarget===null)return;t.ancestors().filter(r=>r.depth>0).forEach(r=>{this.svg.select(`path#arc-${r.data.nid}`).classed("highlighted",!1)})}function j7(e,t){e.preventDefault(),e.stopPropagation(),this.arcMouseenterHandler(e,t),bs!==null&&(window.clearTimeout(bs),bs=null);const n=()=>{if(t.data.t===void 0)return;const r=t.data.t;this.treeWindowStoreValue.treeID=+r;const i=t.ancestors().filter(a=>a.depth!==0).map(a=>a.data.f).reverse();this.treeWindowStoreValue.ancestorFs=i;const s=this.getTreeWindowPos(t);this.treeWindowStoreValue.x=s.x,this.treeWindowStoreValue.y=s.y,this.treeWindowStoreValue.show=!0,this.treeWindowStore.set(this.treeWindowStoreValue),this.curHeadNode.value&&this.curHeadNode.value<300&&this.svg.select(".arc-group").selectAll(`path.arc.leaf-${r}`).filter(o=>o.data.nid!==t.data.nid).classed("same-leaf-highlight",!0),yi=null};this.treeWindowStoreValue.show||new Date().getTime()-y2<500?n():yi=window.setTimeout(n,Te.time.mouseenterDelay)}function X7(e,t){t.data.t!==void 0&&(e.preventDefault(),e.stopPropagation(),this.arcMouseleaveHandler(e,t),this.curHeadNode.value&&this.curHeadNode.value<300&&this.svg.select(".arc-group").selectAll(`path.arc.leaf-${t.data.t}`).classed("same-leaf-highlight",!1),yi!==null&&(window.clearTimeout(yi),yi=null),bs=window.setTimeout(()=>{this.treeWindowStoreValue.show=!1,this.treeWindowStore.set(this.treeWindowStoreValue),y2=new Date().getTime()},100))}function q7(e){let t=(this.xScale(e.x0)+this.xScale(e.x1))/2-Math.PI/2;const n=this.yScale(e.y1)+8,r={x:Math.cos(t)*n,y:Math.sin(t)*n,quad:Math.floor(t/(Math.PI/2))+2};e.x0===this.xScale.domain()[0]&&e.x1===this.xScale.domain()[1]&&(r.x=Math.cos(-Math.PI/4)*n,r.y=Math.sin(-Math.PI/4)*n,r.quad=1);const i=u=>{const f={x:0,y:0};switch(u.quad){case 1:{f.x=u.x,f.y=u.y-Te.layout.treeWindowHeight;break}case 2:{f.x=u.x,f.y=u.y;break}case 3:{f.x=u.x-Te.layout.treeWindowWidth,f.y=u.y;break}case 4:{f.x=u.x-Te.layout.treeWindowWidth,f.y=u.y-Te.layout.treeWindowHeight;break}default:console.warn("Unknown quad!")}return f};let s=window.innerHeight;z.select(".timbertrek-page").size()>0&&(s=z.select(".timbertrek-page").node().getBoundingClientRect().height);const a=5,o=this.svg.node().getBoundingClientRect(),c={x:o.x+o.width/2,y:o.y+o.height/2};let l=i(r);if(l.y+c.ys-a){const u=s-a-c.y-Te.layout.treeWindowHeight;t=Math.asin(u/n),r.quad===3&&(t=Math.PI-t),r.x=Math.cos(t)*n,r.y=Math.sin(t)*n,r.quad=Math.floor(t/(Math.PI/2))+2,l=i(r)}return l.x=c.x+l.x,l.y=c.y+l.y,l}function J7(e,t){if(e.preventDefault(),e.stopPropagation(),localStorage.getItem("treeWindowPinnedOnce")!=="true"&&localStorage.setItem("treeWindowPinnedOnce","true"),t.data.t===void 0)return;const n=t.data.t,r=this.treeWindowStoreValue.treeMap.get(n);if(r===void 0)return;const i=this.getTreeWindowPos(t),s={x:i.x,y:i.y,width:Te.layout.treeWindowWidth,height:Te.layout.treeWindowHeight},a={x:20,y:20};if(this.pinnedTreeStoreValue.lastActiveTreeID!==null){const o=this.pinnedTreeStoreValue.pinnedTrees.filter(c=>c.treeID===this.pinnedTreeStoreValue.lastActiveTreeID)[0];a.x=o.x+20,a.y=o.y+30}if(this.pinnedTreeStoreValue.pinnedTrees.map(o=>o.treeID).includes(n)){let o=-1;for(let l=0;l{}};this.pinnedTreeStoreValue.pinnedTrees.push(o),this.pinnedTreeStore.set(this.pinnedTreeStoreValue)}}function Q7(){const t=this.treeWindowStoreValue.treeMap.get(412);if(t!==void 0){const n={x:70,y:150};if(this.pinnedTreeStoreValue.lastActiveTreeID!==null){const i=this.pinnedTreeStoreValue.pinnedTrees.filter(s=>s.treeID===this.pinnedTreeStoreValue.lastActiveTreeID)[0];n.x=i.x+20,n.y=i.y+30}const r={tree:t[0],treeMetric:Gr(t[2],4),treeID:412,x:n.x,y:n.y,startPos:{x:0,y:0,width:0,height:0},isFav:!1,isPinned:!0,note:"",jiggle:()=>{}};this.pinnedTreeStoreValue.pinnedTrees.push(r),this.pinnedTreeStore.set(this.pinnedTreeStoreValue)}}let Vn=null;function K7(){this.treeMapMap.forEach((n,r)=>{n[2]>=this.localAccuracyLow&&n[2]<=this.localAccuracyHigh?this.selectedTrees.accuracy.add(r):this.selectedTrees.accuracy.delete(r)});const e=new Set;for(const n of this.selectedTrees.accuracy)this.selectedTrees.depth.has(n)&&this.selectedTrees.minSample.has(n)&&this.selectedTrees.allFeature.has(n)&&this.selectedTrees.height.has(n)&&e.add(n);this.dataRoot.eachBefore(n=>{n.data.t!==void 0&&(e.has(n.data.t)?n.data.u=!0:n.data.u=!1)}),this.dataRoot=this.dataRoot.sum(n=>n.u!==void 0&&n.u?1:0);const t=z.partition()(this.dataRoot);t.eachAfter(n=>{var r;if(n.data.u!==void 0&&n.data.u)n.uniqueTreeIDs=new Set([n.data.t]);else{const i=new Set;(r=n.children)==null||r.forEach(s=>{var a;(a=s.uniqueTreeIDs)==null||a.forEach(o=>{i.add(o)})}),n.uniqueTreeIDs=i}}),t.each(n=>{var r;n.treeNum=((r=n.uniqueTreeIDs)==null?void 0:r.size)||0,n.uniqueTreeIDs=null}),this.partition=t,this.updateSunburst(),this.searchStoreValue.updatePlots!==null&&this.searchStoreValue.updatePlots(this.selectedTrees,!1)}function $7(){if(this.searchStoreValue.treeMinSampleMap===null)return;for(const[n,r]of this.searchStoreValue.treeMinSampleMap)r>=this.localMinSampleLow&&r<=this.localMinSampleHigh?this.selectedTrees.minSample.add(n):this.selectedTrees.minSample.delete(n);const e=new Set;for(const n of this.selectedTrees.accuracy)this.selectedTrees.depth.has(n)&&this.selectedTrees.minSample.has(n)&&this.selectedTrees.allFeature.has(n)&&this.selectedTrees.height.has(n)&&e.add(n);this.dataRoot.eachBefore(n=>{n.data.t!==void 0&&(e.has(n.data.t)?n.data.u=!0:n.data.u=!1)}),this.dataRoot=this.dataRoot.sum(n=>n.u!==void 0&&n.u?1:0);const t=z.partition()(this.dataRoot);t.eachAfter(n=>{var r;if(n.data.u!==void 0&&n.data.u)n.uniqueTreeIDs=new Set([n.data.t]);else{const i=new Set;(r=n.children)==null||r.forEach(s=>{var a;(a=s.uniqueTreeIDs)==null||a.forEach(o=>{i.add(o)})}),n.uniqueTreeIDs=i}}),t.each(n=>{var r;n.treeNum=((r=n.uniqueTreeIDs)==null?void 0:r.size)||0,n.uniqueTreeIDs=null}),this.partition=t,this.updateSunburst(),this.searchStoreValue.updatePlots!==null&&this.searchStoreValue.updatePlots(this.selectedTrees,!1)}function ed(){if(this.searchStoreValue.treeHeightMap===null)return;this.searchStoreValue.treeHeightMap.forEach((n,r)=>{this.localHeightRange.has(n)?this.selectedTrees.height.add(r):this.selectedTrees.height.delete(r)});const e=new Set;for(const n of this.selectedTrees.accuracy)this.selectedTrees.depth.has(n)&&this.selectedTrees.minSample.has(n)&&this.selectedTrees.allFeature.has(n)&&this.selectedTrees.height.has(n)&&e.add(n);this.dataRoot.eachBefore(n=>{const r=n;r.previous={x0:r.x0,x1:r.x1,y0:r.y0,y1:r.y1,data:r.data},n.data.t!==void 0&&(e.has(n.data.t)?n.data.u=!0:n.data.u=!1)}),this.dataRoot=this.dataRoot.sum(n=>n.u!==void 0&&n.u?1:0);const t=z.partition()(this.dataRoot);t.eachAfter(n=>{var r;if(n.data.u!==void 0&&n.data.u)n.uniqueTreeIDs=new Set([n.data.t]);else{const i=new Set;(r=n.children)==null||r.forEach(s=>{var a;(a=s.uniqueTreeIDs)==null||a.forEach(o=>{i.add(o)})}),n.uniqueTreeIDs=i}}),t.each(n=>{var r;n.treeNum=((r=n.uniqueTreeIDs)==null?void 0:r.size)||0,n.uniqueTreeIDs=null}),this.partition=t,this.updateSunburstWithAnimation(),this.searchStoreValue.updatePlots!==null&&this.searchStoreValue.updatePlots(this.selectedTrees,!0)}function td(){if(this.searchStoreValue.treeDepthFeaturesMap===null)return;for(const[n,r]of this.searchStoreValue.treeDepthFeaturesMap){let i=!0;e:for(const[s,a]of r)for(const o of a)if(!this.localDepthFeatures.get(s).has(o)){i=!1;break e}i?this.selectedTrees.depth.add(n):this.selectedTrees.depth.delete(n)}const e=new Set;for(const n of this.selectedTrees.accuracy)this.selectedTrees.depth.has(n)&&this.selectedTrees.minSample.has(n)&&this.selectedTrees.allFeature.has(n)&&this.selectedTrees.height.has(n)&&e.add(n);this.dataRoot.eachBefore(n=>{const r=n;r.previous={x0:r.x0,x1:r.x1,y0:r.y0,y1:r.y1,data:r.data},n.data.t!==void 0&&(e.has(n.data.t)?n.data.u=!0:n.data.u=!1)}),this.dataRoot=this.dataRoot.sum(n=>n.u!==void 0&&n.u?1:0);const t=z.partition()(this.dataRoot);t.eachAfter(n=>{var r;if(n.data.u!==void 0&&n.data.u)n.uniqueTreeIDs=new Set([n.data.t]);else{const i=new Set;(r=n.children)==null||r.forEach(s=>{var a;(a=s.uniqueTreeIDs)==null||a.forEach(o=>{i.add(o)})}),n.uniqueTreeIDs=i}}),t.each(n=>{var r;n.treeNum=((r=n.uniqueTreeIDs)==null?void 0:r.size)||0,n.uniqueTreeIDs=null}),this.partition=t,this.updateSunburstWithAnimation(),this.searchStoreValue.updatePlots!==null&&this.searchStoreValue.updatePlots(this.selectedTrees,!0)}function nd(){if(this.searchStoreValue.treeDepthFeaturesMap===null)return;for(const[n,r]of this.searchStoreValue.treeDepthFeaturesMap){let i=!0;e:for(const[s,a]of r)for(const o of a)if(!this.localAllFeatures.has(o)){i=!1;break e}i?this.selectedTrees.allFeature.add(n):this.selectedTrees.allFeature.delete(n)}const e=new Set;for(const n of this.selectedTrees.accuracy)this.selectedTrees.depth.has(n)&&this.selectedTrees.minSample.has(n)&&this.selectedTrees.allFeature.has(n)&&this.selectedTrees.height.has(n)&&e.add(n);this.dataRoot.eachBefore(n=>{const r=n;r.previous={x0:r.x0,x1:r.x1,y0:r.y0,y1:r.y1,data:r.data},n.data.t!==void 0&&(e.has(n.data.t)?n.data.u=!0:n.data.u=!1)}),this.dataRoot=this.dataRoot.sum(n=>n.u!==void 0&&n.u?1:0);const t=z.partition()(this.dataRoot);t.eachAfter(n=>{var r;if(n.data.u!==void 0&&n.data.u)n.uniqueTreeIDs=new Set([n.data.t]);else{const i=new Set;(r=n.children)==null||r.forEach(s=>{var a;(a=s.uniqueTreeIDs)==null||a.forEach(o=>{i.add(o)})}),n.uniqueTreeIDs=i}}),t.each(n=>{var r;n.treeNum=((r=n.uniqueTreeIDs)==null?void 0:r.size)||0,n.uniqueTreeIDs=null}),this.partition=t,this.updateSunburstWithAnimation(),this.searchStoreValue.updatePlots!==null&&this.searchStoreValue.updatePlots(this.selectedTrees,!0)}function rd(e=500){const t=this.svg.select(".content-group"),n=z.transition().duration(e).ease(z.easeLinear);this.removeText(),this.arcDomainStack.forEach(i=>{i.x0=i.node.x0,i.x1=i.node.x1}),t.select(".arc-group").selectAll("g.arc").data(this.partition.descendants().slice(1),i=>i.data.nid).select("path").transition(n).tween("data",i=>{const s={x0:i.x0,x1:i.x1,y0:i.y0,y1:i.y1,data:i.data},a=z.interpolate(i.previous,s),o=z.interpolate(this.xScale.domain(),[this.curHeadNode.x0,this.curHeadNode.x1]);return c=>{this.xScale.domain(o(c)),i.previous=a(c)}}).style("display",i=>i.data.f===";"||i.depth>this.sunburstStoreValue.depthHigh+1?"none":(i.value!==void 0&&i.value===0,"initial")).attrTween("d",i=>()=>this.arc(i.previous)).on("end",(i,s,a)=>{const o=z.select(a[s]);let c="initial";i.data.f===";"||i.depth>this.sunburstStoreValue.depthHigh+1||i.value!==void 0&&i.value===0?c="none":c="initial",o.style("display",c)}),Vn!==null&&(window.clearTimeout(Vn),Vn=null),Vn=window.setTimeout(()=>{this.drawCenterText(),this.drawText()},700),this.sunburstUpdated()}function id(){const e=this.svg.select(".content-group");this.removeText(),this.arcDomainStack.forEach(t=>{t.x0=t.node.x0,t.x1=t.node.x1}),this.xScale.domain([this.curHeadNode.x0,this.curHeadNode.x1]),e.select(".arc-group").selectAll("g.arc").data(this.partition.descendants().slice(1),t=>t.data.nid).select("path").attr("d",t=>this.arc(t)).style("display",t=>t.data.f===";"||t.depth>this.sunburstStoreValue.depthHigh+1||t.value!==void 0&&t.value===0?"none":"initial"),Vn!==null&&(window.clearTimeout(Vn),Vn=null),Vn=window.setTimeout(()=>{this.drawCenterText(),this.drawText()},500),this.sunburstUpdated()}const ss=800;var Us,w2,Zs,v2,js,b2,Xs,C2,qs,S2,Js,_2,Qs,x2;class vc{constructor({component:t,data:n,initDepthGap:r=2,sunburstStore:i,treeWindowStore:s,pinnedTreeStore:a,searchStore:o,sunburstUpdated:c}){ye(this,Us);ye(this,Zs);ye(this,js);ye(this,Xs);ye(this,qs);ye(this,Js);ye(this,Qs);N(this,"svg");N(this,"sunburstStore");N(this,"sunburstStoreValue");N(this,"treeWindowStore");N(this,"treeWindowStoreValue");N(this,"pinnedTreeStore");N(this,"pinnedTreeStoreValue");N(this,"searchStore");N(this,"searchStoreValue");N(this,"sunburstUpdated");N(this,"padding");N(this,"width");N(this,"height");N(this,"maxRadius");N(this,"xScale");N(this,"yScale");N(this,"textFontScale");N(this,"data");N(this,"dataRoot");N(this,"treeMapMap");N(this,"partition");N(this,"totalPathNum");N(this,"totalTreeNum");N(this,"featureCount");N(this,"featureValueCount");N(this,"featureOrder");N(this,"arc");N(this,"featureMap");N(this,"colorScale");N(this,"arcDomainStack");N(this,"curHeadNode");N(this,"localAccuracyLow");N(this,"localAccuracyHigh");N(this,"localMinSampleLow");N(this,"localMinSampleHigh");N(this,"localHeightRange");N(this,"localDepthFeatures");N(this,"localAllFeatures");N(this,"viewInitialized",!1);N(this,"selectedTrees");N(this,"textArc",E7);N(this,"doesTextFitArc",z7);N(this,"removeText",Y7);N(this,"drawText",O7);N(this,"drawSecondaryText",G7);N(this,"drawCenterText",W7);N(this,"arcClicked",B7);N(this,"arcMouseenterHandler",U7);N(this,"arcMouseleaveHandler",Z7);N(this,"leafArcClickHandler",J7);N(this,"leafArcMouseenterHandler",j7);N(this,"leafArcMouseleaveHandler",X7);N(this,"getTreeWindowPos",q7);N(this,"tempShowPinnedTree",Q7);N(this,"syncAccuracyRange",K7);N(this,"syncMinSampleRange",$7);N(this,"updateSunburst",id);N(this,"updateSunburstWithAnimation",rd);N(this,"syncHeightRange",ed);N(this,"syncDepthFeatures",td);N(this,"syncAllFeatures",nd);N(this,"getFeatureColor",t=>this.colorScale(this.getFeatureNameValue(t,gr.First,gi.PairString)));this.svg=z.select(t).select("svg").attr("width","100%").attr("height","100%").attr("viewbox","0 0 650 650").attr("preserveAspectRatio","none"),this.padding={top:10,bottom:10,left:10,right:10};const l=this.svg.node().getBoundingClientRect();this.width=l.width-this.padding.left-this.padding.right,this.height=l.height-this.padding.top-this.padding.bottom,this.data=n.trie,this.treeMapMap=new Map,Object.keys(n.treeMap).forEach(u=>{this.treeMapMap.set(+u,n.treeMap[+u])}),this.featureMap=new Map;for(const[u,f]of Object.entries(n.featureMap))this.featureMap.set(parseInt(u),f);this.featureCount=new Map,this.featureValueCount=new Map,this.colorScale=z.scaleOrdinal(),this.featureOrder=[],this.dataRoot=z.hierarchy(this.data,u=>u.c).sum(u=>u.f==="_"?1:0),this.partition=se(this,Us,w2).call(this),this.curHeadNode=this.partition,this.totalTreeNum=this.partition.treeNum,this.totalPathNum=this.partition.value,this.sunburstStore=i,this.sunburstStoreValue=bl(),se(this,js,b2).call(this,r),this.treeWindowStore=s,this.treeWindowStoreValue=Cl(),se(this,Xs,C2).call(this),this.pinnedTreeStore=a,this.pinnedTreeStoreValue=Fr(),se(this,qs,S2).call(this),this.searchStore=o,this.searchStoreValue=Hr(),this.localAccuracyLow=this.searchStoreValue.curAccuracyLow,this.localAccuracyHigh=this.searchStoreValue.curAccuracyHigh,this.localMinSampleLow=this.searchStoreValue.curMinSampleLow,this.localMinSampleHigh=this.searchStoreValue.curMinSampleHigh,this.localHeightRange=new Set([...this.searchStoreValue.curHeightRange]),this.localDepthFeatures=ao(this.searchStoreValue.curDepthFeatures),this.localAllFeatures=new Set([...this.searchStoreValue.curAllFeatures]),this.selectedTrees={accuracy:new Set(this.treeMapMap.keys()),minSample:new Set(this.treeMapMap.keys()),height:new Set(this.treeMapMap.keys()),depth:new Set(this.treeMapMap.keys()),allFeature:new Set(this.treeMapMap.keys())},se(this,Js,_2).call(this),this.sunburstUpdated=c,this.maxRadius=this.width/2,this.xScale=z.scaleLinear().domain([0,1]).range([0,2*Math.PI]).clamp(!0),this.yScale=z.scaleLinear().domain([0,1]).range([0,this.maxRadius]),this.textFontScale=z.scaleLinear().domain([1,this.sunburstStoreValue.depthMax-1]).range([.93,.7]),this.arcDomainStack=[],this.arc=z.arc().startAngle(u=>this.xScale(u.x0)).endAngle(u=>{const f=u;let h=f.x1;return f.x0===f.x1&&(h=f.x0+1e-6),this.xScale(h)}).padAngle(u=>{const f=u,h=this.xScale(u.x1)-this.xScale(u.x0);return f.data.f==="_"?h<.001?0:Math.min(h/2,.015):0}).padRadius(this.radius*1.5).innerRadius(u=>Math.max(0,this.yScale(u.y0))).outerRadius(u=>Math.max(this.yScale(u.y0),this.yScale(u.y1)-1)),console.time("Draw sunburst"),this.initView(),this.viewInitialized=!0,console.timeEnd("Draw sunburst")}get radius(){return this.width/(2*(this.sunburstStoreValue.depthMax-this.sunburstStoreValue.depthLow+1))}getFeatureInfo(t){const n={name:"",value:"",nameValue:"",short:"",shortValue:""},r=parseInt(t);if(!isNaN(r)){const i=this.featureMap.get(r);i!==void 0&&(n.name=i[0],n.value=i[1],n.short=i[2],n.nameValue=`${n.name} ${n.value}`,n.shortValue=`${n.short} ${n.value}`)}return n}getFeatureNameValue(t,n=gr.First,r=gi.PairArray){let i=-1;if(t.includes(" "))switch(n){case gr.First:i=+t.replace(/(.*)\s.*/,"$1");break;case gr.Second:i=+t.replace(/.*\s(.*)/,"$1");break;case gr.Both:i=+t.replace(/(.*)\s.*/,"$1");break;default:console.error("Unknown cases")}else i=+t;switch(r){case gi.PairArray:return isNaN(i)?["",""]:this.featureMap.get(i);case gi.PairString:{if(isNaN(i))return"";const s=this.featureMap.get(i);return s!==void 0?`${s[0]}:${s[1]}`:(console.error(`Encounter unrecorded key ${i}`),"")}}}initView(){const t=this.svg.append("g").attr("class","content-group").attr("transform",`translate(${this.padding.left+this.width/2}, ${this.padding.top+this.height/2})`);t.append("g").attr("class","mid-circle-group");const n=t.append("g").attr("class","arc-group");t.append("g").attr("class","text-group");const r=n.selectAll("g.arc").data(this.partition.descendants().slice(1),a=>a.data.nid).join("g").attr("class",a=>`arc arc-${a.depth} ${a.data.f==="_"?"leaf leaf-".concat(String(a.data.t)):""}`).classed("leaf",a=>a.data.f==="_");r.append("path").attr("class","arc").attr("class",a=>`arc arc-${a.depth} ${a.data.f==="_"?"leaf leaf-".concat(String(a.data.t)):""}`).attr("id",a=>`arc-${a.data.nid}`).attr("d",a=>this.arc(a)).on("click",(a,o)=>this.arcClicked(a,o)).on("mouseenter",(a,o)=>this.arcMouseenterHandler(a,o)).on("mouseleave",(a,o)=>this.arcMouseleaveHandler(a,o)).style("fill",a=>a.data.f==="_"?"null":this.getFeatureColor(a.data.f)).style("display",a=>a.data.f===";"||a.depth>this.sunburstStoreValue.depthHigh+1?"none":"initial").filter(a=>a.data.f==="_").on("click",(a,o)=>this.leafArcClickHandler(a,o)).on("mouseenter",(a,o)=>this.leafArcMouseenterHandler(a,o)).on("mouseleave",(a,o)=>this.leafArcMouseleaveHandler(a,o)),r.append("title").text(a=>this.getFeatureInfo(a.data.f).nameValue);const s=1/(this.sunburstStoreValue.depthMax+1);this.arcZoom({x0:this.xScale.domain()[0],x1:this.xScale.domain()[1],y0:0,y1:(this.sunburstStoreValue.depthHigh+1)*s},500)}arcZoom(t,n=ss){this.removeText(),se(this,Qs,x2).call(this,t),this.svg.select(".arc-group").transition().duration(n).ease(z.easeCubicInOut).tween("zoom",()=>{const i=z.interpolate(this.xScale.domain(),[t.x0,t.x1]),s=z.interpolate(this.yScale.domain(),[t.y0,t.y1]);return a=>{this.xScale.domain(i(a)),this.yScale.domain(s(a))}}).on("end",()=>{this.drawText(),this.drawCenterText()}).selectAll(".arc").attrTween("d",i=>()=>this.arc(i)).style("fill-opacity",i=>i.depth>this.sunburstStoreValue.depthHigh?.2:1).style("pointer-events",i=>i.depth>this.sunburstStoreValue.depthHigh?"none":"initial").style("display",i=>{const s=i;return s.data.f===";"||s.depth>this.sunburstStoreValue.depthHigh+1?"none":"initial"})}}Us=new WeakSet,w2=function(){let t=0;this.dataRoot.eachBefore(r=>{r.data.f==="_"&&(r.data.u=!0),r.data.nid=t++});for(const[r,i]of this.featureMap){if(this.featureValueCount.has(i[0]))this.featureValueCount.get(i[0]).set(i[1],0);else{const s=new Map;s.set(i[1],0),this.featureValueCount.set(i[0],s)}this.featureCount.has(i[0])||this.featureCount.set(i[0],0)}this.dataRoot.children.forEach(r=>{const[i,s]=this.getFeatureNameValue(r.data.f);this.featureCount.set(i,this.featureCount.get(i)+r.value),this.featureValueCount.get(i).set(s,this.featureValueCount.get(i).get(s)+r.value)}),this.featureCount.set("",0),this.colorScale=se(this,Zs,v2).call(this),this.dataRoot=this.dataRoot.sort((r,i)=>{const s=this.getFeatureInfo(r.data.f).name,a=this.getFeatureInfo(i.data.f).name,o=this.featureCount.get(s),c=this.featureCount.get(a),l=z.lch(this.getFeatureColor(r.data.f)).l,u=z.lch(this.getFeatureColor(i.data.f)).l;return o!==void 0&&c!==void 0?c-o||s.localeCompare(a)||l-u:(console.warn(`Encountered unrecorded keys '${s}', '${a}'`),0)}),this.featureOrder=this.dataRoot.children.map(r=>parseInt(r.data.f)),this.featureMap.forEach((r,i)=>{if(!this.featureOrder.includes(i)){const s=[];this.featureMap.forEach((a,o)=>{a[0]===r[0]&&this.featureOrder.indexOf(o)!==-1&&s.push(this.featureOrder.indexOf(o))}),this.featureOrder.splice(Math.max(...s)+1,0,i)}});const n=z.partition()(this.dataRoot);return n.eachAfter(r=>{var i;if(r.data.f==="_")r.uniqueTreeIDs=new Set([r.data.t]);else{const s=new Set;(i=r.children)==null||i.forEach(a=>{var o;(o=a.uniqueTreeIDs)==null||o.forEach(c=>{s.add(c)})}),r.uniqueTreeIDs=s}}),n.each(r=>{var i;r.treeNum=((i=r.uniqueTreeIDs)==null?void 0:i.size)||0,r.uniqueTreeIDs=null}),n},Zs=new WeakSet,v2=function(){const t=[],n=[],s=[z.lch(49.184,30.07,260.445),z.lch(68.968,73.064,62.176),z.lch(56.278,61.87,27.615),z.lch(60.11,50.293,135.863),z.lch(82.442,65.798,87.008),z.lch(69.948,22.911,191.071),z.lch(57.703,28.677,334.556),z.lch(52.777,22.881,53.64)],a=new Map;for(const[l,u]of s.entries())a.set(l,[0,u]);return Array.from(this.featureCount.keys()).filter(l=>l!=="").sort((l,u)=>this.featureCount.get(u)-this.featureCount.get(l)).forEach((l,u)=>{let f,h;if(u>7){console.warn("Number of feature is greater than 8:",l);let v=-1,S=1/0;for(let b=0;bthis.featureValueCount.get(l).get(S)-this.featureValueCount.get(l).get(v)),g=p.length;let d=f;if(f.l+g*20<=92)p.forEach((v,S)=>{const b=`${l}:${v}`;d=z.lch(f.l+S*20,f.c,f.h),t.push(b),n.push(d.formatHsl())});else{const v=(92-f.l)/g;p.forEach((S,b)=>{const _=`${l}:${S}`;d=z.lch(f.l+b*v,f.c,f.h),t.push(_),n.push(d.formatHsl())})}const m=z.lch(d.l+10,d.c,d.h);a.set(h,[a.get(h)[0]+g,m])}),z.scaleOrdinal(n).domain(t)},js=new WeakSet,b2=function(t){this.sunburstStore.subscribe(n=>{switch(this.sunburstStoreValue=n,this.sunburstStoreValue.action){case Qn.DepthChanged:{this.sunburstStoreValue.action=Qn.None;const r=1/(this.sunburstStoreValue.depthMax+1),i=this.arcDomainStack.length>0?this.yScale.domain()[0]:0;this.arcZoom({x0:this.xScale.domain()[0],x1:this.xScale.domain()[1],y0:i,y1:(this.sunburstStoreValue.depthHigh+1)*r},500),this.sunburstStore.set(this.sunburstStoreValue);break}case Qn.None:break;default:console.error("Unknown case in sunburstStore action")}}),this.sunburstStoreValue.depthMax=this.partition.height,this.sunburstStoreValue.depthLow=1,this.sunburstStoreValue.depthHigh=this.sunburstStoreValue.depthLow+t,this.sunburstStoreValue.action=Qn.None,this.sunburstStoreValue.depthColors=new Array(this.sunburstStoreValue.depthMax).fill(""),this.sunburstStore.set(this.sunburstStoreValue)},Xs=new WeakSet,C2=function(){this.treeWindowStore.subscribe(t=>{this.treeWindowStoreValue=t}),this.treeWindowStoreValue.getFeatureColor=this.getFeatureColor,this.treeWindowStore.set(this.treeWindowStoreValue)},qs=new WeakSet,S2=function(){this.pinnedTreeStore.subscribe(t=>{this.pinnedTreeStoreValue=t}),this.pinnedTreeStoreValue.getFeatureColor=this.getFeatureColor,this.pinnedTreeStoreValue.getFeatureInfo=t=>this.getFeatureInfo(t),this.pinnedTreeStore.set(this.pinnedTreeStoreValue)},Js=new WeakSet,_2=function(){this.searchStore.subscribe(n=>{this.searchStoreValue=n,this.viewInitialized&&this.searchStoreValue.shown&&(this.searchStoreValue.curAccuracyHigh!==this.localAccuracyHigh||this.searchStoreValue.curAccuracyLow!==this.localAccuracyLow)?(this.localAccuracyHigh=this.searchStoreValue.curAccuracyHigh,this.localAccuracyLow=this.searchStoreValue.curAccuracyLow,this.syncAccuracyRange()):(this.localAccuracyHigh=this.searchStoreValue.curAccuracyHigh,this.localAccuracyLow=this.searchStoreValue.curAccuracyLow),this.viewInitialized&&this.searchStoreValue.shown&&(this.searchStoreValue.curMinSampleHigh!==this.localMinSampleHigh||this.searchStoreValue.curMinSampleLow!==this.localMinSampleLow)?(this.localMinSampleHigh=this.searchStoreValue.curMinSampleHigh,this.localMinSampleLow=this.searchStoreValue.curMinSampleLow,this.syncMinSampleRange()):(this.localMinSampleHigh=this.searchStoreValue.curMinSampleHigh,this.localMinSampleLow=this.searchStoreValue.curMinSampleLow);const r=[...this.localHeightRange].every(a=>this.searchStoreValue.curHeightRange.has(a))&&this.localHeightRange.size===this.searchStoreValue.curHeightRange.size;this.viewInitialized&&this.searchStoreValue.shown&&!r?(this.localHeightRange=new Set([...this.searchStoreValue.curHeightRange]),this.syncHeightRange()):this.localHeightRange=new Set([...this.searchStoreValue.curHeightRange]);const i=[...this.searchStoreValue.curDepthFeatures.entries()].every(a=>this.localDepthFeatures.has(a[0])?gc(this.localDepthFeatures.get(a[0]),a[1]):!1);this.viewInitialized&&this.searchStoreValue.shown&&!i?(this.localDepthFeatures=ao(this.searchStoreValue.curDepthFeatures),this.syncDepthFeatures()):this.localDepthFeatures=ao(this.searchStoreValue.curDepthFeatures);const s=gc(this.localAllFeatures,this.searchStoreValue.curAllFeatures);this.viewInitialized&&this.searchStoreValue.shown&&!s?(this.localAllFeatures=new Set([...this.searchStoreValue.curAllFeatures]),this.syncAllFeatures()):this.localAllFeatures=new Set([...this.searchStoreValue.curAllFeatures])}),this.searchStoreValue.getFeatureColor=this.getFeatureColor,this.searchStoreValue.featureMap=this.featureMap,this.searchStoreValue.featureOrder=this.featureOrder;for(let n=1;ni));this.searchStoreValue.curDepthFeatures.set(n,r)}const t=new Set([...this.featureMap.keys()].map(n=>n));this.searchStoreValue.curAllFeatures=t,this.searchStore.set(this.searchStoreValue)},Qs=new WeakSet,x2=function(t){let n=!1;this.arcDomainStack.length>0&&(n=this.curHeadNode.depth-this.arcDomainStack[this.arcDomainStack.length-1].node.depth!==1);const r=this.svg.select("g.content-group").selectAll("g.mid-circle-group").data([0]).join("g").attr("class","mid-circle-group").raise(),i=this.curHeadNode.ancestors().filter(u=>u.depth!==0),s=z.scaleLinear().domain([t.y0,t.y1]).range([0,this.maxRadius]),a=s(this.curHeadNode.y1)-s(this.curHeadNode.y0),o=i.map(u=>u.depth),c=z.scaleLinear().domain([z.min(o)-1,z.max(o)]).range([0,a]),l=c(1);r.selectAll("g.mid-circle").data(i,u=>u.value).join(u=>{const f=u.append("g").attr("class","mid-circle").on("click",h=>this.arcClicked(h,null));return f.append("circle").attr("r",0).style("fill",h=>this.getFeatureColor(h.data.f)).call(h=>h.transition().duration(0).delay(n?ss-100:ss+100).attr("r",p=>c(p.depth))),f.append("path").attr("class","mid-circle-text-arc").attr("id",h=>`mid-circle-text-arc-${h.depth}`).attr("d",h=>{const p=[Math.PI*.5,Math.PI*2.5],g=l*(h.depth-.5),d=z.path();return d.arc(0,0,g,p[0],p[1],!1),d.toString()}),f.append("title").text(h=>this.getFeatureInfo(h.data.f).nameValue),f},u=>{const f=u;return f.select("circle").transition("zoom").duration(ss).ease(z.easeCubicInOut).attr("r",h=>c(h.depth)),f.select("path").attr("d",h=>{const p=[Math.PI*.5,Math.PI*2.5],g=l*(h.depth-.5),d=z.path();return d.arc(0,0,g,p[0],p[1],!1),d.toString()}),f})};const ao=e=>{const t=new Map;return e.forEach((n,r)=>{t.set(r,new Set([...n]))}),t};const kn="src/components/sunburst/Sunburst.svelte";function Do(e){var k,H,I,M,V,E,F,R,A,C;let t,n,r,i,s,a,o,c,l,u,f=((k=e[1])==null?void 0:k.curHeadNode.value)===((H=e[1])==null?void 0:H.totalPathNum)?`${((I=e[1])==null?void 0:I.curHeadNode.value)|0}`:`${((M=e[1])==null?void 0:M.curHeadNode.value)|0}/${(V=e[1])==null?void 0:V.totalPathNum}`,h,p,g,d,m=((E=e[1])==null?void 0:E.curHeadNode.treeNum)===((F=e[1])==null?void 0:F.totalTreeNum)?`${((R=e[1])==null?void 0:R.curHeadNode.treeNum)|0}`:`${((A=e[1])==null?void 0:A.curHeadNode.treeNum)|0}/${(C=e[1])==null?void 0:C.totalTreeNum}`,v,S,b;const _={c:function(){var D,P,G;t=L("div"),n=L("div"),r=L("span"),r.textContent="No tree meets the current constraints :(",i=W(),s=L("span"),s.textContent="Try to relax the filtering in the Search Panel",a=W(),o=Dn("svg"),c=W(),l=L("div"),u=L("span"),h=ce(f),p=ce(" paths"),g=W(),d=L("span"),v=ce(m),S=ce(" trees"),w(r,"class","s-_PkX202GTJ8Y"),x(r,kn,162,4,3664),w(s,"class","s-_PkX202GTJ8Y"),x(s,kn,165,4,3738),w(n,"class","no-tree-message s-_PkX202GTJ8Y"),ge(n,"show",((D=e[1])==null?void 0:D.curHeadNode.treeNum)===0),x(n,kn,161,2,3581),w(o,"class","sunburst-svg s-_PkX202GTJ8Y"),x(o,kn,169,2,3825),w(u,"class","tree-stat s-_PkX202GTJ8Y"),x(u,kn,176,4,4066),w(d,"class","tree-stat s-_PkX202GTJ8Y"),x(d,kn,181,4,4296),w(l,"class","stat-overlay s-_PkX202GTJ8Y"),w(l,"title",b=`There are ${(P=e[1])==null?void 0:P.curHeadNode.value} decision paths `.concat(`and ${(G=e[1])==null?void 0:G.curHeadNode.treeNum} decisions trees in the current selection.`)),x(l,kn,170,2,3856),w(t,"class","sunburst s-_PkX202GTJ8Y"),x(t,kn,160,0,3534)},l:function(D){throw new Error("options.hydrate only works if the component was compiled with the `hydratable: true` option")},m:function(D,P){ae(D,t,P),y(t,n),y(n,r),y(n,i),y(n,s),y(t,a),y(t,o),y(t,c),y(t,l),y(l,u),y(u,h),y(u,p),y(l,g),y(l,d),y(d,v),y(d,S),e[9](t)},p:function(D,[P]){var G,Y,U,X,J,me,K,Q,B,ie,fe,j,$;P&2&&ge(n,"show",((G=D[1])==null?void 0:G.curHeadNode.treeNum)===0),P&2&&f!==(f=((Y=D[1])==null?void 0:Y.curHeadNode.value)===((U=D[1])==null?void 0:U.totalPathNum)?`${((X=D[1])==null?void 0:X.curHeadNode.value)|0}`:`${((J=D[1])==null?void 0:J.curHeadNode.value)|0}/${(me=D[1])==null?void 0:me.totalPathNum}`)&&Ee(h,f),P&2&&m!==(m=((K=D[1])==null?void 0:K.curHeadNode.treeNum)===((Q=D[1])==null?void 0:Q.totalTreeNum)?`${((B=D[1])==null?void 0:B.curHeadNode.treeNum)|0}`:`${((ie=D[1])==null?void 0:ie.curHeadNode.treeNum)|0}/${(fe=D[1])==null?void 0:fe.totalTreeNum}`)&&Ee(v,m),P&2&&b!==(b=`There are ${(j=D[1])==null?void 0:j.curHeadNode.value} decision paths `.concat(`and ${($=D[1])==null?void 0:$.curHeadNode.treeNum} decisions trees in the current selection.`))&&w(l,"title",b)},i:pe,o:pe,d:function(D){D&&ee(t),e[9](null)}};return te("SvelteRegisterBlock",{block:_,id:Do.name,type:"component",source:"",ctx:e}),_}function sd(e,t,n){let{$$slots:r={},$$scope:i}=t;St("Sunburst",r,[]);let{data:s=null}=t,{sunburstStore:a=null}=t,{treeWindowStore:o=null}=t,{pinnedTreeStore:c=null}=t,{searchStore:l=null}=t,{initDepthGap:u=2}=t,f=null,h=!1,p=null;const g=()=>{n(1,p)};Ne(()=>{n(8,h=!0)});const d=()=>{f&&s&&a&&o&&l&&c&&n(1,p=new vc({component:f,data:s,initDepthGap:u,sunburstStore:a,treeWindowStore:o,pinnedTreeStore:c,searchStore:l,sunburstUpdated:g}))},m=["data","sunburstStore","treeWindowStore","pinnedTreeStore","searchStore","initDepthGap"];Object.keys(t).forEach(S=>{!~m.indexOf(S)&&S.slice(0,2)!=="$$"&&S!=="slot"&&console.warn(` was created with unknown prop '${S}'`)});function v(S){Je[S?"unshift":"push"](()=>{f=S,n(0,f)})}return e.$$set=S=>{"data"in S&&n(2,s=S.data),"sunburstStore"in S&&n(3,a=S.sunburstStore),"treeWindowStore"in S&&n(4,o=S.treeWindowStore),"pinnedTreeStore"in S&&n(5,c=S.pinnedTreeStore),"searchStore"in S&&n(6,l=S.searchStore),"initDepthGap"in S&&n(7,u=S.initDepthGap)},e.$capture_state=()=>({Sunburst:vc,onMount:Ne,config:Te,data:s,sunburstStore:a,treeWindowStore:o,pinnedTreeStore:c,searchStore:l,initDepthGap:u,component:f,mounted:h,sunburst:p,sunburstUpdated:g,initView:d}),e.$inject_state=S=>{"data"in S&&n(2,s=S.data),"sunburstStore"in S&&n(3,a=S.sunburstStore),"treeWindowStore"in S&&n(4,o=S.treeWindowStore),"pinnedTreeStore"in S&&n(5,c=S.pinnedTreeStore),"searchStore"in S&&n(6,l=S.searchStore),"initDepthGap"in S&&n(7,u=S.initDepthGap),"component"in S&&n(0,f=S.component),"mounted"in S&&n(8,h=S.mounted),"sunburst"in S&&n(1,p=S.sunburst)},t&&"$$inject"in t&&e.$inject_state(t.$$inject),e.$$.update=()=>{e.$$.dirty&381&&s&&a&&o&&c&&l&&h&&f&&d()},[f,p,s,a,o,c,l,u,h,v]}class L2 extends _t{constructor(t){super(t),Ct(this,t,sd,Do,tt,{data:2,sunburstStore:3,treeWindowStore:4,pinnedTreeStore:5,searchStore:6,initDepthGap:7}),te("SvelteRegisterComponent",{component:this,tagName:"Sunburst_1",options:t,id:Do.name})}get data(){throw new Error(": Props cannot be read directly from the component instance unless compiling with 'accessors: true' or ''")}set data(t){throw new Error(": Props cannot be set directly on the component instance unless compiling with 'accessors: true' or ''")}get sunburstStore(){throw new Error(": Props cannot be read directly from the component instance unless compiling with 'accessors: true' or ''")}set sunburstStore(t){throw new Error(": Props cannot be set directly on the component instance unless compiling with 'accessors: true' or ''")}get treeWindowStore(){throw new Error(": Props cannot be read directly from the component instance unless compiling with 'accessors: true' or ''")}set treeWindowStore(t){throw new Error(": Props cannot be set directly on the component instance unless compiling with 'accessors: true' or ''")}get pinnedTreeStore(){throw new Error(": Props cannot be read directly from the component instance unless compiling with 'accessors: true' or ''")}set pinnedTreeStore(t){throw new Error(": Props cannot be set directly on the component instance unless compiling with 'accessors: true' or ''")}get searchStore(){throw new Error(": Props cannot be read directly from the component instance unless compiling with 'accessors: true' or ''")}set searchStore(t){throw new Error(": Props cannot be set directly on the component instance unless compiling with 'accessors: true' or ''")}get initDepthGap(){throw new Error(": Props cannot be read directly from the component instance unless compiling with 'accessors: true' or ''")}set initDepthGap(t){throw new Error(": Props cannot be set directly on the component instance unless compiling with 'accessors: true' or ''")}}var Ks,k2,$s,T2,ea,M2;class bc{constructor({component:t,treeMapMap:n,featureMap:r,treeWindowStore:i,treeWindowUpdated:s,width:a=150,height:o=150}){ye(this,Ks);ye(this,$s);ye(this,ea);N(this,"treeMap");N(this,"curTreeID");N(this,"curAncestorFs");N(this,"treeWindowStore");N(this,"treeWindowStoreValue");N(this,"treeWindowUpdated");N(this,"svg");N(this,"padding");N(this,"width");N(this,"height");N(this,"getStyle",()=>`left: ${this.treeWindowStoreValue.x}px; - top: ${this.treeWindowStoreValue.y}px;`);N(this,"shouldHidePinLabel",()=>localStorage.getItem("treeWindowPinnedOnce")===null?(localStorage.setItem("treeWindowPinnedOnce","false"),!1):localStorage.getItem("treeWindowPinnedOnce")==="true");this.treeMap=n,this.curTreeID=0,this.curAncestorFs=[],this.treeWindowUpdated=s,this.treeWindowStore=i,this.treeWindowStoreValue=Cl(),se(this,Ks,k2).call(this,r),this.svg=z.select(t).select("svg.tree-svg").attr("width",a).attr("height",o).attr("viewbox",`0 0 ${a} ${o}`).attr("preserveAspectRatio","none"),this.padding={top:20,bottom:20,left:0,right:0},this.width=a-this.padding.left-this.padding.right,this.height=o-this.padding.top-this.padding.bottom}get tree(){const t=this.treeMap.get(this.curTreeID);return t!==void 0?t[0]:(console.warn(`No such tree on the record ${this.curTreeID}`),null)}get treeMetric(){const t=this.treeMap.get(this.curTreeID);return t!==void 0?Gr(t[2],4):null}}Ks=new WeakSet,k2=function(t){this.treeWindowStore.subscribe(n=>{this.treeWindowStoreValue=n,this.svg!==void 0&&(this.treeWindowStoreValue.treeID!==this.curTreeID||this.treeWindowStoreValue.ancestorFs.length!==this.curAncestorFs.length||!this.treeWindowStoreValue.ancestorFs.every((r,i)=>r===this.curAncestorFs[i]))&&this.treeMap.get(this.treeWindowStoreValue.treeID)&&(this.curTreeID=this.treeWindowStoreValue.treeID,this.curAncestorFs=[...this.treeWindowStoreValue.ancestorFs],se(this,$s,T2).call(this)),this.treeWindowUpdated()}),this.treeWindowStoreValue.featureMap=t,this.treeWindowStoreValue.treeMap=this.treeMap,this.treeWindowStore.set(this.treeWindowStoreValue)},$s=new WeakSet,T2=function(){this.svg.selectAll("g.content").remove(),se(this,ea,M2).call(this)},ea=new WeakSet,M2=function(){if(this.tree===null){console.warn("Trying to draw a tree that does not exist");return}const t=this.svg.append("g").attr("class","content").attr("transform",`translate(${this.padding.left}, ${this.padding.top})`),n=z.hierarchy(this.tree,d=>d.c),r=7,i=r*1,s=z.tree().size([this.width,this.height])(n),a=t.append("g").attr("class","link-group");a.selectAll("path.link").data(s.links()).join("path").attr("class",d=>`link link-${d.source.data.f[0]}`).attr("id",d=>{const m=d.source.ancestors().length>1?d.source.ancestors()[1].data.f[0]:"r",v=d.source.data.f[0],S=d.target.data.f[0];return d.target.data.f[0]==="+"?`link-${m}-${v}-p`:d.target.data.f[0]==="-"?`link-${m}-${v}-n`:`link-${m}-${v}-${S}`}).attr("d",d=>z.line()([[d.source.x,d.source.y],[d.target.x,d.target.y]]));const c=t.append("g").attr("class","node-group").selectAll("g").data(s.descendants()).join("g").attr("class","node").attr("transform",d=>`translate(${d.x}, ${d.y})`),l=new Set(["-","+"]);c.filter(d=>!l.has(d.data.f[0])).append("circle").attr("r",r).style("fill",d=>this.treeWindowStoreValue.getFeatureColor?this.treeWindowStoreValue.getFeatureColor(d.data.f[0]):Te.colors["gray-500"]),c.filter(d=>l.has(d.data.f[0])).append("rect").attr("x",-i).attr("y",-i).attr("rx",2).attr("ry",2).attr("width",2*i).attr("height",2*i),c.filter(d=>l.has(d.data.f[0])).append("text").attr("dy",.5).text(d=>d.data.f[0]);for(let d=0;dm===0).attr("x",d=>d.x).attr("y",d=>d.y).text((d,m)=>m===0?"true":"false")};const A2='';const{Object:ad}=vl,Zt="src/components/tree-window/TreeWindow.svelte";function No(e){var M,V;let t,n,r,i,s=((M=e[1])==null?void 0:M.treeWindowStoreValue.treeID)+"",a,o,c,l,u=((V=e[1])==null?void 0:V.treeMetric)+"",f,h,p,g,d,m,v,S,b,_,k,H;const I={c:function(){var F,R,A;t=L("div"),n=L("div"),r=L("span"),i=ce("Tree "),a=ce(s),o=W(),c=L("span"),l=ce("("),f=ce(u),h=ce(")"),p=W(),g=L("div"),d=L("div"),m=L("div"),v=L("div"),S=W(),b=L("span"),b.textContent="pin",_=W(),k=Dn("svg"),w(r,"class","tree-name s-cr5gyj4Gsmo-"),x(r,Zt,173,4,3681),w(c,"class","tree-acc s-cr5gyj4Gsmo-"),x(c,Zt,177,4,3776),w(n,"class","tree-header s-cr5gyj4Gsmo-"),x(n,Zt,172,2,3651),w(v,"class","svg-icon s-cr5gyj4Gsmo-"),x(v,Zt,186,8,4006),w(b,"class","s-cr5gyj4Gsmo-"),x(b,Zt,189,8,4080),w(m,"class","label s-cr5gyj4Gsmo-"),x(m,Zt,185,6,3978),w(d,"class","label-container s-cr5gyj4Gsmo-"),ge(d,"no-display",(F=e[1])==null?void 0:F.shouldHidePinLabel()),x(d,Zt,181,4,3873),w(k,"class","tree-svg s-cr5gyj4Gsmo-"),x(k,Zt,193,4,4126),w(g,"class","content s-cr5gyj4Gsmo-"),x(g,Zt,180,2,3847),w(t,"class","tree-window s-cr5gyj4Gsmo-"),w(t,"style",H=(R=e[1])==null?void 0:R.getStyle()),ge(t,"show",(A=e[1])==null?void 0:A.treeWindowStoreValue.show),x(t,Zt,166,0,3510)},l:function(F){throw new Error("options.hydrate only works if the component was compiled with the `hydratable: true` option")},m:function(F,R){ae(F,t,R),y(t,n),y(n,r),y(r,i),y(r,a),y(n,o),y(n,c),y(c,l),y(c,f),y(c,h),y(t,p),y(t,g),y(g,d),y(d,m),y(m,v),v.innerHTML=A2,y(m,S),y(m,b),y(g,_),y(g,k),e[6](t)},p:function(F,[R]){var A,C,T,D,P;R&2&&s!==(s=((A=F[1])==null?void 0:A.treeWindowStoreValue.treeID)+"")&&Ee(a,s),R&2&&u!==(u=((C=F[1])==null?void 0:C.treeMetric)+"")&&Ee(f,u),R&2&&ge(d,"no-display",(T=F[1])==null?void 0:T.shouldHidePinLabel()),R&2&&H!==(H=(D=F[1])==null?void 0:D.getStyle())&&w(t,"style",H),R&2&&ge(t,"show",(P=F[1])==null?void 0:P.treeWindowStoreValue.show)},i:pe,o:pe,d:function(F){F&&ee(t),e[6](null)}};return te("SvelteRegisterBlock",{block:I,id:No.name,type:"component",source:"",ctx:e}),I}function od(e,t,n){let{$$slots:r={},$$scope:i}=t;St("TreeWindow",r,[]);let{data:s=null}=t,{featureMap:a=null}=t,{treeWindowStore:o=null}=t,c=null,l=!1,u=null;Ne(()=>{n(5,l=!0)});const f=()=>{n(1,u)},h=()=>{if(c&&s&&a&&o){const d=s.treeMap,m=new Map;Object.keys(d).forEach(v=>{m.set(+v,d[+v])}),n(1,u=new bc({component:c,treeMapMap:m,featureMap:a,treeWindowStore:o,treeWindowUpdated:f}))}},p=["data","featureMap","treeWindowStore"];ad.keys(t).forEach(d=>{!~p.indexOf(d)&&d.slice(0,2)!=="$$"&&d!=="slot"&&console.warn(` was created with unknown prop '${d}'`)});function g(d){Je[d?"unshift":"push"](()=>{c=d,n(0,c)})}return e.$$set=d=>{"data"in d&&n(2,s=d.data),"featureMap"in d&&n(3,a=d.featureMap),"treeWindowStore"in d&&n(4,o=d.treeWindowStore)},e.$capture_state=()=>({onMount:Ne,TreeWindow:bc,iconClick:A2,data:s,featureMap:a,treeWindowStore:o,component:c,mounted:l,treeWindow:u,treeWindowUpdated:f,initView:h}),e.$inject_state=d=>{"data"in d&&n(2,s=d.data),"featureMap"in d&&n(3,a=d.featureMap),"treeWindowStore"in d&&n(4,o=d.treeWindowStore),"component"in d&&n(0,c=d.component),"mounted"in d&&n(5,l=d.mounted),"treeWindow"in d&&n(1,u=d.treeWindow)},t&&"$$inject"in t&&e.$inject_state(t.$$inject),e.$$.update=()=>{e.$$.dirty&61&&s&&a&&o&&l&&c&&h()},[c,u,s,a,o,l,g]}class V2 extends _t{constructor(t){super(t),Ct(this,t,od,No,tt,{data:2,featureMap:3,treeWindowStore:4}),te("SvelteRegisterComponent",{component:this,tagName:"TreeWindow_1",options:t,id:No.name})}get data(){throw new Error(": Props cannot be read directly from the component instance unless compiling with 'accessors: true' or ''")}set data(t){throw new Error(": Props cannot be set directly on the component instance unless compiling with 'accessors: true' or ''")}get featureMap(){throw new Error(": Props cannot be read directly from the component instance unless compiling with 'accessors: true' or ''")}set featureMap(t){throw new Error(": Props cannot be set directly on the component instance unless compiling with 'accessors: true' or ''")}get treeWindowStore(){throw new Error(": Props cannot be read directly from the component instance unless compiling with 'accessors: true' or ''")}set treeWindowStore(t){throw new Error(": Props cannot be set directly on the component instance unless compiling with 'accessors: true' or ''")}}const wt=8;var on,qn,ta,D2,Vi,Ho,na,N2,Di,ra,H2,Ni,Fo,ia,F2,sa,P2,aa,R2;class Cc{constructor({component:t,pinnedTree:n,pinnedTreeStore:r,favoritesStore:i,pinnedTreeWindowUpdated:s,initSwitchChecked:a,width:o=200,height:c=200}){ye(this,on);ye(this,ta);ye(this,Vi);ye(this,na);ye(this,ra);ye(this,Ni);ye(this,ia);ye(this,sa);ye(this,aa);N(this,"pinnedTree");N(this,"pinnedTreeWindowUpdated");N(this,"svg");N(this,"padding");N(this,"width");N(this,"height");N(this,"dragRegion");N(this,"pinnedTreeStore");N(this,"pinnedTreeStoreValue");N(this,"pinnedTreeStoreUnsubscriber");N(this,"favoritesStore");N(this,"favoritesStoreValue");N(this,"favoritesStoreUnsubscriber");N(this,"sankey");N(this,"accuracyScale",null);N(this,"hidden",!0);N(this,"endPos");N(this,"node");N(this,"playLaunchingAnimation",()=>{const t=this.pinnedTree.startPos.width/this.endPos.width,n=this.pinnedTree.startPos.height/this.endPos.height,r=this.pinnedTree.startPos.x-this.endPos.x,i=this.pinnedTree.startPos.y-this.endPos.y;this.node.animate([{transformOrigin:"top left",opacity:0,transform:` +`;const Ke="src/components/toolbar/Toolbar.svelte";function mc(e,t,n){const r=e.slice();return r[13]=t[n],r}function yc(e,t,n){const r=e.slice();return r[13]=t[n],r}function To(e){let t;const n={c:function(){var i,s;t=L("div"),w(t,"class","depth-line s-JBVBfphpN2RX"),ge(t,"in-range",e[13]+2<=((i=e[2])==null?void 0:i.sunburstStoreValue.depthHigh)&&e[13]+2>((s=e[2])==null?void 0:s.sunburstStoreValue.depthLow)),x(t,Ke,223,10,5195)},m:function(i,s){ae(i,t,s)},p:function(i,s){var a,o;s&4&&ge(t,"in-range",i[13]+2<=((a=i[2])==null?void 0:a.sunburstStoreValue.depthHigh)&&i[13]+2>((o=i[2])==null?void 0:o.sunburstStoreValue.depthLow))},d:function(i){i&&ne(t)}};return ee("SvelteRegisterBlock",{block:n,id:To.name,type:"each",source:"(223:8) {#each [...Array(Math.max(handler?.sunburstStoreValue.depthMax - 1, 0)).keys()] as i}",ctx:e}),n}function Mo(e){let t,n=e[13]+1+"",r,i,s,a,o;function c(){return e[6](e[13])}const l={c:function(){var f,h,p,g;t=L("div"),r=ce(n),i=W(),w(t,"class","depth-box s-JBVBfphpN2RX"),w(t,"style",s=(f=e[2])==null?void 0:f.getDepthBoxStyle(e[13]+1)),ge(t,"in-range",e[13]+1<=((h=e[2])==null?void 0:h.sunburstStoreValue.depthHigh)&&e[13]+1>=((p=e[2])==null?void 0:p.sunburstStoreValue.depthLow)),ge(t,"no-hover",e[13]+1===((g=e[2])==null?void 0:g.sunburstStoreValue.depthHigh)),x(t,Ke,232,8,5495)},m:function(f,h){ae(f,t,h),y(t,r),y(t,i),a||(o=he(t,"click",c,!1,!1,!1),a=!0)},p:function(f,h){var p,g,d,m;e=f,h&4&&n!==(n=e[13]+1+"")&&Ee(r,n),h&4&&s!==(s=(p=e[2])==null?void 0:p.getDepthBoxStyle(e[13]+1))&&w(t,"style",s),h&4&&ge(t,"in-range",e[13]+1<=((g=e[2])==null?void 0:g.sunburstStoreValue.depthHigh)&&e[13]+1>=((d=e[2])==null?void 0:d.sunburstStoreValue.depthLow)),h&4&&ge(t,"no-hover",e[13]+1===((m=e[2])==null?void 0:m.sunburstStoreValue.depthHigh))},d:function(f){f&&ne(t),a=!1,o()}};return ee("SvelteRegisterBlock",{block:l,id:Mo.name,type:"each",source:"(232:6) {#each [...Array(handler?.sunburstStoreValue.depthMax).keys()] as i}",ctx:e}),l}function Ao(e){var T,D;let t,n,r,i=e[0]<600?"Depth":"Show Depth",s,a,o,c,l,u,f,h,p,g,d,m,v,S,b,_,k,H,I,M,V,E=[...Array(Math.max(((T=e[2])==null?void 0:T.sunburstStoreValue.depthMax)-1,0)).keys()];De(E);let F=[];for(let P=0;P8&&e[0]<650),x(S,Ke,260,6,6293),w(h,"class","tool-button s-JBVBfphpN2RX"),ge(h,"shown",(Y=e[2])==null?void 0:Y.favoritesStoreValue.shown),x(h,Ke,247,4,5952),w(k,"class","svg-icon s-JBVBfphpN2RX"),x(k,Ke,276,6,6646),w(I,"class","button-text s-JBVBfphpN2RX"),ge(I,"no-display",((U=e[2])==null?void 0:U.sunburstStoreValue.depthMax)>8&&e[0]<650),x(I,Ke,279,6,6717),w(_,"class","tool-button s-JBVBfphpN2RX"),ge(_,"shown",(X=e[2])==null?void 0:X.searchStoreValue.shown),x(_,Ke,269,4,6484),w(f,"class","tools s-JBVBfphpN2RX"),x(f,Ke,246,2,5928),w(t,"class","toolbar s-JBVBfphpN2RX"),x(t,Ke,214,0,4855)},l:function(G){throw new Error("options.hydrate only works if the component was compiled with the `hydratable: true` option")},m:function(G,Y){ae(G,t,Y),y(t,n),y(n,r),y(r,s),y(n,a),y(n,o),y(o,c);for(let U=0;U8&&G[0]<650),Y&4&&ge(h,"shown",(me=G[2])==null?void 0:me.favoritesStoreValue.shown),Y&5&&ge(I,"no-display",((K=G[2])==null?void 0:K.sunburstStoreValue.depthMax)>8&&G[0]<650),Y&4&&ge(_,"shown",(Q=G[2])==null?void 0:Q.searchStoreValue.shown)},i:pe,o:pe,d:function(G){G&&ne(t),ln(F,G),ln(A,G),e[9](null),M=!1,Re(V)}};return ee("SvelteRegisterBlock",{block:C,id:Ao.name,type:"component",source:"",ctx:e}),C}function V7(e,t,n){let{$$slots:r={},$$scope:i}=t;St("Toolbar",r,[]);let{favoritesStore:s=null}=t,{sunburstStore:a=null}=t,{searchStore:o=null}=t,{sunburstWidth:c=650}=t,l=null,u=!1,f=null;Ne(()=>{u=!0});const h=()=>{n(2,f)},p=()=>{s&&a&&o&&n(2,f=new gc(h,s,a,o))},g=["favoritesStore","sunburstStore","searchStore","sunburstWidth"];Object.keys(t).forEach(b=>{!~g.indexOf(b)&&b.slice(0,2)!=="$$"&&b!=="slot"&&console.warn(` was created with unknown prop '${b}'`)});const d=b=>f==null?void 0:f.depthBoxClicked(b+1),m=()=>{f==null||f.favoritesClicked()},v=()=>{f==null||f.searchClicked()};function S(b){Je[b?"unshift":"push"](()=>{l=b,n(1,l)})}return e.$$set=b=>{"favoritesStore"in b&&n(3,s=b.favoritesStore),"sunburstStore"in b&&n(4,a=b.sunburstStore),"searchStore"in b&&n(5,o=b.searchStore),"sunburstWidth"in b&&n(0,c=b.sunburstWidth)},e.$capture_state=()=>({onMount:Ne,ToolbarEventHandler:gc,iconSearch:u2,iconHeart:h2,iconHeartSolid:f2,favoritesStore:s,sunburstStore:a,searchStore:o,sunburstWidth:c,component:l,mounted:u,handler:f,handlerUpdated:h,initView:p}),e.$inject_state=b=>{"favoritesStore"in b&&n(3,s=b.favoritesStore),"sunburstStore"in b&&n(4,a=b.sunburstStore),"searchStore"in b&&n(5,o=b.searchStore),"sunburstWidth"in b&&n(0,c=b.sunburstWidth),"component"in b&&n(1,l=b.component),"mounted"in b&&(u=b.mounted),"handler"in b&&n(2,f=b.handler)},t&&"$$inject"in t&&e.$inject_state(t.$$inject),e.$$.update=()=>{e.$$.dirty&56&&s&&a&&o&&p()},[c,l,f,s,a,o,d,m,v,S]}class d2 extends _t{constructor(t){super(t),Ct(this,t,V7,Ao,tt,{favoritesStore:3,sunburstStore:4,searchStore:5,sunburstWidth:0}),ee("SvelteRegisterComponent",{component:this,tagName:"Toolbar",options:t,id:Ao.name})}get favoritesStore(){throw new Error(": Props cannot be read directly from the component instance unless compiling with 'accessors: true' or ''")}set favoritesStore(t){throw new Error(": Props cannot be set directly on the component instance unless compiling with 'accessors: true' or ''")}get sunburstStore(){throw new Error(": Props cannot be read directly from the component instance unless compiling with 'accessors: true' or ''")}set sunburstStore(t){throw new Error(": Props cannot be set directly on the component instance unless compiling with 'accessors: true' or ''")}get searchStore(){throw new Error(": Props cannot be read directly from the component instance unless compiling with 'accessors: true' or ''")}set searchStore(t){throw new Error(": Props cannot be set directly on the component instance unless compiling with 'accessors: true' or ''")}get sunburstWidth(){throw new Error(": Props cannot be read directly from the component instance unless compiling with 'accessors: true' or ''")}set sunburstWidth(t){throw new Error(": Props cannot be set directly on the component instance unless compiling with 'accessors: true' or ''")}}const ws={sunburstWidth:650,treeWindowWidth:150,treeWindowHeaderHeight:26,treeWindowHeight:0,toolbarHeight:36},D7={mouseenterDelay:300};ws.treeWindowHeight=ws.treeWindowHeaderHeight+ws.treeWindowWidth;const N7={"red-50":"hsl(350, 100.0%, 96.08%)","red-100":"hsl(354, 100.0%, 90.2%)","red-200":"hsl(0, 72.65%, 77.06%)","red-300":"hsl(0, 68.67%, 67.45%)","red-400":"hsl(1, 83.25%, 62.55%)","red-500":"hsl(4, 89.62%, 58.43%)","red-600":"hsl(1, 77.19%, 55.29%)","red-700":"hsl(0, 65.08%, 50.59%)","red-800":"hsl(0, 66.39%, 46.67%)","red-900":"hsl(0, 73.46%, 41.37%)","red-a100":"hsl(4, 100.0%, 75.1%)","red-a200":"hsl(0, 100.0%, 66.08%)","red-a400":"hsl(348, 100.0%, 54.51%)","red-a700":"hsl(0, 100.0%, 41.76%)","pink-50":"hsl(340, 80.0%, 94.12%)","pink-100":"hsl(339, 81.33%, 85.29%)","pink-200":"hsl(339, 82.11%, 75.88%)","pink-300":"hsl(339, 82.56%, 66.27%)","pink-400":"hsl(339, 81.9%, 58.82%)","pink-500":"hsl(339, 82.19%, 51.57%)","pink-600":"hsl(338, 77.78%, 47.65%)","pink-700":"hsl(336, 77.98%, 42.75%)","pink-800":"hsl(333, 79.27%, 37.84%)","pink-900":"hsl(328, 81.33%, 29.41%)","pink-a100":"hsl(339, 100.0%, 75.1%)","pink-a200":"hsl(339, 100.0%, 62.55%)","pink-a400":"hsl(338, 100.0%, 48.04%)","pink-a700":"hsl(333, 84.11%, 41.96%)","purple-50":"hsl(292, 44.44%, 92.94%)","purple-100":"hsl(291, 46.07%, 82.55%)","purple-200":"hsl(291, 46.94%, 71.18%)","purple-300":"hsl(291, 46.6%, 59.61%)","purple-400":"hsl(291, 46.61%, 50.78%)","purple-500":"hsl(291, 63.72%, 42.16%)","purple-600":"hsl(287, 65.05%, 40.39%)","purple-700":"hsl(282, 67.88%, 37.84%)","purple-800":"hsl(277, 70.17%, 35.49%)","purple-900":"hsl(267, 75.0%, 31.37%)","purple-a100":"hsl(291, 95.38%, 74.51%)","purple-a200":"hsl(291, 95.9%, 61.76%)","purple-a400":"hsl(291, 100.0%, 48.82%)","purple-a700":"hsl(280, 100.0%, 50.0%)","deep-purple-50":"hsl(264, 45.45%, 93.53%)","deep-purple-100":"hsl(261, 45.68%, 84.12%)","deep-purple-200":"hsl(261, 46.27%, 73.73%)","deep-purple-300":"hsl(261, 46.81%, 63.14%)","deep-purple-400":"hsl(261, 46.72%, 55.1%)","deep-purple-500":"hsl(261, 51.87%, 47.25%)","deep-purple-600":"hsl(259, 53.91%, 45.1%)","deep-purple-700":"hsl(257, 57.75%, 41.76%)","deep-purple-800":"hsl(254, 60.8%, 39.02%)","deep-purple-900":"hsl(251, 68.79%, 33.92%)","deep-purple-a100":"hsl(261, 100.0%, 76.67%)","deep-purple-a200":"hsl(255, 100.0%, 65.1%)","deep-purple-a400":"hsl(258, 100.0%, 56.08%)","deep-purple-a700":"hsl(265, 100.0%, 45.88%)","indigo-50":"hsl(231, 43.75%, 93.73%)","indigo-100":"hsl(231, 45.0%, 84.31%)","indigo-200":"hsl(230, 44.36%, 73.92%)","indigo-300":"hsl(230, 44.09%, 63.53%)","indigo-400":"hsl(230, 44.25%, 55.69%)","indigo-500":"hsl(230, 48.36%, 47.84%)","indigo-600":"hsl(231, 50.0%, 44.71%)","indigo-700":"hsl(231, 53.62%, 40.59%)","indigo-800":"hsl(232, 57.22%, 36.67%)","indigo-900":"hsl(234, 65.79%, 29.8%)","indigo-a100":"hsl(230, 100.0%, 77.45%)","indigo-a200":"hsl(230, 98.84%, 66.08%)","indigo-a400":"hsl(230, 98.97%, 61.76%)","indigo-a700":"hsl(230, 99.04%, 59.22%)","blue-50":"hsl(205, 86.67%, 94.12%)","blue-100":"hsl(207, 88.89%, 85.88%)","blue-200":"hsl(206, 89.74%, 77.06%)","blue-300":"hsl(206, 89.02%, 67.84%)","blue-400":"hsl(206, 89.95%, 60.98%)","blue-500":"hsl(206, 89.74%, 54.12%)","blue-600":"hsl(208, 79.28%, 50.78%)","blue-700":"hsl(209, 78.72%, 46.08%)","blue-800":"hsl(211, 80.28%, 41.76%)","blue-900":"hsl(216, 85.06%, 34.12%)","blue-a100":"hsl(217, 100.0%, 75.49%)","blue-a200":"hsl(217, 100.0%, 63.33%)","blue-a400":"hsl(217, 100.0%, 58.04%)","blue-a700":"hsl(224, 100.0%, 58.04%)","light-blue-50":"hsl(198, 93.55%, 93.92%)","light-blue-100":"hsl(198, 92.41%, 84.51%)","light-blue-200":"hsl(198, 92.37%, 74.31%)","light-blue-300":"hsl(198, 91.3%, 63.92%)","light-blue-400":"hsl(198, 91.93%, 56.27%)","light-blue-500":"hsl(198, 97.57%, 48.43%)","light-blue-600":"hsl(199, 97.41%, 45.49%)","light-blue-700":"hsl(201, 98.1%, 41.37%)","light-blue-800":"hsl(202, 97.91%, 37.45%)","light-blue-900":"hsl(206, 98.72%, 30.59%)","light-blue-a100":"hsl(198, 100.0%, 75.1%)","light-blue-a200":"hsl(198, 100.0%, 62.55%)","light-blue-a400":"hsl(198, 100.0%, 50.0%)","light-blue-a700":"hsl(202, 100.0%, 45.88%)","cyan-50":"hsl(186, 72.22%, 92.94%)","cyan-100":"hsl(186, 71.11%, 82.35%)","cyan-200":"hsl(186, 71.62%, 70.98%)","cyan-300":"hsl(186, 71.15%, 59.22%)","cyan-400":"hsl(186, 70.87%, 50.2%)","cyan-500":"hsl(186, 100.0%, 41.57%)","cyan-600":"hsl(186, 100.0%, 37.84%)","cyan-700":"hsl(185, 100.0%, 32.75%)","cyan-800":"hsl(185, 100.0%, 28.04%)","cyan-900":"hsl(182, 100.0%, 19.61%)","cyan-a100":"hsl(180, 100.0%, 75.88%)","cyan-a200":"hsl(180, 100.0%, 54.71%)","cyan-a400":"hsl(186, 100.0%, 50.0%)","cyan-a700":"hsl(187, 100.0%, 41.57%)","teal-50":"hsl(176, 40.91%, 91.37%)","teal-100":"hsl(174, 41.28%, 78.63%)","teal-200":"hsl(174, 41.9%, 64.9%)","teal-300":"hsl(174, 41.83%, 50.78%)","teal-400":"hsl(174, 62.75%, 40.0%)","teal-500":"hsl(174, 100.0%, 29.41%)","teal-600":"hsl(173, 100.0%, 26.86%)","teal-700":"hsl(173, 100.0%, 23.73%)","teal-800":"hsl(172, 100.0%, 20.59%)","teal-900":"hsl(169, 100.0%, 15.1%)","teal-a100":"hsl(166, 100.0%, 82.75%)","teal-a200":"hsl(165, 100.0%, 69.61%)","teal-a400":"hsl(165, 82.26%, 51.37%)","teal-a700":"hsl(171, 100.0%, 37.45%)","green-50":"hsl(124, 39.39%, 93.53%)","green-100":"hsl(121, 37.5%, 84.31%)","green-200":"hsl(122, 37.4%, 74.31%)","green-300":"hsl(122, 38.46%, 64.31%)","green-400":"hsl(122, 38.46%, 56.67%)","green-500":"hsl(122, 39.44%, 49.22%)","green-600":"hsl(122, 40.97%, 44.51%)","green-700":"hsl(122, 43.43%, 38.82%)","green-800":"hsl(123, 46.2%, 33.53%)","green-900":"hsl(124, 55.37%, 23.73%)","green-a100":"hsl(136, 77.22%, 84.51%)","green-a200":"hsl(150, 81.82%, 67.65%)","green-a400":"hsl(150, 100.0%, 45.1%)","green-a700":"hsl(144, 100.0%, 39.22%)","light-green-50":"hsl(88, 51.72%, 94.31%)","light-green-100":"hsl(87, 50.68%, 85.69%)","light-green-200":"hsl(88, 50.0%, 76.47%)","light-green-300":"hsl(87, 50.0%, 67.06%)","light-green-400":"hsl(87, 50.24%, 59.8%)","light-green-500":"hsl(87, 50.21%, 52.75%)","light-green-600":"hsl(89, 46.12%, 48.04%)","light-green-700":"hsl(92, 47.91%, 42.16%)","light-green-800":"hsl(95, 49.46%, 36.47%)","light-green-900":"hsl(103, 55.56%, 26.47%)","light-green-a100":"hsl(87, 100.0%, 78.24%)","light-green-a200":"hsl(87, 100.0%, 67.45%)","light-green-a400":"hsl(92, 100.0%, 50.59%)","light-green-a700":"hsl(96, 81.15%, 47.84%)","lime-50":"hsl(65, 71.43%, 94.51%)","lime-100":"hsl(64, 69.01%, 86.08%)","lime-200":"hsl(65, 70.69%, 77.25%)","lime-300":"hsl(65, 70.37%, 68.24%)","lime-400":"hsl(65, 69.7%, 61.18%)","lime-500":"hsl(65, 69.96%, 54.31%)","lime-600":"hsl(63, 59.68%, 49.61%)","lime-700":"hsl(62, 61.43%, 43.73%)","lime-800":"hsl(59, 62.89%, 38.04%)","lime-900":"hsl(53, 69.93%, 30.0%)","lime-a100":"hsl(65, 100.0%, 75.29%)","lime-a200":"hsl(65, 100.0%, 62.75%)","lime-a400":"hsl(73, 100.0%, 50.0%)","lime-a700":"hsl(75, 100.0%, 45.88%)","yellow-50":"hsl(55, 100.0%, 95.29%)","yellow-100":"hsl(53, 100.0%, 88.43%)","yellow-200":"hsl(53, 100.0%, 80.78%)","yellow-300":"hsl(53, 100.0%, 73.14%)","yellow-400":"hsl(53, 100.0%, 67.25%)","yellow-500":"hsl(53, 100.0%, 61.57%)","yellow-600":"hsl(48, 98.04%, 60.0%)","yellow-700":"hsl(42, 96.26%, 58.04%)","yellow-800":"hsl(37, 94.64%, 56.08%)","yellow-900":"hsl(28, 91.74%, 52.55%)","yellow-a100":"hsl(60, 100.0%, 77.65%)","yellow-a200":"hsl(60, 100.0%, 50.0%)","yellow-a400":"hsl(55, 100.0%, 50.0%)","yellow-a700":"hsl(50, 100.0%, 50.0%)","amber-50":"hsl(46, 100.0%, 94.12%)","amber-100":"hsl(45, 100.0%, 85.1%)","amber-200":"hsl(45, 100.0%, 75.49%)","amber-300":"hsl(45, 100.0%, 65.49%)","amber-400":"hsl(45, 100.0%, 57.84%)","amber-500":"hsl(45, 100.0%, 51.37%)","amber-600":"hsl(42, 100.0%, 50.0%)","amber-700":"hsl(37, 100.0%, 50.0%)","amber-800":"hsl(33, 100.0%, 50.0%)","amber-900":"hsl(26, 100.0%, 50.0%)","amber-a100":"hsl(47, 100.0%, 74.9%)","amber-a200":"hsl(47, 100.0%, 62.55%)","amber-a400":"hsl(46, 100.0%, 50.0%)","amber-a700":"hsl(40, 100.0%, 50.0%)","orange-50":"hsl(36, 100.0%, 93.92%)","orange-100":"hsl(35, 100.0%, 84.9%)","orange-200":"hsl(35, 100.0%, 75.1%)","orange-300":"hsl(35, 100.0%, 65.1%)","orange-400":"hsl(35, 100.0%, 57.45%)","orange-500":"hsl(35, 100.0%, 50.0%)","orange-600":"hsl(33, 100.0%, 49.22%)","orange-700":"hsl(30, 100.0%, 48.04%)","orange-800":"hsl(27, 100.0%, 46.86%)","orange-900":"hsl(21, 100.0%, 45.1%)","orange-a100":"hsl(38, 100.0%, 75.1%)","orange-a200":"hsl(33, 100.0%, 62.55%)","orange-a400":"hsl(34, 100.0%, 50.0%)","orange-a700":"hsl(25, 100.0%, 50.0%)","deep-orange-50":"hsl(5, 71.43%, 94.51%)","deep-orange-100":"hsl(14, 100.0%, 86.86%)","deep-orange-200":"hsl(14, 100.0%, 78.43%)","deep-orange-300":"hsl(14, 100.0%, 69.8%)","deep-orange-400":"hsl(14, 100.0%, 63.14%)","deep-orange-500":"hsl(14, 100.0%, 56.67%)","deep-orange-600":"hsl(14, 90.68%, 53.73%)","deep-orange-700":"hsl(14, 80.39%, 50.0%)","deep-orange-800":"hsl(14, 82.28%, 46.47%)","deep-orange-900":"hsl(14, 88.18%, 39.8%)","deep-orange-a100":"hsl(14, 100.0%, 75.1%)","deep-orange-a200":"hsl(14, 100.0%, 62.55%)","deep-orange-a400":"hsl(14, 100.0%, 50.0%)","deep-orange-a700":"hsl(11, 100.0%, 43.33%)","brown-50":"hsl(19, 15.79%, 92.55%)","brown-100":"hsl(16, 15.79%, 81.37%)","brown-200":"hsl(14, 15.19%, 69.02%)","brown-300":"hsl(15, 15.32%, 56.47%)","brown-400":"hsl(15, 17.5%, 47.06%)","brown-500":"hsl(15, 25.39%, 37.84%)","brown-600":"hsl(15, 25.29%, 34.12%)","brown-700":"hsl(14, 25.68%, 29.02%)","brown-800":"hsl(11, 25.81%, 24.31%)","brown-900":"hsl(8, 27.84%, 19.02%)","gray-50":"hsl(0, 0.0%, 98.04%)","gray-100":"hsl(0, 0.0%, 96.08%)","gray-200":"hsl(0, 0.0%, 93.33%)","gray-300":"hsl(0, 0.0%, 87.84%)","gray-400":"hsl(0, 0.0%, 74.12%)","gray-500":"hsl(0, 0.0%, 61.96%)","gray-600":"hsl(0, 0.0%, 45.88%)","gray-700":"hsl(0, 0.0%, 38.04%)","gray-800":"hsl(0, 0.0%, 25.88%)","gray-900":"hsl(0, 0.0%, 12.94%)","blue-gray-50":"hsl(204, 15.15%, 93.53%)","blue-gray-100":"hsl(198, 15.66%, 83.73%)","blue-gray-200":"hsl(199, 15.33%, 73.14%)","blue-gray-300":"hsl(199, 15.63%, 62.35%)","blue-gray-400":"hsl(200, 15.38%, 54.12%)","blue-gray-500":"hsl(199, 18.3%, 46.08%)","blue-gray-600":"hsl(198, 18.45%, 40.39%)","blue-gray-700":"hsl(199, 18.34%, 33.14%)","blue-gray-800":"hsl(199, 17.91%, 26.27%)","blue-gray-900":"hsl(199, 19.15%, 18.43%)","blue-gray-1000":"hsl(199, 20.93%, 8.43%)"},Te={colors:N7,layout:ws,time:D7};var Mt=(e=>(e[e.left=0]="left",e[e.middle=1]="middle",e[e.right=2]="right",e))(Mt||{}),gr=(e=>(e[e.First=0]="First",e[e.Second=1]="Second",e[e.Both=2]="Both",e))(gr||{}),gi=(e=>(e[e.PairArray=0]="PairArray",e[e.PairString=1]="PairString",e))(gi||{}),It=(e=>(e[e.SectorArc=0]="SectorArc",e[e.MidLine=1]="MidLine",e))(It||{});const H7=[[" ",19.3],["!",34.3],['"',39.7],["#",58],["$",58],["%",78.6],["&",70.3],["'",23],["(",30],[")",30],["*",40],["+",58],[",",21.2],["-",34.7],[".",21.2],["/",37.3],["0",58],["1",58],["2",58],["3",58],["4",58],["5",58],["6",58],["7",58],["8",58],["9",58],[":",25.2],[";",25.2],["<",58],["=",58],[">",58],["?",39.8],["@",82.2],["A",68],["B",64.7],["C",68.5],["D",75.3],["E",58.1],["F",56.6],["G",73.4],["H",75.6],["I",30.7],["J",44.4],["K",68.1],["L",51.4],["M",92],["N",75.6],["O",79.8],["P",61.1],["Q",79.8],["R",64.4],["S",53],["T",59],["U",73],["V",68],["W",101.9],["X",64.3],["Y",62.9],["Z",62.4],["[",30],["\\",37.5],["]",30],["^",58],["_",39.4],["`",30.7],["a",50.7],["b",55.9],["c",46.7],["d",55.9],["e",52.4],["f",33.7],["g",51.1],["h",55.6],["i",25.6],["j",25.4],["k",52.4],["l",25.6],["m",82.1],["n",55.6],["o",55.6],["p",55.2],["q",55.9],["r",40.3],["s",43.4],["t",37.3],["u",55.6],["v",51.2],["w",76.6],["x",50.4],["y",51.2],["z",46.2],["{",30],["|",30],["}",30],["~",58],["_median",55.9]],F7=[['"&',-9.1],['",',-11.4],['"-',-8.9],['".',-11.4],['"/',-9.1],['"@',-2.3],['"A',-9.1],['"C',-2.3],['"G',-2.3],['"O',-2.3],['"Q',-2.3],['"V',2.4],['"W',2.4],['"Y',1.5],['"\\',2.4],['"a',-3.2],['"c',-4.6],['"d',-4.6],['"e',-4.6],['"o',-4.6],['"q',-4.6],["'&",-9.1],["',",-11.4],["'-",-8.9],["'.",-11.4],["'/",-9.1],["'@",-2.3],["'A",-9.1],["'C",-2.3],["'G",-2.3],["'O",-2.3],["'Q",-2.3],["'V",2.4],["'W",2.4],["'Y",1.5],["'\\",2.4],["'a",-3.2],["'c",-4.6],["'d",-4.6],["'e",-4.6],["'o",-4.6],["'q",-4.6],["(@",-2],["(C",-2],["(G",-2],["(O",-2],["(Q",-2],["(c",-1.6],["(d",-1.6],["(e",-1.6],["(o",-1.6],["(q",-1.6],["*&",-9.1],["*,",-11.4],["*-",-8.9],["*.",-11.4],["*/",-9.1],["*@",-2.3],["*A",-9.1],["*C",-2.3],["*G",-2.3],["*O",-2.3],["*Q",-2.3],["*V",2.4],["*W",2.4],["*Y",1.5],["*\\",2.4],["*a",-3.2],["*c",-4.6],["*d",-4.6],["*e",-4.6],["*o",-4.6],["*q",-4.6],[',"',-11.4],[",'",-11.4],[",*",-11.4],[",-",-6.8],[",@",-2.8],[",C",-2.8],[",G",-2.8],[",O",-2.8],[",Q",-2.8],[",T",-9],[",V",-9],[",W",-6.1],[",Y",-7.6],[",\\",-9],[",v",-6.6],[",w",-3.1],[",y",-6.6],['-"',-8.9],["-&",-2.6],["-'",-8.9],["-*",-8.9],["-,",-6.8],["-.",-6.8],["-/",-2.6],["-A",-2.6],["-T",-9],["-V",-5.6],["-W",-1.6],["-X",-3.1],["-Y",-8],["-Z",-2.3],["-\\",-5.6],['."',-11.4],[".'",-11.4],[".*",-11.4],[".-",-6.8],[".@",-2.8],[".C",-2.8],[".G",-2.8],[".O",-2.8],[".Q",-2.8],[".T",-9],[".V",-9],[".W",-6.1],[".Y",-7.6],[".\\",-9],[".v",-6.6],[".w",-3.1],[".y",-6.6],['/"',2.4],["/&",-6.8],["/'",2.4],["/*",2.4],["/,",-9.6],["/-",-5.6],["/.",-9.6],["//",-6.8],["/:",-4.4],["/;",-4.4],["/?",2.4],["/@",-2.6],["/A",-6.8],["/C",-2.6],["/G",-2.6],["/J",-7.6],["/O",-2.6],["/Q",-2.6],["/a",-5.8],["/c",-5.8],["/d",-5.8],["/e",-5.8],["/f",-1.5],["/g",-6.8],["/m",-4.4],["/n",-4.4],["/o",-5.8],["/p",-4.4],["/q",-5.8],["/r",-4.4],["/s",-5.3],["/t",-2.1],["/u",-4.4],["/v",-2.4],["/x",-2.6],["/y",-2.4],["/z",-4.1],['@"',-2.3],["@&",-2.1],["@'",-2.3],["@)",-2],["@*",-2.3],["@,",-2.8],["@.",-2.8],["@/",-2.1],["@A",-2.1],["@T",-4.9],["@V",-2.6],["@X",-1.5],["@Y",-4],["@Z",-3.5],["@\\",-2.6],["@]",-2],["@}",-2],['A"',-9.1],["A'",-9.1],["A*",-9.1],["A-",-2.6],["A?",-2.8],["A@",-2.1],["AC",-2.1],["AG",-2.1],["AJ",2.5],["AO",-2.1],["AQ",-2.1],["AT",-6.6],["AU",-2.8],["AV",-6.8],["AW",-4.2],["AY",-8.2],["A\\",-6.8],["Av",-4.1],["Ay",-4.1],["C-",-7.5],['D"',-2.3],["D&",-2.1],["D'",-2.3],["D)",-2],["D*",-2.3],["D,",-2.8],["D.",-2.8],["D/",-2.1],["DA",-2.1],["DT",-4.9],["DV",-2.6],["DX",-1.5],["DY",-4],["DZ",-3.5],["D\\",-2.6],["D]",-2],["D}",-2],["F&",-6.6],["F,",-9],["F.",-9],["F/",-6.6],["F:",-3],["F;",-3],["F?",1.5],["FA",-6.6],["FJ",-9.9],["Fc",-3.5],["Fd",-3.5],["Fe",-3.5],["Fm",-3],["Fn",-3],["Fo",-3.5],["Fp",-3],["Fq",-3.5],["Fr",-3],["Fu",-3],["J&",-2.8],["J,",-2.5],["J.",-2.5],["J/",-2.8],["JA",-2.8],["K-",-3.1],["K@",-1.5],["KC",-1.5],["KG",-1.5],["KO",-1.5],["KQ",-1.5],["Kc",-1.8],["Kd",-1.8],["Ke",-1.8],["Kf",-2.6],["Ko",-1.8],["Kq",-1.8],["Kt",-4.1],["Kv",-3.3],["Kw",-2.8],["Ky",-3.3],['L"',-14.5],["L'",-14.5],["L*",-14.5],["L,",2.7],["L-",-9.9],["L.",2.7],["L?",-2.5],["L@",-4],["LC",-4],["LG",-4],["LO",-4],["LQ",-4],["LT",-8.6],["LV",-9.1],["LW",-7.6],["LY",-10.6],["L\\",-9.1],["Lc",-1.8],["Ld",-1.8],["Le",-1.8],["Lo",-1.8],["Lq",-1.8],["Lv",-5.4],["Lw",-4],["Ly",-5.4],['O"',-2.3],["O&",-2.1],["O'",-2.3],["O)",-2],["O*",-2.3],["O,",-2.8],["O.",-2.8],["O/",-2.1],["OA",-2.1],["OT",-4.9],["OV",-2.6],["OX",-1.5],["OY",-4],["OZ",-3.5],["O\\",-2.6],["O]",-2],["O}",-2],["P&",-6.9],["P,",-12.4],["P.",-12.4],["P/",-6.9],["PA",-6.9],["PJ",-9.1],["Pa",-2.5],["Pc",-1.5],["Pd",-1.5],["Pe",-1.5],["Po",-1.5],["Pq",-1.5],['Q"',-2.3],["Q&",-2.1],["Q'",-2.3],["Q)",-2],["Q*",-2.3],["Q,",-2.8],["Q.",-2.8],["Q/",-2.1],["QA",-2.1],["QT",-4.9],["QV",-2.6],["QX",-1.5],["QY",-4],["QZ",-3.5],["Q\\",-2.6],["Q]",-2],["Q}",-2],["R@",-2.3],["RC",-2.3],["RG",-2.3],["RO",-2.3],["RQ",-2.3],["RT",-2.6],["RU",-2.1],["T&",-6.6],["T,",-9],["T-",-9],["T.",-9],["T/",-6.6],["T:",-8],["T;",-8],["T@",-4.9],["TA",-6.6],["TC",-4.9],["TG",-4.9],["TJ",-10],["TO",-4.9],["TQ",-4.9],["Ta",-12.5],["Tc",-10.5],["Td",-10.5],["Te",-10.5],["Tg",-9.4],["Tm",-8],["Tn",-8],["To",-10.5],["Tp",-8],["Tq",-10.5],["Tr",-8],["Ts",-8.1],["Tu",-8],["Tv",-9],["Tw",-7],["Tx",-7.2],["Ty",-9],["Tz",-6],["U&",-2.8],["U,",-2.5],["U.",-2.5],["U/",-2.8],["UA",-2.8],['V"',2.4],["V&",-6.8],["V'",2.4],["V*",2.4],["V,",-9.6],["V-",-5.6],["V.",-9.6],["V/",-6.8],["V:",-4.4],["V;",-4.4],["V?",2.4],["V@",-2.6],["VA",-6.8],["VC",-2.6],["VG",-2.6],["VJ",-7.6],["VO",-2.6],["VQ",-2.6],["Va",-5.8],["Vc",-5.8],["Vd",-5.8],["Ve",-5.8],["Vf",-1.5],["Vg",-6.8],["Vm",-4.4],["Vn",-4.4],["Vo",-5.8],["Vp",-4.4],["Vq",-5.8],["Vr",-4.4],["Vs",-5.3],["Vt",-2.1],["Vu",-4.4],["Vv",-2.4],["Vx",-2.6],["Vy",-2.4],["Vz",-4.1],['W"',2.4],["W&",-4.7],["W'",2.4],["W*",2.4],["W,",-6.1],["W-",-1.6],["W.",-6.1],["W/",-4.7],["W?",1.7],["WA",-4.7],["WJ",-5.1],["Wa",-4.4],["Wc",-1.6],["Wd",-1.6],["We",-1.6],["Wg",-4.9],["Wo",-1.6],["Wq",-1.6],["Ws",-2.3],["X-",-3.1],["X@",-1.5],["XC",-1.5],["XG",-1.5],["XO",-1.5],["XQ",-1.5],["Xc",-1.8],["Xd",-1.8],["Xe",-1.8],["Xf",-2.6],["Xo",-1.8],["Xq",-1.8],["Xt",-4.1],["Xv",-3.3],["Xw",-2.8],["Xy",-3.3],['Y"',1.5],["Y&",-8.2],["Y'",1.5],["Y*",1.5],["Y,",-7.6],["Y-",-8],["Y.",-7.6],["Y/",-8.2],["Y:",-6.1],["Y;",-6.1],["Y?",1.7],["Y@",-4],["YA",-8.2],["YC",-4],["YG",-4],["YJ",-10],["YO",-4],["YQ",-4],["Ya",-6.4],["Yc",-8],["Yd",-8],["Ye",-8],["Yg",-8.6],["Ym",-6.1],["Yn",-6.1],["Yo",-8],["Yp",-6.1],["Yq",-8],["Yr",-6.1],["Ys",-6.4],["Yu",-6.1],["Yv",-5],["Yw",-4.6],["Yx",-6.6],["Yy",-5],["Z-",-3.5],["Z?",1.7],["Z@",-2.9],["ZC",-2.9],["ZG",-2.9],["ZO",-2.9],["ZQ",-2.9],["Zc",-1.9],["Zd",-1.9],["Ze",-1.9],["Zo",-1.9],["Zq",-1.9],["Zs",-1.4],["Zv",-2],["Zy",-2],["[@",-2],["[C",-2],["[G",-2],["[O",-2],["[Q",-2],["[c",-1.6],["[d",-1.6],["[e",-1.6],["[o",-1.6],["[q",-1.6],['\\"',-9.1],["\\'",-9.1],["\\*",-9.1],["\\-",-2.6],["\\?",-2.8],["\\@",-2.1],["\\C",-2.1],["\\G",-2.1],["\\J",2.5],["\\O",-2.1],["\\Q",-2.1],["\\T",-6.6],["\\U",-2.8],["\\V",-6.8],["\\W",-4.2],["\\Y",-8.2],["\\\\",-6.8],["\\v",-4.1],["\\y",-4.1],['a"',-3.6],["a'",-3.6],["a*",-3.6],["av",-1.6],["aw",-.8],["ay",-1.6],['b"',-4.6],["b'",-4.6],["b)",-1.6],["b*",-4.6],["bV",-5.8],["bW",-1.6],["b\\",-5.8],["b]",-1.6],["bv",-1.3],["bx",-3],["by",-1.3],["b}",-1.6],['e"',-4.6],["e'",-4.6],["e)",-1.6],["e*",-4.6],["eV",-5.8],["eW",-1.6],["e\\",-5.8],["e]",-1.6],["ev",-1.3],["ex",-3],["ey",-1.3],["e}",-1.6],['f"',3.4],["f'",3.4],["f*",3.4],["f,",-6.5],["f.",-6.5],["fi",-2.3],['h"',-3.6],["h'",-3.6],["h*",-3.6],["hv",-1.6],["hw",-.8],["hy",-1.6],["kc",-3],["kd",-3],["ke",-3],["ko",-3],["kq",-3],['m"',-3.6],["m'",-3.6],["m*",-3.6],["mv",-1.6],["mw",-.8],["my",-1.6],['n"',-3.6],["n'",-3.6],["n*",-3.6],["nv",-1.6],["nw",-.8],["ny",-1.6],['o"',-4.6],["o'",-4.6],["o)",-1.6],["o*",-4.6],["oV",-5.8],["oW",-1.6],["o\\",-5.8],["o]",-1.6],["ov",-1.3],["ox",-3],["oy",-1.3],["o}",-1.6],['p"',-4.6],["p'",-4.6],["p)",-1.6],["p*",-4.6],["pV",-5.8],["pW",-1.6],["p\\",-5.8],["p]",-1.6],["pv",-1.3],["px",-3],["py",-1.3],["p}",-1.6],["r,",-6.6],["r.",-6.6],["ra",-1.9],["v&",-4.1],["v,",-6.6],["v.",-6.6],["v/",-4.1],["vA",-4.1],["vc",-1.3],["vd",-1.3],["ve",-1.3],["vo",-1.3],["vq",-1.3],["w,",-3.1],["w.",-3.1],["xc",-3],["xd",-3],["xe",-3],["xo",-3],["xq",-3],["y&",-4.1],["y,",-6.6],["y.",-6.6],["y/",-4.1],["yA",-4.1],["yc",-1.3],["yd",-1.3],["ye",-1.3],["yo",-1.3],["yq",-1.3],["{@",-2],["{C",-2],["{G",-2],["{O",-2],["{Q",-2],["{c",-1.6],["{d",-1.6],["{e",-1.6],["{o",-1.6],["{q",-1.6]],P7={textWidth:H7,kerningWidth:F7},R7=(e,t,n=16)=>{const r=new Map(e.textWidth),i=new Map(e.kerningWidth),s=[...t];let a=0;for(const[o,c]of s.entries())a+=r.get(c)||r.get("_median"),o!==s.length-1&&(a+=i.get(`${c}${s[o+1]}`)||0);return a/(100/n)},ft=(e,t=16)=>R7(P7,e,t),rs=Math.PI/2,p2=20;function I7(e,t){switch(t){case It.SectorArc:{const n=[this.xScale(e.x0)-rs,this.xScale(e.x1)-rs],r=Math.max(0,(this.yScale(e.y0)+this.yScale(e.y1))/2),i=(n[0]+n[1])/2,s=i>0&&i=Math.PI/2&&r<=Math.PI*3/2?(u.moveTo(c,l),u.lineTo(a,o)):(u.moveTo(a,o),u.lineTo(c,l)),u.toString()}}}function E7(e,t=16,n=null,r=0){n==null&&(n=this.getFeatureInfo(e.data.f).nameValue);const i=ft(n,t),s=this.xScale(e.x1)-this.xScale(e.x0),a=Math.max(0,(this.yScale(e.y0)+this.yScale(e.y1))/2),o=s*a;return i<=o-r}const jl=(e,t)=>{const n=z.color(e(t.data.f));let r="currentcolor";if(n!==null){const i=[252,252,252],s=[74,74,74],a=z.color(n).rgb(),o=[a.r,a.g,a.b];Gr(i,o)jl(this.getFeatureColor,l)),o=this.textFontScale(this.sunburstStoreValue.depthHigh-this.sunburstStoreValue.depthLow),c=(l,u)=>{const f=this.getFeatureInfo(l.data.f);let h=f.nameValue,p=ft(h,16*o);if(p>u)for(h=f.shortValue,p=ft(h,16*o);p>u;)h=h.replace("...",""),h=h.slice(0,h.length-1),h=`${h}...`,p=ft(h,16*o);return h};a.filter(l=>l.depth===1).style("font-size",`${o}rem`).text(l=>c(l,i*2-10)),a.filter(l=>l.depth!==1).style("font-size",`${o}rem`).append("textPath").attr("startOffset","50%").attr("xlink:href",l=>`#mid-circle-text-arc-${l.depth}`).text(l=>c(l,i*(l.depth-.5)*s))}function W7(){const e=this.svg.select("g.arc-group"),t=this.svg.select("g.text-group");let n=e.selectAll(`g.arc-${this.xScale.domain()[0]===0&&this.xScale.domain()[1]===1?this.sunburstStoreValue.depthLow:this.sunburstStoreValue.depthLow+1}`);n=n.sort((f,h)=>f.x0-h.x0),n=n.filter(f=>f.x0>=this.xScale.domain()[0]&&f.x1<=this.xScale.domain()[1]&&f.data.f!=="_");const r=t.selectAll("g.text-group").data(n.data()).join("g").attr("class","text-group");r.append("path").attr("class","text-arc").attr("id",(f,h)=>`text-arc-${h}`).attr("d",f=>this.textArc(f,It.SectorArc)),r.append("path").attr("class","text-line").attr("id",(f,h)=>`text-line-${h}`).attr("d",f=>this.textArc(f,It.MidLine));const i=r.append("text").attr("class","feature-name");i.style("fill",f=>jl(this.getFeatureColor,f));const s=new Set,a=new Map;if(i.size()===0)return;const o=this.yScale(i.datum().y1)-this.yScale(i.datum().y0)-15,c=this.textFontScale(this.sunburstStoreValue.depthHigh-this.sunburstStoreValue.depthLow),l=i.style("font-size",`${c}rem`).append("textPath").attr("startOffset","50%").attr("xlink:href",(f,h)=>{const p=this.getFeatureInfo(f.data.f);let g=p.nameValue,d=!1;return s.has(p.name)&&(g=p.value,d=!0),s.add(p.name),ft(g,16*c){const p=this.getFeatureInfo(f.data.f);let g=p.nameValue,d=!1;if(s.has(p.name)&&(g=p.value,d=!0),a.get(h)===It.MidLine){if(this.yScale(f.y1)*(this.xScale(f.x1)-this.xScale(f.x0))o&&!d)for(g=p.shortValue,v=ft(g,16*c);v>o;)g=g.replace("...",""),g=g.slice(0,g.length-1),g=`${g}...`,v=ft(g,16*c)}return s.add(p.name),g});const u=new Set;Array.from(this.featureMap.entries()).forEach(f=>{s.has(f[1][0])||u.add(f[0])}),this.drawSecondaryText(u)}function O7(e){const t=this.svg.select("g.arc-group"),n=this.svg.select("g.text-group");let r=t.selectAll(`g.arc-${this.xScale.domain()[0]===0&&this.xScale.domain()[1]===1?this.sunburstStoreValue.depthLow+1:this.sunburstStoreValue.depthLow+2}`);if(r=r.filter(f=>f.x0>=this.xScale.domain()[0]&&f.x1<=this.xScale.domain()[1]&&e.has(+f.data.f)),r.size()===0)return;r=r.sort((f,h)=>f.x0-h.x0);const i=n.selectAll("g.s-text-group").data(r.data()).join("g").attr("class","text-group");i.append("path").attr("class","text-arc").attr("id",(f,h)=>`s-text-arc-${h}`).attr("d",f=>this.textArc(f,It.SectorArc)),i.append("path").attr("class","text-line").attr("id",(f,h)=>`s-text-line-${h}`).attr("d",f=>this.textArc(f,It.MidLine));const s=i.append("text").attr("class","feature-name"),a=this.yScale(s.datum().y1)-this.yScale(s.datum().y0)-15,o=this.textFontScale(this.sunburstStoreValue.depthHigh-this.sunburstStoreValue.depthLow);s.style("fill",f=>jl(this.getFeatureColor,f));const c=new Set([]),l=s.style("font-size",`${o}rem`).append("textPath").attr("startOffset","50%").attr("xlink:href",(f,h)=>{const g=this.getFeatureInfo(f.data.f).nameValue;return ft(g,16*o){if(u.has(f.data.f))return"";const p=this.getFeatureInfo(f.data.f);let g=p.nameValue;if(this.yScale(f.y1)*(this.xScale(f.x1)-this.xScale(f.x0))a)for(g=p.shortValue,m=ft(g,16*o);m>a;)g=g.replace("...",""),g=g.slice(0,g.length-1),g=`${g}...`,m=ft(g,16*o)}return u.add(f.data.f),g})}function G7(){this.svg.select(".text-group").selectAll("*").remove(),this.svg.selectAll("text.feature-name").remove()}let yi=null,vs=null,g2=new Date().getTime();function Y7(e,t){if(e.stopPropagation(),e.preventDefault(),t!==null&&t.data.f==="_")return;let n={x0:0,x1:1,y0:0,y1:1},r=t;const i=this.xScale.domain(),s=this.yScale.domain(),a=this.sunburstStoreValue.depthHigh-this.sunburstStoreValue.depthLow;if(t===null||t.x0==i[0]&&t.x1==i[1]){const l=this.arcDomainStack.pop();l!==void 0?(r=l.node,n=l,this.sunburstStoreValue.depthLow=r.depth===0?1:r.depth,this.sunburstStoreValue.depthHigh=Math.min(this.sunburstStoreValue.depthLow+l.depthGap,this.sunburstStoreValue.depthMax)):console.error("No more arc domain from the stack to pop!")}else{const l=1/(this.sunburstStoreValue.depthMax+1);this.sunburstStoreValue.depthLow=t.depth,this.sunburstStoreValue.depthHigh=Math.min(t.depth+a,this.sunburstStoreValue.depthMax),n={x0:t.x0,x1:t.x1,y0:t.y0,y1:t.y0+l*(this.sunburstStoreValue.depthHigh-this.sunburstStoreValue.depthLow+1)};const u={x0:i[0],x1:i[1],y0:s[0],y1:s[1],node:this.curHeadNode,depthGap:a};this.arcDomainStack.push(u)}const o=new Array(this.sunburstStoreValue.depthMax).fill("");r.ancestors().forEach(l=>{if(l.depth>0){const u=this.getFeatureColor(l.data.f);o[l.depth-1]=u}}),this.sunburstStoreValue.depthColors=o,this.sunburstStore.set(this.sunburstStoreValue),this.curHeadNode=r,this.sunburstUpdated(),this.arcZoom(n)}function B7(e,t){if(e.currentTarget===null)return;t.ancestors().filter(r=>r.depth>0).forEach(r=>{const i=this.svg.select(`path#arc-${r.data.nid}`);z.select(i.node().parentElement).raise(),i.classed("highlighted",!0)})}function U7(e,t){if(e.currentTarget===null)return;t.ancestors().filter(r=>r.depth>0).forEach(r=>{this.svg.select(`path#arc-${r.data.nid}`).classed("highlighted",!1)})}function Z7(e,t){e.preventDefault(),e.stopPropagation(),this.arcMouseenterHandler(e,t),vs!==null&&(window.clearTimeout(vs),vs=null);const n=()=>{if(t.data.t===void 0)return;const r=t.data.t;this.treeWindowStoreValue.treeID=+r;const i=t.ancestors().filter(a=>a.depth!==0).map(a=>a.data.f).reverse();this.treeWindowStoreValue.ancestorFs=i;const s=this.getTreeWindowPos(t);this.treeWindowStoreValue.x=s.x,this.treeWindowStoreValue.y=s.y,this.treeWindowStoreValue.show=!0,this.treeWindowStore.set(this.treeWindowStoreValue),this.curHeadNode.value&&this.curHeadNode.value<300&&this.svg.select(".arc-group").selectAll(`path.arc.leaf-${r}`).filter(o=>o.data.nid!==t.data.nid).classed("same-leaf-highlight",!0),yi=null};this.treeWindowStoreValue.show||new Date().getTime()-g2<500?n():yi=window.setTimeout(n,Te.time.mouseenterDelay)}function j7(e,t){t.data.t!==void 0&&(e.preventDefault(),e.stopPropagation(),this.arcMouseleaveHandler(e,t),this.curHeadNode.value&&this.curHeadNode.value<300&&this.svg.select(".arc-group").selectAll(`path.arc.leaf-${t.data.t}`).classed("same-leaf-highlight",!1),yi!==null&&(window.clearTimeout(yi),yi=null),vs=window.setTimeout(()=>{this.treeWindowStoreValue.show=!1,this.treeWindowStore.set(this.treeWindowStoreValue),g2=new Date().getTime()},100))}function X7(e){let t=(this.xScale(e.x0)+this.xScale(e.x1))/2-Math.PI/2;const n=this.yScale(e.y1)+8,r={x:Math.cos(t)*n,y:Math.sin(t)*n,quad:Math.floor(t/(Math.PI/2))+2};e.x0===this.xScale.domain()[0]&&e.x1===this.xScale.domain()[1]&&(r.x=Math.cos(-Math.PI/4)*n,r.y=Math.sin(-Math.PI/4)*n,r.quad=1);const i=u=>{const f={x:0,y:0};switch(u.quad){case 1:{f.x=u.x,f.y=u.y-Te.layout.treeWindowHeight;break}case 2:{f.x=u.x,f.y=u.y;break}case 3:{f.x=u.x-Te.layout.treeWindowWidth,f.y=u.y;break}case 4:{f.x=u.x-Te.layout.treeWindowWidth,f.y=u.y-Te.layout.treeWindowHeight;break}default:console.warn("Unknown quad!")}return f};let s=window.innerHeight;z.select(".timbertrek-page").size()>0&&(s=z.select(".timbertrek-page").node().getBoundingClientRect().height);const a=5,o=this.svg.node().getBoundingClientRect(),c={x:o.x+o.width/2,y:o.y+o.height/2};let l=i(r);if(l.y+c.ys-a){const u=s-a-c.y-Te.layout.treeWindowHeight;t=Math.asin(u/n),r.quad===3&&(t=Math.PI-t),r.x=Math.cos(t)*n,r.y=Math.sin(t)*n,r.quad=Math.floor(t/(Math.PI/2))+2,l=i(r)}return l.x=c.x+l.x,l.y=c.y+l.y,l}function q7(e,t){if(e.preventDefault(),e.stopPropagation(),localStorage.getItem("treeWindowPinnedOnce")!=="true"&&localStorage.setItem("treeWindowPinnedOnce","true"),t.data.t===void 0)return;const n=t.data.t,r=this.treeWindowStoreValue.treeMap.get(n);if(r===void 0)return;const i=this.getTreeWindowPos(t),s={x:i.x,y:i.y,width:Te.layout.treeWindowWidth,height:Te.layout.treeWindowHeight},a={x:20,y:20};if(this.pinnedTreeStoreValue.lastActiveTreeID!==null){const o=this.pinnedTreeStoreValue.pinnedTrees.filter(c=>c.treeID===this.pinnedTreeStoreValue.lastActiveTreeID)[0];a.x=o.x+20,a.y=o.y+30}if(this.pinnedTreeStoreValue.pinnedTrees.map(o=>o.treeID).includes(n)){let o=-1;for(let l=0;l{}};this.pinnedTreeStoreValue.pinnedTrees.push(o),this.pinnedTreeStore.set(this.pinnedTreeStoreValue)}}function J7(){const t=this.treeWindowStoreValue.treeMap.get(412);if(t!==void 0){const n={x:70,y:150};if(this.pinnedTreeStoreValue.lastActiveTreeID!==null){const i=this.pinnedTreeStoreValue.pinnedTrees.filter(s=>s.treeID===this.pinnedTreeStoreValue.lastActiveTreeID)[0];n.x=i.x+20,n.y=i.y+30}const r={tree:t[0],treeMetric:Or(t[2],4),treeID:412,x:n.x,y:n.y,startPos:{x:0,y:0,width:0,height:0},isFav:!1,isPinned:!0,note:"",jiggle:()=>{}};this.pinnedTreeStoreValue.pinnedTrees.push(r),this.pinnedTreeStore.set(this.pinnedTreeStoreValue)}}let Vn=null;function Q7(){this.treeMapMap.forEach((n,r)=>{n[2]>=this.localAccuracyLow&&n[2]<=this.localAccuracyHigh?this.selectedTrees.accuracy.add(r):this.selectedTrees.accuracy.delete(r)});const e=new Set;for(const n of this.selectedTrees.accuracy)this.selectedTrees.depth.has(n)&&this.selectedTrees.minSample.has(n)&&this.selectedTrees.allFeature.has(n)&&this.selectedTrees.height.has(n)&&e.add(n);this.dataRoot.eachBefore(n=>{n.data.t!==void 0&&(e.has(n.data.t)?n.data.u=!0:n.data.u=!1)}),this.dataRoot=this.dataRoot.sum(n=>n.u!==void 0&&n.u?1:0);const t=z.partition()(this.dataRoot);t.eachAfter(n=>{var r;if(n.data.u!==void 0&&n.data.u)n.uniqueTreeIDs=new Set([n.data.t]);else{const i=new Set;(r=n.children)==null||r.forEach(s=>{var a;(a=s.uniqueTreeIDs)==null||a.forEach(o=>{i.add(o)})}),n.uniqueTreeIDs=i}}),t.each(n=>{var r;n.treeNum=((r=n.uniqueTreeIDs)==null?void 0:r.size)||0,n.uniqueTreeIDs=null}),this.partition=t,this.updateSunburst(),this.searchStoreValue.updatePlots!==null&&this.searchStoreValue.updatePlots(this.selectedTrees,!1)}function K7(){if(this.searchStoreValue.treeMinSampleMap===null)return;for(const[n,r]of this.searchStoreValue.treeMinSampleMap)r>=this.localMinSampleLow&&r<=this.localMinSampleHigh?this.selectedTrees.minSample.add(n):this.selectedTrees.minSample.delete(n);const e=new Set;for(const n of this.selectedTrees.accuracy)this.selectedTrees.depth.has(n)&&this.selectedTrees.minSample.has(n)&&this.selectedTrees.allFeature.has(n)&&this.selectedTrees.height.has(n)&&e.add(n);this.dataRoot.eachBefore(n=>{n.data.t!==void 0&&(e.has(n.data.t)?n.data.u=!0:n.data.u=!1)}),this.dataRoot=this.dataRoot.sum(n=>n.u!==void 0&&n.u?1:0);const t=z.partition()(this.dataRoot);t.eachAfter(n=>{var r;if(n.data.u!==void 0&&n.data.u)n.uniqueTreeIDs=new Set([n.data.t]);else{const i=new Set;(r=n.children)==null||r.forEach(s=>{var a;(a=s.uniqueTreeIDs)==null||a.forEach(o=>{i.add(o)})}),n.uniqueTreeIDs=i}}),t.each(n=>{var r;n.treeNum=((r=n.uniqueTreeIDs)==null?void 0:r.size)||0,n.uniqueTreeIDs=null}),this.partition=t,this.updateSunburst(),this.searchStoreValue.updatePlots!==null&&this.searchStoreValue.updatePlots(this.selectedTrees,!1)}function $7(){if(this.searchStoreValue.treeHeightMap===null)return;this.searchStoreValue.treeHeightMap.forEach((n,r)=>{this.localHeightRange.has(n)?this.selectedTrees.height.add(r):this.selectedTrees.height.delete(r)});const e=new Set;for(const n of this.selectedTrees.accuracy)this.selectedTrees.depth.has(n)&&this.selectedTrees.minSample.has(n)&&this.selectedTrees.allFeature.has(n)&&this.selectedTrees.height.has(n)&&e.add(n);this.dataRoot.eachBefore(n=>{const r=n;r.previous={x0:r.x0,x1:r.x1,y0:r.y0,y1:r.y1,data:r.data},n.data.t!==void 0&&(e.has(n.data.t)?n.data.u=!0:n.data.u=!1)}),this.dataRoot=this.dataRoot.sum(n=>n.u!==void 0&&n.u?1:0);const t=z.partition()(this.dataRoot);t.eachAfter(n=>{var r;if(n.data.u!==void 0&&n.data.u)n.uniqueTreeIDs=new Set([n.data.t]);else{const i=new Set;(r=n.children)==null||r.forEach(s=>{var a;(a=s.uniqueTreeIDs)==null||a.forEach(o=>{i.add(o)})}),n.uniqueTreeIDs=i}}),t.each(n=>{var r;n.treeNum=((r=n.uniqueTreeIDs)==null?void 0:r.size)||0,n.uniqueTreeIDs=null}),this.partition=t,this.updateSunburstWithAnimation(),this.searchStoreValue.updatePlots!==null&&this.searchStoreValue.updatePlots(this.selectedTrees,!0)}function ed(){if(this.searchStoreValue.treeDepthFeaturesMap===null)return;for(const[n,r]of this.searchStoreValue.treeDepthFeaturesMap){let i=!0;e:for(const[s,a]of r)for(const o of a)if(!this.localDepthFeatures.get(s).has(o)){i=!1;break e}i?this.selectedTrees.depth.add(n):this.selectedTrees.depth.delete(n)}const e=new Set;for(const n of this.selectedTrees.accuracy)this.selectedTrees.depth.has(n)&&this.selectedTrees.minSample.has(n)&&this.selectedTrees.allFeature.has(n)&&this.selectedTrees.height.has(n)&&e.add(n);this.dataRoot.eachBefore(n=>{const r=n;r.previous={x0:r.x0,x1:r.x1,y0:r.y0,y1:r.y1,data:r.data},n.data.t!==void 0&&(e.has(n.data.t)?n.data.u=!0:n.data.u=!1)}),this.dataRoot=this.dataRoot.sum(n=>n.u!==void 0&&n.u?1:0);const t=z.partition()(this.dataRoot);t.eachAfter(n=>{var r;if(n.data.u!==void 0&&n.data.u)n.uniqueTreeIDs=new Set([n.data.t]);else{const i=new Set;(r=n.children)==null||r.forEach(s=>{var a;(a=s.uniqueTreeIDs)==null||a.forEach(o=>{i.add(o)})}),n.uniqueTreeIDs=i}}),t.each(n=>{var r;n.treeNum=((r=n.uniqueTreeIDs)==null?void 0:r.size)||0,n.uniqueTreeIDs=null}),this.partition=t,this.updateSunburstWithAnimation(),this.searchStoreValue.updatePlots!==null&&this.searchStoreValue.updatePlots(this.selectedTrees,!0)}function td(){if(this.searchStoreValue.treeDepthFeaturesMap===null)return;for(const[n,r]of this.searchStoreValue.treeDepthFeaturesMap){let i=!0;e:for(const[s,a]of r)for(const o of a)if(!this.localAllFeatures.has(o)){i=!1;break e}i?this.selectedTrees.allFeature.add(n):this.selectedTrees.allFeature.delete(n)}const e=new Set;for(const n of this.selectedTrees.accuracy)this.selectedTrees.depth.has(n)&&this.selectedTrees.minSample.has(n)&&this.selectedTrees.allFeature.has(n)&&this.selectedTrees.height.has(n)&&e.add(n);this.dataRoot.eachBefore(n=>{const r=n;r.previous={x0:r.x0,x1:r.x1,y0:r.y0,y1:r.y1,data:r.data},n.data.t!==void 0&&(e.has(n.data.t)?n.data.u=!0:n.data.u=!1)}),this.dataRoot=this.dataRoot.sum(n=>n.u!==void 0&&n.u?1:0);const t=z.partition()(this.dataRoot);t.eachAfter(n=>{var r;if(n.data.u!==void 0&&n.data.u)n.uniqueTreeIDs=new Set([n.data.t]);else{const i=new Set;(r=n.children)==null||r.forEach(s=>{var a;(a=s.uniqueTreeIDs)==null||a.forEach(o=>{i.add(o)})}),n.uniqueTreeIDs=i}}),t.each(n=>{var r;n.treeNum=((r=n.uniqueTreeIDs)==null?void 0:r.size)||0,n.uniqueTreeIDs=null}),this.partition=t,this.updateSunburstWithAnimation(),this.searchStoreValue.updatePlots!==null&&this.searchStoreValue.updatePlots(this.selectedTrees,!0)}function nd(e=500){const t=this.svg.select(".content-group"),n=z.transition().duration(e).ease(z.easeLinear);this.removeText(),this.arcDomainStack.forEach(i=>{i.x0=i.node.x0,i.x1=i.node.x1}),t.select(".arc-group").selectAll("g.arc").data(this.partition.descendants().slice(1),i=>i.data.nid).select("path").transition(n).tween("data",i=>{const s={x0:i.x0,x1:i.x1,y0:i.y0,y1:i.y1,data:i.data},a=z.interpolate(i.previous,s),o=z.interpolate(this.xScale.domain(),[this.curHeadNode.x0,this.curHeadNode.x1]);return c=>{this.xScale.domain(o(c)),i.previous=a(c)}}).style("display",i=>i.data.f===";"||i.depth>this.sunburstStoreValue.depthHigh+1?"none":(i.value!==void 0&&i.value===0,"initial")).attrTween("d",i=>()=>this.arc(i.previous)).on("end",(i,s,a)=>{const o=z.select(a[s]);let c="initial";i.data.f===";"||i.depth>this.sunburstStoreValue.depthHigh+1||i.value!==void 0&&i.value===0?c="none":c="initial",o.style("display",c)}),Vn!==null&&(window.clearTimeout(Vn),Vn=null),Vn=window.setTimeout(()=>{this.drawCenterText(),this.drawText()},700),this.sunburstUpdated()}function rd(){const e=this.svg.select(".content-group");this.removeText(),this.arcDomainStack.forEach(t=>{t.x0=t.node.x0,t.x1=t.node.x1}),this.xScale.domain([this.curHeadNode.x0,this.curHeadNode.x1]),e.select(".arc-group").selectAll("g.arc").data(this.partition.descendants().slice(1),t=>t.data.nid).select("path").attr("d",t=>this.arc(t)).style("display",t=>t.data.f===";"||t.depth>this.sunburstStoreValue.depthHigh+1||t.value!==void 0&&t.value===0?"none":"initial"),Vn!==null&&(window.clearTimeout(Vn),Vn=null),Vn=window.setTimeout(()=>{this.drawCenterText(),this.drawText()},500),this.sunburstUpdated()}const is=800;var Bs,m2,Us,y2,Zs,w2,js,v2,Xs,b2,qs,C2,Js,S2;class wc{constructor({component:t,data:n,initDepthGap:r=2,sunburstStore:i,treeWindowStore:s,pinnedTreeStore:a,searchStore:o,sunburstUpdated:c}){ye(this,Bs);ye(this,Us);ye(this,Zs);ye(this,js);ye(this,Xs);ye(this,qs);ye(this,Js);N(this,"svg");N(this,"sunburstStore");N(this,"sunburstStoreValue");N(this,"treeWindowStore");N(this,"treeWindowStoreValue");N(this,"pinnedTreeStore");N(this,"pinnedTreeStoreValue");N(this,"searchStore");N(this,"searchStoreValue");N(this,"sunburstUpdated");N(this,"padding");N(this,"width");N(this,"height");N(this,"maxRadius");N(this,"xScale");N(this,"yScale");N(this,"textFontScale");N(this,"data");N(this,"dataRoot");N(this,"treeMapMap");N(this,"partition");N(this,"totalPathNum");N(this,"totalTreeNum");N(this,"featureCount");N(this,"featureValueCount");N(this,"featureOrder");N(this,"arc");N(this,"featureMap");N(this,"colorScale");N(this,"arcDomainStack");N(this,"curHeadNode");N(this,"localAccuracyLow");N(this,"localAccuracyHigh");N(this,"localMinSampleLow");N(this,"localMinSampleHigh");N(this,"localHeightRange");N(this,"localDepthFeatures");N(this,"localAllFeatures");N(this,"viewInitialized",!1);N(this,"selectedTrees");N(this,"textArc",I7);N(this,"doesTextFitArc",E7);N(this,"removeText",G7);N(this,"drawText",W7);N(this,"drawSecondaryText",O7);N(this,"drawCenterText",z7);N(this,"arcClicked",Y7);N(this,"arcMouseenterHandler",B7);N(this,"arcMouseleaveHandler",U7);N(this,"leafArcClickHandler",q7);N(this,"leafArcMouseenterHandler",Z7);N(this,"leafArcMouseleaveHandler",j7);N(this,"getTreeWindowPos",X7);N(this,"tempShowPinnedTree",J7);N(this,"syncAccuracyRange",Q7);N(this,"syncMinSampleRange",K7);N(this,"updateSunburst",rd);N(this,"updateSunburstWithAnimation",nd);N(this,"syncHeightRange",$7);N(this,"syncDepthFeatures",ed);N(this,"syncAllFeatures",td);N(this,"getFeatureColor",t=>this.colorScale(this.getFeatureNameValue(t,gr.First,gi.PairString)));this.svg=z.select(t).select("svg").attr("width","100%").attr("height","100%").attr("viewbox","0 0 650 650").attr("preserveAspectRatio","none"),this.padding={top:10,bottom:10,left:10,right:10};const l=this.svg.node().getBoundingClientRect();this.width=l.width-this.padding.left-this.padding.right,this.height=l.height-this.padding.top-this.padding.bottom,this.data=n.trie,this.treeMapMap=new Map,Object.keys(n.treeMap).forEach(u=>{this.treeMapMap.set(+u,n.treeMap[+u])}),this.featureMap=new Map;for(const[u,f]of Object.entries(n.featureMap))this.featureMap.set(parseInt(u),f);this.featureCount=new Map,this.featureValueCount=new Map,this.colorScale=z.scaleOrdinal(),this.featureOrder=[],this.dataRoot=z.hierarchy(this.data,u=>u.c).sum(u=>u.f==="_"?1:0),this.partition=se(this,Bs,m2).call(this),this.curHeadNode=this.partition,this.totalTreeNum=this.partition.treeNum,this.totalPathNum=this.partition.value,this.sunburstStore=i,this.sunburstStoreValue=vl(),se(this,Zs,w2).call(this,r),this.treeWindowStore=s,this.treeWindowStoreValue=bl(),se(this,js,v2).call(this),this.pinnedTreeStore=a,this.pinnedTreeStoreValue=Hr(),se(this,Xs,b2).call(this),this.searchStore=o,this.searchStoreValue=Nr(),this.localAccuracyLow=this.searchStoreValue.curAccuracyLow,this.localAccuracyHigh=this.searchStoreValue.curAccuracyHigh,this.localMinSampleLow=this.searchStoreValue.curMinSampleLow,this.localMinSampleHigh=this.searchStoreValue.curMinSampleHigh,this.localHeightRange=new Set([...this.searchStoreValue.curHeightRange]),this.localDepthFeatures=so(this.searchStoreValue.curDepthFeatures),this.localAllFeatures=new Set([...this.searchStoreValue.curAllFeatures]),this.selectedTrees={accuracy:new Set(this.treeMapMap.keys()),minSample:new Set(this.treeMapMap.keys()),height:new Set(this.treeMapMap.keys()),depth:new Set(this.treeMapMap.keys()),allFeature:new Set(this.treeMapMap.keys())},se(this,qs,C2).call(this),this.sunburstUpdated=c,this.maxRadius=this.width/2,this.xScale=z.scaleLinear().domain([0,1]).range([0,2*Math.PI]).clamp(!0),this.yScale=z.scaleLinear().domain([0,1]).range([0,this.maxRadius]),this.textFontScale=z.scaleLinear().domain([1,this.sunburstStoreValue.depthMax-1]).range([.93,.7]),this.arcDomainStack=[],this.arc=z.arc().startAngle(u=>this.xScale(u.x0)).endAngle(u=>{const f=u;let h=f.x1;return f.x0===f.x1&&(h=f.x0+1e-6),this.xScale(h)}).padAngle(u=>{const f=u,h=this.xScale(u.x1)-this.xScale(u.x0);return f.data.f==="_"?h<.001?0:Math.min(h/2,.015):0}).padRadius(this.radius*1.5).innerRadius(u=>Math.max(0,this.yScale(u.y0))).outerRadius(u=>Math.max(this.yScale(u.y0),this.yScale(u.y1)-1)),console.time("Draw sunburst"),this.initView(),this.viewInitialized=!0,console.timeEnd("Draw sunburst")}get radius(){return this.width/(2*(this.sunburstStoreValue.depthMax-this.sunburstStoreValue.depthLow+1))}getFeatureInfo(t){const n={name:"",value:"",nameValue:"",short:"",shortValue:""},r=parseInt(t);if(!isNaN(r)){const i=this.featureMap.get(r);i!==void 0&&(n.name=i[0],n.value=i[1],n.short=i[2],n.nameValue=`${n.name} ${n.value}`,n.shortValue=`${n.short} ${n.value}`)}return n}getFeatureNameValue(t,n=gr.First,r=gi.PairArray){let i=-1;if(t.includes(" "))switch(n){case gr.First:i=+t.replace(/(.*)\s.*/,"$1");break;case gr.Second:i=+t.replace(/.*\s(.*)/,"$1");break;case gr.Both:i=+t.replace(/(.*)\s.*/,"$1");break;default:console.error("Unknown cases")}else i=+t;switch(r){case gi.PairArray:return isNaN(i)?["",""]:this.featureMap.get(i);case gi.PairString:{if(isNaN(i))return"";const s=this.featureMap.get(i);return s!==void 0?`${s[0]}:${s[1]}`:(console.error(`Encounter unrecorded key ${i}`),"")}}}initView(){const t=this.svg.append("g").attr("class","content-group").attr("transform",`translate(${this.padding.left+this.width/2}, ${this.padding.top+this.height/2})`);t.append("g").attr("class","mid-circle-group");const n=t.append("g").attr("class","arc-group");t.append("g").attr("class","text-group");const r=n.selectAll("g.arc").data(this.partition.descendants().slice(1),a=>a.data.nid).join("g").attr("class",a=>`arc arc-${a.depth} ${a.data.f==="_"?"leaf leaf-".concat(String(a.data.t)):""}`).classed("leaf",a=>a.data.f==="_");r.append("path").attr("class","arc").attr("class",a=>`arc arc-${a.depth} ${a.data.f==="_"?"leaf leaf-".concat(String(a.data.t)):""}`).attr("id",a=>`arc-${a.data.nid}`).attr("d",a=>this.arc(a)).on("click",(a,o)=>this.arcClicked(a,o)).on("mouseenter",(a,o)=>this.arcMouseenterHandler(a,o)).on("mouseleave",(a,o)=>this.arcMouseleaveHandler(a,o)).style("fill",a=>a.data.f==="_"?"null":this.getFeatureColor(a.data.f)).style("display",a=>a.data.f===";"||a.depth>this.sunburstStoreValue.depthHigh+1?"none":"initial").filter(a=>a.data.f==="_").on("click",(a,o)=>this.leafArcClickHandler(a,o)).on("mouseenter",(a,o)=>this.leafArcMouseenterHandler(a,o)).on("mouseleave",(a,o)=>this.leafArcMouseleaveHandler(a,o)),r.append("title").text(a=>this.getFeatureInfo(a.data.f).nameValue);const s=1/(this.sunburstStoreValue.depthMax+1);this.arcZoom({x0:this.xScale.domain()[0],x1:this.xScale.domain()[1],y0:0,y1:(this.sunburstStoreValue.depthHigh+1)*s},500)}arcZoom(t,n=is){this.removeText(),se(this,Js,S2).call(this,t),this.svg.select(".arc-group").transition().duration(n).ease(z.easeCubicInOut).tween("zoom",()=>{const i=z.interpolate(this.xScale.domain(),[t.x0,t.x1]),s=z.interpolate(this.yScale.domain(),[t.y0,t.y1]);return a=>{this.xScale.domain(i(a)),this.yScale.domain(s(a))}}).on("end",()=>{this.drawText(),this.drawCenterText()}).selectAll(".arc").attrTween("d",i=>()=>this.arc(i)).style("fill-opacity",i=>i.depth>this.sunburstStoreValue.depthHigh?.2:1).style("pointer-events",i=>i.depth>this.sunburstStoreValue.depthHigh?"none":"initial").style("display",i=>{const s=i;return s.data.f===";"||s.depth>this.sunburstStoreValue.depthHigh+1?"none":"initial"})}}Bs=new WeakSet,m2=function(){let t=0;this.dataRoot.eachBefore(r=>{r.data.f==="_"&&(r.data.u=!0),r.data.nid=t++});for(const[r,i]of this.featureMap){if(this.featureValueCount.has(i[0]))this.featureValueCount.get(i[0]).set(i[1],0);else{const s=new Map;s.set(i[1],0),this.featureValueCount.set(i[0],s)}this.featureCount.has(i[0])||this.featureCount.set(i[0],0)}this.dataRoot.children.forEach(r=>{const[i,s]=this.getFeatureNameValue(r.data.f);this.featureCount.set(i,this.featureCount.get(i)+r.value),this.featureValueCount.get(i).set(s,this.featureValueCount.get(i).get(s)+r.value)}),this.featureCount.set("",0),this.colorScale=se(this,Us,y2).call(this),this.dataRoot=this.dataRoot.sort((r,i)=>{const s=this.getFeatureInfo(r.data.f).name,a=this.getFeatureInfo(i.data.f).name,o=this.featureCount.get(s),c=this.featureCount.get(a),l=z.lch(this.getFeatureColor(r.data.f)).l,u=z.lch(this.getFeatureColor(i.data.f)).l;return o!==void 0&&c!==void 0?c-o||s.localeCompare(a)||l-u:(console.warn(`Encountered unrecorded keys '${s}', '${a}'`),0)}),this.featureOrder=this.dataRoot.children.map(r=>parseInt(r.data.f)),this.featureMap.forEach((r,i)=>{if(!this.featureOrder.includes(i)){const s=[];this.featureMap.forEach((a,o)=>{a[0]===r[0]&&this.featureOrder.indexOf(o)!==-1&&s.push(this.featureOrder.indexOf(o))}),this.featureOrder.splice(Math.max(...s)+1,0,i)}});const n=z.partition()(this.dataRoot);return n.eachAfter(r=>{var i;if(r.data.f==="_")r.uniqueTreeIDs=new Set([r.data.t]);else{const s=new Set;(i=r.children)==null||i.forEach(a=>{var o;(o=a.uniqueTreeIDs)==null||o.forEach(c=>{s.add(c)})}),r.uniqueTreeIDs=s}}),n.each(r=>{var i;r.treeNum=((i=r.uniqueTreeIDs)==null?void 0:i.size)||0,r.uniqueTreeIDs=null}),n},Us=new WeakSet,y2=function(){const t=[],n=[],s=[z.lch(49.184,30.07,260.445),z.lch(68.968,73.064,62.176),z.lch(56.278,61.87,27.615),z.lch(60.11,50.293,135.863),z.lch(82.442,65.798,87.008),z.lch(69.948,22.911,191.071),z.lch(57.703,28.677,334.556),z.lch(52.777,22.881,53.64)],a=new Map;for(const[l,u]of s.entries())a.set(l,[0,u]);return Array.from(this.featureCount.keys()).filter(l=>l!=="").sort((l,u)=>this.featureCount.get(u)-this.featureCount.get(l)).forEach((l,u)=>{let f,h;if(u>7){console.warn("Number of feature is greater than 8:",l);let v=-1,S=1/0;for(let b=0;bthis.featureValueCount.get(l).get(S)-this.featureValueCount.get(l).get(v)),g=p.length;let d=f;if(f.l+g*20<=92)p.forEach((v,S)=>{const b=`${l}:${v}`;d=z.lch(f.l+S*20,f.c,f.h),t.push(b),n.push(d.formatHsl())});else{const v=(92-f.l)/g;p.forEach((S,b)=>{const _=`${l}:${S}`;d=z.lch(f.l+b*v,f.c,f.h),t.push(_),n.push(d.formatHsl())})}const m=z.lch(d.l+10,d.c,d.h);a.set(h,[a.get(h)[0]+g,m])}),z.scaleOrdinal(n).domain(t)},Zs=new WeakSet,w2=function(t){this.sunburstStore.subscribe(n=>{switch(this.sunburstStoreValue=n,this.sunburstStoreValue.action){case Qn.DepthChanged:{this.sunburstStoreValue.action=Qn.None;const r=1/(this.sunburstStoreValue.depthMax+1),i=this.arcDomainStack.length>0?this.yScale.domain()[0]:0;this.arcZoom({x0:this.xScale.domain()[0],x1:this.xScale.domain()[1],y0:i,y1:(this.sunburstStoreValue.depthHigh+1)*r},500),this.sunburstStore.set(this.sunburstStoreValue);break}case Qn.None:break;default:console.error("Unknown case in sunburstStore action")}}),this.sunburstStoreValue.depthMax=this.partition.height,this.sunburstStoreValue.depthLow=1,this.sunburstStoreValue.depthHigh=this.sunburstStoreValue.depthLow+t,this.sunburstStoreValue.action=Qn.None,this.sunburstStoreValue.depthColors=new Array(this.sunburstStoreValue.depthMax).fill(""),this.sunburstStore.set(this.sunburstStoreValue)},js=new WeakSet,v2=function(){this.treeWindowStore.subscribe(t=>{this.treeWindowStoreValue=t}),this.treeWindowStoreValue.getFeatureColor=this.getFeatureColor,this.treeWindowStore.set(this.treeWindowStoreValue)},Xs=new WeakSet,b2=function(){this.pinnedTreeStore.subscribe(t=>{this.pinnedTreeStoreValue=t}),this.pinnedTreeStoreValue.getFeatureColor=this.getFeatureColor,this.pinnedTreeStoreValue.getFeatureInfo=t=>this.getFeatureInfo(t),this.pinnedTreeStore.set(this.pinnedTreeStoreValue)},qs=new WeakSet,C2=function(){this.searchStore.subscribe(n=>{this.searchStoreValue=n,this.viewInitialized&&this.searchStoreValue.shown&&(this.searchStoreValue.curAccuracyHigh!==this.localAccuracyHigh||this.searchStoreValue.curAccuracyLow!==this.localAccuracyLow)?(this.localAccuracyHigh=this.searchStoreValue.curAccuracyHigh,this.localAccuracyLow=this.searchStoreValue.curAccuracyLow,this.syncAccuracyRange()):(this.localAccuracyHigh=this.searchStoreValue.curAccuracyHigh,this.localAccuracyLow=this.searchStoreValue.curAccuracyLow),this.viewInitialized&&this.searchStoreValue.shown&&(this.searchStoreValue.curMinSampleHigh!==this.localMinSampleHigh||this.searchStoreValue.curMinSampleLow!==this.localMinSampleLow)?(this.localMinSampleHigh=this.searchStoreValue.curMinSampleHigh,this.localMinSampleLow=this.searchStoreValue.curMinSampleLow,this.syncMinSampleRange()):(this.localMinSampleHigh=this.searchStoreValue.curMinSampleHigh,this.localMinSampleLow=this.searchStoreValue.curMinSampleLow);const r=[...this.localHeightRange].every(a=>this.searchStoreValue.curHeightRange.has(a))&&this.localHeightRange.size===this.searchStoreValue.curHeightRange.size;this.viewInitialized&&this.searchStoreValue.shown&&!r?(this.localHeightRange=new Set([...this.searchStoreValue.curHeightRange]),this.syncHeightRange()):this.localHeightRange=new Set([...this.searchStoreValue.curHeightRange]);const i=[...this.searchStoreValue.curDepthFeatures.entries()].every(a=>this.localDepthFeatures.has(a[0])?pc(this.localDepthFeatures.get(a[0]),a[1]):!1);this.viewInitialized&&this.searchStoreValue.shown&&!i?(this.localDepthFeatures=so(this.searchStoreValue.curDepthFeatures),this.syncDepthFeatures()):this.localDepthFeatures=so(this.searchStoreValue.curDepthFeatures);const s=pc(this.localAllFeatures,this.searchStoreValue.curAllFeatures);this.viewInitialized&&this.searchStoreValue.shown&&!s?(this.localAllFeatures=new Set([...this.searchStoreValue.curAllFeatures]),this.syncAllFeatures()):this.localAllFeatures=new Set([...this.searchStoreValue.curAllFeatures])}),this.searchStoreValue.getFeatureColor=this.getFeatureColor,this.searchStoreValue.featureMap=this.featureMap,this.searchStoreValue.featureOrder=this.featureOrder;for(let n=1;ni));this.searchStoreValue.curDepthFeatures.set(n,r)}const t=new Set([...this.featureMap.keys()].map(n=>n));this.searchStoreValue.curAllFeatures=t,this.searchStore.set(this.searchStoreValue)},Js=new WeakSet,S2=function(t){let n=!1;this.arcDomainStack.length>0&&(n=this.curHeadNode.depth-this.arcDomainStack[this.arcDomainStack.length-1].node.depth!==1);const r=this.svg.select("g.content-group").selectAll("g.mid-circle-group").data([0]).join("g").attr("class","mid-circle-group").raise(),i=this.curHeadNode.ancestors().filter(u=>u.depth!==0),s=z.scaleLinear().domain([t.y0,t.y1]).range([0,this.maxRadius]),a=s(this.curHeadNode.y1)-s(this.curHeadNode.y0),o=i.map(u=>u.depth),c=z.scaleLinear().domain([z.min(o)-1,z.max(o)]).range([0,a]),l=c(1);r.selectAll("g.mid-circle").data(i,u=>u.value).join(u=>{const f=u.append("g").attr("class","mid-circle").on("click",h=>this.arcClicked(h,null));return f.append("circle").attr("r",0).style("fill",h=>this.getFeatureColor(h.data.f)).call(h=>h.transition().duration(0).delay(n?is-100:is+100).attr("r",p=>c(p.depth))),f.append("path").attr("class","mid-circle-text-arc").attr("id",h=>`mid-circle-text-arc-${h.depth}`).attr("d",h=>{const p=[Math.PI*.5,Math.PI*2.5],g=l*(h.depth-.5),d=z.path();return d.arc(0,0,g,p[0],p[1],!1),d.toString()}),f.append("title").text(h=>this.getFeatureInfo(h.data.f).nameValue),f},u=>{const f=u;return f.select("circle").transition("zoom").duration(is).ease(z.easeCubicInOut).attr("r",h=>c(h.depth)),f.select("path").attr("d",h=>{const p=[Math.PI*.5,Math.PI*2.5],g=l*(h.depth-.5),d=z.path();return d.arc(0,0,g,p[0],p[1],!1),d.toString()}),f})};const so=e=>{const t=new Map;return e.forEach((n,r)=>{t.set(r,new Set([...n]))}),t};const kn="src/components/sunburst/Sunburst.svelte";function Vo(e){var k,H,I,M,V,E,F,R,A,C;let t,n,r,i,s,a,o,c,l,u,f=((k=e[1])==null?void 0:k.curHeadNode.value)===((H=e[1])==null?void 0:H.totalPathNum)?`${((I=e[1])==null?void 0:I.curHeadNode.value)|0}`:`${((M=e[1])==null?void 0:M.curHeadNode.value)|0}/${(V=e[1])==null?void 0:V.totalPathNum}`,h,p,g,d,m=((E=e[1])==null?void 0:E.curHeadNode.treeNum)===((F=e[1])==null?void 0:F.totalTreeNum)?`${((R=e[1])==null?void 0:R.curHeadNode.treeNum)|0}`:`${((A=e[1])==null?void 0:A.curHeadNode.treeNum)|0}/${(C=e[1])==null?void 0:C.totalTreeNum}`,v,S,b;const _={c:function(){var D,P,G;t=L("div"),n=L("div"),r=L("span"),r.textContent="No tree meets the current constraints :(",i=W(),s=L("span"),s.textContent="Try to relax the filtering in the Search Panel",a=W(),o=Dn("svg"),c=W(),l=L("div"),u=L("span"),h=ce(f),p=ce(" paths"),g=W(),d=L("span"),v=ce(m),S=ce(" trees"),w(r,"class","s-_PkX202GTJ8Y"),x(r,kn,162,4,3664),w(s,"class","s-_PkX202GTJ8Y"),x(s,kn,165,4,3738),w(n,"class","no-tree-message s-_PkX202GTJ8Y"),ge(n,"show",((D=e[1])==null?void 0:D.curHeadNode.treeNum)===0),x(n,kn,161,2,3581),w(o,"class","sunburst-svg s-_PkX202GTJ8Y"),x(o,kn,169,2,3825),w(u,"class","tree-stat s-_PkX202GTJ8Y"),x(u,kn,176,4,4066),w(d,"class","tree-stat s-_PkX202GTJ8Y"),x(d,kn,181,4,4296),w(l,"class","stat-overlay s-_PkX202GTJ8Y"),w(l,"title",b=`There are ${(P=e[1])==null?void 0:P.curHeadNode.value} decision paths `.concat(`and ${(G=e[1])==null?void 0:G.curHeadNode.treeNum} decisions trees in the current selection.`)),x(l,kn,170,2,3856),w(t,"class","sunburst s-_PkX202GTJ8Y"),x(t,kn,160,0,3534)},l:function(D){throw new Error("options.hydrate only works if the component was compiled with the `hydratable: true` option")},m:function(D,P){ae(D,t,P),y(t,n),y(n,r),y(n,i),y(n,s),y(t,a),y(t,o),y(t,c),y(t,l),y(l,u),y(u,h),y(u,p),y(l,g),y(l,d),y(d,v),y(d,S),e[9](t)},p:function(D,[P]){var G,Y,U,X,J,me,K,Q,B,ie,fe,j,$;P&2&&ge(n,"show",((G=D[1])==null?void 0:G.curHeadNode.treeNum)===0),P&2&&f!==(f=((Y=D[1])==null?void 0:Y.curHeadNode.value)===((U=D[1])==null?void 0:U.totalPathNum)?`${((X=D[1])==null?void 0:X.curHeadNode.value)|0}`:`${((J=D[1])==null?void 0:J.curHeadNode.value)|0}/${(me=D[1])==null?void 0:me.totalPathNum}`)&&Ee(h,f),P&2&&m!==(m=((K=D[1])==null?void 0:K.curHeadNode.treeNum)===((Q=D[1])==null?void 0:Q.totalTreeNum)?`${((B=D[1])==null?void 0:B.curHeadNode.treeNum)|0}`:`${((ie=D[1])==null?void 0:ie.curHeadNode.treeNum)|0}/${(fe=D[1])==null?void 0:fe.totalTreeNum}`)&&Ee(v,m),P&2&&b!==(b=`There are ${(j=D[1])==null?void 0:j.curHeadNode.value} decision paths `.concat(`and ${($=D[1])==null?void 0:$.curHeadNode.treeNum} decisions trees in the current selection.`))&&w(l,"title",b)},i:pe,o:pe,d:function(D){D&&ne(t),e[9](null)}};return ee("SvelteRegisterBlock",{block:_,id:Vo.name,type:"component",source:"",ctx:e}),_}function id(e,t,n){let{$$slots:r={},$$scope:i}=t;St("Sunburst",r,[]);let{data:s=null}=t,{sunburstStore:a=null}=t,{treeWindowStore:o=null}=t,{pinnedTreeStore:c=null}=t,{searchStore:l=null}=t,{initDepthGap:u=2}=t,f=null,h=!1,p=null;const g=()=>{n(1,p)};Ne(()=>{n(8,h=!0)});const d=()=>{f&&s&&a&&o&&l&&c&&n(1,p=new wc({component:f,data:s,initDepthGap:u,sunburstStore:a,treeWindowStore:o,pinnedTreeStore:c,searchStore:l,sunburstUpdated:g}))},m=["data","sunburstStore","treeWindowStore","pinnedTreeStore","searchStore","initDepthGap"];Object.keys(t).forEach(S=>{!~m.indexOf(S)&&S.slice(0,2)!=="$$"&&S!=="slot"&&console.warn(` was created with unknown prop '${S}'`)});function v(S){Je[S?"unshift":"push"](()=>{f=S,n(0,f)})}return e.$$set=S=>{"data"in S&&n(2,s=S.data),"sunburstStore"in S&&n(3,a=S.sunburstStore),"treeWindowStore"in S&&n(4,o=S.treeWindowStore),"pinnedTreeStore"in S&&n(5,c=S.pinnedTreeStore),"searchStore"in S&&n(6,l=S.searchStore),"initDepthGap"in S&&n(7,u=S.initDepthGap)},e.$capture_state=()=>({Sunburst:wc,onMount:Ne,config:Te,data:s,sunburstStore:a,treeWindowStore:o,pinnedTreeStore:c,searchStore:l,initDepthGap:u,component:f,mounted:h,sunburst:p,sunburstUpdated:g,initView:d}),e.$inject_state=S=>{"data"in S&&n(2,s=S.data),"sunburstStore"in S&&n(3,a=S.sunburstStore),"treeWindowStore"in S&&n(4,o=S.treeWindowStore),"pinnedTreeStore"in S&&n(5,c=S.pinnedTreeStore),"searchStore"in S&&n(6,l=S.searchStore),"initDepthGap"in S&&n(7,u=S.initDepthGap),"component"in S&&n(0,f=S.component),"mounted"in S&&n(8,h=S.mounted),"sunburst"in S&&n(1,p=S.sunburst)},t&&"$$inject"in t&&e.$inject_state(t.$$inject),e.$$.update=()=>{e.$$.dirty&381&&s&&a&&o&&c&&l&&h&&f&&d()},[f,p,s,a,o,c,l,u,h,v]}class _2 extends _t{constructor(t){super(t),Ct(this,t,id,Vo,tt,{data:2,sunburstStore:3,treeWindowStore:4,pinnedTreeStore:5,searchStore:6,initDepthGap:7}),ee("SvelteRegisterComponent",{component:this,tagName:"Sunburst_1",options:t,id:Vo.name})}get data(){throw new Error(": Props cannot be read directly from the component instance unless compiling with 'accessors: true' or ''")}set data(t){throw new Error(": Props cannot be set directly on the component instance unless compiling with 'accessors: true' or ''")}get sunburstStore(){throw new Error(": Props cannot be read directly from the component instance unless compiling with 'accessors: true' or ''")}set sunburstStore(t){throw new Error(": Props cannot be set directly on the component instance unless compiling with 'accessors: true' or ''")}get treeWindowStore(){throw new Error(": Props cannot be read directly from the component instance unless compiling with 'accessors: true' or ''")}set treeWindowStore(t){throw new Error(": Props cannot be set directly on the component instance unless compiling with 'accessors: true' or ''")}get pinnedTreeStore(){throw new Error(": Props cannot be read directly from the component instance unless compiling with 'accessors: true' or ''")}set pinnedTreeStore(t){throw new Error(": Props cannot be set directly on the component instance unless compiling with 'accessors: true' or ''")}get searchStore(){throw new Error(": Props cannot be read directly from the component instance unless compiling with 'accessors: true' or ''")}set searchStore(t){throw new Error(": Props cannot be set directly on the component instance unless compiling with 'accessors: true' or ''")}get initDepthGap(){throw new Error(": Props cannot be read directly from the component instance unless compiling with 'accessors: true' or ''")}set initDepthGap(t){throw new Error(": Props cannot be set directly on the component instance unless compiling with 'accessors: true' or ''")}}var Qs,x2,Ks,L2,$s,k2;class vc{constructor({component:t,treeMapMap:n,featureMap:r,treeWindowStore:i,treeWindowUpdated:s,width:a=150,height:o=150}){ye(this,Qs);ye(this,Ks);ye(this,$s);N(this,"treeMap");N(this,"curTreeID");N(this,"curAncestorFs");N(this,"treeWindowStore");N(this,"treeWindowStoreValue");N(this,"treeWindowUpdated");N(this,"svg");N(this,"padding");N(this,"width");N(this,"height");N(this,"getStyle",()=>`left: ${this.treeWindowStoreValue.x}px; + top: ${this.treeWindowStoreValue.y}px;`);N(this,"shouldHidePinLabel",()=>localStorage.getItem("treeWindowPinnedOnce")===null?(localStorage.setItem("treeWindowPinnedOnce","false"),!1):localStorage.getItem("treeWindowPinnedOnce")==="true");this.treeMap=n,this.curTreeID=0,this.curAncestorFs=[],this.treeWindowUpdated=s,this.treeWindowStore=i,this.treeWindowStoreValue=bl(),se(this,Qs,x2).call(this,r),this.svg=z.select(t).select("svg.tree-svg").attr("width",a).attr("height",o).attr("viewbox",`0 0 ${a} ${o}`).attr("preserveAspectRatio","none"),this.padding={top:20,bottom:20,left:0,right:0},this.width=a-this.padding.left-this.padding.right,this.height=o-this.padding.top-this.padding.bottom}get tree(){const t=this.treeMap.get(this.curTreeID);return t!==void 0?t[0]:(console.warn(`No such tree on the record ${this.curTreeID}`),null)}get treeMetric(){const t=this.treeMap.get(this.curTreeID);return t!==void 0?Or(t[2],4):null}}Qs=new WeakSet,x2=function(t){this.treeWindowStore.subscribe(n=>{this.treeWindowStoreValue=n,this.svg!==void 0&&(this.treeWindowStoreValue.treeID!==this.curTreeID||this.treeWindowStoreValue.ancestorFs.length!==this.curAncestorFs.length||!this.treeWindowStoreValue.ancestorFs.every((r,i)=>r===this.curAncestorFs[i]))&&this.treeMap.get(this.treeWindowStoreValue.treeID)&&(this.curTreeID=this.treeWindowStoreValue.treeID,this.curAncestorFs=[...this.treeWindowStoreValue.ancestorFs],se(this,Ks,L2).call(this)),this.treeWindowUpdated()}),this.treeWindowStoreValue.featureMap=t,this.treeWindowStoreValue.treeMap=this.treeMap,this.treeWindowStore.set(this.treeWindowStoreValue)},Ks=new WeakSet,L2=function(){this.svg.selectAll("g.content").remove(),se(this,$s,k2).call(this)},$s=new WeakSet,k2=function(){if(this.tree===null){console.warn("Trying to draw a tree that does not exist");return}const t=this.svg.append("g").attr("class","content").attr("transform",`translate(${this.padding.left}, ${this.padding.top})`),n=z.hierarchy(this.tree,d=>d.c),r=7,i=r*1,s=z.tree().size([this.width,this.height])(n),a=t.append("g").attr("class","link-group");a.selectAll("path.link").data(s.links()).join("path").attr("class",d=>`link link-${d.source.data.f[0]}`).attr("id",d=>{const m=d.source.ancestors().length>1?d.source.ancestors()[1].data.f[0]:"r",v=d.source.data.f[0],S=d.target.data.f[0];return d.target.data.f[0]==="+"?`link-${m}-${v}-p`:d.target.data.f[0]==="-"?`link-${m}-${v}-n`:`link-${m}-${v}-${S}`}).attr("d",d=>z.line()([[d.source.x,d.source.y],[d.target.x,d.target.y]]));const c=t.append("g").attr("class","node-group").selectAll("g").data(s.descendants()).join("g").attr("class","node").attr("transform",d=>`translate(${d.x}, ${d.y})`),l=new Set(["-","+"]);c.filter(d=>!l.has(d.data.f[0])).append("circle").attr("r",r).style("fill",d=>this.treeWindowStoreValue.getFeatureColor?this.treeWindowStoreValue.getFeatureColor(d.data.f[0]):Te.colors["gray-500"]),c.filter(d=>l.has(d.data.f[0])).append("rect").attr("x",-i).attr("y",-i).attr("rx",2).attr("ry",2).attr("width",2*i).attr("height",2*i),c.filter(d=>l.has(d.data.f[0])).append("text").attr("dy",.5).text(d=>d.data.f[0]);for(let d=0;dm===0).attr("x",d=>d.x).attr("y",d=>d.y).text((d,m)=>m===0?"true":"false")};const T2='';const{Object:sd}=wl,Zt="src/components/tree-window/TreeWindow.svelte";function Do(e){var M,V;let t,n,r,i,s=((M=e[1])==null?void 0:M.treeWindowStoreValue.treeID)+"",a,o,c,l,u=((V=e[1])==null?void 0:V.treeMetric)+"",f,h,p,g,d,m,v,S,b,_,k,H;const I={c:function(){var F,R,A;t=L("div"),n=L("div"),r=L("span"),i=ce("Tree "),a=ce(s),o=W(),c=L("span"),l=ce("("),f=ce(u),h=ce(")"),p=W(),g=L("div"),d=L("div"),m=L("div"),v=L("div"),S=W(),b=L("span"),b.textContent="pin",_=W(),k=Dn("svg"),w(r,"class","tree-name s-cr5gyj4Gsmo-"),x(r,Zt,173,4,3681),w(c,"class","tree-acc s-cr5gyj4Gsmo-"),x(c,Zt,177,4,3776),w(n,"class","tree-header s-cr5gyj4Gsmo-"),x(n,Zt,172,2,3651),w(v,"class","svg-icon s-cr5gyj4Gsmo-"),x(v,Zt,186,8,4006),w(b,"class","s-cr5gyj4Gsmo-"),x(b,Zt,189,8,4080),w(m,"class","label s-cr5gyj4Gsmo-"),x(m,Zt,185,6,3978),w(d,"class","label-container s-cr5gyj4Gsmo-"),ge(d,"no-display",(F=e[1])==null?void 0:F.shouldHidePinLabel()),x(d,Zt,181,4,3873),w(k,"class","tree-svg s-cr5gyj4Gsmo-"),x(k,Zt,193,4,4126),w(g,"class","content s-cr5gyj4Gsmo-"),x(g,Zt,180,2,3847),w(t,"class","tree-window s-cr5gyj4Gsmo-"),w(t,"style",H=(R=e[1])==null?void 0:R.getStyle()),ge(t,"show",(A=e[1])==null?void 0:A.treeWindowStoreValue.show),x(t,Zt,166,0,3510)},l:function(F){throw new Error("options.hydrate only works if the component was compiled with the `hydratable: true` option")},m:function(F,R){ae(F,t,R),y(t,n),y(n,r),y(r,i),y(r,a),y(n,o),y(n,c),y(c,l),y(c,f),y(c,h),y(t,p),y(t,g),y(g,d),y(d,m),y(m,v),v.innerHTML=T2,y(m,S),y(m,b),y(g,_),y(g,k),e[6](t)},p:function(F,[R]){var A,C,T,D,P;R&2&&s!==(s=((A=F[1])==null?void 0:A.treeWindowStoreValue.treeID)+"")&&Ee(a,s),R&2&&u!==(u=((C=F[1])==null?void 0:C.treeMetric)+"")&&Ee(f,u),R&2&&ge(d,"no-display",(T=F[1])==null?void 0:T.shouldHidePinLabel()),R&2&&H!==(H=(D=F[1])==null?void 0:D.getStyle())&&w(t,"style",H),R&2&&ge(t,"show",(P=F[1])==null?void 0:P.treeWindowStoreValue.show)},i:pe,o:pe,d:function(F){F&&ne(t),e[6](null)}};return ee("SvelteRegisterBlock",{block:I,id:Do.name,type:"component",source:"",ctx:e}),I}function ad(e,t,n){let{$$slots:r={},$$scope:i}=t;St("TreeWindow",r,[]);let{data:s=null}=t,{featureMap:a=null}=t,{treeWindowStore:o=null}=t,c=null,l=!1,u=null;Ne(()=>{n(5,l=!0)});const f=()=>{n(1,u)},h=()=>{if(c&&s&&a&&o){const d=s.treeMap,m=new Map;Object.keys(d).forEach(v=>{m.set(+v,d[+v])}),n(1,u=new vc({component:c,treeMapMap:m,featureMap:a,treeWindowStore:o,treeWindowUpdated:f}))}},p=["data","featureMap","treeWindowStore"];sd.keys(t).forEach(d=>{!~p.indexOf(d)&&d.slice(0,2)!=="$$"&&d!=="slot"&&console.warn(` was created with unknown prop '${d}'`)});function g(d){Je[d?"unshift":"push"](()=>{c=d,n(0,c)})}return e.$$set=d=>{"data"in d&&n(2,s=d.data),"featureMap"in d&&n(3,a=d.featureMap),"treeWindowStore"in d&&n(4,o=d.treeWindowStore)},e.$capture_state=()=>({onMount:Ne,TreeWindow:vc,iconClick:T2,data:s,featureMap:a,treeWindowStore:o,component:c,mounted:l,treeWindow:u,treeWindowUpdated:f,initView:h}),e.$inject_state=d=>{"data"in d&&n(2,s=d.data),"featureMap"in d&&n(3,a=d.featureMap),"treeWindowStore"in d&&n(4,o=d.treeWindowStore),"component"in d&&n(0,c=d.component),"mounted"in d&&n(5,l=d.mounted),"treeWindow"in d&&n(1,u=d.treeWindow)},t&&"$$inject"in t&&e.$inject_state(t.$$inject),e.$$.update=()=>{e.$$.dirty&61&&s&&a&&o&&l&&c&&h()},[c,u,s,a,o,l,g]}class M2 extends _t{constructor(t){super(t),Ct(this,t,ad,Do,tt,{data:2,featureMap:3,treeWindowStore:4}),ee("SvelteRegisterComponent",{component:this,tagName:"TreeWindow_1",options:t,id:Do.name})}get data(){throw new Error(": Props cannot be read directly from the component instance unless compiling with 'accessors: true' or ''")}set data(t){throw new Error(": Props cannot be set directly on the component instance unless compiling with 'accessors: true' or ''")}get featureMap(){throw new Error(": Props cannot be read directly from the component instance unless compiling with 'accessors: true' or ''")}set featureMap(t){throw new Error(": Props cannot be set directly on the component instance unless compiling with 'accessors: true' or ''")}get treeWindowStore(){throw new Error(": Props cannot be read directly from the component instance unless compiling with 'accessors: true' or ''")}set treeWindowStore(t){throw new Error(": Props cannot be set directly on the component instance unless compiling with 'accessors: true' or ''")}}const wt=8;var on,qn,ea,A2,Vi,No,ta,V2,Di,na,D2,Ni,Ho,ra,N2,ia,H2,sa,F2;class bc{constructor({component:t,pinnedTree:n,pinnedTreeStore:r,favoritesStore:i,pinnedTreeWindowUpdated:s,initSwitchChecked:a,width:o=200,height:c=200}){ye(this,on);ye(this,ea);ye(this,Vi);ye(this,ta);ye(this,na);ye(this,Ni);ye(this,ra);ye(this,ia);ye(this,sa);N(this,"pinnedTree");N(this,"pinnedTreeWindowUpdated");N(this,"svg");N(this,"padding");N(this,"width");N(this,"height");N(this,"dragRegion");N(this,"pinnedTreeStore");N(this,"pinnedTreeStoreValue");N(this,"pinnedTreeStoreUnsubscriber");N(this,"favoritesStore");N(this,"favoritesStoreValue");N(this,"favoritesStoreUnsubscriber");N(this,"sankey");N(this,"accuracyScale",null);N(this,"hidden",!0);N(this,"endPos");N(this,"node");N(this,"playLaunchingAnimation",()=>{const t=this.pinnedTree.startPos.width/this.endPos.width,n=this.pinnedTree.startPos.height/this.endPos.height,r=this.pinnedTree.startPos.x-this.endPos.x,i=this.pinnedTree.startPos.y-this.endPos.y;this.node.animate([{transformOrigin:"top left",opacity:0,transform:` translate(${r}px, ${i}px) scale(${t}, ${n}) - `},{transformOrigin:"top left",opacity:1,transform:"none"}],{duration:300,easing:"cubic-bezier(0.4, 0.0, 0.2, 1)",fill:"none"})});ye(this,Di,t=>{const n=z.color(t);let r="currentcolor";if(n!==null){const i=[252,252,252],s=[74,74,74],a=z.color(n).rgb(),o=[a.r,a.g,a.b];Yr(i,o)` - left: ${this.pinnedTree.x}px; top: ${this.pinnedTree.y}px;`);N(this,"alterLayout",()=>{this.sankey?(se(this,sa,P2).call(this),this.sankey=!1):(se(this,aa,R2).call(this),this.sankey=!0)});N(this,"heartClicked",async t=>{if(t.preventDefault(),t.stopPropagation(),se(this,on,qn).call(this),this.pinnedTree.isFav=!this.pinnedTree.isFav,this.pinnedTreeWindowUpdated(),this.pinnedTree.isFav){await yl();const n=z.select(".hidden-heart");n.transition().duration(400).ease(z.easeCubicInOut).style("transform","scale(1)").style("opacity",1).on("end",()=>{n.classed("pulse",!0),setTimeout(()=>{n.classed("pulse",!1).transition().duration(400).style("transform","scale(0)").style("opacity",0)},1500)});const r=z.select(this.node).select(".icon-heart").classed("play-animation",!0).on("animationend",()=>{r.classed("play-animation",!1)});new Set(this.favoritesStoreValue.favTrees.map(s=>s.pinnedTree.treeID)).has(this.pinnedTree.treeID)||this.favoritesStoreValue.favTrees.push({pinnedTree:this.pinnedTree,pinnedTreeUpdated:()=>{this.pinnedTreeWindowUpdated()},getFeatureColor:this.pinnedTreeStoreValue.getFeatureColor===null?()=>Te.colors["gray-500"]:this.pinnedTreeStoreValue.getFeatureColor})}else{const r=[...this.favoritesStoreValue.favTrees.map(i=>i.pinnedTree.treeID)].indexOf(this.pinnedTree.treeID);r>-1&&this.favoritesStoreValue.favTrees.splice(r,1)}this.favoritesStore.set(this.favoritesStoreValue),this.pinnedTreeStore.set(this.pinnedTreeStoreValue)});N(this,"noteClicked",t=>{t.preventDefault(),t.stopPropagation(),se(this,on,qn).call(this);const n=z.select(this.node).select(".note-window");n.classed("show",!n.classed("show"))});N(this,"closeClicked",t=>{t.preventDefault(),t.stopPropagation();let n=!1;if(this.pinnedTreeStoreValue.lastActiveTreeID!==null&&(n=this.pinnedTreeStoreValue.lastActiveTreeID===this.pinnedTree.treeID),this.pinnedTree.isFav)this.pinnedTree.isPinned=!1;else{const r=this.pinnedTreeStoreValue.pinnedTrees.indexOf(this.pinnedTree);r>-1?this.pinnedTreeStoreValue.pinnedTrees.splice(r,1):console.warn("Trying to delete a tree that does not exist!")}if(n){let r=!1;for(let i=this.pinnedTreeStoreValue.pinnedTrees.length-1;i>=0;i--)if(this.pinnedTreeStoreValue.pinnedTrees[i].isPinned){this.pinnedTreeStoreValue.lastActiveTreeID=this.pinnedTreeStoreValue.pinnedTrees[i].treeID,r=!0;break}r||(this.pinnedTreeStoreValue.lastActiveTreeID=null)}this.pinnedTreeStore.set(this.pinnedTreeStoreValue)});N(this,"cancelEvent",t=>{t.preventDefault(),t.stopPropagation()});N(this,"headerMousedownHandler",t=>{t.preventDefault(),t.stopPropagation(),se(this,on,qn).call(this);const n={x:t.pageX,y:t.pageY},r=s=>{s.preventDefault(),s.stopPropagation();let a=this.node.offsetLeft+s.pageX-n.x,o=this.node.offsetTop+s.pageY-n.y;a=Math.max(this.dragRegion.minLeft,a),a=Math.min(this.dragRegion.maxLeft,a),o=Math.max(this.dragRegion.minTop,o),o=Math.min(this.dragRegion.maxTop,o),n.x=s.pageX,n.y=s.pageY,this.node.style.left=`${a}px`,this.node.style.top=`${o}px`},i=()=>{document.removeEventListener("mousemove",r,!0),document.removeEventListener("mouseup",i,!0),document.body.style.cursor="default",this.pinnedTree.x=parseFloat(this.node.style.left),this.pinnedTree.y=parseFloat(this.node.style.top)};document.addEventListener("mousemove",r,!0),document.addEventListener("mouseup",i,!0),document.body.style.cursor="move"});N(this,"contentMousedownHandler",t=>{se(this,on,qn).call(this)});N(this,"switchToggled",t=>{t.stopPropagation(),t.preventDefault();const n=z.select(t.currentTarget);n.attr("aria-checked",n.attr("aria-checked")==="true"?"false":!0),this.alterLayout()});var h;this.pinnedTree=n,this.pinnedTreeWindowUpdated=s,this.width=o,this.height=c,this.node=t;const u=((h=this.node.parentNode)==null?void 0:h.parentNode).getBoundingClientRect();this.dragRegion={minLeft:0,maxLeft:u.width-this.width,minTop:0,maxTop:u.height-this.height-50},this.pinnedTree.jiggle=()=>{se(this,on,qn).call(this),this.node.classList.add("jiggle"),this.node.onanimationend=()=>{this.node.classList.remove("jiggle")}},this.pinnedTreeStore=r,this.pinnedTreeStoreValue=Fr(),this.pinnedTreeStoreUnsubscriber=this.pinnedTreeStore.subscribe(p=>{this.pinnedTreeStoreValue=p}),this.favoritesStore=i,this.favoritesStoreValue=Nr(),this.favoritesStoreUnsubscriber=this.favoritesStore.subscribe(p=>{this.favoritesStoreValue=p}),se(this,on,qn).call(this),this.svg=z.select(t).select("svg.tree-svg").attr("width",o).attr("height",c).attr("viewbox",`0 0 ${o} ${c}`).attr("preserveAspectRatio","none"),this.padding={top:20,bottom:20,left:0,right:0},this.width=o-this.padding.left-this.padding.right,this.height=c-this.padding.top-this.padding.bottom,a?(this.sankey=!0,se(this,ra,H2).call(this)):(this.sankey=!1,se(this,ta,D2).call(this));const f=z.select(t).node().getBoundingClientRect();this.endPos={x:this.pinnedTree.x,y:this.pinnedTree.y,width:f.width,height:f.height},this.hidden=!1,this.pinnedTreeWindowUpdated(),this.playLaunchingAnimation()}}on=new WeakSet,qn=function(){var n;const t=this.node.parentNode;(n=t==null?void 0:t.parentNode)==null||n.appendChild(t),this.pinnedTreeStoreValue.lastActiveTreeID=this.pinnedTree.treeID},ta=new WeakSet,D2=function(){const t=this.svg.append("g").attr("class","content").attr("transform",`translate(${this.padding.left}, ${this.padding.top})`),n=z.hierarchy(this.pinnedTree.tree,l=>l.c),r=wt*1,i=z.tree().size([this.width,this.height])(n),s=t.append("g").attr("class","link-group");s.selectAll("path.link").data(i.links()).join("path").attr("class",l=>`link link-${l.source.data.f[0]}`).attr("id",l=>l.target.data.f[0]==="+"?`link-${l.source.data.f[0]}-p`:l.target.data.f[0]==="-"?`link-${l.source.data.f[0]}-n`:`link-${l.source.data.f[0]}-${l.target.data.f[0]}`).attr("d",l=>z.line()([[l.source.x,l.source.y],[l.target.x,l.target.y]]));const o=t.append("g").attr("class","node-group").selectAll("g").data(i.descendants()).join("g").attr("class","node").attr("transform",l=>`translate(${l.x}, ${l.y})`),c=new Set(["-","+"]);if(o.filter(l=>!c.has(l.data.f[0])).append("rect").attr("class","node-rect").attr("x",-r).attr("y",-r).attr("rx",wt).attr("ry",wt).attr("width",2*r).attr("height",2*r).style("fill",l=>this.pinnedTreeStoreValue.getFeatureColor?this.pinnedTreeStoreValue.getFeatureColor(l.data.f[0]):Te.colors["gray-500"]),o.filter(l=>!c.has(l.data.f[0])).append("title").text(l=>this.pinnedTreeStoreValue.getFeatureInfo?this.pinnedTreeStoreValue.getFeatureInfo(l.data.f[0]).nameValue:""),o.filter(l=>c.has(l.data.f[0])).append("title").text(l=>{const u=l.data.f[0]==="+"?"yes":"no",f=`${Gr(l.data.f[2]/l.data.f[1],4)} (${l.data.f[2]} / ${l.data.f[1]})`;return`Predict: ${u} - Accuracy: ${f}`}),this.accuracyScale===null){const l=[];o.filter(u=>c.has(u.data.f[0])).each(u=>{l.push(u.data.f[2]/u.data.f[1])}),this.accuracyScale=z.scaleLinear().domain([Math.min(...l),Math.max(...l)]).range([.3,1])}o.filter(l=>c.has(l.data.f[0])).append("rect").attr("class","leaf-rect").attr("x",-r).attr("y",-r).attr("rx",2).attr("ry",2).attr("width",2*r).attr("height",2*r).style("stroke-opacity",l=>this.accuracyScale(l.data.f[2]/l.data.f[1])),o.filter(l=>c.has(l.data.f[0])).append("text").attr("dy",.5).text(l=>l.data.f[0]).style("opacity",l=>this.accuracyScale(l.data.f[2]/l.data.f[1])),se(this,Vi,Ho).call(this,s,t,i)},Vi=new WeakSet,Ho=function(t,n,r,i=null){const s=t.selectAll(`.link-${this.pinnedTree.tree.f[0]}`).data(),a=5,o=-1,c=[{x:(s[0].source.x+s[0].target.x)/2-a,y:(s[0].source.y+s[0].target.y)/2+o},{x:(s[1].source.x+s[1].target.x)/2+a,y:(s[1].source.y+s[1].target.y)/2+o}],l=n.append("g").attr("class","edge-label-group standard").style("opacity",i?0:1);l.selectAll("text.split-label").data(c).join("text").attr("class","split-label").classed("split-label-left",(g,d)=>d===0).attr("x",g=>g.x).attr("y",g=>g.y+3).text((g,d)=>d===0?"true":"false").style("display",s[0].source.height>6?"none":"unset");const u=se(this,na,N2).call(this,r,wt),f=n.append("g").attr("class","node-label-group standard").style("opacity",i?0:1),h=f.selectAll("g.node-label").data(u).join("g").attr("class","node-label").classed("node-label-left",g=>g.pos===Mt.left).attr("transform",g=>`translate(${g.x}, ${g.y})`),p=h.append("text").text(g=>g.text).style("fill",g=>g.backTextColor);h.append("title").text(g=>g.textLong),p.each((g,d,m)=>{const v=z.select(m[d]);if(d+1{const v=m[d],S=z.select(v);let b=g.text,_=v.getBoundingClientRect().width;for(;_>g.width;){if(b==="..."){b=".";break}b=b.replace("...",""),b=b.slice(0,b.length-1),b=`${b}...`,_=ft(b,16*.8)}S.text(b)}),i&&(l.transition(i).style("opacity",1),f.transition(i).style("opacity",1))},na=new WeakSet,N2=function(t,n){const r=[];let s=12,a=this.width-12;const o=5,c=t.descendants();for(const[l,u]of c.entries()){let f=!1;const h=this.pinnedTreeStoreValue.getFeatureInfo===null?"":this.pinnedTreeStoreValue.getFeatureInfo(u.data.f[0]).shortValue,p=this.pinnedTreeStoreValue.getFeatureInfo===null?"":this.pinnedTreeStoreValue.getFeatureInfo(u.data.f[0]).nameValue;let g=Te.colors["gray-50"],d=Te.colors["gray-700"];if(this.pinnedTreeStoreValue.getFeatureColor){const b=this.pinnedTreeStoreValue.getFeatureColor(u.data.f[0]);d=b,g=Fa(this,Di).call(this,b)}l+1v?(S={x:u.x-n-o,y:u.y,pos:Mt.left,featureName:u.data.f[0],width:m,text:h,textLong:p,frontTextColor:g,backTextColor:d,index:l},s=u.x+n,a=this.width-12):(S={x:u.x+n+o,y:u.y,pos:Mt.right,featureName:u.data.f[0],width:v,text:h,textLong:p,frontTextColor:g,backTextColor:d,index:l},u.data.f[0]!=="+"&&u.data.f[0]!=="-"?s=u.x+n+o+v:s=u.x+n+o,a=this.width-12),u.data.f[0]!=="+"&&u.data.f[0]!=="-"&&r.push(S),l+1d.c),r=wt*1,i=z.tree().size([this.width,this.height])(n),s=t.append("g").attr("class","link-group"),a=t.append("g").attr("class","node-group"),o={top:this.padding.top,bottom:this.padding.bottom,left:20,right:20},c=i.data.f[1],l=z.scaleLinear().domain([0,c]).range([0,this.width+this.padding.left+this.padding.right-o.left-o.right]),u=[];let f=0,h=-1;i.descendants().forEach(d=>{const m=Object.assign(d);m.depth!==h&&(f=m.parent===null?o.left:m.parent.x,h=m.depth),m.x=f,m.width=l(m.data.f[1]),f+=m.width,u.push(m)});const p=a.selectAll("g").data(u).join("g").attr("class","node").attr("transform",d=>`translate(${d.x}, ${d.y})`);p.filter(d=>d.data.f[0]!=="+"&&d.data.f[0]!=="-").append("title").text(d=>this.pinnedTreeStoreValue.getFeatureInfo?this.pinnedTreeStoreValue.getFeatureInfo(d.data.f[0]).nameValue:""),p.filter(d=>d.data.f[0]==="+"||d.data.f[0]==="-").append("title").text(d=>{const m=d.data.f[0]==="+"?"yes":"no",v=`${Gr(d.data.f[2]/d.data.f[1],4)} (${d.data.f[2]} / ${d.data.f[1]})`;return`Predict: ${m} - Accuracy: ${v}`});const g=new Set(["-","+"]);if(p.filter(d=>!g.has(d.data.f[0])).append("rect").attr("class","node-rect sankey").attr("x",0).attr("y",-r).attr("width",d=>d.width).attr("height",2*r).attr("rx",d=>d.width<16?1:2).attr("ry",d=>d.width<16?1:2).style("fill",d=>this.pinnedTreeStoreValue.getFeatureColor?this.pinnedTreeStoreValue.getFeatureColor(d.data.f[0]):Te.colors["gray-500"]),this.accuracyScale===null){const d=[];p.filter(m=>g.has(m.data.f[0])).each(m=>{d.push(m.data.f[2]/m.data.f[1])}),this.accuracyScale=z.scaleLinear().domain([Math.min(...d),Math.max(...d)]).range([.3,1])}p.filter(d=>g.has(d.data.f[0])).append("rect").attr("class","leaf-rect").attr("x",0).attr("y",-r).attr("rx",d=>d.width<16?1:2).attr("ry",d=>d.width<16?1:2).attr("width",d=>d.width).attr("height",2*r).style("stroke-opacity",d=>this.accuracyScale(d.data.f[2]/d.data.f[1])),p.filter(d=>g.has(d.data.f[0])).append("text").attr("x",d=>d.width/2).attr("dy",.5).text(d=>d.data.f[0]).style("opacity",d=>d.width<16?0:this.accuracyScale(d.data.f[2]/d.data.f[1])),s.selectAll("path.link").data(i.links()).join("path").attr("class",d=>`link link-${d.source.data.f[0]}`).attr("id",d=>d.target.data.f[0]==="+"?`link-${d.source.data.f[0]}-p`:d.target.data.f[0]==="-"?`link-${d.source.data.f[0]}-n`:`link-${d.source.data.f[0]}-${d.target.data.f[0]}`).attr("d",d=>{const m=d.source,v=d.target;return z.line()([[m.x+m.width/2,m.y],[v.x+v.width/2,v.y-r]])}),se(this,Ni,Fo).call(this,s,t,u,r)},Ni=new WeakSet,Fo=function(t,n,r,i,s=null){const a=t.selectAll(`.link-${this.pinnedTree.tree.f[0]}`).data(),o=5,c=-.5,l=[];for(const d of[0,1]){const m=a[d].source,v=a[d].target,S=m.x+m.width/2,b=v.x+v.width/2,_=m.y,k=v.y-i,H=r[1].y-r[0].y-2*wt,I=wt/(H+wt)*Math.abs(S-b),M=d===0?S-I:S+I,V=_+wt;l.push({x:d===0?(M+b)/2-o:(M+b)/2+o,y:(V+k)/2+c})}const u=n.append("g").attr("class","edge-label-group sankey").style("opacity",s?0:1);u.selectAll("text.split-label").data(l).join("text").attr("class","split-label").classed("split-label-left",(d,m)=>m===0).attr("x",d=>d.x).attr("y",d=>d.y+3).text((d,m)=>m===0?"true":"false").style("display",a[0].source.height>6?"none":"unset");const f=se(this,ia,F2).call(this,r),h=n.append("g").attr("class","node-label-group sankey").style("opacity",s?0:1),p=h.selectAll("g.node-label").data(f).join("g").attr("class","node-label").classed("node-label-left",d=>d.pos===Mt.left).classed("node-label-middle",d=>d.pos===Mt.middle).attr("transform",d=>`translate(${d.x}, ${d.y})`),g=p.append("text").text(d=>d.text).style("fill",d=>d.pos===Mt.middle?d.frontTextColor:d.backTextColor);p.append("title").text(d=>d.textLong),g.each((d,m,v)=>{const S=v[m],b=z.select(S);let _=d.text,k=S.getBoundingClientRect().width;for(;k>d.width;){if(_==="..."){_=".";break}_=_.replace("...",""),_=_.slice(0,_.length-1),_=`${_}...`,k=ft(_,16*.8)}b.text(_)}),s&&(u.transition(s).style("opacity",1),h.transition(s).style("opacity",1))},ia=new WeakSet,F2=function(t){const n=[];let s=20,a=this.width-20;const o=5;for(const[c,l]of t.entries()){let u=!1;const f=this.pinnedTreeStoreValue.getFeatureInfo===null?"":this.pinnedTreeStoreValue.getFeatureInfo(l.data.f[0]).shortValue,h=this.pinnedTreeStoreValue.getFeatureInfo===null?"":this.pinnedTreeStoreValue.getFeatureInfo(l.data.f[0]).nameValue;let p=Te.colors["gray-50"],g=Te.colors["gray-700"];if(this.pinnedTreeStoreValue.getFeatureColor){const b=this.pinnedTreeStoreValue.getFeatureColor(l.data.f[0]);g=b,p=Fa(this,Di).call(this,b)}c+1m&&d>v?(S={x:l.x-o,y:l.y+1,pos:Mt.left,featureName:l.data.f[0],width:d,text:f,textLong:h,frontTextColor:p,backTextColor:g,index:c},s=l.x+l.width,a=this.width-20):v>=d&&v>=m?(S={x:l.x+l.width/2,y:l.y+1,pos:Mt.middle,featureName:l.data.f[0],width:v,text:f,textLong:h,frontTextColor:p,backTextColor:g,index:c},s=l.x+l.width,a=this.width-20):(S={x:l.x+l.width+o,y:l.y+1,pos:Mt.right,featureName:l.data.f[0],width:m,text:f,textLong:h,frontTextColor:p,backTextColor:g,index:c},s=l.x+l.width,a=this.width-20),l.data.f[0]!=="+"&&l.data.f[0]!=="-"&&n.push(S),c+1u.c),r=wt*1,i=z.tree().size([this.width,this.height])(n),s=z.transition().duration(400).ease(z.easeCubicInOut),a=t.select(".link-group");a.selectAll("path.link").data(i.links()).join("path").transition(s).attr("d",u=>z.line()([[u.source.x,u.source.y],[u.target.x,u.target.y]]));const c=t.select(".node-group").selectAll("g.node").data(i.descendants()).join("g");c.transition(s).attr("transform",u=>`translate(${u.x}, ${u.y})`);const l=new Set(["-","+"]);c.filter(u=>!l.has(u.data.f[0])).select("rect.node-rect").classed("sankey",!1).transition(s).attr("x",-r).attr("y",-r).attr("rx",wt).attr("ry",wt).attr("width",2*r).attr("height",2*r),c.filter(u=>l.has(u.data.f[0])).select("rect.leaf-rect").attr("class","leaf-rect").transition(s).attr("x",-r).attr("y",-r).attr("rx",2).attr("ry",2).attr("width",2*r).attr("height",2*r),c.filter(u=>l.has(u.data.f[0])).select("text").transition(s).attr("x",0).attr("dy",.5).style("opacity",u=>this.accuracyScale(u.data.f[2]/u.data.f[1])),t.select(".node-label-group.sankey").transition(s).style("opacity",0).style("pointer-events","none"),t.select(".edge-label-group.sankey").transition(s).style("opacity",0).style("pointer-events","none"),t.select(".node-label-group.standard").size()===0?se(this,Vi,Ho).call(this,a,t,i,s):(t.select(".node-label-group.standard").transition(s).style("opacity",1).style("pointer-events","unset"),t.select(".edge-label-group.standard").transition(s).style("opacity",1).style("pointer-events","unset")),localStorage.setItem("initSwitchChecked","false")},aa=new WeakSet,R2=function(){const t=this.svg.select(".content"),n=z.hierarchy(this.pinnedTree.tree,m=>m.c),r=wt*1,i=z.tree().size([this.width,this.height])(n),s=t.select(".link-group"),a=t.select(".node-group"),o={top:this.padding.top,bottom:this.padding.bottom,left:20,right:20},c=i.data.f[1],l=z.scaleLinear().domain([0,c]).range([0,this.width+this.padding.left+this.padding.right-o.left-o.right]),u=[];let f=0,h=-1;i.descendants().forEach(m=>{const v=Object.assign(m);v.depth!==h&&(f=v.parent===null?o.left:v.parent.x,h=v.depth),v.x=f,v.width=l(v.data.f[1]),f+=v.width,u.push(v)});const p=z.transition().duration(400).ease(z.easeCubicInOut),g=a.selectAll("g.node").data(u).join("g");g.transition(p).attr("transform",m=>`translate(${m.x}, ${m.y})`);const d=new Set(["-","+"]);g.filter(m=>!d.has(m.data.f[0])).select("rect.node-rect").classed("sankey",!0).transition(p).attr("x",0).attr("y",-r).attr("width",m=>m.width).attr("height",2*r).attr("rx",m=>m.width<16?1:2).attr("ry",m=>m.width<16?1:2),g.filter(m=>d.has(m.data.f[0])).select("rect.leaf-rect").transition(p).attr("x",0).attr("y",-r).attr("rx",m=>m.width<16?1:2).attr("ry",m=>m.width<16?1:2).attr("width",m=>m.width).attr("height",2*r),g.filter(m=>d.has(m.data.f[0])).select("text").transition(p).attr("x",m=>m.width/2).attr("dy",.5).text(m=>m.data.f[0]).style("opacity",m=>m.width<16?0:this.accuracyScale(m.data.f[2]/m.data.f[1])),s.selectAll("path.link").data(i.links()).join("path").transition(p).attr("d",m=>{const v=m.source,S=m.target;return z.line()([[v.x+v.width/2,v.y],[S.x+S.width/2,S.y-r]])}),t.select(".node-label-group.standard").transition(p).style("opacity",0).style("pointer-events","none"),t.select(".edge-label-group.standard").transition(p).style("opacity",0).style("pointer-events","none"),t.select(".node-label-group.sankey").size()===0?se(this,Ni,Fo).call(this,s,t,u,r,p):(t.select(".node-label-group.sankey").transition(p).style("opacity",1).style("pointer-events","unset"),t.select(".edge-label-group.sankey").transition(p).style("opacity",1).style("pointer-events","unset")),localStorage.setItem("initSwitchChecked","true")};const I2='',Aa='',E2='',z2=` + `},{transformOrigin:"top left",opacity:1,transform:"none"}],{duration:300,easing:"cubic-bezier(0.4, 0.0, 0.2, 1)",fill:"none"})});ye(this,Di,t=>{const n=z.color(t);let r="currentcolor";if(n!==null){const i=[252,252,252],s=[74,74,74],a=z.color(n).rgb(),o=[a.r,a.g,a.b];Gr(i,o)` + left: ${this.pinnedTree.x}px; top: ${this.pinnedTree.y}px;`);N(this,"alterLayout",()=>{this.sankey?(se(this,ia,H2).call(this),this.sankey=!1):(se(this,sa,F2).call(this),this.sankey=!0)});N(this,"heartClicked",async t=>{if(t.preventDefault(),t.stopPropagation(),se(this,on,qn).call(this),this.pinnedTree.isFav=!this.pinnedTree.isFav,this.pinnedTreeWindowUpdated(),this.pinnedTree.isFav){await ml();const n=z.select(".hidden-heart");n.transition().duration(400).ease(z.easeCubicInOut).style("transform","scale(1)").style("opacity",1).on("end",()=>{n.classed("pulse",!0),setTimeout(()=>{n.classed("pulse",!1).transition().duration(400).style("transform","scale(0)").style("opacity",0)},1500)});const r=z.select(this.node).select(".icon-heart").classed("play-animation",!0).on("animationend",()=>{r.classed("play-animation",!1)});new Set(this.favoritesStoreValue.favTrees.map(s=>s.pinnedTree.treeID)).has(this.pinnedTree.treeID)||this.favoritesStoreValue.favTrees.push({pinnedTree:this.pinnedTree,pinnedTreeUpdated:()=>{this.pinnedTreeWindowUpdated()},getFeatureColor:this.pinnedTreeStoreValue.getFeatureColor===null?()=>Te.colors["gray-500"]:this.pinnedTreeStoreValue.getFeatureColor})}else{const r=[...this.favoritesStoreValue.favTrees.map(i=>i.pinnedTree.treeID)].indexOf(this.pinnedTree.treeID);r>-1&&this.favoritesStoreValue.favTrees.splice(r,1)}this.favoritesStore.set(this.favoritesStoreValue),this.pinnedTreeStore.set(this.pinnedTreeStoreValue)});N(this,"noteClicked",t=>{t.preventDefault(),t.stopPropagation(),se(this,on,qn).call(this);const n=z.select(this.node).select(".note-window");n.classed("show",!n.classed("show"))});N(this,"closeClicked",t=>{t.preventDefault(),t.stopPropagation();let n=!1;if(this.pinnedTreeStoreValue.lastActiveTreeID!==null&&(n=this.pinnedTreeStoreValue.lastActiveTreeID===this.pinnedTree.treeID),this.pinnedTree.isFav)this.pinnedTree.isPinned=!1;else{const r=this.pinnedTreeStoreValue.pinnedTrees.indexOf(this.pinnedTree);r>-1?this.pinnedTreeStoreValue.pinnedTrees.splice(r,1):console.warn("Trying to delete a tree that does not exist!")}if(n){let r=!1;for(let i=this.pinnedTreeStoreValue.pinnedTrees.length-1;i>=0;i--)if(this.pinnedTreeStoreValue.pinnedTrees[i].isPinned){this.pinnedTreeStoreValue.lastActiveTreeID=this.pinnedTreeStoreValue.pinnedTrees[i].treeID,r=!0;break}r||(this.pinnedTreeStoreValue.lastActiveTreeID=null)}this.pinnedTreeStore.set(this.pinnedTreeStoreValue)});N(this,"cancelEvent",t=>{t.preventDefault(),t.stopPropagation()});N(this,"headerMousedownHandler",t=>{t.preventDefault(),t.stopPropagation(),se(this,on,qn).call(this);const n={x:t.pageX,y:t.pageY},r=s=>{s.preventDefault(),s.stopPropagation();let a=this.node.offsetLeft+s.pageX-n.x,o=this.node.offsetTop+s.pageY-n.y;a=Math.max(this.dragRegion.minLeft,a),a=Math.min(this.dragRegion.maxLeft,a),o=Math.max(this.dragRegion.minTop,o),o=Math.min(this.dragRegion.maxTop,o),n.x=s.pageX,n.y=s.pageY,this.node.style.left=`${a}px`,this.node.style.top=`${o}px`},i=()=>{document.removeEventListener("mousemove",r,!0),document.removeEventListener("mouseup",i,!0),document.body.style.cursor="default",this.pinnedTree.x=parseFloat(this.node.style.left),this.pinnedTree.y=parseFloat(this.node.style.top)};document.addEventListener("mousemove",r,!0),document.addEventListener("mouseup",i,!0),document.body.style.cursor="move"});N(this,"contentMousedownHandler",t=>{se(this,on,qn).call(this)});N(this,"switchToggled",t=>{t.stopPropagation(),t.preventDefault();const n=z.select(t.currentTarget);n.attr("aria-checked",n.attr("aria-checked")==="true"?"false":!0),this.alterLayout()});var h;this.pinnedTree=n,this.pinnedTreeWindowUpdated=s,this.width=o,this.height=c,this.node=t;const u=((h=this.node.parentNode)==null?void 0:h.parentNode).getBoundingClientRect();this.dragRegion={minLeft:0,maxLeft:u.width-this.width,minTop:0,maxTop:u.height-this.height-50},this.pinnedTree.jiggle=()=>{se(this,on,qn).call(this),this.node.classList.add("jiggle"),this.node.onanimationend=()=>{this.node.classList.remove("jiggle")}},this.pinnedTreeStore=r,this.pinnedTreeStoreValue=Hr(),this.pinnedTreeStoreUnsubscriber=this.pinnedTreeStore.subscribe(p=>{this.pinnedTreeStoreValue=p}),this.favoritesStore=i,this.favoritesStoreValue=Dr(),this.favoritesStoreUnsubscriber=this.favoritesStore.subscribe(p=>{this.favoritesStoreValue=p}),se(this,on,qn).call(this),this.svg=z.select(t).select("svg.tree-svg").attr("width",o).attr("height",c).attr("viewbox",`0 0 ${o} ${c}`).attr("preserveAspectRatio","none"),this.padding={top:20,bottom:20,left:0,right:0},this.width=o-this.padding.left-this.padding.right,this.height=c-this.padding.top-this.padding.bottom,a?(this.sankey=!0,se(this,na,D2).call(this)):(this.sankey=!1,se(this,ea,A2).call(this));const f=z.select(t).node().getBoundingClientRect();this.endPos={x:this.pinnedTree.x,y:this.pinnedTree.y,width:f.width,height:f.height},this.hidden=!1,this.pinnedTreeWindowUpdated(),this.playLaunchingAnimation()}}on=new WeakSet,qn=function(){var n;const t=this.node.parentNode;(n=t==null?void 0:t.parentNode)==null||n.appendChild(t),this.pinnedTreeStoreValue.lastActiveTreeID=this.pinnedTree.treeID},ea=new WeakSet,A2=function(){const t=this.svg.append("g").attr("class","content").attr("transform",`translate(${this.padding.left}, ${this.padding.top})`),n=z.hierarchy(this.pinnedTree.tree,l=>l.c),r=wt*1,i=z.tree().size([this.width,this.height])(n),s=t.append("g").attr("class","link-group");s.selectAll("path.link").data(i.links()).join("path").attr("class",l=>`link link-${l.source.data.f[0]}`).attr("id",l=>l.target.data.f[0]==="+"?`link-${l.source.data.f[0]}-p`:l.target.data.f[0]==="-"?`link-${l.source.data.f[0]}-n`:`link-${l.source.data.f[0]}-${l.target.data.f[0]}`).attr("d",l=>z.line()([[l.source.x,l.source.y],[l.target.x,l.target.y]]));const o=t.append("g").attr("class","node-group").selectAll("g").data(i.descendants()).join("g").attr("class","node").attr("transform",l=>`translate(${l.x}, ${l.y})`),c=new Set(["-","+"]);if(o.filter(l=>!c.has(l.data.f[0])).append("rect").attr("class","node-rect").attr("x",-r).attr("y",-r).attr("rx",wt).attr("ry",wt).attr("width",2*r).attr("height",2*r).style("fill",l=>this.pinnedTreeStoreValue.getFeatureColor?this.pinnedTreeStoreValue.getFeatureColor(l.data.f[0]):Te.colors["gray-500"]),o.filter(l=>!c.has(l.data.f[0])).append("title").text(l=>this.pinnedTreeStoreValue.getFeatureInfo?this.pinnedTreeStoreValue.getFeatureInfo(l.data.f[0]).nameValue:""),o.filter(l=>c.has(l.data.f[0])).append("title").text(l=>{const u=l.data.f[0]==="+"?"yes":"no",f=`${Or(l.data.f[2]/l.data.f[1],4)} (${l.data.f[2]} / ${l.data.f[1]})`;return`Predict: ${u} - Accuracy: ${f}`}),this.accuracyScale===null){const l=[];o.filter(u=>c.has(u.data.f[0])).each(u=>{l.push(u.data.f[2]/u.data.f[1])}),this.accuracyScale=z.scaleLinear().domain([Math.min(...l),Math.max(...l)]).range([.3,1])}o.filter(l=>c.has(l.data.f[0])).append("rect").attr("class","leaf-rect").attr("x",-r).attr("y",-r).attr("rx",2).attr("ry",2).attr("width",2*r).attr("height",2*r).style("stroke-opacity",l=>this.accuracyScale(l.data.f[2]/l.data.f[1])),o.filter(l=>c.has(l.data.f[0])).append("text").attr("dy",.5).text(l=>l.data.f[0]).style("opacity",l=>this.accuracyScale(l.data.f[2]/l.data.f[1])),se(this,Vi,No).call(this,s,t,i)},Vi=new WeakSet,No=function(t,n,r,i=null){const s=t.selectAll(`.link-${this.pinnedTree.tree.f[0]}`).data(),a=5,o=-1,c=[{x:(s[0].source.x+s[0].target.x)/2-a,y:(s[0].source.y+s[0].target.y)/2+o},{x:(s[1].source.x+s[1].target.x)/2+a,y:(s[1].source.y+s[1].target.y)/2+o}],l=n.append("g").attr("class","edge-label-group standard").style("opacity",i?0:1);l.selectAll("text.split-label").data(c).join("text").attr("class","split-label").classed("split-label-left",(g,d)=>d===0).attr("x",g=>g.x).attr("y",g=>g.y+3).text((g,d)=>d===0?"true":"false").style("display",s[0].source.height>6?"none":"unset");const u=se(this,ta,V2).call(this,r,wt),f=n.append("g").attr("class","node-label-group standard").style("opacity",i?0:1),h=f.selectAll("g.node-label").data(u).join("g").attr("class","node-label").classed("node-label-left",g=>g.pos===Mt.left).attr("transform",g=>`translate(${g.x}, ${g.y})`),p=h.append("text").text(g=>g.text).style("fill",g=>g.backTextColor);h.append("title").text(g=>g.textLong),p.each((g,d,m)=>{const v=z.select(m[d]);if(d+1{const v=m[d],S=z.select(v);let b=g.text,_=v.getBoundingClientRect().width;for(;_>g.width;){if(b==="..."){b=".";break}b=b.replace("...",""),b=b.slice(0,b.length-1),b=`${b}...`,_=ft(b,16*.8)}S.text(b)}),i&&(l.transition(i).style("opacity",1),f.transition(i).style("opacity",1))},ta=new WeakSet,V2=function(t,n){const r=[];let s=12,a=this.width-12;const o=5,c=t.descendants();for(const[l,u]of c.entries()){let f=!1;const h=this.pinnedTreeStoreValue.getFeatureInfo===null?"":this.pinnedTreeStoreValue.getFeatureInfo(u.data.f[0]).shortValue,p=this.pinnedTreeStoreValue.getFeatureInfo===null?"":this.pinnedTreeStoreValue.getFeatureInfo(u.data.f[0]).nameValue;let g=Te.colors["gray-50"],d=Te.colors["gray-700"];if(this.pinnedTreeStoreValue.getFeatureColor){const b=this.pinnedTreeStoreValue.getFeatureColor(u.data.f[0]);d=b,g=Ha(this,Di).call(this,b)}l+1v?(S={x:u.x-n-o,y:u.y,pos:Mt.left,featureName:u.data.f[0],width:m,text:h,textLong:p,frontTextColor:g,backTextColor:d,index:l},s=u.x+n,a=this.width-12):(S={x:u.x+n+o,y:u.y,pos:Mt.right,featureName:u.data.f[0],width:v,text:h,textLong:p,frontTextColor:g,backTextColor:d,index:l},u.data.f[0]!=="+"&&u.data.f[0]!=="-"?s=u.x+n+o+v:s=u.x+n+o,a=this.width-12),u.data.f[0]!=="+"&&u.data.f[0]!=="-"&&r.push(S),l+1d.c),r=wt*1,i=z.tree().size([this.width,this.height])(n),s=t.append("g").attr("class","link-group"),a=t.append("g").attr("class","node-group"),o={top:this.padding.top,bottom:this.padding.bottom,left:20,right:20},c=i.data.f[1],l=z.scaleLinear().domain([0,c]).range([0,this.width+this.padding.left+this.padding.right-o.left-o.right]),u=[];let f=0,h=-1;i.descendants().forEach(d=>{const m=Object.assign(d);m.depth!==h&&(f=m.parent===null?o.left:m.parent.x,h=m.depth),m.x=f,m.width=l(m.data.f[1]),f+=m.width,u.push(m)});const p=a.selectAll("g").data(u).join("g").attr("class","node").attr("transform",d=>`translate(${d.x}, ${d.y})`);p.filter(d=>d.data.f[0]!=="+"&&d.data.f[0]!=="-").append("title").text(d=>this.pinnedTreeStoreValue.getFeatureInfo?this.pinnedTreeStoreValue.getFeatureInfo(d.data.f[0]).nameValue:""),p.filter(d=>d.data.f[0]==="+"||d.data.f[0]==="-").append("title").text(d=>{const m=d.data.f[0]==="+"?"yes":"no",v=`${Or(d.data.f[2]/d.data.f[1],4)} (${d.data.f[2]} / ${d.data.f[1]})`;return`Predict: ${m} - Accuracy: ${v}`});const g=new Set(["-","+"]);if(p.filter(d=>!g.has(d.data.f[0])).append("rect").attr("class","node-rect sankey").attr("x",0).attr("y",-r).attr("width",d=>d.width).attr("height",2*r).attr("rx",d=>d.width<16?1:2).attr("ry",d=>d.width<16?1:2).style("fill",d=>this.pinnedTreeStoreValue.getFeatureColor?this.pinnedTreeStoreValue.getFeatureColor(d.data.f[0]):Te.colors["gray-500"]),this.accuracyScale===null){const d=[];p.filter(m=>g.has(m.data.f[0])).each(m=>{d.push(m.data.f[2]/m.data.f[1])}),this.accuracyScale=z.scaleLinear().domain([Math.min(...d),Math.max(...d)]).range([.3,1])}p.filter(d=>g.has(d.data.f[0])).append("rect").attr("class","leaf-rect").attr("x",0).attr("y",-r).attr("rx",d=>d.width<16?1:2).attr("ry",d=>d.width<16?1:2).attr("width",d=>d.width).attr("height",2*r).style("stroke-opacity",d=>this.accuracyScale(d.data.f[2]/d.data.f[1])),p.filter(d=>g.has(d.data.f[0])).append("text").attr("x",d=>d.width/2).attr("dy",.5).text(d=>d.data.f[0]).style("opacity",d=>d.width<16?0:this.accuracyScale(d.data.f[2]/d.data.f[1])),s.selectAll("path.link").data(i.links()).join("path").attr("class",d=>`link link-${d.source.data.f[0]}`).attr("id",d=>d.target.data.f[0]==="+"?`link-${d.source.data.f[0]}-p`:d.target.data.f[0]==="-"?`link-${d.source.data.f[0]}-n`:`link-${d.source.data.f[0]}-${d.target.data.f[0]}`).attr("d",d=>{const m=d.source,v=d.target;return z.line()([[m.x+m.width/2,m.y],[v.x+v.width/2,v.y-r]])}),se(this,Ni,Ho).call(this,s,t,u,r)},Ni=new WeakSet,Ho=function(t,n,r,i,s=null){const a=t.selectAll(`.link-${this.pinnedTree.tree.f[0]}`).data(),o=5,c=-.5,l=[];for(const d of[0,1]){const m=a[d].source,v=a[d].target,S=m.x+m.width/2,b=v.x+v.width/2,_=m.y,k=v.y-i,H=r[1].y-r[0].y-2*wt,I=wt/(H+wt)*Math.abs(S-b),M=d===0?S-I:S+I,V=_+wt;l.push({x:d===0?(M+b)/2-o:(M+b)/2+o,y:(V+k)/2+c})}const u=n.append("g").attr("class","edge-label-group sankey").style("opacity",s?0:1);u.selectAll("text.split-label").data(l).join("text").attr("class","split-label").classed("split-label-left",(d,m)=>m===0).attr("x",d=>d.x).attr("y",d=>d.y+3).text((d,m)=>m===0?"true":"false").style("display",a[0].source.height>6?"none":"unset");const f=se(this,ra,N2).call(this,r),h=n.append("g").attr("class","node-label-group sankey").style("opacity",s?0:1),p=h.selectAll("g.node-label").data(f).join("g").attr("class","node-label").classed("node-label-left",d=>d.pos===Mt.left).classed("node-label-middle",d=>d.pos===Mt.middle).attr("transform",d=>`translate(${d.x}, ${d.y})`),g=p.append("text").text(d=>d.text).style("fill",d=>d.pos===Mt.middle?d.frontTextColor:d.backTextColor);p.append("title").text(d=>d.textLong),g.each((d,m,v)=>{const S=v[m],b=z.select(S);let _=d.text,k=S.getBoundingClientRect().width;for(;k>d.width;){if(_==="..."){_=".";break}_=_.replace("...",""),_=_.slice(0,_.length-1),_=`${_}...`,k=ft(_,16*.8)}b.text(_)}),s&&(u.transition(s).style("opacity",1),h.transition(s).style("opacity",1))},ra=new WeakSet,N2=function(t){const n=[];let s=20,a=this.width-20;const o=5;for(const[c,l]of t.entries()){let u=!1;const f=this.pinnedTreeStoreValue.getFeatureInfo===null?"":this.pinnedTreeStoreValue.getFeatureInfo(l.data.f[0]).shortValue,h=this.pinnedTreeStoreValue.getFeatureInfo===null?"":this.pinnedTreeStoreValue.getFeatureInfo(l.data.f[0]).nameValue;let p=Te.colors["gray-50"],g=Te.colors["gray-700"];if(this.pinnedTreeStoreValue.getFeatureColor){const b=this.pinnedTreeStoreValue.getFeatureColor(l.data.f[0]);g=b,p=Ha(this,Di).call(this,b)}c+1m&&d>v?(S={x:l.x-o,y:l.y+1,pos:Mt.left,featureName:l.data.f[0],width:d,text:f,textLong:h,frontTextColor:p,backTextColor:g,index:c},s=l.x+l.width,a=this.width-20):v>=d&&v>=m?(S={x:l.x+l.width/2,y:l.y+1,pos:Mt.middle,featureName:l.data.f[0],width:v,text:f,textLong:h,frontTextColor:p,backTextColor:g,index:c},s=l.x+l.width,a=this.width-20):(S={x:l.x+l.width+o,y:l.y+1,pos:Mt.right,featureName:l.data.f[0],width:m,text:f,textLong:h,frontTextColor:p,backTextColor:g,index:c},s=l.x+l.width,a=this.width-20),l.data.f[0]!=="+"&&l.data.f[0]!=="-"&&n.push(S),c+1u.c),r=wt*1,i=z.tree().size([this.width,this.height])(n),s=z.transition().duration(400).ease(z.easeCubicInOut),a=t.select(".link-group");a.selectAll("path.link").data(i.links()).join("path").transition(s).attr("d",u=>z.line()([[u.source.x,u.source.y],[u.target.x,u.target.y]]));const c=t.select(".node-group").selectAll("g.node").data(i.descendants()).join("g");c.transition(s).attr("transform",u=>`translate(${u.x}, ${u.y})`);const l=new Set(["-","+"]);c.filter(u=>!l.has(u.data.f[0])).select("rect.node-rect").classed("sankey",!1).transition(s).attr("x",-r).attr("y",-r).attr("rx",wt).attr("ry",wt).attr("width",2*r).attr("height",2*r),c.filter(u=>l.has(u.data.f[0])).select("rect.leaf-rect").attr("class","leaf-rect").transition(s).attr("x",-r).attr("y",-r).attr("rx",2).attr("ry",2).attr("width",2*r).attr("height",2*r),c.filter(u=>l.has(u.data.f[0])).select("text").transition(s).attr("x",0).attr("dy",.5).style("opacity",u=>this.accuracyScale(u.data.f[2]/u.data.f[1])),t.select(".node-label-group.sankey").transition(s).style("opacity",0).style("pointer-events","none"),t.select(".edge-label-group.sankey").transition(s).style("opacity",0).style("pointer-events","none"),t.select(".node-label-group.standard").size()===0?se(this,Vi,No).call(this,a,t,i,s):(t.select(".node-label-group.standard").transition(s).style("opacity",1).style("pointer-events","unset"),t.select(".edge-label-group.standard").transition(s).style("opacity",1).style("pointer-events","unset")),localStorage.setItem("initSwitchChecked","false")},sa=new WeakSet,F2=function(){const t=this.svg.select(".content"),n=z.hierarchy(this.pinnedTree.tree,m=>m.c),r=wt*1,i=z.tree().size([this.width,this.height])(n),s=t.select(".link-group"),a=t.select(".node-group"),o={top:this.padding.top,bottom:this.padding.bottom,left:20,right:20},c=i.data.f[1],l=z.scaleLinear().domain([0,c]).range([0,this.width+this.padding.left+this.padding.right-o.left-o.right]),u=[];let f=0,h=-1;i.descendants().forEach(m=>{const v=Object.assign(m);v.depth!==h&&(f=v.parent===null?o.left:v.parent.x,h=v.depth),v.x=f,v.width=l(v.data.f[1]),f+=v.width,u.push(v)});const p=z.transition().duration(400).ease(z.easeCubicInOut),g=a.selectAll("g.node").data(u).join("g");g.transition(p).attr("transform",m=>`translate(${m.x}, ${m.y})`);const d=new Set(["-","+"]);g.filter(m=>!d.has(m.data.f[0])).select("rect.node-rect").classed("sankey",!0).transition(p).attr("x",0).attr("y",-r).attr("width",m=>m.width).attr("height",2*r).attr("rx",m=>m.width<16?1:2).attr("ry",m=>m.width<16?1:2),g.filter(m=>d.has(m.data.f[0])).select("rect.leaf-rect").transition(p).attr("x",0).attr("y",-r).attr("rx",m=>m.width<16?1:2).attr("ry",m=>m.width<16?1:2).attr("width",m=>m.width).attr("height",2*r),g.filter(m=>d.has(m.data.f[0])).select("text").transition(p).attr("x",m=>m.width/2).attr("dy",.5).text(m=>m.data.f[0]).style("opacity",m=>m.width<16?0:this.accuracyScale(m.data.f[2]/m.data.f[1])),s.selectAll("path.link").data(i.links()).join("path").transition(p).attr("d",m=>{const v=m.source,S=m.target;return z.line()([[v.x+v.width/2,v.y],[S.x+S.width/2,S.y-r]])}),t.select(".node-label-group.standard").transition(p).style("opacity",0).style("pointer-events","none"),t.select(".edge-label-group.standard").transition(p).style("opacity",0).style("pointer-events","none"),t.select(".node-label-group.sankey").size()===0?se(this,Ni,Ho).call(this,s,t,u,r,p):(t.select(".node-label-group.sankey").transition(p).style("opacity",1).style("pointer-events","unset"),t.select(".edge-label-group.sankey").transition(p).style("opacity",1).style("pointer-events","unset")),localStorage.setItem("initSwitchChecked","true")};const P2='',Ma='',R2='',I2=` @@ -31,7 +31,7 @@ var W0=Object.defineProperty;var O0=(e,t,n)=>t in e?W0(e,t,{enumerable:!0,config -`,W2=` +`,E2=` @@ -47,7 +47,7 @@ var W0=Object.defineProperty;var O0=(e,t,n)=>t in e?W0(e,t,{enumerable:!0,config -`;const Ae="src/components/tree-window/PinnedTreeWindow.svelte";function O2(e){let t;const n={c:function(){t=L("div"),w(t,"class","svg-icon s-YWFeNV-ftNdK"),x(t,Ae,413,10,9908)},m:function(i,s){ae(i,t,s),t.innerHTML=Aa},p:pe,d:function(i){i&&ee(t)}};return te("SvelteRegisterBlock",{block:n,id:O2.name,type:"else",source:"(413:8) {:else}",ctx:e}),n}function G2(e){let t;const n={c:function(){t=L("div"),w(t,"class","svg-icon icon-heart s-YWFeNV-ftNdK"),ge(t,"play-animation",!1),x(t,Ae,409,10,9759)},m:function(i,s){ae(i,t,s),t.innerHTML=z2},p:pe,d:function(i){i&&ee(t)}};return te("SvelteRegisterBlock",{block:n,id:G2.name,type:"if",source:"(409:8) {#if pinnedTreeWindow?.pinnedTree.isFav}",ctx:e}),n}function Y2(e){let t;const n={c:function(){t=L("div"),w(t,"class","svg-icon s-YWFeNV-ftNdK"),x(t,Ae,432,10,10386)},m:function(i,s){ae(i,t,s),t.innerHTML=W2},p:pe,d:function(i){i&&ee(t)}};return te("SvelteRegisterBlock",{block:n,id:Y2.name,type:"else",source:"(432:8) {:else}",ctx:e}),n}function B2(e){let t;const n={c:function(){t=L("div"),w(t,"class","svg-icon s-YWFeNV-ftNdK"),x(t,Ae,428,10,10285)},m:function(i,s){ae(i,t,s),t.innerHTML=E2},p:pe,d:function(i){i&&ee(t)}};return te("SvelteRegisterBlock",{block:n,id:B2.name,type:"if",source:"(428:8) {#if pinnedTreeWindow?.pinnedTree.note === ''}",ctx:e}),n}function Po(e){let t,n,r;const i={c:function(){t=L("textarea"),w(t,"class","note-window-input s-YWFeNV-ftNdK"),w(t,"name","note-input"),w(t,"placeholder","Leave a comment."),x(t,Ae,443,14,10725)},m:function(a,o){ae(a,t,o),xs(t,e[1].pinnedTree.note),n||(r=[he(t,"input",e[11],!1,!1,!1),he(t,"input",e[12])],n=!0)},p:function(a,o){o&2&&xs(t,a[1].pinnedTree.note)},d:function(a){a&&ee(t),n=!1,Re(r)}};return te("SvelteRegisterBlock",{block:i,id:Po.name,type:"if",source:"(443:12) {#if pinnedTreeWindow !== null}",ctx:e}),i}function Ro(e){var de,xe;let t,n,r,i,s,a=((de=e[1])==null?void 0:de.pinnedTree.treeID)+"",o,c,l,u,f=((xe=e[1])==null?void 0:xe.pinnedTree.treeMetric)+"",h,p,g,d,m,v,S,b,_,k,H,I,M,V,E,F,R,A,C,T,D,P,G,Y,U,X,J,me,K,Q;function B(Le,Z){var ue;return(ue=Le[1])!=null&&ue.pinnedTree.isFav?G2:O2}let ie=B(e),fe=ie(e);function j(Le,Z){var ue;return((ue=Le[1])==null?void 0:ue.pinnedTree.note)===""?B2:Y2}let $=j(e),oe=$(e),O=e[1]!==null&&Po(e);const we={c:function(){var Z,ue,He,ke,nt,Pe;t=L("div"),n=L("div"),r=L("div"),i=L("span"),s=ce("Tree "),o=ce(a),c=W(),l=L("span"),u=ce("("),h=ce(f),p=ce(")"),d=W(),m=L("div"),v=L("div"),fe.c(),S=W(),b=L("div"),oe.c(),_=W(),k=L("div"),H=L("div"),O&&O.c(),I=W(),M=L("div"),V=L("div"),E=W(),F=L("div"),R=Dn("svg"),A=W(),C=L("div"),T=L("button"),D=L("label"),P=ce("Scaled by sample size"),Y=W(),U=L("div"),w(i,"class","tree-name s-YWFeNV-ftNdK"),x(i,Ae,392,6,9265),w(l,"class","tree-acc s-YWFeNV-ftNdK"),x(l,Ae,396,6,9362),w(r,"class","tree-info s-YWFeNV-ftNdK"),w(r,"title",g=`Tree ${(Z=e[1])==null?void 0:Z.pinnedTree.treeID} - Accuracy ${(ue=e[1])==null?void 0:ue.pinnedTree.treeMetric}`),x(r,Ae,388,4,9110),w(v,"class","control-fav s-YWFeNV-ftNdK"),w(v,"title","Add to my favorites"),x(v,Ae,402,6,9504),w(H,"class","input-wrapper s-YWFeNV-ftNdK"),x(H,Ae,438,10,10555),w(k,"class","note-window s-YWFeNV-ftNdK"),w(k,"title",""),ge(k,"show",!1),x(k,Ae,437,8,10491),w(b,"class","control-note s-YWFeNV-ftNdK"),w(b,"title","Leave a comment"),x(b,Ae,419,6,10018),w(V,"class","svg-icon s-YWFeNV-ftNdK"),x(V,Ae,461,8,11257),w(M,"class","control-close s-YWFeNV-ftNdK"),w(M,"title","Close the window"),x(M,Ae,455,6,11054),w(m,"class","control-buttons s-YWFeNV-ftNdK"),x(m,Ae,401,4,9468),w(n,"class","tree-header s-YWFeNV-ftNdK"),x(n,Ae,383,2,8952),w(R,"class","tree-svg s-YWFeNV-ftNdK"),x(R,Ae,472,4,11467),w(F,"class","content s-YWFeNV-ftNdK"),x(F,Ae,468,2,11365),w(D,"class","switch-label s-YWFeNV-ftNdK"),w(D,"for",G=`switch-${(He=e[1])==null?void 0:He.pinnedTree.treeID}`),x(D,Ae,482,6,11753),w(U,"class","switch-track s-YWFeNV-ftNdK"),w(U,"id",X=`switch-${(ke=e[1])==null?void 0:ke.pinnedTree.treeID}`),x(U,Ae,487,6,11903),w(T,"class","switch s-YWFeNV-ftNdK"),w(T,"aria-checked",J=e[2]?"true":"false"),w(T,"title","Toggle to visualize sample size as node width"),x(T,Ae,476,4,11537),w(C,"class","control-footer s-YWFeNV-ftNdK"),x(C,Ae,475,2,11504),w(t,"class","pinned-tree-window s-YWFeNV-ftNdK"),w(t,"style",me=(nt=e[1])==null?void 0:nt.getStyle()),ge(t,"hidden",(Pe=e[1])==null?void 0:Pe.hidden),ge(t,"jiggle",!1),x(t,Ae,376,0,8786)},l:function(Z){throw new Error("options.hydrate only works if the component was compiled with the `hydratable: true` option")},m:function(Z,ue){ae(Z,t,ue),y(t,n),y(n,r),y(r,i),y(i,s),y(i,o),y(r,c),y(r,l),y(l,u),y(l,h),y(l,p),y(n,d),y(n,m),y(m,v),fe.m(v,null),y(m,S),y(m,b),oe.m(b,null),y(b,_),y(b,k),y(k,H),O&&O.m(H,null),y(m,I),y(m,M),y(M,V),V.innerHTML=I2,y(t,E),y(t,F),y(F,R),y(t,A),y(t,C),y(C,T),y(T,D),y(D,P),y(T,Y),y(T,U),e[21](t),K||(Q=[he(v,"click",e[9],!1,!1,!1),he(v,"mousedown",e[10],!1,!1,!1),he(H,"click",e[13],!1,!1,!1),he(b,"click",e[14],!1,!1,!1),he(b,"mousedown",ld,!1,!1,!1),he(M,"click",e[15],!1,!1,!1),he(M,"mousedown",e[16],!1,!1,!1),he(n,"mousedown",e[17],!1,!1,!1),he(n,"click",e[18],!1,!1,!1),he(F,"mousedown",e[19],!1,!1,!1),he(T,"click",e[20],!1,!1,!1)],K=!0)},p:function(Z,[ue]){var He,ke,nt,Pe,Kt,xt,Ue,$t;ue&2&&a!==(a=((He=Z[1])==null?void 0:He.pinnedTree.treeID)+"")&&Ee(o,a),ue&2&&f!==(f=((ke=Z[1])==null?void 0:ke.pinnedTree.treeMetric)+"")&&Ee(h,f),ue&2&&g!==(g=`Tree ${(nt=Z[1])==null?void 0:nt.pinnedTree.treeID} - Accuracy ${(Pe=Z[1])==null?void 0:Pe.pinnedTree.treeMetric}`)&&w(r,"title",g),ie===(ie=B(Z))&&fe?fe.p(Z,ue):(fe.d(1),fe=ie(Z),fe&&(fe.c(),fe.m(v,null))),$===($=j(Z))&&oe?oe.p(Z,ue):(oe.d(1),oe=$(Z),oe&&(oe.c(),oe.m(b,_))),Z[1]!==null?O?O.p(Z,ue):(O=Po(Z),O.c(),O.m(H,null)):O&&(O.d(1),O=null),ue&2&&G!==(G=`switch-${(Kt=Z[1])==null?void 0:Kt.pinnedTree.treeID}`)&&w(D,"for",G),ue&2&&X!==(X=`switch-${(xt=Z[1])==null?void 0:xt.pinnedTree.treeID}`)&&w(U,"id",X),ue&4&&J!==(J=Z[2]?"true":"false")&&w(T,"aria-checked",J),ue&2&&me!==(me=(Ue=Z[1])==null?void 0:Ue.getStyle())&&w(t,"style",me),ue&2&&ge(t,"hidden",($t=Z[1])==null?void 0:$t.hidden)},i:pe,o:pe,d:function(Z){Z&&ee(t),fe.d(),oe.d(),O&&O.d(),e[21](null),K=!1,Re(Q)}};return te("SvelteRegisterBlock",{block:we,id:Ro.name,type:"component",source:"",ctx:e}),we}const ld=e=>{e.stopPropagation()};function cd(e,t,n){let{$$slots:r={},$$scope:i}=t;St("PinnedTreeWindow",r,[]);let{pinnedTree:s=null}=t,{pinnedTreeStore:a=null}=t,{favoritesStore:o=null}=t,c=null,l=!1,u=null,f=!1,h=!1;localStorage.getItem("initSwitchChecked")==="true"&&(h=!0),Ne(()=>{n(7,l=!0)}),Ms(()=>{u==null||u.pinnedTreeStoreUnsubscriber(),u==null||u.favoritesStoreUnsubscriber()});const p=()=>{n(1,u)},g=()=>{n(8,f=!0),c&&s&&a&&o&&n(1,u=new Cc({component:c,pinnedTree:s,pinnedTreeStore:a,favoritesStore:o,pinnedTreeWindowUpdated:p,initSwitchChecked:h}))},d=C=>{C.stopPropagation(),o==null||o.update(T=>T)},m=["pinnedTree","pinnedTreeStore","favoritesStore"];Object.keys(t).forEach(C=>{!~m.indexOf(C)&&C.slice(0,2)!=="$$"&&C!=="slot"&&console.warn(` was created with unknown prop '${C}'`)});const v=C=>u==null?void 0:u.heartClicked(C),S=C=>u==null?void 0:u.cancelEvent(C),b=C=>d(C);function _(){u.pinnedTree.note=this.value,n(1,u)}const k=C=>u==null?void 0:u.cancelEvent(C),H=C=>u==null?void 0:u.noteClicked(C),I=C=>u==null?void 0:u.closeClicked(C),M=C=>u==null?void 0:u.cancelEvent(C),V=C=>u==null?void 0:u.headerMousedownHandler(C),E=C=>u==null?void 0:u.cancelEvent(C),F=C=>u==null?void 0:u.contentMousedownHandler(C),R=C=>u==null?void 0:u.switchToggled(C);function A(C){Je[C?"unshift":"push"](()=>{c=C,n(0,c)})}return e.$$set=C=>{"pinnedTree"in C&&n(4,s=C.pinnedTree),"pinnedTreeStore"in C&&n(5,a=C.pinnedTreeStore),"favoritesStore"in C&&n(6,o=C.favoritesStore)},e.$capture_state=()=>({onMount:Ne,onDestroy:Ms,PinnedTreeWindow:Cc,iconCloseCircle:I2,iconHeartCircle:Aa,iconNoteCircle:E2,iconHeartCircleClicked:z2,iconNoteCircleClicked:W2,pinnedTree:s,pinnedTreeStore:a,favoritesStore:o,component:c,mounted:l,pinnedTreeWindow:u,initialized:f,initSwitchChecked:h,pinnedTreeWindowUpdated:p,initView:g,noteChanged:d}),e.$inject_state=C=>{"pinnedTree"in C&&n(4,s=C.pinnedTree),"pinnedTreeStore"in C&&n(5,a=C.pinnedTreeStore),"favoritesStore"in C&&n(6,o=C.favoritesStore),"component"in C&&n(0,c=C.component),"mounted"in C&&n(7,l=C.mounted),"pinnedTreeWindow"in C&&n(1,u=C.pinnedTreeWindow),"initialized"in C&&n(8,f=C.initialized),"initSwitchChecked"in C&&n(2,h=C.initSwitchChecked)},t&&"$$inject"in t&&e.$inject_state(t.$$inject),e.$$.update=()=>{e.$$.dirty&497&&s&&l&&c&&a&&o&&!f&&g()},[c,u,h,d,s,a,o,l,f,v,S,b,_,k,H,I,M,V,E,F,R,A]}class U2 extends _t{constructor(t){super(t),Ct(this,t,cd,Ro,tt,{pinnedTree:4,pinnedTreeStore:5,favoritesStore:6}),te("SvelteRegisterComponent",{component:this,tagName:"PinnedTreeWindow_1",options:t,id:Ro.name})}get pinnedTree(){throw new Error(": Props cannot be read directly from the component instance unless compiling with 'accessors: true' or ''")}set pinnedTree(t){throw new Error(": Props cannot be set directly on the component instance unless compiling with 'accessors: true' or ''")}get pinnedTreeStore(){throw new Error(": Props cannot be read directly from the component instance unless compiling with 'accessors: true' or ''")}set pinnedTreeStore(t){throw new Error(": Props cannot be set directly on the component instance unless compiling with 'accessors: true' or ''")}get favoritesStore(){throw new Error(": Props cannot be read directly from the component instance unless compiling with 'accessors: true' or ''")}set favoritesStore(t){throw new Error(": Props cannot be set directly on the component instance unless compiling with 'accessors: true' or ''")}}var oa,Z2;class Sc{constructor({favTree:t,component:n,textAreaNode:r,favoritesStore:i,pinnedTreeStore:s}){ye(this,oa);N(this,"favTree");N(this,"textAreaNode");N(this,"favoritesStore");N(this,"favoritesStoreValue");N(this,"favoritesStoreUnsubscriber");N(this,"pinnedTreeStore");N(this,"pinnedTreeStoreValue");N(this,"PinnedTreeStoreValueUnsubscriber");N(this,"svg");N(this,"padding");N(this,"width");N(this,"height");N(this,"adjustTextAreaHeight",async()=>{await yl(),this.textAreaNode.style.removeProperty("height"),this.textAreaNode.style.height=`${this.textAreaNode.scrollHeight}px`});N(this,"noteChanged",t=>{t.stopPropagation(),this.favTree.pinnedTreeUpdated(),this.adjustTextAreaHeight()});N(this,"deleteClicked",t=>{t.preventDefault(),t.stopPropagation();let n=-1;for(let a=0;aa.pinnedTree.treeID)].indexOf(this.favTree.pinnedTree.treeID);s>-1&&this.favoritesStoreValue.favTrees.splice(s,1),this.favoritesStore.set(this.favoritesStoreValue)});N(this,"thumbnailClicked",t=>{t.preventDefault(),t.stopPropagation();for(let n=0;n{this.favoritesStoreValue=c,this.favoritesStoreValue.shown&&this.adjustTextAreaHeight()}),this.pinnedTreeStore=s,this.pinnedTreeStoreValue=Fr(),this.PinnedTreeStoreValueUnsubscriber=this.pinnedTreeStore.subscribe(c=>{this.pinnedTreeStoreValue=c});const a=70,o=70;this.svg=z.select(n).select("svg.tree-svg").attr("width",a).attr("height",o).attr("viewbox",`0 0 ${a} ${o}`).attr("preserveAspectRatio","none"),this.padding={top:10,bottom:10,left:0,right:0},this.width=a-this.padding.left-this.padding.right,this.height=o-this.padding.top-this.padding.bottom,se(this,oa,Z2).call(this)}}oa=new WeakSet,Z2=function(){const t=this.svg.append("g").attr("class","content").attr("transform",`translate(${this.padding.left}, ${this.padding.top})`),n=z.hierarchy(this.favTree.pinnedTree.tree,u=>u.c),r=4,i=4,s=z.tree().size([this.width,this.height])(n);t.append("g").attr("class","link-group").selectAll("path.link").data(s.links()).join("path").attr("class",u=>`link link-${u.source.data.f[0]}`).attr("id",u=>{const f=u.source.ancestors().length>1?u.source.ancestors()[1].data.f[0]:"r",h=u.source.data.f[0],p=u.target.data.f[0];return u.target.data.f[0]==="+"?`link-${f}-${h}-p`:u.target.data.f[0]==="-"?`link-${f}-${h}-n`:`link-${f}-${h}-${p}`}).attr("d",u=>z.line()([[u.source.x,u.source.y],[u.target.x,u.target.y]]));const c=t.append("g").attr("class","node-group").selectAll("g").data(s.descendants()).join("g").attr("class","node").attr("transform",u=>`translate(${u.x}, ${u.y})`),l=new Set(["-","+"]);c.filter(u=>!l.has(u.data.f[0])).append("circle").attr("r",r).style("fill",u=>this.favTree.getFeatureColor(u.data.f[0])),c.filter(u=>l.has(u.data.f[0])).append("rect").attr("x",-i).attr("y",-i).attr("rx",1).attr("ry",1).attr("width",2*i).attr("height",2*i),c.filter(u=>l.has(u.data.f[0])).append("text").attr("dy",.5).text(u=>u.data.f[0])};const j2='';const At="src/components/favorites-panel/FavoritesRow.svelte";function Io(e){let t,n,r;const i={c:function(){t=L("textarea"),w(t,"class","note-window-input s-Su409VPrjAJA"),w(t,"name","note-input"),w(t,"placeholder","Leave a comment."),x(t,At,178,8,4177)},m:function(a,o){ae(a,t,o),e[10](t),xs(t,e[0].pinnedTree.note),n||(r=[he(t,"input",e[11],!1,!1,!1),he(t,"input",e[12])],n=!0)},p:function(a,o){o&1&&xs(t,a[0].pinnedTree.note)},d:function(a){a&&ee(t),e[10](null),n=!1,Re(r)}};return te("SvelteRegisterBlock",{block:i,id:Io.name,type:"if",source:"(178:6) {#if favTree !== null}",ctx:e}),i}function Eo(e){var F,R;let t,n,r,i,s,a,o,c,l,u=((F=e[3])==null?void 0:F.favTree.pinnedTree.treeID)+"",f,h,p,g,d=((R=e[3])==null?void 0:R.favTree.pinnedTree.treeMetric)+"",m,v,S,b,_,k,H,I,M,V=e[0]!==null&&Io(e);const E={c:function(){t=L("div"),n=L("div"),r=Dn("svg"),i=W(),s=L("div"),a=L("div"),o=L("div"),c=L("span"),l=ce("Tree "),f=ce(u),h=W(),p=L("span"),g=ce("("),m=ce(d),v=ce(")"),S=W(),b=L("div"),_=L("div"),k=W(),H=L("div"),V&&V.c(),w(r,"class","tree-svg s-Su409VPrjAJA"),x(r,At,155,4,3529),w(n,"class","tree-left s-Su409VPrjAJA"),x(n,At,154,2,3501),w(c,"class","tree-name s-Su409VPrjAJA"),x(c,At,161,8,3711),w(p,"class","tree-metric s-Su409VPrjAJA"),x(p,At,164,8,3816),w(o,"class","tree-info-left s-Su409VPrjAJA"),x(o,At,160,6,3674),w(_,"class","svg-icon s-Su409VPrjAJA"),x(_,At,170,8,3974),w(b,"class","tree-info-right s-Su409VPrjAJA"),x(b,At,169,6,3936),w(a,"class","tree-info s-Su409VPrjAJA"),x(a,At,159,4,3644),w(H,"class","tree-note s-Su409VPrjAJA"),x(H,At,176,4,4116),w(s,"class","tree-right s-Su409VPrjAJA"),x(s,At,158,2,3615),w(t,"class","tree s-Su409VPrjAJA"),x(t,At,153,0,3458)},l:function(C){throw new Error("options.hydrate only works if the component was compiled with the `hydratable: true` option")},m:function(C,T){ae(C,t,T),y(t,n),y(n,r),y(t,i),y(t,s),y(s,a),y(a,o),y(o,c),y(c,l),y(c,f),y(o,h),y(o,p),y(p,g),y(p,m),y(p,v),y(a,S),y(a,b),y(b,_),_.innerHTML=j2,y(s,k),y(s,H),V&&V.m(H,null),e[13](t),I||(M=[he(r,"click",e[8],!1,!1,!1),he(_,"click",e[9],!1,!1,!1)],I=!0)},p:function(C,[T]){var D,P;T&8&&u!==(u=((D=C[3])==null?void 0:D.favTree.pinnedTree.treeID)+"")&&Ee(f,u),T&8&&d!==(d=((P=C[3])==null?void 0:P.favTree.pinnedTree.treeMetric)+"")&&Ee(m,d),C[0]!==null?V?V.p(C,T):(V=Io(C),V.c(),V.m(H,null)):V&&(V.d(1),V=null)},i:pe,o:pe,d:function(C){C&&ee(t),V&&V.d(),e[13](null),I=!1,Re(M)}};return te("SvelteRegisterBlock",{block:E,id:Eo.name,type:"component",source:"",ctx:e}),E}function ud(e,t,n){let{$$slots:r={},$$scope:i}=t;St("FavoritesRow",r,[]);let{favTree:s=null}=t,{favoritesStore:a=null}=t,{pinnedTreeStore:o=null}=t,c=null,l=null,u=!1,f=!1,h=null;Ne(()=>{n(6,u=!0)}),Ms(()=>{h==null||h.favoritesStoreUnsubscriber(),h==null||h.PinnedTreeStoreValueUnsubscriber()});const p=()=>{s&&l&&c&&a&&o&&n(3,h=new Sc({favTree:s,component:c,textAreaNode:l,favoritesStore:a,pinnedTreeStore:o})),n(7,f=!0)},g=["favTree","favoritesStore","pinnedTreeStore"];Object.keys(t).forEach(k=>{!~g.indexOf(k)&&k.slice(0,2)!=="$$"&&k!=="slot"&&console.warn(` was created with unknown prop '${k}'`)});const d=k=>h==null?void 0:h.thumbnailClicked(k),m=k=>h==null?void 0:h.deleteClicked(k);function v(k){Je[k?"unshift":"push"](()=>{l=k,n(2,l)})}const S=k=>h.noteChanged(k);function b(){s.pinnedTree.note=this.value,n(0,s)}function _(k){Je[k?"unshift":"push"](()=>{c=k,n(1,c)})}return e.$$set=k=>{"favTree"in k&&n(0,s=k.favTree),"favoritesStore"in k&&n(4,a=k.favoritesStore),"pinnedTreeStore"in k&&n(5,o=k.pinnedTreeStore)},e.$capture_state=()=>({FavoritesRow:Sc,onMount:Ne,onDestroy:Ms,deleteIcon:j2,favTree:s,favoritesStore:a,pinnedTreeStore:o,component:c,textAreaNode:l,mounted:u,initialized:f,favoriteRow:h,initView:p}),e.$inject_state=k=>{"favTree"in k&&n(0,s=k.favTree),"favoritesStore"in k&&n(4,a=k.favoritesStore),"pinnedTreeStore"in k&&n(5,o=k.pinnedTreeStore),"component"in k&&n(1,c=k.component),"textAreaNode"in k&&n(2,l=k.textAreaNode),"mounted"in k&&n(6,u=k.mounted),"initialized"in k&&n(7,f=k.initialized),"favoriteRow"in k&&n(3,h=k.favoriteRow)},t&&"$$inject"in t&&e.$inject_state(t.$$inject),e.$$.update=()=>{e.$$.dirty&247&&s&&l&&c&&a&&o&&u&&!f&&p()},[s,c,l,h,a,o,u,f,d,m,v,S,b,_]}class X2 extends _t{constructor(t){super(t),Ct(this,t,ud,Eo,tt,{favTree:0,favoritesStore:4,pinnedTreeStore:5}),te("SvelteRegisterComponent",{component:this,tagName:"FavoritesRow_1",options:t,id:Eo.name})}get favTree(){throw new Error(": Props cannot be read directly from the component instance unless compiling with 'accessors: true' or ''")}set favTree(t){throw new Error(": Props cannot be set directly on the component instance unless compiling with 'accessors: true' or ''")}get favoritesStore(){throw new Error(": Props cannot be read directly from the component instance unless compiling with 'accessors: true' or ''")}set favoritesStore(t){throw new Error(": Props cannot be set directly on the component instance unless compiling with 'accessors: true' or ''")}get pinnedTreeStore(){throw new Error(": Props cannot be read directly from the component instance unless compiling with 'accessors: true' or ''")}set pinnedTreeStore(t){throw new Error(": Props cannot be set directly on the component instance unless compiling with 'accessors: true' or ''")}}const _c=(e,t)=>{e.stopPropagation(),e.preventDefault();const n=JSON.parse(JSON.stringify(t.favTrees)),r=[];n.forEach(i=>{delete i.getFeatureColor,delete i.pinnedTreeUpdated,delete i.pinnedTree.isPinned,delete i.pinnedTree.isFav,delete i.pinnedTree.jiggle,delete i.pinnedTree.x,delete i.pinnedTree.y,delete i.pinnedTree.startPos,r.push(i.pinnedTree)}),V7(r,null,"favorite-trees.json")};function q2(e,{from:t,to:n},r={}){const i=getComputedStyle(e),s=i.transform==="none"?"":i.transform,[a,o]=i.transformOrigin.split(" ").map(parseFloat),c=t.left+t.width*a/n.width-(n.left+a),l=t.top+t.height*o/n.height-(n.top+o),{delay:u=0,duration:f=p=>Math.sqrt(p)*120,easing:h=qc}=r;return{delay:u,duration:Br(f)?f(Math.sqrt(c*c+l*l)):f,easing:h,css:(p,g)=>{const d=g*c,m=g*l,v=p+g*t.width/n.width,S=p+g*t.height/n.height;return`transform: ${s} translate(${d}px, ${m}px) scale(${v}, ${S});`}}}const Va='',J2='';const Vt="src/components/favorites-panel/FavoritesPanel.svelte";function as(e,t,n){const r=e.slice();return r[11]=t[n],r}function zo(e){let t,n,r,i;const s=[K2,Q2],a=[];function o(l,u){return l[5].favTrees.length===0?0:1}t=o(e),n=a[t]=s[t](e);const c={c:function(){n.c(),r=_s()},m:function(u,f){a[t].m(u,f),ae(u,r,f),i=!0},p:function(u,f){let h=t;t=o(u),t===h?a[t].p(u,f):(Nn(),Me(a[h],1,1,()=>{a[h]=null}),Hn(),n=a[t],n?n.p(u,f):(n=a[t]=s[t](u),n.c()),_e(n,1),n.m(r.parentNode,r))},i:function(u){i||(_e(n),i=!0)},o:function(u){Me(n),i=!1},d:function(u){a[t].d(u),u&&ee(r)}};return te("SvelteRegisterBlock",{block:c,id:zo.name,type:"if",source:"(180:2) {#if initialized}",ctx:e}),c}function Q2(e){let t,n=[],r=new Map,i,s=e[5].favTrees;De(s);const a=c=>c[11].pinnedTree.treeID;Vs(e,s,as,a);for(let c=0;c{d=null}),Hn()),(!h||b&4&&f!==(f=`max-height: ${S[2]}px;`))&&w(t,"style",f),(!h||b&32)&&ge(t,"shown",S[5].shown)},i:function(S){h||(_e(d),h=!0)},o:function(S){Me(d),h=!1},d:function(S){S&&ee(t),d&&d.d(),e[9](null),p=!1,Re(g)}};return te("SvelteRegisterBlock",{block:m,id:Oo.name,type:"component",source:"",ctx:e}),m}function hd(e,t,n){let{$$slots:r={},$$scope:i}=t;St("FavoritesPanel",r,[]);let{favoritesStore:s=null}=t,{pinnedTreeStore:a=null}=t,{width:o=650}=t,c=null,l=!1,u=!1,f=Nr();Ne(()=>{n(7,l=!0)});const h=()=>{s&&a&&s.subscribe(v=>{n(5,f=v)}),n(3,u=!0)},p=v=>{v.stopPropagation(),v.preventDefault(),n(5,f.shown=!1,f),s==null||s.set(f)},g=["favoritesStore","pinnedTreeStore","width"];Object.keys(t).forEach(v=>{!~g.indexOf(v)&&v.slice(0,2)!=="$$"&&v!=="slot"&&console.warn(` was created with unknown prop '${v}'`)});const d=v=>_c(v,f);function m(v){Je[v?"unshift":"push"](()=>{c=v,n(4,c)})}return e.$$set=v=>{"favoritesStore"in v&&n(0,s=v.favoritesStore),"pinnedTreeStore"in v&&n(1,a=v.pinnedTreeStore),"width"in v&&n(2,o=v.width)},e.$capture_state=()=>({FavoritesRow:X2,downloadClicked:_c,getFavoritesStoreDefaultValue:Nr,onMount:Ne,flip:q2,fade:Ii,closeIcon:Va,downloadIcon:J2,heartDemoIcon:Aa,favoritesStore:s,pinnedTreeStore:a,width:o,component:c,mounted:l,initialized:u,favoritesStoreValue:f,initView:h,closeClicked:p}),e.$inject_state=v=>{"favoritesStore"in v&&n(0,s=v.favoritesStore),"pinnedTreeStore"in v&&n(1,a=v.pinnedTreeStore),"width"in v&&n(2,o=v.width),"component"in v&&n(4,c=v.component),"mounted"in v&&n(7,l=v.mounted),"initialized"in v&&n(3,u=v.initialized),"favoritesStoreValue"in v&&n(5,f=v.favoritesStoreValue)},t&&"$$inject"in t&&e.$inject_state(t.$$inject),e.$$.update=()=>{e.$$.dirty&139&&s&&a&&l&&!u&&h()},[s,a,o,u,c,f,p,l,d,m]}class $2 extends _t{constructor(t){super(t),Ct(this,t,hd,Oo,tt,{favoritesStore:0,pinnedTreeStore:1,width:2}),te("SvelteRegisterComponent",{component:this,tagName:"FavoritesPanel",options:t,id:Oo.name})}get favoritesStore(){throw new Error(": Props cannot be read directly from the component instance unless compiling with 'accessors: true' or ''")}set favoritesStore(t){throw new Error(": Props cannot be set directly on the component instance unless compiling with 'accessors: true' or ''")}get pinnedTreeStore(){throw new Error(": Props cannot be read directly from the component instance unless compiling with 'accessors: true' or ''")}set pinnedTreeStore(t){throw new Error(": Props cannot be set directly on the component instance unless compiling with 'accessors: true' or ''")}get width(){throw new Error(": Props cannot be read directly from the component instance unless compiling with 'accessors: true' or ''")}set width(t){throw new Error(": Props cannot be set directly on the component instance unless compiling with 'accessors: true' or ''")}}const os=z.format(",.3~f"),vt=45,ls="slider-left-thumb",cs="slider-right-thumb",ci=268,ui=16,Ye=8,pr={default:6,original:6*1.8};var la,e0,ca,t0,ua,n0,Tn,mr,Hi,Go,Mr,Cs,Ar,Ss,ha,r0,fa,i0,Mn,yr,Fi,Yo,da,s0,pa,a0,ga,o0,ma,l0,ya,c0,wa,u0,va,h0,ba,f0,Pi,Bo;class xc{constructor(t,n,r,i){ye(this,la);ye(this,ca);ye(this,ua);ye(this,Tn);ye(this,Hi);ye(this,Mr);ye(this,Ar);ye(this,ha);ye(this,fa);ye(this,Mn);ye(this,Fi);ye(this,da);ye(this,pa);ye(this,ga);ye(this,ma);ye(this,ya);ye(this,wa);ye(this,va);ye(this,ba);ye(this,Pi);N(this,"component");N(this,"accuracyRow");N(this,"accuracySVG",null);N(this,"minSampleRow");N(this,"minSampleSVG",null);N(this,"heightRow");N(this,"heightSVG",null);N(this,"data");N(this,"treeMapMap");N(this,"accuracyDensities");N(this,"heightDensities");N(this,"minSampleDensities");N(this,"accuracyXScale");N(this,"accuracyYScale");N(this,"densityClip");N(this,"minSampleXScale");N(this,"minSampleYScale");N(this,"minSampleDensityClip");N(this,"heightXScale");N(this,"heightYScale");N(this,"searchStore");N(this,"searchStoreValue");N(this,"curAccuracyLow");N(this,"curAccuracyHigh");N(this,"accuracyLow");N(this,"accuracyHigh");N(this,"curMinSampleLow");N(this,"curMinSampleHigh");N(this,"minSampleLow");N(this,"minSampleHigh");N(this,"searchUpdated");N(this,"refreshAccuracy",()=>{se(this,Tn,mr).call(this,"slider-left-thumb",this.accuracyLow),se(this,Tn,mr).call(this,"slider-right-thumb",this.accuracyHigh)});N(this,"refreshMinSample",()=>{se(this,Mn,yr).call(this,"slider-left-thumb",this.minSampleLow),se(this,Mn,yr).call(this,"slider-right-thumb",this.minSampleHigh)});N(this,"refreshHeight",()=>{var t;for(const n of this.heightXScale.domain()){const r=z.select(this.component).select(`#height-checkbox-${n}`);r.property("checked")||((t=this.heightSVG)==null||t.select(`#bar-${n}`).classed("selected",!0),r.property("checked",!0),this.searchStoreValue.curHeightRange.add(n))}this.searchStore.set(this.searchStoreValue)});N(this,"refreshDepth",t=>{const n=z.select(this.component).select(`#level-row-${t} .level-content`),r=this.searchStoreValue.curDepthFeatures.get(t);if(r===void 0){console.warn(`Unknown depth ${t}`);return}for(const i of this.searchStoreValue.featureOrder){const s=n.select(`#depth-check-box-label-${t}-${i}`);s.property("checked")||(s.property("checked",!0),r.add(i))}this.searchStoreValue.curDepthFeatures.set(t,r),this.searchStore.set(this.searchStoreValue)});N(this,"refreshAllFeatures",()=>{const t=z.select(this.component).select("#level-row-0 .level-content"),n=this.searchStoreValue.curAllFeatures;for(const r of this.searchStoreValue.featureOrder){const i=t.select(`#depth-check-box-label-0-${r}`);i.property("checked")||(i.property("checked",!0),n.add(r))}this.searchStoreValue.curAllFeatures=n,this.searchStore.set(this.searchStoreValue)});N(this,"updatePlots",(t,n=!1)=>{var k,H,I;const r=[],i=[],s=new Map;if(this.searchStoreValue.treeHeightMap)for(const[M,V]of this.searchStoreValue.treeHeightMap)s.set(M,0);let a=1;this.searchStoreValue.treeHeightMap&&(a=this.searchStoreValue.treeHeightMap.size);const o=z.transition("updatePlot").duration(500);for(const M in this.data.treeMap){const V=parseInt(M);if(t.allFeature.has(V)&&t.depth.has(V)&&t.height.has(V)&&t.minSample.has(V)&&r.push(this.data.treeMap[M][2]),t.allFeature.has(V)&&t.depth.has(V)&&t.height.has(V)&&t.accuracy.has(V)&&this.searchStoreValue.treeMinSampleMap!==null&&i.push(this.searchStoreValue.treeMinSampleMap.get(V)),t.allFeature.has(V)&&t.depth.has(V)&&t.minSample.has(V)&&t.accuracy.has(V)&&this.searchStoreValue.treeHeightMap!==null){const E=this.searchStoreValue.treeHeightMap.get(V),F=s.get(E);s.set(E,F+1)}}const c=50,l=z.bin().thresholds(c),u=l(r),f=[];if(u.forEach(M=>{f.push({x:M.x0===void 0?0:M.x0,y:M.length/a})}),f.length>2){const M=f[1].x-f[0].x;f.unshift({x:f[0].x-M,y:0}),f.push({x:f.slice(-1)[0].x+M,y:0})}const h=[];if(l(i).forEach(M=>{h.push({x:M.x0===void 0?0:M.x0,y:M.length/a})}),h.length>2){const M=h[1].x-h[0].x;h.unshift({x:Math.max(0,h[0].x-M),y:0}),h.push({x:h.slice(-1)[0].x+M,y:0})}const g=[];s.forEach((M,V)=>{g.push({x:V,y:M/a})}),g.sort((M,V)=>M.x-V.x);const d=(k=this.accuracySVG)==null?void 0:k.select("g.hist-group"),m=z.line().curve(z.curveBasis).x(M=>this.accuracyXScale(M.x)).y(M=>this.accuracyYScale(M.y));n?(d==null||d.select("path.area-path").datum(f).transition(o).attr("d",m),d==null||d.select("path.area-path.selected").datum(f).transition(o).attr("d",m)):(d==null||d.select("path.area-path").datum(f).attr("d",m),d==null||d.select("path.area-path.selected").datum(f).attr("d",m));const v=(H=this.minSampleSVG)==null?void 0:H.select("g.hist-group"),S=z.line().curve(z.curveBasis).x(M=>this.minSampleXScale(M.x)).y(M=>this.minSampleYScale(M.y));n?(v==null||v.select("path.area-path").datum(h).transition(o).attr("d",S),v==null||v.select("path.area-path.selected").datum(h).transition(o).attr("d",S)):(v==null||v.select("path.area-path").datum(h).attr("d",S),v==null||v.select("path.area-path.selected").datum(h).attr("d",S));const b=(I=this.heightSVG)==null?void 0:I.select("g.hist-group"),_=b==null?void 0:b.selectAll("g.bar").data(g);n?(_==null||_.select("rect").transition(o).attr("y",M=>this.heightYScale(M.y)).attr("height",M=>this.heightYScale(0)-this.heightYScale(M.y)),_==null||_.select("text").transition(o).attr("y",M=>this.heightYScale(M.y)-5)):(_==null||_.select("rect").attr("y",M=>this.heightYScale(M.y)).attr("height",M=>this.heightYScale(0)-this.heightYScale(M.y)),_==null||_.select("text").attr("y",M=>this.heightYScale(M.y)-5)),_==null||_.select("tspan").text(M=>`(${z.format(".0%")(M.y)})`),_==null||_.select("title").text(M=>`Height: ${M.x} (${z.format(".4%")(M.y)})`)});this.component=t,this.searchUpdated=r,this.searchStore=i,this.searchStoreValue=Hr(),this.searchStore.subscribe(a=>{this.searchStoreValue=a,this.searchUpdated()}),this.accuracyRow=z.select(t).select(".accuracy-row"),this.minSampleRow=z.select(t).select(".min-sample-row"),this.heightRow=z.select(t).select(".height-row"),this.curAccuracyLow=0,this.curAccuracyHigh=1,this.accuracyLow=0,this.accuracyHigh=1,this.curMinSampleLow=0,this.curMinSampleHigh=1,this.minSampleLow=0,this.minSampleHigh=1,this.data=n,this.treeMapMap=new Map,Object.keys(n.treeMap).forEach(a=>{this.treeMapMap.set(+a,n.treeMap[+a])});const s=se(this,la,e0).call(this);this.accuracyDensities=s.accuracyDensities,this.heightDensities=s.heightDensities,this.minSampleDensities=s.minSampleDensities,this.accuracyXScale=z.scaleLinear(),this.accuracyYScale=z.scaleLinear(),this.densityClip=null,this.accuracySVG=se(this,ca,t0).call(this),se(this,ua,n0).call(this),this.minSampleXScale=z.scaleLinear(),this.minSampleYScale=z.scaleLinear(),this.minSampleDensityClip=null,this.minSampleSVG=se(this,ha,r0).call(this),se(this,fa,i0).call(this),this.heightXScale=z.scaleBand(),this.heightYScale=z.scaleLinear(),this.heightSVG=se(this,ga,o0).call(this),se(this,ma,l0).call(this),se(this,wa,u0).call(this),this.searchStoreValue.updatePlots=(a,o)=>{this.updatePlots(a,o)},this.searchStore.set(this.searchStoreValue)}}la=new WeakSet,e0=function(){const t=[];for(const b in this.data.treeMap)t.push(this.data.treeMap[b][2]);const n=t.length,r=50,s=z.bin().thresholds(r)(t),a=[];s.forEach(b=>{a.push({x:b.x0===void 0?0:b.x0,y:b.length/n})});const o=a[1].x-a[0].x;a.unshift({x:a[0].x-o,y:0}),a.push({x:a.slice(-1)[0].x+o,y:0}),this.curAccuracyLow=a[0].x,this.curAccuracyHigh=a.slice(-1)[0].x,this.accuracyLow=this.curAccuracyLow,this.accuracyHigh=this.curAccuracyHigh;const c=new Map;z.hierarchy(this.data.trie,b=>b.c).eachBefore(b=>{if(b.data.t!==void 0){const _=b.data.t;c.has(_)?c.set(_,Math.max(c.get(_),b.depth)):c.set(_,b.depth)}});const u=new Map,f=new Map,h=[];for(const[b,_]of this.treeMapMap){const k=new Map,H=z.hierarchy(_[0],M=>M.c);let I=1/0;H.each(M=>{M.data.f[0]!=="+"&&M.data.f[0]!=="-"?k.has(M.depth+1)?k.get(M.depth+1).add(parseInt(M.data.f[0])):k.set(M.depth+1,new Set([parseInt(M.data.f[0])])):I=Math.min(I,M.data.f[1])}),u.set(b,k),f.set(b,I),h.push(I)}const p=new Map;Array.from(c.values()).forEach(b=>{p.has(b)?p.set(b,p.get(b)+1):p.set(b,1)});const g=[];p.forEach((b,_)=>{g.push({x:_,y:b/n})}),g.sort((b,_)=>b.x-_.x);const d=50,m=z.bin().thresholds(d)(h),v=[];m.forEach(b=>{v.push({x:b.x0===void 0?0:b.x0,y:b.length/n})});const S=v[1].x-v[0].x;return v.unshift({x:Math.max(0,v[0].x-S),y:0}),v.push({x:v.slice(-1)[0].x+S,y:0}),this.curMinSampleLow=v[0].x,this.curMinSampleHigh=v.slice(-1)[0].x,this.minSampleLow=this.curMinSampleLow,this.minSampleHigh=this.curMinSampleHigh,this.searchStoreValue.treeHeightMap=c,this.searchStoreValue.treeMinSampleMap=f,this.searchStoreValue.treeDepthFeaturesMap=u,this.searchStore.set(this.searchStoreValue),{accuracyDensities:a,heightDensities:g,minSampleDensities:v}},ca=new WeakSet,t0=function(){const t=ci-ui*2,n=30,r=15,i=vt+r+n,s=this.accuracyRow.select(".svg-accuracy").attr("width",t).attr("height",i),a={top:0,left:Ye,right:Ye,bottom:0,histTop:2},o=t-a.left-a.right;s.append("g").attr("class","border-group").attr("transform",`translate(${0}, ${a.top})`).append("rect").attr("width",t).attr("height",vt-a.top).style("fill","none").style("stroke",Te.colors["gray-300"]);const c=s.append("g").attr("class","hist-group").attr("transform",`translate(${Ye}, ${a.top})`);this.accuracyXScale=z.scaleLinear().domain([this.accuracyDensities[0].x,this.accuracyDensities.slice(-1)[0].x]).range([0,o]);const l=Math.max(...this.accuracyDensities.map(k=>k.y));this.accuracyYScale=z.scaleLinear().domain([0,l]).range([vt-a.bottom-a.top,a.histTop]);const u=z.line().curve(z.curveBasis).x(k=>this.accuracyXScale(k.x)).y(k=>this.accuracyYScale(k.y)),h=c.append("path").attr("class","area-path").datum(this.accuracyDensities).attr("d",u).clone(!0).classed("selected",!0);this.densityClip=c.append("clipPath").attr("id","accuracy-density-clip").append("rect").style("fill","hsla(100, 50%, 50%, 0.1)").attr("x",this.accuracyXScale(this.curAccuracyLow)).attr("width",this.accuracyXScale(this.curAccuracyHigh)-this.accuracyXScale(this.curAccuracyLow)).attr("height",vt),h.attr("clip-path","url(#accuracy-density-clip)");const p=s.append("g").attr("class","tick-group").attr("transform",`translate(${Ye}, ${vt+r})`),g=p.append("g").attr("class","tick-back-group"),d=p.append("g").attr("class","tick-top-group"),m=30,v=[],S=this.accuracyDensities[1].x-this.accuracyDensities[0].x,b=this.accuracyLow+S,_=this.accuracyHigh;for(let k=0;k<=m;k++)v.push(b+(_-b)*k/m);return d.selectAll("g.tick").data(v).join("g").attr("class","tick").attr("transform",k=>`translate(${this.accuracyXScale(k)}, 0)`).append("line").attr("y2",pr.default),se(this,Ar,Ss).call(this),g.append("text").attr("class","label-min-value").attr("x",-4).attr("y",pr.default*2.2).style("text-anchor","start").style("dominant-baseline","hanging").style("font-size","0.9em").style("fill",Te.colors["gray-500"]).text(os(this.accuracyLow)),g.append("text").attr("class","label-max-value").attr("x",o+4).attr("y",pr.default*2.2).style("text-anchor","end").style("dominant-baseline","hanging").style("font-size","0.9em").style("fill",Te.colors["gray-500"]).text(os(this.accuracyHigh)),s},ua=new WeakSet,n0=function(){se(this,Tn,mr).call(this,ls,this.curAccuracyLow),se(this,Tn,mr).call(this,cs,this.curAccuracyHigh),this.accuracyRow.select(`#${ls}`).on("mousedown",t=>se(this,Hi,Go).call(this,t)),this.accuracyRow.select(`#${cs}`).on("mousedown",t=>se(this,Hi,Go).call(this,t)),se(this,Mr,Cs).call(this)},Tn=new WeakSet,mr=function(t,n){switch(n=Math.min(Math.max(n,this.accuracyLow),this.accuracyHigh),t){case"slider-left-thumb":n=Math.min(this.curAccuracyHigh,n);break;case"slider-right-thumb":n=Math.max(this.curAccuracyLow,n);break;default:console.warn("Unknown thumb type in moveThumb()");break}const r=this.accuracyRow.select(`#${t}`).attr("data-curValue",n),i=ci-2*ui-2*Ye;let s=(n-this.accuracyLow)/(this.accuracyHigh-this.accuracyLow)*i;switch(t){case"slider-left-thumb":s-=Ye,this.curAccuracyLow=n,this.searchStoreValue.curAccuracyLow=this.curAccuracyLow;break;case"slider-right-thumb":this.curAccuracyHigh=n,this.searchStoreValue.curAccuracyHigh=this.curAccuracyHigh;break;default:console.warn("Unknown thumb type in moveThumb()");break}this.searchStore.set(this.searchStoreValue),r.style("left",`${s}px`),se(this,Mr,Cs).call(this),se(this,Ar,Ss).call(this),this.searchUpdated()},Hi=new WeakSet,Go=function(t){t.preventDefault(),t.stopPropagation();const n=t.target;if(n===null||!n.id.includes("thumb"))return;const r=n.parentNode,i=r.getBoundingClientRect().width;n.focus();const s=o=>{o.preventDefault(),o.stopPropagation();const c=o.pageX-r.getBoundingClientRect().x,l=this.accuracyLow+(this.accuracyHigh-this.accuracyLow)*c/i;se(this,Tn,mr).call(this,n.id,l)},a=()=>{document.removeEventListener("mousemove",s),document.removeEventListener("mouseup",a),document.body.style.cursor="default",n.blur()};document.addEventListener("mousemove",s),document.addEventListener("mouseup",a),document.body.style.cursor="grabbing"},Mr=new WeakSet,Cs=function(){const t=this.accuracyRow.select("#slider-left-thumb"),n=this.accuracyRow.select("#slider-right-thumb"),r=parseFloat(t.style("left")),s=parseFloat(n.style("left"))-r;this.accuracyRow.select(".track .range-track").style("left",`${r+Ye}px`).style("width",`${s}px`),this.densityClip!==null&&this.densityClip.attr("x",this.accuracyXScale(this.curAccuracyLow)).attr("width",this.accuracyXScale(this.curAccuracyHigh)-this.accuracyXScale(this.curAccuracyLow))},Ar=new WeakSet,Ss=function(){if(this.accuracySVG===null)return;const t=this.accuracySVG.select("g.tick-top-group").selectAll("g.tick");t.filter(n=>n>=this.curAccuracyLow&&n<=this.curAccuracyHigh).classed("out-range",!1),t.filter(n=>nthis.curAccuracyHigh).classed("out-range",!0),this.curAccuracyHigh===this.curAccuracyLow&&this.accuracySVG.select("g.tick-top-group").selectAll("g.tick").classed("out-range",!0)},ha=new WeakSet,r0=function(){const t=ci-ui*2,n=30,r=15,i=vt+r+n,s=this.minSampleRow.select(".svg-min-sample").attr("width",t).attr("height",i),a={top:0,left:Ye,right:Ye,bottom:0,histTop:2},o=t-a.left-a.right;s.append("g").attr("class","border-group").attr("transform",`translate(${0}, ${a.top})`).append("rect").attr("width",t).attr("height",vt-a.top).style("fill","none").style("stroke",Te.colors["gray-300"]);const c=s.append("g").attr("class","hist-group").attr("transform",`translate(${Ye}, ${a.top})`);this.minSampleXScale=z.scaleLinear().domain([this.minSampleDensities[0].x,this.minSampleDensities.slice(-1)[0].x]).range([0,o]);const l=Math.max(...this.minSampleDensities.map(k=>k.y));this.minSampleYScale=z.scaleLinear().domain([0,l]).range([vt-a.bottom-a.top,a.histTop]);const u=z.line().curve(z.curveBasis).x(k=>this.minSampleXScale(k.x)).y(k=>this.minSampleYScale(k.y)),h=c.append("path").attr("class","area-path").datum(this.minSampleDensities).attr("d",u).clone(!0).classed("selected",!0);this.minSampleDensityClip=c.append("clipPath").attr("id","min-sample-density-clip").append("rect").style("fill","hsla(100, 50%, 50%, 0.1)").attr("x",this.minSampleXScale(this.curMinSampleLow)).attr("width",this.minSampleXScale(this.curMinSampleHigh)-this.minSampleXScale(this.curMinSampleLow)).attr("height",vt),h.attr("clip-path","url(#min-sample-density-clip)");const p=s.append("g").attr("class","tick-group").attr("transform",`translate(${Ye}, ${vt+r})`),g=p.append("g").attr("class","tick-back-group"),d=p.append("g").attr("class","tick-top-group"),m=30,v=[],S=this.minSampleDensities[1].x-this.minSampleDensities[0].x,b=this.minSampleLow+S,_=this.minSampleHigh;for(let k=0;k<=m;k++)v.push(b+(_-b)*k/m);return d.selectAll("g.tick").data(v).join("g").attr("class","tick").attr("transform",k=>`translate(${this.minSampleXScale(k)}, 0)`).append("line").attr("y2",pr.default),se(this,Ar,Ss).call(this),g.append("text").attr("class","label-min-value").attr("x",-4).attr("y",pr.default*2.2).style("text-anchor","start").style("dominant-baseline","hanging").style("font-size","0.9em").style("fill",Te.colors["gray-500"]).text(os(this.minSampleLow)),g.append("text").attr("class","label-max-value").attr("x",o+4).attr("y",pr.default*2.2).style("text-anchor","end").style("dominant-baseline","hanging").style("font-size","0.9em").style("fill",Te.colors["gray-500"]).text(os(this.minSampleHigh)),s},fa=new WeakSet,i0=function(){se(this,Mn,yr).call(this,ls,this.curMinSampleLow),se(this,Mn,yr).call(this,cs,this.curMinSampleHigh),this.minSampleRow.select(`#${ls}`).on("mousedown",t=>se(this,Fi,Yo).call(this,t)),this.minSampleRow.select(`#${cs}`).on("mousedown",t=>se(this,Fi,Yo).call(this,t)),se(this,Mr,Cs).call(this)},Mn=new WeakSet,yr=function(t,n){switch(n=Math.min(Math.max(n,this.minSampleLow),this.minSampleHigh),t){case"slider-left-thumb":n=Math.min(this.curMinSampleHigh,n);break;case"slider-right-thumb":n=Math.max(this.curMinSampleLow,n);break;default:console.warn("Unknown thumb type in moveThumb()");break}const r=this.minSampleRow.select(`#${t}`).attr("data-curValue",n),i=ci-2*ui-2*Ye;let s=(n-this.minSampleLow)/(this.minSampleHigh-this.minSampleLow)*i;switch(t){case"slider-left-thumb":s-=Ye,this.curMinSampleLow=n,this.searchStoreValue.curMinSampleLow=this.curMinSampleLow;break;case"slider-right-thumb":this.curMinSampleHigh=n,this.searchStoreValue.curMinSampleHigh=this.curMinSampleHigh;break;default:console.warn("Unknown thumb type in moveThumb()");break}this.searchStore.set(this.searchStoreValue),r.style("left",`${s}px`),se(this,da,s0).call(this),se(this,pa,a0).call(this),this.searchUpdated()},Fi=new WeakSet,Yo=function(t){t.preventDefault(),t.stopPropagation();const n=t.target;if(n===null||!n.id.includes("thumb"))return;const r=n.parentNode,i=r.getBoundingClientRect().width;n.focus();const s=o=>{o.preventDefault(),o.stopPropagation();const c=o.pageX-r.getBoundingClientRect().x;let l=this.minSampleLow+(this.minSampleHigh-this.minSampleLow)*c/i;l=Gr(l,0),se(this,Mn,yr).call(this,n.id,l)},a=()=>{document.removeEventListener("mousemove",s),document.removeEventListener("mouseup",a),document.body.style.cursor="default",n.blur()};document.addEventListener("mousemove",s),document.addEventListener("mouseup",a),document.body.style.cursor="grabbing"},da=new WeakSet,s0=function(){const t=this.minSampleRow.select("#slider-left-thumb"),n=this.minSampleRow.select("#slider-right-thumb"),r=parseFloat(t.style("left")),s=parseFloat(n.style("left"))-r;this.minSampleRow.select(".track .range-track").style("left",`${r+Ye}px`).style("width",`${s}px`),this.minSampleDensityClip!==null&&this.minSampleDensityClip.attr("x",this.minSampleXScale(this.curMinSampleLow)).attr("width",this.minSampleXScale(this.curMinSampleHigh)-this.minSampleXScale(this.curMinSampleLow))},pa=new WeakSet,a0=function(){if(this.minSampleSVG===null)return;const t=this.minSampleSVG.select("g.tick-top-group").selectAll("g.tick");t.filter(n=>n>=this.curMinSampleLow&&n<=this.curMinSampleHigh).classed("out-range",!1),t.filter(n=>nthis.curMinSampleHigh).classed("out-range",!0),this.curMinSampleHigh===this.curMinSampleLow&&this.minSampleSVG.select("g.tick-top-group").selectAll("g.tick").classed("out-range",!0)},ga=new WeakSet,o0=function(){const t=ci-ui*2,n=0,i=vt+0+n,s=this.heightRow.select(".svg-height").attr("width",t).attr("height",i),a={top:0,left:Ye,right:Ye,bottom:0,histTop:20},o=t-a.left-a.right;s.append("g").attr("class","border-group").attr("transform",`translate(${0}, ${a.top})`).append("rect").attr("width",t).attr("height",vt-a.top).style("fill","none").style("stroke",Te.colors["gray-300"]);const c=s.append("g").attr("class","hist-group").attr("transform",`translate(${Ye}, ${a.top})`);this.heightXScale=z.scaleBand().domain(this.heightDensities.map(h=>h.x)).range([0,o]).paddingInner(.35);const l=Math.max(...this.heightDensities.map(h=>h.y));this.heightYScale=z.scaleLinear().domain([0,l]).range([vt-a.bottom-a.top,a.histTop]);const u=c.selectAll("g.bar").data(this.heightDensities).join("g").attr("class","bar selected").attr("id",h=>`bar-${h.x}`).attr("transform",h=>`translate(${this.heightXScale(h.x)}, ${0})`);return u.append("rect").attr("x",0).attr("y",h=>this.heightYScale(h.y)).attr("width",this.heightXScale.bandwidth()).attr("height",h=>this.heightYScale(0)-this.heightYScale(h.y)),u.append("text").attr("x",this.heightXScale.bandwidth()/2).attr("y",h=>this.heightYScale(h.y)-5).append("tspan").text(h=>`(${z.format(".0%")(h.y)})`),u.append("title").text(h=>`Height: ${h.x} (${z.format(".4%")(h.y)})`),this.searchStoreValue.curHeightRange=new Set(this.heightXScale.domain()),this.searchStore.set(this.searchStoreValue),s},ma=new WeakSet,l0=function(){const t=z.select(this.component).select(".height-checkboxes");this.heightDensities.forEach(n=>{t.append("label").attr("class","height-checkbox-label").attr("for",`height-checkbox-${n.x}`).text(n.x).style("left",`${this.heightXScale(n.x)+this.heightXScale.bandwidth()/2+13}px`),t.append("input").attr("type","checkbox").property("checked",!0).attr("class","height-checkbox").attr("id",`height-checkbox-${n.x}`).style("left",`${this.heightXScale(n.x)+this.heightXScale.bandwidth()/2-4}px`).on("change",i=>se(this,ya,c0).call(this,i,n.x))})},ya=new WeakSet,c0=function(t,n){var i;t.preventDefault();const r=t.target;(i=this.heightSVG)==null||i.select(`#bar-${n}`).classed("selected",r.checked),r.checked?this.searchStoreValue.curHeightRange.add(n):this.searchStoreValue.curHeightRange.delete(n),this.searchStore.set(this.searchStoreValue)},wa=new WeakSet,u0=async function(){await yl();for(const t of this.searchStoreValue.curDepthFeatures.keys())se(this,Pi,Bo).call(this,t);se(this,Pi,Bo).call(this,0)},va=new WeakSet,h0=function(t,n,r){t.preventDefault();const i=t.target,s=this.searchStoreValue.curDepthFeatures.get(n);if(s===void 0){console.error(`Unknown depth ${n}`);return}i.checked?s.add(r):s.delete(r),this.searchStoreValue.curDepthFeatures.set(n,s),this.searchStore.set(this.searchStoreValue)},ba=new WeakSet,f0=function(t,n){t.preventDefault();const r=t.target,i=this.searchStoreValue.curAllFeatures;r.checked?i.add(n):i.delete(n),this.searchStoreValue.curAllFeatures=i,this.searchStore.set(this.searchStoreValue)},Pi=new WeakSet,Bo=function(t){var o,c;const n=z.select(this.component).select(`#level-row-${t} .level-content`),r=new Set([]),i=new Set([]);for(const l of this.searchStoreValue.featureOrder){let u=this.searchStoreValue.featureMap.get(l);u===void 0&&(u=["","",""],console.error(`Cannot find feature ${l} in featureMap`)),i.has(u[2])?r.add(u[2]):i.add(u[2])}let s=null,a=null;for(const l of this.searchStoreValue.featureOrder){let u=this.searchStoreValue.featureMap.get(l);u===void 0&&(u=["","",""],console.error(`Cannot find feature ${l} in featureMap`));let f=n;if(s!==null&&u[2]!==a&&(a=null,s=null),r.has(u[2])){if(s===null){const v=n.append("div").attr("class","depth-checkbox-row");v.append("div").attr("class","depth-checkbox-row-title").text(u[2]),s=v.append("div").attr("class","depth-checkbox-row-checkboxes"),a=u[2]}f=s.append("div").attr("class","checkbox-wrapper")}else f=n.append("div").attr("class","depth-checkbox-single-row").append("div").attr("class","checkbox-wrapper");const h=f.append("input").attr("type","checkbox").property("checked",!0).attr("class","depth-checkbox").attr("id",`depth-check-box-label-${t}-${l}`),p=f.append("label").attr("class","depth-checkbox-label").attr("for",`depth-check-box-label-${t}-${l}`);let g=`${u[2]} ${u[1]}`;u[2]===a&&(g=`${u[1]}`),p.append("span").text(g),p.attr("title",t===0?`Show/hide trees using "${u[0]} ${u[1]}"`:`Show/hide trees using "${u[0]} ${u[1]}" at depth ${t}`);let d="initial";const m=(c=(o=this.searchStoreValue).getFeatureColor)==null?void 0:c.call(o,String(l));m!==void 0&&(d=m),h.style("accent-color",d),h.on("change",v=>{t===0?se(this,ba,f0).call(this,v,l):se(this,va,h0).call(this,v,t,l)})}};const Uo=` +`;const Ae="src/components/tree-window/PinnedTreeWindow.svelte";function z2(e){let t;const n={c:function(){t=L("div"),w(t,"class","svg-icon s-YWFeNV-ftNdK"),x(t,Ae,413,10,9908)},m:function(i,s){ae(i,t,s),t.innerHTML=Ma},p:pe,d:function(i){i&&ne(t)}};return ee("SvelteRegisterBlock",{block:n,id:z2.name,type:"else",source:"(413:8) {:else}",ctx:e}),n}function W2(e){let t;const n={c:function(){t=L("div"),w(t,"class","svg-icon icon-heart s-YWFeNV-ftNdK"),ge(t,"play-animation",!1),x(t,Ae,409,10,9759)},m:function(i,s){ae(i,t,s),t.innerHTML=I2},p:pe,d:function(i){i&&ne(t)}};return ee("SvelteRegisterBlock",{block:n,id:W2.name,type:"if",source:"(409:8) {#if pinnedTreeWindow?.pinnedTree.isFav}",ctx:e}),n}function O2(e){let t;const n={c:function(){t=L("div"),w(t,"class","svg-icon s-YWFeNV-ftNdK"),x(t,Ae,432,10,10386)},m:function(i,s){ae(i,t,s),t.innerHTML=E2},p:pe,d:function(i){i&&ne(t)}};return ee("SvelteRegisterBlock",{block:n,id:O2.name,type:"else",source:"(432:8) {:else}",ctx:e}),n}function G2(e){let t;const n={c:function(){t=L("div"),w(t,"class","svg-icon s-YWFeNV-ftNdK"),x(t,Ae,428,10,10285)},m:function(i,s){ae(i,t,s),t.innerHTML=R2},p:pe,d:function(i){i&&ne(t)}};return ee("SvelteRegisterBlock",{block:n,id:G2.name,type:"if",source:"(428:8) {#if pinnedTreeWindow?.pinnedTree.note === ''}",ctx:e}),n}function Fo(e){let t,n,r;const i={c:function(){t=L("textarea"),w(t,"class","note-window-input s-YWFeNV-ftNdK"),w(t,"name","note-input"),w(t,"placeholder","Leave a comment."),x(t,Ae,443,14,10725)},m:function(a,o){ae(a,t,o),_s(t,e[1].pinnedTree.note),n||(r=[he(t,"input",e[11],!1,!1,!1),he(t,"input",e[12])],n=!0)},p:function(a,o){o&2&&_s(t,a[1].pinnedTree.note)},d:function(a){a&&ne(t),n=!1,Re(r)}};return ee("SvelteRegisterBlock",{block:i,id:Fo.name,type:"if",source:"(443:12) {#if pinnedTreeWindow !== null}",ctx:e}),i}function Po(e){var de,xe;let t,n,r,i,s,a=((de=e[1])==null?void 0:de.pinnedTree.treeID)+"",o,c,l,u,f=((xe=e[1])==null?void 0:xe.pinnedTree.treeMetric)+"",h,p,g,d,m,v,S,b,_,k,H,I,M,V,E,F,R,A,C,T,D,P,G,Y,U,X,J,me,K,Q;function B(Le,Z){var ue;return(ue=Le[1])!=null&&ue.pinnedTree.isFav?W2:z2}let ie=B(e),fe=ie(e);function j(Le,Z){var ue;return((ue=Le[1])==null?void 0:ue.pinnedTree.note)===""?G2:O2}let $=j(e),oe=$(e),O=e[1]!==null&&Fo(e);const we={c:function(){var Z,ue,He,ke,nt,Pe;t=L("div"),n=L("div"),r=L("div"),i=L("span"),s=ce("Tree "),o=ce(a),c=W(),l=L("span"),u=ce("("),h=ce(f),p=ce(")"),d=W(),m=L("div"),v=L("div"),fe.c(),S=W(),b=L("div"),oe.c(),_=W(),k=L("div"),H=L("div"),O&&O.c(),I=W(),M=L("div"),V=L("div"),E=W(),F=L("div"),R=Dn("svg"),A=W(),C=L("div"),T=L("button"),D=L("label"),P=ce("Scaled by sample size"),Y=W(),U=L("div"),w(i,"class","tree-name s-YWFeNV-ftNdK"),x(i,Ae,392,6,9265),w(l,"class","tree-acc s-YWFeNV-ftNdK"),x(l,Ae,396,6,9362),w(r,"class","tree-info s-YWFeNV-ftNdK"),w(r,"title",g=`Tree ${(Z=e[1])==null?void 0:Z.pinnedTree.treeID} - Accuracy ${(ue=e[1])==null?void 0:ue.pinnedTree.treeMetric}`),x(r,Ae,388,4,9110),w(v,"class","control-fav s-YWFeNV-ftNdK"),w(v,"title","Add to my favorites"),x(v,Ae,402,6,9504),w(H,"class","input-wrapper s-YWFeNV-ftNdK"),x(H,Ae,438,10,10555),w(k,"class","note-window s-YWFeNV-ftNdK"),w(k,"title",""),ge(k,"show",!1),x(k,Ae,437,8,10491),w(b,"class","control-note s-YWFeNV-ftNdK"),w(b,"title","Leave a comment"),x(b,Ae,419,6,10018),w(V,"class","svg-icon s-YWFeNV-ftNdK"),x(V,Ae,461,8,11257),w(M,"class","control-close s-YWFeNV-ftNdK"),w(M,"title","Close the window"),x(M,Ae,455,6,11054),w(m,"class","control-buttons s-YWFeNV-ftNdK"),x(m,Ae,401,4,9468),w(n,"class","tree-header s-YWFeNV-ftNdK"),x(n,Ae,383,2,8952),w(R,"class","tree-svg s-YWFeNV-ftNdK"),x(R,Ae,472,4,11467),w(F,"class","content s-YWFeNV-ftNdK"),x(F,Ae,468,2,11365),w(D,"class","switch-label s-YWFeNV-ftNdK"),w(D,"for",G=`switch-${(He=e[1])==null?void 0:He.pinnedTree.treeID}`),x(D,Ae,482,6,11753),w(U,"class","switch-track s-YWFeNV-ftNdK"),w(U,"id",X=`switch-${(ke=e[1])==null?void 0:ke.pinnedTree.treeID}`),x(U,Ae,487,6,11903),w(T,"class","switch s-YWFeNV-ftNdK"),w(T,"aria-checked",J=e[2]?"true":"false"),w(T,"title","Toggle to visualize sample size as node width"),x(T,Ae,476,4,11537),w(C,"class","control-footer s-YWFeNV-ftNdK"),x(C,Ae,475,2,11504),w(t,"class","pinned-tree-window s-YWFeNV-ftNdK"),w(t,"style",me=(nt=e[1])==null?void 0:nt.getStyle()),ge(t,"hidden",(Pe=e[1])==null?void 0:Pe.hidden),ge(t,"jiggle",!1),x(t,Ae,376,0,8786)},l:function(Z){throw new Error("options.hydrate only works if the component was compiled with the `hydratable: true` option")},m:function(Z,ue){ae(Z,t,ue),y(t,n),y(n,r),y(r,i),y(i,s),y(i,o),y(r,c),y(r,l),y(l,u),y(l,h),y(l,p),y(n,d),y(n,m),y(m,v),fe.m(v,null),y(m,S),y(m,b),oe.m(b,null),y(b,_),y(b,k),y(k,H),O&&O.m(H,null),y(m,I),y(m,M),y(M,V),V.innerHTML=P2,y(t,E),y(t,F),y(F,R),y(t,A),y(t,C),y(C,T),y(T,D),y(D,P),y(T,Y),y(T,U),e[21](t),K||(Q=[he(v,"click",e[9],!1,!1,!1),he(v,"mousedown",e[10],!1,!1,!1),he(H,"click",e[13],!1,!1,!1),he(b,"click",e[14],!1,!1,!1),he(b,"mousedown",od,!1,!1,!1),he(M,"click",e[15],!1,!1,!1),he(M,"mousedown",e[16],!1,!1,!1),he(n,"mousedown",e[17],!1,!1,!1),he(n,"click",e[18],!1,!1,!1),he(F,"mousedown",e[19],!1,!1,!1),he(T,"click",e[20],!1,!1,!1)],K=!0)},p:function(Z,[ue]){var He,ke,nt,Pe,Kt,xt,Ue,$t;ue&2&&a!==(a=((He=Z[1])==null?void 0:He.pinnedTree.treeID)+"")&&Ee(o,a),ue&2&&f!==(f=((ke=Z[1])==null?void 0:ke.pinnedTree.treeMetric)+"")&&Ee(h,f),ue&2&&g!==(g=`Tree ${(nt=Z[1])==null?void 0:nt.pinnedTree.treeID} - Accuracy ${(Pe=Z[1])==null?void 0:Pe.pinnedTree.treeMetric}`)&&w(r,"title",g),ie===(ie=B(Z))&&fe?fe.p(Z,ue):(fe.d(1),fe=ie(Z),fe&&(fe.c(),fe.m(v,null))),$===($=j(Z))&&oe?oe.p(Z,ue):(oe.d(1),oe=$(Z),oe&&(oe.c(),oe.m(b,_))),Z[1]!==null?O?O.p(Z,ue):(O=Fo(Z),O.c(),O.m(H,null)):O&&(O.d(1),O=null),ue&2&&G!==(G=`switch-${(Kt=Z[1])==null?void 0:Kt.pinnedTree.treeID}`)&&w(D,"for",G),ue&2&&X!==(X=`switch-${(xt=Z[1])==null?void 0:xt.pinnedTree.treeID}`)&&w(U,"id",X),ue&4&&J!==(J=Z[2]?"true":"false")&&w(T,"aria-checked",J),ue&2&&me!==(me=(Ue=Z[1])==null?void 0:Ue.getStyle())&&w(t,"style",me),ue&2&&ge(t,"hidden",($t=Z[1])==null?void 0:$t.hidden)},i:pe,o:pe,d:function(Z){Z&&ne(t),fe.d(),oe.d(),O&&O.d(),e[21](null),K=!1,Re(Q)}};return ee("SvelteRegisterBlock",{block:we,id:Po.name,type:"component",source:"",ctx:e}),we}const od=e=>{e.stopPropagation()};function ld(e,t,n){let{$$slots:r={},$$scope:i}=t;St("PinnedTreeWindow",r,[]);let{pinnedTree:s=null}=t,{pinnedTreeStore:a=null}=t,{favoritesStore:o=null}=t,c=null,l=!1,u=null,f=!1,h=!1;localStorage.getItem("initSwitchChecked")==="true"&&(h=!0),Ne(()=>{n(7,l=!0)}),Ts(()=>{u==null||u.pinnedTreeStoreUnsubscriber(),u==null||u.favoritesStoreUnsubscriber()});const p=()=>{n(1,u)},g=()=>{n(8,f=!0),c&&s&&a&&o&&n(1,u=new bc({component:c,pinnedTree:s,pinnedTreeStore:a,favoritesStore:o,pinnedTreeWindowUpdated:p,initSwitchChecked:h}))},d=C=>{C.stopPropagation(),o==null||o.update(T=>T)},m=["pinnedTree","pinnedTreeStore","favoritesStore"];Object.keys(t).forEach(C=>{!~m.indexOf(C)&&C.slice(0,2)!=="$$"&&C!=="slot"&&console.warn(` was created with unknown prop '${C}'`)});const v=C=>u==null?void 0:u.heartClicked(C),S=C=>u==null?void 0:u.cancelEvent(C),b=C=>d(C);function _(){u.pinnedTree.note=this.value,n(1,u)}const k=C=>u==null?void 0:u.cancelEvent(C),H=C=>u==null?void 0:u.noteClicked(C),I=C=>u==null?void 0:u.closeClicked(C),M=C=>u==null?void 0:u.cancelEvent(C),V=C=>u==null?void 0:u.headerMousedownHandler(C),E=C=>u==null?void 0:u.cancelEvent(C),F=C=>u==null?void 0:u.contentMousedownHandler(C),R=C=>u==null?void 0:u.switchToggled(C);function A(C){Je[C?"unshift":"push"](()=>{c=C,n(0,c)})}return e.$$set=C=>{"pinnedTree"in C&&n(4,s=C.pinnedTree),"pinnedTreeStore"in C&&n(5,a=C.pinnedTreeStore),"favoritesStore"in C&&n(6,o=C.favoritesStore)},e.$capture_state=()=>({onMount:Ne,onDestroy:Ts,PinnedTreeWindow:bc,iconCloseCircle:P2,iconHeartCircle:Ma,iconNoteCircle:R2,iconHeartCircleClicked:I2,iconNoteCircleClicked:E2,pinnedTree:s,pinnedTreeStore:a,favoritesStore:o,component:c,mounted:l,pinnedTreeWindow:u,initialized:f,initSwitchChecked:h,pinnedTreeWindowUpdated:p,initView:g,noteChanged:d}),e.$inject_state=C=>{"pinnedTree"in C&&n(4,s=C.pinnedTree),"pinnedTreeStore"in C&&n(5,a=C.pinnedTreeStore),"favoritesStore"in C&&n(6,o=C.favoritesStore),"component"in C&&n(0,c=C.component),"mounted"in C&&n(7,l=C.mounted),"pinnedTreeWindow"in C&&n(1,u=C.pinnedTreeWindow),"initialized"in C&&n(8,f=C.initialized),"initSwitchChecked"in C&&n(2,h=C.initSwitchChecked)},t&&"$$inject"in t&&e.$inject_state(t.$$inject),e.$$.update=()=>{e.$$.dirty&497&&s&&l&&c&&a&&o&&!f&&g()},[c,u,h,d,s,a,o,l,f,v,S,b,_,k,H,I,M,V,E,F,R,A]}class Y2 extends _t{constructor(t){super(t),Ct(this,t,ld,Po,tt,{pinnedTree:4,pinnedTreeStore:5,favoritesStore:6}),ee("SvelteRegisterComponent",{component:this,tagName:"PinnedTreeWindow_1",options:t,id:Po.name})}get pinnedTree(){throw new Error(": Props cannot be read directly from the component instance unless compiling with 'accessors: true' or ''")}set pinnedTree(t){throw new Error(": Props cannot be set directly on the component instance unless compiling with 'accessors: true' or ''")}get pinnedTreeStore(){throw new Error(": Props cannot be read directly from the component instance unless compiling with 'accessors: true' or ''")}set pinnedTreeStore(t){throw new Error(": Props cannot be set directly on the component instance unless compiling with 'accessors: true' or ''")}get favoritesStore(){throw new Error(": Props cannot be read directly from the component instance unless compiling with 'accessors: true' or ''")}set favoritesStore(t){throw new Error(": Props cannot be set directly on the component instance unless compiling with 'accessors: true' or ''")}}var aa,B2;class Cc{constructor({favTree:t,component:n,textAreaNode:r,favoritesStore:i,pinnedTreeStore:s}){ye(this,aa);N(this,"favTree");N(this,"textAreaNode");N(this,"favoritesStore");N(this,"favoritesStoreValue");N(this,"favoritesStoreUnsubscriber");N(this,"pinnedTreeStore");N(this,"pinnedTreeStoreValue");N(this,"PinnedTreeStoreValueUnsubscriber");N(this,"svg");N(this,"padding");N(this,"width");N(this,"height");N(this,"adjustTextAreaHeight",async()=>{await ml(),this.textAreaNode.style.removeProperty("height"),this.textAreaNode.style.height=`${this.textAreaNode.scrollHeight}px`});N(this,"noteChanged",t=>{t.stopPropagation(),this.favTree.pinnedTreeUpdated(),this.adjustTextAreaHeight()});N(this,"deleteClicked",t=>{t.preventDefault(),t.stopPropagation();let n=-1;for(let a=0;aa.pinnedTree.treeID)].indexOf(this.favTree.pinnedTree.treeID);s>-1&&this.favoritesStoreValue.favTrees.splice(s,1),this.favoritesStore.set(this.favoritesStoreValue)});N(this,"thumbnailClicked",t=>{t.preventDefault(),t.stopPropagation();for(let n=0;n{this.favoritesStoreValue=c,this.favoritesStoreValue.shown&&this.adjustTextAreaHeight()}),this.pinnedTreeStore=s,this.pinnedTreeStoreValue=Hr(),this.PinnedTreeStoreValueUnsubscriber=this.pinnedTreeStore.subscribe(c=>{this.pinnedTreeStoreValue=c});const a=70,o=70;this.svg=z.select(n).select("svg.tree-svg").attr("width",a).attr("height",o).attr("viewbox",`0 0 ${a} ${o}`).attr("preserveAspectRatio","none"),this.padding={top:10,bottom:10,left:0,right:0},this.width=a-this.padding.left-this.padding.right,this.height=o-this.padding.top-this.padding.bottom,se(this,aa,B2).call(this)}}aa=new WeakSet,B2=function(){const t=this.svg.append("g").attr("class","content").attr("transform",`translate(${this.padding.left}, ${this.padding.top})`),n=z.hierarchy(this.favTree.pinnedTree.tree,u=>u.c),r=4,i=4,s=z.tree().size([this.width,this.height])(n);t.append("g").attr("class","link-group").selectAll("path.link").data(s.links()).join("path").attr("class",u=>`link link-${u.source.data.f[0]}`).attr("id",u=>{const f=u.source.ancestors().length>1?u.source.ancestors()[1].data.f[0]:"r",h=u.source.data.f[0],p=u.target.data.f[0];return u.target.data.f[0]==="+"?`link-${f}-${h}-p`:u.target.data.f[0]==="-"?`link-${f}-${h}-n`:`link-${f}-${h}-${p}`}).attr("d",u=>z.line()([[u.source.x,u.source.y],[u.target.x,u.target.y]]));const c=t.append("g").attr("class","node-group").selectAll("g").data(s.descendants()).join("g").attr("class","node").attr("transform",u=>`translate(${u.x}, ${u.y})`),l=new Set(["-","+"]);c.filter(u=>!l.has(u.data.f[0])).append("circle").attr("r",r).style("fill",u=>this.favTree.getFeatureColor(u.data.f[0])),c.filter(u=>l.has(u.data.f[0])).append("rect").attr("x",-i).attr("y",-i).attr("rx",1).attr("ry",1).attr("width",2*i).attr("height",2*i),c.filter(u=>l.has(u.data.f[0])).append("text").attr("dy",.5).text(u=>u.data.f[0])};const U2='';const At="src/components/favorites-panel/FavoritesRow.svelte";function Ro(e){let t,n,r;const i={c:function(){t=L("textarea"),w(t,"class","note-window-input s-Su409VPrjAJA"),w(t,"name","note-input"),w(t,"placeholder","Leave a comment."),x(t,At,178,8,4177)},m:function(a,o){ae(a,t,o),e[10](t),_s(t,e[0].pinnedTree.note),n||(r=[he(t,"input",e[11],!1,!1,!1),he(t,"input",e[12])],n=!0)},p:function(a,o){o&1&&_s(t,a[0].pinnedTree.note)},d:function(a){a&&ne(t),e[10](null),n=!1,Re(r)}};return ee("SvelteRegisterBlock",{block:i,id:Ro.name,type:"if",source:"(178:6) {#if favTree !== null}",ctx:e}),i}function Io(e){var F,R;let t,n,r,i,s,a,o,c,l,u=((F=e[3])==null?void 0:F.favTree.pinnedTree.treeID)+"",f,h,p,g,d=((R=e[3])==null?void 0:R.favTree.pinnedTree.treeMetric)+"",m,v,S,b,_,k,H,I,M,V=e[0]!==null&&Ro(e);const E={c:function(){t=L("div"),n=L("div"),r=Dn("svg"),i=W(),s=L("div"),a=L("div"),o=L("div"),c=L("span"),l=ce("Tree "),f=ce(u),h=W(),p=L("span"),g=ce("("),m=ce(d),v=ce(")"),S=W(),b=L("div"),_=L("div"),k=W(),H=L("div"),V&&V.c(),w(r,"class","tree-svg s-Su409VPrjAJA"),x(r,At,155,4,3529),w(n,"class","tree-left s-Su409VPrjAJA"),x(n,At,154,2,3501),w(c,"class","tree-name s-Su409VPrjAJA"),x(c,At,161,8,3711),w(p,"class","tree-metric s-Su409VPrjAJA"),x(p,At,164,8,3816),w(o,"class","tree-info-left s-Su409VPrjAJA"),x(o,At,160,6,3674),w(_,"class","svg-icon s-Su409VPrjAJA"),x(_,At,170,8,3974),w(b,"class","tree-info-right s-Su409VPrjAJA"),x(b,At,169,6,3936),w(a,"class","tree-info s-Su409VPrjAJA"),x(a,At,159,4,3644),w(H,"class","tree-note s-Su409VPrjAJA"),x(H,At,176,4,4116),w(s,"class","tree-right s-Su409VPrjAJA"),x(s,At,158,2,3615),w(t,"class","tree s-Su409VPrjAJA"),x(t,At,153,0,3458)},l:function(C){throw new Error("options.hydrate only works if the component was compiled with the `hydratable: true` option")},m:function(C,T){ae(C,t,T),y(t,n),y(n,r),y(t,i),y(t,s),y(s,a),y(a,o),y(o,c),y(c,l),y(c,f),y(o,h),y(o,p),y(p,g),y(p,m),y(p,v),y(a,S),y(a,b),y(b,_),_.innerHTML=U2,y(s,k),y(s,H),V&&V.m(H,null),e[13](t),I||(M=[he(r,"click",e[8],!1,!1,!1),he(_,"click",e[9],!1,!1,!1)],I=!0)},p:function(C,[T]){var D,P;T&8&&u!==(u=((D=C[3])==null?void 0:D.favTree.pinnedTree.treeID)+"")&&Ee(f,u),T&8&&d!==(d=((P=C[3])==null?void 0:P.favTree.pinnedTree.treeMetric)+"")&&Ee(m,d),C[0]!==null?V?V.p(C,T):(V=Ro(C),V.c(),V.m(H,null)):V&&(V.d(1),V=null)},i:pe,o:pe,d:function(C){C&&ne(t),V&&V.d(),e[13](null),I=!1,Re(M)}};return ee("SvelteRegisterBlock",{block:E,id:Io.name,type:"component",source:"",ctx:e}),E}function cd(e,t,n){let{$$slots:r={},$$scope:i}=t;St("FavoritesRow",r,[]);let{favTree:s=null}=t,{favoritesStore:a=null}=t,{pinnedTreeStore:o=null}=t,c=null,l=null,u=!1,f=!1,h=null;Ne(()=>{n(6,u=!0)}),Ts(()=>{h==null||h.favoritesStoreUnsubscriber(),h==null||h.PinnedTreeStoreValueUnsubscriber()});const p=()=>{s&&l&&c&&a&&o&&n(3,h=new Cc({favTree:s,component:c,textAreaNode:l,favoritesStore:a,pinnedTreeStore:o})),n(7,f=!0)},g=["favTree","favoritesStore","pinnedTreeStore"];Object.keys(t).forEach(k=>{!~g.indexOf(k)&&k.slice(0,2)!=="$$"&&k!=="slot"&&console.warn(` was created with unknown prop '${k}'`)});const d=k=>h==null?void 0:h.thumbnailClicked(k),m=k=>h==null?void 0:h.deleteClicked(k);function v(k){Je[k?"unshift":"push"](()=>{l=k,n(2,l)})}const S=k=>h.noteChanged(k);function b(){s.pinnedTree.note=this.value,n(0,s)}function _(k){Je[k?"unshift":"push"](()=>{c=k,n(1,c)})}return e.$$set=k=>{"favTree"in k&&n(0,s=k.favTree),"favoritesStore"in k&&n(4,a=k.favoritesStore),"pinnedTreeStore"in k&&n(5,o=k.pinnedTreeStore)},e.$capture_state=()=>({FavoritesRow:Cc,onMount:Ne,onDestroy:Ts,deleteIcon:U2,favTree:s,favoritesStore:a,pinnedTreeStore:o,component:c,textAreaNode:l,mounted:u,initialized:f,favoriteRow:h,initView:p}),e.$inject_state=k=>{"favTree"in k&&n(0,s=k.favTree),"favoritesStore"in k&&n(4,a=k.favoritesStore),"pinnedTreeStore"in k&&n(5,o=k.pinnedTreeStore),"component"in k&&n(1,c=k.component),"textAreaNode"in k&&n(2,l=k.textAreaNode),"mounted"in k&&n(6,u=k.mounted),"initialized"in k&&n(7,f=k.initialized),"favoriteRow"in k&&n(3,h=k.favoriteRow)},t&&"$$inject"in t&&e.$inject_state(t.$$inject),e.$$.update=()=>{e.$$.dirty&247&&s&&l&&c&&a&&o&&u&&!f&&p()},[s,c,l,h,a,o,u,f,d,m,v,S,b,_]}class Z2 extends _t{constructor(t){super(t),Ct(this,t,cd,Io,tt,{favTree:0,favoritesStore:4,pinnedTreeStore:5}),ee("SvelteRegisterComponent",{component:this,tagName:"FavoritesRow_1",options:t,id:Io.name})}get favTree(){throw new Error(": Props cannot be read directly from the component instance unless compiling with 'accessors: true' or ''")}set favTree(t){throw new Error(": Props cannot be set directly on the component instance unless compiling with 'accessors: true' or ''")}get favoritesStore(){throw new Error(": Props cannot be read directly from the component instance unless compiling with 'accessors: true' or ''")}set favoritesStore(t){throw new Error(": Props cannot be set directly on the component instance unless compiling with 'accessors: true' or ''")}get pinnedTreeStore(){throw new Error(": Props cannot be read directly from the component instance unless compiling with 'accessors: true' or ''")}set pinnedTreeStore(t){throw new Error(": Props cannot be set directly on the component instance unless compiling with 'accessors: true' or ''")}}const Sc=(e,t)=>{e.stopPropagation(),e.preventDefault();const n=JSON.parse(JSON.stringify(t.favTrees)),r=[];n.forEach(i=>{delete i.getFeatureColor,delete i.pinnedTreeUpdated,delete i.pinnedTree.isPinned,delete i.pinnedTree.isFav,delete i.pinnedTree.jiggle,delete i.pinnedTree.x,delete i.pinnedTree.y,delete i.pinnedTree.startPos,r.push(i.pinnedTree)}),A7(r,null,"favorite-trees.json")};function j2(e,{from:t,to:n},r={}){const i=getComputedStyle(e),s=i.transform==="none"?"":i.transform,[a,o]=i.transformOrigin.split(" ").map(parseFloat),c=t.left+t.width*a/n.width-(n.left+a),l=t.top+t.height*o/n.height-(n.top+o),{delay:u=0,duration:f=p=>Math.sqrt(p)*120,easing:h=jc}=r;return{delay:u,duration:Yr(f)?f(Math.sqrt(c*c+l*l)):f,easing:h,css:(p,g)=>{const d=g*c,m=g*l,v=p+g*t.width/n.width,S=p+g*t.height/n.height;return`transform: ${s} translate(${d}px, ${m}px) scale(${v}, ${S});`}}}const Aa='',X2='';const Vt="src/components/favorites-panel/FavoritesPanel.svelte";function ss(e,t,n){const r=e.slice();return r[11]=t[n],r}function Eo(e){let t,n,r,i;const s=[J2,q2],a=[];function o(l,u){return l[5].favTrees.length===0?0:1}t=o(e),n=a[t]=s[t](e);const c={c:function(){n.c(),r=Ss()},m:function(u,f){a[t].m(u,f),ae(u,r,f),i=!0},p:function(u,f){let h=t;t=o(u),t===h?a[t].p(u,f):(Nn(),Me(a[h],1,1,()=>{a[h]=null}),Hn(),n=a[t],n?n.p(u,f):(n=a[t]=s[t](u),n.c()),_e(n,1),n.m(r.parentNode,r))},i:function(u){i||(_e(n),i=!0)},o:function(u){Me(n),i=!1},d:function(u){a[t].d(u),u&&ne(r)}};return ee("SvelteRegisterBlock",{block:c,id:Eo.name,type:"if",source:"(180:2) {#if initialized}",ctx:e}),c}function q2(e){let t,n=[],r=new Map,i,s=e[5].favTrees;De(s);const a=c=>c[11].pinnedTree.treeID;As(e,s,ss,a);for(let c=0;c{d=null}),Hn()),(!h||b&4&&f!==(f=`max-height: ${S[2]}px;`))&&w(t,"style",f),(!h||b&32)&&ge(t,"shown",S[5].shown)},i:function(S){h||(_e(d),h=!0)},o:function(S){Me(d),h=!1},d:function(S){S&&ne(t),d&&d.d(),e[9](null),p=!1,Re(g)}};return ee("SvelteRegisterBlock",{block:m,id:Wo.name,type:"component",source:"",ctx:e}),m}function ud(e,t,n){let{$$slots:r={},$$scope:i}=t;St("FavoritesPanel",r,[]);let{favoritesStore:s=null}=t,{pinnedTreeStore:a=null}=t,{width:o=650}=t,c=null,l=!1,u=!1,f=Dr();Ne(()=>{n(7,l=!0)});const h=()=>{s&&a&&s.subscribe(v=>{n(5,f=v)}),n(3,u=!0)},p=v=>{v.stopPropagation(),v.preventDefault(),n(5,f.shown=!1,f),s==null||s.set(f)},g=["favoritesStore","pinnedTreeStore","width"];Object.keys(t).forEach(v=>{!~g.indexOf(v)&&v.slice(0,2)!=="$$"&&v!=="slot"&&console.warn(` was created with unknown prop '${v}'`)});const d=v=>Sc(v,f);function m(v){Je[v?"unshift":"push"](()=>{c=v,n(4,c)})}return e.$$set=v=>{"favoritesStore"in v&&n(0,s=v.favoritesStore),"pinnedTreeStore"in v&&n(1,a=v.pinnedTreeStore),"width"in v&&n(2,o=v.width)},e.$capture_state=()=>({FavoritesRow:Z2,downloadClicked:Sc,getFavoritesStoreDefaultValue:Dr,onMount:Ne,flip:j2,fade:Ii,closeIcon:Aa,downloadIcon:X2,heartDemoIcon:Ma,favoritesStore:s,pinnedTreeStore:a,width:o,component:c,mounted:l,initialized:u,favoritesStoreValue:f,initView:h,closeClicked:p}),e.$inject_state=v=>{"favoritesStore"in v&&n(0,s=v.favoritesStore),"pinnedTreeStore"in v&&n(1,a=v.pinnedTreeStore),"width"in v&&n(2,o=v.width),"component"in v&&n(4,c=v.component),"mounted"in v&&n(7,l=v.mounted),"initialized"in v&&n(3,u=v.initialized),"favoritesStoreValue"in v&&n(5,f=v.favoritesStoreValue)},t&&"$$inject"in t&&e.$inject_state(t.$$inject),e.$$.update=()=>{e.$$.dirty&139&&s&&a&&l&&!u&&h()},[s,a,o,u,c,f,p,l,d,m]}class Q2 extends _t{constructor(t){super(t),Ct(this,t,ud,Wo,tt,{favoritesStore:0,pinnedTreeStore:1,width:2}),ee("SvelteRegisterComponent",{component:this,tagName:"FavoritesPanel",options:t,id:Wo.name})}get favoritesStore(){throw new Error(": Props cannot be read directly from the component instance unless compiling with 'accessors: true' or ''")}set favoritesStore(t){throw new Error(": Props cannot be set directly on the component instance unless compiling with 'accessors: true' or ''")}get pinnedTreeStore(){throw new Error(": Props cannot be read directly from the component instance unless compiling with 'accessors: true' or ''")}set pinnedTreeStore(t){throw new Error(": Props cannot be set directly on the component instance unless compiling with 'accessors: true' or ''")}get width(){throw new Error(": Props cannot be read directly from the component instance unless compiling with 'accessors: true' or ''")}set width(t){throw new Error(": Props cannot be set directly on the component instance unless compiling with 'accessors: true' or ''")}}const as=z.format(",.3~f"),vt=45,os="slider-left-thumb",ls="slider-right-thumb",li=268,ci=16,Ye=8,pr={default:6,original:6*1.8};var oa,K2,la,$2,ca,e0,Tn,mr,Hi,Oo,Tr,bs,Mr,Cs,ua,t0,ha,n0,Mn,yr,Fi,Go,fa,r0,da,i0,pa,s0,ga,a0,ma,o0,ya,l0,wa,c0,va,u0,Pi,Yo;class _c{constructor(t,n,r,i){ye(this,oa);ye(this,la);ye(this,ca);ye(this,Tn);ye(this,Hi);ye(this,Tr);ye(this,Mr);ye(this,ua);ye(this,ha);ye(this,Mn);ye(this,Fi);ye(this,fa);ye(this,da);ye(this,pa);ye(this,ga);ye(this,ma);ye(this,ya);ye(this,wa);ye(this,va);ye(this,Pi);N(this,"component");N(this,"accuracyRow");N(this,"accuracySVG",null);N(this,"minSampleRow");N(this,"minSampleSVG",null);N(this,"heightRow");N(this,"heightSVG",null);N(this,"data");N(this,"treeMapMap");N(this,"accuracyDensities");N(this,"heightDensities");N(this,"minSampleDensities");N(this,"accuracyXScale");N(this,"accuracyYScale");N(this,"densityClip");N(this,"minSampleXScale");N(this,"minSampleYScale");N(this,"minSampleDensityClip");N(this,"heightXScale");N(this,"heightYScale");N(this,"searchStore");N(this,"searchStoreValue");N(this,"curAccuracyLow");N(this,"curAccuracyHigh");N(this,"accuracyLow");N(this,"accuracyHigh");N(this,"curMinSampleLow");N(this,"curMinSampleHigh");N(this,"minSampleLow");N(this,"minSampleHigh");N(this,"searchUpdated");N(this,"refreshAccuracy",()=>{se(this,Tn,mr).call(this,"slider-left-thumb",this.accuracyLow),se(this,Tn,mr).call(this,"slider-right-thumb",this.accuracyHigh)});N(this,"refreshMinSample",()=>{se(this,Mn,yr).call(this,"slider-left-thumb",this.minSampleLow),se(this,Mn,yr).call(this,"slider-right-thumb",this.minSampleHigh)});N(this,"refreshHeight",()=>{var t;for(const n of this.heightXScale.domain()){const r=z.select(this.component).select(`#height-checkbox-${n}`);r.property("checked")||((t=this.heightSVG)==null||t.select(`#bar-${n}`).classed("selected",!0),r.property("checked",!0),this.searchStoreValue.curHeightRange.add(n))}this.searchStore.set(this.searchStoreValue)});N(this,"refreshDepth",t=>{const n=z.select(this.component).select(`#level-row-${t} .level-content`),r=this.searchStoreValue.curDepthFeatures.get(t);if(r===void 0){console.warn(`Unknown depth ${t}`);return}for(const i of this.searchStoreValue.featureOrder){const s=n.select(`#depth-check-box-label-${t}-${i}`);s.property("checked")||(s.property("checked",!0),r.add(i))}this.searchStoreValue.curDepthFeatures.set(t,r),this.searchStore.set(this.searchStoreValue)});N(this,"refreshAllFeatures",()=>{const t=z.select(this.component).select("#level-row-0 .level-content"),n=this.searchStoreValue.curAllFeatures;for(const r of this.searchStoreValue.featureOrder){const i=t.select(`#depth-check-box-label-0-${r}`);i.property("checked")||(i.property("checked",!0),n.add(r))}this.searchStoreValue.curAllFeatures=n,this.searchStore.set(this.searchStoreValue)});N(this,"updatePlots",(t,n=!1)=>{var k,H,I;const r=[],i=[],s=new Map;if(this.searchStoreValue.treeHeightMap)for(const[M,V]of this.searchStoreValue.treeHeightMap)s.set(M,0);let a=1;this.searchStoreValue.treeHeightMap&&(a=this.searchStoreValue.treeHeightMap.size);const o=z.transition("updatePlot").duration(500);for(const M in this.data.treeMap){const V=parseInt(M);if(t.allFeature.has(V)&&t.depth.has(V)&&t.height.has(V)&&t.minSample.has(V)&&r.push(this.data.treeMap[M][2]),t.allFeature.has(V)&&t.depth.has(V)&&t.height.has(V)&&t.accuracy.has(V)&&this.searchStoreValue.treeMinSampleMap!==null&&i.push(this.searchStoreValue.treeMinSampleMap.get(V)),t.allFeature.has(V)&&t.depth.has(V)&&t.minSample.has(V)&&t.accuracy.has(V)&&this.searchStoreValue.treeHeightMap!==null){const E=this.searchStoreValue.treeHeightMap.get(V),F=s.get(E);s.set(E,F+1)}}const c=50,l=z.bin().thresholds(c),u=l(r),f=[];if(u.forEach(M=>{f.push({x:M.x0===void 0?0:M.x0,y:M.length/a})}),f.length>2){const M=f[1].x-f[0].x;f.unshift({x:f[0].x-M,y:0}),f.push({x:f.slice(-1)[0].x+M,y:0})}const h=[];if(l(i).forEach(M=>{h.push({x:M.x0===void 0?0:M.x0,y:M.length/a})}),h.length>2){const M=h[1].x-h[0].x;h.unshift({x:Math.max(0,h[0].x-M),y:0}),h.push({x:h.slice(-1)[0].x+M,y:0})}const g=[];s.forEach((M,V)=>{g.push({x:V,y:M/a})}),g.sort((M,V)=>M.x-V.x);const d=(k=this.accuracySVG)==null?void 0:k.select("g.hist-group"),m=z.line().curve(z.curveBasis).x(M=>this.accuracyXScale(M.x)).y(M=>this.accuracyYScale(M.y));n?(d==null||d.select("path.area-path").datum(f).transition(o).attr("d",m),d==null||d.select("path.area-path.selected").datum(f).transition(o).attr("d",m)):(d==null||d.select("path.area-path").datum(f).attr("d",m),d==null||d.select("path.area-path.selected").datum(f).attr("d",m));const v=(H=this.minSampleSVG)==null?void 0:H.select("g.hist-group"),S=z.line().curve(z.curveBasis).x(M=>this.minSampleXScale(M.x)).y(M=>this.minSampleYScale(M.y));n?(v==null||v.select("path.area-path").datum(h).transition(o).attr("d",S),v==null||v.select("path.area-path.selected").datum(h).transition(o).attr("d",S)):(v==null||v.select("path.area-path").datum(h).attr("d",S),v==null||v.select("path.area-path.selected").datum(h).attr("d",S));const b=(I=this.heightSVG)==null?void 0:I.select("g.hist-group"),_=b==null?void 0:b.selectAll("g.bar").data(g);n?(_==null||_.select("rect").transition(o).attr("y",M=>this.heightYScale(M.y)).attr("height",M=>this.heightYScale(0)-this.heightYScale(M.y)),_==null||_.select("text").transition(o).attr("y",M=>this.heightYScale(M.y)-5)):(_==null||_.select("rect").attr("y",M=>this.heightYScale(M.y)).attr("height",M=>this.heightYScale(0)-this.heightYScale(M.y)),_==null||_.select("text").attr("y",M=>this.heightYScale(M.y)-5)),_==null||_.select("tspan").text(M=>`(${z.format(".0%")(M.y)})`),_==null||_.select("title").text(M=>`Height: ${M.x} (${z.format(".4%")(M.y)})`)});this.component=t,this.searchUpdated=r,this.searchStore=i,this.searchStoreValue=Nr(),this.searchStore.subscribe(a=>{this.searchStoreValue=a,this.searchUpdated()}),this.accuracyRow=z.select(t).select(".accuracy-row"),this.minSampleRow=z.select(t).select(".min-sample-row"),this.heightRow=z.select(t).select(".height-row"),this.curAccuracyLow=0,this.curAccuracyHigh=1,this.accuracyLow=0,this.accuracyHigh=1,this.curMinSampleLow=0,this.curMinSampleHigh=1,this.minSampleLow=0,this.minSampleHigh=1,this.data=n,this.treeMapMap=new Map,Object.keys(n.treeMap).forEach(a=>{this.treeMapMap.set(+a,n.treeMap[+a])});const s=se(this,oa,K2).call(this);this.accuracyDensities=s.accuracyDensities,this.heightDensities=s.heightDensities,this.minSampleDensities=s.minSampleDensities,this.accuracyXScale=z.scaleLinear(),this.accuracyYScale=z.scaleLinear(),this.densityClip=null,this.accuracySVG=se(this,la,$2).call(this),se(this,ca,e0).call(this),this.minSampleXScale=z.scaleLinear(),this.minSampleYScale=z.scaleLinear(),this.minSampleDensityClip=null,this.minSampleSVG=se(this,ua,t0).call(this),se(this,ha,n0).call(this),this.heightXScale=z.scaleBand(),this.heightYScale=z.scaleLinear(),this.heightSVG=se(this,pa,s0).call(this),se(this,ga,a0).call(this),se(this,ya,l0).call(this),this.searchStoreValue.updatePlots=(a,o)=>{this.updatePlots(a,o)},this.searchStore.set(this.searchStoreValue)}}oa=new WeakSet,K2=function(){const t=[];for(const b in this.data.treeMap)t.push(this.data.treeMap[b][2]);const n=t.length,r=50,s=z.bin().thresholds(r)(t),a=[];s.forEach(b=>{a.push({x:b.x0===void 0?0:b.x0,y:b.length/n})});const o=a[1].x-a[0].x;a.unshift({x:a[0].x-o,y:0}),a.push({x:a.slice(-1)[0].x+o,y:0}),this.curAccuracyLow=a[0].x,this.curAccuracyHigh=a.slice(-1)[0].x,this.accuracyLow=this.curAccuracyLow,this.accuracyHigh=this.curAccuracyHigh;const c=new Map;z.hierarchy(this.data.trie,b=>b.c).eachBefore(b=>{if(b.data.t!==void 0){const _=b.data.t;c.has(_)?c.set(_,Math.max(c.get(_),b.depth)):c.set(_,b.depth)}});const u=new Map,f=new Map,h=[];for(const[b,_]of this.treeMapMap){const k=new Map,H=z.hierarchy(_[0],M=>M.c);let I=1/0;H.each(M=>{M.data.f[0]!=="+"&&M.data.f[0]!=="-"?k.has(M.depth+1)?k.get(M.depth+1).add(parseInt(M.data.f[0])):k.set(M.depth+1,new Set([parseInt(M.data.f[0])])):I=Math.min(I,M.data.f[1])}),u.set(b,k),f.set(b,I),h.push(I)}const p=new Map;Array.from(c.values()).forEach(b=>{p.has(b)?p.set(b,p.get(b)+1):p.set(b,1)});const g=[];p.forEach((b,_)=>{g.push({x:_,y:b/n})}),g.sort((b,_)=>b.x-_.x);const d=50,m=z.bin().thresholds(d)(h),v=[];m.forEach(b=>{v.push({x:b.x0===void 0?0:b.x0,y:b.length/n})});const S=v[1].x-v[0].x;return v.unshift({x:Math.max(0,v[0].x-S),y:0}),v.push({x:v.slice(-1)[0].x+S,y:0}),this.curMinSampleLow=v[0].x,this.curMinSampleHigh=v.slice(-1)[0].x,this.minSampleLow=this.curMinSampleLow,this.minSampleHigh=this.curMinSampleHigh,this.searchStoreValue.treeHeightMap=c,this.searchStoreValue.treeMinSampleMap=f,this.searchStoreValue.treeDepthFeaturesMap=u,this.searchStore.set(this.searchStoreValue),{accuracyDensities:a,heightDensities:g,minSampleDensities:v}},la=new WeakSet,$2=function(){const t=li-ci*2,n=30,r=15,i=vt+r+n,s=this.accuracyRow.select(".svg-accuracy").attr("width",t).attr("height",i),a={top:0,left:Ye,right:Ye,bottom:0,histTop:2},o=t-a.left-a.right;s.append("g").attr("class","border-group").attr("transform",`translate(${0}, ${a.top})`).append("rect").attr("width",t).attr("height",vt-a.top).style("fill","none").style("stroke",Te.colors["gray-300"]);const c=s.append("g").attr("class","hist-group").attr("transform",`translate(${Ye}, ${a.top})`);this.accuracyXScale=z.scaleLinear().domain([this.accuracyDensities[0].x,this.accuracyDensities.slice(-1)[0].x]).range([0,o]);const l=Math.max(...this.accuracyDensities.map(k=>k.y));this.accuracyYScale=z.scaleLinear().domain([0,l]).range([vt-a.bottom-a.top,a.histTop]);const u=z.line().curve(z.curveBasis).x(k=>this.accuracyXScale(k.x)).y(k=>this.accuracyYScale(k.y)),h=c.append("path").attr("class","area-path").datum(this.accuracyDensities).attr("d",u).clone(!0).classed("selected",!0);this.densityClip=c.append("clipPath").attr("id","accuracy-density-clip").append("rect").style("fill","hsla(100, 50%, 50%, 0.1)").attr("x",this.accuracyXScale(this.curAccuracyLow)).attr("width",this.accuracyXScale(this.curAccuracyHigh)-this.accuracyXScale(this.curAccuracyLow)).attr("height",vt),h.attr("clip-path","url(#accuracy-density-clip)");const p=s.append("g").attr("class","tick-group").attr("transform",`translate(${Ye}, ${vt+r})`),g=p.append("g").attr("class","tick-back-group"),d=p.append("g").attr("class","tick-top-group"),m=30,v=[],S=this.accuracyDensities[1].x-this.accuracyDensities[0].x,b=this.accuracyLow+S,_=this.accuracyHigh;for(let k=0;k<=m;k++)v.push(b+(_-b)*k/m);return d.selectAll("g.tick").data(v).join("g").attr("class","tick").attr("transform",k=>`translate(${this.accuracyXScale(k)}, 0)`).append("line").attr("y2",pr.default),se(this,Mr,Cs).call(this),g.append("text").attr("class","label-min-value").attr("x",-4).attr("y",pr.default*2.2).style("text-anchor","start").style("dominant-baseline","hanging").style("font-size","0.9em").style("fill",Te.colors["gray-500"]).text(as(this.accuracyLow)),g.append("text").attr("class","label-max-value").attr("x",o+4).attr("y",pr.default*2.2).style("text-anchor","end").style("dominant-baseline","hanging").style("font-size","0.9em").style("fill",Te.colors["gray-500"]).text(as(this.accuracyHigh)),s},ca=new WeakSet,e0=function(){se(this,Tn,mr).call(this,os,this.curAccuracyLow),se(this,Tn,mr).call(this,ls,this.curAccuracyHigh),this.accuracyRow.select(`#${os}`).on("mousedown",t=>se(this,Hi,Oo).call(this,t)),this.accuracyRow.select(`#${ls}`).on("mousedown",t=>se(this,Hi,Oo).call(this,t)),se(this,Tr,bs).call(this)},Tn=new WeakSet,mr=function(t,n){switch(n=Math.min(Math.max(n,this.accuracyLow),this.accuracyHigh),t){case"slider-left-thumb":n=Math.min(this.curAccuracyHigh,n);break;case"slider-right-thumb":n=Math.max(this.curAccuracyLow,n);break;default:console.warn("Unknown thumb type in moveThumb()");break}const r=this.accuracyRow.select(`#${t}`).attr("data-curValue",n),i=li-2*ci-2*Ye;let s=(n-this.accuracyLow)/(this.accuracyHigh-this.accuracyLow)*i;switch(t){case"slider-left-thumb":s-=Ye,this.curAccuracyLow=n,this.searchStoreValue.curAccuracyLow=this.curAccuracyLow;break;case"slider-right-thumb":this.curAccuracyHigh=n,this.searchStoreValue.curAccuracyHigh=this.curAccuracyHigh;break;default:console.warn("Unknown thumb type in moveThumb()");break}this.searchStore.set(this.searchStoreValue),r.style("left",`${s}px`),se(this,Tr,bs).call(this),se(this,Mr,Cs).call(this),this.searchUpdated()},Hi=new WeakSet,Oo=function(t){t.preventDefault(),t.stopPropagation();const n=t.target;if(n===null||!n.id.includes("thumb"))return;const r=n.parentNode,i=r.getBoundingClientRect().width;n.focus();const s=o=>{o.preventDefault(),o.stopPropagation();const c=o.pageX-r.getBoundingClientRect().x,l=this.accuracyLow+(this.accuracyHigh-this.accuracyLow)*c/i;se(this,Tn,mr).call(this,n.id,l)},a=()=>{document.removeEventListener("mousemove",s),document.removeEventListener("mouseup",a),document.body.style.cursor="default",n.blur()};document.addEventListener("mousemove",s),document.addEventListener("mouseup",a),document.body.style.cursor="grabbing"},Tr=new WeakSet,bs=function(){const t=this.accuracyRow.select("#slider-left-thumb"),n=this.accuracyRow.select("#slider-right-thumb"),r=parseFloat(t.style("left")),s=parseFloat(n.style("left"))-r;this.accuracyRow.select(".track .range-track").style("left",`${r+Ye}px`).style("width",`${s}px`),this.densityClip!==null&&this.densityClip.attr("x",this.accuracyXScale(this.curAccuracyLow)).attr("width",this.accuracyXScale(this.curAccuracyHigh)-this.accuracyXScale(this.curAccuracyLow))},Mr=new WeakSet,Cs=function(){if(this.accuracySVG===null)return;const t=this.accuracySVG.select("g.tick-top-group").selectAll("g.tick");t.filter(n=>n>=this.curAccuracyLow&&n<=this.curAccuracyHigh).classed("out-range",!1),t.filter(n=>nthis.curAccuracyHigh).classed("out-range",!0),this.curAccuracyHigh===this.curAccuracyLow&&this.accuracySVG.select("g.tick-top-group").selectAll("g.tick").classed("out-range",!0)},ua=new WeakSet,t0=function(){const t=li-ci*2,n=30,r=15,i=vt+r+n,s=this.minSampleRow.select(".svg-min-sample").attr("width",t).attr("height",i),a={top:0,left:Ye,right:Ye,bottom:0,histTop:2},o=t-a.left-a.right;s.append("g").attr("class","border-group").attr("transform",`translate(${0}, ${a.top})`).append("rect").attr("width",t).attr("height",vt-a.top).style("fill","none").style("stroke",Te.colors["gray-300"]);const c=s.append("g").attr("class","hist-group").attr("transform",`translate(${Ye}, ${a.top})`);this.minSampleXScale=z.scaleLinear().domain([this.minSampleDensities[0].x,this.minSampleDensities.slice(-1)[0].x]).range([0,o]);const l=Math.max(...this.minSampleDensities.map(k=>k.y));this.minSampleYScale=z.scaleLinear().domain([0,l]).range([vt-a.bottom-a.top,a.histTop]);const u=z.line().curve(z.curveBasis).x(k=>this.minSampleXScale(k.x)).y(k=>this.minSampleYScale(k.y)),h=c.append("path").attr("class","area-path").datum(this.minSampleDensities).attr("d",u).clone(!0).classed("selected",!0);this.minSampleDensityClip=c.append("clipPath").attr("id","min-sample-density-clip").append("rect").style("fill","hsla(100, 50%, 50%, 0.1)").attr("x",this.minSampleXScale(this.curMinSampleLow)).attr("width",this.minSampleXScale(this.curMinSampleHigh)-this.minSampleXScale(this.curMinSampleLow)).attr("height",vt),h.attr("clip-path","url(#min-sample-density-clip)");const p=s.append("g").attr("class","tick-group").attr("transform",`translate(${Ye}, ${vt+r})`),g=p.append("g").attr("class","tick-back-group"),d=p.append("g").attr("class","tick-top-group"),m=30,v=[],S=this.minSampleDensities[1].x-this.minSampleDensities[0].x,b=this.minSampleLow+S,_=this.minSampleHigh;for(let k=0;k<=m;k++)v.push(b+(_-b)*k/m);return d.selectAll("g.tick").data(v).join("g").attr("class","tick").attr("transform",k=>`translate(${this.minSampleXScale(k)}, 0)`).append("line").attr("y2",pr.default),se(this,Mr,Cs).call(this),g.append("text").attr("class","label-min-value").attr("x",-4).attr("y",pr.default*2.2).style("text-anchor","start").style("dominant-baseline","hanging").style("font-size","0.9em").style("fill",Te.colors["gray-500"]).text(as(this.minSampleLow)),g.append("text").attr("class","label-max-value").attr("x",o+4).attr("y",pr.default*2.2).style("text-anchor","end").style("dominant-baseline","hanging").style("font-size","0.9em").style("fill",Te.colors["gray-500"]).text(as(this.minSampleHigh)),s},ha=new WeakSet,n0=function(){se(this,Mn,yr).call(this,os,this.curMinSampleLow),se(this,Mn,yr).call(this,ls,this.curMinSampleHigh),this.minSampleRow.select(`#${os}`).on("mousedown",t=>se(this,Fi,Go).call(this,t)),this.minSampleRow.select(`#${ls}`).on("mousedown",t=>se(this,Fi,Go).call(this,t)),se(this,Tr,bs).call(this)},Mn=new WeakSet,yr=function(t,n){switch(n=Math.min(Math.max(n,this.minSampleLow),this.minSampleHigh),t){case"slider-left-thumb":n=Math.min(this.curMinSampleHigh,n);break;case"slider-right-thumb":n=Math.max(this.curMinSampleLow,n);break;default:console.warn("Unknown thumb type in moveThumb()");break}const r=this.minSampleRow.select(`#${t}`).attr("data-curValue",n),i=li-2*ci-2*Ye;let s=(n-this.minSampleLow)/(this.minSampleHigh-this.minSampleLow)*i;switch(t){case"slider-left-thumb":s-=Ye,this.curMinSampleLow=n,this.searchStoreValue.curMinSampleLow=this.curMinSampleLow;break;case"slider-right-thumb":this.curMinSampleHigh=n,this.searchStoreValue.curMinSampleHigh=this.curMinSampleHigh;break;default:console.warn("Unknown thumb type in moveThumb()");break}this.searchStore.set(this.searchStoreValue),r.style("left",`${s}px`),se(this,fa,r0).call(this),se(this,da,i0).call(this),this.searchUpdated()},Fi=new WeakSet,Go=function(t){t.preventDefault(),t.stopPropagation();const n=t.target;if(n===null||!n.id.includes("thumb"))return;const r=n.parentNode,i=r.getBoundingClientRect().width;n.focus();const s=o=>{o.preventDefault(),o.stopPropagation();const c=o.pageX-r.getBoundingClientRect().x;let l=this.minSampleLow+(this.minSampleHigh-this.minSampleLow)*c/i;l=Or(l,0),se(this,Mn,yr).call(this,n.id,l)},a=()=>{document.removeEventListener("mousemove",s),document.removeEventListener("mouseup",a),document.body.style.cursor="default",n.blur()};document.addEventListener("mousemove",s),document.addEventListener("mouseup",a),document.body.style.cursor="grabbing"},fa=new WeakSet,r0=function(){const t=this.minSampleRow.select("#slider-left-thumb"),n=this.minSampleRow.select("#slider-right-thumb"),r=parseFloat(t.style("left")),s=parseFloat(n.style("left"))-r;this.minSampleRow.select(".track .range-track").style("left",`${r+Ye}px`).style("width",`${s}px`),this.minSampleDensityClip!==null&&this.minSampleDensityClip.attr("x",this.minSampleXScale(this.curMinSampleLow)).attr("width",this.minSampleXScale(this.curMinSampleHigh)-this.minSampleXScale(this.curMinSampleLow))},da=new WeakSet,i0=function(){if(this.minSampleSVG===null)return;const t=this.minSampleSVG.select("g.tick-top-group").selectAll("g.tick");t.filter(n=>n>=this.curMinSampleLow&&n<=this.curMinSampleHigh).classed("out-range",!1),t.filter(n=>nthis.curMinSampleHigh).classed("out-range",!0),this.curMinSampleHigh===this.curMinSampleLow&&this.minSampleSVG.select("g.tick-top-group").selectAll("g.tick").classed("out-range",!0)},pa=new WeakSet,s0=function(){const t=li-ci*2,n=0,i=vt+0+n,s=this.heightRow.select(".svg-height").attr("width",t).attr("height",i),a={top:0,left:Ye,right:Ye,bottom:0,histTop:20},o=t-a.left-a.right;s.append("g").attr("class","border-group").attr("transform",`translate(${0}, ${a.top})`).append("rect").attr("width",t).attr("height",vt-a.top).style("fill","none").style("stroke",Te.colors["gray-300"]);const c=s.append("g").attr("class","hist-group").attr("transform",`translate(${Ye}, ${a.top})`);this.heightXScale=z.scaleBand().domain(this.heightDensities.map(h=>h.x)).range([0,o]).paddingInner(.35);const l=Math.max(...this.heightDensities.map(h=>h.y));this.heightYScale=z.scaleLinear().domain([0,l]).range([vt-a.bottom-a.top,a.histTop]);const u=c.selectAll("g.bar").data(this.heightDensities).join("g").attr("class","bar selected").attr("id",h=>`bar-${h.x}`).attr("transform",h=>`translate(${this.heightXScale(h.x)}, ${0})`);return u.append("rect").attr("x",0).attr("y",h=>this.heightYScale(h.y)).attr("width",this.heightXScale.bandwidth()).attr("height",h=>this.heightYScale(0)-this.heightYScale(h.y)),u.append("text").attr("x",this.heightXScale.bandwidth()/2).attr("y",h=>this.heightYScale(h.y)-5).append("tspan").text(h=>`(${z.format(".0%")(h.y)})`),u.append("title").text(h=>`Height: ${h.x} (${z.format(".4%")(h.y)})`),this.searchStoreValue.curHeightRange=new Set(this.heightXScale.domain()),this.searchStore.set(this.searchStoreValue),s},ga=new WeakSet,a0=function(){const t=z.select(this.component).select(".height-checkboxes");this.heightDensities.forEach(n=>{t.append("label").attr("class","height-checkbox-label").attr("for",`height-checkbox-${n.x}`).text(n.x).style("left",`${this.heightXScale(n.x)+this.heightXScale.bandwidth()/2+13}px`),t.append("input").attr("type","checkbox").property("checked",!0).attr("class","height-checkbox").attr("id",`height-checkbox-${n.x}`).style("left",`${this.heightXScale(n.x)+this.heightXScale.bandwidth()/2-4}px`).on("change",i=>se(this,ma,o0).call(this,i,n.x))})},ma=new WeakSet,o0=function(t,n){var i;t.preventDefault();const r=t.target;(i=this.heightSVG)==null||i.select(`#bar-${n}`).classed("selected",r.checked),r.checked?this.searchStoreValue.curHeightRange.add(n):this.searchStoreValue.curHeightRange.delete(n),this.searchStore.set(this.searchStoreValue)},ya=new WeakSet,l0=async function(){await ml();for(const t of this.searchStoreValue.curDepthFeatures.keys())se(this,Pi,Yo).call(this,t);se(this,Pi,Yo).call(this,0)},wa=new WeakSet,c0=function(t,n,r){t.preventDefault();const i=t.target,s=this.searchStoreValue.curDepthFeatures.get(n);if(s===void 0){console.error(`Unknown depth ${n}`);return}i.checked?s.add(r):s.delete(r),this.searchStoreValue.curDepthFeatures.set(n,s),this.searchStore.set(this.searchStoreValue)},va=new WeakSet,u0=function(t,n){t.preventDefault();const r=t.target,i=this.searchStoreValue.curAllFeatures;r.checked?i.add(n):i.delete(n),this.searchStoreValue.curAllFeatures=i,this.searchStore.set(this.searchStoreValue)},Pi=new WeakSet,Yo=function(t){var o,c;const n=z.select(this.component).select(`#level-row-${t} .level-content`),r=new Set([]),i=new Set([]);for(const l of this.searchStoreValue.featureOrder){let u=this.searchStoreValue.featureMap.get(l);u===void 0&&(u=["","",""],console.error(`Cannot find feature ${l} in featureMap`)),i.has(u[2])?r.add(u[2]):i.add(u[2])}let s=null,a=null;for(const l of this.searchStoreValue.featureOrder){let u=this.searchStoreValue.featureMap.get(l);u===void 0&&(u=["","",""],console.error(`Cannot find feature ${l} in featureMap`));let f=n;if(s!==null&&u[2]!==a&&(a=null,s=null),r.has(u[2])){if(s===null){const v=n.append("div").attr("class","depth-checkbox-row");v.append("div").attr("class","depth-checkbox-row-title").text(u[2]),s=v.append("div").attr("class","depth-checkbox-row-checkboxes"),a=u[2]}f=s.append("div").attr("class","checkbox-wrapper")}else f=n.append("div").attr("class","depth-checkbox-single-row").append("div").attr("class","checkbox-wrapper");const h=f.append("input").attr("type","checkbox").property("checked",!0).attr("class","depth-checkbox").attr("id",`depth-check-box-label-${t}-${l}`),p=f.append("label").attr("class","depth-checkbox-label").attr("for",`depth-check-box-label-${t}-${l}`);let g=`${u[2]} ${u[1]}`;u[2]===a&&(g=`${u[1]}`),p.append("span").text(g),p.attr("title",t===0?`Show/hide trees using "${u[0]} ${u[1]}"`:`Show/hide trees using "${u[0]} ${u[1]}" at depth ${t}`);let d="initial";const m=(c=(o=this.searchStoreValue).getFeatureColor)==null?void 0:c.call(o,String(l));m!==void 0&&(d=m),h.style("accent-color",d),h.on("change",v=>{t===0?se(this,va,u0).call(this,v,l):se(this,wa,c0).call(this,v,t,l)})}};const Bo=` @@ -60,7 +60,7 @@ var W0=Object.defineProperty;var O0=(e,t,n)=>t in e?W0(e,t,{enumerable:!0,config -`,Zo=` +`,Uo=` @@ -73,7 +73,7 @@ var W0=Object.defineProperty;var O0=(e,t,n)=>t in e?W0(e,t,{enumerable:!0,config -`,ql='',Tr='';const{Object:fd,console:dd}=vl,ne="src/components/search-panel/SearchPanel.svelte";function Lc(e,t,n){const r=e.slice();return r[25]=t[n],r}function jo(e){var S,b;let t,n,r,i,s,a,o,c,l,u,f=e[4].curAllFeatures.size===Object.keys((S=e[0])==null?void 0:S.featureMap).length?"Include all features":`Include ${e[4].curAllFeatures.size} out of ${Object.keys((b=e[0])==null?void 0:b.featureMap).length} features`,h,p,g,d,m;const v={c:function(){t=L("div"),n=L("div"),r=L("span"),r.textContent="Features",i=W(),s=L("div"),a=L("span"),o=W(),c=L("span"),l=W(),u=L("div"),h=ce(f),p=W(),g=L("div"),w(r,"class","s-H0d2FahnGNOH"),x(r,ne,677,10,17103),w(a,"class","title-icon refresh-button s-H0d2FahnGNOH"),w(a,"title","Reset the filter"),x(a,ne,679,12,17173),w(c,"class","title-icon detail-button s-H0d2FahnGNOH"),w(c,"title","Show details"),w(c,"data-detail","false"),x(c,ne,687,12,17424),w(s,"class","title-icons s-H0d2FahnGNOH"),x(s,ne,678,10,17135),w(n,"class","row-title s-H0d2FahnGNOH"),x(n,ne,676,8,17069),w(u,"class","level-summary s-H0d2FahnGNOH"),x(u,ne,697,8,17701),w(g,"class","level-content s-H0d2FahnGNOH"),x(g,ne,705,8,18041),w(t,"class","row level-row level-row-all s-H0d2FahnGNOH"),w(t,"id","level-row-0"),ge(t,"show-detail",e[5].has(0)),x(t,ne,671,6,16927)},m:function(k,H){ae(k,t,H),y(t,n),y(n,r),y(n,i),y(n,s),y(s,a),a.innerHTML=Tr,y(s,o),y(s,c),c.innerHTML=ql,y(t,l),y(t,u),y(u,h),y(t,p),y(t,g),d||(m=[he(a,"click",e[18],!1,!1,!1),he(c,"click",e[19],!1,!1,!1)],d=!0)},p:function(k,H){var I,M;H&17&&f!==(f=k[4].curAllFeatures.size===Object.keys((I=k[0])==null?void 0:I.featureMap).length?"Include all features":`Include ${k[4].curAllFeatures.size} out of ${Object.keys((M=k[0])==null?void 0:M.featureMap).length} features`)&&Ee(h,f),H&32&&ge(t,"show-detail",k[5].has(0))},d:function(k){k&&ee(t),d=!1,Re(m)}};return te("SvelteRegisterBlock",{block:v,id:jo.name,type:"if",source:"(671:4) {#if data}",ctx:e}),v}function Xo(e){var M,V,E,F;let t,n,r,i=`Depth ${e[25]}`,s,a,o,c,l,u,f,h,p=((M=e[4].curDepthFeatures.get(e[25]))==null?void 0:M.size)===Object.keys((V=e[0])==null?void 0:V.featureMap).length?"Include all features":`Include ${(E=e[4].curDepthFeatures.get(e[25]))==null?void 0:E.size} out of ${Object.keys((F=e[0])==null?void 0:F.featureMap).length} features`,g,d,m,v,S,b,_;function k(...R){return e[20](e[25],...R)}function H(...R){return e[21](e[25],...R)}const I={c:function(){t=L("div"),n=L("div"),r=L("span"),s=ce(i),a=W(),o=L("div"),c=L("span"),l=W(),u=L("span"),f=W(),h=L("div"),g=ce(p),d=W(),m=L("div"),v=W(),w(r,"class","s-H0d2FahnGNOH"),x(r,ne,716,10,18343),w(c,"class","title-icon refresh-button s-H0d2FahnGNOH"),w(c,"title","Reset the filter"),x(c,ne,718,12,18423),w(u,"class","title-icon detail-button s-H0d2FahnGNOH"),w(u,"title","Show details"),w(u,"data-detail","false"),x(u,ne,726,12,18675),w(o,"class","title-icons s-H0d2FahnGNOH"),x(o,ne,717,10,18385),w(n,"class","row-title s-H0d2FahnGNOH"),x(n,ne,715,8,18309),w(h,"class","level-summary s-H0d2FahnGNOH"),x(h,ne,736,8,18956),w(m,"class","level-content s-H0d2FahnGNOH"),x(m,ne,744,8,19324),w(t,"class","row level-row s-H0d2FahnGNOH"),w(t,"id",S=`level-row-${e[25]}`),ge(t,"show-detail",e[5].has(e[25])),x(t,ne,710,6,18168)},m:function(A,C){ae(A,t,C),y(t,n),y(n,r),y(r,s),y(n,a),y(n,o),y(o,c),c.innerHTML=Tr,y(o,l),y(o,u),u.innerHTML=ql,y(t,f),y(t,h),y(h,g),y(t,d),y(t,m),y(t,v),b||(_=[he(c,"click",k,!1,!1,!1),he(u,"click",H,!1,!1,!1)],b=!0)},p:function(A,C){var T,D,P,G;e=A,C&16&&i!==(i=`Depth ${e[25]}`)&&Ee(s,i),C&17&&p!==(p=((T=e[4].curDepthFeatures.get(e[25]))==null?void 0:T.size)===Object.keys((D=e[0])==null?void 0:D.featureMap).length?"Include all features":`Include ${(P=e[4].curDepthFeatures.get(e[25]))==null?void 0:P.size} out of ${Object.keys((G=e[0])==null?void 0:G.featureMap).length} features`)&&Ee(g,p),C&16&&S!==(S=`level-row-${e[25]}`)&&w(t,"id",S),C&48&&ge(t,"show-detail",e[5].has(e[25]))},d:function(A){A&&ee(t),b=!1,Re(_)}};return te("SvelteRegisterBlock",{block:I,id:Xo.name,type:"each",source:"(710:4) {#each [...searchStoreValue.curDepthFeatures.keys()] as depth}",ctx:e}),I}function qo(e){var kt,Ot,vn,Qr;let t,n,r,i,s,a,o,c,l,u,f,h,p,g,d,m,v,S,b,_,k,H,I,M,V,E,F=e[7]((kt=e[3])==null?void 0:kt.curAccuracyLow)+"",R,A,C,T,D,P,G,Y=e[7]((Ot=e[3])==null?void 0:Ot.curAccuracyHigh)+"",U,X,J,me,K,Q,B,ie,fe,j,$,oe,O,we,de,xe,Le,Z,ue,He,ke,nt,Pe=e[8]((vn=e[3])==null?void 0:vn.curMinSampleLow)+"",Kt,xt,Ue,$t,en,In,dn,gt=e[8]((Qr=e[3])==null?void 0:Qr.curMinSampleHigh)+"",sr,pn,gn,En,mn,tn,Wt,Lt,jr,Dt,nn,Xr,mt,zn,Wn,rn,On,yn,qr,Gn,Nt,wn,Ve=e[0]&&jo(e),Qe=[...e[4].curDepthFeatures.keys()];De(Qe);let Oe=[];for(let Ge=0;Ge{e.preventDefault(),e.stopPropagation()},gd=e=>{e.preventDefault(),e.stopPropagation()};function md(e,t,n){let{$$slots:r={},$$scope:i}=t;St("SearchPanel",r,[]);let{data:s=null}=t,{searchStore:a=null}=t,{width:o=650}=t,c=null,l=!1,u=!1,f=null,h=Hr(),p=new Set([]);var g;(function(T){T[T.Accuracy=0]="Accuracy",T[T.Height=1]="Height",T[T.MinSample=2]="MinSample",T[T.Depth=3]="Depth",T[T.AllFeatures=4]="AllFeatures"})(g||(g={}));const d=z.format(",.3f"),m=z.format("d");Ne(()=>{n(13,l=!0)});const v=()=>{n(3,f)},S=T=>{T.stopPropagation(),T.preventDefault(),n(4,h.shown=!1,h),a==null||a.set(h)},b=(T,D)=>{T.stopPropagation(),T.preventDefault();const P=T.currentTarget;P.dataset.detail==="false"?(P.dataset.detail="true",p.add(D)):(P.dataset.detail="false",p.delete(D)),n(5,p)},_=(T,D,P=null)=>{if(f!==null)switch(T.preventDefault(),D){case g.Accuracy:{f.refreshAccuracy();break}case g.MinSample:{f.refreshMinSample();break}case g.Depth:{P!==null&&f.refreshDepth(P);break}case g.AllFeatures:{f.refreshAllFeatures();break}case g.Height:{f.refreshHeight();break}default:console.warn("Unexpected case for refreshClicked()")}},k=()=>{n(14,u=!0),a&&c&&s&&(a.subscribe(T=>{n(4,h=T)}),n(3,f=new xc(c,s,v,a)))},H=["data","searchStore","width"];fd.keys(t).forEach(T=>{!~H.indexOf(T)&&T.slice(0,2)!=="$$"&&T!=="slot"&&dd.warn(` was created with unknown prop '${T}'`)});const I=T=>_(T,g.Accuracy),M=T=>_(T,g.MinSample),V=T=>_(T,g.Height),E=T=>_(T,g.AllFeatures),F=T=>b(T,0),R=(T,D)=>_(D,g.Depth,T),A=(T,D)=>b(D,T);function C(T){Je[T?"unshift":"push"](()=>{c=T,n(2,c)})}return e.$$set=T=>{"data"in T&&n(0,s=T.data),"searchStore"in T&&n(12,a=T.searchStore),"width"in T&&n(1,o=T.width)},e.$capture_state=()=>({d3:z,getSearchStoreDefaultValue:Hr,onMount:Ne,SearchPanel:xc,closeIcon:Va,thumbLeftIcon:Uo,thumbRightIcon:Zo,downIcon:ql,refreshIcon:Tr,data:s,searchStore:a,width:o,component:c,mounted:l,initialized:u,searchPanel:f,searchStoreValue:h,depthWithDetails:p,RefreshLocation:g,formatter:d,sampleFormatter:m,searchUpdated:v,closeClicked:S,detailClicked:b,refreshClicked:_,initView:k}),e.$inject_state=T=>{"data"in T&&n(0,s=T.data),"searchStore"in T&&n(12,a=T.searchStore),"width"in T&&n(1,o=T.width),"component"in T&&n(2,c=T.component),"mounted"in T&&n(13,l=T.mounted),"initialized"in T&&n(14,u=T.initialized),"searchPanel"in T&&n(3,f=T.searchPanel),"searchStoreValue"in T&&n(4,h=T.searchStoreValue),"depthWithDetails"in T&&n(5,p=T.depthWithDetails),"RefreshLocation"in T&&n(6,g=T.RefreshLocation)},t&&"$$inject"in t&&e.$inject_state(t.$$inject),e.$$.update=()=>{e.$$.dirty&28677&&s&&a&&l&&!u&&c&&k()},[s,o,c,f,h,p,g,d,m,S,b,_,a,l,u,I,M,V,E,F,R,A,C]}class d0 extends _t{constructor(t){super(t),Ct(this,t,md,qo,tt,{data:0,searchStore:12,width:1}),te("SvelteRegisterComponent",{component:this,tagName:"SearchPanel_1",options:t,id:qo.name})}get data(){throw new Error(": Props cannot be read directly from the component instance unless compiling with 'accessors: true' or ''")}set data(t){throw new Error(": Props cannot be set directly on the component instance unless compiling with 'accessors: true' or ''")}get searchStore(){throw new Error(": Props cannot be read directly from the component instance unless compiling with 'accessors: true' or ''")}set searchStore(t){throw new Error(": Props cannot be set directly on the component instance unless compiling with 'accessors: true' or ''")}get width(){throw new Error(": Props cannot be read directly from the component instance unless compiling with 'accessors: true' or ''")}set width(t){throw new Error(": Props cannot be set directly on the component instance unless compiling with 'accessors: true' or ''")}}class kc{constructor(t,n,r,i){N(this,"component");N(this,"inputElem");N(this,"dropzoneUpdated");N(this,"initDataFromDropzone");N(this,"isDragging",!1);N(this,"dragElement",null);N(this,"errorMessage"," ");N(this,"clickHandler",()=>{var t;(t=this.inputElem)==null||t.click()});N(this,"dragEnterHandler",t=>{t.preventDefault(),this.isDragging=!0,this.dragElement=t.target,this.dropzoneUpdated()});N(this,"dragOverHandler",t=>{t.preventDefault()});N(this,"dragLeaveHandler",t=>{t.preventDefault(),this.dragElement===t.target&&(this.isDragging=!1,this.dropzoneUpdated())});N(this,"dropHandler",async t=>{var i;t.preventDefault();let n=null,r=null;(i=t.dataTransfer)!=null&&i.items?t.dataTransfer.items[0].kind==="file"&&(r=t.dataTransfer.items[0].getAsFile(),n=await this.validateFile(r)):(r=t.dataTransfer.files[0],n=await this.validateFile(r)),this.isDragging=!1,this.dropzoneUpdated(),n&&this.initDataFromDropzone(n)});N(this,"inputChanged",async t=>{t.preventDefault();let n=null;const r=t.target.files;if(r!==null){const i=r[0];n=await this.validateFile(i),console.log(n)}!n||this.initDataFromDropzone(n)});N(this,"inputClicked",()=>{});N(this,"readJSON",t=>new Promise((n,r)=>{const i=new FileReader;i.onload=()=>{i.result?n(JSON.parse(i.result)):n(null)},i.onerror=r,i.readAsText(t)}));N(this,"validateFile",async t=>t.type!=="application/json"?(this.errorMessage="It is not a JSON file",this.dropzoneUpdated(),null):await this.readJSON(t));this.component=t,this.inputElem=n,this.dropzoneUpdated=r,this.initDataFromDropzone=i}}const Da=` +`,Xl='',kr='';const{Object:hd,console:fd}=wl,te="src/components/search-panel/SearchPanel.svelte";function xc(e,t,n){const r=e.slice();return r[25]=t[n],r}function Zo(e){var S,b;let t,n,r,i,s,a,o,c,l,u,f=e[4].curAllFeatures.size===Object.keys((S=e[0])==null?void 0:S.featureMap).length?"Include all features":`Include ${e[4].curAllFeatures.size} out of ${Object.keys((b=e[0])==null?void 0:b.featureMap).length} features`,h,p,g,d,m;const v={c:function(){t=L("div"),n=L("div"),r=L("span"),r.textContent="Features",i=W(),s=L("div"),a=L("span"),o=W(),c=L("span"),l=W(),u=L("div"),h=ce(f),p=W(),g=L("div"),w(r,"class","s-H0d2FahnGNOH"),x(r,te,677,10,17103),w(a,"class","title-icon refresh-button s-H0d2FahnGNOH"),w(a,"title","Reset the filter"),x(a,te,679,12,17173),w(c,"class","title-icon detail-button s-H0d2FahnGNOH"),w(c,"title","Show details"),w(c,"data-detail","false"),x(c,te,687,12,17424),w(s,"class","title-icons s-H0d2FahnGNOH"),x(s,te,678,10,17135),w(n,"class","row-title s-H0d2FahnGNOH"),x(n,te,676,8,17069),w(u,"class","level-summary s-H0d2FahnGNOH"),x(u,te,697,8,17701),w(g,"class","level-content s-H0d2FahnGNOH"),x(g,te,705,8,18041),w(t,"class","row level-row level-row-all s-H0d2FahnGNOH"),w(t,"id","level-row-0"),ge(t,"show-detail",e[5].has(0)),x(t,te,671,6,16927)},m:function(k,H){ae(k,t,H),y(t,n),y(n,r),y(n,i),y(n,s),y(s,a),a.innerHTML=kr,y(s,o),y(s,c),c.innerHTML=Xl,y(t,l),y(t,u),y(u,h),y(t,p),y(t,g),d||(m=[he(a,"click",e[18],!1,!1,!1),he(c,"click",e[19],!1,!1,!1)],d=!0)},p:function(k,H){var I,M;H&17&&f!==(f=k[4].curAllFeatures.size===Object.keys((I=k[0])==null?void 0:I.featureMap).length?"Include all features":`Include ${k[4].curAllFeatures.size} out of ${Object.keys((M=k[0])==null?void 0:M.featureMap).length} features`)&&Ee(h,f),H&32&&ge(t,"show-detail",k[5].has(0))},d:function(k){k&&ne(t),d=!1,Re(m)}};return ee("SvelteRegisterBlock",{block:v,id:Zo.name,type:"if",source:"(671:4) {#if data}",ctx:e}),v}function jo(e){var M,V,E,F;let t,n,r,i=`Depth ${e[25]}`,s,a,o,c,l,u,f,h,p=((M=e[4].curDepthFeatures.get(e[25]))==null?void 0:M.size)===Object.keys((V=e[0])==null?void 0:V.featureMap).length?"Include all features":`Include ${(E=e[4].curDepthFeatures.get(e[25]))==null?void 0:E.size} out of ${Object.keys((F=e[0])==null?void 0:F.featureMap).length} features`,g,d,m,v,S,b,_;function k(...R){return e[20](e[25],...R)}function H(...R){return e[21](e[25],...R)}const I={c:function(){t=L("div"),n=L("div"),r=L("span"),s=ce(i),a=W(),o=L("div"),c=L("span"),l=W(),u=L("span"),f=W(),h=L("div"),g=ce(p),d=W(),m=L("div"),v=W(),w(r,"class","s-H0d2FahnGNOH"),x(r,te,716,10,18343),w(c,"class","title-icon refresh-button s-H0d2FahnGNOH"),w(c,"title","Reset the filter"),x(c,te,718,12,18423),w(u,"class","title-icon detail-button s-H0d2FahnGNOH"),w(u,"title","Show details"),w(u,"data-detail","false"),x(u,te,726,12,18675),w(o,"class","title-icons s-H0d2FahnGNOH"),x(o,te,717,10,18385),w(n,"class","row-title s-H0d2FahnGNOH"),x(n,te,715,8,18309),w(h,"class","level-summary s-H0d2FahnGNOH"),x(h,te,736,8,18956),w(m,"class","level-content s-H0d2FahnGNOH"),x(m,te,744,8,19324),w(t,"class","row level-row s-H0d2FahnGNOH"),w(t,"id",S=`level-row-${e[25]}`),ge(t,"show-detail",e[5].has(e[25])),x(t,te,710,6,18168)},m:function(A,C){ae(A,t,C),y(t,n),y(n,r),y(r,s),y(n,a),y(n,o),y(o,c),c.innerHTML=kr,y(o,l),y(o,u),u.innerHTML=Xl,y(t,f),y(t,h),y(h,g),y(t,d),y(t,m),y(t,v),b||(_=[he(c,"click",k,!1,!1,!1),he(u,"click",H,!1,!1,!1)],b=!0)},p:function(A,C){var T,D,P,G;e=A,C&16&&i!==(i=`Depth ${e[25]}`)&&Ee(s,i),C&17&&p!==(p=((T=e[4].curDepthFeatures.get(e[25]))==null?void 0:T.size)===Object.keys((D=e[0])==null?void 0:D.featureMap).length?"Include all features":`Include ${(P=e[4].curDepthFeatures.get(e[25]))==null?void 0:P.size} out of ${Object.keys((G=e[0])==null?void 0:G.featureMap).length} features`)&&Ee(g,p),C&16&&S!==(S=`level-row-${e[25]}`)&&w(t,"id",S),C&48&&ge(t,"show-detail",e[5].has(e[25]))},d:function(A){A&&ne(t),b=!1,Re(_)}};return ee("SvelteRegisterBlock",{block:I,id:jo.name,type:"each",source:"(710:4) {#each [...searchStoreValue.curDepthFeatures.keys()] as depth}",ctx:e}),I}function Xo(e){var kt,Ot,vn,Jr;let t,n,r,i,s,a,o,c,l,u,f,h,p,g,d,m,v,S,b,_,k,H,I,M,V,E,F=e[7]((kt=e[3])==null?void 0:kt.curAccuracyLow)+"",R,A,C,T,D,P,G,Y=e[7]((Ot=e[3])==null?void 0:Ot.curAccuracyHigh)+"",U,X,J,me,K,Q,B,ie,fe,j,$,oe,O,we,de,xe,Le,Z,ue,He,ke,nt,Pe=e[8]((vn=e[3])==null?void 0:vn.curMinSampleLow)+"",Kt,xt,Ue,$t,en,In,dn,gt=e[8]((Jr=e[3])==null?void 0:Jr.curMinSampleHigh)+"",sr,pn,gn,En,mn,tn,Wt,Lt,Zr,Dt,nn,jr,mt,zn,Wn,rn,On,yn,Xr,Gn,Nt,wn,Ve=e[0]&&Zo(e),Qe=[...e[4].curDepthFeatures.keys()];De(Qe);let Oe=[];for(let Ge=0;Ge{e.preventDefault(),e.stopPropagation()},pd=e=>{e.preventDefault(),e.stopPropagation()};function gd(e,t,n){let{$$slots:r={},$$scope:i}=t;St("SearchPanel",r,[]);let{data:s=null}=t,{searchStore:a=null}=t,{width:o=650}=t,c=null,l=!1,u=!1,f=null,h=Nr(),p=new Set([]);var g;(function(T){T[T.Accuracy=0]="Accuracy",T[T.Height=1]="Height",T[T.MinSample=2]="MinSample",T[T.Depth=3]="Depth",T[T.AllFeatures=4]="AllFeatures"})(g||(g={}));const d=z.format(",.3f"),m=z.format("d");Ne(()=>{n(13,l=!0)});const v=()=>{n(3,f)},S=T=>{T.stopPropagation(),T.preventDefault(),n(4,h.shown=!1,h),a==null||a.set(h)},b=(T,D)=>{T.stopPropagation(),T.preventDefault();const P=T.currentTarget;P.dataset.detail==="false"?(P.dataset.detail="true",p.add(D)):(P.dataset.detail="false",p.delete(D)),n(5,p)},_=(T,D,P=null)=>{if(f!==null)switch(T.preventDefault(),D){case g.Accuracy:{f.refreshAccuracy();break}case g.MinSample:{f.refreshMinSample();break}case g.Depth:{P!==null&&f.refreshDepth(P);break}case g.AllFeatures:{f.refreshAllFeatures();break}case g.Height:{f.refreshHeight();break}default:console.warn("Unexpected case for refreshClicked()")}},k=()=>{n(14,u=!0),a&&c&&s&&(a.subscribe(T=>{n(4,h=T)}),n(3,f=new _c(c,s,v,a)))},H=["data","searchStore","width"];hd.keys(t).forEach(T=>{!~H.indexOf(T)&&T.slice(0,2)!=="$$"&&T!=="slot"&&fd.warn(` was created with unknown prop '${T}'`)});const I=T=>_(T,g.Accuracy),M=T=>_(T,g.MinSample),V=T=>_(T,g.Height),E=T=>_(T,g.AllFeatures),F=T=>b(T,0),R=(T,D)=>_(D,g.Depth,T),A=(T,D)=>b(D,T);function C(T){Je[T?"unshift":"push"](()=>{c=T,n(2,c)})}return e.$$set=T=>{"data"in T&&n(0,s=T.data),"searchStore"in T&&n(12,a=T.searchStore),"width"in T&&n(1,o=T.width)},e.$capture_state=()=>({d3:z,getSearchStoreDefaultValue:Nr,onMount:Ne,SearchPanel:_c,closeIcon:Aa,thumbLeftIcon:Bo,thumbRightIcon:Uo,downIcon:Xl,refreshIcon:kr,data:s,searchStore:a,width:o,component:c,mounted:l,initialized:u,searchPanel:f,searchStoreValue:h,depthWithDetails:p,RefreshLocation:g,formatter:d,sampleFormatter:m,searchUpdated:v,closeClicked:S,detailClicked:b,refreshClicked:_,initView:k}),e.$inject_state=T=>{"data"in T&&n(0,s=T.data),"searchStore"in T&&n(12,a=T.searchStore),"width"in T&&n(1,o=T.width),"component"in T&&n(2,c=T.component),"mounted"in T&&n(13,l=T.mounted),"initialized"in T&&n(14,u=T.initialized),"searchPanel"in T&&n(3,f=T.searchPanel),"searchStoreValue"in T&&n(4,h=T.searchStoreValue),"depthWithDetails"in T&&n(5,p=T.depthWithDetails),"RefreshLocation"in T&&n(6,g=T.RefreshLocation)},t&&"$$inject"in t&&e.$inject_state(t.$$inject),e.$$.update=()=>{e.$$.dirty&28677&&s&&a&&l&&!u&&c&&k()},[s,o,c,f,h,p,g,d,m,S,b,_,a,l,u,I,M,V,E,F,R,A,C]}class h0 extends _t{constructor(t){super(t),Ct(this,t,gd,Xo,tt,{data:0,searchStore:12,width:1}),ee("SvelteRegisterComponent",{component:this,tagName:"SearchPanel_1",options:t,id:Xo.name})}get data(){throw new Error(": Props cannot be read directly from the component instance unless compiling with 'accessors: true' or ''")}set data(t){throw new Error(": Props cannot be set directly on the component instance unless compiling with 'accessors: true' or ''")}get searchStore(){throw new Error(": Props cannot be read directly from the component instance unless compiling with 'accessors: true' or ''")}set searchStore(t){throw new Error(": Props cannot be set directly on the component instance unless compiling with 'accessors: true' or ''")}get width(){throw new Error(": Props cannot be read directly from the component instance unless compiling with 'accessors: true' or ''")}set width(t){throw new Error(": Props cannot be set directly on the component instance unless compiling with 'accessors: true' or ''")}}class Lc{constructor(t,n,r,i){N(this,"component");N(this,"inputElem");N(this,"dropzoneUpdated");N(this,"initDataFromDropzone");N(this,"isDragging",!1);N(this,"dragElement",null);N(this,"errorMessage"," ");N(this,"clickHandler",()=>{var t;(t=this.inputElem)==null||t.click()});N(this,"dragEnterHandler",t=>{t.preventDefault(),this.isDragging=!0,this.dragElement=t.target,this.dropzoneUpdated()});N(this,"dragOverHandler",t=>{t.preventDefault()});N(this,"dragLeaveHandler",t=>{t.preventDefault(),this.dragElement===t.target&&(this.isDragging=!1,this.dropzoneUpdated())});N(this,"dropHandler",async t=>{var i;t.preventDefault();let n=null,r=null;(i=t.dataTransfer)!=null&&i.items?t.dataTransfer.items[0].kind==="file"&&(r=t.dataTransfer.items[0].getAsFile(),n=await this.validateFile(r)):(r=t.dataTransfer.files[0],n=await this.validateFile(r)),this.isDragging=!1,this.dropzoneUpdated(),n&&this.initDataFromDropzone(n)});N(this,"inputChanged",async t=>{t.preventDefault();let n=null;const r=t.target.files;if(r!==null){const i=r[0];n=await this.validateFile(i),console.log(n)}!n||this.initDataFromDropzone(n)});N(this,"inputClicked",()=>{});N(this,"readJSON",t=>new Promise((n,r)=>{const i=new FileReader;i.onload=()=>{i.result?n(JSON.parse(i.result)):n(null)},i.onerror=r,i.readAsText(t)}));N(this,"validateFile",async t=>t.type!=="application/json"?(this.errorMessage="It is not a JSON file",this.dropzoneUpdated(),null):await this.readJSON(t));this.component=t,this.inputElem=n,this.dropzoneUpdated=r,this.initDataFromDropzone=i}}const Va=` @@ -145,7 +145,7 @@ var W0=Object.defineProperty;var O0=(e,t,n)=>t in e?W0(e,t,{enumerable:!0,config -`;const cn="src/components/dropzone/Dropzone.svelte";function p0(e){let t;const n={c:function(){t=L("div"),t.textContent="Loading Rashomon set...",w(t,"class","drop-message s-5AsLhRYgdrVb"),x(t,cn,146,6,3225)},m:function(i,s){ae(i,t,s)},d:function(i){i&&ee(t)}};return te("SvelteRegisterBlock",{block:n,id:p0.name,type:"else",source:"(146:4) {:else}",ctx:e}),n}function g0(e){let t,n,r,i,s,a;const o={c:function(){t=L("div"),t.textContent="Drop a Rashomon trie file (.json) here to start",n=W(),r=L("div"),i=L("a"),i.textContent="How to generate this file?",w(t,"class","drop-message s-5AsLhRYgdrVb"),x(t,cn,130,6,2840),w(i,"href","https://github.com/poloclub/timbertrek#web-demo"),w(i,"target","_blank"),w(i,"class","s-5AsLhRYgdrVb"),x(i,cn,140,8,3060),w(r,"class","help-message s-5AsLhRYgdrVb"),x(r,cn,134,6,2943)},m:function(l,u){ae(l,t,u),ae(l,n,u),ae(l,r,u),y(r,i),s||(a=he(r,"click",yd,!1,!1,!1),s=!0)},d:function(l){l&&ee(t),l&&ee(n),l&&ee(r),s=!1,a()}};return te("SvelteRegisterBlock",{block:o,id:g0.name,type:"if",source:"(130:4) {#if curDataset === 'my own set'}",ctx:e}),o}function Jo(e){var S;let t,n,r,i,s,a,o=((S=e[4])==null?void 0:S.errorMessage)+"",c,l,u,f,h,p;function g(b,_){return b[1]==="my own set"?g0:p0}let d=g(e),m=d(e);const v={c:function(){var _;t=L("div"),n=L("div"),r=L("div"),i=W(),m.c(),s=W(),a=L("span"),c=ce(o),l=W(),u=L("input"),w(r,"class","svg-icon s-5AsLhRYgdrVb"),x(r,cn,125,4,2738),w(a,"class","error-message s-5AsLhRYgdrVb"),x(a,cn,149,4,3296),w(u,"accept","json"),w(u,"type","file"),w(u,"autocomplete","off"),vr(u,"display","none"),w(u,"class","s-5AsLhRYgdrVb"),x(u,cn,153,4,3373),w(n,"class","dropzone s-5AsLhRYgdrVb"),ge(n,"drag-over",(_=e[4])==null?void 0:_.isDragging),x(n,cn,116,2,2412),w(t,"class","dropzone-tab s-5AsLhRYgdrVb"),w(t,"style",f=`height: ${e[0]+Te.layout.toolbarHeight}px;`),x(t,cn,111,0,2294)},l:function(_){throw new Error("options.hydrate only works if the component was compiled with the `hydratable: true` option")},m:function(_,k){ae(_,t,k),y(t,n),y(n,r),r.innerHTML=Da,y(n,i),m.m(n,null),y(n,s),y(n,a),y(a,c),y(n,l),y(n,u),e[10](u),e[16](t),h||(p=[he(u,"change",e[8],!1,!1,!1),he(u,"click",e[9],!1,!1,!1),he(n,"click",e[11],!1,!1,!1),he(n,"dragenter",e[12],!1,!1,!1),he(n,"dragover",e[13],!1,!1,!1),he(n,"dragleave",e[14],!1,!1,!1),he(n,"drop",e[15],!1,!1,!1)],h=!0)},p:function(_,[k]){var H,I;d!==(d=g(_))&&(m.d(1),m=d(_),m&&(m.c(),m.m(n,s))),k&16&&o!==(o=((H=_[4])==null?void 0:H.errorMessage)+"")&&Ee(c,o),k&16&&ge(n,"drag-over",(I=_[4])==null?void 0:I.isDragging),k&1&&f!==(f=`height: ${_[0]+Te.layout.toolbarHeight}px;`)&&w(t,"style",f)},i:pe,o:pe,d:function(_){_&&ee(t),m.d(),e[10](null),e[16](null),h=!1,Re(p)}};return te("SvelteRegisterBlock",{block:v,id:Jo.name,type:"component",source:"",ctx:e}),v}const yd=e=>{e.stopPropagation()};function wd(e,t,n){let{$$slots:r={},$$scope:i}=t;St("Dropzone",r,[]);let{initDataFromDropzone:s}=t,{width:a=650}=t,{curDataset:o="my own set"}=t,c=null,l=null,u=null,f=!1,h=!1;Ne(()=>{n(6,f=!0)});const p=()=>{n(4,u)},g=()=>{f&&c&&l&&(n(4,u=new kc(c,l,p,s)),n(7,h=!0))};e.$$.on_mount.push(function(){s===void 0&&!("initDataFromDropzone"in t||e.$$.bound[e.$$.props.initDataFromDropzone])&&console.warn(" was created without expected prop 'initDataFromDropzone'")});const d=["initDataFromDropzone","width","curDataset"];Object.keys(t).forEach(V=>{!~d.indexOf(V)&&V.slice(0,2)!=="$$"&&V!=="slot"&&console.warn(` was created with unknown prop '${V}'`)});const m=V=>u==null?void 0:u.inputChanged(V),v=V=>u==null?void 0:u.inputClicked();function S(V){Je[V?"unshift":"push"](()=>{l=V,n(3,l)})}const b=V=>u==null?void 0:u.clickHandler(),_=V=>u==null?void 0:u.dragEnterHandler(V),k=V=>u==null?void 0:u.dragOverHandler(V),H=V=>u==null?void 0:u.dragLeaveHandler(V),I=V=>u==null?void 0:u.dropHandler(V);function M(V){Je[V?"unshift":"push"](()=>{c=V,n(2,c)})}return e.$$set=V=>{"initDataFromDropzone"in V&&n(5,s=V.initDataFromDropzone),"width"in V&&n(0,a=V.width),"curDataset"in V&&n(1,o=V.curDataset)},e.$capture_state=()=>({onMount:Ne,Dropzone:kc,config:Te,logoIcon:Da,initDataFromDropzone:s,width:a,curDataset:o,component:c,inputElem:l,dropzone:u,mounted:f,initialized:h,dropzoneUpdated:p,initView:g}),e.$inject_state=V=>{"initDataFromDropzone"in V&&n(5,s=V.initDataFromDropzone),"width"in V&&n(0,a=V.width),"curDataset"in V&&n(1,o=V.curDataset),"component"in V&&n(2,c=V.component),"inputElem"in V&&n(3,l=V.inputElem),"dropzone"in V&&n(4,u=V.dropzone),"mounted"in V&&n(6,f=V.mounted),"initialized"in V&&n(7,h=V.initialized)},t&&"$$inject"in t&&e.$inject_state(t.$$inject),e.$$.update=()=>{e.$$.dirty&236&&f&&c&&l&&s&&!h&&g()},[a,o,c,l,u,s,f,h,m,v,S,b,_,k,H,I,M]}class m0 extends _t{constructor(t){super(t),Ct(this,t,wd,Jo,tt,{initDataFromDropzone:5,width:0,curDataset:1}),te("SvelteRegisterComponent",{component:this,tagName:"Dropzone_1",options:t,id:Jo.name})}get initDataFromDropzone(){throw new Error(": Props cannot be read directly from the component instance unless compiling with 'accessors: true' or ''")}set initDataFromDropzone(t){throw new Error(": Props cannot be set directly on the component instance unless compiling with 'accessors: true' or ''")}get width(){throw new Error(": Props cannot be read directly from the component instance unless compiling with 'accessors: true' or ''")}set width(t){throw new Error(": Props cannot be set directly on the component instance unless compiling with 'accessors: true' or ''")}get curDataset(){throw new Error(": Props cannot be read directly from the component instance unless compiling with 'accessors: true' or ''")}set curDataset(t){throw new Error(": Props cannot be set directly on the component instance unless compiling with 'accessors: true' or ''")}}const y0='',w0=` +`;const cn="src/components/dropzone/Dropzone.svelte";function f0(e){let t;const n={c:function(){t=L("div"),t.textContent="Loading Rashomon set...",w(t,"class","drop-message s-5AsLhRYgdrVb"),x(t,cn,146,6,3225)},m:function(i,s){ae(i,t,s)},d:function(i){i&&ne(t)}};return ee("SvelteRegisterBlock",{block:n,id:f0.name,type:"else",source:"(146:4) {:else}",ctx:e}),n}function d0(e){let t,n,r,i,s,a;const o={c:function(){t=L("div"),t.textContent="Drop a Rashomon trie file (.json) here to start",n=W(),r=L("div"),i=L("a"),i.textContent="How to generate this file?",w(t,"class","drop-message s-5AsLhRYgdrVb"),x(t,cn,130,6,2840),w(i,"href","https://github.com/poloclub/timbertrek#web-demo"),w(i,"target","_blank"),w(i,"class","s-5AsLhRYgdrVb"),x(i,cn,140,8,3060),w(r,"class","help-message s-5AsLhRYgdrVb"),x(r,cn,134,6,2943)},m:function(l,u){ae(l,t,u),ae(l,n,u),ae(l,r,u),y(r,i),s||(a=he(r,"click",md,!1,!1,!1),s=!0)},d:function(l){l&&ne(t),l&&ne(n),l&&ne(r),s=!1,a()}};return ee("SvelteRegisterBlock",{block:o,id:d0.name,type:"if",source:"(130:4) {#if curDataset === 'my own set'}",ctx:e}),o}function qo(e){var S;let t,n,r,i,s,a,o=((S=e[4])==null?void 0:S.errorMessage)+"",c,l,u,f,h,p;function g(b,_){return b[1]==="my own set"?d0:f0}let d=g(e),m=d(e);const v={c:function(){var _;t=L("div"),n=L("div"),r=L("div"),i=W(),m.c(),s=W(),a=L("span"),c=ce(o),l=W(),u=L("input"),w(r,"class","svg-icon s-5AsLhRYgdrVb"),x(r,cn,125,4,2738),w(a,"class","error-message s-5AsLhRYgdrVb"),x(a,cn,149,4,3296),w(u,"accept","json"),w(u,"type","file"),w(u,"autocomplete","off"),wr(u,"display","none"),w(u,"class","s-5AsLhRYgdrVb"),x(u,cn,153,4,3373),w(n,"class","dropzone s-5AsLhRYgdrVb"),ge(n,"drag-over",(_=e[4])==null?void 0:_.isDragging),x(n,cn,116,2,2412),w(t,"class","dropzone-tab s-5AsLhRYgdrVb"),w(t,"style",f=`height: ${e[0]+Te.layout.toolbarHeight}px;`),x(t,cn,111,0,2294)},l:function(_){throw new Error("options.hydrate only works if the component was compiled with the `hydratable: true` option")},m:function(_,k){ae(_,t,k),y(t,n),y(n,r),r.innerHTML=Va,y(n,i),m.m(n,null),y(n,s),y(n,a),y(a,c),y(n,l),y(n,u),e[10](u),e[16](t),h||(p=[he(u,"change",e[8],!1,!1,!1),he(u,"click",e[9],!1,!1,!1),he(n,"click",e[11],!1,!1,!1),he(n,"dragenter",e[12],!1,!1,!1),he(n,"dragover",e[13],!1,!1,!1),he(n,"dragleave",e[14],!1,!1,!1),he(n,"drop",e[15],!1,!1,!1)],h=!0)},p:function(_,[k]){var H,I;d!==(d=g(_))&&(m.d(1),m=d(_),m&&(m.c(),m.m(n,s))),k&16&&o!==(o=((H=_[4])==null?void 0:H.errorMessage)+"")&&Ee(c,o),k&16&&ge(n,"drag-over",(I=_[4])==null?void 0:I.isDragging),k&1&&f!==(f=`height: ${_[0]+Te.layout.toolbarHeight}px;`)&&w(t,"style",f)},i:pe,o:pe,d:function(_){_&&ne(t),m.d(),e[10](null),e[16](null),h=!1,Re(p)}};return ee("SvelteRegisterBlock",{block:v,id:qo.name,type:"component",source:"",ctx:e}),v}const md=e=>{e.stopPropagation()};function yd(e,t,n){let{$$slots:r={},$$scope:i}=t;St("Dropzone",r,[]);let{initDataFromDropzone:s}=t,{width:a=650}=t,{curDataset:o="my own set"}=t,c=null,l=null,u=null,f=!1,h=!1;Ne(()=>{n(6,f=!0)});const p=()=>{n(4,u)},g=()=>{f&&c&&l&&(n(4,u=new Lc(c,l,p,s)),n(7,h=!0))};e.$$.on_mount.push(function(){s===void 0&&!("initDataFromDropzone"in t||e.$$.bound[e.$$.props.initDataFromDropzone])&&console.warn(" was created without expected prop 'initDataFromDropzone'")});const d=["initDataFromDropzone","width","curDataset"];Object.keys(t).forEach(V=>{!~d.indexOf(V)&&V.slice(0,2)!=="$$"&&V!=="slot"&&console.warn(` was created with unknown prop '${V}'`)});const m=V=>u==null?void 0:u.inputChanged(V),v=V=>u==null?void 0:u.inputClicked();function S(V){Je[V?"unshift":"push"](()=>{l=V,n(3,l)})}const b=V=>u==null?void 0:u.clickHandler(),_=V=>u==null?void 0:u.dragEnterHandler(V),k=V=>u==null?void 0:u.dragOverHandler(V),H=V=>u==null?void 0:u.dragLeaveHandler(V),I=V=>u==null?void 0:u.dropHandler(V);function M(V){Je[V?"unshift":"push"](()=>{c=V,n(2,c)})}return e.$$set=V=>{"initDataFromDropzone"in V&&n(5,s=V.initDataFromDropzone),"width"in V&&n(0,a=V.width),"curDataset"in V&&n(1,o=V.curDataset)},e.$capture_state=()=>({onMount:Ne,Dropzone:Lc,config:Te,logoIcon:Va,initDataFromDropzone:s,width:a,curDataset:o,component:c,inputElem:l,dropzone:u,mounted:f,initialized:h,dropzoneUpdated:p,initView:g}),e.$inject_state=V=>{"initDataFromDropzone"in V&&n(5,s=V.initDataFromDropzone),"width"in V&&n(0,a=V.width),"curDataset"in V&&n(1,o=V.curDataset),"component"in V&&n(2,c=V.component),"inputElem"in V&&n(3,l=V.inputElem),"dropzone"in V&&n(4,u=V.dropzone),"mounted"in V&&n(6,f=V.mounted),"initialized"in V&&n(7,h=V.initialized)},t&&"$$inject"in t&&e.$inject_state(t.$$inject),e.$$.update=()=>{e.$$.dirty&236&&f&&c&&l&&s&&!h&&g()},[a,o,c,l,u,s,f,h,m,v,S,b,_,k,H,I,M]}class p0 extends _t{constructor(t){super(t),Ct(this,t,yd,qo,tt,{initDataFromDropzone:5,width:0,curDataset:1}),ee("SvelteRegisterComponent",{component:this,tagName:"Dropzone_1",options:t,id:qo.name})}get initDataFromDropzone(){throw new Error(": Props cannot be read directly from the component instance unless compiling with 'accessors: true' or ''")}set initDataFromDropzone(t){throw new Error(": Props cannot be set directly on the component instance unless compiling with 'accessors: true' or ''")}get width(){throw new Error(": Props cannot be read directly from the component instance unless compiling with 'accessors: true' or ''")}set width(t){throw new Error(": Props cannot be set directly on the component instance unless compiling with 'accessors: true' or ''")}get curDataset(){throw new Error(": Props cannot be read directly from the component instance unless compiling with 'accessors: true' or ''")}set curDataset(t){throw new Error(": Props cannot be set directly on the component instance unless compiling with 'accessors: true' or ''")}}const g0='',m0=` @@ -156,7 +156,7 @@ var W0=Object.defineProperty;var O0=(e,t,n)=>t in e?W0(e,t,{enumerable:!0,config -`;const{Map:vd,Object:bd}=vl,Be="src/components/timber/Timber.svelte";function us(e,t,n){const r=e.slice();return r[23]=t[n],r}function v0(e){let t,n,r,i,s,a;n=new g2({props:{favoritesStore:e[9],sunburstStore:e[10],searchStore:e[13],sunburstWidth:e[6]},$$inline:!0}),s=new L2({props:{data:e[4],initDepthGap:e[2],sunburstStore:e[10],treeWindowStore:e[11],pinnedTreeStore:e[12],searchStore:e[13]},$$inline:!0});const o={c:function(){t=L("div"),bt(n.$$.fragment),r=W(),i=L("div"),bt(s.$$.fragment),w(t,"class","toolbar s-DgMWn4VSIQjZ"),x(t,Be,363,8,9587),w(i,"class","sunburst-wrapper s-DgMWn4VSIQjZ"),x(i,Be,372,8,9776)},m:function(l,u){ae(l,t,u),dt(n,t,null),ae(l,r,u),ae(l,i,u),dt(s,i,null),a=!0},p:function(l,u){const f={};u&64&&(f.sunburstWidth=l[6]),n.$set(f);const h={};u&16&&(h.data=l[4]),u&4&&(h.initDepthGap=l[2]),s.$set(h)},i:function(l){a||(_e(n.$$.fragment,l),_e(s.$$.fragment,l),a=!0)},o:function(l){Me(n.$$.fragment,l),Me(s.$$.fragment,l),a=!1},d:function(l){l&&ee(t),pt(n),l&&ee(r),l&&ee(i),pt(s)}};return te("SvelteRegisterBlock",{block:o,id:v0.name,type:"else",source:"(363:6) {:else}",ctx:e}),o}function b0(e){let t,n;t=new m0({props:{initDataFromDropzone:e[8],width:e[6],curDataset:e[0]},$$inline:!0});const r={c:function(){bt(t.$$.fragment)},m:function(s,a){dt(t,s,a),n=!0},p:function(s,a){const o={};a&64&&(o.width=s[6]),a&1&&(o.curDataset=s[0]),t.$set(o)},i:function(s){n||(_e(t.$$.fragment,s),n=!0)},o:function(s){Me(t.$$.fragment,s),n=!1},d:function(s){pt(t,s)}};return te("SvelteRegisterBlock",{block:r,id:b0.name,type:"if",source:"(361:6) {#if data === null}",ctx:e}),r}function Qo(e){let t,n,r,i;n=new U2({props:{pinnedTree:e[23],pinnedTreeStore:e[12],favoritesStore:e[9]},$$inline:!0});const s={c:function(){t=L("div"),bt(n.$$.fragment),w(t,"class","pinned-tree-window-wrapper s-DgMWn4VSIQjZ"),x(t,Be,402,6,10512)},m:function(o,c){ae(o,t,c),dt(n,t,null),i=!0},p:function(o,c){const l={};c&128&&(l.pinnedTree=o[23]),n.$set(l)},i:function(o){i||(_e(n.$$.fragment,o),r&&r.end(1),i=!0)},o:function(o){Me(n.$$.fragment,o),r=wl(t,Ii,{duration:100}),i=!1},d:function(o){o&&ee(t),pt(n),o&&r&&r.end()}};return te("SvelteRegisterBlock",{block:s,id:Qo.name,type:"if",source:"(402:4) {#if pinnedTree.isPinned}",ctx:e}),s}function Ko(e,t){let n,r,i,s=t[23].isPinned&&Qo(t);const a={key:e,first:null,c:function(){n=_s(),s&&s.c(),r=_s(),this.first=n},m:function(c,l){ae(c,n,l),s&&s.m(c,l),ae(c,r,l),i=!0},p:function(c,l){t=c,t[23].isPinned?s?(s.p(t,l),l&128&&_e(s,1)):(s=Qo(t),s.c(),_e(s,1),s.m(r.parentNode,r)):s&&(Nn(),Me(s,1,1,()=>{s=null}),Hn())},i:function(c){i||(_e(s),i=!0)},o:function(c){Me(s),i=!1},d:function(c){c&&ee(n),s&&s.d(c),c&&ee(r)}};return te("SvelteRegisterBlock",{block:a,id:Ko.name,type:"each",source:"(401:2) {#each pinnedTreeStoreValue.pinnedTrees as pinnedTree (pinnedTree.treeID)}",ctx:t}),a}function $o(e){let t,n,r,i,s,a,o,c,l,u,f,h,p,g,d,m,v,S,b,_,k,H,I,M,V,E,F,R,A,C=[],T=new vd,D,P;const G=[b0,v0],Y=[];function U(K,Q){return K[4]===null?0:1}S=U(e),b=Y[S]=G[S](e),H=new $2({props:{favoritesStore:e[9],pinnedTreeStore:e[12],width:e[6]},$$inline:!0}),V=new d0({props:{data:e[4],searchStore:e[13],width:e[6]},$$inline:!0}),R=new V2({props:{data:e[4],featureMap:e[5],treeWindowStore:e[11]},$$inline:!0});let X=e[7].pinnedTrees;De(X);const J=K=>K[23].treeID;Vs(e,X,us,J);for(let K=0;K{Y[ie]=null}),Hn(),b=Y[S],b?b.p(Q,B):(b=Y[S]=G[S](Q),b.c()),_e(b,1),b.m(v,null));const fe={};B&64&&(fe.width=Q[6]),H.$set(fe),(!P||B&8)&&w(k,"style",Q[3]);const j={};B&16&&(j.data=Q[4]),B&64&&(j.width=Q[6]),V.$set(j),(!P||B&8)&&w(M,"style",Q[3]),(!P||B&64&&E!==(E=`width: ${Q[6]}px;`))&&w(n,"style",E);const $={};B&16&&($.data=Q[4]),B&32&&($.featureMap=Q[5]),R.$set($),B&4736&&(X=Q[7].pinnedTrees,De(X),Nn(),Vs(Q,X,us,J),C=Xc(C,B,J,1,Q,X,T,t,jc,Ko,D,us),Hn())},i:function(Q){if(!P){_e(b),_e(H.$$.fragment,Q),_e(V.$$.fragment,Q),_e(R.$$.fragment,Q);for(let B=0;B{n(4,p=A),n(5,g=new Map);for(const[C,T]of Object.entries(p.featureMap))g.set(parseInt(C),T)},S=async A=>{if(A!=="my own dataset"&&(A==="car evaluation"?n(2,f=4):n(2,f=2),m.has(A))){n(16,l=!0);const C=m.get(A),T=await z.json(`/timbertrek/data/${C}`);v(T)}},b=A=>{n(4,p=A),n(5,g=new Map);for(const[C,T]of Object.entries(p.featureMap))g.set(parseInt(C),T)},_=c1(),k=u1(),H=h1(),I=f1(),M=d1();let V=Fr();I.subscribe(A=>{n(7,V=A)}),Ne(()=>{s&&document.addEventListener("timbertrekData",C=>{const T=C,D=T.data;n(6,d=T.width),v(D)});const A=Math.floor((window.innerWidth-d)/2);A<268&&n(3,h=`transform: translateX(calc(100% - ${268-A+5}px))`),n(17,u=!0)});const E=["notebookMode","curDataset","timbertrekTransitioning"];bd.keys(t).forEach(A=>{!~E.indexOf(A)&&A.slice(0,2)!=="$$"&&A!=="slot"&&console.warn(` was created with unknown prop '${A}'`)});const F=()=>{localStorage.clear()};function R(A){Je[A?"unshift":"push"](()=>{c=A,n(1,c)})}return e.$$set=A=>{"notebookMode"in A&&n(14,s=A.notebookMode),"curDataset"in A&&n(0,a=A.curDataset),"timbertrekTransitioning"in A&&n(15,o=A.timbertrekTransitioning)},e.$capture_state=()=>({onMount:Ne,fade:Ii,cubicInOut:sh,getFavoritesStore:c1,getSunburstStore:u1,getTreeWindowStore:h1,getPinnedTreeStore:f1,getPinnedTreeStoreDefaultValue:Fr,getSearchStore:d1,Toolbar:g2,Sunburst:L2,TreeWindow:V2,PinnedTreeWindow:U2,FavoritesPanel:$2,SearchPanel:d0,Dropzone:m0,d3:z,logoIcon:Da,githubIcon:y0,paperIcon:w0,notebookMode:s,curDataset:a,timbertrekTransitioning:o,component:c,initialized:l,mounted:u,initDepthGap:f,sidebarStyle:h,data:p,featureMap:g,sunburstWidth:d,devMode:Cd,datasetMap:m,initData:v,readDataFromFile:S,initDataFromDropzone:b,favoritesStore:_,sunburstStore:k,treeWindowStore:H,pinnedTreeStore:I,searchStore:M,pinnedTreeStoreValue:V}),e.$inject_state=A=>{"notebookMode"in A&&n(14,s=A.notebookMode),"curDataset"in A&&n(0,a=A.curDataset),"timbertrekTransitioning"in A&&n(15,o=A.timbertrekTransitioning),"component"in A&&n(1,c=A.component),"initialized"in A&&n(16,l=A.initialized),"mounted"in A&&n(17,u=A.mounted),"initDepthGap"in A&&n(2,f=A.initDepthGap),"sidebarStyle"in A&&n(3,h=A.sidebarStyle),"data"in A&&n(4,p=A.data),"featureMap"in A&&n(5,g=A.featureMap),"sunburstWidth"in A&&n(6,d=A.sunburstWidth),"pinnedTreeStoreValue"in A&&n(7,V=A.pinnedTreeStoreValue)},t&&"$$inject"in t&&e.$inject_state(t.$$inject),e.$$.update=()=>{e.$$.dirty&245761&&!s&&a&&!l&&u&&!o&&S(a)},[a,c,f,h,p,g,d,V,b,_,k,H,I,M,s,o,l,u,F,R]}class Na extends _t{constructor(t){super(t),Ct(this,t,Sd,$o,tt,{notebookMode:14,curDataset:0,timbertrekTransitioning:15}),te("SvelteRegisterComponent",{component:this,tagName:"Timber",options:t,id:$o.name})}get notebookMode(){throw new Error(": Props cannot be read directly from the component instance unless compiling with 'accessors: true' or ''")}set notebookMode(t){throw new Error(": Props cannot be set directly on the component instance unless compiling with 'accessors: true' or ''")}get curDataset(){throw new Error(": Props cannot be read directly from the component instance unless compiling with 'accessors: true' or ''")}set curDataset(t){throw new Error(": Props cannot be set directly on the component instance unless compiling with 'accessors: true' or ''")}get timbertrekTransitioning(){throw new Error(": Props cannot be read directly from the component instance unless compiling with 'accessors: true' or ''")}set timbertrekTransitioning(t){throw new Error(": Props cannot be set directly on the component instance unless compiling with 'accessors: true' or ''")}}const _d="src/components/article/Youtube.svelte";function el(e){let t;const n={c:function(){t=L("div"),w(t,"id",e[0]),x(t,_d,37,0,1053)},l:function(i){throw new Error("options.hydrate only works if the component was compiled with the `hydratable: true` option")},m:function(i,s){ae(i,t,s)},p:function(i,[s]){s&1&&w(t,"id",i[0])},i:pe,o:pe,d:function(i){i&&ee(t)}};return te("SvelteRegisterBlock",{block:n,id:el.name,type:"component",source:"",ctx:e}),n}let xd=!1;var Jl=document.createElement("script");Jl.src="https://www.youtube.com/iframe_api";var tl=document.getElementsByTagName("script")[0];tl.parentNode.insertBefore(Jl,tl);window.onYouTubeIframeAPIReady=()=>window.dispatchEvent(new Event("iframeApiReady"));function Ld(e,t,n){let{$$slots:r={},$$scope:i}=t;St("Youtube",r,[]);let{videoId:s}=t,{playerId:a="player"}=t,o;function c(h=0){o.seekTo(h),o.playVideo()}const l=o1();window.addEventListener("iframeApiReady",function(h){o=new YT.Player(a,{videoId:s,width:"780",height:"439",events:{onReady:u}})});function u(h){o.unMute()}e.$$.on_mount.push(function(){s===void 0&&!("videoId"in t||e.$$.bound[e.$$.props.videoId])&&console.warn(" was created without expected prop 'videoId'")});const f=["videoId","playerId"];return Object.keys(t).forEach(h=>{!~f.indexOf(h)&&h.slice(0,2)!=="$$"&&h!=="slot"&&console.warn(` was created with unknown prop '${h}'`)}),e.$$set=h=>{"videoId"in h&&n(1,s=h.videoId),"playerId"in h&&n(0,a=h.playerId)},e.$capture_state=()=>({iframeApiReady:xd,setContext:K0,onMount:Ne,tag:Jl,firstScriptTag:tl,createEventDispatcher:o1,getContext:$0,videoId:s,playerId:a,player:o,play:c,dispatch:l,onPlayerReady:u}),e.$inject_state=h=>{"videoId"in h&&n(1,s=h.videoId),"playerId"in h&&n(0,a=h.playerId),"player"in h&&(o=h.player)},t&&"$$inject"in t&&e.$inject_state(t.$$inject),[a,s,c]}class C0 extends _t{constructor(t){super(t),Ct(this,t,Ld,el,tt,{videoId:1,playerId:0,play:2}),te("SvelteRegisterComponent",{component:this,tagName:"Youtube",options:t,id:el.name})}get videoId(){throw new Error(": Props cannot be read directly from the component instance unless compiling with 'accessors: true' or ''")}set videoId(t){throw new Error(": Props cannot be set directly on the component instance unless compiling with 'accessors: true' or ''")}get playerId(){throw new Error(": Props cannot be read directly from the component instance unless compiling with 'accessors: true' or ''")}set playerId(t){throw new Error(": Props cannot be set directly on the component instance unless compiling with 'accessors: true' or ''")}get play(){return this.$$.ctx[2]}set play(t){throw new Error(": Props cannot be set directly on the component instance unless compiling with 'accessors: true' or ''")}}const S0=` +`;const{Map:wd,Object:vd}=wl,Be="src/components/timber/Timber.svelte";function cs(e,t,n){const r=e.slice();return r[23]=t[n],r}function y0(e){let t,n,r,i,s,a;n=new d2({props:{favoritesStore:e[9],sunburstStore:e[10],searchStore:e[13],sunburstWidth:e[6]},$$inline:!0}),s=new _2({props:{data:e[4],initDepthGap:e[2],sunburstStore:e[10],treeWindowStore:e[11],pinnedTreeStore:e[12],searchStore:e[13]},$$inline:!0});const o={c:function(){t=L("div"),bt(n.$$.fragment),r=W(),i=L("div"),bt(s.$$.fragment),w(t,"class","toolbar s-DgMWn4VSIQjZ"),x(t,Be,363,8,9587),w(i,"class","sunburst-wrapper s-DgMWn4VSIQjZ"),x(i,Be,372,8,9776)},m:function(l,u){ae(l,t,u),dt(n,t,null),ae(l,r,u),ae(l,i,u),dt(s,i,null),a=!0},p:function(l,u){const f={};u&64&&(f.sunburstWidth=l[6]),n.$set(f);const h={};u&16&&(h.data=l[4]),u&4&&(h.initDepthGap=l[2]),s.$set(h)},i:function(l){a||(_e(n.$$.fragment,l),_e(s.$$.fragment,l),a=!0)},o:function(l){Me(n.$$.fragment,l),Me(s.$$.fragment,l),a=!1},d:function(l){l&&ne(t),pt(n),l&&ne(r),l&&ne(i),pt(s)}};return ee("SvelteRegisterBlock",{block:o,id:y0.name,type:"else",source:"(363:6) {:else}",ctx:e}),o}function w0(e){let t,n;t=new p0({props:{initDataFromDropzone:e[8],width:e[6],curDataset:e[0]},$$inline:!0});const r={c:function(){bt(t.$$.fragment)},m:function(s,a){dt(t,s,a),n=!0},p:function(s,a){const o={};a&64&&(o.width=s[6]),a&1&&(o.curDataset=s[0]),t.$set(o)},i:function(s){n||(_e(t.$$.fragment,s),n=!0)},o:function(s){Me(t.$$.fragment,s),n=!1},d:function(s){pt(t,s)}};return ee("SvelteRegisterBlock",{block:r,id:w0.name,type:"if",source:"(361:6) {#if data === null}",ctx:e}),r}function Jo(e){let t,n,r,i;n=new Y2({props:{pinnedTree:e[23],pinnedTreeStore:e[12],favoritesStore:e[9]},$$inline:!0});const s={c:function(){t=L("div"),bt(n.$$.fragment),w(t,"class","pinned-tree-window-wrapper s-DgMWn4VSIQjZ"),x(t,Be,402,6,10512)},m:function(o,c){ae(o,t,c),dt(n,t,null),i=!0},p:function(o,c){const l={};c&128&&(l.pinnedTree=o[23]),n.$set(l)},i:function(o){i||(_e(n.$$.fragment,o),r&&r.end(1),i=!0)},o:function(o){Me(n.$$.fragment,o),r=yl(t,Ii,{duration:100}),i=!1},d:function(o){o&&ne(t),pt(n),o&&r&&r.end()}};return ee("SvelteRegisterBlock",{block:s,id:Jo.name,type:"if",source:"(402:4) {#if pinnedTree.isPinned}",ctx:e}),s}function Qo(e,t){let n,r,i,s=t[23].isPinned&&Jo(t);const a={key:e,first:null,c:function(){n=Ss(),s&&s.c(),r=Ss(),this.first=n},m:function(c,l){ae(c,n,l),s&&s.m(c,l),ae(c,r,l),i=!0},p:function(c,l){t=c,t[23].isPinned?s?(s.p(t,l),l&128&&_e(s,1)):(s=Jo(t),s.c(),_e(s,1),s.m(r.parentNode,r)):s&&(Nn(),Me(s,1,1,()=>{s=null}),Hn())},i:function(c){i||(_e(s),i=!0)},o:function(c){Me(s),i=!1},d:function(c){c&&ne(n),s&&s.d(c),c&&ne(r)}};return ee("SvelteRegisterBlock",{block:a,id:Qo.name,type:"each",source:"(401:2) {#each pinnedTreeStoreValue.pinnedTrees as pinnedTree (pinnedTree.treeID)}",ctx:t}),a}function Ko(e){let t,n,r,i,s,a,o,c,l,u,f,h,p,g,d,m,v,S,b,_,k,H,I,M,V,E,F,R,A,C=[],T=new wd,D,P;const G=[w0,y0],Y=[];function U(K,Q){return K[4]===null?0:1}S=U(e),b=Y[S]=G[S](e),H=new Q2({props:{favoritesStore:e[9],pinnedTreeStore:e[12],width:e[6]},$$inline:!0}),V=new h0({props:{data:e[4],searchStore:e[13],width:e[6]},$$inline:!0}),R=new M2({props:{data:e[4],featureMap:e[5],treeWindowStore:e[11]},$$inline:!0});let X=e[7].pinnedTrees;De(X);const J=K=>K[23].treeID;As(e,X,cs,J);for(let K=0;K{Y[ie]=null}),Hn(),b=Y[S],b?b.p(Q,B):(b=Y[S]=G[S](Q),b.c()),_e(b,1),b.m(v,null));const fe={};B&64&&(fe.width=Q[6]),H.$set(fe),(!P||B&8)&&w(k,"style",Q[3]);const j={};B&16&&(j.data=Q[4]),B&64&&(j.width=Q[6]),V.$set(j),(!P||B&8)&&w(M,"style",Q[3]),(!P||B&64&&E!==(E=`width: ${Q[6]}px;`))&&w(n,"style",E);const $={};B&16&&($.data=Q[4]),B&32&&($.featureMap=Q[5]),R.$set($),B&4736&&(X=Q[7].pinnedTrees,De(X),Nn(),As(Q,X,cs,J),C=Zc(C,B,J,1,Q,X,T,t,Uc,Qo,D,cs),Hn())},i:function(Q){if(!P){_e(b),_e(H.$$.fragment,Q),_e(V.$$.fragment,Q),_e(R.$$.fragment,Q);for(let B=0;B{n(4,p=A),n(5,g=new Map);for(const[C,T]of Object.entries(p.featureMap))g.set(parseInt(C),T)},S=async A=>{if(A!=="my own dataset"&&(A==="car evaluation"?n(2,f=4):n(2,f=2),m.has(A))){n(16,l=!0);const C=m.get(A),T=await z.json(`/timbertrek/data/${C}`);v(T)}},b=A=>{n(4,p=A),n(5,g=new Map);for(const[C,T]of Object.entries(p.featureMap))g.set(parseInt(C),T)},_=l1(),k=c1(),H=u1(),I=h1(),M=f1();let V=Hr();I.subscribe(A=>{n(7,V=A)}),Ne(()=>{s&&document.addEventListener("timbertrekData",C=>{const T=C,D=T.data;n(6,d=T.width),v(D)});const A=Math.floor((window.innerWidth-d)/2);A<268&&n(3,h=`transform: translateX(calc(100% - ${268-A+5}px))`),n(17,u=!0)});const E=["notebookMode","curDataset","timbertrekTransitioning"];vd.keys(t).forEach(A=>{!~E.indexOf(A)&&A.slice(0,2)!=="$$"&&A!=="slot"&&console.warn(` was created with unknown prop '${A}'`)});const F=()=>{localStorage.clear()};function R(A){Je[A?"unshift":"push"](()=>{c=A,n(1,c)})}return e.$$set=A=>{"notebookMode"in A&&n(14,s=A.notebookMode),"curDataset"in A&&n(0,a=A.curDataset),"timbertrekTransitioning"in A&&n(15,o=A.timbertrekTransitioning)},e.$capture_state=()=>({onMount:Ne,fade:Ii,cubicInOut:ih,getFavoritesStore:l1,getSunburstStore:c1,getTreeWindowStore:u1,getPinnedTreeStore:h1,getPinnedTreeStoreDefaultValue:Hr,getSearchStore:f1,Toolbar:d2,Sunburst:_2,TreeWindow:M2,PinnedTreeWindow:Y2,FavoritesPanel:Q2,SearchPanel:h0,Dropzone:p0,d3:z,logoIcon:Va,githubIcon:g0,paperIcon:m0,notebookMode:s,curDataset:a,timbertrekTransitioning:o,component:c,initialized:l,mounted:u,initDepthGap:f,sidebarStyle:h,data:p,featureMap:g,sunburstWidth:d,devMode:bd,datasetMap:m,initData:v,readDataFromFile:S,initDataFromDropzone:b,favoritesStore:_,sunburstStore:k,treeWindowStore:H,pinnedTreeStore:I,searchStore:M,pinnedTreeStoreValue:V}),e.$inject_state=A=>{"notebookMode"in A&&n(14,s=A.notebookMode),"curDataset"in A&&n(0,a=A.curDataset),"timbertrekTransitioning"in A&&n(15,o=A.timbertrekTransitioning),"component"in A&&n(1,c=A.component),"initialized"in A&&n(16,l=A.initialized),"mounted"in A&&n(17,u=A.mounted),"initDepthGap"in A&&n(2,f=A.initDepthGap),"sidebarStyle"in A&&n(3,h=A.sidebarStyle),"data"in A&&n(4,p=A.data),"featureMap"in A&&n(5,g=A.featureMap),"sunburstWidth"in A&&n(6,d=A.sunburstWidth),"pinnedTreeStoreValue"in A&&n(7,V=A.pinnedTreeStoreValue)},t&&"$$inject"in t&&e.$inject_state(t.$$inject),e.$$.update=()=>{e.$$.dirty&245761&&!s&&a&&!l&&u&&!o&&S(a)},[a,c,f,h,p,g,d,V,b,_,k,H,I,M,s,o,l,u,F,R]}class Da extends _t{constructor(t){super(t),Ct(this,t,Cd,Ko,tt,{notebookMode:14,curDataset:0,timbertrekTransitioning:15}),ee("SvelteRegisterComponent",{component:this,tagName:"Timber",options:t,id:Ko.name})}get notebookMode(){throw new Error(": Props cannot be read directly from the component instance unless compiling with 'accessors: true' or ''")}set notebookMode(t){throw new Error(": Props cannot be set directly on the component instance unless compiling with 'accessors: true' or ''")}get curDataset(){throw new Error(": Props cannot be read directly from the component instance unless compiling with 'accessors: true' or ''")}set curDataset(t){throw new Error(": Props cannot be set directly on the component instance unless compiling with 'accessors: true' or ''")}get timbertrekTransitioning(){throw new Error(": Props cannot be read directly from the component instance unless compiling with 'accessors: true' or ''")}set timbertrekTransitioning(t){throw new Error(": Props cannot be set directly on the component instance unless compiling with 'accessors: true' or ''")}}const Sd="src/components/article/Youtube.svelte";function $o(e){let t;const n={c:function(){t=L("div"),w(t,"id",e[0]),x(t,Sd,37,0,1053)},l:function(i){throw new Error("options.hydrate only works if the component was compiled with the `hydratable: true` option")},m:function(i,s){ae(i,t,s)},p:function(i,[s]){s&1&&w(t,"id",i[0])},i:pe,o:pe,d:function(i){i&&ne(t)}};return ee("SvelteRegisterBlock",{block:n,id:$o.name,type:"component",source:"",ctx:e}),n}let _d=!1;var ql=document.createElement("script");ql.src="https://www.youtube.com/iframe_api";var el=document.getElementsByTagName("script")[0];el.parentNode.insertBefore(ql,el);window.onYouTubeIframeAPIReady=()=>window.dispatchEvent(new Event("iframeApiReady"));function xd(e,t,n){let{$$slots:r={},$$scope:i}=t;St("Youtube",r,[]);let{videoId:s}=t,{playerId:a="player"}=t,o;function c(h=0){o.seekTo(h),o.playVideo()}const l=a1();window.addEventListener("iframeApiReady",function(h){o=new YT.Player(a,{videoId:s,width:"780",height:"439",events:{onReady:u}})});function u(h){o.unMute()}e.$$.on_mount.push(function(){s===void 0&&!("videoId"in t||e.$$.bound[e.$$.props.videoId])&&console.warn(" was created without expected prop 'videoId'")});const f=["videoId","playerId"];return Object.keys(t).forEach(h=>{!~f.indexOf(h)&&h.slice(0,2)!=="$$"&&h!=="slot"&&console.warn(` was created with unknown prop '${h}'`)}),e.$$set=h=>{"videoId"in h&&n(1,s=h.videoId),"playerId"in h&&n(0,a=h.playerId)},e.$capture_state=()=>({iframeApiReady:_d,setContext:Q0,onMount:Ne,tag:ql,firstScriptTag:el,createEventDispatcher:a1,getContext:K0,videoId:s,playerId:a,player:o,play:c,dispatch:l,onPlayerReady:u}),e.$inject_state=h=>{"videoId"in h&&n(1,s=h.videoId),"playerId"in h&&n(0,a=h.playerId),"player"in h&&(o=h.player)},t&&"$$inject"in t&&e.$inject_state(t.$$inject),[a,s,c]}class v0 extends _t{constructor(t){super(t),Ct(this,t,xd,$o,tt,{videoId:1,playerId:0,play:2}),ee("SvelteRegisterComponent",{component:this,tagName:"Youtube",options:t,id:$o.name})}get videoId(){throw new Error(": Props cannot be read directly from the component instance unless compiling with 'accessors: true' or ''")}set videoId(t){throw new Error(": Props cannot be set directly on the component instance unless compiling with 'accessors: true' or ''")}get playerId(){throw new Error(": Props cannot be read directly from the component instance unless compiling with 'accessors: true' or ''")}set playerId(t){throw new Error(": Props cannot be set directly on the component instance unless compiling with 'accessors: true' or ''")}get play(){return this.$$.ctx[2]}set play(t){throw new Error(": Props cannot be set directly on the component instance unless compiling with 'accessors: true' or ''")}}const b0=` @@ -224,7 +224,7 @@ var W0=Object.defineProperty;var O0=(e,t,n)=>t in e?W0(e,t,{enumerable:!0,config -`,_0='',x0='',L0=` +`,C0='',S0='',_0=` @@ -282,7 +282,7 @@ var W0=Object.defineProperty;var O0=(e,t,n)=>t in e?W0(e,t,{enumerable:!0,config -`,k0=` +`,x0=` @@ -316,7 +316,7 @@ var W0=Object.defineProperty;var O0=(e,t,n)=>t in e?W0(e,t,{enumerable:!0,config -`,T0=` +`,L0=` @@ -327,7 +327,7 @@ var W0=Object.defineProperty;var O0=(e,t,n)=>t in e?W0(e,t,{enumerable:!0,config -`,M0=` +`,k0=` @@ -463,7 +463,7 @@ var W0=Object.defineProperty;var O0=(e,t,n)=>t in e?W0(e,t,{enumerable:!0,config -`,A0=` +`,T0=` @@ -475,7 +475,7 @@ var W0=Object.defineProperty;var O0=(e,t,n)=>t in e?W0(e,t,{enumerable:!0,config -`,V0=` +`,M0=` @@ -517,7 +517,7 @@ var W0=Object.defineProperty;var O0=(e,t,n)=>t in e?W0(e,t,{enumerable:!0,config `,paperLink:`https://arxiv.org/abs/2209.09227 `,venue:`IEEE Visualization Conference (VIS) 2022 `,venueLink:`https://ieeevis.org/year/2022/welcome -`,authors:[{name:"Zijie J. Wang",url:"https://zijie.wang/"},{name:"Chudi Zhong",url:"https://www.linkedin.com/in/chudizhong"},{name:"Rui Xin",url:"https://www.linkedin.com/in/rui-xin-8070181b9"},{name:"Takuya Takagi",url:"https://scholar.google.com/citations?user=9fY1WVIAAAAJ&hl=en"},{name:"Zhi Chen",url:"https://users.cs.duke.edu/~zhichen/"},{name:"Polo Chau",url:"https://www.cc.gatech.edu/~dchau"},{name:"Cynthia Rudin",url:"https://users.cs.duke.edu/~cynthia/"},{name:"Margo Seltzer",url:"https://www.seltzer.com/margo/"}]}};be.tool;be.usage;be.tutorial;be.development;be.team;be.contribute;be.youtubeTimes;be.cite;const q="src/components/article/Article.svelte";function Tc(e,t,n){const r=e.slice();return r[20]=t[n],r[22]=n,r}function Mc(e,t,n){const r=e.slice();return r[23]=t[n],r[22]=n,r}function Ac(e,t,n){const r=e.slice();return r[25]=t[n],r[22]=n,r}function Vc(e,t,n){const r=e.slice();return r[27]=t[n],r}function Dc(e,t,n){const r=e.slice();return r[27]=t[n],r}function Nc(e,t,n){const r=e.slice();return r[32]=t[n],r[22]=n,r}function nl(e){let t,n,r,i,s,a,o;n=new Na({props:{notebookMode:!1,curDataset:e[2],timbertrekTransitioning:e[3]},$$inline:!0});const c={c:function(){t=L("div"),bt(n.$$.fragment),w(t,"class","timbertrek-wrapper s-NAp586LyR7ay"),x(t,q,564,8,12410)},m:function(u,f){ae(u,t,f),dt(n,t,null),s=!0,a||(o=[he(t,"introstart",e[9],!1,!1,!1),he(t,"introend",e[10],!1,!1,!1)],a=!0)},p:function(u,f){const h={};f[0]&4&&(h.curDataset=u[2]),f[0]&8&&(h.timbertrekTransitioning=u[3]),n.$set(h)},i:function(u){s||(_e(n.$$.fragment,u),Dr(()=>{i&&i.end(1),r=th(t,lo,{x:300,duration:300}),r.start()}),s=!0)},o:function(u){Me(n.$$.fragment,u),r&&r.invalidate(),i=wl(t,lo,{x:-300,duration:300}),s=!1},d:function(u){u&&ee(t),pt(n),u&&i&&i.end(),a=!1,Re(o)}};return te("SvelteRegisterBlock",{block:c,id:nl.name,type:"key",source:"(564:6) {#key curDataset}",ctx:e}),c}function rl(e){let t,n=e[32]+"",r,i,s,a;function o(){return e[11](e[32])}const c={c:function(){t=L("span"),r=ce(n),i=W(),w(t,"class","option s-NAp586LyR7ay"),w(t,"data-text",e[32]),ge(t,"selected",e[32]===e[2]),x(t,q,588,10,13075)},m:function(u,f){ae(u,t,f),y(t,r),y(t,i),s||(a=he(t,"click",o,!1,!1,!1),s=!0)},p:function(u,f){e=u,f[0]&132&&ge(t,"selected",e[32]===e[2])},d:function(u){u&&ee(t),s=!1,a()}};return te("SvelteRegisterBlock",{block:c,id:rl.name,type:"each",source:"(588:8) {#each datasets as name, i}",ctx:e}),c}function il(e){let t,n=e[27]+"";const r={c:function(){t=L("p"),w(t,"class","s-NAp586LyR7ay"),x(t,q,612,6,13686)},m:function(s,a){ae(s,t,a),t.innerHTML=n},p:pe,d:function(s){s&&ee(t)}};return te("SvelteRegisterBlock",{block:r,id:il.name,type:"each",source:"(612:4) {#each text.tool as p}",ctx:e}),r}function D0(e){let t,n,r,i,s,a,o,c,l,u,f;const h={c:function(){t=L("div"),n=L("div"),r=W(),i=L("img"),a=W(),o=L("div"),c=L("span"),l=ce(`Launch Jupyter - Notebook`),w(n,"class","mask s-NAp586LyR7ay"),x(n,q,638,10,14399),w(i,"alt","Jupyter notebook place holder"),Vr(i.src,s="/timbertrek/data/jupyter-placeholder.png")||w(i,"src",s),w(i,"class","s-NAp586LyR7ay"),x(i,q,639,10,14430),w(c,"class","svg-icon s-NAp586LyR7ay"),x(c,q,649,12,14716),w(o,"class","button s-NAp586LyR7ay"),x(o,q,643,10,14582),w(t,"class","demo-placeholder s-NAp586LyR7ay"),x(t,q,632,8,14267)},m:function(g,d){ae(g,t,d),y(t,n),y(t,r),y(t,i),y(t,a),y(t,o),y(o,c),c.innerHTML=_0,y(o,l),u||(f=[he(o,"click",e[13],!1,!1,!1),he(t,"click",e[14],!1,!1,!1)],u=!0)},p:pe,d:function(g){g&&ee(t),u=!1,Re(f)}};return te("SvelteRegisterBlock",{block:h,id:D0.name,type:"else",source:"(632:6) {:else}",ctx:e}),h}function N0(e){let t,n;const r={c:function(){t=L("iframe"),w(t,"title","Jupyter notebook"),Vr(t.src,n="https://poloclub.github.io/timbertrek/notebook/retro/notebooks/?path=campas.ipynb")||w(t,"src",n),w(t,"width","100%"),w(t,"height","100%"),w(t,"class","s-NAp586LyR7ay"),x(t,q,625,8,14046)},m:function(s,a){ae(s,t,a)},p:pe,d:function(s){s&&ee(t)}};return te("SvelteRegisterBlock",{block:r,id:N0.name,type:"if",source:"(625:6) {#if showIFrame}",ctx:e}),r}function sl(e){let t,n=e[27]+"";const r={c:function(){t=L("p"),w(t,"class","s-NAp586LyR7ay"),x(t,q,674,8,15510)},m:function(s,a){ae(s,t,a),t.innerHTML=n},p:pe,d:function(s){s&&ee(t)}};return te("SvelteRegisterBlock",{block:r,id:sl.name,type:"each",source:"(674:6) {#each item.descriptions.slice(1) as p}",ctx:e}),r}function al(e){let t,n=e[25].name+"",r,i,s,a=e[25].descriptions[0]+"",o,c,l,u,f,h,p,g,d,m=e[22]+1+"",v,S,b,_=e[25].caption+"",k,H,I=e[25].descriptions.slice(1);De(I);let M=[];for(let E=0;E{i&&i.end(1),r=eh(t,oo,{x:300,duration:300}),r.start()}),s=!0)},o:function(u){Me(n.$$.fragment,u),r&&r.invalidate(),i=yl(t,oo,{x:-300,duration:300}),s=!1},d:function(u){u&&ne(t),pt(n),u&&i&&i.end(),a=!1,Re(o)}};return ee("SvelteRegisterBlock",{block:c,id:tl.name,type:"key",source:"(564:6) {#key curDataset}",ctx:e}),c}function nl(e){let t,n=e[32]+"",r,i,s,a;function o(){return e[11](e[32])}const c={c:function(){t=L("span"),r=ce(n),i=W(),w(t,"class","option s-NAp586LyR7ay"),w(t,"data-text",e[32]),ge(t,"selected",e[32]===e[2]),x(t,q,588,10,13075)},m:function(u,f){ae(u,t,f),y(t,r),y(t,i),s||(a=he(t,"click",o,!1,!1,!1),s=!0)},p:function(u,f){e=u,f[0]&132&&ge(t,"selected",e[32]===e[2])},d:function(u){u&&ne(t),s=!1,a()}};return ee("SvelteRegisterBlock",{block:c,id:nl.name,type:"each",source:"(588:8) {#each datasets as name, i}",ctx:e}),c}function rl(e){let t,n=e[27]+"";const r={c:function(){t=L("p"),w(t,"class","s-NAp586LyR7ay"),x(t,q,612,6,13686)},m:function(s,a){ae(s,t,a),t.innerHTML=n},p:pe,d:function(s){s&&ne(t)}};return ee("SvelteRegisterBlock",{block:r,id:rl.name,type:"each",source:"(612:4) {#each text.tool as p}",ctx:e}),r}function A0(e){let t,n,r,i,s,a,o,c,l,u,f;const h={c:function(){t=L("div"),n=L("div"),r=W(),i=L("img"),a=W(),o=L("div"),c=L("span"),l=ce(`Launch Jupyter + Notebook`),w(n,"class","mask s-NAp586LyR7ay"),x(n,q,638,10,14399),w(i,"alt","Jupyter notebook place holder"),Ar(i.src,s="/timbertrek/data/jupyter-placeholder.png")||w(i,"src",s),w(i,"class","s-NAp586LyR7ay"),x(i,q,639,10,14430),w(c,"class","svg-icon s-NAp586LyR7ay"),x(c,q,649,12,14716),w(o,"class","button s-NAp586LyR7ay"),x(o,q,643,10,14582),w(t,"class","demo-placeholder s-NAp586LyR7ay"),x(t,q,632,8,14267)},m:function(g,d){ae(g,t,d),y(t,n),y(t,r),y(t,i),y(t,a),y(t,o),y(o,c),c.innerHTML=C0,y(o,l),u||(f=[he(o,"click",e[13],!1,!1,!1),he(t,"click",e[14],!1,!1,!1)],u=!0)},p:pe,d:function(g){g&&ne(t),u=!1,Re(f)}};return ee("SvelteRegisterBlock",{block:h,id:A0.name,type:"else",source:"(632:6) {:else}",ctx:e}),h}function V0(e){let t,n;const r={c:function(){t=L("iframe"),w(t,"title","Jupyter notebook"),Ar(t.src,n="https://poloclub.github.io/timbertrek/notebook/retro/notebooks/?path=campas.ipynb")||w(t,"src",n),w(t,"width","100%"),w(t,"height","100%"),w(t,"class","s-NAp586LyR7ay"),x(t,q,625,8,14046)},m:function(s,a){ae(s,t,a)},p:pe,d:function(s){s&&ne(t)}};return ee("SvelteRegisterBlock",{block:r,id:V0.name,type:"if",source:"(625:6) {#if showIFrame}",ctx:e}),r}function il(e){let t,n=e[27]+"";const r={c:function(){t=L("p"),w(t,"class","s-NAp586LyR7ay"),x(t,q,674,8,15510)},m:function(s,a){ae(s,t,a),t.innerHTML=n},p:pe,d:function(s){s&&ne(t)}};return ee("SvelteRegisterBlock",{block:r,id:il.name,type:"each",source:"(674:6) {#each item.descriptions.slice(1) as p}",ctx:e}),r}function sl(e){let t,n=e[25].name+"",r,i,s,a=e[25].descriptions[0]+"",o,c,l,u,f,h,p,g,d,m=e[22]+1+"",v,S,b,_=e[25].caption+"",k,H,I=e[25].descriptions.slice(1);De(I);let M=[];for(let E=0;E{n(3,c=!0),n(2,o=E)};Ne(()=>{});const g=[];Object.keys(t).forEach(E=>{!~g.indexOf(E)&&E.slice(0,2)!=="$$"&&E!=="slot"&&console.warn(`
was created with unknown prop '${E}'`)});const d=()=>{n(3,c=!0)},m=()=>{n(3,c=!1)},v=E=>p(E);function S(E){Je[E?"unshift":"push"](()=>{s=E,n(0,s)})}const b=()=>{n(4,l=!0)},_=()=>{n(4,l=!0)};function k(E){Je[E?"unshift":"push"](()=>{a=E,n(1,a)})}const H=()=>{navigator.clipboard.writeText(be.cite.bibtex).then(()=>{n(5,u=!0)})},I=()=>{setTimeout(()=>{n(5,u=!1)},500)},M=()=>{n(6,f=!0)},V=()=>{n(6,f=!1)};return e.$capture_state=()=>({onMount:Ne,TimberTrek:Na,Youtube:C0,fade:Ii,fly:lo,iconLogo:S0,iconRocket:_0,iconNote:x0,iconGT:L0,iconFujitsu:k0,iconDuke:T0,iconUBC:M0,iconCopy:A0,iconCheckBox:V0,text:be,component:s,currentPlayer:a,curDataset:o,timbertrekTransitioning:c,showIFrame:l,bibtexCopied:u,bibtexHovering:f,datasets:h,optionClicked:p}),e.$inject_state=E=>{"component"in E&&n(0,s=E.component),"currentPlayer"in E&&n(1,a=E.currentPlayer),"curDataset"in E&&n(2,o=E.curDataset),"timbertrekTransitioning"in E&&n(3,c=E.timbertrekTransitioning),"showIFrame"in E&&n(4,l=E.showIFrame),"bibtexCopied"in E&&n(5,u=E.bibtexCopied),"bibtexHovering"in E&&n(6,f=E.bibtexHovering)},t&&"$$inject"in t&&e.$inject_state(t.$$inject),[s,a,o,c,l,u,f,h,p,d,m,v,S,b,_,k,H,I,M,V]}class P0 extends _t{constructor(t){super(t),Ct(this,t,kd,cl,tt,{},null,[-1,-1]),te("SvelteRegisterComponent",{component:this,tagName:"Article",options:t,id:cl.name})}}const Hc="src/components/notebook/Notebook.svelte";function ul(e){let t,n,r,i;r=new Na({props:{notebookMode:!0},$$inline:!0});const s={c:function(){t=L("div"),n=L("div"),bt(r.$$.fragment),w(n,"class","main-app s-G67tNxa3tjK8"),x(n,Hc,22,2,434),w(t,"class","notebook-page s-G67tNxa3tjK8"),x(t,Hc,21,0,404)},l:function(o){throw new Error("options.hydrate only works if the component was compiled with the `hydratable: true` option")},m:function(o,c){ae(o,t,c),y(t,n),dt(r,n,null),e[1](n),i=!0},p:pe,i:function(o){i||(_e(r.$$.fragment,o),i=!0)},o:function(o){Me(r.$$.fragment,o),i=!1},d:function(o){o&&ee(t),pt(r),e[1](null)}};return te("SvelteRegisterBlock",{block:s,id:ul.name,type:"component",source:"",ctx:e}),s}function Td(e,t,n){let{$$slots:r={},$$scope:i}=t;St("Notebook",r,[]);let s=null;const a=[];Object.keys(t).forEach(c=>{!~a.indexOf(c)&&c.slice(0,2)!=="$$"&&c!=="slot"&&console.warn(` was created with unknown prop '${c}'`)});function o(c){Je[c?"unshift":"push"](()=>{s=c,n(0,s)})}return e.$capture_state=()=>({onMount:Ne,TimberTrek:Na,component:s}),e.$inject_state=c=>{"component"in c&&n(0,s=c.component)},t&&"$$inject"in t&&e.$inject_state(t.$$inject),[s,o]}class R0 extends _t{constructor(t){super(t),Ct(this,t,Td,ul,tt,{}),te("SvelteRegisterComponent",{component:this,tagName:"Notebook",options:t,id:ul.name})}}const wr="src/App.svelte";function I0(e){let t,n;t=new R0({$$inline:!0});const r={c:function(){bt(t.$$.fragment)},m:function(s,a){dt(t,s,a),n=!0},i:function(s){n||(_e(t.$$.fragment,s),n=!0)},o:function(s){Me(t.$$.fragment,s),n=!1},d:function(s){pt(t,s)}};return te("SvelteRegisterBlock",{block:r,id:I0.name,type:"else",source:"(29:2) {:else}",ctx:e}),r}function E0(e){let t,n,r,i;r=new P0({$$inline:!0});const s={c:function(){t=L("recommender-overlay"),n=W(),bt(r.$$.fragment),ji(t,"my-brand","TimberTrek"),ji(t,"position-left","20"),ji(t,"display-delay","30000"),ji(t,"class","s-XsEmFtvddWTw"),x(t,wr,22,4,665)},m:function(o,c){ae(o,t,c),ae(o,n,c),dt(r,o,c),i=!0},i:function(o){i||(_e(r.$$.fragment,o),i=!0)},o:function(o){Me(r.$$.fragment,o),i=!1},d:function(o){o&&ee(t),o&&ee(n),pt(r,o)}};return te("SvelteRegisterBlock",{block:s,id:E0.name,type:"if",source:"(22:2) {#if mode === 'article'}",ctx:e}),s}function hl(e){let t,n,r,i,s,a,o,c,l,u;const f=[E0,I0],h=[];function p(d,m){return d[0]==="article"?0:1}c=p(e),l=h[c]=f[c](e);const g={c:function(){t=L("link"),n=L("link"),r=L("link"),i=L("script"),a=W(),o=L("div"),l.c(),w(t,"rel","preconnect"),w(t,"href","https://fonts.googleapis.com"),w(t,"class","s-XsEmFtvddWTw"),x(t,wr,8,2,228),w(n,"rel","preconnect"),w(n,"href","https://fonts.gstatic.com"),w(n,"crossorigin",""),w(n,"class","s-XsEmFtvddWTw"),x(n,wr,9,2,292),w(r,"href","https://fonts.googleapis.com/css2?family=Lato&display=swap"),w(r,"rel","stylesheet"),w(r,"class","s-XsEmFtvddWTw"),x(r,wr,10,2,365),w(i,"type","module"),Vr(i.src,s="https://unpkg.com/recommender-overlay/dist/recommender-overlay.es.js")||w(i,"src",s),w(i,"class","s-XsEmFtvddWTw"),x(i,wr,14,2,469),w(o,"class","stand-alone-page s-XsEmFtvddWTw"),x(o,wr,20,0,603)},l:function(m){throw new Error("options.hydrate only works if the component was compiled with the `hydratable: true` option")},m:function(m,v){y(document.head,t),y(document.head,n),y(document.head,r),y(document.head,i),ae(m,a,v),ae(m,o,v),h[c].m(o,null),u=!0},p:function(m,[v]){let S=c;c=p(m),c!==S&&(Nn(),Me(h[S],1,1,()=>{h[S]=null}),Hn(),l=h[c],l||(l=h[c]=f[c](m),l.c()),_e(l,1),l.m(o,null))},i:function(m){u||(_e(l),u=!0)},o:function(m){Me(l),u=!1},d:function(m){ee(t),ee(n),ee(r),ee(i),m&&ee(a),m&&ee(o),h[c].d()}};return te("SvelteRegisterBlock",{block:g,id:hl.name,type:"component",source:"",ctx:e}),g}function Md(e,t,n){let{$$slots:r={},$$scope:i}=t;St("App",r,[]);let{mode:s="article"}=t;const a=["mode"];return Object.keys(t).forEach(o=>{!~a.indexOf(o)&&o.slice(0,2)!=="$$"&&o!=="slot"&&console.warn(` was created with unknown prop '${o}'`)}),e.$$set=o=>{"mode"in o&&n(0,s=o.mode)},e.$capture_state=()=>({Article:P0,Notebook:R0,mode:s}),e.$inject_state=o=>{"mode"in o&&n(0,s=o.mode)},t&&"$$inject"in t&&e.$inject_state(t.$$inject),[s]}class Ad extends _t{constructor(t){super(t),Ct(this,t,Md,hl,tt,{mode:0}),te("SvelteRegisterComponent",{component:this,tagName:"App",options:t,id:hl.name})}get mode(){throw new Error(": Props cannot be read directly from the component instance unless compiling with 'accessors: true' or ''")}set mode(t){throw new Error(": Props cannot be set directly on the component instance unless compiling with 'accessors: true' or ''")}}new Ad({target:document.body,props:{mode:"article"}}); + cells).`),me=W(),K=L("div"),Yt.c(),Q=W(),B=L("h2"),ie=ce("What Can I do with "),fe=L("span"),fe.textContent="TimberTrek",j=ce("?"),$=W(),oe=L("p"),we=W();for(let le=0;le{n(3,c=!0),n(2,o=E)};Ne(()=>{});const g=[];Object.keys(t).forEach(E=>{!~g.indexOf(E)&&E.slice(0,2)!=="$$"&&E!=="slot"&&console.warn(`
was created with unknown prop '${E}'`)});const d=()=>{n(3,c=!0)},m=()=>{n(3,c=!1)},v=E=>p(E);function S(E){Je[E?"unshift":"push"](()=>{s=E,n(0,s)})}const b=()=>{n(4,l=!0)},_=()=>{n(4,l=!0)};function k(E){Je[E?"unshift":"push"](()=>{a=E,n(1,a)})}const H=()=>{navigator.clipboard.writeText(be.cite.bibtex).then(()=>{n(5,u=!0)})},I=()=>{setTimeout(()=>{n(5,u=!1)},500)},M=()=>{n(6,f=!0)},V=()=>{n(6,f=!1)};return e.$capture_state=()=>({onMount:Ne,TimberTrek:Da,Youtube:v0,fade:Ii,fly:oo,iconLogo:b0,iconRocket:C0,iconNote:S0,iconGT:_0,iconFujitsu:x0,iconDuke:L0,iconUBC:k0,iconCopy:T0,iconCheckBox:M0,text:be,component:s,currentPlayer:a,curDataset:o,timbertrekTransitioning:c,showIFrame:l,bibtexCopied:u,bibtexHovering:f,datasets:h,optionClicked:p}),e.$inject_state=E=>{"component"in E&&n(0,s=E.component),"currentPlayer"in E&&n(1,a=E.currentPlayer),"curDataset"in E&&n(2,o=E.curDataset),"timbertrekTransitioning"in E&&n(3,c=E.timbertrekTransitioning),"showIFrame"in E&&n(4,l=E.showIFrame),"bibtexCopied"in E&&n(5,u=E.bibtexCopied),"bibtexHovering"in E&&n(6,f=E.bibtexHovering)},t&&"$$inject"in t&&e.$inject_state(t.$$inject),[s,a,o,c,l,u,f,h,p,d,m,v,S,b,_,k,H,I,M,V]}class H0 extends _t{constructor(t){super(t),Ct(this,t,Ld,ll,tt,{},null,[-1,-1]),ee("SvelteRegisterComponent",{component:this,tagName:"Article",options:t,id:ll.name})}}const Nc="src/components/notebook/Notebook.svelte";function cl(e){let t,n,r,i;r=new Da({props:{notebookMode:!0},$$inline:!0});const s={c:function(){t=L("div"),n=L("div"),bt(r.$$.fragment),w(n,"class","main-app s-G67tNxa3tjK8"),x(n,Nc,22,2,434),w(t,"class","notebook-page s-G67tNxa3tjK8"),x(t,Nc,21,0,404)},l:function(o){throw new Error("options.hydrate only works if the component was compiled with the `hydratable: true` option")},m:function(o,c){ae(o,t,c),y(t,n),dt(r,n,null),e[1](n),i=!0},p:pe,i:function(o){i||(_e(r.$$.fragment,o),i=!0)},o:function(o){Me(r.$$.fragment,o),i=!1},d:function(o){o&&ne(t),pt(r),e[1](null)}};return ee("SvelteRegisterBlock",{block:s,id:cl.name,type:"component",source:"",ctx:e}),s}function kd(e,t,n){let{$$slots:r={},$$scope:i}=t;St("Notebook",r,[]);let s=null;const a=[];Object.keys(t).forEach(c=>{!~a.indexOf(c)&&c.slice(0,2)!=="$$"&&c!=="slot"&&console.warn(` was created with unknown prop '${c}'`)});function o(c){Je[c?"unshift":"push"](()=>{s=c,n(0,s)})}return e.$capture_state=()=>({onMount:Ne,TimberTrek:Da,component:s}),e.$inject_state=c=>{"component"in c&&n(0,s=c.component)},t&&"$$inject"in t&&e.$inject_state(t.$$inject),[s,o]}class F0 extends _t{constructor(t){super(t),Ct(this,t,kd,cl,tt,{}),ee("SvelteRegisterComponent",{component:this,tagName:"Notebook",options:t,id:cl.name})}}const ui="src/App.svelte";function P0(e){let t,n;t=new F0({$$inline:!0});const r={c:function(){bt(t.$$.fragment)},m:function(s,a){dt(t,s,a),n=!0},i:function(s){n||(_e(t.$$.fragment,s),n=!0)},o:function(s){Me(t.$$.fragment,s),n=!1},d:function(s){pt(t,s)}};return ee("SvelteRegisterBlock",{block:r,id:P0.name,type:"else",source:"(29:2) {:else}",ctx:e}),r}function R0(e){let t,n;t=new H0({$$inline:!0});const r={c:function(){bt(t.$$.fragment)},m:function(s,a){dt(t,s,a),n=!0},i:function(s){n||(_e(t.$$.fragment,s),n=!0)},o:function(s){Me(t.$$.fragment,s),n=!1},d:function(s){pt(t,s)}};return ee("SvelteRegisterBlock",{block:r,id:R0.name,type:"if",source:"(22:2) {#if mode === 'article'}",ctx:e}),r}function ul(e){let t,n,r,i,s,a,o,c,l,u;const f=[R0,P0],h=[];function p(d,m){return d[0]==="article"?0:1}c=p(e),l=h[c]=f[c](e);const g={c:function(){t=L("link"),n=L("link"),r=L("link"),i=L("script"),a=W(),o=L("div"),l.c(),w(t,"rel","preconnect"),w(t,"href","https://fonts.googleapis.com"),w(t,"class","s-XsEmFtvddWTw"),x(t,ui,8,2,228),w(n,"rel","preconnect"),w(n,"href","https://fonts.gstatic.com"),w(n,"crossorigin",""),w(n,"class","s-XsEmFtvddWTw"),x(n,ui,9,2,292),w(r,"href","https://fonts.googleapis.com/css2?family=Lato&display=swap"),w(r,"rel","stylesheet"),w(r,"class","s-XsEmFtvddWTw"),x(r,ui,10,2,365),w(i,"type","module"),Ar(i.src,s="https://unpkg.com/recommender-overlay/dist/recommender-overlay.es.js")||w(i,"src",s),w(i,"class","s-XsEmFtvddWTw"),x(i,ui,14,2,469),w(o,"class","stand-alone-page s-XsEmFtvddWTw"),x(o,ui,20,0,603)},l:function(m){throw new Error("options.hydrate only works if the component was compiled with the `hydratable: true` option")},m:function(m,v){y(document.head,t),y(document.head,n),y(document.head,r),y(document.head,i),ae(m,a,v),ae(m,o,v),h[c].m(o,null),u=!0},p:function(m,[v]){let S=c;c=p(m),c!==S&&(Nn(),Me(h[S],1,1,()=>{h[S]=null}),Hn(),l=h[c],l||(l=h[c]=f[c](m),l.c()),_e(l,1),l.m(o,null))},i:function(m){u||(_e(l),u=!0)},o:function(m){Me(l),u=!1},d:function(m){ne(t),ne(n),ne(r),ne(i),m&&ne(a),m&&ne(o),h[c].d()}};return ee("SvelteRegisterBlock",{block:g,id:ul.name,type:"component",source:"",ctx:e}),g}function Td(e,t,n){let{$$slots:r={},$$scope:i}=t;St("App",r,[]);let{mode:s="article"}=t;const a=["mode"];return Object.keys(t).forEach(o=>{!~a.indexOf(o)&&o.slice(0,2)!=="$$"&&o!=="slot"&&console.warn(` was created with unknown prop '${o}'`)}),e.$$set=o=>{"mode"in o&&n(0,s=o.mode)},e.$capture_state=()=>({Article:H0,Notebook:F0,mode:s}),e.$inject_state=o=>{"mode"in o&&n(0,s=o.mode)},t&&"$$inject"in t&&e.$inject_state(t.$$inject),[s]}class Md extends _t{constructor(t){super(t),Ct(this,t,Td,ul,tt,{mode:0}),ee("SvelteRegisterComponent",{component:this,tagName:"App",options:t,id:ul.name})}get mode(){throw new Error(": Props cannot be read directly from the component instance unless compiling with 'accessors: true' or ''")}set mode(t){throw new Error(": Props cannot be set directly on the component instance unless compiling with 'accessors: true' or ''")}}new Md({target:document.body,props:{mode:"article"}}); diff --git a/index.html b/index.html index 73d054b..1bf2051 100644 --- a/index.html +++ b/index.html @@ -6,7 +6,7 @@
TimberTrek - +