lintje 0.9.0 → 0.9.2
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.
- package/dist-elements/actions.js +1 -1
- package/dist-elements/chunks/{addon-CFE6-y31.js → addon-DoyybBuA.js} +1 -1
- package/dist-elements/chunks/{avatar-DzY3fS4s.js → avatar-BGJgBB9r.js} +1 -1
- package/dist-elements/chunks/{axes-ulrAVsug.js → axes-DfDMsu3s.js} +1 -1
- package/dist-elements/chunks/{base-C2UE6JsW.js → base-DpZg_-sV.js} +32 -32
- package/dist-elements/chunks/{chart-styles-BkgU7N0t.js → chart-styles-BIR87i7H.js} +1 -1
- package/dist-elements/chunks/{dialog-close-Df8WPUeN.js → dialog-close-B0vtlJWP.js} +1 -1
- package/dist-elements/chunks/{disclosure-Biihjuj-.js → disclosure-Cr6FasjS.js} +1 -1
- package/dist-elements/chunks/{download-BBk9JDK6.js → download-Bm3q8daQ.js} +1 -1
- package/dist-elements/chunks/{focus-trap-mTUaLDub.js → focus-trap-BQMduQNN.js} +1 -1
- package/dist-elements/chunks/{input-DPDEDGRz.js → input-D43cAS2M.js} +1 -1
- package/dist-elements/chunks/{month-grid-BfJLElcq.js → month-grid-BQKSnNLC.js} +1 -1
- package/dist-elements/chunks/{other-CYGpqIys.js → other-GcjW2Nqw.js} +1 -1
- package/dist-elements/chunks/{player-CCgRqxTM.js → player-DtFr1Bf8.js} +1 -1
- package/dist-elements/chunks/{sentence-DBtTGvDd.js → sentence-Dq2QLUs9.js} +1 -1
- package/dist-elements/chunks/{stagger-D0Ldq1H5.js → stagger-CYcBlEiK.js} +1 -1
- package/dist-elements/core.js +1 -1
- package/dist-elements/custom-elements.json +1 -1
- package/dist-elements/feedback.js +1 -1
- package/dist-elements/layout.js +1 -1
- package/dist-elements/lintje.js +2486 -2481
- package/dist-elements/overlays.js +1 -1
- package/dist-elements/tag/accordion.js +1 -1
- package/dist-elements/tag/activity-log.js +1 -1
- package/dist-elements/tag/ai-label.js +1 -1
- package/dist-elements/tag/announcement.js +1 -1
- package/dist-elements/tag/app-search.js +1 -1
- package/dist-elements/tag/attachment.js +1 -1
- package/dist-elements/tag/audio-player.js +1 -1
- package/dist-elements/tag/badge.js +1 -1
- package/dist-elements/tag/breadcrumbs.js +1 -1
- package/dist-elements/tag/button.js +1 -1
- package/dist-elements/tag/card-list.js +1 -1
- package/dist-elements/tag/card.js +1 -1
- package/dist-elements/tag/chart.js +1 -1
- package/dist-elements/tag/chat-answer.js +1 -1
- package/dist-elements/tag/chat-composer.js +1 -1
- package/dist-elements/tag/chat-message.js +1 -1
- package/dist-elements/tag/chat-questions.js +1 -1
- package/dist-elements/tag/chat-steps.js +1 -1
- package/dist-elements/tag/chat-strip.js +1 -1
- package/dist-elements/tag/chat-suggestions.js +1 -1
- package/dist-elements/tag/chat.js +1 -1
- package/dist-elements/tag/checkbox-group.js +1 -1
- package/dist-elements/tag/checkbox.js +1 -1
- package/dist-elements/tag/code.js +1 -1
- package/dist-elements/tag/combobox.js +1 -1
- package/dist-elements/tag/conflict-alert.js +1 -1
- package/dist-elements/tag/copy-button.js +1 -1
- package/dist-elements/tag/data-table.js +1 -1
- package/dist-elements/tag/date-input.js +1 -1
- package/dist-elements/tag/date-range.js +1 -1
- package/dist-elements/tag/description-list.js +1 -1
- package/dist-elements/tag/dialog.js +1 -1
- package/dist-elements/tag/document-viewer.js +1 -1
- package/dist-elements/tag/drawer.js +1 -1
- package/dist-elements/tag/empty-state.js +1 -1
- package/dist-elements/tag/error-page.js +1 -1
- package/dist-elements/tag/error-summary.js +1 -1
- package/dist-elements/tag/expander.js +1 -1
- package/dist-elements/tag/explainer.js +1 -1
- package/dist-elements/tag/field.js +1 -1
- package/dist-elements/tag/file-upload.js +1 -1
- package/dist-elements/tag/filter-bar.js +1 -1
- package/dist-elements/tag/filter-sheet.js +1 -1
- package/dist-elements/tag/filter-zone.js +1 -1
- package/dist-elements/tag/find.js +1 -1
- package/dist-elements/tag/footer.js +1 -1
- package/dist-elements/tag/form-actions.js +1 -1
- package/dist-elements/tag/form-section.js +1 -1
- package/dist-elements/tag/form.js +1 -1
- package/dist-elements/tag/gallery.js +1 -1
- package/dist-elements/tag/graph.js +1 -1
- package/dist-elements/tag/grid-item.js +1 -1
- package/dist-elements/tag/grid.js +1 -1
- package/dist-elements/tag/hero.js +1 -1
- package/dist-elements/tag/highlight.js +1 -1
- package/dist-elements/tag/icon-button.js +1 -1
- package/dist-elements/tag/icon.js +1 -1
- package/dist-elements/tag/job-list.js +1 -1
- package/dist-elements/tag/key.js +1 -1
- package/dist-elements/tag/kpi-row.js +1 -1
- package/dist-elements/tag/kpi.js +1 -1
- package/dist-elements/tag/level-meter.js +1 -1
- package/dist-elements/tag/list.js +1 -1
- package/dist-elements/tag/log-viewer.js +1 -1
- package/dist-elements/tag/logo.js +1 -1
- package/dist-elements/tag/map.js +1 -1
- package/dist-elements/tag/menu-button.js +1 -1
- package/dist-elements/tag/modal.js +1 -1
- package/dist-elements/tag/multiselect.js +1 -1
- package/dist-elements/tag/note.js +1 -1
- package/dist-elements/tag/notifications.js +1 -1
- package/dist-elements/tag/number-input.js +1 -1
- package/dist-elements/tag/page-header.js +1 -1
- package/dist-elements/tag/pagination.js +1 -1
- package/dist-elements/tag/person-group.js +1 -1
- package/dist-elements/tag/person.js +1 -1
- package/dist-elements/tag/popover.js +1 -1
- package/dist-elements/tag/progress-bar.js +1 -1
- package/dist-elements/tag/prose.js +1 -1
- package/dist-elements/tag/qr-code.js +1 -1
- package/dist-elements/tag/radio-group.js +1 -1
- package/dist-elements/tag/range.js +1 -1
- package/dist-elements/tag/recording-status.js +1 -1
- package/dist-elements/tag/repeater.js +1 -1
- package/dist-elements/tag/segmented.js +1 -1
- package/dist-elements/tag/select.js +1 -1
- package/dist-elements/tag/shell.js +2 -2
- package/dist-elements/tag/skeleton.js +1 -1
- package/dist-elements/tag/slot-picker.js +1 -1
- package/dist-elements/tag/sortable-list.js +7 -5
- package/dist-elements/tag/spinner.js +1 -1
- package/dist-elements/tag/split-pane.js +1 -1
- package/dist-elements/tag/status-dot.js +1 -1
- package/dist-elements/tag/stepper.js +1 -1
- package/dist-elements/tag/streaming-text.js +1 -1
- package/dist-elements/tag/sub-nav.js +1 -1
- package/dist-elements/tag/tabs.js +1 -1
- package/dist-elements/tag/tag-input.js +1 -1
- package/dist-elements/tag/text-editor.js +1 -1
- package/dist-elements/tag/text-input.js +1 -1
- package/dist-elements/tag/textarea.js +1 -1
- package/dist-elements/tag/tile.js +1 -1
- package/dist-elements/tag/time-input.js +1 -1
- package/dist-elements/tag/toast.js +1 -1
- package/dist-elements/tag/toggle.js +1 -1
- package/dist-elements/tag/toggletip.js +1 -1
- package/dist-elements/tag/token-value.js +1 -1
- package/dist-elements/tag/tooltip.js +1 -1
- package/dist-elements/tag/transcript.js +1 -1
- package/dist-elements/tag/translator.js +1 -1
- package/dist-elements/tag/tree-view.js +1 -1
- package/dist-elements/tag/user-menu.js +17 -14
- package/dist-elements/tag/video-player.js +1 -1
- package/dist-elements/types/components/frame/user-menu/user-menu.d.ts +6 -1
- package/dist-elements/types/components/tables/sortable-list/sortable-list.d.ts +15 -3
- package/dist-elements/types/core/host-config.d.ts +5 -4
- package/package.json +1 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{$ as e,M as t,N as n,R as r,W as i,X as a,Z as o,bt as s,cn as c,d as l,dn as u,et as d,f,g as p,jt as m,k as h,l as g,mn as _,n as v,o as y,on as b,pn as x,rn as ee,t as S,u as C,v as w,xt as T,z as te}from"../chunks/base-C2UE6JsW.js";import{n as E,t as ne}from"../chunks/avatar-DzY3fS4s.js";import{t as re}from"./announcement.js";import{a as ie,r as D,t as O}from"../chunks/download-BBk9JDK6.js";import{u as ae}from"../chunks/axes-ulrAVsug.js";import{r as oe,t as se}from"../chunks/chart-styles-BkgU7N0t.js";import{i as ce,n as le,r as ue,t as de}from"../chunks/wheel-Co2Dpj0Q.js";var fe=`.lintje-graph{--lintje-graph-control:var(--h-button-chrome);--lintje-graph-line:1px;gap:var(--space-3);flex-direction:column;min-width:0;display:flex}.lintje-graph.is-phone{--lintje-graph-control:var(--h-touch)}.lintje-graph .lintje-legend__button{min-height:24px}.lintje-graph--expanded{height:var(--chart-h-main)}.lintje-graph--expanded .lintje-graph__area{flex:1;min-height:0}.lintje-graph__area{background:var(--color-bg-surface);border:1px solid var(--color-border-default);cursor:grab;touch-action:pan-x pan-y;user-select:none;position:relative;overflow:hidden}.lintje-graph__lines{pointer-events:none;position:absolute;inset:0}.lintje-graph__line{fill:none;stroke:var(--color-chart-zero)}.lintje-graph__arrow{fill:var(--color-chart-zero)}.lintje-graph__hit{fill:none;stroke:#0000;stroke-width:12px;pointer-events:stroke;cursor:default}.lintje-graph__edge.is-lit .lintje-graph__line{stroke:var(--color-text-secondary)}.lintje-graph__edge.is-lit .lintje-graph__arrow{fill:var(--color-text-secondary)}.lintje-graph__word{font:var(--text-axis);fill:var(--color-text-secondary);text-anchor:middle;dominant-baseline:central;paint-order:stroke;stroke:var(--color-bg-surface);stroke-width:4px;stroke-linejoin:round}.lintje-graph__word.is-lit{fill:var(--color-text-primary)}.lintje-graph__nodes{pointer-events:none;font:var(--text-small);position:absolute;inset:0}.lintje-graph__node,.lintje-graph__counter{pointer-events:auto;position:absolute;top:0;left:0}.lintje-graph__node,.lintje-graph__counter,.lintje-graph__edge,.lintje-graph__word{animation:lintje-fade-in var(--dur-graph) var(--ease-fade)}.lintje-graph__node.is-late,.lintje-graph__counter.is-late,.lintje-graph__edge.is-late,.lintje-graph__word.is-late{animation-delay:var(--dur-graph);animation-fill-mode:backwards}.lintje-graph__edge,.lintje-graph__glyph{transition:opacity var(--dur-hover) var(--ease-fade)}.lintje-graph__edge.is-dim,.lintje-graph__node.is-dim .lintje-graph__glyph{opacity:.45}.lintje-graph__node.is-dim{color:var(--color-text-secondary)}.lintje-graph__node.is-leaving,.lintje-graph__edge.is-leaving{pointer-events:none;animation:lintje-graph-fade-out var(--dur-graph) var(--ease-fade) forwards}.lintje-graph__edge.is-leaving .lintje-graph__hit{pointer-events:none}@keyframes lintje-graph-fade-out{to{opacity:0}}.lintje-graph__card{box-sizing:border-box;width:var(--lintje-graph-w);height:var(--lintje-graph-h);padding:0 calc(12em / 14 + var(--lintje-graph-room,0em)) 0 calc(12em / 14);font-size:calc(var(--lintje-graph-k,1) * 1em);text-align:left;color:var(--color-text-primary);background:var(--color-bg-surface);border:var(--lintje-graph-line) solid var(--color-border-default);cursor:pointer;align-items:center;gap:.571429em;line-height:1.28571;display:flex}.lintje-graph__card:hover,.lintje-graph__card.is-hover{background:var(--color-bg-subtle)}.lintje-graph__card.is-selected{padding:0 calc(12em / 14 - var(--lintje-graph-line) + var(--lintje-graph-room,0em)) 0 calc(12em / 14 - var(--lintje-graph-line));background:var(--color-bg-subtle);border:calc(2 * var(--lintje-graph-line)) solid var(--color-selected-edge)}.lintje-graph__card--group{box-shadow:var(--shadow-stack)}.lintje-graph__glyph{color:var(--lintje-graph-type,var(--color-text-primary));flex:none;display:flex}.lintje-graph__card .lintje-graph__icon{width:1.42857em;height:1.42857em}.lintje-graph__card .lintje-graph__avatar{width:1.71429em;height:1.71429em;font-size:.857143em}.lintje-graph__text{flex-direction:column;min-width:0;display:flex}.lintje-graph__card .lintje-graph__name{-webkit-line-clamp:2;overflow-wrap:anywhere;-webkit-box-orient:vertical;font-weight:700;display:-webkit-box;overflow:hidden}.lintje-graph__status{font:inherit;gap:.428571em}.lintje-graph__sub{-webkit-line-clamp:2;color:var(--color-text-secondary);-webkit-box-orient:vertical;margin-top:.142857em;display:-webkit-box;overflow:hidden}.lintje-graph__mark{align-items:center;gap:var(--space-2);height:28px;color:var(--color-text-primary);cursor:pointer;display:flex}.lintje-graph__mark .lintje-graph__glyph{box-sizing:border-box;border-radius:var(--radius-round);border:1px solid var(--color-chart-zero);background:color-mix(in srgb, var(--lintje-graph-type,var(--color-bg-surface)) var(--tint-graph-mark), var(--color-bg-surface));justify-content:center;align-items:center;width:28px;height:28px}.lintje-graph__mark.is-hover .lintje-graph__glyph{border-color:var(--color-text-secondary)}.lintje-graph__mark.is-selected .lintje-graph__glyph{border:2px solid var(--color-selected-edge)}.lintje-graph__mark .lintje-graph__name{padding:0 var(--space-1);white-space:nowrap;paint-order:stroke fill;-webkit-text-stroke:4px var(--color-bg-surface);font-weight:400}.lintje-graph__mark.is-selected .lintje-graph__name{font-weight:700}.lintje-graph__mark--counted .lintje-graph__name{margin-left:var(--space-4)}.lintje-graph__counter{box-sizing:border-box;min-width:24px;height:24px;padding:0 var(--space-1);background:var(--color-bg-subtle);border:1px solid var(--color-border-default);color:var(--color-text-primary);font:var(--text-axis);white-space:nowrap;cursor:pointer;border-radius:12px;justify-content:center;align-items:center;font-weight:700;display:inline-flex}.lintje-graph__counter:hover{background:var(--color-border-default)}.lintje-graph__counter.is-open{width:24px;padding:0}.lintje-graph__counter.is-quiet:not(:focus-visible){visibility:hidden}.lintje-graph__counter--small{padding:0 var(--space-2);background:0 0;border-color:#0000}.lintje-graph__counter--small:before{content:"";z-index:-1;background:var(--color-bg-subtle);border:1px solid var(--color-border-default);border-radius:10px;position:absolute;inset:2px}.lintje-graph__counter--small:hover{background:0 0}.lintje-graph__counter--small:hover:before{background:var(--color-border-default)}.lintje-graph__tip{pointer-events:none;width:max-content}.lintje-graph__tip-title{margin:0;font-weight:700}.lintje-graph__tip-note{color:var(--color-text-secondary);margin:0}.lintje-graph__tip-list{margin:var(--space-1) 0 0;padding-left:var(--space-4);list-style:outside}.lintje-graph__zoom{z-index:2;top:var(--space-2);right:var(--space-2);flex-direction:column;display:flex;position:absolute}.lintje-graph__zoom-tip{margin-top:calc(var(--lintje-graph-line) * -1);display:flex}.lintje-graph__zoom-tip:first-child{margin-top:0}.lintje-graph__zoom-button{width:var(--lintje-graph-control);height:var(--lintje-graph-control);background:var(--color-bg-surface);color:var(--color-text-primary);border:var(--lintje-graph-line) solid var(--color-border-strong);cursor:pointer;justify-content:center;align-items:center;display:flex;position:relative}.lintje-graph__zoom-button:after{content:"";inset:0 min(0px, calc((100% - var(--h-target)) / 2));position:absolute}.lintje-graph__zoom-button:hover{background:var(--color-bg-subtle)}.lintje-graph__hint{z-index:2;left:50%;bottom:var(--space-2);max-width:calc(100% - 2 * var(--space-4));width:max-content;padding:var(--space-2) var(--space-3);font:var(--text-small);background:var(--color-bg-surface);color:var(--color-text-primary);border:1px solid var(--color-border-strong);text-align:center;margin:0;position:absolute;transform:translate(-50%)}.lintje-graph__overview{z-index:2;right:var(--space-2);bottom:var(--space-2);box-sizing:border-box;background:var(--color-bg-surface);border:1px solid var(--color-border-default);cursor:pointer;position:absolute;overflow:hidden}.lintje-graph__overview-dot{border-radius:var(--radius-round);background:var(--color-chart-zero);width:4px;height:4px;position:absolute;translate:-50% -50%}.lintje-graph__overview-view{box-sizing:border-box;border:1px solid var(--color-accent-line);position:absolute}.lintje-graph__busy{z-index:2;justify-content:center;align-items:center;display:flex;position:absolute;inset:0}@media print{.lintje-graph__zoom,.lintje-graph__overview,.lintje-graph__hint{display:none}}@media (forced-colors:active){.lintje-graph__card,.lintje-graph__mark .lintje-graph__glyph,.lintje-graph__counter,.lintje-graph__counter--small:before{border-color:canvastext}.lintje-graph__card.is-selected,.lintje-graph__mark.is-selected .lintje-graph__glyph{border-color:highlight}.lintje-graph__line{stroke:canvastext}.lintje-graph__arrow{fill:canvastext}}`,k=Object.defineProperty,pe=(e,t,n)=>t in e?k(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,me=(e,t)=>{for(var n in t)k(e,n,{get:t[n],enumerable:!0})},he=(e,t,n)=>pe(e,typeof t==`symbol`?t:t+``,n),ge={};me(ge,{Graph:()=>j,alg:()=>Oe});var _e=Object.defineProperty,ve=(e,t)=>{for(var n in t)_e(e,n,{get:t[n],enumerable:!0})},ye=class{constructor(e){this._isDirected=!0,this._isMultigraph=!1,this._isCompound=!1,this._nodes={},this._in={},this._preds={},this._out={},this._sucs={},this._edgeObjs={},this._edgeLabels={},this._nodeCount=0,this._edgeCount=0,this._defaultNodeLabelFn=()=>{},this._defaultEdgeLabelFn=()=>{},e&&(this._isDirected=`directed`in e?e.directed:!0,this._isMultigraph=`multigraph`in e&&e.multigraph,this._isCompound=`compound`in e&&e.compound),this._isCompound&&(this._parent={},this._children={},this._children[`\0`]={})}isDirected(){return this._isDirected}isMultigraph(){return this._isMultigraph}isCompound(){return this._isCompound}setGraph(e){return this._label=e,this}graph(){return this._label}setDefaultNodeLabel(e){return this._defaultNodeLabelFn=typeof e==`function`?e:()=>e,this}nodeCount(){return this._nodeCount}nodes(){return Object.keys(this._nodes)}sources(){return this.nodes().filter(e=>Object.keys(this._in[e]).length===0)}sinks(){return this.nodes().filter(e=>Object.keys(this._out[e]).length===0)}setNodes(e,t){return e.forEach(e=>{t===void 0?this.setNode(e):this.setNode(e,t)}),this}setNode(e,t){return e in this._nodes?(arguments.length>1&&(this._nodes[e]=t),this):(this._nodes[e]=arguments.length>1?t:this._defaultNodeLabelFn(e),this._isCompound&&(this._parent[e]=`\0`,this._children[e]={},this._children[`\0`][e]=!0),this._in[e]={},this._preds[e]={},this._out[e]={},this._sucs[e]={},++this._nodeCount,this)}node(e){return this._nodes[e]}hasNode(e){return e in this._nodes}removeNode(e){if(e in this._nodes){let t=e=>this.removeEdge(this._edgeObjs[e]);delete this._nodes[e],this._isCompound&&(this._removeFromParentsChildList(e),delete this._parent[e],this.children(e).forEach(e=>{this.setParent(e)}),delete this._children[e]),Object.keys(this._in[e]).forEach(t),delete this._in[e],delete this._preds[e],Object.keys(this._out[e]).forEach(t),delete this._out[e],delete this._sucs[e],--this._nodeCount}return this}setParent(e,t){if(!this._isCompound)throw Error(`Cannot set parent in a non-compound graph`);if(t===void 0)t=`\0`;else{t+=``;for(let n=t;n!==void 0;n=this.parent(n))if(n===e)throw Error(`Setting `+t+` as parent of `+e+` would create a cycle`);this.setNode(t)}return this.setNode(e),this._removeFromParentsChildList(e),this._parent[e]=t,this._children[t][e]=!0,this}parent(e){if(this._isCompound){let t=this._parent[e];if(t!==`\0`)return t}}children(e=`\0`){if(this._isCompound){let t=this._children[e];if(t)return Object.keys(t)}else{if(e===`\0`)return this.nodes();if(this.hasNode(e))return[]}return[]}predecessors(e){let t=this._preds[e];if(t)return Object.keys(t)}successors(e){let t=this._sucs[e];if(t)return Object.keys(t)}neighbors(e){let t=this.predecessors(e);if(t){let n=new Set(t),r=this.successors(e);if(r)for(let e of r)n.add(e);return Array.from(n.values())}}isLeaf(e){let t;return t=this.isDirected()?this.successors(e):this.neighbors(e),(t?.length??0)===0}filterNodes(e){let t=new this.constructor({directed:this._isDirected,multigraph:this._isMultigraph,compound:this._isCompound});t.setGraph(this.graph()),Object.entries(this._nodes).forEach(([n,r])=>{e(n)&&t.setNode(n,r)}),Object.values(this._edgeObjs).forEach(e=>{t.hasNode(e.v)&&t.hasNode(e.w)&&t.setEdge(e,this.edge(e))});let n={},r=e=>{let i=this.parent(e);return!i||t.hasNode(i)?(n[e]=i,i):i in n?n[i]:r(i)};return this._isCompound&&t.nodes().forEach(e=>t.setParent(e,r(e))),t}setDefaultEdgeLabel(e){return this._defaultEdgeLabelFn=typeof e==`function`?e:()=>e,this}edgeCount(){return this._edgeCount}edges(){return Object.values(this._edgeObjs)}setPath(e,t){return e.reduce((e,n)=>(t===void 0?this.setEdge(e,n):this.setEdge(e,n,t),n)),this}setEdge(e,t,n,r){let i,a,o,s,c=!1;typeof e==`object`&&e&&`v`in e?(i=e.v,a=e.w,o=e.name,arguments.length===2&&(s=t,c=!0)):(i=e,a=t,o=r,arguments.length>2&&(s=n,c=!0)),i=``+i,a=``+a,o!==void 0&&(o=``+o);let l=A(this._isDirected,i,a,o);if(l in this._edgeLabels)return c&&(this._edgeLabels[l]=s),this;if(o!==void 0&&!this._isMultigraph)throw Error(`Cannot set a named edge when isMultigraph = false`);this.setNode(i),this.setNode(a),this._edgeLabels[l]=c?s:this._defaultEdgeLabelFn(i,a,o);let u=Se(this._isDirected,i,a,o);return i=u.v,a=u.w,Object.freeze(u),this._edgeObjs[l]=u,be(this._preds[a],i),be(this._sucs[i],a),this._in[a][l]=u,this._out[i][l]=u,this._edgeCount++,this}edge(e,t,n){let r=arguments.length===1?Ce(this._isDirected,e):A(this._isDirected,e,t,n);return this._edgeLabels[r]}edgeAsObj(e,t,n){let r=arguments.length===1?this.edge(e):this.edge(e,t,n);return typeof r!=`object`||!r?{label:r}:r}hasEdge(e,t,n){return(arguments.length===1?Ce(this._isDirected,e):A(this._isDirected,e,t,n))in this._edgeLabels}removeEdge(e,t,n){let r=arguments.length===1?Ce(this._isDirected,e):A(this._isDirected,e,t,n),i=this._edgeObjs[r];if(i){let e=i.v,t=i.w;delete this._edgeLabels[r],delete this._edgeObjs[r],xe(this._preds[t],e),xe(this._sucs[e],t),delete this._in[t][r],delete this._out[e][r],this._edgeCount--}return this}inEdges(e,t){return this.isDirected()?this.filterEdges(this._in[e],e,t):this.nodeEdges(e,t)}outEdges(e,t){return this.isDirected()?this.filterEdges(this._out[e],e,t):this.nodeEdges(e,t)}nodeEdges(e,t){if(e in this._nodes)return this.filterEdges({...this._in[e],...this._out[e]},e,t)}_removeFromParentsChildList(e){delete this._children[this._parent[e]][e]}filterEdges(e,t,n){if(!e)return;let r=Object.values(e);return n?r.filter(e=>e.v===t&&e.w===n||e.v===n&&e.w===t):r}};function be(e,t){e[t]?e[t]++:e[t]=1}function xe(e,t){e[t]!==void 0&&!--e[t]&&delete e[t]}function A(e,t,n,r){let i=``+t,a=``+n;if(!e&&i>a){let e=i;i=a,a=e}return i+``+a+``+(r===void 0?`\0`:r)}function Se(e,t,n,r){let i=``+t,a=``+n;if(!e&&i>a){let e=i;i=a,a=e}let o={v:i,w:a};return r&&(o.name=r),o}function Ce(e,t){return A(e,t.v,t.w,t.name)}ve({},{read:()=>De,write:()=>we});function we(e){let t={options:{directed:e.isDirected(),multigraph:e.isMultigraph(),compound:e.isCompound()},nodes:Te(e),edges:Ee(e)},n=e.graph();return n!==void 0&&(t.value=structuredClone(n)),t}function Te(e){return e.nodes().map(t=>{let n=e.node(t),r=e.parent(t),i={v:t};return n!==void 0&&(i.value=n),r!==void 0&&(i.parent=r),i})}function Ee(e){return e.edges().map(t=>{let n=e.edge(t),r={v:t.v,w:t.w};return t.name!==void 0&&(r.name=t.name),n!==void 0&&(r.value=n),r})}function De(e){let t=new ye(e.options);return e.value!==void 0&&t.setGraph(e.value),e.nodes.forEach(e=>{t.setNode(e.v,e.value),e.parent&&t.setParent(e.v,e.parent)}),e.edges.forEach(e=>{t.setEdge({v:e.v,w:e.w,name:e.name},e.value)}),t}var Oe={};ve(Oe,{CycleException:()=>Ue,bellmanFord:()=>Ae,components:()=>Me,dijkstra:()=>Fe,dijkstraAll:()=>Le,findCycles:()=>ze,floydWarshall:()=>Ve,isAcyclic:()=>Ge,postorder:()=>Ye,preorder:()=>Xe,prim:()=>Ze,shortestPaths:()=>Qe,tarjan:()=>Re,topsort:()=>We});var ke=()=>1;function Ae(e,t,n,r){return je(e,String(t),n||ke,r||function(t){return e.outEdges(t)??[]})}function je(e,t,n,r){let i={},a,o=0,s=e.nodes(),c=function(e){let t=i[e.v],r=i[e.w];if(!t||!r)return;let o=n(e);t.distance+o<r.distance&&(i[e.w]={distance:t.distance+o,predecessor:e.v},a=!0)},l=function(){s.forEach(function(e){r(e).forEach(function(t){let n=t.v===e?t.v:t.w,r=n===t.v?t.w:t.v;c({v:n,w:r})})})};s.forEach(function(e){i[e]={distance:e===t?0:1/0,predecessor:``}});let u=s.length;for(let e=1;e<u&&(a=!1,o++,l(),a);e++);if(o===u-1&&(a=!1,l(),a))throw Error(`The graph contains a negative weight cycle`);return i}function Me(e){let t={},n=[],r;function i(n){var a,o;n in t||(t[n]=!0,r.push(n),(a=e.successors(n))==null||a.forEach(i),(o=e.predecessors(n))==null||o.forEach(i))}return e.nodes().forEach(function(e){r=[],i(e),r.length&&n.push(r)}),n}var Ne=class{constructor(){this._arr=[],this._keyIndices={}}size(){return this._arr.length}keys(){return this._arr.map(e=>e.key)}has(e){return e in this._keyIndices}priority(e){let t=this._keyIndices[e];if(t!==void 0)return this._arr[t].priority}min(){if(this.size()===0)throw Error(`Queue underflow`);return this._arr[0].key}add(e,t){let n=this._keyIndices,r=String(e);if(!(r in n)){let e=this._arr,i=e.length;return n[r]=i,e.push({key:r,priority:t}),this._decrease(i),!0}return!1}removeMin(){if(this.size()===0)throw Error(`Queue underflow`);this._swap(0,this._arr.length-1);let e=this._arr.pop();return delete this._keyIndices[e.key],this._heapify(0),e.key}decrease(e,t){let n=this._keyIndices[e];if(n===void 0)throw Error(`Key not found: ${e}`);let r=this._arr[n].priority;if(t>r)throw Error(`New priority is greater than current priority. Key: ${e} Old: ${r} New: ${t}`);this._arr[n].priority=t,this._decrease(n)}_heapify(e){let t=this._arr,n=2*e,r=n+1,i=e;n<t.length&&(i=t[n].priority<t[i].priority?n:i,r<t.length&&(i=t[r].priority<t[i].priority?r:i),i!==e&&(this._swap(e,i),this._heapify(i)))}_decrease(e){let t=this._arr,n=t[e].priority,r;for(;e!==0&&(r=e>>1,!(t[r].priority<n));)this._swap(e,r),e=r}_swap(e,t){let n=this._arr,r=this._keyIndices,i=n[e],a=n[t];n[e]=a,n[t]=i,r[a.key]=e,r[i.key]=t}},Pe=()=>1;function Fe(e,t,n,r){return Ie(e,String(t),n||Pe,r||function(t){return e.outEdges(t)??[]})}function Ie(e,t,n,r){let i={},a=new Ne,o,s,c=function(e){let t=e.v===o?e.w:e.v,r=i[t];if(!r)return;let c=n(e),l=s.distance+c;if(c<0)throw Error(`dijkstra does not allow negative edge weights. Bad edge: `+e+` Weight: `+c);l<r.distance&&(r.distance=l,r.predecessor=o,a.decrease(t,l))};for(e.nodes().forEach(function(e){let n=e===t?0:1/0;i[e]={distance:n,predecessor:``},a.add(e,n)});a.size()>0;){o=a.removeMin();let e=i[o];if(!e||e.distance===1/0)break;s=e,r(o).forEach(c)}return i}function Le(e,t,n){return e.nodes().reduce(function(r,i){return r[i]=Fe(e,i,t,n),r},{})}function Re(e){let t=0,n=[],r={},i=[];function a(o){var s;let c=r[o]={onStack:!0,lowlink:t,index:t++};if(n.push(o),(s=e.successors(o))==null||s.forEach(function(e){if(e in r){let t=r[e];t!=null&&t.onStack&&(c.lowlink=Math.min(c.lowlink,t.index))}else{a(e);let t=r[e];t&&(c.lowlink=Math.min(c.lowlink,t.lowlink))}}),c.lowlink===c.index){let e=[],t;do{t=n.pop();let i=r[t];i&&(i.onStack=!1),e.push(t)}while(o!==t);i.push(e)}}return e.nodes().forEach(function(e){e in r||a(e)}),i}function ze(e){return Re(e).filter(function(t){let n=t[0];return n?t.length>1||t.length===1&&(e.outEdges(n,n)??[]).length>0:!1})}var Be=()=>1;function Ve(e,t,n){return He(e,t||Be,n||function(t){return e.outEdges(t)??[]})}function He(e,t,n){let r={},i=e.nodes();return i.forEach(function(e){let a={};r[e]=a,a[e]={distance:0,predecessor:``},i.forEach(function(t){e!==t&&(a[t]={distance:1/0,predecessor:``})}),n(e).forEach(function(n){let r=n.v===e?n.w:n.v,i=t(n);a[r]={distance:i,predecessor:e}})}),i.forEach(function(e){let t=r[e];t&&i.forEach(function(n){let a=r[n];a&&i.forEach(function(n){let r=a[e],i=t[n],o=a[n];if(r&&i&&o){let e=r.distance+i.distance;e<o.distance&&(o.distance=e,o.predecessor=i.predecessor)}})})}),r}var Ue=class extends Error{constructor(e){super(e),this.name=`CycleException`}};function We(e){let t={},n={},r=[];function i(a){var o;if(a in n)throw new Ue;a in t||(n[a]=!0,t[a]=!0,(o=e.predecessors(a))==null||o.forEach(i),delete n[a],r.push(a))}if(e.sinks().forEach(i),Object.keys(t).length!==e.nodeCount())throw new Ue;return r}function Ge(e){try{We(e)}catch(e){if(e instanceof Ue)return!1;throw e}return!0}function Ke(e,t,n,r,i){Array.isArray(t)||(t=[t]);let a=(t=>(e.isDirected()?e.successors(t):e.neighbors(t))??[]),o={};return t.forEach(function(t){if(!e.hasNode(t))throw Error(`Graph does not have node: `+t);i=qe(e,t,n===`post`,o,a,r,i)}),i}function qe(e,t,n,r,i,a,o){return t in r||(r[t]=!0,n||(o=a(o,t)),i(t).forEach(function(t){o=qe(e,t,n,r,i,a,o)}),n&&(o=a(o,t))),o}function Je(e,t,n){return Ke(e,t,n,function(e,t){return e.push(t),e},[])}function Ye(e,t){return Je(e,t,`post`)}function Xe(e,t){return Je(e,t,`pre`)}function Ze(e,t){var n;let r=new ye,i={},a=new Ne,o;function s(e){let n=e.v===o?e.w:e.v,r=a.priority(n);if(r!==void 0){let s=t(e);s<r&&(i[n]=o,a.decrease(n,s))}}if(e.nodeCount()===0)return r;e.nodes().forEach(function(e){a.add(e,1/0),r.setNode(e)});let c=e.nodes()[0];c!==void 0&&a.decrease(c,0);let l=!1;for(;a.size()>0;){if(o=a.removeMin(),o in i)r.setEdge(o,i[o]);else{if(l)throw Error(`Input graph is not connected: `+e);l=!0}(n=e.nodeEdges(o))==null||n.forEach(s)}return r}function Qe(e,t,n,r){return $e(e,t,n,r??(t=>e.outEdges(t)??[]))}function $e(e,t,n,r){if(n===void 0)return Fe(e,t,n,r);let i=!1,a=e.nodes();for(let o=0;o<a.length;o++){let s=a[o];if(s===void 0)continue;let c=r(s);for(let e=0;e<c.length;e++){let t=c[e];if(!t)continue;let r=t.v===s?t.v:t.w;n({v:r,w:r===t.v?t.w:t.v})<0&&(i=!0)}if(i)return Ae(e,t,n,r)}return Fe(e,t,n,r)}var j=ye;function M(e,t,n,r){let i=r;for(;e.hasNode(i);)i=pt(r);return n.dummy=t,e.setNode(i,n),i}function et(e){let t=new j().setGraph(e.graph());return e.nodes().forEach(n=>t.setNode(n,e.node(n))),e.edges().forEach(n=>{let r=t.edge(n.v,n.w)||{weight:0,minlen:1},i=e.edge(n);t.setEdge(n.v,n.w,{weight:r.weight+i.weight,minlen:Math.max(r.minlen,i.minlen)})}),t}function tt(e){let t=new j({multigraph:e.isMultigraph()}).setGraph(e.graph());return e.nodes().forEach(n=>{e.children(n).length||t.setNode(n,e.node(n))}),e.edges().forEach(n=>{t.setEdge(n,e.edge(n))}),t}function nt(e,t){let n=e.x,r=e.y,i=t.x-n,a=t.y-r,o=e.width/2,s=e.height/2;if(!i&&!a)throw Error(`Not possible to find intersection inside of the rectangle`);let c,l;return Math.abs(a)*o>Math.abs(i)*s?(a<0&&(s=-s),c=s*i/a,l=s):(i<0&&(o=-o),c=o,l=o*a/i),{x:n+c,y:r+l}}function rt(e){let t=P(lt(e)+1).map(()=>[]);return e.nodes().forEach(n=>{let r=e.node(n),i=r.rank;i!==void 0&&(t[i]||(t[i]=[]),t[i][r.order]=n)}),t}function it(e){let t=e.nodes().map(t=>{let n=e.node(t).rank;return n===void 0?Number.MAX_VALUE:n}),n=N(Math.min,t);e.nodes().forEach(t=>{let r=e.node(t);Object.hasOwn(r,`rank`)&&(r.rank-=n)})}function at(e){let t=e.nodes().map(t=>e.node(t).rank).filter(e=>e!==void 0),n=N(Math.min,t),r=[];e.nodes().forEach(t=>{let i=e.node(t).rank-n;r[i]||(r[i]=[]),r[i].push(t)});let i=0,a=e.graph().nodeRankFactor;Array.from(r).forEach((t,n)=>{t===void 0&&n%a!==0?--i:t!==void 0&&i&&t.forEach(t=>e.node(t).rank+=i)})}function ot(e,t,n,r){let i={width:0,height:0};return arguments.length>=4&&(i.rank=n,i.order=r),M(e,`border`,i,t)}function st(e,t=ct){let n=[];for(let r=0;r<e.length;r+=t){let i=e.slice(r,r+t);n.push(i)}return n}var ct=65535;function N(e,t){return t.length>ct?e(...st(t).map(t=>e(...t))):e(...t)}function lt(e){let t=e.nodes().map(t=>{let n=e.node(t).rank;return n===void 0?Number.MIN_VALUE:n});return N(Math.max,t)}function ut(e,t){let n={lhs:[],rhs:[]};return e.forEach(e=>{t(e)?n.lhs.push(e):n.rhs.push(e)}),n}function dt(e,t){return t()}var ft=0;function pt(e){return e+(``+ ++ft)}function P(e,t,n=1){t??(t=e,e=0);let r=e=>e<t;n<0&&(r=e=>t<e);let i=[];for(let t=e;r(t);t+=n)i.push(t);return i}function mt(e,t){let n={};for(let r of t)e[r]!==void 0&&(n[r]=e[r]);return n}function ht(e,t){let n;return n=typeof t==`string`?e=>e[t]:t,Object.entries(e).reduce((e,[t,r])=>(e[t]=n(r,t),e),{})}function gt(e,t){return e.reduce((e,n,r)=>(e[n]=t[r],e),{})}var _t=`\0`;function vt(e,t,n){if(!(e&&t&&n&&t.dummy===`edge`&&n.dummy===`edge`&&t.edgeObj&&n.edgeObj&&e[t.edgeObj.v]&&e[n.edgeObj.v]&&e[t.edgeObj.w]&&e[n.edgeObj.w]))return 0;let r=!0;t.edgeObj.w===n.edgeObj.w&&(r=!1);let i=r?e[t.edgeObj.v]?.rank??NaN:e[t.edgeObj.w]?.rank??NaN,a=Object.entries(e).find(e=>e[1].edgeObj?.v===t.edgeObj.v&&e[1].edgeObj?.w===t.edgeObj.w&&e[1].rank===i),o=Object.entries(e).find(e=>e[1].edgeObj?.v===n.edgeObj.v&&e[1].edgeObj?.w===n.edgeObj.w&&e[1].rank===i);if(!a||!o)return 0;let s=a[1].order??NaN,c=o[1].order??NaN;return isNaN(s-c)?0:s-c}var yt=class{constructor(){he(this,`_sentinel`);let e={};e._next=e._prev=e,this._sentinel=e}dequeue(){let e=this._sentinel,t=e._prev;if(t!==e)return bt(t),t}enqueue(e){let t=this._sentinel;e._prev&&e._next&&bt(e),e._next=t._next,t._next._prev=e,t._next=e,e._prev=t}toString(){let e=[],t=this._sentinel,n=t._prev;for(;n!==t;)e.push(JSON.stringify(n,xt)),n=n._prev;return`[`+e.join(`, `)+`]`}};function bt(e){e._prev._next=e._next,e._next._prev=e._prev,delete e._next,delete e._prev}function xt(e,t){if(e!==`_next`&&e!==`_prev`)return t}var St=yt,Ct=()=>1;function wt(e,t){if(e.nodeCount()<=1)return[];let n=Dt(e,t||Ct);return Tt(n.graph,n.buckets,n.zeroIdx).flatMap(t=>e.outEdges(t.v,t.w)||[])}function Tt(e,t,n){let r=[],i=t[t.length-1],a=t[0],o;for(;e.nodeCount();){for(;o=a.dequeue();)Et(e,t,n,o);for(;o=i.dequeue();)Et(e,t,n,o);if(e.nodeCount()){for(let i=t.length-2;i>0;--i)if(o=t[i]?.dequeue(),o){r=r.concat(Et(e,t,n,o,!0)||[]);break}}}return r}function Et(e,t,n,r,i){let a=[],o=i?a:void 0;return(e.inEdges(r.v)||[]).forEach(r=>{let o=e.edge(r),s=e.node(r.v);i&&a.push({v:r.v,w:r.w}),s.out-=o,Ot(t,n,s)}),(e.outEdges(r.v)||[]).forEach(r=>{let i=e.edge(r),a=r.w,o=e.node(a);o.in-=i,Ot(t,n,o)}),e.removeNode(r.v),o}function Dt(e,t){let n=new j,r=0,i=0;e.nodes().forEach(e=>{n.setNode(e,{v:e,in:0,out:0})}),e.edges().forEach(e=>{let a=n.edge(e.v,e.w)||0,o=t(e),s=a+o;n.setEdge(e.v,e.w,s);let c=n.node(e.v),l=n.node(e.w);i=Math.max(i,c.out+=o),r=Math.max(r,l.in+=o)});let a=kt(i+r+3).map(()=>new St),o=r+1;return n.nodes().forEach(e=>{Ot(a,o,n.node(e))}),{graph:n,buckets:a,zeroIdx:o}}function Ot(e,t,n){var r,i,a;n.out?n.in?(a=e[n.out-n.in+t])==null||a.enqueue(n):(i=e[e.length-1])==null||i.enqueue(n):(r=e[0])==null||r.enqueue(n)}function kt(e){let t=[];for(let n=0;n<e;n++)t.push(n);return t}function At(e,t){(e.graph().acyclicer===`greedy`?wt(e,n(e)):jt(e,t??null)).forEach(t=>{let n=e.edge(t);e.removeEdge(t),n.forwardName=t.name,n.reversed=!0,e.setEdge(t.w,t.v,n,pt(`rev`))});function n(e){return t=>e.edge(t).weight}}function jt(e,t){let n=[],r={},i={};function a(t){Object.hasOwn(i,t)||(i[t]=!0,r[t]=!0,e.outEdges(t).forEach(e=>{Object.hasOwn(r,e.w)?n.push(e):a(e.w)}),delete r[t])}function o(a){var s;Object.hasOwn(i,a)||(i[a]=!0,r[a]=!0,(s=e.outEdges(a))==null||s.forEach(i=>{Object.hasOwn(r,i.w)||t.node(a)?.rank>t.node(i.w)?.rank&&Nt(e,i.w,i)?n.push(i):o(i.w)}),delete r[a])}let s=a;return t&&typeof t.node==`function`&&(s=o),e.sources().forEach(s),e.nodes().forEach(s),n}function Mt(e){e.edges().forEach(t=>{let n=e.edge(t);if(n.reversed){e.removeEdge(t);let r=n.forwardName;delete n.reversed,delete n.forwardName,e.setEdge(t.w,t.v,n,r)}})}function Nt(e,t,n){let r=/* @__PURE__ */ new Set;function i(t){if(e.sources().includes(t))return!0;r.add(t);for(let a of e.inEdges(t)??[])if((a.v!==n.v||a.w!==n.w)&&!r.has(a.v)&&i(a.v))return!0;return!1}return i(t)}function Pt(e){e.graph().dummyChains=[],e.edges().forEach(t=>Ft(e,t))}function Ft(e,t){let n=t.v,r=e.node(n).rank,i=t.w,a=e.node(i).rank,o=t.name,s=e.edge(t),c=s.labelRank;if(a===r+1)return;e.removeEdge(t);let l,u,d=0;for(++r;r<a;++d,++r)s.points=[],u={width:0,height:0,edgeLabel:s,edgeObj:t,rank:r},l=M(e,`edge`,u,`_d`),r===c&&(u.width=s.width,u.height=s.height,u.dummy=`edge-label`,u.labelpos=s.labelpos),e.setEdge(n,l,{weight:s.weight},o),d===0&&e.graph().dummyChains.push(l),n=l;e.setEdge(n,i,{weight:s.weight},o)}function It(e){e.graph().dummyChains.forEach(t=>{let n=e.node(t),r=n.edgeLabel,i;for(e.setEdge(n.edgeObj,r);n.dummy;)i=e.successors(t)[0],e.removeNode(t),r.points.push({x:n.x,y:n.y}),n.dummy===`edge-label`&&(r.x=n.x,r.y=n.y,r.width=n.width,r.height=n.height),t=i,n=e.node(t)})}function Lt(e){let t={};function n(r){let i=e.node(r);if(Object.hasOwn(t,r))return i.rank;t[r]=!0;let a=e.outEdges(r),o=a?a.map(t=>t==null?1/0:n(t.w)-e.edge(t).minlen):[],s=N(Math.min,o);return s===1/0&&(s=0),i.rank=s}e.sources().forEach(n)}function F(e,t){return e.node(t.w).rank-e.node(t.v).rank-e.edge(t).minlen}var Rt=zt;function zt(e){let t=new j({directed:!1}),n=e.nodes();if(n.length===0)throw Error(`Graph must have at least one node`);let r=n[0],i=e.nodeCount();t.setNode(r,{});let a,o;for(;Bt(t,e)<i&&(a=Vt(t,e),a);)o=t.hasNode(a.v)?F(e,a):-F(e,a),Ht(t,e,o);return t}function Bt(e,t){function n(r){let i=t.nodeEdges(r);i&&i.forEach(i=>{let a=i.v,o=r===a?i.w:a;!e.hasNode(o)&&!F(t,i)&&(e.setNode(o,{}),e.setEdge(r,o,{}),n(o))})}return e.nodes().forEach(n),e.nodeCount()}function Vt(e,t){return t.edges().reduce((n,r)=>{let i=1/0;return e.hasNode(r.v)!==e.hasNode(r.w)&&(i=F(t,r)),i<n[0]?[i,r]:n},[1/0,null])[1]}function Ht(e,t,n){e.nodes().forEach(e=>t.node(e).rank+=n)}var{preorder:Ut,postorder:Wt}=Oe,Gt=I;I.initLowLimValues=Yt,I.initCutValues=Kt,I.calcCutValue=Jt,I.leaveEdge=Zt,I.enterEdge=Qt,I.exchangeEdges=$t;function I(e){e=et(e),Lt(e);let t=Rt(e);Yt(t),Kt(t,e);let n,r;for(;n=Zt(t);)r=Qt(t,e,n),$t(t,e,n,r)}function Kt(e,t){let n=Wt(e,e.nodes());n=n.slice(0,n.length-1),n.forEach(n=>qt(e,t,n))}function qt(e,t,n){let r=e.node(n).parent,i=e.edge(n,r);i.cutvalue=Jt(e,t,n)}function Jt(e,t,n){let r=e.node(n).parent,i=!0,a=t.edge(n,r),o=0;a||=(i=!1,t.edge(r,n)),o=a.weight;let s=t.nodeEdges(n);return s&&s.forEach(a=>{let s=a.v===n,c=s?a.w:a.v;if(c!==r){let r=s===i,l=t.edge(a).weight;if(o+=r?l:-l,tn(e,n,c)){let t=e.edge(n,c).cutvalue;o+=r?-t:t}}}),o}function Yt(e,t){arguments.length<2&&(t=e.nodes()[0]),Xt(e,{},1,t)}function Xt(e,t,n,r,i){let a=n,o=e.node(r);t[r]=!0;let s=e.neighbors(r);return s&&s.forEach(i=>{Object.hasOwn(t,i)||(n=Xt(e,t,n,i,r))}),o.low=a,o.lim=n++,i?o.parent=i:delete o.parent,n}function Zt(e){return e.edges().find(t=>e.edge(t).cutvalue<0)}function Qt(e,t,n){let r=n.v,i=n.w;t.hasEdge(r,i)||(r=n.w,i=n.v);let a=e.node(r),o=e.node(i),s=a,c=!1;return a.lim>o.lim&&(s=o,c=!0),t.edges().filter(t=>c===nn(e,e.node(t.v),s)&&c!==nn(e,e.node(t.w),s)).reduce((e,n)=>F(t,n)<F(t,e)?n:e)}function $t(e,t,n,r){let i=n.v,a=n.w;e.removeEdge(i,a),e.setEdge(r.v,r.w,{}),Yt(e),Kt(e,t),en(e,t)}function en(e,t){let n=e.nodes().find(t=>!e.node(t).parent);if(!n)return;let r=Ut(e,[n]);r=r.slice(1),r.forEach(n=>{let r=e.node(n).parent,i=t.edge(n,r),a=!1;i||(i=t.edge(r,n),a=!0),t.node(n).rank=t.node(r).rank+(a?i.minlen:-i.minlen)})}function tn(e,t,n){return e.hasEdge(t,n)}function nn(e,t,n){return n.low<=t.lim&&t.lim<=n.lim}var rn=an;function an(e){let t=e.graph().ranker;if(typeof t==`function`)return t(e);switch(t){case`network-simplex`:cn(e);break;case`tight-tree`:sn(e);break;case`longest-path`:on(e);break;case`none`:break;default:cn(e)}}var on=Lt;function sn(e){Lt(e),Rt(e)}function cn(e){Gt(e)}var ln=un;function un(e){let t=fn(e),n=e.graph();Array.isArray(n.dummyChains)&&n.dummyChains.forEach(n=>{let r=e.node(n),i=r.edgeObj,a=dn(e,t,i.v,i.w),o=a.path,s=a.lca,c=0,l=o[c],u=!0;for(;n!==i.w;){if(r=e.node(n),u){for(;(l=o[c])!==s&&e.node(l).maxRank<r.rank;)c++;l===s&&(u=!1)}if(!u){for(;c<o.length-1&&e.node(o[c+1]).minRank<=r.rank;)c++;l=o[c]}l!==void 0&&e.setParent(n,l),n=e.successors(n)[0]}})}function dn(e,t,n,r){let i=[],a=[],o=Math.min(t[n].low,t[r].low),s=Math.max(t[n].lim,t[r].lim),c;c=n;do c=e.parent(c),i.push(c);while(c&&(t[c].low>o||s>t[c].lim));let l=c,u=r;for(;(u=e.parent(u))!==l;)a.push(u);return{path:i.concat(a.reverse()),lca:l}}function fn(e){let t={},n=0;function r(i){let a=n;e.children(i).forEach(r),t[i]={low:a,lim:n++}}return e.children(_t).forEach(r),t}function pn(e){let t=M(e,`root`,{},`_root`),n=hn(e),r=Object.values(n),i=N(Math.max,r)-1,a=2*i+1;e.graph().nestingRoot=t,e.edges().forEach(t=>e.edge(t).minlen*=a);let o=gn(e)+1;e.children(_t).forEach(r=>{mn(e,t,a,o,i,n,r)}),e.graph().nodeRankFactor=a}function mn(e,t,n,r,i,a,o){let s=e.children(o);if(!s.length){o!==t&&e.setEdge(t,o,{weight:0,minlen:n});return}let c=ot(e,`_bt`),l=ot(e,`_bb`),u=e.node(o);e.setParent(c,o),u.borderTop=c,e.setParent(l,o),u.borderBottom=l,s.forEach(s=>{mn(e,t,n,r,i,a,s);let u=e.node(s),d=u.borderTop?u.borderTop:s,f=u.borderBottom?u.borderBottom:s,p=u.borderTop?r:2*r,m=d===f?i-(a[o]??0)+1:1;e.setEdge(c,d,{weight:p,minlen:m,nestingEdge:!0}),e.setEdge(f,l,{weight:p,minlen:m,nestingEdge:!0})}),e.parent(o)||e.setEdge(t,c,{weight:0,minlen:i+(a[o]??0)})}function hn(e){let t={};function n(r,i){let a=e.children(r);a&&a.length&&a.forEach(e=>n(e,i+1)),t[r]=i}return e.children(_t).forEach(e=>n(e,1)),t}function gn(e){return e.edges().reduce((t,n)=>t+e.edge(n).weight,0)}function _n(e){let t=e.graph();e.removeNode(t.nestingRoot),delete t.nestingRoot,e.edges().forEach(t=>{e.edge(t).nestingEdge&&e.removeEdge(t)})}var vn=yn;function yn(e){function t(n){let r=e.children(n),i=e.node(n);if(r.length&&r.forEach(t),i&&Object.hasOwn(i,`minRank`)){i.borderLeft=[],i.borderRight=[];for(let t=i.minRank,r=i.maxRank+1;t<r;++t)bn(e,`borderLeft`,`_bl`,n,i,t),bn(e,`borderRight`,`_br`,n,i,t)}}e.children(_t).forEach(t)}function bn(e,t,n,r,i,a){let o={width:0,height:0,rank:a,borderType:t},s=i[t][a-1],c=M(e,`border`,o,n);i[t][a]=c,e.setParent(c,r),s&&e.setEdge(s,c,{weight:1})}function xn(e){let t=e.graph().rankdir?.toLowerCase();(t===`lr`||t===`rl`)&&Cn(e)}function Sn(e){let t=e.graph().rankdir?.toLowerCase();(t===`bt`||t===`rl`)&&Tn(e),(t===`lr`||t===`rl`)&&(Dn(e),Cn(e))}function Cn(e){e.nodes().forEach(t=>wn(e.node(t))),e.edges().forEach(t=>wn(e.edge(t)))}function wn(e){let t=e.width;e.width=e.height,e.height=t}function Tn(e){e.nodes().forEach(t=>En(e.node(t))),e.edges().forEach(t=>{var n;let r=e.edge(t);(n=r.points)==null||n.forEach(En),Object.hasOwn(r,`y`)&&En(r)})}function En(e){e.y=-e.y}function Dn(e){e.nodes().forEach(t=>On(e.node(t))),e.edges().forEach(t=>{var n;let r=e.edge(t);(n=r.points)==null||n.forEach(On),Object.hasOwn(r,`x`)&&On(r)})}function On(e){let t=e.x;e.x=e.y,e.y=t}function kn(e,t=null){let n={},r=e.nodes().filter(t=>!e.children(t).length),i=r.map(t=>e.node(t).rank),a=P(N(Math.max,i)+1).map(()=>[]);function o(t){if(n[t])return;n[t]=!0;let r=e.node(t);a[r.rank].push(t);let i=e.successors(t);i&&[...i].sort((e,t)=>s(e,t)).forEach(o)}r.sort((t,n)=>e.node(t).rank-e.node(n).rank).forEach(o);function s(n,r){return vt(t,e.node(n),e.node(r))}return a}function An(e,t){let n=0;for(let r=1;r<t.length;++r)n+=jn(e,t[r-1],t[r]);return n}function jn(e,t,n){let r=gt(n,n.map((e,t)=>t)),i=t.flatMap(t=>{let n=e.outEdges(t);return n?n.map(t=>({pos:r[t.w],weight:e.edge(t).weight})).sort((e,t)=>e.pos-t.pos):[]}),a=1;for(;a<n.length;)a<<=1;let o=2*a-1;--a;let s=Array(o).fill(0),c=0;return i.forEach(e=>{let t=e.pos+a;s[t]+=e.weight;let n=0;for(;t>0;)t%2&&(n+=s[t+1]),t=t-1>>1,s[t]+=e.weight;c+=e.weight*n}),c}function Mn(e,t=[]){return t.map(t=>{let n=e.inEdges(t);if(!n||!n.length)return{v:t};{let r=n.reduce((t,n)=>{let r=e.edge(n),i=e.node(n.v);return{sum:t.sum+r.weight*i.order,weight:t.weight+r.weight}},{sum:0,weight:0});return{v:t,barycenter:r.sum/r.weight,weight:r.weight}}})}function Nn(e,t){let n={};return e.forEach((e,t)=>{let r={indegree:0,in:[],out:[],vs:[e.v],i:t};e.barycenter!==void 0&&(r.barycenter=e.barycenter,r.weight=e.weight),n[e.v]=r}),t.edges().forEach(e=>{let t=n[e.v],r=n[e.w];t!==void 0&&r!==void 0&&(r.indegree++,t.out.push(r))}),Pn(Object.values(n).filter(e=>!e.indegree))}function Pn(e){let t=[];function n(e){return t=>{t.merged||(t.barycenter===void 0||e.barycenter===void 0||t.barycenter>=e.barycenter)&&Fn(e,t)}}function r(t){return n=>{n.in.push(t),--n.indegree===0&&e.push(n)}}for(;e.length;){let i=e.pop();t.push(i),i.in.reverse().forEach(n(i)),i.out.forEach(r(i))}return t.filter(e=>!e.merged).map(e=>mt(e,[`vs`,`i`,`barycenter`,`weight`]))}function Fn(e,t){let n=0,r=0;e.weight&&(n+=e.barycenter*e.weight,r+=e.weight),t.weight&&(n+=t.barycenter*t.weight,r+=t.weight),e.vs=t.vs.concat(e.vs),e.barycenter=n/r,e.weight=r,e.i=Math.min(t.i,e.i),t.merged=!0}function In(e,t,n,r,i){let a={},o=null,s=null,c=i;typeof t==`boolean`?(c=t,a={}):t&&(a=t,o=n??null,s=r??null);let l=ut(e,e=>Object.hasOwn(e,`barycenter`)),u=l.lhs,d=l.rhs.sort((e,t)=>t.i-e.i),f=[],p=0,m=0,h=0;u.sort(Rn(s,o,!!c));for(let[e,t]of Object.entries(a)){let n=u.findIndex(t=>t.vs[0]===e);u.splice(n+1,0,t)}h=Ln(f,d,h),u.forEach(e=>{h+=e.vs.length,f.push(e.vs),p+=e.barycenter*e.weight,m+=e.weight,h=Ln(f,d,h)});let g={vs:f.flat(1)};return m&&(g.barycenter=p/m,g.weight=m),g}function Ln(e,t,n){let r;for(;t.length&&(r=t[t.length-1]).i<=n;)t.pop(),e.push(r.vs),n++;return n}function Rn(e,t,n){return(r,i)=>{if(r.barycenter<i.barycenter)return-1;if(r.barycenter>i.barycenter)return 1;if(e&&(typeof r.vs[0]==`string`||typeof i.vs[0]==`string`)){let n=vt(t,e.node(r.vs[0]),e.node(i.vs[0]));if(n!==0)return n}return n?i.i-r.i:r.i-i.i}}function zn(e,t,n,r,i){var a,o;let s=null,c=i;typeof r==`boolean`?(c=r,s=null):r!==void 0&&(s=r);let l=e.children(t),u=e.node(t),d=u?u.borderLeft:void 0,f=u?u.borderRight:void 0,p={};d&&(l=l.filter(e=>e!==d&&e!==f));let m=Mn(e,l);m.forEach(t=>{if(e.children(t.v).length){let{result:r}=zn(e,t.v,n,s,c);p[t.v]=r,Object.hasOwn(r,`barycenter`)&&Vn(t,r)}});let h=Nn(m,n);Bn(h,p);let g={},_=!1;for(let t=0;t<h.length;t++)for(let n=t+1;n<h.length;n++)if(h[t]&&h[n]&&(a=h[t])!=null&&a.barycenter&&(o=h[n])!=null&&o.barycenter&&h[t]?.barycenter===h[n].barycenter){let r=h[t]?.vs[0]??``,i=h[n]?.vs[0]??``,a=e.node(r),o=e.node(i);if(a.dummy===`edge`&&o.dummy===`edge`&&a.edgeObj?.v===o.edgeObj?.v&&a.edgeObj?.w===o.edgeObj?.w){if(a.edgeLabel.reversed){g[i]=h[t],h.splice(t,1),t--;break}g[r]=h[n],h.splice(n,1),n--}else _=!0}let v=In(h,g,s,e,c);if(d&&f){v.vs=[d,v.vs,f].flat(1);let t=e.predecessors(d);if(t&&t.length){let n=e.node(t[0]),r=e.predecessors(f),i=e.node(r[0]);Object.hasOwn(v,`barycenter`)||(v.barycenter=0,v.weight=0),v.barycenter=(v.barycenter*v.weight+n.order+i.order)/(v.weight+2),v.weight+=2}}return Object.defineProperty(v,"result",{value:v,enumerable:!1,configurable:!0,writable:!0}),Object.defineProperty(v,"usedBias",{value:_,enumerable:!1,configurable:!0,writable:!0}),v}function Bn(e,t){e.forEach(e=>{e.vs=e.vs.flatMap(e=>t[e]?t[e].vs:e)})}function Vn(e,t){e.barycenter===void 0?(e.barycenter=t.barycenter,e.weight=t.weight):(e.barycenter=(e.barycenter*e.weight+t.barycenter*t.weight)/(e.weight+t.weight),e.weight+=t.weight)}function Hn(e,t,n,r){r||=e.nodes();let i=Un(e),a=new j({compound:!0}).setGraph({root:i}).setDefaultNodeLabel(t=>e.node(t));return r.forEach(r=>{let o=e.node(r),s=e.parent(r);if(o.rank===t||o.minRank<=t&&t<=o.maxRank){a.setNode(r),a.setParent(r,s||i);let c=e[n](r);c&&c.forEach(t=>{let n=t.v===r?t.w:t.v,i=a.edge(n,r),o=i===void 0?0:i.weight;a.setEdge(n,r,{weight:e.edge(t).weight+o})}),Object.hasOwn(o,`minRank`)&&a.setNode(r,{borderLeft:o.borderLeft[t],borderRight:o.borderRight[t]})}}),a}function Un(e){let t;for(;e.hasNode(t=pt(`_root`)););return t}function Wn(e,t,n){let r={},i;n.forEach(n=>{let a=e.parent(n),o,s;for(;a;){if(o=e.parent(a),o?(s=r[o],r[o]=a):(s=i,i=a),s&&s!==a){t.setEdge(s,a);return}a=o}})}function Gn(e,t={},n=null){if(typeof t.customOrder==`function`){t.customOrder(e,Gn);return}let r=lt(e),i=Kn(e,P(1,r+1),`inEdges`),a=Kn(e,P(r-1,-1,-1),`outEdges`),o=kn(e,n);if(Jn(e,o),t.disableOptimalOrderHeuristic)return;let s=1/0,c,l=t.constraints||[];for(let t=0,r=0;r<4;++t,++r){qn(t%2?i:a,t%4>=2,l,n),o=rt(e);let u=An(e,o);u<s?(r=0,c=Object.assign({},o),s=u):u===s&&(c=structuredClone(o))}Jn(e,c)}function Kn(e,t,n){let r=/* @__PURE__ */ new Map,i=(e,t)=>{r.has(e)||r.set(e,[]),r.get(e).push(t)};for(let t of e.nodes()){let n=e.node(t);if(typeof n.rank==`number`&&i(n.rank,t),typeof n.minRank==`number`&&typeof n.maxRank==`number`)for(let e=n.minRank;e<=n.maxRank;e++)e!==n.rank&&i(e,t)}return t.map(function(t){return Hn(e,t,n,r.get(t)||[])})}function qn(e,t,n,r){let i=!0,a=new j;e.forEach(function(e){n.forEach(e=>a.setEdge(e.left,e.right));let o=e.graph().root,{result:s,usedBias:c}=zn(e,o,a,r,i);t&&c&&(i=!i),s.vs.forEach((t,n)=>e.node(t).order=n),Wn(e,a,s.vs)})}function Jn(e,t){Object.values(t).forEach(t=>t.forEach((t,n)=>e.node(t).order=n))}function Yn(e,t){let n={};function r(t,r){let i=0,a=0,o=t.length,s=r[r.length-1];return r.forEach((t,c)=>{let l=Zn(e,t),u=l?e.node(l).order:o;(l||t===s)&&(r.slice(a,c+1).forEach(t=>{let r=e.predecessors(t);r&&r.forEach(r=>{let a=e.node(r),o=a.order;(o<i||u<o)&&!(a.dummy&&e.node(t).dummy)&&Qn(n,r,t)})}),a=c+1,i=u)}),r}return t.length&&t.reduce(r),n}function Xn(e,t){let n={};function r(t,r,i,a,o){P(r,i).forEach(r=>{let i=t[r];if(i!==void 0&&e.node(i).dummy){let t=e.predecessors(i);t&&t.forEach(t=>{if(t===void 0)return;let r=e.node(t);r.dummy&&(r.order<a||r.order>o)&&Qn(n,t,i)})}})}function i(t,n){let i=-1,a=-1,o=0;return n.forEach((s,c)=>{if(e.node(s).dummy===`border`){let t=e.predecessors(s);if(t&&t.length){let s=t[0];if(s===void 0)return;a=e.node(s).order,r(n,o,c,i,a),o=c,i=a}}r(n,o,n.length,a,t.length)}),n}return t.length&&t.reduce(i),n}function Zn(e,t){if(e.node(t).dummy){let n=e.predecessors(t);if(n)return n.find(t=>e.node(t).dummy)}}function Qn(e,t,n){if(t>n){let e=t;t=n,n=e}let r=e[t];r||(e[t]=r={}),r[n]=!0}function $n(e,t,n){if(t>n){let e=t;t=n,n=e}let r=e[t];return r!==void 0&&Object.hasOwn(r,n)}function er(e,t,n,r,i){let a={},o={},s={};return t.forEach(e=>{e.forEach((e,t)=>{a[e]=e,o[e]=e,s[e]=t})}),t.forEach(t=>{let c=-1,l=-1,u=!1,d=t,f=t.findIndex(t=>i?.includes(t)||lr(t,e,i));f>0&&(d=[t[f],...t.slice(0,f),...t.slice(f+1)],u=!0),d.forEach(t=>{let d=r(t);if(d&&d.length){i!=null&&i.includes(t)&&(d=d.filter(t=>lr(t,e,i)));let r=d.sort((e,t)=>{let n=s[e],r=s[t];return(n===void 0?0:n)-(r===void 0?0:r)}),f=(r.length-1)/2;for(let e=Math.floor(f),i=Math.ceil(f);e<=i;++e){let i=r[e];if(i===void 0)continue;let d=s[i];if(d!==void 0&&o[t]===t&&c<d&&s[i]!==l&&!$n(n,t,i)){let e=a[i];e!==void 0&&(o[i]=t,o[t]=a[t]=e,c=d,u&&=(c=-1,l=s[i]??-1,!1))}}}})}),{root:a,align:o}}function tr(e,t,n,r,i=!1){let a={},o=nr(e,t,n,i),s=i?`borderLeft`:`borderRight`;function c(e,t){let n=o.nodes().slice(),r={},i=n.pop();for(;i;){if(r[i])e(i);else{r[i]=!0,n.push(i);for(let e of t(i))n.push(e)}i=n.pop()}}function l(e){let t=o.inEdges(e);t?a[e]=t.reduce((e,t)=>{let n=a[t.v]??0,r=o.edge(t);return Math.max(e,n+(r===void 0?0:r))},0):a[e]=0}function u(t){let n=o.outEdges(t),r=1/0;n&&(r=n.reduce((e,t)=>{let n=a[t.w],r=o.edge(t);return Math.min(e,(n===void 0?0:n)-(r===void 0?0:r))},1/0));let i=e.node(t);r!==1/0&&i.borderType!==s&&(a[t]=Math.max(a[t]===void 0?0:a[t],r))}function d(e){return o.predecessors(e)||[]}function f(e){return o.successors(e)||[]}return c(l,d),c(u,f),Object.keys(r).forEach(e=>{let t=n[e];t!==void 0&&(a[e]=a[t]??0)}),a}function nr(e,t,n,r){let i=new j,a=e.graph(),o=sr(a.nodesep,a.edgesep,r);return t.forEach(t=>{let r;t.forEach(t=>{let a=n[t];if(a!==void 0){if(i.setNode(a),r!==void 0){let s=n[r];if(s!==void 0){let n=i.edge(s,a);i.setEdge(s,a,Math.max(o(e,t,r),n||0))}}r=t}})}),i}function rr(e,t){return Object.values(t).reduce((t,n)=>{let r=-1/0,i=1/0;Object.entries(n).forEach(([t,n])=>{let a=cr(e,t)/2;r=Math.max(n+a,r),i=Math.min(n-a,i)});let a=r-i;return a<t[0]&&(t=[a,n]),t},[1/0,null])[1]}function ir(e,t){let n=Object.values(t),r=N(Math.min,n),i=N(Math.max,n);[`u`,`d`].forEach(n=>{[`l`,`r`].forEach(a=>{let o=n+a,s=e[o];if(!s||s===t)return;let c=Object.values(s),l=r-N(Math.min,c);a!==`l`&&(l=i-N(Math.max,c)),l&&(e[o]=ht(s,e=>e+l))})})}function ar(e,t=void 0){let n=e.ul;return n?ht(n,(n,r)=>{if(t){let n=e[t.toLowerCase()];if(n&&n[r]!==void 0)return n[r]}let i=Object.values(e).map(e=>{let t=e[r];return t===void 0?0:t}).sort((e,t)=>e-t);return((i[1]??0)+(i[2]??0))/2}):{}}function or(e,t){let n=rt(e),r=Object.assign(Yn(e,n),Xn(e,n)),i={},a;return[`u`,`d`].forEach(o=>{a=o===`u`?n:Object.values(n).reverse(),[`l`,`r`].forEach(n=>{n===`r`&&(a=a.map(e=>Object.values(e).reverse()));let s=er(e,a,r,t=>(o===`u`?e.predecessors(t):e.successors(t))||[],t),c=tr(e,a,s.root,s.align,n===`r`);n===`r`&&(c=ht(c,e=>-e)),i[o+n]=c})}),ir(i,rr(e,i)),ar(i,e.graph().align)}function sr(e,t,n){return(r,i,a)=>{let o=r.node(i),s=r.node(a),c=0,l;if(c+=o.width/2,Object.hasOwn(o,`labelpos`))switch(o.labelpos.toLowerCase()){case`l`:l=-o.width/2;break;case`r`:l=o.width/2}if(l&&(c+=n?l:-l),l=void 0,c+=(o.dummy?t:e)/2,c+=(s.dummy?t:e)/2,c+=s.width/2,Object.hasOwn(s,`labelpos`))switch(s.labelpos.toLowerCase()){case`l`:l=s.width/2;break;case`r`:l=-s.width/2}return l&&(c+=n?l:-l),c}}function cr(e,t){return e.node(t).width}function lr(e,t,n){if(!n)return!1;let r=t.node(e)?.edgeObj;if(!r||t.node(e).edgeLabel.reversed)return!1;let i=n.indexOf(r?.v),a=n.indexOf(r?.w);return i!==-1&&a!==-1&&i===(a+1)%n.length||i===(a-1)%n.length}function ur(e,t){e=tt(e),dr(e),Object.entries(or(e,t)).forEach(([t,n])=>e.node(t).x=n)}function dr(e){let t=rt(e),n=e.graph(),r=n.ranksep,i=n.rankalign,a=0;t.forEach(t=>{let n=t.reduce((t,n)=>{let r=e.node(n).height??0;return t>r?t:r},0);t.forEach(t=>{let r=e.node(t);r.y=i===`top`?a+r.height/2:i===`bottom`?a+n-r.height/2:a+n/2}),a+=n+r})}var fr=/* @__PURE__ */ new WeakMap;function pr(e,t={}){return hr(e,dt,t),e}function mr(e,t,n){let r=t;for(;r!==void 0;){let t=e.parent(r);if(t===n)return r;r=t}}function hr(e,t,n){let r=e.nodes().filter(t=>e.children(t).length),i={};r.forEach(r=>{let a=e.node(r);if(a&&a.rankdir){let o=new j({multigraph:!0,compound:!0});o.setGraph({rankdir:a.rankdir});let s=e.children(r);s.forEach(t=>{let n={...e.node(t)};o.setNode(t,n);let i=e.parent(t);i&&i!==r&&s.includes(i)&&o.setParent(t,i)});let c=/* @__PURE__ */ new Set;e.edges().forEach(t=>{let n=mr(e,t.v,r),i=mr(e,t.w,r);if(n&&i&&n!==i){let r=`${n}\0${i}`;c.has(r)||(c.add(r),o.setEdge(n,i,{...e.edge(t)}))}}),hr(o,t,n);let l=Er(o);gr(l,t,n,null),_r(o,l);let u=1/0,d=1/0,f=-1/0,p=-1/0;o.nodes().forEach(e=>{if(e===r)return;let t=o.node(e);t&&typeof t.x==`number`&&typeof t.y==`number`&&typeof t.width==`number`&&typeof t.height==`number`&&(u=Math.min(u,t.x-t.width/2),f=Math.max(f,t.x+t.width/2),d=Math.min(d,t.y-t.height/2),p=Math.max(p,t.y+t.height/2))}),(!isFinite(u)||!isFinite(d)||!isFinite(f)||!isFinite(p))&&(u=d=0,f=p=0);let m=f-u,h=p-d;i[r]={minX:u,minY:d,maxX:f,maxY:p,width:m,height:h,offsetX:u,offsetY:d},a._dagreClusterSubgraph=o}});let a=[],o=t=>{let n=[],r=(e.children(t)||[]).filter(e=>e!==t);for(;r.length>0;){let t=r.shift();n.push(t),(e.children(t)||[]).filter(e=>e!==t).forEach(e=>r.push(e))}return n},s=/* @__PURE__ */ new Map;r.forEach(t=>{let n=e.node(t);n&&n.rankdir&&i[t]&&s.set(t,(e.children(t)||[]).filter(e=>e!==t))});let c=new Set([...s.values()].flat()),l=/* @__PURE__ */ new Map;s.forEach((e,t)=>{c.has(t)||l.set(t,o(t))});let u=new Set([...l.values()].flat()),d=e=>{for(let[t,n]of l)if(n.includes(e))return t;return e},f=[];e.edges().forEach(t=>{(u.has(t.v)||u.has(t.w))&&f.push({edge:t,label:e.edge(t)})});let p=/* @__PURE__ */ new Map;u.forEach(t=>{let n=e.parent(t);p.set(t,typeof n==`string`?n:void 0)}),l.forEach((t,n)=>{let r=e.node(n),o=[];t.forEach(t=>{let n=e.node(t);n&&(o.push({id:t,node:n,parent:p.get(t)}),e.removeNode(t))});let s=f.filter(({edge:e})=>t.includes(e.v)||t.includes(e.w)),c=i[n];r&&(a.push({clusterId:n,subgraph:r._dagreClusterSubgraph,bounds:c,children:t,removedNodes:o,removedEdges:s}),r.width=c.width,r.height=c.height)});let m=/* @__PURE__ */ new Set;f.forEach(({edge:t,label:n})=>{let r=d(t.v),i=d(t.w);if(r!==i&&e.hasNode(r)&&e.hasNode(i)){let t=`${r}\0${i}`;m.has(t)||(m.add(t),e.setEdge(r,i,{...n,width:0,height:0}))}});let h=Er(e),g=gr(h,t,n,fr.get(e)??null);fr.set(e,g),_r(e,h),m.forEach(t=>{let n=t.indexOf(`\0`),r=t.slice(0,n),i=t.slice(n+1);e.hasEdge(r,i)&&e.removeEdge(r,i)}),a.forEach(({clusterId:t,subgraph:n,bounds:r,removedNodes:i,removedEdges:a})=>{let o=e.node(t),s=o?.x??0,c=o?.y??0,l=(r.minX+r.maxX)/2,u=(r.minY+r.maxY)/2;i.forEach(({id:t,node:n,parent:r})=>{e.setNode(t,n),r!==void 0&&e.setParent(t,r)}),a.forEach(({edge:t,label:n})=>{e.setEdge(t,n)}),n.nodes().forEach(r=>{if(r===t)return;let i=n.node(r),a=e.node(r);a&&i&&typeof i.x==`number`&&typeof i.y==`number`&&(a.x=s+(i.x-l),a.y=c+(i.y-u))}),delete o._dagreClusterSubgraph}),r.forEach(t=>{let n=e.node(t),r=i[t];if(n&&n.rankdir&&n._dagreClusterSubgraph&&r){let i=n._dagreClusterSubgraph,a=n.x??0,o=n.y??0,s=(r.minX+r.maxX)/2,c=(r.minY+r.maxY)/2;i.nodes().forEach(n=>{if(n===t)return;let r=i.node(n),l=e.node(n);if(l&&r&&typeof r.x==`number`&&typeof r.y==`number`){let e=r.x-s,t=r.y-c;l.x=a+e,l.y=o+t}}),delete n._dagreClusterSubgraph}})}function gr(e,t,n,r=null){var i,a;let o=n?.useDynamic!==!1,s=o&&(i=r?.graph)!=null?i:null,c=o&&(a=r?.rawNodes)!=null?a:null;t(` makeSpaceForEdgeLabels`,()=>Dr(e)),t(` removeSelfEdges`,()=>Ir(e)),t(` acyclic`,()=>At(e,s)),t(` nestingGraph.run`,()=>pn(e)),t(` rank`,()=>rn(tt(e))),t(` injectEdgeLabelProxies`,()=>Or(e)),t(` removeEmptyRanks`,()=>at(e)),t(` nestingGraph.cleanup`,()=>_n(e)),t(` normalizeRanks`,()=>it(e)),t(` assignRankMinMax`,()=>kr(e)),t(` removeEdgeLabelProxies`,()=>Ar(e)),t(` normalize.run`,()=>Pt(e)),t(` parentDummyChains`,()=>ln(e)),t(` addBorderSegments`,()=>vn(e)),t(` order`,()=>Gn(e,n,c)),t(` insertSelfEdges`,()=>Lr(e)),t(` adjustCoordinateSystem`,()=>xn(e)),t(` position`,()=>ur(e,n.corePath)),t(` positionSelfEdges`,()=>Rr(e));let l=JSON.parse(JSON.stringify(e._nodes));return t(` removeBorderNodes`,()=>Fr(e)),t(` normalize.undo`,()=>It(e)),t(` fixupEdgeLabelCoords`,()=>Nr(e)),t(` undoCoordinateSystem`,()=>Sn(e)),t(` translateGraph`,()=>jr(e)),t(` assignNodeIntersects`,()=>Mr(e)),t(` reversePoints`,()=>Pr(e)),t(` acyclic.undo`,()=>Mt(e)),{graph:e,rawNodes:l}}function _r(e,t){e.nodes().forEach(n=>{let r=e.node(n),i=t.node(n);r&&(r.x=i.x,r.y=i.y,r.order=i.order,r.rank=i.rank,t.children(n).length&&(r.width=i.width,r.height=i.height))}),e.edges().forEach(n=>{let r=e.edge(n),i=t.edge(n);r.points=i.points,Object.hasOwn(i,`x`)&&(r.x=i.x,r.y=i.y)}),e.graph().width=t.graph().width,e.graph().height=t.graph().height}var vr=[`nodesep`,`edgesep`,`ranksep`,`marginx`,`marginy`],yr={ranksep:50,edgesep:20,nodesep:50,rankdir:`TB`,rankalign:`center`},br=[`acyclicer`,`ranker`,`rankdir`,`align`,`rankalign`],xr=[`width`,`height`,`rank`],Sr={width:0,height:0},Cr=[`minlen`,`weight`,`width`,`height`,`labeloffset`],wr={minlen:1,weight:1,width:0,height:0,labeloffset:10,labelpos:`r`},Tr=[`labelpos`];function Er(e){let t=new j({multigraph:!0,compound:!0}),n=Br(e.graph());return t.setGraph(Object.assign({},yr,zr(n,vr),mt(n,br))),e.nodes().forEach(n=>{let r=zr(Br(e.node(n)),xr);Object.keys(Sr).forEach(e=>{r[e]===void 0&&(r[e]=Sr[e])}),t.setNode(n,r);let i=e.parent(n);i!==void 0&&t.setParent(n,i)}),e.edges().forEach(n=>{let r=Br(e.edge(n));t.setEdge(n,Object.assign({},wr,zr(r,Cr),mt(r,Tr)))}),t}function Dr(e){let t=e.graph();t.ranksep/=2,e.edges().forEach(n=>{let r=e.edge(n);r.minlen*=2,(r.labelpos??`r`).toLowerCase()!==`c`&&(t.rankdir===`TB`||t.rankdir===`BT`?r.width+=r.labeloffset:r.height+=r.labeloffset)})}function Or(e){e.edges().forEach(t=>{let n=e.edge(t);if(n.width&&n.height){let n=e.node(t.v);M(e,`edge-proxy`,{rank:(e.node(t.w).rank-n.rank)/2+n.rank,e:t},`_ep`)}})}function kr(e){let t=0;e.nodes().forEach(n=>{let r=e.node(n);r.borderTop&&(r.minRank=e.node(r.borderTop).rank,r.maxRank=e.node(r.borderBottom).rank,t=Math.max(t,r.maxRank))}),e.graph().maxRank=t}function Ar(e){e.nodes().forEach(t=>{let n=e.node(t);if(n.dummy===`edge-proxy`){let r=n;e.edge(r.e).labelRank=n.rank,e.removeNode(t)}})}function jr(e){let t=1/0,n=0,r=1/0,i=0,a=e.graph(),o=a.marginx||0,s=a.marginy||0;function c(e){let a=e.x,o=e.y,s=e.width,c=e.height;t=Math.min(t,a-s/2),n=Math.max(n,a+s/2),r=Math.min(r,o-c/2),i=Math.max(i,o+c/2)}e.nodes().forEach(t=>c(e.node(t))),e.edges().forEach(t=>{let n=e.edge(t);Object.hasOwn(n,`x`)&&c(n)}),t-=o,r-=s,e.nodes().forEach(n=>{let i=e.node(n);i.x-=t,i.y-=r}),e.edges().forEach(n=>{let i=e.edge(n);i.points.forEach(e=>{e.x-=t,e.y-=r}),Object.hasOwn(i,`x`)&&(i.x-=t),Object.hasOwn(i,`y`)&&(i.y-=r)}),a.width=n-t+o,a.height=i-r+s}function Mr(e){e.edges().forEach(t=>{if(t.v===t.w)return;let n=e.edge(t),r=e.node(t.v),i=e.node(t.w),a,o;n.points?(a=n.points[0],o=n.points[n.points.length-1]):(n.points=[],a=i,o=r),n.points.unshift(nt(r,a)),n.points.push(nt(i,o))})}function Nr(e){e.edges().forEach(t=>{let n=e.edge(t);if(Object.hasOwn(n,`x`))switch((n.labelpos===`l`||n.labelpos===`r`)&&(n.width-=n.labeloffset),n.labelpos){case`l`:n.x-=n.width/2+n.labeloffset;break;case`r`:n.x+=n.width/2+n.labeloffset}})}function Pr(e){e.edges().forEach(t=>{let n=e.edge(t);n.reversed&&n.points.reverse()})}function Fr(e){e.nodes().forEach(t=>{if(e.children(t).length){let n=e.node(t),r=e.node(n.borderTop),i=e.node(n.borderBottom),a=e.node(n.borderLeft[n.borderLeft.length-1]),o=e.node(n.borderRight[n.borderRight.length-1]);n.width=Math.abs(o.x-a.x),n.height=Math.abs(i.y-r.y),n.x=a.x+n.width/2,n.y=r.y+n.height/2}}),e.nodes().forEach(t=>{e.node(t).dummy===`border`&&e.removeNode(t)})}function Ir(e){e.edges().forEach(t=>{if(t.v===t.w){let n=e.node(t.v);n.selfEdges||=[],n.selfEdges.push({e:t,label:e.edge(t)}),e.removeEdge(t)}})}function Lr(e){rt(e).forEach(t=>{let n=0;t.forEach((t,r)=>{let i=e.node(t);typeof i.rank!=`number`&&(i.rank=0),i.order=r+n,(i.selfEdges||[]).forEach(t=>{M(e,`selfedge`,{width:t.label.width,height:t.label.height,rank:i.rank,order:r+ ++n,e:t.e,edgeLabel:t.label},`_se`),(!Array.isArray(t.label.points)||t.label.points.length!==7)&&(t.label.points=[{x:0,y:-10},{x:0,y:-10},{x:0,y:0},{x:0,y:10},{x:0,y:10},{x:0,y:0},{x:0,y:0}])}),delete i.selfEdges})})}function Rr(e){e.nodes().forEach(t=>{let n=e.node(t),r=e=>typeof e==`number`&&isFinite(e);if(n.dummy===`selfedge`){let i=n,a=e.node(i.e.v),o=r(a?.x)?a.x:0,s=r(a?.y)?a.y:0,c=r(a?.width)?a.width:0,l=r(a?.height)?a.height:0,u=r(n.x)?n.x:o,d=r(n.y)?n.y:s,f=c/2,p=l/2;i.edgeLabel.points=[{x:u+f,y:d-p},{x:u+f,y:d-p},{x:u,y:d},{x:u-f,y:d+p},{x:u-f,y:d+p},{x:u,y:d},{x:u,y:d}],i.edgeLabel.x=u,i.edgeLabel.y=d,e.setEdge(i.e,i.edgeLabel),e.removeNode(t)}else n&&Array.isArray(n.selfEdges)&&n.selfEdges.forEach(e=>{if(!Array.isArray(e.label.points)||e.label.points.length!==7){let t=r(n.x)?n.x:0,i=r(n.y)?n.y:0,a=r(n.width)?n.width:0,o=r(n.height)?n.height:0,s=a/2,c=o/2;e.label.points=[{x:t+s,y:i-c},{x:t+s,y:i-c},{x:t,y:i},{x:t-s,y:i+c},{x:t-s,y:i+c},{x:t,y:i},{x:t,y:i}]}})})}function zr(e,t){return ht(mt(e,t),Number)}function Br(e){let t={};return e&&Object.entries(e).forEach(([e,n])=>{typeof e==`string`&&(e=e.toLowerCase()),t[e]=n}),t}function Vr(e,t){var n,r=1;e??=0,t??=0;function i(){var i,a=n.length,o,s=0,c=0;for(i=0;i<a;++i)o=n[i],s+=o.x,c+=o.y;for(s=(s/a-e)*r,c=(c/a-t)*r,i=0;i<a;++i)o=n[i],o.x-=s,o.y-=c}return i.initialize=function(e){n=e},i.x=function(t){return arguments.length?(e=+t,i):e},i.y=function(e){return arguments.length?(t=+e,i):t},i.strength=function(e){return arguments.length?(r=+e,i):r},i}function Hr(e){let t=+this._x.call(null,e),n=+this._y.call(null,e);return Ur(this.cover(t,n),t,n,e)}function Ur(e,t,n,r){if(isNaN(t)||isNaN(n))return e;var i,a=e._root,o={data:r},s=e._x0,c=e._y0,l=e._x1,u=e._y1,d,f,p,m,h,g,_,v;if(!a)return e._root=o,e;for(;a.length;)if((h=t>=(d=(s+l)/2))?s=d:l=d,(g=n>=(f=(c+u)/2))?c=f:u=f,i=a,!(a=a[_=g<<1|h]))return i[_]=o,e;if(p=+e._x.call(null,a.data),m=+e._y.call(null,a.data),t===p&&n===m)return o.next=a,i?i[_]=o:e._root=o,e;do i=i?i[_]=[,,,,]:e._root=[,,,,],(h=t>=(d=(s+l)/2))?s=d:l=d,(g=n>=(f=(c+u)/2))?c=f:u=f;while((_=g<<1|h)==(v=(m>=f)<<1|p>=d));return i[v]=a,i[_]=o,e}function Wr(e){var t,n,r=e.length,i,a,o=Array(r),s=Array(r),c=1/0,l=1/0,u=-1/0,d=-1/0;for(n=0;n<r;++n)isNaN(i=+this._x.call(null,t=e[n]))||isNaN(a=+this._y.call(null,t))||(o[n]=i,s[n]=a,i<c&&(c=i),i>u&&(u=i),a<l&&(l=a),a>d&&(d=a));if(c>u||l>d)return this;for(this.cover(c,l).cover(u,d),n=0;n<r;++n)Ur(this,o[n],s[n],e[n]);return this}function Gr(e,t){if(isNaN(e=+e)||isNaN(t=+t))return this;var n=this._x0,r=this._y0,i=this._x1,a=this._y1;if(isNaN(n))i=(n=Math.floor(e))+1,a=(r=Math.floor(t))+1;else{for(var o=i-n||1,s=this._root,c,l;n>e||e>=i||r>t||t>=a;)switch(l=(t<r)<<1|e<n,c=[,,,,],c[l]=s,s=c,o*=2,l){case 0:i=n+o,a=r+o;break;case 1:n=i-o,a=r+o;break;case 2:i=n+o,r=a-o;break;case 3:n=i-o,r=a-o}this._root&&this._root.length&&(this._root=s)}return this._x0=n,this._y0=r,this._x1=i,this._y1=a,this}function Kr(){var e=[];return this.visit(function(t){if(!t.length)do e.push(t.data);while(t=t.next)}),e}function qr(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 L(e,t,n,r,i){this.node=e,this.x0=t,this.y0=n,this.x1=r,this.y1=i}function Jr(e,t,n){var r,i=this._x0,a=this._y0,o,s,c,l,u=this._x1,d=this._y1,f=[],p=this._root,m,h;for(p&&f.push(new L(p,i,a,u,d)),n==null?n=1/0:(i=e-n,a=t-n,u=e+n,d=t+n,n*=n);m=f.pop();)if(!(!(p=m.node)||(o=m.x0)>u||(s=m.y0)>d||(c=m.x1)<i||(l=m.y1)<a)){if(p.length){var g=(o+c)/2,_=(s+l)/2;f.push(new L(p[3],g,_,c,l),new L(p[2],o,_,g,l),new L(p[1],g,s,c,_),new L(p[0],o,s,g,_)),(h=(t>=_)<<1|e>=g)&&(m=f[f.length-1],f[f.length-1]=f[f.length-1-h],f[f.length-1-h]=m)}else{var v=e-+this._x.call(null,p.data),y=t-+this._y.call(null,p.data),b=v*v+y*y;if(b<n){var x=Math.sqrt(n=b);i=e-x,a=t-x,u=e+x,d=t+x,r=p.data}}}return r}function Yr(e){if(isNaN(u=+this._x.call(null,e))||isNaN(d=+this._y.call(null,e)))return this;var t,n=this._root,r,i,a,o=this._x0,s=this._y0,c=this._x1,l=this._y1,u,d,f,p,m,h,g,_;if(!n)return this;if(n.length)for(;;){if((m=u>=(f=(o+c)/2))?o=f:c=f,(h=d>=(p=(s+l)/2))?s=p:l=p,t=n,!(n=n[g=h<<1|m]))return this;if(!n.length)break;(t[g+1&3]||t[g+2&3]||t[g+3&3])&&(r=t,_=g)}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):t?(a?t[g]=a:delete t[g],(n=t[0]||t[1]||t[2]||t[3])&&n===(t[3]||t[2]||t[1]||t[0])&&!n.length&&(r?r[_]=n:this._root=n),this):(this._root=a,this)}function Xr(e){for(var t=0,n=e.length;t<n;++t)this.remove(e[t]);return this}function Zr(){return this._root}function Qr(){var e=0;return this.visit(function(t){if(!t.length)do++e;while(t=t.next)}),e}function $r(e){var t=[],n,r=this._root,i,a,o,s,c;for(r&&t.push(new L(r,this._x0,this._y0,this._x1,this._y1));n=t.pop();)if(!e(r=n.node,a=n.x0,o=n.y0,s=n.x1,c=n.y1)&&r.length){var l=(a+s)/2,u=(o+c)/2;(i=r[3])&&t.push(new L(i,l,u,s,c)),(i=r[2])&&t.push(new L(i,a,u,l,c)),(i=r[1])&&t.push(new L(i,l,o,s,u)),(i=r[0])&&t.push(new L(i,a,o,l,u))}return this}function ei(e){var t=[],n=[],r;for(this._root&&t.push(new L(this._root,this._x0,this._y0,this._x1,this._y1));r=t.pop();){var i=r.node;if(i.length){var a,o=r.x0,s=r.y0,c=r.x1,l=r.y1,u=(o+c)/2,d=(s+l)/2;(a=i[0])&&t.push(new L(a,o,s,u,d)),(a=i[1])&&t.push(new L(a,u,s,c,d)),(a=i[2])&&t.push(new L(a,o,d,u,l)),(a=i[3])&&t.push(new L(a,u,d,c,l))}n.push(r)}for(;r=n.pop();)e(r.node,r.x0,r.y0,r.x1,r.y1);return this}function ti(e){return e[0]}function ni(e){return arguments.length?(this._x=e,this):this._x}function ri(e){return e[1]}function ii(e){return arguments.length?(this._y=e,this):this._y}function ai(e,t,n){var r=new oi(t??ti,n??ri,NaN,NaN,NaN,NaN);return e==null?r:r.addAll(e)}function oi(e,t,n,r,i,a){this._x=e,this._y=t,this._x0=n,this._y0=r,this._x1=i,this._y1=a,this._root=void 0}function si(e){for(var t={data:e.data},n=t;e=e.next;)n=n.next={data:e.data};return t}var R=ai.prototype=oi.prototype;R.copy=function(){var e=new oi(this._x,this._y,this._x0,this._y0,this._x1,this._y1),t=this._root,n,r;if(!t)return e;if(!t.length)return e._root=si(t),e;for(n=[{source:t,target:e._root=[,,,,]}];t=n.pop();)for(var i=0;i<4;++i)(r=t.source[i])&&(r.length?n.push({source:r,target:t.target[i]=[,,,,]}):t.target[i]=si(r));return e},R.add=Hr,R.addAll=Wr,R.cover=Gr,R.data=Kr,R.extent=qr,R.find=Jr,R.remove=Yr,R.removeAll=Xr,R.root=Zr,R.size=Qr,R.visit=$r,R.visitAfter=ei,R.x=ni,R.y=ii;function z(e){return function(){return e}}function B(e){return(e()-.5)*1e-6}function ci(e){return e.x+e.vx}function li(e){return e.y+e.vy}function ui(e){var t,n,r,i=1,a=1;typeof e!=`function`&&(e=z(e==null?1:+e));function o(){for(var e,o=t.length,c,l,u,d,f,p,m=0;m<a;++m)for(c=ai(t,ci,li).visitAfter(s),e=0;e<o;++e)l=t[e],f=n[l.index],p=f*f,u=l.x+l.vx,d=l.y+l.vy,c.visit(h);function h(e,t,n,a,o){var s=e.data,c=e.r,m=f+c;if(s){if(s.index>l.index){var h=u-s.x-s.vx,g=d-s.y-s.vy,_=h*h+g*g;_<m*m&&(h===0&&(h=B(r),_+=h*h),g===0&&(g=B(r),_+=g*g),_=(m-(_=Math.sqrt(_)))/_*i,l.vx+=(h*=_)*(m=(c*=c)/(p+c)),l.vy+=(g*=_)*m,s.vx-=h*(m=1-m),s.vy-=g*m)}}else return t>u+m||a<u-m||n>d+m||o<d-m}}function s(e){if(e.data)return e.r=n[e.data.index];for(var t=e.r=0;t<4;++t)e[t]&&e[t].r>e.r&&(e.r=e[t].r)}function c(){if(t){var r,i=t.length,a;for(n=Array(i),r=0;r<i;++r)a=t[r],n[a.index]=+e(a,r,t)}}return o.initialize=function(e,n){t=e,r=n,c()},o.iterations=function(e){return arguments.length?(a=+e,o):a},o.strength=function(e){return arguments.length?(i=+e,o):i},o.radius=function(t){return arguments.length?(e=typeof t==`function`?t:z(+t),c(),o):e},o}function di(e){return e.index}function fi(e,t){var n=e.get(t);if(!n)throw Error(`node not found: `+t);return n}function pi(e){var t=di,n=d,r,i=z(30),a,o,s,c,l,u=1;e??=[];function d(e){return 1/Math.min(s[e.source.index],s[e.target.index])}function f(t){for(var n=0,i=e.length;n<u;++n)for(var o=0,s,d,f,p,m,h,g;o<i;++o)s=e[o],d=s.source,f=s.target,p=f.x+f.vx-d.x-d.vx||B(l),m=f.y+f.vy-d.y-d.vy||B(l),h=Math.sqrt(p*p+m*m),h=(h-a[o])/h*t*r[o],p*=h,m*=h,f.vx-=p*(g=c[o]),f.vy-=m*g,d.vx+=p*(g=1-g),d.vy+=m*g}function p(){if(o){var n,i=o.length,l=e.length,u=new Map(o.map((e,n)=>[t(e,n,o),e])),d;for(n=0,s=Array(i);n<l;++n)d=e[n],d.index=n,typeof d.source!=`object`&&(d.source=fi(u,d.source)),typeof d.target!=`object`&&(d.target=fi(u,d.target)),s[d.source.index]=(s[d.source.index]||0)+1,s[d.target.index]=(s[d.target.index]||0)+1;for(n=0,c=Array(l);n<l;++n)d=e[n],c[n]=s[d.source.index]/(s[d.source.index]+s[d.target.index]);r=Array(l),m(),a=Array(l),h()}}function m(){if(o)for(var t=0,i=e.length;t<i;++t)r[t]=+n(e[t],t,e)}function h(){if(o)for(var t=0,n=e.length;t<n;++t)a[t]=+i(e[t],t,e)}return f.initialize=function(e,t){o=e,l=t,p()},f.links=function(t){return arguments.length?(e=t,p(),f):e},f.id=function(e){return arguments.length?(t=e,f):t},f.iterations=function(e){return arguments.length?(u=+e,f):u},f.strength=function(e){return arguments.length?(n=typeof e==`function`?e:z(+e),m(),f):n},f.distance=function(e){return arguments.length?(i=typeof e==`function`?e:z(+e),h(),f):i},f}var mi={value:()=>{}};function hi(){for(var e=0,t=arguments.length,n={},r;e<t;++e){if(!(r=arguments[e]+``)||r in n||/[\s.]/.test(r))throw Error(`illegal type: `+r);n[r]=[]}return new gi(n)}function gi(e){this._=e}function _i(e,t){return e.trim().split(/^|\s+/).map(function(e){var n=``,r=e.indexOf(`.`);if(r>=0&&(n=e.slice(r+1),e=e.slice(0,r)),e&&!t.hasOwnProperty(e))throw Error(`unknown type: `+e);return{type:e,name:n}})}gi.prototype=hi.prototype={constructor:gi,on:function(e,t){var n=this._,r=_i(e+``,n),i,a=-1,o=r.length;if(arguments.length<2){for(;++a<o;)if((i=(e=r[a]).type)&&(i=vi(n[i],e.name)))return i}else{if(t!=null&&typeof t!=`function`)throw Error(`invalid callback: `+t);for(;++a<o;)if(i=(e=r[a]).type)n[i]=yi(n[i],e.name,t);else if(t==null)for(i in n)n[i]=yi(n[i],e.name,null);return this}},copy:function(){var e={},t=this._;for(var n in t)e[n]=t[n].slice();return new gi(e)},call:function(e,t){if((i=arguments.length-2)>0)for(var n=Array(i),r=0,i,a;r<i;++r)n[r]=arguments[r+2];if(!this._.hasOwnProperty(e))throw Error(`unknown type: `+e);for(a=this._[e],r=0,i=a.length;r<i;++r)a[r].value.apply(t,n)},apply:function(e,t,n){if(!this._.hasOwnProperty(e))throw Error(`unknown type: `+e);for(var r=this._[e],i=0,a=r.length;i<a;++i)r[i].value.apply(t,n)}};function vi(e,t){for(var n=0,r=e.length,i;n<r;++n)if((i=e[n]).name===t)return i.value}function yi(e,t,n){for(var r=0,i=e.length;r<i;++r)if(e[r].name===t){e[r]=mi,e=e.slice(0,r).concat(e.slice(r+1));break}return n!=null&&e.push({name:t,value:n}),e}var V=0,bi=0,xi=0,Si=1e3,Ci,H,wi=0,U=0,Ti=0,W=typeof performance==`object`&&performance.now?performance:Date,Ei=typeof window==`object`&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(e){setTimeout(e,17)};function Di(){return U||=(Ei(Oi),W.now()+Ti)}function Oi(){U=0}function ki(){this._call=this._time=this._next=null}ki.prototype=Ai.prototype={constructor:ki,restart:function(e,t,n){if(typeof e!=`function`)throw TypeError(`callback is not a function`);n=(n==null?Di():+n)+(t==null?0:+t),!this._next&&H!==this&&(H?H._next=this:Ci=this,H=this),this._call=e,this._time=n,Fi()},stop:function(){this._call&&(this._call=null,this._time=1/0,Fi())}};function Ai(e,t,n){var r=new ki;return r.restart(e,t,n),r}function ji(){Di(),++V;for(var e=Ci,t;e;)(t=U-e._time)>=0&&e._call.call(void 0,t),e=e._next;--V}function Mi(){U=(wi=W.now())+Ti,V=bi=0;try{ji()}finally{V=0,Pi(),U=0}}function Ni(){var e=W.now(),t=e-wi;t>Si&&(Ti-=t,wi=e)}function Pi(){for(var e,t=Ci,n,r=1/0;t;)t._call?(r>t._time&&(r=t._time),e=t,t=t._next):(n=t._next,t._next=null,t=e?e._next=n:Ci=n);H=e,Fi(r)}function Fi(e){V||(bi&&=clearTimeout(bi),e-U>24?(e<1/0&&(bi=setTimeout(Mi,e-W.now()-Ti)),xi&&=clearInterval(xi)):(xi||=(wi=W.now(),setInterval(Ni,Si)),V=1,Ei(Mi)))}var Ii=1664525,Li=1013904223,Ri=4294967296;function zi(){let e=1;return()=>(e=(Ii*e+Li)%Ri)/Ri}function Bi(e){return e.x}function Vi(e){return e.y}var Hi=10,Ui=Math.PI*(3-Math.sqrt(5));function Wi(e){var t,n=1,r=.001,i=1-r**(1/300),a=0,o=.6,s=/* @__PURE__ */ new Map,c=Ai(d),l=hi(`tick`,`end`),u=zi();e??=[];function d(){f(),l.call(`tick`,t),n<r&&(c.stop(),l.call(`end`,t))}function f(r){var c,l=e.length,u;r===void 0&&(r=1);for(var d=0;d<r;++d)for(n+=(a-n)*i,s.forEach(function(e){e(n)}),c=0;c<l;++c)u=e[c],u.fx==null?u.x+=u.vx*=o:(u.x=u.fx,u.vx=0),u.fy==null?u.y+=u.vy*=o:(u.y=u.fy,u.vy=0);return t}function p(){for(var t=0,n=e.length,r;t<n;++t){if(r=e[t],r.index=t,r.fx!=null&&(r.x=r.fx),r.fy!=null&&(r.y=r.fy),isNaN(r.x)||isNaN(r.y)){var i=Hi*Math.sqrt(.5+t),a=t*Ui;r.x=i*Math.cos(a),r.y=i*Math.sin(a)}(isNaN(r.vx)||isNaN(r.vy))&&(r.vx=r.vy=0)}}function m(t){return t.initialize&&t.initialize(e,u),t}return p(),t={tick:f,restart:function(){return c.restart(d),t},stop:function(){return c.stop(),t},nodes:function(n){return arguments.length?(e=n,p(),s.forEach(m),t):e},alpha:function(e){return arguments.length?(n=+e,t):n},alphaMin:function(e){return arguments.length?(r=+e,t):r},alphaDecay:function(e){return arguments.length?(i=+e,t):+i},alphaTarget:function(e){return arguments.length?(a=+e,t):a},velocityDecay:function(e){return arguments.length?(o=1-e,t):1-o},randomSource:function(e){return arguments.length?(u=e,s.forEach(m),t):u},force:function(e,n){return arguments.length>1?(n==null?s.delete(e):s.set(e,m(n)),t):s.get(e)},find:function(t,n,r){var i=0,a=e.length,o,s,c,l,u;for(r==null?r=1/0:r*=r,i=0;i<a;++i)l=e[i],o=t-l.x,s=n-l.y,c=o*o+s*s,c<r&&(u=l,r=c);return u},on:function(e,n){return arguments.length>1?(l.on(e,n),t):l.on(e)}}}function Gi(){var e,t,n,r,i=z(-30),a,o=1,s=1/0,c=.81;function l(n){var i,a=e.length,o=ai(e,Bi,Vi).visitAfter(d);for(r=n,i=0;i<a;++i)t=e[i],o.visit(f)}function u(){if(e){var t,n=e.length,r;for(a=Array(n),t=0;t<n;++t)r=e[t],a[r.index]=+i(r,t,e)}}function d(e){var t=0,n,r,i=0,o,s,c;if(e.length){for(o=s=c=0;c<4;++c)(n=e[c])&&(r=Math.abs(n.value))&&(t+=n.value,i+=r,o+=r*n.x,s+=r*n.y);e.x=o/i,e.y=s/i}else{n=e,n.x=n.data.x,n.y=n.data.y;do t+=a[n.data.index];while(n=n.next)}e.value=t}function f(e,i,l,u){if(!e.value)return!0;var d=e.x-t.x,f=e.y-t.y,p=u-i,m=d*d+f*f;if(p*p/c<m)return m<s&&(d===0&&(d=B(n),m+=d*d),f===0&&(f=B(n),m+=f*f),m<o&&(m=Math.sqrt(o*m)),t.vx+=d*e.value*r/m,t.vy+=f*e.value*r/m),!0;if(!(e.length||m>=s)){(e.data!==t||e.next)&&(d===0&&(d=B(n),m+=d*d),f===0&&(f=B(n),m+=f*f),m<o&&(m=Math.sqrt(o*m)));do e.data!==t&&(p=a[e.data.index]*r/m,t.vx+=d*p,t.vy+=f*p);while(e=e.next)}}return l.initialize=function(t,r){e=t,n=r,u()},l.strength=function(e){return arguments.length?(i=typeof e==`function`?e:z(+e),u(),l):i},l.distanceMin=function(e){return arguments.length?(o=e*e,l):Math.sqrt(o)},l.distanceMax=function(e){return arguments.length?(s=e*e,l):Math.sqrt(s)},l.theta=function(e){return arguments.length?(c=e*e,l):Math.sqrt(c)},l}function Ki(e){var t=z(.1),n,r,i;typeof e!=`function`&&(e=z(e==null?0:+e));function a(e){for(var t=0,a=n.length,o;t<a;++t)o=n[t],o.vx+=(i[t]-o.x)*r[t]*e}function o(){if(n){var a,o=n.length;for(r=Array(o),i=Array(o),a=0;a<o;++a)r[a]=isNaN(i[a]=+e(n[a],a,n))?0:+t(n[a],a,n)}}return a.initialize=function(e){n=e,o()},a.strength=function(e){return arguments.length?(t=typeof e==`function`?e:z(+e),o(),a):t},a.x=function(t){return arguments.length?(e=typeof t==`function`?t:z(+t),o(),a):e},a}function qi(e){var t=z(.1),n,r,i;typeof e!=`function`&&(e=z(e==null?0:+e));function a(e){for(var t=0,a=n.length,o;t<a;++t)o=n[t],o.vy+=(i[t]-o.y)*r[t]*e}function o(){if(n){var a,o=n.length;for(r=Array(o),i=Array(o),a=0;a<o;++a)r[a]=isNaN(i[a]=+e(n[a],a,n))?0:+t(n[a],a,n)}}return a.initialize=function(e){n=e,o()},a.strength=function(e){return arguments.length?(t=typeof e==`function`?e:z(+e),o(),a):t},a.y=function(t){return arguments.length?(e=typeof t==`function`?t:z(+t),o(),a):e},a}var Ji=32,Yi=72,Xi=16,Zi=170,Qi=-900,$i=300,ea=120,ta=200,na=96,ra=1.3;function ia(e,t){let n=new ge.Graph({multigraph:!0});n.setGraph({rankdir:t,nodesep:Ji,ranksep:Yi,edgesep:Xi}),n.setDefaultEdgeLabel(()=>({}));for(let t of e.nodes)n.setNode(t.id,{width:t.width,height:t.height});e.edges.forEach((e,t)=>n.setEdge(e.from,e.to,{},`e${t}`)),pr(n);let r={};for(let t of e.nodes){let{x:e=0,y:i=0}=n.node(t.id);r[t.id]={x:e,y:i}}return{positions:r,routes:e.edges.map((e,t)=>(n.edge(e.from,e.to,`e${t}`).points??[]).map(({x:e,y:t})=>({x:e,y:t})))}}function aa(e){let{previous:t}=e,n=new Map(e.nodes.map(e=>[e.id,[]]));for(let t of e.edges)n.get(t.from)?.push(t.to),n.get(t.to)?.push(t.from);let r=e.nodes.map((e,r)=>{let i=t?.[e.id];if(i)return{id:e.id,x:i.x,y:i.y,fx:i.x,fy:i.y};let a=t&&n.get(e.id)?.find(e=>t[e]);if(a){let n=r*2.4;return{id:e.id,x:t[a].x+ea*Math.cos(n),y:t[a].y+ea*Math.sin(n)}}return{id:e.id}}),i=Math.max(0,...e.nodes.map(e=>Math.hypot(e.width,e.height)/2)),a=e.edges.map(e=>({source:e.from,target:e.to})),o=Wi(r).force(`link`,pi(a).id(e=>e.id).distance(Zi)).force(`charge`,Gi().strength(Qi)).force(`collide`,ui(i+Xi)).force(`x`,Ki(0).strength(.02)).force(`y`,qi(0).strength(.02)).stop();t||o.force(`center`,Vr(0,0)),o.tick($i);let s={};for(let e of r)s[e.id]={x:e.x??0,y:e.y??0};return{positions:s}}function oa(e){let t=e.nodes.map(e=>e.id),n=e.centre&&t.includes(e.centre)?e.centre:t[0],r={};if(!n)return{positions:r};let i=new Map(t.map(e=>[e,[]]));for(let t of e.edges)i.get(t.from)?.push(t.to),i.get(t.to)?.push(t.from);let a=/* @__PURE__ */ new Map([[n,0]]),o=/* @__PURE__ */ new Map,s=[n];for(let e=0;e<s.length;e++){let t=s[e];for(let e of i.get(t)??[])a.has(e)||(a.set(e,a.get(t)+1),o.set(e,t),s.push(e))}for(let e of t)a.has(e)||(a.set(e,1),o.set(e,n),s.push(e));let c=[];for(let e of s)(c[a.get(e)]??=[]).push(e);let l=/* @__PURE__ */ new Map([[n,0]]);r[n]={x:0,y:0};let u=0;for(let e=1;e<c.length;e++){let t=c[e]??[],n=t.length;if(n){if(u=Math.max(u+ta,n*na/Math.PI),e===1)t.forEach((e,t)=>l.set(e,-Math.PI/2+t*2*Math.PI/n));else{let e=/* @__PURE__ */ new Map;for(let n of t){let t=o.get(n);e.set(t,[...e.get(t)??[],n])}let r=[...e.keys()].sort((e,t)=>l.get(e)-l.get(t)),i=r.flatMap(t=>e.get(t)),a=Math.min(2*Math.PI/n,ta*1.2/u),s=e.get(r[0]).length,c=l.get(r[0])-(s-1)/2*a;i.forEach((e,t)=>l.set(e,c+t*a))}for(let e of t){let t=l.get(e);r[e]={x:u*ra*Math.cos(t),y:u*Math.sin(t)}}}}return{positions:r}}function sa(e){switch(e.kind){case`layered-right`:return ia(e,`LR`);case`layered-down`:return ia(e,`TB`);case`radial`:return oa(e);default:return aa(e)}}function ca(e,t){return`groep:${e}:${t}`}var la=(e,t)=>`${e}\u0000${t}`;function ua(e,t){let n=/* @__PURE__ */ new Map;return t.filter(t=>t.from!==t.to&&e.has(t.from)&&e.has(t.to)).map(e=>{let t=la(e.from,e.to),r=n.get(t)??0;return n.set(t,r+1),{key:`${t}\u0000${r}`,from:e.from,to:e.to,label:e.label??``,direction:e.direction??`to`,value:e.value,unit:e.unit}})}function da(e,t){let n=new Map(e.map(e=>[e.id,/* @__PURE__ */ new Set]));for(let e of t)n.get(e.from)?.add(e.to),n.get(e.to)?.add(e.from);return n}function fa(e,t,n,r){let i=/* @__PURE__ */ new Map;for(let e of t)i.set(e.from,(i.get(e.from)??0)+1),i.set(e.to,(i.get(e.to)??0)+1);let a=new Map(e.map(e=>[e.id,e])),o=/* @__PURE__ */ new Map;for(let e of t){let t=i.get(e.from)??0,n=i.get(e.to)??0;t===1&&n!==1?o.set(e.from,{parent:e.to,edge:e}):n===1&&t!==1&&o.set(e.to,{parent:e.from,edge:e})}let s=/* @__PURE__ */ new Map;for(let t of e){let e=o.get(t.id);if(!e||t.more)continue;let n=ca(e.parent,t.type);s.set(n,[...s.get(n)??[],t.id])}let c=/* @__PURE__ */ new Set,l=[],u=[];for(let[e,t]of s){if(t.length<=5||n.has(e))continue;let{parent:i,edge:s}=o.get(t[0]),d=a.get(t[0]);for(let e of t)c.add(e);l.push({id:e,label:xa(r,d.type),type:d.type,group:{parent:i,members:t}});let f=s.from===i;u.push({...s,key:la(f?i:e,f?e:i),from:f?i:e,to:f?e:i,value:void 0})}return{nodes:[...e.filter(e=>!c.has(e.id)),...l],edges:[...t.filter(e=>!c.has(e.from)&&!c.has(e.to)),...u]}}function pa(e,t){let n=null,r=-1;for(let i of e){let e=t.get(i.id)?.size??0;e>r&&(n=i.id,r=e)}return n}function ma(e,t,n){let r=/* @__PURE__ */ new Set([t]);n&&r.add(n);let i=[t];for(let t=0;t<i.length;t++)for(let n of e.get(i[t])??[])r.has(n)||(r.add(n),i.push(n));return n&&r.delete(n),r}function ha(e,t,n){let r=/* @__PURE__ */ new Map;if(!n||!t.has(n))return r;let i=ma(t,n);for(let a of e){if(!i.has(a.id))continue;let e=a.id===n?/* @__PURE__ */ new Set([n]):ma(t,n,a.id),o=[...i].filter(t=>t!==a.id&&!e.has(t));o.length&&r.set(a.id,o)}return r}function ga(e,t={}){let n=/* @__PURE__ */ new Map;for(let t of e.nodes)n.has(t.id)||n.set(t.id,t);let r=new Map([...n.values()].map(e=>[e.id,e.label])),i=ua(n,e.edges),{nodes:a,edges:o}=fa([...n.values()],i,new Set(t.opened??[]),e.types),s=da(a,o),c=(t.centre&&s.has(t.centre)?t.centre:null)??pa(a,s),l=ha(a,s,c),u=ya({nodes:a,edges:o,neighbours:s,centre:c}),d=/* @__PURE__ */ new Set;for(let e of t.collapsed??[])for(let t of l.get(e)??[])d.add(t);let f=a.filter(e=>!d.has(e.id)),p=o.filter(e=>!d.has(e.from)&&!d.has(e.to));return{nodes:f,edges:p,byId:new Map(a.map(e=>[e.id,e])),neighbours:da(f,p),centre:c,behind:l,folded:d,names:r,layout:u}}function _a(e,t){let n=new Map(e.map(e=>[e.id,[]]));for(let e of t)n.get(e.from)?.push(e.to);let r=/* @__PURE__ */ new Map,i=e=>{r.set(e,1);for(let t of n.get(e)??[]){let e=r.get(t);if(e===1||e===void 0&&i(t))return!0}return r.set(e,2),!1};return e.some(e=>!r.has(e.id)&&i(e.id))}function va(e,t){let n=new Map(e.map(e=>[e.id,[]]));for(let e of t)n.get(e.from)?.push(e.to);let r=/* @__PURE__ */ new Map,i=e=>{let t=r.get(e);if(t!==void 0)return t;r.set(e,0);let a=Math.max(0,...(n.get(e)??[]).map(e=>i(e)+1));return r.set(e,a),a};return Math.max(0,...e.map(e=>i(e.id)))}function ya(e){let{nodes:t,edges:n}=e;if(t.length>100||n.some(e=>e.direction===`both`)||_a(t,n))return`force`;if(n.every(e=>e.direction===`to`)&&va(t,n)>=3)return`layered-right`;let r=e.centre?e.neighbours.get(e.centre)?.size??0:0;return t.length>2&&r>=.6*(t.length-1)?`radial`:`layered-down`}function ba(e,t){return e.find(e=>e.key===t)??{key:t,label:t,icon:``}}function xa(e,t){let n=ba(e,t),r=n.plural??n.label;return r.charAt(0).toUpperCase()+r.slice(1)}function Sa(e,t,n){let r=t.from===n?t.to:t.from,i=e.byId.get(r)?.label??r;return t.direction===`none`?`${t.label||`verbonden met`} ${i}`:t.direction===`both`?`${t.label||`verbonden met`} ↔ ${i}`:t.from===n?`${t.label||`verbonden met`} → ${i}`:`${i} → ${t.label||`verbonden met`}`}function Ca(e,t,n=4){let r=e.edges.filter(e=>e.from===t||e.to===t).map(n=>Sa(e,n,t));return r.length>n?[...r.slice(0,n),`nog ${r.length-n}`]:r}var wa=class{#e=void 0;#t=0;#n=/* @__PURE__ */ new Map;run(e){return e.nodes.length<=100?sa(e):new Promise(t=>{let n=this.worker();if(!n){requestAnimationFrame(()=>t(sa(e)));return}let r=++this.#t;this.#n.set(r,{request:e,settle:t}),n.postMessage({id:r,request:e},[])})}destroy(){this.#e?.terminate(),this.#e=void 0,this.#n.clear()}worker(){if(this.#e!==void 0)return this.#e;try{let e=new Worker(new URL(
|
|
1
|
+
import{$ as e,M as t,N as n,R as r,W as i,X as a,Z as o,bt as s,cn as c,d as l,dn as u,et as d,f,g as p,jt as m,k as h,l as g,mn as _,n as v,o as y,on as b,pn as x,rn as ee,t as S,u as C,v as w,xt as T,z as te}from"../chunks/base-DpZg_-sV.js";import{n as E,t as ne}from"../chunks/avatar-BGJgBB9r.js";import{t as re}from"./announcement.js";import{a as ie,r as D,t as O}from"../chunks/download-Bm3q8daQ.js";import{u as ae}from"../chunks/axes-DfDMsu3s.js";import{r as oe,t as se}from"../chunks/chart-styles-BIR87i7H.js";import{i as ce,n as le,r as ue,t as de}from"../chunks/wheel-Co2Dpj0Q.js";var fe=`.lintje-graph{--lintje-graph-control:var(--h-button-chrome);--lintje-graph-line:1px;gap:var(--space-3);flex-direction:column;min-width:0;display:flex}.lintje-graph.is-phone{--lintje-graph-control:var(--h-touch)}.lintje-graph .lintje-legend__button{min-height:24px}.lintje-graph--expanded{height:var(--chart-h-main)}.lintje-graph--expanded .lintje-graph__area{flex:1;min-height:0}.lintje-graph__area{background:var(--color-bg-surface);border:1px solid var(--color-border-default);cursor:grab;touch-action:pan-x pan-y;user-select:none;position:relative;overflow:hidden}.lintje-graph__lines{pointer-events:none;position:absolute;inset:0}.lintje-graph__line{fill:none;stroke:var(--color-chart-zero)}.lintje-graph__arrow{fill:var(--color-chart-zero)}.lintje-graph__hit{fill:none;stroke:#0000;stroke-width:12px;pointer-events:stroke;cursor:default}.lintje-graph__edge.is-lit .lintje-graph__line{stroke:var(--color-text-secondary)}.lintje-graph__edge.is-lit .lintje-graph__arrow{fill:var(--color-text-secondary)}.lintje-graph__word{font:var(--text-axis);fill:var(--color-text-secondary);text-anchor:middle;dominant-baseline:central;paint-order:stroke;stroke:var(--color-bg-surface);stroke-width:4px;stroke-linejoin:round}.lintje-graph__word.is-lit{fill:var(--color-text-primary)}.lintje-graph__nodes{pointer-events:none;font:var(--text-small);position:absolute;inset:0}.lintje-graph__node,.lintje-graph__counter{pointer-events:auto;position:absolute;top:0;left:0}.lintje-graph__node,.lintje-graph__counter,.lintje-graph__edge,.lintje-graph__word{animation:lintje-fade-in var(--dur-graph) var(--ease-fade)}.lintje-graph__node.is-late,.lintje-graph__counter.is-late,.lintje-graph__edge.is-late,.lintje-graph__word.is-late{animation-delay:var(--dur-graph);animation-fill-mode:backwards}.lintje-graph__edge,.lintje-graph__glyph{transition:opacity var(--dur-hover) var(--ease-fade)}.lintje-graph__edge.is-dim,.lintje-graph__node.is-dim .lintje-graph__glyph{opacity:.45}.lintje-graph__node.is-dim{color:var(--color-text-secondary)}.lintje-graph__node.is-leaving,.lintje-graph__edge.is-leaving{pointer-events:none;animation:lintje-graph-fade-out var(--dur-graph) var(--ease-fade) forwards}.lintje-graph__edge.is-leaving .lintje-graph__hit{pointer-events:none}@keyframes lintje-graph-fade-out{to{opacity:0}}.lintje-graph__card{box-sizing:border-box;width:var(--lintje-graph-w);height:var(--lintje-graph-h);padding:0 calc(12em / 14 + var(--lintje-graph-room,0em)) 0 calc(12em / 14);font-size:calc(var(--lintje-graph-k,1) * 1em);text-align:left;color:var(--color-text-primary);background:var(--color-bg-surface);border:var(--lintje-graph-line) solid var(--color-border-default);cursor:pointer;align-items:center;gap:.571429em;line-height:1.28571;display:flex}.lintje-graph__card:hover,.lintje-graph__card.is-hover{background:var(--color-bg-subtle)}.lintje-graph__card.is-selected{padding:0 calc(12em / 14 - var(--lintje-graph-line) + var(--lintje-graph-room,0em)) 0 calc(12em / 14 - var(--lintje-graph-line));background:var(--color-bg-subtle);border:calc(2 * var(--lintje-graph-line)) solid var(--color-selected-edge)}.lintje-graph__card--group{box-shadow:var(--shadow-stack)}.lintje-graph__glyph{color:var(--lintje-graph-type,var(--color-text-primary));flex:none;display:flex}.lintje-graph__card .lintje-graph__icon{width:1.42857em;height:1.42857em}.lintje-graph__card .lintje-graph__avatar{width:1.71429em;height:1.71429em;font-size:.857143em}.lintje-graph__text{flex-direction:column;min-width:0;display:flex}.lintje-graph__card .lintje-graph__name{-webkit-line-clamp:2;overflow-wrap:anywhere;-webkit-box-orient:vertical;font-weight:700;display:-webkit-box;overflow:hidden}.lintje-graph__status{font:inherit;gap:.428571em}.lintje-graph__sub{-webkit-line-clamp:2;color:var(--color-text-secondary);-webkit-box-orient:vertical;margin-top:.142857em;display:-webkit-box;overflow:hidden}.lintje-graph__mark{align-items:center;gap:var(--space-2);height:28px;color:var(--color-text-primary);cursor:pointer;display:flex}.lintje-graph__mark .lintje-graph__glyph{box-sizing:border-box;border-radius:var(--radius-round);border:1px solid var(--color-chart-zero);background:color-mix(in srgb, var(--lintje-graph-type,var(--color-bg-surface)) var(--tint-graph-mark), var(--color-bg-surface));justify-content:center;align-items:center;width:28px;height:28px}.lintje-graph__mark.is-hover .lintje-graph__glyph{border-color:var(--color-text-secondary)}.lintje-graph__mark.is-selected .lintje-graph__glyph{border:2px solid var(--color-selected-edge)}.lintje-graph__mark .lintje-graph__name{padding:0 var(--space-1);white-space:nowrap;paint-order:stroke fill;-webkit-text-stroke:4px var(--color-bg-surface);font-weight:400}.lintje-graph__mark.is-selected .lintje-graph__name{font-weight:700}.lintje-graph__mark--counted .lintje-graph__name{margin-left:var(--space-4)}.lintje-graph__counter{box-sizing:border-box;min-width:24px;height:24px;padding:0 var(--space-1);background:var(--color-bg-subtle);border:1px solid var(--color-border-default);color:var(--color-text-primary);font:var(--text-axis);white-space:nowrap;cursor:pointer;border-radius:12px;justify-content:center;align-items:center;font-weight:700;display:inline-flex}.lintje-graph__counter:hover{background:var(--color-border-default)}.lintje-graph__counter.is-open{width:24px;padding:0}.lintje-graph__counter.is-quiet:not(:focus-visible){visibility:hidden}.lintje-graph__counter--small{padding:0 var(--space-2);background:0 0;border-color:#0000}.lintje-graph__counter--small:before{content:"";z-index:-1;background:var(--color-bg-subtle);border:1px solid var(--color-border-default);border-radius:10px;position:absolute;inset:2px}.lintje-graph__counter--small:hover{background:0 0}.lintje-graph__counter--small:hover:before{background:var(--color-border-default)}.lintje-graph__tip{pointer-events:none;width:max-content}.lintje-graph__tip-title{margin:0;font-weight:700}.lintje-graph__tip-note{color:var(--color-text-secondary);margin:0}.lintje-graph__tip-list{margin:var(--space-1) 0 0;padding-left:var(--space-4);list-style:outside}.lintje-graph__zoom{z-index:2;top:var(--space-2);right:var(--space-2);flex-direction:column;display:flex;position:absolute}.lintje-graph__zoom-tip{margin-top:calc(var(--lintje-graph-line) * -1);display:flex}.lintje-graph__zoom-tip:first-child{margin-top:0}.lintje-graph__zoom-button{width:var(--lintje-graph-control);height:var(--lintje-graph-control);background:var(--color-bg-surface);color:var(--color-text-primary);border:var(--lintje-graph-line) solid var(--color-border-strong);cursor:pointer;justify-content:center;align-items:center;display:flex;position:relative}.lintje-graph__zoom-button:after{content:"";inset:0 min(0px, calc((100% - var(--h-target)) / 2));position:absolute}.lintje-graph__zoom-button:hover{background:var(--color-bg-subtle)}.lintje-graph__hint{z-index:2;left:50%;bottom:var(--space-2);max-width:calc(100% - 2 * var(--space-4));width:max-content;padding:var(--space-2) var(--space-3);font:var(--text-small);background:var(--color-bg-surface);color:var(--color-text-primary);border:1px solid var(--color-border-strong);text-align:center;margin:0;position:absolute;transform:translate(-50%)}.lintje-graph__overview{z-index:2;right:var(--space-2);bottom:var(--space-2);box-sizing:border-box;background:var(--color-bg-surface);border:1px solid var(--color-border-default);cursor:pointer;position:absolute;overflow:hidden}.lintje-graph__overview-dot{border-radius:var(--radius-round);background:var(--color-chart-zero);width:4px;height:4px;position:absolute;translate:-50% -50%}.lintje-graph__overview-view{box-sizing:border-box;border:1px solid var(--color-accent-line);position:absolute}.lintje-graph__busy{z-index:2;justify-content:center;align-items:center;display:flex;position:absolute;inset:0}@media print{.lintje-graph__zoom,.lintje-graph__overview,.lintje-graph__hint{display:none}}@media (forced-colors:active){.lintje-graph__card,.lintje-graph__mark .lintje-graph__glyph,.lintje-graph__counter,.lintje-graph__counter--small:before{border-color:canvastext}.lintje-graph__card.is-selected,.lintje-graph__mark.is-selected .lintje-graph__glyph{border-color:highlight}.lintje-graph__line{stroke:canvastext}.lintje-graph__arrow{fill:canvastext}}`,k=Object.defineProperty,pe=(e,t,n)=>t in e?k(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,me=(e,t)=>{for(var n in t)k(e,n,{get:t[n],enumerable:!0})},he=(e,t,n)=>pe(e,typeof t==`symbol`?t:t+``,n),ge={};me(ge,{Graph:()=>j,alg:()=>Oe});var _e=Object.defineProperty,ve=(e,t)=>{for(var n in t)_e(e,n,{get:t[n],enumerable:!0})},ye=class{constructor(e){this._isDirected=!0,this._isMultigraph=!1,this._isCompound=!1,this._nodes={},this._in={},this._preds={},this._out={},this._sucs={},this._edgeObjs={},this._edgeLabels={},this._nodeCount=0,this._edgeCount=0,this._defaultNodeLabelFn=()=>{},this._defaultEdgeLabelFn=()=>{},e&&(this._isDirected=`directed`in e?e.directed:!0,this._isMultigraph=`multigraph`in e&&e.multigraph,this._isCompound=`compound`in e&&e.compound),this._isCompound&&(this._parent={},this._children={},this._children[`\0`]={})}isDirected(){return this._isDirected}isMultigraph(){return this._isMultigraph}isCompound(){return this._isCompound}setGraph(e){return this._label=e,this}graph(){return this._label}setDefaultNodeLabel(e){return this._defaultNodeLabelFn=typeof e==`function`?e:()=>e,this}nodeCount(){return this._nodeCount}nodes(){return Object.keys(this._nodes)}sources(){return this.nodes().filter(e=>Object.keys(this._in[e]).length===0)}sinks(){return this.nodes().filter(e=>Object.keys(this._out[e]).length===0)}setNodes(e,t){return e.forEach(e=>{t===void 0?this.setNode(e):this.setNode(e,t)}),this}setNode(e,t){return e in this._nodes?(arguments.length>1&&(this._nodes[e]=t),this):(this._nodes[e]=arguments.length>1?t:this._defaultNodeLabelFn(e),this._isCompound&&(this._parent[e]=`\0`,this._children[e]={},this._children[`\0`][e]=!0),this._in[e]={},this._preds[e]={},this._out[e]={},this._sucs[e]={},++this._nodeCount,this)}node(e){return this._nodes[e]}hasNode(e){return e in this._nodes}removeNode(e){if(e in this._nodes){let t=e=>this.removeEdge(this._edgeObjs[e]);delete this._nodes[e],this._isCompound&&(this._removeFromParentsChildList(e),delete this._parent[e],this.children(e).forEach(e=>{this.setParent(e)}),delete this._children[e]),Object.keys(this._in[e]).forEach(t),delete this._in[e],delete this._preds[e],Object.keys(this._out[e]).forEach(t),delete this._out[e],delete this._sucs[e],--this._nodeCount}return this}setParent(e,t){if(!this._isCompound)throw Error(`Cannot set parent in a non-compound graph`);if(t===void 0)t=`\0`;else{t+=``;for(let n=t;n!==void 0;n=this.parent(n))if(n===e)throw Error(`Setting `+t+` as parent of `+e+` would create a cycle`);this.setNode(t)}return this.setNode(e),this._removeFromParentsChildList(e),this._parent[e]=t,this._children[t][e]=!0,this}parent(e){if(this._isCompound){let t=this._parent[e];if(t!==`\0`)return t}}children(e=`\0`){if(this._isCompound){let t=this._children[e];if(t)return Object.keys(t)}else{if(e===`\0`)return this.nodes();if(this.hasNode(e))return[]}return[]}predecessors(e){let t=this._preds[e];if(t)return Object.keys(t)}successors(e){let t=this._sucs[e];if(t)return Object.keys(t)}neighbors(e){let t=this.predecessors(e);if(t){let n=new Set(t),r=this.successors(e);if(r)for(let e of r)n.add(e);return Array.from(n.values())}}isLeaf(e){let t;return t=this.isDirected()?this.successors(e):this.neighbors(e),(t?.length??0)===0}filterNodes(e){let t=new this.constructor({directed:this._isDirected,multigraph:this._isMultigraph,compound:this._isCompound});t.setGraph(this.graph()),Object.entries(this._nodes).forEach(([n,r])=>{e(n)&&t.setNode(n,r)}),Object.values(this._edgeObjs).forEach(e=>{t.hasNode(e.v)&&t.hasNode(e.w)&&t.setEdge(e,this.edge(e))});let n={},r=e=>{let i=this.parent(e);return!i||t.hasNode(i)?(n[e]=i,i):i in n?n[i]:r(i)};return this._isCompound&&t.nodes().forEach(e=>t.setParent(e,r(e))),t}setDefaultEdgeLabel(e){return this._defaultEdgeLabelFn=typeof e==`function`?e:()=>e,this}edgeCount(){return this._edgeCount}edges(){return Object.values(this._edgeObjs)}setPath(e,t){return e.reduce((e,n)=>(t===void 0?this.setEdge(e,n):this.setEdge(e,n,t),n)),this}setEdge(e,t,n,r){let i,a,o,s,c=!1;typeof e==`object`&&e&&`v`in e?(i=e.v,a=e.w,o=e.name,arguments.length===2&&(s=t,c=!0)):(i=e,a=t,o=r,arguments.length>2&&(s=n,c=!0)),i=``+i,a=``+a,o!==void 0&&(o=``+o);let l=A(this._isDirected,i,a,o);if(l in this._edgeLabels)return c&&(this._edgeLabels[l]=s),this;if(o!==void 0&&!this._isMultigraph)throw Error(`Cannot set a named edge when isMultigraph = false`);this.setNode(i),this.setNode(a),this._edgeLabels[l]=c?s:this._defaultEdgeLabelFn(i,a,o);let u=Se(this._isDirected,i,a,o);return i=u.v,a=u.w,Object.freeze(u),this._edgeObjs[l]=u,be(this._preds[a],i),be(this._sucs[i],a),this._in[a][l]=u,this._out[i][l]=u,this._edgeCount++,this}edge(e,t,n){let r=arguments.length===1?Ce(this._isDirected,e):A(this._isDirected,e,t,n);return this._edgeLabels[r]}edgeAsObj(e,t,n){let r=arguments.length===1?this.edge(e):this.edge(e,t,n);return typeof r!=`object`||!r?{label:r}:r}hasEdge(e,t,n){return(arguments.length===1?Ce(this._isDirected,e):A(this._isDirected,e,t,n))in this._edgeLabels}removeEdge(e,t,n){let r=arguments.length===1?Ce(this._isDirected,e):A(this._isDirected,e,t,n),i=this._edgeObjs[r];if(i){let e=i.v,t=i.w;delete this._edgeLabels[r],delete this._edgeObjs[r],xe(this._preds[t],e),xe(this._sucs[e],t),delete this._in[t][r],delete this._out[e][r],this._edgeCount--}return this}inEdges(e,t){return this.isDirected()?this.filterEdges(this._in[e],e,t):this.nodeEdges(e,t)}outEdges(e,t){return this.isDirected()?this.filterEdges(this._out[e],e,t):this.nodeEdges(e,t)}nodeEdges(e,t){if(e in this._nodes)return this.filterEdges({...this._in[e],...this._out[e]},e,t)}_removeFromParentsChildList(e){delete this._children[this._parent[e]][e]}filterEdges(e,t,n){if(!e)return;let r=Object.values(e);return n?r.filter(e=>e.v===t&&e.w===n||e.v===n&&e.w===t):r}};function be(e,t){e[t]?e[t]++:e[t]=1}function xe(e,t){e[t]!==void 0&&!--e[t]&&delete e[t]}function A(e,t,n,r){let i=``+t,a=``+n;if(!e&&i>a){let e=i;i=a,a=e}return i+``+a+``+(r===void 0?`\0`:r)}function Se(e,t,n,r){let i=``+t,a=``+n;if(!e&&i>a){let e=i;i=a,a=e}let o={v:i,w:a};return r&&(o.name=r),o}function Ce(e,t){return A(e,t.v,t.w,t.name)}ve({},{read:()=>De,write:()=>we});function we(e){let t={options:{directed:e.isDirected(),multigraph:e.isMultigraph(),compound:e.isCompound()},nodes:Te(e),edges:Ee(e)},n=e.graph();return n!==void 0&&(t.value=structuredClone(n)),t}function Te(e){return e.nodes().map(t=>{let n=e.node(t),r=e.parent(t),i={v:t};return n!==void 0&&(i.value=n),r!==void 0&&(i.parent=r),i})}function Ee(e){return e.edges().map(t=>{let n=e.edge(t),r={v:t.v,w:t.w};return t.name!==void 0&&(r.name=t.name),n!==void 0&&(r.value=n),r})}function De(e){let t=new ye(e.options);return e.value!==void 0&&t.setGraph(e.value),e.nodes.forEach(e=>{t.setNode(e.v,e.value),e.parent&&t.setParent(e.v,e.parent)}),e.edges.forEach(e=>{t.setEdge({v:e.v,w:e.w,name:e.name},e.value)}),t}var Oe={};ve(Oe,{CycleException:()=>Ue,bellmanFord:()=>Ae,components:()=>Me,dijkstra:()=>Fe,dijkstraAll:()=>Le,findCycles:()=>ze,floydWarshall:()=>Ve,isAcyclic:()=>Ge,postorder:()=>Ye,preorder:()=>Xe,prim:()=>Ze,shortestPaths:()=>Qe,tarjan:()=>Re,topsort:()=>We});var ke=()=>1;function Ae(e,t,n,r){return je(e,String(t),n||ke,r||function(t){return e.outEdges(t)??[]})}function je(e,t,n,r){let i={},a,o=0,s=e.nodes(),c=function(e){let t=i[e.v],r=i[e.w];if(!t||!r)return;let o=n(e);t.distance+o<r.distance&&(i[e.w]={distance:t.distance+o,predecessor:e.v},a=!0)},l=function(){s.forEach(function(e){r(e).forEach(function(t){let n=t.v===e?t.v:t.w,r=n===t.v?t.w:t.v;c({v:n,w:r})})})};s.forEach(function(e){i[e]={distance:e===t?0:1/0,predecessor:``}});let u=s.length;for(let e=1;e<u&&(a=!1,o++,l(),a);e++);if(o===u-1&&(a=!1,l(),a))throw Error(`The graph contains a negative weight cycle`);return i}function Me(e){let t={},n=[],r;function i(n){var a,o;n in t||(t[n]=!0,r.push(n),(a=e.successors(n))==null||a.forEach(i),(o=e.predecessors(n))==null||o.forEach(i))}return e.nodes().forEach(function(e){r=[],i(e),r.length&&n.push(r)}),n}var Ne=class{constructor(){this._arr=[],this._keyIndices={}}size(){return this._arr.length}keys(){return this._arr.map(e=>e.key)}has(e){return e in this._keyIndices}priority(e){let t=this._keyIndices[e];if(t!==void 0)return this._arr[t].priority}min(){if(this.size()===0)throw Error(`Queue underflow`);return this._arr[0].key}add(e,t){let n=this._keyIndices,r=String(e);if(!(r in n)){let e=this._arr,i=e.length;return n[r]=i,e.push({key:r,priority:t}),this._decrease(i),!0}return!1}removeMin(){if(this.size()===0)throw Error(`Queue underflow`);this._swap(0,this._arr.length-1);let e=this._arr.pop();return delete this._keyIndices[e.key],this._heapify(0),e.key}decrease(e,t){let n=this._keyIndices[e];if(n===void 0)throw Error(`Key not found: ${e}`);let r=this._arr[n].priority;if(t>r)throw Error(`New priority is greater than current priority. Key: ${e} Old: ${r} New: ${t}`);this._arr[n].priority=t,this._decrease(n)}_heapify(e){let t=this._arr,n=2*e,r=n+1,i=e;n<t.length&&(i=t[n].priority<t[i].priority?n:i,r<t.length&&(i=t[r].priority<t[i].priority?r:i),i!==e&&(this._swap(e,i),this._heapify(i)))}_decrease(e){let t=this._arr,n=t[e].priority,r;for(;e!==0&&(r=e>>1,!(t[r].priority<n));)this._swap(e,r),e=r}_swap(e,t){let n=this._arr,r=this._keyIndices,i=n[e],a=n[t];n[e]=a,n[t]=i,r[a.key]=e,r[i.key]=t}},Pe=()=>1;function Fe(e,t,n,r){return Ie(e,String(t),n||Pe,r||function(t){return e.outEdges(t)??[]})}function Ie(e,t,n,r){let i={},a=new Ne,o,s,c=function(e){let t=e.v===o?e.w:e.v,r=i[t];if(!r)return;let c=n(e),l=s.distance+c;if(c<0)throw Error(`dijkstra does not allow negative edge weights. Bad edge: `+e+` Weight: `+c);l<r.distance&&(r.distance=l,r.predecessor=o,a.decrease(t,l))};for(e.nodes().forEach(function(e){let n=e===t?0:1/0;i[e]={distance:n,predecessor:``},a.add(e,n)});a.size()>0;){o=a.removeMin();let e=i[o];if(!e||e.distance===1/0)break;s=e,r(o).forEach(c)}return i}function Le(e,t,n){return e.nodes().reduce(function(r,i){return r[i]=Fe(e,i,t,n),r},{})}function Re(e){let t=0,n=[],r={},i=[];function a(o){var s;let c=r[o]={onStack:!0,lowlink:t,index:t++};if(n.push(o),(s=e.successors(o))==null||s.forEach(function(e){if(e in r){let t=r[e];t!=null&&t.onStack&&(c.lowlink=Math.min(c.lowlink,t.index))}else{a(e);let t=r[e];t&&(c.lowlink=Math.min(c.lowlink,t.lowlink))}}),c.lowlink===c.index){let e=[],t;do{t=n.pop();let i=r[t];i&&(i.onStack=!1),e.push(t)}while(o!==t);i.push(e)}}return e.nodes().forEach(function(e){e in r||a(e)}),i}function ze(e){return Re(e).filter(function(t){let n=t[0];return n?t.length>1||t.length===1&&(e.outEdges(n,n)??[]).length>0:!1})}var Be=()=>1;function Ve(e,t,n){return He(e,t||Be,n||function(t){return e.outEdges(t)??[]})}function He(e,t,n){let r={},i=e.nodes();return i.forEach(function(e){let a={};r[e]=a,a[e]={distance:0,predecessor:``},i.forEach(function(t){e!==t&&(a[t]={distance:1/0,predecessor:``})}),n(e).forEach(function(n){let r=n.v===e?n.w:n.v,i=t(n);a[r]={distance:i,predecessor:e}})}),i.forEach(function(e){let t=r[e];t&&i.forEach(function(n){let a=r[n];a&&i.forEach(function(n){let r=a[e],i=t[n],o=a[n];if(r&&i&&o){let e=r.distance+i.distance;e<o.distance&&(o.distance=e,o.predecessor=i.predecessor)}})})}),r}var Ue=class extends Error{constructor(e){super(e),this.name=`CycleException`}};function We(e){let t={},n={},r=[];function i(a){var o;if(a in n)throw new Ue;a in t||(n[a]=!0,t[a]=!0,(o=e.predecessors(a))==null||o.forEach(i),delete n[a],r.push(a))}if(e.sinks().forEach(i),Object.keys(t).length!==e.nodeCount())throw new Ue;return r}function Ge(e){try{We(e)}catch(e){if(e instanceof Ue)return!1;throw e}return!0}function Ke(e,t,n,r,i){Array.isArray(t)||(t=[t]);let a=(t=>(e.isDirected()?e.successors(t):e.neighbors(t))??[]),o={};return t.forEach(function(t){if(!e.hasNode(t))throw Error(`Graph does not have node: `+t);i=qe(e,t,n===`post`,o,a,r,i)}),i}function qe(e,t,n,r,i,a,o){return t in r||(r[t]=!0,n||(o=a(o,t)),i(t).forEach(function(t){o=qe(e,t,n,r,i,a,o)}),n&&(o=a(o,t))),o}function Je(e,t,n){return Ke(e,t,n,function(e,t){return e.push(t),e},[])}function Ye(e,t){return Je(e,t,`post`)}function Xe(e,t){return Je(e,t,`pre`)}function Ze(e,t){var n;let r=new ye,i={},a=new Ne,o;function s(e){let n=e.v===o?e.w:e.v,r=a.priority(n);if(r!==void 0){let s=t(e);s<r&&(i[n]=o,a.decrease(n,s))}}if(e.nodeCount()===0)return r;e.nodes().forEach(function(e){a.add(e,1/0),r.setNode(e)});let c=e.nodes()[0];c!==void 0&&a.decrease(c,0);let l=!1;for(;a.size()>0;){if(o=a.removeMin(),o in i)r.setEdge(o,i[o]);else{if(l)throw Error(`Input graph is not connected: `+e);l=!0}(n=e.nodeEdges(o))==null||n.forEach(s)}return r}function Qe(e,t,n,r){return $e(e,t,n,r??(t=>e.outEdges(t)??[]))}function $e(e,t,n,r){if(n===void 0)return Fe(e,t,n,r);let i=!1,a=e.nodes();for(let o=0;o<a.length;o++){let s=a[o];if(s===void 0)continue;let c=r(s);for(let e=0;e<c.length;e++){let t=c[e];if(!t)continue;let r=t.v===s?t.v:t.w;n({v:r,w:r===t.v?t.w:t.v})<0&&(i=!0)}if(i)return Ae(e,t,n,r)}return Fe(e,t,n,r)}var j=ye;function M(e,t,n,r){let i=r;for(;e.hasNode(i);)i=pt(r);return n.dummy=t,e.setNode(i,n),i}function et(e){let t=new j().setGraph(e.graph());return e.nodes().forEach(n=>t.setNode(n,e.node(n))),e.edges().forEach(n=>{let r=t.edge(n.v,n.w)||{weight:0,minlen:1},i=e.edge(n);t.setEdge(n.v,n.w,{weight:r.weight+i.weight,minlen:Math.max(r.minlen,i.minlen)})}),t}function tt(e){let t=new j({multigraph:e.isMultigraph()}).setGraph(e.graph());return e.nodes().forEach(n=>{e.children(n).length||t.setNode(n,e.node(n))}),e.edges().forEach(n=>{t.setEdge(n,e.edge(n))}),t}function nt(e,t){let n=e.x,r=e.y,i=t.x-n,a=t.y-r,o=e.width/2,s=e.height/2;if(!i&&!a)throw Error(`Not possible to find intersection inside of the rectangle`);let c,l;return Math.abs(a)*o>Math.abs(i)*s?(a<0&&(s=-s),c=s*i/a,l=s):(i<0&&(o=-o),c=o,l=o*a/i),{x:n+c,y:r+l}}function rt(e){let t=P(lt(e)+1).map(()=>[]);return e.nodes().forEach(n=>{let r=e.node(n),i=r.rank;i!==void 0&&(t[i]||(t[i]=[]),t[i][r.order]=n)}),t}function it(e){let t=e.nodes().map(t=>{let n=e.node(t).rank;return n===void 0?Number.MAX_VALUE:n}),n=N(Math.min,t);e.nodes().forEach(t=>{let r=e.node(t);Object.hasOwn(r,`rank`)&&(r.rank-=n)})}function at(e){let t=e.nodes().map(t=>e.node(t).rank).filter(e=>e!==void 0),n=N(Math.min,t),r=[];e.nodes().forEach(t=>{let i=e.node(t).rank-n;r[i]||(r[i]=[]),r[i].push(t)});let i=0,a=e.graph().nodeRankFactor;Array.from(r).forEach((t,n)=>{t===void 0&&n%a!==0?--i:t!==void 0&&i&&t.forEach(t=>e.node(t).rank+=i)})}function ot(e,t,n,r){let i={width:0,height:0};return arguments.length>=4&&(i.rank=n,i.order=r),M(e,`border`,i,t)}function st(e,t=ct){let n=[];for(let r=0;r<e.length;r+=t){let i=e.slice(r,r+t);n.push(i)}return n}var ct=65535;function N(e,t){return t.length>ct?e(...st(t).map(t=>e(...t))):e(...t)}function lt(e){let t=e.nodes().map(t=>{let n=e.node(t).rank;return n===void 0?Number.MIN_VALUE:n});return N(Math.max,t)}function ut(e,t){let n={lhs:[],rhs:[]};return e.forEach(e=>{t(e)?n.lhs.push(e):n.rhs.push(e)}),n}function dt(e,t){return t()}var ft=0;function pt(e){return e+(``+ ++ft)}function P(e,t,n=1){t??(t=e,e=0);let r=e=>e<t;n<0&&(r=e=>t<e);let i=[];for(let t=e;r(t);t+=n)i.push(t);return i}function mt(e,t){let n={};for(let r of t)e[r]!==void 0&&(n[r]=e[r]);return n}function ht(e,t){let n;return n=typeof t==`string`?e=>e[t]:t,Object.entries(e).reduce((e,[t,r])=>(e[t]=n(r,t),e),{})}function gt(e,t){return e.reduce((e,n,r)=>(e[n]=t[r],e),{})}var _t=`\0`;function vt(e,t,n){if(!(e&&t&&n&&t.dummy===`edge`&&n.dummy===`edge`&&t.edgeObj&&n.edgeObj&&e[t.edgeObj.v]&&e[n.edgeObj.v]&&e[t.edgeObj.w]&&e[n.edgeObj.w]))return 0;let r=!0;t.edgeObj.w===n.edgeObj.w&&(r=!1);let i=r?e[t.edgeObj.v]?.rank??NaN:e[t.edgeObj.w]?.rank??NaN,a=Object.entries(e).find(e=>e[1].edgeObj?.v===t.edgeObj.v&&e[1].edgeObj?.w===t.edgeObj.w&&e[1].rank===i),o=Object.entries(e).find(e=>e[1].edgeObj?.v===n.edgeObj.v&&e[1].edgeObj?.w===n.edgeObj.w&&e[1].rank===i);if(!a||!o)return 0;let s=a[1].order??NaN,c=o[1].order??NaN;return isNaN(s-c)?0:s-c}var yt=class{constructor(){he(this,`_sentinel`);let e={};e._next=e._prev=e,this._sentinel=e}dequeue(){let e=this._sentinel,t=e._prev;if(t!==e)return bt(t),t}enqueue(e){let t=this._sentinel;e._prev&&e._next&&bt(e),e._next=t._next,t._next._prev=e,t._next=e,e._prev=t}toString(){let e=[],t=this._sentinel,n=t._prev;for(;n!==t;)e.push(JSON.stringify(n,xt)),n=n._prev;return`[`+e.join(`, `)+`]`}};function bt(e){e._prev._next=e._next,e._next._prev=e._prev,delete e._next,delete e._prev}function xt(e,t){if(e!==`_next`&&e!==`_prev`)return t}var St=yt,Ct=()=>1;function wt(e,t){if(e.nodeCount()<=1)return[];let n=Dt(e,t||Ct);return Tt(n.graph,n.buckets,n.zeroIdx).flatMap(t=>e.outEdges(t.v,t.w)||[])}function Tt(e,t,n){let r=[],i=t[t.length-1],a=t[0],o;for(;e.nodeCount();){for(;o=a.dequeue();)Et(e,t,n,o);for(;o=i.dequeue();)Et(e,t,n,o);if(e.nodeCount()){for(let i=t.length-2;i>0;--i)if(o=t[i]?.dequeue(),o){r=r.concat(Et(e,t,n,o,!0)||[]);break}}}return r}function Et(e,t,n,r,i){let a=[],o=i?a:void 0;return(e.inEdges(r.v)||[]).forEach(r=>{let o=e.edge(r),s=e.node(r.v);i&&a.push({v:r.v,w:r.w}),s.out-=o,Ot(t,n,s)}),(e.outEdges(r.v)||[]).forEach(r=>{let i=e.edge(r),a=r.w,o=e.node(a);o.in-=i,Ot(t,n,o)}),e.removeNode(r.v),o}function Dt(e,t){let n=new j,r=0,i=0;e.nodes().forEach(e=>{n.setNode(e,{v:e,in:0,out:0})}),e.edges().forEach(e=>{let a=n.edge(e.v,e.w)||0,o=t(e),s=a+o;n.setEdge(e.v,e.w,s);let c=n.node(e.v),l=n.node(e.w);i=Math.max(i,c.out+=o),r=Math.max(r,l.in+=o)});let a=kt(i+r+3).map(()=>new St),o=r+1;return n.nodes().forEach(e=>{Ot(a,o,n.node(e))}),{graph:n,buckets:a,zeroIdx:o}}function Ot(e,t,n){var r,i,a;n.out?n.in?(a=e[n.out-n.in+t])==null||a.enqueue(n):(i=e[e.length-1])==null||i.enqueue(n):(r=e[0])==null||r.enqueue(n)}function kt(e){let t=[];for(let n=0;n<e;n++)t.push(n);return t}function At(e,t){(e.graph().acyclicer===`greedy`?wt(e,n(e)):jt(e,t??null)).forEach(t=>{let n=e.edge(t);e.removeEdge(t),n.forwardName=t.name,n.reversed=!0,e.setEdge(t.w,t.v,n,pt(`rev`))});function n(e){return t=>e.edge(t).weight}}function jt(e,t){let n=[],r={},i={};function a(t){Object.hasOwn(i,t)||(i[t]=!0,r[t]=!0,e.outEdges(t).forEach(e=>{Object.hasOwn(r,e.w)?n.push(e):a(e.w)}),delete r[t])}function o(a){var s;Object.hasOwn(i,a)||(i[a]=!0,r[a]=!0,(s=e.outEdges(a))==null||s.forEach(i=>{Object.hasOwn(r,i.w)||t.node(a)?.rank>t.node(i.w)?.rank&&Nt(e,i.w,i)?n.push(i):o(i.w)}),delete r[a])}let s=a;return t&&typeof t.node==`function`&&(s=o),e.sources().forEach(s),e.nodes().forEach(s),n}function Mt(e){e.edges().forEach(t=>{let n=e.edge(t);if(n.reversed){e.removeEdge(t);let r=n.forwardName;delete n.reversed,delete n.forwardName,e.setEdge(t.w,t.v,n,r)}})}function Nt(e,t,n){let r=/* @__PURE__ */ new Set;function i(t){if(e.sources().includes(t))return!0;r.add(t);for(let a of e.inEdges(t)??[])if((a.v!==n.v||a.w!==n.w)&&!r.has(a.v)&&i(a.v))return!0;return!1}return i(t)}function Pt(e){e.graph().dummyChains=[],e.edges().forEach(t=>Ft(e,t))}function Ft(e,t){let n=t.v,r=e.node(n).rank,i=t.w,a=e.node(i).rank,o=t.name,s=e.edge(t),c=s.labelRank;if(a===r+1)return;e.removeEdge(t);let l,u,d=0;for(++r;r<a;++d,++r)s.points=[],u={width:0,height:0,edgeLabel:s,edgeObj:t,rank:r},l=M(e,`edge`,u,`_d`),r===c&&(u.width=s.width,u.height=s.height,u.dummy=`edge-label`,u.labelpos=s.labelpos),e.setEdge(n,l,{weight:s.weight},o),d===0&&e.graph().dummyChains.push(l),n=l;e.setEdge(n,i,{weight:s.weight},o)}function It(e){e.graph().dummyChains.forEach(t=>{let n=e.node(t),r=n.edgeLabel,i;for(e.setEdge(n.edgeObj,r);n.dummy;)i=e.successors(t)[0],e.removeNode(t),r.points.push({x:n.x,y:n.y}),n.dummy===`edge-label`&&(r.x=n.x,r.y=n.y,r.width=n.width,r.height=n.height),t=i,n=e.node(t)})}function Lt(e){let t={};function n(r){let i=e.node(r);if(Object.hasOwn(t,r))return i.rank;t[r]=!0;let a=e.outEdges(r),o=a?a.map(t=>t==null?1/0:n(t.w)-e.edge(t).minlen):[],s=N(Math.min,o);return s===1/0&&(s=0),i.rank=s}e.sources().forEach(n)}function F(e,t){return e.node(t.w).rank-e.node(t.v).rank-e.edge(t).minlen}var Rt=zt;function zt(e){let t=new j({directed:!1}),n=e.nodes();if(n.length===0)throw Error(`Graph must have at least one node`);let r=n[0],i=e.nodeCount();t.setNode(r,{});let a,o;for(;Bt(t,e)<i&&(a=Vt(t,e),a);)o=t.hasNode(a.v)?F(e,a):-F(e,a),Ht(t,e,o);return t}function Bt(e,t){function n(r){let i=t.nodeEdges(r);i&&i.forEach(i=>{let a=i.v,o=r===a?i.w:a;!e.hasNode(o)&&!F(t,i)&&(e.setNode(o,{}),e.setEdge(r,o,{}),n(o))})}return e.nodes().forEach(n),e.nodeCount()}function Vt(e,t){return t.edges().reduce((n,r)=>{let i=1/0;return e.hasNode(r.v)!==e.hasNode(r.w)&&(i=F(t,r)),i<n[0]?[i,r]:n},[1/0,null])[1]}function Ht(e,t,n){e.nodes().forEach(e=>t.node(e).rank+=n)}var{preorder:Ut,postorder:Wt}=Oe,Gt=I;I.initLowLimValues=Yt,I.initCutValues=Kt,I.calcCutValue=Jt,I.leaveEdge=Zt,I.enterEdge=Qt,I.exchangeEdges=$t;function I(e){e=et(e),Lt(e);let t=Rt(e);Yt(t),Kt(t,e);let n,r;for(;n=Zt(t);)r=Qt(t,e,n),$t(t,e,n,r)}function Kt(e,t){let n=Wt(e,e.nodes());n=n.slice(0,n.length-1),n.forEach(n=>qt(e,t,n))}function qt(e,t,n){let r=e.node(n).parent,i=e.edge(n,r);i.cutvalue=Jt(e,t,n)}function Jt(e,t,n){let r=e.node(n).parent,i=!0,a=t.edge(n,r),o=0;a||=(i=!1,t.edge(r,n)),o=a.weight;let s=t.nodeEdges(n);return s&&s.forEach(a=>{let s=a.v===n,c=s?a.w:a.v;if(c!==r){let r=s===i,l=t.edge(a).weight;if(o+=r?l:-l,tn(e,n,c)){let t=e.edge(n,c).cutvalue;o+=r?-t:t}}}),o}function Yt(e,t){arguments.length<2&&(t=e.nodes()[0]),Xt(e,{},1,t)}function Xt(e,t,n,r,i){let a=n,o=e.node(r);t[r]=!0;let s=e.neighbors(r);return s&&s.forEach(i=>{Object.hasOwn(t,i)||(n=Xt(e,t,n,i,r))}),o.low=a,o.lim=n++,i?o.parent=i:delete o.parent,n}function Zt(e){return e.edges().find(t=>e.edge(t).cutvalue<0)}function Qt(e,t,n){let r=n.v,i=n.w;t.hasEdge(r,i)||(r=n.w,i=n.v);let a=e.node(r),o=e.node(i),s=a,c=!1;return a.lim>o.lim&&(s=o,c=!0),t.edges().filter(t=>c===nn(e,e.node(t.v),s)&&c!==nn(e,e.node(t.w),s)).reduce((e,n)=>F(t,n)<F(t,e)?n:e)}function $t(e,t,n,r){let i=n.v,a=n.w;e.removeEdge(i,a),e.setEdge(r.v,r.w,{}),Yt(e),Kt(e,t),en(e,t)}function en(e,t){let n=e.nodes().find(t=>!e.node(t).parent);if(!n)return;let r=Ut(e,[n]);r=r.slice(1),r.forEach(n=>{let r=e.node(n).parent,i=t.edge(n,r),a=!1;i||(i=t.edge(r,n),a=!0),t.node(n).rank=t.node(r).rank+(a?i.minlen:-i.minlen)})}function tn(e,t,n){return e.hasEdge(t,n)}function nn(e,t,n){return n.low<=t.lim&&t.lim<=n.lim}var rn=an;function an(e){let t=e.graph().ranker;if(typeof t==`function`)return t(e);switch(t){case`network-simplex`:cn(e);break;case`tight-tree`:sn(e);break;case`longest-path`:on(e);break;case`none`:break;default:cn(e)}}var on=Lt;function sn(e){Lt(e),Rt(e)}function cn(e){Gt(e)}var ln=un;function un(e){let t=fn(e),n=e.graph();Array.isArray(n.dummyChains)&&n.dummyChains.forEach(n=>{let r=e.node(n),i=r.edgeObj,a=dn(e,t,i.v,i.w),o=a.path,s=a.lca,c=0,l=o[c],u=!0;for(;n!==i.w;){if(r=e.node(n),u){for(;(l=o[c])!==s&&e.node(l).maxRank<r.rank;)c++;l===s&&(u=!1)}if(!u){for(;c<o.length-1&&e.node(o[c+1]).minRank<=r.rank;)c++;l=o[c]}l!==void 0&&e.setParent(n,l),n=e.successors(n)[0]}})}function dn(e,t,n,r){let i=[],a=[],o=Math.min(t[n].low,t[r].low),s=Math.max(t[n].lim,t[r].lim),c;c=n;do c=e.parent(c),i.push(c);while(c&&(t[c].low>o||s>t[c].lim));let l=c,u=r;for(;(u=e.parent(u))!==l;)a.push(u);return{path:i.concat(a.reverse()),lca:l}}function fn(e){let t={},n=0;function r(i){let a=n;e.children(i).forEach(r),t[i]={low:a,lim:n++}}return e.children(_t).forEach(r),t}function pn(e){let t=M(e,`root`,{},`_root`),n=hn(e),r=Object.values(n),i=N(Math.max,r)-1,a=2*i+1;e.graph().nestingRoot=t,e.edges().forEach(t=>e.edge(t).minlen*=a);let o=gn(e)+1;e.children(_t).forEach(r=>{mn(e,t,a,o,i,n,r)}),e.graph().nodeRankFactor=a}function mn(e,t,n,r,i,a,o){let s=e.children(o);if(!s.length){o!==t&&e.setEdge(t,o,{weight:0,minlen:n});return}let c=ot(e,`_bt`),l=ot(e,`_bb`),u=e.node(o);e.setParent(c,o),u.borderTop=c,e.setParent(l,o),u.borderBottom=l,s.forEach(s=>{mn(e,t,n,r,i,a,s);let u=e.node(s),d=u.borderTop?u.borderTop:s,f=u.borderBottom?u.borderBottom:s,p=u.borderTop?r:2*r,m=d===f?i-(a[o]??0)+1:1;e.setEdge(c,d,{weight:p,minlen:m,nestingEdge:!0}),e.setEdge(f,l,{weight:p,minlen:m,nestingEdge:!0})}),e.parent(o)||e.setEdge(t,c,{weight:0,minlen:i+(a[o]??0)})}function hn(e){let t={};function n(r,i){let a=e.children(r);a&&a.length&&a.forEach(e=>n(e,i+1)),t[r]=i}return e.children(_t).forEach(e=>n(e,1)),t}function gn(e){return e.edges().reduce((t,n)=>t+e.edge(n).weight,0)}function _n(e){let t=e.graph();e.removeNode(t.nestingRoot),delete t.nestingRoot,e.edges().forEach(t=>{e.edge(t).nestingEdge&&e.removeEdge(t)})}var vn=yn;function yn(e){function t(n){let r=e.children(n),i=e.node(n);if(r.length&&r.forEach(t),i&&Object.hasOwn(i,`minRank`)){i.borderLeft=[],i.borderRight=[];for(let t=i.minRank,r=i.maxRank+1;t<r;++t)bn(e,`borderLeft`,`_bl`,n,i,t),bn(e,`borderRight`,`_br`,n,i,t)}}e.children(_t).forEach(t)}function bn(e,t,n,r,i,a){let o={width:0,height:0,rank:a,borderType:t},s=i[t][a-1],c=M(e,`border`,o,n);i[t][a]=c,e.setParent(c,r),s&&e.setEdge(s,c,{weight:1})}function xn(e){let t=e.graph().rankdir?.toLowerCase();(t===`lr`||t===`rl`)&&Cn(e)}function Sn(e){let t=e.graph().rankdir?.toLowerCase();(t===`bt`||t===`rl`)&&Tn(e),(t===`lr`||t===`rl`)&&(Dn(e),Cn(e))}function Cn(e){e.nodes().forEach(t=>wn(e.node(t))),e.edges().forEach(t=>wn(e.edge(t)))}function wn(e){let t=e.width;e.width=e.height,e.height=t}function Tn(e){e.nodes().forEach(t=>En(e.node(t))),e.edges().forEach(t=>{var n;let r=e.edge(t);(n=r.points)==null||n.forEach(En),Object.hasOwn(r,`y`)&&En(r)})}function En(e){e.y=-e.y}function Dn(e){e.nodes().forEach(t=>On(e.node(t))),e.edges().forEach(t=>{var n;let r=e.edge(t);(n=r.points)==null||n.forEach(On),Object.hasOwn(r,`x`)&&On(r)})}function On(e){let t=e.x;e.x=e.y,e.y=t}function kn(e,t=null){let n={},r=e.nodes().filter(t=>!e.children(t).length),i=r.map(t=>e.node(t).rank),a=P(N(Math.max,i)+1).map(()=>[]);function o(t){if(n[t])return;n[t]=!0;let r=e.node(t);a[r.rank].push(t);let i=e.successors(t);i&&[...i].sort((e,t)=>s(e,t)).forEach(o)}r.sort((t,n)=>e.node(t).rank-e.node(n).rank).forEach(o);function s(n,r){return vt(t,e.node(n),e.node(r))}return a}function An(e,t){let n=0;for(let r=1;r<t.length;++r)n+=jn(e,t[r-1],t[r]);return n}function jn(e,t,n){let r=gt(n,n.map((e,t)=>t)),i=t.flatMap(t=>{let n=e.outEdges(t);return n?n.map(t=>({pos:r[t.w],weight:e.edge(t).weight})).sort((e,t)=>e.pos-t.pos):[]}),a=1;for(;a<n.length;)a<<=1;let o=2*a-1;--a;let s=Array(o).fill(0),c=0;return i.forEach(e=>{let t=e.pos+a;s[t]+=e.weight;let n=0;for(;t>0;)t%2&&(n+=s[t+1]),t=t-1>>1,s[t]+=e.weight;c+=e.weight*n}),c}function Mn(e,t=[]){return t.map(t=>{let n=e.inEdges(t);if(!n||!n.length)return{v:t};{let r=n.reduce((t,n)=>{let r=e.edge(n),i=e.node(n.v);return{sum:t.sum+r.weight*i.order,weight:t.weight+r.weight}},{sum:0,weight:0});return{v:t,barycenter:r.sum/r.weight,weight:r.weight}}})}function Nn(e,t){let n={};return e.forEach((e,t)=>{let r={indegree:0,in:[],out:[],vs:[e.v],i:t};e.barycenter!==void 0&&(r.barycenter=e.barycenter,r.weight=e.weight),n[e.v]=r}),t.edges().forEach(e=>{let t=n[e.v],r=n[e.w];t!==void 0&&r!==void 0&&(r.indegree++,t.out.push(r))}),Pn(Object.values(n).filter(e=>!e.indegree))}function Pn(e){let t=[];function n(e){return t=>{t.merged||(t.barycenter===void 0||e.barycenter===void 0||t.barycenter>=e.barycenter)&&Fn(e,t)}}function r(t){return n=>{n.in.push(t),--n.indegree===0&&e.push(n)}}for(;e.length;){let i=e.pop();t.push(i),i.in.reverse().forEach(n(i)),i.out.forEach(r(i))}return t.filter(e=>!e.merged).map(e=>mt(e,[`vs`,`i`,`barycenter`,`weight`]))}function Fn(e,t){let n=0,r=0;e.weight&&(n+=e.barycenter*e.weight,r+=e.weight),t.weight&&(n+=t.barycenter*t.weight,r+=t.weight),e.vs=t.vs.concat(e.vs),e.barycenter=n/r,e.weight=r,e.i=Math.min(t.i,e.i),t.merged=!0}function In(e,t,n,r,i){let a={},o=null,s=null,c=i;typeof t==`boolean`?(c=t,a={}):t&&(a=t,o=n??null,s=r??null);let l=ut(e,e=>Object.hasOwn(e,`barycenter`)),u=l.lhs,d=l.rhs.sort((e,t)=>t.i-e.i),f=[],p=0,m=0,h=0;u.sort(Rn(s,o,!!c));for(let[e,t]of Object.entries(a)){let n=u.findIndex(t=>t.vs[0]===e);u.splice(n+1,0,t)}h=Ln(f,d,h),u.forEach(e=>{h+=e.vs.length,f.push(e.vs),p+=e.barycenter*e.weight,m+=e.weight,h=Ln(f,d,h)});let g={vs:f.flat(1)};return m&&(g.barycenter=p/m,g.weight=m),g}function Ln(e,t,n){let r;for(;t.length&&(r=t[t.length-1]).i<=n;)t.pop(),e.push(r.vs),n++;return n}function Rn(e,t,n){return(r,i)=>{if(r.barycenter<i.barycenter)return-1;if(r.barycenter>i.barycenter)return 1;if(e&&(typeof r.vs[0]==`string`||typeof i.vs[0]==`string`)){let n=vt(t,e.node(r.vs[0]),e.node(i.vs[0]));if(n!==0)return n}return n?i.i-r.i:r.i-i.i}}function zn(e,t,n,r,i){var a,o;let s=null,c=i;typeof r==`boolean`?(c=r,s=null):r!==void 0&&(s=r);let l=e.children(t),u=e.node(t),d=u?u.borderLeft:void 0,f=u?u.borderRight:void 0,p={};d&&(l=l.filter(e=>e!==d&&e!==f));let m=Mn(e,l);m.forEach(t=>{if(e.children(t.v).length){let{result:r}=zn(e,t.v,n,s,c);p[t.v]=r,Object.hasOwn(r,`barycenter`)&&Vn(t,r)}});let h=Nn(m,n);Bn(h,p);let g={},_=!1;for(let t=0;t<h.length;t++)for(let n=t+1;n<h.length;n++)if(h[t]&&h[n]&&(a=h[t])!=null&&a.barycenter&&(o=h[n])!=null&&o.barycenter&&h[t]?.barycenter===h[n].barycenter){let r=h[t]?.vs[0]??``,i=h[n]?.vs[0]??``,a=e.node(r),o=e.node(i);if(a.dummy===`edge`&&o.dummy===`edge`&&a.edgeObj?.v===o.edgeObj?.v&&a.edgeObj?.w===o.edgeObj?.w){if(a.edgeLabel.reversed){g[i]=h[t],h.splice(t,1),t--;break}g[r]=h[n],h.splice(n,1),n--}else _=!0}let v=In(h,g,s,e,c);if(d&&f){v.vs=[d,v.vs,f].flat(1);let t=e.predecessors(d);if(t&&t.length){let n=e.node(t[0]),r=e.predecessors(f),i=e.node(r[0]);Object.hasOwn(v,`barycenter`)||(v.barycenter=0,v.weight=0),v.barycenter=(v.barycenter*v.weight+n.order+i.order)/(v.weight+2),v.weight+=2}}return Object.defineProperty(v,"result",{value:v,enumerable:!1,configurable:!0,writable:!0}),Object.defineProperty(v,"usedBias",{value:_,enumerable:!1,configurable:!0,writable:!0}),v}function Bn(e,t){e.forEach(e=>{e.vs=e.vs.flatMap(e=>t[e]?t[e].vs:e)})}function Vn(e,t){e.barycenter===void 0?(e.barycenter=t.barycenter,e.weight=t.weight):(e.barycenter=(e.barycenter*e.weight+t.barycenter*t.weight)/(e.weight+t.weight),e.weight+=t.weight)}function Hn(e,t,n,r){r||=e.nodes();let i=Un(e),a=new j({compound:!0}).setGraph({root:i}).setDefaultNodeLabel(t=>e.node(t));return r.forEach(r=>{let o=e.node(r),s=e.parent(r);if(o.rank===t||o.minRank<=t&&t<=o.maxRank){a.setNode(r),a.setParent(r,s||i);let c=e[n](r);c&&c.forEach(t=>{let n=t.v===r?t.w:t.v,i=a.edge(n,r),o=i===void 0?0:i.weight;a.setEdge(n,r,{weight:e.edge(t).weight+o})}),Object.hasOwn(o,`minRank`)&&a.setNode(r,{borderLeft:o.borderLeft[t],borderRight:o.borderRight[t]})}}),a}function Un(e){let t;for(;e.hasNode(t=pt(`_root`)););return t}function Wn(e,t,n){let r={},i;n.forEach(n=>{let a=e.parent(n),o,s;for(;a;){if(o=e.parent(a),o?(s=r[o],r[o]=a):(s=i,i=a),s&&s!==a){t.setEdge(s,a);return}a=o}})}function Gn(e,t={},n=null){if(typeof t.customOrder==`function`){t.customOrder(e,Gn);return}let r=lt(e),i=Kn(e,P(1,r+1),`inEdges`),a=Kn(e,P(r-1,-1,-1),`outEdges`),o=kn(e,n);if(Jn(e,o),t.disableOptimalOrderHeuristic)return;let s=1/0,c,l=t.constraints||[];for(let t=0,r=0;r<4;++t,++r){qn(t%2?i:a,t%4>=2,l,n),o=rt(e);let u=An(e,o);u<s?(r=0,c=Object.assign({},o),s=u):u===s&&(c=structuredClone(o))}Jn(e,c)}function Kn(e,t,n){let r=/* @__PURE__ */ new Map,i=(e,t)=>{r.has(e)||r.set(e,[]),r.get(e).push(t)};for(let t of e.nodes()){let n=e.node(t);if(typeof n.rank==`number`&&i(n.rank,t),typeof n.minRank==`number`&&typeof n.maxRank==`number`)for(let e=n.minRank;e<=n.maxRank;e++)e!==n.rank&&i(e,t)}return t.map(function(t){return Hn(e,t,n,r.get(t)||[])})}function qn(e,t,n,r){let i=!0,a=new j;e.forEach(function(e){n.forEach(e=>a.setEdge(e.left,e.right));let o=e.graph().root,{result:s,usedBias:c}=zn(e,o,a,r,i);t&&c&&(i=!i),s.vs.forEach((t,n)=>e.node(t).order=n),Wn(e,a,s.vs)})}function Jn(e,t){Object.values(t).forEach(t=>t.forEach((t,n)=>e.node(t).order=n))}function Yn(e,t){let n={};function r(t,r){let i=0,a=0,o=t.length,s=r[r.length-1];return r.forEach((t,c)=>{let l=Zn(e,t),u=l?e.node(l).order:o;(l||t===s)&&(r.slice(a,c+1).forEach(t=>{let r=e.predecessors(t);r&&r.forEach(r=>{let a=e.node(r),o=a.order;(o<i||u<o)&&!(a.dummy&&e.node(t).dummy)&&Qn(n,r,t)})}),a=c+1,i=u)}),r}return t.length&&t.reduce(r),n}function Xn(e,t){let n={};function r(t,r,i,a,o){P(r,i).forEach(r=>{let i=t[r];if(i!==void 0&&e.node(i).dummy){let t=e.predecessors(i);t&&t.forEach(t=>{if(t===void 0)return;let r=e.node(t);r.dummy&&(r.order<a||r.order>o)&&Qn(n,t,i)})}})}function i(t,n){let i=-1,a=-1,o=0;return n.forEach((s,c)=>{if(e.node(s).dummy===`border`){let t=e.predecessors(s);if(t&&t.length){let s=t[0];if(s===void 0)return;a=e.node(s).order,r(n,o,c,i,a),o=c,i=a}}r(n,o,n.length,a,t.length)}),n}return t.length&&t.reduce(i),n}function Zn(e,t){if(e.node(t).dummy){let n=e.predecessors(t);if(n)return n.find(t=>e.node(t).dummy)}}function Qn(e,t,n){if(t>n){let e=t;t=n,n=e}let r=e[t];r||(e[t]=r={}),r[n]=!0}function $n(e,t,n){if(t>n){let e=t;t=n,n=e}let r=e[t];return r!==void 0&&Object.hasOwn(r,n)}function er(e,t,n,r,i){let a={},o={},s={};return t.forEach(e=>{e.forEach((e,t)=>{a[e]=e,o[e]=e,s[e]=t})}),t.forEach(t=>{let c=-1,l=-1,u=!1,d=t,f=t.findIndex(t=>i?.includes(t)||lr(t,e,i));f>0&&(d=[t[f],...t.slice(0,f),...t.slice(f+1)],u=!0),d.forEach(t=>{let d=r(t);if(d&&d.length){i!=null&&i.includes(t)&&(d=d.filter(t=>lr(t,e,i)));let r=d.sort((e,t)=>{let n=s[e],r=s[t];return(n===void 0?0:n)-(r===void 0?0:r)}),f=(r.length-1)/2;for(let e=Math.floor(f),i=Math.ceil(f);e<=i;++e){let i=r[e];if(i===void 0)continue;let d=s[i];if(d!==void 0&&o[t]===t&&c<d&&s[i]!==l&&!$n(n,t,i)){let e=a[i];e!==void 0&&(o[i]=t,o[t]=a[t]=e,c=d,u&&=(c=-1,l=s[i]??-1,!1))}}}})}),{root:a,align:o}}function tr(e,t,n,r,i=!1){let a={},o=nr(e,t,n,i),s=i?`borderLeft`:`borderRight`;function c(e,t){let n=o.nodes().slice(),r={},i=n.pop();for(;i;){if(r[i])e(i);else{r[i]=!0,n.push(i);for(let e of t(i))n.push(e)}i=n.pop()}}function l(e){let t=o.inEdges(e);t?a[e]=t.reduce((e,t)=>{let n=a[t.v]??0,r=o.edge(t);return Math.max(e,n+(r===void 0?0:r))},0):a[e]=0}function u(t){let n=o.outEdges(t),r=1/0;n&&(r=n.reduce((e,t)=>{let n=a[t.w],r=o.edge(t);return Math.min(e,(n===void 0?0:n)-(r===void 0?0:r))},1/0));let i=e.node(t);r!==1/0&&i.borderType!==s&&(a[t]=Math.max(a[t]===void 0?0:a[t],r))}function d(e){return o.predecessors(e)||[]}function f(e){return o.successors(e)||[]}return c(l,d),c(u,f),Object.keys(r).forEach(e=>{let t=n[e];t!==void 0&&(a[e]=a[t]??0)}),a}function nr(e,t,n,r){let i=new j,a=e.graph(),o=sr(a.nodesep,a.edgesep,r);return t.forEach(t=>{let r;t.forEach(t=>{let a=n[t];if(a!==void 0){if(i.setNode(a),r!==void 0){let s=n[r];if(s!==void 0){let n=i.edge(s,a);i.setEdge(s,a,Math.max(o(e,t,r),n||0))}}r=t}})}),i}function rr(e,t){return Object.values(t).reduce((t,n)=>{let r=-1/0,i=1/0;Object.entries(n).forEach(([t,n])=>{let a=cr(e,t)/2;r=Math.max(n+a,r),i=Math.min(n-a,i)});let a=r-i;return a<t[0]&&(t=[a,n]),t},[1/0,null])[1]}function ir(e,t){let n=Object.values(t),r=N(Math.min,n),i=N(Math.max,n);[`u`,`d`].forEach(n=>{[`l`,`r`].forEach(a=>{let o=n+a,s=e[o];if(!s||s===t)return;let c=Object.values(s),l=r-N(Math.min,c);a!==`l`&&(l=i-N(Math.max,c)),l&&(e[o]=ht(s,e=>e+l))})})}function ar(e,t=void 0){let n=e.ul;return n?ht(n,(n,r)=>{if(t){let n=e[t.toLowerCase()];if(n&&n[r]!==void 0)return n[r]}let i=Object.values(e).map(e=>{let t=e[r];return t===void 0?0:t}).sort((e,t)=>e-t);return((i[1]??0)+(i[2]??0))/2}):{}}function or(e,t){let n=rt(e),r=Object.assign(Yn(e,n),Xn(e,n)),i={},a;return[`u`,`d`].forEach(o=>{a=o===`u`?n:Object.values(n).reverse(),[`l`,`r`].forEach(n=>{n===`r`&&(a=a.map(e=>Object.values(e).reverse()));let s=er(e,a,r,t=>(o===`u`?e.predecessors(t):e.successors(t))||[],t),c=tr(e,a,s.root,s.align,n===`r`);n===`r`&&(c=ht(c,e=>-e)),i[o+n]=c})}),ir(i,rr(e,i)),ar(i,e.graph().align)}function sr(e,t,n){return(r,i,a)=>{let o=r.node(i),s=r.node(a),c=0,l;if(c+=o.width/2,Object.hasOwn(o,`labelpos`))switch(o.labelpos.toLowerCase()){case`l`:l=-o.width/2;break;case`r`:l=o.width/2}if(l&&(c+=n?l:-l),l=void 0,c+=(o.dummy?t:e)/2,c+=(s.dummy?t:e)/2,c+=s.width/2,Object.hasOwn(s,`labelpos`))switch(s.labelpos.toLowerCase()){case`l`:l=s.width/2;break;case`r`:l=-s.width/2}return l&&(c+=n?l:-l),c}}function cr(e,t){return e.node(t).width}function lr(e,t,n){if(!n)return!1;let r=t.node(e)?.edgeObj;if(!r||t.node(e).edgeLabel.reversed)return!1;let i=n.indexOf(r?.v),a=n.indexOf(r?.w);return i!==-1&&a!==-1&&i===(a+1)%n.length||i===(a-1)%n.length}function ur(e,t){e=tt(e),dr(e),Object.entries(or(e,t)).forEach(([t,n])=>e.node(t).x=n)}function dr(e){let t=rt(e),n=e.graph(),r=n.ranksep,i=n.rankalign,a=0;t.forEach(t=>{let n=t.reduce((t,n)=>{let r=e.node(n).height??0;return t>r?t:r},0);t.forEach(t=>{let r=e.node(t);r.y=i===`top`?a+r.height/2:i===`bottom`?a+n-r.height/2:a+n/2}),a+=n+r})}var fr=/* @__PURE__ */ new WeakMap;function pr(e,t={}){return hr(e,dt,t),e}function mr(e,t,n){let r=t;for(;r!==void 0;){let t=e.parent(r);if(t===n)return r;r=t}}function hr(e,t,n){let r=e.nodes().filter(t=>e.children(t).length),i={};r.forEach(r=>{let a=e.node(r);if(a&&a.rankdir){let o=new j({multigraph:!0,compound:!0});o.setGraph({rankdir:a.rankdir});let s=e.children(r);s.forEach(t=>{let n={...e.node(t)};o.setNode(t,n);let i=e.parent(t);i&&i!==r&&s.includes(i)&&o.setParent(t,i)});let c=/* @__PURE__ */ new Set;e.edges().forEach(t=>{let n=mr(e,t.v,r),i=mr(e,t.w,r);if(n&&i&&n!==i){let r=`${n}\0${i}`;c.has(r)||(c.add(r),o.setEdge(n,i,{...e.edge(t)}))}}),hr(o,t,n);let l=Er(o);gr(l,t,n,null),_r(o,l);let u=1/0,d=1/0,f=-1/0,p=-1/0;o.nodes().forEach(e=>{if(e===r)return;let t=o.node(e);t&&typeof t.x==`number`&&typeof t.y==`number`&&typeof t.width==`number`&&typeof t.height==`number`&&(u=Math.min(u,t.x-t.width/2),f=Math.max(f,t.x+t.width/2),d=Math.min(d,t.y-t.height/2),p=Math.max(p,t.y+t.height/2))}),(!isFinite(u)||!isFinite(d)||!isFinite(f)||!isFinite(p))&&(u=d=0,f=p=0);let m=f-u,h=p-d;i[r]={minX:u,minY:d,maxX:f,maxY:p,width:m,height:h,offsetX:u,offsetY:d},a._dagreClusterSubgraph=o}});let a=[],o=t=>{let n=[],r=(e.children(t)||[]).filter(e=>e!==t);for(;r.length>0;){let t=r.shift();n.push(t),(e.children(t)||[]).filter(e=>e!==t).forEach(e=>r.push(e))}return n},s=/* @__PURE__ */ new Map;r.forEach(t=>{let n=e.node(t);n&&n.rankdir&&i[t]&&s.set(t,(e.children(t)||[]).filter(e=>e!==t))});let c=new Set([...s.values()].flat()),l=/* @__PURE__ */ new Map;s.forEach((e,t)=>{c.has(t)||l.set(t,o(t))});let u=new Set([...l.values()].flat()),d=e=>{for(let[t,n]of l)if(n.includes(e))return t;return e},f=[];e.edges().forEach(t=>{(u.has(t.v)||u.has(t.w))&&f.push({edge:t,label:e.edge(t)})});let p=/* @__PURE__ */ new Map;u.forEach(t=>{let n=e.parent(t);p.set(t,typeof n==`string`?n:void 0)}),l.forEach((t,n)=>{let r=e.node(n),o=[];t.forEach(t=>{let n=e.node(t);n&&(o.push({id:t,node:n,parent:p.get(t)}),e.removeNode(t))});let s=f.filter(({edge:e})=>t.includes(e.v)||t.includes(e.w)),c=i[n];r&&(a.push({clusterId:n,subgraph:r._dagreClusterSubgraph,bounds:c,children:t,removedNodes:o,removedEdges:s}),r.width=c.width,r.height=c.height)});let m=/* @__PURE__ */ new Set;f.forEach(({edge:t,label:n})=>{let r=d(t.v),i=d(t.w);if(r!==i&&e.hasNode(r)&&e.hasNode(i)){let t=`${r}\0${i}`;m.has(t)||(m.add(t),e.setEdge(r,i,{...n,width:0,height:0}))}});let h=Er(e),g=gr(h,t,n,fr.get(e)??null);fr.set(e,g),_r(e,h),m.forEach(t=>{let n=t.indexOf(`\0`),r=t.slice(0,n),i=t.slice(n+1);e.hasEdge(r,i)&&e.removeEdge(r,i)}),a.forEach(({clusterId:t,subgraph:n,bounds:r,removedNodes:i,removedEdges:a})=>{let o=e.node(t),s=o?.x??0,c=o?.y??0,l=(r.minX+r.maxX)/2,u=(r.minY+r.maxY)/2;i.forEach(({id:t,node:n,parent:r})=>{e.setNode(t,n),r!==void 0&&e.setParent(t,r)}),a.forEach(({edge:t,label:n})=>{e.setEdge(t,n)}),n.nodes().forEach(r=>{if(r===t)return;let i=n.node(r),a=e.node(r);a&&i&&typeof i.x==`number`&&typeof i.y==`number`&&(a.x=s+(i.x-l),a.y=c+(i.y-u))}),delete o._dagreClusterSubgraph}),r.forEach(t=>{let n=e.node(t),r=i[t];if(n&&n.rankdir&&n._dagreClusterSubgraph&&r){let i=n._dagreClusterSubgraph,a=n.x??0,o=n.y??0,s=(r.minX+r.maxX)/2,c=(r.minY+r.maxY)/2;i.nodes().forEach(n=>{if(n===t)return;let r=i.node(n),l=e.node(n);if(l&&r&&typeof r.x==`number`&&typeof r.y==`number`){let e=r.x-s,t=r.y-c;l.x=a+e,l.y=o+t}}),delete n._dagreClusterSubgraph}})}function gr(e,t,n,r=null){var i,a;let o=n?.useDynamic!==!1,s=o&&(i=r?.graph)!=null?i:null,c=o&&(a=r?.rawNodes)!=null?a:null;t(` makeSpaceForEdgeLabels`,()=>Dr(e)),t(` removeSelfEdges`,()=>Ir(e)),t(` acyclic`,()=>At(e,s)),t(` nestingGraph.run`,()=>pn(e)),t(` rank`,()=>rn(tt(e))),t(` injectEdgeLabelProxies`,()=>Or(e)),t(` removeEmptyRanks`,()=>at(e)),t(` nestingGraph.cleanup`,()=>_n(e)),t(` normalizeRanks`,()=>it(e)),t(` assignRankMinMax`,()=>kr(e)),t(` removeEdgeLabelProxies`,()=>Ar(e)),t(` normalize.run`,()=>Pt(e)),t(` parentDummyChains`,()=>ln(e)),t(` addBorderSegments`,()=>vn(e)),t(` order`,()=>Gn(e,n,c)),t(` insertSelfEdges`,()=>Lr(e)),t(` adjustCoordinateSystem`,()=>xn(e)),t(` position`,()=>ur(e,n.corePath)),t(` positionSelfEdges`,()=>Rr(e));let l=JSON.parse(JSON.stringify(e._nodes));return t(` removeBorderNodes`,()=>Fr(e)),t(` normalize.undo`,()=>It(e)),t(` fixupEdgeLabelCoords`,()=>Nr(e)),t(` undoCoordinateSystem`,()=>Sn(e)),t(` translateGraph`,()=>jr(e)),t(` assignNodeIntersects`,()=>Mr(e)),t(` reversePoints`,()=>Pr(e)),t(` acyclic.undo`,()=>Mt(e)),{graph:e,rawNodes:l}}function _r(e,t){e.nodes().forEach(n=>{let r=e.node(n),i=t.node(n);r&&(r.x=i.x,r.y=i.y,r.order=i.order,r.rank=i.rank,t.children(n).length&&(r.width=i.width,r.height=i.height))}),e.edges().forEach(n=>{let r=e.edge(n),i=t.edge(n);r.points=i.points,Object.hasOwn(i,`x`)&&(r.x=i.x,r.y=i.y)}),e.graph().width=t.graph().width,e.graph().height=t.graph().height}var vr=[`nodesep`,`edgesep`,`ranksep`,`marginx`,`marginy`],yr={ranksep:50,edgesep:20,nodesep:50,rankdir:`TB`,rankalign:`center`},br=[`acyclicer`,`ranker`,`rankdir`,`align`,`rankalign`],xr=[`width`,`height`,`rank`],Sr={width:0,height:0},Cr=[`minlen`,`weight`,`width`,`height`,`labeloffset`],wr={minlen:1,weight:1,width:0,height:0,labeloffset:10,labelpos:`r`},Tr=[`labelpos`];function Er(e){let t=new j({multigraph:!0,compound:!0}),n=Br(e.graph());return t.setGraph(Object.assign({},yr,zr(n,vr),mt(n,br))),e.nodes().forEach(n=>{let r=zr(Br(e.node(n)),xr);Object.keys(Sr).forEach(e=>{r[e]===void 0&&(r[e]=Sr[e])}),t.setNode(n,r);let i=e.parent(n);i!==void 0&&t.setParent(n,i)}),e.edges().forEach(n=>{let r=Br(e.edge(n));t.setEdge(n,Object.assign({},wr,zr(r,Cr),mt(r,Tr)))}),t}function Dr(e){let t=e.graph();t.ranksep/=2,e.edges().forEach(n=>{let r=e.edge(n);r.minlen*=2,(r.labelpos??`r`).toLowerCase()!==`c`&&(t.rankdir===`TB`||t.rankdir===`BT`?r.width+=r.labeloffset:r.height+=r.labeloffset)})}function Or(e){e.edges().forEach(t=>{let n=e.edge(t);if(n.width&&n.height){let n=e.node(t.v);M(e,`edge-proxy`,{rank:(e.node(t.w).rank-n.rank)/2+n.rank,e:t},`_ep`)}})}function kr(e){let t=0;e.nodes().forEach(n=>{let r=e.node(n);r.borderTop&&(r.minRank=e.node(r.borderTop).rank,r.maxRank=e.node(r.borderBottom).rank,t=Math.max(t,r.maxRank))}),e.graph().maxRank=t}function Ar(e){e.nodes().forEach(t=>{let n=e.node(t);if(n.dummy===`edge-proxy`){let r=n;e.edge(r.e).labelRank=n.rank,e.removeNode(t)}})}function jr(e){let t=1/0,n=0,r=1/0,i=0,a=e.graph(),o=a.marginx||0,s=a.marginy||0;function c(e){let a=e.x,o=e.y,s=e.width,c=e.height;t=Math.min(t,a-s/2),n=Math.max(n,a+s/2),r=Math.min(r,o-c/2),i=Math.max(i,o+c/2)}e.nodes().forEach(t=>c(e.node(t))),e.edges().forEach(t=>{let n=e.edge(t);Object.hasOwn(n,`x`)&&c(n)}),t-=o,r-=s,e.nodes().forEach(n=>{let i=e.node(n);i.x-=t,i.y-=r}),e.edges().forEach(n=>{let i=e.edge(n);i.points.forEach(e=>{e.x-=t,e.y-=r}),Object.hasOwn(i,`x`)&&(i.x-=t),Object.hasOwn(i,`y`)&&(i.y-=r)}),a.width=n-t+o,a.height=i-r+s}function Mr(e){e.edges().forEach(t=>{if(t.v===t.w)return;let n=e.edge(t),r=e.node(t.v),i=e.node(t.w),a,o;n.points?(a=n.points[0],o=n.points[n.points.length-1]):(n.points=[],a=i,o=r),n.points.unshift(nt(r,a)),n.points.push(nt(i,o))})}function Nr(e){e.edges().forEach(t=>{let n=e.edge(t);if(Object.hasOwn(n,`x`))switch((n.labelpos===`l`||n.labelpos===`r`)&&(n.width-=n.labeloffset),n.labelpos){case`l`:n.x-=n.width/2+n.labeloffset;break;case`r`:n.x+=n.width/2+n.labeloffset}})}function Pr(e){e.edges().forEach(t=>{let n=e.edge(t);n.reversed&&n.points.reverse()})}function Fr(e){e.nodes().forEach(t=>{if(e.children(t).length){let n=e.node(t),r=e.node(n.borderTop),i=e.node(n.borderBottom),a=e.node(n.borderLeft[n.borderLeft.length-1]),o=e.node(n.borderRight[n.borderRight.length-1]);n.width=Math.abs(o.x-a.x),n.height=Math.abs(i.y-r.y),n.x=a.x+n.width/2,n.y=r.y+n.height/2}}),e.nodes().forEach(t=>{e.node(t).dummy===`border`&&e.removeNode(t)})}function Ir(e){e.edges().forEach(t=>{if(t.v===t.w){let n=e.node(t.v);n.selfEdges||=[],n.selfEdges.push({e:t,label:e.edge(t)}),e.removeEdge(t)}})}function Lr(e){rt(e).forEach(t=>{let n=0;t.forEach((t,r)=>{let i=e.node(t);typeof i.rank!=`number`&&(i.rank=0),i.order=r+n,(i.selfEdges||[]).forEach(t=>{M(e,`selfedge`,{width:t.label.width,height:t.label.height,rank:i.rank,order:r+ ++n,e:t.e,edgeLabel:t.label},`_se`),(!Array.isArray(t.label.points)||t.label.points.length!==7)&&(t.label.points=[{x:0,y:-10},{x:0,y:-10},{x:0,y:0},{x:0,y:10},{x:0,y:10},{x:0,y:0},{x:0,y:0}])}),delete i.selfEdges})})}function Rr(e){e.nodes().forEach(t=>{let n=e.node(t),r=e=>typeof e==`number`&&isFinite(e);if(n.dummy===`selfedge`){let i=n,a=e.node(i.e.v),o=r(a?.x)?a.x:0,s=r(a?.y)?a.y:0,c=r(a?.width)?a.width:0,l=r(a?.height)?a.height:0,u=r(n.x)?n.x:o,d=r(n.y)?n.y:s,f=c/2,p=l/2;i.edgeLabel.points=[{x:u+f,y:d-p},{x:u+f,y:d-p},{x:u,y:d},{x:u-f,y:d+p},{x:u-f,y:d+p},{x:u,y:d},{x:u,y:d}],i.edgeLabel.x=u,i.edgeLabel.y=d,e.setEdge(i.e,i.edgeLabel),e.removeNode(t)}else n&&Array.isArray(n.selfEdges)&&n.selfEdges.forEach(e=>{if(!Array.isArray(e.label.points)||e.label.points.length!==7){let t=r(n.x)?n.x:0,i=r(n.y)?n.y:0,a=r(n.width)?n.width:0,o=r(n.height)?n.height:0,s=a/2,c=o/2;e.label.points=[{x:t+s,y:i-c},{x:t+s,y:i-c},{x:t,y:i},{x:t-s,y:i+c},{x:t-s,y:i+c},{x:t,y:i},{x:t,y:i}]}})})}function zr(e,t){return ht(mt(e,t),Number)}function Br(e){let t={};return e&&Object.entries(e).forEach(([e,n])=>{typeof e==`string`&&(e=e.toLowerCase()),t[e]=n}),t}function Vr(e,t){var n,r=1;e??=0,t??=0;function i(){var i,a=n.length,o,s=0,c=0;for(i=0;i<a;++i)o=n[i],s+=o.x,c+=o.y;for(s=(s/a-e)*r,c=(c/a-t)*r,i=0;i<a;++i)o=n[i],o.x-=s,o.y-=c}return i.initialize=function(e){n=e},i.x=function(t){return arguments.length?(e=+t,i):e},i.y=function(e){return arguments.length?(t=+e,i):t},i.strength=function(e){return arguments.length?(r=+e,i):r},i}function Hr(e){let t=+this._x.call(null,e),n=+this._y.call(null,e);return Ur(this.cover(t,n),t,n,e)}function Ur(e,t,n,r){if(isNaN(t)||isNaN(n))return e;var i,a=e._root,o={data:r},s=e._x0,c=e._y0,l=e._x1,u=e._y1,d,f,p,m,h,g,_,v;if(!a)return e._root=o,e;for(;a.length;)if((h=t>=(d=(s+l)/2))?s=d:l=d,(g=n>=(f=(c+u)/2))?c=f:u=f,i=a,!(a=a[_=g<<1|h]))return i[_]=o,e;if(p=+e._x.call(null,a.data),m=+e._y.call(null,a.data),t===p&&n===m)return o.next=a,i?i[_]=o:e._root=o,e;do i=i?i[_]=[,,,,]:e._root=[,,,,],(h=t>=(d=(s+l)/2))?s=d:l=d,(g=n>=(f=(c+u)/2))?c=f:u=f;while((_=g<<1|h)==(v=(m>=f)<<1|p>=d));return i[v]=a,i[_]=o,e}function Wr(e){var t,n,r=e.length,i,a,o=Array(r),s=Array(r),c=1/0,l=1/0,u=-1/0,d=-1/0;for(n=0;n<r;++n)isNaN(i=+this._x.call(null,t=e[n]))||isNaN(a=+this._y.call(null,t))||(o[n]=i,s[n]=a,i<c&&(c=i),i>u&&(u=i),a<l&&(l=a),a>d&&(d=a));if(c>u||l>d)return this;for(this.cover(c,l).cover(u,d),n=0;n<r;++n)Ur(this,o[n],s[n],e[n]);return this}function Gr(e,t){if(isNaN(e=+e)||isNaN(t=+t))return this;var n=this._x0,r=this._y0,i=this._x1,a=this._y1;if(isNaN(n))i=(n=Math.floor(e))+1,a=(r=Math.floor(t))+1;else{for(var o=i-n||1,s=this._root,c,l;n>e||e>=i||r>t||t>=a;)switch(l=(t<r)<<1|e<n,c=[,,,,],c[l]=s,s=c,o*=2,l){case 0:i=n+o,a=r+o;break;case 1:n=i-o,a=r+o;break;case 2:i=n+o,r=a-o;break;case 3:n=i-o,r=a-o}this._root&&this._root.length&&(this._root=s)}return this._x0=n,this._y0=r,this._x1=i,this._y1=a,this}function Kr(){var e=[];return this.visit(function(t){if(!t.length)do e.push(t.data);while(t=t.next)}),e}function qr(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 L(e,t,n,r,i){this.node=e,this.x0=t,this.y0=n,this.x1=r,this.y1=i}function Jr(e,t,n){var r,i=this._x0,a=this._y0,o,s,c,l,u=this._x1,d=this._y1,f=[],p=this._root,m,h;for(p&&f.push(new L(p,i,a,u,d)),n==null?n=1/0:(i=e-n,a=t-n,u=e+n,d=t+n,n*=n);m=f.pop();)if(!(!(p=m.node)||(o=m.x0)>u||(s=m.y0)>d||(c=m.x1)<i||(l=m.y1)<a)){if(p.length){var g=(o+c)/2,_=(s+l)/2;f.push(new L(p[3],g,_,c,l),new L(p[2],o,_,g,l),new L(p[1],g,s,c,_),new L(p[0],o,s,g,_)),(h=(t>=_)<<1|e>=g)&&(m=f[f.length-1],f[f.length-1]=f[f.length-1-h],f[f.length-1-h]=m)}else{var v=e-+this._x.call(null,p.data),y=t-+this._y.call(null,p.data),b=v*v+y*y;if(b<n){var x=Math.sqrt(n=b);i=e-x,a=t-x,u=e+x,d=t+x,r=p.data}}}return r}function Yr(e){if(isNaN(u=+this._x.call(null,e))||isNaN(d=+this._y.call(null,e)))return this;var t,n=this._root,r,i,a,o=this._x0,s=this._y0,c=this._x1,l=this._y1,u,d,f,p,m,h,g,_;if(!n)return this;if(n.length)for(;;){if((m=u>=(f=(o+c)/2))?o=f:c=f,(h=d>=(p=(s+l)/2))?s=p:l=p,t=n,!(n=n[g=h<<1|m]))return this;if(!n.length)break;(t[g+1&3]||t[g+2&3]||t[g+3&3])&&(r=t,_=g)}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):t?(a?t[g]=a:delete t[g],(n=t[0]||t[1]||t[2]||t[3])&&n===(t[3]||t[2]||t[1]||t[0])&&!n.length&&(r?r[_]=n:this._root=n),this):(this._root=a,this)}function Xr(e){for(var t=0,n=e.length;t<n;++t)this.remove(e[t]);return this}function Zr(){return this._root}function Qr(){var e=0;return this.visit(function(t){if(!t.length)do++e;while(t=t.next)}),e}function $r(e){var t=[],n,r=this._root,i,a,o,s,c;for(r&&t.push(new L(r,this._x0,this._y0,this._x1,this._y1));n=t.pop();)if(!e(r=n.node,a=n.x0,o=n.y0,s=n.x1,c=n.y1)&&r.length){var l=(a+s)/2,u=(o+c)/2;(i=r[3])&&t.push(new L(i,l,u,s,c)),(i=r[2])&&t.push(new L(i,a,u,l,c)),(i=r[1])&&t.push(new L(i,l,o,s,u)),(i=r[0])&&t.push(new L(i,a,o,l,u))}return this}function ei(e){var t=[],n=[],r;for(this._root&&t.push(new L(this._root,this._x0,this._y0,this._x1,this._y1));r=t.pop();){var i=r.node;if(i.length){var a,o=r.x0,s=r.y0,c=r.x1,l=r.y1,u=(o+c)/2,d=(s+l)/2;(a=i[0])&&t.push(new L(a,o,s,u,d)),(a=i[1])&&t.push(new L(a,u,s,c,d)),(a=i[2])&&t.push(new L(a,o,d,u,l)),(a=i[3])&&t.push(new L(a,u,d,c,l))}n.push(r)}for(;r=n.pop();)e(r.node,r.x0,r.y0,r.x1,r.y1);return this}function ti(e){return e[0]}function ni(e){return arguments.length?(this._x=e,this):this._x}function ri(e){return e[1]}function ii(e){return arguments.length?(this._y=e,this):this._y}function ai(e,t,n){var r=new oi(t??ti,n??ri,NaN,NaN,NaN,NaN);return e==null?r:r.addAll(e)}function oi(e,t,n,r,i,a){this._x=e,this._y=t,this._x0=n,this._y0=r,this._x1=i,this._y1=a,this._root=void 0}function si(e){for(var t={data:e.data},n=t;e=e.next;)n=n.next={data:e.data};return t}var R=ai.prototype=oi.prototype;R.copy=function(){var e=new oi(this._x,this._y,this._x0,this._y0,this._x1,this._y1),t=this._root,n,r;if(!t)return e;if(!t.length)return e._root=si(t),e;for(n=[{source:t,target:e._root=[,,,,]}];t=n.pop();)for(var i=0;i<4;++i)(r=t.source[i])&&(r.length?n.push({source:r,target:t.target[i]=[,,,,]}):t.target[i]=si(r));return e},R.add=Hr,R.addAll=Wr,R.cover=Gr,R.data=Kr,R.extent=qr,R.find=Jr,R.remove=Yr,R.removeAll=Xr,R.root=Zr,R.size=Qr,R.visit=$r,R.visitAfter=ei,R.x=ni,R.y=ii;function z(e){return function(){return e}}function B(e){return(e()-.5)*1e-6}function ci(e){return e.x+e.vx}function li(e){return e.y+e.vy}function ui(e){var t,n,r,i=1,a=1;typeof e!=`function`&&(e=z(e==null?1:+e));function o(){for(var e,o=t.length,c,l,u,d,f,p,m=0;m<a;++m)for(c=ai(t,ci,li).visitAfter(s),e=0;e<o;++e)l=t[e],f=n[l.index],p=f*f,u=l.x+l.vx,d=l.y+l.vy,c.visit(h);function h(e,t,n,a,o){var s=e.data,c=e.r,m=f+c;if(s){if(s.index>l.index){var h=u-s.x-s.vx,g=d-s.y-s.vy,_=h*h+g*g;_<m*m&&(h===0&&(h=B(r),_+=h*h),g===0&&(g=B(r),_+=g*g),_=(m-(_=Math.sqrt(_)))/_*i,l.vx+=(h*=_)*(m=(c*=c)/(p+c)),l.vy+=(g*=_)*m,s.vx-=h*(m=1-m),s.vy-=g*m)}}else return t>u+m||a<u-m||n>d+m||o<d-m}}function s(e){if(e.data)return e.r=n[e.data.index];for(var t=e.r=0;t<4;++t)e[t]&&e[t].r>e.r&&(e.r=e[t].r)}function c(){if(t){var r,i=t.length,a;for(n=Array(i),r=0;r<i;++r)a=t[r],n[a.index]=+e(a,r,t)}}return o.initialize=function(e,n){t=e,r=n,c()},o.iterations=function(e){return arguments.length?(a=+e,o):a},o.strength=function(e){return arguments.length?(i=+e,o):i},o.radius=function(t){return arguments.length?(e=typeof t==`function`?t:z(+t),c(),o):e},o}function di(e){return e.index}function fi(e,t){var n=e.get(t);if(!n)throw Error(`node not found: `+t);return n}function pi(e){var t=di,n=d,r,i=z(30),a,o,s,c,l,u=1;e??=[];function d(e){return 1/Math.min(s[e.source.index],s[e.target.index])}function f(t){for(var n=0,i=e.length;n<u;++n)for(var o=0,s,d,f,p,m,h,g;o<i;++o)s=e[o],d=s.source,f=s.target,p=f.x+f.vx-d.x-d.vx||B(l),m=f.y+f.vy-d.y-d.vy||B(l),h=Math.sqrt(p*p+m*m),h=(h-a[o])/h*t*r[o],p*=h,m*=h,f.vx-=p*(g=c[o]),f.vy-=m*g,d.vx+=p*(g=1-g),d.vy+=m*g}function p(){if(o){var n,i=o.length,l=e.length,u=new Map(o.map((e,n)=>[t(e,n,o),e])),d;for(n=0,s=Array(i);n<l;++n)d=e[n],d.index=n,typeof d.source!=`object`&&(d.source=fi(u,d.source)),typeof d.target!=`object`&&(d.target=fi(u,d.target)),s[d.source.index]=(s[d.source.index]||0)+1,s[d.target.index]=(s[d.target.index]||0)+1;for(n=0,c=Array(l);n<l;++n)d=e[n],c[n]=s[d.source.index]/(s[d.source.index]+s[d.target.index]);r=Array(l),m(),a=Array(l),h()}}function m(){if(o)for(var t=0,i=e.length;t<i;++t)r[t]=+n(e[t],t,e)}function h(){if(o)for(var t=0,n=e.length;t<n;++t)a[t]=+i(e[t],t,e)}return f.initialize=function(e,t){o=e,l=t,p()},f.links=function(t){return arguments.length?(e=t,p(),f):e},f.id=function(e){return arguments.length?(t=e,f):t},f.iterations=function(e){return arguments.length?(u=+e,f):u},f.strength=function(e){return arguments.length?(n=typeof e==`function`?e:z(+e),m(),f):n},f.distance=function(e){return arguments.length?(i=typeof e==`function`?e:z(+e),h(),f):i},f}var mi={value:()=>{}};function hi(){for(var e=0,t=arguments.length,n={},r;e<t;++e){if(!(r=arguments[e]+``)||r in n||/[\s.]/.test(r))throw Error(`illegal type: `+r);n[r]=[]}return new gi(n)}function gi(e){this._=e}function _i(e,t){return e.trim().split(/^|\s+/).map(function(e){var n=``,r=e.indexOf(`.`);if(r>=0&&(n=e.slice(r+1),e=e.slice(0,r)),e&&!t.hasOwnProperty(e))throw Error(`unknown type: `+e);return{type:e,name:n}})}gi.prototype=hi.prototype={constructor:gi,on:function(e,t){var n=this._,r=_i(e+``,n),i,a=-1,o=r.length;if(arguments.length<2){for(;++a<o;)if((i=(e=r[a]).type)&&(i=vi(n[i],e.name)))return i}else{if(t!=null&&typeof t!=`function`)throw Error(`invalid callback: `+t);for(;++a<o;)if(i=(e=r[a]).type)n[i]=yi(n[i],e.name,t);else if(t==null)for(i in n)n[i]=yi(n[i],e.name,null);return this}},copy:function(){var e={},t=this._;for(var n in t)e[n]=t[n].slice();return new gi(e)},call:function(e,t){if((i=arguments.length-2)>0)for(var n=Array(i),r=0,i,a;r<i;++r)n[r]=arguments[r+2];if(!this._.hasOwnProperty(e))throw Error(`unknown type: `+e);for(a=this._[e],r=0,i=a.length;r<i;++r)a[r].value.apply(t,n)},apply:function(e,t,n){if(!this._.hasOwnProperty(e))throw Error(`unknown type: `+e);for(var r=this._[e],i=0,a=r.length;i<a;++i)r[i].value.apply(t,n)}};function vi(e,t){for(var n=0,r=e.length,i;n<r;++n)if((i=e[n]).name===t)return i.value}function yi(e,t,n){for(var r=0,i=e.length;r<i;++r)if(e[r].name===t){e[r]=mi,e=e.slice(0,r).concat(e.slice(r+1));break}return n!=null&&e.push({name:t,value:n}),e}var V=0,bi=0,xi=0,Si=1e3,Ci,H,wi=0,U=0,Ti=0,W=typeof performance==`object`&&performance.now?performance:Date,Ei=typeof window==`object`&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(e){setTimeout(e,17)};function Di(){return U||=(Ei(Oi),W.now()+Ti)}function Oi(){U=0}function ki(){this._call=this._time=this._next=null}ki.prototype=Ai.prototype={constructor:ki,restart:function(e,t,n){if(typeof e!=`function`)throw TypeError(`callback is not a function`);n=(n==null?Di():+n)+(t==null?0:+t),!this._next&&H!==this&&(H?H._next=this:Ci=this,H=this),this._call=e,this._time=n,Fi()},stop:function(){this._call&&(this._call=null,this._time=1/0,Fi())}};function Ai(e,t,n){var r=new ki;return r.restart(e,t,n),r}function ji(){Di(),++V;for(var e=Ci,t;e;)(t=U-e._time)>=0&&e._call.call(void 0,t),e=e._next;--V}function Mi(){U=(wi=W.now())+Ti,V=bi=0;try{ji()}finally{V=0,Pi(),U=0}}function Ni(){var e=W.now(),t=e-wi;t>Si&&(Ti-=t,wi=e)}function Pi(){for(var e,t=Ci,n,r=1/0;t;)t._call?(r>t._time&&(r=t._time),e=t,t=t._next):(n=t._next,t._next=null,t=e?e._next=n:Ci=n);H=e,Fi(r)}function Fi(e){V||(bi&&=clearTimeout(bi),e-U>24?(e<1/0&&(bi=setTimeout(Mi,e-W.now()-Ti)),xi&&=clearInterval(xi)):(xi||=(wi=W.now(),setInterval(Ni,Si)),V=1,Ei(Mi)))}var Ii=1664525,Li=1013904223,Ri=4294967296;function zi(){let e=1;return()=>(e=(Ii*e+Li)%Ri)/Ri}function Bi(e){return e.x}function Vi(e){return e.y}var Hi=10,Ui=Math.PI*(3-Math.sqrt(5));function Wi(e){var t,n=1,r=.001,i=1-r**(1/300),a=0,o=.6,s=/* @__PURE__ */ new Map,c=Ai(d),l=hi(`tick`,`end`),u=zi();e??=[];function d(){f(),l.call(`tick`,t),n<r&&(c.stop(),l.call(`end`,t))}function f(r){var c,l=e.length,u;r===void 0&&(r=1);for(var d=0;d<r;++d)for(n+=(a-n)*i,s.forEach(function(e){e(n)}),c=0;c<l;++c)u=e[c],u.fx==null?u.x+=u.vx*=o:(u.x=u.fx,u.vx=0),u.fy==null?u.y+=u.vy*=o:(u.y=u.fy,u.vy=0);return t}function p(){for(var t=0,n=e.length,r;t<n;++t){if(r=e[t],r.index=t,r.fx!=null&&(r.x=r.fx),r.fy!=null&&(r.y=r.fy),isNaN(r.x)||isNaN(r.y)){var i=Hi*Math.sqrt(.5+t),a=t*Ui;r.x=i*Math.cos(a),r.y=i*Math.sin(a)}(isNaN(r.vx)||isNaN(r.vy))&&(r.vx=r.vy=0)}}function m(t){return t.initialize&&t.initialize(e,u),t}return p(),t={tick:f,restart:function(){return c.restart(d),t},stop:function(){return c.stop(),t},nodes:function(n){return arguments.length?(e=n,p(),s.forEach(m),t):e},alpha:function(e){return arguments.length?(n=+e,t):n},alphaMin:function(e){return arguments.length?(r=+e,t):r},alphaDecay:function(e){return arguments.length?(i=+e,t):+i},alphaTarget:function(e){return arguments.length?(a=+e,t):a},velocityDecay:function(e){return arguments.length?(o=1-e,t):1-o},randomSource:function(e){return arguments.length?(u=e,s.forEach(m),t):u},force:function(e,n){return arguments.length>1?(n==null?s.delete(e):s.set(e,m(n)),t):s.get(e)},find:function(t,n,r){var i=0,a=e.length,o,s,c,l,u;for(r==null?r=1/0:r*=r,i=0;i<a;++i)l=e[i],o=t-l.x,s=n-l.y,c=o*o+s*s,c<r&&(u=l,r=c);return u},on:function(e,n){return arguments.length>1?(l.on(e,n),t):l.on(e)}}}function Gi(){var e,t,n,r,i=z(-30),a,o=1,s=1/0,c=.81;function l(n){var i,a=e.length,o=ai(e,Bi,Vi).visitAfter(d);for(r=n,i=0;i<a;++i)t=e[i],o.visit(f)}function u(){if(e){var t,n=e.length,r;for(a=Array(n),t=0;t<n;++t)r=e[t],a[r.index]=+i(r,t,e)}}function d(e){var t=0,n,r,i=0,o,s,c;if(e.length){for(o=s=c=0;c<4;++c)(n=e[c])&&(r=Math.abs(n.value))&&(t+=n.value,i+=r,o+=r*n.x,s+=r*n.y);e.x=o/i,e.y=s/i}else{n=e,n.x=n.data.x,n.y=n.data.y;do t+=a[n.data.index];while(n=n.next)}e.value=t}function f(e,i,l,u){if(!e.value)return!0;var d=e.x-t.x,f=e.y-t.y,p=u-i,m=d*d+f*f;if(p*p/c<m)return m<s&&(d===0&&(d=B(n),m+=d*d),f===0&&(f=B(n),m+=f*f),m<o&&(m=Math.sqrt(o*m)),t.vx+=d*e.value*r/m,t.vy+=f*e.value*r/m),!0;if(!(e.length||m>=s)){(e.data!==t||e.next)&&(d===0&&(d=B(n),m+=d*d),f===0&&(f=B(n),m+=f*f),m<o&&(m=Math.sqrt(o*m)));do e.data!==t&&(p=a[e.data.index]*r/m,t.vx+=d*p,t.vy+=f*p);while(e=e.next)}}return l.initialize=function(t,r){e=t,n=r,u()},l.strength=function(e){return arguments.length?(i=typeof e==`function`?e:z(+e),u(),l):i},l.distanceMin=function(e){return arguments.length?(o=e*e,l):Math.sqrt(o)},l.distanceMax=function(e){return arguments.length?(s=e*e,l):Math.sqrt(s)},l.theta=function(e){return arguments.length?(c=e*e,l):Math.sqrt(c)},l}function Ki(e){var t=z(.1),n,r,i;typeof e!=`function`&&(e=z(e==null?0:+e));function a(e){for(var t=0,a=n.length,o;t<a;++t)o=n[t],o.vx+=(i[t]-o.x)*r[t]*e}function o(){if(n){var a,o=n.length;for(r=Array(o),i=Array(o),a=0;a<o;++a)r[a]=isNaN(i[a]=+e(n[a],a,n))?0:+t(n[a],a,n)}}return a.initialize=function(e){n=e,o()},a.strength=function(e){return arguments.length?(t=typeof e==`function`?e:z(+e),o(),a):t},a.x=function(t){return arguments.length?(e=typeof t==`function`?t:z(+t),o(),a):e},a}function qi(e){var t=z(.1),n,r,i;typeof e!=`function`&&(e=z(e==null?0:+e));function a(e){for(var t=0,a=n.length,o;t<a;++t)o=n[t],o.vy+=(i[t]-o.y)*r[t]*e}function o(){if(n){var a,o=n.length;for(r=Array(o),i=Array(o),a=0;a<o;++a)r[a]=isNaN(i[a]=+e(n[a],a,n))?0:+t(n[a],a,n)}}return a.initialize=function(e){n=e,o()},a.strength=function(e){return arguments.length?(t=typeof e==`function`?e:z(+e),o(),a):t},a.y=function(t){return arguments.length?(e=typeof t==`function`?t:z(+t),o(),a):e},a}var Ji=32,Yi=72,Xi=16,Zi=170,Qi=-900,$i=300,ea=120,ta=200,na=96,ra=1.3;function ia(e,t){let n=new ge.Graph({multigraph:!0});n.setGraph({rankdir:t,nodesep:Ji,ranksep:Yi,edgesep:Xi}),n.setDefaultEdgeLabel(()=>({}));for(let t of e.nodes)n.setNode(t.id,{width:t.width,height:t.height});e.edges.forEach((e,t)=>n.setEdge(e.from,e.to,{},`e${t}`)),pr(n);let r={};for(let t of e.nodes){let{x:e=0,y:i=0}=n.node(t.id);r[t.id]={x:e,y:i}}return{positions:r,routes:e.edges.map((e,t)=>(n.edge(e.from,e.to,`e${t}`).points??[]).map(({x:e,y:t})=>({x:e,y:t})))}}function aa(e){let{previous:t}=e,n=new Map(e.nodes.map(e=>[e.id,[]]));for(let t of e.edges)n.get(t.from)?.push(t.to),n.get(t.to)?.push(t.from);let r=e.nodes.map((e,r)=>{let i=t?.[e.id];if(i)return{id:e.id,x:i.x,y:i.y,fx:i.x,fy:i.y};let a=t&&n.get(e.id)?.find(e=>t[e]);if(a){let n=r*2.4;return{id:e.id,x:t[a].x+ea*Math.cos(n),y:t[a].y+ea*Math.sin(n)}}return{id:e.id}}),i=Math.max(0,...e.nodes.map(e=>Math.hypot(e.width,e.height)/2)),a=e.edges.map(e=>({source:e.from,target:e.to})),o=Wi(r).force(`link`,pi(a).id(e=>e.id).distance(Zi)).force(`charge`,Gi().strength(Qi)).force(`collide`,ui(i+Xi)).force(`x`,Ki(0).strength(.02)).force(`y`,qi(0).strength(.02)).stop();t||o.force(`center`,Vr(0,0)),o.tick($i);let s={};for(let e of r)s[e.id]={x:e.x??0,y:e.y??0};return{positions:s}}function oa(e){let t=e.nodes.map(e=>e.id),n=e.centre&&t.includes(e.centre)?e.centre:t[0],r={};if(!n)return{positions:r};let i=new Map(t.map(e=>[e,[]]));for(let t of e.edges)i.get(t.from)?.push(t.to),i.get(t.to)?.push(t.from);let a=/* @__PURE__ */ new Map([[n,0]]),o=/* @__PURE__ */ new Map,s=[n];for(let e=0;e<s.length;e++){let t=s[e];for(let e of i.get(t)??[])a.has(e)||(a.set(e,a.get(t)+1),o.set(e,t),s.push(e))}for(let e of t)a.has(e)||(a.set(e,1),o.set(e,n),s.push(e));let c=[];for(let e of s)(c[a.get(e)]??=[]).push(e);let l=/* @__PURE__ */ new Map([[n,0]]);r[n]={x:0,y:0};let u=0;for(let e=1;e<c.length;e++){let t=c[e]??[],n=t.length;if(n){if(u=Math.max(u+ta,n*na/Math.PI),e===1)t.forEach((e,t)=>l.set(e,-Math.PI/2+t*2*Math.PI/n));else{let e=/* @__PURE__ */ new Map;for(let n of t){let t=o.get(n);e.set(t,[...e.get(t)??[],n])}let r=[...e.keys()].sort((e,t)=>l.get(e)-l.get(t)),i=r.flatMap(t=>e.get(t)),a=Math.min(2*Math.PI/n,ta*1.2/u),s=e.get(r[0]).length,c=l.get(r[0])-(s-1)/2*a;i.forEach((e,t)=>l.set(e,c+t*a))}for(let e of t){let t=l.get(e);r[e]={x:u*ra*Math.cos(t),y:u*Math.sin(t)}}}}return{positions:r}}function sa(e){switch(e.kind){case`layered-right`:return ia(e,`LR`);case`layered-down`:return ia(e,`TB`);case`radial`:return oa(e);default:return aa(e)}}function ca(e,t){return`groep:${e}:${t}`}var la=(e,t)=>`${e}\u0000${t}`;function ua(e,t){let n=/* @__PURE__ */ new Map;return t.filter(t=>t.from!==t.to&&e.has(t.from)&&e.has(t.to)).map(e=>{let t=la(e.from,e.to),r=n.get(t)??0;return n.set(t,r+1),{key:`${t}\u0000${r}`,from:e.from,to:e.to,label:e.label??``,direction:e.direction??`to`,value:e.value,unit:e.unit}})}function da(e,t){let n=new Map(e.map(e=>[e.id,/* @__PURE__ */ new Set]));for(let e of t)n.get(e.from)?.add(e.to),n.get(e.to)?.add(e.from);return n}function fa(e,t,n,r){let i=/* @__PURE__ */ new Map;for(let e of t)i.set(e.from,(i.get(e.from)??0)+1),i.set(e.to,(i.get(e.to)??0)+1);let a=new Map(e.map(e=>[e.id,e])),o=/* @__PURE__ */ new Map;for(let e of t){let t=i.get(e.from)??0,n=i.get(e.to)??0;t===1&&n!==1?o.set(e.from,{parent:e.to,edge:e}):n===1&&t!==1&&o.set(e.to,{parent:e.from,edge:e})}let s=/* @__PURE__ */ new Map;for(let t of e){let e=o.get(t.id);if(!e||t.more)continue;let n=ca(e.parent,t.type);s.set(n,[...s.get(n)??[],t.id])}let c=/* @__PURE__ */ new Set,l=[],u=[];for(let[e,t]of s){if(t.length<=5||n.has(e))continue;let{parent:i,edge:s}=o.get(t[0]),d=a.get(t[0]);for(let e of t)c.add(e);l.push({id:e,label:xa(r,d.type),type:d.type,group:{parent:i,members:t}});let f=s.from===i;u.push({...s,key:la(f?i:e,f?e:i),from:f?i:e,to:f?e:i,value:void 0})}return{nodes:[...e.filter(e=>!c.has(e.id)),...l],edges:[...t.filter(e=>!c.has(e.from)&&!c.has(e.to)),...u]}}function pa(e,t){let n=null,r=-1;for(let i of e){let e=t.get(i.id)?.size??0;e>r&&(n=i.id,r=e)}return n}function ma(e,t,n){let r=/* @__PURE__ */ new Set([t]);n&&r.add(n);let i=[t];for(let t=0;t<i.length;t++)for(let n of e.get(i[t])??[])r.has(n)||(r.add(n),i.push(n));return n&&r.delete(n),r}function ha(e,t,n){let r=/* @__PURE__ */ new Map;if(!n||!t.has(n))return r;let i=ma(t,n);for(let a of e){if(!i.has(a.id))continue;let e=a.id===n?/* @__PURE__ */ new Set([n]):ma(t,n,a.id),o=[...i].filter(t=>t!==a.id&&!e.has(t));o.length&&r.set(a.id,o)}return r}function ga(e,t={}){let n=/* @__PURE__ */ new Map;for(let t of e.nodes)n.has(t.id)||n.set(t.id,t);let r=new Map([...n.values()].map(e=>[e.id,e.label])),i=ua(n,e.edges),{nodes:a,edges:o}=fa([...n.values()],i,new Set(t.opened??[]),e.types),s=da(a,o),c=(t.centre&&s.has(t.centre)?t.centre:null)??pa(a,s),l=ha(a,s,c),u=ya({nodes:a,edges:o,neighbours:s,centre:c}),d=/* @__PURE__ */ new Set;for(let e of t.collapsed??[])for(let t of l.get(e)??[])d.add(t);let f=a.filter(e=>!d.has(e.id)),p=o.filter(e=>!d.has(e.from)&&!d.has(e.to));return{nodes:f,edges:p,byId:new Map(a.map(e=>[e.id,e])),neighbours:da(f,p),centre:c,behind:l,folded:d,names:r,layout:u}}function _a(e,t){let n=new Map(e.map(e=>[e.id,[]]));for(let e of t)n.get(e.from)?.push(e.to);let r=/* @__PURE__ */ new Map,i=e=>{r.set(e,1);for(let t of n.get(e)??[]){let e=r.get(t);if(e===1||e===void 0&&i(t))return!0}return r.set(e,2),!1};return e.some(e=>!r.has(e.id)&&i(e.id))}function va(e,t){let n=new Map(e.map(e=>[e.id,[]]));for(let e of t)n.get(e.from)?.push(e.to);let r=/* @__PURE__ */ new Map,i=e=>{let t=r.get(e);if(t!==void 0)return t;r.set(e,0);let a=Math.max(0,...(n.get(e)??[]).map(e=>i(e)+1));return r.set(e,a),a};return Math.max(0,...e.map(e=>i(e.id)))}function ya(e){let{nodes:t,edges:n}=e;if(t.length>100||n.some(e=>e.direction===`both`)||_a(t,n))return`force`;if(n.every(e=>e.direction===`to`)&&va(t,n)>=3)return`layered-right`;let r=e.centre?e.neighbours.get(e.centre)?.size??0:0;return t.length>2&&r>=.6*(t.length-1)?`radial`:`layered-down`}function ba(e,t){return e.find(e=>e.key===t)??{key:t,label:t,icon:``}}function xa(e,t){let n=ba(e,t),r=n.plural??n.label;return r.charAt(0).toUpperCase()+r.slice(1)}function Sa(e,t,n){let r=t.from===n?t.to:t.from,i=e.byId.get(r)?.label??r;return t.direction===`none`?`${t.label||`verbonden met`} ${i}`:t.direction===`both`?`${t.label||`verbonden met`} ↔ ${i}`:t.from===n?`${t.label||`verbonden met`} → ${i}`:`${i} → ${t.label||`verbonden met`}`}function Ca(e,t,n=4){let r=e.edges.filter(e=>e.from===t||e.to===t).map(n=>Sa(e,n,t));return r.length>n?[...r.slice(0,n),`nog ${r.length-n}`]:r}var wa=class{#e=void 0;#t=0;#n=/* @__PURE__ */ new Map;run(e){return e.nodes.length<=100?sa(e):new Promise(t=>{let n=this.worker();if(!n){requestAnimationFrame(()=>t(sa(e)));return}let r=++this.#t;this.#n.set(r,{request:e,settle:t}),n.postMessage({id:r,request:e},[])})}destroy(){this.#e?.terminate(),this.#e=void 0,this.#n.clear()}worker(){if(this.#e!==void 0)return this.#e;try{let e=new Worker(new URL(
|
|
2
2
|
/* @vite-ignore */
|
|
3
3
|
new URL(`../workers/layout-worker.js`,import.meta.url).href,``+import.meta.url),{type:`module`});e.addEventListener(`message`,e=>{let t=this.#n.get(e.data.id);this.#n.delete(e.data.id),t?.settle(e.data.result)}),e.addEventListener(`error`,()=>{this.#e?.terminate(),this.#e=null;for(let{request:e,settle:t}of this.#n.values())t(sa(e));this.#n.clear()}),this.#e=e}catch{this.#e=null}return this.#e}},G=3,Ta=16,Ea=.12,Da=[60,-60,120,-120],K=e=>Math.round(e*10)/10;function Oa(e){return{x:e.cx-e.hw,y:e.cy-e.hh,w:2*e.hw,h:2*e.hh}}function ka(e,t){return e.x<t.x+t.w&&e.x+e.w>t.x&&e.y<t.y+t.h&&e.y+e.h>t.y}function Aa(e,t,n,r=G){if(!t&&!n)return{x:e.cx,y:e.cy};let i=Math.hypot(t,n)||1;if(e.round)return{x:e.cx+t/i*(e.hw+r),y:e.cy+n/i*(e.hw+r)};let a=t===0?1/0:Math.abs(e.hw/t),o=n===0?1/0:Math.abs(e.hh/n),s=Math.min(a,o);return{x:e.cx+t*s+t/i*r,y:e.cy+n*s+n/i*r}}function ja(e,t,n){let r=0,i=1,a=t.x-e.x,o=t.y-e.y,s=[[-a,e.x-n.x],[a,n.x+n.w-e.x],[-o,e.y-n.y],[o,n.y+n.h-e.y]];for(let[e,t]of s){if(e===0){if(t<0)return!1;continue}let n=t/e;if(e<0){if(n>i)return!1;n>r&&(r=n)}else{if(n<r)return!1;n<i&&(i=n)}}return!0}function Ma(e,t,n,r){let i=1-r;return{x:i*i*e.x+2*i*r*t.x+r*r*n.x,y:i*i*e.y+2*i*r*t.y+r*r*n.y}}function Na(e,t,n,r){for(let i=1;i<6;i++){let{x:a,y:o}=Ma(e,t,n,i/6);if(r.some(e=>a>e.x&&a<e.x+e.w&&o>e.y&&o<e.y+e.h))return!0}return!1}function Pa(e,t){let n=[],r=0;for(let t=1;t<e.length;t++){let i=Math.hypot(e[t].x-e[t-1].x,e[t].y-e[t-1].y);n.push(i),r+=i}let i=t*r;for(let t=0;t<n.length;t++){if(i<=n[t]||t===n.length-1){let r=n[t]?i/n[t]:0,a=e[t],o=e[t+1];return{x:a.x+(o.x-a.x)*r,y:a.y+(o.y-a.y)*r}}i-=n[t]}return e[0]??{x:0,y:0}}function Fa(e){return e>2.5?11:8}function Ia(e,t,n,r){let i=Math.hypot(t,n)||1,a=t/i,o=n/i,s=Fa(r),c=e.x-a*s,l=e.y-o*s,u=s/2;return`M ${K(e.x)} ${K(e.y)} L ${K(c-o*u)} ${K(l+a*u)} L ${K(c+o*u)} ${K(l-a*u)} Z`}function La(e,t,n){let r=e.x-t.x,i=e.y-t.y,a=Math.hypot(r,i)||1,o=Math.min(n,a/2);return{x:e.x-r/a*o,y:e.y-i/a*o}}function Ra(e,t,n){let r=e=>n?e.cy:e.cx,i=/* @__PURE__ */ new Map,a=/* @__PURE__ */ new Map;for(let r of e){let e=t.get(r.from),o=t.get(r.to);e&&o&&(n?o.cx-o.hw>e.cx+e.hw+16:o.cy-o.hh>e.cy+e.hh+16)&&(i.set(r.from,[...i.get(r.from)??[],r]),a.set(r.to,[...a.get(r.to)??[],r]))}let o=/* @__PURE__ */ new Map,s=(e,i,a)=>{let s=[...e].sort((e,n)=>r(t.get(e[a===`from`?`to`:`from`]))-r(t.get(n[a===`from`?`to`:`from`]))),c=n?i.hh:i.hw,l=Math.min(12,(2*c-8)/Math.max(1,s.length-1));s.forEach((e,t)=>{let n=o.get(e.key)??{out:0,in:0,offset:0},c=r(i)+(t-(s.length-1)/2)*l;a===`from`?n.out=c:(n.in=c,n.offset=(t-(s.length-1)/2)*8),o.set(e.key,n)})};for(let[e,n]of i)s(n,t.get(e),`from`);for(let[e,n]of a)s(n,t.get(e),`to`);return o}function za(e,t,n,r,i,a){let o=i.routed?.get(e.key);if(i.lines===`orthogonal`&&i.layered){let r=a?.get(e.key),s=i.layered===`right`;if(r){if(s){let e={x:t.cx+t.hw+G,y:r.out},i={x:n.cx-n.hw-G,y:r.in},a=(e.x+i.x)/2+r.offset;return{points:[e,{x:a,y:e.y},{x:a,y:i.y},i]}}let e={x:r.out,y:t.cy+t.hh+G},i={x:r.in,y:n.cy-n.hh-G},a=(e.y+i.y)/2+r.offset;return{points:[e,{x:e.x,y:a},{x:i.x,y:a},i]}}if(o&&o.length>1)return{points:o};let c=n.cx-t.cx,l=n.cy-t.cy;if(Math.abs(c)<t.hw+n.hw+24||Math.abs(l)<8)return{points:[Aa(t,c,l),Aa(n,-c,-l)]};let u={x:t.cx+(c>0?t.hw+G:-t.hw-G),y:t.cy},d={x:n.cx,y:n.cy+(l>0?-n.hh-G:n.hh+G)};return{points:[u,{x:d.x,y:u.y},d]}}if(o&&o.length>1&&i.lines===`curved`)return{points:o,smooth:!0};let s=Aa(t,n.cx-t.cx,n.cy-t.cy),c=Aa(n,t.cx-n.cx,t.cy-n.cy),l=-(c.y-s.y),u=c.x-s.x,d=Math.hypot(l,u)||1,f={x:(s.x+c.x)/2,y:(s.y+c.y)/2},p=i.lines===`curved`?Ea*d:0,m=r.some(e=>ja(s,c,e));if(!p&&!m)return{points:[s,c]};for(let e of p?[p,-p,...Da]:Da){let t={x:f.x+l/d*e,y:f.y+u/d*e};if(!Na(s,t,c,r))return{points:[s,c],control:t}}return p?{points:[s,c],control:{x:f.x+l/d*p,y:f.y+u/d*p}}:{points:[s,c]}}function Ba(e,t,n=!1,r=!0){let[i]=e;if(!i)return``;let a=`M ${K(i.x)} ${K(i.y)}`;if(t){let n=e[e.length-1];return`${a} Q ${K(t.x)} ${K(t.y)} ${K(n.x)} ${K(n.y)}`}if(n&&e.length>2){let t=a;for(let n=1;n<e.length;n++){let i=e[n-1],a=e[n],o=r?{x:(i.x+a.x)/2,y:i.y}:{x:i.x,y:(i.y+a.y)/2},s=r?{x:(i.x+a.x)/2,y:a.y}:{x:a.x,y:(i.y+a.y)/2};t+=` C ${K(o.x)} ${K(o.y)} ${K(s.x)} ${K(s.y)} ${K(a.x)} ${K(a.y)}`}return t}return e.map((e,t)=>`${t?`L`:`M`} ${K(e.x)} ${K(e.y)}`).join(` `)}function Va(e,t,n){let r=new Map([...t].map(([e,t])=>[e,Oa(t)])),i=[...r.values()],a=n.lines===`orthogonal`&&n.layered?Ra(e,t,n.layered===`right`):null,o=[],s=[];for(let c of e){let e=t.get(c.from),l=t.get(c.to);if(!e||!l)continue;let u=za(c,e,l,i.filter(e=>e!==r.get(c.from)&&e!==r.get(c.to)),n,a),d=u.points.map(e=>({...e})),f=u.control,p=[],m=Fa(c.width),h=d.length-1,g=f??d[h-1]??d[0],_=f??d[1]??d[h];if(c.direction!==`none`){let e=d[h];p.push(Ia(e,e.x-g.x,e.y-g.y,c.width)),d[h]=La(e,g,m*.8)}if(c.direction===`both`){let e=d[0];p.push(Ia(e,e.x-_.x,e.y-_.y,c.width)),d[0]=La(e,_,m*.8)}let v=null;if(c.label&&c.labelled){let e=n.labelWidth(c.label),t=[];f&&t.push(Ma(u.points[0],f,u.points[u.points.length-1],.5));for(let e of[.5,.38,.62,.28,.72,.18,.82])t.push(Pa(u.points,e));let r=t.find(t=>{let n={x:t.x-e/2,y:t.y-Ta/2,w:e,h:Ta};return!i.some(e=>ka(n,e))&&!o.some(e=>ka(n,e))})??(c.lit?t[0]:null);r&&(o.push({x:r.x-e/2,y:r.y-Ta/2,w:e,h:Ta}),v={x:K(r.x),y:K(r.y)})}s.push({key:c.key,d:Ba(d,f,u.smooth,n.layered!==`down`),arrows:p,label:v})}return s}var q={min:.15,max:3,fit:1.25,step:1.25},Ha=.7,Ua=.35;function Wa(e){return e>=Ha?`card`:e>=Ua?`mark`:`icon`}function J(e,t,n=Object.keys(e)){let r=1/0,i=1/0,a=-1/0,o=-1/0;for(let s of n){let n=e[s],c=t.get(s);n&&c&&(r=Math.min(r,n.x-c.width/2),i=Math.min(i,n.y-c.height/2),a=Math.max(a,n.x+c.width/2),o=Math.max(o,n.y+c.height/2))}return r===1/0?{x:0,y:0,width:1,height:1}:{x:r,y:i,width:Math.max(1,a-r),height:Math.max(1,o-i)}}function Ga(e,t,n=0){let r=t.width-n,i=Math.max(q.min,Math.min((r-48)/e.width,(t.height-48)/e.height,q.fit));return{k:i,x:(r-e.width*i)/2-e.x*i,y:(t.height-e.height*i)/2-e.y*i}}function Ka(e,t,n){let r=Math.min(q.max,Math.max(q.min,e.k*n)),i=r/e.k;return{k:r,x:t.x-(t.x-e.x)*i,y:t.y-(t.y-e.y)*i}}function qa(e,t,n){return{k:e.k,x:n.width/2-t.x*e.k,y:n.height/2-t.y*e.k}}function Ja(e,t,n){let r=e.x*t.k+t.x,i=e.y*t.k+t.y;return r>=-1&&i>=-1&&r+e.width*t.k<=n.width+1&&i+e.height*t.k<=n.height+1}function Ya(e,t){let n=Math.min((t.width-16)/e.width,(t.height-16)/e.height);return{scale:n,x:(t.width-e.width*n)/2-e.x*n,y:(t.height-e.height*n)/2-e.y*n}}var Xa={desktop:480,mobile:360},Y={width:168,wide:240,padX:12,padY:8,icon:20,gap:8,line:18,sub:20,min:40},X={radius:14,gap:8},Z={size:24,sign:12,pad:4,digit:7,inset:12,gap:6},Q={min:1.5,max:4},Za=4,Qa={width:180,height:100},$a=class{constructor(e){this.requestUpdate=e,this.width=640,this.height=Xa.desktop,this.controls=48,this.view=null,this.hover=null,this.tip=null,this.stop=null,this.focused=null,this.drag=null,this.overviewDrag=null,this.touches=/* @__PURE__ */ new Map,this.pinch=null,this.hint=null,this.area=null,this.observer=null,this.attach=e=>{e!==this.area&&(this.observer?.disconnect(),this.observer=null,this.area=e instanceof HTMLElement?e:null,this.area&&(this.read(),this.observer=new a(()=>{this.read()&&this.requestUpdate()}),this.observer.observe(this.area)))}}read(){let e=this.area?.getBoundingClientRect();if(!e||!e.width)return!1;this.controls=te(this.area,`--lintje-graph-control`,40)+8;let t=Math.round(e.width),n=Math.round(e.height);return t===this.width&&n===this.height?!1:(this.width=t,this.height=n,!0)}detach(){this.observer?.disconnect(),this.observer=null,this.area=null,clearTimeout(this.tipTimer),clearTimeout(this.leaveTimer),clearTimeout(this.hintTimer)}},$=e=>Math.round(e*10)/10;function eo(e){return(e.plural??e.label).toLowerCase()}var to=class extends ie{static{this.styles=[r,c(re),c(h),se,s,ne,n,c(i),c(fe)]}static{this.properties={data:{attribute:!1}}}#e=new ee(this);#t=new wa;#n=new $a(()=>this.requestUpdate());#r=null;#i=null;#a=null;#o=null;#s=null;#c=/* @__PURE__ */ new Set;#l=/* @__PURE__ */ new Set;#u=/* @__PURE__ */ new Set;#d=/* @__PURE__ */ new Set;#f=!1;#p={};#m=/* @__PURE__ */ new Map;#h=null;#g=``;#_=!1;#v=null;#y=0;#b=/* @__PURE__ */ new Map;#x;#S=/* @__PURE__ */ new Map;#C=/* @__PURE__ */ new Map;#w=[];#T=[];#E=/* @__PURE__ */ new Set;#D=null;#O={size:14,family:``};get dataSettings(){return this.data??void 0}connectedCallback(){super.connectedCallback(),window.addEventListener(`scroll`,this.#k,{capture:!0,passive:!0})}#k=()=>{this.surfaces().some(e=>e.tip)&&this.placeTips()};disconnectedCallback(){window.removeEventListener(`scroll`,this.#k,{capture:!0}),this.#n.detach(),this.#r?.detach(),this.#t.destroy(),cancelAnimationFrame(this.#y),this.#y=0,clearTimeout(this.#x),super.disconnectedCallback()}expandChanged(e){e?this.#r??=new $a(()=>this.requestUpdate()):(this.#r?.detach(),this.#r=null)}willUpdate(e){super.willUpdate(e),this.#D=this.focusedPart();let t=this.data;t&&(e.has(`data`)||this.#f)&&(e.has(`data`)&&this.adopt(t),this.#f=!1,this.rebuild())}adopt(e){let t=e.selected??null;t!==this.#p.selected&&(this.#p.selected=t,this.#s=t);let n=JSON.stringify(e.collapsed??[]);n!==this.#p.collapsed&&(this.#p.collapsed=n,this.#c=new Set(e.collapsed??[]));let r=JSON.stringify(e.opened??[]);r!==this.#p.opened&&(this.#p.opened=r,this.#l=new Set(e.opened??[]));for(let t of this.#u)e.nodes.some(e=>e.id===t&&e.more)||this.#u.delete(t)}get layoutKind(){return this.data?.layout??this.#o??`force`}get lines(){return this.data?.lines??(this.layoutKind===`radial`?`curved`:`straight`)}rebuild(){let e=this.data;if(!e)return;let t=ga(e,{opened:this.#l,collapsed:this.#c,centre:this.#a});this.#i=t,(!this.#o||t.centre!==this.#a)&&(this.#o=t.layout),this.#a=t.centre,this.readFont(),this.#m=new Map(t.nodes.map(e=>[e.id,this.cardSize(e,t)]));let n=this.layoutKind,r={kind:n,nodes:t.nodes.map(e=>({id:e.id,...this.#m.get(e.id)})),edges:t.edges.map(e=>({from:e.from,to:e.to})),centre:t.centre},i=JSON.stringify(r);if(i===this.#g)return;this.#g=i,n===`force`&&this.#h?.kind===`force`&&(r.previous=this.positionsNow());let a=t.edges.map(e=>e.key),o=e=>({positions:e.positions,routes:e.routes?new Map(a.map((t,n)=>[t,e.routes[n]??[]])):null,kind:n,key:i}),s=this.#t.run(r);s instanceof Promise?(this.#_=!0,s.then(e=>{this.#g===i&&(this.#_=!1,this.apply(o(e)),this.requestUpdate())})):(this.#_=!1,this.apply(o(s)))}readFont(){let e=getComputedStyle(this),t=parseFloat(getComputedStyle(document.documentElement).fontSize)||16;this.#O={size:t*.875,family:e.getPropertyValue(`--font-ui`)}}unit(e){return e*this.#O.size/14}wordWidth(e){return w(e,this.#O.family)+8}counterOf(e,t){if(e.group){let t=ba(this.data?.types??[],e.type),n=e.group.members.length;return{count:n,open:!1,label:`Open ${n} ${eo(t)}`,busy:!1}}if(e.more){let t=this.#u.has(e.id);return{count:e.more,open:!1,busy:t,label:t?`${e.more} relaties worden opgehaald`:`Haal ${e.more} relaties op`}}let n=t.behind.get(e.id)?.length??0;if(!n)return null;let r=!this.#c.has(e.id);return{count:n,open:r,busy:!1,label:`Klap ${n} ${n===1?`relatie`:`relaties`} ${r?`in`:`uit`}`}}counterWidth(e,t=!1){let n=String(e).length;return t?Math.max(Z.size,4*Z.pad+10+n*Z.digit):Math.max(Z.size,2*Z.pad+Z.sign+n*Z.digit)}roomFor(e,t){let n=this.counterOf(e,t);return n?this.counterWidth(n.count)+Z.gap:0}cardSize(e,t){let n=2+2*Y.padX+Y.icon+Y.gap+this.roomFor(e,t),r=this.subOf(e,t),i=e.status?14:0,a=(e,t)=>Math.max(0,...e.split(/\s+/).map(e=>w(e,this.#O.family,t,14))),o=Math.max(a(e.label,700),r?a(r,400)+i:0),s=Math.min(Y.wide,Math.max(Y.width,Math.ceil(n+o+1))),c=t=>this.lineCount(e.label,t,700)<=2&&(!r||this.lineCount(r,t-i,400)<=2);for(;s<Y.wide&&!c(s-n);)s+=8;let l=s-n,u=Math.min(2,this.lineCount(e.label,l,700)),d=r?Math.min(2,this.lineCount(r,l-i,400)):0,f=Math.max(Y.min,2*Y.padY+u*Y.line+(d?Y.sub-Y.line+d*Y.line:0)+2);return{width:this.unit(s),height:this.unit(f)}}subOf(e,t){return e.status?e.status.label:e.group?`${e.group.members.length} bij ${t.byId.get(e.group.parent)?.label??``}`:``}lineCount(e,t,n){let r=e.split(/\s+/).filter(Boolean),i=1,a=0,o=w(` `,this.#O.family,n,14);for(let e of r){let r=w(e,this.#O.family,n,14);a&&a+o+r>t?(i++,a=r):a+=(a?o:0)+r}return i}apply(e){let t=this.#h?this.positionsNow():null,n=t?J(t,this.#C):null;this.#h=e;let r=t&&!f()?C(this,`--dur-graph`):0,i=/* @__PURE__ */ new Set;if(t&&r>0)for(let[n,r]of Object.entries(t)){if(e.positions[n]||this.#b.has(n))continue;let t=this.#S.get(n),a=this.#C.get(n);t&&a&&(this.#b.set(n,{node:t,at:r,size:a}),i.add(n))}for(let t of Object.keys(e.positions))this.#b.delete(t);let a=i.size?r:0;if(this.#T=this.#w.filter(e=>this.#b.has(e.from)||this.#b.has(e.to)),this.#E=new Set(a?Object.keys(e.positions).filter(e=>!t?.[e]):[]),t&&n&&r>0){let i={},o=this.#i;for(let n of Object.keys(e.positions)){let e=t[n]??[...o.neighbours.get(n)??[]].map(e=>t[e]).find(Boolean);e&&(i[n]=e)}this.#v={from:i,fromBounds:n,start:performance.now(),delay:a,duration:r},this.tick()}else this.#v=null;this.#b.size&&(clearTimeout(this.#x),this.#x=setTimeout(()=>{this.#b.clear(),this.#T=[],this.requestUpdate()},r)),this.#S=new Map(this.#i.nodes.map(e=>[e.id,e])),this.#C=new Map(this.#m),this.#w=this.#i.edges}tick(){this.#y||=requestAnimationFrame(()=>{this.#y=0,this.requestUpdate();let e=this.#v;e&&performance.now()-e.start<e.delay+e.duration?this.tick():(this.#v=null,this.#E.clear())})}progress(e){let t=(performance.now()-e.start-e.delay)/e.duration;return l(this,`--ease-in-motion`)(Math.min(1,Math.max(0,t)))}positionsNow(){let e=this.#h;if(!e)return{};let t=this.#v;if(!t)return e.positions;let n=this.progress(t),r={};for(let[i,a]of Object.entries(e.positions)){let e=t.from[i];r[i]=e?{x:e.x+(a.x-e.x)*n,y:e.y+(a.y-e.y)*n}:a}return r}select(e){let t=this.#i,n=e?t?.byId.get(e):null;this.#s=n?n.id:null;for(let e of this.surfaces())e.tip=null;this.emit(`lintje-node-select`,n?{id:n.id,label:n.label}:{id:null,label:null}),this.requestUpdate()}toggle(e){let t=this.#i;if(t){if(e.group)this.#l.add(e.id),this.emit(`lintje-node-toggle`,{id:e.id,open:!0});else if(e.more){if(this.#u.has(e.id))return;this.#u.add(e.id),this.emit(`lintje-node-expand`,{id:e.id})}else if(this.#c.has(e.id))this.#c.delete(e.id),this.emit(`lintje-node-toggle`,{id:e.id,open:!0});else if(t.behind.has(e.id))this.#c.add(e.id),this.emit(`lintje-node-toggle`,{id:e.id,open:!1});else return;for(let e of this.surfaces())e.tip=null;this.#f=!0,this.requestUpdate()}}reset(e){e.view=null;for(let e of this.#c)this.emit(`lintje-node-toggle`,{id:e,open:!0});for(let e of this.#l)this.emit(`lintje-node-toggle`,{id:e,open:!1});(this.#c.size||this.#l.size)&&(this.#f=!0),this.#c=/* @__PURE__ */ new Set,this.#l=/* @__PURE__ */ new Set,this.#s&&this.select(null),this.requestUpdate()}toggleType(e){this.#d.has(e)?this.#d.delete(e):this.#d.add(e),this.requestUpdate()}leave(e){clearTimeout(e.leaveTimer),e.leaveTimer=setTimeout(()=>this.hover(e,null),0)}surfaces(){return this.#r?[this.#n,this.#r]:[this.#n]}hover(e,t,n=300){clearTimeout(e.leaveTimer),!(t&&e.hover&&`node`in t&&`node`in e.hover&&t.node===e.hover.node&&n)&&(e.hover=t,clearTimeout(e.tipTimer),t?n?(e.tip=null,e.tipTimer=setTimeout(()=>{e.tip=e.hover,this.requestUpdate()},n)):e.tip=t:e.tip=null,this.requestUpdate())}viewOf(e){if(e.view)return e.view;if(!this.#h)return null;let t=J(this.#h.positions,this.#m),n=this.#v;if(!n)return Ga(t,e,e.controls);let r=this.progress(n),i=n.fromBounds;return Ga({x:i.x+(t.x-i.x)*r,y:i.y+(t.y-i.y)*r,width:i.width+(t.width-i.width)*r,height:i.height+(t.height-i.height)*r},e,e.controls)}zoom(e,t,n){let r=this.viewOf(e);r&&(e.view=Ka(r,n??{x:e.width/2,y:e.height/2},t),this.requestUpdate())}zoomToSelection(e){let t=this.#i,n=this.#h,r=this.#s;if(!t||!n||!r||!n.positions[r])return;let i=[r,...t.neighbours.get(r)??[]];e.view=Ga(J(n.positions,this.#m,i),e,e.controls),this.requestUpdate()}reveal(e,t){let n=this.viewOf(e),r=this.#h?.positions[t];if(!n||!r)return;let i=r.x*n.k+n.x,a=r.y*n.k+n.y;(i<48||a<48||i>e.width-48||a>e.height-48)&&(e.view=qa(n,r,e))}focusNode(e,t){e.stop=t,this.reveal(e,t),this.requestUpdate(),this.updateComplete.then(()=>{e.area?.querySelector(`[data-node="${CSS.escape(t)}"]`)?.focus()})}neighbourTowards(e,t,n){let r=this.#i,i=this.#h?.positions,a=i?.[e];if(!r||!a||!i)return null;let o=null,s=0;for(let c of r.neighbours.get(e)??[]){let e=i[c],l=r.byId.get(c);if(!e||!l||this.#d.has(l.type))continue;let u=Math.hypot(e.x-a.x,e.y-a.y)||1,d=((e.x-a.x)*t+(e.y-a.y)*n)/u;d>s&&(s=d,o=c)}return o}onKey(e,t){let n=t.target.closest(`[data-node]`),r=n?.dataset.node;if(t.key===`Escape`){e.tip?(this.hover(e,null),t.stopPropagation()):this.#s&&(this.select(null),t.stopPropagation());return}if(!r||!n?.matches(`.lintje-graph__node`))return;let i={ArrowRight:[1,0],ArrowLeft:[-1,0],ArrowUp:[0,-1],ArrowDown:[0,1]}[t.key],a=t.key===`Home`?this.#i?.centre:i?this.neighbourTowards(r,...i):null;(t.key===`Home`||i)&&(t.preventDefault(),a&&this.focusNode(e,a))}onWheel(e,t){if(!ce(t)){e.hint=le(),clearTimeout(e.hintTimer),e.hintTimer=setTimeout(()=>{e.hint=null,this.requestUpdate()},de),this.requestUpdate();return}t.preventDefault();let n=e.area.getBoundingClientRect();this.zoom(e,2**ue(t),{x:t.clientX-n.left,y:t.clientY-n.top})}onPointerDown(e,t){if(t.target.closest(`button, .lintje-graph__overview`))return;let n=e.area.getBoundingClientRect(),r={x:t.clientX-n.left,y:t.clientY-n.top};if(t.pointerType===`touch`){if(e.touches.set(t.pointerId,r),e.touches.size===2){let[t,n]=[...e.touches.values()],r=this.viewOf(e);r&&(e.pinch={distance:Math.hypot(t.x-n.x,t.y-n.y),view:r})}return}let i=this.viewOf(e);i&&t.button===0&&(e.area.setPointerCapture?.(t.pointerId),e.drag={x:t.clientX,y:t.clientY,view:i,moved:!1,id:t.pointerId})}onPointerMove(e,t){if(t.pointerType===`touch`&&e.touches.has(t.pointerId)){let n=e.area.getBoundingClientRect();if(e.touches.set(t.pointerId,{x:t.clientX-n.left,y:t.clientY-n.top}),e.pinch&&e.touches.size===2){let[t,n]=[...e.touches.values()],r=Math.hypot(t.x-n.x,t.y-n.y),i={x:(t.x+n.x)/2,y:(t.y+n.y)/2};e.view=Ka(e.pinch.view,i,r/e.pinch.distance),this.requestUpdate()}return}let n=e.drag;if(!n||n.id!==t.pointerId)return;let r=t.clientX-n.x,i=t.clientY-n.y;!n.moved&&Math.hypot(r,i)<Za||(n.moved=!0,e.view={k:n.view.k,x:n.view.x+r,y:n.view.y+i},this.requestUpdate())}onPointerUp(e,t){if(t.pointerType===`touch`){e.touches.delete(t.pointerId),e.touches.size<2&&(e.pinch=null);return}let n=e.drag;n&&n.id===t.pointerId&&(e.drag=null,!n.moved&&t.type===`pointerup`&&this.#s&&this.select(null),this.requestUpdate())}overviewPoint(e,t){let n=e.currentTarget.getBoundingClientRect();return{x:(e.clientX-n.left-t.x)/t.scale,y:(e.clientY-n.top-t.y)/t.scale}}onOverviewDown(e,t,n){let r=this.viewOf(e);if(!r||t.button!==0)return;let i=this.overviewPoint(t,n),a={x:(e.width/2-r.x)/r.k,y:(e.height/2-r.y)/r.k},o=Math.abs(i.x-a.x)<=e.width/2/r.k&&Math.abs(i.y-a.y)<=e.height/2/r.k,s=o?{x:i.x-a.x,y:i.y-a.y}:{x:0,y:0};o||(e.view=qa(r,i,e)),e.overviewDrag={offset:s,id:t.pointerId},t.currentTarget.setPointerCapture?.(t.pointerId),this.requestUpdate()}onOverviewMove(e,t,n){let r=e.overviewDrag,i=this.viewOf(e);if(!r||r.id!==t.pointerId||!i)return;let a=this.overviewPoint(t,n);e.view=qa(i,{x:a.x-r.offset.x,y:a.y-r.offset.y},e),this.requestUpdate()}png(){let e=this.data,t=(this.expanded&&this.#r?this.#r:this.#n).area?.closest(`.lintje-graph`);if(!e?.download||!t)return;let n=O(t,{title:e.title,subtitle:e.subtitle,footnote:e.footnote},{skip:`.lintje-graph__zoom, .lintje-graph__overview, .lintje-graph__hint, .lintje-graph__busy, .lintje-graph__tip`,buttons:`.lintje-graph__card, .lintje-graph__counter`});D(e.download.filename,n)}typeColor(e){let t=this.data;if(!t||t.typeColors===!1)return;let n=t.types.findIndex(t=>t.key===e);if(n<0)return;let r=t.types[n].color??S[n%S.length];return r===`dark-yellow`?`var(--color-chart-dark-yellow-text)`:v(r)}legend(){let e=this.data,t=this.#i;if(!t||!e.types.length)return u;let n=/* @__PURE__ */ new Map;for(let e of t.nodes)n.set(e.type,(n.get(e.type)??0)+(e.group?e.group.members.length:1));let r=e.types.map(t=>({label:t.label,key:t.key,icon:t.icon,color:this.typeColor(t.key)??`var(--color-text-primary)`,count:n.get(t.key)??0,hidden:this.#d.has(t.key),fixed:e.types.length<2}));return ae({items:r,onToggle:e=>this.toggleType(e)})}render(){let e=this.data;if(!e)return u;let t=(e.state??`ready`)===`ready`,n=this.#e.matches,r=n&&e.mobileSubtitle?e.mobileSubtitle:e.subtitle,i=e.height??(n?Xa.mobile:Xa.desktop);return x`<lintje-tile
|
|
4
4
|
id=${this.id?`${this.id}-tile`:u}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export{S as LintjeGridItem}from"../chunks/base-
|
|
1
|
+
export{S as LintjeGridItem}from"../chunks/base-DpZg_-sV.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export{C as LintjeGrid}from"../chunks/base-
|
|
1
|
+
export{C as LintjeGrid}from"../chunks/base-DpZg_-sV.js";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{J as e,an as t,bt as n,cn as r,dn as i,on as a,pn as o,vt as s,xt as c}from"../chunks/base-
|
|
1
|
+
import{J as e,an as t,bt as n,cn as r,dn as i,on as a,pn as o,vt as s,xt as c}from"../chunks/base-DpZg_-sV.js";var l=`:host{min-width:0;display:block}:host([hidden]){display:none}.lintje-hero__band{padding:calc(var(--space-10) + var(--space-4)) calc(var(--page-pad-x) + var(--page-gutter)) calc(var(--space-10) + var(--space-2));background:var(--color-hero-bg);color:var(--color-hero-text)}.lintje-hero.has-aside .lintje-hero__band{align-items:center;gap:var(--space-10);display:flex}.lintje-hero.has-overlap .lintje-hero__band{padding-bottom:calc(var(--space-10) + var(--space-2) + var(--hero-overlap))}.lintje-hero__body{align-items:flex-start;gap:var(--space-6);flex-direction:column;flex:auto;min-width:0;display:flex}.lintje-hero__aside{flex:0 1 var(--w-hero-aside);justify-content:flex-end;min-width:0;display:flex}.lintje-hero__aside ::slotted(*){max-width:100%}.lintje-hero__aside ::slotted(img){height:auto}.lintje-hero:not(.has-aside) .lintje-hero__aside{display:none}@media (width<=1023px){.lintje-hero.has-aside .lintje-hero__band{display:block}.lintje-hero__aside{display:none}.lintje-hero__panel{margin-top:var(--space-8)}}.lintje-hero:not(.has-panel) .lintje-hero__panel{display:none}.lintje-hero__panel{flex-direction:column;min-width:0;display:flex}.lintje-hero__panel ::slotted(*){flex:auto}.lintje-hero.has-panel .lintje-hero__aside{display:none}@media (width>=1024px){.lintje-hero.has-panel .lintje-hero__band{align-items:stretch;gap:var(--space-10);grid-template-columns:minmax(0,1fr) minmax(0,1fr);display:grid}}.lintje-hero__heading{gap:var(--space-3);flex-direction:column;display:flex}.lintje-hero__title{font:var(--text-h1-display);margin:0}.lintje-hero__description{max-width:var(--w-text);font:var(--text-translation);text-wrap:pretty;margin:0}.lintje-hero__action{align-items:center;gap:var(--space-2);min-height:var(--h-touch);color:inherit;text-underline-offset:.2em;font-weight:700;text-decoration:underline;display:inline-flex}.lintje-hero__action:hover{text-decoration-thickness:2px}.lintje-hero__overlap{margin-top:calc(-1 * var(--hero-overlap));padding:0 calc(var(--page-pad-x) + var(--page-gutter));position:relative}.lintje-hero:not(.has-overlap) .lintje-hero__overlap{display:none}@media screen and (width<=767px){.lintje-hero__band{padding-top:var(--space-8);padding-bottom:var(--space-8)}.lintje-hero.has-overlap .lintje-hero__band{padding-bottom:calc(var(--space-8) + var(--hero-overlap))}.lintje-hero__title{font:var(--text-h1)}.lintje-hero__description{font:var(--text-body)}}`,u=class extends t{constructor(...e){super(...e),this.heading=``,this.hasOverlap=!1,this.hasAside=!1,this.hasPanel=!1}static{this.styles=[n,r(l)]}static{this.properties={heading:{type:String},description:{type:String},action:{type:String},href:{type:String},hasOverlap:{state:!0},hasAside:{state:!0},hasPanel:{state:!0}}}onOverlapChange(e){this.hasOverlap=e.target.assignedElements().length>0}onAsideChange(e){this.hasAside=e.target.assignedElements().length>0}onPanelChange(e){this.hasPanel=e.target.assignedElements().length>0}onAction(t){this.href&&e(t)&&this.followLink(this.href,t)}render(){return o`<div
|
|
2
2
|
class=${s({"lintje-hero":!0,"has-overlap":this.hasOverlap,"has-aside":this.hasAside,"has-panel":this.hasPanel})}
|
|
3
3
|
>
|
|
4
4
|
<div class="lintje-hero__band">
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{an as e,cn as t,on as n,pn as r,vt as i}from"../chunks/base-
|
|
1
|
+
import{an as e,cn as t,on as n,pn as r,vt as i}from"../chunks/base-DpZg_-sV.js";var a=`:host{display:inline}:host([hidden]){display:none}.lintje-highlight{font:inherit;color:var(--color-text-primary);-webkit-box-decoration-break:clone;box-decoration-break:clone}.lintje-highlight--uncertain{background:var(--color-attention-bg);border-bottom:2px dotted var(--color-attention-line)}.lintje-highlight--term{background:var(--color-bg-selected);border:0;border-bottom:2px solid var(--color-term-line);padding:0}.lintje-highlight--control{cursor:help}.lintje-highlight--control:hover{border-bottom-width:3px}.lintje-highlight--match{background:var(--color-warning);color:var(--color-text-on-light-fill)}.lintje-highlight--match.is-current{outline:2px solid var(--color-text-primary)}.lintje-highlight--removed{background:var(--color-error-bg);text-decoration:line-through}.lintje-highlight--added{background:var(--color-success-bg);text-decoration:underline}@media (forced-colors:active){.lintje-highlight--match{forced-color-adjust:none;color:marktext;background:mark}.lintje-highlight--match.is-current{outline-color:canvastext}}`,o={uncertain:`lage zekerheid`,term:`term`,match:`zoekresultaat`},s={removed:`verwijderd`,added:`toegevoegd`},c=class extends e{constructor(...e){super(...e),this.kind=`match`,this.current=!1}static{this.styles=t(a)}static{this.properties={kind:{type:String,reflect:!0},current:{type:Boolean,reflect:!0},explanation:{type:String},label:{type:String}}}get isControl(){return this.kind===`term`&&!!this.explanation}get classes(){return i({"lintje-highlight":!0,[`lintje-highlight--${this.kind}`]:!0,"lintje-highlight--control":this.isControl,"is-current":this.kind===`match`&&this.current})}render(){let e=this.kind;if(e===`removed`||e===`added`){let t=r`<span class="visually-hidden">${this.label||s[e]}: </span>`;return e===`removed`?r`<del class=${this.classes}>${t}<slot></slot></del>`:r`<ins class=${this.classes}>${t}<slot></slot></ins>`}if(this.isControl)return r`<lintje-tooltip text=${this.explanation}
|
|
2
2
|
><button type="button" class=${this.classes}><slot></slot></button
|
|
3
3
|
></lintje-tooltip>`;let t=e===`match`&&this.current?`huidig zoekresultaat`:o[e]??`markering`;return r`<mark class=${this.classes}
|
|
4
4
|
><span class="visually-hidden">begin markering ${t}, </span><slot></slot
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export{P as LintjeIconButton}from"../chunks/base-
|
|
1
|
+
export{P as LintjeIconButton}from"../chunks/base-DpZg_-sV.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export{Lt as ICONS,b as ICON_NAMES,x as LintjeIcon}from"../chunks/base-
|
|
1
|
+
export{Lt as ICONS,b as ICON_NAMES,x as LintjeIcon}from"../chunks/base-DpZg_-sV.js";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{an as e,at as t,cn as n,ct as r,dn as i,on as a,ot as o,pn as s}from"../chunks/base-
|
|
1
|
+
import{an as e,at as t,cn as n,ct as r,dn as i,on as a,ot as o,pn as s}from"../chunks/base-DpZg_-sV.js";import"./list.js";var c=`:host{min-width:0;display:block}:host([hidden]){display:none}.lintje-job-list{display:block}`,l=Object.fromEntries(Object.keys(t).map(e=>[e,{label:t[e],tone:o[e]}])),u={queued:e=>`${e} staat in de wachtrij.`,busy:e=>`${e} wordt verwerkt.`,paused:e=>`${e} is onderbroken.`,done:e=>`${e} is klaar.`,error:e=>`${e} is mislukt.`,cancelled:e=>`${e} is geannuleerd.`};function d(e){let t=u[e.state](e.name),n=e.state===`error`?e.detail?.trim():``;return n?`${t} ${n}${/[.!?]$/.test(n)?``:`.`}`:t}var f={queued:{label:`Annuleren`,event:`lintje-job-cancel`},busy:{label:`Annuleren`,event:`lintje-job-cancel`},paused:{label:`Hervatten`,event:`lintje-job-resume`},error:{label:`Opnieuw`,event:`lintje-job-retry`},cancelled:{label:`Verwijderen`,event:`lintje-job-remove`}};function p(e,t=!1){let n=typeof e.progress==`number`&&!Number.isNaN(e.progress),r=f[e.state],i=e.state===`done`;return{id:e.id,title:e.name,clickable:!!e.href,href:e.href,sub:e.detail,meta:e.meta,icon:e.icon,group:e.group,status:t&&i?void 0:l[e.state],progress:n&&(e.state===`busy`||e.state===`paused`)?e.progress:void 0,action:r?{label:r.label,value:r.event}:void 0,actions:i?[{value:`lintje-job-remove`,label:`Verwijderen`}]:void 0}}var m=class extends e{constructor(...e){super(...e),this.jobs=void 0,this.headingLevel=3,this.spoken=``,this.known=/* @__PURE__ */ new Map,this.loaded=!1,this.emptiedWithFocus=!1}static{this.styles=n(c)}static{this.properties={jobs:{attribute:!1},headingLevel:{type:Number,attribute:`heading-level`},spoken:{state:!0}}}willUpdate(e){if(super.willUpdate(e),!e.has(`jobs`))return;let t=this.renderRoot.querySelector(`lintje-list`);this.emptiedWithFocus=!this.jobs?.length&&!!(t&&r(t));let n=!this.loaded;this.loaded=!0;let i=[],a=/* @__PURE__ */ new Map;for(let e of this.jobs??[]){a.set(e.id,e.state);let t=this.known.get(e.id);!n&&t!==e.state&&i.push(d(e))}this.known=a,i.length?this.spoken=i.join(` `):this.emptiedWithFocus&&(this.spoken=`Er staan geen taken meer in de lijst.`)}updated(e){if(super.updated(e),!this.emptiedWithFocus||(this.emptiedWithFocus=!1,!this.emit(`lintje-jobs-empty`)))return;let t=this.renderRoot.querySelector(`[role="status"]`);t&&(t.tabIndex=-1,t.focus())}onAction(e){e.stopPropagation();let{id:t,action:n}=e.detail;n.startsWith(`lintje-job-`)&&this.emit(n,t)}onRowClick(e){e.stopPropagation(),e.preventDefault(),e.detail.href&&this.followLink(e.detail.href)}render(){let e=this.jobs??[];return s`${e.length?s`<lintje-list
|
|
2
2
|
class="lintje-job-list"
|
|
3
3
|
heading-level=${this.headingLevel}
|
|
4
4
|
.items=${e.map(t=>p(t,e.every(e=>e.state===`done`)))}
|
package/dist-elements/tag/key.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{an as e,cn as t,on as n,pn as r}from"../chunks/base-
|
|
1
|
+
import{an as e,cn as t,on as n,pn as r}from"../chunks/base-DpZg_-sV.js";import{t as i}from"../chunks/key-CAxrgBxD.js";var a=`:host{display:inline-flex}:host([hidden]){display:none}`,o=class extends e{static{this.styles=[t(a),t(i)]}static{this.properties={key:{type:String}}}render(){return r`<kbd class="lintje-key"><slot>${this.key}</slot></kbd>`}};n(`lintje-key`,o);export{o as LintjeKey};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{L as e,R as t,cn as n,dn as r,jt as i,on as a,pn as o}from"../chunks/base-
|
|
1
|
+
import{L as e,R as t,cn as n,dn as r,jt as i,on as a,pn as o}from"../chunks/base-DpZg_-sV.js";import"./kpi.js";var s=`:host{display:block}:host([hidden]){display:none}.lintje-grid{gap:var(--grid-gutter);min-height:inherit;grid-template-columns:repeat(12,minmax(0,1fr));align-items:stretch;display:grid}@media (width>=768px) and (width<=1023px),print and (width<=1023px){.lintje-grid>[style*=span\\ 4]{grid-column:span 6!important}.lintje-grid>[style*=span\\ 8]{grid-column:span 12!important}}@media screen and (width<=767px){.lintje-grid{grid-template-columns:minmax(0,1fr)!important}.lintje-grid>*{grid-column:span 1!important}}@media (width>=768px) and (width<=1023px),print and (width<=1023px){.lintje-grid--kpi-row{grid-template-columns:repeat(3,minmax(0,1fr))!important}.lintje-grid--kpi-row>*{grid-column:span 1!important}}@media screen and (width<=767px){.lintje-grid--kpi-row{grid-template-columns:repeat(2,minmax(0,1fr))!important}.lintje-grid--kpi-row>*{grid-column:span 1!important}}`,c=class extends e{static{this.styles=[t,n(s)]}static{this.properties={data:{attribute:!1}}}get dataSettings(){return this.data??void 0}render(){let e=this.data?.kpis??[],t=this.data?.columns??5;return o`<div
|
|
2
2
|
class="lintje-grid lintje-grid--kpi-row"
|
|
3
3
|
${i({gridTemplateColumns:`repeat(${t}, minmax(0, 1fr))`})}
|
|
4
4
|
>
|
package/dist-elements/tag/kpi.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{L as e,R as t,bt as n,cn as r,dn as i,f as a,g as o,i as s,jt as c,k as l,mn as u,n as d,o as f,on as p,pn as m,t as h,u as g,vt as _,xt as v}from"../chunks/base-
|
|
1
|
+
import{L as e,R as t,bt as n,cn as r,dn as i,f as a,g as o,i as s,jt as c,k as l,mn as u,n as d,o as f,on as p,pn as m,t as h,u as g,vt as _,xt as v}from"../chunks/base-DpZg_-sV.js";var y=`:host{min-width:0;display:block}:host([hidden]){display:none}@media print{:host{break-inside:avoid}}.lintje-kpi{gap:var(--space-2);background:var(--color-bg-surface);border:1px solid var(--color-border-default);border-top:4px solid var(--color-text-muted);border-radius:var(--radius);min-width:0;height:100%;padding:var(--space-4) var(--space-5);text-align:left;animation:lintje-rise var(--dur-kpi) var(--ease-in-motion) both;flex-direction:column;display:flex}.lintje-kpi__label{font:var(--text-tile-title);color:var(--color-text-primary)}.lintje-kpi--icon{grid-template-columns:auto minmax(0,1fr);align-content:start;display:grid}.lintje-kpi--icon>*{grid-column:1/-1;min-width:0}.lintje-kpi--icon>.lintje-kpi__icon{height:1lh;font:var(--text-tile-title);color:var(--color-text-primary);margin-right:var(--space-2);grid-area:1/1;align-items:center;display:flex}.lintje-kpi--icon>.lintje-kpi__icon:empty{display:none}.lintje-kpi--icon>.lintje-kpi__label{grid-area:1/2}.lintje-kpi__value{font:var(--text-kpi);letter-spacing:var(--kpi-tracking);font-variant-numeric:tabular-nums;color:var(--color-text-primary)}.lintje-kpi__suffix{color:var(--color-text-muted);margin-left:var(--space-2);font-size:1.25rem;font-weight:400}.lintje-kpi__count{display:inline-grid}.lintje-kpi__count-final,.lintje-kpi__count-live{grid-area:1/1}.lintje-kpi__count-final{opacity:0}.lintje-kpi__note{font:var(--text-small);color:var(--color-text-primary)}.lintje-kpi__note--error{align-items:center;gap:var(--space-2);display:flex}.lintje-kpi__dot{background:var(--color-error);border-radius:50%;flex:none;width:8px;height:8px}.lintje-kpi__detail{font:var(--text-small);color:var(--color-text-muted)}.lintje-kpi__figures{container-type:inline-size}.lintje-kpi__items{gap:var(--space-2);flex-direction:column;display:flex}.lintje-kpi__item{justify-content:space-between;align-items:baseline;column-gap:var(--space-4);flex-wrap:wrap;min-width:0;display:flex}.lintje-kpi__item--comparison .lintje-kpi__value{color:var(--color-text-secondary)}.lintje-kpi__period{font:var(--text-small);color:var(--color-text-muted)}.lintje-kpi__divider{background:var(--color-border-default);height:1px;display:block}.lintje-kpi__items--row{align-items:end;gap:var(--space-4);grid-auto-columns:minmax(0,1fr);grid-auto-flow:column;display:grid}.lintje-kpi__items--row.lintje-kpi__items--divided{grid-auto-columns:minmax(0,1fr) 1px}.lintje-kpi__items--row .lintje-kpi__item{display:block}.lintje-kpi__items--row .lintje-kpi__divider{align-self:stretch;height:auto}@container (width<318px){.lintje-kpi__items--row{align-items:stretch;gap:var(--space-2);display:flex}.lintje-kpi__items--row .lintje-kpi__item{display:flex}.lintje-kpi__items--row .lintje-kpi__divider{height:1px}}.lintje-kpi--primary .lintje-kpi__divider{margin-block:var(--space-1)}.lintje-kpi__secondary-value{font:var(--text-kpi-secondary);letter-spacing:var(--kpi-tracking);font-variant-numeric:tabular-nums;color:var(--color-text-secondary)}.lintje-kpi__skeleton{gap:var(--space-2);flex-direction:column;display:flex}@media screen and (width<=767px){.lintje-kpi{padding:var(--space-3) var(--space-4);gap:var(--space-1)}.lintje-kpi__value{font:var(--text-kpi-mobile);font-variant-numeric:tabular-nums}}@media (width>=1024px) and (width<=1439px){.lintje-kpi__value{font-size:1.75rem}}.lintje-kpi__sparkline{width:100%;height:var(--h-sparkline);display:block}.lintje-kpi__sparkline-svg{display:block;overflow:visible}.lintje-kpi__sparkline-line{fill:none;stroke:currentColor;stroke-width:2px;stroke-linejoin:round;stroke-linecap:round}.lintje-kpi__sparkline-area{fill:currentColor;fill-opacity:.14}.lintje-kpi__sparkline-point{fill:currentColor}.lintje-kpi__sparkline-end{fill:currentColor;stroke:var(--color-bg-surface);stroke-width:2px}@media (prefers-reduced-motion:no-preference){.lintje-kpi__sparkline-plot{clip-path:inset(-8px calc(100% + 8px) -8px -8px)}.lintje-kpi__sparkline.is-drawn .lintje-kpi__sparkline-plot{clip-path:inset(-8px);animation:lintje-kpi-reveal var(--dur-draw) var(--ease-in-motion) backwards;animation-delay:calc(var(--dur-kpi) + 40ms * var(--kpi-index,0))}}@keyframes lintje-kpi-reveal{0%{clip-path:inset(-8px calc(100% + 8px) -8px -8px)}to{clip-path:inset(-8px)}}.lintje-trend{gap:var(--space-2);font:var(--text-small);color:var(--color-text-primary);align-items:flex-start;display:flex}.lintje-trend__glyph{flex:none;font-size:1rem;font-weight:700;line-height:1.2}.lintje-trend__glyph--good{color:var(--color-success)}.lintje-trend__glyph--bad{color:var(--color-error)}.lintje-trend__glyph--neutral{color:var(--color-text-muted)}.lintje-trend__detail{font:var(--text-small);color:var(--color-text-muted)}.lintje-gauge--arc{aspect-ratio:2;width:min(100%,168px);margin-block:var(--space-4);position:relative}.lintje-gauge__svg{width:100%;height:100%;position:absolute;inset:0;overflow:visible}.lintje-gauge--arc .lintje-kpi__value,.lintje-gauge__skeleton{text-align:center;margin-inline:auto;position:absolute;bottom:0;left:0;right:0}.lintje-gauge__track{fill:none;stroke:var(--color-chart-remainder)}.lintje-gauge__arc-fill{fill:none;stroke-dasharray:1;animation:lintje-gauge-sweep var(--dur-draw) var(--ease-in-motion) both paused}.lintje-gauge__tick{stroke:var(--color-chart-emphasis);stroke-width:1px;stroke-dasharray:3 3}.lintje-gauge__label{font:var(--text-axis);color:var(--color-chart-axis);white-space:nowrap;position:absolute}.lintje-gauge__label--limit{transform:translate(-50%)}.lintje-gauge__label--middle{transform:translate(-50%,-100%)}.lintje-gauge__label--start{transform:translateY(-50%)}.lintje-gauge__label--end{transform:translate(-100%,-50%)}.lintje-gauge__frame{container-type:inline-size}@container (width<232px){.lintje-gauge--arc{margin-bottom:var(--space-8)}.lintje-gauge__label--target{transform:translate(-50%);left:50%!important;top:calc(100% + var(--space-4))!important}}@container (width<160px){.lintje-gauge--arc .lintje-kpi__value{font:var(--text-kpi-secondary);font-variant-numeric:tabular-nums}.lintje-gauge--arc .lintje-kpi__suffix{margin-left:var(--space-1);font-size:1rem}}.lintje-gauge--linear{gap:var(--space-1);flex-direction:column;display:flex}.lintje-gauge__plot{gap:var(--space-1);flex-direction:column;display:flex;position:relative}.lintje-gauge__bar{height:var(--space-4);margin-bottom:var(--space-1);background:var(--color-chart-remainder);position:relative}.lintje-gauge__bar-fill{transform-origin:0;height:100%;animation:lintje-gauge-grow var(--dur-draw) var(--ease-in-motion) both paused}.lintje-gauge__mark{border-left:1px dashed var(--color-chart-emphasis);position:absolute;top:0;bottom:0}.lintje-gauge__target,.lintje-gauge__scale{font:var(--text-axis);color:var(--color-chart-axis)}.lintje-gauge__target-label{white-space:nowrap;width:max-content;display:block}.lintje-gauge__target-label--start{padding-left:var(--space-2)}.lintje-gauge__target-label--end{padding-right:var(--space-2);transform:translate(-100%)}.lintje-gauge__scale{justify-content:space-between;display:flex}.lintje-gauge.is-drawn .lintje-gauge__arc-fill,.lintje-gauge.is-drawn .lintje-gauge__bar-fill{animation-play-state:running}@keyframes lintje-gauge-sweep{0%{stroke-dashoffset:1px}to{stroke-dashoffset:0}}@keyframes lintje-gauge-grow{0%{transform:scaleX(0)}to{transform:scaleX(1)}}@media (prefers-reduced-motion:reduce){.lintje-gauge__arc-fill,.lintje-gauge__bar-fill{animation:none}}@media (forced-colors:active){.lintje-kpi__divider,.lintje-kpi__dot{forced-color-adjust:none;background:canvastext}.lintje-kpi__sparkline-line{stroke:canvastext}.lintje-kpi__sparkline-area{fill:none}.lintje-kpi__sparkline-point,.lintje-kpi__sparkline-end{fill:canvastext;stroke:canvas}.lintje-gauge__bar{forced-color-adjust:none;background:canvas;outline:1px solid canvastext}.lintje-gauge__bar-fill{forced-color-adjust:none;background:highlight!important}.lintje-gauge__svg{forced-color-adjust:none}.lintje-gauge__track{stroke:graytext}.lintje-gauge__arc-fill{stroke:highlight!important}.lintje-gauge__tick{stroke:canvastext}.lintje-gauge__mark{border-color:canvastext}}.lintje-kpi__last-known{font:var(--text-small);color:var(--color-text-muted)}`,b=64,x=24,S=b-x/2-6,C=82,w=86,T=84;function E(e){let t=e.min??0,n=e.max>t?e.max:t+1;return{min:t,max:n,share:e=>Math.max(0,Math.min(1,(e-t)/(n-t)))}}function D(e,t){let n=Math.PI*(1-t);return[e*Math.cos(n),-e*Math.sin(n)]}function O(e,t){let{gauge:n,value:r}=e,i=n.target==null?``:`, ${n.targetLabel??`doel`} ${o(n.target)}`;return`${r==null||!e.ready?``:`${o(r)} `}op een schaal van ${o(t.min)} tot ${o(t.max)}${i}`}function k(e){return`${e.targetLabel??`doel`} ${o(e.target)}`}function A(e,t){return e.gauge.shape===`linear`?M(e,t):j(e,t)}function j(e,t){let{gauge:n,value:r,ready:a}=e,s=E(n),l=a&&r!=null&&s.share(r)>0?s.share(r):null,d=l==null?null:D(b,l),f=!e.loading&&n.target!=null,p=f?s.share(n.target):0,[h,g]=D(S,p),[v,y]=D(C,p),[A,j]=D(w,p),M=Math.cos(Math.PI*(1-p)),N=M>.3?`start`:M<-.3?`end`:`middle`,P=e=>`${(e+T)/168*100}%`;return m`<div class="lintje-gauge__frame"><div
|
|
2
2
|
class=${_({"lintje-gauge":!0,"lintje-gauge--arc":!0,"is-drawn":e.drawn})}>
|
|
3
3
|
${t}
|
|
4
4
|
<svg class="lintje-gauge__svg" viewBox="${-84} ${-84} ${168} ${T}" role="img"
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{an as e,cn as t,jt as n,on as r,pn as i,vt as a}from"../chunks/base-
|
|
1
|
+
import{an as e,cn as t,jt as n,on as r,pn as i,vt as a}from"../chunks/base-DpZg_-sV.js";var o=`:host{min-width:0;display:inline-flex}:host([hidden]){display:none}.lintje-level-meter{align-items:center;gap:var(--space-3);color:var(--color-text-primary);font:var(--text-ui);font-weight:700;display:inline-flex}.lintje-level-meter__bars{align-items:center;gap:var(--space-1);height:var(--space-6);display:inline-flex}.lintje-level-meter__bar{background:var(--color-accent-line);width:4px;transition:height var(--dur-hover) var(--ease-in-motion)}.lintje-level-meter.is-quiet .lintje-level-meter__bar{background:var(--color-border-strong)}@media (prefers-reduced-motion:reduce){.lintje-level-meter__bar{transition:none}}@media (forced-colors:active){.lintje-level-meter__bar{background:canvastext}}`,s=[.4,.8,.55,1,.45,.7,.9,.5,.75,.35];function c(e){return e<.05?`Stil`:e<.2?`Zacht`:`Goed`}var l=class extends e{constructor(...e){super(...e),this.words=!0}static{this.styles=t(o)}static{this.properties={level:{type:Number},words:{type:Boolean,reflect:!0}}}render(){let e=this.level==null?null:Math.min(1,Math.max(0,this.level)),t=e===null?`Nog niet gemeten`:c(e),r=e===null||e<.05;return i`<span
|
|
2
2
|
class=${a({"lintje-level-meter":!0,"is-quiet":r})}
|
|
3
3
|
role="img"
|
|
4
4
|
aria-label=${`Geluid: ${t.toLowerCase()}`}
|