@truefoundry/trueforge 0.177.0 → 0.178.0-rc.1

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 (227) hide show
  1. package/dist/_frontend/assets/{AgentCodeSnippets-EKIN7ZIE-BK__Jr49.js → AgentCodeSnippets-DKA74SI3-C2P2xphc.js} +1 -1
  2. package/dist/_frontend/assets/AgentCodeSnippets-DKA74SI3-C2P2xphc.js.br +0 -0
  3. package/dist/_frontend/assets/AgentCodeSnippets-DKA74SI3-C2P2xphc.js.gz +0 -0
  4. package/dist/_frontend/assets/{AgentMetricChart-ULFKK6JR-DUqlzc0i.js → AgentMetricChart-63ZRCTNR-615ecqfN.js} +1 -1
  5. package/dist/_frontend/assets/AgentMetricChart-63ZRCTNR-615ecqfN.js.br +0 -0
  6. package/dist/_frontend/assets/AgentMetricChart-63ZRCTNR-615ecqfN.js.gz +0 -0
  7. package/dist/_frontend/assets/{AgentOverview-NGCJR4UF-lBAH6Tl_.js → AgentOverview-7W5GOPD6-5y2reLPs.js} +1 -1
  8. package/dist/_frontend/assets/AgentOverview-7W5GOPD6-5y2reLPs.js.br +0 -0
  9. package/dist/_frontend/assets/AgentOverview-7W5GOPD6-5y2reLPs.js.gz +0 -0
  10. package/dist/_frontend/assets/{AgentSessionEventTimeline-NDDZQZ2R-CRKwrZYO.js → AgentSessionEventTimeline-ONESE5X3-aKuWxk8m.js} +1 -1
  11. package/dist/_frontend/assets/AgentSessionEventTimeline-ONESE5X3-aKuWxk8m.js.br +0 -0
  12. package/dist/_frontend/assets/AgentSessionEventTimeline-ONESE5X3-aKuWxk8m.js.gz +0 -0
  13. package/dist/_frontend/assets/{AgentSessionEventTimelineChart-5AY5YW4U-Btf6r_vC.js → AgentSessionEventTimelineChart-ARBD6JZP-DMzLBiQT.js} +1 -1
  14. package/dist/_frontend/assets/AgentSessionEventTimelineChart-ARBD6JZP-DMzLBiQT.js.br +0 -0
  15. package/dist/_frontend/assets/AgentSessionEventTimelineChart-ARBD6JZP-DMzLBiQT.js.gz +0 -0
  16. package/dist/_frontend/assets/AgentSessions-DXPVINTL-Cgeq6RVn.js +1 -0
  17. package/dist/_frontend/assets/AgentSessions-DXPVINTL-Cgeq6RVn.js.br +0 -0
  18. package/dist/_frontend/assets/AgentSessions-DXPVINTL-Cgeq6RVn.js.gz +0 -0
  19. package/dist/_frontend/assets/ConnectorSettings-577VW3QM-DsBlk3uo.js +1 -0
  20. package/dist/_frontend/assets/ConnectorSettings-577VW3QM-DsBlk3uo.js.br +0 -0
  21. package/dist/_frontend/assets/ConnectorSettings-577VW3QM-DsBlk3uo.js.gz +0 -0
  22. package/dist/_frontend/assets/{DockLayout-ELMFMPFZ-64HWC5vP.js → DockLayout-UUNWARXJ-xCtCDovt.js} +1 -1
  23. package/dist/_frontend/assets/{DrawerLayout-SYUH47FF-bW9h_jzW.js → DrawerLayout-PQMMP5DR-B04fGweM.js} +2 -2
  24. package/dist/_frontend/assets/DrawerLayout-PQMMP5DR-B04fGweM.js.br +0 -0
  25. package/dist/_frontend/assets/DrawerLayout-PQMMP5DR-B04fGweM.js.gz +0 -0
  26. package/dist/_frontend/assets/EnvironmentsPage-PQZWQZCO-Dr2xxFfN.js +3 -0
  27. package/dist/_frontend/assets/EnvironmentsPage-PQZWQZCO-Dr2xxFfN.js.br +0 -0
  28. package/dist/_frontend/assets/EnvironmentsPage-PQZWQZCO-Dr2xxFfN.js.gz +0 -0
  29. package/dist/_frontend/assets/ModelSettings-VXSENL34-B3igr5Gm.js +1 -0
  30. package/dist/_frontend/assets/ModelSettings-VXSENL34-B3igr5Gm.js.br +0 -0
  31. package/dist/_frontend/assets/ModelSettings-VXSENL34-B3igr5Gm.js.gz +0 -0
  32. package/dist/_frontend/assets/SandboxSettings-EVTKZHMI-DxsDJ9f2.js +1 -0
  33. package/dist/_frontend/assets/SandboxSettings-EVTKZHMI-DxsDJ9f2.js.br +0 -0
  34. package/dist/_frontend/assets/SandboxSettings-EVTKZHMI-DxsDJ9f2.js.gz +0 -0
  35. package/dist/_frontend/assets/SchedulesPage-GE5HOH5X-BqUWx1Up.js +1 -0
  36. package/dist/_frontend/assets/SchedulesPage-GE5HOH5X-BqUWx1Up.js.br +0 -0
  37. package/dist/_frontend/assets/SchedulesPage-GE5HOH5X-BqUWx1Up.js.gz +0 -0
  38. package/dist/_frontend/assets/SettingsBuilder-L4U6XN5B-BjdzxqSN.js +2 -0
  39. package/dist/_frontend/assets/SettingsBuilder-L4U6XN5B-BjdzxqSN.js.br +0 -0
  40. package/dist/_frontend/assets/SettingsBuilder-L4U6XN5B-BjdzxqSN.js.gz +0 -0
  41. package/dist/_frontend/assets/{ShellRouteSync-M5WTXCX5-BecyJLZB.js → ShellRouteSync-AVUH4WJ4-0FBneogo.js} +1 -1
  42. package/dist/_frontend/assets/ShellRouteSync-AVUH4WJ4-0FBneogo.js.br +0 -0
  43. package/dist/_frontend/assets/ShellRouteSync-AVUH4WJ4-0FBneogo.js.gz +0 -0
  44. package/dist/_frontend/assets/SidebarLayout-MJJUMCYA-BRw3Ei0O.js +2 -0
  45. package/dist/_frontend/assets/SidebarLayout-MJJUMCYA-BRw3Ei0O.js.br +0 -0
  46. package/dist/_frontend/assets/SidebarLayout-MJJUMCYA-BRw3Ei0O.js.gz +0 -0
  47. package/dist/_frontend/assets/SkillSettings-B755K6CA-BI4qn_Eo.js +1 -0
  48. package/dist/_frontend/assets/SkillSettings-B755K6CA-BI4qn_Eo.js.br +0 -0
  49. package/dist/_frontend/assets/SkillSettings-B755K6CA-BI4qn_Eo.js.gz +0 -0
  50. package/dist/_frontend/assets/{TrueForgeUIWithRouter-VAVREKS2-DG9NN-mB.js → TrueForgeUIWithRouter-MNNZC3ZW-CWK4gyZK.js} +1 -1
  51. package/dist/_frontend/assets/WebSearchSettings-BJCW6BFI-CbGfcmvV.js +1 -0
  52. package/dist/_frontend/assets/WebSearchSettings-BJCW6BFI-CbGfcmvV.js.br +0 -0
  53. package/dist/_frontend/assets/WebSearchSettings-BJCW6BFI-CbGfcmvV.js.gz +0 -0
  54. package/dist/_frontend/assets/{WidgetLayout-CJYOCWXG-hW-w0wXo.js → WidgetLayout-6XVTKSOW-YdgTHyGh.js} +1 -1
  55. package/dist/_frontend/assets/WidgetLayout-6XVTKSOW-YdgTHyGh.js.br +0 -0
  56. package/dist/_frontend/assets/WidgetLayout-6XVTKSOW-YdgTHyGh.js.gz +0 -0
  57. package/dist/_frontend/assets/chunk-5GSHR4L4-Cxh1Q_oM.js +1 -0
  58. package/dist/_frontend/assets/chunk-5GSHR4L4-Cxh1Q_oM.js.br +0 -0
  59. package/dist/_frontend/assets/chunk-5GSHR4L4-Cxh1Q_oM.js.gz +0 -0
  60. package/dist/_frontend/assets/{chunk-X2GIDKWH-CMjGi2n8.js → chunk-5LPC6X3J-uDPAksEb.js} +2 -2
  61. package/dist/_frontend/assets/chunk-5LPC6X3J-uDPAksEb.js.br +0 -0
  62. package/dist/_frontend/assets/chunk-5LPC6X3J-uDPAksEb.js.gz +0 -0
  63. package/dist/_frontend/assets/{chunk-EGUH4WJX-SANPGRqh.js → chunk-ERF3RQBH-bc2AFBrP.js} +1 -1
  64. package/dist/_frontend/assets/chunk-ERF3RQBH-bc2AFBrP.js.br +0 -0
  65. package/dist/_frontend/assets/chunk-ERF3RQBH-bc2AFBrP.js.gz +0 -0
  66. package/dist/_frontend/assets/{chunk-OB3PAWPO-DQ_P-4S-.js → chunk-OB3PAWPO-buV69Da_.js} +1 -1
  67. package/dist/_frontend/assets/chunk-OB3PAWPO-buV69Da_.js.br +0 -0
  68. package/dist/_frontend/assets/chunk-OB3PAWPO-buV69Da_.js.gz +0 -0
  69. package/dist/_frontend/assets/{chunk-C5376XWU-CUgFlwPN.js → chunk-SBJYYOBH-9LXSopYV.js} +1 -1
  70. package/dist/_frontend/assets/{cssMode-DBcp10nw.js → cssMode-CUwc-wOz.js} +1 -1
  71. package/dist/_frontend/assets/cssMode-CUwc-wOz.js.br +5 -0
  72. package/dist/_frontend/assets/cssMode-CUwc-wOz.js.gz +0 -0
  73. package/dist/_frontend/assets/{freemarker2-kn4ZhL8s.js → freemarker2-CnV8a3_0.js} +1 -1
  74. package/dist/_frontend/assets/freemarker2-CnV8a3_0.js.br +0 -0
  75. package/dist/_frontend/assets/freemarker2-CnV8a3_0.js.gz +0 -0
  76. package/dist/_frontend/assets/{handlebars-hJoSbeEv.js → handlebars-C-TYdyge.js} +1 -1
  77. package/dist/_frontend/assets/handlebars-C-TYdyge.js.br +0 -0
  78. package/dist/_frontend/assets/handlebars-C-TYdyge.js.gz +0 -0
  79. package/dist/_frontend/assets/{html-Cb9UIhE4.js → html-C0OUO-_o.js} +1 -1
  80. package/dist/_frontend/assets/html-C0OUO-_o.js.br +0 -0
  81. package/dist/_frontend/assets/html-C0OUO-_o.js.gz +0 -0
  82. package/dist/_frontend/assets/{htmlMode-b3R93yfn.js → htmlMode-BnXdhyXH.js} +1 -1
  83. package/dist/_frontend/assets/htmlMode-BnXdhyXH.js.br +0 -0
  84. package/dist/_frontend/assets/htmlMode-BnXdhyXH.js.gz +0 -0
  85. package/dist/_frontend/assets/{index-DyV3Kxi4.js → index-BAccPIjI.js} +3 -3
  86. package/dist/_frontend/assets/index-BAccPIjI.js.br +0 -0
  87. package/dist/_frontend/assets/index-BAccPIjI.js.gz +0 -0
  88. package/dist/_frontend/assets/{index-R1kS-j0r.js → index-CK_pY4oG.js} +1 -1
  89. package/dist/_frontend/assets/index-CK_pY4oG.js.br +0 -0
  90. package/dist/_frontend/assets/index-CK_pY4oG.js.gz +0 -0
  91. package/dist/_frontend/assets/index-DT_x37xf.js +1000 -0
  92. package/dist/_frontend/assets/index-DT_x37xf.js.br +0 -0
  93. package/dist/_frontend/assets/index-DT_x37xf.js.gz +0 -0
  94. package/dist/_frontend/assets/{javascript-CSvI9_rd.js → javascript-Cf9Bcm6Z.js} +1 -1
  95. package/dist/_frontend/assets/{jsonMode-B-bur220.js → jsonMode-Cdvgg8vs.js} +1 -1
  96. package/dist/_frontend/assets/jsonMode-Cdvgg8vs.js.br +0 -0
  97. package/dist/_frontend/assets/jsonMode-Cdvgg8vs.js.gz +0 -0
  98. package/dist/_frontend/assets/{liquid-B2c7_pgJ.js → liquid-BTqXerrw.js} +1 -1
  99. package/dist/_frontend/assets/liquid-BTqXerrw.js.br +0 -0
  100. package/dist/_frontend/assets/liquid-BTqXerrw.js.gz +0 -0
  101. package/dist/_frontend/assets/{lspLanguageFeatures-Dru3qdb_.js → lspLanguageFeatures-ytnPsDYx.js} +1 -1
  102. package/dist/_frontend/assets/lspLanguageFeatures-ytnPsDYx.js.br +0 -0
  103. package/dist/_frontend/assets/lspLanguageFeatures-ytnPsDYx.js.gz +0 -0
  104. package/dist/_frontend/assets/{mdx-BJ8Sv1r2.js → mdx-Cy7YF5TA.js} +1 -1
  105. package/dist/_frontend/assets/mdx-Cy7YF5TA.js.br +0 -0
  106. package/dist/_frontend/assets/mdx-Cy7YF5TA.js.gz +0 -0
  107. package/dist/_frontend/assets/{python-Dd-s66vK.js → python-BfsHYybY.js} +1 -1
  108. package/dist/_frontend/assets/python-BfsHYybY.js.br +0 -0
  109. package/dist/_frontend/assets/python-BfsHYybY.js.gz +0 -0
  110. package/dist/_frontend/assets/{razor-CZgtByAc.js → razor-BDLxWgPZ.js} +1 -1
  111. package/dist/_frontend/assets/razor-BDLxWgPZ.js.br +0 -0
  112. package/dist/_frontend/assets/razor-BDLxWgPZ.js.gz +0 -0
  113. package/dist/_frontend/assets/{tsMode-BKdqN2QK.js → tsMode-BxS0zbXq.js} +1 -1
  114. package/dist/_frontend/assets/tsMode-BxS0zbXq.js.br +0 -0
  115. package/dist/_frontend/assets/tsMode-BxS0zbXq.js.gz +0 -0
  116. package/dist/_frontend/assets/{typescript-DfaR9qdT.js → typescript-zS28nDMH.js} +1 -1
  117. package/dist/_frontend/assets/typescript-zS28nDMH.js.br +0 -0
  118. package/dist/_frontend/assets/typescript-zS28nDMH.js.gz +0 -0
  119. package/dist/_frontend/assets/{workers--wwmRDDg.js → workers-D9MU6Ded.js} +1 -1
  120. package/dist/_frontend/assets/workers-D9MU6Ded.js.br +0 -0
  121. package/dist/_frontend/assets/workers-D9MU6Ded.js.gz +0 -0
  122. package/dist/_frontend/assets/{xml-DSX1f9L4.js → xml-XJYCuhJK.js} +1 -1
  123. package/dist/_frontend/assets/xml-XJYCuhJK.js.br +0 -0
  124. package/dist/_frontend/assets/xml-XJYCuhJK.js.gz +0 -0
  125. package/dist/_frontend/assets/{yaml-CMmrTeSX.js → yaml-CgdBed-B.js} +1 -1
  126. package/dist/_frontend/assets/yaml-CgdBed-B.js.br +0 -0
  127. package/dist/_frontend/assets/yaml-CgdBed-B.js.gz +0 -0
  128. package/dist/_frontend/index.html +1 -1
  129. package/dist/controller-main.js +3 -3
  130. package/dist/controller-main.js.map +1 -1
  131. package/dist/main.js +3 -3
  132. package/dist/main.js.map +1 -1
  133. package/package.json +3 -3
  134. package/dist/_frontend/assets/AgentCodeSnippets-EKIN7ZIE-BK__Jr49.js.br +0 -0
  135. package/dist/_frontend/assets/AgentCodeSnippets-EKIN7ZIE-BK__Jr49.js.gz +0 -0
  136. package/dist/_frontend/assets/AgentMetricChart-ULFKK6JR-DUqlzc0i.js.br +0 -0
  137. package/dist/_frontend/assets/AgentMetricChart-ULFKK6JR-DUqlzc0i.js.gz +0 -0
  138. package/dist/_frontend/assets/AgentOverview-NGCJR4UF-lBAH6Tl_.js.br +0 -0
  139. package/dist/_frontend/assets/AgentOverview-NGCJR4UF-lBAH6Tl_.js.gz +0 -0
  140. package/dist/_frontend/assets/AgentSessionEventTimeline-NDDZQZ2R-CRKwrZYO.js.br +0 -0
  141. package/dist/_frontend/assets/AgentSessionEventTimeline-NDDZQZ2R-CRKwrZYO.js.gz +0 -0
  142. package/dist/_frontend/assets/AgentSessionEventTimelineChart-5AY5YW4U-Btf6r_vC.js.br +0 -0
  143. package/dist/_frontend/assets/AgentSessionEventTimelineChart-5AY5YW4U-Btf6r_vC.js.gz +0 -0
  144. package/dist/_frontend/assets/AgentSessions-AJF4A3MH-C3zdVGKE.js +0 -1
  145. package/dist/_frontend/assets/AgentSessions-AJF4A3MH-C3zdVGKE.js.br +0 -0
  146. package/dist/_frontend/assets/AgentSessions-AJF4A3MH-C3zdVGKE.js.gz +0 -0
  147. package/dist/_frontend/assets/ConnectorSettings-NIHX4DYV-Cqd9W9dr.js +0 -1
  148. package/dist/_frontend/assets/ConnectorSettings-NIHX4DYV-Cqd9W9dr.js.br +0 -0
  149. package/dist/_frontend/assets/ConnectorSettings-NIHX4DYV-Cqd9W9dr.js.gz +0 -0
  150. package/dist/_frontend/assets/DrawerLayout-SYUH47FF-bW9h_jzW.js.br +0 -0
  151. package/dist/_frontend/assets/DrawerLayout-SYUH47FF-bW9h_jzW.js.gz +0 -0
  152. package/dist/_frontend/assets/EnvironmentsPage-YV2D2VMM-DlNlyfm2.js +0 -131
  153. package/dist/_frontend/assets/EnvironmentsPage-YV2D2VMM-DlNlyfm2.js.br +0 -0
  154. package/dist/_frontend/assets/EnvironmentsPage-YV2D2VMM-DlNlyfm2.js.gz +0 -0
  155. package/dist/_frontend/assets/ModelSettings-KMU4MUTS-4qLH7ibV.js +0 -1
  156. package/dist/_frontend/assets/ModelSettings-KMU4MUTS-4qLH7ibV.js.br +0 -0
  157. package/dist/_frontend/assets/ModelSettings-KMU4MUTS-4qLH7ibV.js.gz +0 -0
  158. package/dist/_frontend/assets/SandboxSettings-XYOVCK6J-CbwTlTY9.js +0 -1
  159. package/dist/_frontend/assets/SandboxSettings-XYOVCK6J-CbwTlTY9.js.br +0 -0
  160. package/dist/_frontend/assets/SandboxSettings-XYOVCK6J-CbwTlTY9.js.gz +0 -0
  161. package/dist/_frontend/assets/SchedulesPage-UNS7BDS6-CjgOxBTD.js +0 -1
  162. package/dist/_frontend/assets/SchedulesPage-UNS7BDS6-CjgOxBTD.js.br +0 -0
  163. package/dist/_frontend/assets/SchedulesPage-UNS7BDS6-CjgOxBTD.js.gz +0 -0
  164. package/dist/_frontend/assets/SettingsBuilder-OU3B7YHU-DYpXgbEN.js +0 -2
  165. package/dist/_frontend/assets/SettingsBuilder-OU3B7YHU-DYpXgbEN.js.br +0 -0
  166. package/dist/_frontend/assets/SettingsBuilder-OU3B7YHU-DYpXgbEN.js.gz +0 -0
  167. package/dist/_frontend/assets/ShellRouteSync-M5WTXCX5-BecyJLZB.js.br +0 -0
  168. package/dist/_frontend/assets/ShellRouteSync-M5WTXCX5-BecyJLZB.js.gz +0 -0
  169. package/dist/_frontend/assets/SidebarLayout-MGDOLVJB-bzsOzbNs.js +0 -2
  170. package/dist/_frontend/assets/SidebarLayout-MGDOLVJB-bzsOzbNs.js.br +0 -0
  171. package/dist/_frontend/assets/SidebarLayout-MGDOLVJB-bzsOzbNs.js.gz +0 -0
  172. package/dist/_frontend/assets/SkillSettings-QPZ43BZT-B7Q1Wv_4.js +0 -1
  173. package/dist/_frontend/assets/SkillSettings-QPZ43BZT-B7Q1Wv_4.js.br +0 -0
  174. package/dist/_frontend/assets/SkillSettings-QPZ43BZT-B7Q1Wv_4.js.gz +0 -0
  175. package/dist/_frontend/assets/WebSearchSettings-VOFJUVYH-SgpUTawp.js +0 -1
  176. package/dist/_frontend/assets/WebSearchSettings-VOFJUVYH-SgpUTawp.js.br +0 -0
  177. package/dist/_frontend/assets/WebSearchSettings-VOFJUVYH-SgpUTawp.js.gz +0 -0
  178. package/dist/_frontend/assets/WidgetLayout-CJYOCWXG-hW-w0wXo.js.br +0 -0
  179. package/dist/_frontend/assets/WidgetLayout-CJYOCWXG-hW-w0wXo.js.gz +0 -0
  180. package/dist/_frontend/assets/chunk-EGUH4WJX-SANPGRqh.js.br +0 -0
  181. package/dist/_frontend/assets/chunk-EGUH4WJX-SANPGRqh.js.gz +0 -0
  182. package/dist/_frontend/assets/chunk-OB3PAWPO-DQ_P-4S-.js.br +0 -0
  183. package/dist/_frontend/assets/chunk-OB3PAWPO-DQ_P-4S-.js.gz +0 -0
  184. package/dist/_frontend/assets/chunk-RO36YFVR-D08M8Asc.js +0 -1
  185. package/dist/_frontend/assets/chunk-RO36YFVR-D08M8Asc.js.br +0 -0
  186. package/dist/_frontend/assets/chunk-RO36YFVR-D08M8Asc.js.gz +0 -0
  187. package/dist/_frontend/assets/chunk-X2GIDKWH-CMjGi2n8.js.br +0 -0
  188. package/dist/_frontend/assets/chunk-X2GIDKWH-CMjGi2n8.js.gz +0 -0
  189. package/dist/_frontend/assets/cssMode-DBcp10nw.js.br +0 -10
  190. package/dist/_frontend/assets/cssMode-DBcp10nw.js.gz +0 -0
  191. package/dist/_frontend/assets/freemarker2-kn4ZhL8s.js.br +0 -0
  192. package/dist/_frontend/assets/freemarker2-kn4ZhL8s.js.gz +0 -0
  193. package/dist/_frontend/assets/handlebars-hJoSbeEv.js.br +0 -0
  194. package/dist/_frontend/assets/handlebars-hJoSbeEv.js.gz +0 -0
  195. package/dist/_frontend/assets/html-Cb9UIhE4.js.br +0 -0
  196. package/dist/_frontend/assets/html-Cb9UIhE4.js.gz +0 -0
  197. package/dist/_frontend/assets/htmlMode-b3R93yfn.js.br +0 -8
  198. package/dist/_frontend/assets/htmlMode-b3R93yfn.js.gz +0 -0
  199. package/dist/_frontend/assets/index-D6YKMpJU.js +0 -978
  200. package/dist/_frontend/assets/index-D6YKMpJU.js.br +0 -0
  201. package/dist/_frontend/assets/index-D6YKMpJU.js.gz +0 -0
  202. package/dist/_frontend/assets/index-DyV3Kxi4.js.br +0 -0
  203. package/dist/_frontend/assets/index-DyV3Kxi4.js.gz +0 -0
  204. package/dist/_frontend/assets/index-R1kS-j0r.js.br +0 -0
  205. package/dist/_frontend/assets/index-R1kS-j0r.js.gz +0 -0
  206. package/dist/_frontend/assets/jsonMode-B-bur220.js.br +0 -0
  207. package/dist/_frontend/assets/jsonMode-B-bur220.js.gz +0 -0
  208. package/dist/_frontend/assets/liquid-B2c7_pgJ.js.br +0 -0
  209. package/dist/_frontend/assets/liquid-B2c7_pgJ.js.gz +0 -0
  210. package/dist/_frontend/assets/lspLanguageFeatures-Dru3qdb_.js.br +0 -0
  211. package/dist/_frontend/assets/lspLanguageFeatures-Dru3qdb_.js.gz +0 -0
  212. package/dist/_frontend/assets/mdx-BJ8Sv1r2.js.br +0 -0
  213. package/dist/_frontend/assets/mdx-BJ8Sv1r2.js.gz +0 -0
  214. package/dist/_frontend/assets/python-Dd-s66vK.js.br +0 -0
  215. package/dist/_frontend/assets/python-Dd-s66vK.js.gz +0 -0
  216. package/dist/_frontend/assets/razor-CZgtByAc.js.br +0 -0
  217. package/dist/_frontend/assets/razor-CZgtByAc.js.gz +0 -0
  218. package/dist/_frontend/assets/tsMode-BKdqN2QK.js.br +0 -0
  219. package/dist/_frontend/assets/tsMode-BKdqN2QK.js.gz +0 -0
  220. package/dist/_frontend/assets/typescript-DfaR9qdT.js.br +0 -0
  221. package/dist/_frontend/assets/typescript-DfaR9qdT.js.gz +0 -0
  222. package/dist/_frontend/assets/workers--wwmRDDg.js.br +0 -0
  223. package/dist/_frontend/assets/workers--wwmRDDg.js.gz +0 -0
  224. package/dist/_frontend/assets/xml-DSX1f9L4.js.br +0 -0
  225. package/dist/_frontend/assets/xml-DSX1f9L4.js.gz +0 -0
  226. package/dist/_frontend/assets/yaml-CMmrTeSX.js.br +0 -0
  227. package/dist/_frontend/assets/yaml-CMmrTeSX.js.gz +0 -0
