@thxgg/steward 0.1.20 → 0.1.22
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/.output/nitro.json +1 -1
- package/.output/public/_nuxt/{Dn6yoG20.js → B4iDhohi.js} +2 -2
- package/.output/public/_nuxt/{CV5HFGKm.js → BQBm6AsP.js} +1 -1
- package/.output/public/_nuxt/{D6aZT905.js → BhBgWPCX.js} +1 -1
- package/.output/public/_nuxt/{BTHAQvnA.js → BuvhTQbX.js} +1 -1
- package/.output/public/_nuxt/{a87LfEfa.js → CL_YIWu4.js} +1 -1
- package/.output/public/_nuxt/CZWhz2fI.js +1 -0
- package/.output/public/_nuxt/C_5PUO5r.js +1 -0
- package/.output/public/_nuxt/{C2LWefrW.js → C_Sxjx0M.js} +1 -1
- package/.output/public/_nuxt/CjDuB5VD.js +1 -0
- package/.output/public/_nuxt/{DDV2bymk.js → CuOw9LiK.js} +1 -1
- package/.output/public/_nuxt/{CzCDTesu.js → DQivOuJJ.js} +1 -1
- package/.output/public/_nuxt/DUrbBKgG.js +3 -0
- package/.output/public/_nuxt/{B7kcsnX1.js → Du8Y9zEm.js} +1 -1
- package/.output/public/_nuxt/{DSqaInP-.js → HZy5mmMm.js} +1 -1
- package/.output/public/_nuxt/builds/latest.json +1 -1
- package/.output/public/_nuxt/builds/meta/3e08a0b0-262b-4fb5-b213-4aa35df11afb.json +1 -0
- package/.output/public/_nuxt/entry.xHdymH38.css +1 -0
- package/.output/public/_nuxt/{D9fz0wy8.js → okqELTtf.js} +1 -1
- package/.output/public/_nuxt/{ClxxfTZn.js → rG99Mq9f.js} +1 -1
- package/.output/public/_nuxt/rTDTR03M.js +30 -0
- package/.output/server/chunks/_/git-api.mjs +10 -23
- package/.output/server/chunks/_/git-api.mjs.map +1 -1
- package/.output/server/chunks/_/prd-service.mjs +1 -3
- package/.output/server/chunks/_/prd-service.mjs.map +1 -1
- package/.output/server/chunks/_/watcher.mjs +1 -2
- package/.output/server/chunks/_/watcher.mjs.map +1 -1
- package/.output/server/chunks/build/_prd_-DY25apyl.mjs +2 -1
- package/.output/server/chunks/build/client.precomputed.mjs +1 -1
- package/.output/server/chunks/build/default-BKKgG7HJ.mjs +2 -1
- package/.output/server/chunks/build/error-404-Bf6kdO80.mjs +2 -1
- package/.output/server/chunks/build/error-500-D_bcARXN.mjs +2 -1
- package/.output/server/chunks/build/index-DE1tjHAd.mjs +2 -1
- package/.output/server/chunks/build/nuxt-link-SvT1nf8Z.mjs +1 -1
- package/.output/server/chunks/build/repo-graph-CUcJKW1F.mjs +2 -1
- package/.output/server/chunks/build/server.mjs +3 -2
- package/.output/server/chunks/build/usePrd-hXZOmvAv.mjs +1 -1
- package/.output/server/chunks/nitro/nitro.mjs +1510 -690
- package/.output/server/chunks/nitro/nitro.mjs.map +1 -1
- package/.output/server/chunks/routes/api/browse.get.mjs +1 -0
- package/.output/server/chunks/routes/api/browse.get.mjs.map +1 -1
- package/.output/server/chunks/routes/api/index.get.mjs +3 -3
- package/.output/server/chunks/routes/api/index.post.mjs +2 -2
- package/.output/server/chunks/routes/api/repos/_repoId/git/commits.get.mjs +3 -5
- package/.output/server/chunks/routes/api/repos/_repoId/git/commits.get.mjs.map +1 -1
- package/.output/server/chunks/routes/api/repos/_repoId/git/diff.get.mjs +3 -5
- package/.output/server/chunks/routes/api/repos/_repoId/git/diff.get.mjs.map +1 -1
- package/.output/server/chunks/routes/api/repos/_repoId/git/file-content.get.mjs +3 -5
- package/.output/server/chunks/routes/api/repos/_repoId/git/file-content.get.mjs.map +1 -1
- package/.output/server/chunks/routes/api/repos/_repoId/git/file-diff.get.mjs +3 -5
- package/.output/server/chunks/routes/api/repos/_repoId/git/file-diff.get.mjs.map +1 -1
- package/.output/server/chunks/routes/api/repos/_repoId/graph.get.mjs +3 -5
- package/.output/server/chunks/routes/api/repos/_repoId/graph.get.mjs.map +1 -1
- package/.output/server/chunks/routes/api/repos/_repoId/prd/_prdSlug/archive.post.mjs +2 -4
- package/.output/server/chunks/routes/api/repos/_repoId/prd/_prdSlug/archive.post.mjs.map +1 -1
- package/.output/server/chunks/routes/api/repos/_repoId/prd/_prdSlug/graph.get.mjs +3 -5
- package/.output/server/chunks/routes/api/repos/_repoId/prd/_prdSlug/graph.get.mjs.map +1 -1
- package/.output/server/chunks/routes/api/repos/_repoId/prd/_prdSlug/progress.get.mjs +3 -5
- package/.output/server/chunks/routes/api/repos/_repoId/prd/_prdSlug/progress.get.mjs.map +1 -1
- package/.output/server/chunks/routes/api/repos/_repoId/prd/_prdSlug/tasks/_taskId/commits.get.mjs +3 -5
- package/.output/server/chunks/routes/api/repos/_repoId/prd/_prdSlug/tasks/_taskId/commits.get.mjs.map +1 -1
- package/.output/server/chunks/routes/api/repos/_repoId/prd/_prdSlug/tasks.get.mjs +3 -5
- package/.output/server/chunks/routes/api/repos/_repoId/prd/_prdSlug/tasks.get.mjs.map +1 -1
- package/.output/server/chunks/routes/api/repos/_repoId/prd/_prdSlug_.get.mjs +3 -5
- package/.output/server/chunks/routes/api/repos/_repoId/prd/_prdSlug_.get.mjs.map +1 -1
- package/.output/server/chunks/routes/api/repos/_repoId/prds.get.mjs +3 -5
- package/.output/server/chunks/routes/api/repos/_repoId/prds.get.mjs.map +1 -1
- package/.output/server/chunks/routes/api/repos/_repoId/refresh-git-repos.post.mjs +3 -3
- package/.output/server/chunks/routes/api/repos/_repoId_.delete.mjs +3 -3
- package/.output/server/chunks/routes/api/runtime.get.mjs +3 -2
- package/.output/server/chunks/routes/api/runtime.get.mjs.map +1 -1
- package/.output/server/chunks/routes/api/state-migration/status.get.mjs +3 -2
- package/.output/server/chunks/routes/api/state-migration/status.get.mjs.map +1 -1
- package/.output/server/chunks/routes/api/watch.get.mjs +3 -3
- package/.output/server/chunks/routes/renderer.mjs +1 -1
- package/.output/server/index.mjs +3 -2
- package/.output/server/index.mjs.map +1 -1
- package/.output/server/package.json +1 -1
- package/dist/host/src/api/git.js +14 -7
- package/dist/server/utils/git-repo-path.js +63 -0
- package/dist/server/utils/git.js +26 -9
- package/dist/server/utils/state-migration.js +206 -0
- package/package.json +1 -1
- package/.output/public/_nuxt/B3PShd4B.js +0 -3
- package/.output/public/_nuxt/B9j1BHt9.js +0 -1
- package/.output/public/_nuxt/BGSfDLaX.js +0 -1
- package/.output/public/_nuxt/DK5VWQk7.js +0 -1
- package/.output/public/_nuxt/builds/meta/37438177-5e14-4a46-9af4-eae491ba1f24.json +0 -1
- package/.output/public/_nuxt/entry.Dp3jx0Yw.css +0 -1
- package/.output/public/_nuxt/zhOijcjw.js +0 -30
- package/.output/server/chunks/_/git.mjs +0 -296
- package/.output/server/chunks/_/git.mjs.map +0 -1
- package/.output/server/chunks/_/repos.mjs +0 -272
- package/.output/server/chunks/_/repos.mjs.map +0 -1
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./D6aZT905.js","./CV5HFGKm.js","./Dn6yoG20.js","./entry.Dp3jx0Yw.css"])))=>i.map(i=>d[i]);
|
|
2
|
-
import{c as Pe,f as Qi,B as ct,b as Ji,F as es,r as ts,e as ns}from"./BGSfDLaX.js";import{g as xe,N as os,A as xo,o as q,c as ee,b as oe,w as me,y as Ie,l as I,i as At,O as Dr,k as ye,E as Ve,H as ze,s as re,P as rs,z as rt,a as Z,F as $e,r as Re,B as nt,D as zr,Q as is,x as be,n as he,q as ve,C as ut,R as Ce,t as fe,S as Lt,T as Ar,U as pn,V as Mt,W as ke,X as _e,Y as ss,m as bo,v as as,Z as ls,_ as us,$ as St,a0 as cs,a1 as Lr,a2 as ds,L as Eo,I as He,d as Se,a3 as fs,a4 as hs,a5 as gs,a6 as ps}from"./Dn6yoG20.js";import{T as It,L as ro,C as bn,G as vs,f as ms,R as zo,g as Ao,h as Lo,i as Bo,K as ys,j as Ro,S as ws,k as _s,B as vn,l as xs,m as bs,n as Es,o as ks,p as Ss,q as Ns,r as Cs,s as $s,t as Ms}from"./B3PShd4B.js";import{A as Vo}from"./B7kcsnX1.js";import{_ as Is}from"./DlAUqK2U.js";import{_ as Ps}from"./CzCDTesu.js";const Ts=Pe("arrow-left",[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]]);const Os=Pe("calendar",[["path",{d:"M8 2v4",key:"1cmpym"}],["path",{d:"M16 2v4",key:"4m81vk"}],["rect",{width:"18",height:"18",x:"3",y:"4",rx:"2",key:"1hopcy"}],["path",{d:"M3 10h18",key:"8toen8"}]]);const En=Pe("circle-check",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]]);const Gt=Pe("circle",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]]);const Br=Pe("clock-3",[["path",{d:"M12 6v6h4",key:"135r8i"}],["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]]);const Ds=Pe("clock",[["path",{d:"M12 6v6l4 2",key:"mmk7yg"}],["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]]);const zs=Pe("diff",[["path",{d:"M12 3v14",key:"7cf3v8"}],["path",{d:"M5 10h14",key:"elsbfy"}],["path",{d:"M5 21h14",key:"11awu3"}]]);const As=Pe("external-link",[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"M10 14 21 3",key:"gplh6r"}],["path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6",key:"a6xqqp"}]]);const Ls=Pe("file-code",[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M10 12.5 8 15l2 2.5",key:"1tg20x"}],["path",{d:"m14 12.5 2 2.5-2 2.5",key:"yinavb"}]]);const Bs=Pe("file-diff",[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M9 10h6",key:"9gxzsh"}],["path",{d:"M12 13V7",key:"h0r20n"}],["path",{d:"M9 17h6",key:"r8uit2"}]]);const Rs=Pe("file-exclamation-point",[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]]);const Vs=Pe("file-pen",[["path",{d:"M12.659 22H18a2 2 0 0 0 2-2V8a2.4 2.4 0 0 0-.706-1.706l-3.588-3.588A2.4 2.4 0 0 0 14 2H6a2 2 0 0 0-2 2v9.34",key:"o6klzx"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M10.378 12.622a1 1 0 0 1 3 3.003L8.36 20.637a2 2 0 0 1-.854.506l-2.867.837a.5.5 0 0 1-.62-.62l.836-2.869a2 2 0 0 1 .506-.853z",key:"zhnas1"}]]);const Hs=Pe("file-plus",[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M9 15h6",key:"cctwl0"}],["path",{d:"M12 18v-6",key:"17g6i2"}]]);const Fs=Pe("file-x",[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"m14.5 12.5-5 5",key:"b62r18"}],["path",{d:"m9.5 12.5 5 5",key:"1rk7el"}]]);const Gs=Pe("folder-git-2",[["path",{d:"M18 19a5 5 0 0 1-5-5v8",key:"sz5oeg"}],["path",{d:"M9 20H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H20a2 2 0 0 1 2 2v5",key:"1w6njk"}],["circle",{cx:"13",cy:"12",r:"2",key:"1j92g6"}],["circle",{cx:"20",cy:"19",r:"2",key:"1obnsp"}]]);const Ys=Pe("git-commit-horizontal",[["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}],["line",{x1:"3",x2:"9",y1:"12",y2:"12",key:"1dyftd"}],["line",{x1:"15",x2:"21",y1:"12",y2:"12",key:"oup4p8"}]]);const js=Pe("link-2-off",[["path",{d:"M9 17H7A5 5 0 0 1 7 7",key:"10o201"}],["path",{d:"M15 7h2a5 5 0 0 1 4 8",key:"1d3206"}],["line",{x1:"8",x2:"12",y1:"12",y2:"12",key:"rvw6j4"}],["line",{x1:"2",x2:"22",y1:"2",y2:"22",key:"a6p6uj"}]]);const Xs=Pe("link-2",[["path",{d:"M9 17H7A5 5 0 0 1 7 7h2",key:"8i5ue5"}],["path",{d:"M15 7h2a5 5 0 1 1 0 10h-2",key:"1b9ql8"}],["line",{x1:"8",x2:"16",y1:"12",y2:"12",key:"1jonct"}]]);const Ws=Pe("link",[["path",{d:"M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71",key:"1cjeqo"}],["path",{d:"M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71",key:"19qd67"}]]);const Us=Pe("list-ordered",[["path",{d:"M11 5h10",key:"1cz7ny"}],["path",{d:"M11 12h10",key:"1438ji"}],["path",{d:"M11 19h10",key:"11t30w"}],["path",{d:"M4 4h1v5",key:"10yrso"}],["path",{d:"M4 9h2",key:"r1h2o0"}],["path",{d:"M6.5 20H3.4c0-1 2.6-1.925 2.6-3.5a1.5 1.5 0 0 0-2.6-1.02",key:"xtkcd5"}]]);const qs=Pe("minus",[["path",{d:"M5 12h14",key:"1ays0h"}]]);const Zs=Pe("square-check-big",[["path",{d:"M21 10.656V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h12.344",key:"2acyp4"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]]);const Ks=Pe("tag",[["path",{d:"M12.586 2.586A2 2 0 0 0 11.172 2H4a2 2 0 0 0-2 2v7.172a2 2 0 0 0 .586 1.414l8.704 8.704a2.426 2.426 0 0 0 3.42 0l6.58-6.58a2.426 2.426 0 0 0 0-3.42z",key:"vktsd0"}],["circle",{cx:"7.5",cy:"7.5",r:".5",fill:"currentColor",key:"kqv944"}]]);var Ne=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),Ye=Ne((e,t)=>{var n=Object.defineProperty,o=(R,v,$)=>v in R?n(R,v,{enumerable:!0,configurable:!0,writable:!0,value:$}):R[v]=$,r=(R,v)=>()=>(v||R((v={exports:{}}).exports,v),v.exports),i=(R,v,$)=>o(R,typeof v!="symbol"?v+"":v,$),s=r((R,v)=>{var $="\0",y="\0",b="",S=class{constructor(P){i(this,"_isDirected",!0),i(this,"_isMultigraph",!1),i(this,"_isCompound",!1),i(this,"_label"),i(this,"_defaultNodeLabelFn",()=>{}),i(this,"_defaultEdgeLabelFn",()=>{}),i(this,"_nodes",{}),i(this,"_in",{}),i(this,"_preds",{}),i(this,"_out",{}),i(this,"_sucs",{}),i(this,"_edgeObjs",{}),i(this,"_edgeLabels",{}),i(this,"_nodeCount",0),i(this,"_edgeCount",0),i(this,"_parent"),i(this,"_children"),P&&(this._isDirected=Object.hasOwn(P,"directed")?P.directed:!0,this._isMultigraph=Object.hasOwn(P,"multigraph")?P.multigraph:!1,this._isCompound=Object.hasOwn(P,"compound")?P.compound:!1),this._isCompound&&(this._parent={},this._children={},this._children[y]={})}isDirected(){return this._isDirected}isMultigraph(){return this._isMultigraph}isCompound(){return this._isCompound}setGraph(P){return this._label=P,this}graph(){return this._label}setDefaultNodeLabel(P){return this._defaultNodeLabelFn=P,typeof P!="function"&&(this._defaultNodeLabelFn=()=>P),this}nodeCount(){return this._nodeCount}nodes(){return Object.keys(this._nodes)}sources(){var P=this;return this.nodes().filter(m=>Object.keys(P._in[m]).length===0)}sinks(){var P=this;return this.nodes().filter(m=>Object.keys(P._out[m]).length===0)}setNodes(P,m){var C=arguments,T=this;return P.forEach(function(j){C.length>1?T.setNode(j,m):T.setNode(j)}),this}setNode(P,m){return Object.hasOwn(this._nodes,P)?(arguments.length>1&&(this._nodes[P]=m),this):(this._nodes[P]=arguments.length>1?m:this._defaultNodeLabelFn(P),this._isCompound&&(this._parent[P]=y,this._children[P]={},this._children[y][P]=!0),this._in[P]={},this._preds[P]={},this._out[P]={},this._sucs[P]={},++this._nodeCount,this)}node(P){return this._nodes[P]}hasNode(P){return Object.hasOwn(this._nodes,P)}removeNode(P){var m=this;if(Object.hasOwn(this._nodes,P)){var C=T=>m.removeEdge(m._edgeObjs[T]);delete this._nodes[P],this._isCompound&&(this._removeFromParentsChildList(P),delete this._parent[P],this.children(P).forEach(function(T){m.setParent(T)}),delete this._children[P]),Object.keys(this._in[P]).forEach(C),delete this._in[P],delete this._preds[P],Object.keys(this._out[P]).forEach(C),delete this._out[P],delete this._sucs[P],--this._nodeCount}return this}setParent(P,m){if(!this._isCompound)throw new Error("Cannot set parent in a non-compound graph");if(m===void 0)m=y;else{m+="";for(var C=m;C!==void 0;C=this.parent(C))if(C===P)throw new Error("Setting "+m+" as parent of "+P+" would create a cycle");this.setNode(m)}return this.setNode(P),this._removeFromParentsChildList(P),this._parent[P]=m,this._children[m][P]=!0,this}_removeFromParentsChildList(P){delete this._children[this._parent[P]][P]}parent(P){if(this._isCompound){var m=this._parent[P];if(m!==y)return m}}children(P=y){if(this._isCompound){var m=this._children[P];if(m)return Object.keys(m)}else{if(P===y)return this.nodes();if(this.hasNode(P))return[]}}predecessors(P){var m=this._preds[P];if(m)return Object.keys(m)}successors(P){var m=this._sucs[P];if(m)return Object.keys(m)}neighbors(P){var m=this.predecessors(P);if(m){let T=new Set(m);for(var C of this.successors(P))T.add(C);return Array.from(T.values())}}isLeaf(P){var m;return this.isDirected()?m=this.successors(P):m=this.neighbors(P),m.length===0}filterNodes(P){var m=new this.constructor({directed:this._isDirected,multigraph:this._isMultigraph,compound:this._isCompound});m.setGraph(this.graph());var C=this;Object.entries(this._nodes).forEach(function([Q,te]){P(Q)&&m.setNode(Q,te)}),Object.values(this._edgeObjs).forEach(function(Q){m.hasNode(Q.v)&&m.hasNode(Q.w)&&m.setEdge(Q,C.edge(Q))});var T={};function j(Q){var te=C.parent(Q);return te===void 0||m.hasNode(te)?(T[Q]=te,te):te in T?T[te]:j(te)}return this._isCompound&&m.nodes().forEach(Q=>m.setParent(Q,j(Q))),m}setDefaultEdgeLabel(P){return this._defaultEdgeLabelFn=P,typeof P!="function"&&(this._defaultEdgeLabelFn=()=>P),this}edgeCount(){return this._edgeCount}edges(){return Object.values(this._edgeObjs)}setPath(P,m){var C=this,T=arguments;return P.reduce(function(j,Q){return T.length>1?C.setEdge(j,Q,m):C.setEdge(j,Q),Q}),this}setEdge(){var P,m,C,T,j=!1,Q=arguments[0];typeof Q=="object"&&Q!==null&&"v"in Q?(P=Q.v,m=Q.w,C=Q.name,arguments.length===2&&(T=arguments[1],j=!0)):(P=Q,m=arguments[1],C=arguments[3],arguments.length>2&&(T=arguments[2],j=!0)),P=""+P,m=""+m,C!==void 0&&(C=""+C);var te=H(this._isDirected,P,m,C);if(Object.hasOwn(this._edgeLabels,te))return j&&(this._edgeLabels[te]=T),this;if(C!==void 0&&!this._isMultigraph)throw new Error("Cannot set a named edge when isMultigraph = false");this.setNode(P),this.setNode(m),this._edgeLabels[te]=j?T:this._defaultEdgeLabelFn(P,m,C);var ne=W(this._isDirected,P,m,C);return P=ne.v,m=ne.w,Object.freeze(ne),this._edgeObjs[te]=ne,O(this._preds[m],P),O(this._sucs[P],m),this._in[m][te]=ne,this._out[P][te]=ne,this._edgeCount++,this}edge(P,m,C){var T=arguments.length===1?K(this._isDirected,arguments[0]):H(this._isDirected,P,m,C);return this._edgeLabels[T]}edgeAsObj(){let P=this.edge(...arguments);return typeof P!="object"?{label:P}:P}hasEdge(P,m,C){var T=arguments.length===1?K(this._isDirected,arguments[0]):H(this._isDirected,P,m,C);return Object.hasOwn(this._edgeLabels,T)}removeEdge(P,m,C){var T=arguments.length===1?K(this._isDirected,arguments[0]):H(this._isDirected,P,m,C),j=this._edgeObjs[T];return j&&(P=j.v,m=j.w,delete this._edgeLabels[T],delete this._edgeObjs[T],B(this._preds[m],P),B(this._sucs[P],m),delete this._in[m][T],delete this._out[P][T],this._edgeCount--),this}inEdges(P,m){return this.isDirected()?this.filterEdges(this._in[P],P,m):this.nodeEdges(P,m)}outEdges(P,m){return this.isDirected()?this.filterEdges(this._out[P],P,m):this.nodeEdges(P,m)}nodeEdges(P,m){if(P in this._nodes)return this.filterEdges({...this._in[P],...this._out[P]},P,m)}filterEdges(P,m,C){if(P){var T=Object.values(P);return C?T.filter(function(j){return j.v===m&&j.w===C||j.v===C&&j.w===m}):T}}};function O(P,m){P[m]?P[m]++:P[m]=1}function B(P,m){--P[m]||delete P[m]}function H(P,m,C,T){var j=""+m,Q=""+C;if(!P&&j>Q){var te=j;j=Q,Q=te}return j+b+Q+b+(T===void 0?$:T)}function W(P,m,C,T){var j=""+m,Q=""+C;if(!P&&j>Q){var te=j;j=Q,Q=te}var ne={v:j,w:Q};return T&&(ne.name=T),ne}function K(P,m){return H(P,m.v,m.w,m.name)}v.exports=S}),l=r((R,v)=>{v.exports="3.0.2"}),a=r((R,v)=>{v.exports={Graph:s(),version:l()}}),u=r((R,v)=>{var $=s();v.exports={write:y,read:O};function y(B){var H={options:{directed:B.isDirected(),multigraph:B.isMultigraph(),compound:B.isCompound()},nodes:b(B),edges:S(B)};return B.graph()!==void 0&&(H.value=structuredClone(B.graph())),H}function b(B){return B.nodes().map(function(H){var W=B.node(H),K=B.parent(H),P={v:H};return W!==void 0&&(P.value=W),K!==void 0&&(P.parent=K),P})}function S(B){return B.edges().map(function(H){var W=B.edge(H),K={v:H.v,w:H.w};return H.name!==void 0&&(K.name=H.name),W!==void 0&&(K.value=W),K})}function O(B){var H=new $(B.options).setGraph(B.value);return B.nodes.forEach(function(W){H.setNode(W.v,W.value),W.parent&&H.setParent(W.v,W.parent)}),B.edges.forEach(function(W){H.setEdge({v:W.v,w:W.w,name:W.name},W.value)}),H}}),c=r((R,v)=>{v.exports=y;var $=()=>1;function y(S,O,B,H){return b(S,String(O),B||$,H||function(W){return S.outEdges(W)})}function b(S,O,B,H){var W={},K=!0,P=0,m=S.nodes(),C=function(te){var ne=B(te);W[te.v].distance+ne<W[te.w].distance&&(W[te.w]={distance:W[te.v].distance+ne,predecessor:te.v},K=!0)},T=function(){m.forEach(function(te){H(te).forEach(function(ne){var ie=ne.v===te?ne.v:ne.w,ge=ie===ne.v?ne.w:ne.v;C({v:ie,w:ge})})})};m.forEach(function(te){var ne=te===O?0:Number.POSITIVE_INFINITY;W[te]={distance:ne}});for(var j=m.length,Q=1;Q<j&&(K=!1,P++,T(),!!K);Q++);if(P===j-1&&(K=!1,T(),K))throw new Error("The graph contains a negative weight cycle");return W}}),d=r((R,v)=>{v.exports=$;function $(y){var b={},S=[],O;function B(H){Object.hasOwn(b,H)||(b[H]=!0,O.push(H),y.successors(H).forEach(B),y.predecessors(H).forEach(B))}return y.nodes().forEach(function(H){O=[],B(H),O.length&&S.push(O)}),S}}),f=r((R,v)=>{var $=class{constructor(){i(this,"_arr",[]),i(this,"_keyIndices",{})}size(){return this._arr.length}keys(){return this._arr.map(function(y){return y.key})}has(y){return Object.hasOwn(this._keyIndices,y)}priority(y){var b=this._keyIndices[y];if(b!==void 0)return this._arr[b].priority}min(){if(this.size()===0)throw new Error("Queue underflow");return this._arr[0].key}add(y,b){var S=this._keyIndices;if(y=String(y),!Object.hasOwn(S,y)){var O=this._arr,B=O.length;return S[y]=B,O.push({key:y,priority:b}),this._decrease(B),!0}return!1}removeMin(){this._swap(0,this._arr.length-1);var y=this._arr.pop();return delete this._keyIndices[y.key],this._heapify(0),y.key}decrease(y,b){var S=this._keyIndices[y];if(b>this._arr[S].priority)throw new Error("New priority is greater than current priority. Key: "+y+" Old: "+this._arr[S].priority+" New: "+b);this._arr[S].priority=b,this._decrease(S)}_heapify(y){var b=this._arr,S=2*y,O=S+1,B=y;S<b.length&&(B=b[S].priority<b[B].priority?S:B,O<b.length&&(B=b[O].priority<b[B].priority?O:B),B!==y&&(this._swap(y,B),this._heapify(B)))}_decrease(y){for(var b=this._arr,S=b[y].priority,O;y!==0&&(O=y>>1,!(b[O].priority<S));)this._swap(y,O),y=O}_swap(y,b){var S=this._arr,O=this._keyIndices,B=S[y],H=S[b];S[y]=H,S[b]=B,O[H.key]=y,O[B.key]=b}};v.exports=$}),h=r((R,v)=>{var $=f();v.exports=b;var y=()=>1;function b(O,B,H,W){var K=function(P){return O.outEdges(P)};return S(O,String(B),H||y,W||K)}function S(O,B,H,W){var K={},P=new $,m,C,T=function(j){var Q=j.v!==m?j.v:j.w,te=K[Q],ne=H(j),ie=C.distance+ne;if(ne<0)throw new Error("dijkstra does not allow negative edge weights. Bad edge: "+j+" Weight: "+ne);ie<te.distance&&(te.distance=ie,te.predecessor=m,P.decrease(Q,ie))};for(O.nodes().forEach(function(j){var Q=j===B?0:Number.POSITIVE_INFINITY;K[j]={distance:Q},P.add(j,Q)});P.size()>0&&(m=P.removeMin(),C=K[m],C.distance!==Number.POSITIVE_INFINITY);)W(m).forEach(T);return K}}),k=r((R,v)=>{var $=h();v.exports=y;function y(b,S,O){return b.nodes().reduce(function(B,H){return B[H]=$(b,H,S,O),B},{})}}),N=r((R,v)=>{v.exports=$;function $(b,S,O){if(b[S].predecessor!==void 0)throw new Error("Invalid source vertex");if(b[O].predecessor===void 0&&O!==S)throw new Error("Invalid destination vertex");return{weight:b[O].distance,path:y(b,S,O)}}function y(b,S,O){for(var B=[],H=O;H!==S;)B.push(H),H=b[H].predecessor;return B.push(S),B.reverse()}}),_=r((R,v)=>{v.exports=$;function $(y){var b=0,S=[],O={},B=[];function H(W){var K=O[W]={onStack:!0,lowlink:b,index:b++};if(S.push(W),y.successors(W).forEach(function(C){Object.hasOwn(O,C)?O[C].onStack&&(K.lowlink=Math.min(K.lowlink,O[C].index)):(H(C),K.lowlink=Math.min(K.lowlink,O[C].lowlink))}),K.lowlink===K.index){var P=[],m;do m=S.pop(),O[m].onStack=!1,P.push(m);while(W!==m);B.push(P)}}return y.nodes().forEach(function(W){Object.hasOwn(O,W)||H(W)}),B}}),E=r((R,v)=>{var $=_();v.exports=y;function y(b){return $(b).filter(function(S){return S.length>1||S.length===1&&b.hasEdge(S[0],S[0])})}}),w=r((R,v)=>{v.exports=y;var $=()=>1;function y(S,O,B){return b(S,O||$,B||function(H){return S.outEdges(H)})}function b(S,O,B){var H={},W=S.nodes();return W.forEach(function(K){H[K]={},H[K][K]={distance:0},W.forEach(function(P){K!==P&&(H[K][P]={distance:Number.POSITIVE_INFINITY})}),B(K).forEach(function(P){var m=P.v===K?P.w:P.v,C=O(P);H[K][m]={distance:C,predecessor:K}})}),W.forEach(function(K){var P=H[K];W.forEach(function(m){var C=H[m];W.forEach(function(T){var j=C[K],Q=P[T],te=C[T],ne=j.distance+Q.distance;ne<te.distance&&(te.distance=ne,te.predecessor=Q.predecessor)})})}),H}}),p=r((R,v)=>{function $(b){var S={},O={},B=[];function H(W){if(Object.hasOwn(O,W))throw new y;Object.hasOwn(S,W)||(O[W]=!0,S[W]=!0,b.predecessors(W).forEach(H),delete O[W],B.push(W))}if(b.sinks().forEach(H),Object.keys(S).length!==b.nodeCount())throw new y;return B}var y=class extends Error{constructor(){super(...arguments)}};v.exports=$,$.CycleException=y}),g=r((R,v)=>{var $=p();v.exports=y;function y(b){try{$(b)}catch(S){if(S instanceof $.CycleException)return!1;throw S}return!0}}),L=r((R,v)=>{v.exports=$;function $(b,S,O,B,H){Array.isArray(S)||(S=[S]);var W=(b.isDirected()?b.successors:b.neighbors).bind(b),K={};return S.forEach(function(P){if(!b.hasNode(P))throw new Error("Graph does not have node: "+P);H=y(b,P,O==="post",K,W,B,H)}),H}function y(b,S,O,B,H,W,K){return Object.hasOwn(B,S)||(B[S]=!0,O||(K=W(K,S)),H(S).forEach(function(P){K=y(b,P,O,B,H,W,K)}),O&&(K=W(K,S))),K}}),V=r((R,v)=>{var $=L();v.exports=y;function y(b,S,O){return $(b,S,O,function(B,H){return B.push(H),B},[])}}),G=r((R,v)=>{var $=V();v.exports=y;function y(b,S){return $(b,S,"post")}}),Y=r((R,v)=>{var $=V();v.exports=y;function y(b,S){return $(b,S,"pre")}}),J=r((R,v)=>{var $=s(),y=f();v.exports=b;function b(S,O){var B=new $,H={},W=new y,K;function P(C){var T=C.v===K?C.w:C.v,j=W.priority(T);if(j!==void 0){var Q=O(C);Q<j&&(H[T]=K,W.decrease(T,Q))}}if(S.nodeCount()===0)return B;S.nodes().forEach(function(C){W.add(C,Number.POSITIVE_INFINITY),B.setNode(C)}),W.decrease(S.nodes()[0],0);for(var m=!1;W.size()>0;){if(K=W.removeMin(),Object.hasOwn(H,K))B.setEdge(K,H[K]);else{if(m)throw new Error("Input graph is not connected: "+S);m=!0}S.nodeEdges(K).forEach(P)}return B}}),D=r((R,v)=>{var $=h(),y=c();v.exports=b;function b(O,B,H,W){return S(O,B,H,W||function(K){return O.outEdges(K)})}function S(O,B,H,W){if(H===void 0)return $(O,B,H,W);for(var K=!1,P=O.nodes(),m=0;m<P.length;m++){for(var C=W(P[m]),T=0;T<C.length;T++){var j=C[T],Q=j.v===P[m]?j.v:j.w,te=Q===j.v?j.w:j.v;H({v:Q,w:te})<0&&(K=!0)}if(K)return y(O,B,H,W)}return $(O,B,H,W)}}),z=r((R,v)=>{v.exports={bellmanFord:c(),components:d(),dijkstra:h(),dijkstraAll:k(),extractPath:N(),findCycles:E(),floydWarshall:w(),isAcyclic:g(),postorder:G(),preorder:Y(),prim:J(),shortestPaths:D(),reduce:L(),tarjan:_(),topsort:p()}}),x=a();t.exports={Graph:x.Graph,json:u(),alg:z(),version:x.version}}),Qs=Ne((e,t)=>{var n=class{constructor(){let i={};i._next=i._prev=i,this._sentinel=i}dequeue(){let i=this._sentinel,s=i._prev;if(s!==i)return o(s),s}enqueue(i){let s=this._sentinel;i._prev&&i._next&&o(i),i._next=s._next,s._next._prev=i,s._next=i,i._prev=s}toString(){let i=[],s=this._sentinel,l=s._prev;for(;l!==s;)i.push(JSON.stringify(l,r)),l=l._prev;return"["+i.join(", ")+"]"}};function o(i){i._prev._next=i._next,i._next._prev=i._prev,delete i._next,delete i._prev}function r(i,s){if(i!=="_next"&&i!=="_prev")return s}t.exports=n}),Js=Ne((e,t)=>{var n=Ye().Graph,o=Qs();t.exports=i;var r=()=>1;function i(d,f){if(d.nodeCount()<=1)return[];let h=a(d,f||r);return s(h.graph,h.buckets,h.zeroIdx).flatMap(k=>d.outEdges(k.v,k.w))}function s(d,f,h){let k=[],N=f[f.length-1],_=f[0],E;for(;d.nodeCount();){for(;E=_.dequeue();)l(d,f,h,E);for(;E=N.dequeue();)l(d,f,h,E);if(d.nodeCount()){for(let w=f.length-2;w>0;--w)if(E=f[w].dequeue(),E){k=k.concat(l(d,f,h,E,!0));break}}}return k}function l(d,f,h,k,N){let _=N?[]:void 0;return d.inEdges(k.v).forEach(E=>{let w=d.edge(E),p=d.node(E.v);N&&_.push({v:E.v,w:E.w}),p.out-=w,u(f,h,p)}),d.outEdges(k.v).forEach(E=>{let w=d.edge(E),p=E.w,g=d.node(p);g.in-=w,u(f,h,g)}),d.removeNode(k.v),_}function a(d,f){let h=new n,k=0,N=0;d.nodes().forEach(w=>{h.setNode(w,{v:w,in:0,out:0})}),d.edges().forEach(w=>{let p=h.edge(w.v,w.w)||0,g=f(w),L=p+g;h.setEdge(w.v,w.w,L),N=Math.max(N,h.node(w.v).out+=g),k=Math.max(k,h.node(w.w).in+=g)});let _=c(N+k+3).map(()=>new o),E=k+1;return h.nodes().forEach(w=>{u(_,E,h.node(w))}),{graph:h,buckets:_,zeroIdx:E}}function u(d,f,h){h.out?h.in?d[h.out-h.in+f].enqueue(h):d[d.length-1].enqueue(h):d[0].enqueue(h)}function c(d){let f=[];for(let h=0;h<d;h++)f.push(h);return f}}),De=Ne((e,t)=>{var n=Ye().Graph;t.exports={addBorderNode:f,addDummyNode:o,applyWithChunking:N,asNonCompoundGraph:i,buildLayerMatrix:u,intersectRect:a,mapValues:Y,maxRank:_,normalizeRanks:c,notime:p,partition:E,pick:G,predecessorWeights:l,range:V,removeEmptyRanks:d,simplify:r,successorWeights:s,time:w,uniqueId:L,zipObject:J};function o(D,z,x,R){for(var v=R;D.hasNode(v);)v=L(R);return x.dummy=z,D.setNode(v,x),v}function r(D){let z=new n().setGraph(D.graph());return D.nodes().forEach(x=>z.setNode(x,D.node(x))),D.edges().forEach(x=>{let R=z.edge(x.v,x.w)||{weight:0,minlen:1},v=D.edge(x);z.setEdge(x.v,x.w,{weight:R.weight+v.weight,minlen:Math.max(R.minlen,v.minlen)})}),z}function i(D){let z=new n({multigraph:D.isMultigraph()}).setGraph(D.graph());return D.nodes().forEach(x=>{D.children(x).length||z.setNode(x,D.node(x))}),D.edges().forEach(x=>{z.setEdge(x,D.edge(x))}),z}function s(D){let z=D.nodes().map(x=>{let R={};return D.outEdges(x).forEach(v=>{R[v.w]=(R[v.w]||0)+D.edge(v).weight}),R});return J(D.nodes(),z)}function l(D){let z=D.nodes().map(x=>{let R={};return D.inEdges(x).forEach(v=>{R[v.v]=(R[v.v]||0)+D.edge(v).weight}),R});return J(D.nodes(),z)}function a(D,z){let x=D.x,R=D.y,v=z.x-x,$=z.y-R,y=D.width/2,b=D.height/2;if(!v&&!$)throw new Error("Not possible to find intersection inside of the rectangle");let S,O;return Math.abs($)*y>Math.abs(v)*b?($<0&&(b=-b),S=b*v/$,O=b):(v<0&&(y=-y),S=y,O=y*$/v),{x:x+S,y:R+O}}function u(D){let z=V(_(D)+1).map(()=>[]);return D.nodes().forEach(x=>{let R=D.node(x),v=R.rank;v!==void 0&&(z[v][R.order]=x)}),z}function c(D){let z=D.nodes().map(R=>{let v=D.node(R).rank;return v===void 0?Number.MAX_VALUE:v}),x=N(Math.min,z);D.nodes().forEach(R=>{let v=D.node(R);Object.hasOwn(v,"rank")&&(v.rank-=x)})}function d(D){let z=D.nodes().map(y=>D.node(y).rank).filter(y=>y!==void 0),x=N(Math.min,z),R=[];D.nodes().forEach(y=>{let b=D.node(y).rank-x;R[b]||(R[b]=[]),R[b].push(y)});let v=0,$=D.graph().nodeRankFactor;Array.from(R).forEach((y,b)=>{y===void 0&&b%$!==0?--v:y!==void 0&&v&&y.forEach(S=>D.node(S).rank+=v)})}function f(D,z,x,R){let v={width:0,height:0};return arguments.length>=4&&(v.rank=x,v.order=R),o(D,"border",v,z)}function h(D,z=k){let x=[];for(let R=0;R<D.length;R+=z){let v=D.slice(R,R+z);x.push(v)}return x}var k=65535;function N(D,z){if(z.length>k){let x=h(z);return D.apply(null,x.map(R=>D.apply(null,R)))}else return D.apply(null,z)}function _(D){let z=D.nodes().map(x=>{let R=D.node(x).rank;return R===void 0?Number.MIN_VALUE:R});return N(Math.max,z)}function E(D,z){let x={lhs:[],rhs:[]};return D.forEach(R=>{z(R)?x.lhs.push(R):x.rhs.push(R)}),x}function w(D,z){let x=Date.now();try{return z()}finally{console.log(D+" time: "+(Date.now()-x)+"ms")}}function p(D,z){return z()}var g=0;function L(D){var z=++g;return D+(""+z)}function V(D,z,x=1){z==null&&(z=D,D=0);let R=$=>$<z;x<0&&(R=$=>z<$);let v=[];for(let $=D;R($);$+=x)v.push($);return v}function G(D,z){let x={};for(let R of z)D[R]!==void 0&&(x[R]=D[R]);return x}function Y(D,z){let x=z;return typeof z=="string"&&(x=R=>R[z]),Object.entries(D).reduce((R,[v,$])=>(R[v]=x($,v),R),{})}function J(D,z){return D.reduce((x,R,v)=>(x[R]=z[v],x),{})}}),ea=Ne((e,t)=>{var n=Js(),o=De().uniqueId;t.exports={run:r,undo:s};function r(l){(l.graph().acyclicer==="greedy"?n(l,a(l)):i(l)).forEach(u=>{let c=l.edge(u);l.removeEdge(u),c.forwardName=u.name,c.reversed=!0,l.setEdge(u.w,u.v,c,o("rev"))});function a(u){return c=>u.edge(c).weight}}function i(l){let a=[],u={},c={};function d(f){Object.hasOwn(c,f)||(c[f]=!0,u[f]=!0,l.outEdges(f).forEach(h=>{Object.hasOwn(u,h.w)?a.push(h):d(h.w)}),delete u[f])}return l.nodes().forEach(d),a}function s(l){l.edges().forEach(a=>{let u=l.edge(a);if(u.reversed){l.removeEdge(a);let c=u.forwardName;delete u.reversed,delete u.forwardName,l.setEdge(a.w,a.v,u,c)}})}}),ta=Ne((e,t)=>{var n=De();t.exports={run:o,undo:i};function o(s){s.graph().dummyChains=[],s.edges().forEach(l=>r(s,l))}function r(s,l){let a=l.v,u=s.node(a).rank,c=l.w,d=s.node(c).rank,f=l.name,h=s.edge(l),k=h.labelRank;if(d===u+1)return;s.removeEdge(l);let N,_,E;for(E=0,++u;u<d;++E,++u)h.points=[],_={width:0,height:0,edgeLabel:h,edgeObj:l,rank:u},N=n.addDummyNode(s,"edge",_,"_d"),u===k&&(_.width=h.width,_.height=h.height,_.dummy="edge-label",_.labelpos=h.labelpos),s.setEdge(a,N,{weight:h.weight},f),E===0&&s.graph().dummyChains.push(N),a=N;s.setEdge(a,c,{weight:h.weight},f)}function i(s){s.graph().dummyChains.forEach(l=>{let a=s.node(l),u=a.edgeLabel,c;for(s.setEdge(a.edgeObj,u);a.dummy;)c=s.successors(l)[0],s.removeNode(l),u.points.push({x:a.x,y:a.y}),a.dummy==="edge-label"&&(u.x=a.x,u.y=a.y,u.width=a.width,u.height=a.height),l=c,a=s.node(l)})}}),kn=Ne((e,t)=>{var{applyWithChunking:n}=De();t.exports={longestPath:o,slack:r};function o(i){var s={};function l(a){var u=i.node(a);if(Object.hasOwn(s,a))return u.rank;s[a]=!0;let c=i.outEdges(a).map(f=>f==null?Number.POSITIVE_INFINITY:l(f.w)-i.edge(f).minlen);var d=n(Math.min,c);return d===Number.POSITIVE_INFINITY&&(d=0),u.rank=d}i.sources().forEach(l)}function r(i,s){return i.node(s.w).rank-i.node(s.v).rank-i.edge(s).minlen}}),Rr=Ne((e,t)=>{var n=Ye().Graph,o=kn().slack;t.exports=r;function r(a){var u=new n({directed:!1}),c=a.nodes()[0],d=a.nodeCount();u.setNode(c,{});for(var f,h;i(u,a)<d;)f=s(u,a),h=u.hasNode(f.v)?o(a,f):-o(a,f),l(u,a,h);return u}function i(a,u){function c(d){u.nodeEdges(d).forEach(f=>{var h=f.v,k=d===h?f.w:h;!a.hasNode(k)&&!o(u,f)&&(a.setNode(k,{}),a.setEdge(d,k,{}),c(k))})}return a.nodes().forEach(c),a.nodeCount()}function s(a,u){return u.edges().reduce((c,d)=>{let f=Number.POSITIVE_INFINITY;return a.hasNode(d.v)!==a.hasNode(d.w)&&(f=o(u,d)),f<c[0]?[f,d]:c},[Number.POSITIVE_INFINITY,null])[1]}function l(a,u,c){a.nodes().forEach(d=>u.node(d).rank+=c)}}),na=Ne((e,t)=>{var n=Rr(),o=kn().slack,r=kn().longestPath,i=Ye().alg.preorder,s=Ye().alg.postorder,l=De().simplify;t.exports=a,a.initLowLimValues=f,a.initCutValues=u,a.calcCutValue=d,a.leaveEdge=k,a.enterEdge=N,a.exchangeEdges=_;function a(g){g=l(g),r(g);var L=n(g);f(L),u(L,g);for(var V,G;V=k(L);)G=N(L,g,V),_(L,g,V,G)}function u(g,L){var V=s(g,g.nodes());V=V.slice(0,V.length-1),V.forEach(G=>c(g,L,G))}function c(g,L,V){var G=g.node(V),Y=G.parent;g.edge(V,Y).cutvalue=d(g,L,V)}function d(g,L,V){var G=g.node(V),Y=G.parent,J=!0,D=L.edge(V,Y),z=0;return D||(J=!1,D=L.edge(Y,V)),z=D.weight,L.nodeEdges(V).forEach(x=>{var R=x.v===V,v=R?x.w:x.v;if(v!==Y){var $=R===J,y=L.edge(x).weight;if(z+=$?y:-y,w(g,V,v)){var b=g.edge(V,v).cutvalue;z+=$?-b:b}}}),z}function f(g,L){arguments.length<2&&(L=g.nodes()[0]),h(g,{},1,L)}function h(g,L,V,G,Y){var J=V,D=g.node(G);return L[G]=!0,g.neighbors(G).forEach(z=>{Object.hasOwn(L,z)||(V=h(g,L,V,z,G))}),D.low=J,D.lim=V++,Y?D.parent=Y:delete D.parent,V}function k(g){return g.edges().find(L=>g.edge(L).cutvalue<0)}function N(g,L,V){var G=V.v,Y=V.w;L.hasEdge(G,Y)||(G=V.w,Y=V.v);var J=g.node(G),D=g.node(Y),z=J,x=!1;J.lim>D.lim&&(z=D,x=!0);var R=L.edges().filter(v=>x===p(g,g.node(v.v),z)&&x!==p(g,g.node(v.w),z));return R.reduce((v,$)=>o(L,$)<o(L,v)?$:v)}function _(g,L,V,G){var Y=V.v,J=V.w;g.removeEdge(Y,J),g.setEdge(G.v,G.w,{}),f(g),u(g,L),E(g,L)}function E(g,L){var V=g.nodes().find(Y=>!L.node(Y).parent),G=i(g,V);G=G.slice(1),G.forEach(Y=>{var J=g.node(Y).parent,D=L.edge(Y,J),z=!1;D||(D=L.edge(J,Y),z=!0),L.node(Y).rank=L.node(J).rank+(z?D.minlen:-D.minlen)})}function w(g,L,V){return g.hasEdge(L,V)}function p(g,L,V){return V.low<=L.lim&&L.lim<=V.lim}}),oa=Ne((e,t)=>{var n=kn(),o=n.longestPath,r=Rr(),i=na();t.exports=s;function s(c){var d=c.graph().ranker;if(d instanceof Function)return d(c);switch(c.graph().ranker){case"network-simplex":u(c);break;case"tight-tree":a(c);break;case"longest-path":l(c);break;case"none":break;default:u(c)}}var l=o;function a(c){o(c),r(c)}function u(c){i(c)}}),ra=Ne((e,t)=>{t.exports=n;function n(i){let s=r(i);i.graph().dummyChains.forEach(l=>{let a=i.node(l),u=a.edgeObj,c=o(i,s,u.v,u.w),d=c.path,f=c.lca,h=0,k=d[h],N=!0;for(;l!==u.w;){if(a=i.node(l),N){for(;(k=d[h])!==f&&i.node(k).maxRank<a.rank;)h++;k===f&&(N=!1)}if(!N){for(;h<d.length-1&&i.node(k=d[h+1]).minRank<=a.rank;)h++;k=d[h]}i.setParent(l,k),l=i.successors(l)[0]}})}function o(i,s,l,a){let u=[],c=[],d=Math.min(s[l].low,s[a].low),f=Math.max(s[l].lim,s[a].lim),h,k;h=l;do h=i.parent(h),u.push(h);while(h&&(s[h].low>d||f>s[h].lim));for(k=h,h=a;(h=i.parent(h))!==k;)c.push(h);return{path:u.concat(c.reverse()),lca:k}}function r(i){let s={},l=0;function a(u){let c=l;i.children(u).forEach(a),s[u]={low:c,lim:l++}}return i.children().forEach(a),s}}),ia=Ne((e,t)=>{var n=De();t.exports={run:o,cleanup:l};function o(a){let u=n.addDummyNode(a,"root",{},"_root"),c=i(a),d=Object.values(c),f=n.applyWithChunking(Math.max,d)-1,h=2*f+1;a.graph().nestingRoot=u,a.edges().forEach(N=>a.edge(N).minlen*=h);let k=s(a)+1;a.children().forEach(N=>r(a,u,h,k,f,c,N)),a.graph().nodeRankFactor=h}function r(a,u,c,d,f,h,k){let N=a.children(k);if(!N.length){k!==u&&a.setEdge(u,k,{weight:0,minlen:c});return}let _=n.addBorderNode(a,"_bt"),E=n.addBorderNode(a,"_bb"),w=a.node(k);a.setParent(_,k),w.borderTop=_,a.setParent(E,k),w.borderBottom=E,N.forEach(p=>{r(a,u,c,d,f,h,p);let g=a.node(p),L=g.borderTop?g.borderTop:p,V=g.borderBottom?g.borderBottom:p,G=g.borderTop?d:2*d,Y=L!==V?1:f-h[k]+1;a.setEdge(_,L,{weight:G,minlen:Y,nestingEdge:!0}),a.setEdge(V,E,{weight:G,minlen:Y,nestingEdge:!0})}),a.parent(k)||a.setEdge(u,_,{weight:0,minlen:f+h[k]})}function i(a){var u={};function c(d,f){var h=a.children(d);h&&h.length&&h.forEach(k=>c(k,f+1)),u[d]=f}return a.children().forEach(d=>c(d,1)),u}function s(a){return a.edges().reduce((u,c)=>u+a.edge(c).weight,0)}function l(a){var u=a.graph();a.removeNode(u.nestingRoot),delete u.nestingRoot,a.edges().forEach(c=>{var d=a.edge(c);d.nestingEdge&&a.removeEdge(c)})}}),sa=Ne((e,t)=>{var n=De();t.exports=o;function o(i){function s(l){let a=i.children(l),u=i.node(l);if(a.length&&a.forEach(s),Object.hasOwn(u,"minRank")){u.borderLeft=[],u.borderRight=[];for(let c=u.minRank,d=u.maxRank+1;c<d;++c)r(i,"borderLeft","_bl",l,u,c),r(i,"borderRight","_br",l,u,c)}}i.children().forEach(s)}function r(i,s,l,a,u,c){let d={width:0,height:0,rank:c,borderType:s},f=u[s][c-1],h=n.addDummyNode(i,"border",d,l);u[s][c]=h,i.setParent(h,a),f&&i.setEdge(f,h,{weight:1})}}),aa=Ne((e,t)=>{t.exports={adjust:n,undo:o};function n(c){let d=c.graph().rankdir.toLowerCase();(d==="lr"||d==="rl")&&r(c)}function o(c){let d=c.graph().rankdir.toLowerCase();(d==="bt"||d==="rl")&&s(c),(d==="lr"||d==="rl")&&(a(c),r(c))}function r(c){c.nodes().forEach(d=>i(c.node(d))),c.edges().forEach(d=>i(c.edge(d)))}function i(c){let d=c.width;c.width=c.height,c.height=d}function s(c){c.nodes().forEach(d=>l(c.node(d))),c.edges().forEach(d=>{let f=c.edge(d);f.points.forEach(l),Object.hasOwn(f,"y")&&l(f)})}function l(c){c.y=-c.y}function a(c){c.nodes().forEach(d=>u(c.node(d))),c.edges().forEach(d=>{let f=c.edge(d);f.points.forEach(u),Object.hasOwn(f,"x")&&u(f)})}function u(c){let d=c.x;c.x=c.y,c.y=d}}),la=Ne((e,t)=>{var n=De();t.exports=o;function o(r){let i={},s=r.nodes().filter(d=>!r.children(d).length),l=s.map(d=>r.node(d).rank),a=n.applyWithChunking(Math.max,l),u=n.range(a+1).map(()=>[]);function c(d){if(i[d])return;i[d]=!0;let f=r.node(d);u[f.rank].push(d),r.successors(d).forEach(c)}return s.sort((d,f)=>r.node(d).rank-r.node(f).rank).forEach(c),u}}),ua=Ne((e,t)=>{var n=De().zipObject;t.exports=o;function o(i,s){let l=0;for(let a=1;a<s.length;++a)l+=r(i,s[a-1],s[a]);return l}function r(i,s,l){let a=n(l,l.map((k,N)=>N)),u=s.flatMap(k=>i.outEdges(k).map(N=>({pos:a[N.w],weight:i.edge(N).weight})).sort((N,_)=>N.pos-_.pos)),c=1;for(;c<l.length;)c<<=1;let d=2*c-1;c-=1;let f=new Array(d).fill(0),h=0;return u.forEach(k=>{let N=k.pos+c;f[N]+=k.weight;let _=0;for(;N>0;)N%2&&(_+=f[N+1]),N=N-1>>1,f[N]+=k.weight;h+=k.weight*_}),h}}),ca=Ne((e,t)=>{t.exports=n;function n(o,r=[]){return r.map(i=>{let s=o.inEdges(i);if(s.length){let l=s.reduce((a,u)=>{let c=o.edge(u),d=o.node(u.v);return{sum:a.sum+c.weight*d.order,weight:a.weight+c.weight}},{sum:0,weight:0});return{v:i,barycenter:l.sum/l.weight,weight:l.weight}}else return{v:i}})}}),da=Ne((e,t)=>{var n=De();t.exports=o;function o(s,l){let a={};s.forEach((c,d)=>{let f=a[c.v]={indegree:0,in:[],out:[],vs:[c.v],i:d};c.barycenter!==void 0&&(f.barycenter=c.barycenter,f.weight=c.weight)}),l.edges().forEach(c=>{let d=a[c.v],f=a[c.w];d!==void 0&&f!==void 0&&(f.indegree++,d.out.push(a[c.w]))});let u=Object.values(a).filter(c=>!c.indegree);return r(u)}function r(s){let l=[];function a(c){return d=>{d.merged||(d.barycenter===void 0||c.barycenter===void 0||d.barycenter>=c.barycenter)&&i(c,d)}}function u(c){return d=>{d.in.push(c),--d.indegree===0&&s.push(d)}}for(;s.length;){let c=s.pop();l.push(c),c.in.reverse().forEach(a(c)),c.out.forEach(u(c))}return l.filter(c=>!c.merged).map(c=>n.pick(c,["vs","i","barycenter","weight"]))}function i(s,l){let a=0,u=0;s.weight&&(a+=s.barycenter*s.weight,u+=s.weight),l.weight&&(a+=l.barycenter*l.weight,u+=l.weight),s.vs=l.vs.concat(s.vs),s.barycenter=a/u,s.weight=u,s.i=Math.min(l.i,s.i),l.merged=!0}}),fa=Ne((e,t)=>{var n=De();t.exports=o;function o(s,l){let a=n.partition(s,_=>Object.hasOwn(_,"barycenter")),u=a.lhs,c=a.rhs.sort((_,E)=>E.i-_.i),d=[],f=0,h=0,k=0;u.sort(i(!!l)),k=r(d,c,k),u.forEach(_=>{k+=_.vs.length,d.push(_.vs),f+=_.barycenter*_.weight,h+=_.weight,k=r(d,c,k)});let N={vs:d.flat(!0)};return h&&(N.barycenter=f/h,N.weight=h),N}function r(s,l,a){let u;for(;l.length&&(u=l[l.length-1]).i<=a;)l.pop(),s.push(u.vs),a++;return a}function i(s){return(l,a)=>l.barycenter<a.barycenter?-1:l.barycenter>a.barycenter?1:s?a.i-l.i:l.i-a.i}}),ha=Ne((e,t)=>{var n=ca(),o=da(),r=fa();t.exports=i;function i(a,u,c,d){let f=a.children(u),h=a.node(u),k=h?h.borderLeft:void 0,N=h?h.borderRight:void 0,_={};k&&(f=f.filter(g=>g!==k&&g!==N));let E=n(a,f);E.forEach(g=>{if(a.children(g.v).length){let L=i(a,g.v,c,d);_[g.v]=L,Object.hasOwn(L,"barycenter")&&l(g,L)}});let w=o(E,c);s(w,_);let p=r(w,d);if(k&&(p.vs=[k,p.vs,N].flat(!0),a.predecessors(k).length)){let g=a.node(a.predecessors(k)[0]),L=a.node(a.predecessors(N)[0]);Object.hasOwn(p,"barycenter")||(p.barycenter=0,p.weight=0),p.barycenter=(p.barycenter*p.weight+g.order+L.order)/(p.weight+2),p.weight+=2}return p}function s(a,u){a.forEach(c=>{c.vs=c.vs.flatMap(d=>u[d]?u[d].vs:d)})}function l(a,u){a.barycenter!==void 0?(a.barycenter=(a.barycenter*a.weight+u.barycenter*u.weight)/(a.weight+u.weight),a.weight+=u.weight):(a.barycenter=u.barycenter,a.weight=u.weight)}}),ga=Ne((e,t)=>{var n=Ye().Graph,o=De();t.exports=r;function r(s,l,a,u){u||(u=s.nodes());let c=i(s),d=new n({compound:!0}).setGraph({root:c}).setDefaultNodeLabel(f=>s.node(f));return u.forEach(f=>{let h=s.node(f),k=s.parent(f);(h.rank===l||h.minRank<=l&&l<=h.maxRank)&&(d.setNode(f),d.setParent(f,k||c),s[a](f).forEach(N=>{let _=N.v===f?N.w:N.v,E=d.edge(_,f),w=E!==void 0?E.weight:0;d.setEdge(_,f,{weight:s.edge(N).weight+w})}),Object.hasOwn(h,"minRank")&&d.setNode(f,{borderLeft:h.borderLeft[l],borderRight:h.borderRight[l]}))}),d}function i(s){for(var l;s.hasNode(l=o.uniqueId("_root")););return l}}),pa=Ne((e,t)=>{t.exports=n;function n(o,r,i){let s={},l;i.forEach(a=>{let u=o.parent(a),c,d;for(;u;){if(c=o.parent(u),c?(d=s[c],s[c]=u):(d=l,l=u),d&&d!==u){r.setEdge(d,u);return}u=c}})}}),va=Ne((e,t)=>{var n=la(),o=ua(),r=ha(),i=ga(),s=pa(),l=Ye().Graph,a=De();t.exports=u;function u(h,k={}){if(typeof k.customOrder=="function"){k.customOrder(h,u);return}let N=a.maxRank(h),_=c(h,a.range(1,N+1),"inEdges"),E=c(h,a.range(N-1,-1,-1),"outEdges"),w=n(h);if(f(h,w),k.disableOptimalOrderHeuristic)return;let p=Number.POSITIVE_INFINITY,g,L=k.constraints||[];for(let V=0,G=0;G<4;++V,++G){d(V%2?_:E,V%4>=2,L),w=a.buildLayerMatrix(h);let Y=o(h,w);Y<p?(G=0,g=Object.assign({},w),p=Y):Y===p&&(g=structuredClone(w))}f(h,g)}function c(h,k,N){let _=new Map,E=(w,p)=>{_.has(w)||_.set(w,[]),_.get(w).push(p)};for(let w of h.nodes()){let p=h.node(w);if(typeof p.rank=="number"&&E(p.rank,w),typeof p.minRank=="number"&&typeof p.maxRank=="number")for(let g=p.minRank;g<=p.maxRank;g++)g!==p.rank&&E(g,w)}return k.map(function(w){return i(h,w,N,_.get(w)||[])})}function d(h,k,N){let _=new l;h.forEach(function(E){N.forEach(g=>_.setEdge(g.left,g.right));let w=E.graph().root,p=r(E,w,_,k);p.vs.forEach((g,L)=>E.node(g).order=L),s(E,_,p.vs)})}function f(h,k){Object.values(k).forEach(N=>N.forEach((_,E)=>h.node(_).order=E))}}),ma=Ne((e,t)=>{var n=Ye().Graph,o=De();t.exports={positionX:N,findType1Conflicts:r,findType2Conflicts:i,addConflict:l,hasConflict:a,verticalAlignment:u,horizontalCompaction:c,alignCoordinates:h,findSmallestWidthAlignment:f,balance:k};function r(w,p){let g={};function L(V,G){let Y=0,J=0,D=V.length,z=G[G.length-1];return G.forEach((x,R)=>{let v=s(w,x),$=v?w.node(v).order:D;(v||x===z)&&(G.slice(J,R+1).forEach(y=>{w.predecessors(y).forEach(b=>{let S=w.node(b),O=S.order;(O<Y||$<O)&&!(S.dummy&&w.node(y).dummy)&&l(g,b,y)})}),J=R+1,Y=$)}),G}return p.length&&p.reduce(L),g}function i(w,p){let g={};function L(G,Y,J,D,z){let x;o.range(Y,J).forEach(R=>{x=G[R],w.node(x).dummy&&w.predecessors(x).forEach(v=>{let $=w.node(v);$.dummy&&($.order<D||$.order>z)&&l(g,v,x)})})}function V(G,Y){let J=-1,D,z=0;return Y.forEach((x,R)=>{if(w.node(x).dummy==="border"){let v=w.predecessors(x);v.length&&(D=w.node(v[0]).order,L(Y,z,R,J,D),z=R,J=D)}L(Y,z,Y.length,D,G.length)}),Y}return p.length&&p.reduce(V),g}function s(w,p){if(w.node(p).dummy)return w.predecessors(p).find(g=>w.node(g).dummy)}function l(w,p,g){if(p>g){let V=p;p=g,g=V}let L=w[p];L||(w[p]=L={}),L[g]=!0}function a(w,p,g){if(p>g){let L=p;p=g,g=L}return!!w[p]&&Object.hasOwn(w[p],g)}function u(w,p,g,L){let V={},G={},Y={};return p.forEach(J=>{J.forEach((D,z)=>{V[D]=D,G[D]=D,Y[D]=z})}),p.forEach(J=>{let D=-1;J.forEach(z=>{let x=L(z);if(x.length){x=x.sort((v,$)=>Y[v]-Y[$]);let R=(x.length-1)/2;for(let v=Math.floor(R),$=Math.ceil(R);v<=$;++v){let y=x[v];G[z]===z&&D<Y[y]&&!a(g,z,y)&&(G[y]=z,G[z]=V[z]=V[y],D=Y[y])}}})}),{root:V,align:G}}function c(w,p,g,L,V){let G={},Y=d(w,p,g,V),J=V?"borderLeft":"borderRight";function D(R,v){let $=Y.nodes().slice(),y={},b=$.pop();for(;b;){if(y[b])R(b);else{y[b]=!0,$.push(b);for(let S of v(b))$.push(S)}b=$.pop()}}function z(R){G[R]=Y.inEdges(R).reduce((v,$)=>Math.max(v,G[$.v]+Y.edge($)),0)}function x(R){let v=Y.outEdges(R).reduce((y,b)=>Math.min(y,G[b.w]-Y.edge(b)),Number.POSITIVE_INFINITY),$=w.node(R);v!==Number.POSITIVE_INFINITY&&$.borderType!==J&&(G[R]=Math.max(G[R],v))}return D(z,Y.predecessors.bind(Y)),D(x,Y.successors.bind(Y)),Object.keys(L).forEach(R=>G[R]=G[g[R]]),G}function d(w,p,g,L){let V=new n,G=w.graph(),Y=_(G.nodesep,G.edgesep,L);return p.forEach(J=>{let D;J.forEach(z=>{let x=g[z];if(V.setNode(x),D){var R=g[D],v=V.edge(R,x);V.setEdge(R,x,Math.max(Y(w,z,D),v||0))}D=z})}),V}function f(w,p){return Object.values(p).reduce((g,L)=>{let V=Number.NEGATIVE_INFINITY,G=Number.POSITIVE_INFINITY;Object.entries(L).forEach(([J,D])=>{let z=E(w,J)/2;V=Math.max(D+z,V),G=Math.min(D-z,G)});let Y=V-G;return Y<g[0]&&(g=[Y,L]),g},[Number.POSITIVE_INFINITY,null])[1]}function h(w,p){let g=Object.values(p),L=o.applyWithChunking(Math.min,g),V=o.applyWithChunking(Math.max,g);["u","d"].forEach(G=>{["l","r"].forEach(Y=>{let J=G+Y,D=w[J];if(D===p)return;let z=Object.values(D),x=L-o.applyWithChunking(Math.min,z);Y!=="l"&&(x=V-o.applyWithChunking(Math.max,z)),x&&(w[J]=o.mapValues(D,R=>R+x))})})}function k(w,p){return o.mapValues(w.ul,(g,L)=>{if(p)return w[p.toLowerCase()][L];{let V=Object.values(w).map(G=>G[L]).sort((G,Y)=>G-Y);return(V[1]+V[2])/2}})}function N(w){let p=o.buildLayerMatrix(w),g=Object.assign(r(w,p),i(w,p)),L={},V;["u","d"].forEach(Y=>{V=Y==="u"?p:Object.values(p).reverse(),["l","r"].forEach(J=>{J==="r"&&(V=V.map(R=>Object.values(R).reverse()));let D=(Y==="u"?w.predecessors:w.successors).bind(w),z=u(w,V,g,D),x=c(w,V,z.root,z.align,J==="r");J==="r"&&(x=o.mapValues(x,R=>-R)),L[Y+J]=x})});let G=f(w,L);return h(L,G),k(L,w.graph().align)}function _(w,p,g){return(L,V,G)=>{let Y=L.node(V),J=L.node(G),D=0,z;if(D+=Y.width/2,Object.hasOwn(Y,"labelpos"))switch(Y.labelpos.toLowerCase()){case"l":z=-Y.width/2;break;case"r":z=Y.width/2;break}if(z&&(D+=g?z:-z),z=0,D+=(Y.dummy?p:w)/2,D+=(J.dummy?p:w)/2,D+=J.width/2,Object.hasOwn(J,"labelpos"))switch(J.labelpos.toLowerCase()){case"l":z=J.width/2;break;case"r":z=-J.width/2;break}return z&&(D+=g?z:-z),z=0,D}}function E(w,p){return w.node(p).width}}),ya=Ne((e,t)=>{var n=De(),o=ma().positionX;t.exports=r;function r(s){s=n.asNonCompoundGraph(s),i(s),Object.entries(o(s)).forEach(([l,a])=>s.node(l).x=a)}function i(s){let l=n.buildLayerMatrix(s),a=s.graph().ranksep,u=s.graph().rankalign,c=0;l.forEach(d=>{let f=d.reduce((h,k)=>{let N=s.node(k).height;return h>N?h:N},0);d.forEach(h=>{let k=s.node(h);u==="top"?k.y=c+k.height/2:u==="bottom"?k.y=c+f-k.height/2:k.y=c+f/2}),c+=f+a})}}),wa=Ne((e,t)=>{var n=ea(),o=ta(),r=oa(),i=De().normalizeRanks,s=ra(),l=De().removeEmptyRanks,a=ia(),u=sa(),c=aa(),d=va(),f=ya(),h=De(),k=Ye().Graph;t.exports=N;function N(m,C={}){let T=C.debugTiming?h.time:h.notime;return T("layout",()=>{let j=T(" buildLayoutGraph",()=>D(m));return T(" runLayout",()=>_(j,T,C)),T(" updateInputGraph",()=>E(m,j)),j})}function _(m,C,T){C(" makeSpaceForEdgeLabels",()=>z(m)),C(" removeSelfEdges",()=>B(m)),C(" acyclic",()=>n.run(m)),C(" nestingGraph.run",()=>a.run(m)),C(" rank",()=>r(h.asNonCompoundGraph(m))),C(" injectEdgeLabelProxies",()=>x(m)),C(" removeEmptyRanks",()=>l(m)),C(" nestingGraph.cleanup",()=>a.cleanup(m)),C(" normalizeRanks",()=>i(m)),C(" assignRankMinMax",()=>R(m)),C(" removeEdgeLabelProxies",()=>v(m)),C(" normalize.run",()=>o.run(m)),C(" parentDummyChains",()=>s(m)),C(" addBorderSegments",()=>u(m)),C(" order",()=>d(m,T)),C(" insertSelfEdges",()=>H(m)),C(" adjustCoordinateSystem",()=>c.adjust(m)),C(" position",()=>f(m)),C(" positionSelfEdges",()=>W(m)),C(" removeBorderNodes",()=>O(m)),C(" normalize.undo",()=>o.undo(m)),C(" fixupEdgeLabelCoords",()=>b(m)),C(" undoCoordinateSystem",()=>c.undo(m)),C(" translateGraph",()=>$(m)),C(" assignNodeIntersects",()=>y(m)),C(" reversePoints",()=>S(m)),C(" acyclic.undo",()=>n.undo(m))}function E(m,C){m.nodes().forEach(T=>{let j=m.node(T),Q=C.node(T);j&&(j.x=Q.x,j.y=Q.y,j.order=Q.order,j.rank=Q.rank,C.children(T).length&&(j.width=Q.width,j.height=Q.height))}),m.edges().forEach(T=>{let j=m.edge(T),Q=C.edge(T);j.points=Q.points,Object.hasOwn(Q,"x")&&(j.x=Q.x,j.y=Q.y)}),m.graph().width=C.graph().width,m.graph().height=C.graph().height}var w=["nodesep","edgesep","ranksep","marginx","marginy"],p={ranksep:50,edgesep:20,nodesep:50,rankdir:"tb",rankalign:"center"},g=["acyclicer","ranker","rankdir","align","rankalign"],L=["width","height","rank"],V={width:0,height:0},G=["minlen","weight","width","height","labeloffset"],Y={minlen:1,weight:1,width:0,height:0,labeloffset:10,labelpos:"r"},J=["labelpos"];function D(m){let C=new k({multigraph:!0,compound:!0}),T=P(m.graph());return C.setGraph(Object.assign({},p,K(T,w),h.pick(T,g))),m.nodes().forEach(j=>{let Q=P(m.node(j)),te=K(Q,L);Object.keys(V).forEach(ne=>{te[ne]===void 0&&(te[ne]=V[ne])}),C.setNode(j,te),C.setParent(j,m.parent(j))}),m.edges().forEach(j=>{let Q=P(m.edge(j));C.setEdge(j,Object.assign({},Y,K(Q,G),h.pick(Q,J)))}),C}function z(m){let C=m.graph();C.ranksep/=2,m.edges().forEach(T=>{let j=m.edge(T);j.minlen*=2,j.labelpos.toLowerCase()!=="c"&&(C.rankdir==="TB"||C.rankdir==="BT"?j.width+=j.labeloffset:j.height+=j.labeloffset)})}function x(m){m.edges().forEach(C=>{let T=m.edge(C);if(T.width&&T.height){let j=m.node(C.v),Q={rank:(m.node(C.w).rank-j.rank)/2+j.rank,e:C};h.addDummyNode(m,"edge-proxy",Q,"_ep")}})}function R(m){let C=0;m.nodes().forEach(T=>{let j=m.node(T);j.borderTop&&(j.minRank=m.node(j.borderTop).rank,j.maxRank=m.node(j.borderBottom).rank,C=Math.max(C,j.maxRank))}),m.graph().maxRank=C}function v(m){m.nodes().forEach(C=>{let T=m.node(C);T.dummy==="edge-proxy"&&(m.edge(T.e).labelRank=T.rank,m.removeNode(C))})}function $(m){let C=Number.POSITIVE_INFINITY,T=0,j=Number.POSITIVE_INFINITY,Q=0,te=m.graph(),ne=te.marginx||0,ie=te.marginy||0;function ge(A){let M=A.x,F=A.y,U=A.width,X=A.height;C=Math.min(C,M-U/2),T=Math.max(T,M+U/2),j=Math.min(j,F-X/2),Q=Math.max(Q,F+X/2)}m.nodes().forEach(A=>ge(m.node(A))),m.edges().forEach(A=>{let M=m.edge(A);Object.hasOwn(M,"x")&&ge(M)}),C-=ne,j-=ie,m.nodes().forEach(A=>{let M=m.node(A);M.x-=C,M.y-=j}),m.edges().forEach(A=>{let M=m.edge(A);M.points.forEach(F=>{F.x-=C,F.y-=j}),Object.hasOwn(M,"x")&&(M.x-=C),Object.hasOwn(M,"y")&&(M.y-=j)}),te.width=T-C+ne,te.height=Q-j+ie}function y(m){m.edges().forEach(C=>{let T=m.edge(C),j=m.node(C.v),Q=m.node(C.w),te,ne;T.points?(te=T.points[0],ne=T.points[T.points.length-1]):(T.points=[],te=Q,ne=j),T.points.unshift(h.intersectRect(j,te)),T.points.push(h.intersectRect(Q,ne))})}function b(m){m.edges().forEach(C=>{let T=m.edge(C);if(Object.hasOwn(T,"x"))switch((T.labelpos==="l"||T.labelpos==="r")&&(T.width-=T.labeloffset),T.labelpos){case"l":T.x-=T.width/2+T.labeloffset;break;case"r":T.x+=T.width/2+T.labeloffset;break}})}function S(m){m.edges().forEach(C=>{let T=m.edge(C);T.reversed&&T.points.reverse()})}function O(m){m.nodes().forEach(C=>{if(m.children(C).length){let T=m.node(C),j=m.node(T.borderTop),Q=m.node(T.borderBottom),te=m.node(T.borderLeft[T.borderLeft.length-1]),ne=m.node(T.borderRight[T.borderRight.length-1]);T.width=Math.abs(ne.x-te.x),T.height=Math.abs(Q.y-j.y),T.x=te.x+T.width/2,T.y=j.y+T.height/2}}),m.nodes().forEach(C=>{m.node(C).dummy==="border"&&m.removeNode(C)})}function B(m){m.edges().forEach(C=>{if(C.v===C.w){var T=m.node(C.v);T.selfEdges||(T.selfEdges=[]),T.selfEdges.push({e:C,label:m.edge(C)}),m.removeEdge(C)}})}function H(m){var C=h.buildLayerMatrix(m);C.forEach(T=>{var j=0;T.forEach((Q,te)=>{var ne=m.node(Q);ne.order=te+j,(ne.selfEdges||[]).forEach(ie=>{h.addDummyNode(m,"selfedge",{width:ie.label.width,height:ie.label.height,rank:ne.rank,order:te+ ++j,e:ie.e,label:ie.label},"_se")}),delete ne.selfEdges})})}function W(m){m.nodes().forEach(C=>{var T=m.node(C);if(T.dummy==="selfedge"){var j=m.node(T.e.v),Q=j.x+j.width/2,te=j.y,ne=T.x-Q,ie=j.height/2;m.setEdge(T.e,T.label),m.removeNode(C),T.label.points=[{x:Q+2*ne/3,y:te-ie},{x:Q+5*ne/6,y:te-ie},{x:Q+ne,y:te},{x:Q+5*ne/6,y:te+ie},{x:Q+2*ne/3,y:te+ie}],T.label.x=T.x,T.label.y=T.y}})}function K(m,C){return h.mapValues(h.pick(m,C),Number)}function P(m){var C={};return m&&Object.entries(m).forEach(([T,j])=>{typeof T=="string"&&(T=T.toLowerCase()),C[T]=j}),C}}),_a=Ne((e,t)=>{var n=De(),o=Ye().Graph;t.exports={debugOrdering:r};function r(i){let s=n.buildLayerMatrix(i),l=new o({compound:!0,multigraph:!0}).setGraph({});return i.nodes().forEach(a=>{l.setNode(a,{label:a}),l.setParent(a,"layer"+i.node(a).rank)}),i.edges().forEach(a=>l.setEdge(a.v,a.w,{},a.name)),s.forEach((a,u)=>{let c="layer"+u;l.setNode(c,{rank:"same"}),a.reduce((d,f)=>(l.setEdge(d,f,{style:"invis"}),f))}),l}}),xa=Ne((e,t)=>{t.exports="2.0.4"}),ba=Ne((e,t)=>{t.exports={graphlib:Ye(),layout:wa(),debug:_a(),util:{time:De().time,notime:De().notime},version:xa()}});const Ho=ba();function Wt(e){return Ar()?(pn(e),!0):!1}function Je(e){return typeof e=="function"?e():I(e)}const Ea=typeof window<"u"&&typeof document<"u",ka=e=>typeof e<"u",Sa=Object.prototype.toString,Na=e=>Sa.call(e)==="[object Object]",Ca=()=>{};function $a(e,t){function n(...o){return new Promise((r,i)=>{Promise.resolve(e(()=>t.apply(this,o),{fn:t,thisArg:this,args:o})).then(r).catch(i)})}return n}const Vr=e=>e();function Ma(e=Vr){const t=ve(!0);function n(){t.value=!1}function o(){t.value=!0}const r=(...i)=>{t.value&&e(...i)};return{isActive:us(t),pause:n,resume:o,eventFilter:r}}function Fo(e,t=!1,n="Timeout"){return new Promise((o,r)=>{setTimeout(t?()=>r(n):o,e)})}function Ia(e,t,n={}){const{eventFilter:o=Vr,...r}=n;return ye(e,$a(o,t),r)}function xt(e,t,n={}){const{eventFilter:o,...r}=n,{eventFilter:i,pause:s,resume:l,isActive:a}=Ma(o);return{stop:Ia(e,t,{...r,eventFilter:i}),pause:s,resume:l,isActive:a}}function Pa(e,t={}){if(!bo(e))return as(e);const n=Array.isArray(e.value)?Array.from({length:e.value.length}):{};for(const o in e.value)n[o]=ls(()=>({get(){return e.value[o]},set(r){var i;if((i=Je(t.replaceRef))!=null?i:!0)if(Array.isArray(e.value)){const l=[...e.value];l[o]=r,e.value=l}else{const l={...e.value,[o]:r};Object.setPrototypeOf(l,Object.getPrototypeOf(e.value)),e.value=l}else e.value[o]=r}}));return n}function io(e,t=!1){function n(d,{flush:f="sync",deep:h=!1,timeout:k,throwOnTimeout:N}={}){let _=null;const w=[new Promise(p=>{_=ye(e,g=>{d(g)!==t&&(_?.(),p(g))},{flush:f,deep:h,immediate:!0})})];return k!=null&&w.push(Fo(k,N).then(()=>Je(e)).finally(()=>_?.())),Promise.race(w)}function o(d,f){if(!bo(d))return n(g=>g===d,f);const{flush:h="sync",deep:k=!1,timeout:N,throwOnTimeout:_}=f??{};let E=null;const p=[new Promise(g=>{E=ye([e,d],([L,V])=>{t!==(L===V)&&(E?.(),g(L))},{flush:h,deep:k,immediate:!0})})];return N!=null&&p.push(Fo(N,_).then(()=>Je(e)).finally(()=>(E?.(),Je(e)))),Promise.race(p)}function r(d){return n(f=>!!f,d)}function i(d){return o(null,d)}function s(d){return o(void 0,d)}function l(d){return n(Number.isNaN,d)}function a(d,f){return n(h=>{const k=Array.from(h);return k.includes(d)||k.includes(Je(d))},f)}function u(d){return c(1,d)}function c(d=1,f){let h=-1;return n(()=>(h+=1,h>=d),f)}return Array.isArray(Je(e))?{toMatch:n,toContains:a,changed:u,changedTimes:c,get not(){return io(e,!t)}}:{toMatch:n,toBe:o,toBeTruthy:r,toBeNull:i,toBeNaN:l,toBeUndefined:s,changed:u,changedTimes:c,get not(){return io(e,!t)}}}function so(e){return io(e)}function Ta(e){var t;const n=Je(e);return(t=n?.$el)!=null?t:n}const Hr=Ea?window:void 0;function Fr(...e){let t,n,o,r;if(typeof e[0]=="string"||Array.isArray(e[0])?([n,o,r]=e,t=Hr):[t,n,o,r]=e,!t)return Ca;Array.isArray(n)||(n=[n]),Array.isArray(o)||(o=[o]);const i=[],s=()=>{i.forEach(c=>c()),i.length=0},l=(c,d,f,h)=>(c.addEventListener(d,f,h),()=>c.removeEventListener(d,f,h)),a=ye(()=>[Ta(t),Je(r)],([c,d])=>{if(s(),!c)return;const f=Na(d)?{...d}:d;i.push(...n.flatMap(h=>o.map(k=>l(c,h,k,f))))},{immediate:!0,flush:"post"}),u=()=>{a(),s()};return Wt(u),u}function Oa(e){return typeof e=="function"?e:typeof e=="string"?t=>t.key===e:Array.isArray(e)?t=>e.includes(t.key):()=>!0}function Go(...e){let t,n,o={};e.length===3?(t=e[0],n=e[1],o=e[2]):e.length===2?typeof e[1]=="object"?(t=!0,n=e[0],o=e[1]):(t=e[0],n=e[1]):(t=!0,n=e[0]);const{target:r=Hr,eventName:i="keydown",passive:s=!1,dedupe:l=!1}=o,a=Oa(t);return Fr(r,i,c=>{c.repeat&&Je(l)||a(c)&&n(c)},s)}function Da(e){return JSON.parse(JSON.stringify(e))}function Wn(e,t,n,o={}){var r,i,s;const{clone:l=!1,passive:a=!1,eventName:u,deep:c=!1,defaultValue:d,shouldEmit:f}=o,h=Lt(),k=n||h?.emit||((r=h?.$emit)==null?void 0:r.bind(h))||((s=(i=h?.proxy)==null?void 0:i.$emit)==null?void 0:s.bind(h?.proxy));let N=u;t||(t="modelValue"),N=N||`update:${t.toString()}`;const _=p=>l?typeof l=="function"?l(p):Da(p):p,E=()=>ka(e[t])?_(e[t]):d,w=p=>{f?f(p)&&k(N,p):k(N,p)};if(a){const p=E(),g=ve(p);let L=!1;return ye(()=>e[t],V=>{L||(L=!0,g.value=_(V),nt(()=>L=!1))}),ye(g,V=>{!L&&(V!==e[t]||c)&&w(V)},{deep:c}),g}else return re({get(){return E()},set(p){w(p)}})}var za={value:()=>{}};function An(){for(var e=0,t=arguments.length,n={},o;e<t;++e){if(!(o=arguments[e]+"")||o in n||/[\s.]/.test(o))throw new Error("illegal type: "+o);n[o]=[]}return new mn(n)}function mn(e){this._=e}function Aa(e,t){return e.trim().split(/^|\s+/).map(function(n){var o="",r=n.indexOf(".");if(r>=0&&(o=n.slice(r+1),n=n.slice(0,r)),n&&!t.hasOwnProperty(n))throw new Error("unknown type: "+n);return{type:n,name:o}})}mn.prototype=An.prototype={constructor:mn,on:function(e,t){var n=this._,o=Aa(e+"",n),r,i=-1,s=o.length;if(arguments.length<2){for(;++i<s;)if((r=(e=o[i]).type)&&(r=La(n[r],e.name)))return r;return}if(t!=null&&typeof t!="function")throw new Error("invalid callback: "+t);for(;++i<s;)if(r=(e=o[i]).type)n[r]=Yo(n[r],e.name,t);else if(t==null)for(r in n)n[r]=Yo(n[r],e.name,null);return this},copy:function(){var e={},t=this._;for(var n in t)e[n]=t[n].slice();return new mn(e)},call:function(e,t){if((r=arguments.length-2)>0)for(var n=new Array(r),o=0,r,i;o<r;++o)n[o]=arguments[o+2];if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(i=this._[e],o=0,r=i.length;o<r;++o)i[o].value.apply(t,n)},apply:function(e,t,n){if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(var o=this._[e],r=0,i=o.length;r<i;++r)o[r].value.apply(t,n)}};function La(e,t){for(var n=0,o=e.length,r;n<o;++n)if((r=e[n]).name===t)return r.value}function Yo(e,t,n){for(var o=0,r=e.length;o<r;++o)if(e[o].name===t){e[o]=za,e=e.slice(0,o).concat(e.slice(o+1));break}return n!=null&&e.push({name:t,value:n}),e}var ao="http://www.w3.org/1999/xhtml";const jo={svg:"http://www.w3.org/2000/svg",xhtml:ao,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function Ln(e){var t=e+="",n=t.indexOf(":");return n>=0&&(t=e.slice(0,n))!=="xmlns"&&(e=e.slice(n+1)),jo.hasOwnProperty(t)?{space:jo[t],local:e}:e}function Ba(e){return function(){var t=this.ownerDocument,n=this.namespaceURI;return n===ao&&t.documentElement.namespaceURI===ao?t.createElement(e):t.createElementNS(n,e)}}function Ra(e){return function(){return this.ownerDocument.createElementNS(e.space,e.local)}}function Gr(e){var t=Ln(e);return(t.local?Ra:Ba)(t)}function Va(){}function ko(e){return e==null?Va:function(){return this.querySelector(e)}}function Ha(e){typeof e!="function"&&(e=ko(e));for(var t=this._groups,n=t.length,o=new Array(n),r=0;r<n;++r)for(var i=t[r],s=i.length,l=o[r]=new Array(s),a,u,c=0;c<s;++c)(a=i[c])&&(u=e.call(a,a.__data__,c,i))&&("__data__"in a&&(u.__data__=a.__data__),l[c]=u);return new Be(o,this._parents)}function Fa(e){return e==null?[]:Array.isArray(e)?e:Array.from(e)}function Ga(){return[]}function Yr(e){return e==null?Ga:function(){return this.querySelectorAll(e)}}function Ya(e){return function(){return Fa(e.apply(this,arguments))}}function ja(e){typeof e=="function"?e=Ya(e):e=Yr(e);for(var t=this._groups,n=t.length,o=[],r=[],i=0;i<n;++i)for(var s=t[i],l=s.length,a,u=0;u<l;++u)(a=s[u])&&(o.push(e.call(a,a.__data__,u,s)),r.push(a));return new Be(o,r)}function jr(e){return function(){return this.matches(e)}}function Xr(e){return function(t){return t.matches(e)}}var Xa=Array.prototype.find;function Wa(e){return function(){return Xa.call(this.children,e)}}function Ua(){return this.firstElementChild}function qa(e){return this.select(e==null?Ua:Wa(typeof e=="function"?e:Xr(e)))}var Za=Array.prototype.filter;function Ka(){return Array.from(this.children)}function Qa(e){return function(){return Za.call(this.children,e)}}function Ja(e){return this.selectAll(e==null?Ka:Qa(typeof e=="function"?e:Xr(e)))}function el(e){typeof e!="function"&&(e=jr(e));for(var t=this._groups,n=t.length,o=new Array(n),r=0;r<n;++r)for(var i=t[r],s=i.length,l=o[r]=[],a,u=0;u<s;++u)(a=i[u])&&e.call(a,a.__data__,u,i)&&l.push(a);return new Be(o,this._parents)}function Wr(e){return new Array(e.length)}function tl(){return new Be(this._enter||this._groups.map(Wr),this._parents)}function Sn(e,t){this.ownerDocument=e.ownerDocument,this.namespaceURI=e.namespaceURI,this._next=null,this._parent=e,this.__data__=t}Sn.prototype={constructor:Sn,appendChild:function(e){return this._parent.insertBefore(e,this._next)},insertBefore:function(e,t){return this._parent.insertBefore(e,t)},querySelector:function(e){return this._parent.querySelector(e)},querySelectorAll:function(e){return this._parent.querySelectorAll(e)}};function nl(e){return function(){return e}}function ol(e,t,n,o,r,i){for(var s=0,l,a=t.length,u=i.length;s<u;++s)(l=t[s])?(l.__data__=i[s],o[s]=l):n[s]=new Sn(e,i[s]);for(;s<a;++s)(l=t[s])&&(r[s]=l)}function rl(e,t,n,o,r,i,s){var l,a,u=new Map,c=t.length,d=i.length,f=new Array(c),h;for(l=0;l<c;++l)(a=t[l])&&(f[l]=h=s.call(a,a.__data__,l,t)+"",u.has(h)?r[l]=a:u.set(h,a));for(l=0;l<d;++l)h=s.call(e,i[l],l,i)+"",(a=u.get(h))?(o[l]=a,a.__data__=i[l],u.delete(h)):n[l]=new Sn(e,i[l]);for(l=0;l<c;++l)(a=t[l])&&u.get(f[l])===a&&(r[l]=a)}function il(e){return e.__data__}function sl(e,t){if(!arguments.length)return Array.from(this,il);var n=t?rl:ol,o=this._parents,r=this._groups;typeof e!="function"&&(e=nl(e));for(var i=r.length,s=new Array(i),l=new Array(i),a=new Array(i),u=0;u<i;++u){var c=o[u],d=r[u],f=d.length,h=al(e.call(c,c&&c.__data__,u,o)),k=h.length,N=l[u]=new Array(k),_=s[u]=new Array(k),E=a[u]=new Array(f);n(c,d,N,_,E,h,t);for(var w=0,p=0,g,L;w<k;++w)if(g=N[w]){for(w>=p&&(p=w+1);!(L=_[p])&&++p<k;);g._next=L||null}}return s=new Be(s,o),s._enter=l,s._exit=a,s}function al(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function ll(){return new Be(this._exit||this._groups.map(Wr),this._parents)}function ul(e,t,n){var o=this.enter(),r=this,i=this.exit();return typeof e=="function"?(o=e(o),o&&(o=o.selection())):o=o.append(e+""),t!=null&&(r=t(r),r&&(r=r.selection())),n==null?i.remove():n(i),o&&r?o.merge(r).order():r}function cl(e){for(var t=e.selection?e.selection():e,n=this._groups,o=t._groups,r=n.length,i=o.length,s=Math.min(r,i),l=new Array(r),a=0;a<s;++a)for(var u=n[a],c=o[a],d=u.length,f=l[a]=new Array(d),h,k=0;k<d;++k)(h=u[k]||c[k])&&(f[k]=h);for(;a<r;++a)l[a]=n[a];return new Be(l,this._parents)}function dl(){for(var e=this._groups,t=-1,n=e.length;++t<n;)for(var o=e[t],r=o.length-1,i=o[r],s;--r>=0;)(s=o[r])&&(i&&s.compareDocumentPosition(i)^4&&i.parentNode.insertBefore(s,i),i=s);return this}function fl(e){e||(e=hl);function t(d,f){return d&&f?e(d.__data__,f.__data__):!d-!f}for(var n=this._groups,o=n.length,r=new Array(o),i=0;i<o;++i){for(var s=n[i],l=s.length,a=r[i]=new Array(l),u,c=0;c<l;++c)(u=s[c])&&(a[c]=u);a.sort(t)}return new Be(r,this._parents).order()}function hl(e,t){return e<t?-1:e>t?1:e>=t?0:NaN}function gl(){var e=arguments[0];return arguments[0]=this,e.apply(null,arguments),this}function pl(){return Array.from(this)}function vl(){for(var e=this._groups,t=0,n=e.length;t<n;++t)for(var o=e[t],r=0,i=o.length;r<i;++r){var s=o[r];if(s)return s}return null}function ml(){let e=0;for(const t of this)++e;return e}function yl(){return!this.node()}function wl(e){for(var t=this._groups,n=0,o=t.length;n<o;++n)for(var r=t[n],i=0,s=r.length,l;i<s;++i)(l=r[i])&&e.call(l,l.__data__,i,r);return this}function _l(e){return function(){this.removeAttribute(e)}}function xl(e){return function(){this.removeAttributeNS(e.space,e.local)}}function bl(e,t){return function(){this.setAttribute(e,t)}}function El(e,t){return function(){this.setAttributeNS(e.space,e.local,t)}}function kl(e,t){return function(){var n=t.apply(this,arguments);n==null?this.removeAttribute(e):this.setAttribute(e,n)}}function Sl(e,t){return function(){var n=t.apply(this,arguments);n==null?this.removeAttributeNS(e.space,e.local):this.setAttributeNS(e.space,e.local,n)}}function Nl(e,t){var n=Ln(e);if(arguments.length<2){var o=this.node();return n.local?o.getAttributeNS(n.space,n.local):o.getAttribute(n)}return this.each((t==null?n.local?xl:_l:typeof t=="function"?n.local?Sl:kl:n.local?El:bl)(n,t))}function Ur(e){return e.ownerDocument&&e.ownerDocument.defaultView||e.document&&e||e.defaultView}function Cl(e){return function(){this.style.removeProperty(e)}}function $l(e,t,n){return function(){this.style.setProperty(e,t,n)}}function Ml(e,t,n){return function(){var o=t.apply(this,arguments);o==null?this.style.removeProperty(e):this.style.setProperty(e,o,n)}}function Il(e,t,n){return arguments.length>1?this.each((t==null?Cl:typeof t=="function"?Ml:$l)(e,t,n??"")):Pt(this.node(),e)}function Pt(e,t){return e.style.getPropertyValue(t)||Ur(e).getComputedStyle(e,null).getPropertyValue(t)}function Pl(e){return function(){delete this[e]}}function Tl(e,t){return function(){this[e]=t}}function Ol(e,t){return function(){var n=t.apply(this,arguments);n==null?delete this[e]:this[e]=n}}function Dl(e,t){return arguments.length>1?this.each((t==null?Pl:typeof t=="function"?Ol:Tl)(e,t)):this.node()[e]}function qr(e){return e.trim().split(/^|\s+/)}function So(e){return e.classList||new Zr(e)}function Zr(e){this._node=e,this._names=qr(e.getAttribute("class")||"")}Zr.prototype={add:function(e){var t=this._names.indexOf(e);t<0&&(this._names.push(e),this._node.setAttribute("class",this._names.join(" ")))},remove:function(e){var t=this._names.indexOf(e);t>=0&&(this._names.splice(t,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(e){return this._names.indexOf(e)>=0}};function Kr(e,t){for(var n=So(e),o=-1,r=t.length;++o<r;)n.add(t[o])}function Qr(e,t){for(var n=So(e),o=-1,r=t.length;++o<r;)n.remove(t[o])}function zl(e){return function(){Kr(this,e)}}function Al(e){return function(){Qr(this,e)}}function Ll(e,t){return function(){(t.apply(this,arguments)?Kr:Qr)(this,e)}}function Bl(e,t){var n=qr(e+"");if(arguments.length<2){for(var o=So(this.node()),r=-1,i=n.length;++r<i;)if(!o.contains(n[r]))return!1;return!0}return this.each((typeof t=="function"?Ll:t?zl:Al)(n,t))}function Rl(){this.textContent=""}function Vl(e){return function(){this.textContent=e}}function Hl(e){return function(){var t=e.apply(this,arguments);this.textContent=t??""}}function Fl(e){return arguments.length?this.each(e==null?Rl:(typeof e=="function"?Hl:Vl)(e)):this.node().textContent}function Gl(){this.innerHTML=""}function Yl(e){return function(){this.innerHTML=e}}function jl(e){return function(){var t=e.apply(this,arguments);this.innerHTML=t??""}}function Xl(e){return arguments.length?this.each(e==null?Gl:(typeof e=="function"?jl:Yl)(e)):this.node().innerHTML}function Wl(){this.nextSibling&&this.parentNode.appendChild(this)}function Ul(){return this.each(Wl)}function ql(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function Zl(){return this.each(ql)}function Kl(e){var t=typeof e=="function"?e:Gr(e);return this.select(function(){return this.appendChild(t.apply(this,arguments))})}function Ql(){return null}function Jl(e,t){var n=typeof e=="function"?e:Gr(e),o=t==null?Ql:typeof t=="function"?t:ko(t);return this.select(function(){return this.insertBefore(n.apply(this,arguments),o.apply(this,arguments)||null)})}function eu(){var e=this.parentNode;e&&e.removeChild(this)}function tu(){return this.each(eu)}function nu(){var e=this.cloneNode(!1),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function ou(){var e=this.cloneNode(!0),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function ru(e){return this.select(e?ou:nu)}function iu(e){return arguments.length?this.property("__data__",e):this.node().__data__}function su(e){return function(t){e.call(this,t,this.__data__)}}function au(e){return e.trim().split(/^|\s+/).map(function(t){var n="",o=t.indexOf(".");return o>=0&&(n=t.slice(o+1),t=t.slice(0,o)),{type:t,name:n}})}function lu(e){return function(){var t=this.__on;if(t){for(var n=0,o=-1,r=t.length,i;n<r;++n)i=t[n],(!e.type||i.type===e.type)&&i.name===e.name?this.removeEventListener(i.type,i.listener,i.options):t[++o]=i;++o?t.length=o:delete this.__on}}}function uu(e,t,n){return function(){var o=this.__on,r,i=su(t);if(o){for(var s=0,l=o.length;s<l;++s)if((r=o[s]).type===e.type&&r.name===e.name){this.removeEventListener(r.type,r.listener,r.options),this.addEventListener(r.type,r.listener=i,r.options=n),r.value=t;return}}this.addEventListener(e.type,i,n),r={type:e.type,name:e.name,value:t,listener:i,options:n},o?o.push(r):this.__on=[r]}}function cu(e,t,n){var o=au(e+""),r,i=o.length,s;if(arguments.length<2){var l=this.node().__on;if(l){for(var a=0,u=l.length,c;a<u;++a)for(r=0,c=l[a];r<i;++r)if((s=o[r]).type===c.type&&s.name===c.name)return c.value}return}for(l=t?uu:lu,r=0;r<i;++r)this.each(l(o[r],t,n));return this}function Jr(e,t,n){var o=Ur(e),r=o.CustomEvent;typeof r=="function"?r=new r(t,n):(r=o.document.createEvent("Event"),n?(r.initEvent(t,n.bubbles,n.cancelable),r.detail=n.detail):r.initEvent(t,!1,!1)),e.dispatchEvent(r)}function du(e,t){return function(){return Jr(this,e,t)}}function fu(e,t){return function(){return Jr(this,e,t.apply(this,arguments))}}function hu(e,t){return this.each((typeof t=="function"?fu:du)(e,t))}function*gu(){for(var e=this._groups,t=0,n=e.length;t<n;++t)for(var o=e[t],r=0,i=o.length,s;r<i;++r)(s=o[r])&&(yield s)}var ei=[null];function Be(e,t){this._groups=e,this._parents=t}function tn(){return new Be([[document.documentElement]],ei)}function pu(){return this}Be.prototype=tn.prototype={constructor:Be,select:Ha,selectAll:ja,selectChild:qa,selectChildren:Ja,filter:el,data:sl,enter:tl,exit:ll,join:ul,merge:cl,selection:pu,order:dl,sort:fl,call:gl,nodes:pl,node:vl,size:ml,empty:yl,each:wl,attr:Nl,style:Il,property:Dl,classed:Bl,text:Fl,html:Xl,raise:Ul,lower:Zl,append:Kl,insert:Jl,remove:tu,clone:ru,datum:iu,on:cu,dispatch:hu,[Symbol.iterator]:gu};function Fe(e){return typeof e=="string"?new Be([[document.querySelector(e)]],[document.documentElement]):new Be([[e]],ei)}function vu(e){let t;for(;t=e.sourceEvent;)e=t;return e}function We(e,t){if(e=vu(e),t===void 0&&(t=e.currentTarget),t){var n=t.ownerSVGElement||t;if(n.createSVGPoint){var o=n.createSVGPoint();return o.x=e.clientX,o.y=e.clientY,o=o.matrixTransform(t.getScreenCTM().inverse()),[o.x,o.y]}if(t.getBoundingClientRect){var r=t.getBoundingClientRect();return[e.clientX-r.left-t.clientLeft,e.clientY-r.top-t.clientTop]}}return[e.pageX,e.pageY]}const mu={passive:!1},Ut={capture:!0,passive:!1};function Un(e){e.stopImmediatePropagation()}function Nt(e){e.preventDefault(),e.stopImmediatePropagation()}function ti(e){var t=e.document.documentElement,n=Fe(e).on("dragstart.drag",Nt,Ut);"onselectstart"in t?n.on("selectstart.drag",Nt,Ut):(t.__noselect=t.style.MozUserSelect,t.style.MozUserSelect="none")}function ni(e,t){var n=e.document.documentElement,o=Fe(e).on("dragstart.drag",null);t&&(o.on("click.drag",Nt,Ut),setTimeout(function(){o.on("click.drag",null)},0)),"onselectstart"in n?o.on("selectstart.drag",null):(n.style.MozUserSelect=n.__noselect,delete n.__noselect)}const rn=e=>()=>e;function lo(e,{sourceEvent:t,subject:n,target:o,identifier:r,active:i,x:s,y:l,dx:a,dy:u,dispatch:c}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:t,enumerable:!0,configurable:!0},subject:{value:n,enumerable:!0,configurable:!0},target:{value:o,enumerable:!0,configurable:!0},identifier:{value:r,enumerable:!0,configurable:!0},active:{value:i,enumerable:!0,configurable:!0},x:{value:s,enumerable:!0,configurable:!0},y:{value:l,enumerable:!0,configurable:!0},dx:{value:a,enumerable:!0,configurable:!0},dy:{value:u,enumerable:!0,configurable:!0},_:{value:c}})}lo.prototype.on=function(){var e=this._.on.apply(this._,arguments);return e===this._?this:e};function yu(e){return!e.ctrlKey&&!e.button}function wu(){return this.parentNode}function _u(e,t){return t??{x:e.x,y:e.y}}function xu(){return navigator.maxTouchPoints||"ontouchstart"in this}function bu(){var e=yu,t=wu,n=_u,o=xu,r={},i=An("start","drag","end"),s=0,l,a,u,c,d=0;function f(g){g.on("mousedown.drag",h).filter(o).on("touchstart.drag",_).on("touchmove.drag",E,mu).on("touchend.drag touchcancel.drag",w).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function h(g,L){if(!(c||!e.call(this,g,L))){var V=p(this,t.call(this,g,L),g,L,"mouse");V&&(Fe(g.view).on("mousemove.drag",k,Ut).on("mouseup.drag",N,Ut),ti(g.view),Un(g),u=!1,l=g.clientX,a=g.clientY,V("start",g))}}function k(g){if(Nt(g),!u){var L=g.clientX-l,V=g.clientY-a;u=L*L+V*V>d}r.mouse("drag",g)}function N(g){Fe(g.view).on("mousemove.drag mouseup.drag",null),ni(g.view,u),Nt(g),r.mouse("end",g)}function _(g,L){if(e.call(this,g,L)){var V=g.changedTouches,G=t.call(this,g,L),Y=V.length,J,D;for(J=0;J<Y;++J)(D=p(this,G,g,L,V[J].identifier,V[J]))&&(Un(g),D("start",g,V[J]))}}function E(g){var L=g.changedTouches,V=L.length,G,Y;for(G=0;G<V;++G)(Y=r[L[G].identifier])&&(Nt(g),Y("drag",g,L[G]))}function w(g){var L=g.changedTouches,V=L.length,G,Y;for(c&&clearTimeout(c),c=setTimeout(function(){c=null},500),G=0;G<V;++G)(Y=r[L[G].identifier])&&(Un(g),Y("end",g,L[G]))}function p(g,L,V,G,Y,J){var D=i.copy(),z=We(J||V,L),x,R,v;if((v=n.call(g,new lo("beforestart",{sourceEvent:V,target:f,identifier:Y,active:s,x:z[0],y:z[1],dx:0,dy:0,dispatch:D}),G))!=null)return x=v.x-z[0]||0,R=v.y-z[1]||0,function $(y,b,S){var O=z,B;switch(y){case"start":r[Y]=$,B=s++;break;case"end":delete r[Y],--s;case"drag":z=We(S||b,L),B=s;break}D.call(y,g,new lo(y,{sourceEvent:b,subject:v,target:f,identifier:Y,active:B,x:z[0]+x,y:z[1]+R,dx:z[0]-O[0],dy:z[1]-O[1],dispatch:D}),G)}}return f.filter=function(g){return arguments.length?(e=typeof g=="function"?g:rn(!!g),f):e},f.container=function(g){return arguments.length?(t=typeof g=="function"?g:rn(g),f):t},f.subject=function(g){return arguments.length?(n=typeof g=="function"?g:rn(g),f):n},f.touchable=function(g){return arguments.length?(o=typeof g=="function"?g:rn(!!g),f):o},f.on=function(){var g=i.on.apply(i,arguments);return g===i?f:g},f.clickDistance=function(g){return arguments.length?(d=(g=+g)*g,f):Math.sqrt(d)},f}function No(e,t,n){e.prototype=t.prototype=n,n.constructor=e}function oi(e,t){var n=Object.create(e.prototype);for(var o in t)n[o]=t[o];return n}function nn(){}var qt=.7,Nn=1/qt,Ct="\\s*([+-]?\\d+)\\s*",Zt="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",Ze="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",Eu=/^#([0-9a-f]{3,8})$/,ku=new RegExp(`^rgb\\(${Ct},${Ct},${Ct}\\)$`),Su=new RegExp(`^rgb\\(${Ze},${Ze},${Ze}\\)$`),Nu=new RegExp(`^rgba\\(${Ct},${Ct},${Ct},${Zt}\\)$`),Cu=new RegExp(`^rgba\\(${Ze},${Ze},${Ze},${Zt}\\)$`),$u=new RegExp(`^hsl\\(${Zt},${Ze},${Ze}\\)$`),Mu=new RegExp(`^hsla\\(${Zt},${Ze},${Ze},${Zt}\\)$`),Xo={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};No(nn,yt,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:Wo,formatHex:Wo,formatHex8:Iu,formatHsl:Pu,formatRgb:Uo,toString:Uo});function Wo(){return this.rgb().formatHex()}function Iu(){return this.rgb().formatHex8()}function Pu(){return ri(this).formatHsl()}function Uo(){return this.rgb().formatRgb()}function yt(e){var t,n;return e=(e+"").trim().toLowerCase(),(t=Eu.exec(e))?(n=t[1].length,t=parseInt(t[1],16),n===6?qo(t):n===3?new Le(t>>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):n===8?sn(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):n===4?sn(t>>12&15|t>>8&240,t>>8&15|t>>4&240,t>>4&15|t&240,((t&15)<<4|t&15)/255):null):(t=ku.exec(e))?new Le(t[1],t[2],t[3],1):(t=Su.exec(e))?new Le(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=Nu.exec(e))?sn(t[1],t[2],t[3],t[4]):(t=Cu.exec(e))?sn(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=$u.exec(e))?Qo(t[1],t[2]/100,t[3]/100,1):(t=Mu.exec(e))?Qo(t[1],t[2]/100,t[3]/100,t[4]):Xo.hasOwnProperty(e)?qo(Xo[e]):e==="transparent"?new Le(NaN,NaN,NaN,0):null}function qo(e){return new Le(e>>16&255,e>>8&255,e&255,1)}function sn(e,t,n,o){return o<=0&&(e=t=n=NaN),new Le(e,t,n,o)}function Tu(e){return e instanceof nn||(e=yt(e)),e?(e=e.rgb(),new Le(e.r,e.g,e.b,e.opacity)):new Le}function uo(e,t,n,o){return arguments.length===1?Tu(e):new Le(e,t,n,o??1)}function Le(e,t,n,o){this.r=+e,this.g=+t,this.b=+n,this.opacity=+o}No(Le,uo,oi(nn,{brighter(e){return e=e==null?Nn:Math.pow(Nn,e),new Le(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?qt:Math.pow(qt,e),new Le(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new Le(vt(this.r),vt(this.g),vt(this.b),Cn(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:Zo,formatHex:Zo,formatHex8:Ou,formatRgb:Ko,toString:Ko}));function Zo(){return`#${pt(this.r)}${pt(this.g)}${pt(this.b)}`}function Ou(){return`#${pt(this.r)}${pt(this.g)}${pt(this.b)}${pt((isNaN(this.opacity)?1:this.opacity)*255)}`}function Ko(){const e=Cn(this.opacity);return`${e===1?"rgb(":"rgba("}${vt(this.r)}, ${vt(this.g)}, ${vt(this.b)}${e===1?")":`, ${e})`}`}function Cn(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function vt(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function pt(e){return e=vt(e),(e<16?"0":"")+e.toString(16)}function Qo(e,t,n,o){return o<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new Ge(e,t,n,o)}function ri(e){if(e instanceof Ge)return new Ge(e.h,e.s,e.l,e.opacity);if(e instanceof nn||(e=yt(e)),!e)return new Ge;if(e instanceof Ge)return e;e=e.rgb();var t=e.r/255,n=e.g/255,o=e.b/255,r=Math.min(t,n,o),i=Math.max(t,n,o),s=NaN,l=i-r,a=(i+r)/2;return l?(t===i?s=(n-o)/l+(n<o)*6:n===i?s=(o-t)/l+2:s=(t-n)/l+4,l/=a<.5?i+r:2-i-r,s*=60):l=a>0&&a<1?0:s,new Ge(s,l,a,e.opacity)}function Du(e,t,n,o){return arguments.length===1?ri(e):new Ge(e,t,n,o??1)}function Ge(e,t,n,o){this.h=+e,this.s=+t,this.l=+n,this.opacity=+o}No(Ge,Du,oi(nn,{brighter(e){return e=e==null?Nn:Math.pow(Nn,e),new Ge(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?qt:Math.pow(qt,e),new Ge(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=this.h%360+(this.h<0)*360,t=isNaN(e)||isNaN(this.s)?0:this.s,n=this.l,o=n+(n<.5?n:1-n)*t,r=2*n-o;return new Le(qn(e>=240?e-240:e+120,r,o),qn(e,r,o),qn(e<120?e+240:e-120,r,o),this.opacity)},clamp(){return new Ge(Jo(this.h),an(this.s),an(this.l),Cn(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){const e=Cn(this.opacity);return`${e===1?"hsl(":"hsla("}${Jo(this.h)}, ${an(this.s)*100}%, ${an(this.l)*100}%${e===1?")":`, ${e})`}`}}));function Jo(e){return e=(e||0)%360,e<0?e+360:e}function an(e){return Math.max(0,Math.min(1,e||0))}function qn(e,t,n){return(e<60?t+(n-t)*e/60:e<180?n:e<240?t+(n-t)*(240-e)/60:t)*255}const Co=e=>()=>e;function zu(e,t){return function(n){return e+n*t}}function Au(e,t,n){return e=Math.pow(e,n),t=Math.pow(t,n)-e,n=1/n,function(o){return Math.pow(e+o*t,n)}}function Lu(e){return(e=+e)==1?ii:function(t,n){return n-t?Au(t,n,e):Co(isNaN(t)?n:t)}}function ii(e,t){var n=t-e;return n?zu(e,n):Co(isNaN(e)?t:e)}const $n=(function e(t){var n=Lu(t);function o(r,i){var s=n((r=uo(r)).r,(i=uo(i)).r),l=n(r.g,i.g),a=n(r.b,i.b),u=ii(r.opacity,i.opacity);return function(c){return r.r=s(c),r.g=l(c),r.b=a(c),r.opacity=u(c),r+""}}return o.gamma=e,o})(1);function Bu(e,t){t||(t=[]);var n=e?Math.min(t.length,e.length):0,o=t.slice(),r;return function(i){for(r=0;r<n;++r)o[r]=e[r]*(1-i)+t[r]*i;return o}}function Ru(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}function Vu(e,t){var n=t?t.length:0,o=e?Math.min(n,e.length):0,r=new Array(o),i=new Array(n),s;for(s=0;s<o;++s)r[s]=Yt(e[s],t[s]);for(;s<n;++s)i[s]=t[s];return function(l){for(s=0;s<o;++s)i[s]=r[s](l);return i}}function Hu(e,t){var n=new Date;return e=+e,t=+t,function(o){return n.setTime(e*(1-o)+t*o),n}}function Ue(e,t){return e=+e,t=+t,function(n){return e*(1-n)+t*n}}function Fu(e,t){var n={},o={},r;(e===null||typeof e!="object")&&(e={}),(t===null||typeof t!="object")&&(t={});for(r in t)r in e?n[r]=Yt(e[r],t[r]):o[r]=t[r];return function(i){for(r in n)o[r]=n[r](i);return o}}var co=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,Zn=new RegExp(co.source,"g");function Gu(e){return function(){return e}}function Yu(e){return function(t){return e(t)+""}}function si(e,t){var n=co.lastIndex=Zn.lastIndex=0,o,r,i,s=-1,l=[],a=[];for(e=e+"",t=t+"";(o=co.exec(e))&&(r=Zn.exec(t));)(i=r.index)>n&&(i=t.slice(n,i),l[s]?l[s]+=i:l[++s]=i),(o=o[0])===(r=r[0])?l[s]?l[s]+=r:l[++s]=r:(l[++s]=null,a.push({i:s,x:Ue(o,r)})),n=Zn.lastIndex;return n<t.length&&(i=t.slice(n),l[s]?l[s]+=i:l[++s]=i),l.length<2?a[0]?Yu(a[0].x):Gu(t):(t=a.length,function(u){for(var c=0,d;c<t;++c)l[(d=a[c]).i]=d.x(u);return l.join("")})}function Yt(e,t){var n=typeof t,o;return t==null||n==="boolean"?Co(t):(n==="number"?Ue:n==="string"?(o=yt(t))?(t=o,$n):si:t instanceof yt?$n:t instanceof Date?Hu:Ru(t)?Bu:Array.isArray(t)?Vu:typeof t.valueOf!="function"&&typeof t.toString!="function"||isNaN(t)?Fu:Ue)(e,t)}var er=180/Math.PI,fo={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function ai(e,t,n,o,r,i){var s,l,a;return(s=Math.sqrt(e*e+t*t))&&(e/=s,t/=s),(a=e*n+t*o)&&(n-=e*a,o-=t*a),(l=Math.sqrt(n*n+o*o))&&(n/=l,o/=l,a/=l),e*o<t*n&&(e=-e,t=-t,a=-a,s=-s),{translateX:r,translateY:i,rotate:Math.atan2(t,e)*er,skewX:Math.atan(a)*er,scaleX:s,scaleY:l}}var ln;function ju(e){const t=new(typeof DOMMatrix=="function"?DOMMatrix:WebKitCSSMatrix)(e+"");return t.isIdentity?fo:ai(t.a,t.b,t.c,t.d,t.e,t.f)}function Xu(e){return e==null||(ln||(ln=document.createElementNS("http://www.w3.org/2000/svg","g")),ln.setAttribute("transform",e),!(e=ln.transform.baseVal.consolidate()))?fo:(e=e.matrix,ai(e.a,e.b,e.c,e.d,e.e,e.f))}function li(e,t,n,o){function r(u){return u.length?u.pop()+" ":""}function i(u,c,d,f,h,k){if(u!==d||c!==f){var N=h.push("translate(",null,t,null,n);k.push({i:N-4,x:Ue(u,d)},{i:N-2,x:Ue(c,f)})}else(d||f)&&h.push("translate("+d+t+f+n)}function s(u,c,d,f){u!==c?(u-c>180?c+=360:c-u>180&&(u+=360),f.push({i:d.push(r(d)+"rotate(",null,o)-2,x:Ue(u,c)})):c&&d.push(r(d)+"rotate("+c+o)}function l(u,c,d,f){u!==c?f.push({i:d.push(r(d)+"skewX(",null,o)-2,x:Ue(u,c)}):c&&d.push(r(d)+"skewX("+c+o)}function a(u,c,d,f,h,k){if(u!==d||c!==f){var N=h.push(r(h)+"scale(",null,",",null,")");k.push({i:N-4,x:Ue(u,d)},{i:N-2,x:Ue(c,f)})}else(d!==1||f!==1)&&h.push(r(h)+"scale("+d+","+f+")")}return function(u,c){var d=[],f=[];return u=e(u),c=e(c),i(u.translateX,u.translateY,c.translateX,c.translateY,d,f),s(u.rotate,c.rotate,d,f),l(u.skewX,c.skewX,d,f),a(u.scaleX,u.scaleY,c.scaleX,c.scaleY,d,f),u=c=null,function(h){for(var k=-1,N=f.length,_;++k<N;)d[(_=f[k]).i]=_.x(h);return d.join("")}}}var Wu=li(ju,"px, ","px)","deg)"),Uu=li(Xu,", ",")",")"),qu=1e-12;function tr(e){return((e=Math.exp(e))+1/e)/2}function Zu(e){return((e=Math.exp(e))-1/e)/2}function Ku(e){return((e=Math.exp(2*e))-1)/(e+1)}const yn=(function e(t,n,o){function r(i,s){var l=i[0],a=i[1],u=i[2],c=s[0],d=s[1],f=s[2],h=c-l,k=d-a,N=h*h+k*k,_,E;if(N<qu)E=Math.log(f/u)/t,_=function(G){return[l+G*h,a+G*k,u*Math.exp(t*G*E)]};else{var w=Math.sqrt(N),p=(f*f-u*u+o*N)/(2*u*n*w),g=(f*f-u*u-o*N)/(2*f*n*w),L=Math.log(Math.sqrt(p*p+1)-p),V=Math.log(Math.sqrt(g*g+1)-g);E=(V-L)/t,_=function(G){var Y=G*E,J=tr(L),D=u/(n*w)*(J*Ku(t*Y+L)-Zu(L));return[l+D*h,a+D*k,u*J/tr(t*Y+L)]}}return _.duration=E*1e3*t/Math.SQRT2,_}return r.rho=function(i){var s=Math.max(.001,+i),l=s*s,a=l*l;return e(s,l,a)},r})(Math.SQRT2,2,4);var Tt=0,Vt=0,Bt=0,ui=1e3,Mn,Ht,In=0,wt=0,Bn=0,Kt=typeof performance=="object"&&performance.now?performance:Date,ci=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(e){setTimeout(e,17)};function $o(){return wt||(ci(Qu),wt=Kt.now()+Bn)}function Qu(){wt=0}function Pn(){this._call=this._time=this._next=null}Pn.prototype=di.prototype={constructor:Pn,restart:function(e,t,n){if(typeof e!="function")throw new TypeError("callback is not a function");n=(n==null?$o():+n)+(t==null?0:+t),!this._next&&Ht!==this&&(Ht?Ht._next=this:Mn=this,Ht=this),this._call=e,this._time=n,ho()},stop:function(){this._call&&(this._call=null,this._time=1/0,ho())}};function di(e,t,n){var o=new Pn;return o.restart(e,t,n),o}function Ju(){$o(),++Tt;for(var e=Mn,t;e;)(t=wt-e._time)>=0&&e._call.call(void 0,t),e=e._next;--Tt}function nr(){wt=(In=Kt.now())+Bn,Tt=Vt=0;try{Ju()}finally{Tt=0,tc(),wt=0}}function ec(){var e=Kt.now(),t=e-In;t>ui&&(Bn-=t,In=e)}function tc(){for(var e,t=Mn,n,o=1/0;t;)t._call?(o>t._time&&(o=t._time),e=t,t=t._next):(n=t._next,t._next=null,t=e?e._next=n:Mn=n);Ht=e,ho(o)}function ho(e){if(!Tt){Vt&&(Vt=clearTimeout(Vt));var t=e-wt;t>24?(e<1/0&&(Vt=setTimeout(nr,e-Kt.now()-Bn)),Bt&&(Bt=clearInterval(Bt))):(Bt||(In=Kt.now(),Bt=setInterval(ec,ui)),Tt=1,ci(nr))}}function or(e,t,n){var o=new Pn;return t=t==null?0:+t,o.restart(r=>{o.stop(),e(r+t)},t,n),o}var nc=An("start","end","cancel","interrupt"),oc=[],fi=0,rr=1,go=2,wn=3,ir=4,po=5,_n=6;function Rn(e,t,n,o,r,i){var s=e.__transition;if(!s)e.__transition={};else if(n in s)return;rc(e,n,{name:t,index:o,group:r,on:nc,tween:oc,time:i.time,delay:i.delay,duration:i.duration,ease:i.ease,timer:null,state:fi})}function Mo(e,t){var n=je(e,t);if(n.state>fi)throw new Error("too late; already scheduled");return n}function Ke(e,t){var n=je(e,t);if(n.state>wn)throw new Error("too late; already running");return n}function je(e,t){var n=e.__transition;if(!n||!(n=n[t]))throw new Error("transition not found");return n}function rc(e,t,n){var o=e.__transition,r;o[t]=n,n.timer=di(i,0,n.time);function i(u){n.state=rr,n.timer.restart(s,n.delay,n.time),n.delay<=u&&s(u-n.delay)}function s(u){var c,d,f,h;if(n.state!==rr)return a();for(c in o)if(h=o[c],h.name===n.name){if(h.state===wn)return or(s);h.state===ir?(h.state=_n,h.timer.stop(),h.on.call("interrupt",e,e.__data__,h.index,h.group),delete o[c]):+c<t&&(h.state=_n,h.timer.stop(),h.on.call("cancel",e,e.__data__,h.index,h.group),delete o[c])}if(or(function(){n.state===wn&&(n.state=ir,n.timer.restart(l,n.delay,n.time),l(u))}),n.state=go,n.on.call("start",e,e.__data__,n.index,n.group),n.state===go){for(n.state=wn,r=new Array(f=n.tween.length),c=0,d=-1;c<f;++c)(h=n.tween[c].value.call(e,e.__data__,n.index,n.group))&&(r[++d]=h);r.length=d+1}}function l(u){for(var c=u<n.duration?n.ease.call(null,u/n.duration):(n.timer.restart(a),n.state=po,1),d=-1,f=r.length;++d<f;)r[d].call(e,c);n.state===po&&(n.on.call("end",e,e.__data__,n.index,n.group),a())}function a(){n.state=_n,n.timer.stop(),delete o[t];for(var u in o)return;delete e.__transition}}function xn(e,t){var n=e.__transition,o,r,i=!0,s;if(n){t=t==null?null:t+"";for(s in n){if((o=n[s]).name!==t){i=!1;continue}r=o.state>go&&o.state<po,o.state=_n,o.timer.stop(),o.on.call(r?"interrupt":"cancel",e,e.__data__,o.index,o.group),delete n[s]}i&&delete e.__transition}}function ic(e){return this.each(function(){xn(this,e)})}function sc(e,t){var n,o;return function(){var r=Ke(this,e),i=r.tween;if(i!==n){o=n=i;for(var s=0,l=o.length;s<l;++s)if(o[s].name===t){o=o.slice(),o.splice(s,1);break}}r.tween=o}}function ac(e,t,n){var o,r;if(typeof n!="function")throw new Error;return function(){var i=Ke(this,e),s=i.tween;if(s!==o){r=(o=s).slice();for(var l={name:t,value:n},a=0,u=r.length;a<u;++a)if(r[a].name===t){r[a]=l;break}a===u&&r.push(l)}i.tween=r}}function lc(e,t){var n=this._id;if(e+="",arguments.length<2){for(var o=je(this.node(),n).tween,r=0,i=o.length,s;r<i;++r)if((s=o[r]).name===e)return s.value;return null}return this.each((t==null?sc:ac)(n,e,t))}function Io(e,t,n){var o=e._id;return e.each(function(){var r=Ke(this,o);(r.value||(r.value={}))[t]=n.apply(this,arguments)}),function(r){return je(r,o).value[t]}}function hi(e,t){var n;return(typeof t=="number"?Ue:t instanceof yt?$n:(n=yt(t))?(t=n,$n):si)(e,t)}function uc(e){return function(){this.removeAttribute(e)}}function cc(e){return function(){this.removeAttributeNS(e.space,e.local)}}function dc(e,t,n){var o,r=n+"",i;return function(){var s=this.getAttribute(e);return s===r?null:s===o?i:i=t(o=s,n)}}function fc(e,t,n){var o,r=n+"",i;return function(){var s=this.getAttributeNS(e.space,e.local);return s===r?null:s===o?i:i=t(o=s,n)}}function hc(e,t,n){var o,r,i;return function(){var s,l=n(this),a;return l==null?void this.removeAttribute(e):(s=this.getAttribute(e),a=l+"",s===a?null:s===o&&a===r?i:(r=a,i=t(o=s,l)))}}function gc(e,t,n){var o,r,i;return function(){var s,l=n(this),a;return l==null?void this.removeAttributeNS(e.space,e.local):(s=this.getAttributeNS(e.space,e.local),a=l+"",s===a?null:s===o&&a===r?i:(r=a,i=t(o=s,l)))}}function pc(e,t){var n=Ln(e),o=n==="transform"?Uu:hi;return this.attrTween(e,typeof t=="function"?(n.local?gc:hc)(n,o,Io(this,"attr."+e,t)):t==null?(n.local?cc:uc)(n):(n.local?fc:dc)(n,o,t))}function vc(e,t){return function(n){this.setAttribute(e,t.call(this,n))}}function mc(e,t){return function(n){this.setAttributeNS(e.space,e.local,t.call(this,n))}}function yc(e,t){var n,o;function r(){var i=t.apply(this,arguments);return i!==o&&(n=(o=i)&&mc(e,i)),n}return r._value=t,r}function wc(e,t){var n,o;function r(){var i=t.apply(this,arguments);return i!==o&&(n=(o=i)&&vc(e,i)),n}return r._value=t,r}function _c(e,t){var n="attr."+e;if(arguments.length<2)return(n=this.tween(n))&&n._value;if(t==null)return this.tween(n,null);if(typeof t!="function")throw new Error;var o=Ln(e);return this.tween(n,(o.local?yc:wc)(o,t))}function xc(e,t){return function(){Mo(this,e).delay=+t.apply(this,arguments)}}function bc(e,t){return t=+t,function(){Mo(this,e).delay=t}}function Ec(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?xc:bc)(t,e)):je(this.node(),t).delay}function kc(e,t){return function(){Ke(this,e).duration=+t.apply(this,arguments)}}function Sc(e,t){return t=+t,function(){Ke(this,e).duration=t}}function Nc(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?kc:Sc)(t,e)):je(this.node(),t).duration}function Cc(e,t){if(typeof t!="function")throw new Error;return function(){Ke(this,e).ease=t}}function $c(e){var t=this._id;return arguments.length?this.each(Cc(t,e)):je(this.node(),t).ease}function Mc(e,t){return function(){var n=t.apply(this,arguments);if(typeof n!="function")throw new Error;Ke(this,e).ease=n}}function Ic(e){if(typeof e!="function")throw new Error;return this.each(Mc(this._id,e))}function Pc(e){typeof e!="function"&&(e=jr(e));for(var t=this._groups,n=t.length,o=new Array(n),r=0;r<n;++r)for(var i=t[r],s=i.length,l=o[r]=[],a,u=0;u<s;++u)(a=i[u])&&e.call(a,a.__data__,u,i)&&l.push(a);return new ot(o,this._parents,this._name,this._id)}function Tc(e){if(e._id!==this._id)throw new Error;for(var t=this._groups,n=e._groups,o=t.length,r=n.length,i=Math.min(o,r),s=new Array(o),l=0;l<i;++l)for(var a=t[l],u=n[l],c=a.length,d=s[l]=new Array(c),f,h=0;h<c;++h)(f=a[h]||u[h])&&(d[h]=f);for(;l<o;++l)s[l]=t[l];return new ot(s,this._parents,this._name,this._id)}function Oc(e){return(e+"").trim().split(/^|\s+/).every(function(t){var n=t.indexOf(".");return n>=0&&(t=t.slice(0,n)),!t||t==="start"})}function Dc(e,t,n){var o,r,i=Oc(t)?Mo:Ke;return function(){var s=i(this,e),l=s.on;l!==o&&(r=(o=l).copy()).on(t,n),s.on=r}}function zc(e,t){var n=this._id;return arguments.length<2?je(this.node(),n).on.on(e):this.each(Dc(n,e,t))}function Ac(e){return function(){var t=this.parentNode;for(var n in this.__transition)if(+n!==e)return;t&&t.removeChild(this)}}function Lc(){return this.on("end.remove",Ac(this._id))}function Bc(e){var t=this._name,n=this._id;typeof e!="function"&&(e=ko(e));for(var o=this._groups,r=o.length,i=new Array(r),s=0;s<r;++s)for(var l=o[s],a=l.length,u=i[s]=new Array(a),c,d,f=0;f<a;++f)(c=l[f])&&(d=e.call(c,c.__data__,f,l))&&("__data__"in c&&(d.__data__=c.__data__),u[f]=d,Rn(u[f],t,n,f,u,je(c,n)));return new ot(i,this._parents,t,n)}function Rc(e){var t=this._name,n=this._id;typeof e!="function"&&(e=Yr(e));for(var o=this._groups,r=o.length,i=[],s=[],l=0;l<r;++l)for(var a=o[l],u=a.length,c,d=0;d<u;++d)if(c=a[d]){for(var f=e.call(c,c.__data__,d,a),h,k=je(c,n),N=0,_=f.length;N<_;++N)(h=f[N])&&Rn(h,t,n,N,f,k);i.push(f),s.push(c)}return new ot(i,s,t,n)}var Vc=tn.prototype.constructor;function Hc(){return new Vc(this._groups,this._parents)}function Fc(e,t){var n,o,r;return function(){var i=Pt(this,e),s=(this.style.removeProperty(e),Pt(this,e));return i===s?null:i===n&&s===o?r:r=t(n=i,o=s)}}function gi(e){return function(){this.style.removeProperty(e)}}function Gc(e,t,n){var o,r=n+"",i;return function(){var s=Pt(this,e);return s===r?null:s===o?i:i=t(o=s,n)}}function Yc(e,t,n){var o,r,i;return function(){var s=Pt(this,e),l=n(this),a=l+"";return l==null&&(a=l=(this.style.removeProperty(e),Pt(this,e))),s===a?null:s===o&&a===r?i:(r=a,i=t(o=s,l))}}function jc(e,t){var n,o,r,i="style."+t,s="end."+i,l;return function(){var a=Ke(this,e),u=a.on,c=a.value[i]==null?l||(l=gi(t)):void 0;(u!==n||r!==c)&&(o=(n=u).copy()).on(s,r=c),a.on=o}}function Xc(e,t,n){var o=(e+="")=="transform"?Wu:hi;return t==null?this.styleTween(e,Fc(e,o)).on("end.style."+e,gi(e)):typeof t=="function"?this.styleTween(e,Yc(e,o,Io(this,"style."+e,t))).each(jc(this._id,e)):this.styleTween(e,Gc(e,o,t),n).on("end.style."+e,null)}function Wc(e,t,n){return function(o){this.style.setProperty(e,t.call(this,o),n)}}function Uc(e,t,n){var o,r;function i(){var s=t.apply(this,arguments);return s!==r&&(o=(r=s)&&Wc(e,s,n)),o}return i._value=t,i}function qc(e,t,n){var o="style."+(e+="");if(arguments.length<2)return(o=this.tween(o))&&o._value;if(t==null)return this.tween(o,null);if(typeof t!="function")throw new Error;return this.tween(o,Uc(e,t,n??""))}function Zc(e){return function(){this.textContent=e}}function Kc(e){return function(){var t=e(this);this.textContent=t??""}}function Qc(e){return this.tween("text",typeof e=="function"?Kc(Io(this,"text",e)):Zc(e==null?"":e+""))}function Jc(e){return function(t){this.textContent=e.call(this,t)}}function ed(e){var t,n;function o(){var r=e.apply(this,arguments);return r!==n&&(t=(n=r)&&Jc(r)),t}return o._value=e,o}function td(e){var t="text";if(arguments.length<1)return(t=this.tween(t))&&t._value;if(e==null)return this.tween(t,null);if(typeof e!="function")throw new Error;return this.tween(t,ed(e))}function nd(){for(var e=this._name,t=this._id,n=pi(),o=this._groups,r=o.length,i=0;i<r;++i)for(var s=o[i],l=s.length,a,u=0;u<l;++u)if(a=s[u]){var c=je(a,t);Rn(a,e,n,u,s,{time:c.time+c.delay+c.duration,delay:0,duration:c.duration,ease:c.ease})}return new ot(o,this._parents,e,n)}function od(){var e,t,n=this,o=n._id,r=n.size();return new Promise(function(i,s){var l={value:s},a={value:function(){--r===0&&i()}};n.each(function(){var u=Ke(this,o),c=u.on;c!==e&&(t=(e=c).copy(),t._.cancel.push(l),t._.interrupt.push(l),t._.end.push(a)),u.on=t}),r===0&&i()})}var rd=0;function ot(e,t,n,o){this._groups=e,this._parents=t,this._name=n,this._id=o}function pi(){return++rd}var Qe=tn.prototype;ot.prototype={constructor:ot,select:Bc,selectAll:Rc,selectChild:Qe.selectChild,selectChildren:Qe.selectChildren,filter:Pc,merge:Tc,selection:Hc,transition:nd,call:Qe.call,nodes:Qe.nodes,node:Qe.node,size:Qe.size,empty:Qe.empty,each:Qe.each,on:zc,attr:pc,attrTween:_c,style:Xc,styleTween:qc,text:Qc,textTween:td,remove:Lc,tween:lc,delay:Ec,duration:Nc,ease:$c,easeVarying:Ic,end:od,[Symbol.iterator]:Qe[Symbol.iterator]};function id(e){return((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2}var sd={time:null,delay:0,duration:250,ease:id};function ad(e,t){for(var n;!(n=e.__transition)||!(n=n[t]);)if(!(e=e.parentNode))throw new Error(`transition ${t} not found`);return n}function ld(e){var t,n;e instanceof ot?(t=e._id,e=e._name):(t=pi(),(n=sd).time=$o(),e=e==null?null:e+"");for(var o=this._groups,r=o.length,i=0;i<r;++i)for(var s=o[i],l=s.length,a,u=0;u<l;++u)(a=s[u])&&Rn(a,e,t,u,s,n||ad(a,t));return new ot(o,this._parents,e,t)}tn.prototype.interrupt=ic;tn.prototype.transition=ld;const un=e=>()=>e;function ud(e,{sourceEvent:t,target:n,transform:o,dispatch:r}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:t,enumerable:!0,configurable:!0},target:{value:n,enumerable:!0,configurable:!0},transform:{value:o,enumerable:!0,configurable:!0},_:{value:r}})}function et(e,t,n){this.k=e,this.x=t,this.y=n}et.prototype={constructor:et,scale:function(e){return e===1?this:new et(this.k*e,this.x,this.y)},translate:function(e,t){return e===0&t===0?this:new et(this.k,this.x+this.k*e,this.y+this.k*t)},apply:function(e){return[e[0]*this.k+this.x,e[1]*this.k+this.y]},applyX:function(e){return e*this.k+this.x},applyY:function(e){return e*this.k+this.y},invert:function(e){return[(e[0]-this.x)/this.k,(e[1]-this.y)/this.k]},invertX:function(e){return(e-this.x)/this.k},invertY:function(e){return(e-this.y)/this.k},rescaleX:function(e){return e.copy().domain(e.range().map(this.invertX,this).map(e.invert,e))},rescaleY:function(e){return e.copy().domain(e.range().map(this.invertY,this).map(e.invert,e))},toString:function(){return"translate("+this.x+","+this.y+") scale("+this.k+")"}};var Ot=new et(1,0,0);et.prototype;function Kn(e){e.stopImmediatePropagation()}function Rt(e){e.preventDefault(),e.stopImmediatePropagation()}function cd(e){return(!e.ctrlKey||e.type==="wheel")&&!e.button}function dd(){var e=this;return e instanceof SVGElement?(e=e.ownerSVGElement||e,e.hasAttribute("viewBox")?(e=e.viewBox.baseVal,[[e.x,e.y],[e.x+e.width,e.y+e.height]]):[[0,0],[e.width.baseVal.value,e.height.baseVal.value]]):[[0,0],[e.clientWidth,e.clientHeight]]}function sr(){return this.__zoom||Ot}function fd(e){return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*(e.ctrlKey?10:1)}function hd(){return navigator.maxTouchPoints||"ontouchstart"in this}function gd(e,t,n){var o=e.invertX(t[0][0])-n[0][0],r=e.invertX(t[1][0])-n[1][0],i=e.invertY(t[0][1])-n[0][1],s=e.invertY(t[1][1])-n[1][1];return e.translate(r>o?(o+r)/2:Math.min(0,o)||Math.max(0,r),s>i?(i+s)/2:Math.min(0,i)||Math.max(0,s))}function pd(){var e=cd,t=dd,n=gd,o=fd,r=hd,i=[0,1/0],s=[[-1/0,-1/0],[1/0,1/0]],l=250,a=yn,u=An("start","zoom","end"),c,d,f,h=500,k=150,N=0,_=10;function E(v){v.property("__zoom",sr).on("wheel.zoom",Y,{passive:!1}).on("mousedown.zoom",J).on("dblclick.zoom",D).filter(r).on("touchstart.zoom",z).on("touchmove.zoom",x).on("touchend.zoom touchcancel.zoom",R).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}E.transform=function(v,$,y,b){var S=v.selection?v.selection():v;S.property("__zoom",sr),v!==S?L(v,$,y,b):S.interrupt().each(function(){V(this,arguments).event(b).start().zoom(null,typeof $=="function"?$.apply(this,arguments):$).end()})},E.scaleBy=function(v,$,y,b){E.scaleTo(v,function(){var S=this.__zoom.k,O=typeof $=="function"?$.apply(this,arguments):$;return S*O},y,b)},E.scaleTo=function(v,$,y,b){E.transform(v,function(){var S=t.apply(this,arguments),O=this.__zoom,B=y==null?g(S):typeof y=="function"?y.apply(this,arguments):y,H=O.invert(B),W=typeof $=="function"?$.apply(this,arguments):$;return n(p(w(O,W),B,H),S,s)},y,b)},E.translateBy=function(v,$,y,b){E.transform(v,function(){return n(this.__zoom.translate(typeof $=="function"?$.apply(this,arguments):$,typeof y=="function"?y.apply(this,arguments):y),t.apply(this,arguments),s)},null,b)},E.translateTo=function(v,$,y,b,S){E.transform(v,function(){var O=t.apply(this,arguments),B=this.__zoom,H=b==null?g(O):typeof b=="function"?b.apply(this,arguments):b;return n(Ot.translate(H[0],H[1]).scale(B.k).translate(typeof $=="function"?-$.apply(this,arguments):-$,typeof y=="function"?-y.apply(this,arguments):-y),O,s)},b,S)};function w(v,$){return $=Math.max(i[0],Math.min(i[1],$)),$===v.k?v:new et($,v.x,v.y)}function p(v,$,y){var b=$[0]-y[0]*v.k,S=$[1]-y[1]*v.k;return b===v.x&&S===v.y?v:new et(v.k,b,S)}function g(v){return[(+v[0][0]+ +v[1][0])/2,(+v[0][1]+ +v[1][1])/2]}function L(v,$,y,b){v.on("start.zoom",function(){V(this,arguments).event(b).start()}).on("interrupt.zoom end.zoom",function(){V(this,arguments).event(b).end()}).tween("zoom",function(){var S=this,O=arguments,B=V(S,O).event(b),H=t.apply(S,O),W=y==null?g(H):typeof y=="function"?y.apply(S,O):y,K=Math.max(H[1][0]-H[0][0],H[1][1]-H[0][1]),P=S.__zoom,m=typeof $=="function"?$.apply(S,O):$,C=a(P.invert(W).concat(K/P.k),m.invert(W).concat(K/m.k));return function(T){if(T===1)T=m;else{var j=C(T),Q=K/j[2];T=new et(Q,W[0]-j[0]*Q,W[1]-j[1]*Q)}B.zoom(null,T)}})}function V(v,$,y){return!y&&v.__zooming||new G(v,$)}function G(v,$){this.that=v,this.args=$,this.active=0,this.sourceEvent=null,this.extent=t.apply(v,$),this.taps=0}G.prototype={event:function(v){return v&&(this.sourceEvent=v),this},start:function(){return++this.active===1&&(this.that.__zooming=this,this.emit("start")),this},zoom:function(v,$){return this.mouse&&v!=="mouse"&&(this.mouse[1]=$.invert(this.mouse[0])),this.touch0&&v!=="touch"&&(this.touch0[1]=$.invert(this.touch0[0])),this.touch1&&v!=="touch"&&(this.touch1[1]=$.invert(this.touch1[0])),this.that.__zoom=$,this.emit("zoom"),this},end:function(){return--this.active===0&&(delete this.that.__zooming,this.emit("end")),this},emit:function(v){var $=Fe(this.that).datum();u.call(v,this.that,new ud(v,{sourceEvent:this.sourceEvent,target:E,transform:this.that.__zoom,dispatch:u}),$)}};function Y(v,...$){if(!e.apply(this,arguments))return;var y=V(this,$).event(v),b=this.__zoom,S=Math.max(i[0],Math.min(i[1],b.k*Math.pow(2,o.apply(this,arguments)))),O=We(v);if(y.wheel)(y.mouse[0][0]!==O[0]||y.mouse[0][1]!==O[1])&&(y.mouse[1]=b.invert(y.mouse[0]=O)),clearTimeout(y.wheel);else{if(b.k===S)return;y.mouse=[O,b.invert(O)],xn(this),y.start()}Rt(v),y.wheel=setTimeout(B,k),y.zoom("mouse",n(p(w(b,S),y.mouse[0],y.mouse[1]),y.extent,s));function B(){y.wheel=null,y.end()}}function J(v,...$){if(f||!e.apply(this,arguments))return;var y=v.currentTarget,b=V(this,$,!0).event(v),S=Fe(v.view).on("mousemove.zoom",W,!0).on("mouseup.zoom",K,!0),O=We(v,y),B=v.clientX,H=v.clientY;ti(v.view),Kn(v),b.mouse=[O,this.__zoom.invert(O)],xn(this),b.start();function W(P){if(Rt(P),!b.moved){var m=P.clientX-B,C=P.clientY-H;b.moved=m*m+C*C>N}b.event(P).zoom("mouse",n(p(b.that.__zoom,b.mouse[0]=We(P,y),b.mouse[1]),b.extent,s))}function K(P){S.on("mousemove.zoom mouseup.zoom",null),ni(P.view,b.moved),Rt(P),b.event(P).end()}}function D(v,...$){if(e.apply(this,arguments)){var y=this.__zoom,b=We(v.changedTouches?v.changedTouches[0]:v,this),S=y.invert(b),O=y.k*(v.shiftKey?.5:2),B=n(p(w(y,O),b,S),t.apply(this,$),s);Rt(v),l>0?Fe(this).transition().duration(l).call(L,B,b,v):Fe(this).call(E.transform,B,b,v)}}function z(v,...$){if(e.apply(this,arguments)){var y=v.touches,b=y.length,S=V(this,$,v.changedTouches.length===b).event(v),O,B,H,W;for(Kn(v),B=0;B<b;++B)H=y[B],W=We(H,this),W=[W,this.__zoom.invert(W),H.identifier],S.touch0?!S.touch1&&S.touch0[2]!==W[2]&&(S.touch1=W,S.taps=0):(S.touch0=W,O=!0,S.taps=1+!!c);c&&(c=clearTimeout(c)),O&&(S.taps<2&&(d=W[0],c=setTimeout(function(){c=null},h)),xn(this),S.start())}}function x(v,...$){if(this.__zooming){var y=V(this,$).event(v),b=v.changedTouches,S=b.length,O,B,H,W;for(Rt(v),O=0;O<S;++O)B=b[O],H=We(B,this),y.touch0&&y.touch0[2]===B.identifier?y.touch0[0]=H:y.touch1&&y.touch1[2]===B.identifier&&(y.touch1[0]=H);if(B=y.that.__zoom,y.touch1){var K=y.touch0[0],P=y.touch0[1],m=y.touch1[0],C=y.touch1[1],T=(T=m[0]-K[0])*T+(T=m[1]-K[1])*T,j=(j=C[0]-P[0])*j+(j=C[1]-P[1])*j;B=w(B,Math.sqrt(T/j)),H=[(K[0]+m[0])/2,(K[1]+m[1])/2],W=[(P[0]+C[0])/2,(P[1]+C[1])/2]}else if(y.touch0)H=y.touch0[0],W=y.touch0[1];else return;y.zoom("touch",n(p(B,H,W),y.extent,s))}}function R(v,...$){if(this.__zooming){var y=V(this,$).event(v),b=v.changedTouches,S=b.length,O,B;for(Kn(v),f&&clearTimeout(f),f=setTimeout(function(){f=null},h),O=0;O<S;++O)B=b[O],y.touch0&&y.touch0[2]===B.identifier?delete y.touch0:y.touch1&&y.touch1[2]===B.identifier&&delete y.touch1;if(y.touch1&&!y.touch0&&(y.touch0=y.touch1,delete y.touch1),y.touch0)y.touch0[1]=this.__zoom.invert(y.touch0[0]);else if(y.end(),y.taps===2&&(B=We(B,this),Math.hypot(d[0]-B[0],d[1]-B[1])<_)){var H=Fe(this).on("dblclick.zoom");H&&H.apply(this,arguments)}}}return E.wheelDelta=function(v){return arguments.length?(o=typeof v=="function"?v:un(+v),E):o},E.filter=function(v){return arguments.length?(e=typeof v=="function"?v:un(!!v),E):e},E.touchable=function(v){return arguments.length?(r=typeof v=="function"?v:un(!!v),E):r},E.extent=function(v){return arguments.length?(t=typeof v=="function"?v:un([[+v[0][0],+v[0][1]],[+v[1][0],+v[1][1]]]),E):t},E.scaleExtent=function(v){return arguments.length?(i[0]=+v[0],i[1]=+v[1],E):[i[0],i[1]]},E.translateExtent=function(v){return arguments.length?(s[0][0]=+v[0][0],s[1][0]=+v[1][0],s[0][1]=+v[0][1],s[1][1]=+v[1][1],E):[[s[0][0],s[0][1]],[s[1][0],s[1][1]]]},E.constrain=function(v){return arguments.length?(n=v,E):n},E.duration=function(v){return arguments.length?(l=+v,E):l},E.interpolate=function(v){return arguments.length?(a=v,E):a},E.on=function(){var v=u.on.apply(u,arguments);return v===u?E:v},E.clickDistance=function(v){return arguments.length?(N=(v=+v)*v,E):Math.sqrt(N)},E.tapDistance=function(v){return arguments.length?(_=+v,E):_},E}var ue=(e=>(e.Left="left",e.Top="top",e.Right="right",e.Bottom="bottom",e))(ue||{}),Po=(e=>(e.Partial="partial",e.Full="full",e))(Po||{}),ht=(e=>(e.Bezier="default",e.SimpleBezier="simple-bezier",e.Straight="straight",e.Step="step",e.SmoothStep="smoothstep",e))(ht||{}),dt=(e=>(e.Strict="strict",e.Loose="loose",e))(dt||{}),Tn=(e=>(e.Arrow="arrow",e.ArrowClosed="arrowclosed",e))(Tn||{}),jt=(e=>(e.Free="free",e.Vertical="vertical",e.Horizontal="horizontal",e))(jt||{}),vi=(e=>(e.TopLeft="top-left",e.TopCenter="top-center",e.TopRight="top-right",e.BottomLeft="bottom-left",e.BottomCenter="bottom-center",e.BottomRight="bottom-right",e))(vi||{});const vd=["INPUT","SELECT","TEXTAREA"],md=typeof document<"u"?document:null;function vo(e){var t,n;const o=((n=(t=e.composedPath)==null?void 0:t.call(e))==null?void 0:n[0])||e.target,r=typeof o?.hasAttribute=="function"?o.hasAttribute("contenteditable"):!1,i=typeof o?.closest=="function"?o.closest(".nokey"):null;return vd.includes(o?.nodeName)||r||!!i}function yd(e){return e.ctrlKey||e.metaKey||e.shiftKey||e.altKey}function ar(e,t,n,o){const r=t.replace("+",`
|
|
3
|
-
`).replace(`
|
|
4
|
-
|
|
5
|
-
`,`
|
|
6
|
-
+`).split(`
|
|
7
|
-
`).map(s=>s.trim().toLowerCase());if(r.length===1)return e.toLowerCase()===t.toLowerCase();o||n.add(e.toLowerCase());const i=r.every((s,l)=>n.has(s)&&Array.from(n.values())[l]===r[l]);return o&&n.delete(e.toLowerCase()),i}function wd(e,t){return n=>{if(!n.code&&!n.key)return!1;const o=_d(n.code,e);return Array.isArray(e)?e.some(r=>ar(n[o],r,t,n.type==="keyup")):ar(n[o],e,t,n.type==="keyup")}}function _d(e,t){return t.includes(e)?"code":"key"}function Xt(e,t){const n=re(()=>_e(t?.target)??md),o=ut(_e(e)===!0);let r=!1;const i=new Set;let s=a(_e(e));ye(()=>_e(e),(u,c)=>{typeof c=="boolean"&&typeof u!="boolean"&&l(),s=a(u)},{immediate:!0}),Fr(["blur","contextmenu"],l),Go((...u)=>s(...u),u=>{var c,d;const f=_e(t?.actInsideInputWithModifier)??!0,h=_e(t?.preventDefault)??!1;if(r=yd(u),(!r||r&&!f)&&vo(u))return;const N=((d=(c=u.composedPath)==null?void 0:c.call(u))==null?void 0:d[0])||u.target,_=N?.nodeName==="BUTTON"||N?.nodeName==="A";!h&&(r||!_)&&u.preventDefault(),o.value=!0},{eventName:"keydown",target:n}),Go((...u)=>s(...u),u=>{const c=_e(t?.actInsideInputWithModifier)??!0;if(o.value){if((!r||r&&!c)&&vo(u))return;r=!1,o.value=!1}},{eventName:"keyup",target:n});function l(){r=!1,i.clear(),o.value=_e(e)===!0}function a(u){return u===null?(l(),()=>!1):typeof u=="boolean"?(l(),o.value=u,()=>!1):Array.isArray(u)||typeof u=="string"?wd(u,i):u}return o}const mi="vue-flow__node-desc",yi="vue-flow__edge-desc",xd="vue-flow__aria-live",wi=["Enter"," ","Escape"],$t={ArrowUp:{x:0,y:-1},ArrowDown:{x:0,y:1},ArrowLeft:{x:-1,y:0},ArrowRight:{x:1,y:0}};function On(e){return{...e.computedPosition||{x:0,y:0},width:e.dimensions.width||0,height:e.dimensions.height||0}}function Dn(e,t){const n=Math.max(0,Math.min(e.x+e.width,t.x+t.width)-Math.max(e.x,t.x)),o=Math.max(0,Math.min(e.y+e.height,t.y+t.height)-Math.max(e.y,t.y));return Math.ceil(n*o)}function Vn(e){return{width:e.offsetWidth,height:e.offsetHeight}}function _t(e,t=0,n=1){return Math.min(Math.max(e,t),n)}function _i(e,t){return{x:_t(e.x,t[0][0],t[1][0]),y:_t(e.y,t[0][1],t[1][1])}}function lr(e){const t=e.getRootNode();return"elementFromPoint"in t?t:window.document}function ft(e){return e&&typeof e=="object"&&"id"in e&&"source"in e&&"target"in e}function mt(e){return e&&typeof e=="object"&&"id"in e&&"position"in e&&!ft(e)}function Ft(e){return mt(e)&&"computedPosition"in e}function cn(e){return!Number.isNaN(e)&&Number.isFinite(e)}function bd(e){return cn(e.width)&&cn(e.height)&&cn(e.x)&&cn(e.y)}function Ed(e,t,n){const o={id:e.id.toString(),type:e.type??"default",dimensions:St({width:0,height:0}),computedPosition:St({z:0,...e.position}),handleBounds:{source:[],target:[]},draggable:void 0,selectable:void 0,connectable:void 0,focusable:void 0,selected:!1,dragging:!1,resizing:!1,initialized:!1,isParent:!1,position:{x:0,y:0},data:Te(e.data)?e.data:{},events:St(Te(e.events)?e.events:{})};return Object.assign(t??o,e,{id:e.id.toString(),parentNode:n})}function xi(e,t,n){var o,r;const i={id:e.id.toString(),type:e.type??t?.type??"default",source:e.source.toString(),target:e.target.toString(),sourceHandle:(o=e.sourceHandle)==null?void 0:o.toString(),targetHandle:(r=e.targetHandle)==null?void 0:r.toString(),updatable:e.updatable??n?.updatable,selectable:e.selectable??n?.selectable,focusable:e.focusable??n?.focusable,data:Te(e.data)?e.data:{},events:St(Te(e.events)?e.events:{}),label:e.label??"",interactionWidth:e.interactionWidth??n?.interactionWidth,...n??{}};return Object.assign(t??i,e,{id:e.id.toString()})}function bi(e,t,n,o){const r=typeof e=="string"?e:e.id,i=new Set,s=o==="source"?"target":"source";for(const l of n)l[s]===r&&i.add(l[o]);return t.filter(l=>i.has(l.id))}function kd(...e){if(e.length===3){const[i,s,l]=e;return bi(i,s,l,"target")}const[t,n]=e,o=typeof t=="string"?t:t.id;return n.filter(i=>ft(i)&&i.source===o).map(i=>n.find(s=>mt(s)&&s.id===i.target))}function Sd(...e){if(e.length===3){const[i,s,l]=e;return bi(i,s,l,"source")}const[t,n]=e,o=typeof t=="string"?t:t.id;return n.filter(i=>ft(i)&&i.target===o).map(i=>n.find(s=>mt(s)&&s.id===i.source))}function Ei({source:e,sourceHandle:t,target:n,targetHandle:o}){return`vueflow__edge-${e}${t??""}-${n}${o??""}`}function Nd(e,t){return t.some(n=>ft(n)&&n.source===e.source&&n.target===e.target&&(n.sourceHandle===e.sourceHandle||!n.sourceHandle&&!e.sourceHandle)&&(n.targetHandle===e.targetHandle||!n.targetHandle&&!e.targetHandle))}function Qt({x:e,y:t},{x:n,y:o,zoom:r}){return{x:e*r+n,y:t*r+o}}function Jt({x:e,y:t},{x:n,y:o,zoom:r},i=!1,s=[1,1]){const l={x:(e-n)/r,y:(t-o)/r};return i?Hn(l,s):l}function Cd(e,t){return{x:Math.min(e.x,t.x),y:Math.min(e.y,t.y),x2:Math.max(e.x2,t.x2),y2:Math.max(e.y2,t.y2)}}function ki({x:e,y:t,width:n,height:o}){return{x:e,y:t,x2:e+n,y2:t+o}}function $d({x:e,y:t,x2:n,y2:o}){return{x:e,y:t,width:n-e,height:o-t}}function Si(e){let t={x:Number.POSITIVE_INFINITY,y:Number.POSITIVE_INFINITY,x2:Number.NEGATIVE_INFINITY,y2:Number.NEGATIVE_INFINITY};for(let n=0;n<e.length;n++){const o=e[n];t=Cd(t,ki({...o.computedPosition,...o.dimensions}))}return $d(t)}function Ni(e,t,n={x:0,y:0,zoom:1},o=!1,r=!1){const i={...Jt(t,n),width:t.width/n.zoom,height:t.height/n.zoom},s=[];for(const l of e){const{dimensions:a,selectable:u=!0,hidden:c=!1}=l,d=a.width??l.width??null,f=a.height??l.height??null;if(r&&!u||c)continue;const h=Dn(i,On(l)),k=d===null||f===null,N=o&&h>0,_=(d??0)*(f??0);(k||N||h>=_||l.dragging)&&s.push(l)}return s}function Ci(e,t){const n=new Set;if(typeof e=="string")n.add(e);else if(e.length>=1)for(const o of e)n.add(o.id);return t.filter(o=>n.has(o.source)||n.has(o.target))}function bt(e,t){if(typeof e=="number")return Math.floor((t-t/(1+e))*.5);if(typeof e=="string"&&e.endsWith("px")){const n=Number.parseFloat(e);if(!Number.isNaN(n))return Math.floor(n)}if(typeof e=="string"&&e.endsWith("%")){const n=Number.parseFloat(e);if(!Number.isNaN(n))return Math.floor(t*n*.01)}return on(`The padding value "${e}" is invalid. Please provide a number or a string with a valid unit (px or %).`),0}function Md(e,t,n){if(typeof e=="string"||typeof e=="number"){const o=bt(e,n),r=bt(e,t);return{top:o,right:r,bottom:o,left:r,x:r*2,y:o*2}}if(typeof e=="object"){const o=bt(e.top??e.y??0,n),r=bt(e.bottom??e.y??0,n),i=bt(e.left??e.x??0,t),s=bt(e.right??e.x??0,t);return{top:o,right:s,bottom:r,left:i,x:i+s,y:o+r}}return{top:0,right:0,bottom:0,left:0,x:0,y:0}}function Id(e,t,n,o,r,i){const{x:s,y:l}=Qt(e,{x:t,y:n,zoom:o}),{x:a,y:u}=Qt({x:e.x+e.width,y:e.y+e.height},{x:t,y:n,zoom:o}),c=r-a,d=i-u;return{left:Math.floor(s),top:Math.floor(l),right:Math.floor(c),bottom:Math.floor(d)}}function ur(e,t,n,o,r,i=.1){const s=Md(i,t,n),l=(t-s.x)/e.width,a=(n-s.y)/e.height,u=Math.min(l,a),c=_t(u,o,r),d=e.x+e.width/2,f=e.y+e.height/2,h=t/2-d*c,k=n/2-f*c,N=Id(e,h,k,c,t,n),_={left:Math.min(N.left-s.left,0),top:Math.min(N.top-s.top,0),right:Math.min(N.right-s.right,0),bottom:Math.min(N.bottom-s.bottom,0)};return{x:h-_.left+_.right,y:k-_.top+_.bottom,zoom:c}}function Pd(e,t){return{x:t.x+e.x,y:t.y+e.y,z:(e.z>t.z?e.z:t.z)+1}}function $i(e,t){if(!e.parentNode)return!1;const n=t.get(e.parentNode);return n?n.selected?!0:$i(n,t):!1}function en(e,t){return typeof e>"u"?"":typeof e=="string"?e:`${t?`${t}__`:""}${Object.keys(e).sort().map(o=>`${o}=${e[o]}`).join("&")}`}function cr(e){const t=e.ctrlKey&&zn()?10:1;return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*t}function dr(e,t,n){return e<t?_t(Math.abs(e-t),1,t)/t:e>n?-_t(Math.abs(e-n),1,t)/t:0}function Mi(e,t,n=15,o=40){const r=dr(e.x,o,t.width-o)*n,i=dr(e.y,o,t.height-o)*n;return[r,i]}function Qn(e,t){if(t){const n=e.position.x+e.dimensions.width-t.dimensions.width,o=e.position.y+e.dimensions.height-t.dimensions.height;if(n>0||o>0||e.position.x<0||e.position.y<0){let r={};if(typeof t.style=="function"?r={...t.style(t)}:t.style&&(r={...t.style}),r.width=r.width??`${t.dimensions.width}px`,r.height=r.height??`${t.dimensions.height}px`,n>0)if(typeof r.width=="string"){const i=Number(r.width.replace("px",""));r.width=`${i+n}px`}else r.width+=n;if(o>0)if(typeof r.height=="string"){const i=Number(r.height.replace("px",""));r.height=`${i+o}px`}else r.height+=o;if(e.position.x<0){const i=Math.abs(e.position.x);if(t.position.x=t.position.x-i,typeof r.width=="string"){const s=Number(r.width.replace("px",""));r.width=`${s+i}px`}else r.width+=i;e.position.x=0}if(e.position.y<0){const i=Math.abs(e.position.y);if(t.position.y=t.position.y-i,typeof r.height=="string"){const s=Number(r.height.replace("px",""));r.height=`${s+i}px`}else r.height+=i;e.position.y=0}t.dimensions.width=Number(r.width.toString().replace("px","")),t.dimensions.height=Number(r.height.toString().replace("px","")),typeof t.style=="function"?t.style=i=>{const s=t.style;return{...s(i),...r}}:t.style={...t.style,...r}}}}function fr(e,t){var n,o;const r=e.filter(s=>s.type==="add"||s.type==="remove");for(const s of r)if(s.type==="add")t.findIndex(a=>a.id===s.item.id)===-1&&t.push(s.item);else if(s.type==="remove"){const l=t.findIndex(a=>a.id===s.id);l!==-1&&t.splice(l,1)}const i=t.map(s=>s.id);for(const s of t)for(const l of e)if(l.id===s.id)switch(l.type){case"select":s.selected=l.selected;break;case"position":if(Ft(s)&&(typeof l.position<"u"&&(s.position=l.position),typeof l.dragging<"u"&&(s.dragging=l.dragging),s.expandParent&&s.parentNode)){const a=t[i.indexOf(s.parentNode)];a&&Ft(a)&&Qn(s,a)}break;case"dimensions":if(Ft(s)&&(typeof l.dimensions<"u"&&(s.dimensions=l.dimensions),typeof l.updateStyle<"u"&&l.updateStyle&&(s.style={...s.style||{},width:`${(n=l.dimensions)==null?void 0:n.width}px`,height:`${(o=l.dimensions)==null?void 0:o.height}px`}),typeof l.resizing<"u"&&(s.resizing=l.resizing),s.expandParent&&s.parentNode)){const a=t[i.indexOf(s.parentNode)];a&&Ft(a)&&(!!a.dimensions.width&&!!a.dimensions.height?Qn(s,a):nt(()=>{Qn(s,a)}))}break}return t}function at(e,t){return{id:e,type:"select",selected:t}}function hr(e){return{item:e,type:"add"}}function gr(e){return{id:e,type:"remove"}}function pr(e,t,n,o,r){return{id:e,source:t,target:n,sourceHandle:o||null,targetHandle:r||null,type:"remove"}}function lt(e,t=new Set,n=!1){const o=[];for(const[r,i]of e){const s=t.has(r);!(i.selected===void 0&&!s)&&i.selected!==s&&(n&&(i.selected=s),o.push(at(i.id,s)))}return o}const vr=()=>{};function se(e){const t=new Set;let n=vr,o=()=>!1;const r=()=>t.size>0||o(),i=f=>{n=f},s=()=>{n=vr},l=f=>{o=f},a=()=>{o=()=>!1},u=f=>{t.delete(f)};return{on:f=>{t.add(f);const h=()=>u(f);return Wt(h),{off:h}},off:u,trigger:f=>{const h=[n];return r()?h.push(...t):e&&h.push(e),Promise.allSettled(h.map(k=>k(f)))},hasListeners:r,listeners:t,setEmitter:i,removeEmitter:s,setHasEmitListeners:l,removeHasEmitListeners:a}}function mr(e,t,n){let o=e;do{if(o&&o.matches(t))return!0;if(o===n)return!1;o=o.parentElement}while(o);return!1}function Td(e,t,n,o){var r,i;const s=new Map;for(const[l,a]of e)(a.selected||a.id===o)&&(!a.parentNode||!$i(a,e))&&(a.draggable||t&&typeof a.draggable>"u")&&e.get(l)&&s.set(l,{id:a.id,position:a.position||{x:0,y:0},distance:{x:n.x-((r=a.computedPosition)==null?void 0:r.x)||0,y:n.y-((i=a.computedPosition)==null?void 0:i.y)||0},from:{x:a.computedPosition.x,y:a.computedPosition.y},extent:a.extent,parentNode:a.parentNode,dimensions:{...a.dimensions},expandParent:a.expandParent});return Array.from(s.values())}function Jn({id:e,dragItems:t,findNode:n}){const o=[];for(const r of t){const i=n(r.id);i&&o.push(i)}return[e?o.find(r=>r.id===e):o[0],o]}function Ii(e){if(Array.isArray(e))switch(e.length){case 1:return[e[0],e[0],e[0],e[0]];case 2:return[e[0],e[1],e[0],e[1]];case 3:return[e[0],e[1],e[2],e[1]];case 4:return e;default:return[0,0,0,0]}return[e,e,e,e]}function Od(e,t,n){const[o,r,i,s]=typeof e!="string"?Ii(e.padding):[0,0,0,0];return n&&typeof n.computedPosition.x<"u"&&typeof n.computedPosition.y<"u"&&typeof n.dimensions.width<"u"&&typeof n.dimensions.height<"u"?[[n.computedPosition.x+s,n.computedPosition.y+o],[n.computedPosition.x+n.dimensions.width-r,n.computedPosition.y+n.dimensions.height-i]]:!1}function Dd(e,t,n,o){let r=e.extent||n;if((r==="parent"||!Array.isArray(r)&&r?.range==="parent")&&!e.expandParent)if(e.parentNode&&o&&e.dimensions.width&&e.dimensions.height){const i=Od(r,e,o);i&&(r=i)}else t(new Ae(Oe.NODE_EXTENT_INVALID,e.id)),r=n;else if(Array.isArray(r)){const i=o?.computedPosition.x||0,s=o?.computedPosition.y||0;r=[[r[0][0]+i,r[0][1]+s],[r[1][0]+i,r[1][1]+s]]}else if(r!=="parent"&&r?.range&&Array.isArray(r.range)){const[i,s,l,a]=Ii(r.padding),u=o?.computedPosition.x||0,c=o?.computedPosition.y||0;r=[[r.range[0][0]+u+a,r.range[0][1]+c+i],[r.range[1][0]+u-s,r.range[1][1]+c-l]]}return r==="parent"?[[Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY],[Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY]]:r}function zd({width:e,height:t},n){return[n[0],[n[1][0]-(e||0),n[1][1]-(t||0)]]}function To(e,t,n,o,r){const i=zd(e.dimensions,Dd(e,n,o,r)),s=_i(t,i);return{position:{x:s.x-(r?.computedPosition.x||0),y:s.y-(r?.computedPosition.y||0)},computedPosition:s}}function Dt(e,t,n=ue.Left,o=!1){const r=(t?.x??0)+e.computedPosition.x,i=(t?.y??0)+e.computedPosition.y,{width:s,height:l}=t??Rd(e);if(o)return{x:r+s/2,y:i+l/2};switch(t?.position??n){case ue.Top:return{x:r+s/2,y:i};case ue.Right:return{x:r+s,y:i+l/2};case ue.Bottom:return{x:r+s/2,y:i+l};case ue.Left:return{x:r,y:i+l/2}}}function yr(e,t){return e&&(t?e.find(n=>n.id===t):e[0])||null}function Ad({sourcePos:e,targetPos:t,sourceWidth:n,sourceHeight:o,targetWidth:r,targetHeight:i,width:s,height:l,viewport:a}){const u={x:Math.min(e.x,t.x),y:Math.min(e.y,t.y),x2:Math.max(e.x+n,t.x+r),y2:Math.max(e.y+o,t.y+i)};u.x===u.x2&&(u.x2+=1),u.y===u.y2&&(u.y2+=1);const c=ki({x:(0-a.x)/a.zoom,y:(0-a.y)/a.zoom,width:s/a.zoom,height:l/a.zoom}),d=Math.max(0,Math.min(c.x2,u.x2)-Math.max(c.x,u.x)),f=Math.max(0,Math.min(c.y2,u.y2)-Math.max(c.y,u.y));return Math.ceil(d*f)>0}function Ld(e,t,n=!1){const o=typeof e.zIndex=="number";let r=o?e.zIndex:0;const i=t(e.source),s=t(e.target);return!i||!s?0:(n&&(r=o?e.zIndex:Math.max(i.computedPosition.z||0,s.computedPosition.z||0)),r)}var Oe=(e=>(e.MISSING_STYLES="MISSING_STYLES",e.MISSING_VIEWPORT_DIMENSIONS="MISSING_VIEWPORT_DIMENSIONS",e.NODE_INVALID="NODE_INVALID",e.NODE_NOT_FOUND="NODE_NOT_FOUND",e.NODE_MISSING_PARENT="NODE_MISSING_PARENT",e.NODE_TYPE_MISSING="NODE_TYPE_MISSING",e.NODE_EXTENT_INVALID="NODE_EXTENT_INVALID",e.EDGE_INVALID="EDGE_INVALID",e.EDGE_NOT_FOUND="EDGE_NOT_FOUND",e.EDGE_SOURCE_MISSING="EDGE_SOURCE_MISSING",e.EDGE_TARGET_MISSING="EDGE_TARGET_MISSING",e.EDGE_TYPE_MISSING="EDGE_TYPE_MISSING",e.EDGE_SOURCE_TARGET_SAME="EDGE_SOURCE_TARGET_SAME",e.EDGE_SOURCE_TARGET_MISSING="EDGE_SOURCE_TARGET_MISSING",e.EDGE_ORPHANED="EDGE_ORPHANED",e.USEVUEFLOW_OPTIONS="USEVUEFLOW_OPTIONS",e))(Oe||{});const wr={MISSING_STYLES:()=>"It seems that you haven't loaded the necessary styles. Please import '@vue-flow/core/dist/style.css' to ensure that the graph is rendered correctly",MISSING_VIEWPORT_DIMENSIONS:()=>"The Vue Flow parent container needs a width and a height to render the graph",NODE_INVALID:e=>`Node is invalid
|
|
8
|
-
Node: ${e}`,NODE_NOT_FOUND:e=>`Node not found
|
|
9
|
-
Node: ${e}`,NODE_MISSING_PARENT:(e,t)=>`Node is missing a parent
|
|
10
|
-
Node: ${e}
|
|
11
|
-
Parent: ${t}`,NODE_TYPE_MISSING:e=>`Node type is missing
|
|
12
|
-
Type: ${e}`,NODE_EXTENT_INVALID:e=>`Only child nodes can use a parent extent
|
|
13
|
-
Node: ${e}`,EDGE_INVALID:e=>`An edge needs a source and a target
|
|
14
|
-
Edge: ${e}`,EDGE_SOURCE_MISSING:(e,t)=>`Edge source is missing
|
|
15
|
-
Edge: ${e}
|
|
16
|
-
Source: ${t}`,EDGE_TARGET_MISSING:(e,t)=>`Edge target is missing
|
|
17
|
-
Edge: ${e}
|
|
18
|
-
Target: ${t}`,EDGE_TYPE_MISSING:e=>`Edge type is missing
|
|
19
|
-
Type: ${e}`,EDGE_SOURCE_TARGET_SAME:(e,t,n)=>`Edge source and target are the same
|
|
20
|
-
Edge: ${e}
|
|
21
|
-
Source: ${t}
|
|
22
|
-
Target: ${n}`,EDGE_SOURCE_TARGET_MISSING:(e,t,n)=>`Edge source or target is missing
|
|
23
|
-
Edge: ${e}
|
|
24
|
-
Source: ${t}
|
|
25
|
-
Target: ${n}`,EDGE_ORPHANED:e=>`Edge was orphaned (suddenly missing source or target) and has been removed
|
|
26
|
-
Edge: ${e}`,EDGE_NOT_FOUND:e=>`Edge not found
|
|
27
|
-
Edge: ${e}`,USEVUEFLOW_OPTIONS:()=>"The options parameter is deprecated and will be removed in the next major version. Please use the id parameter instead"};class Ae extends Error{constructor(t,...n){var o;super((o=wr[t])==null?void 0:o.call(wr,...n)),this.name="VueFlowError",this.code=t,this.args=n}}function Oo(e){return"clientX"in e}function Bd(e){return"sourceEvent"in e}function qe(e,t){const n=Oo(e);let o,r;return n?(o=e.clientX,r=e.clientY):"touches"in e&&e.touches.length>0?(o=e.touches[0].clientX,r=e.touches[0].clientY):"changedTouches"in e&&e.changedTouches.length>0?(o=e.changedTouches[0].clientX,r=e.changedTouches[0].clientY):(o=0,r=0),{x:o-(t?.left??0),y:r-(t?.top??0)}}const zn=()=>{var e;return typeof navigator<"u"&&((e=navigator?.userAgent)==null?void 0:e.indexOf("Mac"))>=0};function Rd(e){var t,n;return{width:((t=e.dimensions)==null?void 0:t.width)??e.width??0,height:((n=e.dimensions)==null?void 0:n.height)??e.height??0}}function Hn(e,t=[1,1]){return{x:t[0]*Math.round(e.x/t[0]),y:t[1]*Math.round(e.y/t[1])}}const Vd=()=>!0;function eo(e){e?.classList.remove("valid","connecting","vue-flow__handle-valid","vue-flow__handle-connecting")}function Hd(e,t,n){const o=[],r={x:e.x-n,y:e.y-n,width:n*2,height:n*2};for(const i of t.values())Dn(r,On(i))>0&&o.push(i);return o}const Fd=250;function Gd(e,t,n,o){var r,i;let s=[],l=Number.POSITIVE_INFINITY;const a=Hd(e,n,t+Fd);for(const u of a){const c=[...((r=u.handleBounds)==null?void 0:r.source)??[],...((i=u.handleBounds)==null?void 0:i.target)??[]];for(const d of c){if(o.nodeId===d.nodeId&&o.type===d.type&&o.id===d.id)continue;const{x:f,y:h}=Dt(u,d,d.position,!0),k=Math.sqrt((f-e.x)**2+(h-e.y)**2);k>t||(k<l?(s=[{...d,x:f,y:h}],l=k):k===l&&s.push({...d,x:f,y:h}))}}if(!s.length)return null;if(s.length>1){const u=o.type==="source"?"target":"source";return s.find(c=>c.type===u)??s[0]}return s[0]}function _r(e,{handle:t,connectionMode:n,fromNodeId:o,fromHandleId:r,fromType:i,doc:s,lib:l,flowId:a,isValidConnection:u=Vd},c,d,f,h){const k=i==="target",N=t?s.querySelector(`.${l}-flow__handle[data-id="${a}-${t?.nodeId}-${t?.id}-${t?.type}"]`):null,{x:_,y:E}=qe(e),w=s.elementFromPoint(_,E),p=w?.classList.contains(`${l}-flow__handle`)?w:N,g={handleDomNode:p,isValid:!1,connection:null,toHandle:null};if(p){const L=Pi(void 0,p),V=p.getAttribute("data-nodeid"),G=p.getAttribute("data-handleid"),Y=p.classList.contains("connectable"),J=p.classList.contains("connectableend");if(!V||!L)return g;const D={source:k?V:o,sourceHandle:k?G:r,target:k?o:V,targetHandle:k?r:G};g.connection=D;const x=Y&&J&&(n===dt.Strict?k&&L==="source"||!k&&L==="target":V!==o||G!==r);g.isValid=x&&u(D,{nodes:d,edges:c,sourceNode:f(D.source),targetNode:f(D.target)}),g.toHandle=Ti(V,L,G,h,n,!0)}return g}function Pi(e,t){return e||(t?.classList.contains("target")?"target":t?.classList.contains("source")?"source":null)}function Yd(e,t){let n=null;return t?n="valid":e&&!t&&(n="invalid"),n}function jd(e,t){let n=null;return t?n=!0:e&&!t&&(n=!1),n}function Ti(e,t,n,o,r,i=!1){var s,l,a;const u=o.get(e);if(!u)return null;const c=r===dt.Strict?(s=u.handleBounds)==null?void 0:s[t]:[...((l=u.handleBounds)==null?void 0:l.source)??[],...((a=u.handleBounds)==null?void 0:a.target)??[]],d=(n?c?.find(f=>f.id===n):c?.[0])??null;return d&&i?{...d,...Dt(u,d,d.position,!0)}:d}const mo={[ue.Left]:ue.Right,[ue.Right]:ue.Left,[ue.Top]:ue.Bottom,[ue.Bottom]:ue.Top},Xd=["production","prod"];function on(e,...t){Oi()&&console.warn(`[Vue Flow]: ${e}`,...t)}function Oi(){return!Xd.includes("production")}function xr(e,t,n,o,r){const i=t.querySelectorAll(`.vue-flow__handle.${e}`);return i?.length?Array.from(i).map(s=>{const l=s.getBoundingClientRect();return{id:s.getAttribute("data-handleid"),type:e,nodeId:r,position:s.getAttribute("data-handlepos"),x:(l.left-n.left)/o,y:(l.top-n.top)/o,...Vn(s)}}):null}function yo(e,t,n,o,r,i=!1,s){r.value=!1,e.selected?(i||e.selected&&t)&&(o([e]),nt(()=>{s.blur()})):n([e])}function Te(e){return typeof I(e)<"u"}function Wd(e,t,n,o){if(!e||!e.source||!e.target)return n(new Ae(Oe.EDGE_INVALID,e?.id??"[ID UNKNOWN]")),!1;let r;return ft(e)?r=e:r={...e,id:Ei(e)},r=xi(r,void 0,o),Nd(r,t)?!1:r}function Ud(e,t,n,o,r){if(!t.source||!t.target)return r(new Ae(Oe.EDGE_INVALID,e.id)),!1;if(!n)return r(new Ae(Oe.EDGE_NOT_FOUND,e.id)),!1;const{id:i,...s}=e;return{...s,id:o?Ei(t):i,source:t.source,target:t.target,sourceHandle:t.sourceHandle,targetHandle:t.targetHandle}}function br(e,t,n){const o={},r=[];for(let i=0;i<e.length;++i){const s=e[i];if(!mt(s)){n(new Ae(Oe.NODE_INVALID,s?.id)||`[ID UNKNOWN|INDEX ${i}]`);continue}const l=Ed(s,t(s.id),s.parentNode);s.parentNode&&(o[s.parentNode]=!0),r[i]=l}for(const i of r){const s=t(i.parentNode)||r.find(l=>l.id===i.parentNode);i.parentNode&&!s&&n(new Ae(Oe.NODE_MISSING_PARENT,i.id,i.parentNode)),(i.parentNode||o[i.id])&&(o[i.id]&&(i.isParent=!0),s&&(s.isParent=!0))}return r}function Er(e,t,n,o,r,i){let s=r;const l=o.get(s)||new Map;o.set(s,l.set(n,t)),s=`${r}-${e}`;const a=o.get(s)||new Map;if(o.set(s,a.set(n,t)),i){s=`${r}-${e}-${i}`;const u=o.get(s)||new Map;o.set(s,u.set(n,t))}}function to(e,t,n){e.clear();for(const o of n){const{source:r,target:i,sourceHandle:s=null,targetHandle:l=null}=o,a={edgeId:o.id,source:r,target:i,sourceHandle:s,targetHandle:l},u=`${r}-${s}--${i}-${l}`,c=`${i}-${l}--${r}-${s}`;Er("source",a,c,e,r,s),Er("target",a,u,e,i,l)}}function kr(e,t){if(e.size!==t.size)return!1;for(const n of e)if(!t.has(n))return!1;return!0}function no(e,t,n,o,r,i,s,l){const a=[];for(const u of e){const c=ft(u)?u:Wd(u,l,r,i);if(!c)continue;const d=n(c.source),f=n(c.target);if(!d||!f){r(new Ae(Oe.EDGE_SOURCE_TARGET_MISSING,c.id,c.source,c.target));continue}if(!d){r(new Ae(Oe.EDGE_SOURCE_MISSING,c.id,c.source));continue}if(!f){r(new Ae(Oe.EDGE_TARGET_MISSING,c.id,c.target));continue}if(t&&!t(c,{edges:l,nodes:s,sourceNode:d,targetNode:f})){r(new Ae(Oe.EDGE_INVALID,c.id));continue}const h=o(c.id);a.push({...xi(c,h,i),sourceNode:d,targetNode:f})}return a}const Sr=Symbol("vueFlow"),Di=Symbol("nodeId"),zi=Symbol("nodeRef"),qd=Symbol("edgeId"),Zd=Symbol("edgeRef"),Fn=Symbol("slots");function Ai(e){const{vueFlowRef:t,snapToGrid:n,snapGrid:o,noDragClassName:r,nodeLookup:i,nodeExtent:s,nodeDragThreshold:l,viewport:a,autoPanOnNodeDrag:u,autoPanSpeed:c,nodesDraggable:d,panBy:f,findNode:h,multiSelectionActive:k,nodesSelectionActive:N,selectNodesOnDrag:_,removeSelectedElements:E,addSelectedNodes:w,updateNodePositions:p,emits:g}=Me(),{onStart:L,onDrag:V,onStop:G,onClick:Y,el:J,disabled:D,id:z,selectable:x,dragHandle:R}=e,v=ut(!1);let $=[],y,b=null,S={x:void 0,y:void 0},O={x:0,y:0},B=null,H=!1,W=!1,K=0,P=!1;const m=Jd(),C=({x:ie,y:ge})=>{S={x:ie,y:ge};let A=!1;if($=$.map(M=>{const F={x:ie-M.distance.x,y:ge-M.distance.y},{computedPosition:U}=To(M,n.value?Hn(F,o.value):F,g.error,s.value,M.parentNode?h(M.parentNode):void 0);return A=A||M.position.x!==U.x||M.position.y!==U.y,M.position=U,M}),W=W||A,!!A&&(p($,!0,!0),v.value=!0,B)){const[M,F]=Jn({id:z,dragItems:$,findNode:h});V({event:B,node:M,nodes:F})}},T=()=>{if(!b)return;const[ie,ge]=Mi(O,b,c.value);if(ie!==0||ge!==0){const A={x:(S.x??0)-ie/a.value.zoom,y:(S.y??0)-ge/a.value.zoom};f({x:ie,y:ge})&&C(A)}K=requestAnimationFrame(T)},j=(ie,ge)=>{H=!0;const A=h(z);!_.value&&!k.value&&A&&(A.selected||E()),A&&_e(x)&&_.value&&yo(A,k.value,w,E,N,!1,ge);const M=m(ie.sourceEvent);if(S=M,$=Td(i.value,d.value,M,z),$.length){const[F,U]=Jn({id:z,dragItems:$,findNode:h});L({event:ie.sourceEvent,node:F,nodes:U})}},Q=(ie,ge)=>{var A;ie.sourceEvent.type==="touchmove"&&ie.sourceEvent.touches.length>1||(W=!1,l.value===0&&j(ie,ge),S=m(ie.sourceEvent),b=((A=t.value)==null?void 0:A.getBoundingClientRect())||null,O=qe(ie.sourceEvent,b))},te=(ie,ge)=>{const A=m(ie.sourceEvent);if(!P&&H&&u.value&&(P=!0,T()),!H){const M=A.xSnapped-(S.x??0),F=A.ySnapped-(S.y??0);Math.sqrt(M*M+F*F)>l.value&&j(ie,ge)}(S.x!==A.xSnapped||S.y!==A.ySnapped)&&$.length&&H&&(B=ie.sourceEvent,O=qe(ie.sourceEvent,b),C(A))},ne=ie=>{let ge=!1;if(!H&&!v.value&&!k.value){const A=ie.sourceEvent,M=m(A),F=M.xSnapped-(S.x??0),U=M.ySnapped-(S.y??0),X=Math.sqrt(F*F+U*U);X!==0&&X<=l.value&&(Y?.(A),ge=!0)}if($.length&&!ge){W&&(p($,!1,!1),W=!1);const[A,M]=Jn({id:z,dragItems:$,findNode:h});G({event:ie.sourceEvent,node:A,nodes:M})}$=[],v.value=!1,P=!1,H=!1,S={x:void 0,y:void 0},cancelAnimationFrame(K)};return ye([()=>_e(D),J],([ie,ge],A,M)=>{if(ge){const F=Fe(ge);ie||(y=bu().on("start",U=>Q(U,ge)).on("drag",U=>te(U,ge)).on("end",U=>ne(U)).filter(U=>{const X=U.target,ae=_e(R);return!U.button&&(!r.value||!mr(X,`.${r.value}`,ge)&&(!ae||mr(X,ae,ge)))}),F.call(y)),M(()=>{F.on(".drag",null),y&&(y.on("start",null),y.on("drag",null),y.on("end",null))})}}),v}function Kd(){return{doubleClick:se(),click:se(),mouseEnter:se(),mouseMove:se(),mouseLeave:se(),contextMenu:se(),updateStart:se(),update:se(),updateEnd:se()}}function Qd(e,t){const n=Kd();return n.doubleClick.on(o=>{var r,i;t.edgeDoubleClick(o),(i=(r=e.events)==null?void 0:r.doubleClick)==null||i.call(r,o)}),n.click.on(o=>{var r,i;t.edgeClick(o),(i=(r=e.events)==null?void 0:r.click)==null||i.call(r,o)}),n.mouseEnter.on(o=>{var r,i;t.edgeMouseEnter(o),(i=(r=e.events)==null?void 0:r.mouseEnter)==null||i.call(r,o)}),n.mouseMove.on(o=>{var r,i;t.edgeMouseMove(o),(i=(r=e.events)==null?void 0:r.mouseMove)==null||i.call(r,o)}),n.mouseLeave.on(o=>{var r,i;t.edgeMouseLeave(o),(i=(r=e.events)==null?void 0:r.mouseLeave)==null||i.call(r,o)}),n.contextMenu.on(o=>{var r,i;t.edgeContextMenu(o),(i=(r=e.events)==null?void 0:r.contextMenu)==null||i.call(r,o)}),n.updateStart.on(o=>{var r,i;t.edgeUpdateStart(o),(i=(r=e.events)==null?void 0:r.updateStart)==null||i.call(r,o)}),n.update.on(o=>{var r,i;t.edgeUpdate(o),(i=(r=e.events)==null?void 0:r.update)==null||i.call(r,o)}),n.updateEnd.on(o=>{var r,i;t.edgeUpdateEnd(o),(i=(r=e.events)==null?void 0:r.updateEnd)==null||i.call(r,o)}),Object.entries(n).reduce((o,[r,i])=>(o.emit[r]=i.trigger,o.on[r]=i.on,o),{emit:{},on:{}})}function Jd(){const{viewport:e,snapGrid:t,snapToGrid:n,vueFlowRef:o}=Me();return r=>{var i;const s=((i=o.value)==null?void 0:i.getBoundingClientRect())??{left:0,top:0},l=Bd(r)?r.sourceEvent:r,{x:a,y:u}=qe(l,s),c=Jt({x:a,y:u},e.value),{x:d,y:f}=n.value?Hn(c,t.value):c;return{xSnapped:d,ySnapped:f,...c}}}function dn(){return!0}function Li({handleId:e,nodeId:t,type:n,isValidConnection:o,edgeUpdaterType:r,onEdgeUpdate:i,onEdgeUpdateEnd:s}){const{id:l,vueFlowRef:a,connectionMode:u,connectionRadius:c,connectOnClick:d,connectionClickStartHandle:f,nodesConnectable:h,autoPanOnConnect:k,autoPanSpeed:N,findNode:_,panBy:E,startConnection:w,updateConnection:p,endConnection:g,emits:L,viewport:V,edges:G,nodes:Y,isValidConnection:J,nodeLookup:D}=Me();let z=null,x=!1,R=null;function v(y){var b;const S=_e(n)==="target",O=Oo(y),B=lr(y.target),H=y.currentTarget;if(H&&(O&&y.button===0||!O)){let W=function(ce){A=qe(ce,ne),C=Gd(Jt(A,V.value,!1,[1,1]),c.value,D.value,U),M||(F(),M=!0);const pe=_r(ce,{handle:C,connectionMode:u.value,fromNodeId:_e(t),fromHandleId:_e(e),fromType:S?"target":"source",isValidConnection:m,doc:B,lib:"vue",flowId:l,nodeLookup:D.value},G.value,Y.value,_,D.value);R=pe.handleDomNode,z=pe.connection,x=jd(!!C,pe.isValid);const we={...de,isValid:x,to:pe.toHandle&&x?Qt({x:pe.toHandle.x,y:pe.toHandle.y},V.value):A,toHandle:pe.toHandle,toPosition:x&&pe.toHandle?pe.toHandle.position:mo[U.position],toNode:pe.toHandle?D.value.get(pe.toHandle.nodeId):null};if(x&&C&&de?.toHandle&&we.toHandle&&de.toHandle.type===we.toHandle.type&&de.toHandle.nodeId===we.toHandle.nodeId&&de.toHandle.id===we.toHandle.id&&de.to.x===we.to.x&&de.to.y===we.to.y)return;const Ee=C??pe.toHandle;if(p(Ee&&x?Qt({x:Ee.x,y:Ee.y},V.value):A,Ee,Yd(!!Ee,x)),de=we,!C&&!x&&!R)return eo(ge);z&&z.source!==z.target&&R&&(eo(ge),ge=R,R.classList.add("connecting","vue-flow__handle-connecting"),R.classList.toggle("valid",!!x),R.classList.toggle("vue-flow__handle-valid",!!x))},K=function(ce){"touches"in ce&&ce.touches.length>0||((C||R)&&z&&x&&(i?i(ce,z):L.connect(z)),L.connectEnd(ce),r&&s?.(ce),eo(ge),cancelAnimationFrame(T),g(ce),M=!1,x=!1,z=null,R=null,B.removeEventListener("mousemove",W),B.removeEventListener("mouseup",K),B.removeEventListener("touchmove",W),B.removeEventListener("touchend",K))};const P=_(_e(t));let m=_e(o)||J.value||dn;!m&&P&&(m=(S?P.isValidSourcePos:P.isValidTargetPos)||dn);let C,T=0;const{x:j,y:Q}=qe(y),te=Pi(_e(r),H),ne=(b=a.value)==null?void 0:b.getBoundingClientRect();if(!ne||!te)return;const ie=Ti(_e(t),te,_e(e),D.value,u.value);if(!ie)return;let ge,A=qe(y,ne),M=!1;const F=()=>{if(!k.value)return;const[ce,pe]=Mi(A,ne,N.value);E({x:ce,y:pe}),T=requestAnimationFrame(F)},U={...ie,nodeId:_e(t),type:te,position:ie.position},X=D.value.get(_e(t)),le={inProgress:!0,isValid:null,from:Dt(X,U,ue.Left,!0),fromHandle:U,fromPosition:U.position,fromNode:X,to:A,toHandle:null,toPosition:mo[U.position],toNode:null};w({nodeId:_e(t),id:_e(e),type:te,position:H?.getAttribute("data-handlepos")||ue.Top,...A},{x:j-ne.left,y:Q-ne.top}),L.connectStart({event:y,nodeId:_e(t),handleId:_e(e),handleType:te});let de=le;B.addEventListener("mousemove",W),B.addEventListener("mouseup",K),B.addEventListener("touchmove",W),B.addEventListener("touchend",K)}}function $(y){var b,S;if(!d.value)return;const O=_e(n)==="target";if(!f.value){L.clickConnectStart({event:y,nodeId:_e(t),handleId:_e(e)}),w({nodeId:_e(t),type:_e(n),id:_e(e),position:ue.Top,...qe(y)},void 0,!0);return}let B=_e(o)||J.value||dn;const H=_(_e(t));if(!B&&H&&(B=(O?H.isValidSourcePos:H.isValidTargetPos)||dn),H&&(typeof H.connectable>"u"?h.value:H.connectable)===!1)return;const W=lr(y.target),K=_r(y,{handle:{nodeId:_e(t),id:_e(e),type:_e(n),position:ue.Top,...qe(y)},connectionMode:u.value,fromNodeId:f.value.nodeId,fromHandleId:f.value.id??null,fromType:f.value.type,isValidConnection:B,doc:W,lib:"vue",flowId:l,nodeLookup:D.value},G.value,Y.value,_,D.value),P=((b=K.connection)==null?void 0:b.source)===((S=K.connection)==null?void 0:S.target);K.isValid&&K.connection&&!P&&L.connect(K.connection),L.clickConnectEnd(y),g(y,!0)}return{handlePointerDown:v,handleClick:$}}function ef(){return At(Di,"")}function Bi(e){const t=e??ef()??"",n=At(zi,ve(null)),{findNode:o,edges:r,emits:i}=Me(),s=o(t);return s||i.error(new Ae(Oe.NODE_NOT_FOUND,t)),{id:t,nodeEl:n,node:s,parentNode:re(()=>o(s.parentNode)),connectedEdges:re(()=>Ci([s],r.value))}}function tf(){return{doubleClick:se(),click:se(),mouseEnter:se(),mouseMove:se(),mouseLeave:se(),contextMenu:se(),dragStart:se(),drag:se(),dragStop:se()}}function nf(e,t){const n=tf();return n.doubleClick.on(o=>{var r,i;t.nodeDoubleClick(o),(i=(r=e.events)==null?void 0:r.doubleClick)==null||i.call(r,o)}),n.click.on(o=>{var r,i;t.nodeClick(o),(i=(r=e.events)==null?void 0:r.click)==null||i.call(r,o)}),n.mouseEnter.on(o=>{var r,i;t.nodeMouseEnter(o),(i=(r=e.events)==null?void 0:r.mouseEnter)==null||i.call(r,o)}),n.mouseMove.on(o=>{var r,i;t.nodeMouseMove(o),(i=(r=e.events)==null?void 0:r.mouseMove)==null||i.call(r,o)}),n.mouseLeave.on(o=>{var r,i;t.nodeMouseLeave(o),(i=(r=e.events)==null?void 0:r.mouseLeave)==null||i.call(r,o)}),n.contextMenu.on(o=>{var r,i;t.nodeContextMenu(o),(i=(r=e.events)==null?void 0:r.contextMenu)==null||i.call(r,o)}),n.dragStart.on(o=>{var r,i;t.nodeDragStart(o),(i=(r=e.events)==null?void 0:r.dragStart)==null||i.call(r,o)}),n.drag.on(o=>{var r,i;t.nodeDrag(o),(i=(r=e.events)==null?void 0:r.drag)==null||i.call(r,o)}),n.dragStop.on(o=>{var r,i;t.nodeDragStop(o),(i=(r=e.events)==null?void 0:r.dragStop)==null||i.call(r,o)}),Object.entries(n).reduce((o,[r,i])=>(o.emit[r]=i.trigger,o.on[r]=i.on,o),{emit:{},on:{}})}function Ri(){const{getSelectedNodes:e,nodeExtent:t,updateNodePositions:n,findNode:o,snapGrid:r,snapToGrid:i,nodesDraggable:s,emits:l}=Me();return(a,u=!1)=>{const c=i.value?r.value[0]:5,d=i.value?r.value[1]:5,f=u?4:1,h=a.x*c*f,k=a.y*d*f,N=[];for(const _ of e.value)if(_.draggable||s&&typeof _.draggable>"u"){const E={x:_.computedPosition.x+h,y:_.computedPosition.y+k},{position:w}=To(_,E,l.error,t.value,_.parentNode?o(_.parentNode):void 0);N.push({id:_.id,position:w,from:_.position,distance:{x:a.x,y:a.y},dimensions:_.dimensions})}n(N,!0,!1)}}const fn=.1,of=e=>((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2;function st(){return on("Viewport not initialized yet."),Promise.resolve(!1)}const rf={zoomIn:st,zoomOut:st,zoomTo:st,fitView:st,setCenter:st,fitBounds:st,project:e=>e,screenToFlowCoordinate:e=>e,flowToScreenCoordinate:e=>e,setViewport:st,setTransform:st,getViewport:()=>({x:0,y:0,zoom:1}),getTransform:()=>({x:0,y:0,zoom:1}),viewportInitialized:!1};function sf(e){function t(o,r){return new Promise(i=>{e.d3Selection&&e.d3Zoom?e.d3Zoom.interpolate(r?.interpolate==="linear"?Yt:yn).scaleBy(oo(e.d3Selection,r?.duration,r?.ease,()=>{i(!0)}),o):i(!1)})}function n(o,r,i,s){return new Promise(l=>{var a;const{x:u,y:c}=_i({x:-o,y:-r},e.translateExtent),d=Ot.translate(-u,-c).scale(i);e.d3Selection&&e.d3Zoom?(a=e.d3Zoom)==null||a.interpolate(s?.interpolate==="linear"?Yt:yn).transform(oo(e.d3Selection,s?.duration,s?.ease,()=>{l(!0)}),d):l(!1)})}return re(()=>e.d3Zoom&&e.d3Selection&&e.dimensions.width&&e.dimensions.height?{viewportInitialized:!0,zoomIn:r=>t(1.2,r),zoomOut:r=>t(1/1.2,r),zoomTo:(r,i)=>new Promise(s=>{e.d3Selection&&e.d3Zoom?e.d3Zoom.interpolate(i?.interpolate==="linear"?Yt:yn).scaleTo(oo(e.d3Selection,i?.duration,i?.ease,()=>{s(!0)}),r):s(!1)}),setViewport:(r,i)=>n(r.x,r.y,r.zoom,i),setTransform:(r,i)=>n(r.x,r.y,r.zoom,i),getViewport:()=>({x:e.viewport.x,y:e.viewport.y,zoom:e.viewport.zoom}),getTransform:()=>({x:e.viewport.x,y:e.viewport.y,zoom:e.viewport.zoom}),fitView:(r={padding:fn,includeHiddenNodes:!1,duration:0})=>{var i,s;const l=[];for(const f of e.nodes)f.dimensions.width&&f.dimensions.height&&(r?.includeHiddenNodes||!f.hidden)&&(!((i=r.nodes)!=null&&i.length)||(s=r.nodes)!=null&&s.length&&r.nodes.includes(f.id))&&l.push(f);if(!l.length)return Promise.resolve(!1);const a=Si(l),{x:u,y:c,zoom:d}=ur(a,e.dimensions.width,e.dimensions.height,r.minZoom??e.minZoom,r.maxZoom??e.maxZoom,r.padding??fn);return n(u,c,d,r)},setCenter:(r,i,s)=>{const l=typeof s?.zoom<"u"?s.zoom:e.maxZoom,a=e.dimensions.width/2-r*l,u=e.dimensions.height/2-i*l;return n(a,u,l,s)},fitBounds:(r,i={padding:fn})=>{const{x:s,y:l,zoom:a}=ur(r,e.dimensions.width,e.dimensions.height,e.minZoom,e.maxZoom,i.padding??fn);return n(s,l,a,i)},project:r=>Jt(r,e.viewport,e.snapToGrid,e.snapGrid),screenToFlowCoordinate:r=>{if(e.vueFlowRef){const{x:i,y:s}=e.vueFlowRef.getBoundingClientRect(),l={x:r.x-i,y:r.y-s};return Jt(l,e.viewport,e.snapToGrid,e.snapGrid)}return{x:0,y:0}},flowToScreenCoordinate:r=>{if(e.vueFlowRef){const{x:i,y:s}=e.vueFlowRef.getBoundingClientRect(),l={x:r.x+i,y:r.y+s};return Qt(l,e.viewport)}return{x:0,y:0}}}:rf)}function oo(e,t=0,n=of,o=()=>{}){const r=typeof t=="number"&&t>0;return r||o(),r?e.transition().duration(t).ease(n).on("end",o):e}function af(e,t,n){const o=Dr(!0);return o.run(()=>{const r=()=>{o.run(()=>{let N,_,E=!!(n.nodes.value.length||n.edges.value.length);N=xt([e.modelValue,()=>{var w,p;return(p=(w=e.modelValue)==null?void 0:w.value)==null?void 0:p.length}],([w])=>{w&&Array.isArray(w)&&(_?.pause(),n.setElements(w),!_&&!E&&w.length?E=!0:_?.resume())}),_=xt([n.nodes,n.edges,()=>n.edges.value.length,()=>n.nodes.value.length],([w,p])=>{var g;(g=e.modelValue)!=null&&g.value&&Array.isArray(e.modelValue.value)&&(N?.pause(),e.modelValue.value=[...w,...p],nt(()=>{N?.resume()}))},{immediate:E}),pn(()=>{N?.stop(),_?.stop()})})},i=()=>{o.run(()=>{let N,_,E=!!n.nodes.value.length;N=xt([e.nodes,()=>{var w,p;return(p=(w=e.nodes)==null?void 0:w.value)==null?void 0:p.length}],([w])=>{w&&Array.isArray(w)&&(_?.pause(),n.setNodes(w),!_&&!E&&w.length?E=!0:_?.resume())}),_=xt([n.nodes,()=>n.nodes.value.length],([w])=>{var p;(p=e.nodes)!=null&&p.value&&Array.isArray(e.nodes.value)&&(N?.pause(),e.nodes.value=[...w],nt(()=>{N?.resume()}))},{immediate:E}),pn(()=>{N?.stop(),_?.stop()})})},s=()=>{o.run(()=>{let N,_,E=!!n.edges.value.length;N=xt([e.edges,()=>{var w,p;return(p=(w=e.edges)==null?void 0:w.value)==null?void 0:p.length}],([w])=>{w&&Array.isArray(w)&&(_?.pause(),n.setEdges(w),!_&&!E&&w.length?E=!0:_?.resume())}),_=xt([n.edges,()=>n.edges.value.length],([w])=>{var p;(p=e.edges)!=null&&p.value&&Array.isArray(e.edges.value)&&(N?.pause(),e.edges.value=[...w],nt(()=>{N?.resume()}))},{immediate:E}),pn(()=>{N?.stop(),_?.stop()})})},l=()=>{o.run(()=>{ye(()=>t.maxZoom,()=>{t.maxZoom&&Te(t.maxZoom)&&n.setMaxZoom(t.maxZoom)},{immediate:!0})})},a=()=>{o.run(()=>{ye(()=>t.minZoom,()=>{t.minZoom&&Te(t.minZoom)&&n.setMinZoom(t.minZoom)},{immediate:!0})})},u=()=>{o.run(()=>{ye(()=>t.translateExtent,()=>{t.translateExtent&&Te(t.translateExtent)&&n.setTranslateExtent(t.translateExtent)},{immediate:!0})})},c=()=>{o.run(()=>{ye(()=>t.nodeExtent,()=>{t.nodeExtent&&Te(t.nodeExtent)&&n.setNodeExtent(t.nodeExtent)},{immediate:!0})})},d=()=>{o.run(()=>{ye(()=>t.applyDefault,()=>{Te(t.applyDefault)&&(n.applyDefault.value=t.applyDefault)},{immediate:!0})})},f=()=>{o.run(()=>{const N=async _=>{let E=_;typeof t.autoConnect=="function"&&(E=await t.autoConnect(_)),E!==!1&&n.addEdges([E])};ye(()=>t.autoConnect,()=>{Te(t.autoConnect)&&(n.autoConnect.value=t.autoConnect)},{immediate:!0}),ye(n.autoConnect,(_,E,w)=>{_?n.onConnect(N):n.hooks.value.connect.off(N),w(()=>{n.hooks.value.connect.off(N)})},{immediate:!0})})},h=()=>{const N=["id","modelValue","translateExtent","nodeExtent","edges","nodes","maxZoom","minZoom","applyDefault","autoConnect"];for(const _ of Object.keys(t)){const E=_;if(!N.includes(E)){const w=Ce(()=>t[E]),p=n[E];bo(p)&&o.run(()=>{ye(w,g=>{Te(g)&&(p.value=g)},{immediate:!0})})}}};r(),i(),s(),a(),l(),u(),c(),d(),f(),h()}),()=>o.stop()}function lf(){return{edgesChange:se(),nodesChange:se(),nodeDoubleClick:se(),nodeClick:se(),nodeMouseEnter:se(),nodeMouseMove:se(),nodeMouseLeave:se(),nodeContextMenu:se(),nodeDragStart:se(),nodeDrag:se(),nodeDragStop:se(),nodesInitialized:se(),miniMapNodeClick:se(),miniMapNodeDoubleClick:se(),miniMapNodeMouseEnter:se(),miniMapNodeMouseMove:se(),miniMapNodeMouseLeave:se(),connect:se(),connectStart:se(),connectEnd:se(),clickConnectStart:se(),clickConnectEnd:se(),paneReady:se(),init:se(),move:se(),moveStart:se(),moveEnd:se(),selectionDragStart:se(),selectionDrag:se(),selectionDragStop:se(),selectionContextMenu:se(),selectionStart:se(),selectionEnd:se(),viewportChangeStart:se(),viewportChange:se(),viewportChangeEnd:se(),paneScroll:se(),paneClick:se(),paneContextMenu:se(),paneMouseEnter:se(),paneMouseMove:se(),paneMouseLeave:se(),edgeContextMenu:se(),edgeMouseEnter:se(),edgeMouseMove:se(),edgeMouseLeave:se(),edgeDoubleClick:se(),edgeClick:se(),edgeUpdateStart:se(),edgeUpdate:se(),edgeUpdateEnd:se(),updateNodeInternals:se(),error:se(e=>on(e.message))}}function uf(e,t){const n=Lt();rs(()=>{for(const[r,i]of Object.entries(t.value)){const s=l=>{e(r,l)};i.setEmitter(s),Wt(i.removeEmitter),i.setHasEmitListeners(()=>o(r)),Wt(i.removeHasEmitListeners)}});function o(r){var i;const s=cf(r);return!!((i=n?.vnode.props)==null?void 0:i[s])}}function cf(e){const[t,...n]=e.split(":");return`on${t.replace(/(?:^|-)(\w)/g,(r,i)=>i.toUpperCase())}${n.length?`:${n.join(":")}`:""}`}function Vi(){return{vueFlowRef:null,viewportRef:null,nodes:[],edges:[],connectionLookup:new Map,nodeTypes:{},edgeTypes:{},initialized:!1,dimensions:{width:0,height:0},viewport:{x:0,y:0,zoom:1},d3Zoom:null,d3Selection:null,d3ZoomHandler:null,minZoom:.5,maxZoom:2,translateExtent:[[Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY],[Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY]],nodeExtent:[[Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY],[Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY]],selectionMode:Po.Full,paneDragging:!1,preventScrolling:!0,zoomOnScroll:!0,zoomOnPinch:!0,zoomOnDoubleClick:!0,panOnScroll:!1,panOnScrollSpeed:.5,panOnScrollMode:jt.Free,paneClickDistance:0,panOnDrag:!0,edgeUpdaterRadius:10,onlyRenderVisibleElements:!1,defaultViewport:{x:0,y:0,zoom:1},nodesSelectionActive:!1,userSelectionActive:!1,userSelectionRect:null,defaultMarkerColor:"#b1b1b7",connectionLineStyle:{},connectionLineType:null,connectionLineOptions:{type:ht.Bezier,style:{}},connectionMode:dt.Loose,connectionStartHandle:null,connectionEndHandle:null,connectionClickStartHandle:null,connectionPosition:{x:Number.NaN,y:Number.NaN},connectionRadius:20,connectOnClick:!0,connectionStatus:null,isValidConnection:null,snapGrid:[15,15],snapToGrid:!1,edgesUpdatable:!1,edgesFocusable:!0,nodesFocusable:!0,nodesConnectable:!0,nodesDraggable:!0,nodeDragThreshold:1,elementsSelectable:!0,selectNodesOnDrag:!0,multiSelectionActive:!1,selectionKeyCode:"Shift",multiSelectionKeyCode:zn()?"Meta":"Control",zoomActivationKeyCode:zn()?"Meta":"Control",deleteKeyCode:"Backspace",panActivationKeyCode:"Space",hooks:lf(),applyDefault:!0,autoConnect:!1,fitViewOnInit:!1,fitViewOnInitDone:!1,noDragClassName:"nodrag",noWheelClassName:"nowheel",noPanClassName:"nopan",defaultEdgeOptions:void 0,elevateEdgesOnSelect:!1,elevateNodesOnSelect:!0,autoPanOnNodeDrag:!0,autoPanOnConnect:!0,autoPanSpeed:15,disableKeyboardA11y:!1,ariaLiveMessage:""}}const df=["id","vueFlowRef","viewportRef","initialized","modelValue","nodes","edges","maxZoom","minZoom","translateExtent","hooks","defaultEdgeOptions"];function ff(e,t,n){const o=sf(e),r=A=>{const M=A??[];e.hooks.updateNodeInternals.trigger(M)},i=A=>Sd(A,e.nodes,e.edges),s=A=>kd(A,e.nodes,e.edges),l=A=>Ci(A,e.edges),a=({id:A,type:M,nodeId:F})=>{var U;const X=A?`-${M}-${A}`:`-${M}`;return Array.from(((U=e.connectionLookup.get(`${F}${X}`))==null?void 0:U.values())??[])},u=A=>{if(A)return t.value.get(A)},c=A=>{if(A)return n.value.get(A)},d=(A,M,F)=>{var U,X;const ae=[];for(const le of A){const de={id:le.id,type:"position",dragging:F,from:le.from};if(M&&(de.position=le.position,le.parentNode)){const ce=u(le.parentNode);de.position={x:de.position.x-(((U=ce?.computedPosition)==null?void 0:U.x)??0),y:de.position.y-(((X=ce?.computedPosition)==null?void 0:X.y)??0)}}ae.push(de)}ae?.length&&e.hooks.nodesChange.trigger(ae)},f=A=>{if(!e.vueFlowRef)return;const M=e.vueFlowRef.querySelector(".vue-flow__transformationpane");if(!M)return;const F=window.getComputedStyle(M),{m22:U}=new window.DOMMatrixReadOnly(F.transform),X=[];for(const ae of A){const le=ae,de=u(le.id);if(de){const ce=Vn(le.nodeElement);if(!!(ce.width&&ce.height&&(de.dimensions.width!==ce.width||de.dimensions.height!==ce.height||le.forceUpdate))){const we=le.nodeElement.getBoundingClientRect();de.dimensions=ce,de.handleBounds.source=xr("source",le.nodeElement,we,U,de.id),de.handleBounds.target=xr("target",le.nodeElement,we,U,de.id),X.push({id:de.id,type:"dimensions",dimensions:ce})}}}!e.fitViewOnInitDone&&e.fitViewOnInit&&o.value.fitView().then(()=>{e.fitViewOnInitDone=!0}),X.length&&e.hooks.nodesChange.trigger(X)},h=(A,M)=>{const F=new Set,U=new Set;for(const le of A)mt(le)?F.add(le.id):ft(le)&&U.add(le.id);const X=lt(t.value,F,!0),ae=lt(n.value,U);if(e.multiSelectionActive){for(const le of F)X.push(at(le,M));for(const le of U)ae.push(at(le,M))}X.length&&e.hooks.nodesChange.trigger(X),ae.length&&e.hooks.edgesChange.trigger(ae)},k=A=>{if(e.multiSelectionActive){const M=A.map(F=>at(F.id,!0));e.hooks.nodesChange.trigger(M);return}e.hooks.nodesChange.trigger(lt(t.value,new Set(A.map(M=>M.id)),!0)),e.hooks.edgesChange.trigger(lt(n.value))},N=A=>{if(e.multiSelectionActive){const M=A.map(F=>at(F.id,!0));e.hooks.edgesChange.trigger(M);return}e.hooks.edgesChange.trigger(lt(n.value,new Set(A.map(M=>M.id)))),e.hooks.nodesChange.trigger(lt(t.value,new Set,!0))},_=A=>{h(A,!0)},E=A=>{const F=(A||e.nodes).map(U=>(U.selected=!1,at(U.id,!1)));e.hooks.nodesChange.trigger(F)},w=A=>{const F=(A||e.edges).map(U=>(U.selected=!1,at(U.id,!1)));e.hooks.edgesChange.trigger(F)},p=A=>{if(!A||!A.length)return h([],!1);const M=A.reduce((F,U)=>{const X=at(U.id,!1);return mt(U)?F.nodes.push(X):F.edges.push(X),F},{nodes:[],edges:[]});M.nodes.length&&e.hooks.nodesChange.trigger(M.nodes),M.edges.length&&e.hooks.edgesChange.trigger(M.edges)},g=A=>{var M;(M=e.d3Zoom)==null||M.scaleExtent([A,e.maxZoom]),e.minZoom=A},L=A=>{var M;(M=e.d3Zoom)==null||M.scaleExtent([e.minZoom,A]),e.maxZoom=A},V=A=>{var M;(M=e.d3Zoom)==null||M.translateExtent(A),e.translateExtent=A},G=A=>{e.nodeExtent=A,r()},Y=A=>{var M;(M=e.d3Zoom)==null||M.clickDistance(A)},J=A=>{e.nodesDraggable=A,e.nodesConnectable=A,e.elementsSelectable=A},D=A=>{const M=A instanceof Function?A(e.nodes):A;!e.initialized&&!M.length||(e.nodes=br(M,u,e.hooks.error.trigger))},z=A=>{const M=A instanceof Function?A(e.edges):A;if(!e.initialized&&!M.length)return;const F=no(M,e.isValidConnection,u,c,e.hooks.error.trigger,e.defaultEdgeOptions,e.nodes,e.edges);to(e.connectionLookup,n.value,F),e.edges=F},x=A=>{const M=A instanceof Function?A([...e.nodes,...e.edges]):A;!e.initialized&&!M.length||(D(M.filter(mt)),z(M.filter(ft)))},R=A=>{let M=A instanceof Function?A(e.nodes):A;M=Array.isArray(M)?M:[M];const F=br(M,u,e.hooks.error.trigger),U=[];for(const X of F)U.push(hr(X));U.length&&e.hooks.nodesChange.trigger(U)},v=A=>{let M=A instanceof Function?A(e.edges):A;M=Array.isArray(M)?M:[M];const F=no(M,e.isValidConnection,u,c,e.hooks.error.trigger,e.defaultEdgeOptions,e.nodes,e.edges),U=[];for(const X of F)U.push(hr(X));U.length&&e.hooks.edgesChange.trigger(U)},$=(A,M=!0,F=!1)=>{const U=A instanceof Function?A(e.nodes):A,X=Array.isArray(U)?U:[U],ae=[],le=[];function de(pe){const we=l(pe);for(const Ee of we)(!Te(Ee.deletable)||Ee.deletable)&&le.push(pr(Ee.id,Ee.source,Ee.target,Ee.sourceHandle,Ee.targetHandle))}function ce(pe){const we=[];for(const Ee of e.nodes)Ee.parentNode===pe&&we.push(Ee);if(we.length){for(const Ee of we)ae.push(gr(Ee.id));M&&de(we);for(const Ee of we)ce(Ee.id)}}for(const pe of X){const we=typeof pe=="string"?u(pe):pe;we&&(Te(we.deletable)&&!we.deletable||(ae.push(gr(we.id)),M&&de([we]),F&&ce(we.id)))}le.length&&e.hooks.edgesChange.trigger(le),ae.length&&e.hooks.nodesChange.trigger(ae)},y=A=>{const M=A instanceof Function?A(e.edges):A,F=Array.isArray(M)?M:[M],U=[];for(const X of F){const ae=typeof X=="string"?c(X):X;ae&&(Te(ae.deletable)&&!ae.deletable||U.push(pr(typeof X=="string"?X:X.id,ae.source,ae.target,ae.sourceHandle,ae.targetHandle)))}e.hooks.edgesChange.trigger(U)},b=(A,M,F=!0)=>{const U=c(A.id);if(!U)return!1;const X=e.edges.indexOf(U),ae=Ud(A,M,U,F,e.hooks.error.trigger);if(ae){const[le]=no([ae],e.isValidConnection,u,c,e.hooks.error.trigger,e.defaultEdgeOptions,e.nodes,e.edges);return e.edges=e.edges.map((de,ce)=>ce===X?le:de),to(e.connectionLookup,n.value,[le]),le}return!1},S=(A,M,F={replace:!1})=>{const U=c(A);if(!U)return;const X=typeof M=="function"?M(U):M;U.data=F.replace?X:{...U.data,...X}},O=A=>fr(A,e.nodes),B=A=>{const M=fr(A,e.edges);return to(e.connectionLookup,n.value,M),M},H=(A,M,F={replace:!1})=>{const U=u(A);if(!U)return;const X=typeof M=="function"?M(U):M;F.replace?e.nodes.splice(e.nodes.indexOf(U),1,X):Object.assign(U,X)},W=(A,M,F={replace:!1})=>{const U=u(A);if(!U)return;const X=typeof M=="function"?M(U):M;U.data=F.replace?X:{...U.data,...X}},K=(A,M,F=!1)=>{F?e.connectionClickStartHandle=A:e.connectionStartHandle=A,e.connectionEndHandle=null,e.connectionStatus=null,M&&(e.connectionPosition=M)},P=(A,M=null,F=null)=>{e.connectionStartHandle&&(e.connectionPosition=A,e.connectionEndHandle=M,e.connectionStatus=F)},m=(A,M)=>{e.connectionPosition={x:Number.NaN,y:Number.NaN},e.connectionEndHandle=null,e.connectionStatus=null,M?e.connectionClickStartHandle=null:e.connectionStartHandle=null},C=A=>{const M=bd(A),F=M?null:Ft(A)?A:u(A.id);return!M&&!F?[null,null,M]:[M?A:On(F),F,M]},T=(A,M=!0,F=e.nodes)=>{const[U,X,ae]=C(A);if(!U)return[];const le=[];for(const de of F||e.nodes){if(!ae&&(de.id===X.id||!de.computedPosition))continue;const ce=On(de),pe=Dn(ce,U);(M&&pe>0||pe>=ce.width*ce.height||pe>=Number(U.width)*Number(U.height))&&le.push(de)}return le},j=(A,M,F=!0)=>{const[U]=C(A);if(!U)return!1;const X=Dn(U,M);return F&&X>0||X>=Number(U.width)*Number(U.height)},Q=A=>{const{viewport:M,dimensions:F,d3Zoom:U,d3Selection:X,translateExtent:ae}=e;if(!U||!X||!A.x&&!A.y)return!1;const le=Ot.translate(M.x+A.x,M.y+A.y).scale(M.zoom),de=[[0,0],[F.width,F.height]],ce=U.constrain()(le,de,ae),pe=e.viewport.x!==ce.x||e.viewport.y!==ce.y||e.viewport.zoom!==ce.k;return U.transform(X,ce),pe},te=A=>{const M=A instanceof Function?A(e):A,F=["d3Zoom","d3Selection","d3ZoomHandler","viewportRef","vueFlowRef","dimensions","hooks"];Te(M.defaultEdgeOptions)&&(e.defaultEdgeOptions=M.defaultEdgeOptions);const U=M.modelValue||M.nodes||M.edges?[]:void 0;U&&(M.modelValue&&U.push(...M.modelValue),M.nodes&&U.push(...M.nodes),M.edges&&U.push(...M.edges),x(U));const X=()=>{Te(M.maxZoom)&&L(M.maxZoom),Te(M.minZoom)&&g(M.minZoom),Te(M.translateExtent)&&V(M.translateExtent)};for(const ae of Object.keys(M)){const le=ae,de=M[le];![...df,...F].includes(le)&&Te(de)&&(e[le]=de)}so(()=>e.d3Zoom).not.toBeNull().then(X),e.initialized||(e.initialized=!0)};return{updateNodePositions:d,updateNodeDimensions:f,setElements:x,setNodes:D,setEdges:z,addNodes:R,addEdges:v,removeNodes:$,removeEdges:y,findNode:u,findEdge:c,updateEdge:b,updateEdgeData:S,updateNode:H,updateNodeData:W,applyEdgeChanges:B,applyNodeChanges:O,addSelectedElements:_,addSelectedNodes:k,addSelectedEdges:N,setMinZoom:g,setMaxZoom:L,setTranslateExtent:V,setNodeExtent:G,setPaneClickDistance:Y,removeSelectedElements:p,removeSelectedNodes:E,removeSelectedEdges:w,startConnection:K,updateConnection:P,endConnection:m,setInteractive:J,setState:te,getIntersectingNodes:T,getIncomers:i,getOutgoers:s,getConnectedEdges:l,getHandleConnections:a,isNodeIntersecting:j,panBy:Q,fitView:A=>o.value.fitView(A),zoomIn:A=>o.value.zoomIn(A),zoomOut:A=>o.value.zoomOut(A),zoomTo:(A,M)=>o.value.zoomTo(A,M),setViewport:(A,M)=>o.value.setViewport(A,M),setTransform:(A,M)=>o.value.setTransform(A,M),getViewport:()=>o.value.getViewport(),getTransform:()=>o.value.getTransform(),setCenter:(A,M,F)=>o.value.setCenter(A,M,F),fitBounds:(A,M)=>o.value.fitBounds(A,M),project:A=>o.value.project(A),screenToFlowCoordinate:A=>o.value.screenToFlowCoordinate(A),flowToScreenCoordinate:A=>o.value.flowToScreenCoordinate(A),toObject:()=>{const A=[],M=[];for(const F of e.nodes){const{computedPosition:U,handleBounds:X,selected:ae,dimensions:le,isParent:de,resizing:ce,dragging:pe,events:we,...Ee}=F;A.push(Ee)}for(const F of e.edges){const{selected:U,sourceNode:X,targetNode:ae,events:le,...de}=F;M.push(de)}return JSON.parse(JSON.stringify({nodes:A,edges:M,position:[e.viewport.x,e.viewport.y],zoom:e.viewport.zoom,viewport:e.viewport}))},fromObject:A=>new Promise(M=>{const{nodes:F,edges:U,position:X,zoom:ae,viewport:le}=A;F&&D(F),U&&z(U);const[de,ce]=le?.x&&le?.y?[le.x,le.y]:X??[null,null];if(de&&ce){const pe=le?.zoom||ae||e.viewport.zoom;return so(()=>o.value.viewportInitialized).toBe(!0).then(()=>{o.value.setViewport({x:de,y:ce,zoom:pe}).then(()=>{M(!0)})})}else M(!0)}),updateNodeInternals:r,viewportHelper:o,$reset:()=>{const A=Vi();if(e.edges=[],e.nodes=[],e.d3Zoom&&e.d3Selection){const M=Ot.translate(A.defaultViewport.x??0,A.defaultViewport.y??0).scale(_t(A.defaultViewport.zoom??1,A.minZoom,A.maxZoom)),F=e.viewportRef.getBoundingClientRect(),U=[[0,0],[F.width,F.height]],X=e.d3Zoom.constrain()(M,U,A.translateExtent);e.d3Zoom.transform(e.d3Selection,X)}te(A)},$destroy:()=>{}}}const hf=["data-id","data-handleid","data-nodeid","data-handlepos"],gf={name:"Handle",compatConfig:{MODE:3}},zt=xe({...gf,props:{id:{default:null},type:{},position:{default:()=>ue.Top},isValidConnection:{type:Function},connectable:{type:[Boolean,Number,String,Function],default:void 0},connectableStart:{type:Boolean,default:!0},connectableEnd:{type:Boolean,default:!0}},setup(e,{expose:t}){const n=cs(e,["position","connectable","connectableStart","connectableEnd","id"]),o=Ce(()=>n.type??"source"),r=Ce(()=>n.isValidConnection??null),{id:i,connectionStartHandle:s,connectionClickStartHandle:l,connectionEndHandle:a,vueFlowRef:u,nodesConnectable:c,noDragClassName:d,noPanClassName:f}=Me(),{id:h,node:k,nodeEl:N,connectedEdges:_}=Bi(),E=ve(),w=Ce(()=>typeof e.connectableStart<"u"?e.connectableStart:!0),p=Ce(()=>typeof e.connectableEnd<"u"?e.connectableEnd:!0),g=Ce(()=>{var z,x,R,v,$,y;return((z=s.value)==null?void 0:z.nodeId)===h&&((x=s.value)==null?void 0:x.id)===e.id&&((R=s.value)==null?void 0:R.type)===o.value||((v=a.value)==null?void 0:v.nodeId)===h&&(($=a.value)==null?void 0:$.id)===e.id&&((y=a.value)==null?void 0:y.type)===o.value}),L=Ce(()=>{var z,x,R;return((z=l.value)==null?void 0:z.nodeId)===h&&((x=l.value)==null?void 0:x.id)===e.id&&((R=l.value)==null?void 0:R.type)===o.value}),{handlePointerDown:V,handleClick:G}=Li({nodeId:h,handleId:e.id,isValidConnection:r,type:o}),Y=re(()=>typeof e.connectable=="string"&&e.connectable==="single"?!_.value.some(z=>{const x=z[`${o.value}Handle`];return z[o.value]!==h?!1:x?x===e.id:!0}):typeof e.connectable=="number"?_.value.filter(z=>{const x=z[`${o.value}Handle`];return z[o.value]!==h?!1:x?x===e.id:!0}).length<e.connectable:typeof e.connectable=="function"?e.connectable(k,_.value):Te(e.connectable)?e.connectable:c.value);rt(()=>{var z;if(!k.dimensions.width||!k.dimensions.height)return;const x=(z=k.handleBounds[o.value])==null?void 0:z.find(O=>O.id===e.id);if(!u.value||x)return;const R=u.value.querySelector(".vue-flow__transformationpane");if(!N.value||!E.value||!R||!e.id)return;const v=N.value.getBoundingClientRect(),$=E.value.getBoundingClientRect(),y=window.getComputedStyle(R),{m22:b}=new window.DOMMatrixReadOnly(y.transform),S={id:e.id,position:e.position,x:($.left-v.left)/b,y:($.top-v.top)/b,type:o.value,nodeId:h,...Vn(E.value)};k.handleBounds[o.value]=[...k.handleBounds[o.value]??[],S]});function J(z){const x=Oo(z);Y.value&&w.value&&(x&&z.button===0||!x)&&V(z)}function D(z){!h||!l.value&&!w.value||Y.value&&G(z)}return t({handleClick:G,handlePointerDown:V,onClick:D,onPointerDown:J}),(z,x)=>(q(),ee("div",{ref_key:"handle",ref:E,"data-id":`${I(i)}-${I(h)}-${e.id}-${o.value}`,"data-handleid":e.id,"data-nodeid":I(h),"data-handlepos":z.position,class:ze(["vue-flow__handle",[`vue-flow__handle-${z.position}`,`vue-flow__handle-${e.id}`,I(d),I(f),o.value,{connectable:Y.value,connecting:L.value,connectablestart:w.value,connectableend:p.value,connectionindicator:Y.value&&(w.value&&!g.value||p.value&&g.value)}]]),onMousedown:J,onTouchstartPassive:J,onClick:D},[Ie(z.$slots,"default",{id:z.id})],42,hf))}}),Gn=function({sourcePosition:e=ue.Bottom,targetPosition:t=ue.Top,label:n,connectable:o=!0,isValidTargetPos:r,isValidSourcePos:i,data:s}){const l=s.label??n;return[ke(zt,{type:"target",position:t,connectable:o,isValidConnection:r}),typeof l!="string"&&l?ke(l):ke($e,[l]),ke(zt,{type:"source",position:e,connectable:o,isValidConnection:i})]};Gn.props=["sourcePosition","targetPosition","label","isValidTargetPos","isValidSourcePos","connectable","data"];Gn.inheritAttrs=!1;Gn.compatConfig={MODE:3};const pf=Gn,Yn=function({targetPosition:e=ue.Top,label:t,connectable:n=!0,isValidTargetPos:o,data:r}){const i=r.label??t;return[ke(zt,{type:"target",position:e,connectable:n,isValidConnection:o}),typeof i!="string"&&i?ke(i):ke($e,[i])]};Yn.props=["targetPosition","label","isValidTargetPos","connectable","data"];Yn.inheritAttrs=!1;Yn.compatConfig={MODE:3};const vf=Yn,jn=function({sourcePosition:e=ue.Bottom,label:t,connectable:n=!0,isValidSourcePos:o,data:r}){const i=r.label??t;return[typeof i!="string"&&i?ke(i):ke($e,[i]),ke(zt,{type:"source",position:e,connectable:n,isValidConnection:o})]};jn.props=["sourcePosition","label","isValidSourcePos","connectable","data"];jn.inheritAttrs=!1;jn.compatConfig={MODE:3};const mf=jn,yf=["transform"],wf=["width","height","x","y","rx","ry"],_f=["y"],xf={name:"EdgeText",compatConfig:{MODE:3}},bf=xe({...xf,props:{x:{},y:{},label:{},labelStyle:{default:()=>({})},labelShowBg:{type:Boolean,default:!0},labelBgStyle:{default:()=>({})},labelBgPadding:{default:()=>[2,4]},labelBgBorderRadius:{default:2}},setup(e){const t=ve({x:0,y:0,width:0,height:0}),n=ve(null),o=re(()=>`translate(${e.x-t.value.width/2} ${e.y-t.value.height/2})`);rt(r),ye([()=>e.x,()=>e.y,n,()=>e.label],r);function r(){if(!n.value)return;const i=n.value.getBBox();(i.width!==t.value.width||i.height!==t.value.height)&&(t.value=i)}return(i,s)=>(q(),ee("g",{transform:o.value,class:"vue-flow__edge-textwrapper"},[i.labelShowBg?(q(),ee("rect",{key:0,class:"vue-flow__edge-textbg",width:`${t.value.width+2*i.labelBgPadding[0]}px`,height:`${t.value.height+2*i.labelBgPadding[1]}px`,x:-i.labelBgPadding[0],y:-i.labelBgPadding[1],style:Ve(i.labelBgStyle),rx:i.labelBgBorderRadius,ry:i.labelBgBorderRadius},null,12,wf)):he("",!0),Z("text",Eo(i.$attrs,{ref_key:"el",ref:n,class:"vue-flow__edge-text",y:t.value.height/2,dy:"0.3em",style:i.labelStyle}),[Ie(i.$slots,"default",{},()=>[typeof i.label!="string"?(q(),be(He(i.label),{key:0})):(q(),ee($e,{key:1},[Se(fe(i.label),1)],64))])],16,_f)],8,yf))}}),Ef=["id","d","marker-end","marker-start"],kf=["d","stroke-width"],Sf={name:"BaseEdge",inheritAttrs:!1,compatConfig:{MODE:3}},Xn=xe({...Sf,props:{id:{},labelX:{},labelY:{},path:{},label:{},markerStart:{},markerEnd:{},interactionWidth:{default:20},labelStyle:{},labelShowBg:{type:Boolean},labelBgStyle:{},labelBgPadding:{},labelBgBorderRadius:{}},setup(e,{expose:t}){const n=ve(null),o=ve(null),r=ve(null),i=ds();return t({pathEl:n,interactionEl:o,labelEl:r}),(s,l)=>(q(),ee($e,null,[Z("path",Eo(I(i),{id:s.id,ref_key:"pathEl",ref:n,d:s.path,class:"vue-flow__edge-path","marker-end":s.markerEnd,"marker-start":s.markerStart}),null,16,Ef),s.interactionWidth?(q(),ee("path",{key:0,ref_key:"interactionEl",ref:o,fill:"none",d:s.path,"stroke-width":s.interactionWidth,"stroke-opacity":0,class:"vue-flow__edge-interaction"},null,8,kf)):he("",!0),s.label&&s.labelX&&s.labelY?(q(),be(bf,{key:1,ref_key:"labelEl",ref:r,x:s.labelX,y:s.labelY,label:s.label,"label-show-bg":s.labelShowBg,"label-bg-style":s.labelBgStyle,"label-bg-padding":s.labelBgPadding,"label-bg-border-radius":s.labelBgBorderRadius,"label-style":s.labelStyle},null,8,["x","y","label","label-show-bg","label-bg-style","label-bg-padding","label-bg-border-radius","label-style"])):he("",!0)],64))}});function Hi({sourceX:e,sourceY:t,targetX:n,targetY:o}){const r=Math.abs(n-e)/2,i=n<e?n+r:n-r,s=Math.abs(o-t)/2,l=o<t?o+s:o-s;return[i,l,r,s]}function Fi({sourceX:e,sourceY:t,targetX:n,targetY:o,sourceControlX:r,sourceControlY:i,targetControlX:s,targetControlY:l}){const a=e*.125+r*.375+s*.375+n*.125,u=t*.125+i*.375+l*.375+o*.125,c=Math.abs(a-e),d=Math.abs(u-t);return[a,u,c,d]}function hn(e,t){return e>=0?.5*e:t*25*Math.sqrt(-e)}function Nr({pos:e,x1:t,y1:n,x2:o,y2:r,c:i}){let s,l;switch(e){case ue.Left:s=t-hn(t-o,i),l=n;break;case ue.Right:s=t+hn(o-t,i),l=n;break;case ue.Top:s=t,l=n-hn(n-r,i);break;case ue.Bottom:s=t,l=n+hn(r-n,i);break}return[s,l]}function Gi(e){const{sourceX:t,sourceY:n,sourcePosition:o=ue.Bottom,targetX:r,targetY:i,targetPosition:s=ue.Top,curvature:l=.25}=e,[a,u]=Nr({pos:o,x1:t,y1:n,x2:r,y2:i,c:l}),[c,d]=Nr({pos:s,x1:r,y1:i,x2:t,y2:n,c:l}),[f,h,k,N]=Fi({sourceX:t,sourceY:n,targetX:r,targetY:i,sourceControlX:a,sourceControlY:u,targetControlX:c,targetControlY:d});return[`M${t},${n} C${a},${u} ${c},${d} ${r},${i}`,f,h,k,N]}function Cr({pos:e,x1:t,y1:n,x2:o,y2:r}){let i,s;switch(e){case ue.Left:case ue.Right:i=.5*(t+o),s=n;break;case ue.Top:case ue.Bottom:i=t,s=.5*(n+r);break}return[i,s]}function Yi(e){const{sourceX:t,sourceY:n,sourcePosition:o=ue.Bottom,targetX:r,targetY:i,targetPosition:s=ue.Top}=e,[l,a]=Cr({pos:o,x1:t,y1:n,x2:r,y2:i}),[u,c]=Cr({pos:s,x1:r,y1:i,x2:t,y2:n}),[d,f,h,k]=Fi({sourceX:t,sourceY:n,targetX:r,targetY:i,sourceControlX:l,sourceControlY:a,targetControlX:u,targetControlY:c});return[`M${t},${n} C${l},${a} ${u},${c} ${r},${i}`,d,f,h,k]}const $r={[ue.Left]:{x:-1,y:0},[ue.Right]:{x:1,y:0},[ue.Top]:{x:0,y:-1},[ue.Bottom]:{x:0,y:1}};function Nf({source:e,sourcePosition:t=ue.Bottom,target:n}){return t===ue.Left||t===ue.Right?e.x<n.x?{x:1,y:0}:{x:-1,y:0}:e.y<n.y?{x:0,y:1}:{x:0,y:-1}}function Mr(e,t){return Math.sqrt((t.x-e.x)**2+(t.y-e.y)**2)}function Cf({source:e,sourcePosition:t=ue.Bottom,target:n,targetPosition:o=ue.Top,center:r,offset:i}){const s=$r[t],l=$r[o],a={x:e.x+s.x*i,y:e.y+s.y*i},u={x:n.x+l.x*i,y:n.y+l.y*i},c=Nf({source:a,sourcePosition:t,target:u}),d=c.x!==0?"x":"y",f=c[d];let h,k,N;const _={x:0,y:0},E={x:0,y:0},[w,p,g,L]=Hi({sourceX:e.x,sourceY:e.y,targetX:n.x,targetY:n.y});if(s[d]*l[d]===-1){k=r.x??w,N=r.y??p;const G=[{x:k,y:a.y},{x:k,y:u.y}],Y=[{x:a.x,y:N},{x:u.x,y:N}];s[d]===f?h=d==="x"?G:Y:h=d==="x"?Y:G}else{const G=[{x:a.x,y:u.y}],Y=[{x:u.x,y:a.y}];if(d==="x"?h=s.x===f?Y:G:h=s.y===f?G:Y,t===o){const R=Math.abs(e[d]-n[d]);if(R<=i){const v=Math.min(i-1,i-R);s[d]===f?_[d]=(a[d]>e[d]?-1:1)*v:E[d]=(u[d]>n[d]?-1:1)*v}}if(t!==o){const R=d==="x"?"y":"x",v=s[d]===l[R],$=a[R]>u[R],y=a[R]<u[R];(s[d]===1&&(!v&&$||v&&y)||s[d]!==1&&(!v&&y||v&&$))&&(h=d==="x"?G:Y)}const J={x:a.x+_.x,y:a.y+_.y},D={x:u.x+E.x,y:u.y+E.y},z=Math.max(Math.abs(J.x-h[0].x),Math.abs(D.x-h[0].x)),x=Math.max(Math.abs(J.y-h[0].y),Math.abs(D.y-h[0].y));z>=x?(k=(J.x+D.x)/2,N=h[0].y):(k=h[0].x,N=(J.y+D.y)/2)}return[[e,{x:a.x+_.x,y:a.y+_.y},...h,{x:u.x+E.x,y:u.y+E.y},n],k,N,g,L]}function $f(e,t,n,o){const r=Math.min(Mr(e,t)/2,Mr(t,n)/2,o),{x:i,y:s}=t;if(e.x===i&&i===n.x||e.y===s&&s===n.y)return`L${i} ${s}`;if(e.y===s){const u=e.x<n.x?-1:1,c=e.y<n.y?1:-1;return`L ${i+r*u},${s}Q ${i},${s} ${i},${s+r*c}`}const l=e.x<n.x?1:-1,a=e.y<n.y?-1:1;return`L ${i},${s+r*a}Q ${i},${s} ${i+r*l},${s}`}function wo(e){const{sourceX:t,sourceY:n,sourcePosition:o=ue.Bottom,targetX:r,targetY:i,targetPosition:s=ue.Top,borderRadius:l=5,centerX:a,centerY:u,offset:c=20}=e,[d,f,h,k,N]=Cf({source:{x:t,y:n},sourcePosition:o,target:{x:r,y:i},targetPosition:s,center:{x:a,y:u},offset:c});return[d.reduce((E,w,p)=>{let g;return p>0&&p<d.length-1?g=$f(d[p-1],w,d[p+1],l):g=`${p===0?"M":"L"}${w.x} ${w.y}`,E+=g,E},""),f,h,k,N]}function Mf(e){const{sourceX:t,sourceY:n,targetX:o,targetY:r}=e,[i,s,l,a]=Hi({sourceX:t,sourceY:n,targetX:o,targetY:r});return[`M ${t},${n}L ${o},${r}`,i,s,l,a]}const If=xe({name:"StraightEdge",props:["label","labelStyle","labelShowBg","labelBgStyle","labelBgPadding","labelBgBorderRadius","sourceY","sourceX","targetX","targetY","markerEnd","markerStart","interactionWidth"],compatConfig:{MODE:3},setup(e,{attrs:t}){return()=>{const[n,o,r]=Mf(e);return ke(Xn,{path:n,labelX:o,labelY:r,...t,...e})}}}),Pf=If,Tf=xe({name:"SmoothStepEdge",props:["sourcePosition","targetPosition","label","labelStyle","labelShowBg","labelBgStyle","labelBgPadding","labelBgBorderRadius","sourceY","sourceX","targetX","targetY","borderRadius","markerEnd","markerStart","interactionWidth","offset"],compatConfig:{MODE:3},setup(e,{attrs:t}){return()=>{const[n,o,r]=wo({...e,sourcePosition:e.sourcePosition??ue.Bottom,targetPosition:e.targetPosition??ue.Top});return ke(Xn,{path:n,labelX:o,labelY:r,...t,...e})}}}),ji=Tf,Of=xe({name:"StepEdge",props:["sourcePosition","targetPosition","label","labelStyle","labelShowBg","labelBgStyle","labelBgPadding","labelBgBorderRadius","sourceY","sourceX","targetX","targetY","markerEnd","markerStart","interactionWidth"],setup(e,{attrs:t}){return()=>ke(ji,{...e,...t,borderRadius:0})}}),Df=Of,zf=xe({name:"BezierEdge",props:["sourcePosition","targetPosition","label","labelStyle","labelShowBg","labelBgStyle","labelBgPadding","labelBgBorderRadius","sourceY","sourceX","targetX","targetY","curvature","markerEnd","markerStart","interactionWidth"],compatConfig:{MODE:3},setup(e,{attrs:t}){return()=>{const[n,o,r]=Gi({...e,sourcePosition:e.sourcePosition??ue.Bottom,targetPosition:e.targetPosition??ue.Top});return ke(Xn,{path:n,labelX:o,labelY:r,...t,...e})}}}),Af=zf,Lf=xe({name:"SimpleBezierEdge",props:["sourcePosition","targetPosition","label","labelStyle","labelShowBg","labelBgStyle","labelBgPadding","labelBgBorderRadius","sourceY","sourceX","targetX","targetY","markerEnd","markerStart","interactionWidth"],compatConfig:{MODE:3},setup(e,{attrs:t}){return()=>{const[n,o,r]=Yi({...e,sourcePosition:e.sourcePosition??ue.Bottom,targetPosition:e.targetPosition??ue.Top});return ke(Xn,{path:n,labelX:o,labelY:r,...t,...e})}}}),Bf=Lf,Rf={input:mf,default:pf,output:vf},Vf={default:Af,straight:Pf,step:Df,smoothstep:ji,simplebezier:Bf};function Hf(e,t,n){const o=re(()=>N=>t.value.get(N)),r=re(()=>N=>n.value.get(N)),i=re(()=>{const N={...Vf,...e.edgeTypes},_=Object.keys(N);for(const E of e.edges)E.type&&!_.includes(E.type)&&(N[E.type]=E.type);return N}),s=re(()=>{const N={...Rf,...e.nodeTypes},_=Object.keys(N);for(const E of e.nodes)E.type&&!_.includes(E.type)&&(N[E.type]=E.type);return N}),l=re(()=>e.onlyRenderVisibleElements?Ni(e.nodes,{x:0,y:0,width:e.dimensions.width,height:e.dimensions.height},e.viewport,!0):e.nodes),a=re(()=>{if(e.onlyRenderVisibleElements){const N=[];for(const _ of e.edges){const E=t.value.get(_.source),w=t.value.get(_.target);Ad({sourcePos:E.computedPosition||{x:0,y:0},targetPos:w.computedPosition||{x:0,y:0},sourceWidth:E.dimensions.width,sourceHeight:E.dimensions.height,targetWidth:w.dimensions.width,targetHeight:w.dimensions.height,width:e.dimensions.width,height:e.dimensions.height,viewport:e.viewport})&&N.push(_)}return N}return e.edges}),u=re(()=>[...l.value,...a.value]),c=re(()=>{const N=[];for(const _ of e.nodes)_.selected&&N.push(_);return N}),d=re(()=>{const N=[];for(const _ of e.edges)_.selected&&N.push(_);return N}),f=re(()=>[...c.value,...d.value]),h=re(()=>{const N=[];for(const _ of e.nodes)_.dimensions.width&&_.dimensions.height&&_.handleBounds!==void 0&&N.push(_);return N}),k=re(()=>l.value.length>0&&h.value.length===l.value.length);return{getNode:o,getEdge:r,getElements:u,getEdgeTypes:i,getNodeTypes:s,getEdges:a,getNodes:l,getSelectedElements:f,getSelectedNodes:c,getSelectedEdges:d,getNodesInitialized:h,areNodesInitialized:k}}class gt{constructor(){this.currentId=0,this.flows=new Map}static getInstance(){var t;const n=(t=Lt())==null?void 0:t.appContext.app,o=n?.config.globalProperties.$vueFlowStorage??gt.instance;return gt.instance=o??new gt,n&&(n.config.globalProperties.$vueFlowStorage=gt.instance),gt.instance}set(t,n){return this.flows.set(t,n)}get(t){return this.flows.get(t)}remove(t){return this.flows.delete(t)}create(t,n){const o=Vi(),r=ss(o),i={};for(const[f,h]of Object.entries(r.hooks)){const k=`on${f.charAt(0).toUpperCase()+f.slice(1)}`;i[k]=h.on}const s={};for(const[f,h]of Object.entries(r.hooks))s[f]=h.trigger;const l=re(()=>{const f=new Map;for(const h of r.nodes)f.set(h.id,h);return f}),a=re(()=>{const f=new Map;for(const h of r.edges)f.set(h.id,h);return f}),u=Hf(r,l,a),c=ff(r,l,a);c.setState({...r,...n});const d={...i,...u,...c,...Pa(r),nodeLookup:l,edgeLookup:a,emits:s,id:t,vueFlowVersion:"1.48.2",$destroy:()=>{this.remove(t)}};return this.set(t,d),d}getId(){return`vue-flow-${this.currentId++}`}}function Me(e){const t=gt.getInstance(),n=Ar(),o=typeof e=="object",r=o?e:{id:e},i=r.id,s=i??n?.vueFlowId;let l;if(n){const a=At(Sr,null);typeof a<"u"&&a!==null&&(!s||a.id===s)&&(l=a)}if(l||s&&(l=t.get(s)),!l||s&&l.id!==s){const a=i??t.getId(),u=t.create(a,r);l=u,(n??Dr(!0)).run(()=>{ye(u.applyDefault,(d,f,h)=>{const k=_=>{u.applyNodeChanges(_)},N=_=>{u.applyEdgeChanges(_)};d?(u.onNodesChange(k),u.onEdgesChange(N)):(u.hooks.value.nodesChange.off(k),u.hooks.value.edgesChange.off(N)),h(()=>{u.hooks.value.nodesChange.off(k),u.hooks.value.edgesChange.off(N)})},{immediate:!0}),Wt(()=>{if(l){const d=t.get(l.id);d?d.$destroy():on(`No store instance found for id ${l.id} in storage.`)}})})}else o&&l.setState(r);if(n&&(Mt(Sr,l),n.vueFlowId=l.id),o){const a=Lt();a?.type.name!=="VueFlow"&&l.emits.error(new Ae(Oe.USEVUEFLOW_OPTIONS))}return l}function Ff(e){const{emits:t,dimensions:n}=Me();let o;rt(()=>{const r=()=>{var i,s;if(!e.value||!(((s=(i=e.value).checkVisibility)==null?void 0:s.call(i))??!0))return;const l=Vn(e.value);(l.width===0||l.height===0)&&t.error(new Ae(Oe.MISSING_VIEWPORT_DIMENSIONS)),n.value={width:l.width||500,height:l.height||500}};r(),window.addEventListener("resize",r),e.value&&(o=new ResizeObserver(()=>r()),o.observe(e.value)),zr(()=>{window.removeEventListener("resize",r),o&&e.value&&o.unobserve(e.value)})})}const Gf={name:"UserSelection",compatConfig:{MODE:3}},Yf=xe({...Gf,props:{userSelectionRect:{}},setup(e){return(t,n)=>(q(),ee("div",{class:"vue-flow__selection vue-flow__container",style:Ve({width:`${t.userSelectionRect.width}px`,height:`${t.userSelectionRect.height}px`,transform:`translate(${t.userSelectionRect.x}px, ${t.userSelectionRect.y}px)`})},null,4))}}),jf=["tabIndex"],Xf={name:"NodesSelection",compatConfig:{MODE:3}},Wf=xe({...Xf,setup(e){const{emits:t,viewport:n,getSelectedNodes:o,noPanClassName:r,disableKeyboardA11y:i,userSelectionActive:s}=Me(),l=Ri(),a=ve(null),u=Ai({el:a,onStart(k){t.selectionDragStart(k),t.nodeDragStart(k)},onDrag(k){t.selectionDrag(k),t.nodeDrag(k)},onStop(k){t.selectionDragStop(k),t.nodeDragStop(k)}});rt(()=>{var k;i.value||(k=a.value)==null||k.focus({preventScroll:!0})});const c=re(()=>Si(o.value)),d=re(()=>({width:`${c.value.width}px`,height:`${c.value.height}px`,top:`${c.value.y}px`,left:`${c.value.x}px`}));function f(k){t.selectionContextMenu({event:k,nodes:o.value})}function h(k){i.value||$t[k.key]&&(k.preventDefault(),l({x:$t[k.key].x,y:$t[k.key].y},k.shiftKey))}return(k,N)=>!I(s)&&c.value.width&&c.value.height?(q(),ee("div",{key:0,class:ze(["vue-flow__nodesselection vue-flow__container",I(r)]),style:Ve({transform:`translate(${I(n).x}px,${I(n).y}px) scale(${I(n).zoom})`})},[Z("div",{ref_key:"el",ref:a,class:ze([{dragging:I(u)},"vue-flow__nodesselection-rect"]),style:Ve(d.value),tabIndex:I(i)?void 0:-1,onContextmenu:f,onKeydown:h},null,46,jf)],6)):he("",!0)}});function Uf(e,t){return{x:e.clientX-t.left,y:e.clientY-t.top}}const qf={name:"Pane",compatConfig:{MODE:3}},Zf=xe({...qf,props:{isSelecting:{type:Boolean},selectionKeyPressed:{type:Boolean}},setup(e){const{vueFlowRef:t,nodes:n,viewport:o,emits:r,userSelectionActive:i,removeSelectedElements:s,userSelectionRect:l,elementsSelectable:a,nodesSelectionActive:u,getSelectedEdges:c,getSelectedNodes:d,removeNodes:f,removeEdges:h,selectionMode:k,deleteKeyCode:N,multiSelectionKeyCode:_,multiSelectionActive:E,edgeLookup:w,nodeLookup:p,connectionLookup:g,defaultEdgeOptions:L,connectionStartHandle:V,panOnDrag:G}=Me(),Y=ut(null),J=ut(new Set),D=ut(new Set),z=ut(null),x=Ce(()=>a.value&&(e.isSelecting||i.value)),R=Ce(()=>V.value!==null);let v=!1,$=!1;const y=Xt(N,{actInsideInputWithModifier:!1}),b=Xt(_);ye(y,m=>{m&&(f(d.value),h(c.value),u.value=!1)}),ye(b,m=>{E.value=m});function S(m,C){return T=>{T.target===C&&m?.(T)}}function O(m){if(v||R.value){v=!1;return}r.paneClick(m),s(),u.value=!1}function B(m){var C;if(Array.isArray(G.value)&&((C=G.value)!=null&&C.includes(2))){m.preventDefault();return}r.paneContextMenu(m)}function H(m){r.paneScroll(m)}function W(m){var C,T,j;if(z.value=((C=t.value)==null?void 0:C.getBoundingClientRect())??null,!a.value||!e.isSelecting||m.button!==0||m.target!==Y.value||!z.value)return;(j=(T=m.target)==null?void 0:T.setPointerCapture)==null||j.call(T,m.pointerId);const{x:Q,y:te}=Uf(m,z.value);$=!0,v=!1,s(),l.value={width:0,height:0,startX:Q,startY:te,x:Q,y:te},r.selectionStart(m)}function K(m){var C;if(!z.value||!l.value)return;v=!0;const{x:T,y:j}=qe(m,z.value),{startX:Q=0,startY:te=0}=l.value,ne={startX:Q,startY:te,x:T<Q?T:Q,y:j<te?j:te,width:Math.abs(T-Q),height:Math.abs(j-te)},ie=J.value,ge=D.value;J.value=new Set(Ni(n.value,ne,o.value,k.value===Po.Partial,!0).map(M=>M.id)),D.value=new Set;const A=((C=L.value)==null?void 0:C.selectable)??!0;for(const M of J.value){const F=g.value.get(M);if(F)for(const{edgeId:U}of F.values()){const X=w.value.get(U);X&&(X.selectable??A)&&D.value.add(U)}}if(!kr(ie,J.value)){const M=lt(p.value,J.value,!0);r.nodesChange(M)}if(!kr(ge,D.value)){const M=lt(w.value,D.value);r.edgesChange(M)}l.value=ne,i.value=!0,u.value=!1}function P(m){var C;m.button!==0||!$||((C=m.target)==null||C.releasePointerCapture(m.pointerId),!i.value&&l.value&&m.target===Y.value&&O(m),i.value=!1,l.value=null,u.value=J.value.size>0,r.selectionEnd(m),e.selectionKeyPressed&&(v=!1),$=!1)}return(m,C)=>(q(),ee("div",{ref_key:"container",ref:Y,class:ze(["vue-flow__pane vue-flow__container",{selection:m.isSelecting}]),onClick:C[0]||(C[0]=T=>x.value?void 0:S(O,Y.value)(T)),onContextmenu:C[1]||(C[1]=T=>S(B,Y.value)(T)),onWheelPassive:C[2]||(C[2]=T=>S(H,Y.value)(T)),onPointerenter:C[3]||(C[3]=T=>x.value?void 0:I(r).paneMouseEnter(T)),onPointerdown:C[4]||(C[4]=T=>x.value?W(T):I(r).paneMouseMove(T)),onPointermove:C[5]||(C[5]=T=>x.value?K(T):I(r).paneMouseMove(T)),onPointerup:C[6]||(C[6]=T=>x.value?P(T):void 0),onPointerleave:C[7]||(C[7]=T=>I(r).paneMouseLeave(T))},[Ie(m.$slots,"default"),I(i)&&I(l)?(q(),be(Yf,{key:0,"user-selection-rect":I(l)},null,8,["user-selection-rect"])):he("",!0),I(u)&&I(d).length?(q(),be(Wf,{key:1})):he("",!0)],34))}}),Kf={name:"Transform",compatConfig:{MODE:3}},Qf=xe({...Kf,setup(e){const{viewport:t,fitViewOnInit:n,fitViewOnInitDone:o}=Me(),r=re(()=>n.value?!o.value:!1),i=re(()=>`translate(${t.value.x}px,${t.value.y}px) scale(${t.value.zoom})`);return(s,l)=>(q(),ee("div",{class:"vue-flow__transformationpane vue-flow__container",style:Ve({transform:i.value,opacity:r.value?0:void 0})},[Ie(s.$slots,"default")],4))}}),Jf={name:"Viewport",compatConfig:{MODE:3}},eh=xe({...Jf,setup(e){const{minZoom:t,maxZoom:n,defaultViewport:o,translateExtent:r,zoomActivationKeyCode:i,selectionKeyCode:s,panActivationKeyCode:l,panOnScroll:a,panOnScrollMode:u,panOnScrollSpeed:c,panOnDrag:d,zoomOnDoubleClick:f,zoomOnPinch:h,zoomOnScroll:k,preventScrolling:N,noWheelClassName:_,noPanClassName:E,emits:w,connectionStartHandle:p,userSelectionActive:g,paneDragging:L,d3Zoom:V,d3Selection:G,d3ZoomHandler:Y,viewport:J,viewportRef:D,paneClickDistance:z}=Me();Ff(D);const x=ut(!1),R=ut(!1);let v=null,$=!1,y=0,b={x:0,y:0,zoom:0};const S=Xt(l),O=Xt(s),B=Xt(i),H=Ce(()=>(!O.value||O.value&&s.value===!0)&&(S.value||d.value)),W=Ce(()=>S.value||a.value),K=Ce(()=>s.value===!0&&H.value!==!0),P=Ce(()=>O.value&&s.value!==!0||g.value||K.value),m=Ce(()=>p.value!==null);rt(()=>{if(!D.value){on("Viewport element is missing");return}const te=D.value,ne=te.getBoundingClientRect(),ie=pd().clickDistance(z.value).scaleExtent([t.value,n.value]).translateExtent(r.value),ge=Fe(te).call(ie),A=ge.on("wheel.zoom"),M=Ot.translate(o.value.x??0,o.value.y??0).scale(_t(o.value.zoom??1,t.value,n.value)),F=[[0,0],[ne.width,ne.height]],U=ie.constrain()(M,F,r.value);ie.transform(ge,U),ie.wheelDelta(cr),V.value=ie,G.value=ge,Y.value=A,J.value={x:U.x,y:U.y,zoom:U.k},ie.on("start",X=>{var ae;if(!X.sourceEvent)return null;y=X.sourceEvent.button,x.value=!0;const le=j(X.transform);((ae=X.sourceEvent)==null?void 0:ae.type)==="mousedown"&&(L.value=!0),b=le,w.viewportChangeStart(le),w.moveStart({event:X,flowTransform:le})}),ie.on("end",X=>{if(!X.sourceEvent)return null;if(x.value=!1,L.value=!1,C(H.value,y??0)&&!$&&w.paneContextMenu(X.sourceEvent),$=!1,T(b,X.transform)){const ae=j(X.transform);b=ae,w.viewportChangeEnd(ae),w.moveEnd({event:X,flowTransform:ae})}}),ie.filter(X=>{var ae;const le=B.value||k.value,de=h.value&&X.ctrlKey,ce=X.button,pe=X.type==="wheel";if(ce===1&&X.type==="mousedown"&&(Q(X,"vue-flow__node")||Q(X,"vue-flow__edge")))return!0;if(!H.value&&!le&&!W.value&&!f.value&&!h.value||g.value||m.value&&!pe||!f.value&&X.type==="dblclick"||Q(X,_.value)&&pe||Q(X,E.value)&&(!pe||W.value&&pe&&!B.value)||!h.value&&X.ctrlKey&&pe||!le&&!W.value&&!de&&pe)return!1;if(!h&&X.type==="touchstart"&&((ae=X.touches)==null?void 0:ae.length)>1)return X.preventDefault(),!1;if(!H.value&&(X.type==="mousedown"||X.type==="touchstart")||K.value&&Array.isArray(d.value)&&d.value.includes(0)&&ce===0||Array.isArray(d.value)&&!d.value.includes(ce)&&(X.type==="mousedown"||X.type==="touchstart"))return!1;const we=Array.isArray(d.value)&&d.value.includes(ce)||s.value===!0&&Array.isArray(d.value)&&!d.value.includes(0)||!ce||ce<=1;return(!X.ctrlKey||S.value||pe)&&we}),ye([g,H],()=>{g.value&&!x.value?ie.on("zoom",null):g.value||ie.on("zoom",X=>{J.value={x:X.transform.x,y:X.transform.y,zoom:X.transform.k};const ae=j(X.transform);$=C(H.value,y??0),w.viewportChange(ae),w.move({event:X,flowTransform:ae})})},{immediate:!0}),ye([g,W,u,B,h,N,_],()=>{W.value&&!B.value&&!g.value?ge.on("wheel.zoom",X=>{if(Q(X,_.value))return!1;const ae=B.value||k.value,le=h.value&&X.ctrlKey;if(!(!N.value||W.value||ae||le))return!1;X.preventDefault(),X.stopImmediatePropagation();const ce=ge.property("__zoom").k||1,pe=zn();if(!S.value&&X.ctrlKey&&h.value&&pe){const qi=We(X),Zi=cr(X),Ki=ce*2**Zi;ie.scaleTo(ge,Ki,qi,X);return}const we=X.deltaMode===1?20:1;let Ee=u.value===jt.Vertical?0:X.deltaX*we,it=u.value===jt.Horizontal?0:X.deltaY*we;!pe&&X.shiftKey&&u.value!==jt.Vertical&&!Ee&&it&&(Ee=it,it=0),ie.translateBy(ge,-(Ee/ce)*c.value,-(it/ce)*c.value);const Xe=j(ge.property("__zoom"));v&&clearTimeout(v),R.value?(w.move({event:X,flowTransform:Xe}),w.viewportChange(Xe),v=setTimeout(()=>{w.moveEnd({event:X,flowTransform:Xe}),w.viewportChangeEnd(Xe),R.value=!1},150)):(R.value=!0,w.moveStart({event:X,flowTransform:Xe}),w.viewportChangeStart(Xe))},{passive:!1}):typeof A<"u"&&ge.on("wheel.zoom",function(X,ae){const le=!N.value&&X.type==="wheel"&&!X.ctrlKey,de=B.value||k.value,ce=h.value&&X.ctrlKey;if(!de&&!a.value&&!ce&&X.type==="wheel"||le||Q(X,_.value))return null;X.preventDefault(),A.call(this,X,ae)},{passive:!1})},{immediate:!0})});function C(te,ne){return ne===2&&Array.isArray(te)&&te.includes(2)}function T(te,ne){return te.x!==ne.x&&!Number.isNaN(ne.x)||te.y!==ne.y&&!Number.isNaN(ne.y)||te.zoom!==ne.k&&!Number.isNaN(ne.k)}function j(te){return{x:te.x,y:te.y,zoom:te.k}}function Q(te,ne){return te.target.closest(`.${ne}`)}return(te,ne)=>(q(),ee("div",{ref_key:"viewportRef",ref:D,class:"vue-flow__viewport vue-flow__container"},[oe(Zf,{"is-selecting":P.value,"selection-key-pressed":I(O),class:ze({connecting:m.value,dragging:I(L),draggable:I(d)===!0||Array.isArray(I(d))&&I(d).includes(0)})},{default:me(()=>[oe(Qf,null,{default:me(()=>[Ie(te.$slots,"default")]),_:3})]),_:3},8,["is-selecting","selection-key-pressed","class"])],512))}}),th=["id"],nh=["id"],oh=["id"],rh={name:"A11yDescriptions",compatConfig:{MODE:3}},ih=xe({...rh,setup(e){const{id:t,disableKeyboardA11y:n,ariaLiveMessage:o}=Me();return(r,i)=>(q(),ee($e,null,[Z("div",{id:`${I(mi)}-${I(t)}`,style:{display:"none"}}," Press enter or space to select a node. "+fe(I(n)?"":"You can then use the arrow keys to move the node around.")+" You can then use the arrow keys to move the node around, press delete to remove it and press escape to cancel. ",9,th),Z("div",{id:`${I(yi)}-${I(t)}`,style:{display:"none"}}," Press enter or space to select an edge. You can then press delete to remove it or press escape to cancel. ",8,nh),I(n)?he("",!0):(q(),ee("div",{key:0,id:`${I(xd)}-${I(t)}`,"aria-live":"assertive","aria-atomic":"true",style:{position:"absolute",width:"1px",height:"1px",margin:"-1px",border:"0",padding:"0",overflow:"hidden",clip:"rect(0px, 0px, 0px, 0px)","clip-path":"inset(100%)"}},fe(I(o)),9,oh))],64))}});function sh(){const e=Me();ye(()=>e.viewportHelper.value.viewportInitialized,t=>{t&&setTimeout(()=>{e.emits.init(e),e.emits.paneReady(e)},1)})}function ah(e,t,n){return n===ue.Left?e-t:n===ue.Right?e+t:e}function lh(e,t,n){return n===ue.Top?e-t:n===ue.Bottom?e+t:e}const Do=function({radius:e=10,centerX:t=0,centerY:n=0,position:o=ue.Top,type:r}){return ke("circle",{class:`vue-flow__edgeupdater vue-flow__edgeupdater-${r}`,cx:ah(t,e,o),cy:lh(n,e,o),r:e,stroke:"transparent",fill:"transparent"})};Do.props=["radius","centerX","centerY","position","type"];Do.compatConfig={MODE:3};const Ir=Do,uh=xe({name:"Edge",compatConfig:{MODE:3},props:["id"],setup(e){const{id:t,addSelectedEdges:n,connectionMode:o,edgeUpdaterRadius:r,emits:i,nodesSelectionActive:s,noPanClassName:l,getEdgeTypes:a,removeSelectedEdges:u,findEdge:c,findNode:d,isValidConnection:f,multiSelectionActive:h,disableKeyboardA11y:k,elementsSelectable:N,edgesUpdatable:_,edgesFocusable:E,hooks:w}=Me(),p=re(()=>c(e.id)),{emit:g,on:L}=Qd(p.value,i),V=At(Fn),G=Lt(),Y=ve(!1),J=ve(!1),D=ve(""),z=ve(null),x=ve("source"),R=ve(null),v=Ce(()=>typeof p.value.selectable>"u"?N.value:p.value.selectable),$=Ce(()=>typeof p.value.updatable>"u"?_.value:p.value.updatable),y=Ce(()=>typeof p.value.focusable>"u"?E.value:p.value.focusable);Mt(qd,e.id),Mt(Zd,R);const b=re(()=>p.value.class instanceof Function?p.value.class(p.value):p.value.class),S=re(()=>p.value.style instanceof Function?p.value.style(p.value):p.value.style),O=re(()=>{const M=p.value.type||"default",F=V?.[`edge-${M}`];if(F)return F;let U=p.value.template??a.value[M];if(typeof U=="string"&&G){const X=Object.keys(G.appContext.components);X&&X.includes(M)&&(U=Lr(M,!1))}return U&&typeof U!="string"?U:(i.error(new Ae(Oe.EDGE_TYPE_MISSING,U)),!1)}),{handlePointerDown:B}=Li({nodeId:D,handleId:z,type:x,isValidConnection:f,edgeUpdaterType:x,onEdgeUpdate:K,onEdgeUpdateEnd:P});return()=>{const M=d(p.value.source),F=d(p.value.target),U="pathOptions"in p.value?p.value.pathOptions:{};if(!M&&!F)return i.error(new Ae(Oe.EDGE_SOURCE_TARGET_MISSING,p.value.id,p.value.source,p.value.target)),null;if(!M)return i.error(new Ae(Oe.EDGE_SOURCE_MISSING,p.value.id,p.value.source)),null;if(!F)return i.error(new Ae(Oe.EDGE_TARGET_MISSING,p.value.id,p.value.target)),null;if(!p.value||p.value.hidden||M.hidden||F.hidden)return null;let X;o.value===dt.Strict?X=M.handleBounds.source:X=[...M.handleBounds.source||[],...M.handleBounds.target||[]];const ae=yr(X,p.value.sourceHandle);let le;o.value===dt.Strict?le=F.handleBounds.target:le=[...F.handleBounds.target||[],...F.handleBounds.source||[]];const de=yr(le,p.value.targetHandle),ce=ae?.position||ue.Bottom,pe=de?.position||ue.Top,{x:we,y:Ee}=Dt(M,ae,ce),{x:it,y:Xe}=Dt(F,de,pe);return p.value.sourceX=we,p.value.sourceY=Ee,p.value.targetX=it,p.value.targetY=Xe,ke("g",{ref:R,key:e.id,"data-id":e.id,class:["vue-flow__edge",`vue-flow__edge-${O.value===!1?"default":p.value.type||"default"}`,l.value,b.value,{updating:Y.value,selected:p.value.selected,animated:p.value.animated,inactive:!v.value&&!w.value.edgeClick.hasListeners()}],tabIndex:y.value?0:void 0,"aria-label":p.value.ariaLabel===null?void 0:p.value.ariaLabel??`Edge from ${p.value.source} to ${p.value.target}`,"aria-describedby":y.value?`${yi}-${t}`:void 0,"aria-roledescription":"edge",role:y.value?"group":"img",...p.value.domAttributes,onClick:C,onContextmenu:T,onDblclick:j,onMouseenter:Q,onMousemove:te,onMouseleave:ne,onKeyDown:y.value?A:void 0},[J.value?null:ke(O.value===!1?a.value.default:O.value,{id:e.id,sourceNode:M,targetNode:F,source:p.value.source,target:p.value.target,type:p.value.type,updatable:$.value,selected:p.value.selected,animated:p.value.animated,label:p.value.label,labelStyle:p.value.labelStyle,labelShowBg:p.value.labelShowBg,labelBgStyle:p.value.labelBgStyle,labelBgPadding:p.value.labelBgPadding,labelBgBorderRadius:p.value.labelBgBorderRadius,data:p.value.data,events:{...p.value.events,...L},style:S.value,markerStart:`url('#${en(p.value.markerStart,t)}')`,markerEnd:`url('#${en(p.value.markerEnd,t)}')`,sourcePosition:ce,targetPosition:pe,sourceX:we,sourceY:Ee,targetX:it,targetY:Xe,sourceHandleId:p.value.sourceHandle,targetHandleId:p.value.targetHandle,interactionWidth:p.value.interactionWidth,...U}),[$.value==="source"||$.value===!0?[ke("g",{onMousedown:ie,onMouseenter:H,onMouseout:W},ke(Ir,{position:ce,centerX:we,centerY:Ee,radius:r.value,type:"source","data-type":"source"}))]:null,$.value==="target"||$.value===!0?[ke("g",{onMousedown:ge,onMouseenter:H,onMouseout:W},ke(Ir,{position:pe,centerX:it,centerY:Xe,radius:r.value,type:"target","data-type":"target"}))]:null]])};function H(){Y.value=!0}function W(){Y.value=!1}function K(M,F){g.update({event:M,edge:p.value,connection:F})}function P(M){g.updateEnd({event:M,edge:p.value}),J.value=!1}function m(M,F){M.button===0&&(J.value=!0,D.value=F?p.value.target:p.value.source,z.value=(F?p.value.targetHandle:p.value.sourceHandle)??null,x.value=F?"target":"source",g.updateStart({event:M,edge:p.value}),B(M))}function C(M){var F;const U={event:M,edge:p.value};v.value&&(s.value=!1,p.value.selected&&h.value?(u([p.value]),(F=R.value)==null||F.blur()):n([p.value])),g.click(U)}function T(M){g.contextMenu({event:M,edge:p.value})}function j(M){g.doubleClick({event:M,edge:p.value})}function Q(M){g.mouseEnter({event:M,edge:p.value})}function te(M){g.mouseMove({event:M,edge:p.value})}function ne(M){g.mouseLeave({event:M,edge:p.value})}function ie(M){m(M,!0)}function ge(M){m(M,!1)}function A(M){var F;!k.value&&wi.includes(M.key)&&v.value&&(M.key==="Escape"?((F=R.value)==null||F.blur(),u([c(e.id)])):n([c(e.id)]))}}}),ch=uh,dh=xe({name:"ConnectionLine",compatConfig:{MODE:3},setup(){var e;const{id:t,connectionMode:n,connectionStartHandle:o,connectionEndHandle:r,connectionPosition:i,connectionLineType:s,connectionLineStyle:l,connectionLineOptions:a,connectionStatus:u,viewport:c,findNode:d}=Me(),f=(e=At(Fn))==null?void 0:e["connection-line"],h=re(()=>{var w;return d((w=o.value)==null?void 0:w.nodeId)}),k=re(()=>{var w;return d((w=r.value)==null?void 0:w.nodeId)??null}),N=re(()=>({x:(i.value.x-c.value.x)/c.value.zoom,y:(i.value.y-c.value.y)/c.value.zoom})),_=re(()=>a.value.markerStart?`url(#${en(a.value.markerStart,t)})`:""),E=re(()=>a.value.markerEnd?`url(#${en(a.value.markerEnd,t)})`:"");return()=>{var w,p,g;if(!h.value||!o.value)return null;const L=o.value.id,V=o.value.type,G=h.value.handleBounds;let Y=G?.[V]??[];if(n.value===dt.Loose){const S=G?.[V==="source"?"target":"source"]??[];Y=[...Y,...S]}if(!Y)return null;const J=(L?Y.find(S=>S.id===L):Y[0])??null,D=J?.position??ue.Top,{x:z,y:x}=Dt(h.value,J,D);let R=null;k.value&&(n.value===dt.Strict?R=((w=k.value.handleBounds[V==="source"?"target":"source"])==null?void 0:w.find(S=>{var O;return S.id===((O=r.value)==null?void 0:O.id)}))||null:R=((p=[...k.value.handleBounds.source??[],...k.value.handleBounds.target??[]])==null?void 0:p.find(S=>{var O;return S.id===((O=r.value)==null?void 0:O.id)}))||null);const v=((g=r.value)==null?void 0:g.position)??(D?mo[D]:null);if(!D||!v)return null;const $=s.value??a.value.type??ht.Bezier;let y="";const b={sourceX:z,sourceY:x,sourcePosition:D,targetX:N.value.x,targetY:N.value.y,targetPosition:v};return $===ht.Bezier?[y]=Gi(b):$===ht.Step?[y]=wo({...b,borderRadius:0}):$===ht.SmoothStep?[y]=wo(b):$===ht.SimpleBezier?[y]=Yi(b):y=`M${z},${x} ${N.value.x},${N.value.y}`,ke("svg",{class:"vue-flow__edges vue-flow__connectionline vue-flow__container"},ke("g",{class:"vue-flow__connection"},f?ke(f,{sourceX:z,sourceY:x,sourcePosition:D,targetX:N.value.x,targetY:N.value.y,targetPosition:v,sourceNode:h.value,sourceHandle:J,targetNode:k.value,targetHandle:R,markerEnd:E.value,markerStart:_.value,connectionStatus:u.value}):ke("path",{d:y,class:[a.value.class,u.value,"vue-flow__connection-path"],style:{...l.value,...a.value.style},"marker-end":E.value,"marker-start":_.value})))}}}),fh=dh,hh=["id","markerWidth","markerHeight","markerUnits","orient"],gh={name:"MarkerType",compatConfig:{MODE:3}},ph=xe({...gh,props:{id:{},type:{},color:{default:"none"},width:{default:12.5},height:{default:12.5},markerUnits:{default:"strokeWidth"},orient:{default:"auto-start-reverse"},strokeWidth:{default:1}},setup(e){return(t,n)=>(q(),ee("marker",{id:t.id,class:"vue-flow__arrowhead",viewBox:"-10 -10 20 20",refX:"0",refY:"0",markerWidth:`${t.width}`,markerHeight:`${t.height}`,markerUnits:t.markerUnits,orient:t.orient},[t.type===I(Tn).ArrowClosed?(q(),ee("polyline",{key:0,style:Ve({stroke:t.color,fill:t.color,strokeWidth:t.strokeWidth}),"stroke-linecap":"round","stroke-linejoin":"round",points:"-5,-4 0,0 -5,4 -5,-4"},null,4)):he("",!0),t.type===I(Tn).Arrow?(q(),ee("polyline",{key:1,style:Ve({stroke:t.color,strokeWidth:t.strokeWidth}),"stroke-linecap":"round","stroke-linejoin":"round",fill:"none",points:"-5,-4 0,0 -5,4"},null,4)):he("",!0)],8,hh))}}),vh={class:"vue-flow__marker vue-flow__container","aria-hidden":"true"},mh={name:"MarkerDefinitions",compatConfig:{MODE:3}},yh=xe({...mh,setup(e){const{id:t,edges:n,connectionLineOptions:o,defaultMarkerColor:r}=Me(),i=re(()=>{const s=new Set,l=[],a=u=>{if(u){const c=en(u,t);s.has(c)||(typeof u=="object"?l.push({...u,id:c,color:u.color||r.value}):l.push({id:c,color:r.value,type:u}),s.add(c))}};for(const u of[o.value.markerEnd,o.value.markerStart])a(u);for(const u of n.value)for(const c of[u.markerStart,u.markerEnd])a(c);return l.sort((u,c)=>u.id.localeCompare(c.id))});return(s,l)=>(q(),ee("svg",vh,[Z("defs",null,[(q(!0),ee($e,null,Re(i.value,a=>(q(),be(ph,{id:a.id,key:a.id,type:a.type,color:a.color,width:a.width,height:a.height,markerUnits:a.markerUnits,"stroke-width":a.strokeWidth,orient:a.orient},null,8,["id","type","color","width","height","markerUnits","stroke-width","orient"]))),128))])]))}}),wh={name:"Edges",compatConfig:{MODE:3}},_h=xe({...wh,setup(e){const{findNode:t,getEdges:n,elevateEdgesOnSelect:o}=Me();return(r,i)=>(q(),ee($e,null,[oe(yh),(q(!0),ee($e,null,Re(I(n),s=>(q(),ee("svg",{key:s.id,class:"vue-flow__edges vue-flow__container",style:Ve({zIndex:I(Ld)(s,I(t),I(o))})},[oe(I(ch),{id:s.id},null,8,["id"])],4))),128)),oe(I(fh))],64))}}),xh=xe({name:"Node",compatConfig:{MODE:3},props:["id","resizeObserver"],setup(e){const{id:t,noPanClassName:n,selectNodesOnDrag:o,nodesSelectionActive:r,multiSelectionActive:i,emits:s,removeSelectedNodes:l,addSelectedNodes:a,updateNodeDimensions:u,onUpdateNodeInternals:c,getNodeTypes:d,nodeExtent:f,elevateNodesOnSelect:h,disableKeyboardA11y:k,ariaLiveMessage:N,snapToGrid:_,snapGrid:E,nodeDragThreshold:w,nodesDraggable:p,elementsSelectable:g,nodesConnectable:L,nodesFocusable:V,hooks:G}=Me(),Y=ve(null);Mt(zi,Y),Mt(Di,e.id);const J=At(Fn),D=Lt(),z=Ri(),{node:x,parentNode:R}=Bi(e.id),{emit:v,on:$}=nf(x,s),y=Ce(()=>typeof x.draggable>"u"?p.value:x.draggable),b=Ce(()=>typeof x.selectable>"u"?g.value:x.selectable),S=Ce(()=>typeof x.connectable>"u"?L.value:x.connectable),O=Ce(()=>typeof x.focusable>"u"?V.value:x.focusable),B=re(()=>b.value||y.value||G.value.nodeClick.hasListeners()||G.value.nodeDoubleClick.hasListeners()||G.value.nodeMouseEnter.hasListeners()||G.value.nodeMouseMove.hasListeners()||G.value.nodeMouseLeave.hasListeners()),H=Ce(()=>!!x.dimensions.width&&!!x.dimensions.height),W=re(()=>{const F=x.type||"default",U=J?.[`node-${F}`];if(U)return U;let X=x.template||d.value[F];if(typeof X=="string"&&D){const ae=Object.keys(D.appContext.components);ae&&ae.includes(F)&&(X=Lr(F,!1))}return X&&typeof X!="string"?X:(s.error(new Ae(Oe.NODE_TYPE_MISSING,X)),!1)}),K=Ai({id:e.id,el:Y,disabled:()=>!y.value,selectable:b,dragHandle:()=>x.dragHandle,onStart(F){v.dragStart(F)},onDrag(F){v.drag(F)},onStop(F){v.dragStop(F)},onClick(F){A(F)}}),P=re(()=>x.class instanceof Function?x.class(x):x.class),m=re(()=>{const F=(x.style instanceof Function?x.style(x):x.style)||{},U=x.width instanceof Function?x.width(x):x.width,X=x.height instanceof Function?x.height(x):x.height;return!F.width&&U&&(F.width=typeof U=="string"?U:`${U}px`),!F.height&&X&&(F.height=typeof X=="string"?X:`${X}px`),F}),C=Ce(()=>Number(x.zIndex??m.value.zIndex??0));return c(F=>{(F.includes(e.id)||!F.length)&&j()}),rt(()=>{ye(()=>x.hidden,(F=!1,U,X)=>{!F&&Y.value&&(e.resizeObserver.observe(Y.value),X(()=>{Y.value&&e.resizeObserver.unobserve(Y.value)}))},{immediate:!0,flush:"post"})}),ye([()=>x.type,()=>x.sourcePosition,()=>x.targetPosition],()=>{nt(()=>{u([{id:e.id,nodeElement:Y.value,forceUpdate:!0}])})}),ye([()=>x.position.x,()=>x.position.y,()=>{var F;return(F=R.value)==null?void 0:F.computedPosition.x},()=>{var F;return(F=R.value)==null?void 0:F.computedPosition.y},()=>{var F;return(F=R.value)==null?void 0:F.computedPosition.z},C,()=>x.selected,()=>x.dimensions.height,()=>x.dimensions.width,()=>{var F;return(F=R.value)==null?void 0:F.dimensions.height},()=>{var F;return(F=R.value)==null?void 0:F.dimensions.width}],([F,U,X,ae,le,de])=>{const ce={x:F,y:U,z:de+(h.value&&x.selected?1e3:0)};typeof X<"u"&&typeof ae<"u"?x.computedPosition=Pd({x:X,y:ae,z:le},ce):x.computedPosition=ce},{flush:"post",immediate:!0}),ye([()=>x.extent,f],([F,U],[X,ae])=>{(F!==X||U!==ae)&&T()}),x.extent==="parent"||typeof x.extent=="object"&&"range"in x.extent&&x.extent.range==="parent"?so(()=>H).toBe(!0).then(T):T(),()=>x.hidden?null:ke("div",{ref:Y,"data-id":x.id,class:["vue-flow__node",`vue-flow__node-${W.value===!1?"default":x.type||"default"}`,{[n.value]:y.value,dragging:K?.value,draggable:y.value,selected:x.selected,selectable:b.value,parent:x.isParent},P.value],style:{visibility:H.value?"visible":"hidden",zIndex:x.computedPosition.z??C.value,transform:`translate(${x.computedPosition.x}px,${x.computedPosition.y}px)`,pointerEvents:B.value?"all":"none",...m.value},tabIndex:O.value?0:void 0,role:O.value?"group":void 0,"aria-describedby":k.value?void 0:`${mi}-${t}`,"aria-label":x.ariaLabel,"aria-roledescription":"node",...x.domAttributes,onMouseenter:Q,onMousemove:te,onMouseleave:ne,onContextmenu:ie,onClick:A,onDblclick:ge,onKeydown:M},[ke(W.value===!1?d.value.default:W.value,{id:x.id,type:x.type,data:x.data,events:{...x.events,...$},selected:x.selected,resizing:x.resizing,dragging:K.value,connectable:S.value,position:x.computedPosition,dimensions:x.dimensions,isValidTargetPos:x.isValidTargetPos,isValidSourcePos:x.isValidSourcePos,parent:x.parentNode,parentNodeId:x.parentNode,zIndex:x.computedPosition.z??C.value,targetPosition:x.targetPosition,sourcePosition:x.sourcePosition,label:x.label,dragHandle:x.dragHandle,onUpdateNodeInternals:j})]);function T(){const F=x.computedPosition,{computedPosition:U,position:X}=To(x,_.value?Hn(F,E.value):F,s.error,f.value,R.value);(x.computedPosition.x!==U.x||x.computedPosition.y!==U.y)&&(x.computedPosition={...x.computedPosition,...U}),(x.position.x!==X.x||x.position.y!==X.y)&&(x.position=X)}function j(){Y.value&&u([{id:e.id,nodeElement:Y.value,forceUpdate:!0}])}function Q(F){K?.value||v.mouseEnter({event:F,node:x})}function te(F){K?.value||v.mouseMove({event:F,node:x})}function ne(F){K?.value||v.mouseLeave({event:F,node:x})}function ie(F){return v.contextMenu({event:F,node:x})}function ge(F){return v.doubleClick({event:F,node:x})}function A(F){b.value&&(!o.value||!y.value||w.value>0)&&yo(x,i.value,a,l,r,!1,Y.value),v.click({event:F,node:x})}function M(F){if(!(vo(F)||k.value))if(wi.includes(F.key)&&b.value){const U=F.key==="Escape";yo(x,i.value,a,l,r,U,Y.value)}else y.value&&x.selected&&$t[F.key]&&(F.preventDefault(),N.value=`Moved selected node ${F.key.replace("Arrow","").toLowerCase()}. New position, x: ${~~x.position.x}, y: ${~~x.position.y}`,z({x:$t[F.key].x,y:$t[F.key].y},F.shiftKey))}}}),bh=xh;function Eh(e={includeHiddenNodes:!1}){const{nodes:t}=Me();return re(()=>{if(t.value.length===0)return!1;for(const n of t.value)if((e.includeHiddenNodes||!n.hidden)&&(n?.handleBounds===void 0||n.dimensions.width===0||n.dimensions.height===0))return!1;return!0})}const kh={class:"vue-flow__nodes vue-flow__container"},Sh={name:"Nodes",compatConfig:{MODE:3}},Nh=xe({...Sh,setup(e){const{getNodes:t,updateNodeDimensions:n,emits:o}=Me(),r=Eh(),i=ve();return ye(r,s=>{s&&nt(()=>{o.nodesInitialized(t.value)})},{immediate:!0}),rt(()=>{i.value=new ResizeObserver(s=>{const l=s.map(a=>({id:a.target.getAttribute("data-id"),nodeElement:a.target,forceUpdate:!0}));nt(()=>n(l))})}),zr(()=>{var s;return(s=i.value)==null?void 0:s.disconnect()}),(s,l)=>(q(),ee("div",kh,[i.value?(q(!0),ee($e,{key:0},Re(I(t),(a,u,c,d)=>{const f=[a.id];if(d&&d.key===a.id&&is(d,f))return d;const h=(q(),be(I(bh),{id:a.id,key:a.id,"resize-observer":i.value},null,8,["id","resize-observer"]));return h.memo=f,h},l,0),128)):he("",!0)]))}});function Ch(){const{emits:e}=Me();rt(()=>{if(Oi()){const t=document.querySelector(".vue-flow__pane");t&&window.getComputedStyle(t).zIndex!=="1"&&e.error(new Ae(Oe.MISSING_STYLES))}})}const $h=Z("div",{class:"vue-flow__edge-labels"},null,-1),Mh={name:"VueFlow",compatConfig:{MODE:3}},Ih=xe({...Mh,props:{id:{},modelValue:{},nodes:{},edges:{},edgeTypes:{},nodeTypes:{},connectionMode:{},connectionLineType:{},connectionLineStyle:{default:void 0},connectionLineOptions:{default:void 0},connectionRadius:{},isValidConnection:{type:[Function,null],default:void 0},deleteKeyCode:{default:void 0},selectionKeyCode:{type:[Boolean,null],default:void 0},multiSelectionKeyCode:{default:void 0},zoomActivationKeyCode:{default:void 0},panActivationKeyCode:{default:void 0},snapToGrid:{type:Boolean,default:void 0},snapGrid:{},onlyRenderVisibleElements:{type:Boolean,default:void 0},edgesUpdatable:{type:[Boolean,String],default:void 0},nodesDraggable:{type:Boolean,default:void 0},nodesConnectable:{type:Boolean,default:void 0},nodeDragThreshold:{},elementsSelectable:{type:Boolean,default:void 0},selectNodesOnDrag:{type:Boolean,default:void 0},panOnDrag:{type:[Boolean,Array],default:void 0},minZoom:{},maxZoom:{},defaultViewport:{},translateExtent:{},nodeExtent:{},defaultMarkerColor:{},zoomOnScroll:{type:Boolean,default:void 0},zoomOnPinch:{type:Boolean,default:void 0},panOnScroll:{type:Boolean,default:void 0},panOnScrollSpeed:{},panOnScrollMode:{},paneClickDistance:{},zoomOnDoubleClick:{type:Boolean,default:void 0},preventScrolling:{type:Boolean,default:void 0},selectionMode:{},edgeUpdaterRadius:{},fitViewOnInit:{type:Boolean,default:void 0},connectOnClick:{type:Boolean,default:void 0},applyDefault:{type:Boolean,default:void 0},autoConnect:{type:[Boolean,Function],default:void 0},noDragClassName:{},noWheelClassName:{},noPanClassName:{},defaultEdgeOptions:{},elevateEdgesOnSelect:{type:Boolean,default:void 0},elevateNodesOnSelect:{type:Boolean,default:void 0},disableKeyboardA11y:{type:Boolean,default:void 0},edgesFocusable:{type:Boolean,default:void 0},nodesFocusable:{type:Boolean,default:void 0},autoPanOnConnect:{type:Boolean,default:void 0},autoPanOnNodeDrag:{type:Boolean,default:void 0},autoPanSpeed:{}},emits:["nodesChange","edgesChange","nodesInitialized","paneReady","init","updateNodeInternals","error","connect","connectStart","connectEnd","clickConnectStart","clickConnectEnd","moveStart","move","moveEnd","selectionDragStart","selectionDrag","selectionDragStop","selectionContextMenu","selectionStart","selectionEnd","viewportChangeStart","viewportChange","viewportChangeEnd","paneScroll","paneClick","paneContextMenu","paneMouseEnter","paneMouseMove","paneMouseLeave","edgeUpdate","edgeContextMenu","edgeMouseEnter","edgeMouseMove","edgeMouseLeave","edgeDoubleClick","edgeClick","edgeUpdateStart","edgeUpdateEnd","nodeContextMenu","nodeMouseEnter","nodeMouseMove","nodeMouseLeave","nodeDoubleClick","nodeClick","nodeDragStart","nodeDrag","nodeDragStop","miniMapNodeClick","miniMapNodeDoubleClick","miniMapNodeMouseEnter","miniMapNodeMouseMove","miniMapNodeMouseLeave","update:modelValue","update:nodes","update:edges"],setup(e,{expose:t,emit:n}){const o=e,r=os(),i=Wn(o,"modelValue",n),s=Wn(o,"nodes",n),l=Wn(o,"edges",n),a=Me(o),u=af({modelValue:i,nodes:s,edges:l},o,a);return uf(n,a.hooks),sh(),Ch(),Mt(Fn,r),xo(u),t(a),(c,d)=>(q(),ee("div",{ref:I(a).vueFlowRef,class:"vue-flow"},[oe(eh,null,{default:me(()=>[oe(_h),$h,oe(Nh),Ie(c.$slots,"zoom-pane")]),_:3}),Ie(c.$slots,"default"),oe(ih)],512))}}),Ph={name:"Panel",compatConfig:{MODE:3}},Th=xe({...Ph,props:{position:{}},setup(e){const t=e,{userSelectionActive:n}=Me(),o=re(()=>`${t.position}`.split("-"));return(r,i)=>(q(),ee("div",{class:ze(["vue-flow__panel",o.value]),style:Ve({pointerEvents:I(n)?"none":"all"})},[Ie(r.$slots,"default")],6))}});var tt=(e=>(e.Lines="lines",e.Dots="dots",e))(tt||{});const Xi=function({dimensions:e,size:t,color:n}){return ke("path",{stroke:n,"stroke-width":t,d:`M${e[0]/2} 0 V${e[1]} M0 ${e[1]/2} H${e[0]}`})},Wi=function({radius:e,color:t}){return ke("circle",{cx:e,cy:e,r:e,fill:t})};tt.Lines+"",tt.Dots+"";const Oh={[tt.Dots]:"#81818a",[tt.Lines]:"#eee"},Dh=["id","x","y","width","height","patternTransform"],zh={key:2,height:"100",width:"100"},Ah=["fill"],Lh=["x","y","fill"],Bh={name:"Background",compatConfig:{MODE:3}},Rh=xe({...Bh,props:{id:{},variant:{default:()=>tt.Dots},gap:{default:20},size:{default:1},lineWidth:{default:1},patternColor:{},color:{},bgColor:{},height:{default:100},width:{default:100},x:{default:0},y:{default:0},offset:{default:0}},setup(e){const{id:t,viewport:n}=Me(),o=re(()=>{const s=n.value.zoom,[l,a]=Array.isArray(e.gap)?e.gap:[e.gap,e.gap],u=[l*s||1,a*s||1],c=e.size*s,[d,f]=Array.isArray(e.offset)?e.offset:[e.offset,e.offset],h=[d*s||1+u[0]/2,f*s||1+u[1]/2];return{scaledGap:u,offset:h,size:c}}),r=Ce(()=>`pattern-${t}${e.id?`-${e.id}`:""}`),i=Ce(()=>e.color||e.patternColor||Oh[e.variant||tt.Dots]);return(s,l)=>(q(),ee("svg",{class:"vue-flow__background vue-flow__container",style:Ve({height:`${s.height>100?100:s.height}%`,width:`${s.width>100?100:s.width}%`})},[Ie(s.$slots,"pattern-container",{id:r.value},()=>[Z("pattern",{id:r.value,x:I(n).x%o.value.scaledGap[0],y:I(n).y%o.value.scaledGap[1],width:o.value.scaledGap[0],height:o.value.scaledGap[1],patternTransform:`translate(-${o.value.offset[0]},-${o.value.offset[1]})`,patternUnits:"userSpaceOnUse"},[Ie(s.$slots,"pattern",{},()=>[s.variant===I(tt).Lines?(q(),be(I(Xi),{key:0,size:s.lineWidth,color:i.value,dimensions:o.value.scaledGap},null,8,["size","color","dimensions"])):s.variant===I(tt).Dots?(q(),be(I(Wi),{key:1,color:i.value,radius:o.value.size/2},null,8,["color","radius"])):he("",!0),s.bgColor?(q(),ee("svg",zh,[Z("rect",{width:"100%",height:"100%",fill:s.bgColor},null,8,Ah)])):he("",!0)])],8,Dh)]),Z("rect",{x:s.x,y:s.y,width:"100%",height:"100%",fill:`url(#${r.value})`},null,8,Lh),Ie(s.$slots,"default",{id:r.value})],4))}}),Vh={name:"ControlButton",compatConfig:{MODE:3}},Hh=(e,t)=>{const n=e.__vccOpts||e;for(const[o,r]of t)n[o]=r;return n},Fh={type:"button",class:"vue-flow__controls-button"};function Gh(e,t,n,o,r,i){return q(),ee("button",Fh,[Ie(e.$slots,"default")])}const gn=Hh(Vh,[["render",Gh]]),Yh={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32"},jh=Z("path",{d:"M32 18.133H18.133V32h-4.266V18.133H0v-4.266h13.867V0h4.266v13.867H32z"},null,-1),Xh=[jh];function Wh(e,t){return q(),ee("svg",Yh,Xh)}const Uh={render:Wh},qh={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 5"},Zh=Z("path",{d:"M0 0h32v4.2H0z"},null,-1),Kh=[Zh];function Qh(e,t){return q(),ee("svg",qh,Kh)}const Jh={render:Qh},eg={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 30"},tg=Z("path",{d:"M3.692 4.63c0-.53.4-.938.939-.938h5.215V0H4.708C2.13 0 0 2.054 0 4.63v5.216h3.692V4.631zM27.354 0h-5.2v3.692h5.17c.53 0 .984.4.984.939v5.215H32V4.631A4.624 4.624 0 0 0 27.354 0zm.954 24.83c0 .532-.4.94-.939.94h-5.215v3.768h5.215c2.577 0 4.631-2.13 4.631-4.707v-5.139h-3.692v5.139zm-23.677.94a.919.919 0 0 1-.939-.94v-5.138H0v5.139c0 2.577 2.13 4.707 4.708 4.707h5.138V25.77H4.631z"},null,-1),ng=[tg];function og(e,t){return q(),ee("svg",eg,ng)}const rg={render:og},ig={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32"},sg=Z("path",{d:"M21.333 10.667H19.81V7.619C19.81 3.429 16.38 0 12.19 0 8 0 4.571 3.429 4.571 7.619v3.048H3.048A3.056 3.056 0 0 0 0 13.714v15.238A3.056 3.056 0 0 0 3.048 32h18.285a3.056 3.056 0 0 0 3.048-3.048V13.714a3.056 3.056 0 0 0-3.048-3.047zM12.19 24.533a3.056 3.056 0 0 1-3.047-3.047 3.056 3.056 0 0 1 3.047-3.048 3.056 3.056 0 0 1 3.048 3.048 3.056 3.056 0 0 1-3.048 3.047zm4.724-13.866H7.467V7.619c0-2.59 2.133-4.724 4.723-4.724 2.591 0 4.724 2.133 4.724 4.724v3.048z"},null,-1),ag=[sg];function lg(e,t){return q(),ee("svg",ig,ag)}const ug={render:lg},cg={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32"},dg=Z("path",{d:"M21.333 10.667H19.81V7.619C19.81 3.429 16.38 0 12.19 0c-4.114 1.828-1.37 2.133.305 2.438 1.676.305 4.42 2.59 4.42 5.181v3.048H3.047A3.056 3.056 0 0 0 0 13.714v15.238A3.056 3.056 0 0 0 3.048 32h18.285a3.056 3.056 0 0 0 3.048-3.048V13.714a3.056 3.056 0 0 0-3.048-3.047zM12.19 24.533a3.056 3.056 0 0 1-3.047-3.047 3.056 3.056 0 0 1 3.047-3.048 3.056 3.056 0 0 1 3.048 3.048 3.056 3.056 0 0 1-3.048 3.047z"},null,-1),fg=[dg];function hg(e,t){return q(),ee("svg",cg,fg)}const gg={render:hg},pg={name:"Controls",compatConfig:{MODE:3}},vg=xe({...pg,props:{showZoom:{type:Boolean,default:!0},showFitView:{type:Boolean,default:!0},showInteractive:{type:Boolean,default:!0},fitViewParams:{},position:{default:()=>vi.BottomLeft}},emits:["zoomIn","zoomOut","fitView","interactionChange"],setup(e,{emit:t}){const{nodesDraggable:n,nodesConnectable:o,elementsSelectable:r,setInteractive:i,zoomIn:s,zoomOut:l,fitView:a,viewport:u,minZoom:c,maxZoom:d}=Me(),f=Ce(()=>n.value||o.value||r.value),h=Ce(()=>u.value.zoom<=c.value),k=Ce(()=>u.value.zoom>=d.value);function N(){s(),t("zoomIn")}function _(){l(),t("zoomOut")}function E(){a(e.fitViewParams),t("fitView")}function w(){i(!f.value),t("interactionChange",!f.value)}return(p,g)=>(q(),be(I(Th),{class:"vue-flow__controls",position:p.position},{default:me(()=>[Ie(p.$slots,"top"),p.showZoom?(q(),ee($e,{key:0},[Ie(p.$slots,"control-zoom-in",{},()=>[oe(gn,{class:"vue-flow__controls-zoomin",disabled:k.value,onClick:N},{default:me(()=>[Ie(p.$slots,"icon-zoom-in",{},()=>[(q(),be(He(I(Uh))))])]),_:3},8,["disabled"])]),Ie(p.$slots,"control-zoom-out",{},()=>[oe(gn,{class:"vue-flow__controls-zoomout",disabled:h.value,onClick:_},{default:me(()=>[Ie(p.$slots,"icon-zoom-out",{},()=>[(q(),be(He(I(Jh))))])]),_:3},8,["disabled"])])],64)):he("",!0),p.showFitView?Ie(p.$slots,"control-fit-view",{key:1},()=>[oe(gn,{class:"vue-flow__controls-fitview",onClick:E},{default:me(()=>[Ie(p.$slots,"icon-fit-view",{},()=>[(q(),be(He(I(rg))))])]),_:3})]):he("",!0),p.showInteractive?Ie(p.$slots,"control-interactive",{key:2},()=>[p.showInteractive?(q(),be(gn,{key:0,class:"vue-flow__controls-interactive",onClick:w},{default:me(()=>[f.value?Ie(p.$slots,"icon-unlock",{key:0},()=>[(q(),be(He(I(gg))))]):he("",!0),f.value?he("",!0):Ie(p.$slots,"icon-lock",{key:1},()=>[(q(),be(He(I(ug))))])]),_:3})):he("",!0)]):he("",!0),Ie(p.$slots,"default")]),_:3},8,["position"]))}}),mg={key:0,class:"space-y-2"},yg={class:"flex items-center justify-between gap-2 text-[11px] text-muted-foreground"},wg={class:"shrink-0 font-mono"},_g=["title"],xg={class:"line-clamp-2 text-sm font-medium leading-snug"},bg={class:"flex items-center justify-between gap-2 text-[11px] text-muted-foreground"},Eg={class:"flex items-center gap-1.5 text-[10px] uppercase tracking-wide"},kg={class:"rounded bg-background/60 px-1.5 py-0.5"},Sg={class:"rounded bg-background/60 px-1.5 py-0.5"},Ng={key:1,class:"space-y-1.5"},Cg={class:"flex items-center gap-2 text-sm font-medium"},$g={class:"font-mono text-[11px] text-muted-foreground"},Mg=xe({__name:"Node",props:{id:{},type:{},selected:{type:Boolean},connectable:{type:[Boolean,Number,String,Function]},position:{},dimensions:{},label:{},isValidTargetPos:{type:Function},isValidSourcePos:{type:Function},parent:{},parentNodeId:{},dragging:{type:Boolean},resizing:{type:Boolean},zIndex:{},targetPosition:{},sourcePosition:{},dragHandle:{},data:{},events:{}},setup(e){const t=e,n=re(()=>t.data),o=re(()=>n.value.kind==="task"?n.value:null),r=re(()=>n.value.kind==="external"?n.value:null),i=re(()=>{if(n.value.kind!=="task")return{label:"Missing dependency",icon:It,class:"text-amber-600 dark:text-amber-400"};switch(n.value.status){case"completed":return{label:"Completed",icon:En,class:"text-emerald-600 dark:text-emerald-400"};case"in_progress":return{label:"In Progress",icon:Br,class:"text-blue-600 dark:text-blue-400"};default:return{label:"Pending",icon:Gt,class:"text-muted-foreground"}}}),s=re(()=>n.value.kind!=="task"?null:n.value.priority.replace("_"," ")),l=re(()=>n.value.kind!=="task"?null:n.value.category),a=re(()=>n.value.kind==="external"?["border-amber-500/60 bg-amber-50/70 text-amber-900 dark:border-amber-500/40 dark:bg-amber-500/10 dark:text-amber-100","border-dashed"]:n.value.status==="completed"?["border-emerald-500/40 bg-emerald-50/70 text-emerald-950 dark:border-emerald-500/40 dark:bg-emerald-500/10 dark:text-emerald-100","border-solid"]:n.value.status==="in_progress"?["border-blue-500/40 bg-blue-50/80 text-blue-950 dark:border-blue-500/40 dark:bg-blue-500/10 dark:text-blue-100","border-solid"]:["border-border bg-card text-card-foreground","border-solid"]),u=re(()=>n.value.kind!=="task"||!n.value.showPrdLabel?null:n.value.prdName?.trim()||n.value.prdSlug);return(c,d)=>(q(),ee("div",{class:ze(["w-[17rem] rounded-xl border px-3 py-2 shadow-sm transition-[transform,box-shadow,border-color] duration-150 ease-[var(--ease-out-cubic)] motion-reduce:transition-none",[I(a),e.selected?"ring-2 ring-primary/30 shadow-md":"hover:shadow-md hover:border-primary/40"]])},[oe(I(zt),{type:"target",position:I(ue).Top,class:"!h-2 !w-2 !border-0 !bg-transparent !opacity-0 !pointer-events-none"},null,8,["position"]),I(o)?(q(),ee("div",mg,[Z("div",yg,[Z("span",wg,fe(I(o).taskId),1),I(u)?(q(),ee("span",{key:0,title:`${I(o).prdName} (${I(o).prdSlug})`,class:"max-w-[11rem] truncate rounded border border-border bg-background/60 px-1.5 py-0.5 text-[10px]"},fe(I(u)),9,_g)):he("",!0)]),Z("p",xg,fe(I(o).title),1),Z("div",bg,[Z("div",{class:ze(["flex items-center gap-1.5",I(i).class])},[(q(),be(He(I(i).icon),{class:"size-3.5"})),Z("span",null,fe(I(i).label),1)],2),Z("div",Eg,[Z("span",kg,fe(I(l)),1),Z("span",Sg,fe(I(s)),1)])])])):I(r)?(q(),ee("div",Ng,[Z("div",Cg,[oe(I(It),{class:"size-4"}),Z("span",null,fe(I(r).title),1)]),Z("p",$g,fe(I(r).dependencyRef),1)])):he("",!0),oe(I(zt),{type:"source",position:I(ue).Bottom,class:"!h-2 !w-2 !border-0 !bg-transparent !opacity-0 !pointer-events-none"},null,8,["position"])],2))}}),Pr=Object.assign(Mg,{__name:"GraphNode"}),Ig={class:"relative h-full overflow-hidden rounded-lg border border-border bg-card"},Pg={key:0,class:"flex h-full items-center justify-center"},Tg={class:"flex flex-col items-center gap-2 text-sm text-muted-foreground"},Og={key:1,class:"flex h-full items-center justify-center p-6"},Dg={class:"max-w-sm text-center"},zg={class:"mt-1 text-sm text-muted-foreground"},Ag={key:2,class:"flex h-full items-center justify-center p-6"},Lg={class:"max-w-sm text-center"},Bg={class:"mt-1 text-sm text-muted-foreground"},Rg={key:4,class:"pointer-events-none absolute top-3 left-3 z-10 rounded-md border border-border bg-background/95 p-2.5 shadow-sm"},Vg={class:"space-y-1 text-xs"},Hg={class:"flex items-center gap-1.5 text-muted-foreground"},Fg={class:"flex items-center gap-1.5 text-blue-600 dark:text-blue-400"},Gg={class:"flex items-center gap-1.5 text-emerald-600 dark:text-emerald-400"},Yg={class:"flex items-center gap-1.5 text-amber-600 dark:text-amber-400"},jg={key:5,class:"pointer-events-none absolute top-3 right-3 z-10 rounded-md border border-border bg-background/95 p-2.5 shadow-sm"},Xg={class:"flex flex-wrap items-center gap-1.5 text-[11px] text-muted-foreground"},Wg={class:"rounded bg-muted px-1.5 py-0.5"},Ug={class:"rounded bg-blue-500/10 px-1.5 py-0.5 text-blue-700 dark:text-blue-300"},qg={class:"rounded bg-emerald-500/10 px-1.5 py-0.5 text-emerald-700 dark:text-emerald-300"},Zg={class:"rounded bg-amber-500/10 px-1.5 py-0.5 text-amber-700 dark:text-amber-300"},Kg=xe({__name:"Explorer",props:{payload:{},scope:{},loading:{type:Boolean,default:!1},error:{default:null}},emits:["taskClick"],setup(e,{emit:t}){const n=e,o=t,r={task:St(Pr),external:St(Pr)},i=Qi("(prefers-reduced-motion: reduce)"),s=ve(0);ye(()=>[n.scope,n.payload?.scope,n.payload?.nodes.length,n.payload?.edges.length],()=>{s.value+=1},{deep:!1});const l=re(()=>`${n.scope}-${s.value}`),a=re(()=>n.payload?n.payload.nodes.some(_=>_.kind==="task"):!1),u=re(()=>n.payload?.stats);function c(_,E){return _.kind==="external"?{width:272,height:80}:E==="repo"?{width:272,height:116}:{width:272,height:96}}function d(_){return _==="repo"?{ranksep:136,nodesep:88,edgesep:34,marginx:36,marginy:28}:{ranksep:102,nodesep:56,edgesep:20,marginx:24,marginy:22}}function f(_,E){const w=new Ho.graphlib.Graph,p=d(n.scope);w.setDefaultEdgeLabel(()=>({})),w.setGraph({rankdir:"TB",ranker:"network-simplex",...p});for(const g of _){const L=c(g.data,n.scope);w.setNode(g.id,L)}for(const g of E)w.setEdge(g.source,g.target);return Ho.layout(w),_.map(g=>{const L=c(g.data,n.scope),V=w.node(g.id);return V?{...g,targetPosition:ue.Top,sourcePosition:ue.Bottom,position:{x:V.x-L.width/2,y:V.y-L.height/2}}:g})}const h=re(()=>n.payload?n.payload.edges.map(_=>({id:_.id,source:_.source,target:_.target,type:"step",animated:_.unresolved&&!i.value,markerEnd:{type:Tn.ArrowClosed,width:16,height:16},style:{strokeWidth:_.unresolved?1.4:1.7,stroke:_.unresolved?"var(--muted-foreground)":"var(--border)",strokeOpacity:_.unresolved?.62:.95,strokeDasharray:_.unresolved?"5 4":void 0}})):[]),k=re(()=>{if(!n.payload)return[];const _=n.payload.nodes.map(E=>({id:E.id,type:E.kind,data:{...E,showPrdLabel:E.kind==="task"?n.scope==="repo":void 0},draggable:!1,selectable:E.kind==="task",connectable:!1,position:{x:0,y:0}}));return f(_,h.value)});function N(_){const w=_.node.data;!w||w.kind!=="task"||o("taskClick",{prdSlug:w.prdSlug,taskId:w.taskId})}return(_,E)=>(q(),ee("div",Ig,[e.loading?(q(),ee("div",Pg,[Z("div",Tg,[oe(I(ro),{class:"size-5 animate-spin"}),E[0]||(E[0]=Z("span",null,"Building graph...",-1))])])):e.error?(q(),ee("div",Og,[Z("div",Dg,[oe(I(bn),{class:"mx-auto mb-3 size-8 text-destructive"}),E[1]||(E[1]=Z("p",{class:"text-sm font-medium"},"Graph unavailable",-1)),Z("p",zg,fe(e.error),1)])])):!e.payload||!I(a)?(q(),ee("div",Ag,[Z("div",Lg,[oe(I(vs),{class:"mx-auto mb-3 size-8 text-muted-foreground/60"}),E[2]||(E[2]=Z("p",{class:"text-sm font-medium"},"No graphable tasks yet",-1)),Z("p",Bg,fe(e.scope==="repo"?"No PRDs with task state were found in this repository.":"This PRD does not have generated tasks yet."),1)])])):(q(),be(I(Ih),{key:I(l),nodes:I(k),edges:I(h),"node-types":r,"fit-view-on-init":!0,"fit-view-on-init-options":{padding:.2},"nodes-draggable":!1,"nodes-connectable":!1,"elements-selectable":!0,"zoom-on-scroll":!0,"pan-on-drag":!0,"min-zoom":.2,"max-zoom":1.8,class:"h-full",onNodeClick:N},{default:me(()=>[oe(I(Rh),{gap:20,size:1.2,variant:"dots",color:"var(--border)"}),oe(I(vg),{position:"bottom-left","show-interactive":!1})]),_:1},8,["nodes","edges"])),e.payload&&I(a)?(q(),ee("div",Rg,[E[7]||(E[7]=Z("p",{class:"mb-1 text-[11px] font-medium uppercase tracking-wide text-muted-foreground"},"Legend",-1)),Z("div",Vg,[Z("div",Hg,[oe(I(Gt),{class:"size-3.5"}),E[3]||(E[3]=Se(" Pending ",-1))]),Z("div",Fg,[oe(I(Br),{class:"size-3.5"}),E[4]||(E[4]=Se(" In Progress ",-1))]),Z("div",Gg,[oe(I(En),{class:"size-3.5"}),E[5]||(E[5]=Se(" Completed ",-1))]),Z("div",Yg,[oe(I(It),{class:"size-3.5"}),E[6]||(E[6]=Se(" Missing dependency ",-1))])])])):he("",!0),I(u)&&I(a)?(q(),ee("div",jg,[Z("div",Xg,[Z("span",Wg,"Total "+fe(I(u).total),1),Z("span",Ug,"WIP "+fe(I(u).inProgress),1),Z("span",qg,"Done "+fe(I(u).completed),1),Z("span",Zg,"Missing "+fe(I(u).unresolved),1)])])):he("",!0)]))}}),am=Object.assign(Kg,{__name:"GraphExplorer"}),Qg={class:"space-y-0.5 p-2"},Jg=["onClick"],ep={class:"min-w-0 flex-1"},tp=["title"],np={class:"text-muted-foreground"},op={class:"mt-1 flex h-1.5 w-full overflow-hidden rounded-full bg-muted"},rp={class:"flex shrink-0 items-center gap-1 text-xs"},ip={key:0,class:"text-green-600 dark:text-green-400"},sp={key:1,class:"text-red-600 dark:text-red-400"},ap={key:0,class:"py-4 text-center text-sm text-muted-foreground"},lp=xe({__name:"ChangesMinimap",props:{files:{},selectedFile:{}},emits:["select"],setup(e,{emit:t}){const n=e,o=t,r=re(()=>n.files.length===0?1:Math.max(...n.files.map(c=>c.additions+c.deletions),1));function i(c){switch(c){case"added":return{icon:Hs,class:"text-green-600 dark:text-green-400"};case"deleted":return{icon:Fs,class:"text-red-600 dark:text-red-400"};case"renamed":return{icon:Vo,class:"text-blue-600 dark:text-blue-400"};default:return{icon:Vs,class:"text-yellow-600 dark:text-yellow-400"}}}function s(c){const d=c.additions+c.deletions;if(d===0)return{additions:0,deletions:0,total:0};const f=d/r.value*100,h=c.additions/d*f,k=c.deletions/d*f;return{additions:h,deletions:k,total:f}}function l(c){return c.status==="renamed"&&c.oldPath?`${c.oldPath} → ${c.path}`:c.path}function a(c){return c.split("/").pop()||c}function u(c){o("select",c)}return(c,d)=>(q(),ee("div",Qg,[(q(!0),ee($e,null,Re(e.files,f=>(q(),ee("button",{key:f.path,class:ze(["group flex w-full items-center gap-2 rounded px-2 py-1.5 text-left text-sm transition-colors hover:bg-muted/50",{"bg-muted":e.selectedFile===f.path}]),onClick:h=>u(f.path)},[(q(),be(He(i(f.status).icon),{class:ze(["size-4 shrink-0",i(f.status).class])},null,8,["class"])),Z("div",ep,[Z("div",{class:ze(["truncate text-xs",{"font-medium":e.selectedFile===f.path}]),title:l(f)},[f.status==="renamed"&&f.oldPath?(q(),ee($e,{key:0},[Z("span",np,fe(a(f.oldPath)),1),oe(I(Vo),{class:"mx-1 inline size-3 text-muted-foreground"}),Z("span",null,fe(a(f.path)),1)],64)):(q(),ee($e,{key:1},[Se(fe(f.path),1)],64))],10,tp),Z("div",op,[s(f).additions>0?(q(),ee("div",{key:0,class:"bg-green-500 dark:bg-green-400",style:Ve({width:`${s(f).additions}%`})},null,4)):he("",!0),s(f).deletions>0?(q(),ee("div",{key:1,class:"bg-red-500 dark:bg-red-400",style:Ve({width:`${s(f).deletions}%`})},null,4)):he("",!0)])]),Z("div",rp,[f.additions>0?(q(),ee("span",ip," +"+fe(f.additions),1)):he("",!0),f.deletions>0?(q(),ee("span",sp," -"+fe(f.deletions),1)):he("",!0)])],10,Jg))),128)),e.files.length===0?(q(),ee("div",ap," No files changed ")):he("",!0)]))}}),up=Object.assign(lp,{__name:"GitChangesMinimap"}),cp={class:"diff-viewer"},dp={key:0,class:"flex items-center justify-center py-8"},fp={key:1,class:"flex flex-col items-center justify-center gap-3 py-12 text-muted-foreground"},hp={key:2,class:"flex flex-col items-center justify-center gap-3 py-12 text-muted-foreground"},gp={key:3,class:"diff-container"},pp={class:"flex flex-col items-center justify-center gap-3 border-b border-border bg-muted/30 py-6"},vp={class:"text-center"},mp={class:"text-sm text-muted-foreground"},yp={key:4,class:"diff-container"},wp={class:"full-file-view"},_p={class:"diff-gutter"},xp={class:"line-number"},bp={class:"diff-content"},Ep=["innerHTML"],kp={key:5,class:"diff-container"},Sp={class:"diff-toolbar"},Np={class:"diff-split"},Cp={class:"diff-column-content"},$p={key:0,class:"diff-separator-half"},Mp={class:"diff-gutter"},Ip={key:0,class:"line-number"},Pp={class:"diff-content"},Tp=["innerHTML"],Op={class:"diff-column-content"},Dp={key:0,class:"diff-separator-half"},zp={class:"diff-gutter"},Ap={key:0,class:"line-number"},Lp={class:"diff-content"},Bp=["innerHTML"],Tr=1e4,Or=1500,Rp=4e3,Vp=xe({__name:"DiffViewer",props:{hunks:{},filePath:{},binary:{type:Boolean},oldPath:{},fileContent:{},showFullFile:{type:Boolean},isLoadingContent:{type:Boolean}},setup(e){const t=e,n=ve(!1),o=ve(!0),r=ve(null),i=ve(null),s=ve(!1);let l=0,a=0;ye(()=>t.filePath,()=>{n.value=!1});function u($){if(!o.value||s.value)return;const y=$.target;i.value&&(s.value=!0,i.value.scrollLeft=y.scrollLeft,requestAnimationFrame(()=>{s.value=!1}))}function c($){if(!o.value||s.value)return;const y=$.target;r.value&&(s.value=!0,r.value.scrollLeft=y.scrollLeft,requestAnimationFrame(()=>{s.value=!1}))}const d=re(()=>{let $=0;for(const y of t.hunks)$+=y.lines.length;return $}),f=re(()=>d.value>Tr),h=re(()=>t.hunks.length===0&&!t.binary),k=re(()=>{const $=new Set,y=new Set;for(const b of t.hunks)for(const S of b.lines)S.type==="add"&&S.newNumber!==void 0&&$.add(S.newNumber),S.type==="remove"&&S.oldNumber!==void 0&&y.add(S.oldNumber);return{added:$,removed:y}}),N=re(()=>t.fileContent?t.fileContent.split(`
|
|
28
|
-
`):[]);function _($){const y=$.split(".").pop()?.toLowerCase()||"";return{ts:"typescript",tsx:"tsx",js:"javascript",jsx:"jsx",vue:"vue",svelte:"svelte",py:"python",rb:"ruby",rs:"rust",go:"go",java:"java",kt:"kotlin",swift:"swift",dart:"dart",c:"c",cpp:"cpp",h:"c",hpp:"cpp",cs:"csharp",php:"php",html:"html",css:"css",scss:"scss",sass:"sass",less:"less",json:"json",yaml:"yaml",yml:"yaml",toml:"toml",xml:"xml",md:"markdown",mdx:"mdx",sh:"bash",bash:"bash",zsh:"bash",fish:"fish",ps1:"powershell",sql:"sql",graphql:"graphql",gql:"graphql",dockerfile:"dockerfile",makefile:"makefile"}[y]||"text"}const E=re(()=>_(t.filePath)),w=ve(new Map),p=ve(!0),g=new Map;let L=null;async function V(){return L||(L=fs(()=>import("./D6aZT905.js"),__vite__mapDeps([0,1,2,3]),import.meta.url).then($=>$.codeToHtml)),L}const G=re(()=>{const $=[],y=t.filePath;for(let b=0;b<t.hunks.length;b++){const S=t.hunks[b];b>0&&$.push({type:"separator",hunkIndex:b});const O=S.lines;let B=0;for(;B<O.length;){const H=O[B];if(H.type==="context")$.push({type:"line",pair:{id:`${y}:${b}-${B}`,left:{lineNum:H.oldNumber,content:H.content,type:"context"},right:{lineNum:H.newNumber,content:H.content,type:"context"}}}),B++;else if(H.type==="remove"){const W=[],K=[];for(;B<O.length&&O[B].type==="remove";)W.push(O[B]),B++;for(;B<O.length&&O[B].type==="add";)K.push(O[B]),B++;const P=Math.max(W.length,K.length);for(let m=0;m<P;m++){const C=W[m],T=K[m];$.push({type:"line",pair:{id:`${y}:${b}-${B-P+m}`,left:C?{lineNum:C.oldNumber,content:C.content,type:"remove"}:{content:"",type:"empty"},right:T?{lineNum:T.newNumber,content:T.content,type:"add"}:{content:"",type:"empty"}}})}}else H.type==="add"&&$.push({type:"line",pair:{id:`${y}:${b}-${B}`,left:{content:"",type:"empty"},right:{lineNum:H.newNumber,content:H.content,type:"add"}}}),B++}}return $});async function Y($,y){if(!$.trim())return"";const b=`${y}:${$}`,S=g.get(b);if(S!==void 0)return S;try{const H=(await(await V())($,{lang:y,themes:{light:"catppuccin-latte",dark:"catppuccin-mocha"}})).match(/<code[^>]*>([\s\S]*?)<\/code>/),W=H?H[1]||"":D($);return g.set(b,W),W}catch{const O=D($);return g.set(b,O),O}}async function J($,y){if(!$)return[];const b=$.split(`
|
|
29
|
-
`);if(b.length>Rp)return b.map(D);try{const B=(await(await V())($,{lang:y,themes:{light:"catppuccin-latte",dark:"catppuccin-mocha"}})).match(/<code[^>]*>([\s\S]*?)<\/code>/);return!B||!B[1]?b.map(D):B[1].split(`
|
|
30
|
-
`)}catch{return b.map(D)}}function D($){return $.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}const z=ve([]),x=ve(!1);ye(()=>[t.fileContent,t.filePath],async([$],y,b)=>{const S=++l;let O=!1;if(b(()=>{O=!0}),z.value=[],!$){x.value=!1;return}x.value=!0;try{const B=await J($,E.value);if(O||S!==l)return;z.value=B}finally{!O&&S===l&&(x.value=!1)}},{immediate:!0}),ye(()=>[t.hunks,t.filePath,z.value],async($,y,b)=>{const S=++a;let O=!1;b(()=>{O=!0}),p.value=!0,w.value=new Map;const B=E.value,H=new Map,W=z.value,K=[];try{for(const T of G.value){if(O||S!==a)return;if(T.type==="line"&&T.pair){if(T.pair.left.content&&T.pair.left.type!=="empty"){const j=`${T.pair.id}-old`;if(T.pair.left.type==="context"&&T.pair.left.lineNum&&W.length>0){const Q=T.pair.right.lineNum?T.pair.right.lineNum-1:-1;Q>=0&&Q<W.length?H.set(j,W[Q]||""):K.push({key:j,content:T.pair.left.content})}else K.push({key:j,content:T.pair.left.content})}if(T.pair.right.content&&T.pair.right.type!=="empty"){const j=`${T.pair.id}-new`,Q=T.pair.right.lineNum;Q&&W.length>0&&Q<=W.length?H.set(j,W[Q-1]||""):K.push({key:j,content:T.pair.right.content})}}}const P=K.slice(0,Or),m=K.slice(Or);for(const{key:T,content:j}of m)H.set(T,D(j));const C=50;for(let T=0;T<P.length;T+=C){if(O||S!==a)return;const j=P.slice(T,T+C),Q=await Promise.all(j.map(async({key:te,content:ne})=>{const ie=await Y(ne,B);return{key:te,result:ie}}));if(O||S!==a)return;for(const{key:te,result:ne}of Q)H.set(te,ne)}if(O||S!==a)return;w.value=H}finally{!O&&S===a&&(p.value=!1)}},{immediate:!0});function R($,y){return w.value.get(`${$}-${y}`)||""}function v($){return k.value.added.has($)?"add":"context"}return($,y)=>(q(),ee("div",cp,[(I(p)||e.isLoadingContent||I(x))&&!e.binary?(q(),ee("div",dp,[...y[2]||(y[2]=[Z("div",{class:"size-6 animate-spin rounded-full border-2 border-primary border-t-transparent"},null,-1)])])):e.binary?(q(),ee("div",fp,[oe(I(Rs),{class:"size-10 opacity-50"}),y[3]||(y[3]=Z("div",{class:"text-center"},[Z("p",{class:"font-medium"},"Binary file"),Z("p",{class:"text-sm"},"This file cannot be displayed as a diff")],-1))])):I(h)&&!e.showFullFile?(q(),ee("div",hp,[oe(I(It),{class:"size-10 opacity-50"}),y[4]||(y[4]=Z("div",{class:"text-center"},[Z("p",{class:"font-medium"},"No changes"),Z("p",{class:"text-sm"},"This file was touched but has no content changes")],-1))])):I(f)&&!I(n)&&!e.showFullFile?(q(),ee("div",gp,[Z("div",pp,[oe(I(It),{class:"size-8 text-yellow-500"}),Z("div",vp,[y[5]||(y[5]=Z("p",{class:"font-medium"},"Large file",-1)),Z("p",mp," This file has "+fe(I(d).toLocaleString())+" lines (threshold: "+fe(Tr.toLocaleString())+") ",1)]),oe(I(ct),{variant:"outline",size:"sm",onClick:y[0]||(y[0]=b=>n.value=!0)},{default:me(()=>[oe(I(ms),{class:"mr-2 size-4"}),y[6]||(y[6]=Se(" Show full diff ",-1))]),_:1})])])):e.showFullFile&&e.fileContent?(q(),ee("div",yp,[Z("div",wp,[(q(!0),ee($e,null,Re(I(N),(b,S)=>(q(),ee("div",{key:S,class:ze(["full-file-line",{"diff-add":v(S+1)==="add"}])},[Z("div",_p,[Z("span",xp,fe(S+1),1)]),Z("div",bp,[Z("span",{class:"diff-code",innerHTML:I(z)[S]||D(b)},null,8,Ep)])],2))),128))])])):(q(),ee("div",kp,[Z("div",Sp,[oe(I(ct),{variant:"ghost",size:"sm",class:ze(["h-7 gap-1.5 text-xs",{"text-primary":I(o)}]),onClick:y[1]||(y[1]=b=>o.value=!I(o))},{default:me(()=>[(q(),be(He(I(o)?I(Ws):I(js)),{class:"size-3.5"})),Se(" "+fe(I(o)?"Sync scroll":"Scroll unlocked"),1)]),_:1},8,["class"])]),Z("div",Np,[Z("div",{ref_key:"leftScrollRef",ref:r,class:"diff-column diff-column-left",onScroll:u},[Z("div",Cp,[(q(!0),ee($e,null,Re(I(G),b=>(q(),ee($e,{key:b.type==="line"?`left-${b.pair?.id}`:`left-sep-${b.hunkIndex}`},[b.type==="separator"?(q(),ee("div",$p,[...y[7]||(y[7]=[Z("div",{class:"separator-line"},null,-1),Z("span",{class:"separator-text"},"···",-1)])])):b.pair?(q(),ee("div",{key:1,class:ze(["diff-line",{"diff-remove":b.pair.left.type==="remove","diff-empty":b.pair.left.type==="empty","diff-context":b.pair.left.type==="context"}])},[Z("div",Mp,[b.pair.left.lineNum?(q(),ee("span",Ip,fe(b.pair.left.lineNum),1)):he("",!0)]),Z("div",Pp,[b.pair.left.type!=="empty"?(q(),ee("span",{key:0,class:"diff-code",innerHTML:R(b.pair.id,"old")||D(b.pair.left.content)},null,8,Tp)):he("",!0)])],2)):he("",!0)],64))),128))])],544),Z("div",{ref_key:"rightScrollRef",ref:i,class:"diff-column diff-column-right",onScroll:c},[Z("div",Op,[(q(!0),ee($e,null,Re(I(G),b=>(q(),ee($e,{key:b.type==="line"?`right-${b.pair?.id}`:`right-sep-${b.hunkIndex}`},[b.type==="separator"?(q(),ee("div",Dp,[...y[8]||(y[8]=[Z("span",{class:"separator-text"},"···",-1),Z("div",{class:"separator-line"},null,-1)])])):b.pair?(q(),ee("div",{key:1,class:ze(["diff-line",{"diff-add":b.pair.right.type==="add","diff-empty":b.pair.right.type==="empty","diff-context":b.pair.right.type==="context"}])},[Z("div",zp,[b.pair.right.lineNum?(q(),ee("span",Ap,fe(b.pair.right.lineNum),1)):he("",!0)]),Z("div",Lp,[b.pair.right.type!=="empty"?(q(),ee("span",{key:0,class:"diff-code",innerHTML:R(b.pair.id,"new")||D(b.pair.right.content)},null,8,Bp)):he("",!0)])],2)):he("",!0)],64))),128))])],544)])]))]))}}),Hp=Object.assign(Is(Vp,[["__scopeId","data-v-9eb8ced7"]]),{__name:"GitDiffViewer"});function _o(){let e=null;function t(){e?.controller.abort();const r=new AbortController,i={controller:r,signal:r.signal,isCurrent:()=>e===i&&!r.signal.aborted};return e=i,i}function n(r){e===r&&(e=null)}function o(){e?.controller.abort(),e=null}return{begin:t,clear:n,cancel:o}}function kt(e){if(!e||typeof e!="object")return!1;const t=e;if(t.name==="AbortError"||t.cause?.name==="AbortError")return!0;const n=t.message||t.cause?.message;return typeof n=="string"&&n.toLowerCase().includes("aborted")}function Ui(){const{showError:e}=Ji();function t(_){if(_&&typeof _=="object"){const E=_;return E.data?.message||E.data?.statusMessage||E.message||"Unknown error"}return"Unknown error"}const n=ve(0),o=ve(0),r=ve(0),i=ve(0),s=re(()=>n.value>0),l=re(()=>o.value>0),a=re(()=>r.value>0),u=re(()=>i.value>0);function c(_){_.value+=1}function d(_){_.value=Math.max(0,_.value-1)}async function f(_,E,w){if(!_||E.length===0)return{commits:[],failedShas:[]};c(n);try{const p={shas:E.join(",")};w?.repoPath&&(p.repo=w.repoPath);const g=await $fetch(`/api/repos/${_}/git/commits`,{query:p,signal:w?.signal}),L=g.map(G=>G.shortSha),V=E.filter(G=>!L.some(Y=>Y.startsWith(G)||G.startsWith(Y)));return{commits:g,failedShas:V}}catch(p){return kt(p)?{commits:[],failedShas:[]}:(w?.suppressError||e("Failed to fetch commits",t(p)),{commits:[],failedShas:E})}finally{d(n)}}async function h(_,E,w){if(!_||!E)return[];c(o);try{const p={commit:E};return w?.repoPath&&(p.repo=w.repoPath),await $fetch(`/api/repos/${_}/git/diff`,{query:p,signal:w?.signal})}catch(p){throw!kt(p)&&!w?.suppressError&&e("Failed to fetch diff",t(p)),p}finally{d(o)}}async function k(_,E,w,p){if(!_||!E||!w)return[];c(r);try{const g={commit:E,file:w};return p?.repoPath&&(g.repo=p.repoPath),await $fetch(`/api/repos/${_}/git/file-diff`,{query:g,signal:p?.signal})}catch(g){throw!kt(g)&&!p?.suppressError&&e("Failed to fetch file diff",t(g)),g}finally{d(r)}}async function N(_,E,w,p){if(!_||!E||!w)return null;c(i);try{const g={commit:E,file:w};return p?.repoPath&&(g.repo=p.repoPath),(await $fetch(`/api/repos/${_}/git/file-content`,{query:g,signal:p?.signal})).content}catch(g){throw!kt(g)&&!p?.suppressError&&e("Failed to fetch file content",t(g)),g}finally{d(i)}}return{fetchCommits:f,fetchDiff:h,fetchFileDiff:k,fetchFileContent:N,isLoadingCommits:s,isLoadingDiff:l,isLoadingFileDiff:a,isLoadingFileContent:u}}const Fp={key:0,class:"flex flex-1 flex-col items-center justify-center gap-4 p-8"},Gp={class:"text-center"},Yp={class:"text-sm text-muted-foreground"},jp={key:1,class:"flex flex-1 items-center justify-center"},Xp={key:2,class:"flex flex-1 flex-col items-center justify-center gap-2 p-8 text-center text-muted-foreground"},Wp={key:3,class:"flex min-h-0 flex-1 overflow-hidden"},Up={class:"flex w-56 shrink-0 flex-col border-r border-border"},qp={class:"flex items-center justify-between border-b border-border px-3 py-2"},Zp={class:"text-xs font-medium text-muted-foreground"},Kp={class:"text-muted-foreground/50 transition-colors hover:text-muted-foreground"},Qp={class:"min-h-0 flex-1 overflow-y-auto"},Jp={class:"flex min-h-0 flex-1 flex-col overflow-hidden"},ev={key:0,class:"flex items-center gap-2 border-b border-border px-4 py-2"},tv={key:0,class:"min-w-0 flex-1 truncate font-mono text-sm"},nv={class:"text-muted-foreground"},ov={key:1,class:"min-w-0 flex-1 truncate font-mono text-sm"},rv={key:2,class:"rounded bg-yellow-500/10 px-1.5 py-0.5 text-xs text-yellow-600 dark:text-yellow-400"},iv={key:1,class:"flex flex-1 items-center justify-center"},sv={key:2,class:"flex flex-1 flex-col items-center justify-center gap-4 p-8"},av={class:"text-center"},lv={class:"text-xs text-muted-foreground"},uv={key:4,class:"flex flex-1 items-center justify-center text-sm text-muted-foreground"},cv=xe({__name:"DiffPanel",props:{repoId:{},commitSha:{},repoPath:{}},emits:["close"],setup(e,{emit:t}){const n=e,o=t,{fetchDiff:r,fetchFileDiff:i,fetchFileContent:s,isLoadingDiff:l,isLoadingFileDiff:a,isLoadingFileContent:u}=Ui(),c=ve([]),d=ve(),f=ve([]),h=ve(null),k=ve(null),N=ve(null),_=ve("changes"),E=_o(),w=_o();function p(S,O){if(S&&typeof S=="object"){const B=S;return B.data?.message||B.data?.statusMessage||B.statusMessage||B.message||O}return O}const g=re(()=>c.value.find(S=>S.path===d.value)),L=re(()=>`${n.repoPath||""}:${n.commitSha}:${d.value||""}`);function V(){k.value=null,c.value=[],d.value=void 0,f.value=[],h.value=null,N.value=null}async function G(){const S=n.repoId,O=n.commitSha,B=n.repoPath,H=E.begin();w.cancel(),V();try{const W=await r(S,O,{repoPath:B,signal:H.signal,suppressError:!0});if(!(H.isCurrent()&&n.repoId===S&&n.commitSha===O&&n.repoPath===B))return;c.value=W,W.length>0&&(d.value=W[0].path)}catch(W){if(kt(W)||!H.isCurrent())return;k.value=p(W,"Could not load commit diff.")}finally{E.clear(H)}}async function Y(){const S=d.value;if(!S){N.value=null,f.value=[],h.value=null;return}const O=n.repoId,B=n.commitSha,H=n.repoPath,W=_.value,K=S,P=w.begin();N.value=null,f.value=[],h.value=null;const m=()=>P.isCurrent()&&n.repoId===O&&n.commitSha===B&&n.repoPath===H&&_.value===W&&d.value===K;try{const C=i(O,B,K,{repoPath:H,signal:P.signal,suppressError:!0});if(W==="full"){const[T,j]=await Promise.all([C,s(O,B,K,{repoPath:H,signal:P.signal,suppressError:!0})]);if(!m())return;f.value=T,h.value=j}else{const T=await C;if(!m())return;f.value=T,h.value=null}}catch(C){if(!m()||kt(C))return;N.value=p(C,"Could not load file diff.")}finally{w.clear(P)}}function J(){_.value=_.value==="changes"?"full":"changes"}function D(S){d.value=S}function z(){G()}function x(){Y()}ye(()=>[d.value,_.value],()=>{Y()}),ye(()=>[n.repoId,n.commitSha,n.repoPath],()=>{G()},{immediate:!0});const R=ve(null),v=ve(null);function $(S){if(c.value.length===0)return;const O=d.value?c.value.findIndex(W=>W.path===d.value):-1;let B;S==="next"?B=O<c.value.length-1?O+1:0:B=O>0?O-1:c.value.length-1;const H=c.value[B];H&&(d.value=H.path)}function y(S){if(!v.value)return;const O=v.value.querySelectorAll(".diff-separator");if(O.length===0)return;const B=v.value.closest(".overflow-y-auto, [data-radix-scroll-area-viewport]");if(!B)return;const H=B.scrollTop,W=B.getBoundingClientRect();let K=null;if(S==="next"){for(const P of O)if(P.getBoundingClientRect().top-W.top+H>H+50){K=P;break}!K&&O.length>0&&(K=O[0])}else{for(let P=O.length-1;P>=0;P--){const m=O[P];if(m.getBoundingClientRect().top-W.top+H<H-10){K=m;break}}!K&&O.length>0&&(K=O[O.length-1])}K&&K.scrollIntoView({behavior:"smooth",block:"start"})}function b(S){if(!(S.target instanceof HTMLInputElement||S.target instanceof HTMLTextAreaElement))switch(S.key){case"j":case"ArrowDown":!S.ctrlKey&&!S.metaKey&&(S.preventDefault(),$("next"));break;case"k":case"ArrowUp":!S.ctrlKey&&!S.metaKey&&(S.preventDefault(),$("prev"));break;case"[":S.preventDefault(),y("prev");break;case"]":S.preventDefault(),y("next");break;case"Escape":S.preventDefault(),o("close");break}}return rt(()=>{document.addEventListener("keydown",b)}),xo(()=>{E.cancel(),w.cancel(),document.removeEventListener("keydown",b)}),(S,O)=>{const B=up,H=Hp;return q(),ee("div",{ref_key:"panelRef",ref:R,class:"flex h-full flex-col overflow-hidden",tabindex:"-1"},[I(k)?(q(),ee("div",Fp,[oe(I(bn),{class:"size-12 text-destructive"}),Z("div",Gp,[O[0]||(O[0]=Z("p",{class:"font-medium"},"Failed to load diff",-1)),Z("p",Yp,fe(I(k)),1)]),oe(I(ct),{variant:"outline",size:"sm",onClick:z},{default:me(()=>[oe(I(zo),{class:"mr-2 size-4"}),O[1]||(O[1]=Se(" Retry ",-1))]),_:1})])):I(l)&&I(c).length===0?(q(),ee("div",jp,[oe(I(ro),{class:"size-8 animate-spin text-muted-foreground"})])):I(c).length===0?(q(),ee("div",Xp,[...O[2]||(O[2]=[Z("p",null,"No files changed in this commit",-1)])])):(q(),ee("div",Wp,[Z("div",Up,[Z("div",qp,[Z("span",Zp,fe(I(c).length)+" file"+fe(I(c).length!==1?"s":"")+" changed ",1),oe(I(Ao),null,{default:me(()=>[oe(I(Lo),null,{default:me(()=>[oe(I(Bo),{"as-child":""},{default:me(()=>[Z("button",Kp,[oe(I(ys),{class:"size-3.5"})])]),_:1}),oe(I(Ro),{side:"bottom",align:"end",class:"max-w-xs"},{default:me(()=>[...O[3]||(O[3]=[Z("div",{class:"space-y-1 text-xs"},[Z("div",{class:"flex justify-between gap-4"},[Z("span",{class:"text-muted-foreground"},"Navigate files"),Z("span",{class:"font-mono"},"j/k or ↑/↓")]),Z("div",{class:"flex justify-between gap-4"},[Z("span",{class:"text-muted-foreground"},"Jump to hunk"),Z("span",{class:"font-mono"},"[ / ]")]),Z("div",{class:"flex justify-between gap-4"},[Z("span",{class:"text-muted-foreground"},"Close"),Z("span",{class:"font-mono"},"Esc")])],-1)])]),_:1})]),_:1})]),_:1})]),Z("div",Qp,[oe(B,{files:I(c),"selected-file":I(d),onSelect:D},null,8,["files","selected-file"])])]),Z("div",Jp,[I(d)?(q(),ee("div",ev,[I(g)?.oldPath?(q(),ee("span",tv,[Z("span",nv,fe(I(g).oldPath),1),O[4]||(O[4]=Z("span",{class:"mx-2 text-muted-foreground"},"→",-1)),Z("span",null,fe(I(d)),1)])):(q(),ee("span",ov,fe(I(d)),1)),I(g)?.binary?(q(),ee("span",rv," binary ")):he("",!0),I(g)?.binary?he("",!0):(q(),be(I(Ao),{key:3},{default:me(()=>[oe(I(Lo),null,{default:me(()=>[oe(I(Bo),{"as-child":""},{default:me(()=>[oe(I(ct),{variant:"ghost",size:"sm",class:"h-7 shrink-0 gap-1.5 text-xs",onClick:J},{default:me(()=>[(q(),be(He(I(_)==="changes"?I(Bs):I(Ls)),{class:"size-3.5"})),Se(" "+fe(I(_)==="changes"?"Changes":"Full file"),1)]),_:1})]),_:1}),oe(I(Ro),null,{default:me(()=>[Se(fe(I(_)==="changes"?"Show full file with changes":"Show changes only"),1)]),_:1})]),_:1})]),_:1}))])):he("",!0),I(a)?(q(),ee("div",iv,[oe(I(ro),{class:"size-6 animate-spin text-muted-foreground"})])):I(N)?(q(),ee("div",sv,[oe(I(bn),{class:"size-8 text-destructive"}),Z("div",av,[O[5]||(O[5]=Z("p",{class:"text-sm font-medium"},"Failed to load file diff",-1)),Z("p",lv,fe(I(N)),1)]),oe(I(ct),{variant:"outline",size:"sm",onClick:x},{default:me(()=>[oe(I(zo),{class:"mr-2 size-4"}),O[6]||(O[6]=Se(" Retry ",-1))]),_:1})])):I(d)?(q(),be(I(ws),{key:3,class:"h-0 flex-1 overflow-hidden"},{default:me(()=>[Z("div",{ref_key:"diffViewerRef",ref:v},[(q(),be(H,{key:I(L),hunks:I(f),"file-path":I(d),binary:I(g)?.binary,"old-path":I(g)?.oldPath,"file-content":I(h),"show-full-file":I(_)==="full","is-loading-content":I(u)},null,8,["hunks","file-path","binary","old-path","file-content","show-full-file","is-loading-content"]))],512)]),_:1})):(q(),ee("div",uv," Select a file to view changes "))])]))],512)}}}),dv=Object.assign(cv,{__name:"GitDiffPanel"}),fv={class:"space-y-2"},hv={key:1,class:"rounded-lg border border-dashed p-4 text-center text-sm text-muted-foreground"},gv=["onClick"],pv={class:"flex items-start gap-3"},vv={class:"min-w-0 flex-1"},mv={class:"flex flex-wrap items-center gap-2"},yv={class:"font-mono text-xs font-medium text-primary"},wv={class:"flex items-center gap-1 text-xs text-muted-foreground"},_v={class:"flex items-center gap-0.5 text-xs text-green-600 dark:text-green-400"},xv={class:"flex items-center gap-0.5 text-xs text-red-600 dark:text-red-400"},bv={class:"mt-1 truncate text-sm"},Ev={key:1,class:"flex items-center gap-1 text-muted-foreground"},kv={key:2,class:"text-muted-foreground"},Sv={key:0,class:"mt-1 text-xs text-muted-foreground"},Nv=xe({__name:"CommitList",props:{commits:{},repoId:{}},emits:["select"],setup(e,{emit:t}){const n=e,o=t,{fetchCommits:r,isLoadingCommits:i}=Ui(),s=ve(new Map),l=ve(new Set);function a(w){return w.trim().toLowerCase()}function u(w){return(w||"").trim()}function c(w,p){return`${u(p)}::${a(w)}`}function d(w,p){const g=a(w),L=a(p.sha),V=a(p.shortSha);return L===g||V===g||L.startsWith(g)||g.startsWith(L)||V.startsWith(g)||g.startsWith(V)}const f=re(()=>new Set(n.commits.map(p=>p.repo).filter(Boolean)).size>1),h=_o();ye(()=>({commits:n.commits,repoId:n.repoId}),async({commits:w,repoId:p},g,L)=>{const V=h.begin();if(L(()=>{h.clear(V)}),w.length===0||!p){s.value=new Map,l.value=new Set;return}const G=new Map;for(const z of w){const x=z.repo||"";G.has(x)||G.set(x,[]),G.get(x).push(z.sha)}const Y=await Promise.all(Array.from(G.entries()).map(async([z,x])=>{const R=await r(p,x,{repoPath:z||void 0,signal:V.signal});return{repoPath:z,requestedShas:[...x],commits:R.commits,failedShas:R.failedShas}})),J=new Map,D=new Set;for(const{repoPath:z,requestedShas:x,commits:R,failedShas:v}of Y){const $=[...R];for(const y of x){const b=c(y,z),S=$.findIndex(O=>d(y,O));if(S>=0){const[O]=$.splice(S,1);if(O){J.set(b,{...O,repoPath:z});continue}}D.add(b)}for(const y of v)D.add(c(y,z))}V.isCurrent()&&(s.value=J,l.value=D)},{immediate:!0}),xo(()=>{h.cancel()});function k(w){const p=new Date(w),L=new Date().getTime()-p.getTime(),V=Math.floor(L/1e3),G=Math.floor(V/60),Y=Math.floor(G/60),J=Math.floor(Y/24);return V<60?"just now":G<60?`${G} minute${G===1?"":"s"} ago`:Y<24?`${Y} hour${Y===1?"":"s"} ago`:J<7?`${J} day${J===1?"":"s"} ago`:p.toLocaleDateString()}function N(w){o("select",w.sha,w.repo)}function _(w){const p=s.value.get(c(w.sha,w.repo));if(p)return p;const g=a(w.sha),L=`${u(w.repo)}::`;for(const[V,G]of s.value){if(!V.startsWith(L))continue;const Y=V.slice(L.length);if(Y.startsWith(g)||g.startsWith(Y))return G}}function E(w){const p=c(w.sha,w.repo);if(l.value.has(p))return!0;const g=a(w.sha),L=`${u(w.repo)}::`;for(const V of l.value){if(!V.startsWith(L))continue;const G=V.slice(L.length);if(G.startsWith(g)||g.startsWith(G))return!0}return!1}return(w,p)=>(q(),ee("div",fv,[I(i)?(q(!0),ee($e,{key:0},Re(Math.min(e.commits.length,3),g=>(q(),ee("div",{key:g,class:"animate-pulse rounded-lg border bg-muted/50 p-3"},[...p[0]||(p[0]=[hs('<div class="flex items-start gap-3"><div class="h-5 w-5 rounded bg-muted"></div><div class="flex-1 space-y-2"><div class="h-4 w-20 rounded bg-muted"></div><div class="h-4 w-3/4 rounded bg-muted"></div><div class="h-3 w-1/2 rounded bg-muted"></div></div></div>',1)])]))),128)):e.commits.length===0?(q(),ee("div",hv," No commits recorded for this task ")):(q(!0),ee($e,{key:2},Re(e.commits,g=>(q(),ee("button",{key:`${g.repo||""}:${g.sha}`,class:"w-full rounded-lg border bg-card p-3 text-left transition-colors hover:bg-muted/50 focus:outline-none focus:ring-2 focus:ring-ring",onClick:L=>N(g)},[Z("div",pv,[oe(I(Ys),{class:"mt-0.5 size-5 shrink-0 text-muted-foreground"}),Z("div",vv,[Z("div",mv,[Z("code",yv,fe(_(g)?.shortSha||g.sha.substring(0,7)),1),_(g)?(q(),ee($e,{key:0},[Z("span",wv,[oe(I(es),{class:"size-3"}),Se(" "+fe(_(g).filesChanged),1)]),Z("span",_v,[oe(I(_s),{class:"size-3"}),Se(fe(_(g).additions),1)]),Z("span",xv,[oe(I(qs),{class:"size-3"}),Se(fe(_(g).deletions),1)])],64)):he("",!0),g.repo&&I(f)?(q(),be(I(vn),{key:1,variant:"secondary",class:"gap-1 text-xs"},{default:me(()=>[oe(I(Gs),{class:"size-3"}),Se(" "+fe(g.repo),1)]),_:2},1024)):he("",!0)]),Z("p",bv,[_(g)?(q(),ee($e,{key:0},[Se(fe(_(g).message),1)],64)):E(g)?(q(),ee("span",Ev,[oe(I(bn),{class:"size-3"}),p[1]||(p[1]=Se(" Commit unavailable ",-1))])):(q(),ee("span",kv,"Loading..."))]),_(g)?(q(),ee("p",Sv,fe(_(g).author)+" · "+fe(k(_(g).date)),1)):he("",!0)])])],8,gv))),128))]))}}),Cv=Object.assign(Nv,{__name:"GitCommitList"}),$v=xe({__name:"Separator",props:{orientation:{default:"horizontal"},decorative:{type:Boolean,default:!0},asChild:{type:Boolean},as:{},class:{}},setup(e){const t=e,n=ts(t,"class");return(o,r)=>(q(),be(I(xs),Eo({"data-slot":"separator"},I(n),{class:I(ns)("bg-border shrink-0 data-[orientation=horizontal]:h-px data-[orientation=horizontal]:w-full data-[orientation=vertical]:h-full data-[orientation=vertical]:w-px",t.class)}),null,16,["class"]))}}),Et=Object.assign($v,{__name:"UiSeparator"}),Mv={class:"flex items-center gap-2"},Iv={key:1,class:"min-h-0 flex-1 overflow-hidden"},Pv={key:2,class:"min-h-0 flex-1 space-y-4 overflow-y-auto px-6"},Tv={class:"flex flex-wrap items-center gap-2"},Ov={class:"space-y-2"},Dv={class:"text-sm text-muted-foreground leading-relaxed"},zv={key:0,class:"space-y-2"},Av={class:"flex items-center gap-2 text-sm font-medium"},Lv={class:"ml-4 list-decimal space-y-1 text-sm text-muted-foreground"},Bv={key:2,class:"space-y-2"},Rv={class:"flex items-center gap-2 text-sm font-medium"},Vv={class:"space-y-1.5 text-sm text-muted-foreground"},Hv={key:4,class:"space-y-2"},Fv={class:"flex items-center gap-2 text-sm font-medium"},Gv={class:"space-y-1 text-sm text-muted-foreground"},Yv={class:"font-mono text-xs"},jv={class:"space-y-2"},Xv={class:"flex items-center gap-2 text-sm font-medium"},Wv={key:6,class:"space-y-2"},Uv={class:"flex flex-col gap-1 text-xs text-muted-foreground"},qv={key:0,class:"flex items-center gap-2"},Zv={key:1,class:"flex items-center gap-2"},Kv={key:7,class:"space-y-2"},Qv={class:"flex items-center justify-between rounded-md border border-border bg-muted/30 px-3 py-2 text-sm"},Jv={class:"text-muted-foreground"},em=xe({__name:"Detail",props:ps({task:{},taskTitles:{},commits:{},repoId:{},taskPrdSlug:{},currentPrdSlug:{}},{open:{type:Boolean,default:!1},openModifiers:{}}),emits:["update:open"],setup(e){const t=e,n=gs(e,"open"),o=re(()=>{if(!t.task)return{label:"",variant:"secondary"};switch(t.task.category){case"setup":return{label:"Setup",variant:"secondary"};case"feature":return{label:"Feature",variant:"default"};case"integration":return{label:"Integration",variant:"outline"};case"testing":return{label:"Testing",variant:"secondary"};case"documentation":return{label:"Docs",variant:"secondary"};default:return{label:t.task.category,variant:"secondary"}}}),r=re(()=>{if(!t.task)return{label:"",class:""};switch(t.task.priority){case"critical":return{label:"Critical",class:"text-destructive"};case"high":return{label:"High",class:"text-orange-500"};case"medium":return{label:"Medium",class:"text-muted-foreground"};case"low":return{label:"Low",class:"text-muted-foreground"};default:return{label:t.task.priority,class:"text-muted-foreground"}}}),i=re(()=>{if(!t.task)return{label:"",icon:Gt,class:""};switch(t.task.status){case"pending":return{label:"Pending",icon:Gt,class:"text-muted-foreground"};case"in_progress":return{label:"In Progress",icon:Ds,class:"text-blue-500"};case"completed":return{label:"Completed",icon:En,class:"text-green-500"};default:return{label:t.task.status,icon:Gt,class:"text-muted-foreground"}}});function s(_){if(!_)return"";try{return new Date(_).toLocaleString()}catch{return _}}function l(_){return t.taskTitles?.get(_)??_}const a=re(()=>t.commits&&t.commits.length>0&&t.repoId),u=re(()=>!t.repoId||!t.taskPrdSlug?!1:t.currentPrdSlug?t.taskPrdSlug!==t.currentPrdSlug:!0),c=re(()=>{if(!u.value||!t.repoId||!t.taskPrdSlug||!t.task)return"";const _=new URLSearchParams({task:t.task.id,taskPrd:t.taskPrdSlug});return`/${t.repoId}/${t.taskPrdSlug}?${_.toString()}`}),d=ve("details"),f=ve(null),h=ve(null);function k(_,E){f.value=_,h.value=E||null,d.value="diff"}function N(){d.value="details",f.value=null,h.value=null}return ye(()=>t.task,()=>{d.value="details",f.value=null,h.value=null}),ye(n,_=>{_||(d.value="details",f.value=null,h.value=null)}),(_,E)=>{const w=dv,p=Cv,g=Ps;return q(),be(I($s),{open:n.value,"onUpdate:open":E[0]||(E[0]=L=>n.value=L)},{default:me(()=>[oe(I(Cs),{class:ze(["flex h-full w-full flex-col overflow-hidden sm:max-w-lg",I(d)==="diff"?"sm:!max-w-[94vw] xl:!max-w-[88vw]":""])},{default:me(()=>[e.task?(q(),be(I(bs),{key:0,class:"px-6 pr-12"},{default:me(()=>[Z("div",Mv,[I(d)==="diff"?(q(),be(I(ct),{key:0,variant:"ghost",size:"icon",class:"size-8 shrink-0",onClick:N},{default:me(()=>[oe(I(Ts),{class:"size-4"})]),_:1})):he("",!0),oe(I(Es),{class:"text-left text-lg"},{default:me(()=>[Se(fe(I(d)==="diff"?"Commit Changes":e.task.title),1)]),_:1})]),oe(I(ks),{class:"sr-only"},{default:me(()=>[...E[1]||(E[1]=[Se("Task details",-1)])]),_:1})]),_:1})):he("",!0),e.task&&I(d)==="diff"&&I(f)&&e.repoId?(q(),ee("div",Iv,[oe(w,{"repo-id":e.repoId,"commit-sha":I(f),"repo-path":I(h)||void 0,class:"h-full",onClose:N},null,8,["repo-id","commit-sha","repo-path"])])):e.task?(q(),ee("div",Pv,[Z("div",Tv,[oe(I(vn),{variant:I(o).variant},{default:me(()=>[oe(I(Ks),{class:"mr-1 size-3"}),Se(" "+fe(I(o).label),1)]),_:1},8,["variant"]),oe(I(vn),{variant:"outline",class:ze(I(r).class)},{default:me(()=>[oe(I(It),{class:"mr-1 size-3"}),Se(" "+fe(I(r).label),1)]),_:1},8,["class"]),oe(I(vn),{variant:"outline",class:ze(I(i).class)},{default:me(()=>[(q(),be(He(I(i).icon),{class:"mr-1 size-3"})),Se(" "+fe(I(i).label),1)]),_:1},8,["class"])]),Z("div",Ov,[E[2]||(E[2]=Z("h4",{class:"text-sm font-medium"},"Description",-1)),Z("p",Dv,fe(e.task.description),1)]),oe(I(Et)),e.task.steps.length>0?(q(),ee("div",zv,[Z("h4",Av,[oe(I(Us),{class:"size-4"}),E[3]||(E[3]=Se(" Steps ",-1))]),Z("ol",Lv,[(q(!0),ee($e,null,Re(e.task.steps,(L,V)=>(q(),ee("li",{key:V,class:"pl-1"},fe(L),1))),128))])])):he("",!0),e.task.steps.length>0&&e.task.passes.length>0?(q(),be(I(Et),{key:1})):he("",!0),e.task.passes.length>0?(q(),ee("div",Bv,[Z("h4",Rv,[oe(I(Zs),{class:"size-4"}),E[4]||(E[4]=Se(" Pass Criteria ",-1))]),Z("ul",Vv,[(q(!0),ee($e,null,Re(e.task.passes,(L,V)=>(q(),ee("li",{key:V,class:"flex items-start gap-2"},[Z("div",{class:ze(["mt-0.5 flex size-4 shrink-0 items-center justify-center rounded border",e.task.status==="completed"?"border-primary bg-primary text-primary-foreground":"border-muted-foreground/50"])},[e.task.status==="completed"?(q(),be(I(Ms),{key:0,class:"size-3"})):he("",!0)],2),Z("span",null,fe(L),1)]))),128))])])):he("",!0),e.task.dependencies.length>0?(q(),be(I(Et),{key:3})):he("",!0),e.task.dependencies.length>0?(q(),ee("div",Hv,[Z("h4",Fv,[oe(I(Xs),{class:"size-4"}),E[5]||(E[5]=Se(" Dependencies ",-1))]),Z("ul",Gv,[(q(!0),ee($e,null,Re(e.task.dependencies,L=>(q(),ee("li",{key:L,class:"flex items-center gap-2"},[Z("span",Yv,fe(L),1),Z("span",null,fe(l(L)),1)]))),128))])])):he("",!0),I(a)?(q(),ee($e,{key:5},[oe(I(Et)),Z("div",jv,[Z("h4",Xv,[oe(I(zs),{class:"size-4"}),E[6]||(E[6]=Se(" Changes ",-1))]),oe(p,{commits:e.commits,"repo-id":e.repoId,onSelect:k},null,8,["commits","repo-id"])])],64)):he("",!0),e.task.startedAt||e.task.completedAt?(q(),ee("div",Wv,[oe(I(Et)),Z("div",Uv,[e.task.startedAt?(q(),ee("div",qv,[oe(I(Os),{class:"size-3"}),Z("span",null,"Started: "+fe(s(e.task.startedAt)),1)])):he("",!0),e.task.completedAt?(q(),ee("div",Zv,[oe(I(En),{class:"size-3"}),Z("span",null,"Completed: "+fe(s(e.task.completedAt)),1)])):he("",!0)])])):he("",!0),I(u)?(q(),ee("div",Kv,[oe(I(Et)),Z("div",Qv,[Z("span",Jv,"This task belongs to "+fe(e.taskPrdSlug)+".",1),oe(g,{to:I(c)},{default:me(()=>[oe(I(ct),{variant:"outline",size:"sm",class:"h-8"},{default:me(()=>[oe(I(As),{class:"mr-1.5 size-3.5"}),E[7]||(E[7]=Se(" Open PRD ",-1))]),_:1})]),_:1},8,["to"])])])):he("",!0)])):he("",!0),oe(I(Ss),{class:"px-6 pb-6"},{default:me(()=>[oe(I(Ns),{"as-child":""},{default:me(()=>[oe(I(ct),{variant:"outline",class:"w-full"},{default:me(()=>[...E[8]||(E[8]=[Se("Close",-1)])]),_:1})]),_:1})]),_:1})]),_:1},8,["class"])]),_:1},8,["open"])}}}),lm=Object.assign(em,{__name:"TasksDetail"});export{Os as C,As as E,qs as M,lm as _,Gt as a,En as b,am as c};
|