@thxgg/steward 0.1.15 → 0.1.17

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (158) hide show
  1. package/.env.example +6 -0
  2. package/.output/nitro.json +1 -1
  3. package/.output/public/_nuxt/{qKRNa41x.js → 4r0X30JV.js} +1 -1
  4. package/.output/public/_nuxt/{uTyw4SRK.js → BMdjSp24.js} +1 -1
  5. package/.output/public/_nuxt/{BubpH_wW.js → BSZqAKg4.js} +1 -1
  6. package/.output/public/_nuxt/{nYTZJhvT.js → BdjPva1I.js} +1 -1
  7. package/.output/public/_nuxt/Beeir9iR.js +1 -0
  8. package/.output/public/_nuxt/Bh3vsUvl.js +1 -0
  9. package/.output/public/_nuxt/{CMu9GKTH.js → BlTKcjLJ.js} +2 -2
  10. package/.output/public/_nuxt/{BDqHART1.js → By7gAVcL.js} +1 -1
  11. package/.output/public/_nuxt/CbJfCtEa.js +1 -0
  12. package/.output/public/_nuxt/CbkpNvIu.js +141 -0
  13. package/.output/public/_nuxt/CmhLcqDu.js +1 -0
  14. package/.output/public/_nuxt/DC6iPLz1.js +30 -0
  15. package/.output/public/_nuxt/{C_NevjZD.js → DD--ojY9.js} +1 -1
  16. package/.output/public/_nuxt/Detail.DSyVQNdr.css +1 -0
  17. package/.output/public/_nuxt/DhKWRjCh.js +60 -0
  18. package/.output/public/_nuxt/_prd_.BkpxMFSV.css +1 -0
  19. package/.output/public/_nuxt/builds/latest.json +1 -1
  20. package/.output/public/_nuxt/builds/meta/f3f42dbd-d501-442b-871c-3d06157e7aa1.json +1 -0
  21. package/.output/public/_nuxt/c1sXju8w.js +1 -0
  22. package/.output/public/_nuxt/eGCjCghR.js +1 -0
  23. package/.output/public/_nuxt/nX8Sf7cz.js +13 -0
  24. package/.output/server/chunks/_/git-api.mjs +100 -7
  25. package/.output/server/chunks/_/git-api.mjs.map +1 -1
  26. package/.output/server/chunks/_/git.mjs +3 -10
  27. package/.output/server/chunks/_/git.mjs.map +1 -1
  28. package/.output/server/chunks/_/prd-service.mjs +234 -0
  29. package/.output/server/chunks/_/prd-service.mjs.map +1 -0
  30. package/.output/server/chunks/_/task-graph.mjs +3 -3
  31. package/.output/server/chunks/_/task-graph.mjs.map +1 -1
  32. package/.output/server/chunks/_/watcher.mjs +26 -46
  33. package/.output/server/chunks/_/watcher.mjs.map +1 -1
  34. package/.output/server/chunks/build/{Detail-DC-KJQ1f.mjs → Detail-MGwP_u2d.mjs} +63 -34
  35. package/.output/server/chunks/build/Detail-MGwP_u2d.mjs.map +1 -0
  36. package/.output/server/chunks/build/DiffViewer-styles-1.mjs-BFsE2PCW.mjs +4 -0
  37. package/.output/server/chunks/build/DiffViewer-styles-1.mjs-BFsE2PCW.mjs.map +1 -0
  38. package/.output/server/chunks/build/DiffViewer-styles.D2bqX3nK.mjs +8 -0
  39. package/.output/server/chunks/build/DiffViewer-styles.D2bqX3nK.mjs.map +1 -0
  40. package/.output/server/chunks/build/DiffViewer-styles.FoV36wuV.mjs +10 -0
  41. package/.output/server/chunks/build/DiffViewer-styles.FoV36wuV.mjs.map +1 -0
  42. package/.output/server/chunks/build/Viewer-styles.D6wYWFb1.mjs +8 -0
  43. package/.output/server/chunks/build/Viewer-styles.D6wYWFb1.mjs.map +1 -0
  44. package/.output/server/chunks/build/{_prd_-C1C4GAhW.mjs → _prd_-C-Aj4fVa.mjs} +75 -33
  45. package/.output/server/chunks/build/_prd_-C-Aj4fVa.mjs.map +1 -0
  46. package/.output/server/chunks/build/client.precomputed.mjs +1 -1
  47. package/.output/server/chunks/build/{default-DWCOHHTE.mjs → default-Cao5eO80.mjs} +4 -3
  48. package/.output/server/chunks/build/default-Cao5eO80.mjs.map +1 -0
  49. package/.output/server/chunks/build/error-404-Bf6kdO80.mjs +2 -1
  50. package/.output/server/chunks/build/error-500-D_bcARXN.mjs +2 -1
  51. package/.output/server/chunks/build/{index-CckL_NBD.mjs → index-ByZO4Bvq.mjs} +2 -2
  52. package/.output/server/chunks/build/index-ByZO4Bvq.mjs.map +1 -0
  53. package/.output/server/chunks/build/{index-QVeSHT3L.mjs → index-ljj9uTXI.mjs} +8 -5
  54. package/.output/server/chunks/build/index-ljj9uTXI.mjs.map +1 -0
  55. package/.output/server/chunks/build/nuxt-link-SvT1nf8Z.mjs +1 -1
  56. package/.output/server/chunks/build/{repo-graph-CTEkxiYd.mjs → repo-graph-EuhMeFt7.mjs} +25 -10
  57. package/.output/server/chunks/build/repo-graph-EuhMeFt7.mjs.map +1 -0
  58. package/.output/server/chunks/build/server.mjs +7 -6
  59. package/.output/server/chunks/build/styles.mjs +4 -4
  60. package/.output/server/chunks/build/{usePrd-SqcxGyFU.mjs → usePrd-f7ylhIqs.mjs} +10 -34
  61. package/.output/server/chunks/build/usePrd-f7ylhIqs.mjs.map +1 -0
  62. package/.output/server/chunks/nitro/nitro.mjs +1149 -720
  63. package/.output/server/chunks/nitro/nitro.mjs.map +1 -1
  64. package/.output/server/chunks/routes/api/browse.get.mjs +12 -6
  65. package/.output/server/chunks/routes/api/browse.get.mjs.map +1 -1
  66. package/.output/server/chunks/routes/api/index.get.mjs +2 -1
  67. package/.output/server/chunks/routes/api/index.get.mjs.map +1 -1
  68. package/.output/server/chunks/routes/api/index.post.mjs +3 -2
  69. package/.output/server/chunks/routes/api/index.post.mjs.map +1 -1
  70. package/.output/server/chunks/routes/api/repos/_repoId/git/commits.get.mjs +11 -13
  71. package/.output/server/chunks/routes/api/repos/_repoId/git/commits.get.mjs.map +1 -1
  72. package/.output/server/chunks/routes/api/repos/_repoId/git/diff.get.mjs +11 -6
  73. package/.output/server/chunks/routes/api/repos/_repoId/git/diff.get.mjs.map +1 -1
  74. package/.output/server/chunks/routes/api/repos/_repoId/git/file-content.get.mjs +31 -12
  75. package/.output/server/chunks/routes/api/repos/_repoId/git/file-content.get.mjs.map +1 -1
  76. package/.output/server/chunks/routes/api/repos/_repoId/git/file-diff.get.mjs +13 -13
  77. package/.output/server/chunks/routes/api/repos/_repoId/git/file-diff.get.mjs.map +1 -1
  78. package/.output/server/chunks/routes/api/repos/_repoId/graph.get.mjs +5 -1
  79. package/.output/server/chunks/routes/api/repos/_repoId/graph.get.mjs.map +1 -1
  80. package/.output/server/chunks/routes/api/repos/_repoId/prd/_prdSlug/graph.get.mjs +14 -1
  81. package/.output/server/chunks/routes/api/repos/_repoId/prd/_prdSlug/graph.get.mjs.map +1 -1
  82. package/.output/server/chunks/routes/api/repos/_repoId/prd/_prdSlug/progress.get.mjs +20 -9
  83. package/.output/server/chunks/routes/api/repos/_repoId/prd/_prdSlug/progress.get.mjs.map +1 -1
  84. package/.output/server/chunks/routes/api/repos/_repoId/prd/_prdSlug/tasks/_taskId/commits.get.mjs +20 -85
  85. package/.output/server/chunks/routes/api/repos/_repoId/prd/_prdSlug/tasks/_taskId/commits.get.mjs.map +1 -1
  86. package/.output/server/chunks/routes/api/repos/_repoId/prd/_prdSlug/tasks.get.mjs +20 -9
  87. package/.output/server/chunks/routes/api/repos/_repoId/prd/_prdSlug/tasks.get.mjs.map +1 -1
  88. package/.output/server/chunks/routes/api/repos/_repoId/prd/_prdSlug_.get.mjs +30 -50
  89. package/.output/server/chunks/routes/api/repos/_repoId/prd/_prdSlug_.get.mjs.map +1 -1
  90. package/.output/server/chunks/routes/api/repos/_repoId/prds.get.mjs +19 -49
  91. package/.output/server/chunks/routes/api/repos/_repoId/prds.get.mjs.map +1 -1
  92. package/.output/server/chunks/routes/api/repos/_repoId/refresh-git-repos.post.mjs +6 -13
  93. package/.output/server/chunks/routes/api/repos/_repoId/refresh-git-repos.post.mjs.map +1 -1
  94. package/.output/server/chunks/routes/api/repos/_repoId_.delete.mjs +2 -1
  95. package/.output/server/chunks/routes/api/repos/_repoId_.delete.mjs.map +1 -1
  96. package/.output/server/chunks/routes/api/runtime.get.mjs +3 -2
  97. package/.output/server/chunks/routes/api/runtime.get.mjs.map +1 -1
  98. package/.output/server/chunks/routes/api/watch.get.mjs +5 -4
  99. package/.output/server/chunks/routes/api/watch.get.mjs.map +1 -1
  100. package/.output/server/chunks/routes/renderer.mjs +1 -1
  101. package/.output/server/index.mjs +3 -2
  102. package/.output/server/index.mjs.map +1 -1
  103. package/.output/server/node_modules/zod/index.js +4 -0
  104. package/.output/server/node_modules/zod/package.json +118 -0
  105. package/.output/server/node_modules/zod/v3/ZodError.js +133 -0
  106. package/.output/server/node_modules/zod/v3/errors.js +9 -0
  107. package/.output/server/node_modules/zod/v3/external.js +6 -0
  108. package/.output/server/node_modules/zod/v3/helpers/errorUtil.js +6 -0
  109. package/.output/server/node_modules/zod/v3/helpers/parseUtil.js +109 -0
  110. package/.output/server/node_modules/zod/v3/helpers/typeAliases.js +1 -0
  111. package/.output/server/node_modules/zod/v3/helpers/util.js +133 -0
  112. package/.output/server/node_modules/zod/v3/locales/en.js +109 -0
  113. package/.output/server/node_modules/zod/v3/types.js +3693 -0
  114. package/.output/server/package.json +2 -1
  115. package/README.md +7 -2
  116. package/dist/host/src/api/prds.js +6 -172
  117. package/dist/host/src/api/repos.js +3 -16
  118. package/dist/host/src/api/state.js +7 -2
  119. package/dist/host/src/executor-runner.js +368 -0
  120. package/dist/host/src/executor.js +138 -260
  121. package/dist/host/src/index.js +7 -2
  122. package/dist/host/src/mcp.js +27 -1
  123. package/dist/host/src/ui.js +18 -3
  124. package/dist/server/utils/change-events.js +33 -0
  125. package/dist/server/utils/git.js +11 -16
  126. package/dist/server/utils/prd-service.js +235 -0
  127. package/dist/server/utils/prd-state.js +57 -45
  128. package/dist/server/utils/repos.js +58 -13
  129. package/dist/server/utils/state-schema.js +61 -0
  130. package/dist/server/utils/task-graph.js +2 -2
  131. package/package.json +2 -1
  132. package/.output/public/_nuxt/-k8zG74W.js +0 -61
  133. package/.output/public/_nuxt/B-5VWizU.js +0 -1
  134. package/.output/public/_nuxt/BMAq0QVD.js +0 -42
  135. package/.output/public/_nuxt/BPeTf9dd.js +0 -1
  136. package/.output/public/_nuxt/C2HGkiSP.js +0 -1
  137. package/.output/public/_nuxt/CVvrkZkq.js +0 -1
  138. package/.output/public/_nuxt/Detail.CzXXlavD.css +0 -1
  139. package/.output/public/_nuxt/_prd_.KTotLoF_.css +0 -1
  140. package/.output/public/_nuxt/builds/meta/c1a7997d-8d53-4718-ad03-a977e05e2523.json +0 -1
  141. package/.output/public/_nuxt/qt5OEWHC.js +0 -1
  142. package/.output/public/_nuxt/wbj-mIhK.js +0 -1
  143. package/.output/server/chunks/build/Detail-DC-KJQ1f.mjs.map +0 -1
  144. package/.output/server/chunks/build/DiffViewer-styles-1.mjs-D0sb4vsK.mjs +0 -4
  145. package/.output/server/chunks/build/DiffViewer-styles-1.mjs-D0sb4vsK.mjs.map +0 -1
  146. package/.output/server/chunks/build/DiffViewer-styles.CkSjCQ0r.mjs +0 -10
  147. package/.output/server/chunks/build/DiffViewer-styles.CkSjCQ0r.mjs.map +0 -1
  148. package/.output/server/chunks/build/DiffViewer-styles.FJJuYjYB.mjs +0 -8
  149. package/.output/server/chunks/build/DiffViewer-styles.FJJuYjYB.mjs.map +0 -1
  150. package/.output/server/chunks/build/Viewer-styles.CshnetGw.mjs +0 -8
  151. package/.output/server/chunks/build/Viewer-styles.CshnetGw.mjs.map +0 -1
  152. package/.output/server/chunks/build/_prd_-C1C4GAhW.mjs.map +0 -1
  153. package/.output/server/chunks/build/default-DWCOHHTE.mjs.map +0 -1
  154. package/.output/server/chunks/build/index-CckL_NBD.mjs.map +0 -1
  155. package/.output/server/chunks/build/index-QVeSHT3L.mjs.map +0 -1
  156. package/.output/server/chunks/build/repo-graph-CTEkxiYd.mjs.map +0 -1
  157. package/.output/server/chunks/build/usePrd-SqcxGyFU.mjs.map +0 -1
  158. package/.output/server/node_modules/shiki/dist/bundle-web.mjs +0 -366
@@ -0,0 +1,30 @@
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./CbkpNvIu.js","./nX8Sf7cz.js","./BlTKcjLJ.js","./entry.LcDOtJnR.css"])))=>i.map(i=>d[i]);
2
+ import{c as Oe,f as ka,t as Sa,g as Ca,h as Na,P as uo,i as $a,j as Hi,d as Ma,k as Or,l as Ta,B as bt,r as Gi,e as qi,b as Oa,F as Pa}from"./CmhLcqDu.js";import{N as Ho,q as ce,z as je,s as ne,g as ve,y as xe,O as ji,o as j,x as we,w as fe,l as k,c as ee,L as He,k as _e,P as ur,Q as dn,R as Bt,C as dt,b as oe,E as Re,S as Ia,J as co,K as fo,v as Yi,d as Se,t as he,p as Da,I as Ge,T as Aa,U as za,A as Wi,i as tn,V as Xi,H as Ae,W as Ba,a as Z,F as Me,r as qe,B as pt,D as Ui,X as Ra,n as ge,Y as $e,Z as nn,_ as Wt,$ as Ce,a0 as Ee,a1 as La,m as cr,a2 as Va,a3 as an,a4 as Ht,a5 as Fa,a6 as Zi,a7 as Ha,a8 as Ga,a9 as qa,aa as ja,ab as Ya}from"./BlTKcjLJ.js";import{c as ho,b as Ke,V as Wa,D as Xa,e as Ua,d as dr,P as Za,T as Ka,a as Ja,L as Go,C as Yn,G as Qa,f as el,R as Pr,K as tl,S as nl,g as ol,B as Vn,h as rl,i as il,j as sl,k as al,l as ll,m as ul,n as cl,o as dl,p as fl}from"./DD--ojY9.js";import{A as Ir}from"./BdjPva1I.js";import{_ as hl}from"./DlAUqK2U.js";import{_ as pl}from"./Beeir9iR.js";const gl=Oe("arrow-left",[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]]);const vl=Oe("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 Wn=Oe("circle-check",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]]);const fn=Oe("circle",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]]);const Ki=Oe("clock-3",[["path",{d:"M12 6v6h4",key:"135r8i"}],["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]]);const ml=Oe("clock",[["path",{d:"M12 6v6l4 2",key:"mmk7yg"}],["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]]);const yl=Oe("diff",[["path",{d:"M12 3v14",key:"7cf3v8"}],["path",{d:"M5 10h14",key:"elsbfy"}],["path",{d:"M5 21h14",key:"11awu3"}]]);const wl=Oe("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 _l=Oe("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 xl=Oe("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 bl=Oe("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 El=Oe("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 kl=Oe("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 Sl=Oe("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 Cl=Oe("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 Nl=Oe("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 $l=Oe("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 Ml=Oe("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 Tl=Oe("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 Ol=Oe("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 Pl=Oe("minus",[["path",{d:"M5 12h14",key:"1ays0h"}]]);const Il=Oe("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 Dl=Oe("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"}]]);const Xt=Oe("triangle-alert",[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]]);function Al(e,t){const n=ka(!1,300);Sa(()=>{n.value=!1});const o=ce(null),r=Ca();function i(){o.value=null,n.value=!1}function s(a,l){const c=a.currentTarget,u={x:a.clientX,y:a.clientY},d=zl(u,c.getBoundingClientRect()),h=Bl(u,d,1),f=Rl(l.getBoundingClientRect()),g=Vl([...h,...f]);o.value=g,n.value=!0}return Ho(a=>{if(e.value&&t.value){const l=u=>s(u,t.value),c=u=>s(u,e.value);e.value.addEventListener("pointerleave",l),t.value.addEventListener("pointerleave",c),a(()=>{e.value?.removeEventListener("pointerleave",l),t.value?.removeEventListener("pointerleave",c)})}}),Ho(a=>{if(o.value){const l=c=>{if(!o.value||!(c.target instanceof Element))return;const u=c.target,d={x:c.clientX,y:c.clientY},h=e.value?.contains(u)||t.value?.contains(u),f=!Ll(d,o.value),g=!!u.closest("[data-grace-area-trigger]");h?i():(f||g)&&(i(),r.trigger())};e.value?.ownerDocument.addEventListener("pointermove",l),a(()=>e.value?.ownerDocument.removeEventListener("pointermove",l))}}),{isPointerInTransit:n,onPointerExit:r.on}}function zl(e,t){const n=Math.abs(t.top-e.y),o=Math.abs(t.bottom-e.y),r=Math.abs(t.right-e.x),i=Math.abs(t.left-e.x);switch(Math.min(n,o,r,i)){case i:return"left";case r:return"right";case n:return"top";case o:return"bottom";default:throw new Error("unreachable")}}function Bl(e,t,n=5){const o=[];switch(t){case"top":o.push({x:e.x-n,y:e.y+n},{x:e.x+n,y:e.y+n});break;case"bottom":o.push({x:e.x-n,y:e.y-n},{x:e.x+n,y:e.y-n});break;case"left":o.push({x:e.x+n,y:e.y-n},{x:e.x+n,y:e.y+n});break;case"right":o.push({x:e.x-n,y:e.y-n},{x:e.x-n,y:e.y+n});break}return o}function Rl(e){const{top:t,right:n,bottom:o,left:r}=e;return[{x:r,y:t},{x:n,y:t},{x:n,y:o},{x:r,y:o}]}function Ll(e,t){const{x:n,y:o}=e;let r=!1;for(let i=0,s=t.length-1;i<t.length;s=i++){const a=t[i].x,l=t[i].y,c=t[s].x,u=t[s].y;l>o!=u>o&&n<(c-a)*(o-l)/(u-l)+a&&(r=!r)}return r}function Vl(e){const t=e.slice();return t.sort((n,o)=>n.x<o.x?-1:n.x>o.x?1:n.y<o.y?-1:n.y>o.y?1:0),Fl(t)}function Fl(e){if(e.length<=1)return e.slice();const t=[];for(let o=0;o<e.length;o++){const r=e[o];for(;t.length>=2;){const i=t[t.length-1],s=t[t.length-2];if((i.x-s.x)*(r.y-s.y)>=(i.y-s.y)*(r.x-s.x))t.pop();else break}t.push(r)}t.pop();const n=[];for(let o=e.length-1;o>=0;o--){const r=e[o];for(;n.length>=2;){const i=n[n.length-1],s=n[n.length-2];if((i.x-s.x)*(r.y-s.y)>=(i.y-s.y)*(r.x-s.x))n.pop();else break}n.push(r)}return n.pop(),t.length===1&&n.length===1&&t[0].x===n[0].x&&t[0].y===n[0].y?t:t.concat(n)}function Hl(e){const t=ce(),n=ne(()=>t.value?.width??0),o=ne(()=>t.value?.height??0);return je(()=>{const r=Na(e);if(r){t.value={width:r.offsetWidth,height:r.offsetHeight};const i=new ResizeObserver(s=>{if(!Array.isArray(s)||!s.length)return;const a=s[0];let l,c;if("borderBoxSize"in a){const u=a.borderBoxSize,d=Array.isArray(u)?u[0]:u;l=d.inlineSize,c=d.blockSize}else l=r.offsetWidth,c=r.offsetHeight;t.value={width:l,height:c}});return i.observe(r,{box:"border-box"}),()=>i.unobserve(r)}else t.value=void 0}),{width:n,height:o}}const[Ji,Gl]=ho("PopperRoot");var ql=ve({inheritAttrs:!1,__name:"PopperRoot",setup(e){const t=ce();return Gl({anchor:t,onAnchorChange:n=>t.value=n}),(n,o)=>xe(n.$slots,"default")}}),jl=ql,Yl=ve({__name:"PopperAnchor",props:{reference:{type:null,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},setup(e){const t=e,{forwardRef:n,currentElement:o}=Ke(),r=Ji();return ji(()=>{r.onAnchorChange(t.reference??o.value)}),(i,s)=>(j(),we(k(uo),{ref:k(n),as:i.as,"as-child":i.asChild},{default:fe(()=>[xe(i.$slots,"default")]),_:3},8,["as","as-child"]))}}),Wl=Yl;const Xl={key:0,d:"M0 0L6 6L12 0"},Ul={key:1,d:"M0 0L4.58579 4.58579C5.36683 5.36683 6.63316 5.36684 7.41421 4.58579L12 0"};var Zl=ve({__name:"Arrow",props:{width:{type:Number,required:!1,default:10},height:{type:Number,required:!1,default:5},rounded:{type:Boolean,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:"svg"}},setup(e){const t=e;return Ke(),(n,o)=>(j(),we(k(uo),He(t,{width:n.width,height:n.height,viewBox:n.asChild?void 0:"0 0 12 6",preserveAspectRatio:n.asChild?void 0:"none"}),{default:fe(()=>[xe(n.$slots,"default",{},()=>[n.rounded?(j(),ee("path",Ul)):(j(),ee("path",Xl))])]),_:3},16,["width","height","viewBox","preserveAspectRatio"]))}}),Kl=Zl;function Jl(e){return e!==null}function Ql(e){return{name:"transformOrigin",options:e,fn(t){const{placement:n,rects:o,middlewareData:r}=t,s=r.arrow?.centerOffset!==0,a=s?0:e.arrowWidth,l=s?0:e.arrowHeight,[c,u]=qo(n),d={start:"0%",center:"50%",end:"100%"}[u],h=(r.arrow?.x??0)+a/2,f=(r.arrow?.y??0)+l/2;let g="",y="";return c==="bottom"?(g=s?d:`${h}px`,y=`${-l}px`):c==="top"?(g=s?d:`${h}px`,y=`${o.floating.height+l}px`):c==="right"?(g=`${-l}px`,y=s?d:`${f}px`):c==="left"&&(g=`${o.floating.width+l}px`,y=s?d:`${f}px`),{data:{x:g,y}}}}}function qo(e){const[t,n="center"]=e.split("-");return[t,n]}const eu=["top","right","bottom","left"],Et=Math.min,Le=Math.max,Xn=Math.round,Mn=Math.floor,rt=e=>({x:e,y:e}),tu={left:"right",right:"left",bottom:"top",top:"bottom"},nu={start:"end",end:"start"};function jo(e,t,n){return Le(e,Et(t,n))}function gt(e,t){return typeof e=="function"?e(t):e}function vt(e){return e.split("-")[0]}function on(e){return e.split("-")[1]}function fr(e){return e==="x"?"y":"x"}function hr(e){return e==="y"?"height":"width"}const ou=new Set(["top","bottom"]);function ot(e){return ou.has(vt(e))?"y":"x"}function pr(e){return fr(ot(e))}function ru(e,t,n){n===void 0&&(n=!1);const o=on(e),r=pr(e),i=hr(r);let s=r==="x"?o===(n?"end":"start")?"right":"left":o==="start"?"bottom":"top";return t.reference[i]>t.floating[i]&&(s=Un(s)),[s,Un(s)]}function iu(e){const t=Un(e);return[Yo(e),t,Yo(t)]}function Yo(e){return e.replace(/start|end/g,t=>nu[t])}const Dr=["left","right"],Ar=["right","left"],su=["top","bottom"],au=["bottom","top"];function lu(e,t,n){switch(e){case"top":case"bottom":return n?t?Ar:Dr:t?Dr:Ar;case"left":case"right":return t?su:au;default:return[]}}function uu(e,t,n,o){const r=on(e);let i=lu(vt(e),n==="start",o);return r&&(i=i.map(s=>s+"-"+r),t&&(i=i.concat(i.map(Yo)))),i}function Un(e){return e.replace(/left|right|bottom|top/g,t=>tu[t])}function cu(e){return{top:0,right:0,bottom:0,left:0,...e}}function Qi(e){return typeof e!="number"?cu(e):{top:e,right:e,bottom:e,left:e}}function Zn(e){const{x:t,y:n,width:o,height:r}=e;return{width:o,height:r,top:n,left:t,right:t+o,bottom:n+r,x:t,y:n}}function zr(e,t,n){let{reference:o,floating:r}=e;const i=ot(t),s=pr(t),a=hr(s),l=vt(t),c=i==="y",u=o.x+o.width/2-r.width/2,d=o.y+o.height/2-r.height/2,h=o[a]/2-r[a]/2;let f;switch(l){case"top":f={x:u,y:o.y-r.height};break;case"bottom":f={x:u,y:o.y+o.height};break;case"right":f={x:o.x+o.width,y:d};break;case"left":f={x:o.x-r.width,y:d};break;default:f={x:o.x,y:o.y}}switch(on(t)){case"start":f[s]-=h*(n&&c?-1:1);break;case"end":f[s]+=h*(n&&c?-1:1);break}return f}async function du(e,t){var n;t===void 0&&(t={});const{x:o,y:r,platform:i,rects:s,elements:a,strategy:l}=e,{boundary:c="clippingAncestors",rootBoundary:u="viewport",elementContext:d="floating",altBoundary:h=!1,padding:f=0}=gt(t,e),g=Qi(f),w=a[h?d==="floating"?"reference":"floating":d],b=Zn(await i.getClippingRect({element:(n=await(i.isElement==null?void 0:i.isElement(w)))==null||n?w:w.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(a.floating)),boundary:c,rootBoundary:u,strategy:l})),E=d==="floating"?{x:o,y:r,width:s.floating.width,height:s.floating.height}:s.reference,v=await(i.getOffsetParent==null?void 0:i.getOffsetParent(a.floating)),m=await(i.isElement==null?void 0:i.isElement(v))?await(i.getScale==null?void 0:i.getScale(v))||{x:1,y:1}:{x:1,y:1},T=Zn(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:a,rect:E,offsetParent:v,strategy:l}):E);return{top:(b.top-T.top+g.top)/m.y,bottom:(T.bottom-b.bottom+g.bottom)/m.y,left:(b.left-T.left+g.left)/m.x,right:(T.right-b.right+g.right)/m.x}}const fu=async(e,t,n)=>{const{placement:o="bottom",strategy:r="absolute",middleware:i=[],platform:s}=n,a=i.filter(Boolean),l=await(s.isRTL==null?void 0:s.isRTL(t));let c=await s.getElementRects({reference:e,floating:t,strategy:r}),{x:u,y:d}=zr(c,o,l),h=o,f={},g=0;for(let w=0;w<a.length;w++){var y;const{name:b,fn:E}=a[w],{x:v,y:m,data:T,reset:B}=await E({x:u,y:d,initialPlacement:o,placement:h,strategy:r,middlewareData:f,rects:c,platform:{...s,detectOverflow:(y=s.detectOverflow)!=null?y:du},elements:{reference:e,floating:t}});u=v??u,d=m??d,f={...f,[b]:{...f[b],...T}},B&&g<=50&&(g++,typeof B=="object"&&(B.placement&&(h=B.placement),B.rects&&(c=B.rects===!0?await s.getElementRects({reference:e,floating:t,strategy:r}):B.rects),{x:u,y:d}=zr(c,h,l)),w=-1)}return{x:u,y:d,placement:h,strategy:r,middlewareData:f}},hu=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:o,placement:r,rects:i,platform:s,elements:a,middlewareData:l}=t,{element:c,padding:u=0}=gt(e,t)||{};if(c==null)return{};const d=Qi(u),h={x:n,y:o},f=pr(r),g=hr(f),y=await s.getDimensions(c),w=f==="y",b=w?"top":"left",E=w?"bottom":"right",v=w?"clientHeight":"clientWidth",m=i.reference[g]+i.reference[f]-h[f]-i.floating[g],T=h[f]-i.reference[f],B=await(s.getOffsetParent==null?void 0:s.getOffsetParent(c));let H=B?B[v]:0;(!H||!await(s.isElement==null?void 0:s.isElement(B)))&&(H=a.floating[v]||i.floating[g]);const F=m/2-T/2,K=H/2-y[g]/2-1,I=Et(d[b],K),A=Et(d[E],K),S=I,C=H-y[g]-A,p=H/2-y[g]/2+F,N=jo(S,p,C),_=!l.arrow&&on(r)!=null&&p!==N&&i.reference[g]/2-(p<S?I:A)-y[g]/2<0,$=_?p<S?p-S:p-C:0;return{[f]:h[f]+$,data:{[f]:N,centerOffset:p-N-$,..._&&{alignmentOffset:$}},reset:_}}}),pu=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n,o;const{placement:r,middlewareData:i,rects:s,initialPlacement:a,platform:l,elements:c}=t,{mainAxis:u=!0,crossAxis:d=!0,fallbackPlacements:h,fallbackStrategy:f="bestFit",fallbackAxisSideDirection:g="none",flipAlignment:y=!0,...w}=gt(e,t);if((n=i.arrow)!=null&&n.alignmentOffset)return{};const b=vt(r),E=ot(a),v=vt(a)===a,m=await(l.isRTL==null?void 0:l.isRTL(c.floating)),T=h||(v||!y?[Un(a)]:iu(a)),B=g!=="none";!h&&B&&T.push(...uu(a,y,g,m));const H=[a,...T],F=await l.detectOverflow(t,w),K=[];let I=((o=i.flip)==null?void 0:o.overflows)||[];if(u&&K.push(F[b]),d){const p=ru(r,s,m);K.push(F[p[0]],F[p[1]])}if(I=[...I,{placement:r,overflows:K}],!K.every(p=>p<=0)){var A,S;const p=(((A=i.flip)==null?void 0:A.index)||0)+1,N=H[p];if(N&&(!(d==="alignment"?E!==ot(N):!1)||I.every(P=>ot(P.placement)===E?P.overflows[0]>0:!0)))return{data:{index:p,overflows:I},reset:{placement:N}};let _=(S=I.filter($=>$.overflows[0]<=0).sort(($,P)=>$.overflows[1]-P.overflows[1])[0])==null?void 0:S.placement;if(!_)switch(f){case"bestFit":{var C;const $=(C=I.filter(P=>{if(B){const G=ot(P.placement);return G===E||G==="y"}return!0}).map(P=>[P.placement,P.overflows.filter(G=>G>0).reduce((G,L)=>G+L,0)]).sort((P,G)=>P[1]-G[1])[0])==null?void 0:C[0];$&&(_=$);break}case"initialPlacement":_=a;break}if(r!==_)return{reset:{placement:_}}}return{}}}};function Br(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function Rr(e){return eu.some(t=>e[t]>=0)}const gu=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n,platform:o}=t,{strategy:r="referenceHidden",...i}=gt(e,t);switch(r){case"referenceHidden":{const s=await o.detectOverflow(t,{...i,elementContext:"reference"}),a=Br(s,n.reference);return{data:{referenceHiddenOffsets:a,referenceHidden:Rr(a)}}}case"escaped":{const s=await o.detectOverflow(t,{...i,altBoundary:!0}),a=Br(s,n.floating);return{data:{escapedOffsets:a,escaped:Rr(a)}}}default:return{}}}}},es=new Set(["left","top"]);async function vu(e,t){const{placement:n,platform:o,elements:r}=e,i=await(o.isRTL==null?void 0:o.isRTL(r.floating)),s=vt(n),a=on(n),l=ot(n)==="y",c=es.has(s)?-1:1,u=i&&l?-1:1,d=gt(t,e);let{mainAxis:h,crossAxis:f,alignmentAxis:g}=typeof d=="number"?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return a&&typeof g=="number"&&(f=a==="end"?g*-1:g),l?{x:f*u,y:h*c}:{x:h*c,y:f*u}}const mu=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,o;const{x:r,y:i,placement:s,middlewareData:a}=t,l=await vu(t,e);return s===((n=a.offset)==null?void 0:n.placement)&&(o=a.arrow)!=null&&o.alignmentOffset?{}:{x:r+l.x,y:i+l.y,data:{...l,placement:s}}}}},yu=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:o,placement:r,platform:i}=t,{mainAxis:s=!0,crossAxis:a=!1,limiter:l={fn:b=>{let{x:E,y:v}=b;return{x:E,y:v}}},...c}=gt(e,t),u={x:n,y:o},d=await i.detectOverflow(t,c),h=ot(vt(r)),f=fr(h);let g=u[f],y=u[h];if(s){const b=f==="y"?"top":"left",E=f==="y"?"bottom":"right",v=g+d[b],m=g-d[E];g=jo(v,g,m)}if(a){const b=h==="y"?"top":"left",E=h==="y"?"bottom":"right",v=y+d[b],m=y-d[E];y=jo(v,y,m)}const w=l.fn({...t,[f]:g,[h]:y});return{...w,data:{x:w.x-n,y:w.y-o,enabled:{[f]:s,[h]:a}}}}}},wu=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:n,y:o,placement:r,rects:i,middlewareData:s}=t,{offset:a=0,mainAxis:l=!0,crossAxis:c=!0}=gt(e,t),u={x:n,y:o},d=ot(r),h=fr(d);let f=u[h],g=u[d];const y=gt(a,t),w=typeof y=="number"?{mainAxis:y,crossAxis:0}:{mainAxis:0,crossAxis:0,...y};if(l){const v=h==="y"?"height":"width",m=i.reference[h]-i.floating[v]+w.mainAxis,T=i.reference[h]+i.reference[v]-w.mainAxis;f<m?f=m:f>T&&(f=T)}if(c){var b,E;const v=h==="y"?"width":"height",m=es.has(vt(r)),T=i.reference[d]-i.floating[v]+(m&&((b=s.offset)==null?void 0:b[d])||0)+(m?0:w.crossAxis),B=i.reference[d]+i.reference[v]+(m?0:((E=s.offset)==null?void 0:E[d])||0)-(m?w.crossAxis:0);g<T?g=T:g>B&&(g=B)}return{[h]:f,[d]:g}}}},_u=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var n,o;const{placement:r,rects:i,platform:s,elements:a}=t,{apply:l=()=>{},...c}=gt(e,t),u=await s.detectOverflow(t,c),d=vt(r),h=on(r),f=ot(r)==="y",{width:g,height:y}=i.floating;let w,b;d==="top"||d==="bottom"?(w=d,b=h===(await(s.isRTL==null?void 0:s.isRTL(a.floating))?"start":"end")?"left":"right"):(b=d,w=h==="end"?"top":"bottom");const E=y-u.top-u.bottom,v=g-u.left-u.right,m=Et(y-u[w],E),T=Et(g-u[b],v),B=!t.middlewareData.shift;let H=m,F=T;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(F=v),(o=t.middlewareData.shift)!=null&&o.enabled.y&&(H=E),B&&!h){const I=Le(u.left,0),A=Le(u.right,0),S=Le(u.top,0),C=Le(u.bottom,0);f?F=g-2*(I!==0||A!==0?I+A:Le(u.left,u.right)):H=y-2*(S!==0||C!==0?S+C:Le(u.top,u.bottom))}await l({...t,availableWidth:F,availableHeight:H});const K=await s.getDimensions(a.floating);return g!==K.width||y!==K.height?{reset:{rects:!0}}:{}}}};function po(){return typeof window<"u"}function zt(e){return gr(e)?(e.nodeName||"").toLowerCase():"#document"}function Ve(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function at(e){var t;return(t=(gr(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function gr(e){return po()?e instanceof Node||e instanceof Ve(e).Node:!1}function Xe(e){return po()?e instanceof Element||e instanceof Ve(e).Element:!1}function st(e){return po()?e instanceof HTMLElement||e instanceof Ve(e).HTMLElement:!1}function Lr(e){return!po()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof Ve(e).ShadowRoot}const xu=new Set(["inline","contents"]);function Sn(e){const{overflow:t,overflowX:n,overflowY:o,display:r}=Ue(e);return/auto|scroll|overlay|hidden|clip/.test(t+o+n)&&!xu.has(r)}const bu=new Set(["table","td","th"]);function Eu(e){return bu.has(zt(e))}const ku=[":popover-open",":modal"];function go(e){return ku.some(t=>{try{return e.matches(t)}catch{return!1}})}const Su=["transform","translate","scale","rotate","perspective"],Cu=["transform","translate","scale","rotate","perspective","filter"],Nu=["paint","layout","strict","content"];function vr(e){const t=mr(),n=Xe(e)?Ue(e):e;return Su.some(o=>n[o]?n[o]!=="none":!1)||(n.containerType?n.containerType!=="normal":!1)||!t&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!t&&(n.filter?n.filter!=="none":!1)||Cu.some(o=>(n.willChange||"").includes(o))||Nu.some(o=>(n.contain||"").includes(o))}function $u(e){let t=kt(e);for(;st(t)&&!Ut(t);){if(vr(t))return t;if(go(t))return null;t=kt(t)}return null}function mr(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const Mu=new Set(["html","body","#document"]);function Ut(e){return Mu.has(zt(e))}function Ue(e){return Ve(e).getComputedStyle(e)}function vo(e){return Xe(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function kt(e){if(zt(e)==="html")return e;const t=e.assignedSlot||e.parentNode||Lr(e)&&e.host||at(e);return Lr(t)?t.host:t}function ts(e){const t=kt(e);return Ut(t)?e.ownerDocument?e.ownerDocument.body:e.body:st(t)&&Sn(t)?t:ts(t)}function vn(e,t,n){var o;t===void 0&&(t=[]),n===void 0&&(n=!0);const r=ts(e),i=r===((o=e.ownerDocument)==null?void 0:o.body),s=Ve(r);if(i){const a=Wo(s);return t.concat(s,s.visualViewport||[],Sn(r)?r:[],a&&n?vn(a):[])}return t.concat(r,vn(r,[],n))}function Wo(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function ns(e){const t=Ue(e);let n=parseFloat(t.width)||0,o=parseFloat(t.height)||0;const r=st(e),i=r?e.offsetWidth:n,s=r?e.offsetHeight:o,a=Xn(n)!==i||Xn(o)!==s;return a&&(n=i,o=s),{width:n,height:o,$:a}}function yr(e){return Xe(e)?e:e.contextElement}function Gt(e){const t=yr(e);if(!st(t))return rt(1);const n=t.getBoundingClientRect(),{width:o,height:r,$:i}=ns(t);let s=(i?Xn(n.width):n.width)/o,a=(i?Xn(n.height):n.height)/r;return(!s||!Number.isFinite(s))&&(s=1),(!a||!Number.isFinite(a))&&(a=1),{x:s,y:a}}const Tu=rt(0);function os(e){const t=Ve(e);return!mr()||!t.visualViewport?Tu:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function Ou(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==Ve(e)?!1:t}function Pt(e,t,n,o){t===void 0&&(t=!1),n===void 0&&(n=!1);const r=e.getBoundingClientRect(),i=yr(e);let s=rt(1);t&&(o?Xe(o)&&(s=Gt(o)):s=Gt(e));const a=Ou(i,n,o)?os(i):rt(0);let l=(r.left+a.x)/s.x,c=(r.top+a.y)/s.y,u=r.width/s.x,d=r.height/s.y;if(i){const h=Ve(i),f=o&&Xe(o)?Ve(o):o;let g=h,y=Wo(g);for(;y&&o&&f!==g;){const w=Gt(y),b=y.getBoundingClientRect(),E=Ue(y),v=b.left+(y.clientLeft+parseFloat(E.paddingLeft))*w.x,m=b.top+(y.clientTop+parseFloat(E.paddingTop))*w.y;l*=w.x,c*=w.y,u*=w.x,d*=w.y,l+=v,c+=m,g=Ve(y),y=Wo(g)}}return Zn({width:u,height:d,x:l,y:c})}function mo(e,t){const n=vo(e).scrollLeft;return t?t.left+n:Pt(at(e)).left+n}function rs(e,t){const n=e.getBoundingClientRect(),o=n.left+t.scrollLeft-mo(e,n),r=n.top+t.scrollTop;return{x:o,y:r}}function Pu(e){let{elements:t,rect:n,offsetParent:o,strategy:r}=e;const i=r==="fixed",s=at(o),a=t?go(t.floating):!1;if(o===s||a&&i)return n;let l={scrollLeft:0,scrollTop:0},c=rt(1);const u=rt(0),d=st(o);if((d||!d&&!i)&&((zt(o)!=="body"||Sn(s))&&(l=vo(o)),st(o))){const f=Pt(o);c=Gt(o),u.x=f.x+o.clientLeft,u.y=f.y+o.clientTop}const h=s&&!d&&!i?rs(s,l):rt(0);return{width:n.width*c.x,height:n.height*c.y,x:n.x*c.x-l.scrollLeft*c.x+u.x+h.x,y:n.y*c.y-l.scrollTop*c.y+u.y+h.y}}function Iu(e){return Array.from(e.getClientRects())}function Du(e){const t=at(e),n=vo(e),o=e.ownerDocument.body,r=Le(t.scrollWidth,t.clientWidth,o.scrollWidth,o.clientWidth),i=Le(t.scrollHeight,t.clientHeight,o.scrollHeight,o.clientHeight);let s=-n.scrollLeft+mo(e);const a=-n.scrollTop;return Ue(o).direction==="rtl"&&(s+=Le(t.clientWidth,o.clientWidth)-r),{width:r,height:i,x:s,y:a}}const Vr=25;function Au(e,t){const n=Ve(e),o=at(e),r=n.visualViewport;let i=o.clientWidth,s=o.clientHeight,a=0,l=0;if(r){i=r.width,s=r.height;const u=mr();(!u||u&&t==="fixed")&&(a=r.offsetLeft,l=r.offsetTop)}const c=mo(o);if(c<=0){const u=o.ownerDocument,d=u.body,h=getComputedStyle(d),f=u.compatMode==="CSS1Compat"&&parseFloat(h.marginLeft)+parseFloat(h.marginRight)||0,g=Math.abs(o.clientWidth-d.clientWidth-f);g<=Vr&&(i-=g)}else c<=Vr&&(i+=c);return{width:i,height:s,x:a,y:l}}const zu=new Set(["absolute","fixed"]);function Bu(e,t){const n=Pt(e,!0,t==="fixed"),o=n.top+e.clientTop,r=n.left+e.clientLeft,i=st(e)?Gt(e):rt(1),s=e.clientWidth*i.x,a=e.clientHeight*i.y,l=r*i.x,c=o*i.y;return{width:s,height:a,x:l,y:c}}function Fr(e,t,n){let o;if(t==="viewport")o=Au(e,n);else if(t==="document")o=Du(at(e));else if(Xe(t))o=Bu(t,n);else{const r=os(e);o={x:t.x-r.x,y:t.y-r.y,width:t.width,height:t.height}}return Zn(o)}function is(e,t){const n=kt(e);return n===t||!Xe(n)||Ut(n)?!1:Ue(n).position==="fixed"||is(n,t)}function Ru(e,t){const n=t.get(e);if(n)return n;let o=vn(e,[],!1).filter(a=>Xe(a)&&zt(a)!=="body"),r=null;const i=Ue(e).position==="fixed";let s=i?kt(e):e;for(;Xe(s)&&!Ut(s);){const a=Ue(s),l=vr(s);!l&&a.position==="fixed"&&(r=null),(i?!l&&!r:!l&&a.position==="static"&&!!r&&zu.has(r.position)||Sn(s)&&!l&&is(e,s))?o=o.filter(u=>u!==s):r=a,s=kt(s)}return t.set(e,o),o}function Lu(e){let{element:t,boundary:n,rootBoundary:o,strategy:r}=e;const s=[...n==="clippingAncestors"?go(t)?[]:Ru(t,this._c):[].concat(n),o],a=s[0],l=s.reduce((c,u)=>{const d=Fr(t,u,r);return c.top=Le(d.top,c.top),c.right=Et(d.right,c.right),c.bottom=Et(d.bottom,c.bottom),c.left=Le(d.left,c.left),c},Fr(t,a,r));return{width:l.right-l.left,height:l.bottom-l.top,x:l.left,y:l.top}}function Vu(e){const{width:t,height:n}=ns(e);return{width:t,height:n}}function Fu(e,t,n){const o=st(t),r=at(t),i=n==="fixed",s=Pt(e,!0,i,t);let a={scrollLeft:0,scrollTop:0};const l=rt(0);function c(){l.x=mo(r)}if(o||!o&&!i)if((zt(t)!=="body"||Sn(r))&&(a=vo(t)),o){const f=Pt(t,!0,i,t);l.x=f.x+t.clientLeft,l.y=f.y+t.clientTop}else r&&c();i&&!o&&r&&c();const u=r&&!o&&!i?rs(r,a):rt(0),d=s.left+a.scrollLeft-l.x-u.x,h=s.top+a.scrollTop-l.y-u.y;return{x:d,y:h,width:s.width,height:s.height}}function To(e){return Ue(e).position==="static"}function Hr(e,t){if(!st(e)||Ue(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return at(e)===n&&(n=n.ownerDocument.body),n}function ss(e,t){const n=Ve(e);if(go(e))return n;if(!st(e)){let r=kt(e);for(;r&&!Ut(r);){if(Xe(r)&&!To(r))return r;r=kt(r)}return n}let o=Hr(e,t);for(;o&&Eu(o)&&To(o);)o=Hr(o,t);return o&&Ut(o)&&To(o)&&!vr(o)?n:o||$u(e)||n}const Hu=async function(e){const t=this.getOffsetParent||ss,n=this.getDimensions,o=await n(e.floating);return{reference:Fu(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:o.width,height:o.height}}};function Gu(e){return Ue(e).direction==="rtl"}const qu={convertOffsetParentRelativeRectToViewportRelativeRect:Pu,getDocumentElement:at,getClippingRect:Lu,getOffsetParent:ss,getElementRects:Hu,getClientRects:Iu,getDimensions:Vu,getScale:Gt,isElement:Xe,isRTL:Gu};function as(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function ju(e,t){let n=null,o;const r=at(e);function i(){var a;clearTimeout(o),(a=n)==null||a.disconnect(),n=null}function s(a,l){a===void 0&&(a=!1),l===void 0&&(l=1),i();const c=e.getBoundingClientRect(),{left:u,top:d,width:h,height:f}=c;if(a||t(),!h||!f)return;const g=Mn(d),y=Mn(r.clientWidth-(u+h)),w=Mn(r.clientHeight-(d+f)),b=Mn(u),v={rootMargin:-g+"px "+-y+"px "+-w+"px "+-b+"px",threshold:Le(0,Et(1,l))||1};let m=!0;function T(B){const H=B[0].intersectionRatio;if(H!==l){if(!m)return s();H?s(!1,H):o=setTimeout(()=>{s(!1,1e-7)},1e3)}H===1&&!as(c,e.getBoundingClientRect())&&s(),m=!1}try{n=new IntersectionObserver(T,{...v,root:r.ownerDocument})}catch{n=new IntersectionObserver(T,v)}n.observe(e)}return s(!0),i}function Yu(e,t,n,o){o===void 0&&(o={});const{ancestorScroll:r=!0,ancestorResize:i=!0,elementResize:s=typeof ResizeObserver=="function",layoutShift:a=typeof IntersectionObserver=="function",animationFrame:l=!1}=o,c=yr(e),u=r||i?[...c?vn(c):[],...vn(t)]:[];u.forEach(b=>{r&&b.addEventListener("scroll",n,{passive:!0}),i&&b.addEventListener("resize",n)});const d=c&&a?ju(c,n):null;let h=-1,f=null;s&&(f=new ResizeObserver(b=>{let[E]=b;E&&E.target===c&&f&&(f.unobserve(t),cancelAnimationFrame(h),h=requestAnimationFrame(()=>{var v;(v=f)==null||v.observe(t)})),n()}),c&&!l&&f.observe(c),f.observe(t));let g,y=l?Pt(e):null;l&&w();function w(){const b=Pt(e);y&&!as(y,b)&&n(),y=b,g=requestAnimationFrame(w)}return n(),()=>{var b;u.forEach(E=>{r&&E.removeEventListener("scroll",n),i&&E.removeEventListener("resize",n)}),d?.(),(b=f)==null||b.disconnect(),f=null,l&&cancelAnimationFrame(g)}}const Wu=mu,Xu=yu,Gr=pu,Uu=_u,Zu=gu,Ku=hu,Ju=wu,Qu=(e,t,n)=>{const o=new Map,r={platform:qu,...n},i={...r.platform,_c:o};return fu(e,t,{...r,platform:i})};function ec(e){return e!=null&&typeof e=="object"&&"$el"in e}function Xo(e){if(ec(e)){const t=e.$el;return gr(t)&&zt(t)==="#comment"?null:t}return e}function Ft(e){return typeof e=="function"?e():k(e)}function tc(e){return{name:"arrow",options:e,fn(t){const n=Xo(Ft(e.element));return n==null?{}:Ku({element:n,padding:e.padding}).fn(t)}}}function ls(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function qr(e,t){const n=ls(e);return Math.round(t*n)/n}function nc(e,t,n){n===void 0&&(n={});const o=n.whileElementsMounted,r=ne(()=>{var H;return(H=Ft(n.open))!=null?H:!0}),i=ne(()=>Ft(n.middleware)),s=ne(()=>{var H;return(H=Ft(n.placement))!=null?H:"bottom"}),a=ne(()=>{var H;return(H=Ft(n.strategy))!=null?H:"absolute"}),l=ne(()=>{var H;return(H=Ft(n.transform))!=null?H:!0}),c=ne(()=>Xo(e.value)),u=ne(()=>Xo(t.value)),d=ce(0),h=ce(0),f=ce(a.value),g=ce(s.value),y=dt({}),w=ce(!1),b=ne(()=>{const H={position:f.value,left:"0",top:"0"};if(!u.value)return H;const F=qr(u.value,d.value),K=qr(u.value,h.value);return l.value?{...H,transform:"translate("+F+"px, "+K+"px)",...ls(u.value)>=1.5&&{willChange:"transform"}}:{position:f.value,left:F+"px",top:K+"px"}});let E;function v(){if(c.value==null||u.value==null)return;const H=r.value;Qu(c.value,u.value,{middleware:i.value,placement:s.value,strategy:a.value}).then(F=>{d.value=F.x,h.value=F.y,f.value=F.strategy,g.value=F.placement,y.value=F.middlewareData,w.value=H!==!1})}function m(){typeof E=="function"&&(E(),E=void 0)}function T(){if(m(),o===void 0){v();return}if(c.value!=null&&u.value!=null){E=o(c.value,u.value,v);return}}function B(){r.value||(w.value=!1)}return _e([i,s,a,r],v,{flush:"sync"}),_e([c,u],T,{flush:"sync"}),_e(r,B,{flush:"sync"}),ur()&&dn(m),{x:Bt(d),y:Bt(h),strategy:Bt(f),placement:Bt(g),middlewareData:Bt(y),isPositioned:Bt(w),floatingStyles:b,update:v}}const oc={side:"bottom",sideOffset:0,sideFlip:!0,align:"center",alignOffset:0,alignFlip:!0,arrowPadding:0,hideShiftedArrow:!0,avoidCollisions:!0,collisionBoundary:()=>[],collisionPadding:0,sticky:"partial",hideWhenDetached:!1,positionStrategy:"fixed",updatePositionStrategy:"optimized",prioritizePosition:!1},[rc,ic]=ho("PopperContent");var sc=ve({inheritAttrs:!1,__name:"PopperContent",props:Ia({side:{type:null,required:!1},sideOffset:{type:Number,required:!1},sideFlip:{type:Boolean,required:!1},align:{type:null,required:!1},alignOffset:{type:Number,required:!1},alignFlip:{type:Boolean,required:!1},avoidCollisions:{type:Boolean,required:!1},collisionBoundary:{type:null,required:!1},collisionPadding:{type:[Number,Object],required:!1},arrowPadding:{type:Number,required:!1},hideShiftedArrow:{type:Boolean,required:!1},sticky:{type:String,required:!1},hideWhenDetached:{type:Boolean,required:!1},positionStrategy:{type:String,required:!1},updatePositionStrategy:{type:String,required:!1},disableUpdateOnLayoutShift:{type:Boolean,required:!1},prioritizePosition:{type:Boolean,required:!1},reference:{type:null,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},{...oc}),emits:["placed"],setup(e,{emit:t}){const n=e,o=t,r=Ji(),{forwardRef:i,currentElement:s}=Ke(),a=ce(),l=ce(),{width:c,height:u}=Hl(l),d=ne(()=>n.side+(n.align!=="center"?`-${n.align}`:"")),h=ne(()=>typeof n.collisionPadding=="number"?n.collisionPadding:{top:0,right:0,bottom:0,left:0,...n.collisionPadding}),f=ne(()=>Array.isArray(n.collisionBoundary)?n.collisionBoundary:[n.collisionBoundary]),g=ne(()=>({padding:h.value,boundary:f.value.filter(Jl),altBoundary:f.value.length>0})),y=ne(()=>({mainAxis:n.sideFlip,crossAxis:n.alignFlip})),w=$a(()=>[Wu({mainAxis:n.sideOffset+u.value,alignmentAxis:n.alignOffset}),n.prioritizePosition&&n.avoidCollisions&&Gr({...g.value,...y.value}),n.avoidCollisions&&Xu({mainAxis:!0,crossAxis:!!n.prioritizePosition,limiter:n.sticky==="partial"?Ju():void 0,...g.value}),!n.prioritizePosition&&n.avoidCollisions&&Gr({...g.value,...y.value}),Uu({...g.value,apply:({elements:S,rects:C,availableWidth:p,availableHeight:N})=>{const{width:_,height:$}=C.reference,P=S.floating.style;P.setProperty("--reka-popper-available-width",`${p}px`),P.setProperty("--reka-popper-available-height",`${N}px`),P.setProperty("--reka-popper-anchor-width",`${_}px`),P.setProperty("--reka-popper-anchor-height",`${$}px`)}}),l.value&&tc({element:l.value,padding:n.arrowPadding}),Ql({arrowWidth:c.value,arrowHeight:u.value}),n.hideWhenDetached&&Zu({strategy:"referenceHidden",...g.value})]),b=ne(()=>n.reference??r.anchor.value),{floatingStyles:E,placement:v,isPositioned:m,middlewareData:T}=nc(b,a,{strategy:n.positionStrategy,placement:d,whileElementsMounted:(...S)=>Yu(...S,{layoutShift:!n.disableUpdateOnLayoutShift,animationFrame:n.updatePositionStrategy==="always"}),middleware:w}),B=ne(()=>qo(v.value)[0]),H=ne(()=>qo(v.value)[1]);ji(()=>{m.value&&o("placed")});const F=ne(()=>{const S=T.value.arrow?.centerOffset!==0;return n.hideShiftedArrow&&S}),K=ce("");Ho(()=>{s.value&&(K.value=window.getComputedStyle(s.value).zIndex)});const I=ne(()=>T.value.arrow?.x??0),A=ne(()=>T.value.arrow?.y??0);return ic({placedSide:B,onArrowChange:S=>l.value=S,arrowX:I,arrowY:A,shouldHideArrow:F}),(S,C)=>(j(),ee("div",{ref_key:"floatingRef",ref:a,"data-reka-popper-content-wrapper":"",style:Re({...k(E),transform:k(m)?k(E).transform:"translate(0, -200%)",minWidth:"max-content",zIndex:K.value,"--reka-popper-transform-origin":[k(T).transformOrigin?.x,k(T).transformOrigin?.y].join(" "),...k(T).hide?.referenceHidden&&{visibility:"hidden",pointerEvents:"none"}})},[oe(k(uo),He({ref:k(i)},S.$attrs,{"as-child":n.asChild,as:S.as,"data-side":B.value,"data-align":H.value,style:{animation:k(m)?void 0:"none"}}),{default:fe(()=>[xe(S.$slots,"default")]),_:3},16,["as-child","as","data-side","data-align","style"])],4))}}),ac=sc;const lc={top:"bottom",right:"left",bottom:"top",left:"right"};var uc=ve({inheritAttrs:!1,__name:"PopperArrow",props:{width:{type:Number,required:!1},height:{type:Number,required:!1},rounded:{type:Boolean,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:"svg"}},setup(e){const{forwardRef:t}=Ke(),n=rc(),o=ne(()=>lc[n.placedSide.value]);return(r,i)=>(j(),ee("span",{ref:s=>{k(n).onArrowChange(s)},style:Re({position:"absolute",left:k(n).arrowX?.value?`${k(n).arrowX?.value}px`:void 0,top:k(n).arrowY?.value?`${k(n).arrowY?.value}px`:void 0,[o.value]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[k(n).placedSide.value],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[k(n).placedSide.value],visibility:k(n).shouldHideArrow.value?"hidden":void 0})},[oe(Kl,He(r.$attrs,{ref:k(t),style:{display:"block"},as:r.as,"as-child":r.asChild,rounded:r.rounded,width:r.width,height:r.height}),{default:fe(()=>[xe(r.$slots,"default")]),_:3},16,["as","as-child","rounded","width","height"])],4))}}),cc=uc,dc=ve({__name:"TooltipArrow",props:{width:{type:Number,required:!1,default:10},height:{type:Number,required:!1,default:5},asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:"svg"}},setup(e){const t=e;return Ke(),(n,o)=>(j(),we(k(cc),co(fo(t)),{default:fe(()=>[xe(n.$slots,"default")]),_:3},16))}}),fc=dc;const[wr,hc]=ho("TooltipProvider");var pc=ve({inheritAttrs:!1,__name:"TooltipProvider",props:{delayDuration:{type:Number,required:!1,default:700},skipDelayDuration:{type:Number,required:!1,default:300},disableHoverableContent:{type:Boolean,required:!1,default:!1},disableClosingTrigger:{type:Boolean,required:!1},disabled:{type:Boolean,required:!1},ignoreNonKeyboardFocus:{type:Boolean,required:!1,default:!1}},setup(e){const t=e,{delayDuration:n,skipDelayDuration:o,disableHoverableContent:r,disableClosingTrigger:i,ignoreNonKeyboardFocus:s,disabled:a}=Yi(t);Ke();const l=ce(!0),c=ce(!1),{start:u,stop:d}=Hi(()=>{l.value=!0},o,{immediate:!1});return hc({isOpenDelayed:l,delayDuration:n,onOpen(){d(),l.value=!1},onClose(){u()},isPointerInTransitRef:c,disableHoverableContent:r,disableClosingTrigger:i,disabled:a,ignoreNonKeyboardFocus:s}),(h,f)=>xe(h.$slots,"default")}}),gc=pc;const us="tooltip.open",[yo,vc]=ho("TooltipRoot");var mc=ve({__name:"TooltipRoot",props:{defaultOpen:{type:Boolean,required:!1,default:!1},open:{type:Boolean,required:!1,default:void 0},delayDuration:{type:Number,required:!1,default:void 0},disableHoverableContent:{type:Boolean,required:!1,default:void 0},disableClosingTrigger:{type:Boolean,required:!1,default:void 0},disabled:{type:Boolean,required:!1,default:void 0},ignoreNonKeyboardFocus:{type:Boolean,required:!1,default:void 0}},emits:["update:open"],setup(e,{emit:t}){const n=e,o=t;Ke();const r=wr(),i=ne(()=>n.disableHoverableContent??r.disableHoverableContent.value),s=ne(()=>n.disableClosingTrigger??r.disableClosingTrigger.value),a=ne(()=>n.disabled??r.disabled.value),l=ne(()=>n.delayDuration??r.delayDuration.value),c=ne(()=>n.ignoreNonKeyboardFocus??r.ignoreNonKeyboardFocus.value),u=Ma(n,"open",o,{defaultValue:n.defaultOpen,passive:n.open===void 0});_e(u,v=>{r.onClose&&(v?(r.onOpen(),document.dispatchEvent(new CustomEvent(us))):r.onClose())});const d=ce(!1),h=ce(),f=ne(()=>u.value?d.value?"delayed-open":"instant-open":"closed"),{start:g,stop:y}=Hi(()=>{d.value=!0,u.value=!0},l,{immediate:!1});function w(){y(),d.value=!1,u.value=!0}function b(){y(),u.value=!1}function E(){g()}return vc({contentId:"",open:u,stateAttribute:f,trigger:h,onTriggerChange(v){h.value=v},onTriggerEnter(){r.isOpenDelayed.value?E():w()},onTriggerLeave(){i.value?b():y()},onOpen:w,onClose:b,disableHoverableContent:i,disableClosingTrigger:s,disabled:a,ignoreNonKeyboardFocus:c}),(v,m)=>(j(),we(k(jl),null,{default:fe(()=>[xe(v.$slots,"default",{open:k(u)})]),_:3}))}}),yc=mc,wc=ve({__name:"TooltipContentImpl",props:{ariaLabel:{type:String,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1},side:{type:null,required:!1,default:"top"},sideOffset:{type:Number,required:!1,default:0},align:{type:null,required:!1,default:"center"},alignOffset:{type:Number,required:!1},avoidCollisions:{type:Boolean,required:!1,default:!0},collisionBoundary:{type:null,required:!1,default:()=>[]},collisionPadding:{type:[Number,Object],required:!1,default:0},arrowPadding:{type:Number,required:!1,default:0},sticky:{type:String,required:!1,default:"partial"},hideWhenDetached:{type:Boolean,required:!1,default:!1},positionStrategy:{type:String,required:!1},updatePositionStrategy:{type:String,required:!1}},emits:["escapeKeyDown","pointerDownOutside"],setup(e,{emit:t}){const n=e,o=t,r=yo(),{forwardRef:i,currentElement:s}=Ke(),a=ne(()=>n.ariaLabel||s.value?.textContent),l=ne(()=>{const{ariaLabel:c,...u}=n;return u});return je(()=>{Or(window,"scroll",c=>{c.target?.contains(r.trigger.value)&&r.onClose()}),Or(window,us,r.onClose)}),(c,u)=>(j(),we(k(Xa),{"as-child":"","disable-outside-pointer-events":!1,onEscapeKeyDown:u[0]||(u[0]=d=>o("escapeKeyDown",d)),onPointerDownOutside:u[1]||(u[1]=d=>{k(r).disableClosingTrigger.value&&k(r).trigger.value?.contains(d.target)&&d.preventDefault(),o("pointerDownOutside",d)}),onFocusOutside:u[2]||(u[2]=Da(()=>{},["prevent"])),onDismiss:u[3]||(u[3]=d=>k(r).onClose())},{default:fe(()=>[oe(k(ac),He({ref:k(i),"data-state":k(r).stateAttribute.value},{...c.$attrs,...l.value},{style:{"--reka-tooltip-content-transform-origin":"var(--reka-popper-transform-origin)","--reka-tooltip-content-available-width":"var(--reka-popper-available-width)","--reka-tooltip-content-available-height":"var(--reka-popper-available-height)","--reka-tooltip-trigger-width":"var(--reka-popper-anchor-width)","--reka-tooltip-trigger-height":"var(--reka-popper-anchor-height)"}}),{default:fe(()=>[xe(c.$slots,"default"),oe(k(Wa),{id:k(r).contentId,role:"tooltip"},{default:fe(()=>[Se(he(a.value),1)]),_:1},8,["id"])]),_:3},16,["data-state"])]),_:3}))}}),cs=wc,_c=ve({__name:"TooltipContentHoverable",props:{ariaLabel:{type:String,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1},side:{type:null,required:!1},sideOffset:{type:Number,required:!1},align:{type:null,required:!1},alignOffset:{type:Number,required:!1},avoidCollisions:{type:Boolean,required:!1},collisionBoundary:{type:null,required:!1},collisionPadding:{type:[Number,Object],required:!1},arrowPadding:{type:Number,required:!1},sticky:{type:String,required:!1},hideWhenDetached:{type:Boolean,required:!1},positionStrategy:{type:String,required:!1},updatePositionStrategy:{type:String,required:!1}},setup(e){const n=Ua(e),{forwardRef:o,currentElement:r}=Ke(),{trigger:i,onClose:s}=yo(),a=wr(),{isPointerInTransit:l,onPointerExit:c}=Al(i,r);return a.isPointerInTransitRef=l,c(()=>{s()}),(u,d)=>(j(),we(cs,He({ref:k(o)},k(n)),{default:fe(()=>[xe(u.$slots,"default")]),_:3},16))}}),xc=_c,bc=ve({__name:"TooltipContent",props:{forceMount:{type:Boolean,required:!1},ariaLabel:{type:String,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1},side:{type:null,required:!1,default:"top"},sideOffset:{type:Number,required:!1},align:{type:null,required:!1},alignOffset:{type:Number,required:!1},avoidCollisions:{type:Boolean,required:!1},collisionBoundary:{type:null,required:!1},collisionPadding:{type:[Number,Object],required:!1},arrowPadding:{type:Number,required:!1},sticky:{type:String,required:!1},hideWhenDetached:{type:Boolean,required:!1},positionStrategy:{type:String,required:!1},updatePositionStrategy:{type:String,required:!1}},emits:["escapeKeyDown","pointerDownOutside"],setup(e,{emit:t}){const n=e,o=t,r=yo(),i=dr(n,o),{forwardRef:s}=Ke();return(a,l)=>(j(),we(k(Za),{present:a.forceMount||k(r).open.value},{default:fe(()=>[(j(),we(Ge(k(r).disableHoverableContent.value?cs:xc),He({ref:k(s)},k(i)),{default:fe(()=>[xe(a.$slots,"default")]),_:3},16))]),_:3},8,["present"]))}}),Ec=bc,kc=ve({__name:"TooltipPortal",props:{to:{type:null,required:!1},disabled:{type:Boolean,required:!1},defer:{type:Boolean,required:!1},forceMount:{type:Boolean,required:!1}},setup(e){const t=e;return(n,o)=>(j(),we(k(Ka),co(fo(t)),{default:fe(()=>[xe(n.$slots,"default")]),_:3},16))}}),Sc=kc,Cc=ve({__name:"TooltipTrigger",props:{reference:{type:null,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:"button"}},setup(e){const t=e,n=yo(),o=wr();n.contentId||=Ja(void 0,"reka-tooltip-content");const{forwardRef:r,currentElement:i}=Ke(),s=ce(!1),a=ce(!1),l=ne(()=>n.disabled.value?{}:{click:y,focus:f,pointermove:d,pointerleave:h,pointerdown:u,blur:g});je(()=>{n.onTriggerChange(i.value)});function c(){setTimeout(()=>{s.value=!1},1)}function u(){n.open&&!n.disableClosingTrigger.value&&n.onClose(),s.value=!0,document.addEventListener("pointerup",c,{once:!0})}function d(w){w.pointerType!=="touch"&&!a.value&&!o.isPointerInTransitRef.value&&(n.onTriggerEnter(),a.value=!0)}function h(){n.onTriggerLeave(),a.value=!1}function f(w){s.value||n.ignoreNonKeyboardFocus.value&&!w.target.matches?.(":focus-visible")||n.onOpen()}function g(){n.onClose()}function y(){n.disableClosingTrigger.value||n.onClose()}return(w,b)=>(j(),we(k(Wl),{"as-child":"",reference:w.reference},{default:fe(()=>[oe(k(uo),He({ref:k(r),"aria-describedby":k(n).open.value?k(n).contentId:void 0,"data-state":k(n).stateAttribute.value,as:w.as,"as-child":t.asChild,"data-grace-area-trigger":""},Aa(l.value)),{default:fe(()=>[xe(w.$slots,"default")]),_:3},16,["aria-describedby","data-state","as","as-child"])]),_:3},8,["reference"]))}}),Nc=Cc,Ne=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),Ze=Ne((e,t)=>{var n=Object.defineProperty,o=(C,p,N)=>p in C?n(C,p,{enumerable:!0,configurable:!0,writable:!0,value:N}):C[p]=N,r=(C,p)=>()=>(p||C((p={exports:{}}).exports,p),p.exports),i=(C,p,N)=>o(C,typeof p!="symbol"?p+"":p,N),s=r((C,p)=>{var N="\0",_="\0",$="",P=class{constructor(D){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"),D&&(this._isDirected=Object.hasOwn(D,"directed")?D.directed:!0,this._isMultigraph=Object.hasOwn(D,"multigraph")?D.multigraph:!1,this._isCompound=Object.hasOwn(D,"compound")?D.compound:!1),this._isCompound&&(this._parent={},this._children={},this._children[_]={})}isDirected(){return this._isDirected}isMultigraph(){return this._isMultigraph}isCompound(){return this._isCompound}setGraph(D){return this._label=D,this}graph(){return this._label}setDefaultNodeLabel(D){return this._defaultNodeLabelFn=D,typeof D!="function"&&(this._defaultNodeLabelFn=()=>D),this}nodeCount(){return this._nodeCount}nodes(){return Object.keys(this._nodes)}sources(){var D=this;return this.nodes().filter(x=>Object.keys(D._in[x]).length===0)}sinks(){var D=this;return this.nodes().filter(x=>Object.keys(D._out[x]).length===0)}setNodes(D,x){var O=arguments,R=this;return D.forEach(function(W){O.length>1?R.setNode(W,x):R.setNode(W)}),this}setNode(D,x){return Object.hasOwn(this._nodes,D)?(arguments.length>1&&(this._nodes[D]=x),this):(this._nodes[D]=arguments.length>1?x:this._defaultNodeLabelFn(D),this._isCompound&&(this._parent[D]=_,this._children[D]={},this._children[_][D]=!0),this._in[D]={},this._preds[D]={},this._out[D]={},this._sucs[D]={},++this._nodeCount,this)}node(D){return this._nodes[D]}hasNode(D){return Object.hasOwn(this._nodes,D)}removeNode(D){var x=this;if(Object.hasOwn(this._nodes,D)){var O=R=>x.removeEdge(x._edgeObjs[R]);delete this._nodes[D],this._isCompound&&(this._removeFromParentsChildList(D),delete this._parent[D],this.children(D).forEach(function(R){x.setParent(R)}),delete this._children[D]),Object.keys(this._in[D]).forEach(O),delete this._in[D],delete this._preds[D],Object.keys(this._out[D]).forEach(O),delete this._out[D],delete this._sucs[D],--this._nodeCount}return this}setParent(D,x){if(!this._isCompound)throw new Error("Cannot set parent in a non-compound graph");if(x===void 0)x=_;else{x+="";for(var O=x;O!==void 0;O=this.parent(O))if(O===D)throw new Error("Setting "+x+" as parent of "+D+" would create a cycle");this.setNode(x)}return this.setNode(D),this._removeFromParentsChildList(D),this._parent[D]=x,this._children[x][D]=!0,this}_removeFromParentsChildList(D){delete this._children[this._parent[D]][D]}parent(D){if(this._isCompound){var x=this._parent[D];if(x!==_)return x}}children(D=_){if(this._isCompound){var x=this._children[D];if(x)return Object.keys(x)}else{if(D===_)return this.nodes();if(this.hasNode(D))return[]}}predecessors(D){var x=this._preds[D];if(x)return Object.keys(x)}successors(D){var x=this._sucs[D];if(x)return Object.keys(x)}neighbors(D){var x=this.predecessors(D);if(x){let R=new Set(x);for(var O of this.successors(D))R.add(O);return Array.from(R.values())}}isLeaf(D){var x;return this.isDirected()?x=this.successors(D):x=this.neighbors(D),x.length===0}filterNodes(D){var x=new this.constructor({directed:this._isDirected,multigraph:this._isMultigraph,compound:this._isCompound});x.setGraph(this.graph());var O=this;Object.entries(this._nodes).forEach(function([Q,te]){D(Q)&&x.setNode(Q,te)}),Object.values(this._edgeObjs).forEach(function(Q){x.hasNode(Q.v)&&x.hasNode(Q.w)&&x.setEdge(Q,O.edge(Q))});var R={};function W(Q){var te=O.parent(Q);return te===void 0||x.hasNode(te)?(R[Q]=te,te):te in R?R[te]:W(te)}return this._isCompound&&x.nodes().forEach(Q=>x.setParent(Q,W(Q))),x}setDefaultEdgeLabel(D){return this._defaultEdgeLabelFn=D,typeof D!="function"&&(this._defaultEdgeLabelFn=()=>D),this}edgeCount(){return this._edgeCount}edges(){return Object.values(this._edgeObjs)}setPath(D,x){var O=this,R=arguments;return D.reduce(function(W,Q){return R.length>1?O.setEdge(W,Q,x):O.setEdge(W,Q),Q}),this}setEdge(){var D,x,O,R,W=!1,Q=arguments[0];typeof Q=="object"&&Q!==null&&"v"in Q?(D=Q.v,x=Q.w,O=Q.name,arguments.length===2&&(R=arguments[1],W=!0)):(D=Q,x=arguments[1],O=arguments[3],arguments.length>2&&(R=arguments[2],W=!0)),D=""+D,x=""+x,O!==void 0&&(O=""+O);var te=q(this._isDirected,D,x,O);if(Object.hasOwn(this._edgeLabels,te))return W&&(this._edgeLabels[te]=R),this;if(O!==void 0&&!this._isMultigraph)throw new Error("Cannot set a named edge when isMultigraph = false");this.setNode(D),this.setNode(x),this._edgeLabels[te]=W?R:this._defaultEdgeLabelFn(D,x,O);var re=U(this._isDirected,D,x,O);return D=re.v,x=re.w,Object.freeze(re),this._edgeObjs[te]=re,G(this._preds[x],D),G(this._sucs[D],x),this._in[x][te]=re,this._out[D][te]=re,this._edgeCount++,this}edge(D,x,O){var R=arguments.length===1?J(this._isDirected,arguments[0]):q(this._isDirected,D,x,O);return this._edgeLabels[R]}edgeAsObj(){let D=this.edge(...arguments);return typeof D!="object"?{label:D}:D}hasEdge(D,x,O){var R=arguments.length===1?J(this._isDirected,arguments[0]):q(this._isDirected,D,x,O);return Object.hasOwn(this._edgeLabels,R)}removeEdge(D,x,O){var R=arguments.length===1?J(this._isDirected,arguments[0]):q(this._isDirected,D,x,O),W=this._edgeObjs[R];return W&&(D=W.v,x=W.w,delete this._edgeLabels[R],delete this._edgeObjs[R],L(this._preds[x],D),L(this._sucs[D],x),delete this._in[x][R],delete this._out[D][R],this._edgeCount--),this}inEdges(D,x){return this.isDirected()?this.filterEdges(this._in[D],D,x):this.nodeEdges(D,x)}outEdges(D,x){return this.isDirected()?this.filterEdges(this._out[D],D,x):this.nodeEdges(D,x)}nodeEdges(D,x){if(D in this._nodes)return this.filterEdges({...this._in[D],...this._out[D]},D,x)}filterEdges(D,x,O){if(D){var R=Object.values(D);return O?R.filter(function(W){return W.v===x&&W.w===O||W.v===O&&W.w===x}):R}}};function G(D,x){D[x]?D[x]++:D[x]=1}function L(D,x){--D[x]||delete D[x]}function q(D,x,O,R){var W=""+x,Q=""+O;if(!D&&W>Q){var te=W;W=Q,Q=te}return W+$+Q+$+(R===void 0?N:R)}function U(D,x,O,R){var W=""+x,Q=""+O;if(!D&&W>Q){var te=W;W=Q,Q=te}var re={v:W,w:Q};return R&&(re.name=R),re}function J(D,x){return q(D,x.v,x.w,x.name)}p.exports=P}),a=r((C,p)=>{p.exports="3.0.2"}),l=r((C,p)=>{p.exports={Graph:s(),version:a()}}),c=r((C,p)=>{var N=s();p.exports={write:_,read:G};function _(L){var q={options:{directed:L.isDirected(),multigraph:L.isMultigraph(),compound:L.isCompound()},nodes:$(L),edges:P(L)};return L.graph()!==void 0&&(q.value=structuredClone(L.graph())),q}function $(L){return L.nodes().map(function(q){var U=L.node(q),J=L.parent(q),D={v:q};return U!==void 0&&(D.value=U),J!==void 0&&(D.parent=J),D})}function P(L){return L.edges().map(function(q){var U=L.edge(q),J={v:q.v,w:q.w};return q.name!==void 0&&(J.name=q.name),U!==void 0&&(J.value=U),J})}function G(L){var q=new N(L.options).setGraph(L.value);return L.nodes.forEach(function(U){q.setNode(U.v,U.value),U.parent&&q.setParent(U.v,U.parent)}),L.edges.forEach(function(U){q.setEdge({v:U.v,w:U.w,name:U.name},U.value)}),q}}),u=r((C,p)=>{p.exports=_;var N=()=>1;function _(P,G,L,q){return $(P,String(G),L||N,q||function(U){return P.outEdges(U)})}function $(P,G,L,q){var U={},J=!0,D=0,x=P.nodes(),O=function(te){var re=L(te);U[te.v].distance+re<U[te.w].distance&&(U[te.w]={distance:U[te.v].distance+re,predecessor:te.v},J=!0)},R=function(){x.forEach(function(te){q(te).forEach(function(re){var ae=re.v===te?re.v:re.w,me=ae===re.v?re.w:re.v;O({v:ae,w:me})})})};x.forEach(function(te){var re=te===G?0:Number.POSITIVE_INFINITY;U[te]={distance:re}});for(var W=x.length,Q=1;Q<W&&(J=!1,D++,R(),!!J);Q++);if(D===W-1&&(J=!1,R(),J))throw new Error("The graph contains a negative weight cycle");return U}}),d=r((C,p)=>{p.exports=N;function N(_){var $={},P=[],G;function L(q){Object.hasOwn($,q)||($[q]=!0,G.push(q),_.successors(q).forEach(L),_.predecessors(q).forEach(L))}return _.nodes().forEach(function(q){G=[],L(q),G.length&&P.push(G)}),P}}),h=r((C,p)=>{var N=class{constructor(){i(this,"_arr",[]),i(this,"_keyIndices",{})}size(){return this._arr.length}keys(){return this._arr.map(function(_){return _.key})}has(_){return Object.hasOwn(this._keyIndices,_)}priority(_){var $=this._keyIndices[_];if($!==void 0)return this._arr[$].priority}min(){if(this.size()===0)throw new Error("Queue underflow");return this._arr[0].key}add(_,$){var P=this._keyIndices;if(_=String(_),!Object.hasOwn(P,_)){var G=this._arr,L=G.length;return P[_]=L,G.push({key:_,priority:$}),this._decrease(L),!0}return!1}removeMin(){this._swap(0,this._arr.length-1);var _=this._arr.pop();return delete this._keyIndices[_.key],this._heapify(0),_.key}decrease(_,$){var P=this._keyIndices[_];if($>this._arr[P].priority)throw new Error("New priority is greater than current priority. Key: "+_+" Old: "+this._arr[P].priority+" New: "+$);this._arr[P].priority=$,this._decrease(P)}_heapify(_){var $=this._arr,P=2*_,G=P+1,L=_;P<$.length&&(L=$[P].priority<$[L].priority?P:L,G<$.length&&(L=$[G].priority<$[L].priority?G:L),L!==_&&(this._swap(_,L),this._heapify(L)))}_decrease(_){for(var $=this._arr,P=$[_].priority,G;_!==0&&(G=_>>1,!($[G].priority<P));)this._swap(_,G),_=G}_swap(_,$){var P=this._arr,G=this._keyIndices,L=P[_],q=P[$];P[_]=q,P[$]=L,G[q.key]=_,G[L.key]=$}};p.exports=N}),f=r((C,p)=>{var N=h();p.exports=$;var _=()=>1;function $(G,L,q,U){var J=function(D){return G.outEdges(D)};return P(G,String(L),q||_,U||J)}function P(G,L,q,U){var J={},D=new N,x,O,R=function(W){var Q=W.v!==x?W.v:W.w,te=J[Q],re=q(W),ae=O.distance+re;if(re<0)throw new Error("dijkstra does not allow negative edge weights. Bad edge: "+W+" Weight: "+re);ae<te.distance&&(te.distance=ae,te.predecessor=x,D.decrease(Q,ae))};for(G.nodes().forEach(function(W){var Q=W===L?0:Number.POSITIVE_INFINITY;J[W]={distance:Q},D.add(W,Q)});D.size()>0&&(x=D.removeMin(),O=J[x],O.distance!==Number.POSITIVE_INFINITY);)U(x).forEach(R);return J}}),g=r((C,p)=>{var N=f();p.exports=_;function _($,P,G){return $.nodes().reduce(function(L,q){return L[q]=N($,q,P,G),L},{})}}),y=r((C,p)=>{p.exports=N;function N($,P,G){if($[P].predecessor!==void 0)throw new Error("Invalid source vertex");if($[G].predecessor===void 0&&G!==P)throw new Error("Invalid destination vertex");return{weight:$[G].distance,path:_($,P,G)}}function _($,P,G){for(var L=[],q=G;q!==P;)L.push(q),q=$[q].predecessor;return L.push(P),L.reverse()}}),w=r((C,p)=>{p.exports=N;function N(_){var $=0,P=[],G={},L=[];function q(U){var J=G[U]={onStack:!0,lowlink:$,index:$++};if(P.push(U),_.successors(U).forEach(function(O){Object.hasOwn(G,O)?G[O].onStack&&(J.lowlink=Math.min(J.lowlink,G[O].index)):(q(O),J.lowlink=Math.min(J.lowlink,G[O].lowlink))}),J.lowlink===J.index){var D=[],x;do x=P.pop(),G[x].onStack=!1,D.push(x);while(U!==x);L.push(D)}}return _.nodes().forEach(function(U){Object.hasOwn(G,U)||q(U)}),L}}),b=r((C,p)=>{var N=w();p.exports=_;function _($){return N($).filter(function(P){return P.length>1||P.length===1&&$.hasEdge(P[0],P[0])})}}),E=r((C,p)=>{p.exports=_;var N=()=>1;function _(P,G,L){return $(P,G||N,L||function(q){return P.outEdges(q)})}function $(P,G,L){var q={},U=P.nodes();return U.forEach(function(J){q[J]={},q[J][J]={distance:0},U.forEach(function(D){J!==D&&(q[J][D]={distance:Number.POSITIVE_INFINITY})}),L(J).forEach(function(D){var x=D.v===J?D.w:D.v,O=G(D);q[J][x]={distance:O,predecessor:J}})}),U.forEach(function(J){var D=q[J];U.forEach(function(x){var O=q[x];U.forEach(function(R){var W=O[J],Q=D[R],te=O[R],re=W.distance+Q.distance;re<te.distance&&(te.distance=re,te.predecessor=Q.predecessor)})})}),q}}),v=r((C,p)=>{function N($){var P={},G={},L=[];function q(U){if(Object.hasOwn(G,U))throw new _;Object.hasOwn(P,U)||(G[U]=!0,P[U]=!0,$.predecessors(U).forEach(q),delete G[U],L.push(U))}if($.sinks().forEach(q),Object.keys(P).length!==$.nodeCount())throw new _;return L}var _=class extends Error{constructor(){super(...arguments)}};p.exports=N,N.CycleException=_}),m=r((C,p)=>{var N=v();p.exports=_;function _($){try{N($)}catch(P){if(P instanceof N.CycleException)return!1;throw P}return!0}}),T=r((C,p)=>{p.exports=N;function N($,P,G,L,q){Array.isArray(P)||(P=[P]);var U=($.isDirected()?$.successors:$.neighbors).bind($),J={};return P.forEach(function(D){if(!$.hasNode(D))throw new Error("Graph does not have node: "+D);q=_($,D,G==="post",J,U,L,q)}),q}function _($,P,G,L,q,U,J){return Object.hasOwn(L,P)||(L[P]=!0,G||(J=U(J,P)),q(P).forEach(function(D){J=_($,D,G,L,q,U,J)}),G&&(J=U(J,P))),J}}),B=r((C,p)=>{var N=T();p.exports=_;function _($,P,G){return N($,P,G,function(L,q){return L.push(q),L},[])}}),H=r((C,p)=>{var N=B();p.exports=_;function _($,P){return N($,P,"post")}}),F=r((C,p)=>{var N=B();p.exports=_;function _($,P){return N($,P,"pre")}}),K=r((C,p)=>{var N=s(),_=h();p.exports=$;function $(P,G){var L=new N,q={},U=new _,J;function D(O){var R=O.v===J?O.w:O.v,W=U.priority(R);if(W!==void 0){var Q=G(O);Q<W&&(q[R]=J,U.decrease(R,Q))}}if(P.nodeCount()===0)return L;P.nodes().forEach(function(O){U.add(O,Number.POSITIVE_INFINITY),L.setNode(O)}),U.decrease(P.nodes()[0],0);for(var x=!1;U.size()>0;){if(J=U.removeMin(),Object.hasOwn(q,J))L.setEdge(J,q[J]);else{if(x)throw new Error("Input graph is not connected: "+P);x=!0}P.nodeEdges(J).forEach(D)}return L}}),I=r((C,p)=>{var N=f(),_=u();p.exports=$;function $(G,L,q,U){return P(G,L,q,U||function(J){return G.outEdges(J)})}function P(G,L,q,U){if(q===void 0)return N(G,L,q,U);for(var J=!1,D=G.nodes(),x=0;x<D.length;x++){for(var O=U(D[x]),R=0;R<O.length;R++){var W=O[R],Q=W.v===D[x]?W.v:W.w,te=Q===W.v?W.w:W.v;q({v:Q,w:te})<0&&(J=!0)}if(J)return _(G,L,q,U)}return N(G,L,q,U)}}),A=r((C,p)=>{p.exports={bellmanFord:u(),components:d(),dijkstra:f(),dijkstraAll:g(),extractPath:y(),findCycles:b(),floydWarshall:E(),isAcyclic:m(),postorder:H(),preorder:F(),prim:K(),shortestPaths:I(),reduce:T(),tarjan:w(),topsort:v()}}),S=l();t.exports={Graph:S.Graph,json:c(),alg:A(),version:S.version}}),$c=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,a=s._prev;for(;a!==s;)i.push(JSON.stringify(a,r)),a=a._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}),Mc=Ne((e,t)=>{var n=Ze().Graph,o=$c();t.exports=i;var r=()=>1;function i(d,h){if(d.nodeCount()<=1)return[];let f=l(d,h||r);return s(f.graph,f.buckets,f.zeroIdx).flatMap(g=>d.outEdges(g.v,g.w))}function s(d,h,f){let g=[],y=h[h.length-1],w=h[0],b;for(;d.nodeCount();){for(;b=w.dequeue();)a(d,h,f,b);for(;b=y.dequeue();)a(d,h,f,b);if(d.nodeCount()){for(let E=h.length-2;E>0;--E)if(b=h[E].dequeue(),b){g=g.concat(a(d,h,f,b,!0));break}}}return g}function a(d,h,f,g,y){let w=y?[]:void 0;return d.inEdges(g.v).forEach(b=>{let E=d.edge(b),v=d.node(b.v);y&&w.push({v:b.v,w:b.w}),v.out-=E,c(h,f,v)}),d.outEdges(g.v).forEach(b=>{let E=d.edge(b),v=b.w,m=d.node(v);m.in-=E,c(h,f,m)}),d.removeNode(g.v),w}function l(d,h){let f=new n,g=0,y=0;d.nodes().forEach(E=>{f.setNode(E,{v:E,in:0,out:0})}),d.edges().forEach(E=>{let v=f.edge(E.v,E.w)||0,m=h(E),T=v+m;f.setEdge(E.v,E.w,T),y=Math.max(y,f.node(E.v).out+=m),g=Math.max(g,f.node(E.w).in+=m)});let w=u(y+g+3).map(()=>new o),b=g+1;return f.nodes().forEach(E=>{c(w,b,f.node(E))}),{graph:f,buckets:w,zeroIdx:b}}function c(d,h,f){f.out?f.in?d[f.out-f.in+h].enqueue(f):d[d.length-1].enqueue(f):d[0].enqueue(f)}function u(d){let h=[];for(let f=0;f<d;f++)h.push(f);return h}}),De=Ne((e,t)=>{var n=Ze().Graph;t.exports={addBorderNode:h,addDummyNode:o,applyWithChunking:y,asNonCompoundGraph:i,buildLayerMatrix:c,intersectRect:l,mapValues:F,maxRank:w,normalizeRanks:u,notime:v,partition:b,pick:H,predecessorWeights:a,range:B,removeEmptyRanks:d,simplify:r,successorWeights:s,time:E,uniqueId:T,zipObject:K};function o(I,A,S,C){for(var p=C;I.hasNode(p);)p=T(C);return S.dummy=A,I.setNode(p,S),p}function r(I){let A=new n().setGraph(I.graph());return I.nodes().forEach(S=>A.setNode(S,I.node(S))),I.edges().forEach(S=>{let C=A.edge(S.v,S.w)||{weight:0,minlen:1},p=I.edge(S);A.setEdge(S.v,S.w,{weight:C.weight+p.weight,minlen:Math.max(C.minlen,p.minlen)})}),A}function i(I){let A=new n({multigraph:I.isMultigraph()}).setGraph(I.graph());return I.nodes().forEach(S=>{I.children(S).length||A.setNode(S,I.node(S))}),I.edges().forEach(S=>{A.setEdge(S,I.edge(S))}),A}function s(I){let A=I.nodes().map(S=>{let C={};return I.outEdges(S).forEach(p=>{C[p.w]=(C[p.w]||0)+I.edge(p).weight}),C});return K(I.nodes(),A)}function a(I){let A=I.nodes().map(S=>{let C={};return I.inEdges(S).forEach(p=>{C[p.v]=(C[p.v]||0)+I.edge(p).weight}),C});return K(I.nodes(),A)}function l(I,A){let S=I.x,C=I.y,p=A.x-S,N=A.y-C,_=I.width/2,$=I.height/2;if(!p&&!N)throw new Error("Not possible to find intersection inside of the rectangle");let P,G;return Math.abs(N)*_>Math.abs(p)*$?(N<0&&($=-$),P=$*p/N,G=$):(p<0&&(_=-_),P=_,G=_*N/p),{x:S+P,y:C+G}}function c(I){let A=B(w(I)+1).map(()=>[]);return I.nodes().forEach(S=>{let C=I.node(S),p=C.rank;p!==void 0&&(A[p][C.order]=S)}),A}function u(I){let A=I.nodes().map(C=>{let p=I.node(C).rank;return p===void 0?Number.MAX_VALUE:p}),S=y(Math.min,A);I.nodes().forEach(C=>{let p=I.node(C);Object.hasOwn(p,"rank")&&(p.rank-=S)})}function d(I){let A=I.nodes().map(_=>I.node(_).rank).filter(_=>_!==void 0),S=y(Math.min,A),C=[];I.nodes().forEach(_=>{let $=I.node(_).rank-S;C[$]||(C[$]=[]),C[$].push(_)});let p=0,N=I.graph().nodeRankFactor;Array.from(C).forEach((_,$)=>{_===void 0&&$%N!==0?--p:_!==void 0&&p&&_.forEach(P=>I.node(P).rank+=p)})}function h(I,A,S,C){let p={width:0,height:0};return arguments.length>=4&&(p.rank=S,p.order=C),o(I,"border",p,A)}function f(I,A=g){let S=[];for(let C=0;C<I.length;C+=A){let p=I.slice(C,C+A);S.push(p)}return S}var g=65535;function y(I,A){if(A.length>g){let S=f(A);return I.apply(null,S.map(C=>I.apply(null,C)))}else return I.apply(null,A)}function w(I){let A=I.nodes().map(S=>{let C=I.node(S).rank;return C===void 0?Number.MIN_VALUE:C});return y(Math.max,A)}function b(I,A){let S={lhs:[],rhs:[]};return I.forEach(C=>{A(C)?S.lhs.push(C):S.rhs.push(C)}),S}function E(I,A){let S=Date.now();try{return A()}finally{console.log(I+" time: "+(Date.now()-S)+"ms")}}function v(I,A){return A()}var m=0;function T(I){var A=++m;return I+(""+A)}function B(I,A,S=1){A==null&&(A=I,I=0);let C=N=>N<A;S<0&&(C=N=>A<N);let p=[];for(let N=I;C(N);N+=S)p.push(N);return p}function H(I,A){let S={};for(let C of A)I[C]!==void 0&&(S[C]=I[C]);return S}function F(I,A){let S=A;return typeof A=="string"&&(S=C=>C[A]),Object.entries(I).reduce((C,[p,N])=>(C[p]=S(N,p),C),{})}function K(I,A){return I.reduce((S,C,p)=>(S[C]=A[p],S),{})}}),Tc=Ne((e,t)=>{var n=Mc(),o=De().uniqueId;t.exports={run:r,undo:s};function r(a){(a.graph().acyclicer==="greedy"?n(a,l(a)):i(a)).forEach(c=>{let u=a.edge(c);a.removeEdge(c),u.forwardName=c.name,u.reversed=!0,a.setEdge(c.w,c.v,u,o("rev"))});function l(c){return u=>c.edge(u).weight}}function i(a){let l=[],c={},u={};function d(h){Object.hasOwn(u,h)||(u[h]=!0,c[h]=!0,a.outEdges(h).forEach(f=>{Object.hasOwn(c,f.w)?l.push(f):d(f.w)}),delete c[h])}return a.nodes().forEach(d),l}function s(a){a.edges().forEach(l=>{let c=a.edge(l);if(c.reversed){a.removeEdge(l);let u=c.forwardName;delete c.reversed,delete c.forwardName,a.setEdge(l.w,l.v,c,u)}})}}),Oc=Ne((e,t)=>{var n=De();t.exports={run:o,undo:i};function o(s){s.graph().dummyChains=[],s.edges().forEach(a=>r(s,a))}function r(s,a){let l=a.v,c=s.node(l).rank,u=a.w,d=s.node(u).rank,h=a.name,f=s.edge(a),g=f.labelRank;if(d===c+1)return;s.removeEdge(a);let y,w,b;for(b=0,++c;c<d;++b,++c)f.points=[],w={width:0,height:0,edgeLabel:f,edgeObj:a,rank:c},y=n.addDummyNode(s,"edge",w,"_d"),c===g&&(w.width=f.width,w.height=f.height,w.dummy="edge-label",w.labelpos=f.labelpos),s.setEdge(l,y,{weight:f.weight},h),b===0&&s.graph().dummyChains.push(y),l=y;s.setEdge(l,u,{weight:f.weight},h)}function i(s){s.graph().dummyChains.forEach(a=>{let l=s.node(a),c=l.edgeLabel,u;for(s.setEdge(l.edgeObj,c);l.dummy;)u=s.successors(a)[0],s.removeNode(a),c.points.push({x:l.x,y:l.y}),l.dummy==="edge-label"&&(c.x=l.x,c.y=l.y,c.width=l.width,c.height=l.height),a=u,l=s.node(a)})}}),Kn=Ne((e,t)=>{var{applyWithChunking:n}=De();t.exports={longestPath:o,slack:r};function o(i){var s={};function a(l){var c=i.node(l);if(Object.hasOwn(s,l))return c.rank;s[l]=!0;let u=i.outEdges(l).map(h=>h==null?Number.POSITIVE_INFINITY:a(h.w)-i.edge(h).minlen);var d=n(Math.min,u);return d===Number.POSITIVE_INFINITY&&(d=0),c.rank=d}i.sources().forEach(a)}function r(i,s){return i.node(s.w).rank-i.node(s.v).rank-i.edge(s).minlen}}),ds=Ne((e,t)=>{var n=Ze().Graph,o=Kn().slack;t.exports=r;function r(l){var c=new n({directed:!1}),u=l.nodes()[0],d=l.nodeCount();c.setNode(u,{});for(var h,f;i(c,l)<d;)h=s(c,l),f=c.hasNode(h.v)?o(l,h):-o(l,h),a(c,l,f);return c}function i(l,c){function u(d){c.nodeEdges(d).forEach(h=>{var f=h.v,g=d===f?h.w:f;!l.hasNode(g)&&!o(c,h)&&(l.setNode(g,{}),l.setEdge(d,g,{}),u(g))})}return l.nodes().forEach(u),l.nodeCount()}function s(l,c){return c.edges().reduce((u,d)=>{let h=Number.POSITIVE_INFINITY;return l.hasNode(d.v)!==l.hasNode(d.w)&&(h=o(c,d)),h<u[0]?[h,d]:u},[Number.POSITIVE_INFINITY,null])[1]}function a(l,c,u){l.nodes().forEach(d=>c.node(d).rank+=u)}}),Pc=Ne((e,t)=>{var n=ds(),o=Kn().slack,r=Kn().longestPath,i=Ze().alg.preorder,s=Ze().alg.postorder,a=De().simplify;t.exports=l,l.initLowLimValues=h,l.initCutValues=c,l.calcCutValue=d,l.leaveEdge=g,l.enterEdge=y,l.exchangeEdges=w;function l(m){m=a(m),r(m);var T=n(m);h(T),c(T,m);for(var B,H;B=g(T);)H=y(T,m,B),w(T,m,B,H)}function c(m,T){var B=s(m,m.nodes());B=B.slice(0,B.length-1),B.forEach(H=>u(m,T,H))}function u(m,T,B){var H=m.node(B),F=H.parent;m.edge(B,F).cutvalue=d(m,T,B)}function d(m,T,B){var H=m.node(B),F=H.parent,K=!0,I=T.edge(B,F),A=0;return I||(K=!1,I=T.edge(F,B)),A=I.weight,T.nodeEdges(B).forEach(S=>{var C=S.v===B,p=C?S.w:S.v;if(p!==F){var N=C===K,_=T.edge(S).weight;if(A+=N?_:-_,E(m,B,p)){var $=m.edge(B,p).cutvalue;A+=N?-$:$}}}),A}function h(m,T){arguments.length<2&&(T=m.nodes()[0]),f(m,{},1,T)}function f(m,T,B,H,F){var K=B,I=m.node(H);return T[H]=!0,m.neighbors(H).forEach(A=>{Object.hasOwn(T,A)||(B=f(m,T,B,A,H))}),I.low=K,I.lim=B++,F?I.parent=F:delete I.parent,B}function g(m){return m.edges().find(T=>m.edge(T).cutvalue<0)}function y(m,T,B){var H=B.v,F=B.w;T.hasEdge(H,F)||(H=B.w,F=B.v);var K=m.node(H),I=m.node(F),A=K,S=!1;K.lim>I.lim&&(A=I,S=!0);var C=T.edges().filter(p=>S===v(m,m.node(p.v),A)&&S!==v(m,m.node(p.w),A));return C.reduce((p,N)=>o(T,N)<o(T,p)?N:p)}function w(m,T,B,H){var F=B.v,K=B.w;m.removeEdge(F,K),m.setEdge(H.v,H.w,{}),h(m),c(m,T),b(m,T)}function b(m,T){var B=m.nodes().find(F=>!T.node(F).parent),H=i(m,B);H=H.slice(1),H.forEach(F=>{var K=m.node(F).parent,I=T.edge(F,K),A=!1;I||(I=T.edge(K,F),A=!0),T.node(F).rank=T.node(K).rank+(A?I.minlen:-I.minlen)})}function E(m,T,B){return m.hasEdge(T,B)}function v(m,T,B){return B.low<=T.lim&&T.lim<=B.lim}}),Ic=Ne((e,t)=>{var n=Kn(),o=n.longestPath,r=ds(),i=Pc();t.exports=s;function s(u){var d=u.graph().ranker;if(d instanceof Function)return d(u);switch(u.graph().ranker){case"network-simplex":c(u);break;case"tight-tree":l(u);break;case"longest-path":a(u);break;case"none":break;default:c(u)}}var a=o;function l(u){o(u),r(u)}function c(u){i(u)}}),Dc=Ne((e,t)=>{t.exports=n;function n(i){let s=r(i);i.graph().dummyChains.forEach(a=>{let l=i.node(a),c=l.edgeObj,u=o(i,s,c.v,c.w),d=u.path,h=u.lca,f=0,g=d[f],y=!0;for(;a!==c.w;){if(l=i.node(a),y){for(;(g=d[f])!==h&&i.node(g).maxRank<l.rank;)f++;g===h&&(y=!1)}if(!y){for(;f<d.length-1&&i.node(g=d[f+1]).minRank<=l.rank;)f++;g=d[f]}i.setParent(a,g),a=i.successors(a)[0]}})}function o(i,s,a,l){let c=[],u=[],d=Math.min(s[a].low,s[l].low),h=Math.max(s[a].lim,s[l].lim),f,g;f=a;do f=i.parent(f),c.push(f);while(f&&(s[f].low>d||h>s[f].lim));for(g=f,f=l;(f=i.parent(f))!==g;)u.push(f);return{path:c.concat(u.reverse()),lca:g}}function r(i){let s={},a=0;function l(c){let u=a;i.children(c).forEach(l),s[c]={low:u,lim:a++}}return i.children().forEach(l),s}}),Ac=Ne((e,t)=>{var n=De();t.exports={run:o,cleanup:a};function o(l){let c=n.addDummyNode(l,"root",{},"_root"),u=i(l),d=Object.values(u),h=n.applyWithChunking(Math.max,d)-1,f=2*h+1;l.graph().nestingRoot=c,l.edges().forEach(y=>l.edge(y).minlen*=f);let g=s(l)+1;l.children().forEach(y=>r(l,c,f,g,h,u,y)),l.graph().nodeRankFactor=f}function r(l,c,u,d,h,f,g){let y=l.children(g);if(!y.length){g!==c&&l.setEdge(c,g,{weight:0,minlen:u});return}let w=n.addBorderNode(l,"_bt"),b=n.addBorderNode(l,"_bb"),E=l.node(g);l.setParent(w,g),E.borderTop=w,l.setParent(b,g),E.borderBottom=b,y.forEach(v=>{r(l,c,u,d,h,f,v);let m=l.node(v),T=m.borderTop?m.borderTop:v,B=m.borderBottom?m.borderBottom:v,H=m.borderTop?d:2*d,F=T!==B?1:h-f[g]+1;l.setEdge(w,T,{weight:H,minlen:F,nestingEdge:!0}),l.setEdge(B,b,{weight:H,minlen:F,nestingEdge:!0})}),l.parent(g)||l.setEdge(c,w,{weight:0,minlen:h+f[g]})}function i(l){var c={};function u(d,h){var f=l.children(d);f&&f.length&&f.forEach(g=>u(g,h+1)),c[d]=h}return l.children().forEach(d=>u(d,1)),c}function s(l){return l.edges().reduce((c,u)=>c+l.edge(u).weight,0)}function a(l){var c=l.graph();l.removeNode(c.nestingRoot),delete c.nestingRoot,l.edges().forEach(u=>{var d=l.edge(u);d.nestingEdge&&l.removeEdge(u)})}}),zc=Ne((e,t)=>{var n=De();t.exports=o;function o(i){function s(a){let l=i.children(a),c=i.node(a);if(l.length&&l.forEach(s),Object.hasOwn(c,"minRank")){c.borderLeft=[],c.borderRight=[];for(let u=c.minRank,d=c.maxRank+1;u<d;++u)r(i,"borderLeft","_bl",a,c,u),r(i,"borderRight","_br",a,c,u)}}i.children().forEach(s)}function r(i,s,a,l,c,u){let d={width:0,height:0,rank:u,borderType:s},h=c[s][u-1],f=n.addDummyNode(i,"border",d,a);c[s][u]=f,i.setParent(f,l),h&&i.setEdge(h,f,{weight:1})}}),Bc=Ne((e,t)=>{t.exports={adjust:n,undo:o};function n(u){let d=u.graph().rankdir.toLowerCase();(d==="lr"||d==="rl")&&r(u)}function o(u){let d=u.graph().rankdir.toLowerCase();(d==="bt"||d==="rl")&&s(u),(d==="lr"||d==="rl")&&(l(u),r(u))}function r(u){u.nodes().forEach(d=>i(u.node(d))),u.edges().forEach(d=>i(u.edge(d)))}function i(u){let d=u.width;u.width=u.height,u.height=d}function s(u){u.nodes().forEach(d=>a(u.node(d))),u.edges().forEach(d=>{let h=u.edge(d);h.points.forEach(a),Object.hasOwn(h,"y")&&a(h)})}function a(u){u.y=-u.y}function l(u){u.nodes().forEach(d=>c(u.node(d))),u.edges().forEach(d=>{let h=u.edge(d);h.points.forEach(c),Object.hasOwn(h,"x")&&c(h)})}function c(u){let d=u.x;u.x=u.y,u.y=d}}),Rc=Ne((e,t)=>{var n=De();t.exports=o;function o(r){let i={},s=r.nodes().filter(d=>!r.children(d).length),a=s.map(d=>r.node(d).rank),l=n.applyWithChunking(Math.max,a),c=n.range(l+1).map(()=>[]);function u(d){if(i[d])return;i[d]=!0;let h=r.node(d);c[h.rank].push(d),r.successors(d).forEach(u)}return s.sort((d,h)=>r.node(d).rank-r.node(h).rank).forEach(u),c}}),Lc=Ne((e,t)=>{var n=De().zipObject;t.exports=o;function o(i,s){let a=0;for(let l=1;l<s.length;++l)a+=r(i,s[l-1],s[l]);return a}function r(i,s,a){let l=n(a,a.map((g,y)=>y)),c=s.flatMap(g=>i.outEdges(g).map(y=>({pos:l[y.w],weight:i.edge(y).weight})).sort((y,w)=>y.pos-w.pos)),u=1;for(;u<a.length;)u<<=1;let d=2*u-1;u-=1;let h=new Array(d).fill(0),f=0;return c.forEach(g=>{let y=g.pos+u;h[y]+=g.weight;let w=0;for(;y>0;)y%2&&(w+=h[y+1]),y=y-1>>1,h[y]+=g.weight;f+=g.weight*w}),f}}),Vc=Ne((e,t)=>{t.exports=n;function n(o,r=[]){return r.map(i=>{let s=o.inEdges(i);if(s.length){let a=s.reduce((l,c)=>{let u=o.edge(c),d=o.node(c.v);return{sum:l.sum+u.weight*d.order,weight:l.weight+u.weight}},{sum:0,weight:0});return{v:i,barycenter:a.sum/a.weight,weight:a.weight}}else return{v:i}})}}),Fc=Ne((e,t)=>{var n=De();t.exports=o;function o(s,a){let l={};s.forEach((u,d)=>{let h=l[u.v]={indegree:0,in:[],out:[],vs:[u.v],i:d};u.barycenter!==void 0&&(h.barycenter=u.barycenter,h.weight=u.weight)}),a.edges().forEach(u=>{let d=l[u.v],h=l[u.w];d!==void 0&&h!==void 0&&(h.indegree++,d.out.push(l[u.w]))});let c=Object.values(l).filter(u=>!u.indegree);return r(c)}function r(s){let a=[];function l(u){return d=>{d.merged||(d.barycenter===void 0||u.barycenter===void 0||d.barycenter>=u.barycenter)&&i(u,d)}}function c(u){return d=>{d.in.push(u),--d.indegree===0&&s.push(d)}}for(;s.length;){let u=s.pop();a.push(u),u.in.reverse().forEach(l(u)),u.out.forEach(c(u))}return a.filter(u=>!u.merged).map(u=>n.pick(u,["vs","i","barycenter","weight"]))}function i(s,a){let l=0,c=0;s.weight&&(l+=s.barycenter*s.weight,c+=s.weight),a.weight&&(l+=a.barycenter*a.weight,c+=a.weight),s.vs=a.vs.concat(s.vs),s.barycenter=l/c,s.weight=c,s.i=Math.min(a.i,s.i),a.merged=!0}}),Hc=Ne((e,t)=>{var n=De();t.exports=o;function o(s,a){let l=n.partition(s,w=>Object.hasOwn(w,"barycenter")),c=l.lhs,u=l.rhs.sort((w,b)=>b.i-w.i),d=[],h=0,f=0,g=0;c.sort(i(!!a)),g=r(d,u,g),c.forEach(w=>{g+=w.vs.length,d.push(w.vs),h+=w.barycenter*w.weight,f+=w.weight,g=r(d,u,g)});let y={vs:d.flat(!0)};return f&&(y.barycenter=h/f,y.weight=f),y}function r(s,a,l){let c;for(;a.length&&(c=a[a.length-1]).i<=l;)a.pop(),s.push(c.vs),l++;return l}function i(s){return(a,l)=>a.barycenter<l.barycenter?-1:a.barycenter>l.barycenter?1:s?l.i-a.i:a.i-l.i}}),Gc=Ne((e,t)=>{var n=Vc(),o=Fc(),r=Hc();t.exports=i;function i(l,c,u,d){let h=l.children(c),f=l.node(c),g=f?f.borderLeft:void 0,y=f?f.borderRight:void 0,w={};g&&(h=h.filter(m=>m!==g&&m!==y));let b=n(l,h);b.forEach(m=>{if(l.children(m.v).length){let T=i(l,m.v,u,d);w[m.v]=T,Object.hasOwn(T,"barycenter")&&a(m,T)}});let E=o(b,u);s(E,w);let v=r(E,d);if(g&&(v.vs=[g,v.vs,y].flat(!0),l.predecessors(g).length)){let m=l.node(l.predecessors(g)[0]),T=l.node(l.predecessors(y)[0]);Object.hasOwn(v,"barycenter")||(v.barycenter=0,v.weight=0),v.barycenter=(v.barycenter*v.weight+m.order+T.order)/(v.weight+2),v.weight+=2}return v}function s(l,c){l.forEach(u=>{u.vs=u.vs.flatMap(d=>c[d]?c[d].vs:d)})}function a(l,c){l.barycenter!==void 0?(l.barycenter=(l.barycenter*l.weight+c.barycenter*c.weight)/(l.weight+c.weight),l.weight+=c.weight):(l.barycenter=c.barycenter,l.weight=c.weight)}}),qc=Ne((e,t)=>{var n=Ze().Graph,o=De();t.exports=r;function r(s,a,l,c){c||(c=s.nodes());let u=i(s),d=new n({compound:!0}).setGraph({root:u}).setDefaultNodeLabel(h=>s.node(h));return c.forEach(h=>{let f=s.node(h),g=s.parent(h);(f.rank===a||f.minRank<=a&&a<=f.maxRank)&&(d.setNode(h),d.setParent(h,g||u),s[l](h).forEach(y=>{let w=y.v===h?y.w:y.v,b=d.edge(w,h),E=b!==void 0?b.weight:0;d.setEdge(w,h,{weight:s.edge(y).weight+E})}),Object.hasOwn(f,"minRank")&&d.setNode(h,{borderLeft:f.borderLeft[a],borderRight:f.borderRight[a]}))}),d}function i(s){for(var a;s.hasNode(a=o.uniqueId("_root")););return a}}),jc=Ne((e,t)=>{t.exports=n;function n(o,r,i){let s={},a;i.forEach(l=>{let c=o.parent(l),u,d;for(;c;){if(u=o.parent(c),u?(d=s[u],s[u]=c):(d=a,a=c),d&&d!==c){r.setEdge(d,c);return}c=u}})}}),Yc=Ne((e,t)=>{var n=Rc(),o=Lc(),r=Gc(),i=qc(),s=jc(),a=Ze().Graph,l=De();t.exports=c;function c(f,g={}){if(typeof g.customOrder=="function"){g.customOrder(f,c);return}let y=l.maxRank(f),w=u(f,l.range(1,y+1),"inEdges"),b=u(f,l.range(y-1,-1,-1),"outEdges"),E=n(f);if(h(f,E),g.disableOptimalOrderHeuristic)return;let v=Number.POSITIVE_INFINITY,m,T=g.constraints||[];for(let B=0,H=0;H<4;++B,++H){d(B%2?w:b,B%4>=2,T),E=l.buildLayerMatrix(f);let F=o(f,E);F<v?(H=0,m=Object.assign({},E),v=F):F===v&&(m=structuredClone(E))}h(f,m)}function u(f,g,y){let w=new Map,b=(E,v)=>{w.has(E)||w.set(E,[]),w.get(E).push(v)};for(let E of f.nodes()){let v=f.node(E);if(typeof v.rank=="number"&&b(v.rank,E),typeof v.minRank=="number"&&typeof v.maxRank=="number")for(let m=v.minRank;m<=v.maxRank;m++)m!==v.rank&&b(m,E)}return g.map(function(E){return i(f,E,y,w.get(E)||[])})}function d(f,g,y){let w=new a;f.forEach(function(b){y.forEach(m=>w.setEdge(m.left,m.right));let E=b.graph().root,v=r(b,E,w,g);v.vs.forEach((m,T)=>b.node(m).order=T),s(b,w,v.vs)})}function h(f,g){Object.values(g).forEach(y=>y.forEach((w,b)=>f.node(w).order=b))}}),Wc=Ne((e,t)=>{var n=Ze().Graph,o=De();t.exports={positionX:y,findType1Conflicts:r,findType2Conflicts:i,addConflict:a,hasConflict:l,verticalAlignment:c,horizontalCompaction:u,alignCoordinates:f,findSmallestWidthAlignment:h,balance:g};function r(E,v){let m={};function T(B,H){let F=0,K=0,I=B.length,A=H[H.length-1];return H.forEach((S,C)=>{let p=s(E,S),N=p?E.node(p).order:I;(p||S===A)&&(H.slice(K,C+1).forEach(_=>{E.predecessors(_).forEach($=>{let P=E.node($),G=P.order;(G<F||N<G)&&!(P.dummy&&E.node(_).dummy)&&a(m,$,_)})}),K=C+1,F=N)}),H}return v.length&&v.reduce(T),m}function i(E,v){let m={};function T(H,F,K,I,A){let S;o.range(F,K).forEach(C=>{S=H[C],E.node(S).dummy&&E.predecessors(S).forEach(p=>{let N=E.node(p);N.dummy&&(N.order<I||N.order>A)&&a(m,p,S)})})}function B(H,F){let K=-1,I,A=0;return F.forEach((S,C)=>{if(E.node(S).dummy==="border"){let p=E.predecessors(S);p.length&&(I=E.node(p[0]).order,T(F,A,C,K,I),A=C,K=I)}T(F,A,F.length,I,H.length)}),F}return v.length&&v.reduce(B),m}function s(E,v){if(E.node(v).dummy)return E.predecessors(v).find(m=>E.node(m).dummy)}function a(E,v,m){if(v>m){let B=v;v=m,m=B}let T=E[v];T||(E[v]=T={}),T[m]=!0}function l(E,v,m){if(v>m){let T=v;v=m,m=T}return!!E[v]&&Object.hasOwn(E[v],m)}function c(E,v,m,T){let B={},H={},F={};return v.forEach(K=>{K.forEach((I,A)=>{B[I]=I,H[I]=I,F[I]=A})}),v.forEach(K=>{let I=-1;K.forEach(A=>{let S=T(A);if(S.length){S=S.sort((p,N)=>F[p]-F[N]);let C=(S.length-1)/2;for(let p=Math.floor(C),N=Math.ceil(C);p<=N;++p){let _=S[p];H[A]===A&&I<F[_]&&!l(m,A,_)&&(H[_]=A,H[A]=B[A]=B[_],I=F[_])}}})}),{root:B,align:H}}function u(E,v,m,T,B){let H={},F=d(E,v,m,B),K=B?"borderLeft":"borderRight";function I(C,p){let N=F.nodes().slice(),_={},$=N.pop();for(;$;){if(_[$])C($);else{_[$]=!0,N.push($);for(let P of p($))N.push(P)}$=N.pop()}}function A(C){H[C]=F.inEdges(C).reduce((p,N)=>Math.max(p,H[N.v]+F.edge(N)),0)}function S(C){let p=F.outEdges(C).reduce((_,$)=>Math.min(_,H[$.w]-F.edge($)),Number.POSITIVE_INFINITY),N=E.node(C);p!==Number.POSITIVE_INFINITY&&N.borderType!==K&&(H[C]=Math.max(H[C],p))}return I(A,F.predecessors.bind(F)),I(S,F.successors.bind(F)),Object.keys(T).forEach(C=>H[C]=H[m[C]]),H}function d(E,v,m,T){let B=new n,H=E.graph(),F=w(H.nodesep,H.edgesep,T);return v.forEach(K=>{let I;K.forEach(A=>{let S=m[A];if(B.setNode(S),I){var C=m[I],p=B.edge(C,S);B.setEdge(C,S,Math.max(F(E,A,I),p||0))}I=A})}),B}function h(E,v){return Object.values(v).reduce((m,T)=>{let B=Number.NEGATIVE_INFINITY,H=Number.POSITIVE_INFINITY;Object.entries(T).forEach(([K,I])=>{let A=b(E,K)/2;B=Math.max(I+A,B),H=Math.min(I-A,H)});let F=B-H;return F<m[0]&&(m=[F,T]),m},[Number.POSITIVE_INFINITY,null])[1]}function f(E,v){let m=Object.values(v),T=o.applyWithChunking(Math.min,m),B=o.applyWithChunking(Math.max,m);["u","d"].forEach(H=>{["l","r"].forEach(F=>{let K=H+F,I=E[K];if(I===v)return;let A=Object.values(I),S=T-o.applyWithChunking(Math.min,A);F!=="l"&&(S=B-o.applyWithChunking(Math.max,A)),S&&(E[K]=o.mapValues(I,C=>C+S))})})}function g(E,v){return o.mapValues(E.ul,(m,T)=>{if(v)return E[v.toLowerCase()][T];{let B=Object.values(E).map(H=>H[T]).sort((H,F)=>H-F);return(B[1]+B[2])/2}})}function y(E){let v=o.buildLayerMatrix(E),m=Object.assign(r(E,v),i(E,v)),T={},B;["u","d"].forEach(F=>{B=F==="u"?v:Object.values(v).reverse(),["l","r"].forEach(K=>{K==="r"&&(B=B.map(C=>Object.values(C).reverse()));let I=(F==="u"?E.predecessors:E.successors).bind(E),A=c(E,B,m,I),S=u(E,B,A.root,A.align,K==="r");K==="r"&&(S=o.mapValues(S,C=>-C)),T[F+K]=S})});let H=h(E,T);return f(T,H),g(T,E.graph().align)}function w(E,v,m){return(T,B,H)=>{let F=T.node(B),K=T.node(H),I=0,A;if(I+=F.width/2,Object.hasOwn(F,"labelpos"))switch(F.labelpos.toLowerCase()){case"l":A=-F.width/2;break;case"r":A=F.width/2;break}if(A&&(I+=m?A:-A),A=0,I+=(F.dummy?v:E)/2,I+=(K.dummy?v:E)/2,I+=K.width/2,Object.hasOwn(K,"labelpos"))switch(K.labelpos.toLowerCase()){case"l":A=K.width/2;break;case"r":A=-K.width/2;break}return A&&(I+=m?A:-A),A=0,I}}function b(E,v){return E.node(v).width}}),Xc=Ne((e,t)=>{var n=De(),o=Wc().positionX;t.exports=r;function r(s){s=n.asNonCompoundGraph(s),i(s),Object.entries(o(s)).forEach(([a,l])=>s.node(a).x=l)}function i(s){let a=n.buildLayerMatrix(s),l=s.graph().ranksep,c=s.graph().rankalign,u=0;a.forEach(d=>{let h=d.reduce((f,g)=>{let y=s.node(g).height;return f>y?f:y},0);d.forEach(f=>{let g=s.node(f);c==="top"?g.y=u+g.height/2:c==="bottom"?g.y=u+h-g.height/2:g.y=u+h/2}),u+=h+l})}}),Uc=Ne((e,t)=>{var n=Tc(),o=Oc(),r=Ic(),i=De().normalizeRanks,s=Dc(),a=De().removeEmptyRanks,l=Ac(),c=zc(),u=Bc(),d=Yc(),h=Xc(),f=De(),g=Ze().Graph;t.exports=y;function y(x,O={}){let R=O.debugTiming?f.time:f.notime;return R("layout",()=>{let W=R(" buildLayoutGraph",()=>I(x));return R(" runLayout",()=>w(W,R,O)),R(" updateInputGraph",()=>b(x,W)),W})}function w(x,O,R){O(" makeSpaceForEdgeLabels",()=>A(x)),O(" removeSelfEdges",()=>L(x)),O(" acyclic",()=>n.run(x)),O(" nestingGraph.run",()=>l.run(x)),O(" rank",()=>r(f.asNonCompoundGraph(x))),O(" injectEdgeLabelProxies",()=>S(x)),O(" removeEmptyRanks",()=>a(x)),O(" nestingGraph.cleanup",()=>l.cleanup(x)),O(" normalizeRanks",()=>i(x)),O(" assignRankMinMax",()=>C(x)),O(" removeEdgeLabelProxies",()=>p(x)),O(" normalize.run",()=>o.run(x)),O(" parentDummyChains",()=>s(x)),O(" addBorderSegments",()=>c(x)),O(" order",()=>d(x,R)),O(" insertSelfEdges",()=>q(x)),O(" adjustCoordinateSystem",()=>u.adjust(x)),O(" position",()=>h(x)),O(" positionSelfEdges",()=>U(x)),O(" removeBorderNodes",()=>G(x)),O(" normalize.undo",()=>o.undo(x)),O(" fixupEdgeLabelCoords",()=>$(x)),O(" undoCoordinateSystem",()=>u.undo(x)),O(" translateGraph",()=>N(x)),O(" assignNodeIntersects",()=>_(x)),O(" reversePoints",()=>P(x)),O(" acyclic.undo",()=>n.undo(x))}function b(x,O){x.nodes().forEach(R=>{let W=x.node(R),Q=O.node(R);W&&(W.x=Q.x,W.y=Q.y,W.order=Q.order,W.rank=Q.rank,O.children(R).length&&(W.width=Q.width,W.height=Q.height))}),x.edges().forEach(R=>{let W=x.edge(R),Q=O.edge(R);W.points=Q.points,Object.hasOwn(Q,"x")&&(W.x=Q.x,W.y=Q.y)}),x.graph().width=O.graph().width,x.graph().height=O.graph().height}var E=["nodesep","edgesep","ranksep","marginx","marginy"],v={ranksep:50,edgesep:20,nodesep:50,rankdir:"tb",rankalign:"center"},m=["acyclicer","ranker","rankdir","align","rankalign"],T=["width","height","rank"],B={width:0,height:0},H=["minlen","weight","width","height","labeloffset"],F={minlen:1,weight:1,width:0,height:0,labeloffset:10,labelpos:"r"},K=["labelpos"];function I(x){let O=new g({multigraph:!0,compound:!0}),R=D(x.graph());return O.setGraph(Object.assign({},v,J(R,E),f.pick(R,m))),x.nodes().forEach(W=>{let Q=D(x.node(W)),te=J(Q,T);Object.keys(B).forEach(re=>{te[re]===void 0&&(te[re]=B[re])}),O.setNode(W,te),O.setParent(W,x.parent(W))}),x.edges().forEach(W=>{let Q=D(x.edge(W));O.setEdge(W,Object.assign({},F,J(Q,H),f.pick(Q,K)))}),O}function A(x){let O=x.graph();O.ranksep/=2,x.edges().forEach(R=>{let W=x.edge(R);W.minlen*=2,W.labelpos.toLowerCase()!=="c"&&(O.rankdir==="TB"||O.rankdir==="BT"?W.width+=W.labeloffset:W.height+=W.labeloffset)})}function S(x){x.edges().forEach(O=>{let R=x.edge(O);if(R.width&&R.height){let W=x.node(O.v),Q={rank:(x.node(O.w).rank-W.rank)/2+W.rank,e:O};f.addDummyNode(x,"edge-proxy",Q,"_ep")}})}function C(x){let O=0;x.nodes().forEach(R=>{let W=x.node(R);W.borderTop&&(W.minRank=x.node(W.borderTop).rank,W.maxRank=x.node(W.borderBottom).rank,O=Math.max(O,W.maxRank))}),x.graph().maxRank=O}function p(x){x.nodes().forEach(O=>{let R=x.node(O);R.dummy==="edge-proxy"&&(x.edge(R.e).labelRank=R.rank,x.removeNode(O))})}function N(x){let O=Number.POSITIVE_INFINITY,R=0,W=Number.POSITIVE_INFINITY,Q=0,te=x.graph(),re=te.marginx||0,ae=te.marginy||0;function me(z){let M=z.x,V=z.y,X=z.width,Y=z.height;O=Math.min(O,M-X/2),R=Math.max(R,M+X/2),W=Math.min(W,V-Y/2),Q=Math.max(Q,V+Y/2)}x.nodes().forEach(z=>me(x.node(z))),x.edges().forEach(z=>{let M=x.edge(z);Object.hasOwn(M,"x")&&me(M)}),O-=re,W-=ae,x.nodes().forEach(z=>{let M=x.node(z);M.x-=O,M.y-=W}),x.edges().forEach(z=>{let M=x.edge(z);M.points.forEach(V=>{V.x-=O,V.y-=W}),Object.hasOwn(M,"x")&&(M.x-=O),Object.hasOwn(M,"y")&&(M.y-=W)}),te.width=R-O+re,te.height=Q-W+ae}function _(x){x.edges().forEach(O=>{let R=x.edge(O),W=x.node(O.v),Q=x.node(O.w),te,re;R.points?(te=R.points[0],re=R.points[R.points.length-1]):(R.points=[],te=Q,re=W),R.points.unshift(f.intersectRect(W,te)),R.points.push(f.intersectRect(Q,re))})}function $(x){x.edges().forEach(O=>{let R=x.edge(O);if(Object.hasOwn(R,"x"))switch((R.labelpos==="l"||R.labelpos==="r")&&(R.width-=R.labeloffset),R.labelpos){case"l":R.x-=R.width/2+R.labeloffset;break;case"r":R.x+=R.width/2+R.labeloffset;break}})}function P(x){x.edges().forEach(O=>{let R=x.edge(O);R.reversed&&R.points.reverse()})}function G(x){x.nodes().forEach(O=>{if(x.children(O).length){let R=x.node(O),W=x.node(R.borderTop),Q=x.node(R.borderBottom),te=x.node(R.borderLeft[R.borderLeft.length-1]),re=x.node(R.borderRight[R.borderRight.length-1]);R.width=Math.abs(re.x-te.x),R.height=Math.abs(Q.y-W.y),R.x=te.x+R.width/2,R.y=W.y+R.height/2}}),x.nodes().forEach(O=>{x.node(O).dummy==="border"&&x.removeNode(O)})}function L(x){x.edges().forEach(O=>{if(O.v===O.w){var R=x.node(O.v);R.selfEdges||(R.selfEdges=[]),R.selfEdges.push({e:O,label:x.edge(O)}),x.removeEdge(O)}})}function q(x){var O=f.buildLayerMatrix(x);O.forEach(R=>{var W=0;R.forEach((Q,te)=>{var re=x.node(Q);re.order=te+W,(re.selfEdges||[]).forEach(ae=>{f.addDummyNode(x,"selfedge",{width:ae.label.width,height:ae.label.height,rank:re.rank,order:te+ ++W,e:ae.e,label:ae.label},"_se")}),delete re.selfEdges})})}function U(x){x.nodes().forEach(O=>{var R=x.node(O);if(R.dummy==="selfedge"){var W=x.node(R.e.v),Q=W.x+W.width/2,te=W.y,re=R.x-Q,ae=W.height/2;x.setEdge(R.e,R.label),x.removeNode(O),R.label.points=[{x:Q+2*re/3,y:te-ae},{x:Q+5*re/6,y:te-ae},{x:Q+re,y:te},{x:Q+5*re/6,y:te+ae},{x:Q+2*re/3,y:te+ae}],R.label.x=R.x,R.label.y=R.y}})}function J(x,O){return f.mapValues(f.pick(x,O),Number)}function D(x){var O={};return x&&Object.entries(x).forEach(([R,W])=>{typeof R=="string"&&(R=R.toLowerCase()),O[R]=W}),O}}),Zc=Ne((e,t)=>{var n=De(),o=Ze().Graph;t.exports={debugOrdering:r};function r(i){let s=n.buildLayerMatrix(i),a=new o({compound:!0,multigraph:!0}).setGraph({});return i.nodes().forEach(l=>{a.setNode(l,{label:l}),a.setParent(l,"layer"+i.node(l).rank)}),i.edges().forEach(l=>a.setEdge(l.v,l.w,{},l.name)),s.forEach((l,c)=>{let u="layer"+c;a.setNode(u,{rank:"same"}),l.reduce((d,h)=>(a.setEdge(d,h,{style:"invis"}),h))}),a}}),Kc=Ne((e,t)=>{t.exports="2.0.4"}),Jc=Ne((e,t)=>{t.exports={graphlib:Ze(),layout:Uc(),debug:Zc(),util:{time:De().time,notime:De().notime},version:Kc()}});const jr=Jc();function mn(e){return ur()?(dn(e),!0):!1}function ct(e){return typeof e=="function"?e():k(e)}const Qc=typeof window<"u"&&typeof document<"u",ed=e=>typeof e<"u",td=Object.prototype.toString,nd=e=>td.call(e)==="[object Object]",od=()=>{};function rd(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 fs=e=>e();function id(e=fs){const t=ce(!0);function n(){t.value=!1}function o(){t.value=!0}const r=(...i)=>{t.value&&e(...i)};return{isActive:an(t),pause:n,resume:o,eventFilter:r}}function Yr(e,t=!1,n="Timeout"){return new Promise((o,r)=>{setTimeout(t?()=>r(n):o,e)})}function sd(e,t,n={}){const{eventFilter:o=fs,...r}=n;return _e(e,rd(o,t),r)}function Rt(e,t,n={}){const{eventFilter:o,...r}=n,{eventFilter:i,pause:s,resume:a,isActive:l}=id(o);return{stop:sd(e,t,{...r,eventFilter:i}),pause:s,resume:a,isActive:l}}function ad(e,t={}){if(!cr(e))return Yi(e);const n=Array.isArray(e.value)?Array.from({length:e.value.length}):{};for(const o in e.value)n[o]=Va(()=>({get(){return e.value[o]},set(r){var i;if((i=ct(t.replaceRef))!=null?i:!0)if(Array.isArray(e.value)){const a=[...e.value];a[o]=r,e.value=a}else{const a={...e.value,[o]:r};Object.setPrototypeOf(a,Object.getPrototypeOf(e.value)),e.value=a}else e.value[o]=r}}));return n}function Uo(e,t=!1){function n(d,{flush:h="sync",deep:f=!1,timeout:g,throwOnTimeout:y}={}){let w=null;const E=[new Promise(v=>{w=_e(e,m=>{d(m)!==t&&(w?.(),v(m))},{flush:h,deep:f,immediate:!0})})];return g!=null&&E.push(Yr(g,y).then(()=>ct(e)).finally(()=>w?.())),Promise.race(E)}function o(d,h){if(!cr(d))return n(m=>m===d,h);const{flush:f="sync",deep:g=!1,timeout:y,throwOnTimeout:w}=h??{};let b=null;const v=[new Promise(m=>{b=_e([e,d],([T,B])=>{t!==(T===B)&&(b?.(),m(T))},{flush:f,deep:g,immediate:!0})})];return y!=null&&v.push(Yr(y,w).then(()=>ct(e)).finally(()=>(b?.(),ct(e)))),Promise.race(v)}function r(d){return n(h=>!!h,d)}function i(d){return o(null,d)}function s(d){return o(void 0,d)}function a(d){return n(Number.isNaN,d)}function l(d,h){return n(f=>{const g=Array.from(f);return g.includes(d)||g.includes(ct(d))},h)}function c(d){return u(1,d)}function u(d=1,h){let f=-1;return n(()=>(f+=1,f>=d),h)}return Array.isArray(ct(e))?{toMatch:n,toContains:l,changed:c,changedTimes:u,get not(){return Uo(e,!t)}}:{toMatch:n,toBe:o,toBeTruthy:r,toBeNull:i,toBeNaN:a,toBeUndefined:s,changed:c,changedTimes:u,get not(){return Uo(e,!t)}}}function Zo(e){return Uo(e)}function ld(e){var t;const n=ct(e);return(t=n?.$el)!=null?t:n}const hs=Qc?window:void 0;function ps(...e){let t,n,o,r;if(typeof e[0]=="string"||Array.isArray(e[0])?([n,o,r]=e,t=hs):[t,n,o,r]=e,!t)return od;Array.isArray(n)||(n=[n]),Array.isArray(o)||(o=[o]);const i=[],s=()=>{i.forEach(u=>u()),i.length=0},a=(u,d,h,f)=>(u.addEventListener(d,h,f),()=>u.removeEventListener(d,h,f)),l=_e(()=>[ld(t),ct(r)],([u,d])=>{if(s(),!u)return;const h=nd(d)?{...d}:d;i.push(...n.flatMap(f=>o.map(g=>a(u,f,g,h))))},{immediate:!0,flush:"post"}),c=()=>{l(),s()};return mn(c),c}function ud(e){return typeof e=="function"?e:typeof e=="string"?t=>t.key===e:Array.isArray(e)?t=>e.includes(t.key):()=>!0}function Wr(...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=hs,eventName:i="keydown",passive:s=!1,dedupe:a=!1}=o,l=ud(t);return ps(r,i,u=>{u.repeat&&ct(a)||l(u)&&n(u)},s)}function cd(e){return JSON.parse(JSON.stringify(e))}function Oo(e,t,n,o={}){var r,i,s;const{clone:a=!1,passive:l=!1,eventName:c,deep:u=!1,defaultValue:d,shouldEmit:h}=o,f=nn(),g=n||f?.emit||((r=f?.$emit)==null?void 0:r.bind(f))||((s=(i=f?.proxy)==null?void 0:i.$emit)==null?void 0:s.bind(f?.proxy));let y=c;t||(t="modelValue"),y=y||`update:${t.toString()}`;const w=v=>a?typeof a=="function"?a(v):cd(v):v,b=()=>ed(e[t])?w(e[t]):d,E=v=>{h?h(v)&&g(y,v):g(y,v)};if(l){const v=b(),m=ce(v);let T=!1;return _e(()=>e[t],B=>{T||(T=!0,m.value=w(B),pt(()=>T=!1))}),_e(m,B=>{!T&&(B!==e[t]||u)&&E(B)},{deep:u}),m}else return ne({get(){return b()},set(v){E(v)}})}var dd={value:()=>{}};function wo(){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 Fn(n)}function Fn(e){this._=e}function fd(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}})}Fn.prototype=wo.prototype={constructor:Fn,on:function(e,t){var n=this._,o=fd(e+"",n),r,i=-1,s=o.length;if(arguments.length<2){for(;++i<s;)if((r=(e=o[i]).type)&&(r=hd(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]=Xr(n[r],e.name,t);else if(t==null)for(r in n)n[r]=Xr(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 Fn(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 hd(e,t){for(var n=0,o=e.length,r;n<o;++n)if((r=e[n]).name===t)return r.value}function Xr(e,t,n){for(var o=0,r=e.length;o<r;++o)if(e[o].name===t){e[o]=dd,e=e.slice(0,o).concat(e.slice(o+1));break}return n!=null&&e.push({name:t,value:n}),e}var Ko="http://www.w3.org/1999/xhtml";const Ur={svg:"http://www.w3.org/2000/svg",xhtml:Ko,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function _o(e){var t=e+="",n=t.indexOf(":");return n>=0&&(t=e.slice(0,n))!=="xmlns"&&(e=e.slice(n+1)),Ur.hasOwnProperty(t)?{space:Ur[t],local:e}:e}function pd(e){return function(){var t=this.ownerDocument,n=this.namespaceURI;return n===Ko&&t.documentElement.namespaceURI===Ko?t.createElement(e):t.createElementNS(n,e)}}function gd(e){return function(){return this.ownerDocument.createElementNS(e.space,e.local)}}function gs(e){var t=_o(e);return(t.local?gd:pd)(t)}function vd(){}function _r(e){return e==null?vd:function(){return this.querySelector(e)}}function md(e){typeof e!="function"&&(e=_r(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,a=o[r]=new Array(s),l,c,u=0;u<s;++u)(l=i[u])&&(c=e.call(l,l.__data__,u,i))&&("__data__"in l&&(c.__data__=l.__data__),a[u]=c);return new Fe(o,this._parents)}function yd(e){return e==null?[]:Array.isArray(e)?e:Array.from(e)}function wd(){return[]}function vs(e){return e==null?wd:function(){return this.querySelectorAll(e)}}function _d(e){return function(){return yd(e.apply(this,arguments))}}function xd(e){typeof e=="function"?e=_d(e):e=vs(e);for(var t=this._groups,n=t.length,o=[],r=[],i=0;i<n;++i)for(var s=t[i],a=s.length,l,c=0;c<a;++c)(l=s[c])&&(o.push(e.call(l,l.__data__,c,s)),r.push(l));return new Fe(o,r)}function ms(e){return function(){return this.matches(e)}}function ys(e){return function(t){return t.matches(e)}}var bd=Array.prototype.find;function Ed(e){return function(){return bd.call(this.children,e)}}function kd(){return this.firstElementChild}function Sd(e){return this.select(e==null?kd:Ed(typeof e=="function"?e:ys(e)))}var Cd=Array.prototype.filter;function Nd(){return Array.from(this.children)}function $d(e){return function(){return Cd.call(this.children,e)}}function Md(e){return this.selectAll(e==null?Nd:$d(typeof e=="function"?e:ys(e)))}function Td(e){typeof e!="function"&&(e=ms(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,a=o[r]=[],l,c=0;c<s;++c)(l=i[c])&&e.call(l,l.__data__,c,i)&&a.push(l);return new Fe(o,this._parents)}function ws(e){return new Array(e.length)}function Od(){return new Fe(this._enter||this._groups.map(ws),this._parents)}function Jn(e,t){this.ownerDocument=e.ownerDocument,this.namespaceURI=e.namespaceURI,this._next=null,this._parent=e,this.__data__=t}Jn.prototype={constructor:Jn,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 Pd(e){return function(){return e}}function Id(e,t,n,o,r,i){for(var s=0,a,l=t.length,c=i.length;s<c;++s)(a=t[s])?(a.__data__=i[s],o[s]=a):n[s]=new Jn(e,i[s]);for(;s<l;++s)(a=t[s])&&(r[s]=a)}function Dd(e,t,n,o,r,i,s){var a,l,c=new Map,u=t.length,d=i.length,h=new Array(u),f;for(a=0;a<u;++a)(l=t[a])&&(h[a]=f=s.call(l,l.__data__,a,t)+"",c.has(f)?r[a]=l:c.set(f,l));for(a=0;a<d;++a)f=s.call(e,i[a],a,i)+"",(l=c.get(f))?(o[a]=l,l.__data__=i[a],c.delete(f)):n[a]=new Jn(e,i[a]);for(a=0;a<u;++a)(l=t[a])&&c.get(h[a])===l&&(r[a]=l)}function Ad(e){return e.__data__}function zd(e,t){if(!arguments.length)return Array.from(this,Ad);var n=t?Dd:Id,o=this._parents,r=this._groups;typeof e!="function"&&(e=Pd(e));for(var i=r.length,s=new Array(i),a=new Array(i),l=new Array(i),c=0;c<i;++c){var u=o[c],d=r[c],h=d.length,f=Bd(e.call(u,u&&u.__data__,c,o)),g=f.length,y=a[c]=new Array(g),w=s[c]=new Array(g),b=l[c]=new Array(h);n(u,d,y,w,b,f,t);for(var E=0,v=0,m,T;E<g;++E)if(m=y[E]){for(E>=v&&(v=E+1);!(T=w[v])&&++v<g;);m._next=T||null}}return s=new Fe(s,o),s._enter=a,s._exit=l,s}function Bd(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function Rd(){return new Fe(this._exit||this._groups.map(ws),this._parents)}function Ld(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 Vd(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),a=new Array(r),l=0;l<s;++l)for(var c=n[l],u=o[l],d=c.length,h=a[l]=new Array(d),f,g=0;g<d;++g)(f=c[g]||u[g])&&(h[g]=f);for(;l<r;++l)a[l]=n[l];return new Fe(a,this._parents)}function Fd(){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 Hd(e){e||(e=Gd);function t(d,h){return d&&h?e(d.__data__,h.__data__):!d-!h}for(var n=this._groups,o=n.length,r=new Array(o),i=0;i<o;++i){for(var s=n[i],a=s.length,l=r[i]=new Array(a),c,u=0;u<a;++u)(c=s[u])&&(l[u]=c);l.sort(t)}return new Fe(r,this._parents).order()}function Gd(e,t){return e<t?-1:e>t?1:e>=t?0:NaN}function qd(){var e=arguments[0];return arguments[0]=this,e.apply(null,arguments),this}function jd(){return Array.from(this)}function Yd(){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 Wd(){let e=0;for(const t of this)++e;return e}function Xd(){return!this.node()}function Ud(e){for(var t=this._groups,n=0,o=t.length;n<o;++n)for(var r=t[n],i=0,s=r.length,a;i<s;++i)(a=r[i])&&e.call(a,a.__data__,i,r);return this}function Zd(e){return function(){this.removeAttribute(e)}}function Kd(e){return function(){this.removeAttributeNS(e.space,e.local)}}function Jd(e,t){return function(){this.setAttribute(e,t)}}function Qd(e,t){return function(){this.setAttributeNS(e.space,e.local,t)}}function ef(e,t){return function(){var n=t.apply(this,arguments);n==null?this.removeAttribute(e):this.setAttribute(e,n)}}function tf(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 nf(e,t){var n=_o(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?Kd:Zd:typeof t=="function"?n.local?tf:ef:n.local?Qd:Jd)(n,t))}function _s(e){return e.ownerDocument&&e.ownerDocument.defaultView||e.document&&e||e.defaultView}function of(e){return function(){this.style.removeProperty(e)}}function rf(e,t,n){return function(){this.style.setProperty(e,t,n)}}function sf(e,t,n){return function(){var o=t.apply(this,arguments);o==null?this.style.removeProperty(e):this.style.setProperty(e,o,n)}}function af(e,t,n){return arguments.length>1?this.each((t==null?of:typeof t=="function"?sf:rf)(e,t,n??"")):Zt(this.node(),e)}function Zt(e,t){return e.style.getPropertyValue(t)||_s(e).getComputedStyle(e,null).getPropertyValue(t)}function lf(e){return function(){delete this[e]}}function uf(e,t){return function(){this[e]=t}}function cf(e,t){return function(){var n=t.apply(this,arguments);n==null?delete this[e]:this[e]=n}}function df(e,t){return arguments.length>1?this.each((t==null?lf:typeof t=="function"?cf:uf)(e,t)):this.node()[e]}function xs(e){return e.trim().split(/^|\s+/)}function xr(e){return e.classList||new bs(e)}function bs(e){this._node=e,this._names=xs(e.getAttribute("class")||"")}bs.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 Es(e,t){for(var n=xr(e),o=-1,r=t.length;++o<r;)n.add(t[o])}function ks(e,t){for(var n=xr(e),o=-1,r=t.length;++o<r;)n.remove(t[o])}function ff(e){return function(){Es(this,e)}}function hf(e){return function(){ks(this,e)}}function pf(e,t){return function(){(t.apply(this,arguments)?Es:ks)(this,e)}}function gf(e,t){var n=xs(e+"");if(arguments.length<2){for(var o=xr(this.node()),r=-1,i=n.length;++r<i;)if(!o.contains(n[r]))return!1;return!0}return this.each((typeof t=="function"?pf:t?ff:hf)(n,t))}function vf(){this.textContent=""}function mf(e){return function(){this.textContent=e}}function yf(e){return function(){var t=e.apply(this,arguments);this.textContent=t??""}}function wf(e){return arguments.length?this.each(e==null?vf:(typeof e=="function"?yf:mf)(e)):this.node().textContent}function _f(){this.innerHTML=""}function xf(e){return function(){this.innerHTML=e}}function bf(e){return function(){var t=e.apply(this,arguments);this.innerHTML=t??""}}function Ef(e){return arguments.length?this.each(e==null?_f:(typeof e=="function"?bf:xf)(e)):this.node().innerHTML}function kf(){this.nextSibling&&this.parentNode.appendChild(this)}function Sf(){return this.each(kf)}function Cf(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function Nf(){return this.each(Cf)}function $f(e){var t=typeof e=="function"?e:gs(e);return this.select(function(){return this.appendChild(t.apply(this,arguments))})}function Mf(){return null}function Tf(e,t){var n=typeof e=="function"?e:gs(e),o=t==null?Mf:typeof t=="function"?t:_r(t);return this.select(function(){return this.insertBefore(n.apply(this,arguments),o.apply(this,arguments)||null)})}function Of(){var e=this.parentNode;e&&e.removeChild(this)}function Pf(){return this.each(Of)}function If(){var e=this.cloneNode(!1),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function Df(){var e=this.cloneNode(!0),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function Af(e){return this.select(e?Df:If)}function zf(e){return arguments.length?this.property("__data__",e):this.node().__data__}function Bf(e){return function(t){e.call(this,t,this.__data__)}}function Rf(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 Lf(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 Vf(e,t,n){return function(){var o=this.__on,r,i=Bf(t);if(o){for(var s=0,a=o.length;s<a;++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 Ff(e,t,n){var o=Rf(e+""),r,i=o.length,s;if(arguments.length<2){var a=this.node().__on;if(a){for(var l=0,c=a.length,u;l<c;++l)for(r=0,u=a[l];r<i;++r)if((s=o[r]).type===u.type&&s.name===u.name)return u.value}return}for(a=t?Vf:Lf,r=0;r<i;++r)this.each(a(o[r],t,n));return this}function Ss(e,t,n){var o=_s(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 Hf(e,t){return function(){return Ss(this,e,t)}}function Gf(e,t){return function(){return Ss(this,e,t.apply(this,arguments))}}function qf(e,t){return this.each((typeof t=="function"?Gf:Hf)(e,t))}function*jf(){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 Cs=[null];function Fe(e,t){this._groups=e,this._parents=t}function Cn(){return new Fe([[document.documentElement]],Cs)}function Yf(){return this}Fe.prototype=Cn.prototype={constructor:Fe,select:md,selectAll:xd,selectChild:Sd,selectChildren:Md,filter:Td,data:zd,enter:Od,exit:Rd,join:Ld,merge:Vd,selection:Yf,order:Fd,sort:Hd,call:qd,nodes:jd,node:Yd,size:Wd,empty:Xd,each:Ud,attr:nf,style:af,property:df,classed:gf,text:wf,html:Ef,raise:Sf,lower:Nf,append:$f,insert:Tf,remove:Pf,clone:Af,datum:zf,on:Ff,dispatch:qf,[Symbol.iterator]:jf};function Ye(e){return typeof e=="string"?new Fe([[document.querySelector(e)]],[document.documentElement]):new Fe([[e]],Cs)}function Wf(e){let t;for(;t=e.sourceEvent;)e=t;return e}function et(e,t){if(e=Wf(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 Xf={passive:!1},yn={capture:!0,passive:!1};function Po(e){e.stopImmediatePropagation()}function qt(e){e.preventDefault(),e.stopImmediatePropagation()}function Ns(e){var t=e.document.documentElement,n=Ye(e).on("dragstart.drag",qt,yn);"onselectstart"in t?n.on("selectstart.drag",qt,yn):(t.__noselect=t.style.MozUserSelect,t.style.MozUserSelect="none")}function $s(e,t){var n=e.document.documentElement,o=Ye(e).on("dragstart.drag",null);t&&(o.on("click.drag",qt,yn),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 Tn=e=>()=>e;function Jo(e,{sourceEvent:t,subject:n,target:o,identifier:r,active:i,x:s,y:a,dx:l,dy:c,dispatch:u}){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:a,enumerable:!0,configurable:!0},dx:{value:l,enumerable:!0,configurable:!0},dy:{value:c,enumerable:!0,configurable:!0},_:{value:u}})}Jo.prototype.on=function(){var e=this._.on.apply(this._,arguments);return e===this._?this:e};function Uf(e){return!e.ctrlKey&&!e.button}function Zf(){return this.parentNode}function Kf(e,t){return t??{x:e.x,y:e.y}}function Jf(){return navigator.maxTouchPoints||"ontouchstart"in this}function Qf(){var e=Uf,t=Zf,n=Kf,o=Jf,r={},i=wo("start","drag","end"),s=0,a,l,c,u,d=0;function h(m){m.on("mousedown.drag",f).filter(o).on("touchstart.drag",w).on("touchmove.drag",b,Xf).on("touchend.drag touchcancel.drag",E).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function f(m,T){if(!(u||!e.call(this,m,T))){var B=v(this,t.call(this,m,T),m,T,"mouse");B&&(Ye(m.view).on("mousemove.drag",g,yn).on("mouseup.drag",y,yn),Ns(m.view),Po(m),c=!1,a=m.clientX,l=m.clientY,B("start",m))}}function g(m){if(qt(m),!c){var T=m.clientX-a,B=m.clientY-l;c=T*T+B*B>d}r.mouse("drag",m)}function y(m){Ye(m.view).on("mousemove.drag mouseup.drag",null),$s(m.view,c),qt(m),r.mouse("end",m)}function w(m,T){if(e.call(this,m,T)){var B=m.changedTouches,H=t.call(this,m,T),F=B.length,K,I;for(K=0;K<F;++K)(I=v(this,H,m,T,B[K].identifier,B[K]))&&(Po(m),I("start",m,B[K]))}}function b(m){var T=m.changedTouches,B=T.length,H,F;for(H=0;H<B;++H)(F=r[T[H].identifier])&&(qt(m),F("drag",m,T[H]))}function E(m){var T=m.changedTouches,B=T.length,H,F;for(u&&clearTimeout(u),u=setTimeout(function(){u=null},500),H=0;H<B;++H)(F=r[T[H].identifier])&&(Po(m),F("end",m,T[H]))}function v(m,T,B,H,F,K){var I=i.copy(),A=et(K||B,T),S,C,p;if((p=n.call(m,new Jo("beforestart",{sourceEvent:B,target:h,identifier:F,active:s,x:A[0],y:A[1],dx:0,dy:0,dispatch:I}),H))!=null)return S=p.x-A[0]||0,C=p.y-A[1]||0,function N(_,$,P){var G=A,L;switch(_){case"start":r[F]=N,L=s++;break;case"end":delete r[F],--s;case"drag":A=et(P||$,T),L=s;break}I.call(_,m,new Jo(_,{sourceEvent:$,subject:p,target:h,identifier:F,active:L,x:A[0]+S,y:A[1]+C,dx:A[0]-G[0],dy:A[1]-G[1],dispatch:I}),H)}}return h.filter=function(m){return arguments.length?(e=typeof m=="function"?m:Tn(!!m),h):e},h.container=function(m){return arguments.length?(t=typeof m=="function"?m:Tn(m),h):t},h.subject=function(m){return arguments.length?(n=typeof m=="function"?m:Tn(m),h):n},h.touchable=function(m){return arguments.length?(o=typeof m=="function"?m:Tn(!!m),h):o},h.on=function(){var m=i.on.apply(i,arguments);return m===i?h:m},h.clickDistance=function(m){return arguments.length?(d=(m=+m)*m,h):Math.sqrt(d)},h}function br(e,t,n){e.prototype=t.prototype=n,n.constructor=e}function Ms(e,t){var n=Object.create(e.prototype);for(var o in t)n[o]=t[o];return n}function Nn(){}var wn=.7,Qn=1/wn,jt="\\s*([+-]?\\d+)\\s*",_n="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",it="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",eh=/^#([0-9a-f]{3,8})$/,th=new RegExp(`^rgb\\(${jt},${jt},${jt}\\)$`),nh=new RegExp(`^rgb\\(${it},${it},${it}\\)$`),oh=new RegExp(`^rgba\\(${jt},${jt},${jt},${_n}\\)$`),rh=new RegExp(`^rgba\\(${it},${it},${it},${_n}\\)$`),ih=new RegExp(`^hsl\\(${_n},${it},${it}\\)$`),sh=new RegExp(`^hsla\\(${_n},${it},${it},${_n}\\)$`),Zr={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};br(Nn,It,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:Kr,formatHex:Kr,formatHex8:ah,formatHsl:lh,formatRgb:Jr,toString:Jr});function Kr(){return this.rgb().formatHex()}function ah(){return this.rgb().formatHex8()}function lh(){return Ts(this).formatHsl()}function Jr(){return this.rgb().formatRgb()}function It(e){var t,n;return e=(e+"").trim().toLowerCase(),(t=eh.exec(e))?(n=t[1].length,t=parseInt(t[1],16),n===6?Qr(t):n===3?new Be(t>>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):n===8?On(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):n===4?On(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=th.exec(e))?new Be(t[1],t[2],t[3],1):(t=nh.exec(e))?new Be(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=oh.exec(e))?On(t[1],t[2],t[3],t[4]):(t=rh.exec(e))?On(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=ih.exec(e))?ni(t[1],t[2]/100,t[3]/100,1):(t=sh.exec(e))?ni(t[1],t[2]/100,t[3]/100,t[4]):Zr.hasOwnProperty(e)?Qr(Zr[e]):e==="transparent"?new Be(NaN,NaN,NaN,0):null}function Qr(e){return new Be(e>>16&255,e>>8&255,e&255,1)}function On(e,t,n,o){return o<=0&&(e=t=n=NaN),new Be(e,t,n,o)}function uh(e){return e instanceof Nn||(e=It(e)),e?(e=e.rgb(),new Be(e.r,e.g,e.b,e.opacity)):new Be}function Qo(e,t,n,o){return arguments.length===1?uh(e):new Be(e,t,n,o??1)}function Be(e,t,n,o){this.r=+e,this.g=+t,this.b=+n,this.opacity=+o}br(Be,Qo,Ms(Nn,{brighter(e){return e=e==null?Qn:Math.pow(Qn,e),new Be(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?wn:Math.pow(wn,e),new Be(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new Be(Tt(this.r),Tt(this.g),Tt(this.b),eo(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:ei,formatHex:ei,formatHex8:ch,formatRgb:ti,toString:ti}));function ei(){return`#${Mt(this.r)}${Mt(this.g)}${Mt(this.b)}`}function ch(){return`#${Mt(this.r)}${Mt(this.g)}${Mt(this.b)}${Mt((isNaN(this.opacity)?1:this.opacity)*255)}`}function ti(){const e=eo(this.opacity);return`${e===1?"rgb(":"rgba("}${Tt(this.r)}, ${Tt(this.g)}, ${Tt(this.b)}${e===1?")":`, ${e})`}`}function eo(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function Tt(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function Mt(e){return e=Tt(e),(e<16?"0":"")+e.toString(16)}function ni(e,t,n,o){return o<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new We(e,t,n,o)}function Ts(e){if(e instanceof We)return new We(e.h,e.s,e.l,e.opacity);if(e instanceof Nn||(e=It(e)),!e)return new We;if(e instanceof We)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,a=i-r,l=(i+r)/2;return a?(t===i?s=(n-o)/a+(n<o)*6:n===i?s=(o-t)/a+2:s=(t-n)/a+4,a/=l<.5?i+r:2-i-r,s*=60):a=l>0&&l<1?0:s,new We(s,a,l,e.opacity)}function dh(e,t,n,o){return arguments.length===1?Ts(e):new We(e,t,n,o??1)}function We(e,t,n,o){this.h=+e,this.s=+t,this.l=+n,this.opacity=+o}br(We,dh,Ms(Nn,{brighter(e){return e=e==null?Qn:Math.pow(Qn,e),new We(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?wn:Math.pow(wn,e),new We(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 Be(Io(e>=240?e-240:e+120,r,o),Io(e,r,o),Io(e<120?e+240:e-120,r,o),this.opacity)},clamp(){return new We(oi(this.h),Pn(this.s),Pn(this.l),eo(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=eo(this.opacity);return`${e===1?"hsl(":"hsla("}${oi(this.h)}, ${Pn(this.s)*100}%, ${Pn(this.l)*100}%${e===1?")":`, ${e})`}`}}));function oi(e){return e=(e||0)%360,e<0?e+360:e}function Pn(e){return Math.max(0,Math.min(1,e||0))}function Io(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 Er=e=>()=>e;function fh(e,t){return function(n){return e+n*t}}function hh(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 ph(e){return(e=+e)==1?Os:function(t,n){return n-t?hh(t,n,e):Er(isNaN(t)?n:t)}}function Os(e,t){var n=t-e;return n?fh(e,n):Er(isNaN(e)?t:e)}const to=(function e(t){var n=ph(t);function o(r,i){var s=n((r=Qo(r)).r,(i=Qo(i)).r),a=n(r.g,i.g),l=n(r.b,i.b),c=Os(r.opacity,i.opacity);return function(u){return r.r=s(u),r.g=a(u),r.b=l(u),r.opacity=c(u),r+""}}return o.gamma=e,o})(1);function gh(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 vh(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}function mh(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]=hn(e[s],t[s]);for(;s<n;++s)i[s]=t[s];return function(a){for(s=0;s<o;++s)i[s]=r[s](a);return i}}function yh(e,t){var n=new Date;return e=+e,t=+t,function(o){return n.setTime(e*(1-o)+t*o),n}}function tt(e,t){return e=+e,t=+t,function(n){return e*(1-n)+t*n}}function wh(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]=hn(e[r],t[r]):o[r]=t[r];return function(i){for(r in n)o[r]=n[r](i);return o}}var er=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,Do=new RegExp(er.source,"g");function _h(e){return function(){return e}}function xh(e){return function(t){return e(t)+""}}function Ps(e,t){var n=er.lastIndex=Do.lastIndex=0,o,r,i,s=-1,a=[],l=[];for(e=e+"",t=t+"";(o=er.exec(e))&&(r=Do.exec(t));)(i=r.index)>n&&(i=t.slice(n,i),a[s]?a[s]+=i:a[++s]=i),(o=o[0])===(r=r[0])?a[s]?a[s]+=r:a[++s]=r:(a[++s]=null,l.push({i:s,x:tt(o,r)})),n=Do.lastIndex;return n<t.length&&(i=t.slice(n),a[s]?a[s]+=i:a[++s]=i),a.length<2?l[0]?xh(l[0].x):_h(t):(t=l.length,function(c){for(var u=0,d;u<t;++u)a[(d=l[u]).i]=d.x(c);return a.join("")})}function hn(e,t){var n=typeof t,o;return t==null||n==="boolean"?Er(t):(n==="number"?tt:n==="string"?(o=It(t))?(t=o,to):Ps:t instanceof It?to:t instanceof Date?yh:vh(t)?gh:Array.isArray(t)?mh:typeof t.valueOf!="function"&&typeof t.toString!="function"||isNaN(t)?wh:tt)(e,t)}var ri=180/Math.PI,tr={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function Is(e,t,n,o,r,i){var s,a,l;return(s=Math.sqrt(e*e+t*t))&&(e/=s,t/=s),(l=e*n+t*o)&&(n-=e*l,o-=t*l),(a=Math.sqrt(n*n+o*o))&&(n/=a,o/=a,l/=a),e*o<t*n&&(e=-e,t=-t,l=-l,s=-s),{translateX:r,translateY:i,rotate:Math.atan2(t,e)*ri,skewX:Math.atan(l)*ri,scaleX:s,scaleY:a}}var In;function bh(e){const t=new(typeof DOMMatrix=="function"?DOMMatrix:WebKitCSSMatrix)(e+"");return t.isIdentity?tr:Is(t.a,t.b,t.c,t.d,t.e,t.f)}function Eh(e){return e==null||(In||(In=document.createElementNS("http://www.w3.org/2000/svg","g")),In.setAttribute("transform",e),!(e=In.transform.baseVal.consolidate()))?tr:(e=e.matrix,Is(e.a,e.b,e.c,e.d,e.e,e.f))}function Ds(e,t,n,o){function r(c){return c.length?c.pop()+" ":""}function i(c,u,d,h,f,g){if(c!==d||u!==h){var y=f.push("translate(",null,t,null,n);g.push({i:y-4,x:tt(c,d)},{i:y-2,x:tt(u,h)})}else(d||h)&&f.push("translate("+d+t+h+n)}function s(c,u,d,h){c!==u?(c-u>180?u+=360:u-c>180&&(c+=360),h.push({i:d.push(r(d)+"rotate(",null,o)-2,x:tt(c,u)})):u&&d.push(r(d)+"rotate("+u+o)}function a(c,u,d,h){c!==u?h.push({i:d.push(r(d)+"skewX(",null,o)-2,x:tt(c,u)}):u&&d.push(r(d)+"skewX("+u+o)}function l(c,u,d,h,f,g){if(c!==d||u!==h){var y=f.push(r(f)+"scale(",null,",",null,")");g.push({i:y-4,x:tt(c,d)},{i:y-2,x:tt(u,h)})}else(d!==1||h!==1)&&f.push(r(f)+"scale("+d+","+h+")")}return function(c,u){var d=[],h=[];return c=e(c),u=e(u),i(c.translateX,c.translateY,u.translateX,u.translateY,d,h),s(c.rotate,u.rotate,d,h),a(c.skewX,u.skewX,d,h),l(c.scaleX,c.scaleY,u.scaleX,u.scaleY,d,h),c=u=null,function(f){for(var g=-1,y=h.length,w;++g<y;)d[(w=h[g]).i]=w.x(f);return d.join("")}}}var kh=Ds(bh,"px, ","px)","deg)"),Sh=Ds(Eh,", ",")",")"),Ch=1e-12;function ii(e){return((e=Math.exp(e))+1/e)/2}function Nh(e){return((e=Math.exp(e))-1/e)/2}function $h(e){return((e=Math.exp(2*e))-1)/(e+1)}const Hn=(function e(t,n,o){function r(i,s){var a=i[0],l=i[1],c=i[2],u=s[0],d=s[1],h=s[2],f=u-a,g=d-l,y=f*f+g*g,w,b;if(y<Ch)b=Math.log(h/c)/t,w=function(H){return[a+H*f,l+H*g,c*Math.exp(t*H*b)]};else{var E=Math.sqrt(y),v=(h*h-c*c+o*y)/(2*c*n*E),m=(h*h-c*c-o*y)/(2*h*n*E),T=Math.log(Math.sqrt(v*v+1)-v),B=Math.log(Math.sqrt(m*m+1)-m);b=(B-T)/t,w=function(H){var F=H*b,K=ii(T),I=c/(n*E)*(K*$h(t*F+T)-Nh(T));return[a+I*f,l+I*g,c*K/ii(t*F+T)]}}return w.duration=b*1e3*t/Math.SQRT2,w}return r.rho=function(i){var s=Math.max(.001,+i),a=s*s,l=a*a;return e(s,a,l)},r})(Math.SQRT2,2,4);var Kt=0,ln=0,rn=0,As=1e3,no,un,oo=0,Dt=0,xo=0,xn=typeof performance=="object"&&performance.now?performance:Date,zs=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(e){setTimeout(e,17)};function kr(){return Dt||(zs(Mh),Dt=xn.now()+xo)}function Mh(){Dt=0}function ro(){this._call=this._time=this._next=null}ro.prototype=Bs.prototype={constructor:ro,restart:function(e,t,n){if(typeof e!="function")throw new TypeError("callback is not a function");n=(n==null?kr():+n)+(t==null?0:+t),!this._next&&un!==this&&(un?un._next=this:no=this,un=this),this._call=e,this._time=n,nr()},stop:function(){this._call&&(this._call=null,this._time=1/0,nr())}};function Bs(e,t,n){var o=new ro;return o.restart(e,t,n),o}function Th(){kr(),++Kt;for(var e=no,t;e;)(t=Dt-e._time)>=0&&e._call.call(void 0,t),e=e._next;--Kt}function si(){Dt=(oo=xn.now())+xo,Kt=ln=0;try{Th()}finally{Kt=0,Ph(),Dt=0}}function Oh(){var e=xn.now(),t=e-oo;t>As&&(xo-=t,oo=e)}function Ph(){for(var e,t=no,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:no=n);un=e,nr(o)}function nr(e){if(!Kt){ln&&(ln=clearTimeout(ln));var t=e-Dt;t>24?(e<1/0&&(ln=setTimeout(si,e-xn.now()-xo)),rn&&(rn=clearInterval(rn))):(rn||(oo=xn.now(),rn=setInterval(Oh,As)),Kt=1,zs(si))}}function ai(e,t,n){var o=new ro;return t=t==null?0:+t,o.restart(r=>{o.stop(),e(r+t)},t,n),o}var Ih=wo("start","end","cancel","interrupt"),Dh=[],Rs=0,li=1,or=2,Gn=3,ui=4,rr=5,qn=6;function bo(e,t,n,o,r,i){var s=e.__transition;if(!s)e.__transition={};else if(n in s)return;Ah(e,n,{name:t,index:o,group:r,on:Ih,tween:Dh,time:i.time,delay:i.delay,duration:i.duration,ease:i.ease,timer:null,state:Rs})}function Sr(e,t){var n=Je(e,t);if(n.state>Rs)throw new Error("too late; already scheduled");return n}function lt(e,t){var n=Je(e,t);if(n.state>Gn)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 Ah(e,t,n){var o=e.__transition,r;o[t]=n,n.timer=Bs(i,0,n.time);function i(c){n.state=li,n.timer.restart(s,n.delay,n.time),n.delay<=c&&s(c-n.delay)}function s(c){var u,d,h,f;if(n.state!==li)return l();for(u in o)if(f=o[u],f.name===n.name){if(f.state===Gn)return ai(s);f.state===ui?(f.state=qn,f.timer.stop(),f.on.call("interrupt",e,e.__data__,f.index,f.group),delete o[u]):+u<t&&(f.state=qn,f.timer.stop(),f.on.call("cancel",e,e.__data__,f.index,f.group),delete o[u])}if(ai(function(){n.state===Gn&&(n.state=ui,n.timer.restart(a,n.delay,n.time),a(c))}),n.state=or,n.on.call("start",e,e.__data__,n.index,n.group),n.state===or){for(n.state=Gn,r=new Array(h=n.tween.length),u=0,d=-1;u<h;++u)(f=n.tween[u].value.call(e,e.__data__,n.index,n.group))&&(r[++d]=f);r.length=d+1}}function a(c){for(var u=c<n.duration?n.ease.call(null,c/n.duration):(n.timer.restart(l),n.state=rr,1),d=-1,h=r.length;++d<h;)r[d].call(e,u);n.state===rr&&(n.on.call("end",e,e.__data__,n.index,n.group),l())}function l(){n.state=qn,n.timer.stop(),delete o[t];for(var c in o)return;delete e.__transition}}function jn(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>or&&o.state<rr,o.state=qn,o.timer.stop(),o.on.call(r?"interrupt":"cancel",e,e.__data__,o.index,o.group),delete n[s]}i&&delete e.__transition}}function zh(e){return this.each(function(){jn(this,e)})}function Bh(e,t){var n,o;return function(){var r=lt(this,e),i=r.tween;if(i!==n){o=n=i;for(var s=0,a=o.length;s<a;++s)if(o[s].name===t){o=o.slice(),o.splice(s,1);break}}r.tween=o}}function Rh(e,t,n){var o,r;if(typeof n!="function")throw new Error;return function(){var i=lt(this,e),s=i.tween;if(s!==o){r=(o=s).slice();for(var a={name:t,value:n},l=0,c=r.length;l<c;++l)if(r[l].name===t){r[l]=a;break}l===c&&r.push(a)}i.tween=r}}function Lh(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?Bh:Rh)(n,e,t))}function Cr(e,t,n){var o=e._id;return e.each(function(){var r=lt(this,o);(r.value||(r.value={}))[t]=n.apply(this,arguments)}),function(r){return Je(r,o).value[t]}}function Ls(e,t){var n;return(typeof t=="number"?tt:t instanceof It?to:(n=It(t))?(t=n,to):Ps)(e,t)}function Vh(e){return function(){this.removeAttribute(e)}}function Fh(e){return function(){this.removeAttributeNS(e.space,e.local)}}function Hh(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 Gh(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 qh(e,t,n){var o,r,i;return function(){var s,a=n(this),l;return a==null?void this.removeAttribute(e):(s=this.getAttribute(e),l=a+"",s===l?null:s===o&&l===r?i:(r=l,i=t(o=s,a)))}}function jh(e,t,n){var o,r,i;return function(){var s,a=n(this),l;return a==null?void this.removeAttributeNS(e.space,e.local):(s=this.getAttributeNS(e.space,e.local),l=a+"",s===l?null:s===o&&l===r?i:(r=l,i=t(o=s,a)))}}function Yh(e,t){var n=_o(e),o=n==="transform"?Sh:Ls;return this.attrTween(e,typeof t=="function"?(n.local?jh:qh)(n,o,Cr(this,"attr."+e,t)):t==null?(n.local?Fh:Vh)(n):(n.local?Gh:Hh)(n,o,t))}function Wh(e,t){return function(n){this.setAttribute(e,t.call(this,n))}}function Xh(e,t){return function(n){this.setAttributeNS(e.space,e.local,t.call(this,n))}}function Uh(e,t){var n,o;function r(){var i=t.apply(this,arguments);return i!==o&&(n=(o=i)&&Xh(e,i)),n}return r._value=t,r}function Zh(e,t){var n,o;function r(){var i=t.apply(this,arguments);return i!==o&&(n=(o=i)&&Wh(e,i)),n}return r._value=t,r}function Kh(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=_o(e);return this.tween(n,(o.local?Uh:Zh)(o,t))}function Jh(e,t){return function(){Sr(this,e).delay=+t.apply(this,arguments)}}function Qh(e,t){return t=+t,function(){Sr(this,e).delay=t}}function ep(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?Jh:Qh)(t,e)):Je(this.node(),t).delay}function tp(e,t){return function(){lt(this,e).duration=+t.apply(this,arguments)}}function np(e,t){return t=+t,function(){lt(this,e).duration=t}}function op(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?tp:np)(t,e)):Je(this.node(),t).duration}function rp(e,t){if(typeof t!="function")throw new Error;return function(){lt(this,e).ease=t}}function ip(e){var t=this._id;return arguments.length?this.each(rp(t,e)):Je(this.node(),t).ease}function sp(e,t){return function(){var n=t.apply(this,arguments);if(typeof n!="function")throw new Error;lt(this,e).ease=n}}function ap(e){if(typeof e!="function")throw new Error;return this.each(sp(this._id,e))}function lp(e){typeof e!="function"&&(e=ms(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,a=o[r]=[],l,c=0;c<s;++c)(l=i[c])&&e.call(l,l.__data__,c,i)&&a.push(l);return new mt(o,this._parents,this._name,this._id)}function up(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),a=0;a<i;++a)for(var l=t[a],c=n[a],u=l.length,d=s[a]=new Array(u),h,f=0;f<u;++f)(h=l[f]||c[f])&&(d[f]=h);for(;a<o;++a)s[a]=t[a];return new mt(s,this._parents,this._name,this._id)}function cp(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 dp(e,t,n){var o,r,i=cp(t)?Sr:lt;return function(){var s=i(this,e),a=s.on;a!==o&&(r=(o=a).copy()).on(t,n),s.on=r}}function fp(e,t){var n=this._id;return arguments.length<2?Je(this.node(),n).on.on(e):this.each(dp(n,e,t))}function hp(e){return function(){var t=this.parentNode;for(var n in this.__transition)if(+n!==e)return;t&&t.removeChild(this)}}function pp(){return this.on("end.remove",hp(this._id))}function gp(e){var t=this._name,n=this._id;typeof e!="function"&&(e=_r(e));for(var o=this._groups,r=o.length,i=new Array(r),s=0;s<r;++s)for(var a=o[s],l=a.length,c=i[s]=new Array(l),u,d,h=0;h<l;++h)(u=a[h])&&(d=e.call(u,u.__data__,h,a))&&("__data__"in u&&(d.__data__=u.__data__),c[h]=d,bo(c[h],t,n,h,c,Je(u,n)));return new mt(i,this._parents,t,n)}function vp(e){var t=this._name,n=this._id;typeof e!="function"&&(e=vs(e));for(var o=this._groups,r=o.length,i=[],s=[],a=0;a<r;++a)for(var l=o[a],c=l.length,u,d=0;d<c;++d)if(u=l[d]){for(var h=e.call(u,u.__data__,d,l),f,g=Je(u,n),y=0,w=h.length;y<w;++y)(f=h[y])&&bo(f,t,n,y,h,g);i.push(h),s.push(u)}return new mt(i,s,t,n)}var mp=Cn.prototype.constructor;function yp(){return new mp(this._groups,this._parents)}function wp(e,t){var n,o,r;return function(){var i=Zt(this,e),s=(this.style.removeProperty(e),Zt(this,e));return i===s?null:i===n&&s===o?r:r=t(n=i,o=s)}}function Vs(e){return function(){this.style.removeProperty(e)}}function _p(e,t,n){var o,r=n+"",i;return function(){var s=Zt(this,e);return s===r?null:s===o?i:i=t(o=s,n)}}function xp(e,t,n){var o,r,i;return function(){var s=Zt(this,e),a=n(this),l=a+"";return a==null&&(l=a=(this.style.removeProperty(e),Zt(this,e))),s===l?null:s===o&&l===r?i:(r=l,i=t(o=s,a))}}function bp(e,t){var n,o,r,i="style."+t,s="end."+i,a;return function(){var l=lt(this,e),c=l.on,u=l.value[i]==null?a||(a=Vs(t)):void 0;(c!==n||r!==u)&&(o=(n=c).copy()).on(s,r=u),l.on=o}}function Ep(e,t,n){var o=(e+="")=="transform"?kh:Ls;return t==null?this.styleTween(e,wp(e,o)).on("end.style."+e,Vs(e)):typeof t=="function"?this.styleTween(e,xp(e,o,Cr(this,"style."+e,t))).each(bp(this._id,e)):this.styleTween(e,_p(e,o,t),n).on("end.style."+e,null)}function kp(e,t,n){return function(o){this.style.setProperty(e,t.call(this,o),n)}}function Sp(e,t,n){var o,r;function i(){var s=t.apply(this,arguments);return s!==r&&(o=(r=s)&&kp(e,s,n)),o}return i._value=t,i}function Cp(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,Sp(e,t,n??""))}function Np(e){return function(){this.textContent=e}}function $p(e){return function(){var t=e(this);this.textContent=t??""}}function Mp(e){return this.tween("text",typeof e=="function"?$p(Cr(this,"text",e)):Np(e==null?"":e+""))}function Tp(e){return function(t){this.textContent=e.call(this,t)}}function Op(e){var t,n;function o(){var r=e.apply(this,arguments);return r!==n&&(t=(n=r)&&Tp(r)),t}return o._value=e,o}function Pp(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,Op(e))}function Ip(){for(var e=this._name,t=this._id,n=Fs(),o=this._groups,r=o.length,i=0;i<r;++i)for(var s=o[i],a=s.length,l,c=0;c<a;++c)if(l=s[c]){var u=Je(l,t);bo(l,e,n,c,s,{time:u.time+u.delay+u.duration,delay:0,duration:u.duration,ease:u.ease})}return new mt(o,this._parents,e,n)}function Dp(){var e,t,n=this,o=n._id,r=n.size();return new Promise(function(i,s){var a={value:s},l={value:function(){--r===0&&i()}};n.each(function(){var c=lt(this,o),u=c.on;u!==e&&(t=(e=u).copy(),t._.cancel.push(a),t._.interrupt.push(a),t._.end.push(l)),c.on=t}),r===0&&i()})}var Ap=0;function mt(e,t,n,o){this._groups=e,this._parents=t,this._name=n,this._id=o}function Fs(){return++Ap}var ut=Cn.prototype;mt.prototype={constructor:mt,select:gp,selectAll:vp,selectChild:ut.selectChild,selectChildren:ut.selectChildren,filter:lp,merge:up,selection:yp,transition:Ip,call:ut.call,nodes:ut.nodes,node:ut.node,size:ut.size,empty:ut.empty,each:ut.each,on:fp,attr:Yh,attrTween:Kh,style:Ep,styleTween:Cp,text:Mp,textTween:Pp,remove:pp,tween:Lh,delay:ep,duration:op,ease:ip,easeVarying:ap,end:Dp,[Symbol.iterator]:ut[Symbol.iterator]};function zp(e){return((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2}var Bp={time:null,delay:0,duration:250,ease:zp};function Rp(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 Lp(e){var t,n;e instanceof mt?(t=e._id,e=e._name):(t=Fs(),(n=Bp).time=kr(),e=e==null?null:e+"");for(var o=this._groups,r=o.length,i=0;i<r;++i)for(var s=o[i],a=s.length,l,c=0;c<a;++c)(l=s[c])&&bo(l,e,t,c,s,n||Rp(l,t));return new mt(o,this._parents,e,t)}Cn.prototype.interrupt=zh;Cn.prototype.transition=Lp;const Dn=e=>()=>e;function Vp(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 ft(e,t,n){this.k=e,this.x=t,this.y=n}ft.prototype={constructor:ft,scale:function(e){return e===1?this:new ft(this.k*e,this.x,this.y)},translate:function(e,t){return e===0&t===0?this:new ft(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 Jt=new ft(1,0,0);ft.prototype;function Ao(e){e.stopImmediatePropagation()}function sn(e){e.preventDefault(),e.stopImmediatePropagation()}function Fp(e){return(!e.ctrlKey||e.type==="wheel")&&!e.button}function Hp(){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 ci(){return this.__zoom||Jt}function Gp(e){return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*(e.ctrlKey?10:1)}function qp(){return navigator.maxTouchPoints||"ontouchstart"in this}function jp(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 Yp(){var e=Fp,t=Hp,n=jp,o=Gp,r=qp,i=[0,1/0],s=[[-1/0,-1/0],[1/0,1/0]],a=250,l=Hn,c=wo("start","zoom","end"),u,d,h,f=500,g=150,y=0,w=10;function b(p){p.property("__zoom",ci).on("wheel.zoom",F,{passive:!1}).on("mousedown.zoom",K).on("dblclick.zoom",I).filter(r).on("touchstart.zoom",A).on("touchmove.zoom",S).on("touchend.zoom touchcancel.zoom",C).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}b.transform=function(p,N,_,$){var P=p.selection?p.selection():p;P.property("__zoom",ci),p!==P?T(p,N,_,$):P.interrupt().each(function(){B(this,arguments).event($).start().zoom(null,typeof N=="function"?N.apply(this,arguments):N).end()})},b.scaleBy=function(p,N,_,$){b.scaleTo(p,function(){var P=this.__zoom.k,G=typeof N=="function"?N.apply(this,arguments):N;return P*G},_,$)},b.scaleTo=function(p,N,_,$){b.transform(p,function(){var P=t.apply(this,arguments),G=this.__zoom,L=_==null?m(P):typeof _=="function"?_.apply(this,arguments):_,q=G.invert(L),U=typeof N=="function"?N.apply(this,arguments):N;return n(v(E(G,U),L,q),P,s)},_,$)},b.translateBy=function(p,N,_,$){b.transform(p,function(){return n(this.__zoom.translate(typeof N=="function"?N.apply(this,arguments):N,typeof _=="function"?_.apply(this,arguments):_),t.apply(this,arguments),s)},null,$)},b.translateTo=function(p,N,_,$,P){b.transform(p,function(){var G=t.apply(this,arguments),L=this.__zoom,q=$==null?m(G):typeof $=="function"?$.apply(this,arguments):$;return n(Jt.translate(q[0],q[1]).scale(L.k).translate(typeof N=="function"?-N.apply(this,arguments):-N,typeof _=="function"?-_.apply(this,arguments):-_),G,s)},$,P)};function E(p,N){return N=Math.max(i[0],Math.min(i[1],N)),N===p.k?p:new ft(N,p.x,p.y)}function v(p,N,_){var $=N[0]-_[0]*p.k,P=N[1]-_[1]*p.k;return $===p.x&&P===p.y?p:new ft(p.k,$,P)}function m(p){return[(+p[0][0]+ +p[1][0])/2,(+p[0][1]+ +p[1][1])/2]}function T(p,N,_,$){p.on("start.zoom",function(){B(this,arguments).event($).start()}).on("interrupt.zoom end.zoom",function(){B(this,arguments).event($).end()}).tween("zoom",function(){var P=this,G=arguments,L=B(P,G).event($),q=t.apply(P,G),U=_==null?m(q):typeof _=="function"?_.apply(P,G):_,J=Math.max(q[1][0]-q[0][0],q[1][1]-q[0][1]),D=P.__zoom,x=typeof N=="function"?N.apply(P,G):N,O=l(D.invert(U).concat(J/D.k),x.invert(U).concat(J/x.k));return function(R){if(R===1)R=x;else{var W=O(R),Q=J/W[2];R=new ft(Q,U[0]-W[0]*Q,U[1]-W[1]*Q)}L.zoom(null,R)}})}function B(p,N,_){return!_&&p.__zooming||new H(p,N)}function H(p,N){this.that=p,this.args=N,this.active=0,this.sourceEvent=null,this.extent=t.apply(p,N),this.taps=0}H.prototype={event:function(p){return p&&(this.sourceEvent=p),this},start:function(){return++this.active===1&&(this.that.__zooming=this,this.emit("start")),this},zoom:function(p,N){return this.mouse&&p!=="mouse"&&(this.mouse[1]=N.invert(this.mouse[0])),this.touch0&&p!=="touch"&&(this.touch0[1]=N.invert(this.touch0[0])),this.touch1&&p!=="touch"&&(this.touch1[1]=N.invert(this.touch1[0])),this.that.__zoom=N,this.emit("zoom"),this},end:function(){return--this.active===0&&(delete this.that.__zooming,this.emit("end")),this},emit:function(p){var N=Ye(this.that).datum();c.call(p,this.that,new Vp(p,{sourceEvent:this.sourceEvent,target:b,transform:this.that.__zoom,dispatch:c}),N)}};function F(p,...N){if(!e.apply(this,arguments))return;var _=B(this,N).event(p),$=this.__zoom,P=Math.max(i[0],Math.min(i[1],$.k*Math.pow(2,o.apply(this,arguments)))),G=et(p);if(_.wheel)(_.mouse[0][0]!==G[0]||_.mouse[0][1]!==G[1])&&(_.mouse[1]=$.invert(_.mouse[0]=G)),clearTimeout(_.wheel);else{if($.k===P)return;_.mouse=[G,$.invert(G)],jn(this),_.start()}sn(p),_.wheel=setTimeout(L,g),_.zoom("mouse",n(v(E($,P),_.mouse[0],_.mouse[1]),_.extent,s));function L(){_.wheel=null,_.end()}}function K(p,...N){if(h||!e.apply(this,arguments))return;var _=p.currentTarget,$=B(this,N,!0).event(p),P=Ye(p.view).on("mousemove.zoom",U,!0).on("mouseup.zoom",J,!0),G=et(p,_),L=p.clientX,q=p.clientY;Ns(p.view),Ao(p),$.mouse=[G,this.__zoom.invert(G)],jn(this),$.start();function U(D){if(sn(D),!$.moved){var x=D.clientX-L,O=D.clientY-q;$.moved=x*x+O*O>y}$.event(D).zoom("mouse",n(v($.that.__zoom,$.mouse[0]=et(D,_),$.mouse[1]),$.extent,s))}function J(D){P.on("mousemove.zoom mouseup.zoom",null),$s(D.view,$.moved),sn(D),$.event(D).end()}}function I(p,...N){if(e.apply(this,arguments)){var _=this.__zoom,$=et(p.changedTouches?p.changedTouches[0]:p,this),P=_.invert($),G=_.k*(p.shiftKey?.5:2),L=n(v(E(_,G),$,P),t.apply(this,N),s);sn(p),a>0?Ye(this).transition().duration(a).call(T,L,$,p):Ye(this).call(b.transform,L,$,p)}}function A(p,...N){if(e.apply(this,arguments)){var _=p.touches,$=_.length,P=B(this,N,p.changedTouches.length===$).event(p),G,L,q,U;for(Ao(p),L=0;L<$;++L)q=_[L],U=et(q,this),U=[U,this.__zoom.invert(U),q.identifier],P.touch0?!P.touch1&&P.touch0[2]!==U[2]&&(P.touch1=U,P.taps=0):(P.touch0=U,G=!0,P.taps=1+!!u);u&&(u=clearTimeout(u)),G&&(P.taps<2&&(d=U[0],u=setTimeout(function(){u=null},f)),jn(this),P.start())}}function S(p,...N){if(this.__zooming){var _=B(this,N).event(p),$=p.changedTouches,P=$.length,G,L,q,U;for(sn(p),G=0;G<P;++G)L=$[G],q=et(L,this),_.touch0&&_.touch0[2]===L.identifier?_.touch0[0]=q:_.touch1&&_.touch1[2]===L.identifier&&(_.touch1[0]=q);if(L=_.that.__zoom,_.touch1){var J=_.touch0[0],D=_.touch0[1],x=_.touch1[0],O=_.touch1[1],R=(R=x[0]-J[0])*R+(R=x[1]-J[1])*R,W=(W=O[0]-D[0])*W+(W=O[1]-D[1])*W;L=E(L,Math.sqrt(R/W)),q=[(J[0]+x[0])/2,(J[1]+x[1])/2],U=[(D[0]+O[0])/2,(D[1]+O[1])/2]}else if(_.touch0)q=_.touch0[0],U=_.touch0[1];else return;_.zoom("touch",n(v(L,q,U),_.extent,s))}}function C(p,...N){if(this.__zooming){var _=B(this,N).event(p),$=p.changedTouches,P=$.length,G,L;for(Ao(p),h&&clearTimeout(h),h=setTimeout(function(){h=null},f),G=0;G<P;++G)L=$[G],_.touch0&&_.touch0[2]===L.identifier?delete _.touch0:_.touch1&&_.touch1[2]===L.identifier&&delete _.touch1;if(_.touch1&&!_.touch0&&(_.touch0=_.touch1,delete _.touch1),_.touch0)_.touch0[1]=this.__zoom.invert(_.touch0[0]);else if(_.end(),_.taps===2&&(L=et(L,this),Math.hypot(d[0]-L[0],d[1]-L[1])<w)){var q=Ye(this).on("dblclick.zoom");q&&q.apply(this,arguments)}}}return b.wheelDelta=function(p){return arguments.length?(o=typeof p=="function"?p:Dn(+p),b):o},b.filter=function(p){return arguments.length?(e=typeof p=="function"?p:Dn(!!p),b):e},b.touchable=function(p){return arguments.length?(r=typeof p=="function"?p:Dn(!!p),b):r},b.extent=function(p){return arguments.length?(t=typeof p=="function"?p:Dn([[+p[0][0],+p[0][1]],[+p[1][0],+p[1][1]]]),b):t},b.scaleExtent=function(p){return arguments.length?(i[0]=+p[0],i[1]=+p[1],b):[i[0],i[1]]},b.translateExtent=function(p){return arguments.length?(s[0][0]=+p[0][0],s[1][0]=+p[1][0],s[0][1]=+p[0][1],s[1][1]=+p[1][1],b):[[s[0][0],s[0][1]],[s[1][0],s[1][1]]]},b.constrain=function(p){return arguments.length?(n=p,b):n},b.duration=function(p){return arguments.length?(a=+p,b):a},b.interpolate=function(p){return arguments.length?(l=p,b):l},b.on=function(){var p=c.on.apply(c,arguments);return p===c?b:p},b.clickDistance=function(p){return arguments.length?(y=(p=+p)*p,b):Math.sqrt(y)},b.tapDistance=function(p){return arguments.length?(w=+p,b):w},b}var ue=(e=>(e.Left="left",e.Top="top",e.Right="right",e.Bottom="bottom",e))(ue||{}),Nr=(e=>(e.Partial="partial",e.Full="full",e))(Nr||{}),Nt=(e=>(e.Bezier="default",e.SimpleBezier="simple-bezier",e.Straight="straight",e.Step="step",e.SmoothStep="smoothstep",e))(Nt||{}),St=(e=>(e.Strict="strict",e.Loose="loose",e))(St||{}),io=(e=>(e.Arrow="arrow",e.ArrowClosed="arrowclosed",e))(io||{}),pn=(e=>(e.Free="free",e.Vertical="vertical",e.Horizontal="horizontal",e))(pn||{}),Hs=(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))(Hs||{});const Wp=["INPUT","SELECT","TEXTAREA"],Xp=typeof document<"u"?document:null;function ir(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 Wp.includes(o?.nodeName)||r||!!i}function Up(e){return e.ctrlKey||e.metaKey||e.shiftKey||e.altKey}function di(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,a)=>n.has(s)&&Array.from(n.values())[a]===r[a]);return o&&n.delete(e.toLowerCase()),i}function Zp(e,t){return n=>{if(!n.code&&!n.key)return!1;const o=Kp(n.code,e);return Array.isArray(e)?e.some(r=>di(n[o],r,t,n.type==="keyup")):di(n[o],e,t,n.type==="keyup")}}function Kp(e,t){return t.includes(e)?"code":"key"}function gn(e,t){const n=ne(()=>Ee(t?.target)??Xp),o=dt(Ee(e)===!0);let r=!1;const i=new Set;let s=l(Ee(e));_e(()=>Ee(e),(c,u)=>{typeof u=="boolean"&&typeof c!="boolean"&&a(),s=l(c)},{immediate:!0}),ps(["blur","contextmenu"],a),Wr((...c)=>s(...c),c=>{var u,d;const h=Ee(t?.actInsideInputWithModifier)??!0,f=Ee(t?.preventDefault)??!1;if(r=Up(c),(!r||r&&!h)&&ir(c))return;const y=((d=(u=c.composedPath)==null?void 0:u.call(c))==null?void 0:d[0])||c.target,w=y?.nodeName==="BUTTON"||y?.nodeName==="A";!f&&(r||!w)&&c.preventDefault(),o.value=!0},{eventName:"keydown",target:n}),Wr((...c)=>s(...c),c=>{const u=Ee(t?.actInsideInputWithModifier)??!0;if(o.value){if((!r||r&&!u)&&ir(c))return;r=!1,o.value=!1}},{eventName:"keyup",target:n});function a(){r=!1,i.clear(),o.value=Ee(e)===!0}function l(c){return c===null?(a(),()=>!1):typeof c=="boolean"?(a(),o.value=c,()=>!1):Array.isArray(c)||typeof c=="string"?Zp(c,i):c}return o}const Gs="vue-flow__node-desc",qs="vue-flow__edge-desc",Jp="vue-flow__aria-live",js=["Enter"," ","Escape"],Yt={ArrowUp:{x:0,y:-1},ArrowDown:{x:0,y:1},ArrowLeft:{x:-1,y:0},ArrowRight:{x:1,y:0}};function so(e){return{...e.computedPosition||{x:0,y:0},width:e.dimensions.width||0,height:e.dimensions.height||0}}function ao(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 Eo(e){return{width:e.offsetWidth,height:e.offsetHeight}}function At(e,t=0,n=1){return Math.min(Math.max(e,t),n)}function Ys(e,t){return{x:At(e.x,t[0][0],t[1][0]),y:At(e.y,t[0][1],t[1][1])}}function fi(e){const t=e.getRootNode();return"elementFromPoint"in t?t:window.document}function Ct(e){return e&&typeof e=="object"&&"id"in e&&"source"in e&&"target"in e}function Ot(e){return e&&typeof e=="object"&&"id"in e&&"position"in e&&!Ct(e)}function cn(e){return Ot(e)&&"computedPosition"in e}function An(e){return!Number.isNaN(e)&&Number.isFinite(e)}function Qp(e){return An(e.width)&&An(e.height)&&An(e.x)&&An(e.y)}function eg(e,t,n){const o={id:e.id.toString(),type:e.type??"default",dimensions:Ht({width:0,height:0}),computedPosition:Ht({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:Pe(e.data)?e.data:{},events:Ht(Pe(e.events)?e.events:{})};return Object.assign(t??o,e,{id:e.id.toString(),parentNode:n})}function Ws(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:Pe(e.data)?e.data:{},events:Ht(Pe(e.events)?e.events:{}),label:e.label??"",interactionWidth:e.interactionWidth??n?.interactionWidth,...n??{}};return Object.assign(t??i,e,{id:e.id.toString()})}function Xs(e,t,n,o){const r=typeof e=="string"?e:e.id,i=new Set,s=o==="source"?"target":"source";for(const a of n)a[s]===r&&i.add(a[o]);return t.filter(a=>i.has(a.id))}function tg(...e){if(e.length===3){const[i,s,a]=e;return Xs(i,s,a,"target")}const[t,n]=e,o=typeof t=="string"?t:t.id;return n.filter(i=>Ct(i)&&i.source===o).map(i=>n.find(s=>Ot(s)&&s.id===i.target))}function ng(...e){if(e.length===3){const[i,s,a]=e;return Xs(i,s,a,"source")}const[t,n]=e,o=typeof t=="string"?t:t.id;return n.filter(i=>Ct(i)&&i.target===o).map(i=>n.find(s=>Ot(s)&&s.id===i.source))}function Us({source:e,sourceHandle:t,target:n,targetHandle:o}){return`vueflow__edge-${e}${t??""}-${n}${o??""}`}function og(e,t){return t.some(n=>Ct(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 bn({x:e,y:t},{x:n,y:o,zoom:r}){return{x:e*r+n,y:t*r+o}}function En({x:e,y:t},{x:n,y:o,zoom:r},i=!1,s=[1,1]){const a={x:(e-n)/r,y:(t-o)/r};return i?ko(a,s):a}function rg(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 Zs({x:e,y:t,width:n,height:o}){return{x:e,y:t,x2:e+n,y2:t+o}}function ig({x:e,y:t,x2:n,y2:o}){return{x:e,y:t,width:n-e,height:o-t}}function Ks(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=rg(t,Zs({...o.computedPosition,...o.dimensions}))}return ig(t)}function Js(e,t,n={x:0,y:0,zoom:1},o=!1,r=!1){const i={...En(t,n),width:t.width/n.zoom,height:t.height/n.zoom},s=[];for(const a of e){const{dimensions:l,selectable:c=!0,hidden:u=!1}=a,d=l.width??a.width??null,h=l.height??a.height??null;if(r&&!c||u)continue;const f=ao(i,so(a)),g=d===null||h===null,y=o&&f>0,w=(d??0)*(h??0);(g||y||f>=w||a.dragging)&&s.push(a)}return s}function Qs(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 Lt(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 $n(`The padding value "${e}" is invalid. Please provide a number or a string with a valid unit (px or %).`),0}function sg(e,t,n){if(typeof e=="string"||typeof e=="number"){const o=Lt(e,n),r=Lt(e,t);return{top:o,right:r,bottom:o,left:r,x:r*2,y:o*2}}if(typeof e=="object"){const o=Lt(e.top??e.y??0,n),r=Lt(e.bottom??e.y??0,n),i=Lt(e.left??e.x??0,t),s=Lt(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 ag(e,t,n,o,r,i){const{x:s,y:a}=bn(e,{x:t,y:n,zoom:o}),{x:l,y:c}=bn({x:e.x+e.width,y:e.y+e.height},{x:t,y:n,zoom:o}),u=r-l,d=i-c;return{left:Math.floor(s),top:Math.floor(a),right:Math.floor(u),bottom:Math.floor(d)}}function hi(e,t,n,o,r,i=.1){const s=sg(i,t,n),a=(t-s.x)/e.width,l=(n-s.y)/e.height,c=Math.min(a,l),u=At(c,o,r),d=e.x+e.width/2,h=e.y+e.height/2,f=t/2-d*u,g=n/2-h*u,y=ag(e,f,g,u,t,n),w={left:Math.min(y.left-s.left,0),top:Math.min(y.top-s.top,0),right:Math.min(y.right-s.right,0),bottom:Math.min(y.bottom-s.bottom,0)};return{x:f-w.left+w.right,y:g-w.top+w.bottom,zoom:u}}function lg(e,t){return{x:t.x+e.x,y:t.y+e.y,z:(e.z>t.z?e.z:t.z)+1}}function ea(e,t){if(!e.parentNode)return!1;const n=t.get(e.parentNode);return n?n.selected?!0:ea(n,t):!1}function kn(e,t){return typeof e>"u"?"":typeof e=="string"?e:`${t?`${t}__`:""}${Object.keys(e).sort().map(o=>`${o}=${e[o]}`).join("&")}`}function pi(e){const t=e.ctrlKey&&lo()?10:1;return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*t}function gi(e,t,n){return e<t?At(Math.abs(e-t),1,t)/t:e>n?-At(Math.abs(e-n),1,t)/t:0}function ta(e,t,n=15,o=40){const r=gi(e.x,o,t.width-o)*n,i=gi(e.y,o,t.height-o)*n;return[r,i]}function zo(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 vi(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(l=>l.id===s.item.id)===-1&&t.push(s.item);else if(s.type==="remove"){const a=t.findIndex(l=>l.id===s.id);a!==-1&&t.splice(a,1)}const i=t.map(s=>s.id);for(const s of t)for(const a of e)if(a.id===s.id)switch(a.type){case"select":s.selected=a.selected;break;case"position":if(cn(s)&&(typeof a.position<"u"&&(s.position=a.position),typeof a.dragging<"u"&&(s.dragging=a.dragging),s.expandParent&&s.parentNode)){const l=t[i.indexOf(s.parentNode)];l&&cn(l)&&zo(s,l)}break;case"dimensions":if(cn(s)&&(typeof a.dimensions<"u"&&(s.dimensions=a.dimensions),typeof a.updateStyle<"u"&&a.updateStyle&&(s.style={...s.style||{},width:`${(n=a.dimensions)==null?void 0:n.width}px`,height:`${(o=a.dimensions)==null?void 0:o.height}px`}),typeof a.resizing<"u"&&(s.resizing=a.resizing),s.expandParent&&s.parentNode)){const l=t[i.indexOf(s.parentNode)];l&&cn(l)&&(!!l.dimensions.width&&!!l.dimensions.height?zo(s,l):pt(()=>{zo(s,l)}))}break}return t}function _t(e,t){return{id:e,type:"select",selected:t}}function mi(e){return{item:e,type:"add"}}function yi(e){return{id:e,type:"remove"}}function wi(e,t,n,o,r){return{id:e,source:t,target:n,sourceHandle:o||null,targetHandle:r||null,type:"remove"}}function xt(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(_t(i.id,s)))}return o}const _i=()=>{};function ie(e){const t=new Set;let n=_i,o=()=>!1;const r=()=>t.size>0||o(),i=h=>{n=h},s=()=>{n=_i},a=h=>{o=h},l=()=>{o=()=>!1},c=h=>{t.delete(h)};return{on:h=>{t.add(h);const f=()=>c(h);return mn(f),{off:f}},off:c,trigger:h=>{const f=[n];return r()?f.push(...t):e&&f.push(e),Promise.allSettled(f.map(g=>g(h)))},hasListeners:r,listeners:t,setEmitter:i,removeEmitter:s,setHasEmitListeners:a,removeHasEmitListeners:l}}function xi(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 ug(e,t,n,o){var r,i;const s=new Map;for(const[a,l]of e)(l.selected||l.id===o)&&(!l.parentNode||!ea(l,e))&&(l.draggable||t&&typeof l.draggable>"u")&&e.get(a)&&s.set(a,{id:l.id,position:l.position||{x:0,y:0},distance:{x:n.x-((r=l.computedPosition)==null?void 0:r.x)||0,y:n.y-((i=l.computedPosition)==null?void 0:i.y)||0},from:{x:l.computedPosition.x,y:l.computedPosition.y},extent:l.extent,parentNode:l.parentNode,dimensions:{...l.dimensions},expandParent:l.expandParent});return Array.from(s.values())}function Bo({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 na(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 cg(e,t,n){const[o,r,i,s]=typeof e!="string"?na(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 dg(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=cg(r,e,o);i&&(r=i)}else t(new ze(Ie.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,a,l]=na(r.padding),c=o?.computedPosition.x||0,u=o?.computedPosition.y||0;r=[[r.range[0][0]+c+l,r.range[0][1]+u+i],[r.range[1][0]+c-s,r.range[1][1]+u-a]]}return r==="parent"?[[Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY],[Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY]]:r}function fg({width:e,height:t},n){return[n[0],[n[1][0]-(e||0),n[1][1]-(t||0)]]}function $r(e,t,n,o,r){const i=fg(e.dimensions,dg(e,n,o,r)),s=Ys(t,i);return{position:{x:s.x-(r?.computedPosition.x||0),y:s.y-(r?.computedPosition.y||0)},computedPosition:s}}function Qt(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:a}=t??vg(e);if(o)return{x:r+s/2,y:i+a/2};switch(t?.position??n){case ue.Top:return{x:r+s/2,y:i};case ue.Right:return{x:r+s,y:i+a/2};case ue.Bottom:return{x:r+s/2,y:i+a};case ue.Left:return{x:r,y:i+a/2}}}function bi(e,t){return e&&(t?e.find(n=>n.id===t):e[0])||null}function hg({sourcePos:e,targetPos:t,sourceWidth:n,sourceHeight:o,targetWidth:r,targetHeight:i,width:s,height:a,viewport:l}){const c={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)};c.x===c.x2&&(c.x2+=1),c.y===c.y2&&(c.y2+=1);const u=Zs({x:(0-l.x)/l.zoom,y:(0-l.y)/l.zoom,width:s/l.zoom,height:a/l.zoom}),d=Math.max(0,Math.min(u.x2,c.x2)-Math.max(u.x,c.x)),h=Math.max(0,Math.min(u.y2,c.y2)-Math.max(u.y,c.y));return Math.ceil(d*h)>0}function pg(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 Ie=(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))(Ie||{});const Ei={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 ze extends Error{constructor(t,...n){var o;super((o=Ei[t])==null?void 0:o.call(Ei,...n)),this.name="VueFlowError",this.code=t,this.args=n}}function Mr(e){return"clientX"in e}function gg(e){return"sourceEvent"in e}function nt(e,t){const n=Mr(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 lo=()=>{var e;return typeof navigator<"u"&&((e=navigator?.userAgent)==null?void 0:e.indexOf("Mac"))>=0};function vg(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 ko(e,t=[1,1]){return{x:t[0]*Math.round(e.x/t[0]),y:t[1]*Math.round(e.y/t[1])}}const mg=()=>!0;function Ro(e){e?.classList.remove("valid","connecting","vue-flow__handle-valid","vue-flow__handle-connecting")}function yg(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())ao(r,so(i))>0&&o.push(i);return o}const wg=250;function _g(e,t,n,o){var r,i;let s=[],a=Number.POSITIVE_INFINITY;const l=yg(e,n,t+wg);for(const c of l){const u=[...((r=c.handleBounds)==null?void 0:r.source)??[],...((i=c.handleBounds)==null?void 0:i.target)??[]];for(const d of u){if(o.nodeId===d.nodeId&&o.type===d.type&&o.id===d.id)continue;const{x:h,y:f}=Qt(c,d,d.position,!0),g=Math.sqrt((h-e.x)**2+(f-e.y)**2);g>t||(g<a?(s=[{...d,x:h,y:f}],a=g):g===a&&s.push({...d,x:h,y:f}))}}if(!s.length)return null;if(s.length>1){const c=o.type==="source"?"target":"source";return s.find(u=>u.type===c)??s[0]}return s[0]}function ki(e,{handle:t,connectionMode:n,fromNodeId:o,fromHandleId:r,fromType:i,doc:s,lib:a,flowId:l,isValidConnection:c=mg},u,d,h,f){const g=i==="target",y=t?s.querySelector(`.${a}-flow__handle[data-id="${l}-${t?.nodeId}-${t?.id}-${t?.type}"]`):null,{x:w,y:b}=nt(e),E=s.elementFromPoint(w,b),v=E?.classList.contains(`${a}-flow__handle`)?E:y,m={handleDomNode:v,isValid:!1,connection:null,toHandle:null};if(v){const T=oa(void 0,v),B=v.getAttribute("data-nodeid"),H=v.getAttribute("data-handleid"),F=v.classList.contains("connectable"),K=v.classList.contains("connectableend");if(!B||!T)return m;const I={source:g?B:o,sourceHandle:g?H:r,target:g?o:B,targetHandle:g?r:H};m.connection=I;const S=F&&K&&(n===St.Strict?g&&T==="source"||!g&&T==="target":B!==o||H!==r);m.isValid=S&&c(I,{nodes:d,edges:u,sourceNode:h(I.source),targetNode:h(I.target)}),m.toHandle=ra(B,T,H,f,n,!0)}return m}function oa(e,t){return e||(t?.classList.contains("target")?"target":t?.classList.contains("source")?"source":null)}function xg(e,t){let n=null;return t?n="valid":e&&!t&&(n="invalid"),n}function bg(e,t){let n=null;return t?n=!0:e&&!t&&(n=!1),n}function ra(e,t,n,o,r,i=!1){var s,a,l;const c=o.get(e);if(!c)return null;const u=r===St.Strict?(s=c.handleBounds)==null?void 0:s[t]:[...((a=c.handleBounds)==null?void 0:a.source)??[],...((l=c.handleBounds)==null?void 0:l.target)??[]],d=(n?u?.find(h=>h.id===n):u?.[0])??null;return d&&i?{...d,...Qt(c,d,d.position,!0)}:d}const sr={[ue.Left]:ue.Right,[ue.Right]:ue.Left,[ue.Top]:ue.Bottom,[ue.Bottom]:ue.Top},Eg=["production","prod"];function $n(e,...t){ia()&&console.warn(`[Vue Flow]: ${e}`,...t)}function ia(){return!Eg.includes("production")}function Si(e,t,n,o,r){const i=t.querySelectorAll(`.vue-flow__handle.${e}`);return i?.length?Array.from(i).map(s=>{const a=s.getBoundingClientRect();return{id:s.getAttribute("data-handleid"),type:e,nodeId:r,position:s.getAttribute("data-handlepos"),x:(a.left-n.left)/o,y:(a.top-n.top)/o,...Eo(s)}}):null}function ar(e,t,n,o,r,i=!1,s){r.value=!1,e.selected?(i||e.selected&&t)&&(o([e]),pt(()=>{s.blur()})):n([e])}function Pe(e){return typeof k(e)<"u"}function kg(e,t,n,o){if(!e||!e.source||!e.target)return n(new ze(Ie.EDGE_INVALID,e?.id??"[ID UNKNOWN]")),!1;let r;return Ct(e)?r=e:r={...e,id:Us(e)},r=Ws(r,void 0,o),og(r,t)?!1:r}function Sg(e,t,n,o,r){if(!t.source||!t.target)return r(new ze(Ie.EDGE_INVALID,e.id)),!1;if(!n)return r(new ze(Ie.EDGE_NOT_FOUND,e.id)),!1;const{id:i,...s}=e;return{...s,id:o?Us(t):i,source:t.source,target:t.target,sourceHandle:t.sourceHandle,targetHandle:t.targetHandle}}function Ci(e,t,n){const o={},r=[];for(let i=0;i<e.length;++i){const s=e[i];if(!Ot(s)){n(new ze(Ie.NODE_INVALID,s?.id)||`[ID UNKNOWN|INDEX ${i}]`);continue}const a=eg(s,t(s.id),s.parentNode);s.parentNode&&(o[s.parentNode]=!0),r[i]=a}for(const i of r){const s=t(i.parentNode)||r.find(a=>a.id===i.parentNode);i.parentNode&&!s&&n(new ze(Ie.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 Ni(e,t,n,o,r,i){let s=r;const a=o.get(s)||new Map;o.set(s,a.set(n,t)),s=`${r}-${e}`;const l=o.get(s)||new Map;if(o.set(s,l.set(n,t)),i){s=`${r}-${e}-${i}`;const c=o.get(s)||new Map;o.set(s,c.set(n,t))}}function Lo(e,t,n){e.clear();for(const o of n){const{source:r,target:i,sourceHandle:s=null,targetHandle:a=null}=o,l={edgeId:o.id,source:r,target:i,sourceHandle:s,targetHandle:a},c=`${r}-${s}--${i}-${a}`,u=`${i}-${a}--${r}-${s}`;Ni("source",l,u,e,r,s),Ni("target",l,c,e,i,a)}}function $i(e,t){if(e.size!==t.size)return!1;for(const n of e)if(!t.has(n))return!1;return!0}function Vo(e,t,n,o,r,i,s,a){const l=[];for(const c of e){const u=Ct(c)?c:kg(c,a,r,i);if(!u)continue;const d=n(u.source),h=n(u.target);if(!d||!h){r(new ze(Ie.EDGE_SOURCE_TARGET_MISSING,u.id,u.source,u.target));continue}if(!d){r(new ze(Ie.EDGE_SOURCE_MISSING,u.id,u.source));continue}if(!h){r(new ze(Ie.EDGE_TARGET_MISSING,u.id,u.target));continue}if(t&&!t(u,{edges:a,nodes:s,sourceNode:d,targetNode:h})){r(new ze(Ie.EDGE_INVALID,u.id));continue}const f=o(u.id);l.push({...Ws(u,f,i),sourceNode:d,targetNode:h})}return l}const Mi=Symbol("vueFlow"),sa=Symbol("nodeId"),aa=Symbol("nodeRef"),Cg=Symbol("edgeId"),Ng=Symbol("edgeRef"),So=Symbol("slots");function la(e){const{vueFlowRef:t,snapToGrid:n,snapGrid:o,noDragClassName:r,nodeLookup:i,nodeExtent:s,nodeDragThreshold:a,viewport:l,autoPanOnNodeDrag:c,autoPanSpeed:u,nodesDraggable:d,panBy:h,findNode:f,multiSelectionActive:g,nodesSelectionActive:y,selectNodesOnDrag:w,removeSelectedElements:b,addSelectedNodes:E,updateNodePositions:v,emits:m}=Te(),{onStart:T,onDrag:B,onStop:H,onClick:F,el:K,disabled:I,id:A,selectable:S,dragHandle:C}=e,p=dt(!1);let N=[],_,$=null,P={x:void 0,y:void 0},G={x:0,y:0},L=null,q=!1,U=!1,J=0,D=!1;const x=Tg(),O=({x:ae,y:me})=>{P={x:ae,y:me};let z=!1;if(N=N.map(M=>{const V={x:ae-M.distance.x,y:me-M.distance.y},{computedPosition:X}=$r(M,n.value?ko(V,o.value):V,m.error,s.value,M.parentNode?f(M.parentNode):void 0);return z=z||M.position.x!==X.x||M.position.y!==X.y,M.position=X,M}),U=U||z,!!z&&(v(N,!0,!0),p.value=!0,L)){const[M,V]=Bo({id:A,dragItems:N,findNode:f});B({event:L,node:M,nodes:V})}},R=()=>{if(!$)return;const[ae,me]=ta(G,$,u.value);if(ae!==0||me!==0){const z={x:(P.x??0)-ae/l.value.zoom,y:(P.y??0)-me/l.value.zoom};h({x:ae,y:me})&&O(z)}J=requestAnimationFrame(R)},W=(ae,me)=>{q=!0;const z=f(A);!w.value&&!g.value&&z&&(z.selected||b()),z&&Ee(S)&&w.value&&ar(z,g.value,E,b,y,!1,me);const M=x(ae.sourceEvent);if(P=M,N=ug(i.value,d.value,M,A),N.length){const[V,X]=Bo({id:A,dragItems:N,findNode:f});T({event:ae.sourceEvent,node:V,nodes:X})}},Q=(ae,me)=>{var z;ae.sourceEvent.type==="touchmove"&&ae.sourceEvent.touches.length>1||(U=!1,a.value===0&&W(ae,me),P=x(ae.sourceEvent),$=((z=t.value)==null?void 0:z.getBoundingClientRect())||null,G=nt(ae.sourceEvent,$))},te=(ae,me)=>{const z=x(ae.sourceEvent);if(!D&&q&&c.value&&(D=!0,R()),!q){const M=z.xSnapped-(P.x??0),V=z.ySnapped-(P.y??0);Math.sqrt(M*M+V*V)>a.value&&W(ae,me)}(P.x!==z.xSnapped||P.y!==z.ySnapped)&&N.length&&q&&(L=ae.sourceEvent,G=nt(ae.sourceEvent,$),O(z))},re=ae=>{let me=!1;if(!q&&!p.value&&!g.value){const z=ae.sourceEvent,M=x(z),V=M.xSnapped-(P.x??0),X=M.ySnapped-(P.y??0),Y=Math.sqrt(V*V+X*X);Y!==0&&Y<=a.value&&(F?.(z),me=!0)}if(N.length&&!me){U&&(v(N,!1,!1),U=!1);const[z,M]=Bo({id:A,dragItems:N,findNode:f});H({event:ae.sourceEvent,node:z,nodes:M})}N=[],p.value=!1,D=!1,q=!1,P={x:void 0,y:void 0},cancelAnimationFrame(J)};return _e([()=>Ee(I),K],([ae,me],z,M)=>{if(me){const V=Ye(me);ae||(_=Qf().on("start",X=>Q(X,me)).on("drag",X=>te(X,me)).on("end",X=>re(X)).filter(X=>{const Y=X.target,se=Ee(C);return!X.button&&(!r.value||!xi(Y,`.${r.value}`,me)&&(!se||xi(Y,se,me)))}),V.call(_)),M(()=>{V.on(".drag",null),_&&(_.on("start",null),_.on("drag",null),_.on("end",null))})}}),p}function $g(){return{doubleClick:ie(),click:ie(),mouseEnter:ie(),mouseMove:ie(),mouseLeave:ie(),contextMenu:ie(),updateStart:ie(),update:ie(),updateEnd:ie()}}function Mg(e,t){const n=$g();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 Tg(){const{viewport:e,snapGrid:t,snapToGrid:n,vueFlowRef:o}=Te();return r=>{var i;const s=((i=o.value)==null?void 0:i.getBoundingClientRect())??{left:0,top:0},a=gg(r)?r.sourceEvent:r,{x:l,y:c}=nt(a,s),u=En({x:l,y:c},e.value),{x:d,y:h}=n.value?ko(u,t.value):u;return{xSnapped:d,ySnapped:h,...u}}}function zn(){return!0}function ua({handleId:e,nodeId:t,type:n,isValidConnection:o,edgeUpdaterType:r,onEdgeUpdate:i,onEdgeUpdateEnd:s}){const{id:a,vueFlowRef:l,connectionMode:c,connectionRadius:u,connectOnClick:d,connectionClickStartHandle:h,nodesConnectable:f,autoPanOnConnect:g,autoPanSpeed:y,findNode:w,panBy:b,startConnection:E,updateConnection:v,endConnection:m,emits:T,viewport:B,edges:H,nodes:F,isValidConnection:K,nodeLookup:I}=Te();let A=null,S=!1,C=null;function p(_){var $;const P=Ee(n)==="target",G=Mr(_),L=fi(_.target),q=_.currentTarget;if(q&&(G&&_.button===0||!G)){let U=function(de){z=nt(de,re),O=_g(En(z,B.value,!1,[1,1]),u.value,I.value,X),M||(V(),M=!0);const ye=ki(de,{handle:O,connectionMode:c.value,fromNodeId:Ee(t),fromHandleId:Ee(e),fromType:P?"target":"source",isValidConnection:x,doc:L,lib:"vue",flowId:a,nodeLookup:I.value},H.value,F.value,w,I.value);C=ye.handleDomNode,A=ye.connection,S=bg(!!O,ye.isValid);const be={...pe,isValid:S,to:ye.toHandle&&S?bn({x:ye.toHandle.x,y:ye.toHandle.y},B.value):z,toHandle:ye.toHandle,toPosition:S&&ye.toHandle?ye.toHandle.position:sr[X.position],toNode:ye.toHandle?I.value.get(ye.toHandle.nodeId):null};if(S&&O&&pe?.toHandle&&be.toHandle&&pe.toHandle.type===be.toHandle.type&&pe.toHandle.nodeId===be.toHandle.nodeId&&pe.toHandle.id===be.toHandle.id&&pe.to.x===be.to.x&&pe.to.y===be.to.y)return;const ke=O??ye.toHandle;if(v(ke&&S?bn({x:ke.x,y:ke.y},B.value):z,ke,xg(!!ke,S)),pe=be,!O&&!S&&!C)return Ro(me);A&&A.source!==A.target&&C&&(Ro(me),me=C,C.classList.add("connecting","vue-flow__handle-connecting"),C.classList.toggle("valid",!!S),C.classList.toggle("vue-flow__handle-valid",!!S))},J=function(de){"touches"in de&&de.touches.length>0||((O||C)&&A&&S&&(i?i(de,A):T.connect(A)),T.connectEnd(de),r&&s?.(de),Ro(me),cancelAnimationFrame(R),m(de),M=!1,S=!1,A=null,C=null,L.removeEventListener("mousemove",U),L.removeEventListener("mouseup",J),L.removeEventListener("touchmove",U),L.removeEventListener("touchend",J))};const D=w(Ee(t));let x=Ee(o)||K.value||zn;!x&&D&&(x=(P?D.isValidSourcePos:D.isValidTargetPos)||zn);let O,R=0;const{x:W,y:Q}=nt(_),te=oa(Ee(r),q),re=($=l.value)==null?void 0:$.getBoundingClientRect();if(!re||!te)return;const ae=ra(Ee(t),te,Ee(e),I.value,c.value);if(!ae)return;let me,z=nt(_,re),M=!1;const V=()=>{if(!g.value)return;const[de,ye]=ta(z,re,y.value);b({x:de,y:ye}),R=requestAnimationFrame(V)},X={...ae,nodeId:Ee(t),type:te,position:ae.position},Y=I.value.get(Ee(t)),le={inProgress:!0,isValid:null,from:Qt(Y,X,ue.Left,!0),fromHandle:X,fromPosition:X.position,fromNode:Y,to:z,toHandle:null,toPosition:sr[X.position],toNode:null};E({nodeId:Ee(t),id:Ee(e),type:te,position:q?.getAttribute("data-handlepos")||ue.Top,...z},{x:W-re.left,y:Q-re.top}),T.connectStart({event:_,nodeId:Ee(t),handleId:Ee(e),handleType:te});let pe=le;L.addEventListener("mousemove",U),L.addEventListener("mouseup",J),L.addEventListener("touchmove",U),L.addEventListener("touchend",J)}}function N(_){var $,P;if(!d.value)return;const G=Ee(n)==="target";if(!h.value){T.clickConnectStart({event:_,nodeId:Ee(t),handleId:Ee(e)}),E({nodeId:Ee(t),type:Ee(n),id:Ee(e),position:ue.Top,...nt(_)},void 0,!0);return}let L=Ee(o)||K.value||zn;const q=w(Ee(t));if(!L&&q&&(L=(G?q.isValidSourcePos:q.isValidTargetPos)||zn),q&&(typeof q.connectable>"u"?f.value:q.connectable)===!1)return;const U=fi(_.target),J=ki(_,{handle:{nodeId:Ee(t),id:Ee(e),type:Ee(n),position:ue.Top,...nt(_)},connectionMode:c.value,fromNodeId:h.value.nodeId,fromHandleId:h.value.id??null,fromType:h.value.type,isValidConnection:L,doc:U,lib:"vue",flowId:a,nodeLookup:I.value},H.value,F.value,w,I.value),D=(($=J.connection)==null?void 0:$.source)===((P=J.connection)==null?void 0:P.target);J.isValid&&J.connection&&!D&&T.connect(J.connection),T.clickConnectEnd(_),m(_,!0)}return{handlePointerDown:p,handleClick:N}}function Og(){return tn(sa,"")}function ca(e){const t=e??Og()??"",n=tn(aa,ce(null)),{findNode:o,edges:r,emits:i}=Te(),s=o(t);return s||i.error(new ze(Ie.NODE_NOT_FOUND,t)),{id:t,nodeEl:n,node:s,parentNode:ne(()=>o(s.parentNode)),connectedEdges:ne(()=>Qs([s],r.value))}}function Pg(){return{doubleClick:ie(),click:ie(),mouseEnter:ie(),mouseMove:ie(),mouseLeave:ie(),contextMenu:ie(),dragStart:ie(),drag:ie(),dragStop:ie()}}function Ig(e,t){const n=Pg();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 da(){const{getSelectedNodes:e,nodeExtent:t,updateNodePositions:n,findNode:o,snapGrid:r,snapToGrid:i,nodesDraggable:s,emits:a}=Te();return(l,c=!1)=>{const u=i.value?r.value[0]:5,d=i.value?r.value[1]:5,h=c?4:1,f=l.x*u*h,g=l.y*d*h,y=[];for(const w of e.value)if(w.draggable||s&&typeof w.draggable>"u"){const b={x:w.computedPosition.x+f,y:w.computedPosition.y+g},{position:E}=$r(w,b,a.error,t.value,w.parentNode?o(w.parentNode):void 0);y.push({id:w.id,position:E,from:w.position,distance:{x:l.x,y:l.y},dimensions:w.dimensions})}n(y,!0,!1)}}const Bn=.1,Dg=e=>((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2;function wt(){return $n("Viewport not initialized yet."),Promise.resolve(!1)}const Ag={zoomIn:wt,zoomOut:wt,zoomTo:wt,fitView:wt,setCenter:wt,fitBounds:wt,project:e=>e,screenToFlowCoordinate:e=>e,flowToScreenCoordinate:e=>e,setViewport:wt,setTransform:wt,getViewport:()=>({x:0,y:0,zoom:1}),getTransform:()=>({x:0,y:0,zoom:1}),viewportInitialized:!1};function zg(e){function t(o,r){return new Promise(i=>{e.d3Selection&&e.d3Zoom?e.d3Zoom.interpolate(r?.interpolate==="linear"?hn:Hn).scaleBy(Fo(e.d3Selection,r?.duration,r?.ease,()=>{i(!0)}),o):i(!1)})}function n(o,r,i,s){return new Promise(a=>{var l;const{x:c,y:u}=Ys({x:-o,y:-r},e.translateExtent),d=Jt.translate(-c,-u).scale(i);e.d3Selection&&e.d3Zoom?(l=e.d3Zoom)==null||l.interpolate(s?.interpolate==="linear"?hn:Hn).transform(Fo(e.d3Selection,s?.duration,s?.ease,()=>{a(!0)}),d):a(!1)})}return ne(()=>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"?hn:Hn).scaleTo(Fo(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:Bn,includeHiddenNodes:!1,duration:0})=>{var i,s;const a=[];for(const h of e.nodes)h.dimensions.width&&h.dimensions.height&&(r?.includeHiddenNodes||!h.hidden)&&(!((i=r.nodes)!=null&&i.length)||(s=r.nodes)!=null&&s.length&&r.nodes.includes(h.id))&&a.push(h);if(!a.length)return Promise.resolve(!1);const l=Ks(a),{x:c,y:u,zoom:d}=hi(l,e.dimensions.width,e.dimensions.height,r.minZoom??e.minZoom,r.maxZoom??e.maxZoom,r.padding??Bn);return n(c,u,d,r)},setCenter:(r,i,s)=>{const a=typeof s?.zoom<"u"?s.zoom:e.maxZoom,l=e.dimensions.width/2-r*a,c=e.dimensions.height/2-i*a;return n(l,c,a,s)},fitBounds:(r,i={padding:Bn})=>{const{x:s,y:a,zoom:l}=hi(r,e.dimensions.width,e.dimensions.height,e.minZoom,e.maxZoom,i.padding??Bn);return n(s,a,l,i)},project:r=>En(r,e.viewport,e.snapToGrid,e.snapGrid),screenToFlowCoordinate:r=>{if(e.vueFlowRef){const{x:i,y:s}=e.vueFlowRef.getBoundingClientRect(),a={x:r.x-i,y:r.y-s};return En(a,e.viewport,e.snapToGrid,e.snapGrid)}return{x:0,y:0}},flowToScreenCoordinate:r=>{if(e.vueFlowRef){const{x:i,y:s}=e.vueFlowRef.getBoundingClientRect(),a={x:r.x+i,y:r.y+s};return bn(a,e.viewport)}return{x:0,y:0}}}:Ag)}function Fo(e,t=0,n=Dg,o=()=>{}){const r=typeof t=="number"&&t>0;return r||o(),r?e.transition().duration(t).ease(n).on("end",o):e}function Bg(e,t,n){const o=Xi(!0);return o.run(()=>{const r=()=>{o.run(()=>{let y,w,b=!!(n.nodes.value.length||n.edges.value.length);y=Rt([e.modelValue,()=>{var E,v;return(v=(E=e.modelValue)==null?void 0:E.value)==null?void 0:v.length}],([E])=>{E&&Array.isArray(E)&&(w?.pause(),n.setElements(E),!w&&!b&&E.length?b=!0:w?.resume())}),w=Rt([n.nodes,n.edges,()=>n.edges.value.length,()=>n.nodes.value.length],([E,v])=>{var m;(m=e.modelValue)!=null&&m.value&&Array.isArray(e.modelValue.value)&&(y?.pause(),e.modelValue.value=[...E,...v],pt(()=>{y?.resume()}))},{immediate:b}),dn(()=>{y?.stop(),w?.stop()})})},i=()=>{o.run(()=>{let y,w,b=!!n.nodes.value.length;y=Rt([e.nodes,()=>{var E,v;return(v=(E=e.nodes)==null?void 0:E.value)==null?void 0:v.length}],([E])=>{E&&Array.isArray(E)&&(w?.pause(),n.setNodes(E),!w&&!b&&E.length?b=!0:w?.resume())}),w=Rt([n.nodes,()=>n.nodes.value.length],([E])=>{var v;(v=e.nodes)!=null&&v.value&&Array.isArray(e.nodes.value)&&(y?.pause(),e.nodes.value=[...E],pt(()=>{y?.resume()}))},{immediate:b}),dn(()=>{y?.stop(),w?.stop()})})},s=()=>{o.run(()=>{let y,w,b=!!n.edges.value.length;y=Rt([e.edges,()=>{var E,v;return(v=(E=e.edges)==null?void 0:E.value)==null?void 0:v.length}],([E])=>{E&&Array.isArray(E)&&(w?.pause(),n.setEdges(E),!w&&!b&&E.length?b=!0:w?.resume())}),w=Rt([n.edges,()=>n.edges.value.length],([E])=>{var v;(v=e.edges)!=null&&v.value&&Array.isArray(e.edges.value)&&(y?.pause(),e.edges.value=[...E],pt(()=>{y?.resume()}))},{immediate:b}),dn(()=>{y?.stop(),w?.stop()})})},a=()=>{o.run(()=>{_e(()=>t.maxZoom,()=>{t.maxZoom&&Pe(t.maxZoom)&&n.setMaxZoom(t.maxZoom)},{immediate:!0})})},l=()=>{o.run(()=>{_e(()=>t.minZoom,()=>{t.minZoom&&Pe(t.minZoom)&&n.setMinZoom(t.minZoom)},{immediate:!0})})},c=()=>{o.run(()=>{_e(()=>t.translateExtent,()=>{t.translateExtent&&Pe(t.translateExtent)&&n.setTranslateExtent(t.translateExtent)},{immediate:!0})})},u=()=>{o.run(()=>{_e(()=>t.nodeExtent,()=>{t.nodeExtent&&Pe(t.nodeExtent)&&n.setNodeExtent(t.nodeExtent)},{immediate:!0})})},d=()=>{o.run(()=>{_e(()=>t.applyDefault,()=>{Pe(t.applyDefault)&&(n.applyDefault.value=t.applyDefault)},{immediate:!0})})},h=()=>{o.run(()=>{const y=async w=>{let b=w;typeof t.autoConnect=="function"&&(b=await t.autoConnect(w)),b!==!1&&n.addEdges([b])};_e(()=>t.autoConnect,()=>{Pe(t.autoConnect)&&(n.autoConnect.value=t.autoConnect)},{immediate:!0}),_e(n.autoConnect,(w,b,E)=>{w?n.onConnect(y):n.hooks.value.connect.off(y),E(()=>{n.hooks.value.connect.off(y)})},{immediate:!0})})},f=()=>{const y=["id","modelValue","translateExtent","nodeExtent","edges","nodes","maxZoom","minZoom","applyDefault","autoConnect"];for(const w of Object.keys(t)){const b=w;if(!y.includes(b)){const E=$e(()=>t[b]),v=n[b];cr(v)&&o.run(()=>{_e(E,m=>{Pe(m)&&(v.value=m)},{immediate:!0})})}}};r(),i(),s(),l(),a(),c(),u(),d(),h(),f()}),()=>o.stop()}function Rg(){return{edgesChange:ie(),nodesChange:ie(),nodeDoubleClick:ie(),nodeClick:ie(),nodeMouseEnter:ie(),nodeMouseMove:ie(),nodeMouseLeave:ie(),nodeContextMenu:ie(),nodeDragStart:ie(),nodeDrag:ie(),nodeDragStop:ie(),nodesInitialized:ie(),miniMapNodeClick:ie(),miniMapNodeDoubleClick:ie(),miniMapNodeMouseEnter:ie(),miniMapNodeMouseMove:ie(),miniMapNodeMouseLeave:ie(),connect:ie(),connectStart:ie(),connectEnd:ie(),clickConnectStart:ie(),clickConnectEnd:ie(),paneReady:ie(),init:ie(),move:ie(),moveStart:ie(),moveEnd:ie(),selectionDragStart:ie(),selectionDrag:ie(),selectionDragStop:ie(),selectionContextMenu:ie(),selectionStart:ie(),selectionEnd:ie(),viewportChangeStart:ie(),viewportChange:ie(),viewportChangeEnd:ie(),paneScroll:ie(),paneClick:ie(),paneContextMenu:ie(),paneMouseEnter:ie(),paneMouseMove:ie(),paneMouseLeave:ie(),edgeContextMenu:ie(),edgeMouseEnter:ie(),edgeMouseMove:ie(),edgeMouseLeave:ie(),edgeDoubleClick:ie(),edgeClick:ie(),edgeUpdateStart:ie(),edgeUpdate:ie(),edgeUpdateEnd:ie(),updateNodeInternals:ie(),error:ie(e=>$n(e.message))}}function Lg(e,t){const n=nn();Ba(()=>{for(const[r,i]of Object.entries(t.value)){const s=a=>{e(r,a)};i.setEmitter(s),mn(i.removeEmitter),i.setHasEmitListeners(()=>o(r)),mn(i.removeHasEmitListeners)}});function o(r){var i;const s=Vg(r);return!!((i=n?.vnode.props)==null?void 0:i[s])}}function Vg(e){const[t,...n]=e.split(":");return`on${t.replace(/(?:^|-)(\w)/g,(r,i)=>i.toUpperCase())}${n.length?`:${n.join(":")}`:""}`}function fa(){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:Nr.Full,paneDragging:!1,preventScrolling:!0,zoomOnScroll:!0,zoomOnPinch:!0,zoomOnDoubleClick:!0,panOnScroll:!1,panOnScrollSpeed:.5,panOnScrollMode:pn.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:Nt.Bezier,style:{}},connectionMode:St.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:lo()?"Meta":"Control",zoomActivationKeyCode:lo()?"Meta":"Control",deleteKeyCode:"Backspace",panActivationKeyCode:"Space",hooks:Rg(),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 Fg=["id","vueFlowRef","viewportRef","initialized","modelValue","nodes","edges","maxZoom","minZoom","translateExtent","hooks","defaultEdgeOptions"];function Hg(e,t,n){const o=zg(e),r=z=>{const M=z??[];e.hooks.updateNodeInternals.trigger(M)},i=z=>ng(z,e.nodes,e.edges),s=z=>tg(z,e.nodes,e.edges),a=z=>Qs(z,e.edges),l=({id:z,type:M,nodeId:V})=>{var X;const Y=z?`-${M}-${z}`:`-${M}`;return Array.from(((X=e.connectionLookup.get(`${V}${Y}`))==null?void 0:X.values())??[])},c=z=>{if(z)return t.value.get(z)},u=z=>{if(z)return n.value.get(z)},d=(z,M,V)=>{var X,Y;const se=[];for(const le of z){const pe={id:le.id,type:"position",dragging:V,from:le.from};if(M&&(pe.position=le.position,le.parentNode)){const de=c(le.parentNode);pe.position={x:pe.position.x-(((X=de?.computedPosition)==null?void 0:X.x)??0),y:pe.position.y-(((Y=de?.computedPosition)==null?void 0:Y.y)??0)}}se.push(pe)}se?.length&&e.hooks.nodesChange.trigger(se)},h=z=>{if(!e.vueFlowRef)return;const M=e.vueFlowRef.querySelector(".vue-flow__transformationpane");if(!M)return;const V=window.getComputedStyle(M),{m22:X}=new window.DOMMatrixReadOnly(V.transform),Y=[];for(const se of z){const le=se,pe=c(le.id);if(pe){const de=Eo(le.nodeElement);if(!!(de.width&&de.height&&(pe.dimensions.width!==de.width||pe.dimensions.height!==de.height||le.forceUpdate))){const be=le.nodeElement.getBoundingClientRect();pe.dimensions=de,pe.handleBounds.source=Si("source",le.nodeElement,be,X,pe.id),pe.handleBounds.target=Si("target",le.nodeElement,be,X,pe.id),Y.push({id:pe.id,type:"dimensions",dimensions:de})}}}!e.fitViewOnInitDone&&e.fitViewOnInit&&o.value.fitView().then(()=>{e.fitViewOnInitDone=!0}),Y.length&&e.hooks.nodesChange.trigger(Y)},f=(z,M)=>{const V=new Set,X=new Set;for(const le of z)Ot(le)?V.add(le.id):Ct(le)&&X.add(le.id);const Y=xt(t.value,V,!0),se=xt(n.value,X);if(e.multiSelectionActive){for(const le of V)Y.push(_t(le,M));for(const le of X)se.push(_t(le,M))}Y.length&&e.hooks.nodesChange.trigger(Y),se.length&&e.hooks.edgesChange.trigger(se)},g=z=>{if(e.multiSelectionActive){const M=z.map(V=>_t(V.id,!0));e.hooks.nodesChange.trigger(M);return}e.hooks.nodesChange.trigger(xt(t.value,new Set(z.map(M=>M.id)),!0)),e.hooks.edgesChange.trigger(xt(n.value))},y=z=>{if(e.multiSelectionActive){const M=z.map(V=>_t(V.id,!0));e.hooks.edgesChange.trigger(M);return}e.hooks.edgesChange.trigger(xt(n.value,new Set(z.map(M=>M.id)))),e.hooks.nodesChange.trigger(xt(t.value,new Set,!0))},w=z=>{f(z,!0)},b=z=>{const V=(z||e.nodes).map(X=>(X.selected=!1,_t(X.id,!1)));e.hooks.nodesChange.trigger(V)},E=z=>{const V=(z||e.edges).map(X=>(X.selected=!1,_t(X.id,!1)));e.hooks.edgesChange.trigger(V)},v=z=>{if(!z||!z.length)return f([],!1);const M=z.reduce((V,X)=>{const Y=_t(X.id,!1);return Ot(X)?V.nodes.push(Y):V.edges.push(Y),V},{nodes:[],edges:[]});M.nodes.length&&e.hooks.nodesChange.trigger(M.nodes),M.edges.length&&e.hooks.edgesChange.trigger(M.edges)},m=z=>{var M;(M=e.d3Zoom)==null||M.scaleExtent([z,e.maxZoom]),e.minZoom=z},T=z=>{var M;(M=e.d3Zoom)==null||M.scaleExtent([e.minZoom,z]),e.maxZoom=z},B=z=>{var M;(M=e.d3Zoom)==null||M.translateExtent(z),e.translateExtent=z},H=z=>{e.nodeExtent=z,r()},F=z=>{var M;(M=e.d3Zoom)==null||M.clickDistance(z)},K=z=>{e.nodesDraggable=z,e.nodesConnectable=z,e.elementsSelectable=z},I=z=>{const M=z instanceof Function?z(e.nodes):z;!e.initialized&&!M.length||(e.nodes=Ci(M,c,e.hooks.error.trigger))},A=z=>{const M=z instanceof Function?z(e.edges):z;if(!e.initialized&&!M.length)return;const V=Vo(M,e.isValidConnection,c,u,e.hooks.error.trigger,e.defaultEdgeOptions,e.nodes,e.edges);Lo(e.connectionLookup,n.value,V),e.edges=V},S=z=>{const M=z instanceof Function?z([...e.nodes,...e.edges]):z;!e.initialized&&!M.length||(I(M.filter(Ot)),A(M.filter(Ct)))},C=z=>{let M=z instanceof Function?z(e.nodes):z;M=Array.isArray(M)?M:[M];const V=Ci(M,c,e.hooks.error.trigger),X=[];for(const Y of V)X.push(mi(Y));X.length&&e.hooks.nodesChange.trigger(X)},p=z=>{let M=z instanceof Function?z(e.edges):z;M=Array.isArray(M)?M:[M];const V=Vo(M,e.isValidConnection,c,u,e.hooks.error.trigger,e.defaultEdgeOptions,e.nodes,e.edges),X=[];for(const Y of V)X.push(mi(Y));X.length&&e.hooks.edgesChange.trigger(X)},N=(z,M=!0,V=!1)=>{const X=z instanceof Function?z(e.nodes):z,Y=Array.isArray(X)?X:[X],se=[],le=[];function pe(ye){const be=a(ye);for(const ke of be)(!Pe(ke.deletable)||ke.deletable)&&le.push(wi(ke.id,ke.source,ke.target,ke.sourceHandle,ke.targetHandle))}function de(ye){const be=[];for(const ke of e.nodes)ke.parentNode===ye&&be.push(ke);if(be.length){for(const ke of be)se.push(yi(ke.id));M&&pe(be);for(const ke of be)de(ke.id)}}for(const ye of Y){const be=typeof ye=="string"?c(ye):ye;be&&(Pe(be.deletable)&&!be.deletable||(se.push(yi(be.id)),M&&pe([be]),V&&de(be.id)))}le.length&&e.hooks.edgesChange.trigger(le),se.length&&e.hooks.nodesChange.trigger(se)},_=z=>{const M=z instanceof Function?z(e.edges):z,V=Array.isArray(M)?M:[M],X=[];for(const Y of V){const se=typeof Y=="string"?u(Y):Y;se&&(Pe(se.deletable)&&!se.deletable||X.push(wi(typeof Y=="string"?Y:Y.id,se.source,se.target,se.sourceHandle,se.targetHandle)))}e.hooks.edgesChange.trigger(X)},$=(z,M,V=!0)=>{const X=u(z.id);if(!X)return!1;const Y=e.edges.indexOf(X),se=Sg(z,M,X,V,e.hooks.error.trigger);if(se){const[le]=Vo([se],e.isValidConnection,c,u,e.hooks.error.trigger,e.defaultEdgeOptions,e.nodes,e.edges);return e.edges=e.edges.map((pe,de)=>de===Y?le:pe),Lo(e.connectionLookup,n.value,[le]),le}return!1},P=(z,M,V={replace:!1})=>{const X=u(z);if(!X)return;const Y=typeof M=="function"?M(X):M;X.data=V.replace?Y:{...X.data,...Y}},G=z=>vi(z,e.nodes),L=z=>{const M=vi(z,e.edges);return Lo(e.connectionLookup,n.value,M),M},q=(z,M,V={replace:!1})=>{const X=c(z);if(!X)return;const Y=typeof M=="function"?M(X):M;V.replace?e.nodes.splice(e.nodes.indexOf(X),1,Y):Object.assign(X,Y)},U=(z,M,V={replace:!1})=>{const X=c(z);if(!X)return;const Y=typeof M=="function"?M(X):M;X.data=V.replace?Y:{...X.data,...Y}},J=(z,M,V=!1)=>{V?e.connectionClickStartHandle=z:e.connectionStartHandle=z,e.connectionEndHandle=null,e.connectionStatus=null,M&&(e.connectionPosition=M)},D=(z,M=null,V=null)=>{e.connectionStartHandle&&(e.connectionPosition=z,e.connectionEndHandle=M,e.connectionStatus=V)},x=(z,M)=>{e.connectionPosition={x:Number.NaN,y:Number.NaN},e.connectionEndHandle=null,e.connectionStatus=null,M?e.connectionClickStartHandle=null:e.connectionStartHandle=null},O=z=>{const M=Qp(z),V=M?null:cn(z)?z:c(z.id);return!M&&!V?[null,null,M]:[M?z:so(V),V,M]},R=(z,M=!0,V=e.nodes)=>{const[X,Y,se]=O(z);if(!X)return[];const le=[];for(const pe of V||e.nodes){if(!se&&(pe.id===Y.id||!pe.computedPosition))continue;const de=so(pe),ye=ao(de,X);(M&&ye>0||ye>=de.width*de.height||ye>=Number(X.width)*Number(X.height))&&le.push(pe)}return le},W=(z,M,V=!0)=>{const[X]=O(z);if(!X)return!1;const Y=ao(X,M);return V&&Y>0||Y>=Number(X.width)*Number(X.height)},Q=z=>{const{viewport:M,dimensions:V,d3Zoom:X,d3Selection:Y,translateExtent:se}=e;if(!X||!Y||!z.x&&!z.y)return!1;const le=Jt.translate(M.x+z.x,M.y+z.y).scale(M.zoom),pe=[[0,0],[V.width,V.height]],de=X.constrain()(le,pe,se),ye=e.viewport.x!==de.x||e.viewport.y!==de.y||e.viewport.zoom!==de.k;return X.transform(Y,de),ye},te=z=>{const M=z instanceof Function?z(e):z,V=["d3Zoom","d3Selection","d3ZoomHandler","viewportRef","vueFlowRef","dimensions","hooks"];Pe(M.defaultEdgeOptions)&&(e.defaultEdgeOptions=M.defaultEdgeOptions);const X=M.modelValue||M.nodes||M.edges?[]:void 0;X&&(M.modelValue&&X.push(...M.modelValue),M.nodes&&X.push(...M.nodes),M.edges&&X.push(...M.edges),S(X));const Y=()=>{Pe(M.maxZoom)&&T(M.maxZoom),Pe(M.minZoom)&&m(M.minZoom),Pe(M.translateExtent)&&B(M.translateExtent)};for(const se of Object.keys(M)){const le=se,pe=M[le];![...Fg,...V].includes(le)&&Pe(pe)&&(e[le]=pe)}Zo(()=>e.d3Zoom).not.toBeNull().then(Y),e.initialized||(e.initialized=!0)};return{updateNodePositions:d,updateNodeDimensions:h,setElements:S,setNodes:I,setEdges:A,addNodes:C,addEdges:p,removeNodes:N,removeEdges:_,findNode:c,findEdge:u,updateEdge:$,updateEdgeData:P,updateNode:q,updateNodeData:U,applyEdgeChanges:L,applyNodeChanges:G,addSelectedElements:w,addSelectedNodes:g,addSelectedEdges:y,setMinZoom:m,setMaxZoom:T,setTranslateExtent:B,setNodeExtent:H,setPaneClickDistance:F,removeSelectedElements:v,removeSelectedNodes:b,removeSelectedEdges:E,startConnection:J,updateConnection:D,endConnection:x,setInteractive:K,setState:te,getIntersectingNodes:R,getIncomers:i,getOutgoers:s,getConnectedEdges:a,getHandleConnections:l,isNodeIntersecting:W,panBy:Q,fitView:z=>o.value.fitView(z),zoomIn:z=>o.value.zoomIn(z),zoomOut:z=>o.value.zoomOut(z),zoomTo:(z,M)=>o.value.zoomTo(z,M),setViewport:(z,M)=>o.value.setViewport(z,M),setTransform:(z,M)=>o.value.setTransform(z,M),getViewport:()=>o.value.getViewport(),getTransform:()=>o.value.getTransform(),setCenter:(z,M,V)=>o.value.setCenter(z,M,V),fitBounds:(z,M)=>o.value.fitBounds(z,M),project:z=>o.value.project(z),screenToFlowCoordinate:z=>o.value.screenToFlowCoordinate(z),flowToScreenCoordinate:z=>o.value.flowToScreenCoordinate(z),toObject:()=>{const z=[],M=[];for(const V of e.nodes){const{computedPosition:X,handleBounds:Y,selected:se,dimensions:le,isParent:pe,resizing:de,dragging:ye,events:be,...ke}=V;z.push(ke)}for(const V of e.edges){const{selected:X,sourceNode:Y,targetNode:se,events:le,...pe}=V;M.push(pe)}return JSON.parse(JSON.stringify({nodes:z,edges:M,position:[e.viewport.x,e.viewport.y],zoom:e.viewport.zoom,viewport:e.viewport}))},fromObject:z=>new Promise(M=>{const{nodes:V,edges:X,position:Y,zoom:se,viewport:le}=z;V&&I(V),X&&A(X);const[pe,de]=le?.x&&le?.y?[le.x,le.y]:Y??[null,null];if(pe&&de){const ye=le?.zoom||se||e.viewport.zoom;return Zo(()=>o.value.viewportInitialized).toBe(!0).then(()=>{o.value.setViewport({x:pe,y:de,zoom:ye}).then(()=>{M(!0)})})}else M(!0)}),updateNodeInternals:r,viewportHelper:o,$reset:()=>{const z=fa();if(e.edges=[],e.nodes=[],e.d3Zoom&&e.d3Selection){const M=Jt.translate(z.defaultViewport.x??0,z.defaultViewport.y??0).scale(At(z.defaultViewport.zoom??1,z.minZoom,z.maxZoom)),V=e.viewportRef.getBoundingClientRect(),X=[[0,0],[V.width,V.height]],Y=e.d3Zoom.constrain()(M,X,z.translateExtent);e.d3Zoom.transform(e.d3Selection,Y)}te(z)},$destroy:()=>{}}}const Gg=["data-id","data-handleid","data-nodeid","data-handlepos"],qg={name:"Handle",compatConfig:{MODE:3}},en=ve({...qg,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=Fa(e,["position","connectable","connectableStart","connectableEnd","id"]),o=$e(()=>n.type??"source"),r=$e(()=>n.isValidConnection??null),{id:i,connectionStartHandle:s,connectionClickStartHandle:a,connectionEndHandle:l,vueFlowRef:c,nodesConnectable:u,noDragClassName:d,noPanClassName:h}=Te(),{id:f,node:g,nodeEl:y,connectedEdges:w}=ca(),b=ce(),E=$e(()=>typeof e.connectableStart<"u"?e.connectableStart:!0),v=$e(()=>typeof e.connectableEnd<"u"?e.connectableEnd:!0),m=$e(()=>{var A,S,C,p,N,_;return((A=s.value)==null?void 0:A.nodeId)===f&&((S=s.value)==null?void 0:S.id)===e.id&&((C=s.value)==null?void 0:C.type)===o.value||((p=l.value)==null?void 0:p.nodeId)===f&&((N=l.value)==null?void 0:N.id)===e.id&&((_=l.value)==null?void 0:_.type)===o.value}),T=$e(()=>{var A,S,C;return((A=a.value)==null?void 0:A.nodeId)===f&&((S=a.value)==null?void 0:S.id)===e.id&&((C=a.value)==null?void 0:C.type)===o.value}),{handlePointerDown:B,handleClick:H}=ua({nodeId:f,handleId:e.id,isValidConnection:r,type:o}),F=ne(()=>typeof e.connectable=="string"&&e.connectable==="single"?!w.value.some(A=>{const S=A[`${o.value}Handle`];return A[o.value]!==f?!1:S?S===e.id:!0}):typeof e.connectable=="number"?w.value.filter(A=>{const S=A[`${o.value}Handle`];return A[o.value]!==f?!1:S?S===e.id:!0}).length<e.connectable:typeof e.connectable=="function"?e.connectable(g,w.value):Pe(e.connectable)?e.connectable:u.value);je(()=>{var A;if(!g.dimensions.width||!g.dimensions.height)return;const S=(A=g.handleBounds[o.value])==null?void 0:A.find(G=>G.id===e.id);if(!c.value||S)return;const C=c.value.querySelector(".vue-flow__transformationpane");if(!y.value||!b.value||!C||!e.id)return;const p=y.value.getBoundingClientRect(),N=b.value.getBoundingClientRect(),_=window.getComputedStyle(C),{m22:$}=new window.DOMMatrixReadOnly(_.transform),P={id:e.id,position:e.position,x:(N.left-p.left)/$,y:(N.top-p.top)/$,type:o.value,nodeId:f,...Eo(b.value)};g.handleBounds[o.value]=[...g.handleBounds[o.value]??[],P]});function K(A){const S=Mr(A);F.value&&E.value&&(S&&A.button===0||!S)&&B(A)}function I(A){!f||!a.value&&!E.value||F.value&&H(A)}return t({handleClick:H,handlePointerDown:B,onClick:I,onPointerDown:K}),(A,S)=>(j(),ee("div",{ref_key:"handle",ref:b,"data-id":`${k(i)}-${k(f)}-${e.id}-${o.value}`,"data-handleid":e.id,"data-nodeid":k(f),"data-handlepos":A.position,class:Ae(["vue-flow__handle",[`vue-flow__handle-${A.position}`,`vue-flow__handle-${e.id}`,k(d),k(h),o.value,{connectable:F.value,connecting:T.value,connectablestart:E.value,connectableend:v.value,connectionindicator:F.value&&(E.value&&!m.value||v.value&&m.value)}]]),onMousedown:K,onTouchstartPassive:K,onClick:I},[xe(A.$slots,"default",{id:A.id})],42,Gg))}}),Co=function({sourcePosition:e=ue.Bottom,targetPosition:t=ue.Top,label:n,connectable:o=!0,isValidTargetPos:r,isValidSourcePos:i,data:s}){const a=s.label??n;return[Ce(en,{type:"target",position:t,connectable:o,isValidConnection:r}),typeof a!="string"&&a?Ce(a):Ce(Me,[a]),Ce(en,{type:"source",position:e,connectable:o,isValidConnection:i})]};Co.props=["sourcePosition","targetPosition","label","isValidTargetPos","isValidSourcePos","connectable","data"];Co.inheritAttrs=!1;Co.compatConfig={MODE:3};const jg=Co,No=function({targetPosition:e=ue.Top,label:t,connectable:n=!0,isValidTargetPos:o,data:r}){const i=r.label??t;return[Ce(en,{type:"target",position:e,connectable:n,isValidConnection:o}),typeof i!="string"&&i?Ce(i):Ce(Me,[i])]};No.props=["targetPosition","label","isValidTargetPos","connectable","data"];No.inheritAttrs=!1;No.compatConfig={MODE:3};const Yg=No,$o=function({sourcePosition:e=ue.Bottom,label:t,connectable:n=!0,isValidSourcePos:o,data:r}){const i=r.label??t;return[typeof i!="string"&&i?Ce(i):Ce(Me,[i]),Ce(en,{type:"source",position:e,connectable:n,isValidConnection:o})]};$o.props=["sourcePosition","label","isValidSourcePos","connectable","data"];$o.inheritAttrs=!1;$o.compatConfig={MODE:3};const Wg=$o,Xg=["transform"],Ug=["width","height","x","y","rx","ry"],Zg=["y"],Kg={name:"EdgeText",compatConfig:{MODE:3}},Jg=ve({...Kg,props:{x:{},y:{},label:{},labelStyle:{default:()=>({})},labelShowBg:{type:Boolean,default:!0},labelBgStyle:{default:()=>({})},labelBgPadding:{default:()=>[2,4]},labelBgBorderRadius:{default:2}},setup(e){const t=ce({x:0,y:0,width:0,height:0}),n=ce(null),o=ne(()=>`translate(${e.x-t.value.width/2} ${e.y-t.value.height/2})`);je(r),_e([()=>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)=>(j(),ee("g",{transform:o.value,class:"vue-flow__edge-textwrapper"},[i.labelShowBg?(j(),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:Re(i.labelBgStyle),rx:i.labelBgBorderRadius,ry:i.labelBgBorderRadius},null,12,Ug)):ge("",!0),Z("text",He(i.$attrs,{ref_key:"el",ref:n,class:"vue-flow__edge-text",y:t.value.height/2,dy:"0.3em",style:i.labelStyle}),[xe(i.$slots,"default",{},()=>[typeof i.label!="string"?(j(),we(Ge(i.label),{key:0})):(j(),ee(Me,{key:1},[Se(he(i.label),1)],64))])],16,Zg)],8,Xg))}}),Qg=["id","d","marker-end","marker-start"],ev=["d","stroke-width"],tv={name:"BaseEdge",inheritAttrs:!1,compatConfig:{MODE:3}},Mo=ve({...tv,props:{id:{},labelX:{},labelY:{},path:{},label:{},markerStart:{},markerEnd:{},interactionWidth:{default:20},labelStyle:{},labelShowBg:{type:Boolean},labelBgStyle:{},labelBgPadding:{},labelBgBorderRadius:{}},setup(e,{expose:t}){const n=ce(null),o=ce(null),r=ce(null),i=Ha();return t({pathEl:n,interactionEl:o,labelEl:r}),(s,a)=>(j(),ee(Me,null,[Z("path",He(k(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,Qg),s.interactionWidth?(j(),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,ev)):ge("",!0),s.label&&s.labelX&&s.labelY?(j(),we(Jg,{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"])):ge("",!0)],64))}});function ha({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,a=o<t?o+s:o-s;return[i,a,r,s]}function pa({sourceX:e,sourceY:t,targetX:n,targetY:o,sourceControlX:r,sourceControlY:i,targetControlX:s,targetControlY:a}){const l=e*.125+r*.375+s*.375+n*.125,c=t*.125+i*.375+a*.375+o*.125,u=Math.abs(l-e),d=Math.abs(c-t);return[l,c,u,d]}function Rn(e,t){return e>=0?.5*e:t*25*Math.sqrt(-e)}function Ti({pos:e,x1:t,y1:n,x2:o,y2:r,c:i}){let s,a;switch(e){case ue.Left:s=t-Rn(t-o,i),a=n;break;case ue.Right:s=t+Rn(o-t,i),a=n;break;case ue.Top:s=t,a=n-Rn(n-r,i);break;case ue.Bottom:s=t,a=n+Rn(r-n,i);break}return[s,a]}function ga(e){const{sourceX:t,sourceY:n,sourcePosition:o=ue.Bottom,targetX:r,targetY:i,targetPosition:s=ue.Top,curvature:a=.25}=e,[l,c]=Ti({pos:o,x1:t,y1:n,x2:r,y2:i,c:a}),[u,d]=Ti({pos:s,x1:r,y1:i,x2:t,y2:n,c:a}),[h,f,g,y]=pa({sourceX:t,sourceY:n,targetX:r,targetY:i,sourceControlX:l,sourceControlY:c,targetControlX:u,targetControlY:d});return[`M${t},${n} C${l},${c} ${u},${d} ${r},${i}`,h,f,g,y]}function Oi({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 va(e){const{sourceX:t,sourceY:n,sourcePosition:o=ue.Bottom,targetX:r,targetY:i,targetPosition:s=ue.Top}=e,[a,l]=Oi({pos:o,x1:t,y1:n,x2:r,y2:i}),[c,u]=Oi({pos:s,x1:r,y1:i,x2:t,y2:n}),[d,h,f,g]=pa({sourceX:t,sourceY:n,targetX:r,targetY:i,sourceControlX:a,sourceControlY:l,targetControlX:c,targetControlY:u});return[`M${t},${n} C${a},${l} ${c},${u} ${r},${i}`,d,h,f,g]}const Pi={[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 nv({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 Ii(e,t){return Math.sqrt((t.x-e.x)**2+(t.y-e.y)**2)}function ov({source:e,sourcePosition:t=ue.Bottom,target:n,targetPosition:o=ue.Top,center:r,offset:i}){const s=Pi[t],a=Pi[o],l={x:e.x+s.x*i,y:e.y+s.y*i},c={x:n.x+a.x*i,y:n.y+a.y*i},u=nv({source:l,sourcePosition:t,target:c}),d=u.x!==0?"x":"y",h=u[d];let f,g,y;const w={x:0,y:0},b={x:0,y:0},[E,v,m,T]=ha({sourceX:e.x,sourceY:e.y,targetX:n.x,targetY:n.y});if(s[d]*a[d]===-1){g=r.x??E,y=r.y??v;const H=[{x:g,y:l.y},{x:g,y:c.y}],F=[{x:l.x,y},{x:c.x,y}];s[d]===h?f=d==="x"?H:F:f=d==="x"?F:H}else{const H=[{x:l.x,y:c.y}],F=[{x:c.x,y:l.y}];if(d==="x"?f=s.x===h?F:H:f=s.y===h?H:F,t===o){const C=Math.abs(e[d]-n[d]);if(C<=i){const p=Math.min(i-1,i-C);s[d]===h?w[d]=(l[d]>e[d]?-1:1)*p:b[d]=(c[d]>n[d]?-1:1)*p}}if(t!==o){const C=d==="x"?"y":"x",p=s[d]===a[C],N=l[C]>c[C],_=l[C]<c[C];(s[d]===1&&(!p&&N||p&&_)||s[d]!==1&&(!p&&_||p&&N))&&(f=d==="x"?H:F)}const K={x:l.x+w.x,y:l.y+w.y},I={x:c.x+b.x,y:c.y+b.y},A=Math.max(Math.abs(K.x-f[0].x),Math.abs(I.x-f[0].x)),S=Math.max(Math.abs(K.y-f[0].y),Math.abs(I.y-f[0].y));A>=S?(g=(K.x+I.x)/2,y=f[0].y):(g=f[0].x,y=(K.y+I.y)/2)}return[[e,{x:l.x+w.x,y:l.y+w.y},...f,{x:c.x+b.x,y:c.y+b.y},n],g,y,m,T]}function rv(e,t,n,o){const r=Math.min(Ii(e,t)/2,Ii(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 c=e.x<n.x?-1:1,u=e.y<n.y?1:-1;return`L ${i+r*c},${s}Q ${i},${s} ${i},${s+r*u}`}const a=e.x<n.x?1:-1,l=e.y<n.y?-1:1;return`L ${i},${s+r*l}Q ${i},${s} ${i+r*a},${s}`}function lr(e){const{sourceX:t,sourceY:n,sourcePosition:o=ue.Bottom,targetX:r,targetY:i,targetPosition:s=ue.Top,borderRadius:a=5,centerX:l,centerY:c,offset:u=20}=e,[d,h,f,g,y]=ov({source:{x:t,y:n},sourcePosition:o,target:{x:r,y:i},targetPosition:s,center:{x:l,y:c},offset:u});return[d.reduce((b,E,v)=>{let m;return v>0&&v<d.length-1?m=rv(d[v-1],E,d[v+1],a):m=`${v===0?"M":"L"}${E.x} ${E.y}`,b+=m,b},""),h,f,g,y]}function iv(e){const{sourceX:t,sourceY:n,targetX:o,targetY:r}=e,[i,s,a,l]=ha({sourceX:t,sourceY:n,targetX:o,targetY:r});return[`M ${t},${n}L ${o},${r}`,i,s,a,l]}const sv=ve({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]=iv(e);return Ce(Mo,{path:n,labelX:o,labelY:r,...t,...e})}}}),av=sv,lv=ve({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]=lr({...e,sourcePosition:e.sourcePosition??ue.Bottom,targetPosition:e.targetPosition??ue.Top});return Ce(Mo,{path:n,labelX:o,labelY:r,...t,...e})}}}),ma=lv,uv=ve({name:"StepEdge",props:["sourcePosition","targetPosition","label","labelStyle","labelShowBg","labelBgStyle","labelBgPadding","labelBgBorderRadius","sourceY","sourceX","targetX","targetY","markerEnd","markerStart","interactionWidth"],setup(e,{attrs:t}){return()=>Ce(ma,{...e,...t,borderRadius:0})}}),cv=uv,dv=ve({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]=ga({...e,sourcePosition:e.sourcePosition??ue.Bottom,targetPosition:e.targetPosition??ue.Top});return Ce(Mo,{path:n,labelX:o,labelY:r,...t,...e})}}}),fv=dv,hv=ve({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]=va({...e,sourcePosition:e.sourcePosition??ue.Bottom,targetPosition:e.targetPosition??ue.Top});return Ce(Mo,{path:n,labelX:o,labelY:r,...t,...e})}}}),pv=hv,gv={input:Wg,default:jg,output:Yg},vv={default:fv,straight:av,step:cv,smoothstep:ma,simplebezier:pv};function mv(e,t,n){const o=ne(()=>y=>t.value.get(y)),r=ne(()=>y=>n.value.get(y)),i=ne(()=>{const y={...vv,...e.edgeTypes},w=Object.keys(y);for(const b of e.edges)b.type&&!w.includes(b.type)&&(y[b.type]=b.type);return y}),s=ne(()=>{const y={...gv,...e.nodeTypes},w=Object.keys(y);for(const b of e.nodes)b.type&&!w.includes(b.type)&&(y[b.type]=b.type);return y}),a=ne(()=>e.onlyRenderVisibleElements?Js(e.nodes,{x:0,y:0,width:e.dimensions.width,height:e.dimensions.height},e.viewport,!0):e.nodes),l=ne(()=>{if(e.onlyRenderVisibleElements){const y=[];for(const w of e.edges){const b=t.value.get(w.source),E=t.value.get(w.target);hg({sourcePos:b.computedPosition||{x:0,y:0},targetPos:E.computedPosition||{x:0,y:0},sourceWidth:b.dimensions.width,sourceHeight:b.dimensions.height,targetWidth:E.dimensions.width,targetHeight:E.dimensions.height,width:e.dimensions.width,height:e.dimensions.height,viewport:e.viewport})&&y.push(w)}return y}return e.edges}),c=ne(()=>[...a.value,...l.value]),u=ne(()=>{const y=[];for(const w of e.nodes)w.selected&&y.push(w);return y}),d=ne(()=>{const y=[];for(const w of e.edges)w.selected&&y.push(w);return y}),h=ne(()=>[...u.value,...d.value]),f=ne(()=>{const y=[];for(const w of e.nodes)w.dimensions.width&&w.dimensions.height&&w.handleBounds!==void 0&&y.push(w);return y}),g=ne(()=>a.value.length>0&&f.value.length===a.value.length);return{getNode:o,getEdge:r,getElements:c,getEdgeTypes:i,getNodeTypes:s,getEdges:l,getNodes:a,getSelectedElements:h,getSelectedNodes:u,getSelectedEdges:d,getNodesInitialized:f,areNodesInitialized:g}}class $t{constructor(){this.currentId=0,this.flows=new Map}static getInstance(){var t;const n=(t=nn())==null?void 0:t.appContext.app,o=n?.config.globalProperties.$vueFlowStorage??$t.instance;return $t.instance=o??new $t,n&&(n.config.globalProperties.$vueFlowStorage=$t.instance),$t.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=fa(),r=La(o),i={};for(const[h,f]of Object.entries(r.hooks)){const g=`on${h.charAt(0).toUpperCase()+h.slice(1)}`;i[g]=f.on}const s={};for(const[h,f]of Object.entries(r.hooks))s[h]=f.trigger;const a=ne(()=>{const h=new Map;for(const f of r.nodes)h.set(f.id,f);return h}),l=ne(()=>{const h=new Map;for(const f of r.edges)h.set(f.id,f);return h}),c=mv(r,a,l),u=Hg(r,a,l);u.setState({...r,...n});const d={...i,...c,...u,...ad(r),nodeLookup:a,edgeLookup:l,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 Te(e){const t=$t.getInstance(),n=ur(),o=typeof e=="object",r=o?e:{id:e},i=r.id,s=i??n?.vueFlowId;let a;if(n){const l=tn(Mi,null);typeof l<"u"&&l!==null&&(!s||l.id===s)&&(a=l)}if(a||s&&(a=t.get(s)),!a||s&&a.id!==s){const l=i??t.getId(),c=t.create(l,r);a=c,(n??Xi(!0)).run(()=>{_e(c.applyDefault,(d,h,f)=>{const g=w=>{c.applyNodeChanges(w)},y=w=>{c.applyEdgeChanges(w)};d?(c.onNodesChange(g),c.onEdgesChange(y)):(c.hooks.value.nodesChange.off(g),c.hooks.value.edgesChange.off(y)),f(()=>{c.hooks.value.nodesChange.off(g),c.hooks.value.edgesChange.off(y)})},{immediate:!0}),mn(()=>{if(a){const d=t.get(a.id);d?d.$destroy():$n(`No store instance found for id ${a.id} in storage.`)}})})}else o&&a.setState(r);if(n&&(Wt(Mi,a),n.vueFlowId=a.id),o){const l=nn();l?.type.name!=="VueFlow"&&a.emits.error(new ze(Ie.USEVUEFLOW_OPTIONS))}return a}function yv(e){const{emits:t,dimensions:n}=Te();let o;je(()=>{const r=()=>{var i,s;if(!e.value||!(((s=(i=e.value).checkVisibility)==null?void 0:s.call(i))??!0))return;const a=Eo(e.value);(a.width===0||a.height===0)&&t.error(new ze(Ie.MISSING_VIEWPORT_DIMENSIONS)),n.value={width:a.width||500,height:a.height||500}};r(),window.addEventListener("resize",r),e.value&&(o=new ResizeObserver(()=>r()),o.observe(e.value)),Ui(()=>{window.removeEventListener("resize",r),o&&e.value&&o.unobserve(e.value)})})}const wv={name:"UserSelection",compatConfig:{MODE:3}},_v=ve({...wv,props:{userSelectionRect:{}},setup(e){return(t,n)=>(j(),ee("div",{class:"vue-flow__selection vue-flow__container",style:Re({width:`${t.userSelectionRect.width}px`,height:`${t.userSelectionRect.height}px`,transform:`translate(${t.userSelectionRect.x}px, ${t.userSelectionRect.y}px)`})},null,4))}}),xv=["tabIndex"],bv={name:"NodesSelection",compatConfig:{MODE:3}},Ev=ve({...bv,setup(e){const{emits:t,viewport:n,getSelectedNodes:o,noPanClassName:r,disableKeyboardA11y:i,userSelectionActive:s}=Te(),a=da(),l=ce(null),c=la({el:l,onStart(g){t.selectionDragStart(g),t.nodeDragStart(g)},onDrag(g){t.selectionDrag(g),t.nodeDrag(g)},onStop(g){t.selectionDragStop(g),t.nodeDragStop(g)}});je(()=>{var g;i.value||(g=l.value)==null||g.focus({preventScroll:!0})});const u=ne(()=>Ks(o.value)),d=ne(()=>({width:`${u.value.width}px`,height:`${u.value.height}px`,top:`${u.value.y}px`,left:`${u.value.x}px`}));function h(g){t.selectionContextMenu({event:g,nodes:o.value})}function f(g){i.value||Yt[g.key]&&(g.preventDefault(),a({x:Yt[g.key].x,y:Yt[g.key].y},g.shiftKey))}return(g,y)=>!k(s)&&u.value.width&&u.value.height?(j(),ee("div",{key:0,class:Ae(["vue-flow__nodesselection vue-flow__container",k(r)]),style:Re({transform:`translate(${k(n).x}px,${k(n).y}px) scale(${k(n).zoom})`})},[Z("div",{ref_key:"el",ref:l,class:Ae([{dragging:k(c)},"vue-flow__nodesselection-rect"]),style:Re(d.value),tabIndex:k(i)?void 0:-1,onContextmenu:h,onKeydown:f},null,46,xv)],6)):ge("",!0)}});function kv(e,t){return{x:e.clientX-t.left,y:e.clientY-t.top}}const Sv={name:"Pane",compatConfig:{MODE:3}},Cv=ve({...Sv,props:{isSelecting:{type:Boolean},selectionKeyPressed:{type:Boolean}},setup(e){const{vueFlowRef:t,nodes:n,viewport:o,emits:r,userSelectionActive:i,removeSelectedElements:s,userSelectionRect:a,elementsSelectable:l,nodesSelectionActive:c,getSelectedEdges:u,getSelectedNodes:d,removeNodes:h,removeEdges:f,selectionMode:g,deleteKeyCode:y,multiSelectionKeyCode:w,multiSelectionActive:b,edgeLookup:E,nodeLookup:v,connectionLookup:m,defaultEdgeOptions:T,connectionStartHandle:B,panOnDrag:H}=Te(),F=dt(null),K=dt(new Set),I=dt(new Set),A=dt(null),S=$e(()=>l.value&&(e.isSelecting||i.value)),C=$e(()=>B.value!==null);let p=!1,N=!1;const _=gn(y,{actInsideInputWithModifier:!1}),$=gn(w);_e(_,x=>{x&&(h(d.value),f(u.value),c.value=!1)}),_e($,x=>{b.value=x});function P(x,O){return R=>{R.target===O&&x?.(R)}}function G(x){if(p||C.value){p=!1;return}r.paneClick(x),s(),c.value=!1}function L(x){var O;if(Array.isArray(H.value)&&((O=H.value)!=null&&O.includes(2))){x.preventDefault();return}r.paneContextMenu(x)}function q(x){r.paneScroll(x)}function U(x){var O,R,W;if(A.value=((O=t.value)==null?void 0:O.getBoundingClientRect())??null,!l.value||!e.isSelecting||x.button!==0||x.target!==F.value||!A.value)return;(W=(R=x.target)==null?void 0:R.setPointerCapture)==null||W.call(R,x.pointerId);const{x:Q,y:te}=kv(x,A.value);N=!0,p=!1,s(),a.value={width:0,height:0,startX:Q,startY:te,x:Q,y:te},r.selectionStart(x)}function J(x){var O;if(!A.value||!a.value)return;p=!0;const{x:R,y:W}=nt(x,A.value),{startX:Q=0,startY:te=0}=a.value,re={startX:Q,startY:te,x:R<Q?R:Q,y:W<te?W:te,width:Math.abs(R-Q),height:Math.abs(W-te)},ae=K.value,me=I.value;K.value=new Set(Js(n.value,re,o.value,g.value===Nr.Partial,!0).map(M=>M.id)),I.value=new Set;const z=((O=T.value)==null?void 0:O.selectable)??!0;for(const M of K.value){const V=m.value.get(M);if(V)for(const{edgeId:X}of V.values()){const Y=E.value.get(X);Y&&(Y.selectable??z)&&I.value.add(X)}}if(!$i(ae,K.value)){const M=xt(v.value,K.value,!0);r.nodesChange(M)}if(!$i(me,I.value)){const M=xt(E.value,I.value);r.edgesChange(M)}a.value=re,i.value=!0,c.value=!1}function D(x){var O;x.button!==0||!N||((O=x.target)==null||O.releasePointerCapture(x.pointerId),!i.value&&a.value&&x.target===F.value&&G(x),i.value=!1,a.value=null,c.value=K.value.size>0,r.selectionEnd(x),e.selectionKeyPressed&&(p=!1),N=!1)}return(x,O)=>(j(),ee("div",{ref_key:"container",ref:F,class:Ae(["vue-flow__pane vue-flow__container",{selection:x.isSelecting}]),onClick:O[0]||(O[0]=R=>S.value?void 0:P(G,F.value)(R)),onContextmenu:O[1]||(O[1]=R=>P(L,F.value)(R)),onWheelPassive:O[2]||(O[2]=R=>P(q,F.value)(R)),onPointerenter:O[3]||(O[3]=R=>S.value?void 0:k(r).paneMouseEnter(R)),onPointerdown:O[4]||(O[4]=R=>S.value?U(R):k(r).paneMouseMove(R)),onPointermove:O[5]||(O[5]=R=>S.value?J(R):k(r).paneMouseMove(R)),onPointerup:O[6]||(O[6]=R=>S.value?D(R):void 0),onPointerleave:O[7]||(O[7]=R=>k(r).paneMouseLeave(R))},[xe(x.$slots,"default"),k(i)&&k(a)?(j(),we(_v,{key:0,"user-selection-rect":k(a)},null,8,["user-selection-rect"])):ge("",!0),k(c)&&k(d).length?(j(),we(Ev,{key:1})):ge("",!0)],34))}}),Nv={name:"Transform",compatConfig:{MODE:3}},$v=ve({...Nv,setup(e){const{viewport:t,fitViewOnInit:n,fitViewOnInitDone:o}=Te(),r=ne(()=>n.value?!o.value:!1),i=ne(()=>`translate(${t.value.x}px,${t.value.y}px) scale(${t.value.zoom})`);return(s,a)=>(j(),ee("div",{class:"vue-flow__transformationpane vue-flow__container",style:Re({transform:i.value,opacity:r.value?0:void 0})},[xe(s.$slots,"default")],4))}}),Mv={name:"Viewport",compatConfig:{MODE:3}},Tv=ve({...Mv,setup(e){const{minZoom:t,maxZoom:n,defaultViewport:o,translateExtent:r,zoomActivationKeyCode:i,selectionKeyCode:s,panActivationKeyCode:a,panOnScroll:l,panOnScrollMode:c,panOnScrollSpeed:u,panOnDrag:d,zoomOnDoubleClick:h,zoomOnPinch:f,zoomOnScroll:g,preventScrolling:y,noWheelClassName:w,noPanClassName:b,emits:E,connectionStartHandle:v,userSelectionActive:m,paneDragging:T,d3Zoom:B,d3Selection:H,d3ZoomHandler:F,viewport:K,viewportRef:I,paneClickDistance:A}=Te();yv(I);const S=dt(!1),C=dt(!1);let p=null,N=!1,_=0,$={x:0,y:0,zoom:0};const P=gn(a),G=gn(s),L=gn(i),q=$e(()=>(!G.value||G.value&&s.value===!0)&&(P.value||d.value)),U=$e(()=>P.value||l.value),J=$e(()=>s.value===!0&&q.value!==!0),D=$e(()=>G.value&&s.value!==!0||m.value||J.value),x=$e(()=>v.value!==null);je(()=>{if(!I.value){$n("Viewport element is missing");return}const te=I.value,re=te.getBoundingClientRect(),ae=Yp().clickDistance(A.value).scaleExtent([t.value,n.value]).translateExtent(r.value),me=Ye(te).call(ae),z=me.on("wheel.zoom"),M=Jt.translate(o.value.x??0,o.value.y??0).scale(At(o.value.zoom??1,t.value,n.value)),V=[[0,0],[re.width,re.height]],X=ae.constrain()(M,V,r.value);ae.transform(me,X),ae.wheelDelta(pi),B.value=ae,H.value=me,F.value=z,K.value={x:X.x,y:X.y,zoom:X.k},ae.on("start",Y=>{var se;if(!Y.sourceEvent)return null;_=Y.sourceEvent.button,S.value=!0;const le=W(Y.transform);((se=Y.sourceEvent)==null?void 0:se.type)==="mousedown"&&(T.value=!0),$=le,E.viewportChangeStart(le),E.moveStart({event:Y,flowTransform:le})}),ae.on("end",Y=>{if(!Y.sourceEvent)return null;if(S.value=!1,T.value=!1,O(q.value,_??0)&&!N&&E.paneContextMenu(Y.sourceEvent),N=!1,R($,Y.transform)){const se=W(Y.transform);$=se,E.viewportChangeEnd(se),E.moveEnd({event:Y,flowTransform:se})}}),ae.filter(Y=>{var se;const le=L.value||g.value,pe=f.value&&Y.ctrlKey,de=Y.button,ye=Y.type==="wheel";if(de===1&&Y.type==="mousedown"&&(Q(Y,"vue-flow__node")||Q(Y,"vue-flow__edge")))return!0;if(!q.value&&!le&&!U.value&&!h.value&&!f.value||m.value||x.value&&!ye||!h.value&&Y.type==="dblclick"||Q(Y,w.value)&&ye||Q(Y,b.value)&&(!ye||U.value&&ye&&!L.value)||!f.value&&Y.ctrlKey&&ye||!le&&!U.value&&!pe&&ye)return!1;if(!f&&Y.type==="touchstart"&&((se=Y.touches)==null?void 0:se.length)>1)return Y.preventDefault(),!1;if(!q.value&&(Y.type==="mousedown"||Y.type==="touchstart")||J.value&&Array.isArray(d.value)&&d.value.includes(0)&&de===0||Array.isArray(d.value)&&!d.value.includes(de)&&(Y.type==="mousedown"||Y.type==="touchstart"))return!1;const be=Array.isArray(d.value)&&d.value.includes(de)||s.value===!0&&Array.isArray(d.value)&&!d.value.includes(0)||!de||de<=1;return(!Y.ctrlKey||P.value||ye)&&be}),_e([m,q],()=>{m.value&&!S.value?ae.on("zoom",null):m.value||ae.on("zoom",Y=>{K.value={x:Y.transform.x,y:Y.transform.y,zoom:Y.transform.k};const se=W(Y.transform);N=O(q.value,_??0),E.viewportChange(se),E.move({event:Y,flowTransform:se})})},{immediate:!0}),_e([m,U,c,L,f,y,w],()=>{U.value&&!L.value&&!m.value?me.on("wheel.zoom",Y=>{if(Q(Y,w.value))return!1;const se=L.value||g.value,le=f.value&&Y.ctrlKey;if(!(!y.value||U.value||se||le))return!1;Y.preventDefault(),Y.stopImmediatePropagation();const de=me.property("__zoom").k||1,ye=lo();if(!P.value&&Y.ctrlKey&&f.value&&ye){const xa=et(Y),ba=pi(Y),Ea=de*2**ba;ae.scaleTo(me,Ea,xa,Y);return}const be=Y.deltaMode===1?20:1;let ke=c.value===pn.Vertical?0:Y.deltaX*be,yt=c.value===pn.Horizontal?0:Y.deltaY*be;!ye&&Y.shiftKey&&c.value!==pn.Vertical&&!ke&&yt&&(ke=yt,yt=0),ae.translateBy(me,-(ke/de)*u.value,-(yt/de)*u.value);const Qe=W(me.property("__zoom"));p&&clearTimeout(p),C.value?(E.move({event:Y,flowTransform:Qe}),E.viewportChange(Qe),p=setTimeout(()=>{E.moveEnd({event:Y,flowTransform:Qe}),E.viewportChangeEnd(Qe),C.value=!1},150)):(C.value=!0,E.moveStart({event:Y,flowTransform:Qe}),E.viewportChangeStart(Qe))},{passive:!1}):typeof z<"u"&&me.on("wheel.zoom",function(Y,se){const le=!y.value&&Y.type==="wheel"&&!Y.ctrlKey,pe=L.value||g.value,de=f.value&&Y.ctrlKey;if(!pe&&!l.value&&!de&&Y.type==="wheel"||le||Q(Y,w.value))return null;Y.preventDefault(),z.call(this,Y,se)},{passive:!1})},{immediate:!0})});function O(te,re){return re===2&&Array.isArray(te)&&te.includes(2)}function R(te,re){return te.x!==re.x&&!Number.isNaN(re.x)||te.y!==re.y&&!Number.isNaN(re.y)||te.zoom!==re.k&&!Number.isNaN(re.k)}function W(te){return{x:te.x,y:te.y,zoom:te.k}}function Q(te,re){return te.target.closest(`.${re}`)}return(te,re)=>(j(),ee("div",{ref_key:"viewportRef",ref:I,class:"vue-flow__viewport vue-flow__container"},[oe(Cv,{"is-selecting":D.value,"selection-key-pressed":k(G),class:Ae({connecting:x.value,dragging:k(T),draggable:k(d)===!0||Array.isArray(k(d))&&k(d).includes(0)})},{default:fe(()=>[oe($v,null,{default:fe(()=>[xe(te.$slots,"default")]),_:3})]),_:3},8,["is-selecting","selection-key-pressed","class"])],512))}}),Ov=["id"],Pv=["id"],Iv=["id"],Dv={name:"A11yDescriptions",compatConfig:{MODE:3}},Av=ve({...Dv,setup(e){const{id:t,disableKeyboardA11y:n,ariaLiveMessage:o}=Te();return(r,i)=>(j(),ee(Me,null,[Z("div",{id:`${k(Gs)}-${k(t)}`,style:{display:"none"}}," Press enter or space to select a node. "+he(k(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,Ov),Z("div",{id:`${k(qs)}-${k(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,Pv),k(n)?ge("",!0):(j(),ee("div",{key:0,id:`${k(Jp)}-${k(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%)"}},he(k(o)),9,Iv))],64))}});function zv(){const e=Te();_e(()=>e.viewportHelper.value.viewportInitialized,t=>{t&&setTimeout(()=>{e.emits.init(e),e.emits.paneReady(e)},1)})}function Bv(e,t,n){return n===ue.Left?e-t:n===ue.Right?e+t:e}function Rv(e,t,n){return n===ue.Top?e-t:n===ue.Bottom?e+t:e}const Tr=function({radius:e=10,centerX:t=0,centerY:n=0,position:o=ue.Top,type:r}){return Ce("circle",{class:`vue-flow__edgeupdater vue-flow__edgeupdater-${r}`,cx:Bv(t,e,o),cy:Rv(n,e,o),r:e,stroke:"transparent",fill:"transparent"})};Tr.props=["radius","centerX","centerY","position","type"];Tr.compatConfig={MODE:3};const Di=Tr,Lv=ve({name:"Edge",compatConfig:{MODE:3},props:["id"],setup(e){const{id:t,addSelectedEdges:n,connectionMode:o,edgeUpdaterRadius:r,emits:i,nodesSelectionActive:s,noPanClassName:a,getEdgeTypes:l,removeSelectedEdges:c,findEdge:u,findNode:d,isValidConnection:h,multiSelectionActive:f,disableKeyboardA11y:g,elementsSelectable:y,edgesUpdatable:w,edgesFocusable:b,hooks:E}=Te(),v=ne(()=>u(e.id)),{emit:m,on:T}=Mg(v.value,i),B=tn(So),H=nn(),F=ce(!1),K=ce(!1),I=ce(""),A=ce(null),S=ce("source"),C=ce(null),p=$e(()=>typeof v.value.selectable>"u"?y.value:v.value.selectable),N=$e(()=>typeof v.value.updatable>"u"?w.value:v.value.updatable),_=$e(()=>typeof v.value.focusable>"u"?b.value:v.value.focusable);Wt(Cg,e.id),Wt(Ng,C);const $=ne(()=>v.value.class instanceof Function?v.value.class(v.value):v.value.class),P=ne(()=>v.value.style instanceof Function?v.value.style(v.value):v.value.style),G=ne(()=>{const M=v.value.type||"default",V=B?.[`edge-${M}`];if(V)return V;let X=v.value.template??l.value[M];if(typeof X=="string"&&H){const Y=Object.keys(H.appContext.components);Y&&Y.includes(M)&&(X=Zi(M,!1))}return X&&typeof X!="string"?X:(i.error(new ze(Ie.EDGE_TYPE_MISSING,X)),!1)}),{handlePointerDown:L}=ua({nodeId:I,handleId:A,type:S,isValidConnection:h,edgeUpdaterType:S,onEdgeUpdate:J,onEdgeUpdateEnd:D});return()=>{const M=d(v.value.source),V=d(v.value.target),X="pathOptions"in v.value?v.value.pathOptions:{};if(!M&&!V)return i.error(new ze(Ie.EDGE_SOURCE_TARGET_MISSING,v.value.id,v.value.source,v.value.target)),null;if(!M)return i.error(new ze(Ie.EDGE_SOURCE_MISSING,v.value.id,v.value.source)),null;if(!V)return i.error(new ze(Ie.EDGE_TARGET_MISSING,v.value.id,v.value.target)),null;if(!v.value||v.value.hidden||M.hidden||V.hidden)return null;let Y;o.value===St.Strict?Y=M.handleBounds.source:Y=[...M.handleBounds.source||[],...M.handleBounds.target||[]];const se=bi(Y,v.value.sourceHandle);let le;o.value===St.Strict?le=V.handleBounds.target:le=[...V.handleBounds.target||[],...V.handleBounds.source||[]];const pe=bi(le,v.value.targetHandle),de=se?.position||ue.Bottom,ye=pe?.position||ue.Top,{x:be,y:ke}=Qt(M,se,de),{x:yt,y:Qe}=Qt(V,pe,ye);return v.value.sourceX=be,v.value.sourceY=ke,v.value.targetX=yt,v.value.targetY=Qe,Ce("g",{ref:C,key:e.id,"data-id":e.id,class:["vue-flow__edge",`vue-flow__edge-${G.value===!1?"default":v.value.type||"default"}`,a.value,$.value,{updating:F.value,selected:v.value.selected,animated:v.value.animated,inactive:!p.value&&!E.value.edgeClick.hasListeners()}],tabIndex:_.value?0:void 0,"aria-label":v.value.ariaLabel===null?void 0:v.value.ariaLabel??`Edge from ${v.value.source} to ${v.value.target}`,"aria-describedby":_.value?`${qs}-${t}`:void 0,"aria-roledescription":"edge",role:_.value?"group":"img",...v.value.domAttributes,onClick:O,onContextmenu:R,onDblclick:W,onMouseenter:Q,onMousemove:te,onMouseleave:re,onKeyDown:_.value?z:void 0},[K.value?null:Ce(G.value===!1?l.value.default:G.value,{id:e.id,sourceNode:M,targetNode:V,source:v.value.source,target:v.value.target,type:v.value.type,updatable:N.value,selected:v.value.selected,animated:v.value.animated,label:v.value.label,labelStyle:v.value.labelStyle,labelShowBg:v.value.labelShowBg,labelBgStyle:v.value.labelBgStyle,labelBgPadding:v.value.labelBgPadding,labelBgBorderRadius:v.value.labelBgBorderRadius,data:v.value.data,events:{...v.value.events,...T},style:P.value,markerStart:`url('#${kn(v.value.markerStart,t)}')`,markerEnd:`url('#${kn(v.value.markerEnd,t)}')`,sourcePosition:de,targetPosition:ye,sourceX:be,sourceY:ke,targetX:yt,targetY:Qe,sourceHandleId:v.value.sourceHandle,targetHandleId:v.value.targetHandle,interactionWidth:v.value.interactionWidth,...X}),[N.value==="source"||N.value===!0?[Ce("g",{onMousedown:ae,onMouseenter:q,onMouseout:U},Ce(Di,{position:de,centerX:be,centerY:ke,radius:r.value,type:"source","data-type":"source"}))]:null,N.value==="target"||N.value===!0?[Ce("g",{onMousedown:me,onMouseenter:q,onMouseout:U},Ce(Di,{position:ye,centerX:yt,centerY:Qe,radius:r.value,type:"target","data-type":"target"}))]:null]])};function q(){F.value=!0}function U(){F.value=!1}function J(M,V){m.update({event:M,edge:v.value,connection:V})}function D(M){m.updateEnd({event:M,edge:v.value}),K.value=!1}function x(M,V){M.button===0&&(K.value=!0,I.value=V?v.value.target:v.value.source,A.value=(V?v.value.targetHandle:v.value.sourceHandle)??null,S.value=V?"target":"source",m.updateStart({event:M,edge:v.value}),L(M))}function O(M){var V;const X={event:M,edge:v.value};p.value&&(s.value=!1,v.value.selected&&f.value?(c([v.value]),(V=C.value)==null||V.blur()):n([v.value])),m.click(X)}function R(M){m.contextMenu({event:M,edge:v.value})}function W(M){m.doubleClick({event:M,edge:v.value})}function Q(M){m.mouseEnter({event:M,edge:v.value})}function te(M){m.mouseMove({event:M,edge:v.value})}function re(M){m.mouseLeave({event:M,edge:v.value})}function ae(M){x(M,!0)}function me(M){x(M,!1)}function z(M){var V;!g.value&&js.includes(M.key)&&p.value&&(M.key==="Escape"?((V=C.value)==null||V.blur(),c([u(e.id)])):n([u(e.id)]))}}}),Vv=Lv,Fv=ve({name:"ConnectionLine",compatConfig:{MODE:3},setup(){var e;const{id:t,connectionMode:n,connectionStartHandle:o,connectionEndHandle:r,connectionPosition:i,connectionLineType:s,connectionLineStyle:a,connectionLineOptions:l,connectionStatus:c,viewport:u,findNode:d}=Te(),h=(e=tn(So))==null?void 0:e["connection-line"],f=ne(()=>{var E;return d((E=o.value)==null?void 0:E.nodeId)}),g=ne(()=>{var E;return d((E=r.value)==null?void 0:E.nodeId)??null}),y=ne(()=>({x:(i.value.x-u.value.x)/u.value.zoom,y:(i.value.y-u.value.y)/u.value.zoom})),w=ne(()=>l.value.markerStart?`url(#${kn(l.value.markerStart,t)})`:""),b=ne(()=>l.value.markerEnd?`url(#${kn(l.value.markerEnd,t)})`:"");return()=>{var E,v,m;if(!f.value||!o.value)return null;const T=o.value.id,B=o.value.type,H=f.value.handleBounds;let F=H?.[B]??[];if(n.value===St.Loose){const P=H?.[B==="source"?"target":"source"]??[];F=[...F,...P]}if(!F)return null;const K=(T?F.find(P=>P.id===T):F[0])??null,I=K?.position??ue.Top,{x:A,y:S}=Qt(f.value,K,I);let C=null;g.value&&(n.value===St.Strict?C=((E=g.value.handleBounds[B==="source"?"target":"source"])==null?void 0:E.find(P=>{var G;return P.id===((G=r.value)==null?void 0:G.id)}))||null:C=((v=[...g.value.handleBounds.source??[],...g.value.handleBounds.target??[]])==null?void 0:v.find(P=>{var G;return P.id===((G=r.value)==null?void 0:G.id)}))||null);const p=((m=r.value)==null?void 0:m.position)??(I?sr[I]:null);if(!I||!p)return null;const N=s.value??l.value.type??Nt.Bezier;let _="";const $={sourceX:A,sourceY:S,sourcePosition:I,targetX:y.value.x,targetY:y.value.y,targetPosition:p};return N===Nt.Bezier?[_]=ga($):N===Nt.Step?[_]=lr({...$,borderRadius:0}):N===Nt.SmoothStep?[_]=lr($):N===Nt.SimpleBezier?[_]=va($):_=`M${A},${S} ${y.value.x},${y.value.y}`,Ce("svg",{class:"vue-flow__edges vue-flow__connectionline vue-flow__container"},Ce("g",{class:"vue-flow__connection"},h?Ce(h,{sourceX:A,sourceY:S,sourcePosition:I,targetX:y.value.x,targetY:y.value.y,targetPosition:p,sourceNode:f.value,sourceHandle:K,targetNode:g.value,targetHandle:C,markerEnd:b.value,markerStart:w.value,connectionStatus:c.value}):Ce("path",{d:_,class:[l.value.class,c.value,"vue-flow__connection-path"],style:{...a.value,...l.value.style},"marker-end":b.value,"marker-start":w.value})))}}}),Hv=Fv,Gv=["id","markerWidth","markerHeight","markerUnits","orient"],qv={name:"MarkerType",compatConfig:{MODE:3}},jv=ve({...qv,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)=>(j(),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===k(io).ArrowClosed?(j(),ee("polyline",{key:0,style:Re({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)):ge("",!0),t.type===k(io).Arrow?(j(),ee("polyline",{key:1,style:Re({stroke:t.color,strokeWidth:t.strokeWidth}),"stroke-linecap":"round","stroke-linejoin":"round",fill:"none",points:"-5,-4 0,0 -5,4"},null,4)):ge("",!0)],8,Gv))}}),Yv={class:"vue-flow__marker vue-flow__container","aria-hidden":"true"},Wv={name:"MarkerDefinitions",compatConfig:{MODE:3}},Xv=ve({...Wv,setup(e){const{id:t,edges:n,connectionLineOptions:o,defaultMarkerColor:r}=Te(),i=ne(()=>{const s=new Set,a=[],l=c=>{if(c){const u=kn(c,t);s.has(u)||(typeof c=="object"?a.push({...c,id:u,color:c.color||r.value}):a.push({id:u,color:r.value,type:c}),s.add(u))}};for(const c of[o.value.markerEnd,o.value.markerStart])l(c);for(const c of n.value)for(const u of[c.markerStart,c.markerEnd])l(u);return a.sort((c,u)=>c.id.localeCompare(u.id))});return(s,a)=>(j(),ee("svg",Yv,[Z("defs",null,[(j(!0),ee(Me,null,qe(i.value,l=>(j(),we(jv,{id:l.id,key:l.id,type:l.type,color:l.color,width:l.width,height:l.height,markerUnits:l.markerUnits,"stroke-width":l.strokeWidth,orient:l.orient},null,8,["id","type","color","width","height","markerUnits","stroke-width","orient"]))),128))])]))}}),Uv={name:"Edges",compatConfig:{MODE:3}},Zv=ve({...Uv,setup(e){const{findNode:t,getEdges:n,elevateEdgesOnSelect:o}=Te();return(r,i)=>(j(),ee(Me,null,[oe(Xv),(j(!0),ee(Me,null,qe(k(n),s=>(j(),ee("svg",{key:s.id,class:"vue-flow__edges vue-flow__container",style:Re({zIndex:k(pg)(s,k(t),k(o))})},[oe(k(Vv),{id:s.id},null,8,["id"])],4))),128)),oe(k(Hv))],64))}}),Kv=ve({name:"Node",compatConfig:{MODE:3},props:["id","resizeObserver"],setup(e){const{id:t,noPanClassName:n,selectNodesOnDrag:o,nodesSelectionActive:r,multiSelectionActive:i,emits:s,removeSelectedNodes:a,addSelectedNodes:l,updateNodeDimensions:c,onUpdateNodeInternals:u,getNodeTypes:d,nodeExtent:h,elevateNodesOnSelect:f,disableKeyboardA11y:g,ariaLiveMessage:y,snapToGrid:w,snapGrid:b,nodeDragThreshold:E,nodesDraggable:v,elementsSelectable:m,nodesConnectable:T,nodesFocusable:B,hooks:H}=Te(),F=ce(null);Wt(aa,F),Wt(sa,e.id);const K=tn(So),I=nn(),A=da(),{node:S,parentNode:C}=ca(e.id),{emit:p,on:N}=Ig(S,s),_=$e(()=>typeof S.draggable>"u"?v.value:S.draggable),$=$e(()=>typeof S.selectable>"u"?m.value:S.selectable),P=$e(()=>typeof S.connectable>"u"?T.value:S.connectable),G=$e(()=>typeof S.focusable>"u"?B.value:S.focusable),L=ne(()=>$.value||_.value||H.value.nodeClick.hasListeners()||H.value.nodeDoubleClick.hasListeners()||H.value.nodeMouseEnter.hasListeners()||H.value.nodeMouseMove.hasListeners()||H.value.nodeMouseLeave.hasListeners()),q=$e(()=>!!S.dimensions.width&&!!S.dimensions.height),U=ne(()=>{const V=S.type||"default",X=K?.[`node-${V}`];if(X)return X;let Y=S.template||d.value[V];if(typeof Y=="string"&&I){const se=Object.keys(I.appContext.components);se&&se.includes(V)&&(Y=Zi(V,!1))}return Y&&typeof Y!="string"?Y:(s.error(new ze(Ie.NODE_TYPE_MISSING,Y)),!1)}),J=la({id:e.id,el:F,disabled:()=>!_.value,selectable:$,dragHandle:()=>S.dragHandle,onStart(V){p.dragStart(V)},onDrag(V){p.drag(V)},onStop(V){p.dragStop(V)},onClick(V){z(V)}}),D=ne(()=>S.class instanceof Function?S.class(S):S.class),x=ne(()=>{const V=(S.style instanceof Function?S.style(S):S.style)||{},X=S.width instanceof Function?S.width(S):S.width,Y=S.height instanceof Function?S.height(S):S.height;return!V.width&&X&&(V.width=typeof X=="string"?X:`${X}px`),!V.height&&Y&&(V.height=typeof Y=="string"?Y:`${Y}px`),V}),O=$e(()=>Number(S.zIndex??x.value.zIndex??0));return u(V=>{(V.includes(e.id)||!V.length)&&W()}),je(()=>{_e(()=>S.hidden,(V=!1,X,Y)=>{!V&&F.value&&(e.resizeObserver.observe(F.value),Y(()=>{F.value&&e.resizeObserver.unobserve(F.value)}))},{immediate:!0,flush:"post"})}),_e([()=>S.type,()=>S.sourcePosition,()=>S.targetPosition],()=>{pt(()=>{c([{id:e.id,nodeElement:F.value,forceUpdate:!0}])})}),_e([()=>S.position.x,()=>S.position.y,()=>{var V;return(V=C.value)==null?void 0:V.computedPosition.x},()=>{var V;return(V=C.value)==null?void 0:V.computedPosition.y},()=>{var V;return(V=C.value)==null?void 0:V.computedPosition.z},O,()=>S.selected,()=>S.dimensions.height,()=>S.dimensions.width,()=>{var V;return(V=C.value)==null?void 0:V.dimensions.height},()=>{var V;return(V=C.value)==null?void 0:V.dimensions.width}],([V,X,Y,se,le,pe])=>{const de={x:V,y:X,z:pe+(f.value&&S.selected?1e3:0)};typeof Y<"u"&&typeof se<"u"?S.computedPosition=lg({x:Y,y:se,z:le},de):S.computedPosition=de},{flush:"post",immediate:!0}),_e([()=>S.extent,h],([V,X],[Y,se])=>{(V!==Y||X!==se)&&R()}),S.extent==="parent"||typeof S.extent=="object"&&"range"in S.extent&&S.extent.range==="parent"?Zo(()=>q).toBe(!0).then(R):R(),()=>S.hidden?null:Ce("div",{ref:F,"data-id":S.id,class:["vue-flow__node",`vue-flow__node-${U.value===!1?"default":S.type||"default"}`,{[n.value]:_.value,dragging:J?.value,draggable:_.value,selected:S.selected,selectable:$.value,parent:S.isParent},D.value],style:{visibility:q.value?"visible":"hidden",zIndex:S.computedPosition.z??O.value,transform:`translate(${S.computedPosition.x}px,${S.computedPosition.y}px)`,pointerEvents:L.value?"all":"none",...x.value},tabIndex:G.value?0:void 0,role:G.value?"group":void 0,"aria-describedby":g.value?void 0:`${Gs}-${t}`,"aria-label":S.ariaLabel,"aria-roledescription":"node",...S.domAttributes,onMouseenter:Q,onMousemove:te,onMouseleave:re,onContextmenu:ae,onClick:z,onDblclick:me,onKeydown:M},[Ce(U.value===!1?d.value.default:U.value,{id:S.id,type:S.type,data:S.data,events:{...S.events,...N},selected:S.selected,resizing:S.resizing,dragging:J.value,connectable:P.value,position:S.computedPosition,dimensions:S.dimensions,isValidTargetPos:S.isValidTargetPos,isValidSourcePos:S.isValidSourcePos,parent:S.parentNode,parentNodeId:S.parentNode,zIndex:S.computedPosition.z??O.value,targetPosition:S.targetPosition,sourcePosition:S.sourcePosition,label:S.label,dragHandle:S.dragHandle,onUpdateNodeInternals:W})]);function R(){const V=S.computedPosition,{computedPosition:X,position:Y}=$r(S,w.value?ko(V,b.value):V,s.error,h.value,C.value);(S.computedPosition.x!==X.x||S.computedPosition.y!==X.y)&&(S.computedPosition={...S.computedPosition,...X}),(S.position.x!==Y.x||S.position.y!==Y.y)&&(S.position=Y)}function W(){F.value&&c([{id:e.id,nodeElement:F.value,forceUpdate:!0}])}function Q(V){J?.value||p.mouseEnter({event:V,node:S})}function te(V){J?.value||p.mouseMove({event:V,node:S})}function re(V){J?.value||p.mouseLeave({event:V,node:S})}function ae(V){return p.contextMenu({event:V,node:S})}function me(V){return p.doubleClick({event:V,node:S})}function z(V){$.value&&(!o.value||!_.value||E.value>0)&&ar(S,i.value,l,a,r,!1,F.value),p.click({event:V,node:S})}function M(V){if(!(ir(V)||g.value))if(js.includes(V.key)&&$.value){const X=V.key==="Escape";ar(S,i.value,l,a,r,X,F.value)}else _.value&&S.selected&&Yt[V.key]&&(V.preventDefault(),y.value=`Moved selected node ${V.key.replace("Arrow","").toLowerCase()}. New position, x: ${~~S.position.x}, y: ${~~S.position.y}`,A({x:Yt[V.key].x,y:Yt[V.key].y},V.shiftKey))}}}),Jv=Kv;function Qv(e={includeHiddenNodes:!1}){const{nodes:t}=Te();return ne(()=>{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 em={class:"vue-flow__nodes vue-flow__container"},tm={name:"Nodes",compatConfig:{MODE:3}},nm=ve({...tm,setup(e){const{getNodes:t,updateNodeDimensions:n,emits:o}=Te(),r=Qv(),i=ce();return _e(r,s=>{s&&pt(()=>{o.nodesInitialized(t.value)})},{immediate:!0}),je(()=>{i.value=new ResizeObserver(s=>{const a=s.map(l=>({id:l.target.getAttribute("data-id"),nodeElement:l.target,forceUpdate:!0}));pt(()=>n(a))})}),Ui(()=>{var s;return(s=i.value)==null?void 0:s.disconnect()}),(s,a)=>(j(),ee("div",em,[i.value?(j(!0),ee(Me,{key:0},qe(k(t),(l,c,u,d)=>{const h=[l.id];if(d&&d.key===l.id&&Ra(d,h))return d;const f=(j(),we(k(Jv),{id:l.id,key:l.id,"resize-observer":i.value},null,8,["id","resize-observer"]));return f.memo=h,f},a,0),128)):ge("",!0)]))}});function om(){const{emits:e}=Te();je(()=>{if(ia()){const t=document.querySelector(".vue-flow__pane");t&&window.getComputedStyle(t).zIndex!=="1"&&e.error(new ze(Ie.MISSING_STYLES))}})}const rm=Z("div",{class:"vue-flow__edge-labels"},null,-1),im={name:"VueFlow",compatConfig:{MODE:3}},sm=ve({...im,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=za(),i=Oo(o,"modelValue",n),s=Oo(o,"nodes",n),a=Oo(o,"edges",n),l=Te(o),c=Bg({modelValue:i,nodes:s,edges:a},o,l);return Lg(n,l.hooks),zv(),om(),Wt(So,r),Wi(c),t(l),(u,d)=>(j(),ee("div",{ref:k(l).vueFlowRef,class:"vue-flow"},[oe(Tv,null,{default:fe(()=>[oe(Zv),rm,oe(nm),xe(u.$slots,"zoom-pane")]),_:3}),xe(u.$slots,"default"),oe(Av)],512))}}),am={name:"Panel",compatConfig:{MODE:3}},lm=ve({...am,props:{position:{}},setup(e){const t=e,{userSelectionActive:n}=Te(),o=ne(()=>`${t.position}`.split("-"));return(r,i)=>(j(),ee("div",{class:Ae(["vue-flow__panel",o.value]),style:Re({pointerEvents:k(n)?"none":"all"})},[xe(r.$slots,"default")],6))}});var ht=(e=>(e.Lines="lines",e.Dots="dots",e))(ht||{});const ya=function({dimensions:e,size:t,color:n}){return Ce("path",{stroke:n,"stroke-width":t,d:`M${e[0]/2} 0 V${e[1]} M0 ${e[1]/2} H${e[0]}`})},wa=function({radius:e,color:t}){return Ce("circle",{cx:e,cy:e,r:e,fill:t})};ht.Lines+"",ht.Dots+"";const um={[ht.Dots]:"#81818a",[ht.Lines]:"#eee"},cm=["id","x","y","width","height","patternTransform"],dm={key:2,height:"100",width:"100"},fm=["fill"],hm=["x","y","fill"],pm={name:"Background",compatConfig:{MODE:3}},gm=ve({...pm,props:{id:{},variant:{default:()=>ht.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}=Te(),o=ne(()=>{const s=n.value.zoom,[a,l]=Array.isArray(e.gap)?e.gap:[e.gap,e.gap],c=[a*s||1,l*s||1],u=e.size*s,[d,h]=Array.isArray(e.offset)?e.offset:[e.offset,e.offset],f=[d*s||1+c[0]/2,h*s||1+c[1]/2];return{scaledGap:c,offset:f,size:u}}),r=$e(()=>`pattern-${t}${e.id?`-${e.id}`:""}`),i=$e(()=>e.color||e.patternColor||um[e.variant||ht.Dots]);return(s,a)=>(j(),ee("svg",{class:"vue-flow__background vue-flow__container",style:Re({height:`${s.height>100?100:s.height}%`,width:`${s.width>100?100:s.width}%`})},[xe(s.$slots,"pattern-container",{id:r.value},()=>[Z("pattern",{id:r.value,x:k(n).x%o.value.scaledGap[0],y:k(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"},[xe(s.$slots,"pattern",{},()=>[s.variant===k(ht).Lines?(j(),we(k(ya),{key:0,size:s.lineWidth,color:i.value,dimensions:o.value.scaledGap},null,8,["size","color","dimensions"])):s.variant===k(ht).Dots?(j(),we(k(wa),{key:1,color:i.value,radius:o.value.size/2},null,8,["color","radius"])):ge("",!0),s.bgColor?(j(),ee("svg",dm,[Z("rect",{width:"100%",height:"100%",fill:s.bgColor},null,8,fm)])):ge("",!0)])],8,cm)]),Z("rect",{x:s.x,y:s.y,width:"100%",height:"100%",fill:`url(#${r.value})`},null,8,hm),xe(s.$slots,"default",{id:r.value})],4))}}),vm={name:"ControlButton",compatConfig:{MODE:3}},mm=(e,t)=>{const n=e.__vccOpts||e;for(const[o,r]of t)n[o]=r;return n},ym={type:"button",class:"vue-flow__controls-button"};function wm(e,t,n,o,r,i){return j(),ee("button",ym,[xe(e.$slots,"default")])}const Ln=mm(vm,[["render",wm]]),_m={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32"},xm=Z("path",{d:"M32 18.133H18.133V32h-4.266V18.133H0v-4.266h13.867V0h4.266v13.867H32z"},null,-1),bm=[xm];function Em(e,t){return j(),ee("svg",_m,bm)}const km={render:Em},Sm={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 5"},Cm=Z("path",{d:"M0 0h32v4.2H0z"},null,-1),Nm=[Cm];function $m(e,t){return j(),ee("svg",Sm,Nm)}const Mm={render:$m},Tm={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 30"},Om=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),Pm=[Om];function Im(e,t){return j(),ee("svg",Tm,Pm)}const Dm={render:Im},Am={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32"},zm=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),Bm=[zm];function Rm(e,t){return j(),ee("svg",Am,Bm)}const Lm={render:Rm},Vm={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32"},Fm=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),Hm=[Fm];function Gm(e,t){return j(),ee("svg",Vm,Hm)}const qm={render:Gm},jm={name:"Controls",compatConfig:{MODE:3}},Ym=ve({...jm,props:{showZoom:{type:Boolean,default:!0},showFitView:{type:Boolean,default:!0},showInteractive:{type:Boolean,default:!0},fitViewParams:{},position:{default:()=>Hs.BottomLeft}},emits:["zoomIn","zoomOut","fitView","interactionChange"],setup(e,{emit:t}){const{nodesDraggable:n,nodesConnectable:o,elementsSelectable:r,setInteractive:i,zoomIn:s,zoomOut:a,fitView:l,viewport:c,minZoom:u,maxZoom:d}=Te(),h=$e(()=>n.value||o.value||r.value),f=$e(()=>c.value.zoom<=u.value),g=$e(()=>c.value.zoom>=d.value);function y(){s(),t("zoomIn")}function w(){a(),t("zoomOut")}function b(){l(e.fitViewParams),t("fitView")}function E(){i(!h.value),t("interactionChange",!h.value)}return(v,m)=>(j(),we(k(lm),{class:"vue-flow__controls",position:v.position},{default:fe(()=>[xe(v.$slots,"top"),v.showZoom?(j(),ee(Me,{key:0},[xe(v.$slots,"control-zoom-in",{},()=>[oe(Ln,{class:"vue-flow__controls-zoomin",disabled:g.value,onClick:y},{default:fe(()=>[xe(v.$slots,"icon-zoom-in",{},()=>[(j(),we(Ge(k(km))))])]),_:3},8,["disabled"])]),xe(v.$slots,"control-zoom-out",{},()=>[oe(Ln,{class:"vue-flow__controls-zoomout",disabled:f.value,onClick:w},{default:fe(()=>[xe(v.$slots,"icon-zoom-out",{},()=>[(j(),we(Ge(k(Mm))))])]),_:3},8,["disabled"])])],64)):ge("",!0),v.showFitView?xe(v.$slots,"control-fit-view",{key:1},()=>[oe(Ln,{class:"vue-flow__controls-fitview",onClick:b},{default:fe(()=>[xe(v.$slots,"icon-fit-view",{},()=>[(j(),we(Ge(k(Dm))))])]),_:3})]):ge("",!0),v.showInteractive?xe(v.$slots,"control-interactive",{key:2},()=>[v.showInteractive?(j(),we(Ln,{key:0,class:"vue-flow__controls-interactive",onClick:E},{default:fe(()=>[h.value?xe(v.$slots,"icon-unlock",{key:0},()=>[(j(),we(Ge(k(qm))))]):ge("",!0),h.value?ge("",!0):xe(v.$slots,"icon-lock",{key:1},()=>[(j(),we(Ge(k(Lm))))])]),_:3})):ge("",!0)]):ge("",!0),xe(v.$slots,"default")]),_:3},8,["position"]))}}),Wm={key:0,class:"space-y-2"},Xm={class:"flex items-center justify-between gap-2 text-[11px] text-muted-foreground"},Um={class:"shrink-0 font-mono"},Zm=["title"],Km={class:"line-clamp-2 text-sm font-medium leading-snug"},Jm={class:"flex items-center justify-between gap-2 text-[11px] text-muted-foreground"},Qm={class:"flex items-center gap-1.5 text-[10px] uppercase tracking-wide"},ey={class:"rounded bg-background/60 px-1.5 py-0.5"},ty={class:"rounded bg-background/60 px-1.5 py-0.5"},ny={key:1,class:"space-y-1.5"},oy={class:"flex items-center gap-2 text-sm font-medium"},ry={class:"font-mono text-[11px] text-muted-foreground"},iy=ve({__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=ne(()=>t.data),o=ne(()=>n.value.kind==="task"?n.value:null),r=ne(()=>n.value.kind==="external"?n.value:null),i=ne(()=>{if(n.value.kind!=="task")return{label:"Missing dependency",icon:Xt,class:"text-amber-600 dark:text-amber-400"};switch(n.value.status){case"completed":return{label:"Completed",icon:Wn,class:"text-emerald-600 dark:text-emerald-400"};case"in_progress":return{label:"In Progress",icon:Ki,class:"text-blue-600 dark:text-blue-400"};default:return{label:"Pending",icon:fn,class:"text-muted-foreground"}}}),s=ne(()=>n.value.kind!=="task"?null:n.value.priority.replace("_"," ")),a=ne(()=>n.value.kind!=="task"?null:n.value.category),l=ne(()=>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"]),c=ne(()=>n.value.kind!=="task"||!n.value.showPrdLabel?null:n.value.prdName?.trim()||n.value.prdSlug);return(u,d)=>(j(),ee("div",{class:Ae(["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",[k(l),e.selected?"ring-2 ring-primary/30 shadow-md":"hover:shadow-md hover:border-primary/40"]])},[oe(k(en),{type:"target",position:k(ue).Top,class:"!h-2 !w-2 !border-0 !bg-transparent !opacity-0 !pointer-events-none"},null,8,["position"]),k(o)?(j(),ee("div",Wm,[Z("div",Xm,[Z("span",Um,he(k(o).taskId),1),k(c)?(j(),ee("span",{key:0,title:`${k(o).prdName} (${k(o).prdSlug})`,class:"max-w-[11rem] truncate rounded border border-border bg-background/60 px-1.5 py-0.5 text-[10px]"},he(k(c)),9,Zm)):ge("",!0)]),Z("p",Km,he(k(o).title),1),Z("div",Jm,[Z("div",{class:Ae(["flex items-center gap-1.5",k(i).class])},[(j(),we(Ge(k(i).icon),{class:"size-3.5"})),Z("span",null,he(k(i).label),1)],2),Z("div",Qm,[Z("span",ey,he(k(a)),1),Z("span",ty,he(k(s)),1)])])])):k(r)?(j(),ee("div",ny,[Z("div",oy,[oe(k(Xt),{class:"size-4"}),Z("span",null,he(k(r).title),1)]),Z("p",ry,he(k(r).dependencyRef),1)])):ge("",!0),oe(k(en),{type:"source",position:k(ue).Bottom,class:"!h-2 !w-2 !border-0 !bg-transparent !opacity-0 !pointer-events-none"},null,8,["position"])],2))}}),Ai=Object.assign(iy,{__name:"GraphNode"}),sy={class:"relative h-full overflow-hidden rounded-lg border border-border bg-card"},ay={key:0,class:"flex h-full items-center justify-center"},ly={class:"flex flex-col items-center gap-2 text-sm text-muted-foreground"},uy={key:1,class:"flex h-full items-center justify-center p-6"},cy={class:"max-w-sm text-center"},dy={class:"mt-1 text-sm text-muted-foreground"},fy={key:2,class:"flex h-full items-center justify-center p-6"},hy={class:"max-w-sm text-center"},py={class:"mt-1 text-sm text-muted-foreground"},gy={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"},vy={class:"space-y-1 text-xs"},my={class:"flex items-center gap-1.5 text-muted-foreground"},yy={class:"flex items-center gap-1.5 text-blue-600 dark:text-blue-400"},wy={class:"flex items-center gap-1.5 text-emerald-600 dark:text-emerald-400"},_y={class:"flex items-center gap-1.5 text-amber-600 dark:text-amber-400"},xy={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"},by={class:"flex flex-wrap items-center gap-1.5 text-[11px] text-muted-foreground"},Ey={class:"rounded bg-muted px-1.5 py-0.5"},ky={class:"rounded bg-blue-500/10 px-1.5 py-0.5 text-blue-700 dark:text-blue-300"},Sy={class:"rounded bg-emerald-500/10 px-1.5 py-0.5 text-emerald-700 dark:text-emerald-300"},Cy={class:"rounded bg-amber-500/10 px-1.5 py-0.5 text-amber-700 dark:text-amber-300"},Ny=ve({__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:Ht(Ai),external:Ht(Ai)},i=Ta("(prefers-reduced-motion: reduce)"),s=ce(0);_e(()=>[n.scope,n.payload?.scope,n.payload?.nodes.length,n.payload?.edges.length],()=>{s.value+=1},{deep:!1});const a=ne(()=>`${n.scope}-${s.value}`),l=ne(()=>n.payload?n.payload.nodes.some(w=>w.kind==="task"):!1),c=ne(()=>n.payload?.stats);function u(w,b){return w.kind==="external"?{width:272,height:80}:b==="repo"?{width:272,height:116}:{width:272,height:96}}function d(w){return w==="repo"?{ranksep:136,nodesep:88,edgesep:34,marginx:36,marginy:28}:{ranksep:102,nodesep:56,edgesep:20,marginx:24,marginy:22}}function h(w,b){const E=new jr.graphlib.Graph,v=d(n.scope);E.setDefaultEdgeLabel(()=>({})),E.setGraph({rankdir:"TB",ranker:"network-simplex",...v});for(const m of w){const T=u(m.data,n.scope);E.setNode(m.id,T)}for(const m of b)E.setEdge(m.source,m.target);return jr.layout(E),w.map(m=>{const T=u(m.data,n.scope),B=E.node(m.id);return B?{...m,targetPosition:ue.Top,sourcePosition:ue.Bottom,position:{x:B.x-T.width/2,y:B.y-T.height/2}}:m})}const f=ne(()=>n.payload?n.payload.edges.map(w=>({id:w.id,source:w.source,target:w.target,type:"step",animated:w.unresolved&&!i.value,markerEnd:{type:io.ArrowClosed,width:16,height:16},style:{strokeWidth:w.unresolved?1.4:1.7,stroke:w.unresolved?"var(--muted-foreground)":"var(--border)",strokeOpacity:w.unresolved?.62:.95,strokeDasharray:w.unresolved?"5 4":void 0}})):[]),g=ne(()=>{if(!n.payload)return[];const w=n.payload.nodes.map(b=>({id:b.id,type:b.kind,data:{...b,showPrdLabel:b.kind==="task"?n.scope==="repo":void 0},draggable:!1,selectable:b.kind==="task",connectable:!1,position:{x:0,y:0}}));return h(w,f.value)});function y(w){const E=w.node.data;!E||E.kind!=="task"||o("taskClick",{prdSlug:E.prdSlug,taskId:E.taskId})}return(w,b)=>(j(),ee("div",sy,[e.loading?(j(),ee("div",ay,[Z("div",ly,[oe(k(Go),{class:"size-5 animate-spin"}),b[0]||(b[0]=Z("span",null,"Building graph...",-1))])])):e.error?(j(),ee("div",uy,[Z("div",cy,[oe(k(Yn),{class:"mx-auto mb-3 size-8 text-destructive"}),b[1]||(b[1]=Z("p",{class:"text-sm font-medium"},"Graph unavailable",-1)),Z("p",dy,he(e.error),1)])])):!e.payload||!k(l)?(j(),ee("div",fy,[Z("div",hy,[oe(k(Qa),{class:"mx-auto mb-3 size-8 text-muted-foreground/60"}),b[2]||(b[2]=Z("p",{class:"text-sm font-medium"},"No graphable tasks yet",-1)),Z("p",py,he(e.scope==="repo"?"No PRDs with task state were found in this repository.":"This PRD does not have generated tasks yet."),1)])])):(j(),we(k(sm),{key:k(a),nodes:k(g),edges:k(f),"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:y},{default:fe(()=>[oe(k(gm),{gap:20,size:1.2,variant:"dots",color:"var(--border)"}),oe(k(Ym),{position:"bottom-left","show-interactive":!1})]),_:1},8,["nodes","edges"])),e.payload&&k(l)?(j(),ee("div",gy,[b[7]||(b[7]=Z("p",{class:"mb-1 text-[11px] font-medium uppercase tracking-wide text-muted-foreground"},"Legend",-1)),Z("div",vy,[Z("div",my,[oe(k(fn),{class:"size-3.5"}),b[3]||(b[3]=Se(" Pending ",-1))]),Z("div",yy,[oe(k(Ki),{class:"size-3.5"}),b[4]||(b[4]=Se(" In Progress ",-1))]),Z("div",wy,[oe(k(Wn),{class:"size-3.5"}),b[5]||(b[5]=Se(" Completed ",-1))]),Z("div",_y,[oe(k(Xt),{class:"size-3.5"}),b[6]||(b[6]=Se(" Missing dependency ",-1))])])])):ge("",!0),k(c)&&k(l)?(j(),ee("div",xy,[Z("div",by,[Z("span",Ey,"Total "+he(k(c).total),1),Z("span",ky,"WIP "+he(k(c).inProgress),1),Z("span",Sy,"Done "+he(k(c).completed),1),Z("span",Cy,"Missing "+he(k(c).unresolved),1)])])):ge("",!0)]))}}),Fw=Object.assign(Ny,{__name:"GraphExplorer"}),$y={class:"space-y-0.5 p-2"},My=["onClick"],Ty={class:"min-w-0 flex-1"},Oy=["title"],Py={class:"text-muted-foreground"},Iy={class:"mt-1 flex h-1.5 w-full overflow-hidden rounded-full bg-muted"},Dy={class:"flex shrink-0 items-center gap-1 text-xs"},Ay={key:0,class:"text-green-600 dark:text-green-400"},zy={key:1,class:"text-red-600 dark:text-red-400"},By={key:0,class:"py-4 text-center text-sm text-muted-foreground"},Ry=ve({__name:"ChangesMinimap",props:{files:{},selectedFile:{}},emits:["select"],setup(e,{emit:t}){const n=e,o=t,r=ne(()=>n.files.length===0?1:Math.max(...n.files.map(u=>u.additions+u.deletions),1));function i(u){switch(u){case"added":return{icon:kl,class:"text-green-600 dark:text-green-400"};case"deleted":return{icon:Sl,class:"text-red-600 dark:text-red-400"};case"renamed":return{icon:Ir,class:"text-blue-600 dark:text-blue-400"};default:return{icon:El,class:"text-yellow-600 dark:text-yellow-400"}}}function s(u){const d=u.additions+u.deletions;if(d===0)return{additions:0,deletions:0,total:0};const h=d/r.value*100,f=u.additions/d*h,g=u.deletions/d*h;return{additions:f,deletions:g,total:h}}function a(u){return u.status==="renamed"&&u.oldPath?`${u.oldPath} → ${u.path}`:u.path}function l(u){return u.split("/").pop()||u}function c(u){o("select",u)}return(u,d)=>(j(),ee("div",$y,[(j(!0),ee(Me,null,qe(e.files,h=>(j(),ee("button",{key:h.path,class:Ae(["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===h.path}]),onClick:f=>c(h.path)},[(j(),we(Ge(i(h.status).icon),{class:Ae(["size-4 shrink-0",i(h.status).class])},null,8,["class"])),Z("div",Ty,[Z("div",{class:Ae(["truncate text-xs",{"font-medium":e.selectedFile===h.path}]),title:a(h)},[h.status==="renamed"&&h.oldPath?(j(),ee(Me,{key:0},[Z("span",Py,he(l(h.oldPath)),1),oe(k(Ir),{class:"mx-1 inline size-3 text-muted-foreground"}),Z("span",null,he(l(h.path)),1)],64)):(j(),ee(Me,{key:1},[Se(he(h.path),1)],64))],10,Oy),Z("div",Iy,[s(h).additions>0?(j(),ee("div",{key:0,class:"bg-green-500 dark:bg-green-400",style:Re({width:`${s(h).additions}%`})},null,4)):ge("",!0),s(h).deletions>0?(j(),ee("div",{key:1,class:"bg-red-500 dark:bg-red-400",style:Re({width:`${s(h).deletions}%`})},null,4)):ge("",!0)])]),Z("div",Dy,[h.additions>0?(j(),ee("span",Ay," +"+he(h.additions),1)):ge("",!0),h.deletions>0?(j(),ee("span",zy," -"+he(h.deletions),1)):ge("",!0)])],10,My))),128)),e.files.length===0?(j(),ee("div",By," No files changed ")):ge("",!0)]))}}),Ly=Object.assign(Ry,{__name:"GitChangesMinimap"}),Vy={class:"diff-viewer"},Fy={key:0,class:"flex items-center justify-center py-8"},Hy={key:1,class:"flex flex-col items-center justify-center gap-3 py-12 text-muted-foreground"},Gy={key:2,class:"flex flex-col items-center justify-center gap-3 py-12 text-muted-foreground"},qy={key:3,class:"diff-container"},jy={class:"flex flex-col items-center justify-center gap-3 border-b border-border bg-muted/30 py-6"},Yy={class:"text-center"},Wy={class:"text-sm text-muted-foreground"},Xy={key:4,class:"diff-container"},Uy={class:"full-file-view"},Zy={class:"diff-gutter"},Ky={class:"line-number"},Jy={class:"diff-content"},Qy=["innerHTML"],e0={key:5,class:"diff-container"},t0={class:"diff-toolbar"},n0={class:"diff-split"},o0={class:"diff-column-content"},r0={key:0,class:"diff-separator-half"},i0={class:"diff-gutter"},s0={key:0,class:"line-number"},a0={class:"diff-content"},l0=["innerHTML"],u0={class:"diff-column-content"},c0={key:0,class:"diff-separator-half"},d0={class:"diff-gutter"},f0={key:0,class:"line-number"},h0={class:"diff-content"},p0=["innerHTML"],zi=1e4,Bi=1500,g0=4e3,v0=ve({__name:"DiffViewer",props:{hunks:{},filePath:{},binary:{type:Boolean},oldPath:{},fileContent:{},showFullFile:{type:Boolean},isLoadingContent:{type:Boolean}},setup(e){const t=e,n=ce(!1),o=ce(!0),r=ce(null),i=ce(null),s=ce(!1);function a(C){if(!o.value||s.value)return;const p=C.target;i.value&&(s.value=!0,i.value.scrollLeft=p.scrollLeft,requestAnimationFrame(()=>{s.value=!1}))}function l(C){if(!o.value||s.value)return;const p=C.target;r.value&&(s.value=!0,r.value.scrollLeft=p.scrollLeft,requestAnimationFrame(()=>{s.value=!1}))}const c=ne(()=>{let C=0;for(const p of t.hunks)C+=p.lines.length;return C}),u=ne(()=>c.value>zi),d=ne(()=>t.hunks.length===0&&!t.binary),h=ne(()=>{const C=new Set,p=new Set;for(const N of t.hunks)for(const _ of N.lines)_.type==="add"&&_.newNumber!==void 0&&C.add(_.newNumber),_.type==="remove"&&_.oldNumber!==void 0&&p.add(_.oldNumber);return{added:C,removed:p}}),f=ne(()=>t.fileContent?t.fileContent.split(`
28
+ `):[]);function g(C){const p=C.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"}[p]||"text"}const y=ne(()=>g(t.filePath)),w=ce(new Map),b=ce(!0),E=new Map;let v=null;async function m(){return v||(v=Ga(()=>import("./CbkpNvIu.js"),__vite__mapDeps([0,1,2,3]),import.meta.url).then(C=>C.codeToHtml)),v}const T=ne(()=>{const C=[];for(let p=0;p<t.hunks.length;p++){const N=t.hunks[p];p>0&&C.push({type:"separator",hunkIndex:p});const _=N.lines;let $=0;for(;$<_.length;){const P=_[$];if(P.type==="context")C.push({type:"line",pair:{id:`${p}-${$}`,left:{lineNum:P.oldNumber,content:P.content,type:"context"},right:{lineNum:P.newNumber,content:P.content,type:"context"}}}),$++;else if(P.type==="remove"){const G=[],L=[];for(;$<_.length&&_[$].type==="remove";)G.push(_[$]),$++;for(;$<_.length&&_[$].type==="add";)L.push(_[$]),$++;const q=Math.max(G.length,L.length);for(let U=0;U<q;U++){const J=G[U],D=L[U];C.push({type:"line",pair:{id:`${p}-${$-q+U}`,left:J?{lineNum:J.oldNumber,content:J.content,type:"remove"}:{content:"",type:"empty"},right:D?{lineNum:D.newNumber,content:D.content,type:"add"}:{content:"",type:"empty"}}})}}else P.type==="add"&&C.push({type:"line",pair:{id:`${p}-${$}`,left:{content:"",type:"empty"},right:{lineNum:P.newNumber,content:P.content,type:"add"}}}),$++}}return C});async function B(C,p){if(!C.trim())return"";const N=`${p}:${C}`,_=E.get(N);if(_!==void 0)return _;try{const G=(await(await m())(C,{lang:p,themes:{light:"catppuccin-latte",dark:"catppuccin-mocha"}})).match(/<code[^>]*>([\s\S]*?)<\/code>/),L=G?G[1]||"":F(C);return E.set(N,L),L}catch{const $=F(C);return E.set(N,$),$}}async function H(C,p){if(!C)return[];const N=C.split(`
29
+ `);if(N.length>g0)return N.map(F);try{const P=(await(await m())(C,{lang:p,themes:{light:"catppuccin-latte",dark:"catppuccin-mocha"}})).match(/<code[^>]*>([\s\S]*?)<\/code>/);return!P||!P[1]?N.map(F):P[1].split(`
30
+ `)}catch{return N.map(F)}}function F(C){return C.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#039;")}const K=ce([]),I=ce(!1);_e(()=>[t.fileContent,t.filePath],async([C])=>{if(!C){K.value=[];return}I.value=!0;const p=y.value;K.value=await H(C,p),I.value=!1},{immediate:!0}),_e(()=>[t.hunks,t.filePath,K.value],async()=>{b.value=!0;const C=y.value,p=new Map,N=K.value,_=[];for(const L of T.value)if(L.type==="line"&&L.pair){if(L.pair.left.content&&L.pair.left.type!=="empty"){const q=`${L.pair.id}-old`;if(L.pair.left.type==="context"&&L.pair.left.lineNum&&N.length>0){const U=L.pair.right.lineNum?L.pair.right.lineNum-1:-1;U>=0&&U<N.length?p.set(q,N[U]||""):_.push({key:q,content:L.pair.left.content})}else _.push({key:q,content:L.pair.left.content})}if(L.pair.right.content&&L.pair.right.type!=="empty"){const q=`${L.pair.id}-new`,U=L.pair.right.lineNum;U&&N.length>0&&U<=N.length?p.set(q,N[U-1]||""):_.push({key:q,content:L.pair.right.content})}}const $=_.slice(0,Bi),P=_.slice(Bi);for(const{key:L,content:q}of P)p.set(L,F(q));const G=50;for(let L=0;L<$.length;L+=G){const q=$.slice(L,L+G),U=await Promise.all(q.map(async({key:J,content:D})=>{const x=await B(D,C);return{key:J,result:x}}));for(const{key:J,result:D}of U)p.set(J,D)}w.value=p,b.value=!1},{immediate:!0});function A(C,p){return w.value.get(`${C}-${p}`)||""}function S(C){return h.value.added.has(C)?"add":"context"}return(C,p)=>(j(),ee("div",Vy,[(k(b)||e.isLoadingContent||k(I))&&!e.binary?(j(),ee("div",Fy,[...p[2]||(p[2]=[Z("div",{class:"size-6 animate-spin rounded-full border-2 border-primary border-t-transparent"},null,-1)])])):e.binary?(j(),ee("div",Hy,[oe(k(bl),{class:"size-10 opacity-50"}),p[3]||(p[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))])):k(d)&&!e.showFullFile?(j(),ee("div",Gy,[oe(k(Xt),{class:"size-10 opacity-50"}),p[4]||(p[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))])):k(u)&&!k(n)&&!e.showFullFile?(j(),ee("div",qy,[Z("div",jy,[oe(k(Xt),{class:"size-8 text-yellow-500"}),Z("div",Yy,[p[5]||(p[5]=Z("p",{class:"font-medium"},"Large file",-1)),Z("p",Wy," This file has "+he(k(c).toLocaleString())+" lines (threshold: "+he(zi.toLocaleString())+") ",1)]),oe(k(bt),{variant:"outline",size:"sm",onClick:p[0]||(p[0]=N=>n.value=!0)},{default:fe(()=>[oe(k(el),{class:"mr-2 size-4"}),p[6]||(p[6]=Se(" Show full diff ",-1))]),_:1})])])):e.showFullFile&&e.fileContent?(j(),ee("div",Xy,[Z("div",Uy,[(j(!0),ee(Me,null,qe(k(f),(N,_)=>(j(),ee("div",{key:_,class:Ae(["full-file-line",{"diff-add":S(_+1)==="add"}])},[Z("div",Zy,[Z("span",Ky,he(_+1),1)]),Z("div",Jy,[Z("span",{class:"diff-code",innerHTML:k(K)[_]||F(N)},null,8,Qy)])],2))),128))])])):(j(),ee("div",e0,[Z("div",t0,[oe(k(bt),{variant:"ghost",size:"sm",class:Ae(["h-7 gap-1.5 text-xs",{"text-primary":k(o)}]),onClick:p[1]||(p[1]=N=>o.value=!k(o))},{default:fe(()=>[(j(),we(Ge(k(o)?k(Tl):k($l)),{class:"size-3.5"})),Se(" "+he(k(o)?"Sync scroll":"Scroll unlocked"),1)]),_:1},8,["class"])]),Z("div",n0,[Z("div",{ref_key:"leftScrollRef",ref:r,class:"diff-column diff-column-left",onScroll:a},[Z("div",o0,[(j(!0),ee(Me,null,qe(k(T),N=>(j(),ee(Me,{key:N.type==="line"?`left-${N.pair?.id}`:`left-sep-${N.hunkIndex}`},[N.type==="separator"?(j(),ee("div",r0,[...p[7]||(p[7]=[Z("div",{class:"separator-line"},null,-1),Z("span",{class:"separator-text"},"···",-1)])])):N.pair?(j(),ee("div",{key:1,class:Ae(["diff-line",{"diff-remove":N.pair.left.type==="remove","diff-empty":N.pair.left.type==="empty","diff-context":N.pair.left.type==="context"}])},[Z("div",i0,[N.pair.left.lineNum?(j(),ee("span",s0,he(N.pair.left.lineNum),1)):ge("",!0)]),Z("div",a0,[N.pair.left.type!=="empty"?(j(),ee("span",{key:0,class:"diff-code",innerHTML:A(N.pair.id,"old")||F(N.pair.left.content)},null,8,l0)):ge("",!0)])],2)):ge("",!0)],64))),128))])],544),Z("div",{ref_key:"rightScrollRef",ref:i,class:"diff-column diff-column-right",onScroll:l},[Z("div",u0,[(j(!0),ee(Me,null,qe(k(T),N=>(j(),ee(Me,{key:N.type==="line"?`right-${N.pair?.id}`:`right-sep-${N.hunkIndex}`},[N.type==="separator"?(j(),ee("div",c0,[...p[8]||(p[8]=[Z("span",{class:"separator-text"},"···",-1),Z("div",{class:"separator-line"},null,-1)])])):N.pair?(j(),ee("div",{key:1,class:Ae(["diff-line",{"diff-add":N.pair.right.type==="add","diff-empty":N.pair.right.type==="empty","diff-context":N.pair.right.type==="context"}])},[Z("div",d0,[N.pair.right.lineNum?(j(),ee("span",f0,he(N.pair.right.lineNum),1)):ge("",!0)]),Z("div",h0,[N.pair.right.type!=="empty"?(j(),ee("span",{key:0,class:"diff-code",innerHTML:A(N.pair.id,"new")||F(N.pair.right.content)},null,8,p0)):ge("",!0)])],2)):ge("",!0)],64))),128))])],544)])]))]))}}),m0=Object.assign(hl(v0,[["__scopeId","data-v-a5da7e6e"]]),{__name:"GitDiffViewer"}),y0=ve({__name:"Tooltip",props:{defaultOpen:{type:Boolean},open:{type:Boolean},delayDuration:{},disableHoverableContent:{type:Boolean},disableClosingTrigger:{type:Boolean},disabled:{type:Boolean},ignoreNonKeyboardFocus:{type:Boolean}},emits:["update:open"],setup(e,{emit:t}){const r=dr(e,t);return(i,s)=>(j(),we(k(yc),He({"data-slot":"tooltip"},k(r)),{default:fe(a=>[xe(i.$slots,"default",co(fo(a)))]),_:3},16))}}),Ri=Object.assign(y0,{__name:"UiTooltip"}),w0=ve({inheritAttrs:!1,__name:"TooltipContent",props:{forceMount:{type:Boolean},ariaLabel:{},asChild:{type:Boolean},as:{},side:{},sideOffset:{default:4},align:{},alignOffset:{},avoidCollisions:{type:Boolean},collisionBoundary:{},collisionPadding:{},arrowPadding:{},sticky:{},hideWhenDetached:{type:Boolean},positionStrategy:{},updatePositionStrategy:{},class:{}},emits:["escapeKeyDown","pointerDownOutside"],setup(e,{emit:t}){const n=e,o=t,r=Gi(n,"class"),i=dr(r,o);return(s,a)=>(j(),we(k(Sc),null,{default:fe(()=>[oe(k(Ec),He({"data-slot":"tooltip-content"},{...k(i),...s.$attrs},{class:k(qi)("bg-foreground text-background animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 w-fit rounded-md px-3 py-1.5 text-xs text-balance",n.class)}),{default:fe(()=>[xe(s.$slots,"default"),oe(k(fc),{class:"bg-foreground fill-foreground z-50 size-2.5 translate-y-[calc(-50%_-_2px)] rotate-45 rounded-[2px]"})]),_:3},16,["class"])]),_:3}))}}),Li=Object.assign(w0,{__name:"UiTooltipContent"}),_0=ve({__name:"TooltipProvider",props:{delayDuration:{default:0},skipDelayDuration:{},disableHoverableContent:{type:Boolean},disableClosingTrigger:{type:Boolean},disabled:{type:Boolean},ignoreNonKeyboardFocus:{type:Boolean}},setup(e){const t=e;return(n,o)=>(j(),we(k(gc),co(fo(t)),{default:fe(()=>[xe(n.$slots,"default")]),_:3},16))}}),Vi=Object.assign(_0,{__name:"UiTooltipProvider"}),x0=ve({__name:"TooltipTrigger",props:{reference:{},asChild:{type:Boolean},as:{}},setup(e){const t=e;return(n,o)=>(j(),we(k(Nc),He({"data-slot":"tooltip-trigger"},t),{default:fe(()=>[xe(n.$slots,"default")]),_:3},16))}}),Fi=Object.assign(x0,{__name:"UiTooltipTrigger"});function _a(){const{showError:e}=Oa();function t(u){if(u&&typeof u=="object"){const d=u;return d.data?.message||d.data?.statusMessage||d.message||"Unknown error"}return"Unknown error"}const n=ce(!1),o=ce(!1),r=ce(!1),i=ce(!1);async function s(u,d,h){if(!u||d.length===0)return{commits:[],failedShas:[]};n.value=!0;try{const f={shas:d.join(",")};h&&(f.repo=h);const g=await $fetch(`/api/repos/${u}/git/commits`,{query:f}),y=g.map(b=>b.shortSha),w=d.filter(b=>!y.some(E=>E.startsWith(b)||b.startsWith(E)));return{commits:g,failedShas:w}}catch(f){return e("Failed to fetch commits",t(f)),{commits:[],failedShas:d}}finally{n.value=!1}}async function a(u,d,h){if(!u||!d)return[];o.value=!0;try{const f={commit:d};return h&&(f.repo=h),await $fetch(`/api/repos/${u}/git/diff`,{query:f})}catch(f){return e("Failed to fetch diff",t(f)),[]}finally{o.value=!1}}async function l(u,d,h,f){if(!u||!d||!h)return[];r.value=!0;try{const g={commit:d,file:h};return f&&(g.repo=f),await $fetch(`/api/repos/${u}/git/file-diff`,{query:g})}catch(g){return e("Failed to fetch file diff",t(g)),[]}finally{r.value=!1}}async function c(u,d,h,f){if(!u||!d||!h)return null;i.value=!0;try{const g={commit:d,file:h};return f&&(g.repo=f),(await $fetch(`/api/repos/${u}/git/file-content`,{query:g})).content}catch(g){return e("Failed to fetch file content",t(g)),null}finally{i.value=!1}}return{fetchCommits:s,fetchDiff:a,fetchFileDiff:l,fetchFileContent:c,isLoadingCommits:an(n),isLoadingDiff:an(o),isLoadingFileDiff:an(r),isLoadingFileContent:an(i)}}const b0={key:0,class:"flex flex-1 flex-col items-center justify-center gap-4 p-8"},E0={class:"text-center"},k0={class:"text-sm text-muted-foreground"},S0={key:1,class:"flex flex-1 items-center justify-center"},C0={key:2,class:"flex flex-1 flex-col items-center justify-center gap-2 p-8 text-center text-muted-foreground"},N0={key:3,class:"flex min-h-0 flex-1 overflow-hidden"},$0={class:"flex w-56 shrink-0 flex-col border-r border-border"},M0={class:"flex items-center justify-between border-b border-border px-3 py-2"},T0={class:"text-xs font-medium text-muted-foreground"},O0={class:"text-muted-foreground/50 transition-colors hover:text-muted-foreground"},P0={class:"min-h-0 flex-1 overflow-y-auto"},I0={class:"flex min-h-0 flex-1 flex-col overflow-hidden"},D0={key:0,class:"flex items-center gap-2 border-b border-border px-4 py-2"},A0={key:0,class:"min-w-0 flex-1 truncate font-mono text-sm"},z0={class:"text-muted-foreground"},B0={key:1,class:"min-w-0 flex-1 truncate font-mono text-sm"},R0={key:2,class:"rounded bg-yellow-500/10 px-1.5 py-0.5 text-xs text-yellow-600 dark:text-yellow-400"},L0={key:1,class:"flex flex-1 items-center justify-center"},V0={key:2,class:"flex flex-1 flex-col items-center justify-center gap-4 p-8"},F0={class:"text-center"},H0={class:"text-xs text-muted-foreground"},G0={key:4,class:"flex flex-1 items-center justify-center text-sm text-muted-foreground"},q0=ve({__name:"DiffPanel",props:{repoId:{},commitSha:{},repoPath:{}},emits:["close"],setup(e,{emit:t}){const n=e,o=t,{fetchDiff:r,fetchFileDiff:i,fetchFileContent:s,isLoadingDiff:a,isLoadingFileDiff:l,isLoadingFileContent:c}=_a(),u=ce([]),d=ce(),h=ce([]),f=ce(null),g=ce(null),y=ce(null),w=ce("changes"),b=ne(()=>u.value.find(C=>C.path===d.value));async function E(){g.value=null,u.value=[],d.value=void 0,h.value=[];const C=await r(n.repoId,n.commitSha,n.repoPath);C.length===0&&!a.value&&(g.value=null),u.value=C,C.length>0&&(d.value=C[0].path)}async function v(){if(!d.value){h.value=[],f.value=null;return}y.value=null;const C=await i(n.repoId,n.commitSha,d.value,n.repoPath);if(h.value=C,w.value==="full"){const p=await s(n.repoId,n.commitSha,d.value,n.repoPath);f.value=p}}function m(){w.value=w.value==="changes"?"full":"changes"}_e(w,async C=>{if(C==="full"&&d.value&&!f.value){const p=await s(n.repoId,n.commitSha,d.value,n.repoPath);f.value=p}});function T(C){d.value=C}function B(){E()}function H(){v()}_e(d,()=>{v()}),_e(()=>[n.repoId,n.commitSha,n.repoPath],()=>{E()},{immediate:!0});const F=ce(null),K=ce(null);function I(C){if(u.value.length===0)return;const p=d.value?u.value.findIndex($=>$.path===d.value):-1;let N;C==="next"?N=p<u.value.length-1?p+1:0:N=p>0?p-1:u.value.length-1;const _=u.value[N];_&&(d.value=_.path)}function A(C){if(!K.value)return;const p=K.value.querySelectorAll(".diff-separator");if(p.length===0)return;const N=K.value.closest(".overflow-y-auto, [data-radix-scroll-area-viewport]");if(!N)return;const _=N.scrollTop,$=N.getBoundingClientRect();let P=null;if(C==="next"){for(const G of p)if(G.getBoundingClientRect().top-$.top+_>_+50){P=G;break}!P&&p.length>0&&(P=p[0])}else{for(let G=p.length-1;G>=0;G--){const L=p[G];if(L.getBoundingClientRect().top-$.top+_<_-10){P=L;break}}!P&&p.length>0&&(P=p[p.length-1])}P&&P.scrollIntoView({behavior:"smooth",block:"start"})}function S(C){if(!(C.target instanceof HTMLInputElement||C.target instanceof HTMLTextAreaElement))switch(C.key){case"j":case"ArrowDown":!C.ctrlKey&&!C.metaKey&&(C.preventDefault(),I("next"));break;case"k":case"ArrowUp":!C.ctrlKey&&!C.metaKey&&(C.preventDefault(),I("prev"));break;case"[":C.preventDefault(),A("prev");break;case"]":C.preventDefault(),A("next");break;case"Escape":C.preventDefault(),o("close");break}}return je(()=>{document.addEventListener("keydown",S)}),Wi(()=>{document.removeEventListener("keydown",S)}),(C,p)=>{const N=Ly,_=m0;return j(),ee("div",{ref_key:"panelRef",ref:F,class:"flex h-full flex-col overflow-hidden",tabindex:"-1"},[k(g)?(j(),ee("div",b0,[oe(k(Yn),{class:"size-12 text-destructive"}),Z("div",E0,[p[0]||(p[0]=Z("p",{class:"font-medium"},"Failed to load diff",-1)),Z("p",k0,he(k(g)),1)]),oe(k(bt),{variant:"outline",size:"sm",onClick:B},{default:fe(()=>[oe(k(Pr),{class:"mr-2 size-4"}),p[1]||(p[1]=Se(" Retry ",-1))]),_:1})])):k(a)&&k(u).length===0?(j(),ee("div",S0,[oe(k(Go),{class:"size-8 animate-spin text-muted-foreground"})])):k(u).length===0?(j(),ee("div",C0,[...p[2]||(p[2]=[Z("p",null,"No files changed in this commit",-1)])])):(j(),ee("div",N0,[Z("div",$0,[Z("div",M0,[Z("span",T0,he(k(u).length)+" file"+he(k(u).length!==1?"s":"")+" changed ",1),oe(k(Vi),null,{default:fe(()=>[oe(k(Ri),null,{default:fe(()=>[oe(k(Fi),{"as-child":""},{default:fe(()=>[Z("button",O0,[oe(k(tl),{class:"size-3.5"})])]),_:1}),oe(k(Li),{side:"bottom",align:"end",class:"max-w-xs"},{default:fe(()=>[...p[3]||(p[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",P0,[oe(N,{files:k(u),"selected-file":k(d),onSelect:T},null,8,["files","selected-file"])])]),Z("div",I0,[k(d)?(j(),ee("div",D0,[k(b)?.oldPath?(j(),ee("span",A0,[Z("span",z0,he(k(b).oldPath),1),p[4]||(p[4]=Z("span",{class:"mx-2 text-muted-foreground"},"→",-1)),Z("span",null,he(k(d)),1)])):(j(),ee("span",B0,he(k(d)),1)),k(b)?.binary?(j(),ee("span",R0," binary ")):ge("",!0),k(b)?.binary?ge("",!0):(j(),we(k(Vi),{key:3},{default:fe(()=>[oe(k(Ri),null,{default:fe(()=>[oe(k(Fi),{"as-child":""},{default:fe(()=>[oe(k(bt),{variant:"ghost",size:"sm",class:"h-7 shrink-0 gap-1.5 text-xs",onClick:m},{default:fe(()=>[(j(),we(Ge(k(w)==="changes"?k(xl):k(_l)),{class:"size-3.5"})),Se(" "+he(k(w)==="changes"?"Changes":"Full file"),1)]),_:1})]),_:1}),oe(k(Li),null,{default:fe(()=>[Se(he(k(w)==="changes"?"Show full file with changes":"Show changes only"),1)]),_:1})]),_:1})]),_:1}))])):ge("",!0),k(l)?(j(),ee("div",L0,[oe(k(Go),{class:"size-6 animate-spin text-muted-foreground"})])):k(y)?(j(),ee("div",V0,[oe(k(Yn),{class:"size-8 text-destructive"}),Z("div",F0,[p[5]||(p[5]=Z("p",{class:"text-sm font-medium"},"Failed to load file diff",-1)),Z("p",H0,he(k(y)),1)]),oe(k(bt),{variant:"outline",size:"sm",onClick:H},{default:fe(()=>[oe(k(Pr),{class:"mr-2 size-4"}),p[6]||(p[6]=Se(" Retry ",-1))]),_:1})])):k(d)?(j(),we(k(nl),{key:3,class:"h-0 flex-1 overflow-hidden"},{default:fe(()=>[Z("div",{ref_key:"diffViewerRef",ref:K},[oe(_,{hunks:k(h),"file-path":k(d),binary:k(b)?.binary,"old-path":k(b)?.oldPath,"file-content":k(f),"show-full-file":k(w)==="full","is-loading-content":k(c)},null,8,["hunks","file-path","binary","old-path","file-content","show-full-file","is-loading-content"])],512)]),_:1})):(j(),ee("div",G0," Select a file to view changes "))])]))],512)}}}),j0=Object.assign(q0,{__name:"GitDiffPanel"}),Y0={class:"space-y-2"},W0={key:1,class:"rounded-lg border border-dashed p-4 text-center text-sm text-muted-foreground"},X0=["onClick"],U0={class:"flex items-start gap-3"},Z0={class:"min-w-0 flex-1"},K0={class:"flex flex-wrap items-center gap-2"},J0={class:"font-mono text-xs font-medium text-primary"},Q0={class:"flex items-center gap-1 text-xs text-muted-foreground"},ew={class:"flex items-center gap-0.5 text-xs text-green-600 dark:text-green-400"},tw={class:"flex items-center gap-0.5 text-xs text-red-600 dark:text-red-400"},nw={class:"mt-1 truncate text-sm"},ow={key:1,class:"flex items-center gap-1 text-muted-foreground"},rw={key:2,class:"text-muted-foreground"},iw={key:0,class:"mt-1 text-xs text-muted-foreground"},sw=ve({__name:"CommitList",props:{commits:{},repoId:{}},emits:["select"],setup(e,{emit:t}){const n=e,o=t,{fetchCommits:r,isLoadingCommits:i}=_a(),s=ce(new Map),a=ce(new Set),l=ne(()=>new Set(n.commits.map(g=>g.repo).filter(Boolean)).size>1);_e(()=>({commits:n.commits,repoId:n.repoId}),async({commits:f,repoId:g})=>{if(f.length===0||!g){s.value=new Map,a.value=new Set;return}const y=new Map;for(const v of f){const m=v.repo||"";y.has(m)||y.set(m,[]),y.get(m).push(v.sha)}const w=await Promise.all(Array.from(y.entries()).map(async([v,m])=>{const T=await r(g,m,v||void 0);return{commits:T.commits.map(B=>({...B,repoPath:v})),failedShas:T.failedShas}})),b=new Map,E=new Set;for(const{commits:v,failedShas:m}of w){for(const T of v)b.set(T.shortSha,T);for(const T of m)E.add(T)}s.value=b,a.value=E},{immediate:!0});function c(f){const g=new Date(f),w=new Date().getTime()-g.getTime(),b=Math.floor(w/1e3),E=Math.floor(b/60),v=Math.floor(E/60),m=Math.floor(v/24);return b<60?"just now":E<60?`${E} minute${E===1?"":"s"} ago`:v<24?`${v} hour${v===1?"":"s"} ago`:m<7?`${m} day${m===1?"":"s"} ago`:g.toLocaleDateString()}function u(f){o("select",f.sha,f.repo)}function d(f){const g=s.value.get(f);if(g)return g;for(const[y,w]of s.value)if(y.startsWith(f)||f.startsWith(y))return w}function h(f){if(a.value.has(f))return!0;for(const g of a.value)if(g.startsWith(f)||f.startsWith(g))return!0;return!1}return(f,g)=>(j(),ee("div",Y0,[k(i)?(j(!0),ee(Me,{key:0},qe(Math.min(e.commits.length,3),y=>(j(),ee("div",{key:y,class:"animate-pulse rounded-lg border bg-muted/50 p-3"},[...g[0]||(g[0]=[qa('<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?(j(),ee("div",W0," No commits recorded for this task ")):(j(!0),ee(Me,{key:2},qe(e.commits,y=>(j(),ee("button",{key:y.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:w=>u(y)},[Z("div",U0,[oe(k(Nl),{class:"mt-0.5 size-5 shrink-0 text-muted-foreground"}),Z("div",Z0,[Z("div",K0,[Z("code",J0,he(d(y.sha)?.shortSha||y.sha.substring(0,7)),1),d(y.sha)?(j(),ee(Me,{key:0},[Z("span",Q0,[oe(k(Pa),{class:"size-3"}),Se(" "+he(d(y.sha).filesChanged),1)]),Z("span",ew,[oe(k(ol),{class:"size-3"}),Se(he(d(y.sha).additions),1)]),Z("span",tw,[oe(k(Pl),{class:"size-3"}),Se(he(d(y.sha).deletions),1)])],64)):ge("",!0),y.repo&&k(l)?(j(),we(k(Vn),{key:1,variant:"secondary",class:"gap-1 text-xs"},{default:fe(()=>[oe(k(Cl),{class:"size-3"}),Se(" "+he(y.repo),1)]),_:2},1024)):ge("",!0)]),Z("p",nw,[d(y.sha)?(j(),ee(Me,{key:0},[Se(he(d(y.sha).message),1)],64)):h(y.sha)?(j(),ee("span",ow,[oe(k(Yn),{class:"size-3"}),g[1]||(g[1]=Se(" Commit unavailable ",-1))])):(j(),ee("span",rw,"Loading..."))]),d(y.sha)?(j(),ee("p",iw,he(d(y.sha).author)+" · "+he(c(d(y.sha).date)),1)):ge("",!0)])])],8,X0))),128))]))}}),aw=Object.assign(sw,{__name:"GitCommitList"}),lw=ve({__name:"Separator",props:{orientation:{default:"horizontal"},decorative:{type:Boolean,default:!0},asChild:{type:Boolean},as:{},class:{}},setup(e){const t=e,n=Gi(t,"class");return(o,r)=>(j(),we(k(rl),He({"data-slot":"separator"},k(n),{class:k(qi)("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"]))}}),Vt=Object.assign(lw,{__name:"UiSeparator"}),uw={class:"flex items-center gap-2"},cw={key:1,class:"min-h-0 flex-1 overflow-hidden"},dw={key:2,class:"min-h-0 flex-1 space-y-4 overflow-y-auto px-6"},fw={class:"flex flex-wrap items-center gap-2"},hw={class:"space-y-2"},pw={class:"text-sm text-muted-foreground leading-relaxed"},gw={key:0,class:"space-y-2"},vw={class:"flex items-center gap-2 text-sm font-medium"},mw={class:"ml-4 list-decimal space-y-1 text-sm text-muted-foreground"},yw={key:2,class:"space-y-2"},ww={class:"flex items-center gap-2 text-sm font-medium"},_w={class:"space-y-1.5 text-sm text-muted-foreground"},xw={key:4,class:"space-y-2"},bw={class:"flex items-center gap-2 text-sm font-medium"},Ew={class:"space-y-1 text-sm text-muted-foreground"},kw={class:"font-mono text-xs"},Sw={class:"space-y-2"},Cw={class:"flex items-center gap-2 text-sm font-medium"},Nw={key:6,class:"space-y-2"},$w={class:"flex flex-col gap-1 text-xs text-muted-foreground"},Mw={key:0,class:"flex items-center gap-2"},Tw={key:1,class:"flex items-center gap-2"},Ow={key:7,class:"space-y-2"},Pw={class:"flex items-center justify-between rounded-md border border-border bg-muted/30 px-3 py-2 text-sm"},Iw={class:"text-muted-foreground"},Dw=ve({__name:"Detail",props:Ya({task:{},taskTitles:{},commits:{},repoId:{},taskPrdSlug:{},currentPrdSlug:{}},{open:{type:Boolean,default:!1},openModifiers:{}}),emits:["update:open"],setup(e){const t=e,n=ja(e,"open"),o=ne(()=>{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=ne(()=>{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=ne(()=>{if(!t.task)return{label:"",icon:fn,class:""};switch(t.task.status){case"pending":return{label:"Pending",icon:fn,class:"text-muted-foreground"};case"in_progress":return{label:"In Progress",icon:ml,class:"text-blue-500"};case"completed":return{label:"Completed",icon:Wn,class:"text-green-500"};default:return{label:t.task.status,icon:fn,class:"text-muted-foreground"}}});function s(w){if(!w)return"";try{return new Date(w).toLocaleString()}catch{return w}}function a(w){return t.taskTitles?.get(w)??w}const l=ne(()=>t.commits&&t.commits.length>0&&t.repoId),c=ne(()=>!t.repoId||!t.taskPrdSlug?!1:t.currentPrdSlug?t.taskPrdSlug!==t.currentPrdSlug:!0),u=ne(()=>{if(!c.value||!t.repoId||!t.taskPrdSlug||!t.task)return"";const w=new URLSearchParams({task:t.task.id,taskPrd:t.taskPrdSlug});return`/${t.repoId}/${t.taskPrdSlug}?${w.toString()}`}),d=ce("details"),h=ce(null),f=ce(null);function g(w,b){h.value=w,f.value=b||null,d.value="diff"}function y(){d.value="details",h.value=null,f.value=null}return _e(()=>t.task,()=>{d.value="details",h.value=null,f.value=null}),_e(n,w=>{w||(d.value="details",h.value=null,f.value=null)}),(w,b)=>{const E=j0,v=aw,m=pl;return j(),we(k(dl),{open:n.value,"onUpdate:open":b[0]||(b[0]=T=>n.value=T)},{default:fe(()=>[oe(k(cl),{class:Ae(["flex h-full w-full flex-col overflow-hidden sm:max-w-lg",k(d)==="diff"?"sm:!max-w-[94vw] xl:!max-w-[88vw]":""])},{default:fe(()=>[e.task?(j(),we(k(il),{key:0,class:"px-6 pr-12"},{default:fe(()=>[Z("div",uw,[k(d)==="diff"?(j(),we(k(bt),{key:0,variant:"ghost",size:"icon",class:"size-8 shrink-0",onClick:y},{default:fe(()=>[oe(k(gl),{class:"size-4"})]),_:1})):ge("",!0),oe(k(sl),{class:"text-left text-lg"},{default:fe(()=>[Se(he(k(d)==="diff"?"Commit Changes":e.task.title),1)]),_:1})]),oe(k(al),{class:"sr-only"},{default:fe(()=>[...b[1]||(b[1]=[Se("Task details",-1)])]),_:1})]),_:1})):ge("",!0),e.task&&k(d)==="diff"&&k(h)&&e.repoId?(j(),ee("div",cw,[oe(E,{"repo-id":e.repoId,"commit-sha":k(h),"repo-path":k(f)||void 0,class:"h-full",onClose:y},null,8,["repo-id","commit-sha","repo-path"])])):e.task?(j(),ee("div",dw,[Z("div",fw,[oe(k(Vn),{variant:k(o).variant},{default:fe(()=>[oe(k(Dl),{class:"mr-1 size-3"}),Se(" "+he(k(o).label),1)]),_:1},8,["variant"]),oe(k(Vn),{variant:"outline",class:Ae(k(r).class)},{default:fe(()=>[oe(k(Xt),{class:"mr-1 size-3"}),Se(" "+he(k(r).label),1)]),_:1},8,["class"]),oe(k(Vn),{variant:"outline",class:Ae(k(i).class)},{default:fe(()=>[(j(),we(Ge(k(i).icon),{class:"mr-1 size-3"})),Se(" "+he(k(i).label),1)]),_:1},8,["class"])]),Z("div",hw,[b[2]||(b[2]=Z("h4",{class:"text-sm font-medium"},"Description",-1)),Z("p",pw,he(e.task.description),1)]),oe(k(Vt)),e.task.steps.length>0?(j(),ee("div",gw,[Z("h4",vw,[oe(k(Ol),{class:"size-4"}),b[3]||(b[3]=Se(" Steps ",-1))]),Z("ol",mw,[(j(!0),ee(Me,null,qe(e.task.steps,(T,B)=>(j(),ee("li",{key:B,class:"pl-1"},he(T),1))),128))])])):ge("",!0),e.task.steps.length>0&&e.task.passes.length>0?(j(),we(k(Vt),{key:1})):ge("",!0),e.task.passes.length>0?(j(),ee("div",yw,[Z("h4",ww,[oe(k(Il),{class:"size-4"}),b[4]||(b[4]=Se(" Pass Criteria ",-1))]),Z("ul",_w,[(j(!0),ee(Me,null,qe(e.task.passes,(T,B)=>(j(),ee("li",{key:B,class:"flex items-start gap-2"},[Z("div",{class:Ae(["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"?(j(),we(k(fl),{key:0,class:"size-3"})):ge("",!0)],2),Z("span",null,he(T),1)]))),128))])])):ge("",!0),e.task.dependencies.length>0?(j(),we(k(Vt),{key:3})):ge("",!0),e.task.dependencies.length>0?(j(),ee("div",xw,[Z("h4",bw,[oe(k(Ml),{class:"size-4"}),b[5]||(b[5]=Se(" Dependencies ",-1))]),Z("ul",Ew,[(j(!0),ee(Me,null,qe(e.task.dependencies,T=>(j(),ee("li",{key:T,class:"flex items-center gap-2"},[Z("span",kw,he(T),1),Z("span",null,he(a(T)),1)]))),128))])])):ge("",!0),k(l)?(j(),ee(Me,{key:5},[oe(k(Vt)),Z("div",Sw,[Z("h4",Cw,[oe(k(yl),{class:"size-4"}),b[6]||(b[6]=Se(" Changes ",-1))]),oe(v,{commits:e.commits,"repo-id":e.repoId,onSelect:g},null,8,["commits","repo-id"])])],64)):ge("",!0),e.task.startedAt||e.task.completedAt?(j(),ee("div",Nw,[oe(k(Vt)),Z("div",$w,[e.task.startedAt?(j(),ee("div",Mw,[oe(k(vl),{class:"size-3"}),Z("span",null,"Started: "+he(s(e.task.startedAt)),1)])):ge("",!0),e.task.completedAt?(j(),ee("div",Tw,[oe(k(Wn),{class:"size-3"}),Z("span",null,"Completed: "+he(s(e.task.completedAt)),1)])):ge("",!0)])])):ge("",!0),k(c)?(j(),ee("div",Ow,[oe(k(Vt)),Z("div",Pw,[Z("span",Iw,"This task belongs to "+he(e.taskPrdSlug)+".",1),oe(m,{to:k(u)},{default:fe(()=>[oe(k(bt),{variant:"outline",size:"sm",class:"h-8"},{default:fe(()=>[oe(k(wl),{class:"mr-1.5 size-3.5"}),b[7]||(b[7]=Se(" Open PRD ",-1))]),_:1})]),_:1},8,["to"])])])):ge("",!0)])):ge("",!0),oe(k(ll),{class:"px-6 pb-6"},{default:fe(()=>[oe(k(ul),{"as-child":""},{default:fe(()=>[oe(k(bt),{variant:"outline",class:"w-full"},{default:fe(()=>[...b[8]||(b[8]=[Se("Close",-1)])]),_:1})]),_:1})]),_:1})]),_:1},8,["class"])]),_:1},8,["open"])}}}),Hw=Object.assign(Dw,{__name:"TasksDetail"});export{vl as C,wl as E,Pl as M,Hw as _,fn as a,Wn as b,Fw as c};