@nightingale-elements/nightingale-interpro-track
Advanced tools
Comparing version 4.0.24-alpha.0 to 4.2.1-alpha.0
import NightingaleInterproTrack from "./nightingale-interpro-track"; | ||
export type { BaseGroup, LabelGroup } from "./nightingale-interpro-track"; | ||
export default NightingaleInterproTrack; | ||
//# sourceMappingURL=index.d.ts.map |
@@ -1,2 +0,2 @@ | ||
import{bindEvents as t,contrastingColor as e,getColor as n}from"@nightingale-elements/nightingale-new-core";import r,{DefaultLayout as i}from"@nightingale-elements/nightingale-track";function a(t,e,n,r){var i,a=arguments.length,o=a<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,n,r);else for(var s=t.length-1;s>=0;s--)(i=t[s])&&(o=(a<3?i(o):a>3?i(e,n,o):i(e,n))||o);return a>3&&o&&Object.defineProperty(e,n,o),o}function o(t,e,n,r){if("a"===n&&!r)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof e?t!==e||!r:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===n?r:"a"===n?r.call(t):r?r.value:e.get(t)}function s(t,e,n,r,i){if("m"===r)throw new TypeError("Private method is not writable");if("a"===r&&!i)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof e?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===r?i.call(t,n):i?i.value=n:e.set(t,n),n | ||
import{bindEvents as t,contrastingColor as e}from"@nightingale-elements/nightingale-new-core";import n,{DefaultLayout as r}from"@nightingale-elements/nightingale-track";function i(t,e,n,r){var i,a=arguments.length,o=a<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,n,r);else for(var s=t.length-1;s>=0;s--)(i=t[s])&&(o=(a<3?i(o):a>3?i(e,n,o):i(e,n))||o);return a>3&&o&&Object.defineProperty(e,n,o),o}function a(t,e,n,r){if("a"===n&&!r)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof e?t!==e||!r:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===n?r:"a"===n?r.call(t):r?r.value:e.get(t)}function o(t,e,n,r,i){if("m"===r)throw new TypeError("Private method is not writable");if("a"===r&&!i)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof e?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===r?i.call(t,n):i?i.value=n:e.set(t,n),n | ||
/** | ||
@@ -6,3 +6,3 @@ * @license | ||
* SPDX-License-Identifier: BSD-3-Clause | ||
*/}const u=(t,e)=>"method"===e.kind&&e.descriptor&&!("value"in e.descriptor)?{...e,finisher(n){n.createProperty(e.key,t)}}:{kind:"field",key:Symbol(),placement:"own",descriptor:{},originalKey:e.key,initializer(){"function"==typeof e.initializer&&(this[e.key]=e.initializer.call(this))},finisher(n){n.createProperty(e.key,t)}}; | ||
*/}const s=(t,e)=>"method"===e.kind&&e.descriptor&&!("value"in e.descriptor)?{...e,finisher(n){n.createProperty(e.key,t)}}:{kind:"field",key:Symbol(),placement:"own",descriptor:{},originalKey:e.key,initializer(){"function"==typeof e.initializer&&(this[e.key]=e.initializer.call(this))},finisher(n){n.createProperty(e.key,t)}}; | ||
/** | ||
@@ -12,3 +12,3 @@ * @license | ||
* SPDX-License-Identifier: BSD-3-Clause | ||
*/function l(t){return(e,n)=>void 0!==n?((t,e,n)=>{e.constructor.createProperty(n,t)})(t,e,n):u(t,e) | ||
*/function u(t){return(e,n)=>void 0!==n?((t,e,n)=>{e.constructor.createProperty(n,t)})(t,e,n):s(t,e) | ||
/** | ||
@@ -18,3 +18,3 @@ * @license | ||
* SPDX-License-Identifier: BSD-3-Clause | ||
*/}var h;null===(h=window.HTMLSlotElement)||void 0===h||h.prototype.assignedElements;var c={value:()=>{}};function f(){for(var t,e=0,n=arguments.length,r={};e<n;++e){if(!(t=arguments[e]+"")||t in r||/[\s.]/.test(t))throw new Error("illegal type: "+t);r[t]=[]}return new d(r)}function d(t){this._=t}function p(t,e){return t.trim().split(/^|\s+/).map((function(t){var n="",r=t.indexOf(".");if(r>=0&&(n=t.slice(r+1),t=t.slice(0,r)),t&&!e.hasOwnProperty(t))throw new Error("unknown type: "+t);return{type:t,name:n}}))}function g(t,e){for(var n,r=0,i=t.length;r<i;++r)if((n=t[r]).name===e)return n.value}function v(t,e,n){for(var r=0,i=t.length;r<i;++r)if(t[r].name===e){t[r]=c,t=t.slice(0,r).concat(t.slice(r+1));break}return null!=n&&t.push({name:e,value:n}),t}d.prototype=f.prototype={constructor:d,on:function(t,e){var n,r=this._,i=p(t+"",r),a=-1,o=i.length;if(!(arguments.length<2)){if(null!=e&&"function"!=typeof e)throw new Error("invalid callback: "+e);for(;++a<o;)if(n=(t=i[a]).type)r[n]=v(r[n],t.name,e);else if(null==e)for(n in r)r[n]=v(r[n],t.name,null);return this}for(;++a<o;)if((n=(t=i[a]).type)&&(n=g(r[n],t.name)))return n},copy:function(){var t={},e=this._;for(var n in e)t[n]=e[n].slice();return new d(t)},call:function(t,e){if((n=arguments.length-2)>0)for(var n,r,i=new Array(n),a=0;a<n;++a)i[a]=arguments[a+2];if(!this._.hasOwnProperty(t))throw new Error("unknown type: "+t);for(a=0,n=(r=this._[t]).length;a<n;++a)r[a].value.apply(e,i)},apply:function(t,e,n){if(!this._.hasOwnProperty(t))throw new Error("unknown type: "+t);for(var r=this._[t],i=0,a=r.length;i<a;++i)r[i].value.apply(e,n)}};var y="http://www.w3.org/1999/xhtml",m={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 _(t){var e=t+="",n=e.indexOf(":");return n>=0&&"xmlns"!==(e=t.slice(0,n))&&(t=t.slice(n+1)),m.hasOwnProperty(e)?{space:m[e],local:t}:t}function w(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 b(t){return function(){return this.ownerDocument.createElementNS(t.space,t.local)}}function x(t){var e=_(t);return(e.local?b:w)(e)}function k(){}function A(t){return null==t?k:function(){return this.querySelector(t)}}function $(t){return null==t?[]:Array.isArray(t)?t:Array.from(t)}function S(){return[]}function j(t){return null==t?S:function(){return this.querySelectorAll(t)}}function E(t){return function(){return this.matches(t)}}function O(t){return function(e){return e.matches(t)}}var P=Array.prototype.find;function M(){return this.firstElementChild}var F=Array.prototype.filter;function N(){return Array.from(this.children)}function R(t){return new Array(t.length)}function C(t,e){this.ownerDocument=t.ownerDocument,this.namespaceURI=t.namespaceURI,this._next=null,this._parent=t,this.__data__=e}function T(t){return function(){return t}}function Y(t,e,n,r,i,a){for(var o,s=0,u=e.length,l=a.length;s<l;++s)(o=e[s])?(o.__data__=a[s],r[s]=o):n[s]=new C(t,a[s]);for(;s<u;++s)(o=e[s])&&(i[s]=o)}function q(t,e,n,r,i,a,o){var s,u,l,h=new Map,c=e.length,f=a.length,d=new Array(c);for(s=0;s<c;++s)(u=e[s])&&(d[s]=l=o.call(u,u.__data__,s,e)+"",h.has(l)?i[s]=u:h.set(l,u));for(s=0;s<f;++s)l=o.call(t,a[s],s,a)+"",(u=h.get(l))?(r[s]=u,u.__data__=a[s],h.delete(l)):n[s]=new C(t,a[s]);for(s=0;s<c;++s)(u=e[s])&&h.get(d[s])===u&&(i[s]=u)}function L(t){return t.__data__}function X(t){return"object"==typeof t&&"length"in t?t:Array.from(t)}function z(t,e){return t<e?-1:t>e?1:t>=e?0:NaN}function H(t){return function(){this.removeAttribute(t)}}function I(t){return function(){this.removeAttributeNS(t.space,t.local)}}function W(t,e){return function(){this.setAttribute(t,e)}}function B(t,e){return function(){this.setAttributeNS(t.space,t.local,e)}}function G(t,e){return function(){var n=e.apply(this,arguments);null==n?this.removeAttribute(t):this.setAttribute(t,n)}}function D(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 V(t){return t.ownerDocument&&t.ownerDocument.defaultView||t.document&&t||t.defaultView}function U(t){return function(){this.style.removeProperty(t)}}function K(t,e,n){return function(){this.style.setProperty(t,e,n)}}function J(t,e,n){return function(){var r=e.apply(this,arguments);null==r?this.style.removeProperty(t):this.style.setProperty(t,r,n)}}function Q(t,e){return t.style.getPropertyValue(e)||V(t).getComputedStyle(t,null).getPropertyValue(e)}function Z(t){return function(){delete this[t]}}function tt(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 nt(t){return t.trim().split(/^|\s+/)}function rt(t){return t.classList||new it(t)}function it(t){this._node=t,this._names=nt(t.getAttribute("class")||"")}function at(t,e){for(var n=rt(t),r=-1,i=e.length;++r<i;)n.add(e[r])}function ot(t,e){for(var n=rt(t),r=-1,i=e.length;++r<i;)n.remove(e[r])}function st(t){return function(){at(this,t)}}function ut(t){return function(){ot(this,t)}}function lt(t,e){return function(){(e.apply(this,arguments)?at:ot)(this,t)}}function ht(){this.textContent=""}function ct(t){return function(){this.textContent=t}}function ft(t){return function(){var e=t.apply(this,arguments);this.textContent=e??""}}function dt(){this.innerHTML=""}function pt(t){return function(){this.innerHTML=t}}function gt(t){return function(){var e=t.apply(this,arguments);this.innerHTML=e??""}}function vt(){this.nextSibling&&this.parentNode.appendChild(this)}function yt(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function mt(){return null}function _t(){var t=this.parentNode;t&&t.removeChild(this)}function wt(){var t=this.cloneNode(!1),e=this.parentNode;return e?e.insertBefore(t,this.nextSibling):t}function bt(){var t=this.cloneNode(!0),e=this.parentNode;return e?e.insertBefore(t,this.nextSibling):t}function xt(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}}))}function kt(t){return function(){var e=this.__on;if(e){for(var n,r=0,i=-1,a=e.length;r<a;++r)n=e[r],t.type&&n.type!==t.type||n.name!==t.name?e[++i]=n:this.removeEventListener(n.type,n.listener,n.options);++i?e.length=i:delete this.__on}}}function At(t,e,n){return function(){var r,i=this.__on,a=function(t){return function(e){t.call(this,e,this.__data__)}}(e);if(i)for(var o=0,s=i.length;o<s;++o)if((r=i[o]).type===t.type&&r.name===t.name)return this.removeEventListener(r.type,r.listener,r.options),this.addEventListener(r.type,r.listener=a,r.options=n),void(r.value=e);this.addEventListener(t.type,a,n),r={type:t.type,name:t.name,value:e,listener:a,options:n},i?i.push(r):this.__on=[r]}}function $t(t,e,n){var r=V(t),i=r.CustomEvent;"function"==typeof i?i=new i(e,n):(i=r.document.createEvent("Event"),n?(i.initEvent(e,n.bubbles,n.cancelable),i.detail=n.detail):i.initEvent(e,!1,!1)),t.dispatchEvent(i)}function St(t,e){return function(){return $t(this,t,e)}}function jt(t,e){return function(){return $t(this,t,e.apply(this,arguments))}}C.prototype={constructor:C,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)}},it.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 Et=[null];function Ot(t,e){this._groups=t,this._parents=e}function Pt(){return new Ot([[document.documentElement]],Et)}function Mt(t,e,n){t.prototype=e.prototype=n,n.constructor=t}function Ft(t,e){var n=Object.create(t.prototype);for(var r in e)n[r]=e[r];return n}function Nt(){}Ot.prototype=Pt.prototype={constructor:Ot,select:function(t){"function"!=typeof t&&(t=A(t));for(var e=this._groups,n=e.length,r=new Array(n),i=0;i<n;++i)for(var a,o,s=e[i],u=s.length,l=r[i]=new Array(u),h=0;h<u;++h)(a=s[h])&&(o=t.call(a,a.__data__,h,s))&&("__data__"in a&&(o.__data__=a.__data__),l[h]=o);return new Ot(r,this._parents)},selectAll:function(t){t="function"==typeof t?function(t){return function(){return $(t.apply(this,arguments))}}(t):j(t);for(var e=this._groups,n=e.length,r=[],i=[],a=0;a<n;++a)for(var o,s=e[a],u=s.length,l=0;l<u;++l)(o=s[l])&&(r.push(t.call(o,o.__data__,l,s)),i.push(o));return new Ot(r,i)},selectChild:function(t){return this.select(null==t?M:function(t){return function(){return P.call(this.children,t)}}("function"==typeof t?t:O(t)))},selectChildren:function(t){return this.selectAll(null==t?N:function(t){return function(){return F.call(this.children,t)}}("function"==typeof t?t:O(t)))},filter:function(t){"function"!=typeof t&&(t=E(t));for(var e=this._groups,n=e.length,r=new Array(n),i=0;i<n;++i)for(var a,o=e[i],s=o.length,u=r[i]=[],l=0;l<s;++l)(a=o[l])&&t.call(a,a.__data__,l,o)&&u.push(a);return new Ot(r,this._parents)},data:function(t,e){if(!arguments.length)return Array.from(this,L);var n=e?q:Y,r=this._parents,i=this._groups;"function"!=typeof t&&(t=T(t));for(var a=i.length,o=new Array(a),s=new Array(a),u=new Array(a),l=0;l<a;++l){var h=r[l],c=i[l],f=c.length,d=X(t.call(h,h&&h.__data__,l,r)),p=d.length,g=s[l]=new Array(p),v=o[l]=new Array(p),y=u[l]=new Array(f);n(h,c,g,v,y,d,e);for(var m,_,w=0,b=0;w<p;++w)if(m=g[w]){for(w>=b&&(b=w+1);!(_=v[b])&&++b<p;);m._next=_||null}}return(o=new Ot(o,r))._enter=s,o._exit=u,o},enter:function(){return new Ot(this._enter||this._groups.map(R),this._parents)},exit:function(){return new Ot(this._exit||this._groups.map(R),this._parents)},join:function(t,e,n){var r=this.enter(),i=this,a=this.exit();return"function"==typeof t?(r=t(r))&&(r=r.selection()):r=r.append(t+""),null!=e&&(i=e(i))&&(i=i.selection()),null==n?a.remove():n(a),r&&i?r.merge(i).order():i},merge:function(t){for(var e=t.selection?t.selection():t,n=this._groups,r=e._groups,i=n.length,a=r.length,o=Math.min(i,a),s=new Array(i),u=0;u<o;++u)for(var l,h=n[u],c=r[u],f=h.length,d=s[u]=new Array(f),p=0;p<f;++p)(l=h[p]||c[p])&&(d[p]=l);for(;u<i;++u)s[u]=n[u];return new Ot(s,this._parents)},selection:function(){return this},order:function(){for(var t=this._groups,e=-1,n=t.length;++e<n;)for(var r,i=t[e],a=i.length-1,o=i[a];--a>=0;)(r=i[a])&&(o&&4^r.compareDocumentPosition(o)&&o.parentNode.insertBefore(r,o),o=r);return this},sort:function(t){function e(e,n){return e&&n?t(e.__data__,n.__data__):!e-!n}t||(t=z);for(var n=this._groups,r=n.length,i=new Array(r),a=0;a<r;++a){for(var o,s=n[a],u=s.length,l=i[a]=new Array(u),h=0;h<u;++h)(o=s[h])&&(l[h]=o);l.sort(e)}return new Ot(i,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 r=t[e],i=0,a=r.length;i<a;++i){var o=r[i];if(o)return o}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,r=e.length;n<r;++n)for(var i,a=e[n],o=0,s=a.length;o<s;++o)(i=a[o])&&t.call(i,i.__data__,o,a);return this},attr:function(t,e){var n=_(t);if(arguments.length<2){var r=this.node();return n.local?r.getAttributeNS(n.space,n.local):r.getAttribute(n)}return this.each((null==e?n.local?I:H:"function"==typeof e?n.local?D:G:n.local?B:W)(n,e))},style:function(t,e,n){return arguments.length>1?this.each((null==e?U:"function"==typeof e?J:K)(t,e,n??"")):Q(this.node(),t)},property:function(t,e){return arguments.length>1?this.each((null==e?Z:"function"==typeof e?et:tt)(t,e)):this.node()[t]},classed:function(t,e){var n=nt(t+"");if(arguments.length<2){for(var r=rt(this.node()),i=-1,a=n.length;++i<a;)if(!r.contains(n[i]))return!1;return!0}return this.each(("function"==typeof e?lt:e?st:ut)(n,e))},text:function(t){return arguments.length?this.each(null==t?ht:("function"==typeof t?ft:ct)(t)):this.node().textContent},html:function(t){return arguments.length?this.each(null==t?dt:("function"==typeof t?gt:pt)(t)):this.node().innerHTML},raise:function(){return this.each(vt)},lower:function(){return this.each(yt)},append:function(t){var e="function"==typeof t?t:x(t);return this.select((function(){return this.appendChild(e.apply(this,arguments))}))},insert:function(t,e){var n="function"==typeof t?t:x(t),r=null==e?mt:"function"==typeof e?e:A(e);return this.select((function(){return this.insertBefore(n.apply(this,arguments),r.apply(this,arguments)||null)}))},remove:function(){return this.each(_t)},clone:function(t){return this.select(t?bt:wt)},datum:function(t){return arguments.length?this.property("__data__",t):this.node().__data__},on:function(t,e,n){var r,i,a=xt(t+""),o=a.length;if(!(arguments.length<2)){for(s=e?At:kt,r=0;r<o;++r)this.each(s(a[r],e,n));return this}var s=this.node().__on;if(s)for(var u,l=0,h=s.length;l<h;++l)for(r=0,u=s[l];r<o;++r)if((i=a[r]).type===u.type&&i.name===u.name)return u.value},dispatch:function(t,e){return this.each(("function"==typeof e?jt:St)(t,e))},[Symbol.iterator]:function*(){for(var t=this._groups,e=0,n=t.length;e<n;++e)for(var r,i=t[e],a=0,o=i.length;a<o;++a)(r=i[a])&&(yield r)}};var Rt=1/.7,Ct="\\s*([+-]?\\d+)\\s*",Tt="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",Yt="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",qt=/^#([0-9a-f]{3,8})$/,Lt=new RegExp(`^rgb\\(${Ct},${Ct},${Ct}\\)$`),Xt=new RegExp(`^rgb\\(${Yt},${Yt},${Yt}\\)$`),zt=new RegExp(`^rgba\\(${Ct},${Ct},${Ct},${Tt}\\)$`),Ht=new RegExp(`^rgba\\(${Yt},${Yt},${Yt},${Tt}\\)$`),It=new RegExp(`^hsl\\(${Tt},${Yt},${Yt}\\)$`),Wt=new RegExp(`^hsla\\(${Tt},${Yt},${Yt},${Tt}\\)$`),Bt={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 Gt(){return this.rgb().formatHex()}function Dt(){return this.rgb().formatRgb()}function Vt(t){var e,n;return t=(t+"").trim().toLowerCase(),(e=qt.exec(t))?(n=e[1].length,e=parseInt(e[1],16),6===n?Ut(e):3===n?new Zt(e>>8&15|e>>4&240,e>>4&15|240&e,(15&e)<<4|15&e,1):8===n?Kt(e>>24&255,e>>16&255,e>>8&255,(255&e)/255):4===n?Kt(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=Lt.exec(t))?new Zt(e[1],e[2],e[3],1):(e=Xt.exec(t))?new Zt(255*e[1]/100,255*e[2]/100,255*e[3]/100,1):(e=zt.exec(t))?Kt(e[1],e[2],e[3],e[4]):(e=Ht.exec(t))?Kt(255*e[1]/100,255*e[2]/100,255*e[3]/100,e[4]):(e=It.exec(t))?ae(e[1],e[2]/100,e[3]/100,1):(e=Wt.exec(t))?ae(e[1],e[2]/100,e[3]/100,e[4]):Bt.hasOwnProperty(t)?Ut(Bt[t]):"transparent"===t?new Zt(NaN,NaN,NaN,0):null}function Ut(t){return new Zt(t>>16&255,t>>8&255,255&t,1)}function Kt(t,e,n,r){return r<=0&&(t=e=n=NaN),new Zt(t,e,n,r)}function Jt(t){return t instanceof Nt||(t=Vt(t)),t?new Zt((t=t.rgb()).r,t.g,t.b,t.opacity):new Zt}function Qt(t,e,n,r){return 1===arguments.length?Jt(t):new Zt(t,e,n,r??1)}function Zt(t,e,n,r){this.r=+t,this.g=+e,this.b=+n,this.opacity=+r}function te(){return`#${ie(this.r)}${ie(this.g)}${ie(this.b)}`}function ee(){const t=ne(this.opacity);return`${1===t?"rgb(":"rgba("}${re(this.r)}, ${re(this.g)}, ${re(this.b)}${1===t?")":`, ${t})`}`}function ne(t){return isNaN(t)?1:Math.max(0,Math.min(1,t))}function re(t){return Math.max(0,Math.min(255,Math.round(t)||0))}function ie(t){return((t=re(t))<16?"0":"")+t.toString(16)}function ae(t,e,n,r){return r<=0?t=e=n=NaN:n<=0||n>=1?t=e=NaN:e<=0&&(t=NaN),new se(t,e,n,r)}function oe(t){if(t instanceof se)return new se(t.h,t.s,t.l,t.opacity);if(t instanceof Nt||(t=Vt(t)),!t)return new se;if(t instanceof se)return t;var e=(t=t.rgb()).r/255,n=t.g/255,r=t.b/255,i=Math.min(e,n,r),a=Math.max(e,n,r),o=NaN,s=a-i,u=(a+i)/2;return s?(o=e===a?(n-r)/s+6*(n<r):n===a?(r-e)/s+2:(e-n)/s+4,s/=u<.5?a+i:2-a-i,o*=60):s=u>0&&u<1?0:o,new se(o,s,u,t.opacity)}function se(t,e,n,r){this.h=+t,this.s=+e,this.l=+n,this.opacity=+r}function ue(t){return(t=(t||0)%360)<0?t+360:t}function le(t){return Math.max(0,Math.min(1,t||0))}function he(t,e,n){return 255*(t<60?e+(n-e)*t/60:t<180?n:t<240?e+(n-e)*(240-t)/60:e)}Mt(Nt,Vt,{copy(t){return Object.assign(new this.constructor,this,t)},displayable(){return this.rgb().displayable()},hex:Gt,formatHex:Gt,formatHex8:function(){return this.rgb().formatHex8()},formatHsl:function(){return oe(this).formatHsl()},formatRgb:Dt,toString:Dt}),Mt(Zt,Qt,Ft(Nt,{brighter(t){return t=null==t?Rt:Math.pow(Rt,t),new Zt(this.r*t,this.g*t,this.b*t,this.opacity)},darker(t){return t=null==t?.7:Math.pow(.7,t),new Zt(this.r*t,this.g*t,this.b*t,this.opacity)},rgb(){return this},clamp(){return new Zt(re(this.r),re(this.g),re(this.b),ne(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:te,formatHex:te,formatHex8:function(){return`#${ie(this.r)}${ie(this.g)}${ie(this.b)}${ie(255*(isNaN(this.opacity)?1:this.opacity))}`},formatRgb:ee,toString:ee})),Mt(se,(function(t,e,n,r){return 1===arguments.length?oe(t):new se(t,e,n,r??1)}),Ft(Nt,{brighter(t){return t=null==t?Rt:Math.pow(Rt,t),new se(this.h,this.s,this.l*t,this.opacity)},darker(t){return t=null==t?.7:Math.pow(.7,t),new se(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,r=n+(n<.5?n:1-n)*e,i=2*n-r;return new Zt(he(t>=240?t-240:t+120,i,r),he(t,i,r),he(t<120?t+240:t-120,i,r),this.opacity)},clamp(){return new se(ue(this.h),le(this.s),le(this.l),ne(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=ne(this.opacity);return`${1===t?"hsl(":"hsla("}${ue(this.h)}, ${100*le(this.s)}%, ${100*le(this.l)}%${1===t?")":`, ${t})`}`}}));var ce=t=>()=>t;function fe(t){return 1==(t=+t)?de: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(r){return Math.pow(t+r*e,n)}}(e,n,t):ce(isNaN(e)?n:e)}}function de(t,e){var n=e-t;return n?function(t,e){return function(n){return t+n*e}}(t,n):ce(isNaN(t)?e:t)}var pe=function t(e){var n=fe(e);function r(t,e){var r=n((t=Qt(t)).r,(e=Qt(e)).r),i=n(t.g,e.g),a=n(t.b,e.b),o=de(t.opacity,e.opacity);return function(e){return t.r=r(e),t.g=i(e),t.b=a(e),t.opacity=o(e),t+""}}return r.gamma=t,r}(1);function ge(t,e){return t=+t,e=+e,function(n){return t*(1-n)+e*n}}var ve=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,ye=new RegExp(ve.source,"g");function me(t,e){var n,r,i,a=ve.lastIndex=ye.lastIndex=0,o=-1,s=[],u=[];for(t+="",e+="";(n=ve.exec(t))&&(r=ye.exec(e));)(i=r.index)>a&&(i=e.slice(a,i),s[o]?s[o]+=i:s[++o]=i),(n=n[0])===(r=r[0])?s[o]?s[o]+=r:s[++o]=r:(s[++o]=null,u.push({i:o,x:ge(n,r)})),a=ye.lastIndex;return a<e.length&&(i=e.slice(a),s[o]?s[o]+=i:s[++o]=i),s.length<2?u[0]?function(t){return function(e){return t(e)+""}}(u[0].x):function(t){return function(){return t}}(e):(e=u.length,function(t){for(var n,r=0;r<e;++r)s[(n=u[r]).i]=n.x(t);return s.join("")})}var _e,we=180/Math.PI,be={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function xe(t,e,n,r,i,a){var o,s,u;return(o=Math.sqrt(t*t+e*e))&&(t/=o,e/=o),(u=t*n+e*r)&&(n-=t*u,r-=e*u),(s=Math.sqrt(n*n+r*r))&&(n/=s,r/=s,u/=s),t*r<e*n&&(t=-t,e=-e,u=-u,o=-o),{translateX:i,translateY:a,rotate:Math.atan2(e,t)*we,skewX:Math.atan(u)*we,scaleX:o,scaleY:s}}function ke(t,e,n,r){function i(t){return t.length?t.pop()+" ":""}return function(a,o){var s=[],u=[];return a=t(a),o=t(o),function(t,r,i,a,o,s){if(t!==i||r!==a){var u=o.push("translate(",null,e,null,n);s.push({i:u-4,x:ge(t,i)},{i:u-2,x:ge(r,a)})}else(i||a)&&o.push("translate("+i+e+a+n)}(a.translateX,a.translateY,o.translateX,o.translateY,s,u),function(t,e,n,a){t!==e?(t-e>180?e+=360:e-t>180&&(t+=360),a.push({i:n.push(i(n)+"rotate(",null,r)-2,x:ge(t,e)})):e&&n.push(i(n)+"rotate("+e+r)}(a.rotate,o.rotate,s,u),function(t,e,n,a){t!==e?a.push({i:n.push(i(n)+"skewX(",null,r)-2,x:ge(t,e)}):e&&n.push(i(n)+"skewX("+e+r)}(a.skewX,o.skewX,s,u),function(t,e,n,r,a,o){if(t!==n||e!==r){var s=a.push(i(a)+"scale(",null,",",null,")");o.push({i:s-4,x:ge(t,n)},{i:s-2,x:ge(e,r)})}else 1===n&&1===r||a.push(i(a)+"scale("+n+","+r+")")}(a.scaleX,a.scaleY,o.scaleX,o.scaleY,s,u),a=o=null,function(t){for(var e,n=-1,r=u.length;++n<r;)s[(e=u[n]).i]=e.x(t);return s.join("")}}}var Ae,$e,Se=ke((function(t){const e=new("function"==typeof DOMMatrix?DOMMatrix:WebKitCSSMatrix)(t+"");return e.isIdentity?be:xe(e.a,e.b,e.c,e.d,e.e,e.f)}),"px, ","px)","deg)"),je=ke((function(t){return null==t?be:(_e||(_e=document.createElementNS("http://www.w3.org/2000/svg","g")),_e.setAttribute("transform",t),(t=_e.transform.baseVal.consolidate())?xe((t=t.matrix).a,t.b,t.c,t.d,t.e,t.f):be)}),", ",")",")"),Ee=0,Oe=0,Pe=0,Me=0,Fe=0,Ne=0,Re="object"==typeof performance&&performance.now?performance:Date,Ce="object"==typeof window&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(t){setTimeout(t,17)};function Te(){return Fe||(Ce(Ye),Fe=Re.now()+Ne)}function Ye(){Fe=0}function qe(){this._call=this._time=this._next=null}function Le(t,e,n){var r=new qe;return r.restart(t,e,n),r}function Xe(){Fe=(Me=Re.now())+Ne,Ee=Oe=0;try{!function(){Te(),++Ee;for(var t,e=Ae;e;)(t=Fe-e._time)>=0&&e._call.call(void 0,t),e=e._next;--Ee}()}finally{Ee=0,function(){var t,e,n=Ae,r=1/0;for(;n;)n._call?(r>n._time&&(r=n._time),t=n,n=n._next):(e=n._next,n._next=null,n=t?t._next=e:Ae=e);$e=t,He(r)}(),Fe=0}}function ze(){var t=Re.now(),e=t-Me;e>1e3&&(Ne-=e,Me=t)}function He(t){Ee||(Oe&&(Oe=clearTimeout(Oe)),t-Fe>24?(t<1/0&&(Oe=setTimeout(Xe,t-Re.now()-Ne)),Pe&&(Pe=clearInterval(Pe))):(Pe||(Me=Re.now(),Pe=setInterval(ze,1e3)),Ee=1,Ce(Xe)))}function Ie(t,e,n){var r=new qe;return e=null==e?0:+e,r.restart((n=>{r.stop(),t(n+e)}),e,n),r}qe.prototype=Le.prototype={constructor:qe,restart:function(t,e,n){if("function"!=typeof t)throw new TypeError("callback is not a function");n=(null==n?Te():+n)+(null==e?0:+e),this._next||$e===this||($e?$e._next=this:Ae=this,$e=this),this._call=t,this._time=n,He()},stop:function(){this._call&&(this._call=null,this._time=1/0,He())}};var We=f("start","end","cancel","interrupt"),Be=[];function Ge(t,e,n,r,i,a){var o=t.__transition;if(o){if(n in o)return}else t.__transition={};!function(t,e,n){var r,i=t.__transition;function a(t){n.state=1,n.timer.restart(o,n.delay,n.time),n.delay<=t&&o(t-n.delay)}function o(a){var l,h,c,f;if(1!==n.state)return u();for(l in i)if((f=i[l]).name===n.name){if(3===f.state)return Ie(o);4===f.state?(f.state=6,f.timer.stop(),f.on.call("interrupt",t,t.__data__,f.index,f.group),delete i[l]):+l<e&&(f.state=6,f.timer.stop(),f.on.call("cancel",t,t.__data__,f.index,f.group),delete i[l])}if(Ie((function(){3===n.state&&(n.state=4,n.timer.restart(s,n.delay,n.time),s(a))})),n.state=2,n.on.call("start",t,t.__data__,n.index,n.group),2===n.state){for(n.state=3,r=new Array(c=n.tween.length),l=0,h=-1;l<c;++l)(f=n.tween[l].value.call(t,t.__data__,n.index,n.group))&&(r[++h]=f);r.length=h+1}}function s(e){for(var i=e<n.duration?n.ease.call(null,e/n.duration):(n.timer.restart(u),n.state=5,1),a=-1,o=r.length;++a<o;)r[a].call(t,i);5===n.state&&(n.on.call("end",t,t.__data__,n.index,n.group),u())}function u(){for(var r in n.state=6,n.timer.stop(),delete i[e],i)return;delete t.__transition}i[e]=n,n.timer=Le(a,0,n.time)}(t,n,{name:e,index:r,group:i,on:We,tween:Be,time:a.time,delay:a.delay,duration:a.duration,ease:a.ease,timer:null,state:0})}function De(t,e){var n=Ue(t,e);if(n.state>0)throw new Error("too late; already scheduled");return n}function Ve(t,e){var n=Ue(t,e);if(n.state>3)throw new Error("too late; already running");return n}function Ue(t,e){var n=t.__transition;if(!n||!(n=n[e]))throw new Error("transition not found");return n}function Ke(t,e){var n,r;return function(){var i=Ve(this,t),a=i.tween;if(a!==n)for(var o=0,s=(r=n=a).length;o<s;++o)if(r[o].name===e){(r=r.slice()).splice(o,1);break}i.tween=r}}function Je(t,e,n){var r,i;if("function"!=typeof n)throw new Error;return function(){var a=Ve(this,t),o=a.tween;if(o!==r){i=(r=o).slice();for(var s={name:e,value:n},u=0,l=i.length;u<l;++u)if(i[u].name===e){i[u]=s;break}u===l&&i.push(s)}a.tween=i}}function Qe(t,e,n){var r=t._id;return t.each((function(){var t=Ve(this,r);(t.value||(t.value={}))[e]=n.apply(this,arguments)})),function(t){return Ue(t,r).value[e]}}function Ze(t,e){var n;return("number"==typeof e?ge:e instanceof Vt?pe:(n=Vt(e))?(e=n,pe):me)(t,e)}function tn(t){return function(){this.removeAttribute(t)}}function en(t){return function(){this.removeAttributeNS(t.space,t.local)}}function nn(t,e,n){var r,i,a=n+"";return function(){var o=this.getAttribute(t);return o===a?null:o===r?i:i=e(r=o,n)}}function rn(t,e,n){var r,i,a=n+"";return function(){var o=this.getAttributeNS(t.space,t.local);return o===a?null:o===r?i:i=e(r=o,n)}}function an(t,e,n){var r,i,a;return function(){var o,s,u=n(this);if(null!=u)return(o=this.getAttribute(t))===(s=u+"")?null:o===r&&s===i?a:(i=s,a=e(r=o,u));this.removeAttribute(t)}}function on(t,e,n){var r,i,a;return function(){var o,s,u=n(this);if(null!=u)return(o=this.getAttributeNS(t.space,t.local))===(s=u+"")?null:o===r&&s===i?a:(i=s,a=e(r=o,u));this.removeAttributeNS(t.space,t.local)}}function sn(t,e){return function(n){this.setAttribute(t,e.call(this,n))}}function un(t,e){return function(n){this.setAttributeNS(t.space,t.local,e.call(this,n))}}function ln(t,e){var n,r;function i(){var i=e.apply(this,arguments);return i!==r&&(n=(r=i)&&un(t,i)),n}return i._value=e,i}function hn(t,e){var n,r;function i(){var i=e.apply(this,arguments);return i!==r&&(n=(r=i)&&sn(t,i)),n}return i._value=e,i}function cn(t,e){return function(){De(this,t).delay=+e.apply(this,arguments)}}function fn(t,e){return e=+e,function(){De(this,t).delay=e}}function dn(t,e){return function(){Ve(this,t).duration=+e.apply(this,arguments)}}function pn(t,e){return e=+e,function(){Ve(this,t).duration=e}}function gn(t,e){if("function"!=typeof e)throw new Error;return function(){Ve(this,t).ease=e}}function vn(t,e,n){var r,i,a=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)?De:Ve;return function(){var o=a(this,t),s=o.on;s!==r&&(i=(r=s).copy()).on(e,n),o.on=i}}var yn=Pt.prototype.constructor;function mn(t){return function(){this.style.removeProperty(t)}}function _n(t,e,n){return function(r){this.style.setProperty(t,e.call(this,r),n)}}function wn(t,e,n){var r,i;function a(){var a=e.apply(this,arguments);return a!==i&&(r=(i=a)&&_n(t,a,n)),r}return a._value=e,a}function bn(t){return function(e){this.textContent=t.call(this,e)}}function xn(t){var e,n;function r(){var r=t.apply(this,arguments);return r!==n&&(e=(n=r)&&bn(r)),e}return r._value=t,r}var kn=0;function An(t,e,n,r){this._groups=t,this._parents=e,this._name=n,this._id=r}function $n(){return++kn}var Sn=Pt.prototype;An.prototype={constructor:An,select:function(t){var e=this._name,n=this._id;"function"!=typeof t&&(t=A(t));for(var r=this._groups,i=r.length,a=new Array(i),o=0;o<i;++o)for(var s,u,l=r[o],h=l.length,c=a[o]=new Array(h),f=0;f<h;++f)(s=l[f])&&(u=t.call(s,s.__data__,f,l))&&("__data__"in s&&(u.__data__=s.__data__),c[f]=u,Ge(c[f],e,n,f,c,Ue(s,n)));return new An(a,this._parents,e,n)},selectAll:function(t){var e=this._name,n=this._id;"function"!=typeof t&&(t=j(t));for(var r=this._groups,i=r.length,a=[],o=[],s=0;s<i;++s)for(var u,l=r[s],h=l.length,c=0;c<h;++c)if(u=l[c]){for(var f,d=t.call(u,u.__data__,c,l),p=Ue(u,n),g=0,v=d.length;g<v;++g)(f=d[g])&&Ge(f,e,n,g,d,p);a.push(d),o.push(u)}return new An(a,o,e,n)},selectChild:Sn.selectChild,selectChildren:Sn.selectChildren,filter:function(t){"function"!=typeof t&&(t=E(t));for(var e=this._groups,n=e.length,r=new Array(n),i=0;i<n;++i)for(var a,o=e[i],s=o.length,u=r[i]=[],l=0;l<s;++l)(a=o[l])&&t.call(a,a.__data__,l,o)&&u.push(a);return new An(r,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,r=e.length,i=n.length,a=Math.min(r,i),o=new Array(r),s=0;s<a;++s)for(var u,l=e[s],h=n[s],c=l.length,f=o[s]=new Array(c),d=0;d<c;++d)(u=l[d]||h[d])&&(f[d]=u);for(;s<r;++s)o[s]=e[s];return new An(o,this._parents,this._name,this._id)},selection:function(){return new yn(this._groups,this._parents)},transition:function(){for(var t=this._name,e=this._id,n=$n(),r=this._groups,i=r.length,a=0;a<i;++a)for(var o,s=r[a],u=s.length,l=0;l<u;++l)if(o=s[l]){var h=Ue(o,e);Ge(o,t,n,l,s,{time:h.time+h.delay+h.duration,delay:0,duration:h.duration,ease:h.ease})}return new An(r,this._parents,t,n)},call:Sn.call,nodes:Sn.nodes,node:Sn.node,size:Sn.size,empty:Sn.empty,each:Sn.each,on:function(t,e){var n=this._id;return arguments.length<2?Ue(this.node(),n).on.on(t):this.each(vn(n,t,e))},attr:function(t,e){var n=_(t),r="transform"===n?je:Ze;return this.attrTween(t,"function"==typeof e?(n.local?on:an)(n,r,Qe(this,"attr."+t,e)):null==e?(n.local?en:tn)(n):(n.local?rn:nn)(n,r,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 r=_(t);return this.tween(n,(r.local?ln:hn)(r,e))},style:function(t,e,n){var r="transform"==(t+="")?Se:Ze;return null==e?this.styleTween(t,function(t,e){var n,r,i;return function(){var a=Q(this,t),o=(this.style.removeProperty(t),Q(this,t));return a===o?null:a===n&&o===r?i:i=e(n=a,r=o)}}(t,r)).on("end.style."+t,mn(t)):"function"==typeof e?this.styleTween(t,function(t,e,n){var r,i,a;return function(){var o=Q(this,t),s=n(this),u=s+"";return null==s&&(this.style.removeProperty(t),u=s=Q(this,t)),o===u?null:o===r&&u===i?a:(i=u,a=e(r=o,s))}}(t,r,Qe(this,"style."+t,e))).each(function(t,e){var n,r,i,a,o="style."+e,s="end."+o;return function(){var u=Ve(this,t),l=u.on,h=null==u.value[o]?a||(a=mn(e)):void 0;l===n&&i===h||(r=(n=l).copy()).on(s,i=h),u.on=r}}(this._id,t)):this.styleTween(t,function(t,e,n){var r,i,a=n+"";return function(){var o=Q(this,t);return o===a?null:o===r?i:i=e(r=o,n)}}(t,r,e),n).on("end.style."+t,null)},styleTween:function(t,e,n){var r="style."+(t+="");if(arguments.length<2)return(r=this.tween(r))&&r._value;if(null==e)return this.tween(r,null);if("function"!=typeof e)throw new Error;return this.tween(r,wn(t,e,n??""))},text:function(t){return this.tween("text","function"==typeof t?function(t){return function(){var e=t(this);this.textContent=e??""}}(Qe(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,xn(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 r,i=Ue(this.node(),n).tween,a=0,o=i.length;a<o;++a)if((r=i[a]).name===t)return r.value;return null}return this.each((null==e?Ke:Je)(n,t,e))},delay:function(t){var e=this._id;return arguments.length?this.each(("function"==typeof t?cn:fn)(e,t)):Ue(this.node(),e).delay},duration:function(t){var e=this._id;return arguments.length?this.each(("function"==typeof t?dn:pn)(e,t)):Ue(this.node(),e).duration},ease:function(t){var e=this._id;return arguments.length?this.each(gn(e,t)):Ue(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;Ve(this,t).ease=n}}(this._id,t))},end:function(){var t,e,n=this,r=n._id,i=n.size();return new Promise((function(a,o){var s={value:o},u={value:function(){0==--i&&a()}};n.each((function(){var n=Ve(this,r),i=n.on;i!==t&&((e=(t=i).copy())._.cancel.push(s),e._.interrupt.push(s),e._.end.push(u)),n.on=e})),0===i&&a()}))},[Symbol.iterator]:Sn[Symbol.iterator]};var jn={time:null,delay:0,duration:250,ease:function(t){return((t*=2)<=1?t*t*t:(t-=2)*t*t+2)/2}};function En(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 On(t,e,n){this.k=t,this.x=e,this.y=n}Pt.prototype.interrupt=function(t){return this.each((function(){!function(t,e){var n,r,i,a=t.__transition,o=!0;if(a){for(i in e=null==e?null:e+"",a)(n=a[i]).name===e?(r=n.state>2&&n.state<5,n.state=6,n.timer.stop(),n.on.call(r?"interrupt":"cancel",t,t.__data__,n.index,n.group),delete a[i]):o=!1;o&&delete t.__transition}}(this,t)}))},Pt.prototype.transition=function(t){var e,n;t instanceof An?(e=t._id,t=t._name):(e=$n(),(n=jn).time=Te(),t=null==t?null:t+"");for(var r=this._groups,i=r.length,a=0;a<i;++a)for(var o,s=r[a],u=s.length,l=0;l<u;++l)(o=s[l])&&Ge(o,t,e,l,s,n||En(o,e));return new An(r,this._parents,t,e)},On.prototype={constructor:On,scale:function(t){return 1===t?this:new On(this.k*t,this.x,this.y)},translate:function(t,e){return 0===t&0===e?this:new On(this.k,this.x+this.k*t,this.y+this.k*e)},apply:function(t){return[t[0]*this.k+this.x,t[1]*this.k+this.y]},applyX:function(t){return t*this.k+this.x},applyY:function(t){return t*this.k+this.y},invert:function(t){return[(t[0]-this.x)/this.k,(t[1]-this.y)/this.k]},invertX:function(t){return(t-this.x)/this.k},invertY:function(t){return(t-this.y)/this.k},rescaleX:function(t){return t.copy().domain(t.range().map(this.invertX,this).map(t.invert,t))},rescaleY:function(t){return t.copy().domain(t.range().map(this.invertY,this).map(t.invert,t))},toString:function(){return"translate("+this.x+","+this.y+") scale("+this.k+")"}},new On(1,0,0),On.prototype;var Pn=Array.isArray,Mn="object"==typeof global&&global&&global.Object===Object&&global,Fn="object"==typeof self&&self&&self.Object===Object&&self,Nn=Mn||Fn||Function("return this")(),Rn=Nn.Symbol,Cn=Object.prototype,Tn=Cn.hasOwnProperty,Yn=Cn.toString,qn=Rn?Rn.toStringTag:void 0;var Ln=Object.prototype.toString;var Xn=Rn?Rn.toStringTag:void 0;function zn(t){return null==t?void 0===t?"[object Undefined]":"[object Null]":Xn&&Xn in Object(t)?function(t){var e=Tn.call(t,qn),n=t[qn];try{t[qn]=void 0;var r=!0}catch(t){}var i=Yn.call(t);return r&&(e?t[qn]=n:delete t[qn]),i}(t):function(t){return Ln.call(t)}(t)}function Hn(t){return"symbol"==typeof t||function(t){return null!=t&&"object"==typeof t}(t)&&"[object Symbol]"==zn(t)}var In=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Wn=/^\w*$/;function Bn(t){var e=typeof t;return null!=t&&("object"==e||"function"==e)}var Gn,Dn=Nn["__core-js_shared__"],Vn=(Gn=/[^.]+$/.exec(Dn&&Dn.keys&&Dn.keys.IE_PROTO||""))?"Symbol(src)_1."+Gn:"";var Un=Function.prototype.toString;var Kn=/^\[object .+?Constructor\]$/,Jn=Function.prototype,Qn=Object.prototype,Zn=Jn.toString,tr=Qn.hasOwnProperty,er=RegExp("^"+Zn.call(tr).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function nr(t){if(!Bn(t)||(e=t,Vn&&Vn in e))return!1;var e,n=function(t){if(!Bn(t))return!1;var e=zn(t);return"[object Function]"==e||"[object GeneratorFunction]"==e||"[object AsyncFunction]"==e||"[object Proxy]"==e}(t)?er:Kn;return n.test(function(t){if(null!=t){try{return Un.call(t)}catch(t){}try{return t+""}catch(t){}}return""}(t))}function rr(t,e){var n=function(t,e){return null==t?void 0:t[e]}(t,e);return nr(n)?n:void 0}var ir=rr(Object,"create");var ar=Object.prototype.hasOwnProperty;var or=Object.prototype.hasOwnProperty;function sr(t){var e=-1,n=null==t?0:t.length;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}function ur(t,e){for(var n,r,i=t.length;i--;)if((n=t[i][0])===(r=e)||n!=n&&r!=r)return i;return-1}sr.prototype.clear=function(){this.__data__=ir?ir(null):{},this.size=0},sr.prototype.delete=function(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e},sr.prototype.get=function(t){var e=this.__data__;if(ir){var n=e[t];return"__lodash_hash_undefined__"===n?void 0:n}return ar.call(e,t)?e[t]:void 0},sr.prototype.has=function(t){var e=this.__data__;return ir?void 0!==e[t]:or.call(e,t)},sr.prototype.set=function(t,e){var n=this.__data__;return this.size+=this.has(t)?0:1,n[t]=ir&&void 0===e?"__lodash_hash_undefined__":e,this};var lr=Array.prototype.splice;function hr(t){var e=-1,n=null==t?0:t.length;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}hr.prototype.clear=function(){this.__data__=[],this.size=0},hr.prototype.delete=function(t){var e=this.__data__,n=ur(e,t);return!(n<0)&&(n==e.length-1?e.pop():lr.call(e,n,1),--this.size,!0)},hr.prototype.get=function(t){var e=this.__data__,n=ur(e,t);return n<0?void 0:e[n][1]},hr.prototype.has=function(t){return ur(this.__data__,t)>-1},hr.prototype.set=function(t,e){var n=this.__data__,r=ur(n,t);return r<0?(++this.size,n.push([t,e])):n[r][1]=e,this};var cr=rr(Nn,"Map");function fr(t,e){var n,r,i=t.__data__;return("string"==(r=typeof(n=e))||"number"==r||"symbol"==r||"boolean"==r?"__proto__"!==n:null===n)?i["string"==typeof e?"string":"hash"]:i.map}function dr(t){var e=-1,n=null==t?0:t.length;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}dr.prototype.clear=function(){this.size=0,this.__data__={hash:new sr,map:new(cr||hr),string:new sr}},dr.prototype.delete=function(t){var e=fr(this,t).delete(t);return this.size-=e?1:0,e},dr.prototype.get=function(t){return fr(this,t).get(t)},dr.prototype.has=function(t){return fr(this,t).has(t)},dr.prototype.set=function(t,e){var n=fr(this,t),r=n.size;return n.set(t,e),this.size+=n.size==r?0:1,this};function pr(t,e){if("function"!=typeof t||null!=e&&"function"!=typeof e)throw new TypeError("Expected a function");var n=function(){var r=arguments,i=e?e.apply(this,r):r[0],a=n.cache;if(a.has(i))return a.get(i);var o=t.apply(this,r);return n.cache=a.set(i,o)||a,o};return n.cache=new(pr.Cache||dr),n}pr.Cache=dr;var gr,vr,yr,mr=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,_r=/\\(\\)?/g,wr=(gr=function(t){var e=[];return 46===t.charCodeAt(0)&&e.push(""),t.replace(mr,(function(t,n,r,i){e.push(r?i.replace(_r,"$1"):n||t)})),e},vr=pr(gr,(function(t){return 500===yr.size&&yr.clear(),t})),yr=vr.cache,vr),br=wr;var xr=Rn?Rn.prototype:void 0,kr=xr?xr.toString:void 0;function Ar(t){if("string"==typeof t)return t;if(Pn(t))return function(t,e){for(var n=-1,r=null==t?0:t.length,i=Array(r);++n<r;)i[n]=e(t[n],n,t);return i}(t,Ar)+"";if(Hn(t))return kr?kr.call(t):"";var e=t+"";return"0"==e&&1/t==-Infinity?"-0":e}function $r(t,e){return Pn(t)?t:function(t,e){if(Pn(t))return!1;var n=typeof t;return!("number"!=n&&"symbol"!=n&&"boolean"!=n&&null!=t&&!Hn(t))||Wn.test(t)||!In.test(t)||null!=e&&t in Object(e)}(t,e)?[t]:br(function(t){return null==t?"":Ar(t)}(t))}var Sr,jr,Er,Or;function Pr(t){if("string"==typeof t||Hn(t))return t;var e=t+"";return"0"==e&&1/t==-Infinity?"-0":e}function Mr(t,e,n){var r=null==t?void 0:function(t,e){for(var n=0,r=(e=$r(e,t)).length;null!=t&&n<r;)t=t[Pr(e[n++])];return n&&n==r?t:void 0}(t,e);return void 0===r?n:r}class Fr extends i{constructor({expanded:t,padding:e,...n}){super(n),Sr.add(this),jr.set(this,new Map),Er.set(this,new Map),this.maxYPos=0,this.expanded=!1,this.padding=1,this.expanded=t,this.padding=e}init(t,e){var n;let r=0;if(s(this,jr,new Map,"f"),s(this,Er,new Map,"f"),this.maxYPos=0,!t)return;const i={};for(let a=0;a<t.length;a++){const s=t[a],u=(null===(n=null==s?void 0:s.residues)||void 0===n?void 0:n.length)||(null==e?void 0:e.length);o(this,jr,"f").set(s.accession,u&&!this.expanded?16:14),o(this,Er,"f").set(s.accession,this.padding),r=(o(this,jr,"f").get(s.accession)||0)+2*this.padding,this.maxYPos=Math.max(this.maxYPos,r),s.accession in i||(i[s.accession]={}),s.residues&&(r=o(this,Sr,"m",Or).call(this,s.residues,s.accession,this.expanded?r:o(this,Er,"f").get(s.accession)||0,a,3,s.locations,i,this.expanded))}if(e)for(let t=0;t<e.length;t++){const n=e[t];o(this,jr,"f").has(n.accession)||(o(this,jr,"f").set(n.accession,10),o(this,Er,"f").set(n.accession,(this.expanded?this.maxYPos:3)+this.padding),r+=this.expanded?2*this.padding+(o(this,jr,"f").get(n.accession)||14):0,this.maxYPos=Math.max(this.maxYPos,r)),n.accession in i||(i[n.accession]={}),n.residues&&(r=o(this,Sr,"m",Or).call(this,n.residues,n.accession,n.expanded?r:o(this,Er,"f").get(n.accession)||0,t,3,n.locations,i,this.expanded&&n.expanded))}this.maxYPos+=this.padding}static filterOutResidueFragmentsOutOfLocation(t,e){t.locations.forEach((t=>t.fragments=t.fragments.filter((t=>e.some((e=>e.fragments.some((e=>t.start>=e.start&&t.end<=e.end)))))))),t.locations=t.locations.filter((t=>t.fragments.length))}static getAccFromFeature(t){let e="";return"string"==typeof t?e=t:t.accession&&(e=t.accession),e}getFeatureYPos(t){const e=Fr.getAccFromFeature(t);return o(this,Er,"f").get(e)||0}getFeatureHeight(t){const e=Fr.getAccFromFeature(t);return o(this,jr,"f").get(e)||0}}jr=new WeakMap,Er=new WeakMap,Sr=new WeakSet,Or=function(t,e,n,r,i,a,s={},u=!0){for(let l=0;l<t.length;l++){const h=t[l];Fr.filterOutResidueFragmentsOutOfLocation(h,a||[]),h.accession in s[e]||(s[e][h.accession]={});for(let t=0;t<h.locations.length;t++){const a=h.locations[t].description;a in s[e][h.accession]||(s[e][h.accession][a]={height:u?10:(o(this,jr,"f").get(e)||14)-2*i,yPos:u?this.maxYPos+this.padding:n+i},n=u?this.maxYPos+2*this.padding+10:n),o(this,jr,"f").set(`${h.accession}_${r}_${l}_${t}`,s[e][h.accession][a].height),o(this,Er,"f").set(`${h.accession}_${r}_${l}_${t}`,s[e][h.accession][a].yPos),this.maxYPos=Math.max(this.maxYPos,n)}}return u?n:this.maxYPos+2*this.padding};const Nr=(t,e)=>{let n={value:1,...t};const r=[];for(const t of e)n?n.end<t.start?(r.push(n),n=null,r.push(t)):n.start<t.start&&n.end>=t.end?(r.push({start:n.start,end:t.start-1,value:n.value}),r.push({start:t.start,end:t.end,value:(t.value||0)+((null==n?void 0:n.value)||0)}),n=t.end===n.end?null:{start:t.end+1,end:n.end,value:n.value}):t.start<n.start&&t.end>n.end?(r.push({start:t.start,end:n.start-1,value:t.value}),r.push({start:n.start,end:n.end,value:(t.value||0)+((null==n?void 0:n.value)||0)}),r.push({start:n.end+1,end:t.end,value:t.value}),n=null):t.end>=n.start&&t.end<=n.end?(t.start<n.start&&r.push({start:t.start,end:n.start-1,value:t.value}),r.push({start:n.start,end:t.end,value:(t.value||0)+((null==n?void 0:n.value)||0)}),n=t.end<n.end?{start:t.end+1,end:n.end,value:n.value}:null):n.end>=t.start&&n.end<t.end?(r.push({start:n.start,end:t.start-1,value:n.value}),r.push({start:t.start,end:n.end,value:(t.value||0)+((null==n?void 0:n.value)||0)}),r.push({start:n.end+1,end:t.end,value:t.value}),n=null):r.push(t):r.push(t);return n&&r.push(n),r},Rr=t=>t.selectAll("g.residues-group").data((t=>{var e;return(null===(e=t.residues)||void 0===e?void 0:e.map(((e,n)=>({...e,feature:t,i:n}))))||[]})).enter().append("g").attr("class","residues-group").selectAll("g.residues-locations").data((t=>t.locations.map(((e,n)=>({...e,accession:t.accession,feature:t.feature,location:e,i:t.i,j:n}))))).enter().append("g").attr("class","residues-locations"),Cr=({baseG:e,getResidueShape:n,getResidueTransform:r,getResidueFill:i,element:a})=>e.selectAll("path.residue").data((t=>t.fragments.map((e=>({...e,accession:t.accession,feature:{...t.feature,currentResidue:{...e,description:t.location.description}},location:t.location,k:t.feature.k,i:t.i,j:t.j}))))).enter().append("path").attr("class","feature rectangle residue").attr("d",n).attr("transform",r).attr("fill",i).attr("stroke","transparent").call(t,a),Tr=({baseG:t,expanded:e,getResidueShape:n,getResidueTransform:r,getResidueFill:i})=>{const a=t.selectAll("path.residue"),o=new Set(a.data().map((t=>{var e,n;return`${null===(e=t.feature)||void 0===e?void 0:e.accession}-${null===(n=t.location)||void 0===n?void 0:n.description}`}))).size;a.attr("d",n).attr("transform",r).style("pointer-events",(t=>e||t.feature&&t.feature.expanded?"auto":"none")).style("stroke",(()=>e?null:"none")).style("opacity",(()=>e?null:.8/o)).attr("fill",i)};var Yr,qr,Lr,Xr,zr,Hr,Ir,Wr;let Br=Wr=class extends r{constructor(){super(),this.expanded=!1,this["show-label"]=!1,this.label=null,this.layout=void 0,Yr.set(this,void 0),qr.set(this,void 0),Lr.set(this,!1),Xr.set(this,void 0),zr.set(this,void 0),Hr.set(this,void 0),Ir.set(this,void 0),this["margin-top"]=2,this["margin-bottom"]=2}createTrack(){this.layoutObj&&(this.layoutObj.expanded=this.expanded,s(this,Xr,void 0,"f"),super.createTrack())}connectedCallback(){super.connectedCallback(),s(this,Lr,!1,"f")}attributeChangedCallback(t,e,n){if(super.attributeChangedCallback(t,e,n),"expanded"===t&&e!==n&&o(this,Yr,"f"))for(const t of o(this,Yr,"f"))t.expanded=!e}set contributors(t){s(this,Yr,Wr.normalizeLocations(t),"f"),s(this,qr,((t,e=100,n=!0)=>{let r=[];return n&&(r=Nr({start:1,end:e,value:0},r)),t.forEach((t=>{var e;return null===(e=t.locations)||void 0===e?void 0:e.forEach((t=>t.fragments.forEach((t=>{r=Nr(t,r)}))))})),r})(o(this,Yr,"f"),this.length),"f"),this.data&&this.createTrack()}getLayout(){return new Fr({layoutHeight:this.height,expanded:this.expanded,padding:(this["margin-top"]+this["margin-bottom"])/2})}createFeatures(){var e,n,r,i,a,u;if(!this.seqG)return;null===(e=this.layoutObj)||void 0===e||e.init(this.data,o(this,Yr,"f")),this.data.forEach(((t,e)=>t.k=e)),s(this,zr,this.seqG.selectAll("g.feature-group").data(this.data).enter().append("g").attr("class","feature-group").attr("id",(t=>`g_${t.accession}`)),"f");const l=o(this,zr,"f").selectAll("g.location-group").data((t=>{var e;return(null===(e=t.locations)||void 0===e?void 0:e.map((e=>({...e,feature:t}))))||[]})).enter().append("g").attr("class","location-group").style("cursor",o(this,Yr,"f")?"pointer":"default");if(l.selectAll("line.cover").data((t=>[t.fragments.reduce(((e,n)=>({start:Math.min(e.start,n.start),end:Math.max(e.end,n.end),feature:t.feature})),{start:1/0,end:-1/0})])).enter().append("line").attr("class","cover"),l.selectAll("path.feature").data((t=>t.fragments.map((e=>({...e,feature:t.feature,fragments:t.fragments}))))).enter().append("path").attr("class",(t=>`${this.getShape(t)} feature`)).on("click.expanded",(()=>{this.expanded?this.removeAttribute("expanded"):this.setAttribute("expanded","expanded")})).call(t,this),l.selectAll("text.feature-label").data((t=>t.fragments.map((e=>({...e,feature:t.feature,fragments:t.fragments}))))).enter().append("text").attr("class","feature-label").attr("dominant-baseline","middle").attr("text-anchor","middle").style("cursor","inherit").style("pointer-events","none"),s(this,Hr,Rr(o(this,zr,"f")),"f"),Cr({baseG:o(this,Hr,"f"),getResidueShape:t=>this.getResidueShape(t),getResidueTransform:t=>this.getResidueTransform(t),getResidueFill:t=>this.getResidueFill(t,this.expanded),element:this}),o(this,Yr,"f")){o(this,Yr,"f").forEach(((t,e)=>t.k=e)),o(this,Xr,"f")||s(this,Xr,null===(n=this.svg)||void 0===n?void 0:n.append("g").attr("class","children-features"),"f");const e=null===(r=o(this,Xr,"f"))||void 0===r?void 0:r.append("g").attr("class","children-group"),a=null==e?void 0:e.selectAll("g.child-group").data(o(this,Yr,"f")).enter().append("g").attr("class","child-group");if(!a)return;const u=a.selectAll("g.child-location-group").data((t=>(t.expanded=this.expanded,(t.locations||[]).map((e=>({...e,feature:t})))))).enter().append("g").attr("class",((t,e)=>`child-location-group clg-${e}`));null==u||u.selectAll("line.cover").data((t=>[t.fragments.reduce(((e,n)=>({start:Math.min(e.start,n.start),end:Math.max(e.end,n.end),feature:t.feature})),{start:1/0,end:-1/0})])).enter().append("line").attr("class","cover"),null==u||u.selectAll("path.child-fragment").data((t=>t.fragments.map((e=>({...e,feature:t.feature,fragments:t.fragments}))))).enter().append("path").attr("class",(t=>`${this.getShape(t)} child-fragment feature`)).call(t,this).on("click.expanded",((t,e)=>{e.feature.expanded=!e.feature.expanded,this.refresh()})),u.selectAll("text.child-label").data((t=>t.fragments.map((e=>({...e,feature:t.feature,fragments:t.fragments}))))).enter().append("text").attr("class","child-label").attr("dominant-baseline","middle").attr("text-anchor","middle").style("cursor","default").style("pointer-events","none"),s(this,Ir,Rr(a),"f"),Cr({baseG:o(this,Ir,"f"),getResidueShape:t=>this.getResidueShape(t),getResidueTransform:t=>this.getResidueTransform(t),getResidueFill:t=>{var e;return this.getResidueFill(t,null===(e=t.feature)||void 0===e?void 0:e.expanded)},element:this}),(null===(i=o(this,qr,"f"))||void 0===i?void 0:i.length)&&(({element:t,coverage:e})=>{var n,r,i;t.accession=(null===(r=null===(n=null==t?void 0:t.data)||void 0===n?void 0:n[0])||void 0===r?void 0:r.accession)||"_";const a=null===(i=t.svg)||void 0===i?void 0:i.append("defs").append("mask").attr("id",`mask-${t.accession}`);null==a||a.selectAll("rect").data(e).enter().append("rect").attr("y",0).attr("height",t.height)})({element:this,coverage:o(this,qr,"f")})}null===(a=this.svg)||void 0===a||a.attr("height",((null===(u=this.layoutObj)||void 0===u?void 0:u.maxYPos)||0)+this["margin-bottom"]),s(this,Lr,!0,"f")}getResidueShape(t){var e;return this.featureShape.getFeatureShape(this.getSingleBaseWidth(),(null===(e=this.layoutObj)||void 0===e?void 0:e.getFeatureHeight(`${t.accession}_${t.k}_${t.i}_${t.j}`))||0,t.end&&t.start?t.end-t.start+1:1,"rectangle")}getResidueTransform(t){var e;return`translate(${this.getXFromSeqPosition(t.start||1)},${this["margin-top"]+((null===(e=this.layoutObj)||void 0===e?void 0:e.getFeatureYPos(`${t.accession}_${t.k}_${t.i}_${t.j}`))||0)})`}getResidueFill(t,e){return e?this.getFeatureColor(t):"white"}getTextLabel(t){var e,n;return(null===(e=this.label)||void 0===e?void 0:e.length)?this.label.startsWith(".")?Mr(t,this.label.slice(1),null):this.label:(null===(n=null==t?void 0:t.feature)||void 0===n?void 0:n.accession)||null}refreshLabels(t,r=2){t.attr("x",(t=>{const e=Gr(this["display-start"],t.start),n=Dr(this["display-end"],t.end,this.length);return this.getXFromSeqPosition(e+(n-e)/2||1)})).attr("y",(t=>{var e,n;return this["margin-top"]+((null===(e=this.layoutObj)||void 0===e?void 0:e.getFeatureYPos(t.feature))||0)+((null===(n=this.layoutObj)||void 0===n?void 0:n.getFeatureHeight(t.feature))||0)/2})).attr("fill",((t,r,i)=>{var a;const o=null===(a=i[r].parentElement)||void 0===a?void 0:a.querySelector("path.feature");return o?e(n(o,"fill")):null})).attr("font-size",(t=>{var e;return((null===(e=this.layoutObj)||void 0===e?void 0:e.getFeatureHeight(t.feature))||2)-r})).text((t=>this["show-label"]?this.getTextLabel(t):null)).each(function(t,e,n,r,i){function a(a){var o,s,u;const l=function(t){return"string"==typeof t?new Ot([[document.querySelector(t)]],[document.documentElement]):new Ot([[t]],Et)}(this),h=Gr(t,a.start),c=Dr(e,a.end,n),f=r(c)-r(h),d=i(a.feature)/2;let p=(null===(s=null===(o=l.node())||void 0===o?void 0:o.getComputedTextLength)||void 0===s?void 0:s.call(o))||0,g=l.text();for(;p>f-2*d&&g.length>0;)g=g.slice(0,-1),l.text(g.length?g+"…":""),p=(null===(u=l.node())||void 0===u?void 0:u.getComputedTextLength())||0}return a}(this["display-start"],this["display-end"],this.length,(t=>this.getXFromSeqPosition(t)),(t=>{var e;return(null===(e=this.layoutObj)||void 0===e?void 0:e.getFeatureHeight(t))||0})))}refreshFeatures(t,e=!0){const n=new Set(t.data().map((t=>{var e;return null===(e=t.feature)||void 0===e?void 0:e.accession}))).size;t.attr("d",(t=>{var n;return this.featureShape.getFeatureShape(this.getSingleBaseWidth(),(null===(n=this.layoutObj)||void 0===n?void 0:n.getFeatureHeight(t.feature||""))||0,t.end&&t.start?t.end-t.start+1:1,e?this.getShape(t.shape?t:t.feature):"rectangle")})).attr("fill",(t=>e?this.getFeatureColor(t.feature):"white")).attr("opacity",e?1:.8/n).style("stroke",(t=>e?this.getFeatureColor(t.feature):"none")).attr("transform",(t=>{var e;return`translate(${this.getXFromSeqPosition(t.start||1)},${this["margin-top"]+((null===(e=this.layoutObj)||void 0===e?void 0:e.getFeatureYPos(t.feature))||0)})`})).style("pointer-events",e?"auto":"none")}refreshCoverLine(t,e=!0){t.attr("x1",(t=>this.getXFromSeqPosition(t.start||1))).attr("x2",(t=>this.getXFromSeqPosition((t.end||0)+1))).attr("y1",(t=>{var e,n;return this["margin-top"]+((null===(e=this.layoutObj)||void 0===e?void 0:e.getFeatureYPos(t.feature))||0)+((null===(n=this.layoutObj)||void 0===n?void 0:n.getFeatureHeight(t.feature))||0)/2})).attr("y2",(t=>{var e,n;return this["margin-top"]+((null===(e=this.layoutObj)||void 0===e?void 0:e.getFeatureYPos(t.feature))||0)+((null===(n=this.layoutObj)||void 0===n?void 0:n.getFeatureHeight(t.feature))||0)/2})).attr("stroke",(t=>this.getFeatureColor(t.feature))).attr("visibility",e?"visible":"hidden")}refresh(){var t,e,n,r,i,a,s,u;if(o(this,Lr,"f")&&this.layoutObj){if(this.layoutObj.expanded=this.expanded,this.layoutObj.init(this.data,o(this,Yr,"f")),this.height=this.layoutObj.maxYPos,this.refreshCoverLine(null===(t=o(this,zr,"f"))||void 0===t?void 0:t.selectAll("g.location-group line.cover")),this.refreshFeatures(null===(e=o(this,zr,"f"))||void 0===e?void 0:e.selectAll("g.location-group path.feature")),this.refreshLabels(null===(n=o(this,zr,"f"))||void 0===n?void 0:n.selectAll("g.location-group text.feature-label")),o(this,Hr,"f")&&Tr({baseG:o(this,Hr,"f"),expanded:this.expanded,getResidueShape:t=>this.getResidueShape(t),getResidueTransform:t=>this.getResidueTransform(t),getResidueFill:t=>this.getResidueFill(t,this.expanded)}),o(this,Yr,"f")){const t=null===(r=o(this,Xr,"f"))||void 0===r?void 0:r.select("g.children-group");null==t||t.attr("visibility",this.expanded?"visible":"hidden");const e=null==t?void 0:t.selectAll("g.child-group"),n=null==e?void 0:e.selectAll("g.child-location-group"),u=null==n?void 0:n.selectAll("line.cover"),l=null==n?void 0:n.selectAll("path.child-fragment");this.refreshCoverLine(u,this.expanded),this.refreshFeatures(l,this.expanded),this.refreshLabels(null==e?void 0:e.selectAll("g.child-location-group text.child-label"),0),null===(i=o(this,Ir,"f"))||void 0===i||i.attr("visibility",(()=>this.expanded?"visible":"hidden")),o(this,Ir,"f")&&Tr({baseG:o(this,Ir,"f"),expanded:this.expanded,getResidueShape:t=>this.getResidueShape(t),getResidueTransform:t=>this.getResidueTransform(t),getResidueFill:t=>{var e;return this.getResidueFill(t,null===(e=t.feature)||void 0===e?void 0:e.expanded)}}),(null===(a=o(this,qr,"f"))||void 0===a?void 0:a.length)&&(({element:t,featuresG:e,contributorsLength:n})=>{var r;null==e||e.attr("mask",t.expanded?null:`url(#mask-${t.accession})`),null===(r=t.svg)||void 0===r||r.selectAll("defs mask rect").attr("x",(e=>t.getXFromSeqPosition(e.start))).attr("width",(e=>t.getSingleBaseWidth()*(e.end-e.start+1))).attr("height",t.height).attr("fill","white").attr("opacity",(t=>((t.value||0)/(n||1)+.3)/1.3))})({element:this,featuresG:o(this,zr,"f"),contributorsLength:null===(s=o(this,Yr,"f"))||void 0===s?void 0:s.length})}null===(u=this.svg)||void 0===u||u.attr("height",this.layoutObj.maxYPos+this["margin-bottom"]),this.updateHighlight(),this.renderMarginOnGroup(this.margins)}}};function Gr(t,e){const n=t&&t>0?t:0;return Math.max(e||0,n)}function Dr(t,e,n){const r=t&&t>0?t:n||0;return Math.min(e||0,r)}Yr=new WeakMap,qr=new WeakMap,Lr=new WeakMap,Xr=new WeakMap,zr=new WeakMap,Hr=new WeakMap,Ir=new WeakMap,a([l({type:Boolean})],Br.prototype,"expanded",void 0),a([l({type:Boolean})],Br.prototype,"show-label",void 0),a([l({type:String})],Br.prototype,"label",void 0),Br=Wr=a([(t=>e=>"function"==typeof e?((t,e)=>(customElements.define(t,e),e))(t,e):((t,e)=>{const{kind:n,elements:r}=e;return{kind:n,elements:r,finisher(e){customElements.define(t,e)}}})(t,e))("nightingale-interpro-track")],Br);var Vr=Br;export{Vr as default}; | ||
*/}var l;null===(l=window.HTMLSlotElement)||void 0===l||l.prototype.assignedElements;var h={value:()=>{}};function c(){for(var t,e=0,n=arguments.length,r={};e<n;++e){if(!(t=arguments[e]+"")||t in r||/[\s.]/.test(t))throw new Error("illegal type: "+t);r[t]=[]}return new f(r)}function f(t){this._=t}function d(t,e){for(var n,r=0,i=t.length;r<i;++r)if((n=t[r]).name===e)return n.value}function p(t,e,n){for(var r=0,i=t.length;r<i;++r)if(t[r].name===e){t[r]=h,t=t.slice(0,r).concat(t.slice(r+1));break}return null!=n&&t.push({name:e,value:n}),t}f.prototype=c.prototype={constructor:f,on:function(t,e){var n,r,i=this._,a=(r=i,(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&&!r.hasOwnProperty(t))throw new Error("unknown type: "+t);return{type:t,name:e}}))),o=-1,s=a.length;if(!(arguments.length<2)){if(null!=e&&"function"!=typeof e)throw new Error("invalid callback: "+e);for(;++o<s;)if(n=(t=a[o]).type)i[n]=p(i[n],t.name,e);else if(null==e)for(n in i)i[n]=p(i[n],t.name,null);return this}for(;++o<s;)if((n=(t=a[o]).type)&&(n=d(i[n],t.name)))return n},copy:function(){var t={},e=this._;for(var n in e)t[n]=e[n].slice();return new f(t)},call:function(t,e){if((n=arguments.length-2)>0)for(var n,r,i=new Array(n),a=0;a<n;++a)i[a]=arguments[a+2];if(!this._.hasOwnProperty(t))throw new Error("unknown type: "+t);for(a=0,n=(r=this._[t]).length;a<n;++a)r[a].value.apply(e,i)},apply:function(t,e,n){if(!this._.hasOwnProperty(t))throw new Error("unknown type: "+t);for(var r=this._[t],i=0,a=r.length;i<a;++i)r[i].value.apply(e,n)}};var v="http://www.w3.org/1999/xhtml",g={svg:"http://www.w3.org/2000/svg",xhtml:v,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function y(t){var e=t+="",n=e.indexOf(":");return n>=0&&"xmlns"!==(e=t.slice(0,n))&&(t=t.slice(n+1)),g.hasOwnProperty(e)?{space:g[e],local:t}:t}function m(t){return function(){var e=this.ownerDocument,n=this.namespaceURI;return n===v&&e.documentElement.namespaceURI===v?e.createElement(t):e.createElementNS(n,t)}}function _(t){return function(){return this.ownerDocument.createElementNS(t.space,t.local)}}function w(t){var e=y(t);return(e.local?_:m)(e)}function b(){}function x(t){return null==t?b:function(){return this.querySelector(t)}}function k(){return[]}function A(t){return null==t?k:function(){return this.querySelectorAll(t)}}function $(t){return function(){return null==(e=t.apply(this,arguments))?[]:Array.isArray(e)?e:Array.from(e);var e}}function S(t){return function(){return this.matches(t)}}function j(t){return function(e){return e.matches(t)}}var E=Array.prototype.find;function O(){return this.firstElementChild}var P=Array.prototype.filter;function F(){return Array.from(this.children)}function M(t){return new Array(t.length)}function N(t,e){this.ownerDocument=t.ownerDocument,this.namespaceURI=t.namespaceURI,this._next=null,this._parent=t,this.__data__=e}function R(t,e,n,r,i,a){for(var o,s=0,u=e.length,l=a.length;s<l;++s)(o=e[s])?(o.__data__=a[s],r[s]=o):n[s]=new N(t,a[s]);for(;s<u;++s)(o=e[s])&&(i[s]=o)}function C(t,e,n,r,i,a,o){var s,u,l,h=new Map,c=e.length,f=a.length,d=new Array(c);for(s=0;s<c;++s)(u=e[s])&&(d[s]=l=o.call(u,u.__data__,s,e)+"",h.has(l)?i[s]=u:h.set(l,u));for(s=0;s<f;++s)l=o.call(t,a[s],s,a)+"",(u=h.get(l))?(r[s]=u,u.__data__=a[s],h.delete(l)):n[s]=new N(t,a[s]);for(s=0;s<c;++s)(u=e[s])&&h.get(d[s])===u&&(i[s]=u)}function T(t){return t.__data__}function Y(t){return"object"==typeof t&&"length"in t?t:Array.from(t)}function q(t,e){return t<e?-1:t>e?1:t>=e?0:NaN}function L(t){return function(){this.removeAttribute(t)}}function X(t){return function(){this.removeAttributeNS(t.space,t.local)}}function z(t,e){return function(){this.setAttribute(t,e)}}function H(t,e){return function(){this.setAttributeNS(t.space,t.local,e)}}function W(t,e){return function(){var n=e.apply(this,arguments);null==n?this.removeAttribute(t):this.setAttribute(t,n)}}function B(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 I(t){return t.ownerDocument&&t.ownerDocument.defaultView||t.document&&t||t.defaultView}function G(t){return function(){this.style.removeProperty(t)}}function D(t,e,n){return function(){this.style.setProperty(t,e,n)}}function V(t,e,n){return function(){var r=e.apply(this,arguments);null==r?this.style.removeProperty(t):this.style.setProperty(t,r,n)}}function U(t,e){return t.style.getPropertyValue(e)||I(t).getComputedStyle(t,null).getPropertyValue(e)}function K(t){return function(){delete this[t]}}function J(t,e){return function(){this[t]=e}}function Q(t,e){return function(){var n=e.apply(this,arguments);null==n?delete this[t]:this[t]=n}}function Z(t){return t.trim().split(/^|\s+/)}function tt(t){return t.classList||new et(t)}function et(t){this._node=t,this._names=Z(t.getAttribute("class")||"")}function nt(t,e){for(var n=tt(t),r=-1,i=e.length;++r<i;)n.add(e[r])}function rt(t,e){for(var n=tt(t),r=-1,i=e.length;++r<i;)n.remove(e[r])}function it(t){return function(){nt(this,t)}}function at(t){return function(){rt(this,t)}}function ot(t,e){return function(){(e.apply(this,arguments)?nt:rt)(this,t)}}function st(){this.textContent=""}function ut(t){return function(){this.textContent=t}}function lt(t){return function(){var e=t.apply(this,arguments);this.textContent=e??""}}function ht(){this.innerHTML=""}function ct(t){return function(){this.innerHTML=t}}function ft(t){return function(){var e=t.apply(this,arguments);this.innerHTML=e??""}}function dt(){this.nextSibling&&this.parentNode.appendChild(this)}function pt(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function vt(){return null}function gt(){var t=this.parentNode;t&&t.removeChild(this)}function yt(){var t=this.cloneNode(!1),e=this.parentNode;return e?e.insertBefore(t,this.nextSibling):t}function mt(){var t=this.cloneNode(!0),e=this.parentNode;return e?e.insertBefore(t,this.nextSibling):t}function _t(t){return function(){var e=this.__on;if(e){for(var n,r=0,i=-1,a=e.length;r<a;++r)n=e[r],t.type&&n.type!==t.type||n.name!==t.name?e[++i]=n:this.removeEventListener(n.type,n.listener,n.options);++i?e.length=i:delete this.__on}}}function wt(t,e,n){return function(){var r,i=this.__on,a=function(t){return function(e){t.call(this,e,this.__data__)}}(e);if(i)for(var o=0,s=i.length;o<s;++o)if((r=i[o]).type===t.type&&r.name===t.name)return this.removeEventListener(r.type,r.listener,r.options),this.addEventListener(r.type,r.listener=a,r.options=n),void(r.value=e);this.addEventListener(t.type,a,n),r={type:t.type,name:t.name,value:e,listener:a,options:n},i?i.push(r):this.__on=[r]}}function bt(t,e,n){var r=I(t),i=r.CustomEvent;"function"==typeof i?i=new i(e,n):(i=r.document.createEvent("Event"),n?(i.initEvent(e,n.bubbles,n.cancelable),i.detail=n.detail):i.initEvent(e,!1,!1)),t.dispatchEvent(i)}function xt(t,e){return function(){return bt(this,t,e)}}function kt(t,e){return function(){return bt(this,t,e.apply(this,arguments))}}N.prototype={constructor:N,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)}},et.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 At=[null];function $t(t,e){this._groups=t,this._parents=e}function St(){return new $t([[document.documentElement]],At)}function jt(t,e,n){t.prototype=e.prototype=n,n.constructor=t}function Et(t,e){var n=Object.create(t.prototype);for(var r in e)n[r]=e[r];return n}function Ot(){}$t.prototype=St.prototype={constructor:$t,select:function(t){"function"!=typeof t&&(t=x(t));for(var e=this._groups,n=e.length,r=new Array(n),i=0;i<n;++i)for(var a,o,s=e[i],u=s.length,l=r[i]=new Array(u),h=0;h<u;++h)(a=s[h])&&(o=t.call(a,a.__data__,h,s))&&("__data__"in a&&(o.__data__=a.__data__),l[h]=o);return new $t(r,this._parents)},selectAll:function(t){t="function"==typeof t?$(t):A(t);for(var e=this._groups,n=e.length,r=[],i=[],a=0;a<n;++a)for(var o,s=e[a],u=s.length,l=0;l<u;++l)(o=s[l])&&(r.push(t.call(o,o.__data__,l,s)),i.push(o));return new $t(r,i)},selectChild:function(t){return this.select(null==t?O:function(t){return function(){return E.call(this.children,t)}}("function"==typeof t?t:j(t)))},selectChildren:function(t){return this.selectAll(null==t?F:function(t){return function(){return P.call(this.children,t)}}("function"==typeof t?t:j(t)))},filter:function(t){"function"!=typeof t&&(t=S(t));for(var e=this._groups,n=e.length,r=new Array(n),i=0;i<n;++i)for(var a,o=e[i],s=o.length,u=r[i]=[],l=0;l<s;++l)(a=o[l])&&t.call(a,a.__data__,l,o)&&u.push(a);return new $t(r,this._parents)},data:function(t,e){if(!arguments.length)return Array.from(this,T);var n,r=e?C:R,i=this._parents,a=this._groups;"function"!=typeof t&&(n=t,t=function(){return n});for(var o=a.length,s=new Array(o),u=new Array(o),l=new Array(o),h=0;h<o;++h){var c=i[h],f=a[h],d=f.length,p=Y(t.call(c,c&&c.__data__,h,i)),v=p.length,g=u[h]=new Array(v),y=s[h]=new Array(v);r(c,f,g,y,l[h]=new Array(d),p,e);for(var m,_,w=0,b=0;w<v;++w)if(m=g[w]){for(w>=b&&(b=w+1);!(_=y[b])&&++b<v;);m._next=_||null}}return(s=new $t(s,i))._enter=u,s._exit=l,s},enter:function(){return new $t(this._enter||this._groups.map(M),this._parents)},exit:function(){return new $t(this._exit||this._groups.map(M),this._parents)},join:function(t,e,n){var r=this.enter(),i=this,a=this.exit();return"function"==typeof t?(r=t(r))&&(r=r.selection()):r=r.append(t+""),null!=e&&(i=e(i))&&(i=i.selection()),null==n?a.remove():n(a),r&&i?r.merge(i).order():i},merge:function(t){for(var e=t.selection?t.selection():t,n=this._groups,r=e._groups,i=n.length,a=r.length,o=Math.min(i,a),s=new Array(i),u=0;u<o;++u)for(var l,h=n[u],c=r[u],f=h.length,d=s[u]=new Array(f),p=0;p<f;++p)(l=h[p]||c[p])&&(d[p]=l);for(;u<i;++u)s[u]=n[u];return new $t(s,this._parents)},selection:function(){return this},order:function(){for(var t=this._groups,e=-1,n=t.length;++e<n;)for(var r,i=t[e],a=i.length-1,o=i[a];--a>=0;)(r=i[a])&&(o&&4^r.compareDocumentPosition(o)&&o.parentNode.insertBefore(r,o),o=r);return this},sort:function(t){function e(e,n){return e&&n?t(e.__data__,n.__data__):!e-!n}t||(t=q);for(var n=this._groups,r=n.length,i=new Array(r),a=0;a<r;++a){for(var o,s=n[a],u=s.length,l=i[a]=new Array(u),h=0;h<u;++h)(o=s[h])&&(l[h]=o);l.sort(e)}return new $t(i,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 r=t[e],i=0,a=r.length;i<a;++i){var o=r[i];if(o)return o}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,r=e.length;n<r;++n)for(var i,a=e[n],o=0,s=a.length;o<s;++o)(i=a[o])&&t.call(i,i.__data__,o,a);return this},attr:function(t,e){var n=y(t);if(arguments.length<2){var r=this.node();return n.local?r.getAttributeNS(n.space,n.local):r.getAttribute(n)}return this.each((null==e?n.local?X:L:"function"==typeof e?n.local?B:W:n.local?H:z)(n,e))},style:function(t,e,n){return arguments.length>1?this.each((null==e?G:"function"==typeof e?V:D)(t,e,n??"")):U(this.node(),t)},property:function(t,e){return arguments.length>1?this.each((null==e?K:"function"==typeof e?Q:J)(t,e)):this.node()[t]},classed:function(t,e){var n=Z(t+"");if(arguments.length<2){for(var r=tt(this.node()),i=-1,a=n.length;++i<a;)if(!r.contains(n[i]))return!1;return!0}return this.each(("function"==typeof e?ot:e?it:at)(n,e))},text:function(t){return arguments.length?this.each(null==t?st:("function"==typeof t?lt:ut)(t)):this.node().textContent},html:function(t){return arguments.length?this.each(null==t?ht:("function"==typeof t?ft:ct)(t)):this.node().innerHTML},raise:function(){return this.each(dt)},lower:function(){return this.each(pt)},append:function(t){var e="function"==typeof t?t:w(t);return this.select((function(){return this.appendChild(e.apply(this,arguments))}))},insert:function(t,e){var n="function"==typeof t?t:w(t),r=null==e?vt:"function"==typeof e?e:x(e);return this.select((function(){return this.insertBefore(n.apply(this,arguments),r.apply(this,arguments)||null)}))},remove:function(){return this.each(gt)},clone:function(t){return this.select(t?mt:yt)},datum:function(t){return arguments.length?this.property("__data__",t):this.node().__data__},on:function(t,e,n){var r,i,a=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+""),o=a.length;if(!(arguments.length<2)){for(s=e?wt:_t,r=0;r<o;++r)this.each(s(a[r],e,n));return this}var s=this.node().__on;if(s)for(var u,l=0,h=s.length;l<h;++l)for(r=0,u=s[l];r<o;++r)if((i=a[r]).type===u.type&&i.name===u.name)return u.value},dispatch:function(t,e){return this.each(("function"==typeof e?kt:xt)(t,e))},[Symbol.iterator]:function*(){for(var t=this._groups,e=0,n=t.length;e<n;++e)for(var r,i=t[e],a=0,o=i.length;a<o;++a)(r=i[a])&&(yield r)}};var Pt=.7,Ft=1/Pt,Mt="\\s*([+-]?\\d+)\\s*",Nt="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",Rt="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",Ct=/^#([0-9a-f]{3,8})$/,Tt=new RegExp(`^rgb\\(${Mt},${Mt},${Mt}\\)$`),Yt=new RegExp(`^rgb\\(${Rt},${Rt},${Rt}\\)$`),qt=new RegExp(`^rgba\\(${Mt},${Mt},${Mt},${Nt}\\)$`),Lt=new RegExp(`^rgba\\(${Rt},${Rt},${Rt},${Nt}\\)$`),Xt=new RegExp(`^hsl\\(${Nt},${Rt},${Rt}\\)$`),zt=new RegExp(`^hsla\\(${Nt},${Rt},${Rt},${Nt}\\)$`),Ht={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 Wt(){return this.rgb().formatHex()}function Bt(){return this.rgb().formatRgb()}function It(t){var e,n;return t=(t+"").trim().toLowerCase(),(e=Ct.exec(t))?(n=e[1].length,e=parseInt(e[1],16),6===n?Gt(e):3===n?new Ut(e>>8&15|e>>4&240,e>>4&15|240&e,(15&e)<<4|15&e,1):8===n?Dt(e>>24&255,e>>16&255,e>>8&255,(255&e)/255):4===n?Dt(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=Tt.exec(t))?new Ut(e[1],e[2],e[3],1):(e=Yt.exec(t))?new Ut(255*e[1]/100,255*e[2]/100,255*e[3]/100,1):(e=qt.exec(t))?Dt(e[1],e[2],e[3],e[4]):(e=Lt.exec(t))?Dt(255*e[1]/100,255*e[2]/100,255*e[3]/100,e[4]):(e=Xt.exec(t))?ee(e[1],e[2]/100,e[3]/100,1):(e=zt.exec(t))?ee(e[1],e[2]/100,e[3]/100,e[4]):Ht.hasOwnProperty(t)?Gt(Ht[t]):"transparent"===t?new Ut(NaN,NaN,NaN,0):null}function Gt(t){return new Ut(t>>16&255,t>>8&255,255&t,1)}function Dt(t,e,n,r){return r<=0&&(t=e=n=NaN),new Ut(t,e,n,r)}function Vt(t,e,n,r){return 1===arguments.length?((i=t)instanceof Ot||(i=It(i)),i?new Ut((i=i.rgb()).r,i.g,i.b,i.opacity):new Ut):new Ut(t,e,n,r??1);var i}function Ut(t,e,n,r){this.r=+t,this.g=+e,this.b=+n,this.opacity=+r}function Kt(){return`#${te(this.r)}${te(this.g)}${te(this.b)}`}function Jt(){const t=Qt(this.opacity);return`${1===t?"rgb(":"rgba("}${Zt(this.r)}, ${Zt(this.g)}, ${Zt(this.b)}${1===t?")":`, ${t})`}`}function Qt(t){return isNaN(t)?1:Math.max(0,Math.min(1,t))}function Zt(t){return Math.max(0,Math.min(255,Math.round(t)||0))}function te(t){return((t=Zt(t))<16?"0":"")+t.toString(16)}function ee(t,e,n,r){return r<=0?t=e=n=NaN:n<=0||n>=1?t=e=NaN:e<=0&&(t=NaN),new re(t,e,n,r)}function ne(t){if(t instanceof re)return new re(t.h,t.s,t.l,t.opacity);if(t instanceof Ot||(t=It(t)),!t)return new re;if(t instanceof re)return t;var e=(t=t.rgb()).r/255,n=t.g/255,r=t.b/255,i=Math.min(e,n,r),a=Math.max(e,n,r),o=NaN,s=a-i,u=(a+i)/2;return s?(o=e===a?(n-r)/s+6*(n<r):n===a?(r-e)/s+2:(e-n)/s+4,s/=u<.5?a+i:2-a-i,o*=60):s=u>0&&u<1?0:o,new re(o,s,u,t.opacity)}function re(t,e,n,r){this.h=+t,this.s=+e,this.l=+n,this.opacity=+r}function ie(t){return(t=(t||0)%360)<0?t+360:t}function ae(t){return Math.max(0,Math.min(1,t||0))}function oe(t,e,n){return 255*(t<60?e+(n-e)*t/60:t<180?n:t<240?e+(n-e)*(240-t)/60:e)}jt(Ot,It,{copy(t){return Object.assign(new this.constructor,this,t)},displayable(){return this.rgb().displayable()},hex:Wt,formatHex:Wt,formatHex8:function(){return this.rgb().formatHex8()},formatHsl:function(){return ne(this).formatHsl()},formatRgb:Bt,toString:Bt}),jt(Ut,Vt,Et(Ot,{brighter(t){return t=null==t?Ft:Math.pow(Ft,t),new Ut(this.r*t,this.g*t,this.b*t,this.opacity)},darker(t){return t=null==t?Pt:Math.pow(Pt,t),new Ut(this.r*t,this.g*t,this.b*t,this.opacity)},rgb(){return this},clamp(){return new Ut(Zt(this.r),Zt(this.g),Zt(this.b),Qt(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:Kt,formatHex:Kt,formatHex8:function(){return`#${te(this.r)}${te(this.g)}${te(this.b)}${te(255*(isNaN(this.opacity)?1:this.opacity))}`},formatRgb:Jt,toString:Jt})),jt(re,(function(t,e,n,r){return 1===arguments.length?ne(t):new re(t,e,n,r??1)}),Et(Ot,{brighter(t){return t=null==t?Ft:Math.pow(Ft,t),new re(this.h,this.s,this.l*t,this.opacity)},darker(t){return t=null==t?Pt:Math.pow(Pt,t),new re(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,r=n+(n<.5?n:1-n)*e,i=2*n-r;return new Ut(oe(t>=240?t-240:t+120,i,r),oe(t,i,r),oe(t<120?t+240:t-120,i,r),this.opacity)},clamp(){return new re(ie(this.h),ae(this.s),ae(this.l),Qt(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=Qt(this.opacity);return`${1===t?"hsl(":"hsla("}${ie(this.h)}, ${100*ae(this.s)}%, ${100*ae(this.l)}%${1===t?")":`, ${t})`}`}}));var se=t=>()=>t;function ue(t){return 1==(t=+t)?le: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(r){return Math.pow(t+r*e,n)}}(e,n,t):se(isNaN(e)?n:e)}}function le(t,e){var n=e-t;return n?function(t,e){return function(n){return t+n*e}}(t,n):se(isNaN(t)?e:t)}var he=function t(e){var n=ue(e);function r(t,e){var r=n((t=Vt(t)).r,(e=Vt(e)).r),i=n(t.g,e.g),a=n(t.b,e.b),o=le(t.opacity,e.opacity);return function(e){return t.r=r(e),t.g=i(e),t.b=a(e),t.opacity=o(e),t+""}}return r.gamma=t,r}(1);function ce(t,e){return t=+t,e=+e,function(n){return t*(1-n)+e*n}}var fe=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,de=new RegExp(fe.source,"g");function pe(t,e){var n,r,i,a=fe.lastIndex=de.lastIndex=0,o=-1,s=[],u=[];for(t+="",e+="";(n=fe.exec(t))&&(r=de.exec(e));)(i=r.index)>a&&(i=e.slice(a,i),s[o]?s[o]+=i:s[++o]=i),(n=n[0])===(r=r[0])?s[o]?s[o]+=r:s[++o]=r:(s[++o]=null,u.push({i:o,x:ce(n,r)})),a=de.lastIndex;return a<e.length&&(i=e.slice(a),s[o]?s[o]+=i:s[++o]=i),s.length<2?u[0]?function(t){return function(e){return t(e)+""}}(u[0].x):function(t){return function(){return t}}(e):(e=u.length,function(t){for(var n,r=0;r<e;++r)s[(n=u[r]).i]=n.x(t);return s.join("")})}var ve,ge=180/Math.PI,ye={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function me(t,e,n,r,i,a){var o,s,u;return(o=Math.sqrt(t*t+e*e))&&(t/=o,e/=o),(u=t*n+e*r)&&(n-=t*u,r-=e*u),(s=Math.sqrt(n*n+r*r))&&(n/=s,r/=s,u/=s),t*r<e*n&&(t=-t,e=-e,u=-u,o=-o),{translateX:i,translateY:a,rotate:Math.atan2(e,t)*ge,skewX:Math.atan(u)*ge,scaleX:o,scaleY:s}}function _e(t,e,n,r){function i(t){return t.length?t.pop()+" ":""}return function(a,o){var s=[],u=[];return a=t(a),o=t(o),function(t,r,i,a,o,s){if(t!==i||r!==a){var u=o.push("translate(",null,e,null,n);s.push({i:u-4,x:ce(t,i)},{i:u-2,x:ce(r,a)})}else(i||a)&&o.push("translate("+i+e+a+n)}(a.translateX,a.translateY,o.translateX,o.translateY,s,u),function(t,e,n,a){t!==e?(t-e>180?e+=360:e-t>180&&(t+=360),a.push({i:n.push(i(n)+"rotate(",null,r)-2,x:ce(t,e)})):e&&n.push(i(n)+"rotate("+e+r)}(a.rotate,o.rotate,s,u),function(t,e,n,a){t!==e?a.push({i:n.push(i(n)+"skewX(",null,r)-2,x:ce(t,e)}):e&&n.push(i(n)+"skewX("+e+r)}(a.skewX,o.skewX,s,u),function(t,e,n,r,a,o){if(t!==n||e!==r){var s=a.push(i(a)+"scale(",null,",",null,")");o.push({i:s-4,x:ce(t,n)},{i:s-2,x:ce(e,r)})}else 1===n&&1===r||a.push(i(a)+"scale("+n+","+r+")")}(a.scaleX,a.scaleY,o.scaleX,o.scaleY,s,u),a=o=null,function(t){for(var e,n=-1,r=u.length;++n<r;)s[(e=u[n]).i]=e.x(t);return s.join("")}}}var we,be,xe=_e((function(t){const e=new("function"==typeof DOMMatrix?DOMMatrix:WebKitCSSMatrix)(t+"");return e.isIdentity?ye:me(e.a,e.b,e.c,e.d,e.e,e.f)}),"px, ","px)","deg)"),ke=_e((function(t){return null==t?ye:(ve||(ve=document.createElementNS("http://www.w3.org/2000/svg","g")),ve.setAttribute("transform",t),(t=ve.transform.baseVal.consolidate())?me((t=t.matrix).a,t.b,t.c,t.d,t.e,t.f):ye)}),", ",")",")"),Ae=0,$e=0,Se=0,je=1e3,Ee=0,Oe=0,Pe=0,Fe="object"==typeof performance&&performance.now?performance:Date,Me="object"==typeof window&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(t){setTimeout(t,17)};function Ne(){return Oe||(Me(Re),Oe=Fe.now()+Pe)}function Re(){Oe=0}function Ce(){this._call=this._time=this._next=null}function Te(t,e,n){var r=new Ce;return r.restart(t,e,n),r}function Ye(){Oe=(Ee=Fe.now())+Pe,Ae=$e=0;try{!function(){Ne(),++Ae;for(var t,e=we;e;)(t=Oe-e._time)>=0&&e._call.call(void 0,t),e=e._next;--Ae}()}finally{Ae=0,function(){var t,e,n=we,r=1/0;for(;n;)n._call?(r>n._time&&(r=n._time),t=n,n=n._next):(e=n._next,n._next=null,n=t?t._next=e:we=e);be=t,Le(r)}(),Oe=0}}function qe(){var t=Fe.now(),e=t-Ee;e>je&&(Pe-=e,Ee=t)}function Le(t){Ae||($e&&($e=clearTimeout($e)),t-Oe>24?(t<1/0&&($e=setTimeout(Ye,t-Fe.now()-Pe)),Se&&(Se=clearInterval(Se))):(Se||(Ee=Fe.now(),Se=setInterval(qe,je)),Ae=1,Me(Ye)))}function Xe(t,e,n){var r=new Ce;return e=null==e?0:+e,r.restart((n=>{r.stop(),t(n+e)}),e,n),r}Ce.prototype=Te.prototype={constructor:Ce,restart:function(t,e,n){if("function"!=typeof t)throw new TypeError("callback is not a function");n=(null==n?Ne():+n)+(null==e?0:+e),this._next||be===this||(be?be._next=this:we=this,be=this),this._call=t,this._time=n,Le()},stop:function(){this._call&&(this._call=null,this._time=1/0,Le())}};var ze=c("start","end","cancel","interrupt"),He=[],We=0,Be=1,Ie=2,Ge=3,De=4,Ve=5,Ue=6;function Ke(t,e,n,r,i,a){var o=t.__transition;if(o){if(n in o)return}else t.__transition={};!function(t,e,n){var r,i=t.__transition;function a(t){n.state=Be,n.timer.restart(o,n.delay,n.time),n.delay<=t&&o(t-n.delay)}function o(a){var l,h,c,f;if(n.state!==Be)return u();for(l in i)if((f=i[l]).name===n.name){if(f.state===Ge)return Xe(o);f.state===De?(f.state=Ue,f.timer.stop(),f.on.call("interrupt",t,t.__data__,f.index,f.group),delete i[l]):+l<e&&(f.state=Ue,f.timer.stop(),f.on.call("cancel",t,t.__data__,f.index,f.group),delete i[l])}if(Xe((function(){n.state===Ge&&(n.state=De,n.timer.restart(s,n.delay,n.time),s(a))})),n.state=Ie,n.on.call("start",t,t.__data__,n.index,n.group),n.state===Ie){for(n.state=Ge,r=new Array(c=n.tween.length),l=0,h=-1;l<c;++l)(f=n.tween[l].value.call(t,t.__data__,n.index,n.group))&&(r[++h]=f);r.length=h+1}}function s(e){for(var i=e<n.duration?n.ease.call(null,e/n.duration):(n.timer.restart(u),n.state=Ve,1),a=-1,o=r.length;++a<o;)r[a].call(t,i);n.state===Ve&&(n.on.call("end",t,t.__data__,n.index,n.group),u())}function u(){for(var r in n.state=Ue,n.timer.stop(),delete i[e],i)return;delete t.__transition}i[e]=n,n.timer=Te(a,0,n.time)}(t,n,{name:e,index:r,group:i,on:ze,tween:He,time:a.time,delay:a.delay,duration:a.duration,ease:a.ease,timer:null,state:We})}function Je(t,e){var n=Ze(t,e);if(n.state>We)throw new Error("too late; already scheduled");return n}function Qe(t,e){var n=Ze(t,e);if(n.state>Ge)throw new Error("too late; already running");return n}function Ze(t,e){var n=t.__transition;if(!n||!(n=n[e]))throw new Error("transition not found");return n}function tn(t,e){var n,r;return function(){var i=Qe(this,t),a=i.tween;if(a!==n)for(var o=0,s=(r=n=a).length;o<s;++o)if(r[o].name===e){(r=r.slice()).splice(o,1);break}i.tween=r}}function en(t,e,n){var r,i;if("function"!=typeof n)throw new Error;return function(){var a=Qe(this,t),o=a.tween;if(o!==r){i=(r=o).slice();for(var s={name:e,value:n},u=0,l=i.length;u<l;++u)if(i[u].name===e){i[u]=s;break}u===l&&i.push(s)}a.tween=i}}function nn(t,e,n){var r=t._id;return t.each((function(){var t=Qe(this,r);(t.value||(t.value={}))[e]=n.apply(this,arguments)})),function(t){return Ze(t,r).value[e]}}function rn(t,e){var n;return("number"==typeof e?ce:e instanceof It?he:(n=It(e))?(e=n,he):pe)(t,e)}function an(t){return function(){this.removeAttribute(t)}}function on(t){return function(){this.removeAttributeNS(t.space,t.local)}}function sn(t,e,n){var r,i,a=n+"";return function(){var o=this.getAttribute(t);return o===a?null:o===r?i:i=e(r=o,n)}}function un(t,e,n){var r,i,a=n+"";return function(){var o=this.getAttributeNS(t.space,t.local);return o===a?null:o===r?i:i=e(r=o,n)}}function ln(t,e,n){var r,i,a;return function(){var o,s,u=n(this);if(null!=u)return(o=this.getAttribute(t))===(s=u+"")?null:o===r&&s===i?a:(i=s,a=e(r=o,u));this.removeAttribute(t)}}function hn(t,e,n){var r,i,a;return function(){var o,s,u=n(this);if(null!=u)return(o=this.getAttributeNS(t.space,t.local))===(s=u+"")?null:o===r&&s===i?a:(i=s,a=e(r=o,u));this.removeAttributeNS(t.space,t.local)}}function cn(t,e){var n,r;function i(){var i=e.apply(this,arguments);return i!==r&&(n=(r=i)&&function(t,e){return function(n){this.setAttributeNS(t.space,t.local,e.call(this,n))}}(t,i)),n}return i._value=e,i}function fn(t,e){var n,r;function i(){var i=e.apply(this,arguments);return i!==r&&(n=(r=i)&&function(t,e){return function(n){this.setAttribute(t,e.call(this,n))}}(t,i)),n}return i._value=e,i}function dn(t,e){return function(){Je(this,t).delay=+e.apply(this,arguments)}}function pn(t,e){return e=+e,function(){Je(this,t).delay=e}}function vn(t,e){return function(){Qe(this,t).duration=+e.apply(this,arguments)}}function gn(t,e){return e=+e,function(){Qe(this,t).duration=e}}var yn=St.prototype.constructor;function mn(t){return function(){this.style.removeProperty(t)}}var _n=0;function wn(t,e,n,r){this._groups=t,this._parents=e,this._name=n,this._id=r}function bn(){return++_n}var xn=St.prototype;wn.prototype={constructor:wn,select:function(t){var e=this._name,n=this._id;"function"!=typeof t&&(t=x(t));for(var r=this._groups,i=r.length,a=new Array(i),o=0;o<i;++o)for(var s,u,l=r[o],h=l.length,c=a[o]=new Array(h),f=0;f<h;++f)(s=l[f])&&(u=t.call(s,s.__data__,f,l))&&("__data__"in s&&(u.__data__=s.__data__),c[f]=u,Ke(c[f],e,n,f,c,Ze(s,n)));return new wn(a,this._parents,e,n)},selectAll:function(t){var e=this._name,n=this._id;"function"!=typeof t&&(t=A(t));for(var r=this._groups,i=r.length,a=[],o=[],s=0;s<i;++s)for(var u,l=r[s],h=l.length,c=0;c<h;++c)if(u=l[c]){for(var f,d=t.call(u,u.__data__,c,l),p=Ze(u,n),v=0,g=d.length;v<g;++v)(f=d[v])&&Ke(f,e,n,v,d,p);a.push(d),o.push(u)}return new wn(a,o,e,n)},selectChild:xn.selectChild,selectChildren:xn.selectChildren,filter:function(t){"function"!=typeof t&&(t=S(t));for(var e=this._groups,n=e.length,r=new Array(n),i=0;i<n;++i)for(var a,o=e[i],s=o.length,u=r[i]=[],l=0;l<s;++l)(a=o[l])&&t.call(a,a.__data__,l,o)&&u.push(a);return new wn(r,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,r=e.length,i=n.length,a=Math.min(r,i),o=new Array(r),s=0;s<a;++s)for(var u,l=e[s],h=n[s],c=l.length,f=o[s]=new Array(c),d=0;d<c;++d)(u=l[d]||h[d])&&(f[d]=u);for(;s<r;++s)o[s]=e[s];return new wn(o,this._parents,this._name,this._id)},selection:function(){return new yn(this._groups,this._parents)},transition:function(){for(var t=this._name,e=this._id,n=bn(),r=this._groups,i=r.length,a=0;a<i;++a)for(var o,s=r[a],u=s.length,l=0;l<u;++l)if(o=s[l]){var h=Ze(o,e);Ke(o,t,n,l,s,{time:h.time+h.delay+h.duration,delay:0,duration:h.duration,ease:h.ease})}return new wn(r,this._parents,t,n)},call:xn.call,nodes:xn.nodes,node:xn.node,size:xn.size,empty:xn.empty,each:xn.each,on:function(t,e){var n=this._id;return arguments.length<2?Ze(this.node(),n).on.on(t):this.each(function(t,e,n){var r,i,a=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)?Je:Qe;return function(){var o=a(this,t),s=o.on;s!==r&&(i=(r=s).copy()).on(e,n),o.on=i}}(n,t,e))},attr:function(t,e){var n=y(t),r="transform"===n?ke:rn;return this.attrTween(t,"function"==typeof e?(n.local?hn:ln)(n,r,nn(this,"attr."+t,e)):null==e?(n.local?on:an)(n):(n.local?un:sn)(n,r,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 r=y(t);return this.tween(n,(r.local?cn:fn)(r,e))},style:function(t,e,n){var r="transform"==(t+="")?xe:rn;return null==e?this.styleTween(t,function(t,e){var n,r,i;return function(){var a=U(this,t),o=(this.style.removeProperty(t),U(this,t));return a===o?null:a===n&&o===r?i:i=e(n=a,r=o)}}(t,r)).on("end.style."+t,mn(t)):"function"==typeof e?this.styleTween(t,function(t,e,n){var r,i,a;return function(){var o=U(this,t),s=n(this),u=s+"";return null==s&&(this.style.removeProperty(t),u=s=U(this,t)),o===u?null:o===r&&u===i?a:(i=u,a=e(r=o,s))}}(t,r,nn(this,"style."+t,e))).each(function(t,e){var n,r,i,a,o="style."+e,s="end."+o;return function(){var u=Qe(this,t),l=u.on,h=null==u.value[o]?a||(a=mn(e)):void 0;l===n&&i===h||(r=(n=l).copy()).on(s,i=h),u.on=r}}(this._id,t)):this.styleTween(t,function(t,e,n){var r,i,a=n+"";return function(){var o=U(this,t);return o===a?null:o===r?i:i=e(r=o,n)}}(t,r,e),n).on("end.style."+t,null)},styleTween:function(t,e,n){var r="style."+(t+="");if(arguments.length<2)return(r=this.tween(r))&&r._value;if(null==e)return this.tween(r,null);if("function"!=typeof e)throw new Error;return this.tween(r,function(t,e,n){var r,i;function a(){var a=e.apply(this,arguments);return a!==i&&(r=(i=a)&&function(t,e,n){return function(r){this.style.setProperty(t,e.call(this,r),n)}}(t,a,n)),r}return a._value=e,a}(t,e,n??""))},text:function(t){return this.tween("text","function"==typeof t?function(t){return function(){var e=t(this);this.textContent=e??""}}(nn(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 r(){var r=t.apply(this,arguments);return r!==n&&(e=(n=r)&&function(t){return function(e){this.textContent=t.call(this,e)}}(r)),e}return r._value=t,r}(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 r,i=Ze(this.node(),n).tween,a=0,o=i.length;a<o;++a)if((r=i[a]).name===t)return r.value;return null}return this.each((null==e?tn:en)(n,t,e))},delay:function(t){var e=this._id;return arguments.length?this.each(("function"==typeof t?dn:pn)(e,t)):Ze(this.node(),e).delay},duration:function(t){var e=this._id;return arguments.length?this.each(("function"==typeof t?vn:gn)(e,t)):Ze(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(){Qe(this,t).ease=e}}(e,t)):Ze(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;Qe(this,t).ease=n}}(this._id,t))},end:function(){var t,e,n=this,r=n._id,i=n.size();return new Promise((function(a,o){var s={value:o},u={value:function(){0==--i&&a()}};n.each((function(){var n=Qe(this,r),i=n.on;i!==t&&((e=(t=i).copy())._.cancel.push(s),e._.interrupt.push(s),e._.end.push(u)),n.on=e})),0===i&&a()}))},[Symbol.iterator]:xn[Symbol.iterator]};var kn={time:null,delay:0,duration:250,ease:function(t){return((t*=2)<=1?t*t*t:(t-=2)*t*t+2)/2}};function An(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 $n(t,e,n){this.k=t,this.x=e,this.y=n}St.prototype.interrupt=function(t){return this.each((function(){!function(t,e){var n,r,i,a=t.__transition,o=!0;if(a){for(i in e=null==e?null:e+"",a)(n=a[i]).name===e?(r=n.state>Ie&&n.state<Ve,n.state=Ue,n.timer.stop(),n.on.call(r?"interrupt":"cancel",t,t.__data__,n.index,n.group),delete a[i]):o=!1;o&&delete t.__transition}}(this,t)}))},St.prototype.transition=function(t){var e,n;t instanceof wn?(e=t._id,t=t._name):(e=bn(),(n=kn).time=Ne(),t=null==t?null:t+"");for(var r=this._groups,i=r.length,a=0;a<i;++a)for(var o,s=r[a],u=s.length,l=0;l<u;++l)(o=s[l])&&Ke(o,t,e,l,s,n||An(o,e));return new wn(r,this._parents,t,e)},$n.prototype={constructor:$n,scale:function(t){return 1===t?this:new $n(this.k*t,this.x,this.y)},translate:function(t,e){return 0===t&0===e?this:new $n(this.k,this.x+this.k*t,this.y+this.k*e)},apply:function(t){return[t[0]*this.k+this.x,t[1]*this.k+this.y]},applyX:function(t){return t*this.k+this.x},applyY:function(t){return t*this.k+this.y},invert:function(t){return[(t[0]-this.x)/this.k,(t[1]-this.y)/this.k]},invertX:function(t){return(t-this.x)/this.k},invertY:function(t){return(t-this.y)/this.k},rescaleX:function(t){return t.copy().domain(t.range().map(this.invertX,this).map(t.invert,t))},rescaleY:function(t){return t.copy().domain(t.range().map(this.invertY,this).map(t.invert,t))},toString:function(){return"translate("+this.x+","+this.y+") scale("+this.k+")"}},$n.prototype;var Sn=Array.isArray,jn="object"==typeof global&&global&&global.Object===Object&&global,En="object"==typeof self&&self&&self.Object===Object&&self,On=jn||En||Function("return this")(),Pn=On.Symbol,Fn=Object.prototype,Mn=Fn.hasOwnProperty,Nn=Fn.toString,Rn=Pn?Pn.toStringTag:void 0;var Cn=Object.prototype.toString;var Tn="[object Null]",Yn="[object Undefined]",qn=Pn?Pn.toStringTag:void 0;function Ln(t){return null==t?void 0===t?Yn:Tn:qn&&qn in Object(t)?function(t){var e=Mn.call(t,Rn),n=t[Rn];try{t[Rn]=void 0;var r=!0}catch(t){}var i=Nn.call(t);return r&&(e?t[Rn]=n:delete t[Rn]),i}(t):function(t){return Cn.call(t)}(t)}var Xn="[object Symbol]";function zn(t){return"symbol"==typeof t||function(t){return null!=t&&"object"==typeof t}(t)&&Ln(t)==Xn}var Hn=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Wn=/^\w*$/;function Bn(t){var e=typeof t;return null!=t&&("object"==e||"function"==e)}var In="[object AsyncFunction]",Gn="[object Function]",Dn="[object GeneratorFunction]",Vn="[object Proxy]";var Un,Kn=On["__core-js_shared__"],Jn=(Un=/[^.]+$/.exec(Kn&&Kn.keys&&Kn.keys.IE_PROTO||""))?"Symbol(src)_1."+Un:"";var Qn=Function.prototype.toString;var Zn=/^\[object .+?Constructor\]$/,tr=Function.prototype,er=Object.prototype,nr=tr.toString,rr=er.hasOwnProperty,ir=RegExp("^"+nr.call(rr).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function ar(t){if(!Bn(t)||(e=t,Jn&&Jn in e))return!1;var e,n=function(t){if(!Bn(t))return!1;var e=Ln(t);return e==Gn||e==Dn||e==In||e==Vn}(t)?ir:Zn;return n.test(function(t){if(null!=t){try{return Qn.call(t)}catch(t){}try{return t+""}catch(t){}}return""}(t))}function or(t,e){var n=function(t,e){return null==t?void 0:t[e]}(t,e);return ar(n)?n:void 0}var sr=or(Object,"create");var ur=Object.prototype.hasOwnProperty;var lr=Object.prototype.hasOwnProperty;function hr(t){var e=-1,n=null==t?0:t.length;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}function cr(t,e){for(var n,r,i=t.length;i--;)if((n=t[i][0])===(r=e)||n!=n&&r!=r)return i;return-1}hr.prototype.clear=function(){this.__data__=sr?sr(null):{},this.size=0},hr.prototype.delete=function(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e},hr.prototype.get=function(t){var e=this.__data__;if(sr){var n=e[t];return"__lodash_hash_undefined__"===n?void 0:n}return ur.call(e,t)?e[t]:void 0},hr.prototype.has=function(t){var e=this.__data__;return sr?void 0!==e[t]:lr.call(e,t)},hr.prototype.set=function(t,e){var n=this.__data__;return this.size+=this.has(t)?0:1,n[t]=sr&&void 0===e?"__lodash_hash_undefined__":e,this};var fr=Array.prototype.splice;function dr(t){var e=-1,n=null==t?0:t.length;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}dr.prototype.clear=function(){this.__data__=[],this.size=0},dr.prototype.delete=function(t){var e=this.__data__,n=cr(e,t);return!(n<0)&&(n==e.length-1?e.pop():fr.call(e,n,1),--this.size,!0)},dr.prototype.get=function(t){var e=this.__data__,n=cr(e,t);return n<0?void 0:e[n][1]},dr.prototype.has=function(t){return cr(this.__data__,t)>-1},dr.prototype.set=function(t,e){var n=this.__data__,r=cr(n,t);return r<0?(++this.size,n.push([t,e])):n[r][1]=e,this};var pr=or(On,"Map");function vr(t,e){var n,r,i=t.__data__;return("string"==(r=typeof(n=e))||"number"==r||"symbol"==r||"boolean"==r?"__proto__"!==n:null===n)?i["string"==typeof e?"string":"hash"]:i.map}function gr(t){var e=-1,n=null==t?0:t.length;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}gr.prototype.clear=function(){this.size=0,this.__data__={hash:new hr,map:new(pr||dr),string:new hr}},gr.prototype.delete=function(t){var e=vr(this,t).delete(t);return this.size-=e?1:0,e},gr.prototype.get=function(t){return vr(this,t).get(t)},gr.prototype.has=function(t){return vr(this,t).has(t)},gr.prototype.set=function(t,e){var n=vr(this,t),r=n.size;return n.set(t,e),this.size+=n.size==r?0:1,this};var yr="Expected a function";function mr(t,e){if("function"!=typeof t||null!=e&&"function"!=typeof e)throw new TypeError(yr);var n=function(){var r=arguments,i=e?e.apply(this,r):r[0],a=n.cache;if(a.has(i))return a.get(i);var o=t.apply(this,r);return n.cache=a.set(i,o)||a,o};return n.cache=new(mr.Cache||gr),n}mr.Cache=gr;var _r,wr,br,xr=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,kr=/\\(\\)?/g,Ar=(_r=function(t){var e=[];return 46===t.charCodeAt(0)&&e.push(""),t.replace(xr,(function(t,n,r,i){e.push(r?i.replace(kr,"$1"):n||t)})),e},wr=mr(_r,(function(t){return 500===br.size&&br.clear(),t})),br=wr.cache,wr),$r=Ar;var Sr=1/0,jr=Pn?Pn.prototype:void 0,Er=jr?jr.toString:void 0;function Or(t){if("string"==typeof t)return t;if(Sn(t))return function(t,e){for(var n=-1,r=null==t?0:t.length,i=Array(r);++n<r;)i[n]=e(t[n],n,t);return i}(t,Or)+"";if(zn(t))return Er?Er.call(t):"";var e=t+"";return"0"==e&&1/t==-Sr?"-0":e}function Pr(t,e){return Sn(t)?t:function(t,e){if(Sn(t))return!1;var n=typeof t;return!("number"!=n&&"symbol"!=n&&"boolean"!=n&&null!=t&&!zn(t))||Wn.test(t)||!Hn.test(t)||null!=e&&t in Object(e)}(t,e)?[t]:$r(function(t){return null==t?"":Or(t)}(t))}var Fr,Mr,Nr,Rr,Cr=1/0;function Tr(t){if("string"==typeof t||zn(t))return t;var e=t+"";return"0"==e&&1/t==-Cr?"-0":e}function Yr(t,e,n){var r=null==t?void 0:function(t,e){for(var n=0,r=(e=Pr(e,t)).length;null!=t&&n<r;)t=t[Tr(e[n++])];return n&&n==r?t:void 0}(t,e);return void 0===r?n:r}class qr extends r{constructor({expanded:t,padding:e,...n}){super(n),Fr.add(this),Mr.set(this,new Map),Nr.set(this,new Map),this.maxYPos=0,this.expanded=!1,this.padding=1,this.expanded=t,this.padding=e}init(t,e){var n;let r=0;if(o(this,Mr,new Map,"f"),o(this,Nr,new Map,"f"),this.maxYPos=0,!t)return;const i={};for(let o=0;o<t.length;o++){const s=t[o],u=(null===(n=null==s?void 0:s.residues)||void 0===n?void 0:n.length)||(null==e?void 0:e.length);a(this,Mr,"f").set(s.accession,u&&!this.expanded?16:14),a(this,Nr,"f").set(s.accession,this.padding),r=(a(this,Mr,"f").get(s.accession)||0)+2*this.padding,this.maxYPos=Math.max(this.maxYPos,r),s.accession in i||(i[s.accession]={}),s.residues&&(r=a(this,Fr,"m",Rr).call(this,s.residues,s.accession,this.expanded?r:a(this,Nr,"f").get(s.accession)||0,o,3,s.locations,i,this.expanded))}if(e)for(let t=0;t<e.length;t++){const n=e[t];a(this,Mr,"f").has(n.accession)||(a(this,Mr,"f").set(n.accession,10),a(this,Nr,"f").set(n.accession,(this.expanded?this.maxYPos:3)+this.padding),r+=this.expanded?2*this.padding+(a(this,Mr,"f").get(n.accession)||14):0,this.maxYPos=Math.max(this.maxYPos,r)),n.accession in i||(i[n.accession]={}),n.residues&&(r=a(this,Fr,"m",Rr).call(this,n.residues,n.accession,n.expanded?r:a(this,Nr,"f").get(n.accession)||0,t,3,n.locations,i,this.expanded&&n.expanded))}this.maxYPos+=this.padding}static filterOutResidueFragmentsOutOfLocation(t,e){t.locations.forEach((t=>t.fragments=t.fragments.filter((t=>e.some((e=>e.fragments.some((e=>t.start>=e.start&&t.end<=e.end)))))))),t.locations=t.locations.filter((t=>t.fragments.length))}static getAccFromFeature(t){let e="";return"string"==typeof t?e=t:t.accession&&(e=t.accession),e}getFeatureYPos(t){const e=qr.getAccFromFeature(t);return a(this,Nr,"f").get(e)||0}getFeatureHeight(t){const e=qr.getAccFromFeature(t);return a(this,Mr,"f").get(e)||0}}Mr=new WeakMap,Nr=new WeakMap,Fr=new WeakSet,Rr=function(t,e,n,r,i,o,s={},u=!0){for(let l=0;l<t.length;l++){const h=t[l];qr.filterOutResidueFragmentsOutOfLocation(h,o||[]),h.accession in s[e]||(s[e][h.accession]={});for(let t=0;t<h.locations.length;t++){const o=h.locations[t].description;o in s[e][h.accession]||(s[e][h.accession][o]={height:u?10:(a(this,Mr,"f").get(e)||14)-2*i,yPos:u?this.maxYPos+this.padding:n+i},n=u?this.maxYPos+2*this.padding+10:n),a(this,Mr,"f").set(`${h.accession}_${r}_${l}_${t}`,s[e][h.accession][o].height),a(this,Nr,"f").set(`${h.accession}_${r}_${l}_${t}`,s[e][h.accession][o].yPos),this.maxYPos=Math.max(this.maxYPos,n)}}return u?n:this.maxYPos+2*this.padding};const Lr=(t,e)=>{let n={value:1,...t};const r=[];for(const t of e)n?n.end<t.start?(r.push(n),n=null,r.push(t)):n.start<t.start&&n.end>=t.end?(r.push({start:n.start,end:t.start-1,value:n.value}),r.push({start:t.start,end:t.end,value:(t.value||0)+((null==n?void 0:n.value)||0)}),n=t.end===n.end?null:{start:t.end+1,end:n.end,value:n.value}):t.start<n.start&&t.end>n.end?(r.push({start:t.start,end:n.start-1,value:t.value}),r.push({start:n.start,end:n.end,value:(t.value||0)+((null==n?void 0:n.value)||0)}),r.push({start:n.end+1,end:t.end,value:t.value}),n=null):t.end>=n.start&&t.end<=n.end?(t.start<n.start&&r.push({start:t.start,end:n.start-1,value:t.value}),r.push({start:n.start,end:t.end,value:(t.value||0)+((null==n?void 0:n.value)||0)}),n=t.end<n.end?{start:t.end+1,end:n.end,value:n.value}:null):n.end>=t.start&&n.end<t.end?(r.push({start:n.start,end:t.start-1,value:n.value}),r.push({start:t.start,end:n.end,value:(t.value||0)+((null==n?void 0:n.value)||0)}),r.push({start:n.end+1,end:t.end,value:t.value}),n=null):r.push(t):r.push(t);return n&&r.push(n),r},Xr=t=>t.selectAll("g.residues-group").data((t=>{var e;return(null===(e=t.residues)||void 0===e?void 0:e.map(((e,n)=>({...e,feature:t,i:n}))))||[]})).enter().append("g").attr("class","residues-group").selectAll("g.residues-locations").data((t=>t.locations.map(((e,n)=>({...e,accession:t.accession,feature:t.feature,location:e,i:t.i,j:n}))))).enter().append("g").attr("class","residues-locations"),zr=({baseG:e,getResidueShape:n,getResidueTransform:r,getResidueFill:i,element:a})=>e.selectAll("path.residue").data((t=>t.fragments.map((e=>({...e,accession:t.accession,feature:{...t.feature,currentResidue:{...e,description:t.location.description}},location:t.location,k:t.feature.k,i:t.i,j:t.j}))))).enter().append("path").attr("class","feature rectangle residue").attr("d",n).attr("transform",r).attr("fill",i).attr("stroke","transparent").call(t,a),Hr=({baseG:t,expanded:e,getResidueShape:n,getResidueTransform:r,getResidueFill:i})=>{const a=t.selectAll("path.residue"),o=new Set(a.data().map((t=>{var e,n;return`${null===(e=t.feature)||void 0===e?void 0:e.accession}-${null===(n=t.location)||void 0===n?void 0:n.description}`}))).size;a.attr("d",n).attr("transform",r).style("pointer-events",(t=>e||t.feature&&t.feature.expanded?"auto":"none")).style("stroke",(()=>e?null:"none")).style("opacity",(()=>e?null:.8/o)).attr("fill",i)};var Wr,Br,Ir,Gr,Dr,Vr,Ur,Kr;const Jr={};let Qr=Kr=class extends n{constructor(){super(),this.expanded=!1,this["show-label"]=!1,this.label=null,this.layout=void 0,Wr.set(this,void 0),Br.set(this,void 0),Ir.set(this,!1),Gr.set(this,void 0),Dr.set(this,void 0),Vr.set(this,void 0),Ur.set(this,void 0),this["margin-top"]=2,this["margin-bottom"]=2}createTrack(){this.layoutObj&&(this.layoutObj.expanded=!!this.expanded,o(this,Gr,void 0,"f"),super.createTrack())}connectedCallback(){super.connectedCallback(),o(this,Ir,!1,"f")}attributeChangedCallback(t,e,n){if(super.attributeChangedCallback(t,e,n),"expanded"===t&&e!==n&&a(this,Wr,"f"))for(const t of a(this,Wr,"f"))t.expanded=!e}set contributors(t){o(this,Wr,Kr.normalizeLocations(t),"f"),o(this,Br,((t,e=100,n=!0)=>{let r=[];return n&&(r=Lr({start:1,end:e,value:0},r)),t.forEach((t=>{var e;return null===(e=t.locations)||void 0===e?void 0:e.forEach((t=>t.fragments.forEach((t=>{r=Lr(t,r)}))))})),r})(a(this,Wr,"f"),this.length),"f"),this.data&&this.createTrack()}getLayout(){return new qr({layoutHeight:this.height,expanded:!!this.expanded,padding:(this["margin-top"]+this["margin-bottom"])/2})}createFeatures(){var e,n,r,i,s,u;if(!this.seqG)return;null===(e=this.layoutObj)||void 0===e||e.init(this.data,a(this,Wr,"f")),this.data.forEach(((t,e)=>t.k=e)),o(this,Dr,this.seqG.selectAll("g.feature-group").data(this.data).enter().append("g").attr("class","feature-group").attr("id",(t=>`g_${t.accession}`)),"f");const l=a(this,Dr,"f").selectAll("g.location-group").data((t=>{var e;return(null===(e=t.locations)||void 0===e?void 0:e.map((e=>({...e,feature:t}))))||[]})).enter().append("g").attr("class","location-group").style("cursor",a(this,Wr,"f")?"pointer":"default");if(l.selectAll("line.cover").data((t=>[t.fragments.reduce(((e,n)=>({start:Math.min(e.start,n.start),end:Math.max(e.end,n.end),feature:t.feature})),{start:1/0,end:-1/0})])).enter().append("line").attr("class","cover"),l.selectAll("path.feature").data((t=>t.fragments.map((e=>({...e,feature:t.feature,fragments:t.fragments}))))).enter().append("path").attr("class",(t=>`${this.getShape(t)} feature`)).on("click.expanded",(()=>{this.expanded?this.removeAttribute("expanded"):this.setAttribute("expanded","expanded")})).call(t,this),l.selectAll("text.feature-label").data((t=>t.fragments.map((e=>({...e,feature:t.feature,fragments:t.fragments}))))).enter().append("text").attr("class","feature-label").attr("dominant-baseline","middle").attr("text-anchor","middle").style("cursor","inherit").style("pointer-events","none"),o(this,Vr,Xr(a(this,Dr,"f")),"f"),zr({baseG:a(this,Vr,"f"),getResidueShape:t=>this.getResidueShape(t),getResidueTransform:t=>this.getResidueTransform(t),getResidueFill:t=>this.getResidueFill(t,!!this.expanded),element:this}),a(this,Wr,"f")){a(this,Wr,"f").forEach(((t,e)=>t.k=e)),a(this,Gr,"f")||o(this,Gr,null===(n=this.svg)||void 0===n?void 0:n.append("g").attr("class","children-features"),"f");const e=null===(r=a(this,Gr,"f"))||void 0===r?void 0:r.append("g").attr("class","children-group"),s=null==e?void 0:e.selectAll("g.child-group").data(a(this,Wr,"f")).enter().append("g").attr("class","child-group");if(!s)return;const u=s.selectAll("g.child-location-group").data((t=>(t.expanded=this.expanded,(t.locations||[]).map((e=>({...e,feature:t})))))).enter().append("g").attr("class",((t,e)=>`child-location-group clg-${e}`));null==u||u.selectAll("line.cover").data((t=>[t.fragments.reduce(((e,n)=>({start:Math.min(e.start,n.start),end:Math.max(e.end,n.end),feature:t.feature})),{start:1/0,end:-1/0})])).enter().append("line").attr("class","cover"),null==u||u.selectAll("path.child-fragment").data((t=>t.fragments.map((e=>({...e,feature:t.feature,fragments:t.fragments}))))).enter().append("path").attr("class",(t=>`${this.getShape(t)} child-fragment feature`)).call(t,this).on("click.expanded",((t,e)=>{e.feature.expanded=!e.feature.expanded,this.refresh()})),u.selectAll("text.child-label").data((t=>t.fragments.map((e=>({...e,feature:t.feature,fragments:t.fragments}))))).enter().append("text").attr("class","child-label").attr("dominant-baseline","middle").attr("text-anchor","middle").style("cursor","default").style("pointer-events","none"),o(this,Ur,Xr(s),"f"),zr({baseG:a(this,Ur,"f"),getResidueShape:t=>this.getResidueShape(t),getResidueTransform:t=>this.getResidueTransform(t),getResidueFill:t=>{var e;return this.getResidueFill(t,!!(null===(e=t.feature)||void 0===e?void 0:e.expanded))},element:this}),(null===(i=a(this,Br,"f"))||void 0===i?void 0:i.length)&&(({element:t,coverage:e})=>{var n,r,i;t.accession=(null===(r=null===(n=null==t?void 0:t.data)||void 0===n?void 0:n[0])||void 0===r?void 0:r.accession)||"_";const a=null===(i=t.svg)||void 0===i?void 0:i.append("defs").append("mask").attr("id",`mask-${t.accession}`);null==a||a.selectAll("rect").data(e).enter().append("rect").attr("y",0).attr("height",t.height)})({element:this,coverage:a(this,Br,"f")})}null===(s=this.svg)||void 0===s||s.attr("height",((null===(u=this.layoutObj)||void 0===u?void 0:u.maxYPos)||0)+this["margin-bottom"]),o(this,Ir,!0,"f")}getResidueShape(t){var e;return this.featureShape.getFeatureShape(this.getSingleBaseWidth(),(null===(e=this.layoutObj)||void 0===e?void 0:e.getFeatureHeight(`${t.accession}_${t.k}_${t.i}_${t.j}`))||0,t.end&&t.start?t.end-t.start+1:1,"rectangle")}getResidueTransform(t){var e;return`translate(${this.getXFromSeqPosition(t.start||1)},${this["margin-top"]+((null===(e=this.layoutObj)||void 0===e?void 0:e.getFeatureYPos(`${t.accession}_${t.k}_${t.i}_${t.j}`))||0)})`}getResidueFill(t,e){return e?this.getFeatureColor(t):"white"}getTextLabel(t){var e,n;return(null===(e=this.label)||void 0===e?void 0:e.length)?this.label.startsWith(".")?Yr(t,this.label.slice(1),null):this.label:(null===(n=null==t?void 0:t.feature)||void 0===n?void 0:n.accession)||null}refreshLabels(t,n=2){t.attr("x",(t=>{const e=Zr(this["display-start"],t.start),n=ti(this["display-end"],t.end,this.length);return this.getXFromSeqPosition(e+(n-e)/2||1)})).attr("y",(t=>{var e,n;return this["margin-top"]+((null===(e=this.layoutObj)||void 0===e?void 0:e.getFeatureYPos(t.feature))||0)+((null===(n=this.layoutObj)||void 0===n?void 0:n.getFeatureHeight(t.feature))||0)/2})).attr("fill",((t,n,r)=>{var i;return(null===(i=r[n].parentElement)||void 0===i?void 0:i.querySelector("path.feature"))?e(function(t){var e;if(Jr[t])return Jr[t];const n=document.createElement("div");n.style.color=t,document.body.appendChild(n);const r=window.getComputedStyle(n).color;document.body.removeChild(n);const i=(null===(e=null==r?void 0:r.match(/[.\d]+/g))||void 0===e?void 0:e.map(Number))||null;return Jr[t]=i,i}(this.getFeatureFillColor(t))):null})).attr("font-size",(t=>{var e;return((null===(e=this.layoutObj)||void 0===e?void 0:e.getFeatureHeight(t.feature))||2)-n})).text((t=>this["show-label"]?this.getTextLabel(t):null)).each(function(t,e,n,r,i){function a(a){var o,s,u;const l=function(t){return"string"==typeof t?new $t([[document.querySelector(t)]],[document.documentElement]):new $t([[t]],At)}(this),h=Zr(t,a.start),c=ti(e,a.end,n),f=r(c)-r(h),d=i(a.feature)/2;let p=(null===(s=null===(o=l.node())||void 0===o?void 0:o.getComputedTextLength)||void 0===s?void 0:s.call(o))||0,v=l.text();for(;p>f-2*d&&v.length>0;)v=v.slice(0,-1),l.text(v.length?v+"…":""),p=(null===(u=l.node())||void 0===u?void 0:u.getComputedTextLength())||0}return a}(this["display-start"],this["display-end"],this.length,(t=>this.getXFromSeqPosition(t)),(t=>{var e;return(null===(e=this.layoutObj)||void 0===e?void 0:e.getFeatureHeight(t))||0})))}refreshFeatures(t,e=!0){const n=new Set(t.data().map((t=>{var e;return null===(e=t.feature)||void 0===e?void 0:e.accession}))).size;t.attr("d",(t=>{var n;return this.featureShape.getFeatureShape(this.getSingleBaseWidth(),(null===(n=this.layoutObj)||void 0===n?void 0:n.getFeatureHeight(t.feature||""))||0,t.end&&t.start?t.end-t.start+1:1,e?this.getShape(t.shape?t:t.feature):"rectangle")})).style("fill",(t=>e?this.getFeatureColor(t.feature):"white")).attr("opacity",e?1:.8/n).style("stroke",(t=>e?this.getFeatureColor(t.feature):"none")).attr("transform",(t=>{var e;return`translate(${this.getXFromSeqPosition(t.start||1)},${this["margin-top"]+((null===(e=this.layoutObj)||void 0===e?void 0:e.getFeatureYPos(t.feature))||0)})`})).style("pointer-events",e?"auto":"none")}refreshCoverLine(t,e=!0){t.attr("x1",(t=>this.getXFromSeqPosition(t.start||1))).attr("x2",(t=>this.getXFromSeqPosition((t.end||0)+1))).attr("y1",(t=>{var e,n;return this["margin-top"]+((null===(e=this.layoutObj)||void 0===e?void 0:e.getFeatureYPos(t.feature))||0)+((null===(n=this.layoutObj)||void 0===n?void 0:n.getFeatureHeight(t.feature))||0)/2})).attr("y2",(t=>{var e,n;return this["margin-top"]+((null===(e=this.layoutObj)||void 0===e?void 0:e.getFeatureYPos(t.feature))||0)+((null===(n=this.layoutObj)||void 0===n?void 0:n.getFeatureHeight(t.feature))||0)/2})).attr("stroke",(t=>this.getFeatureColor(t.feature))).attr("visibility",e?"visible":"hidden")}refresh(){var t,e,n,r,i,o,s,u;if(a(this,Ir,"f")&&this.layoutObj){if(this.layoutObj.expanded=!!this.expanded,this.layoutObj.init(this.data,a(this,Wr,"f")),this.height=this.layoutObj.maxYPos,this.refreshCoverLine(null===(t=a(this,Dr,"f"))||void 0===t?void 0:t.selectAll("g.location-group line.cover")),this.refreshFeatures(null===(e=a(this,Dr,"f"))||void 0===e?void 0:e.selectAll("g.location-group path.feature")),this.refreshLabels(null===(n=a(this,Dr,"f"))||void 0===n?void 0:n.selectAll("g.location-group text.feature-label")),a(this,Vr,"f")&&Hr({baseG:a(this,Vr,"f"),expanded:!!this.expanded,getResidueShape:t=>this.getResidueShape(t),getResidueTransform:t=>this.getResidueTransform(t),getResidueFill:t=>this.getResidueFill(t,!!this.expanded)}),a(this,Wr,"f")){const t=null===(r=a(this,Gr,"f"))||void 0===r?void 0:r.select("g.children-group");null==t||t.attr("visibility",this.expanded?"visible":"hidden");const e=null==t?void 0:t.selectAll("g.child-group"),n=null==e?void 0:e.selectAll("g.child-location-group"),u=null==n?void 0:n.selectAll("line.cover"),l=null==n?void 0:n.selectAll("path.child-fragment");this.refreshCoverLine(u,this.expanded),this.refreshFeatures(l,this.expanded),this.refreshLabels(null==e?void 0:e.selectAll("g.child-location-group text.child-label"),0),null===(i=a(this,Ur,"f"))||void 0===i||i.attr("visibility",(()=>this.expanded?"visible":"hidden")),a(this,Ur,"f")&&Hr({baseG:a(this,Ur,"f"),expanded:!!this.expanded,getResidueShape:t=>this.getResidueShape(t),getResidueTransform:t=>this.getResidueTransform(t),getResidueFill:t=>{var e;return this.getResidueFill(t,!!(null===(e=t.feature)||void 0===e?void 0:e.expanded))}}),(null===(o=a(this,Br,"f"))||void 0===o?void 0:o.length)&&(({element:t,featuresG:e,contributorsLength:n})=>{var r;null==e||e.attr("mask",t.expanded?null:`url(#mask-${t.accession})`),null===(r=t.svg)||void 0===r||r.selectAll("defs mask rect").attr("x",(e=>t.getXFromSeqPosition(e.start))).attr("width",(e=>t.getSingleBaseWidth()*(e.end-e.start+1))).attr("height",t.height).attr("fill","white").attr("opacity",(t=>((t.value||0)/(n||1)+.3)/1.3))})({element:this,featuresG:a(this,Dr,"f"),contributorsLength:null===(s=a(this,Wr,"f"))||void 0===s?void 0:s.length})}null===(u=this.svg)||void 0===u||u.attr("height",this.layoutObj.maxYPos+this["margin-bottom"]),this.updateHighlight(),this.renderMarginOnGroup(this.margins)}}};function Zr(t,e){const n=t&&t>0?t:0;return Math.max(e||0,n)}function ti(t,e,n){const r=t&&t>0?t:n||0;return Math.min(e||0,r)}Wr=new WeakMap,Br=new WeakMap,Ir=new WeakMap,Gr=new WeakMap,Dr=new WeakMap,Vr=new WeakMap,Ur=new WeakMap,i([u({type:Boolean})],Qr.prototype,"expanded",void 0),i([u({type:Boolean})],Qr.prototype,"show-label",void 0),i([u({type:String})],Qr.prototype,"label",void 0),Qr=Kr=i([(t=>e=>"function"==typeof e?((t,e)=>(customElements.define(t,e),e))(t,e):((t,e)=>{const{kind:n,elements:r}=e;return{kind:n,elements:r,finisher(e){customElements.define(t,e)}}})(t,e))("nightingale-interpro-track")],Qr);var ei=Qr;export{ei as default}; | ||
//# sourceMappingURL=index.js.map |
@@ -21,3 +21,3 @@ import { DefaultLayout, Feature, FeatureLocation, LayoutOptions } from "@nightingale-elements/nightingale-track"; | ||
residues: Residue[]; | ||
expanded: boolean; | ||
expanded?: boolean; | ||
i?: number; | ||
@@ -24,0 +24,0 @@ j?: number; |
@@ -8,5 +8,5 @@ import { Selection } from "d3"; | ||
#private; | ||
expanded: boolean; | ||
"show-label": boolean; | ||
label: string | null; | ||
expanded?: boolean; | ||
"show-label"?: boolean; | ||
label?: string | null; | ||
layout: undefined; | ||
@@ -32,2 +32,7 @@ protected layoutObj?: InterproEntryLayout; | ||
export default NightingaleInterproTrack; | ||
declare global { | ||
interface HTMLElementTagNameMap { | ||
"nightingale-interpro-track": NightingaleInterproTrack; | ||
} | ||
} | ||
//# sourceMappingURL=nightingale-interpro-track.d.ts.map |
{ | ||
"name": "@nightingale-elements/nightingale-interpro-track", | ||
"version": "4.0.24-alpha.0", | ||
"version": "4.2.1-alpha.0", | ||
"description": "Interpro extension of the track type.", | ||
@@ -35,8 +35,8 @@ "files": [ | ||
"dependencies": { | ||
"@nightingale-elements/nightingale-new-core": "^4.0.24-alpha.0", | ||
"@nightingale-elements/nightingale-track": "^4.0.24-alpha.0", | ||
"d3": "7.8.2", | ||
"@nightingale-elements/nightingale-new-core": "^4.2.0", | ||
"@nightingale-elements/nightingale-track": "^4.2.1-alpha.0", | ||
"d3": "7.8.3", | ||
"lodash-es": "^4.17.15" | ||
}, | ||
"gitHead": "7935a53b6f7736d5a9d4fd12d2f01612d6b9a93f" | ||
"gitHead": "83029a091ebe9fa94512eaef3b8fe2a0f553c3ad" | ||
} |
import NightingaleInterproTrack from "./nightingale-interpro-track"; | ||
export type { BaseGroup, LabelGroup } from "./nightingale-interpro-track"; | ||
export default NightingaleInterproTrack; |
@@ -30,3 +30,3 @@ /* eslint-disable no-param-reassign */ | ||
residues: Residue[]; | ||
expanded: boolean; | ||
expanded?: boolean; | ||
i?: number; | ||
@@ -33,0 +33,0 @@ j?: number; |
@@ -9,3 +9,2 @@ import { customElement, property } from "lit/decorators.js"; | ||
contrastingColor, | ||
getColor, | ||
} from "@nightingale-elements/nightingale-new-core"; | ||
@@ -39,10 +38,25 @@ import NightingaleTrack from "@nightingale-elements/nightingale-track"; | ||
const colorCache: Record<string, number[] | null> = {}; | ||
function colorKeywordToRGB(colorKeyword: string) { | ||
if (colorCache[colorKeyword]) return colorCache[colorKeyword]; | ||
const el = document.createElement("div"); | ||
el.style.color = colorKeyword; | ||
document.body.appendChild(el); | ||
const rgbValue = window.getComputedStyle(el).color; | ||
document.body.removeChild(el); | ||
const res = rgbValue?.match(/[.\d]+/g)?.map(Number) || null; | ||
colorCache[colorKeyword] = res; | ||
return res; | ||
} | ||
@customElement("nightingale-interpro-track") | ||
class NightingaleInterproTrack extends NightingaleTrack { | ||
@property({ type: Boolean }) | ||
expanded = false; | ||
expanded?: boolean = false; | ||
@property({ type: Boolean }) | ||
"show-label" = false; | ||
"show-label"?: boolean = false; | ||
@property({ type: String }) | ||
label: string | null = null; | ||
label?: string | null = null; | ||
@@ -74,3 +88,3 @@ layout = undefined; | ||
if (!this.layoutObj) return; | ||
this.layoutObj.expanded = this.expanded; | ||
this.layoutObj.expanded = !!this.expanded; | ||
this.#childrenG = undefined; | ||
@@ -109,3 +123,3 @@ super.createTrack(); | ||
layoutHeight: this.height, | ||
expanded: this.expanded, | ||
expanded: !!this.expanded, | ||
padding: (this["margin-top"] + this["margin-bottom"]) / 2, | ||
@@ -192,3 +206,3 @@ }); | ||
getResidueTransform: (d) => this.getResidueTransform(d), | ||
getResidueFill: (d) => this.getResidueFill(d, this.expanded), | ||
getResidueFill: (d) => this.getResidueFill(d, !!this.expanded), | ||
element: this, | ||
@@ -283,3 +297,3 @@ }); | ||
getResidueTransform: (d) => this.getResidueTransform(d), | ||
getResidueFill: (d) => this.getResidueFill(d, d.feature?.expanded), | ||
getResidueFill: (d) => this.getResidueFill(d, !!d.feature?.expanded), | ||
element: this, | ||
@@ -343,3 +357,3 @@ }); | ||
) | ||
.attr("fill", (_f, i, nodes) => { | ||
.attr("fill", (f, i, nodes) => { | ||
const element = nodes[i]; | ||
@@ -349,3 +363,5 @@ const firstPath = element.parentElement?.querySelector("path.feature"); | ||
if (firstPath) { | ||
return contrastingColor(getColor(firstPath, "fill")); | ||
return contrastingColor( | ||
colorKeywordToRGB(this.getFeatureFillColor(f)) | ||
); | ||
} | ||
@@ -386,3 +402,3 @@ return null; | ||
) | ||
.attr("fill", (f) => | ||
.style("fill", (f) => | ||
expanded ? this.getFeatureColor(f.feature as Feature) : "white" | ||
@@ -432,3 +448,3 @@ ) | ||
if (this.#haveCreatedFeatures && this.layoutObj) { | ||
this.layoutObj.expanded = this.expanded; | ||
this.layoutObj.expanded = !!this.expanded; | ||
this.layoutObj.init(this.data as InterProFeature[], this.#contributors); | ||
@@ -453,6 +469,6 @@ this.height = this.layoutObj.maxYPos; | ||
baseG: this.#residuesG, | ||
expanded: this.expanded, | ||
expanded: !!this.expanded, | ||
getResidueShape: (d) => this.getResidueShape(d), | ||
getResidueTransform: (d) => this.getResidueTransform(d), | ||
getResidueFill: (d) => this.getResidueFill(d, this.expanded), | ||
getResidueFill: (d) => this.getResidueFill(d, !!this.expanded), | ||
}); | ||
@@ -493,6 +509,7 @@ | ||
baseG: this.#childResiduesG, | ||
expanded: this.expanded, | ||
expanded: !!this.expanded, | ||
getResidueShape: (d) => this.getResidueShape(d), | ||
getResidueTransform: (d) => this.getResidueTransform(d), | ||
getResidueFill: (d) => this.getResidueFill(d, d.feature?.expanded), | ||
getResidueFill: (d) => | ||
this.getResidueFill(d, !!d.feature?.expanded), | ||
}); | ||
@@ -555,1 +572,7 @@ | ||
export default NightingaleInterproTrack; | ||
declare global { | ||
interface HTMLElementTagNameMap { | ||
"nightingale-interpro-track": NightingaleInterproTrack; | ||
} | ||
} |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Mixed license
License(Experimental) Package contains multiple licenses.
Found 1 instance in 1 package
Mixed license
License(Experimental) Package contains multiple licenses.
Found 1 instance in 1 package
384142
25
1568
+ Addedd3@7.8.3(transitive)
- Removedd3@7.8.2(transitive)
Updated@nightingale-elements/nightingale-track@^4.2.1-alpha.0
Updatedd3@7.8.3