UNPKG

@nightingale-elements/nightingale-new-core

Version:
23 lines 89.8 kB
function t(t,e,n,i){var r,o=arguments.length,s=o<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,n,i);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(s=(o<3?r(s):o>3?r(e,n,s):r(e,n))||s);return o>3&&s&&Object.defineProperty(e,n,s),s}function e(t,e,n,i){if("a"===n&&!i)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof e?t!==e||!i:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===n?i:"a"===n?i.call(t):i?i.value:e.get(t)}function n(t,e,n,i,r){if("m"===i)throw new TypeError("Private method is not writable");if("a"===i&&!r)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof e?t!==e||!r:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===i?r.call(t,n):r?r.value=n:e.set(t,n),n}"function"==typeof SuppressedError&&SuppressedError; /** * @license * Copyright 2017 Google LLC * SPDX-License-Identifier: BSD-3-Clause */ const i=t=>(e,n)=>{void 0!==n?n.addInitializer((()=>{customElements.define(t,e)})):customElements.define(t,e)} /** * @license * Copyright 2019 Google LLC * SPDX-License-Identifier: BSD-3-Clause */,r=globalThis,o=r.ShadowRoot&&(void 0===r.ShadyCSS||r.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,s=Symbol(),a=new WeakMap;let h=class{constructor(t,e,n){if(this._$cssResult$=!0,n!==s)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=t,this.t=e}get styleSheet(){let t=this.o;const e=this.t;if(o&&void 0===t){const n=void 0!==e&&1===e.length;n&&(t=a.get(e)),void 0===t&&((this.o=t=new CSSStyleSheet).replaceSync(this.cssText),n&&a.set(e,t))}return t}toString(){return this.cssText}};const l=o?t=>t:t=>t instanceof CSSStyleSheet?(t=>{let e="";for(const n of t.cssRules)e+=n.cssText;return(t=>new h("string"==typeof t?t:t+"",void 0,s))(e)})(t):t /** * @license * Copyright 2017 Google LLC * SPDX-License-Identifier: BSD-3-Clause */,{is:u,defineProperty:c,getOwnPropertyDescriptor:f,getOwnPropertyNames:d,getOwnPropertySymbols:p,getPrototypeOf:g}=Object,m=globalThis,v=m.trustedTypes,y=v?v.emptyScript:"",_=m.reactiveElementPolyfillSupport,w=(t,e)=>t,b={toAttribute(t,e){switch(e){case Boolean:t=t?y:null;break;case Object:case Array:t=null==t?t:JSON.stringify(t)}return t},fromAttribute(t,e){let n=t;switch(e){case Boolean:n=null!==t;break;case Number:n=null===t?null:Number(t);break;case Object:case Array:try{n=JSON.parse(t)}catch(t){n=null}}return n}},$=(t,e)=>!u(t,e),x={attribute:!0,type:String,converter:b,reflect:!1,hasChanged:$};Symbol.metadata??=Symbol("metadata"),m.litPropertyMetadata??=new WeakMap;class A extends HTMLElement{static addInitializer(t){this._$Ei(),(this.l??=[]).push(t)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(t,e=x){if(e.state&&(e.attribute=!1),this._$Ei(),this.elementProperties.set(t,e),!e.noAccessor){const n=Symbol(),i=this.getPropertyDescriptor(t,n,e);void 0!==i&&c(this.prototype,t,i)}}static getPropertyDescriptor(t,e,n){const{get:i,set:r}=f(this.prototype,t)??{get(){return this[e]},set(t){this[e]=t}};return{get(){return i?.call(this)},set(e){const o=i?.call(this);r.call(this,e),this.requestUpdate(t,o,n)},configurable:!0,enumerable:!0}}static getPropertyOptions(t){return this.elementProperties.get(t)??x}static _$Ei(){if(this.hasOwnProperty(w("elementProperties")))return;const t=g(this);t.finalize(),void 0!==t.l&&(this.l=[...t.l]),this.elementProperties=new Map(t.elementProperties)}static finalize(){if(this.hasOwnProperty(w("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(w("properties"))){const t=this.properties,e=[...d(t),...p(t)];for(const n of e)this.createProperty(n,t[n])}const t=this[Symbol.metadata];if(null!==t){const e=litPropertyMetadata.get(t);if(void 0!==e)for(const[t,n]of e)this.elementProperties.set(t,n)}this._$Eh=new Map;for(const[t,e]of this.elementProperties){const n=this._$Eu(t,e);void 0!==n&&this._$Eh.set(n,t)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(t){const e=[];if(Array.isArray(t)){const n=new Set(t.flat(1/0).reverse());for(const t of n)e.unshift(l(t))}else void 0!==t&&e.push(l(t));return e}static _$Eu(t,e){const n=e.attribute;return!1===n?void 0:"string"==typeof n?n:"string"==typeof t?t.toLowerCase():void 0}constructor(){super(),this._$Ep=void 0,this.isUpdatePending=!1,this.hasUpdated=!1,this._$Em=null,this._$Ev()}_$Ev(){this._$ES=new Promise((t=>this.enableUpdating=t)),this._$AL=new Map,this._$E_(),this.requestUpdate(),this.constructor.l?.forEach((t=>t(this)))}addController(t){(this._$EO??=new Set).add(t),void 0!==this.renderRoot&&this.isConnected&&t.hostConnected?.()}removeController(t){this._$EO?.delete(t)}_$E_(){const t=new Map,e=this.constructor.elementProperties;for(const n of e.keys())this.hasOwnProperty(n)&&(t.set(n,this[n]),delete this[n]);t.size>0&&(this._$Ep=t)}createRenderRoot(){const t=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return((t,e)=>{if(o)t.adoptedStyleSheets=e.map((t=>t instanceof CSSStyleSheet?t:t.styleSheet));else for(const n of e){const e=document.createElement("style"),i=r.litNonce;void 0!==i&&e.setAttribute("nonce",i),e.textContent=n.cssText,t.appendChild(e)}})(t,this.constructor.elementStyles),t}connectedCallback(){this.renderRoot??=this.createRenderRoot(),this.enableUpdating(!0),this._$EO?.forEach((t=>t.hostConnected?.()))}enableUpdating(t){}disconnectedCallback(){this._$EO?.forEach((t=>t.hostDisconnected?.()))}attributeChangedCallback(t,e,n){this._$AK(t,n)}_$EC(t,e){const n=this.constructor.elementProperties.get(t),i=this.constructor._$Eu(t,n);if(void 0!==i&&!0===n.reflect){const r=(void 0!==n.converter?.toAttribute?n.converter:b).toAttribute(e,n.type);this._$Em=t,null==r?this.removeAttribute(i):this.setAttribute(i,r),this._$Em=null}}_$AK(t,e){const n=this.constructor,i=n._$Eh.get(t);if(void 0!==i&&this._$Em!==i){const t=n.getPropertyOptions(i),r="function"==typeof t.converter?{fromAttribute:t.converter}:void 0!==t.converter?.fromAttribute?t.converter:b;this._$Em=i,this[i]=r.fromAttribute(e,t.type),this._$Em=null}}requestUpdate(t,e,n){if(void 0!==t){if(n??=this.constructor.getPropertyOptions(t),!(n.hasChanged??$)(this[t],e))return;this.P(t,e,n)}!1===this.isUpdatePending&&(this._$ES=this._$ET())}P(t,e,n){this._$AL.has(t)||this._$AL.set(t,e),!0===n.reflect&&this._$Em!==t&&(this._$Ej??=new Set).add(t)}async _$ET(){this.isUpdatePending=!0;try{await this._$ES}catch(t){Promise.reject(t)}const t=this.scheduleUpdate();return null!=t&&await t,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this.renderRoot??=this.createRenderRoot(),this._$Ep){for(const[t,e]of this._$Ep)this[t]=e;this._$Ep=void 0}const t=this.constructor.elementProperties;if(t.size>0)for(const[e,n]of t)!0!==n.wrapped||this._$AL.has(e)||void 0===this[e]||this.P(e,this[e],n)}let t=!1;const e=this._$AL;try{t=this.shouldUpdate(e),t?(this.willUpdate(e),this._$EO?.forEach((t=>t.hostUpdate?.())),this.update(e)):this._$EU()}catch(e){throw t=!1,this._$EU(),e}t&&this._$AE(e)}willUpdate(t){}_$AE(t){this._$EO?.forEach((t=>t.hostUpdated?.())),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(t)),this.updated(t)}_$EU(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$ES}shouldUpdate(t){return!0}update(t){this._$Ej&&=this._$Ej.forEach((t=>this._$EC(t,this[t]))),this._$EU()}updated(t){}firstUpdated(t){}}A.elementStyles=[],A.shadowRootOptions={mode:"open"},A[w("elementProperties")]=new Map,A[w("finalized")]=new Map,_?.({ReactiveElement:A}),(m.reactiveElementVersions??=[]).push("2.0.4"); /** * @license * Copyright 2017 Google LLC * SPDX-License-Identifier: BSD-3-Clause */ const M={attribute:!0,type:String,converter:b,reflect:!1,hasChanged:$},S=(t=M,e,n)=>{const{kind:i,metadata:r}=n;let o=globalThis.litPropertyMetadata.get(r);if(void 0===o&&globalThis.litPropertyMetadata.set(r,o=new Map),o.set(n.name,t),"accessor"===i){const{name:i}=n;return{set(n){const r=e.get.call(this);e.set.call(this,n),this.requestUpdate(i,r,t)},init(e){return void 0!==e&&this.P(i,void 0,t),e}}}if("setter"===i){const{name:i}=n;return function(n){const r=this[i];e.call(this,n),this.requestUpdate(i,r,t)}}throw Error("Unsupported decorator location: "+i)};function E(t){return(e,n)=>"object"==typeof n?S(t,e,n):((t,e,n)=>{const i=e.hasOwnProperty(n);return e.constructor.createProperty(n,i?{...t,wrapped:!0}:t),i?Object.getOwnPropertyDescriptor(e,n):void 0})(t,e,n)}const k=(e,n)=>{class i extends e{constructor(){super(...arguments),this.width=null==n?void 0:n.width,this.height=null==n?void 0:n.height}}return t([E({type:Number})],i.prototype,"width",void 0),t([E({type:Number,reflect:!0})],i.prototype,"height",void 0),i};function C(t,e){return null==t||null==e?NaN:t<e?-1:t>e?1:t>=e?0:NaN}function N(t,e){return null==t||null==e?NaN:e<t?-1:e>t?1:e>=t?0:NaN}function z(t){let e,n,i;function r(t,i,r=0,o=t.length){if(r<o){if(0!==e(i,i))return o;do{const e=r+o>>>1;n(t[e],i)<0?r=e+1:o=e}while(r<o)}return r}return 2!==t.length?(e=C,n=(e,n)=>C(t(e),n),i=(e,n)=>t(e)-n):(e=t===C||t===N?t:P,n=t,i=t),{left:r,center:function(t,e,n=0,o=t.length){const s=r(t,e,n,o-1);return s>n&&i(t[s-1],e)>-i(t[s],e)?s-1:s},right:function(t,i,r=0,o=t.length){if(r<o){if(0!==e(i,i))return o;do{const e=r+o>>>1;n(t[e],i)<=0?r=e+1:o=e}while(r<o)}return r}}}function P(){return 0}const T=z(C).right;z((function(t){return null===t?NaN:+t})).center;const R=Math.sqrt(50),H=Math.sqrt(10),O=Math.sqrt(2);function U(t,e,n){const i=(e-t)/Math.max(0,n),r=Math.floor(Math.log10(i)),o=i/Math.pow(10,r),s=o>=R?10:o>=H?5:o>=O?2:1;let a,h,l;return r<0?(l=Math.pow(10,-r)/s,a=Math.round(t*l),h=Math.round(e*l),a/l<t&&++a,h/l>e&&--h,l=-l):(l=Math.pow(10,r)*s,a=Math.round(t/l),h=Math.round(e/l),a*l<t&&++a,h*l>e&&--h),h<a&&.5<=n&&n<2?U(t,e,2*n):[a,h,l]}function D(t,e,n){return U(t=+t,e=+e,n=+n)[2]}var q={value:()=>{}};function j(){for(var t,e=0,n=arguments.length,i={};e<n;++e){if(!(t=arguments[e]+"")||t in i||/[\s.]/.test(t))throw new Error("illegal type: "+t);i[t]=[]}return new B(i)}function B(t){this._=t}function W(t,e){for(var n,i=0,r=t.length;i<r;++i)if((n=t[i]).name===e)return n.value}function X(t,e,n){for(var i=0,r=t.length;i<r;++i)if(t[i].name===e){t[i]=q,t=t.slice(0,i).concat(t.slice(i+1));break}return null!=n&&t.push({name:e,value:n}),t}B.prototype=j.prototype={constructor:B,on:function(t,e){var n,i,r=this._,o=(i=r,(t+"").trim().split(/^|\s+/).map((function(t){var e="",n=t.indexOf(".");if(n>=0&&(e=t.slice(n+1),t=t.slice(0,n)),t&&!i.hasOwnProperty(t))throw new Error("unknown type: "+t);return{type:t,name:e}}))),s=-1,a=o.length;if(!(arguments.length<2)){if(null!=e&&"function"!=typeof e)throw new Error("invalid callback: "+e);for(;++s<a;)if(n=(t=o[s]).type)r[n]=X(r[n],t.name,e);else if(null==e)for(n in r)r[n]=X(r[n],t.name,null);return this}for(;++s<a;)if((n=(t=o[s]).type)&&(n=W(r[n],t.name)))return n},copy:function(){var t={},e=this._;for(var n in e)t[n]=e[n].slice();return new B(t)},call:function(t,e){if((n=arguments.length-2)>0)for(var n,i,r=new Array(n),o=0;o<n;++o)r[o]=arguments[o+2];if(!this._.hasOwnProperty(t))throw new Error("unknown type: "+t);for(o=0,n=(i=this._[t]).length;o<n;++o)i[o].value.apply(e,r)},apply:function(t,e,n){if(!this._.hasOwnProperty(t))throw new Error("unknown type: "+t);for(var i=this._[t],r=0,o=i.length;r<o;++r)i[r].value.apply(e,n)}};var Y="http://www.w3.org/1999/xhtml",I={svg:"http://www.w3.org/2000/svg",xhtml:Y,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function L(t){var e=t+="",n=e.indexOf(":");return n>=0&&"xmlns"!==(e=t.slice(0,n))&&(t=t.slice(n+1)),I.hasOwnProperty(e)?{space:I[e],local:t}:t}function V(t){return function(){var e=this.ownerDocument,n=this.namespaceURI;return n===Y&&e.documentElement.namespaceURI===Y?e.createElement(t):e.createElementNS(n,t)}}function G(t){return function(){return this.ownerDocument.createElementNS(t.space,t.local)}}function K(t){var e=L(t);return(e.local?G:V)(e)}function Z(){}function F(t){return null==t?Z:function(){return this.querySelector(t)}}function J(){return[]}function Q(t){return null==t?J:function(){return this.querySelectorAll(t)}}function tt(t){return function(){return null==(e=t.apply(this,arguments))?[]:Array.isArray(e)?e:Array.from(e);var e}}function et(t){return function(){return this.matches(t)}}function nt(t){return function(e){return e.matches(t)}}var it=Array.prototype.find;function rt(){return this.firstElementChild}var ot=Array.prototype.filter;function st(){return Array.from(this.children)}function at(t){return new Array(t.length)}function ht(t,e){this.ownerDocument=t.ownerDocument,this.namespaceURI=t.namespaceURI,this._next=null,this._parent=t,this.__data__=e}function lt(t,e,n,i,r,o){for(var s,a=0,h=e.length,l=o.length;a<l;++a)(s=e[a])?(s.__data__=o[a],i[a]=s):n[a]=new ht(t,o[a]);for(;a<h;++a)(s=e[a])&&(r[a]=s)}function ut(t,e,n,i,r,o,s){var a,h,l,u=new Map,c=e.length,f=o.length,d=new Array(c);for(a=0;a<c;++a)(h=e[a])&&(d[a]=l=s.call(h,h.__data__,a,e)+"",u.has(l)?r[a]=h:u.set(l,h));for(a=0;a<f;++a)l=s.call(t,o[a],a,o)+"",(h=u.get(l))?(i[a]=h,h.__data__=o[a],u.delete(l)):n[a]=new ht(t,o[a]);for(a=0;a<c;++a)(h=e[a])&&u.get(d[a])===h&&(r[a]=h)}function ct(t){return t.__data__}function ft(t){return"object"==typeof t&&"length"in t?t:Array.from(t)}function dt(t,e){return t<e?-1:t>e?1:t>=e?0:NaN}function pt(t){return function(){this.removeAttribute(t)}}function gt(t){return function(){this.removeAttributeNS(t.space,t.local)}}function mt(t,e){return function(){this.setAttribute(t,e)}}function vt(t,e){return function(){this.setAttributeNS(t.space,t.local,e)}}function yt(t,e){return function(){var n=e.apply(this,arguments);null==n?this.removeAttribute(t):this.setAttribute(t,n)}}function _t(t,e){return function(){var n=e.apply(this,arguments);null==n?this.removeAttributeNS(t.space,t.local):this.setAttributeNS(t.space,t.local,n)}}function wt(t){return t.ownerDocument&&t.ownerDocument.defaultView||t.document&&t||t.defaultView}function bt(t){return function(){this.style.removeProperty(t)}}function $t(t,e,n){return function(){this.style.setProperty(t,e,n)}}function xt(t,e,n){return function(){var i=e.apply(this,arguments);null==i?this.style.removeProperty(t):this.style.setProperty(t,i,n)}}function At(t,e){return t.style.getPropertyValue(e)||wt(t).getComputedStyle(t,null).getPropertyValue(e)}function Mt(t){return function(){delete this[t]}}function St(t,e){return function(){this[t]=e}}function Et(t,e){return function(){var n=e.apply(this,arguments);null==n?delete this[t]:this[t]=n}}function kt(t){return t.trim().split(/^|\s+/)}function Ct(t){return t.classList||new Nt(t)}function Nt(t){this._node=t,this._names=kt(t.getAttribute("class")||"")}function zt(t,e){for(var n=Ct(t),i=-1,r=e.length;++i<r;)n.add(e[i])}function Pt(t,e){for(var n=Ct(t),i=-1,r=e.length;++i<r;)n.remove(e[i])}function Tt(t){return function(){zt(this,t)}}function Rt(t){return function(){Pt(this,t)}}function Ht(t,e){return function(){(e.apply(this,arguments)?zt:Pt)(this,t)}}function Ot(){this.textContent=""}function Ut(t){return function(){this.textContent=t}}function Dt(t){return function(){var e=t.apply(this,arguments);this.textContent=e??""}}function qt(){this.innerHTML=""}function jt(t){return function(){this.innerHTML=t}}function Bt(t){return function(){var e=t.apply(this,arguments);this.innerHTML=e??""}}function Wt(){this.nextSibling&&this.parentNode.appendChild(this)}function Xt(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function Yt(){return null}function It(){var t=this.parentNode;t&&t.removeChild(this)}function Lt(){var t=this.cloneNode(!1),e=this.parentNode;return e?e.insertBefore(t,this.nextSibling):t}function Vt(){var t=this.cloneNode(!0),e=this.parentNode;return e?e.insertBefore(t,this.nextSibling):t}function Gt(t){return function(){var e=this.__on;if(e){for(var n,i=0,r=-1,o=e.length;i<o;++i)n=e[i],t.type&&n.type!==t.type||n.name!==t.name?e[++r]=n:this.removeEventListener(n.type,n.listener,n.options);++r?e.length=r:delete this.__on}}}function Kt(t,e,n){return function(){var i,r=this.__on,o=function(t){return function(e){t.call(this,e,this.__data__)}}(e);if(r)for(var s=0,a=r.length;s<a;++s)if((i=r[s]).type===t.type&&i.name===t.name)return this.removeEventListener(i.type,i.listener,i.options),this.addEventListener(i.type,i.listener=o,i.options=n),void(i.value=e);this.addEventListener(t.type,o,n),i={type:t.type,name:t.name,value:e,listener:o,options:n},r?r.push(i):this.__on=[i]}}function Zt(t,e,n){var i=wt(t),r=i.CustomEvent;"function"==typeof r?r=new r(e,n):(r=i.document.createEvent("Event"),n?(r.initEvent(e,n.bubbles,n.cancelable),r.detail=n.detail):r.initEvent(e,!1,!1)),t.dispatchEvent(r)}function Ft(t,e){return function(){return Zt(this,t,e)}}function Jt(t,e){return function(){return Zt(this,t,e.apply(this,arguments))}}ht.prototype={constructor:ht,appendChild:function(t){return this._parent.insertBefore(t,this._next)},insertBefore:function(t,e){return this._parent.insertBefore(t,e)},querySelector:function(t){return this._parent.querySelector(t)},querySelectorAll:function(t){return this._parent.querySelectorAll(t)}},Nt.prototype={add:function(t){this._names.indexOf(t)<0&&(this._names.push(t),this._node.setAttribute("class",this._names.join(" ")))},remove:function(t){var e=this._names.indexOf(t);e>=0&&(this._names.splice(e,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(t){return this._names.indexOf(t)>=0}};var Qt=[null];function te(t,e){this._groups=t,this._parents=e}function ee(){return new te([[document.documentElement]],Qt)}function ne(t){return"string"==typeof t?new te([[document.querySelector(t)]],[document.documentElement]):new te([[t]],Qt)}function ie(t,e){if(t=function(t){let e;for(;e=t.sourceEvent;)t=e;return t}(t),void 0===e&&(e=t.currentTarget),e){var n=e.ownerSVGElement||e;if(n.createSVGPoint){var i=n.createSVGPoint();return i.x=t.clientX,i.y=t.clientY,[(i=i.matrixTransform(e.getScreenCTM().inverse())).x,i.y]}if(e.getBoundingClientRect){var r=e.getBoundingClientRect();return[t.clientX-r.left-e.clientLeft,t.clientY-r.top-e.clientTop]}}return[t.pageX,t.pageY]}te.prototype=ee.prototype={constructor:te,select:function(t){"function"!=typeof t&&(t=F(t));for(var e=this._groups,n=e.length,i=new Array(n),r=0;r<n;++r)for(var o,s,a=e[r],h=a.length,l=i[r]=new Array(h),u=0;u<h;++u)(o=a[u])&&(s=t.call(o,o.__data__,u,a))&&("__data__"in o&&(s.__data__=o.__data__),l[u]=s);return new te(i,this._parents)},selectAll:function(t){t="function"==typeof t?tt(t):Q(t);for(var e=this._groups,n=e.length,i=[],r=[],o=0;o<n;++o)for(var s,a=e[o],h=a.length,l=0;l<h;++l)(s=a[l])&&(i.push(t.call(s,s.__data__,l,a)),r.push(s));return new te(i,r)},selectChild:function(t){return this.select(null==t?rt:function(t){return function(){return it.call(this.children,t)}}("function"==typeof t?t:nt(t)))},selectChildren:function(t){return this.selectAll(null==t?st:function(t){return function(){return ot.call(this.children,t)}}("function"==typeof t?t:nt(t)))},filter:function(t){"function"!=typeof t&&(t=et(t));for(var e=this._groups,n=e.length,i=new Array(n),r=0;r<n;++r)for(var o,s=e[r],a=s.length,h=i[r]=[],l=0;l<a;++l)(o=s[l])&&t.call(o,o.__data__,l,s)&&h.push(o);return new te(i,this._parents)},data:function(t,e){if(!arguments.length)return Array.from(this,ct);var n,i=e?ut:lt,r=this._parents,o=this._groups;"function"!=typeof t&&(n=t,t=function(){return n});for(var s=o.length,a=new Array(s),h=new Array(s),l=new Array(s),u=0;u<s;++u){var c=r[u],f=o[u],d=f.length,p=ft(t.call(c,c&&c.__data__,u,r)),g=p.length,m=h[u]=new Array(g),v=a[u]=new Array(g);i(c,f,m,v,l[u]=new Array(d),p,e);for(var y,_,w=0,b=0;w<g;++w)if(y=m[w]){for(w>=b&&(b=w+1);!(_=v[b])&&++b<g;);y._next=_||null}}return(a=new te(a,r))._enter=h,a._exit=l,a},enter:function(){return new te(this._enter||this._groups.map(at),this._parents)},exit:function(){return new te(this._exit||this._groups.map(at),this._parents)},join:function(t,e,n){var i=this.enter(),r=this,o=this.exit();return"function"==typeof t?(i=t(i))&&(i=i.selection()):i=i.append(t+""),null!=e&&(r=e(r))&&(r=r.selection()),null==n?o.remove():n(o),i&&r?i.merge(r).order():r},merge:function(t){for(var e=t.selection?t.selection():t,n=this._groups,i=e._groups,r=n.length,o=i.length,s=Math.min(r,o),a=new Array(r),h=0;h<s;++h)for(var l,u=n[h],c=i[h],f=u.length,d=a[h]=new Array(f),p=0;p<f;++p)(l=u[p]||c[p])&&(d[p]=l);for(;h<r;++h)a[h]=n[h];return new te(a,this._parents)},selection:function(){return this},order:function(){for(var t=this._groups,e=-1,n=t.length;++e<n;)for(var i,r=t[e],o=r.length-1,s=r[o];--o>=0;)(i=r[o])&&(s&&4^i.compareDocumentPosition(s)&&s.parentNode.insertBefore(i,s),s=i);return this},sort:function(t){function e(e,n){return e&&n?t(e.__data__,n.__data__):!e-!n}t||(t=dt);for(var n=this._groups,i=n.length,r=new Array(i),o=0;o<i;++o){for(var s,a=n[o],h=a.length,l=r[o]=new Array(h),u=0;u<h;++u)(s=a[u])&&(l[u]=s);l.sort(e)}return new te(r,this._parents).order()},call:function(){var t=arguments[0];return arguments[0]=this,t.apply(null,arguments),this},nodes:function(){return Array.from(this)},node:function(){for(var t=this._groups,e=0,n=t.length;e<n;++e)for(var i=t[e],r=0,o=i.length;r<o;++r){var s=i[r];if(s)return s}return null},size:function(){let t=0;for(const e of this)++t;return t},empty:function(){return!this.node()},each:function(t){for(var e=this._groups,n=0,i=e.length;n<i;++n)for(var r,o=e[n],s=0,a=o.length;s<a;++s)(r=o[s])&&t.call(r,r.__data__,s,o);return this},attr:function(t,e){var n=L(t);if(arguments.length<2){var i=this.node();return n.local?i.getAttributeNS(n.space,n.local):i.getAttribute(n)}return this.each((null==e?n.local?gt:pt:"function"==typeof e?n.local?_t:yt:n.local?vt:mt)(n,e))},style:function(t,e,n){return arguments.length>1?this.each((null==e?bt:"function"==typeof e?xt:$t)(t,e,n??"")):At(this.node(),t)},property:function(t,e){return arguments.length>1?this.each((null==e?Mt:"function"==typeof e?Et:St)(t,e)):this.node()[t]},classed:function(t,e){var n=kt(t+"");if(arguments.length<2){for(var i=Ct(this.node()),r=-1,o=n.length;++r<o;)if(!i.contains(n[r]))return!1;return!0}return this.each(("function"==typeof e?Ht:e?Tt:Rt)(n,e))},text:function(t){return arguments.length?this.each(null==t?Ot:("function"==typeof t?Dt:Ut)(t)):this.node().textContent},html:function(t){return arguments.length?this.each(null==t?qt:("function"==typeof t?Bt:jt)(t)):this.node().innerHTML},raise:function(){return this.each(Wt)},lower:function(){return this.each(Xt)},append:function(t){var e="function"==typeof t?t:K(t);return this.select((function(){return this.appendChild(e.apply(this,arguments))}))},insert:function(t,e){var n="function"==typeof t?t:K(t),i=null==e?Yt:"function"==typeof e?e:F(e);return this.select((function(){return this.insertBefore(n.apply(this,arguments),i.apply(this,arguments)||null)}))},remove:function(){return this.each(It)},clone:function(t){return this.select(t?Vt:Lt)},datum:function(t){return arguments.length?this.property("__data__",t):this.node().__data__},on:function(t,e,n){var i,r,o=function(t){return t.trim().split(/^|\s+/).map((function(t){var e="",n=t.indexOf(".");return n>=0&&(e=t.slice(n+1),t=t.slice(0,n)),{type:t,name:e}}))}(t+""),s=o.length;if(!(arguments.length<2)){for(a=e?Kt:Gt,i=0;i<s;++i)this.each(a(o[i],e,n));return this}var a=this.node().__on;if(a)for(var h,l=0,u=a.length;l<u;++l)for(i=0,h=a[l];i<s;++i)if((r=o[i]).type===h.type&&r.name===h.name)return h.value},dispatch:function(t,e){return this.each(("function"==typeof e?Jt:Ft)(t,e))},[Symbol.iterator]:function*(){for(var t=this._groups,e=0,n=t.length;e<n;++e)for(var i,r=t[e],o=0,s=r.length;o<s;++o)(i=r[o])&&(yield i)}};const re={capture:!0,passive:!1};function oe(t){t.preventDefault(),t.stopImmediatePropagation()}function se(t,e,n){t.prototype=e.prototype=n,n.constructor=t}function ae(t,e){var n=Object.create(t.prototype);for(var i in e)n[i]=e[i];return n}function he(){}var le=.7,ue=1/le,ce="\\s*([+-]?\\d+)\\s*",fe="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",de="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",pe=/^#([0-9a-f]{3,8})$/,ge=new RegExp(`^rgb\\(${ce},${ce},${ce}\\)$`),me=new RegExp(`^rgb\\(${de},${de},${de}\\)$`),ve=new RegExp(`^rgba\\(${ce},${ce},${ce},${fe}\\)$`),ye=new RegExp(`^rgba\\(${de},${de},${de},${fe}\\)$`),_e=new RegExp(`^hsl\\(${fe},${de},${de}\\)$`),we=new RegExp(`^hsla\\(${fe},${de},${de},${fe}\\)$`),be={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};function $e(){return this.rgb().formatHex()}function xe(){return this.rgb().formatRgb()}function Ae(t){var e,n;return t=(t+"").trim().toLowerCase(),(e=pe.exec(t))?(n=e[1].length,e=parseInt(e[1],16),6===n?Me(e):3===n?new ke(e>>8&15|e>>4&240,e>>4&15|240&e,(15&e)<<4|15&e,1):8===n?Se(e>>24&255,e>>16&255,e>>8&255,(255&e)/255):4===n?Se(e>>12&15|e>>8&240,e>>8&15|e>>4&240,e>>4&15|240&e,((15&e)<<4|15&e)/255):null):(e=ge.exec(t))?new ke(e[1],e[2],e[3],1):(e=me.exec(t))?new ke(255*e[1]/100,255*e[2]/100,255*e[3]/100,1):(e=ve.exec(t))?Se(e[1],e[2],e[3],e[4]):(e=ye.exec(t))?Se(255*e[1]/100,255*e[2]/100,255*e[3]/100,e[4]):(e=_e.exec(t))?Re(e[1],e[2]/100,e[3]/100,1):(e=we.exec(t))?Re(e[1],e[2]/100,e[3]/100,e[4]):be.hasOwnProperty(t)?Me(be[t]):"transparent"===t?new ke(NaN,NaN,NaN,0):null}function Me(t){return new ke(t>>16&255,t>>8&255,255&t,1)}function Se(t,e,n,i){return i<=0&&(t=e=n=NaN),new ke(t,e,n,i)}function Ee(t,e,n,i){return 1===arguments.length?function(t){return t instanceof he||(t=Ae(t)),t?new ke((t=t.rgb()).r,t.g,t.b,t.opacity):new ke}(t):new ke(t,e,n,i??1)}function ke(t,e,n,i){this.r=+t,this.g=+e,this.b=+n,this.opacity=+i}function Ce(){return`#${Te(this.r)}${Te(this.g)}${Te(this.b)}`}function Ne(){const t=ze(this.opacity);return`${1===t?"rgb(":"rgba("}${Pe(this.r)}, ${Pe(this.g)}, ${Pe(this.b)}${1===t?")":`, ${t})`}`}function ze(t){return isNaN(t)?1:Math.max(0,Math.min(1,t))}function Pe(t){return Math.max(0,Math.min(255,Math.round(t)||0))}function Te(t){return((t=Pe(t))<16?"0":"")+t.toString(16)}function Re(t,e,n,i){return i<=0?t=e=n=NaN:n<=0||n>=1?t=e=NaN:e<=0&&(t=NaN),new Oe(t,e,n,i)}function He(t){if(t instanceof Oe)return new Oe(t.h,t.s,t.l,t.opacity);if(t instanceof he||(t=Ae(t)),!t)return new Oe;if(t instanceof Oe)return t;var e=(t=t.rgb()).r/255,n=t.g/255,i=t.b/255,r=Math.min(e,n,i),o=Math.max(e,n,i),s=NaN,a=o-r,h=(o+r)/2;return a?(s=e===o?(n-i)/a+6*(n<i):n===o?(i-e)/a+2:(e-n)/a+4,a/=h<.5?o+r:2-o-r,s*=60):a=h>0&&h<1?0:s,new Oe(s,a,h,t.opacity)}function Oe(t,e,n,i){this.h=+t,this.s=+e,this.l=+n,this.opacity=+i}function Ue(t){return(t=(t||0)%360)<0?t+360:t}function De(t){return Math.max(0,Math.min(1,t||0))}function qe(t,e,n){return 255*(t<60?e+(n-e)*t/60:t<180?n:t<240?e+(n-e)*(240-t)/60:e)}se(he,Ae,{copy(t){return Object.assign(new this.constructor,this,t)},displayable(){return this.rgb().displayable()},hex:$e,formatHex:$e,formatHex8:function(){return this.rgb().formatHex8()},formatHsl:function(){return He(this).formatHsl()},formatRgb:xe,toString:xe}),se(ke,Ee,ae(he,{brighter(t){return t=null==t?ue:Math.pow(ue,t),new ke(this.r*t,this.g*t,this.b*t,this.opacity)},darker(t){return t=null==t?le:Math.pow(le,t),new ke(this.r*t,this.g*t,this.b*t,this.opacity)},rgb(){return this},clamp(){return new ke(Pe(this.r),Pe(this.g),Pe(this.b),ze(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:Ce,formatHex:Ce,formatHex8:function(){return`#${Te(this.r)}${Te(this.g)}${Te(this.b)}${Te(255*(isNaN(this.opacity)?1:this.opacity))}`},formatRgb:Ne,toString:Ne})),se(Oe,(function(t,e,n,i){return 1===arguments.length?He(t):new Oe(t,e,n,i??1)}),ae(he,{brighter(t){return t=null==t?ue:Math.pow(ue,t),new Oe(this.h,this.s,this.l*t,this.opacity)},darker(t){return t=null==t?le:Math.pow(le,t),new Oe(this.h,this.s,this.l*t,this.opacity)},rgb(){var t=this.h%360+360*(this.h<0),e=isNaN(t)||isNaN(this.s)?0:this.s,n=this.l,i=n+(n<.5?n:1-n)*e,r=2*n-i;return new ke(qe(t>=240?t-240:t+120,r,i),qe(t,r,i),qe(t<120?t+240:t-120,r,i),this.opacity)},clamp(){return new Oe(Ue(this.h),De(this.s),De(this.l),ze(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){const t=ze(this.opacity);return`${1===t?"hsl(":"hsla("}${Ue(this.h)}, ${100*De(this.s)}%, ${100*De(this.l)}%${1===t?")":`, ${t})`}`}}));var je=t=>()=>t;function Be(t){return 1==(t=+t)?We:function(e,n){return n-e?function(t,e,n){return t=Math.pow(t,n),e=Math.pow(e,n)-t,n=1/n,function(i){return Math.pow(t+i*e,n)}}(e,n,t):je(isNaN(e)?n:e)}}function We(t,e){var n=e-t;return n?function(t,e){return function(n){return t+n*e}}(t,n):je(isNaN(t)?e:t)}var Xe=function t(e){var n=Be(e);function i(t,e){var i=n((t=Ee(t)).r,(e=Ee(e)).r),r=n(t.g,e.g),o=n(t.b,e.b),s=We(t.opacity,e.opacity);return function(e){return t.r=i(e),t.g=r(e),t.b=o(e),t.opacity=s(e),t+""}}return i.gamma=t,i}(1);function Ye(t,e){e||(e=[]);var n,i=t?Math.min(e.length,t.length):0,r=e.slice();return function(o){for(n=0;n<i;++n)r[n]=t[n]*(1-o)+e[n]*o;return r}}function Ie(t,e){var n,i=e?e.length:0,r=t?Math.min(i,t.length):0,o=new Array(r),s=new Array(i);for(n=0;n<r;++n)o[n]=Je(t[n],e[n]);for(;n<i;++n)s[n]=e[n];return function(t){for(n=0;n<r;++n)s[n]=o[n](t);return s}}function Le(t,e){var n=new Date;return t=+t,e=+e,function(i){return n.setTime(t*(1-i)+e*i),n}}function Ve(t,e){return t=+t,e=+e,function(n){return t*(1-n)+e*n}}function Ge(t,e){var n,i={},r={};for(n in null!==t&&"object"==typeof t||(t={}),null!==e&&"object"==typeof e||(e={}),e)n in t?i[n]=Je(t[n],e[n]):r[n]=e[n];return function(t){for(n in i)r[n]=i[n](t);return r}}var Ke=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,Ze=new RegExp(Ke.source,"g");function Fe(t,e){var n,i,r,o=Ke.lastIndex=Ze.lastIndex=0,s=-1,a=[],h=[];for(t+="",e+="";(n=Ke.exec(t))&&(i=Ze.exec(e));)(r=i.index)>o&&(r=e.slice(o,r),a[s]?a[s]+=r:a[++s]=r),(n=n[0])===(i=i[0])?a[s]?a[s]+=i:a[++s]=i:(a[++s]=null,h.push({i:s,x:Ve(n,i)})),o=Ze.lastIndex;return o<e.length&&(r=e.slice(o),a[s]?a[s]+=r:a[++s]=r),a.length<2?h[0]?function(t){return function(e){return t(e)+""}}(h[0].x):function(t){return function(){return t}}(e):(e=h.length,function(t){for(var n,i=0;i<e;++i)a[(n=h[i]).i]=n.x(t);return a.join("")})}function Je(t,e){var n,i,r=typeof e;return null==e||"boolean"===r?je(e):("number"===r?Ve:"string"===r?(n=Ae(e))?(e=n,Xe):Fe:e instanceof Ae?Xe:e instanceof Date?Le:(i=e,!ArrayBuffer.isView(i)||i instanceof DataView?Array.isArray(e)?Ie:"function"!=typeof e.valueOf&&"function"!=typeof e.toString||isNaN(e)?Ge:Ve:Ye))(t,e)}function Qe(t,e){return t=+t,e=+e,function(n){return Math.round(t*(1-n)+e*n)}}var tn,en=180/Math.PI,nn={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function rn(t,e,n,i,r,o){var s,a,h;return(s=Math.sqrt(t*t+e*e))&&(t/=s,e/=s),(h=t*n+e*i)&&(n-=t*h,i-=e*h),(a=Math.sqrt(n*n+i*i))&&(n/=a,i/=a,h/=a),t*i<e*n&&(t=-t,e=-e,h=-h,s=-s),{translateX:r,translateY:o,rotate:Math.atan2(e,t)*en,skewX:Math.atan(h)*en,scaleX:s,scaleY:a}}function on(t,e,n,i){function r(t){return t.length?t.pop()+" ":""}return function(o,s){var a=[],h=[];return o=t(o),s=t(s),function(t,i,r,o,s,a){if(t!==r||i!==o){var h=s.push("translate(",null,e,null,n);a.push({i:h-4,x:Ve(t,r)},{i:h-2,x:Ve(i,o)})}else(r||o)&&s.push("translate("+r+e+o+n)}(o.translateX,o.translateY,s.translateX,s.translateY,a,h),function(t,e,n,o){t!==e?(t-e>180?e+=360:e-t>180&&(t+=360),o.push({i:n.push(r(n)+"rotate(",null,i)-2,x:Ve(t,e)})):e&&n.push(r(n)+"rotate("+e+i)}(o.rotate,s.rotate,a,h),function(t,e,n,o){t!==e?o.push({i:n.push(r(n)+"skewX(",null,i)-2,x:Ve(t,e)}):e&&n.push(r(n)+"skewX("+e+i)}(o.skewX,s.skewX,a,h),function(t,e,n,i,o,s){if(t!==n||e!==i){var a=o.push(r(o)+"scale(",null,",",null,")");s.push({i:a-4,x:Ve(t,n)},{i:a-2,x:Ve(e,i)})}else 1===n&&1===i||o.push(r(o)+"scale("+n+","+i+")")}(o.scaleX,o.scaleY,s.scaleX,s.scaleY,a,h),o=s=null,function(t){for(var e,n=-1,i=h.length;++n<i;)a[(e=h[n]).i]=e.x(t);return a.join("")}}}var sn=on((function(t){const e=new("function"==typeof DOMMatrix?DOMMatrix:WebKitCSSMatrix)(t+"");return e.isIdentity?nn:rn(e.a,e.b,e.c,e.d,e.e,e.f)}),"px, ","px)","deg)"),an=on((function(t){return null==t?nn:(tn||(tn=document.createElementNS("http://www.w3.org/2000/svg","g")),tn.setAttribute("transform",t),(t=tn.transform.baseVal.consolidate())?rn((t=t.matrix).a,t.b,t.c,t.d,t.e,t.f):nn)}),", ",")",")");function hn(t){return((t=Math.exp(t))+1/t)/2}var ln,un,cn=function t(e,n,i){function r(t,r){var o,s,a=t[0],h=t[1],l=t[2],u=r[0],c=r[1],f=r[2],d=u-a,p=c-h,g=d*d+p*p;if(g<1e-12)s=Math.log(f/l)/e,o=function(t){return[a+t*d,h+t*p,l*Math.exp(e*t*s)]};else{var m=Math.sqrt(g),v=(f*f-l*l+i*g)/(2*l*n*m),y=(f*f-l*l-i*g)/(2*f*n*m),_=Math.log(Math.sqrt(v*v+1)-v),w=Math.log(Math.sqrt(y*y+1)-y);s=(w-_)/e,o=function(t){var i,r=t*s,o=hn(_),u=l/(n*m)*(o*(i=e*r+_,((i=Math.exp(2*i))-1)/(i+1))-function(t){return((t=Math.exp(t))-1/t)/2}(_));return[a+u*d,h+u*p,l*o/hn(e*r+_)]}}return o.duration=1e3*s*e/Math.SQRT2,o}return r.rho=function(e){var n=Math.max(.001,+e),i=n*n;return t(n,i,i*i)},r}(Math.SQRT2,2,4),fn=0,dn=0,pn=0,gn=0,mn=0,vn=0,yn="object"==typeof performance&&performance.now?performance:Date,_n="object"==typeof window&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(t){setTimeout(t,17)};function wn(){return mn||(_n(bn),mn=yn.now()+vn)}function bn(){mn=0}function $n(){this._call=this._time=this._next=null}function xn(t,e,n){var i=new $n;return i.restart(t,e,n),i}function An(){mn=(gn=yn.now())+vn,fn=dn=0;try{!function(){wn(),++fn;for(var t,e=ln;e;)(t=mn-e._time)>=0&&e._call.call(void 0,t),e=e._next;--fn}()}finally{fn=0,function(){var t,e,n=ln,i=1/0;for(;n;)n._call?(i>n._time&&(i=n._time),t=n,n=n._next):(e=n._next,n._next=null,n=t?t._next=e:ln=e);un=t,Sn(i)}(),mn=0}}function Mn(){var t=yn.now(),e=t-gn;e>1e3&&(vn-=e,gn=t)}function Sn(t){fn||(dn&&(dn=clearTimeout(dn)),t-mn>24?(t<1/0&&(dn=setTimeout(An,t-yn.now()-vn)),pn&&(pn=clearInterval(pn))):(pn||(gn=yn.now(),pn=setInterval(Mn,1e3)),fn=1,_n(An)))}function En(t,e,n){var i=new $n;return e=null==e?0:+e,i.restart((n=>{i.stop(),t(n+e)}),e,n),i}$n.prototype=xn.prototype={constructor:$n,restart:function(t,e,n){if("function"!=typeof t)throw new TypeError("callback is not a function");n=(null==n?wn():+n)+(null==e?0:+e),this._next||un===this||(un?un._next=this:ln=this,un=this),this._call=t,this._time=n,Sn()},stop:function(){this._call&&(this._call=null,this._time=1/0,Sn())}};var kn=j("start","end","cancel","interrupt"),Cn=[];function Nn(t,e,n,i,r,o){var s=t.__transition;if(s){if(n in s)return}else t.__transition={};!function(t,e,n){var i,r=t.__transition;function o(t){n.state=1,n.timer.restart(s,n.delay,n.time),n.delay<=t&&s(t-n.delay)}function s(o){var l,u,c,f;if(1!==n.state)return h();for(l in r)if((f=r[l]).name===n.name){if(3===f.state)return En(s);4===f.state?(f.state=6,f.timer.stop(),f.on.call("interrupt",t,t.__data__,f.index,f.group),delete r[l]):+l<e&&(f.state=6,f.timer.stop(),f.on.call("cancel",t,t.__data__,f.index,f.group),delete r[l])}if(En((function(){3===n.state&&(n.state=4,n.timer.restart(a,n.delay,n.time),a(o))})),n.state=2,n.on.call("start",t,t.__data__,n.index,n.group),2===n.state){for(n.state=3,i=new Array(c=n.tween.length),l=0,u=-1;l<c;++l)(f=n.tween[l].value.call(t,t.__data__,n.index,n.group))&&(i[++u]=f);i.length=u+1}}function a(e){for(var r=e<n.duration?n.ease.call(null,e/n.duration):(n.timer.restart(h),n.state=5,1),o=-1,s=i.length;++o<s;)i[o].call(t,r);5===n.state&&(n.on.call("end",t,t.__data__,n.index,n.group),h())}function h(){for(var i in n.state=6,n.timer.stop(),delete r[e],r)return;delete t.__transition}r[e]=n,n.timer=xn(o,0,n.time)}(t,n,{name:e,index:i,group:r,on:kn,tween:Cn,time:o.time,delay:o.delay,duration:o.duration,ease:o.ease,timer:null,state:0})}function zn(t,e){var n=Tn(t,e);if(n.state>0)throw new Error("too late; already scheduled");return n}function Pn(t,e){var n=Tn(t,e);if(n.state>3)throw new Error("too late; already running");return n}function Tn(t,e){var n=t.__transition;if(!n||!(n=n[e]))throw new Error("transition not found");return n}function Rn(t,e){var n,i,r,o=t.__transition,s=!0;if(o){for(r in e=null==e?null:e+"",o)(n=o[r]).name===e?(i=n.state>2&&n.state<5,n.state=6,n.timer.stop(),n.on.call(i?"interrupt":"cancel",t,t.__data__,n.index,n.group),delete o[r]):s=!1;s&&delete t.__transition}}function Hn(t,e){var n,i;return function(){var r=Pn(this,t),o=r.tween;if(o!==n)for(var s=0,a=(i=n=o).length;s<a;++s)if(i[s].name===e){(i=i.slice()).splice(s,1);break}r.tween=i}}function On(t,e,n){var i,r;if("function"!=typeof n)throw new Error;return function(){var o=Pn(this,t),s=o.tween;if(s!==i){r=(i=s).slice();for(var a={name:e,value:n},h=0,l=r.length;h<l;++h)if(r[h].name===e){r[h]=a;break}h===l&&r.push(a)}o.tween=r}}function Un(t,e,n){var i=t._id;return t.each((function(){var t=Pn(this,i);(t.value||(t.value={}))[e]=n.apply(this,arguments)})),function(t){return Tn(t,i).value[e]}}function Dn(t,e){var n;return("number"==typeof e?Ve:e instanceof Ae?Xe:(n=Ae(e))?(e=n,Xe):Fe)(t,e)}function qn(t){return function(){this.removeAttribute(t)}}function jn(t){return function(){this.removeAttributeNS(t.space,t.local)}}function Bn(t,e,n){var i,r,o=n+"";return function(){var s=this.getAttribute(t);return s===o?null:s===i?r:r=e(i=s,n)}}function Wn(t,e,n){var i,r,o=n+"";return function(){var s=this.getAttributeNS(t.space,t.local);return s===o?null:s===i?r:r=e(i=s,n)}}function Xn(t,e,n){var i,r,o;return function(){var s,a,h=n(this);if(null!=h)return(s=this.getAttribute(t))===(a=h+"")?null:s===i&&a===r?o:(r=a,o=e(i=s,h));this.removeAttribute(t)}}function Yn(t,e,n){var i,r,o;return function(){var s,a,h=n(this);if(null!=h)return(s=this.getAttributeNS(t.space,t.local))===(a=h+"")?null:s===i&&a===r?o:(r=a,o=e(i=s,h));this.removeAttributeNS(t.space,t.local)}}function In(t,e){var n,i;function r(){var r=e.apply(this,arguments);return r!==i&&(n=(i=r)&&function(t,e){return function(n){this.setAttributeNS(t.space,t.local,e.call(this,n))}}(t,r)),n}return r._value=e,r}function Ln(t,e){var n,i;function r(){var r=e.apply(this,arguments);return r!==i&&(n=(i=r)&&function(t,e){return function(n){this.setAttribute(t,e.call(this,n))}}(t,r)),n}return r._value=e,r}function Vn(t,e){return function(){zn(this,t).delay=+e.apply(this,arguments)}}function Gn(t,e){return e=+e,function(){zn(this,t).delay=e}}function Kn(t,e){return function(){Pn(this,t).duration=+e.apply(this,arguments)}}function Zn(t,e){return e=+e,function(){Pn(this,t).duration=e}}var Fn=ee.prototype.constructor;function Jn(t){return function(){this.style.removeProperty(t)}}var Qn=0;function ti(t,e,n,i){this._groups=t,this._parents=e,this._name=n,this._id=i}function ei(){return++Qn}var ni=ee.prototype;ti.prototype={constructor:ti,select:function(t){var e=this._name,n=this._id;"function"!=typeof t&&(t=F(t));for(var i=this._groups,r=i.length,o=new Array(r),s=0;s<r;++s)for(var a,h,l=i[s],u=l.length,c=o[s]=new Array(u),f=0;f<u;++f)(a=l[f])&&(h=t.call(a,a.__data__,f,l))&&("__data__"in a&&(h.__data__=a.__data__),c[f]=h,Nn(c[f],e,n,f,c,Tn(a,n)));return new ti(o,this._parents,e,n)},selectAll:function(t){var e=this._name,n=this._id;"function"!=typeof t&&(t=Q(t));for(var i=this._groups,r=i.length,o=[],s=[],a=0;a<r;++a)for(var h,l=i[a],u=l.length,c=0;c<u;++c)if(h=l[c]){for(var f,d=t.call(h,h.__data__,c,l),p=Tn(h,n),g=0,m=d.length;g<m;++g)(f=d[g])&&Nn(f,e,n,g,d,p);o.push(d),s.push(h)}return new ti(o,s,e,n)},selectChild:ni.selectChild,selectChildren:ni.selectChildren,filter:function(t){"function"!=typeof t&&(t=et(t));for(var e=this._groups,n=e.length,i=new Array(n),r=0;r<n;++r)for(var o,s=e[r],a=s.length,h=i[r]=[],l=0;l<a;++l)(o=s[l])&&t.call(o,o.__data__,l,s)&&h.push(o);return new ti(i,this._parents,this._name,this._id)},merge:function(t){if(t._id!==this._id)throw new Error;for(var e=this._groups,n=t._groups,i=e.length,r=n.length,o=Math.min(i,r),s=new Array(i),a=0;a<o;++a)for(var h,l=e[a],u=n[a],c=l.length,f=s[a]=new Array(c),d=0;d<c;++d)(h=l[d]||u[d])&&(f[d]=h);for(;a<i;++a)s[a]=e[a];return new ti(s,this._parents,this._name,this._id)},selection:function(){return new Fn(this._groups,this._parents)},transition:function(){for(var t=this._name,e=this._id,n=ei(),i=this._groups,r=i.length,o=0;o<r;++o)for(var s,a=i[o],h=a.length,l=0;l<h;++l)if(s=a[l]){var u=Tn(s,e);Nn(s,t,n,l,a,{time:u.time+u.delay+u.duration,delay:0,duration:u.duration,ease:u.ease})}return new ti(i,this._parents,t,n)},call:ni.call,nodes:ni.nodes,node:ni.node,size:ni.size,empty:ni.empty,each:ni.each,on:function(t,e){var n=this._id;return arguments.length<2?Tn(this.node(),n).on.on(t):this.each(function(t,e,n){var i,r,o=function(t){return(t+"").trim().split(/^|\s+/).every((function(t){var e=t.indexOf(".");return e>=0&&(t=t.slice(0,e)),!t||"start"===t}))}(e)?zn:Pn;return function(){var s=o(this,t),a=s.on;a!==i&&(r=(i=a).copy()).on(e,n),s.on=r}}(n,t,e))},attr:function(t,e){var n=L(t),i="transform"===n?an:Dn;return this.attrTween(t,"function"==typeof e?(n.local?Yn:Xn)(n,i,Un(this,"attr."+t,e)):null==e?(n.local?jn:qn)(n):(n.local?Wn:Bn)(n,i,e))},attrTween:function(t,e){var n="attr."+t;if(arguments.length<2)return(n=this.tween(n))&&n._value;if(null==e)return this.tween(n,null);if("function"!=typeof e)throw new Error;var i=L(t);return this.tween(n,(i.local?In:Ln)(i,e))},style:function(t,e,n){var i="transform"==(t+="")?sn:Dn;return null==e?this.styleTween(t,function(t,e){var n,i,r;return function(){var o=At(this,t),s=(this.style.removeProperty(t),At(this,t));return o===s?null:o===n&&s===i?r:r=e(n=o,i=s)}}(t,i)).on("end.style."+t,Jn(t)):"function"==typeof e?this.styleTween(t,function(t,e,n){var i,r,o;return function(){var s=At(this,t),a=n(this),h=a+"";return null==a&&(this.style.removeProperty(t),h=a=At(this,t)),s===h?null:s===i&&h===r?o:(r=h,o=e(i=s,a))}}(t,i,Un(this,"style."+t,e))).each(function(t,e){var n,i,r,o,s="style."+e,a="end."+s;return function(){var h=Pn(this,t),l=h.on,u=null==h.value[s]?o||(o=Jn(e)):void 0;l===n&&r===u||(i=(n=l).copy()).on(a,r=u),h.on=i}}(this._id,t)):this.styleTween(t,function(t,e,n){var i,r,o=n+"";return function(){var s=At(this,t);return s===o?null:s===i?r:r=e(i=s,n)}}(t,i,e),n).on("end.style."+t,null)},styleTween:function(t,e,n){var i="style."+(t+="");if(arguments.length<2)return(i=this.tween(i))&&i._value;if(null==e)return this.tween(i,null);if("function"!=typeof e)throw new Error;return this.tween(i,function(t,e,n){var i,r;function o(){var o=e.apply(this,arguments);return o!==r&&(i=(r=o)&&function(t,e,n){return function(i){this.style.setProperty(t,e.call(this,i),n)}}(t,o,n)),i}return o._value=e,o}(t,e,n??""))},text:function(t){return this.tween("text","function"==typeof t?function(t){return function(){var e=t(this);this.textContent=e??""}}(Un(this,"text",t)):function(t){return function(){this.textContent=t}}(null==t?"":t+""))},textTween:function(t){var e="text";if(arguments.length<1)return(e=this.tween(e))&&e._value;if(null==t)return this.tween(e,null);if("function"!=typeof t)throw new Error;return this.tween(e,function(t){var e,n;function i(){var i=t.apply(this,arguments);return i!==n&&(e=(n=i)&&function(t){return function(e){this.textContent=t.call(this,e)}}(i)),e}return i._value=t,i}(t))},remove:function(){return this.on("end.remove",function(t){return function(){var e=this.parentNode;for(var n in this.__transition)if(+n!==t)return;e&&e.removeChild(this)}}(this._id))},tween:function(t,e){var n=this._id;if(t+="",arguments.length<2){for(var i,r=Tn(this.node(),n).tween,o=0,s=r.length;o<s;++o)if((i=r[o]).name===t)return i.value;return null}return this.each((null==e?Hn:On)(n,t,e))},delay:function(t){var e=this._id;return arguments.length?this.each(("function"==typeof t?Vn:Gn)(e,t)):Tn(this.node(),e).delay},duration:function(t){var e=this._id;return arguments.length?this.each(("function"==typeof t?Kn:Zn)(e,t)):Tn(this.node(),e).duration},ease:function(t){var e=this._id;return arguments.length?this.each(function(t,e){if("function"!=typeof e)throw new Error;return function(){Pn(this,t).ease=e}}(e,t)):Tn(this.node(),e).ease},easeVarying:function(t){if("function"!=typeof t)throw new Error;return this.each(function(t,e){return function(){var n=e.apply(this,arguments);if("function"!=typeof n)throw new Error;Pn(this,t).ease=n}}(this._id,t))},end:function(){var t,e,n=this,i=n._id,r=n.size();return new Promise((function(o,s){var a={value:s},h={value:function(){0==--r&&o()}};n.each((function(){var n=Pn(this,i),r=n.on;r!==t&&((e=(t=r).copy())._.cancel.push(a),e._.interrupt.push(a),e._.end.push(h)),n.on=e})),0===r&&o()}))},[Symbol.iterator]:ni[Symbol.iterator]};var ii={time:null,delay:0,duration:250,ease:function(t){return((t*=2)<=1?t*t*t:(t-=2)*t*t+2)/2}};function ri(t,e){for(var n;!(n=t.__transition)||!(n=n[e]);)if(!(t=t.parentNode))throw new Error(`transition ${e} not found`);return n}function oi(t,e){if((n=(t=e?t.toExponential(e-1):t.toExponential()).indexOf("e"))<0)return null;var n,i=t.slice(0,n);return[i.length>1?i[0]+i.slice(2):i,+t.slice(n+1)]}function si(t){return(t=oi(Math.abs(t)))?t[1]:NaN}ee.prototype.interrupt=function(t){return this.each((function(){Rn(this,t)}))},ee.prototype.transition=function(t){var e,n;t instanceof ti?(e=t._id,t=t._name):(e=ei(),(n=ii).time=wn(),t=null==t?null:t+"");for(var i=this._groups,r=i.length,o=0;o<r;++o)for(var s,a=i[o],h=a.length,l=0;l<h;++l)(s=a[l])&&Nn(s,t,e,l,a,n||ri(s,e));return new ti(i,this._parents,t,e)};var ai,hi=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function li(t){if(!(e=hi.exec(t)))throw new Error("invalid format: "+t);var e;return new ui({fill:e[1],align:e[2],sign:e[3],symbol:e[4],zero:e[5],width:e[6],comma:e[7],precision:e[8]&&e[8].slice(1),trim:e[9],type:e[10]})}function ui(t){this.fill=void 0===t.fill?" ":t.fill+"",this.align=void 0===t.align?">":t.align+"",this.sign=void 0===t.sign?"-":t.sign+"",this.symbol=void 0===t.symbol?"":t.symbol+"",this.zero=!!t.zero,this.width=void 0===t.width?void 0:+t.width,this.comma=!!t.comma,this.precision=void 0===t.precision?void 0:+t.precision,this.trim=!!t.trim,this.type=void 0===t.type?"":t.type+""}function ci(t,e){var n=oi(t,e);if(!n)return t+"";var i=n[0],r=n[1];return r<0?"0."+new Array(-r).join("0")+i:i.length>r+1?i.slice(0,r+1)+"."+i.slice(r+1):i+new Array(r-i.length+2).join("0")}li.prototype=ui.prototype,ui.prototype.toString=function(){return this.fill+this.align+this.sign+this.symbol+(this.zero?"0":"")+(void 0===this.width?"":Math.max(1,0|this.width))+(this.comma?",":"")+(void 0===this.precision?"":"."+Math.max(0,0|this.precision))+(this.trim?"~":"")+this.type};var fi={"%":(t,e)=>(100*t).toFixed(e),b:t=>Math.round(t).toString(2),c:t=>t+"",d:function(t){return Math.abs(t=Math.round(t))>=1e21?t.toLocaleString("en").replace(/,/g,""):t.toString(10)},e:(t,e)=>t.toExponential(e),f:(t,e)=>t.toFixed(e),g:(t,e)=>t.toPrecision(e),o:t=>Math.round(t).toString(8),p:(t,e)=>ci(100*t,e),r:ci,s:function(t,e){var n=oi(t,e);if(!n)return t+"";var i=n[0],r=n[1],o=r-(ai=3*Math.max(-8,Math.min(8,Math.floor(r/3))))+1,s=i.lengt