hafez 2.2.0 → 2.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (67) hide show
  1. package/README.md +48 -1
  2. package/dist/apply.d.ts +12 -0
  3. package/dist/apply.js +82 -17
  4. package/dist/batch-ops.d.ts +31 -27
  5. package/dist/batch-ops.js +80 -15
  6. package/dist/cli/block-hook.d.ts +6 -0
  7. package/dist/cli/block-hook.js +3 -3
  8. package/dist/cli/commands.d.ts +2 -0
  9. package/dist/cli/commands.js +98 -46
  10. package/dist/cli/format.d.ts +4 -1
  11. package/dist/cli/format.js +19 -0
  12. package/dist/cli/index.js +11 -2
  13. package/dist/cli/upgrade.js +1 -1
  14. package/dist/contracts.d.ts +9 -0
  15. package/dist/contracts.js +9 -0
  16. package/dist/dates.d.ts +3 -0
  17. package/dist/dates.js +9 -0
  18. package/dist/db.d.ts +34 -4
  19. package/dist/db.js +163 -21
  20. package/dist/digest.js +14 -7
  21. package/dist/document.d.ts +2 -0
  22. package/dist/document.js +2 -2
  23. package/dist/git.d.ts +13 -2
  24. package/dist/git.js +47 -5
  25. package/dist/graph/activity.d.ts +5 -0
  26. package/dist/graph/activity.js +70 -0
  27. package/dist/graph/client.js +326 -0
  28. package/dist/graph/copy-fonts.d.ts +1 -0
  29. package/dist/graph/copy-fonts.js +13 -0
  30. package/dist/graph/fields.d.ts +8 -0
  31. package/dist/graph/fields.js +12 -0
  32. package/dist/graph/fonts/geist-OFL.txt +93 -0
  33. package/dist/graph/fonts/geist-mono-OFL.txt +93 -0
  34. package/dist/graph/fonts/geist-mono.woff2 +0 -0
  35. package/dist/graph/fonts/geist.woff2 +0 -0
  36. package/dist/graph/fonts/outfit-OFL.txt +93 -0
  37. package/dist/graph/fonts/outfit.woff2 +0 -0
  38. package/dist/graph/fonts.d.ts +14 -0
  39. package/dist/graph/fonts.js +17 -0
  40. package/dist/graph/live.d.ts +16 -0
  41. package/dist/graph/live.js +99 -0
  42. package/dist/graph/open.d.ts +1 -0
  43. package/dist/graph/open.js +20 -0
  44. package/dist/graph/server.d.ts +17 -0
  45. package/dist/graph/server.js +189 -0
  46. package/dist/health.d.ts +6 -0
  47. package/dist/health.js +310 -0
  48. package/dist/index.d.ts +1 -1
  49. package/dist/index.js +37 -9
  50. package/dist/internal.d.ts +21 -0
  51. package/dist/internal.js +9 -0
  52. package/dist/read-json.d.ts +26 -0
  53. package/dist/read-json.js +53 -0
  54. package/dist/stale.d.ts +2 -2
  55. package/dist/stale.js +4 -9
  56. package/dist/surfaces/items.d.ts +44 -0
  57. package/dist/surfaces/items.js +68 -9
  58. package/dist/surfaces/surfaces.js +3 -1
  59. package/dist/templates.d.ts +2 -0
  60. package/dist/templates.js +6 -1
  61. package/dist/types.d.ts +178 -8
  62. package/dist/vault.d.ts +9 -2
  63. package/dist/vault.js +10 -0
  64. package/dist/workstream.d.ts +17 -0
  65. package/dist/workstream.js +78 -0
  66. package/package.json +9 -3
  67. package/skill/hafez/SKILL.md +12 -6
@@ -0,0 +1,326 @@
1
+ "use strict";(()=>{var ns=Object.defineProperty;var gp=(e,r,n)=>r in e?ns(e,r,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[r]=n;var os=(e,r)=>{for(var n in r)ns(e,n,{get:r[n],enumerable:!0})};var ie=(e,r,n)=>gp(e,typeof r!="symbol"?r+"":r,n);var An="http://www.w3.org/1999/xhtml",ti={svg:"http://www.w3.org/2000/svg",xhtml:An,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function rt(e){var r=e+="",n=r.indexOf(":");return n>=0&&(r=e.slice(0,n))!=="xmlns"&&(e=e.slice(n+1)),ti.hasOwnProperty(r)?{space:ti[r],local:e}:e}function xp(e){return function(){var r=this.ownerDocument,n=this.namespaceURI;return n===An&&r.documentElement.namespaceURI===An?r.createElement(e):r.createElementNS(n,e)}}function vp(e){return function(){return this.ownerDocument.createElementNS(e.space,e.local)}}function Rn(e){var r=rt(e);return(r.local?vp:xp)(r)}function yp(){}function Rt(e){return e==null?yp:function(){return this.querySelector(e)}}function is(e){typeof e!="function"&&(e=Rt(e));for(var r=this._groups,n=r.length,o=new Array(n),i=0;i<n;++i)for(var a=r[i],s=a.length,l=o[i]=new Array(s),u,c,f=0;f<s;++f)(u=a[f])&&(c=e.call(u,u.__data__,f,a))&&("__data__"in u&&(c.__data__=u.__data__),l[f]=c);return new te(o,this._parents)}function ri(e){return e==null?[]:Array.isArray(e)?e:Array.from(e)}function _p(){return[]}function pr(e){return e==null?_p:function(){return this.querySelectorAll(e)}}function bp(e){return function(){return ri(e.apply(this,arguments))}}function as(e){typeof e=="function"?e=bp(e):e=pr(e);for(var r=this._groups,n=r.length,o=[],i=[],a=0;a<n;++a)for(var s=r[a],l=s.length,u,c=0;c<l;++c)(u=s[c])&&(o.push(e.call(u,u.__data__,c,s)),i.push(u));return new te(o,i)}function mr(e){return function(){return this.matches(e)}}function En(e){return function(r){return r.matches(e)}}var wp=Array.prototype.find;function kp(e){return function(){return wp.call(this.children,e)}}function Cp(){return this.firstElementChild}function ss(e){return this.select(e==null?Cp:kp(typeof e=="function"?e:En(e)))}var Ap=Array.prototype.filter;function Rp(){return Array.from(this.children)}function Ep(e){return function(){return Ap.call(this.children,e)}}function ls(e){return this.selectAll(e==null?Rp:Ep(typeof e=="function"?e:En(e)))}function us(e){typeof e!="function"&&(e=mr(e));for(var r=this._groups,n=r.length,o=new Array(n),i=0;i<n;++i)for(var a=r[i],s=a.length,l=o[i]=[],u,c=0;c<s;++c)(u=a[c])&&e.call(u,u.__data__,c,a)&&l.push(u);return new te(o,this._parents)}function Dn(e){return new Array(e.length)}function cs(){return new te(this._enter||this._groups.map(Dn),this._parents)}function gr(e,r){this.ownerDocument=e.ownerDocument,this.namespaceURI=e.namespaceURI,this._next=null,this._parent=e,this.__data__=r}gr.prototype={constructor:gr,appendChild:function(e){return this._parent.insertBefore(e,this._next)},insertBefore:function(e,r){return this._parent.insertBefore(e,r)},querySelector:function(e){return this._parent.querySelector(e)},querySelectorAll:function(e){return this._parent.querySelectorAll(e)}};function fs(e){return function(){return e}}function Dp(e,r,n,o,i,a){for(var s=0,l,u=r.length,c=a.length;s<c;++s)(l=r[s])?(l.__data__=a[s],o[s]=l):n[s]=new gr(e,a[s]);for(;s<u;++s)(l=r[s])&&(i[s]=l)}function Sp(e,r,n,o,i,a,s){var l,u,c=new Map,f=r.length,h=a.length,d=new Array(f),p;for(l=0;l<f;++l)(u=r[l])&&(d[l]=p=s.call(u,u.__data__,l,r)+"",c.has(p)?i[l]=u:c.set(p,u));for(l=0;l<h;++l)p=s.call(e,a[l],l,a)+"",(u=c.get(p))?(o[l]=u,u.__data__=a[l],c.delete(p)):n[l]=new gr(e,a[l]);for(l=0;l<f;++l)(u=r[l])&&c.get(d[l])===u&&(i[l]=u)}function Mp(e){return e.__data__}function hs(e,r){if(!arguments.length)return Array.from(this,Mp);var n=r?Sp:Dp,o=this._parents,i=this._groups;typeof e!="function"&&(e=fs(e));for(var a=i.length,s=new Array(a),l=new Array(a),u=new Array(a),c=0;c<a;++c){var f=o[c],h=i[c],d=h.length,p=Tp(e.call(f,f&&f.__data__,c,o)),m=p.length,v=l[c]=new Array(m),x=s[c]=new Array(m),g=u[c]=new Array(d);n(f,h,v,x,g,p,r);for(var b=0,k=0,y,_;b<m;++b)if(y=v[b]){for(b>=k&&(k=b+1);!(_=x[k])&&++k<m;);y._next=_||null}}return s=new te(s,o),s._enter=l,s._exit=u,s}function Tp(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function ds(){return new te(this._exit||this._groups.map(Dn),this._parents)}function ps(e,r,n){var o=this.enter(),i=this,a=this.exit();return typeof e=="function"?(o=e(o),o&&(o=o.selection())):o=o.append(e+""),r!=null&&(i=r(i),i&&(i=i.selection())),n==null?a.remove():n(a),o&&i?o.merge(i).order():i}function ms(e){for(var r=e.selection?e.selection():e,n=this._groups,o=r._groups,i=n.length,a=o.length,s=Math.min(i,a),l=new Array(i),u=0;u<s;++u)for(var c=n[u],f=o[u],h=c.length,d=l[u]=new Array(h),p,m=0;m<h;++m)(p=c[m]||f[m])&&(d[m]=p);for(;u<i;++u)l[u]=n[u];return new te(l,this._parents)}function gs(){for(var e=this._groups,r=-1,n=e.length;++r<n;)for(var o=e[r],i=o.length-1,a=o[i],s;--i>=0;)(s=o[i])&&(a&&s.compareDocumentPosition(a)^4&&a.parentNode.insertBefore(s,a),a=s);return this}function xs(e){e||(e=Np);function r(h,d){return h&&d?e(h.__data__,d.__data__):!h-!d}for(var n=this._groups,o=n.length,i=new Array(o),a=0;a<o;++a){for(var s=n[a],l=s.length,u=i[a]=new Array(l),c,f=0;f<l;++f)(c=s[f])&&(u[f]=c);u.sort(r)}return new te(i,this._parents).order()}function Np(e,r){return e<r?-1:e>r?1:e>=r?0:NaN}function vs(){var e=arguments[0];return arguments[0]=this,e.apply(null,arguments),this}function ys(){return Array.from(this)}function _s(){for(var e=this._groups,r=0,n=e.length;r<n;++r)for(var o=e[r],i=0,a=o.length;i<a;++i){var s=o[i];if(s)return s}return null}function bs(){let e=0;for(let r of this)++e;return e}function ws(){return!this.node()}function ks(e){for(var r=this._groups,n=0,o=r.length;n<o;++n)for(var i=r[n],a=0,s=i.length,l;a<s;++a)(l=i[a])&&e.call(l,l.__data__,a,i);return this}function Fp(e){return function(){this.removeAttribute(e)}}function Ip(e){return function(){this.removeAttributeNS(e.space,e.local)}}function Lp(e,r){return function(){this.setAttribute(e,r)}}function zp(e,r){return function(){this.setAttributeNS(e.space,e.local,r)}}function Pp(e,r){return function(){var n=r.apply(this,arguments);n==null?this.removeAttribute(e):this.setAttribute(e,n)}}function Op(e,r){return function(){var n=r.apply(this,arguments);n==null?this.removeAttributeNS(e.space,e.local):this.setAttributeNS(e.space,e.local,n)}}function Cs(e,r){var n=rt(e);if(arguments.length<2){var o=this.node();return n.local?o.getAttributeNS(n.space,n.local):o.getAttribute(n)}return this.each((r==null?n.local?Ip:Fp:typeof r=="function"?n.local?Op:Pp:n.local?zp:Lp)(n,r))}function Sn(e){return e.ownerDocument&&e.ownerDocument.defaultView||e.document&&e||e.defaultView}function Bp(e){return function(){this.style.removeProperty(e)}}function jp(e,r,n){return function(){this.style.setProperty(e,r,n)}}function $p(e,r,n){return function(){var o=r.apply(this,arguments);o==null?this.style.removeProperty(e):this.style.setProperty(e,o,n)}}function As(e,r,n){return arguments.length>1?this.each((r==null?Bp:typeof r=="function"?$p:jp)(e,r,n??"")):ct(this.node(),e)}function ct(e,r){return e.style.getPropertyValue(r)||Sn(e).getComputedStyle(e,null).getPropertyValue(r)}function Hp(e){return function(){delete this[e]}}function Up(e,r){return function(){this[e]=r}}function Gp(e,r){return function(){var n=r.apply(this,arguments);n==null?delete this[e]:this[e]=n}}function Rs(e,r){return arguments.length>1?this.each((r==null?Hp:typeof r=="function"?Gp:Up)(e,r)):this.node()[e]}function Es(e){return e.trim().split(/^|\s+/)}function ni(e){return e.classList||new Ds(e)}function Ds(e){this._node=e,this._names=Es(e.getAttribute("class")||"")}Ds.prototype={add:function(e){var r=this._names.indexOf(e);r<0&&(this._names.push(e),this._node.setAttribute("class",this._names.join(" ")))},remove:function(e){var r=this._names.indexOf(e);r>=0&&(this._names.splice(r,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(e){return this._names.indexOf(e)>=0}};function Ss(e,r){for(var n=ni(e),o=-1,i=r.length;++o<i;)n.add(r[o])}function Ms(e,r){for(var n=ni(e),o=-1,i=r.length;++o<i;)n.remove(r[o])}function qp(e){return function(){Ss(this,e)}}function Wp(e){return function(){Ms(this,e)}}function Jp(e,r){return function(){(r.apply(this,arguments)?Ss:Ms)(this,e)}}function Ts(e,r){var n=Es(e+"");if(arguments.length<2){for(var o=ni(this.node()),i=-1,a=n.length;++i<a;)if(!o.contains(n[i]))return!1;return!0}return this.each((typeof r=="function"?Jp:r?qp:Wp)(n,r))}function Xp(){this.textContent=""}function Vp(e){return function(){this.textContent=e}}function Yp(e){return function(){var r=e.apply(this,arguments);this.textContent=r??""}}function Ns(e){return arguments.length?this.each(e==null?Xp:(typeof e=="function"?Yp:Vp)(e)):this.node().textContent}function Zp(){this.innerHTML=""}function Kp(e){return function(){this.innerHTML=e}}function Qp(e){return function(){var r=e.apply(this,arguments);this.innerHTML=r??""}}function Fs(e){return arguments.length?this.each(e==null?Zp:(typeof e=="function"?Qp:Kp)(e)):this.node().innerHTML}function em(){this.nextSibling&&this.parentNode.appendChild(this)}function Is(){return this.each(em)}function tm(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function Ls(){return this.each(tm)}function zs(e){var r=typeof e=="function"?e:Rn(e);return this.select(function(){return this.appendChild(r.apply(this,arguments))})}function rm(){return null}function Ps(e,r){var n=typeof e=="function"?e:Rn(e),o=r==null?rm:typeof r=="function"?r:Rt(r);return this.select(function(){return this.insertBefore(n.apply(this,arguments),o.apply(this,arguments)||null)})}function nm(){var e=this.parentNode;e&&e.removeChild(this)}function Os(){return this.each(nm)}function om(){var e=this.cloneNode(!1),r=this.parentNode;return r?r.insertBefore(e,this.nextSibling):e}function im(){var e=this.cloneNode(!0),r=this.parentNode;return r?r.insertBefore(e,this.nextSibling):e}function Bs(e){return this.select(e?im:om)}function js(e){return arguments.length?this.property("__data__",e):this.node().__data__}function am(e){return function(r){e.call(this,r,this.__data__)}}function sm(e){return e.trim().split(/^|\s+/).map(function(r){var n="",o=r.indexOf(".");return o>=0&&(n=r.slice(o+1),r=r.slice(0,o)),{type:r,name:n}})}function lm(e){return function(){var r=this.__on;if(r){for(var n=0,o=-1,i=r.length,a;n<i;++n)a=r[n],(!e.type||a.type===e.type)&&a.name===e.name?this.removeEventListener(a.type,a.listener,a.options):r[++o]=a;++o?r.length=o:delete this.__on}}}function um(e,r,n){return function(){var o=this.__on,i,a=am(r);if(o){for(var s=0,l=o.length;s<l;++s)if((i=o[s]).type===e.type&&i.name===e.name){this.removeEventListener(i.type,i.listener,i.options),this.addEventListener(i.type,i.listener=a,i.options=n),i.value=r;return}}this.addEventListener(e.type,a,n),i={type:e.type,name:e.name,value:r,listener:a,options:n},o?o.push(i):this.__on=[i]}}function $s(e,r,n){var o=sm(e+""),i,a=o.length,s;if(arguments.length<2){var l=this.node().__on;if(l){for(var u=0,c=l.length,f;u<c;++u)for(i=0,f=l[u];i<a;++i)if((s=o[i]).type===f.type&&s.name===f.name)return f.value}return}for(l=r?um:lm,i=0;i<a;++i)this.each(l(o[i],r,n));return this}function Hs(e,r,n){var o=Sn(e),i=o.CustomEvent;typeof i=="function"?i=new i(r,n):(i=o.document.createEvent("Event"),n?(i.initEvent(r,n.bubbles,n.cancelable),i.detail=n.detail):i.initEvent(r,!1,!1)),e.dispatchEvent(i)}function cm(e,r){return function(){return Hs(this,e,r)}}function fm(e,r){return function(){return Hs(this,e,r.apply(this,arguments))}}function Us(e,r){return this.each((typeof r=="function"?fm:cm)(e,r))}function*Gs(){for(var e=this._groups,r=0,n=e.length;r<n;++r)for(var o=e[r],i=0,a=o.length,s;i<a;++i)(s=o[i])&&(yield s)}var oi=[null];function te(e,r){this._groups=e,this._parents=r}function qs(){return new te([[document.documentElement]],oi)}function hm(){return this}te.prototype=qs.prototype={constructor:te,select:is,selectAll:as,selectChild:ss,selectChildren:ls,filter:us,data:hs,enter:cs,exit:ds,join:ps,merge:ms,selection:hm,order:gs,sort:xs,call:vs,nodes:ys,node:_s,size:bs,empty:ws,each:ks,attr:Cs,style:As,property:Rs,classed:Ts,text:Ns,html:Fs,raise:Is,lower:Ls,append:zs,insert:Ps,remove:Os,clone:Bs,datum:js,on:$s,dispatch:Us,[Symbol.iterator]:Gs};var nt=qs;function se(e){return typeof e=="string"?new te([[document.querySelector(e)]],[document.documentElement]):new te([[e]],oi)}function Ws(e){let r;for(;r=e.sourceEvent;)e=r;return e}function ve(e,r){if(e=Ws(e),r===void 0&&(r=e.currentTarget),r){var n=r.ownerSVGElement||r;if(n.createSVGPoint){var o=n.createSVGPoint();return o.x=e.clientX,o.y=e.clientY,o=o.matrixTransform(r.getScreenCTM().inverse()),[o.x,o.y]}if(r.getBoundingClientRect){var i=r.getBoundingClientRect();return[e.clientX-i.left-r.clientLeft,e.clientY-i.top-r.clientTop]}}return[e.pageX,e.pageY]}var dm={value:()=>{}};function Xs(){for(var e=0,r=arguments.length,n={},o;e<r;++e){if(!(o=arguments[e]+"")||o in n||/[\s.]/.test(o))throw new Error("illegal type: "+o);n[o]=[]}return new Mn(n)}function Mn(e){this._=e}function pm(e,r){return e.trim().split(/^|\s+/).map(function(n){var o="",i=n.indexOf(".");if(i>=0&&(o=n.slice(i+1),n=n.slice(0,i)),n&&!r.hasOwnProperty(n))throw new Error("unknown type: "+n);return{type:n,name:o}})}Mn.prototype=Xs.prototype={constructor:Mn,on:function(e,r){var n=this._,o=pm(e+"",n),i,a=-1,s=o.length;if(arguments.length<2){for(;++a<s;)if((i=(e=o[a]).type)&&(i=mm(n[i],e.name)))return i;return}if(r!=null&&typeof r!="function")throw new Error("invalid callback: "+r);for(;++a<s;)if(i=(e=o[a]).type)n[i]=Js(n[i],e.name,r);else if(r==null)for(i in n)n[i]=Js(n[i],e.name,null);return this},copy:function(){var e={},r=this._;for(var n in r)e[n]=r[n].slice();return new Mn(e)},call:function(e,r){if((i=arguments.length-2)>0)for(var n=new Array(i),o=0,i,a;o<i;++o)n[o]=arguments[o+2];if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(a=this._[e],o=0,i=a.length;o<i;++o)a[o].value.apply(r,n)},apply:function(e,r,n){if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(var o=this._[e],i=0,a=o.length;i<a;++i)o[i].value.apply(r,n)}};function mm(e,r){for(var n=0,o=e.length,i;n<o;++n)if((i=e[n]).name===r)return i.value}function Js(e,r,n){for(var o=0,i=e.length;o<i;++o)if(e[o].name===r){e[o]=dm,e=e.slice(0,o).concat(e.slice(o+1));break}return n!=null&&e.push({name:r,value:n}),e}var ot=Xs;var Vs={passive:!1},Et={capture:!0,passive:!1};function Tn(e){e.stopImmediatePropagation()}function ft(e){e.preventDefault(),e.stopImmediatePropagation()}function xr(e){var r=e.document.documentElement,n=se(e).on("dragstart.drag",ft,Et);"onselectstart"in r?n.on("selectstart.drag",ft,Et):(r.__noselect=r.style.MozUserSelect,r.style.MozUserSelect="none")}function vr(e,r){var n=e.document.documentElement,o=se(e).on("dragstart.drag",null);r&&(o.on("click.drag",ft,Et),setTimeout(function(){o.on("click.drag",null)},0)),"onselectstart"in n?o.on("selectstart.drag",null):(n.style.MozUserSelect=n.__noselect,delete n.__noselect)}var yr=e=>()=>e;function _r(e,{sourceEvent:r,subject:n,target:o,identifier:i,active:a,x:s,y:l,dx:u,dy:c,dispatch:f}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:r,enumerable:!0,configurable:!0},subject:{value:n,enumerable:!0,configurable:!0},target:{value:o,enumerable:!0,configurable:!0},identifier:{value:i,enumerable:!0,configurable:!0},active:{value:a,enumerable:!0,configurable:!0},x:{value:s,enumerable:!0,configurable:!0},y:{value:l,enumerable:!0,configurable:!0},dx:{value:u,enumerable:!0,configurable:!0},dy:{value:c,enumerable:!0,configurable:!0},_:{value:f}})}_r.prototype.on=function(){var e=this._.on.apply(this._,arguments);return e===this._?this:e};function gm(e){return!e.ctrlKey&&!e.button}function xm(){return this.parentNode}function vm(e,r){return r??{x:e.x,y:e.y}}function ym(){return navigator.maxTouchPoints||"ontouchstart"in this}function ii(){var e=gm,r=xm,n=vm,o=ym,i={},a=ot("start","drag","end"),s=0,l,u,c,f,h=0;function d(y){y.on("mousedown.drag",p).filter(o).on("touchstart.drag",x).on("touchmove.drag",g,Vs).on("touchend.drag touchcancel.drag",b).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function p(y,_){if(!(f||!e.call(this,y,_))){var w=k(this,r.call(this,y,_),y,_,"mouse");w&&(se(y.view).on("mousemove.drag",m,Et).on("mouseup.drag",v,Et),xr(y.view),Tn(y),c=!1,l=y.clientX,u=y.clientY,w("start",y))}}function m(y){if(ft(y),!c){var _=y.clientX-l,w=y.clientY-u;c=_*_+w*w>h}i.mouse("drag",y)}function v(y){se(y.view).on("mousemove.drag mouseup.drag",null),vr(y.view,c),ft(y),i.mouse("end",y)}function x(y,_){if(e.call(this,y,_)){var w=y.changedTouches,C=r.call(this,y,_),R=w.length,S,N;for(S=0;S<R;++S)(N=k(this,C,y,_,w[S].identifier,w[S]))&&(Tn(y),N("start",y,w[S]))}}function g(y){var _=y.changedTouches,w=_.length,C,R;for(C=0;C<w;++C)(R=i[_[C].identifier])&&(ft(y),R("drag",y,_[C]))}function b(y){var _=y.changedTouches,w=_.length,C,R;for(f&&clearTimeout(f),f=setTimeout(function(){f=null},500),C=0;C<w;++C)(R=i[_[C].identifier])&&(Tn(y),R("end",y,_[C]))}function k(y,_,w,C,R,S){var N=a.copy(),T=ve(S||w,_),L,B,A;if((A=n.call(y,new _r("beforestart",{sourceEvent:w,target:d,identifier:R,active:s,x:T[0],y:T[1],dx:0,dy:0,dispatch:N}),C))!=null)return L=A.x-T[0]||0,B=A.y-T[1]||0,function F(M,z,j){var $=T,U;switch(M){case"start":i[R]=F,U=s++;break;case"end":delete i[R],--s;case"drag":T=ve(j||z,_),U=s;break}N.call(M,y,new _r(M,{sourceEvent:z,subject:A,target:d,identifier:R,active:U,x:T[0]+L,y:T[1]+B,dx:T[0]-$[0],dy:T[1]-$[1],dispatch:N}),C)}}return d.filter=function(y){return arguments.length?(e=typeof y=="function"?y:yr(!!y),d):e},d.container=function(y){return arguments.length?(r=typeof y=="function"?y:yr(y),d):r},d.subject=function(y){return arguments.length?(n=typeof y=="function"?y:yr(y),d):n},d.touchable=function(y){return arguments.length?(o=typeof y=="function"?y:yr(!!y),d):o},d.on=function(){var y=a.on.apply(a,arguments);return y===a?d:y},d.clickDistance=function(y){return arguments.length?(h=(y=+y)*y,d):Math.sqrt(h)},d}function Nn(e,r,n){e.prototype=r.prototype=n,n.constructor=e}function ai(e,r){var n=Object.create(e.prototype);for(var o in r)n[o]=r[o];return n}function kr(){}var br=.7,Ln=1/br,Ht="\\s*([+-]?\\d+)\\s*",wr="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",We="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",_m=/^#([0-9a-f]{3,8})$/,bm=new RegExp(`^rgb\\(${Ht},${Ht},${Ht}\\)$`),wm=new RegExp(`^rgb\\(${We},${We},${We}\\)$`),km=new RegExp(`^rgba\\(${Ht},${Ht},${Ht},${wr}\\)$`),Cm=new RegExp(`^rgba\\(${We},${We},${We},${wr}\\)$`),Am=new RegExp(`^hsl\\(${wr},${We},${We}\\)$`),Rm=new RegExp(`^hsla\\(${wr},${We},${We},${wr}\\)$`),Ys={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};Nn(kr,ht,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:Zs,formatHex:Zs,formatHex8:Em,formatHsl:Dm,formatRgb:Ks,toString:Ks});function Zs(){return this.rgb().formatHex()}function Em(){return this.rgb().formatHex8()}function Dm(){return ol(this).formatHsl()}function Ks(){return this.rgb().formatRgb()}function ht(e){var r,n;return e=(e+"").trim().toLowerCase(),(r=_m.exec(e))?(n=r[1].length,r=parseInt(r[1],16),n===6?Qs(r):n===3?new ye(r>>8&15|r>>4&240,r>>4&15|r&240,(r&15)<<4|r&15,1):n===8?Fn(r>>24&255,r>>16&255,r>>8&255,(r&255)/255):n===4?Fn(r>>12&15|r>>8&240,r>>8&15|r>>4&240,r>>4&15|r&240,((r&15)<<4|r&15)/255):null):(r=bm.exec(e))?new ye(r[1],r[2],r[3],1):(r=wm.exec(e))?new ye(r[1]*255/100,r[2]*255/100,r[3]*255/100,1):(r=km.exec(e))?Fn(r[1],r[2],r[3],r[4]):(r=Cm.exec(e))?Fn(r[1]*255/100,r[2]*255/100,r[3]*255/100,r[4]):(r=Am.exec(e))?rl(r[1],r[2]/100,r[3]/100,1):(r=Rm.exec(e))?rl(r[1],r[2]/100,r[3]/100,r[4]):Ys.hasOwnProperty(e)?Qs(Ys[e]):e==="transparent"?new ye(NaN,NaN,NaN,0):null}function Qs(e){return new ye(e>>16&255,e>>8&255,e&255,1)}function Fn(e,r,n,o){return o<=0&&(e=r=n=NaN),new ye(e,r,n,o)}function Sm(e){return e instanceof kr||(e=ht(e)),e?(e=e.rgb(),new ye(e.r,e.g,e.b,e.opacity)):new ye}function Ut(e,r,n,o){return arguments.length===1?Sm(e):new ye(e,r,n,o??1)}function ye(e,r,n,o){this.r=+e,this.g=+r,this.b=+n,this.opacity=+o}Nn(ye,Ut,ai(kr,{brighter(e){return e=e==null?Ln:Math.pow(Ln,e),new ye(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?br:Math.pow(br,e),new ye(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new ye(St(this.r),St(this.g),St(this.b),zn(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:el,formatHex:el,formatHex8:Mm,formatRgb:tl,toString:tl}));function el(){return`#${Dt(this.r)}${Dt(this.g)}${Dt(this.b)}`}function Mm(){return`#${Dt(this.r)}${Dt(this.g)}${Dt(this.b)}${Dt((isNaN(this.opacity)?1:this.opacity)*255)}`}function tl(){let e=zn(this.opacity);return`${e===1?"rgb(":"rgba("}${St(this.r)}, ${St(this.g)}, ${St(this.b)}${e===1?")":`, ${e})`}`}function zn(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function St(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function Dt(e){return e=St(e),(e<16?"0":"")+e.toString(16)}function rl(e,r,n,o){return o<=0?e=r=n=NaN:n<=0||n>=1?e=r=NaN:r<=0&&(e=NaN),new Be(e,r,n,o)}function ol(e){if(e instanceof Be)return new Be(e.h,e.s,e.l,e.opacity);if(e instanceof kr||(e=ht(e)),!e)return new Be;if(e instanceof Be)return e;e=e.rgb();var r=e.r/255,n=e.g/255,o=e.b/255,i=Math.min(r,n,o),a=Math.max(r,n,o),s=NaN,l=a-i,u=(a+i)/2;return l?(r===a?s=(n-o)/l+(n<o)*6:n===a?s=(o-r)/l+2:s=(r-n)/l+4,l/=u<.5?a+i:2-a-i,s*=60):l=u>0&&u<1?0:s,new Be(s,l,u,e.opacity)}function il(e,r,n,o){return arguments.length===1?ol(e):new Be(e,r,n,o??1)}function Be(e,r,n,o){this.h=+e,this.s=+r,this.l=+n,this.opacity=+o}Nn(Be,il,ai(kr,{brighter(e){return e=e==null?Ln:Math.pow(Ln,e),new Be(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?br:Math.pow(br,e),new Be(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=this.h%360+(this.h<0)*360,r=isNaN(e)||isNaN(this.s)?0:this.s,n=this.l,o=n+(n<.5?n:1-n)*r,i=2*n-o;return new ye(si(e>=240?e-240:e+120,i,o),si(e,i,o),si(e<120?e+240:e-120,i,o),this.opacity)},clamp(){return new Be(nl(this.h),In(this.s),In(this.l),zn(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(){let e=zn(this.opacity);return`${e===1?"hsl(":"hsla("}${nl(this.h)}, ${In(this.s)*100}%, ${In(this.l)*100}%${e===1?")":`, ${e})`}`}}));function nl(e){return e=(e||0)%360,e<0?e+360:e}function In(e){return Math.max(0,Math.min(1,e||0))}function si(e,r,n){return(e<60?r+(n-r)*e/60:e<180?n:e<240?r+(n-r)*(240-e)/60:r)*255}function li(e,r,n,o,i){var a=e*e,s=a*e;return((1-3*e+3*a-s)*r+(4-6*a+3*s)*n+(1+3*e+3*a-3*s)*o+s*i)/6}function al(e){var r=e.length-1;return function(n){var o=n<=0?n=0:n>=1?(n=1,r-1):Math.floor(n*r),i=e[o],a=e[o+1],s=o>0?e[o-1]:2*i-a,l=o<r-1?e[o+2]:2*a-i;return li((n-o/r)*r,s,i,a,l)}}function sl(e){var r=e.length;return function(n){var o=Math.floor(((n%=1)<0?++n:n)*r),i=e[(o+r-1)%r],a=e[o%r],s=e[(o+1)%r],l=e[(o+2)%r];return li((n-o/r)*r,i,a,s,l)}}var ui=e=>()=>e;function Tm(e,r){return function(n){return e+n*r}}function Nm(e,r,n){return e=Math.pow(e,n),r=Math.pow(r,n)-e,n=1/n,function(o){return Math.pow(e+o*r,n)}}function ll(e){return(e=+e)==1?Pn:function(r,n){return n-r?Nm(r,n,e):ui(isNaN(r)?n:r)}}function Pn(e,r){var n=r-e;return n?Tm(e,n):ui(isNaN(e)?r:e)}var On=(function e(r){var n=ll(r);function o(i,a){var s=n((i=Ut(i)).r,(a=Ut(a)).r),l=n(i.g,a.g),u=n(i.b,a.b),c=Pn(i.opacity,a.opacity);return function(f){return i.r=s(f),i.g=l(f),i.b=u(f),i.opacity=c(f),i+""}}return o.gamma=e,o})(1);function ul(e){return function(r){var n=r.length,o=new Array(n),i=new Array(n),a=new Array(n),s,l;for(s=0;s<n;++s)l=Ut(r[s]),o[s]=l.r||0,i[s]=l.g||0,a[s]=l.b||0;return o=e(o),i=e(i),a=e(a),l.opacity=1,function(u){return l.r=o(u),l.g=i(u),l.b=a(u),l+""}}}var Fm=ul(al),Im=ul(sl);function De(e,r){return e=+e,r=+r,function(n){return e*(1-n)+r*n}}var fi=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,ci=new RegExp(fi.source,"g");function Lm(e){return function(){return e}}function zm(e){return function(r){return e(r)+""}}function hi(e,r){var n=fi.lastIndex=ci.lastIndex=0,o,i,a,s=-1,l=[],u=[];for(e=e+"",r=r+"";(o=fi.exec(e))&&(i=ci.exec(r));)(a=i.index)>n&&(a=r.slice(n,a),l[s]?l[s]+=a:l[++s]=a),(o=o[0])===(i=i[0])?l[s]?l[s]+=i:l[++s]=i:(l[++s]=null,u.push({i:s,x:De(o,i)})),n=ci.lastIndex;return n<r.length&&(a=r.slice(n),l[s]?l[s]+=a:l[++s]=a),l.length<2?u[0]?zm(u[0].x):Lm(r):(r=u.length,function(c){for(var f=0,h;f<r;++f)l[(h=u[f]).i]=h.x(c);return l.join("")})}var cl=180/Math.PI,Bn={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function di(e,r,n,o,i,a){var s,l,u;return(s=Math.sqrt(e*e+r*r))&&(e/=s,r/=s),(u=e*n+r*o)&&(n-=e*u,o-=r*u),(l=Math.sqrt(n*n+o*o))&&(n/=l,o/=l,u/=l),e*o<r*n&&(e=-e,r=-r,u=-u,s=-s),{translateX:i,translateY:a,rotate:Math.atan2(r,e)*cl,skewX:Math.atan(u)*cl,scaleX:s,scaleY:l}}var jn;function fl(e){let r=new(typeof DOMMatrix=="function"?DOMMatrix:WebKitCSSMatrix)(e+"");return r.isIdentity?Bn:di(r.a,r.b,r.c,r.d,r.e,r.f)}function hl(e){return e==null?Bn:(jn||(jn=document.createElementNS("http://www.w3.org/2000/svg","g")),jn.setAttribute("transform",e),(e=jn.transform.baseVal.consolidate())?(e=e.matrix,di(e.a,e.b,e.c,e.d,e.e,e.f)):Bn)}function dl(e,r,n,o){function i(c){return c.length?c.pop()+" ":""}function a(c,f,h,d,p,m){if(c!==h||f!==d){var v=p.push("translate(",null,r,null,n);m.push({i:v-4,x:De(c,h)},{i:v-2,x:De(f,d)})}else(h||d)&&p.push("translate("+h+r+d+n)}function s(c,f,h,d){c!==f?(c-f>180?f+=360:f-c>180&&(c+=360),d.push({i:h.push(i(h)+"rotate(",null,o)-2,x:De(c,f)})):f&&h.push(i(h)+"rotate("+f+o)}function l(c,f,h,d){c!==f?d.push({i:h.push(i(h)+"skewX(",null,o)-2,x:De(c,f)}):f&&h.push(i(h)+"skewX("+f+o)}function u(c,f,h,d,p,m){if(c!==h||f!==d){var v=p.push(i(p)+"scale(",null,",",null,")");m.push({i:v-4,x:De(c,h)},{i:v-2,x:De(f,d)})}else(h!==1||d!==1)&&p.push(i(p)+"scale("+h+","+d+")")}return function(c,f){var h=[],d=[];return c=e(c),f=e(f),a(c.translateX,c.translateY,f.translateX,f.translateY,h,d),s(c.rotate,f.rotate,h,d),l(c.skewX,f.skewX,h,d),u(c.scaleX,c.scaleY,f.scaleX,f.scaleY,h,d),c=f=null,function(p){for(var m=-1,v=d.length,x;++m<v;)h[(x=d[m]).i]=x.x(p);return h.join("")}}}var pi=dl(fl,"px, ","px)","deg)"),mi=dl(hl,", ",")",")");var Pm=1e-12;function pl(e){return((e=Math.exp(e))+1/e)/2}function Om(e){return((e=Math.exp(e))-1/e)/2}function Bm(e){return((e=Math.exp(2*e))-1)/(e+1)}var gi=(function e(r,n,o){function i(a,s){var l=a[0],u=a[1],c=a[2],f=s[0],h=s[1],d=s[2],p=f-l,m=h-u,v=p*p+m*m,x,g;if(v<Pm)g=Math.log(d/c)/r,x=function(C){return[l+C*p,u+C*m,c*Math.exp(r*C*g)]};else{var b=Math.sqrt(v),k=(d*d-c*c+o*v)/(2*c*n*b),y=(d*d-c*c-o*v)/(2*d*n*b),_=Math.log(Math.sqrt(k*k+1)-k),w=Math.log(Math.sqrt(y*y+1)-y);g=(w-_)/r,x=function(C){var R=C*g,S=pl(_),N=c/(n*b)*(S*Bm(r*R+_)-Om(_));return[l+N*p,u+N*m,c*S/pl(r*R+_)]}}return x.duration=g*1e3*r/Math.SQRT2,x}return i.rho=function(a){var s=Math.max(.001,+a),l=s*s,u=l*l;return e(s,l,u)},i})(Math.SQRT2,2,4);var Gt=0,Ar=0,Cr=0,gl=1e3,$n,Rr,Hn=0,Mt=0,Un=0,Er=typeof performance=="object"&&performance.now?performance:Date,xl=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(e){setTimeout(e,17)};function Sr(){return Mt||(xl(jm),Mt=Er.now()+Un)}function jm(){Mt=0}function Dr(){this._call=this._time=this._next=null}Dr.prototype=qt.prototype={constructor:Dr,restart:function(e,r,n){if(typeof e!="function")throw new TypeError("callback is not a function");n=(n==null?Sr():+n)+(r==null?0:+r),!this._next&&Rr!==this&&(Rr?Rr._next=this:$n=this,Rr=this),this._call=e,this._time=n,xi()},stop:function(){this._call&&(this._call=null,this._time=1/0,xi())}};function qt(e,r,n){var o=new Dr;return o.restart(e,r,n),o}function vl(){Sr(),++Gt;for(var e=$n,r;e;)(r=Mt-e._time)>=0&&e._call.call(void 0,r),e=e._next;--Gt}function ml(){Mt=(Hn=Er.now())+Un,Gt=Ar=0;try{vl()}finally{Gt=0,Hm(),Mt=0}}function $m(){var e=Er.now(),r=e-Hn;r>gl&&(Un-=r,Hn=e)}function Hm(){for(var e,r=$n,n,o=1/0;r;)r._call?(o>r._time&&(o=r._time),e=r,r=r._next):(n=r._next,r._next=null,r=e?e._next=n:$n=n);Rr=e,xi(o)}function xi(e){if(!Gt){Ar&&(Ar=clearTimeout(Ar));var r=e-Mt;r>24?(e<1/0&&(Ar=setTimeout(ml,e-Er.now()-Un)),Cr&&(Cr=clearInterval(Cr))):(Cr||(Hn=Er.now(),Cr=setInterval($m,gl)),Gt=1,xl(ml))}}function Gn(e,r,n){var o=new Dr;return r=r==null?0:+r,o.restart(i=>{o.stop(),e(i+r)},r,n),o}var Um=ot("start","end","cancel","interrupt"),Gm=[],bl=0,yl=1,Wn=2,qn=3,_l=4,Jn=5,Mr=6;function dt(e,r,n,o,i,a){var s=e.__transition;if(!s)e.__transition={};else if(n in s)return;qm(e,n,{name:r,index:o,group:i,on:Um,tween:Gm,time:a.time,delay:a.delay,duration:a.duration,ease:a.ease,timer:null,state:bl})}function Tr(e,r){var n=ae(e,r);if(n.state>bl)throw new Error("too late; already scheduled");return n}function fe(e,r){var n=ae(e,r);if(n.state>qn)throw new Error("too late; already running");return n}function ae(e,r){var n=e.__transition;if(!n||!(n=n[r]))throw new Error("transition not found");return n}function qm(e,r,n){var o=e.__transition,i;o[r]=n,n.timer=qt(a,0,n.time);function a(c){n.state=yl,n.timer.restart(s,n.delay,n.time),n.delay<=c&&s(c-n.delay)}function s(c){var f,h,d,p;if(n.state!==yl)return u();for(f in o)if(p=o[f],p.name===n.name){if(p.state===qn)return Gn(s);p.state===_l?(p.state=Mr,p.timer.stop(),p.on.call("interrupt",e,e.__data__,p.index,p.group),delete o[f]):+f<r&&(p.state=Mr,p.timer.stop(),p.on.call("cancel",e,e.__data__,p.index,p.group),delete o[f])}if(Gn(function(){n.state===qn&&(n.state=_l,n.timer.restart(l,n.delay,n.time),l(c))}),n.state=Wn,n.on.call("start",e,e.__data__,n.index,n.group),n.state===Wn){for(n.state=qn,i=new Array(d=n.tween.length),f=0,h=-1;f<d;++f)(p=n.tween[f].value.call(e,e.__data__,n.index,n.group))&&(i[++h]=p);i.length=h+1}}function l(c){for(var f=c<n.duration?n.ease.call(null,c/n.duration):(n.timer.restart(u),n.state=Jn,1),h=-1,d=i.length;++h<d;)i[h].call(e,f);n.state===Jn&&(n.on.call("end",e,e.__data__,n.index,n.group),u())}function u(){n.state=Mr,n.timer.stop(),delete o[r];for(var c in o)return;delete e.__transition}}function Tt(e,r){var n=e.__transition,o,i,a=!0,s;if(n){r=r==null?null:r+"";for(s in n){if((o=n[s]).name!==r){a=!1;continue}i=o.state>Wn&&o.state<Jn,o.state=Mr,o.timer.stop(),o.on.call(i?"interrupt":"cancel",e,e.__data__,o.index,o.group),delete n[s]}a&&delete e.__transition}}function wl(e){return this.each(function(){Tt(this,e)})}function Wm(e,r){var n,o;return function(){var i=fe(this,e),a=i.tween;if(a!==n){o=n=a;for(var s=0,l=o.length;s<l;++s)if(o[s].name===r){o=o.slice(),o.splice(s,1);break}}i.tween=o}}function Jm(e,r,n){var o,i;if(typeof n!="function")throw new Error;return function(){var a=fe(this,e),s=a.tween;if(s!==o){i=(o=s).slice();for(var l={name:r,value:n},u=0,c=i.length;u<c;++u)if(i[u].name===r){i[u]=l;break}u===c&&i.push(l)}a.tween=i}}function kl(e,r){var n=this._id;if(e+="",arguments.length<2){for(var o=ae(this.node(),n).tween,i=0,a=o.length,s;i<a;++i)if((s=o[i]).name===e)return s.value;return null}return this.each((r==null?Wm:Jm)(n,e,r))}function Wt(e,r,n){var o=e._id;return e.each(function(){var i=fe(this,o);(i.value||(i.value={}))[r]=n.apply(this,arguments)}),function(i){return ae(i,o).value[r]}}function Xn(e,r){var n;return(typeof r=="number"?De:r instanceof ht?On:(n=ht(r))?(r=n,On):hi)(e,r)}function Xm(e){return function(){this.removeAttribute(e)}}function Vm(e){return function(){this.removeAttributeNS(e.space,e.local)}}function Ym(e,r,n){var o,i=n+"",a;return function(){var s=this.getAttribute(e);return s===i?null:s===o?a:a=r(o=s,n)}}function Zm(e,r,n){var o,i=n+"",a;return function(){var s=this.getAttributeNS(e.space,e.local);return s===i?null:s===o?a:a=r(o=s,n)}}function Km(e,r,n){var o,i,a;return function(){var s,l=n(this),u;return l==null?void this.removeAttribute(e):(s=this.getAttribute(e),u=l+"",s===u?null:s===o&&u===i?a:(i=u,a=r(o=s,l)))}}function Qm(e,r,n){var o,i,a;return function(){var s,l=n(this),u;return l==null?void this.removeAttributeNS(e.space,e.local):(s=this.getAttributeNS(e.space,e.local),u=l+"",s===u?null:s===o&&u===i?a:(i=u,a=r(o=s,l)))}}function Cl(e,r){var n=rt(e),o=n==="transform"?mi:Xn;return this.attrTween(e,typeof r=="function"?(n.local?Qm:Km)(n,o,Wt(this,"attr."+e,r)):r==null?(n.local?Vm:Xm)(n):(n.local?Zm:Ym)(n,o,r))}function eg(e,r){return function(n){this.setAttribute(e,r.call(this,n))}}function tg(e,r){return function(n){this.setAttributeNS(e.space,e.local,r.call(this,n))}}function rg(e,r){var n,o;function i(){var a=r.apply(this,arguments);return a!==o&&(n=(o=a)&&tg(e,a)),n}return i._value=r,i}function ng(e,r){var n,o;function i(){var a=r.apply(this,arguments);return a!==o&&(n=(o=a)&&eg(e,a)),n}return i._value=r,i}function Al(e,r){var n="attr."+e;if(arguments.length<2)return(n=this.tween(n))&&n._value;if(r==null)return this.tween(n,null);if(typeof r!="function")throw new Error;var o=rt(e);return this.tween(n,(o.local?rg:ng)(o,r))}function og(e,r){return function(){Tr(this,e).delay=+r.apply(this,arguments)}}function ig(e,r){return r=+r,function(){Tr(this,e).delay=r}}function Rl(e){var r=this._id;return arguments.length?this.each((typeof e=="function"?og:ig)(r,e)):ae(this.node(),r).delay}function ag(e,r){return function(){fe(this,e).duration=+r.apply(this,arguments)}}function sg(e,r){return r=+r,function(){fe(this,e).duration=r}}function El(e){var r=this._id;return arguments.length?this.each((typeof e=="function"?ag:sg)(r,e)):ae(this.node(),r).duration}function lg(e,r){if(typeof r!="function")throw new Error;return function(){fe(this,e).ease=r}}function Dl(e){var r=this._id;return arguments.length?this.each(lg(r,e)):ae(this.node(),r).ease}function ug(e,r){return function(){var n=r.apply(this,arguments);if(typeof n!="function")throw new Error;fe(this,e).ease=n}}function Sl(e){if(typeof e!="function")throw new Error;return this.each(ug(this._id,e))}function Ml(e){typeof e!="function"&&(e=mr(e));for(var r=this._groups,n=r.length,o=new Array(n),i=0;i<n;++i)for(var a=r[i],s=a.length,l=o[i]=[],u,c=0;c<s;++c)(u=a[c])&&e.call(u,u.__data__,c,a)&&l.push(u);return new me(o,this._parents,this._name,this._id)}function Tl(e){if(e._id!==this._id)throw new Error;for(var r=this._groups,n=e._groups,o=r.length,i=n.length,a=Math.min(o,i),s=new Array(o),l=0;l<a;++l)for(var u=r[l],c=n[l],f=u.length,h=s[l]=new Array(f),d,p=0;p<f;++p)(d=u[p]||c[p])&&(h[p]=d);for(;l<o;++l)s[l]=r[l];return new me(s,this._parents,this._name,this._id)}function cg(e){return(e+"").trim().split(/^|\s+/).every(function(r){var n=r.indexOf(".");return n>=0&&(r=r.slice(0,n)),!r||r==="start"})}function fg(e,r,n){var o,i,a=cg(r)?Tr:fe;return function(){var s=a(this,e),l=s.on;l!==o&&(i=(o=l).copy()).on(r,n),s.on=i}}function Nl(e,r){var n=this._id;return arguments.length<2?ae(this.node(),n).on.on(e):this.each(fg(n,e,r))}function hg(e){return function(){var r=this.parentNode;for(var n in this.__transition)if(+n!==e)return;r&&r.removeChild(this)}}function Fl(){return this.on("end.remove",hg(this._id))}function Il(e){var r=this._name,n=this._id;typeof e!="function"&&(e=Rt(e));for(var o=this._groups,i=o.length,a=new Array(i),s=0;s<i;++s)for(var l=o[s],u=l.length,c=a[s]=new Array(u),f,h,d=0;d<u;++d)(f=l[d])&&(h=e.call(f,f.__data__,d,l))&&("__data__"in f&&(h.__data__=f.__data__),c[d]=h,dt(c[d],r,n,d,c,ae(f,n)));return new me(a,this._parents,r,n)}function Ll(e){var r=this._name,n=this._id;typeof e!="function"&&(e=pr(e));for(var o=this._groups,i=o.length,a=[],s=[],l=0;l<i;++l)for(var u=o[l],c=u.length,f,h=0;h<c;++h)if(f=u[h]){for(var d=e.call(f,f.__data__,h,u),p,m=ae(f,n),v=0,x=d.length;v<x;++v)(p=d[v])&&dt(p,r,n,v,d,m);a.push(d),s.push(f)}return new me(a,s,r,n)}var dg=nt.prototype.constructor;function zl(){return new dg(this._groups,this._parents)}function pg(e,r){var n,o,i;return function(){var a=ct(this,e),s=(this.style.removeProperty(e),ct(this,e));return a===s?null:a===n&&s===o?i:i=r(n=a,o=s)}}function Pl(e){return function(){this.style.removeProperty(e)}}function mg(e,r,n){var o,i=n+"",a;return function(){var s=ct(this,e);return s===i?null:s===o?a:a=r(o=s,n)}}function gg(e,r,n){var o,i,a;return function(){var s=ct(this,e),l=n(this),u=l+"";return l==null&&(u=l=(this.style.removeProperty(e),ct(this,e))),s===u?null:s===o&&u===i?a:(i=u,a=r(o=s,l))}}function xg(e,r){var n,o,i,a="style."+r,s="end."+a,l;return function(){var u=fe(this,e),c=u.on,f=u.value[a]==null?l||(l=Pl(r)):void 0;(c!==n||i!==f)&&(o=(n=c).copy()).on(s,i=f),u.on=o}}function Ol(e,r,n){var o=(e+="")=="transform"?pi:Xn;return r==null?this.styleTween(e,pg(e,o)).on("end.style."+e,Pl(e)):typeof r=="function"?this.styleTween(e,gg(e,o,Wt(this,"style."+e,r))).each(xg(this._id,e)):this.styleTween(e,mg(e,o,r),n).on("end.style."+e,null)}function vg(e,r,n){return function(o){this.style.setProperty(e,r.call(this,o),n)}}function yg(e,r,n){var o,i;function a(){var s=r.apply(this,arguments);return s!==i&&(o=(i=s)&&vg(e,s,n)),o}return a._value=r,a}function Bl(e,r,n){var o="style."+(e+="");if(arguments.length<2)return(o=this.tween(o))&&o._value;if(r==null)return this.tween(o,null);if(typeof r!="function")throw new Error;return this.tween(o,yg(e,r,n??""))}function _g(e){return function(){this.textContent=e}}function bg(e){return function(){var r=e(this);this.textContent=r??""}}function jl(e){return this.tween("text",typeof e=="function"?bg(Wt(this,"text",e)):_g(e==null?"":e+""))}function wg(e){return function(r){this.textContent=e.call(this,r)}}function kg(e){var r,n;function o(){var i=e.apply(this,arguments);return i!==n&&(r=(n=i)&&wg(i)),r}return o._value=e,o}function $l(e){var r="text";if(arguments.length<1)return(r=this.tween(r))&&r._value;if(e==null)return this.tween(r,null);if(typeof e!="function")throw new Error;return this.tween(r,kg(e))}function Hl(){for(var e=this._name,r=this._id,n=Vn(),o=this._groups,i=o.length,a=0;a<i;++a)for(var s=o[a],l=s.length,u,c=0;c<l;++c)if(u=s[c]){var f=ae(u,r);dt(u,e,n,c,s,{time:f.time+f.delay+f.duration,delay:0,duration:f.duration,ease:f.ease})}return new me(o,this._parents,e,n)}function Ul(){var e,r,n=this,o=n._id,i=n.size();return new Promise(function(a,s){var l={value:s},u={value:function(){--i===0&&a()}};n.each(function(){var c=fe(this,o),f=c.on;f!==e&&(r=(e=f).copy(),r._.cancel.push(l),r._.interrupt.push(l),r._.end.push(u)),c.on=r}),i===0&&a()})}var Cg=0;function me(e,r,n,o){this._groups=e,this._parents=r,this._name=n,this._id=o}function Gl(e){return nt().transition(e)}function Vn(){return++Cg}var it=nt.prototype;me.prototype=Gl.prototype={constructor:me,select:Il,selectAll:Ll,selectChild:it.selectChild,selectChildren:it.selectChildren,filter:Ml,merge:Tl,selection:zl,transition:Hl,call:it.call,nodes:it.nodes,node:it.node,size:it.size,empty:it.empty,each:it.each,on:Nl,attr:Cl,attrTween:Al,style:Ol,styleTween:Bl,text:jl,textTween:$l,remove:Fl,tween:kl,delay:Rl,duration:El,ease:Dl,easeVarying:Sl,end:Ul,[Symbol.iterator]:it[Symbol.iterator]};function Yn(e){return((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2}var Ag={time:null,delay:0,duration:250,ease:Yn};function Rg(e,r){for(var n;!(n=e.__transition)||!(n=n[r]);)if(!(e=e.parentNode))throw new Error(`transition ${r} not found`);return n}function ql(e){var r,n;e instanceof me?(r=e._id,e=e._name):(r=Vn(),(n=Ag).time=Sr(),e=e==null?null:e+"");for(var o=this._groups,i=o.length,a=0;a<i;++a)for(var s=o[a],l=s.length,u,c=0;c<l;++c)(u=s[c])&&dt(u,e,r,c,s,n||Rg(u,r));return new me(o,this._parents,e,r)}nt.prototype.interrupt=wl;nt.prototype.transition=ql;var Nr=e=>()=>e;function vi(e,{sourceEvent:r,target:n,transform:o,dispatch:i}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:r,enumerable:!0,configurable:!0},target:{value:n,enumerable:!0,configurable:!0},transform:{value:o,enumerable:!0,configurable:!0},_:{value:i}})}function je(e,r,n){this.k=e,this.x=r,this.y=n}je.prototype={constructor:je,scale:function(e){return e===1?this:new je(this.k*e,this.x,this.y)},translate:function(e,r){return e===0&r===0?this:new je(this.k,this.x+this.k*e,this.y+this.k*r)},apply:function(e){return[e[0]*this.k+this.x,e[1]*this.k+this.y]},applyX:function(e){return e*this.k+this.x},applyY:function(e){return e*this.k+this.y},invert:function(e){return[(e[0]-this.x)/this.k,(e[1]-this.y)/this.k]},invertX:function(e){return(e-this.x)/this.k},invertY:function(e){return(e-this.y)/this.k},rescaleX:function(e){return e.copy().domain(e.range().map(this.invertX,this).map(e.invert,e))},rescaleY:function(e){return e.copy().domain(e.range().map(this.invertY,this).map(e.invert,e))},toString:function(){return"translate("+this.x+","+this.y+") scale("+this.k+")"}};var Fr=new je(1,0,0);Ae.prototype=je.prototype;function Ae(e){for(;!e.__zoom;)if(!(e=e.parentNode))return Fr;return e.__zoom}function Zn(e){e.stopImmediatePropagation()}function Jt(e){e.preventDefault(),e.stopImmediatePropagation()}function Eg(e){return(!e.ctrlKey||e.type==="wheel")&&!e.button}function Dg(){var e=this;return e instanceof SVGElement?(e=e.ownerSVGElement||e,e.hasAttribute("viewBox")?(e=e.viewBox.baseVal,[[e.x,e.y],[e.x+e.width,e.y+e.height]]):[[0,0],[e.width.baseVal.value,e.height.baseVal.value]]):[[0,0],[e.clientWidth,e.clientHeight]]}function Wl(){return this.__zoom||Fr}function Sg(e){return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*(e.ctrlKey?10:1)}function Mg(){return navigator.maxTouchPoints||"ontouchstart"in this}function Tg(e,r,n){var o=e.invertX(r[0][0])-n[0][0],i=e.invertX(r[1][0])-n[1][0],a=e.invertY(r[0][1])-n[0][1],s=e.invertY(r[1][1])-n[1][1];return e.translate(i>o?(o+i)/2:Math.min(0,o)||Math.max(0,i),s>a?(a+s)/2:Math.min(0,a)||Math.max(0,s))}function yi(){var e=Eg,r=Dg,n=Tg,o=Sg,i=Mg,a=[0,1/0],s=[[-1/0,-1/0],[1/0,1/0]],l=250,u=gi,c=ot("start","zoom","end"),f,h,d,p=500,m=150,v=0,x=10;function g(A){A.property("__zoom",Wl).on("wheel.zoom",R,{passive:!1}).on("mousedown.zoom",S).on("dblclick.zoom",N).filter(i).on("touchstart.zoom",T).on("touchmove.zoom",L).on("touchend.zoom touchcancel.zoom",B).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}g.transform=function(A,F,M,z){var j=A.selection?A.selection():A;j.property("__zoom",Wl),A!==j?_(A,F,M,z):j.interrupt().each(function(){w(this,arguments).event(z).start().zoom(null,typeof F=="function"?F.apply(this,arguments):F).end()})},g.scaleBy=function(A,F,M,z){g.scaleTo(A,function(){var j=this.__zoom.k,$=typeof F=="function"?F.apply(this,arguments):F;return j*$},M,z)},g.scaleTo=function(A,F,M,z){g.transform(A,function(){var j=r.apply(this,arguments),$=this.__zoom,U=M==null?y(j):typeof M=="function"?M.apply(this,arguments):M,W=$.invert(U),V=typeof F=="function"?F.apply(this,arguments):F;return n(k(b($,V),U,W),j,s)},M,z)},g.translateBy=function(A,F,M,z){g.transform(A,function(){return n(this.__zoom.translate(typeof F=="function"?F.apply(this,arguments):F,typeof M=="function"?M.apply(this,arguments):M),r.apply(this,arguments),s)},null,z)},g.translateTo=function(A,F,M,z,j){g.transform(A,function(){var $=r.apply(this,arguments),U=this.__zoom,W=z==null?y($):typeof z=="function"?z.apply(this,arguments):z;return n(Fr.translate(W[0],W[1]).scale(U.k).translate(typeof F=="function"?-F.apply(this,arguments):-F,typeof M=="function"?-M.apply(this,arguments):-M),$,s)},z,j)};function b(A,F){return F=Math.max(a[0],Math.min(a[1],F)),F===A.k?A:new je(F,A.x,A.y)}function k(A,F,M){var z=F[0]-M[0]*A.k,j=F[1]-M[1]*A.k;return z===A.x&&j===A.y?A:new je(A.k,z,j)}function y(A){return[(+A[0][0]+ +A[1][0])/2,(+A[0][1]+ +A[1][1])/2]}function _(A,F,M,z){A.on("start.zoom",function(){w(this,arguments).event(z).start()}).on("interrupt.zoom end.zoom",function(){w(this,arguments).event(z).end()}).tween("zoom",function(){var j=this,$=arguments,U=w(j,$).event(z),W=r.apply(j,$),V=M==null?y(W):typeof M=="function"?M.apply(j,$):M,Ce=Math.max(W[1][0]-W[0][0],W[1][1]-W[0][1]),ce=j.__zoom,Pe=typeof F=="function"?F.apply(j,$):F,et=u(ce.invert(V).concat(Ce/ce.k),Pe.invert(V).concat(Ce/Pe.k));return function(Oe){if(Oe===1)Oe=Pe;else{var tt=et(Oe),ei=Ce/tt[2];Oe=new je(ei,V[0]-tt[0]*ei,V[1]-tt[1]*ei)}U.zoom(null,Oe)}})}function w(A,F,M){return!M&&A.__zooming||new C(A,F)}function C(A,F){this.that=A,this.args=F,this.active=0,this.sourceEvent=null,this.extent=r.apply(A,F),this.taps=0}C.prototype={event:function(A){return A&&(this.sourceEvent=A),this},start:function(){return++this.active===1&&(this.that.__zooming=this,this.emit("start")),this},zoom:function(A,F){return this.mouse&&A!=="mouse"&&(this.mouse[1]=F.invert(this.mouse[0])),this.touch0&&A!=="touch"&&(this.touch0[1]=F.invert(this.touch0[0])),this.touch1&&A!=="touch"&&(this.touch1[1]=F.invert(this.touch1[0])),this.that.__zoom=F,this.emit("zoom"),this},end:function(){return--this.active===0&&(delete this.that.__zooming,this.emit("end")),this},emit:function(A){var F=se(this.that).datum();c.call(A,this.that,new vi(A,{sourceEvent:this.sourceEvent,target:g,type:A,transform:this.that.__zoom,dispatch:c}),F)}};function R(A,...F){if(!e.apply(this,arguments))return;var M=w(this,F).event(A),z=this.__zoom,j=Math.max(a[0],Math.min(a[1],z.k*Math.pow(2,o.apply(this,arguments)))),$=ve(A);if(M.wheel)(M.mouse[0][0]!==$[0]||M.mouse[0][1]!==$[1])&&(M.mouse[1]=z.invert(M.mouse[0]=$)),clearTimeout(M.wheel);else{if(z.k===j)return;M.mouse=[$,z.invert($)],Tt(this),M.start()}Jt(A),M.wheel=setTimeout(U,m),M.zoom("mouse",n(k(b(z,j),M.mouse[0],M.mouse[1]),M.extent,s));function U(){M.wheel=null,M.end()}}function S(A,...F){if(d||!e.apply(this,arguments))return;var M=A.currentTarget,z=w(this,F,!0).event(A),j=se(A.view).on("mousemove.zoom",V,!0).on("mouseup.zoom",Ce,!0),$=ve(A,M),U=A.clientX,W=A.clientY;xr(A.view),Zn(A),z.mouse=[$,this.__zoom.invert($)],Tt(this),z.start();function V(ce){if(Jt(ce),!z.moved){var Pe=ce.clientX-U,et=ce.clientY-W;z.moved=Pe*Pe+et*et>v}z.event(ce).zoom("mouse",n(k(z.that.__zoom,z.mouse[0]=ve(ce,M),z.mouse[1]),z.extent,s))}function Ce(ce){j.on("mousemove.zoom mouseup.zoom",null),vr(ce.view,z.moved),Jt(ce),z.event(ce).end()}}function N(A,...F){if(e.apply(this,arguments)){var M=this.__zoom,z=ve(A.changedTouches?A.changedTouches[0]:A,this),j=M.invert(z),$=M.k*(A.shiftKey?.5:2),U=n(k(b(M,$),z,j),r.apply(this,F),s);Jt(A),l>0?se(this).transition().duration(l).call(_,U,z,A):se(this).call(g.transform,U,z,A)}}function T(A,...F){if(e.apply(this,arguments)){var M=A.touches,z=M.length,j=w(this,F,A.changedTouches.length===z).event(A),$,U,W,V;for(Zn(A),U=0;U<z;++U)W=M[U],V=ve(W,this),V=[V,this.__zoom.invert(V),W.identifier],j.touch0?!j.touch1&&j.touch0[2]!==V[2]&&(j.touch1=V,j.taps=0):(j.touch0=V,$=!0,j.taps=1+!!f);f&&(f=clearTimeout(f)),$&&(j.taps<2&&(h=V[0],f=setTimeout(function(){f=null},p)),Tt(this),j.start())}}function L(A,...F){if(this.__zooming){var M=w(this,F).event(A),z=A.changedTouches,j=z.length,$,U,W,V;for(Jt(A),$=0;$<j;++$)U=z[$],W=ve(U,this),M.touch0&&M.touch0[2]===U.identifier?M.touch0[0]=W:M.touch1&&M.touch1[2]===U.identifier&&(M.touch1[0]=W);if(U=M.that.__zoom,M.touch1){var Ce=M.touch0[0],ce=M.touch0[1],Pe=M.touch1[0],et=M.touch1[1],Oe=(Oe=Pe[0]-Ce[0])*Oe+(Oe=Pe[1]-Ce[1])*Oe,tt=(tt=et[0]-ce[0])*tt+(tt=et[1]-ce[1])*tt;U=b(U,Math.sqrt(Oe/tt)),W=[(Ce[0]+Pe[0])/2,(Ce[1]+Pe[1])/2],V=[(ce[0]+et[0])/2,(ce[1]+et[1])/2]}else if(M.touch0)W=M.touch0[0],V=M.touch0[1];else return;M.zoom("touch",n(k(U,W,V),M.extent,s))}}function B(A,...F){if(this.__zooming){var M=w(this,F).event(A),z=A.changedTouches,j=z.length,$,U;for(Zn(A),d&&clearTimeout(d),d=setTimeout(function(){d=null},p),$=0;$<j;++$)U=z[$],M.touch0&&M.touch0[2]===U.identifier?delete M.touch0:M.touch1&&M.touch1[2]===U.identifier&&delete M.touch1;if(M.touch1&&!M.touch0&&(M.touch0=M.touch1,delete M.touch1),M.touch0)M.touch0[1]=this.__zoom.invert(M.touch0[0]);else if(M.end(),M.taps===2&&(U=ve(U,this),Math.hypot(h[0]-U[0],h[1]-U[1])<x)){var W=se(this).on("dblclick.zoom");W&&W.apply(this,arguments)}}}return g.wheelDelta=function(A){return arguments.length?(o=typeof A=="function"?A:Nr(+A),g):o},g.filter=function(A){return arguments.length?(e=typeof A=="function"?A:Nr(!!A),g):e},g.touchable=function(A){return arguments.length?(i=typeof A=="function"?A:Nr(!!A),g):i},g.extent=function(A){return arguments.length?(r=typeof A=="function"?A:Nr([[+A[0][0],+A[0][1]],[+A[1][0],+A[1][1]]]),g):r},g.scaleExtent=function(A){return arguments.length?(a[0]=+A[0],a[1]=+A[1],g):[a[0],a[1]]},g.translateExtent=function(A){return arguments.length?(s[0][0]=+A[0][0],s[1][0]=+A[1][0],s[0][1]=+A[0][1],s[1][1]=+A[1][1],g):[[s[0][0],s[0][1]],[s[1][0],s[1][1]]]},g.constrain=function(A){return arguments.length?(n=A,g):n},g.duration=function(A){return arguments.length?(l=+A,g):l},g.interpolate=function(A){return arguments.length?(u=A,g):u},g.on=function(){var A=c.on.apply(c,arguments);return A===c?g:A},g.clickDistance=function(A){return arguments.length?(v=(A=+A)*A,g):Math.sqrt(v)},g.tapDistance=function(A){return arguments.length?(x=+A,g):x},g}var Xt=class extends Map{constructor(r,n=Ig){if(super(),Object.defineProperties(this,{_intern:{value:new Map},_key:{value:n}}),r!=null)for(let[o,i]of r)this.set(o,i)}get(r){return super.get(Jl(this,r))}has(r){return super.has(Jl(this,r))}set(r,n){return super.set(Ng(this,r),n)}delete(r){return super.delete(Fg(this,r))}};function Jl({_intern:e,_key:r},n){let o=r(n);return e.has(o)?e.get(o):n}function Ng({_intern:e,_key:r},n){let o=r(n);return e.has(o)?e.get(o):(e.set(o,n),n)}function Fg({_intern:e,_key:r},n){let o=r(n);return e.has(o)&&(n=e.get(o),e.delete(o)),n}function Ig(e){return e!==null&&typeof e=="object"?e.valueOf():e}function Ir(e,r){let n;if(r===void 0)for(let o of e)o!=null&&(n<o||n===void 0&&o>=o)&&(n=o);else{let o=-1;for(let i of e)(i=r(i,++o,e))!=null&&(n<i||n===void 0&&i>=i)&&(n=i)}return n}function Lr(e,r){let n;if(r===void 0)for(let o of e)o!=null&&(n>o||n===void 0&&o>=o)&&(n=o);else{let o=-1;for(let i of e)(i=r(i,++o,e))!=null&&(n>i||n===void 0&&i>=i)&&(n=i)}return n}function Kn(e,r){let n=0;if(r===void 0)for(let o of e)(o=+o)&&(n+=o);else{let o=-1;for(let i of e)(i=+r(i,++o,e))&&(n+=i)}return n}var Lg=typeof global=="object"&&global&&global.Object===Object&&global,Xl=Lg;var zg=typeof self=="object"&&self&&self.Object===Object&&self,Pg=Xl||zg||Function("return this")(),Qn=Pg;var Og=Qn.Symbol,Vt=Og;var Vl=Object.prototype,Bg=Vl.hasOwnProperty,jg=Vl.toString,zr=Vt?Vt.toStringTag:void 0;function $g(e){var r=Bg.call(e,zr),n=e[zr];try{e[zr]=void 0;var o=!0}catch{}var i=jg.call(e);return o&&(r?e[zr]=n:delete e[zr]),i}var Yl=$g;var Hg=Object.prototype,Ug=Hg.toString;function Gg(e){return Ug.call(e)}var Zl=Gg;var qg="[object Null]",Wg="[object Undefined]",Kl=Vt?Vt.toStringTag:void 0;function Jg(e){return e==null?e===void 0?Wg:qg:Kl&&Kl in Object(e)?Yl(e):Zl(e)}var Ql=Jg;function Xg(e){return e!=null&&typeof e=="object"}var eu=Xg;var Vg="[object Symbol]";function Yg(e){return typeof e=="symbol"||eu(e)&&Ql(e)==Vg}var tu=Yg;var Zg=/\s/;function Kg(e){for(var r=e.length;r--&&Zg.test(e.charAt(r)););return r}var ru=Kg;var Qg=/^\s+/;function e0(e){return e&&e.slice(0,ru(e)+1).replace(Qg,"")}var nu=e0;function t0(e){var r=typeof e;return e!=null&&(r=="object"||r=="function")}var Nt=t0;var ou=NaN,r0=/^[-+]0x[0-9a-f]+$/i,n0=/^0b[01]+$/i,o0=/^0o[0-7]+$/i,i0=parseInt;function a0(e){if(typeof e=="number")return e;if(tu(e))return ou;if(Nt(e)){var r=typeof e.valueOf=="function"?e.valueOf():e;e=Nt(r)?r+"":r}if(typeof e!="string")return e===0?e:+e;e=nu(e);var n=n0.test(e);return n||o0.test(e)?i0(e.slice(2),n?2:8):r0.test(e)?ou:+e}var _i=a0;var s0=function(){return Qn.Date.now()},eo=s0;var l0="Expected a function",u0=Math.max,c0=Math.min;function f0(e,r,n){var o,i,a,s,l,u,c=0,f=!1,h=!1,d=!0;if(typeof e!="function")throw new TypeError(l0);r=_i(r)||0,Nt(n)&&(f=!!n.leading,h="maxWait"in n,a=h?u0(_i(n.maxWait)||0,r):a,d="trailing"in n?!!n.trailing:d);function p(w){var C=o,R=i;return o=i=void 0,c=w,s=e.apply(R,C),s}function m(w){return c=w,l=setTimeout(g,r),f?p(w):s}function v(w){var C=w-u,R=w-c,S=r-C;return h?c0(S,a-R):S}function x(w){var C=w-u,R=w-c;return u===void 0||C>=r||C<0||h&&R>=a}function g(){var w=eo();if(x(w))return b(w);l=setTimeout(g,v(w))}function b(w){return l=void 0,d&&o?p(w):(o=i=void 0,s)}function k(){l!==void 0&&clearTimeout(l),c=0,o=u=i=l=void 0}function y(){return l===void 0?s:b(eo())}function _(){var w=eo(),C=x(w);if(o=arguments,i=this,u=w,C){if(l===void 0)return m(u);if(h)return clearTimeout(l),l=setTimeout(g,r),p(u)}return l===void 0&&(l=setTimeout(g,r)),s}return _.cancel=k,_.flush=y,_}var to=f0;var h0="Expected a function";function d0(e,r,n){var o=!0,i=!0;if(typeof e!="function")throw new TypeError(h0);return Nt(n)&&(o="leading"in n?!!n.leading:o,i="trailing"in n?!!n.trailing:i),to(e,r,{leading:o,maxWait:r,trailing:i})}var bi=d0;var pt=Object.freeze({Linear:Object.freeze({None:function(e){return e},In:function(e){return e},Out:function(e){return e},InOut:function(e){return e}}),Quadratic:Object.freeze({In:function(e){return e*e},Out:function(e){return e*(2-e)},InOut:function(e){return(e*=2)<1?.5*e*e:-.5*(--e*(e-2)-1)}}),Cubic:Object.freeze({In:function(e){return e*e*e},Out:function(e){return--e*e*e+1},InOut:function(e){return(e*=2)<1?.5*e*e*e:.5*((e-=2)*e*e+2)}}),Quartic:Object.freeze({In:function(e){return e*e*e*e},Out:function(e){return 1- --e*e*e*e},InOut:function(e){return(e*=2)<1?.5*e*e*e*e:-.5*((e-=2)*e*e*e-2)}}),Quintic:Object.freeze({In:function(e){return e*e*e*e*e},Out:function(e){return--e*e*e*e*e+1},InOut:function(e){return(e*=2)<1?.5*e*e*e*e*e:.5*((e-=2)*e*e*e*e+2)}}),Sinusoidal:Object.freeze({In:function(e){return 1-Math.sin((1-e)*Math.PI/2)},Out:function(e){return Math.sin(e*Math.PI/2)},InOut:function(e){return .5*(1-Math.sin(Math.PI*(.5-e)))}}),Exponential:Object.freeze({In:function(e){return e===0?0:Math.pow(1024,e-1)},Out:function(e){return e===1?1:1-Math.pow(2,-10*e)},InOut:function(e){return e===0?0:e===1?1:(e*=2)<1?.5*Math.pow(1024,e-1):.5*(-Math.pow(2,-10*(e-1))+2)}}),Circular:Object.freeze({In:function(e){return 1-Math.sqrt(1-e*e)},Out:function(e){return Math.sqrt(1- --e*e)},InOut:function(e){return(e*=2)<1?-.5*(Math.sqrt(1-e*e)-1):.5*(Math.sqrt(1-(e-=2)*e)+1)}}),Elastic:Object.freeze({In:function(e){return e===0?0:e===1?1:-Math.pow(2,10*(e-1))*Math.sin((e-1.1)*5*Math.PI)},Out:function(e){return e===0?0:e===1?1:Math.pow(2,-10*e)*Math.sin((e-.1)*5*Math.PI)+1},InOut:function(e){return e===0?0:e===1?1:(e*=2,e<1?-.5*Math.pow(2,10*(e-1))*Math.sin((e-1.1)*5*Math.PI):.5*Math.pow(2,-10*(e-1))*Math.sin((e-1.1)*5*Math.PI)+1)}}),Back:Object.freeze({In:function(e){var r=1.70158;return e===1?1:e*e*((r+1)*e-r)},Out:function(e){var r=1.70158;return e===0?0:--e*e*((r+1)*e+r)+1},InOut:function(e){var r=2.5949095;return(e*=2)<1?.5*(e*e*((r+1)*e-r)):.5*((e-=2)*e*((r+1)*e+r)+2)}}),Bounce:Object.freeze({In:function(e){return 1-pt.Bounce.Out(1-e)},Out:function(e){return e<.36363636363636365?7.5625*e*e:e<.7272727272727273?7.5625*(e-=.5454545454545454)*e+.75:e<.9090909090909091?7.5625*(e-=.8181818181818182)*e+.9375:7.5625*(e-=.9545454545454546)*e+.984375},InOut:function(e){return e<.5?pt.Bounce.In(e*2)*.5:pt.Bounce.Out(e*2-1)*.5+.5}}),generatePow:function(e){return e===void 0&&(e=4),e=e<Number.EPSILON?Number.EPSILON:e,e=e>1e4?1e4:e,{In:function(r){return Math.pow(r,e)},Out:function(r){return 1-Math.pow(1-r,e)},InOut:function(r){return r<.5?Math.pow(r*2,e)/2:(1-Math.pow(2-r*2,e))/2+.5}}}}),Pr=function(){return performance.now()},ki=(function(){function e(){for(var r=[],n=0;n<arguments.length;n++)r[n]=arguments[n];this._tweens={},this._tweensAddedDuringUpdate={},this.add.apply(this,r)}return e.prototype.getAll=function(){var r=this;return Object.keys(this._tweens).map(function(n){return r._tweens[n]})},e.prototype.removeAll=function(){this._tweens={}},e.prototype.add=function(){for(var r,n=[],o=0;o<arguments.length;o++)n[o]=arguments[o];for(var i=0,a=n;i<a.length;i++){var s=a[i];(r=s._group)===null||r===void 0||r.remove(s),s._group=this,this._tweens[s.getId()]=s,this._tweensAddedDuringUpdate[s.getId()]=s}},e.prototype.remove=function(){for(var r=[],n=0;n<arguments.length;n++)r[n]=arguments[n];for(var o=0,i=r;o<i.length;o++){var a=i[o];a._group=void 0,delete this._tweens[a.getId()],delete this._tweensAddedDuringUpdate[a.getId()]}},e.prototype.allStopped=function(){return this.getAll().every(function(r){return!r.isPlaying()})},e.prototype.update=function(r,n){r===void 0&&(r=Pr()),n===void 0&&(n=!0);var o=Object.keys(this._tweens);if(o.length!==0)for(;o.length>0;){this._tweensAddedDuringUpdate={};for(var i=0;i<o.length;i++){var a=this._tweens[o[i]],s=!n;a&&a.update(r,s)===!1&&!n&&this.remove(a)}o=Object.keys(this._tweensAddedDuringUpdate)}},e})(),Yt={Linear:function(e,r){var n=e.length-1,o=n*r,i=Math.floor(o),a=Yt.Utils.Linear;return r<0?a(e[0],e[1],o):r>1?a(e[n],e[n-1],n-o):a(e[i],e[i+1>n?n:i+1],o-i)},Bezier:function(e,r){for(var n=0,o=e.length-1,i=Math.pow,a=Yt.Utils.Bernstein,s=0;s<=o;s++)n+=i(1-r,o-s)*i(r,s)*e[s]*a(o,s);return n},CatmullRom:function(e,r){var n=e.length-1,o=n*r,i=Math.floor(o),a=Yt.Utils.CatmullRom;return e[0]===e[n]?(r<0&&(i=Math.floor(o=n*(1+r))),a(e[(i-1+n)%n],e[i],e[(i+1)%n],e[(i+2)%n],o-i)):r<0?e[0]-(a(e[0],e[0],e[1],e[1],-o)-e[0]):r>1?e[n]-(a(e[n],e[n],e[n-1],e[n-1],o-n)-e[n]):a(e[i?i-1:0],e[i],e[n<i+1?n:i+1],e[n<i+2?n:i+2],o-i)},Utils:{Linear:function(e,r,n){return(r-e)*n+e},Bernstein:function(e,r){var n=Yt.Utils.Factorial;return n(e)/n(r)/n(e-r)},Factorial:(function(){var e=[1];return function(r){var n=1;if(e[r])return e[r];for(var o=r;o>1;o--)n*=o;return e[r]=n,n}})(),CatmullRom:function(e,r,n,o,i){var a=(n-e)*.5,s=(o-r)*.5,l=i*i,u=i*l;return(2*r-2*n+a+s)*u+(-3*r+3*n-2*a-s)*l+a*i+r}}},iu=(function(){function e(){}return e.nextId=function(){return e._nextId++},e._nextId=0,e})(),wi=new ki,Ci=(function(){function e(r,n){this._isPaused=!1,this._pauseStart=0,this._valuesStart={},this._valuesEnd={},this._valuesStartRepeat={},this._duration=1e3,this._isDynamic=!1,this._initialRepeat=0,this._repeat=0,this._yoyo=!1,this._isPlaying=!1,this._reversed=!1,this._delayTime=0,this._startTime=0,this._easingFunction=pt.Linear.None,this._interpolationFunction=Yt.Linear,this._chainedTweens=[],this._onStartCallbackFired=!1,this._onEveryStartCallbackFired=!1,this._id=iu.nextId(),this._isChainStopped=!1,this._propertiesAreSetUp=!1,this._goToEnd=!1,this._object=r,typeof n=="object"?(this._group=n,n.add(this)):n===!0&&(this._group=wi,wi.add(this))}return e.prototype.getId=function(){return this._id},e.prototype.isPlaying=function(){return this._isPlaying},e.prototype.isPaused=function(){return this._isPaused},e.prototype.getDuration=function(){return this._duration},e.prototype.to=function(r,n){if(n===void 0&&(n=1e3),this._isPlaying)throw new Error("Can not call Tween.to() while Tween is already started or paused. Stop the Tween first.");return this._valuesEnd=r,this._propertiesAreSetUp=!1,this._duration=n<0?0:n,this},e.prototype.duration=function(r){return r===void 0&&(r=1e3),this._duration=r<0?0:r,this},e.prototype.dynamic=function(r){return r===void 0&&(r=!1),this._isDynamic=r,this},e.prototype.start=function(r,n){if(r===void 0&&(r=Pr()),n===void 0&&(n=!1),this._isPlaying)return this;if(this._repeat=this._initialRepeat,this._reversed){this._reversed=!1;for(var o in this._valuesStartRepeat)this._swapEndStartRepeatValues(o),this._valuesStart[o]=this._valuesStartRepeat[o]}if(this._isPlaying=!0,this._isPaused=!1,this._onStartCallbackFired=!1,this._onEveryStartCallbackFired=!1,this._isChainStopped=!1,this._startTime=r,this._startTime+=this._delayTime,!this._propertiesAreSetUp||n){if(this._propertiesAreSetUp=!0,!this._isDynamic){var i={};for(var a in this._valuesEnd)i[a]=this._valuesEnd[a];this._valuesEnd=i}this._setupProperties(this._object,this._valuesStart,this._valuesEnd,this._valuesStartRepeat,n)}return this},e.prototype.startFromCurrentValues=function(r){return this.start(r,!0)},e.prototype._setupProperties=function(r,n,o,i,a){for(var s in o){var l=r[s],u=Array.isArray(l),c=u?"array":typeof l,f=!u&&Array.isArray(o[s]);if(!(c==="undefined"||c==="function")){if(f){var h=o[s];if(h.length===0)continue;for(var d=[l],p=0,m=h.length;p<m;p+=1){var v=this._handleRelativeValue(l,h[p]);if(isNaN(v)){f=!1,console.warn("Found invalid interpolation list. Skipping.");break}d.push(v)}f&&(o[s]=d)}if((c==="object"||u)&&l&&!f){n[s]=u?[]:{};var x=l;for(var g in x)n[s][g]=x[g];i[s]=u?[]:{};var h=o[s];if(!this._isDynamic){var b={};for(var g in h)b[g]=h[g];o[s]=h=b}this._setupProperties(x,n[s],h,i[s],a)}else(typeof n[s]>"u"||a)&&(n[s]=l),u||(n[s]*=1),f?i[s]=o[s].slice().reverse():i[s]=n[s]||0}}},e.prototype.stop=function(){return this._isChainStopped||(this._isChainStopped=!0,this.stopChainedTweens()),this._isPlaying?(this._isPlaying=!1,this._isPaused=!1,this._onStopCallback&&this._onStopCallback(this._object),this):this},e.prototype.end=function(){return this._goToEnd=!0,this.update(this._startTime+this._duration),this},e.prototype.pause=function(r){return r===void 0&&(r=Pr()),this._isPaused||!this._isPlaying?this:(this._isPaused=!0,this._pauseStart=r,this)},e.prototype.resume=function(r){return r===void 0&&(r=Pr()),!this._isPaused||!this._isPlaying?this:(this._isPaused=!1,this._startTime+=r-this._pauseStart,this._pauseStart=0,this)},e.prototype.stopChainedTweens=function(){for(var r=0,n=this._chainedTweens.length;r<n;r++)this._chainedTweens[r].stop();return this},e.prototype.group=function(r){return r?(r.add(this),this):(console.warn("tween.group() without args has been removed, use group.add(tween) instead."),this)},e.prototype.remove=function(){var r;return(r=this._group)===null||r===void 0||r.remove(this),this},e.prototype.delay=function(r){return r===void 0&&(r=0),this._delayTime=r,this},e.prototype.repeat=function(r){return r===void 0&&(r=0),this._initialRepeat=r,this._repeat=r,this},e.prototype.repeatDelay=function(r){return this._repeatDelayTime=r,this},e.prototype.yoyo=function(r){return r===void 0&&(r=!1),this._yoyo=r,this},e.prototype.easing=function(r){return r===void 0&&(r=pt.Linear.None),this._easingFunction=r,this},e.prototype.interpolation=function(r){return r===void 0&&(r=Yt.Linear),this._interpolationFunction=r,this},e.prototype.chain=function(){for(var r=[],n=0;n<arguments.length;n++)r[n]=arguments[n];return this._chainedTweens=r,this},e.prototype.onStart=function(r){return this._onStartCallback=r,this},e.prototype.onEveryStart=function(r){return this._onEveryStartCallback=r,this},e.prototype.onUpdate=function(r){return this._onUpdateCallback=r,this},e.prototype.onRepeat=function(r){return this._onRepeatCallback=r,this},e.prototype.onComplete=function(r){return this._onCompleteCallback=r,this},e.prototype.onStop=function(r){return this._onStopCallback=r,this},e.prototype.update=function(r,n){var o=this,i;if(r===void 0&&(r=Pr()),n===void 0&&(n=e.autoStartOnUpdate),this._isPaused)return!0;var a;if(!this._goToEnd&&!this._isPlaying)if(n)this.start(r,!0);else return!1;if(this._goToEnd=!1,r<this._startTime)return!0;this._onStartCallbackFired===!1&&(this._onStartCallback&&this._onStartCallback(this._object),this._onStartCallbackFired=!0),this._onEveryStartCallbackFired===!1&&(this._onEveryStartCallback&&this._onEveryStartCallback(this._object),this._onEveryStartCallbackFired=!0);var s=r-this._startTime,l=this._duration+((i=this._repeatDelayTime)!==null&&i!==void 0?i:this._delayTime),u=this._duration+this._repeat*l,c=function(){if(o._duration===0||s>u)return 1;var v=Math.trunc(s/l),x=s-v*l,g=Math.min(x/o._duration,1);return g===0&&s===o._duration?1:g},f=c(),h=this._easingFunction(f);if(this._updateProperties(this._object,this._valuesStart,this._valuesEnd,h),this._onUpdateCallback&&this._onUpdateCallback(this._object,f),this._duration===0||s>=this._duration)if(this._repeat>0){var d=Math.min(Math.trunc((s-this._duration)/l)+1,this._repeat);isFinite(this._repeat)&&(this._repeat-=d);for(a in this._valuesStartRepeat)!this._yoyo&&typeof this._valuesEnd[a]=="string"&&(this._valuesStartRepeat[a]=this._valuesStartRepeat[a]+parseFloat(this._valuesEnd[a])),this._yoyo&&this._swapEndStartRepeatValues(a),this._valuesStart[a]=this._valuesStartRepeat[a];return this._yoyo&&(this._reversed=!this._reversed),this._startTime+=l*d,this._onRepeatCallback&&this._onRepeatCallback(this._object),this._onEveryStartCallbackFired=!1,!0}else{this._onCompleteCallback&&this._onCompleteCallback(this._object);for(var p=0,m=this._chainedTweens.length;p<m;p++)this._chainedTweens[p].start(this._startTime+this._duration,!1);return this._isPlaying=!1,!1}return!0},e.prototype._updateProperties=function(r,n,o,i){for(var a in o)if(n[a]!==void 0){var s=n[a]||0,l=o[a],u=Array.isArray(r[a]),c=Array.isArray(l),f=!u&&c;f?r[a]=this._interpolationFunction(l,i):typeof l=="object"&&l?this._updateProperties(r[a],s,l,i):(l=this._handleRelativeValue(s,l),typeof l=="number"&&(r[a]=s+(l-s)*i))}},e.prototype._handleRelativeValue=function(r,n){return typeof n!="string"?n:n.charAt(0)==="+"||n.charAt(0)==="-"?r+parseFloat(n):parseFloat(n)},e.prototype._swapEndStartRepeatValues=function(r){var n=this._valuesStartRepeat[r],o=this._valuesEnd[r];typeof o=="string"?this._valuesStartRepeat[r]=this._valuesStartRepeat[r]+parseFloat(o):this._valuesStartRepeat[r]=this._valuesEnd[r],this._valuesEnd[r]=n},e.autoStartOnUpdate=!1,e})();var sR=iu.nextId,Je=wi,lR=Je.getAll.bind(Je),uR=Je.removeAll.bind(Je),cR=Je.add.bind(Je),fR=Je.remove.bind(Je),hR=Je.update.bind(Je);function au(e,r){(r==null||r>e.length)&&(r=e.length);for(var n=0,o=Array(r);n<r;n++)o[n]=e[n];return o}function p0(e){if(Array.isArray(e))return e}function m0(e,r){if(!(e instanceof r))throw new TypeError("Cannot call a class as a function")}function g0(e,r,n){return Object.defineProperty(e,"prototype",{writable:!1}),e}function x0(e,r){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var o,i,a,s,l=[],u=!0,c=!1;try{if(a=(n=n.call(e)).next,r!==0)for(;!(u=(o=a.call(n)).done)&&(l.push(o.value),l.length!==r);u=!0);}catch(f){c=!0,i=f}finally{try{if(!u&&n.return!=null&&(s=n.return(),Object(s)!==s))return}finally{if(c)throw i}}return l}}function v0(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
2
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function y0(e,r){return p0(e)||x0(e,r)||_0(e,r)||v0()}function _0(e,r){if(e){if(typeof e=="string")return au(e,r);var n={}.toString.call(e).slice(8,-1);return n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set"?Array.from(e):n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?au(e,r):void 0}}var b0=g0(function e(r,n){var o=n.default,i=o===void 0?null:o,a=n.triggerUpdate,s=a===void 0?!0:a,l=n.onChange,u=l===void 0?function(c,f){}:l;m0(this,e),this.name=r,this.defaultVal=i,this.triggerUpdate=s,this.onChange=u});function Or(e){var r=e.stateInit,n=r===void 0?function(){return{}}:r,o=e.props,i=o===void 0?{}:o,a=e.methods,s=a===void 0?{}:a,l=e.aliases,u=l===void 0?{}:l,c=e.init,f=c===void 0?function(){}:c,h=e.update,d=h===void 0?function(){}:h,p=Object.keys(i).map(function(m){return new b0(m,i[m])});return function m(){for(var v=arguments.length,x=new Array(v),g=0;g<v;g++)x[g]=arguments[g];var b=!!(this instanceof m&&this.constructor),k=b?x.shift():void 0,y=x[0],_=y===void 0?{}:y,w=Object.assign({},n instanceof Function?n(_):n,{initialised:!1}),C={};function R(T){return S(T,_),N(),R}var S=function(L,B){f.call(R,L,w,B),w.initialised=!0},N=to(function(){w.initialised&&(d.call(R,w,C),C={})},1);return p.forEach(function(T){R[T.name]=L(T);function L(B){var A=B.name,F=B.triggerUpdate,M=F===void 0?!1:F,z=B.onChange,j=z===void 0?function(W,V){}:z,$=B.defaultVal,U=$===void 0?null:$;return function(W){var V=w[A];if(!arguments.length)return V;var Ce=W===void 0?U:W;return w[A]=Ce,j.call(R,Ce,w,V),!C.hasOwnProperty(A)&&(C[A]=V),M&&N(),R}}}),Object.keys(s).forEach(function(T){R[T]=function(){for(var L,B=arguments.length,A=new Array(B),F=0;F<B;F++)A[F]=arguments[F];return(L=s[T]).call.apply(L,[R,w].concat(A))}}),Object.entries(u).forEach(function(T){var L=y0(T,2),B=L[0],A=L[1];return R[B]=R[A]}),R.resetProps=function(){return p.forEach(function(T){R[T.name](T.defaultVal)}),R},R.resetProps(),w._rerender=N,b&&k&&R(k),R}}var q=(function(e){return typeof e=="function"?e:typeof e=="string"?function(r){return r[e]}:function(r){return e}});function ro(e){"@babel/helpers - typeof";return ro=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(r){return typeof r}:function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},ro(e)}var w0=/^\s+/,k0=/\s+$/;function O(e,r){if(e=e||"",r=r||{},e instanceof O)return e;if(!(this instanceof O))return new O(e,r);var n=C0(e);this._originalInput=e,this._r=n.r,this._g=n.g,this._b=n.b,this._a=n.a,this._roundA=Math.round(100*this._a)/100,this._format=r.format||n.format,this._gradientType=r.gradientType,this._r<1&&(this._r=Math.round(this._r)),this._g<1&&(this._g=Math.round(this._g)),this._b<1&&(this._b=Math.round(this._b)),this._ok=n.ok}O.prototype={isDark:function(){return this.getBrightness()<128},isLight:function(){return!this.isDark()},isValid:function(){return this._ok},getOriginalInput:function(){return this._originalInput},getFormat:function(){return this._format},getAlpha:function(){return this._a},getBrightness:function(){var r=this.toRgb();return(r.r*299+r.g*587+r.b*114)/1e3},getLuminance:function(){var r=this.toRgb(),n,o,i,a,s,l;return n=r.r/255,o=r.g/255,i=r.b/255,n<=.03928?a=n/12.92:a=Math.pow((n+.055)/1.055,2.4),o<=.03928?s=o/12.92:s=Math.pow((o+.055)/1.055,2.4),i<=.03928?l=i/12.92:l=Math.pow((i+.055)/1.055,2.4),.2126*a+.7152*s+.0722*l},setAlpha:function(r){return this._a=du(r),this._roundA=Math.round(100*this._a)/100,this},toHsv:function(){var r=lu(this._r,this._g,this._b);return{h:r.h*360,s:r.s,v:r.v,a:this._a}},toHsvString:function(){var r=lu(this._r,this._g,this._b),n=Math.round(r.h*360),o=Math.round(r.s*100),i=Math.round(r.v*100);return this._a==1?"hsv("+n+", "+o+"%, "+i+"%)":"hsva("+n+", "+o+"%, "+i+"%, "+this._roundA+")"},toHsl:function(){var r=su(this._r,this._g,this._b);return{h:r.h*360,s:r.s,l:r.l,a:this._a}},toHslString:function(){var r=su(this._r,this._g,this._b),n=Math.round(r.h*360),o=Math.round(r.s*100),i=Math.round(r.l*100);return this._a==1?"hsl("+n+", "+o+"%, "+i+"%)":"hsla("+n+", "+o+"%, "+i+"%, "+this._roundA+")"},toHex:function(r){return uu(this._r,this._g,this._b,r)},toHexString:function(r){return"#"+this.toHex(r)},toHex8:function(r){return D0(this._r,this._g,this._b,this._a,r)},toHex8String:function(r){return"#"+this.toHex8(r)},toRgb:function(){return{r:Math.round(this._r),g:Math.round(this._g),b:Math.round(this._b),a:this._a}},toRgbString:function(){return this._a==1?"rgb("+Math.round(this._r)+", "+Math.round(this._g)+", "+Math.round(this._b)+")":"rgba("+Math.round(this._r)+", "+Math.round(this._g)+", "+Math.round(this._b)+", "+this._roundA+")"},toPercentageRgb:function(){return{r:Math.round(K(this._r,255)*100)+"%",g:Math.round(K(this._g,255)*100)+"%",b:Math.round(K(this._b,255)*100)+"%",a:this._a}},toPercentageRgbString:function(){return this._a==1?"rgb("+Math.round(K(this._r,255)*100)+"%, "+Math.round(K(this._g,255)*100)+"%, "+Math.round(K(this._b,255)*100)+"%)":"rgba("+Math.round(K(this._r,255)*100)+"%, "+Math.round(K(this._g,255)*100)+"%, "+Math.round(K(this._b,255)*100)+"%, "+this._roundA+")"},toName:function(){return this._a===0?"transparent":this._a<1?!1:j0[uu(this._r,this._g,this._b,!0)]||!1},toFilter:function(r){var n="#"+cu(this._r,this._g,this._b,this._a),o=n,i=this._gradientType?"GradientType = 1, ":"";if(r){var a=O(r);o="#"+cu(a._r,a._g,a._b,a._a)}return"progid:DXImageTransform.Microsoft.gradient("+i+"startColorstr="+n+",endColorstr="+o+")"},toString:function(r){var n=!!r;r=r||this._format;var o=!1,i=this._a<1&&this._a>=0,a=!n&&i&&(r==="hex"||r==="hex6"||r==="hex3"||r==="hex4"||r==="hex8"||r==="name");return a?r==="name"&&this._a===0?this.toName():this.toRgbString():(r==="rgb"&&(o=this.toRgbString()),r==="prgb"&&(o=this.toPercentageRgbString()),(r==="hex"||r==="hex6")&&(o=this.toHexString()),r==="hex3"&&(o=this.toHexString(!0)),r==="hex4"&&(o=this.toHex8String(!0)),r==="hex8"&&(o=this.toHex8String()),r==="name"&&(o=this.toName()),r==="hsl"&&(o=this.toHslString()),r==="hsv"&&(o=this.toHsvString()),o||this.toHexString())},clone:function(){return O(this.toString())},_applyModification:function(r,n){var o=r.apply(null,[this].concat([].slice.call(n)));return this._r=o._r,this._g=o._g,this._b=o._b,this.setAlpha(o._a),this},lighten:function(){return this._applyModification(N0,arguments)},brighten:function(){return this._applyModification(F0,arguments)},darken:function(){return this._applyModification(I0,arguments)},desaturate:function(){return this._applyModification(S0,arguments)},saturate:function(){return this._applyModification(M0,arguments)},greyscale:function(){return this._applyModification(T0,arguments)},spin:function(){return this._applyModification(L0,arguments)},_applyCombination:function(r,n){return r.apply(null,[this].concat([].slice.call(n)))},analogous:function(){return this._applyCombination(O0,arguments)},complement:function(){return this._applyCombination(z0,arguments)},monochromatic:function(){return this._applyCombination(B0,arguments)},splitcomplement:function(){return this._applyCombination(P0,arguments)},triad:function(){return this._applyCombination(fu,[3])},tetrad:function(){return this._applyCombination(fu,[4])}};O.fromRatio=function(e,r){if(ro(e)=="object"){var n={};for(var o in e)e.hasOwnProperty(o)&&(o==="a"?n[o]=e[o]:n[o]=Br(e[o]));e=n}return O(e,r)};function C0(e){var r={r:0,g:0,b:0},n=1,o=null,i=null,a=null,s=!1,l=!1;return typeof e=="string"&&(e=G0(e)),ro(e)=="object"&&(at(e.r)&&at(e.g)&&at(e.b)?(r=A0(e.r,e.g,e.b),s=!0,l=String(e.r).substr(-1)==="%"?"prgb":"rgb"):at(e.h)&&at(e.s)&&at(e.v)?(o=Br(e.s),i=Br(e.v),r=E0(e.h,o,i),s=!0,l="hsv"):at(e.h)&&at(e.s)&&at(e.l)&&(o=Br(e.s),a=Br(e.l),r=R0(e.h,o,a),s=!0,l="hsl"),e.hasOwnProperty("a")&&(n=e.a)),n=du(n),{ok:s,format:e.format||l,r:Math.min(255,Math.max(r.r,0)),g:Math.min(255,Math.max(r.g,0)),b:Math.min(255,Math.max(r.b,0)),a:n}}function A0(e,r,n){return{r:K(e,255)*255,g:K(r,255)*255,b:K(n,255)*255}}function su(e,r,n){e=K(e,255),r=K(r,255),n=K(n,255);var o=Math.max(e,r,n),i=Math.min(e,r,n),a,s,l=(o+i)/2;if(o==i)a=s=0;else{var u=o-i;switch(s=l>.5?u/(2-o-i):u/(o+i),o){case e:a=(r-n)/u+(r<n?6:0);break;case r:a=(n-e)/u+2;break;case n:a=(e-r)/u+4;break}a/=6}return{h:a,s,l}}function R0(e,r,n){var o,i,a;e=K(e,360),r=K(r,100),n=K(n,100);function s(c,f,h){return h<0&&(h+=1),h>1&&(h-=1),h<1/6?c+(f-c)*6*h:h<1/2?f:h<2/3?c+(f-c)*(2/3-h)*6:c}if(r===0)o=i=a=n;else{var l=n<.5?n*(1+r):n+r-n*r,u=2*n-l;o=s(u,l,e+1/3),i=s(u,l,e),a=s(u,l,e-1/3)}return{r:o*255,g:i*255,b:a*255}}function lu(e,r,n){e=K(e,255),r=K(r,255),n=K(n,255);var o=Math.max(e,r,n),i=Math.min(e,r,n),a,s,l=o,u=o-i;if(s=o===0?0:u/o,o==i)a=0;else{switch(o){case e:a=(r-n)/u+(r<n?6:0);break;case r:a=(n-e)/u+2;break;case n:a=(e-r)/u+4;break}a/=6}return{h:a,s,v:l}}function E0(e,r,n){e=K(e,360)*6,r=K(r,100),n=K(n,100);var o=Math.floor(e),i=e-o,a=n*(1-r),s=n*(1-i*r),l=n*(1-(1-i)*r),u=o%6,c=[n,s,a,a,l,n][u],f=[l,n,n,s,a,a][u],h=[a,a,l,n,n,s][u];return{r:c*255,g:f*255,b:h*255}}function uu(e,r,n,o){var i=[He(Math.round(e).toString(16)),He(Math.round(r).toString(16)),He(Math.round(n).toString(16))];return o&&i[0].charAt(0)==i[0].charAt(1)&&i[1].charAt(0)==i[1].charAt(1)&&i[2].charAt(0)==i[2].charAt(1)?i[0].charAt(0)+i[1].charAt(0)+i[2].charAt(0):i.join("")}function D0(e,r,n,o,i){var a=[He(Math.round(e).toString(16)),He(Math.round(r).toString(16)),He(Math.round(n).toString(16)),He(pu(o))];return i&&a[0].charAt(0)==a[0].charAt(1)&&a[1].charAt(0)==a[1].charAt(1)&&a[2].charAt(0)==a[2].charAt(1)&&a[3].charAt(0)==a[3].charAt(1)?a[0].charAt(0)+a[1].charAt(0)+a[2].charAt(0)+a[3].charAt(0):a.join("")}function cu(e,r,n,o){var i=[He(pu(o)),He(Math.round(e).toString(16)),He(Math.round(r).toString(16)),He(Math.round(n).toString(16))];return i.join("")}O.equals=function(e,r){return!e||!r?!1:O(e).toRgbString()==O(r).toRgbString()};O.random=function(){return O.fromRatio({r:Math.random(),g:Math.random(),b:Math.random()})};function S0(e,r){r=r===0?0:r||10;var n=O(e).toHsl();return n.s-=r/100,n.s=no(n.s),O(n)}function M0(e,r){r=r===0?0:r||10;var n=O(e).toHsl();return n.s+=r/100,n.s=no(n.s),O(n)}function T0(e){return O(e).desaturate(100)}function N0(e,r){r=r===0?0:r||10;var n=O(e).toHsl();return n.l+=r/100,n.l=no(n.l),O(n)}function F0(e,r){r=r===0?0:r||10;var n=O(e).toRgb();return n.r=Math.max(0,Math.min(255,n.r-Math.round(255*-(r/100)))),n.g=Math.max(0,Math.min(255,n.g-Math.round(255*-(r/100)))),n.b=Math.max(0,Math.min(255,n.b-Math.round(255*-(r/100)))),O(n)}function I0(e,r){r=r===0?0:r||10;var n=O(e).toHsl();return n.l-=r/100,n.l=no(n.l),O(n)}function L0(e,r){var n=O(e).toHsl(),o=(n.h+r)%360;return n.h=o<0?360+o:o,O(n)}function z0(e){var r=O(e).toHsl();return r.h=(r.h+180)%360,O(r)}function fu(e,r){if(isNaN(r)||r<=0)throw new Error("Argument to polyad must be a positive number");for(var n=O(e).toHsl(),o=[O(e)],i=360/r,a=1;a<r;a++)o.push(O({h:(n.h+a*i)%360,s:n.s,l:n.l}));return o}function P0(e){var r=O(e).toHsl(),n=r.h;return[O(e),O({h:(n+72)%360,s:r.s,l:r.l}),O({h:(n+216)%360,s:r.s,l:r.l})]}function O0(e,r,n){r=r||6,n=n||30;var o=O(e).toHsl(),i=360/n,a=[O(e)];for(o.h=(o.h-(i*r>>1)+720)%360;--r;)o.h=(o.h+i)%360,a.push(O(o));return a}function B0(e,r){r=r||6;for(var n=O(e).toHsv(),o=n.h,i=n.s,a=n.v,s=[],l=1/r;r--;)s.push(O({h:o,s:i,v:a})),a=(a+l)%1;return s}O.mix=function(e,r,n){n=n===0?0:n||50;var o=O(e).toRgb(),i=O(r).toRgb(),a=n/100,s={r:(i.r-o.r)*a+o.r,g:(i.g-o.g)*a+o.g,b:(i.b-o.b)*a+o.b,a:(i.a-o.a)*a+o.a};return O(s)};O.readability=function(e,r){var n=O(e),o=O(r);return(Math.max(n.getLuminance(),o.getLuminance())+.05)/(Math.min(n.getLuminance(),o.getLuminance())+.05)};O.isReadable=function(e,r,n){var o=O.readability(e,r),i,a;switch(a=!1,i=q0(n),i.level+i.size){case"AAsmall":case"AAAlarge":a=o>=4.5;break;case"AAlarge":a=o>=3;break;case"AAAsmall":a=o>=7;break}return a};O.mostReadable=function(e,r,n){var o=null,i=0,a,s,l,u;n=n||{},s=n.includeFallbackColors,l=n.level,u=n.size;for(var c=0;c<r.length;c++)a=O.readability(e,r[c]),a>i&&(i=a,o=O(r[c]));return O.isReadable(e,o,{level:l,size:u})||!s?o:(n.includeFallbackColors=!1,O.mostReadable(e,["#fff","#000"],n))};var Ai=O.names={aliceblue:"f0f8ff",antiquewhite:"faebd7",aqua:"0ff",aquamarine:"7fffd4",azure:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"000",blanchedalmond:"ffebcd",blue:"00f",blueviolet:"8a2be2",brown:"a52a2a",burlywood:"deb887",burntsienna:"ea7e5d",cadetblue:"5f9ea0",chartreuse:"7fff00",chocolate:"d2691e",coral:"ff7f50",cornflowerblue:"6495ed",cornsilk:"fff8dc",crimson:"dc143c",cyan:"0ff",darkblue:"00008b",darkcyan:"008b8b",darkgoldenrod:"b8860b",darkgray:"a9a9a9",darkgreen:"006400",darkgrey:"a9a9a9",darkkhaki:"bdb76b",darkmagenta:"8b008b",darkolivegreen:"556b2f",darkorange:"ff8c00",darkorchid:"9932cc",darkred:"8b0000",darksalmon:"e9967a",darkseagreen:"8fbc8f",darkslateblue:"483d8b",darkslategray:"2f4f4f",darkslategrey:"2f4f4f",darkturquoise:"00ced1",darkviolet:"9400d3",deeppink:"ff1493",deepskyblue:"00bfff",dimgray:"696969",dimgrey:"696969",dodgerblue:"1e90ff",firebrick:"b22222",floralwhite:"fffaf0",forestgreen:"228b22",fuchsia:"f0f",gainsboro:"dcdcdc",ghostwhite:"f8f8ff",gold:"ffd700",goldenrod:"daa520",gray:"808080",green:"008000",greenyellow:"adff2f",grey:"808080",honeydew:"f0fff0",hotpink:"ff69b4",indianred:"cd5c5c",indigo:"4b0082",ivory:"fffff0",khaki:"f0e68c",lavender:"e6e6fa",lavenderblush:"fff0f5",lawngreen:"7cfc00",lemonchiffon:"fffacd",lightblue:"add8e6",lightcoral:"f08080",lightcyan:"e0ffff",lightgoldenrodyellow:"fafad2",lightgray:"d3d3d3",lightgreen:"90ee90",lightgrey:"d3d3d3",lightpink:"ffb6c1",lightsalmon:"ffa07a",lightseagreen:"20b2aa",lightskyblue:"87cefa",lightslategray:"789",lightslategrey:"789",lightsteelblue:"b0c4de",lightyellow:"ffffe0",lime:"0f0",limegreen:"32cd32",linen:"faf0e6",magenta:"f0f",maroon:"800000",mediumaquamarine:"66cdaa",mediumblue:"0000cd",mediumorchid:"ba55d3",mediumpurple:"9370db",mediumseagreen:"3cb371",mediumslateblue:"7b68ee",mediumspringgreen:"00fa9a",mediumturquoise:"48d1cc",mediumvioletred:"c71585",midnightblue:"191970",mintcream:"f5fffa",mistyrose:"ffe4e1",moccasin:"ffe4b5",navajowhite:"ffdead",navy:"000080",oldlace:"fdf5e6",olive:"808000",olivedrab:"6b8e23",orange:"ffa500",orangered:"ff4500",orchid:"da70d6",palegoldenrod:"eee8aa",palegreen:"98fb98",paleturquoise:"afeeee",palevioletred:"db7093",papayawhip:"ffefd5",peachpuff:"ffdab9",peru:"cd853f",pink:"ffc0cb",plum:"dda0dd",powderblue:"b0e0e6",purple:"800080",rebeccapurple:"663399",red:"f00",rosybrown:"bc8f8f",royalblue:"4169e1",saddlebrown:"8b4513",salmon:"fa8072",sandybrown:"f4a460",seagreen:"2e8b57",seashell:"fff5ee",sienna:"a0522d",silver:"c0c0c0",skyblue:"87ceeb",slateblue:"6a5acd",slategray:"708090",slategrey:"708090",snow:"fffafa",springgreen:"00ff7f",steelblue:"4682b4",tan:"d2b48c",teal:"008080",thistle:"d8bfd8",tomato:"ff6347",turquoise:"40e0d0",violet:"ee82ee",wheat:"f5deb3",white:"fff",whitesmoke:"f5f5f5",yellow:"ff0",yellowgreen:"9acd32"},j0=O.hexNames=$0(Ai);function $0(e){var r={};for(var n in e)e.hasOwnProperty(n)&&(r[e[n]]=n);return r}function du(e){return e=parseFloat(e),(isNaN(e)||e<0||e>1)&&(e=1),e}function K(e,r){H0(e)&&(e="100%");var n=U0(e);return e=Math.min(r,Math.max(0,parseFloat(e))),n&&(e=parseInt(e*r,10)/100),Math.abs(e-r)<1e-6?1:e%r/parseFloat(r)}function no(e){return Math.min(1,Math.max(0,e))}function Re(e){return parseInt(e,16)}function H0(e){return typeof e=="string"&&e.indexOf(".")!=-1&&parseFloat(e)===1}function U0(e){return typeof e=="string"&&e.indexOf("%")!=-1}function He(e){return e.length==1?"0"+e:""+e}function Br(e){return e<=1&&(e=e*100+"%"),e}function pu(e){return Math.round(parseFloat(e)*255).toString(16)}function hu(e){return Re(e)/255}var $e=(function(){var e="[-\\+]?\\d+%?",r="[-\\+]?\\d*\\.\\d+%?",n="(?:"+r+")|(?:"+e+")",o="[\\s|\\(]+("+n+")[,|\\s]+("+n+")[,|\\s]+("+n+")\\s*\\)?",i="[\\s|\\(]+("+n+")[,|\\s]+("+n+")[,|\\s]+("+n+")[,|\\s]+("+n+")\\s*\\)?";return{CSS_UNIT:new RegExp(n),rgb:new RegExp("rgb"+o),rgba:new RegExp("rgba"+i),hsl:new RegExp("hsl"+o),hsla:new RegExp("hsla"+i),hsv:new RegExp("hsv"+o),hsva:new RegExp("hsva"+i),hex3:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex6:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,hex4:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex8:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/}})();function at(e){return!!$e.CSS_UNIT.exec(e)}function G0(e){e=e.replace(w0,"").replace(k0,"").toLowerCase();var r=!1;if(Ai[e])e=Ai[e],r=!0;else if(e=="transparent")return{r:0,g:0,b:0,a:0,format:"name"};var n;return(n=$e.rgb.exec(e))?{r:n[1],g:n[2],b:n[3]}:(n=$e.rgba.exec(e))?{r:n[1],g:n[2],b:n[3],a:n[4]}:(n=$e.hsl.exec(e))?{h:n[1],s:n[2],l:n[3]}:(n=$e.hsla.exec(e))?{h:n[1],s:n[2],l:n[3],a:n[4]}:(n=$e.hsv.exec(e))?{h:n[1],s:n[2],v:n[3]}:(n=$e.hsva.exec(e))?{h:n[1],s:n[2],v:n[3],a:n[4]}:(n=$e.hex8.exec(e))?{r:Re(n[1]),g:Re(n[2]),b:Re(n[3]),a:hu(n[4]),format:r?"name":"hex8"}:(n=$e.hex6.exec(e))?{r:Re(n[1]),g:Re(n[2]),b:Re(n[3]),format:r?"name":"hex"}:(n=$e.hex4.exec(e))?{r:Re(n[1]+""+n[1]),g:Re(n[2]+""+n[2]),b:Re(n[3]+""+n[3]),a:hu(n[4]+""+n[4]),format:r?"name":"hex8"}:(n=$e.hex3.exec(e))?{r:Re(n[1]+""+n[1]),g:Re(n[2]+""+n[2]),b:Re(n[3]+""+n[3]),format:r?"name":"hex"}:!1}function q0(e){var r,n;return e=e||{level:"AA",size:"small"},r=(e.level||"AA").toUpperCase(),n=(e.size||"small").toLowerCase(),r!=="AA"&&r!=="AAA"&&(r="AA"),n!=="small"&&n!=="large"&&(n="small"),{level:r,size:n}}function Ri(e,r){(r==null||r>e.length)&&(r=e.length);for(var n=0,o=Array(r);n<r;n++)o[n]=e[n];return o}function W0(e){if(Array.isArray(e))return Ri(e)}function vu(e,r,n){if(typeof e=="function"?e===r:e.has(r))return arguments.length<3?r:n;throw new TypeError("Private element is not present on this object")}function J0(e,r){if(r.has(e))throw new TypeError("Cannot initialize the same private elements twice on an object")}function X0(e,r){if(!(e instanceof r))throw new TypeError("Cannot call a class as a function")}function Se(e,r){return e.get(vu(e,r))}function mu(e,r,n){J0(e,r),r.set(e,n)}function gu(e,r,n){return e.set(vu(e,r),n),n}function V0(e,r){for(var n=0;n<r.length;n++){var o=r[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,tx(o.key),o)}}function Y0(e,r,n){return r&&V0(e.prototype,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function Z0(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function K0(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
3
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Q0(e){return W0(e)||Z0(e)||rx(e)||K0()}function ex(e,r){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var o=n.call(e,r);if(typeof o!="object")return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}function tx(e){var r=ex(e,"string");return typeof r=="symbol"?r:r+""}function rx(e,r){if(e){if(typeof e=="string")return Ri(e,r);var n={}.toString.call(e).slice(8,-1);return n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set"?Array.from(e):n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Ri(e,r):void 0}}var nx=123,ox=function(r){return"#".concat(Math.min(r,Math.pow(2,24)).toString(16).padStart(6,"0"))},yu=function(r,n,o){return(r<<16)+(n<<8)+o},ix=function(r){var n=O(r).toRgb(),o=n.r,i=n.g,a=n.b;return yu(o,i,a)},xu=function(r,n){return r*nx%Math.pow(2,n)},Ft=new WeakMap,st=new WeakMap,_u=(function(){function e(){var r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:6;X0(this,e),mu(this,Ft,void 0),mu(this,st,void 0),gu(st,this,r),this.reset()}return Y0(e,[{key:"reset",value:function(){gu(Ft,this,["__reserved for background__"])}},{key:"register",value:function(n){if(Se(Ft,this).length>=Math.pow(2,24-Se(st,this)))return null;var o=Se(Ft,this).length,i=xu(o,Se(st,this)),a=ox(o+(i<<24-Se(st,this)));return Se(Ft,this).push(n),a}},{key:"lookup",value:function(n){if(!n)return null;var o=typeof n=="string"?ix(n):yu.apply(void 0,Q0(n));if(!o)return null;var i=o&Math.pow(2,24-Se(st,this))-1,a=o>>24-Se(st,this)&Math.pow(2,Se(st,this))-1;return xu(i,Se(st,this))!==a||i>=Se(Ft,this).length?null:Se(Ft,this)[i]}}])})();var Hr,Q,Au,Mi,mt,bu,Ru,Eu,Ei,io,jr,Du,Ti,Di,Si,ax,so={},lo=[],sx=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,co=Array.isArray;function Xe(e,r){for(var n in r)e[n]=r[n];return e}function Ni(e){e&&e.parentNode&&e.parentNode.removeChild(e)}function lx(e,r,n){var o,i,a,s={};for(a in r)a=="key"?o=r[a]:a=="ref"?i=r[a]:s[a]=r[a];if(arguments.length>2&&(s.children=arguments.length>3?Hr.call(arguments,2):n),typeof e=="function"&&e.defaultProps!=null)for(a in e.defaultProps)s[a]===void 0&&(s[a]=e.defaultProps[a]);return $r(e,s,o,i,null)}function $r(e,r,n,o,i){var a={type:e,props:r,key:n,ref:o,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:i??++Au,__i:-1,__u:0};return i==null&&Q.vnode!=null&&Q.vnode(a),a}function fo(e){return e.children}function ao(e,r){this.props=e,this.context=r}function It(e,r){if(r==null)return e.__?It(e.__,e.__i+1):null;for(var n;r<e.__k.length;r++)if((n=e.__k[r])!=null&&n.__e!=null)return n.__e;return typeof e.type=="function"?It(e):null}function ux(e){if(e.__P&&e.__d){var r=e.__v,n=r.__e,o=[],i=[],a=Xe({},r);a.__v=r.__v+1,Q.vnode&&Q.vnode(a),Fi(e.__P,a,r,e.__n,e.__P.namespaceURI,32&r.__u?[n]:null,o,n??It(r),!!(32&r.__u),i),a.__v=r.__v,a.__.__k[a.__i]=a,Fu(o,a,i),r.__e=r.__=null,a.__e!=n&&Su(a)}}function Su(e){if((e=e.__)!=null&&e.__c!=null)return e.__e=e.__c.base=null,e.__k.some(function(r){if(r!=null&&r.__e!=null)return e.__e=e.__c.base=r.__e}),Su(e)}function wu(e){(!e.__d&&(e.__d=!0)&&mt.push(e)&&!uo.__r++||bu!=Q.debounceRendering)&&((bu=Q.debounceRendering)||Ru)(uo)}function uo(){try{for(var e,r=1;mt.length;)mt.length>r&&mt.sort(Eu),e=mt.shift(),r=mt.length,ux(e)}finally{mt.length=uo.__r=0}}function Mu(e,r,n,o,i,a,s,l,u,c,f){var h,d,p,m,v,x,g=o&&o.__k||lo,b=r.length;for(u=cx(n,r,g,u,b),h=0;h<b;h++)(p=n.__k[h])!=null&&(d=p.__i!=-1&&g[p.__i]||so,p.__i=h,x=Fi(e,p,d,i,a,s,l,u,c,f),m=p.__e,p.ref&&d.ref!=p.ref&&(d.ref&&Ii(d.ref,null,p),f.push(p.ref,p.__c||m,p)),v==null&&m!=null&&(v=m),4&p.__u?(u=Tu(p,u,e),d.__e&&(d.__e=null)):typeof p.type=="function"&&x!==void 0?u=x:m&&(u=m.nextSibling),p.__u&=-7);return n.__e=v,u}function cx(e,r,n,o,i){var a,s,l,u,c,f=n.length,h=f,d=0;for(e.__k=new Array(i),a=0;a<i;a++)(s=r[a])!=null&&typeof s!="boolean"&&typeof s!="function"?(typeof s=="string"||typeof s=="number"||typeof s=="bigint"||s.constructor==String?s=e.__k[a]=$r(null,s,null,null,null):co(s)?s=e.__k[a]=$r(fo,{children:s},null,null,null):s.constructor===void 0&&s.__b>0?s=e.__k[a]=$r(s.type,s.props,s.key,s.ref?s.ref:null,s.__v):e.__k[a]=s,u=a+d,s.__=e,s.__b=e.__b+1,l=null,(c=s.__i=fx(s,n,u,h))!=-1&&(h--,(l=n[c])&&(l.__u|=2)),l==null||l.__v==null?(c==-1&&(i>f?d--:i<f&&d++),typeof s.type!="function"&&(s.__u|=4)):c!=u&&(c==u-1?d--:c==u+1?d++:(c>u?d--:d++,s.__u|=4))):e.__k[a]=null;if(h)for(a=0;a<f;a++)(l=n[a])!=null&&(2&l.__u)==0&&(l.__e==o&&(o=It(l)),Lu(l,l));return o}function Tu(e,r,n){var o,i;if(typeof e.type=="function"){for(o=e.__k,i=0;o&&i<o.length;i++)o[i]&&(o[i].__=e,r=Tu(o[i],r,n));return r}e.__e!=r&&(r&&e.type&&!r.parentNode&&(r=It(e)),r=n.insertBefore(e.__e,r||null));do r=r&&r.nextSibling;while(r!=null&&r.nodeType==8);return r}function fx(e,r,n,o){var i,a,s,l=e.key,u=e.type,c=r[n],f=c!=null&&(2&c.__u)==0;if(c===null&&l==null||f&&l==c.key&&u==c.type)return n;if(o>(f?1:0)){for(i=n-1,a=n+1;i>=0||a<r.length;)if((c=r[s=i>=0?i--:a++])!=null&&(2&c.__u)==0&&l==c.key&&u==c.type)return s}return-1}function ku(e,r,n){r[0]=="-"?e.setProperty(r,n??""):e[r]=n==null?"":typeof n!="number"||sx.test(r)?n:n+"px"}function oo(e,r,n,o,i){var a,s;e:if(r=="style")if(typeof n=="string")e.style.cssText=n;else{if(typeof o=="string"&&(e.style.cssText=o=""),o)for(r in o)n&&r in n||ku(e.style,r,"");if(n)for(r in n)o&&n[r]==o[r]||ku(e.style,r,n[r])}else if(r[0]=="o"&&r[1]=="n")a=r!=(r=r.replace(Du,"$1")),s=r.toLowerCase(),r=s in e||r=="onFocusOut"||r=="onFocusIn"?s.slice(2):r.slice(2),e.l||(e.l={}),e.l[r+a]=n,n?o?n[jr]=o[jr]:(n[jr]=Ti,e.addEventListener(r,a?Si:Di,a)):e.removeEventListener(r,a?Si:Di,a);else{if(i=="http://www.w3.org/2000/svg")r=r.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if(r!="width"&&r!="height"&&r!="href"&&r!="list"&&r!="form"&&r!="tabIndex"&&r!="download"&&r!="rowSpan"&&r!="colSpan"&&r!="role"&&r!="popover"&&r in e)try{e[r]=n??"";break e}catch{}typeof n=="function"||(n==null||n===!1&&r[4]!="-"?e.removeAttribute(r):e.setAttribute(r,r=="popover"&&n==1?"":n))}}function Cu(e){return function(r){if(this.l){var n=this.l[r.type+e];if(r[io]==null)r[io]=Ti++;else if(r[io]<n[jr])return;return n(Q.event?Q.event(r):r)}}}function Fi(e,r,n,o,i,a,s,l,u,c){var f,h,d,p,m,v,x,g,b,k,y,_,w,C,R,S,N=r.type;if(r.constructor!==void 0)return null;128&n.__u&&(u=!!(32&n.__u),a=[l=r.__e=n.__e]),(f=Q.__b)&&f(r);e:if(typeof N=="function"){h=s.length;try{if(b=r.props,k=N.prototype&&N.prototype.render,y=(f=N.contextType)&&o[f.__c],_=f?y?y.props.value:f.__:o,n.__c?g=(d=r.__c=n.__c).__=d.__E:(k?r.__c=d=new N(b,_):(r.__c=d=new ao(b,_),d.constructor=N,d.render=dx),y&&y.sub(d),d.state||(d.state={}),d.__n=o,p=d.__d=!0,d.__h=[],d._sb=[]),k&&d.__s==null&&(d.__s=d.state),k&&N.getDerivedStateFromProps!=null&&(d.__s==d.state&&(d.__s=Xe({},d.__s)),Xe(d.__s,N.getDerivedStateFromProps(b,d.__s))),m=d.props,v=d.state,d.__v=r,p)k&&N.getDerivedStateFromProps==null&&d.componentWillMount!=null&&d.componentWillMount(),k&&d.componentDidMount!=null&&d.__h.push(d.componentDidMount);else{if(k&&N.getDerivedStateFromProps==null&&b!==m&&d.componentWillReceiveProps!=null&&d.componentWillReceiveProps(b,_),r.__v==n.__v||!d.__e&&d.shouldComponentUpdate!=null&&d.shouldComponentUpdate(b,d.__s,_)===!1){r.__v!=n.__v&&(d.props=b,d.state=d.__s,d.__d=!1),r.__e=n.__e,r.__k=n.__k,r.__k.some(function(T){T&&(T.__=r)}),lo.push.apply(d.__h,d._sb),d._sb=[],d.__h.length&&s.push(d),l=It(n);break e}d.componentWillUpdate!=null&&d.componentWillUpdate(b,d.__s,_),k&&d.componentDidUpdate!=null&&d.__h.push(function(){d.componentDidUpdate(m,v,x)})}if(d.context=_,d.props=b,d.__P=e,d.__e=!1,w=Q.__r,C=0,k)d.state=d.__s,d.__d=!1,w&&w(r),f=d.render(d.props,d.state,d.context),lo.push.apply(d.__h,d._sb),d._sb=[];else do d.__d=!1,w&&w(r),f=d.render(d.props,d.state,d.context),d.state=d.__s;while(d.__d&&++C<25);d.state=d.__s,d.getChildContext!=null&&(o=Xe(Xe({},o),d.getChildContext())),k&&!p&&d.getSnapshotBeforeUpdate!=null&&(x=d.getSnapshotBeforeUpdate(m,v)),R=f!=null&&f.type===fo&&f.key==null?Iu(f.props.children):f,l=Mu(e,co(R)?R:[R],r,n,o,i,a,s,l,u,c),d.base=r.__e,r.__u&=-161,d.__h.length&&s.push(d),g&&(d.__E=d.__=null)}catch(T){if(s.length=h,r.__v=null,u||a!=null){if(T.then){for(r.__u|=u?160:128;l&&l.nodeType==8&&l.nextSibling;)l=l.nextSibling;a!=null&&(a[a.indexOf(l)]=null),r.__e=l}else if(a!=null)for(S=a.length;S--;)Ni(a[S])}else r.__e=n.__e;r.__k==null&&(r.__k=n.__k||[]),T.then||Nu(r),Q.__e(T,r,n)}}else a==null&&r.__v==n.__v?(r.__k=n.__k,r.__e=n.__e):l=r.__e=hx(n.__e,r,n,o,i,a,s,u,c);return(f=Q.diffed)&&f(r),128&r.__u?void 0:l}function Nu(e){e&&(e.__c&&(e.__c.__e=!0),e.__k&&e.__k.some(Nu))}function Fu(e,r,n){for(var o=0;o<n.length;o++)Ii(n[o],n[++o],n[++o]);Q.__c&&Q.__c(r,e),e.some(function(i){try{e=i.__h,i.__h=[],e.some(function(a){a.call(i)})}catch(a){Q.__e(a,i.__v)}})}function Iu(e){return typeof e!="object"||e==null||e.__b>0?e:co(e)?e.map(Iu):e.constructor!==void 0?null:Xe({},e)}function hx(e,r,n,o,i,a,s,l,u){var c,f,h,d,p,m,v,x=n.props||so,g=r.props,b=r.type;if(b=="svg"?i="http://www.w3.org/2000/svg":b=="math"?i="http://www.w3.org/1998/Math/MathML":i||(i="http://www.w3.org/1999/xhtml"),a!=null){for(c=0;c<a.length;c++)if((p=a[c])&&"setAttribute"in p==!!b&&(b?p.localName==b:p.nodeType==3)){e=p,a[c]=null;break}}if(e==null){if(b==null)return document.createTextNode(g);e=document.createElementNS(i,b,g.is&&g),l&&(Q.__m&&Q.__m(r,a),l=!1),a=null}if(b==null)x===g||l&&e.data==g||(e.data=g);else{if(a=b=="textarea"&&g.defaultValue!=null?null:a&&Hr.call(e.childNodes),!l&&a!=null)for(x={},c=0;c<e.attributes.length;c++)x[(p=e.attributes[c]).name]=p.value;for(c in x)p=x[c],c=="dangerouslySetInnerHTML"?h=p:c=="children"||c in g||c=="value"&&"defaultValue"in g||c=="checked"&&"defaultChecked"in g||oo(e,c,null,p,i);for(c in g)p=g[c],c=="children"?d=p:c=="dangerouslySetInnerHTML"?f=p:c=="value"?m=p:c=="checked"?v=p:l&&typeof p!="function"||x[c]===p||oo(e,c,p,x[c],i);if(f)l||h&&(f.__html==h.__html||f.__html==e.innerHTML)||(e.innerHTML=f.__html),r.__k=[];else if(h&&(e.innerHTML=""),Mu(r.type=="template"?e.content:e,co(d)?d:[d],r,n,o,b=="foreignObject"?"http://www.w3.org/1999/xhtml":i,a,s,a?a[0]:n.__k&&It(n,0),l,u),a!=null)for(c=a.length;c--;)Ni(a[c]);l&&b!="textarea"||(c="value",b=="progress"&&m==null?e.removeAttribute("value"):m!=null&&(m!==e[c]||b=="progress"&&!m||b=="option"&&m!=x[c])&&oo(e,c,m,x[c],i),c="checked",v!=null&&v!=e[c]&&oo(e,c,v,x[c],i))}return e}function Ii(e,r,n){try{if(typeof e=="function"){var o=typeof e.__u=="function";o&&e.__u(),o&&r==null||(e.__u=e(r))}else e.current=r}catch(i){Q.__e(i,n)}}function Lu(e,r,n){var o,i;if(Q.unmount&&Q.unmount(e),(o=e.ref)&&(o.current&&o.current!=e.__e||Ii(o,null,r)),(o=e.__c)!=null){if(o.componentWillUnmount)try{o.componentWillUnmount()}catch(a){Q.__e(a,r)}o.base=o.__P=o.__n=null}if(o=e.__k)for(i=0;i<o.length;i++)o[i]&&Lu(o[i],r,n||typeof e.type!="function");n||Ni(e.__e),e.__c=e.__=e.__e=void 0}function dx(e,r,n){return this.constructor(e,n)}function zu(e,r,n){var o,i,a,s;r==document&&(r=document.documentElement),Q.__&&Q.__(e,r),i=(o=typeof n=="function")?null:n&&n.__k||r.__k,a=[],s=[],Fi(r,e=(!o&&n||r).__k=lx(fo,null,[e]),i||so,so,r.namespaceURI,!o&&n?[n]:i?null:r.firstChild?Hr.call(r.childNodes):null,a,!o&&n?n:i?i.__e:r.firstChild,o,s),Fu(a,e,s),e.props.children=null}function Li(e,r,n){var o,i,a,s,l=Xe({},e.props);for(a in e.type&&e.type.defaultProps&&(s=e.type.defaultProps),r)a=="key"?o=r[a]:a=="ref"?i=r[a]:l[a]=r[a]===void 0&&s!=null?s[a]:r[a];return arguments.length>2&&(l.children=arguments.length>3?Hr.call(arguments,2):n),$r(e.type,l,o||e.key,i||e.ref,null)}Hr=lo.slice,Q={__e:function(e,r,n,o){for(var i,a,s;r=r.__;)if((i=r.__c)&&!i.__)try{if((a=i.constructor)&&a.getDerivedStateFromError!=null&&(i.setState(a.getDerivedStateFromError(e)),s=i.__d),i.componentDidCatch!=null&&(i.componentDidCatch(e,o||{}),s=i.__d),s)return i.__E=i}catch(l){e=l}throw e}},Au=0,Mi=function(e){return e!=null&&e.constructor===void 0},ao.prototype.setState=function(e,r){var n;n=this.__s!=null&&this.__s!=this.state?this.__s:this.__s=Xe({},this.state),typeof e=="function"&&(e=e(Xe({},n),this.props)),e&&Xe(n,e),e!=null&&this.__v&&(r&&this._sb.push(r),wu(this))},ao.prototype.forceUpdate=function(e){this.__v&&(this.__e=!0,e&&this.__h.push(e),wu(this))},ao.prototype.render=fo,mt=[],Ru=typeof Promise=="function"?Promise.prototype.then.bind(Promise.resolve()):setTimeout,Eu=function(e,r){return e.__v.__b-r.__v.__b},uo.__r=0,Ei=Math.random().toString(8),io="__d"+Ei,jr="__a"+Ei,Du=/(PointerCapture)$|Capture$/i,Ti=0,Di=Cu(!1),Si=Cu(!0),ax=0;function Pu(e,r){(r==null||r>e.length)&&(r=e.length);for(var n=0,o=Array(r);n<r;n++)o[n]=e[n];return o}function px(e){if(Array.isArray(e))return e}function mx(e,r,n){return(r=bx(r))in e?Object.defineProperty(e,r,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[r]=n,e}function gx(e,r){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var o,i,a,s,l=[],u=!0,c=!1;try{if(a=(n=n.call(e)).next,r!==0)for(;!(u=(o=a.call(n)).done)&&(l.push(o.value),l.length!==r);u=!0);}catch(f){c=!0,i=f}finally{try{if(!u&&n.return!=null&&(s=n.return(),Object(s)!==s))return}finally{if(c)throw i}}return l}}function xx(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
4
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Ou(e,r){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);r&&(o=o.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,o)}return n}function vx(e){for(var r=1;r<arguments.length;r++){var n=arguments[r]!=null?arguments[r]:{};r%2?Ou(Object(n),!0).forEach(function(o){mx(e,o,n[o])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Ou(Object(n)).forEach(function(o){Object.defineProperty(e,o,Object.getOwnPropertyDescriptor(n,o))})}return e}function yx(e,r){return px(e)||gx(e,r)||wx(e,r)||xx()}function _x(e,r){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var o=n.call(e,r);if(typeof o!="object")return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return(r==="string"?String:Number)(e)}function bx(e){var r=_x(e,"string");return typeof r=="symbol"?r:r+""}function ho(e){"@babel/helpers - typeof";return ho=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(r){return typeof r}:function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},ho(e)}function wx(e,r){if(e){if(typeof e=="string")return Pu(e,r);var n={}.toString.call(e).slice(8,-1);return n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set"?Array.from(e):n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Pu(e,r):void 0}}var zi=function(r){if(ho(r)!=="object")return r;var n=Li(r);if(n.props){var o;n.props=vx({},n.props),n!=null&&(o=n.props)!==null&&o!==void 0&&o.children&&(n.props.children=Array.isArray(n.props.children)?n.props.children.map(zi):zi(n.props.children))}return n},kx=function(r){return Mi(Li(r))},Cx=function(r,n){delete n.__k,zu(zi(r),n)};function Ax(e,r){r===void 0&&(r={});var n=r.insertAt;if(!(typeof document>"u")){var o=document.head||document.getElementsByTagName("head")[0],i=document.createElement("style");i.type="text/css",n==="top"&&o.firstChild?o.insertBefore(i,o.firstChild):o.appendChild(i),i.styleSheet?i.styleSheet.cssText=e:i.appendChild(document.createTextNode(e))}}var Rx=`.float-tooltip-kap {
5
+ position: absolute;
6
+ width: max-content; /* prevent shrinking near right edge */
7
+ max-width: max(50%, 150px);
8
+ padding: 3px 5px;
9
+ border-radius: 3px;
10
+ font: 12px sans-serif;
11
+ color: #eee;
12
+ background: rgba(0,0,0,0.6);
13
+ pointer-events: none;
14
+ }
15
+ `;Ax(Rx);var Bu=Or({props:{content:{default:!1},offsetX:{triggerUpdate:!1},offsetY:{triggerUpdate:!1}},init:function(r,n){var o=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},i=o.style,a=i===void 0?{}:i,s=!!r&&ho(r)==="object"&&!!r.node&&typeof r.node=="function",l=se(s?r.node():r);l.style("position")==="static"&&l.style("position","relative"),n.tooltipEl=l.append("div").attr("class","float-tooltip-kap"),Object.entries(a).forEach(function(c){var f=yx(c,2),h=f[0],d=f[1];return n.tooltipEl.style(h,d)}),n.tooltipEl.style("left","-10000px").style("display","none");var u="tooltip-".concat(Math.round(Math.random()*1e12));n.mouseInside=!1,l.on("mousemove.".concat(u),function(c){n.mouseInside=!0;var f=ve(c),h=l.node(),d=h.offsetWidth,p=h.offsetHeight,m=[n.offsetX===null||n.offsetX===void 0?"-".concat(f[0]/d*100,"%"):typeof n.offsetX=="number"?"calc(-50% + ".concat(n.offsetX,"px)"):n.offsetX,n.offsetY===null||n.offsetY===void 0?p>130&&p-f[1]<100?"calc(-100% - 6px)":"21px":typeof n.offsetY=="number"?n.offsetY<0?"calc(-100% - ".concat(Math.abs(n.offsetY),"px)"):"".concat(n.offsetY,"px"):n.offsetY];n.tooltipEl.style("left",f[0]+"px").style("top",f[1]+"px").style("transform","translate(".concat(m.join(","),")")),n.content&&n.tooltipEl.style("display","inline")}),l.on("mouseover.".concat(u),function(){n.mouseInside=!0,n.content&&n.tooltipEl.style("display","inline")}),l.on("mouseout.".concat(u),function(){n.mouseInside=!1,n.tooltipEl.style("display","none")})},update:function(r){r.tooltipEl.style("display",r.content&&r.mouseInside?"inline":"none"),r.content?r.content instanceof HTMLElement?(r.tooltipEl.text(""),r.tooltipEl.append(function(){return r.content})):typeof r.content=="string"?r.tooltipEl.html(r.content):kx(r.content)?(r.tooltipEl.text(""),Cx(r.content,r.tooltipEl.node())):(r.tooltipEl.style("display","none"),console.warn("Tooltip content is invalid, skipping.",r.content,r.content.toString())):r.tooltipEl.text("")}});function Pi(e,r,n){var o,i=1;e==null&&(e=0),r==null&&(r=0),n==null&&(n=0);function a(){var s,l=o.length,u,c=0,f=0,h=0;for(s=0;s<l;++s)u=o[s],c+=u.x||0,f+=u.y||0,h+=u.z||0;for(c=(c/l-e)*i,f=(f/l-r)*i,h=(h/l-n)*i,s=0;s<l;++s)u=o[s],c&&(u.x-=c),f&&(u.y-=f),h&&(u.z-=h)}return a.initialize=function(s){o=s},a.x=function(s){return arguments.length?(e=+s,a):e},a.y=function(s){return arguments.length?(r=+s,a):r},a.z=function(s){return arguments.length?(n=+s,a):n},a.strength=function(s){return arguments.length?(i=+s,a):i},a}function ju(e){let r=+this._x.call(null,e);return $u(this.cover(r),r,e)}function $u(e,r,n){if(isNaN(r))return e;var o,i=e._root,a={data:n},s=e._x0,l=e._x1,u,c,f,h,d;if(!i)return e._root=a,e;for(;i.length;)if((f=r>=(u=(s+l)/2))?s=u:l=u,o=i,!(i=i[h=+f]))return o[h]=a,e;if(c=+e._x.call(null,i.data),r===c)return a.next=i,o?o[h]=a:e._root=a,e;do o=o?o[h]=new Array(2):e._root=new Array(2),(f=r>=(u=(s+l)/2))?s=u:l=u;while((h=+f)==(d=+(c>=u)));return o[d]=i,o[h]=a,e}function Hu(e){Array.isArray(e)||(e=Array.from(e));let r=e.length,n=new Float64Array(r),o=1/0,i=-1/0;for(let a=0,s;a<r;++a)isNaN(s=+this._x.call(null,e[a]))||(n[a]=s,s<o&&(o=s),s>i&&(i=s));if(o>i)return this;this.cover(o).cover(i);for(let a=0;a<r;++a)$u(this,n[a],e[a]);return this}function Uu(e){if(isNaN(e=+e))return this;var r=this._x0,n=this._x1;if(isNaN(r))n=(r=Math.floor(e))+1;else{for(var o=n-r||1,i=this._root,a,s;r>e||e>=n;)switch(s=+(e<r),a=new Array(2),a[s]=i,i=a,o*=2,s){case 0:n=r+o;break;case 1:r=n-o;break}this._root&&this._root.length&&(this._root=i)}return this._x0=r,this._x1=n,this}function Gu(){var e=[];return this.visit(function(r){if(!r.length)do e.push(r.data);while(r=r.next)}),e}function qu(e){return arguments.length?this.cover(+e[0][0]).cover(+e[1][0]):isNaN(this._x0)?void 0:[[this._x0],[this._x1]]}function Me(e,r,n){this.node=e,this.x0=r,this.x1=n}function Wu(e,r){var n,o=this._x0,i,a,s=this._x1,l=[],u=this._root,c,f;for(u&&l.push(new Me(u,o,s)),r==null?r=1/0:(o=e-r,s=e+r);c=l.pop();)if(!(!(u=c.node)||(i=c.x0)>s||(a=c.x1)<o))if(u.length){var h=(i+a)/2;l.push(new Me(u[1],h,a),new Me(u[0],i,h)),(f=+(e>=h))&&(c=l[l.length-1],l[l.length-1]=l[l.length-1-f],l[l.length-1-f]=c)}else{var d=Math.abs(e-+this._x.call(null,u.data));d<r&&(r=d,o=e-d,s=e+d,n=u.data)}return n}function Ju(e){if(isNaN(u=+this._x.call(null,e)))return this;var r,n=this._root,o,i,a,s=this._x0,l=this._x1,u,c,f,h,d;if(!n)return this;if(n.length)for(;;){if((f=u>=(c=(s+l)/2))?s=c:l=c,r=n,!(n=n[h=+f]))return this;if(!n.length)break;r[h+1&1]&&(o=r,d=h)}for(;n.data!==e;)if(i=n,!(n=n.next))return this;return(a=n.next)&&delete n.next,i?(a?i.next=a:delete i.next,this):r?(a?r[h]=a:delete r[h],(n=r[0]||r[1])&&n===(r[1]||r[0])&&!n.length&&(o?o[d]=n:this._root=n),this):(this._root=a,this)}function Xu(e){for(var r=0,n=e.length;r<n;++r)this.remove(e[r]);return this}function Vu(){return this._root}function Yu(){var e=0;return this.visit(function(r){if(!r.length)do++e;while(r=r.next)}),e}function Zu(e){var r=[],n,o=this._root,i,a,s;for(o&&r.push(new Me(o,this._x0,this._x1));n=r.pop();)if(!e(o=n.node,a=n.x0,s=n.x1)&&o.length){var l=(a+s)/2;(i=o[1])&&r.push(new Me(i,l,s)),(i=o[0])&&r.push(new Me(i,a,l))}return this}function Ku(e){var r=[],n=[],o;for(this._root&&r.push(new Me(this._root,this._x0,this._x1));o=r.pop();){var i=o.node;if(i.length){var a,s=o.x0,l=o.x1,u=(s+l)/2;(a=i[0])&&r.push(new Me(a,s,u)),(a=i[1])&&r.push(new Me(a,u,l))}n.push(o)}for(;o=n.pop();)e(o.node,o.x0,o.x1);return this}function Qu(e){return e[0]}function ec(e){return arguments.length?(this._x=e,this):this._x}function Ur(e,r){var n=new Oi(r??Qu,NaN,NaN);return e==null?n:n.addAll(e)}function Oi(e,r,n){this._x=e,this._x0=r,this._x1=n,this._root=void 0}function tc(e){for(var r={data:e.data},n=r;e=e.next;)n=n.next={data:e.data};return r}var _e=Ur.prototype=Oi.prototype;_e.copy=function(){var e=new Oi(this._x,this._x0,this._x1),r=this._root,n,o;if(!r)return e;if(!r.length)return e._root=tc(r),e;for(n=[{source:r,target:e._root=new Array(2)}];r=n.pop();)for(var i=0;i<2;++i)(o=r.source[i])&&(o.length?n.push({source:o,target:r.target[i]=new Array(2)}):r.target[i]=tc(o));return e};_e.add=ju;_e.addAll=Hu;_e.cover=Uu;_e.data=Gu;_e.extent=qu;_e.find=Wu;_e.remove=Ju;_e.removeAll=Xu;_e.root=Vu;_e.size=Yu;_e.visit=Zu;_e.visitAfter=Ku;_e.x=ec;function rc(e){let r=+this._x.call(null,e),n=+this._y.call(null,e);return nc(this.cover(r,n),r,n,e)}function nc(e,r,n,o){if(isNaN(r)||isNaN(n))return e;var i,a=e._root,s={data:o},l=e._x0,u=e._y0,c=e._x1,f=e._y1,h,d,p,m,v,x,g,b;if(!a)return e._root=s,e;for(;a.length;)if((v=r>=(h=(l+c)/2))?l=h:c=h,(x=n>=(d=(u+f)/2))?u=d:f=d,i=a,!(a=a[g=x<<1|v]))return i[g]=s,e;if(p=+e._x.call(null,a.data),m=+e._y.call(null,a.data),r===p&&n===m)return s.next=a,i?i[g]=s:e._root=s,e;do i=i?i[g]=new Array(4):e._root=new Array(4),(v=r>=(h=(l+c)/2))?l=h:c=h,(x=n>=(d=(u+f)/2))?u=d:f=d;while((g=x<<1|v)===(b=(m>=d)<<1|p>=h));return i[b]=a,i[g]=s,e}function oc(e){var r,n,o=e.length,i,a,s=new Array(o),l=new Array(o),u=1/0,c=1/0,f=-1/0,h=-1/0;for(n=0;n<o;++n)isNaN(i=+this._x.call(null,r=e[n]))||isNaN(a=+this._y.call(null,r))||(s[n]=i,l[n]=a,i<u&&(u=i),i>f&&(f=i),a<c&&(c=a),a>h&&(h=a));if(u>f||c>h)return this;for(this.cover(u,c).cover(f,h),n=0;n<o;++n)nc(this,s[n],l[n],e[n]);return this}function ic(e,r){if(isNaN(e=+e)||isNaN(r=+r))return this;var n=this._x0,o=this._y0,i=this._x1,a=this._y1;if(isNaN(n))i=(n=Math.floor(e))+1,a=(o=Math.floor(r))+1;else{for(var s=i-n||1,l=this._root,u,c;n>e||e>=i||o>r||r>=a;)switch(c=(r<o)<<1|e<n,u=new Array(4),u[c]=l,l=u,s*=2,c){case 0:i=n+s,a=o+s;break;case 1:n=i-s,a=o+s;break;case 2:i=n+s,o=a-s;break;case 3:n=i-s,o=a-s;break}this._root&&this._root.length&&(this._root=l)}return this._x0=n,this._y0=o,this._x1=i,this._y1=a,this}function ac(){var e=[];return this.visit(function(r){if(!r.length)do e.push(r.data);while(r=r.next)}),e}function sc(e){return arguments.length?this.cover(+e[0][0],+e[0][1]).cover(+e[1][0],+e[1][1]):isNaN(this._x0)?void 0:[[this._x0,this._y0],[this._x1,this._y1]]}function le(e,r,n,o,i){this.node=e,this.x0=r,this.y0=n,this.x1=o,this.y1=i}function lc(e,r,n){var o,i=this._x0,a=this._y0,s,l,u,c,f=this._x1,h=this._y1,d=[],p=this._root,m,v;for(p&&d.push(new le(p,i,a,f,h)),n==null?n=1/0:(i=e-n,a=r-n,f=e+n,h=r+n,n*=n);m=d.pop();)if(!(!(p=m.node)||(s=m.x0)>f||(l=m.y0)>h||(u=m.x1)<i||(c=m.y1)<a))if(p.length){var x=(s+u)/2,g=(l+c)/2;d.push(new le(p[3],x,g,u,c),new le(p[2],s,g,x,c),new le(p[1],x,l,u,g),new le(p[0],s,l,x,g)),(v=(r>=g)<<1|e>=x)&&(m=d[d.length-1],d[d.length-1]=d[d.length-1-v],d[d.length-1-v]=m)}else{var b=e-+this._x.call(null,p.data),k=r-+this._y.call(null,p.data),y=b*b+k*k;if(y<n){var _=Math.sqrt(n=y);i=e-_,a=r-_,f=e+_,h=r+_,o=p.data}}return o}function uc(e){if(isNaN(f=+this._x.call(null,e))||isNaN(h=+this._y.call(null,e)))return this;var r,n=this._root,o,i,a,s=this._x0,l=this._y0,u=this._x1,c=this._y1,f,h,d,p,m,v,x,g;if(!n)return this;if(n.length)for(;;){if((m=f>=(d=(s+u)/2))?s=d:u=d,(v=h>=(p=(l+c)/2))?l=p:c=p,r=n,!(n=n[x=v<<1|m]))return this;if(!n.length)break;(r[x+1&3]||r[x+2&3]||r[x+3&3])&&(o=r,g=x)}for(;n.data!==e;)if(i=n,!(n=n.next))return this;return(a=n.next)&&delete n.next,i?(a?i.next=a:delete i.next,this):r?(a?r[x]=a:delete r[x],(n=r[0]||r[1]||r[2]||r[3])&&n===(r[3]||r[2]||r[1]||r[0])&&!n.length&&(o?o[g]=n:this._root=n),this):(this._root=a,this)}function cc(e){for(var r=0,n=e.length;r<n;++r)this.remove(e[r]);return this}function fc(){return this._root}function hc(){var e=0;return this.visit(function(r){if(!r.length)do++e;while(r=r.next)}),e}function dc(e){var r=[],n,o=this._root,i,a,s,l,u;for(o&&r.push(new le(o,this._x0,this._y0,this._x1,this._y1));n=r.pop();)if(!e(o=n.node,a=n.x0,s=n.y0,l=n.x1,u=n.y1)&&o.length){var c=(a+l)/2,f=(s+u)/2;(i=o[3])&&r.push(new le(i,c,f,l,u)),(i=o[2])&&r.push(new le(i,a,f,c,u)),(i=o[1])&&r.push(new le(i,c,s,l,f)),(i=o[0])&&r.push(new le(i,a,s,c,f))}return this}function pc(e){var r=[],n=[],o;for(this._root&&r.push(new le(this._root,this._x0,this._y0,this._x1,this._y1));o=r.pop();){var i=o.node;if(i.length){var a,s=o.x0,l=o.y0,u=o.x1,c=o.y1,f=(s+u)/2,h=(l+c)/2;(a=i[0])&&r.push(new le(a,s,l,f,h)),(a=i[1])&&r.push(new le(a,f,l,u,h)),(a=i[2])&&r.push(new le(a,s,h,f,c)),(a=i[3])&&r.push(new le(a,f,h,u,c))}n.push(o)}for(;o=n.pop();)e(o.node,o.x0,o.y0,o.x1,o.y1);return this}function mc(e){return e[0]}function gc(e){return arguments.length?(this._x=e,this):this._x}function xc(e){return e[1]}function vc(e){return arguments.length?(this._y=e,this):this._y}function Gr(e,r,n){var o=new Bi(r??mc,n??xc,NaN,NaN,NaN,NaN);return e==null?o:o.addAll(e)}function Bi(e,r,n,o,i,a){this._x=e,this._y=r,this._x0=n,this._y0=o,this._x1=i,this._y1=a,this._root=void 0}function yc(e){for(var r={data:e.data},n=r;e=e.next;)n=n.next={data:e.data};return r}var ge=Gr.prototype=Bi.prototype;ge.copy=function(){var e=new Bi(this._x,this._y,this._x0,this._y0,this._x1,this._y1),r=this._root,n,o;if(!r)return e;if(!r.length)return e._root=yc(r),e;for(n=[{source:r,target:e._root=new Array(4)}];r=n.pop();)for(var i=0;i<4;++i)(o=r.source[i])&&(o.length?n.push({source:o,target:r.target[i]=new Array(4)}):r.target[i]=yc(o));return e};ge.add=rc;ge.addAll=oc;ge.cover=ic;ge.data=ac;ge.extent=sc;ge.find=lc;ge.remove=uc;ge.removeAll=cc;ge.root=fc;ge.size=hc;ge.visit=dc;ge.visitAfter=pc;ge.x=gc;ge.y=vc;function _c(e){let r=+this._x.call(null,e),n=+this._y.call(null,e),o=+this._z.call(null,e);return bc(this.cover(r,n,o),r,n,o,e)}function bc(e,r,n,o,i){if(isNaN(r)||isNaN(n)||isNaN(o))return e;var a,s=e._root,l={data:i},u=e._x0,c=e._y0,f=e._z0,h=e._x1,d=e._y1,p=e._z1,m,v,x,g,b,k,y,_,w,C,R;if(!s)return e._root=l,e;for(;s.length;)if((y=r>=(m=(u+h)/2))?u=m:h=m,(_=n>=(v=(c+d)/2))?c=v:d=v,(w=o>=(x=(f+p)/2))?f=x:p=x,a=s,!(s=s[C=w<<2|_<<1|y]))return a[C]=l,e;if(g=+e._x.call(null,s.data),b=+e._y.call(null,s.data),k=+e._z.call(null,s.data),r===g&&n===b&&o===k)return l.next=s,a?a[C]=l:e._root=l,e;do a=a?a[C]=new Array(8):e._root=new Array(8),(y=r>=(m=(u+h)/2))?u=m:h=m,(_=n>=(v=(c+d)/2))?c=v:d=v,(w=o>=(x=(f+p)/2))?f=x:p=x;while((C=w<<2|_<<1|y)===(R=(k>=x)<<2|(b>=v)<<1|g>=m));return a[R]=s,a[C]=l,e}function wc(e){Array.isArray(e)||(e=Array.from(e));let r=e.length,n=new Float64Array(r),o=new Float64Array(r),i=new Float64Array(r),a=1/0,s=1/0,l=1/0,u=-1/0,c=-1/0,f=-1/0;for(let h=0,d,p,m,v;h<r;++h)isNaN(p=+this._x.call(null,d=e[h]))||isNaN(m=+this._y.call(null,d))||isNaN(v=+this._z.call(null,d))||(n[h]=p,o[h]=m,i[h]=v,p<a&&(a=p),p>u&&(u=p),m<s&&(s=m),m>c&&(c=m),v<l&&(l=v),v>f&&(f=v));if(a>u||s>c||l>f)return this;this.cover(a,s,l).cover(u,c,f);for(let h=0;h<r;++h)bc(this,n[h],o[h],i[h],e[h]);return this}function kc(e,r,n){if(isNaN(e=+e)||isNaN(r=+r)||isNaN(n=+n))return this;var o=this._x0,i=this._y0,a=this._z0,s=this._x1,l=this._y1,u=this._z1;if(isNaN(o))s=(o=Math.floor(e))+1,l=(i=Math.floor(r))+1,u=(a=Math.floor(n))+1;else{for(var c=s-o||1,f=this._root,h,d;o>e||e>=s||i>r||r>=l||a>n||n>=u;)switch(d=(n<a)<<2|(r<i)<<1|e<o,h=new Array(8),h[d]=f,f=h,c*=2,d){case 0:s=o+c,l=i+c,u=a+c;break;case 1:o=s-c,l=i+c,u=a+c;break;case 2:s=o+c,i=l-c,u=a+c;break;case 3:o=s-c,i=l-c,u=a+c;break;case 4:s=o+c,l=i+c,a=u-c;break;case 5:o=s-c,l=i+c,a=u-c;break;case 6:s=o+c,i=l-c,a=u-c;break;case 7:o=s-c,i=l-c,a=u-c;break}this._root&&this._root.length&&(this._root=f)}return this._x0=o,this._y0=i,this._z0=a,this._x1=s,this._y1=l,this._z1=u,this}function Cc(){var e=[];return this.visit(function(r){if(!r.length)do e.push(r.data);while(r=r.next)}),e}function Ac(e){return arguments.length?this.cover(+e[0][0],+e[0][1],+e[0][2]).cover(+e[1][0],+e[1][1],+e[1][2]):isNaN(this._x0)?void 0:[[this._x0,this._y0,this._z0],[this._x1,this._y1,this._z1]]}function J(e,r,n,o,i,a,s){this.node=e,this.x0=r,this.y0=n,this.z0=o,this.x1=i,this.y1=a,this.z1=s}function Rc(e,r,n,o){var i,a=this._x0,s=this._y0,l=this._z0,u,c,f,h,d,p,m=this._x1,v=this._y1,x=this._z1,g=[],b=this._root,k,y;for(b&&g.push(new J(b,a,s,l,m,v,x)),o==null?o=1/0:(a=e-o,s=r-o,l=n-o,m=e+o,v=r+o,x=n+o,o*=o);k=g.pop();)if(!(!(b=k.node)||(u=k.x0)>m||(c=k.y0)>v||(f=k.z0)>x||(h=k.x1)<a||(d=k.y1)<s||(p=k.z1)<l))if(b.length){var _=(u+h)/2,w=(c+d)/2,C=(f+p)/2;g.push(new J(b[7],_,w,C,h,d,p),new J(b[6],u,w,C,_,d,p),new J(b[5],_,c,C,h,w,p),new J(b[4],u,c,C,_,w,p),new J(b[3],_,w,f,h,d,C),new J(b[2],u,w,f,_,d,C),new J(b[1],_,c,f,h,w,C),new J(b[0],u,c,f,_,w,C)),(y=(n>=C)<<2|(r>=w)<<1|e>=_)&&(k=g[g.length-1],g[g.length-1]=g[g.length-1-y],g[g.length-1-y]=k)}else{var R=e-+this._x.call(null,b.data),S=r-+this._y.call(null,b.data),N=n-+this._z.call(null,b.data),T=R*R+S*S+N*N;if(T<o){var L=Math.sqrt(o=T);a=e-L,s=r-L,l=n-L,m=e+L,v=r+L,x=n+L,i=b.data}}return i}var Ex=(e,r,n,o,i,a)=>Math.sqrt((e-o)**2+(r-i)**2+(n-a)**2);function Ec(e,r,n,o){let i=[],a=e-o,s=r-o,l=n-o,u=e+o,c=r+o,f=n+o;return this.visit((h,d,p,m,v,x,g)=>{if(!h.length)do{let b=h.data;Ex(e,r,n,this._x(b),this._y(b),this._z(b))<=o&&i.push(b)}while(h=h.next);return d>u||p>c||m>f||v<a||x<s||g<l}),i}function Dc(e){if(isNaN(d=+this._x.call(null,e))||isNaN(p=+this._y.call(null,e))||isNaN(m=+this._z.call(null,e)))return this;var r,n=this._root,o,i,a,s=this._x0,l=this._y0,u=this._z0,c=this._x1,f=this._y1,h=this._z1,d,p,m,v,x,g,b,k,y,_,w;if(!n)return this;if(n.length)for(;;){if((b=d>=(v=(s+c)/2))?s=v:c=v,(k=p>=(x=(l+f)/2))?l=x:f=x,(y=m>=(g=(u+h)/2))?u=g:h=g,r=n,!(n=n[_=y<<2|k<<1|b]))return this;if(!n.length)break;(r[_+1&7]||r[_+2&7]||r[_+3&7]||r[_+4&7]||r[_+5&7]||r[_+6&7]||r[_+7&7])&&(o=r,w=_)}for(;n.data!==e;)if(i=n,!(n=n.next))return this;return(a=n.next)&&delete n.next,i?(a?i.next=a:delete i.next,this):r?(a?r[_]=a:delete r[_],(n=r[0]||r[1]||r[2]||r[3]||r[4]||r[5]||r[6]||r[7])&&n===(r[7]||r[6]||r[5]||r[4]||r[3]||r[2]||r[1]||r[0])&&!n.length&&(o?o[w]=n:this._root=n),this):(this._root=a,this)}function Sc(e){for(var r=0,n=e.length;r<n;++r)this.remove(e[r]);return this}function Mc(){return this._root}function Tc(){var e=0;return this.visit(function(r){if(!r.length)do++e;while(r=r.next)}),e}function Nc(e){var r=[],n,o=this._root,i,a,s,l,u,c,f;for(o&&r.push(new J(o,this._x0,this._y0,this._z0,this._x1,this._y1,this._z1));n=r.pop();)if(!e(o=n.node,a=n.x0,s=n.y0,l=n.z0,u=n.x1,c=n.y1,f=n.z1)&&o.length){var h=(a+u)/2,d=(s+c)/2,p=(l+f)/2;(i=o[7])&&r.push(new J(i,h,d,p,u,c,f)),(i=o[6])&&r.push(new J(i,a,d,p,h,c,f)),(i=o[5])&&r.push(new J(i,h,s,p,u,d,f)),(i=o[4])&&r.push(new J(i,a,s,p,h,d,f)),(i=o[3])&&r.push(new J(i,h,d,l,u,c,p)),(i=o[2])&&r.push(new J(i,a,d,l,h,c,p)),(i=o[1])&&r.push(new J(i,h,s,l,u,d,p)),(i=o[0])&&r.push(new J(i,a,s,l,h,d,p))}return this}function Fc(e){var r=[],n=[],o;for(this._root&&r.push(new J(this._root,this._x0,this._y0,this._z0,this._x1,this._y1,this._z1));o=r.pop();){var i=o.node;if(i.length){var a,s=o.x0,l=o.y0,u=o.z0,c=o.x1,f=o.y1,h=o.z1,d=(s+c)/2,p=(l+f)/2,m=(u+h)/2;(a=i[0])&&r.push(new J(a,s,l,u,d,p,m)),(a=i[1])&&r.push(new J(a,d,l,u,c,p,m)),(a=i[2])&&r.push(new J(a,s,p,u,d,f,m)),(a=i[3])&&r.push(new J(a,d,p,u,c,f,m)),(a=i[4])&&r.push(new J(a,s,l,m,d,p,h)),(a=i[5])&&r.push(new J(a,d,l,m,c,p,h)),(a=i[6])&&r.push(new J(a,s,p,m,d,f,h)),(a=i[7])&&r.push(new J(a,d,p,m,c,f,h))}n.push(o)}for(;o=n.pop();)e(o.node,o.x0,o.y0,o.z0,o.x1,o.y1,o.z1);return this}function Ic(e){return e[0]}function Lc(e){return arguments.length?(this._x=e,this):this._x}function zc(e){return e[1]}function Pc(e){return arguments.length?(this._y=e,this):this._y}function Oc(e){return e[2]}function Bc(e){return arguments.length?(this._z=e,this):this._z}function qr(e,r,n,o){var i=new ji(r??Ic,n??zc,o??Oc,NaN,NaN,NaN,NaN,NaN,NaN);return e==null?i:i.addAll(e)}function ji(e,r,n,o,i,a,s,l,u){this._x=e,this._y=r,this._z=n,this._x0=o,this._y0=i,this._z0=a,this._x1=s,this._y1=l,this._z1=u,this._root=void 0}function jc(e){for(var r={data:e.data},n=r;e=e.next;)n=n.next={data:e.data};return r}var he=qr.prototype=ji.prototype;he.copy=function(){var e=new ji(this._x,this._y,this._z,this._x0,this._y0,this._z0,this._x1,this._y1,this._z1),r=this._root,n,o;if(!r)return e;if(!r.length)return e._root=jc(r),e;for(n=[{source:r,target:e._root=new Array(8)}];r=n.pop();)for(var i=0;i<8;++i)(o=r.source[i])&&(o.length?n.push({source:o,target:r.target[i]=new Array(8)}):r.target[i]=jc(o));return e};he.add=_c;he.addAll=wc;he.cover=kc;he.data=Cc;he.extent=Ac;he.find=Rc;he.findAllWithinRadius=Ec;he.remove=Dc;he.removeAll=Sc;he.root=Mc;he.size=Tc;he.visit=Nc;he.visitAfter=Fc;he.x=Lc;he.y=Pc;he.z=Bc;function Te(e){return function(){return e}}function Ue(e){return(e()-.5)*1e-6}function Dx(e){return e.index}function $c(e,r){var n=e.get(r);if(!n)throw new Error("node not found: "+r);return n}function $i(e){var r=Dx,n=d,o,i=Te(30),a,s,l,u,c,f,h=1;e==null&&(e=[]);function d(g){return 1/Math.min(u[g.source.index],u[g.target.index])}function p(g){for(var b=0,k=e.length;b<h;++b)for(var y=0,_,w,C,R=0,S=0,N=0,T,L;y<k;++y)_=e[y],w=_.source,C=_.target,R=C.x+C.vx-w.x-w.vx||Ue(f),l>1&&(S=C.y+C.vy-w.y-w.vy||Ue(f)),l>2&&(N=C.z+C.vz-w.z-w.vz||Ue(f)),T=Math.sqrt(R*R+S*S+N*N),T=(T-a[y])/T*g*o[y],R*=T,S*=T,N*=T,C.vx-=R*(L=c[y]),l>1&&(C.vy-=S*L),l>2&&(C.vz-=N*L),w.vx+=R*(L=1-L),l>1&&(w.vy+=S*L),l>2&&(w.vz+=N*L)}function m(){if(s){var g,b=s.length,k=e.length,y=new Map(s.map((w,C)=>[r(w,C,s),w])),_;for(g=0,u=new Array(b);g<k;++g)_=e[g],_.index=g,typeof _.source!="object"&&(_.source=$c(y,_.source)),typeof _.target!="object"&&(_.target=$c(y,_.target)),u[_.source.index]=(u[_.source.index]||0)+1,u[_.target.index]=(u[_.target.index]||0)+1;for(g=0,c=new Array(k);g<k;++g)_=e[g],c[g]=u[_.source.index]/(u[_.source.index]+u[_.target.index]);o=new Array(k),v(),a=new Array(k),x()}}function v(){if(s)for(var g=0,b=e.length;g<b;++g)o[g]=+n(e[g],g,e)}function x(){if(s)for(var g=0,b=e.length;g<b;++g)a[g]=+i(e[g],g,e)}return p.initialize=function(g,...b){s=g,f=b.find(k=>typeof k=="function")||Math.random,l=b.find(k=>[1,2,3].includes(k))||2,m()},p.links=function(g){return arguments.length?(e=g,m(),p):e},p.id=function(g){return arguments.length?(r=g,p):r},p.iterations=function(g){return arguments.length?(h=+g,p):h},p.strength=function(g){return arguments.length?(n=typeof g=="function"?g:Te(+g),v(),p):n},p.distance=function(g){return arguments.length?(i=typeof g=="function"?g:Te(+g),x(),p):i},p}function Hc(){let e=1;return()=>(e=(1664525*e+1013904223)%4294967296)/4294967296}var Uc=3;function po(e){return e.x}function Hi(e){return e.y}function Gc(e){return e.z}var Sx=10,Mx=Math.PI*(3-Math.sqrt(5)),Tx=Math.PI*20/(9+Math.sqrt(221));function Ui(e,r){r=r||2;var n=Math.min(Uc,Math.max(1,Math.round(r))),o,i=1,a=.001,s=1-Math.pow(a,1/300),l=0,u=.6,c=new Map,f=qt(p),h=ot("tick","end"),d=Hc();e==null&&(e=[]);function p(){m(),h.call("tick",o),i<a&&(f.stop(),h.call("end",o))}function m(g){var b,k=e.length,y;g===void 0&&(g=1);for(var _=0;_<g;++_)for(i+=(l-i)*s,c.forEach(function(w){w(i)}),b=0;b<k;++b)y=e[b],y.fx==null?y.x+=y.vx*=u:(y.x=y.fx,y.vx=0),n>1&&(y.fy==null?y.y+=y.vy*=u:(y.y=y.fy,y.vy=0)),n>2&&(y.fz==null?y.z+=y.vz*=u:(y.z=y.fz,y.vz=0));return o}function v(){for(var g=0,b=e.length,k;g<b;++g){if(k=e[g],k.index=g,k.fx!=null&&(k.x=k.fx),k.fy!=null&&(k.y=k.fy),k.fz!=null&&(k.z=k.fz),isNaN(k.x)||n>1&&isNaN(k.y)||n>2&&isNaN(k.z)){var y=Sx*(n>2?Math.cbrt(.5+g):n>1?Math.sqrt(.5+g):g),_=g*Mx,w=g*Tx;n===1?k.x=y:n===2?(k.x=y*Math.cos(_),k.y=y*Math.sin(_)):(k.x=y*Math.sin(_)*Math.cos(w),k.y=y*Math.cos(_),k.z=y*Math.sin(_)*Math.sin(w))}(isNaN(k.vx)||n>1&&isNaN(k.vy)||n>2&&isNaN(k.vz))&&(k.vx=0,n>1&&(k.vy=0),n>2&&(k.vz=0))}}function x(g){return g.initialize&&g.initialize(e,d,n),g}return v(),o={tick:m,restart:function(){return f.restart(p),o},stop:function(){return f.stop(),o},numDimensions:function(g){return arguments.length?(n=Math.min(Uc,Math.max(1,Math.round(g))),c.forEach(x),o):n},nodes:function(g){return arguments.length?(e=g,v(),c.forEach(x),o):e},alpha:function(g){return arguments.length?(i=+g,o):i},alphaMin:function(g){return arguments.length?(a=+g,o):a},alphaDecay:function(g){return arguments.length?(s=+g,o):+s},alphaTarget:function(g){return arguments.length?(l=+g,o):l},velocityDecay:function(g){return arguments.length?(u=1-g,o):1-u},randomSource:function(g){return arguments.length?(d=g,c.forEach(x),o):d},force:function(g,b){return arguments.length>1?(b==null?c.delete(g):c.set(g,x(b)),o):c.get(g)},find:function(){var g=Array.prototype.slice.call(arguments),b=g.shift()||0,k=(n>1?g.shift():null)||0,y=(n>2?g.shift():null)||0,_=g.shift()||1/0,w=0,C=e.length,R,S,N,T,L,B;for(_*=_,w=0;w<C;++w)L=e[w],R=b-L.x,S=k-(L.y||0),N=y-(L.z||0),T=R*R+S*S+N*N,T<_&&(B=L,_=T);return B},on:function(g,b){return arguments.length>1?(h.on(g,b),o):h.on(g)}}}function Gi(){var e,r,n,o,i,a=Te(-30),s,l=1,u=1/0,c=.81;function f(m){var v,x=e.length,g=(r===1?Ur(e,po):r===2?Gr(e,po,Hi):r===3?qr(e,po,Hi,Gc):null).visitAfter(d);for(i=m,v=0;v<x;++v)n=e[v],g.visit(p)}function h(){if(e){var m,v=e.length,x;for(s=new Array(v),m=0;m<v;++m)x=e[m],s[x.index]=+a(x,m,e)}}function d(m){var v=0,x,g,b=0,k,y,_,w,C=m.length;if(C){for(k=y=_=w=0;w<C;++w)(x=m[w])&&(g=Math.abs(x.value))&&(v+=x.value,b+=g,k+=g*(x.x||0),y+=g*(x.y||0),_+=g*(x.z||0));v*=Math.sqrt(4/C),m.x=k/b,r>1&&(m.y=y/b),r>2&&(m.z=_/b)}else{x=m,x.x=x.data.x,r>1&&(x.y=x.data.y),r>2&&(x.z=x.data.z);do v+=s[x.data.index];while(x=x.next)}m.value=v}function p(m,v,x,g,b){if(!m.value)return!0;var k=[x,g,b][r-1],y=m.x-n.x,_=r>1?m.y-n.y:0,w=r>2?m.z-n.z:0,C=k-v,R=y*y+_*_+w*w;if(C*C/c<R)return R<u&&(y===0&&(y=Ue(o),R+=y*y),r>1&&_===0&&(_=Ue(o),R+=_*_),r>2&&w===0&&(w=Ue(o),R+=w*w),R<l&&(R=Math.sqrt(l*R)),n.vx+=y*m.value*i/R,r>1&&(n.vy+=_*m.value*i/R),r>2&&(n.vz+=w*m.value*i/R)),!0;if(m.length||R>=u)return;(m.data!==n||m.next)&&(y===0&&(y=Ue(o),R+=y*y),r>1&&_===0&&(_=Ue(o),R+=_*_),r>2&&w===0&&(w=Ue(o),R+=w*w),R<l&&(R=Math.sqrt(l*R)));do m.data!==n&&(C=s[m.data.index]*i/R,n.vx+=y*C,r>1&&(n.vy+=_*C),r>2&&(n.vz+=w*C));while(m=m.next)}return f.initialize=function(m,...v){e=m,o=v.find(x=>typeof x=="function")||Math.random,r=v.find(x=>[1,2,3].includes(x))||2,h()},f.strength=function(m){return arguments.length?(a=typeof m=="function"?m:Te(+m),h(),f):a},f.distanceMin=function(m){return arguments.length?(l=m*m,f):Math.sqrt(l)},f.distanceMax=function(m){return arguments.length?(u=m*m,f):Math.sqrt(u)},f.theta=function(m){return arguments.length?(c=m*m,f):Math.sqrt(c)},f}function qi(e,r,n,o){var i,a,s=Te(.1),l,u;typeof e!="function"&&(e=Te(+e)),r==null&&(r=0),n==null&&(n=0),o==null&&(o=0);function c(h){for(var d=0,p=i.length;d<p;++d){var m=i[d],v=m.x-r||1e-6,x=(m.y||0)-n||1e-6,g=(m.z||0)-o||1e-6,b=Math.sqrt(v*v+x*x+g*g),k=(u[d]-b)*l[d]*h/b;m.vx+=v*k,a>1&&(m.vy+=x*k),a>2&&(m.vz+=g*k)}}function f(){if(i){var h,d=i.length;for(l=new Array(d),u=new Array(d),h=0;h<d;++h)u[h]=+e(i[h],h,i),l[h]=isNaN(u[h])?0:+s(i[h],h,i)}}return c.initialize=function(h,...d){i=h,a=d.find(p=>[1,2,3].includes(p))||2,f()},c.strength=function(h){return arguments.length?(s=typeof h=="function"?h:Te(+h),f(),c):s},c.radius=function(h){return arguments.length?(e=typeof h=="function"?h:Te(+h),f(),c):e},c.x=function(h){return arguments.length?(r=+h,c):r},c.y=function(h){return arguments.length?(n=+h,c):n},c.z=function(h){return arguments.length?(o=+h,c):o},c}var{abs:Wr,cos:lt,sin:Zt,acos:Nx,atan2:Jr,sqrt:gt,pow:Ne}=Math;function Xr(e){return e<0?-Ne(-e,1/3):Ne(e,1/3)}var qc=Math.PI,mo=2*qc,xt=qc/2,Fx=1e-6,Wi=Number.MAX_SAFE_INTEGER||9007199254740991,Ji=Number.MIN_SAFE_INTEGER||-9007199254740991,Ix={x:0,y:0,z:0},I={Tvalues:[-.06405689286260563,.06405689286260563,-.1911188674736163,.1911188674736163,-.3150426796961634,.3150426796961634,-.4337935076260451,.4337935076260451,-.5454214713888396,.5454214713888396,-.6480936519369755,.6480936519369755,-.7401241915785544,.7401241915785544,-.820001985973903,.820001985973903,-.8864155270044011,.8864155270044011,-.9382745520027328,.9382745520027328,-.9747285559713095,.9747285559713095,-.9951872199970213,.9951872199970213],Cvalues:[.12793819534675216,.12793819534675216,.1258374563468283,.1258374563468283,.12167047292780339,.12167047292780339,.1155056680537256,.1155056680537256,.10744427011596563,.10744427011596563,.09761865210411388,.09761865210411388,.08619016153195327,.08619016153195327,.0733464814110803,.0733464814110803,.05929858491543678,.05929858491543678,.04427743881741981,.04427743881741981,.028531388628933663,.028531388628933663,.0123412297999872,.0123412297999872],arcfn:function(e,r){let n=r(e),o=n.x*n.x+n.y*n.y;return typeof n.z<"u"&&(o+=n.z*n.z),gt(o)},compute:function(e,r,n){if(e===0)return r[0].t=0,r[0];let o=r.length-1;if(e===1)return r[o].t=1,r[o];let i=1-e,a=r;if(o===0)return r[0].t=e,r[0];if(o===1){let l={x:i*a[0].x+e*a[1].x,y:i*a[0].y+e*a[1].y,t:e};return n&&(l.z=i*a[0].z+e*a[1].z),l}if(o<4){let l=i*i,u=e*e,c,f,h,d=0;o===2?(a=[a[0],a[1],a[2],Ix],c=l,f=i*e*2,h=u):o===3&&(c=l*i,f=l*e*3,h=i*u*3,d=e*u);let p={x:c*a[0].x+f*a[1].x+h*a[2].x+d*a[3].x,y:c*a[0].y+f*a[1].y+h*a[2].y+d*a[3].y,t:e};return n&&(p.z=c*a[0].z+f*a[1].z+h*a[2].z+d*a[3].z),p}let s=JSON.parse(JSON.stringify(r));for(;s.length>1;){for(let l=0;l<s.length-1;l++)s[l]={x:s[l].x+(s[l+1].x-s[l].x)*e,y:s[l].y+(s[l+1].y-s[l].y)*e},typeof s[l].z<"u"&&(s[l].z=s[l].z+(s[l+1].z-s[l].z)*e);s.splice(s.length-1,1)}return s[0].t=e,s[0]},computeWithRatios:function(e,r,n,o){let i=1-e,a=n,s=r,l=a[0],u=a[1],c=a[2],f=a[3],h;if(l*=i,u*=e,s.length===2)return h=l+u,{x:(l*s[0].x+u*s[1].x)/h,y:(l*s[0].y+u*s[1].y)/h,z:o?(l*s[0].z+u*s[1].z)/h:!1,t:e};if(l*=i,u*=2*i,c*=e*e,s.length===3)return h=l+u+c,{x:(l*s[0].x+u*s[1].x+c*s[2].x)/h,y:(l*s[0].y+u*s[1].y+c*s[2].y)/h,z:o?(l*s[0].z+u*s[1].z+c*s[2].z)/h:!1,t:e};if(l*=i,u*=1.5*i,c*=3*i,f*=e*e*e,s.length===4)return h=l+u+c+f,{x:(l*s[0].x+u*s[1].x+c*s[2].x+f*s[3].x)/h,y:(l*s[0].y+u*s[1].y+c*s[2].y+f*s[3].y)/h,z:o?(l*s[0].z+u*s[1].z+c*s[2].z+f*s[3].z)/h:!1,t:e}},derive:function(e,r){let n=[];for(let o=e,i=o.length,a=i-1;i>1;i--,a--){let s=[];for(let l=0,u;l<a;l++)u={x:a*(o[l+1].x-o[l].x),y:a*(o[l+1].y-o[l].y)},r&&(u.z=a*(o[l+1].z-o[l].z)),s.push(u);n.push(s),o=s}return n},between:function(e,r,n){return r<=e&&e<=n||I.approximately(e,r)||I.approximately(e,n)},approximately:function(e,r,n){return Wr(e-r)<=(n||Fx)},length:function(e){let n=I.Tvalues.length,o=0;for(let i=0,a;i<n;i++)a=.5*I.Tvalues[i]+.5,o+=I.Cvalues[i]*I.arcfn(a,e);return .5*o},map:function(e,r,n,o,i){let a=n-r,s=i-o,l=e-r,u=l/a;return o+s*u},lerp:function(e,r,n){let o={x:r.x+e*(n.x-r.x),y:r.y+e*(n.y-r.y)};return r.z!==void 0&&n.z!==void 0&&(o.z=r.z+e*(n.z-r.z)),o},pointToString:function(e){let r=e.x+"/"+e.y;return typeof e.z<"u"&&(r+="/"+e.z),r},pointsToString:function(e){return"["+e.map(I.pointToString).join(", ")+"]"},copy:function(e){return JSON.parse(JSON.stringify(e))},angle:function(e,r,n){let o=r.x-e.x,i=r.y-e.y,a=n.x-e.x,s=n.y-e.y,l=o*s-i*a,u=o*a+i*s;return Jr(l,u)},round:function(e,r){let n=""+e,o=n.indexOf(".");return parseFloat(n.substring(0,o+1+r))},dist:function(e,r){let n=e.x-r.x,o=e.y-r.y;return gt(n*n+o*o)},closest:function(e,r){let n=Ne(2,63),o,i;return e.forEach(function(a,s){i=I.dist(r,a),i<n&&(n=i,o=s)}),{mdist:n,mpos:o}},abcratio:function(e,r){if(r!==2&&r!==3)return!1;if(typeof e>"u")e=.5;else if(e===0||e===1)return e;let n=Ne(e,r)+Ne(1-e,r),o=n-1;return Wr(o/n)},projectionratio:function(e,r){if(r!==2&&r!==3)return!1;if(typeof e>"u")e=.5;else if(e===0||e===1)return e;let n=Ne(1-e,r),o=Ne(e,r)+n;return n/o},lli8:function(e,r,n,o,i,a,s,l){let u=(e*o-r*n)*(i-s)-(e-n)*(i*l-a*s),c=(e*o-r*n)*(a-l)-(r-o)*(i*l-a*s),f=(e-n)*(a-l)-(r-o)*(i-s);return f==0?!1:{x:u/f,y:c/f}},lli4:function(e,r,n,o){let i=e.x,a=e.y,s=r.x,l=r.y,u=n.x,c=n.y,f=o.x,h=o.y;return I.lli8(i,a,s,l,u,c,f,h)},lli:function(e,r){return I.lli4(e,e.c,r,r.c)},makeline:function(e,r){return new Lt(e.x,e.y,(e.x+r.x)/2,(e.y+r.y)/2,r.x,r.y)},findbbox:function(e){let r=Wi,n=Wi,o=Ji,i=Ji;return e.forEach(function(a){let s=a.bbox();r>s.x.min&&(r=s.x.min),n>s.y.min&&(n=s.y.min),o<s.x.max&&(o=s.x.max),i<s.y.max&&(i=s.y.max)}),{x:{min:r,mid:(r+o)/2,max:o,size:o-r},y:{min:n,mid:(n+i)/2,max:i,size:i-n}}},shapeintersections:function(e,r,n,o,i){if(!I.bboxoverlap(r,o))return[];let a=[],s=[e.startcap,e.forward,e.back,e.endcap],l=[n.startcap,n.forward,n.back,n.endcap];return s.forEach(function(u){u.virtual||l.forEach(function(c){if(c.virtual)return;let f=u.intersects(c,i);f.length>0&&(f.c1=u,f.c2=c,f.s1=e,f.s2=n,a.push(f))})}),a},makeshape:function(e,r,n){let o=r.points.length,i=e.points.length,a=I.makeline(r.points[o-1],e.points[0]),s=I.makeline(e.points[i-1],r.points[0]),l={startcap:a,forward:e,back:r,endcap:s,bbox:I.findbbox([a,e,r,s])};return l.intersections=function(u){return I.shapeintersections(l,l.bbox,u,u.bbox,n)},l},getminmax:function(e,r,n){if(!n)return{min:0,max:0};let o=Wi,i=Ji,a,s;n.indexOf(0)===-1&&(n=[0].concat(n)),n.indexOf(1)===-1&&n.push(1);for(let l=0,u=n.length;l<u;l++)a=n[l],s=e.get(a),s[r]<o&&(o=s[r]),s[r]>i&&(i=s[r]);return{min:o,mid:(o+i)/2,max:i,size:i-o}},align:function(e,r){let n=r.p1.x,o=r.p1.y,i=-Jr(r.p2.y-o,r.p2.x-n),a=function(s){return{x:(s.x-n)*lt(i)-(s.y-o)*Zt(i),y:(s.x-n)*Zt(i)+(s.y-o)*lt(i)}};return e.map(a)},roots:function(e,r){r=r||{p1:{x:0,y:0},p2:{x:1,y:0}};let n=e.length-1,o=I.align(e,r),i=function(C){return 0<=C&&C<=1};if(n===2){let C=o[0].y,R=o[1].y,S=o[2].y,N=C-2*R+S;if(N!==0){let T=-gt(R*R-C*S),L=-C+R,B=-(T+L)/N,A=-(-T+L)/N;return[B,A].filter(i)}else if(R!==S&&N===0)return[(2*R-S)/(2*R-2*S)].filter(i);return[]}let a=o[0].y,s=o[1].y,l=o[2].y,u=o[3].y,c=-a+3*s-3*l+u,f=3*a-6*s+3*l,h=-3*a+3*s,d=a;if(I.approximately(c,0)){if(I.approximately(f,0))return I.approximately(h,0)?[]:[-d/h].filter(i);let C=gt(h*h-4*f*d),R=2*f;return[(C-h)/R,(-h-C)/R].filter(i)}f/=c,h/=c,d/=c;let p=(3*h-f*f)/3,m=p/3,v=(2*f*f*f-9*f*h+27*d)/27,x=v/2,g=x*x+m*m*m,b,k,y,_,w;if(g<0){let C=-p/3,R=C*C*C,S=gt(R),N=-v/(2*S),T=N<-1?-1:N>1?1:N,L=Nx(T),B=Xr(S),A=2*B;return y=A*lt(L/3)-f/3,_=A*lt((L+mo)/3)-f/3,w=A*lt((L+2*mo)/3)-f/3,[y,_,w].filter(i)}else{if(g===0)return b=x<0?Xr(-x):-Xr(x),y=2*b-f/3,_=-b-f/3,[y,_].filter(i);{let C=gt(g);return b=Xr(-x+C),k=Xr(x+C),[b-k-f/3].filter(i)}}},droots:function(e){if(e.length===3){let r=e[0],n=e[1],o=e[2],i=r-2*n+o;if(i!==0){let a=-gt(n*n-r*o),s=-r+n,l=-(a+s)/i,u=-(-a+s)/i;return[l,u]}else if(n!==o&&i===0)return[(2*n-o)/(2*(n-o))];return[]}if(e.length===2){let r=e[0],n=e[1];return r!==n?[r/(r-n)]:[]}return[]},curvature:function(e,r,n,o,i){let a,s,l,u,c=0,f=0,h=I.compute(e,r),d=I.compute(e,n),p=h.x*h.x+h.y*h.y;if(o?(a=gt(Ne(h.y*d.z-d.y*h.z,2)+Ne(h.z*d.x-d.z*h.x,2)+Ne(h.x*d.y-d.x*h.y,2)),s=Ne(p+h.z*h.z,3/2)):(a=h.x*d.y-h.y*d.x,s=Ne(p,3/2)),a===0||s===0)return{k:0,r:0};if(c=a/s,f=s/a,!i){let m=I.curvature(e-.001,r,n,o,!0).k,v=I.curvature(e+.001,r,n,o,!0).k;u=(v-c+(c-m))/2,l=(Wr(v-c)+Wr(c-m))/2}return{k:c,r:f,dk:u,adk:l}},inflections:function(e){if(e.length<4)return[];let r=I.align(e,{p1:e[0],p2:e.slice(-1)[0]}),n=r[2].x*r[1].y,o=r[3].x*r[1].y,i=r[1].x*r[2].y,a=r[3].x*r[2].y,s=18*(-3*n+2*o+3*i-a),l=18*(3*n-o-3*i),u=18*(i-n);if(I.approximately(s,0)){if(!I.approximately(l,0)){let d=-u/l;if(0<=d&&d<=1)return[d]}return[]}let c=2*s;if(I.approximately(c,0))return[];let f=l*l-4*s*u;if(f<0)return[];let h=Math.sqrt(f);return[(h-l)/c,-(l+h)/c].filter(function(d){return 0<=d&&d<=1})},bboxoverlap:function(e,r){let n=["x","y"],o=n.length;for(let i=0,a,s,l,u;i<o;i++)if(a=n[i],s=e[a].mid,l=r[a].mid,u=(e[a].size+r[a].size)/2,Wr(s-l)>=u)return!1;return!0},expandbox:function(e,r){r.x.min<e.x.min&&(e.x.min=r.x.min),r.y.min<e.y.min&&(e.y.min=r.y.min),r.z&&r.z.min<e.z.min&&(e.z.min=r.z.min),r.x.max>e.x.max&&(e.x.max=r.x.max),r.y.max>e.y.max&&(e.y.max=r.y.max),r.z&&r.z.max>e.z.max&&(e.z.max=r.z.max),e.x.mid=(e.x.min+e.x.max)/2,e.y.mid=(e.y.min+e.y.max)/2,e.z&&(e.z.mid=(e.z.min+e.z.max)/2),e.x.size=e.x.max-e.x.min,e.y.size=e.y.max-e.y.min,e.z&&(e.z.size=e.z.max-e.z.min)},pairiteration:function(e,r,n){let o=e.bbox(),i=r.bbox(),a=1e5,s=n||.5;if(o.x.size+o.y.size<s&&i.x.size+i.y.size<s)return[(a*(e._t1+e._t2)/2|0)/a+"/"+(a*(r._t1+r._t2)/2|0)/a];let l=e.split(.5),u=r.split(.5),c=[{left:l.left,right:u.left},{left:l.left,right:u.right},{left:l.right,right:u.right},{left:l.right,right:u.left}];c=c.filter(function(h){return I.bboxoverlap(h.left.bbox(),h.right.bbox())});let f=[];return c.length===0||(c.forEach(function(h){f=f.concat(I.pairiteration(h.left,h.right,s))}),f=f.filter(function(h,d){return f.indexOf(h)===d})),f},getccenter:function(e,r,n){let o=r.x-e.x,i=r.y-e.y,a=n.x-r.x,s=n.y-r.y,l=o*lt(xt)-i*Zt(xt),u=o*Zt(xt)+i*lt(xt),c=a*lt(xt)-s*Zt(xt),f=a*Zt(xt)+s*lt(xt),h=(e.x+r.x)/2,d=(e.y+r.y)/2,p=(r.x+n.x)/2,m=(r.y+n.y)/2,v=h+l,x=d+u,g=p+c,b=m+f,k=I.lli8(h,d,v,x,p,m,g,b),y=I.dist(k,e),_=Jr(e.y-k.y,e.x-k.x),w=Jr(r.y-k.y,r.x-k.x),C=Jr(n.y-k.y,n.x-k.x),R;return _<C?((_>w||w>C)&&(_+=mo),_>C&&(R=C,C=_,_=R)):C<w&&w<_?(R=C,C=_,_=R):C+=mo,k.s=_,k.e=C,k.r=y,k},numberSort:function(e,r){return e-r}};var Kt=class e{constructor(r){this.curves=[],this._3d=!1,r&&(this.curves=r,this._3d=this.curves[0]._3d)}valueOf(){return this.toString()}toString(){return"["+this.curves.map(function(r){return I.pointsToString(r.points)}).join(", ")+"]"}addCurve(r){this.curves.push(r),this._3d=this._3d||r._3d}length(){return this.curves.map(function(r){return r.length()}).reduce(function(r,n){return r+n})}curve(r){return this.curves[r]}bbox(){let r=this.curves;for(var n=r[0].bbox(),o=1;o<r.length;o++)I.expandbox(n,r[o].bbox());return n}offset(r){let n=[];return this.curves.forEach(function(o){n.push(...o.offset(r))}),new e(n)}};var{abs:Vr,min:Wc,max:Jc,cos:Lx,sin:zx,acos:Px,sqrt:Yr}=Math,Ox=Math.PI;var Lt=class e{constructor(r){let n=r&&r.forEach?r:Array.from(arguments).slice(),o=!1;if(typeof n[0]=="object"){o=n.length;let p=[];n.forEach(function(m){["x","y","z"].forEach(function(v){typeof m[v]<"u"&&p.push(m[v])})}),n=p}let i=!1,a=n.length;if(o){if(o>4){if(arguments.length!==1)throw new Error("Only new Bezier(point[]) is accepted for 4th and higher order curves");i=!0}}else if(a!==6&&a!==8&&a!==9&&a!==12&&arguments.length!==1)throw new Error("Only new Bezier(point[]) is accepted for 4th and higher order curves");let s=this._3d=!i&&(a===9||a===12)||r&&r[0]&&typeof r[0].z<"u",l=this.points=[];for(let p=0,m=s?3:2;p<a;p+=m){var u={x:n[p],y:n[p+1]};s&&(u.z=n[p+2]),l.push(u)}let c=this.order=l.length-1,f=this.dims=["x","y"];s&&f.push("z"),this.dimlen=f.length;let h=I.align(l,{p1:l[0],p2:l[c]}),d=I.dist(l[0],l[c]);this._linear=h.reduce((p,m)=>p+Vr(m.y),0)<d/50,this._lut=[],this._t1=0,this._t2=1,this.update()}static quadraticFromPoints(r,n,o,i){if(typeof i>"u"&&(i=.5),i===0)return new e(n,n,o);if(i===1)return new e(r,n,n);let a=e.getABC(2,r,n,o,i);return new e(r,a.A,o)}static cubicFromPoints(r,n,o,i,a){typeof i>"u"&&(i=.5);let s=e.getABC(3,r,n,o,i);typeof a>"u"&&(a=I.dist(n,s.C));let l=a*(1-i)/i,u=I.dist(r,o),c=(o.x-r.x)/u,f=(o.y-r.y)/u,h=a*c,d=a*f,p=l*c,m=l*f,v={x:n.x-h,y:n.y-d},x={x:n.x+p,y:n.y+m},g=s.A,b={x:g.x+(v.x-g.x)/(1-i),y:g.y+(v.y-g.y)/(1-i)},k={x:g.x+(x.x-g.x)/i,y:g.y+(x.y-g.y)/i},y={x:r.x+(b.x-r.x)/i,y:r.y+(b.y-r.y)/i},_={x:o.x+(k.x-o.x)/(1-i),y:o.y+(k.y-o.y)/(1-i)};return new e(r,y,_,o)}static getUtils(){return I}getUtils(){return e.getUtils()}static get PolyBezier(){return Kt}valueOf(){return this.toString()}toString(){return I.pointsToString(this.points)}toSVG(){if(this._3d)return!1;let r=this.points,n=r[0].x,o=r[0].y,i=["M",n,o,this.order===2?"Q":"C"];for(let a=1,s=r.length;a<s;a++)i.push(r[a].x),i.push(r[a].y);return i.join(" ")}setRatios(r){if(r.length!==this.points.length)throw new Error("incorrect number of ratio values");this.ratios=r,this._lut=[]}verify(){let r=this.coordDigest();r!==this._print&&(this._print=r,this.update())}coordDigest(){return this.points.map(function(r,n){return""+n+r.x+r.y+(r.z?r.z:0)}).join("")}update(){this._lut=[],this.dpoints=I.derive(this.points,this._3d),this.computedirection()}computedirection(){let r=this.points,n=I.angle(r[0],r[this.order],r[1]);this.clockwise=n>0}length(){return I.length(this.derivative.bind(this))}static getABC(r=2,n,o,i,a=.5){let s=I.projectionratio(a,r),l=1-s,u={x:s*n.x+l*i.x,y:s*n.y+l*i.y},c=I.abcratio(a,r);return{A:{x:o.x+(o.x-u.x)/c,y:o.y+(o.y-u.y)/c},B:o,C:u,S:n,E:i}}getABC(r,n){n=n||this.get(r);let o=this.points[0],i=this.points[this.order];return e.getABC(this.order,o,n,i,r)}getLUT(r){if(this.verify(),r=r||100,this._lut.length===r+1)return this._lut;this._lut=[],r++,this._lut=[];for(let n=0,o,i;n<r;n++)i=n/(r-1),o=this.compute(i),o.t=i,this._lut.push(o);return this._lut}on(r,n){n=n||5;let o=this.getLUT(),i=[];for(let a=0,s,l=0;a<o.length;a++)s=o[a],I.dist(s,r)<n&&(i.push(s),l+=a/o.length);return i.length?t/=i.length:!1}project(r){let n=this.getLUT(),o=n.length-1,i=I.closest(n,r),a=i.mpos,s=(a-1)/o,l=(a+1)/o,u=.1/o,c=i.mdist,f=s,h=f,d;c+=1;for(let p;f<l+u;f+=u)d=this.compute(f),p=I.dist(r,d),p<c&&(c=p,h=f);return h=h<0?0:h>1?1:h,d=this.compute(h),d.t=h,d.d=c,d}get(r){return this.compute(r)}point(r){return this.points[r]}compute(r){return this.ratios?I.computeWithRatios(r,this.points,this.ratios,this._3d):I.compute(r,this.points,this._3d,this.ratios)}raise(){let r=this.points,n=[r[0]],o=r.length;for(let i=1,a,s;i<o;i++)a=r[i],s=r[i-1],n[i]={x:(o-i)/o*a.x+i/o*s.x,y:(o-i)/o*a.y+i/o*s.y};return n[o]=r[o-1],new e(n)}derivative(r){return I.compute(r,this.dpoints[0],this._3d)}dderivative(r){return I.compute(r,this.dpoints[1],this._3d)}align(){let r=this.points;return new e(I.align(r,{p1:r[0],p2:r[r.length-1]}))}curvature(r){return I.curvature(r,this.dpoints[0],this.dpoints[1],this._3d)}inflections(){return I.inflections(this.points)}normal(r){return this._3d?this.__normal3(r):this.__normal2(r)}__normal2(r){let n=this.derivative(r),o=Yr(n.x*n.x+n.y*n.y);return{t:r,x:-n.y/o,y:n.x/o}}__normal3(r){let n=this.derivative(r),o=this.derivative(r+.01),i=Yr(n.x*n.x+n.y*n.y+n.z*n.z),a=Yr(o.x*o.x+o.y*o.y+o.z*o.z);n.x/=i,n.y/=i,n.z/=i,o.x/=a,o.y/=a,o.z/=a;let s={x:o.y*n.z-o.z*n.y,y:o.z*n.x-o.x*n.z,z:o.x*n.y-o.y*n.x},l=Yr(s.x*s.x+s.y*s.y+s.z*s.z);s.x/=l,s.y/=l,s.z/=l;let u=[s.x*s.x,s.x*s.y-s.z,s.x*s.z+s.y,s.x*s.y+s.z,s.y*s.y,s.y*s.z-s.x,s.x*s.z-s.y,s.y*s.z+s.x,s.z*s.z];return{t:r,x:u[0]*n.x+u[1]*n.y+u[2]*n.z,y:u[3]*n.x+u[4]*n.y+u[5]*n.z,z:u[6]*n.x+u[7]*n.y+u[8]*n.z}}hull(r){let n=this.points,o=[],i=[],a=0;for(i[a++]=n[0],i[a++]=n[1],i[a++]=n[2],this.order===3&&(i[a++]=n[3]);n.length>1;){o=[];for(let s=0,l,u=n.length-1;s<u;s++)l=I.lerp(r,n[s],n[s+1]),i[a++]=l,o.push(l);n=o}return i}split(r,n){if(r===0&&n)return this.split(n).left;if(n===1)return this.split(r).right;let o=this.hull(r),i={left:this.order===2?new e([o[0],o[3],o[5]]):new e([o[0],o[4],o[7],o[9]]),right:this.order===2?new e([o[5],o[4],o[2]]):new e([o[9],o[8],o[6],o[3]]),span:o};return i.left._t1=I.map(0,0,1,this._t1,this._t2),i.left._t2=I.map(r,0,1,this._t1,this._t2),i.right._t1=I.map(r,0,1,this._t1,this._t2),i.right._t2=I.map(1,0,1,this._t1,this._t2),n?(n=I.map(n,r,1,0,1),i.right.split(n).left):i}extrema(){let r={},n=[];return this.dims.forEach(function(o){let i=function(s){return s[o]},a=this.dpoints[0].map(i);r[o]=I.droots(a),this.order===3&&(a=this.dpoints[1].map(i),r[o]=r[o].concat(I.droots(a))),r[o]=r[o].filter(function(s){return s>=0&&s<=1}),n=n.concat(r[o].sort(I.numberSort))}.bind(this)),r.values=n.sort(I.numberSort).filter(function(o,i){return n.indexOf(o)===i}),r}bbox(){let r=this.extrema(),n={};return this.dims.forEach(function(o){n[o]=I.getminmax(this,o,r[o])}.bind(this)),n}overlaps(r){let n=this.bbox(),o=r.bbox();return I.bboxoverlap(n,o)}offset(r,n){if(typeof n<"u"){let o=this.get(r),i=this.normal(r),a={c:o,n:i,x:o.x+i.x*n,y:o.y+i.y*n};return this._3d&&(a.z=o.z+i.z*n),a}if(this._linear){let o=this.normal(0),i=this.points.map(function(a){let s={x:a.x+r*o.x,y:a.y+r*o.y};return a.z&&o.z&&(s.z=a.z+r*o.z),s});return[new e(i)]}return this.reduce().map(function(o){return o._linear?o.offset(r)[0]:o.scale(r)})}simple(){if(this.order===3){let i=I.angle(this.points[0],this.points[3],this.points[1]),a=I.angle(this.points[0],this.points[3],this.points[2]);if(i>0&&a<0||i<0&&a>0)return!1}let r=this.normal(0),n=this.normal(1),o=r.x*n.x+r.y*n.y;return this._3d&&(o+=r.z*n.z),Vr(Px(o))<Ox/3}reduce(){let r,n=0,o=0,i=.01,a,s=[],l=[],u=this.extrema().values;for(u.indexOf(0)===-1&&(u=[0].concat(u)),u.indexOf(1)===-1&&u.push(1),n=u[0],r=1;r<u.length;r++)o=u[r],a=this.split(n,o),a._t1=n,a._t2=o,s.push(a),n=o;return s.forEach(function(c){for(n=0,o=0;o<=1;)for(o=n+i;o<=1+i;o+=i)if(a=c.split(n,o),!a.simple()){if(o-=i,Vr(n-o)<i)return[];a=c.split(n,o),a._t1=I.map(n,0,1,c._t1,c._t2),a._t2=I.map(o,0,1,c._t1,c._t2),l.push(a),n=o;break}n<1&&(a=c.split(n,1),a._t1=I.map(n,0,1,c._t1,c._t2),a._t2=c._t2,l.push(a))}),l}translate(r,n,o){o=typeof o=="number"?o:n;let i=this.order,a=this.points.map((s,l)=>(1-l/i)*n+l/i*o);return new e(this.points.map((s,l)=>({x:s.x+r.x*a[l],y:s.y+r.y*a[l]})))}scale(r){let n=this.order,o=!1;if(typeof r=="function"&&(o=r),o&&n===2)return this.raise().scale(o);let i=this.clockwise,a=this.points;if(this._linear)return this.translate(this.normal(0),o?o(0):r,o?o(1):r);let s=o?o(0):r,l=o?o(1):r,u=[this.offset(0,10),this.offset(1,10)],c=[],f=I.lli4(u[0],u[0].c,u[1],u[1].c);if(!f)throw new Error("cannot scale this curve. Try reducing it first.");return[0,1].forEach(function(h){let d=c[h*n]=I.copy(a[h*n]);d.x+=(h?l:s)*u[h].n.x,d.y+=(h?l:s)*u[h].n.y}),o?([0,1].forEach(function(h){if(!(n===2&&h)){var d=a[h+1],p={x:d.x-f.x,y:d.y-f.y},m=o?o((h+1)/n):r;o&&!i&&(m=-m);var v=Yr(p.x*p.x+p.y*p.y);p.x/=v,p.y/=v,c[h+1]={x:d.x+m*p.x,y:d.y+m*p.y}}}),new e(c)):([0,1].forEach(h=>{if(n===2&&h)return;let d=c[h*n],p=this.derivative(h),m={x:d.x+p.x,y:d.y+p.y};c[h+1]=I.lli4(d,m,f,a[h+1])}),new e(c))}outline(r,n,o,i){if(n=n===void 0?r:n,this._linear){let _=this.normal(0),w=this.points[0],C=this.points[this.points.length-1],R,S,N;o===void 0&&(o=r,i=n),R={x:w.x+_.x*r,y:w.y+_.y*r},N={x:C.x+_.x*o,y:C.y+_.y*o},S={x:(R.x+N.x)/2,y:(R.y+N.y)/2};let T=[R,S,N];R={x:w.x-_.x*n,y:w.y-_.y*n},N={x:C.x-_.x*i,y:C.y-_.y*i},S={x:(R.x+N.x)/2,y:(R.y+N.y)/2};let L=[N,S,R],B=I.makeline(L[2],T[0]),A=I.makeline(T[2],L[0]),F=[B,new e(T),A,new e(L)];return new Kt(F)}let a=this.reduce(),s=a.length,l=[],u=[],c,f=0,h=this.length(),d=typeof o<"u"&&typeof i<"u";function p(_,w,C,R,S){return function(N){let T=R/C,L=(R+S)/C,B=w-_;return I.map(N,0,1,_+T*B,_+L*B)}}a.forEach(function(_){let w=_.length();d?(l.push(_.scale(p(r,o,h,f,w))),u.push(_.scale(p(-n,-i,h,f,w)))):(l.push(_.scale(r)),u.push(_.scale(-n))),f+=w}),u=u.map(function(_){return c=_.points,c[3]?_.points=[c[3],c[2],c[1],c[0]]:_.points=[c[2],c[1],c[0]],_}).reverse();let m=l[0].points[0],v=l[s-1].points[l[s-1].points.length-1],x=u[s-1].points[u[s-1].points.length-1],g=u[0].points[0],b=I.makeline(x,m),k=I.makeline(v,g),y=[b].concat(l).concat([k]).concat(u);return new Kt(y)}outlineshapes(r,n,o){n=n||r;let i=this.outline(r,n).curves,a=[];for(let s=1,l=i.length;s<l/2;s++){let u=I.makeshape(i[s],i[l-s],o);u.startcap.virtual=s>1,u.endcap.virtual=s<l/2-1,a.push(u)}return a}intersects(r,n){return r?r.p1&&r.p2?this.lineIntersects(r):(r instanceof e&&(r=r.reduce()),this.curveintersects(this.reduce(),r,n)):this.selfintersects(n)}lineIntersects(r){let n=Wc(r.p1.x,r.p2.x),o=Wc(r.p1.y,r.p2.y),i=Jc(r.p1.x,r.p2.x),a=Jc(r.p1.y,r.p2.y);return I.roots(this.points,r).filter(s=>{var l=this.get(s);return I.between(l.x,n,i)&&I.between(l.y,o,a)})}selfintersects(r){let n=this.reduce(),o=n.length-2,i=[];for(let a=0,s,l,u;a<o;a++)l=n.slice(a,a+1),u=n.slice(a+2),s=this.curveintersects(l,u,r),i.push(...s);return i}curveintersects(r,n,o){let i=[];r.forEach(function(s){n.forEach(function(l){s.overlaps(l)&&i.push({left:s,right:l})})});let a=[];return i.forEach(function(s){let l=I.pairiteration(s.left,s.right,o);l.length>0&&(a=a.concat(l))}),a}arcs(r){return r=r||.5,this._iterate(r,[])}_error(r,n,o,i){let a=(i-o)/4,s=this.get(o+a),l=this.get(i-a),u=I.dist(r,n),c=I.dist(r,s),f=I.dist(r,l);return Vr(c-u)+Vr(f-u)}_iterate(r,n){let o=0,i=1,a;do{a=0,i=1;let s=this.get(o),l,u,c,f,h=!1,d=!1,p,m=i,v=1,x=0;do if(d=h,f=c,m=(o+i)/2,x++,l=this.get(m),u=this.get(i),c=I.getccenter(s,l,u),c.interval={start:o,end:i},h=this._error(c,s,o,i)<=r,p=d&&!h,p||(v=i),h){if(i>=1){if(c.interval.end=v=1,f=c,i>1){let b={x:c.x+c.r*Lx(c.e),y:c.y+c.r*zx(c.e)};c.e+=I.angle({x:c.x,y:c.y},b,this.get(1))}break}i=i+(i-o)/2}else i=m;while(!p&&a++<100);if(a>=100)break;f=f||c,n.push(f),o=v}while(i<1);return n}};function Xi(e,r){(r==null||r>e.length)&&(r=e.length);for(var n=0,o=Array(r);n<r;n++)o[n]=e[n];return o}function Bx(e){if(Array.isArray(e))return e}function jx(e){if(Array.isArray(e))return Xi(e)}function $x(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function Hx(e,r){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var o,i,a,s,l=[],u=!0,c=!1;try{if(a=(n=n.call(e)).next,r!==0)for(;!(u=(o=a.call(n)).done)&&(l.push(o.value),l.length!==r);u=!0);}catch(f){c=!0,i=f}finally{try{if(!u&&n.return!=null&&(s=n.return(),Object(s)!==s))return}finally{if(c)throw i}}return l}}function Ux(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
16
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Gx(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
17
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function qx(e,r){if(e==null)return{};var n,o,i=Wx(e,r);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(o=0;o<a.length;o++)n=a[o],r.includes(n)||{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function Wx(e,r){if(e==null)return{};var n={};for(var o in e)if({}.hasOwnProperty.call(e,o)){if(r.includes(o))continue;n[o]=e[o]}return n}function Jx(e,r){return Bx(e)||Hx(e,r)||Xc(e,r)||Ux()}function Xx(e){return jx(e)||$x(e)||Xc(e)||Gx()}function Vx(e,r){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var o=n.call(e,r);if(typeof o!="object")return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}function Yx(e){var r=Vx(e,"string");return typeof r=="symbol"?r:r+""}function Xc(e,r){if(e){if(typeof e=="string")return Xi(e,r);var n={}.toString.call(e).slice(8,-1);return n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set"?Array.from(e):n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Xi(e,r):void 0}}var Vc=(function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,o=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1,i=(r instanceof Array?r.length?r:[void 0]:[r]).map(function(l){return{keyAccessor:l,isProp:!(l instanceof Function)}}),a=e.reduce(function(l,u){var c=l,f=u;return i.forEach(function(h,d){var p=h.keyAccessor,m=h.isProp,v;if(m){var x=f,g=x[p],b=qx(x,[p].map(Yx));v=g,f=b}else v=p(f,d);d+1<i.length?(c.hasOwnProperty(v)||(c[v]={}),c=c[v]):n?(c.hasOwnProperty(v)||(c[v]=[]),c[v].push(f)):c[v]=f}),l},{});n instanceof Function&&(function l(u){var c=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1;c===i.length?Object.keys(u).forEach(function(f){return u[f]=n(u[f])}):Object.values(u).forEach(function(f){return l(f,c+1)})})(a);var s=a;return o&&(s=[],(function l(u){var c=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[];c.length===i.length?s.push({keys:c,vals:u}):Object.entries(u).forEach(function(f){var h=Jx(f,2),d=h[0],p=h[1];return l(p,[].concat(Xx(c),[d]))})})(a),r instanceof Array&&r.length===0&&s.length===1&&(s[0].keys=[])),s});function Yc(e,r){switch(arguments.length){case 0:break;case 1:this.range(e);break;default:this.range(r).domain(e);break}return this}var Vi=Symbol("implicit");function Zr(){var e=new Xt,r=[],n=[],o=Vi;function i(a){let s=e.get(a);if(s===void 0){if(o!==Vi)return o;e.set(a,s=r.push(a)-1)}return n[s%n.length]}return i.domain=function(a){if(!arguments.length)return r.slice();r=[],e=new Xt;for(let s of a)e.has(s)||e.set(s,r.push(s)-1);return i},i.range=function(a){return arguments.length?(n=Array.from(a),i):n.slice()},i.unknown=function(a){return arguments.length?(o=a,i):o},i.copy=function(){return Zr(r,n).unknown(o)},Yc.apply(i,arguments),i}function Zc(e){for(var r=e.length/6|0,n=new Array(r),o=0;o<r;)n[o]="#"+e.slice(o*6,++o*6);return n}var Yi=Zc("a6cee31f78b4b2df8a33a02cfb9a99e31a1cfdbf6fff7f00cab2d66a3d9affff99b15928");function Zx(e,r){r===void 0&&(r={});var n=r.insertAt;if(!(typeof document>"u")){var o=document.head||document.getElementsByTagName("head")[0],i=document.createElement("style");i.type="text/css",n==="top"&&o.firstChild?o.insertBefore(i,o.firstChild):o.appendChild(i),i.styleSheet?i.styleSheet.cssText=e:i.appendChild(document.createTextNode(e))}}var Kx=`.force-graph-container canvas {
18
+ display: block;
19
+ user-select: none;
20
+ outline: none;
21
+ -webkit-tap-highlight-color: transparent;
22
+ }
23
+
24
+ .force-graph-container .clickable {
25
+ cursor: pointer;
26
+ }
27
+
28
+ .force-graph-container .grabbable {
29
+ cursor: move;
30
+ cursor: grab;
31
+ cursor: -moz-grab;
32
+ cursor: -webkit-grab;
33
+ }
34
+
35
+ .force-graph-container .grabbable:active {
36
+ cursor: grabbing;
37
+ cursor: -moz-grabbing;
38
+ cursor: -webkit-grabbing;
39
+ }
40
+ `;Zx(Kx);var Qx=Zr(Yi);function Kc(e,r,n){!r||typeof n!="string"||e.filter(o=>!o[n]).forEach(o=>{o[n]=Qx(r(o))})}function ev({nodes:e,links:r},n,{nodeFilter:o=()=>!0,onLoopError:i=a=>{throw`Invalid DAG structure! Found cycle in node path: ${a.join(" -> ")}.`}}={}){let a={};e.forEach(c=>a[n(c)]={data:c,out:[],depth:-1,skip:!o(c)}),r.forEach(({source:c,target:f})=>{let h=v(c),d=v(f);if(!a.hasOwnProperty(h))throw`Missing source node with id: ${h}`;if(!a.hasOwnProperty(d))throw`Missing target node with id: ${d}`;let p=a[h],m=a[d];p.out.push(m);function v(x){return typeof x=="object"?n(x):x}});let s=[];return u(Object.values(a)),Object.assign({},...Object.entries(a).filter(([,c])=>!c.skip).map(([c,f])=>({[c]:f.depth})));function u(c,f=[],h=0){for(let d=0,p=c.length;d<p;d++){let m=c[d];if(f.indexOf(m)!==-1){let v=[...f.slice(f.indexOf(m)),m].map(x=>n(x.data));s.some(x=>x.length===v.length&&x.every((g,b)=>g===v[b]))||(s.push(v),i(v));continue}h>m.depth&&(m.depth=h,u(m.out,[...f,m],h+(m.skip?0:1)))}}}var tv=2,de=(e,r)=>r.onNeedsRedraw&&r.onNeedsRedraw(),Qc=(e,r)=>{if(!r.isShadow){let n=q(r.linkDirectionalParticles);r.graphData.links.forEach(o=>{let i=Math.round(Math.abs(n(o)));i?o.__photons=[...Array(i)].map(()=>({})):delete o.__photons})}},go=Or({props:{graphData:{default:{nodes:[],links:[]},onChange(e,r){r.engineRunning=!1,Qc(e,r)}},dagMode:{onChange(e,r){!e&&(r.graphData.nodes||[]).forEach(n=>n.fx=n.fy=void 0)}},dagLevelDistance:{},dagNodeFilter:{default:e=>!0},onDagError:{triggerUpdate:!1},nodeRelSize:{default:4,triggerUpdate:!1,onChange:de},nodeId:{default:"id"},nodeVal:{default:"val",triggerUpdate:!1,onChange:de},nodeColor:{default:"color",triggerUpdate:!1,onChange:de},nodeAutoColorBy:{},nodeCanvasObject:{triggerUpdate:!1,onChange:de},nodeCanvasObjectMode:{default:()=>"replace",triggerUpdate:!1,onChange:de},nodeVisibility:{default:!0,triggerUpdate:!1,onChange:de},linkSource:{default:"source"},linkTarget:{default:"target"},linkVisibility:{default:!0,triggerUpdate:!1,onChange:de},linkColor:{default:"color",triggerUpdate:!1,onChange:de},linkAutoColorBy:{},linkLineDash:{triggerUpdate:!1,onChange:de},linkWidth:{default:1,triggerUpdate:!1,onChange:de},linkCurvature:{default:0,triggerUpdate:!1,onChange:de},linkSelfCurveRotation:{default:0,triggerUpdate:!1,onChange:de},linkCanvasObject:{triggerUpdate:!1,onChange:de},linkCanvasObjectMode:{default:()=>"replace",triggerUpdate:!1,onChange:de},linkDirectionalArrowLength:{default:0,triggerUpdate:!1,onChange:de},linkDirectionalArrowColor:{triggerUpdate:!1,onChange:de},linkDirectionalArrowRelPos:{default:.5,triggerUpdate:!1,onChange:de},linkDirectionalParticles:{default:0,triggerUpdate:!1,onChange:Qc},linkDirectionalParticleSpeed:{default:.01,triggerUpdate:!1},linkDirectionalParticleOffset:{default:0,triggerUpdate:!1},linkDirectionalParticleWidth:{default:4,triggerUpdate:!1},linkDirectionalParticleColor:{triggerUpdate:!1},linkDirectionalParticleCanvasObject:{triggerUpdate:!1},globalScale:{default:1,triggerUpdate:!1},d3AlphaMin:{default:0,triggerUpdate:!1},d3AlphaDecay:{default:.0228,triggerUpdate:!1,onChange(e,r){r.forceLayout.alphaDecay(e)}},d3AlphaTarget:{default:0,triggerUpdate:!1,onChange(e,r){r.forceLayout.alphaTarget(e)}},d3VelocityDecay:{default:.4,triggerUpdate:!1,onChange(e,r){r.forceLayout.velocityDecay(e)}},warmupTicks:{default:0,triggerUpdate:!1},cooldownTicks:{default:1/0,triggerUpdate:!1},cooldownTime:{default:15e3,triggerUpdate:!1},onUpdate:{default:()=>{},triggerUpdate:!1},onFinishUpdate:{default:()=>{},triggerUpdate:!1},onEngineTick:{default:()=>{},triggerUpdate:!1},onEngineStop:{default:()=>{},triggerUpdate:!1},onNeedsRedraw:{triggerUpdate:!1},isShadow:{default:!1,triggerUpdate:!1}},methods:{d3Force:function(e,r,n){return n===void 0?e.forceLayout.force(r):(e.forceLayout.force(r,n),this)},d3ReheatSimulation:function(e){return e.forceLayout.alpha(1),this.resetCountdown(),this},resetCountdown:function(e){return e.cntTicks=0,e.startTickTime=new Date,e.engineRunning=!0,this},isEngineRunning:e=>!!e.engineRunning,tickFrame:function(e){return!e.isShadow&&r(),o(),!e.isShadow&&i(),!e.isShadow&&a(),n(),this;function r(){e.engineRunning&&(++e.cntTicks>e.cooldownTicks||new Date-e.startTickTime>e.cooldownTime||e.d3AlphaMin>0&&e.forceLayout.alpha()<e.d3AlphaMin?(e.engineRunning=!1,e.onEngineStop()):(e.forceLayout.tick(),e.onEngineTick()))}function n(){let s=q(e.nodeVisibility),l=q(e.nodeVal),u=q(e.nodeColor),c=q(e.nodeCanvasObjectMode),f=e.ctx,h=e.isShadow/e.globalScale,d=e.graphData.nodes.filter(s);f.save(),d.forEach(p=>{let m=c(p);if(e.nodeCanvasObject&&(m==="before"||m==="replace")&&(e.nodeCanvasObject(p,f,e.globalScale),m==="replace")){f.restore();return}let v=Math.sqrt(Math.max(0,l(p)||1))*e.nodeRelSize+h;f.beginPath(),f.arc(p.x,p.y,v,0,2*Math.PI,!1),f.fillStyle=u(p)||"rgba(31, 120, 180, 0.92)",f.fill(),e.nodeCanvasObject&&m==="after"&&e.nodeCanvasObject(p,e.ctx,e.globalScale)}),f.restore()}function o(){let s=q(e.linkVisibility),l=q(e.linkColor),u=q(e.linkWidth),c=q(e.linkLineDash),f=q(e.linkCurvature),h=q(e.linkSelfCurveRotation),d=q(e.linkCanvasObjectMode),p=e.ctx,m=e.isShadow*2,v=e.graphData.links.filter(s);v.forEach(y);let x=[],g=[],b=v;if(e.linkCanvasObject){let _=[],w=[];v.forEach(C=>({before:x,after:g,replace:_}[d(C)]||w).push(C)),b=[...x,...g,...w],x=x.concat(_)}p.save(),x.forEach(_=>e.linkCanvasObject(_,p,e.globalScale)),p.restore();let k=Vc(b,[l,u,c]);p.save(),Object.entries(k).forEach(([_,w])=>{let C=!_||_==="undefined"?"rgba(0,0,0,0.15)":_;Object.entries(w).forEach(([R,S])=>{let N=(R||1)/e.globalScale+m;Object.entries(S).forEach(([T,L])=>{let B=c(L[0]);p.beginPath(),L.forEach(A=>{let F=A.source,M=A.target;if(!F||!M||!F.hasOwnProperty("x")||!M.hasOwnProperty("x"))return;p.moveTo(F.x,F.y);let z=A.__controlPoints;z?p[z.length===2?"quadraticCurveTo":"bezierCurveTo"](...z,M.x,M.y):p.lineTo(M.x,M.y)}),p.strokeStyle=C,p.lineWidth=N,p.setLineDash(B||[]),p.stroke()})})}),p.restore(),p.save(),g.forEach(_=>e.linkCanvasObject(_,p,e.globalScale)),p.restore();function y(_){let w=f(_);if(!w){_.__controlPoints=null;return}let C=_.source,R=_.target;if(!C||!R||!C.hasOwnProperty("x")||!R.hasOwnProperty("x"))return;let S=Math.sqrt(Math.pow(R.x-C.x,2)+Math.pow(R.y-C.y,2));if(S>0){let N=Math.atan2(R.y-C.y,R.x-C.x),T=S*w,L={x:(C.x+R.x)/2+T*Math.cos(N-Math.PI/2),y:(C.y+R.y)/2+T*Math.sin(N-Math.PI/2)};_.__controlPoints=[L.x,L.y]}else{let N=w*70,T=(h(_)||0)*Math.PI/180,L=T-Math.PI/2,B=T;_.__controlPoints=[R.x+N*Math.cos(L),R.y+N*Math.sin(L),R.x+N*Math.cos(B),R.y+N*Math.sin(B)]}}}function i(){let u=q(e.linkDirectionalArrowLength),c=q(e.linkDirectionalArrowRelPos),f=q(e.linkVisibility),h=q(e.linkDirectionalArrowColor||e.linkColor),d=q(e.nodeVal),p=e.ctx;p.save(),e.graphData.links.filter(f).forEach(m=>{let v=u(m);if(!v||v<0)return;let x=m.source,g=m.target;if(!x||!g||!x.hasOwnProperty("x")||!g.hasOwnProperty("x"))return;let b=Math.sqrt(Math.max(0,d(x)||1))*e.nodeRelSize,k=Math.sqrt(Math.max(0,d(g)||1))*e.nodeRelSize,y=Math.min(1,Math.max(0,c(m))),_=h(m)||"rgba(0,0,0,0.28)",w=v/1.6/2,C=m.__controlPoints&&new Lt(x.x,x.y,...m.__controlPoints,g.x,g.y),R=C?F=>C.get(F):F=>({x:x.x+(g.x-x.x)*F||0,y:x.y+(g.y-x.y)*F||0}),S=C?C.length():Math.sqrt(Math.pow(g.x-x.x,2)+Math.pow(g.y-x.y,2)),N=b+v+(S-b-k-v)*y,T=R(N/S),L=R((N-v)/S),B=R((N-v*(1-.2))/S),A=Math.atan2(T.y-L.y,T.x-L.x)-Math.PI/2;p.beginPath(),p.moveTo(T.x,T.y),p.lineTo(L.x+w*Math.cos(A),L.y+w*Math.sin(A)),p.lineTo(B.x,B.y),p.lineTo(L.x-w*Math.cos(A),L.y-w*Math.sin(A)),p.fillStyle=_,p.fill()}),p.restore()}function a(){let s=q(e.linkDirectionalParticles),l=q(e.linkDirectionalParticleSpeed),u=q(e.linkDirectionalParticleOffset),c=q(e.linkDirectionalParticleWidth),f=q(e.linkVisibility),h=q(e.linkDirectionalParticleColor||e.linkColor),d=e.ctx;d.save(),e.graphData.links.filter(f).forEach(p=>{let m=s(p);if(!p.hasOwnProperty("__photons")||!p.__photons.length)return;let v=p.source,x=p.target;if(!v||!x||!v.hasOwnProperty("x")||!x.hasOwnProperty("x"))return;let g=l(p),b=Math.abs(u(p)),k=p.__photons||[],y=Math.max(0,c(p)/2)/Math.sqrt(e.globalScale),_=h(p)||"rgba(0,0,0,0.28)";d.fillStyle=_;let w=p.__controlPoints?new Lt(v.x,v.y,...p.__controlPoints,x.x,x.y):null,C=0,R=!1;k.forEach(S=>{let N=!!S.__singleHop;if(S.hasOwnProperty("__progressRatio")||(S.__progressRatio=N?g<0?1:0:(C+b)/m),!N&&C++,S.__progressRatio+=g,S.__progressRatio>=1||S.__progressRatio<0)if(!N)S.__progressRatio=S.__progressRatio%1,S.__progressRatio<0&&S.__progressRatio++;else{R=!0;return}let T=S.__progressRatio,L=w?w.get(T):{x:v.x+(x.x-v.x)*T||0,y:v.y+(x.y-v.y)*T||0};e.linkDirectionalParticleCanvasObject?e.linkDirectionalParticleCanvasObject(L.x,L.y,p,d,e.globalScale):(d.beginPath(),d.arc(L.x,L.y,y,0,2*Math.PI,!1),d.fill())}),R&&(p.__photons=p.__photons.filter(S=>!S.__singleHop||S.__progressRatio<=1&&S.__progressRatio>=0))}),d.restore()}},emitParticle:function(e,r){return r&&(!r.__photons&&(r.__photons=[]),r.__photons.push({__singleHop:!0})),this}},stateInit:()=>({forceLayout:Ui().force("link",$i()).force("charge",Gi()).force("center",Pi()).force("dagRadial",null).stop(),engineRunning:!1}),init(e,r){r.ctx=e},update(e,r){e.engineRunning=!1,e.onUpdate(),e.nodeAutoColorBy!==null&&Kc(e.graphData.nodes,q(e.nodeAutoColorBy),e.nodeColor),e.linkAutoColorBy!==null&&Kc(e.graphData.links,q(e.linkAutoColorBy),e.linkColor),e.graphData.links.forEach(s=>{s.source=s[e.linkSource],s.target=s[e.linkTarget]}),e.forceLayout.stop().alpha(1).nodes(e.graphData.nodes);let n=e.forceLayout.force("link");n&&n.id(s=>s[e.nodeId]).links(e.graphData.links);let o=e.dagMode&&ev(e.graphData,s=>s[e.nodeId],{nodeFilter:e.dagNodeFilter,onLoopError:e.onDagError||void 0}),i=Math.max(...Object.values(o||[])),a=e.dagLevelDistance||e.graphData.nodes.length/(i||1)*tv*(["radialin","radialout"].indexOf(e.dagMode)!==-1?.7:1);if(["lr","rl","td","bu"].includes(r.dagMode)){let s=["lr","rl"].includes(r.dagMode)?"fx":"fy";e.graphData.nodes.filter(e.dagNodeFilter).forEach(l=>delete l[s])}if(["lr","rl","td","bu"].includes(e.dagMode)){let s=["rl","bu"].includes(e.dagMode),l=c=>(o[c[e.nodeId]]-i/2)*a*(s?-1:1),u=["lr","rl"].includes(e.dagMode)?"fx":"fy";e.graphData.nodes.filter(e.dagNodeFilter).forEach(c=>c[u]=l(c))}e.forceLayout.force("dagRadial",["radialin","radialout"].indexOf(e.dagMode)!==-1?qi(s=>{let l=o[s[e.nodeId]]||-1;return(e.dagMode==="radialin"?i-l:l)*a}).strength(s=>e.dagNodeFilter(s)?1:0):null);for(let s=0;s<e.warmupTicks&&!(e.d3AlphaMin>0&&e.forceLayout.alpha()<e.d3AlphaMin);s++)e.forceLayout.tick();this.resetCountdown(),e.onFinishUpdate()}});function tf(e,r){let n=e instanceof Array?e:[e],o=new r;return o._destructor&&o._destructor(),{linkProp:function(i){return{default:o[i](),onChange(a,s){n.forEach(l=>s[l][i](a))},triggerUpdate:!1}},linkMethod:function(i){return function(a,...s){let l=[];return n.forEach(u=>{let c=a[u],f=c[i](...s);f!==c&&l.push(f)}),l.length?l[0]:this}}}}var rv=800,nv=4,ov=5,rf=tf("forceGraph",go),iv=tf(["forceGraph","shadowGraph"],go),av=Object.assign(...["nodeColor","nodeAutoColorBy","nodeCanvasObject","nodeCanvasObjectMode","linkColor","linkAutoColorBy","linkLineDash","linkWidth","linkCanvasObject","linkCanvasObjectMode","linkDirectionalArrowLength","linkDirectionalArrowColor","linkDirectionalArrowRelPos","linkDirectionalParticles","linkDirectionalParticleSpeed","linkDirectionalParticleOffset","linkDirectionalParticleWidth","linkDirectionalParticleColor","linkDirectionalParticleCanvasObject","dagMode","dagLevelDistance","dagNodeFilter","onDagError","d3AlphaMin","d3AlphaDecay","d3VelocityDecay","warmupTicks","cooldownTicks","cooldownTime","onEngineTick","onEngineStop"].map(e=>({[e]:rf.linkProp(e)})),...["nodeRelSize","nodeId","nodeVal","nodeVisibility","linkSource","linkTarget","linkVisibility","linkCurvature","linkSelfCurveRotation"].map(e=>({[e]:iv.linkProp(e)}))),sv=Object.assign(...["d3Force","d3ReheatSimulation","emitParticle"].map(e=>({[e]:rf.linkMethod(e)})));function Zi(e){if(e.canvas){let r=e.canvas.width,n=e.canvas.height;r===300&&n===150&&(r=n=0);let o=window.devicePixelRatio;r/=o,n/=o,[e.canvas,e.shadowCanvas].forEach(a=>{a.style.width=`${e.width}px`,a.style.height=`${e.height}px`,a.width=e.width*o,a.height=e.height*o,!r&&!n&&a.getContext("2d").scale(o,o)});let i=Ae(e.canvas).k;e.zoom.translateBy(e.zoom.__baseElem,(e.width-r)/2/i,(e.height-n)/2/i),e.needsRedraw=!0}}function nf(e){let r=window.devicePixelRatio;e.setTransform(r,0,0,r,0,0)}function ef(e,r,n){e.save(),nf(e),e.clearRect(0,0,r,n),e.restore()}var of=Or({props:{width:{default:window.innerWidth,onChange:(e,r)=>Zi(r),triggerUpdate:!1},height:{default:window.innerHeight,onChange:(e,r)=>Zi(r),triggerUpdate:!1},graphData:{default:{nodes:[],links:[]},onChange:(e,r)=>{[e.nodes,e.links].every(o=>(o||[]).every(i=>!i.hasOwnProperty("__indexColor")))&&r.colorTracker.reset(),[{type:"Node",objs:e.nodes},{type:"Link",objs:e.links}].forEach(n),r.forceGraph.graphData(e),r.shadowGraph.graphData(e);function n({type:o,objs:i}){i.filter(a=>{if(!a.hasOwnProperty("__indexColor"))return!0;let s=r.colorTracker.lookup(a.__indexColor);return!s||!s.hasOwnProperty("d")||s.d!==a}).forEach(a=>{a.__indexColor=r.colorTracker.register({type:o,d:a})})}},triggerUpdate:!1},backgroundColor:{onChange(e,r){r.canvas&&e&&(r.canvas.style.background=e)},triggerUpdate:!1},nodeLabel:{default:"name",triggerUpdate:!1},nodePointerAreaPaint:{onChange(e,r){r.shadowGraph.nodeCanvasObject(e?(n,o,i)=>e(n,n.__indexColor,o,i):null),r.flushShadowCanvas&&r.flushShadowCanvas()},triggerUpdate:!1},linkPointerAreaPaint:{onChange(e,r){r.shadowGraph.linkCanvasObject(e?(n,o,i)=>e(n,n.__indexColor,o,i):null),r.flushShadowCanvas&&r.flushShadowCanvas()},triggerUpdate:!1},linkLabel:{default:"name",triggerUpdate:!1},linkHoverPrecision:{default:4,triggerUpdate:!1},minZoom:{default:.01,onChange(e,r){r.zoom.scaleExtent([e,r.zoom.scaleExtent()[1]])},triggerUpdate:!1},maxZoom:{default:1e3,onChange(e,r){r.zoom.scaleExtent([r.zoom.scaleExtent()[0],e])},triggerUpdate:!1},enableNodeDrag:{default:!0,triggerUpdate:!1},enableZoomInteraction:{default:!0,triggerUpdate:!1},enablePanInteraction:{default:!0,triggerUpdate:!1},enableZoomPanInteraction:{default:!0,triggerUpdate:!1},enablePointerInteraction:{default:!0,onChange(e,r){r.hoverObj=null},triggerUpdate:!1},autoPauseRedraw:{default:!0,triggerUpdate:!1},onNodeDrag:{default:()=>{},triggerUpdate:!1},onNodeDragEnd:{default:()=>{},triggerUpdate:!1},onNodeClick:{triggerUpdate:!1},onNodeRightClick:{triggerUpdate:!1},onNodeHover:{triggerUpdate:!1},onLinkClick:{triggerUpdate:!1},onLinkRightClick:{triggerUpdate:!1},onLinkHover:{triggerUpdate:!1},onBackgroundClick:{triggerUpdate:!1},onBackgroundRightClick:{triggerUpdate:!1},showPointerCursor:{default:!0,triggerUpdate:!1},onZoom:{triggerUpdate:!1},onZoomEnd:{triggerUpdate:!1},onRenderFramePre:{triggerUpdate:!1},onRenderFramePost:{triggerUpdate:!1},...av},aliases:{stopAnimation:"pauseAnimation"},methods:{graph2ScreenCoords:function(e,r,n){let o=Ae(e.canvas);return{x:r*o.k+o.x,y:n*o.k+o.y}},screen2GraphCoords:function(e,r,n){let o=Ae(e.canvas);return{x:(r-o.x)/o.k,y:(n-o.y)/o.k}},centerAt:function(e,r,n,o){if(!e.canvas)return null;if(r!==void 0||n!==void 0){let s=Object.assign({},r!==void 0?{x:r}:{},n!==void 0?{y:n}:{});return o?e.tweenGroup.add(new Ci(i()).to(s,o).easing(pt.Quadratic.Out).onUpdate(a).onComplete(function(){e.tweenGroup.remove(this)}).start()):a(s),this}return i();function i(){let s=Ae(e.canvas);return{x:(e.width/2-s.x)/s.k,y:(e.height/2-s.y)/s.k}}function a({x:s,y:l}){e.zoom.translateTo(e.zoom.__baseElem,s===void 0?i().x:s,l===void 0?i().y:l),e.needsRedraw=!0}},zoom:function(e,r,n){if(!e.canvas)return null;if(r!==void 0)return n?e.tweenGroup.add(new Ci({k:o()}).to({k:r},n).easing(pt.Quadratic.Out).onUpdate(({k:a})=>i(a)).onComplete(function(){e.tweenGroup.remove(this)}).start()):i(r),this;return o();function o(){return Ae(e.canvas).k}function i(a){e.zoom.scaleTo(e.zoom.__baseElem,a),e.needsRedraw=!0}},zoomToFit:function(e,r=0,n=10,...o){let i=this.getGraphBbox(...o);if(i){let a={x:(i.x[0]+i.x[1])/2,y:(i.y[0]+i.y[1])/2},s=Math.max(1e-12,Math.min(1e12,(e.width-n*2)/(i.x[1]-i.x[0]),(e.height-n*2)/(i.y[1]-i.y[0])));this.centerAt(a.x,a.y,r),this.zoom(s,r)}return this},getGraphBbox:function(e,r=()=>!0){let n=q(e.nodeVal),o=a=>Math.sqrt(Math.max(0,n(a)||1))*e.nodeRelSize,i=e.graphData.nodes.filter(r).map(a=>({x:a.x,y:a.y,r:o(a)}));return i.length?{x:[Lr(i,a=>a.x-a.r),Ir(i,a=>a.x+a.r)],y:[Lr(i,a=>a.y-a.r),Ir(i,a=>a.y+a.r)]}:null},pauseAnimation:function(e){return e.animationFrameRequestId&&(cancelAnimationFrame(e.animationFrameRequestId),e.animationFrameRequestId=null),this},resumeAnimation:function(e){return e.animationFrameRequestId||this._animationCycle(),this},_destructor:function(){this.pauseAnimation(),this.graphData({nodes:[],links:[]})},...sv},stateInit:()=>({lastSetZoom:1,zoom:yi(),forceGraph:new go,shadowGraph:new go().cooldownTicks(0).nodeColor("__indexColor").linkColor("__indexColor").isShadow(!0),colorTracker:new _u,tweenGroup:new ki}),init:function(e,r){e.innerHTML="";let n=document.createElement("div");n.classList.add("force-graph-container"),n.style.position="relative",e.appendChild(n),r.canvas=document.createElement("canvas"),r.backgroundColor&&(r.canvas.style.background=r.backgroundColor),n.appendChild(r.canvas),r.shadowCanvas=document.createElement("canvas");let o=r.canvas.getContext("2d"),i=r.shadowCanvas.getContext("2d",{willReadFrequently:!0}),a={x:-1e12,y:-1e12},s=()=>{let u=null,c=window.devicePixelRatio,f=a.x>0&&a.y>0?i.getImageData(a.x*c,a.y*c,1,1):null;return f&&(u=r.colorTracker.lookup(f.data)),u};se(r.canvas).call(ii().subject(()=>{if(!r.enableNodeDrag)return null;let u=s();return u&&u.type==="Node"?u.d:null}).on("start",u=>{let c=u.subject;c.__initialDragPos={x:c.x,y:c.y,fx:c.fx,fy:c.fy},u.active||(c.fx=c.x,c.fy=c.y),r.canvas.classList.add("grabbable")}).on("drag",u=>{let c=u.subject,f=c.__initialDragPos,h=u,d=Ae(r.canvas).k,p={x:f.x+(h.x-f.x)/d-c.x,y:f.y+(h.y-f.y)/d-c.y};["x","y"].forEach(m=>c[`f${m}`]=c[m]=f[m]+(h[m]-f[m])/d),!(!c.__dragged&&ov>=Math.sqrt(Kn(["x","y"].map(m=>(u[m]-f[m])**2))))&&(r.forceGraph.d3AlphaTarget(.3).resetCountdown(),r.isPointerDragging=!0,c.__dragged=!0,r.onNodeDrag(c,p))}).on("end",u=>{let c=u.subject,f=c.__initialDragPos,h={x:c.x-f.x,y:c.y-f.y};f.fx===void 0&&(c.fx=void 0),f.fy===void 0&&(c.fy=void 0),delete c.__initialDragPos,r.forceGraph.d3AlphaTarget()&&r.forceGraph.d3AlphaTarget(0).resetCountdown(),r.canvas.classList.remove("grabbable"),r.isPointerDragging=!1,c.__dragged&&(delete c.__dragged,r.onNodeDragEnd(c,h))})),r.zoom(r.zoom.__baseElem=se(r.canvas)),r.zoom.__baseElem.on("dblclick.zoom",null),r.zoom.filter(u=>!u.button&&r.enableZoomPanInteraction&&(u.type!=="wheel"||q(r.enableZoomInteraction)(u))&&(u.type==="wheel"||q(r.enablePanInteraction)(u))).on("zoom",u=>{let c=u.transform;[o,i].forEach(f=>{nf(f),f.translate(c.x,c.y),f.scale(c.k,c.k)}),r.isPointerDragging=!0,r.onZoom&&r.onZoom({...c,...this.centerAt()}),r.needsRedraw=!0}).on("end",u=>{r.isPointerDragging=!1,r.onZoomEnd&&r.onZoomEnd({...u.transform,...this.centerAt()})}),Zi(r),r.forceGraph.onNeedsRedraw(()=>r.needsRedraw=!0).onFinishUpdate(()=>{Ae(r.canvas).k===r.lastSetZoom&&r.graphData.nodes.length&&(r.zoom.scaleTo(r.zoom.__baseElem,r.lastSetZoom=nv/Math.cbrt(r.graphData.nodes.length)),r.needsRedraw=!0)}),r.tooltip=new Bu(n),["pointermove","pointerdown"].forEach(u=>n.addEventListener(u,c=>{u==="pointerdown"&&(r.isPointerPressed=!0,r.pointerDownEvent=c),!r.isPointerDragging&&c.type==="pointermove"&&r.onBackgroundClick&&(c.pressure>0||r.isPointerPressed)&&(c.pointerType==="mouse"||c.movementX===void 0||[c.movementX,c.movementY].some(d=>Math.abs(d)>1))&&(r.isPointerDragging=!0);let f=h(n);a.x=c.pageX-f.left,a.y=c.pageY-f.top;function h(d){let p=d.getBoundingClientRect(),m=window.pageXOffset||document.documentElement.scrollLeft,v=window.pageYOffset||document.documentElement.scrollTop;return{top:p.top+v,left:p.left+m}}},{passive:!0})),n.addEventListener("pointerup",u=>{if(!r.isPointerPressed)return;if(r.isPointerPressed=!1,r.isPointerDragging){r.isPointerDragging=!1;return}let c=[u,r.pointerDownEvent];requestAnimationFrame(()=>{if(u.button===0)if(r.hoverObj){let f=r[`on${r.hoverObj.type}Click`];f&&f(r.hoverObj.d,...c)}else r.onBackgroundClick&&r.onBackgroundClick(...c);if(u.button===2)if(r.hoverObj){let f=r[`on${r.hoverObj.type}RightClick`];f&&f(r.hoverObj.d,...c)}else r.onBackgroundRightClick&&r.onBackgroundRightClick(...c)})},{passive:!0}),n.addEventListener("contextmenu",u=>!r.onBackgroundRightClick&&!r.onNodeRightClick&&!r.onLinkRightClick?!0:(u.preventDefault(),!1)),r.forceGraph(o),r.shadowGraph(i);let l=bi(()=>{ef(i,r.width,r.height),r.shadowGraph.linkWidth(c=>q(r.linkWidth)(c)+r.linkHoverPrecision);let u=Ae(r.canvas);r.shadowGraph.globalScale(u.k).tickFrame()},rv);r.flushShadowCanvas=l.flush,(this._animationCycle=function u(){let c=!r.autoPauseRedraw||!!r.needsRedraw||r.forceGraph.isEngineRunning()||r.graphData.links.some(f=>f.__photons&&f.__photons.length);if(r.needsRedraw=!1,r.enablePointerInteraction){let f=r.isPointerDragging?null:s();if(f!==r.hoverObj){let h=r.hoverObj,d=h?h.type:null,p=f?f.type:null;if(d&&d!==p){let m=r[`on${d}Hover`];m&&m(null,h.d)}if(p){let m=r[`on${p}Hover`];m&&m(f.d,d===p?h.d:null)}r.tooltip.content(f&&q(r[`${f.type.toLowerCase()}Label`])(f.d)||null),r.canvas.classList[(f&&r[`on${p}Click`]||!f&&r.onBackgroundClick)&&q(r.showPointerCursor)(f?.d)?"add":"remove"]("clickable"),r.hoverObj=f}c&&l()}if(c){ef(o,r.width,r.height);let f=Ae(r.canvas).k;r.onRenderFramePre&&r.onRenderFramePre(o,f),r.forceGraph.globalScale(f).tickFrame(),r.onRenderFramePost&&r.onRenderFramePost(o,f)}r.tweenGroup.update(),r.animationFrameRequestId=requestAnimationFrame(u)})()},update:function(r){}});function af(e){return String(e).padStart(2,"0")}function vt(e=new Date){return`${e.getFullYear()}-${af(e.getMonth()+1)}-${af(e.getDate())}`}function zt(e,r){return sf(r)-sf(e)}function sf(e){let[r,n,o]=e.split("-").map(Number);return Date.UTC(r,n-1,o)/864e5}var lv=3,uv=14,Ge=e=>e.kind==="entity"&&(e.status??"active")==="active",Ve=e=>Ge(e)&&e.stale===!0,Fe=e=>e.kind==="entity"&&e.status==="done";function uf(e,r){if(e.kind!=="entity"||Fe(e)||e.last_touched===void 0)return null;let n=zt(e.last_touched.slice(0,10),r);return n<=lv?"glow":n<=(e.staleness_days??uv)?"plain":"faded"}var cv=12,Kr={floor:4,step:1.8,entity:3,knowledge:2.6,plan:3.2};function cf(e){return e.kind==="knowledge"?e.subtype==="plan"?Kr.plan:Kr.knowledge:Ge(e)?Kr.floor+Kr.step*Math.sqrt(Math.min(e.open_actions??0,cv)):Kr.entity}function lf(e){return e.kind!=="entity"?3:Ge(e)?0:e.status==="paused"?1:2}function Qt(e,r){return lf(e)-lf(r)||Number(Ve(r))-Number(Ve(e))||(r.open_actions??0)-(e.open_actions??0)||(r.last_touched??"").localeCompare(e.last_touched??"")}function ff(e,r){let n=new Map;for(let i of r)i.relation==="parent"&&n.set(i.source,i.target);let o=new Set;for(let i of e)if(!(i.kind!=="entity"||Fe(i)))for(let a=n.get(i.id);a!==void 0&&!o.has(a);a=n.get(a))o.add(a);return i=>!Fe(i)||o.has(i.id)}function X(e,r){let n=parseInt(e.slice(1),16);return`rgba(${n>>16}, ${n>>8&255}, ${n&255}, ${r})`}var be="#ffffff",hf="#000000",ee={root:"#0e1117",well:"#0a0a0f",popover:"#161b22",text:"#e2e8f0",text2:"#94a3b8",muted:"#7c8da3",gold:"#cbaa4b",wisdom:"#5b9bd5",amber:"#fbbf24",info:"#38bdf8",teal:"#14b8a6",create:"#22c55e",update:"#f97316",delete:"#ef4444",surface:X(be,.04),elevated:X(be,.07),border:X(be,.07),hover:X(be,.05),inset:X(hf,.4),shadow:X(hf,.5),scrollbar:X(be,.08),scrollbarHover:X(be,.15)},xo={sans:"'Geist', system-ui, sans-serif",display:"'Outfit', system-ui, sans-serif",mono:"'Geist Mono', ui-monospace, monospace"},df={micro:10,label:11,base:12,body:13,title:16},pf=4,mf={sm:4,md:8,lg:12},vo={fast:180,normal:350,ease:"cubic-bezier(.4, 0, 0, 1)"},er={create:ee.create,update:ee.update,delete:ee.delete},H={background:ee.well,label:ee.text2,labelStrong:ee.text,labelHalo:X(ee.well,.85),font:e=>`${e}px ${xo.sans}`,displayFont:e=>`600 ${e}px ${xo.display}`,territory:{live:{fill:X(ee.gold,.045),stroke:X(ee.gold,.14),name:X(ee.gold,.9)},plain:{fill:X(be,.02),stroke:X(be,.05),name:X(ee.muted,.7)}},frame:{fill:X(be,.025),stroke:X(be,.09),title:ee.muted,caption:X(ee.muted,.7)},selectedRing:ee.text,entity:ee.gold,knowledge:ee.wisdom,core:ee.well,stale:ee.amber,glow:{inner:X(ee.gold,.45),outer:X(ee.gold,0)},edge:{parent:X(be,.16),related:X(be,.08),mention:X(ee.text2,.3),done:X(be,.035)},dimEdge:X(be,.015)};var gf=H.background,_o=H.label,xf=.12,Ki=H.dimEdge,vf=H.selectedRing,Qr=3.4,yo={glow:1,plain:.85,faded:.45,untouched:.85,done:.22,knowledge:.7,plan:.85},yf={parent:{color:H.edge.parent,width:1.6,dash:null},related:{color:H.edge.related,width:.8,dash:null},mention:{color:H.edge.mention,width:.6,dash:[3,2]}},fv=yf.related;function bo(e,r,n){let o=cf(e);if(e.kind==="knowledge"){let l=e.subtype==="plan";return{radius:o,shape:"diamond",fill:X(H.knowledge,l?yo.plan:yo.knowledge),hollow:l,core:!1,glow:!1,ring:null}}let i=Fe(e),a=uf(e,r),s=i?yo.done:yo[a??"untouched"];return{radius:o,shape:"disc",fill:X(H.entity,s),hollow:!1,core:n,glow:a==="glow",ring:Ve(e)?H.stale:null}}function wo(e,r=!1){let n=yf[e.relation]??fv;return r?{...n,color:H.edge.done}:n}var hv=["type","status","subtype","confidence","last_touched","description"],dv=["open_actions","stale","stale_actions","staleness_days","unlinked","best"],_f=[...hv,...dv];function bf(e,r){let n=e.get(r.id);if(!n)return r;for(let o of _f)o in r||delete n[o];return Object.assign(n,r)}var xe={selected:1e3,hovered:950,hoverNear:800,selectedNear:700,lit:500,parent:300,live:200,paused:100,plan:55,knowledge:50,done:10},pv=4,kf=60;function Cf(e,r,n){if(e.id===r.selected)return xe.selected;if(e.id===r.hovered)return xe.hovered;if(r.hoverNear.has(e.id))return xe.hoverNear;if(r.selectedNear.has(e.id))return xe.selectedNear;if(r.lit?.has(e.id))return xe.lit;let o=Math.min(e.open_actions??0,12)*pv;return n?xe.parent+(Ge(e)?kf:0)+o:e.kind==="knowledge"?e.subtype==="plan"?xe.plan:xe.knowledge:Fe(e)?xe.done:Ge(e)?xe.live+o:xe.paused}var mv=[[1.1,xe.parent+kf],[1.8,xe.parent],[2.8,xe.live],[4,xe.knowledge]];function Af(e){for(let[r,n]of mv)if(e<r)return n;return 0}var Qi={base:11,min:10.5,max:13.5};function en(e){return Math.min(Qi.max,Math.max(Qi.min,Qi.base*Math.sqrt(e)))}var wf=34;function ea(e){return e.length>wf?`${e.slice(0,wf-2)}\u2026`:e}function Rf(e,r,n=0){let o=e.filter(l=>l.x>=r.x&&l.x+l.w<=r.x+r.w&&l.y>=r.y&&l.y+l.h<=r.y+r.h);o.sort((l,u)=>u.priority-l.priority);let i=Math.max(1,...o.slice(0,32).map(l=>Math.max(l.w,l.h)))+n,a=new Map,s=[];for(let l of o){let u=Math.floor((l.x-n)/i),c=Math.floor((l.x+l.w+n)/i),f=Math.floor((l.y-n)/i),h=Math.floor((l.y+l.h+n)/i),d=!0;for(let p=u;p<=c&&d;p++)for(let m=f;m<=h&&d;m++)for(let v of a.get(`${p},${m}`)??[])if(l.x<v.x+v.w+n&&v.x<l.x+l.w+n&&l.y<v.y+v.h+n&&v.y<l.y+l.h+n){d=!1;break}if(d){s.push(l);for(let p=u;p<=c;p++)for(let m=f;m<=h;m++){let v=`${p},${m}`,x=a.get(v);x?x.push(l):a.set(v,[l])}}}return s}var D={nodes:[],links:[],font:H.font(en(1)),parentOf:new Map,frame:null,hovered:null,focusNodes:new Set,focusLinks:new Set,selected:null,selectedNear:new Set,live:(()=>!0),lit:null,family:null,local:!1};function Ef(e){let r=new Map(D.nodes.map(a=>[a.id,a])),n=vt(),o=new Set(e.edges.filter(a=>a.relation==="parent").map(a=>a.target)),i=new Set(e.nodes.filter(Fe).map(a=>a.id));D.nodes=e.nodes.map(a=>bf(r,{...a,style:bo(a,n,o.has(a.id))})),D.links=e.edges.map(a=>({...a,style:wo(a,i.has(a.source)||i.has(a.target))})),D.live=ff(e.nodes,e.edges),D.parentOf=new Map(e.edges.filter(a=>a.relation==="parent").map(a=>[a.source,a.target]))}var ue=e=>typeof e=="string"?e:e.id;var we={parentLink:{distance:26,strength:.7},otherLink:{distance:70,strength:.04},localLink:{distance:50,strength:.5},charge:{live:-70,rest:-35},chargeDistanceMax:380,gravity:.012,warmupTicks:220,cooldownMs:2500,alphaDecay:.03,alphaMin:.001,velocityDecay:.35},ta=(e,r=!1)=>e.relation==="parent"?we.parentLink:r?we.localLink:we.otherLink,Mf=e=>e.unlinked?0:Ge(e)?we.charge.live:we.charge.rest;function Tf(){let e=[];return Object.assign(r=>{for(let n of e)n.fx===void 0&&(n.vx=(n.vx??0)-(n.x??0)*we.gravity*r,n.vy=(n.vy??0)-(n.y??0)*we.gravity*r)},{initialize(r){e=r}})}var ko={ringMin:120,ringSpread:520,child:30},gv=Math.PI*2;function Df(e){let r=2166136261;for(let n=0;n<e.length;n++)r^=e.charCodeAt(n),r=Math.imul(r,16777619);return(r>>>0)/4294967296}function Nf(e,r){let n=new Map(e.map(a=>[a.id,a])),o=new Set,i=a=>{if(a.x!==void 0&&a.y!==void 0)return;o.add(a.id);let s=Df(a.id)*gv,l=r.get(a.id),u=l===void 0||o.has(l)?void 0:n.get(l);if(u&&i(u),u?.x!==void 0&&u.y!==void 0)a.x=u.x+Math.cos(s)*ko.child,a.y=u.y+Math.sin(s)*ko.child;else{let c=ko.ringMin+Df(`${a.id}r`)*ko.ringSpread;a.x=Math.cos(s)*c,a.y=Math.sin(s)*c}o.delete(a.id)};for(let a of e)i(a)}var Ye={gap:90,col:20,row:16,insetX:14,insetY:12,minRows:4},xv=(e,r)=>e.kind.localeCompare(r.kind)||+(e.status==="done")-+(r.status==="done")||e.name.localeCompare(r.name)||e.id.localeCompare(r.id);function Ff(e,r,n=null){if(e.length===0)return null;let o=n?.rows??Math.max(Ye.minRows,Math.ceil(Math.sqrt(e.length*2.2))),i=new Map,a=[...e].sort(xv);for(let m of a){let v=n?.slots.get(m.id);v&&i.set(m.id,v.cell)}let s=new Set(i.values()),l=0;for(let m of a)if(!i.has(m.id)){for(;s.has(l);)l++;i.set(m.id,l),s.add(l)}let u=Math.max(...s),c=Math.floor(u/o)*Ye.col+Ye.insetX*2,f=(Math.min(o,u+1)-1)*Ye.row+Ye.insetY*2,{x:h,y:d}=n??{x:0,y:0};if(!n){let m=r.map(g=>g.x??0),v=r.map(g=>g.y??0),x=v.length>0?(Math.min(...v)+Math.max(...v))/2:0;h=m.length>0?Math.max(...m)+Ye.gap:-c/2,d=x-f/2}let p=new Map;for(let[m,v]of i)p.set(m,{x:h+Ye.insetX+Math.floor(v/o)*Ye.col,y:d+Ye.insetY+v%o*Ye.row,cell:v});return{x:h,y:d,w:c,h:f,rows:o,count:e.length,slots:p}}var Sf={min:2,pad:14};function If(e,r){let n=new Map(e.map(a=>[a.id,a])),o=new Map;for(let a of e){let s=a,l=new Set([a.id]);for(let c=n.get(r.get(s.id)??"");c&&!l.has(c.id);c=n.get(r.get(s.id)??""))l.add(c.id),s=c;let u=o.get(s.id);u?u.push(a):o.set(s.id,[a])}let i=[];for(let[a,s]of o){if(s.length<Sf.min)continue;let l=0,u=0;for(let f of s)l+=f.x??0,u+=f.y??0;l/=s.length,u/=s.length;let c=0;for(let f of s)c=Math.max(c,Math.hypot((f.x??0)-l,(f.y??0)-u));i.push({root:a,name:n.get(a).name,x:l,y:u,r:c+Sf.pad,live:s.some(Ge),members:s.length})}return i}function Lf(e,r,n,o,i){let a=1/0,s=-1/0,l=1/0,u=-1/0;for(let x of e)a=Math.min(a,(x.x??0)-x.r),s=Math.max(s,(x.x??0)+x.r),l=Math.min(l,(x.y??0)-x.r),u=Math.max(u,(x.y??0)+x.r);if(r&&(a=Math.min(a,r.x),s=Math.max(s,r.x+r.w),l=Math.min(l,r.y),u=Math.max(u,r.y+r.h)),a>s)return{x:0,y:0,k:1};let c={w:o.w-i*2,h:o.h-i*2},f=[[s-a,0]],h=[[u-l,0]];if(r){let x=r.y+r.h;f.push([r.x-a,n.w]),h.push([u-r.y,n.above],[x-l,n.below],[r.h,n.above+n.below])}let d=1/0;for(let[x,g]of[[f,c.w],[h,c.h]])for(let[b,k]of x)b>0&&(d=Math.min(d,Math.max(g-k,1)/b));Number.isFinite(d)||(d=1);let p=r?Math.max(s,r.x+n.w/d):s,m=r?Math.min(l,r.y-n.above/d):l,v=r?Math.max(u,r.y+r.h+n.below/d):u;return{x:(a+p)/2,y:(m+v)/2,k:d}}var nr=Math.PI*2,sa=1.25,Co=64,ra=null;function vv(){if(ra)return ra;let e=document.createElement("canvas");e.width=e.height=Co;let r=e.getContext("2d"),n=Co/2,o=r.createRadialGradient(n,n,n*.6/Qr,n,n,n);return o.addColorStop(0,H.glow.inner),o.addColorStop(1,H.glow.outer),r.fillStyle=o,r.fillRect(0,0,Co,Co),ra=e}function Of(e,r){D.font=H.font(en(r)/r)}function Bf(e){if(D.hovered!==null)return!D.focusNodes.has(e);let r=D.family??D.lit;return r!==null&&!r.has(e)}function yv(e,r,n,o,i){if(e.beginPath(),r.style.shape==="diamond"){let a=i*sa;e.moveTo(n,o-a),e.lineTo(n+a,o),e.lineTo(n,o+a),e.lineTo(n-a,o),e.closePath()}else e.arc(n,o,i,0,nr)}function jf(e,r,n){let{radius:o,fill:i,hollow:a,core:s,ring:l}=e.style,u=e.x??0,c=e.y??0,f=Bf(e);if(f)r.globalAlpha=xf;else if(e.style.glow){let d=o*Qr;r.drawImage(vv(),u-d,c-d,d*2,d*2)}yv(r,e,u,c,o),a?(r.lineWidth=1.2/n,r.strokeStyle=i,r.stroke()):(r.fillStyle=i,r.fill()),s&&(r.beginPath(),r.arc(u,c,o*.38,0,nr),r.fillStyle=H.core,r.fill()),l&&(r.beginPath(),r.arc(u,c,o+2.2/n,0,nr),r.lineWidth=1.6/n,r.strokeStyle=l,r.stroke()),e===D.selected&&(r.beginPath(),r.arc(u,c,o+5/n,0,nr),r.lineWidth=1.5/n,r.strokeStyle=vf,r.stroke()),f&&(r.globalAlpha=1)}function $f(e,r,n){n.beginPath(),n.arc(e.x??0,e.y??0,e.style.radius*sa+1,0,nr),n.fillStyle=r,n.fill()}function la(e){if(D.hovered!==null)return D.focusLinks.has(e)?e.style.color:Ki;let r=D.family??D.lit;return r===null||typeof e.source!="string"&&typeof e.target!="string"&&r.has(e.source)&&r.has(e.target)?e.style.color:Ki}var Hf=e=>e.style.width,Uf=e=>e.style.dash,_v=1.1,zf=2e3,na={live:650,plain:600},Ee={territoryLive:13,territory:11,frameTitle:11,frameCaption:10.5,pad:2},tr=1.25,Ro=6,oa="no parent, related or wiki-link",Gf=e=>`UNLINKED \xB7 ${e}`,ia=[];function qf(e,r,n){ia=If(n,D.parentOf),e.lineWidth=1/r;for(let i of ia){let a=i.live?H.territory.live:H.territory.plain;e.beginPath(),e.arc(i.x,i.y,i.r,0,nr),e.fillStyle=a.fill,e.fill(),e.strokeStyle=a.stroke,e.stroke()}let o=D.frame;o&&(e.save(),e.setLineDash([4/r,4/r]),e.beginPath(),e.roundRect(o.x,o.y,o.w,o.h,10),e.fillStyle=H.frame.fill,e.fill(),e.strokeStyle=H.frame.stroke,e.stroke(),e.restore())}var aa=new Map;function Wf(){aa.clear()}var Ao=null;function Jf(){let e=D.frame;return e?(Ao??(Ao=document.createElement("canvas").getContext("2d")),{w:Math.max(rr(Ao,"display",Gf(e.count),Ee.frameTitle),rr(Ao,"sans",oa,Ee.frameCaption)),above:Ro+Ee.frameTitle*tr,below:Ro+Ee.frameCaption*tr}):{w:0,above:0,below:0}}function rr(e,r,n,o){let i=`${r}\0${n}`,a=aa.get(i);return a===void 0&&(e.font=r==="sans"?H.font(100):H.displayFont(100),a=e.measureText(n).width,aa.set(i,a)),a*o/100}function bv(e){let r=e.getTransform();return{x:-r.e/r.a,y:-r.f/r.d,w:e.canvas.width/r.a,h:e.canvas.height/r.d}}var Pf=e=>e&&new Set([...e].map(r=>r.id));function Xf(e,r,n){let o=[],i=en(r),a=i*tr/r,s=D.frame;if(s){let f=Gf(s.count),h=Ee.frameTitle*tr/r,d=s.y-Ro/r-h;o.push({text:f,x:s.x,y:d,w:rr(e,"display",f,Ee.frameTitle)/r,h,priority:zf+1,ax:s.x,ay:d,align:"left",font:H.displayFont(Ee.frameTitle/r),color:H.frame.title,halo:!1});let p=s.y+s.h+Ro/r;o.push({text:oa,x:s.x,y:p,w:rr(e,"sans",oa,Ee.frameCaption)/r,h:Ee.frameCaption*tr/r,priority:zf,ax:s.x,ay:p,align:"left",font:H.font(Ee.frameCaption/r),color:H.frame.caption,halo:!1})}let l=new Set;if(r<_v)for(let f of ia){l.add(f.root);let h=f.live?Ee.territoryLive:Ee.territory,d=ea(f.name).toUpperCase(),p=rr(e,"display",d,h)/r,m=h*tr/r,v=f.y-f.r-3/r-m;o.push({text:d,x:f.x-p/2,y:v,w:p,h:m,priority:(f.live?na.live:na.plain)+Math.min(f.members,49),ax:f.x,ay:v,align:"center",font:H.displayFont(h/r),color:f.live?H.territory.live.name:H.territory.plain.name,halo:!0})}let u={selected:D.selected?.id??null,hovered:D.hovered?.id??null,hoverNear:Pf(D.focusNodes),selectedNear:D.selectedNear,lit:Pf(D.family??D.lit)},c=D.local?0:Af(r);for(let f of n){if(Bf(f))continue;let h=Cf(f,u,f.style.core);if(h<c||l.has(f.id)&&h<na.plain)continue;let d=ea(f.name),p=rr(e,"sans",d,i)/r,m=f.x??0,v=(f.y??0)+f.style.radius*(f.style.shape==="diamond"?sa:1)+3/r;o.push({text:d,x:m-p/2,y:v,w:p,h:a,priority:h,ax:m,ay:v,align:"center",font:D.font,color:h>=700?H.labelStrong:_o,halo:!0})}e.save(),e.textBaseline="top",e.lineJoin="round",e.lineWidth=3/r,e.strokeStyle=H.labelHalo;for(let f of Rf(o,bv(e),Ee.pad/r))e.font=f.font,e.textAlign=f.align,f.halo&&e.strokeText(f.text,f.ax,f.ay),e.fillStyle=f.color,e.fillText(f.text,f.ax,f.ay);e.restore()}function Vf(e){let r=new URLSearchParams(e),n=r.get("focus")||null,o=Number(r.get("depth")),i=r.get("highlight");return{focus:n,depth:n!==null&&(o===1||o===2)?o:null,scope:r.get("scope")==="all"?"all":"live",highlight:i!==null&&/^(tag|domain):./.test(i)?i:null}}function Yf(e,r){let n=new URLSearchParams(e),o=(a,s)=>s===null?n.delete(a):n.set(a,s);"focus"in r&&o("focus",r.focus??null),"depth"in r&&o("depth",r.depth==null?null:String(r.depth)),"scope"in r&&o("scope",r.scope==="all"?"all":null),"highlight"in r&&o("highlight",r.highlight??null);let i=n.toString().replace(/%2C/gi,",").replace(/%3A/gi,":");return i?`?${i}`:""}function Zf(e){return e.selected?e.depth!==null?"local":"selection":"overview"}function or(){return Vf(location.search)}function Pt(e){let r=new URL(location.href);r.search=Yf(r.search,e),history.replaceState(history.state,"",r)}var Kf=[["live","Live work"],["unlinked","Unlinked"],["activity","Activity"],["highlight","Highlight"]],wv={left:{share:.21,min:220,max:300},right:{share:.28,min:280,max:420}},kv=160,Cv=640;function E(e,r={},...n){let o=document.createElement(e);for(let[i,a]of Object.entries(r))i==="class"?o.className=a:o.setAttribute(i,a);return o.append(...n),o}function Av(e,r){let n=`sec-${e}`,o=E("span",{class:"count"}),i=E("button",{class:"sec-head",type:"button","aria-expanded":"true","aria-controls":n},E("span",{class:"label"},r),o,E("span",{class:"chev","aria-hidden":"true"},"\u25BE")),a=E("div",{class:"sec-body",id:n});i.addEventListener("click",()=>{let l=i.getAttribute("aria-expanded")!=="true";i.setAttribute("aria-expanded",String(l)),a.hidden=!l});let s=E("section",{class:"sec",id:e,hidden:""},E("h2",{},i),a);return{root:s,body:a,setCount:l=>{o.textContent=l},show:()=>{s.hidden=!1}}}var Eo=(e,r={})=>E("button",{class:"btn",type:"button",...r},e);function eh(){let e=E("div",{id:"app"}),r=E("div",{id:"scope",role:"group","aria-label":"Scope"}),n=E("div",{id:"search"}),o={knowledge:Eo("Knowledge",{"aria-pressed":"true",title:"Show or hide Knowledge notes"}),fit:Eo("Fit",{title:"Fit the graph to the view"}),relayout:Eo("Re-layout",{title:"Lay the graph out again"}),legend:Eo("?",{class:"btn icon","aria-label":"Legend","aria-expanded":"false","aria-controls":"legend",title:"Legend"})},i=E("div",{id:"legend",class:"popover",role:"dialog","aria-label":"Legend",hidden:""}),a=E("header",{id:"head"},E("div",{class:"brand"},"HAFEZ",E("span",{},"GRAPH")),r,n,E("div",{id:"tools"},o.knowledge,o.fit,o.relayout,o.legend,i)),s=Object.fromEntries(Kf.map(([v,x])=>[v,Av(v,x)])),l=E("nav",{id:"left",class:"side","aria-label":"Vault"},...Kf.map(([v])=>s[v].root)),u=E("main",{id:"canvas","aria-label":"Graph"}),c=E("div",{id:"note"}),f=E("aside",{id:"right",class:"side","aria-label":"Note"},c),h={left:Qf("left"),right:Qf("right")},d={...h},p=()=>{e.style.setProperty("--left",`${h.left}px`),e.style.setProperty("--right",`${h.right}px`),l.inert=h.left===0,f.inert=h.right===0},m=v=>{let x=E("div",{class:"grip",role:"separator","aria-orientation":"vertical","aria-label":`Resize the ${v} sidebar`,title:"Drag to resize \xB7 double-click to collapse or restore"});return x.addEventListener("pointerdown",g=>{x.setPointerCapture(g.pointerId),x.classList.add("drag");let b=g.clientX,k=h[v],y=w=>{let C=Math.min(Cv,Math.max(0,k+(v==="left"?w.clientX-b:b-w.clientX)));h[v]=C<kv?0:C,p()},_=()=>{x.removeEventListener("pointermove",y),x.classList.remove("drag"),h[v]&&(d[v]=h[v])};x.addEventListener("pointermove",y),x.addEventListener("pointerup",_,{once:!0})}),x.addEventListener("dblclick",()=>{h[v]=h[v]?0:d[v],p()}),x};return e.append(a,l,m("left"),u,m("right"),f),p(),document.body.append(e),{scope:r,search:n,tools:o,legend:i,sections:s,canvas:u,note:c}}function Qf(e){let{share:r,min:n,max:o}=wv[e];return Math.round(Math.min(o,Math.max(n,window.innerWidth*r)))}var ir=or().scope,Do=!0,tn=null,th=null,So=e=>e.kind==="entity"||e.kind==="knowledge";function Ot(e){return So(e)?e.kind==="knowledge"?Do:ir==="all"||D.live(e):!1}function rh(e){return!So(e)||Ot(e)?null:e.kind==="knowledge"?(ca(!0),"knowledge"):(ua("all"),"scope")}function ua(e){if(ir=e,tn)for(let r of["live","all"])tn[r].setAttribute("aria-pressed",String(r===ir));Pt({scope:ir})}function ca(e){Do=e,th?.setAttribute("aria-pressed",String(e))}function nh(e,r,n){let o=(i,a,s)=>{let l=E("button",{class:"btn",type:"button",title:s},a);return l.addEventListener("click",()=>{ir!==i&&(ua(i),n())}),l};tn={live:o("live","Live work","Hide done work"),all:o("all","Everything","Show the whole Vault, done work included")},e.append(tn.live,tn.all),ua(ir),th=r,ca(Do),r.addEventListener("click",()=>{ca(!Do),n()})}var fa=null,ha=null,da=()=>{};function oh(e){da=e}function ih(e){fa=e,To(),da()}function Mo(e){ha=e,To(),da()}function To(){D.lit=fa?new Set(D.nodes.filter(fa)):null,D.family=ha===null?null:Rv(ha)}function Rv(e){let r=new Set([e]);for(let n of D.links){if(n.relation!=="parent")continue;let o=ue(n.source),i=ue(n.target);o===e&&r.add(i),i===e&&r.add(o)}return new Set(D.nodes.filter(n=>r.has(n.id)))}var ah=or(),yt=ah.depth,rn=ah.focus,No=rn,sh=[];function Fo(e){return e===rn?!1:(rn=e,Pt({focus:e}),!0)}function pa(){return yt}function nn(){return yt!==null}function lh(e){yt=e,Pt({depth:yt});for(let[r,n]of sh)n.setAttribute("aria-pressed",String(r===yt))}function uh(e,r,n){if(yt===null||rn===null)return e;let o=r.find(u=>u.id===rn);if(!o)return e;let i=e.includes(o)?e:[...e,o],a=new Set(i.map(u=>u.id)),s=new Set([o.id]),l=new Set([o.id]);for(let u=0;u<yt;u++){let c=new Set;for(let f of n){let h=ue(f.source),d=ue(f.target);!a.has(h)||!a.has(d)||(l.has(h)&&!s.has(d)&&(s.add(d),c.add(d)),l.has(d)&&!s.has(h)&&(s.add(h),c.add(h)))}l=c}return i.filter(u=>s.has(u.id))}function ch(e){let r=E("div",{class:"depth",role:"group","aria-label":"Local graph"},E("span",{class:"label","aria-hidden":"true"},"Local graph"));return sh=[[null,"Off","Show the whole graph"],[1,"1","Show this note and its neighbours"],[2,"2","Show this note and two links out"]].map(([n,o,i])=>{let a=E("button",{class:"btn",type:"button",title:i,"aria-pressed":String(n===yt),"aria-label":n===null?"Local graph off":`Local graph depth ${n}`},o);return a.addEventListener("click",()=>e(n)),r.append(a),[n,a]}),r}function ma(){let e=uh(D.nodes.filter(Ot),D.nodes,D.links),r=new Map(e.map(i=>[i.id,i])),n=D.links.filter(i=>r.has(ue(i.source))&&r.has(ue(i.target)));To();let o=i=>r.has(D.parentOf.get(i.id)??"");for(let i of n){let a=r.get(ue(i.source)),s=r.get(ue(i.target));a.x===void 0&&s.x!==void 0&&!o(a)?fh(a,s):s.x===void 0&&a.x!==void 0&&!o(s)&&fh(s,a)}return Nf(e,D.parentOf),{nodes:e,links:n}}function fh(e,r){e.x=(r.x??0)+(Math.random()-.5)*10,e.y=(r.y??0)+(Math.random()-.5)*10}function hh(e,r){if(D.hovered=e,D.focusNodes.clear(),D.focusLinks.clear(),!!e){D.focusNodes.add(e);for(let n of r)if(!(ue(n.source)!==e.id&&ue(n.target)!==e.id)){D.focusLinks.add(n);for(let o of[n.source,n.target])typeof o!="string"&&D.focusNodes.add(o)}}}function on(e,r){if(D.selectedNear.clear(),!!e)for(let n of r){let o=ue(n.source),i=ue(n.target);o===e.id&&D.selectedNear.add(i),i===e.id&&D.selectedNear.add(o)}}function ga(e,r,n,o,i){let a=new Set;for(let s of r){if(s.relation!==o)continue;let l=ue(s.source),u=ue(s.target);l===e.id&&i!=="in"&&a.add(u),u===e.id&&i!=="out"&&a.add(l)}return a.delete(e.id),[...a].flatMap(s=>n.get(s)??[]).sort((s,l)=>s.name.localeCompare(l.name))}var xa={};os(xa,{decode:()=>an,encode:()=>_t,format:()=>ar,parse:()=>sn});var dh={};function Ev(e){let r=dh[e];if(r)return r;r=dh[e]=[];for(let n=0;n<128;n++){let o=String.fromCharCode(n);r.push(o)}for(let n=0;n<e.length;n++){let o=e.charCodeAt(n);r[o]="%"+("0"+o.toString(16).toUpperCase()).slice(-2)}return r}function Io(e,r){typeof r!="string"&&(r=Io.defaultChars);let n=Ev(r);return e.replace(/(%[a-f0-9]{2})+/gi,function(o){let i="";for(let a=0,s=o.length;a<s;a+=3){let l=parseInt(o.slice(a+1,a+3),16);if(l<128){i+=n[l];continue}if((l&224)===192&&a+3<s){let u=parseInt(o.slice(a+4,a+6),16);if((u&192)===128){let c=l<<6&1984|u&63;c<128?i+="\uFFFD\uFFFD":i+=String.fromCharCode(c),a+=3;continue}}if((l&240)===224&&a+6<s){let u=parseInt(o.slice(a+4,a+6),16),c=parseInt(o.slice(a+7,a+9),16);if((u&192)===128&&(c&192)===128){let f=l<<12&61440|u<<6&4032|c&63;f<2048||f>=55296&&f<=57343?i+="\uFFFD\uFFFD\uFFFD":i+=String.fromCharCode(f),a+=6;continue}}if((l&248)===240&&a+9<s){let u=parseInt(o.slice(a+4,a+6),16),c=parseInt(o.slice(a+7,a+9),16),f=parseInt(o.slice(a+10,a+12),16);if((u&192)===128&&(c&192)===128&&(f&192)===128){let h=l<<18&1835008|u<<12&258048|c<<6&4032|f&63;h<65536||h>1114111?i+="\uFFFD\uFFFD\uFFFD\uFFFD":(h-=65536,i+=String.fromCharCode(55296+(h>>10),56320+(h&1023))),a+=9;continue}}i+="\uFFFD"}return i})}Io.defaultChars=";/?:@&=+$,#";Io.componentChars="";var an=Io;var ph={};function Dv(e){let r=ph[e];if(r)return r;r=ph[e]=[];for(let n=0;n<128;n++){let o=String.fromCharCode(n);/^[0-9a-z]$/i.test(o)?r.push(o):r.push("%"+("0"+n.toString(16).toUpperCase()).slice(-2))}for(let n=0;n<e.length;n++)r[e.charCodeAt(n)]=e[n];return r}function Lo(e,r,n){typeof r!="string"&&(n=r,r=Lo.defaultChars),typeof n>"u"&&(n=!0);let o=Dv(r),i="";for(let a=0,s=e.length;a<s;a++){let l=e.charCodeAt(a);if(n&&l===37&&a+2<s&&/^[0-9a-f]{2}$/i.test(e.slice(a+1,a+3))){i+=e.slice(a,a+3),a+=2;continue}if(l<128){i+=o[l];continue}if(l>=55296&&l<=57343){if(l>=55296&&l<=56319&&a+1<s){let u=e.charCodeAt(a+1);if(u>=56320&&u<=57343){i+=encodeURIComponent(e[a]+e[a+1]),a++;continue}}i+="%EF%BF%BD";continue}i+=encodeURIComponent(e[a])}return i}Lo.defaultChars=";/?:@&=+$,-_.!~*'()#";Lo.componentChars="-_.!~*'()";var _t=Lo;function ar(e){let r="";return r+=e.protocol||"",r+=e.slashes?"//":"",r+=e.auth?e.auth+"@":"",e.hostname&&e.hostname.indexOf(":")!==-1?r+="["+e.hostname+"]":r+=e.hostname||"",r+=e.port?":"+e.port:"",r+=e.pathname||"",r+=e.search||"",r+=e.hash||"",r}function zo(){this.protocol=null,this.slashes=null,this.auth=null,this.port=null,this.hostname=null,this.hash=null,this.search=null,this.pathname=null}var Sv=/^([a-z0-9.+-]+:)/i,Mv=/:[0-9]*$/,Tv=/^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/,Nv=["<",">",'"',"`"," ","\r",`
41
+ `," "],Fv=["{","}","|","\\","^","`"].concat(Nv),Iv=["'"].concat(Fv),mh=["%","/","?",";","#"].concat(Iv),gh=["/","?","#"],Lv=255,xh=/^[+a-z0-9A-Z_-]{0,63}$/,zv=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,vh={javascript:!0,"javascript:":!0},yh={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0};function Pv(e,r){if(e&&e instanceof zo)return e;let n=new zo;return n.parse(e,r),n}zo.prototype.parse=function(e,r){let n,o,i,a=e;if(a=a.trim(),!r&&e.split("#").length===1){let c=Tv.exec(a);if(c)return this.pathname=c[1],c[2]&&(this.search=c[2]),this}let s=Sv.exec(a);if(s&&(s=s[0],n=s.toLowerCase(),this.protocol=s,a=a.substr(s.length)),(r||s||a.match(/^\/\/[^@\/]+@[^@\/]+/))&&(i=a.substr(0,2)==="//",i&&!(s&&vh[s])&&(a=a.substr(2),this.slashes=!0)),!vh[s]&&(i||s&&!yh[s])){let c=-1;for(let m=0;m<gh.length;m++)o=a.indexOf(gh[m]),o!==-1&&(c===-1||o<c)&&(c=o);let f,h;c===-1?h=a.lastIndexOf("@"):h=a.lastIndexOf("@",c),h!==-1&&(f=a.slice(0,h),a=a.slice(h+1),this.auth=f),c=-1;for(let m=0;m<mh.length;m++)o=a.indexOf(mh[m]),o!==-1&&(c===-1||o<c)&&(c=o);c===-1&&(c=a.length),a[c-1]===":"&&c--;let d=a.slice(0,c);a=a.slice(c),this.parseHost(d),this.hostname=this.hostname||"";let p=this.hostname[0]==="["&&this.hostname[this.hostname.length-1]==="]";if(!p){let m=this.hostname.split(/\./);for(let v=0,x=m.length;v<x;v++){let g=m[v];if(g&&!g.match(xh)){let b="";for(let k=0,y=g.length;k<y;k++)g.charCodeAt(k)>127?b+="x":b+=g[k];if(!b.match(xh)){let k=m.slice(0,v),y=m.slice(v+1),_=g.match(zv);_&&(k.push(_[1]),y.unshift(_[2])),y.length&&(a=y.join(".")+a),this.hostname=k.join(".");break}}}}this.hostname.length>Lv&&(this.hostname=""),p&&(this.hostname=this.hostname.substr(1,this.hostname.length-2))}let l=a.indexOf("#");l!==-1&&(this.hash=a.substr(l),a=a.slice(0,l));let u=a.indexOf("?");return u!==-1&&(this.search=a.substr(u),a=a.slice(0,u)),a&&(this.pathname=a),yh[n]&&this.hostname&&!this.pathname&&(this.pathname=""),this};zo.prototype.parseHost=function(e){let r=Mv.exec(e);r&&(r=r[0],r!==":"&&(this.port=r.substr(1)),e=e.substr(0,e.length-r.length)),e&&(this.hostname=e)};var sn=Pv;var wa={};os(wa,{Any:()=>va,Cc:()=>ya,Cf:()=>Ov,P:()=>ln,S:()=>_a,Z:()=>ba});var va=/[\0-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/,ya=/[\0-\x1F\x7F-\x9F]/,Ov=/[\xAD\u0600-\u0605\u061C\u06DD\u070F\u0890\u0891\u08E2\u180E\u200B-\u200F\u202A-\u202E\u2060-\u2064\u2066-\u206F\uFEFF\uFFF9-\uFFFB]|\uD804[\uDCBD\uDCCD]|\uD80D[\uDC30-\uDC3F]|\uD82F[\uDCA0-\uDCA3]|\uD834[\uDD73-\uDD7A]|\uDB40[\uDC01\uDC20-\uDC7F]/,ln=/[!-#%-\*,-\/:;\?@\[-\]_\{\}\xA1\xA7\xAB\xB6\xB7\xBB\xBF\u037E\u0387\u055A-\u055F\u0589\u058A\u05BE\u05C0\u05C3\u05C6\u05F3\u05F4\u0609\u060A\u060C\u060D\u061B\u061D-\u061F\u066A-\u066D\u06D4\u0700-\u070D\u07F7-\u07F9\u0830-\u083E\u085E\u0964\u0965\u0970\u09FD\u0A76\u0AF0\u0C77\u0C84\u0DF4\u0E4F\u0E5A\u0E5B\u0F04-\u0F12\u0F14\u0F3A-\u0F3D\u0F85\u0FD0-\u0FD4\u0FD9\u0FDA\u104A-\u104F\u10FB\u1360-\u1368\u1400\u166E\u169B\u169C\u16EB-\u16ED\u1735\u1736\u17D4-\u17D6\u17D8-\u17DA\u1800-\u180A\u1944\u1945\u1A1E\u1A1F\u1AA0-\u1AA6\u1AA8-\u1AAD\u1B4E\u1B4F\u1B5A-\u1B60\u1B7D-\u1B7F\u1BFC-\u1BFF\u1C3B-\u1C3F\u1C7E\u1C7F\u1CC0-\u1CC7\u1CD3\u2010-\u2027\u2030-\u2043\u2045-\u2051\u2053-\u205E\u207D\u207E\u208D\u208E\u2308-\u230B\u2329\u232A\u2768-\u2775\u27C5\u27C6\u27E6-\u27EF\u2983-\u2998\u29D8-\u29DB\u29FC\u29FD\u2CF9-\u2CFC\u2CFE\u2CFF\u2D70\u2E00-\u2E2E\u2E30-\u2E4F\u2E52-\u2E5D\u3001-\u3003\u3008-\u3011\u3014-\u301F\u3030\u303D\u30A0\u30FB\uA4FE\uA4FF\uA60D-\uA60F\uA673\uA67E\uA6F2-\uA6F7\uA874-\uA877\uA8CE\uA8CF\uA8F8-\uA8FA\uA8FC\uA92E\uA92F\uA95F\uA9C1-\uA9CD\uA9DE\uA9DF\uAA5C-\uAA5F\uAADE\uAADF\uAAF0\uAAF1\uABEB\uFD3E\uFD3F\uFE10-\uFE19\uFE30-\uFE52\uFE54-\uFE61\uFE63\uFE68\uFE6A\uFE6B\uFF01-\uFF03\uFF05-\uFF0A\uFF0C-\uFF0F\uFF1A\uFF1B\uFF1F\uFF20\uFF3B-\uFF3D\uFF3F\uFF5B\uFF5D\uFF5F-\uFF65]|\uD800[\uDD00-\uDD02\uDF9F\uDFD0]|\uD801\uDD6F|\uD802[\uDC57\uDD1F\uDD3F\uDE50-\uDE58\uDE7F\uDEF0-\uDEF6\uDF39-\uDF3F\uDF99-\uDF9C]|\uD803[\uDD6E\uDEAD\uDED0\uDF55-\uDF59\uDF86-\uDF89]|\uD804[\uDC47-\uDC4D\uDCBB\uDCBC\uDCBE-\uDCC1\uDD40-\uDD43\uDD74\uDD75\uDDC5-\uDDC8\uDDCD\uDDDB\uDDDD-\uDDDF\uDE38-\uDE3D\uDEA9\uDFD4\uDFD5\uDFD7\uDFD8]|\uD805[\uDC4B-\uDC4F\uDC5A\uDC5B\uDC5D\uDCC6\uDDC1-\uDDD7\uDE41-\uDE43\uDE60-\uDE6C\uDEB9\uDF3C-\uDF3E]|\uD806[\uDC3B\uDD44-\uDD46\uDDE2\uDE3F-\uDE46\uDE9A-\uDE9C\uDE9E-\uDEA2\uDF00-\uDF09\uDFE1]|\uD807[\uDC41-\uDC45\uDC70\uDC71\uDEF7\uDEF8\uDF43-\uDF4F\uDFFF]|\uD809[\uDC70-\uDC74]|\uD80B[\uDFF1\uDFF2]|\uD81A[\uDE6E\uDE6F\uDEF5\uDF37-\uDF3B\uDF44]|\uD81B[\uDD6D-\uDD6F\uDE97-\uDE9A\uDFE2]|\uD82F\uDC9F|\uD836[\uDE87-\uDE8B]|\uD839\uDDFF|\uD83A[\uDD5E\uDD5F]/,_a=/[\$\+<->\^`\|~\xA2-\xA6\xA8\xA9\xAC\xAE-\xB1\xB4\xB8\xD7\xF7\u02C2-\u02C5\u02D2-\u02DF\u02E5-\u02EB\u02ED\u02EF-\u02FF\u0375\u0384\u0385\u03F6\u0482\u058D-\u058F\u0606-\u0608\u060B\u060E\u060F\u06DE\u06E9\u06FD\u06FE\u07F6\u07FE\u07FF\u0888\u09F2\u09F3\u09FA\u09FB\u0AF1\u0B70\u0BF3-\u0BFA\u0C7F\u0D4F\u0D79\u0E3F\u0F01-\u0F03\u0F13\u0F15-\u0F17\u0F1A-\u0F1F\u0F34\u0F36\u0F38\u0FBE-\u0FC5\u0FC7-\u0FCC\u0FCE\u0FCF\u0FD5-\u0FD8\u109E\u109F\u1390-\u1399\u166D\u17DB\u1940\u19DE-\u19FF\u1B61-\u1B6A\u1B74-\u1B7C\u1FBD\u1FBF-\u1FC1\u1FCD-\u1FCF\u1FDD-\u1FDF\u1FED-\u1FEF\u1FFD\u1FFE\u2044\u2052\u207A-\u207C\u208A-\u208C\u20A0-\u20C1\u2100\u2101\u2103-\u2106\u2108\u2109\u2114\u2116-\u2118\u211E-\u2123\u2125\u2127\u2129\u212E\u213A\u213B\u2140-\u2144\u214A-\u214D\u214F\u218A\u218B\u2190-\u2307\u230C-\u2328\u232B-\u2429\u2440-\u244A\u249C-\u24E9\u2500-\u2767\u2794-\u27C4\u27C7-\u27E5\u27F0-\u2982\u2999-\u29D7\u29DC-\u29FB\u29FE-\u2B73\u2B76-\u2BFF\u2CE5-\u2CEA\u2E50\u2E51\u2E80-\u2E99\u2E9B-\u2EF3\u2F00-\u2FD5\u2FF0-\u2FFF\u3004\u3012\u3013\u3020\u3036\u3037\u303E\u303F\u309B\u309C\u3190\u3191\u3196-\u319F\u31C0-\u31E5\u31EF\u3200-\u321E\u322A-\u3247\u3250\u3260-\u327F\u328A-\u32B0\u32C0-\u33FF\u4DC0-\u4DFF\uA490-\uA4C6\uA700-\uA716\uA720\uA721\uA789\uA78A\uA828-\uA82B\uA836-\uA839\uAA77-\uAA79\uAB5B\uAB6A\uAB6B\uFB29\uFBB2-\uFBD2\uFD40-\uFD4F\uFD90\uFD91\uFDC8-\uFDCF\uFDFC-\uFDFF\uFE62\uFE64-\uFE66\uFE69\uFF04\uFF0B\uFF1C-\uFF1E\uFF3E\uFF40\uFF5C\uFF5E\uFFE0-\uFFE6\uFFE8-\uFFEE\uFFFC\uFFFD]|\uD800[\uDD37-\uDD3F\uDD79-\uDD89\uDD8C-\uDD8E\uDD90-\uDD9C\uDDA0\uDDD0-\uDDFC]|\uD802[\uDC77\uDC78\uDEC8]|\uD803[\uDD8E\uDD8F\uDED1-\uDED8]|\uD805\uDF3F|\uD807[\uDFD5-\uDFF1]|\uD81A[\uDF3C-\uDF3F\uDF45]|\uD82F\uDC9C|\uD833[\uDC00-\uDCEF\uDCFA-\uDCFC\uDD00-\uDEB3\uDEBA-\uDED0\uDEE0-\uDEF0\uDF50-\uDFC3]|\uD834[\uDC00-\uDCF5\uDD00-\uDD26\uDD29-\uDD64\uDD6A-\uDD6C\uDD83\uDD84\uDD8C-\uDDA9\uDDAE-\uDDEA\uDE00-\uDE41\uDE45\uDF00-\uDF56]|\uD835[\uDEC1\uDEDB\uDEFB\uDF15\uDF35\uDF4F\uDF6F\uDF89\uDFA9\uDFC3]|\uD836[\uDC00-\uDDFF\uDE37-\uDE3A\uDE6D-\uDE74\uDE76-\uDE83\uDE85\uDE86]|\uD838[\uDD4F\uDEFF]|\uD83B[\uDCAC\uDCB0\uDD2E\uDEF0\uDEF1]|\uD83C[\uDC00-\uDC2B\uDC30-\uDC93\uDCA0-\uDCAE\uDCB1-\uDCBF\uDCC1-\uDCCF\uDCD1-\uDCF5\uDD0D-\uDDAD\uDDE6-\uDE02\uDE10-\uDE3B\uDE40-\uDE48\uDE50\uDE51\uDE60-\uDE65\uDF00-\uDFFF]|\uD83D[\uDC00-\uDED8\uDEDC-\uDEEC\uDEF0-\uDEFC\uDF00-\uDFD9\uDFE0-\uDFEB\uDFF0]|\uD83E[\uDC00-\uDC0B\uDC10-\uDC47\uDC50-\uDC59\uDC60-\uDC87\uDC90-\uDCAD\uDCB0-\uDCBB\uDCC0\uDCC1\uDCD0-\uDCD8\uDD00-\uDE57\uDE60-\uDE6D\uDE70-\uDE7C\uDE80-\uDE8A\uDE8E-\uDEC6\uDEC8\uDECD-\uDEDC\uDEDF-\uDEEA\uDEEF-\uDEF8\uDF00-\uDF92\uDF94-\uDFEF\uDFFA]/,ba=/[ \xA0\u1680\u2000-\u200A\u2028\u2029\u202F\u205F\u3000]/;var Bv=[8364,0,8218,402,8222,8230,8224,8225,710,8240,352,8249,338,0,381,0,0,8216,8217,8220,8221,8226,8211,8212,732,8482,353,8250,339,0,382,376];function jv(e){return e===0||e>=55296&&e<=57343||e>1114111}function _h(e){return jv(e)?65533:e>=128&&e<=159&&Bv[e-128]||e}function bh(e){return e-1>>>0<127||e-160>>>0<55136?String.fromCharCode(e):String.fromCodePoint(_h(e))}var qe=(()=>{let e=new Uint8Array(127),r=0;for(let n=33;n<=126;n++)n!==34&&n!==36&&n!==92&&(e[n]=r++);return e})();function wh(e,r,n,o,i,a){let l=e.length,u=a*90,c=0,f=()=>{let S=qe[e.charCodeAt(c++)];return S<a?S:S*91-u+qe[e.charCodeAt(c++)]},h=n-o,d=n+i,p=new Int32Array(d);p.fill(-1,o,a),p.fill(-1,a+h,d);let m=new Int32Array(d),v=new Int32Array(d);function x(S,N){let T=0,L=N,B=N+S;for(;L<B;){let A=qe[e.charCodeAt(c++)];if(A<89)T+=A,p[L++]=T;else if(A===89){let F=qe[e.charCodeAt(c++)]+2;for(;F--;)p[L++]=++T}else{let F=qe[e.charCodeAt(c++)];T+=89+(F<90?F*91+qe[e.charCodeAt(c++)]:qe[e.charCodeAt(c++)]*8281+qe[e.charCodeAt(c++)]*91+qe[e.charCodeAt(c++)]),p[L++]=T}}}x(o,0),x(h,a);let g=new Int32Array(i*2),b=0,k=0;function y(S,N){for(let T=0;T<S;T++){let L=N+T,B=f(),A=f();g[k*2]=B,g[k*2+1]=A,k+=1,m[L]=b;let F=(p[B]<0?v[B]:1)+(p[A]<0?v[A]:1);v[L]=F,b+=F}}y(i-a+o,a+h),y(a-o,o);let _=new Uint16Array(b),w=0;for(let S=0;S<k;S++)for(let N=0;N<2;N++){let T=g[S*2+N],L=p[T];if(L<0){let B=m[T],A=B+v[T];for(;B<A;)_[w++]=_[B++]}else _[w++]=L}let C=new Uint16Array(r),R=0;for(;c<l;){let S=qe[e.charCodeAt(c++)];S>=a&&(S=S*91-u+qe[e.charCodeAt(c++)]);let N=p[S];if(N<0){let T=m[S],L=T+v[S];for(;T<L;)C[R++]=_[T++]}else C[R++]=N}return C}var kh=wh("!}.&u%}'&}*'~!6*)%&,~!J~!J~%L~y<~!R,~~%Lu~~#GD~~#|)1#%}^%}2%+#.##%##%}&%##%'#%##&%#%#'%#&#%#&#'#%%#&#%##%#)%''%&%#%#'%#%%#%%}%%%#%#&(23#%%#&-%0%('1#(##%#'##+%'*.:1}#%#6-+(%'%%#%%%}#L'2351&('%}&/N'(0(/*-%(%%}#'+&T%7.2}#&%&#%#36/5##%&%%#&#%%#))2%%##%&&'0~!#*+&'%1~!%).'3q?&%'1~!.##%6(~!+%%%(Gw'rT~!E#<nA%#jZ~!H%(~!42##~!*31&~!G%U~#)5~#`3~!J~!Z~%]~%Y~%C~!q~!u~#kz~%#~!6'~!D~!U~!?~#T~!c%~!G#'~%7|~!G~!J~!G&~#pb~(Df}#%}*&}#%##%##%##&#-}&'#'&%#.++}%mI,#,@&(}*%}*'%&##&#%##%}&0}#.},U},%}+%}&%}#%##&}B%(}(%}+%)})%##%#&}&%##%&}<%}>%#%&}*%}(%}9%}/%})%}*%}*%}?&}&%}3%}&*#%})%#%#)}#&#-#+*%E%%'%'#%}#*V##&##I}#&&##%&%#&&Qf%%))w/0+&%#(#.%-''''++++7}>%4'',##1,#%#&%##&#'##&#*#9)%&%}#*}%,#+P(%A&%#'&##wSD',9E00#y#@}(+}&%&>~!#~!X}#*}(&&}(&}(,%}%&#+&}#&}I%#%}%)#(},'%#*}4%%#%}(''}#/##(##),%-##%%)#&}(.}&%#&}%%}*&#%},&&}&%}#%*'#%})%}D&}&%}-&}6&#&}-,%}#%})-(~+`~,=?~I9'9%~!,#%})%})%}@%}?%}(~!?~#<~#pP~#BG~#=1#%K+~#?#~%;)~#A~#mF1~#A'~'X%'~#lR~#N~'N~#r~#m#-~#i'?%#'%~#B%##%,%#~#_%#0%~#]732~,w~2+#:&#%&'0%&>%}#>##F+)#%&&#(+_}4&}-%}(&}@&}O7Fdf0@+/v4}&WU##&/0#&'('B#%}.%}'+#%}#%%&#&%#%##+#&#)#6#'#.},%}c%},%#%##%&#&%#&~#>'*-.%##%##%}#%%}%'~#)D1}#%*&~#_%%'(~#S2%'.}#~#=##*'*-%}&'%'##&&~'E%.#&~#M4}%%##&'%#~#O1##%&#'+~#<B%##%%'%+~#;#@%}#&%#&&%#(~#H1}'%'##&&~#?A}&'~#D#%32}'&&&&~#[}'(#%}'~#;C})&}%%#%~#=&%,3}%'(#%%~#^'#&&)#%'~#Y%-~#d-%'~#^%%&#&&&}#~#b~2t*&'~&(~&@~0%~e~3}%*''0})&}+~!9##-}#%-hD*)1fC#%/&/fB#40~!+#)*4~!+~!K'&:~!/*7~!.#~!H~!L':~%x&~!H#~!*~%1~!I#~!+A~#p'~!F~~#-#~,,(~.Z~!V~%;'B'mq-W~!N~%I%#&&#&}#%},%%}'%}+X#%}#&}(%}'%}<%}#%}%%'}'%}:~![)9@~%>~#UA%-%##&~!C%~!-.9:~!1~!-^2/:a~!y,D*J#-5)/4~%23,~#G~!L1~!0X3`~!2+~!!0-~&E~!W~!o,>Y&]~%cZx_&~#O*9#A#'#+I'%#)~!0B*-5A+-((F&*M#)(-7-5+'-3a5Vi~!Y~!?+[)%3),ERHm~!+:D,VG.+)?fB%%*(%)'(#&80%1'8`K8?`+'Z#&O&'H5#*9)A%%5&3))0%39+.*7#()&&*=4@**L)<'_&*+..;(#*+)./&0#3)%')-8(4ixD(&.}%,('aI:,)%,k2231T)I'#/-W7,/'Q#.'Y24+h')37</31&83##&0#),H(?'&?/1##%#&&#%''-%&&&#(&''&#.-'%#%%(,')*'&#&#'##%(%(#%('#&##%%%%('%#%#%%#%#&%##h>w+v<ayvyvcg.uuhKr}g/v|g>u9i[~>g5uI~=RvdwEg;v/g;uk!!TTSx]@RT!U!#!@VBRUU!'UTe-d0c`e&gSdicedFcrdTaqb.kYcAohdYd@a3e+d}dMdtd.aJ#bqcK`dle/e.e'dwdPdodddjbEb}ogd^ofdpduc6j?l%d{drdqc)d7bacOdQ%T#Y)X.sR[yH>6Vyv3[xwLu>vo'!*.[yBacahoj>6Rew3[xqdZa#!a&#^(X-[yG>6Vyu3[xvg3sEr|g.u/Ri9db0T#^(Xa)!-[y;>6Vylg4wKs{JwNZt3@3r=c4Z([xlg;wKt!cpq's@v7A'*a(a+!-a#[y<3Dt?3Dt'>6Vym3[xmg9rxsNJwLZt4~?r?db1T#`-!(Xa,!0[yS>6Vz%NuQs.g4wKtnJwNZtS@3r>c4Z([y%g;wKtrdga8!a(!#&T*Y-Xa#!a0<or[yc3Dtq>6Vz43[y3JwNZtf@3s!Ju}!%Dti:pm3c_%X#tjB5pkd6q!r]u?voC'*-a.a2!0a&a+[yI3DtI3Ds~3DtH>6Vyw3[xx;:s#~<5pKJwNZtE@3r~d`a)!a2T#a.(!+U.X1[yT3Dt`3Dtv>6Vz&3[y&g9rxwzcxstPu.<rAJwLZtT~?r@dZa%!a.&^*Za(/Reu[ya>6Vz23[y1g3sEr}wkg{NuQRg{ci(U#5@b`~,cg#U(2WnH5wugcRh7dX#T(Y,a'Ta!!a,[yZ<]mj>6Vz,3[y+Pv#5ReZKu+=,%!H}7ABwkaS?Rh:BcW(X#<]mrj:ubv/ARekdg%!(!a.*Ta(Y.X1!#sP>Rl*Dt6[y>>6Vyo3Wf*jOvuumvuRgRJuq*!:9<B@bX~3jVv&v@s@5Re[d/rQt{uAvo&a&a*)a2!,0Wf!3Dt0=Bs'>6Re}3[xy~<5s%JwJZt1~Gs)c;&!#2sJkNuXvzq7rxu,Re8dka4!a8(aEZ+a@Y.X1Xa)[yd=Bs(3DtP>6Vz53[y4cX#X&Re:avRe9~<5s&JwJZtQ~Gs*i^rzvdRg+Jv{%!2sbB@bX}kdga,!Za?&^*T1/!a'Dt+[y6>6Vyf3Wf%g/u;s4hGu6?Rh-JvZ,!c%#&RoX54Rivj7uyvf8RgTKvZB%*!2sGh<vu5Rgq<=C::9bb~#dZ#T&Ta6Y.X*Dt>[y93Wf)coZ(T,6VyifluvRgC@95@B@bX~/hFu34cC#T,k/unq8w8Q5RkUklwQuzunq8w8Q5Rk8d/rJu?v8w9)-&!a0a;a&aIWejg3sEr/h1s<DtDJvyZqY5aws3Jvy!&Wei~Hr1:au5@Bag>23E~5c:Z&bX};kKv?w&unuVu5Rjc;>bs)#~@:Rh.=ay<a]C;b`}Vd6s/t{uAvoaxa()!a,a7%-a#a2Dt,[yF2Wo[>6Vyt3[xuNuPRi&NuPwpi#RoWh?vf8Ri%Jv]!%Ri:KvxD!.'2WeAjZu`q9rxu,Re7woeAg-unLq(qA_/*2Wg_g3u5q^9:4E}/jTrxrzv=Wkkd~0UX#^^Xa-a1a5T&a=U1a'*aEa]!a*aPaA-adok[y54Rn>;:p3~Dp5g9rpsFNvZqjg3uJp4~<5p0Pw;5qlJwNZt*@3p1Pw:5p/Ou!5p2JvG'!6Vye=<qnJvh_[xhg3v,Rh3kOwOw-sDuev/Re^dha[a%!%!a+#Ta7)-5TaCaO!aka!a)sf[yb2>Rl!9ARiq5E}Qg=ucRkBE|oJrJ_@Wk~@Wk{JrJ_@Wk|@WkyJrJ_@Wk}@WkzJvO_[y2g-vMRmiKuYC!)&>Ri;>Ri<@3RkNc](X#@9Rk=g5vuRmhKvDB!+'=]meg3u4Rmgd)#Y'Vz3CARmfd`a+!%T'!+#Ta1Ta6TaM-sTDt9[yA9sYd'%Y#s[[xpj:ueunaXRgEjRq,v-vuqdd2'`#6Rev<32@5>:2<E}5xIo9a*X#Y(;5RePJvD_g>vyRgNj8w)v8<wggs:RgXiZt|vjx,hSq3ah!-(~@:Ro/Ou!5RhWj^v(pyw8unRhUdx-UY#^Ua.a3a70!)%UX1TaDa)'omRiRRhE[y:3Dsz=Br,>6Vyj3[xkg6ruwjcqsrPw;5r*Ku]D'Zt-@3r(~?r.i[vwv]dU1a--U#`a4(g/vsRhPOu!5RhLj:rmu9Wo!~@:wdh@g/vsRiTjXuvvNr}:RhBj^v(pyw8unRn]dz1UYa'a+^Y(!aETZalaRY.Ta?a4[yDJw1!#qLsW>6Vyrfzq-pLflpwRe|Js>%!Dt@3Dt&Jvy_[xs~HrnjMuwpsw'RecKu+D#'!t<~Grl~?rjg5u-x,gwp{ah!-(~@:Rg~Ou!5Rh'jXuvvNr}:Rh#cW#X/c;&!#2sLi[v7u7RgpJv)(!iLrxu,Re6j7v@s@5Se[e7d`aW!Za(a`T.a#!a3!&aDa-!9)Dt_=6s+3[x~~DR|h~DS6avhGun5RkZj3w)v-]mkKunB!&*]kb97R|i<ARk<c:Z(6Vy}Juh'!wziMRoS:F|vkLuauJv5vtvQRh1d='T+Y#VyO~DR|jcF#T'7R|g97R|kJv3'!ay<Rj,Jvh&!:ReXcsa6*a+#a#_aIRf9aLRf?c,Z&Rf5Rf7c.Z&Rf;Rf>cQ#%T'p-Rf8Rf=ct#%'(*!,p,Rf4p+Rf6Rf:Rf<d~'Ua%U*^UYa(!a,-!#a4YaTalaEX0a8a<Weo3Dt/3Dsx=Br93Wen~Dr;~<5p<JwNZt2@3p=Pw:5p;Ou!5r3c7&!#:p>3Ds}KvGB)_6Vyk2sM=<r7x'eovA(!hFu1ARf}cV#X&@r5j6rvwQa^Rf3c=Za'wkghJv__g;unRggA53B9=b^}%j6uduo5Jq;!(hIv%2Re`Ou4ARe_e%a#^^^Xa&!a*a2!&a6YaP!*ad!#a:aE/5Rn?[y@>6Vyp;:pE~DrY~<5pBJwNZt8@3pCh=rt3rWPw:5pAJup_[xoNuPpF9c!#'45pD5ARn)d8#X'X*3@rU72s]h>v<<sSjJpqvewOJq/(!hNw'5ReBk0s2u3w/w'5ReE5@Jq.!a+JQ!&WeU23d(#Y&RjG5]jBk!u7w&u0udARjEe#+^^^Ub#!a2/a`Z(agT1!a-a;|@TaG!aS[yV=Re~fow'RguNuPRe?bz#'>RoUWeL>:Cbb|?JwPZtVg6ruRmzJvD'!6Vz(g/vmRh~Jvy_[y(g9voRgyx*cy(#2>Ri2B9b]~9kIw9u7rluJu3Rg]dI#a%UY'@=p%CAx.gQZ&RhwwygtRm{x5g_Z'+ABqR9Woa=Bp&dV#^*Xa'!&@o{g4v]Rk;Jv{!%Rk[wkkiA5RkiwwfUB=x,fUuqC&*!>RfTg8v0RfV~ARfSd;rJsAuAv9wR'ae+/aO!a@aza/a#[yQ@Wg!2Wemg3sEr0JvB_g>uvReWg2v+Re=KupB_+[y!2AbY~-~Hr2AJwD!(h<~El>h<~El?Kun@+_:9b`}Kg-v/Ri3g;vtwyk_9]k_d=&T#*U.6qh@Ab`|K9:H|CJv[!&3Dtex'fDwC%!Rf[9WlMd[(^X,!a%Z06Vz!@WgBg=v~Rgvg,QRe@awd,#Y+jTv|Q~EfWj]uNr|~FRfXdy#Y&^Ua%!aO.!(a)Ua;=!a@aKap!a-,a!Ta]a[rSa]p?[y82sK=Bq~;:p:~<5p8Pw:5p7d'#Y'Wf(;RnRi[u4w&RgJJvG'!6Vyh=<r#ijuuv/sIKuYD'ZtG@3p9~Gr&d2#`(g<vtRgFj`u5w&rqpxRf2CJuY!+:wfnTOu!5Rg}jNs1ucv&RfwJvA!&3@q|BDcC#T,k/unq8w8Q5RkTklwQuzunq8w8Q5Rk9dga#!a'!a=#a0!:+Tb*b@aO.a4!aba8aFJv^}?!VyR~Dr<g;u%Rn.~<5p[x'e`wNZtR@3p]Pw:5pZhNvjBp.woe_g5u-r4JwF!%DtO3:ooc7&!#:p^3DtpLuGw(!+%)Dtk6Vz#2sd=<r8d'#Y([y#<x3gJt`w@!)%}MRiowzikRij=]ilxAf3,U(#B2Rf#g0v-Rm[ck{`U#]giKv3>)!&6Ri154s,KuGB_%@r68r:dJ|t`#X(9<E|u2@H|rx3gJu?w'!+'1Nu7Reg4=H~+9<wxgY95Rm]xLggZ-`(X}U2:Ri4h<uOawRmsJv__5@bb{jbV~3dka#a'a]!,#a+U=a>b6a3b%!/aKa/)!arwve^VyJ;:pR~DpTg3uJpS~<5pOPw;5qmPw:5pNOu!5pQJvG'!6Vyx=<qoJvA!{~Jup!%@qk7Rn/KvyD!}''[xz;>wkh'?Rh,x8gyt`w5D!&),(SgyccRgztJ@3pPB5p#d'(Y#<]mmifubw&RgoJvE&!82s^JvF&!8Rf,ADb]~;x=h'rNu]vK!,%'*0RnORh)4Rh*AqQg-vaRnNg;wHwkh'ba~4cE#Ta*x3gctyw@'!+%RnFRnD<4Rn@hFvK5RnCxWg[#`&a0Ua()`1Rm75Rg[c]%X#qi8Rg^NvdRj>BwzgZauwji7Rm6A4wgg]d1#&(*,.0a#Rm;Rm<Rm=Rm>Rm?Rm@RmARmBe%#^^^Xaea?aC/b+(,!a+a#!a/!>a&Ta<aKbD!2wphBRnk[yPw}hE|.=Br-3Dtm>6Vy~g6urRf.x,hPrNav!%'RnqRo%Ro#Nu;q[Pw;5r+JwNZtM@3r)d'#Y'Weh;xChL#`&RnmRnoKu}>%(!Rne~Bs-;2wjcussJv+'!aYSO}6@B<5?ba~8LrNvj!.%*ROwungw~ng~:9;Ri^>wtnig;wHRnixDh@|(UZ.x1h@|)!#:2<H|*xHn]#-UX'3Ro)z=iT}6ARns=Bwsn_wpnaRncw]aR(#UXa&Ua*a/=]iPd'#Y&Ro'WnXf{QRm2hNvj]nZd`'T~&1`{|`#9b]{}c:'!#Wl{>@=be}]?cl{{U#:5Abb}Jds#^YaF!a*b4a#a3aPa>&Tb!bH!*a_!Eau?/a&RjY<]gj>6Vz*;:pe~DrZg,QRj1JwNZtX@wihspcJvZ&!VyX9WmOJu|!|N2WmHJvh&!]ht~Bpbcn&T(!#RmQ<s7Nu;padH#X'`+WmJ@>RmKCARhnKup=!)&Wf+:RhqNuPpf9c!#'45pd5AwghpARn(Ls@w!%,)!RmP@Wfe<E|IJva!&WmNg8vsRmLd`*.`#Y'Xa!axRn*]hrA8Rhug5s@rXg8u!RmMd8#X'X*3@rV72smdI*#UY&RmICARho~GsgxVgd)Ta'U-Y&Xa!T#RnEWnA@Wffg1uDRi0hFvK5RnBxGnG&#`%owp)@wsf+bX}Ze-*1!a*^^^Ua|!#a.aq&Ya2!a>.a6!a:aO`aJDtL[y`@Wg#>6Vz12@wzoYRoZNuPRi!NuPRhzg=ucRi,@=b`{Yg=ucRi-ACJvB!&Sh[ebSh]ebi`wUuFRm4Jw2_[y0JvB!.<Ju(!&SoG}6Shd}6<Ju(!&SoH}6She}6Kur@._g5vHRieJvx!{L2G{Kx6gd'T#?Rh82Wi5cZ#X(g1w)Rm5dW-Y(Ta#!a)!#aYa=wnfE=su2>>bU{0j9udv:<svj8uQv-7RgHdE%#^'sq9sp=>Bb_{TJv`!&g/r|snj6v(us5d,#Y(56H}[978H}]Jw5!&g1rushJvB!+j;v{u5?zDhd}6}bj;v{u5?zDhe}6}ce*#`(^^^a[aea!=!a6a*aoXb1a.!aAbL!b>,b'aL!aV@Wf|2Wlg3[y/JwNZt^@3piPw:5pgJunZou3@rsJva&!Vy_g<v~Rm#JvG'!6Vz0=<r{Ju{%!:pj@WfsiXuJu3Rm:JvZ&!WfA~Bph@c4Z&Dtwax5rubx(#:awRk1@d,#Y&RfjRfid1#,Y(@Wfp2Wlrg5s@ryKu[@!,'=]ig9wlk?Rk>g5u-rqJvy'!@9RkQcH(T#=>Ri~@<wkj(Wj(KuZB*!&<7rw@9RkRcH(T#=>Ri}@<wkj)Wj)dg(Ta2Xa9X#`-!a*CARhg@@=I}d9x;c~#X%so=<sj>2@@=aybb}XjWv0Q~EfEj3vLv;<d,#Y(56H}`978H}_dgaPaFa'a/!#a3Y0a_a;a|!1(a7-[yE3[xt;:pJNvZrrg3uJrvJwNZt=@3pIh=rt3rxPw:5pGOu!5rpJvG'!6Vys=<rz@c4Z&Dt(ax5rtJvZ!&~BpH@wsfNg-vaRlNci*U#=<wei<F}a5@Jq.!a*JQ!%@qZ23d(#Y&RjH5]jCk!u7w&u0udARjFd/prq=tyvpaEa(a:.!a1aZ(@@=I}:9wpd%=<sX55w_h}@@=I{t=ay<aU@@=I}T=ay<2@@=I})?C9:9au@9Cb]}DP~=x-fAZ(2Wl1=ay<aU@@=I}>5@d##Y+jTv|vV~EfFj]uNpn~FRfGdgaK!Z2&!a8a-Tb({E!acTbM*!a(DtY[yYd'%Y#sl[y*hHvh>Re5x2c{Z}.j4uCvcawRiMd+#X+_x&d!},<5RkX;2Hzw@x,gavfB-!{CcF&T#Roe;RodwWbBg5urRgaKvHC*_6Vz+<4opieuew&Rmq@d]&Y)X,T#X0Rh}<BqP=4qS9:ReMg/ujReNJw0!/<Jui%!bd{kawwnemRelAxUa?a3#*.&UX(Ya+a/RhvRnQ<o}9Wmtd-#Y&RgSRmw9;Rmxay=Rmyg-vaRmuxEhSrNu,v-voC!%(aR.a(a7+1Ro1>Ro5CE{A9b]{@;5x#eO{:g;urRi+KrNA!%(Ro3>Ro79;Ri_Ku@>{;&!x%gX|{KunA_+g5QRj/g3u5Rj#g>uERj%wio/xRhS&!,!#^1U}wba{8>>@=be}qC@:D5ba{7Ku+A&!}x?ba}t>>@=be}se(aA^^^Uat!b0#{pa+awUazbGa#aLb9bgaWac'a5TbS=Br!d1#`%scp_Jvl!#rT>Re0JvX&!VyN=H{Fcm#U&:pY=ReaJv2&!]h0=]nUJvG'!6Vy|=<r%JrM_=]h2@Wlud'#)U'Wf'b]{i=]h/Jvh!&~BpWg=v]RnMx+ny#'Nu;pVwjnu=]nwxJnx,T#`&Reqwjnt=]nvieu9vrRjLLuYwP(#+!th@wih5pX~Gr'g5v/Rh4KunA'!-CARnP@wwiN:Rm_9x'cvw>!|l=<saKvAA!0&3@q}>w^e1bp#&Re2Re3BDx7gH#T|f5H|eKuZ>!%(:qNAH{]Jv6!+3B2B9=b^{X<5<B92:E{ZLvhwA(a;a%!igQuyRmad+#Y}m@3Rh5d8#X'X*:AqUAHzmaxwbh<aXRnVcF}RT#Nw&cj#U(BWnug/vsRntdka)(a3+.Zb7aYYan1!bVa@Xa}[y^@b[{G=H{+hFu73Rj&Pv#5ReQcK%T#sig1v{Rj'Ku+D#'!t]~Grm~?rkKuMB!01d5#`'Vy.ta3Dtu~Hroc8#'{^45s85AwZbP&!#Rn!wghxWn#KvEA!)&2RlA2RlBx:h|#(T,=]j09Wobz>x]z/@awRoTd+#Y(az]hFhCrm4d,#Y+jTv|Q~EfMj]uNr|~FRfOdCa!Xa9_X#@<plJvf!%b`{(9;Rgwc;.!#2x7cw#T|UDb]|T5Ju={(!=@E{&Jv)&!Ab`{'awJvf!~*>>@=be{#KuY>!+&4Ezyi[ugv&RjIdea+T)#UXa&T-T&a!Rh9auRmW=]kLg5vuRn+g3u4Rn-Ow6ARn,hHus5xNk?#UX(U~)/g8v0RkD~AwkkF?Ri.OuNBwkkA?Ri/d|a2`a*^UYa.!aBTZaTa'Xa;!(!2!-a#b2[yC>6Vyq3[xr2Wi?g1rusVh%s?DtF~<5rbJs;%!DtBfswKtCj[uvuSsEu3RgVx3o:u+wN'*Zt;@3rd~Grh~?rfg8w)Lq)qE&-a%!>bI|`jWv0vV~EfCjTv|vV~Ef@j]uNpn~FRfBcK#T']gWNu7x,k7q4ai(0!hHv8<RhmkMu9vrsBuev/RhlCJvB!,g<v{wchh~@:Rhji[vrv{wchi~@:RhkdS&a5UY#Ta!RgPwwiI5BwciI~@:Rh`x'iJvj'!5]iJPu8Bwch]~@:Rhach)U#h3rp]gLh@t|Ax,hTq3ah!-(~@:Ro0Ou!5RhXj^v(pyw8unRhVd|)`,^UYas!a?/a2Z'a^Ta{Tb7Ta(a#!a,Wf&9sZ3DtAadamov=Bqt3[xig8vsRm~>waiL2b`{QJv*_Ouv2qgj<v]v2BqfdR'X*X#Y-@3qr~Gqv~?p6hHv-]glPup5Lq+q?_%*b_{qF{n9b^{rOu4ARhpKvCD!+&~Bqp:5Dbb}nwoiKl&unuTuBv]v+ueunaXRf0=Jvh!0nKufu8v1w&w7q%w&uHrz:Rgnj5w,uxDJq/(!hNw'5ReCk0s2u3w/w'5ReFd>Za&!*UaA=<wkgsRnSJv^!%Refifw3vyRgOKu_B'!,<]gkiiu:w&Rh<=C@a^<B57@2F{[<B5@aW:=3away9A5aW=<B=C@a^<B57@2F{Ie-#`(^^^bCara.b8aza6!/bZ,!adTbnTbOb+aFaS!aAT9@Wf~2Wli3Dtl2@d,#Y&RfnRfmJwJZtN~GqyJva&!VyMg<v~Rm%iXuJu3Rm9Jv[_=]ih9wlkDRkCd1#`(@Wg>2Wls3cH#T(@<Rj*=>Ri|b~'#23s9h<~El.d'#Y&Dtxi^rzvdRl#d*#U%(o|B2s`hJwSaxRmDKv4B&!1:Rmdd5#`'Vx}to~Hq{x'f1v3(!BA5ba|bJv_&!Wfug1v]ReIdO+U/Y#&G}-8wze=Rh{g1v]ReHg/uQRf/by#)ibQwERl/cH#T(@<Rj+=>Ri{cNu+vlax-!(#a0qa9<Rii2;;bU{H;x<i=&X#Rk`<4wwi=C9H~8xAI(Y#<azRi@45wXI<B9;5bb~7dL(X#Xa(+!aL6Vy{g5QqOau:5au2@ay547EzbxOcU(UX-T#Ta#:Cbb|A?wjh/b_|SOw6ARgtihr}u7Rhy<d1#T)X1@@=I|~=ay<2@@=aybb}Sj3vLv;<d,#Y(56H}A978H}@dGpvs@uAu`vcw9*!aFa+ai%(b!aXa8.a?a[ozWey=sU2@G}Nch&U#Rf_WexKu+D#'!t:~Gr`~?r^j]uNr|~FRg*j^psurwJt|RmcKv)@&!)7Rkv~Br[@wxfO:Rl3co#U'6Rezj_q#vIuavjRltwzeyh@vr5JqD0!>aY?C9:9au@9Cb]}9cl#U*5;5<H||jbuus1ucv&Rfvg1v~d/pppzqFr^a--a~!aMat1(hFv;Wiz@@=Izoj5uuv-7Rix~Cw`fk2WlVcZ#X,k)u3vWs@u2]ktg;wEx'fBq(_2Wg/jTv|vV~EfoJv]!15x'hzqG!(P~EfU~CRl_j6v(us5x4i-#T(2WmZ?C2F|d>Kq<aj1!*jTqIsBv=Wl`~Cw`fi2WlWj`v0u*~>RlR=c>Z,k#u3vWs@u2]kr<c1Z+jTqIsBv=Wla~Cw`fm2WlXdmb3!a{(arZa`bkTa%TbQTa-a9+c'!aM!/[yL=Bqug.w'RifhFvyDRj.g>vgwyk^9]k^Jv3_@WfbAARkhJw2_[x|JvB_wkoIRoKwkoJRoLd'(Y#<]gm=<9<H|yd'%_X#skDtb3awwqkgNulRkgdB#^',9:p'hJwSaxRmEBwVb8@4=H|qLu+w50&!)@3qs~?pU>Awwn;;Rn=c:Z'ARn<=<qwKvC@!/&~BqqJv6!&]eVb^z^xRge'/a%+^`#Sge}6<4Rn3=]n0Pw2>Rn8Jw0!&>Rn:>Rn6cY#a7+!a&=<wkaNw~h3z_c5Z{=wjh#=]nLKv^D!&)Vyz=bW|swYb<WetcG#T(2wxa@qVx@gD#Y&b^|V5JwG&!5bb|pg/w&RgD@x=kHs=uAvn!a%%/'+RmSRh694Ro`g-vaRmRhHv-]mlxCcS#`&ba~.5cD#Ta)P~=d,#Y(56H{>978H{Dd_#{2^Y%_+qbbb{6g3sERhsbU{?dfa.,`a(Xa<!aiX#(55RiG54RiHcI#T'WiU3RiVNvdwtfcRlKNvdd,#Y&RlHRlExQgf.1*^T'X#Sgf}6Wn4=]hfPrk>Rn7Jw0!&>Rn5>Rn9Lunw?&a2!,5<oq@@wqfdRlJj5Q~=d,#Y(~ARfcOuN]fdDKw;ay(}i!547E}j?cI#T(@5bV}iCbV}hdv(^^Tb?a40,b##Tbo!a*bR!a<b|a/!aKai!aU[yK=]o^g:v>ReGJwPZtK<7Rh+h<~El,Pv#5ReR@awwxjCg,ulRjDJv6&!]j!z?aQeeg>w=Sh<eeJw;!&axEzOg,Qosc!#*:wkeJ]eJ>x'h-u(!%Ro.w~h.zPdNZ(X,Ya![x{;9ReY;wkgxRiF:x?ap#Y&RmUg<s2Rkod]+UY0TZ'!a&A9sw<=bczLNvuw{gqzNhJwSaxRmCKuLay!#&s_Rf-55b^{uJvZa!!c%#(55Ri654wmiu5RiuawLu,vp!+}^%b_}Y9;wkgxba}o>A9:=b^}zKuh=a''!3awRk3c*'!#aHRk6c+Z&Rk5Rk4Jv)&!awRjSawd9*`#0?C2@EzMj8u<uJ5RmbjQrquJu3x,k>uq@_+=ayb^|W~ARkEOuN]k@7dhzV^X/X&a-#zRzSb`zXcJzTT#2WkVKvDBzW!%FzY9;5bbzWjQrquJu3Jw3%!b`zU=ayb^zQd:#X(T-a!6Vyywxh}=b]{Jg=u1RiAdGp~qHtzv!w(wA+a+a;<!aJaYai'anasb(=azRmV:Cbb{MLq2vb!%')RjuRjrRjtRjqx3jnqCw3!%')Rk(Rk+Rk&Rk)Lq2vb!%')Rj{RjxRjzRjwLq2vb!%')RjsRjpRjfRjex3jcqCw3!%')Rk'Rk*RjkRjl9<CbbzfOu4ARhxLq2vb!%')RjyRjvRjhRjgx=joq*uKvb!%')+-Rk.Rk%Rj~Rk-Rk#Rj}x=jdq*uKvb!%')+-Rk,Rk!Rj|RjmRjjRjidAq&qKs@uAv8Aa.'*-a@a&0!aM@a5[y73Dsy3Ds|3Dt):wxgI2sHJwJZt.~Gqxwsf0ikrzt}Rl0Jvy_[xj~HqzKv_A|D!&WfP8axRoVcf,U#k(v]v+ueunaXRf1Ju}'!g8u#Ri=jQw!sCunLprq>!,')~<5qeGzq9F{W=c##%s5au:5aU3CBE|;d4#X(D!a&6Vygx(b;#(=]ed?C2F{N<capoq2r[a&!aPa9,'Pw;5s:@@=I|,55w_h|@@=IzcP~=x'fCqB_2Wl2>aU@@=I|1OuNBc1Z+jTqIsBv=Wlc~Cw`fl2WlZ~AcTa%!Z+jTqIsBv=Wlb~Cw`fh2WlYk+uNqJsBv=WlSg,u3dca3#UXaMYa)TaB-=cM|7T#<bI}l5@B932:aV2G{BOuNBJq:|M!5Ezt=<B=C@a^<B57@2F{v>cB{/T#=ay<bI{3Jv6!a.6BKq0ah&+!5E}HP~Ef{978BaU@@=Iza<7d#.Y#978BaU@@=IzH~AJq0!(@@=IzG978BaU@@=IzFe,aU*Y&^^^bvJb,b:bFad!a,c2Ta>aL.bo6!a#CbTa'T#Re{2Wlh2@G{yg6t~Ro_NvdRfticuRQRllJv3&!x&c|zs@Jw3!%RflwpfkRlpKuL;%(!Re<@G|C2GzdhIvuBwgjAg-u0RjAKQB%!(GzZ@G|5NuuRl7d='T+Y#Vy[g<v~Rm!==G|>JvA!)@wma=]m1ifuaw&RmnLs@vT'!|/+[y,g:v>ReTJw1!#qX=x!eC{bLu+wT&)ZtZauq_~Graci&U#F|89:r_Lupvq!.)&2RlG8RfaC=x!eF{_h?rpWlmd&'!#X|&]k::xJey#`'T|+<E|&2@H|%dE#(^,g;u.RiEg6vjRiC9xCkA{O|zY#g=ucRmXKs0@!&*@G|m@awRknJuh!,3d(}gY}eJvj!%Rm):Jw3!%Rm+Rm-Ls0w(&!a(a#@b[|6cZ#X'7RkxWgAOu4ARn'dH'U#Y*Vz-Wm'CARm}d]*#a%^a*T'aK!a<9bV{PC=p*Jw4!&SgxcbB5r]idw(wBRmF7xFkt#&`(Rm/Rm8E|!JuY_9:Rl5=wrgr2:bbxd@xXfB(a*#T+!.X0X1Ta/a'T&RlDRfL>RlyARl9b[z[>RfZ:RlL:RfRwlg/ARl;9;RlxKv,A/!%7s69<74=BA5ba{-8Bde#`a<XaKYa1,a'P~=wxfB2bZ}}?C972@@=I}r8@55B9;5bb}G978B2@@=aybb}3j3vLv;<Jw3&!>Rfk=ayb^}4~Ad1#`*@@=aybb{w2@>==<bbz]dx+UY#^UaF!a9!bB'Ya1.!ajXa#%olRhD[y=3Dt#Ov5BrHKuMB%!(Rf^Wep~HrJwkiQjKr|~FRg)Ku+D#'!t5~GrF~?rDdV)UY,Z/_7RkuG{<~BrBg,rlsO:235B@bX}|d?a1!#`(6Vyn5@d##Y+jTv|vV~EfIj]uNpn~FRfH7Lq2vb1!a9-978BaU@@=Iz9978BbU}#~AJq0!(@@=Iz8978BaU@@=Iz7~AJQ|}!978BbU}!JvkaK!AdUa21-U#`a+(g/vsRn~Ou!5RPj:rmu9WhOjXuvvNr}:RhAj^v(pyw8unRn[kPr}p|u7vwv]RiSBd;pppzq@qHQa?(b.!a.a`@.|xa(hFv;Wiyj5uuv-7Riw~Cw`fg2WlU978BbU|wOuNBJqG!(P~EfD~CRlQcZ#X,k)u3vWs@u2]ksg;wEx'f@q1_2Wg.j]uNpn~FRfqJv]!15x'h{qG!(@@=IzK~CRl^j6v(us5x4i,#T(2WmY?C2F{1>Kq<aj1!*jTqIsBv=Wld~Cw`fj2Wl[j`v0u*~>RlT=c>Z,k#u3vWs@u2]kq<c1Z+jTqIsBv=Wle~Cw`fn2Wl]dn1#c(a(b^a2!b/bAT(bj!aDa7bu,a_a{c0!2T0g:v>ReD2@G{42@G{5~DpM~<5rc=Bx6i>{RT#RnI@zCx]y]z:2Jv[!zr5Awyk]9]k]dD(Y+X#6Vz.g=wKtgwhaCwgmTWj2Lu,w%_+/[y-B;b^xeg3u3Rj-2@bX{*KrJ<!+'@Wg(g?QRlC@Jv`!%b[zIwsfII}8JQ_@w|kW|=Jv(%!AqcOuNBJvEzh!bYzjLs@wP#(0!oy@>RkdJwMZtc3Dtd@BcG#T'9bWxg2@2Fznd*#Y+;2x'c}w<zizixNgwa#Z'U+!/!a'!a+w~g~z6wcn{Rn}wcnzRn|5Rh%=]nJg5vuRmvNvdRlvcprJu}w*az*a#!%.a.'Bot9qT]kj@Wg'ay2Gzv@Jv`!%b[zEwsfHI}1;ck#Ux`<Cbbx_Lu+w!a&0*!wko*wwo,So,}6Juqxf!E}PigQuyRm`d3(`#8>Rn%:A5B;bZ~%KvhCa!a2!x>k7#Uxb@b{#xaRk7Jw0!)>wwhlShl}6>wwhmShm}6CJvB!.x'hhvj{!!5Bwkhhbaz}x'hivjz~!5Bwkhibaz|xEhTrNu,v-vpD!a%&/)a3a.,%Ro2t[CE{)@3re9b]{%wjo09:rgc:Z&Ro6=<riifuaw&RmoKrNA!%(Ro4>Ro89;Ri`dSaL'UYzxZb)7Rka3xRhT&!,!#^1U}vbaz{>>@=be}yC@:D5bazzKu+A&!}{?ba}y>>@=be}wxBh[t`u~vJvr!%a!a()a,a0a4RoC=]o;Ju(!%RoGRhdwjh`=]oAg>w#Ro?g5vuRo=NvdRl|Ku]C.!&;RoEJvB!%RoORoMBx'h[v+_?w~h`}~5?w~hd~!xKh]oiptu-utv.vp!#%&a30a@a'a+(a/aOp(o~p!RoDJu(!%RoHRhewjha=]oBNvdRl}g>w#Ro@g5vuRo>c[#X']o<CauRoRAd-#Y':RkpauRoQKu]C.!&;RoFJvB!%RoNRoPBx'h]v+_?w~ha}t5?w~he}ue!/UbhYacXaW^Tc&a;b:a-c/#b&aja1(!cL+!bKbt!bmcRc9aIc?8[yW3Dtt94Rg`Jv}!&SiRMzBhEebShEMNuPRe>x7gL#TzuwjirRipc<Z&>on;>z=h-MSh.Mwqczx'a7vj&!>Re4@=ResJt__NuPRi*NuPRi)j]uNr|~FRfzKrJ>_+@Wfy@Wf]2WocKrJ<!+'@Wg%g/QRl@@Jv`!&awRl<wsfFIzgLu(w*!.*&ShBMwvhIRhI9;RhNx1hK'!#Sn]Mx1hK~0!#:2<H~7cNu+w7D*'1ZtW>Rn1~?rOc:Z&Rn2=<rQ<7wjh&=BSnLMc]#X(6Vz)w[b=a!U#9wzgMc3#&(RgMRitRis<x,gKt`ax!&+SioM=BSilMc3#&(RgKRinRimKurB,!&SiQMzBhDebShDM6BJQ!(P~Efx978B2@@=I}WLrJw!!,a*&@G}O@9wkibRid@@x'fKwC!&SlDMSfLMjUv~Q~EfKKv3@a+!(hFv-]mpx/hYZ(C5RiWz<o/MwkhY?So/M@x,gbvfB*&!SgEM:SoeeehFu3:Rgbda(,^TZa)X/7Sg[eb:2RgI~BrMC@wgkc:wwkcRerx3h(uUvK!&*,SnOM4Sh*MArRg;wHRh(x=h;rJvPwI!a4',a'0@Wg&=BSh/Mg>w=Rh=g3w*wwgGRgGcW(X#;Sg}M2Gzk@Jv`!&awRl=wsfGIz`dKZ*T'Y-:RhR7RhQg5u-p`j6v(us5d,#Y+~Awkia?RicOuNBwkibba}Ld6p~tyu_vbAa'a+!a/'a3aEa8a!>Sh,ebJv{!&Sh@ebSaReb9;SgwebNuPRi(NvdRl)NuPRi'hHu^<Rm^Jvv_@Wl(g;u1Si/ebKu'B&!*Sh?eb@Wl'z@aPeb95Si.ebcpputyvjB)!,&a+0a%ShAMWeK@G}C@WfJ9;RhMwvhH9w{ia}ix,hJvRA1(!zAn[MRhHx1hJ~*!#hFv(BSn[MBJQ!(@@=I~'978B2@@=I}2db.Ua<'X}+T#a0XaG2G}E;wkg|wuh!Rh!x,hZu,@)!&So0MVy)C5RiXACJvB!&5RiY5RiZg8w)cG}*T#2@bU}=KsA>(!a.3wkhZba~(x,h^u(A!&(SoCMRhb5Bz=h[eb?w~hb~6x,h_u(A!&(SoDMRhc5Bz=h]eb?w~hc~6e)aA1T#T,^^^c-bMb&blcPaP(a/!0!bA=b5c@a(!bfbrc#2afwmhARnjwchORnp2Wlf3DtsNvdRl-2@wpa<]m0bx(#:awRk2@Jw3!%RfhwpfgRlnKQB%!(G{V@G|'NuuRl6d='T+Y#VyUg<v~Rl~==G|<Jv+'!aYShC}6@B<5?ba~8@Jw3'!g2QRljhLrpWlOd+#Y'g.w'rIg>w*wgj@g-u0Rj@Lu+wT&)ZtUauq]~GrGci&U#F|39:rELrNvj!.%*RhCwunfw~nf~:9;Ri]>wtnhg;wHRnhx3hDs@v~!/+'@Wfr@9RkSNu&Rlo=@<5GzoKs0@_+@Wl+@awRkmJuh!-3d(}pY#qWJvj!%Rm(:Jw3!%Rm,Rm*de&!1U-U#`)Re;@G|.@9Ri82@wjfvRlq=@<5GzpLvOvr!).&2RlF8Rf`C=x!eE{.Jw3_g2QRlkhLrpWlPde(!#U{s,UXa*Ta'[y'g:v>ReS;x0PZ&RnlRnn~HrKJw1}f!=x!eB|2w]aP(#Xa&a*Ta.Ua2a7=]iOd'#Y&Ro&WnWg;u.RiDg6vjRiBNvdRlzhNvj]nYJuW_2Wm3x)kFze{9d])!a.!,Y01!#&aC!a3RndC=ox~BrC@2b^{pg,rlse7x'ksuq!%Rm.E{xidw(wBRmGx9o+)X#wwo-So-}69:Rl4@xSf@a#XZ'X)X,Ta(/ARl8b[xc>RfY:RlI:RfQwlg.ARl:9;Rlwdn'#^XafaQa1X1TaHTa)@b[{zcZ#X'7RkwWg@Ou4ARn&x)kG#{,g7u/RkGdH'U#Y*Vz'Wm&CARm|bx#(A]gUbUzJj9Q~=d,#Y(56H}l978H{U7d,0#U*2>ABb_xZ978BbU{e~AJQ{g!978BbU{hxMh?ad{oUYZ.x1h?{l!#:2<H{mx3n[t{vl!,&a%3Ro(z=iS}6ARnr=Bwsn^wvn`Rnbd`*T}B0!#^X'BG{c9b]{a>>@=be}F?JvS!&BG{d7BG}(Bde#`a1X,Ya@!a'P~=wxf@2bZ}I56B2@@=aybb}08@55B9;5bb}<j3vLv;<Jw3&!>Rfg=ayb^}&OuNBKuLA!)a!P~=x#fD{f2@>==<bbzl?C972@@=Ix^d6rSu,v7w*C(0a)a6#B+a%!sQ[y?3Dt%3[xn~<5rLOu!5p@Ku+D#'!t7~GrP~?rNKvlaya7'!h+v-5qMg=t|cd,U#5AAaa5Abb{S@52B5@a[@52B5Gx[iXueu;d<#`a(!/549C;ag>23ExY5@Dah89b^~689Jv)!~2b[~1Lv'w(%*!a#bX|aPrmawRe]keu7uhv-q6rxu,q`xTo]/a5aU!bNaDXbi!b-!ao!b<bwA!#5@B932:aV2G|:d-)Y#hJrL>RhG<7@C5<H|_=Cau:5aj5@B932:bJ|ng>vIbs)#?C2F|9jPv0w.vISh-MKvUaz(.!9ABbb|[5;5<H|Eg>unwfh;9:4E|YjQsBt|vjx'hYq3!(?C2F|J:2<BaY?C2F|GOu!5x,g|p{ah!-(?C2F|c9:4E|OjXuvvNr}:Rh&i[w*t|cd+U#jJvsu)vsSn~Mkfrmu9p}u7vwv]So!McW#Xa!ax5@A5aY:5;5<H|>kJv~vYrquJu3x4ib#T)2@SmZM?C2F|Bj:rmu9@xPhI(a*a#U#`a3-5Abb|L~@:RhK9:4E|0@52B5G|#C::aY?C2F|-:2<BaY?C2F|.5Jvk!a)javYrquJu3x4ia#T)2@SmYM?C2F|HAxPhH(!a#U#`a*-5Abb|4~@:RhJ9:4E|R@52B5G|F:2<BaY?C2F|Sc^#Xa2j=Qq5CJvB!-g<v{z;hhM?C2F|Zi[vrv{z;hiM?C2F|XKsA>!a)-g<v{z;h[eb?C2F|]i[vrv{z;h]eb?C2F|^iZu.vix,hZq3ah!.(?C2F|QOu!5ShXM:2<BaY?C2F|P",13494,2713,49,25,61);var re;(function(e){e[e.VALUE_LENGTH=49152]="VALUE_LENGTH",e[e.FLAG13=8192]="FLAG13",e[e.BRANCH_LENGTH=8064]="BRANCH_LENGTH",e[e.JUMP_TABLE=127]="JUMP_TABLE",e[e.VALUE_MASK=8191]="VALUE_MASK"})(re||(re={}));var pe;(function(e){e[e.AMP=38]="AMP",e[e.NUM=35]="NUM",e[e.SEMI=59]="SEMI",e[e.EQUALS=61]="EQUALS",e[e.ZERO=48]="ZERO",e[e.NINE=57]="NINE",e[e.LOWER_A=97]="LOWER_A",e[e.LOWER_X=120]="LOWER_X"})(pe||(pe={}));var Po=32,Rh=21,$v=2097151,ka=2047,Eh=0;function Hv(e){let r=e>>>Rh;return r===ka?Eh:r}function Dh(e){return e-pe.ZERO>>>0<=9}function Uv(e){return(e|Po)-pe.LOWER_A>>>0<=5}function Sh(e){return(e|Po)-pe.LOWER_A>>>0<=25}function Gv(e){return e===pe.EQUALS||Sh(e)||Dh(e)}var Ch;(function(e){e[e.EntityStart=0]="EntityStart",e[e.NumericStart=1]="NumericStart",e[e.NumericDecimal=2]="NumericDecimal",e[e.NumericHex=3]="NumericHex",e[e.NamedEntity=4]="NamedEntity"})(Ch||(Ch={}));var Ca;(function(e){e[e.Legacy=0]="Legacy",e[e.Strict=1]="Strict",e[e.Attribute=2]="Attribute"})(Ca||(Ca={}));function qv(e,r,n,o){let i=(r&re.BRANCH_LENGTH)>>7,a=r&re.JUMP_TABLE;if(a){if(i===0)return o===a?n:-1;let u=o-a;if(u>>>0>=i)return-1;let c=e[n+u];return c===0?-1:n+i+c-1&65535}if(i===0)return-1;let s=i+1>>1,l=n+s+i;for(let u=0;u<i;u++){let f=e[n+(u>>1)]>>((u&1)<<3)&255;if(f===o){let h=n+s+u;return l+e[h]&65535}if(f>o)return-1}return-1}function Ah(e,r,n){return n===1?String.fromCharCode(e[r]&re.VALUE_MASK):n===2?String.fromCharCode(e[r+1]):String.fromCharCode(e[r+1],e[r+2])}function Wv(e,r,n){let o=r+1,i=0,a=o;if(o<n&&(e.charCodeAt(o)|Po)===pe.LOWER_X)for(o+=1,a=o;o<n;){let l=e.charCodeAt(o);if(Dh(l))i=i*16+(l-pe.ZERO);else if(Uv(l))i=i*16+((l|Po)-pe.LOWER_A+10);else break;o+=1}else for(;o<n;){let l=e.charCodeAt(o)-pe.ZERO;if(l>>>0>9)break;i=i*10+l,o+=1}if(o===a)return 0;o<n&&e.charCodeAt(o)===pe.SEMI&&(o+=1),i>1114111&&(i=1114112);let s=o-r;return s>=ka&&(Eh=s,s=ka),s<<Rh|i}function Jv(e,r,n){let o=kh,i=e.indexOf("&");if(i<0)return e;let a=e.length,s=0,l="",u=o[0],c=u&re.JUMP_TABLE,f=(u&re.BRANCH_LENGTH)>>7;do{let h=i+1,d=e.charCodeAt(h),p,m;if(d===pe.NUM){let v=Wv(e,h,a);p=Hv(v),r&&p>0&&e.charCodeAt(h+p-1)!==pe.SEMI&&(p=0),m=p===0?"":bh(v&$v)}else if(Sh(d)){p=0,m="";let v=d-c,x;if(v>>>0<f){let _=o[1+v];x=_===0?-1:f+_&65535}else x=-1;let g=0,b=0,k=x<0?0:o[x],y=h+1;e:for(;y<a;){for(;(k&(re.VALUE_LENGTH|re.FLAG13))===0&&(k&re.JUMP_TABLE)!==0;){let R=k&re.JUMP_TABLE,S=(k&re.BRANCH_LENGTH)>>7;if(S===0){if(e.charCodeAt(y)!==R)break e;x+=1}else{let N=e.charCodeAt(y)-R;if(N>>>0>=S)break e;let T=o[x+1+N];if(T===0)break e;x=x+S+T&65535}if(k=o[x],y+=1,y>=a)break e}if((k&(re.VALUE_LENGTH|re.FLAG13))===re.FLAG13){let R=(k&re.BRANCH_LENGTH)>>7;if(e.charCodeAt(y)!==(k&re.JUMP_TABLE))break;y+=1;let S=R-1,N=x+1,T=0;for(;T+1<S;T+=2){let L=o[N];if(e.charCodeAt(y)!==(L&255)||(y+=1,e.charCodeAt(y)!==(L>>8&255)))break e;y+=1,N+=1}if(T<S){if(e.charCodeAt(y)!==(o[N]&255))break;y+=1}x+=1+(R>>1),k=o[x];continue}let _=k>>>14,w=e.charCodeAt(y);if(_!==0){if(w===pe.SEMI){p=y-h+1,m=_===1?String.fromCharCode(k&re.VALUE_MASK):Ah(o,x,_);break}if(!r&&(k&re.FLAG13)===0&&(p=y-h,g=x,b=_),_===1)break}let C=qv(o,k,x+(_||1),w);if(C<0)break;x=C,k=o[x],y+=1}if(m===""){let _=k>>>14;_!==0&&!r&&(k&re.FLAG13)===0&&(p=y-h,g=x,b=_),p>0&&(m=Ah(o,g,b))}}else p=0,m="";p===0||n&&d!==pe.NUM&&e.charCodeAt(h+p-1)!==pe.SEMI&&h+p<a&&Gv(e.charCodeAt(h+p))?i=h:(s<i&&(l+=e.slice(s,i)),l+=m,i=s=h+p),e.charCodeAt(i)!==pe.AMP&&(i=e.indexOf("&",i))}while(i>=0);return l+e.slice(s)}function Oo(e){return Jv(e,!0,!1)}var Mh;(function(e){e[e.XML=0]="XML",e[e.HTML=1]="HTML"})(Mh||(Mh={}));var Th;(function(e){e[e.UTF8=0]="UTF8",e[e.ASCII=1]="ASCII",e[e.Extensive=2]="Extensive",e[e.Attribute=3]="Attribute",e[e.Text=4]="Text"})(Th||(Th={}));var Vv=class{constructor(e={}){ie(this,"src_Any",va.source);ie(this,"src_Cc",ya.source);ie(this,"src_Z",ba.source);ie(this,"src_P",ln.source);ie(this,"src_ZPCc",[this.src_Z,this.src_P,this.src_Cc].join("|"));ie(this,"src_ZCc",[this.src_Z,this.src_Cc].join("|"));ie(this,"cache",{});ie(this,"opts",{maxLength:1e4,urlAuth:!1,schema_names:[]});this.opts={...this.opts,...e}}set(e={}){return this.opts={...this.opts,...e},this.cache={},this}escapeRE(e){return e.replace(/[.?*+^$[\]\\(){}|-]/g,"\\$&")}nestedPairRE(e,r,n=4){let o=this.escapeRE(e),i=this.escapeRE(r),a=`(?:(?!${this.src_ZCc}|${o}|${i}).)`,s=`${o}${a}{0,1000}${i}`;for(let l=2;l<=n;l++)s=`${o}(?:${a}|${s}){0,1000}${i}`;return s}get_text_separators(){var e;return(e=this.cache).text_separators??(e.text_separators=/[><\uff5c]/)}get_pseudo_letter(){var e;return(e=this.cache).src_pseudo_letter??(e.src_pseudo_letter=new RegExp(`(?:(?!${this.get_text_separators().source}|${this.src_ZPCc})${this.src_Any})`))}get_ipv4_addr(){var e;return(e=this.cache).src_ip4??(e.src_ip4=new RegExp("(?:(?:25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9][0-9]|[0-9])[.]){3}(?:25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9][0-9]|[0-9])"))}get_ipv6_addr(){var n;let e="[0-9A-Fa-f]{1,4}",r=`(?:(?:${e}:${e})|${this.get_ipv4_addr().source})`;return(n=this.cache).src_ip6_addr??(n.src_ip6_addr=new RegExp(`(?:(?:${e}:){6}${r}|::(?:${e}:){5}${r}|(?:${e})?::(?:${e}:){4}${r}|(?:(?:${e}:){0,1}${e})?::(?:${e}:){3}${r}|(?:(?:${e}:){0,2}${e})?::(?:${e}:){2}${r}|(?:(?:${e}:){0,3}${e})?::${e}:${r}|(?:(?:${e}:){0,4}${e})?::${r}|(?:(?:${e}:){0,5}${e})?::${e}|(?:(?:${e}:){0,6}${e})?::)`))}get_ipv6_url_host(){var e;return(e=this.cache).src_ip6_host??(e.src_ip6_host=new RegExp(`\\[${this.get_ipv6_addr().source}\\]`))}get_ipv6_mail_host(){var e;return(e=this.cache).src_ipv6_mail_host??(e.src_ipv6_mail_host=new RegExp(`\\[IPv6:${this.get_ipv6_addr().source}\\]`))}get_auth(){var e;return(e=this.cache).src_auth??(e.src_auth=new RegExp(`(?:(?:(?!${this.src_ZCc}|[@/\\[\\]()]).){1,50}@)?`))}get_port(){var e;return(e=this.cache).src_port??(e.src_port=new RegExp("(?::(?:6(?:[0-4]\\d{3}|5(?:[0-4]\\d{2}|5(?:[0-2]\\d|3[0-5])))|[1-5]?\\d{1,4}))?"))}get_host_terminator(){var e;return(e=this.cache).src_host_terminator??(e.src_host_terminator=new RegExp(`(?=$|${this.get_text_separators().source}|${this.src_ZPCc})(?!${this.opts["---"]?"-(?!--)|":"-|"}_|:\\d|\\.-|\\.(?!$|${this.src_ZPCc}))`))}get_path_terminator(){var e;return(e=this.cache).src_path_terminator??(e.src_path_terminator=new RegExp(`${this.src_ZPCc}|${this.get_text_separators().source}`))}get_path(){var e;return(e=this.cache).src_path??(e.src_path=new RegExp(`(?:[/?#](?:${this.nestedPairRE("[","]")}|${this.nestedPairRE("(",")")}|${this.nestedPairRE("{","}")}|\\"(?:(?!${this.src_ZCc}|["]).){1,100}\\"|\\'(?:(?!${this.src_ZCc}|[']).){1,100}\\'|\\'(?=${this.get_pseudo_letter().source}|[-])|\\.{2,20}[:]?[a-zA-Z0-9%/&]|\\.(?!${this.src_ZCc}|[.]|$)|`+(this.opts["---"]?"\\-(?!--(?:[^-]|$))(?:-{0,19})|":"\\-{1,20}|")+`,(?!${this.src_ZCc}|$)|;(?!${this.src_ZCc}|$)|\\!{1,20}(?!${this.src_ZCc}|[!]|$)|\\?(?!${this.src_ZCc}|[?]|$)|`+this.get_path_extra().source+`[\\\\/:%@#&=_~*]|(?!${this.get_path_terminator().source}).){1,${this.opts.maxLength}}|\\/)?`))}get_mail_name(){var e;return(e=this.cache).src_mail_name??(e.src_mail_name=new RegExp("[-!#$%&'*+/=?^_`{|}~a-zA-Z0-9](?:[-!#$%&'*+/=?^_`{|}~a-zA-Z0-9]|[.](?=[-!#$%&'*+/=?^_`{|}~a-zA-Z0-9])){0,63}"))}get_xn(){var e;return(e=this.cache).src_xn??(e.src_xn=new RegExp("xn--[a-z0-9\\-]{1,59}"))}get_tld(){if(this.cache.tld)return this.cache.tld;let e=[...new Set(this.opts.tlds||[])].sort().reverse().join("|");return this.cache.tld=new RegExp(`${e||"$#none#$"}|${this.get_xn().source}`),this.cache.tld}get_domain_root(){var e;return(e=this.cache).src_domain_root??(e.src_domain_root=new RegExp("(?:"+this.get_xn().source+`|${this.get_pseudo_letter().source}{1,63})`))}get_domain(){var e;return(e=this.cache).src_domain??(e.src_domain=new RegExp("(?:"+this.get_xn().source+`|(?:${this.get_pseudo_letter().source})|(?:${this.get_pseudo_letter().source}(?:-|${this.get_pseudo_letter().source}){0,61}${this.get_pseudo_letter().source}))`))}get_url_host_port(){var e;return(e=this.cache).url_host_port??(e.url_host_port=new RegExp("(?:"+this.get_ipv6_url_host().source+`|(?:(?:(?:${this.get_domain().source})\\.){0,10}${this.get_domain().source}))`+this.get_port().source+this.get_host_terminator().source))}get_fuzzy_url_host_port(){var e;return(e=this.cache).fuzzy_url_host_port??(e.fuzzy_url_host_port=new RegExp("(?:"+(this.opts.fuzzyIP?this.get_ipv4_addr().source+"|":"")+`(?:(?:(?:${this.get_domain().source})\\.){1,10}(?:${this.get_tld().source})))`+this.get_host_terminator().source))}get_mail_host(){var e;return(e=this.cache).src_mail_host??(e.src_mail_host=new RegExp("(?:"+this.get_ipv6_mail_host().source+`|(?:(?:(?:${this.get_domain().source})\\.){0,4}${this.get_domain().source}))`+this.get_host_terminator().source))}get_fuzzy_mail_host(){var e;return(e=this.cache).src_fuzzy_mail_host??(e.src_fuzzy_mail_host=new RegExp("(?:"+this.get_ipv6_mail_host().source+`|(?:(?:(?:${this.get_domain().source})[.]){1,4}${this.get_domain_root().source}))`+this.get_host_terminator().source))}get_path_extra(){var e;return(e=this.cache).src_path_extra??(e.src_path_extra=new RegExp(""))}get_fuzzy_mail_host_search(){var e;return(e=this.cache).mail_fuzzy_host_search??(e.mail_fuzzy_host_search=new RegExp(`@${this.get_fuzzy_mail_host().source}`,"ig"))}get_fuzzy_link_search(){var e;return(e=this.cache).link_fuzzy_search??(e.link_fuzzy_search=new RegExp(`(^|(?![.:/\\-_@])(?:[$+<=>^\`|\uFF5C]|${this.src_ZPCc}))(?:(?![$+<=>^\`|\uFF5C])${this.get_fuzzy_url_host_port().source}${this.get_path().source})`,"ig"))}get_http_validator(){var e;return(e=this.cache).http_validator??(e.http_validator=new RegExp("\\/\\/"+(this.opts.urlAuth?this.get_auth().source:"")+this.get_url_host_port().source+this.get_path().source,"iy"))}get_relative_proto_validator(){var e;return(e=this.cache).relative_proto_validator??(e.relative_proto_validator=new RegExp((this.opts.urlAuth?this.get_auth().source:"")+`(?:localhost|${this.get_ipv6_url_host().source}|(?:(?:${this.get_domain().source})[.]){1,10}${this.get_domain_root().source})`+this.get_port().source+this.get_host_terminator().source+this.get_path().source,"iy"))}get_mail_name_validator(){var e;return(e=this.cache).mail_name_validator??(e.mail_name_validator=new RegExp(`(?:^|${this.get_text_separators().source}|"|\\(|${this.src_ZCc})(${this.get_mail_name().source})$`))}get_mailto_validator(){var e;return(e=this.cache).mailto_validator??(e.mailto_validator=new RegExp(`${this.get_mail_name().source}@${this.get_mail_host().source}`,"iy"))}get_schema_names(){var e;return(e=this.cache).schema_names??(e.schema_names=new RegExp((this.opts.schema_names||[]).map(r=>this.escapeRE(r)).join("|")))}get_schema_search(){var e;return(e=this.cache).schema_search??(e.schema_search=new RegExp(`(^|(?!_)(?:[><\uFF5C]|${this.src_ZPCc}))(${this.get_schema_names().source})`,"ig"))}get_schema_at_start(){var e;return(e=this.cache).schema_at_start??(e.schema_at_start=new RegExp(`^${this.get_schema_search().source}`,"i"))}},Aa={validate:(e,r,n)=>{let o=n.re.get_http_validator();o.lastIndex=r;let i=o.exec(e);return i?i[0].length:0},normalize:(e,r)=>r.normalize(e)},Yv={"http:":Aa,"https:":Aa,"ftp:":Aa,"//":{validate:function(e,r,n){let o=n.re.get_relative_proto_validator();o.lastIndex=r;let i=o.exec(e);return i?r>=3&&e[r-3]===":"||r>=3&&e[r-3]==="/"?0:i[0].length:0},normalize:(e,r)=>r.normalize(e)},"mailto:":{validate:function(e,r,n){let o=n.re.get_mailto_validator();o.lastIndex=r;let i=o.exec(e);return i?i[0].length:0},normalize:(e,r)=>r.normalize(e)}},Zv="a:cdefgilmnoqrstuwxz|b:abdefghijmnorstvwyz|c:acdfghiklmnoruvwxyz|d:ejkmoz|e:cegrstu|f:ijkmor|g:abdefghilmnpqrstuwy|h:kmnrtu|i:delmnoqrst|j:emop|k:eghimnprwyz|l:abcikrstuvy|m:acdeghklmnopqrstuvwxyz|n:acefgilopruz|o:m|p:aefghklmnrstwy|q:a|r:eosuw|s:abcdeghijklmnortuvxyz|t:cdfghjklmnortvwz|u:agksyz|v:aceginu|w:fs|y:et|z:amw",Kv="biz|com|edu|gov|net|org|pro|web|xxx|aero|asia|coop|info|museum|name|shop|\u0440\u0444";function Qv(){let e=Kv.split("|");return Zv.split("|").forEach(r=>{let n=r.indexOf(":"),o=r.slice(0,n);for(let i of r.slice(n+1))e.push(o+i)}),e}var ey={fuzzyLink:!1,fuzzyEmail:!0,fuzzyIP:!1,"---":!1,tlds:Qv(),urlAuth:!1,maxLength:1e4},Nh=class{constructor(e,r,n,o){ie(this,"schema");ie(this,"index");ie(this,"lastIndex");ie(this,"raw");ie(this,"text");ie(this,"url");let i=e.slice(n,o);this.schema=r.toLowerCase(),this.index=n,this.lastIndex=o,this.raw=i,this.text=i,this.url=i}},Fh=class{constructor(e={}){ie(this,"__opts__");ie(this,"__schemas__");ie(this,"re");let{rebuilder:r,...n}=e;this.__opts__={...ey,...n},this.__schemas__={...Yv},this.re=r||new Vv,this.re.set({...this.__opts__,schema_names:Object.keys(this.__schemas__)})}add(e,r=null){if(!r)delete this.__schemas__[e];else{let n={normalize:(o,i)=>i.normalize(o),...r};this.__schemas__[e]=n}return this.re.set({...this.__opts__,schema_names:Object.keys(this.__schemas__)}),this}set(e={}){return this.__opts__={...this.__opts__,...e},this.re.set({...this.__opts__,schema_names:Object.keys(this.__schemas__)}),this}test(e){if(!e.length)return!1;let r,n;for(n=this.re.get_schema_search(),n.lastIndex=0;(r=n.exec(e))!==null;)if(this.testSchemaAt(e,r[2],n.lastIndex))return!0;if(this.__opts__.fuzzyLink&&this.__schemas__["http:"]&&(n=this.re.get_fuzzy_link_search(),n.lastIndex=0,n.exec(e)!==null))return!0;if(this.__opts__.fuzzyEmail&&this.__schemas__["mailto:"]&&e.indexOf("@")>=0){let o=this.re.get_fuzzy_mail_host_search(),i=this.re.get_mail_name_validator();for(o.lastIndex=0;(r=o.exec(e))!==null;){let a=e.slice(Math.max(0,r.index-65),r.index);if(i.test(a))return!0}}return!1}testSchemaAt(e,r,n){return this.__schemas__[r.toLowerCase()]?this.__schemas__[r.toLowerCase()].validate(e.slice(0,n+this.__opts__.maxLength),n,this):0}match(e){let r=[],n=this.re.get_schema_search(),o,i,a,s,l,u,c=!1,f=!1,h=!1,d=0;if(!e.length)return null;for(n.lastIndex=0,this.__opts__.fuzzyLink&&this.__schemas__["http:"]&&(o=this.re.get_fuzzy_link_search(),o.lastIndex=0),this.__opts__.fuzzyEmail&&this.__schemas__["mailto:"]&&(i=this.re.get_fuzzy_mail_host_search(),i.lastIndex=0,a=this.re.get_mail_name_validator());;){let p=Math.max(d-1,0);if(i&&a&&!h&&(!l||l.index<d))for(i.lastIndex<p&&(i.lastIndex=p);;){let b=i.exec(e);if(!b){h=!0,l=void 0;break}let k=a.exec(e.slice(Math.max(0,b.index-65),b.index));if(k){if(l={schema:"mailto:",index:b.index-k[1].length,lastIndex:b.index+b[0].length},l.index>=d)break;i.lastIndex<p&&(i.lastIndex=p)}}if(o&&!f&&(!s||s.index<d))for(o.lastIndex<p&&(o.lastIndex=p);;){let b=o.exec(e);if(!b){f=!0,s=void 0;break}if(s={schema:"",index:b.index+b[1].length,lastIndex:b.index+b[0].length},s.index>=d)break;o.lastIndex<p&&(o.lastIndex=p)}let m=l;(!m||s&&(s.index<m.index||s.index===m.index&&s.lastIndex>m.lastIndex))&&(m=s);let v;if(!c)for(;;){if(!u){n.lastIndex<p&&(n.lastIndex=p);let y=n.exec(e);if(!y){c=!0;break}u={schema:y[2],index:y.index+y[1].length,lastIndex:y.index+y[0].length}}if(u.index<d){u=void 0;continue}if(m&&u.index>m.index)break;let b=u;u=void 0;let k=this.testSchemaAt(e,b.schema,b.lastIndex);if(k){v={schema:b.schema,index:b.index,lastIndex:b.lastIndex+k};break}}let x=v;if((!x||l&&(l.index<x.index||l.index===x.index&&l.lastIndex>x.lastIndex))&&(x=l),(!x||s&&(s.index<x.index||s.index===x.index&&s.lastIndex>x.lastIndex))&&(x=s),!x)break;x===l?l=void 0:x===s&&(s=void 0);let g=new Nh(e,x.schema,x.index,x.lastIndex);g.schema?this.__schemas__[g.schema].normalize(g,this):this.normalize(g),r.push(g),d=x.lastIndex}return r.length?r:null}matchAtStart(e){if(!e.length)return null;let r=this.re.get_schema_at_start().exec(e);if(!r)return null;let n=this.testSchemaAt(e,r[2],r[0].length);if(!n)return null;let o=new Nh(e,r[2],r.index+r[1].length,r.index+r[0].length+n);return this.__schemas__[o.schema].normalize(o,this),o}tlds(e,r=!1){return e=Array.isArray(e)?e:[e],r?this.__opts__.tlds=this.__opts__.tlds.concat(e):this.__opts__.tlds=e,this.re.set({...this.__opts__,schema_names:Object.keys(this.__schemas__)}),this}normalize(e){e.schema||(e.url=`http://${e.url}`),e.schema==="mailto:"&&!/^mailto:/i.test(e.url)&&(e.url=`mailto:${e.url}`)}};var ty=/^xn--/,ry=/[^\0-\x7F]/,ny=/[\x2E\u3002\uFF0E\uFF61]/g,oy={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},Ra=35,Ze=Math.floor,Ea=String.fromCharCode;function bt(e){throw new RangeError(oy[e])}function iy(e,r){let n=[],o=e.length;for(;o--;)n[o]=r(e[o]);return n}function Lh(e,r){let n=e.split("@"),o="";n.length>1&&(o=n[0]+"@",e=n[1]),e=e.replace(ny,".");let i=e.split("."),a=iy(i,r).join(".");return o+a}function zh(e){let r=[],n=0,o=e.length;for(;n<o;){let i=e.charCodeAt(n++);if(i>=55296&&i<=56319&&n<o){let a=e.charCodeAt(n++);(a&64512)==56320?r.push(((i&1023)<<10)+(a&1023)+65536):(r.push(i),n--)}else r.push(i)}return r}var ay=e=>String.fromCodePoint(...e),sy=function(e){return e>=48&&e<58?26+(e-48):e>=65&&e<91?e-65:e>=97&&e<123?e-97:36},Ih=function(e,r){return e+22+75*(e<26)-((r!=0)<<5)},Ph=function(e,r,n){let o=0;for(e=n?Ze(e/700):e>>1,e+=Ze(e/r);e>Ra*26>>1;o+=36)e=Ze(e/Ra);return Ze(o+(Ra+1)*e/(e+38))},Oh=function(e){let r=[],n=e.length,o=0,i=128,a=72,s=e.lastIndexOf("-");s<0&&(s=0);for(let l=0;l<s;++l)e.charCodeAt(l)>=128&&bt("not-basic"),r.push(e.charCodeAt(l));for(let l=s>0?s+1:0;l<n;){let u=o;for(let f=1,h=36;;h+=36){l>=n&&bt("invalid-input");let d=sy(e.charCodeAt(l++));d>=36&&bt("invalid-input"),d>Ze((2147483647-o)/f)&&bt("overflow"),o+=d*f;let p=h<=a?1:h>=a+26?26:h-a;if(d<p)break;let m=36-p;f>Ze(2147483647/m)&&bt("overflow"),f*=m}let c=r.length+1;a=Ph(o-u,c,u==0),Ze(o/c)>2147483647-i&&bt("overflow"),i+=Ze(o/c),o%=c,r.splice(o++,0,i)}return String.fromCodePoint(...r)},Bh=function(e){let r=[];e=zh(e);let n=e.length,o=128,i=0,a=72;for(let u of e)u<128&&r.push(Ea(u));let s=r.length,l=s;for(s&&r.push("-");l<n;){let u=2147483647;for(let f of e)f>=o&&f<u&&(u=f);let c=l+1;u-o>Ze((2147483647-i)/c)&&bt("overflow"),i+=(u-o)*c,o=u;for(let f of e)if(f<o&&++i>2147483647&&bt("overflow"),f===o){let h=i;for(let d=36;;d+=36){let p=d<=a?1:d>=a+26?26:d-a;if(h<p)break;let m=h-p,v=36-p;r.push(Ea(Ih(p+m%v,0))),h=Ze(m/v)}r.push(Ea(Ih(h,0))),a=Ph(i,c,l===s),i=0,++l}++i,++o}return r.join("")},ly=function(e){return Lh(e,function(r){return ty.test(r)?Oh(r.slice(4).toLowerCase()):r})},uy=function(e){return Lh(e,function(r){return ry.test(r)?"xn--"+Bh(r):r})},cy={version:"2.3.1",ucs2:{decode:zh,encode:ay},decode:Oh,encode:Bh,toASCII:uy,toUnicode:ly};var Da=cy;var jh=Object.defineProperty,Kh=(e,r)=>{let n={};for(var o in e)jh(n,o,{get:e[o],enumerable:!0});return r||jh(n,Symbol.toStringTag,{value:"Module"}),n},fy=Kh({arrayReplaceAt:()=>hy,asciiTrim:()=>Uo,callable:()=>Qh,escapeHtml:()=>wt,escapeRE:()=>wy,fromCodePoint:()=>cn,isMdAsciiPunct:()=>dn,isPunctChar:()=>td,isPunctCharCode:()=>hn,isSpace:()=>Y,isValidEntityCode:()=>Ia,isWhiteSpace:()=>fn,lib:()=>ky,normalizeReference:()=>Ho,unescapeAll:()=>sr,unescapeMd:()=>gy});function Qh(e){let r=function(...n){return Reflect.construct(e,n,new.target&&new.target!==r?new.target:e)};return Object.defineProperty(r,"name",{value:e.name}),Object.setPrototypeOf(r,e),r.prototype=e.prototype,r}function hy(e,r,n){return[].concat(e.slice(0,r),n,e.slice(r+1))}function Ia(e){return!(e>=55296&&e<=57343||e>=64976&&e<=65007||(e&65535)===65535||(e&65535)===65534||e>=0&&e<=8||e===11||e>=14&&e<=31||e>=127&&e<=159||e>1114111)}function cn(e){if(e>65535){e-=65536;let r=55296+(e>>10),n=56320+(e&1023);return String.fromCharCode(r,n)}return String.fromCharCode(e)}var ed=/\\([!"#$%&'()*+,\-./:;<=>?@[\\\]^_`{|}~])/g,dy=new RegExp(`${ed.source}|${/&([a-z#][a-z0-9]{1,31});/gi.source}`,"gi"),py=/^#((?:x[a-f0-9]{1,8}|[0-9]{1,8}))$/i;function my(e,r){if(r.charCodeAt(0)===35&&py.test(r)){let o=r[1].toLowerCase()==="x"?parseInt(r.slice(2),16):parseInt(r.slice(1),10);return Ia(o)?cn(o):e}let n=Oo(e);return n!==e?n:e}function gy(e){return e.indexOf("\\")<0?e:e.replace(ed,"$1")}function sr(e){return e.indexOf("\\")<0&&e.indexOf("&")<0?e:e.replace(dy,function(r,n,o){return n||my(r,o)})}var xy=/[&<>"]/,vy=/[&<>"]/g,yy={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;"};function _y(e){return yy[e]}function wt(e){return xy.test(e)?e.replace(vy,_y):e}var by=/[.?*+^$[\]\\(){}|-]/g;function wy(e){return e.replace(by,"\\$&")}function Y(e){switch(e){case 9:case 32:return!0}return!1}function fn(e){if(e>=8192&&e<=8202)return!0;switch(e){case 9:case 10:case 11:case 12:case 13:case 32:case 160:case 5760:case 8239:case 8287:case 12288:return!0}return!1}function td(e){return ln.test(e)||_a.test(e)}function hn(e){return td(cn(e))}function dn(e){switch(e){case 33:case 34:case 35:case 36:case 37:case 38:case 39:case 40:case 41:case 42:case 43:case 44:case 45:case 46:case 47:case 58:case 59:case 60:case 61:case 62:case 63:case 64:case 91:case 92:case 93:case 94:case 95:case 96:case 123:case 124:case 125:case 126:return!0;default:return!1}}function Ho(e){return e=e.trim().replace(/\s+/g," "),e.toLowerCase().toUpperCase()}function $h(e){return e===32||e===9||e===10||e===13}function Uo(e){let r=0;for(;r<e.length&&$h(e.charCodeAt(r));r++);let n=e.length-1;for(;n>=r&&$h(e.charCodeAt(n));n--);return e.slice(r,n+1)}var ky={mdurl:xa,ucmicro:wa};function Cy(e,r,n){let o,i,a,s,l=e.posMax,u=e.pos;for(e.pos=r+1,o=1;e.pos<l;){if(a=e.src.charCodeAt(e.pos),a===93&&(o--,o===0)){i=!0;break}if(s=e.pos,e.md.inline.skipToken(e),a===91){if(s===e.pos-1)o++;else if(n)return e.pos=u,-1}}let c=-1;return i&&(c=e.pos),e.pos=u,c}function Ay(e,r,n){let o,i=r,a={ok:!1,pos:0,str:""};if(e.charCodeAt(i)===60){for(i++;i<n;){if(o=e.charCodeAt(i),o===10||o===60)return a;if(o===62)return a.pos=i+1,a.str=sr(e.slice(r+1,i)),a.ok=!0,a;if(o===92&&i+1<n){i+=2;continue}i++}return a}let s=0;for(;i<n&&(o=e.charCodeAt(i),!(o===32||o<32||o===127));){if(o===92&&i+1<n){if(e.charCodeAt(i+1)===32){i++;continue}i+=2;continue}if(o===40&&(s++,s>32))return a;if(o===41){if(s===0)break;s--}i++}return r===i||s!==0||(a.str=sr(e.slice(r,i)),a.pos=i,a.ok=!0),a}function Ry(e,r,n,o){let i,a=r,s={ok:!1,can_continue:!1,pos:0,str:"",marker:0};if(o)s.str=o.str,s.marker=o.marker;else{if(a>=n)return s;let l=e.charCodeAt(a);if(l!==34&&l!==39&&l!==40)return s;r++,a++,l===40&&(l=41),s.marker=l}for(;a<n;){if(i=e.charCodeAt(a),i===s.marker)return s.pos=a+1,s.str+=sr(e.slice(r,a)),s.ok=!0,s;if(i===40&&s.marker===41)return s;i===92&&a+1<n&&a++,a++}return s.can_continue=!0,s.str+=sr(e.slice(r,a)),s}var Ey=Kh({parseLinkDestination:()=>Ay,parseLinkLabel:()=>Cy,parseLinkTitle:()=>Ry});function pn(e){"@babel/helpers - typeof";return pn=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(r){return typeof r}:function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},pn(e)}function Dy(e,r){if(pn(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var o=n.call(e,r||"default");if(pn(o)!="object")return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return(r==="string"?String:Number)(e)}function Sy(e){var r=Dy(e,"string");return pn(r)=="symbol"?r:r+""}function P(e,r,n){return(r=Sy(r))in e?Object.defineProperty(e,r,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[r]=n,e}var jt=class{constructor(e,r,n){P(this,"map",null),P(this,"level",0),P(this,"children",null),P(this,"content",""),P(this,"markup",""),P(this,"info",""),P(this,"block",!1),P(this,"hidden",!1),this.type=e,this.tag=r,this.attrs=null,this.nesting=n,this.meta=null}attrIndex(e){if(!this.attrs)return-1;let r=this.attrs;for(let n=0,o=r.length;n<o;n++)if(r[n][0]===e)return n;return-1}attrPush(e){this.attrs?this.attrs.push(e):this.attrs=[e]}attrSet(e,r){let n=this.attrIndex(e),o=[e,r];n<0?this.attrPush(o):this.attrs[n]=o}attrGet(e){let r=this.attrIndex(e),n=null;return r>=0&&(n=this.attrs[r][1]),n}attrJoin(e,r){let n=this.attrIndex(e);n<0?this.attrPush([e,r]):this.attrs[n][1]=`${this.attrs[n][1]} ${r}`}},mn=class{constructor(){P(this,"__rules__",[]),P(this,"__cache__",null)}__find__(e){for(let r=0;r<this.__rules__.length;r++)if(this.__rules__[r].name===e)return r;return-1}__compile__(){let e=new Set;this.__rules__.forEach(r=>{r.enabled&&r.alt.forEach(n=>{n&&e.add(n)})}),this.__cache__=Object.create(null),this.__cache__[""]=[],this.__rules__.forEach(r=>{r.enabled&&this.__cache__[""].push(r.fn)}),e.forEach(r=>{this.__cache__[r]=[],this.__rules__.forEach(n=>{n.enabled&&n.alt.indexOf(r)>=0&&this.__cache__[r].push(n.fn)})})}at(e,r,n={}){let o=this.__find__(e);if(o===-1)throw new Error(`Parser rule not found: ${e}`);this.__rules__[o].fn=r,this.__rules__[o].alt=n.alt||[],this.__cache__=null}before(e,r,n,o={}){let i=this.__find__(e);if(i===-1)throw new Error(`Parser rule not found: ${e}`);this.__rules__.splice(i,0,{name:r,enabled:!0,fn:n,alt:o.alt||[]}),this.__cache__=null}after(e,r,n,o={}){let i=this.__find__(e);if(i===-1)throw new Error(`Parser rule not found: ${e}`);this.__rules__.splice(i+1,0,{name:r,enabled:!0,fn:n,alt:o.alt||[]}),this.__cache__=null}push(e,r,n={}){this.__rules__.push({name:e,enabled:!0,fn:r,alt:n.alt||[]}),this.__cache__=null}enable(e,r=!1){Array.isArray(e)||(e=[e]);let n=[];return e.forEach(o=>{let i=this.__find__(o);if(i<0){if(r)return;throw new Error(`Rules manager: invalid rule name ${o}`)}this.__rules__[i].enabled=!0,n.push(o)}),this.__cache__=null,n}enableOnly(e,r=!1){Array.isArray(e)||(e=[e]),this.__rules__.forEach(n=>{n.enabled=!1}),this.enable(e,r)}disable(e,r=!1){Array.isArray(e)||(e=[e]);let n=[];return e.forEach(o=>{let i=this.__find__(o);if(i<0){if(r)return;throw new Error(`Rules manager: invalid rule name ${o}`)}this.__rules__[i].enabled=!1,n.push(o)}),this.__cache__=null,n}getRules(e){return this.__cache__||this.__compile__(),this.__cache__[e]||[]}},Ke={};Ke.code_inline=function(e,r,n,o,i){let a=e[r];return`<code${i.renderAttrs(a)}>${wt(a.content)}</code>`};Ke.code_block=function(e,r,n,o,i){let a=e[r];return`<pre${i.renderAttrs(a)}><code>${wt(e[r].content)}</code></pre>
42
+ `};Ke.fence=function(e,r,n,o,i){let a=e[r],s=a.info?sr(a.info).trim():"",l="",u="";if(s){let f=s.split(/(\s+)/g);l=f[0],u=f.slice(2).join("")}let c;if(n.highlight?c=n.highlight(a.content,l,u)||wt(a.content):c=wt(a.content),c.indexOf("<pre")===0)return c+`
43
+ `;if(s){let f=a.attrIndex("class"),h=a.attrs?a.attrs.slice():[];f<0?h.push(["class",`${n.langPrefix}${l}`]):(h[f]=[h[f][0],h[f][1]],h[f][1]+=` ${n.langPrefix}${l}`);let d={attrs:h};return`<pre><code${i.renderAttrs(d)}>${c}</code></pre>
44
+ `}return`<pre><code${i.renderAttrs(a)}>${c}</code></pre>
45
+ `};Ke.image=function(e,r,n,o,i){let a=e[r];return a.attrs[a.attrIndex("alt")][1]=i.renderInlineAsText(a.children,n,o),i.renderToken(e,r,n)};Ke.hardbreak=function(e,r,n){return n.xhtmlOut?`<br />
46
+ `:`<br>
47
+ `};Ke.softbreak=function(e,r,n){return n.breaks?n.xhtmlOut?`<br />
48
+ `:`<br>
49
+ `:`
50
+ `};Ke.text=function(e,r){return wt(e[r].content)};Ke.html_block=function(e,r){return e[r].content};Ke.html_inline=function(e,r){return e[r].content};var rd=class{constructor(){P(this,"rules",Object.assign({},Ke))}renderAttrs(e){let r,n,o;if(!e.attrs)return"";for(o="",r=0,n=e.attrs.length;r<n;r++)o+=` ${wt(e.attrs[r][0])}="${wt(String(e.attrs[r][1]))}"`;return o}renderToken(e,r,n){let o=e[r],i="";if(o.hidden)return"";let a=r-1;for(;a>=0&&e[a].hidden&&e[a].nesting===0;)a--;o.block&&o.nesting!==-1&&a>=0&&e[a].hidden&&e[a].nesting===-1&&(i+=`
51
+ `),i+=(o.nesting===-1?"</":"<")+o.tag,i+=this.renderAttrs(o),o.nesting===0&&n.xhtmlOut&&(i+=" /");let s=!1;if(o.block&&(s=!0,o.nesting===1)){let l=r+1;for(;l<e.length&&e[l].hidden&&e[l].nesting===0;)l++;if(l<e.length){let u=e[l];(u.type==="inline"||u.hidden||u.nesting===-1&&u.tag===o.tag)&&(s=!1)}}return i+=s?`>
52
+ `:">",i}renderInline(e,r,n){let o="",i=this.rules;for(let a=0,s=e.length;a<s;a++){let l=e[a].type;typeof i[l]<"u"?o+=i[l](e,a,r,n,this):o+=this.renderToken(e,a,r)}return o}renderInlineAsText(e,r,n){let o="";for(let i=0,a=e.length;i<a;i++)switch(e[i].type){case"text":case"code_inline":o+=e[i].content;break;case"image":o+=this.renderInlineAsText(e[i].children,r,n);break;case"html_inline":case"html_block":o+=e[i].content;break;case"softbreak":case"hardbreak":o+=`
53
+ `}return o}render(e,r,n){let o="",i=this.rules;for(let a=0,s=e.length;a<s;a++){let l=e[a].type;l==="inline"?o+=this.renderInline(e[a].children,r,n):typeof i[l]<"u"?o+=i[l](e,a,r,n,this):o+=this.renderToken(e,a,r)}return o}},nd=class{constructor(e,r,n){P(this,"tokens",[]),P(this,"inlineMode",!1),P(this,"Token",jt),this.src=e,this.env=n,this.md=r}},My=/\r\n?/g,Ty=/\0/g;function Ny(e){let r;r=e.src.replace(My,`
54
+ `),r=r.replace(Ty,"\uFFFD"),e.src=r}function Fy(e){let r;e.inlineMode?(r=new e.Token("inline","",0),r.content=e.src,r.map=[0,1],r.children=[],e.tokens.push(r)):e.md.block.parse(e.src,e.md,e.env,e.tokens)}function Iy(e){let r=e.tokens,n=0;for(let o=0;o<r.length;o++)r[o].type!=="reference_definition"&&(o!==n&&(r[n]=r[o]),n++);r.length!==n&&(r.length=n)}function Ly(e){let r=e.tokens;for(let n=0,o=r.length;n<o;n++){let i=r[n];i.type==="inline"&&e.md.inline.parse(i.content,e.md,e.env,i.children)}}function zy(e){return/^<a[>\s]/i.test(e)}function Py(e){return/^<\/a\s*>/i.test(e)}function Oy(e){let r=e.tokens;if(e.md.options.linkify)for(let n=0,o=r.length;n<o;n++){if(r[n].type!=="inline"||!e.md.linkify.test(r[n].content))continue;let i=r[n].children,a=[],s=0;for(let l=i.length-1;l>=0;l--){let u=i[l];if(u.type==="link_close"){for(l--;i[l].level!==u.level&&i[l].type!=="link_open";)l--;continue}if(u.type==="html_inline"&&(zy(u.content)&&s>0&&s--,Py(u.content)&&s++),!(s>0)&&u.type==="text"&&e.md.linkify.test(u.content)){let c=u.content,f=e.md.linkify.match(c),h=[],d=u.level,p=0;f.length>0&&f[0].index===0&&l>0&&i[l-1].type==="text_special"&&(f=f.slice(1));for(let m=0;m<f.length;m++){let v=f[m].url,x=e.md.normalizeLink(v);if(!e.md.validateLink(x))continue;let g=f[m].text;f[m].schema?f[m].schema==="mailto:"&&!/^mailto:/i.test(g)?g=e.md.normalizeLinkText(`mailto:${g}`).replace(/^mailto:/,""):g=e.md.normalizeLinkText(g):g=e.md.normalizeLinkText(`http://${g}`).replace(/^http:\/\//,"");let b=f[m].index;if(b>p){let w=new e.Token("text","",0);w.content=c.slice(p,b),w.level=d,h.push(w)}let k=new e.Token("link_open","a",1);k.attrs=[["href",x]],k.level=d++,k.markup="linkify",k.info="auto",h.push(k);let y=new e.Token("text","",0);y.content=g,y.level=d,h.push(y);let _=new e.Token("link_close","a",-1);_.level=--d,_.markup="linkify",_.info="auto",h.push(_),p=f[m].lastIndex}if(p<c.length){let m=new e.Token("text","",0);m.content=c.slice(p),m.level=d,h.push(m)}a.push({index:l,nodes:h})}}if(a.length>0){let l=i.length;for(let h of a)l+=h.nodes.length-1;let u=new Array(l),c=0,f=0;a.reverse();for(let h=0;h<i.length;h++){let d=a[c];if(d?.index===h){for(let p of d.nodes)u[f++]=p;c++}else u[f++]=i[h]}r[n].children=u}}}var od=/\+-|\.\.|\?\?\?\?|!!!!|,,|--/,By=/\((c|tm|r)\)/i,jy=/\((c|tm|r)\)/gi,$y={c:"\xA9",r:"\xAE",tm:"\u2122"};function Hy(e,r){return $y[r.toLowerCase()]}function Uy(e){let r=0;for(let n=e.length-1;n>=0;n--){let o=e[n];o.type==="text"&&!r&&(o.content=o.content.replace(jy,Hy)),o.type==="link_open"&&o.info==="auto"&&r--,o.type==="link_close"&&o.info==="auto"&&r++}}function Gy(e){let r=0;for(let n=e.length-1;n>=0;n--){let o=e[n];o.type==="text"&&!r&&od.test(o.content)&&(o.content=o.content.replace(/\+-/g,"\xB1").replace(/\.{2,}/g,"\u2026").replace(/([?!])…/g,"$1..").replace(/([?!]){4,}/g,"$1$1$1").replace(/,{2,}/g,",").replace(/(^|[^-])---(?=[^-]|$)/gm,"$1\u2014").replace(/(^|\s)--(?=\s|$)/gm,"$1\u2013").replace(/(^|[^-\s])--(?=[^-\s]|$)/gm,"$1\u2013")),o.type==="link_open"&&o.info==="auto"&&r--,o.type==="link_close"&&o.info==="auto"&&r++}}function qy(e){let r;if(e.md.options.typographer)for(r=e.tokens.length-1;r>=0;r--)e.tokens[r].type==="inline"&&(By.test(e.tokens[r].content)&&Uy(e.tokens[r].children),od.test(e.tokens[r].content)&&Gy(e.tokens[r].children))}var Wy=/['"]/,Hh=/['"]/g,Uh="\u2019",Jy=1e3;function Gh(e,r,n){for(;e.length>n;){let o=e.pop();o.isSingleQuote?r.single=o.prevSameQuoteIdx:r.double=o.prevSameQuoteIdx}}function Bo(e,r,n,o){e[r]||(e[r]=[]),e[r].push({pos:n,ch:o})}function Xy(e,r){let n="",o=0;r.sort((i,a)=>i.pos-a.pos);for(let i=0;i<r.length;i++){let a=r[i];n+=e.slice(o,a.pos)+a.ch,o=a.pos+1}return n+e.slice(o)}function Vy(e,r){let n,o=[],i={single:-1,double:-1},a={};for(let s=0;s<e.length;s++){let l=e[s],u=e[s].level;for(n=o.length-1;n>=0&&!(o[n].level<=u);n--);if(Gh(o,i,n+1),l.type!=="text")continue;let c=l.content,f=0,h=c.length;e:for(;f<h;){Hh.lastIndex=f;let d=Hh.exec(c);if(!d)break;let p=!0,m=!0;f=d.index+1;let v=d[0]==="'",x=32;if(d.index-1>=0)x=c.charCodeAt(d.index-1);else for(n=s-1;n>=0&&!(e[n].type==="softbreak"||e[n].type==="hardbreak");n--)if(e[n].content){x=e[n].content.charCodeAt(e[n].content.length-1);break}let g=32;if(f<h)g=c.charCodeAt(f);else for(n=s+1;n<e.length&&!(e[n].type==="softbreak"||e[n].type==="hardbreak");n++)if(e[n].content){g=e[n].content.charCodeAt(0);break}let b=dn(x)||hn(x),k=dn(g)||hn(g),y=fn(x),_=fn(g);if(_?p=!1:k&&(y||b||(p=!1)),y?m=!1:b&&(_||k||(m=!1)),g===34&&d[0]==='"'&&x>=48&&x<=57&&(m=p=!1),p&&m&&(p=b,m=k),!p&&!m){v&&Bo(a,s,d.index,Uh);continue}if(m&&(n=v?i.single:i.double,n>=0&&o[n].level===u)){let w=o[n],C,R;v?(C=r.md.options.quotes[2],R=r.md.options.quotes[3]):(C=r.md.options.quotes[0],R=r.md.options.quotes[1]),Bo(a,s,d.index,R),Bo(a,w.tokenIdx,w.contentPos,C),Gh(o,i,n);continue e}if(p){if(o.length>=Jy)return;o.push({tokenIdx:s,contentPos:d.index,isSingleQuote:v,level:u,prevSameQuoteIdx:v?i.single:i.double}),v?i.single=o.length-1:i.double=o.length-1}else m&&v&&Bo(a,s,d.index,Uh)}}Object.keys(a).forEach(function(s){let l=Number(s);e[l].content=Xy(e[l].content,a[s])})}function Yy(e){if(e.md.options.typographer)for(let r=e.tokens.length-1;r>=0;r--)e.tokens[r].type!=="inline"||!Wy.test(e.tokens[r].content)||Vy(e.tokens[r].children,e)}function Zy(e){let r,n,o=e.length;for(r=0;r<o;r++)e[r].type==="text_special"&&(e[r].type="text");for(r=n=0;r<o;r++)e[r].type==="text"&&r+1<o&&e[r+1].type==="text"?e[r+1].content=e[r].content+e[r+1].content:(r!==n&&(e[n]=e[r]),n++);r!==n&&(e.length=n)}function Ky(e){let r,n,o=e.tokens,i=o.length;for(let a=0;a<i;a++){if(o[a].type!=="inline")continue;let s=o[a].children,l=s.length;for(r=0;r<l;r++)s[r].type==="text_special"&&(s[r].type="text"),s[r].children&&Zy(s[r].children);for(r=n=0;r<l;r++)s[r].type==="text"&&r+1<l&&s[r+1].type==="text"?s[r+1].content=s[r].content+s[r+1].content:(r!==n&&(s[n]=s[r]),n++);r!==n&&(s.length=n)}}var Sa=[["normalize",Ny],["block",Fy],["strip_references",Iy],["inline",Ly],["linkify",Oy],["replacements",qy],["smartquotes",Yy],["text_join",Ky]],id=class{constructor(){P(this,"ruler",new mn),P(this,"State",nd);for(let e=0;e<Sa.length;e++)this.ruler.push(Sa[e][0],Sa[e][1])}process(e){let r=this.ruler.getRules("");for(let n=0,o=r.length;n<o;n++)r[n](e)}},ad=class{constructor(e,r,n,o){P(this,"bMarks",[]),P(this,"eMarks",[]),P(this,"tShift",[]),P(this,"sCount",[]),P(this,"bsCount",[]),P(this,"blkIndent",0),P(this,"line",0),P(this,"lineMax",0),P(this,"tight",!1),P(this,"listIndent",-1),P(this,"parentType","root"),P(this,"level",0),P(this,"Token",jt),this.src=e,this.md=r,this.env=n,this.tokens=o;let i=this.src;for(let a=0,s=0,l=0,u=0,c=i.length,f=!1;s<c;s++){let h=i.charCodeAt(s);if(!f)if(Y(h)){l++,h===9?u+=4-u%4:u++;continue}else f=!0;(h===10||s===c-1)&&(h!==10&&s++,this.bMarks.push(a),this.eMarks.push(s),this.tShift.push(l),this.sCount.push(u),this.bsCount.push(0),f=!1,l=0,u=0,a=s+1)}this.bMarks.push(i.length),this.eMarks.push(i.length),this.tShift.push(0),this.sCount.push(0),this.bsCount.push(0),this.lineMax=this.bMarks.length-1}push(e,r,n){let o=new jt(e,r,n);return o.block=!0,n<0&&this.level--,o.level=this.level,n>0&&this.level++,this.tokens.push(o),o}isEmpty(e){return this.bMarks[e]+this.tShift[e]>=this.eMarks[e]}skipEmptyLines(e){for(let r=this.lineMax;e<r&&!(this.bMarks[e]+this.tShift[e]<this.eMarks[e]);e++);return e}skipSpaces(e){for(let r=this.src.length;e<r&&Y(this.src.charCodeAt(e));e++);return e}skipSpacesBack(e,r){if(e<=r)return e;for(;e>r;)if(!Y(this.src.charCodeAt(--e)))return e+1;return e}skipChars(e,r){for(let n=this.src.length;e<n&&this.src.charCodeAt(e)===r;e++);return e}skipCharsBack(e,r,n){if(e<=n)return e;for(;e>n;)if(r!==this.src.charCodeAt(--e))return e+1;return e}getLines(e,r,n,o){if(e>=r)return"";let i=new Array(r-e);for(let a=0,s=e;s<r;s++,a++){let l=0,u=this.bMarks[s],c=u,f;for(s+1<r||o?f=this.eMarks[s]+1:f=this.eMarks[s];c<f&&l<n;){let h=this.src.charCodeAt(c);if(Y(h))h===9?l+=4-(l+this.bsCount[s])%4:l++;else if(c-u<this.tShift[s])l++;else break;c++}l>n?i[a]=new Array(l-n+1).join(" ")+this.src.slice(c,f):i[a]=this.src.slice(c,f)}return i.join("")}},Qy=65536;function Ma(e,r){let n=e.bMarks[r]+e.tShift[r],o=e.eMarks[r];return e.src.slice(n,o)}function qh(e){let r=[],n=e.length,o=0,i=e.charCodeAt(o),a=!1,s=0,l="";for(;o<n;)i===124&&(a?(l+=e.substring(s,o-1),s=o):(r.push(l+e.substring(s,o)),l="",s=o+1)),a=i===92,o++,i=e.charCodeAt(o);return r.push(l+e.substring(s)),r}function e_(e,r,n,o){if(r+2>n)return!1;let i=r+1;if(e.sCount[i]<e.blkIndent||e.sCount[i]-e.blkIndent>=4)return!1;let a=e.bMarks[i]+e.tShift[i];if(a>=e.eMarks[i])return!1;let s=e.src.charCodeAt(a++);if(s!==124&&s!==45&&s!==58||a>=e.eMarks[i])return!1;let l=e.src.charCodeAt(a++);if(l!==124&&l!==45&&l!==58&&!Y(l)||s===45&&Y(l))return!1;for(;a<e.eMarks[i];){let y=e.src.charCodeAt(a);if(y!==124&&y!==45&&y!==58&&!Y(y))return!1;a++}let u=Ma(e,r+1),c=u.split("|"),f=[];for(let y=0;y<c.length;y++){let _=c[y].trim();if(!_){if(y===0||y===c.length-1)continue;return!1}if(!/^:?-+:?$/.test(_))return!1;_.charCodeAt(_.length-1)===58?f.push(_.charCodeAt(0)===58?"center":"right"):_.charCodeAt(0)===58?f.push("left"):f.push("")}if(u=Ma(e,r).trim(),u.indexOf("|")===-1||e.sCount[r]-e.blkIndent>=4)return!1;c=qh(u),c.length&&c[0]===""&&c.shift(),c.length&&c[c.length-1]===""&&c.pop();let h=c.length;if(h===0||h!==f.length)return!1;if(o)return!0;let d=e.parentType;e.parentType="table";let p=e.md.block.ruler.getRules("blockquote"),m=e.push("table_open","table",1),v=[r,0];m.map=v;let x=e.push("thead_open","thead",1);x.map=[r,r+1];let g=e.push("tr_open","tr",1);g.map=[r,r+1];for(let y=0;y<c.length;y++){let _=e.push("th_open","th",1);f[y]&&(_.attrs=[["style",`text-align:${f[y]}`]]);let w=e.push("inline","",0);w.content=c[y].trim(),w.children=[],e.push("th_close","th",-1)}e.push("tr_close","tr",-1),e.push("thead_close","thead",-1);let b,k=0;for(i=r+2;i<n&&!(e.sCount[i]<e.blkIndent);i++){let y=!1;for(let w=0,C=p.length;w<C;w++)if(p[w](e,i,n,!0)){y=!0;break}if(y||(u=Ma(e,i).trim(),!u)||e.sCount[i]-e.blkIndent>=4||(c=qh(u),c.length&&c[0]===""&&c.shift(),c.length&&c[c.length-1]===""&&c.pop(),k+=h-c.length,k>Qy))break;if(i===r+2){let w=e.push("tbody_open","tbody",1);w.map=b=[r+2,0]}let _=e.push("tr_open","tr",1);_.map=[i,i+1];for(let w=0;w<h;w++){let C=e.push("td_open","td",1);f[w]&&(C.attrs=[["style",`text-align:${f[w]}`]]);let R=e.push("inline","",0);R.content=c[w]?c[w].trim():"",R.children=[],e.push("td_close","td",-1)}e.push("tr_close","tr",-1)}return b&&(e.push("tbody_close","tbody",-1),b[1]=i),e.push("table_close","table",-1),v[1]=i,e.parentType=d,e.line=i,!0}function t_(e,r,n){if(e.sCount[r]-e.blkIndent<4)return!1;let o=r+1,i=o;for(;o<n;){if(e.isEmpty(o)){o++;continue}if(e.sCount[o]-e.blkIndent>=4){o++,i=o;continue}break}e.line=i;let a=e.push("code_block","code",0);return a.content=e.getLines(r,i,4+e.blkIndent,!1)+`
55
+ `,a.map=[r,e.line],!0}function r_(e,r,n,o){let i=e.bMarks[r]+e.tShift[r],a=e.eMarks[r];if(e.sCount[r]-e.blkIndent>=4||i+3>a)return!1;let s=e.src.charCodeAt(i);if(s!==126&&s!==96)return!1;let l=i;i=e.skipChars(i,s);let u=i-l;if(u<3)return!1;let c=e.src.slice(l,i),f=e.src.slice(i,a);if(s===96&&f.indexOf(String.fromCharCode(s))>=0)return!1;if(o)return!0;let h=r,d=!1;for(;h++,!(h>=n||(i=l=e.bMarks[h]+e.tShift[h],a=e.eMarks[h],i<a&&e.sCount[h]<e.blkIndent));)if(e.src.charCodeAt(i)===s&&!(e.sCount[h]-e.blkIndent>=4)&&(i=e.skipChars(i,s),!(i-l<u)&&(i=e.skipSpaces(i),!(i<a)))){d=!0;break}u=e.sCount[r],e.line=h+(d?1:0);let p=e.push("fence","code",0);return p.info=f,p.content=e.getLines(r+1,h,u,!0),p.markup=c,p.map=[r,e.line],!0}function n_(e,r,n,o){let i=e.bMarks[r]+e.tShift[r],a=e.eMarks[r],s=e.lineMax;if(e.sCount[r]-e.blkIndent>=4||e.src.charCodeAt(i)!==62)return!1;if(o)return!0;let l=[],u=[],c=[],f=[],h=e.md.block.ruler.getRules("blockquote"),d=e.parentType;e.parentType="blockquote";let p=!1,m;for(m=r;m<n;m++){let k=e.sCount[m]<e.blkIndent;if(i=e.bMarks[m]+e.tShift[m],a=e.eMarks[m],i>=a)break;if(e.src.charCodeAt(i++)===62&&!k){let _=e.sCount[m]+1,w,C;e.src.charCodeAt(i)===32?(i++,_++,C=!1,w=!0):e.src.charCodeAt(i)===9?(w=!0,(e.bsCount[m]+_)%4===3?(i++,_++,C=!1):C=!0):w=!1;let R=_;for(l.push(e.bMarks[m]),e.bMarks[m]=i;i<a;){let S=e.src.charCodeAt(i);if(Y(S))S===9?R+=4-(R+e.bsCount[m]+(C?1:0))%4:R++;else break;i++}p=i>=a,u.push(e.bsCount[m]),e.bsCount[m]=e.sCount[m]+1+(w?1:0),c.push(e.sCount[m]),e.sCount[m]=R-_,f.push(e.tShift[m]),e.tShift[m]=i-e.bMarks[m];continue}if(p)break;let y=!1;for(let _=0,w=h.length;_<w;_++)if(h[_](e,m,n,!0)){y=!0;break}if(y){e.lineMax=m,e.blkIndent!==0&&(l.push(e.bMarks[m]),u.push(e.bsCount[m]),f.push(e.tShift[m]),c.push(e.sCount[m]),e.sCount[m]-=e.blkIndent);break}l.push(e.bMarks[m]),u.push(e.bsCount[m]),f.push(e.tShift[m]),c.push(e.sCount[m]),e.sCount[m]=-1}let v=e.blkIndent;e.blkIndent=0;let x=e.push("blockquote_open","blockquote",1);x.markup=">";let g=[r,0];x.map=g,e.md.block.tokenize(e,r,m);let b=e.push("blockquote_close","blockquote",-1);b.markup=">",e.lineMax=s,e.parentType=d,g[1]=e.line;for(let k=0;k<f.length;k++)e.bMarks[k+r]=l[k],e.tShift[k+r]=f[k],e.sCount[k+r]=c[k],e.bsCount[k+r]=u[k];return e.blkIndent=v,!0}function o_(e,r,n,o){let i=e.eMarks[r];if(e.sCount[r]-e.blkIndent>=4)return!1;let a=e.bMarks[r]+e.tShift[r],s=e.src.charCodeAt(a++);if(s!==42&&s!==45&&s!==95)return!1;let l=1;for(;a<i;){let c=e.src.charCodeAt(a++);if(c!==s&&!Y(c))return!1;c===s&&l++}if(l<3)return!1;if(o)return!0;e.line=r+1;let u=e.push("hr","hr",0);return u.map=[r,e.line],u.markup=Array(l+1).join(String.fromCharCode(s)),!0}function Wh(e,r){let n=e.eMarks[r],o=e.bMarks[r]+e.tShift[r],i=e.src.charCodeAt(o++);return i!==42&&i!==45&&i!==43||o<n&&!Y(e.src.charCodeAt(o))?-1:o}function Jh(e,r){let n=e.bMarks[r]+e.tShift[r],o=e.eMarks[r],i=n;if(i+1>=o)return-1;let a=e.src.charCodeAt(i++);if(a<48||a>57)return-1;for(;;){if(i>=o)return-1;if(a=e.src.charCodeAt(i++),a>=48&&a<=57){if(i-n>=10)return-1;continue}if(a===41||a===46)break;return-1}return i<o&&(a=e.src.charCodeAt(i),!Y(a))?-1:i}function i_(e,r){let n=e.level+2;for(let o=r+2,i=e.tokens.length-2;o<i;o++)e.tokens[o].level===n&&e.tokens[o].type==="paragraph_open"&&(e.tokens[o+2].hidden=!0,e.tokens[o].hidden=!0,o+=2)}function a_(e,r,n,o){let i,a,s,l,u=r,c=!0;if(e.sCount[u]-e.blkIndent>=4||e.listIndent>=0&&e.sCount[u]-e.listIndent>=4&&e.sCount[u]<e.blkIndent)return!1;let f=!1;o&&e.parentType==="paragraph"&&e.sCount[u]>=e.blkIndent&&(f=!0);let h,d,p;if((p=Jh(e,u))>=0){if(h=!0,s=e.bMarks[u]+e.tShift[u],d=Number(e.src.slice(s,p-1)),f&&d!==1)return!1}else if((p=Wh(e,u))>=0)h=!1;else return!1;if(f&&e.skipSpaces(p)>=e.eMarks[u])return!1;if(o)return!0;let m=e.src.charCodeAt(p-1),v=e.tokens.length;h?(l=e.push("ordered_list_open","ol",1),d!==1&&(l.attrs=[["start",d]])):l=e.push("bullet_list_open","ul",1);let x=[u,0];l.map=x,l.markup=String.fromCharCode(m);let g=!1,b=e.md.block.ruler.getRules("list"),k=e.parentType;for(e.parentType="list";u<n;){a=p,i=e.eMarks[u];let y=e.sCount[u]+p-(e.bMarks[u]+e.tShift[u]),_=y;for(;a<i;){let F=e.src.charCodeAt(a);if(F===9)_+=4-(_+e.bsCount[u])%4;else if(F===32)_++;else break;a++}let w=a,C;w>=i?C=1:C=_-y,C>4&&(C=1);let R=y+C;l=e.push("list_item_open","li",1),l.markup=String.fromCharCode(m);let S=[u,0];l.map=S,h&&(l.info=e.src.slice(s,p-1));let N=e.tight,T=e.tShift[u],L=e.sCount[u],B=e.listIndent;if(e.listIndent=e.blkIndent,e.blkIndent=R,e.tight=!0,e.tShift[u]=w-e.bMarks[u],e.sCount[u]=_,w>=i&&e.isEmpty(u+1)?e.line=Math.min(e.line+2,n):e.md.block.tokenize(e,u,n),(!e.tight||g)&&(c=!1),g=e.line-u>1&&e.isEmpty(e.line-1),e.blkIndent=e.listIndent,e.listIndent=B,e.tShift[u]=T,e.sCount[u]=L,e.tight=N,l=e.push("list_item_close","li",-1),l.markup=String.fromCharCode(m),u=e.line,S[1]=u,u>=n||e.sCount[u]<e.blkIndent||e.sCount[u]-e.blkIndent>=4)break;let A=!1;for(let F=0,M=b.length;F<M;F++)if(b[F](e,u,n,!0)){A=!0;break}if(A)break;if(h){if(p=Jh(e,u),p<0)break;s=e.bMarks[u]+e.tShift[u]}else if(p=Wh(e,u),p<0)break;if(m!==e.src.charCodeAt(p-1))break}return h?l=e.push("ordered_list_close","ol",-1):l=e.push("bullet_list_close","ul",-1),l.markup=String.fromCharCode(m),x[1]=u,e.line=u,e.parentType=k,c&&i_(e,v),!0}var Ta=999;function s_(e){let r=e.length;for(let n=0;n<e.length-1;n++){let o=e.charCodeAt(n);if(o<55296||o>56319)continue;let i=e.charCodeAt(n+1);i>=56320&&i<=57343&&(r--,n++)}return r}function un(e,r){return Math.min(e.eMarks[r]+1,e.src.length)}function jo(e,r){let n=e.lineMax;if(r>=n||e.isEmpty(r))return-1;let o=!1;if(e.sCount[r]-e.blkIndent>3&&(o=!0),e.sCount[r]<0&&(o=!0),!o){let i=e.md.block.ruler.getRules("reference"),a=e.parentType;e.parentType="reference";let s=!1;for(let l=0,u=i.length;l<u;l++)if(i[l](e,r,n,!0)){s=!0;break}if(e.parentType=a,s)return-1}return e.bMarks[r]+e.tShift[r]}function l_(e,r,n,o){let i=e.src,a=e.bMarks[r]+e.tShift[r],s=r+1;if(e.sCount[r]-e.blkIndent>=4||i.charCodeAt(a)!==91)return!1;let l=un(e,r),u="",c=-1,f=++a;for(;a<l;){if(u.length+a-f>Ta*2)return!1;let w=i.charCodeAt(a);if(w===91)return!1;if(w===93){c=a;break}if(w===92&&(w=i.charCodeAt(++a)),w===10&&a<l){let C=jo(e,s);if(C<0)return!1;u+=i.slice(f,l),a=f=C,l=un(e,s++);continue}a++}if(c<0||i.charCodeAt(c+1)!==58||(u+=i.slice(f,c),u.length>Ta&&s_(u)>Ta))return!1;for(a=c+2;a<l;){let w=i.charCodeAt(a);if(w===10){let C=jo(e,s);if(C<0)break;a=C,l=un(e,s++)}else if(Y(w))a++;else break}let h=e.md.helpers.parseLinkDestination(i,a,l);if(!h.ok)return!1;let d=e.md.normalizeLink(h.str);if(!e.md.validateLink(d))return!1;a=h.pos;let p=a,m=l,v=s;for(;a<l;){let w=i.charCodeAt(a);if(w===10){let C=jo(e,s);if(C<0)break;a=C,l=un(e,s++)}else if(Y(w))a++;else break}let x=a,g=e.md.helpers.parseLinkTitle(i,a,l);for(;g.can_continue;){let w=jo(e,s);if(w<0)break;a=w,l=un(e,s++),g=e.md.helpers.parseLinkTitle(i,a,l,g)}let b;for(x!==p&&g.ok?(b=g.str,a=g.pos):(b="",a=p,l=m,s=v);a<l&&Y(i.charCodeAt(a));)a++;if(a<l&&i.charCodeAt(a)!==10&&b)for(b="",a=p,l=m,s=v;a<l&&Y(i.charCodeAt(a));)a++;if(a<l&&i.charCodeAt(a)!==10)return!1;let k=Ho(u);if(!k)return!1;if(o)return!0;typeof e.env.references>"u"&&(e.env.references={}),typeof e.env.references[k]>"u"&&(e.env.references[k]={title:b,href:d});let y=e.push("reference_definition","",0);y.map=[r,s],y.hidden=!0;let _=Object.create(null);return _.label=k,y.meta=_,e.line=s,!0}var u_=["address","article","aside","base","basefont","blockquote","body","caption","center","col","colgroup","dd","details","dialog","dir","div","dl","dt","fieldset","figcaption","figure","footer","form","frame","frameset","h1","h2","h3","h4","h5","h6","head","header","hr","html","iframe","legend","li","link","main","menu","menuitem","nav","noframes","ol","optgroup","option","p","param","search","section","summary","table","tbody","td","tfoot","th","thead","title","tr","track","ul"],sd=`<[A-Za-z][A-Za-z0-9\\-]*(?:\\s+[a-zA-Z_:][a-zA-Z0-9:._-]*(?:\\s*=\\s*(?:[^"'=<>\`\\x00-\\x20]+|'[^']*'|"[^"]*"))?)*\\s*\\/?>`,ld="<\\/[A-Za-z][A-Za-z0-9\\-]*\\s*>";new RegExp(`^(?:${sd}|${ld}|<!---?>|<!--(?:[^-]|-[^-]|--[^>])*-->|<[?][\\s\\S]*?[?]>|<![A-Za-z][^>]*>|<!\\[CDATA\\[[\\s\\S]*?\\]\\]>)`);var ud=new RegExp(`^(?:${sd}|${ld})`),Bt=[[/^<(script|pre|style|textarea)(?=(\s|>|$))/i,/<\/(script|pre|style|textarea)>/i,!0],[/^<!--/,/-->/,!0],[/^<\?/,/\?>/,!0],[/^<![A-Za-z]/,/>/,!0],[/^<!\[CDATA\[/,/\]\]>/,!0],[new RegExp(`^</?(${u_.join("|")})(?=(\\s|/?>|$))`,"i"),/^$/,!0],[new RegExp(`${ud.source}\\s*$`),/^$/,!1]];function c_(e,r,n,o){let i=e.bMarks[r]+e.tShift[r],a=e.eMarks[r];if(e.sCount[r]-e.blkIndent>=4||!e.md.options.html||e.src.charCodeAt(i)!==60)return!1;let s=e.src.slice(i,a),l=0;for(;l<Bt.length&&!Bt[l][0].test(s);l++);if(l===Bt.length)return!1;if(o)return Bt[l][2];let u=r+1,c=Bt[l][1].test("");if(!Bt[l][1].test(s)){for(;u<n&&!(e.sCount[u]<e.blkIndent&&(c||!e.isEmpty(u)));u++)if(i=e.bMarks[u]+e.tShift[u],a=e.eMarks[u],s=e.src.slice(i,a),Bt[l][1].test(s)){s.length!==0&&u++;break}}e.line=u;let f=e.push("html_block","",0);return f.map=[r,u],f.content=e.getLines(r,u,e.blkIndent,!0),!0}function f_(e,r,n,o){let i=e.bMarks[r]+e.tShift[r],a=e.eMarks[r];if(e.sCount[r]-e.blkIndent>=4)return!1;let s=e.src.charCodeAt(i);if(s!==35||i>=a)return!1;let l=1;for(s=e.src.charCodeAt(++i);s===35&&i<a&&l<=6;)l++,s=e.src.charCodeAt(++i);if(l>6||i<a&&!Y(s))return!1;if(o)return!0;a=e.skipSpacesBack(a,i);let u=e.skipCharsBack(a,35,i);u>i&&Y(e.src.charCodeAt(u-1))&&(a=u),e.line=r+1;let c=e.push("heading_open",`h${l}`,1);c.markup="########".slice(0,l),c.map=[r,e.line];let f=e.push("inline","",0);f.content=Uo(e.src.slice(i,a)),f.map=[r,e.line],f.children=[];let h=e.push("heading_close",`h${l}`,-1);return h.markup="########".slice(0,l),!0}function h_(e,r,n){let o=e.md.block.ruler.getRules("paragraph");if(e.sCount[r]-e.blkIndent>=4)return!1;let i=e.parentType;e.parentType="paragraph";let a=0,s,l=r+1;for(;l<n&&!e.isEmpty(l);l++){if(e.sCount[l]-e.blkIndent>3)continue;if(e.sCount[l]>=e.blkIndent){let p=e.bMarks[l]+e.tShift[l],m=e.eMarks[l];if(p<m&&(s=e.src.charCodeAt(p),(s===45||s===61)&&(p=e.skipChars(p,s),p=e.skipSpaces(p),p>=m))){a=s===61?1:2;break}}if(e.sCount[l]<0)continue;let d=!1;for(let p=0,m=o.length;p<m;p++)if(o[p](e,l,n,!0)){d=!0;break}if(d)break}if(!a)return e.parentType=i,!1;let u=Uo(e.getLines(r,l,e.blkIndent,!1));e.line=l+1;let c=e.push("heading_open",`h${a}`,1);c.markup=String.fromCharCode(s),c.map=[r,e.line];let f=e.push("inline","",0);f.content=u,f.map=[r,e.line-1],f.children=[];let h=e.push("heading_close",`h${a}`,-1);return h.markup=String.fromCharCode(s),e.parentType=i,!0}function d_(e,r,n){let o=e.md.block.ruler.getRules("paragraph"),i=e.parentType,a=r+1;for(e.parentType="paragraph";a<n&&!e.isEmpty(a);a++){if(e.sCount[a]-e.blkIndent>3||e.sCount[a]<0)continue;let c=!1;for(let f=0,h=o.length;f<h;f++)if(o[f](e,a,n,!0)){c=!0;break}if(c)break}let s=Uo(e.getLines(r,a,e.blkIndent,!1));e.line=a;let l=e.push("paragraph_open","p",1);l.map=[r,e.line];let u=e.push("inline","",0);return u.content=s,u.map=[r,e.line],u.children=[],e.push("paragraph_close","p",-1),e.parentType=i,!0}var $o=[["table",e_,["paragraph","reference"]],["code",t_],["fence",r_,["paragraph","reference","blockquote","list"]],["blockquote",n_,["paragraph","reference","blockquote","list"]],["hr",o_,["paragraph","reference","blockquote","list"]],["list",a_,["paragraph","reference","blockquote"]],["reference",l_],["html_block",c_,["paragraph","reference","blockquote"]],["heading",f_,["paragraph","reference","blockquote"]],["lheading",h_],["paragraph",d_]],cd=class{constructor(){P(this,"ruler",new mn),P(this,"State",ad);for(let e=0;e<$o.length;e++)this.ruler.push($o[e][0],$o[e][1],{alt:($o[e][2]||[]).slice()})}tokenize(e,r,n){let o=this.ruler.getRules(""),i=o.length,a=e.md.options.maxNesting,s=r,l=!1;for(;s<n&&(e.line=s=e.skipEmptyLines(s),!(s>=n||e.sCount[s]<e.blkIndent));){if(e.level>=a){e.line=n;break}let u=e.line,c=!1;for(let f=0;f<i;f++)if(c=o[f](e,s,n,!1),c){if(u>=e.line)throw new Error("block rule didn't increment state.line");break}if(!c)throw new Error("none of the block rules matched");e.tight=!l,e.isEmpty(e.line-1)&&(l=!0),s=e.line,s<n&&e.isEmpty(s)&&(l=!0,s++,e.line=s)}}parse(e,r,n,o){if(!e)return;let i=new this.State(e,r,n,o);this.tokenize(i,i.line,i.lineMax)}},fd=class{constructor(e,r,n,o){P(this,"pos",0),P(this,"level",0),P(this,"pending",""),P(this,"pendingLevel",0),P(this,"cache",{}),P(this,"backticks",{}),P(this,"backticksScanned",!1),P(this,"skipHtmlSpecial",!1),P(this,"linkLevel",0),P(this,"delimiters",[]),P(this,"_prev_delimiters",[]),P(this,"Token",jt),this.src=e,this.env=n,this.md=r,this.tokens=o,this.tokens_meta=Array(o.length),this.posMax=this.src.length}pushPending(){let e=new jt("text","",0);return e.content=this.pending,e.level=this.pendingLevel,this.tokens.push(e),this.pending="",e}push(e,r,n){this.pending&&this.pushPending();let o=new jt(e,r,n),i;return n<0&&(this.level--,this.delimiters=this._prev_delimiters.pop()),o.level=this.level,n>0&&(this.level++,this._prev_delimiters.push(this.delimiters),this.delimiters=[],i={delimiters:this.delimiters}),this.pendingLevel=this.level,this.tokens.push(o),this.tokens_meta.push(i),o}scanDelims(e,r){let n=this.posMax,o=this.src.charCodeAt(e),i;if(e===0)i=32;else if(e===1)i=this.src.charCodeAt(0),(i&63488)===55296&&(i=65533);else if(i=this.src.charCodeAt(e-1),(i&64512)===56320){let m=this.src.charCodeAt(e-2);i=(m&64512)===55296?65536+(m-55296<<10)+(i-56320):65533}else(i&64512)===55296&&(i=65533);let a=e;for(;a<n&&this.src.charCodeAt(a)===o;)a++;let s=a-e,l=a<n?this.src.charCodeAt(a):32;if((l&64512)===55296){let m=this.src.charCodeAt(a+1);l=(m&64512)===56320?65536+(l-55296<<10)+(m-56320):65533}else(l&64512)===56320&&(l=65533);let u=dn(i)||hn(i),c=dn(l)||hn(l),f=fn(i),h=fn(l),d=!h&&(!c||f||u),p=!f&&(!u||h||c);return{can_open:d&&(r||!p||u),can_close:p&&(r||!d||c),length:s}}};function p_(e){switch(e){case 10:case 33:case 35:case 36:case 37:case 38:case 42:case 43:case 45:case 58:case 60:case 61:case 62:case 64:case 91:case 92:case 93:case 94:case 95:case 96:case 123:case 125:case 126:return!0;default:return!1}}function m_(e,r){let n=e.pos;for(;n<e.posMax&&!p_(e.src.charCodeAt(n));)n++;return n===e.pos?!1:(r||(e.pending+=e.src.slice(e.pos,n)),e.pos=n,!0)}function g_(e){return e>=65&&e<=90||e>=97&&e<=122}function x_(e){return e>=65&&e<=90||e>=97&&e<=122||e>=48&&e<=57||e===43||e===45||e===46}function v_(e,r){if(!e.md.options.linkify||e.linkLevel>0)return!1;let n=e.pos,o=e.posMax;if(n+3>o||e.src.charCodeAt(n)!==58||e.src.charCodeAt(n+1)!==47||e.src.charCodeAt(n+2)!==47)return!1;let i=n-Math.min(10,e.pending.length,n),a=n;for(;a>i&&x_(e.src.charCodeAt(a-1));)a--;if(a===n||!g_(e.src.charCodeAt(a)))return!1;let s=n-a,l=e.md.linkify.matchAtStart(e.src.slice(a));if(!l)return!1;let u=l.url;if(u.length<=s)return!1;let c=u.length;for(;c>0&&u.charCodeAt(c-1)===42;)c--;c!==u.length&&(u=u.slice(0,c));let f=e.md.normalizeLink(u);if(!e.md.validateLink(f))return!1;if(!r){e.pending=e.pending.slice(0,-s);let h=e.push("link_open","a",1);h.attrs=[["href",f]],h.markup="linkify",h.info="auto";let d=e.push("text","",0);d.content=e.md.normalizeLinkText(u);let p=e.push("link_close","a",-1);p.markup="linkify",p.info="auto"}return e.pos+=u.length-s,!0}function y_(e,r){let n=e.pos;if(e.src.charCodeAt(n)!==10)return!1;let o=e.pending.length-1,i=e.posMax;if(!r)if(o>=0&&e.pending.charCodeAt(o)===32)if(o>=1&&e.pending.charCodeAt(o-1)===32){let a=o-1;for(;a>=1&&e.pending.charCodeAt(a-1)===32;)a--;e.pending=e.pending.slice(0,a),e.push("hardbreak","br",0)}else e.pending=e.pending.slice(0,-1),e.push("softbreak","br",0);else e.push("softbreak","br",0);for(n++;n<i&&Y(e.src.charCodeAt(n));)n++;return e.pos=n,!0}var La=[];for(let e=0;e<256;e++)La.push(0);"\\!\"#$%&'()*+,./:;<=>?@[]^_`{|}~-".split("").forEach(function(e){La[e.charCodeAt(0)]=1});function __(e,r){let n=e.pos,o=e.posMax;if(e.src.charCodeAt(n)!==92||(n++,n>=o))return!1;let i=e.src.charCodeAt(n);if(i===10){for(r||e.push("hardbreak","br",0),n++;n<o&&(i=e.src.charCodeAt(n),!!Y(i));)n++;return e.pos=n,!0}if(i===32){if(!r){let l=e.push("text_special","",0);l.content="\\",l.markup="\\",l.info="escape"}return e.pos=n,!0}let a=e.src[n];if(i>=55296&&i<=56319&&n+1<o){let l=e.src.charCodeAt(n+1);l>=56320&&l<=57343&&(a+=e.src[n+1],n++)}let s="\\"+a;if(!r){let l=e.push("text_special","",0);i<256&&La[i]!==0?l.content=a:l.content=s,l.markup=s,l.info="escape"}return e.pos=n+1,!0}function b_(e){let r={},n=0;for(;(n=e.indexOf("`",n))!==-1;){let o=n;for(;e.charCodeAt(++n)===96;);r[n-o]=o}return r}function w_(e,r){var n;let o=e.pos;if(e.src.charCodeAt(o)!==96)return!1;let i=e.posMax,a=o+1;for(;a<i&&e.src.charCodeAt(a)===96;)a++;let s=e.src.slice(o,a),l=s.length;if(e.backticksScanned||(e.backticks=b_(e.src),e.backticksScanned=!0),((n=e.backticks[l])!==null&&n!==void 0?n:-1)>=a){let u=a,c;for(;(c=e.src.indexOf("`",u))!==-1&&c<i;){for(u=c+1;e.src.charCodeAt(u)===96;)u++;if(u>i)break;if(u-c===l){if(!r){let f=e.push("code_inline","code",0);f.markup=s;let h=e.src.slice(a,c).replace(/\n/g," ");h.startsWith(" ")&&h.endsWith(" ")&&/[^ ]/.test(h)&&(h=h.slice(1,-1)),f.content=h}return e.pos=u,!0}}}return r||(e.pending+=s),e.pos=a,!0}function k_(e,r){let n=e.pos,o=e.src.charCodeAt(n);if(r||o!==126)return!1;let i=e.scanDelims(e.pos,!0),a=i.length,s=String.fromCharCode(o);if(a<2)return!1;let l;a%2&&(l=e.push("text","",0),l.content=s,a--);for(let u=0;u<a;u+=2)l=e.push("text","",0),l.content=s+s,e.delimiters.push({marker:o,length:0,token:e.tokens.length-1,end:-1,open:i.can_open,close:i.can_close});return e.pos+=i.length,!0}function Xh(e,r){let n,o=[],i=r.length;for(let a=0;a<i;a++){let s=r[a];if(s.marker!==126||s.end===-1)continue;let l=r[s.end];n=e.tokens[s.token],n.type="s_open",n.tag="s",n.nesting=1,n.markup="~~",n.content="",n=e.tokens[l.token],n.type="s_close",n.tag="s",n.nesting=-1,n.markup="~~",n.content="",e.tokens[l.token-1].type==="text"&&e.tokens[l.token-1].content==="~"&&o.push(l.token-1)}for(;o.length;){let a=o.pop(),s=a+1;for(;s<e.tokens.length&&e.tokens[s].type==="s_close";)s++;s--,a!==s&&(n=e.tokens[s],e.tokens[s]=e.tokens[a],e.tokens[a]=n)}}function C_(e){let r=e.tokens_meta,n=e.tokens_meta.length;Xh(e,e.delimiters);for(let i=0;i<n;i++){var o;let a=(o=r[i])===null||o===void 0?void 0:o.delimiters;a&&Xh(e,a)}}var hd={tokenize:k_,postProcess:C_};function A_(e,r){let n=e.pos,o=e.src.charCodeAt(n);if(r||o!==95&&o!==42)return!1;let i=e.scanDelims(e.pos,o===42);for(let a=0;a<i.length;a++){let s=e.push("text","",0);s.content=String.fromCharCode(o),e.delimiters.push({marker:o,length:i.length,token:e.tokens.length-1,end:-1,open:i.can_open,close:i.can_close})}return e.pos+=i.length,!0}function Vh(e,r){let n=r.length;for(let o=n-1;o>=0;o--){let i=r[o];if(i.marker!==95&&i.marker!==42||i.end===-1)continue;let a=r[i.end],s=o>0&&r[o-1].end===i.end+1&&r[o-1].marker===i.marker&&r[o-1].token===i.token-1&&r[i.end+1].token===a.token+1,l=String.fromCharCode(i.marker),u=e.tokens[i.token];u.type=s?"strong_open":"em_open",u.tag=s?"strong":"em",u.nesting=1,u.markup=s?l+l:l,u.content="";let c=e.tokens[a.token];c.type=s?"strong_close":"em_close",c.tag=s?"strong":"em",c.nesting=-1,c.markup=s?l+l:l,c.content="",s&&(e.tokens[r[o-1].token].content="",e.tokens[r[i.end+1].token].content="",o--)}}function R_(e){let r=e.tokens_meta,n=e.tokens_meta.length;Vh(e,e.delimiters);for(let i=0;i<n;i++){var o;let a=(o=r[i])===null||o===void 0?void 0:o.delimiters;a&&Vh(e,a)}}var dd={tokenize:A_,postProcess:R_};function E_(e,r){let n,o,i,a,s="",l="",u=e.pos,c=!0;if(e.src.charCodeAt(e.pos)!==91)return!1;let f=e.pos,h=e.posMax,d=e.pos+1,p=e.md.helpers.parseLinkLabel(e,e.pos,!0);if(p<0)return!1;let m=p+1;if(m<h&&e.src.charCodeAt(m)===40){for(c=!1,m++;m<h&&(n=e.src.charCodeAt(m),!(!Y(n)&&n!==10));m++);if(m>=h)return!1;if(u=m,i=e.md.helpers.parseLinkDestination(e.src,m,e.posMax),i.ok){for(s=e.md.normalizeLink(i.str),e.md.validateLink(s)?m=i.pos:s="",u=m;m<h&&(n=e.src.charCodeAt(m),!(!Y(n)&&n!==10));m++);if(i=e.md.helpers.parseLinkTitle(e.src,m,e.posMax),m<h&&u!==m&&i.ok)for(l=i.str,m=i.pos;m<h&&(n=e.src.charCodeAt(m),!(!Y(n)&&n!==10));m++);}(m>=h||e.src.charCodeAt(m)!==41)&&(c=!0),m++}if(c){if(typeof e.env.references>"u")return!1;if(m<h&&e.src.charCodeAt(m)===91?(u=m+1,m=e.md.helpers.parseLinkLabel(e,m),m>=0?o=e.src.slice(u,m++):m=p+1):m=p+1,o||(o=e.src.slice(d,p)),o=Ho(o),a=e.env.references[o],!a)return e.pos=f,!1;s=a.href,l=a.title}if(!r){e.pos=d,e.posMax=p;let v=e.push("link_open","a",1),x=[["href",s]];if(v.attrs=x,l&&x.push(["title",l]),o){let g=Object.create(null);g.label=o,v.meta=g}e.linkLevel++,e.md.inline.tokenize(e),e.linkLevel--,e.push("link_close","a",-1)}return e.pos=m,e.posMax=h,!0}function D_(e,r){let n,o,i,a,s,l,u,c,f="",h=e.pos,d=e.posMax;if(e.src.charCodeAt(e.pos)!==33||e.src.charCodeAt(e.pos+1)!==91)return!1;let p=e.pos+2,m=e.md.helpers.parseLinkLabel(e,e.pos+1,!1);if(m<0)return!1;if(a=m+1,a<d&&e.src.charCodeAt(a)===40){for(a++;a<d&&(n=e.src.charCodeAt(a),!(!Y(n)&&n!==10));a++);if(a>=d)return!1;for(c=a,l=e.md.helpers.parseLinkDestination(e.src,a,e.posMax),l.ok&&(f=e.md.normalizeLink(l.str),e.md.validateLink(f)?a=l.pos:f=""),c=a;a<d&&(n=e.src.charCodeAt(a),!(!Y(n)&&n!==10));a++);if(l=e.md.helpers.parseLinkTitle(e.src,a,e.posMax),a<d&&c!==a&&l.ok)for(u=l.str,a=l.pos;a<d&&(n=e.src.charCodeAt(a),!(!Y(n)&&n!==10));a++);else u="";if(a>=d||e.src.charCodeAt(a)!==41)return e.pos=h,!1;a++}else{if(typeof e.env.references>"u")return!1;if(a<d&&e.src.charCodeAt(a)===91?(c=a+1,a=e.md.helpers.parseLinkLabel(e,a),a>=0?i=e.src.slice(c,a++):a=m+1):a=m+1,i||(i=e.src.slice(p,m)),i=Ho(i),s=e.env.references[i],!s)return e.pos=h,!1;f=s.href,u=s.title}if(!r){o=e.src.slice(p,m);let v=[];e.md.inline.parse(o,e.md,e.env,v);let x=e.push("image","img",0),g=[["src",f],["alt",""]];if(x.attrs=g,x.children=v,x.content=o,u&&g.push(["title",u]),i){let b=Object.create(null);b.label=i,x.meta=b}}return e.pos=a,e.posMax=d,!0}var S_=/^([a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*)$/,M_=/^([a-zA-Z][a-zA-Z0-9+.-]{1,31}):([^<>\x00-\x20]*)$/;function T_(e,r){let n=e.pos;if(e.src.charCodeAt(n)!==60)return!1;let o=e.pos,i=e.posMax;for(;;){if(++n>=i)return!1;let s=e.src.charCodeAt(n);if(s===60)return!1;if(s===62)break}let a=e.src.slice(o+1,n);if(M_.test(a)){let s=e.md.normalizeLink(a);if(!e.md.validateLink(s))return!1;if(!r){let l=e.push("link_open","a",1);l.attrs=[["href",s]],l.markup="autolink",l.info="auto";let u=e.push("text","",0);u.content=e.md.normalizeLinkText(a);let c=e.push("link_close","a",-1);c.markup="autolink",c.info="auto"}return e.pos+=a.length+2,!0}if(S_.test(a)){let s=e.md.normalizeLink(`mailto:${a}`);if(!e.md.validateLink(s))return!1;if(!r){let l=e.push("link_open","a",1);l.attrs=[["href",s]],l.markup="autolink",l.info="auto";let u=e.push("text","",0);u.content=e.md.normalizeLinkText(a);let c=e.push("link_close","a",-1);c.markup="autolink",c.info="auto"}return e.pos+=a.length+2,!0}return!1}function N_(e){return/^<a[>\s]/i.test(e)}function F_(e){return/^<\/a\s*>/i.test(e)}function pd(e){let r=e|32;return r>=97&&r<=122}function I_(e,r){let n=e.src,o,i;if(n.startsWith("<!--",r)){if(n.startsWith(">",r+4))return r+5;if(n.startsWith("->",r+4))return r+6;o=r+4,i="-->"}else if(n.startsWith("<![CDATA[",r))o=r+9,i="]]>";else if(n.charCodeAt(r+1)===63)o=r+2,i="?>";else if(pd(n.charCodeAt(r+2)))o=r+3,i=">";else return-1;if(e.skipHtmlSpecial)return-1;let a=n.indexOf(i,o);return a<0?(e.skipHtmlSpecial=!0,-1):a+i.length}function L_(e,r){if(!e.md.options.html)return!1;let n=e.posMax,o=e.pos;if(e.src.charCodeAt(o)!==60||o+2>=n)return!1;let i,a=e.src.charCodeAt(o+1);if(a===33||a===63)i=I_(e,o);else if(a===47||pd(a)){let s=e.src.slice(o).match(ud);i=s?o+s[0].length:-1}else return!1;if(i<0)return!1;if(!r){let s=e.push("html_inline","",0);s.content=e.src.slice(o,i),N_(s.content)&&e.linkLevel++,F_(s.content)&&e.linkLevel--}return e.pos=i,!0}var z_=/^&#((?:x[a-f0-9]{1,6}|[0-9]{1,7}));/i,P_=/^&([a-z][a-z0-9]{1,31});/i;function O_(e,r){let n=e.pos,o=e.posMax;if(e.src.charCodeAt(n)!==38||n+1>=o)return!1;if(e.src.charCodeAt(n+1)===35){let i=e.src.slice(n).match(z_);if(i){if(!r){let a=i[1][0].toLowerCase()==="x"?parseInt(i[1].slice(1),16):parseInt(i[1],10),s=e.push("text_special","",0);s.content=Ia(a)?cn(a):cn(65533),s.markup=i[0],s.info="entity"}return e.pos+=i[0].length,!0}}else{let i=e.src.slice(n).match(P_);if(i){let a=Oo(i[0]);if(a!==i[0]){if(!r){let s=e.push("text_special","",0);s.content=a,s.markup=i[0],s.info="entity"}return e.pos+=i[0].length,!0}}}return!1}function Yh(e){let r={},n=e.length;if(!n)return;let o=0,i=-2,a=[];for(let s=0;s<n;s++){let l=e[s];if(a.push(0),(e[o].marker!==l.marker||i!==l.token-1)&&(o=s),i=l.token,l.length=l.length||0,!l.close)continue;r.hasOwnProperty(l.marker)||(r[l.marker]=[-1,-1,-1,-1,-1,-1]);let u=r[l.marker][(l.open?3:0)+l.length%3],c=o-a[o]-1,f=c;for(;c>u;c-=a[c]+1){let h=e[c];if(h.marker===l.marker&&h.open&&h.end<0){let d=!1;if((h.close||l.open)&&(h.length+l.length)%3===0&&(h.length%3!==0||l.length%3!==0)&&(d=!0),!d){let p=c>0&&!e[c-1].open?a[c-1]+1:0;a[s]=s-c+p,a[c]=p,l.open=!1,h.end=s,h.close=!1,f=-1,i=-2;break}}}f!==-1&&(r[l.marker][(l.open?3:0)+(l.length||0)%3]=f)}}function B_(e){let r=e.tokens_meta,n=e.tokens_meta.length;Yh(e.delimiters);for(let i=0;i<n;i++){var o;let a=(o=r[i])===null||o===void 0?void 0:o.delimiters;a&&Yh(a)}}function j_(e){let r,n,o=0,i=e.tokens,a=e.tokens.length;for(r=n=0;r<a;r++)i[r].nesting<0&&o--,i[r].level=o,i[r].nesting>0&&o++,i[r].type==="text"&&r+1<a&&i[r+1].type==="text"?i[r+1].content=i[r].content+i[r+1].content:(r!==n&&(i[n]=i[r]),n++);r!==n&&(i.length=n)}var Na=[["text",m_],["linkify",v_],["newline",y_],["escape",__],["backticks",w_],["strikethrough",hd.tokenize],["emphasis",dd.tokenize],["link",E_],["image",D_],["autolink",T_],["html_inline",L_],["entity",O_]],Fa=[["balance_pairs",B_],["strikethrough",hd.postProcess],["emphasis",dd.postProcess],["fragments_join",j_]],md=class{constructor(){P(this,"ruler",new mn),P(this,"ruler2",new mn),P(this,"State",fd);for(let e=0;e<Na.length;e++)this.ruler.push(Na[e][0],Na[e][1]);for(let e=0;e<Fa.length;e++)this.ruler2.push(Fa[e][0],Fa[e][1])}skipToken(e){let r=e.pos,n=this.ruler.getRules(""),o=n.length,i=e.md.options.maxNesting,a=e.cache;if(typeof a[r]<"u"){e.pos=a[r];return}let s=!1;if(e.level<i){for(let l=0;l<o;l++)if(e.level++,s=n[l](e,!0),e.level--,s){if(r>=e.pos)throw new Error("inline rule didn't increment state.pos");break}}else e.pos=e.posMax;s||e.pos++,a[r]=e.pos}tokenize(e){let r=this.ruler.getRules(""),n=r.length,o=e.posMax,i=e.md.options.maxNesting;for(;e.pos<o;){let a=e.pos,s=!1;if(e.level<i){for(let l=0;l<n;l++)if(s=r[l](e,!1),s){if(a>=e.pos)throw new Error("inline rule didn't increment state.pos");break}}if(s){if(e.pos>=o)break;continue}e.pending+=e.src[e.pos++]}e.pending&&e.pushPending()}parse(e,r,n,o){let i=new this.State(e,r,n,o);this.tokenize(i);let a=this.ruler2.getRules(""),s=a.length;for(let l=0;l<s;l++)a[l](i)}},$_={default:{options:{html:!1,xhtmlOut:!1,breaks:!1,langPrefix:"language-",linkify:!1,typographer:!1,quotes:"\u201C\u201D\u2018\u2019",highlight:null,maxNesting:100},components:{core:{},block:{},inline:{}}},zero:{options:{html:!1,xhtmlOut:!1,breaks:!1,langPrefix:"language-",linkify:!1,typographer:!1,quotes:"\u201C\u201D\u2018\u2019",highlight:null,maxNesting:20},components:{core:{rules:["normalize","block","strip_references","inline","text_join"]},block:{rules:["paragraph"]},inline:{rules:["text"],rules2:["balance_pairs","fragments_join"]}}},commonmark:{options:{html:!0,xhtmlOut:!0,breaks:!1,langPrefix:"language-",linkify:!1,typographer:!1,quotes:"\u201C\u201D\u2018\u2019",highlight:null,maxNesting:20},components:{core:{rules:["normalize","block","strip_references","inline","text_join"]},block:{rules:["blockquote","code","fence","heading","hr","html_block","lheading","list","reference","paragraph"]},inline:{rules:["autolink","backticks","emphasis","entity","escape","html_inline","image","link","newline","text"],rules2:["balance_pairs","emphasis","fragments_join"]}}}},H_=/^(vbscript|javascript|file|data):/,U_=/^data:image\/(gif|png|jpeg|webp);/,Zh=["http:","https:","mailto:"],Qe=class{validateLink(e){let r=e.trim().toLowerCase();return H_.test(r)?U_.test(r):!0}normalizeLink(e){let r=sn(e,!0);if(r.hostname&&(!r.protocol||Zh.indexOf(r.protocol)>=0))try{r.hostname=Da.toASCII(r.hostname)}catch{}return r.auth&&(r.auth=_t(r.auth)),r.hostname&&(r.hostname=_t(r.hostname)),r.pathname&&(r.pathname=_t(r.pathname)),r.search&&(r.search=_t(r.search)),r.hash&&(r.hash=_t(r.hash)),ar(r)}normalizeLinkText(e){let r=sn(e,!0);if(r.hostname&&(!r.protocol||Zh.indexOf(r.protocol)>=0))try{r.hostname=Da.toUnicode(r.hostname)}catch{}return an(ar(r),an.defaultChars+"%")}constructor(...e){P(this,"inline",new md),P(this,"block",new cd),P(this,"core",new id),P(this,"renderer",new rd),P(this,"linkify",new Fh),P(this,"utils",fy),P(this,"helpers",Object.assign({},Ey));let[r,n]=e;typeof r=="string"?(this.configure(r),n&&this.set(n)):(this.configure("default"),this.set(r||{}))}set(e){return Object.assign(this.options,e),this}configure(e){let r;if(typeof e=="string"){let i=e;if(r=$_[i],!r)throw new Error(`Wrong 'markdown-it' preset "${i}", check name`)}else r=e;if(!r)throw new Error("Wrong `markdown-it` preset, can't be empty");r.options&&(this.options={...r.options});let n=r.components;if(n){var o;["core","block","inline"].forEach(a=>{var s;let l=(s=n[a])===null||s===void 0?void 0:s.rules;l&&this[a].ruler.enableOnly(l)});let i=(o=n.inline)===null||o===void 0?void 0:o.rules2;i&&this.inline.ruler2.enableOnly(i)}return this}enable(e,r=!1){let n=[];Array.isArray(e)||(e=[e]),["core","block","inline"].forEach(i=>{n=n.concat(this[i].ruler.enable(e,!0))}),n=n.concat(this.inline.ruler2.enable(e,!0));let o=e.filter(i=>n.indexOf(i)<0);if(o.length&&!r)throw new Error(`MarkdownIt. Failed to enable unknown rule(s): ${o}`);return this}disable(e,r=!1){let n=[];Array.isArray(e)||(e=[e]),["core","block","inline"].forEach(i=>{n=n.concat(this[i].ruler.disable(e,!0))}),n=n.concat(this.inline.ruler2.disable(e,!0));let o=e.filter(i=>n.indexOf(i)<0);if(o.length&&!r)throw new Error(`MarkdownIt. Failed to disable unknown rule(s): ${o}`);return this}use(e,...r){return e.apply(e,[this,...r]),this}parse(e,r){if(typeof e!="string")throw new Error("Input data should be a String");let n=new this.core.State(e,this,r);return this.core.process(n),n.tokens}render(e,r={}){return this.renderer.render(this.parse(e,r),this.options,r)}parseInline(e,r){let n=new this.core.State(e,this,r);return n.inlineMode=!0,this.core.process(n),n.tokens}renderInline(e,r={}){return this.renderer.render(this.parseInline(e,r),this.options,r)}};P(Qe,"Token",jt);P(Qe,"Ruler",mn);P(Qe,"Renderer",rd);P(Qe,"ParserCore",id);P(Qe,"StateCore",nd);P(Qe,"ParserBlock",cd);P(Qe,"StateBlock",ad);P(Qe,"ParserInline",md);P(Qe,"StateInline",fd);var gd=Qh(Qe);var Ie=new gd({html:!1}),G_=/^\[\[\s*([^\]|]+?)\s*(?:\|\s*([^\]]+?)\s*)?\]\]/;Ie.inline.ruler.before("link","wikilink",(e,r)=>{if(!e.src.startsWith("[[",e.pos))return!1;let n=G_.exec(e.src.slice(e.pos));if(!n)return!1;if(!r){let o=e.push("wikilink","",0);o.meta={slug:n[1],label:n[2]??n[1]}}return e.pos+=n[0].length,!0});Ie.renderer.rules.wikilink=(e,r)=>{let{slug:n,label:o}=e[r].meta,i=Ie.utils.escapeHtml;return`<a class="wiki" href="?focus=${i(encodeURIComponent(n))}" data-slug="${i(n)}">${i(o)}</a>`};var q_=/^(javascript|vbscript|file|data):/;Ie.validateLink=e=>!q_.test(e.trim().toLowerCase());Ie.renderer.rules.image=(e,r,n,o,i)=>Ie.utils.escapeHtml(i.renderInlineAsText(e[r].children??[],n,o));Ie.renderer.rules.link_open=(e,r,n,o,i)=>(e[r].attrSet("target","_blank"),e[r].attrSet("rel","noopener noreferrer"),i.renderToken(e,r,n));var W_=new Set(["Notes","Context","Purpose","Goals","Brief","Next Actions","Current State","Open Questions","Session Log","Related"]);function za(e,r={}){if(r.inline)return Ie.renderInline(e);if(r.section===void 0)return Ie.render(e);let n={},o=Ie.parse(e,n),i=u=>o[u].type==="heading_open"&&o[u].tag==="h2"&&o[u].level===0,a=u=>o[u+1].content.trim(),s=o.findIndex((u,c)=>i(c)&&a(c)===r.section);if(s<0)return"";let l=o.findIndex((u,c)=>c>s&&i(c)&&W_.has(a(c)));return Ie.renderer.render(o.slice(s+3,l<0?void 0:l),Ie.options,n)}function lr(e,r){let n=zt(e,r);return n<=0?"today":n<14?`${n}d`:n<60?`${Math.round(n/7)}w`:n<365?`${Math.round(n/30)}mo`:`${Math.round(n/365)}y`}var J_=(e,r)=>`${e} ${r}${e===1?"":"s"}`;function xd(e,r){let n=[];e.kind==="entity"?n.push({text:e.type??"entity",tone:"gold"}):e.kind==="knowledge"?n.push({text:e.subtype??"insight",tone:"wisdom"}):n.push({text:e.kind,tone:"muted"}),e.status&&n.push({text:e.status,tone:e.status==="active"?"gold":"muted"}),e.confidence&&n.push({text:e.confidence,tone:"wisdom"});let o=e.kind==="entity"&&e.status==="active";if(o&&e.stale&&e.last_touched){let i=zt(e.last_touched,r);n.push({text:`Stale \xB7 ${i}d`,tone:"amber",title:`Untouched ${i} days, past its staleness-days (${e.staleness_days??14})`})}return o&&e.stale_actions&&n.push({text:J_(e.stale_actions,"stale action"),tone:"amber",title:"Open actions past staleness-days, undated ones included"}),e.unlinked&&n.push({text:"Unlinked",tone:"muted",title:"No Parent, Related or Wiki-link edge either way"}),n}var kt=e=>typeof e=="string"?e:e.id;function Pa(e,r,n,o){let i=new Set(n.filter(s=>s.relation==="parent"&&kt(s.target)===e.id).map(s=>kt(s.source))),a=r.filter(s=>i.has(s.id)).sort(Qt);return{rows:a.slice(0,o),more:Math.max(0,a.length-o)}}function vd(e,r){let n=new Set(e.filter(i=>i.kind==="entity"||i.kind==="knowledge").map(i=>i.id)),o=new Map;for(let i of r){let a=[kt(i.source),kt(i.target)];if(a.every(s=>n.has(s)))for(let s of a)o.set(s,(o.get(s)??0)+1)}return o}function yd(e,r,n,o,i,a){let s=n.find(u=>u.relation==="parent"&&kt(u.source)===e.id),l=new Set(n.filter(u=>u.relation==="parent"&&kt(u.target)===e.id).map(u=>kt(u.source)));return{touched:e.last_touched?lr(e.last_touched,o):null,open_actions:e.kind==="entity"?a??e.open_actions??null:null,parent:s?kt(s.target):null,children:r.filter(u=>l.has(u.id)).length,most_linked:i.get(e.id)??0}}function Go(e){return e.unlinked?`hafez link ${e.id} ${e.best??"<slug>"} related`:null}var kd=new Set(["entity","knowledge","session"]),X_=new Set(["entity","knowledge"]),V_=8,Oa=12,Ba=6,Y_=1500,ke=null,qo=null,Le=E("div",{id:"panel",hidden:"",tabindex:"-1","aria-label":"Note"}),Cd=E("div",{id:"empty"},E("h2",{class:"label"},"Nothing selected"),E("p",{},"Click a node on the canvas, or search with /, to read a note here."));function Ad(e,r){ke=r,e.append(Cd,Le),Le.addEventListener("click",n=>{let o=n.target.closest("a[data-slug]");o&&(n.preventDefault(),ke?.focus(o.dataset.slug))})}function gn(e,r=!0){let n=ke?.drawn().nodes.find(a=>a.id===e);if(!n||!ke)return!1;let o=D.selected?.id!==e,i=Le.hidden;return i&&(qo=document.activeElement instanceof HTMLElement?document.activeElement:null),D.selected=n,on(n,ke.drawn().links),ja(n,null),Rd(!0),o&&Le.parentElement?.closest(".side")?.scrollTo(0,0),i&&Le.focus({preventScroll:!0}),r&&ke.ease(n),ke.redraw(),o&&ke.selected(n),kd.has(n.kind)&&fetch(`/note/${encodeURIComponent(e)}`).then(async a=>{D.selected===n&&ja(n,a.ok?await a.json():null,a.ok?void 0:"Not in the Vault any more.")}).catch(()=>{D.selected===n&&ja(n,null,"Could not reach the graph server.")}),!0}function Rd(e){Le.hidden=!e,Cd.hidden=e}function xn(){let e=Le.contains(document.activeElement);Rd(!1),D.selected=null,on(null,[]),ke?.redraw(),ke?.selected(null),e&&qo?.isConnected&&qo.focus({preventScroll:!0}),qo=null}function ja(e,r,n){let o=Le.contains(document.activeElement),i=r?.frontmatter??{},a=(g,b)=>typeof i[g]=="string"?i[g]:b,s=vt(),l=new Map(D.nodes.map(g=>[g.id,g])),u=new Set(ke?.drawn().nodes??[]),c=r?.actions?.filter(g=>g.handle!==void 0)??[];Le.replaceChildren();let f=E("button",{class:"btn icon close",type:"button","aria-label":"Close the panel",title:"Close"},"\xD7");f.addEventListener("click",xn);let h=E("div",{class:"badges"});for(let g of xd(e,s)){let b=E("span",{class:`badge tone-${g.tone}`},g.text);g.title&&(b.title=g.title),h.append(b)}let d=E("div",{class:"head"});d.append(f,h,E("h2",{},a("name",e.name)));let p=a("description",e.description);p&&d.append(E("p",{class:"desc"},p)),d.append(Z_(e,r?c.length:void 0,s,l)),ke&&d.append(ke.depthControl()),n&&d.append(E("p",{class:"muted"},n)),Le.append(d);let m=Go(e);if(m){let g=e.best?l.get(e.best):void 0;Ct("Place it","place").append(E("p",{class:"muted"},g?`Closest linked note: ${g.name}`:"Nothing close matched: name the note to link it to."),ur(m))}r?.kind==="knowledge"&&Ct("","body").append(wd(r.body));let v=r?.kind==="entity"?wd(r.body,{section:"Brief"}):null;if(v?.hasChildNodes()&&Q_(Ct("Brief"),v),c.length){let g=E("ul",{class:"actions"}),b=y=>{let _=E("li",{class:y.stale?"stale":""}),w=E("span",{class:"md"});w.innerHTML=za(y.text,{inline:!0});let C=y.added?`${lr(y.added,s)}${y.stale?" \xB7 stale":""}`:"undated";return _.append(w,E("span",{class:"age"},C)),y.added&&(_.title=`Added ${y.added}`),_};g.append(...c.slice(0,Ba).map(b));let k=Ct("Next actions","",String(c.length));k.append(g),$a(k,c.length-Ba,()=>g.append(...c.slice(Ba).map(b)))}r?.kind==="entity"&&K_(e,r);let x=Pa(e,D.nodes,D.links,V_);if(x.rows.length){let g=x.rows.length+x.more,b=E("ul",{class:"rows"});b.append(...x.rows.map(y=>_d(y,s,u)));let k=Ct("Children","",String(g));k.append(b),$a(k,x.more,()=>b.replaceChildren(...Pa(e,D.nodes,D.links,g).rows.map(y=>_d(y,s,u))))}bd("Related",ga(e,D.links,l,"related","both"),u),bd("Wiki-links",ga(e,D.links,l,"mention","both"),u),kd.has(e.kind)&&Ct("","read").append(ur(`hafez read ${e.id}`)),o&&Le.focus({preventScroll:!0})}function Z_(e,r,n,o){let i=yd(e,D.nodes,D.links,n,vd(D.nodes,D.links),r),a=E("div",{class:"facts"}),s=(...u)=>a.append(E("span",{},...u));i.touched&&s("touched ",E("b",{},i.touched==="today"?"today":`${i.touched} ago`)),i.open_actions!==null&&s(E("b",{},String(i.open_actions)),` open action${i.open_actions===1?"":"s"}`),i.children&&s("parent \xB7 ",E("b",{},String(i.children)),i.children===1?" child":" children"),s("most-linked \xB7 ",E("b",{},String(i.most_linked)));let l=i.parent?o.get(i.parent):void 0;if(l){let u=E("a",{class:"wiki",href:`?focus=${encodeURIComponent(l.id)}`,"data-slug":l.id},l.name);s("in ",u)}return a}function K_(e,r){let n=Ct("Agent history"),o=r.log??[];if(o.length){let a=E("ul",{class:"log"});for(let s of o){let l=E("li",{class:s.type}),u=E("span",{class:"summary"},s.summary);u.addEventListener("click",()=>u.classList.add("open")),l.append(E("span",{class:"when"},`${s.date} \xB7 ${s.agent} \xB7 ${s.type}`),u),a.append(l)}n.append(a)}else n.append(E("p",{class:"muted"},"No Session Log entries."));r.archive_entries&&n.append(E("p",{class:"muted"},`${r.archive_entries} older entr${r.archive_entries===1?"y":"ies"} archived`),ur(`hafez read ${e.id} --archive`));let i=r.sessions;if(i?.count){let a=i.latest?` \xB7 latest ${i.latest}`:"";n.append(E("p",{class:"muted"},`${i.count} session${i.count===1?"":"s"} touched it${a}`),ur(`hafez query --kind session --related-to ${e.id}`))}}function _d(e,r,n){let o=[e.status??e.kind];return e.open_actions&&o.push(`${e.open_actions} open`),e.last_touched&&o.push(lr(e.last_touched,r)),Ed(e,o.join(" \xB7 "),n)}function bd(e,r,n){let o=r.filter(l=>X_.has(l.kind));if(!o.length)return;let i=E("ul",{class:"rows"}),a=l=>Ed(l,l.kind==="entity"?l.status??l.kind:l.subtype??l.kind,n);i.append(...o.slice(0,Oa).map(a));let s=Ct(e,"",String(o.length));s.append(i),$a(s,o.length-Oa,()=>i.append(...o.slice(Oa).map(a)))}function Ed(e,r,n){let o=["row",e.kind,e.kind==="entity"?e.status:void 0,e.stale?"stale":void 0,n.has(e)?void 0:"hidden"],i=!n.has(e),a=E("button",{class:o.filter(Boolean).join(" "),type:"button"},E("span",{class:"dot","aria-hidden":"true"}),E("span",{class:"nm"},e.name),E("span",{class:"sub"},r));return a.title=i?`${e.id} (hidden by the current view: a click shows it)`:e.id,a.addEventListener("click",()=>ke?.focus(e.id)),E("li",{},a)}function Ct(e,r="",n){let o=E("section",{class:`sec ${r}`.trim()});if(e){let i=E("h3",{class:"label"},e);n&&i.append(E("span",{class:"count"},n)),o.append(i)}return Le.append(o),o}function $a(e,r,n){if(r<=0)return;let o=E("button",{class:"more",type:"button"},`+${r} more`);o.addEventListener("click",()=>{n(),o.remove()}),e.append(o)}function Q_(e,r){r.classList.add("clamp");let n=E("button",{class:"more",type:"button"},"Show the whole Brief");n.addEventListener("click",()=>{r.classList.remove("clamp"),n.remove()}),e.append(r,n),requestAnimationFrame(()=>{r.scrollHeight<=r.clientHeight+1&&n.click()})}function ur(e){let r=E("button",{class:"btn",type:"button","aria-label":`Copy ${e}`},"Copy"),n,o=a=>{r.textContent=a,r.setAttribute("aria-label",a),clearTimeout(n),n=setTimeout(()=>{r.textContent="Copy",r.setAttribute("aria-label",`Copy ${e}`)},Y_)};r.addEventListener("click",()=>{Promise.resolve().then(()=>navigator.clipboard.writeText(e)).then(()=>o("Copied"),()=>o("Copy failed"))});let i=E("div",{class:"line"});return i.append(E("code",{class:"code"},e),r),i}function wd(e,r){let n=E("div",{class:"md"});return n.innerHTML=za(e,r),n}var Dd=matchMedia("(prefers-reduced-motion: reduce)"),Sd=()=>Dd.matches,vn=e=>Dd.matches?0:e;var eb=1600,$t=new Map,Nd=[];function Fd(e){Nd.push(e)}var tb=5e3,rb=3e3,Id=[];function Ld(e){Id.push(e)}function zd(e,r){let n=Promise.resolve(),o=c=>{n=n.then(c).catch(f=>console.error(f))},i=null,a,s=c=>{i=c;for(let f of Id)f(c)};function l(){let c=new EventSource("/events");c.addEventListener("open",()=>{clearTimeout(a);let f=i!==null;o(async()=>{f&&await r(),s("live")})}),c.addEventListener("error",()=>{if(c.readyState===EventSource.CLOSED){clearTimeout(a),s("offline"),setTimeout(l,rb);return}i==="reconnecting"||i==="offline"||(s("reconnecting"),a=setTimeout(()=>s("offline"),tb))}),c.addEventListener("message",f=>{let h=JSON.parse(f.data);h.type==="commit"&&o(()=>u(h.changes))})}l();async function u(c){let f=Md(e());await r();let h=Md(e()),d=performance.now();for(let{slug:p,op:m}of c){let v=m==="delete"?h.has(p)?void 0:f.get(p):h.get(p);v&&$t.set(p,{op:m,color:er[m],start:d,node:v})}for(let p of Nd)p(c)}}function Md(e){return new Map(e.map(r=>[r.id,r]))}var Td=Math.PI*2;function Pd(e,r){if($t.size===0)return;let n=performance.now();e.save();for(let[o,{color:i,start:a,node:s}]of $t){let l=(n-a)/eb;if(l>=1){$t.delete(o);continue}let u=s.x??0,c=s.y??0,f=s.style.radius;e.globalAlpha=1-l,e.fillStyle=i,e.strokeStyle=i,e.beginPath(),e.arc(u,c,f,0,Td),e.fill(),e.lineWidth=2/r,e.beginPath(),e.arc(u,c,f+(2+(Sd()?4:16*l))/r,0,Td),e.stroke()}e.restore()}var nb=8,ob=4,Ha={contains:3e3,description:2e3,fuzzy:0},ib=/[\s\-_:]/,Od=(e,r)=>r===0||ib.test(e[r-1]);function Ua(e,r){let n=r.indexOf(e);if(n>=0)return Ha.contains-n*2-(r.length-e.length)+(Od(r,n)?200:0);let o=0,i=-1;for(let a of e){let s=i>=0&&r[i+1]===a?i+1:-1;if(s<0){for(let l=i+1;l<r.length&&s<0;l++)r[l]===a&&Od(r,l)&&(s=l);if(s<0)return null;o+=8-Math.min(s-i-1,10)}else o+=10;i=s}return Ha.fuzzy+o}function ab(e,r,n){let o=Ua(e,n.name.toLowerCase()),i=Ua(e,n.id.toLowerCase()),a=n.description?.toLowerCase(),s=a&&r.every(u=>a.includes(u))?Ha.description:null,l=Math.max(o??-1/0,i??-1/0,s??-1/0);return l>-1/0?l:null}function sb(e,r){let n=e.kind==="knowledge"&&e.subtype==="plan";return{node:e,shape:e.kind==="entity"?"disc":n?"hollow":"diamond",status:e.kind==="entity"?e.status??"active":n?"plan":"knowledge",stale:Ve(e),hidden:r}}function Bd(e,r,n,o){let i=e.trim().toLowerCase();if(!i)return{notes:[],noteTotal:0,facets:[],facetTotal:0};let a=i.split(/\s+/),s=[];for(let u of r){if(u.kind!=="entity"&&u.kind!=="knowledge")continue;let c=ab(i,a,u);c!==null&&s.push([u,c])}s.sort((u,c)=>c[1]-u[1]||Qt(u[0],c[0])||u[0].name.localeCompare(c[0].name));let l=[];for(let u of n){let c=Ua(i,u.name.toLowerCase());c!==null&&l.push([u,c])}return l.sort((u,c)=>c[1]-u[1]||c[0].count-u[0].count||u[0].name.localeCompare(c[0].name)),{notes:s.slice(0,nb).map(([u])=>sb(u,!o(u))),noteTotal:s.length,facets:l.slice(0,ob).map(([u])=>u),facetTotal:l.length}}function jd(e){let{notes:r,noteTotal:n,facets:o,facetTotal:i}=e;if(n+i===0)return"No note, tag or domain matches.";let a=(u,c,f,h)=>c===0?"":u<c?`${u} of ${c} ${h}`:`${c} ${c===1?f:h}`,s=[a(r.length,n,"note","notes"),a(o.length,i,"tag or domain","tags and domains")].filter(Boolean),l=r.length<n||o.length<i;return`${s.join(" \xB7 ")}${l?": type more to narrow":""}`}var Ga="search-list";function $d(e,r){let n=E("input",{class:"input",type:"search",placeholder:"Search notes, tags, domains ( / )","aria-label":"Search notes, tags and domains",spellcheck:"false",autocomplete:"off",role:"combobox","aria-expanded":"false","aria-controls":Ga,"aria-autocomplete":"list"}),o=E("ul",{id:Ga,role:"listbox","aria-label":"Search results"}),i=E("p",{class:"total",role:"status"}),a=E("div",{class:"results popover",hidden:""},o,i);e.append(n,a);let s=[],l=0;function u(p){s=p?[...p.notes.map(m=>({note:m})),...p.facets.map(m=>({facet:m}))]:[],o.replaceChildren(...s.map((m,v)=>{let x="note"in m?lb(m.note):ub(m.facet);return x.id=`${Ga}-${v}`,x.addEventListener("mousedown",g=>{g.preventDefault(),h(m)}),x})),i.textContent=p?jd(p):"",a.hidden=p===null||s.length===0&&!n.value.trim(),n.setAttribute("aria-expanded",String(!a.hidden)),c()}function c(){for(let[m,v]of[...o.children].entries())v.setAttribute("aria-selected",String(m===l));let p=o.children[l];p?(n.setAttribute("aria-activedescendant",p.id),p.scrollIntoView({block:"nearest"})):n.removeAttribute("aria-activedescendant")}function f(){n.value="",u(null),n.blur()}function h(p){"note"in p?r.pick(p.note.node.id):r.highlight(p.facet.id),f()}function d(){l=0,u(n.value.trim()?Bd(n.value,r.notes(),r.facets(),r.shows):null)}n.addEventListener("input",d),n.addEventListener("focus",d),n.addEventListener("keydown",p=>{if(p.stopPropagation(),p.key==="Escape")f();else if(p.key==="Enter"&&s[l])h(s[l]);else if(p.key==="ArrowDown"||p.key==="ArrowUp"){if(p.preventDefault(),!s.length)return;l=(l+(p.key==="ArrowDown"?1:s.length-1))%s.length,c()}}),n.addEventListener("blur",()=>u(null)),document.addEventListener("keydown",p=>{p.key!=="/"||p.ctrlKey||p.metaKey||p.altKey||fb(p.target)||(p.preventDefault(),n.focus(),n.select())})}function lb(e){let{node:r}=e,n=[E("span",{class:`cue ${e.status}`},e.status)];e.stale&&n.push(E("span",{class:"cue stale"},"stale")),e.hidden&&n.push(E("span",{class:"cue hidden",title:"Hidden by the current view: picking it shows it"},"hidden"));let o=["opt","note",e.status,e.stale?"is-stale":"",e.hidden?"is-hidden":""].filter(Boolean).join(" ");return E("li",{class:o,role:"option",title:r.id},E("span",{class:`mark ${e.shape}`,"aria-hidden":"true"}),E("span",{class:"name"},r.name),E("span",{class:"cues"},...n),E("span",{class:"slug"},r.id))}function ub(e){return E("li",{class:`opt facet ${e.kind}`,role:"option",title:`Highlight the ${e.count} notes carrying this ${e.kind}`},E("span",{class:"mark facet","aria-hidden":"true"},"#"),E("span",{class:"name"},`Highlight ${e.name}`),E("span",{class:"cues"},E("span",{class:"cue"},e.kind)),E("span",{class:"slug"},`${e.count} note${e.count===1?"":"s"}`))}var cb=new Set(["button","checkbox","radio","range","color","file","submit","reset","image"]);function fb(e){return e instanceof HTMLElement?e.isContentEditable||e instanceof HTMLTextAreaElement?!0:e instanceof HTMLInputElement&&!cb.has(e.type):!1}var hb=3e4,db=2400,pb=.7,Hd={create:"created",update:"updated",delete:"deleted"},fr=null,Wa=null,Wo=!1,Ja=[],qa=new Map,Ud=0,cr=new Map,ut=document.createElement("ol");function Gd(e,r){fr=r,Wa=e;let n=E("button",{class:"btn follow",type:"button","aria-pressed":"false",title:"Move the camera to each change"},"Follow");n.addEventListener("click",()=>{Wo=!Wo,n.setAttribute("aria-pressed",String(Wo))}),e.body.append(n,ut),e.show(),Xa().finally(()=>{ut.setAttribute("aria-live","polite"),ut.setAttribute("aria-relevant","additions")}),setInterval(qd,hb),Fd(xb),Ld(o=>{gb(o),o==="live"&&Xa()})}var mb={live:"live",reconnecting:"reconnecting\u2026",offline:"offline"};function gb(e){Wa?.setCount(`\u25CF ${mb[e]}`),Wa?.root.setAttribute("data-connection",e)}async function Xa(){let e=++Ud;try{let r=await fetch("/activity");if(!r.ok)return;let n=await r.json();if(e!==Ud)return;Ja=n,vb()}catch{}}function xb(e){let r=new Set(e.filter(o=>o.op!=="delete").map(o=>o.slug)),n;for(let{slug:o,op:i}of e){let a=$t.get(o);if(i==="delete"){if(r.has(o))continue;a?.op==="delete"&&cr.set(o,{node:a.node,start:a.start})}else cr.delete(o);a&&(n=a.node)}Xa(),Wo&&n&&fr?.ease(n),fr?.redraw()}function vb(){if(!Ja.length){qa=new Map,ut.replaceChildren(E("li",{class:"empty"},"No changes yet"));return}let e=new Map;for(let o of Ja){let i=`${o.slug}\0${o.op}\0${o.timestamp}\0${o.count}\0${o.agent??""}`;e.set(i,qa.get(i)??yb(o))}let r=new Set(e.values());for(let o of[...ut.children])r.has(o)||o.remove();let n=0;for(let o of e.values())ut.children[n]!==o&&ut.insertBefore(o,ut.children[n]??null),n++;qa=e,qd()}function yb({slug:e,kind:r,op:n,timestamp:o,name:i,count:a,agent:s}){let l=new Date(o),u=E("button",{class:"entry",type:"button",title:`${Hd[n]} ${e}${s?` by ${s}`:""} \xB7 ${l.toLocaleString()}`},E("span",{class:`mark ${n}`,"aria-hidden":"true"}),E("span",{class:"sr"},`${Hd[n]} `),E("span",{class:"what"},i));return a>1&&u.append(E("span",{class:"times mono","aria-label":`${a} times`},`\xD7${a}`)),s&&u.append(E("span",{class:"agent mono"},E("span",{class:"sr"},"by "),s)),u.append(E("time",{class:"ago mono",datetime:o})),n==="delete"||r==="session"?u.disabled=!0:u.addEventListener("click",()=>fr?.select(e)),E("li",{},u)}function qd(){let e=Date.now();for(let r of ut.querySelectorAll("time"))r.textContent=_b(e-Date.parse(r.dateTime))}function _b(e){let r=Math.floor(e/6e4);return r<1?"now":r<60?`${r}m`:r<1440?`${Math.floor(r/60)}h`:`${Math.floor(r/1440)}d`}var bb=Math.PI*2;function Wd(e,r){if(cr.size>0){let n=performance.now();e.save(),e.font=D.font,e.textAlign="center",e.textBaseline="top";for(let[o,{node:i,start:a}]of cr){let s=(n-a)/db;if(s>=1){cr.delete(o);continue}let l=i.x??0,u=i.y??0,c=i.style.radius;e.globalAlpha=pb*(1-s),e.fillStyle=i.style.fill,e.beginPath(),e.arc(l,u,c,0,bb),e.fill(),e.fillStyle=_o,e.fillText(i.name,l,u+c+2/r)}e.restore()}(cr.size>0||$t.size>0)&&fr&&requestAnimationFrame(fr.redraw)}var Va=[{family:"Geist",file:"geist.woff2",pkg:"@fontsource-variable/geist",src:"files/geist-latin-wght-normal.woff2"},{family:"Geist Mono",file:"geist-mono.woff2",pkg:"@fontsource-variable/geist-mono",src:"files/geist-mono-latin-wght-normal.woff2"},{family:"Outfit",file:"outfit.woff2",pkg:"@fontsource-variable/outfit",src:"files/outfit-latin-wght-normal.woff2"}],wb=e=>e.file.replace(/\.woff2$/,"-OFL.txt"),TS=new Map(Va.flatMap(e=>[[e.file,`${e.pkg}/${e.src}`],[wb(e),`${e.pkg}/LICENSE`]]));var Jd=e=>`--${e.replace(/[A-Z]/g,r=>`-${r.toLowerCase()}`)}`;function kb(){return`:root { ${[...Object.entries(ee).map(([r,n])=>`${Jd(r)}: ${n};`),...Object.entries(xo).map(([r,n])=>`${Jd(r)}: ${n};`),...Object.entries(df).map(([r,n])=>`--fs-${r}: ${n}px;`),...Object.entries(mf).map(([r,n])=>`--r-${r}: ${n}px;`),`--s: ${pf}px;`,`--fast: ${vo.fast}ms;`,`--normal: ${vo.normal}ms;`,`--ease: ${vo.ease};`].join(" ")} }`}var Cb=()=>Va.map(e=>`@font-face { font-family: '${e.family}'; src: url(/fonts/${e.file}) format('woff2'); font-weight: 100 900; font-style: normal; font-display: swap; }`).join(`
56
+ `),G=(e,r)=>`color-mix(in srgb, var(--${e}) ${r}%, transparent)`,Ab=`
57
+ * { box-sizing: border-box; }
58
+ html, body { margin: 0; height: 100%; overflow: hidden; background: var(--root); color: var(--text);
59
+ font: var(--fs-base)/1.5 var(--sans); -webkit-font-smoothing: antialiased; }
60
+ button, input, select { font: inherit; color: inherit; }
61
+ ::-webkit-scrollbar { width: 6px; height: 6px; }
62
+ ::-webkit-scrollbar-thumb { background: var(--scrollbar); border-radius: 3px; }
63
+ ::-webkit-scrollbar-thumb:hover { background: var(--scrollbar-hover); }
64
+ :focus-visible { outline: 2px solid ${G("gold",80)}; outline-offset: 2px; }
65
+ [hidden] { display: none !important; }
66
+ @media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition: none !important; animation: none !important; } }
67
+
68
+ /* Shared recipes */
69
+ .label { font: 600 var(--fs-label) var(--display); text-transform: uppercase; letter-spacing: .15em; color: var(--muted); }
70
+ .mono { font-family: var(--mono); font-variant-numeric: tabular-nums; }
71
+ .sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
72
+ .btn { display: inline-flex; align-items: center; gap: calc(var(--s) * 1.5); height: 28px; padding: 0 calc(var(--s) * 2.5);
73
+ border-radius: var(--r-md); border: 1px solid var(--border); background: var(--surface); color: var(--text2);
74
+ font: 600 var(--fs-label) var(--display); text-transform: uppercase; letter-spacing: .12em; white-space: nowrap; cursor: pointer;
75
+ transition: color var(--fast) var(--ease), background var(--fast) var(--ease), border-color var(--fast) var(--ease); }
76
+ .btn:hover, .btn[aria-pressed=true], .btn[aria-expanded=true] { color: var(--gold); border-color: ${G("gold",30)}; background: ${G("gold",10)}; }
77
+ .btn.icon { width: 28px; padding: 0; justify-content: center; font-size: var(--fs-body); letter-spacing: 0; }
78
+ .btn .swatch { width: 8px; height: 8px; border-radius: 50%; flex: none; }
79
+ .input { height: 30px; width: 100%; padding: 0 calc(var(--s) * 2.5); border-radius: var(--r-md); border: 1px solid var(--border);
80
+ background: var(--surface); color: var(--text); font: var(--fs-body) var(--sans); outline: none; }
81
+ .input:focus { border-color: ${G("gold",40)}; }
82
+ .input::placeholder { color: var(--muted); }
83
+ .select { height: 26px; padding: 0 var(--s); border-radius: var(--r-sm); border: 1px solid var(--border); background: var(--root); color: var(--text2); }
84
+ .popover { background: var(--popover); border: 1px solid var(--border); border-radius: var(--r-lg); box-shadow: 0 12px 32px var(--shadow); }
85
+ .code { flex: 1; min-width: 0; padding: calc(var(--s) * 1.5) var(--s) calc(var(--s) * 1.5) calc(var(--s) * 2); background: var(--inset);
86
+ border: 1px solid var(--border); border-radius: var(--r-md); font: var(--fs-base) var(--mono); color: var(--text2);
87
+ white-space: nowrap; overflow-x: auto; user-select: all; }
88
+
89
+ /* The shell: header, left sidebar, canvas, right sidebar */
90
+ #app { position: fixed; inset: 0; display: grid; grid-template-rows: 52px minmax(0, 1fr);
91
+ grid-template-columns: var(--left) 6px minmax(0, 1fr) 6px var(--right); }
92
+ #head { grid-column: 1 / -1; display: flex; align-items: center; gap: calc(var(--s) * 3); padding: 0 calc(var(--s) * 3.5);
93
+ border-bottom: 1px solid var(--border); background: var(--root); min-width: 0; }
94
+ #head .brand { font: 700 14px var(--display); letter-spacing: .18em; color: var(--gold); white-space: nowrap; }
95
+ #head .brand span { margin-left: calc(var(--s) * 2); font-size: var(--fs-label); font-weight: 600; letter-spacing: .15em; color: var(--muted); }
96
+ #scope { display: flex; gap: calc(var(--s) * 1.5); min-width: 0; }
97
+ #search { position: relative; flex: 1 1 auto; min-width: 140px; max-width: 440px; margin: 0 auto; }
98
+ #tools { position: relative; display: flex; gap: calc(var(--s) * 1.5); }
99
+ .side { min-width: 0; min-height: 0; overflow: auto; background: var(--root); }
100
+ .grip { cursor: col-resize; border-left: 1px solid var(--border); transition: background var(--fast) var(--ease); touch-action: none; }
101
+ .grip:hover, .grip.drag { background: ${G("gold",18)}; }
102
+ #canvas { position: relative; min-width: 0; min-height: 0; overflow: hidden; background: var(--well); }
103
+
104
+ /* The canvas with no graph to draw: an empty Vault, a failed load (states.ts) */
105
+ #state { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); z-index: 10; width: min(420px, calc(100% - 32px));
106
+ display: flex; flex-direction: column; align-items: flex-start; gap: calc(var(--s) * 3); padding: calc(var(--s) * 5) calc(var(--s) * 5.5); }
107
+ #state h2 { margin: 0; }
108
+ #state p { margin: 0; color: var(--text2); font-size: var(--fs-body); overflow-wrap: anywhere; }
109
+ #state .hint { color: var(--muted); font-size: var(--fs-base); }
110
+ #state .code { flex: none; align-self: stretch; }
111
+
112
+ /* A ?focus= that names no note, and the closest notes (miss.ts) */
113
+ #miss { margin: calc(var(--s) * 4) calc(var(--s) * 4) 0; padding: calc(var(--s) * 4) calc(var(--s) * 4.5); display: flex; flex-direction: column; gap: calc(var(--s) * 2);
114
+ border: 1px solid ${G("amber",30)}; border-radius: var(--r-lg); background: ${G("amber",6)}; }
115
+ #miss h2 { margin: 0; color: var(--amber); }
116
+ #miss p { margin: 0; color: var(--text2); font-size: var(--fs-body); }
117
+ #miss code { color: var(--text); }
118
+ #miss ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }
119
+ #miss .choice { all: unset; box-sizing: border-box; display: flex; gap: calc(var(--s) * 2); align-items: baseline; width: 100%;
120
+ padding: calc(var(--s) * 1.25) calc(var(--s) * 2); border-radius: var(--r-md); color: var(--text); font-size: var(--fs-body); cursor: pointer; }
121
+ #miss .choice:hover { background: var(--hover); color: var(--gold); }
122
+ #miss .choice:focus-visible { outline: 2px solid ${G("gold",80)}; outline-offset: -2px; }
123
+ #miss .slug { margin-left: auto; max-width: 45%; overflow: hidden; text-overflow: ellipsis; font: var(--fs-label) var(--mono); color: var(--muted); white-space: nowrap; }
124
+
125
+ /* One section-header recipe for every left-sidebar section */
126
+ .sec { border-bottom: 1px solid var(--border); }
127
+ .sec > h2 { margin: 0; }
128
+ .sec-head { all: unset; box-sizing: border-box; display: flex; width: 100%; align-items: center; gap: calc(var(--s) * 2);
129
+ padding: calc(var(--s) * 3) calc(var(--s) * 4); cursor: pointer; }
130
+ .sec-head:focus-visible { outline: 2px solid ${G("gold",80)}; outline-offset: -2px; }
131
+ .sec-head .label { flex: 1; }
132
+ .sec-head:hover .label { color: var(--text2); }
133
+ .sec-head .count { font: var(--fs-label) var(--mono); color: var(--muted); }
134
+ .sec-head .chev { color: var(--muted); font-size: var(--fs-micro); transition: transform var(--fast) var(--ease); }
135
+ .sec-head[aria-expanded=false] .chev { transform: rotate(-90deg); }
136
+ .sec-body { padding: 0 calc(var(--s) * 2) calc(var(--s) * 3); max-height: 38vh; overflow: auto; }
137
+
138
+ /* Search: a combobox over notes, tags and domains (search.ts) */
139
+ #search .results { position: absolute; left: 0; right: 0; top: 34px; z-index: 20; padding: var(--s); }
140
+ #search ul { list-style: none; margin: 0; padding: 0; max-height: min(400px, calc(100vh - 120px)); overflow: auto; }
141
+ #search li { display: flex; gap: calc(var(--s) * 2); align-items: center; padding: calc(var(--s) * 1.25) calc(var(--s) * 2);
142
+ border-radius: calc(var(--r-md) - 2px); cursor: pointer; color: var(--text2); font-size: var(--fs-body); white-space: nowrap; overflow: hidden; }
143
+ #search li:hover { background: var(--hover); color: var(--text); }
144
+ #search li[aria-selected=true] { background: var(--hover); color: var(--text); box-shadow: inset 0 0 0 1px ${G("gold",60)}; }
145
+ #search li .name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
146
+ #search li .slug { max-width: 38%; overflow: hidden; text-overflow: ellipsis; font: var(--fs-label) var(--mono); color: var(--muted); }
147
+ #search li .cues { display: flex; gap: var(--s); flex: none; }
148
+ #search .cue { padding: 0 calc(var(--s) * 1.25); border-radius: var(--r-sm); border: 1px solid var(--border); font: 600 var(--fs-micro) var(--display);
149
+ text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
150
+ #search .cue.active { color: var(--gold); border-color: ${G("gold",35)}; }
151
+ #search .cue.knowledge, #search .cue.plan { color: var(--wisdom); border-color: ${G("wisdom",35)}; }
152
+ #search .cue.stale { color: var(--amber); border-color: ${G("amber",40)}; }
153
+ #search .cue.hidden { border-style: dashed; }
154
+ #search li.is-hidden .name { color: var(--muted); }
155
+ #search .mark { flex: none; width: 9px; height: 9px; }
156
+ #search .mark.disc { border-radius: 50%; background: var(--gold); }
157
+ #search li.paused .mark.disc { background: ${G("gold",55)}; }
158
+ #search li.done .mark.disc { background: ${G("gold",25)}; }
159
+ #search li.is-stale .mark.disc { box-shadow: 0 0 0 1.5px var(--root), 0 0 0 3px var(--amber); }
160
+ #search .mark.diamond, #search .mark.hollow { width: 8px; height: 8px; margin: 0 0.5px; transform: rotate(45deg); background: var(--wisdom); }
161
+ #search .mark.hollow { background: none; border: 1.5px solid var(--wisdom); }
162
+ #search .mark.facet { width: auto; height: auto; font: 600 var(--fs-label) var(--mono); color: var(--muted); }
163
+ #search .total { margin: var(--s) calc(var(--s) * 2) 0; font: var(--fs-label) var(--mono); color: var(--muted); }
164
+ #search .total:empty { display: none; }
165
+ .input:focus-visible { outline: 2px solid ${G("gold",80)}; outline-offset: 1px; }
166
+
167
+ /* A notice over the canvas (notice.ts) */
168
+ #notice { position: absolute; top: calc(var(--s) * 3); left: 50%; transform: translateX(-50%); z-index: 15; max-width: min(560px, calc(100% - 32px));
169
+ padding: calc(var(--s) * 2) calc(var(--s) * 3.5); color: var(--text); font-size: var(--fs-body); border-color: ${G("gold",35)}; }
170
+
171
+ /* Legend */
172
+ #legend { position: absolute; top: 38px; right: 0; z-index: 30; width: 320px; max-height: calc(100vh - 64px); overflow: auto; padding: calc(var(--s) * 3.5); }
173
+ #legend .label { margin-bottom: calc(var(--s) * 2.5); }
174
+ #legend dl { display: grid; grid-template-columns: 22px 1fr; gap: calc(var(--s) * 1.5) calc(var(--s) * 2); align-items: center; margin: 0; }
175
+ #legend dt { display: flex; }
176
+ #legend dd { margin: 0; color: var(--text2); }
177
+ #legend dd + dt.group, #legend dt.group + dd { margin-top: calc(var(--s) * 2); }
178
+
179
+ /* Live work, Unlinked and Highlight (sections.ts) */
180
+ #left .hint { margin: 0 calc(var(--s) * 2) calc(var(--s) * 2); color: var(--muted); font-size: var(--fs-base); }
181
+ #left .sub { margin: calc(var(--s) * 2) calc(var(--s) * 2) calc(var(--s) * 0.5); font: 600 var(--fs-micro) var(--display);
182
+ text-transform: uppercase; letter-spacing: .12em; color: var(--muted); }
183
+ #left .dot { width: 8px; height: 8px; border-radius: 50%; flex: none; background: var(--gold); }
184
+ #left .paused .dot { background: ${G("gold",55)}; }
185
+ #left .done .dot { background: ${G("gold",25)}; }
186
+ #left .knowledge .dot { background: var(--wisdom); }
187
+ #left .stale .dot { background: var(--amber); }
188
+ #live .row { all: unset; box-sizing: border-box; display: grid; grid-template-columns: 8px minmax(0, 1fr) auto; gap: 1px calc(var(--s) * 2.5);
189
+ align-items: center; width: 100%; padding: calc(var(--s) * 1.5) calc(var(--s) * 2); border-radius: var(--r-md); cursor: pointer; }
190
+ #live .row:hover { background: var(--hover); }
191
+ #live .row.on { background: ${G("gold",8)}; }
192
+ #live .row:focus-visible { outline: 2px solid ${G("gold",80)}; outline-offset: -2px; }
193
+ #live .row .dot { grid-column: 1; grid-row: 1 / 3; }
194
+ #live .row .nm { grid-column: 2; grid-row: 1; font-size: var(--fs-body); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
195
+ #live .row .sub { grid-column: 2; grid-row: 2; margin: 0; font: var(--fs-label) var(--mono); text-transform: none; letter-spacing: 0;
196
+ color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
197
+ #live .row .st { color: var(--amber); }
198
+ #live .row .cnt { grid-column: 3; grid-row: 1 / 3; font: 600 var(--fs-body) var(--display); color: var(--text2); font-variant-numeric: tabular-nums; }
199
+ #unlinked .un { padding: calc(var(--s) * 1.5) calc(var(--s) * 2); border-radius: var(--r-md); }
200
+ #unlinked .un:hover { background: var(--hover); }
201
+ #unlinked .un.done { opacity: .55; }
202
+ #unlinked .name { all: unset; display: flex; align-items: center; gap: calc(var(--s) * 1.5); font-size: var(--fs-body); cursor: pointer; }
203
+ #unlinked .name:hover { color: var(--gold); }
204
+ #unlinked .name:focus-visible { outline: 2px solid ${G("gold",80)}; outline-offset: 2px; }
205
+ #unlinked .line { display: flex; gap: calc(var(--s) * 1.5); align-items: center; margin-top: var(--s); }
206
+ #unlinked .line .code { padding: var(--s) calc(var(--s) * 1.5); font-size: var(--fs-label); overflow: hidden; text-overflow: ellipsis; }
207
+ #unlinked .line .btn, #highlight .chip { height: 24px; padding: 0 calc(var(--s) * 2); font-size: var(--fs-micro); }
208
+ #highlight .chips { display: flex; flex-wrap: wrap; gap: calc(var(--s) * 1.25); padding: 0 calc(var(--s) * 2); }
209
+ #highlight .chip { text-transform: none; letter-spacing: .02em; font-family: var(--sans); font-weight: 500; font-size: var(--fs-base); }
210
+ #highlight .chip .n { font: var(--fs-micro) var(--mono); color: var(--muted); }
211
+
212
+ /* Activity */
213
+ #activity .follow { margin: 0 calc(var(--s) * 2) calc(var(--s) * 2); height: 24px; font-size: var(--fs-micro); }
214
+ #activity ol { list-style: none; margin: 0; padding: 0 calc(var(--s) * 2); }
215
+ #activity .entry { display: flex; gap: calc(var(--s) * 2); align-items: baseline; width: 100%; padding: calc(var(--s) * 0.75) 0;
216
+ background: none; border: 0; color: var(--text2); text-align: left; white-space: nowrap; cursor: pointer; }
217
+ #activity .entry:hover { color: var(--text); }
218
+ #activity .entry:disabled { cursor: default; opacity: .6; }
219
+ #activity .entry .what { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
220
+ #activity .entry .times { color: var(--text); font-size: var(--fs-label); }
221
+ #activity .entry .agent { max-width: 40%; overflow: hidden; text-overflow: ellipsis; color: var(--muted); font-size: var(--fs-label); }
222
+ #activity .entry .ago { flex: none; min-width: 3ch; text-align: right; color: var(--muted); font-size: var(--fs-label); }
223
+ #activity[data-connection=live] .sec-head .count { color: var(--teal); }
224
+ #activity[data-connection=reconnecting] .sec-head .count, #activity[data-connection=offline] .sec-head .count { color: var(--amber); }
225
+ #activity .mark { width: 7px; height: 7px; border-radius: 50%; flex: none; transform: translateY(-1px); }
226
+ #activity .mark.create { background: var(--create); }
227
+ #activity .mark.update { background: var(--update); }
228
+ #activity .mark.delete { background: var(--delete); }
229
+ #activity .empty { color: var(--muted); }
230
+
231
+ /* The right sidebar: the panel or its empty state */
232
+ #empty { padding: calc(var(--s) * 5) calc(var(--s) * 5.5); display: flex; flex-direction: column; gap: calc(var(--s) * 3); }
233
+ #empty p { margin: 0; color: var(--text2); font-size: var(--fs-body); }
234
+ #panel { position: relative; padding-bottom: calc(var(--s) * 6); font-size: var(--fs-body); }
235
+ #panel:focus { outline: none; }
236
+ #panel .head { position: relative; padding: calc(var(--s) * 4.5) calc(var(--s) * 5.5) calc(var(--s) * 3.5); border-bottom: 1px solid var(--border); }
237
+ #panel h2 { margin: 0 calc(var(--s) * 8) var(--s) 0; font: 700 var(--fs-title)/1.25 var(--display); word-break: break-word; }
238
+ #panel .close { position: absolute; top: calc(var(--s) * 3); right: calc(var(--s) * 3); }
239
+ #panel .badges { display: flex; flex-wrap: wrap; gap: calc(var(--s) * 1.25); margin: 0 calc(var(--s) * 8) calc(var(--s) * 2) 0; }
240
+ #panel .badge { padding: 1px calc(var(--s) * 1.5); border-radius: var(--r-sm); border: 1px solid; font: 600 var(--fs-micro) var(--display);
241
+ text-transform: uppercase; letter-spacing: .12em; white-space: nowrap; }
242
+ #panel .badge.tone-gold { color: var(--gold); border-color: ${G("gold",35)}; background: ${G("gold",10)}; }
243
+ #panel .badge.tone-wisdom { color: var(--wisdom); border-color: ${G("wisdom",35)}; background: ${G("wisdom",10)}; }
244
+ #panel .badge.tone-amber { color: var(--amber); border-color: ${G("amber",40)}; background: ${G("amber",10)}; }
245
+ #panel .badge.tone-muted { color: var(--text2); border-color: var(--border); background: var(--surface); }
246
+ #panel .desc { margin: 0 0 calc(var(--s) * 2); color: var(--text2); }
247
+ #panel .facts { display: flex; flex-wrap: wrap; gap: var(--s) calc(var(--s) * 3.5); color: var(--muted); font-size: var(--fs-base); }
248
+ #panel .facts b { color: var(--text2); font-weight: 500; font-family: var(--mono); }
249
+ #panel .muted { margin: 0 0 calc(var(--s) * 1.5); color: var(--muted); font-size: var(--fs-base); }
250
+ #panel .facts + .muted { margin: calc(var(--s) * 2) 0 0; }
251
+ #panel .depth { display: flex; align-items: center; gap: calc(var(--s) * 1.5); margin-top: calc(var(--s) * 3); }
252
+ #panel .depth .label { margin-right: var(--s); }
253
+ #panel .depth .btn { height: 24px; min-width: 32px; justify-content: center; padding: 0 calc(var(--s) * 2); font-size: var(--fs-micro); }
254
+ #panel .sec { padding: calc(var(--s) * 3.5) calc(var(--s) * 5.5); border-bottom: 1px solid var(--border); }
255
+ #panel .sec:last-child { border-bottom: 0; }
256
+ #panel h3 { display: flex; justify-content: space-between; align-items: baseline; margin: 0 0 calc(var(--s) * 2); }
257
+ #panel h3 .count { font: var(--fs-label) var(--mono); letter-spacing: 0; color: var(--muted); }
258
+ #panel .place { background: ${G("gold",5)}; border-left: 2px solid var(--gold); }
259
+ #panel ul { margin: 0; padding-left: calc(var(--s) * 4.5); }
260
+ #panel ul.actions, #panel ul.log, #panel ul.rows { list-style: none; padding: 0; }
261
+ #panel .actions li { display: flex; gap: calc(var(--s) * 2); align-items: baseline; padding: var(--s) 0; }
262
+ #panel .actions .md { flex: 1; min-width: 0; }
263
+ #panel .actions .age { font: var(--fs-label) var(--mono); color: var(--muted); white-space: nowrap; }
264
+ #panel .actions .stale .age { color: var(--amber); }
265
+ #panel .log li { position: relative; padding: var(--s) 0 calc(var(--s) * 1.5) calc(var(--s) * 3.5); color: var(--text2); }
266
+ #panel .log li::before { content: ''; position: absolute; left: 2px; top: 10px; width: 5px; height: 5px; border-radius: 50%; background: var(--muted); }
267
+ #panel .log li.decision::before { background: var(--gold); }
268
+ #panel .log li.blocker::before { background: var(--delete); }
269
+ #panel .log .when { display: block; font: var(--fs-label) var(--mono); color: var(--muted); }
270
+ #panel .log .summary { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3; overflow: hidden; cursor: pointer; }
271
+ #panel .log .summary.open { display: block; cursor: auto; }
272
+ #panel .log + .muted, #panel .line + .muted { margin-top: calc(var(--s) * 3); }
273
+ #panel .row { all: unset; box-sizing: border-box; display: flex; align-items: center; gap: calc(var(--s) * 2); width: 100%;
274
+ padding: var(--s) calc(var(--s) * 1.5); margin: 0 calc(var(--s) * -1.5); border-radius: calc(var(--r-md) - 2px); cursor: pointer; color: var(--text2); }
275
+ #panel .row:hover { background: var(--hover); color: var(--text); }
276
+ #panel .row:focus-visible { outline: 2px solid ${G("gold",80)}; outline-offset: -2px; }
277
+ #panel .row .dot { width: 7px; height: 7px; border-radius: 50%; flex: none; background: var(--gold); }
278
+ #panel .row.knowledge .dot { background: var(--wisdom); }
279
+ #panel .row.stale .dot { background: var(--amber); }
280
+ #panel .row.done .dot { background: ${G("gold",25)}; }
281
+ #panel .row.paused .dot { background: ${G("gold",55)}; }
282
+ #panel .row .nm { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
283
+ #panel .row .sub { font: var(--fs-label) var(--mono); color: var(--muted); white-space: nowrap; }
284
+ #panel .row.hidden .nm { color: var(--muted); }
285
+ #panel .row.hidden .dot { background: none; border: 1px dashed var(--muted); }
286
+ #panel .more { all: unset; margin-top: var(--s); color: var(--muted); font-size: var(--fs-base); cursor: pointer; }
287
+ #panel .more:hover, #panel .more:focus-visible { color: var(--gold); }
288
+ #panel .md { overflow-wrap: anywhere; color: var(--text2); }
289
+ #panel .md.clamp { position: relative; max-height: 220px; overflow: hidden; }
290
+ #panel .md.clamp::after { content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 56px; background: linear-gradient(transparent, var(--root)); }
291
+ #panel .md h1, #panel .md h2, #panel .md h3, #panel .md h4 { display: block; margin: calc(var(--s) * 3.5) 0 var(--s); font: 600 var(--fs-body) var(--sans); color: var(--text);
292
+ text-transform: none; letter-spacing: 0; }
293
+ #panel .md > :first-child { margin-top: 0; }
294
+ #panel .md > :last-child { margin-bottom: 0; }
295
+ #panel .md h1 { font-size: 15px; }
296
+ #panel .md p, #panel .md ul, #panel .md ol, #panel .md pre, #panel .md table, #panel .md blockquote { margin: 0 0 calc(var(--s) * 2); }
297
+ #panel .md ol { padding-left: calc(var(--s) * 4.5); }
298
+ #panel .md code { padding: 0 3px; background: var(--inset); border: 1px solid var(--border); border-radius: var(--r-sm); font: var(--fs-base) var(--mono); }
299
+ #panel .md pre { padding: calc(var(--s) * 1.5) calc(var(--s) * 2); background: var(--inset); border: 1px solid var(--border); border-radius: var(--r-md); overflow-x: auto; }
300
+ #panel .md pre code { padding: 0; border: 0; background: none; white-space: pre; }
301
+ #panel .md table { display: block; overflow-x: auto; border-collapse: collapse; font-size: var(--fs-base); }
302
+ #panel .md th, #panel .md td { padding: 3px calc(var(--s) * 1.5); border: 1px solid var(--border); text-align: left; vertical-align: top; overflow-wrap: normal; min-width: 72px; }
303
+ #panel .md th { color: var(--text); }
304
+ #panel .md hr { margin: calc(var(--s) * 3) 0; border: 0; border-top: 1px solid var(--border); }
305
+ #panel .md blockquote { padding-left: calc(var(--s) * 2.5); border-left: 2px solid var(--border); color: var(--muted); }
306
+ #panel a.wiki, #panel .md a { color: var(--gold); text-decoration: none; border-bottom: 1px dotted ${G("gold",50)}; }
307
+ #panel .line { display: flex; gap: calc(var(--s) * 1.5); align-items: center; }
308
+ `;function Xd(){return[Cb(),kb(),Ab].join(`
309
+ `)}var Vd="http://www.w3.org/2000/svg";function ne(...e){let r=document.createElementNS(Vd,"svg");for(let[n,o]of Object.entries({width:22,height:18,viewBox:"0 0 22 18","aria-hidden":"true"}))r.setAttribute(n,String(o));for(let{tag:n,...o}of e){let i=document.createElementNS(Vd,String(n));for(let[a,s]of Object.entries(o))i.setAttribute(a,String(s));r.append(i)}return r}var Rb=e=>({id:"",kind:"entity",name:"",status:"active",...e}),Zd=vt(),Eb={last_touched:Zd},Yd={last_touched:"2000-01-01"};function ze(e,r={}){let n=bo(Rb(e),Zd,r.parent??!1),o=r.r??n.radius*(r.scale??1),i=r.cx??11,a=n.hollow?{fill:"none",stroke:n.fill,"stroke-width":1.2}:{fill:n.fill},s=[];if(n.glow&&s.push({tag:"circle",cx:i,cy:9,r:Math.min(8.5,o*Qr/2),fill:H.glow.inner}),n.shape==="diamond"){let l=o*1.25;s.push({tag:"polygon",points:`${i},${9-l} ${i+l},9 ${i},${9+l} ${i-l},9`,...a})}else s.push({tag:"circle",cx:i,cy:9,r:o,...a});return n.core&&s.push({tag:"circle",cx:i,cy:9,r:o*.38,fill:H.core}),n.ring&&s.push({tag:"circle",cx:i,cy:9,r:o+2,fill:"none",stroke:n.ring,"stroke-width":1.5}),s}function Jo(e,r=!1){let{color:n,width:o,dash:i}=wo({source:"",target:"",relation:e},r);return{tag:"line",x1:2,y1:9,x2:20,y2:9,stroke:n,"stroke-width":Math.max(1.5,o*2),"stroke-dasharray":i?.join(" ")??"none"}}var Ya=e=>[{tag:"circle",cx:11,cy:9,r:3.5,fill:e},{tag:"circle",cx:11,cy:9,r:7,fill:"none",stroke:e,"stroke-width":1.5}],Db=[{label:"Entity: a gold disc",swatch:()=>ne(...ze({},{r:4.5}))},{label:"Knowledge note: a blue diamond",swatch:()=>ne(...ze({kind:"knowledge"},{r:4}))},{label:"Plan: a hollow diamond",swatch:()=>ne(...ze({kind:"knowledge",subtype:"plan"},{r:4}))},{label:"Parent: a hollow core",swatch:()=>ne(...ze({},{r:5.5,parent:!0}))},{label:"Size: open actions, up to 12; active work keeps a floor",swatch:()=>ne(...ze({open_actions:0},{scale:.75,cx:5}),...ze({open_actions:9},{scale:.75,cx:14})),group:!0},{label:"Glow: touched in the last 3 days",swatch:()=>ne(...ze(Eb,{r:4}))},{label:"Faded: untouched past its staleness-days",swatch:()=>ne(...ze(Yd,{r:4.5}))},{label:"Amber ring: Stale, active and untouched past its staleness-days",swatch:()=>ne(...ze({...Yd,stale:!0},{r:4.5}))},{label:"Paused: recency only, no size or ring",swatch:()=>ne(...ze({status:"paused"}))},{label:"Done: faint, its links too (shown under Everything)",swatch:()=>ne(...ze({status:"done"},{r:4.5}))},{label:"Selected",swatch:()=>ne(...ze({},{r:4.5}),{tag:"circle",cx:11,cy:9,r:7.5,fill:"none",stroke:H.selectedRing,"stroke-width":1.5})},{label:"Territory: a top-level family, gold when it holds live work",swatch:()=>ne({tag:"circle",cx:11,cy:9,r:7.5,fill:H.territory.live.fill,stroke:H.territory.live.stroke}),group:!0},{label:"Unlinked: no parent, related or wiki-link, gathered in one frame",swatch:()=>ne({tag:"rect",x:3,y:3,width:16,height:12,rx:3,fill:H.frame.fill,stroke:H.frame.stroke,"stroke-dasharray":"2 2"})},{label:"Parent link",swatch:()=>ne(Jo("parent")),group:!0},{label:"Related link",swatch:()=>ne(Jo("related"))},{label:"Wiki-link (dashed)",swatch:()=>ne(Jo("mention"))},{label:"Link to done work (faint)",swatch:()=>ne(Jo("related",!0))},{label:"Pulse: a note just created",swatch:()=>ne(...Ya(er.create)),group:!0},{label:"Pulse: a note just updated",swatch:()=>ne(...Ya(er.update))},{label:"Pulse: a note just deleted, fading out",swatch:()=>ne(...Ya(er.delete))}];function Kd(e,r){let n=E("dl");for(let{label:i,swatch:a,group:s}of Db)n.append(E("dt",s?{class:"group"}:{},a()),E("dd",s?{class:"group"}:{},i));r.append(E("div",{class:"label"},"Legend"),n);let o=i=>{r.hidden=!i,e.setAttribute("aria-expanded",String(i))};e.addEventListener("click",()=>o(r.hidden)),document.addEventListener("pointerdown",i=>{let a=i.target;!r.hidden&&!r.contains(a)&&!e.contains(a)&&o(!1)}),document.addEventListener("keydown",i=>{i.key!=="Escape"||r.hidden||(i.stopImmediatePropagation(),o(!1),e.focus())},{capture:!0})}var Sb=200;async function Qd(){let e;try{e=await fetch("/graph")}catch{return{problem:"Could not reach the graph server. Start it again, then Retry:",line:"hafez graph"}}if(!e.ok){let r=(await e.text().catch(()=>"")).trim().slice(0,Sb);return{problem:`The graph server answered ${e.status}${r?`: ${r}`:"."}`}}try{let r=await e.json();if(Array.isArray(r?.nodes)&&Array.isArray(r?.edges))return{graph:r}}catch{}return{problem:"The graph server sent something that is not a Graph."}}function Mb(e){return!e.nodes.some(r=>r.kind==="entity"||r.kind==="knowledge")}function ep(e,r){let n=E("div",{id:"state",class:"popover",hidden:""});return e.append(n),o=>{if("graph"in o&&!Mb(o.graph)){n.hidden=!0,n.replaceChildren();return}if(n.hidden=!1,"graph"in o){n.setAttribute("role","status"),n.replaceChildren(E("h2",{class:"label"},"The Vault is empty"),E("p",{},"Create the first note, or ask an agent to:"),E("code",{class:"code"},'hafez create entity "<name>" --type project'),E("p",{class:"hint"},"It shows here as soon as it is committed."));return}n.setAttribute("role","alert");let i=E("button",{class:"btn",type:"button"},"Retry");i.addEventListener("click",r),n.replaceChildren(E("h2",{class:"label"},"The graph did not load"),E("p",{},o.problem),...o.line?[E("code",{class:"code"},o.line)]:[],i)}}var hr=null;async function tp(e,r,n){let o=[];try{let l=await fetch(`/note/${encodeURIComponent(r)}`);if(l.status!==404)return;o=(await l.json()).closest??[]}catch{}let i=new Map(D.nodes.map(l=>[l.id,l])),a=o.flatMap(l=>i.get(l)??[]);Xo();let s=E("code",{class:"mono"},r);if(hr=E("div",{id:"miss",role:"status"},E("h2",{class:"label"},"No such note"),E("p",{},"The URL names ",s,", which is not in the Vault.")),a.length){let l=E("ul",{});for(let u of a){let c=E("button",{class:"choice",type:"button",title:u.id},u.name,E("span",{class:"slug"},u.id));c.addEventListener("click",()=>{Xo(),n(u.id)}),l.append(E("li",{},c))}hr.append(E("p",{},"Did you mean:"),l)}else hr.append(E("p",{},"Nothing in the Vault is close to it: search with /."));e.prepend(hr)}function Xo(){hr?.remove(),hr=null}function np(e){let r=[...e].sort(Qt);return{stale:r.filter(Ve),active:r.filter(n=>Ge(n)&&!Ve(n)),paused:r.filter(n=>n.kind==="entity"&&n.status==="paused")}}function op(e,r){let n=Ve(e),o=e.last_touched?.slice(0,10),i=o===void 0?"untouched":lr(o,r),a=o===void 0||i==="today"?i:n?`stale ${zt(o,r)}d`:`${i} ago`,s=e.open_actions??0,l=s===0?"no open actions":e.stale_actions?`${e.stale_actions}/${s} actions stale`:`${s} action${s===1?"":"s"}`;return{when:a,stale:n,share:l,open:s}}function ip(e){return e.filter(r=>r.unlinked).sort((r,n)=>Number(Fe(r))-Number(Fe(n))||r.kind.localeCompare(n.kind)||r.name.localeCompare(n.name))}var rp=e=>typeof e=="string"?e:e.id;function ap(e){let r=new Map;for(let n of e){if(n.relation!=="tag"&&n.relation!=="domain")continue;let o=rp(n.target);r.has(o)||r.set(o,new Set),r.get(o).add(rp(n.source))}return r}function Vo(e,r){let n=ap(r),o={domain:0,tag:1};return e.filter(i=>i.kind==="tag"||i.kind==="domain").map(i=>({id:i.id,kind:i.kind,name:i.name,count:n.get(i.id)?.size??0})).sort((i,a)=>o[i.kind]-o[a.kind]||a.count-i.count||i.name.localeCompare(a.name))}function sp(e,r){let n=ap(r).get(e)??new Set;return o=>n.has(o.id)}function lp(e,r){let{live:n,unlinked:o,highlight:i}=e,a=or().highlight,s=null,l=new Map,u=x=>x.kind==="knowledge"?"knowledge":x.status??"active";function c(x,g){let{when:b,stale:k,share:y,open:_}=op(x,g),w=E("button",{class:`row ${k?"stale":u(x)}`,type:"button",title:x.id},E("span",{class:"dot","aria-hidden":"true"}),E("span",{class:"nm"},x.name),E("span",{class:"sub"},E("span",{class:k?"when st":"when"},b),` \xB7 ${y}`),E("span",{class:"cnt",title:"open actions"},_?String(_):""));w.addEventListener("click",()=>r(x.id)),w.addEventListener("mouseenter",()=>Mo(x.id)),w.addEventListener("focus",()=>{w.matches(":focus-visible")&&Mo(x.id)});for(let C of["mouseleave","blur"])w.addEventListener(C,()=>Mo(null));return x.id===s&&w.classList.add("on"),l.set(x.id,w),w}function f(x){let g=np(D.nodes);l.clear();let b=[];for(let[k,y]of[["Stale",g.stale],["Active",g.active],["Paused",g.paused]])y.length&&b.push(E("h3",{class:"sub"},`${k} \xB7 ${y.length}`),...y.map(_=>c(_,x)));b.length||b.push(E("p",{class:"hint"},"No live or paused work.")),n.body.replaceChildren(...b),n.setCount(String(g.stale.length+g.active.length+g.paused.length)),n.show()}function h(){let x=ip(D.nodes.filter(Ot));o.body.replaceChildren(E("p",{class:"hint"},x.length?"No parent, related or wiki-link either way. Each line places a note beside its closest one.":"Every note in view is linked."),...x.map(g=>{let b=E("button",{class:`name ${u(g)}`,type:"button",title:g.id},E("span",{class:"dot","aria-hidden":"true"}),g.name);b.addEventListener("click",()=>r(g.id));let k=Go(g),y=ur(k);return y.querySelector("code").title=k,E("div",{class:g.status==="done"?"un done":"un"},b,y)})),o.setCount(String(x.length)),o.show()}function d(){let x=Vo(D.nodes,D.links);a!==null&&!x.some(b=>b.id===a)&&m(null);let g=(b,k)=>{let y=x.filter(_=>_.kind===b);return y.length?[E("h3",{class:"sub"},`${k} \xB7 ${y.length}`),E("div",{class:"chips"},...y.map(p))]:[]};i.body.replaceChildren(E("p",{class:"hint"},x.length?"A chip lights the notes carrying it; search finds the rest.":"No note carries a tag or a domain."),...g("domain","Domains"),...g("tag","Tags")),i.setCount(String(x.length)),i.show(),v()}function p(x){let g=E("button",{class:`btn chip ${x.kind}`,type:"button","aria-pressed":String(x.id===a),title:`${x.kind} \xB7 ${x.count} notes`},x.name,E("span",{class:"n"},String(x.count)));return g.dataset.id=x.id,g.addEventListener("click",()=>{m(a===x.id?null:x.id),v()}),g}function m(x){a=x,Pt({highlight:x});for(let g of i.body.querySelectorAll(".chip"))g.setAttribute("aria-pressed",String(g.dataset.id===a))}function v(){ih(a===null?null:sp(a,D.links))}return{render(){let x=vt();f(x),h(),d()},rescope:h,highlight(x){m(x),v()},markSelected(x){l.get(s??"")?.classList.remove("on"),s=x,l.get(x??"")?.classList.add("on")}}}var Tb=5e3;function up(e){let r=E("div",{id:"notice",class:"popover",role:"status",hidden:""});e.append(r);let n;return o=>{r.textContent=o,r.hidden=!1,clearTimeout(n),n=setTimeout(()=>{r.hidden=!0},Tb)}}var cp=600,Nb=2,hp=400,Fb=40,Ib=4;document.head.append(Object.assign(document.createElement("style"),{textContent:Xd()}));var oe=eh(),dr=new Set,yn=new Set,Yo=new Set,_n=null,es=null,Zo=!0,bn=null,Za=!1;D.local=nn();var wn=No,Ka=No!==null;function dp(){Z.graphData().nodes.length!==0&&(_n===null&&qb(),Zo&&(Zo=!1,Za&&D.selected?Ko(D.selected):rs(0),Za=!1))}function Lb(){dp();let e=wn;e===null||!Z.graphData().nodes.some(r=>r.id===e)||(wn=null,gn(e))}function zb(){dp();for(let e of dr)e.fx=void 0,e.fy=void 0;dr.clear(),yn.clear(),Ka&&D.selected?.id===No&&Ko(D.selected),Ka=!1}var Z=new of(oe.canvas).backgroundColor(gf).width(oe.canvas.clientWidth).height(oe.canvas.clientHeight).nodeCanvasObjectMode(()=>"replace").nodeCanvasObject(jf).nodePointerAreaPaint($f).onRenderFramePre(Pb).onRenderFramePost(Ob).linkColor(la).linkWidth(Hf).linkLineDash(Uf).onEngineStop(zb).onEngineTick(Lb).nodeLabel(Bb).onNodeHover(jb).onNodeClick($b).warmupTicks(we.warmupTicks).cooldownTime(we.cooldownMs).d3AlphaDecay(we.alphaDecay).d3AlphaMin(we.alphaMin).d3VelocityDecay(we.velocityDecay);Z.d3Force("link").distance(e=>ta(e,D.local).distance).strength(e=>ta(e,D.local).strength);Z.d3Force("charge").strength(Mf).distanceMax(we.chargeDistanceMax);Z.d3Force("center",null);Z.d3Force("gravity",Tf());for(let e of["wheel","pointerdown","touchstart"])oe.canvas.addEventListener(e,()=>{Ka=!1},{capture:!0,passive:!0});function Pb(e,r){Of(e,r),qf(e,r,Z.graphData().nodes)}function Ob(e,r){Xf(e,r,Z.graphData().nodes),Pd(e,r),Wd(e,r)}function Bb(){return""}function kn(){Z.linkColor(la)}function jb(e){hh(e,Z.graphData().links),kn()}function $b(e){gn(e.id)}function Ko(e){if(D.local||e.x===void 0||e.y===void 0)return;let r=Math.max(Z.zoom(),Nb);Z.centerAt(e.x,e.y,vn(cp)),Z.zoom(r,vn(cp))}Ad(oe.note,{ease:Ko,redraw:kn,drawn:()=>Z.graphData(),selected:e=>{e&&Xo(),Qo.markSelected(e?.id??null);let r=Fo(e?.id??null);!e&&nn()?Qa(null):r&&nn()&&At("free")},focus:Cn,depthControl:()=>ch(Qa)});function Qa(e){let r=pa();if(!(e===r||e!==null&&!D.selected)){if(lh(e),D.local=e!==null,r===null&&(bn=new Map(D.nodes.map(n=>[n,{x:n.x,y:n.y,fx:n.fx,fy:n.fy}]))),e!==null){At("free");return}Hb(),Za=D.selected!==null,At("restore")}}function Hb(){for(let e of D.nodes){let r=bn?.get(e),n=e;delete n.vx,delete n.vy,n.x=r?.x,n.y=r?.y,n.fx=r?.fx,n.fy=r?.fy}bn=null}document.addEventListener("keydown",e=>{if(e.key!=="Escape"||e.defaultPrevented)return;let r=Zf({depth:pa(),selected:D.selected!==null});r==="local"?Qa(null):(r==="selection"&&xn(),rs(vn(hp)))});function Cn(e){if(gn(e))return;let r=D.nodes.find(n=>n.id===e);r&&(pp(r),nn()&&Fo(e)?At("free"):At(),wn=e)}function pp(e){let r=rh(e);r==="knowledge"?fp(`Knowledge turned back on to show ${e.name}.`):r==="scope"&&fp(`Everything turned on to show ${e.name}: Live work hides done work.`)}new ResizeObserver(()=>Z.width(oe.canvas.clientWidth).height(oe.canvas.clientHeight)).observe(oe.canvas);document.fonts.ready.then(()=>{Wf(),kn()});function At(e="keep",r=!1){let n=new Set(Z.graphData().nodes),o=new Set(e==="restore"?D.nodes.filter(a=>a.x!==void 0):n);if(e!=="keep"){for(let a of dr)a.fx=void 0,a.fy=void 0;dr.clear(),yn.clear(),Zo=!0}let i=ma();for(let a of i.nodes)e!=="free"&&(o.has(a)?a.fx===void 0&&!yn.has(a)&&(a.fx=a.x,a.fy=a.y,dr.add(a)):yn.add(a));mp(i.nodes)!==_n&&(_n=null,es=r?D.frame:null),Z.graphData(i),Qo.rescope(),D.selected&&!i.nodes.includes(D.selected)?xn():on(D.selected,i.links)}var Ub=ep(oe.canvas,()=>{ts()});async function ts(){let e=await Qd();if(Ub(e),!("graph"in e))return!1;Ef(e.graph),Qo.render(),At("keep",!0);let r=wn;if(r===null||Z.graphData().nodes.some(o=>o.id===r))return!0;let n=D.nodes.find(o=>o.id===r);return n?(pp(n),At()):(wn=null,Fo(null),tp(oe.note,r,Cn)),!0}nh(oe.scope,oe.tools.knowledge,At);var Qo=lp(oe.sections,Cn);oh(kn);var fp=up(oe.canvas);$d(oe.search,{notes:()=>D.nodes.filter(So),facets:()=>Vo(D.nodes,D.links),shows:Ot,pick:Cn,highlight:e=>Qo.highlight(e)});Gd(oe.sections.activity,{ease:Ko,redraw:kn,select:Cn});Kd(oe.tools.legend,oe.legend);oe.tools.fit.addEventListener("click",()=>rs(vn(hp)));oe.tools.relayout.addEventListener("click",Gb);function rs(e){let r=Z.graphData().nodes.map(o=>({id:o.id,x:o.x,y:o.y,r:o.style.radius*1.25}));if(r.length===0)return;let n=Lf(r,D.frame,Jf(),{w:Z.width(),h:Z.height()},Fb);Z.centerAt(n.x,n.y,e),Z.zoom(D.local?Math.min(n.k,Ib):n.k,e)}function Gb(){for(let e of D.nodes)for(let r of["x","y","vx","vy","fx","fy"])delete e[r];dr.clear(),yn.clear(),Yo.clear(),_n=null,es=null,Zo=!0,bn&&(bn=new Map),Z.graphData(ma())}var mp=e=>e.filter(r=>r.unlinked).map(r=>r.id).join(`
310
+ `);function qb(){let e=Z.graphData().nodes;_n=mp(e);let r=Ff(e.filter(n=>n.unlinked),e.filter(n=>!n.unlinked),es);for(let n of Yo)r?.slots.has(n.id)||(n.fx=void 0,n.fy=void 0,Yo.delete(n));for(let n of e){let o=r?.slots.get(n.id);o&&(n.fx=n.x=o.x,n.fy=n.y=o.y,Yo.add(n))}D.frame=r}ts();async function Wb(){await ts()&&D.selected&&!gn(D.selected.id,!1)&&xn()}zd(()=>Z.graphData().nodes,Wb);})();
311
+ /*! Bundled license information:
312
+
313
+ lodash-es/lodash.js:
314
+ (**
315
+ * @license
316
+ * Lodash (Custom Build) <https://lodash.com/>
317
+ * Build: `lodash modularize exports="es" --repo lodash/lodash#4.18.1 -o ./`
318
+ * Copyright OpenJS Foundation and other contributors <https://openjsf.org/>
319
+ * Released under MIT license <https://lodash.com/license>
320
+ * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
321
+ * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
322
+ *)
323
+
324
+ markdown-it/dist/markdown-it.mjs:
325
+ (*! markdown-it 15.0.3 https://github.com/markdown-it/markdown-it @license MIT *)
326
+ */