@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
@@ -1,42 +0,0 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./DxNHbxmM.js","./CnnebwVN.js","./wDzz0qaB.js","./DPfMkruS.js","./Cl0AqbOI.js","./2EtD6e53.js","./DxSwrfjg.js","./Cp-IABpG.js","./BPQ3VLAy.js","./CXtECtnM.js","./COt5Ahok.js","./5X7smno1.js","./DGP4VlC8.js","./BGJmEYvX.js","./CylS5w8V.js","./BLtJtn59.js","./CxbxFI8M.js","./Bp3cYrEr.js","./CDVJQ6XC.js","./DZxFcAj9.js","./BIGW1oBm.js","./C9oPPf7i.js","./g9-lgVsj.js","./CmIQRyeF.js","./m17aaUwq.js","./Buea-lGh.js","./CufHLc7y.js","./Yzrsuije.js","./CYsAdtH9.js","./fuZLfV_i.js","./CXZktZb0.js","./Br6cN0cg.js","./W9tJ9s81.js","./B6aJPvgy.js","./Dspwwk_N.js","./83L43bj1.js","./B1dDrJ26.js","./TsXTqZ29.js","./Cvjx9yec.js","./DJjDtW9f.js","./BLmx8bSh.js","./DYoxhk2S.js","./Cm3UrAx6.js","./DEthMvLe.js","./DqQDbK_p.js","./CW8IKDeL.js","./BEDo0Tqx.js"])))=>i.map(i=>d[i]);
2
- import{c as Le,f as cc,t as dc,g as fc,h as hc,P as ar,i as pc,j as Ha,d as gc,k as us,l as mc,B as Bt,r as Ga,e as ja,b as vc,F as yc}from"./qt5OEWHC.js";import{N as Zr,q as fe,z as it,s as oe,g as ye,y as ke,O as qa,o as j,x as be,w as pe,l as S,c as ee,L as tt,k as Ee,P as Ai,Q as zn,R as on,C as Nt,b as ie,E as Xe,S as _c,J as lr,K as ur,v as Ua,d as Te,t as ge,p as wc,I as ot,T as bc,_ as J,U as xc,A as Wa,i as Cn,V as Ya,H as He,W as Ec,a as X,F as Oe,r as rt,B as At,D as Xa,X as kc,n as ve,Y as Ie,Z as Nn,$ as vn,a0 as Pe,a1 as Ce,a2 as Sc,m as Ii,a3 as Cc,a4 as Mn,a5 as cn,a6 as Nc,a7 as Ka,a8 as Tc,a9 as Pc,aa as Ac,ab as Ic}from"./CMu9GKTH.js";import{c as cr,b as dt,V as Oc,D as Rc,e as Mc,d as Oi,P as Lc,T as Dc,a as $c,L as Jr,C as Mo,G as Bc,f as zc,R as cs,K as Vc,S as Fc,g as Hc,B as Co,h as Gc,i as jc,j as qc,k as Uc,l as Wc,m as Yc,n as Xc,o as Kc,p as Zc}from"./C_NevjZD.js";import{A as ds}from"./nYTZJhvT.js";import{_ as Jc}from"./DlAUqK2U.js";import{_ as Qc}from"./wbj-mIhK.js";const ed=Le("arrow-left",[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]]);const td=Le("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 Lo=Le("circle-check",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]]);const Vn=Le("circle",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]]);const Za=Le("clock-3",[["path",{d:"M12 6v6h4",key:"135r8i"}],["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]]);const nd=Le("clock",[["path",{d:"M12 6v6l4 2",key:"mmk7yg"}],["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]]);const od=Le("diff",[["path",{d:"M12 3v14",key:"7cf3v8"}],["path",{d:"M5 10h14",key:"elsbfy"}],["path",{d:"M5 21h14",key:"11awu3"}]]);const rd=Le("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 id=Le("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 sd=Le("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 ad=Le("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 ld=Le("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 ud=Le("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 cd=Le("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 dd=Le("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 fd=Le("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 hd=Le("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 pd=Le("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 gd=Le("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 md=Le("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 vd=Le("minus",[["path",{d:"M5 12h14",key:"1ays0h"}]]);const yd=Le("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 _d=Le("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 yn=Le("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 wd(e,t){const n=cc(!1,300);dc(()=>{n.value=!1});const o=fe(null),r=fc();function i(){o.value=null,n.value=!1}function s(a,l){const u=a.currentTarget,c={x:a.clientX,y:a.clientY},d=bd(c,u.getBoundingClientRect()),h=xd(c,d,1),f=Ed(l.getBoundingClientRect()),p=Sd([...h,...f]);o.value=p,n.value=!0}return Zr(a=>{if(e.value&&t.value){const l=c=>s(c,t.value),u=c=>s(c,e.value);e.value.addEventListener("pointerleave",l),t.value.addEventListener("pointerleave",u),a(()=>{e.value?.removeEventListener("pointerleave",l),t.value?.removeEventListener("pointerleave",u)})}}),Zr(a=>{if(o.value){const l=u=>{if(!o.value||!(u.target instanceof Element))return;const c=u.target,d={x:u.clientX,y:u.clientY},h=e.value?.contains(c)||t.value?.contains(c),f=!kd(d,o.value),p=!!c.closest("[data-grace-area-trigger]");h?i():(f||p)&&(i(),r.trigger())};e.value?.ownerDocument.addEventListener("pointermove",l),a(()=>e.value?.ownerDocument.removeEventListener("pointermove",l))}}),{isPointerInTransit:n,onPointerExit:r.on}}function bd(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 xd(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 Ed(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 kd(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,u=t[s].x,c=t[s].y;l>o!=c>o&&n<(u-a)*(o-l)/(c-l)+a&&(r=!r)}return r}function Sd(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),Cd(t)}function Cd(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 Nd(e){const t=fe(),n=oe(()=>t.value?.width??0),o=oe(()=>t.value?.height??0);return it(()=>{const r=hc(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,u;if("borderBoxSize"in a){const c=a.borderBoxSize,d=Array.isArray(c)?c[0]:c;l=d.inlineSize,u=d.blockSize}else l=r.offsetWidth,u=r.offsetHeight;t.value={width:l,height:u}});return i.observe(r,{box:"border-box"}),()=>i.unobserve(r)}else t.value=void 0}),{width:n,height:o}}const[Ja,Td]=cr("PopperRoot");var Pd=ye({inheritAttrs:!1,__name:"PopperRoot",setup(e){const t=fe();return Td({anchor:t,onAnchorChange:n=>t.value=n}),(n,o)=>ke(n.$slots,"default")}}),Ad=Pd,Id=ye({__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}=dt(),r=Ja();return qa(()=>{r.onAnchorChange(t.reference??o.value)}),(i,s)=>(j(),be(S(ar),{ref:S(n),as:i.as,"as-child":i.asChild},{default:pe(()=>[ke(i.$slots,"default")]),_:3},8,["as","as-child"]))}}),Od=Id;const Rd={key:0,d:"M0 0L6 6L12 0"},Md={key:1,d:"M0 0L4.58579 4.58579C5.36683 5.36683 6.63316 5.36684 7.41421 4.58579L12 0"};var Ld=ye({__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 dt(),(n,o)=>(j(),be(S(ar),tt(t,{width:n.width,height:n.height,viewBox:n.asChild?void 0:"0 0 12 6",preserveAspectRatio:n.asChild?void 0:"none"}),{default:pe(()=>[ke(n.$slots,"default",{},()=>[n.rounded?(j(),ee("path",Md)):(j(),ee("path",Rd))])]),_:3},16,["width","height","viewBox","preserveAspectRatio"]))}}),Dd=Ld;function $d(e){return e!==null}function Bd(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,[u,c]=Qr(n),d={start:"0%",center:"50%",end:"100%"}[c],h=(r.arrow?.x??0)+a/2,f=(r.arrow?.y??0)+l/2;let p="",v="";return u==="bottom"?(p=s?d:`${h}px`,v=`${-l}px`):u==="top"?(p=s?d:`${h}px`,v=`${o.floating.height+l}px`):u==="right"?(p=`${-l}px`,v=s?d:`${f}px`):u==="left"&&(p=`${o.floating.width+l}px`,v=s?d:`${f}px`),{data:{x:p,y:v}}}}}function Qr(e){const[t,n="center"]=e.split("-");return[t,n]}const zd=["top","right","bottom","left"],Vt=Math.min,Je=Math.max,Do=Math.round,co=Math.floor,wt=e=>({x:e,y:e}),Vd={left:"right",right:"left",bottom:"top",top:"bottom"},Fd={start:"end",end:"start"};function ei(e,t,n){return Je(e,Vt(t,n))}function It(e,t){return typeof e=="function"?e(t):e}function Ot(e){return e.split("-")[0]}function Tn(e){return e.split("-")[1]}function Ri(e){return e==="x"?"y":"x"}function Mi(e){return e==="y"?"height":"width"}const Hd=new Set(["top","bottom"]);function _t(e){return Hd.has(Ot(e))?"y":"x"}function Li(e){return Ri(_t(e))}function Gd(e,t,n){n===void 0&&(n=!1);const o=Tn(e),r=Li(e),i=Mi(r);let s=r==="x"?o===(n?"end":"start")?"right":"left":o==="start"?"bottom":"top";return t.reference[i]>t.floating[i]&&(s=$o(s)),[s,$o(s)]}function jd(e){const t=$o(e);return[ti(e),t,ti(t)]}function ti(e){return e.replace(/start|end/g,t=>Fd[t])}const fs=["left","right"],hs=["right","left"],qd=["top","bottom"],Ud=["bottom","top"];function Wd(e,t,n){switch(e){case"top":case"bottom":return n?t?hs:fs:t?fs:hs;case"left":case"right":return t?qd:Ud;default:return[]}}function Yd(e,t,n,o){const r=Tn(e);let i=Wd(Ot(e),n==="start",o);return r&&(i=i.map(s=>s+"-"+r),t&&(i=i.concat(i.map(ti)))),i}function $o(e){return e.replace(/left|right|bottom|top/g,t=>Vd[t])}function Xd(e){return{top:0,right:0,bottom:0,left:0,...e}}function Qa(e){return typeof e!="number"?Xd(e):{top:e,right:e,bottom:e,left:e}}function Bo(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 ps(e,t,n){let{reference:o,floating:r}=e;const i=_t(t),s=Li(t),a=Mi(s),l=Ot(t),u=i==="y",c=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:c,y:o.y-r.height};break;case"bottom":f={x:c,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(Tn(t)){case"start":f[s]-=h*(n&&u?-1:1);break;case"end":f[s]+=h*(n&&u?-1:1);break}return f}async function Kd(e,t){var n;t===void 0&&(t={});const{x:o,y:r,platform:i,rects:s,elements:a,strategy:l}=e,{boundary:u="clippingAncestors",rootBoundary:c="viewport",elementContext:d="floating",altBoundary:h=!1,padding:f=0}=It(t,e),p=Qa(f),_=a[h?d==="floating"?"reference":"floating":d],y=Bo(await i.getClippingRect({element:(n=await(i.isElement==null?void 0:i.isElement(_)))==null||n?_:_.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(a.floating)),boundary:u,rootBoundary:c,strategy:l})),b=d==="floating"?{x:o,y:r,width:s.floating.width,height:s.floating.height}:s.reference,g=await(i.getOffsetParent==null?void 0:i.getOffsetParent(a.floating)),w=await(i.isElement==null?void 0:i.isElement(g))?await(i.getScale==null?void 0:i.getScale(g))||{x:1,y:1}:{x:1,y:1},T=Bo(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:a,rect:b,offsetParent:g,strategy:l}):b);return{top:(y.top-T.top+p.top)/w.y,bottom:(T.bottom-y.bottom+p.bottom)/w.y,left:(y.left-T.left+p.left)/w.x,right:(T.right-y.right+p.right)/w.x}}const Zd=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 u=await s.getElementRects({reference:e,floating:t,strategy:r}),{x:c,y:d}=ps(u,o,l),h=o,f={},p=0;for(let _=0;_<a.length;_++){var v;const{name:y,fn:b}=a[_],{x:g,y:w,data:T,reset:M}=await b({x:c,y:d,initialPlacement:o,placement:h,strategy:r,middlewareData:f,rects:u,platform:{...s,detectOverflow:(v=s.detectOverflow)!=null?v:Kd},elements:{reference:e,floating:t}});c=g??c,d=w??d,f={...f,[y]:{...f[y],...T}},M&&p<=50&&(p++,typeof M=="object"&&(M.placement&&(h=M.placement),M.rects&&(u=M.rects===!0?await s.getElementRects({reference:e,floating:t,strategy:r}):M.rects),{x:c,y:d}=ps(u,h,l)),_=-1)}return{x:c,y:d,placement:h,strategy:r,middlewareData:f}},Jd=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:u,padding:c=0}=It(e,t)||{};if(u==null)return{};const d=Qa(c),h={x:n,y:o},f=Li(r),p=Mi(f),v=await s.getDimensions(u),_=f==="y",y=_?"top":"left",b=_?"bottom":"right",g=_?"clientHeight":"clientWidth",w=i.reference[p]+i.reference[f]-h[f]-i.floating[p],T=h[f]-i.reference[f],M=await(s.getOffsetParent==null?void 0:s.getOffsetParent(u));let z=M?M[g]:0;(!z||!await(s.isElement==null?void 0:s.isElement(M)))&&(z=a.floating[g]||i.floating[p]);const H=w/2-T/2,K=z/2-v[p]/2-1,P=Vt(d[y],K),C=Vt(d[b],K),x=P,N=z-v[p]-C,m=z/2-v[p]/2+H,A=ei(x,m,N),k=!l.arrow&&Tn(r)!=null&&m!==A&&i.reference[p]/2-(m<x?P:C)-v[p]/2<0,O=k?m<x?m-x:m-N:0;return{[f]:h[f]+O,data:{[f]:A,centerOffset:m-A-O,...k&&{alignmentOffset:O}},reset:k}}}),Qd=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:u}=t,{mainAxis:c=!0,crossAxis:d=!0,fallbackPlacements:h,fallbackStrategy:f="bestFit",fallbackAxisSideDirection:p="none",flipAlignment:v=!0,..._}=It(e,t);if((n=i.arrow)!=null&&n.alignmentOffset)return{};const y=Ot(r),b=_t(a),g=Ot(a)===a,w=await(l.isRTL==null?void 0:l.isRTL(u.floating)),T=h||(g||!v?[$o(a)]:jd(a)),M=p!=="none";!h&&M&&T.push(...Yd(a,v,p,w));const z=[a,...T],H=await l.detectOverflow(t,_),K=[];let P=((o=i.flip)==null?void 0:o.overflows)||[];if(c&&K.push(H[y]),d){const m=Gd(r,s,w);K.push(H[m[0]],H[m[1]])}if(P=[...P,{placement:r,overflows:K}],!K.every(m=>m<=0)){var C,x;const m=(((C=i.flip)==null?void 0:C.index)||0)+1,A=z[m];if(A&&(!(d==="alignment"?b!==_t(A):!1)||P.every(L=>_t(L.placement)===b?L.overflows[0]>0:!0)))return{data:{index:m,overflows:P},reset:{placement:A}};let k=(x=P.filter(O=>O.overflows[0]<=0).sort((O,L)=>O.overflows[1]-L.overflows[1])[0])==null?void 0:x.placement;if(!k)switch(f){case"bestFit":{var N;const O=(N=P.filter(L=>{if(M){const F=_t(L.placement);return F===b||F==="y"}return!0}).map(L=>[L.placement,L.overflows.filter(F=>F>0).reduce((F,G)=>F+G,0)]).sort((L,F)=>L[1]-F[1])[0])==null?void 0:N[0];O&&(k=O);break}case"initialPlacement":k=a;break}if(r!==k)return{reset:{placement:k}}}return{}}}};function gs(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function ms(e){return zd.some(t=>e[t]>=0)}const ef=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n,platform:o}=t,{strategy:r="referenceHidden",...i}=It(e,t);switch(r){case"referenceHidden":{const s=await o.detectOverflow(t,{...i,elementContext:"reference"}),a=gs(s,n.reference);return{data:{referenceHiddenOffsets:a,referenceHidden:ms(a)}}}case"escaped":{const s=await o.detectOverflow(t,{...i,altBoundary:!0}),a=gs(s,n.floating);return{data:{escapedOffsets:a,escaped:ms(a)}}}default:return{}}}}},el=new Set(["left","top"]);async function tf(e,t){const{placement:n,platform:o,elements:r}=e,i=await(o.isRTL==null?void 0:o.isRTL(r.floating)),s=Ot(n),a=Tn(n),l=_t(n)==="y",u=el.has(s)?-1:1,c=i&&l?-1:1,d=It(t,e);let{mainAxis:h,crossAxis:f,alignmentAxis:p}=typeof d=="number"?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return a&&typeof p=="number"&&(f=a==="end"?p*-1:p),l?{x:f*c,y:h*u}:{x:h*u,y:f*c}}const nf=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 tf(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}}}}},of=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:y=>{let{x:b,y:g}=y;return{x:b,y:g}}},...u}=It(e,t),c={x:n,y:o},d=await i.detectOverflow(t,u),h=_t(Ot(r)),f=Ri(h);let p=c[f],v=c[h];if(s){const y=f==="y"?"top":"left",b=f==="y"?"bottom":"right",g=p+d[y],w=p-d[b];p=ei(g,p,w)}if(a){const y=h==="y"?"top":"left",b=h==="y"?"bottom":"right",g=v+d[y],w=v-d[b];v=ei(g,v,w)}const _=l.fn({...t,[f]:p,[h]:v});return{..._,data:{x:_.x-n,y:_.y-o,enabled:{[f]:s,[h]:a}}}}}},rf=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:u=!0}=It(e,t),c={x:n,y:o},d=_t(r),h=Ri(d);let f=c[h],p=c[d];const v=It(a,t),_=typeof v=="number"?{mainAxis:v,crossAxis:0}:{mainAxis:0,crossAxis:0,...v};if(l){const g=h==="y"?"height":"width",w=i.reference[h]-i.floating[g]+_.mainAxis,T=i.reference[h]+i.reference[g]-_.mainAxis;f<w?f=w:f>T&&(f=T)}if(u){var y,b;const g=h==="y"?"width":"height",w=el.has(Ot(r)),T=i.reference[d]-i.floating[g]+(w&&((y=s.offset)==null?void 0:y[d])||0)+(w?0:_.crossAxis),M=i.reference[d]+i.reference[g]+(w?0:((b=s.offset)==null?void 0:b[d])||0)-(w?_.crossAxis:0);p<T?p=T:p>M&&(p=M)}return{[h]:f,[d]:p}}}},sf=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=()=>{},...u}=It(e,t),c=await s.detectOverflow(t,u),d=Ot(r),h=Tn(r),f=_t(r)==="y",{width:p,height:v}=i.floating;let _,y;d==="top"||d==="bottom"?(_=d,y=h===(await(s.isRTL==null?void 0:s.isRTL(a.floating))?"start":"end")?"left":"right"):(y=d,_=h==="end"?"top":"bottom");const b=v-c.top-c.bottom,g=p-c.left-c.right,w=Vt(v-c[_],b),T=Vt(p-c[y],g),M=!t.middlewareData.shift;let z=w,H=T;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(H=g),(o=t.middlewareData.shift)!=null&&o.enabled.y&&(z=b),M&&!h){const P=Je(c.left,0),C=Je(c.right,0),x=Je(c.top,0),N=Je(c.bottom,0);f?H=p-2*(P!==0||C!==0?P+C:Je(c.left,c.right)):z=v-2*(x!==0||N!==0?x+N:Je(c.top,c.bottom))}await l({...t,availableWidth:H,availableHeight:z});const K=await s.getDimensions(a.floating);return p!==K.width||v!==K.height?{reset:{rects:!0}}:{}}}};function dr(){return typeof window<"u"}function tn(e){return Di(e)?(e.nodeName||"").toLowerCase():"#document"}function Qe(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function Et(e){var t;return(t=(Di(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function Di(e){return dr()?e instanceof Node||e instanceof Qe(e).Node:!1}function lt(e){return dr()?e instanceof Element||e instanceof Qe(e).Element:!1}function xt(e){return dr()?e instanceof HTMLElement||e instanceof Qe(e).HTMLElement:!1}function vs(e){return!dr()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof Qe(e).ShadowRoot}const af=new Set(["inline","contents"]);function ro(e){const{overflow:t,overflowX:n,overflowY:o,display:r}=ut(e);return/auto|scroll|overlay|hidden|clip/.test(t+o+n)&&!af.has(r)}const lf=new Set(["table","td","th"]);function uf(e){return lf.has(tn(e))}const cf=[":popover-open",":modal"];function fr(e){return cf.some(t=>{try{return e.matches(t)}catch{return!1}})}const df=["transform","translate","scale","rotate","perspective"],ff=["transform","translate","scale","rotate","perspective","filter"],hf=["paint","layout","strict","content"];function $i(e){const t=Bi(),n=lt(e)?ut(e):e;return df.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)||ff.some(o=>(n.willChange||"").includes(o))||hf.some(o=>(n.contain||"").includes(o))}function pf(e){let t=Ft(e);for(;xt(t)&&!_n(t);){if($i(t))return t;if(fr(t))return null;t=Ft(t)}return null}function Bi(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const gf=new Set(["html","body","#document"]);function _n(e){return gf.has(tn(e))}function ut(e){return Qe(e).getComputedStyle(e)}function hr(e){return lt(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Ft(e){if(tn(e)==="html")return e;const t=e.assignedSlot||e.parentNode||vs(e)&&e.host||Et(e);return vs(t)?t.host:t}function tl(e){const t=Ft(e);return _n(t)?e.ownerDocument?e.ownerDocument.body:e.body:xt(t)&&ro(t)?t:tl(t)}function qn(e,t,n){var o;t===void 0&&(t=[]),n===void 0&&(n=!0);const r=tl(e),i=r===((o=e.ownerDocument)==null?void 0:o.body),s=Qe(r);if(i){const a=ni(s);return t.concat(s,s.visualViewport||[],ro(r)?r:[],a&&n?qn(a):[])}return t.concat(r,qn(r,[],n))}function ni(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function nl(e){const t=ut(e);let n=parseFloat(t.width)||0,o=parseFloat(t.height)||0;const r=xt(e),i=r?e.offsetWidth:n,s=r?e.offsetHeight:o,a=Do(n)!==i||Do(o)!==s;return a&&(n=i,o=s),{width:n,height:o,$:a}}function zi(e){return lt(e)?e:e.contextElement}function dn(e){const t=zi(e);if(!xt(t))return wt(1);const n=t.getBoundingClientRect(),{width:o,height:r,$:i}=nl(t);let s=(i?Do(n.width):n.width)/o,a=(i?Do(n.height):n.height)/r;return(!s||!Number.isFinite(s))&&(s=1),(!a||!Number.isFinite(a))&&(a=1),{x:s,y:a}}const mf=wt(0);function ol(e){const t=Qe(e);return!Bi()||!t.visualViewport?mf:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function vf(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==Qe(e)?!1:t}function Zt(e,t,n,o){t===void 0&&(t=!1),n===void 0&&(n=!1);const r=e.getBoundingClientRect(),i=zi(e);let s=wt(1);t&&(o?lt(o)&&(s=dn(o)):s=dn(e));const a=vf(i,n,o)?ol(i):wt(0);let l=(r.left+a.x)/s.x,u=(r.top+a.y)/s.y,c=r.width/s.x,d=r.height/s.y;if(i){const h=Qe(i),f=o&&lt(o)?Qe(o):o;let p=h,v=ni(p);for(;v&&o&&f!==p;){const _=dn(v),y=v.getBoundingClientRect(),b=ut(v),g=y.left+(v.clientLeft+parseFloat(b.paddingLeft))*_.x,w=y.top+(v.clientTop+parseFloat(b.paddingTop))*_.y;l*=_.x,u*=_.y,c*=_.x,d*=_.y,l+=g,u+=w,p=Qe(v),v=ni(p)}}return Bo({width:c,height:d,x:l,y:u})}function pr(e,t){const n=hr(e).scrollLeft;return t?t.left+n:Zt(Et(e)).left+n}function rl(e,t){const n=e.getBoundingClientRect(),o=n.left+t.scrollLeft-pr(e,n),r=n.top+t.scrollTop;return{x:o,y:r}}function yf(e){let{elements:t,rect:n,offsetParent:o,strategy:r}=e;const i=r==="fixed",s=Et(o),a=t?fr(t.floating):!1;if(o===s||a&&i)return n;let l={scrollLeft:0,scrollTop:0},u=wt(1);const c=wt(0),d=xt(o);if((d||!d&&!i)&&((tn(o)!=="body"||ro(s))&&(l=hr(o)),xt(o))){const f=Zt(o);u=dn(o),c.x=f.x+o.clientLeft,c.y=f.y+o.clientTop}const h=s&&!d&&!i?rl(s,l):wt(0);return{width:n.width*u.x,height:n.height*u.y,x:n.x*u.x-l.scrollLeft*u.x+c.x+h.x,y:n.y*u.y-l.scrollTop*u.y+c.y+h.y}}function _f(e){return Array.from(e.getClientRects())}function wf(e){const t=Et(e),n=hr(e),o=e.ownerDocument.body,r=Je(t.scrollWidth,t.clientWidth,o.scrollWidth,o.clientWidth),i=Je(t.scrollHeight,t.clientHeight,o.scrollHeight,o.clientHeight);let s=-n.scrollLeft+pr(e);const a=-n.scrollTop;return ut(o).direction==="rtl"&&(s+=Je(t.clientWidth,o.clientWidth)-r),{width:r,height:i,x:s,y:a}}const ys=25;function bf(e,t){const n=Qe(e),o=Et(e),r=n.visualViewport;let i=o.clientWidth,s=o.clientHeight,a=0,l=0;if(r){i=r.width,s=r.height;const c=Bi();(!c||c&&t==="fixed")&&(a=r.offsetLeft,l=r.offsetTop)}const u=pr(o);if(u<=0){const c=o.ownerDocument,d=c.body,h=getComputedStyle(d),f=c.compatMode==="CSS1Compat"&&parseFloat(h.marginLeft)+parseFloat(h.marginRight)||0,p=Math.abs(o.clientWidth-d.clientWidth-f);p<=ys&&(i-=p)}else u<=ys&&(i+=u);return{width:i,height:s,x:a,y:l}}const xf=new Set(["absolute","fixed"]);function Ef(e,t){const n=Zt(e,!0,t==="fixed"),o=n.top+e.clientTop,r=n.left+e.clientLeft,i=xt(e)?dn(e):wt(1),s=e.clientWidth*i.x,a=e.clientHeight*i.y,l=r*i.x,u=o*i.y;return{width:s,height:a,x:l,y:u}}function _s(e,t,n){let o;if(t==="viewport")o=bf(e,n);else if(t==="document")o=wf(Et(e));else if(lt(t))o=Ef(t,n);else{const r=ol(e);o={x:t.x-r.x,y:t.y-r.y,width:t.width,height:t.height}}return Bo(o)}function il(e,t){const n=Ft(e);return n===t||!lt(n)||_n(n)?!1:ut(n).position==="fixed"||il(n,t)}function kf(e,t){const n=t.get(e);if(n)return n;let o=qn(e,[],!1).filter(a=>lt(a)&&tn(a)!=="body"),r=null;const i=ut(e).position==="fixed";let s=i?Ft(e):e;for(;lt(s)&&!_n(s);){const a=ut(s),l=$i(s);!l&&a.position==="fixed"&&(r=null),(i?!l&&!r:!l&&a.position==="static"&&!!r&&xf.has(r.position)||ro(s)&&!l&&il(e,s))?o=o.filter(c=>c!==s):r=a,s=Ft(s)}return t.set(e,o),o}function Sf(e){let{element:t,boundary:n,rootBoundary:o,strategy:r}=e;const s=[...n==="clippingAncestors"?fr(t)?[]:kf(t,this._c):[].concat(n),o],a=s[0],l=s.reduce((u,c)=>{const d=_s(t,c,r);return u.top=Je(d.top,u.top),u.right=Vt(d.right,u.right),u.bottom=Vt(d.bottom,u.bottom),u.left=Je(d.left,u.left),u},_s(t,a,r));return{width:l.right-l.left,height:l.bottom-l.top,x:l.left,y:l.top}}function Cf(e){const{width:t,height:n}=nl(e);return{width:t,height:n}}function Nf(e,t,n){const o=xt(t),r=Et(t),i=n==="fixed",s=Zt(e,!0,i,t);let a={scrollLeft:0,scrollTop:0};const l=wt(0);function u(){l.x=pr(r)}if(o||!o&&!i)if((tn(t)!=="body"||ro(r))&&(a=hr(t)),o){const f=Zt(t,!0,i,t);l.x=f.x+t.clientLeft,l.y=f.y+t.clientTop}else r&&u();i&&!o&&r&&u();const c=r&&!o&&!i?rl(r,a):wt(0),d=s.left+a.scrollLeft-l.x-c.x,h=s.top+a.scrollTop-l.y-c.y;return{x:d,y:h,width:s.width,height:s.height}}function Ir(e){return ut(e).position==="static"}function ws(e,t){if(!xt(e)||ut(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return Et(e)===n&&(n=n.ownerDocument.body),n}function sl(e,t){const n=Qe(e);if(fr(e))return n;if(!xt(e)){let r=Ft(e);for(;r&&!_n(r);){if(lt(r)&&!Ir(r))return r;r=Ft(r)}return n}let o=ws(e,t);for(;o&&uf(o)&&Ir(o);)o=ws(o,t);return o&&_n(o)&&Ir(o)&&!$i(o)?n:o||pf(e)||n}const Tf=async function(e){const t=this.getOffsetParent||sl,n=this.getDimensions,o=await n(e.floating);return{reference:Nf(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:o.width,height:o.height}}};function Pf(e){return ut(e).direction==="rtl"}const Af={convertOffsetParentRelativeRectToViewportRelativeRect:yf,getDocumentElement:Et,getClippingRect:Sf,getOffsetParent:sl,getElementRects:Tf,getClientRects:_f,getDimensions:Cf,getScale:dn,isElement:lt,isRTL:Pf};function al(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function If(e,t){let n=null,o;const r=Et(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 u=e.getBoundingClientRect(),{left:c,top:d,width:h,height:f}=u;if(a||t(),!h||!f)return;const p=co(d),v=co(r.clientWidth-(c+h)),_=co(r.clientHeight-(d+f)),y=co(c),g={rootMargin:-p+"px "+-v+"px "+-_+"px "+-y+"px",threshold:Je(0,Vt(1,l))||1};let w=!0;function T(M){const z=M[0].intersectionRatio;if(z!==l){if(!w)return s();z?s(!1,z):o=setTimeout(()=>{s(!1,1e-7)},1e3)}z===1&&!al(u,e.getBoundingClientRect())&&s(),w=!1}try{n=new IntersectionObserver(T,{...g,root:r.ownerDocument})}catch{n=new IntersectionObserver(T,g)}n.observe(e)}return s(!0),i}function Of(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,u=zi(e),c=r||i?[...u?qn(u):[],...qn(t)]:[];c.forEach(y=>{r&&y.addEventListener("scroll",n,{passive:!0}),i&&y.addEventListener("resize",n)});const d=u&&a?If(u,n):null;let h=-1,f=null;s&&(f=new ResizeObserver(y=>{let[b]=y;b&&b.target===u&&f&&(f.unobserve(t),cancelAnimationFrame(h),h=requestAnimationFrame(()=>{var g;(g=f)==null||g.observe(t)})),n()}),u&&!l&&f.observe(u),f.observe(t));let p,v=l?Zt(e):null;l&&_();function _(){const y=Zt(e);v&&!al(v,y)&&n(),v=y,p=requestAnimationFrame(_)}return n(),()=>{var y;c.forEach(b=>{r&&b.removeEventListener("scroll",n),i&&b.removeEventListener("resize",n)}),d?.(),(y=f)==null||y.disconnect(),f=null,l&&cancelAnimationFrame(p)}}const Rf=nf,Mf=of,bs=Qd,Lf=sf,Df=ef,$f=Jd,Bf=rf,zf=(e,t,n)=>{const o=new Map,r={platform:Af,...n},i={...r.platform,_c:o};return Zd(e,t,{...r,platform:i})};function Vf(e){return e!=null&&typeof e=="object"&&"$el"in e}function oi(e){if(Vf(e)){const t=e.$el;return Di(t)&&tn(t)==="#comment"?null:t}return e}function ln(e){return typeof e=="function"?e():S(e)}function Ff(e){return{name:"arrow",options:e,fn(t){const n=oi(ln(e.element));return n==null?{}:$f({element:n,padding:e.padding}).fn(t)}}}function ll(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function xs(e,t){const n=ll(e);return Math.round(t*n)/n}function Hf(e,t,n){n===void 0&&(n={});const o=n.whileElementsMounted,r=oe(()=>{var z;return(z=ln(n.open))!=null?z:!0}),i=oe(()=>ln(n.middleware)),s=oe(()=>{var z;return(z=ln(n.placement))!=null?z:"bottom"}),a=oe(()=>{var z;return(z=ln(n.strategy))!=null?z:"absolute"}),l=oe(()=>{var z;return(z=ln(n.transform))!=null?z:!0}),u=oe(()=>oi(e.value)),c=oe(()=>oi(t.value)),d=fe(0),h=fe(0),f=fe(a.value),p=fe(s.value),v=Nt({}),_=fe(!1),y=oe(()=>{const z={position:f.value,left:"0",top:"0"};if(!c.value)return z;const H=xs(c.value,d.value),K=xs(c.value,h.value);return l.value?{...z,transform:"translate("+H+"px, "+K+"px)",...ll(c.value)>=1.5&&{willChange:"transform"}}:{position:f.value,left:H+"px",top:K+"px"}});let b;function g(){if(u.value==null||c.value==null)return;const z=r.value;zf(u.value,c.value,{middleware:i.value,placement:s.value,strategy:a.value}).then(H=>{d.value=H.x,h.value=H.y,f.value=H.strategy,p.value=H.placement,v.value=H.middlewareData,_.value=z!==!1})}function w(){typeof b=="function"&&(b(),b=void 0)}function T(){if(w(),o===void 0){g();return}if(u.value!=null&&c.value!=null){b=o(u.value,c.value,g);return}}function M(){r.value||(_.value=!1)}return Ee([i,s,a,r],g,{flush:"sync"}),Ee([u,c],T,{flush:"sync"}),Ee(r,M,{flush:"sync"}),Ai()&&zn(w),{x:on(d),y:on(h),strategy:on(f),placement:on(p),middlewareData:on(v),isPositioned:on(_),floatingStyles:y,update:g}}const Gf={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},[jf,qf]=cr("PopperContent");var Uf=ye({inheritAttrs:!1,__name:"PopperContent",props:_c({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}},{...Gf}),emits:["placed"],setup(e,{emit:t}){const n=e,o=t,r=Ja(),{forwardRef:i,currentElement:s}=dt(),a=fe(),l=fe(),{width:u,height:c}=Nd(l),d=oe(()=>n.side+(n.align!=="center"?`-${n.align}`:"")),h=oe(()=>typeof n.collisionPadding=="number"?n.collisionPadding:{top:0,right:0,bottom:0,left:0,...n.collisionPadding}),f=oe(()=>Array.isArray(n.collisionBoundary)?n.collisionBoundary:[n.collisionBoundary]),p=oe(()=>({padding:h.value,boundary:f.value.filter($d),altBoundary:f.value.length>0})),v=oe(()=>({mainAxis:n.sideFlip,crossAxis:n.alignFlip})),_=pc(()=>[Rf({mainAxis:n.sideOffset+c.value,alignmentAxis:n.alignOffset}),n.prioritizePosition&&n.avoidCollisions&&bs({...p.value,...v.value}),n.avoidCollisions&&Mf({mainAxis:!0,crossAxis:!!n.prioritizePosition,limiter:n.sticky==="partial"?Bf():void 0,...p.value}),!n.prioritizePosition&&n.avoidCollisions&&bs({...p.value,...v.value}),Lf({...p.value,apply:({elements:x,rects:N,availableWidth:m,availableHeight:A})=>{const{width:k,height:O}=N.reference,L=x.floating.style;L.setProperty("--reka-popper-available-width",`${m}px`),L.setProperty("--reka-popper-available-height",`${A}px`),L.setProperty("--reka-popper-anchor-width",`${k}px`),L.setProperty("--reka-popper-anchor-height",`${O}px`)}}),l.value&&Ff({element:l.value,padding:n.arrowPadding}),Bd({arrowWidth:u.value,arrowHeight:c.value}),n.hideWhenDetached&&Df({strategy:"referenceHidden",...p.value})]),y=oe(()=>n.reference??r.anchor.value),{floatingStyles:b,placement:g,isPositioned:w,middlewareData:T}=Hf(y,a,{strategy:n.positionStrategy,placement:d,whileElementsMounted:(...x)=>Of(...x,{layoutShift:!n.disableUpdateOnLayoutShift,animationFrame:n.updatePositionStrategy==="always"}),middleware:_}),M=oe(()=>Qr(g.value)[0]),z=oe(()=>Qr(g.value)[1]);qa(()=>{w.value&&o("placed")});const H=oe(()=>{const x=T.value.arrow?.centerOffset!==0;return n.hideShiftedArrow&&x}),K=fe("");Zr(()=>{s.value&&(K.value=window.getComputedStyle(s.value).zIndex)});const P=oe(()=>T.value.arrow?.x??0),C=oe(()=>T.value.arrow?.y??0);return qf({placedSide:M,onArrowChange:x=>l.value=x,arrowX:P,arrowY:C,shouldHideArrow:H}),(x,N)=>(j(),ee("div",{ref_key:"floatingRef",ref:a,"data-reka-popper-content-wrapper":"",style:Xe({...S(b),transform:S(w)?S(b).transform:"translate(0, -200%)",minWidth:"max-content",zIndex:K.value,"--reka-popper-transform-origin":[S(T).transformOrigin?.x,S(T).transformOrigin?.y].join(" "),...S(T).hide?.referenceHidden&&{visibility:"hidden",pointerEvents:"none"}})},[ie(S(ar),tt({ref:S(i)},x.$attrs,{"as-child":n.asChild,as:x.as,"data-side":M.value,"data-align":z.value,style:{animation:S(w)?void 0:"none"}}),{default:pe(()=>[ke(x.$slots,"default")]),_:3},16,["as-child","as","data-side","data-align","style"])],4))}}),Wf=Uf;const Yf={top:"bottom",right:"left",bottom:"top",left:"right"};var Xf=ye({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}=dt(),n=jf(),o=oe(()=>Yf[n.placedSide.value]);return(r,i)=>(j(),ee("span",{ref:s=>{S(n).onArrowChange(s)},style:Xe({position:"absolute",left:S(n).arrowX?.value?`${S(n).arrowX?.value}px`:void 0,top:S(n).arrowY?.value?`${S(n).arrowY?.value}px`:void 0,[o.value]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[S(n).placedSide.value],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[S(n).placedSide.value],visibility:S(n).shouldHideArrow.value?"hidden":void 0})},[ie(Dd,tt(r.$attrs,{ref:S(t),style:{display:"block"},as:r.as,"as-child":r.asChild,rounded:r.rounded,width:r.width,height:r.height}),{default:pe(()=>[ke(r.$slots,"default")]),_:3},16,["as","as-child","rounded","width","height"])],4))}}),Kf=Xf,Zf=ye({__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 dt(),(n,o)=>(j(),be(S(Kf),lr(ur(t)),{default:pe(()=>[ke(n.$slots,"default")]),_:3},16))}}),Jf=Zf;const[Vi,Qf]=cr("TooltipProvider");var eh=ye({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}=Ua(t);dt();const l=fe(!0),u=fe(!1),{start:c,stop:d}=Ha(()=>{l.value=!0},o,{immediate:!1});return Qf({isOpenDelayed:l,delayDuration:n,onOpen(){d(),l.value=!1},onClose(){c()},isPointerInTransitRef:u,disableHoverableContent:r,disableClosingTrigger:i,disabled:a,ignoreNonKeyboardFocus:s}),(h,f)=>ke(h.$slots,"default")}}),th=eh;const ul="tooltip.open",[gr,nh]=cr("TooltipRoot");var oh=ye({__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;dt();const r=Vi(),i=oe(()=>n.disableHoverableContent??r.disableHoverableContent.value),s=oe(()=>n.disableClosingTrigger??r.disableClosingTrigger.value),a=oe(()=>n.disabled??r.disabled.value),l=oe(()=>n.delayDuration??r.delayDuration.value),u=oe(()=>n.ignoreNonKeyboardFocus??r.ignoreNonKeyboardFocus.value),c=gc(n,"open",o,{defaultValue:n.defaultOpen,passive:n.open===void 0});Ee(c,g=>{r.onClose&&(g?(r.onOpen(),document.dispatchEvent(new CustomEvent(ul))):r.onClose())});const d=fe(!1),h=fe(),f=oe(()=>c.value?d.value?"delayed-open":"instant-open":"closed"),{start:p,stop:v}=Ha(()=>{d.value=!0,c.value=!0},l,{immediate:!1});function _(){v(),d.value=!1,c.value=!0}function y(){v(),c.value=!1}function b(){p()}return nh({contentId:"",open:c,stateAttribute:f,trigger:h,onTriggerChange(g){h.value=g},onTriggerEnter(){r.isOpenDelayed.value?b():_()},onTriggerLeave(){i.value?y():v()},onOpen:_,onClose:y,disableHoverableContent:i,disableClosingTrigger:s,disabled:a,ignoreNonKeyboardFocus:u}),(g,w)=>(j(),be(S(Ad),null,{default:pe(()=>[ke(g.$slots,"default",{open:S(c)})]),_:3}))}}),rh=oh,ih=ye({__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=gr(),{forwardRef:i,currentElement:s}=dt(),a=oe(()=>n.ariaLabel||s.value?.textContent),l=oe(()=>{const{ariaLabel:u,...c}=n;return c});return it(()=>{us(window,"scroll",u=>{u.target?.contains(r.trigger.value)&&r.onClose()}),us(window,ul,r.onClose)}),(u,c)=>(j(),be(S(Rc),{"as-child":"","disable-outside-pointer-events":!1,onEscapeKeyDown:c[0]||(c[0]=d=>o("escapeKeyDown",d)),onPointerDownOutside:c[1]||(c[1]=d=>{S(r).disableClosingTrigger.value&&S(r).trigger.value?.contains(d.target)&&d.preventDefault(),o("pointerDownOutside",d)}),onFocusOutside:c[2]||(c[2]=wc(()=>{},["prevent"])),onDismiss:c[3]||(c[3]=d=>S(r).onClose())},{default:pe(()=>[ie(S(Wf),tt({ref:S(i),"data-state":S(r).stateAttribute.value},{...u.$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:pe(()=>[ke(u.$slots,"default"),ie(S(Oc),{id:S(r).contentId,role:"tooltip"},{default:pe(()=>[Te(ge(a.value),1)]),_:1},8,["id"])]),_:3},16,["data-state"])]),_:3}))}}),cl=ih,sh=ye({__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=Mc(e),{forwardRef:o,currentElement:r}=dt(),{trigger:i,onClose:s}=gr(),a=Vi(),{isPointerInTransit:l,onPointerExit:u}=wd(i,r);return a.isPointerInTransitRef=l,u(()=>{s()}),(c,d)=>(j(),be(cl,tt({ref:S(o)},S(n)),{default:pe(()=>[ke(c.$slots,"default")]),_:3},16))}}),ah=sh,lh=ye({__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=gr(),i=Oi(n,o),{forwardRef:s}=dt();return(a,l)=>(j(),be(S(Lc),{present:a.forceMount||S(r).open.value},{default:pe(()=>[(j(),be(ot(S(r).disableHoverableContent.value?cl:ah),tt({ref:S(s)},S(i)),{default:pe(()=>[ke(a.$slots,"default")]),_:3},16))]),_:3},8,["present"]))}}),uh=lh,ch=ye({__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(),be(S(Dc),lr(ur(t)),{default:pe(()=>[ke(n.$slots,"default")]),_:3},16))}}),dh=ch,fh=ye({__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=gr(),o=Vi();n.contentId||=$c(void 0,"reka-tooltip-content");const{forwardRef:r,currentElement:i}=dt(),s=fe(!1),a=fe(!1),l=oe(()=>n.disabled.value?{}:{click:v,focus:f,pointermove:d,pointerleave:h,pointerdown:c,blur:p});it(()=>{n.onTriggerChange(i.value)});function u(){setTimeout(()=>{s.value=!1},1)}function c(){n.open&&!n.disableClosingTrigger.value&&n.onClose(),s.value=!0,document.addEventListener("pointerup",u,{once:!0})}function d(_){_.pointerType!=="touch"&&!a.value&&!o.isPointerInTransitRef.value&&(n.onTriggerEnter(),a.value=!0)}function h(){n.onTriggerLeave(),a.value=!1}function f(_){s.value||n.ignoreNonKeyboardFocus.value&&!_.target.matches?.(":focus-visible")||n.onOpen()}function p(){n.onClose()}function v(){n.disableClosingTrigger.value||n.onClose()}return(_,y)=>(j(),be(S(Od),{"as-child":"",reference:_.reference},{default:pe(()=>[ie(S(ar),tt({ref:S(r),"aria-describedby":S(n).open.value?S(n).contentId:void 0,"data-state":S(n).stateAttribute.value,as:_.as,"as-child":t.asChild,"data-grace-area-trigger":""},bc(l.value)),{default:pe(()=>[ke(_.$slots,"default")]),_:3},16,["aria-describedby","data-state","as","as-child"])]),_:3},8,["reference"]))}}),hh=fh;let Be=class extends Error{constructor(t){super(t),this.name="ShikiError"}};function ph(e){return Fi(e)}function Fi(e){return Array.isArray(e)?gh(e):e instanceof RegExp?e:typeof e=="object"?mh(e):e}function gh(e){let t=[];for(let n=0,o=e.length;n<o;n++)t[n]=Fi(e[n]);return t}function mh(e){let t={};for(let n in e)t[n]=Fi(e[n]);return t}function dl(e,...t){return t.forEach(n=>{for(let o in n)e[o]=n[o]}),e}function fl(e){const t=~e.lastIndexOf("/")||~e.lastIndexOf("\\");return t===0?e:~t===e.length-1?fl(e.substring(0,e.length-1)):e.substr(~t+1)}var Or=/\$(\d+)|\${(\d+):\/(downcase|upcase)}/g,fo=class{static hasCaptures(e){return e===null?!1:(Or.lastIndex=0,Or.test(e))}static replaceCaptures(e,t,n){return e.replace(Or,(o,r,i,s)=>{let a=n[parseInt(r||i,10)];if(a){let l=t.substring(a.start,a.end);for(;l[0]===".";)l=l.substring(1);switch(s){case"downcase":return l.toLowerCase();case"upcase":return l.toUpperCase();default:return l}}else return o})}};function hl(e,t){return e<t?-1:e>t?1:0}function pl(e,t){if(e===null&&t===null)return 0;if(!e)return-1;if(!t)return 1;let n=e.length,o=t.length;if(n===o){for(let r=0;r<n;r++){let i=hl(e[r],t[r]);if(i!==0)return i}return 0}return n-o}function Es(e){return!!(/^#[0-9a-f]{6}$/i.test(e)||/^#[0-9a-f]{8}$/i.test(e)||/^#[0-9a-f]{3}$/i.test(e)||/^#[0-9a-f]{4}$/i.test(e))}function gl(e){return e.replace(/[\-\\\{\}\*\+\?\|\^\$\.\,\[\]\(\)\#\s]/g,"\\$&")}var ml=class{constructor(e){this.fn=e}cache=new Map;get(e){if(this.cache.has(e))return this.cache.get(e);const t=this.fn(e);return this.cache.set(e,t),t}},zo=class{constructor(e,t,n){this._colorMap=e,this._defaults=t,this._root=n}static createFromRawTheme(e,t){return this.createFromParsedTheme(_h(e),t)}static createFromParsedTheme(e,t){return bh(e,t)}_cachedMatchRoot=new ml(e=>this._root.match(e));getColorMap(){return this._colorMap.getColorMap()}getDefaults(){return this._defaults}match(e){if(e===null)return this._defaults;const t=e.scopeName,o=this._cachedMatchRoot.get(t).find(r=>vh(e.parent,r.parentScopes));return o?new vl(o.fontStyle,o.foreground,o.background):null}},Rr=class No{constructor(t,n){this.parent=t,this.scopeName=n}static push(t,n){for(const o of n)t=new No(t,o);return t}static from(...t){let n=null;for(let o=0;o<t.length;o++)n=new No(n,t[o]);return n}push(t){return new No(this,t)}getSegments(){let t=this;const n=[];for(;t;)n.push(t.scopeName),t=t.parent;return n.reverse(),n}toString(){return this.getSegments().join(" ")}extends(t){return this===t?!0:this.parent===null?!1:this.parent.extends(t)}getExtensionIfDefined(t){const n=[];let o=this;for(;o&&o!==t;)n.push(o.scopeName),o=o.parent;return o===t?n.reverse():void 0}};function vh(e,t){if(t.length===0)return!0;for(let n=0;n<t.length;n++){let o=t[n],r=!1;if(o===">"){if(n===t.length-1)return!1;o=t[++n],r=!0}for(;e&&!yh(e.scopeName,o);){if(r)return!1;e=e.parent}if(!e)return!1;e=e.parent}return!0}function yh(e,t){return t===e||e.startsWith(t)&&e[t.length]==="."}var vl=class{constructor(e,t,n){this.fontStyle=e,this.foregroundId=t,this.backgroundId=n}};function _h(e){if(!e)return[];if(!e.settings||!Array.isArray(e.settings))return[];let t=e.settings,n=[],o=0;for(let r=0,i=t.length;r<i;r++){let s=t[r];if(!s.settings)continue;let a;if(typeof s.scope=="string"){let d=s.scope;d=d.replace(/^[,]+/,""),d=d.replace(/[,]+$/,""),a=d.split(",")}else Array.isArray(s.scope)?a=s.scope:a=[""];let l=-1;if(typeof s.settings.fontStyle=="string"){l=0;let d=s.settings.fontStyle.split(" ");for(let h=0,f=d.length;h<f;h++)switch(d[h]){case"italic":l=l|1;break;case"bold":l=l|2;break;case"underline":l=l|4;break;case"strikethrough":l=l|8;break}}let u=null;typeof s.settings.foreground=="string"&&Es(s.settings.foreground)&&(u=s.settings.foreground);let c=null;typeof s.settings.background=="string"&&Es(s.settings.background)&&(c=s.settings.background);for(let d=0,h=a.length;d<h;d++){let p=a[d].trim().split(" "),v=p[p.length-1],_=null;p.length>1&&(_=p.slice(0,p.length-1),_.reverse()),n[o++]=new wh(v,_,r,l,u,c)}}return n}var wh=class{constructor(e,t,n,o,r,i){this.scope=e,this.parentScopes=t,this.index=n,this.fontStyle=o,this.foreground=r,this.background=i}},We=(e=>(e[e.NotSet=-1]="NotSet",e[e.None=0]="None",e[e.Italic=1]="Italic",e[e.Bold=2]="Bold",e[e.Underline=4]="Underline",e[e.Strikethrough=8]="Strikethrough",e))(We||{});function bh(e,t){e.sort((l,u)=>{let c=hl(l.scope,u.scope);return c!==0||(c=pl(l.parentScopes,u.parentScopes),c!==0)?c:l.index-u.index});let n=0,o="#000000",r="#ffffff";for(;e.length>=1&&e[0].scope==="";){let l=e.shift();l.fontStyle!==-1&&(n=l.fontStyle),l.foreground!==null&&(o=l.foreground),l.background!==null&&(r=l.background)}let i=new xh(t),s=new vl(n,i.getId(o),i.getId(r)),a=new kh(new ri(0,null,-1,0,0),[]);for(let l=0,u=e.length;l<u;l++){let c=e[l];a.insert(0,c.scope,c.parentScopes,c.fontStyle,i.getId(c.foreground),i.getId(c.background))}return new zo(i,s,a)}var xh=class{_isFrozen;_lastColorId;_id2color;_color2id;constructor(e){if(this._lastColorId=0,this._id2color=[],this._color2id=Object.create(null),Array.isArray(e)){this._isFrozen=!0;for(let t=0,n=e.length;t<n;t++)this._color2id[e[t]]=t,this._id2color[t]=e[t]}else this._isFrozen=!1}getId(e){if(e===null)return 0;e=e.toUpperCase();let t=this._color2id[e];if(t)return t;if(this._isFrozen)throw new Error(`Missing color in color map - ${e}`);return t=++this._lastColorId,this._color2id[e]=t,this._id2color[t]=e,t}getColorMap(){return this._id2color.slice(0)}},Eh=Object.freeze([]),ri=class yl{scopeDepth;parentScopes;fontStyle;foreground;background;constructor(t,n,o,r,i){this.scopeDepth=t,this.parentScopes=n||Eh,this.fontStyle=o,this.foreground=r,this.background=i}clone(){return new yl(this.scopeDepth,this.parentScopes,this.fontStyle,this.foreground,this.background)}static cloneArr(t){let n=[];for(let o=0,r=t.length;o<r;o++)n[o]=t[o].clone();return n}acceptOverwrite(t,n,o,r){this.scopeDepth>t?console.log("how did this happen?"):this.scopeDepth=t,n!==-1&&(this.fontStyle=n),o!==0&&(this.foreground=o),r!==0&&(this.background=r)}},kh=class ii{constructor(t,n=[],o={}){this._mainRule=t,this._children=o,this._rulesWithParentScopes=n}_rulesWithParentScopes;static _cmpBySpecificity(t,n){if(t.scopeDepth!==n.scopeDepth)return n.scopeDepth-t.scopeDepth;let o=0,r=0;for(;t.parentScopes[o]===">"&&o++,n.parentScopes[r]===">"&&r++,!(o>=t.parentScopes.length||r>=n.parentScopes.length);){const i=n.parentScopes[r].length-t.parentScopes[o].length;if(i!==0)return i;o++,r++}return n.parentScopes.length-t.parentScopes.length}match(t){if(t!==""){let o=t.indexOf("."),r,i;if(o===-1?(r=t,i=""):(r=t.substring(0,o),i=t.substring(o+1)),this._children.hasOwnProperty(r))return this._children[r].match(i)}const n=this._rulesWithParentScopes.concat(this._mainRule);return n.sort(ii._cmpBySpecificity),n}insert(t,n,o,r,i,s){if(n===""){this._doInsertHere(t,o,r,i,s);return}let a=n.indexOf("."),l,u;a===-1?(l=n,u=""):(l=n.substring(0,a),u=n.substring(a+1));let c;this._children.hasOwnProperty(l)?c=this._children[l]:(c=new ii(this._mainRule.clone(),ri.cloneArr(this._rulesWithParentScopes)),this._children[l]=c),c.insert(t+1,u,o,r,i,s)}_doInsertHere(t,n,o,r,i){if(n===null){this._mainRule.acceptOverwrite(t,o,r,i);return}for(let s=0,a=this._rulesWithParentScopes.length;s<a;s++){let l=this._rulesWithParentScopes[s];if(pl(l.parentScopes,n)===0){l.acceptOverwrite(t,o,r,i);return}}o===-1&&(o=this._mainRule.fontStyle),r===0&&(r=this._mainRule.foreground),i===0&&(i=this._mainRule.background),this._rulesWithParentScopes.push(new ri(t,n,o,r,i))}},wn=class nt{static toBinaryStr(t){return t.toString(2).padStart(32,"0")}static print(t){const n=nt.getLanguageId(t),o=nt.getTokenType(t),r=nt.getFontStyle(t),i=nt.getForeground(t),s=nt.getBackground(t);console.log({languageId:n,tokenType:o,fontStyle:r,foreground:i,background:s})}static getLanguageId(t){return(t&255)>>>0}static getTokenType(t){return(t&768)>>>8}static containsBalancedBrackets(t){return(t&1024)!==0}static getFontStyle(t){return(t&30720)>>>11}static getForeground(t){return(t&16744448)>>>15}static getBackground(t){return(t&4278190080)>>>24}static set(t,n,o,r,i,s,a){let l=nt.getLanguageId(t),u=nt.getTokenType(t),c=nt.containsBalancedBrackets(t)?1:0,d=nt.getFontStyle(t),h=nt.getForeground(t),f=nt.getBackground(t);return n!==0&&(l=n),o!==8&&(u=o),r!==null&&(c=r?1:0),i!==-1&&(d=i),s!==0&&(h=s),a!==0&&(f=a),(l<<0|u<<8|c<<10|d<<11|h<<15|f<<24)>>>0}};function Vo(e,t){const n=[],o=Sh(e);let r=o.next();for(;r!==null;){let l=0;if(r.length===2&&r.charAt(1)===":"){switch(r.charAt(0)){case"R":l=1;break;case"L":l=-1;break;default:console.log(`Unknown priority ${r} in scope selector`)}r=o.next()}let u=s();if(n.push({matcher:u,priority:l}),r!==",")break;r=o.next()}return n;function i(){if(r==="-"){r=o.next();const l=i();return u=>!!l&&!l(u)}if(r==="("){r=o.next();const l=a();return r===")"&&(r=o.next()),l}if(ks(r)){const l=[];do l.push(r),r=o.next();while(ks(r));return u=>t(l,u)}return null}function s(){const l=[];let u=i();for(;u;)l.push(u),u=i();return c=>l.every(d=>d(c))}function a(){const l=[];let u=s();for(;u&&(l.push(u),r==="|"||r===",");){do r=o.next();while(r==="|"||r===",");u=s()}return c=>l.some(d=>d(c))}}function ks(e){return!!e&&!!e.match(/[\w\.:]+/)}function Sh(e){let t=/([LR]:|[\w\.:][\w\.:\-]*|[\,\|\-\(\)])/g,n=t.exec(e);return{next:()=>{if(!n)return null;const o=n[0];return n=t.exec(e),o}}}function _l(e){typeof e.dispose=="function"&&e.dispose()}var Un=class{constructor(e){this.scopeName=e}toKey(){return this.scopeName}},Ch=class{constructor(e,t){this.scopeName=e,this.ruleName=t}toKey(){return`${this.scopeName}#${this.ruleName}`}},Nh=class{_references=[];_seenReferenceKeys=new Set;get references(){return this._references}visitedRule=new Set;add(e){const t=e.toKey();this._seenReferenceKeys.has(t)||(this._seenReferenceKeys.add(t),this._references.push(e))}},Th=class{constructor(e,t){this.repo=e,this.initialScopeName=t,this.seenFullScopeRequests.add(this.initialScopeName),this.Q=[new Un(this.initialScopeName)]}seenFullScopeRequests=new Set;seenPartialScopeRequests=new Set;Q;processQueue(){const e=this.Q;this.Q=[];const t=new Nh;for(const n of e)Ph(n,this.initialScopeName,this.repo,t);for(const n of t.references)if(n instanceof Un){if(this.seenFullScopeRequests.has(n.scopeName))continue;this.seenFullScopeRequests.add(n.scopeName),this.Q.push(n)}else{if(this.seenFullScopeRequests.has(n.scopeName)||this.seenPartialScopeRequests.has(n.toKey()))continue;this.seenPartialScopeRequests.add(n.toKey()),this.Q.push(n)}}};function Ph(e,t,n,o){const r=n.lookup(e.scopeName);if(!r){if(e.scopeName===t)throw new Error(`No grammar provided for <${t}>`);return}const i=n.lookup(t);e instanceof Un?To({baseGrammar:i,selfGrammar:r},o):si(e.ruleName,{baseGrammar:i,selfGrammar:r,repository:r.repository},o);const s=n.injections(e.scopeName);if(s)for(const a of s)o.add(new Un(a))}function si(e,t,n){if(t.repository&&t.repository[e]){const o=t.repository[e];Fo([o],t,n)}}function To(e,t){e.selfGrammar.patterns&&Array.isArray(e.selfGrammar.patterns)&&Fo(e.selfGrammar.patterns,{...e,repository:e.selfGrammar.repository},t),e.selfGrammar.injections&&Fo(Object.values(e.selfGrammar.injections),{...e,repository:e.selfGrammar.repository},t)}function Fo(e,t,n){for(const o of e){if(n.visitedRule.has(o))continue;n.visitedRule.add(o);const r=o.repository?dl({},t.repository,o.repository):t.repository;Array.isArray(o.patterns)&&Fo(o.patterns,{...t,repository:r},n);const i=o.include;if(!i)continue;const s=wl(i);switch(s.kind){case 0:To({...t,selfGrammar:t.baseGrammar},n);break;case 1:To(t,n);break;case 2:si(s.ruleName,{...t,repository:r},n);break;case 3:case 4:const a=s.scopeName===t.selfGrammar.scopeName?t.selfGrammar:s.scopeName===t.baseGrammar.scopeName?t.baseGrammar:void 0;if(a){const l={baseGrammar:t.baseGrammar,selfGrammar:a,repository:r};s.kind===4?si(s.ruleName,l,n):To(l,n)}else s.kind===4?n.add(new Ch(s.scopeName,s.ruleName)):n.add(new Un(s.scopeName));break}}}var Ah=class{kind=0},Ih=class{kind=1},Oh=class{constructor(e){this.ruleName=e}kind=2},Rh=class{constructor(e){this.scopeName=e}kind=3},Mh=class{constructor(e,t){this.scopeName=e,this.ruleName=t}kind=4};function wl(e){if(e==="$base")return new Ah;if(e==="$self")return new Ih;const t=e.indexOf("#");if(t===-1)return new Rh(e);if(t===0)return new Oh(e.substring(1));{const n=e.substring(0,t),o=e.substring(t+1);return new Mh(n,o)}}var Lh=/\\(\d+)/,Ss=/\\(\d+)/g,Dh=-1,bl=-2;var io=class{$location;id;_nameIsCapturing;_name;_contentNameIsCapturing;_contentName;constructor(e,t,n,o){this.$location=e,this.id=t,this._name=n||null,this._nameIsCapturing=fo.hasCaptures(this._name),this._contentName=o||null,this._contentNameIsCapturing=fo.hasCaptures(this._contentName)}get debugName(){const e=this.$location?`${fl(this.$location.filename)}:${this.$location.line}`:"unknown";return`${this.constructor.name}#${this.id} @ ${e}`}getName(e,t){return!this._nameIsCapturing||this._name===null||e===null||t===null?this._name:fo.replaceCaptures(this._name,e,t)}getContentName(e,t){return!this._contentNameIsCapturing||this._contentName===null?this._contentName:fo.replaceCaptures(this._contentName,e,t)}},$h=class extends io{retokenizeCapturedWithRuleId;constructor(e,t,n,o,r){super(e,t,n,o),this.retokenizeCapturedWithRuleId=r}dispose(){}collectPatterns(e,t){throw new Error("Not supported!")}compile(e,t){throw new Error("Not supported!")}compileAG(e,t,n,o){throw new Error("Not supported!")}},Bh=class extends io{_match;captures;_cachedCompiledPatterns;constructor(e,t,n,o,r){super(e,t,n,null),this._match=new Wn(o,this.id),this.captures=r,this._cachedCompiledPatterns=null}dispose(){this._cachedCompiledPatterns&&(this._cachedCompiledPatterns.dispose(),this._cachedCompiledPatterns=null)}get debugMatchRegExp(){return`${this._match.source}`}collectPatterns(e,t){t.push(this._match)}compile(e,t){return this._getCachedCompiledPatterns(e).compile(e)}compileAG(e,t,n,o){return this._getCachedCompiledPatterns(e).compileAG(e,n,o)}_getCachedCompiledPatterns(e){return this._cachedCompiledPatterns||(this._cachedCompiledPatterns=new Yn,this.collectPatterns(e,this._cachedCompiledPatterns)),this._cachedCompiledPatterns}},Cs=class extends io{hasMissingPatterns;patterns;_cachedCompiledPatterns;constructor(e,t,n,o,r){super(e,t,n,o),this.patterns=r.patterns,this.hasMissingPatterns=r.hasMissingPatterns,this._cachedCompiledPatterns=null}dispose(){this._cachedCompiledPatterns&&(this._cachedCompiledPatterns.dispose(),this._cachedCompiledPatterns=null)}collectPatterns(e,t){for(const n of this.patterns)e.getRule(n).collectPatterns(e,t)}compile(e,t){return this._getCachedCompiledPatterns(e).compile(e)}compileAG(e,t,n,o){return this._getCachedCompiledPatterns(e).compileAG(e,n,o)}_getCachedCompiledPatterns(e){return this._cachedCompiledPatterns||(this._cachedCompiledPatterns=new Yn,this.collectPatterns(e,this._cachedCompiledPatterns)),this._cachedCompiledPatterns}},ai=class extends io{_begin;beginCaptures;_end;endHasBackReferences;endCaptures;applyEndPatternLast;hasMissingPatterns;patterns;_cachedCompiledPatterns;constructor(e,t,n,o,r,i,s,a,l,u){super(e,t,n,o),this._begin=new Wn(r,this.id),this.beginCaptures=i,this._end=new Wn(s||"￿",-1),this.endHasBackReferences=this._end.hasBackReferences,this.endCaptures=a,this.applyEndPatternLast=l||!1,this.patterns=u.patterns,this.hasMissingPatterns=u.hasMissingPatterns,this._cachedCompiledPatterns=null}dispose(){this._cachedCompiledPatterns&&(this._cachedCompiledPatterns.dispose(),this._cachedCompiledPatterns=null)}get debugBeginRegExp(){return`${this._begin.source}`}get debugEndRegExp(){return`${this._end.source}`}getEndWithResolvedBackReferences(e,t){return this._end.resolveBackReferences(e,t)}collectPatterns(e,t){t.push(this._begin)}compile(e,t){return this._getCachedCompiledPatterns(e,t).compile(e)}compileAG(e,t,n,o){return this._getCachedCompiledPatterns(e,t).compileAG(e,n,o)}_getCachedCompiledPatterns(e,t){if(!this._cachedCompiledPatterns){this._cachedCompiledPatterns=new Yn;for(const n of this.patterns)e.getRule(n).collectPatterns(e,this._cachedCompiledPatterns);this.applyEndPatternLast?this._cachedCompiledPatterns.push(this._end.hasBackReferences?this._end.clone():this._end):this._cachedCompiledPatterns.unshift(this._end.hasBackReferences?this._end.clone():this._end)}return this._end.hasBackReferences&&(this.applyEndPatternLast?this._cachedCompiledPatterns.setSource(this._cachedCompiledPatterns.length()-1,t):this._cachedCompiledPatterns.setSource(0,t)),this._cachedCompiledPatterns}},Ho=class extends io{_begin;beginCaptures;whileCaptures;_while;whileHasBackReferences;hasMissingPatterns;patterns;_cachedCompiledPatterns;_cachedCompiledWhilePatterns;constructor(e,t,n,o,r,i,s,a,l){super(e,t,n,o),this._begin=new Wn(r,this.id),this.beginCaptures=i,this.whileCaptures=a,this._while=new Wn(s,bl),this.whileHasBackReferences=this._while.hasBackReferences,this.patterns=l.patterns,this.hasMissingPatterns=l.hasMissingPatterns,this._cachedCompiledPatterns=null,this._cachedCompiledWhilePatterns=null}dispose(){this._cachedCompiledPatterns&&(this._cachedCompiledPatterns.dispose(),this._cachedCompiledPatterns=null),this._cachedCompiledWhilePatterns&&(this._cachedCompiledWhilePatterns.dispose(),this._cachedCompiledWhilePatterns=null)}get debugBeginRegExp(){return`${this._begin.source}`}get debugWhileRegExp(){return`${this._while.source}`}getWhileWithResolvedBackReferences(e,t){return this._while.resolveBackReferences(e,t)}collectPatterns(e,t){t.push(this._begin)}compile(e,t){return this._getCachedCompiledPatterns(e).compile(e)}compileAG(e,t,n,o){return this._getCachedCompiledPatterns(e).compileAG(e,n,o)}_getCachedCompiledPatterns(e){if(!this._cachedCompiledPatterns){this._cachedCompiledPatterns=new Yn;for(const t of this.patterns)e.getRule(t).collectPatterns(e,this._cachedCompiledPatterns)}return this._cachedCompiledPatterns}compileWhile(e,t){return this._getCachedCompiledWhilePatterns(e,t).compile(e)}compileWhileAG(e,t,n,o){return this._getCachedCompiledWhilePatterns(e,t).compileAG(e,n,o)}_getCachedCompiledWhilePatterns(e,t){return this._cachedCompiledWhilePatterns||(this._cachedCompiledWhilePatterns=new Yn,this._cachedCompiledWhilePatterns.push(this._while.hasBackReferences?this._while.clone():this._while)),this._while.hasBackReferences&&this._cachedCompiledWhilePatterns.setSource(0,t||"￿"),this._cachedCompiledWhilePatterns}},xl=class Ue{static createCaptureRule(t,n,o,r,i){return t.registerRule(s=>new $h(n,s,o,r,i))}static getCompiledRuleId(t,n,o){return t.id||n.registerRule(r=>{if(t.id=r,t.match)return new Bh(t.$vscodeTextmateLocation,t.id,t.name,t.match,Ue._compileCaptures(t.captures,n,o));if(typeof t.begin>"u"){t.repository&&(o=dl({},o,t.repository));let i=t.patterns;return typeof i>"u"&&t.include&&(i=[{include:t.include}]),new Cs(t.$vscodeTextmateLocation,t.id,t.name,t.contentName,Ue._compilePatterns(i,n,o))}return t.while?new Ho(t.$vscodeTextmateLocation,t.id,t.name,t.contentName,t.begin,Ue._compileCaptures(t.beginCaptures||t.captures,n,o),t.while,Ue._compileCaptures(t.whileCaptures||t.captures,n,o),Ue._compilePatterns(t.patterns,n,o)):new ai(t.$vscodeTextmateLocation,t.id,t.name,t.contentName,t.begin,Ue._compileCaptures(t.beginCaptures||t.captures,n,o),t.end,Ue._compileCaptures(t.endCaptures||t.captures,n,o),t.applyEndPatternLast,Ue._compilePatterns(t.patterns,n,o))}),t.id}static _compileCaptures(t,n,o){let r=[];if(t){let i=0;for(const s in t){if(s==="$vscodeTextmateLocation")continue;const a=parseInt(s,10);a>i&&(i=a)}for(let s=0;s<=i;s++)r[s]=null;for(const s in t){if(s==="$vscodeTextmateLocation")continue;const a=parseInt(s,10);let l=0;t[s].patterns&&(l=Ue.getCompiledRuleId(t[s],n,o)),r[a]=Ue.createCaptureRule(n,t[s].$vscodeTextmateLocation,t[s].name,t[s].contentName,l)}}return r}static _compilePatterns(t,n,o){let r=[];if(t)for(let i=0,s=t.length;i<s;i++){const a=t[i];let l=-1;if(a.include){const u=wl(a.include);switch(u.kind){case 0:case 1:l=Ue.getCompiledRuleId(o[a.include],n,o);break;case 2:let c=o[u.ruleName];c&&(l=Ue.getCompiledRuleId(c,n,o));break;case 3:case 4:const d=u.scopeName,h=u.kind===4?u.ruleName:null,f=n.getExternalGrammar(d,o);if(f)if(h){let p=f.repository[h];p&&(l=Ue.getCompiledRuleId(p,n,f.repository))}else l=Ue.getCompiledRuleId(f.repository.$self,n,f.repository);break}}else l=Ue.getCompiledRuleId(a,n,o);if(l!==-1){const u=n.getRule(l);let c=!1;if((u instanceof Cs||u instanceof ai||u instanceof Ho)&&u.hasMissingPatterns&&u.patterns.length===0&&(c=!0),c)continue;r.push(l)}}return{patterns:r,hasMissingPatterns:(t?t.length:0)!==r.length}}},Wn=class El{source;ruleId;hasAnchor;hasBackReferences;_anchorCache;constructor(t,n){if(t&&typeof t=="string"){const o=t.length;let r=0,i=[],s=!1;for(let a=0;a<o;a++)if(t.charAt(a)==="\\"&&a+1<o){const u=t.charAt(a+1);u==="z"?(i.push(t.substring(r,a)),i.push("$(?!\\n)(?<!\\n)"),r=a+2):(u==="A"||u==="G")&&(s=!0),a++}this.hasAnchor=s,r===0?this.source=t:(i.push(t.substring(r,o)),this.source=i.join(""))}else this.hasAnchor=!1,this.source=t;this.hasAnchor?this._anchorCache=this._buildAnchorCache():this._anchorCache=null,this.ruleId=n,typeof this.source=="string"?this.hasBackReferences=Lh.test(this.source):this.hasBackReferences=!1}clone(){return new El(this.source,this.ruleId)}setSource(t){this.source!==t&&(this.source=t,this.hasAnchor&&(this._anchorCache=this._buildAnchorCache()))}resolveBackReferences(t,n){if(typeof this.source!="string")throw new Error("This method should only be called if the source is a string");let o=n.map(r=>t.substring(r.start,r.end));return Ss.lastIndex=0,this.source.replace(Ss,(r,i)=>gl(o[parseInt(i,10)]||""))}_buildAnchorCache(){if(typeof this.source!="string")throw new Error("This method should only be called if the source is a string");let t=[],n=[],o=[],r=[],i,s,a,l;for(i=0,s=this.source.length;i<s;i++)a=this.source.charAt(i),t[i]=a,n[i]=a,o[i]=a,r[i]=a,a==="\\"&&i+1<s&&(l=this.source.charAt(i+1),l==="A"?(t[i+1]="￿",n[i+1]="￿",o[i+1]="A",r[i+1]="A"):l==="G"?(t[i+1]="￿",n[i+1]="G",o[i+1]="￿",r[i+1]="G"):(t[i+1]=l,n[i+1]=l,o[i+1]=l,r[i+1]=l),i++);return{A0_G0:t.join(""),A0_G1:n.join(""),A1_G0:o.join(""),A1_G1:r.join("")}}resolveAnchors(t,n){return!this.hasAnchor||!this._anchorCache||typeof this.source!="string"?this.source:t?n?this._anchorCache.A1_G1:this._anchorCache.A1_G0:n?this._anchorCache.A0_G1:this._anchorCache.A0_G0}},Yn=class{_items;_hasAnchors;_cached;_anchorCache;constructor(){this._items=[],this._hasAnchors=!1,this._cached=null,this._anchorCache={A0_G0:null,A0_G1:null,A1_G0:null,A1_G1:null}}dispose(){this._disposeCaches()}_disposeCaches(){this._cached&&(this._cached.dispose(),this._cached=null),this._anchorCache.A0_G0&&(this._anchorCache.A0_G0.dispose(),this._anchorCache.A0_G0=null),this._anchorCache.A0_G1&&(this._anchorCache.A0_G1.dispose(),this._anchorCache.A0_G1=null),this._anchorCache.A1_G0&&(this._anchorCache.A1_G0.dispose(),this._anchorCache.A1_G0=null),this._anchorCache.A1_G1&&(this._anchorCache.A1_G1.dispose(),this._anchorCache.A1_G1=null)}push(e){this._items.push(e),this._hasAnchors=this._hasAnchors||e.hasAnchor}unshift(e){this._items.unshift(e),this._hasAnchors=this._hasAnchors||e.hasAnchor}length(){return this._items.length}setSource(e,t){this._items[e].source!==t&&(this._disposeCaches(),this._items[e].setSource(t))}compile(e){if(!this._cached){let t=this._items.map(n=>n.source);this._cached=new Ns(e,t,this._items.map(n=>n.ruleId))}return this._cached}compileAG(e,t,n){return this._hasAnchors?t?n?(this._anchorCache.A1_G1||(this._anchorCache.A1_G1=this._resolveAnchors(e,t,n)),this._anchorCache.A1_G1):(this._anchorCache.A1_G0||(this._anchorCache.A1_G0=this._resolveAnchors(e,t,n)),this._anchorCache.A1_G0):n?(this._anchorCache.A0_G1||(this._anchorCache.A0_G1=this._resolveAnchors(e,t,n)),this._anchorCache.A0_G1):(this._anchorCache.A0_G0||(this._anchorCache.A0_G0=this._resolveAnchors(e,t,n)),this._anchorCache.A0_G0):this.compile(e)}_resolveAnchors(e,t,n){let o=this._items.map(r=>r.resolveAnchors(t,n));return new Ns(e,o,this._items.map(r=>r.ruleId))}},Ns=class{constructor(e,t,n){this.regExps=t,this.rules=n,this.scanner=e.createOnigScanner(t)}scanner;dispose(){typeof this.scanner.dispose=="function"&&this.scanner.dispose()}toString(){const e=[];for(let t=0,n=this.rules.length;t<n;t++)e.push(" - "+this.rules[t]+": "+this.regExps[t]);return e.join(`
3
- `)}findNextMatchSync(e,t,n){const o=this.scanner.findNextMatchSync(e,t,n);return o?{ruleId:this.rules[o.index],captureIndices:o.captureIndices}:null}},Mr=class{constructor(e,t){this.languageId=e,this.tokenType=t}},zh=class li{_defaultAttributes;_embeddedLanguagesMatcher;constructor(t,n){this._defaultAttributes=new Mr(t,8),this._embeddedLanguagesMatcher=new Vh(Object.entries(n||{}))}getDefaultAttributes(){return this._defaultAttributes}getBasicScopeAttributes(t){return t===null?li._NULL_SCOPE_METADATA:this._getBasicScopeAttributes.get(t)}static _NULL_SCOPE_METADATA=new Mr(0,0);_getBasicScopeAttributes=new ml(t=>{const n=this._scopeToLanguage(t),o=this._toStandardTokenType(t);return new Mr(n,o)});_scopeToLanguage(t){return this._embeddedLanguagesMatcher.match(t)||0}_toStandardTokenType(t){const n=t.match(li.STANDARD_TOKEN_TYPE_REGEXP);if(!n)return 8;switch(n[1]){case"comment":return 1;case"string":return 2;case"regex":return 3;case"meta.embedded":return 0}throw new Error("Unexpected match for standard token type!")}static STANDARD_TOKEN_TYPE_REGEXP=/\b(comment|string|regex|meta\.embedded)\b/},Vh=class{values;scopesRegExp;constructor(e){if(e.length===0)this.values=null,this.scopesRegExp=null;else{this.values=new Map(e);const t=e.map(([n,o])=>gl(n));t.sort(),t.reverse(),this.scopesRegExp=new RegExp(`^((${t.join(")|(")}))($|\\.)`,"")}}match(e){if(!this.scopesRegExp)return;const t=e.match(this.scopesRegExp);if(t)return this.values.get(t[1])}},Ts=class{constructor(e,t){this.stack=e,this.stoppedEarly=t}};function kl(e,t,n,o,r,i,s,a){const l=t.content.length;let u=!1,c=-1;if(s){const f=Fh(e,t,n,o,r,i);r=f.stack,o=f.linePos,n=f.isFirstLine,c=f.anchorPosition}const d=Date.now();for(;!u;){if(a!==0&&Date.now()-d>a)return new Ts(r,!0);h()}return new Ts(r,!1);function h(){const f=Hh(e,t,n,o,r,c);if(!f){i.produce(r,l),u=!0;return}const p=f.captureIndices,v=f.matchedRuleId,_=p&&p.length>0?p[0].end>o:!1;if(v===Dh){const y=r.getRule(e);i.produce(r,p[0].start),r=r.withContentNameScopesList(r.nameScopesList),Ln(e,t,n,r,i,y.endCaptures,p),i.produce(r,p[0].end);const b=r;if(r=r.parent,c=b.getAnchorPos(),!_&&b.getEnterPos()===o){r=b,i.produce(r,l),u=!0;return}}else{const y=e.getRule(v);i.produce(r,p[0].start);const b=r,g=y.getName(t.content,p),w=r.contentNameScopesList.pushAttributed(g,e);if(r=r.push(v,o,c,p[0].end===l,null,w,w),y instanceof ai){const T=y;Ln(e,t,n,r,i,T.beginCaptures,p),i.produce(r,p[0].end),c=p[0].end;const M=T.getContentName(t.content,p),z=w.pushAttributed(M,e);if(r=r.withContentNameScopesList(z),T.endHasBackReferences&&(r=r.withEndRule(T.getEndWithResolvedBackReferences(t.content,p))),!_&&b.hasSameRuleAs(r)){r=r.pop(),i.produce(r,l),u=!0;return}}else if(y instanceof Ho){const T=y;Ln(e,t,n,r,i,T.beginCaptures,p),i.produce(r,p[0].end),c=p[0].end;const M=T.getContentName(t.content,p),z=w.pushAttributed(M,e);if(r=r.withContentNameScopesList(z),T.whileHasBackReferences&&(r=r.withEndRule(T.getWhileWithResolvedBackReferences(t.content,p))),!_&&b.hasSameRuleAs(r)){r=r.pop(),i.produce(r,l),u=!0;return}}else if(Ln(e,t,n,r,i,y.captures,p),i.produce(r,p[0].end),r=r.pop(),!_){r=r.safePop(),i.produce(r,l),u=!0;return}}p[0].end>o&&(o=p[0].end,n=!1)}}function Fh(e,t,n,o,r,i){let s=r.beginRuleCapturedEOL?0:-1;const a=[];for(let l=r;l;l=l.pop()){const u=l.getRule(e);u instanceof Ho&&a.push({rule:u,stack:l})}for(let l=a.pop();l;l=a.pop()){const{ruleScanner:u,findOptions:c}=qh(l.rule,e,l.stack.endRule,n,o===s),d=u.findNextMatchSync(t,o,c);if(d){if(d.ruleId!==bl){r=l.stack.pop();break}d.captureIndices&&d.captureIndices.length&&(i.produce(l.stack,d.captureIndices[0].start),Ln(e,t,n,l.stack,i,l.rule.whileCaptures,d.captureIndices),i.produce(l.stack,d.captureIndices[0].end),s=d.captureIndices[0].end,d.captureIndices[0].end>o&&(o=d.captureIndices[0].end,n=!1))}else{r=l.stack.pop();break}}return{stack:r,linePos:o,anchorPosition:s,isFirstLine:n}}function Hh(e,t,n,o,r,i){const s=Gh(e,t,n,o,r,i),a=e.getInjections();if(a.length===0)return s;const l=jh(a,e,t,n,o,r,i);if(!l)return s;if(!s)return l;const u=s.captureIndices[0].start,c=l.captureIndices[0].start;return c<u||l.priorityMatch&&c===u?l:s}function Gh(e,t,n,o,r,i){const s=r.getRule(e),{ruleScanner:a,findOptions:l}=Sl(s,e,r.endRule,n,o===i),u=a.findNextMatchSync(t,o,l);return u?{captureIndices:u.captureIndices,matchedRuleId:u.ruleId}:null}function jh(e,t,n,o,r,i,s){let a=Number.MAX_VALUE,l=null,u,c=0;const d=i.contentNameScopesList.getScopeNames();for(let h=0,f=e.length;h<f;h++){const p=e[h];if(!p.matcher(d))continue;const v=t.getRule(p.ruleId),{ruleScanner:_,findOptions:y}=Sl(v,t,null,o,r===s),b=_.findNextMatchSync(n,r,y);if(!b)continue;const g=b.captureIndices[0].start;if(!(g>=a)&&(a=g,l=b.captureIndices,u=b.ruleId,c=p.priority,a===r))break}return l?{priorityMatch:c===-1,captureIndices:l,matchedRuleId:u}:null}function Sl(e,t,n,o,r){return{ruleScanner:e.compileAG(t,n,o,r),findOptions:0}}function qh(e,t,n,o,r){return{ruleScanner:e.compileWhileAG(t,n,o,r),findOptions:0}}function Ln(e,t,n,o,r,i,s){if(i.length===0)return;const a=t.content,l=Math.min(i.length,s.length),u=[],c=s[0].end;for(let d=0;d<l;d++){const h=i[d];if(h===null)continue;const f=s[d];if(f.length===0)continue;if(f.start>c)break;for(;u.length>0&&u[u.length-1].endPos<=f.start;)r.produceFromScopes(u[u.length-1].scopes,u[u.length-1].endPos),u.pop();if(u.length>0?r.produceFromScopes(u[u.length-1].scopes,f.start):r.produce(o,f.start),h.retokenizeCapturedWithRuleId){const v=h.getName(a,s),_=o.contentNameScopesList.pushAttributed(v,e),y=h.getContentName(a,s),b=_.pushAttributed(y,e),g=o.push(h.retokenizeCapturedWithRuleId,f.start,-1,!1,null,_,b),w=e.createOnigString(a.substring(0,f.end));kl(e,w,n&&f.start===0,f.start,g,r,!1,0),_l(w);continue}const p=h.getName(a,s);if(p!==null){const _=(u.length>0?u[u.length-1].scopes:o.contentNameScopesList).pushAttributed(p,e);u.push(new Uh(_,f.end))}}for(;u.length>0;)r.produceFromScopes(u[u.length-1].scopes,u[u.length-1].endPos),u.pop()}var Uh=class{scopes;endPos;constructor(e,t){this.scopes=e,this.endPos=t}};function Wh(e,t,n,o,r,i,s,a){return new Xh(e,t,n,o,r,i,s,a)}function Ps(e,t,n,o,r){const i=Vo(t,Go),s=xl.getCompiledRuleId(n,o,r.repository);for(const a of i)e.push({debugSelector:t,matcher:a.matcher,ruleId:s,grammar:r,priority:a.priority})}function Go(e,t){if(t.length<e.length)return!1;let n=0;return e.every(o=>{for(let r=n;r<t.length;r++)if(Yh(t[r],o))return n=r+1,!0;return!1})}function Yh(e,t){if(!e)return!1;if(e===t)return!0;const n=t.length;return e.length>n&&e.substr(0,n)===t&&e[n]==="."}var Xh=class{constructor(e,t,n,o,r,i,s,a){if(this._rootScopeName=e,this.balancedBracketSelectors=i,this._onigLib=a,this._basicScopeAttributesProvider=new zh(n,o),this._rootId=-1,this._lastRuleId=0,this._ruleId2desc=[null],this._includedGrammars={},this._grammarRepository=s,this._grammar=As(t,null),this._injections=null,this._tokenTypeMatchers=[],r)for(const l of Object.keys(r)){const u=Vo(l,Go);for(const c of u)this._tokenTypeMatchers.push({matcher:c.matcher,type:r[l]})}}_rootId;_lastRuleId;_ruleId2desc;_includedGrammars;_grammarRepository;_grammar;_injections;_basicScopeAttributesProvider;_tokenTypeMatchers;get themeProvider(){return this._grammarRepository}dispose(){for(const e of this._ruleId2desc)e&&e.dispose()}createOnigScanner(e){return this._onigLib.createOnigScanner(e)}createOnigString(e){return this._onigLib.createOnigString(e)}getMetadataForScope(e){return this._basicScopeAttributesProvider.getBasicScopeAttributes(e)}_collectInjections(){const e={lookup:r=>r===this._rootScopeName?this._grammar:this.getExternalGrammar(r),injections:r=>this._grammarRepository.injections(r)},t=[],n=this._rootScopeName,o=e.lookup(n);if(o){const r=o.injections;if(r)for(let s in r)Ps(t,s,r[s],this,o);const i=this._grammarRepository.injections(n);i&&i.forEach(s=>{const a=this.getExternalGrammar(s);if(a){const l=a.injectionSelector;l&&Ps(t,l,a,this,a)}})}return t.sort((r,i)=>r.priority-i.priority),t}getInjections(){return this._injections===null&&(this._injections=this._collectInjections()),this._injections}registerRule(e){const t=++this._lastRuleId,n=e(t);return this._ruleId2desc[t]=n,n}getRule(e){return this._ruleId2desc[e]}getExternalGrammar(e,t){if(this._includedGrammars[e])return this._includedGrammars[e];if(this._grammarRepository){const n=this._grammarRepository.lookup(e);if(n)return this._includedGrammars[e]=As(n,t&&t.$base),this._includedGrammars[e]}}tokenizeLine(e,t,n=0){const o=this._tokenize(e,t,!1,n);return{tokens:o.lineTokens.getResult(o.ruleStack,o.lineLength),ruleStack:o.ruleStack,stoppedEarly:o.stoppedEarly}}tokenizeLine2(e,t,n=0){const o=this._tokenize(e,t,!0,n);return{tokens:o.lineTokens.getBinaryResult(o.ruleStack,o.lineLength),ruleStack:o.ruleStack,stoppedEarly:o.stoppedEarly}}_tokenize(e,t,n,o){this._rootId===-1&&(this._rootId=xl.getCompiledRuleId(this._grammar.repository.$self,this,this._grammar.repository),this.getInjections());let r;if(!t||t===ui.NULL){r=!0;const u=this._basicScopeAttributesProvider.getDefaultAttributes(),c=this.themeProvider.getDefaults(),d=wn.set(0,u.languageId,u.tokenType,null,c.fontStyle,c.foregroundId,c.backgroundId),h=this.getRule(this._rootId).getName(null,null);let f;h?f=Fn.createRootAndLookUpScopeName(h,d,this):f=Fn.createRoot("unknown",d),t=new ui(null,this._rootId,-1,-1,!1,null,f,f)}else r=!1,t.reset();e=e+`
4
- `;const i=this.createOnigString(e),s=i.content.length,a=new Zh(n,e,this._tokenTypeMatchers,this.balancedBracketSelectors),l=kl(this,i,r,0,t,a,!0,o);return _l(i),{lineLength:s,lineTokens:a,ruleStack:l.stack,stoppedEarly:l.stoppedEarly}}};function As(e,t){return e=ph(e),e.repository=e.repository||{},e.repository.$self={$vscodeTextmateLocation:e.$vscodeTextmateLocation,patterns:e.patterns,name:e.scopeName},e.repository.$base=t||e.repository.$self,e}var Fn=class pt{constructor(t,n,o){this.parent=t,this.scopePath=n,this.tokenAttributes=o}static fromExtension(t,n){let o=t,r=t?.scopePath??null;for(const i of n)r=Rr.push(r,i.scopeNames),o=new pt(o,r,i.encodedTokenAttributes);return o}static createRoot(t,n){return new pt(null,new Rr(null,t),n)}static createRootAndLookUpScopeName(t,n,o){const r=o.getMetadataForScope(t),i=new Rr(null,t),s=o.themeProvider.themeMatch(i),a=pt.mergeAttributes(n,r,s);return new pt(null,i,a)}get scopeName(){return this.scopePath.scopeName}toString(){return this.getScopeNames().join(" ")}equals(t){return pt.equals(this,t)}static equals(t,n){do{if(t===n||!t&&!n)return!0;if(!t||!n||t.scopeName!==n.scopeName||t.tokenAttributes!==n.tokenAttributes)return!1;t=t.parent,n=n.parent}while(!0)}static mergeAttributes(t,n,o){let r=-1,i=0,s=0;return o!==null&&(r=o.fontStyle,i=o.foregroundId,s=o.backgroundId),wn.set(t,n.languageId,n.tokenType,null,r,i,s)}pushAttributed(t,n){if(t===null)return this;if(t.indexOf(" ")===-1)return pt._pushAttributed(this,t,n);const o=t.split(/ /g);let r=this;for(const i of o)r=pt._pushAttributed(r,i,n);return r}static _pushAttributed(t,n,o){const r=o.getMetadataForScope(n),i=t.scopePath.push(n),s=o.themeProvider.themeMatch(i),a=pt.mergeAttributes(t.tokenAttributes,r,s);return new pt(t,i,a)}getScopeNames(){return this.scopePath.getSegments()}getExtensionIfDefined(t){const n=[];let o=this;for(;o&&o!==t;)n.push({encodedTokenAttributes:o.tokenAttributes,scopeNames:o.scopePath.getExtensionIfDefined(o.parent?.scopePath??null)}),o=o.parent;return o===t?n.reverse():void 0}},ui=class jt{constructor(t,n,o,r,i,s,a,l){this.parent=t,this.ruleId=n,this.beginRuleCapturedEOL=i,this.endRule=s,this.nameScopesList=a,this.contentNameScopesList=l,this.depth=this.parent?this.parent.depth+1:1,this._enterPos=o,this._anchorPos=r}_stackElementBrand=void 0;static NULL=new jt(null,0,0,0,!1,null,null,null);_enterPos;_anchorPos;depth;equals(t){return t===null?!1:jt._equals(this,t)}static _equals(t,n){return t===n?!0:this._structuralEquals(t,n)?Fn.equals(t.contentNameScopesList,n.contentNameScopesList):!1}static _structuralEquals(t,n){do{if(t===n||!t&&!n)return!0;if(!t||!n||t.depth!==n.depth||t.ruleId!==n.ruleId||t.endRule!==n.endRule)return!1;t=t.parent,n=n.parent}while(!0)}clone(){return this}static _reset(t){for(;t;)t._enterPos=-1,t._anchorPos=-1,t=t.parent}reset(){jt._reset(this)}pop(){return this.parent}safePop(){return this.parent?this.parent:this}push(t,n,o,r,i,s,a){return new jt(this,t,n,o,r,i,s,a)}getEnterPos(){return this._enterPos}getAnchorPos(){return this._anchorPos}getRule(t){return t.getRule(this.ruleId)}toString(){const t=[];return this._writeString(t,0),"["+t.join(",")+"]"}_writeString(t,n){return this.parent&&(n=this.parent._writeString(t,n)),t[n++]=`(${this.ruleId}, ${this.nameScopesList?.toString()}, ${this.contentNameScopesList?.toString()})`,n}withContentNameScopesList(t){return this.contentNameScopesList===t?this:this.parent.push(this.ruleId,this._enterPos,this._anchorPos,this.beginRuleCapturedEOL,this.endRule,this.nameScopesList,t)}withEndRule(t){return this.endRule===t?this:new jt(this.parent,this.ruleId,this._enterPos,this._anchorPos,this.beginRuleCapturedEOL,t,this.nameScopesList,this.contentNameScopesList)}hasSameRuleAs(t){let n=this;for(;n&&n._enterPos===t._enterPos;){if(n.ruleId===t.ruleId)return!0;n=n.parent}return!1}toStateStackFrame(){return{ruleId:this.ruleId,beginRuleCapturedEOL:this.beginRuleCapturedEOL,endRule:this.endRule,nameScopesList:this.nameScopesList?.getExtensionIfDefined(this.parent?.nameScopesList??null)??[],contentNameScopesList:this.contentNameScopesList?.getExtensionIfDefined(this.nameScopesList)??[]}}static pushFrame(t,n){const o=Fn.fromExtension(t?.nameScopesList??null,n.nameScopesList);return new jt(t,n.ruleId,n.enterPos??-1,n.anchorPos??-1,n.beginRuleCapturedEOL,n.endRule,o,Fn.fromExtension(o,n.contentNameScopesList))}},Kh=class{balancedBracketScopes;unbalancedBracketScopes;allowAny=!1;constructor(e,t){this.balancedBracketScopes=e.flatMap(n=>n==="*"?(this.allowAny=!0,[]):Vo(n,Go).map(o=>o.matcher)),this.unbalancedBracketScopes=t.flatMap(n=>Vo(n,Go).map(o=>o.matcher))}get matchesAlways(){return this.allowAny&&this.unbalancedBracketScopes.length===0}get matchesNever(){return this.balancedBracketScopes.length===0&&!this.allowAny}match(e){for(const t of this.unbalancedBracketScopes)if(t(e))return!1;for(const t of this.balancedBracketScopes)if(t(e))return!0;return this.allowAny}},Zh=class{constructor(e,t,n,o){this.balancedBracketSelectors=o,this._emitBinaryTokens=e,this._tokenTypeOverrides=n,this._lineText=null,this._tokens=[],this._binaryTokens=[],this._lastTokenEndIndex=0}_emitBinaryTokens;_lineText;_tokens;_binaryTokens;_lastTokenEndIndex;_tokenTypeOverrides;produce(e,t){this.produceFromScopes(e.contentNameScopesList,t)}produceFromScopes(e,t){if(this._lastTokenEndIndex>=t)return;if(this._emitBinaryTokens){let o=e?.tokenAttributes??0,r=!1;if(this.balancedBracketSelectors?.matchesAlways&&(r=!0),this._tokenTypeOverrides.length>0||this.balancedBracketSelectors&&!this.balancedBracketSelectors.matchesAlways&&!this.balancedBracketSelectors.matchesNever){const i=e?.getScopeNames()??[];for(const s of this._tokenTypeOverrides)s.matcher(i)&&(o=wn.set(o,0,s.type,null,-1,0,0));this.balancedBracketSelectors&&(r=this.balancedBracketSelectors.match(i))}if(r&&(o=wn.set(o,0,8,r,-1,0,0)),this._binaryTokens.length>0&&this._binaryTokens[this._binaryTokens.length-1]===o){this._lastTokenEndIndex=t;return}this._binaryTokens.push(this._lastTokenEndIndex),this._binaryTokens.push(o),this._lastTokenEndIndex=t;return}const n=e?.getScopeNames()??[];this._tokens.push({startIndex:this._lastTokenEndIndex,endIndex:t,scopes:n}),this._lastTokenEndIndex=t}getResult(e,t){return this._tokens.length>0&&this._tokens[this._tokens.length-1].startIndex===t-1&&this._tokens.pop(),this._tokens.length===0&&(this._lastTokenEndIndex=-1,this.produce(e,t),this._tokens[this._tokens.length-1].startIndex=0),this._tokens}getBinaryResult(e,t){this._binaryTokens.length>0&&this._binaryTokens[this._binaryTokens.length-2]===t-1&&(this._binaryTokens.pop(),this._binaryTokens.pop()),this._binaryTokens.length===0&&(this._lastTokenEndIndex=-1,this.produce(e,t),this._binaryTokens[this._binaryTokens.length-2]=0);const n=new Uint32Array(this._binaryTokens.length);for(let o=0,r=this._binaryTokens.length;o<r;o++)n[o]=this._binaryTokens[o];return n}},Jh=class{constructor(e,t){this._onigLib=t,this._theme=e}_grammars=new Map;_rawGrammars=new Map;_injectionGrammars=new Map;_theme;dispose(){for(const e of this._grammars.values())e.dispose()}setTheme(e){this._theme=e}getColorMap(){return this._theme.getColorMap()}addGrammar(e,t){this._rawGrammars.set(e.scopeName,e),t&&this._injectionGrammars.set(e.scopeName,t)}lookup(e){return this._rawGrammars.get(e)}injections(e){return this._injectionGrammars.get(e)}getDefaults(){return this._theme.getDefaults()}themeMatch(e){return this._theme.match(e)}grammarForScopeName(e,t,n,o,r){if(!this._grammars.has(e)){let i=this._rawGrammars.get(e);if(!i)return null;this._grammars.set(e,Wh(e,i,t,n,o,r,this,this._onigLib))}return this._grammars.get(e)}},Qh=class{_options;_syncRegistry;_ensureGrammarCache;constructor(t){this._options=t,this._syncRegistry=new Jh(zo.createFromRawTheme(t.theme,t.colorMap),t.onigLib),this._ensureGrammarCache=new Map}dispose(){this._syncRegistry.dispose()}setTheme(t,n){this._syncRegistry.setTheme(zo.createFromRawTheme(t,n))}getColorMap(){return this._syncRegistry.getColorMap()}loadGrammarWithEmbeddedLanguages(t,n,o){return this.loadGrammarWithConfiguration(t,n,{embeddedLanguages:o})}loadGrammarWithConfiguration(t,n,o){return this._loadGrammar(t,n,o.embeddedLanguages,o.tokenTypes,new Kh(o.balancedBracketSelectors||[],o.unbalancedBracketSelectors||[]))}loadGrammar(t){return this._loadGrammar(t,0,null,null,null)}_loadGrammar(t,n,o,r,i){const s=new Th(this._syncRegistry,t);for(;s.Q.length>0;)s.Q.map(a=>this._loadSingleGrammar(a.scopeName)),s.processQueue();return this._grammarForScopeName(t,n,o,r,i)}_loadSingleGrammar(t){this._ensureGrammarCache.has(t)||(this._doLoadSingleGrammar(t),this._ensureGrammarCache.set(t,!0))}_doLoadSingleGrammar(t){const n=this._options.loadGrammar(t);if(n){const o=typeof this._options.getInjections=="function"?this._options.getInjections(t):void 0;this._syncRegistry.addGrammar(n,o)}}addGrammar(t,n=[],o=0,r=null){return this._syncRegistry.addGrammar(t,n),this._grammarForScopeName(t.scopeName,o,r)}_grammarForScopeName(t,n=0,o=null,r=null,i=null){return this._syncRegistry.grammarForScopeName(t,n,o,r,i)}},ci=ui.NULL;const ep=["area","base","basefont","bgsound","br","col","command","embed","frame","hr","image","img","input","keygen","link","meta","param","source","track","wbr"];class so{constructor(t,n,o){this.normal=n,this.property=t,o&&(this.space=o)}}so.prototype.normal={};so.prototype.property={};so.prototype.space=void 0;function Cl(e,t){const n={},o={};for(const r of e)Object.assign(n,r.property),Object.assign(o,r.normal);return new so(n,o,t)}function di(e){return e.toLowerCase()}class Ke{constructor(t,n){this.attribute=n,this.property=t}}Ke.prototype.attribute="";Ke.prototype.booleanish=!1;Ke.prototype.boolean=!1;Ke.prototype.commaOrSpaceSeparated=!1;Ke.prototype.commaSeparated=!1;Ke.prototype.defined=!1;Ke.prototype.mustUseProperty=!1;Ke.prototype.number=!1;Ke.prototype.overloadedBoolean=!1;Ke.prototype.property="";Ke.prototype.spaceSeparated=!1;Ke.prototype.space=void 0;let tp=0;const xe=nn(),De=nn(),fi=nn(),re=nn(),Re=nn(),fn=nn(),Ze=nn();function nn(){return 2**++tp}const hi=Object.freeze(Object.defineProperty({__proto__:null,boolean:xe,booleanish:De,commaOrSpaceSeparated:Ze,commaSeparated:fn,number:re,overloadedBoolean:fi,spaceSeparated:Re},Symbol.toStringTag,{value:"Module"})),Lr=Object.keys(hi);class Hi extends Ke{constructor(t,n,o,r){let i=-1;if(super(t,n),Is(this,"space",r),typeof o=="number")for(;++i<Lr.length;){const s=Lr[i];Is(this,Lr[i],(o&hi[s])===hi[s])}}}Hi.prototype.defined=!0;function Is(e,t,n){n&&(e[t]=n)}function Pn(e){const t={},n={};for(const[o,r]of Object.entries(e.properties)){const i=new Hi(o,e.transform(e.attributes||{},o),r,e.space);e.mustUseProperty&&e.mustUseProperty.includes(o)&&(i.mustUseProperty=!0),t[o]=i,n[di(o)]=o,n[di(i.attribute)]=o}return new so(t,n,e.space)}const Nl=Pn({properties:{ariaActiveDescendant:null,ariaAtomic:De,ariaAutoComplete:null,ariaBusy:De,ariaChecked:De,ariaColCount:re,ariaColIndex:re,ariaColSpan:re,ariaControls:Re,ariaCurrent:null,ariaDescribedBy:Re,ariaDetails:null,ariaDisabled:De,ariaDropEffect:Re,ariaErrorMessage:null,ariaExpanded:De,ariaFlowTo:Re,ariaGrabbed:De,ariaHasPopup:null,ariaHidden:De,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:Re,ariaLevel:re,ariaLive:null,ariaModal:De,ariaMultiLine:De,ariaMultiSelectable:De,ariaOrientation:null,ariaOwns:Re,ariaPlaceholder:null,ariaPosInSet:re,ariaPressed:De,ariaReadOnly:De,ariaRelevant:null,ariaRequired:De,ariaRoleDescription:Re,ariaRowCount:re,ariaRowIndex:re,ariaRowSpan:re,ariaSelected:De,ariaSetSize:re,ariaSort:null,ariaValueMax:re,ariaValueMin:re,ariaValueNow:re,ariaValueText:null,role:null},transform(e,t){return t==="role"?t:"aria-"+t.slice(4).toLowerCase()}});function Tl(e,t){return t in e?e[t]:t}function Pl(e,t){return Tl(e,t.toLowerCase())}const np=Pn({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:fn,acceptCharset:Re,accessKey:Re,action:null,allow:null,allowFullScreen:xe,allowPaymentRequest:xe,allowUserMedia:xe,alt:null,as:null,async:xe,autoCapitalize:null,autoComplete:Re,autoFocus:xe,autoPlay:xe,blocking:Re,capture:null,charSet:null,checked:xe,cite:null,className:Re,cols:re,colSpan:null,content:null,contentEditable:De,controls:xe,controlsList:Re,coords:re|fn,crossOrigin:null,data:null,dateTime:null,decoding:null,default:xe,defer:xe,dir:null,dirName:null,disabled:xe,download:fi,draggable:De,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:xe,formTarget:null,headers:Re,height:re,hidden:fi,high:re,href:null,hrefLang:null,htmlFor:Re,httpEquiv:Re,id:null,imageSizes:null,imageSrcSet:null,inert:xe,inputMode:null,integrity:null,is:null,isMap:xe,itemId:null,itemProp:Re,itemRef:Re,itemScope:xe,itemType:Re,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:xe,low:re,manifest:null,max:null,maxLength:re,media:null,method:null,min:null,minLength:re,multiple:xe,muted:xe,name:null,nonce:null,noModule:xe,noValidate:xe,onAbort:null,onAfterPrint:null,onAuxClick:null,onBeforeMatch:null,onBeforePrint:null,onBeforeToggle:null,onBeforeUnload:null,onBlur:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onContextLost:null,onContextMenu:null,onContextRestored:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnded:null,onError:null,onFocus:null,onFormData:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLanguageChange:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadEnd:null,onLoadStart:null,onMessage:null,onMessageError:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRejectionHandled:null,onReset:null,onResize:null,onScroll:null,onScrollEnd:null,onSecurityPolicyViolation:null,onSeeked:null,onSeeking:null,onSelect:null,onSlotChange:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnhandledRejection:null,onUnload:null,onVolumeChange:null,onWaiting:null,onWheel:null,open:xe,optimum:re,pattern:null,ping:Re,placeholder:null,playsInline:xe,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:xe,referrerPolicy:null,rel:Re,required:xe,reversed:xe,rows:re,rowSpan:re,sandbox:Re,scope:null,scoped:xe,seamless:xe,selected:xe,shadowRootClonable:xe,shadowRootDelegatesFocus:xe,shadowRootMode:null,shape:null,size:re,sizes:null,slot:null,span:re,spellCheck:De,src:null,srcDoc:null,srcLang:null,srcSet:null,start:re,step:null,style:null,tabIndex:re,target:null,title:null,translate:null,type:null,typeMustMatch:xe,useMap:null,value:De,width:re,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:Re,axis:null,background:null,bgColor:null,border:re,borderColor:null,bottomMargin:re,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:xe,declare:xe,event:null,face:null,frame:null,frameBorder:null,hSpace:re,leftMargin:re,link:null,longDesc:null,lowSrc:null,marginHeight:re,marginWidth:re,noResize:xe,noHref:xe,noShade:xe,noWrap:xe,object:null,profile:null,prompt:null,rev:null,rightMargin:re,rules:null,scheme:null,scrolling:De,standby:null,summary:null,text:null,topMargin:re,valueType:null,version:null,vAlign:null,vLink:null,vSpace:re,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:xe,disableRemotePlayback:xe,prefix:null,property:null,results:re,security:null,unselectable:null},space:"html",transform:Pl}),op=Pn({attributes:{accentHeight:"accent-height",alignmentBaseline:"alignment-baseline",arabicForm:"arabic-form",baselineShift:"baseline-shift",capHeight:"cap-height",className:"class",clipPath:"clip-path",clipRule:"clip-rule",colorInterpolation:"color-interpolation",colorInterpolationFilters:"color-interpolation-filters",colorProfile:"color-profile",colorRendering:"color-rendering",crossOrigin:"crossorigin",dataType:"datatype",dominantBaseline:"dominant-baseline",enableBackground:"enable-background",fillOpacity:"fill-opacity",fillRule:"fill-rule",floodColor:"flood-color",floodOpacity:"flood-opacity",fontFamily:"font-family",fontSize:"font-size",fontSizeAdjust:"font-size-adjust",fontStretch:"font-stretch",fontStyle:"font-style",fontVariant:"font-variant",fontWeight:"font-weight",glyphName:"glyph-name",glyphOrientationHorizontal:"glyph-orientation-horizontal",glyphOrientationVertical:"glyph-orientation-vertical",hrefLang:"hreflang",horizAdvX:"horiz-adv-x",horizOriginX:"horiz-origin-x",horizOriginY:"horiz-origin-y",imageRendering:"image-rendering",letterSpacing:"letter-spacing",lightingColor:"lighting-color",markerEnd:"marker-end",markerMid:"marker-mid",markerStart:"marker-start",navDown:"nav-down",navDownLeft:"nav-down-left",navDownRight:"nav-down-right",navLeft:"nav-left",navNext:"nav-next",navPrev:"nav-prev",navRight:"nav-right",navUp:"nav-up",navUpLeft:"nav-up-left",navUpRight:"nav-up-right",onAbort:"onabort",onActivate:"onactivate",onAfterPrint:"onafterprint",onBeforePrint:"onbeforeprint",onBegin:"onbegin",onCancel:"oncancel",onCanPlay:"oncanplay",onCanPlayThrough:"oncanplaythrough",onChange:"onchange",onClick:"onclick",onClose:"onclose",onCopy:"oncopy",onCueChange:"oncuechange",onCut:"oncut",onDblClick:"ondblclick",onDrag:"ondrag",onDragEnd:"ondragend",onDragEnter:"ondragenter",onDragExit:"ondragexit",onDragLeave:"ondragleave",onDragOver:"ondragover",onDragStart:"ondragstart",onDrop:"ondrop",onDurationChange:"ondurationchange",onEmptied:"onemptied",onEnd:"onend",onEnded:"onended",onError:"onerror",onFocus:"onfocus",onFocusIn:"onfocusin",onFocusOut:"onfocusout",onHashChange:"onhashchange",onInput:"oninput",onInvalid:"oninvalid",onKeyDown:"onkeydown",onKeyPress:"onkeypress",onKeyUp:"onkeyup",onLoad:"onload",onLoadedData:"onloadeddata",onLoadedMetadata:"onloadedmetadata",onLoadStart:"onloadstart",onMessage:"onmessage",onMouseDown:"onmousedown",onMouseEnter:"onmouseenter",onMouseLeave:"onmouseleave",onMouseMove:"onmousemove",onMouseOut:"onmouseout",onMouseOver:"onmouseover",onMouseUp:"onmouseup",onMouseWheel:"onmousewheel",onOffline:"onoffline",onOnline:"ononline",onPageHide:"onpagehide",onPageShow:"onpageshow",onPaste:"onpaste",onPause:"onpause",onPlay:"onplay",onPlaying:"onplaying",onPopState:"onpopstate",onProgress:"onprogress",onRateChange:"onratechange",onRepeat:"onrepeat",onReset:"onreset",onResize:"onresize",onScroll:"onscroll",onSeeked:"onseeked",onSeeking:"onseeking",onSelect:"onselect",onShow:"onshow",onStalled:"onstalled",onStorage:"onstorage",onSubmit:"onsubmit",onSuspend:"onsuspend",onTimeUpdate:"ontimeupdate",onToggle:"ontoggle",onUnload:"onunload",onVolumeChange:"onvolumechange",onWaiting:"onwaiting",onZoom:"onzoom",overlinePosition:"overline-position",overlineThickness:"overline-thickness",paintOrder:"paint-order",panose1:"panose-1",pointerEvents:"pointer-events",referrerPolicy:"referrerpolicy",renderingIntent:"rendering-intent",shapeRendering:"shape-rendering",stopColor:"stop-color",stopOpacity:"stop-opacity",strikethroughPosition:"strikethrough-position",strikethroughThickness:"strikethrough-thickness",strokeDashArray:"stroke-dasharray",strokeDashOffset:"stroke-dashoffset",strokeLineCap:"stroke-linecap",strokeLineJoin:"stroke-linejoin",strokeMiterLimit:"stroke-miterlimit",strokeOpacity:"stroke-opacity",strokeWidth:"stroke-width",tabIndex:"tabindex",textAnchor:"text-anchor",textDecoration:"text-decoration",textRendering:"text-rendering",transformOrigin:"transform-origin",typeOf:"typeof",underlinePosition:"underline-position",underlineThickness:"underline-thickness",unicodeBidi:"unicode-bidi",unicodeRange:"unicode-range",unitsPerEm:"units-per-em",vAlphabetic:"v-alphabetic",vHanging:"v-hanging",vIdeographic:"v-ideographic",vMathematical:"v-mathematical",vectorEffect:"vector-effect",vertAdvY:"vert-adv-y",vertOriginX:"vert-origin-x",vertOriginY:"vert-origin-y",wordSpacing:"word-spacing",writingMode:"writing-mode",xHeight:"x-height",playbackOrder:"playbackorder",timelineBegin:"timelinebegin"},properties:{about:Ze,accentHeight:re,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:re,amplitude:re,arabicForm:null,ascent:re,attributeName:null,attributeType:null,azimuth:re,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:re,by:null,calcMode:null,capHeight:re,className:Re,clip:null,clipPath:null,clipPathUnits:null,clipRule:null,color:null,colorInterpolation:null,colorInterpolationFilters:null,colorProfile:null,colorRendering:null,content:null,contentScriptType:null,contentStyleType:null,crossOrigin:null,cursor:null,cx:null,cy:null,d:null,dataType:null,defaultAction:null,descent:re,diffuseConstant:re,direction:null,display:null,dur:null,divisor:re,dominantBaseline:null,download:xe,dx:null,dy:null,edgeMode:null,editable:null,elevation:re,enableBackground:null,end:null,event:null,exponent:re,externalResourcesRequired:null,fill:null,fillOpacity:re,fillRule:null,filter:null,filterRes:null,filterUnits:null,floodColor:null,floodOpacity:null,focusable:null,focusHighlight:null,fontFamily:null,fontSize:null,fontSizeAdjust:null,fontStretch:null,fontStyle:null,fontVariant:null,fontWeight:null,format:null,fr:null,from:null,fx:null,fy:null,g1:fn,g2:fn,glyphName:fn,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:re,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:re,horizOriginX:re,horizOriginY:re,id:null,ideographic:re,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:re,k:re,k1:re,k2:re,k3:re,k4:re,kernelMatrix:Ze,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:re,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:re,mediaTime:null,method:null,min:null,mode:null,name:null,navDown:null,navDownLeft:null,navDownRight:null,navLeft:null,navNext:null,navPrev:null,navRight:null,navUp:null,navUpLeft:null,navUpRight:null,numOctaves:null,observer:null,offset:null,onAbort:null,onActivate:null,onAfterPrint:null,onBeforePrint:null,onBegin:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnd:null,onEnded:null,onError:null,onFocus:null,onFocusIn:null,onFocusOut:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadStart:null,onMessage:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onMouseWheel:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRepeat:null,onReset:null,onResize:null,onScroll:null,onSeeked:null,onSeeking:null,onSelect:null,onShow:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnload:null,onVolumeChange:null,onWaiting:null,onZoom:null,opacity:null,operator:null,order:null,orient:null,orientation:null,origin:null,overflow:null,overlay:null,overlinePosition:re,overlineThickness:re,paintOrder:null,panose1:null,path:null,pathLength:re,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:Re,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:re,pointsAtY:re,pointsAtZ:re,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:Ze,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:Ze,rev:Ze,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:Ze,requiredFeatures:Ze,requiredFonts:Ze,requiredFormats:Ze,resource:null,restart:null,result:null,rotate:null,rx:null,ry:null,scale:null,seed:null,shapeRendering:null,side:null,slope:null,snapshotTime:null,specularConstant:re,specularExponent:re,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:re,strikethroughThickness:re,string:null,stroke:null,strokeDashArray:Ze,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:re,strokeOpacity:re,strokeWidth:null,style:null,surfaceScale:re,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:Ze,tabIndex:re,tableValues:null,target:null,targetX:re,targetY:re,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:Ze,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:re,underlineThickness:re,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:re,values:null,vAlphabetic:re,vMathematical:re,vectorEffect:null,vHanging:re,vIdeographic:re,version:null,vertAdvY:re,vertOriginX:re,vertOriginY:re,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:re,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:Tl}),Al=Pn({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:"xlink",transform(e,t){return"xlink:"+t.slice(5).toLowerCase()}}),Il=Pn({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:Pl}),Ol=Pn({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(e,t){return"xml:"+t.slice(3).toLowerCase()}}),rp=/[A-Z]/g,Os=/-[a-z]/g,ip=/^data[-\w.:]+$/i;function sp(e,t){const n=di(t);let o=t,r=Ke;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)==="data"&&ip.test(t)){if(t.charAt(4)==="-"){const i=t.slice(5).replace(Os,lp);o="data"+i.charAt(0).toUpperCase()+i.slice(1)}else{const i=t.slice(4);if(!Os.test(i)){let s=i.replace(rp,ap);s.charAt(0)!=="-"&&(s="-"+s),t="data"+s}}r=Hi}return new r(o,t)}function ap(e){return"-"+e.toLowerCase()}function lp(e){return e.charAt(1).toUpperCase()}const up=Cl([Nl,np,Al,Il,Ol],"html"),Rl=Cl([Nl,op,Al,Il,Ol],"svg"),Rs={}.hasOwnProperty;function cp(e,t){const n=t||{};function o(r,...i){let s=o.invalid;const a=o.handlers;if(r&&Rs.call(r,e)){const l=String(r[e]);s=Rs.call(a,l)?a[l]:o.unknown}if(s)return s.call(this,r,...i)}return o.handlers=n.handlers||{},o.invalid=n.invalid,o.unknown=n.unknown,o}const dp=/["&'<>`]/g,fp=/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,hp=/[\x01-\t\v\f\x0E-\x1F\x7F\x81\x8D\x8F\x90\x9D\xA0-\uFFFF]/g,pp=/[|\\{}()[\]^$+*?.]/g,Ms=new WeakMap;function gp(e,t){if(e=e.replace(t.subset?mp(t.subset):dp,o),t.subset||t.escapeOnly)return e;return e.replace(fp,n).replace(hp,o);function n(r,i,s){return t.format((r.charCodeAt(0)-55296)*1024+r.charCodeAt(1)-56320+65536,s.charCodeAt(i+2),t)}function o(r,i,s){return t.format(r.charCodeAt(0),s.charCodeAt(i+1),t)}}function mp(e){let t=Ms.get(e);return t||(t=vp(e),Ms.set(e,t)),t}function vp(e){const t=[];let n=-1;for(;++n<e.length;)t.push(e[n].replace(pp,"\\$&"));return new RegExp("(?:"+t.join("|")+")","g")}const yp=/[\dA-Fa-f]/;function _p(e,t,n){const o="&#x"+e.toString(16).toUpperCase();return n&&t&&!yp.test(String.fromCharCode(t))?o:o+";"}const wp=/\d/;function bp(e,t,n){const o="&#"+String(e);return n&&t&&!wp.test(String.fromCharCode(t))?o:o+";"}const xp=["AElig","AMP","Aacute","Acirc","Agrave","Aring","Atilde","Auml","COPY","Ccedil","ETH","Eacute","Ecirc","Egrave","Euml","GT","Iacute","Icirc","Igrave","Iuml","LT","Ntilde","Oacute","Ocirc","Ograve","Oslash","Otilde","Ouml","QUOT","REG","THORN","Uacute","Ucirc","Ugrave","Uuml","Yacute","aacute","acirc","acute","aelig","agrave","amp","aring","atilde","auml","brvbar","ccedil","cedil","cent","copy","curren","deg","divide","eacute","ecirc","egrave","eth","euml","frac12","frac14","frac34","gt","iacute","icirc","iexcl","igrave","iquest","iuml","laquo","lt","macr","micro","middot","nbsp","not","ntilde","oacute","ocirc","ograve","ordf","ordm","oslash","otilde","ouml","para","plusmn","pound","quot","raquo","reg","sect","shy","sup1","sup2","sup3","szlig","thorn","times","uacute","ucirc","ugrave","uml","uuml","yacute","yen","yuml"],Dr={nbsp:" ",iexcl:"¡",cent:"¢",pound:"£",curren:"¤",yen:"¥",brvbar:"¦",sect:"§",uml:"¨",copy:"©",ordf:"ª",laquo:"«",not:"¬",shy:"­",reg:"®",macr:"¯",deg:"°",plusmn:"±",sup2:"²",sup3:"³",acute:"´",micro:"µ",para:"¶",middot:"·",cedil:"¸",sup1:"¹",ordm:"º",raquo:"»",frac14:"¼",frac12:"½",frac34:"¾",iquest:"¿",Agrave:"À",Aacute:"Á",Acirc:"Â",Atilde:"Ã",Auml:"Ä",Aring:"Å",AElig:"Æ",Ccedil:"Ç",Egrave:"È",Eacute:"É",Ecirc:"Ê",Euml:"Ë",Igrave:"Ì",Iacute:"Í",Icirc:"Î",Iuml:"Ï",ETH:"Ð",Ntilde:"Ñ",Ograve:"Ò",Oacute:"Ó",Ocirc:"Ô",Otilde:"Õ",Ouml:"Ö",times:"×",Oslash:"Ø",Ugrave:"Ù",Uacute:"Ú",Ucirc:"Û",Uuml:"Ü",Yacute:"Ý",THORN:"Þ",szlig:"ß",agrave:"à",aacute:"á",acirc:"â",atilde:"ã",auml:"ä",aring:"å",aelig:"æ",ccedil:"ç",egrave:"è",eacute:"é",ecirc:"ê",euml:"ë",igrave:"ì",iacute:"í",icirc:"î",iuml:"ï",eth:"ð",ntilde:"ñ",ograve:"ò",oacute:"ó",ocirc:"ô",otilde:"õ",ouml:"ö",divide:"÷",oslash:"ø",ugrave:"ù",uacute:"ú",ucirc:"û",uuml:"ü",yacute:"ý",thorn:"þ",yuml:"ÿ",fnof:"ƒ",Alpha:"Α",Beta:"Β",Gamma:"Γ",Delta:"Δ",Epsilon:"Ε",Zeta:"Ζ",Eta:"Η",Theta:"Θ",Iota:"Ι",Kappa:"Κ",Lambda:"Λ",Mu:"Μ",Nu:"Ν",Xi:"Ξ",Omicron:"Ο",Pi:"Π",Rho:"Ρ",Sigma:"Σ",Tau:"Τ",Upsilon:"Υ",Phi:"Φ",Chi:"Χ",Psi:"Ψ",Omega:"Ω",alpha:"α",beta:"β",gamma:"γ",delta:"δ",epsilon:"ε",zeta:"ζ",eta:"η",theta:"θ",iota:"ι",kappa:"κ",lambda:"λ",mu:"μ",nu:"ν",xi:"ξ",omicron:"ο",pi:"π",rho:"ρ",sigmaf:"ς",sigma:"σ",tau:"τ",upsilon:"υ",phi:"φ",chi:"χ",psi:"ψ",omega:"ω",thetasym:"ϑ",upsih:"ϒ",piv:"ϖ",bull:"•",hellip:"…",prime:"′",Prime:"″",oline:"‾",frasl:"⁄",weierp:"℘",image:"ℑ",real:"ℜ",trade:"™",alefsym:"ℵ",larr:"←",uarr:"↑",rarr:"→",darr:"↓",harr:"↔",crarr:"↵",lArr:"⇐",uArr:"⇑",rArr:"⇒",dArr:"⇓",hArr:"⇔",forall:"∀",part:"∂",exist:"∃",empty:"∅",nabla:"∇",isin:"∈",notin:"∉",ni:"∋",prod:"∏",sum:"∑",minus:"−",lowast:"∗",radic:"√",prop:"∝",infin:"∞",ang:"∠",and:"∧",or:"∨",cap:"∩",cup:"∪",int:"∫",there4:"∴",sim:"∼",cong:"≅",asymp:"≈",ne:"≠",equiv:"≡",le:"≤",ge:"≥",sub:"⊂",sup:"⊃",nsub:"⊄",sube:"⊆",supe:"⊇",oplus:"⊕",otimes:"⊗",perp:"⊥",sdot:"⋅",lceil:"⌈",rceil:"⌉",lfloor:"⌊",rfloor:"⌋",lang:"〈",rang:"〉",loz:"◊",spades:"♠",clubs:"♣",hearts:"♥",diams:"♦",quot:'"',amp:"&",lt:"<",gt:">",OElig:"Œ",oelig:"œ",Scaron:"Š",scaron:"š",Yuml:"Ÿ",circ:"ˆ",tilde:"˜",ensp:" ",emsp:" ",thinsp:" ",zwnj:"‌",zwj:"‍",lrm:"‎",rlm:"‏",ndash:"–",mdash:"—",lsquo:"‘",rsquo:"’",sbquo:"‚",ldquo:"“",rdquo:"”",bdquo:"„",dagger:"†",Dagger:"‡",permil:"‰",lsaquo:"‹",rsaquo:"›",euro:"€"},Ep=["cent","copy","divide","gt","lt","not","para","times"],Ml={}.hasOwnProperty,pi={};let ho;for(ho in Dr)Ml.call(Dr,ho)&&(pi[Dr[ho]]=ho);const kp=/[^\dA-Za-z]/;function Sp(e,t,n,o){const r=String.fromCharCode(e);if(Ml.call(pi,r)){const i=pi[r],s="&"+i;return n&&xp.includes(i)&&!Ep.includes(i)&&(!o||t&&t!==61&&kp.test(String.fromCharCode(t)))?s:s+";"}return""}function Cp(e,t,n){let o=_p(e,t,n.omitOptionalSemicolons),r;if((n.useNamedReferences||n.useShortestReferences)&&(r=Sp(e,t,n.omitOptionalSemicolons,n.attribute)),(n.useShortestReferences||!r)&&n.useShortestReferences){const i=bp(e,t,n.omitOptionalSemicolons);i.length<o.length&&(o=i)}return r&&(!n.useShortestReferences||r.length<o.length)?r:o}function hn(e,t){return gp(e,Object.assign({format:Cp},t))}const Np=/^>|^->|<!--|-->|--!>|<!-$/g,Tp=[">"],Pp=["<",">"];function Ap(e,t,n,o){return o.settings.bogusComments?"<?"+hn(e.value,Object.assign({},o.settings.characterReferences,{subset:Tp}))+">":"<!--"+e.value.replace(Np,r)+"-->";function r(i){return hn(i,Object.assign({},o.settings.characterReferences,{subset:Pp}))}}function Ip(e,t,n,o){return"<!"+(o.settings.upperDoctype?"DOCTYPE":"doctype")+(o.settings.tightDoctype?"":" ")+"html>"}function Ls(e,t){const n=String(e);if(typeof t!="string")throw new TypeError("Expected character");let o=0,r=n.indexOf(t);for(;r!==-1;)o++,r=n.indexOf(t,r+t.length);return o}function Op(e,t){const n=t||{};return(e[e.length-1]===""?[...e,""]:e).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}function Rp(e){return e.join(" ").trim()}const Mp=/[ \t\n\f\r]/g;function Gi(e){return typeof e=="object"?e.type==="text"?Ds(e.value):!1:Ds(e)}function Ds(e){return e.replace(Mp,"")===""}const je=Dl(1),Ll=Dl(-1),Lp=[];function Dl(e){return t;function t(n,o,r){const i=n?n.children:Lp;let s=(o||0)+e,a=i[s];if(!r)for(;a&&Gi(a);)s+=e,a=i[s];return a}}const Dp={}.hasOwnProperty;function $l(e){return t;function t(n,o,r){return Dp.call(e,n.tagName)&&e[n.tagName](n,o,r)}}const ji=$l({body:Bp,caption:$r,colgroup:$r,dd:Hp,dt:Fp,head:$r,html:$p,li:Vp,optgroup:Gp,option:jp,p:zp,rp:$s,rt:$s,tbody:Up,td:Bs,tfoot:Wp,th:Bs,thead:qp,tr:Yp});function $r(e,t,n){const o=je(n,t,!0);return!o||o.type!=="comment"&&!(o.type==="text"&&Gi(o.value.charAt(0)))}function $p(e,t,n){const o=je(n,t);return!o||o.type!=="comment"}function Bp(e,t,n){const o=je(n,t);return!o||o.type!=="comment"}function zp(e,t,n){const o=je(n,t);return o?o.type==="element"&&(o.tagName==="address"||o.tagName==="article"||o.tagName==="aside"||o.tagName==="blockquote"||o.tagName==="details"||o.tagName==="div"||o.tagName==="dl"||o.tagName==="fieldset"||o.tagName==="figcaption"||o.tagName==="figure"||o.tagName==="footer"||o.tagName==="form"||o.tagName==="h1"||o.tagName==="h2"||o.tagName==="h3"||o.tagName==="h4"||o.tagName==="h5"||o.tagName==="h6"||o.tagName==="header"||o.tagName==="hgroup"||o.tagName==="hr"||o.tagName==="main"||o.tagName==="menu"||o.tagName==="nav"||o.tagName==="ol"||o.tagName==="p"||o.tagName==="pre"||o.tagName==="section"||o.tagName==="table"||o.tagName==="ul"):!n||!(n.type==="element"&&(n.tagName==="a"||n.tagName==="audio"||n.tagName==="del"||n.tagName==="ins"||n.tagName==="map"||n.tagName==="noscript"||n.tagName==="video"))}function Vp(e,t,n){const o=je(n,t);return!o||o.type==="element"&&o.tagName==="li"}function Fp(e,t,n){const o=je(n,t);return!!(o&&o.type==="element"&&(o.tagName==="dt"||o.tagName==="dd"))}function Hp(e,t,n){const o=je(n,t);return!o||o.type==="element"&&(o.tagName==="dt"||o.tagName==="dd")}function $s(e,t,n){const o=je(n,t);return!o||o.type==="element"&&(o.tagName==="rp"||o.tagName==="rt")}function Gp(e,t,n){const o=je(n,t);return!o||o.type==="element"&&o.tagName==="optgroup"}function jp(e,t,n){const o=je(n,t);return!o||o.type==="element"&&(o.tagName==="option"||o.tagName==="optgroup")}function qp(e,t,n){const o=je(n,t);return!!(o&&o.type==="element"&&(o.tagName==="tbody"||o.tagName==="tfoot"))}function Up(e,t,n){const o=je(n,t);return!o||o.type==="element"&&(o.tagName==="tbody"||o.tagName==="tfoot")}function Wp(e,t,n){return!je(n,t)}function Yp(e,t,n){const o=je(n,t);return!o||o.type==="element"&&o.tagName==="tr"}function Bs(e,t,n){const o=je(n,t);return!o||o.type==="element"&&(o.tagName==="td"||o.tagName==="th")}const Xp=$l({body:Jp,colgroup:Qp,head:Zp,html:Kp,tbody:eg});function Kp(e){const t=je(e,-1);return!t||t.type!=="comment"}function Zp(e){const t=new Set;for(const o of e.children)if(o.type==="element"&&(o.tagName==="base"||o.tagName==="title")){if(t.has(o.tagName))return!1;t.add(o.tagName)}const n=e.children[0];return!n||n.type==="element"}function Jp(e){const t=je(e,-1,!0);return!t||t.type!=="comment"&&!(t.type==="text"&&Gi(t.value.charAt(0)))&&!(t.type==="element"&&(t.tagName==="meta"||t.tagName==="link"||t.tagName==="script"||t.tagName==="style"||t.tagName==="template"))}function Qp(e,t,n){const o=Ll(n,t),r=je(e,-1,!0);return n&&o&&o.type==="element"&&o.tagName==="colgroup"&&ji(o,n.children.indexOf(o),n)?!1:!!(r&&r.type==="element"&&r.tagName==="col")}function eg(e,t,n){const o=Ll(n,t),r=je(e,-1);return n&&o&&o.type==="element"&&(o.tagName==="thead"||o.tagName==="tbody")&&ji(o,n.children.indexOf(o),n)?!1:!!(r&&r.type==="element"&&r.tagName==="tr")}const po={name:[[`
5
- \f\r &/=>`.split(""),`
6
- \f\r "&'/=>\``.split("")],[`\0
7
- \f\r "&'/<=>`.split(""),`\0
8
- \f\r "&'/<=>\``.split("")]],unquoted:[[`
9
- \f\r &>`.split(""),`\0
10
- \f\r "&'<=>\``.split("")],[`\0
11
- \f\r "&'<=>\``.split(""),`\0
12
- \f\r "&'<=>\``.split("")]],single:[["&'".split(""),"\"&'`".split("")],["\0&'".split(""),"\0\"&'`".split("")]],double:[['"&'.split(""),"\"&'`".split("")],['\0"&'.split(""),"\0\"&'`".split("")]]};function tg(e,t,n,o){const r=o.schema,i=r.space==="svg"?!1:o.settings.omitOptionalTags;let s=r.space==="svg"?o.settings.closeEmptyElements:o.settings.voids.includes(e.tagName.toLowerCase());const a=[];let l;r.space==="html"&&e.tagName==="svg"&&(o.schema=Rl);const u=ng(o,e.properties),c=o.all(r.space==="html"&&e.tagName==="template"?e.content:e);return o.schema=r,c&&(s=!1),(u||!i||!Xp(e,t,n))&&(a.push("<",e.tagName,u?" "+u:""),s&&(r.space==="svg"||o.settings.closeSelfClosing)&&(l=u.charAt(u.length-1),(!o.settings.tightSelfClosing||l==="/"||l&&l!=='"'&&l!=="'")&&a.push(" "),a.push("/")),a.push(">")),a.push(c),!s&&(!i||!ji(e,t,n))&&a.push("</"+e.tagName+">"),a.join("")}function ng(e,t){const n=[];let o=-1,r;if(t){for(r in t)if(t[r]!==null&&t[r]!==void 0){const i=og(e,r,t[r]);i&&n.push(i)}}for(;++o<n.length;){const i=e.settings.tightAttributes?n[o].charAt(n[o].length-1):void 0;o!==n.length-1&&i!=='"'&&i!=="'"&&(n[o]+=" ")}return n.join("")}function og(e,t,n){const o=sp(e.schema,t),r=e.settings.allowParseErrors&&e.schema.space==="html"?0:1,i=e.settings.allowDangerousCharacters?0:1;let s=e.quote,a;if(o.overloadedBoolean&&(n===o.attribute||n==="")?n=!0:(o.boolean||o.overloadedBoolean)&&(typeof n!="string"||n===o.attribute||n==="")&&(n=!!n),n==null||n===!1||typeof n=="number"&&Number.isNaN(n))return"";const l=hn(o.attribute,Object.assign({},e.settings.characterReferences,{subset:po.name[r][i]}));return n===!0||(n=Array.isArray(n)?(o.commaSeparated?Op:Rp)(n,{padLeft:!e.settings.tightCommaSeparatedLists}):String(n),e.settings.collapseEmptyAttributes&&!n)?l:(e.settings.preferUnquoted&&(a=hn(n,Object.assign({},e.settings.characterReferences,{attribute:!0,subset:po.unquoted[r][i]}))),a!==n&&(e.settings.quoteSmart&&Ls(n,s)>Ls(n,e.alternative)&&(s=e.alternative),a=s+hn(n,Object.assign({},e.settings.characterReferences,{subset:(s==="'"?po.single:po.double)[r][i],attribute:!0}))+s),l+(a&&"="+a))}const rg=["<","&"];function Bl(e,t,n,o){return n&&n.type==="element"&&(n.tagName==="script"||n.tagName==="style")?e.value:hn(e.value,Object.assign({},o.settings.characterReferences,{subset:rg}))}function ig(e,t,n,o){return o.settings.allowDangerousHtml?e.value:Bl(e,t,n,o)}function sg(e,t,n,o){return o.all(e)}const ag=cp("type",{invalid:lg,unknown:ug,handlers:{comment:Ap,doctype:Ip,element:tg,raw:ig,root:sg,text:Bl}});function lg(e){throw new Error("Expected node, not `"+e+"`")}function ug(e){const t=e;throw new Error("Cannot compile unknown node `"+t.type+"`")}const cg={},dg={},fg=[];function hg(e,t){const n=t||cg,o=n.quote||'"',r=o==='"'?"'":'"';if(o!=='"'&&o!=="'")throw new Error("Invalid quote `"+o+"`, expected `'` or `\"`");return{one:pg,all:gg,settings:{omitOptionalTags:n.omitOptionalTags||!1,allowParseErrors:n.allowParseErrors||!1,allowDangerousCharacters:n.allowDangerousCharacters||!1,quoteSmart:n.quoteSmart||!1,preferUnquoted:n.preferUnquoted||!1,tightAttributes:n.tightAttributes||!1,upperDoctype:n.upperDoctype||!1,tightDoctype:n.tightDoctype||!1,bogusComments:n.bogusComments||!1,tightCommaSeparatedLists:n.tightCommaSeparatedLists||!1,tightSelfClosing:n.tightSelfClosing||!1,collapseEmptyAttributes:n.collapseEmptyAttributes||!1,allowDangerousHtml:n.allowDangerousHtml||!1,voids:n.voids||ep,characterReferences:n.characterReferences||dg,closeSelfClosing:n.closeSelfClosing||!1,closeEmptyElements:n.closeEmptyElements||!1},schema:n.space==="svg"?Rl:up,quote:o,alternative:r}.one(Array.isArray(e)?{type:"root",children:e}:e,void 0,void 0)}function pg(e,t,n){return ag(e,t,n,this)}function gg(e){const t=[],n=e&&e.children||fg;let o=-1;for(;++o<n.length;)t[o]=this.one(n[o],o,e);return t.join("")}function jo(e,t){const n=typeof e=="string"?{}:{...e.colorReplacements},o=typeof e=="string"?e:e.name;for(const[r,i]of Object.entries(t?.colorReplacements||{}))typeof i=="string"?n[r]=i:r===o&&Object.assign(n,i);return n}function zt(e,t){return e&&(t?.[e?.toLowerCase()]||e)}function mg(e){return Array.isArray(e)?e:[e]}async function zl(e){return Promise.resolve(typeof e=="function"?e():e).then(t=>t.default||t)}function qi(e){return!e||["plaintext","txt","text","plain"].includes(e)}function Vl(e){return e==="ansi"||qi(e)}function Ui(e){return e==="none"}function Fl(e){return Ui(e)}function Hl(e,t){if(!t)return e;e.properties||={},e.properties.class||=[],typeof e.properties.class=="string"&&(e.properties.class=e.properties.class.split(/\s+/g)),Array.isArray(e.properties.class)||(e.properties.class=[]);const n=Array.isArray(t)?t:t.split(/\s+/g);for(const o of n)o&&!e.properties.class.includes(o)&&e.properties.class.push(o);return e}function mr(e,t=!1){if(e.length===0)return[["",0]];const n=e.split(/(\r?\n)/g);let o=0;const r=[];for(let i=0;i<n.length;i+=2){const s=t?n[i]+(n[i+1]||""):n[i];r.push([s,o]),o+=n[i].length,o+=n[i+1]?.length||0}return r}function vg(e){const t=mr(e,!0).map(([r])=>r);function n(r){if(r===e.length)return{line:t.length-1,character:t[t.length-1].length};let i=r,s=0;for(const a of t){if(i<a.length)break;i-=a.length,s++}return{line:s,character:i}}function o(r,i){let s=0;for(let a=0;a<r;a++)s+=t[a].length;return s+=i,s}return{lines:t,indexToPos:n,posToIndex:o}}function yg(e,t,n){const o=new Set;for(const i of e.matchAll(/:?lang=["']([^"']+)["']/g)){const s=i[1].toLowerCase().trim();s&&o.add(s)}for(const i of e.matchAll(/(?:```|~~~)([\w-]+)/g)){const s=i[1].toLowerCase().trim();s&&o.add(s)}for(const i of e.matchAll(/\\begin\{([\w-]+)\}/g)){const s=i[1].toLowerCase().trim();s&&o.add(s)}for(const i of e.matchAll(/<script\s+(?:type|lang)=["']([^"']+)["']/gi)){const s=i[1].toLowerCase().trim(),a=s.includes("/")?s.split("/").pop():s;a&&o.add(a)}if(!n)return Array.from(o);const r=n.getBundledLanguages();return Array.from(o).filter(i=>i&&r[i])}const Wi="light-dark()",_g=["color","background-color"];function wg(e,t){let n=0;const o=[];for(const r of t)r>n&&o.push({...e,content:e.content.slice(n,r),offset:e.offset+n}),n=r;return n<e.content.length&&o.push({...e,content:e.content.slice(n),offset:e.offset+n}),o}function bg(e,t){const n=Array.from(t instanceof Set?t:new Set(t)).sort((o,r)=>o-r);return n.length?e.map(o=>o.flatMap(r=>{const i=n.filter(s=>r.offset<s&&s<r.offset+r.content.length).map(s=>s-r.offset).sort((s,a)=>s-a);return i.length?wg(r,i):r})):e}function xg(e,t,n,o,r="css-vars"){const i={content:e.content,explanation:e.explanation,offset:e.offset},s=t.map(c=>qo(e.variants[c])),a=new Set(s.flatMap(c=>Object.keys(c))),l={},u=(c,d)=>{const h=d==="color"?"":d==="background-color"?"-bg":`-${d}`;return n+t[c]+(d==="color"?"":h)};return s.forEach((c,d)=>{for(const h of a){const f=c[h]||"inherit";if(d===0&&o&&_g.includes(h))if(o===Wi&&s.length>1){const p=t.findIndex(b=>b==="light"),v=t.findIndex(b=>b==="dark");if(p===-1||v===-1)throw new Be('When using `defaultColor: "light-dark()"`, you must provide both `light` and `dark` themes');const _=s[p][h]||"inherit",y=s[v][h]||"inherit";l[h]=`light-dark(${_}, ${y})`,r==="css-vars"&&(l[u(d,h)]=f)}else l[h]=f;else r==="css-vars"&&(l[u(d,h)]=f)}}),i.htmlStyle=l,i}function qo(e){const t={};if(e.color&&(t.color=e.color),e.bgColor&&(t["background-color"]=e.bgColor),e.fontStyle){e.fontStyle&We.Italic&&(t["font-style"]="italic"),e.fontStyle&We.Bold&&(t["font-weight"]="bold");const n=[];e.fontStyle&We.Underline&&n.push("underline"),e.fontStyle&We.Strikethrough&&n.push("line-through"),n.length&&(t["text-decoration"]=n.join(" "))}return t}function gi(e){return typeof e=="string"?e:Object.entries(e).map(([t,n])=>`${t}:${n}`).join(";")}const Gl=new WeakMap;function vr(e,t){Gl.set(e,t)}function Xn(e){return Gl.get(e)}class An{_stacks={};lang;get themes(){return Object.keys(this._stacks)}get theme(){return this.themes[0]}get _stack(){return this._stacks[this.theme]}static initial(t,n){return new An(Object.fromEntries(mg(n).map(o=>[o,ci])),t)}constructor(...t){if(t.length===2){const[n,o]=t;this.lang=o,this._stacks=n}else{const[n,o,r]=t;this.lang=o,this._stacks={[r]:n}}}getInternalStack(t=this.theme){return this._stacks[t]}getScopes(t=this.theme){return Eg(this._stacks[t])}toJSON(){return{lang:this.lang,theme:this.theme,themes:this.themes,scopes:this.getScopes()}}}function Eg(e){const t=[],n=new Set;function o(r){if(n.has(r))return;n.add(r);const i=r?.nameScopesList?.scopeName;i&&t.push(i),r.parent&&o(r.parent)}return o(e),t}function kg(e,t){if(!(e instanceof An))throw new Be("Invalid grammar state");return e.getInternalStack(t)}function Sg(){const e=new WeakMap;function t(n){if(!e.has(n.meta)){let o=function(s){if(typeof s=="number"){if(s<0||s>n.source.length)throw new Be(`Invalid decoration offset: ${s}. Code length: ${n.source.length}`);return{...r.indexToPos(s),offset:s}}else{const a=r.lines[s.line];if(a===void 0)throw new Be(`Invalid decoration position ${JSON.stringify(s)}. Lines length: ${r.lines.length}`);let l=s.character;if(l<0&&(l=a.length+l),l<0||l>a.length)throw new Be(`Invalid decoration position ${JSON.stringify(s)}. Line ${s.line} length: ${a.length}`);return{...s,character:l,offset:r.posToIndex(s.line,l)}}};const r=vg(n.source),i=(n.options.decorations||[]).map(s=>({...s,start:o(s.start),end:o(s.end)}));Cg(i),e.set(n.meta,{decorations:i,converter:r,source:n.source})}return e.get(n.meta)}return{name:"shiki:decorations",tokens(n){if(!this.options.decorations?.length)return;const r=t(this).decorations.flatMap(s=>[s.start.offset,s.end.offset]);return bg(n,r)},code(n){if(!this.options.decorations?.length)return;const o=t(this),r=Array.from(n.children).filter(c=>c.type==="element"&&c.tagName==="span");if(r.length!==o.converter.lines.length)throw new Be(`Number of lines in code element (${r.length}) does not match the number of lines in the source (${o.converter.lines.length}). Failed to apply decorations.`);function i(c,d,h,f){const p=r[c];let v="",_=-1,y=-1;if(d===0&&(_=0),h===0&&(y=0),h===Number.POSITIVE_INFINITY&&(y=p.children.length),_===-1||y===-1)for(let g=0;g<p.children.length;g++)v+=jl(p.children[g]),_===-1&&v.length===d&&(_=g+1),y===-1&&v.length===h&&(y=g+1);if(_===-1)throw new Be(`Failed to find start index for decoration ${JSON.stringify(f.start)}`);if(y===-1)throw new Be(`Failed to find end index for decoration ${JSON.stringify(f.end)}`);const b=p.children.slice(_,y);if(!f.alwaysWrap&&b.length===p.children.length)a(p,f,"line");else if(!f.alwaysWrap&&b.length===1&&b[0].type==="element")a(b[0],f,"token");else{const g={type:"element",tagName:"span",properties:{},children:b};a(g,f,"wrapper"),p.children.splice(_,b.length,g)}}function s(c,d){r[c]=a(r[c],d,"line")}function a(c,d,h){const f=d.properties||{},p=d.transform||(v=>v);return c.tagName=d.tagName||"span",c.properties={...c.properties,...f,class:c.properties.class},d.properties?.class&&Hl(c,d.properties.class),c=p(c,h)||c,c}const l=[],u=o.decorations.sort((c,d)=>d.start.offset-c.start.offset||c.end.offset-d.end.offset);for(const c of u){const{start:d,end:h}=c;if(d.line===h.line)i(d.line,d.character,h.character,c);else if(d.line<h.line){i(d.line,d.character,Number.POSITIVE_INFINITY,c);for(let f=d.line+1;f<h.line;f++)l.unshift(()=>s(f,c));i(h.line,0,h.character,c)}}l.forEach(c=>c())}}}function Cg(e){for(let t=0;t<e.length;t++){const n=e[t];if(n.start.offset>n.end.offset)throw new Be(`Invalid decoration range: ${JSON.stringify(n.start)} - ${JSON.stringify(n.end)}`);for(let o=t+1;o<e.length;o++){const r=e[o],i=n.start.offset<=r.start.offset&&r.start.offset<n.end.offset,s=n.start.offset<r.end.offset&&r.end.offset<=n.end.offset,a=r.start.offset<=n.start.offset&&n.start.offset<r.end.offset,l=r.start.offset<n.end.offset&&n.end.offset<=r.end.offset;if(i||s||a||l){if(i&&s||a&&l||a&&n.start.offset===n.end.offset||s&&r.start.offset===r.end.offset)continue;throw new Be(`Decorations ${JSON.stringify(n.start)} and ${JSON.stringify(r.start)} intersect.`)}}}}function jl(e){return e.type==="text"?e.value:e.type==="element"?e.children.map(jl).join(""):""}const Ng=[Sg()];function Uo(e){const t=Tg(e.transformers||[]);return[...t.pre,...t.normal,...t.post,...Ng]}function Tg(e){const t=[],n=[],o=[];for(const r of e)switch(r.enforce){case"pre":t.push(r);break;case"post":n.push(r);break;default:o.push(r)}return{pre:t,post:n,normal:o}}var Wt=["black","red","green","yellow","blue","magenta","cyan","white","brightBlack","brightRed","brightGreen","brightYellow","brightBlue","brightMagenta","brightCyan","brightWhite"],Br={1:"bold",2:"dim",3:"italic",4:"underline",7:"reverse",8:"hidden",9:"strikethrough"};function Pg(e,t){const n=e.indexOf("\x1B",t);if(n!==-1&&e[n+1]==="["){const o=e.indexOf("m",n);if(o!==-1)return{sequence:e.substring(n+2,o).split(";"),startPosition:n,position:o+1}}return{position:e.length}}function zs(e){const t=e.shift();if(t==="2"){const n=e.splice(0,3).map(o=>Number.parseInt(o));return n.length!==3||n.some(o=>Number.isNaN(o))?void 0:{type:"rgb",rgb:n}}else if(t==="5"){const n=e.shift();if(n)return{type:"table",index:Number(n)}}}function Ag(e){const t=[];for(;e.length>0;){const n=e.shift();if(!n)continue;const o=Number.parseInt(n);if(!Number.isNaN(o))if(o===0)t.push({type:"resetAll"});else if(o<=9)Br[o]&&t.push({type:"setDecoration",value:Br[o]});else if(o<=29){const r=Br[o-20];r&&(t.push({type:"resetDecoration",value:r}),r==="dim"&&t.push({type:"resetDecoration",value:"bold"}))}else if(o<=37)t.push({type:"setForegroundColor",value:{type:"named",name:Wt[o-30]}});else if(o===38){const r=zs(e);r&&t.push({type:"setForegroundColor",value:r})}else if(o===39)t.push({type:"resetForegroundColor"});else if(o<=47)t.push({type:"setBackgroundColor",value:{type:"named",name:Wt[o-40]}});else if(o===48){const r=zs(e);r&&t.push({type:"setBackgroundColor",value:r})}else o===49?t.push({type:"resetBackgroundColor"}):o===53?t.push({type:"setDecoration",value:"overline"}):o===55?t.push({type:"resetDecoration",value:"overline"}):o>=90&&o<=97?t.push({type:"setForegroundColor",value:{type:"named",name:Wt[o-90+8]}}):o>=100&&o<=107&&t.push({type:"setBackgroundColor",value:{type:"named",name:Wt[o-100+8]}})}return t}function Ig(){let e=null,t=null,n=new Set;return{parse(o){const r=[];let i=0;do{const s=Pg(o,i),a=s.sequence?o.substring(i,s.startPosition):o.substring(i);if(a.length>0&&r.push({value:a,foreground:e,background:t,decorations:new Set(n)}),s.sequence){const l=Ag(s.sequence);for(const u of l)u.type==="resetAll"?(e=null,t=null,n.clear()):u.type==="resetForegroundColor"?e=null:u.type==="resetBackgroundColor"?t=null:u.type==="resetDecoration"&&n.delete(u.value);for(const u of l)u.type==="setForegroundColor"?e=u.value:u.type==="setBackgroundColor"?t=u.value:u.type==="setDecoration"&&n.add(u.value)}i=s.position}while(i<o.length);return r}}}var Og={black:"#000000",red:"#bb0000",green:"#00bb00",yellow:"#bbbb00",blue:"#0000bb",magenta:"#ff00ff",cyan:"#00bbbb",white:"#eeeeee",brightBlack:"#555555",brightRed:"#ff5555",brightGreen:"#00ff00",brightYellow:"#ffff55",brightBlue:"#5555ff",brightMagenta:"#ff55ff",brightCyan:"#55ffff",brightWhite:"#ffffff"};function Rg(e=Og){function t(a){return e[a]}function n(a){return`#${a.map(l=>Math.max(0,Math.min(l,255)).toString(16).padStart(2,"0")).join("")}`}let o;function r(){if(o)return o;o=[];for(let u=0;u<Wt.length;u++)o.push(t(Wt[u]));let a=[0,95,135,175,215,255];for(let u=0;u<6;u++)for(let c=0;c<6;c++)for(let d=0;d<6;d++)o.push(n([a[u],a[c],a[d]]));let l=8;for(let u=0;u<24;u++,l+=10)o.push(n([l,l,l]));return o}function i(a){return r()[a]}function s(a){switch(a.type){case"named":return t(a.name);case"rgb":return n(a.rgb);case"table":return i(a.index)}}return{value:s}}const Mg={black:"#000000",red:"#cd3131",green:"#0DBC79",yellow:"#E5E510",blue:"#2472C8",magenta:"#BC3FBC",cyan:"#11A8CD",white:"#E5E5E5",brightBlack:"#666666",brightRed:"#F14C4C",brightGreen:"#23D18B",brightYellow:"#F5F543",brightBlue:"#3B8EEA",brightMagenta:"#D670D6",brightCyan:"#29B8DB",brightWhite:"#FFFFFF"};function Lg(e,t,n){const o=jo(e,n),r=mr(t),i=Object.fromEntries(Wt.map(l=>{const u=`terminal.ansi${l[0].toUpperCase()}${l.substring(1)}`,c=e.colors?.[u];return[l,c||Mg[l]]})),s=Rg(i),a=Ig();return r.map(l=>a.parse(l[0]).map(u=>{let c,d;u.decorations.has("reverse")?(c=u.background?s.value(u.background):e.bg,d=u.foreground?s.value(u.foreground):e.fg):(c=u.foreground?s.value(u.foreground):e.fg,d=u.background?s.value(u.background):void 0),c=zt(c,o),d=zt(d,o),u.decorations.has("dim")&&(c=Dg(c));let h=We.None;return u.decorations.has("bold")&&(h|=We.Bold),u.decorations.has("italic")&&(h|=We.Italic),u.decorations.has("underline")&&(h|=We.Underline),u.decorations.has("strikethrough")&&(h|=We.Strikethrough),{content:u.value,offset:l[1],color:c,bgColor:d,fontStyle:h}}))}function Dg(e){const t=e.match(/#([0-9a-f]{3,8})/i);if(t){const o=t[1];if(o.length===8){const r=Math.round(Number.parseInt(o.slice(6,8),16)/2).toString(16).padStart(2,"0");return`#${o.slice(0,6)}${r}`}else{if(o.length===6)return`#${o}80`;if(o.length===4){const r=o[0],i=o[1],s=o[2],a=o[3],l=Math.round(Number.parseInt(`${a}${a}`,16)/2).toString(16).padStart(2,"0");return`#${r}${r}${i}${i}${s}${s}${l}`}else if(o.length===3){const r=o[0],i=o[1],s=o[2];return`#${r}${r}${i}${i}${s}${s}80`}}}const n=e.match(/var\((--[\w-]+-ansi-[\w-]+)\)/);return n?`var(${n[1]}-dim)`:e}function Yi(e,t,n={}){const{theme:o=e.getLoadedThemes()[0]}=n,r=e.resolveLangAlias(n.lang||"text");if(qi(r)||Ui(o))return mr(t).map(l=>[{content:l[0],offset:l[1]}]);const{theme:i,colorMap:s}=e.setTheme(o);if(r==="ansi")return Lg(i,t,n);const a=e.getLanguage(n.lang||"text");if(n.grammarState){if(n.grammarState.lang!==a.name)throw new Be(`Grammar state language "${n.grammarState.lang}" does not match highlight language "${a.name}"`);if(!n.grammarState.themes.includes(i.name))throw new Be(`Grammar state themes "${n.grammarState.themes}" do not contain highlight theme "${i.name}"`)}return Bg(t,a,i,s,n)}function $g(...e){if(e.length===2)return Xn(e[1]);const[t,n,o={}]=e,{lang:r="text",theme:i=t.getLoadedThemes()[0]}=o;if(qi(r)||Ui(i))throw new Be("Plain language does not have grammar state");if(r==="ansi")throw new Be("ANSI language does not have grammar state");const{theme:s,colorMap:a}=t.setTheme(i),l=t.getLanguage(r);return new An(Xi(n,l,s,a,o).stateStack,l.name,s.name)}function Bg(e,t,n,o,r){const i=Xi(e,t,n,o,r),s=new An(i.stateStack,t.name,n.name);return vr(i.tokens,s),i.tokens}function Xi(e,t,n,o,r){const i=jo(n,r),{tokenizeMaxLineLength:s=0,tokenizeTimeLimit:a=500}=r,l=mr(e);let u=r.grammarState?kg(r.grammarState,n.name)??ci:r.grammarContextCode!=null?Xi(r.grammarContextCode,t,n,o,{...r,grammarState:void 0,grammarContextCode:void 0}).stateStack:ci,c=[];const d=[];for(let h=0,f=l.length;h<f;h++){const[p,v]=l[h];if(p===""){c=[],d.push([]);continue}if(s>0&&p.length>=s){c=[],d.push([{content:p,offset:v,color:"",fontStyle:0}]);continue}let _,y,b;r.includeExplanation&&(_=t.tokenizeLine(p,u,a),y=_.tokens,b=0);const g=t.tokenizeLine2(p,u,a),w=g.tokens.length/2;for(let T=0;T<w;T++){const M=g.tokens[2*T],z=T+1<w?g.tokens[2*T+2]:p.length;if(M===z)continue;const H=g.tokens[2*T+1],K=zt(o[wn.getForeground(H)],i),P=wn.getFontStyle(H),C={content:p.substring(M,z),offset:v+M,color:K,fontStyle:P};if(r.includeExplanation){const x=[];if(r.includeExplanation!=="scopeName")for(const m of n.settings){let A;switch(typeof m.scope){case"string":A=m.scope.split(/,/).map(k=>k.trim());break;case"object":A=m.scope;break;default:continue}x.push({settings:m,selectors:A.map(k=>k.split(/ /))})}C.explanation=[];let N=0;for(;M+N<z;){const m=y[b],A=p.substring(m.startIndex,m.endIndex);N+=A.length,C.explanation.push({content:A,scopes:r.includeExplanation==="scopeName"?zg(m.scopes):Vg(x,m.scopes)}),b+=1}}c.push(C)}d.push(c),c=[],u=g.ruleStack}return{tokens:d,stateStack:u}}function zg(e){return e.map(t=>({scopeName:t}))}function Vg(e,t){const n=[];for(let o=0,r=t.length;o<r;o++){const i=t[o];n[o]={scopeName:i,themeMatches:Hg(e,i,t.slice(0,o))}}return n}function Vs(e,t){return e===t||t.substring(0,e.length)===e&&t[e.length]==="."}function Fg(e,t,n){if(!Vs(e[e.length-1],t))return!1;let o=e.length-2,r=n.length-1;for(;o>=0&&r>=0;)Vs(e[o],n[r])&&(o-=1),r-=1;return o===-1}function Hg(e,t,n){const o=[];for(const{selectors:r,settings:i}of e)for(const s of r)if(Fg(s,t,n)){o.push(i);break}return o}function ql(e,t,n){const o=Object.entries(n.themes).filter(l=>l[1]).map(l=>({color:l[0],theme:l[1]})),r=o.map(l=>{const u=Yi(e,t,{...n,theme:l.theme}),c=Xn(u),d=typeof l.theme=="string"?l.theme:l.theme.name;return{tokens:u,state:c,theme:d}}),i=Gg(...r.map(l=>l.tokens)),s=i[0].map((l,u)=>l.map((c,d)=>{const h={content:c.content,variants:{},offset:c.offset};return"includeExplanation"in n&&n.includeExplanation&&(h.explanation=c.explanation),i.forEach((f,p)=>{const{content:v,explanation:_,offset:y,...b}=f[u][d];h.variants[o[p].color]=b}),h})),a=r[0].state?new An(Object.fromEntries(r.map(l=>[l.theme,l.state?.getInternalStack(l.theme)])),r[0].state.lang):void 0;return a&&vr(s,a),s}function Gg(...e){const t=e.map(()=>[]),n=e.length;for(let o=0;o<e[0].length;o++){const r=e.map(l=>l[o]),i=t.map(()=>[]);t.forEach((l,u)=>l.push(i[u]));const s=r.map(()=>0),a=r.map(l=>l[0]);for(;a.every(l=>l);){const l=Math.min(...a.map(u=>u.content.length));for(let u=0;u<n;u++){const c=a[u];c.content.length===l?(i[u].push(c),s[u]+=1,a[u]=r[u][s[u]]):(i[u].push({...c,content:c.content.slice(0,l)}),a[u]={...c,content:c.content.slice(l),offset:c.offset+l})}}}return t}function Wo(e,t,n){let o,r,i,s,a,l;if("themes"in n){const{defaultColor:u="light",cssVariablePrefix:c="--shiki-",colorsRendering:d="css-vars"}=n,h=Object.entries(n.themes).filter(y=>y[1]).map(y=>({color:y[0],theme:y[1]})).sort((y,b)=>y.color===u?-1:b.color===u?1:0);if(h.length===0)throw new Be("`themes` option must not be empty");const f=ql(e,t,n);if(l=Xn(f),u&&Wi!==u&&!h.find(y=>y.color===u))throw new Be(`\`themes\` option must contain the defaultColor key \`${u}\``);const p=h.map(y=>e.getTheme(y.theme)),v=h.map(y=>y.color);i=f.map(y=>y.map(b=>xg(b,v,c,u,d))),l&&vr(i,l);const _=h.map(y=>jo(y.theme,n));r=Fs(h,p,_,c,u,"fg",d),o=Fs(h,p,_,c,u,"bg",d),s=`shiki-themes ${p.map(y=>y.name).join(" ")}`,a=u?void 0:[r,o].join(";")}else if("theme"in n){const u=jo(n.theme,n);i=Yi(e,t,n);const c=e.getTheme(n.theme);o=zt(c.bg,u),r=zt(c.fg,u),s=c.name,l=Xn(i)}else throw new Be("Invalid options, either `theme` or `themes` must be provided");return{tokens:i,fg:r,bg:o,themeName:s,rootStyle:a,grammarState:l}}function Fs(e,t,n,o,r,i,s){return e.map((a,l)=>{const u=zt(t[l][i],n[l])||"inherit",c=`${o+a.color}${i==="bg"?"-bg":""}:${u}`;if(l===0&&r){if(r===Wi&&e.length>1){const d=e.findIndex(v=>v.color==="light"),h=e.findIndex(v=>v.color==="dark");if(d===-1||h===-1)throw new Be('When using `defaultColor: "light-dark()"`, you must provide both `light` and `dark` themes');const f=zt(t[d][i],n[d])||"inherit",p=zt(t[h][i],n[h])||"inherit";return`light-dark(${f}, ${p});${c}`}return u}return s==="css-vars"?c:null}).filter(a=>!!a).join(";")}function Yo(e,t,n,o={meta:{},options:n,codeToHast:(r,i)=>Yo(e,r,i),codeToTokens:(r,i)=>Wo(e,r,i)}){let r=t;for(const p of Uo(n))r=p.preprocess?.call(o,r,n)||r;let{tokens:i,fg:s,bg:a,themeName:l,rootStyle:u,grammarState:c}=Wo(e,r,n);const{mergeWhitespaces:d=!0,mergeSameStyleTokens:h=!1}=n;d===!0?i=qg(i):d==="never"&&(i=Ug(i)),h&&(i=Wg(i));const f={...o,get source(){return r}};for(const p of Uo(n))i=p.tokens?.call(f,i)||i;return jg(i,{...n,fg:s,bg:a,themeName:l,rootStyle:n.rootStyle===!1?!1:n.rootStyle??u},f,c)}function jg(e,t,n,o=Xn(e)){const r=Uo(t),i=[],s={type:"root",children:[]},{structure:a="classic",tabindex:l="0"}=t,u={class:`shiki ${t.themeName||""}`};t.rootStyle!==!1&&(t.rootStyle!=null?u.style=t.rootStyle:u.style=`background-color:${t.bg};color:${t.fg}`),l!==!1&&l!=null&&(u.tabindex=l.toString());for(const[v,_]of Object.entries(t.meta||{}))v.startsWith("_")||(u[v]=_);let c={type:"element",tagName:"pre",properties:u,children:[],data:t.data},d={type:"element",tagName:"code",properties:{},children:i};const h=[],f={...n,structure:a,addClassToHast:Hl,get source(){return n.source},get tokens(){return e},get options(){return t},get root(){return s},get pre(){return c},get code(){return d},get lines(){return h}};if(e.forEach((v,_)=>{_&&(a==="inline"?s.children.push({type:"element",tagName:"br",properties:{},children:[]}):a==="classic"&&i.push({type:"text",value:`
13
- `}));let y={type:"element",tagName:"span",properties:{class:"line"},children:[]},b=0;for(const g of v){let w={type:"element",tagName:"span",properties:{...g.htmlAttrs},children:[{type:"text",value:g.content}]};const T=gi(g.htmlStyle||qo(g));T&&(w.properties.style=T);for(const M of r)w=M?.span?.call(f,w,_+1,b,y,g)||w;a==="inline"?s.children.push(w):a==="classic"&&y.children.push(w),b+=g.content.length}if(a==="classic"){for(const g of r)y=g?.line?.call(f,y,_+1)||y;h.push(y),i.push(y)}else a==="inline"&&h.push(y)}),a==="classic"){for(const v of r)d=v?.code?.call(f,d)||d;c.children.push(d);for(const v of r)c=v?.pre?.call(f,c)||c;s.children.push(c)}else if(a==="inline"){const v=[];let _={type:"element",tagName:"span",properties:{class:"line"},children:[]};for(const g of s.children)g.type==="element"&&g.tagName==="br"?(v.push(_),_={type:"element",tagName:"span",properties:{class:"line"},children:[]}):(g.type==="element"||g.type==="text")&&_.children.push(g);v.push(_);let b={type:"element",tagName:"code",properties:{},children:v};for(const g of r)b=g?.code?.call(f,b)||b;s.children=[];for(let g=0;g<b.children.length;g++){g>0&&s.children.push({type:"element",tagName:"br",properties:{},children:[]});const w=b.children[g];w.type==="element"&&s.children.push(...w.children)}}let p=s;for(const v of r)p=v?.root?.call(f,p)||p;return o&&vr(p,o),p}function qg(e){return e.map(t=>{const n=[];let o="",r;return t.forEach((i,s)=>{const l=!(i.fontStyle&&(i.fontStyle&We.Underline||i.fontStyle&We.Strikethrough));l&&i.content.match(/^\s+$/)&&t[s+1]?(r===void 0&&(r=i.offset),o+=i.content):o?(l?n.push({...i,offset:r,content:o+i.content}):n.push({content:o,offset:r},i),r=void 0,o=""):n.push(i)}),n})}function Ug(e){return e.map(t=>t.flatMap(n=>{if(n.content.match(/^\s+$/))return n;const o=n.content.match(/^(\s*)(.*?)(\s*)$/);if(!o)return n;const[,r,i,s]=o;if(!r&&!s)return n;const a=[{...n,offset:n.offset+r.length,content:i}];return r&&a.unshift({content:r,offset:n.offset}),s&&a.push({content:s,offset:n.offset+r.length+i.length}),a}))}function Wg(e){return e.map(t=>{const n=[];for(const o of t){if(n.length===0){n.push({...o});continue}const r=n[n.length-1],i=gi(r.htmlStyle||qo(r)),s=gi(o.htmlStyle||qo(o)),a=r.fontStyle&&(r.fontStyle&We.Underline||r.fontStyle&We.Strikethrough),l=o.fontStyle&&(o.fontStyle&We.Underline||o.fontStyle&We.Strikethrough);!a&&!l&&i===s?r.content+=o.content:n.push({...o})}return n})}const Yg=hg;function Xg(e,t,n){const o={meta:{},options:n,codeToHast:(i,s)=>Yo(e,i,s),codeToTokens:(i,s)=>Wo(e,i,s)};let r=Yg(Yo(e,t,n,o));for(const i of Uo(n))r=i.postprocess?.call(o,r,n)||r;return r}const Hs={light:"#333333",dark:"#bbbbbb"},Gs={light:"#fffffe",dark:"#1e1e1e"},js="__shiki_resolved";function Ki(e){if(e?.[js])return e;const t={...e};t.tokenColors&&!t.settings&&(t.settings=t.tokenColors,delete t.tokenColors),t.type||="dark",t.colorReplacements={...t.colorReplacements},t.settings||=[];let{bg:n,fg:o}=t;if(!n||!o){const a=t.settings?t.settings.find(l=>!l.name&&!l.scope):void 0;a?.settings?.foreground&&(o=a.settings.foreground),a?.settings?.background&&(n=a.settings.background),!o&&t?.colors?.["editor.foreground"]&&(o=t.colors["editor.foreground"]),!n&&t?.colors?.["editor.background"]&&(n=t.colors["editor.background"]),o||(o=t.type==="light"?Hs.light:Hs.dark),n||(n=t.type==="light"?Gs.light:Gs.dark),t.fg=o,t.bg=n}t.settings[0]&&t.settings[0].settings&&!t.settings[0].scope||t.settings.unshift({settings:{foreground:t.fg,background:t.bg}});let r=0;const i=new Map;function s(a){if(i.has(a))return i.get(a);r+=1;const l=`#${r.toString(16).padStart(8,"0").toLowerCase()}`;return t.colorReplacements?.[`#${l}`]?s(a):(i.set(a,l),l)}t.settings=t.settings.map(a=>{const l=a.settings?.foreground&&!a.settings.foreground.startsWith("#"),u=a.settings?.background&&!a.settings.background.startsWith("#");if(!l&&!u)return a;const c={...a,settings:{...a.settings}};if(l){const d=s(a.settings.foreground);t.colorReplacements[d]=a.settings.foreground,c.settings.foreground=d}if(u){const d=s(a.settings.background);t.colorReplacements[d]=a.settings.background,c.settings.background=d}return c});for(const a of Object.keys(t.colors||{}))if((a==="editor.foreground"||a==="editor.background"||a.startsWith("terminal.ansi"))&&!t.colors[a]?.startsWith("#")){const l=s(t.colors[a]);t.colorReplacements[l]=t.colors[a],t.colors[a]=l}return Object.defineProperty(t,js,{enumerable:!1,writable:!1,value:!0}),t}async function Ul(e){return Array.from(new Set((await Promise.all(e.filter(t=>!Vl(t)).map(async t=>await zl(t).then(n=>Array.isArray(n)?n:[n])))).flat()))}async function Wl(e){return(await Promise.all(e.map(async n=>Fl(n)?null:Ki(await zl(n))))).filter(n=>!!n)}let Kg=3;function Zg(e,t=3){t>Kg||console.trace(`[SHIKI DEPRECATE]: ${e}`)}let un=class extends Error{constructor(t){super(t),this.name="ShikiError"}};function Yl(e,t){if(!t)return e;if(t[e]){const n=new Set([e]);for(;t[e];){if(e=t[e],n.has(e))throw new un(`Circular alias \`${Array.from(n).join(" -> ")} -> ${e}\``);n.add(e)}}return e}class Jg extends Qh{constructor(t,n,o,r={}){super(t),this._resolver=t,this._themes=n,this._langs=o,this._alias=r,this._themes.map(i=>this.loadTheme(i)),this.loadLanguages(this._langs)}_resolvedThemes=new Map;_resolvedGrammars=new Map;_langMap=new Map;_langGraph=new Map;_textmateThemeCache=new WeakMap;_loadedThemesCache=null;_loadedLanguagesCache=null;getTheme(t){return typeof t=="string"?this._resolvedThemes.get(t):this.loadTheme(t)}loadTheme(t){const n=Ki(t);return n.name&&(this._resolvedThemes.set(n.name,n),this._loadedThemesCache=null),n}getLoadedThemes(){return this._loadedThemesCache||(this._loadedThemesCache=[...this._resolvedThemes.keys()]),this._loadedThemesCache}setTheme(t){let n=this._textmateThemeCache.get(t);n||(n=zo.createFromRawTheme(t),this._textmateThemeCache.set(t,n)),this._syncRegistry.setTheme(n)}getGrammar(t){return t=Yl(t,this._alias),this._resolvedGrammars.get(t)}loadLanguage(t){if(this.getGrammar(t.name))return;const n=new Set([...this._langMap.values()].filter(i=>i.embeddedLangsLazy?.includes(t.name)));this._resolver.addLanguage(t);const o={balancedBracketSelectors:t.balancedBracketSelectors||["*"],unbalancedBracketSelectors:t.unbalancedBracketSelectors||[]};this._syncRegistry._rawGrammars.set(t.scopeName,t);const r=this.loadGrammarWithConfiguration(t.scopeName,1,o);if(r.name=t.name,this._resolvedGrammars.set(t.name,r),t.aliases&&t.aliases.forEach(i=>{this._alias[i]=t.name}),this._loadedLanguagesCache=null,n.size)for(const i of n)this._resolvedGrammars.delete(i.name),this._loadedLanguagesCache=null,this._syncRegistry?._injectionGrammars?.delete(i.scopeName),this._syncRegistry?._grammars?.delete(i.scopeName),this.loadLanguage(this._langMap.get(i.name))}dispose(){super.dispose(),this._resolvedThemes.clear(),this._resolvedGrammars.clear(),this._langMap.clear(),this._langGraph.clear(),this._loadedThemesCache=null}loadLanguages(t){for(const r of t)this.resolveEmbeddedLanguages(r);const n=Array.from(this._langGraph.entries()),o=n.filter(([r,i])=>!i);if(o.length){const r=n.filter(([i,s])=>s?(s.embeddedLanguages||s.embeddedLangs)?.some(l=>o.map(([u])=>u).includes(l)):!1).filter(i=>!o.includes(i));throw new un(`Missing languages ${o.map(([i])=>`\`${i}\``).join(", ")}, required by ${r.map(([i])=>`\`${i}\``).join(", ")}`)}for(const[r,i]of n)this._resolver.addLanguage(i);for(const[r,i]of n)this.loadLanguage(i)}getLoadedLanguages(){return this._loadedLanguagesCache||(this._loadedLanguagesCache=[...new Set([...this._resolvedGrammars.keys(),...Object.keys(this._alias)])]),this._loadedLanguagesCache}resolveEmbeddedLanguages(t){this._langMap.set(t.name,t),this._langGraph.set(t.name,t);const n=t.embeddedLanguages??t.embeddedLangs;if(n)for(const o of n)this._langGraph.set(o,this._langMap.get(o))}}class Qg{_langs=new Map;_scopeToLang=new Map;_injections=new Map;_onigLib;constructor(t,n){this._onigLib={createOnigScanner:o=>t.createScanner(o),createOnigString:o=>t.createString(o)},n.forEach(o=>this.addLanguage(o))}get onigLib(){return this._onigLib}getLangRegistration(t){return this._langs.get(t)}loadGrammar(t){return this._scopeToLang.get(t)}addLanguage(t){this._langs.set(t.name,t),t.aliases&&t.aliases.forEach(n=>{this._langs.set(n,t)}),this._scopeToLang.set(t.scopeName,t),t.injectTo&&t.injectTo.forEach(n=>{this._injections.get(n)||this._injections.set(n,[]),this._injections.get(n).push(t.scopeName)})}getInjections(t){const n=t.split(".");let o=[];for(let r=1;r<=n.length;r++){const i=n.slice(0,r).join(".");o=[...o,...this._injections.get(i)||[]]}return o}}let In=0;function em(e){In+=1,e.warnings!==!1&&In>=10&&In%10===0&&console.warn(`[Shiki] ${In} instances have been created. Shiki is supposed to be used as a singleton, consider refactoring your code to cache your highlighter instance; Or call \`highlighter.dispose()\` to release unused instances.`);let t=!1;if(!e.engine)throw new un("`engine` option is required for synchronous mode");const n=(e.langs||[]).flat(1),o=(e.themes||[]).flat(1).map(Ki),r=new Qg(e.engine,n),i=new Jg(r,o,n,e.langAlias);let s;function a(g){return Yl(g,e.langAlias)}function l(g){y();const w=i.getGrammar(typeof g=="string"?g:g.name);if(!w)throw new un(`Language \`${g}\` not found, you may need to load it first`);return w}function u(g){if(g==="none")return{bg:"",fg:"",name:"none",settings:[],type:"dark"};y();const w=i.getTheme(g);if(!w)throw new un(`Theme \`${g}\` not found, you may need to load it first`);return w}function c(g){y();const w=u(g);s!==g&&(i.setTheme(w),s=g);const T=i.getColorMap();return{theme:w,colorMap:T}}function d(){return y(),i.getLoadedThemes()}function h(){return y(),i.getLoadedLanguages()}function f(...g){y(),i.loadLanguages(g.flat(1))}async function p(...g){return f(await Ul(g))}function v(...g){y();for(const w of g.flat(1))i.loadTheme(w)}async function _(...g){return y(),v(await Wl(g))}function y(){if(t)throw new un("Shiki instance has been disposed")}function b(){t||(t=!0,i.dispose(),In-=1)}return{setTheme:c,getTheme:u,getLanguage:l,getLoadedThemes:d,getLoadedLanguages:h,resolveLangAlias:a,loadLanguage:p,loadLanguageSync:f,loadTheme:_,loadThemeSync:v,dispose:b,[Symbol.dispose]:b}}async function tm(e){e.engine||Zg("`engine` option is required. Use `createOnigurumaEngine` or `createJavaScriptRegexEngine` to create an engine.");const[t,n,o]=await Promise.all([Wl(e.themes||[]),Ul(e.langs||[]),e.engine]);return em({...e,themes:t,langs:n,engine:o})}async function nm(e){const t=await tm(e);return{getLastGrammarState:(...n)=>$g(t,...n),codeToTokensBase:(n,o)=>Yi(t,n,o),codeToTokensWithThemes:(n,o)=>ql(t,n,o),codeToTokens:(n,o)=>Wo(t,n,o),codeToHast:(n,o)=>Yo(t,n,o),codeToHtml:(n,o)=>Xg(t,n,o),getBundledLanguages:()=>({}),getBundledThemes:()=>({}),...t,getInternalContext:()=>t}}function om(e){const t=e.langs,n=e.themes,o=e.engine;async function r(i){function s(d){if(typeof d=="string"){if(d=i.langAlias?.[d]||d,Vl(d))return[];const h=t[d];if(!h)throw new Be(`Language \`${d}\` is not included in this bundle. You may want to load it from external source.`);return h}return d}function a(d){if(Fl(d))return"none";if(typeof d=="string"){const h=n[d];if(!h)throw new Be(`Theme \`${d}\` is not included in this bundle. You may want to load it from external source.`);return h}return d}const l=(i.themes??[]).map(d=>a(d)),u=(i.langs??[]).map(d=>s(d)),c=await nm({engine:i.engine??o(),...i,themes:l,langs:u});return{...c,loadLanguage(...d){return c.loadLanguage(...d.map(s))},loadTheme(...d){return c.loadTheme(...d.map(a))},getBundledLanguages(){return t},getBundledThemes(){return n}}}return r}function rm(e){let t;async function n(o={}){if(t){const r=await t;return await Promise.all([r.loadTheme(...o.themes||[]),r.loadLanguage(...o.langs||[])]),r}else{t=e({...o,themes:[],langs:[]});const r=await t;return await Promise.all([r.loadTheme(...o.themes||[]),r.loadLanguage(...o.langs||[])]),r}}return n}function im(e,t){const n=rm(e);async function o(r,i){const s=await n({langs:[i.lang],themes:"theme"in i?[i.theme]:Object.values(i.themes)}),a=await t?.guessEmbeddedLanguages?.(r,i.lang,s);return a&&await s.loadLanguage(...a),s}return{getSingletonHighlighter(r){return n(r)},async codeToHtml(r,i){return(await o(r,i)).codeToHtml(r,i)},async codeToHast(r,i){return(await o(r,i)).codeToHast(r,i)},async codeToTokens(r,i){return(await o(r,i)).codeToTokens(r,i)},async codeToTokensBase(r,i){return(await o(r,i)).codeToTokensBase(r,i)},async codeToTokensWithThemes(r,i){return(await o(r,i)).codeToTokensWithThemes(r,i)},async getLastGrammarState(r,i){return(await n({langs:[i.lang],themes:[i.theme]})).getLastGrammarState(r,i)}}}const sm=[{id:"andromeeda",displayName:"Andromeeda",type:"dark",import:(()=>J(()=>import("./C4gqWexZ.js"),[],import.meta.url))},{id:"aurora-x",displayName:"Aurora X",type:"dark",import:(()=>J(()=>import("./D-2ljcwZ.js"),[],import.meta.url))},{id:"ayu-dark",displayName:"Ayu Dark",type:"dark",import:(()=>J(()=>import("./CMjwMIkn.js"),[],import.meta.url))},{id:"ayu-light",displayName:"Ayu Light",type:"light",import:(()=>J(()=>import("./C47S-Tmv.js"),[],import.meta.url))},{id:"ayu-mirage",displayName:"Ayu Mirage",type:"dark",import:(()=>J(()=>import("./CjoLj4QM.js"),[],import.meta.url))},{id:"catppuccin-frappe",displayName:"Catppuccin Frappé",type:"dark",import:(()=>J(()=>import("./DFWUc33u.js"),[],import.meta.url))},{id:"catppuccin-latte",displayName:"Catppuccin Latte",type:"light",import:(()=>J(()=>import("./C9dUb6Cb.js"),[],import.meta.url))},{id:"catppuccin-macchiato",displayName:"Catppuccin Macchiato",type:"dark",import:(()=>J(()=>import("./DQyhUUbL.js"),[],import.meta.url))},{id:"catppuccin-mocha",displayName:"Catppuccin Mocha",type:"dark",import:(()=>J(()=>import("./D87Tk5Gz.js"),[],import.meta.url))},{id:"dark-plus",displayName:"Dark Plus",type:"dark",import:(()=>J(()=>import("./C3mMm8J8.js"),[],import.meta.url))},{id:"dracula",displayName:"Dracula Theme",type:"dark",import:(()=>J(()=>import("./BzJJZx-M.js"),[],import.meta.url))},{id:"dracula-soft",displayName:"Dracula Theme Soft",type:"dark",import:(()=>J(()=>import("./BXkSAIEj.js"),[],import.meta.url))},{id:"everforest-dark",displayName:"Everforest Dark",type:"dark",import:(()=>J(()=>import("./BgDCqdQA.js"),[],import.meta.url))},{id:"everforest-light",displayName:"Everforest Light",type:"light",import:(()=>J(()=>import("./C8M2exoo.js"),[],import.meta.url))},{id:"github-dark",displayName:"GitHub Dark",type:"dark",import:(()=>J(()=>import("./DHJKELXO.js"),[],import.meta.url))},{id:"github-dark-default",displayName:"GitHub Dark Default",type:"dark",import:(()=>J(()=>import("./Cuk6v7N8.js"),[],import.meta.url))},{id:"github-dark-dimmed",displayName:"GitHub Dark Dimmed",type:"dark",import:(()=>J(()=>import("./DH5Ifo-i.js"),[],import.meta.url))},{id:"github-dark-high-contrast",displayName:"GitHub Dark High Contrast",type:"dark",import:(()=>J(()=>import("./E3gJ1_iC.js"),[],import.meta.url))},{id:"github-light",displayName:"GitHub Light",type:"light",import:(()=>J(()=>import("./DAi9KRSo.js"),[],import.meta.url))},{id:"github-light-default",displayName:"GitHub Light Default",type:"light",import:(()=>J(()=>import("./D7oLnXFd.js"),[],import.meta.url))},{id:"github-light-high-contrast",displayName:"GitHub Light High Contrast",type:"light",import:(()=>J(()=>import("./BfjtVDDH.js"),[],import.meta.url))},{id:"gruvbox-dark-hard",displayName:"Gruvbox Dark Hard",type:"dark",import:(()=>J(()=>import("./CFHQjOhq.js"),[],import.meta.url))},{id:"gruvbox-dark-medium",displayName:"Gruvbox Dark Medium",type:"dark",import:(()=>J(()=>import("./GsRaNv29.js"),[],import.meta.url))},{id:"gruvbox-dark-soft",displayName:"Gruvbox Dark Soft",type:"dark",import:(()=>J(()=>import("./CVdnzihN.js"),[],import.meta.url))},{id:"gruvbox-light-hard",displayName:"Gruvbox Light Hard",type:"light",import:(()=>J(()=>import("./CH1njM8p.js"),[],import.meta.url))},{id:"gruvbox-light-medium",displayName:"Gruvbox Light Medium",type:"light",import:(()=>J(()=>import("./DRw_LuNl.js"),[],import.meta.url))},{id:"gruvbox-light-soft",displayName:"Gruvbox Light Soft",type:"light",import:(()=>J(()=>import("./hJgmCMqR.js"),[],import.meta.url))},{id:"horizon",displayName:"Horizon",type:"dark",import:(()=>J(()=>import("./BUw7H-hv.js"),[],import.meta.url))},{id:"houston",displayName:"Houston",type:"dark",import:(()=>J(()=>import("./DnULxvSX.js"),[],import.meta.url))},{id:"kanagawa-dragon",displayName:"Kanagawa Dragon",type:"dark",import:(()=>J(()=>import("./CkXjmgJE.js"),[],import.meta.url))},{id:"kanagawa-lotus",displayName:"Kanagawa Lotus",type:"light",import:(()=>J(()=>import("./CfQXZHmo.js"),[],import.meta.url))},{id:"kanagawa-wave",displayName:"Kanagawa Wave",type:"dark",import:(()=>J(()=>import("./DWedfzmr.js"),[],import.meta.url))},{id:"laserwave",displayName:"LaserWave",type:"dark",import:(()=>J(()=>import("./DUszq2jm.js"),[],import.meta.url))},{id:"light-plus",displayName:"Light Plus",type:"light",import:(()=>J(()=>import("./B7mTdjB0.js"),[],import.meta.url))},{id:"material-theme",displayName:"Material Theme",type:"dark",import:(()=>J(()=>import("./D5KoaKCx.js"),[],import.meta.url))},{id:"material-theme-darker",displayName:"Material Theme Darker",type:"dark",import:(()=>J(()=>import("./BfHTSMKl.js"),[],import.meta.url))},{id:"material-theme-lighter",displayName:"Material Theme Lighter",type:"light",import:(()=>J(()=>import("./B0m2ddpp.js"),[],import.meta.url))},{id:"material-theme-ocean",displayName:"Material Theme Ocean",type:"dark",import:(()=>J(()=>import("./CyktbL80.js"),[],import.meta.url))},{id:"material-theme-palenight",displayName:"Material Theme Palenight",type:"dark",import:(()=>J(()=>import("./Csfq5Kiy.js"),[],import.meta.url))},{id:"min-dark",displayName:"Min Dark",type:"dark",import:(()=>J(()=>import("./CafNBF8u.js"),[],import.meta.url))},{id:"min-light",displayName:"Min Light",type:"light",import:(()=>J(()=>import("./CTRr51gU.js"),[],import.meta.url))},{id:"monokai",displayName:"Monokai",type:"dark",import:(()=>J(()=>import("./D4h5O-jR.js"),[],import.meta.url))},{id:"night-owl",displayName:"Night Owl",type:"dark",import:(()=>J(()=>import("./C39BiMTA.js"),[],import.meta.url))},{id:"night-owl-light",displayName:"Night Owl Light",type:"light",import:(()=>J(()=>import("./CMTm3GFP.js"),[],import.meta.url))},{id:"nord",displayName:"Nord",type:"dark",import:(()=>J(()=>import("./Ddv68eIx.js"),[],import.meta.url))},{id:"one-dark-pro",displayName:"One Dark Pro",type:"dark",import:(()=>J(()=>import("./DVMEJ2y_.js"),[],import.meta.url))},{id:"one-light",displayName:"One Light",type:"light",import:(()=>J(()=>import("./C3Wv6jpd.js"),[],import.meta.url))},{id:"plastic",displayName:"Plastic",type:"dark",import:(()=>J(()=>import("./3e1v2bzS.js"),[],import.meta.url))},{id:"poimandres",displayName:"Poimandres",type:"dark",import:(()=>J(()=>import("./CS3Unz2-.js"),[],import.meta.url))},{id:"red",displayName:"Red",type:"dark",import:(()=>J(()=>import("./bN70gL4F.js"),[],import.meta.url))},{id:"rose-pine",displayName:"Rosé Pine",type:"dark",import:(()=>J(()=>import("./qdsjHGoJ.js"),[],import.meta.url))},{id:"rose-pine-dawn",displayName:"Rosé Pine Dawn",type:"light",import:(()=>J(()=>import("./DHQR4-dF.js"),[],import.meta.url))},{id:"rose-pine-moon",displayName:"Rosé Pine Moon",type:"dark",import:(()=>J(()=>import("./D4_iv3hh.js"),[],import.meta.url))},{id:"slack-dark",displayName:"Slack Dark",type:"dark",import:(()=>J(()=>import("./BthQWCQV.js"),[],import.meta.url))},{id:"slack-ochin",displayName:"Slack Ochin",type:"light",import:(()=>J(()=>import("./DqwNpetd.js"),[],import.meta.url))},{id:"snazzy-light",displayName:"Snazzy Light",type:"light",import:(()=>J(()=>import("./Bw305WKR.js"),[],import.meta.url))},{id:"solarized-dark",displayName:"Solarized Dark",type:"dark",import:(()=>J(()=>import("./DXbdFlpD.js"),[],import.meta.url))},{id:"solarized-light",displayName:"Solarized Light",type:"light",import:(()=>J(()=>import("./L9t79GZl.js"),[],import.meta.url))},{id:"synthwave-84",displayName:"Synthwave '84",type:"dark",import:(()=>J(()=>import("./CbfX1IO0.js"),[],import.meta.url))},{id:"tokyo-night",displayName:"Tokyo Night",type:"dark",import:(()=>J(()=>import("./hegEt444.js"),[],import.meta.url))},{id:"vesper",displayName:"Vesper",type:"dark",import:(()=>J(()=>import("./DU1UobuO.js"),[],import.meta.url))},{id:"vitesse-black",displayName:"Vitesse Black",type:"dark",import:(()=>J(()=>import("./Bkuqu6BP.js"),[],import.meta.url))},{id:"vitesse-dark",displayName:"Vitesse Dark",type:"dark",import:(()=>J(()=>import("./D0r3Knsf.js"),[],import.meta.url))},{id:"vitesse-light",displayName:"Vitesse Light",type:"light",import:(()=>J(()=>import("./CVO1_9PV.js"),[],import.meta.url))}],am=Object.fromEntries(sm.map(e=>[e.id,e.import]));class Zi extends Error{constructor(t){super(t),this.name="ShikiError"}}function lm(){return 2147483648}function um(){return typeof performance<"u"?performance.now():Date.now()}const cm=(e,t)=>e+(t-e%t)%t;async function dm(e){let t,n;const o={};function r(f){n=f,o.HEAPU8=new Uint8Array(f),o.HEAPU32=new Uint32Array(f)}function i(f,p,v){o.HEAPU8.copyWithin(f,p,p+v)}function s(f){try{return t.grow(f-n.byteLength+65535>>>16),r(t.buffer),1}catch{}}function a(f){const p=o.HEAPU8.length;f=f>>>0;const v=lm();if(f>v)return!1;for(let _=1;_<=4;_*=2){let y=p*(1+.2/_);y=Math.min(y,f+100663296);const b=Math.min(v,cm(Math.max(f,y),65536));if(s(b))return!0}return!1}const l=typeof TextDecoder<"u"?new TextDecoder("utf8"):void 0;function u(f,p,v=1024){const _=p+v;let y=p;for(;f[y]&&!(y>=_);)++y;if(y-p>16&&f.buffer&&l)return l.decode(f.subarray(p,y));let b="";for(;p<y;){let g=f[p++];if(!(g&128)){b+=String.fromCharCode(g);continue}const w=f[p++]&63;if((g&224)===192){b+=String.fromCharCode((g&31)<<6|w);continue}const T=f[p++]&63;if((g&240)===224?g=(g&15)<<12|w<<6|T:g=(g&7)<<18|w<<12|T<<6|f[p++]&63,g<65536)b+=String.fromCharCode(g);else{const M=g-65536;b+=String.fromCharCode(55296|M>>10,56320|M&1023)}}return b}function c(f,p){return f?u(o.HEAPU8,f,p):""}const d={emscripten_get_now:um,emscripten_memcpy_big:i,emscripten_resize_heap:a,fd_write:()=>0};async function h(){const p=await e({env:d,wasi_snapshot_preview1:d});t=p.memory,r(t.buffer),Object.assign(o,p),o.UTF8ToString=c}return await h(),o}var fm=Object.defineProperty,hm=(e,t,n)=>t in e?fm(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Fe=(e,t,n)=>hm(e,typeof t!="symbol"?t+"":t,n);let qe=null;function pm(e){throw new Zi(e.UTF8ToString(e.getLastOnigError()))}class yr{constructor(t){Fe(this,"utf16Length"),Fe(this,"utf8Length"),Fe(this,"utf16Value"),Fe(this,"utf8Value"),Fe(this,"utf16OffsetToUtf8"),Fe(this,"utf8OffsetToUtf16");const n=t.length,o=yr._utf8ByteLength(t),r=o!==n,i=r?new Uint32Array(n+1):null;r&&(i[n]=o);const s=r?new Uint32Array(o+1):null;r&&(s[o]=n);const a=new Uint8Array(o);let l=0;for(let u=0;u<n;u++){const c=t.charCodeAt(u);let d=c,h=!1;if(c>=55296&&c<=56319&&u+1<n){const f=t.charCodeAt(u+1);f>=56320&&f<=57343&&(d=(c-55296<<10)+65536|f-56320,h=!0)}r&&(i[u]=l,h&&(i[u+1]=l),d<=127?s[l+0]=u:d<=2047?(s[l+0]=u,s[l+1]=u):d<=65535?(s[l+0]=u,s[l+1]=u,s[l+2]=u):(s[l+0]=u,s[l+1]=u,s[l+2]=u,s[l+3]=u)),d<=127?a[l++]=d:d<=2047?(a[l++]=192|(d&1984)>>>6,a[l++]=128|(d&63)>>>0):d<=65535?(a[l++]=224|(d&61440)>>>12,a[l++]=128|(d&4032)>>>6,a[l++]=128|(d&63)>>>0):(a[l++]=240|(d&1835008)>>>18,a[l++]=128|(d&258048)>>>12,a[l++]=128|(d&4032)>>>6,a[l++]=128|(d&63)>>>0),h&&u++}this.utf16Length=n,this.utf8Length=o,this.utf16Value=t,this.utf8Value=a,this.utf16OffsetToUtf8=i,this.utf8OffsetToUtf16=s}static _utf8ByteLength(t){let n=0;for(let o=0,r=t.length;o<r;o++){const i=t.charCodeAt(o);let s=i,a=!1;if(i>=55296&&i<=56319&&o+1<r){const l=t.charCodeAt(o+1);l>=56320&&l<=57343&&(s=(i-55296<<10)+65536|l-56320,a=!0)}s<=127?n+=1:s<=2047?n+=2:s<=65535?n+=3:n+=4,a&&o++}return n}createString(t){const n=t.omalloc(this.utf8Length);return t.HEAPU8.set(this.utf8Value,n),n}}const _r=class gt{constructor(t){if(Fe(this,"id",++gt.LAST_ID),Fe(this,"_onigBinding"),Fe(this,"content"),Fe(this,"utf16Length"),Fe(this,"utf8Length"),Fe(this,"utf16OffsetToUtf8"),Fe(this,"utf8OffsetToUtf16"),Fe(this,"ptr"),!qe)throw new Zi("Must invoke loadWasm first.");this._onigBinding=qe,this.content=t;const n=new yr(t);this.utf16Length=n.utf16Length,this.utf8Length=n.utf8Length,this.utf16OffsetToUtf8=n.utf16OffsetToUtf8,this.utf8OffsetToUtf16=n.utf8OffsetToUtf16,this.utf8Length<1e4&&!gt._sharedPtrInUse?(gt._sharedPtr||(gt._sharedPtr=qe.omalloc(1e4)),gt._sharedPtrInUse=!0,qe.HEAPU8.set(n.utf8Value,gt._sharedPtr),this.ptr=gt._sharedPtr):this.ptr=n.createString(qe)}convertUtf8OffsetToUtf16(t){return this.utf8OffsetToUtf16?t<0?0:t>this.utf8Length?this.utf16Length:this.utf8OffsetToUtf16[t]:t}convertUtf16OffsetToUtf8(t){return this.utf16OffsetToUtf8?t<0?0:t>this.utf16Length?this.utf8Length:this.utf16OffsetToUtf8[t]:t}dispose(){this.ptr===gt._sharedPtr?gt._sharedPtrInUse=!1:this._onigBinding.ofree(this.ptr)}};Fe(_r,"LAST_ID",0);Fe(_r,"_sharedPtr",0);Fe(_r,"_sharedPtrInUse",!1);let Xl=_r;class gm{constructor(t){if(Fe(this,"_onigBinding"),Fe(this,"_ptr"),!qe)throw new Zi("Must invoke loadWasm first.");const n=[],o=[];for(let a=0,l=t.length;a<l;a++){const u=new yr(t[a]);n[a]=u.createString(qe),o[a]=u.utf8Length}const r=qe.omalloc(4*t.length);qe.HEAPU32.set(n,r/4);const i=qe.omalloc(4*t.length);qe.HEAPU32.set(o,i/4);const s=qe.createOnigScanner(r,i,t.length);for(let a=0,l=t.length;a<l;a++)qe.ofree(n[a]);qe.ofree(i),qe.ofree(r),s===0&&pm(qe),this._onigBinding=qe,this._ptr=s}dispose(){this._onigBinding.freeOnigScanner(this._ptr)}findNextMatchSync(t,n,o){let r=0;if(typeof o=="number"&&(r=o),typeof t=="string"){t=new Xl(t);const i=this._findNextMatchSync(t,n,!1,r);return t.dispose(),i}return this._findNextMatchSync(t,n,!1,r)}_findNextMatchSync(t,n,o,r){const i=this._onigBinding,s=i.findNextOnigScannerMatch(this._ptr,t.id,t.ptr,t.utf8Length,t.convertUtf16OffsetToUtf8(n),r);if(s===0)return null;const a=i.HEAPU32;let l=s/4;const u=a[l++],c=a[l++],d=[];for(let h=0;h<c;h++){const f=t.convertUtf8OffsetToUtf16(a[l++]),p=t.convertUtf8OffsetToUtf16(a[l++]);d[h]={start:f,end:p,length:p-f}}return{index:u,captureIndices:d}}}function mm(e){return typeof e.instantiator=="function"}function vm(e){return typeof e.default=="function"}function ym(e){return typeof e.data<"u"}function _m(e){return typeof Response<"u"&&e instanceof Response}function wm(e){return typeof ArrayBuffer<"u"&&(e instanceof ArrayBuffer||ArrayBuffer.isView(e))||typeof Buffer<"u"&&Buffer.isBuffer?.(e)||typeof SharedArrayBuffer<"u"&&e instanceof SharedArrayBuffer||typeof Uint32Array<"u"&&e instanceof Uint32Array}let go;function bm(e){if(go)return go;async function t(){qe=await dm(async n=>{let o=e;return o=await o,typeof o=="function"&&(o=await o(n)),typeof o=="function"&&(o=await o(n)),mm(o)?o=await o.instantiator(n):vm(o)?o=await o.default(n):(ym(o)&&(o=o.data),_m(o)?typeof WebAssembly.instantiateStreaming=="function"?o=await xm(o)(n):o=await Em(o)(n):wm(o)?o=await zr(o)(n):o instanceof WebAssembly.Module?o=await zr(o)(n):"default"in o&&o.default instanceof WebAssembly.Module&&(o=await zr(o.default)(n))),"instance"in o&&(o=o.instance),"exports"in o&&(o=o.exports),o})}return go=t(),go}function zr(e){return t=>WebAssembly.instantiate(e,t)}function xm(e){return t=>WebAssembly.instantiateStreaming(e,t)}function Em(e){return async t=>{const n=await e.arrayBuffer();return WebAssembly.instantiate(n,t)}}async function km(e){return e&&await bm(e),{createScanner(t){return new gm(t.map(n=>typeof n=="string"?n:n.source))},createString(t){return new Xl(t)}}}var Ae=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),ct=Ae((e,t)=>{var n=Object.defineProperty,o=(N,m,A)=>m in N?n(N,m,{enumerable:!0,configurable:!0,writable:!0,value:A}):N[m]=A,r=(N,m)=>()=>(m||N((m={exports:{}}).exports,m),m.exports),i=(N,m,A)=>o(N,typeof m!="symbol"?m+"":m,A),s=r((N,m)=>{var A="\0",k="\0",O="",L=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[k]={})}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(E=>Object.keys(D._in[E]).length===0)}sinks(){var D=this;return this.nodes().filter(E=>Object.keys(D._out[E]).length===0)}setNodes(D,E){var R=arguments,B=this;return D.forEach(function(W){R.length>1?B.setNode(W,E):B.setNode(W)}),this}setNode(D,E){return Object.hasOwn(this._nodes,D)?(arguments.length>1&&(this._nodes[D]=E),this):(this._nodes[D]=arguments.length>1?E:this._defaultNodeLabelFn(D),this._isCompound&&(this._parent[D]=k,this._children[D]={},this._children[k][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 E=this;if(Object.hasOwn(this._nodes,D)){var R=B=>E.removeEdge(E._edgeObjs[B]);delete this._nodes[D],this._isCompound&&(this._removeFromParentsChildList(D),delete this._parent[D],this.children(D).forEach(function(B){E.setParent(B)}),delete this._children[D]),Object.keys(this._in[D]).forEach(R),delete this._in[D],delete this._preds[D],Object.keys(this._out[D]).forEach(R),delete this._out[D],delete this._sucs[D],--this._nodeCount}return this}setParent(D,E){if(!this._isCompound)throw new Error("Cannot set parent in a non-compound graph");if(E===void 0)E=k;else{E+="";for(var R=E;R!==void 0;R=this.parent(R))if(R===D)throw new Error("Setting "+E+" as parent of "+D+" would create a cycle");this.setNode(E)}return this.setNode(D),this._removeFromParentsChildList(D),this._parent[D]=E,this._children[E][D]=!0,this}_removeFromParentsChildList(D){delete this._children[this._parent[D]][D]}parent(D){if(this._isCompound){var E=this._parent[D];if(E!==k)return E}}children(D=k){if(this._isCompound){var E=this._children[D];if(E)return Object.keys(E)}else{if(D===k)return this.nodes();if(this.hasNode(D))return[]}}predecessors(D){var E=this._preds[D];if(E)return Object.keys(E)}successors(D){var E=this._sucs[D];if(E)return Object.keys(E)}neighbors(D){var E=this.predecessors(D);if(E){let B=new Set(E);for(var R of this.successors(D))B.add(R);return Array.from(B.values())}}isLeaf(D){var E;return this.isDirected()?E=this.successors(D):E=this.neighbors(D),E.length===0}filterNodes(D){var E=new this.constructor({directed:this._isDirected,multigraph:this._isMultigraph,compound:this._isCompound});E.setGraph(this.graph());var R=this;Object.entries(this._nodes).forEach(function([Q,ne]){D(Q)&&E.setNode(Q,ne)}),Object.values(this._edgeObjs).forEach(function(Q){E.hasNode(Q.v)&&E.hasNode(Q.w)&&E.setEdge(Q,R.edge(Q))});var B={};function W(Q){var ne=R.parent(Q);return ne===void 0||E.hasNode(ne)?(B[Q]=ne,ne):ne in B?B[ne]:W(ne)}return this._isCompound&&E.nodes().forEach(Q=>E.setParent(Q,W(Q))),E}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,E){var R=this,B=arguments;return D.reduce(function(W,Q){return B.length>1?R.setEdge(W,Q,E):R.setEdge(W,Q),Q}),this}setEdge(){var D,E,R,B,W=!1,Q=arguments[0];typeof Q=="object"&&Q!==null&&"v"in Q?(D=Q.v,E=Q.w,R=Q.name,arguments.length===2&&(B=arguments[1],W=!0)):(D=Q,E=arguments[1],R=arguments[3],arguments.length>2&&(B=arguments[2],W=!0)),D=""+D,E=""+E,R!==void 0&&(R=""+R);var ne=U(this._isDirected,D,E,R);if(Object.hasOwn(this._edgeLabels,ne))return W&&(this._edgeLabels[ne]=B),this;if(R!==void 0&&!this._isMultigraph)throw new Error("Cannot set a named edge when isMultigraph = false");this.setNode(D),this.setNode(E),this._edgeLabels[ne]=W?B:this._defaultEdgeLabelFn(D,E,R);var se=Z(this._isDirected,D,E,R);return D=se.v,E=se.w,Object.freeze(se),this._edgeObjs[ne]=se,F(this._preds[E],D),F(this._sucs[D],E),this._in[E][ne]=se,this._out[D][ne]=se,this._edgeCount++,this}edge(D,E,R){var B=arguments.length===1?te(this._isDirected,arguments[0]):U(this._isDirected,D,E,R);return this._edgeLabels[B]}edgeAsObj(){let D=this.edge(...arguments);return typeof D!="object"?{label:D}:D}hasEdge(D,E,R){var B=arguments.length===1?te(this._isDirected,arguments[0]):U(this._isDirected,D,E,R);return Object.hasOwn(this._edgeLabels,B)}removeEdge(D,E,R){var B=arguments.length===1?te(this._isDirected,arguments[0]):U(this._isDirected,D,E,R),W=this._edgeObjs[B];return W&&(D=W.v,E=W.w,delete this._edgeLabels[B],delete this._edgeObjs[B],G(this._preds[E],D),G(this._sucs[D],E),delete this._in[E][B],delete this._out[D][B],this._edgeCount--),this}inEdges(D,E){return this.isDirected()?this.filterEdges(this._in[D],D,E):this.nodeEdges(D,E)}outEdges(D,E){return this.isDirected()?this.filterEdges(this._out[D],D,E):this.nodeEdges(D,E)}nodeEdges(D,E){if(D in this._nodes)return this.filterEdges({...this._in[D],...this._out[D]},D,E)}filterEdges(D,E,R){if(D){var B=Object.values(D);return R?B.filter(function(W){return W.v===E&&W.w===R||W.v===R&&W.w===E}):B}}};function F(D,E){D[E]?D[E]++:D[E]=1}function G(D,E){--D[E]||delete D[E]}function U(D,E,R,B){var W=""+E,Q=""+R;if(!D&&W>Q){var ne=W;W=Q,Q=ne}return W+O+Q+O+(B===void 0?A:B)}function Z(D,E,R,B){var W=""+E,Q=""+R;if(!D&&W>Q){var ne=W;W=Q,Q=ne}var se={v:W,w:Q};return B&&(se.name=B),se}function te(D,E){return U(D,E.v,E.w,E.name)}m.exports=L}),a=r((N,m)=>{m.exports="3.0.2"}),l=r((N,m)=>{m.exports={Graph:s(),version:a()}}),u=r((N,m)=>{var A=s();m.exports={write:k,read:F};function k(G){var U={options:{directed:G.isDirected(),multigraph:G.isMultigraph(),compound:G.isCompound()},nodes:O(G),edges:L(G)};return G.graph()!==void 0&&(U.value=structuredClone(G.graph())),U}function O(G){return G.nodes().map(function(U){var Z=G.node(U),te=G.parent(U),D={v:U};return Z!==void 0&&(D.value=Z),te!==void 0&&(D.parent=te),D})}function L(G){return G.edges().map(function(U){var Z=G.edge(U),te={v:U.v,w:U.w};return U.name!==void 0&&(te.name=U.name),Z!==void 0&&(te.value=Z),te})}function F(G){var U=new A(G.options).setGraph(G.value);return G.nodes.forEach(function(Z){U.setNode(Z.v,Z.value),Z.parent&&U.setParent(Z.v,Z.parent)}),G.edges.forEach(function(Z){U.setEdge({v:Z.v,w:Z.w,name:Z.name},Z.value)}),U}}),c=r((N,m)=>{m.exports=k;var A=()=>1;function k(L,F,G,U){return O(L,String(F),G||A,U||function(Z){return L.outEdges(Z)})}function O(L,F,G,U){var Z={},te=!0,D=0,E=L.nodes(),R=function(ne){var se=G(ne);Z[ne.v].distance+se<Z[ne.w].distance&&(Z[ne.w]={distance:Z[ne.v].distance+se,predecessor:ne.v},te=!0)},B=function(){E.forEach(function(ne){U(ne).forEach(function(se){var ue=se.v===ne?se.v:se.w,_e=ue===se.v?se.w:se.v;R({v:ue,w:_e})})})};E.forEach(function(ne){var se=ne===F?0:Number.POSITIVE_INFINITY;Z[ne]={distance:se}});for(var W=E.length,Q=1;Q<W&&(te=!1,D++,B(),!!te);Q++);if(D===W-1&&(te=!1,B(),te))throw new Error("The graph contains a negative weight cycle");return Z}}),d=r((N,m)=>{m.exports=A;function A(k){var O={},L=[],F;function G(U){Object.hasOwn(O,U)||(O[U]=!0,F.push(U),k.successors(U).forEach(G),k.predecessors(U).forEach(G))}return k.nodes().forEach(function(U){F=[],G(U),F.length&&L.push(F)}),L}}),h=r((N,m)=>{var A=class{constructor(){i(this,"_arr",[]),i(this,"_keyIndices",{})}size(){return this._arr.length}keys(){return this._arr.map(function(k){return k.key})}has(k){return Object.hasOwn(this._keyIndices,k)}priority(k){var O=this._keyIndices[k];if(O!==void 0)return this._arr[O].priority}min(){if(this.size()===0)throw new Error("Queue underflow");return this._arr[0].key}add(k,O){var L=this._keyIndices;if(k=String(k),!Object.hasOwn(L,k)){var F=this._arr,G=F.length;return L[k]=G,F.push({key:k,priority:O}),this._decrease(G),!0}return!1}removeMin(){this._swap(0,this._arr.length-1);var k=this._arr.pop();return delete this._keyIndices[k.key],this._heapify(0),k.key}decrease(k,O){var L=this._keyIndices[k];if(O>this._arr[L].priority)throw new Error("New priority is greater than current priority. Key: "+k+" Old: "+this._arr[L].priority+" New: "+O);this._arr[L].priority=O,this._decrease(L)}_heapify(k){var O=this._arr,L=2*k,F=L+1,G=k;L<O.length&&(G=O[L].priority<O[G].priority?L:G,F<O.length&&(G=O[F].priority<O[G].priority?F:G),G!==k&&(this._swap(k,G),this._heapify(G)))}_decrease(k){for(var O=this._arr,L=O[k].priority,F;k!==0&&(F=k>>1,!(O[F].priority<L));)this._swap(k,F),k=F}_swap(k,O){var L=this._arr,F=this._keyIndices,G=L[k],U=L[O];L[k]=U,L[O]=G,F[U.key]=k,F[G.key]=O}};m.exports=A}),f=r((N,m)=>{var A=h();m.exports=O;var k=()=>1;function O(F,G,U,Z){var te=function(D){return F.outEdges(D)};return L(F,String(G),U||k,Z||te)}function L(F,G,U,Z){var te={},D=new A,E,R,B=function(W){var Q=W.v!==E?W.v:W.w,ne=te[Q],se=U(W),ue=R.distance+se;if(se<0)throw new Error("dijkstra does not allow negative edge weights. Bad edge: "+W+" Weight: "+se);ue<ne.distance&&(ne.distance=ue,ne.predecessor=E,D.decrease(Q,ue))};for(F.nodes().forEach(function(W){var Q=W===G?0:Number.POSITIVE_INFINITY;te[W]={distance:Q},D.add(W,Q)});D.size()>0&&(E=D.removeMin(),R=te[E],R.distance!==Number.POSITIVE_INFINITY);)Z(E).forEach(B);return te}}),p=r((N,m)=>{var A=f();m.exports=k;function k(O,L,F){return O.nodes().reduce(function(G,U){return G[U]=A(O,U,L,F),G},{})}}),v=r((N,m)=>{m.exports=A;function A(O,L,F){if(O[L].predecessor!==void 0)throw new Error("Invalid source vertex");if(O[F].predecessor===void 0&&F!==L)throw new Error("Invalid destination vertex");return{weight:O[F].distance,path:k(O,L,F)}}function k(O,L,F){for(var G=[],U=F;U!==L;)G.push(U),U=O[U].predecessor;return G.push(L),G.reverse()}}),_=r((N,m)=>{m.exports=A;function A(k){var O=0,L=[],F={},G=[];function U(Z){var te=F[Z]={onStack:!0,lowlink:O,index:O++};if(L.push(Z),k.successors(Z).forEach(function(R){Object.hasOwn(F,R)?F[R].onStack&&(te.lowlink=Math.min(te.lowlink,F[R].index)):(U(R),te.lowlink=Math.min(te.lowlink,F[R].lowlink))}),te.lowlink===te.index){var D=[],E;do E=L.pop(),F[E].onStack=!1,D.push(E);while(Z!==E);G.push(D)}}return k.nodes().forEach(function(Z){Object.hasOwn(F,Z)||U(Z)}),G}}),y=r((N,m)=>{var A=_();m.exports=k;function k(O){return A(O).filter(function(L){return L.length>1||L.length===1&&O.hasEdge(L[0],L[0])})}}),b=r((N,m)=>{m.exports=k;var A=()=>1;function k(L,F,G){return O(L,F||A,G||function(U){return L.outEdges(U)})}function O(L,F,G){var U={},Z=L.nodes();return Z.forEach(function(te){U[te]={},U[te][te]={distance:0},Z.forEach(function(D){te!==D&&(U[te][D]={distance:Number.POSITIVE_INFINITY})}),G(te).forEach(function(D){var E=D.v===te?D.w:D.v,R=F(D);U[te][E]={distance:R,predecessor:te}})}),Z.forEach(function(te){var D=U[te];Z.forEach(function(E){var R=U[E];Z.forEach(function(B){var W=R[te],Q=D[B],ne=R[B],se=W.distance+Q.distance;se<ne.distance&&(ne.distance=se,ne.predecessor=Q.predecessor)})})}),U}}),g=r((N,m)=>{function A(O){var L={},F={},G=[];function U(Z){if(Object.hasOwn(F,Z))throw new k;Object.hasOwn(L,Z)||(F[Z]=!0,L[Z]=!0,O.predecessors(Z).forEach(U),delete F[Z],G.push(Z))}if(O.sinks().forEach(U),Object.keys(L).length!==O.nodeCount())throw new k;return G}var k=class extends Error{constructor(){super(...arguments)}};m.exports=A,A.CycleException=k}),w=r((N,m)=>{var A=g();m.exports=k;function k(O){try{A(O)}catch(L){if(L instanceof A.CycleException)return!1;throw L}return!0}}),T=r((N,m)=>{m.exports=A;function A(O,L,F,G,U){Array.isArray(L)||(L=[L]);var Z=(O.isDirected()?O.successors:O.neighbors).bind(O),te={};return L.forEach(function(D){if(!O.hasNode(D))throw new Error("Graph does not have node: "+D);U=k(O,D,F==="post",te,Z,G,U)}),U}function k(O,L,F,G,U,Z,te){return Object.hasOwn(G,L)||(G[L]=!0,F||(te=Z(te,L)),U(L).forEach(function(D){te=k(O,D,F,G,U,Z,te)}),F&&(te=Z(te,L))),te}}),M=r((N,m)=>{var A=T();m.exports=k;function k(O,L,F){return A(O,L,F,function(G,U){return G.push(U),G},[])}}),z=r((N,m)=>{var A=M();m.exports=k;function k(O,L){return A(O,L,"post")}}),H=r((N,m)=>{var A=M();m.exports=k;function k(O,L){return A(O,L,"pre")}}),K=r((N,m)=>{var A=s(),k=h();m.exports=O;function O(L,F){var G=new A,U={},Z=new k,te;function D(R){var B=R.v===te?R.w:R.v,W=Z.priority(B);if(W!==void 0){var Q=F(R);Q<W&&(U[B]=te,Z.decrease(B,Q))}}if(L.nodeCount()===0)return G;L.nodes().forEach(function(R){Z.add(R,Number.POSITIVE_INFINITY),G.setNode(R)}),Z.decrease(L.nodes()[0],0);for(var E=!1;Z.size()>0;){if(te=Z.removeMin(),Object.hasOwn(U,te))G.setEdge(te,U[te]);else{if(E)throw new Error("Input graph is not connected: "+L);E=!0}L.nodeEdges(te).forEach(D)}return G}}),P=r((N,m)=>{var A=f(),k=c();m.exports=O;function O(F,G,U,Z){return L(F,G,U,Z||function(te){return F.outEdges(te)})}function L(F,G,U,Z){if(U===void 0)return A(F,G,U,Z);for(var te=!1,D=F.nodes(),E=0;E<D.length;E++){for(var R=Z(D[E]),B=0;B<R.length;B++){var W=R[B],Q=W.v===D[E]?W.v:W.w,ne=Q===W.v?W.w:W.v;U({v:Q,w:ne})<0&&(te=!0)}if(te)return k(F,G,U,Z)}return A(F,G,U,Z)}}),C=r((N,m)=>{m.exports={bellmanFord:c(),components:d(),dijkstra:f(),dijkstraAll:p(),extractPath:v(),findCycles:y(),floydWarshall:b(),isAcyclic:w(),postorder:z(),preorder:H(),prim:K(),shortestPaths:P(),reduce:T(),tarjan:_(),topsort:g()}}),x=l();t.exports={Graph:x.Graph,json:u(),alg:C(),version:x.version}}),Sm=Ae((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}),Cm=Ae((e,t)=>{var n=ct().Graph,o=Sm();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(p=>d.outEdges(p.v,p.w))}function s(d,h,f){let p=[],v=h[h.length-1],_=h[0],y;for(;d.nodeCount();){for(;y=_.dequeue();)a(d,h,f,y);for(;y=v.dequeue();)a(d,h,f,y);if(d.nodeCount()){for(let b=h.length-2;b>0;--b)if(y=h[b].dequeue(),y){p=p.concat(a(d,h,f,y,!0));break}}}return p}function a(d,h,f,p,v){let _=v?[]:void 0;return d.inEdges(p.v).forEach(y=>{let b=d.edge(y),g=d.node(y.v);v&&_.push({v:y.v,w:y.w}),g.out-=b,u(h,f,g)}),d.outEdges(p.v).forEach(y=>{let b=d.edge(y),g=y.w,w=d.node(g);w.in-=b,u(h,f,w)}),d.removeNode(p.v),_}function l(d,h){let f=new n,p=0,v=0;d.nodes().forEach(b=>{f.setNode(b,{v:b,in:0,out:0})}),d.edges().forEach(b=>{let g=f.edge(b.v,b.w)||0,w=h(b),T=g+w;f.setEdge(b.v,b.w,T),v=Math.max(v,f.node(b.v).out+=w),p=Math.max(p,f.node(b.w).in+=w)});let _=c(v+p+3).map(()=>new o),y=p+1;return f.nodes().forEach(b=>{u(_,y,f.node(b))}),{graph:f,buckets:_,zeroIdx:y}}function u(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 c(d){let h=[];for(let f=0;f<d;f++)h.push(f);return h}}),Ve=Ae((e,t)=>{var n=ct().Graph;t.exports={addBorderNode:h,addDummyNode:o,applyWithChunking:v,asNonCompoundGraph:i,buildLayerMatrix:u,intersectRect:l,mapValues:H,maxRank:_,normalizeRanks:c,notime:g,partition:y,pick:z,predecessorWeights:a,range:M,removeEmptyRanks:d,simplify:r,successorWeights:s,time:b,uniqueId:T,zipObject:K};function o(P,C,x,N){for(var m=N;P.hasNode(m);)m=T(N);return x.dummy=C,P.setNode(m,x),m}function r(P){let C=new n().setGraph(P.graph());return P.nodes().forEach(x=>C.setNode(x,P.node(x))),P.edges().forEach(x=>{let N=C.edge(x.v,x.w)||{weight:0,minlen:1},m=P.edge(x);C.setEdge(x.v,x.w,{weight:N.weight+m.weight,minlen:Math.max(N.minlen,m.minlen)})}),C}function i(P){let C=new n({multigraph:P.isMultigraph()}).setGraph(P.graph());return P.nodes().forEach(x=>{P.children(x).length||C.setNode(x,P.node(x))}),P.edges().forEach(x=>{C.setEdge(x,P.edge(x))}),C}function s(P){let C=P.nodes().map(x=>{let N={};return P.outEdges(x).forEach(m=>{N[m.w]=(N[m.w]||0)+P.edge(m).weight}),N});return K(P.nodes(),C)}function a(P){let C=P.nodes().map(x=>{let N={};return P.inEdges(x).forEach(m=>{N[m.v]=(N[m.v]||0)+P.edge(m).weight}),N});return K(P.nodes(),C)}function l(P,C){let x=P.x,N=P.y,m=C.x-x,A=C.y-N,k=P.width/2,O=P.height/2;if(!m&&!A)throw new Error("Not possible to find intersection inside of the rectangle");let L,F;return Math.abs(A)*k>Math.abs(m)*O?(A<0&&(O=-O),L=O*m/A,F=O):(m<0&&(k=-k),L=k,F=k*A/m),{x:x+L,y:N+F}}function u(P){let C=M(_(P)+1).map(()=>[]);return P.nodes().forEach(x=>{let N=P.node(x),m=N.rank;m!==void 0&&(C[m][N.order]=x)}),C}function c(P){let C=P.nodes().map(N=>{let m=P.node(N).rank;return m===void 0?Number.MAX_VALUE:m}),x=v(Math.min,C);P.nodes().forEach(N=>{let m=P.node(N);Object.hasOwn(m,"rank")&&(m.rank-=x)})}function d(P){let C=P.nodes().map(k=>P.node(k).rank).filter(k=>k!==void 0),x=v(Math.min,C),N=[];P.nodes().forEach(k=>{let O=P.node(k).rank-x;N[O]||(N[O]=[]),N[O].push(k)});let m=0,A=P.graph().nodeRankFactor;Array.from(N).forEach((k,O)=>{k===void 0&&O%A!==0?--m:k!==void 0&&m&&k.forEach(L=>P.node(L).rank+=m)})}function h(P,C,x,N){let m={width:0,height:0};return arguments.length>=4&&(m.rank=x,m.order=N),o(P,"border",m,C)}function f(P,C=p){let x=[];for(let N=0;N<P.length;N+=C){let m=P.slice(N,N+C);x.push(m)}return x}var p=65535;function v(P,C){if(C.length>p){let x=f(C);return P.apply(null,x.map(N=>P.apply(null,N)))}else return P.apply(null,C)}function _(P){let C=P.nodes().map(x=>{let N=P.node(x).rank;return N===void 0?Number.MIN_VALUE:N});return v(Math.max,C)}function y(P,C){let x={lhs:[],rhs:[]};return P.forEach(N=>{C(N)?x.lhs.push(N):x.rhs.push(N)}),x}function b(P,C){let x=Date.now();try{return C()}finally{console.log(P+" time: "+(Date.now()-x)+"ms")}}function g(P,C){return C()}var w=0;function T(P){var C=++w;return P+(""+C)}function M(P,C,x=1){C==null&&(C=P,P=0);let N=A=>A<C;x<0&&(N=A=>C<A);let m=[];for(let A=P;N(A);A+=x)m.push(A);return m}function z(P,C){let x={};for(let N of C)P[N]!==void 0&&(x[N]=P[N]);return x}function H(P,C){let x=C;return typeof C=="string"&&(x=N=>N[C]),Object.entries(P).reduce((N,[m,A])=>(N[m]=x(A,m),N),{})}function K(P,C){return P.reduce((x,N,m)=>(x[N]=C[m],x),{})}}),Nm=Ae((e,t)=>{var n=Cm(),o=Ve().uniqueId;t.exports={run:r,undo:s};function r(a){(a.graph().acyclicer==="greedy"?n(a,l(a)):i(a)).forEach(u=>{let c=a.edge(u);a.removeEdge(u),c.forwardName=u.name,c.reversed=!0,a.setEdge(u.w,u.v,c,o("rev"))});function l(u){return c=>u.edge(c).weight}}function i(a){let l=[],u={},c={};function d(h){Object.hasOwn(c,h)||(c[h]=!0,u[h]=!0,a.outEdges(h).forEach(f=>{Object.hasOwn(u,f.w)?l.push(f):d(f.w)}),delete u[h])}return a.nodes().forEach(d),l}function s(a){a.edges().forEach(l=>{let u=a.edge(l);if(u.reversed){a.removeEdge(l);let c=u.forwardName;delete u.reversed,delete u.forwardName,a.setEdge(l.w,l.v,u,c)}})}}),Tm=Ae((e,t)=>{var n=Ve();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,u=s.node(l).rank,c=a.w,d=s.node(c).rank,h=a.name,f=s.edge(a),p=f.labelRank;if(d===u+1)return;s.removeEdge(a);let v,_,y;for(y=0,++u;u<d;++y,++u)f.points=[],_={width:0,height:0,edgeLabel:f,edgeObj:a,rank:u},v=n.addDummyNode(s,"edge",_,"_d"),u===p&&(_.width=f.width,_.height=f.height,_.dummy="edge-label",_.labelpos=f.labelpos),s.setEdge(l,v,{weight:f.weight},h),y===0&&s.graph().dummyChains.push(v),l=v;s.setEdge(l,c,{weight:f.weight},h)}function i(s){s.graph().dummyChains.forEach(a=>{let l=s.node(a),u=l.edgeLabel,c;for(s.setEdge(l.edgeObj,u);l.dummy;)c=s.successors(a)[0],s.removeNode(a),u.points.push({x:l.x,y:l.y}),l.dummy==="edge-label"&&(u.x=l.x,u.y=l.y,u.width=l.width,u.height=l.height),a=c,l=s.node(a)})}}),Xo=Ae((e,t)=>{var{applyWithChunking:n}=Ve();t.exports={longestPath:o,slack:r};function o(i){var s={};function a(l){var u=i.node(l);if(Object.hasOwn(s,l))return u.rank;s[l]=!0;let c=i.outEdges(l).map(h=>h==null?Number.POSITIVE_INFINITY:a(h.w)-i.edge(h).minlen);var d=n(Math.min,c);return d===Number.POSITIVE_INFINITY&&(d=0),u.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}}),Kl=Ae((e,t)=>{var n=ct().Graph,o=Xo().slack;t.exports=r;function r(l){var u=new n({directed:!1}),c=l.nodes()[0],d=l.nodeCount();u.setNode(c,{});for(var h,f;i(u,l)<d;)h=s(u,l),f=u.hasNode(h.v)?o(l,h):-o(l,h),a(u,l,f);return u}function i(l,u){function c(d){u.nodeEdges(d).forEach(h=>{var f=h.v,p=d===f?h.w:f;!l.hasNode(p)&&!o(u,h)&&(l.setNode(p,{}),l.setEdge(d,p,{}),c(p))})}return l.nodes().forEach(c),l.nodeCount()}function s(l,u){return u.edges().reduce((c,d)=>{let h=Number.POSITIVE_INFINITY;return l.hasNode(d.v)!==l.hasNode(d.w)&&(h=o(u,d)),h<c[0]?[h,d]:c},[Number.POSITIVE_INFINITY,null])[1]}function a(l,u,c){l.nodes().forEach(d=>u.node(d).rank+=c)}}),Pm=Ae((e,t)=>{var n=Kl(),o=Xo().slack,r=Xo().longestPath,i=ct().alg.preorder,s=ct().alg.postorder,a=Ve().simplify;t.exports=l,l.initLowLimValues=h,l.initCutValues=u,l.calcCutValue=d,l.leaveEdge=p,l.enterEdge=v,l.exchangeEdges=_;function l(w){w=a(w),r(w);var T=n(w);h(T),u(T,w);for(var M,z;M=p(T);)z=v(T,w,M),_(T,w,M,z)}function u(w,T){var M=s(w,w.nodes());M=M.slice(0,M.length-1),M.forEach(z=>c(w,T,z))}function c(w,T,M){var z=w.node(M),H=z.parent;w.edge(M,H).cutvalue=d(w,T,M)}function d(w,T,M){var z=w.node(M),H=z.parent,K=!0,P=T.edge(M,H),C=0;return P||(K=!1,P=T.edge(H,M)),C=P.weight,T.nodeEdges(M).forEach(x=>{var N=x.v===M,m=N?x.w:x.v;if(m!==H){var A=N===K,k=T.edge(x).weight;if(C+=A?k:-k,b(w,M,m)){var O=w.edge(M,m).cutvalue;C+=A?-O:O}}}),C}function h(w,T){arguments.length<2&&(T=w.nodes()[0]),f(w,{},1,T)}function f(w,T,M,z,H){var K=M,P=w.node(z);return T[z]=!0,w.neighbors(z).forEach(C=>{Object.hasOwn(T,C)||(M=f(w,T,M,C,z))}),P.low=K,P.lim=M++,H?P.parent=H:delete P.parent,M}function p(w){return w.edges().find(T=>w.edge(T).cutvalue<0)}function v(w,T,M){var z=M.v,H=M.w;T.hasEdge(z,H)||(z=M.w,H=M.v);var K=w.node(z),P=w.node(H),C=K,x=!1;K.lim>P.lim&&(C=P,x=!0);var N=T.edges().filter(m=>x===g(w,w.node(m.v),C)&&x!==g(w,w.node(m.w),C));return N.reduce((m,A)=>o(T,A)<o(T,m)?A:m)}function _(w,T,M,z){var H=M.v,K=M.w;w.removeEdge(H,K),w.setEdge(z.v,z.w,{}),h(w),u(w,T),y(w,T)}function y(w,T){var M=w.nodes().find(H=>!T.node(H).parent),z=i(w,M);z=z.slice(1),z.forEach(H=>{var K=w.node(H).parent,P=T.edge(H,K),C=!1;P||(P=T.edge(K,H),C=!0),T.node(H).rank=T.node(K).rank+(C?P.minlen:-P.minlen)})}function b(w,T,M){return w.hasEdge(T,M)}function g(w,T,M){return M.low<=T.lim&&T.lim<=M.lim}}),Am=Ae((e,t)=>{var n=Xo(),o=n.longestPath,r=Kl(),i=Pm();t.exports=s;function s(c){var d=c.graph().ranker;if(d instanceof Function)return d(c);switch(c.graph().ranker){case"network-simplex":u(c);break;case"tight-tree":l(c);break;case"longest-path":a(c);break;case"none":break;default:u(c)}}var a=o;function l(c){o(c),r(c)}function u(c){i(c)}}),Im=Ae((e,t)=>{t.exports=n;function n(i){let s=r(i);i.graph().dummyChains.forEach(a=>{let l=i.node(a),u=l.edgeObj,c=o(i,s,u.v,u.w),d=c.path,h=c.lca,f=0,p=d[f],v=!0;for(;a!==u.w;){if(l=i.node(a),v){for(;(p=d[f])!==h&&i.node(p).maxRank<l.rank;)f++;p===h&&(v=!1)}if(!v){for(;f<d.length-1&&i.node(p=d[f+1]).minRank<=l.rank;)f++;p=d[f]}i.setParent(a,p),a=i.successors(a)[0]}})}function o(i,s,a,l){let u=[],c=[],d=Math.min(s[a].low,s[l].low),h=Math.max(s[a].lim,s[l].lim),f,p;f=a;do f=i.parent(f),u.push(f);while(f&&(s[f].low>d||h>s[f].lim));for(p=f,f=l;(f=i.parent(f))!==p;)c.push(f);return{path:u.concat(c.reverse()),lca:p}}function r(i){let s={},a=0;function l(u){let c=a;i.children(u).forEach(l),s[u]={low:c,lim:a++}}return i.children().forEach(l),s}}),Om=Ae((e,t)=>{var n=Ve();t.exports={run:o,cleanup:a};function o(l){let u=n.addDummyNode(l,"root",{},"_root"),c=i(l),d=Object.values(c),h=n.applyWithChunking(Math.max,d)-1,f=2*h+1;l.graph().nestingRoot=u,l.edges().forEach(v=>l.edge(v).minlen*=f);let p=s(l)+1;l.children().forEach(v=>r(l,u,f,p,h,c,v)),l.graph().nodeRankFactor=f}function r(l,u,c,d,h,f,p){let v=l.children(p);if(!v.length){p!==u&&l.setEdge(u,p,{weight:0,minlen:c});return}let _=n.addBorderNode(l,"_bt"),y=n.addBorderNode(l,"_bb"),b=l.node(p);l.setParent(_,p),b.borderTop=_,l.setParent(y,p),b.borderBottom=y,v.forEach(g=>{r(l,u,c,d,h,f,g);let w=l.node(g),T=w.borderTop?w.borderTop:g,M=w.borderBottom?w.borderBottom:g,z=w.borderTop?d:2*d,H=T!==M?1:h-f[p]+1;l.setEdge(_,T,{weight:z,minlen:H,nestingEdge:!0}),l.setEdge(M,y,{weight:z,minlen:H,nestingEdge:!0})}),l.parent(p)||l.setEdge(u,_,{weight:0,minlen:h+f[p]})}function i(l){var u={};function c(d,h){var f=l.children(d);f&&f.length&&f.forEach(p=>c(p,h+1)),u[d]=h}return l.children().forEach(d=>c(d,1)),u}function s(l){return l.edges().reduce((u,c)=>u+l.edge(c).weight,0)}function a(l){var u=l.graph();l.removeNode(u.nestingRoot),delete u.nestingRoot,l.edges().forEach(c=>{var d=l.edge(c);d.nestingEdge&&l.removeEdge(c)})}}),Rm=Ae((e,t)=>{var n=Ve();t.exports=o;function o(i){function s(a){let l=i.children(a),u=i.node(a);if(l.length&&l.forEach(s),Object.hasOwn(u,"minRank")){u.borderLeft=[],u.borderRight=[];for(let c=u.minRank,d=u.maxRank+1;c<d;++c)r(i,"borderLeft","_bl",a,u,c),r(i,"borderRight","_br",a,u,c)}}i.children().forEach(s)}function r(i,s,a,l,u,c){let d={width:0,height:0,rank:c,borderType:s},h=u[s][c-1],f=n.addDummyNode(i,"border",d,a);u[s][c]=f,i.setParent(f,l),h&&i.setEdge(h,f,{weight:1})}}),Mm=Ae((e,t)=>{t.exports={adjust:n,undo:o};function n(c){let d=c.graph().rankdir.toLowerCase();(d==="lr"||d==="rl")&&r(c)}function o(c){let d=c.graph().rankdir.toLowerCase();(d==="bt"||d==="rl")&&s(c),(d==="lr"||d==="rl")&&(l(c),r(c))}function r(c){c.nodes().forEach(d=>i(c.node(d))),c.edges().forEach(d=>i(c.edge(d)))}function i(c){let d=c.width;c.width=c.height,c.height=d}function s(c){c.nodes().forEach(d=>a(c.node(d))),c.edges().forEach(d=>{let h=c.edge(d);h.points.forEach(a),Object.hasOwn(h,"y")&&a(h)})}function a(c){c.y=-c.y}function l(c){c.nodes().forEach(d=>u(c.node(d))),c.edges().forEach(d=>{let h=c.edge(d);h.points.forEach(u),Object.hasOwn(h,"x")&&u(h)})}function u(c){let d=c.x;c.x=c.y,c.y=d}}),Lm=Ae((e,t)=>{var n=Ve();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),u=n.range(l+1).map(()=>[]);function c(d){if(i[d])return;i[d]=!0;let h=r.node(d);u[h.rank].push(d),r.successors(d).forEach(c)}return s.sort((d,h)=>r.node(d).rank-r.node(h).rank).forEach(c),u}}),Dm=Ae((e,t)=>{var n=Ve().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((p,v)=>v)),u=s.flatMap(p=>i.outEdges(p).map(v=>({pos:l[v.w],weight:i.edge(v).weight})).sort((v,_)=>v.pos-_.pos)),c=1;for(;c<a.length;)c<<=1;let d=2*c-1;c-=1;let h=new Array(d).fill(0),f=0;return u.forEach(p=>{let v=p.pos+c;h[v]+=p.weight;let _=0;for(;v>0;)v%2&&(_+=h[v+1]),v=v-1>>1,h[v]+=p.weight;f+=p.weight*_}),f}}),$m=Ae((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,u)=>{let c=o.edge(u),d=o.node(u.v);return{sum:l.sum+c.weight*d.order,weight:l.weight+c.weight}},{sum:0,weight:0});return{v:i,barycenter:a.sum/a.weight,weight:a.weight}}else return{v:i}})}}),Bm=Ae((e,t)=>{var n=Ve();t.exports=o;function o(s,a){let l={};s.forEach((c,d)=>{let h=l[c.v]={indegree:0,in:[],out:[],vs:[c.v],i:d};c.barycenter!==void 0&&(h.barycenter=c.barycenter,h.weight=c.weight)}),a.edges().forEach(c=>{let d=l[c.v],h=l[c.w];d!==void 0&&h!==void 0&&(h.indegree++,d.out.push(l[c.w]))});let u=Object.values(l).filter(c=>!c.indegree);return r(u)}function r(s){let a=[];function l(c){return d=>{d.merged||(d.barycenter===void 0||c.barycenter===void 0||d.barycenter>=c.barycenter)&&i(c,d)}}function u(c){return d=>{d.in.push(c),--d.indegree===0&&s.push(d)}}for(;s.length;){let c=s.pop();a.push(c),c.in.reverse().forEach(l(c)),c.out.forEach(u(c))}return a.filter(c=>!c.merged).map(c=>n.pick(c,["vs","i","barycenter","weight"]))}function i(s,a){let l=0,u=0;s.weight&&(l+=s.barycenter*s.weight,u+=s.weight),a.weight&&(l+=a.barycenter*a.weight,u+=a.weight),s.vs=a.vs.concat(s.vs),s.barycenter=l/u,s.weight=u,s.i=Math.min(a.i,s.i),a.merged=!0}}),zm=Ae((e,t)=>{var n=Ve();t.exports=o;function o(s,a){let l=n.partition(s,_=>Object.hasOwn(_,"barycenter")),u=l.lhs,c=l.rhs.sort((_,y)=>y.i-_.i),d=[],h=0,f=0,p=0;u.sort(i(!!a)),p=r(d,c,p),u.forEach(_=>{p+=_.vs.length,d.push(_.vs),h+=_.barycenter*_.weight,f+=_.weight,p=r(d,c,p)});let v={vs:d.flat(!0)};return f&&(v.barycenter=h/f,v.weight=f),v}function r(s,a,l){let u;for(;a.length&&(u=a[a.length-1]).i<=l;)a.pop(),s.push(u.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}}),Vm=Ae((e,t)=>{var n=$m(),o=Bm(),r=zm();t.exports=i;function i(l,u,c,d){let h=l.children(u),f=l.node(u),p=f?f.borderLeft:void 0,v=f?f.borderRight:void 0,_={};p&&(h=h.filter(w=>w!==p&&w!==v));let y=n(l,h);y.forEach(w=>{if(l.children(w.v).length){let T=i(l,w.v,c,d);_[w.v]=T,Object.hasOwn(T,"barycenter")&&a(w,T)}});let b=o(y,c);s(b,_);let g=r(b,d);if(p&&(g.vs=[p,g.vs,v].flat(!0),l.predecessors(p).length)){let w=l.node(l.predecessors(p)[0]),T=l.node(l.predecessors(v)[0]);Object.hasOwn(g,"barycenter")||(g.barycenter=0,g.weight=0),g.barycenter=(g.barycenter*g.weight+w.order+T.order)/(g.weight+2),g.weight+=2}return g}function s(l,u){l.forEach(c=>{c.vs=c.vs.flatMap(d=>u[d]?u[d].vs:d)})}function a(l,u){l.barycenter!==void 0?(l.barycenter=(l.barycenter*l.weight+u.barycenter*u.weight)/(l.weight+u.weight),l.weight+=u.weight):(l.barycenter=u.barycenter,l.weight=u.weight)}}),Fm=Ae((e,t)=>{var n=ct().Graph,o=Ve();t.exports=r;function r(s,a,l,u){u||(u=s.nodes());let c=i(s),d=new n({compound:!0}).setGraph({root:c}).setDefaultNodeLabel(h=>s.node(h));return u.forEach(h=>{let f=s.node(h),p=s.parent(h);(f.rank===a||f.minRank<=a&&a<=f.maxRank)&&(d.setNode(h),d.setParent(h,p||c),s[l](h).forEach(v=>{let _=v.v===h?v.w:v.v,y=d.edge(_,h),b=y!==void 0?y.weight:0;d.setEdge(_,h,{weight:s.edge(v).weight+b})}),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}}),Hm=Ae((e,t)=>{t.exports=n;function n(o,r,i){let s={},a;i.forEach(l=>{let u=o.parent(l),c,d;for(;u;){if(c=o.parent(u),c?(d=s[c],s[c]=u):(d=a,a=u),d&&d!==u){r.setEdge(d,u);return}u=c}})}}),Gm=Ae((e,t)=>{var n=Lm(),o=Dm(),r=Vm(),i=Fm(),s=Hm(),a=ct().Graph,l=Ve();t.exports=u;function u(f,p={}){if(typeof p.customOrder=="function"){p.customOrder(f,u);return}let v=l.maxRank(f),_=c(f,l.range(1,v+1),"inEdges"),y=c(f,l.range(v-1,-1,-1),"outEdges"),b=n(f);if(h(f,b),p.disableOptimalOrderHeuristic)return;let g=Number.POSITIVE_INFINITY,w,T=p.constraints||[];for(let M=0,z=0;z<4;++M,++z){d(M%2?_:y,M%4>=2,T),b=l.buildLayerMatrix(f);let H=o(f,b);H<g?(z=0,w=Object.assign({},b),g=H):H===g&&(w=structuredClone(b))}h(f,w)}function c(f,p,v){let _=new Map,y=(b,g)=>{_.has(b)||_.set(b,[]),_.get(b).push(g)};for(let b of f.nodes()){let g=f.node(b);if(typeof g.rank=="number"&&y(g.rank,b),typeof g.minRank=="number"&&typeof g.maxRank=="number")for(let w=g.minRank;w<=g.maxRank;w++)w!==g.rank&&y(w,b)}return p.map(function(b){return i(f,b,v,_.get(b)||[])})}function d(f,p,v){let _=new a;f.forEach(function(y){v.forEach(w=>_.setEdge(w.left,w.right));let b=y.graph().root,g=r(y,b,_,p);g.vs.forEach((w,T)=>y.node(w).order=T),s(y,_,g.vs)})}function h(f,p){Object.values(p).forEach(v=>v.forEach((_,y)=>f.node(_).order=y))}}),jm=Ae((e,t)=>{var n=ct().Graph,o=Ve();t.exports={positionX:v,findType1Conflicts:r,findType2Conflicts:i,addConflict:a,hasConflict:l,verticalAlignment:u,horizontalCompaction:c,alignCoordinates:f,findSmallestWidthAlignment:h,balance:p};function r(b,g){let w={};function T(M,z){let H=0,K=0,P=M.length,C=z[z.length-1];return z.forEach((x,N)=>{let m=s(b,x),A=m?b.node(m).order:P;(m||x===C)&&(z.slice(K,N+1).forEach(k=>{b.predecessors(k).forEach(O=>{let L=b.node(O),F=L.order;(F<H||A<F)&&!(L.dummy&&b.node(k).dummy)&&a(w,O,k)})}),K=N+1,H=A)}),z}return g.length&&g.reduce(T),w}function i(b,g){let w={};function T(z,H,K,P,C){let x;o.range(H,K).forEach(N=>{x=z[N],b.node(x).dummy&&b.predecessors(x).forEach(m=>{let A=b.node(m);A.dummy&&(A.order<P||A.order>C)&&a(w,m,x)})})}function M(z,H){let K=-1,P,C=0;return H.forEach((x,N)=>{if(b.node(x).dummy==="border"){let m=b.predecessors(x);m.length&&(P=b.node(m[0]).order,T(H,C,N,K,P),C=N,K=P)}T(H,C,H.length,P,z.length)}),H}return g.length&&g.reduce(M),w}function s(b,g){if(b.node(g).dummy)return b.predecessors(g).find(w=>b.node(w).dummy)}function a(b,g,w){if(g>w){let M=g;g=w,w=M}let T=b[g];T||(b[g]=T={}),T[w]=!0}function l(b,g,w){if(g>w){let T=g;g=w,w=T}return!!b[g]&&Object.hasOwn(b[g],w)}function u(b,g,w,T){let M={},z={},H={};return g.forEach(K=>{K.forEach((P,C)=>{M[P]=P,z[P]=P,H[P]=C})}),g.forEach(K=>{let P=-1;K.forEach(C=>{let x=T(C);if(x.length){x=x.sort((m,A)=>H[m]-H[A]);let N=(x.length-1)/2;for(let m=Math.floor(N),A=Math.ceil(N);m<=A;++m){let k=x[m];z[C]===C&&P<H[k]&&!l(w,C,k)&&(z[k]=C,z[C]=M[C]=M[k],P=H[k])}}})}),{root:M,align:z}}function c(b,g,w,T,M){let z={},H=d(b,g,w,M),K=M?"borderLeft":"borderRight";function P(N,m){let A=H.nodes().slice(),k={},O=A.pop();for(;O;){if(k[O])N(O);else{k[O]=!0,A.push(O);for(let L of m(O))A.push(L)}O=A.pop()}}function C(N){z[N]=H.inEdges(N).reduce((m,A)=>Math.max(m,z[A.v]+H.edge(A)),0)}function x(N){let m=H.outEdges(N).reduce((k,O)=>Math.min(k,z[O.w]-H.edge(O)),Number.POSITIVE_INFINITY),A=b.node(N);m!==Number.POSITIVE_INFINITY&&A.borderType!==K&&(z[N]=Math.max(z[N],m))}return P(C,H.predecessors.bind(H)),P(x,H.successors.bind(H)),Object.keys(T).forEach(N=>z[N]=z[w[N]]),z}function d(b,g,w,T){let M=new n,z=b.graph(),H=_(z.nodesep,z.edgesep,T);return g.forEach(K=>{let P;K.forEach(C=>{let x=w[C];if(M.setNode(x),P){var N=w[P],m=M.edge(N,x);M.setEdge(N,x,Math.max(H(b,C,P),m||0))}P=C})}),M}function h(b,g){return Object.values(g).reduce((w,T)=>{let M=Number.NEGATIVE_INFINITY,z=Number.POSITIVE_INFINITY;Object.entries(T).forEach(([K,P])=>{let C=y(b,K)/2;M=Math.max(P+C,M),z=Math.min(P-C,z)});let H=M-z;return H<w[0]&&(w=[H,T]),w},[Number.POSITIVE_INFINITY,null])[1]}function f(b,g){let w=Object.values(g),T=o.applyWithChunking(Math.min,w),M=o.applyWithChunking(Math.max,w);["u","d"].forEach(z=>{["l","r"].forEach(H=>{let K=z+H,P=b[K];if(P===g)return;let C=Object.values(P),x=T-o.applyWithChunking(Math.min,C);H!=="l"&&(x=M-o.applyWithChunking(Math.max,C)),x&&(b[K]=o.mapValues(P,N=>N+x))})})}function p(b,g){return o.mapValues(b.ul,(w,T)=>{if(g)return b[g.toLowerCase()][T];{let M=Object.values(b).map(z=>z[T]).sort((z,H)=>z-H);return(M[1]+M[2])/2}})}function v(b){let g=o.buildLayerMatrix(b),w=Object.assign(r(b,g),i(b,g)),T={},M;["u","d"].forEach(H=>{M=H==="u"?g:Object.values(g).reverse(),["l","r"].forEach(K=>{K==="r"&&(M=M.map(N=>Object.values(N).reverse()));let P=(H==="u"?b.predecessors:b.successors).bind(b),C=u(b,M,w,P),x=c(b,M,C.root,C.align,K==="r");K==="r"&&(x=o.mapValues(x,N=>-N)),T[H+K]=x})});let z=h(b,T);return f(T,z),p(T,b.graph().align)}function _(b,g,w){return(T,M,z)=>{let H=T.node(M),K=T.node(z),P=0,C;if(P+=H.width/2,Object.hasOwn(H,"labelpos"))switch(H.labelpos.toLowerCase()){case"l":C=-H.width/2;break;case"r":C=H.width/2;break}if(C&&(P+=w?C:-C),C=0,P+=(H.dummy?g:b)/2,P+=(K.dummy?g:b)/2,P+=K.width/2,Object.hasOwn(K,"labelpos"))switch(K.labelpos.toLowerCase()){case"l":C=K.width/2;break;case"r":C=-K.width/2;break}return C&&(P+=w?C:-C),C=0,P}}function y(b,g){return b.node(g).width}}),qm=Ae((e,t)=>{var n=Ve(),o=jm().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,u=s.graph().rankalign,c=0;a.forEach(d=>{let h=d.reduce((f,p)=>{let v=s.node(p).height;return f>v?f:v},0);d.forEach(f=>{let p=s.node(f);u==="top"?p.y=c+p.height/2:u==="bottom"?p.y=c+h-p.height/2:p.y=c+h/2}),c+=h+l})}}),Um=Ae((e,t)=>{var n=Nm(),o=Tm(),r=Am(),i=Ve().normalizeRanks,s=Im(),a=Ve().removeEmptyRanks,l=Om(),u=Rm(),c=Mm(),d=Gm(),h=qm(),f=Ve(),p=ct().Graph;t.exports=v;function v(E,R={}){let B=R.debugTiming?f.time:f.notime;return B("layout",()=>{let W=B(" buildLayoutGraph",()=>P(E));return B(" runLayout",()=>_(W,B,R)),B(" updateInputGraph",()=>y(E,W)),W})}function _(E,R,B){R(" makeSpaceForEdgeLabels",()=>C(E)),R(" removeSelfEdges",()=>G(E)),R(" acyclic",()=>n.run(E)),R(" nestingGraph.run",()=>l.run(E)),R(" rank",()=>r(f.asNonCompoundGraph(E))),R(" injectEdgeLabelProxies",()=>x(E)),R(" removeEmptyRanks",()=>a(E)),R(" nestingGraph.cleanup",()=>l.cleanup(E)),R(" normalizeRanks",()=>i(E)),R(" assignRankMinMax",()=>N(E)),R(" removeEdgeLabelProxies",()=>m(E)),R(" normalize.run",()=>o.run(E)),R(" parentDummyChains",()=>s(E)),R(" addBorderSegments",()=>u(E)),R(" order",()=>d(E,B)),R(" insertSelfEdges",()=>U(E)),R(" adjustCoordinateSystem",()=>c.adjust(E)),R(" position",()=>h(E)),R(" positionSelfEdges",()=>Z(E)),R(" removeBorderNodes",()=>F(E)),R(" normalize.undo",()=>o.undo(E)),R(" fixupEdgeLabelCoords",()=>O(E)),R(" undoCoordinateSystem",()=>c.undo(E)),R(" translateGraph",()=>A(E)),R(" assignNodeIntersects",()=>k(E)),R(" reversePoints",()=>L(E)),R(" acyclic.undo",()=>n.undo(E))}function y(E,R){E.nodes().forEach(B=>{let W=E.node(B),Q=R.node(B);W&&(W.x=Q.x,W.y=Q.y,W.order=Q.order,W.rank=Q.rank,R.children(B).length&&(W.width=Q.width,W.height=Q.height))}),E.edges().forEach(B=>{let W=E.edge(B),Q=R.edge(B);W.points=Q.points,Object.hasOwn(Q,"x")&&(W.x=Q.x,W.y=Q.y)}),E.graph().width=R.graph().width,E.graph().height=R.graph().height}var b=["nodesep","edgesep","ranksep","marginx","marginy"],g={ranksep:50,edgesep:20,nodesep:50,rankdir:"tb",rankalign:"center"},w=["acyclicer","ranker","rankdir","align","rankalign"],T=["width","height","rank"],M={width:0,height:0},z=["minlen","weight","width","height","labeloffset"],H={minlen:1,weight:1,width:0,height:0,labeloffset:10,labelpos:"r"},K=["labelpos"];function P(E){let R=new p({multigraph:!0,compound:!0}),B=D(E.graph());return R.setGraph(Object.assign({},g,te(B,b),f.pick(B,w))),E.nodes().forEach(W=>{let Q=D(E.node(W)),ne=te(Q,T);Object.keys(M).forEach(se=>{ne[se]===void 0&&(ne[se]=M[se])}),R.setNode(W,ne),R.setParent(W,E.parent(W))}),E.edges().forEach(W=>{let Q=D(E.edge(W));R.setEdge(W,Object.assign({},H,te(Q,z),f.pick(Q,K)))}),R}function C(E){let R=E.graph();R.ranksep/=2,E.edges().forEach(B=>{let W=E.edge(B);W.minlen*=2,W.labelpos.toLowerCase()!=="c"&&(R.rankdir==="TB"||R.rankdir==="BT"?W.width+=W.labeloffset:W.height+=W.labeloffset)})}function x(E){E.edges().forEach(R=>{let B=E.edge(R);if(B.width&&B.height){let W=E.node(R.v),Q={rank:(E.node(R.w).rank-W.rank)/2+W.rank,e:R};f.addDummyNode(E,"edge-proxy",Q,"_ep")}})}function N(E){let R=0;E.nodes().forEach(B=>{let W=E.node(B);W.borderTop&&(W.minRank=E.node(W.borderTop).rank,W.maxRank=E.node(W.borderBottom).rank,R=Math.max(R,W.maxRank))}),E.graph().maxRank=R}function m(E){E.nodes().forEach(R=>{let B=E.node(R);B.dummy==="edge-proxy"&&(E.edge(B.e).labelRank=B.rank,E.removeNode(R))})}function A(E){let R=Number.POSITIVE_INFINITY,B=0,W=Number.POSITIVE_INFINITY,Q=0,ne=E.graph(),se=ne.marginx||0,ue=ne.marginy||0;function _e($){let I=$.x,V=$.y,Y=$.width,q=$.height;R=Math.min(R,I-Y/2),B=Math.max(B,I+Y/2),W=Math.min(W,V-q/2),Q=Math.max(Q,V+q/2)}E.nodes().forEach($=>_e(E.node($))),E.edges().forEach($=>{let I=E.edge($);Object.hasOwn(I,"x")&&_e(I)}),R-=se,W-=ue,E.nodes().forEach($=>{let I=E.node($);I.x-=R,I.y-=W}),E.edges().forEach($=>{let I=E.edge($);I.points.forEach(V=>{V.x-=R,V.y-=W}),Object.hasOwn(I,"x")&&(I.x-=R),Object.hasOwn(I,"y")&&(I.y-=W)}),ne.width=B-R+se,ne.height=Q-W+ue}function k(E){E.edges().forEach(R=>{let B=E.edge(R),W=E.node(R.v),Q=E.node(R.w),ne,se;B.points?(ne=B.points[0],se=B.points[B.points.length-1]):(B.points=[],ne=Q,se=W),B.points.unshift(f.intersectRect(W,ne)),B.points.push(f.intersectRect(Q,se))})}function O(E){E.edges().forEach(R=>{let B=E.edge(R);if(Object.hasOwn(B,"x"))switch((B.labelpos==="l"||B.labelpos==="r")&&(B.width-=B.labeloffset),B.labelpos){case"l":B.x-=B.width/2+B.labeloffset;break;case"r":B.x+=B.width/2+B.labeloffset;break}})}function L(E){E.edges().forEach(R=>{let B=E.edge(R);B.reversed&&B.points.reverse()})}function F(E){E.nodes().forEach(R=>{if(E.children(R).length){let B=E.node(R),W=E.node(B.borderTop),Q=E.node(B.borderBottom),ne=E.node(B.borderLeft[B.borderLeft.length-1]),se=E.node(B.borderRight[B.borderRight.length-1]);B.width=Math.abs(se.x-ne.x),B.height=Math.abs(Q.y-W.y),B.x=ne.x+B.width/2,B.y=W.y+B.height/2}}),E.nodes().forEach(R=>{E.node(R).dummy==="border"&&E.removeNode(R)})}function G(E){E.edges().forEach(R=>{if(R.v===R.w){var B=E.node(R.v);B.selfEdges||(B.selfEdges=[]),B.selfEdges.push({e:R,label:E.edge(R)}),E.removeEdge(R)}})}function U(E){var R=f.buildLayerMatrix(E);R.forEach(B=>{var W=0;B.forEach((Q,ne)=>{var se=E.node(Q);se.order=ne+W,(se.selfEdges||[]).forEach(ue=>{f.addDummyNode(E,"selfedge",{width:ue.label.width,height:ue.label.height,rank:se.rank,order:ne+ ++W,e:ue.e,label:ue.label},"_se")}),delete se.selfEdges})})}function Z(E){E.nodes().forEach(R=>{var B=E.node(R);if(B.dummy==="selfedge"){var W=E.node(B.e.v),Q=W.x+W.width/2,ne=W.y,se=B.x-Q,ue=W.height/2;E.setEdge(B.e,B.label),E.removeNode(R),B.label.points=[{x:Q+2*se/3,y:ne-ue},{x:Q+5*se/6,y:ne-ue},{x:Q+se,y:ne},{x:Q+5*se/6,y:ne+ue},{x:Q+2*se/3,y:ne+ue}],B.label.x=B.x,B.label.y=B.y}})}function te(E,R){return f.mapValues(f.pick(E,R),Number)}function D(E){var R={};return E&&Object.entries(E).forEach(([B,W])=>{typeof B=="string"&&(B=B.toLowerCase()),R[B]=W}),R}}),Wm=Ae((e,t)=>{var n=Ve(),o=ct().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,u)=>{let c="layer"+u;a.setNode(c,{rank:"same"}),l.reduce((d,h)=>(a.setEdge(d,h,{style:"invis"}),h))}),a}}),Ym=Ae((e,t)=>{t.exports="2.0.4"}),Xm=Ae((e,t)=>{t.exports={graphlib:ct(),layout:Um(),debug:Wm(),util:{time:Ve().time,notime:Ve().notime},version:Ym()}});const qs=Xm();function Kn(e){return Ai()?(zn(e),!0):!1}function Ct(e){return typeof e=="function"?e():S(e)}const Km=typeof window<"u"&&typeof document<"u",Zm=e=>typeof e<"u",Jm=Object.prototype.toString,Qm=e=>Jm.call(e)==="[object Object]",ev=()=>{};function tv(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 Zl=e=>e();function nv(e=Zl){const t=fe(!0);function n(){t.value=!1}function o(){t.value=!0}const r=(...i)=>{t.value&&e(...i)};return{isActive:Mn(t),pause:n,resume:o,eventFilter:r}}function Us(e,t=!1,n="Timeout"){return new Promise((o,r)=>{setTimeout(t?()=>r(n):o,e)})}function ov(e,t,n={}){const{eventFilter:o=Zl,...r}=n;return Ee(e,tv(o,t),r)}function rn(e,t,n={}){const{eventFilter:o,...r}=n,{eventFilter:i,pause:s,resume:a,isActive:l}=nv(o);return{stop:ov(e,t,{...r,eventFilter:i}),pause:s,resume:a,isActive:l}}function rv(e,t={}){if(!Ii(e))return Ua(e);const n=Array.isArray(e.value)?Array.from({length:e.value.length}):{};for(const o in e.value)n[o]=Cc(()=>({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 mi(e,t=!1){function n(d,{flush:h="sync",deep:f=!1,timeout:p,throwOnTimeout:v}={}){let _=null;const b=[new Promise(g=>{_=Ee(e,w=>{d(w)!==t&&(_?.(),g(w))},{flush:h,deep:f,immediate:!0})})];return p!=null&&b.push(Us(p,v).then(()=>Ct(e)).finally(()=>_?.())),Promise.race(b)}function o(d,h){if(!Ii(d))return n(w=>w===d,h);const{flush:f="sync",deep:p=!1,timeout:v,throwOnTimeout:_}=h??{};let y=null;const g=[new Promise(w=>{y=Ee([e,d],([T,M])=>{t!==(T===M)&&(y?.(),w(T))},{flush:f,deep:p,immediate:!0})})];return v!=null&&g.push(Us(v,_).then(()=>Ct(e)).finally(()=>(y?.(),Ct(e)))),Promise.race(g)}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 p=Array.from(f);return p.includes(d)||p.includes(Ct(d))},h)}function u(d){return c(1,d)}function c(d=1,h){let f=-1;return n(()=>(f+=1,f>=d),h)}return Array.isArray(Ct(e))?{toMatch:n,toContains:l,changed:u,changedTimes:c,get not(){return mi(e,!t)}}:{toMatch:n,toBe:o,toBeTruthy:r,toBeNull:i,toBeNaN:a,toBeUndefined:s,changed:u,changedTimes:c,get not(){return mi(e,!t)}}}function vi(e){return mi(e)}function iv(e){var t;const n=Ct(e);return(t=n?.$el)!=null?t:n}const Jl=Km?window:void 0;function Ql(...e){let t,n,o,r;if(typeof e[0]=="string"||Array.isArray(e[0])?([n,o,r]=e,t=Jl):[t,n,o,r]=e,!t)return ev;Array.isArray(n)||(n=[n]),Array.isArray(o)||(o=[o]);const i=[],s=()=>{i.forEach(c=>c()),i.length=0},a=(c,d,h,f)=>(c.addEventListener(d,h,f),()=>c.removeEventListener(d,h,f)),l=Ee(()=>[iv(t),Ct(r)],([c,d])=>{if(s(),!c)return;const h=Qm(d)?{...d}:d;i.push(...n.flatMap(f=>o.map(p=>a(c,f,p,h))))},{immediate:!0,flush:"post"}),u=()=>{l(),s()};return Kn(u),u}function sv(e){return typeof e=="function"?e:typeof e=="string"?t=>t.key===e:Array.isArray(e)?t=>e.includes(t.key):()=>!0}function Ws(...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=Jl,eventName:i="keydown",passive:s=!1,dedupe:a=!1}=o,l=sv(t);return Ql(r,i,c=>{c.repeat&&Ct(a)||l(c)&&n(c)},s)}function av(e){return JSON.parse(JSON.stringify(e))}function Vr(e,t,n,o={}){var r,i,s;const{clone:a=!1,passive:l=!1,eventName:u,deep:c=!1,defaultValue:d,shouldEmit:h}=o,f=Nn(),p=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 v=u;t||(t="modelValue"),v=v||`update:${t.toString()}`;const _=g=>a?typeof a=="function"?a(g):av(g):g,y=()=>Zm(e[t])?_(e[t]):d,b=g=>{h?h(g)&&p(v,g):p(v,g)};if(l){const g=y(),w=fe(g);let T=!1;return Ee(()=>e[t],M=>{T||(T=!0,w.value=_(M),At(()=>T=!1))}),Ee(w,M=>{!T&&(M!==e[t]||c)&&b(M)},{deep:c}),w}else return oe({get(){return y()},set(g){b(g)}})}var lv={value:()=>{}};function wr(){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 Po(n)}function Po(e){this._=e}function uv(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}})}Po.prototype=wr.prototype={constructor:Po,on:function(e,t){var n=this._,o=uv(e+"",n),r,i=-1,s=o.length;if(arguments.length<2){for(;++i<s;)if((r=(e=o[i]).type)&&(r=cv(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]=Ys(n[r],e.name,t);else if(t==null)for(r in n)n[r]=Ys(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 Po(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 cv(e,t){for(var n=0,o=e.length,r;n<o;++n)if((r=e[n]).name===t)return r.value}function Ys(e,t,n){for(var o=0,r=e.length;o<r;++o)if(e[o].name===t){e[o]=lv,e=e.slice(0,o).concat(e.slice(o+1));break}return n!=null&&e.push({name:t,value:n}),e}var yi="http://www.w3.org/1999/xhtml";const Xs={svg:"http://www.w3.org/2000/svg",xhtml:yi,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function br(e){var t=e+="",n=t.indexOf(":");return n>=0&&(t=e.slice(0,n))!=="xmlns"&&(e=e.slice(n+1)),Xs.hasOwnProperty(t)?{space:Xs[t],local:e}:e}function dv(e){return function(){var t=this.ownerDocument,n=this.namespaceURI;return n===yi&&t.documentElement.namespaceURI===yi?t.createElement(e):t.createElementNS(n,e)}}function fv(e){return function(){return this.ownerDocument.createElementNS(e.space,e.local)}}function eu(e){var t=br(e);return(t.local?fv:dv)(t)}function hv(){}function Ji(e){return e==null?hv:function(){return this.querySelector(e)}}function pv(e){typeof e!="function"&&(e=Ji(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,u,c=0;c<s;++c)(l=i[c])&&(u=e.call(l,l.__data__,c,i))&&("__data__"in l&&(u.__data__=l.__data__),a[c]=u);return new et(o,this._parents)}function gv(e){return e==null?[]:Array.isArray(e)?e:Array.from(e)}function mv(){return[]}function tu(e){return e==null?mv:function(){return this.querySelectorAll(e)}}function vv(e){return function(){return gv(e.apply(this,arguments))}}function yv(e){typeof e=="function"?e=vv(e):e=tu(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,u=0;u<a;++u)(l=s[u])&&(o.push(e.call(l,l.__data__,u,s)),r.push(l));return new et(o,r)}function nu(e){return function(){return this.matches(e)}}function ou(e){return function(t){return t.matches(e)}}var _v=Array.prototype.find;function wv(e){return function(){return _v.call(this.children,e)}}function bv(){return this.firstElementChild}function xv(e){return this.select(e==null?bv:wv(typeof e=="function"?e:ou(e)))}var Ev=Array.prototype.filter;function kv(){return Array.from(this.children)}function Sv(e){return function(){return Ev.call(this.children,e)}}function Cv(e){return this.selectAll(e==null?kv:Sv(typeof e=="function"?e:ou(e)))}function Nv(e){typeof e!="function"&&(e=nu(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,u=0;u<s;++u)(l=i[u])&&e.call(l,l.__data__,u,i)&&a.push(l);return new et(o,this._parents)}function ru(e){return new Array(e.length)}function Tv(){return new et(this._enter||this._groups.map(ru),this._parents)}function Ko(e,t){this.ownerDocument=e.ownerDocument,this.namespaceURI=e.namespaceURI,this._next=null,this._parent=e,this.__data__=t}Ko.prototype={constructor:Ko,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 Pv(e){return function(){return e}}function Av(e,t,n,o,r,i){for(var s=0,a,l=t.length,u=i.length;s<u;++s)(a=t[s])?(a.__data__=i[s],o[s]=a):n[s]=new Ko(e,i[s]);for(;s<l;++s)(a=t[s])&&(r[s]=a)}function Iv(e,t,n,o,r,i,s){var a,l,u=new Map,c=t.length,d=i.length,h=new Array(c),f;for(a=0;a<c;++a)(l=t[a])&&(h[a]=f=s.call(l,l.__data__,a,t)+"",u.has(f)?r[a]=l:u.set(f,l));for(a=0;a<d;++a)f=s.call(e,i[a],a,i)+"",(l=u.get(f))?(o[a]=l,l.__data__=i[a],u.delete(f)):n[a]=new Ko(e,i[a]);for(a=0;a<c;++a)(l=t[a])&&u.get(h[a])===l&&(r[a]=l)}function Ov(e){return e.__data__}function Rv(e,t){if(!arguments.length)return Array.from(this,Ov);var n=t?Iv:Av,o=this._parents,r=this._groups;typeof e!="function"&&(e=Pv(e));for(var i=r.length,s=new Array(i),a=new Array(i),l=new Array(i),u=0;u<i;++u){var c=o[u],d=r[u],h=d.length,f=Mv(e.call(c,c&&c.__data__,u,o)),p=f.length,v=a[u]=new Array(p),_=s[u]=new Array(p),y=l[u]=new Array(h);n(c,d,v,_,y,f,t);for(var b=0,g=0,w,T;b<p;++b)if(w=v[b]){for(b>=g&&(g=b+1);!(T=_[g])&&++g<p;);w._next=T||null}}return s=new et(s,o),s._enter=a,s._exit=l,s}function Mv(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function Lv(){return new et(this._exit||this._groups.map(ru),this._parents)}function Dv(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 $v(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 u=n[l],c=o[l],d=u.length,h=a[l]=new Array(d),f,p=0;p<d;++p)(f=u[p]||c[p])&&(h[p]=f);for(;l<r;++l)a[l]=n[l];return new et(a,this._parents)}function Bv(){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 zv(e){e||(e=Vv);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),u,c=0;c<a;++c)(u=s[c])&&(l[c]=u);l.sort(t)}return new et(r,this._parents).order()}function Vv(e,t){return e<t?-1:e>t?1:e>=t?0:NaN}function Fv(){var e=arguments[0];return arguments[0]=this,e.apply(null,arguments),this}function Hv(){return Array.from(this)}function Gv(){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 jv(){let e=0;for(const t of this)++e;return e}function qv(){return!this.node()}function Uv(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 Wv(e){return function(){this.removeAttribute(e)}}function Yv(e){return function(){this.removeAttributeNS(e.space,e.local)}}function Xv(e,t){return function(){this.setAttribute(e,t)}}function Kv(e,t){return function(){this.setAttributeNS(e.space,e.local,t)}}function Zv(e,t){return function(){var n=t.apply(this,arguments);n==null?this.removeAttribute(e):this.setAttribute(e,n)}}function Jv(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 Qv(e,t){var n=br(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?Yv:Wv:typeof t=="function"?n.local?Jv:Zv:n.local?Kv:Xv)(n,t))}function iu(e){return e.ownerDocument&&e.ownerDocument.defaultView||e.document&&e||e.defaultView}function ey(e){return function(){this.style.removeProperty(e)}}function ty(e,t,n){return function(){this.style.setProperty(e,t,n)}}function ny(e,t,n){return function(){var o=t.apply(this,arguments);o==null?this.style.removeProperty(e):this.style.setProperty(e,o,n)}}function oy(e,t,n){return arguments.length>1?this.each((t==null?ey:typeof t=="function"?ny:ty)(e,t,n??"")):bn(this.node(),e)}function bn(e,t){return e.style.getPropertyValue(t)||iu(e).getComputedStyle(e,null).getPropertyValue(t)}function ry(e){return function(){delete this[e]}}function iy(e,t){return function(){this[e]=t}}function sy(e,t){return function(){var n=t.apply(this,arguments);n==null?delete this[e]:this[e]=n}}function ay(e,t){return arguments.length>1?this.each((t==null?ry:typeof t=="function"?sy:iy)(e,t)):this.node()[e]}function su(e){return e.trim().split(/^|\s+/)}function Qi(e){return e.classList||new au(e)}function au(e){this._node=e,this._names=su(e.getAttribute("class")||"")}au.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 lu(e,t){for(var n=Qi(e),o=-1,r=t.length;++o<r;)n.add(t[o])}function uu(e,t){for(var n=Qi(e),o=-1,r=t.length;++o<r;)n.remove(t[o])}function ly(e){return function(){lu(this,e)}}function uy(e){return function(){uu(this,e)}}function cy(e,t){return function(){(t.apply(this,arguments)?lu:uu)(this,e)}}function dy(e,t){var n=su(e+"");if(arguments.length<2){for(var o=Qi(this.node()),r=-1,i=n.length;++r<i;)if(!o.contains(n[r]))return!1;return!0}return this.each((typeof t=="function"?cy:t?ly:uy)(n,t))}function fy(){this.textContent=""}function hy(e){return function(){this.textContent=e}}function py(e){return function(){var t=e.apply(this,arguments);this.textContent=t??""}}function gy(e){return arguments.length?this.each(e==null?fy:(typeof e=="function"?py:hy)(e)):this.node().textContent}function my(){this.innerHTML=""}function vy(e){return function(){this.innerHTML=e}}function yy(e){return function(){var t=e.apply(this,arguments);this.innerHTML=t??""}}function _y(e){return arguments.length?this.each(e==null?my:(typeof e=="function"?yy:vy)(e)):this.node().innerHTML}function wy(){this.nextSibling&&this.parentNode.appendChild(this)}function by(){return this.each(wy)}function xy(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function Ey(){return this.each(xy)}function ky(e){var t=typeof e=="function"?e:eu(e);return this.select(function(){return this.appendChild(t.apply(this,arguments))})}function Sy(){return null}function Cy(e,t){var n=typeof e=="function"?e:eu(e),o=t==null?Sy:typeof t=="function"?t:Ji(t);return this.select(function(){return this.insertBefore(n.apply(this,arguments),o.apply(this,arguments)||null)})}function Ny(){var e=this.parentNode;e&&e.removeChild(this)}function Ty(){return this.each(Ny)}function Py(){var e=this.cloneNode(!1),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function Ay(){var e=this.cloneNode(!0),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function Iy(e){return this.select(e?Ay:Py)}function Oy(e){return arguments.length?this.property("__data__",e):this.node().__data__}function Ry(e){return function(t){e.call(this,t,this.__data__)}}function My(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 Ly(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 Dy(e,t,n){return function(){var o=this.__on,r,i=Ry(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 $y(e,t,n){var o=My(e+""),r,i=o.length,s;if(arguments.length<2){var a=this.node().__on;if(a){for(var l=0,u=a.length,c;l<u;++l)for(r=0,c=a[l];r<i;++r)if((s=o[r]).type===c.type&&s.name===c.name)return c.value}return}for(a=t?Dy:Ly,r=0;r<i;++r)this.each(a(o[r],t,n));return this}function cu(e,t,n){var o=iu(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 By(e,t){return function(){return cu(this,e,t)}}function zy(e,t){return function(){return cu(this,e,t.apply(this,arguments))}}function Vy(e,t){return this.each((typeof t=="function"?zy:By)(e,t))}function*Fy(){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 du=[null];function et(e,t){this._groups=e,this._parents=t}function ao(){return new et([[document.documentElement]],du)}function Hy(){return this}et.prototype=ao.prototype={constructor:et,select:pv,selectAll:yv,selectChild:xv,selectChildren:Cv,filter:Nv,data:Rv,enter:Tv,exit:Lv,join:Dv,merge:$v,selection:Hy,order:Bv,sort:zv,call:Fv,nodes:Hv,node:Gv,size:jv,empty:qv,each:Uv,attr:Qv,style:oy,property:ay,classed:dy,text:gy,html:_y,raise:by,lower:Ey,append:ky,insert:Cy,remove:Ty,clone:Iy,datum:Oy,on:$y,dispatch:Vy,[Symbol.iterator]:Fy};function st(e){return typeof e=="string"?new et([[document.querySelector(e)]],[document.documentElement]):new et([[e]],du)}function Gy(e){let t;for(;t=e.sourceEvent;)e=t;return e}function mt(e,t){if(e=Gy(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 jy={passive:!1},Zn={capture:!0,passive:!1};function Fr(e){e.stopImmediatePropagation()}function pn(e){e.preventDefault(),e.stopImmediatePropagation()}function fu(e){var t=e.document.documentElement,n=st(e).on("dragstart.drag",pn,Zn);"onselectstart"in t?n.on("selectstart.drag",pn,Zn):(t.__noselect=t.style.MozUserSelect,t.style.MozUserSelect="none")}function hu(e,t){var n=e.document.documentElement,o=st(e).on("dragstart.drag",null);t&&(o.on("click.drag",pn,Zn),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 mo=e=>()=>e;function _i(e,{sourceEvent:t,subject:n,target:o,identifier:r,active:i,x:s,y:a,dx:l,dy:u,dispatch:c}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:t,enumerable:!0,configurable:!0},subject:{value:n,enumerable:!0,configurable:!0},target:{value:o,enumerable:!0,configurable:!0},identifier:{value:r,enumerable:!0,configurable:!0},active:{value:i,enumerable:!0,configurable:!0},x:{value:s,enumerable:!0,configurable:!0},y:{value:a,enumerable:!0,configurable:!0},dx:{value:l,enumerable:!0,configurable:!0},dy:{value:u,enumerable:!0,configurable:!0},_:{value:c}})}_i.prototype.on=function(){var e=this._.on.apply(this._,arguments);return e===this._?this:e};function qy(e){return!e.ctrlKey&&!e.button}function Uy(){return this.parentNode}function Wy(e,t){return t??{x:e.x,y:e.y}}function Yy(){return navigator.maxTouchPoints||"ontouchstart"in this}function Xy(){var e=qy,t=Uy,n=Wy,o=Yy,r={},i=wr("start","drag","end"),s=0,a,l,u,c,d=0;function h(w){w.on("mousedown.drag",f).filter(o).on("touchstart.drag",_).on("touchmove.drag",y,jy).on("touchend.drag touchcancel.drag",b).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function f(w,T){if(!(c||!e.call(this,w,T))){var M=g(this,t.call(this,w,T),w,T,"mouse");M&&(st(w.view).on("mousemove.drag",p,Zn).on("mouseup.drag",v,Zn),fu(w.view),Fr(w),u=!1,a=w.clientX,l=w.clientY,M("start",w))}}function p(w){if(pn(w),!u){var T=w.clientX-a,M=w.clientY-l;u=T*T+M*M>d}r.mouse("drag",w)}function v(w){st(w.view).on("mousemove.drag mouseup.drag",null),hu(w.view,u),pn(w),r.mouse("end",w)}function _(w,T){if(e.call(this,w,T)){var M=w.changedTouches,z=t.call(this,w,T),H=M.length,K,P;for(K=0;K<H;++K)(P=g(this,z,w,T,M[K].identifier,M[K]))&&(Fr(w),P("start",w,M[K]))}}function y(w){var T=w.changedTouches,M=T.length,z,H;for(z=0;z<M;++z)(H=r[T[z].identifier])&&(pn(w),H("drag",w,T[z]))}function b(w){var T=w.changedTouches,M=T.length,z,H;for(c&&clearTimeout(c),c=setTimeout(function(){c=null},500),z=0;z<M;++z)(H=r[T[z].identifier])&&(Fr(w),H("end",w,T[z]))}function g(w,T,M,z,H,K){var P=i.copy(),C=mt(K||M,T),x,N,m;if((m=n.call(w,new _i("beforestart",{sourceEvent:M,target:h,identifier:H,active:s,x:C[0],y:C[1],dx:0,dy:0,dispatch:P}),z))!=null)return x=m.x-C[0]||0,N=m.y-C[1]||0,function A(k,O,L){var F=C,G;switch(k){case"start":r[H]=A,G=s++;break;case"end":delete r[H],--s;case"drag":C=mt(L||O,T),G=s;break}P.call(k,w,new _i(k,{sourceEvent:O,subject:m,target:h,identifier:H,active:G,x:C[0]+x,y:C[1]+N,dx:C[0]-F[0],dy:C[1]-F[1],dispatch:P}),z)}}return h.filter=function(w){return arguments.length?(e=typeof w=="function"?w:mo(!!w),h):e},h.container=function(w){return arguments.length?(t=typeof w=="function"?w:mo(w),h):t},h.subject=function(w){return arguments.length?(n=typeof w=="function"?w:mo(w),h):n},h.touchable=function(w){return arguments.length?(o=typeof w=="function"?w:mo(!!w),h):o},h.on=function(){var w=i.on.apply(i,arguments);return w===i?h:w},h.clickDistance=function(w){return arguments.length?(d=(w=+w)*w,h):Math.sqrt(d)},h}function es(e,t,n){e.prototype=t.prototype=n,n.constructor=e}function pu(e,t){var n=Object.create(e.prototype);for(var o in t)n[o]=t[o];return n}function lo(){}var Jn=.7,Zo=1/Jn,gn="\\s*([+-]?\\d+)\\s*",Qn="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",bt="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",Ky=/^#([0-9a-f]{3,8})$/,Zy=new RegExp(`^rgb\\(${gn},${gn},${gn}\\)$`),Jy=new RegExp(`^rgb\\(${bt},${bt},${bt}\\)$`),Qy=new RegExp(`^rgba\\(${gn},${gn},${gn},${Qn}\\)$`),e_=new RegExp(`^rgba\\(${bt},${bt},${bt},${Qn}\\)$`),t_=new RegExp(`^hsl\\(${Qn},${bt},${bt}\\)$`),n_=new RegExp(`^hsla\\(${Qn},${bt},${bt},${Qn}\\)$`),Ks={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};es(lo,Jt,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:Zs,formatHex:Zs,formatHex8:o_,formatHsl:r_,formatRgb:Js,toString:Js});function Zs(){return this.rgb().formatHex()}function o_(){return this.rgb().formatHex8()}function r_(){return gu(this).formatHsl()}function Js(){return this.rgb().formatRgb()}function Jt(e){var t,n;return e=(e+"").trim().toLowerCase(),(t=Ky.exec(e))?(n=t[1].length,t=parseInt(t[1],16),n===6?Qs(t):n===3?new Ye(t>>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):n===8?vo(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):n===4?vo(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=Zy.exec(e))?new Ye(t[1],t[2],t[3],1):(t=Jy.exec(e))?new Ye(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=Qy.exec(e))?vo(t[1],t[2],t[3],t[4]):(t=e_.exec(e))?vo(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=t_.exec(e))?na(t[1],t[2]/100,t[3]/100,1):(t=n_.exec(e))?na(t[1],t[2]/100,t[3]/100,t[4]):Ks.hasOwnProperty(e)?Qs(Ks[e]):e==="transparent"?new Ye(NaN,NaN,NaN,0):null}function Qs(e){return new Ye(e>>16&255,e>>8&255,e&255,1)}function vo(e,t,n,o){return o<=0&&(e=t=n=NaN),new Ye(e,t,n,o)}function i_(e){return e instanceof lo||(e=Jt(e)),e?(e=e.rgb(),new Ye(e.r,e.g,e.b,e.opacity)):new Ye}function wi(e,t,n,o){return arguments.length===1?i_(e):new Ye(e,t,n,o??1)}function Ye(e,t,n,o){this.r=+e,this.g=+t,this.b=+n,this.opacity=+o}es(Ye,wi,pu(lo,{brighter(e){return e=e==null?Zo:Math.pow(Zo,e),new Ye(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?Jn:Math.pow(Jn,e),new Ye(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new Ye(Xt(this.r),Xt(this.g),Xt(this.b),Jo(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:ea,formatHex:ea,formatHex8:s_,formatRgb:ta,toString:ta}));function ea(){return`#${Yt(this.r)}${Yt(this.g)}${Yt(this.b)}`}function s_(){return`#${Yt(this.r)}${Yt(this.g)}${Yt(this.b)}${Yt((isNaN(this.opacity)?1:this.opacity)*255)}`}function ta(){const e=Jo(this.opacity);return`${e===1?"rgb(":"rgba("}${Xt(this.r)}, ${Xt(this.g)}, ${Xt(this.b)}${e===1?")":`, ${e})`}`}function Jo(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function Xt(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function Yt(e){return e=Xt(e),(e<16?"0":"")+e.toString(16)}function na(e,t,n,o){return o<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new at(e,t,n,o)}function gu(e){if(e instanceof at)return new at(e.h,e.s,e.l,e.opacity);if(e instanceof lo||(e=Jt(e)),!e)return new at;if(e instanceof at)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 at(s,a,l,e.opacity)}function a_(e,t,n,o){return arguments.length===1?gu(e):new at(e,t,n,o??1)}function at(e,t,n,o){this.h=+e,this.s=+t,this.l=+n,this.opacity=+o}es(at,a_,pu(lo,{brighter(e){return e=e==null?Zo:Math.pow(Zo,e),new at(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?Jn:Math.pow(Jn,e),new at(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 Ye(Hr(e>=240?e-240:e+120,r,o),Hr(e,r,o),Hr(e<120?e+240:e-120,r,o),this.opacity)},clamp(){return new at(oa(this.h),yo(this.s),yo(this.l),Jo(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=Jo(this.opacity);return`${e===1?"hsl(":"hsla("}${oa(this.h)}, ${yo(this.s)*100}%, ${yo(this.l)*100}%${e===1?")":`, ${e})`}`}}));function oa(e){return e=(e||0)%360,e<0?e+360:e}function yo(e){return Math.max(0,Math.min(1,e||0))}function Hr(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 ts=e=>()=>e;function l_(e,t){return function(n){return e+n*t}}function u_(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 c_(e){return(e=+e)==1?mu:function(t,n){return n-t?u_(t,n,e):ts(isNaN(t)?n:t)}}function mu(e,t){var n=t-e;return n?l_(e,n):ts(isNaN(e)?t:e)}const Qo=(function e(t){var n=c_(t);function o(r,i){var s=n((r=wi(r)).r,(i=wi(i)).r),a=n(r.g,i.g),l=n(r.b,i.b),u=mu(r.opacity,i.opacity);return function(c){return r.r=s(c),r.g=a(c),r.b=l(c),r.opacity=u(c),r+""}}return o.gamma=e,o})(1);function d_(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 f_(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}function h_(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 p_(e,t){var n=new Date;return e=+e,t=+t,function(o){return n.setTime(e*(1-o)+t*o),n}}function vt(e,t){return e=+e,t=+t,function(n){return e*(1-n)+t*n}}function g_(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 bi=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,Gr=new RegExp(bi.source,"g");function m_(e){return function(){return e}}function v_(e){return function(t){return e(t)+""}}function vu(e,t){var n=bi.lastIndex=Gr.lastIndex=0,o,r,i,s=-1,a=[],l=[];for(e=e+"",t=t+"";(o=bi.exec(e))&&(r=Gr.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:vt(o,r)})),n=Gr.lastIndex;return n<t.length&&(i=t.slice(n),a[s]?a[s]+=i:a[++s]=i),a.length<2?l[0]?v_(l[0].x):m_(t):(t=l.length,function(u){for(var c=0,d;c<t;++c)a[(d=l[c]).i]=d.x(u);return a.join("")})}function Hn(e,t){var n=typeof t,o;return t==null||n==="boolean"?ts(t):(n==="number"?vt:n==="string"?(o=Jt(t))?(t=o,Qo):vu:t instanceof Jt?Qo:t instanceof Date?p_:f_(t)?d_:Array.isArray(t)?h_:typeof t.valueOf!="function"&&typeof t.toString!="function"||isNaN(t)?g_:vt)(e,t)}var ra=180/Math.PI,xi={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function yu(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)*ra,skewX:Math.atan(l)*ra,scaleX:s,scaleY:a}}var _o;function y_(e){const t=new(typeof DOMMatrix=="function"?DOMMatrix:WebKitCSSMatrix)(e+"");return t.isIdentity?xi:yu(t.a,t.b,t.c,t.d,t.e,t.f)}function __(e){return e==null||(_o||(_o=document.createElementNS("http://www.w3.org/2000/svg","g")),_o.setAttribute("transform",e),!(e=_o.transform.baseVal.consolidate()))?xi:(e=e.matrix,yu(e.a,e.b,e.c,e.d,e.e,e.f))}function _u(e,t,n,o){function r(u){return u.length?u.pop()+" ":""}function i(u,c,d,h,f,p){if(u!==d||c!==h){var v=f.push("translate(",null,t,null,n);p.push({i:v-4,x:vt(u,d)},{i:v-2,x:vt(c,h)})}else(d||h)&&f.push("translate("+d+t+h+n)}function s(u,c,d,h){u!==c?(u-c>180?c+=360:c-u>180&&(u+=360),h.push({i:d.push(r(d)+"rotate(",null,o)-2,x:vt(u,c)})):c&&d.push(r(d)+"rotate("+c+o)}function a(u,c,d,h){u!==c?h.push({i:d.push(r(d)+"skewX(",null,o)-2,x:vt(u,c)}):c&&d.push(r(d)+"skewX("+c+o)}function l(u,c,d,h,f,p){if(u!==d||c!==h){var v=f.push(r(f)+"scale(",null,",",null,")");p.push({i:v-4,x:vt(u,d)},{i:v-2,x:vt(c,h)})}else(d!==1||h!==1)&&f.push(r(f)+"scale("+d+","+h+")")}return function(u,c){var d=[],h=[];return u=e(u),c=e(c),i(u.translateX,u.translateY,c.translateX,c.translateY,d,h),s(u.rotate,c.rotate,d,h),a(u.skewX,c.skewX,d,h),l(u.scaleX,u.scaleY,c.scaleX,c.scaleY,d,h),u=c=null,function(f){for(var p=-1,v=h.length,_;++p<v;)d[(_=h[p]).i]=_.x(f);return d.join("")}}}var w_=_u(y_,"px, ","px)","deg)"),b_=_u(__,", ",")",")"),x_=1e-12;function ia(e){return((e=Math.exp(e))+1/e)/2}function E_(e){return((e=Math.exp(e))-1/e)/2}function k_(e){return((e=Math.exp(2*e))-1)/(e+1)}const Ao=(function e(t,n,o){function r(i,s){var a=i[0],l=i[1],u=i[2],c=s[0],d=s[1],h=s[2],f=c-a,p=d-l,v=f*f+p*p,_,y;if(v<x_)y=Math.log(h/u)/t,_=function(z){return[a+z*f,l+z*p,u*Math.exp(t*z*y)]};else{var b=Math.sqrt(v),g=(h*h-u*u+o*v)/(2*u*n*b),w=(h*h-u*u-o*v)/(2*h*n*b),T=Math.log(Math.sqrt(g*g+1)-g),M=Math.log(Math.sqrt(w*w+1)-w);y=(M-T)/t,_=function(z){var H=z*y,K=ia(T),P=u/(n*b)*(K*k_(t*H+T)-E_(T));return[a+P*f,l+P*p,u*K/ia(t*H+T)]}}return _.duration=y*1e3*t/Math.SQRT2,_}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 xn=0,Dn=0,On=0,wu=1e3,er,$n,tr=0,Qt=0,xr=0,eo=typeof performance=="object"&&performance.now?performance:Date,bu=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(e){setTimeout(e,17)};function ns(){return Qt||(bu(S_),Qt=eo.now()+xr)}function S_(){Qt=0}function nr(){this._call=this._time=this._next=null}nr.prototype=xu.prototype={constructor:nr,restart:function(e,t,n){if(typeof e!="function")throw new TypeError("callback is not a function");n=(n==null?ns():+n)+(t==null?0:+t),!this._next&&$n!==this&&($n?$n._next=this:er=this,$n=this),this._call=e,this._time=n,Ei()},stop:function(){this._call&&(this._call=null,this._time=1/0,Ei())}};function xu(e,t,n){var o=new nr;return o.restart(e,t,n),o}function C_(){ns(),++xn;for(var e=er,t;e;)(t=Qt-e._time)>=0&&e._call.call(void 0,t),e=e._next;--xn}function sa(){Qt=(tr=eo.now())+xr,xn=Dn=0;try{C_()}finally{xn=0,T_(),Qt=0}}function N_(){var e=eo.now(),t=e-tr;t>wu&&(xr-=t,tr=e)}function T_(){for(var e,t=er,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:er=n);$n=e,Ei(o)}function Ei(e){if(!xn){Dn&&(Dn=clearTimeout(Dn));var t=e-Qt;t>24?(e<1/0&&(Dn=setTimeout(sa,e-eo.now()-xr)),On&&(On=clearInterval(On))):(On||(tr=eo.now(),On=setInterval(N_,wu)),xn=1,bu(sa))}}function aa(e,t,n){var o=new nr;return t=t==null?0:+t,o.restart(r=>{o.stop(),e(r+t)},t,n),o}var P_=wr("start","end","cancel","interrupt"),A_=[],Eu=0,la=1,ki=2,Io=3,ua=4,Si=5,Oo=6;function Er(e,t,n,o,r,i){var s=e.__transition;if(!s)e.__transition={};else if(n in s)return;I_(e,n,{name:t,index:o,group:r,on:P_,tween:A_,time:i.time,delay:i.delay,duration:i.duration,ease:i.ease,timer:null,state:Eu})}function os(e,t){var n=ft(e,t);if(n.state>Eu)throw new Error("too late; already scheduled");return n}function kt(e,t){var n=ft(e,t);if(n.state>Io)throw new Error("too late; already running");return n}function ft(e,t){var n=e.__transition;if(!n||!(n=n[t]))throw new Error("transition not found");return n}function I_(e,t,n){var o=e.__transition,r;o[t]=n,n.timer=xu(i,0,n.time);function i(u){n.state=la,n.timer.restart(s,n.delay,n.time),n.delay<=u&&s(u-n.delay)}function s(u){var c,d,h,f;if(n.state!==la)return l();for(c in o)if(f=o[c],f.name===n.name){if(f.state===Io)return aa(s);f.state===ua?(f.state=Oo,f.timer.stop(),f.on.call("interrupt",e,e.__data__,f.index,f.group),delete o[c]):+c<t&&(f.state=Oo,f.timer.stop(),f.on.call("cancel",e,e.__data__,f.index,f.group),delete o[c])}if(aa(function(){n.state===Io&&(n.state=ua,n.timer.restart(a,n.delay,n.time),a(u))}),n.state=ki,n.on.call("start",e,e.__data__,n.index,n.group),n.state===ki){for(n.state=Io,r=new Array(h=n.tween.length),c=0,d=-1;c<h;++c)(f=n.tween[c].value.call(e,e.__data__,n.index,n.group))&&(r[++d]=f);r.length=d+1}}function a(u){for(var c=u<n.duration?n.ease.call(null,u/n.duration):(n.timer.restart(l),n.state=Si,1),d=-1,h=r.length;++d<h;)r[d].call(e,c);n.state===Si&&(n.on.call("end",e,e.__data__,n.index,n.group),l())}function l(){n.state=Oo,n.timer.stop(),delete o[t];for(var u in o)return;delete e.__transition}}function Ro(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>ki&&o.state<Si,o.state=Oo,o.timer.stop(),o.on.call(r?"interrupt":"cancel",e,e.__data__,o.index,o.group),delete n[s]}i&&delete e.__transition}}function O_(e){return this.each(function(){Ro(this,e)})}function R_(e,t){var n,o;return function(){var r=kt(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 M_(e,t,n){var o,r;if(typeof n!="function")throw new Error;return function(){var i=kt(this,e),s=i.tween;if(s!==o){r=(o=s).slice();for(var a={name:t,value:n},l=0,u=r.length;l<u;++l)if(r[l].name===t){r[l]=a;break}l===u&&r.push(a)}i.tween=r}}function L_(e,t){var n=this._id;if(e+="",arguments.length<2){for(var o=ft(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?R_:M_)(n,e,t))}function rs(e,t,n){var o=e._id;return e.each(function(){var r=kt(this,o);(r.value||(r.value={}))[t]=n.apply(this,arguments)}),function(r){return ft(r,o).value[t]}}function ku(e,t){var n;return(typeof t=="number"?vt:t instanceof Jt?Qo:(n=Jt(t))?(t=n,Qo):vu)(e,t)}function D_(e){return function(){this.removeAttribute(e)}}function $_(e){return function(){this.removeAttributeNS(e.space,e.local)}}function B_(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 z_(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 V_(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 F_(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 H_(e,t){var n=br(e),o=n==="transform"?b_:ku;return this.attrTween(e,typeof t=="function"?(n.local?F_:V_)(n,o,rs(this,"attr."+e,t)):t==null?(n.local?$_:D_)(n):(n.local?z_:B_)(n,o,t))}function G_(e,t){return function(n){this.setAttribute(e,t.call(this,n))}}function j_(e,t){return function(n){this.setAttributeNS(e.space,e.local,t.call(this,n))}}function q_(e,t){var n,o;function r(){var i=t.apply(this,arguments);return i!==o&&(n=(o=i)&&j_(e,i)),n}return r._value=t,r}function U_(e,t){var n,o;function r(){var i=t.apply(this,arguments);return i!==o&&(n=(o=i)&&G_(e,i)),n}return r._value=t,r}function W_(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=br(e);return this.tween(n,(o.local?q_:U_)(o,t))}function Y_(e,t){return function(){os(this,e).delay=+t.apply(this,arguments)}}function X_(e,t){return t=+t,function(){os(this,e).delay=t}}function K_(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?Y_:X_)(t,e)):ft(this.node(),t).delay}function Z_(e,t){return function(){kt(this,e).duration=+t.apply(this,arguments)}}function J_(e,t){return t=+t,function(){kt(this,e).duration=t}}function Q_(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?Z_:J_)(t,e)):ft(this.node(),t).duration}function e0(e,t){if(typeof t!="function")throw new Error;return function(){kt(this,e).ease=t}}function t0(e){var t=this._id;return arguments.length?this.each(e0(t,e)):ft(this.node(),t).ease}function n0(e,t){return function(){var n=t.apply(this,arguments);if(typeof n!="function")throw new Error;kt(this,e).ease=n}}function o0(e){if(typeof e!="function")throw new Error;return this.each(n0(this._id,e))}function r0(e){typeof e!="function"&&(e=nu(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,u=0;u<s;++u)(l=i[u])&&e.call(l,l.__data__,u,i)&&a.push(l);return new Rt(o,this._parents,this._name,this._id)}function i0(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],u=n[a],c=l.length,d=s[a]=new Array(c),h,f=0;f<c;++f)(h=l[f]||u[f])&&(d[f]=h);for(;a<o;++a)s[a]=t[a];return new Rt(s,this._parents,this._name,this._id)}function s0(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 a0(e,t,n){var o,r,i=s0(t)?os:kt;return function(){var s=i(this,e),a=s.on;a!==o&&(r=(o=a).copy()).on(t,n),s.on=r}}function l0(e,t){var n=this._id;return arguments.length<2?ft(this.node(),n).on.on(e):this.each(a0(n,e,t))}function u0(e){return function(){var t=this.parentNode;for(var n in this.__transition)if(+n!==e)return;t&&t.removeChild(this)}}function c0(){return this.on("end.remove",u0(this._id))}function d0(e){var t=this._name,n=this._id;typeof e!="function"&&(e=Ji(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,u=i[s]=new Array(l),c,d,h=0;h<l;++h)(c=a[h])&&(d=e.call(c,c.__data__,h,a))&&("__data__"in c&&(d.__data__=c.__data__),u[h]=d,Er(u[h],t,n,h,u,ft(c,n)));return new Rt(i,this._parents,t,n)}function f0(e){var t=this._name,n=this._id;typeof e!="function"&&(e=tu(e));for(var o=this._groups,r=o.length,i=[],s=[],a=0;a<r;++a)for(var l=o[a],u=l.length,c,d=0;d<u;++d)if(c=l[d]){for(var h=e.call(c,c.__data__,d,l),f,p=ft(c,n),v=0,_=h.length;v<_;++v)(f=h[v])&&Er(f,t,n,v,h,p);i.push(h),s.push(c)}return new Rt(i,s,t,n)}var h0=ao.prototype.constructor;function p0(){return new h0(this._groups,this._parents)}function g0(e,t){var n,o,r;return function(){var i=bn(this,e),s=(this.style.removeProperty(e),bn(this,e));return i===s?null:i===n&&s===o?r:r=t(n=i,o=s)}}function Su(e){return function(){this.style.removeProperty(e)}}function m0(e,t,n){var o,r=n+"",i;return function(){var s=bn(this,e);return s===r?null:s===o?i:i=t(o=s,n)}}function v0(e,t,n){var o,r,i;return function(){var s=bn(this,e),a=n(this),l=a+"";return a==null&&(l=a=(this.style.removeProperty(e),bn(this,e))),s===l?null:s===o&&l===r?i:(r=l,i=t(o=s,a))}}function y0(e,t){var n,o,r,i="style."+t,s="end."+i,a;return function(){var l=kt(this,e),u=l.on,c=l.value[i]==null?a||(a=Su(t)):void 0;(u!==n||r!==c)&&(o=(n=u).copy()).on(s,r=c),l.on=o}}function _0(e,t,n){var o=(e+="")=="transform"?w_:ku;return t==null?this.styleTween(e,g0(e,o)).on("end.style."+e,Su(e)):typeof t=="function"?this.styleTween(e,v0(e,o,rs(this,"style."+e,t))).each(y0(this._id,e)):this.styleTween(e,m0(e,o,t),n).on("end.style."+e,null)}function w0(e,t,n){return function(o){this.style.setProperty(e,t.call(this,o),n)}}function b0(e,t,n){var o,r;function i(){var s=t.apply(this,arguments);return s!==r&&(o=(r=s)&&w0(e,s,n)),o}return i._value=t,i}function x0(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,b0(e,t,n??""))}function E0(e){return function(){this.textContent=e}}function k0(e){return function(){var t=e(this);this.textContent=t??""}}function S0(e){return this.tween("text",typeof e=="function"?k0(rs(this,"text",e)):E0(e==null?"":e+""))}function C0(e){return function(t){this.textContent=e.call(this,t)}}function N0(e){var t,n;function o(){var r=e.apply(this,arguments);return r!==n&&(t=(n=r)&&C0(r)),t}return o._value=e,o}function T0(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,N0(e))}function P0(){for(var e=this._name,t=this._id,n=Cu(),o=this._groups,r=o.length,i=0;i<r;++i)for(var s=o[i],a=s.length,l,u=0;u<a;++u)if(l=s[u]){var c=ft(l,t);Er(l,e,n,u,s,{time:c.time+c.delay+c.duration,delay:0,duration:c.duration,ease:c.ease})}return new Rt(o,this._parents,e,n)}function A0(){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 u=kt(this,o),c=u.on;c!==e&&(t=(e=c).copy(),t._.cancel.push(a),t._.interrupt.push(a),t._.end.push(l)),u.on=t}),r===0&&i()})}var I0=0;function Rt(e,t,n,o){this._groups=e,this._parents=t,this._name=n,this._id=o}function Cu(){return++I0}var St=ao.prototype;Rt.prototype={constructor:Rt,select:d0,selectAll:f0,selectChild:St.selectChild,selectChildren:St.selectChildren,filter:r0,merge:i0,selection:p0,transition:P0,call:St.call,nodes:St.nodes,node:St.node,size:St.size,empty:St.empty,each:St.each,on:l0,attr:H_,attrTween:W_,style:_0,styleTween:x0,text:S0,textTween:T0,remove:c0,tween:L_,delay:K_,duration:Q_,ease:t0,easeVarying:o0,end:A0,[Symbol.iterator]:St[Symbol.iterator]};function O0(e){return((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2}var R0={time:null,delay:0,duration:250,ease:O0};function M0(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 L0(e){var t,n;e instanceof Rt?(t=e._id,e=e._name):(t=Cu(),(n=R0).time=ns(),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,u=0;u<a;++u)(l=s[u])&&Er(l,e,t,u,s,n||M0(l,t));return new Rt(o,this._parents,e,t)}ao.prototype.interrupt=O_;ao.prototype.transition=L0;const wo=e=>()=>e;function D0(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 Tt(e,t,n){this.k=e,this.x=t,this.y=n}Tt.prototype={constructor:Tt,scale:function(e){return e===1?this:new Tt(this.k*e,this.x,this.y)},translate:function(e,t){return e===0&t===0?this:new Tt(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 En=new Tt(1,0,0);Tt.prototype;function jr(e){e.stopImmediatePropagation()}function Rn(e){e.preventDefault(),e.stopImmediatePropagation()}function $0(e){return(!e.ctrlKey||e.type==="wheel")&&!e.button}function B0(){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 ca(){return this.__zoom||En}function z0(e){return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*(e.ctrlKey?10:1)}function V0(){return navigator.maxTouchPoints||"ontouchstart"in this}function F0(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 H0(){var e=$0,t=B0,n=F0,o=z0,r=V0,i=[0,1/0],s=[[-1/0,-1/0],[1/0,1/0]],a=250,l=Ao,u=wr("start","zoom","end"),c,d,h,f=500,p=150,v=0,_=10;function y(m){m.property("__zoom",ca).on("wheel.zoom",H,{passive:!1}).on("mousedown.zoom",K).on("dblclick.zoom",P).filter(r).on("touchstart.zoom",C).on("touchmove.zoom",x).on("touchend.zoom touchcancel.zoom",N).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}y.transform=function(m,A,k,O){var L=m.selection?m.selection():m;L.property("__zoom",ca),m!==L?T(m,A,k,O):L.interrupt().each(function(){M(this,arguments).event(O).start().zoom(null,typeof A=="function"?A.apply(this,arguments):A).end()})},y.scaleBy=function(m,A,k,O){y.scaleTo(m,function(){var L=this.__zoom.k,F=typeof A=="function"?A.apply(this,arguments):A;return L*F},k,O)},y.scaleTo=function(m,A,k,O){y.transform(m,function(){var L=t.apply(this,arguments),F=this.__zoom,G=k==null?w(L):typeof k=="function"?k.apply(this,arguments):k,U=F.invert(G),Z=typeof A=="function"?A.apply(this,arguments):A;return n(g(b(F,Z),G,U),L,s)},k,O)},y.translateBy=function(m,A,k,O){y.transform(m,function(){return n(this.__zoom.translate(typeof A=="function"?A.apply(this,arguments):A,typeof k=="function"?k.apply(this,arguments):k),t.apply(this,arguments),s)},null,O)},y.translateTo=function(m,A,k,O,L){y.transform(m,function(){var F=t.apply(this,arguments),G=this.__zoom,U=O==null?w(F):typeof O=="function"?O.apply(this,arguments):O;return n(En.translate(U[0],U[1]).scale(G.k).translate(typeof A=="function"?-A.apply(this,arguments):-A,typeof k=="function"?-k.apply(this,arguments):-k),F,s)},O,L)};function b(m,A){return A=Math.max(i[0],Math.min(i[1],A)),A===m.k?m:new Tt(A,m.x,m.y)}function g(m,A,k){var O=A[0]-k[0]*m.k,L=A[1]-k[1]*m.k;return O===m.x&&L===m.y?m:new Tt(m.k,O,L)}function w(m){return[(+m[0][0]+ +m[1][0])/2,(+m[0][1]+ +m[1][1])/2]}function T(m,A,k,O){m.on("start.zoom",function(){M(this,arguments).event(O).start()}).on("interrupt.zoom end.zoom",function(){M(this,arguments).event(O).end()}).tween("zoom",function(){var L=this,F=arguments,G=M(L,F).event(O),U=t.apply(L,F),Z=k==null?w(U):typeof k=="function"?k.apply(L,F):k,te=Math.max(U[1][0]-U[0][0],U[1][1]-U[0][1]),D=L.__zoom,E=typeof A=="function"?A.apply(L,F):A,R=l(D.invert(Z).concat(te/D.k),E.invert(Z).concat(te/E.k));return function(B){if(B===1)B=E;else{var W=R(B),Q=te/W[2];B=new Tt(Q,Z[0]-W[0]*Q,Z[1]-W[1]*Q)}G.zoom(null,B)}})}function M(m,A,k){return!k&&m.__zooming||new z(m,A)}function z(m,A){this.that=m,this.args=A,this.active=0,this.sourceEvent=null,this.extent=t.apply(m,A),this.taps=0}z.prototype={event:function(m){return m&&(this.sourceEvent=m),this},start:function(){return++this.active===1&&(this.that.__zooming=this,this.emit("start")),this},zoom:function(m,A){return this.mouse&&m!=="mouse"&&(this.mouse[1]=A.invert(this.mouse[0])),this.touch0&&m!=="touch"&&(this.touch0[1]=A.invert(this.touch0[0])),this.touch1&&m!=="touch"&&(this.touch1[1]=A.invert(this.touch1[0])),this.that.__zoom=A,this.emit("zoom"),this},end:function(){return--this.active===0&&(delete this.that.__zooming,this.emit("end")),this},emit:function(m){var A=st(this.that).datum();u.call(m,this.that,new D0(m,{sourceEvent:this.sourceEvent,target:y,transform:this.that.__zoom,dispatch:u}),A)}};function H(m,...A){if(!e.apply(this,arguments))return;var k=M(this,A).event(m),O=this.__zoom,L=Math.max(i[0],Math.min(i[1],O.k*Math.pow(2,o.apply(this,arguments)))),F=mt(m);if(k.wheel)(k.mouse[0][0]!==F[0]||k.mouse[0][1]!==F[1])&&(k.mouse[1]=O.invert(k.mouse[0]=F)),clearTimeout(k.wheel);else{if(O.k===L)return;k.mouse=[F,O.invert(F)],Ro(this),k.start()}Rn(m),k.wheel=setTimeout(G,p),k.zoom("mouse",n(g(b(O,L),k.mouse[0],k.mouse[1]),k.extent,s));function G(){k.wheel=null,k.end()}}function K(m,...A){if(h||!e.apply(this,arguments))return;var k=m.currentTarget,O=M(this,A,!0).event(m),L=st(m.view).on("mousemove.zoom",Z,!0).on("mouseup.zoom",te,!0),F=mt(m,k),G=m.clientX,U=m.clientY;fu(m.view),jr(m),O.mouse=[F,this.__zoom.invert(F)],Ro(this),O.start();function Z(D){if(Rn(D),!O.moved){var E=D.clientX-G,R=D.clientY-U;O.moved=E*E+R*R>v}O.event(D).zoom("mouse",n(g(O.that.__zoom,O.mouse[0]=mt(D,k),O.mouse[1]),O.extent,s))}function te(D){L.on("mousemove.zoom mouseup.zoom",null),hu(D.view,O.moved),Rn(D),O.event(D).end()}}function P(m,...A){if(e.apply(this,arguments)){var k=this.__zoom,O=mt(m.changedTouches?m.changedTouches[0]:m,this),L=k.invert(O),F=k.k*(m.shiftKey?.5:2),G=n(g(b(k,F),O,L),t.apply(this,A),s);Rn(m),a>0?st(this).transition().duration(a).call(T,G,O,m):st(this).call(y.transform,G,O,m)}}function C(m,...A){if(e.apply(this,arguments)){var k=m.touches,O=k.length,L=M(this,A,m.changedTouches.length===O).event(m),F,G,U,Z;for(jr(m),G=0;G<O;++G)U=k[G],Z=mt(U,this),Z=[Z,this.__zoom.invert(Z),U.identifier],L.touch0?!L.touch1&&L.touch0[2]!==Z[2]&&(L.touch1=Z,L.taps=0):(L.touch0=Z,F=!0,L.taps=1+!!c);c&&(c=clearTimeout(c)),F&&(L.taps<2&&(d=Z[0],c=setTimeout(function(){c=null},f)),Ro(this),L.start())}}function x(m,...A){if(this.__zooming){var k=M(this,A).event(m),O=m.changedTouches,L=O.length,F,G,U,Z;for(Rn(m),F=0;F<L;++F)G=O[F],U=mt(G,this),k.touch0&&k.touch0[2]===G.identifier?k.touch0[0]=U:k.touch1&&k.touch1[2]===G.identifier&&(k.touch1[0]=U);if(G=k.that.__zoom,k.touch1){var te=k.touch0[0],D=k.touch0[1],E=k.touch1[0],R=k.touch1[1],B=(B=E[0]-te[0])*B+(B=E[1]-te[1])*B,W=(W=R[0]-D[0])*W+(W=R[1]-D[1])*W;G=b(G,Math.sqrt(B/W)),U=[(te[0]+E[0])/2,(te[1]+E[1])/2],Z=[(D[0]+R[0])/2,(D[1]+R[1])/2]}else if(k.touch0)U=k.touch0[0],Z=k.touch0[1];else return;k.zoom("touch",n(g(G,U,Z),k.extent,s))}}function N(m,...A){if(this.__zooming){var k=M(this,A).event(m),O=m.changedTouches,L=O.length,F,G;for(jr(m),h&&clearTimeout(h),h=setTimeout(function(){h=null},f),F=0;F<L;++F)G=O[F],k.touch0&&k.touch0[2]===G.identifier?delete k.touch0:k.touch1&&k.touch1[2]===G.identifier&&delete k.touch1;if(k.touch1&&!k.touch0&&(k.touch0=k.touch1,delete k.touch1),k.touch0)k.touch0[1]=this.__zoom.invert(k.touch0[0]);else if(k.end(),k.taps===2&&(G=mt(G,this),Math.hypot(d[0]-G[0],d[1]-G[1])<_)){var U=st(this).on("dblclick.zoom");U&&U.apply(this,arguments)}}}return y.wheelDelta=function(m){return arguments.length?(o=typeof m=="function"?m:wo(+m),y):o},y.filter=function(m){return arguments.length?(e=typeof m=="function"?m:wo(!!m),y):e},y.touchable=function(m){return arguments.length?(r=typeof m=="function"?m:wo(!!m),y):r},y.extent=function(m){return arguments.length?(t=typeof m=="function"?m:wo([[+m[0][0],+m[0][1]],[+m[1][0],+m[1][1]]]),y):t},y.scaleExtent=function(m){return arguments.length?(i[0]=+m[0],i[1]=+m[1],y):[i[0],i[1]]},y.translateExtent=function(m){return arguments.length?(s[0][0]=+m[0][0],s[1][0]=+m[1][0],s[0][1]=+m[0][1],s[1][1]=+m[1][1],y):[[s[0][0],s[0][1]],[s[1][0],s[1][1]]]},y.constrain=function(m){return arguments.length?(n=m,y):n},y.duration=function(m){return arguments.length?(a=+m,y):a},y.interpolate=function(m){return arguments.length?(l=m,y):l},y.on=function(){var m=u.on.apply(u,arguments);return m===u?y:m},y.clickDistance=function(m){return arguments.length?(v=(m=+m)*m,y):Math.sqrt(v)},y.tapDistance=function(m){return arguments.length?(_=+m,y):_},y}var de=(e=>(e.Left="left",e.Top="top",e.Right="right",e.Bottom="bottom",e))(de||{}),is=(e=>(e.Partial="partial",e.Full="full",e))(is||{}),qt=(e=>(e.Bezier="default",e.SimpleBezier="simple-bezier",e.Straight="straight",e.Step="step",e.SmoothStep="smoothstep",e))(qt||{}),Ht=(e=>(e.Strict="strict",e.Loose="loose",e))(Ht||{}),or=(e=>(e.Arrow="arrow",e.ArrowClosed="arrowclosed",e))(or||{}),Gn=(e=>(e.Free="free",e.Vertical="vertical",e.Horizontal="horizontal",e))(Gn||{}),Nu=(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))(Nu||{});const G0=["INPUT","SELECT","TEXTAREA"],j0=typeof document<"u"?document:null;function Ci(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 G0.includes(o?.nodeName)||r||!!i}function q0(e){return e.ctrlKey||e.metaKey||e.shiftKey||e.altKey}function da(e,t,n,o){const r=t.replace("+",`
14
- `).replace(`
15
-
16
- `,`
17
- +`).split(`
18
- `).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 U0(e,t){return n=>{if(!n.code&&!n.key)return!1;const o=W0(n.code,e);return Array.isArray(e)?e.some(r=>da(n[o],r,t,n.type==="keyup")):da(n[o],e,t,n.type==="keyup")}}function W0(e,t){return t.includes(e)?"code":"key"}function jn(e,t){const n=oe(()=>Ce(t?.target)??j0),o=Nt(Ce(e)===!0);let r=!1;const i=new Set;let s=l(Ce(e));Ee(()=>Ce(e),(u,c)=>{typeof c=="boolean"&&typeof u!="boolean"&&a(),s=l(u)},{immediate:!0}),Ql(["blur","contextmenu"],a),Ws((...u)=>s(...u),u=>{var c,d;const h=Ce(t?.actInsideInputWithModifier)??!0,f=Ce(t?.preventDefault)??!1;if(r=q0(u),(!r||r&&!h)&&Ci(u))return;const v=((d=(c=u.composedPath)==null?void 0:c.call(u))==null?void 0:d[0])||u.target,_=v?.nodeName==="BUTTON"||v?.nodeName==="A";!f&&(r||!_)&&u.preventDefault(),o.value=!0},{eventName:"keydown",target:n}),Ws((...u)=>s(...u),u=>{const c=Ce(t?.actInsideInputWithModifier)??!0;if(o.value){if((!r||r&&!c)&&Ci(u))return;r=!1,o.value=!1}},{eventName:"keyup",target:n});function a(){r=!1,i.clear(),o.value=Ce(e)===!0}function l(u){return u===null?(a(),()=>!1):typeof u=="boolean"?(a(),o.value=u,()=>!1):Array.isArray(u)||typeof u=="string"?U0(u,i):u}return o}const Tu="vue-flow__node-desc",Pu="vue-flow__edge-desc",Y0="vue-flow__aria-live",Au=["Enter"," ","Escape"],mn={ArrowUp:{x:0,y:-1},ArrowDown:{x:0,y:1},ArrowLeft:{x:-1,y:0},ArrowRight:{x:1,y:0}};function rr(e){return{...e.computedPosition||{x:0,y:0},width:e.dimensions.width||0,height:e.dimensions.height||0}}function ir(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 kr(e){return{width:e.offsetWidth,height:e.offsetHeight}}function en(e,t=0,n=1){return Math.min(Math.max(e,t),n)}function Iu(e,t){return{x:en(e.x,t[0][0],t[1][0]),y:en(e.y,t[0][1],t[1][1])}}function fa(e){const t=e.getRootNode();return"elementFromPoint"in t?t:window.document}function Gt(e){return e&&typeof e=="object"&&"id"in e&&"source"in e&&"target"in e}function Kt(e){return e&&typeof e=="object"&&"id"in e&&"position"in e&&!Gt(e)}function Bn(e){return Kt(e)&&"computedPosition"in e}function bo(e){return!Number.isNaN(e)&&Number.isFinite(e)}function X0(e){return bo(e.width)&&bo(e.height)&&bo(e.x)&&bo(e.y)}function K0(e,t,n){const o={id:e.id.toString(),type:e.type??"default",dimensions:cn({width:0,height:0}),computedPosition:cn({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:$e(e.data)?e.data:{},events:cn($e(e.events)?e.events:{})};return Object.assign(t??o,e,{id:e.id.toString(),parentNode:n})}function Ou(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:$e(e.data)?e.data:{},events:cn($e(e.events)?e.events:{}),label:e.label??"",interactionWidth:e.interactionWidth??n?.interactionWidth,...n??{}};return Object.assign(t??i,e,{id:e.id.toString()})}function Ru(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 Z0(...e){if(e.length===3){const[i,s,a]=e;return Ru(i,s,a,"target")}const[t,n]=e,o=typeof t=="string"?t:t.id;return n.filter(i=>Gt(i)&&i.source===o).map(i=>n.find(s=>Kt(s)&&s.id===i.target))}function J0(...e){if(e.length===3){const[i,s,a]=e;return Ru(i,s,a,"source")}const[t,n]=e,o=typeof t=="string"?t:t.id;return n.filter(i=>Gt(i)&&i.target===o).map(i=>n.find(s=>Kt(s)&&s.id===i.source))}function Mu({source:e,sourceHandle:t,target:n,targetHandle:o}){return`vueflow__edge-${e}${t??""}-${n}${o??""}`}function Q0(e,t){return t.some(n=>Gt(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 to({x:e,y:t},{x:n,y:o,zoom:r}){return{x:e*r+n,y:t*r+o}}function no({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?Sr(a,s):a}function ew(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 Lu({x:e,y:t,width:n,height:o}){return{x:e,y:t,x2:e+n,y2:t+o}}function tw({x:e,y:t,x2:n,y2:o}){return{x:e,y:t,width:n-e,height:o-t}}function Du(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=ew(t,Lu({...o.computedPosition,...o.dimensions}))}return tw(t)}function $u(e,t,n={x:0,y:0,zoom:1},o=!1,r=!1){const i={...no(t,n),width:t.width/n.zoom,height:t.height/n.zoom},s=[];for(const a of e){const{dimensions:l,selectable:u=!0,hidden:c=!1}=a,d=l.width??a.width??null,h=l.height??a.height??null;if(r&&!u||c)continue;const f=ir(i,rr(a)),p=d===null||h===null,v=o&&f>0,_=(d??0)*(h??0);(p||v||f>=_||a.dragging)&&s.push(a)}return s}function Bu(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 sn(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 uo(`The padding value "${e}" is invalid. Please provide a number or a string with a valid unit (px or %).`),0}function nw(e,t,n){if(typeof e=="string"||typeof e=="number"){const o=sn(e,n),r=sn(e,t);return{top:o,right:r,bottom:o,left:r,x:r*2,y:o*2}}if(typeof e=="object"){const o=sn(e.top??e.y??0,n),r=sn(e.bottom??e.y??0,n),i=sn(e.left??e.x??0,t),s=sn(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 ow(e,t,n,o,r,i){const{x:s,y:a}=to(e,{x:t,y:n,zoom:o}),{x:l,y:u}=to({x:e.x+e.width,y:e.y+e.height},{x:t,y:n,zoom:o}),c=r-l,d=i-u;return{left:Math.floor(s),top:Math.floor(a),right:Math.floor(c),bottom:Math.floor(d)}}function ha(e,t,n,o,r,i=.1){const s=nw(i,t,n),a=(t-s.x)/e.width,l=(n-s.y)/e.height,u=Math.min(a,l),c=en(u,o,r),d=e.x+e.width/2,h=e.y+e.height/2,f=t/2-d*c,p=n/2-h*c,v=ow(e,f,p,c,t,n),_={left:Math.min(v.left-s.left,0),top:Math.min(v.top-s.top,0),right:Math.min(v.right-s.right,0),bottom:Math.min(v.bottom-s.bottom,0)};return{x:f-_.left+_.right,y:p-_.top+_.bottom,zoom:c}}function rw(e,t){return{x:t.x+e.x,y:t.y+e.y,z:(e.z>t.z?e.z:t.z)+1}}function zu(e,t){if(!e.parentNode)return!1;const n=t.get(e.parentNode);return n?n.selected?!0:zu(n,t):!1}function oo(e,t){return typeof e>"u"?"":typeof e=="string"?e:`${t?`${t}__`:""}${Object.keys(e).sort().map(o=>`${o}=${e[o]}`).join("&")}`}function pa(e){const t=e.ctrlKey&&sr()?10:1;return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*t}function ga(e,t,n){return e<t?en(Math.abs(e-t),1,t)/t:e>n?-en(Math.abs(e-n),1,t)/t:0}function Vu(e,t,n=15,o=40){const r=ga(e.x,o,t.width-o)*n,i=ga(e.y,o,t.height-o)*n;return[r,i]}function qr(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 ma(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(Bn(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&&Bn(l)&&qr(s,l)}break;case"dimensions":if(Bn(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&&Bn(l)&&(!!l.dimensions.width&&!!l.dimensions.height?qr(s,l):At(()=>{qr(s,l)}))}break}return t}function Dt(e,t){return{id:e,type:"select",selected:t}}function va(e){return{item:e,type:"add"}}function ya(e){return{id:e,type:"remove"}}function _a(e,t,n,o,r){return{id:e,source:t,target:n,sourceHandle:o||null,targetHandle:r||null,type:"remove"}}function $t(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(Dt(i.id,s)))}return o}const wa=()=>{};function ae(e){const t=new Set;let n=wa,o=()=>!1;const r=()=>t.size>0||o(),i=h=>{n=h},s=()=>{n=wa},a=h=>{o=h},l=()=>{o=()=>!1},u=h=>{t.delete(h)};return{on:h=>{t.add(h);const f=()=>u(h);return Kn(f),{off:f}},off:u,trigger:h=>{const f=[n];return r()?f.push(...t):e&&f.push(e),Promise.allSettled(f.map(p=>p(h)))},hasListeners:r,listeners:t,setEmitter:i,removeEmitter:s,setHasEmitListeners:a,removeHasEmitListeners:l}}function ba(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 iw(e,t,n,o){var r,i;const s=new Map;for(const[a,l]of e)(l.selected||l.id===o)&&(!l.parentNode||!zu(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 Ur({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 Fu(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 sw(e,t,n){const[o,r,i,s]=typeof e!="string"?Fu(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 aw(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=sw(r,e,o);i&&(r=i)}else t(new Ge(ze.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]=Fu(r.padding),u=o?.computedPosition.x||0,c=o?.computedPosition.y||0;r=[[r.range[0][0]+u+l,r.range[0][1]+c+i],[r.range[1][0]+u-s,r.range[1][1]+c-a]]}return r==="parent"?[[Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY],[Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY]]:r}function lw({width:e,height:t},n){return[n[0],[n[1][0]-(e||0),n[1][1]-(t||0)]]}function ss(e,t,n,o,r){const i=lw(e.dimensions,aw(e,n,o,r)),s=Iu(t,i);return{position:{x:s.x-(r?.computedPosition.x||0),y:s.y-(r?.computedPosition.y||0)},computedPosition:s}}function kn(e,t,n=de.Left,o=!1){const r=(t?.x??0)+e.computedPosition.x,i=(t?.y??0)+e.computedPosition.y,{width:s,height:a}=t??fw(e);if(o)return{x:r+s/2,y:i+a/2};switch(t?.position??n){case de.Top:return{x:r+s/2,y:i};case de.Right:return{x:r+s,y:i+a/2};case de.Bottom:return{x:r+s/2,y:i+a};case de.Left:return{x:r,y:i+a/2}}}function xa(e,t){return e&&(t?e.find(n=>n.id===t):e[0])||null}function uw({sourcePos:e,targetPos:t,sourceWidth:n,sourceHeight:o,targetWidth:r,targetHeight:i,width:s,height:a,viewport:l}){const u={x:Math.min(e.x,t.x),y:Math.min(e.y,t.y),x2:Math.max(e.x+n,t.x+r),y2:Math.max(e.y+o,t.y+i)};u.x===u.x2&&(u.x2+=1),u.y===u.y2&&(u.y2+=1);const c=Lu({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(c.x2,u.x2)-Math.max(c.x,u.x)),h=Math.max(0,Math.min(c.y2,u.y2)-Math.max(c.y,u.y));return Math.ceil(d*h)>0}function cw(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 ze=(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))(ze||{});const Ea={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
19
- Node: ${e}`,NODE_NOT_FOUND:e=>`Node not found
20
- Node: ${e}`,NODE_MISSING_PARENT:(e,t)=>`Node is missing a parent
21
- Node: ${e}
22
- Parent: ${t}`,NODE_TYPE_MISSING:e=>`Node type is missing
23
- Type: ${e}`,NODE_EXTENT_INVALID:e=>`Only child nodes can use a parent extent
24
- Node: ${e}`,EDGE_INVALID:e=>`An edge needs a source and a target
25
- Edge: ${e}`,EDGE_SOURCE_MISSING:(e,t)=>`Edge source is missing
26
- Edge: ${e}
27
- Source: ${t}`,EDGE_TARGET_MISSING:(e,t)=>`Edge target is missing
28
- Edge: ${e}
29
- Target: ${t}`,EDGE_TYPE_MISSING:e=>`Edge type is missing
30
- Type: ${e}`,EDGE_SOURCE_TARGET_SAME:(e,t,n)=>`Edge source and target are the same
31
- Edge: ${e}
32
- Source: ${t}
33
- Target: ${n}`,EDGE_SOURCE_TARGET_MISSING:(e,t,n)=>`Edge source or target is missing
34
- Edge: ${e}
35
- Source: ${t}
36
- Target: ${n}`,EDGE_ORPHANED:e=>`Edge was orphaned (suddenly missing source or target) and has been removed
37
- Edge: ${e}`,EDGE_NOT_FOUND:e=>`Edge not found
38
- 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 Ge extends Error{constructor(t,...n){var o;super((o=Ea[t])==null?void 0:o.call(Ea,...n)),this.name="VueFlowError",this.code=t,this.args=n}}function as(e){return"clientX"in e}function dw(e){return"sourceEvent"in e}function yt(e,t){const n=as(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 sr=()=>{var e;return typeof navigator<"u"&&((e=navigator?.userAgent)==null?void 0:e.indexOf("Mac"))>=0};function fw(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 Sr(e,t=[1,1]){return{x:t[0]*Math.round(e.x/t[0]),y:t[1]*Math.round(e.y/t[1])}}const hw=()=>!0;function Wr(e){e?.classList.remove("valid","connecting","vue-flow__handle-valid","vue-flow__handle-connecting")}function pw(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())ir(r,rr(i))>0&&o.push(i);return o}const gw=250;function mw(e,t,n,o){var r,i;let s=[],a=Number.POSITIVE_INFINITY;const l=pw(e,n,t+gw);for(const u of l){const c=[...((r=u.handleBounds)==null?void 0:r.source)??[],...((i=u.handleBounds)==null?void 0:i.target)??[]];for(const d of c){if(o.nodeId===d.nodeId&&o.type===d.type&&o.id===d.id)continue;const{x:h,y:f}=kn(u,d,d.position,!0),p=Math.sqrt((h-e.x)**2+(f-e.y)**2);p>t||(p<a?(s=[{...d,x:h,y:f}],a=p):p===a&&s.push({...d,x:h,y:f}))}}if(!s.length)return null;if(s.length>1){const u=o.type==="source"?"target":"source";return s.find(c=>c.type===u)??s[0]}return s[0]}function ka(e,{handle:t,connectionMode:n,fromNodeId:o,fromHandleId:r,fromType:i,doc:s,lib:a,flowId:l,isValidConnection:u=hw},c,d,h,f){const p=i==="target",v=t?s.querySelector(`.${a}-flow__handle[data-id="${l}-${t?.nodeId}-${t?.id}-${t?.type}"]`):null,{x:_,y}=yt(e),b=s.elementFromPoint(_,y),g=b?.classList.contains(`${a}-flow__handle`)?b:v,w={handleDomNode:g,isValid:!1,connection:null,toHandle:null};if(g){const T=Hu(void 0,g),M=g.getAttribute("data-nodeid"),z=g.getAttribute("data-handleid"),H=g.classList.contains("connectable"),K=g.classList.contains("connectableend");if(!M||!T)return w;const P={source:p?M:o,sourceHandle:p?z:r,target:p?o:M,targetHandle:p?r:z};w.connection=P;const x=H&&K&&(n===Ht.Strict?p&&T==="source"||!p&&T==="target":M!==o||z!==r);w.isValid=x&&u(P,{nodes:d,edges:c,sourceNode:h(P.source),targetNode:h(P.target)}),w.toHandle=Gu(M,T,z,f,n,!0)}return w}function Hu(e,t){return e||(t?.classList.contains("target")?"target":t?.classList.contains("source")?"source":null)}function vw(e,t){let n=null;return t?n="valid":e&&!t&&(n="invalid"),n}function yw(e,t){let n=null;return t?n=!0:e&&!t&&(n=!1),n}function Gu(e,t,n,o,r,i=!1){var s,a,l;const u=o.get(e);if(!u)return null;const c=r===Ht.Strict?(s=u.handleBounds)==null?void 0:s[t]:[...((a=u.handleBounds)==null?void 0:a.source)??[],...((l=u.handleBounds)==null?void 0:l.target)??[]],d=(n?c?.find(h=>h.id===n):c?.[0])??null;return d&&i?{...d,...kn(u,d,d.position,!0)}:d}const Ni={[de.Left]:de.Right,[de.Right]:de.Left,[de.Top]:de.Bottom,[de.Bottom]:de.Top},_w=["production","prod"];function uo(e,...t){ju()&&console.warn(`[Vue Flow]: ${e}`,...t)}function ju(){return!_w.includes("production")}function Sa(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,...kr(s)}}):null}function Ti(e,t,n,o,r,i=!1,s){r.value=!1,e.selected?(i||e.selected&&t)&&(o([e]),At(()=>{s.blur()})):n([e])}function $e(e){return typeof S(e)<"u"}function ww(e,t,n,o){if(!e||!e.source||!e.target)return n(new Ge(ze.EDGE_INVALID,e?.id??"[ID UNKNOWN]")),!1;let r;return Gt(e)?r=e:r={...e,id:Mu(e)},r=Ou(r,void 0,o),Q0(r,t)?!1:r}function bw(e,t,n,o,r){if(!t.source||!t.target)return r(new Ge(ze.EDGE_INVALID,e.id)),!1;if(!n)return r(new Ge(ze.EDGE_NOT_FOUND,e.id)),!1;const{id:i,...s}=e;return{...s,id:o?Mu(t):i,source:t.source,target:t.target,sourceHandle:t.sourceHandle,targetHandle:t.targetHandle}}function Ca(e,t,n){const o={},r=[];for(let i=0;i<e.length;++i){const s=e[i];if(!Kt(s)){n(new Ge(ze.NODE_INVALID,s?.id)||`[ID UNKNOWN|INDEX ${i}]`);continue}const a=K0(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 Ge(ze.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 Na(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 u=o.get(s)||new Map;o.set(s,u.set(n,t))}}function Yr(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},u=`${r}-${s}--${i}-${a}`,c=`${i}-${a}--${r}-${s}`;Na("source",l,c,e,r,s),Na("target",l,u,e,i,a)}}function Ta(e,t){if(e.size!==t.size)return!1;for(const n of e)if(!t.has(n))return!1;return!0}function Xr(e,t,n,o,r,i,s,a){const l=[];for(const u of e){const c=Gt(u)?u:ww(u,a,r,i);if(!c)continue;const d=n(c.source),h=n(c.target);if(!d||!h){r(new Ge(ze.EDGE_SOURCE_TARGET_MISSING,c.id,c.source,c.target));continue}if(!d){r(new Ge(ze.EDGE_SOURCE_MISSING,c.id,c.source));continue}if(!h){r(new Ge(ze.EDGE_TARGET_MISSING,c.id,c.target));continue}if(t&&!t(c,{edges:a,nodes:s,sourceNode:d,targetNode:h})){r(new Ge(ze.EDGE_INVALID,c.id));continue}const f=o(c.id);l.push({...Ou(c,f,i),sourceNode:d,targetNode:h})}return l}const Pa=Symbol("vueFlow"),qu=Symbol("nodeId"),Uu=Symbol("nodeRef"),xw=Symbol("edgeId"),Ew=Symbol("edgeRef"),Cr=Symbol("slots");function Wu(e){const{vueFlowRef:t,snapToGrid:n,snapGrid:o,noDragClassName:r,nodeLookup:i,nodeExtent:s,nodeDragThreshold:a,viewport:l,autoPanOnNodeDrag:u,autoPanSpeed:c,nodesDraggable:d,panBy:h,findNode:f,multiSelectionActive:p,nodesSelectionActive:v,selectNodesOnDrag:_,removeSelectedElements:y,addSelectedNodes:b,updateNodePositions:g,emits:w}=Me(),{onStart:T,onDrag:M,onStop:z,onClick:H,el:K,disabled:P,id:C,selectable:x,dragHandle:N}=e,m=Nt(!1);let A=[],k,O=null,L={x:void 0,y:void 0},F={x:0,y:0},G=null,U=!1,Z=!1,te=0,D=!1;const E=Cw(),R=({x:ue,y:_e})=>{L={x:ue,y:_e};let $=!1;if(A=A.map(I=>{const V={x:ue-I.distance.x,y:_e-I.distance.y},{computedPosition:Y}=ss(I,n.value?Sr(V,o.value):V,w.error,s.value,I.parentNode?f(I.parentNode):void 0);return $=$||I.position.x!==Y.x||I.position.y!==Y.y,I.position=Y,I}),Z=Z||$,!!$&&(g(A,!0,!0),m.value=!0,G)){const[I,V]=Ur({id:C,dragItems:A,findNode:f});M({event:G,node:I,nodes:V})}},B=()=>{if(!O)return;const[ue,_e]=Vu(F,O,c.value);if(ue!==0||_e!==0){const $={x:(L.x??0)-ue/l.value.zoom,y:(L.y??0)-_e/l.value.zoom};h({x:ue,y:_e})&&R($)}te=requestAnimationFrame(B)},W=(ue,_e)=>{U=!0;const $=f(C);!_.value&&!p.value&&$&&($.selected||y()),$&&Ce(x)&&_.value&&Ti($,p.value,b,y,v,!1,_e);const I=E(ue.sourceEvent);if(L=I,A=iw(i.value,d.value,I,C),A.length){const[V,Y]=Ur({id:C,dragItems:A,findNode:f});T({event:ue.sourceEvent,node:V,nodes:Y})}},Q=(ue,_e)=>{var $;ue.sourceEvent.type==="touchmove"&&ue.sourceEvent.touches.length>1||(Z=!1,a.value===0&&W(ue,_e),L=E(ue.sourceEvent),O=(($=t.value)==null?void 0:$.getBoundingClientRect())||null,F=yt(ue.sourceEvent,O))},ne=(ue,_e)=>{const $=E(ue.sourceEvent);if(!D&&U&&u.value&&(D=!0,B()),!U){const I=$.xSnapped-(L.x??0),V=$.ySnapped-(L.y??0);Math.sqrt(I*I+V*V)>a.value&&W(ue,_e)}(L.x!==$.xSnapped||L.y!==$.ySnapped)&&A.length&&U&&(G=ue.sourceEvent,F=yt(ue.sourceEvent,O),R($))},se=ue=>{let _e=!1;if(!U&&!m.value&&!p.value){const $=ue.sourceEvent,I=E($),V=I.xSnapped-(L.x??0),Y=I.ySnapped-(L.y??0),q=Math.sqrt(V*V+Y*Y);q!==0&&q<=a.value&&(H?.($),_e=!0)}if(A.length&&!_e){Z&&(g(A,!1,!1),Z=!1);const[$,I]=Ur({id:C,dragItems:A,findNode:f});z({event:ue.sourceEvent,node:$,nodes:I})}A=[],m.value=!1,D=!1,U=!1,L={x:void 0,y:void 0},cancelAnimationFrame(te)};return Ee([()=>Ce(P),K],([ue,_e],$,I)=>{if(_e){const V=st(_e);ue||(k=Xy().on("start",Y=>Q(Y,_e)).on("drag",Y=>ne(Y,_e)).on("end",Y=>se(Y)).filter(Y=>{const q=Y.target,le=Ce(N);return!Y.button&&(!r.value||!ba(q,`.${r.value}`,_e)&&(!le||ba(q,le,_e)))}),V.call(k)),I(()=>{V.on(".drag",null),k&&(k.on("start",null),k.on("drag",null),k.on("end",null))})}}),m}function kw(){return{doubleClick:ae(),click:ae(),mouseEnter:ae(),mouseMove:ae(),mouseLeave:ae(),contextMenu:ae(),updateStart:ae(),update:ae(),updateEnd:ae()}}function Sw(e,t){const n=kw();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 Cw(){const{viewport:e,snapGrid:t,snapToGrid:n,vueFlowRef:o}=Me();return r=>{var i;const s=((i=o.value)==null?void 0:i.getBoundingClientRect())??{left:0,top:0},a=dw(r)?r.sourceEvent:r,{x:l,y:u}=yt(a,s),c=no({x:l,y:u},e.value),{x:d,y:h}=n.value?Sr(c,t.value):c;return{xSnapped:d,ySnapped:h,...c}}}function xo(){return!0}function Yu({handleId:e,nodeId:t,type:n,isValidConnection:o,edgeUpdaterType:r,onEdgeUpdate:i,onEdgeUpdateEnd:s}){const{id:a,vueFlowRef:l,connectionMode:u,connectionRadius:c,connectOnClick:d,connectionClickStartHandle:h,nodesConnectable:f,autoPanOnConnect:p,autoPanSpeed:v,findNode:_,panBy:y,startConnection:b,updateConnection:g,endConnection:w,emits:T,viewport:M,edges:z,nodes:H,isValidConnection:K,nodeLookup:P}=Me();let C=null,x=!1,N=null;function m(k){var O;const L=Ce(n)==="target",F=as(k),G=fa(k.target),U=k.currentTarget;if(U&&(F&&k.button===0||!F)){let Z=function(he){$=yt(he,se),R=mw(no($,M.value,!1,[1,1]),c.value,P.value,Y),I||(V(),I=!0);const we=ka(he,{handle:R,connectionMode:u.value,fromNodeId:Ce(t),fromHandleId:Ce(e),fromType:L?"target":"source",isValidConnection:E,doc:G,lib:"vue",flowId:a,nodeLookup:P.value},z.value,H.value,_,P.value);N=we.handleDomNode,C=we.connection,x=yw(!!R,we.isValid);const Se={...me,isValid:x,to:we.toHandle&&x?to({x:we.toHandle.x,y:we.toHandle.y},M.value):$,toHandle:we.toHandle,toPosition:x&&we.toHandle?we.toHandle.position:Ni[Y.position],toNode:we.toHandle?P.value.get(we.toHandle.nodeId):null};if(x&&R&&me?.toHandle&&Se.toHandle&&me.toHandle.type===Se.toHandle.type&&me.toHandle.nodeId===Se.toHandle.nodeId&&me.toHandle.id===Se.toHandle.id&&me.to.x===Se.to.x&&me.to.y===Se.to.y)return;const Ne=R??we.toHandle;if(g(Ne&&x?to({x:Ne.x,y:Ne.y},M.value):$,Ne,vw(!!Ne,x)),me=Se,!R&&!x&&!N)return Wr(_e);C&&C.source!==C.target&&N&&(Wr(_e),_e=N,N.classList.add("connecting","vue-flow__handle-connecting"),N.classList.toggle("valid",!!x),N.classList.toggle("vue-flow__handle-valid",!!x))},te=function(he){"touches"in he&&he.touches.length>0||((R||N)&&C&&x&&(i?i(he,C):T.connect(C)),T.connectEnd(he),r&&s?.(he),Wr(_e),cancelAnimationFrame(B),w(he),I=!1,x=!1,C=null,N=null,G.removeEventListener("mousemove",Z),G.removeEventListener("mouseup",te),G.removeEventListener("touchmove",Z),G.removeEventListener("touchend",te))};const D=_(Ce(t));let E=Ce(o)||K.value||xo;!E&&D&&(E=(L?D.isValidSourcePos:D.isValidTargetPos)||xo);let R,B=0;const{x:W,y:Q}=yt(k),ne=Hu(Ce(r),U),se=(O=l.value)==null?void 0:O.getBoundingClientRect();if(!se||!ne)return;const ue=Gu(Ce(t),ne,Ce(e),P.value,u.value);if(!ue)return;let _e,$=yt(k,se),I=!1;const V=()=>{if(!p.value)return;const[he,we]=Vu($,se,v.value);y({x:he,y:we}),B=requestAnimationFrame(V)},Y={...ue,nodeId:Ce(t),type:ne,position:ue.position},q=P.value.get(Ce(t)),ce={inProgress:!0,isValid:null,from:kn(q,Y,de.Left,!0),fromHandle:Y,fromPosition:Y.position,fromNode:q,to:$,toHandle:null,toPosition:Ni[Y.position],toNode:null};b({nodeId:Ce(t),id:Ce(e),type:ne,position:U?.getAttribute("data-handlepos")||de.Top,...$},{x:W-se.left,y:Q-se.top}),T.connectStart({event:k,nodeId:Ce(t),handleId:Ce(e),handleType:ne});let me=ce;G.addEventListener("mousemove",Z),G.addEventListener("mouseup",te),G.addEventListener("touchmove",Z),G.addEventListener("touchend",te)}}function A(k){var O,L;if(!d.value)return;const F=Ce(n)==="target";if(!h.value){T.clickConnectStart({event:k,nodeId:Ce(t),handleId:Ce(e)}),b({nodeId:Ce(t),type:Ce(n),id:Ce(e),position:de.Top,...yt(k)},void 0,!0);return}let G=Ce(o)||K.value||xo;const U=_(Ce(t));if(!G&&U&&(G=(F?U.isValidSourcePos:U.isValidTargetPos)||xo),U&&(typeof U.connectable>"u"?f.value:U.connectable)===!1)return;const Z=fa(k.target),te=ka(k,{handle:{nodeId:Ce(t),id:Ce(e),type:Ce(n),position:de.Top,...yt(k)},connectionMode:u.value,fromNodeId:h.value.nodeId,fromHandleId:h.value.id??null,fromType:h.value.type,isValidConnection:G,doc:Z,lib:"vue",flowId:a,nodeLookup:P.value},z.value,H.value,_,P.value),D=((O=te.connection)==null?void 0:O.source)===((L=te.connection)==null?void 0:L.target);te.isValid&&te.connection&&!D&&T.connect(te.connection),T.clickConnectEnd(k),w(k,!0)}return{handlePointerDown:m,handleClick:A}}function Nw(){return Cn(qu,"")}function Xu(e){const t=e??Nw()??"",n=Cn(Uu,fe(null)),{findNode:o,edges:r,emits:i}=Me(),s=o(t);return s||i.error(new Ge(ze.NODE_NOT_FOUND,t)),{id:t,nodeEl:n,node:s,parentNode:oe(()=>o(s.parentNode)),connectedEdges:oe(()=>Bu([s],r.value))}}function Tw(){return{doubleClick:ae(),click:ae(),mouseEnter:ae(),mouseMove:ae(),mouseLeave:ae(),contextMenu:ae(),dragStart:ae(),drag:ae(),dragStop:ae()}}function Pw(e,t){const n=Tw();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 Ku(){const{getSelectedNodes:e,nodeExtent:t,updateNodePositions:n,findNode:o,snapGrid:r,snapToGrid:i,nodesDraggable:s,emits:a}=Me();return(l,u=!1)=>{const c=i.value?r.value[0]:5,d=i.value?r.value[1]:5,h=u?4:1,f=l.x*c*h,p=l.y*d*h,v=[];for(const _ of e.value)if(_.draggable||s&&typeof _.draggable>"u"){const y={x:_.computedPosition.x+f,y:_.computedPosition.y+p},{position:b}=ss(_,y,a.error,t.value,_.parentNode?o(_.parentNode):void 0);v.push({id:_.id,position:b,from:_.position,distance:{x:l.x,y:l.y},dimensions:_.dimensions})}n(v,!0,!1)}}const Eo=.1,Aw=e=>((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2;function Lt(){return uo("Viewport not initialized yet."),Promise.resolve(!1)}const Iw={zoomIn:Lt,zoomOut:Lt,zoomTo:Lt,fitView:Lt,setCenter:Lt,fitBounds:Lt,project:e=>e,screenToFlowCoordinate:e=>e,flowToScreenCoordinate:e=>e,setViewport:Lt,setTransform:Lt,getViewport:()=>({x:0,y:0,zoom:1}),getTransform:()=>({x:0,y:0,zoom:1}),viewportInitialized:!1};function Ow(e){function t(o,r){return new Promise(i=>{e.d3Selection&&e.d3Zoom?e.d3Zoom.interpolate(r?.interpolate==="linear"?Hn:Ao).scaleBy(Kr(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:u,y:c}=Iu({x:-o,y:-r},e.translateExtent),d=En.translate(-u,-c).scale(i);e.d3Selection&&e.d3Zoom?(l=e.d3Zoom)==null||l.interpolate(s?.interpolate==="linear"?Hn:Ao).transform(Kr(e.d3Selection,s?.duration,s?.ease,()=>{a(!0)}),d):a(!1)})}return oe(()=>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:Ao).scaleTo(Kr(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:Eo,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=Du(a),{x:u,y:c,zoom:d}=ha(l,e.dimensions.width,e.dimensions.height,r.minZoom??e.minZoom,r.maxZoom??e.maxZoom,r.padding??Eo);return n(u,c,d,r)},setCenter:(r,i,s)=>{const a=typeof s?.zoom<"u"?s.zoom:e.maxZoom,l=e.dimensions.width/2-r*a,u=e.dimensions.height/2-i*a;return n(l,u,a,s)},fitBounds:(r,i={padding:Eo})=>{const{x:s,y:a,zoom:l}=ha(r,e.dimensions.width,e.dimensions.height,e.minZoom,e.maxZoom,i.padding??Eo);return n(s,a,l,i)},project:r=>no(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 no(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 to(a,e.viewport)}return{x:0,y:0}}}:Iw)}function Kr(e,t=0,n=Aw,o=()=>{}){const r=typeof t=="number"&&t>0;return r||o(),r?e.transition().duration(t).ease(n).on("end",o):e}function Rw(e,t,n){const o=Ya(!0);return o.run(()=>{const r=()=>{o.run(()=>{let v,_,y=!!(n.nodes.value.length||n.edges.value.length);v=rn([e.modelValue,()=>{var b,g;return(g=(b=e.modelValue)==null?void 0:b.value)==null?void 0:g.length}],([b])=>{b&&Array.isArray(b)&&(_?.pause(),n.setElements(b),!_&&!y&&b.length?y=!0:_?.resume())}),_=rn([n.nodes,n.edges,()=>n.edges.value.length,()=>n.nodes.value.length],([b,g])=>{var w;(w=e.modelValue)!=null&&w.value&&Array.isArray(e.modelValue.value)&&(v?.pause(),e.modelValue.value=[...b,...g],At(()=>{v?.resume()}))},{immediate:y}),zn(()=>{v?.stop(),_?.stop()})})},i=()=>{o.run(()=>{let v,_,y=!!n.nodes.value.length;v=rn([e.nodes,()=>{var b,g;return(g=(b=e.nodes)==null?void 0:b.value)==null?void 0:g.length}],([b])=>{b&&Array.isArray(b)&&(_?.pause(),n.setNodes(b),!_&&!y&&b.length?y=!0:_?.resume())}),_=rn([n.nodes,()=>n.nodes.value.length],([b])=>{var g;(g=e.nodes)!=null&&g.value&&Array.isArray(e.nodes.value)&&(v?.pause(),e.nodes.value=[...b],At(()=>{v?.resume()}))},{immediate:y}),zn(()=>{v?.stop(),_?.stop()})})},s=()=>{o.run(()=>{let v,_,y=!!n.edges.value.length;v=rn([e.edges,()=>{var b,g;return(g=(b=e.edges)==null?void 0:b.value)==null?void 0:g.length}],([b])=>{b&&Array.isArray(b)&&(_?.pause(),n.setEdges(b),!_&&!y&&b.length?y=!0:_?.resume())}),_=rn([n.edges,()=>n.edges.value.length],([b])=>{var g;(g=e.edges)!=null&&g.value&&Array.isArray(e.edges.value)&&(v?.pause(),e.edges.value=[...b],At(()=>{v?.resume()}))},{immediate:y}),zn(()=>{v?.stop(),_?.stop()})})},a=()=>{o.run(()=>{Ee(()=>t.maxZoom,()=>{t.maxZoom&&$e(t.maxZoom)&&n.setMaxZoom(t.maxZoom)},{immediate:!0})})},l=()=>{o.run(()=>{Ee(()=>t.minZoom,()=>{t.minZoom&&$e(t.minZoom)&&n.setMinZoom(t.minZoom)},{immediate:!0})})},u=()=>{o.run(()=>{Ee(()=>t.translateExtent,()=>{t.translateExtent&&$e(t.translateExtent)&&n.setTranslateExtent(t.translateExtent)},{immediate:!0})})},c=()=>{o.run(()=>{Ee(()=>t.nodeExtent,()=>{t.nodeExtent&&$e(t.nodeExtent)&&n.setNodeExtent(t.nodeExtent)},{immediate:!0})})},d=()=>{o.run(()=>{Ee(()=>t.applyDefault,()=>{$e(t.applyDefault)&&(n.applyDefault.value=t.applyDefault)},{immediate:!0})})},h=()=>{o.run(()=>{const v=async _=>{let y=_;typeof t.autoConnect=="function"&&(y=await t.autoConnect(_)),y!==!1&&n.addEdges([y])};Ee(()=>t.autoConnect,()=>{$e(t.autoConnect)&&(n.autoConnect.value=t.autoConnect)},{immediate:!0}),Ee(n.autoConnect,(_,y,b)=>{_?n.onConnect(v):n.hooks.value.connect.off(v),b(()=>{n.hooks.value.connect.off(v)})},{immediate:!0})})},f=()=>{const v=["id","modelValue","translateExtent","nodeExtent","edges","nodes","maxZoom","minZoom","applyDefault","autoConnect"];for(const _ of Object.keys(t)){const y=_;if(!v.includes(y)){const b=Ie(()=>t[y]),g=n[y];Ii(g)&&o.run(()=>{Ee(b,w=>{$e(w)&&(g.value=w)},{immediate:!0})})}}};r(),i(),s(),l(),a(),u(),c(),d(),h(),f()}),()=>o.stop()}function Mw(){return{edgesChange:ae(),nodesChange:ae(),nodeDoubleClick:ae(),nodeClick:ae(),nodeMouseEnter:ae(),nodeMouseMove:ae(),nodeMouseLeave:ae(),nodeContextMenu:ae(),nodeDragStart:ae(),nodeDrag:ae(),nodeDragStop:ae(),nodesInitialized:ae(),miniMapNodeClick:ae(),miniMapNodeDoubleClick:ae(),miniMapNodeMouseEnter:ae(),miniMapNodeMouseMove:ae(),miniMapNodeMouseLeave:ae(),connect:ae(),connectStart:ae(),connectEnd:ae(),clickConnectStart:ae(),clickConnectEnd:ae(),paneReady:ae(),init:ae(),move:ae(),moveStart:ae(),moveEnd:ae(),selectionDragStart:ae(),selectionDrag:ae(),selectionDragStop:ae(),selectionContextMenu:ae(),selectionStart:ae(),selectionEnd:ae(),viewportChangeStart:ae(),viewportChange:ae(),viewportChangeEnd:ae(),paneScroll:ae(),paneClick:ae(),paneContextMenu:ae(),paneMouseEnter:ae(),paneMouseMove:ae(),paneMouseLeave:ae(),edgeContextMenu:ae(),edgeMouseEnter:ae(),edgeMouseMove:ae(),edgeMouseLeave:ae(),edgeDoubleClick:ae(),edgeClick:ae(),edgeUpdateStart:ae(),edgeUpdate:ae(),edgeUpdateEnd:ae(),updateNodeInternals:ae(),error:ae(e=>uo(e.message))}}function Lw(e,t){const n=Nn();Ec(()=>{for(const[r,i]of Object.entries(t.value)){const s=a=>{e(r,a)};i.setEmitter(s),Kn(i.removeEmitter),i.setHasEmitListeners(()=>o(r)),Kn(i.removeHasEmitListeners)}});function o(r){var i;const s=Dw(r);return!!((i=n?.vnode.props)==null?void 0:i[s])}}function Dw(e){const[t,...n]=e.split(":");return`on${t.replace(/(?:^|-)(\w)/g,(r,i)=>i.toUpperCase())}${n.length?`:${n.join(":")}`:""}`}function Zu(){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:is.Full,paneDragging:!1,preventScrolling:!0,zoomOnScroll:!0,zoomOnPinch:!0,zoomOnDoubleClick:!0,panOnScroll:!1,panOnScrollSpeed:.5,panOnScrollMode:Gn.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:qt.Bezier,style:{}},connectionMode:Ht.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:sr()?"Meta":"Control",zoomActivationKeyCode:sr()?"Meta":"Control",deleteKeyCode:"Backspace",panActivationKeyCode:"Space",hooks:Mw(),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 $w=["id","vueFlowRef","viewportRef","initialized","modelValue","nodes","edges","maxZoom","minZoom","translateExtent","hooks","defaultEdgeOptions"];function Bw(e,t,n){const o=Ow(e),r=$=>{const I=$??[];e.hooks.updateNodeInternals.trigger(I)},i=$=>J0($,e.nodes,e.edges),s=$=>Z0($,e.nodes,e.edges),a=$=>Bu($,e.edges),l=({id:$,type:I,nodeId:V})=>{var Y;const q=$?`-${I}-${$}`:`-${I}`;return Array.from(((Y=e.connectionLookup.get(`${V}${q}`))==null?void 0:Y.values())??[])},u=$=>{if($)return t.value.get($)},c=$=>{if($)return n.value.get($)},d=($,I,V)=>{var Y,q;const le=[];for(const ce of $){const me={id:ce.id,type:"position",dragging:V,from:ce.from};if(I&&(me.position=ce.position,ce.parentNode)){const he=u(ce.parentNode);me.position={x:me.position.x-(((Y=he?.computedPosition)==null?void 0:Y.x)??0),y:me.position.y-(((q=he?.computedPosition)==null?void 0:q.y)??0)}}le.push(me)}le?.length&&e.hooks.nodesChange.trigger(le)},h=$=>{if(!e.vueFlowRef)return;const I=e.vueFlowRef.querySelector(".vue-flow__transformationpane");if(!I)return;const V=window.getComputedStyle(I),{m22:Y}=new window.DOMMatrixReadOnly(V.transform),q=[];for(const le of $){const ce=le,me=u(ce.id);if(me){const he=kr(ce.nodeElement);if(!!(he.width&&he.height&&(me.dimensions.width!==he.width||me.dimensions.height!==he.height||ce.forceUpdate))){const Se=ce.nodeElement.getBoundingClientRect();me.dimensions=he,me.handleBounds.source=Sa("source",ce.nodeElement,Se,Y,me.id),me.handleBounds.target=Sa("target",ce.nodeElement,Se,Y,me.id),q.push({id:me.id,type:"dimensions",dimensions:he})}}}!e.fitViewOnInitDone&&e.fitViewOnInit&&o.value.fitView().then(()=>{e.fitViewOnInitDone=!0}),q.length&&e.hooks.nodesChange.trigger(q)},f=($,I)=>{const V=new Set,Y=new Set;for(const ce of $)Kt(ce)?V.add(ce.id):Gt(ce)&&Y.add(ce.id);const q=$t(t.value,V,!0),le=$t(n.value,Y);if(e.multiSelectionActive){for(const ce of V)q.push(Dt(ce,I));for(const ce of Y)le.push(Dt(ce,I))}q.length&&e.hooks.nodesChange.trigger(q),le.length&&e.hooks.edgesChange.trigger(le)},p=$=>{if(e.multiSelectionActive){const I=$.map(V=>Dt(V.id,!0));e.hooks.nodesChange.trigger(I);return}e.hooks.nodesChange.trigger($t(t.value,new Set($.map(I=>I.id)),!0)),e.hooks.edgesChange.trigger($t(n.value))},v=$=>{if(e.multiSelectionActive){const I=$.map(V=>Dt(V.id,!0));e.hooks.edgesChange.trigger(I);return}e.hooks.edgesChange.trigger($t(n.value,new Set($.map(I=>I.id)))),e.hooks.nodesChange.trigger($t(t.value,new Set,!0))},_=$=>{f($,!0)},y=$=>{const V=($||e.nodes).map(Y=>(Y.selected=!1,Dt(Y.id,!1)));e.hooks.nodesChange.trigger(V)},b=$=>{const V=($||e.edges).map(Y=>(Y.selected=!1,Dt(Y.id,!1)));e.hooks.edgesChange.trigger(V)},g=$=>{if(!$||!$.length)return f([],!1);const I=$.reduce((V,Y)=>{const q=Dt(Y.id,!1);return Kt(Y)?V.nodes.push(q):V.edges.push(q),V},{nodes:[],edges:[]});I.nodes.length&&e.hooks.nodesChange.trigger(I.nodes),I.edges.length&&e.hooks.edgesChange.trigger(I.edges)},w=$=>{var I;(I=e.d3Zoom)==null||I.scaleExtent([$,e.maxZoom]),e.minZoom=$},T=$=>{var I;(I=e.d3Zoom)==null||I.scaleExtent([e.minZoom,$]),e.maxZoom=$},M=$=>{var I;(I=e.d3Zoom)==null||I.translateExtent($),e.translateExtent=$},z=$=>{e.nodeExtent=$,r()},H=$=>{var I;(I=e.d3Zoom)==null||I.clickDistance($)},K=$=>{e.nodesDraggable=$,e.nodesConnectable=$,e.elementsSelectable=$},P=$=>{const I=$ instanceof Function?$(e.nodes):$;!e.initialized&&!I.length||(e.nodes=Ca(I,u,e.hooks.error.trigger))},C=$=>{const I=$ instanceof Function?$(e.edges):$;if(!e.initialized&&!I.length)return;const V=Xr(I,e.isValidConnection,u,c,e.hooks.error.trigger,e.defaultEdgeOptions,e.nodes,e.edges);Yr(e.connectionLookup,n.value,V),e.edges=V},x=$=>{const I=$ instanceof Function?$([...e.nodes,...e.edges]):$;!e.initialized&&!I.length||(P(I.filter(Kt)),C(I.filter(Gt)))},N=$=>{let I=$ instanceof Function?$(e.nodes):$;I=Array.isArray(I)?I:[I];const V=Ca(I,u,e.hooks.error.trigger),Y=[];for(const q of V)Y.push(va(q));Y.length&&e.hooks.nodesChange.trigger(Y)},m=$=>{let I=$ instanceof Function?$(e.edges):$;I=Array.isArray(I)?I:[I];const V=Xr(I,e.isValidConnection,u,c,e.hooks.error.trigger,e.defaultEdgeOptions,e.nodes,e.edges),Y=[];for(const q of V)Y.push(va(q));Y.length&&e.hooks.edgesChange.trigger(Y)},A=($,I=!0,V=!1)=>{const Y=$ instanceof Function?$(e.nodes):$,q=Array.isArray(Y)?Y:[Y],le=[],ce=[];function me(we){const Se=a(we);for(const Ne of Se)(!$e(Ne.deletable)||Ne.deletable)&&ce.push(_a(Ne.id,Ne.source,Ne.target,Ne.sourceHandle,Ne.targetHandle))}function he(we){const Se=[];for(const Ne of e.nodes)Ne.parentNode===we&&Se.push(Ne);if(Se.length){for(const Ne of Se)le.push(ya(Ne.id));I&&me(Se);for(const Ne of Se)he(Ne.id)}}for(const we of q){const Se=typeof we=="string"?u(we):we;Se&&($e(Se.deletable)&&!Se.deletable||(le.push(ya(Se.id)),I&&me([Se]),V&&he(Se.id)))}ce.length&&e.hooks.edgesChange.trigger(ce),le.length&&e.hooks.nodesChange.trigger(le)},k=$=>{const I=$ instanceof Function?$(e.edges):$,V=Array.isArray(I)?I:[I],Y=[];for(const q of V){const le=typeof q=="string"?c(q):q;le&&($e(le.deletable)&&!le.deletable||Y.push(_a(typeof q=="string"?q:q.id,le.source,le.target,le.sourceHandle,le.targetHandle)))}e.hooks.edgesChange.trigger(Y)},O=($,I,V=!0)=>{const Y=c($.id);if(!Y)return!1;const q=e.edges.indexOf(Y),le=bw($,I,Y,V,e.hooks.error.trigger);if(le){const[ce]=Xr([le],e.isValidConnection,u,c,e.hooks.error.trigger,e.defaultEdgeOptions,e.nodes,e.edges);return e.edges=e.edges.map((me,he)=>he===q?ce:me),Yr(e.connectionLookup,n.value,[ce]),ce}return!1},L=($,I,V={replace:!1})=>{const Y=c($);if(!Y)return;const q=typeof I=="function"?I(Y):I;Y.data=V.replace?q:{...Y.data,...q}},F=$=>ma($,e.nodes),G=$=>{const I=ma($,e.edges);return Yr(e.connectionLookup,n.value,I),I},U=($,I,V={replace:!1})=>{const Y=u($);if(!Y)return;const q=typeof I=="function"?I(Y):I;V.replace?e.nodes.splice(e.nodes.indexOf(Y),1,q):Object.assign(Y,q)},Z=($,I,V={replace:!1})=>{const Y=u($);if(!Y)return;const q=typeof I=="function"?I(Y):I;Y.data=V.replace?q:{...Y.data,...q}},te=($,I,V=!1)=>{V?e.connectionClickStartHandle=$:e.connectionStartHandle=$,e.connectionEndHandle=null,e.connectionStatus=null,I&&(e.connectionPosition=I)},D=($,I=null,V=null)=>{e.connectionStartHandle&&(e.connectionPosition=$,e.connectionEndHandle=I,e.connectionStatus=V)},E=($,I)=>{e.connectionPosition={x:Number.NaN,y:Number.NaN},e.connectionEndHandle=null,e.connectionStatus=null,I?e.connectionClickStartHandle=null:e.connectionStartHandle=null},R=$=>{const I=X0($),V=I?null:Bn($)?$:u($.id);return!I&&!V?[null,null,I]:[I?$:rr(V),V,I]},B=($,I=!0,V=e.nodes)=>{const[Y,q,le]=R($);if(!Y)return[];const ce=[];for(const me of V||e.nodes){if(!le&&(me.id===q.id||!me.computedPosition))continue;const he=rr(me),we=ir(he,Y);(I&&we>0||we>=he.width*he.height||we>=Number(Y.width)*Number(Y.height))&&ce.push(me)}return ce},W=($,I,V=!0)=>{const[Y]=R($);if(!Y)return!1;const q=ir(Y,I);return V&&q>0||q>=Number(Y.width)*Number(Y.height)},Q=$=>{const{viewport:I,dimensions:V,d3Zoom:Y,d3Selection:q,translateExtent:le}=e;if(!Y||!q||!$.x&&!$.y)return!1;const ce=En.translate(I.x+$.x,I.y+$.y).scale(I.zoom),me=[[0,0],[V.width,V.height]],he=Y.constrain()(ce,me,le),we=e.viewport.x!==he.x||e.viewport.y!==he.y||e.viewport.zoom!==he.k;return Y.transform(q,he),we},ne=$=>{const I=$ instanceof Function?$(e):$,V=["d3Zoom","d3Selection","d3ZoomHandler","viewportRef","vueFlowRef","dimensions","hooks"];$e(I.defaultEdgeOptions)&&(e.defaultEdgeOptions=I.defaultEdgeOptions);const Y=I.modelValue||I.nodes||I.edges?[]:void 0;Y&&(I.modelValue&&Y.push(...I.modelValue),I.nodes&&Y.push(...I.nodes),I.edges&&Y.push(...I.edges),x(Y));const q=()=>{$e(I.maxZoom)&&T(I.maxZoom),$e(I.minZoom)&&w(I.minZoom),$e(I.translateExtent)&&M(I.translateExtent)};for(const le of Object.keys(I)){const ce=le,me=I[ce];![...$w,...V].includes(ce)&&$e(me)&&(e[ce]=me)}vi(()=>e.d3Zoom).not.toBeNull().then(q),e.initialized||(e.initialized=!0)};return{updateNodePositions:d,updateNodeDimensions:h,setElements:x,setNodes:P,setEdges:C,addNodes:N,addEdges:m,removeNodes:A,removeEdges:k,findNode:u,findEdge:c,updateEdge:O,updateEdgeData:L,updateNode:U,updateNodeData:Z,applyEdgeChanges:G,applyNodeChanges:F,addSelectedElements:_,addSelectedNodes:p,addSelectedEdges:v,setMinZoom:w,setMaxZoom:T,setTranslateExtent:M,setNodeExtent:z,setPaneClickDistance:H,removeSelectedElements:g,removeSelectedNodes:y,removeSelectedEdges:b,startConnection:te,updateConnection:D,endConnection:E,setInteractive:K,setState:ne,getIntersectingNodes:B,getIncomers:i,getOutgoers:s,getConnectedEdges:a,getHandleConnections:l,isNodeIntersecting:W,panBy:Q,fitView:$=>o.value.fitView($),zoomIn:$=>o.value.zoomIn($),zoomOut:$=>o.value.zoomOut($),zoomTo:($,I)=>o.value.zoomTo($,I),setViewport:($,I)=>o.value.setViewport($,I),setTransform:($,I)=>o.value.setTransform($,I),getViewport:()=>o.value.getViewport(),getTransform:()=>o.value.getTransform(),setCenter:($,I,V)=>o.value.setCenter($,I,V),fitBounds:($,I)=>o.value.fitBounds($,I),project:$=>o.value.project($),screenToFlowCoordinate:$=>o.value.screenToFlowCoordinate($),flowToScreenCoordinate:$=>o.value.flowToScreenCoordinate($),toObject:()=>{const $=[],I=[];for(const V of e.nodes){const{computedPosition:Y,handleBounds:q,selected:le,dimensions:ce,isParent:me,resizing:he,dragging:we,events:Se,...Ne}=V;$.push(Ne)}for(const V of e.edges){const{selected:Y,sourceNode:q,targetNode:le,events:ce,...me}=V;I.push(me)}return JSON.parse(JSON.stringify({nodes:$,edges:I,position:[e.viewport.x,e.viewport.y],zoom:e.viewport.zoom,viewport:e.viewport}))},fromObject:$=>new Promise(I=>{const{nodes:V,edges:Y,position:q,zoom:le,viewport:ce}=$;V&&P(V),Y&&C(Y);const[me,he]=ce?.x&&ce?.y?[ce.x,ce.y]:q??[null,null];if(me&&he){const we=ce?.zoom||le||e.viewport.zoom;return vi(()=>o.value.viewportInitialized).toBe(!0).then(()=>{o.value.setViewport({x:me,y:he,zoom:we}).then(()=>{I(!0)})})}else I(!0)}),updateNodeInternals:r,viewportHelper:o,$reset:()=>{const $=Zu();if(e.edges=[],e.nodes=[],e.d3Zoom&&e.d3Selection){const I=En.translate($.defaultViewport.x??0,$.defaultViewport.y??0).scale(en($.defaultViewport.zoom??1,$.minZoom,$.maxZoom)),V=e.viewportRef.getBoundingClientRect(),Y=[[0,0],[V.width,V.height]],q=e.d3Zoom.constrain()(I,Y,$.translateExtent);e.d3Zoom.transform(e.d3Selection,q)}ne($)},$destroy:()=>{}}}const zw=["data-id","data-handleid","data-nodeid","data-handlepos"],Vw={name:"Handle",compatConfig:{MODE:3}},Sn=ye({...Vw,props:{id:{default:null},type:{},position:{default:()=>de.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=Nc(e,["position","connectable","connectableStart","connectableEnd","id"]),o=Ie(()=>n.type??"source"),r=Ie(()=>n.isValidConnection??null),{id:i,connectionStartHandle:s,connectionClickStartHandle:a,connectionEndHandle:l,vueFlowRef:u,nodesConnectable:c,noDragClassName:d,noPanClassName:h}=Me(),{id:f,node:p,nodeEl:v,connectedEdges:_}=Xu(),y=fe(),b=Ie(()=>typeof e.connectableStart<"u"?e.connectableStart:!0),g=Ie(()=>typeof e.connectableEnd<"u"?e.connectableEnd:!0),w=Ie(()=>{var C,x,N,m,A,k;return((C=s.value)==null?void 0:C.nodeId)===f&&((x=s.value)==null?void 0:x.id)===e.id&&((N=s.value)==null?void 0:N.type)===o.value||((m=l.value)==null?void 0:m.nodeId)===f&&((A=l.value)==null?void 0:A.id)===e.id&&((k=l.value)==null?void 0:k.type)===o.value}),T=Ie(()=>{var C,x,N;return((C=a.value)==null?void 0:C.nodeId)===f&&((x=a.value)==null?void 0:x.id)===e.id&&((N=a.value)==null?void 0:N.type)===o.value}),{handlePointerDown:M,handleClick:z}=Yu({nodeId:f,handleId:e.id,isValidConnection:r,type:o}),H=oe(()=>typeof e.connectable=="string"&&e.connectable==="single"?!_.value.some(C=>{const x=C[`${o.value}Handle`];return C[o.value]!==f?!1:x?x===e.id:!0}):typeof e.connectable=="number"?_.value.filter(C=>{const x=C[`${o.value}Handle`];return C[o.value]!==f?!1:x?x===e.id:!0}).length<e.connectable:typeof e.connectable=="function"?e.connectable(p,_.value):$e(e.connectable)?e.connectable:c.value);it(()=>{var C;if(!p.dimensions.width||!p.dimensions.height)return;const x=(C=p.handleBounds[o.value])==null?void 0:C.find(F=>F.id===e.id);if(!u.value||x)return;const N=u.value.querySelector(".vue-flow__transformationpane");if(!v.value||!y.value||!N||!e.id)return;const m=v.value.getBoundingClientRect(),A=y.value.getBoundingClientRect(),k=window.getComputedStyle(N),{m22:O}=new window.DOMMatrixReadOnly(k.transform),L={id:e.id,position:e.position,x:(A.left-m.left)/O,y:(A.top-m.top)/O,type:o.value,nodeId:f,...kr(y.value)};p.handleBounds[o.value]=[...p.handleBounds[o.value]??[],L]});function K(C){const x=as(C);H.value&&b.value&&(x&&C.button===0||!x)&&M(C)}function P(C){!f||!a.value&&!b.value||H.value&&z(C)}return t({handleClick:z,handlePointerDown:M,onClick:P,onPointerDown:K}),(C,x)=>(j(),ee("div",{ref_key:"handle",ref:y,"data-id":`${S(i)}-${S(f)}-${e.id}-${o.value}`,"data-handleid":e.id,"data-nodeid":S(f),"data-handlepos":C.position,class:He(["vue-flow__handle",[`vue-flow__handle-${C.position}`,`vue-flow__handle-${e.id}`,S(d),S(h),o.value,{connectable:H.value,connecting:T.value,connectablestart:b.value,connectableend:g.value,connectionindicator:H.value&&(b.value&&!w.value||g.value&&w.value)}]]),onMousedown:K,onTouchstartPassive:K,onClick:P},[ke(C.$slots,"default",{id:C.id})],42,zw))}}),Nr=function({sourcePosition:e=de.Bottom,targetPosition:t=de.Top,label:n,connectable:o=!0,isValidTargetPos:r,isValidSourcePos:i,data:s}){const a=s.label??n;return[Pe(Sn,{type:"target",position:t,connectable:o,isValidConnection:r}),typeof a!="string"&&a?Pe(a):Pe(Oe,[a]),Pe(Sn,{type:"source",position:e,connectable:o,isValidConnection:i})]};Nr.props=["sourcePosition","targetPosition","label","isValidTargetPos","isValidSourcePos","connectable","data"];Nr.inheritAttrs=!1;Nr.compatConfig={MODE:3};const Fw=Nr,Tr=function({targetPosition:e=de.Top,label:t,connectable:n=!0,isValidTargetPos:o,data:r}){const i=r.label??t;return[Pe(Sn,{type:"target",position:e,connectable:n,isValidConnection:o}),typeof i!="string"&&i?Pe(i):Pe(Oe,[i])]};Tr.props=["targetPosition","label","isValidTargetPos","connectable","data"];Tr.inheritAttrs=!1;Tr.compatConfig={MODE:3};const Hw=Tr,Pr=function({sourcePosition:e=de.Bottom,label:t,connectable:n=!0,isValidSourcePos:o,data:r}){const i=r.label??t;return[typeof i!="string"&&i?Pe(i):Pe(Oe,[i]),Pe(Sn,{type:"source",position:e,connectable:n,isValidConnection:o})]};Pr.props=["sourcePosition","label","isValidSourcePos","connectable","data"];Pr.inheritAttrs=!1;Pr.compatConfig={MODE:3};const Gw=Pr,jw=["transform"],qw=["width","height","x","y","rx","ry"],Uw=["y"],Ww={name:"EdgeText",compatConfig:{MODE:3}},Yw=ye({...Ww,props:{x:{},y:{},label:{},labelStyle:{default:()=>({})},labelShowBg:{type:Boolean,default:!0},labelBgStyle:{default:()=>({})},labelBgPadding:{default:()=>[2,4]},labelBgBorderRadius:{default:2}},setup(e){const t=fe({x:0,y:0,width:0,height:0}),n=fe(null),o=oe(()=>`translate(${e.x-t.value.width/2} ${e.y-t.value.height/2})`);it(r),Ee([()=>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:Xe(i.labelBgStyle),rx:i.labelBgBorderRadius,ry:i.labelBgBorderRadius},null,12,qw)):ve("",!0),X("text",tt(i.$attrs,{ref_key:"el",ref:n,class:"vue-flow__edge-text",y:t.value.height/2,dy:"0.3em",style:i.labelStyle}),[ke(i.$slots,"default",{},()=>[typeof i.label!="string"?(j(),be(ot(i.label),{key:0})):(j(),ee(Oe,{key:1},[Te(ge(i.label),1)],64))])],16,Uw)],8,jw))}}),Xw=["id","d","marker-end","marker-start"],Kw=["d","stroke-width"],Zw={name:"BaseEdge",inheritAttrs:!1,compatConfig:{MODE:3}},Ar=ye({...Zw,props:{id:{},labelX:{},labelY:{},path:{},label:{},markerStart:{},markerEnd:{},interactionWidth:{default:20},labelStyle:{},labelShowBg:{type:Boolean},labelBgStyle:{},labelBgPadding:{},labelBgBorderRadius:{}},setup(e,{expose:t}){const n=fe(null),o=fe(null),r=fe(null),i=Tc();return t({pathEl:n,interactionEl:o,labelEl:r}),(s,a)=>(j(),ee(Oe,null,[X("path",tt(S(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,Xw),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,Kw)):ve("",!0),s.label&&s.labelX&&s.labelY?(j(),be(Yw,{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"])):ve("",!0)],64))}});function Ju({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 Qu({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,u=t*.125+i*.375+a*.375+o*.125,c=Math.abs(l-e),d=Math.abs(u-t);return[l,u,c,d]}function ko(e,t){return e>=0?.5*e:t*25*Math.sqrt(-e)}function Aa({pos:e,x1:t,y1:n,x2:o,y2:r,c:i}){let s,a;switch(e){case de.Left:s=t-ko(t-o,i),a=n;break;case de.Right:s=t+ko(o-t,i),a=n;break;case de.Top:s=t,a=n-ko(n-r,i);break;case de.Bottom:s=t,a=n+ko(r-n,i);break}return[s,a]}function ec(e){const{sourceX:t,sourceY:n,sourcePosition:o=de.Bottom,targetX:r,targetY:i,targetPosition:s=de.Top,curvature:a=.25}=e,[l,u]=Aa({pos:o,x1:t,y1:n,x2:r,y2:i,c:a}),[c,d]=Aa({pos:s,x1:r,y1:i,x2:t,y2:n,c:a}),[h,f,p,v]=Qu({sourceX:t,sourceY:n,targetX:r,targetY:i,sourceControlX:l,sourceControlY:u,targetControlX:c,targetControlY:d});return[`M${t},${n} C${l},${u} ${c},${d} ${r},${i}`,h,f,p,v]}function Ia({pos:e,x1:t,y1:n,x2:o,y2:r}){let i,s;switch(e){case de.Left:case de.Right:i=.5*(t+o),s=n;break;case de.Top:case de.Bottom:i=t,s=.5*(n+r);break}return[i,s]}function tc(e){const{sourceX:t,sourceY:n,sourcePosition:o=de.Bottom,targetX:r,targetY:i,targetPosition:s=de.Top}=e,[a,l]=Ia({pos:o,x1:t,y1:n,x2:r,y2:i}),[u,c]=Ia({pos:s,x1:r,y1:i,x2:t,y2:n}),[d,h,f,p]=Qu({sourceX:t,sourceY:n,targetX:r,targetY:i,sourceControlX:a,sourceControlY:l,targetControlX:u,targetControlY:c});return[`M${t},${n} C${a},${l} ${u},${c} ${r},${i}`,d,h,f,p]}const Oa={[de.Left]:{x:-1,y:0},[de.Right]:{x:1,y:0},[de.Top]:{x:0,y:-1},[de.Bottom]:{x:0,y:1}};function Jw({source:e,sourcePosition:t=de.Bottom,target:n}){return t===de.Left||t===de.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 Ra(e,t){return Math.sqrt((t.x-e.x)**2+(t.y-e.y)**2)}function Qw({source:e,sourcePosition:t=de.Bottom,target:n,targetPosition:o=de.Top,center:r,offset:i}){const s=Oa[t],a=Oa[o],l={x:e.x+s.x*i,y:e.y+s.y*i},u={x:n.x+a.x*i,y:n.y+a.y*i},c=Jw({source:l,sourcePosition:t,target:u}),d=c.x!==0?"x":"y",h=c[d];let f,p,v;const _={x:0,y:0},y={x:0,y:0},[b,g,w,T]=Ju({sourceX:e.x,sourceY:e.y,targetX:n.x,targetY:n.y});if(s[d]*a[d]===-1){p=r.x??b,v=r.y??g;const z=[{x:p,y:l.y},{x:p,y:u.y}],H=[{x:l.x,y:v},{x:u.x,y:v}];s[d]===h?f=d==="x"?z:H:f=d==="x"?H:z}else{const z=[{x:l.x,y:u.y}],H=[{x:u.x,y:l.y}];if(d==="x"?f=s.x===h?H:z:f=s.y===h?z:H,t===o){const N=Math.abs(e[d]-n[d]);if(N<=i){const m=Math.min(i-1,i-N);s[d]===h?_[d]=(l[d]>e[d]?-1:1)*m:y[d]=(u[d]>n[d]?-1:1)*m}}if(t!==o){const N=d==="x"?"y":"x",m=s[d]===a[N],A=l[N]>u[N],k=l[N]<u[N];(s[d]===1&&(!m&&A||m&&k)||s[d]!==1&&(!m&&k||m&&A))&&(f=d==="x"?z:H)}const K={x:l.x+_.x,y:l.y+_.y},P={x:u.x+y.x,y:u.y+y.y},C=Math.max(Math.abs(K.x-f[0].x),Math.abs(P.x-f[0].x)),x=Math.max(Math.abs(K.y-f[0].y),Math.abs(P.y-f[0].y));C>=x?(p=(K.x+P.x)/2,v=f[0].y):(p=f[0].x,v=(K.y+P.y)/2)}return[[e,{x:l.x+_.x,y:l.y+_.y},...f,{x:u.x+y.x,y:u.y+y.y},n],p,v,w,T]}function eb(e,t,n,o){const r=Math.min(Ra(e,t)/2,Ra(t,n)/2,o),{x:i,y:s}=t;if(e.x===i&&i===n.x||e.y===s&&s===n.y)return`L${i} ${s}`;if(e.y===s){const u=e.x<n.x?-1:1,c=e.y<n.y?1:-1;return`L ${i+r*u},${s}Q ${i},${s} ${i},${s+r*c}`}const 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 Pi(e){const{sourceX:t,sourceY:n,sourcePosition:o=de.Bottom,targetX:r,targetY:i,targetPosition:s=de.Top,borderRadius:a=5,centerX:l,centerY:u,offset:c=20}=e,[d,h,f,p,v]=Qw({source:{x:t,y:n},sourcePosition:o,target:{x:r,y:i},targetPosition:s,center:{x:l,y:u},offset:c});return[d.reduce((y,b,g)=>{let w;return g>0&&g<d.length-1?w=eb(d[g-1],b,d[g+1],a):w=`${g===0?"M":"L"}${b.x} ${b.y}`,y+=w,y},""),h,f,p,v]}function tb(e){const{sourceX:t,sourceY:n,targetX:o,targetY:r}=e,[i,s,a,l]=Ju({sourceX:t,sourceY:n,targetX:o,targetY:r});return[`M ${t},${n}L ${o},${r}`,i,s,a,l]}const nb=ye({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]=tb(e);return Pe(Ar,{path:n,labelX:o,labelY:r,...t,...e})}}}),ob=nb,rb=ye({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]=Pi({...e,sourcePosition:e.sourcePosition??de.Bottom,targetPosition:e.targetPosition??de.Top});return Pe(Ar,{path:n,labelX:o,labelY:r,...t,...e})}}}),nc=rb,ib=ye({name:"StepEdge",props:["sourcePosition","targetPosition","label","labelStyle","labelShowBg","labelBgStyle","labelBgPadding","labelBgBorderRadius","sourceY","sourceX","targetX","targetY","markerEnd","markerStart","interactionWidth"],setup(e,{attrs:t}){return()=>Pe(nc,{...e,...t,borderRadius:0})}}),sb=ib,ab=ye({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]=ec({...e,sourcePosition:e.sourcePosition??de.Bottom,targetPosition:e.targetPosition??de.Top});return Pe(Ar,{path:n,labelX:o,labelY:r,...t,...e})}}}),lb=ab,ub=ye({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]=tc({...e,sourcePosition:e.sourcePosition??de.Bottom,targetPosition:e.targetPosition??de.Top});return Pe(Ar,{path:n,labelX:o,labelY:r,...t,...e})}}}),cb=ub,db={input:Gw,default:Fw,output:Hw},fb={default:lb,straight:ob,step:sb,smoothstep:nc,simplebezier:cb};function hb(e,t,n){const o=oe(()=>v=>t.value.get(v)),r=oe(()=>v=>n.value.get(v)),i=oe(()=>{const v={...fb,...e.edgeTypes},_=Object.keys(v);for(const y of e.edges)y.type&&!_.includes(y.type)&&(v[y.type]=y.type);return v}),s=oe(()=>{const v={...db,...e.nodeTypes},_=Object.keys(v);for(const y of e.nodes)y.type&&!_.includes(y.type)&&(v[y.type]=y.type);return v}),a=oe(()=>e.onlyRenderVisibleElements?$u(e.nodes,{x:0,y:0,width:e.dimensions.width,height:e.dimensions.height},e.viewport,!0):e.nodes),l=oe(()=>{if(e.onlyRenderVisibleElements){const v=[];for(const _ of e.edges){const y=t.value.get(_.source),b=t.value.get(_.target);uw({sourcePos:y.computedPosition||{x:0,y:0},targetPos:b.computedPosition||{x:0,y:0},sourceWidth:y.dimensions.width,sourceHeight:y.dimensions.height,targetWidth:b.dimensions.width,targetHeight:b.dimensions.height,width:e.dimensions.width,height:e.dimensions.height,viewport:e.viewport})&&v.push(_)}return v}return e.edges}),u=oe(()=>[...a.value,...l.value]),c=oe(()=>{const v=[];for(const _ of e.nodes)_.selected&&v.push(_);return v}),d=oe(()=>{const v=[];for(const _ of e.edges)_.selected&&v.push(_);return v}),h=oe(()=>[...c.value,...d.value]),f=oe(()=>{const v=[];for(const _ of e.nodes)_.dimensions.width&&_.dimensions.height&&_.handleBounds!==void 0&&v.push(_);return v}),p=oe(()=>a.value.length>0&&f.value.length===a.value.length);return{getNode:o,getEdge:r,getElements:u,getEdgeTypes:i,getNodeTypes:s,getEdges:l,getNodes:a,getSelectedElements:h,getSelectedNodes:c,getSelectedEdges:d,getNodesInitialized:f,areNodesInitialized:p}}class Ut{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??Ut.instance;return Ut.instance=o??new Ut,n&&(n.config.globalProperties.$vueFlowStorage=Ut.instance),Ut.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=Zu(),r=Sc(o),i={};for(const[h,f]of Object.entries(r.hooks)){const p=`on${h.charAt(0).toUpperCase()+h.slice(1)}`;i[p]=f.on}const s={};for(const[h,f]of Object.entries(r.hooks))s[h]=f.trigger;const a=oe(()=>{const h=new Map;for(const f of r.nodes)h.set(f.id,f);return h}),l=oe(()=>{const h=new Map;for(const f of r.edges)h.set(f.id,f);return h}),u=hb(r,a,l),c=Bw(r,a,l);c.setState({...r,...n});const d={...i,...u,...c,...rv(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 Me(e){const t=Ut.getInstance(),n=Ai(),o=typeof e=="object",r=o?e:{id:e},i=r.id,s=i??n?.vueFlowId;let a;if(n){const l=Cn(Pa,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(),u=t.create(l,r);a=u,(n??Ya(!0)).run(()=>{Ee(u.applyDefault,(d,h,f)=>{const p=_=>{u.applyNodeChanges(_)},v=_=>{u.applyEdgeChanges(_)};d?(u.onNodesChange(p),u.onEdgesChange(v)):(u.hooks.value.nodesChange.off(p),u.hooks.value.edgesChange.off(v)),f(()=>{u.hooks.value.nodesChange.off(p),u.hooks.value.edgesChange.off(v)})},{immediate:!0}),Kn(()=>{if(a){const d=t.get(a.id);d?d.$destroy():uo(`No store instance found for id ${a.id} in storage.`)}})})}else o&&a.setState(r);if(n&&(vn(Pa,a),n.vueFlowId=a.id),o){const l=Nn();l?.type.name!=="VueFlow"&&a.emits.error(new Ge(ze.USEVUEFLOW_OPTIONS))}return a}function pb(e){const{emits:t,dimensions:n}=Me();let o;it(()=>{const r=()=>{var i,s;if(!e.value||!(((s=(i=e.value).checkVisibility)==null?void 0:s.call(i))??!0))return;const a=kr(e.value);(a.width===0||a.height===0)&&t.error(new Ge(ze.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)),Xa(()=>{window.removeEventListener("resize",r),o&&e.value&&o.unobserve(e.value)})})}const gb={name:"UserSelection",compatConfig:{MODE:3}},mb=ye({...gb,props:{userSelectionRect:{}},setup(e){return(t,n)=>(j(),ee("div",{class:"vue-flow__selection vue-flow__container",style:Xe({width:`${t.userSelectionRect.width}px`,height:`${t.userSelectionRect.height}px`,transform:`translate(${t.userSelectionRect.x}px, ${t.userSelectionRect.y}px)`})},null,4))}}),vb=["tabIndex"],yb={name:"NodesSelection",compatConfig:{MODE:3}},_b=ye({...yb,setup(e){const{emits:t,viewport:n,getSelectedNodes:o,noPanClassName:r,disableKeyboardA11y:i,userSelectionActive:s}=Me(),a=Ku(),l=fe(null),u=Wu({el:l,onStart(p){t.selectionDragStart(p),t.nodeDragStart(p)},onDrag(p){t.selectionDrag(p),t.nodeDrag(p)},onStop(p){t.selectionDragStop(p),t.nodeDragStop(p)}});it(()=>{var p;i.value||(p=l.value)==null||p.focus({preventScroll:!0})});const c=oe(()=>Du(o.value)),d=oe(()=>({width:`${c.value.width}px`,height:`${c.value.height}px`,top:`${c.value.y}px`,left:`${c.value.x}px`}));function h(p){t.selectionContextMenu({event:p,nodes:o.value})}function f(p){i.value||mn[p.key]&&(p.preventDefault(),a({x:mn[p.key].x,y:mn[p.key].y},p.shiftKey))}return(p,v)=>!S(s)&&c.value.width&&c.value.height?(j(),ee("div",{key:0,class:He(["vue-flow__nodesselection vue-flow__container",S(r)]),style:Xe({transform:`translate(${S(n).x}px,${S(n).y}px) scale(${S(n).zoom})`})},[X("div",{ref_key:"el",ref:l,class:He([{dragging:S(u)},"vue-flow__nodesselection-rect"]),style:Xe(d.value),tabIndex:S(i)?void 0:-1,onContextmenu:h,onKeydown:f},null,46,vb)],6)):ve("",!0)}});function wb(e,t){return{x:e.clientX-t.left,y:e.clientY-t.top}}const bb={name:"Pane",compatConfig:{MODE:3}},xb=ye({...bb,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:u,getSelectedEdges:c,getSelectedNodes:d,removeNodes:h,removeEdges:f,selectionMode:p,deleteKeyCode:v,multiSelectionKeyCode:_,multiSelectionActive:y,edgeLookup:b,nodeLookup:g,connectionLookup:w,defaultEdgeOptions:T,connectionStartHandle:M,panOnDrag:z}=Me(),H=Nt(null),K=Nt(new Set),P=Nt(new Set),C=Nt(null),x=Ie(()=>l.value&&(e.isSelecting||i.value)),N=Ie(()=>M.value!==null);let m=!1,A=!1;const k=jn(v,{actInsideInputWithModifier:!1}),O=jn(_);Ee(k,E=>{E&&(h(d.value),f(c.value),u.value=!1)}),Ee(O,E=>{y.value=E});function L(E,R){return B=>{B.target===R&&E?.(B)}}function F(E){if(m||N.value){m=!1;return}r.paneClick(E),s(),u.value=!1}function G(E){var R;if(Array.isArray(z.value)&&((R=z.value)!=null&&R.includes(2))){E.preventDefault();return}r.paneContextMenu(E)}function U(E){r.paneScroll(E)}function Z(E){var R,B,W;if(C.value=((R=t.value)==null?void 0:R.getBoundingClientRect())??null,!l.value||!e.isSelecting||E.button!==0||E.target!==H.value||!C.value)return;(W=(B=E.target)==null?void 0:B.setPointerCapture)==null||W.call(B,E.pointerId);const{x:Q,y:ne}=wb(E,C.value);A=!0,m=!1,s(),a.value={width:0,height:0,startX:Q,startY:ne,x:Q,y:ne},r.selectionStart(E)}function te(E){var R;if(!C.value||!a.value)return;m=!0;const{x:B,y:W}=yt(E,C.value),{startX:Q=0,startY:ne=0}=a.value,se={startX:Q,startY:ne,x:B<Q?B:Q,y:W<ne?W:ne,width:Math.abs(B-Q),height:Math.abs(W-ne)},ue=K.value,_e=P.value;K.value=new Set($u(n.value,se,o.value,p.value===is.Partial,!0).map(I=>I.id)),P.value=new Set;const $=((R=T.value)==null?void 0:R.selectable)??!0;for(const I of K.value){const V=w.value.get(I);if(V)for(const{edgeId:Y}of V.values()){const q=b.value.get(Y);q&&(q.selectable??$)&&P.value.add(Y)}}if(!Ta(ue,K.value)){const I=$t(g.value,K.value,!0);r.nodesChange(I)}if(!Ta(_e,P.value)){const I=$t(b.value,P.value);r.edgesChange(I)}a.value=se,i.value=!0,u.value=!1}function D(E){var R;E.button!==0||!A||((R=E.target)==null||R.releasePointerCapture(E.pointerId),!i.value&&a.value&&E.target===H.value&&F(E),i.value=!1,a.value=null,u.value=K.value.size>0,r.selectionEnd(E),e.selectionKeyPressed&&(m=!1),A=!1)}return(E,R)=>(j(),ee("div",{ref_key:"container",ref:H,class:He(["vue-flow__pane vue-flow__container",{selection:E.isSelecting}]),onClick:R[0]||(R[0]=B=>x.value?void 0:L(F,H.value)(B)),onContextmenu:R[1]||(R[1]=B=>L(G,H.value)(B)),onWheelPassive:R[2]||(R[2]=B=>L(U,H.value)(B)),onPointerenter:R[3]||(R[3]=B=>x.value?void 0:S(r).paneMouseEnter(B)),onPointerdown:R[4]||(R[4]=B=>x.value?Z(B):S(r).paneMouseMove(B)),onPointermove:R[5]||(R[5]=B=>x.value?te(B):S(r).paneMouseMove(B)),onPointerup:R[6]||(R[6]=B=>x.value?D(B):void 0),onPointerleave:R[7]||(R[7]=B=>S(r).paneMouseLeave(B))},[ke(E.$slots,"default"),S(i)&&S(a)?(j(),be(mb,{key:0,"user-selection-rect":S(a)},null,8,["user-selection-rect"])):ve("",!0),S(u)&&S(d).length?(j(),be(_b,{key:1})):ve("",!0)],34))}}),Eb={name:"Transform",compatConfig:{MODE:3}},kb=ye({...Eb,setup(e){const{viewport:t,fitViewOnInit:n,fitViewOnInitDone:o}=Me(),r=oe(()=>n.value?!o.value:!1),i=oe(()=>`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:Xe({transform:i.value,opacity:r.value?0:void 0})},[ke(s.$slots,"default")],4))}}),Sb={name:"Viewport",compatConfig:{MODE:3}},Cb=ye({...Sb,setup(e){const{minZoom:t,maxZoom:n,defaultViewport:o,translateExtent:r,zoomActivationKeyCode:i,selectionKeyCode:s,panActivationKeyCode:a,panOnScroll:l,panOnScrollMode:u,panOnScrollSpeed:c,panOnDrag:d,zoomOnDoubleClick:h,zoomOnPinch:f,zoomOnScroll:p,preventScrolling:v,noWheelClassName:_,noPanClassName:y,emits:b,connectionStartHandle:g,userSelectionActive:w,paneDragging:T,d3Zoom:M,d3Selection:z,d3ZoomHandler:H,viewport:K,viewportRef:P,paneClickDistance:C}=Me();pb(P);const x=Nt(!1),N=Nt(!1);let m=null,A=!1,k=0,O={x:0,y:0,zoom:0};const L=jn(a),F=jn(s),G=jn(i),U=Ie(()=>(!F.value||F.value&&s.value===!0)&&(L.value||d.value)),Z=Ie(()=>L.value||l.value),te=Ie(()=>s.value===!0&&U.value!==!0),D=Ie(()=>F.value&&s.value!==!0||w.value||te.value),E=Ie(()=>g.value!==null);it(()=>{if(!P.value){uo("Viewport element is missing");return}const ne=P.value,se=ne.getBoundingClientRect(),ue=H0().clickDistance(C.value).scaleExtent([t.value,n.value]).translateExtent(r.value),_e=st(ne).call(ue),$=_e.on("wheel.zoom"),I=En.translate(o.value.x??0,o.value.y??0).scale(en(o.value.zoom??1,t.value,n.value)),V=[[0,0],[se.width,se.height]],Y=ue.constrain()(I,V,r.value);ue.transform(_e,Y),ue.wheelDelta(pa),M.value=ue,z.value=_e,H.value=$,K.value={x:Y.x,y:Y.y,zoom:Y.k},ue.on("start",q=>{var le;if(!q.sourceEvent)return null;k=q.sourceEvent.button,x.value=!0;const ce=W(q.transform);((le=q.sourceEvent)==null?void 0:le.type)==="mousedown"&&(T.value=!0),O=ce,b.viewportChangeStart(ce),b.moveStart({event:q,flowTransform:ce})}),ue.on("end",q=>{if(!q.sourceEvent)return null;if(x.value=!1,T.value=!1,R(U.value,k??0)&&!A&&b.paneContextMenu(q.sourceEvent),A=!1,B(O,q.transform)){const le=W(q.transform);O=le,b.viewportChangeEnd(le),b.moveEnd({event:q,flowTransform:le})}}),ue.filter(q=>{var le;const ce=G.value||p.value,me=f.value&&q.ctrlKey,he=q.button,we=q.type==="wheel";if(he===1&&q.type==="mousedown"&&(Q(q,"vue-flow__node")||Q(q,"vue-flow__edge")))return!0;if(!U.value&&!ce&&!Z.value&&!h.value&&!f.value||w.value||E.value&&!we||!h.value&&q.type==="dblclick"||Q(q,_.value)&&we||Q(q,y.value)&&(!we||Z.value&&we&&!G.value)||!f.value&&q.ctrlKey&&we||!ce&&!Z.value&&!me&&we)return!1;if(!f&&q.type==="touchstart"&&((le=q.touches)==null?void 0:le.length)>1)return q.preventDefault(),!1;if(!U.value&&(q.type==="mousedown"||q.type==="touchstart")||te.value&&Array.isArray(d.value)&&d.value.includes(0)&&he===0||Array.isArray(d.value)&&!d.value.includes(he)&&(q.type==="mousedown"||q.type==="touchstart"))return!1;const Se=Array.isArray(d.value)&&d.value.includes(he)||s.value===!0&&Array.isArray(d.value)&&!d.value.includes(0)||!he||he<=1;return(!q.ctrlKey||L.value||we)&&Se}),Ee([w,U],()=>{w.value&&!x.value?ue.on("zoom",null):w.value||ue.on("zoom",q=>{K.value={x:q.transform.x,y:q.transform.y,zoom:q.transform.k};const le=W(q.transform);A=R(U.value,k??0),b.viewportChange(le),b.move({event:q,flowTransform:le})})},{immediate:!0}),Ee([w,Z,u,G,f,v,_],()=>{Z.value&&!G.value&&!w.value?_e.on("wheel.zoom",q=>{if(Q(q,_.value))return!1;const le=G.value||p.value,ce=f.value&&q.ctrlKey;if(!(!v.value||Z.value||le||ce))return!1;q.preventDefault(),q.stopImmediatePropagation();const he=_e.property("__zoom").k||1,we=sr();if(!L.value&&q.ctrlKey&&f.value&&we){const ac=mt(q),lc=pa(q),uc=he*2**lc;ue.scaleTo(_e,uc,ac,q);return}const Se=q.deltaMode===1?20:1;let Ne=u.value===Gn.Vertical?0:q.deltaX*Se,Mt=u.value===Gn.Horizontal?0:q.deltaY*Se;!we&&q.shiftKey&&u.value!==Gn.Vertical&&!Ne&&Mt&&(Ne=Mt,Mt=0),ue.translateBy(_e,-(Ne/he)*c.value,-(Mt/he)*c.value);const ht=W(_e.property("__zoom"));m&&clearTimeout(m),N.value?(b.move({event:q,flowTransform:ht}),b.viewportChange(ht),m=setTimeout(()=>{b.moveEnd({event:q,flowTransform:ht}),b.viewportChangeEnd(ht),N.value=!1},150)):(N.value=!0,b.moveStart({event:q,flowTransform:ht}),b.viewportChangeStart(ht))},{passive:!1}):typeof $<"u"&&_e.on("wheel.zoom",function(q,le){const ce=!v.value&&q.type==="wheel"&&!q.ctrlKey,me=G.value||p.value,he=f.value&&q.ctrlKey;if(!me&&!l.value&&!he&&q.type==="wheel"||ce||Q(q,_.value))return null;q.preventDefault(),$.call(this,q,le)},{passive:!1})},{immediate:!0})});function R(ne,se){return se===2&&Array.isArray(ne)&&ne.includes(2)}function B(ne,se){return ne.x!==se.x&&!Number.isNaN(se.x)||ne.y!==se.y&&!Number.isNaN(se.y)||ne.zoom!==se.k&&!Number.isNaN(se.k)}function W(ne){return{x:ne.x,y:ne.y,zoom:ne.k}}function Q(ne,se){return ne.target.closest(`.${se}`)}return(ne,se)=>(j(),ee("div",{ref_key:"viewportRef",ref:P,class:"vue-flow__viewport vue-flow__container"},[ie(xb,{"is-selecting":D.value,"selection-key-pressed":S(F),class:He({connecting:E.value,dragging:S(T),draggable:S(d)===!0||Array.isArray(S(d))&&S(d).includes(0)})},{default:pe(()=>[ie(kb,null,{default:pe(()=>[ke(ne.$slots,"default")]),_:3})]),_:3},8,["is-selecting","selection-key-pressed","class"])],512))}}),Nb=["id"],Tb=["id"],Pb=["id"],Ab={name:"A11yDescriptions",compatConfig:{MODE:3}},Ib=ye({...Ab,setup(e){const{id:t,disableKeyboardA11y:n,ariaLiveMessage:o}=Me();return(r,i)=>(j(),ee(Oe,null,[X("div",{id:`${S(Tu)}-${S(t)}`,style:{display:"none"}}," Press enter or space to select a node. "+ge(S(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,Nb),X("div",{id:`${S(Pu)}-${S(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,Tb),S(n)?ve("",!0):(j(),ee("div",{key:0,id:`${S(Y0)}-${S(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%)"}},ge(S(o)),9,Pb))],64))}});function Ob(){const e=Me();Ee(()=>e.viewportHelper.value.viewportInitialized,t=>{t&&setTimeout(()=>{e.emits.init(e),e.emits.paneReady(e)},1)})}function Rb(e,t,n){return n===de.Left?e-t:n===de.Right?e+t:e}function Mb(e,t,n){return n===de.Top?e-t:n===de.Bottom?e+t:e}const ls=function({radius:e=10,centerX:t=0,centerY:n=0,position:o=de.Top,type:r}){return Pe("circle",{class:`vue-flow__edgeupdater vue-flow__edgeupdater-${r}`,cx:Rb(t,e,o),cy:Mb(n,e,o),r:e,stroke:"transparent",fill:"transparent"})};ls.props=["radius","centerX","centerY","position","type"];ls.compatConfig={MODE:3};const Ma=ls,Lb=ye({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:u,findEdge:c,findNode:d,isValidConnection:h,multiSelectionActive:f,disableKeyboardA11y:p,elementsSelectable:v,edgesUpdatable:_,edgesFocusable:y,hooks:b}=Me(),g=oe(()=>c(e.id)),{emit:w,on:T}=Sw(g.value,i),M=Cn(Cr),z=Nn(),H=fe(!1),K=fe(!1),P=fe(""),C=fe(null),x=fe("source"),N=fe(null),m=Ie(()=>typeof g.value.selectable>"u"?v.value:g.value.selectable),A=Ie(()=>typeof g.value.updatable>"u"?_.value:g.value.updatable),k=Ie(()=>typeof g.value.focusable>"u"?y.value:g.value.focusable);vn(xw,e.id),vn(Ew,N);const O=oe(()=>g.value.class instanceof Function?g.value.class(g.value):g.value.class),L=oe(()=>g.value.style instanceof Function?g.value.style(g.value):g.value.style),F=oe(()=>{const I=g.value.type||"default",V=M?.[`edge-${I}`];if(V)return V;let Y=g.value.template??l.value[I];if(typeof Y=="string"&&z){const q=Object.keys(z.appContext.components);q&&q.includes(I)&&(Y=Ka(I,!1))}return Y&&typeof Y!="string"?Y:(i.error(new Ge(ze.EDGE_TYPE_MISSING,Y)),!1)}),{handlePointerDown:G}=Yu({nodeId:P,handleId:C,type:x,isValidConnection:h,edgeUpdaterType:x,onEdgeUpdate:te,onEdgeUpdateEnd:D});return()=>{const I=d(g.value.source),V=d(g.value.target),Y="pathOptions"in g.value?g.value.pathOptions:{};if(!I&&!V)return i.error(new Ge(ze.EDGE_SOURCE_TARGET_MISSING,g.value.id,g.value.source,g.value.target)),null;if(!I)return i.error(new Ge(ze.EDGE_SOURCE_MISSING,g.value.id,g.value.source)),null;if(!V)return i.error(new Ge(ze.EDGE_TARGET_MISSING,g.value.id,g.value.target)),null;if(!g.value||g.value.hidden||I.hidden||V.hidden)return null;let q;o.value===Ht.Strict?q=I.handleBounds.source:q=[...I.handleBounds.source||[],...I.handleBounds.target||[]];const le=xa(q,g.value.sourceHandle);let ce;o.value===Ht.Strict?ce=V.handleBounds.target:ce=[...V.handleBounds.target||[],...V.handleBounds.source||[]];const me=xa(ce,g.value.targetHandle),he=le?.position||de.Bottom,we=me?.position||de.Top,{x:Se,y:Ne}=kn(I,le,he),{x:Mt,y:ht}=kn(V,me,we);return g.value.sourceX=Se,g.value.sourceY=Ne,g.value.targetX=Mt,g.value.targetY=ht,Pe("g",{ref:N,key:e.id,"data-id":e.id,class:["vue-flow__edge",`vue-flow__edge-${F.value===!1?"default":g.value.type||"default"}`,a.value,O.value,{updating:H.value,selected:g.value.selected,animated:g.value.animated,inactive:!m.value&&!b.value.edgeClick.hasListeners()}],tabIndex:k.value?0:void 0,"aria-label":g.value.ariaLabel===null?void 0:g.value.ariaLabel??`Edge from ${g.value.source} to ${g.value.target}`,"aria-describedby":k.value?`${Pu}-${t}`:void 0,"aria-roledescription":"edge",role:k.value?"group":"img",...g.value.domAttributes,onClick:R,onContextmenu:B,onDblclick:W,onMouseenter:Q,onMousemove:ne,onMouseleave:se,onKeyDown:k.value?$:void 0},[K.value?null:Pe(F.value===!1?l.value.default:F.value,{id:e.id,sourceNode:I,targetNode:V,source:g.value.source,target:g.value.target,type:g.value.type,updatable:A.value,selected:g.value.selected,animated:g.value.animated,label:g.value.label,labelStyle:g.value.labelStyle,labelShowBg:g.value.labelShowBg,labelBgStyle:g.value.labelBgStyle,labelBgPadding:g.value.labelBgPadding,labelBgBorderRadius:g.value.labelBgBorderRadius,data:g.value.data,events:{...g.value.events,...T},style:L.value,markerStart:`url('#${oo(g.value.markerStart,t)}')`,markerEnd:`url('#${oo(g.value.markerEnd,t)}')`,sourcePosition:he,targetPosition:we,sourceX:Se,sourceY:Ne,targetX:Mt,targetY:ht,sourceHandleId:g.value.sourceHandle,targetHandleId:g.value.targetHandle,interactionWidth:g.value.interactionWidth,...Y}),[A.value==="source"||A.value===!0?[Pe("g",{onMousedown:ue,onMouseenter:U,onMouseout:Z},Pe(Ma,{position:he,centerX:Se,centerY:Ne,radius:r.value,type:"source","data-type":"source"}))]:null,A.value==="target"||A.value===!0?[Pe("g",{onMousedown:_e,onMouseenter:U,onMouseout:Z},Pe(Ma,{position:we,centerX:Mt,centerY:ht,radius:r.value,type:"target","data-type":"target"}))]:null]])};function U(){H.value=!0}function Z(){H.value=!1}function te(I,V){w.update({event:I,edge:g.value,connection:V})}function D(I){w.updateEnd({event:I,edge:g.value}),K.value=!1}function E(I,V){I.button===0&&(K.value=!0,P.value=V?g.value.target:g.value.source,C.value=(V?g.value.targetHandle:g.value.sourceHandle)??null,x.value=V?"target":"source",w.updateStart({event:I,edge:g.value}),G(I))}function R(I){var V;const Y={event:I,edge:g.value};m.value&&(s.value=!1,g.value.selected&&f.value?(u([g.value]),(V=N.value)==null||V.blur()):n([g.value])),w.click(Y)}function B(I){w.contextMenu({event:I,edge:g.value})}function W(I){w.doubleClick({event:I,edge:g.value})}function Q(I){w.mouseEnter({event:I,edge:g.value})}function ne(I){w.mouseMove({event:I,edge:g.value})}function se(I){w.mouseLeave({event:I,edge:g.value})}function ue(I){E(I,!0)}function _e(I){E(I,!1)}function $(I){var V;!p.value&&Au.includes(I.key)&&m.value&&(I.key==="Escape"?((V=N.value)==null||V.blur(),u([c(e.id)])):n([c(e.id)]))}}}),Db=Lb,$b=ye({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:u,viewport:c,findNode:d}=Me(),h=(e=Cn(Cr))==null?void 0:e["connection-line"],f=oe(()=>{var b;return d((b=o.value)==null?void 0:b.nodeId)}),p=oe(()=>{var b;return d((b=r.value)==null?void 0:b.nodeId)??null}),v=oe(()=>({x:(i.value.x-c.value.x)/c.value.zoom,y:(i.value.y-c.value.y)/c.value.zoom})),_=oe(()=>l.value.markerStart?`url(#${oo(l.value.markerStart,t)})`:""),y=oe(()=>l.value.markerEnd?`url(#${oo(l.value.markerEnd,t)})`:"");return()=>{var b,g,w;if(!f.value||!o.value)return null;const T=o.value.id,M=o.value.type,z=f.value.handleBounds;let H=z?.[M]??[];if(n.value===Ht.Loose){const L=z?.[M==="source"?"target":"source"]??[];H=[...H,...L]}if(!H)return null;const K=(T?H.find(L=>L.id===T):H[0])??null,P=K?.position??de.Top,{x:C,y:x}=kn(f.value,K,P);let N=null;p.value&&(n.value===Ht.Strict?N=((b=p.value.handleBounds[M==="source"?"target":"source"])==null?void 0:b.find(L=>{var F;return L.id===((F=r.value)==null?void 0:F.id)}))||null:N=((g=[...p.value.handleBounds.source??[],...p.value.handleBounds.target??[]])==null?void 0:g.find(L=>{var F;return L.id===((F=r.value)==null?void 0:F.id)}))||null);const m=((w=r.value)==null?void 0:w.position)??(P?Ni[P]:null);if(!P||!m)return null;const A=s.value??l.value.type??qt.Bezier;let k="";const O={sourceX:C,sourceY:x,sourcePosition:P,targetX:v.value.x,targetY:v.value.y,targetPosition:m};return A===qt.Bezier?[k]=ec(O):A===qt.Step?[k]=Pi({...O,borderRadius:0}):A===qt.SmoothStep?[k]=Pi(O):A===qt.SimpleBezier?[k]=tc(O):k=`M${C},${x} ${v.value.x},${v.value.y}`,Pe("svg",{class:"vue-flow__edges vue-flow__connectionline vue-flow__container"},Pe("g",{class:"vue-flow__connection"},h?Pe(h,{sourceX:C,sourceY:x,sourcePosition:P,targetX:v.value.x,targetY:v.value.y,targetPosition:m,sourceNode:f.value,sourceHandle:K,targetNode:p.value,targetHandle:N,markerEnd:y.value,markerStart:_.value,connectionStatus:u.value}):Pe("path",{d:k,class:[l.value.class,u.value,"vue-flow__connection-path"],style:{...a.value,...l.value.style},"marker-end":y.value,"marker-start":_.value})))}}}),Bb=$b,zb=["id","markerWidth","markerHeight","markerUnits","orient"],Vb={name:"MarkerType",compatConfig:{MODE:3}},Fb=ye({...Vb,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===S(or).ArrowClosed?(j(),ee("polyline",{key:0,style:Xe({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)):ve("",!0),t.type===S(or).Arrow?(j(),ee("polyline",{key:1,style:Xe({stroke:t.color,strokeWidth:t.strokeWidth}),"stroke-linecap":"round","stroke-linejoin":"round",fill:"none",points:"-5,-4 0,0 -5,4"},null,4)):ve("",!0)],8,zb))}}),Hb={class:"vue-flow__marker vue-flow__container","aria-hidden":"true"},Gb={name:"MarkerDefinitions",compatConfig:{MODE:3}},jb=ye({...Gb,setup(e){const{id:t,edges:n,connectionLineOptions:o,defaultMarkerColor:r}=Me(),i=oe(()=>{const s=new Set,a=[],l=u=>{if(u){const c=oo(u,t);s.has(c)||(typeof u=="object"?a.push({...u,id:c,color:u.color||r.value}):a.push({id:c,color:r.value,type:u}),s.add(c))}};for(const u of[o.value.markerEnd,o.value.markerStart])l(u);for(const u of n.value)for(const c of[u.markerStart,u.markerEnd])l(c);return a.sort((u,c)=>u.id.localeCompare(c.id))});return(s,a)=>(j(),ee("svg",Hb,[X("defs",null,[(j(!0),ee(Oe,null,rt(i.value,l=>(j(),be(Fb,{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))])]))}}),qb={name:"Edges",compatConfig:{MODE:3}},Ub=ye({...qb,setup(e){const{findNode:t,getEdges:n,elevateEdgesOnSelect:o}=Me();return(r,i)=>(j(),ee(Oe,null,[ie(jb),(j(!0),ee(Oe,null,rt(S(n),s=>(j(),ee("svg",{key:s.id,class:"vue-flow__edges vue-flow__container",style:Xe({zIndex:S(cw)(s,S(t),S(o))})},[ie(S(Db),{id:s.id},null,8,["id"])],4))),128)),ie(S(Bb))],64))}}),Wb=ye({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:u,onUpdateNodeInternals:c,getNodeTypes:d,nodeExtent:h,elevateNodesOnSelect:f,disableKeyboardA11y:p,ariaLiveMessage:v,snapToGrid:_,snapGrid:y,nodeDragThreshold:b,nodesDraggable:g,elementsSelectable:w,nodesConnectable:T,nodesFocusable:M,hooks:z}=Me(),H=fe(null);vn(Uu,H),vn(qu,e.id);const K=Cn(Cr),P=Nn(),C=Ku(),{node:x,parentNode:N}=Xu(e.id),{emit:m,on:A}=Pw(x,s),k=Ie(()=>typeof x.draggable>"u"?g.value:x.draggable),O=Ie(()=>typeof x.selectable>"u"?w.value:x.selectable),L=Ie(()=>typeof x.connectable>"u"?T.value:x.connectable),F=Ie(()=>typeof x.focusable>"u"?M.value:x.focusable),G=oe(()=>O.value||k.value||z.value.nodeClick.hasListeners()||z.value.nodeDoubleClick.hasListeners()||z.value.nodeMouseEnter.hasListeners()||z.value.nodeMouseMove.hasListeners()||z.value.nodeMouseLeave.hasListeners()),U=Ie(()=>!!x.dimensions.width&&!!x.dimensions.height),Z=oe(()=>{const V=x.type||"default",Y=K?.[`node-${V}`];if(Y)return Y;let q=x.template||d.value[V];if(typeof q=="string"&&P){const le=Object.keys(P.appContext.components);le&&le.includes(V)&&(q=Ka(V,!1))}return q&&typeof q!="string"?q:(s.error(new Ge(ze.NODE_TYPE_MISSING,q)),!1)}),te=Wu({id:e.id,el:H,disabled:()=>!k.value,selectable:O,dragHandle:()=>x.dragHandle,onStart(V){m.dragStart(V)},onDrag(V){m.drag(V)},onStop(V){m.dragStop(V)},onClick(V){$(V)}}),D=oe(()=>x.class instanceof Function?x.class(x):x.class),E=oe(()=>{const V=(x.style instanceof Function?x.style(x):x.style)||{},Y=x.width instanceof Function?x.width(x):x.width,q=x.height instanceof Function?x.height(x):x.height;return!V.width&&Y&&(V.width=typeof Y=="string"?Y:`${Y}px`),!V.height&&q&&(V.height=typeof q=="string"?q:`${q}px`),V}),R=Ie(()=>Number(x.zIndex??E.value.zIndex??0));return c(V=>{(V.includes(e.id)||!V.length)&&W()}),it(()=>{Ee(()=>x.hidden,(V=!1,Y,q)=>{!V&&H.value&&(e.resizeObserver.observe(H.value),q(()=>{H.value&&e.resizeObserver.unobserve(H.value)}))},{immediate:!0,flush:"post"})}),Ee([()=>x.type,()=>x.sourcePosition,()=>x.targetPosition],()=>{At(()=>{u([{id:e.id,nodeElement:H.value,forceUpdate:!0}])})}),Ee([()=>x.position.x,()=>x.position.y,()=>{var V;return(V=N.value)==null?void 0:V.computedPosition.x},()=>{var V;return(V=N.value)==null?void 0:V.computedPosition.y},()=>{var V;return(V=N.value)==null?void 0:V.computedPosition.z},R,()=>x.selected,()=>x.dimensions.height,()=>x.dimensions.width,()=>{var V;return(V=N.value)==null?void 0:V.dimensions.height},()=>{var V;return(V=N.value)==null?void 0:V.dimensions.width}],([V,Y,q,le,ce,me])=>{const he={x:V,y:Y,z:me+(f.value&&x.selected?1e3:0)};typeof q<"u"&&typeof le<"u"?x.computedPosition=rw({x:q,y:le,z:ce},he):x.computedPosition=he},{flush:"post",immediate:!0}),Ee([()=>x.extent,h],([V,Y],[q,le])=>{(V!==q||Y!==le)&&B()}),x.extent==="parent"||typeof x.extent=="object"&&"range"in x.extent&&x.extent.range==="parent"?vi(()=>U).toBe(!0).then(B):B(),()=>x.hidden?null:Pe("div",{ref:H,"data-id":x.id,class:["vue-flow__node",`vue-flow__node-${Z.value===!1?"default":x.type||"default"}`,{[n.value]:k.value,dragging:te?.value,draggable:k.value,selected:x.selected,selectable:O.value,parent:x.isParent},D.value],style:{visibility:U.value?"visible":"hidden",zIndex:x.computedPosition.z??R.value,transform:`translate(${x.computedPosition.x}px,${x.computedPosition.y}px)`,pointerEvents:G.value?"all":"none",...E.value},tabIndex:F.value?0:void 0,role:F.value?"group":void 0,"aria-describedby":p.value?void 0:`${Tu}-${t}`,"aria-label":x.ariaLabel,"aria-roledescription":"node",...x.domAttributes,onMouseenter:Q,onMousemove:ne,onMouseleave:se,onContextmenu:ue,onClick:$,onDblclick:_e,onKeydown:I},[Pe(Z.value===!1?d.value.default:Z.value,{id:x.id,type:x.type,data:x.data,events:{...x.events,...A},selected:x.selected,resizing:x.resizing,dragging:te.value,connectable:L.value,position:x.computedPosition,dimensions:x.dimensions,isValidTargetPos:x.isValidTargetPos,isValidSourcePos:x.isValidSourcePos,parent:x.parentNode,parentNodeId:x.parentNode,zIndex:x.computedPosition.z??R.value,targetPosition:x.targetPosition,sourcePosition:x.sourcePosition,label:x.label,dragHandle:x.dragHandle,onUpdateNodeInternals:W})]);function B(){const V=x.computedPosition,{computedPosition:Y,position:q}=ss(x,_.value?Sr(V,y.value):V,s.error,h.value,N.value);(x.computedPosition.x!==Y.x||x.computedPosition.y!==Y.y)&&(x.computedPosition={...x.computedPosition,...Y}),(x.position.x!==q.x||x.position.y!==q.y)&&(x.position=q)}function W(){H.value&&u([{id:e.id,nodeElement:H.value,forceUpdate:!0}])}function Q(V){te?.value||m.mouseEnter({event:V,node:x})}function ne(V){te?.value||m.mouseMove({event:V,node:x})}function se(V){te?.value||m.mouseLeave({event:V,node:x})}function ue(V){return m.contextMenu({event:V,node:x})}function _e(V){return m.doubleClick({event:V,node:x})}function $(V){O.value&&(!o.value||!k.value||b.value>0)&&Ti(x,i.value,l,a,r,!1,H.value),m.click({event:V,node:x})}function I(V){if(!(Ci(V)||p.value))if(Au.includes(V.key)&&O.value){const Y=V.key==="Escape";Ti(x,i.value,l,a,r,Y,H.value)}else k.value&&x.selected&&mn[V.key]&&(V.preventDefault(),v.value=`Moved selected node ${V.key.replace("Arrow","").toLowerCase()}. New position, x: ${~~x.position.x}, y: ${~~x.position.y}`,C({x:mn[V.key].x,y:mn[V.key].y},V.shiftKey))}}}),Yb=Wb;function Xb(e={includeHiddenNodes:!1}){const{nodes:t}=Me();return oe(()=>{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 Kb={class:"vue-flow__nodes vue-flow__container"},Zb={name:"Nodes",compatConfig:{MODE:3}},Jb=ye({...Zb,setup(e){const{getNodes:t,updateNodeDimensions:n,emits:o}=Me(),r=Xb(),i=fe();return Ee(r,s=>{s&&At(()=>{o.nodesInitialized(t.value)})},{immediate:!0}),it(()=>{i.value=new ResizeObserver(s=>{const a=s.map(l=>({id:l.target.getAttribute("data-id"),nodeElement:l.target,forceUpdate:!0}));At(()=>n(a))})}),Xa(()=>{var s;return(s=i.value)==null?void 0:s.disconnect()}),(s,a)=>(j(),ee("div",Kb,[i.value?(j(!0),ee(Oe,{key:0},rt(S(t),(l,u,c,d)=>{const h=[l.id];if(d&&d.key===l.id&&kc(d,h))return d;const f=(j(),be(S(Yb),{id:l.id,key:l.id,"resize-observer":i.value},null,8,["id","resize-observer"]));return f.memo=h,f},a,0),128)):ve("",!0)]))}});function Qb(){const{emits:e}=Me();it(()=>{if(ju()){const t=document.querySelector(".vue-flow__pane");t&&window.getComputedStyle(t).zIndex!=="1"&&e.error(new Ge(ze.MISSING_STYLES))}})}const e1=X("div",{class:"vue-flow__edge-labels"},null,-1),t1={name:"VueFlow",compatConfig:{MODE:3}},n1=ye({...t1,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=xc(),i=Vr(o,"modelValue",n),s=Vr(o,"nodes",n),a=Vr(o,"edges",n),l=Me(o),u=Rw({modelValue:i,nodes:s,edges:a},o,l);return Lw(n,l.hooks),Ob(),Qb(),vn(Cr,r),Wa(u),t(l),(c,d)=>(j(),ee("div",{ref:S(l).vueFlowRef,class:"vue-flow"},[ie(Cb,null,{default:pe(()=>[ie(Ub),e1,ie(Jb),ke(c.$slots,"zoom-pane")]),_:3}),ke(c.$slots,"default"),ie(Ib)],512))}}),o1={name:"Panel",compatConfig:{MODE:3}},r1=ye({...o1,props:{position:{}},setup(e){const t=e,{userSelectionActive:n}=Me(),o=oe(()=>`${t.position}`.split("-"));return(r,i)=>(j(),ee("div",{class:He(["vue-flow__panel",o.value]),style:Xe({pointerEvents:S(n)?"none":"all"})},[ke(r.$slots,"default")],6))}});var Pt=(e=>(e.Lines="lines",e.Dots="dots",e))(Pt||{});const oc=function({dimensions:e,size:t,color:n}){return Pe("path",{stroke:n,"stroke-width":t,d:`M${e[0]/2} 0 V${e[1]} M0 ${e[1]/2} H${e[0]}`})},rc=function({radius:e,color:t}){return Pe("circle",{cx:e,cy:e,r:e,fill:t})};Pt.Lines+"",Pt.Dots+"";const i1={[Pt.Dots]:"#81818a",[Pt.Lines]:"#eee"},s1=["id","x","y","width","height","patternTransform"],a1={key:2,height:"100",width:"100"},l1=["fill"],u1=["x","y","fill"],c1={name:"Background",compatConfig:{MODE:3}},d1=ye({...c1,props:{id:{},variant:{default:()=>Pt.Dots},gap:{default:20},size:{default:1},lineWidth:{default:1},patternColor:{},color:{},bgColor:{},height:{default:100},width:{default:100},x:{default:0},y:{default:0},offset:{default:0}},setup(e){const{id:t,viewport:n}=Me(),o=oe(()=>{const s=n.value.zoom,[a,l]=Array.isArray(e.gap)?e.gap:[e.gap,e.gap],u=[a*s||1,l*s||1],c=e.size*s,[d,h]=Array.isArray(e.offset)?e.offset:[e.offset,e.offset],f=[d*s||1+u[0]/2,h*s||1+u[1]/2];return{scaledGap:u,offset:f,size:c}}),r=Ie(()=>`pattern-${t}${e.id?`-${e.id}`:""}`),i=Ie(()=>e.color||e.patternColor||i1[e.variant||Pt.Dots]);return(s,a)=>(j(),ee("svg",{class:"vue-flow__background vue-flow__container",style:Xe({height:`${s.height>100?100:s.height}%`,width:`${s.width>100?100:s.width}%`})},[ke(s.$slots,"pattern-container",{id:r.value},()=>[X("pattern",{id:r.value,x:S(n).x%o.value.scaledGap[0],y:S(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"},[ke(s.$slots,"pattern",{},()=>[s.variant===S(Pt).Lines?(j(),be(S(oc),{key:0,size:s.lineWidth,color:i.value,dimensions:o.value.scaledGap},null,8,["size","color","dimensions"])):s.variant===S(Pt).Dots?(j(),be(S(rc),{key:1,color:i.value,radius:o.value.size/2},null,8,["color","radius"])):ve("",!0),s.bgColor?(j(),ee("svg",a1,[X("rect",{width:"100%",height:"100%",fill:s.bgColor},null,8,l1)])):ve("",!0)])],8,s1)]),X("rect",{x:s.x,y:s.y,width:"100%",height:"100%",fill:`url(#${r.value})`},null,8,u1),ke(s.$slots,"default",{id:r.value})],4))}}),f1={name:"ControlButton",compatConfig:{MODE:3}},h1=(e,t)=>{const n=e.__vccOpts||e;for(const[o,r]of t)n[o]=r;return n},p1={type:"button",class:"vue-flow__controls-button"};function g1(e,t,n,o,r,i){return j(),ee("button",p1,[ke(e.$slots,"default")])}const So=h1(f1,[["render",g1]]),m1={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32"},v1=X("path",{d:"M32 18.133H18.133V32h-4.266V18.133H0v-4.266h13.867V0h4.266v13.867H32z"},null,-1),y1=[v1];function _1(e,t){return j(),ee("svg",m1,y1)}const w1={render:_1},b1={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 5"},x1=X("path",{d:"M0 0h32v4.2H0z"},null,-1),E1=[x1];function k1(e,t){return j(),ee("svg",b1,E1)}const S1={render:k1},C1={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 30"},N1=X("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),T1=[N1];function P1(e,t){return j(),ee("svg",C1,T1)}const A1={render:P1},I1={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32"},O1=X("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),R1=[O1];function M1(e,t){return j(),ee("svg",I1,R1)}const L1={render:M1},D1={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32"},$1=X("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),B1=[$1];function z1(e,t){return j(),ee("svg",D1,B1)}const V1={render:z1},F1={name:"Controls",compatConfig:{MODE:3}},H1=ye({...F1,props:{showZoom:{type:Boolean,default:!0},showFitView:{type:Boolean,default:!0},showInteractive:{type:Boolean,default:!0},fitViewParams:{},position:{default:()=>Nu.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:u,minZoom:c,maxZoom:d}=Me(),h=Ie(()=>n.value||o.value||r.value),f=Ie(()=>u.value.zoom<=c.value),p=Ie(()=>u.value.zoom>=d.value);function v(){s(),t("zoomIn")}function _(){a(),t("zoomOut")}function y(){l(e.fitViewParams),t("fitView")}function b(){i(!h.value),t("interactionChange",!h.value)}return(g,w)=>(j(),be(S(r1),{class:"vue-flow__controls",position:g.position},{default:pe(()=>[ke(g.$slots,"top"),g.showZoom?(j(),ee(Oe,{key:0},[ke(g.$slots,"control-zoom-in",{},()=>[ie(So,{class:"vue-flow__controls-zoomin",disabled:p.value,onClick:v},{default:pe(()=>[ke(g.$slots,"icon-zoom-in",{},()=>[(j(),be(ot(S(w1))))])]),_:3},8,["disabled"])]),ke(g.$slots,"control-zoom-out",{},()=>[ie(So,{class:"vue-flow__controls-zoomout",disabled:f.value,onClick:_},{default:pe(()=>[ke(g.$slots,"icon-zoom-out",{},()=>[(j(),be(ot(S(S1))))])]),_:3},8,["disabled"])])],64)):ve("",!0),g.showFitView?ke(g.$slots,"control-fit-view",{key:1},()=>[ie(So,{class:"vue-flow__controls-fitview",onClick:y},{default:pe(()=>[ke(g.$slots,"icon-fit-view",{},()=>[(j(),be(ot(S(A1))))])]),_:3})]):ve("",!0),g.showInteractive?ke(g.$slots,"control-interactive",{key:2},()=>[g.showInteractive?(j(),be(So,{key:0,class:"vue-flow__controls-interactive",onClick:b},{default:pe(()=>[h.value?ke(g.$slots,"icon-unlock",{key:0},()=>[(j(),be(ot(S(V1))))]):ve("",!0),h.value?ve("",!0):ke(g.$slots,"icon-lock",{key:1},()=>[(j(),be(ot(S(L1))))])]),_:3})):ve("",!0)]):ve("",!0),ke(g.$slots,"default")]),_:3},8,["position"]))}}),G1={key:0,class:"space-y-2"},j1={class:"flex items-center justify-between gap-2 text-[11px] text-muted-foreground"},q1={class:"shrink-0 font-mono"},U1=["title"],W1={class:"line-clamp-2 text-sm font-medium leading-snug"},Y1={class:"flex items-center justify-between gap-2 text-[11px] text-muted-foreground"},X1={class:"flex items-center gap-1.5 text-[10px] uppercase tracking-wide"},K1={class:"rounded bg-background/60 px-1.5 py-0.5"},Z1={class:"rounded bg-background/60 px-1.5 py-0.5"},J1={key:1,class:"space-y-1.5"},Q1={class:"flex items-center gap-2 text-sm font-medium"},ex={class:"font-mono text-[11px] text-muted-foreground"},tx=ye({__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=oe(()=>t.data),o=oe(()=>n.value.kind==="task"?n.value:null),r=oe(()=>n.value.kind==="external"?n.value:null),i=oe(()=>{if(n.value.kind!=="task")return{label:"Missing dependency",icon:yn,class:"text-amber-600 dark:text-amber-400"};switch(n.value.status){case"completed":return{label:"Completed",icon:Lo,class:"text-emerald-600 dark:text-emerald-400"};case"in_progress":return{label:"In Progress",icon:Za,class:"text-blue-600 dark:text-blue-400"};default:return{label:"Pending",icon:Vn,class:"text-muted-foreground"}}}),s=oe(()=>n.value.kind!=="task"?null:n.value.priority.replace("_"," ")),a=oe(()=>n.value.kind!=="task"?null:n.value.category),l=oe(()=>n.value.kind==="external"?["border-amber-500/60 bg-amber-50/70 text-amber-900 dark:border-amber-500/40 dark:bg-amber-500/10 dark:text-amber-100","border-dashed"]:n.value.status==="completed"?["border-emerald-500/40 bg-emerald-50/70 text-emerald-950 dark:border-emerald-500/40 dark:bg-emerald-500/10 dark:text-emerald-100","border-solid"]:n.value.status==="in_progress"?["border-blue-500/40 bg-blue-50/80 text-blue-950 dark:border-blue-500/40 dark:bg-blue-500/10 dark:text-blue-100","border-solid"]:["border-border bg-card text-card-foreground","border-solid"]),u=oe(()=>n.value.kind!=="task"||!n.value.showPrdLabel?null:n.value.prdName?.trim()||n.value.prdSlug);return(c,d)=>(j(),ee("div",{class:He(["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",[S(l),e.selected?"ring-2 ring-primary/30 shadow-md":"hover:shadow-md hover:border-primary/40"]])},[ie(S(Sn),{type:"target",position:S(de).Top,class:"!h-2 !w-2 !border-0 !bg-transparent !opacity-0 !pointer-events-none"},null,8,["position"]),S(o)?(j(),ee("div",G1,[X("div",j1,[X("span",q1,ge(S(o).taskId),1),S(u)?(j(),ee("span",{key:0,title:`${S(o).prdName} (${S(o).prdSlug})`,class:"max-w-[11rem] truncate rounded border border-border bg-background/60 px-1.5 py-0.5 text-[10px]"},ge(S(u)),9,U1)):ve("",!0)]),X("p",W1,ge(S(o).title),1),X("div",Y1,[X("div",{class:He(["flex items-center gap-1.5",S(i).class])},[(j(),be(ot(S(i).icon),{class:"size-3.5"})),X("span",null,ge(S(i).label),1)],2),X("div",X1,[X("span",K1,ge(S(a)),1),X("span",Z1,ge(S(s)),1)])])])):S(r)?(j(),ee("div",J1,[X("div",Q1,[ie(S(yn),{class:"size-4"}),X("span",null,ge(S(r).title),1)]),X("p",ex,ge(S(r).dependencyRef),1)])):ve("",!0),ie(S(Sn),{type:"source",position:S(de).Bottom,class:"!h-2 !w-2 !border-0 !bg-transparent !opacity-0 !pointer-events-none"},null,8,["position"])],2))}}),La=Object.assign(tx,{__name:"GraphNode"}),nx={class:"relative h-full overflow-hidden rounded-lg border border-border bg-card"},ox={key:0,class:"flex h-full items-center justify-center"},rx={class:"flex flex-col items-center gap-2 text-sm text-muted-foreground"},ix={key:1,class:"flex h-full items-center justify-center p-6"},sx={class:"max-w-sm text-center"},ax={class:"mt-1 text-sm text-muted-foreground"},lx={key:2,class:"flex h-full items-center justify-center p-6"},ux={class:"max-w-sm text-center"},cx={class:"mt-1 text-sm text-muted-foreground"},dx={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"},fx={class:"space-y-1 text-xs"},hx={class:"flex items-center gap-1.5 text-muted-foreground"},px={class:"flex items-center gap-1.5 text-blue-600 dark:text-blue-400"},gx={class:"flex items-center gap-1.5 text-emerald-600 dark:text-emerald-400"},mx={class:"flex items-center gap-1.5 text-amber-600 dark:text-amber-400"},vx={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"},yx={class:"flex flex-wrap items-center gap-1.5 text-[11px] text-muted-foreground"},_x={class:"rounded bg-muted px-1.5 py-0.5"},wx={class:"rounded bg-blue-500/10 px-1.5 py-0.5 text-blue-700 dark:text-blue-300"},bx={class:"rounded bg-emerald-500/10 px-1.5 py-0.5 text-emerald-700 dark:text-emerald-300"},xx={class:"rounded bg-amber-500/10 px-1.5 py-0.5 text-amber-700 dark:text-amber-300"},Ex=ye({__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:cn(La),external:cn(La)},i=mc("(prefers-reduced-motion: reduce)"),s=fe(0);Ee(()=>[n.scope,n.payload?.scope,n.payload?.nodes.length,n.payload?.edges.length],()=>{s.value+=1},{deep:!1});const a=oe(()=>`${n.scope}-${s.value}`),l=oe(()=>n.payload?n.payload.nodes.some(_=>_.kind==="task"):!1),u=oe(()=>n.payload?.stats);function c(_,y){return _.kind==="external"?{width:272,height:80}:y==="repo"?{width:272,height:116}:{width:272,height:96}}function d(_){return _==="repo"?{ranksep:136,nodesep:88,edgesep:34,marginx:36,marginy:28}:{ranksep:102,nodesep:56,edgesep:20,marginx:24,marginy:22}}function h(_,y){const b=new qs.graphlib.Graph,g=d(n.scope);b.setDefaultEdgeLabel(()=>({})),b.setGraph({rankdir:"TB",ranker:"network-simplex",...g});for(const w of _){const T=c(w.data,n.scope);b.setNode(w.id,T)}for(const w of y)b.setEdge(w.source,w.target);return qs.layout(b),_.map(w=>{const T=c(w.data,n.scope),M=b.node(w.id);return M?{...w,targetPosition:de.Top,sourcePosition:de.Bottom,position:{x:M.x-T.width/2,y:M.y-T.height/2}}:w})}const f=oe(()=>n.payload?n.payload.edges.map(_=>({id:_.id,source:_.source,target:_.target,type:"step",animated:_.unresolved&&!i.value,markerEnd:{type:or.ArrowClosed,width:16,height:16},style:{strokeWidth:_.unresolved?1.4:1.7,stroke:_.unresolved?"var(--muted-foreground)":"var(--border)",strokeOpacity:_.unresolved?.62:.95,strokeDasharray:_.unresolved?"5 4":void 0}})):[]),p=oe(()=>{if(!n.payload)return[];const _=n.payload.nodes.map(y=>({id:y.id,type:y.kind,data:{...y,showPrdLabel:y.kind==="task"?n.scope==="repo":void 0},draggable:!1,selectable:y.kind==="task",connectable:!1,position:{x:0,y:0}}));return h(_,f.value)});function v(_){const b=_.node.data;!b||b.kind!=="task"||o("taskClick",{prdSlug:b.prdSlug,taskId:b.taskId})}return(_,y)=>(j(),ee("div",nx,[e.loading?(j(),ee("div",ox,[X("div",rx,[ie(S(Jr),{class:"size-5 animate-spin"}),y[0]||(y[0]=X("span",null,"Building graph...",-1))])])):e.error?(j(),ee("div",ix,[X("div",sx,[ie(S(Mo),{class:"mx-auto mb-3 size-8 text-destructive"}),y[1]||(y[1]=X("p",{class:"text-sm font-medium"},"Graph unavailable",-1)),X("p",ax,ge(e.error),1)])])):!e.payload||!S(l)?(j(),ee("div",lx,[X("div",ux,[ie(S(Bc),{class:"mx-auto mb-3 size-8 text-muted-foreground/60"}),y[2]||(y[2]=X("p",{class:"text-sm font-medium"},"No graphable tasks yet",-1)),X("p",cx,ge(e.scope==="repo"?"No PRDs with task state were found in this repository.":"This PRD does not have generated tasks yet."),1)])])):(j(),be(S(n1),{key:S(a),nodes:S(p),edges:S(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:v},{default:pe(()=>[ie(S(d1),{gap:20,size:1.2,variant:"dots",color:"var(--border)"}),ie(S(H1),{position:"bottom-left","show-interactive":!1})]),_:1},8,["nodes","edges"])),e.payload&&S(l)?(j(),ee("div",dx,[y[7]||(y[7]=X("p",{class:"mb-1 text-[11px] font-medium uppercase tracking-wide text-muted-foreground"},"Legend",-1)),X("div",fx,[X("div",hx,[ie(S(Vn),{class:"size-3.5"}),y[3]||(y[3]=Te(" Pending ",-1))]),X("div",px,[ie(S(Za),{class:"size-3.5"}),y[4]||(y[4]=Te(" In Progress ",-1))]),X("div",gx,[ie(S(Lo),{class:"size-3.5"}),y[5]||(y[5]=Te(" Completed ",-1))]),X("div",mx,[ie(S(yn),{class:"size-3.5"}),y[6]||(y[6]=Te(" Missing dependency ",-1))])])])):ve("",!0),S(u)&&S(l)?(j(),ee("div",vx,[X("div",yx,[X("span",_x,"Total "+ge(S(u).total),1),X("span",wx,"WIP "+ge(S(u).inProgress),1),X("span",bx,"Done "+ge(S(u).completed),1),X("span",xx,"Missing "+ge(S(u).unresolved),1)])])):ve("",!0)]))}}),Gk=Object.assign(Ex,{__name:"GraphExplorer"}),kx={class:"space-y-0.5 p-2"},Sx=["onClick"],Cx={class:"min-w-0 flex-1"},Nx=["title"],Tx={class:"text-muted-foreground"},Px={class:"mt-1 flex h-1.5 w-full overflow-hidden rounded-full bg-muted"},Ax={class:"flex shrink-0 items-center gap-1 text-xs"},Ix={key:0,class:"text-green-600 dark:text-green-400"},Ox={key:1,class:"text-red-600 dark:text-red-400"},Rx={key:0,class:"py-4 text-center text-sm text-muted-foreground"},Mx=ye({__name:"ChangesMinimap",props:{files:{},selectedFile:{}},emits:["select"],setup(e,{emit:t}){const n=e,o=t,r=oe(()=>n.files.length===0?1:Math.max(...n.files.map(c=>c.additions+c.deletions),1));function i(c){switch(c){case"added":return{icon:ud,class:"text-green-600 dark:text-green-400"};case"deleted":return{icon:cd,class:"text-red-600 dark:text-red-400"};case"renamed":return{icon:ds,class:"text-blue-600 dark:text-blue-400"};default:return{icon:ld,class:"text-yellow-600 dark:text-yellow-400"}}}function s(c){const d=c.additions+c.deletions;if(d===0)return{additions:0,deletions:0,total:0};const h=d/r.value*100,f=c.additions/d*h,p=c.deletions/d*h;return{additions:f,deletions:p,total:h}}function a(c){return c.status==="renamed"&&c.oldPath?`${c.oldPath} → ${c.path}`:c.path}function l(c){return c.split("/").pop()||c}function u(c){o("select",c)}return(c,d)=>(j(),ee("div",kx,[(j(!0),ee(Oe,null,rt(e.files,h=>(j(),ee("button",{key:h.path,class:He(["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=>u(h.path)},[(j(),be(ot(i(h.status).icon),{class:He(["size-4 shrink-0",i(h.status).class])},null,8,["class"])),X("div",Cx,[X("div",{class:He(["truncate text-xs",{"font-medium":e.selectedFile===h.path}]),title:a(h)},[h.status==="renamed"&&h.oldPath?(j(),ee(Oe,{key:0},[X("span",Tx,ge(l(h.oldPath)),1),ie(S(ds),{class:"mx-1 inline size-3 text-muted-foreground"}),X("span",null,ge(l(h.path)),1)],64)):(j(),ee(Oe,{key:1},[Te(ge(h.path),1)],64))],10,Nx),X("div",Px,[s(h).additions>0?(j(),ee("div",{key:0,class:"bg-green-500 dark:bg-green-400",style:Xe({width:`${s(h).additions}%`})},null,4)):ve("",!0),s(h).deletions>0?(j(),ee("div",{key:1,class:"bg-red-500 dark:bg-red-400",style:Xe({width:`${s(h).deletions}%`})},null,4)):ve("",!0)])]),X("div",Ax,[h.additions>0?(j(),ee("span",Ix," +"+ge(h.additions),1)):ve("",!0),h.deletions>0?(j(),ee("span",Ox," -"+ge(h.deletions),1)):ve("",!0)])],10,Sx))),128)),e.files.length===0?(j(),ee("div",Rx," No files changed ")):ve("",!0)]))}}),Lx=Object.assign(Mx,{__name:"GitChangesMinimap"}),ic=[{id:"angular-html",name:"Angular HTML",import:(()=>J(()=>import("./DxNHbxmM.js").then(e=>e.f),__vite__mapDeps([0,1,2,3]),import.meta.url))},{id:"angular-ts",name:"Angular TypeScript",import:(()=>J(()=>import("./Cl0AqbOI.js"),__vite__mapDeps([4,0,1,2,3,5]),import.meta.url))},{id:"astro",name:"Astro",import:(()=>J(()=>import("./DxSwrfjg.js"),__vite__mapDeps([6,7,2,8,3,9,10]),import.meta.url))},{id:"blade",name:"Blade",import:(()=>J(()=>import("./5X7smno1.js"),__vite__mapDeps([11,12,1,2,3,13,14,15,7]),import.meta.url))},{id:"c",name:"C",import:(()=>J(()=>import("./BIGW1oBm.js"),[],import.meta.url))},{id:"coffee",name:"CoffeeScript",aliases:["coffeescript"],import:(()=>J(()=>import("./CxbxFI8M.js"),__vite__mapDeps([16,2]),import.meta.url))},{id:"cpp",name:"C++",aliases:["c++"],import:(()=>J(()=>import("./Bp3cYrEr.js"),__vite__mapDeps([17,18,19,20,15]),import.meta.url))},{id:"css",name:"CSS",import:(()=>J(()=>import("./DPfMkruS.js"),[],import.meta.url))},{id:"csv",name:"CSV",import:(()=>J(()=>import("./fuZLfV_i.js"),[],import.meta.url))},{id:"glsl",name:"GLSL",import:(()=>J(()=>import("./DZxFcAj9.js"),__vite__mapDeps([19,20]),import.meta.url))},{id:"graphql",name:"GraphQL",aliases:["gql"],import:(()=>J(()=>import("./C9oPPf7i.js"),__vite__mapDeps([21,2,8,22,10]),import.meta.url))},{id:"haml",name:"Ruby Haml",import:(()=>J(()=>import("./CmIQRyeF.js"),__vite__mapDeps([23,2,3]),import.meta.url))},{id:"handlebars",name:"Handlebars",aliases:["hbs"],import:(()=>J(()=>import("./m17aaUwq.js"),__vite__mapDeps([24,1,2,3,25]),import.meta.url))},{id:"html",name:"HTML",import:(()=>J(()=>import("./CnnebwVN.js"),__vite__mapDeps([1,2,3]),import.meta.url))},{id:"html-derivative",name:"HTML (Derivative)",import:(()=>J(()=>import("./DGP4VlC8.js"),__vite__mapDeps([12,1,2,3]),import.meta.url))},{id:"http",name:"HTTP",import:(()=>J(()=>import("./CufHLc7y.js"),__vite__mapDeps([26,27,7,13,14,21,2,8,22,10]),import.meta.url))},{id:"hurl",name:"Hurl",import:(()=>J(()=>import("./CYsAdtH9.js"),__vite__mapDeps([28,21,2,8,22,10,13,14,29]),import.meta.url))},{id:"imba",name:"Imba",import:(()=>J(()=>import("./DGztddWO.js"),[],import.meta.url))},{id:"java",name:"Java",import:(()=>J(()=>import("./CylS5w8V.js"),[],import.meta.url))},{id:"javascript",name:"JavaScript",aliases:["js","cjs","mjs"],import:(()=>J(()=>import("./wDzz0qaB.js"),[],import.meta.url))},{id:"jinja",name:"Jinja",import:(()=>J(()=>import("./CXZktZb0.js"),__vite__mapDeps([30,1,2,3]),import.meta.url))},{id:"jison",name:"Jison",import:(()=>J(()=>import("./Br6cN0cg.js"),__vite__mapDeps([31,2]),import.meta.url))},{id:"json",name:"JSON",import:(()=>J(()=>import("./Cp-IABpG.js"),[],import.meta.url))},{id:"json5",name:"JSON5",import:(()=>J(()=>import("./C9tS-k6U.js"),[],import.meta.url))},{id:"jsonc",name:"JSON with Comments",import:(()=>J(()=>import("./Des-eS-w.js"),[],import.meta.url))},{id:"jsonl",name:"JSON Lines",import:(()=>J(()=>import("./DcaNXYhu.js"),[],import.meta.url))},{id:"jsx",name:"JSX",import:(()=>J(()=>import("./g9-lgVsj.js"),[],import.meta.url))},{id:"julia",name:"Julia",aliases:["jl"],import:(()=>J(()=>import("./W9tJ9s81.js"),__vite__mapDeps([32,17,18,19,20,15,33,2,34]),import.meta.url))},{id:"less",name:"Less",import:(()=>J(()=>import("./B1dDrJ26.js"),[],import.meta.url))},{id:"markdown",name:"Markdown",aliases:["md"],import:(()=>J(()=>import("./Cvjx9yec.js"),[],import.meta.url))},{id:"marko",name:"Marko",import:(()=>J(()=>import("./83L43bj1.js"),__vite__mapDeps([35,3,36,5,8]),import.meta.url))},{id:"mdc",name:"MDC",import:(()=>J(()=>import("./TsXTqZ29.js"),__vite__mapDeps([37,38,25,12,1,2,3]),import.meta.url))},{id:"mdx",name:"MDX",import:(()=>J(()=>import("./Cmh6b_Ma.js"),[],import.meta.url))},{id:"php",name:"PHP",import:(()=>J(()=>import("./DJjDtW9f.js"),__vite__mapDeps([39,1,2,3,13,14,15,7]),import.meta.url))},{id:"postcss",name:"PostCSS",import:(()=>J(()=>import("./CXtECtnM.js"),[],import.meta.url))},{id:"pug",name:"Pug",aliases:["jade"],import:(()=>J(()=>import("./BLmx8bSh.js"),__vite__mapDeps([40,2,3,1]),import.meta.url))},{id:"python",name:"Python",aliases:["py"],import:(()=>J(()=>import("./B6aJPvgy.js"),[],import.meta.url))},{id:"r",name:"R",import:(()=>J(()=>import("./Dspwwk_N.js"),[],import.meta.url))},{id:"regexp",name:"RegExp",aliases:["regex"],import:(()=>J(()=>import("./CDVJQ6XC.js"),[],import.meta.url))},{id:"sass",name:"Sass",import:(()=>J(()=>import("./Cj5Yp3dK.js"),[],import.meta.url))},{id:"scss",name:"SCSS",import:(()=>J(()=>import("./2EtD6e53.js"),__vite__mapDeps([5,3]),import.meta.url))},{id:"shellscript",name:"Shell",aliases:["bash","sh","shell","zsh"],import:(()=>J(()=>import("./Yzrsuije.js"),[],import.meta.url))},{id:"sql",name:"SQL",import:(()=>J(()=>import("./BLtJtn59.js"),[],import.meta.url))},{id:"stylus",name:"Stylus",aliases:["styl"],import:(()=>J(()=>import("./BEDo0Tqx.js"),[],import.meta.url))},{id:"svelte",name:"Svelte",import:(()=>J(()=>import("./DYoxhk2S.js"),__vite__mapDeps([41,2,8,3,9]),import.meta.url))},{id:"ts-tags",name:"TypeScript with Tags",aliases:["lit"],import:(()=>J(()=>import("./Cm3UrAx6.js"),__vite__mapDeps([42,8,3,2,19,20,1,15,13,14]),import.meta.url))},{id:"tsx",name:"TSX",import:(()=>J(()=>import("./COt5Ahok.js"),[],import.meta.url))},{id:"typescript",name:"TypeScript",aliases:["ts","cts","mts"],import:(()=>J(()=>import("./BPQ3VLAy.js"),[],import.meta.url))},{id:"vue",name:"Vue",import:(()=>J(()=>import("./DEthMvLe.js"),__vite__mapDeps([43,3,2,8,7,1,12]),import.meta.url))},{id:"vue-html",name:"Vue HTML",import:(()=>J(()=>import("./DqQDbK_p.js"),__vite__mapDeps([44,2]),import.meta.url))},{id:"vue-vine",name:"Vue Vine",import:(()=>J(()=>import("./CW8IKDeL.js"),__vite__mapDeps([45,3,5,36,46,9,2]),import.meta.url))},{id:"wasm",name:"WebAssembly",import:(()=>J(()=>import("./MzD3tlZU.js"),[],import.meta.url))},{id:"wgsl",name:"WGSL",import:(()=>J(()=>import("./Dx-B1_4e.js"),[],import.meta.url))},{id:"wit",name:"WebAssembly Interface Types",import:(()=>J(()=>import("./5i3qLPDT.js"),[],import.meta.url))},{id:"xml",name:"XML",import:(()=>J(()=>import("./BGJmEYvX.js"),__vite__mapDeps([13,14]),import.meta.url))},{id:"yaml",name:"YAML",aliases:["yml"],import:(()=>J(()=>import("./Buea-lGh.js"),[],import.meta.url))}],Dx=Object.fromEntries(ic.map(e=>[e.id,e.import])),$x=Object.fromEntries(ic.flatMap(e=>e.aliases?.map(t=>[t,e.import])||[])),Bx={...Dx,...$x},zx=om({langs:Bx,themes:am,engine:()=>km(J(()=>import("./CG6Dc4jp.js"),[],import.meta.url))}),{codeToHtml:Da}=im(zx,{guessEmbeddedLanguages:yg}),Vx={class:"diff-viewer"},Fx={key:0,class:"flex items-center justify-center py-8"},Hx={key:1,class:"flex flex-col items-center justify-center gap-3 py-12 text-muted-foreground"},Gx={key:2,class:"flex flex-col items-center justify-center gap-3 py-12 text-muted-foreground"},jx={key:3,class:"diff-container"},qx={class:"flex flex-col items-center justify-center gap-3 border-b border-border bg-muted/30 py-6"},Ux={class:"text-center"},Wx={class:"text-sm text-muted-foreground"},Yx={key:4,class:"diff-container"},Xx={class:"full-file-view"},Kx={class:"diff-gutter"},Zx={class:"line-number"},Jx={class:"diff-content"},Qx=["innerHTML"],eE={key:5,class:"diff-container"},tE={class:"diff-toolbar"},nE={class:"diff-split"},oE={class:"diff-column-content"},rE={key:0,class:"diff-separator-half"},iE={class:"diff-gutter"},sE={key:0,class:"line-number"},aE={class:"diff-content"},lE=["innerHTML"],uE={class:"diff-column-content"},cE={key:0,class:"diff-separator-half"},dE={class:"diff-gutter"},fE={key:0,class:"line-number"},hE={class:"diff-content"},pE=["innerHTML"],$a=1e4,gE=ye({__name:"DiffViewer",props:{hunks:{},filePath:{},binary:{type:Boolean},oldPath:{},fileContent:{},showFullFile:{type:Boolean},isLoadingContent:{type:Boolean}},setup(e){const t=e,n=fe(!1),o=fe(!0),r=fe(null),i=fe(null),s=fe(!1);function a(P){if(!o.value||s.value)return;const C=P.target;i.value&&(s.value=!0,i.value.scrollLeft=C.scrollLeft,requestAnimationFrame(()=>{s.value=!1}))}function l(P){if(!o.value||s.value)return;const C=P.target;r.value&&(s.value=!0,r.value.scrollLeft=C.scrollLeft,requestAnimationFrame(()=>{s.value=!1}))}const u=oe(()=>{let P=0;for(const C of t.hunks)P+=C.lines.length;return P}),c=oe(()=>u.value>$a),d=oe(()=>t.hunks.length===0&&!t.binary),h=oe(()=>{const P=new Set,C=new Set;for(const x of t.hunks)for(const N of x.lines)N.type==="add"&&N.newNumber!==void 0&&P.add(N.newNumber),N.type==="remove"&&N.oldNumber!==void 0&&C.add(N.oldNumber);return{added:P,removed:C}}),f=oe(()=>t.fileContent?t.fileContent.split(`
39
- `):[]);function p(P){const C=P.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"}[C]||"text"}const v=oe(()=>p(t.filePath)),_=fe(new Map),y=fe(!0),b=oe(()=>{const P=[];for(let C=0;C<t.hunks.length;C++){const x=t.hunks[C];C>0&&P.push({type:"separator",hunkIndex:C});const N=x.lines;let m=0;for(;m<N.length;){const A=N[m];if(A.type==="context")P.push({type:"line",pair:{id:`${C}-${m}`,left:{lineNum:A.oldNumber,content:A.content,type:"context"},right:{lineNum:A.newNumber,content:A.content,type:"context"}}}),m++;else if(A.type==="remove"){const k=[],O=[];for(;m<N.length&&N[m].type==="remove";)k.push(N[m]),m++;for(;m<N.length&&N[m].type==="add";)O.push(N[m]),m++;const L=Math.max(k.length,O.length);for(let F=0;F<L;F++){const G=k[F],U=O[F];P.push({type:"line",pair:{id:`${C}-${m-L+F}`,left:G?{lineNum:G.oldNumber,content:G.content,type:"remove"}:{content:"",type:"empty"},right:U?{lineNum:U.newNumber,content:U.content,type:"add"}:{content:"",type:"empty"}}})}}else A.type==="add"&&P.push({type:"line",pair:{id:`${C}-${m}`,left:{content:"",type:"empty"},right:{lineNum:A.newNumber,content:A.content,type:"add"}}}),m++}}return P});async function g(P,C){if(!P.trim())return"";try{const N=(await Da(P,{lang:C,themes:{light:"catppuccin-latte",dark:"catppuccin-mocha"}})).match(/<code[^>]*>([\s\S]*?)<\/code>/);return N?N[1]||"":T(P)}catch{return T(P)}}async function w(P,C){if(!P)return[];try{const N=(await Da(P,{lang:C,themes:{light:"catppuccin-latte",dark:"catppuccin-mocha"}})).match(/<code[^>]*>([\s\S]*?)<\/code>/);return!N||!N[1]?P.split(`
40
- `).map(T):N[1].split(`
41
- `)}catch{return P.split(`
42
- `).map(T)}}function T(P){return P.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#039;")}const M=fe([]),z=fe(!1);Ee(()=>[t.fileContent,t.filePath],async([P])=>{if(!P){M.value=[];return}z.value=!0;const C=v.value;M.value=await w(P,C),z.value=!1},{immediate:!0}),Ee(()=>[t.hunks,t.filePath,M.value],async()=>{y.value=!0;const P=v.value,C=new Map,x=M.value,N=[];for(const A of b.value)if(A.type==="line"&&A.pair){if(A.pair.left.content&&A.pair.left.type!=="empty"){const k=`${A.pair.id}-old`;if(A.pair.left.type==="context"&&A.pair.left.lineNum&&x.length>0){const O=A.pair.right.lineNum?A.pair.right.lineNum-1:-1;O>=0&&O<x.length?C.set(k,x[O]||""):N.push({key:k,content:A.pair.left.content})}else N.push({key:k,content:A.pair.left.content})}if(A.pair.right.content&&A.pair.right.type!=="empty"){const k=`${A.pair.id}-new`,O=A.pair.right.lineNum;O&&x.length>0&&O<=x.length?C.set(k,x[O-1]||""):N.push({key:k,content:A.pair.right.content})}}const m=50;for(let A=0;A<N.length;A+=m){const k=N.slice(A,A+m),O=await Promise.all(k.map(async({key:L,content:F})=>{const G=await g(F,P);return{key:L,result:G}}));for(const{key:L,result:F}of O)C.set(L,F)}_.value=C,y.value=!1},{immediate:!0});function H(P,C){return _.value.get(`${P}-${C}`)||""}function K(P){return h.value.added.has(P)?"add":"context"}return(P,C)=>(j(),ee("div",Vx,[(S(y)||e.isLoadingContent||S(z))&&!e.binary?(j(),ee("div",Fx,[...C[2]||(C[2]=[X("div",{class:"size-6 animate-spin rounded-full border-2 border-primary border-t-transparent"},null,-1)])])):e.binary?(j(),ee("div",Hx,[ie(S(ad),{class:"size-10 opacity-50"}),C[3]||(C[3]=X("div",{class:"text-center"},[X("p",{class:"font-medium"},"Binary file"),X("p",{class:"text-sm"},"This file cannot be displayed as a diff")],-1))])):S(d)&&!e.showFullFile?(j(),ee("div",Gx,[ie(S(yn),{class:"size-10 opacity-50"}),C[4]||(C[4]=X("div",{class:"text-center"},[X("p",{class:"font-medium"},"No changes"),X("p",{class:"text-sm"},"This file was touched but has no content changes")],-1))])):S(c)&&!S(n)&&!e.showFullFile?(j(),ee("div",jx,[X("div",qx,[ie(S(yn),{class:"size-8 text-yellow-500"}),X("div",Ux,[C[5]||(C[5]=X("p",{class:"font-medium"},"Large file",-1)),X("p",Wx," This file has "+ge(S(u).toLocaleString())+" lines (threshold: "+ge($a.toLocaleString())+") ",1)]),ie(S(Bt),{variant:"outline",size:"sm",onClick:C[0]||(C[0]=x=>n.value=!0)},{default:pe(()=>[ie(S(zc),{class:"mr-2 size-4"}),C[6]||(C[6]=Te(" Show full diff ",-1))]),_:1})])])):e.showFullFile&&e.fileContent?(j(),ee("div",Yx,[X("div",Xx,[(j(!0),ee(Oe,null,rt(S(f),(x,N)=>(j(),ee("div",{key:N,class:He(["full-file-line",{"diff-add":K(N+1)==="add"}])},[X("div",Kx,[X("span",Zx,ge(N+1),1)]),X("div",Jx,[X("span",{class:"diff-code",innerHTML:S(M)[N]||T(x)},null,8,Qx)])],2))),128))])])):(j(),ee("div",eE,[X("div",tE,[ie(S(Bt),{variant:"ghost",size:"sm",class:He(["h-7 gap-1.5 text-xs",{"text-primary":S(o)}]),onClick:C[1]||(C[1]=x=>o.value=!S(o))},{default:pe(()=>[(j(),be(ot(S(o)?S(gd):S(hd)),{class:"size-3.5"})),Te(" "+ge(S(o)?"Sync scroll":"Scroll unlocked"),1)]),_:1},8,["class"])]),X("div",nE,[X("div",{ref_key:"leftScrollRef",ref:r,class:"diff-column diff-column-left",onScroll:a},[X("div",oE,[(j(!0),ee(Oe,null,rt(S(b),x=>(j(),ee(Oe,{key:x.type==="line"?`left-${x.pair?.id}`:`left-sep-${x.hunkIndex}`},[x.type==="separator"?(j(),ee("div",rE,[...C[7]||(C[7]=[X("div",{class:"separator-line"},null,-1),X("span",{class:"separator-text"},"···",-1)])])):x.pair?(j(),ee("div",{key:1,class:He(["diff-line",{"diff-remove":x.pair.left.type==="remove","diff-empty":x.pair.left.type==="empty","diff-context":x.pair.left.type==="context"}])},[X("div",iE,[x.pair.left.lineNum?(j(),ee("span",sE,ge(x.pair.left.lineNum),1)):ve("",!0)]),X("div",aE,[x.pair.left.type!=="empty"?(j(),ee("span",{key:0,class:"diff-code",innerHTML:H(x.pair.id,"old")||T(x.pair.left.content)},null,8,lE)):ve("",!0)])],2)):ve("",!0)],64))),128))])],544),X("div",{ref_key:"rightScrollRef",ref:i,class:"diff-column diff-column-right",onScroll:l},[X("div",uE,[(j(!0),ee(Oe,null,rt(S(b),x=>(j(),ee(Oe,{key:x.type==="line"?`right-${x.pair?.id}`:`right-sep-${x.hunkIndex}`},[x.type==="separator"?(j(),ee("div",cE,[...C[8]||(C[8]=[X("span",{class:"separator-text"},"···",-1),X("div",{class:"separator-line"},null,-1)])])):x.pair?(j(),ee("div",{key:1,class:He(["diff-line",{"diff-add":x.pair.right.type==="add","diff-empty":x.pair.right.type==="empty","diff-context":x.pair.right.type==="context"}])},[X("div",dE,[x.pair.right.lineNum?(j(),ee("span",fE,ge(x.pair.right.lineNum),1)):ve("",!0)]),X("div",hE,[x.pair.right.type!=="empty"?(j(),ee("span",{key:0,class:"diff-code",innerHTML:H(x.pair.id,"new")||T(x.pair.right.content)},null,8,pE)):ve("",!0)])],2)):ve("",!0)],64))),128))])],544)])]))]))}}),mE=Object.assign(Jc(gE,[["__scopeId","data-v-13d918cc"]]),{__name:"GitDiffViewer"}),vE=ye({__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=Oi(e,t);return(i,s)=>(j(),be(S(rh),tt({"data-slot":"tooltip"},S(r)),{default:pe(a=>[ke(i.$slots,"default",lr(ur(a)))]),_:3},16))}}),Ba=Object.assign(vE,{__name:"UiTooltip"}),yE=ye({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=Ga(n,"class"),i=Oi(r,o);return(s,a)=>(j(),be(S(dh),null,{default:pe(()=>[ie(S(uh),tt({"data-slot":"tooltip-content"},{...S(i),...s.$attrs},{class:S(ja)("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:pe(()=>[ke(s.$slots,"default"),ie(S(Jf),{class:"bg-foreground fill-foreground z-50 size-2.5 translate-y-[calc(-50%_-_2px)] rotate-45 rounded-[2px]"})]),_:3},16,["class"])]),_:3}))}}),za=Object.assign(yE,{__name:"UiTooltipContent"}),_E=ye({__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(),be(S(th),lr(ur(t)),{default:pe(()=>[ke(n.$slots,"default")]),_:3},16))}}),Va=Object.assign(_E,{__name:"UiTooltipProvider"}),wE=ye({__name:"TooltipTrigger",props:{reference:{},asChild:{type:Boolean},as:{}},setup(e){const t=e;return(n,o)=>(j(),be(S(hh),tt({"data-slot":"tooltip-trigger"},t),{default:pe(()=>[ke(n.$slots,"default")]),_:3},16))}}),Fa=Object.assign(wE,{__name:"UiTooltipTrigger"});function sc(){const{showError:e}=vc();function t(c){if(c&&typeof c=="object"){const d=c;return d.data?.message||d.data?.statusMessage||d.message||"Unknown error"}return"Unknown error"}const n=fe(!1),o=fe(!1),r=fe(!1),i=fe(!1);async function s(c,d,h){if(!c||d.length===0)return{commits:[],failedShas:[]};n.value=!0;try{const f={shas:d.join(",")};h&&(f.repo=h);const p=await $fetch(`/api/repos/${c}/git/commits`,{query:f}),v=p.map(y=>y.shortSha),_=d.filter(y=>!v.some(b=>b.startsWith(y)||y.startsWith(b)));return{commits:p,failedShas:_}}catch(f){return e("Failed to fetch commits",t(f)),{commits:[],failedShas:d}}finally{n.value=!1}}async function a(c,d,h){if(!c||!d)return[];o.value=!0;try{const f={commit:d};return h&&(f.repo=h),await $fetch(`/api/repos/${c}/git/diff`,{query:f})}catch(f){return e("Failed to fetch diff",t(f)),[]}finally{o.value=!1}}async function l(c,d,h,f){if(!c||!d||!h)return[];r.value=!0;try{const p={commit:d,file:h};return f&&(p.repo=f),await $fetch(`/api/repos/${c}/git/file-diff`,{query:p})}catch(p){return e("Failed to fetch file diff",t(p)),[]}finally{r.value=!1}}async function u(c,d,h,f){if(!c||!d||!h)return null;i.value=!0;try{const p={commit:d,file:h};return f&&(p.repo=f),(await $fetch(`/api/repos/${c}/git/file-content`,{query:p})).content}catch(p){return e("Failed to fetch file content",t(p)),null}finally{i.value=!1}}return{fetchCommits:s,fetchDiff:a,fetchFileDiff:l,fetchFileContent:u,isLoadingCommits:Mn(n),isLoadingDiff:Mn(o),isLoadingFileDiff:Mn(r),isLoadingFileContent:Mn(i)}}const bE={key:0,class:"flex flex-1 flex-col items-center justify-center gap-4 p-8"},xE={class:"text-center"},EE={class:"text-sm text-muted-foreground"},kE={key:1,class:"flex flex-1 items-center justify-center"},SE={key:2,class:"flex flex-1 flex-col items-center justify-center gap-2 p-8 text-center text-muted-foreground"},CE={key:3,class:"flex min-h-0 flex-1 overflow-hidden"},NE={class:"flex w-56 shrink-0 flex-col border-r border-border"},TE={class:"flex items-center justify-between border-b border-border px-3 py-2"},PE={class:"text-xs font-medium text-muted-foreground"},AE={class:"text-muted-foreground/50 transition-colors hover:text-muted-foreground"},IE={class:"min-h-0 flex-1 overflow-y-auto"},OE={class:"flex min-h-0 flex-1 flex-col overflow-hidden"},RE={key:0,class:"flex items-center gap-2 border-b border-border px-4 py-2"},ME={key:0,class:"min-w-0 flex-1 truncate font-mono text-sm"},LE={class:"text-muted-foreground"},DE={key:1,class:"min-w-0 flex-1 truncate font-mono text-sm"},$E={key:2,class:"rounded bg-yellow-500/10 px-1.5 py-0.5 text-xs text-yellow-600 dark:text-yellow-400"},BE={key:1,class:"flex flex-1 items-center justify-center"},zE={key:2,class:"flex flex-1 flex-col items-center justify-center gap-4 p-8"},VE={class:"text-center"},FE={class:"text-xs text-muted-foreground"},HE={key:4,class:"flex flex-1 items-center justify-center text-sm text-muted-foreground"},GE=ye({__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:u}=sc(),c=fe([]),d=fe(),h=fe([]),f=fe(null),p=fe(null),v=fe(null),_=fe("changes"),y=oe(()=>c.value.find(N=>N.path===d.value));async function b(){p.value=null,c.value=[],d.value=void 0,h.value=[];const N=await r(n.repoId,n.commitSha,n.repoPath);N.length===0&&!a.value&&(p.value=null),c.value=N,N.length>0&&(d.value=N[0].path)}async function g(){if(!d.value){h.value=[],f.value=null;return}v.value=null;const N=await i(n.repoId,n.commitSha,d.value,n.repoPath);if(h.value=N,_.value==="full"){const m=await s(n.repoId,n.commitSha,d.value,n.repoPath);f.value=m}}function w(){_.value=_.value==="changes"?"full":"changes"}Ee(_,async N=>{if(N==="full"&&d.value&&!f.value){const m=await s(n.repoId,n.commitSha,d.value,n.repoPath);f.value=m}});function T(N){d.value=N}function M(){b()}function z(){g()}Ee(d,()=>{g()}),Ee(()=>[n.repoId,n.commitSha,n.repoPath],()=>{b()},{immediate:!0});const H=fe(null),K=fe(null);function P(N){if(c.value.length===0)return;const m=d.value?c.value.findIndex(O=>O.path===d.value):-1;let A;N==="next"?A=m<c.value.length-1?m+1:0:A=m>0?m-1:c.value.length-1;const k=c.value[A];k&&(d.value=k.path)}function C(N){if(!K.value)return;const m=K.value.querySelectorAll(".diff-separator");if(m.length===0)return;const A=K.value.closest(".overflow-y-auto, [data-radix-scroll-area-viewport]");if(!A)return;const k=A.scrollTop,O=A.getBoundingClientRect();let L=null;if(N==="next"){for(const F of m)if(F.getBoundingClientRect().top-O.top+k>k+50){L=F;break}!L&&m.length>0&&(L=m[0])}else{for(let F=m.length-1;F>=0;F--){const G=m[F];if(G.getBoundingClientRect().top-O.top+k<k-10){L=G;break}}!L&&m.length>0&&(L=m[m.length-1])}L&&L.scrollIntoView({behavior:"smooth",block:"start"})}function x(N){if(!(N.target instanceof HTMLInputElement||N.target instanceof HTMLTextAreaElement))switch(N.key){case"j":case"ArrowDown":!N.ctrlKey&&!N.metaKey&&(N.preventDefault(),P("next"));break;case"k":case"ArrowUp":!N.ctrlKey&&!N.metaKey&&(N.preventDefault(),P("prev"));break;case"[":N.preventDefault(),C("prev");break;case"]":N.preventDefault(),C("next");break;case"Escape":N.preventDefault(),o("close");break}}return it(()=>{document.addEventListener("keydown",x)}),Wa(()=>{document.removeEventListener("keydown",x)}),(N,m)=>{const A=Lx,k=mE;return j(),ee("div",{ref_key:"panelRef",ref:H,class:"flex h-full flex-col overflow-hidden",tabindex:"-1"},[S(p)?(j(),ee("div",bE,[ie(S(Mo),{class:"size-12 text-destructive"}),X("div",xE,[m[0]||(m[0]=X("p",{class:"font-medium"},"Failed to load diff",-1)),X("p",EE,ge(S(p)),1)]),ie(S(Bt),{variant:"outline",size:"sm",onClick:M},{default:pe(()=>[ie(S(cs),{class:"mr-2 size-4"}),m[1]||(m[1]=Te(" Retry ",-1))]),_:1})])):S(a)&&S(c).length===0?(j(),ee("div",kE,[ie(S(Jr),{class:"size-8 animate-spin text-muted-foreground"})])):S(c).length===0?(j(),ee("div",SE,[...m[2]||(m[2]=[X("p",null,"No files changed in this commit",-1)])])):(j(),ee("div",CE,[X("div",NE,[X("div",TE,[X("span",PE,ge(S(c).length)+" file"+ge(S(c).length!==1?"s":"")+" changed ",1),ie(S(Va),null,{default:pe(()=>[ie(S(Ba),null,{default:pe(()=>[ie(S(Fa),{"as-child":""},{default:pe(()=>[X("button",AE,[ie(S(Vc),{class:"size-3.5"})])]),_:1}),ie(S(za),{side:"bottom",align:"end",class:"max-w-xs"},{default:pe(()=>[...m[3]||(m[3]=[X("div",{class:"space-y-1 text-xs"},[X("div",{class:"flex justify-between gap-4"},[X("span",{class:"text-muted-foreground"},"Navigate files"),X("span",{class:"font-mono"},"j/k or ↑/↓")]),X("div",{class:"flex justify-between gap-4"},[X("span",{class:"text-muted-foreground"},"Jump to hunk"),X("span",{class:"font-mono"},"[ / ]")]),X("div",{class:"flex justify-between gap-4"},[X("span",{class:"text-muted-foreground"},"Close"),X("span",{class:"font-mono"},"Esc")])],-1)])]),_:1})]),_:1})]),_:1})]),X("div",IE,[ie(A,{files:S(c),"selected-file":S(d),onSelect:T},null,8,["files","selected-file"])])]),X("div",OE,[S(d)?(j(),ee("div",RE,[S(y)?.oldPath?(j(),ee("span",ME,[X("span",LE,ge(S(y).oldPath),1),m[4]||(m[4]=X("span",{class:"mx-2 text-muted-foreground"},"→",-1)),X("span",null,ge(S(d)),1)])):(j(),ee("span",DE,ge(S(d)),1)),S(y)?.binary?(j(),ee("span",$E," binary ")):ve("",!0),S(y)?.binary?ve("",!0):(j(),be(S(Va),{key:3},{default:pe(()=>[ie(S(Ba),null,{default:pe(()=>[ie(S(Fa),{"as-child":""},{default:pe(()=>[ie(S(Bt),{variant:"ghost",size:"sm",class:"h-7 shrink-0 gap-1.5 text-xs",onClick:w},{default:pe(()=>[(j(),be(ot(S(_)==="changes"?S(sd):S(id)),{class:"size-3.5"})),Te(" "+ge(S(_)==="changes"?"Changes":"Full file"),1)]),_:1})]),_:1}),ie(S(za),null,{default:pe(()=>[Te(ge(S(_)==="changes"?"Show full file with changes":"Show changes only"),1)]),_:1})]),_:1})]),_:1}))])):ve("",!0),S(l)?(j(),ee("div",BE,[ie(S(Jr),{class:"size-6 animate-spin text-muted-foreground"})])):S(v)?(j(),ee("div",zE,[ie(S(Mo),{class:"size-8 text-destructive"}),X("div",VE,[m[5]||(m[5]=X("p",{class:"text-sm font-medium"},"Failed to load file diff",-1)),X("p",FE,ge(S(v)),1)]),ie(S(Bt),{variant:"outline",size:"sm",onClick:z},{default:pe(()=>[ie(S(cs),{class:"mr-2 size-4"}),m[6]||(m[6]=Te(" Retry ",-1))]),_:1})])):S(d)?(j(),be(S(Fc),{key:3,class:"h-0 flex-1 overflow-hidden"},{default:pe(()=>[X("div",{ref_key:"diffViewerRef",ref:K},[ie(k,{hunks:S(h),"file-path":S(d),binary:S(y)?.binary,"old-path":S(y)?.oldPath,"file-content":S(f),"show-full-file":S(_)==="full","is-loading-content":S(u)},null,8,["hunks","file-path","binary","old-path","file-content","show-full-file","is-loading-content"])],512)]),_:1})):(j(),ee("div",HE," Select a file to view changes "))])]))],512)}}}),jE=Object.assign(GE,{__name:"GitDiffPanel"}),qE={class:"space-y-2"},UE={key:1,class:"rounded-lg border border-dashed p-4 text-center text-sm text-muted-foreground"},WE=["onClick"],YE={class:"flex items-start gap-3"},XE={class:"min-w-0 flex-1"},KE={class:"flex flex-wrap items-center gap-2"},ZE={class:"font-mono text-xs font-medium text-primary"},JE={class:"flex items-center gap-1 text-xs text-muted-foreground"},QE={class:"flex items-center gap-0.5 text-xs text-green-600 dark:text-green-400"},ek={class:"flex items-center gap-0.5 text-xs text-red-600 dark:text-red-400"},tk={class:"mt-1 truncate text-sm"},nk={key:1,class:"flex items-center gap-1 text-muted-foreground"},ok={key:2,class:"text-muted-foreground"},rk={key:0,class:"mt-1 text-xs text-muted-foreground"},ik=ye({__name:"CommitList",props:{commits:{},repoId:{}},emits:["select"],setup(e,{emit:t}){const n=e,o=t,{fetchCommits:r,isLoadingCommits:i}=sc(),s=fe(new Map),a=fe(new Set),l=oe(()=>new Set(n.commits.map(p=>p.repo).filter(Boolean)).size>1);Ee(()=>({commits:n.commits,repoId:n.repoId}),async({commits:f,repoId:p})=>{if(f.length===0||!p){s.value=new Map,a.value=new Set;return}const v=new Map;for(const g of f){const w=g.repo||"";v.has(w)||v.set(w,[]),v.get(w).push(g.sha)}const _=await Promise.all(Array.from(v.entries()).map(async([g,w])=>{const T=await r(p,w,g||void 0);return{commits:T.commits.map(M=>({...M,repoPath:g})),failedShas:T.failedShas}})),y=new Map,b=new Set;for(const{commits:g,failedShas:w}of _){for(const T of g)y.set(T.shortSha,T);for(const T of w)b.add(T)}s.value=y,a.value=b},{immediate:!0});function u(f){const p=new Date(f),_=new Date().getTime()-p.getTime(),y=Math.floor(_/1e3),b=Math.floor(y/60),g=Math.floor(b/60),w=Math.floor(g/24);return y<60?"just now":b<60?`${b} minute${b===1?"":"s"} ago`:g<24?`${g} hour${g===1?"":"s"} ago`:w<7?`${w} day${w===1?"":"s"} ago`:p.toLocaleDateString()}function c(f){o("select",f.sha,f.repo)}function d(f){const p=s.value.get(f);if(p)return p;for(const[v,_]of s.value)if(v.startsWith(f)||f.startsWith(v))return _}function h(f){if(a.value.has(f))return!0;for(const p of a.value)if(p.startsWith(f)||f.startsWith(p))return!0;return!1}return(f,p)=>(j(),ee("div",qE,[S(i)?(j(!0),ee(Oe,{key:0},rt(Math.min(e.commits.length,3),v=>(j(),ee("div",{key:v,class:"animate-pulse rounded-lg border bg-muted/50 p-3"},[...p[0]||(p[0]=[Pc('<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",UE," No commits recorded for this task ")):(j(!0),ee(Oe,{key:2},rt(e.commits,v=>(j(),ee("button",{key:v.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:_=>c(v)},[X("div",YE,[ie(S(fd),{class:"mt-0.5 size-5 shrink-0 text-muted-foreground"}),X("div",XE,[X("div",KE,[X("code",ZE,ge(d(v.sha)?.shortSha||v.sha.substring(0,7)),1),d(v.sha)?(j(),ee(Oe,{key:0},[X("span",JE,[ie(S(yc),{class:"size-3"}),Te(" "+ge(d(v.sha).filesChanged),1)]),X("span",QE,[ie(S(Hc),{class:"size-3"}),Te(ge(d(v.sha).additions),1)]),X("span",ek,[ie(S(vd),{class:"size-3"}),Te(ge(d(v.sha).deletions),1)])],64)):ve("",!0),v.repo&&S(l)?(j(),be(S(Co),{key:1,variant:"secondary",class:"gap-1 text-xs"},{default:pe(()=>[ie(S(dd),{class:"size-3"}),Te(" "+ge(v.repo),1)]),_:2},1024)):ve("",!0)]),X("p",tk,[d(v.sha)?(j(),ee(Oe,{key:0},[Te(ge(d(v.sha).message),1)],64)):h(v.sha)?(j(),ee("span",nk,[ie(S(Mo),{class:"size-3"}),p[1]||(p[1]=Te(" Commit unavailable ",-1))])):(j(),ee("span",ok,"Loading..."))]),d(v.sha)?(j(),ee("p",rk,ge(d(v.sha).author)+" · "+ge(u(d(v.sha).date)),1)):ve("",!0)])])],8,WE))),128))]))}}),sk=Object.assign(ik,{__name:"GitCommitList"}),ak=ye({__name:"Separator",props:{orientation:{default:"horizontal"},decorative:{type:Boolean,default:!0},asChild:{type:Boolean},as:{},class:{}},setup(e){const t=e,n=Ga(t,"class");return(o,r)=>(j(),be(S(Gc),tt({"data-slot":"separator"},S(n),{class:S(ja)("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"]))}}),an=Object.assign(ak,{__name:"UiSeparator"}),lk={class:"flex items-center gap-2"},uk={key:1,class:"min-h-0 flex-1 overflow-hidden"},ck={key:2,class:"min-h-0 flex-1 space-y-4 overflow-y-auto px-6"},dk={class:"flex flex-wrap items-center gap-2"},fk={class:"space-y-2"},hk={class:"text-sm text-muted-foreground leading-relaxed"},pk={key:0,class:"space-y-2"},gk={class:"flex items-center gap-2 text-sm font-medium"},mk={class:"ml-4 list-decimal space-y-1 text-sm text-muted-foreground"},vk={key:2,class:"space-y-2"},yk={class:"flex items-center gap-2 text-sm font-medium"},_k={class:"space-y-1.5 text-sm text-muted-foreground"},wk={key:4,class:"space-y-2"},bk={class:"flex items-center gap-2 text-sm font-medium"},xk={class:"space-y-1 text-sm text-muted-foreground"},Ek={class:"font-mono text-xs"},kk={class:"space-y-2"},Sk={class:"flex items-center gap-2 text-sm font-medium"},Ck={key:6,class:"space-y-2"},Nk={class:"flex flex-col gap-1 text-xs text-muted-foreground"},Tk={key:0,class:"flex items-center gap-2"},Pk={key:1,class:"flex items-center gap-2"},Ak={key:7,class:"space-y-2"},Ik={class:"flex items-center justify-between rounded-md border border-border bg-muted/30 px-3 py-2 text-sm"},Ok={class:"text-muted-foreground"},Rk=ye({__name:"Detail",props:Ic({task:{},taskTitles:{},commits:{},repoId:{},taskPrdSlug:{},currentPrdSlug:{}},{open:{type:Boolean,default:!1},openModifiers:{}}),emits:["update:open"],setup(e){const t=e,n=Ac(e,"open"),o=oe(()=>{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=oe(()=>{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=oe(()=>{if(!t.task)return{label:"",icon:Vn,class:""};switch(t.task.status){case"pending":return{label:"Pending",icon:Vn,class:"text-muted-foreground"};case"in_progress":return{label:"In Progress",icon:nd,class:"text-blue-500"};case"completed":return{label:"Completed",icon:Lo,class:"text-green-500"};default:return{label:t.task.status,icon:Vn,class:"text-muted-foreground"}}});function s(_){if(!_)return"";try{return new Date(_).toLocaleString()}catch{return _}}function a(_){return t.taskTitles?.get(_)??_}const l=oe(()=>t.commits&&t.commits.length>0&&t.repoId),u=oe(()=>!t.repoId||!t.taskPrdSlug?!1:t.currentPrdSlug?t.taskPrdSlug!==t.currentPrdSlug:!0),c=oe(()=>{if(!u.value||!t.repoId||!t.taskPrdSlug||!t.task)return"";const _=new URLSearchParams({task:t.task.id,taskPrd:t.taskPrdSlug});return`/${t.repoId}/${t.taskPrdSlug}?${_.toString()}`}),d=fe("details"),h=fe(null),f=fe(null);function p(_,y){h.value=_,f.value=y||null,d.value="diff"}function v(){d.value="details",h.value=null,f.value=null}return Ee(()=>t.task,()=>{d.value="details",h.value=null,f.value=null}),Ee(n,_=>{_||(d.value="details",h.value=null,f.value=null)}),(_,y)=>{const b=jE,g=sk,w=Qc;return j(),be(S(Kc),{open:n.value,"onUpdate:open":y[0]||(y[0]=T=>n.value=T)},{default:pe(()=>[ie(S(Xc),{class:He(["flex h-full w-full flex-col overflow-hidden sm:max-w-lg",S(d)==="diff"?"sm:!max-w-[94vw] xl:!max-w-[88vw]":""])},{default:pe(()=>[e.task?(j(),be(S(jc),{key:0,class:"px-6 pr-12"},{default:pe(()=>[X("div",lk,[S(d)==="diff"?(j(),be(S(Bt),{key:0,variant:"ghost",size:"icon",class:"size-8 shrink-0",onClick:v},{default:pe(()=>[ie(S(ed),{class:"size-4"})]),_:1})):ve("",!0),ie(S(qc),{class:"text-left text-lg"},{default:pe(()=>[Te(ge(S(d)==="diff"?"Commit Changes":e.task.title),1)]),_:1})]),ie(S(Uc),{class:"sr-only"},{default:pe(()=>[...y[1]||(y[1]=[Te("Task details",-1)])]),_:1})]),_:1})):ve("",!0),e.task&&S(d)==="diff"&&S(h)&&e.repoId?(j(),ee("div",uk,[ie(b,{"repo-id":e.repoId,"commit-sha":S(h),"repo-path":S(f)||void 0,class:"h-full",onClose:v},null,8,["repo-id","commit-sha","repo-path"])])):e.task?(j(),ee("div",ck,[X("div",dk,[ie(S(Co),{variant:S(o).variant},{default:pe(()=>[ie(S(_d),{class:"mr-1 size-3"}),Te(" "+ge(S(o).label),1)]),_:1},8,["variant"]),ie(S(Co),{variant:"outline",class:He(S(r).class)},{default:pe(()=>[ie(S(yn),{class:"mr-1 size-3"}),Te(" "+ge(S(r).label),1)]),_:1},8,["class"]),ie(S(Co),{variant:"outline",class:He(S(i).class)},{default:pe(()=>[(j(),be(ot(S(i).icon),{class:"mr-1 size-3"})),Te(" "+ge(S(i).label),1)]),_:1},8,["class"])]),X("div",fk,[y[2]||(y[2]=X("h4",{class:"text-sm font-medium"},"Description",-1)),X("p",hk,ge(e.task.description),1)]),ie(S(an)),e.task.steps.length>0?(j(),ee("div",pk,[X("h4",gk,[ie(S(md),{class:"size-4"}),y[3]||(y[3]=Te(" Steps ",-1))]),X("ol",mk,[(j(!0),ee(Oe,null,rt(e.task.steps,(T,M)=>(j(),ee("li",{key:M,class:"pl-1"},ge(T),1))),128))])])):ve("",!0),e.task.steps.length>0&&e.task.passes.length>0?(j(),be(S(an),{key:1})):ve("",!0),e.task.passes.length>0?(j(),ee("div",vk,[X("h4",yk,[ie(S(yd),{class:"size-4"}),y[4]||(y[4]=Te(" Pass Criteria ",-1))]),X("ul",_k,[(j(!0),ee(Oe,null,rt(e.task.passes,(T,M)=>(j(),ee("li",{key:M,class:"flex items-start gap-2"},[X("div",{class:He(["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(),be(S(Zc),{key:0,class:"size-3"})):ve("",!0)],2),X("span",null,ge(T),1)]))),128))])])):ve("",!0),e.task.dependencies.length>0?(j(),be(S(an),{key:3})):ve("",!0),e.task.dependencies.length>0?(j(),ee("div",wk,[X("h4",bk,[ie(S(pd),{class:"size-4"}),y[5]||(y[5]=Te(" Dependencies ",-1))]),X("ul",xk,[(j(!0),ee(Oe,null,rt(e.task.dependencies,T=>(j(),ee("li",{key:T,class:"flex items-center gap-2"},[X("span",Ek,ge(T),1),X("span",null,ge(a(T)),1)]))),128))])])):ve("",!0),S(l)?(j(),ee(Oe,{key:5},[ie(S(an)),X("div",kk,[X("h4",Sk,[ie(S(od),{class:"size-4"}),y[6]||(y[6]=Te(" Changes ",-1))]),ie(g,{commits:e.commits,"repo-id":e.repoId,onSelect:p},null,8,["commits","repo-id"])])],64)):ve("",!0),e.task.startedAt||e.task.completedAt?(j(),ee("div",Ck,[ie(S(an)),X("div",Nk,[e.task.startedAt?(j(),ee("div",Tk,[ie(S(td),{class:"size-3"}),X("span",null,"Started: "+ge(s(e.task.startedAt)),1)])):ve("",!0),e.task.completedAt?(j(),ee("div",Pk,[ie(S(Lo),{class:"size-3"}),X("span",null,"Completed: "+ge(s(e.task.completedAt)),1)])):ve("",!0)])])):ve("",!0),S(u)?(j(),ee("div",Ak,[ie(S(an)),X("div",Ik,[X("span",Ok,"This task belongs to "+ge(e.taskPrdSlug)+".",1),ie(w,{to:S(c)},{default:pe(()=>[ie(S(Bt),{variant:"outline",size:"sm",class:"h-8"},{default:pe(()=>[ie(S(rd),{class:"mr-1.5 size-3.5"}),y[7]||(y[7]=Te(" Open PRD ",-1))]),_:1})]),_:1},8,["to"])])])):ve("",!0)])):ve("",!0),ie(S(Wc),{class:"px-6 pb-6"},{default:pe(()=>[ie(S(Yc),{"as-child":""},{default:pe(()=>[ie(S(Bt),{variant:"outline",class:"w-full"},{default:pe(()=>[...y[8]||(y[8]=[Te("Close",-1)])]),_:1})]),_:1})]),_:1})]),_:1},8,["class"])]),_:1},8,["open"])}}}),jk=Object.assign(Rk,{__name:"TasksDetail"});export{td as C,rd as E,vd as M,jk as _,om as a,am as b,im as c,km as d,Vn as e,Lo as f,yg as g,Gk as h};