@cline/cli-windows-arm64 3.0.34 → 3.0.36

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 (160) hide show
  1. package/bin/cline.exe +0 -0
  2. package/cline-hub/webview/assets/Chat-C5jbpANv.js +201 -0
  3. package/cline-hub/webview/assets/abnfDiagram-VRR7QNED-C5rCTOhv.js +1 -0
  4. package/cline-hub/webview/assets/{arc-BE0bInUi.js → arc-C6pGbJrV.js} +1 -1
  5. package/cline-hub/webview/assets/architectureDiagram-ZJ3FMSHR-B-IyfiZR.js +36 -0
  6. package/cline-hub/webview/assets/{badge-CCf0mJUQ.js → badge-Bzt6S3c1.js} +1 -1
  7. package/cline-hub/webview/assets/blockDiagram-677ZJIJ3-B-BR0eRd.js +132 -0
  8. package/cline-hub/webview/assets/{bundle-mjs-CPvDmBTC.js → bundle-mjs-D3mlU5Wg.js} +1 -1
  9. package/cline-hub/webview/assets/{c4Diagram-AAUBKEIU-D6Qt5AIg.js → c4Diagram-LMCZKHZV-nm2HPWma.js} +6 -6
  10. package/cline-hub/webview/assets/channel-8doMLUjk.js +1 -0
  11. package/cline-hub/webview/assets/chunk-2Q5K7J3B-C1jixKkw.js +1 -0
  12. package/cline-hub/webview/assets/chunk-32BRIVSS-hNjl59yJ.js +1 -0
  13. package/cline-hub/webview/assets/chunk-52WLFC77-BuWVK9iY.js +10 -0
  14. package/cline-hub/webview/assets/{chunk-FMBD7UC4-BEsc7Thj.js → chunk-5VM5RSS4-ZNzvKenW.js} +1 -1
  15. package/cline-hub/webview/assets/chunk-7BUUIJ7U-Bb538aSH.js +1 -0
  16. package/cline-hub/webview/assets/chunk-BO2N2NFS-Dc8TVhBR.js +131 -0
  17. package/cline-hub/webview/assets/chunk-C7G6YPKG-DNqG58q0.js +1 -0
  18. package/cline-hub/webview/assets/chunk-EX3LRPZG-e5_iLYaU.js +231 -0
  19. package/cline-hub/webview/assets/chunk-FWX5IMBZ-CYhSzu5d.js +2 -0
  20. package/cline-hub/webview/assets/chunk-HOUHSVGY-7-np6tLe.js +1 -0
  21. package/cline-hub/webview/assets/chunk-ICXQ74PX-tBj7_Af3.js +2 -0
  22. package/cline-hub/webview/assets/chunk-JWPE2WC7-DVXcaiue.js +1 -0
  23. package/cline-hub/webview/assets/chunk-MOJQB5TN-yHpPpNVl.js +88 -0
  24. package/cline-hub/webview/assets/chunk-OGEWGWER-BWr7Kxep.js +1 -0
  25. package/cline-hub/webview/assets/chunk-PUDLZKDR-8aZ1kjkY.js +156 -0
  26. package/cline-hub/webview/assets/{chunk-O5CBEL6O-BsgSq8yj.js → chunk-Q4XR5HBZ-DLm93PI-.js} +17 -17
  27. package/cline-hub/webview/assets/chunk-RYQCIY6F-BdKtCk_D.js +1 -0
  28. package/cline-hub/webview/assets/{chunk-727SXJPM-BWS1oU2y.js → chunk-V7JOEXUC-ClSqKe24.js} +6 -6
  29. package/cline-hub/webview/assets/chunk-VAUOI2AC-CsrCo4-F.js +1 -0
  30. package/cline-hub/webview/assets/chunk-VR4S4FIN-s6lsgHY6.js +1 -0
  31. package/cline-hub/webview/assets/chunk-WYO6CB5R-i6G7y6Wv.js +126 -0
  32. package/cline-hub/webview/assets/chunk-XXDRQBXY-DlK_iNGL.js +1 -0
  33. package/cline-hub/webview/assets/chunk-Y2CYZVJY-DsF7k-Jl.js +1 -0
  34. package/cline-hub/webview/assets/chunk-ZGVPDNZ5-C9VvO5W0.js +62 -0
  35. package/cline-hub/webview/assets/{chunk-XPW4576I-_W3lCQaj.js → chunk-ZIRB5QZD-C6fEPe3t.js} +2 -2
  36. package/cline-hub/webview/assets/classDiagram-OUVF2IWQ-tjZJwVeV.js +1 -0
  37. package/cline-hub/webview/assets/classDiagram-v2-EOCWNBFH-tjZJwVeV.js +1 -0
  38. package/cline-hub/webview/assets/cose-bilkent-JH36ORCC-MT4lvgSK.js +1 -0
  39. package/cline-hub/webview/assets/cynefinDiagram-TSTJHNR4-Dn-OLu7p.js +62 -0
  40. package/cline-hub/webview/assets/dagre-VKFMJZFB-eCj9UyqP.js +4 -0
  41. package/cline-hub/webview/assets/{desktop-client-Cbu3aJ5_.js → desktop-client-D5160ONr.js} +1 -1
  42. package/cline-hub/webview/assets/diagram-FQU43EPY-DRPKgSnd.js +3 -0
  43. package/cline-hub/webview/assets/diagram-G47NLZAW-0GD8Q1tc.js +24 -0
  44. package/cline-hub/webview/assets/diagram-NH7WQ7WH-BEnNVzix.js +24 -0
  45. package/cline-hub/webview/assets/diagram-OA4YK3LP-V6MJ_f3q.js +30 -0
  46. package/cline-hub/webview/assets/diagram-WEI45ONY-CzW1JD7r.js +41 -0
  47. package/cline-hub/webview/assets/{dist-BWmyBWFf.js → dist-BH9bKIvu.js} +1 -1
  48. package/cline-hub/webview/assets/ebnfDiagram-CCIWWBDH-CFwKmlRg.js +1 -0
  49. package/cline-hub/webview/assets/erDiagram-Q63AITRT-CgAPlUXh.js +85 -0
  50. package/cline-hub/webview/assets/extensions-view-koTx1Pm8.js +1 -0
  51. package/cline-hub/webview/assets/flowDiagram-23GEKE2U-Dzdx6GmQ.js +1 -0
  52. package/cline-hub/webview/assets/ganttDiagram-NO4QXBWP-DM0XEDYK.js +292 -0
  53. package/cline-hub/webview/assets/gitGraphDiagram-IHSO6WYX-CNM8anLk.js +106 -0
  54. package/cline-hub/webview/assets/{highlighted-body-OFNGDK62-D1N2gyd6.js → highlighted-body-OFNGDK62-DPiwQPvA.js} +1 -1
  55. package/cline-hub/webview/assets/{index-COgdQxvL.js → index-BA-eNxbD.js} +3 -3
  56. package/cline-hub/webview/assets/index-qF2TI5Ef.css +1 -0
  57. package/cline-hub/webview/assets/infoDiagram-FWYZ7A6U-CHt0koLa.js +2 -0
  58. package/cline-hub/webview/assets/{ishikawaDiagram-YF4QCWOH-Y2gkCwVM.js → ishikawaDiagram-FXEZZL3T-zkyeJR-l.js} +1 -1
  59. package/cline-hub/webview/assets/{journeyDiagram-JHISSGLW-DeyQ4diw.js → journeyDiagram-5HDEW3XC-DDcjgcyH.js} +1 -1
  60. package/cline-hub/webview/assets/{kanban-definition-UN3LZRKU-CqMuInJf.js → kanban-definition-HUTT4EX6-BYP4PPrE.js} +24 -24
  61. package/cline-hub/webview/assets/{label-CWJcfOco.js → label-CcAzCAzM.js} +1 -1
  62. package/cline-hub/webview/assets/{line-CCCfjwrh.js → line-BTy_dUbW.js} +1 -1
  63. package/cline-hub/webview/assets/{linear-CwrvaBIl.js → linear-BiXMiKrI.js} +1 -1
  64. package/cline-hub/webview/assets/mermaid-GHXKKRXX-Am84rhzj.js +1 -0
  65. package/cline-hub/webview/assets/{mermaid-layout-h6BdjjI9.js → mermaid-layout-Djp6vQyU.js} +2 -2
  66. package/cline-hub/webview/assets/{mermaid-layout-BvlR7J0w.js → mermaid-layout-Dqd4g2mK.js} +1 -1
  67. package/cline-hub/webview/assets/mermaid-layout-OD00zOyc.js +1 -0
  68. package/cline-hub/webview/assets/{mermaid-layout-a6NCHtwk.js → mermaid-layout-mnuPOLAR.js} +1 -1
  69. package/cline-hub/webview/assets/{mermaid-markup-B0el00jA.js → mermaid-markup-BZ6zsKDb.js} +2 -2
  70. package/cline-hub/webview/assets/mermaid-parser-2rg6EBvL.js +1 -0
  71. package/cline-hub/webview/assets/mermaid-parser-BSNQtRf6.js +1 -0
  72. package/cline-hub/webview/assets/mermaid-parser-CZPlgix_.js +4 -0
  73. package/cline-hub/webview/assets/mermaid-parser-Cp5YPQ7g.js +1 -0
  74. package/cline-hub/webview/assets/mermaid-parser-DNzq6p3w.js +161 -0
  75. package/cline-hub/webview/assets/mermaid-parser-DYl5dUZ5.js +1 -0
  76. package/cline-hub/webview/assets/mermaid-parser-DyUJWOTu.js +2 -0
  77. package/cline-hub/webview/assets/mermaid-parser-DyeriwkP.js +3 -0
  78. package/cline-hub/webview/assets/mermaid-parser-QWTbqGyA.js +1 -0
  79. package/cline-hub/webview/assets/mermaid-parser-i85Vjfgu.js +1 -0
  80. package/cline-hub/webview/assets/mermaid.core-DPoJ8TcZ.js +11 -0
  81. package/cline-hub/webview/assets/{mindmap-definition-RKZ34NQL-DJUYWmK3.js → mindmap-definition-LN4V7U3C-CHWTvxxK.js} +8 -8
  82. package/cline-hub/webview/assets/pegDiagram-2B236MQR-CXg1egGc.js +1 -0
  83. package/cline-hub/webview/assets/pieDiagram-ENE6RG2P-DaCuXnM0.js +39 -0
  84. package/cline-hub/webview/assets/{quadrantDiagram-W4KKPZXB-CgdCUG0L.js → quadrantDiagram-ABIIQ3AL-nzS6VzgH.js} +6 -6
  85. package/cline-hub/webview/assets/railroadDiagram-RFXS5EU6-CqNrv-_I.js +1 -0
  86. package/cline-hub/webview/assets/{react-dom-hobdzdVk.js → react-dom-Cmec2Q1Q.js} +1 -1
  87. package/cline-hub/webview/assets/{requirementDiagram-4Y6WPE33-C0ZXsF9P.js → requirementDiagram-TGXJPOKE-OOZcRg4n.js} +7 -7
  88. package/cline-hub/webview/assets/rolldown-runtime-CNC7AqOf.js +1 -0
  89. package/cline-hub/webview/assets/{sankeyDiagram-5OEKKPKP-C-e_yT2t.js → sankeyDiagram-HTMAVEWB-HscxOZtZ.js} +1 -1
  90. package/cline-hub/webview/assets/{sequenceDiagram-3UESZ5HK-DYm5hGt2.js → sequenceDiagram-DBY2YBRQ-R_qy17y4.js} +9 -9
  91. package/cline-hub/webview/assets/settings-view-DdaVezZH.js +1 -0
  92. package/cline-hub/webview/assets/sizeCapture-X5ZJPWSS-B0uUizjq.js +1 -0
  93. package/cline-hub/webview/assets/src-Cz8bXOH0.js +1 -0
  94. package/cline-hub/webview/assets/stateDiagram-2N3HPSRC-ClswSyZL.js +1 -0
  95. package/cline-hub/webview/assets/stateDiagram-v2-6OUMAXLB-DFYi3Fwm.js +1 -0
  96. package/cline-hub/webview/assets/swimlanes-5IMT3BWC-BkuqVu2j.js +2 -0
  97. package/cline-hub/webview/assets/swimlanesDiagram-G3AALYLV-CxnljicL.js +8 -0
  98. package/cline-hub/webview/assets/switch-DI9z38Ya.js +1 -0
  99. package/cline-hub/webview/assets/{timeline-definition-PNZ67QCA-Bx5uqaPf.js → timeline-definition-FHXFAJF6-BjpuN3pN.js} +7 -7
  100. package/cline-hub/webview/assets/vennDiagram-L72KCM5P-8F1dmIqI.js +34 -0
  101. package/cline-hub/webview/assets/{vscode-DK7ayvks.js → vscode-BO5mAFne.js} +1 -1
  102. package/cline-hub/webview/assets/{wardleyDiagram-YWT4CUSO-CNDRYo1K.js → wardleyDiagram-EHGQE667-7YrnPd_H.js} +3 -3
  103. package/cline-hub/webview/assets/xychartDiagram-FW5EYKEG-Cja295cp.js +7 -0
  104. package/cline-hub/webview/index.html +7 -7
  105. package/package.json +1 -1
  106. package/cline-hub/webview/assets/Chat-L1CH__f4.js +0 -201
  107. package/cline-hub/webview/assets/architectureDiagram-3BPJPVTR-D_Q6Ra94.js +0 -36
  108. package/cline-hub/webview/assets/blockDiagram-GPEHLZMM-C1ccJ71l.js +0 -132
  109. package/cline-hub/webview/assets/channel-CFOn3D2I.js +0 -1
  110. package/cline-hub/webview/assets/chunk-2J33WTMH-B5_fx5o6.js +0 -1
  111. package/cline-hub/webview/assets/chunk-3OPIFGDE-x-ISkqhG.js +0 -62
  112. package/cline-hub/webview/assets/chunk-4BX2VUAB-Bs6oAWjs.js +0 -1
  113. package/cline-hub/webview/assets/chunk-55IACEB6-CWPBibRZ.js +0 -1
  114. package/cline-hub/webview/assets/chunk-5ZQYHXKU-Cl_wv1xY.js +0 -2
  115. package/cline-hub/webview/assets/chunk-AQP2D5EJ-CHau_0d8.js +0 -231
  116. package/cline-hub/webview/assets/chunk-BO2N2NFS-WeGK2y8v.js +0 -131
  117. package/cline-hub/webview/assets/chunk-BSJP7CBP-BS0Fn1lu.js +0 -1
  118. package/cline-hub/webview/assets/chunk-CSCIHK7Q-CF15Zetb.js +0 -123
  119. package/cline-hub/webview/assets/chunk-KSCS5N6A-oDwWfb-J.js +0 -10
  120. package/cline-hub/webview/assets/chunk-L5ZTLDWV-pMGqLM5o.js +0 -1
  121. package/cline-hub/webview/assets/chunk-LZXEDZCA-CZOmMbjk.js +0 -2
  122. package/cline-hub/webview/assets/chunk-ND2GUHAM-CDatfx2p.js +0 -1
  123. package/cline-hub/webview/assets/chunk-NZK2D7GU-C-cyh3Oz.js +0 -1
  124. package/cline-hub/webview/assets/chunk-QZHKN3VN-Xy1le_l2.js +0 -1
  125. package/cline-hub/webview/assets/chunk-WU5MYG2G-Dy3guuAS.js +0 -1
  126. package/cline-hub/webview/assets/classDiagram-4FO5ZUOK-raKMe8CJ.js +0 -1
  127. package/cline-hub/webview/assets/classDiagram-v2-Q7XG4LA2-raKMe8CJ.js +0 -1
  128. package/cline-hub/webview/assets/cose-bilkent-S5V4N54A-VnAJK7Vl.js +0 -1
  129. package/cline-hub/webview/assets/dagre-BM42HDAG-BQlxlb5b.js +0 -4
  130. package/cline-hub/webview/assets/diagram-2AECGRRQ-B9HpYQIQ.js +0 -43
  131. package/cline-hub/webview/assets/diagram-5GNKFQAL-DylUUW1F.js +0 -10
  132. package/cline-hub/webview/assets/diagram-KO2AKTUF-CfGwOsfW.js +0 -3
  133. package/cline-hub/webview/assets/diagram-LMA3HP47-CG53Q1r4.js +0 -24
  134. package/cline-hub/webview/assets/diagram-OG6HWLK6-Co6Xz15R.js +0 -24
  135. package/cline-hub/webview/assets/erDiagram-TEJ5UH35-3GiyC0HW.js +0 -85
  136. package/cline-hub/webview/assets/extensions-view-Czr1F6UU.js +0 -1
  137. package/cline-hub/webview/assets/flowDiagram-I6XJVG4X-DwS-bNw8.js +0 -162
  138. package/cline-hub/webview/assets/ganttDiagram-6RSMTGT7-C4mC4LHf.js +0 -292
  139. package/cline-hub/webview/assets/gitGraphDiagram-PVQCEYII-DO_pCBps.js +0 -106
  140. package/cline-hub/webview/assets/index-BU8Y5WqL.css +0 -1
  141. package/cline-hub/webview/assets/infoDiagram-5YYISTIA-CA65Jbmz.js +0 -2
  142. package/cline-hub/webview/assets/mermaid-GHXKKRXX-CPCCHe22.js +0 -1
  143. package/cline-hub/webview/assets/mermaid-layout-CwJyez4c.js +0 -1
  144. package/cline-hub/webview/assets/mermaid-parser-8x28gmNZ.js +0 -1
  145. package/cline-hub/webview/assets/mermaid-parser-B9a939LX.js +0 -4
  146. package/cline-hub/webview/assets/mermaid-parser-CIaLTf2b.js +0 -1
  147. package/cline-hub/webview/assets/mermaid-parser-CTeAeWa9.js +0 -1
  148. package/cline-hub/webview/assets/mermaid-parser-DlpIbxXb.js +0 -159
  149. package/cline-hub/webview/assets/mermaid-parser-Nt7KyXsC.js +0 -1
  150. package/cline-hub/webview/assets/mermaid-parser-kNaey6uv.js +0 -1
  151. package/cline-hub/webview/assets/mermaid.core-bKbkko4L.js +0 -9
  152. package/cline-hub/webview/assets/pieDiagram-4H26LBE5-C1eqm0Py.js +0 -30
  153. package/cline-hub/webview/assets/rolldown-runtime-Cyuzqnbw.js +0 -1
  154. package/cline-hub/webview/assets/settings-view-D3YT4VdK.js +0 -1
  155. package/cline-hub/webview/assets/src-BOORkYYF.js +0 -1
  156. package/cline-hub/webview/assets/stateDiagram-AJRCARHV-KZnvyykZ.js +0 -1
  157. package/cline-hub/webview/assets/stateDiagram-v2-BHNVJYJU-n6tj6oA7.js +0 -1
  158. package/cline-hub/webview/assets/switch-O5JzNA9x.js +0 -1
  159. package/cline-hub/webview/assets/vennDiagram-CIIHVFJN-DXVgvc2I.js +0 -34
  160. package/cline-hub/webview/assets/xychartDiagram-2RQKCTM6-Ykrx2Oe-.js +0 -7