@@ -1,131 +0,0 @@
1
- import{B as tn}from"./chunk-EGUH4WJX-SANPGRqh.js";import{cG as os,b as sn,t as as,r as L,cH as Ye,aY as At,cI as qt,cJ as Ut,j as d,P as nn,Y as rn,a0 as re,I as Qe,a1 as on,a2 as Vt,cK as an,a4 as ln,a5 as cn,a6 as Yt,a7 as ce,a8 as fn,a9 as fe,O as ls,ar as un,f as yt,a3 as hn,ab as cs,ac as fs,ad as us,ae as hs,af as ds,ag as dn,am as mn,cL as pn,g as ge,cM as gn}from"./index-D6YKMpJU.js";const vt=Symbol.for("yaml.alias"),bt=Symbol.for("yaml.document"),se=Symbol.for("yaml.map"),ms=Symbol.for("yaml.pair"),z=Symbol.for("yaml.scalar"),Se=Symbol.for("yaml.seq"),H=Symbol.for("yaml.node.type"),Ne=s=>!!s&&typeof s=="object"&&s[H]===vt,$e=s=>!!s&&typeof s=="object"&&s[H]===bt,_e=s=>!!s&&typeof s=="object"&&s[H]===se,B=s=>!!s&&typeof s=="object"&&s[H]===ms,x=s=>!!s&&typeof s=="object"&&s[H]===z,Be=s=>!!s&&typeof s=="object"&&s[H]===Se;function $(s){if(s&&typeof s=="object")switch(s[H]){case se:case Se:return!0}return!1}function _(s){if(s&&typeof s=="object")switch(s[H]){case vt:case se:case z:case Se:return!0}return!1}const ps=s=>(x(s)||$(s))&&!!s.anchor,ie=Symbol("break visit"),yn=Symbol("skip children"),Le=Symbol("remove node");function Ee(s,e){const t=bn(e);$e(s)?de(null,s.contents,t,Object.freeze([s]))===Le&&(s.contents=null):de(null,s,t,Object.freeze([]))}Ee.BREAK=ie;Ee.SKIP=yn;Ee.REMOVE=Le;function de(s,e,t,n){const i=wn(s,e,t,n);if(_(i)||B(i))return kn(s,n,i),de(s,i,t,n);if(typeof i!="symbol"){if($(e)){n=Object.freeze(n.concat(e));for(let r=0;r<e.items.length;++r){const o=de(r,e.items[r],t,n);if(typeof o=="number")r=o-1;else{if(o===ie)return ie;o===Le&&(e.items.splice(r,1),r-=1)}}}else if(B(e)){n=Object.freeze(n.concat(e));const r=de("key",e.key,t,n);if(r===ie)return ie;r===Le&&(e.key=null);const o=de("value",e.value,t,n);if(o===ie)return ie;o===Le&&(e.value=null)}}return i}function bn(s){return typeof s=="object"&&(s.Collection||s.Node||s.Value)?Object.assign({Alias:s.Node,Map:s.Node,Scalar:s.Node,Seq:s.Node},s.Value&&{Map:s.Value,Scalar:s.Value,Seq:s.Value},s.Collection&&{Map:s.Collection,Seq:s.Collection},s):s}function wn(s,e,t,n){var i,r,o,a,l;if(typeof t=="function")return t(s,e,n);if(_e(e))return(i=t.Map)==null?void 0:i.call(t,s,e,n);if(Be(e))return(r=t.Seq)==null?void 0:r.call(t,s,e,n);if(B(e))return(o=t.Pair)==null?void 0:o.call(t,s,e,n);if(x(e))return(a=t.Scalar)==null?void 0:a.call(t,s,e,n);if(Ne(e))return(l=t.Alias)==null?void 0:l.call(t,s,e,n)}function kn(s,e,t){const n=e[e.length-1];if($(n))n.items[s]=t;else if(B(n))s==="key"?n.key=t:n.value=t;else if($e(n))n.contents=t;else{const i=Ne(n)?"alias":"scalar";throw new Error(`Cannot replace node with ${i} parent`)}}const Sn={"!":"%21",",":"%2C","[":"%5B","]":"%5D","{":"%7B","}":"%7D"},Nn=s=>s.replace(/[!,[\]{}]/g,e=>Sn[e]);class q{constructor(e,t){this.docStart=null,this.docEnd=!1,this.yaml=Object.assign({},q.defaultYaml,e),this.tags=Object.assign({},q.defaultTags,t)}clone(){const e=new q(this.yaml,this.tags);return e.docStart=this.docStart,e}atDocument(){const e=new q(this.yaml,this.tags);switch(this.yaml.version){case"1.1":this.atNextDocument=!0;break;case"1.2":this.atNextDocument=!1,this.yaml={explicit:q.defaultYaml.explicit,version:"1.2"},this.tags=Object.assign({},q.defaultTags);break}return e}add(e,t){this.atNextDocument&&(this.yaml={explicit:q.defaultYaml.explicit,version:"1.1"},this.tags=Object.assign({},q.defaultTags),this.atNextDocument=!1);const n=e.trim().split(/[ \t]+/),i=n.shift();switch(i){case"%TAG":{if(n.length!==2&&(t(0,"%TAG directive should contain exactly two parts"),n.length<2))return!1;const[r,o]=n;return this.tags[r]=o,!0}case"%YAML":{if(this.yaml.explicit=!0,n.length!==1)return t(0,"%YAML directive should contain exactly one part"),!1;const[r]=n;if(r==="1.1"||r==="1.2")return this.yaml.version=r,!0;{const o=/^\d+\.\d+$/.test(r);return t(6,`Unsupported YAML version ${r}`,o),!1}}default:return t(0,`Unknown directive ${i}`,!0),!1}}tagName(e,t){if(e==="!")return"!";if(e[0]!=="!")return t(`Not a valid tag: ${e}`),null;if(e[1]==="<"){const o=e.slice(2,-1);return o==="!"||o==="!!"?(t(`Verbatim tags aren't resolved, so ${e} is invalid.`),null):(e[e.length-1]!==">"&&t("Verbatim tags must end with a >"),o)}const[,n,i]=e.match(/^(.*!)([^!]*)$/s);i||t(`The ${e} tag has no suffix`);const r=this.tags[n];if(r)try{return r+decodeURIComponent(i)}catch(o){return t(String(o)),null}return n==="!"?e:(t(`Could not resolve tag: ${e}`),null)}tagString(e){for(const[t,n]of Object.entries(this.tags))if(e.startsWith(n))return t+Nn(e.substring(n.length));return e[0]==="!"?e:`!<${e}>`}toString(e){const t=this.yaml.explicit?[`%YAML ${this.yaml.version||"1.2"}`]:[],n=Object.entries(this.tags);let i;if(e&&n.length>0&&_(e.contents)){const r={};Ee(e.contents,(o,a)=>{_(a)&&a.tag&&(r[a.tag]=!0)}),i=Object.keys(r)}else i=[];for(const[r,o]of n)r==="!!"&&o==="tag:yaml.org,2002:"||(!e||i.some(a=>a.startsWith(o)))&&t.push(`%TAG ${r} ${o}`);return t.join(`
2
- `)}}q.defaultYaml={explicit:!1,version:"1.2"};q.defaultTags={"!!":"tag:yaml.org,2002:"};function gs(s){if(/[\x00-\x19\s,[\]{}]/.test(s)){const t=`Anchor must not contain whitespace or control characters: ${JSON.stringify(s)}`;throw new Error(t)}return!0}function ys(s){const e=new Set;return Ee(s,{Value(t,n){n.anchor&&e.add(n.anchor)}}),e}function bs(s,e){for(let t=1;;++t){const n=`${s}${t}`;if(!e.has(n))return n}}function En(s,e){const t=[],n=new Map;let i=null;return{onAnchor:r=>{t.push(r),i??(i=ys(s));const o=bs(e,i);return i.add(o),o},setAnchors:()=>{for(const r of t){const o=n.get(r);if(typeof o=="object"&&o.anchor&&(x(o.node)||$(o.node)))o.node.anchor=o.anchor;else{const a=new Error("Failed to resolve repeated object (this should not happen)");throw a.source=r,a}}},sourceObjects:n}}function me(s,e,t,n){if(n&&typeof n=="object")if(Array.isArray(n))for(let i=0,r=n.length;i<r;++i){const o=n[i],a=me(s,n,String(i),o);a===void 0?delete n[i]:a!==o&&(n[i]=a)}else if(n instanceof Map)for(const i of Array.from(n.keys())){const r=n.get(i),o=me(s,n,i,r);o===void 0?n.delete(i):o!==r&&n.set(i,o)}else if(n instanceof Set)for(const i of Array.from(n)){const r=me(s,n,i,i);r===void 0?n.delete(i):r!==i&&(n.delete(i),n.add(r))}else for(const[i,r]of Object.entries(n)){const o=me(s,n,i,r);o===void 0?delete n[i]:o!==r&&(n[i]=o)}return s.call(e,t,n)}function G(s,e,t){if(Array.isArray(s))return s.map((n,i)=>G(n,String(i),t));if(s&&typeof s.toJSON=="function"){if(!t||!ps(s))return s.toJSON(e,t);const n={aliasCount:0,count:1,res:void 0};t.anchors.set(s,n),t.onCreate=r=>{n.res=r,delete t.onCreate};const i=s.toJSON(e,t);return t.onCreate&&t.onCreate(i),i}return typeof s=="bigint"&&!(t!=null&&t.keep)?Number(s):s}class Ot{constructor(e){Object.defineProperty(this,H,{value:e})}clone(){const e=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));return this.range&&(e.range=this.range.slice()),e}toJS(e,{mapAsMap:t,maxAliasCount:n,onAnchor:i,reviver:r}={}){if(!$e(e))throw new TypeError("A document argument is required");const o={anchors:new Map,doc:e,keep:!0,mapAsMap:t===!0,mapKeyWarned:!1,maxAliasCount:typeof n=="number"?n:100},a=G(this,"",o);if(typeof i=="function")for(const{count:l,res:c}of o.anchors.values())i(c,l);return typeof r=="function"?me(r,{"":a},"",a):a}}class Tt extends Ot{constructor(e){super(vt),this.source=e,Object.defineProperty(this,"tag",{set(){throw new Error("Alias nodes cannot have tags")}})}resolve(e,t){if((t==null?void 0:t.maxAliasCount)===0)throw new ReferenceError("Alias resolution is disabled");let n;t!=null&&t.aliasResolveCache?n=t.aliasResolveCache:(n=[],Ee(e,{Node:(r,o)=>{(Ne(o)||ps(o))&&n.push(o)}}),t&&(t.aliasResolveCache=n));let i;for(const r of n){if(r===this)break;r.anchor===this.source&&(i=r)}if(i&&t){const{anchors:r,doc:o,maxAliasCount:a}=t;let l=r.get(i);if(l||(G(i,null,t),l=r.get(i)),(l==null?void 0:l.res)===void 0){const c="This should not happen: Alias anchor was not resolved?";throw new ReferenceError(c)}if(a>=0&&(l.count+=1,l.aliasCount===0&&(l.aliasCount=Je(o,i,r)),l.count*l.aliasCount>a)){const c="Excessive alias count indicates a resource exhaustion attack";throw new ReferenceError(c)}}return i}toJSON(e,t){if(!t)return{source:this.source};const n=this.resolve(t.doc,t);if(!n){const i=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw new ReferenceError(i)}return t.anchors.get(n).res}toString(e,t,n){const i=`*${this.source}`;if(e){if(gs(this.source),e.options.verifyAliasOrder&&!e.anchors.has(this.source)){const r=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw new Error(r)}if(e.implicitKey)return`${i} `}return i}}function Je(s,e,t){if(Ne(e)){const n=e.resolve(s),i=t&&n&&t.get(n);return i?i.count*i.aliasCount:0}else if($(e)){let n=0;for(const i of e.items){const r=Je(s,i,t);r>n&&(n=r)}return n}else if(B(e)){const n=Je(s,e.key,t),i=Je(s,e.value,t);return Math.max(n,i)}return 1}const ws=s=>!s||typeof s!="function"&&typeof s!="object";class O extends Ot{constructor(e){super(z),this.value=e}toJSON(e,t){return t!=null&&t.keep?this.value:G(this.value,e,t)}toString(){return String(this.value)}}O.BLOCK_FOLDED="BLOCK_FOLDED";O.BLOCK_LITERAL="BLOCK_LITERAL";O.PLAIN="PLAIN";O.QUOTE_DOUBLE="QUOTE_DOUBLE";O.QUOTE_SINGLE="QUOTE_SINGLE";const An="tag:yaml.org,2002:";function vn(s,e,t){if(e){const n=t.filter(r=>r.tag===e),i=n.find(r=>!r.format)??n[0];if(!i)throw new Error(`Tag ${e} not found`);return i}return t.find(n=>{var i;return((i=n.identify)==null?void 0:i.call(n,s))&&!n.format})}function xe(s,e,t){var f,p,h;if($e(s)&&(s=s.contents),_(s))return s;if(B(s)){const y=(p=(f=t.schema[se]).createNode)==null?void 0:p.call(f,t.schema,null,t);return y.items.push(s),y}(s instanceof String||s instanceof Number||s instanceof Boolean||typeof BigInt<"u"&&s instanceof BigInt)&&(s=s.valueOf());const{aliasDuplicateObjects:n,onAnchor:i,onTagObj:r,schema:o,sourceObjects:a}=t;let l;if(n&&s&&typeof s=="object"){if(l=a.get(s),l)return l.anchor??(l.anchor=i(s)),new Tt(l.anchor);l={anchor:null,node:null},a.set(s,l)}e!=null&&e.startsWith("!!")&&(e=An+e.slice(2));let c=vn(s,e,o.tags);if(!c){if(s&&typeof s.toJSON=="function"&&(s=s.toJSON()),!s||typeof s!="object"){const y=new O(s);return l&&(l.node=y),y}c=s instanceof Map?o[se]:Symbol.iterator in Object(s)?o[Se]:o[se]}r&&(r(c),delete t.onTagObj);const m=c!=null&&c.createNode?c.createNode(t.schema,s,t):typeof((h=c==null?void 0:c.nodeClass)==null?void 0:h.from)=="function"?c.nodeClass.from(t.schema,s,t):new O(s);return e?m.tag=e:c.default||(m.tag=c.tag),l&&(l.node=m),m}function We(s,e,t){let n=t;for(let i=e.length-1;i>=0;--i){const r=e[i];if(typeof r=="number"&&Number.isInteger(r)&&r>=0){const o=[];o[r]=n,n=o}else n=new Map([[r,n]])}return xe(n,void 0,{aliasDuplicateObjects:!1,keepUndefined:!1,onAnchor:()=>{throw new Error("This should not happen, please report a bug.")},schema:s,sourceObjects:new Map})}const Te=s=>s==null||typeof s=="object"&&!!s[Symbol.iterator]().next().done;class ks extends Ot{constructor(e,t){super(e),Object.defineProperty(this,"schema",{value:t,configurable:!0,enumerable:!1,writable:!0})}clone(e){const t=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));return e&&(t.schema=e),t.items=t.items.map(n=>_(n)||B(n)?n.clone(e):n),this.range&&(t.range=this.range.slice()),t}addIn(e,t){if(Te(e))this.add(t);else{const[n,...i]=e,r=this.get(n,!0);if($(r))r.addIn(i,t);else if(r===void 0&&this.schema)this.set(n,We(this.schema,i,t));else throw new Error(`Expected YAML collection at ${n}. Remaining path: ${i}`)}}deleteIn(e){const[t,...n]=e;if(n.length===0)return this.delete(t);const i=this.get(t,!0);if($(i))return i.deleteIn(n);throw new Error(`Expected YAML collection at ${t}. Remaining path: ${n}`)}getIn(e,t){const[n,...i]=e,r=this.get(n,!0);return i.length===0?!t&&x(r)?r.value:r:$(r)?r.getIn(i,t):void 0}hasAllNullValues(e){return this.items.every(t=>{if(!B(t))return!1;const n=t.value;return n==null||e&&x(n)&&n.value==null&&!n.commentBefore&&!n.comment&&!n.tag})}hasIn(e){const[t,...n]=e;if(n.length===0)return this.has(t);const i=this.get(t,!0);return $(i)?i.hasIn(n):!1}setIn(e,t){const[n,...i]=e;if(i.length===0)this.set(n,t);else{const r=this.get(n,!0);if($(r))r.setIn(i,t);else if(r===void 0&&this.schema)this.set(n,We(this.schema,i,t));else throw new Error(`Expected YAML collection at ${n}. Remaining path: ${i}`)}}}const On=s=>s.replace(/^(?!$)(?: $)?/gm,"#");function X(s,e){return/^\n+$/.test(s)?s.substring(1):e?s.replace(/^(?! *$)/gm,e):s}const oe=(s,e,t)=>s.endsWith(`
3
- `)?X(t,e):t.includes(`
4
- `)?`
5
- `+X(t,e):(s.endsWith(" ")?"":" ")+t,Ss="flow",wt="block",Ge="quoted";function Ze(s,e,t="flow",{indentAtStart:n,lineWidth:i=80,minContentWidth:r=20,onFold:o,onOverflow:a}={}){if(!i||i<0)return s;i<r&&(r=0);const l=Math.max(1+r,1+i-e.length);if(s.length<=l)return s;const c=[],m={};let f=i-e.length;typeof n=="number"&&(n>i-Math.max(2,r)?c.push(0):f=i-n);let p,h,y=!1,u=-1,g=-1,b=-1;t===wt&&(u=Jt(s,u,e.length),u!==-1&&(f=u+l));for(let E;E=s[u+=1];){if(t===Ge&&E==="\\"){switch(g=u,s[u+1]){case"x":u+=3;break;case"u":u+=5;break;case"U":u+=9;break;default:u+=1}b=u}if(E===`
6
- `)t===wt&&(u=Jt(s,u,e.length)),f=u+e.length+l,p=void 0;else{if(E===" "&&h&&h!==" "&&h!==`
7
- `&&h!==" "){const S=s[u+1];S&&S!==" "&&S!==`
8
- `&&S!==" "&&(p=u)}if(u>=f)if(p)c.push(p),f=p+l,p=void 0;else if(t===Ge){for(;h===" "||h===" ";)h=E,E=s[u+=1],y=!0;const S=u>b+1?u-2:g-1;if(m[S])return s;c.push(S),m[S]=!0,f=S+l,p=void 0}else y=!0}h=E}if(y&&a&&a(),c.length===0)return s;o&&o();let w=s.slice(0,c[0]);for(let E=0;E<c.length;++E){const S=c[E],N=c[E+1]||s.length;S===0?w=`
9
- ${e}${s.slice(0,N)}`:(t===Ge&&m[S]&&(w+=`${s[S]}\\`),w+=`
10
- ${e}${s.slice(S+1,N)}`)}return w}function Jt(s,e,t){let n=e,i=e+1,r=s[i];for(;r===" "||r===" ";)if(e<i+t)r=s[++e];else{do r=s[++e];while(r&&r!==`
11
- `);n=e,i=e+1,r=s[i]}return n}const et=(s,e)=>({indentAtStart:e?s.indent.length:s.indentAtStart,lineWidth:s.options.lineWidth,minContentWidth:s.options.minContentWidth}),tt=s=>/^(%|---|\.\.\.)/m.test(s);function Tn(s,e,t){if(!e||e<0)return!1;const n=e-t,i=s.length;if(i<=n)return!1;for(let r=0,o=0;r<i;++r)if(s[r]===`
12
- `){if(r-o>n)return!0;if(o=r+1,i-o<=n)return!1}return!0}function je(s,e){const t=JSON.stringify(s);if(e.options.doubleQuotedAsJSON)return t;const{implicitKey:n}=e,i=e.options.doubleQuotedMinMultiLineLength,r=e.indent||(tt(s)?" ":"");let o="",a=0;for(let l=0,c=t[l];c;c=t[++l])if(c===" "&&t[l+1]==="\\"&&t[l+2]==="n"&&(o+=t.slice(a,l)+"\\ ",l+=1,a=l,c="\\"),c==="\\")switch(t[l+1]){case"u":{o+=t.slice(a,l);const m=t.substr(l+2,4);switch(m){case"0000":o+="\\0";break;case"0007":o+="\\a";break;case"000b":o+="\\v";break;case"001b":o+="\\e";break;case"0085":o+="\\N";break;case"00a0":o+="\\_";break;case"2028":o+="\\L";break;case"2029":o+="\\P";break;default:m.substr(0,2)==="00"?o+="\\x"+m.substr(2):o+=t.substr(l,6)}l+=5,a=l+1}break;case"n":if(n||t[l+2]==='"'||t.length<i)l+=1;else{for(o+=t.slice(a,l)+`
13
-
14
- `;t[l+2]==="\\"&&t[l+3]==="n"&&t[l+4]!=='"';)o+=`
15
- `,l+=2;o+=r,t[l+2]===" "&&(o+="\\"),l+=1,a=l+1}break;default:l+=1}return o=a?o+t.slice(a):t,n?o:Ze(o,r,Ge,et(e,!1))}function kt(s,e){if(e.options.singleQuote===!1||e.implicitKey&&s.includes(`
16
- `)||/[ \t]\n|\n[ \t]/.test(s))return je(s,e);const t=e.indent||(tt(s)?" ":""),n="'"+s.replace(/'/g,"''").replace(/\n+/g,`$&
17
- ${t}`)+"'";return e.implicitKey?n:Ze(n,t,Ss,et(e,!1))}function pe(s,e){const{singleQuote:t}=e.options;let n;if(t===!1)n=je;else{const i=s.includes('"'),r=s.includes("'");i&&!r?n=kt:r&&!i?n=je:n=t?kt:je}return n(s,e)}let St;try{St=new RegExp(`(^|(?<!
18
- ))
19
- +(?!
20
- |$)`,"g")}catch{St=/\n+(?!\n|$)/g}function He({comment:s,type:e,value:t},n,i,r){const{blockQuote:o,commentString:a,lineWidth:l}=n.options;if(!o||/\n[\t ]+$/.test(t))return pe(t,n);const c=n.indent||(n.forceBlockIndent||tt(t)?" ":""),m=o==="literal"?!0:o==="folded"||e===O.BLOCK_FOLDED?!1:e===O.BLOCK_LITERAL?!0:!Tn(t,l,c.length);if(!t)return m?`|
21
- `:`>
22
- `;let f,p;for(p=t.length;p>0;--p){const N=t[p-1];if(N!==`
23
- `&&N!==" "&&N!==" ")break}let h=t.substring(p);const y=h.indexOf(`
24
- `);y===-1?f="-":t===h||y!==h.length-1?(f="+",r&&r()):f="",h&&(t=t.slice(0,-h.length),h[h.length-1]===`
25
- `&&(h=h.slice(0,-1)),h=h.replace(St,`$&${c}`));let u=!1,g,b=-1;for(g=0;g<t.length;++g){const N=t[g];if(N===" ")u=!0;else if(N===`
26
- `)b=g;else break}let w=t.substring(0,b<g?b+1:g);w&&(t=t.substring(w.length),w=w.replace(/\n+/g,`$&${c}`));let S=(u?c?"2":"1":"")+f;if(s&&(S+=" "+a(s.replace(/ ?[\r\n]+/g," ")),i&&i()),!m){const N=t.replace(/\n+/g,`
27
- $&`).replace(/(?:^|\n)([\t ].*)(?:([\n\t ]*)\n(?![\n\t ]))?/g,"$1$2").replace(/\n+/g,`$&${c}`);let v=!1;const A=et(n,!0);o!=="folded"&&e!==O.BLOCK_FOLDED&&(A.onOverflow=()=>{v=!0});const k=Ze(`${w}${N}${h}`,c,wt,A);if(!v)return`>${S}
28
- ${c}${k}`}return t=t.replace(/\n+/g,`$&${c}`),`|${S}
29
- ${c}${w}${t}${h}`}function In(s,e,t,n){const{type:i,value:r}=s,{actualString:o,implicitKey:a,indent:l,indentStep:c,inFlow:m}=e;if(a&&r.includes(`
30
- `)||m&&/[[\]{},]/.test(r))return pe(r,e);if(/^[\n\t ,[\]{}#&*!|>'"%@`]|^[?-]$|^[?-][ \t]|[\n:][ \t]|[ \t]\n|[\n\t ]#|[\n\t :]$/.test(r))return a||m||!r.includes(`
31
- `)?pe(r,e):He(s,e,t,n);if(!a&&!m&&i!==O.PLAIN&&r.includes(`
32
- `))return He(s,e,t,n);if(tt(r)){if(l==="")return e.forceBlockIndent=!0,He(s,e,t,n);if(a&&l===c)return pe(r,e)}const f=r.replace(/\n+/g,`$&
33
- ${l}`);if(o){const p=u=>{var g;return u.default&&u.tag!=="tag:yaml.org,2002:str"&&((g=u.test)==null?void 0:g.test(f))},{compat:h,tags:y}=e.doc.schema;if(y.some(p)||h!=null&&h.some(p))return pe(r,e)}return a?f:Ze(f,l,Ss,et(e,!1))}function It(s,e,t,n){const{implicitKey:i,inFlow:r}=e,o=typeof s.value=="string"?s:Object.assign({},s,{value:String(s.value)});let{type:a}=s;a!==O.QUOTE_DOUBLE&&/[\x00-\x08\x0b-\x1f\x7f-\x9f\u{D800}-\u{DFFF}]/u.test(o.value)&&(a=O.QUOTE_DOUBLE);const l=m=>{switch(m){case O.BLOCK_FOLDED:case O.BLOCK_LITERAL:return i||r?pe(o.value,e):He(o,e,t,n);case O.QUOTE_DOUBLE:return je(o.value,e);case O.QUOTE_SINGLE:return kt(o.value,e);case O.PLAIN:return In(o,e,t,n);default:return null}};let c=l(a);if(c===null){const{defaultKeyType:m,defaultStringType:f}=e.options,p=i&&m||f;if(c=l(p),c===null)throw new Error(`Unsupported default string type ${p}`)}return c}function Ns(s,e){const t=Object.assign({blockQuote:!0,commentString:On,defaultKeyType:null,defaultStringType:"PLAIN",directives:null,doubleQuotedAsJSON:!1,doubleQuotedMinMultiLineLength:40,falseStr:"false",flowCollectionPadding:!0,indentSeq:!0,lineWidth:80,minContentWidth:20,nullStr:"null",simpleKeys:!1,singleQuote:null,trailingComma:!1,trueStr:"true",verifyAliasOrder:!0},s.schema.toStringOptions,e);let n;switch(t.collectionStyle){case"block":n=!1;break;case"flow":n=!0;break;default:n=null}return{anchors:new Set,doc:s,flowCollectionPadding:t.flowCollectionPadding?" ":"",indent:"",indentStep:typeof t.indent=="number"?" ".repeat(t.indent):" ",inFlow:n,options:t}}function Ln(s,e){var i;if(e.tag){const r=s.filter(o=>o.tag===e.tag);if(r.length>0)return r.find(o=>o.format===e.format)??r[0]}let t,n;if(x(e)){n=e.value;let r=s.filter(o=>{var a;return(a=o.identify)==null?void 0:a.call(o,n)});if(r.length>1){const o=r.filter(a=>a.test);o.length>0&&(r=o)}t=r.find(o=>o.format===e.format)??r.find(o=>!o.format)}else n=e,t=s.find(r=>r.nodeClass&&n instanceof r.nodeClass);if(!t){const r=((i=n==null?void 0:n.constructor)==null?void 0:i.name)??(n===null?"null":typeof n);throw new Error(`Tag not resolved for ${r} value`)}return t}function jn(s,e,{anchors:t,doc:n}){if(!n.directives)return"";const i=[],r=(x(s)||$(s))&&s.anchor;r&&gs(r)&&(t.add(r),i.push(`&${r}`));const o=s.tag??(e.default?null:e.tag);return o&&i.push(n.directives.tagString(o)),i.join(" ")}function we(s,e,t,n){var l;if(B(s))return s.toString(e,t,n);if(Ne(s)){if(e.doc.directives)return s.toString(e);if((l=e.resolvedAliases)!=null&&l.has(s))throw new TypeError("Cannot stringify circular structure without alias nodes");e.resolvedAliases?e.resolvedAliases.add(s):e.resolvedAliases=new Set([s]),s=s.resolve(e.doc)}let i;const r=_(s)?s:e.doc.createNode(s,{onTagObj:c=>i=c});i??(i=Ln(e.doc.schema.tags,r));const o=jn(r,i,e);o.length>0&&(e.indentAtStart=(e.indentAtStart??0)+o.length+1);const a=typeof i.stringify=="function"?i.stringify(r,e,t,n):x(r)?It(r,e,t,n):r.toString(e,t,n);return o?x(r)||a[0]==="{"||a[0]==="["?`${o} ${a}`:`${o}
34
- ${e.indent}${a}`:a}function xn({key:s,value:e},t,n,i){const{allNullValues:r,doc:o,indent:a,indentStep:l,options:{commentString:c,indentSeq:m,simpleKeys:f}}=t;let p=_(s)&&s.comment||null;if(f){if(p)throw new Error("With simple keys, key nodes cannot have comments");if($(s)||!_(s)&&typeof s=="object"){const A="With simple keys, collection cannot be used as a key value";throw new Error(A)}}let h=!f&&(!s||p&&e==null&&!t.inFlow||$(s)||(x(s)?s.type===O.BLOCK_FOLDED||s.type===O.BLOCK_LITERAL:typeof s=="object"));t=Object.assign({},t,{allNullValues:!1,implicitKey:!h&&(f||!r),indent:a+l});let y=!1,u=!1,g=we(s,t,()=>y=!0,()=>u=!0);if(!h&&!t.inFlow&&g.length>1024){if(f)throw new Error("With simple keys, single line scalar must not span more than 1024 characters");h=!0}if(t.inFlow){if(r||e==null)return y&&n&&n(),g===""?"?":h?`? ${g}`:g}else if(r&&!f||e==null&&h)return g=`? ${g}`,p&&!y?g+=oe(g,t.indent,c(p)):u&&i&&i(),g;y&&(p=null),h?(p&&(g+=oe(g,t.indent,c(p))),g=`? ${g}
35
- ${a}:`):(g=`${g}:`,p&&(g+=oe(g,t.indent,c(p))));let b,w,E;_(e)?(b=!!e.spaceBefore,w=e.commentBefore,E=e.comment):(b=!1,w=null,E=null,e&&typeof e=="object"&&(e=o.createNode(e))),t.implicitKey=!1,!h&&!p&&x(e)&&(t.indentAtStart=g.length+1),u=!1,!m&&l.length>=2&&!t.inFlow&&!h&&Be(e)&&!e.flow&&!e.tag&&!e.anchor&&(t.indent=t.indent.substring(2));let S=!1;const N=we(e,t,()=>S=!0,()=>u=!0);let v=" ";if(p||b||w){if(v=b?`
36
- `:"",w){const A=c(w);v+=`
37
- ${X(A,t.indent)}`}N===""&&!t.inFlow?v===`
38
- `&&E&&(v=`
39
-
40
- `):v+=`
41
- ${t.indent}`}else if(!h&&$(e)){const A=N[0],k=N.indexOf(`
42
- `),I=k!==-1,C=t.inFlow??e.flow??e.items.length===0;if(I||!C){let R=!1;if(I&&(A==="&"||A==="!")){let D=N.indexOf(" ");A==="&"&&D!==-1&&D<k&&N[D+1]==="!"&&(D=N.indexOf(" ",D+1)),(D===-1||k<D)&&(R=!0)}R||(v=`
43
- ${t.indent}`)}}else(N===""||N[0]===`
44
- `)&&(v="");return g+=v+N,t.inFlow?S&&n&&n():E&&!S?g+=oe(g,t.indent,c(E)):u&&i&&i(),g}function Es(s,e){(s==="debug"||s==="warn")&&console.warn(e)}const Ke="<<",Z={identify:s=>s===Ke||typeof s=="symbol"&&s.description===Ke,default:"key",tag:"tag:yaml.org,2002:merge",test:/^<<$/,resolve:()=>Object.assign(new O(Symbol(Ke)),{addToJSMap:As}),stringify:()=>Ke},Cn=(s,e)=>(Z.identify(e)||x(e)&&(!e.type||e.type===O.PLAIN)&&Z.identify(e.value))&&(s==null?void 0:s.doc.schema.tags.some(t=>t.tag===Z.tag&&t.default));function As(s,e,t){const n=vs(s,t);if(Be(n))for(const i of n.items)at(s,e,i);else if(Array.isArray(n))for(const i of n)at(s,e,i);else at(s,e,n)}function at(s,e,t){const n=vs(s,t);if(!_e(n))throw new Error("Merge sources must be maps or map aliases");const i=n.toJSON(null,s,Map);for(const[r,o]of i)e instanceof Map?e.has(r)||e.set(r,o):e instanceof Set?e.add(r):Object.prototype.hasOwnProperty.call(e,r)||Object.defineProperty(e,r,{value:o,writable:!0,enumerable:!0,configurable:!0});return e}function vs(s,e){return s&&Ne(e)?e.resolve(s.doc,s):e}function Os(s,e,{key:t,value:n}){if(_(t)&&t.addToJSMap)t.addToJSMap(s,e,n);else if(Cn(s,t))As(s,e,n);else{const i=G(t,"",s);if(e instanceof Map)e.set(i,G(n,i,s));else if(e instanceof Set)e.add(i);else{const r=$n(t,i,s),o=G(n,r,s);r in e?Object.defineProperty(e,r,{value:o,writable:!0,enumerable:!0,configurable:!0}):e[r]=o}}return e}function $n(s,e,t){if(e===null)return"";if(typeof e!="object")return String(e);if(_(s)&&(t!=null&&t.doc)){const n=Ns(t.doc,{});n.anchors=new Set;for(const r of t.anchors.keys())n.anchors.add(r.anchor);n.inFlow=!0,n.inStringifyKey=!0;const i=s.toString(n);if(!t.mapKeyWarned){let r=JSON.stringify(i);r.length>40&&(r=r.substring(0,36)+'..."'),Es(t.doc.options.logLevel,`Keys with collection values will be stringified due to JS Object restrictions: ${r}. Set mapAsMap: true to use object keys.`),t.mapKeyWarned=!0}return i}return JSON.stringify(e)}function Lt(s,e,t){const n=xe(s,void 0,t),i=xe(e,void 0,t);return new U(n,i)}class U{constructor(e,t=null){Object.defineProperty(this,H,{value:ms}),this.key=e,this.value=t}clone(e){let{key:t,value:n}=this;return _(t)&&(t=t.clone(e)),_(n)&&(n=n.clone(e)),new U(t,n)}toJSON(e,t){const n=t!=null&&t.mapAsMap?new Map:{};return Os(t,n,this)}toString(e,t,n){return e!=null&&e.doc?xn(this,e,t,n):JSON.stringify(this)}}function Ts(s,e,t){return(e.inFlow??s.flow?Bn:_n)(s,e,t)}function _n({comment:s,items:e},t,{blockItemPrefix:n,flowChars:i,itemIndent:r,onChompKeep:o,onComment:a}){const{indent:l,options:{commentString:c}}=t,m=Object.assign({},t,{indent:r,type:null});let f=!1;const p=[];for(let y=0;y<e.length;++y){const u=e[y];let g=null;if(_(u))!f&&u.spaceBefore&&p.push(""),ze(t,p,u.commentBefore,f),u.comment&&(g=u.comment);else if(B(u)){const w=_(u.key)?u.key:null;w&&(!f&&w.spaceBefore&&p.push(""),ze(t,p,w.commentBefore,f))}f=!1;let b=we(u,m,()=>g=null,()=>f=!0);g&&(b+=oe(b,r,c(g))),f&&g&&(f=!1),p.push(n+b)}let h;if(p.length===0)h=i.start+i.end;else{h=p[0];for(let y=1;y<p.length;++y){const u=p[y];h+=u?`
45
- ${l}${u}`:`
46
- `}}return s?(h+=`
47
- `+X(c(s),l),a&&a()):f&&o&&o(),h}function Bn({items:s},e,{flowChars:t,itemIndent:n}){const{indent:i,indentStep:r,flowCollectionPadding:o,options:{commentString:a}}=e;n+=r;const l=Object.assign({},e,{indent:n,inFlow:!0,type:null});let c=!1,m=0;const f=[];for(let y=0;y<s.length;++y){const u=s[y];let g=null;if(_(u))u.spaceBefore&&f.push(""),ze(e,f,u.commentBefore,!1),u.comment&&(g=u.comment);else if(B(u)){const w=_(u.key)?u.key:null;w&&(w.spaceBefore&&f.push(""),ze(e,f,w.commentBefore,!1),w.comment&&(c=!0));const E=_(u.value)?u.value:null;E?(E.comment&&(g=E.comment),E.commentBefore&&(c=!0)):u.value==null&&(w!=null&&w.comment)&&(g=w.comment)}g&&(c=!0);let b=we(u,l,()=>g=null);c||(c=f.length>m||b.includes(`
48
- `)),y<s.length-1?b+=",":e.options.trailingComma&&(e.options.lineWidth>0&&(c||(c=f.reduce((w,E)=>w+E.length+2,2)+(b.length+2)>e.options.lineWidth)),c&&(b+=",")),g&&(b+=oe(b,n,a(g))),f.push(b),m=f.length}const{start:p,end:h}=t;if(f.length===0)return p+h;if(!c){const y=f.reduce((u,g)=>u+g.length+2,2);c=e.options.lineWidth>0&&y>e.options.lineWidth}if(c){let y=p;for(const u of f)y+=u?`
49
- ${r}${i}${u}`:`
50
- `;return`${y}
51
- ${i}${h}`}else return`${p}${o}${f.join(" ")}${o}${h}`}function ze({indent:s,options:{commentString:e}},t,n,i){if(n&&i&&(n=n.replace(/^\n+/,"")),n){const r=X(e(n),s);t.push(r.trimStart())}}function ae(s,e){const t=x(e)?e.value:e;for(const n of s)if(B(n)&&(n.key===e||n.key===t||x(n.key)&&n.key.value===t))return n}class J extends ks{static get tagName(){return"tag:yaml.org,2002:map"}constructor(e){super(se,e),this.items=[]}static from(e,t,n){const{keepUndefined:i,replacer:r}=n,o=new this(e),a=(l,c)=>{if(typeof r=="function")c=r.call(t,l,c);else if(Array.isArray(r)&&!r.includes(l))return;(c!==void 0||i)&&o.items.push(Lt(l,c,n))};if(t instanceof Map)for(const[l,c]of t)a(l,c);else if(t&&typeof t=="object")for(const l of Object.keys(t))a(l,t[l]);return typeof e.sortMapEntries=="function"&&o.items.sort(e.sortMapEntries),o}add(e,t){var o;let n;B(e)?n=e:!e||typeof e!="object"||!("key"in e)?n=new U(e,e==null?void 0:e.value):n=new U(e.key,e.value);const i=ae(this.items,n.key),r=(o=this.schema)==null?void 0:o.sortMapEntries;if(i){if(!t)throw new Error(`Key ${n.key} already set`);x(i.value)&&ws(n.value)?i.value.value=n.value:i.value=n.value}else if(r){const a=this.items.findIndex(l=>r(n,l)<0);a===-1?this.items.push(n):this.items.splice(a,0,n)}else this.items.push(n)}delete(e){const t=ae(this.items,e);return t?this.items.splice(this.items.indexOf(t),1).length>0:!1}get(e,t){const n=ae(this.items,e),i=n==null?void 0:n.value;return(!t&&x(i)?i.value:i)??void 0}has(e){return!!ae(this.items,e)}set(e,t){this.add(new U(e,t),!0)}toJSON(e,t,n){const i=n?new n:t!=null&&t.mapAsMap?new Map:{};t!=null&&t.onCreate&&t.onCreate(i);for(const r of this.items)Os(t,i,r);return i}toString(e,t,n){if(!e)return JSON.stringify(this);for(const i of this.items)if(!B(i))throw new Error(`Map items must all be pairs; found ${JSON.stringify(i)} instead`);return!e.allNullValues&&this.hasAllNullValues(!1)&&(e=Object.assign({},e,{allNullValues:!0})),Ts(this,e,{blockItemPrefix:"",flowChars:{start:"{",end:"}"},itemIndent:e.indent||"",onChompKeep:n,onComment:t})}}const Ae={collection:"map",default:!0,nodeClass:J,tag:"tag:yaml.org,2002:map",resolve(s,e){return _e(s)||e("Expected a mapping for this tag"),s},createNode:(s,e,t)=>J.from(s,e,t)};class le extends ks{static get tagName(){return"tag:yaml.org,2002:seq"}constructor(e){super(Se,e),this.items=[]}add(e){this.items.push(e)}delete(e){const t=Re(e);return typeof t!="number"?!1:this.items.splice(t,1).length>0}get(e,t){const n=Re(e);if(typeof n!="number")return;const i=this.items[n];return!t&&x(i)?i.value:i}has(e){const t=Re(e);return typeof t=="number"&&t<this.items.length}set(e,t){const n=Re(e);if(typeof n!="number")throw new Error(`Expected a valid index, not ${e}.`);const i=this.items[n];x(i)&&ws(t)?i.value=t:this.items[n]=t}toJSON(e,t){const n=[];t!=null&&t.onCreate&&t.onCreate(n);let i=0;for(const r of this.items)n.push(G(r,String(i++),t));return n}toString(e,t,n){return e?Ts(this,e,{blockItemPrefix:"- ",flowChars:{start:"[",end:"]"},itemIndent:(e.indent||"")+" ",onChompKeep:n,onComment:t}):JSON.stringify(this)}static from(e,t,n){const{replacer:i}=n,r=new this(e);if(t&&Symbol.iterator in Object(t)){let o=0;for(let a of t){if(typeof i=="function"){const l=t instanceof Set?a:String(o++);a=i.call(t,l,a)}r.items.push(xe(a,void 0,n))}}return r}}function Re(s){let e=x(s)?s.value:s;return e&&typeof e=="string"&&(e=Number(e)),typeof e=="number"&&Number.isInteger(e)&&e>=0?e:null}const ve={collection:"seq",default:!0,nodeClass:le,tag:"tag:yaml.org,2002:seq",resolve(s,e){return Be(s)||e("Expected a sequence for this tag"),s},createNode:(s,e,t)=>le.from(s,e,t)},st={identify:s=>typeof s=="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:s=>s,stringify(s,e,t,n){return e=Object.assign({actualString:!0},e),It(s,e,t,n)}},nt={identify:s=>s==null,createNode:()=>new O(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^(?:~|[Nn]ull|NULL)?$/,resolve:()=>new O(null),stringify:({source:s},e)=>typeof s=="string"&&nt.test.test(s)?s:e.options.nullStr},jt={identify:s=>typeof s=="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:[Tt]rue|TRUE|[Ff]alse|FALSE)$/,resolve:s=>new O(s[0]==="t"||s[0]==="T"),stringify({source:s,value:e},t){if(s&&jt.test.test(s)){const n=s[0]==="t"||s[0]==="T";if(e===n)return s}return e?t.options.trueStr:t.options.falseStr}};function W({format:s,minFractionDigits:e,tag:t,value:n}){if(typeof n=="bigint")return String(n);const i=typeof n=="number"?n:Number(n);if(!isFinite(i))return isNaN(i)?".nan":i<0?"-.inf":".inf";let r=Object.is(n,-0)?"-0":JSON.stringify(n);if(!s&&e&&(!t||t==="tag:yaml.org,2002:float")&&/^-?\d/.test(r)&&!r.includes("e")){let o=r.indexOf(".");o<0&&(o=r.length,r+=".");let a=e-(r.length-o-1);for(;a-- >0;)r+="0"}return r}const Is={identify:s=>typeof s=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,resolve:s=>s.slice(-3).toLowerCase()==="nan"?NaN:s[0]==="-"?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,stringify:W},Ls={identify:s=>typeof s=="number",default:!0,tag:"tag:yaml.org,2002:float",format:"EXP",test:/^[-+]?(?:\.[0-9]+|[0-9]+(?:\.[0-9]*)?)[eE][-+]?[0-9]+$/,resolve:s=>parseFloat(s),stringify(s){const e=Number(s.value);return isFinite(e)?e.toExponential():W(s)}},js={identify:s=>typeof s=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:\.[0-9]+|[0-9]+\.[0-9]*)$/,resolve(s){const e=new O(parseFloat(s)),t=s.indexOf(".");return t!==-1&&s[s.length-1]==="0"&&(e.minFractionDigits=s.length-t-1),e},stringify:W},it=s=>typeof s=="bigint"||Number.isInteger(s),xt=(s,e,t,{intAsBigInt:n})=>n?BigInt(s):parseInt(s.substring(e),t);function xs(s,e,t){const{value:n}=s;return it(n)&&n>=0?t+n.toString(e):W(s)}const Cs={identify:s=>it(s)&&s>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^0o[0-7]+$/,resolve:(s,e,t)=>xt(s,2,8,t),stringify:s=>xs(s,8,"0o")},$s={identify:it,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9]+$/,resolve:(s,e,t)=>xt(s,0,10,t),stringify:W},_s={identify:s=>it(s)&&s>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^0x[0-9a-fA-F]+$/,resolve:(s,e,t)=>xt(s,2,16,t),stringify:s=>xs(s,16,"0x")},Mn=[Ae,ve,st,nt,jt,Cs,$s,_s,Is,Ls,js];function Gt(s){return typeof s=="bigint"||Number.isInteger(s)}const Fe=({value:s})=>JSON.stringify(s),Pn=[{identify:s=>typeof s=="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:s=>s,stringify:Fe},{identify:s=>s==null,createNode:()=>new O(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^null$/,resolve:()=>null,stringify:Fe},{identify:s=>typeof s=="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^true$|^false$/,resolve:s=>s==="true",stringify:Fe},{identify:Gt,default:!0,tag:"tag:yaml.org,2002:int",test:/^-?(?:0|[1-9][0-9]*)$/,resolve:(s,e,{intAsBigInt:t})=>t?BigInt(s):parseInt(s,10),stringify:({value:s})=>Gt(s)?s.toString():JSON.stringify(s)},{identify:s=>typeof s=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^-?(?:0|[1-9][0-9]*)(?:\.[0-9]*)?(?:[eE][-+]?[0-9]+)?$/,resolve:s=>parseFloat(s),stringify:Fe}],Dn={default:!0,tag:"",test:/^/,resolve(s,e){return e(`Unresolved plain scalar ${JSON.stringify(s)}`),s}},Kn=[Ae,ve].concat(Pn,Dn),Ct={identify:s=>s instanceof Uint8Array,default:!1,tag:"tag:yaml.org,2002:binary",resolve(s,e){if(typeof atob=="function"){const t=atob(s.replace(/[\n\r]/g,"")),n=new Uint8Array(t.length);for(let i=0;i<t.length;++i)n[i]=t.charCodeAt(i);return n}else return e("This environment does not support reading binary tags; either Buffer or atob is required"),s},stringify({comment:s,type:e,value:t},n,i,r){if(!t)return"";const o=t;let a;if(typeof btoa=="function"){let l="";for(let c=0;c<o.length;++c)l+=String.fromCharCode(o[c]);a=btoa(l)}else throw new Error("This environment does not support writing binary tags; either Buffer or btoa is required");if(e??(e=O.BLOCK_LITERAL),e!==O.QUOTE_DOUBLE){const l=Math.max(n.options.lineWidth-n.indent.length,n.options.minContentWidth),c=Math.ceil(a.length/l),m=new Array(c);for(let f=0,p=0;f<c;++f,p+=l)m[f]=a.substr(p,l);a=m.join(e===O.BLOCK_LITERAL?`
52
- `:" ")}return It({comment:s,type:e,value:a},n,i,r)}};function Bs(s,e){if(Be(s))for(let t=0;t<s.items.length;++t){let n=s.items[t];if(!B(n)){if(_e(n)){n.items.length>1&&e("Each pair must have its own sequence indicator");const i=n.items[0]||new U(new O(null));if(n.commentBefore&&(i.key.commentBefore=i.key.commentBefore?`${n.commentBefore}
53
- ${i.key.commentBefore}`:n.commentBefore),n.comment){const r=i.value??i.key;r.comment=r.comment?`${n.comment}
54
- ${r.comment}`:n.comment}n=i}s.items[t]=B(n)?n:new U(n)}}else e("Expected a sequence for this tag");return s}function Ms(s,e,t){const{replacer:n}=t,i=new le(s);i.tag="tag:yaml.org,2002:pairs";let r=0;if(e&&Symbol.iterator in Object(e))for(let o of e){typeof n=="function"&&(o=n.call(e,String(r++),o));let a,l;if(Array.isArray(o))if(o.length===2)a=o[0],l=o[1];else throw new TypeError(`Expected [key, value] tuple: ${o}`);else if(o&&o instanceof Object){const c=Object.keys(o);if(c.length===1)a=c[0],l=o[a];else throw new TypeError(`Expected tuple with one key, not ${c.length} keys`)}else a=o;i.items.push(Lt(a,l,t))}return i}const $t={collection:"seq",default:!1,tag:"tag:yaml.org,2002:pairs",resolve:Bs,createNode:Ms};class ye extends le{constructor(){super(),this.add=J.prototype.add.bind(this),this.delete=J.prototype.delete.bind(this),this.get=J.prototype.get.bind(this),this.has=J.prototype.has.bind(this),this.set=J.prototype.set.bind(this),this.tag=ye.tag}toJSON(e,t){if(!t)return super.toJSON(e);const n=new Map;t!=null&&t.onCreate&&t.onCreate(n);for(const i of this.items){let r,o;if(B(i)?(r=G(i.key,"",t),o=G(i.value,r,t)):r=G(i,"",t),n.has(r))throw new Error("Ordered maps must not include duplicate keys");n.set(r,o)}return n}static from(e,t,n){const i=Ms(e,t,n),r=new this;return r.items=i.items,r}}ye.tag="tag:yaml.org,2002:omap";const _t={collection:"seq",identify:s=>s instanceof Map,nodeClass:ye,default:!1,tag:"tag:yaml.org,2002:omap",resolve(s,e){const t=Bs(s,e),n=[];for(const{key:i}of t.items)x(i)&&(n.includes(i.value)?e(`Ordered maps must not include duplicate keys: ${i.value}`):n.push(i.value));return Object.assign(new ye,t)},createNode:(s,e,t)=>ye.from(s,e,t)};function Ps({value:s,source:e},t){return e&&(s?Ds:Ks).test.test(e)?e:s?t.options.trueStr:t.options.falseStr}const Ds={identify:s=>s===!0,default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:Y|y|[Yy]es|YES|[Tt]rue|TRUE|[Oo]n|ON)$/,resolve:()=>new O(!0),stringify:Ps},Ks={identify:s=>s===!1,default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:N|n|[Nn]o|NO|[Ff]alse|FALSE|[Oo]ff|OFF)$/,resolve:()=>new O(!1),stringify:Ps},Rn={identify:s=>typeof s=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,resolve:s=>s.slice(-3).toLowerCase()==="nan"?NaN:s[0]==="-"?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,stringify:W},Fn={identify:s=>typeof s=="number",default:!0,tag:"tag:yaml.org,2002:float",format:"EXP",test:/^[-+]?(?:[0-9][0-9_]*)?(?:\.[0-9_]*)?[eE][-+]?[0-9]+$/,resolve:s=>parseFloat(s.replace(/_/g,"")),stringify(s){const e=Number(s.value);return isFinite(e)?e.toExponential():W(s)}},qn={identify:s=>typeof s=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:[0-9][0-9_]*)?\.[0-9_]*$/,resolve(s){const e=new O(parseFloat(s.replace(/_/g,""))),t=s.indexOf(".");if(t!==-1){const n=s.substring(t+1).replace(/_/g,"");n[n.length-1]==="0"&&(e.minFractionDigits=n.length)}return e},stringify:W},Me=s=>typeof s=="bigint"||Number.isInteger(s);function rt(s,e,t,{intAsBigInt:n}){const i=s[0];if((i==="-"||i==="+")&&(e+=1),s=s.substring(e).replace(/_/g,""),n){switch(t){case 2:s=`0b${s}`;break;case 8:s=`0o${s}`;break;case 16:s=`0x${s}`;break}const o=BigInt(s);return i==="-"?BigInt(-1)*o:o}const r=parseInt(s,t);return i==="-"?-1*r:r}function Bt(s,e,t){const{value:n}=s;if(Me(n)){const i=n.toString(e);return n<0?"-"+t+i.substr(1):t+i}return W(s)}const Un={identify:Me,default:!0,tag:"tag:yaml.org,2002:int",format:"BIN",test:/^[-+]?0b[0-1_]+$/,resolve:(s,e,t)=>rt(s,2,2,t),stringify:s=>Bt(s,2,"0b")},Vn={identify:Me,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^[-+]?0[0-7_]+$/,resolve:(s,e,t)=>rt(s,1,8,t),stringify:s=>Bt(s,8,"0")},Yn={identify:Me,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9][0-9_]*$/,resolve:(s,e,t)=>rt(s,0,10,t),stringify:W},Jn={identify:Me,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^[-+]?0x[0-9a-fA-F_]+$/,resolve:(s,e,t)=>rt(s,2,16,t),stringify:s=>Bt(s,16,"0x")};class be extends J{constructor(e){super(e),this.tag=be.tag}add(e){let t;B(e)?t=e:e&&typeof e=="object"&&"key"in e&&"value"in e&&e.value===null?t=new U(e.key,null):t=new U(e,null),ae(this.items,t.key)||this.items.push(t)}get(e,t){const n=ae(this.items,e);return!t&&B(n)?x(n.key)?n.key.value:n.key:n}set(e,t){if(typeof t!="boolean")throw new Error(`Expected boolean value for set(key, value) in a YAML set, not ${typeof t}`);const n=ae(this.items,e);n&&!t?this.items.splice(this.items.indexOf(n),1):!n&&t&&this.items.push(new U(e))}toJSON(e,t){return super.toJSON(e,t,Set)}toString(e,t,n){if(!e)return JSON.stringify(this);if(this.hasAllNullValues(!0))return super.toString(Object.assign({},e,{allNullValues:!0}),t,n);throw new Error("Set items must all have null values")}static from(e,t,n){const{replacer:i}=n,r=new this(e);if(t&&Symbol.iterator in Object(t))for(let o of t)typeof i=="function"&&(o=i.call(t,o,o)),r.items.push(Lt(o,null,n));return r}}be.tag="tag:yaml.org,2002:set";const Mt={collection:"map",identify:s=>s instanceof Set,nodeClass:be,default:!1,tag:"tag:yaml.org,2002:set",createNode:(s,e,t)=>be.from(s,e,t),resolve(s,e){if(_e(s)){if(s.hasAllNullValues(!0))return Object.assign(new be,s);e("Set items must all have null values")}else e("Expected a mapping for this tag");return s}};function Pt(s,e){const t=s[0],n=t==="-"||t==="+"?s.substring(1):s,i=o=>e?BigInt(o):Number(o),r=n.replace(/_/g,"").split(":").reduce((o,a)=>o*i(60)+i(a),i(0));return t==="-"?i(-1)*r:r}function Rs(s){let{value:e}=s,t=o=>o;if(typeof e=="bigint")t=o=>BigInt(o);else if(isNaN(e)||!isFinite(e))return W(s);let n="";e<0&&(n="-",e*=t(-1));const i=t(60),r=[e%i];return e<60?r.unshift(0):(e=(e-r[0])/i,r.unshift(e%i),e>=60&&(e=(e-r[0])/i,r.unshift(e))),n+r.map(o=>String(o).padStart(2,"0")).join(":").replace(/000000\d*$/,"")}const Fs={identify:s=>typeof s=="bigint"||Number.isInteger(s),default:!0,tag:"tag:yaml.org,2002:int",format:"TIME",test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+$/,resolve:(s,e,{intAsBigInt:t})=>Pt(s,t),stringify:Rs},qs={identify:s=>typeof s=="number",default:!0,tag:"tag:yaml.org,2002:float",format:"TIME",test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+\.[0-9_]*$/,resolve:s=>Pt(s,!1),stringify:Rs},ot={identify:s=>s instanceof Date,default:!0,tag:"tag:yaml.org,2002:timestamp",test:RegExp("^([0-9]{4})-([0-9]{1,2})-([0-9]{1,2})(?:(?:t|T|[ \\t]+)([0-9]{1,2}):([0-9]{1,2}):([0-9]{1,2}(\\.[0-9]+)?)(?:[ \\t]*(Z|[-+][012]?[0-9](?::[0-9]{2})?))?)?$"),resolve(s){const e=s.match(ot.test);if(!e)throw new Error("!!timestamp expects a date, starting with yyyy-mm-dd");const[,t,n,i,r,o,a]=e.map(Number),l=e[7]?Number((e[7]+"00").substr(1,3)):0;let c=Date.UTC(t,n-1,i,r||0,o||0,a||0,l);const m=e[8];if(m&&m!=="Z"){let f=Pt(m,!1);Math.abs(f)<30&&(f*=60),c-=6e4*f}return new Date(c)},stringify:({value:s})=>(s==null?void 0:s.toISOString().replace(/(T00:00:00)?\.000Z$/,""))??""},Ht=[Ae,ve,st,nt,Ds,Ks,Un,Vn,Yn,Jn,Rn,Fn,qn,Ct,Z,_t,$t,Mt,Fs,qs,ot],Qt=new Map([["core",Mn],["failsafe",[Ae,ve,st]],["json",Kn],["yaml11",Ht],["yaml-1.1",Ht]]),Wt={binary:Ct,bool:jt,float:js,floatExp:Ls,floatNaN:Is,floatTime:qs,int:$s,intHex:_s,intOct:Cs,intTime:Fs,map:Ae,merge:Z,null:nt,omap:_t,pairs:$t,seq:ve,set:Mt,timestamp:ot},Gn={"tag:yaml.org,2002:binary":Ct,"tag:yaml.org,2002:merge":Z,"tag:yaml.org,2002:omap":_t,"tag:yaml.org,2002:pairs":$t,"tag:yaml.org,2002:set":Mt,"tag:yaml.org,2002:timestamp":ot};function lt(s,e,t){const n=Qt.get(e);if(n&&!s)return t&&!n.includes(Z)?n.concat(Z):n.slice();let i=n;if(!i)if(Array.isArray(s))i=[];else{const r=Array.from(Qt.keys()).filter(o=>o!=="yaml11").map(o=>JSON.stringify(o)).join(", ");throw new Error(`Unknown schema "${e}"; use one of ${r} or define customTags array`)}if(Array.isArray(s))for(const r of s)i=i.concat(r);else typeof s=="function"&&(i=s(i.slice()));return t&&(i=i.concat(Z)),i.reduce((r,o)=>{const a=typeof o=="string"?Wt[o]:o;if(!a){const l=JSON.stringify(o),c=Object.keys(Wt).map(m=>JSON.stringify(m)).join(", ");throw new Error(`Unknown custom tag ${l}; use one of ${c}`)}return r.includes(a)||r.push(a),r},[])}const Hn=(s,e)=>s.key<e.key?-1:s.key>e.key?1:0;class Dt{constructor({compat:e,customTags:t,merge:n,resolveKnownTags:i,schema:r,sortMapEntries:o,toStringDefaults:a}){this.compat=Array.isArray(e)?lt(e,"compat"):e?lt(null,e):null,this.name=typeof r=="string"&&r||"core",this.knownTags=i?Gn:{},this.tags=lt(t,this.name,n),this.toStringOptions=a??null,Object.defineProperty(this,se,{value:Ae}),Object.defineProperty(this,z,{value:st}),Object.defineProperty(this,Se,{value:ve}),this.sortMapEntries=typeof o=="function"?o:o===!0?Hn:null}clone(){const e=Object.create(Dt.prototype,Object.getOwnPropertyDescriptors(this));return e.tags=this.tags.slice(),e}}function Qn(s,e){var l;const t=[];let n=e.directives===!0;if(e.directives!==!1&&s.directives){const c=s.directives.toString(s);c?(t.push(c),n=!0):s.directives.docStart&&(n=!0)}n&&t.push("---");const i=Ns(s,e),{commentString:r}=i.options;if(s.commentBefore){t.length!==1&&t.unshift("");const c=r(s.commentBefore);t.unshift(X(c,""))}let o=!1,a=null;if(s.contents){if(_(s.contents)){if(s.contents.spaceBefore&&n&&t.push(""),s.contents.commentBefore){const f=r(s.contents.commentBefore);t.push(X(f,""))}i.forceBlockIndent=!!s.comment,a=s.contents.comment}const c=a?void 0:()=>o=!0;let m=we(s.contents,i,()=>a=null,c);a&&(m+=oe(m,"",r(a))),(m[0]==="|"||m[0]===">")&&t[t.length-1]==="---"?t[t.length-1]=`--- ${m}`:t.push(m)}else t.push(we(s.contents,i));if((l=s.directives)!=null&&l.docEnd)if(s.comment){const c=r(s.comment);c.includes(`
55
- `)?(t.push("..."),t.push(X(c,""))):t.push(`... ${c}`)}else t.push("...");else{let c=s.comment;c&&o&&(c=c.replace(/^\n+/,"")),c&&((!o||a)&&t[t.length-1]!==""&&t.push(""),t.push(X(r(c),"")))}return t.join(`
56
- `)+`
57
- `}class Pe{constructor(e,t,n){this.commentBefore=null,this.comment=null,this.errors=[],this.warnings=[],Object.defineProperty(this,H,{value:bt});let i=null;typeof t=="function"||Array.isArray(t)?i=t:n===void 0&&t&&(n=t,t=void 0);const r=Object.assign({intAsBigInt:!1,keepSourceTokens:!1,logLevel:"warn",prettyErrors:!0,strict:!0,stringKeys:!1,uniqueKeys:!0,version:"1.2"},n);this.options=r;let{version:o}=r;n!=null&&n._directives?(this.directives=n._directives.atDocument(),this.directives.yaml.explicit&&(o=this.directives.yaml.version)):this.directives=new q({version:o}),this.setSchema(o,n),this.contents=e===void 0?null:this.createNode(e,i,n)}clone(){const e=Object.create(Pe.prototype,{[H]:{value:bt}});return e.commentBefore=this.commentBefore,e.comment=this.comment,e.errors=this.errors.slice(),e.warnings=this.warnings.slice(),e.options=Object.assign({},this.options),this.directives&&(e.directives=this.directives.clone()),e.schema=this.schema.clone(),e.contents=_(this.contents)?this.contents.clone(e.schema):this.contents,this.range&&(e.range=this.range.slice()),e}add(e){ue(this.contents)&&this.contents.add(e)}addIn(e,t){ue(this.contents)&&this.contents.addIn(e,t)}createAlias(e,t){if(!e.anchor){const n=ys(this);e.anchor=!t||n.has(t)?bs(t||"a",n):t}return new Tt(e.anchor)}createNode(e,t,n){let i;if(typeof t=="function")e=t.call({"":e},"",e),i=t;else if(Array.isArray(t)){const g=w=>typeof w=="number"||w instanceof String||w instanceof Number,b=t.filter(g).map(String);b.length>0&&(t=t.concat(b)),i=t}else n===void 0&&t&&(n=t,t=void 0);const{aliasDuplicateObjects:r,anchorPrefix:o,flow:a,keepUndefined:l,onTagObj:c,tag:m}=n??{},{onAnchor:f,setAnchors:p,sourceObjects:h}=En(this,o||"a"),y={aliasDuplicateObjects:r??!0,keepUndefined:l??!1,onAnchor:f,onTagObj:c,replacer:i,schema:this.schema,sourceObjects:h},u=xe(e,m,y);return a&&$(u)&&(u.flow=!0),p(),u}createPair(e,t,n={}){const i=this.createNode(e,null,n),r=this.createNode(t,null,n);return new U(i,r)}delete(e){return ue(this.contents)?this.contents.delete(e):!1}deleteIn(e){return Te(e)?this.contents==null?!1:(this.contents=null,!0):ue(this.contents)?this.contents.deleteIn(e):!1}get(e,t){return $(this.contents)?this.contents.get(e,t):void 0}getIn(e,t){return Te(e)?!t&&x(this.contents)?this.contents.value:this.contents:$(this.contents)?this.contents.getIn(e,t):void 0}has(e){return $(this.contents)?this.contents.has(e):!1}hasIn(e){return Te(e)?this.contents!==void 0:$(this.contents)?this.contents.hasIn(e):!1}set(e,t){this.contents==null?this.contents=We(this.schema,[e],t):ue(this.contents)&&this.contents.set(e,t)}setIn(e,t){Te(e)?this.contents=t:this.contents==null?this.contents=We(this.schema,Array.from(e),t):ue(this.contents)&&this.contents.setIn(e,t)}setSchema(e,t={}){typeof e=="number"&&(e=String(e));let n;switch(e){case"1.1":this.directives?this.directives.yaml.version="1.1":this.directives=new q({version:"1.1"}),n={resolveKnownTags:!1,schema:"yaml-1.1"};break;case"1.2":case"next":this.directives?this.directives.yaml.version=e:this.directives=new q({version:e}),n={resolveKnownTags:!0,schema:"core"};break;case null:this.directives&&delete this.directives,n=null;break;default:{const i=JSON.stringify(e);throw new Error(`Expected '1.1', '1.2' or null as first argument, but found: ${i}`)}}if(t.schema instanceof Object)this.schema=t.schema;else if(n)this.schema=new Dt(Object.assign(n,t));else throw new Error("With a null YAML version, the { schema: Schema } option is required")}toJS({json:e,jsonArg:t,mapAsMap:n,maxAliasCount:i,onAnchor:r,reviver:o}={}){const a={anchors:new Map,doc:this,keep:!e,mapAsMap:n===!0,mapKeyWarned:!1,maxAliasCount:typeof i=="number"?i:100},l=G(this.contents,t??"",a);if(typeof r=="function")for(const{count:c,res:m}of a.anchors.values())r(m,c);return typeof o=="function"?me(o,{"":l},"",l):l}toJSON(e,t){return this.toJS({json:!0,jsonArg:e,mapAsMap:!1,onAnchor:t})}toString(e={}){if(this.errors.length>0)throw new Error("Document with errors cannot be stringified");if("indent"in e&&(!Number.isInteger(e.indent)||Number(e.indent)<=0)){const t=JSON.stringify(e.indent);throw new Error(`"indent" option must be a positive integer, not ${t}`)}return Qn(this,e)}}function ue(s){if($(s))return!0;throw new Error("Expected a YAML collection as document contents")}class Us extends Error{constructor(e,t,n,i){super(),this.name=e,this.code=n,this.message=i,this.pos=t}}class Ie extends Us{constructor(e,t,n){super("YAMLParseError",e,t,n)}}class Wn extends Us{constructor(e,t,n){super("YAMLWarning",e,t,n)}}const zt=(s,e)=>t=>{if(t.pos[0]===-1)return;t.linePos=t.pos.map(a=>e.linePos(a));const{line:n,col:i}=t.linePos[0];t.message+=` at line ${n}, column ${i}`;let r=i-1,o=s.substring(e.lineStarts[n-1],e.lineStarts[n]).replace(/[\n\r]+$/,"");if(r>=60&&o.length>80){const a=Math.min(r-39,o.length-79);o="…"+o.substring(a),r-=a-1}if(o.length>80&&(o=o.substring(0,79)+"…"),n>1&&/^ *$/.test(o.substring(0,r))){let a=s.substring(e.lineStarts[n-2],e.lineStarts[n-1]);a.length>80&&(a=a.substring(0,79)+`…
58
- `),o=a+o}if(/[^ ]/.test(o)){let a=1;const l=t.linePos[1];(l==null?void 0:l.line)===n&&l.col>i&&(a=Math.max(1,Math.min(l.col-i,80-r)));const c=" ".repeat(r)+"^".repeat(a);t.message+=`:
59
-
60
- ${o}
61
- ${c}
62
- `}};function ke(s,{flow:e,indicator:t,next:n,offset:i,onError:r,parentIndent:o,startOnNewline:a}){let l=!1,c=a,m=a,f="",p="",h=!1,y=!1,u=null,g=null,b=null,w=null,E=null,S=null,N=null;for(const k of s)switch(y&&(k.type!=="space"&&k.type!=="newline"&&k.type!=="comma"&&r(k.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space"),y=!1),u&&(c&&k.type!=="comment"&&k.type!=="newline"&&r(u,"TAB_AS_INDENT","Tabs are not allowed as indentation"),u=null),k.type){case"space":!e&&(t!=="doc-start"||(n==null?void 0:n.type)!=="flow-collection")&&k.source.includes(" ")&&(u=k),m=!0;break;case"comment":{m||r(k,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");const I=k.source.substring(1)||" ";f?f+=p+I:f=I,p="",c=!1;break}case"newline":c?f?f+=k.source:(!S||t!=="seq-item-ind")&&(l=!0):p+=k.source,c=!0,h=!0,(g||b)&&(w=k),m=!0;break;case"anchor":g&&r(k,"MULTIPLE_ANCHORS","A node can have at most one anchor"),k.source.endsWith(":")&&r(k.offset+k.source.length-1,"BAD_ALIAS","Anchor ending in : is ambiguous",!0),g=k,N??(N=k.offset),c=!1,m=!1,y=!0;break;case"tag":{b&&r(k,"MULTIPLE_TAGS","A node can have at most one tag"),b=k,N??(N=k.offset),c=!1,m=!1,y=!0;break}case t:(g||b)&&r(k,"BAD_PROP_ORDER",`Anchors and tags must be after the ${k.source} indicator`),S&&r(k,"UNEXPECTED_TOKEN",`Unexpected ${k.source} in ${e??"collection"}`),S=k,c=t==="seq-item-ind"||t==="explicit-key-ind",m=!1;break;case"comma":if(e){E&&r(k,"UNEXPECTED_TOKEN",`Unexpected , in ${e}`),E=k,c=!1,m=!1;break}default:r(k,"UNEXPECTED_TOKEN",`Unexpected ${k.type} token`),c=!1,m=!1}const v=s[s.length-1],A=v?v.offset+v.source.length:i;return y&&n&&n.type!=="space"&&n.type!=="newline"&&n.type!=="comma"&&(n.type!=="scalar"||n.source!=="")&&r(n.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space"),u&&(c&&u.indent<=o||(n==null?void 0:n.type)==="block-map"||(n==null?void 0:n.type)==="block-seq")&&r(u,"TAB_AS_INDENT","Tabs are not allowed as indentation"),{comma:E,found:S,spaceBefore:l,comment:f,hasNewline:h,anchor:g,tag:b,newlineAfterProp:w,end:A,start:N??A}}function Ce(s){if(!s)return null;switch(s.type){case"alias":case"scalar":case"double-quoted-scalar":case"single-quoted-scalar":if(s.source.includes(`
63
- `))return!0;if(s.end){for(const e of s.end)if(e.type==="newline")return!0}return!1;case"flow-collection":for(const e of s.items){for(const t of e.start)if(t.type==="newline")return!0;if(e.sep){for(const t of e.sep)if(t.type==="newline")return!0}if(Ce(e.key)||Ce(e.value))return!0}return!1;default:return!0}}function Nt(s,e,t){if((e==null?void 0:e.type)==="flow-collection"){const n=e.end[0];n.indent===s&&(n.source==="]"||n.source==="}")&&Ce(e)&&t(n,"BAD_INDENT","Flow end indicator should be more indented than parent",!0)}}function Vs(s,e,t){const{uniqueKeys:n}=s.options;if(n===!1)return!1;const i=typeof n=="function"?n:(r,o)=>r===o||x(r)&&x(o)&&r.value===o.value;return e.some(r=>i(r.key,t))}const Xt="All mapping items must start at the same column";function zn({composeNode:s,composeEmptyNode:e},t,n,i,r){var m;const o=(r==null?void 0:r.nodeClass)??J,a=new o(t.schema);t.atRoot&&(t.atRoot=!1);let l=n.offset,c=null;for(const f of n.items){const{start:p,key:h,sep:y,value:u}=f,g=ke(p,{indicator:"explicit-key-ind",next:h??(y==null?void 0:y[0]),offset:l,onError:i,parentIndent:n.indent,startOnNewline:!0}),b=!g.found;if(b){if(h&&(h.type==="block-seq"?i(l,"BLOCK_AS_IMPLICIT_KEY","A block sequence may not be used as an implicit map key"):"indent"in h&&h.indent!==n.indent&&i(l,"BAD_INDENT",Xt)),!g.anchor&&!g.tag&&!y){c=g.end,g.comment&&(a.comment?a.comment+=`
64
- `+g.comment:a.comment=g.comment);continue}(g.newlineAfterProp||Ce(h))&&i(h??p[p.length-1],"MULTILINE_IMPLICIT_KEY","Implicit keys need to be on a single line")}else((m=g.found)==null?void 0:m.indent)!==n.indent&&i(l,"BAD_INDENT",Xt);t.atKey=!0;const w=g.end,E=h?s(t,h,g,i):e(t,w,p,null,g,i);t.schema.compat&&Nt(n.indent,h,i),t.atKey=!1,Vs(t,a.items,E)&&i(w,"DUPLICATE_KEY","Map keys must be unique");const S=ke(y??[],{indicator:"map-value-ind",next:u,offset:E.range[2],onError:i,parentIndent:n.indent,startOnNewline:!h||h.type==="block-scalar"});if(l=S.end,S.found){b&&((u==null?void 0:u.type)==="block-map"&&!S.hasNewline&&i(l,"BLOCK_AS_IMPLICIT_KEY","Nested mappings are not allowed in compact mappings"),t.options.strict&&g.start<S.found.offset-1024&&i(E.range,"KEY_OVER_1024_CHARS","The : indicator must be at most 1024 chars after the start of an implicit block mapping key"));const N=u?s(t,u,S,i):e(t,l,y,null,S,i);t.schema.compat&&Nt(n.indent,u,i),l=N.range[2];const v=new U(E,N);t.options.keepSourceTokens&&(v.srcToken=f),a.items.push(v)}else{b&&i(E.range,"MISSING_CHAR","Implicit map keys need to be followed by map values"),S.comment&&(E.comment?E.comment+=`
65
- `+S.comment:E.comment=S.comment);const N=new U(E);t.options.keepSourceTokens&&(N.srcToken=f),a.items.push(N)}}return c&&c<l&&i(c,"IMPOSSIBLE","Map comment with trailing content"),a.range=[n.offset,l,c??l],a}function Xn({composeNode:s,composeEmptyNode:e},t,n,i,r){const o=(r==null?void 0:r.nodeClass)??le,a=new o(t.schema);t.atRoot&&(t.atRoot=!1),t.atKey&&(t.atKey=!1);let l=n.offset,c=null;for(const{start:m,value:f}of n.items){const p=ke(m,{indicator:"seq-item-ind",next:f,offset:l,onError:i,parentIndent:n.indent,startOnNewline:!0});if(!p.found)if(p.anchor||p.tag||f)(f==null?void 0:f.type)==="block-seq"?i(p.end,"BAD_INDENT","All sequence items must start at the same column"):i(l,"MISSING_CHAR","Sequence item without - indicator");else{c=p.end,p.comment&&(a.comment=p.comment);continue}const h=f?s(t,f,p,i):e(t,p.end,m,null,p,i);t.schema.compat&&Nt(n.indent,f,i),l=h.range[2],a.items.push(h)}return a.range=[n.offset,l,c??l],a}function De(s,e,t,n){let i="";if(s){let r=!1,o="";for(const a of s){const{source:l,type:c}=a;switch(c){case"space":r=!0;break;case"comment":{t&&!r&&n(a,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");const m=l.substring(1)||" ";i?i+=o+m:i=m,o="";break}case"newline":i&&(o+=l),r=!0;break;default:n(a,"UNEXPECTED_TOKEN",`Unexpected ${c} at node end`)}e+=l.length}}return{comment:i,offset:e}}const ct="Block collections are not allowed within flow collections",ft=s=>s&&(s.type==="block-map"||s.type==="block-seq");function Zn({composeNode:s,composeEmptyNode:e},t,n,i,r){var g;const o=n.start.source==="{",a=o?"flow map":"flow sequence",l=(r==null?void 0:r.nodeClass)??(o?J:le),c=new l(t.schema);c.flow=!0;const m=t.atRoot;m&&(t.atRoot=!1),t.atKey&&(t.atKey=!1);let f=n.offset+n.start.source.length;for(let b=0;b<n.items.length;++b){const w=n.items[b],{start:E,key:S,sep:N,value:v}=w,A=ke(E,{flow:a,indicator:"explicit-key-ind",next:S??(N==null?void 0:N[0]),offset:f,onError:i,parentIndent:n.indent,startOnNewline:!1});if(!A.found){if(!A.anchor&&!A.tag&&!N&&!v){b===0&&A.comma?i(A.comma,"UNEXPECTED_TOKEN",`Unexpected , in ${a}`):b<n.items.length-1&&i(A.start,"UNEXPECTED_TOKEN",`Unexpected empty item in ${a}`),A.comment&&(c.comment?c.comment+=`
66
- `+A.comment:c.comment=A.comment),f=A.end;continue}!o&&t.options.strict&&Ce(S)&&i(S,"MULTILINE_IMPLICIT_KEY","Implicit keys of flow sequence pairs need to be on a single line")}if(b===0)A.comma&&i(A.comma,"UNEXPECTED_TOKEN",`Unexpected , in ${a}`);else if(A.comma||i(A.start,"MISSING_CHAR",`Missing , between ${a} items`),A.comment){let k="";e:for(const I of E)switch(I.type){case"comma":case"space":break;case"comment":k=I.source.substring(1);break e;default:break e}if(k){let I=c.items[c.items.length-1];B(I)&&(I=I.value??I.key),I.comment?I.comment+=`
67
- `+k:I.comment=k,A.comment=A.comment.substring(k.length+1)}}if(!o&&!N&&!A.found){const k=v?s(t,v,A,i):e(t,A.end,N,null,A,i);c.items.push(k),f=k.range[2],ft(v)&&i(k.range,"BLOCK_IN_FLOW",ct)}else{t.atKey=!0;const k=A.end,I=S?s(t,S,A,i):e(t,k,E,null,A,i);ft(S)&&i(I.range,"BLOCK_IN_FLOW",ct),t.atKey=!1;const C=ke(N??[],{flow:a,indicator:"map-value-ind",next:v,offset:I.range[2],onError:i,parentIndent:n.indent,startOnNewline:!1});if(C.found){if(!o&&!A.found&&t.options.strict){if(N)for(const P of N){if(P===C.found)break;if(P.type==="newline"){i(P,"MULTILINE_IMPLICIT_KEY","Implicit keys of flow sequence pairs need to be on a single line");break}}A.start<C.found.offset-1024&&i(C.found,"KEY_OVER_1024_CHARS","The : indicator must be at most 1024 chars after the start of an implicit flow sequence key")}}else v&&("source"in v&&((g=v.source)==null?void 0:g[0])===":"?i(v,"MISSING_CHAR",`Missing space after : in ${a}`):i(C.start,"MISSING_CHAR",`Missing , or : between ${a} items`));const R=v?s(t,v,C,i):C.found?e(t,C.end,N,null,C,i):null;R?ft(v)&&i(R.range,"BLOCK_IN_FLOW",ct):C.comment&&(I.comment?I.comment+=`
68
- `+C.comment:I.comment=C.comment);const D=new U(I,R);if(t.options.keepSourceTokens&&(D.srcToken=w),o){const P=c;Vs(t,P.items,I)&&i(k,"DUPLICATE_KEY","Map keys must be unique"),P.items.push(D)}else{const P=new J(t.schema);P.flow=!0,P.items.push(D);const j=(R??I).range;P.range=[I.range[0],j[1],j[2]],c.items.push(P)}f=R?R.range[2]:C.end}}const p=o?"}":"]",[h,...y]=n.end;let u=f;if((h==null?void 0:h.source)===p)u=h.offset+h.source.length;else{const b=a[0].toUpperCase()+a.substring(1),w=m?`${b} must end with a ${p}`:`${b} in block collection must be sufficiently indented and end with a ${p}`;i(f,m?"MISSING_CHAR":"BAD_INDENT",w),h&&h.source.length!==1&&y.unshift(h)}if(y.length>0){const b=De(y,u,t.options.strict,i);b.comment&&(c.comment?c.comment+=`
69
- `+b.comment:c.comment=b.comment),c.range=[n.offset,u,b.offset]}else c.range=[n.offset,u,u];return c}function ut(s,e,t,n,i,r){const o=t.type==="block-map"?zn(s,e,t,n,r):t.type==="block-seq"?Xn(s,e,t,n,r):Zn(s,e,t,n,r),a=o.constructor;return i==="!"||i===a.tagName?(o.tag=a.tagName,o):(i&&(o.tag=i),o)}function ei(s,e,t,n,i){var p;const r=n.tag,o=r?e.directives.tagName(r.source,h=>i(r,"TAG_RESOLVE_FAILED",h)):null;if(t.type==="block-seq"){const{anchor:h,newlineAfterProp:y}=n,u=h&&r?h.offset>r.offset?h:r:h??r;u&&(!y||y.offset<u.offset)&&i(u,"MISSING_CHAR","Missing newline after block sequence props")}const a=t.type==="block-map"?"map":t.type==="block-seq"?"seq":t.start.source==="{"?"map":"seq";if(!r||!o||o==="!"||o===J.tagName&&a==="map"||o===le.tagName&&a==="seq")return ut(s,e,t,i,o);let l=e.schema.tags.find(h=>h.tag===o&&h.collection===a);if(!l){const h=e.schema.knownTags[o];if((h==null?void 0:h.collection)===a)e.schema.tags.push(Object.assign({},h,{default:!1})),l=h;else return h?i(r,"BAD_COLLECTION_TYPE",`${h.tag} used for ${a} collection, but expects ${h.collection??"scalar"}`,!0):i(r,"TAG_RESOLVE_FAILED",`Unresolved tag: ${o}`,!0),ut(s,e,t,i,o)}const c=ut(s,e,t,i,o,l),m=((p=l.resolve)==null?void 0:p.call(l,c,h=>i(r,"TAG_RESOLVE_FAILED",h),e.options))??c,f=_(m)?m:new O(m);return f.range=c.range,f.tag=o,l!=null&&l.format&&(f.format=l.format),f}function ti(s,e,t){const n=e.offset,i=si(e,s.options.strict,t);if(!i)return{value:"",type:null,comment:"",range:[n,n,n]};const r=i.mode===">"?O.BLOCK_FOLDED:O.BLOCK_LITERAL,o=e.source?ni(e.source):[];let a=o.length;for(let u=o.length-1;u>=0;--u){const g=o[u][1];if(g===""||g==="\r")a=u;else break}if(a===0){const u=i.chomp==="+"&&o.length>0?`
70
- `.repeat(Math.max(1,o.length-1)):"";let g=n+i.length;return e.source&&(g+=e.source.length),{value:u,type:r,comment:i.comment,range:[n,g,g]}}let l=e.indent+i.indent,c=e.offset+i.length,m=0;for(let u=0;u<a;++u){const[g,b]=o[u];if(b===""||b==="\r")i.indent===0&&g.length>l&&(l=g.length);else{g.length<l&&t(c+g.length,"MISSING_CHAR","Block scalars with more-indented leading empty lines must use an explicit indentation indicator"),i.indent===0&&(l=g.length),m=u,l===0&&!s.atRoot&&t(c,"BAD_INDENT","Block scalar values in collections must be indented");break}c+=g.length+b.length+1}for(let u=o.length-1;u>=a;--u)o[u][0].length>l&&(a=u+1);let f="",p="",h=!1;for(let u=0;u<m;++u)f+=o[u][0].slice(l)+`
71
- `;for(let u=m;u<a;++u){let[g,b]=o[u];c+=g.length+b.length+1;const w=b[b.length-1]==="\r";if(w&&(b=b.slice(0,-1)),b&&g.length<l){const S=`Block scalar lines must not be less indented than their ${i.indent?"explicit indentation indicator":"first line"}`;t(c-b.length-(w?2:1),"BAD_INDENT",S),g=""}r===O.BLOCK_LITERAL?(f+=p+g.slice(l)+b,p=`
72
- `):g.length>l||b[0]===" "?(p===" "?p=`
73
- `:!h&&p===`
74
- `&&(p=`
75
-
76
- `),f+=p+g.slice(l)+b,p=`
77
- `,h=!0):b===""?p===`
78
- `?f+=`
79
- `:p=`
80
- `:(f+=p+b,p=" ",h=!1)}switch(i.chomp){case"-":break;case"+":for(let u=a;u<o.length;++u)f+=`
81
- `+o[u][0].slice(l);f[f.length-1]!==`
82
- `&&(f+=`
83
- `);break;default:f+=`
84
- `}const y=n+i.length+e.source.length;return{value:f,type:r,comment:i.comment,range:[n,y,y]}}function si({offset:s,props:e},t,n){if(e[0].type!=="block-scalar-header")return n(e[0],"IMPOSSIBLE","Block scalar header not found"),null;const{source:i}=e[0],r=i[0];let o=0,a="",l=-1;for(let p=1;p<i.length;++p){const h=i[p];if(!a&&(h==="-"||h==="+"))a=h;else{const y=Number(h);!o&&y?o=y:l===-1&&(l=s+p)}}l!==-1&&n(l,"UNEXPECTED_TOKEN",`Block scalar header includes extra characters: ${i}`);let c=!1,m="",f=i.length;for(let p=1;p<e.length;++p){const h=e[p];switch(h.type){case"space":c=!0;case"newline":f+=h.source.length;break;case"comment":t&&!c&&n(h,"MISSING_CHAR","Comments must be separated from other tokens by white space characters"),f+=h.source.length,m=h.source.substring(1);break;case"error":n(h,"UNEXPECTED_TOKEN",h.message),f+=h.source.length;break;default:{const y=`Unexpected token in block scalar header: ${h.type}`;n(h,"UNEXPECTED_TOKEN",y);const u=h.source;u&&typeof u=="string"&&(f+=u.length)}}}return{mode:r,indent:o,chomp:a,comment:m,length:f}}function ni(s){const e=s.split(/\n( *)/),t=e[0],n=t.match(/^( *)/),r=[n!=null&&n[1]?[n[1],t.slice(n[1].length)]:["",t]];for(let o=1;o<e.length;o+=2)r.push([e[o],e[o+1]]);return r}function ii(s,e,t){const{offset:n,type:i,source:r,end:o}=s;let a,l;const c=(p,h,y)=>t(n+p,h,y);switch(i){case"scalar":a=O.PLAIN,l=ri(r,c);break;case"single-quoted-scalar":a=O.QUOTE_SINGLE,l=oi(r,c);break;case"double-quoted-scalar":a=O.QUOTE_DOUBLE,l=ai(r,c);break;default:return t(s,"UNEXPECTED_TOKEN",`Expected a flow scalar value, but found: ${i}`),{value:"",type:null,comment:"",range:[n,n+r.length,n+r.length]}}const m=n+r.length,f=De(o,m,e,t);return{value:l,type:a,comment:f.comment,range:[n,m,f.offset]}}function ri(s,e){let t="";switch(s[0]){case" ":t="a tab character";break;case",":t="flow indicator character ,";break;case"%":t="directive indicator character %";break;case"|":case">":{t=`block scalar indicator ${s[0]}`;break}case"@":case"`":{t=`reserved character ${s[0]}`;break}}return t&&e(0,"BAD_SCALAR_START",`Plain value cannot start with ${t}`),Ys(s)}function oi(s,e){return(s[s.length-1]!=="'"||s.length===1)&&e(s.length,"MISSING_CHAR","Missing closing 'quote"),Ys(s.slice(1,-1)).replace(/''/g,"'")}function Ys(s){const e=/(.*?)\r?\n/sy;let t=e.exec(s);if(!t)return s;let n,i;try{n=new RegExp("(?<![ ])[ ]+$"),i=new RegExp("^[ ]+|(?<![ ])[ ]+$","g")}catch{n=/[ \t]+$/,i=/^[ \t]+|[ \t]+$/g}let r=t[1].replace(n,""),o=" ",a=e.lastIndex;for(;t=e.exec(s);){const c=t[1].replace(i,"");c===""?o===`
85
- `?r+=o:o=`
86
- `:(r+=o+c,o=" "),a=e.lastIndex}const l=/[ \t]*(.*)/sy;return l.lastIndex=a,t=l.exec(s),r+o+((t==null?void 0:t[1])??"")}function ai(s,e){let t="";for(let n=1;n<s.length-1;++n){const i=s[n];if(!(i==="\r"&&s[n+1]===`
87
- `))if(i===`
88
- `){const{fold:r,offset:o}=li(s,n);t+=r,n=o}else if(i==="\\"){let r=s[++n];const o=ci[r];if(o)t+=o;else if(r===`
89
- `)for(r=s[n+1];r===" "||r===" ";)r=s[++n+1];else if(r==="\r"&&s[n+1]===`
90
- `)for(r=s[++n+1];r===" "||r===" ";)r=s[++n+1];else if(r==="x"||r==="u"||r==="U"){const a=r==="x"?2:r==="u"?4:8;t+=fi(s,n+1,a,e),n+=a}else{const a=s.substr(n-1,2);e(n-1,"BAD_DQ_ESCAPE",`Invalid escape sequence ${a}`),t+=a}}else if(i===" "||i===" "){const r=n;let o=s[n+1];for(;o===" "||o===" ";)o=s[++n+1];o!==`
91
- `&&!(o==="\r"&&s[n+2]===`
92
- `)&&(t+=n>r?s.slice(r,n+1):i)}else t+=i}return(s[s.length-1]!=='"'||s.length===1)&&e(s.length,"MISSING_CHAR",'Missing closing "quote'),t}function li(s,e){let t="",n=s[e+1];for(;(n===" "||n===" "||n===`
93
- `||n==="\r")&&!(n==="\r"&&s[e+2]!==`
94
- `);)n===`
95
- `&&(t+=`
96
- `),e+=1,n=s[e+1];return t||(t=" "),{fold:t,offset:e}}const ci={0:"\0",a:"\x07",b:"\b",e:"\x1B",f:"\f",n:`
97
- `,r:"\r",t:" ",v:"\v",N:"…",_:" ",L:"\u2028",P:"\u2029"," ":" ",'"':'"',"/":"/","\\":"\\"," ":" "};function fi(s,e,t,n){const i=s.substr(e,t),o=i.length===t&&/^[0-9a-fA-F]+$/.test(i)?parseInt(i,16):NaN;try{return String.fromCodePoint(o)}catch{const a=s.substr(e-2,t+2);return n(e-2,"BAD_DQ_ESCAPE",`Invalid escape sequence ${a}`),a}}function Js(s,e,t,n){const{value:i,type:r,comment:o,range:a}=e.type==="block-scalar"?ti(s,e,n):ii(e,s.options.strict,n),l=t?s.directives.tagName(t.source,f=>n(t,"TAG_RESOLVE_FAILED",f)):null;let c;s.options.stringKeys&&s.atKey?c=s.schema[z]:l?c=ui(s.schema,i,l,t,n):e.type==="scalar"?c=hi(s,i,e,n):c=s.schema[z];let m;try{const f=c.resolve(i,p=>n(t??e,"TAG_RESOLVE_FAILED",p),s.options);m=x(f)?f:new O(f)}catch(f){const p=f instanceof Error?f.message:String(f);n(t??e,"TAG_RESOLVE_FAILED",p),m=new O(i)}return m.range=a,m.source=i,r&&(m.type=r),l&&(m.tag=l),c.format&&(m.format=c.format),o&&(m.comment=o),m}function ui(s,e,t,n,i){var a;if(t==="!")return s[z];const r=[];for(const l of s.tags)if(!l.collection&&l.tag===t)if(l.default&&l.test)r.push(l);else return l;for(const l of r)if((a=l.test)!=null&&a.test(e))return l;const o=s.knownTags[t];return o&&!o.collection?(s.tags.push(Object.assign({},o,{default:!1,test:void 0})),o):(i(n,"TAG_RESOLVE_FAILED",`Unresolved tag: ${t}`,t!=="tag:yaml.org,2002:str"),s[z])}function hi({atKey:s,directives:e,schema:t},n,i,r){const o=t.tags.find(a=>{var l;return(a.default===!0||s&&a.default==="key")&&((l=a.test)==null?void 0:l.test(n))})||t[z];if(t.compat){const a=t.compat.find(l=>{var c;return l.default&&((c=l.test)==null?void 0:c.test(n))})??t[z];if(o.tag!==a.tag){const l=e.tagString(o.tag),c=e.tagString(a.tag),m=`Value may be parsed as either ${l} or ${c}`;r(i,"TAG_RESOLVE_FAILED",m,!0)}}return o}function di(s,e,t){if(e){t??(t=e.length);for(let n=t-1;n>=0;--n){let i=e[n];switch(i.type){case"space":case"comment":case"newline":s-=i.source.length;continue}for(i=e[++n];(i==null?void 0:i.type)==="space";)s+=i.source.length,i=e[++n];break}}return s}const mi={composeNode:Gs,composeEmptyNode:Kt};function Gs(s,e,t,n){const i=s.atKey,{spaceBefore:r,comment:o,anchor:a,tag:l}=t;let c,m=!0;switch(e.type){case"alias":c=pi(s,e,n),(a||l)&&n(e,"ALIAS_PROPS","An alias node must not specify any properties");break;case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":case"block-scalar":c=Js(s,e,l,n),a&&(c.anchor=a.source.substring(1));break;case"block-map":case"block-seq":case"flow-collection":try{c=ei(mi,s,e,t,n),a&&(c.anchor=a.source.substring(1))}catch(f){const p=f instanceof Error?f.message:String(f);n(e,"RESOURCE_EXHAUSTION",p)}break;default:{const f=e.type==="error"?e.message:`Unsupported token (type: ${e.type})`;n(e,"UNEXPECTED_TOKEN",f),m=!1}}return c??(c=Kt(s,e.offset,void 0,null,t,n)),a&&c.anchor===""&&n(a,"BAD_ALIAS","Anchor cannot be an empty string"),i&&s.options.stringKeys&&(!x(c)||typeof c.value!="string"||c.tag&&c.tag!=="tag:yaml.org,2002:str")&&n(l??e,"NON_STRING_KEY","With stringKeys, all keys must be strings"),r&&(c.spaceBefore=!0),o&&(e.type==="scalar"&&e.source===""?c.comment=o:c.commentBefore=o),s.options.keepSourceTokens&&m&&(c.srcToken=e),c}function Kt(s,e,t,n,{spaceBefore:i,comment:r,anchor:o,tag:a,end:l},c){const m={type:"scalar",offset:di(e,t,n),indent:-1,source:""},f=Js(s,m,a,c);return o&&(f.anchor=o.source.substring(1),f.anchor===""&&c(o,"BAD_ALIAS","Anchor cannot be an empty string")),i&&(f.spaceBefore=!0),r&&(f.comment=r,f.range[2]=l),f}function pi({options:s},{offset:e,source:t,end:n},i){const r=new Tt(t.substring(1));r.source===""&&i(e,"BAD_ALIAS","Alias cannot be an empty string"),r.source.endsWith(":")&&i(e+t.length-1,"BAD_ALIAS","Alias ending in : is ambiguous",!0);const o=e+t.length,a=De(n,o,s.strict,i);return r.range=[e,o,a.offset],a.comment&&(r.comment=a.comment),r}function gi(s,e,{offset:t,start:n,value:i,end:r},o){const a=Object.assign({_directives:e},s),l=new Pe(void 0,a),c={atKey:!1,atRoot:!0,directives:l.directives,options:l.options,schema:l.schema},m=ke(n,{indicator:"doc-start",next:i??(r==null?void 0:r[0]),offset:t,onError:o,parentIndent:0,startOnNewline:!0});m.found&&(l.directives.docStart=!0,i&&(i.type==="block-map"||i.type==="block-seq")&&!m.hasNewline&&o(m.end,"MISSING_CHAR","Block collection cannot start on same line with directives-end marker")),l.contents=i?Gs(c,i,m,o):Kt(c,m.end,n,null,m,o);const f=l.contents.range[2],p=De(r,f,!1,o);return p.comment&&(l.comment=p.comment),l.range=[t,f,p.offset],l}function Oe(s){if(typeof s=="number")return[s,s+1];if(Array.isArray(s))return s.length===2?s:[s[0],s[1]];const{offset:e,source:t}=s;return[e,e+(typeof t=="string"?t.length:1)]}function Zt(s){var i;let e="",t=!1,n=!1;for(let r=0;r<s.length;++r){const o=s[r];switch(o[0]){case"#":e+=(e===""?"":n?`
98
-
99
- `:`
100
- `)+(o.substring(1)||" "),t=!0,n=!1;break;case"%":((i=s[r+1])==null?void 0:i[0])!=="#"&&(r+=1),t=!1;break;default:t||(n=!0),t=!1}}return{comment:e,afterEmptyLine:n}}class yi{constructor(e={}){this.doc=null,this.atDirectives=!1,this.prelude=[],this.errors=[],this.warnings=[],this.onError=(t,n,i,r)=>{const o=Oe(t);r?this.warnings.push(new Wn(o,n,i)):this.errors.push(new Ie(o,n,i))},this.directives=new q({version:e.version||"1.2"}),this.options=e}decorate(e,t){const{comment:n,afterEmptyLine:i}=Zt(this.prelude);if(n){const r=e.contents;if(t)e.comment=e.comment?`${e.comment}
101
- ${n}`:n;else if(i||e.directives.docStart||!r)e.commentBefore=n;else if($(r)&&!r.flow&&r.items.length>0){let o=r.items[0];B(o)&&(o=o.key);const a=o.commentBefore;o.commentBefore=a?`${n}
102
- ${a}`:n}else{const o=r.commentBefore;r.commentBefore=o?`${n}
103
- ${o}`:n}}if(t){for(let r=0;r<this.errors.length;++r)e.errors.push(this.errors[r]);for(let r=0;r<this.warnings.length;++r)e.warnings.push(this.warnings[r])}else e.errors=this.errors,e.warnings=this.warnings;this.prelude=[],this.errors=[],this.warnings=[]}streamInfo(){return{comment:Zt(this.prelude).comment,directives:this.directives,errors:this.errors,warnings:this.warnings}}*compose(e,t=!1,n=-1){for(const i of e)yield*this.next(i);yield*this.end(t,n)}*next(e){switch(e.type){case"directive":this.directives.add(e.source,(t,n,i)=>{const r=Oe(e);r[0]+=t,this.onError(r,"BAD_DIRECTIVE",n,i)}),this.prelude.push(e.source),this.atDirectives=!0;break;case"document":{const t=gi(this.options,this.directives,e,this.onError);this.atDirectives&&!t.directives.docStart&&this.onError(e,"MISSING_CHAR","Missing directives-end/doc-start indicator line"),this.decorate(t,!1),this.doc&&(yield this.doc),this.doc=t,this.atDirectives=!1;break}case"byte-order-mark":case"space":break;case"comment":case"newline":this.prelude.push(e.source);break;case"error":{const t=e.source?`${e.message}: ${JSON.stringify(e.source)}`:e.message,n=new Ie(Oe(e),"UNEXPECTED_TOKEN",t);this.atDirectives||!this.doc?this.errors.push(n):this.doc.errors.push(n);break}case"doc-end":{if(!this.doc){const n="Unexpected doc-end without preceding document";this.errors.push(new Ie(Oe(e),"UNEXPECTED_TOKEN",n));break}this.doc.directives.docEnd=!0;const t=De(e.end,e.offset+e.source.length,this.doc.options.strict,this.onError);if(this.decorate(this.doc,!0),t.comment){const n=this.doc.comment;this.doc.comment=n?`${n}
104
- ${t.comment}`:t.comment}this.doc.range[2]=t.offset;break}default:this.errors.push(new Ie(Oe(e),"UNEXPECTED_TOKEN",`Unsupported token ${e.type}`))}}*end(e=!1,t=-1){if(this.doc)this.decorate(this.doc,!0),yield this.doc,this.doc=null;else if(e){const n=Object.assign({_directives:this.directives},this.options),i=new Pe(void 0,n);this.atDirectives&&this.onError(t,"MISSING_CHAR","Missing directives-end indicator line"),i.range=[0,t,t],this.decorate(i,!1),yield i}}}const Hs="\uFEFF",Qs="",Ws="",Et="";function bi(s){switch(s){case Hs:return"byte-order-mark";case Qs:return"doc-mode";case Ws:return"flow-error-end";case Et:return"scalar";case"---":return"doc-start";case"...":return"doc-end";case"":case`
105
- `:case`\r
106
- `:return"newline";case"-":return"seq-item-ind";case"?":return"explicit-key-ind";case":":return"map-value-ind";case"{":return"flow-map-start";case"}":return"flow-map-end";case"[":return"flow-seq-start";case"]":return"flow-seq-end";case",":return"comma"}switch(s[0]){case" ":case" ":return"space";case"#":return"comment";case"%":return"directive-line";case"*":return"alias";case"&":return"anchor";case"!":return"tag";case"'":return"single-quoted-scalar";case'"':return"double-quoted-scalar";case"|":case">":return"block-scalar-header"}return null}function Q(s){switch(s){case void 0:case" ":case`
107
- `:case"\r":case" ":return!0;default:return!1}}const es=new Set("0123456789ABCDEFabcdef"),wi=new Set("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-#;/?:@&=+$_.!~*'()"),qe=new Set(",[]{}"),ki=new Set(` ,[]{}
108
- \r `),ht=s=>!s||ki.has(s);class Si{constructor(){this.atEnd=!1,this.blockScalarIndent=-1,this.blockScalarKeep=!1,this.buffer="",this.flowKey=!1,this.flowLevel=0,this.indentNext=0,this.indentValue=0,this.lineEndPos=null,this.next=null,this.pos=0}*lex(e,t=!1){if(e){if(typeof e!="string")throw TypeError("source is not a string");this.buffer=this.buffer?this.buffer+e:e,this.lineEndPos=null}this.atEnd=!t;let n=this.next??"stream";for(;n&&(t||this.hasChars(1));)n=yield*this.parseNext(n)}atLineEnd(){let e=this.pos,t=this.buffer[e];for(;t===" "||t===" ";)t=this.buffer[++e];return!t||t==="#"||t===`
109
- `?!0:t==="\r"?this.buffer[e+1]===`
110
- `:!1}charAt(e){return this.buffer[this.pos+e]}continueScalar(e){let t=this.buffer[e];if(this.indentNext>0){let n=0;for(;t===" ";)t=this.buffer[++n+e];if(t==="\r"){const i=this.buffer[n+e+1];if(i===`
111
- `||!i&&!this.atEnd)return e+n+1}return t===`
112
- `||n>=this.indentNext||!t&&!this.atEnd?e+n:-1}if(t==="-"||t==="."){const n=this.buffer.substr(e,3);if((n==="---"||n==="...")&&Q(this.buffer[e+3]))return-1}return e}getLine(){let e=this.lineEndPos;return(typeof e!="number"||e!==-1&&e<this.pos)&&(e=this.buffer.indexOf(`
113
- `,this.pos),this.lineEndPos=e),e===-1?this.atEnd?this.buffer.substring(this.pos):null:(this.buffer[e-1]==="\r"&&(e-=1),this.buffer.substring(this.pos,e))}hasChars(e){return this.pos+e<=this.buffer.length}setNext(e){return this.buffer=this.buffer.substring(this.pos),this.pos=0,this.lineEndPos=null,this.next=e,null}peek(e){return this.buffer.substr(this.pos,e)}*parseNext(e){switch(e){case"stream":return yield*this.parseStream();case"line-start":return yield*this.parseLineStart();case"block-start":return yield*this.parseBlockStart();case"doc":return yield*this.parseDocument();case"flow":return yield*this.parseFlowCollection();case"quoted-scalar":return yield*this.parseQuotedScalar();case"block-scalar":return yield*this.parseBlockScalar();case"plain-scalar":return yield*this.parsePlainScalar()}}*parseStream(){let e=this.getLine();if(e===null)return this.setNext("stream");if(e[0]===Hs&&(yield*this.pushCount(1),e=e.substring(1)),e[0]==="%"){let t=e.length,n=e.indexOf("#");for(;n!==-1;){const r=e[n-1];if(r===" "||r===" "){t=n-1;break}else n=e.indexOf("#",n+1)}for(;;){const r=e[t-1];if(r===" "||r===" ")t-=1;else break}const i=(yield*this.pushCount(t))+(yield*this.pushSpaces(!0));return yield*this.pushCount(e.length-i),this.pushNewline(),"stream"}if(this.atLineEnd()){const t=yield*this.pushSpaces(!0);return yield*this.pushCount(e.length-t),yield*this.pushNewline(),"stream"}return yield Qs,yield*this.parseLineStart()}*parseLineStart(){const e=this.charAt(0);if(!e&&!this.atEnd)return this.setNext("line-start");if(e==="-"||e==="."){if(!this.atEnd&&!this.hasChars(4))return this.setNext("line-start");const t=this.peek(3);if((t==="---"||t==="...")&&Q(this.charAt(3)))return yield*this.pushCount(3),this.indentValue=0,this.indentNext=0,t==="---"?"doc":"stream"}return this.indentValue=yield*this.pushSpaces(!1),this.indentNext>this.indentValue&&!Q(this.charAt(1))&&(this.indentNext=this.indentValue),yield*this.parseBlockStart()}*parseBlockStart(){const[e,t]=this.peek(2);if(!t&&!this.atEnd)return this.setNext("block-start");if((e==="-"||e==="?"||e===":")&&Q(t)){const n=(yield*this.pushCount(1))+(yield*this.pushSpaces(!0));return this.indentNext=this.indentValue+1,this.indentValue+=n,"block-start"}return"doc"}*parseDocument(){yield*this.pushSpaces(!0);const e=this.getLine();if(e===null)return this.setNext("doc");let t=yield*this.pushIndicators();switch(e[t]){case"#":yield*this.pushCount(e.length-t);case void 0:return yield*this.pushNewline(),yield*this.parseLineStart();case"{":case"[":return yield*this.pushCount(1),this.flowKey=!1,this.flowLevel=1,"flow";case"}":case"]":return yield*this.pushCount(1),"doc";case"*":return yield*this.pushUntil(ht),"doc";case'"':case"'":return yield*this.parseQuotedScalar();case"|":case">":return t+=yield*this.parseBlockScalarHeader(),t+=yield*this.pushSpaces(!0),yield*this.pushCount(e.length-t),yield*this.pushNewline(),yield*this.parseBlockScalar();default:return yield*this.parsePlainScalar()}}*parseFlowCollection(){let e,t,n=-1;do e=yield*this.pushNewline(),e>0?(t=yield*this.pushSpaces(!1),this.indentValue=n=t):t=0,t+=yield*this.pushSpaces(!0);while(e+t>0);const i=this.getLine();if(i===null)return this.setNext("flow");if((n!==-1&&n<this.indentNext&&i[0]!=="#"||n===0&&(i.startsWith("---")||i.startsWith("..."))&&Q(i[3]))&&!(n===this.indentNext-1&&this.flowLevel===1&&(i[0]==="]"||i[0]==="}")))return this.flowLevel=0,yield Ws,yield*this.parseLineStart();let r=0;for(;i[r]===",";)r+=yield*this.pushCount(1),r+=yield*this.pushSpaces(!0),this.flowKey=!1;switch(r+=yield*this.pushIndicators(),i[r]){case void 0:return"flow";case"#":return yield*this.pushCount(i.length-r),"flow";case"{":case"[":return yield*this.pushCount(1),this.flowKey=!1,this.flowLevel+=1,"flow";case"}":case"]":return yield*this.pushCount(1),this.flowKey=!0,this.flowLevel-=1,this.flowLevel?"flow":"doc";case"*":return yield*this.pushUntil(ht),"flow";case'"':case"'":return this.flowKey=!0,yield*this.parseQuotedScalar();case":":{const o=this.charAt(1);if(this.flowKey||Q(o)||o===",")return this.flowKey=!1,yield*this.pushCount(1),yield*this.pushSpaces(!0),"flow"}default:return this.flowKey=!1,yield*this.parsePlainScalar()}}*parseQuotedScalar(){const e=this.charAt(0);let t=this.buffer.indexOf(e,this.pos+1);if(e==="'")for(;t!==-1&&this.buffer[t+1]==="'";)t=this.buffer.indexOf("'",t+2);else for(;t!==-1;){let r=0;for(;this.buffer[t-1-r]==="\\";)r+=1;if(r%2===0)break;t=this.buffer.indexOf('"',t+1)}const n=this.buffer.substring(0,t);let i=n.indexOf(`
114
- `,this.pos);if(i!==-1){for(;i!==-1;){const r=this.continueScalar(i+1);if(r===-1)break;i=n.indexOf(`
115
- `,r)}i!==-1&&(t=i-(n[i-1]==="\r"?2:1))}if(t===-1){if(!this.atEnd)return this.setNext("quoted-scalar");t=this.buffer.length}return yield*this.pushToIndex(t+1,!1),this.flowLevel?"flow":"doc"}*parseBlockScalarHeader(){this.blockScalarIndent=-1,this.blockScalarKeep=!1;let e=this.pos;for(;;){const t=this.buffer[++e];if(t==="+")this.blockScalarKeep=!0;else if(t>"0"&&t<="9")this.blockScalarIndent=Number(t)-1;else if(t!=="-")break}return yield*this.pushUntil(t=>Q(t)||t==="#")}*parseBlockScalar(){let e=this.pos-1,t=0,n;e:for(let r=this.pos;n=this.buffer[r];++r)switch(n){case" ":t+=1;break;case`
116
- `:e=r,t=0;break;case"\r":{const o=this.buffer[r+1];if(!o&&!this.atEnd)return this.setNext("block-scalar");if(o===`
117
- `)break}default:break e}if(!n&&!this.atEnd)return this.setNext("block-scalar");if(t>=this.indentNext){this.blockScalarIndent===-1?this.indentNext=t:this.indentNext=this.blockScalarIndent+(this.indentNext===0?1:this.indentNext);do{const r=this.continueScalar(e+1);if(r===-1)break;e=this.buffer.indexOf(`
118
- `,r)}while(e!==-1);if(e===-1){if(!this.atEnd)return this.setNext("block-scalar");e=this.buffer.length}}let i=e+1;for(n=this.buffer[i];n===" ";)n=this.buffer[++i];if(n===" "){for(;n===" "||n===" "||n==="\r"||n===`
119
- `;)n=this.buffer[++i];e=i-1}else if(!this.blockScalarKeep)do{let r=e-1,o=this.buffer[r];o==="\r"&&(o=this.buffer[--r]);const a=r;for(;o===" ";)o=this.buffer[--r];if(o===`
120
- `&&r>=this.pos&&r+1+t>a)e=r;else break}while(!0);return yield Et,yield*this.pushToIndex(e+1,!0),yield*this.parseLineStart()}*parsePlainScalar(){const e=this.flowLevel>0;let t=this.pos-1,n=this.pos-1,i;for(;i=this.buffer[++n];)if(i===":"){const r=this.buffer[n+1];if(Q(r)||e&&qe.has(r))break;t=n}else if(Q(i)){let r=this.buffer[n+1];if(i==="\r"&&(r===`
121
- `?(n+=1,i=`
122
- `,r=this.buffer[n+1]):t=n),r==="#"||e&&qe.has(r))break;if(i===`
123
- `){const o=this.continueScalar(n+1);if(o===-1)break;n=Math.max(n,o-2)}}else{if(e&&qe.has(i))break;t=n}return!i&&!this.atEnd?this.setNext("plain-scalar"):(yield Et,yield*this.pushToIndex(t+1,!0),e?"flow":"doc")}*pushCount(e){return e>0?(yield this.buffer.substr(this.pos,e),this.pos+=e,e):0}*pushToIndex(e,t){const n=this.buffer.slice(this.pos,e);return n?(yield n,this.pos+=n.length,n.length):(t&&(yield""),0)}*pushIndicators(){let e=0;e:for(;;){switch(this.charAt(0)){case"!":e+=yield*this.pushTag(),e+=yield*this.pushSpaces(!0);continue e;case"&":e+=yield*this.pushUntil(ht),e+=yield*this.pushSpaces(!0);continue e;case"-":case"?":case":":{const t=this.flowLevel>0,n=this.charAt(1);if(Q(n)||t&&qe.has(n)){t?this.flowKey&&(this.flowKey=!1):this.indentNext=this.indentValue+1,e+=yield*this.pushCount(1),e+=yield*this.pushSpaces(!0);continue e}}}break e}return e}*pushTag(){if(this.charAt(1)==="<"){let e=this.pos+2,t=this.buffer[e];for(;!Q(t)&&t!==">";)t=this.buffer[++e];return yield*this.pushToIndex(t===">"?e+1:e,!1)}else{let e=this.pos+1,t=this.buffer[e];for(;t;)if(wi.has(t))t=this.buffer[++e];else if(t==="%"&&es.has(this.buffer[e+1])&&es.has(this.buffer[e+2]))t=this.buffer[e+=3];else break;return yield*this.pushToIndex(e,!1)}}*pushNewline(){const e=this.buffer[this.pos];return e===`
124
- `?yield*this.pushCount(1):e==="\r"&&this.charAt(1)===`
125
- `?yield*this.pushCount(2):0}*pushSpaces(e){let t=this.pos-1,n;do n=this.buffer[++t];while(n===" "||e&&n===" ");const i=t-this.pos;return i>0&&(yield this.buffer.substr(this.pos,i),this.pos=t),i}*pushUntil(e){let t=this.pos,n=this.buffer[t];for(;!e(n);)n=this.buffer[++t];return yield*this.pushToIndex(t,!1)}}class Ni{constructor(){this.lineStarts=[],this.addNewLine=e=>this.lineStarts.push(e),this.linePos=e=>{let t=0,n=this.lineStarts.length;for(;t<n;){const r=t+n>>1;this.lineStarts[r]<e?t=r+1:n=r}if(this.lineStarts[t]===e)return{line:t+1,col:1};if(t===0)return{line:0,col:e};const i=this.lineStarts[t-1];return{line:t,col:e-i+1}}}}function te(s,e){for(let t=0;t<s.length;++t)if(s[t].type===e)return!0;return!1}function ts(s){for(let e=0;e<s.length;++e)switch(s[e].type){case"space":case"comment":case"newline":break;default:return e}return-1}function zs(s){switch(s==null?void 0:s.type){case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":case"flow-collection":return!0;default:return!1}}function Ue(s){switch(s.type){case"document":return s.start;case"block-map":{const e=s.items[s.items.length-1];return e.sep??e.start}case"block-seq":return s.items[s.items.length-1].start;default:return[]}}function he(s){var t;if(s.length===0)return[];let e=s.length;e:for(;--e>=0;)switch(s[e].type){case"doc-start":case"explicit-key-ind":case"map-value-ind":case"seq-item-ind":case"newline":break e}for(;((t=s[++e])==null?void 0:t.type)==="space";);return s.splice(e,s.length)}function Xe(s,e){if(e.length<1e5)Array.prototype.push.apply(s,e);else for(let t=0;t<e.length;++t)s.push(e[t])}function ss(s){if(s.start.type==="flow-seq-start")for(const e of s.items)e.sep&&!e.value&&!te(e.start,"explicit-key-ind")&&!te(e.sep,"map-value-ind")&&(e.key&&(e.value=e.key),delete e.key,zs(e.value)?e.value.end?Xe(e.value.end,e.sep):e.value.end=e.sep:Xe(e.start,e.sep),delete e.sep)}class Ei{constructor(e){this.atNewLine=!0,this.atScalar=!1,this.indent=0,this.offset=0,this.onKeyLine=!1,this.stack=[],this.source="",this.type="",this.lexer=new Si,this.onNewLine=e}*parse(e,t=!1){this.onNewLine&&this.offset===0&&this.onNewLine(0);for(const n of this.lexer.lex(e,t))yield*this.next(n);t||(yield*this.end())}*next(e){if(this.source=e,this.atScalar){this.atScalar=!1,yield*this.step(),this.offset+=e.length;return}const t=bi(e);if(t)if(t==="scalar")this.atNewLine=!1,this.atScalar=!0,this.type="scalar";else{switch(this.type=t,yield*this.step(),t){case"newline":this.atNewLine=!0,this.indent=0,this.onNewLine&&this.onNewLine(this.offset+e.length);break;case"space":this.atNewLine&&e[0]===" "&&(this.indent+=e.length);break;case"explicit-key-ind":case"map-value-ind":case"seq-item-ind":this.atNewLine&&(this.indent+=e.length);break;case"doc-mode":case"flow-error-end":return;default:this.atNewLine=!1}this.offset+=e.length}else{const n=`Not a YAML token: ${e}`;yield*this.pop({type:"error",offset:this.offset,message:n,source:e}),this.offset+=e.length}}*end(){for(;this.stack.length>0;)yield*this.pop()}get sourceToken(){return{type:this.type,offset:this.offset,indent:this.indent,source:this.source}}*step(){const e=this.peek(1);if(this.type==="doc-end"&&(e==null?void 0:e.type)!=="doc-end"){for(;this.stack.length>0;)yield*this.pop();this.stack.push({type:"doc-end",offset:this.offset,source:this.source});return}if(!e)return yield*this.stream();switch(e.type){case"document":return yield*this.document(e);case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return yield*this.scalar(e);case"block-scalar":return yield*this.blockScalar(e);case"block-map":return yield*this.blockMap(e);case"block-seq":return yield*this.blockSequence(e);case"flow-collection":return yield*this.flowCollection(e);case"doc-end":return yield*this.documentEnd(e)}yield*this.pop()}peek(e){return this.stack[this.stack.length-e]}*pop(e){const t=e??this.stack.pop();if(!t)yield{type:"error",offset:this.offset,source:"",message:"Tried to pop an empty stack"};else if(this.stack.length===0)yield t;else{const n=this.peek(1);switch(t.type==="block-scalar"?t.indent="indent"in n?n.indent:0:t.type==="flow-collection"&&n.type==="document"&&(t.indent=0),t.type==="flow-collection"&&ss(t),n.type){case"document":n.value=t;break;case"block-scalar":n.props.push(t);break;case"block-map":{const i=n.items[n.items.length-1];if(i.value){n.items.push({start:[],key:t,sep:[]}),this.onKeyLine=!0;return}else if(i.sep)i.value=t;else{Object.assign(i,{key:t,sep:[]}),this.onKeyLine=!i.explicitKey;return}break}case"block-seq":{const i=n.items[n.items.length-1];i.value?n.items.push({start:[],value:t}):i.value=t;break}case"flow-collection":{const i=n.items[n.items.length-1];!i||i.value?n.items.push({start:[],key:t,sep:[]}):i.sep?i.value=t:Object.assign(i,{key:t,sep:[]});return}default:yield*this.pop(),yield*this.pop(t)}if((n.type==="document"||n.type==="block-map"||n.type==="block-seq")&&(t.type==="block-map"||t.type==="block-seq")){const i=t.items[t.items.length-1];i&&!i.sep&&!i.value&&i.start.length>0&&ts(i.start)===-1&&(t.indent===0||i.start.every(r=>r.type!=="comment"||r.indent<t.indent))&&(n.type==="document"?n.end=i.start:n.items.push({start:i.start}),t.items.splice(-1,1))}}}*stream(){switch(this.type){case"directive-line":yield{type:"directive",offset:this.offset,source:this.source};return;case"byte-order-mark":case"space":case"comment":case"newline":yield this.sourceToken;return;case"doc-mode":case"doc-start":{const e={type:"document",offset:this.offset,start:[]};this.type==="doc-start"&&e.start.push(this.sourceToken),this.stack.push(e);return}}yield{type:"error",offset:this.offset,message:`Unexpected ${this.type} token in YAML stream`,source:this.source}}*document(e){if(e.value)return yield*this.lineEnd(e);switch(this.type){case"doc-start":{ts(e.start)!==-1?(yield*this.pop(),yield*this.step()):e.start.push(this.sourceToken);return}case"anchor":case"tag":case"space":case"comment":case"newline":e.start.push(this.sourceToken);return}const t=this.startBlockValue(e);t?this.stack.push(t):yield{type:"error",offset:this.offset,message:`Unexpected ${this.type} token in YAML document`,source:this.source}}*scalar(e){if(this.type==="map-value-ind"){const t=Ue(this.peek(2)),n=he(t);let i;e.end?(i=e.end,i.push(this.sourceToken),delete e.end):i=[this.sourceToken];const r={type:"block-map",offset:e.offset,indent:e.indent,items:[{start:n,key:e,sep:i}]};this.onKeyLine=!0,this.stack[this.stack.length-1]=r}else yield*this.lineEnd(e)}*blockScalar(e){switch(this.type){case"space":case"comment":case"newline":e.props.push(this.sourceToken);return;case"scalar":if(e.source=this.source,this.atNewLine=!0,this.indent=0,this.onNewLine){let t=this.source.indexOf(`
126
- `)+1;for(;t!==0;)this.onNewLine(this.offset+t),t=this.source.indexOf(`
127
- `,t)+1}yield*this.pop();break;default:yield*this.pop(),yield*this.step()}}*blockMap(e){var n;const t=e.items[e.items.length-1];switch(this.type){case"newline":if(this.onKeyLine=!1,t.value){const i="end"in t.value?t.value.end:void 0,r=Array.isArray(i)?i[i.length-1]:void 0;(r==null?void 0:r.type)==="comment"?i==null||i.push(this.sourceToken):e.items.push({start:[this.sourceToken]})}else t.sep?t.sep.push(this.sourceToken):t.start.push(this.sourceToken);return;case"space":case"comment":if(t.value)e.items.push({start:[this.sourceToken]});else if(t.sep)t.sep.push(this.sourceToken);else{if(this.atIndentedComment(t.start,e.indent)){const i=e.items[e.items.length-2],r=(n=i==null?void 0:i.value)==null?void 0:n.end;if(Array.isArray(r)){Xe(r,t.start),r.push(this.sourceToken),e.items.pop();return}}t.start.push(this.sourceToken)}return}if(this.indent>=e.indent){const i=!this.onKeyLine&&this.indent===e.indent,r=i&&(t.sep||t.explicitKey)&&this.type!=="seq-item-ind";let o=[];if(r&&t.sep&&!t.value){const a=[];for(let l=0;l<t.sep.length;++l){const c=t.sep[l];switch(c.type){case"newline":a.push(l);break;case"space":break;case"comment":c.indent>e.indent&&(a.length=0);break;default:a.length=0}}a.length>=2&&(o=t.sep.splice(a[1]))}switch(this.type){case"anchor":case"tag":r||t.value?(o.push(this.sourceToken),e.items.push({start:o}),this.onKeyLine=!0):t.sep?t.sep.push(this.sourceToken):t.start.push(this.sourceToken);return;case"explicit-key-ind":!t.sep&&!t.explicitKey?(t.start.push(this.sourceToken),t.explicitKey=!0):r||t.value?(o.push(this.sourceToken),e.items.push({start:o,explicitKey:!0})):this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:[this.sourceToken],explicitKey:!0}]}),this.onKeyLine=!0;return;case"map-value-ind":if(t.explicitKey)if(t.sep)if(t.value)e.items.push({start:[],key:null,sep:[this.sourceToken]});else if(te(t.sep,"map-value-ind"))this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:o,key:null,sep:[this.sourceToken]}]});else if(zs(t.key)&&!te(t.sep,"newline")){const a=he(t.start),l=t.key,c=t.sep;c.push(this.sourceToken),delete t.key,delete t.sep,this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:a,key:l,sep:c}]})}else o.length>0?t.sep=t.sep.concat(o,this.sourceToken):t.sep.push(this.sourceToken);else if(te(t.start,"newline"))Object.assign(t,{key:null,sep:[this.sourceToken]});else{const a=he(t.start);this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:a,key:null,sep:[this.sourceToken]}]})}else t.sep?t.value||r?e.items.push({start:o,key:null,sep:[this.sourceToken]}):te(t.sep,"map-value-ind")?this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:[],key:null,sep:[this.sourceToken]}]}):t.sep.push(this.sourceToken):Object.assign(t,{key:null,sep:[this.sourceToken]});this.onKeyLine=!0;return;case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":{const a=this.flowScalar(this.type);r||t.value?(e.items.push({start:o,key:a,sep:[]}),this.onKeyLine=!0):t.sep?this.stack.push(a):(Object.assign(t,{key:a,sep:[]}),this.onKeyLine=!0);return}default:{const a=this.startBlockValue(e);if(a){if(a.type==="block-seq"){if(!t.explicitKey&&t.sep&&!te(t.sep,"newline")){yield*this.pop({type:"error",offset:this.offset,message:"Unexpected block-seq-ind on same line with key",source:this.source});return}}else i&&e.items.push({start:o});this.stack.push(a);return}}}}yield*this.pop(),yield*this.step()}*blockSequence(e){var n;const t=e.items[e.items.length-1];switch(this.type){case"newline":if(t.value){const i="end"in t.value?t.value.end:void 0,r=Array.isArray(i)?i[i.length-1]:void 0;(r==null?void 0:r.type)==="comment"?i==null||i.push(this.sourceToken):e.items.push({start:[this.sourceToken]})}else t.start.push(this.sourceToken);return;case"space":case"comment":if(t.value)e.items.push({start:[this.sourceToken]});else{if(this.atIndentedComment(t.start,e.indent)){const i=e.items[e.items.length-2],r=(n=i==null?void 0:i.value)==null?void 0:n.end;if(Array.isArray(r)){Xe(r,t.start),r.push(this.sourceToken),e.items.pop();return}}t.start.push(this.sourceToken)}return;case"anchor":case"tag":if(t.value||this.indent<=e.indent)break;t.start.push(this.sourceToken);return;case"seq-item-ind":if(this.indent!==e.indent)break;t.value||te(t.start,"seq-item-ind")?e.items.push({start:[this.sourceToken]}):t.start.push(this.sourceToken);return}if(this.indent>e.indent){const i=this.startBlockValue(e);if(i){this.stack.push(i);return}}yield*this.pop(),yield*this.step()}*flowCollection(e){const t=e.items[e.items.length-1];if(this.type==="flow-error-end"){let n;do yield*this.pop(),n=this.peek(1);while((n==null?void 0:n.type)==="flow-collection")}else if(e.end.length===0){switch(this.type){case"comma":case"explicit-key-ind":!t||t.sep?e.items.push({start:[this.sourceToken]}):t.start.push(this.sourceToken);return;case"map-value-ind":!t||t.value?e.items.push({start:[],key:null,sep:[this.sourceToken]}):t.sep?t.sep.push(this.sourceToken):Object.assign(t,{key:null,sep:[this.sourceToken]});return;case"space":case"comment":case"newline":case"anchor":case"tag":!t||t.value?e.items.push({start:[this.sourceToken]}):t.sep?t.sep.push(this.sourceToken):t.start.push(this.sourceToken);return;case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":{const i=this.flowScalar(this.type);!t||t.value?e.items.push({start:[],key:i,sep:[]}):t.sep?this.stack.push(i):Object.assign(t,{key:i,sep:[]});return}case"flow-map-end":case"flow-seq-end":e.end.push(this.sourceToken);return}const n=this.startBlockValue(e);n?this.stack.push(n):(yield*this.pop(),yield*this.step())}else{const n=this.peek(2);if(n.type==="block-map"&&(this.type==="map-value-ind"&&n.indent===e.indent||this.type==="newline"&&!n.items[n.items.length-1].sep))yield*this.pop(),yield*this.step();else if(this.type==="map-value-ind"&&n.type!=="flow-collection"){const i=Ue(n),r=he(i);ss(e);const o=e.end.splice(1,e.end.length);o.push(this.sourceToken);const a={type:"block-map",offset:e.offset,indent:e.indent,items:[{start:r,key:e,sep:o}]};this.onKeyLine=!0,this.stack[this.stack.length-1]=a}else yield*this.lineEnd(e)}}flowScalar(e){if(this.onNewLine){let t=this.source.indexOf(`
128
- `)+1;for(;t!==0;)this.onNewLine(this.offset+t),t=this.source.indexOf(`
129
- `,t)+1}return{type:e,offset:this.offset,indent:this.indent,source:this.source}}startBlockValue(e){switch(this.type){case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return this.flowScalar(this.type);case"block-scalar-header":return{type:"block-scalar",offset:this.offset,indent:this.indent,props:[this.sourceToken],source:""};case"flow-map-start":case"flow-seq-start":return{type:"flow-collection",offset:this.offset,indent:this.indent,start:this.sourceToken,items:[],end:[]};case"seq-item-ind":return{type:"block-seq",offset:this.offset,indent:this.indent,items:[{start:[this.sourceToken]}]};case"explicit-key-ind":{this.onKeyLine=!0;const t=Ue(e),n=he(t);return n.push(this.sourceToken),{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:n,explicitKey:!0}]}}case"map-value-ind":{this.onKeyLine=!0;const t=Ue(e),n=he(t);return{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:n,key:null,sep:[this.sourceToken]}]}}}return null}atIndentedComment(e,t){return this.type!=="comment"||this.indent<=t?!1:e.every(n=>n.type==="newline"||n.type==="space")}*documentEnd(e){this.type!=="doc-mode"&&(e.end?e.end.push(this.sourceToken):e.end=[this.sourceToken],this.type==="newline"&&(yield*this.pop()))}*lineEnd(e){switch(this.type){case"comma":case"doc-start":case"doc-end":case"flow-seq-end":case"flow-map-end":case"map-value-ind":yield*this.pop(),yield*this.step();break;case"newline":this.onKeyLine=!1;case"space":case"comment":default:e.end?e.end.push(this.sourceToken):e.end=[this.sourceToken],this.type==="newline"&&(yield*this.pop())}}}function Ai(s){const e=s.prettyErrors!==!1;return{lineCounter:s.lineCounter||e&&new Ni||null,prettyErrors:e}}function vi(s,e={}){const{lineCounter:t,prettyErrors:n}=Ai(e),i=new Ei(t==null?void 0:t.addNewLine),r=new yi(e);let o=null;for(const a of r.compose(i.parse(s),!0,s.length))if(!o)o=a;else if(o.options.logLevel!=="silent"){o.errors.push(new Ie(a.range.slice(0,2),"MULTIPLE_DOCS","Source contains multiple documents; please use YAML.parseAllDocuments()"));break}return n&&t&&(o.errors.forEach(zt(s,t)),o.warnings.forEach(zt(s,t))),o}function Oi(s,e,t){let n;const i=vi(s,t);if(!i)return null;if(i.warnings.forEach(r=>Es(i.options.logLevel,r)),i.errors.length>0){if(i.options.logLevel!=="silent")throw i.errors[0];i.errors=[]}return i.toJS(Object.assign({reviver:n},t))}function Ti(s,e,t){let n=null;if(typeof e=="function"||Array.isArray(e)?n=e:t===void 0&&e&&(t=e),typeof t=="string"&&(t=t.length),typeof t=="number"){const i=Math.round(t);t=i<1?void 0:i>8?{indent:8}:{indent:i}}if(s===void 0){const{keepUndefined:i}=t??e??{};if(!i)return}return $e(s)&&!n?s.toString(t):new Pe(s,n,t).toString(t)}var Ii="default";function Rt(s){return s.trim()===Ii}function Li(s){return Rt(s.name)}function ji(s){const e=(s==null?void 0:s.cpu)??1,t=(s==null?void 0:s.memory)??1,n=(s==null?void 0:s.disk)??3;return`${String(e)} vCPU · ${String(t)} GB RAM · ${String(n)} GB disk`}function xi(s){var n;if((s==null?void 0:s.networkBlockAll)===!0)return"Blocked";const e=((n=s==null?void 0:s.domainAllowList)==null?void 0:n.trim())??"";if(e.length===0)return"Unrestricted";const t=e.split(",").map(i=>i.trim()).filter(i=>i.length>0).length;return t===0?"Unrestricted":`${String(t)} allowed domain${t===1?"":"s"}`}function dt(){return{name:"",description:"",image:{type:"build",buildScript:""},resources:{cpu:1,memory:1,disk:3},networking:{networkBlockAll:!1}}}function mt(s){var e,t,n,i,r,o,a,l;return{name:s.name,description:s.description??"",buildScript:((e=s.image)==null?void 0:e.buildScript)??"",cpu:String(((t=s.resources)==null?void 0:t.cpu)??1),memory:String(((n=s.resources)==null?void 0:n.memory)??1),disk:String(((i=s.resources)==null?void 0:i.disk)??3),networkBlockAll:((r=s.networking)==null?void 0:r.networkBlockAll)===!0,domainAllowList:((o=s.networking)==null?void 0:o.domainAllowList)??"",secrets:((l=(a=s.networking)==null?void 0:a.secrets)==null?void 0:l.map(c=>({...c,hosts:[...c.hosts]})))??[],environmentVariables:Object.entries(s.environmentVariables??{}).map(([c,m])=>({key:c,value:m}))}}function ns(s){const e=Number(s.cpu),t=Number(s.memory),n=Number(s.disk),i=Object.fromEntries(s.environmentVariables.map(o=>[o.key.trim(),o.value]).filter(([o,a])=>o.length>0&&a.length>0)),r=s.networkBlockAll?void 0:s.secrets.map(o=>({env:o.env.trim(),value:o.value,hosts:o.hosts.map(a=>a.trim()).filter(a=>a.length>0)})).filter(o=>o.env.length>0&&o.value.length>0);return{name:s.name.trim(),...s.description.trim().length===0?{}:{description:s.description.trim()},...s.buildScript.trim().length===0?{}:{image:{type:"build",buildScript:s.buildScript}},resources:{cpu:Number.isFinite(e)&&e>0?e:1,memory:Number.isFinite(t)&&t>0?t:1,disk:Number.isFinite(n)&&n>0?n:3},...Object.keys(i).length===0?{}:{environmentVariables:i},networking:s.networkBlockAll?{networkBlockAll:!0}:{networkBlockAll:!1,...s.domainAllowList.trim().length===0?{}:{domainAllowList:s.domainAllowList.trim()},...r==null||r.length===0?{}:{secrets:r}}}}function Ci(s){const e=s.name.trim();if(e.length===0)return"Name is required";if(Rt(e))return'Name "default" is reserved';const t=Number(s.cpu),n=Number(s.memory),i=Number(s.disk);if(!Number.isFinite(t)||t<=0)return"CPU must be a positive number";if(!Number.isFinite(n)||n<=0)return"Memory must be a positive number";if(!Number.isFinite(i)||i<=0)return"Disk must be a positive number";if(!s.networkBlockAll){for(const r of s.secrets)if(r.env.trim().length!==0&&r.value.trim().length===0)return"Secret value is required"}return null}var Y="w-full rounded-md border border-border bg-input-box-bg px-2.5 py-1.5 text-sm text-text-primary placeholder:text-text-secondary/70 outline-none focus:border-primary-button-bg",is="text-sm font-medium text-text-primary",Ve="rounded-lg border border-border p-4 flex flex-col gap-4";function $i({values:s,onChange:e,nameDisabled:t}){const n=i=>e({...s,...i});return d.jsxs("div",{className:"flex flex-col gap-4 pb-8",children:[d.jsxs("label",{className:"flex flex-col gap-1.5",children:[d.jsx("span",{className:is,children:"Name"}),d.jsx("input",{className:ge(Y,t&&"opacity-70"),value:s.name,disabled:t,placeholder:"my-environment",onChange:i=>n({name:i.target.value})})]}),d.jsxs("label",{className:"flex flex-col gap-1.5",children:[d.jsx("span",{className:is,children:"Description"}),d.jsx("textarea",{className:ge(Y,"min-h-20 resize-y"),value:s.description,placeholder:"write description ...",onChange:i=>n({description:i.target.value})})]}),d.jsxs("div",{className:Ve,children:[d.jsx("h3",{className:"text-sm font-medium text-text-primary",children:"Image And Resources"}),d.jsxs("label",{className:"flex flex-col gap-1.5",children:[d.jsxs("span",{className:"text-xs font-medium text-text-secondary",children:["Build Script (",s.buildScript.length,"/5120)"]}),d.jsx("textarea",{className:ge(Y,"min-h-24 resize-y font-mono text-xs"),value:s.buildScript,placeholder:`set -ex
130
- pip install httpx
131
- `,onChange:i=>n({buildScript:i.target.value})})]}),d.jsxs("div",{className:"grid grid-cols-3 gap-3",children:[d.jsxs("label",{className:"flex flex-col gap-1",children:[d.jsx("span",{className:"text-xs font-medium text-text-secondary",children:"CPU"}),d.jsx("input",{className:Y,type:"number",min:.1,step:"any",value:s.cpu,placeholder:"type...",onChange:i=>n({cpu:i.target.value})})]}),d.jsxs("label",{className:"flex flex-col gap-1",children:[d.jsx("span",{className:"text-xs font-medium text-text-secondary",children:"Memory (GB)"}),d.jsx("input",{className:Y,type:"number",min:.1,step:"any",value:s.memory,placeholder:"type...",onChange:i=>n({memory:i.target.value})})]}),d.jsxs("label",{className:"flex flex-col gap-1",children:[d.jsx("span",{className:"text-xs font-medium text-text-secondary",children:"Disk (GB)"}),d.jsx("input",{className:Y,type:"number",min:.1,step:"any",value:s.disk,placeholder:"type...",onChange:i=>n({disk:i.target.value})})]})]})]}),d.jsxs("div",{className:Ve,children:[d.jsxs("div",{className:"flex items-center justify-between",children:[d.jsx("h3",{className:"text-sm font-medium text-text-primary",children:"Environment Variables"}),d.jsx("button",{type:"button",className:"cursor-pointer text-xs font-medium text-text-secondary transition-colors hover:text-text-primary",onClick:()=>n({environmentVariables:[...s.environmentVariables,{key:"",value:""}]}),children:"+ Add Variables"})]}),s.environmentVariables.map((i,r)=>d.jsxs("div",{className:"flex items-center gap-2",children:[d.jsxs("div",{className:"flex min-w-0 flex-1 items-center gap-2",children:[d.jsx("input",{className:Y,value:i.key,placeholder:"KEY",onChange:o=>{const a=s.environmentVariables.map((l,c)=>c===r?{...l,key:o.target.value}:l);n({environmentVariables:a})}}),d.jsx("input",{className:Y,value:i.value,placeholder:"value",onChange:o=>{const a=s.environmentVariables.map((l,c)=>c===r?{...l,value:o.target.value}:l);n({environmentVariables:a})}})]}),d.jsx("button",{type:"button",className:yt({variant:"ghost",size:"icon"}),"aria-label":"Remove environment variable",onClick:()=>n({environmentVariables:s.environmentVariables.filter((o,a)=>a!==r)}),children:d.jsx(Qe,{name:"trash",className:"size-3.5 text-failure-bg"})})]},r))]}),d.jsxs("div",{className:Ve,children:[d.jsxs("div",{className:"flex items-center justify-between gap-4",children:[d.jsxs("div",{className:"flex flex-col",children:[d.jsx("span",{className:"text-sm font-medium text-text-primary",children:"Block All Network"}),d.jsx("span",{className:"text-xs text-text-secondary",children:"Overrides the domain allow list"})]}),d.jsx(gn,{checked:s.networkBlockAll,onCheckedChange:i=>n({networkBlockAll:i}),"aria-label":"Block All Network"})]}),s.networkBlockAll?null:d.jsxs("label",{className:"flex flex-col gap-1.5 pt-1",children:[d.jsx("span",{className:"text-xs font-medium text-text-secondary",children:"Domain Allow List"}),d.jsx("input",{className:Y,value:s.domainAllowList,placeholder:"api.github.com,api.openai.com",onChange:i=>n({domainAllowList:i.target.value})})]})]}),s.networkBlockAll?null:d.jsxs("div",{className:Ve,children:[d.jsxs("div",{className:"flex items-center justify-between",children:[d.jsxs("div",{className:"flex flex-col",children:[d.jsx("h3",{className:"text-sm font-medium text-text-primary",children:"Secrets"}),d.jsx("span",{className:"text-xs text-text-secondary",children:"Synced immediately with existing sandboxes"})]}),d.jsx("button",{type:"button",className:"cursor-pointer text-xs font-medium text-text-secondary transition-colors hover:text-text-primary",onClick:()=>n({secrets:[...s.secrets,{env:"",value:"",hosts:[]}]}),children:"+ Add Secret"})]}),s.secrets.map((i,r)=>d.jsxs("div",{className:"flex flex-col gap-2 rounded-md border border-border p-3",children:[d.jsxs("div",{className:"flex items-center gap-2",children:[d.jsxs("div",{className:"flex min-w-0 flex-1 items-center gap-2",children:[d.jsx("input",{className:Y,value:i.env,placeholder:"ENV_NAME",onChange:o=>{const a=s.secrets.map((l,c)=>c===r?{...l,env:o.target.value}:l);n({secrets:a})}}),d.jsx("input",{className:Y,type:"password",value:i.value,placeholder:"value",onChange:o=>{const a=s.secrets.map((l,c)=>c===r?{...l,value:o.target.value}:l);n({secrets:a})}})]}),d.jsx("button",{type:"button",className:yt({variant:"ghost",size:"icon"}),"aria-label":"Remove secret",onClick:()=>n({secrets:s.secrets.filter((o,a)=>a!==r)}),children:d.jsx(Qe,{name:"trash",className:"size-3.5 text-failure-bg"})})]}),d.jsx("input",{className:Y,value:i.hosts.join(","),placeholder:"Allowed hosts (comma-separated)",onChange:o=>{const a=o.target.value.split(",").map(c=>c.trim()),l=s.secrets.map((c,m)=>m===r?{...c,hosts:a}:c);n({secrets:l})}})]},r))]})]})}function pt(s){return Ti(s,{lineWidth:0})}function _i(s){return!(s==null||typeof s!="object"||Array.isArray(s)||!("name"in s)||typeof s.name!="string"||s.name.trim().length===0)}function rs(s){let e;try{e=Oi(s)}catch(t){return{error:At(t,"Invalid YAML")}}return _i(e)?Rt(e.name)?{error:'Name "default" is reserved'}:{manifest:e}:e==null||typeof e!="object"||Array.isArray(e)?{error:"YAML must be an object manifest"}:{error:"Manifest name is required"}}function Bi({open:s,onOpenChange:e,mode:t,environment:n,onSaved:i}){const r=os(),o=as(),[a,l]=L.useState("form"),[c,m]=L.useState(()=>mt(dt())),[f,p]=L.useState(()=>pt(dt())),[h,y]=L.useState(c),[u,g]=L.useState(f),[b,w]=L.useState(null),[E,S]=L.useState(!1),[N,v]=L.useState(null);L.useEffect(()=>{if(!s){l("form"),v(null),w(null),S(!1);return}const j=t==="edit"&&n!=null?n.manifest:dt(),K=mt(j),M=pt(j);m(K),p(M),y(K),g(M),l("form"),v(null),w(null)},[s,t,n]);const A=L.useMemo(()=>JSON.stringify(c)!==JSON.stringify(h),[h,c]),I=a==="form"?A:f!==u,C=j=>{if(j!==a){if(I){w(j);return}R(j)}},R=j=>{if(j==="yaml"){const K=ns(c),M=pt(K);p(M),g(M),y(c)}else{const K=rs(f);if("error"in K){v(K.error),w(null);return}const M=mt(K.manifest);m(M),y(M),g(f)}l(j),w(null),v(null)},D=async j=>{j.preventDefault(),v(null);let K;if(a==="form"){const M=Ci(c);if(M!=null){v(M);return}K=ns(c)}else{const M=rs(f);if("error"in M){v(M.error);return}K=M.manifest}S(!0);try{await r.createOrUpdateEnvironment({manifest:K}),o==null||o.showSuccess({title:t==="create"?"Environment created":"Environment updated"}),i==null||i(),e(!1)}catch(M){v(At(M,"Failed to save environment"))}finally{S(!1)}},P=t==="create"?"New environment":(n==null?void 0:n.name)??"Edit environment";return d.jsxs(d.Fragment,{children:[d.jsx(mn,{open:s,onOpenChange:e,title:P,description:"Configure the environment as a form or edit its manifest directly.",size:"xl",headerActions:d.jsxs("div",{className:"inline-flex shrink-0 rounded-md bg-secondary-bg p-0.5 border border-border",children:[d.jsx("button",{type:"button",className:ge("rounded-sm px-2.5 py-1 text-xs font-medium transition-colors",a==="form"?"bg-primary-bg text-text-primary shadow-xs":"text-text-secondary hover:text-text-primary"),onClick:()=>C("form"),children:"UI Form"}),d.jsx("button",{type:"button",className:ge("rounded-sm px-2.5 py-1 text-xs font-medium transition-colors",a==="yaml"?"bg-primary-bg text-text-primary shadow-xs":"text-text-secondary hover:text-text-primary"),onClick:()=>C("yaml"),children:"YAML"})]}),footer:d.jsxs("div",{className:"flex justify-end gap-2",children:[d.jsx(re.Secondary,{type:"button",disabled:E,onClick:()=>e(!1),children:"Cancel"}),d.jsx(re.Primary,{type:"submit",form:"environment-form",disabled:E,children:E?"Saving…":t==="create"?"Create":"Save"})]}),children:d.jsxs("form",{id:"environment-form",className:ge("flex min-h-0 flex-1 flex-col gap-4 px-5 pt-4",a==="form"?"pb-10":"h-full pb-4"),onSubmit:j=>void D(j),children:[N!=null?d.jsx("p",{className:"text-sm text-failure-bg",children:N}):null,a==="form"?d.jsx($i,{values:c,onChange:m,nameDisabled:t==="edit"}):d.jsx("div",{className:"flex min-h-[30rem] flex-1 flex-col",children:d.jsx(pn,{language:"yaml",value:f,height:"100%",showToolbar:!1,defaultShowLineNumbers:!0,className:"flex-1",onChange:j=>p(j)})})]})}),d.jsx(cs,{open:b!=null,onOpenChange:j=>!j&&w(null),children:d.jsxs(fs,{children:[d.jsx(us,{children:d.jsx(hs,{children:"Warning"})}),d.jsx("p",{className:"text-sm text-text-secondary",children:b==="form"?"The YAML changes will be lost. Are you sure you want to switch to UI form?":"You might lose all your changes from the form. Are you sure you want to switch to YAML Editor?"}),d.jsxs(ds,{children:[d.jsx(re.Secondary,{type:"button",onClick:()=>w(null),children:"Cancel"}),d.jsx(re.Primary,{type:"button",onClick:()=>{b!=null&&R(b)},children:"Yes"})]})]})})]})}var Mi={pending:{label:"Pending",variant:"info"},ready:{label:"Ready",variant:"success"},failed:{label:"Failed",variant:"destructive"}};function Pi({status:s,statusReason:e}){const t=Mi[s],n=d.jsx(tn,{variant:t.variant,shape:"rounded",size:"sm",children:t.label});return s==="failed"&&e!=null&&e.length>0?d.jsx(ls,{content:e,children:n}):n}var Di=[10,25],Ki=1e4;function gt(s){return Math.min(Math.max(s,1),25)}function Ri(){return Ye(window.location.search).isNew?{kind:"create"}:{kind:"closed"}}function Vi(s){const e=os(),t=sn(),n=as(),[i,r]=L.useState([]),[o,a]=L.useState(!0),[l,c]=L.useState(null),[m,f]=L.useState(()=>Ye(window.location.search).q??""),[p,h]=L.useState(()=>Ri()),[y,u]=L.useState(null),[g,b]=L.useState(!1),[w,E]=L.useState(()=>gt(dn)),[S,N]=L.useState(void 0),[v,A]=L.useState(void 0),[k,I]=L.useState(void 0),C=L.useRef(0),R=L.useRef(!1),D=L.useRef((t==null?void 0:t.settingsOpen)??!1),P=(t==null?void 0:t.settingsOpen)??!1,j=L.useCallback(async({token:T,size:F,silent:ee=!1})=>{const ne=++C.current;ee||(a(!0),c(null));try{const V=await e.listEnvironments({limit:gt(F),...T===void 0||T===""?{}:{pageToken:T}});if(ne!==C.current)return;r(V.data),A(V.nextPageToken),I(V.previousPageToken)}catch(V){if(ne!==C.current)return;ee||(c(At(V,"Failed to load environments")),r([]),A(void 0),I(void 0))}finally{ne===C.current&&!ee&&a(!1)}},[e]);L.useEffect(()=>{qt({q:m.trim().length===0?null:m})},[m]),L.useEffect(()=>{j({token:S,size:w})},[j,w,S]),L.useEffect(()=>{D.current&&!P&&j({token:S,size:w}),D.current=P},[P,j,S,w]),L.useEffect(()=>{const T=i.filter(ee=>ee.status==="pending");if(T.length===0)return;const F=window.setInterval(async()=>{try{const ne=(await Promise.all(T.map(V=>e.getEnvironment({name:V.name}).catch(()=>null)))).filter(V=>V!=null);if(ne.length===0)return;r(V=>V.map(Ft=>ne.find(en=>en.name===Ft.name)??Ft)),ne.some(V=>V.status!=="pending")&&(t==null||t.invalidateEnvironmentsList())}catch{}},Ki);return()=>window.clearInterval(F)},[i,e,t]),L.useEffect(()=>{R.current||Ye(window.location.search).isNew&&(R.current=!0,h({kind:"create"}),qt({isNew:null}))},[]),L.useEffect(()=>{const T=()=>{const F=Ye(window.location.search);f(F.q??""),F.isNew&&h({kind:"create"})};return window.addEventListener(Ut,T),()=>window.removeEventListener(Ut,T)},[]);const K=L.useMemo(()=>{const T=m.trim().toLowerCase();return T.length===0?i:i.filter(F=>F.name.toLowerCase().includes(T)||F.description.toLowerCase().includes(T))},[i,m]),M=v!=null||k!=null||i.length>0,Xs=()=>{h({kind:"create"})},Zs=async()=>{if(y!=null){b(!0);try{await e.deleteEnvironment({name:y.name}),n==null||n.showSuccess({title:"Environment deleted"}),u(null),N(void 0),t==null||t.invalidateEnvironmentsList(),j({token:void 0,size:w})}catch(T){n==null||n.showError(T)}finally{b(!1)}}};return d.jsxs("div",{className:"flex h-full min-h-0 flex-col bg-primary-bg",children:[d.jsx(nn,{title:"Environments",end:d.jsxs(d.Fragment,{children:[d.jsx("div",{className:"w-64",children:d.jsx(rn,{query:m,setQuery:f,placeholder:"Search environments by name"})}),d.jsxs(re.Primary,{type:"button",onClick:Xs,children:[d.jsx(Qe,{name:"plus",className:"size-3.5"}),"New Environment"]})]})}),d.jsx("div",{className:"min-h-0 flex-1 overflow-auto px-4 py-4",children:l!=null?d.jsx("p",{className:"text-failure-bg px-3 py-8 text-center text-sm",children:l}):o?d.jsx("div",{className:"flex flex-col gap-2",role:"status","aria-label":"Loading environments",children:Array.from({length:5},(T,F)=>d.jsx(on,{className:"h-12 w-full rounded-md"},F))}):i.length===0?d.jsx(Vt,{title:"No environments yet",description:"Create an environment to customize sandbox images, resources, and networking.",className:"min-h-full"}):K.length===0?d.jsx(Vt,{title:"No environments found",description:d.jsxs(d.Fragment,{children:["No environments match ",d.jsx(an,{children:m.trim()}),"."]}),className:"min-h-full"}):d.jsxs("div",{className:"overflow-hidden rounded-lg border border-border",children:[d.jsxs(ln,{className:"min-w-240",children:[d.jsx(cn,{children:d.jsxs(Yt,{className:"hover:bg-transparent",children:[d.jsx(ce,{className:"w-96 max-w-96",children:"Name"}),d.jsx(ce,{children:"Build Status"}),d.jsx(ce,{children:"Resources"}),d.jsx(ce,{children:"Networking"}),d.jsx(ce,{children:"Updated"}),d.jsx(ce,{className:"w-16"})]})}),d.jsx(fn,{children:K.map(T=>{const F=Li(T);return d.jsxs(Yt,{className:F?void 0:"cursor-pointer",onClick:()=>{F||h({kind:"edit",environment:T})},children:[d.jsx(fe,{className:"w-96 max-w-96",children:d.jsxs("div",{className:"flex flex-col gap-0.5",children:[d.jsx("span",{className:"truncate font-medium text-text-primary",children:T.name}),T.description.length>0?d.jsx(ls,{content:T.description,className:"max-w-sm whitespace-normal text-left",triggerClassName:"block min-w-0 w-full max-w-full",children:d.jsx("span",{className:"block truncate text-xs text-text-secondary",children:T.description})}):null]})}),d.jsx(fe,{children:d.jsx(Pi,{status:T.status,statusReason:T.statusReason})}),d.jsx(fe,{className:"text-sm text-text-secondary",children:ji(T.manifest.resources)}),d.jsx(fe,{className:"text-sm text-text-secondary",children:xi(T.manifest.networking)}),d.jsx(fe,{className:"text-sm text-text-secondary",children:un(T.updatedAt)}),d.jsx(fe,{children:F?null:d.jsx("button",{type:"button",className:yt({variant:"ghost",size:"icon"}),"aria-label":`Delete ${T.name}`,onClick:ee=>{ee.stopPropagation(),u(T)},children:d.jsx(Qe,{name:"trash",className:"size-3.5 text-failure-bg"})})})]},T.id)})})]}),M?d.jsx(hn,{pageSize:w,rowCount:K.length,canPrev:k!=null,canNext:v!=null,onPrev:()=>N(k),onNext:()=>N(v),pageSizeOptions:Di,onPageSizeChange:T=>{E(gt(T)),N(void 0),I(void 0)}}):null]})}),d.jsx(Bi,{open:p.kind!=="closed",mode:p.kind==="edit"?"edit":"create",...p.kind==="edit"?{environment:p.environment}:{},onOpenChange:T=>{T||h({kind:"closed"})},onSaved:()=>{N(void 0),t==null||t.invalidateEnvironmentsList(),j({token:void 0,size:w})}}),d.jsx(cs,{open:y!=null,onOpenChange:T=>!T&&u(null),children:d.jsxs(fs,{children:[d.jsx(us,{children:d.jsx(hs,{children:"Delete environment"})}),d.jsxs("p",{className:"text-sm text-text-secondary",children:["Delete ",d.jsx("span",{className:"font-medium text-text-primary",children:y==null?void 0:y.name}),"? This cannot be undone. Delete fails if any agent still references the environment."]}),d.jsxs(ds,{children:[d.jsx(re.Secondary,{type:"button",disabled:g,onClick:()=>u(null),children:"Cancel"}),d.jsx(re.Primary,{type:"button",disabled:g,onClick:()=>void Zs(),children:g?"Deleting…":"Delete"})]})]})})]})}export{Vi as EnvironmentsPage,Ki as PENDING_ENVIRONMENTS_POLL_INTERVAL_MS};
@@ -1 +0,0 @@
1
- import{C as je}from"./chunk-C5376XWU-CUgFlwPN.js";import{aX as Ne,t as we,r as o,aY as Z,j as e,Y as Ce,a0 as H,I as O,aZ as be,a_ as ye,a$ as ke,b0 as Ee,g as z,b1 as Se,ap as Me}from"./index-D6YKMpJU.js";var fe=Me("h-11 shadow-sm"),Ue=({open:a,onOpenChange:l,onSave:f,title:E,description:h,initialBaseUrl:S="",baseUrlPlaceholder:d="https://api.openai.com/v1",requireApiKey:i=!0,submitLabel:M="Save",busy:I=!1,error:A})=>{const[U,B]=o.useState(""),[y,x]=o.useState(""),[k,D]=o.useState(!1),T=()=>{B(""),x(""),D(!1)};o.useEffect(()=>{a&&(B(""),x(S),D(!1))},[a,S]);const W=u=>{u||T(),l(u)},P=U.trim(),J=!i||!!P,j=async u=>{if(u.preventDefault(),!(!J||I))try{await f({apiKey:P,baseUrl:y.trim()}),T(),l(!1)}catch{}};return e.jsx(ye,{open:a,onOpenChange:W,title:E,description:h,contentSized:!0,children:e.jsxs("form",{className:"flex flex-col overflow-y-auto p-5 md:p-6",onSubmit:j,children:[e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{children:[e.jsxs("label",{htmlFor:"model-provider-api-key",className:"mb-1.5 block text-sm font-medium text-text-primary",children:["API key",i?null:e.jsx("span",{className:"font-normal text-text-secondary",children:" (optional)"})]}),e.jsx("input",{id:"model-provider-api-key",type:"password",required:i,value:U,onChange:u=>{B(u.target.value)},placeholder:i?"Enter API key":"Enter a new key",autoFocus:!0,className:fe}),i?null:e.jsx("p",{className:"mt-1.5 text-xs text-text-secondary",children:"Leave blank to keep the current key; enter a new one to replace it."})]}),e.jsxs(ke,{expanded:k,onChange:(u,X)=>D(X),className:"rounded-md border border-border",children:[e.jsx(Ee,{className:"px-3 py-2.5",children:e.jsxs("span",{className:"flex w-full items-center justify-between text-sm font-medium text-text-primary",children:["Advanced · custom endpoint",e.jsx(O,{name:"chevron-down",className:z("size-4 shrink-0 text-text-secondary transition-transform duration-200",k?"rotate-0":"-rotate-90")})]})}),e.jsxs(Se,{className:"space-y-1.5 border-t border-border px-3 pb-3 pt-4",children:[e.jsx("label",{htmlFor:"model-provider-base-url",className:"block text-sm font-medium text-text-primary",children:"Base URL"}),e.jsx("input",{id:"model-provider-base-url",type:"url",value:y,onChange:u=>{x(u.target.value)},placeholder:d,className:fe}),e.jsx("p",{className:"text-xs text-text-secondary",children:"Leave blank unless you use a regional or proxy endpoint."})]})]})]}),e.jsxs("div",{className:"mt-6 space-y-3",children:[A?e.jsx("p",{className:"text-failure-bg text-sm",children:A}):null,e.jsx(H.Primary,{type:"submit",size:"large",disabled:!J||I,className:"w-full shrink-0",children:M})]})]})})},Te=Ue,Pe="128000",Le="4096",ge=()=>({id:"",name:"",advancedExpanded:!0,contextLength:"",maxOutputTokens:""}),ve=a=>(a==null?void 0:a.models.map(l=>{var f,E,h,S,d;return{id:l.id,name:l.name,advancedExpanded:!0,reasoningEfforts:(f=l.properties)==null?void 0:f.reasoningEfforts,contextLength:((h=(E=l.properties)==null?void 0:E.contextLength)==null?void 0:h.toString())??"",maxOutputTokens:((d=(S=l.properties)==null?void 0:S.maxOutputTokens)==null?void 0:d.toString())??"",nameDirty:!0}}))??[ge()],G="h-11 w-full rounded-md border border-border/70 bg-secondary-bg px-3 text-sm text-text-primary outline-none transition-colors placeholder:text-text-secondary/70 focus-visible:border-focus-ring focus-visible:ring-2 focus-visible:ring-focus-ring/50",se="border-failure-bg focus-visible:border-failure-bg focus-visible:ring-failure-bg";function ue(a){const l=a.trim();if(l==="")return null;const f=Number(l);return Number.isInteger(f)&&f>0?f:null}function $e(a){return a.replace(/([a-zA-Z])(\d)/g,"$1-$2").toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^[^a-z]+/,"").slice(0,64).replace(/-+$/g,"")}var de=()=>e.jsx("span",{className:"ml-0.5 text-failure-bg","aria-hidden":!0,children:"*"}),re=({children:a})=>e.jsx("p",{className:"mt-1 text-xs text-failure-bg",children:a}),ie=({children:a})=>e.jsx("p",{className:"mt-1 text-xs text-text-secondary",children:a}),Re=({open:a,onOpenChange:l,onSubmit:f,reasoningEffortOptions:E,busy:h=!1,error:S,isEditMode:d=!1,initialValues:i})=>{const[M,I]=o.useState((i==null?void 0:i.name)??""),[A,U]=o.useState((i==null?void 0:i.baseUrl)??""),[B,y]=o.useState(""),[x,k]=o.useState(()=>ve(i)),[D,T]=o.useState(!1),[W,P]=o.useState(!1),J=()=>{I((i==null?void 0:i.name)??""),U((i==null?void 0:i.baseUrl)??""),y(""),k(ve(i)),T(!1),P(!1)},j=s=>{s||J(),l(s)},u=(s,r)=>{k(b=>b.map((c,w)=>w===s?{...c,...r}:c))},X=()=>{T(!0),P(!0),k(s=>s.map(r=>({...r,idTouched:!0,contextTouched:!0,maxTouched:!0})))},v=M.trim(),Q=v?null:"Name is required.",L=A.trim();let $=null;if(!L)$="Base URL is required.";else try{new URL(L)}catch{$="Enter a valid URL."}const ce=s=>s.id.trim()?null:"Model ID is required.",K=s=>s.name.trim()?null:"Model name is required.",V=s=>ue(s.contextLength)==null?"Set the model's context window.":null,N=s=>ue(s.maxOutputTokens)==null?"Set the max output tokens.":null,ee=!Q&&!$&&x.every(s=>!ce(s)&&!K(s)),te=D&&Q,Y=W&&$,ae=async()=>{if(X(),!ee||h)return;const s=x.findIndex(r=>V(r)||N(r));if(s!==-1){u(s,{advancedExpanded:!0});const r=x[s],b=r&&V(r)?"context-length":"max-output-tokens";setTimeout(()=>{var w;const c=document.getElementById(`custom-provider-model-${s}-${b}`);(w=c==null?void 0:c.scrollIntoView)==null||w.call(c,{block:"center",behavior:"smooth"}),c==null||c.focus()},0);return}try{await f({name:v,baseUrl:L,apiKey:B.trim(),models:x.map(r=>{var _;const b={};(_=r.reasoningEfforts)!=null&&_.length&&(b.reasoningEfforts=r.reasoningEfforts);const c=ue(r.contextLength);c!=null&&(b.contextLength=c);const w=ue(r.maxOutputTokens);return w!=null&&(b.maxOutputTokens=w),{id:r.id.trim(),name:r.name.trim(),...Object.keys(b).length>0?{properties:b}:{}}})}),j(!1)}catch{}};return e.jsx(ye,{open:a,onOpenChange:j,title:d?`Edit ${(i==null?void 0:i.name)??M}`:"Add custom provider",description:d?"Update the endpoint, credentials, and models for this provider.":"Connect any OpenAI-compatible endpoint, whether it's a local model, a proxy, or your own hosted service.",contentSized:!0,children:e.jsxs("form",{className:"flex min-h-0 flex-auto flex-col",onSubmit:s=>{s.preventDefault(),ae()},children:[e.jsxs("div",{className:"min-h-0 flex-auto space-y-4 overflow-y-auto px-5 pt-4 pb-8",children:[e.jsxs("div",{children:[e.jsxs("label",{htmlFor:"custom-provider-name",className:"mb-1.5 block text-sm font-medium text-text-primary",children:["Name",e.jsx(de,{})]}),e.jsx("input",{id:"custom-provider-name",type:"text",value:M,onChange:s=>I(s.target.value),onBlur:()=>T(!0),placeholder:"local-llama",autoFocus:!d,readOnly:d,"aria-readonly":d,"aria-invalid":te?!0:void 0,className:z(G,d&&"cursor-not-allowed bg-secondary-bg/60 text-text-secondary",te&&se)}),d?e.jsx(ie,{children:"Provider names cannot be changed after creation."}):null,te?e.jsx(re,{children:Q}):null]}),e.jsxs("div",{children:[e.jsxs("label",{htmlFor:"custom-provider-base-url",className:"mb-1.5 block text-sm font-medium text-text-primary",children:["Base URL",e.jsx(de,{})]}),e.jsx("input",{id:"custom-provider-base-url",type:"text",value:A,onChange:s=>U(s.target.value),onBlur:()=>P(!0),placeholder:"http://localhost:11434/v1",autoFocus:d,"aria-invalid":Y?!0:void 0,className:z(G,Y&&se)}),Y?e.jsx(re,{children:$}):L?null:e.jsx(ie,{children:"OpenAI-compatible endpoint, usually ending in /v1."})]}),e.jsxs("div",{children:[e.jsxs("label",{htmlFor:"custom-provider-api-key",className:"mb-1.5 block text-sm font-medium text-text-primary",children:["API key",e.jsx("span",{className:"font-normal text-text-secondary",children:" (optional)"})]}),e.jsx("input",{id:"custom-provider-api-key",type:"password",value:B,onChange:s=>y(s.target.value),placeholder:"sk-…",className:G}),e.jsx(ie,{children:d?"Leave blank to keep the saved key, or enter a new key to replace it.":"Leave blank if your endpoint needs no key (e.g. a local model)."})]}),e.jsxs("fieldset",{className:"m-0 min-w-0 border-0 p-0",children:[e.jsxs("legend",{className:"float-left mb-2 w-full p-0 text-sm font-medium text-text-primary",children:["Models",e.jsx(de,{})]}),e.jsx("div",{className:"clear-both",children:x.map((s,r)=>{const b=ce(s),c=s.idTouched&&b,w=K(s),_=!!w&&s.nameDirty,me=V(s),ne=N(s),oe=s.contextTouched&&me,le=s.maxTouched&&ne;return e.jsxs("div",{className:z("pb-6",r>0?"border-t border-border pt-6":"pt-1"),style:r>0?{borderTopWidth:"0.5px"}:void 0,children:[e.jsxs("div",{className:"grid grid-cols-[1fr_1fr_2rem] items-end gap-2",children:[e.jsxs("div",{className:"min-w-0",children:[e.jsx("label",{htmlFor:`custom-provider-model-${r}-id`,className:"mb-1 block text-xs font-normal text-text-secondary",children:"Model ID"}),e.jsx("input",{id:`custom-provider-model-${r}-id`,type:"text",value:s.id,onChange:p=>{const F=p.target.value;u(r,{id:F,...s.nameDirty?{}:{name:$e(F)}})},onBlur:()=>u(r,{idTouched:!0}),placeholder:"llama3.1:70b","aria-invalid":c?!0:void 0,className:z(G,"font-mono",c&&se)})]}),e.jsxs("div",{className:"min-w-0",children:[e.jsx("label",{htmlFor:`custom-provider-model-${r}-name`,className:"mb-1 block text-xs font-normal text-text-secondary",children:"Model name"}),e.jsx("input",{id:`custom-provider-model-${r}-name`,type:"text",value:s.name,onChange:p=>u(r,{name:p.target.value,nameDirty:!0}),placeholder:"llama-3-1-70b","aria-invalid":_?!0:void 0,className:z(G,_&&se)})]}),e.jsx("button",{type:"button","aria-label":`Remove model ${r+1}`,disabled:x.length===1||h,className:"mb-0.5 flex size-9 items-center justify-center rounded-md text-text-secondary transition-colors hover:text-text-primary disabled:opacity-40",onClick:()=>k(p=>p.filter((F,g)=>g!==r)),children:e.jsx(O,{name:"trash",className:"size-4"})})]}),c?e.jsx(re,{children:b}):null,_?e.jsx(re,{children:w}):null,e.jsxs("div",{className:"mt-2",children:[e.jsxs("button",{type:"button","aria-expanded":s.advancedExpanded,"aria-controls":`custom-provider-model-${r}-advanced`,className:"flex cursor-pointer items-center gap-1.5 text-sm font-medium text-text-primary",onClick:()=>u(r,{advancedExpanded:!s.advancedExpanded}),children:[e.jsx(O,{name:"chevron-down",className:z("size-4 text-text-secondary transition-transform",s.advancedExpanded?"":"-rotate-90")}),"Advanced"]}),s.advancedExpanded?e.jsxs("div",{id:`custom-provider-model-${r}-advanced`,className:"mt-3 space-y-4 pl-6",children:[e.jsxs("div",{children:[e.jsxs("label",{htmlFor:`custom-provider-model-${r}-context-length`,className:"mb-1.5 block text-xs font-medium text-text-secondary",children:["Context length",e.jsx(de,{})]}),e.jsx("input",{id:`custom-provider-model-${r}-context-length`,type:"number",min:1,inputMode:"numeric",value:s.contextLength,onChange:p=>u(r,{contextLength:p.target.value}),onBlur:()=>u(r,{contextTouched:!0}),placeholder:Pe,"aria-invalid":oe?!0:void 0,className:z(G,oe&&se)}),oe?e.jsx(re,{children:me}):s.contextLength.trim()===""?e.jsx(ie,{children:"Model's total token window."}):null]}),e.jsxs("div",{children:[e.jsxs("label",{htmlFor:`custom-provider-model-${r}-max-output-tokens`,className:"mb-1.5 block text-xs font-medium text-text-secondary",children:["Max output tokens",e.jsx(de,{})]}),e.jsx("input",{id:`custom-provider-model-${r}-max-output-tokens`,type:"number",min:1,inputMode:"numeric",value:s.maxOutputTokens,onChange:p=>u(r,{maxOutputTokens:p.target.value}),onBlur:()=>u(r,{maxTouched:!0}),placeholder:Le,"aria-invalid":le?!0:void 0,className:z(G,le&&se)}),le?e.jsx(re,{children:ne}):s.maxOutputTokens.trim()===""?e.jsx(ie,{children:"Longest reply the model allows — use its real limit."}):null]}),E&&E.length>0?e.jsxs("div",{children:[e.jsxs("label",{className:"flex w-fit cursor-pointer items-center gap-2 select-none",children:[e.jsx("input",{type:"checkbox",className:"size-4 shrink-0 cursor-pointer accent-primary-button-bg disabled:cursor-not-allowed disabled:opacity-50",checked:s.reasoningEfforts!==void 0,"aria-label":`Enable reasoning effort for model ${r+1}`,disabled:h,onChange:p=>u(r,{reasoningEfforts:p.target.checked?[]:void 0})}),e.jsx("span",{className:"text-text-secondary text-xs font-medium",children:"Reasoning effort"})]}),s.reasoningEfforts!==void 0?e.jsx("div",{role:"group","aria-label":`Supported reasoning efforts for model ${r+1}`,className:"mt-2 flex flex-wrap gap-2",children:E.map(p=>{var g;const F=((g=s.reasoningEfforts)==null?void 0:g.includes(p))??!1;return e.jsx("button",{type:"button","aria-pressed":F,disabled:h,className:z("rounded-full border px-3 py-1 text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-focus-ring/40 disabled:opacity-50",F?"border-primary-button-bg bg-primary-button-bg text-primary-button-text":"border-border text-text-secondary hover:bg-ghost-button-hover"),onClick:()=>{var q;return u(r,{reasoningEfforts:F?(q=s.reasoningEfforts)==null?void 0:q.filter(xe=>xe!==p):[...s.reasoningEfforts??[],p]})},children:p},p)})}):null]}):null]}):null]})]},r)})}),e.jsxs(H.Secondary,{size:"small",type:"button",className:"mt-4 w-fit",onClick:()=>k(s=>[...s,ge()]),children:[e.jsx(O,{name:"plus",className:"size-3.5"}),"Add model"]})]})]}),e.jsxs("div",{className:"shrink-0 space-y-3 border-t border-border px-5 py-4",children:[S?e.jsx("p",{className:"text-failure-bg text-sm",children:S}):null,e.jsx(H.Primary,{type:"submit",size:"large",disabled:!ee||h,className:"w-full",children:d?"Save changes":"Add provider"})]})]})})},ze=Re;function pe(a){return a.kind==="model"&&a.provider.models.length===1}function Oe(a){return a.kind==="provider"?`“${a.provider.name}” and all of its models will no longer be available to your agents.`:pe(a)?`“${a.model.name}” is the only model left in ${a.provider.name}, so the whole provider will be removed.`:`“${a.model.name}” will no longer be available to your agents. The rest of ${a.provider.name} stays configured.`}function Fe(a){return"baseUrl"in a&&typeof a.baseUrl=="string"?a.baseUrl:""}var Ie=()=>{const{modelCatalog:a}=Ne(),l=we(),[f,E]=o.useState(""),[h,S]=o.useState([]),[d,i]=o.useState([]),[M,I]=o.useState(!0),[A,U]=o.useState(null),[B,y]=o.useState(null),[x,k]=o.useState(!1),[D,T]=o.useState(null),[W,P]=o.useState(null),[J,j]=o.useState(null),[u,X]=o.useState(!1),[v,Q]=o.useState(null),[L,$]=o.useState(null),[ce,K]=o.useState(null),V=o.useMemo(()=>(d??[]).reduce((t,n)=>(t[n.name]=n.logo??"",t),{}),[d]),N=f.trim().toLowerCase(),ee=o.useCallback(async()=>{I(!0),U(null);try{const[t,n]=await Promise.all([a.listModelProviders(),a.getModelProviderCatalog()]);S(t),i(n)}catch(t){U(Z(t,"Failed to load model providers"))}finally{I(!1)}},[a]);o.useEffect(()=>{ee()},[ee]);const te=o.useMemo(()=>new Set(h.map(t=>t.type)),[h]),Y=o.useMemo(()=>h.filter(t=>{var n;return((n=t.name)==null?void 0:n.toLowerCase().includes(N))||t.models.some(m=>m.name.toLowerCase().includes(N)||m.id.toLowerCase().includes(N))}),[h,N]),ae=o.useMemo(()=>d.filter(t=>t.type!=="custom"&&!te.has(t.type)&&(t.name.toLowerCase().includes(N)||t.models.some(n=>n.name.toLowerCase().includes(N)||n.id.toLowerCase().includes(N)))),[d,te,N]),s=o.useMemo(()=>{var t;return(t=d.find(n=>n.type==="custom"))==null?void 0:t.supportedReasoningEfforts},[d]),r=o.useMemo(()=>{const t=new Map;for(const n of d)t.set(n.type,n.models);return t},[d]),b=()=>{T(null),P(null),j(null)},c=async(t,n)=>{k(!0),U(null);try{await t(),await ee(),b()}catch(m){throw n?n(m):l==null?U(Z(m,"Request failed")):l.showError(m),m}finally{k(!1)}},w=async(t,n)=>{j(null),await c(async()=>{await a.createModelProvider({type:t.type,name:t.name,...n.baseUrl?{baseUrl:n.baseUrl}:{},apiKey:n.apiKey,models:t.models})},m=>j(Z(m,"Request failed")))},_=async(t,n)=>{j(null),await c(async()=>{await a.updateModelProvider({id:t.id,type:t.type,name:t.name,...n.baseUrl?{baseUrl:n.baseUrl}:{},apiKey:n.apiKey,models:t.models})},m=>j(Z(m,"Request failed"))),l==null||l.showSuccess({title:`${t.name} updated`})},me=()=>{x||($(null),K(null))},ne=({provider:t,models:n},m)=>c(async()=>{await a.updateModelProvider({id:t.id,type:t.type,name:t.name,...t.baseUrl?{baseUrl:t.baseUrl}:{},apiKey:"",models:n})},m),oe=t=>{K(null);const n=R=>K(Z(R,"Request failed"));let m;if(t.kind==="model"&&!pe(t))m=ne({provider:t.provider,models:t.provider.models.filter(R=>R.id!==t.model.id)},n);else{const R=a.deleteModelProvider;R!==void 0&&(m=c(async()=>{await R({id:t.provider.id})},n))}m==null||m.then(()=>$(null)).catch(()=>{})},le=async t=>{y(null),await c(async()=>{await a.createModelProvider({type:"custom",name:t.name,baseUrl:t.baseUrl,apiKey:t.apiKey,models:t.models})},n=>y(Z(n,"Request failed"))),setTimeout(()=>{l==null||l.showSuccess({title:`${t.name} added`})},0)},p=async t=>{if(!v)return;const n=v;y(null),await c(async()=>{await a.updateModelProvider({id:n.id,type:n.type,name:n.name,baseUrl:t.baseUrl,apiKey:t.apiKey,models:t.models})},m=>y(Z(m,"Request failed"))),setTimeout(()=>{l==null||l.showSuccess({title:"Model provider updated",description:`${n.name} was updated successfully.`})},0)},F=v?{name:v.name,baseUrl:v.baseUrl??"",models:v.models}:void 0,g=D!=null?h.find(t=>t.id===D)??null:null,q=W!=null?d.find(t=>t.type===W)??null:null,xe=g!=null||q!=null;return e.jsxs(e.Fragment,{children:[e.jsx("h3",{className:"text-xl font-semibold tracking-tight text-text-primary",children:"Models"}),e.jsx("p",{className:"mt-1 text-sm text-text-secondary",children:"Connect providers and choose which models are available."}),A?e.jsx("p",{className:"mt-3 rounded-md border border-failure-bg/30 bg-failure-bg/10 px-3 py-2 text-sm text-failure-bg",children:A}):null,e.jsx("div",{className:"mt-4 min-h-0 min-w-0 flex-1 overflow-y-hidden",children:e.jsxs("div",{className:"flex h-full min-w-0 flex-col gap-3",children:[e.jsxs("div",{className:"flex min-w-0 flex-col gap-2 sm:flex-row",children:[e.jsx("div",{className:"min-w-0 flex-1",children:e.jsx(Ce,{query:f,setQuery:E,placeholder:"Search providers and models"})}),e.jsxs(H.Secondary,{type:"button",className:"shrink-0 sm:self-auto",onClick:()=>{y(null),Q(null),X(!0)},children:[e.jsx(O,{name:"plus",size:"1rem",className:"mr-1"}),"Add Custom Provider"]})]}),e.jsxs("div",{className:"flex flex-1 flex-col gap-2 overflow-y-auto",children:[M?e.jsx("p",{className:"py-8 text-center text-sm text-text-secondary",children:"Loading…"}):null,!M&&Y.length>0?e.jsxs("section",{"aria-labelledby":"configured-providers-heading",children:[e.jsx("div",{id:"configured-providers-heading",className:"mb-2 text-[0.8125rem] font-semibold uppercase text-text-secondary",children:"Configured"}),e.jsx("div",{className:"overflow-hidden rounded-xl border border-border bg-card-bg",children:Y.map(t=>{const n=r.get(t.type)??[],m=new Set(t.models.map(C=>C.id)),R=n.filter(C=>!m.has(C.id)),he=V[t.name];return e.jsxs("article",{className:"border-b border-border p-3 last:border-b-0",children:[e.jsxs("header",{className:"flex flex-col gap-3 sm:flex-row sm:items-center",children:[e.jsxs("div",{className:"flex min-w-0 flex-1 items-center gap-3",children:[e.jsx("div",{className:"flex h-9 w-9 shrink-0 items-center justify-center rounded-lg border border-border bg-secondary-bg text-text-primary","aria-hidden":!0,children:he?e.jsx(be,{src:he,alt:t.name,className:"size-4.5"}):e.jsx(O,{name:"cpu",className:"size-4.5"})}),e.jsx("h5",{className:"truncate text-base font-medium text-text-primary",children:t.name})]}),e.jsxs("div",{className:"flex flex-wrap items-center gap-2.5 sm:justify-end",children:[e.jsxs("span",{className:"flex items-center gap-1.5 rounded-full border border-border bg-secondary-bg/40 px-2 py-0.5 text-xs font-medium text-success-bg",children:[e.jsx("span",{className:"h-1.5 w-1.5 rounded-full bg-success-bg"}),"Connected"]}),e.jsxs(H.Secondary,{size:"small",className:"text-[0.8125rem]",type:"button","aria-label":`Edit ${t.name}`,title:`Edit ${t.name}`,disabled:x,onClick:()=>{t.type==="custom"?(b(),y(null),Q(t),X(!0)):(j(null),P(null),T(t.id))},children:[e.jsx(O,{name:"pencil",className:"size-3.5"}),"Edit"]}),a.deleteModelProvider?e.jsx(H.Secondary,{size:"small",className:"transition-colors hover:bg-failure-bg/10 hover:text-failure-bg",type:"button",disabled:x,onClick:()=>{K(null),$({kind:"provider",provider:t})},children:"Remove"}):null]})]}),e.jsxs("div",{className:"mt-3 overflow-hidden rounded-lg border border-border bg-secondary-bg/30",children:[t.models.map(C=>e.jsxs("div",{className:"flex min-h-10 items-center gap-3 border-b border-border px-3 py-2 text-sm text-text-primary last:border-b-0",children:[e.jsx("span",{className:"min-w-0 flex-1 truncate",children:C.name}),t.models.length>1||a.deleteModelProvider?e.jsx("button",{type:"button","aria-label":`Remove ${C.name}`,disabled:x,className:"inline-flex size-7 shrink-0 items-center justify-center rounded-md text-text-secondary hover:bg-ghost-button-hover hover:text-ghost-button-text focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-focus-ring disabled:opacity-50",onClick:()=>{K(null),$({kind:"model",provider:t,model:C})},children:e.jsx(O,{name:"trash",className:"size-3.5"})}):null]},C.id)),R.length>0?e.jsxs("section",{children:[e.jsxs("div",{className:"border-b border-border bg-secondary-bg/40 px-3 py-2 text-xs font-semibold uppercase tracking-wide text-text-secondary",children:["Available to add · ",R.length]}),R.map(C=>e.jsxs("div",{className:"flex min-h-12 items-center gap-3 border-b border-border px-3 py-2 text-sm text-text-primary last:border-b-0",children:[e.jsx("span",{className:"min-w-0 flex-1 truncate",children:C.name}),e.jsx(H.Secondary,{size:"small",type:"button",disabled:x,onClick:()=>{ne({provider:t,models:[...t.models,C]}).catch(()=>{})},children:"Add"})]},C.id))]}):null]})]},t.id)})})]}):null,!M&&ae.length>0?e.jsxs("section",{"aria-labelledby":"available-providers-heading",className:"mt-2",children:[e.jsx("div",{id:"available-providers-heading",className:"mb-2 text-[0.8125rem] font-semibold uppercase text-text-secondary",children:"Available"}),e.jsx("div",{className:"overflow-hidden rounded-xl border border-border bg-card-bg",children:ae.map(t=>{const n=V[t.name];return e.jsx("article",{className:"border-b border-border p-3 last:border-b-0",children:e.jsxs("header",{className:"flex flex-col gap-3 sm:flex-row sm:items-center",children:[e.jsxs("div",{className:"flex min-w-0 flex-1 items-center gap-3",children:[e.jsx("span",{className:"flex size-9 shrink-0 items-center justify-center rounded-lg border border-border bg-secondary-bg text-text-primary","aria-hidden":!0,children:n?e.jsx(be,{src:n,alt:t.name,className:"size-4.5"}):e.jsx(O,{name:"cpu",className:"size-4.5"})}),e.jsxs("div",{className:"min-w-0 flex-1 overflow-hidden",children:[e.jsx("h5",{className:"truncate text-base font-medium text-text-primary",children:t.name}),e.jsx("p",{className:"truncate text-sm text-text-secondary",children:t.models.map(m=>m.name).join(" · ")})]})]}),e.jsxs(H.Secondary,{type:"button",disabled:x,onClick:()=>{j(null),T(null),P(t.type)},children:[e.jsx(O,{name:"wrench",className:"size-4"}),"Configure"]})]})},t.type)})})]}):null,!M&&Y.length===0&&ae.length===0?e.jsx("div",{className:"flex flex-1 items-center justify-center rounded-xl border border-dashed border-border p-8 text-center text-sm text-text-secondary",children:N?`No providers match “${f.trim()}”.`:"No model providers yet."}):null]}),L?e.jsx(je,{title:L.kind==="model"&&!pe(L)?"Remove model?":"Remove provider?",description:Oe(L),busy:x,error:ce,onCancel:me,onConfirm:()=>{oe(L)}}):null,e.jsx(Te,{open:xe,onOpenChange:t=>{t||b()},onSave:t=>{if(g)return _(g,t);if(q)return w(q,t)},title:g?"Edit Provider Details":"Configure Provider Details",initialBaseUrl:g?g.baseUrl??"":q?Fe(q):"",requireApiKey:g==null,submitLabel:g?"Save":"Create",busy:x,error:J}),e.jsx(ze,{open:u,onOpenChange:t=>{X(t),t||(y(null),Q(null))},isEditMode:v!==null,initialValues:F,onSubmit:v?p:le,reasoningEffortOptions:s,busy:x,error:B},(v==null?void 0:v.id)??"add-custom-provider")]})})]})},De=Ie;export{De as default};
@@ -1 +0,0 @@
1
- import{C as G}from"./chunk-C5376XWU-CUgFlwPN.js";import{aX as Y,t as V,r as a,aY as B,b3 as X,j as e,I as O,a0 as K,a_ as H,a$ as J,b0 as Q,g as W,b1 as Z,ap as ee}from"./index-D6YKMpJU.js";var te={execTimeoutMs:3e5,autoStopIntervalInMinutes:15,autoArchiveIntervalInMinutes:10080,autoDeleteIntervalInMinutes:43200},E=ee("h-11 shadow-sm");function R(n){if(n.trim()==="")return null;const r=Number(n);return!Number.isFinite(r)||r<0?null:r}var se=({open:n,onOpenChange:r,onSave:d,title:N,description:S,initialConfig:F=null,requireApiKey:y=!0,busy:I=!1,error:C})=>{const[m,w]=a.useState(""),[c,u]=a.useState(""),[k,l]=a.useState(""),[x,o]=a.useState(""),[b,p]=a.useState(""),[j,M]=a.useState(!1),h=()=>{w(""),u(""),l(""),o(""),p(""),M(!1)};a.useEffect(()=>{if(!n)return;const s=F??te;w(String(s.execTimeoutMs)),u(String(s.autoStopIntervalInMinutes)),l(String(s.autoArchiveIntervalInMinutes)),o(String(s.autoDeleteIntervalInMinutes)),p(""),M(!1)},[n,F]);const A=s=>{s||h(),r(s)},f=R(m),v=R(c),P=R(k),g=R(x),D=b.trim(),z=(!y||!!D)&&f!=null&&v!=null&&P!=null&&g!=null,_=async s=>{if(s.preventDefault(),!(!z||I||f==null||v==null||P==null||g==null))try{await d({execTimeoutMs:f,autoStopIntervalInMinutes:v,autoArchiveIntervalInMinutes:P,autoDeleteIntervalInMinutes:g,apiKey:D}),h(),r(!1)}catch{}};return e.jsx(H,{open:n,onOpenChange:A,title:N,description:S,contentSized:!0,headerIcon:e.jsx("span",{className:"flex size-11 shrink-0 items-center justify-center rounded-lg border border-border bg-secondary-bg text-text-primary","aria-hidden":!0,children:e.jsx(O,{name:"cube",className:"size-6"})}),children:e.jsxs("form",{className:"flex flex-col overflow-y-auto p-5 md:p-6",onSubmit:_,children:[e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{children:[e.jsxs("label",{htmlFor:"sandbox-api-key",className:"mb-1.5 block text-sm font-medium text-text-primary",children:["API key",y?null:e.jsx("span",{className:"font-normal text-text-secondary",children:" (optional)"})]}),e.jsx("input",{id:"sandbox-api-key",type:"password",required:y,value:b,onChange:s=>{p(s.target.value)},placeholder:y?"dtn_...":"Leave blank to keep existing",autoFocus:!0,className:E})]}),e.jsxs(J,{expanded:j,onChange:(s,U)=>M(U),className:"rounded-md border border-border",children:[e.jsx(Q,{className:"px-3 py-2.5",children:e.jsxs("span",{className:"flex w-full items-center justify-between text-sm font-medium text-text-primary",children:["Advanced settings",e.jsx(O,{name:"chevron-down",className:W("size-4 shrink-0 text-text-secondary transition-transform duration-200",j?"rotate-0":"-rotate-90")})]})}),e.jsxs(Z,{className:"space-y-4 border-t border-border px-3 pb-3 pt-4",children:[e.jsxs("div",{children:[e.jsx("label",{htmlFor:"sandbox-exec-timeout",className:"mb-1.5 block text-sm font-medium text-text-primary",children:"Exec timeout (ms)"}),e.jsx("input",{id:"sandbox-exec-timeout",type:"number",min:0,required:!0,value:m,onChange:s=>{w(s.target.value)},placeholder:"300000",className:E})]}),e.jsxs("div",{children:[e.jsx("label",{htmlFor:"sandbox-auto-stop",className:"mb-1.5 block text-sm font-medium text-text-primary",children:"Auto-stop interval (minutes)"}),e.jsx("input",{id:"sandbox-auto-stop",type:"number",min:0,required:!0,value:c,onChange:s=>{u(s.target.value)},placeholder:"15",className:E})]}),e.jsxs("div",{children:[e.jsx("label",{htmlFor:"sandbox-auto-archive",className:"mb-1.5 block text-sm font-medium text-text-primary",children:"Auto-archive interval (minutes)"}),e.jsx("input",{id:"sandbox-auto-archive",type:"number",min:0,required:!0,value:k,onChange:s=>{l(s.target.value)},placeholder:"10080",className:E})]}),e.jsxs("div",{children:[e.jsx("label",{htmlFor:"sandbox-auto-delete",className:"mb-1.5 block text-sm font-medium text-text-primary",children:"Auto-delete interval (minutes)"}),e.jsx("input",{id:"sandbox-auto-delete",type:"number",min:0,required:!0,value:x,onChange:s=>{o(s.target.value)},placeholder:"43200",className:E})]})]})]})]}),e.jsxs("div",{className:"mt-6 space-y-3",children:[C?e.jsx("p",{className:"text-failure-bg text-sm",children:C}):null,e.jsx(K.Primary,{type:"submit",size:"large",disabled:!z||I,className:"w-full shrink-0",children:"Save"})]})]})})},ae=se,q=({execTimeoutMs:n,autoStopIntervalInMinutes:r,autoArchiveIntervalInMinutes:d,autoDeleteIntervalInMinutes:N})=>({execTimeoutMs:n,autoStopIntervalInMinutes:r,autoArchiveIntervalInMinutes:d,autoDeleteIntervalInMinutes:N}),ne=()=>{const{sandboxCatalog:n}=Y(),r=V(),[d,N]=a.useState([]),[S,F]=a.useState([]),[y,I]=a.useState(!0),[C,m]=a.useState(null),[w,c]=a.useState(null),[u,k]=a.useState(!1),[l,x]=a.useState(null),[o,b]=a.useState(null),[p,j]=a.useState(null),[M,h]=a.useState(null),A=a.useCallback(async({quiet:t=!1}={})=>{if(n){t||I(!0),m(null);try{const[i,T]=await Promise.all([n.listSandboxProviders(),n.getSandboxProviderCatalog()]);N(i),F(T)}catch(i){m(B(i,"Failed to load sandbox providers"))}finally{t||I(!1)}}},[n]);a.useEffect(()=>{A()},[A]);const f=d.length>0,v=a.useMemo(()=>{if(f)return[];const t=new Set(d.map(i=>i.catalogId));return S.filter(i=>!t.has(i.id))},[S,d,f]),P=a.useMemo(()=>{const t=o??l;return t==null||!X(t)?null:q(t)},[o,l]);if(!n)return e.jsx("p",{className:"text-sm text-text-secondary",children:"Sandbox provider catalog is not available."});const g=async(t,i=m)=>{k(!0),m(null);try{await t(),await A({quiet:!0})}catch(T){throw i(B(T,"Request failed")),T}finally{k(!1)}},D=async t=>{l&&(c(null),await g(async()=>{await n.createSandboxProvider({catalogId:l.id,name:l.name,type:l.type,...q(t),apiKey:t.apiKey})},c),x(null),setTimeout(()=>{r==null||r.showSuccess({title:`${l.name} configured`})},0))},z=async t=>{o&&(c(null),await g(async()=>{await n.updateSandboxProvider({id:o.id,...q(t),...t.apiKey?{apiKey:t.apiKey}:{}})},c),b(null),setTimeout(()=>{r==null||r.showSuccess({title:`${o.name} updated`})},0))},_=()=>{u||(j(null),h(null))},s=t=>{const i=n.deleteSandboxProvider;i&&(h(null),g(async()=>{await i({id:t.id}),j(null)},h).catch(()=>{}))},U=l!=null||o!=null,$=o!=null,L=o?`Update ${o.name}`:l?`Configure ${l.name}`:"Configure sandbox provider";return e.jsxs(e.Fragment,{children:[e.jsx("h3",{className:"text-xl font-semibold tracking-tight text-text-primary",children:"Sandbox providers"}),e.jsx("p",{className:"mt-1 text-sm text-text-secondary",children:"Choose a provider that runs sandboxes for code, files and shell commands. Only one can be active at a time."}),C?e.jsx("p",{className:"mt-3 rounded-md border border-failure-bg/30 bg-failure-bg/10 px-3 py-2 text-sm text-failure-bg",children:C}):null,e.jsx("div",{className:"mt-4 flex-1 overflow-y-auto",children:y?e.jsx("p",{className:"text-sm text-text-secondary",children:"Loading sandbox providers…"}):e.jsxs("div",{className:"space-y-6",children:[d.length>0?e.jsxs("section",{children:[e.jsxs("h4",{className:"mb-2 text-xs font-semibold uppercase tracking-wide text-text-secondary",children:["Configured · ",d.length]}),e.jsxs("div",{className:"overflow-hidden rounded-xl border border-border bg-card-bg",children:[d.map(t=>e.jsxs("article",{className:"flex flex-col gap-3 border-b border-border p-3 last:border-b-0 sm:flex-row sm:items-center",children:[e.jsxs("div",{className:"flex min-w-0 flex-1 items-center gap-3",children:[e.jsx("span",{className:"flex size-9 shrink-0 items-center justify-center rounded-lg border border-border bg-secondary-bg text-text-primary","aria-hidden":!0,children:e.jsx(O,{name:"cube",className:"size-4.5"})}),e.jsx("div",{className:"min-w-0",children:e.jsx("h5",{className:"truncate text-sm font-medium text-text-primary",children:t.name})})]}),e.jsxs("div",{className:"flex flex-wrap items-center gap-2.5 sm:justify-end",children:[e.jsxs("span",{className:"inline-flex items-center gap-1.5 text-sm font-medium text-success-bg",children:[e.jsx("span",{className:"size-2 rounded-full bg-success-bg","aria-hidden":!0}),"Connected"]}),e.jsx(K.Secondary,{size:"small",type:"button",disabled:u,onClick:()=>{c(null),x(null),b(t)},children:"Update"}),n.deleteSandboxProvider?e.jsx(K.Ghost,{size:"small",className:"text-text-secondary",type:"button",disabled:u,onClick:()=>{h(null),j(t)},children:"Remove"}):null]})]},t.id))," "]})]}):null,f?null:e.jsxs("section",{children:[e.jsxs("h4",{className:"mb-2 text-xs font-semibold uppercase tracking-wide text-text-secondary",children:["Available · ",v.length]}),v.length===0?e.jsx("p",{className:"text-sm text-text-secondary",children:S.length>0?"All catalog providers are configured.":"No sandbox providers in the catalog."}):e.jsx("div",{className:"overflow-hidden rounded-xl border border-border bg-card-bg",children:v.map(t=>e.jsxs("article",{className:"flex flex-col gap-3 border-b border-border p-3 last:border-b-0 sm:flex-row sm:items-center",children:[e.jsxs("div",{className:"flex min-w-0 flex-1 items-center gap-3",children:[e.jsx("span",{className:"flex size-9 shrink-0 items-center justify-center rounded-lg border border-border bg-secondary-bg text-text-primary","aria-hidden":!0,children:e.jsx(O,{name:"cube",className:"size-4.5"})}),e.jsx("div",{className:"min-w-0",children:e.jsx("h5",{className:"truncate text-sm font-medium text-text-primary",children:t.name})})]}),e.jsx(K.Secondary,{type:"button",disabled:u,onClick:()=>{c(null),b(null),x(t)},children:"Configure"})]},t.id))})]})]})}),p?e.jsx(G,{title:"Remove sandbox provider?",description:`“${p.name}” will stop running sandboxes for code, files and shell commands.`,busy:u,error:M,onCancel:_,onConfirm:()=>{s(p)}}):null,e.jsx(ae,{open:U,onOpenChange:t=>{t||(c(null),x(null),b(null))},onSave:$?z:D,title:L,description:$?"Update this sandbox provider. Leave API key blank to keep the existing key.":"Configure this sandbox provider. API key is never stored in the catalog.",initialConfig:P,requireApiKey:!$,busy:u,error:w})]})},oe=ne;export{oe as default};