@@ -0,0 +1,24 @@
1
+ import{n as e}from"./chunk-Y2CYZVJY-DsF7k-Jl.js";import{m as t,p as n}from"./src-Cz8bXOH0.js";import{D as r,H as i,K as a,U as o,a as s,b as c,c as l,f as u,v as d,w as f,y as p}from"./chunk-WYO6CB5R-i6G7y6Wv.js";import{t as m}from"./ordinal-hYBb2elL.js";import{t as h}from"./defaultLocale-C8Fc0cco.js";import{i as g}from"./chunk-ICXQ74PX-tBj7_Af3.js";import{t as _}from"./chunk-VAUOI2AC-CsrCo4-F.js";import{t as v}from"./chunk-JWPE2WC7-DVXcaiue.js";import{n as y}from"./mermaid-parser-CZPlgix_.js";import{t as b}from"./chunk-VR4S4FIN-s6lsgHY6.js";import{i as x,n as S}from"./chunk-C7G6YPKG-DNqG58q0.js";function C(e){var t=0,n=e.children,r=n&&n.length;if(!r)t=1;else for(;--r>=0;)t+=n[r].value;e.value=t}function w(){return this.eachAfter(C)}function T(e,t){let n=-1;for(let r of this)e.call(t,r,++n,this);return this}function E(e,t){for(var n=this,r=[n],i,a,o=-1;n=r.pop();)if(e.call(t,n,++o,this),i=n.children)for(a=i.length-1;a>=0;--a)r.push(i[a]);return this}function D(e,t){for(var n=this,r=[n],i=[],a,o,s,c=-1;n=r.pop();)if(i.push(n),a=n.children)for(o=0,s=a.length;o<s;++o)r.push(a[o]);for(;n=i.pop();)e.call(t,n,++c,this);return this}function O(e,t){let n=-1;for(let r of this)if(e.call(t,r,++n,this))return r}function k(e){return this.eachAfter(function(t){for(var n=+e(t.data)||0,r=t.children,i=r&&r.length;--i>=0;)n+=r[i].value;t.value=n})}function A(e){return this.eachBefore(function(t){t.children&&t.children.sort(e)})}function j(e){for(var t=this,n=M(t,e),r=[t];t!==n;)t=t.parent,r.push(t);for(var i=r.length;e!==n;)r.splice(i,0,e),e=e.parent;return r}function M(e,t){if(e===t)return e;var n=e.ancestors(),r=t.ancestors(),i=null;for(e=n.pop(),t=r.pop();e===t;)i=e,e=n.pop(),t=r.pop();return i}function N(){for(var e=this,t=[e];e=e.parent;)t.push(e);return t}function P(){return Array.from(this)}function F(){var e=[];return this.eachBefore(function(t){t.children||e.push(t)}),e}function I(){var e=this,t=[];return e.each(function(n){n!==e&&t.push({source:n.parent,target:n})}),t}function*L(){var e=this,t,n=[e],r,i,a;do for(t=n.reverse(),n=[];e=t.pop();)if(yield e,r=e.children)for(i=0,a=r.length;i<a;++i)n.push(r[i]);while(n.length)}function R(e,t){e instanceof Map?(e=[void 0,e],t===void 0&&(t=V)):t===void 0&&(t=B);for(var n=new W(e),r,i=[n],a,o,s,c;r=i.pop();)if((o=t(r.data))&&(c=(o=Array.from(o)).length))for(r.children=o,s=c-1;s>=0;--s)i.push(a=o[s]=new W(o[s])),a.parent=r,a.depth=r.depth+1;return n.eachBefore(U)}function z(){return R(this).eachBefore(H)}function B(e){return e.children}function V(e){return Array.isArray(e)?e[1]:null}function H(e){e.data.value!==void 0&&(e.value=e.data.value),e.data=e.data.data}function U(e){var t=0;do e.height=t;while((e=e.parent)&&e.height<++t)}function W(e){this.data=e,this.depth=this.height=0,this.parent=null}W.prototype=R.prototype={constructor:W,count:w,each:T,eachAfter:D,eachBefore:E,find:O,sum:k,sort:A,path:j,ancestors:N,descendants:P,leaves:F,links:I,copy:z,[Symbol.iterator]:L};function G(e){if(typeof e!=`function`)throw Error();return e}function K(){return 0}function q(e){return function(){return e}}function J(e){e.x0=Math.round(e.x0),e.y0=Math.round(e.y0),e.x1=Math.round(e.x1),e.y1=Math.round(e.y1)}function ee(e,t,n,r,i){for(var a=e.children,o,s=-1,c=a.length,l=e.value&&(r-t)/e.value;++s<c;)o=a[s],o.y0=n,o.y1=i,o.x0=t,o.x1=t+=o.value*l}function te(e,t,n,r,i){for(var a=e.children,o,s=-1,c=a.length,l=e.value&&(i-n)/e.value;++s<c;)o=a[s],o.x0=t,o.x1=r,o.y0=n,o.y1=n+=o.value*l}var ne=(1+Math.sqrt(5))/2;function re(e,t,n,r,i,a){for(var o=[],s=t.children,c,l,u=0,d=0,f=s.length,p,m,h=t.value,g,_,v,y,b,x,S;u<f;){p=i-n,m=a-r;do g=s[d++].value;while(!g&&d<f);for(_=v=g,x=Math.max(m/p,p/m)/(h*e),S=g*g*x,b=Math.max(v/S,S/_);d<f;++d){if(g+=l=s[d].value,l<_&&(_=l),l>v&&(v=l),S=g*g*x,y=Math.max(v/S,S/_),y>b){g-=l;break}b=y}o.push(c={value:g,dice:p<m,children:s.slice(u,d)}),c.dice?ee(c,n,r,i,h?r+=m*g/h:a):te(c,n,r,h?n+=p*g/h:i,a),h-=g,u=d}return o}var ie=(function e(t){function n(e,n,r,i,a){re(t,e,n,r,i,a)}return n.ratio=function(t){return e((t=+t)>1?t:1)},n})(ne);function ae(){var e=ie,t=!1,n=1,r=1,i=[0],a=K,o=K,s=K,c=K,l=K;function u(e){return e.x0=e.y0=0,e.x1=n,e.y1=r,e.eachBefore(d),i=[0],t&&e.eachBefore(J),e}function d(t){var n=i[t.depth],r=t.x0+n,u=t.y0+n,d=t.x1-n,f=t.y1-n;d<r&&(r=d=(r+d)/2),f<u&&(u=f=(u+f)/2),t.x0=r,t.y0=u,t.x1=d,t.y1=f,t.children&&(n=i[t.depth+1]=a(t)/2,r+=l(t)-n,u+=o(t)-n,d-=s(t)-n,f-=c(t)-n,d<r&&(r=d=(r+d)/2),f<u&&(u=f=(u+f)/2),e(t,r,u,d,f))}return u.round=function(e){return arguments.length?(t=!!e,u):t},u.size=function(e){return arguments.length?(n=+e[0],r=+e[1],u):[n,r]},u.tile=function(t){return arguments.length?(e=G(t),u):e},u.padding=function(e){return arguments.length?u.paddingInner(e).paddingOuter(e):u.paddingInner()},u.paddingInner=function(e){return arguments.length?(a=typeof e==`function`?e:q(+e),u):a},u.paddingOuter=function(e){return arguments.length?u.paddingTop(e).paddingRight(e).paddingBottom(e).paddingLeft(e):u.paddingTop()},u.paddingTop=function(e){return arguments.length?(o=typeof e==`function`?e:q(+e),u):o},u.paddingRight=function(e){return arguments.length?(s=typeof e==`function`?e:q(+e),u):s},u.paddingBottom=function(e){return arguments.length?(c=typeof e==`function`?e:q(+e),u):c},u.paddingLeft=function(e){return arguments.length?(l=typeof e==`function`?e:q(+e),u):l},u}var Y=class{constructor(){this.nodes=[],this.levels=new Map,this.outerNodes=[],this.classes=new Map,this.setAccTitle=o,this.getAccTitle=p,this.setDiagramTitle=a,this.getDiagramTitle=f,this.getAccDescription=d,this.setAccDescription=i}static{e(this,`TreeMapDB`)}getNodes(){return this.nodes}getConfig(){let e=u,t=c();return g({...e.treemap,...t.treemap??{}})}addNode(e,t){this.nodes.push(e),this.levels.set(e,t),t===0&&(this.outerNodes.push(e),this.root??=e)}getRoot(){return{name:``,children:this.outerNodes}}addClass(e,t){let n=this.classes.get(e)??{id:e,styles:[],textStyles:[]},r=t.replace(/\\,/g,`§§§`).replace(/,/g,`;`).replace(/§§§/g,`,`).split(`;`);r&&r.forEach(e=>{S(e)&&(n?.textStyles?n.textStyles.push(e):n.textStyles=[e]),n?.styles?n.styles.push(e):n.styles=[e]}),this.classes.set(e,n)}getClasses(){return this.classes}getStylesForClass(e){return this.classes.get(e)?.styles??[]}clear(){s(),this.nodes=[],this.levels=new Map,this.outerNodes=[],this.classes=new Map,this.root=void 0}};function X(e){if(!e.length)return[];let t=[],n=[];return e.forEach(e=>{let r={name:e.name,children:e.type===`Leaf`?void 0:[]};for(r.classSelector=e?.classSelector,e?.cssCompiledStyles&&(r.cssCompiledStyles=e.cssCompiledStyles),e.type===`Leaf`&&e.value!==void 0&&(r.value=e.value);n.length>0&&n[n.length-1].level>=e.level;)n.pop();if(n.length===0)t.push(r);else{let e=n[n.length-1].node;e.children?e.children.push(r):e.children=[r]}e.type!==`Leaf`&&n.push({node:r,level:e.level})}),t}e(X,`buildHierarchy`);var oe=e((t,n)=>{v(t,n);let r=[];for(let e of t.TreemapRows??[])e.$type===`ClassDefStatement`&&n.addClass(e.className??``,e.styleText??``);for(let e of t.TreemapRows??[]){let t=e.item;if(!t)continue;let i=e.indent?parseInt(e.indent):0,a=se(t),o=t.classSelector?n.getStylesForClass(t.classSelector):[],s=o.length>0?o:void 0,c={level:i,name:a,type:t.$type,value:t.value,classSelector:t.classSelector,cssCompiledStyles:s};r.push(c)}let i=X(r),a=e((e,t)=>{for(let r of e)n.addNode(r,t),r.children&&r.children.length>0&&a(r.children,t+1)},`addNodesRecursively`);a(i,0)},`populate`),se=e(e=>e.name?String(e.name):``,`getItemName`),Z={parser:{yy:void 0},parse:e(async e=>{try{let n=await y(`treemap`,e);t.debug(`Treemap AST:`,n);let r=Z.parser?.yy;if(!(r instanceof Y))throw Error(`parser.parser?.yy was not a TreemapDB. This is due to a bug within Mermaid, please report this issue at https://github.com/mermaid-js/mermaid/issues.`);oe(n,r)}catch(e){throw t.error(`Error parsing treemap:`,e),e}},`parse`)},ce=10,Q=10,$=25,le={draw:e((r,i,a,o)=>{let s=o.db,u=s.getConfig(),d=u.padding??ce,f=s.getDiagramTitle(),p=s.getRoot(),{themeVariables:g}=c();if(!p)return;let v=f?30:0,y=_(i),S=u.nodeWidth?u.nodeWidth*Q:960,C=u.nodeHeight?u.nodeHeight*Q:500,w=S,T=C+v;y.attr(`viewBox`,`0 0 ${w} ${T}`),l(y,T,w,u.useMaxWidth);let E;try{let t=u.valueFormat||`,`;if(t===`$0,0`)E=e(e=>`$`+h(`,`)(e),`valueFormat`);else if(t.startsWith(`$`)&&t.includes(`,`)){let n=/\.\d+/.exec(t),r=n?n[0]:``;E=e(e=>`$`+h(`,`+r)(e),`valueFormat`)}else if(t.startsWith(`$`)){let n=t.substring(1);E=e(e=>`$`+h(n||``)(e),`valueFormat`)}else E=h(t)}catch(e){t.error(`Error creating format function:`,e),E=h(`,`)}let D=m().range([`transparent`,g.cScale0,g.cScale1,g.cScale2,g.cScale3,g.cScale4,g.cScale5,g.cScale6,g.cScale7,g.cScale8,g.cScale9,g.cScale10,g.cScale11]),O=m().range([`transparent`,g.cScalePeer0,g.cScalePeer1,g.cScalePeer2,g.cScalePeer3,g.cScalePeer4,g.cScalePeer5,g.cScalePeer6,g.cScalePeer7,g.cScalePeer8,g.cScalePeer9,g.cScalePeer10,g.cScalePeer11]),k=m().range([g.cScaleLabel0,g.cScaleLabel1,g.cScaleLabel2,g.cScaleLabel3,g.cScaleLabel4,g.cScaleLabel5,g.cScaleLabel6,g.cScaleLabel7,g.cScaleLabel8,g.cScaleLabel9,g.cScaleLabel10,g.cScaleLabel11]);f&&y.append(`text`).attr(`x`,w/2).attr(`y`,v/2).attr(`class`,`treemapTitle`).attr(`text-anchor`,`middle`).attr(`dominant-baseline`,`middle`).text(f);let A=y.append(`g`).attr(`transform`,`translate(0, ${v})`).attr(`class`,`treemapContainer`),j=R(p).sum(e=>e.value??0).sort((e,t)=>(t.value??0)-(e.value??0)),M=ae().size([S,C]).paddingTop(e=>e.children&&e.children.length>0?$+Q:0).paddingInner(d).paddingLeft(e=>e.children&&e.children.length>0?Q:0).paddingRight(e=>e.children&&e.children.length>0?Q:0).paddingBottom(e=>e.children&&e.children.length>0?Q:0).round(!0)(j),N=M.descendants().filter(e=>e.children&&e.children.length>0),P=A.selectAll(`.treemapSection`).data(N).enter().append(`g`).attr(`class`,`treemapSection`).attr(`transform`,e=>`translate(${e.x0},${e.y0})`);P.append(`rect`).attr(`width`,e=>e.x1-e.x0).attr(`height`,$).attr(`class`,`treemapSectionHeader`).attr(`fill`,`none`).attr(`fill-opacity`,.6).attr(`stroke-width`,.6).attr(`style`,e=>e.depth===0?`display: none;`:``),P.append(`clipPath`).attr(`id`,(e,t)=>`clip-section-${i}-${t}`).append(`rect`).attr(`width`,e=>Math.max(0,e.x1-e.x0-12)).attr(`height`,$),P.append(`rect`).attr(`width`,e=>e.x1-e.x0).attr(`height`,e=>e.y1-e.y0).attr(`class`,(e,t)=>`treemapSection section${t}`).attr(`fill`,e=>D(e.data.name)).attr(`fill-opacity`,.6).attr(`stroke`,e=>O(e.data.name)).attr(`stroke-width`,2).attr(`stroke-opacity`,.4).attr(`style`,e=>{if(e.depth===0)return`display: none;`;let t=x({cssCompiledStyles:e.data.cssCompiledStyles});return t.nodeStyles+`;`+t.borderStyles.join(`;`)}),P.append(`text`).attr(`class`,`treemapSectionLabel`).attr(`x`,6).attr(`y`,$/2).attr(`dominant-baseline`,`middle`).text(e=>e.depth===0?``:e.data.name).attr(`font-weight`,`bold`).attr(`clip-path`,(e,t)=>`url(#clip-section-${i}-${t})`).attr(`style`,e=>e.depth===0?`display: none;`:`dominant-baseline: middle; font-size: 12px; fill:`+k(e.data.name)+`; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;`+x({cssCompiledStyles:e.data.cssCompiledStyles}).labelStyles.replace(`color:`,`fill:`)).each(function(e){if(e.depth===0)return;let t=n(this),r=e.data.name;t.text(r);let i=e.x1-e.x0,a;a=u.showValues!==!1&&e.value?i-10-30-10-6:i-6-6;let o=Math.max(15,a),s=t.node();if(s.getComputedTextLength()>o){let e=r;for(;e.length>0;){if(e=r.substring(0,e.length-1),e.length===0){t.text(`...`),s.getComputedTextLength()>o&&t.text(``);break}if(t.text(e+`...`),s.getComputedTextLength()<=o)break}}}),u.showValues!==!1&&P.append(`text`).attr(`class`,`treemapSectionValue`).attr(`x`,e=>e.x1-e.x0-10).attr(`y`,$/2).attr(`text-anchor`,`end`).attr(`dominant-baseline`,`middle`).text(e=>e.value?E(e.value):``).attr(`font-style`,`italic`).attr(`style`,e=>e.depth===0?`display: none;`:`text-anchor: end; dominant-baseline: middle; font-size: 10px; fill:`+k(e.data.name)+`; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;`+x({cssCompiledStyles:e.data.cssCompiledStyles}).labelStyles.replace(`color:`,`fill:`));let F=M.leaves(),I=F.length>20,L=I?16:38,z=I?14:28,B=I?4:8,V=I?4:6,H=I?2:4,U=I?8:10,W=I?1:2,G=A.selectAll(`.treemapLeafGroup`).data(F).enter().append(`g`).attr(`class`,(e,t)=>`treemapNode treemapLeafGroup leaf${t}${e.data.classSelector?` ${e.data.classSelector}`:``}x`).attr(`transform`,e=>`translate(${e.x0},${e.y0})`);G.append(`rect`).attr(`width`,e=>e.x1-e.x0).attr(`height`,e=>e.y1-e.y0).attr(`class`,`treemapLeaf`).attr(`fill`,e=>e.parent?D(e.parent.data.name):D(e.data.name)).attr(`style`,e=>x({cssCompiledStyles:e.data.cssCompiledStyles}).nodeStyles).attr(`fill-opacity`,.3).attr(`stroke`,e=>e.parent?D(e.parent.data.name):D(e.data.name)).attr(`stroke-width`,3),G.append(`clipPath`).attr(`id`,(e,t)=>`clip-${i}-${t}`).append(`rect`).attr(`width`,e=>Math.max(0,e.x1-e.x0-4)).attr(`height`,e=>Math.max(0,e.y1-e.y0-4)),G.append(`text`).attr(`class`,`treemapLabel`).attr(`x`,e=>(e.x1-e.x0)/2).attr(`y`,e=>(e.y1-e.y0)/2).attr(`style`,e=>`text-anchor: middle; dominant-baseline: middle; font-size: ${L}px;fill:`+k(e.data.name)+`;`+x({cssCompiledStyles:e.data.cssCompiledStyles}).labelStyles.replace(`color:`,`fill:`)).attr(`clip-path`,(e,t)=>`url(#clip-${i}-${t})`).text(e=>e.data.name).each(function(e){let t=n(this),r=e.x1-e.x0,i=e.y1-e.y0,a=t.node(),o=r-2*H,s=i-2*H;if(o<U||s<U){t.style(`display`,`none`);return}let c=parseInt(t.style(`font-size`),10),l=.6;for(;a.getComputedTextLength()>o&&c>B;)c--,t.style(`font-size`,`${c}px`);let u=Math.max(V,Math.min(z,Math.round(c*l))),d=c+W+u;for(;d>s&&c>B&&(c--,u=Math.max(V,Math.min(z,Math.round(c*l))),!(u<V&&c===B));)t.style(`font-size`,`${c}px`),d=c+W+u;t.style(`font-size`,`${c}px`),I?(c<B||s<B)&&t.style(`display`,`none`):(a.getComputedTextLength()>o||c<B||s<c)&&t.style(`display`,`none`)}),u.showValues!==!1&&G.append(`text`).attr(`class`,`treemapValue`).attr(`x`,e=>(e.x1-e.x0)/2).attr(`y`,function(e){return(e.y1-e.y0)/2}).attr(`style`,e=>`text-anchor: middle; dominant-baseline: hanging; font-size: ${z}px;fill:`+k(e.data.name)+`;`+x({cssCompiledStyles:e.data.cssCompiledStyles}).labelStyles.replace(`color:`,`fill:`)).attr(`clip-path`,(e,t)=>`url(#clip-${i}-${t})`).text(e=>e.value?E(e.value):``).each(function(e){let t=n(this),r=this.parentNode;if(!r){t.style(`display`,`none`);return}let i=n(r).select(`.treemapLabel`);if(i.empty()||i.style(`display`)===`none`){t.style(`display`,`none`);return}let a=parseFloat(i.style(`font-size`)),o=Math.max(V,Math.min(z,Math.round(a*.6)));t.style(`font-size`,`${o}px`);let s=(e.y1-e.y0)/2+a/2+W;t.attr(`y`,s);let c=e.x1-e.x0,l=e.y1-e.y0-4,u=c-2*H;t.node().getComputedTextLength()>u||s+o>l||o<V?t.style(`display`,`none`):t.style(`display`,null)}),b(y,u.diagramPadding??8,`flowchart`,u?.useMaxWidth||!1)},`draw`),getClasses:e(function(e,t){return t.db.getClasses()},`getClasses`)},ue={sectionStrokeColor:`black`,sectionStrokeWidth:`1`,sectionFillColor:`#efefef`,leafStrokeColor:`black`,leafStrokeWidth:`1`,leafFillColor:`#efefef`,labelFontSize:`12px`,valueFontSize:`10px`,titleFontSize:`14px`},de={parser:Z,get db(){return new Y},renderer:le,styles:e(({treemap:e}={})=>{let t=g(r(),c().themeVariables),n=g(ue,e),i=n.titleColor??t.titleColor,a=n.labelColor??t.textColor,o=n.valueColor??t.textColor;return`
2
+ .treemapNode.section {
3
+ stroke: ${n.sectionStrokeColor};
4
+ stroke-width: ${n.sectionStrokeWidth};
5
+ fill: ${n.sectionFillColor};
6
+ }
7
+ .treemapNode.leaf {
8
+ stroke: ${n.leafStrokeColor};
9
+ stroke-width: ${n.leafStrokeWidth};
10
+ fill: ${n.leafFillColor};
11
+ }
12
+ .treemapLabel {
13
+ fill: ${a};
14
+ font-size: ${n.labelFontSize};
15
+ }
16
+ .treemapValue {
17
+ fill: ${o};
18
+ font-size: ${n.valueFontSize};
19
+ }
20
+ .treemapTitle {
21
+ fill: ${i};
22
+ font-size: ${n.titleFontSize};
23
+ }
24
+ `},`getStyles`)};export{de as diagram};
@@ -0,0 +1,24 @@
1
+ import{n as e}from"./chunk-Y2CYZVJY-DsF7k-Jl.js";import{m as t}from"./src-Cz8bXOH0.js";import{H as n,K as r,U as i,a,b as o,c as s,f as c,v as l,w as u,y as d}from"./chunk-WYO6CB5R-i6G7y6Wv.js";import{i as f}from"./chunk-ICXQ74PX-tBj7_Af3.js";import{t as p}from"./chunk-VAUOI2AC-CsrCo4-F.js";import{t as m}from"./chunk-JWPE2WC7-DVXcaiue.js";import{n as h}from"./mermaid-parser-CZPlgix_.js";var g=c.packet,_=class{constructor(){this.packet=[],this.setAccTitle=i,this.getAccTitle=d,this.setDiagramTitle=r,this.getDiagramTitle=u,this.getAccDescription=l,this.setAccDescription=n}static{e(this,`PacketDB`)}getConfig(){let e=f({...g,...o().packet});return e.showBits&&(e.paddingY+=10),e}getPacket(){return this.packet}pushWord(e){e.length>0&&this.packet.push(e)}clear(){a(),this.packet=[]}},v=1e4,y=e((e,n)=>{m(e,n);let r=-1,i=[],a=1,{bitsPerRow:o}=n.getConfig();for(let{start:s,end:c,bits:l,label:u}of e.blocks){if(s!==void 0&&c!==void 0&&c<s)throw Error(`Packet block ${s} - ${c} is invalid. End must be greater than start.`);if(s??=r+1,s!==r+1)throw Error(`Packet block ${s} - ${c??s} is not contiguous. It should start from ${r+1}.`);if(l===0)throw Error(`Packet block ${s} is invalid. Cannot have a zero bit field.`);for(c??=s+(l??1)-1,l??=c-s+1,r=c,t.debug(`Packet block ${s} - ${r} with label ${u}`);i.length<=o+1&&n.getPacket().length<v;){let[e,t]=b({start:s,end:c,bits:l,label:u},a,o);if(i.push(e),e.end+1===a*o&&(n.pushWord(i),i=[],a++),!t)break;({start:s,end:c,bits:l,label:u}=t)}}n.pushWord(i)},`populate`),b=e((e,t,n)=>{if(e.start===void 0)throw Error(`start should have been set during first phase`);if(e.end===void 0)throw Error(`end should have been set during first phase`);if(e.start>e.end)throw Error(`Block start ${e.start} is greater than block end ${e.end}.`);if(e.end+1<=t*n)return[e,void 0];let r=t*n-1,i=t*n;return[{start:e.start,end:r,label:e.label,bits:r-e.start},{start:i,end:e.end,label:e.label,bits:e.end-i}]},`getNextFittingBlock`),x={parser:{yy:void 0},parse:e(async e=>{let n=await h(`packet`,e),r=x.parser?.yy;if(!(r instanceof _))throw Error(`parser.parser?.yy was not a PacketDB. This is due to a bug within Mermaid, please report this issue at https://github.com/mermaid-js/mermaid/issues.`);t.debug(n),y(n,r)},`parse`)},S=e((e,t,n,r)=>{let i=r.db,a=i.getConfig(),{rowHeight:o,paddingY:c,bitWidth:l,bitsPerRow:u}=a,d=i.getPacket(),f=i.getDiagramTitle(),m=o+c,h=m*(d.length+1)-(f?0:o),g=l*u+2,_=p(t);_.attr(`viewBox`,`0 0 ${g} ${h}`),s(_,h,g,a.useMaxWidth);for(let[e,t]of d.entries())C(_,t,e,a);_.append(`text`).text(f).attr(`x`,g/2).attr(`y`,h-m/2).attr(`dominant-baseline`,`middle`).attr(`text-anchor`,`middle`).attr(`class`,`packetTitle`)},`draw`),C=e((e,t,n,{rowHeight:r,paddingX:i,paddingY:a,bitWidth:o,bitsPerRow:s,showBits:c})=>{let l=e.append(`g`),u=n*(r+a)+a;for(let e of t){let t=e.start%s*o+1,n=(e.end-e.start+1)*o-i;if(l.append(`rect`).attr(`x`,t).attr(`y`,u).attr(`width`,n).attr(`height`,r).attr(`class`,`packetBlock`),l.append(`text`).attr(`x`,t+n/2).attr(`y`,u+r/2).attr(`class`,`packetLabel`).attr(`dominant-baseline`,`middle`).attr(`text-anchor`,`middle`).text(e.label),!c)continue;let a=e.end===e.start,d=u-2;l.append(`text`).attr(`x`,t+(a?n/2:0)).attr(`y`,d).attr(`class`,`packetByte start`).attr(`dominant-baseline`,`auto`).attr(`text-anchor`,a?`middle`:`start`).text(e.start),a||l.append(`text`).attr(`x`,t+n).attr(`y`,d).attr(`class`,`packetByte end`).attr(`dominant-baseline`,`auto`).attr(`text-anchor`,`end`).text(e.end)}},`drawWord`),w={draw:S},T={byteFontSize:`10px`,startByteColor:`black`,endByteColor:`black`,labelColor:`black`,labelFontSize:`12px`,titleColor:`black`,titleFontSize:`14px`,blockStrokeColor:`black`,blockStrokeWidth:`1`,blockFillColor:`#efefef`},E={parser:x,get db(){return new _},renderer:w,styles:e(({packet:e}={})=>{let t=f(T,e);return`
2
+ .packetByte {
3
+ font-size: ${t.byteFontSize};
4
+ }
5
+ .packetByte.start {
6
+ fill: ${t.startByteColor};
7
+ }
8
+ .packetByte.end {
9
+ fill: ${t.endByteColor};
10
+ }
11
+ .packetLabel {
12
+ fill: ${t.labelColor};
13
+ font-size: ${t.labelFontSize};
14
+ }
15
+ .packetTitle {
16
+ fill: ${t.titleColor};
17
+ font-size: ${t.titleFontSize};
18
+ }
19
+ .packetBlock {
20
+ stroke: ${t.blockStrokeColor};
21
+ stroke-width: ${t.blockStrokeWidth};
22
+ fill: ${t.blockFillColor};
23
+ }
24
+ `},`styles`)};export{E as diagram};
@@ -0,0 +1,30 @@
1
+ import{n as e}from"./chunk-Y2CYZVJY-DsF7k-Jl.js";import{m as t}from"./src-Cz8bXOH0.js";import{H as n,K as r,U as i,a,b as o,c as s,f as c,v as l,w as u,y as d,z as f}from"./chunk-WYO6CB5R-i6G7y6Wv.js";import{i as p}from"./chunk-ICXQ74PX-tBj7_Af3.js";import{t as m}from"./chunk-VAUOI2AC-CsrCo4-F.js";import{t as h}from"./chunk-JWPE2WC7-DVXcaiue.js";import{n as g}from"./mermaid-parser-CZPlgix_.js";import{r as _,t as v}from"./chunk-HOUHSVGY-7-np6tLe.js";import{t as y}from"./chunk-2Q5K7J3B-C1jixKkw.js";var b=/[─━│┃└┗├┣]/,x=/[└┗├┣]/,S=/[─━]/,C=/^[\s│┃]+$/,w=/^\s*(title[\t ]|accTitle[\t ]*:|accDescr[\t ]*[:{])/,T=/^\s*%%/,E=` `;function D(e){return e.some(e=>b.test(e))}e(D,`isBoxDrawingFormat`);function O(e){for(let t of e){let e=x.exec(t);if(e?.index&&e.index>0)return e.index}return 4}e(O,`inferSegmentWidth`);function k(e,t){return e.replace(/\bline\s+(\d+)\b/gi,(e,n)=>{let r=parseInt(n,10),i=t.get(r);return i?`line ${i}`:e})}e(k,`remapErrorLines`);function A(e){let t=e.split(`
2
+ `),n=new Map,r=-1;for(let[e,n]of t.entries())if(n.trim()===`treeView-beta`){r=e;break}if(r===-1)return{text:e,lineMap:n};let i=[];for(let e=r+1;e<t.length;e++){let n=t[e];n.trim()===``||T.test(n)||w.test(n)||C.test(n)||i.push(n.replace(/\t/g,` `))}if(!D(i))return{text:e,lineMap:n};let a=O(i),o=[],s=0;for(let e=0;e<=r;e++)o.push(t[e]),s++,n.set(s,e+1);for(let e=r+1;e<t.length;e++){let r=t[e],i=r.trim(),c=e+1;if(i===``){o.push(r),s++,n.set(s,c);continue}if(T.test(r)){o.push(r),s++,n.set(s,c);continue}if(w.test(r)){o.push(r),s++,n.set(s,c);continue}if(C.test(r))continue;let l=r.replace(/\t/g,` `),u=x.exec(l);if(u?.index!==void 0){let e=u.index,t=Math.round(e/a)+1,r=e+1;for(;r<l.length&&S.test(l[r]);)r++;for(;r<l.length&&l[r]===` `;)r++;let i=l.slice(r).trimEnd();if(!i)throw Error(`Line ${c}: Empty node \u2014 expected a filename or directory name after the box-drawing prefix`);let d=E.repeat(t);o.push(d+i),s++,n.set(s,c)}else if(/^[\s─━│┃└┗├┣]+$/.test(l))continue;else if(b.test(l))o.push(r),s++,n.set(s,c);else if(/^\s+/.test(l))throw Error(`Line ${c}: Unexpected indentation without box-drawing characters. In box-drawing format, use \u251C\u2500\u2500 or \u2514\u2500\u2500 prefixes for indented nodes.`);else o.push(r),s++,n.set(s,c)}return{text:o.join(`
3
+ `),lineMap:n}}e(A,`preprocessBoxDrawing`);var j=new y(()=>({cnt:1,stack:[{id:0,level:-1,name:`/`,nodeType:`directory`,children:[]}]})),M=e(()=>{j.reset(),a()},`clear`),N=e(()=>j.records.stack[0],`getRoot`),P=e(()=>j.records.cnt,`getCount`),F=c.treeView,I={clear:M,addNode:e((e,t,n,r,i,a)=>{for(;e<=j.records.stack[j.records.stack.length-1].level;)j.records.stack.pop();let o={id:j.records.cnt++,level:e,name:t,nodeType:n,icon:i,cssClass:r,description:a,children:[]};j.records.stack[j.records.stack.length-1].children.push(o),j.records.stack.push(o)},`addNode`),getRoot:N,getCount:P,getConfig:e(()=>p(F,o().treeView),`getConfig`),getAccTitle:d,getAccDescription:l,getDiagramTitle:u,setAccDescription:n,setAccTitle:i,setDiagramTitle:r},L=e(e=>{h(e,I);for(let t of e.nodes){let e=typeof t.indent==`number`?t.indent:0,n=t.name,r=n.endsWith(`/`);r&&(n=n.slice(0,-1));let i=r?`directory`:`file`,a=t.classAnnotation||void 0,s=t.iconAnnotation,c=s===void 0?void 0:s||`none`,l=t.descAnnotation||void 0,u=l?f(l,o()):void 0;I.addNode(e,n,i,a,c,u)}},`populate`),R={parse:e(async e=>{let{text:n,lineMap:r}=A(e);try{let e=await g(`treeView`,n);t.debug(e),L(e)}catch(e){throw r.size>0&&e instanceof Error&&(e.message=k(e.message,r)),e}},`parse`)},z={prefix:`mermaid-treeview`,height:24,width:24,icons:{folder:{body:`<path fill="currentColor" d="M10.59 4.59A2 2 0 0 0 9.17 4H4a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.17z"/>`},file:{body:`<path fill="currentColor" fill-rule="evenodd" d="M6 2a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8.83a2 2 0 0 0-.59-1.42l-4.82-4.82A2 2 0 0 0 13.17 2H6Zm7.5 1.9l4.6 4.6h-3.6a1 1 0 0 1-1-1V3.9Z" clip-rule="evenodd"/>`}}};function B(e,t){let n=t?.filenameIcons?.[e];if(n)return n;let r=e.lastIndexOf(`.`);if(r>0){let n=e.substring(r).toLowerCase(),i=t?.extensionIcons;return i?.[n]??i?.[n.slice(1)]}}e(B,`detectIcon`);function V(e,t){return e.includes(`:`)?e:e in z.icons||!t?`${z.prefix}:${e}`:`${t}:${e}`}e(V,`qualifyIcon`);function H(e,t){if(e.icon!==`none`){if(e.icon)return V(e.icon,t.defaultIconPack);if(t.showIcons){if(e.nodeType===`file`){let n=B(e.name,t);if(n===`none`)return;if(n)return V(n,t.defaultIconPack)}return`${z.prefix}:${e.nodeType===`directory`?`folder`:`file`}`}}}e(H,`getNodeIcon`),_([{name:z.prefix,icons:z}]);var U=14,W=4,G=16,K=e((e,t)=>`tv-icon-${e}-${t.replace(/[^\w-]/g,`-`)}`,`iconSymbolId`),q=e(async(t,n,r,i)=>{let a=new Set,o=e(e=>{let t=H(e,r);t&&a.add(t),e.children.forEach(o)},`collect`);if(o(n),a.size===0)return;let s=await Promise.all([...a].map(async e=>({icon:e,svg:await v(e,{height:U,width:U})}))),c=t.append(`defs`);for(let{icon:e,svg:t}of s)c.append(`g`).attr(`id`,K(i,e)).html(t)},`injectIconDefs`),J=e((e,t,n,r,i,a)=>{let o=r.append(`g`),s=`treeView-node-label`;n.nodeType===`directory`&&(s+=` treeView-node-dir`),n.cssClass&&(s+=` ${n.cssClass}`);let c=U+W,l=H(n,i),u=l!==void 0;l&&o.append(`use`).attr(`xlink:href`,`#${K(a,l)}`).attr(`x`,e+i.paddingX).attr(`y`,t+i.paddingY).attr(`class`,`treeView-node-icon`);let d=o.append(`text`).text(n.name).attr(`dominant-baseline`,`middle`).attr(`class`,s),{height:f,width:p}=d.node().getBBox(),m=f+i.paddingY*2,h=e+i.paddingX+(u?c:0);d.attr(`x`,h),d.attr(`y`,t+m/2);let g=h+p;return n.BBox={x:e,y:t,width:p+i.paddingX*2+(u?c:0),height:m},n.cssClass?.split(/\s+/).includes(`highlight`)&&o.insert(`rect`,`:first-child`).attr(`x`,e).attr(`y`,t+1).attr(`width`,0).attr(`height`,m-2).attr(`rx`,3).attr(`class`,`treeView-highlight-bg`),{node:n,nodeGroup:o,labelRightEdge:g,centerY:t+m/2}},`positionLabel`),Y=e((e,t,n,r,i,a)=>e.append(`line`).attr(`x1`,t).attr(`y1`,n).attr(`x2`,r).attr(`y2`,i).attr(`stroke-width`,a).attr(`class`,`treeView-node-line`),`positionLine`),X=e((t,n,r,i)=>{let a=0,o=0,s=[],c=e((e,t,n,r)=>{let c=r*(n.rowIndent+n.paddingX),l=J(c,a,t,e,n,i);s.push(l);let{height:u,width:d}=t.BBox;Y(e,c-n.rowIndent,a+u/2,c,a+u/2,n.lineThickness),o=Math.max(o,c+d),a+=u},`drawNode`),l=e((e,n=0)=>{c(t,e,r,n),e.children.forEach(e=>{l(e,n+1)});let{x:i,y:a,height:o}=e.BBox;if(e.children.length){let{y:n,height:s}=e.children[e.children.length-1].BBox;Y(t,i+r.paddingX,a+o,i+r.paddingX,n+s/2+r.lineThickness/2,r.lineThickness)}},`processNode`);l(n);let u=s.filter(e=>e.node.description);if(u.length>0){let e=Math.max(...s.map(e=>e.labelRightEdge))+G;for(let t of u){let n=t.nodeGroup.append(`text`).text(t.node.description).attr(`dominant-baseline`,`middle`).attr(`class`,`treeView-node-description`).attr(`x`,e).attr(`y`,t.centerY).node().getBBox();o=Math.max(o,e+n.width+r.paddingX)}}for(let e of s)if(e.node.cssClass?.split(/\s+/).includes(`highlight`)){let t=e.nodeGroup.select(`.treeView-highlight-bg`);if(!t.empty()){let n=o-e.node.BBox.x+8;t.attr(`width`,n),o=Math.max(o,e.node.BBox.x+n+2)}}return{totalHeight:a,totalWidth:o}},`drawTree`),Z={draw:e(async(e,n,r,i)=>{t.debug(`Rendering treeView diagram
4
+ `+e);let a=i.db,o=a.getRoot(),c=a.getConfig(),l=m(n);await q(l,o,c,n);let u=l.append(`g`);u.attr(`class`,`tree-view`);let{totalHeight:d,totalWidth:f}=X(u,o,c,n);l.attr(`viewBox`,`-${c.lineThickness/2} 0 ${f} ${d}`),s(l,d,f,c.useMaxWidth)},`draw`)},Q={labelFontSize:`16px`,labelColor:`black`,lineColor:`black`,iconColor:`#546e7a`,descriptionColor:`#6a9955`,highlightBg:`rgba(255, 193, 7, 0.15)`,highlightStroke:`#ffc107`},$={db:I,renderer:Z,parser:R,styles:e(({treeView:e})=>{let{labelFontSize:t,labelColor:n,lineColor:r,iconColor:i,descriptionColor:a,highlightBg:o,highlightStroke:s}=p(Q,e);return`
5
+ .treeView-node-label {
6
+ font-size: ${t};
7
+ fill: ${n};
8
+ white-space: pre;
9
+ }
10
+ .treeView-node-dir {
11
+ font-weight: bold;
12
+ }
13
+ .treeView-node-line {
14
+ stroke: ${r};
15
+ }
16
+ .treeView-node-icon {
17
+ color: ${i};
18
+ }
19
+ .treeView-node-description {
20
+ font-size: ${t};
21
+ fill: ${a};
22
+ font-style: italic;
23
+ white-space: pre;
24
+ }
25
+ .treeView-highlight-bg {
26
+ fill: ${o};
27
+ stroke: ${s};
28
+ stroke-width: 1;
29
+ }
30
+ `},`styles`)};export{$ as diagram};
@@ -0,0 +1,41 @@
1
+ import{n as e}from"./chunk-Y2CYZVJY-DsF7k-Jl.js";import{m as t}from"./src-Cz8bXOH0.js";import{D as n,H as r,K as i,U as a,a as o,b as s,c,f as l,v as u,w as d,y as f}from"./chunk-WYO6CB5R-i6G7y6Wv.js";import{i as p}from"./chunk-ICXQ74PX-tBj7_Af3.js";import{t as m}from"./chunk-VAUOI2AC-CsrCo4-F.js";import{t as h}from"./chunk-JWPE2WC7-DVXcaiue.js";import{n as g}from"./mermaid-parser-CZPlgix_.js";var _={showLegend:!0,ticks:5,max:null,min:0,graticule:`circle`},v={axes:[],curves:[],options:_},y=structuredClone(v),b=l.radar,x=e(()=>p({...b,...s().radar}),`getConfig`),S=e(()=>y.axes,`getAxes`),C=e(()=>y.curves,`getCurves`),w=e(()=>y.options,`getOptions`),T=e(e=>{y.axes=e.map(e=>({name:e.name,label:e.label??e.name}))},`setAxes`),E=e(e=>{y.curves=e.map(e=>({name:e.name,label:e.label??e.name,entries:D(e.entries)}))},`setCurves`),D=e(e=>{if(e[0].axis==null)return e.map(e=>e.value);let t=S();if(t.length===0)throw Error(`Axes must be populated before curves for reference entries`);return t.map(t=>{let n=e.find(e=>e.axis?.$refText===t.name);if(n===void 0)throw Error(`Missing entry for axis `+t.label);return n.value})},`computeCurveEntries`),O={getAxes:S,getCurves:C,getOptions:w,setAxes:T,setCurves:E,setOptions:e(e=>{let t=e.reduce((e,t)=>(e[t.name]=t,e),{});y.options={showLegend:t.showLegend?.value??_.showLegend,ticks:t.ticks?.value??_.ticks,max:t.max?.value??_.max,min:t.min?.value??_.min,graticule:t.graticule?.value??_.graticule}},`setOptions`),getConfig:x,clear:e(()=>{o(),y=structuredClone(v)},`clear`),setAccTitle:a,getAccTitle:f,setDiagramTitle:i,getDiagramTitle:d,getAccDescription:u,setAccDescription:r},k=e(e=>{h(e,O);let{axes:t,curves:n,options:r}=e;O.setAxes(t),O.setCurves(n),O.setOptions(r)},`populate`),A={parse:e(async e=>{let n=await g(`radar`,e);t.debug(n),k(n)},`parse`)},j=e((e,t,n,r)=>{let i=r.db,a=i.getAxes(),o=i.getCurves(),s=i.getOptions(),c=i.getConfig(),l=i.getDiagramTitle(),u=M(m(t),c),d=s.max??Math.max(...o.map(e=>Math.max(...e.entries))),f=s.min,p=Math.min(c.width,c.height)/2;N(u,a,p,s.ticks,s.graticule),P(u,a,p,c),F(u,a,o,f,d,s.graticule,c),R(u,o,s.showLegend,c),u.append(`text`).attr(`class`,`radarTitle`).text(l).attr(`x`,0).attr(`y`,-c.height/2-c.marginTop)},`draw`),M=e((e,t)=>{let n=t.width+t.marginLeft+t.marginRight,r=t.height+t.marginTop+t.marginBottom,i={x:t.marginLeft+t.width/2,y:t.marginTop+t.height/2};return c(e,r,n,t.useMaxWidth??!0),e.attr(`viewBox`,`0 0 ${n} ${r}`).attr(`overflow`,`visible`),e.append(`g`).attr(`transform`,`translate(${i.x}, ${i.y})`)},`drawFrame`),N=e((e,t,n,r,i)=>{if(i===`circle`)for(let t=0;t<r;t++){let i=n*(t+1)/r;e.append(`circle`).attr(`r`,i).attr(`class`,`radarGraticule`)}else if(i===`polygon`){let i=t.length;for(let a=0;a<r;a++){let o=n*(a+1)/r,s=t.map((e,t)=>{let n=2*t*Math.PI/i-Math.PI/2;return`${o*Math.cos(n)},${o*Math.sin(n)}`}).join(` `);e.append(`polygon`).attr(`points`,s).attr(`class`,`radarGraticule`)}}},`drawGraticule`),P=e((e,t,n,r)=>{let i=t.length;for(let a=0;a<i;a++){let o=t[a].label,s=2*a*Math.PI/i-Math.PI/2,c=Math.cos(s),l=Math.sin(s);e.append(`line`).attr(`x1`,0).attr(`y1`,0).attr(`x2`,n*r.axisScaleFactor*c).attr(`y2`,n*r.axisScaleFactor*l).attr(`class`,`radarAxisLine`);let u=c>.01?`start`:c<-.01?`end`:`middle`,d=l>.01?`hanging`:l<-.01?`auto`:`central`;e.append(`text`).text(o).attr(`x`,n*r.axisLabelFactor*c+4*c).attr(`y`,n*r.axisLabelFactor*l+4*l).attr(`text-anchor`,u).attr(`dominant-baseline`,d).attr(`class`,`radarAxisLabel`)}},`drawAxes`);function F(e,t,n,r,i,a,o){let s=t.length,c=Math.min(o.width,o.height)/2;n.forEach((t,n)=>{if(t.entries.length!==s)return;let l=t.entries.map((e,t)=>{let n=2*Math.PI*t/s-Math.PI/2,a=I(e,r,i,c);return{x:a*Math.cos(n),y:a*Math.sin(n)}});a===`circle`?e.append(`path`).attr(`d`,L(l,o.curveTension)).attr(`class`,`radarCurve-${n}`):a===`polygon`&&e.append(`polygon`).attr(`points`,l.map(e=>`${e.x},${e.y}`).join(` `)).attr(`class`,`radarCurve-${n}`)})}e(F,`drawCurves`);function I(e,t,n,r){return r*(Math.min(Math.max(e,t),n)-t)/(n-t)}e(I,`relativeRadius`);function L(e,t){let n=e.length,r=`M${e[0].x},${e[0].y}`;for(let i=0;i<n;i++){let a=e[(i-1+n)%n],o=e[i],s=e[(i+1)%n],c=e[(i+2)%n],l={x:o.x+(s.x-a.x)*t,y:o.y+(s.y-a.y)*t},u={x:s.x-(c.x-o.x)*t,y:s.y-(c.y-o.y)*t};r+=` C${l.x},${l.y} ${u.x},${u.y} ${s.x},${s.y}`}return`${r} Z`}e(L,`closedRoundCurve`);function R(e,t,n,r){if(!n)return;let i=(r.width/2+r.marginRight)*3/4,a=-(r.height/2+r.marginTop)*3/4;t.forEach((t,n)=>{let r=e.append(`g`).attr(`transform`,`translate(${i}, ${a+n*20})`);r.append(`rect`).attr(`width`,12).attr(`height`,12).attr(`class`,`radarLegendBox-${n}`),r.append(`text`).attr(`x`,16).attr(`y`,0).attr(`class`,`radarLegendText`).text(t.label)})}e(R,`drawLegend`);var z={draw:j},B=e((e,t)=>{let n=``;for(let r=0;r<e.THEME_COLOR_LIMIT;r++){let i=e[`cScale${r}`];n+=`
2
+ .radarCurve-${r} {
3
+ color: ${i};
4
+ fill: ${i};
5
+ fill-opacity: ${t.curveOpacity};
6
+ stroke: ${i};
7
+ stroke-width: ${t.curveStrokeWidth};
8
+ }
9
+ .radarLegendBox-${r} {
10
+ fill: ${i};
11
+ fill-opacity: ${t.curveOpacity};
12
+ stroke: ${i};
13
+ }
14
+ `}return n},`genIndexStyles`),V=e(e=>{let t=p(n(),s().themeVariables);return{themeVariables:t,radarOptions:p(t.radar,e)}},`buildRadarStyleOptions`),H={parser:A,db:O,renderer:z,styles:e(({radar:e}={})=>{let{themeVariables:t,radarOptions:n}=V(e);return`
15
+ .radarTitle {
16
+ font-size: ${t.fontSize};
17
+ color: ${t.titleColor};
18
+ dominant-baseline: hanging;
19
+ text-anchor: middle;
20
+ }
21
+ .radarAxisLine {
22
+ stroke: ${n.axisColor};
23
+ stroke-width: ${n.axisStrokeWidth};
24
+ }
25
+ .radarAxisLabel {
26
+ font-size: ${n.axisLabelFontSize}px;
27
+ color: ${n.axisColor};
28
+ }
29
+ .radarGraticule {
30
+ fill: ${n.graticuleColor};
31
+ fill-opacity: ${n.graticuleOpacity};
32
+ stroke: ${n.graticuleColor};
33
+ stroke-width: ${n.graticuleStrokeWidth};
34
+ }
35
+ .radarLegendText {
36
+ text-anchor: start;
37
+ font-size: ${n.legendFontSize}px;
38
+ dominant-baseline: hanging;
39
+ }
40
+ ${B(t,n)}
41
+ `},`styles`)};export{H as diagram};
@@ -1 +1 @@
1
- import{t as e}from"./rolldown-runtime-Cyuzqnbw.js";var t=Math.abs,n=Math.atan2,r=Math.cos,i=Math.max,a=Math.min,o=Math.sin,s=Math.sqrt,c=1e-12,l=Math.PI,u=l/2,d=2*l;function f(e){return e>1?0:e<-1?l:Math.acos(e)}function p(e){return e>=1?u:e<=-1?-u:Math.asin(e)}var m=e((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.BLANK_URL=e.relativeFirstCharacters=e.whitespaceEscapeCharsRegex=e.urlSchemeRegex=e.ctrlCharactersRegex=e.htmlCtrlEntityRegex=e.htmlEntitiesRegex=e.invalidProtocolRegex=void 0,e.invalidProtocolRegex=/^([^\w]*)(javascript|data|vbscript)/im,e.htmlEntitiesRegex=/&#(\w+)(^\w|;)?/g,e.htmlCtrlEntityRegex=/&(newline|tab);/gi,e.ctrlCharactersRegex=/[\u0000-\u001F\u007F-\u009F\u2000-\u200D\uFEFF]/gim,e.urlSchemeRegex=/^.+(:|&colon;)/gim,e.whitespaceEscapeCharsRegex=/(\\|%5[cC])((%(6[eE]|72|74))|[nrt])/g,e.relativeFirstCharacters=[`.`,`/`],e.BLANK_URL=`about:blank`})),h=e((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.sanitizeUrl=o;var t=m();function n(e){return t.relativeFirstCharacters.indexOf(e[0])>-1}function r(e){return e.replace(t.ctrlCharactersRegex,``).replace(t.htmlEntitiesRegex,function(e,t){return String.fromCharCode(t)})}function i(e){return URL.canParse(e)}function a(e){try{return decodeURIComponent(e)}catch{return e}}function o(e){if(!e)return t.BLANK_URL;var o,s=a(e.trim());do s=r(s).replace(t.htmlCtrlEntityRegex,``).replace(t.ctrlCharactersRegex,``).replace(t.whitespaceEscapeCharsRegex,``).trim(),s=a(s),o=s.match(t.ctrlCharactersRegex)||s.match(t.htmlEntitiesRegex)||s.match(t.htmlCtrlEntityRegex)||s.match(t.whitespaceEscapeCharsRegex);while(o&&o.length>0);var c=s;if(!c)return t.BLANK_URL;if(n(c))return c;var l=c.trimStart(),u=l.match(t.urlSchemeRegex);if(!u)return c;var d=u[0].toLowerCase().trim();if(t.invalidProtocolRegex.test(d))return t.BLANK_URL;var f=l.replace(/\\/g,`/`);if(d===`mailto:`||d.includes(`://`))return f;if(d===`http:`||d===`https:`){if(!i(f))return t.BLANK_URL;var p=new URL(f);return p.protocol=p.protocol.toLowerCase(),p.hostname=p.hostname.toLowerCase(),p.toString()}return f}}));export{n as a,u as c,l as d,o as f,p as i,i as l,d as m,t as n,r as o,s as p,f as r,c as s,h as t,a as u};
1
+ import{t as e}from"./rolldown-runtime-CNC7AqOf.js";var t=Math.abs,n=Math.atan2,r=Math.cos,i=Math.max,a=Math.min,o=Math.sin,s=Math.sqrt,c=1e-12,l=Math.PI,u=l/2,d=2*l;function f(e){return e>1?0:e<-1?l:Math.acos(e)}function p(e){return e>=1?u:e<=-1?-u:Math.asin(e)}var m=e((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.BLANK_URL=e.relativeFirstCharacters=e.whitespaceEscapeCharsRegex=e.urlSchemeRegex=e.ctrlCharactersRegex=e.htmlCtrlEntityRegex=e.htmlEntitiesRegex=e.invalidProtocolRegex=void 0,e.invalidProtocolRegex=/^([^\w]*)(javascript|data|vbscript)/im,e.htmlEntitiesRegex=/&#(\w+)(^\w|;)?/g,e.htmlCtrlEntityRegex=/&(newline|tab);/gi,e.ctrlCharactersRegex=/[\u0000-\u001F\u007F-\u009F\u2000-\u200D\uFEFF]/gim,e.urlSchemeRegex=/^.+(:|&colon;)/gim,e.whitespaceEscapeCharsRegex=/(\\|%5[cC])((%(6[eE]|72|74))|[nrt])/g,e.relativeFirstCharacters=[`.`,`/`],e.BLANK_URL=`about:blank`})),h=e((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.sanitizeUrl=o;var t=m();function n(e){return t.relativeFirstCharacters.indexOf(e[0])>-1}function r(e){return e.replace(t.ctrlCharactersRegex,``).replace(t.htmlEntitiesRegex,function(e,t){return String.fromCharCode(t)})}function i(e){return URL.canParse(e)}function a(e){try{return decodeURIComponent(e)}catch{return e}}function o(e){if(!e)return t.BLANK_URL;var o,s=a(e.trim());do s=r(s).replace(t.htmlCtrlEntityRegex,``).replace(t.ctrlCharactersRegex,``).replace(t.whitespaceEscapeCharsRegex,``).trim(),s=a(s),o=s.match(t.ctrlCharactersRegex)||s.match(t.htmlEntitiesRegex)||s.match(t.htmlCtrlEntityRegex)||s.match(t.whitespaceEscapeCharsRegex);while(o&&o.length>0);var c=s;if(!c)return t.BLANK_URL;if(n(c))return c;var l=c.trimStart(),u=l.match(t.urlSchemeRegex);if(!u)return c;var d=u[0].toLowerCase().trim();if(t.invalidProtocolRegex.test(d))return t.BLANK_URL;var f=l.replace(/\\/g,`/`);if(d===`mailto:`||d.includes(`://`))return f;if(d===`http:`||d===`https:`){if(!i(f))return t.BLANK_URL;var p=new URL(f);return p.protocol=p.protocol.toLowerCase(),p.hostname=p.hostname.toLowerCase(),p.toString()}return f}}));export{n as a,u as c,l as d,o as f,p as i,i as l,d as m,t as n,r as o,s as p,f as r,c as s,h as t,a as u};
@@ -0,0 +1 @@
1
+ import{n as e}from"./mermaid-parser-DyUJWOTu.js";import{n as t}from"./chunk-Y2CYZVJY-DsF7k-Jl.js";import{m as n}from"./src-Cz8bXOH0.js";import"./chunk-WYO6CB5R-i6G7y6Wv.js";import"./chunk-VAUOI2AC-CsrCo4-F.js";import{n as r,r as i,t as a}from"./chunk-MOJQB5TN-yHpPpNVl.js";import{t as o}from"./chunk-JWPE2WC7-DVXcaiue.js";import{t as s}from"./mermaid-parser-CZPlgix_.js";var c=e().RailroadEbnf.parser.LangiumParser,l=t(e=>{let t=e.alternatives.map(u);return t.length===1?t[0]:{type:`choice`,alternatives:t}},`transformChoice`),u=t(e=>{let t=e.elements.map(p);return t.length===1?t[0]:{type:`sequence`,elements:t}},`transformSequence`),d=t(e=>{switch(e.$type){case`EbnfTerminal`:return{type:`terminal`,value:e.value};case`EbnfNonTerminal`:return{type:`nonterminal`,name:e.name};case`EbnfSpecial`:return{type:`special`,text:e.text};case`EbnfGroup`:return l(e.element);case`EbnfOptional`:return{type:`optional`,element:l(e.element)};case`EbnfRepetition`:return{type:`repetition`,element:l(e.element),min:0,max:1/0};default:throw Error(`Unsupported EBNF primary node: ${e.$type}`)}},`transformPrimary`),f=t((e,t)=>{switch(t.$type){case`EbnfOptionalPostfix`:return{type:`optional`,element:e};case`EbnfZeroOrMorePostfix`:return{type:`repetition`,element:e,min:0,max:1/0};case`EbnfOneOrMorePostfix`:return{type:`repetition`,element:e,min:1,max:1/0};case`EbnfExceptionPostfix`:return{type:`sequence`,elements:[e,{type:`terminal`,value:`-`},d(t.except)]};default:throw Error(`Unsupported EBNF postfix node: ${t.$type}`)}},`transformPostfix`),p=t(e=>e.postfixes.reduce((e,t)=>f(e,t),d(e.base)),`transformTerm`),m=t(e=>({name:e.name,definition:l(e.definition)}),`transformRule`),h=t(e=>{o(e,a),e.title&&a.setTitle(e.title),e.rules.map(e=>a.addRule(m(e)))},`populateDb`),g={parser:{parse:t(e=>{a.clear(),n.debug(`[EBNF Parser] Starting Langium parse`);let t=c.parse(e);if(t.lexerErrors.length>0||t.parserErrors.length>0)throw new s(t);let r=t.value;n.debug(`[EBNF Parser] Parsed rules:`,r.rules.length),h(r),n.debug(`[EBNF Parser] Parse complete`)},`parse`),parser:{yy:a}},db:a,renderer:i,styles:r};export{g as diagram};
@@ -0,0 +1,85 @@
1
+ import{n as e,t}from"./chunk-Y2CYZVJY-DsF7k-Jl.js";import{m as n,p as r}from"./src-Cz8bXOH0.js";import{H as i,K as a,U as o,a as s,rt as c,v as l,w as u,x as d,y as f}from"./chunk-WYO6CB5R-i6G7y6Wv.js";import{t as p}from"./channel-8doMLUjk.js";import{c as m,g as h}from"./chunk-ICXQ74PX-tBj7_Af3.js";import"./chunk-HOUHSVGY-7-np6tLe.js";import"./chunk-Q4XR5HBZ-DLm93PI-.js";import"./chunk-7BUUIJ7U-Bb538aSH.js";import"./chunk-OGEWGWER-BWr7Kxep.js";import{t as g}from"./chunk-XXDRQBXY-DlK_iNGL.js";import{t as _}from"./chunk-VR4S4FIN-s6lsgHY6.js";import"./chunk-C7G6YPKG-DNqG58q0.js";import"./chunk-ZGVPDNZ5-C9VvO5W0.js";import"./chunk-52WLFC77-BuWVK9iY.js";import{r as v,t as y}from"./chunk-FWX5IMBZ-CYhSzu5d.js";var b=(function(){var t=e(function(e,t,n,r){for(n||={},r=e.length;r--;n[e[r]]=t);return n},`o`),n=[6,8,10,22,24,26,28,33,34,35,36,37,40,43,44,48,50,51,52],r=[1,10],i=[1,11],a=[1,12],o=[1,13],s=[1,23],c=[1,24],l=[1,25],u=[1,26],d=[1,27],f=[1,19],p=[1,28],m=[1,29],h=[1,20],g=[1,18],_=[1,21],v=[1,22],y=[1,36],b=[1,37],x=[1,38],S=[1,39],C=[1,40],w=[6,8,10,13,15,17,20,21,22,24,26,28,33,34,35,36,37,40,43,44,48,50,51,52,66,67,68,69,70],T=[1,45],E=[1,46],D=[1,55],O=[40,48,50,51,52,71,72],k=[1,66],A=[1,64],j=[1,61],M=[1,65],N=[1,67],P=[6,8,10,13,17,22,24,26,28,33,34,35,36,37,40,41,42,43,44,48,49,50,51,52,66,67,68,69,70],F=[66,67,68,69,70],I=[1,85],L=[1,84],R=[1,82],z=[1,83],B=[6,10,42,47],V=[6,10,13,41,42,47,48,49],H=[1,93],U=[1,92],W=[1,91],G=[19,58],K=[1,102],q=[1,101],J=[19,58,61,63],Y={trace:e(function(){},`trace`),yy:{},symbols_:{error:2,start:3,ER_DIAGRAM:4,document:5,EOF:6,line:7,SPACE:8,statement:9,NEWLINE:10,entityName:11,relSpec:12,COLON:13,role:14,STYLE_SEPARATOR:15,idList:16,BLOCK_START:17,attributes:18,BLOCK_STOP:19,SQS:20,SQE:21,title:22,title_value:23,acc_title:24,acc_title_value:25,acc_descr:26,acc_descr_value:27,acc_descr_multiline_value:28,direction:29,classDefStatement:30,classStatement:31,styleStatement:32,direction_tb:33,direction_bt:34,direction_rl:35,direction_lr:36,CLASSDEF:37,stylesOpt:38,separator:39,UNICODE_TEXT:40,STYLE_TEXT:41,COMMA:42,CLASS:43,STYLE:44,style:45,styleComponent:46,SEMI:47,NUM:48,BRKT:49,ENTITY_NAME:50,DECIMAL_NUM:51,ENTITY_ONE:52,attribute:53,attributeType:54,attributeName:55,attributeKeyTypeList:56,attributeComment:57,ATTRIBUTE_WORD:58,"?":59,attributeKeyType:60,",":61,ATTRIBUTE_KEY:62,COMMENT:63,cardinality:64,relType:65,ZERO_OR_ONE:66,ZERO_OR_MORE:67,ONE_OR_MORE:68,ONLY_ONE:69,MD_PARENT:70,NON_IDENTIFYING:71,IDENTIFYING:72,WORD:73,$accept:0,$end:1},terminals_:{2:`error`,4:`ER_DIAGRAM`,6:`EOF`,8:`SPACE`,10:`NEWLINE`,13:`COLON`,15:`STYLE_SEPARATOR`,17:`BLOCK_START`,19:`BLOCK_STOP`,20:`SQS`,21:`SQE`,22:`title`,23:`title_value`,24:`acc_title`,25:`acc_title_value`,26:`acc_descr`,27:`acc_descr_value`,28:`acc_descr_multiline_value`,33:`direction_tb`,34:`direction_bt`,35:`direction_rl`,36:`direction_lr`,37:`CLASSDEF`,40:`UNICODE_TEXT`,41:`STYLE_TEXT`,42:`COMMA`,43:`CLASS`,44:`STYLE`,47:`SEMI`,48:`NUM`,49:`BRKT`,50:`ENTITY_NAME`,51:`DECIMAL_NUM`,52:`ENTITY_ONE`,58:`ATTRIBUTE_WORD`,59:`?`,61:`,`,62:`ATTRIBUTE_KEY`,63:`COMMENT`,66:`ZERO_OR_ONE`,67:`ZERO_OR_MORE`,68:`ONE_OR_MORE`,69:`ONLY_ONE`,70:`MD_PARENT`,71:`NON_IDENTIFYING`,72:`IDENTIFYING`,73:`WORD`},productions_:[0,[3,3],[5,0],[5,2],[7,2],[7,1],[7,1],[7,1],[9,5],[9,9],[9,7],[9,7],[9,4],[9,6],[9,3],[9,5],[9,1],[9,3],[9,7],[9,9],[9,6],[9,8],[9,4],[9,6],[9,2],[9,2],[9,2],[9,1],[9,1],[9,1],[9,1],[9,1],[29,1],[29,1],[29,1],[29,1],[30,4],[16,1],[16,1],[16,3],[16,3],[31,3],[32,4],[38,1],[38,3],[45,1],[45,2],[39,1],[39,1],[39,1],[46,1],[46,1],[46,1],[46,1],[11,1],[11,1],[11,1],[11,1],[11,1],[18,1],[18,2],[53,2],[53,3],[53,3],[53,4],[54,1],[54,2],[55,1],[56,1],[56,3],[60,1],[57,1],[12,3],[64,1],[64,1],[64,1],[64,1],[64,1],[65,1],[65,1],[14,1],[14,1],[14,1]],performAction:e(function(e,t,n,r,i,a,o){var s=a.length-1;switch(i){case 1:break;case 2:this.$=[];break;case 3:a[s-1].push(a[s]),this.$=a[s-1];break;case 4:case 5:this.$=a[s];break;case 6:case 7:this.$=[];break;case 8:r.addEntity(a[s-4]),r.addEntity(a[s-2]),r.addRelationship(a[s-4],a[s],a[s-2],a[s-3]);break;case 9:r.addEntity(a[s-8]),r.addEntity(a[s-4]),r.addRelationship(a[s-8],a[s],a[s-4],a[s-5]),r.setClass([a[s-8]],a[s-6]),r.setClass([a[s-4]],a[s-2]);break;case 10:r.addEntity(a[s-6]),r.addEntity(a[s-2]),r.addRelationship(a[s-6],a[s],a[s-2],a[s-3]),r.setClass([a[s-6]],a[s-4]);break;case 11:r.addEntity(a[s-6]),r.addEntity(a[s-4]),r.addRelationship(a[s-6],a[s],a[s-4],a[s-5]),r.setClass([a[s-4]],a[s-2]);break;case 12:r.addEntity(a[s-3]),r.addAttributes(a[s-3],a[s-1]);break;case 13:r.addEntity(a[s-5]),r.addAttributes(a[s-5],a[s-1]),r.setClass([a[s-5]],a[s-3]);break;case 14:r.addEntity(a[s-2]);break;case 15:r.addEntity(a[s-4]),r.setClass([a[s-4]],a[s-2]);break;case 16:r.addEntity(a[s]);break;case 17:r.addEntity(a[s-2]),r.setClass([a[s-2]],a[s]);break;case 18:r.addEntity(a[s-6],a[s-4]),r.addAttributes(a[s-6],a[s-1]);break;case 19:r.addEntity(a[s-8],a[s-6]),r.addAttributes(a[s-8],a[s-1]),r.setClass([a[s-8]],a[s-3]);break;case 20:r.addEntity(a[s-5],a[s-3]);break;case 21:r.addEntity(a[s-7],a[s-5]),r.setClass([a[s-7]],a[s-2]);break;case 22:r.addEntity(a[s-3],a[s-1]);break;case 23:r.addEntity(a[s-5],a[s-3]),r.setClass([a[s-5]],a[s]);break;case 24:case 25:this.$=a[s].trim(),r.setAccTitle(this.$);break;case 26:case 27:this.$=a[s].trim(),r.setAccDescription(this.$);break;case 32:r.setDirection(`TB`);break;case 33:r.setDirection(`BT`);break;case 34:r.setDirection(`RL`);break;case 35:r.setDirection(`LR`);break;case 36:this.$=a[s-3],r.addClass(a[s-2],a[s-1]);break;case 37:case 38:case 59:case 68:this.$=[a[s]];break;case 39:case 40:this.$=a[s-2].concat([a[s]]);break;case 41:this.$=a[s-2],r.setClass(a[s-1],a[s]);break;case 42:this.$=a[s-3],r.addCssStyles(a[s-2],a[s-1]);break;case 43:this.$=[a[s]];break;case 44:a[s-2].push(a[s]),this.$=a[s-2];break;case 46:this.$=a[s-1]+a[s];break;case 54:case 80:case 81:this.$=a[s].replace(/"/g,``);break;case 55:case 56:case 57:case 58:case 82:this.$=a[s];break;case 60:a[s].push(a[s-1]),this.$=a[s];break;case 61:this.$={type:a[s-1],name:a[s]};break;case 62:this.$={type:a[s-2],name:a[s-1],keys:a[s]};break;case 63:this.$={type:a[s-2],name:a[s-1],comment:a[s]};break;case 64:this.$={type:a[s-3],name:a[s-2],keys:a[s-1],comment:a[s]};break;case 65:case 67:case 70:this.$=a[s];break;case 66:this.$=a[s-1]+a[s];break;case 69:a[s-2].push(a[s]),this.$=a[s-2];break;case 71:this.$=a[s].replace(/"/g,``);break;case 72:this.$={cardA:a[s],relType:a[s-1],cardB:a[s-2]};break;case 73:this.$=r.Cardinality.ZERO_OR_ONE;break;case 74:this.$=r.Cardinality.ZERO_OR_MORE;break;case 75:this.$=r.Cardinality.ONE_OR_MORE;break;case 76:this.$=r.Cardinality.ONLY_ONE;break;case 77:this.$=r.Cardinality.MD_PARENT;break;case 78:this.$=r.Identification.NON_IDENTIFYING;break;case 79:this.$=r.Identification.IDENTIFYING;break}},`anonymous`),table:[{3:1,4:[1,2]},{1:[3]},t(n,[2,2],{5:3}),{6:[1,4],7:5,8:[1,6],9:7,10:[1,8],11:9,22:r,24:i,26:a,28:o,29:14,30:15,31:16,32:17,33:s,34:c,35:l,36:u,37:d,40:f,43:p,44:m,48:h,50:g,51:_,52:v},t(n,[2,7],{1:[2,1]}),t(n,[2,3]),{9:30,11:9,22:r,24:i,26:a,28:o,29:14,30:15,31:16,32:17,33:s,34:c,35:l,36:u,37:d,40:f,43:p,44:m,48:h,50:g,51:_,52:v},t(n,[2,5]),t(n,[2,6]),t(n,[2,16],{12:31,64:35,15:[1,32],17:[1,33],20:[1,34],66:y,67:b,68:x,69:S,70:C}),{23:[1,41]},{25:[1,42]},{27:[1,43]},t(n,[2,27]),t(n,[2,28]),t(n,[2,29]),t(n,[2,30]),t(n,[2,31]),t(w,[2,54]),t(w,[2,55]),t(w,[2,56]),t(w,[2,57]),t(w,[2,58]),t(n,[2,32]),t(n,[2,33]),t(n,[2,34]),t(n,[2,35]),{16:44,40:T,41:E},{16:47,40:T,41:E},{16:48,40:T,41:E},t(n,[2,4]),{11:49,40:f,48:h,50:g,51:_,52:v},{16:50,40:T,41:E},{18:51,19:[1,52],53:53,54:54,58:D},{11:56,40:f,48:h,50:g,51:_,52:v},{65:57,71:[1,58],72:[1,59]},t(O,[2,73]),t(O,[2,74]),t(O,[2,75]),t(O,[2,76]),t(O,[2,77]),t(n,[2,24]),t(n,[2,25]),t(n,[2,26]),{13:k,38:60,41:A,42:j,45:62,46:63,48:M,49:N},t(P,[2,37]),t(P,[2,38]),{16:68,40:T,41:E,42:j},{13:k,38:69,41:A,42:j,45:62,46:63,48:M,49:N},{13:[1,70],15:[1,71]},t(n,[2,17],{64:35,12:72,17:[1,73],42:j,66:y,67:b,68:x,69:S,70:C}),{19:[1,74]},t(n,[2,14]),{18:75,19:[2,59],53:53,54:54,58:D},{55:76,58:[1,77]},{58:[2,65],59:[1,78]},{21:[1,79]},{64:80,66:y,67:b,68:x,69:S,70:C},t(F,[2,78]),t(F,[2,79]),{6:I,10:L,39:81,42:R,47:z},{40:[1,86],41:[1,87]},t(B,[2,43],{46:88,13:k,41:A,48:M,49:N}),t(V,[2,45]),t(V,[2,50]),t(V,[2,51]),t(V,[2,52]),t(V,[2,53]),t(n,[2,41],{42:j}),{6:I,10:L,39:89,42:R,47:z},{14:90,40:H,50:U,73:W},{16:94,40:T,41:E},{11:95,40:f,48:h,50:g,51:_,52:v},{18:96,19:[1,97],53:53,54:54,58:D},t(n,[2,12]),{19:[2,60]},t(G,[2,61],{56:98,57:99,60:100,62:K,63:q}),t([19,58,62,63],[2,67]),{58:[2,66]},t(n,[2,22],{15:[1,104],17:[1,103]}),t([40,48,50,51,52],[2,72]),t(n,[2,36]),{13:k,41:A,45:105,46:63,48:M,49:N},t(n,[2,47]),t(n,[2,48]),t(n,[2,49]),t(P,[2,39]),t(P,[2,40]),t(V,[2,46]),t(n,[2,42]),t(n,[2,8]),t(n,[2,80]),t(n,[2,81]),t(n,[2,82]),{13:[1,106],42:j},{13:[1,108],15:[1,107]},{19:[1,109]},t(n,[2,15]),t(G,[2,62],{57:110,61:[1,111],63:q}),t(G,[2,63]),t(J,[2,68]),t(G,[2,71]),t(J,[2,70]),{18:112,19:[1,113],53:53,54:54,58:D},{16:114,40:T,41:E},t(B,[2,44],{46:88,13:k,41:A,48:M,49:N}),{14:115,40:H,50:U,73:W},{16:116,40:T,41:E},{14:117,40:H,50:U,73:W},t(n,[2,13]),t(G,[2,64]),{60:118,62:K},{19:[1,119]},t(n,[2,20]),t(n,[2,23],{17:[1,120],42:j}),t(n,[2,11]),{13:[1,121],42:j},t(n,[2,10]),t(J,[2,69]),t(n,[2,18]),{18:122,19:[1,123],53:53,54:54,58:D},{14:124,40:H,50:U,73:W},{19:[1,125]},t(n,[2,21]),t(n,[2,9]),t(n,[2,19])],defaultActions:{75:[2,60],78:[2,66]},parseError:e(function(e,t){if(t.recoverable)this.trace(e);else{var n=Error(e);throw n.hash=t,n}},`parseError`),parse:e(function(t){var n=this,r=[0],i=[],a=[null],o=[],s=this.table,c=``,l=0,u=0,d=0,f=2,p=1,m=o.slice.call(arguments,1),h=Object.create(this.lexer),g={yy:{}};for(var _ in this.yy)Object.prototype.hasOwnProperty.call(this.yy,_)&&(g.yy[_]=this.yy[_]);h.setInput(t,g.yy),g.yy.lexer=h,g.yy.parser=this,h.yylloc===void 0&&(h.yylloc={});var v=h.yylloc;o.push(v);var y=h.options&&h.options.ranges;typeof g.yy.parseError==`function`?this.parseError=g.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function b(e){r.length-=2*e,a.length-=e,o.length-=e}e(b,`popStack`);function x(){var e=i.pop()||h.lex()||p;return typeof e!=`number`&&(e instanceof Array&&(i=e,e=i.pop()),e=n.symbols_[e]||e),e}e(x,`lex`);for(var S,C,w,T,E,D={},O,k,A,j;;){if(w=r[r.length-1],this.defaultActions[w]?T=this.defaultActions[w]:(S??=x(),T=s[w]&&s[w][S]),T===void 0||!T.length||!T[0]){var M=``;for(O in j=[],s[w])this.terminals_[O]&&O>f&&j.push(`'`+this.terminals_[O]+`'`);M=h.showPosition?`Parse error on line `+(l+1)+`:
2
+ `+h.showPosition()+`
3
+ Expecting `+j.join(`, `)+`, got '`+(this.terminals_[S]||S)+`'`:`Parse error on line `+(l+1)+`: Unexpected `+(S==p?`end of input`:`'`+(this.terminals_[S]||S)+`'`),this.parseError(M,{text:h.match,token:this.terminals_[S]||S,line:h.yylineno,loc:v,expected:j})}if(T[0]instanceof Array&&T.length>1)throw Error(`Parse Error: multiple actions possible at state: `+w+`, token: `+S);switch(T[0]){case 1:r.push(S),a.push(h.yytext),o.push(h.yylloc),r.push(T[1]),S=null,C?(S=C,C=null):(u=h.yyleng,c=h.yytext,l=h.yylineno,v=h.yylloc,d>0&&d--);break;case 2:if(k=this.productions_[T[1]][1],D.$=a[a.length-k],D._$={first_line:o[o.length-(k||1)].first_line,last_line:o[o.length-1].last_line,first_column:o[o.length-(k||1)].first_column,last_column:o[o.length-1].last_column},y&&(D._$.range=[o[o.length-(k||1)].range[0],o[o.length-1].range[1]]),E=this.performAction.apply(D,[c,u,l,g.yy,T[1],a,o].concat(m)),E!==void 0)return E;k&&(r=r.slice(0,-1*k*2),a=a.slice(0,-1*k),o=o.slice(0,-1*k)),r.push(this.productions_[T[1]][0]),a.push(D.$),o.push(D._$),A=s[r[r.length-2]][r[r.length-1]],r.push(A);break;case 3:return!0}}return!0},`parse`)};Y.lexer=(function(){return{EOF:1,parseError:e(function(e,t){if(this.yy.parser)this.yy.parser.parseError(e,t);else throw Error(e)},`parseError`),setInput:e(function(e,t){return this.yy=t||this.yy||{},this._input=e,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match=``,this.conditionStack=[`INITIAL`],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},`setInput`),input:e(function(){var e=this._input[0];return this.yytext+=e,this.yyleng++,this.offset++,this.match+=e,this.matched+=e,e.match(/(?:\r\n?|\n).*/g)?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),e},`input`),unput:e(function(e){var t=e.length,n=e.split(/(?:\r\n?|\n)/g);this._input=e+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-t),this.offset-=t;var r=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),n.length-1&&(this.yylineno-=n.length-1);var i=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:n?(n.length===r.length?this.yylloc.first_column:0)+r[r.length-n.length].length-n[0].length:this.yylloc.first_column-t},this.options.ranges&&(this.yylloc.range=[i[0],i[0]+this.yyleng-t]),this.yyleng=this.yytext.length,this},`unput`),more:e(function(){return this._more=!0,this},`more`),reject:e(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError(`Lexical error on line `+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).
4
+ `+this.showPosition(),{text:``,token:null,line:this.yylineno});return this},`reject`),less:e(function(e){this.unput(this.match.slice(e))},`less`),pastInput:e(function(){var e=this.matched.substr(0,this.matched.length-this.match.length);return(e.length>20?`...`:``)+e.substr(-20).replace(/\n/g,``)},`pastInput`),upcomingInput:e(function(){var e=this.match;return e.length<20&&(e+=this._input.substr(0,20-e.length)),(e.substr(0,20)+(e.length>20?`...`:``)).replace(/\n/g,``)},`upcomingInput`),showPosition:e(function(){var e=this.pastInput(),t=Array(e.length+1).join(`-`);return e+this.upcomingInput()+`
5
+ `+t+`^`},`showPosition`),test_match:e(function(e,t){var n,r,i;if(this.options.backtrack_lexer&&(i={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(i.yylloc.range=this.yylloc.range.slice(0))),r=e[0].match(/(?:\r\n?|\n).*/g),r&&(this.yylineno+=r.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:r?r[r.length-1].length-r[r.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+e[0].length},this.yytext+=e[0],this.match+=e[0],this.matches=e,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(e[0].length),this.matched+=e[0],n=this.performAction.call(this,this.yy,this,t,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),n)return n;if(this._backtrack){for(var a in i)this[a]=i[a];return!1}return!1},`test_match`),next:e(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var e,t,n,r;this._more||(this.yytext=``,this.match=``);for(var i=this._currentRules(),a=0;a<i.length;a++)if(n=this._input.match(this.rules[i[a]]),n&&(!t||n[0].length>t[0].length)){if(t=n,r=a,this.options.backtrack_lexer){if(e=this.test_match(n,i[a]),e!==!1)return e;if(this._backtrack){t=!1;continue}else return!1}else if(!this.options.flex)break}return t?(e=this.test_match(t,i[r]),e===!1?!1:e):this._input===``?this.EOF:this.parseError(`Lexical error on line `+(this.yylineno+1)+`. Unrecognized text.
6
+ `+this.showPosition(),{text:``,token:null,line:this.yylineno})},`next`),lex:e(function(){return this.next()||this.lex()},`lex`),begin:e(function(e){this.conditionStack.push(e)},`begin`),popState:e(function(){return this.conditionStack.length-1>0?this.conditionStack.pop():this.conditionStack[0]},`popState`),_currentRules:e(function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},`_currentRules`),topState:e(function(e){return e=this.conditionStack.length-1-Math.abs(e||0),e>=0?this.conditionStack[e]:`INITIAL`},`topState`),pushState:e(function(e){this.begin(e)},`pushState`),stateStackSize:e(function(){return this.conditionStack.length},`stateStackSize`),options:{"case-insensitive":!0},performAction:e(function(e,t,n,r){switch(n){case 0:return this.begin(`acc_title`),24;case 1:return this.popState(),`acc_title_value`;case 2:return this.begin(`acc_descr`),26;case 3:return this.popState(),`acc_descr_value`;case 4:this.begin(`acc_descr_multiline`);break;case 5:this.popState();break;case 6:return`acc_descr_multiline_value`;case 7:return 33;case 8:return 34;case 9:return 35;case 10:return 36;case 11:return 10;case 12:break;case 13:return 8;case 14:return 50;case 15:return 73;case 16:return 4;case 17:return this.begin(`block`),17;case 18:return 49;case 19:return 49;case 20:return 42;case 21:return 15;case 22:return 13;case 23:break;case 24:return 62;case 25:return 58;case 26:return 58;case 27:this.begin(`block_bq`);break;case 28:return 58;case 29:this.popState();break;case 30:return 63;case 31:break;case 32:return this.popState(),19;case 33:return t.yytext[0];case 34:return 20;case 35:return 21;case 36:return this.begin(`style`),44;case 37:return this.popState(),10;case 38:break;case 39:return 13;case 40:return 42;case 41:return 49;case 42:return this.begin(`style`),37;case 43:return 43;case 44:return 66;case 45:return 68;case 46:return 68;case 47:return 68;case 48:return 66;case 49:return 66;case 50:return 67;case 51:return 67;case 52:return 67;case 53:return 67;case 54:return 67;case 55:return 68;case 56:return 67;case 57:return 68;case 58:return 69;case 59:return 69;case 60:return 51;case 61:return 69;case 62:return 69;case 63:return 69;case 64:return 52;case 65:return 48;case 66:return 69;case 67:return 66;case 68:return 67;case 69:return 68;case 70:return 70;case 71:return 71;case 72:return 72;case 73:return 72;case 74:return 71;case 75:return 71;case 76:return 71;case 77:return 41;case 78:return 47;case 79:return 40;case 80:return t.yytext[0];case 81:return 6}},`anonymous`),rules:[/^(?:accTitle\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*\{\s*)/i,/^(?:[\}])/i,/^(?:[^\}]*)/i,/^(?:.*direction\s+TB[^\n]*)/i,/^(?:.*direction\s+BT[^\n]*)/i,/^(?:.*direction\s+RL[^\n]*)/i,/^(?:.*direction\s+LR[^\n]*)/i,/^(?:[\n]+)/i,/^(?:\s+)/i,/^(?:[\s]+)/i,/^(?:"[^"%\r\n\v\b\\]+")/i,/^(?:"[^"]*")/i,/^(?:erDiagram\b)/i,/^(?:\{)/i,/^(?:#)/i,/^(?:#)/i,/^(?:,)/i,/^(?::::)/i,/^(?::)/i,/^(?:\s+)/i,/^(?:\b((?:PK)|(?:FK)|(?:UK))\b)/i,/^(?:([^\s]*)[~].*[~]([^\s]*))/i,/^(?:([\*A-Za-z_\u00C0-\uFFFF][A-Za-z0-9\-\_\[\]\(\)\.,\u00C0-\uFFFF\*]*))/i,/^(?:[`])/i,/^(?:[^`]+)/i,/^(?:[`])/i,/^(?:"[^"]*")/i,/^(?:[\n]+)/i,/^(?:\})/i,/^(?:.)/i,/^(?:\[)/i,/^(?:\])/i,/^(?:style\b)/i,/^(?:[\n]+)/i,/^(?:\s+)/i,/^(?::)/i,/^(?:,)/i,/^(?:#)/i,/^(?:classDef\b)/i,/^(?:class\b)/i,/^(?:one or zero\b)/i,/^(?:one or more\b)/i,/^(?:one or many\b)/i,/^(?:1\+)/i,/^(?:\|o\b)/i,/^(?:zero or one\b)/i,/^(?:zero or more\b)/i,/^(?:zero or many\b)/i,/^(?:0\+)/i,/^(?:\}o\b)/i,/^(?:many\(0\))/i,/^(?:many\(1\))/i,/^(?:many\b)/i,/^(?:\}\|)/i,/^(?:one\b)/i,/^(?:only one\b)/i,/^(?:[0-9]+\.[0-9]+)/i,/^(?:1(?=\s+[A-Za-z_"']))/i,/^(?:1(?=\s+[0-9]))/i,/^(?:1(?=(--|\.\.|\.-|-\.)))/i,/^(?:1\b)/i,/^(?:[0-9]+)/i,/^(?:\|\|)/i,/^(?:o\|)/i,/^(?:o\{)/i,/^(?:\|\{)/i,/^(?:u(?=[\.\-\|]))/i,/^(?:\.\.)/i,/^(?:--)/i,/^(?:to\b)/i,/^(?:optionally to\b)/i,/^(?:\.-)/i,/^(?:-\.)/i,/^(?:([^\x00-\x7F]|\w|-|\*)+)/i,/^(?:;)/i,/^(?:([^\x00-\x7F]|\w|-|\*|\.)+)/i,/^(?:.)/i,/^(?:$)/i],conditions:{style:{rules:[37,38,39,40,41,77,78],inclusive:!1},acc_descr_multiline:{rules:[5,6],inclusive:!1},acc_descr:{rules:[3],inclusive:!1},acc_title:{rules:[1],inclusive:!1},block_bq:{rules:[28,29],inclusive:!1},block:{rules:[23,24,25,26,27,30,31,32,33],inclusive:!1},INITIAL:{rules:[0,2,4,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,34,35,36,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,79,80,81],inclusive:!0}}}})();function X(){this.yy={}}return e(X,`Parser`),X.prototype=Y,Y.Parser=X,new X})();b.parser=b;var x=b,S=class{constructor(){this.entities=new Map,this.relationships=[],this.classes=new Map,this.direction=`TB`,this.Cardinality={ZERO_OR_ONE:`ZERO_OR_ONE`,ZERO_OR_MORE:`ZERO_OR_MORE`,ONE_OR_MORE:`ONE_OR_MORE`,ONLY_ONE:`ONLY_ONE`,MD_PARENT:`MD_PARENT`},this.Identification={NON_IDENTIFYING:`NON_IDENTIFYING`,IDENTIFYING:`IDENTIFYING`},this.setAccTitle=o,this.getAccTitle=f,this.setAccDescription=i,this.getAccDescription=l,this.setDiagramTitle=a,this.getDiagramTitle=u,this.getConfig=e(()=>d().er,`getConfig`),this.clear(),this.addEntity=this.addEntity.bind(this),this.addAttributes=this.addAttributes.bind(this),this.addRelationship=this.addRelationship.bind(this),this.setDirection=this.setDirection.bind(this),this.addCssStyles=this.addCssStyles.bind(this),this.addClass=this.addClass.bind(this),this.setClass=this.setClass.bind(this),this.setAccTitle=this.setAccTitle.bind(this),this.setAccDescription=this.setAccDescription.bind(this)}static{e(this,`ErDB`)}addEntity(e,t=``){return this.entities.has(e)?!this.entities.get(e)?.alias&&t&&(this.entities.get(e).alias=t,n.info(`Add alias '${t}' to entity '${e}'`)):(this.entities.set(e,{id:`entity-${e}-${this.entities.size}`,label:e,attributes:[],alias:t,shape:`erBox`,look:d().look??`default`,cssClasses:`default`,cssStyles:[],labelType:`markdown`}),n.info(`Added new entity :`,e)),this.entities.get(e)}getEntity(e){return this.entities.get(e)}getEntities(){return this.entities}getClasses(){return this.classes}addAttributes(e,t){let r=this.addEntity(e),i;for(i=t.length-1;i>=0;i--)t[i].keys||(t[i].keys=[]),t[i].comment||(t[i].comment=``),r.attributes.push(t[i]),n.debug(`Added attribute `,t[i].name)}addRelationship(e,t,r,i){let a=this.entities.get(e),o=this.entities.get(r);if(!a||!o)return;let s={entityA:a.id,roleA:t,entityB:o.id,relSpec:i};this.relationships.push(s),n.debug(`Added new relationship :`,s)}getRelationships(){return this.relationships}getDirection(){return this.direction}setDirection(e){this.direction=e}getCompiledStyles(e){let t=[];for(let n of e){let e=this.classes.get(n);e?.styles&&(t=[...t,...e.styles??[]].map(e=>e.trim())),e?.textStyles&&(t=[...t,...e.textStyles??[]].map(e=>e.trim()))}return t}addCssStyles(e,t){for(let n of e){let e=this.entities.get(n);if(!t||!e)return;for(let n of t)e.cssStyles.push(n)}}addClass(e,t){e.forEach(e=>{let n=this.classes.get(e);n===void 0&&(n={id:e,styles:[],textStyles:[]},this.classes.set(e,n)),t&&t.forEach(function(e){if(/color/.exec(e)){let t=e.replace(`fill`,`bgFill`);n.textStyles.push(t)}n.styles.push(e)})})}setClass(e,t){for(let n of e){let e=this.entities.get(n);if(e)for(let n of t)e.cssClasses+=` `+n}}clear(){this.entities=new Map,this.classes=new Map,this.relationships=[],s()}getData(){let e=[],t=[],n=d(),r=0;for(let t of this.entities.keys()){let n=this.entities.get(t);n&&(n.cssCompiledStyles=this.getCompiledStyles(n.cssClasses.split(` `)),n.colorIndex=r++,e.push(n))}let i=0;for(let e of this.relationships){let r={id:m(e.entityA,e.entityB,{prefix:`id`,counter:i++}),type:`normal`,curve:`basis`,start:e.entityA,end:e.entityB,label:e.roleA,labelpos:`c`,thickness:`normal`,classes:`relationshipLine`,arrowTypeStart:e.relSpec.cardB.toLowerCase(),arrowTypeEnd:e.relSpec.cardA.toLowerCase(),pattern:e.relSpec.relType==`IDENTIFYING`?`solid`:`dashed`,look:n.look,labelType:`markdown`};t.push(r)}return{nodes:e,edges:t,other:{},config:n,direction:`TB`}}},C={};t(C,{draw:()=>w});var w=e(async function(e,t,i,a){n.info(`REF0:`),n.info(`Drawing er diagram (unified)`,t);let{securityLevel:o,er:s,layout:c}=d(),l=a.db.getData(),u=g(t,o);l.type=a.type,l.layoutAlgorithm=y(c),l.config.flowchart.nodeSpacing=s?.nodeSpacing||140,l.config.flowchart.rankSpacing=s?.rankSpacing||80,l.direction=a.db.getDirection();let{config:f}=l,{look:p}=f;p===`neo`?l.markers=[`only_one_neo`,`zero_or_one_neo`,`one_or_more_neo`,`zero_or_more_neo`]:l.markers=[`only_one`,`zero_or_one`,`one_or_more`,`zero_or_more`],l.diagramId=t,await v(l,u),l.layoutAlgorithm===`elk`&&u.select(`.edges`).lower();let m=u.selectAll(`[id*="-background"]`);Array.from(m).length>0&&m.each(function(){let e=r(this),t=e.attr(`id`).replace(`-background`,``),n=u.select(`#${CSS.escape(t)}`);if(!n.empty()){let t=n.attr(`transform`);e.attr(`transform`,t)}}),h.insertTitle(u,`erDiagramTitleText`,s?.titleTopMargin??25,a.db.getDiagramTitle()),_(u,8,`erDiagram`,s?.useMaxWidth??!0)},`draw`),T=e((e,t)=>{let n=p;return c(n(e,`r`),n(e,`g`),n(e,`b`),t)},`fade`),E=new Set([`redux-color`,`redux-dark-color`]),D=e(e=>{let{theme:t,look:n,bkgColorArray:r,borderColorArray:i}=e;if(!E.has(t))return``;let a=r?.length>0,o=``;for(let t=0;t<e.THEME_COLOR_LIMIT;t++)o+=`
7
+
8
+ [data-look="${n}"][data-color-id="color-${t}"].node path {
9
+ stroke: ${i[t]};
10
+ ${a?`fill: ${r[t]};`:``}
11
+ }
12
+
13
+ [data-look="${n}"][data-color-id="color-${t}"].node rect {
14
+ stroke: ${i[t]};
15
+ ${a?`fill: ${r[t]};`:``}
16
+ }
17
+ `;return o},`genColor`),O={parser:x,get db(){return new S},renderer:C,styles:e(e=>{let{look:t,theme:n,erEdgeLabelBackground:r,strokeWidth:i}=e;return`
18
+ ${D(e)}
19
+ .entityBox {
20
+ fill: ${e.mainBkg};
21
+ stroke: ${e.nodeBorder};
22
+ }
23
+
24
+ .relationshipLabelBox {
25
+ fill: ${e.tertiaryColor};
26
+ opacity: 0.7;
27
+ background-color: ${e.tertiaryColor};
28
+ rect {
29
+ opacity: 0.5;
30
+ }
31
+ }
32
+
33
+ .labelBkg {
34
+ background-color: ${E.has(n)&&r?r:T(e.tertiaryColor,.5)};
35
+ }
36
+
37
+ .edgeLabel {
38
+ background-color: ${E.has(n)&&r?r:e.edgeLabelBackground};
39
+ }
40
+ .edgeLabel .label rect {
41
+ fill: ${E.has(n)&&r?r:e.edgeLabelBackground};
42
+ }
43
+ .edgeLabel .label text {
44
+ fill: ${e.textColor};
45
+ }
46
+
47
+ .edgeLabel .label {
48
+ fill: ${e.nodeBorder};
49
+ font-size: 14px;
50
+ }
51
+
52
+ .label {
53
+ font-family: ${e.fontFamily};
54
+ color: ${e.nodeTextColor||e.textColor};
55
+ }
56
+
57
+ .edge-pattern-dashed {
58
+ stroke-dasharray: 8,8;
59
+ }
60
+
61
+ .node rect,
62
+ .node circle,
63
+ .node ellipse,
64
+ .node polygon
65
+ {
66
+ fill: ${e.mainBkg};
67
+ stroke: ${e.nodeBorder};
68
+ stroke-width: ${t===`neo`?i:`1px`};
69
+ }
70
+
71
+ .relationshipLine {
72
+ stroke: ${e.lineColor};
73
+ stroke-width: ${t===`neo`?i:`1px`};
74
+ fill: none;
75
+ }
76
+
77
+ .marker {
78
+ fill: none !important;
79
+ stroke: ${e.lineColor} !important;
80
+ stroke-width: 1;
81
+ }
82
+ [data-look=neo].labelBkg {
83
+ background-color: ${T(e.tertiaryColor,.5)};
84
+ }
85
+ `},`getStyles`)};export{O as diagram};
@@ -0,0 +1 @@
1
+ import{a as e}from"./rolldown-runtime-CNC7AqOf.js";import{i as t,r as n}from"./bundle-mjs-D3mlU5Wg.js";import{E as r,T as i,c as a,w as o,y as s}from"./vscode-BO5mAFne.js";import{i as c,r as l,t as u}from"./switch-DI9z38Ya.js";import{a as d,i as ee,n as f,r as p,t as m}from"./desktop-client-D5160ONr.js";import{G as h,H as g,L as _,R as v,V as y,i as te,o as ne,s as re}from"./index-BA-eNxbD.js";import{n as ie,t as b}from"./badge-Bzt6S3c1.js";var ae=i(`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`}]]),x=i(`puzzle`,[[`path`,{d:`M15.39 4.39a1 1 0 0 0 1.68-.474 2.5 2.5 0 1 1 3.014 3.015 1 1 0 0 0-.474 1.68l1.683 1.682a2.414 2.414 0 0 1 0 3.414L19.61 15.39a1 1 0 0 1-1.68-.474 2.5 2.5 0 1 0-3.014 3.015 1 1 0 0 1 .474 1.68l-1.683 1.682a2.414 2.414 0 0 1-3.414 0L8.61 19.61a1 1 0 0 0-1.68.474 2.5 2.5 0 1 1-3.014-3.015 1 1 0 0 0 .474-1.68l-1.683-1.682a2.414 2.414 0 0 1 0-3.414L4.39 8.61a1 1 0 0 1 1.68.474 2.5 2.5 0 1 0 3.014-3.015 1 1 0 0 1-.474-1.68l1.683-1.682a2.414 2.414 0 0 1 3.414 0z`,key:`w46dr5`}]]),S=e(t(),1),C=`/api/marketplace/catalog`,w={version:1,counts:{total:0,plugins:0,skills:0,mcps:0},tags:[],entries:[]};function T(e){return e===`mcp`||e===`skill`||e===`plugin`}function E(e){return Array.isArray(e)?e.filter(e=>typeof e==`string`):[]}function D(e){return typeof e==`number`&&Number.isFinite(e)?e:0}function O(e){if(!Array.isArray(e))return;let t=e.map(e=>{if(!e||typeof e!=`object`)return null;let t=e;if(typeof t.name!=`string`)return null;let n={name:t.name};return typeof t.required==`boolean`&&(n.required=t.required),typeof t.description==`string`&&(n.description=t.description),typeof t.url==`string`&&(n.url=t.url),n}).filter(e=>e!==null);return t.length>0?t:void 0}async function k(){let e=await fetch(C,{headers:{Accept:`application/json`}});if(!e.ok)throw Error(`Failed to fetch marketplace: ${e.status}`);let t=await e.json(),n=typeof t?.baseUrl==`string`?t.baseUrl:void 0,r=typeof t?.counts==`object`&&t.counts!==null?t.counts:{},i=Array.isArray(t?.tags)?t.tags.map(e=>{if(!e||typeof e!=`object`)return null;let t=e;return typeof t.id!=`string`||typeof t.label!=`string`?null:{id:t.id,label:t.label,count:D(t.count)}}).filter(e=>e!==null):[],a=Array.isArray(t?.entries)?t.entries.map(e=>{if(!e||typeof e!=`object`)return null;let t=e,n=typeof t.install==`object`&&t.install!==null?t.install:{};return typeof t.id!=`string`||!T(t.type)||typeof t.name!=`string`||typeof t.tagline!=`string`||typeof t.description!=`string`||typeof n.command!=`string`?null:{id:t.id,type:t.type,name:t.name,featured:typeof t.featured==`boolean`?t.featured:void 0,tagline:t.tagline,description:t.description,tags:E(t.tags),install:{args:E(n.args),command:n.command,env:O(n.env),notes:typeof n.notes==`string`?n.notes:void 0}}}).filter(e=>e!==null&&e.install.args.length>0):[];return{version:D(t?.version)||w.version,generatedAt:typeof t?.generatedAt==`string`?t.generatedAt:void 0,baseUrl:n,counts:{total:D(r.total)||a.length,plugins:D(r.plugins),skills:D(r.skills),mcps:D(r.mcps)},tags:i,entries:a}}var A=n(),j=3e5,M={fontFamily:`ui-monospace, "SFMono-Regular", Menlo, Consolas, "Liberation Mono", monospace`},N={mcp:{title:`MCP Servers`,description:`Install Model Context Protocol servers into this CLI environment.`,emptyInstalled:`No MCP servers installed.`,emptyCatalog:`No MCP servers match the current filters.`,icon:v},skill:{title:`Skills`,description:`Install skills globally for Cline.`,emptyInstalled:`No skills installed.`,emptyCatalog:`No skills match the current filters.`,icon:f},plugin:{title:`Plugins`,description:`Install plugins into this CLI environment.`,emptyInstalled:`No plugins installed.`,emptyCatalog:`No plugins match the current filters.`,icon:x}},oe={mcp:`cline mcp install`,plugin:`cline plugin install`,skill:`cline skill add`};function P(e){return`${e.type}:${e.id}`}function se(e,t){return Number(!!t.featured)-Number(!!e.featured)}function F(e){return e.trim().toLowerCase()}function I(e){return new Set([e.id,e.name,...e.install.args].map(F).filter(Boolean))}function ce(e,t){let n=I(e);return t.matchValues.map(F).filter(Boolean).some(e=>n.has(e))}function L(e,t){return[e.name,e.tagline,e.description,e.type,...e.tags.map(e=>t.get(e)??e)].join(` `).toLowerCase()}function R(e){if(e?.status===`installed`||e?.status===`uninstalled`||e?.status===`failed`)return e.message}function z({actionState:e,entry:t}){let n=t.install.env?.filter(e=>e.required!==!1)??[],r=t.install.env?.filter(e=>e.required===!1)??[];return n.length>0||r.length>0||t.install.notes||e?.status===`failed`?(0,A.jsxs)(`div`,{className:`grid gap-3 border-t pt-3`,"data-marketplace-entry-details":!0,children:[n.length>0||r.length>0?(0,A.jsxs)(`div`,{className:`rounded-lg border border-amber-500/30 bg-amber-500/10 p-3`,children:[(0,A.jsx)(`p`,{className:`text-sm font-medium text-amber-800 dark:text-amber-200`,children:`Environment setup needed`}),(0,A.jsx)(`p`,{className:`mt-1 text-xs leading-5 text-amber-800/80 dark:text-amber-100/80`,children:`Add these values to your Cline/plugin environment after install.`}),(0,A.jsx)(`div`,{className:`mt-3 grid gap-2`,children:[...n,...r].map(e=>(0,A.jsxs)(`div`,{className:`rounded-md border border-amber-500/20 bg-background/60 p-2`,children:[(0,A.jsxs)(`div`,{className:`flex items-center justify-between gap-2`,children:[(0,A.jsx)(`code`,{className:`font-mono text-xs font-semibold`,children:(0,A.jsx)(`span`,{style:M,children:e.name})}),(0,A.jsx)(b,{variant:`outline`,children:e.required===!1?`Optional`:`Required`})]}),e.description?(0,A.jsx)(`p`,{className:`mt-1 text-xs text-muted-foreground`,children:e.description}):null,e.url?(0,A.jsxs)(`a`,{className:`mt-1 inline-flex items-center gap-1 text-xs text-primary hover:underline`,href:e.url,rel:`noreferrer`,target:`_blank`,children:[`Get value`,(0,A.jsx)(d,{className:`size-3`})]}):null]},e.name))})]}):null,t.install.notes?(0,A.jsx)(`p`,{className:`rounded-lg border bg-muted/30 p-3 text-xs leading-5 text-muted-foreground`,children:t.install.notes}):null,e?.status===`failed`?(0,A.jsx)(`div`,{className:`max-h-44 overflow-auto rounded-lg border border-destructive/40 bg-destructive/10 p-3 text-sm text-destructive`,children:e.message}):null]}):null}function B({actionState:e,entry:t,expanded:n,installed:i,installedStatusReady:a,onInstall:c,onToggleExpanded:l,onUninstall:u,matchedLocalItems:d=[],showFeatured:ee=!0,showTags:f=!0,sourceLabel:m,tagLabels:h}){let g=N[t.type].icon,_=e?.status===`installing`||e?.status===`uninstalling`,v=!!t.install.env?.length,y=v||!!t.install.notes||e?.status===`failed`,te=R(e),ne=e=>{if(e.stopPropagation(),i){u(t);return}c(t)},re=a?e?.status===`installing`?`Installing...`:e?.status===`uninstalling`?`Uninstalling...`:i?`Uninstall`:`Install`:`Checking...`,ae=te?(0,A.jsx)(`output`,{className:r(`text-xs`,e?.status===`failed`?`text-destructive`:`text-muted-foreground`),children:te}):v?(0,A.jsx)(`span`,{className:`text-xs text-amber-700 dark:text-amber-300`,children:`Requires setup after install`}):null,x=(0,A.jsxs)(s,{disabled:!a||_,onClick:ne,size:`sm`,type:`button`,variant:i?`destructive`:`default`,children:[_||!a?(0,A.jsx)(ie,{}):null,i&&!_?(0,A.jsx)(o,{className:`size-4`}):null,re]}),S=(0,A.jsxs)(A.Fragment,{children:[i?null:(0,A.jsx)(`div`,{className:`absolute top-4 right-4`,"data-marketplace-entry-interactive":!0,children:x}),(0,A.jsxs)(`div`,{className:`min-w-0`,children:[(0,A.jsxs)(`div`,{className:`flex min-w-0 items-start justify-between gap-2`,children:[(0,A.jsxs)(`div`,{className:r(`flex min-w-0 flex-1 items-center gap-2`,!i&&`pr-24`),children:[(0,A.jsx)(g,{className:`h-4 w-4 shrink-0 text-primary`}),(0,A.jsx)(`h2`,{className:`min-w-0 truncate text-sm font-semibold text-foreground`,children:t.name}),ee&&t.featured?(0,A.jsxs)(b,{className:`border border-violet-500/20 bg-violet-500/10 text-violet-700 dark:text-violet-300`,children:[(0,A.jsx)(p,{className:`fill-current`}),`Featured`]}):null]}),(0,A.jsxs)(`div`,{className:`flex shrink-0 flex-wrap items-center justify-end gap-2`,children:[m?(0,A.jsx)(b,{variant:`outline`,className:`shrink-0 text-muted-foreground`,children:m}):null,d.map(e=>e.renderMatchedBadges?(0,A.jsx)(`span`,{className:`contents`,children:e.renderMatchedBadges()},`${e.key}:badges`):null),d.map(e=>e.renderMatchedControls?(0,A.jsx)(`span`,{className:`contents`,"data-marketplace-entry-interactive":!0,children:e.renderMatchedControls()},`${e.key}:controls`):null)]})]}),d.some(e=>e.renderMatchedMeta)?(0,A.jsx)(`div`,{className:`mt-1 grid gap-1`,children:d.map(e=>e.renderMatchedMeta?(0,A.jsx)(`div`,{children:e.renderMatchedMeta()},`${e.key}:meta`):null)}):null]}),(0,A.jsxs)(`div`,{className:`flex flex-col gap-3 sm:flex-row sm:items-stretch sm:justify-between`,children:[(0,A.jsxs)(`div`,{className:`grid min-w-0 flex-1 gap-2`,children:[f&&t.tags.length>0?(0,A.jsx)(`div`,{className:`flex flex-wrap gap-1.5`,children:t.tags.slice(0,5).map(e=>(0,A.jsx)(b,{variant:`outline`,className:`max-w-full text-muted-foreground`,children:(0,A.jsx)(`span`,{className:`truncate`,children:h.get(e)??e})},e))}):null,(0,A.jsx)(`p`,{className:`line-clamp-2 text-xs leading-5 text-muted-foreground`,children:t.description}),ae]}),i?(0,A.jsx)(`div`,{className:`flex shrink-0 flex-col items-start gap-1 sm:items-end sm:justify-end`,children:x}):null]}),d.some(e=>e.renderMatchedDetails)?(0,A.jsx)(`div`,{className:`grid gap-2`,"data-marketplace-entry-details":!0,children:d.map(e=>e.renderMatchedDetails?(0,A.jsx)(`div`,{children:e.renderMatchedDetails()},e.key):null)}):null,n&&y?(0,A.jsx)(z,{actionState:e,entry:t}):null]});return y?(0,A.jsx)(`div`,{"aria-expanded":n,"aria-label":`${n?`Collapse`:`Expand`} ${t.name}`,className:`relative grid cursor-pointer gap-2 rounded-lg border bg-card p-4 text-left transition-colors hover:bg-accent/20 focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 focus-visible:outline-none`,onClick:e=>{e.target instanceof HTMLElement&&e.target.closest(`[data-marketplace-entry-details], [data-marketplace-entry-interactive]`)||l(t)},onKeyDown:e=>{e.target===e.currentTarget&&(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),l(t))},role:`button`,tabIndex:0,children:S}):(0,A.jsx)(`div`,{className:`relative grid gap-2 rounded-lg border bg-card p-4 text-left transition-colors hover:bg-accent/20`,children:S})}function V({active:e,count:t,onClick:n,tag:r}){return(0,A.jsxs)(s,{"aria-pressed":e,onClick:n,size:`sm`,type:`button`,variant:e?`default`:`outline`,children:[(0,A.jsx)(`span`,{className:`truncate`,children:r.label}),(0,A.jsx)(`span`,{className:`rounded bg-background/30 px-1.5 py-0.5 text-xs`,children:t})]})}function H({actionStates:e,emptyMessage:t,entries:n,expandedEntryKey:r,headerContent:i,installedEntryKeys:a,installedStatusReady:o,localOnlyInstalledItems:s=[],matchedLocalItemsByEntryKey:c,onInstall:l,onToggleExpanded:u,onUninstall:d,showFeaturedBadges:ee=!0,showEntryTags:f=!0,sourceLabel:p,tagLabels:m,title:h}){let g=n.length+s.length;return(0,A.jsxs)(`section`,{className:`grid gap-3`,children:[(0,A.jsxs)(`div`,{className:`flex items-center justify-between gap-3`,children:[(0,A.jsx)(`h2`,{className:`text-base font-semibold text-foreground`,children:h}),(0,A.jsx)(`span`,{className:`text-sm text-muted-foreground`,children:g})]}),i,g>0?(0,A.jsxs)(`div`,{className:`grid gap-3`,children:[s.map(e=>e.render()),n.map(t=>{let n=P(t);return(0,A.jsx)(B,{actionState:e.get(n),entry:t,expanded:r===n,installed:a.has(n),installedStatusReady:o,onInstall:l,onToggleExpanded:u,onUninstall:d,matchedLocalItems:c?.get(n)??[],showFeatured:ee,showTags:f,sourceLabel:p,tagLabels:m},n)})]}):(0,A.jsx)(`div`,{className:`rounded-lg border border-dashed bg-card p-6 text-center text-sm text-muted-foreground`,children:t})]})}function le({chrome:e=`page`,installedItems:t,onInstalledItemsChanged:n,primitive:r}){let[i,o]=(0,S.useState)(null),[c,u]=(0,S.useState)(null),[d,ee]=(0,S.useState)(``),[f,p]=(0,S.useState)(null),[h,g]=(0,S.useState)(null),[_,v]=(0,S.useState)(()=>new Set),[y,b]=(0,S.useState)(()=>new Map),[ae,x]=(0,S.useState)(`loading`);(0,S.useEffect)(()=>{let e=!1;return(async()=>{try{e||x(`loading`);let t=await k();e||(o(t),u(null));try{let n=await m.invoke(`list_marketplace_installed_entries`,{entries:t.entries});e||(v(new Set(n.installedKeys)),x(`ready`))}catch{e||x(`ready`)}}catch(t){e||(u(t instanceof Error?t.message:String(t)),x(`ready`))}})(),()=>{e=!0}},[]);let C=N[r],w=C.icon,T=(0,S.useMemo)(()=>new Map(i?.tags.map(e=>[e.id,e.label])??[]),[i?.tags]),E=(0,S.useMemo)(()=>(i?.entries.filter(e=>e.type===r)??[]).sort(se),[i?.entries,r]),D=(0,S.useMemo)(()=>{let e=d.trim().toLowerCase();return E.filter(t=>e.length===0||L(t,T).includes(e))},[E,d,T]),O=(0,S.useMemo)(()=>D.filter(e=>_.has(P(e))),[D,_]),M=(0,S.useMemo)(()=>D.filter(e=>!_.has(P(e))),[D,_]),I=(0,S.useMemo)(()=>{let e=new Map;for(let t of M)for(let n of t.tags)e.set(n,(e.get(n)??0)+1);return e},[M]),R=(0,S.useMemo)(()=>(i?.tags??[]).filter(e=>(I.get(e.id)??0)>0),[i?.tags,I]),z=(0,S.useMemo)(()=>M.filter(e=>!f||e.tags.includes(f)),[M,f]),B=(0,S.useMemo)(()=>{let e=new Map;for(let n of t??[])for(let t of O){let r=P(t);if(!ce(t,n))continue;let i=e.get(r)??[];i.push(n),e.set(r,i)}return e},[O,t]),le=(0,S.useMemo)(()=>{let e=new Set,n=E.filter(e=>_.has(P(e)));for(let r of t??[])n.some(e=>ce(e,r))&&e.add(r.key);return e},[_,t,E]),ue=(0,S.useMemo)(()=>{let e=d.trim().toLowerCase();return(t??[]).filter(t=>le.has(t.key)?!1:e.length===0||t.matchValues.map(F).some(t=>t.includes(e)))},[t,le,d]),U=ae===`ready`,de=R.length>0?(0,A.jsxs)(`div`,{className:`flex flex-col gap-2 md:flex-row md:items-center md:justify-between`,children:[(0,A.jsx)(`div`,{className:`flex gap-2 overflow-x-auto pb-1`,children:R.map(e=>(0,A.jsx)(V,{active:f===e.id,count:I.get(e.id)??0,onClick:()=>p(t=>t===e.id?null:e.id),tag:e},e.id))}),(0,A.jsxs)(`div`,{className:`flex min-h-8 shrink-0 items-center gap-2 text-sm text-muted-foreground`,children:[(0,A.jsx)(`span`,{className:`font-medium text-foreground`,children:z.length}),(0,A.jsx)(`span`,{children:z.length===1?`result`:`results`}),f?(0,A.jsx)(s,{onClick:()=>p(null),size:`sm`,type:`button`,variant:`ghost`,children:`Clear filters`}):null]})]}):null,W=(e,t)=>{let n=P(e);b(e=>{let r=new Map(e);return r.set(n,t),r})},fe=e=>{v(t=>new Set(t).add(P(e)))},G=e=>{v(t=>{let n=new Set(t);return n.delete(P(e)),n})},pe=e=>{let t=P(e);g(e=>e===t?null:t)},K=async e=>{let t=P(e),r=y.get(t);if(!(r?.status===`installing`||r?.status===`uninstalling`)){g(t),W(e,{status:`installing`});try{W(e,{status:`installed`,message:(await m.invoke(`install_marketplace_entry`,{entry:e},{timeoutMs:j})).message}),fe(e),await n?.()}catch(t){W(e,{status:`failed`,message:t instanceof Error?t.message:String(t)})}}},q=async e=>{let t=P(e),r=y.get(t);if(!(r?.status===`installing`||r?.status===`uninstalling`)){g(t),W(e,{status:`uninstalling`});try{W(e,{status:`uninstalled`,message:(await m.invoke(`uninstall_marketplace_entry`,{entry:e},{timeoutMs:j})).message}),G(e),await n?.()}catch(t){W(e,{status:`failed`,message:t instanceof Error?t.message:String(t)})}}},me=(0,A.jsxs)(`div`,{className:`grid gap-6`,children:[e===`page`?(0,A.jsx)(re,{description:C.description,icon:w,title:C.title,meta:(0,A.jsx)(te,{children:oe[r]}),actions:i?.generatedAt?(0,A.jsxs)(`p`,{className:`text-xs text-muted-foreground`,children:[`Updated`,` `,new Intl.DateTimeFormat(void 0,{month:`short`,day:`numeric`,year:`numeric`}).format(new Date(i.generatedAt))]}):null}):null,!i&&!c?(0,A.jsxs)(`div`,{className:`flex min-h-80 items-center justify-center rounded-lg border bg-card text-sm text-muted-foreground`,children:[(0,A.jsx)(ie,{className:`mr-2`}),`Loading marketplace...`]}):null,i&&!U?(0,A.jsxs)(`div`,{className:`flex min-h-80 items-center justify-center rounded-lg border bg-card text-sm text-muted-foreground`,children:[(0,A.jsx)(ie,{className:`mr-2`}),`Checking installed status...`]}):null,c?(0,A.jsx)(`div`,{className:`rounded-lg border border-destructive/40 bg-destructive/10 p-4 text-sm text-destructive`,children:c}):null,i&&U?(0,A.jsxs)(`div`,{className:`grid gap-6`,children:[(0,A.jsx)(`div`,{className:`grid gap-3`,children:(0,A.jsx)(`div`,{className:`flex flex-col gap-3 md:flex-row md:items-center`,children:(0,A.jsxs)(`div`,{className:`relative block flex-1`,children:[(0,A.jsx)(l,{className:`pointer-events-none absolute left-2.5 top-1/2 size-4 -translate-y-1/2 text-muted-foreground`}),(0,A.jsx)(a,{"aria-label":`Search ${C.title}`,className:`h-10 pl-8`,onChange:e=>ee(e.target.value),placeholder:`Search ${C.title.toLowerCase()}`,value:d})]})})}),(0,A.jsx)(H,{actionStates:y,emptyMessage:C.emptyInstalled,entries:O,expandedEntryKey:h,installedEntryKeys:_,installedStatusReady:U,localOnlyInstalledItems:ue,matchedLocalItemsByEntryKey:B,onInstall:K,onToggleExpanded:pe,onUninstall:q,showFeaturedBadges:!1,showEntryTags:!1,sourceLabel:`Marketplace`,tagLabels:T,title:`Installed`}),(0,A.jsx)(H,{actionStates:y,emptyMessage:C.emptyCatalog,entries:z,expandedEntryKey:h,headerContent:de,installedEntryKeys:_,installedStatusReady:U,onInstall:K,onToggleExpanded:pe,onUninstall:q,tagLabels:T,title:`Marketplace`})]}):null]});return e===`embedded`?me:(0,A.jsx)(ne,{children:me})}var ue={Rules:`Review project and global rule files that shape Cline behavior.`,Hooks:`Inspect hook configuration and recent execution status.`,MCP:`Manage installed MCP servers and add new servers from the marketplace.`,Skills:`Manage installed skills and add new skills from the marketplace.`,Agents:`Review configured agents discovered from local settings.`,Plugins:`Manage installed plugins and add new plugins from the marketplace.`,Tools:`Inspect built-in tools and tools contributed by plugins.`},U={Rules:`cline config rules`,Hooks:`cline config hooks`,MCP:`cline mcp install`,Skills:`cline skill`,Agents:`cline config agents`,Plugins:`cline plugin`,Tools:`cline config tools`},de={settingsPath:``,hasSettingsFile:!1,servers:[]};function W(e){return Array.isArray(e)?e:[]}function fe(e){return{workspaceRoot:typeof e?.workspaceRoot==`string`?e.workspaceRoot:``,rules:W(e?.rules),workflows:W(e?.workflows),skills:W(e?.skills),agents:W(e?.agents),plugins:W(e?.plugins),tools:W(e?.tools),hooks:W(e?.hooks),mcp:e?.mcp&&typeof e.mcp==`object`?{settingsPath:typeof e.mcp.settingsPath==`string`?e.mcp.settingsPath:``,hasSettingsFile:!!e.mcp.hasSettingsFile,servers:W(e.mcp.servers)}:{...de},warnings:W(e?.warnings)}}var G=6e4,pe=3e4,K=null,q=null;function me(e,t){return!!(e&&t-e.fetchedAt<G&&Array.isArray(e.tools)&&e.tools.length>0)}function he(e,t=150){let n=e.replace(/\s+/g,` `).trim();return n.length<=t?n:`${n.slice(0,t).trimEnd()}...`}function J(e){return e.replaceAll(`\\`,`/`)}function ge(e,t){let n=J(t),r=J(e);return n&&r.startsWith(`${n}/`)?`Project`:`Global`}function Y({scope:e}){return(0,A.jsx)(b,{variant:`outline`,className:`shrink-0 text-muted-foreground`,children:e})}function _e(...e){let t=new Set;for(let n of e){let e=n?.trim().replaceAll(`\\`,`/`);if(!e)continue;t.add(e);let r=e.split(`/`).filter(Boolean);for(let e of r)t.add(e.replace(/\.[^.]+$/,``));for(let e=0;e<r.length-1;e+=1)t.add(`${r[e]}/${r[e+1]}`)}return[...t]}async function ve(){return fe(await m.invoke(`list_user_instruction_configs`))}function ye(e,t){return(e instanceof Error?e.message:String(e)).includes(`unsupported desktop command: ${t}`)}function be({catalogPrimitive:e,section:t=`Rules`,showTabs:n=!1}){let[i,a]=(0,S.useState)(t),[l,d]=(0,S.useState)(()=>!me(K,Date.now())),[p,C]=(0,S.useState)(null),[w,T]=(0,S.useState)(()=>K?.workspaceRoot??``),[E,D]=(0,S.useState)(()=>K?.rules??[]),[O,k]=(0,S.useState)(()=>K?.workflows??[]),[j,M]=(0,S.useState)(()=>K?.skills??[]),[N,oe]=(0,S.useState)(()=>K?.agents??[]),[P,se]=(0,S.useState)(()=>K?.plugins??[]),[F,I]=(0,S.useState)(()=>K?.tools??[]),[ce,L]=(0,S.useState)(()=>K?.hooks??[]),[R,z]=(0,S.useState)(()=>K?.mcp??de),[B,V]=(0,S.useState)(()=>K?.warnings??[]),[H,W]=(0,S.useState)(()=>q?.hookExecutionByEvent??{}),[G,be]=(0,S.useState)(()=>q?.hookExecutionSessionId??null),[xe,Se]=(0,S.useState)(!1),[X,Ce]=(0,S.useState)(()=>new Set),[we,Te]=(0,S.useState)(()=>new Set),[Ee,De]=(0,S.useState)(()=>new Set),[Oe,ke]=(0,S.useState)(()=>new Map);(0,S.useEffect)(()=>{a(t)},[t]);let Z=(0,S.useCallback)(async(e=!1)=>{if(!e&&me(K,Date.now())){T(K.workspaceRoot),D(K.rules),k(K.workflows),M(K.skills),oe(K.agents),se(K.plugins),I(K.tools),L(K.hooks),z(K.mcp),V(K.warnings),C(null),d(!1);return}d(!0),C(null);try{let e=await ve();T(e.workspaceRoot),D(e.rules),k(e.workflows),M(e.skills),oe(e.agents),se(e.plugins),I(e.tools),L(e.hooks),z(e.mcp),V(e.warnings),K={...e,fetchedAt:Date.now()}}catch(e){C(e instanceof Error?e.message:String(e))}finally{d(!1)}},[]),Ae=(0,S.useCallback)(async(e=!1)=>{if(!e&&q&&Date.now()-q.fetchedAt<pe){W(q.hookExecutionByEvent),be(q.hookExecutionSessionId);return}Se(!0);try{let e=(await m.invoke(`list_cli_sessions`,{limit:300})??[]).filter(e=>typeof e.sessionId==`string`&&e.sessionId.trim().length>0).sort((e,t)=>(t.startedAt??``).localeCompare(e.startedAt??``))[0];if(!e?.sessionId){W({}),be(null),q={hookExecutionByEvent:{},hookExecutionSessionId:null,fetchedAt:Date.now()};return}let t=await m.invoke(`read_session_hooks`,{sessionId:e.sessionId,limit:5e3}),n={};for(let e of t??[]){let t=e.hookEventName?.trim();if(!t)continue;let r=n[t]??{count:0,lastTs:null};r.count+=1,e.ts&&(!r.lastTs||e.ts>r.lastTs)&&(r.lastTs=e.ts),n[t]=r}W(n),be(e.sessionId),q={hookExecutionByEvent:n,hookExecutionSessionId:e.sessionId,fetchedAt:Date.now()}}catch{}finally{Se(!1)}},[]),je=(0,S.useCallback)(e=>{let t=fe(e);T(t.workspaceRoot),D(t.rules),k(t.workflows),M(t.skills),oe(t.agents),se(t.plugins),I(t.tools),L(t.hooks),z(t.mcp),V(t.warnings),K={...t,fetchedAt:Date.now()}},[]),Q=(0,S.useCallback)(async e=>{Ce(t=>new Set(t).add(e.id)),C(null);try{let t=[e.name,...e.headlessToolNames??[]].filter(Boolean);if(t.length===0)throw Error(`tool name is required`);let n;try{n=await m.invoke(`set_tool_disabled`,{names:t,disabled:e.enabled})}catch(e){if(!ye(e,`set_tool_disabled`))throw e;for(let e of t)n=await m.invoke(`toggle_disabled_plugin_tool`,{name:e})}if(!n)throw Error(`tool toggle did not return an updated extension list`);je(n)}catch(e){C(e instanceof Error?e.message:String(e))}finally{Ce(t=>{let n=new Set(t);return n.delete(e.id),n})}},[je]),Me=(0,S.useCallback)(async e=>{Te(t=>new Set(t).add(e.path)),C(null);try{je(await m.invoke(`set_plugin_disabled`,{path:e.path,disabled:e.enabled}))}catch(e){C(e instanceof Error?e.message:String(e))}finally{Te(t=>{let n=new Set(t);return n.delete(e.path),n})}},[je]),Ne=(0,S.useCallback)(async e=>{if(!Ee.has(e.key)){De(t=>new Set(t).add(e.key)),ke(t=>{let n=new Map(t);return n.delete(e.key),n}),C(null);try{let t=await m.invoke(`uninstall_local_primitive`,{type:e.type,id:e.id,name:e.name,path:e.path});ke(n=>{let r=new Map(n);return r.set(e.key,{status:`success`,message:t.message??`Uninstalled ${e.name??e.id??e.path}.`}),r}),await Z(!0)}catch(t){let n=t instanceof Error?t.message:String(t);ke(t=>{let r=new Map(t);return r.set(e.key,{status:`failed`,message:n}),r}),C(n)}finally{De(t=>{let n=new Set(t);return n.delete(e.key),n})}}},[Ee,Z]),Pe=(0,S.useCallback)(e=>{if(!e)return`never`;let t=Number(e),n=Number.isFinite(t)?new Date(t):new Date(e);return Number.isNaN(n.getTime())?e:n.toLocaleString()},[]);(0,S.useEffect)(()=>{let e=window.setTimeout(()=>{Z(!1)},0);return()=>window.clearTimeout(e)},[Z]),(0,S.useEffect)(()=>{if(i!==`Hooks`)return;let e=window.setTimeout(()=>{Ae(!1)},0);return()=>window.clearTimeout(e)},[i,Ae]);let Fe=[`Rules`,`Hooks`,`Skills`,`Agents`,`Plugins`,`Tools`],Ie=(0,S.useMemo)(()=>{let e=O.map(e=>({id:e.id,type:`workflow`,name:e.name,instructions:e.instructions,path:e.path,scope:ge(e.path,w)})),t=j.map(e=>({id:J(e.path).toLowerCase(),type:`skill`,name:e.name,description:e.description,instructions:e.instructions,path:e.path,scope:ge(e.path,w)}));return[...e,...t].sort((e,t)=>e.name.localeCompare(t.name))},[j,O,w]),{projectRules:Le,globalRules:Re}=(0,S.useMemo)(()=>{let e=J(w),t=[],n=[];for(let r of E){let i=J(r.path);e&&i.startsWith(`${e}/`)&&i.includes(`/.clinerules/`)?t.push(r):n.push(r)}return{projectRules:t,globalRules:n}},[E,w]),{projectHooks:ze,globalHooks:Be}=(0,S.useMemo)(()=>{let e=J(w),t=[],n=[];for(let r of ce){let i=J(r.path);e&&i.startsWith(`${e}/`)&&i.includes(`/.clinerules/hooks`)?t.push(r):n.push(r)}return{projectHooks:t,globalHooks:n}},[ce,w]),{projectPlugins:Ve,globalPlugins:He}=(0,S.useMemo)(()=>{let e=J(w),t=[],n=[];for(let r of P){let i=J(r.path);e&&i.startsWith(`${e}/`)&&i.includes(`/.cline/plugins`)?t.push(r):n.push(r)}return{projectPlugins:t,globalPlugins:n}},[P,w]),Ue=(0,S.useMemo)(()=>F.filter(e=>e.source===`builtin`),[F]),We=(0,S.useMemo)(()=>F.filter(e=>e.source!==`builtin`),[F]),$=(0,S.useMemo)(()=>{let e=new Map;for(let t of We){let n=`${t.pluginName??``}:${t.path??``}`,r=e.get(n)??[];r.push(t),e.set(n,r)}for(let t of e.values())t.sort((e,t)=>e.name.localeCompare(t.name));return e},[We]),Ge=(0,S.useMemo)(()=>[...He.map(e=>({plugin:e,scope:`Global`})),...Ve.map(e=>({plugin:e,scope:`Project`}))],[He,Ve]),Ke=(0,S.useMemo)(()=>[...Re.map(e=>({rule:e,scope:`Global`})),...Le.map(e=>({rule:e,scope:`Project`}))],[Re,Le]),qe=(0,S.useMemo)(()=>[...Be.map(e=>({hook:e,scope:`Global`})),...ze.map(e=>({hook:e,scope:`Project`}))],[Be,ze]),Je=e=>{let t=Oe.get(e);return t?(0,A.jsx)(`output`,{className:r(`text-xs`,t.status===`failed`?`text-destructive`:`text-muted-foreground`),children:t.message}):null},Ye=e=>{let t=Ee.has(e.key);return(0,A.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-3`,children:[(0,A.jsx)(`div`,{className:`min-h-5 text-xs text-muted-foreground`,children:Je(e.key)}),(0,A.jsxs)(s,{disabled:t,onClick:()=>{Ne(e)},type:`button`,variant:`destructive`,children:[t?(0,A.jsx)(ie,{}):(0,A.jsx)(o,{className:`size-4`}),t?`Uninstalling...`:`Uninstall`]})]})},Xe=e=>{let t=`${e.type}:${e.path}`;return(0,A.jsxs)(`div`,{className:`rounded-lg border border-border px-5 py-4`,children:[(0,A.jsxs)(`div`,{className:`flex items-center gap-3`,children:[e.type===`workflow`?(0,A.jsx)(c,{className:`h-4 w-4 shrink-0 text-primary`}):(0,A.jsx)(f,{className:`h-4 w-4 shrink-0 text-primary`}),(0,A.jsx)(`h3`,{className:`min-w-0 flex-1 text-sm font-semibold text-foreground`,children:e.name}),(0,A.jsx)(Y,{scope:e.scope}),(0,A.jsx)(b,{variant:`outline`,className:`shrink-0 text-muted-foreground`,children:e.type})]}),(0,A.jsx)(`p`,{className:`mt-2 ml-7 text-xs text-muted-foreground`,children:e.description?.trim()||he(e.instructions)}),(0,A.jsx)(`p`,{className:`mt-1 ml-7 text-xs font-mono text-muted-foreground`,children:e.path}),(0,A.jsx)(`div`,{className:`mt-3`,children:Ye({key:t,type:e.type,id:e.id,name:e.name,path:e.path})})]},t)},Ze=e=>(0,A.jsxs)(`div`,{className:`grid gap-1`,children:[(0,A.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:e.description?.trim()||he(e.instructions)}),(0,A.jsx)(`p`,{className:`text-xs font-mono text-muted-foreground`,children:e.path})]}),Qe=({plugin:e,scope:t})=>{let n=e.path;return(0,A.jsxs)(`div`,{className:`rounded-lg border border-border px-5 py-4`,children:[(0,A.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,A.jsx)(x,{className:`h-4 w-4 shrink-0 text-primary`}),(0,A.jsx)(`h3`,{className:`min-w-0 flex-1 text-sm font-semibold text-foreground`,children:e.name}),(0,A.jsx)(Y,{scope:t}),(0,A.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:e.enabled?`Enabled`:`Disabled`}),(0,A.jsx)(u,{checked:e.enabled,onCheckedChange:()=>{Me(e)},disabled:we.has(e.path),"aria-label":`Toggle ${e.name}`})]}),(0,A.jsx)(`p`,{className:`mt-1 ml-7 text-xs font-mono text-muted-foreground`,children:e.path}),(0,A.jsxs)(`div`,{className:`mt-3 ml-7 flex flex-col gap-2`,children:[($.get(`${e.name}:${e.path}`)??[]).map(t=>{let n=X.has(t.id);return(0,A.jsxs)(`div`,{className:`flex items-center justify-between gap-4 rounded-md border border-border/70 px-3 py-2`,children:[(0,A.jsxs)(`div`,{className:`min-w-0`,children:[(0,A.jsx)(`p`,{className:`text-xs font-medium text-foreground`,children:t.name}),(0,A.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:t.description?.trim()||`No description available.`})]}),(0,A.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,A.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:t.enabled?`Enabled`:`Disabled`}),(0,A.jsx)(u,{checked:t.enabled,onCheckedChange:()=>{Q(t)},disabled:n||!e.enabled,"aria-label":`Toggle ${t.name}`})]})]},t.id)}),($.get(`${e.name}:${e.path}`)?.length??0)===0&&(0,A.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`No plugin tools found.`})]}),(0,A.jsx)(`div`,{className:`mt-3`,children:Ye({key:n,type:`plugin`,id:e.name,name:e.name,path:e.path})})]},e.path)},$e=e=>(0,A.jsxs)(A.Fragment,{children:[(0,A.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:e.enabled?`Enabled`:`Disabled`}),(0,A.jsx)(u,{checked:e.enabled,onCheckedChange:()=>{Me(e)},disabled:we.has(e.path),"aria-label":`Toggle ${e.name}`})]}),et=e=>(0,A.jsx)(`p`,{className:`min-w-0 truncate text-xs font-mono text-muted-foreground`,children:e.path}),tt=e=>{let t=$.get(`${e.name}:${e.path}`)??[];return t.length===0?null:(0,A.jsx)(`div`,{className:`grid gap-2`,children:t.map(t=>{let n=X.has(t.id);return(0,A.jsxs)(`div`,{className:`flex items-center justify-between gap-4 rounded-md border border-border/70 px-3 py-2`,children:[(0,A.jsxs)(`div`,{className:`min-w-0`,children:[(0,A.jsx)(`p`,{className:`text-xs font-medium text-foreground`,children:t.name}),(0,A.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:t.description?.trim()||`No description available.`})]}),(0,A.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,A.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:t.enabled?`Enabled`:`Disabled`}),(0,A.jsx)(u,{checked:t.enabled,onCheckedChange:()=>{Q(t)},disabled:n||!e.enabled,"aria-label":`Toggle ${t.name}`})]})]},t.id)})})},nt=e=>{let t=e.name;return(0,A.jsxs)(`div`,{className:`rounded-lg border border-border px-5 py-4`,children:[(0,A.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,A.jsx)(v,{className:`h-4 w-4 shrink-0 text-primary`}),(0,A.jsx)(`h3`,{className:`min-w-0 flex-1 text-sm font-semibold text-foreground`,children:e.name}),(0,A.jsx)(Y,{scope:`Global`}),(0,A.jsx)(b,{variant:`outline`,className:`shrink-0 text-muted-foreground`,children:e.transportType}),(0,A.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:e.disabled?`Disabled`:`Enabled`})]}),(0,A.jsx)(`p`,{className:`mt-2 ml-7 text-xs text-muted-foreground`,children:e.url??([e.command,...e.args??[]].filter(Boolean).join(` `)||`No launch command configured.`)}),R.settingsPath?(0,A.jsx)(`p`,{className:`mt-1 ml-7 text-xs font-mono text-muted-foreground`,children:R.settingsPath}):null,(0,A.jsx)(`div`,{className:`mt-3`,children:Ye({key:t,type:`mcp`,id:e.name,name:e.name})})]},e.name)},rt=e=>(0,A.jsxs)(`div`,{className:`grid gap-1`,children:[(0,A.jsxs)(`p`,{className:`text-xs text-muted-foreground`,children:[e.disabled?`Disabled`:`Enabled`,` locally`,e.transportType?` via ${e.transportType}`:``]}),R.settingsPath?(0,A.jsx)(`p`,{className:`text-xs font-mono text-muted-foreground`,children:R.settingsPath}):null]}),it=e===`skill`?Ie.map(e=>({key:`${e.type}:${e.path}`,matchValues:_e(e.id,e.name,e.path),render:()=>Xe(e),renderMatchedBadges:()=>(0,A.jsxs)(A.Fragment,{children:[(0,A.jsx)(Y,{scope:e.scope}),(0,A.jsx)(b,{variant:`outline`,className:`shrink-0 text-muted-foreground`,children:e.type})]}),renderMatchedDetails:()=>Ze(e)})):e===`plugin`?Ge.map(e=>({key:e.plugin.path,matchValues:_e(e.plugin.name,e.plugin.path),render:()=>Qe(e),renderMatchedBadges:()=>(0,A.jsx)(Y,{scope:e.scope}),renderMatchedControls:()=>$e(e.plugin),renderMatchedDetails:($.get(`${e.plugin.name}:${e.plugin.path}`)??[]).length>0?()=>tt(e.plugin):void 0,renderMatchedMeta:()=>et(e.plugin)})):e===`mcp`?R.servers.map(e=>({key:e.name,matchValues:_e(e.name),render:()=>nt(e),renderMatchedBadges:()=>(0,A.jsxs)(A.Fragment,{children:[(0,A.jsx)(Y,{scope:`Global`}),(0,A.jsx)(b,{variant:`outline`,className:`shrink-0 text-muted-foreground`,children:e.transportType})]}),renderMatchedDetails:()=>rt(e)})):null;return(0,A.jsxs)(ne,{children:[(0,A.jsx)(re,{description:ue[i],title:i,meta:(0,A.jsx)(te,{children:U[i]}),actions:(0,A.jsx)(s,{variant:`outline`,size:`sm`,onClick:()=>{Z(!0),i===`Hooks`&&Ae(!0)},disabled:l,children:(0,A.jsx)(ee,{className:r(`h-4 w-4`,l&&`animate-spin`)})})}),n?(0,A.jsx)(`div`,{className:`mb-6 flex items-center gap-0 border-b border-border`,children:Fe.map(e=>(0,A.jsxs)(s,{variant:`ghost`,onClick:()=>a(e),className:r(`relative px-4 py-2.5 text-sm font-medium transition-colors`,i===e?`text-foreground`:`text-muted-foreground hover:text-foreground`),children:[e,i===e&&(0,A.jsx)(`span`,{className:`absolute inset-x-0 -bottom-px h-0.5 bg-foreground`})]},e))}):null,p&&(0,A.jsxs)(`div`,{className:`mb-4 rounded-lg border border-destructive/40 bg-destructive/10 px-4 py-3 text-sm text-destructive`,children:[`Failed to load configuration lists: `,p]}),B.length>0&&(0,A.jsxs)(`div`,{className:`mb-4 rounded-lg border border-yellow-500/40 bg-yellow-500/10 px-4 py-3 text-sm text-yellow-700 dark:text-yellow-300`,children:[(0,A.jsxs)(`div`,{className:`mb-2 flex items-center gap-2 font-medium`,children:[(0,A.jsx)(ae,{className:`h-4 w-4`}),`Partial results`]}),(0,A.jsx)(`ul`,{className:`list-disc space-y-1 pl-5`,children:B.map(e=>(0,A.jsx)(`li`,{children:e},e))})]}),e?(0,A.jsx)(le,{chrome:`embedded`,installedItems:it??void 0,onInstalledItemsChanged:()=>Z(!0),primitive:e}):null,i===`Rules`&&(0,A.jsxs)(`div`,{children:[(0,A.jsx)(`p`,{className:`mb-6 text-sm leading-relaxed text-muted-foreground`,children:`Enabled rules discovered from configured workspace/global directories.`}),(0,A.jsxs)(`div`,{className:`grid gap-3`,children:[(0,A.jsxs)(`div`,{className:`flex items-center justify-between gap-3`,children:[(0,A.jsx)(`h3`,{className:`text-base font-semibold text-foreground`,children:`Installed`}),(0,A.jsx)(`span`,{className:`text-sm text-muted-foreground`,children:Ke.length})]}),(0,A.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[Ke.map(({rule:e,scope:t})=>(0,A.jsxs)(`div`,{className:`rounded-lg border border-border px-4 py-3`,children:[(0,A.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,A.jsx)(y,{className:`h-4 w-4 shrink-0 text-muted-foreground`}),(0,A.jsx)(`span`,{className:`flex-1 text-sm font-medium text-foreground`,children:e.name}),(0,A.jsx)(Y,{scope:t})]}),(0,A.jsx)(`p`,{className:`mt-2 text-xs text-muted-foreground`,children:he(e.instructions)}),(0,A.jsx)(`p`,{className:`mt-1 text-xs font-mono text-muted-foreground`,children:e.path})]},e.path)),Ke.length===0&&(0,A.jsx)(`p`,{className:`rounded-lg border border-dashed border-border px-4 py-3 text-sm text-muted-foreground`,children:`No rules found.`})]})]})]}),i===`Hooks`&&(0,A.jsxs)(`div`,{children:[(0,A.jsx)(`p`,{className:`mb-6 text-sm leading-relaxed text-muted-foreground`,children:`Hook config files from workspace and global hook directories.`}),xe&&G&&(0,A.jsxs)(`p`,{className:`mb-4 text-xs text-muted-foreground`,children:[`Execution status is based on hook events in session`,` `,(0,A.jsx)(`span`,{className:`font-mono`,children:G}),`.`]}),(0,A.jsxs)(`div`,{className:`grid gap-3`,children:[(0,A.jsxs)(`div`,{className:`flex items-center justify-between gap-3`,children:[(0,A.jsx)(`h3`,{className:`text-base font-semibold text-foreground`,children:`Installed`}),(0,A.jsx)(`span`,{className:`text-sm text-muted-foreground`,children:qe.length})]}),(0,A.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[qe.map(({hook:e,scope:t})=>(0,A.jsxs)(`div`,{className:`rounded-lg border border-border px-4 py-3`,children:[(0,A.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,A.jsx)(g,{className:`h-4 w-4 shrink-0 text-muted-foreground`}),(0,A.jsx)(`span`,{className:`flex-1 text-sm font-mono text-foreground`,children:e.fileName}),(0,A.jsx)(Y,{scope:t}),e.hookEventName&&(0,A.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,A.jsx)(`span`,{className:`rounded border border-border px-2 py-0.5 text-xs text-muted-foreground`,children:e.hookEventName}),(()=>{let t=H[e.hookEventName],n=(t?.count??0)>0;return(0,A.jsx)(`span`,{className:r(`rounded border px-2 py-0.5 text-xs`,n?`border-emerald-400/50 text-emerald-600 dark:text-emerald-400`:`border-border text-muted-foreground`),children:n?`${t?.count??0} executed`:`never executed`})})()]})]}),e.hookEventName?(0,A.jsxs)(`p`,{className:`mt-1 text-xs text-muted-foreground`,children:[`Last run:`,` `,Pe(H[e.hookEventName]?.lastTs??null)]}):null,(0,A.jsx)(`p`,{className:`mt-1 text-xs font-mono text-muted-foreground`,children:e.path})]},e.path)),qe.length===0&&(0,A.jsx)(`p`,{className:`rounded-lg border border-dashed border-border px-4 py-3 text-sm text-muted-foreground`,children:`No hooks found.`})]})]})]}),i===`Skills`&&!e&&(0,A.jsxs)(`div`,{children:[(0,A.jsxs)(`p`,{className:`mb-6 text-sm leading-relaxed text-muted-foreground`,children:[`Skills can be invoked in chat with`,` `,(0,A.jsx)(`code`,{className:`rounded bg-secondary px-1.5 py-0.5 text-xs font-mono text-foreground`,children:`/SKILL`}),`.`]}),(0,A.jsxs)(`div`,{className:`flex flex-col gap-3`,children:[Ie.map(e=>(0,A.jsxs)(`div`,{className:`rounded-lg border border-border px-5 py-4`,children:[(0,A.jsxs)(`div`,{className:`flex items-center gap-3`,children:[e.type===`workflow`?(0,A.jsx)(c,{className:`h-4 w-4 shrink-0 text-primary`}):(0,A.jsx)(f,{className:`h-4 w-4 shrink-0 text-primary`}),(0,A.jsx)(`h3`,{className:`text-sm font-semibold text-foreground`,children:e.name}),(0,A.jsx)(`span`,{className:`rounded border border-border px-2 py-0.5 text-xs text-muted-foreground`,children:e.type})]}),(0,A.jsx)(`p`,{className:`mt-2 ml-7 text-xs text-muted-foreground`,children:e.description?.trim()||he(e.instructions)}),(0,A.jsx)(`p`,{className:`mt-1 ml-7 text-xs font-mono text-muted-foreground`,children:e.path})]},`${e.type}:${e.path}`)),Ie.length===0&&(0,A.jsx)(`p`,{className:`rounded-lg border border-dashed border-border px-4 py-3 text-sm text-muted-foreground`,children:`No enabled skills or workflows found.`})]})]}),i===`Agents`&&(0,A.jsxs)(`div`,{children:[(0,A.jsx)(`p`,{className:`mb-6 text-sm leading-relaxed text-muted-foreground`,children:`Configured agents discovered from Documents and settings directories.`}),(0,A.jsxs)(`div`,{className:`flex flex-col gap-3`,children:[N.map(e=>(0,A.jsxs)(`div`,{className:`rounded-lg border border-border px-5 py-4`,children:[(0,A.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,A.jsx)(h,{className:`h-4 w-4 shrink-0 text-primary`}),(0,A.jsx)(`h3`,{className:`text-sm font-semibold text-foreground`,children:e.name})]}),(0,A.jsx)(`p`,{className:`mt-1 ml-7 text-xs font-mono text-muted-foreground`,children:e.path})]},e.path)),N.length===0&&(0,A.jsx)(`p`,{className:`rounded-lg border border-dashed border-border px-4 py-3 text-sm text-muted-foreground`,children:`No configured agents found.`})]})]}),i===`Plugins`&&!e&&(0,A.jsxs)(`div`,{children:[(0,A.jsx)(`p`,{className:`mb-6 text-sm leading-relaxed text-muted-foreground`,children:`Plugins discovered from workspace and global plugin directories.`}),(0,A.jsxs)(`div`,{className:`mb-6`,children:[(0,A.jsx)(`h3`,{className:`mb-3 text-xs font-semibold uppercase tracking-wider text-muted-foreground`,children:`Global Plugins`}),(0,A.jsxs)(`div`,{className:`flex flex-col gap-3`,children:[He.map(e=>(0,A.jsxs)(`div`,{className:`rounded-lg border border-border px-5 py-4`,children:[(0,A.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,A.jsx)(x,{className:`h-4 w-4 shrink-0 text-primary`}),(0,A.jsx)(`h3`,{className:`min-w-0 flex-1 text-sm font-semibold text-foreground`,children:e.name}),(0,A.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:e.enabled?`Enabled`:`Disabled`}),(0,A.jsx)(u,{checked:e.enabled,onCheckedChange:()=>{Me(e)},disabled:we.has(e.path),"aria-label":`Toggle ${e.name}`})]}),(0,A.jsx)(`p`,{className:`mt-1 ml-7 text-xs font-mono text-muted-foreground`,children:e.path}),(0,A.jsxs)(`div`,{className:`mt-3 ml-7 flex flex-col gap-2`,children:[($.get(`${e.name}:${e.path}`)??[]).map(t=>{let n=X.has(t.id);return(0,A.jsxs)(`div`,{className:`flex items-center justify-between gap-4 rounded-md border border-border/70 px-3 py-2`,children:[(0,A.jsxs)(`div`,{className:`min-w-0`,children:[(0,A.jsx)(`p`,{className:`text-xs font-medium text-foreground`,children:t.name}),(0,A.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:t.description?.trim()||`No description available.`})]}),(0,A.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,A.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:t.enabled?`Enabled`:`Disabled`}),(0,A.jsx)(u,{checked:t.enabled,onCheckedChange:()=>{Q(t)},disabled:n||!e.enabled,"aria-label":`Toggle ${t.name}`})]})]},t.id)}),($.get(`${e.name}:${e.path}`)?.length??0)===0&&(0,A.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`No plugin tools found.`})]})]},e.path)),He.length===0&&(0,A.jsx)(`p`,{className:`rounded-lg border border-dashed border-border px-4 py-3 text-sm text-muted-foreground`,children:`No global plugins found.`})]})]}),(0,A.jsxs)(`div`,{children:[(0,A.jsx)(`h3`,{className:`mb-3 text-xs font-semibold uppercase tracking-wider text-muted-foreground`,children:`Project Plugins`}),(0,A.jsxs)(`div`,{className:`flex flex-col gap-3`,children:[Ve.map(e=>(0,A.jsxs)(`div`,{className:`rounded-lg border border-border px-5 py-4`,children:[(0,A.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,A.jsx)(x,{className:`h-4 w-4 shrink-0 text-primary`}),(0,A.jsx)(`h3`,{className:`min-w-0 flex-1 text-sm font-semibold text-foreground`,children:e.name}),(0,A.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:e.enabled?`Enabled`:`Disabled`}),(0,A.jsx)(u,{checked:e.enabled,onCheckedChange:()=>{Me(e)},disabled:we.has(e.path),"aria-label":`Toggle ${e.name}`})]}),(0,A.jsx)(`p`,{className:`mt-1 ml-7 text-xs font-mono text-muted-foreground`,children:e.path}),(0,A.jsxs)(`div`,{className:`mt-3 ml-7 flex flex-col gap-2`,children:[($.get(`${e.name}:${e.path}`)??[]).map(t=>{let n=X.has(t.id);return(0,A.jsxs)(`div`,{className:`flex items-center justify-between gap-4 rounded-md border border-border/70 px-3 py-2`,children:[(0,A.jsxs)(`div`,{className:`min-w-0`,children:[(0,A.jsx)(`p`,{className:`text-xs font-medium text-foreground`,children:t.name}),(0,A.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:t.description?.trim()||`No description available.`})]}),(0,A.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,A.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:t.enabled?`Enabled`:`Disabled`}),(0,A.jsx)(u,{checked:t.enabled,onCheckedChange:()=>{Q(t)},disabled:n||!e.enabled,"aria-label":`Toggle ${t.name}`})]})]},t.id)}),($.get(`${e.name}:${e.path}`)?.length??0)===0&&(0,A.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`No plugin tools found.`})]})]},e.path)),Ve.length===0&&(0,A.jsx)(`p`,{className:`rounded-lg border border-dashed border-border px-4 py-3 text-sm text-muted-foreground`,children:`No project plugins found.`})]})]})]}),i===`Tools`&&(0,A.jsxs)(`div`,{children:[(0,A.jsx)(`p`,{className:`mb-6 text-sm leading-relaxed text-muted-foreground`,children:`Builtin tool groups and plugin-contributed tools available to the runtime.`}),(0,A.jsxs)(`div`,{className:`mb-6`,children:[(0,A.jsx)(`h3`,{className:`mb-3 text-xs font-semibold uppercase tracking-wider text-muted-foreground`,children:`Builtin Tools`}),(0,A.jsxs)(`div`,{className:`flex flex-col gap-3`,children:[Ue.map(e=>(()=>{let t=X.has(e.id);return(0,A.jsxs)(`div`,{className:`rounded-lg border border-border px-5 py-4`,children:[(0,A.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,A.jsx)(_,{className:`h-4 w-4 shrink-0 text-primary`}),(0,A.jsx)(`h3`,{className:`min-w-0 flex-1 text-sm font-semibold text-foreground`,children:e.name}),(0,A.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:e.enabled?`Enabled`:`Disabled`}),(0,A.jsx)(u,{checked:e.enabled,onCheckedChange:()=>{Q(e)},disabled:t,"aria-label":`Toggle ${e.name}`})]}),(0,A.jsx)(`p`,{className:`mt-2 ml-7 text-xs text-muted-foreground`,children:e.description?.trim()||`No description available.`}),!!e.headlessToolNames?.length&&(0,A.jsx)(`p`,{className:`mt-1 ml-7 text-xs font-mono text-muted-foreground`,children:e.headlessToolNames.join(`, `)})]},e.id)})()),Ue.length===0&&(0,A.jsx)(`p`,{className:`rounded-lg border border-dashed border-border px-4 py-3 text-sm text-muted-foreground`,children:`No builtin tools found.`})]})]}),(0,A.jsxs)(`div`,{children:[(0,A.jsx)(`h3`,{className:`mb-3 text-xs font-semibold uppercase tracking-wider text-muted-foreground`,children:`Plugin Tools`}),(0,A.jsxs)(`div`,{className:`flex flex-col gap-3`,children:[We.map(e=>(()=>{let t=X.has(e.id);return(0,A.jsxs)(`div`,{className:`rounded-lg border border-border px-5 py-4`,children:[(0,A.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,A.jsx)(_,{className:`h-4 w-4 shrink-0 text-primary`}),(0,A.jsx)(`h3`,{className:`min-w-0 flex-1 text-sm font-semibold text-foreground`,children:e.name}),e.pluginName&&(0,A.jsxs)(`span`,{className:`rounded border border-border px-2 py-0.5 text-xs text-muted-foreground`,children:[`plugin: `,e.pluginName]}),(0,A.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:e.enabled?`Enabled`:`Disabled`}),(0,A.jsx)(u,{checked:e.enabled,onCheckedChange:()=>{Q(e)},disabled:t,"aria-label":`Toggle ${e.name}`})]}),(0,A.jsx)(`p`,{className:`mt-2 ml-7 text-xs text-muted-foreground`,children:e.description?.trim()||`No description available.`}),e.path&&(0,A.jsx)(`p`,{className:`mt-1 ml-7 text-xs font-mono text-muted-foreground`,children:e.path})]},e.id)})()),We.length===0&&(0,A.jsx)(`p`,{className:`rounded-lg border border-dashed border-border px-4 py-3 text-sm text-muted-foreground`,children:`No plugin tools found.`})]})]})]})]})}export{be as CustomizationSectionView};
@@ -0,0 +1 @@
1
+ import"./src-Cz8bXOH0.js";import"./chunk-WYO6CB5R-i6G7y6Wv.js";import"./chunk-ICXQ74PX-tBj7_Af3.js";import"./chunk-HOUHSVGY-7-np6tLe.js";import"./chunk-Q4XR5HBZ-DLm93PI-.js";import"./chunk-7BUUIJ7U-Bb538aSH.js";import"./chunk-OGEWGWER-BWr7Kxep.js";import"./chunk-32BRIVSS-hNjl59yJ.js";import"./chunk-XXDRQBXY-DlK_iNGL.js";import"./chunk-VR4S4FIN-s6lsgHY6.js";import"./chunk-C7G6YPKG-DNqG58q0.js";import"./chunk-ZGVPDNZ5-C9VvO5W0.js";import"./chunk-52WLFC77-BuWVK9iY.js";import"./chunk-FWX5IMBZ-CYhSzu5d.js";import"./chunk-ZIRB5QZD-C6fEPe3t.js";import{n as e}from"./chunk-PUDLZKDR-8aZ1kjkY.js";export{e as diagram};