@capagents/forgeqe 3.1.0 → 3.1.2

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 (254) hide show
  1. package/HOW_TO_USE.md +465 -95
  2. package/README.md +21 -6
  3. package/THIRD_PARTY_NOTICES.md +210 -1
  4. package/dist/docs-site/CREDITS.md +6 -0
  5. package/dist/docs-site/architecture-map/index.html +1 -1
  6. package/dist/docs-site/docs/app-theme.css +100 -8
  7. package/dist/docs-site/docs/architecture/index.html +210 -214
  8. package/dist/docs-site/docs/area-api/index.html +350 -0
  9. package/dist/docs-site/docs/area-automated-tests/index.html +967 -0
  10. package/dist/docs-site/docs/area-browser/index.html +430 -0
  11. package/dist/docs-site/docs/area-data/index.html +605 -0
  12. package/dist/docs-site/docs/area-desktop/index.html +755 -0
  13. package/dist/docs-site/docs/area-mobile/index.html +631 -0
  14. package/dist/docs-site/docs/area-operations/index.html +1069 -0
  15. package/dist/docs-site/docs/area-pull-requests/index.html +208 -0
  16. package/dist/docs-site/docs/area-quality/index.html +365 -0
  17. package/dist/docs-site/docs/area-release/index.html +320 -0
  18. package/dist/docs-site/docs/area-setup/index.html +1192 -0
  19. package/dist/docs-site/docs/area-systems/index.html +207 -0
  20. package/dist/docs-site/docs/area-test-cases/index.html +694 -0
  21. package/dist/docs-site/docs/containers/index.html +97 -104
  22. package/dist/docs-site/docs/cost-architecture/index.html +108 -112
  23. package/dist/docs-site/docs/custom-agents-first-run/index.html +19 -23
  24. package/dist/docs-site/docs/desktop/index.html +172 -162
  25. package/dist/docs-site/docs/desktop-ci/index.html +26 -33
  26. package/dist/docs-site/docs/evidence/index.html +253 -257
  27. package/dist/docs-site/docs/feature-test-prompts/index.html +66 -70
  28. package/dist/docs-site/docs/get-started/index.html +495 -0
  29. package/dist/docs-site/docs/graphify/index.html +42 -46
  30. package/dist/docs-site/docs/guardrails/index.html +17 -21
  31. package/dist/docs-site/docs/index.html +17 -6708
  32. package/dist/docs-site/docs/mobile/index.html +155 -162
  33. package/dist/docs-site/docs/model-routing/index.html +44 -51
  34. package/dist/docs-site/docs/overview/index.html +176 -0
  35. package/dist/docs-site/docs/product-graph/index.html +52 -55
  36. package/dist/docs-site/docs/product-knowledge/index.html +11 -15
  37. package/dist/docs-site/docs/product-views/index.html +53 -57
  38. package/dist/docs-site/docs/reference/index.html +379 -0
  39. package/dist/docs-site/docs/search.js +1 -1
  40. package/dist/docs-site/docs/using/index.html +480 -0
  41. package/dist/docs-site/docs/web-app/index.html +147 -93
  42. package/dist/docs-site/security/index.html +930 -0
  43. package/dist/docs-site/security/security-theme.css +161 -0
  44. package/dist/docs-site/security/security.js +1465 -0
  45. package/dist/docs-site/vendor/react-18.3.1.production.min.js +31 -0
  46. package/dist/docs-site/vendor/react-dom-18.3.1.production.min.js +267 -0
  47. package/dist/docs-site/vendor/reactflow-11.11.4.umd.js +10 -0
  48. package/dist/forgeqe.js +2251 -1886
  49. package/dist/web/THIRD_PARTY_NOTICES.md +0 -136
  50. package/dist/web/assets/Agent-CPhmZdFX.js +8 -0
  51. package/dist/web/assets/AgentWork-BXdN9xgi.js +2 -0
  52. package/dist/web/assets/ApiTests-Do3xLjfB.js +10 -0
  53. package/dist/web/assets/Browse-WVkJT6Bs.js +2 -0
  54. package/dist/web/assets/Chat-CDc9UcQX.js +3 -0
  55. package/dist/web/assets/CommandPalette-BAZm62lV.js +1 -0
  56. package/dist/web/assets/Compare-Br6n9T9L.js +1 -0
  57. package/dist/web/assets/Cost-BBUyBu3Y.js +1 -0
  58. package/dist/web/assets/Data-Ch2DPEWp.js +6 -0
  59. package/dist/web/assets/Desktop-Qzoq-cQv.js +1 -0
  60. package/dist/web/assets/DesktopReview-CF_jQYAM.js +1 -0
  61. package/dist/web/assets/Evidence-C72Lj5_Q.js +1 -0
  62. package/dist/web/assets/Explore-ObkEpUyS.js +2 -0
  63. package/dist/web/assets/Features-CQzNo_WP.js +1 -0
  64. package/dist/web/assets/Flags-0-RniPJm.js +2 -0
  65. package/dist/web/assets/Flaky-BPJvNLCA.js +1 -0
  66. package/dist/web/assets/Impact-CfccsL_k.js +3 -0
  67. package/dist/web/assets/Jobs-T6m4zhDy.js +5 -0
  68. package/dist/web/assets/KindPage-BDUvWe2p.js +6 -0
  69. package/dist/web/assets/Migration-Dqeh4x5u.js +2 -0
  70. package/dist/web/assets/PageAgent-DNjzIgeY.js +1 -0
  71. package/dist/web/assets/Product-nYV_scOV.js +7 -0
  72. package/dist/web/assets/Production-CGSbEWVa.js +1 -0
  73. package/dist/web/assets/Quality-BIypojZm.js +1 -0
  74. package/dist/web/assets/Readiness-BlRjwJRg.js +1 -0
  75. package/dist/web/assets/Record-v2KLI-_Z.js +1 -0
  76. package/dist/web/assets/Regression-B-jSt4Jz.js +5 -0
  77. package/dist/web/assets/RelationGraph-8J98lOVG.js +1 -0
  78. package/dist/web/assets/Reports-GI4u6SyW.js +2 -0
  79. package/dist/web/assets/Response-mhBThq2b.js +9 -0
  80. package/dist/web/assets/Responsive-DXu7Ra7K.js +3 -0
  81. package/dist/web/assets/RunDiff-D0SHDNp0.js +1 -0
  82. package/dist/web/assets/Runs-C1Gjdi9M.js +2 -0
  83. package/dist/web/assets/Settings-BGGeuvyF.js +21 -0
  84. package/dist/web/assets/Steps-D-YG0eJy.js +2 -0
  85. package/dist/web/assets/TestCases-DC4w77eQ.js +1 -0
  86. package/dist/web/assets/TestData-CvKWRVVV.js +2 -0
  87. package/dist/web/assets/TestDebt-D8YzN29_.js +1 -0
  88. package/dist/web/assets/TestManagement-C5cDCqrD.js +1 -0
  89. package/dist/web/assets/Tosca-BGUv3RiJ.js +3 -0
  90. package/dist/web/assets/WhatsNew-B_Gyuv8O.js +1 -0
  91. package/dist/web/assets/agents-C0Jg2pN8.js +1 -0
  92. package/dist/web/assets/coverage-BMP6ELFJ.js +5 -0
  93. package/dist/web/assets/dataParts-DbeCj9ga.js +3 -0
  94. package/dist/web/assets/diff-BStuTmsN.js +2 -0
  95. package/dist/web/assets/families-BBFFrUlo.js +1 -0
  96. package/dist/web/assets/filters-CnAMr286.js +1 -0
  97. package/dist/web/assets/fold-D_O_VZui.js +1 -0
  98. package/dist/web/assets/head-CRo48rPt.js +1 -0
  99. package/dist/web/assets/highlight-BcFZIf59.js +4 -0
  100. package/dist/web/assets/index-B3JsM7tv.js +64 -0
  101. package/dist/web/assets/index-CafApcbZ.css +2 -0
  102. package/dist/web/assets/input-CtzK50ZF.js +1 -0
  103. package/dist/web/assets/jsx-runtime-LKYXHABd.js +1 -0
  104. package/dist/web/assets/line-icons-rdF8DYDJ.js +1 -0
  105. package/dist/web/assets/logos-D4oVWzqa.js +1 -0
  106. package/dist/web/assets/palette-DAaGSao7.js +1 -0
  107. package/dist/web/assets/paletteCommands-Co-RlQ8q.js +1 -0
  108. package/dist/web/assets/parts-D357Wolo.js +1 -0
  109. package/dist/web/assets/productParts-B8oHRCJF.js +1 -0
  110. package/dist/web/assets/qualityParts-BLkmIfDY.js +1 -0
  111. package/dist/web/assets/recordTest-Cez2sDJO.js +1 -0
  112. package/dist/web/assets/rolldown-runtime-XKyaHtl9.js +1 -0
  113. package/dist/web/assets/route-BloYJWgw.js +1 -0
  114. package/dist/web/index.html +12 -12
  115. package/docs/ARCHITECTURE.md +1 -1
  116. package/docs/BASAL.md +1 -1
  117. package/docs/DESKTOP.md +20 -1
  118. package/docs/EVIDENCE.md +1 -1
  119. package/docs/MOBILE.md +4 -4
  120. package/docs/PRODUCT_KNOWLEDGE.md +2 -0
  121. package/docs/WEB_APP.md +114 -51
  122. package/docs/user-guide.html +463 -87
  123. package/forgeqe.example.yaml +3 -3
  124. package/package.json +1 -1
  125. package/prompts/page-differs.md +1 -1
  126. package/prompts/requests-rule.md +1 -1
  127. package/prompts/responsive-review.md +38 -0
  128. package/prompts/responsive-split.md +40 -0
  129. package/prompts/responsive.md +42 -0
  130. package/prompts/test-reviewer.md +1 -1
  131. package/prompts/test-rules.md +3 -4
  132. package/skills/web-guidance/LICENSE +202 -0
  133. package/skills/web-guidance/SKILL.md +76 -0
  134. package/skills/web-guidance/UPSTREAM +67 -0
  135. package/skills/web-guidance/references/accessibility/accessibility.md +585 -0
  136. package/skills/web-guidance/references/accessibility/accessible-error-announcement.md +302 -0
  137. package/skills/web-guidance/references/accessibility/accessible-generated-content.md +41 -0
  138. package/skills/web-guidance/references/accessibility/respect-os-text-scale.md +127 -0
  139. package/skills/web-guidance/references/css/responsive-design.md +16 -0
  140. package/skills/web-guidance/references/forms/autofill-address-form.md +86 -0
  141. package/skills/web-guidance/references/forms/autofill-payment-form.md +142 -0
  142. package/skills/web-guidance/references/forms/autofill-sign-in-form.md +145 -0
  143. package/skills/web-guidance/references/forms/autofill-sign-up-form.md +155 -0
  144. package/skills/web-guidance/references/forms/forms.md +415 -0
  145. package/skills/web-guidance/references/forms/ime-safe-enter-submit.md +115 -0
  146. package/skills/web-guidance/references/forms/required-field-feedback.md +317 -0
  147. package/skills/web-guidance/references/forms/select-menu-interaction.md +310 -0
  148. package/skills/web-guidance/references/forms/slider.md +184 -0
  149. package/skills/web-guidance/references/forms/sms-otp-form.md +208 -0
  150. package/skills/web-guidance/references/forms/switch.md +60 -0
  151. package/skills/web-guidance/references/forms/validate-input-after-interaction.md +406 -0
  152. package/skills/web-guidance/references/performance/break-up-long-tasks.md +64 -0
  153. package/skills/web-guidance/references/performance/identify-heavy-scripts.md +69 -0
  154. package/skills/web-guidance/references/performance/identify-inp-causes.md +105 -0
  155. package/skills/web-guidance/references/performance/interaction-paint-timing.md +200 -0
  156. package/skills/web-guidance/references/performance/optimize-image-priority.md +73 -0
  157. package/skills/web-guidance/references/performance/performance.md +384 -0
  158. package/skills/web-guidance/references/privacy/privacy.md +247 -0
  159. package/skills/web-guidance/references/security/passkey-authentication.md +218 -0
  160. package/skills/web-guidance/references/security/passkey-management.md +310 -0
  161. package/skills/web-guidance/references/security/passkey-reauthentication.md +142 -0
  162. package/skills/web-guidance/references/security/passkey-registration.md +186 -0
  163. package/skills/web-guidance/references/security/passkeys.md +39 -0
  164. package/skills/web-guidance/references/security/sanitize-untrusted-html.md +105 -0
  165. package/skills/web-guidance/references/security/secure-external-subresources.md +202 -0
  166. package/skills/web-guidance/references/security/security.md +390 -0
  167. package/skills/web-guidance/references/security/trusted-types.md +141 -0
  168. package/skills/web-guidance/references/security/validate-origins.md +197 -0
  169. package/skills/web-guidance/references/security/verify-email-ownership.md +235 -0
  170. package/skills/web-guidance/references/ui-atoms/position-aware-tooltips.md +173 -0
  171. package/skills/web-guidance/references/ui-atoms/responsive-table.md +122 -0
  172. package/skills/web-guidance/references/ui-atoms/viewport-aware-dropdowns.md +178 -0
  173. package/skills/web-guidance/references/ui-behaviors/drag-and-drop.md +108 -0
  174. package/skills/web-guidance/references/ui-behaviors/light-dismiss-a-dialog.md +89 -0
  175. package/skills/web-guidance/references/ui-behaviors/motion.md +97 -0
  176. package/skills/web-guidance/references/ui-behaviors/platform-controls-dismiss-dialog.md +40 -0
  177. package/skills/web-guidance/references/ui-behaviors/prevent-page-scroll-under-modal-dialog.md +59 -0
  178. package/skills/web-guidance/references/ui-behaviors/search-hidden-content.md +141 -0
  179. package/skills/web-guidance/references/ui-behaviors/sortable-table.md +140 -0
  180. package/skills/web-guidance/references/ui-components/accordion.md +343 -0
  181. package/skills/web-guidance/references/ui-components/breadcrumbs.md +168 -0
  182. package/skills/web-guidance/references/ui-components/carousel.md +206 -0
  183. package/skills/web-guidance/references/ui-components/checkbox.md +144 -0
  184. package/skills/web-guidance/references/ui-components/dialog.md +218 -0
  185. package/skills/web-guidance/references/ui-components/hovercard.md +391 -0
  186. package/skills/web-guidance/references/ui-components/menu.md +415 -0
  187. package/skills/web-guidance/references/ui-components/navbar.md +281 -0
  188. package/skills/web-guidance/references/ui-components/navigation-drawer.md +429 -0
  189. package/skills/web-guidance/references/ui-components/persistent-toast-notifications.md +185 -0
  190. package/skills/web-guidance/references/ui-components/progress.md +181 -0
  191. package/skills/web-guidance/references/ui-components/spinner.md +179 -0
  192. package/skills/web-guidance/references/ui-components/tabs.md +371 -0
  193. package/skills/web-guidance/references/ui-components/toolbar.md +277 -0
  194. package/skills/web-guidance/references/user-experience/form-factor-adaptation.md +120 -0
  195. package/skills/web-guidance/references/user-experience/natural-interactions.md +155 -0
  196. package/skills/web-guidance/references/visual-design/color.md +43 -0
  197. package/skills/web-guidance/references/visual-design/dark-mode.md +350 -0
  198. package/dist/web/assets/AgentWork-C3KdZh5M.js +0 -2
  199. package/dist/web/assets/ApiTests-BLnl7JGO.js +0 -10
  200. package/dist/web/assets/Browse-C-Enjpmd.js +0 -2
  201. package/dist/web/assets/Chat-Bt6jZI68.js +0 -3
  202. package/dist/web/assets/Choices-D5eTFinz.js +0 -3
  203. package/dist/web/assets/CommandPalette-D89NM2_E.js +0 -1
  204. package/dist/web/assets/Compare-YfFYHwfK.js +0 -1
  205. package/dist/web/assets/Cost-ClaDz0YR.js +0 -1
  206. package/dist/web/assets/Data-jSFgAfej.js +0 -6
  207. package/dist/web/assets/Desktop-BofKeLVf.js +0 -1
  208. package/dist/web/assets/DesktopReview--WjeZh3w.js +0 -1
  209. package/dist/web/assets/Evidence-CJNzSQpY.js +0 -1
  210. package/dist/web/assets/Explore-BdFvqgF4.js +0 -2
  211. package/dist/web/assets/Features-CIBbw6PG.js +0 -1
  212. package/dist/web/assets/Flags-B62v4uWR.js +0 -2
  213. package/dist/web/assets/Flaky-Cut1kZw6.js +0 -1
  214. package/dist/web/assets/Impact-jOSl5Q0k.js +0 -3
  215. package/dist/web/assets/Jobs-DMJGgWtQ.js +0 -5
  216. package/dist/web/assets/KindPage-BbQWH5wa.js +0 -6
  217. package/dist/web/assets/Migration-BBgv7xXo.js +0 -2
  218. package/dist/web/assets/PageAgent-txbNoP6u.js +0 -1
  219. package/dist/web/assets/Product-BrXH81Ns.js +0 -7
  220. package/dist/web/assets/Production-CCVtFNGQ.js +0 -1
  221. package/dist/web/assets/Quality-Dxh-60A8.js +0 -1
  222. package/dist/web/assets/Readiness-DyJvSOLN.js +0 -1
  223. package/dist/web/assets/Record-Dnlkimjb.js +0 -1
  224. package/dist/web/assets/Regression-D2DDTwzs.js +0 -5
  225. package/dist/web/assets/Reports-ClcY7M0Q.js +0 -2
  226. package/dist/web/assets/Response-D9FYUvHg.js +0 -9
  227. package/dist/web/assets/RunDiff-CNImaEdz.js +0 -1
  228. package/dist/web/assets/Runs-CFvmdULI.js +0 -2
  229. package/dist/web/assets/Steps-BS66s0E1.js +0 -2
  230. package/dist/web/assets/TestCases-CrQEUtfD.js +0 -1
  231. package/dist/web/assets/TestData-e3IX0xwG.js +0 -2
  232. package/dist/web/assets/TestDebt-tXPoexMF.js +0 -1
  233. package/dist/web/assets/TestManagement-wjGaoZzI.js +0 -1
  234. package/dist/web/assets/Tosca-C5YaMLS0.js +0 -3
  235. package/dist/web/assets/WhatsNew-CwnRbDnd.js +0 -1
  236. package/dist/web/assets/azuredevops-BcQ5AFOM.js +0 -1
  237. package/dist/web/assets/crew-CWfjZIxE.js +0 -1
  238. package/dist/web/assets/families-DWilSDct.js +0 -1
  239. package/dist/web/assets/filters-CVzIOjPG.js +0 -1
  240. package/dist/web/assets/fold-tvLGnxD1.js +0 -1
  241. package/dist/web/assets/frame-Deu1IqzV.js +0 -13
  242. package/dist/web/assets/index-BWMIKyPB.js +0 -76
  243. package/dist/web/assets/index-C2Yq55oT.css +0 -2
  244. package/dist/web/assets/line-icons-C_amZ5-o.js +0 -1
  245. package/dist/web/assets/logos-C1NBtBMc.js +0 -1
  246. package/dist/web/assets/logos-DFyhMw0i.js +0 -1
  247. package/dist/web/assets/markdown-DC2HA0yZ.js +0 -10
  248. package/dist/web/assets/paletteCommands-Qxm5DZIs.js +0 -1
  249. package/dist/web/assets/parts-BR6dUwqn.js +0 -1
  250. package/dist/web/assets/productParts-BxdHuSBa.js +0 -1
  251. package/dist/web/assets/qualityParts-lz6eYVxC.js +0 -1
  252. package/dist/web/assets/recordTest-CcplpTS6.js +0 -1
  253. package/dist/web/assets/today-DuQFapJM.js +0 -1
  254. package/dist/web/assets/when-CHnpLdYw.js +0 -1
@@ -1,76 +0,0 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/Features-CIBbw6PG.js","assets/line-icons-C_amZ5-o.js","assets/filters-CVzIOjPG.js","assets/frame-Deu1IqzV.js","assets/markdown-DC2HA0yZ.js","assets/WhatsNew-CwnRbDnd.js","assets/Chat-Bt6jZI68.js","assets/Choices-D5eTFinz.js","assets/logos-DFyhMw0i.js","assets/azuredevops-BcQ5AFOM.js","assets/when-CHnpLdYw.js","assets/Response-D9FYUvHg.js","assets/fold-tvLGnxD1.js","assets/poll-CHpac9Fb.js","assets/recordTest-CcplpTS6.js","assets/Reports-ClcY7M0Q.js","assets/families-DWilSDct.js","assets/Runs-CFvmdULI.js","assets/Record-Dnlkimjb.js","assets/DesktopReview--WjeZh3w.js","assets/AgentWork-C3KdZh5M.js","assets/Desktop-BofKeLVf.js","assets/Regression-D2DDTwzs.js","assets/PageAgent-txbNoP6u.js","assets/crew-CWfjZIxE.js","assets/Impact-jOSl5Q0k.js","assets/flowLayout-cXVJhLpH.js","assets/ApiTests-BLnl7JGO.js","assets/Migration-BBgv7xXo.js","assets/logos-C1NBtBMc.js","assets/parts-BR6dUwqn.js","assets/Tosca-C5YaMLS0.js","assets/Steps-BS66s0E1.js","assets/Compare-YfFYHwfK.js","assets/Quality-Dxh-60A8.js","assets/qualityParts-lz6eYVxC.js","assets/Flaky-Cut1kZw6.js","assets/RunDiff-CNImaEdz.js","assets/TestDebt-tXPoexMF.js","assets/TestManagement-wjGaoZzI.js","assets/Flags-B62v4uWR.js","assets/Production-CCVtFNGQ.js","assets/Cost-ClaDz0YR.js","assets/Explore-BdFvqgF4.js","assets/Readiness-DyJvSOLN.js","assets/TestCases-CrQEUtfD.js","assets/KindPage-BbQWH5wa.js","assets/Data-jSFgAfej.js","assets/TestData-e3IX0xwG.js","assets/Jobs-DMJGgWtQ.js","assets/Product-BrXH81Ns.js","assets/productParts-BxdHuSBa.js","assets/Product-DLioOiRN.css","assets/Evidence-CJNzSQpY.js","assets/Browse-C-Enjpmd.js","assets/today-DuQFapJM.js"])))=>i.map(i=>d[i]);
2
- import{$ as e,$n as t,$t as n,An as r,At as i,B as a,Bn as o,Ct as s,Dr as c,E as l,En as u,Et as d,Fn as f,G as p,Gt as m,H as h,In as g,Ir as _,It as v,J as y,Jn as b,Jt as x,K as S,Kn as C,L as w,Ln as T,Lr as E,Lt as D,M as O,Mn as ee,Mr as te,N as ne,Nn as k,Nr as A,Nt as j,O as M,On as re,Or as N,Ot as ie,Pt as ae,Qn as oe,R as P,Rn as se,Rr as ce,Sn as le,Sr as F,St as ue,Tt as de,U as fe,Un as pe,V as me,Vt as he,W as ge,Wn as _e,Wt as ve,Xn as ye,Y as I,_n as be,_t as xe,a as Se,ar as Ce,at as we,bn as Te,br as Ee,cn as De,ct as Oe,dt as ke,en as Ae,er as je,f as Me,fn as Ne,ft as Pe,gn as Fe,gr as Ie,gt as Le,ir as Re,j as ze,jn as Be,jr as Ve,jt as He,k as Ue,kt as We,l as Ge,m as Ke,mn as qe,nr as Je,nt as Ye,o as Xe,on as Ze,ot as Qe,pr as $e,pt as et,qn as tt,r as nt,s as rt,sn as it,sr as at,tn as ot,u as st,ut as ct,v as lt,vt as ut,w as dt,wr as ft,wt as pt,xr as mt,xt as ht,y as gt,yr as _t,zr as vt,zt as yt}from"./line-icons-C_amZ5-o.js";import{$ as bt,$t as xt,At as St,B as Ct,Bt as wt,Ct as Tt,Et,G as Dt,Gt as Ot,H as kt,Ht as At,J as jt,K as Mt,Kt as Nt,Mt as Pt,Ot as Ft,Q as It,U as Lt,V as L,Vt as Rt,W as zt,Wt as Bt,Xt as Vt,Z as Ht,Zt as Ut,a as R,at as Wt,c as z,ct as Gt,d as Kt,dt as qt,en as Jt,et as Yt,f as Xt,g as Zt,gt as Qt,h as $t,i as en,it as tn,l as nn,lt as rn,m as an,mt as on,n as sn,nt as cn,o as ln,p as B,q as un,qt as dn,r as fn,s as pn,st as mn,t as hn,u as gn,ut as _n,v as vn,vt as yn,xt as bn,z as V,zt as xn}from"./filters-CVzIOjPG.js";import{$ as Sn,$t as Cn,A as wn,An as Tn,At as En,B as Dn,Bn as On,Bt as kn,C as An,Cn as jn,Ct as Mn,D as Nn,Dn as Pn,E as Fn,En as In,Fn as Ln,G as Rn,Gn as zn,H,Hn as Bn,Ht as Vn,I as Hn,In as Un,It as Wn,J as Gn,Jn as Kn,Jt as qn,K as Jn,Kn as Yn,Kt as Xn,Ln as Zn,Mn as Qn,Nn as $n,Nt as er,O as tr,On as nr,P as rr,Pn as ir,Q as ar,R as or,Rn as sr,Rt as cr,S as lr,Sn as ur,St as dr,T as fr,Tn as pr,Tt as mr,U as hr,Un as gr,Ut as _r,V as U,Vn as vr,Vt as yr,W as br,Wn as xr,X as Sr,Y as Cr,Yn as wr,Yt as Tr,Z as Er,Zn as Dr,_n as Or,_t as kr,a as Ar,an as jr,at as Mr,bn as Nr,bt as Pr,cn as Fr,ct as Ir,d as Lr,dn as Rr,en as zr,et as Br,f as Vr,fn as Hr,ft as Ur,gn as Wr,gt as W,hn as Gr,ht as Kr,i as qr,in as Jr,it as Yr,jn as Xr,k as Zr,l as Qr,ln as $r,mn as ei,mt as ti,nn as ni,nt as ri,o as ii,ot as ai,pn as oi,pt as si,q as ci,qn as li,rn as ui,rt as di,s as fi,sn as pi,st as mi,t as hi,tn as gi,tt as _i,u as vi,un as yi,ut as bi,vn as xi,vt as Si,w as Ci,wn as G,wt as wi,xn as Ti,xt as Ei,yn as Di,yt as K,z as Oi,zn as ki,zt as Ai}from"./frame-Deu1IqzV.js";import{t as ji}from"./crew-CWfjZIxE.js";import{a as Mi,c as Ni,d as Pi,i as Fi,l as Ii,m as Li,n as Ri,o as zi,p as Bi,s as Vi,t as Hi,u as Ui}from"./Choices-D5eTFinz.js";import{i as Wi,n as Gi,r as Ki}from"./today-DuQFapJM.js";import{a as qi,f as Ji,i as Yi,n as Xi,r as Zi,t as Qi}from"./logos-DFyhMw0i.js";import{o as $i,r as ea}from"./markdown-DC2HA0yZ.js";import{t as ta}from"./when-CHnpLdYw.js";(function(){let e=document.createElement(`link`).relList;if(e&&e.supports&&e.supports(`modulepreload`))return;for(let e of document.querySelectorAll(`link[rel="modulepreload"]`))n(e);new MutationObserver(e=>{for(let t of e)if(t.type===`childList`)for(let e of t.addedNodes)e.tagName===`LINK`&&e.rel===`modulepreload`&&n(e)}).observe(document,{childList:!0,subtree:!0});function t(e){let t={};return e.integrity&&(t.integrity=e.integrity),e.referrerPolicy&&(t.referrerPolicy=e.referrerPolicy),t.credentials=e.crossOrigin===`use-credentials`?`include`:e.crossOrigin===`anonymous`?`omit`:`same-origin`,t}function n(e){if(e.ep)return;e.ep=!0;let n=t(e);fetch(e.href,n)}})();var na=E((e=>{function t(e,t){var n=e.length;e.push(t);a:for(;0<n;){var r=n-1>>>1,a=e[r];if(0<i(a,t))e[r]=t,e[n]=a,n=r;else break a}}function n(e){return e.length===0?null:e[0]}function r(e){if(e.length===0)return null;var t=e[0],n=e.pop();if(n!==t){e[0]=n;a:for(var r=0,a=e.length,o=a>>>1;r<o;){var s=2*(r+1)-1,c=e[s],l=s+1,u=e[l];if(0>i(c,n))l<a&&0>i(u,c)?(e[r]=u,e[l]=n,r=l):(e[r]=c,e[s]=n,r=s);else if(l<a&&0>i(u,n))e[r]=u,e[l]=n,r=l;else break a}}return t}function i(e,t){var n=e.sortIndex-t.sortIndex;return n===0?e.id-t.id:n}if(e.unstable_now=void 0,typeof performance==`object`&&typeof performance.now==`function`){var a=performance;e.unstable_now=function(){return a.now()}}else{var o=Date,s=o.now();e.unstable_now=function(){return o.now()-s}}var c=[],l=[],u=1,d=null,f=3,p=!1,m=!1,h=!1,g=!1,_=typeof setTimeout==`function`?setTimeout:null,v=typeof clearTimeout==`function`?clearTimeout:null,y=typeof setImmediate<`u`?setImmediate:null;function b(e){for(var i=n(l);i!==null;){if(i.callback===null)r(l);else if(i.startTime<=e)r(l),i.sortIndex=i.expirationTime,t(c,i);else break;i=n(l)}}function x(e){if(h=!1,b(e),!m){if(n(c)!==null)m=!0,S||(S=!0,O());else{var t=n(l);t!==null&&ne(x,t.startTime-e)}}}var S=!1,C=-1,w=5,T=-1;function E(){return g?!0:!(e.unstable_now()-T<w)}function D(){if(g=!1,S){var t=e.unstable_now();T=t;var i=!0;try{a:{m=!1,h&&(h=!1,v(C),C=-1),p=!0;var a=f;try{b:{for(b(t),d=n(c);d!==null&&!(d.expirationTime>t&&E());){var o=d.callback;if(typeof o==`function`){d.callback=null,f=d.priorityLevel;var s=o(d.expirationTime<=t);if(t=e.unstable_now(),typeof s==`function`){d.callback=s,b(t),i=!0;break b}d===n(c)&&r(c),b(t)}else r(c);d=n(c)}if(d!==null)i=!0;else{var u=n(l);u!==null&&ne(x,u.startTime-t),i=!1}}break a}finally{d=null,f=a,p=!1}i=void 0}}finally{i?O():S=!1}}}var O;if(typeof y==`function`)O=function(){y(D)};else if(typeof MessageChannel<`u`){var ee=new MessageChannel,te=ee.port2;ee.port1.onmessage=D,O=function(){te.postMessage(null)}}else O=function(){_(D,0)};function ne(t,n){C=_(function(){t(e.unstable_now())},n)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(e){e.callback=null},e.unstable_forceFrameRate=function(e){0>e||125<e?console.error(`forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported`):w=0<e?Math.floor(1e3/e):5},e.unstable_getCurrentPriorityLevel=function(){return f},e.unstable_next=function(e){switch(f){case 1:case 2:case 3:var t=3;break;default:t=f}var n=f;f=t;try{return e()}finally{f=n}},e.unstable_requestPaint=function(){g=!0},e.unstable_runWithPriority=function(e,t){switch(e){case 1:case 2:case 3:case 4:case 5:break;default:e=3}var n=f;f=e;try{return t()}finally{f=n}},e.unstable_scheduleCallback=function(r,i,a){var o=e.unstable_now();switch(typeof a==`object`&&a?(a=a.delay,a=typeof a==`number`&&0<a?o+a:o):a=o,r){case 1:var s=-1;break;case 2:s=250;break;case 5:s=1073741823;break;case 4:s=1e4;break;default:s=5e3}return s=a+s,r={id:u++,callback:i,priorityLevel:r,startTime:a,expirationTime:s,sortIndex:-1},a>o?(r.sortIndex=a,t(l,r),n(c)===null&&r===n(l)&&(h?(v(C),C=-1):h=!0,ne(x,a-o))):(r.sortIndex=s,t(c,r),m||p||(m=!0,S||(S=!0,O()))),r},e.unstable_shouldYield=E,e.unstable_wrapCallback=function(e){var t=f;return function(){var n=f;f=t;try{return e.apply(this,arguments)}finally{f=n}}}})),ra=E(((e,t)=>{t.exports=na()})),ia=E((e=>{var t=ra(),n=_(),r=Jt();function i(e){var t=`https://react.dev/errors/`+e;if(1<arguments.length){t+=`?args[]=`+encodeURIComponent(arguments[1]);for(var n=2;n<arguments.length;n++)t+=`&args[]=`+encodeURIComponent(arguments[n])}return`Minified React error #`+e+`; visit `+t+` for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`}function a(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function o(e){var t=e,n=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,t.flags&4098&&(n=t.return),e=t.return;while(e)}return t.tag===3?n:null}function s(e){if(e.tag===13){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function c(e){if(e.tag===31){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function l(e){if(o(e)!==e)throw Error(i(188))}function u(e){var t=e.alternate;if(!t){if(t=o(e),t===null)throw Error(i(188));return t===e?e:null}for(var n=e,r=t;;){var a=n.return;if(a===null)break;var s=a.alternate;if(s===null){if(r=a.return,r!==null){n=r;continue}break}if(a.child===s.child){for(s=a.child;s;){if(s===n)return l(a),e;if(s===r)return l(a),t;s=s.sibling}throw Error(i(188))}if(n.return!==r.return)n=a,r=s;else{for(var c=!1,u=a.child;u;){if(u===n){c=!0,n=a,r=s;break}if(u===r){c=!0,r=a,n=s;break}u=u.sibling}if(!c){for(u=s.child;u;){if(u===n){c=!0,n=s,r=a;break}if(u===r){c=!0,r=s,n=a;break}u=u.sibling}if(!c)throw Error(i(189))}}if(n.alternate!==r)throw Error(i(190))}if(n.tag!==3)throw Error(i(188));return n.stateNode.current===n?e:t}function d(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e;for(e=e.child;e!==null;){if(t=d(e),t!==null)return t;e=e.sibling}return null}var f=Object.assign,p=Symbol.for(`react.element`),m=Symbol.for(`react.transitional.element`),h=Symbol.for(`react.portal`),g=Symbol.for(`react.fragment`),v=Symbol.for(`react.strict_mode`),y=Symbol.for(`react.profiler`),b=Symbol.for(`react.consumer`),x=Symbol.for(`react.context`),S=Symbol.for(`react.forward_ref`),C=Symbol.for(`react.suspense`),w=Symbol.for(`react.suspense_list`),T=Symbol.for(`react.memo`),E=Symbol.for(`react.lazy`),D=Symbol.for(`react.activity`),O=Symbol.for(`react.memo_cache_sentinel`),ee=Symbol.iterator;function te(e){return typeof e!=`object`||!e?null:(e=ee&&e[ee]||e[`@@iterator`],typeof e==`function`?e:null)}var ne=Symbol.for(`react.client.reference`);function k(e){if(e==null)return null;if(typeof e==`function`)return e.$$typeof===ne?null:e.displayName||e.name||null;if(typeof e==`string`)return e;switch(e){case g:return`Fragment`;case y:return`Profiler`;case v:return`StrictMode`;case C:return`Suspense`;case w:return`SuspenseList`;case D:return`Activity`}if(typeof e==`object`)switch(e.$$typeof){case h:return`Portal`;case x:return e.displayName||`Context`;case b:return(e._context.displayName||`Context`)+`.Consumer`;case S:var t=e.render;return e=e.displayName,e||=(e=t.displayName||t.name||``,e===``?`ForwardRef`:`ForwardRef(`+e+`)`),e;case T:return t=e.displayName||null,t===null?k(e.type)||`Memo`:t;case E:t=e._payload,e=e._init;try{return k(e(t))}catch{}}return null}var A=Array.isArray,j=n.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,M=r.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,re={pending:!1,data:null,method:null,action:null},N=[],ie=-1;function ae(e){return{current:e}}function oe(e){0>ie||(e.current=N[ie],N[ie]=null,ie--)}function P(e,t){ie++,N[ie]=e.current,e.current=t}var se=ae(null),ce=ae(null),le=ae(null),F=ae(null);function ue(e,t){switch(P(le,t),P(ce,e),P(se,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?Vd(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=Vd(t),e=Hd(t,e);else switch(e){case`svg`:e=1;break;case`math`:e=2;break;default:e=0}}oe(se),P(se,e)}function de(){oe(se),oe(ce),oe(le)}function fe(e){e.memoizedState!==null&&P(F,e);var t=se.current,n=Hd(t,e.type);t!==n&&(P(ce,e),P(se,n))}function pe(e){ce.current===e&&(oe(se),oe(ce)),F.current===e&&(oe(F),Qf._currentValue=re)}var me,he;function ge(e){if(me===void 0)try{throw Error()}catch(e){var t=e.stack.trim().match(/\n( *(at )?)/);me=t&&t[1]||``,he=-1<e.stack.indexOf(`
3
- at`)?` (<anonymous>)`:-1<e.stack.indexOf(`@`)?`@unknown:0:0`:``}return`
4
- `+me+e+he}var _e=!1;function ve(e,t){if(!e||_e)return``;_e=!0;var n=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var r={DetermineComponentFrameRoot:function(){try{if(t){var n=function(){throw Error()};if(Object.defineProperty(n.prototype,"props",{set:function(){throw Error()}}),typeof Reflect==`object`&&Reflect.construct){try{Reflect.construct(n,[])}catch(e){var r=e}Reflect.construct(e,[],n)}else{try{n.call()}catch(e){r=e}e.call(n.prototype)}}else{try{throw Error()}catch(e){r=e}(n=e())&&typeof n.catch==`function`&&n.catch(function(){})}}catch(e){if(e&&r&&typeof e.stack==`string`)return[e.stack,r.stack]}return[null,null]}};r.DetermineComponentFrameRoot.displayName=`DetermineComponentFrameRoot`;var i=Object.getOwnPropertyDescriptor(r.DetermineComponentFrameRoot,`name`);i&&i.configurable&&Object.defineProperty(r.DetermineComponentFrameRoot,"name",{value:`DetermineComponentFrameRoot`});var a=r.DetermineComponentFrameRoot(),o=a[0],s=a[1];if(o&&s){var c=o.split(`
5
- `),l=s.split(`
6
- `);for(i=r=0;r<c.length&&!c[r].includes(`DetermineComponentFrameRoot`);)r++;for(;i<l.length&&!l[i].includes(`DetermineComponentFrameRoot`);)i++;if(r===c.length||i===l.length)for(r=c.length-1,i=l.length-1;1<=r&&0<=i&&c[r]!==l[i];)i--;for(;1<=r&&0<=i;r--,i--)if(c[r]!==l[i]){if(r!==1||i!==1)do if(r--,i--,0>i||c[r]!==l[i]){var u=`
7
- `+c[r].replace(` at new `,` at `);return e.displayName&&u.includes(`<anonymous>`)&&(u=u.replace(`<anonymous>`,e.displayName)),u}while(1<=r&&0<=i);break}}}finally{_e=!1,Error.prepareStackTrace=n}return(n=e?e.displayName||e.name:``)?ge(n):``}function ye(e,t){switch(e.tag){case 26:case 27:case 5:return ge(e.type);case 16:return ge(`Lazy`);case 13:return e.child!==t&&t!==null?ge(`Suspense Fallback`):ge(`Suspense`);case 19:return ge(`SuspenseList`);case 0:case 15:return ve(e.type,!1);case 11:return ve(e.type.render,!1);case 1:return ve(e.type,!0);case 31:return ge(`Activity`);default:return``}}function I(e){try{var t=``,n=null;do t+=ye(e,n),n=e,e=e.return;while(e);return t}catch(e){return`
8
- Error generating stack: `+e.message+`
9
- `+e.stack}}var be=Object.prototype.hasOwnProperty,xe=t.unstable_scheduleCallback,Se=t.unstable_cancelCallback,Ce=t.unstable_shouldYield,we=t.unstable_requestPaint,Te=t.unstable_now,Ee=t.unstable_getCurrentPriorityLevel,De=t.unstable_ImmediatePriority,Oe=t.unstable_UserBlockingPriority,ke=t.unstable_NormalPriority,Ae=t.unstable_LowPriority,je=t.unstable_IdlePriority,Me=t.log,Ne=t.unstable_setDisableYieldValue,Pe=null,Fe=null;function Ie(e){if(typeof Me==`function`&&Ne(e),Fe&&typeof Fe.setStrictMode==`function`)try{Fe.setStrictMode(Pe,e)}catch{}}var Le=Math.clz32?Math.clz32:Be,Re=Math.log,ze=Math.LN2;function Be(e){return e>>>=0,e===0?32:31-(Re(e)/ze|0)|0}var Ve=256,He=262144,Ue=4194304;function We(e){var t=e&42;if(t!==0)return t;switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return e&261888;case 262144:case 524288:case 1048576:case 2097152:return e&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return e&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return e}}function Ge(e,t,n){var r=e.pendingLanes;if(r===0)return 0;var i=0,a=e.suspendedLanes,o=e.pingedLanes;e=e.warmLanes;var s=r&134217727;return s===0?(s=r&~a,s===0?o===0?n||(n=r&~e,n!==0&&(i=We(n))):i=We(o):i=We(s)):(r=s&~a,r===0?(o&=s,o===0?n||(n=s&~e,n!==0&&(i=We(n))):i=We(o)):i=We(r)),i===0?0:t!==0&&t!==i&&(t&a)===0&&(a=i&-i,n=t&-t,a>=n||a===32&&n&4194048)?t:i}function Ke(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function qe(e,t){switch(e){case 1:case 2:case 4:case 8:case 64:return t+250;case 16:case 32:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return t+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function Je(){var e=Ue;return Ue<<=1,!(Ue&62914560)&&(Ue=4194304),e}function Ye(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function Xe(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function Ze(e,t,n,r,i,a){var o=e.pendingLanes;e.pendingLanes=n,e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0,e.expiredLanes&=n,e.entangledLanes&=n,e.errorRecoveryDisabledLanes&=n,e.shellSuspendCounter=0;var s=e.entanglements,c=e.expirationTimes,l=e.hiddenUpdates;for(n=o&~n;0<n;){var u=31-Le(n),d=1<<u;s[u]=0,c[u]=-1;var f=l[u];if(f!==null)for(l[u]=null,u=0;u<f.length;u++){var p=f[u];p!==null&&(p.lane&=-536870913)}n&=~d}r!==0&&Qe(e,r,0),a!==0&&i===0&&e.tag!==0&&(e.suspendedLanes|=a&~(o&~t))}function Qe(e,t,n){e.pendingLanes|=t,e.suspendedLanes&=~t;var r=31-Le(t);e.entangledLanes|=t,e.entanglements[r]=e.entanglements[r]|1073741824|n&261930}function $e(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var r=31-Le(n),i=1<<r;i&t|e[r]&t&&(e[r]|=t),n&=~i}}function et(e,t){var n=t&-t;return n=n&42?1:tt(n),(n&(e.suspendedLanes|t))===0?n:0}function tt(e){switch(e){case 2:e=1;break;case 8:e=4;break;case 32:e=16;break;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:e=128;break;case 268435456:e=134217728;break;default:e=0}return e}function nt(e){return e&=-e,2<e?8<e?e&134217727?32:268435456:8:2}function rt(){var e=M.p;return e===0?(e=window.event,e===void 0?32:mp(e.type)):e}function it(e,t){var n=M.p;try{return M.p=e,t()}finally{M.p=n}}var at=Math.random().toString(36).slice(2),ot=`__reactFiber$`+at,st=`__reactProps$`+at,ct=`__reactContainer$`+at,lt=`__reactEvents$`+at,ut=`__reactListeners$`+at,dt=`__reactHandles$`+at,ft=`__reactResources$`+at,pt=`__reactMarker$`+at;function mt(e){delete e[ot],delete e[st],delete e[lt],delete e[ut],delete e[dt]}function ht(e){var t=e[ot];if(t)return t;for(var n=e.parentNode;n;){if(t=n[ct]||n[ot]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=df(e);e!==null;){if(n=e[ot])return n;e=df(e)}return t}e=n,n=e.parentNode}return null}function gt(e){if(e=e[ot]||e[ct]){var t=e.tag;if(t===5||t===6||t===13||t===31||t===26||t===27||t===3)return e}return null}function _t(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e.stateNode;throw Error(i(33))}function vt(e){var t=e[ft];return t||=e[ft]={hoistableStyles:new Map,hoistableScripts:new Map},t}function yt(e){e[pt]=!0}var bt=new Set,xt={};function St(e,t){Ct(e,t),Ct(e+`Capture`,t)}function Ct(e,t){for(xt[e]=t,e=0;e<t.length;e++)bt.add(t[e])}var wt=RegExp(`^[:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD][:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*$`),Tt={},Et={};function Dt(e){return be.call(Et,e)?!0:be.call(Tt,e)?!1:wt.test(e)?Et[e]=!0:(Tt[e]=!0,!1)}function Ot(e,t,n){if(Dt(t)){if(n===null)e.removeAttribute(t);else{switch(typeof n){case`undefined`:case`function`:case`symbol`:e.removeAttribute(t);return;case`boolean`:var r=t.toLowerCase().slice(0,5);if(r!==`data-`&&r!==`aria-`){e.removeAttribute(t);return}}e.setAttribute(t,``+n)}}}function kt(e,t,n){if(n===null)e.removeAttribute(t);else{switch(typeof n){case`undefined`:case`function`:case`symbol`:case`boolean`:e.removeAttribute(t);return}e.setAttribute(t,``+n)}}function At(e,t,n,r){if(r===null)e.removeAttribute(n);else{switch(typeof r){case`undefined`:case`function`:case`symbol`:case`boolean`:e.removeAttribute(n);return}e.setAttributeNS(t,n,``+r)}}function jt(e){switch(typeof e){case`bigint`:case`boolean`:case`number`:case`string`:case`undefined`:return e;case`object`:return e;default:return``}}function Mt(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()===`input`&&(t===`checkbox`||t===`radio`)}function Nt(e,t,n){var r=Object.getOwnPropertyDescriptor(e.constructor.prototype,t);if(!e.hasOwnProperty(t)&&r!==void 0&&typeof r.get==`function`&&typeof r.set==`function`){var i=r.get,a=r.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return i.call(this)},set:function(e){n=``+e,a.call(this,e)}}),Object.defineProperty(e,t,{enumerable:r.enumerable}),{getValue:function(){return n},setValue:function(e){n=``+e},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function Pt(e){if(!e._valueTracker){var t=Mt(e)?`checked`:`value`;e._valueTracker=Nt(e,t,``+e[t])}}function Ft(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r=``;return e&&(r=Mt(e)?e.checked?`true`:`false`:e.value),e=r,e!==n&&(t.setValue(e),!0)}function It(e){if(e||=typeof document<`u`?document:void 0,e===void 0)return null;try{return e.activeElement||e.body}catch{return e.body}}var Lt=/[\n"\\]/g;function L(e){return e.replace(Lt,function(e){return`\\`+e.charCodeAt(0).toString(16)+` `})}function Rt(e,t,n,r,i,a,o,s){e.name=``,o!=null&&typeof o!=`function`&&typeof o!=`symbol`&&typeof o!=`boolean`?e.type=o:e.removeAttribute(`type`),t==null?o!==`submit`&&o!==`reset`||e.removeAttribute(`value`):o===`number`?(t===0&&e.value===``||e.value!=t)&&(e.value=``+jt(t)):e.value!==``+jt(t)&&(e.value=``+jt(t)),t==null?n==null?r!=null&&e.removeAttribute(`value`):Bt(e,o,jt(n)):Bt(e,o,jt(t)),i==null&&a!=null&&(e.defaultChecked=!!a),i!=null&&(e.checked=i&&typeof i!=`function`&&typeof i!=`symbol`),s!=null&&typeof s!=`function`&&typeof s!=`symbol`&&typeof s!=`boolean`?e.name=``+jt(s):e.removeAttribute(`name`)}function zt(e,t,n,r,i,a,o,s){if(a!=null&&typeof a!=`function`&&typeof a!=`symbol`&&typeof a!=`boolean`&&(e.type=a),t!=null||n!=null){if(!(a!==`submit`&&a!==`reset`||t!=null)){Pt(e);return}n=n==null?``:``+jt(n),t=t==null?n:``+jt(t),s||t===e.value||(e.value=t),e.defaultValue=t}r??=i,r=typeof r!=`function`&&typeof r!=`symbol`&&!!r,e.checked=s?e.checked:!!r,e.defaultChecked=!!r,o!=null&&typeof o!=`function`&&typeof o!=`symbol`&&typeof o!=`boolean`&&(e.name=o),Pt(e)}function Bt(e,t,n){t===`number`&&It(e.ownerDocument)===e||e.defaultValue===``+n||(e.defaultValue=``+n)}function Vt(e,t,n,r){if(e=e.options,t){t={};for(var i=0;i<n.length;i++)t[`$`+n[i]]=!0;for(n=0;n<e.length;n++)i=t.hasOwnProperty(`$`+e[n].value),e[n].selected!==i&&(e[n].selected=i),i&&r&&(e[n].defaultSelected=!0)}else{for(n=``+jt(n),t=null,i=0;i<e.length;i++){if(e[i].value===n){e[i].selected=!0,r&&(e[i].defaultSelected=!0);return}t!==null||e[i].disabled||(t=e[i])}t!==null&&(t.selected=!0)}}function Ht(e,t,n){t!=null&&(t=``+jt(t),t!==e.value&&(e.value=t),n==null)?e.defaultValue!==t&&(e.defaultValue=t):e.defaultValue=n==null?``:``+jt(n)}function Ut(e,t,n,r){if(t==null){if(r!=null){if(n!=null)throw Error(i(92));if(A(r)){if(1<r.length)throw Error(i(93));r=r[0]}n=r}n??=``,t=n}n=jt(t),e.defaultValue=n,r=e.textContent,r===n&&r!==``&&r!==null&&(e.value=r),Pt(e)}function R(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var Wt=new Set(`animationIterationCount aspectRatio borderImageOutset borderImageSlice borderImageWidth boxFlex boxFlexGroup boxOrdinalGroup columnCount columns flex flexGrow flexPositive flexShrink flexNegative flexOrder gridArea gridRow gridRowEnd gridRowSpan gridRowStart gridColumn gridColumnEnd gridColumnSpan gridColumnStart fontWeight lineClamp lineHeight opacity order orphans scale tabSize widows zIndex zoom fillOpacity floodOpacity stopOpacity strokeDasharray strokeDashoffset strokeMiterlimit strokeOpacity strokeWidth MozAnimationIterationCount MozBoxFlex MozBoxFlexGroup MozLineClamp msAnimationIterationCount msFlex msZoom msFlexGrow msFlexNegative msFlexOrder msFlexPositive msFlexShrink msGridColumn msGridColumnSpan msGridRow msGridRowSpan WebkitAnimationIterationCount WebkitBoxFlex WebKitBoxFlexGroup WebkitBoxOrdinalGroup WebkitColumnCount WebkitColumns WebkitFlex WebkitFlexGrow WebkitFlexPositive WebkitFlexShrink WebkitLineClamp`.split(` `));function z(e,t,n){var r=t.indexOf(`--`)===0;n==null||typeof n==`boolean`||n===``?r?e.setProperty(t,``):t===`float`?e.cssFloat=``:e[t]=``:r?e.setProperty(t,n):typeof n!=`number`||n===0||Wt.has(t)?t===`float`?e.cssFloat=n:e[t]=(``+n).trim():e[t]=n+`px`}function Gt(e,t,n){if(t!=null&&typeof t!=`object`)throw Error(i(62));if(e=e.style,n!=null){for(var r in n)!n.hasOwnProperty(r)||t!=null&&t.hasOwnProperty(r)||(r.indexOf(`--`)===0?e.setProperty(r,``):r===`float`?e.cssFloat=``:e[r]=``);for(var a in t)r=t[a],t.hasOwnProperty(a)&&n[a]!==r&&z(e,a,r)}else for(var o in t)t.hasOwnProperty(o)&&z(e,o,t[o])}function Kt(e){if(e.indexOf(`-`)===-1)return!1;switch(e){case`annotation-xml`:case`color-profile`:case`font-face`:case`font-face-src`:case`font-face-uri`:case`font-face-format`:case`font-face-name`:case`missing-glyph`:return!1;default:return!0}}var qt=new Map([[`acceptCharset`,`accept-charset`],[`htmlFor`,`for`],[`httpEquiv`,`http-equiv`],[`crossOrigin`,`crossorigin`],[`accentHeight`,`accent-height`],[`alignmentBaseline`,`alignment-baseline`],[`arabicForm`,`arabic-form`],[`baselineShift`,`baseline-shift`],[`capHeight`,`cap-height`],[`clipPath`,`clip-path`],[`clipRule`,`clip-rule`],[`colorInterpolation`,`color-interpolation`],[`colorInterpolationFilters`,`color-interpolation-filters`],[`colorProfile`,`color-profile`],[`colorRendering`,`color-rendering`],[`dominantBaseline`,`dominant-baseline`],[`enableBackground`,`enable-background`],[`fillOpacity`,`fill-opacity`],[`fillRule`,`fill-rule`],[`floodColor`,`flood-color`],[`floodOpacity`,`flood-opacity`],[`fontFamily`,`font-family`],[`fontSize`,`font-size`],[`fontSizeAdjust`,`font-size-adjust`],[`fontStretch`,`font-stretch`],[`fontStyle`,`font-style`],[`fontVariant`,`font-variant`],[`fontWeight`,`font-weight`],[`glyphName`,`glyph-name`],[`glyphOrientationHorizontal`,`glyph-orientation-horizontal`],[`glyphOrientationVertical`,`glyph-orientation-vertical`],[`horizAdvX`,`horiz-adv-x`],[`horizOriginX`,`horiz-origin-x`],[`imageRendering`,`image-rendering`],[`letterSpacing`,`letter-spacing`],[`lightingColor`,`lighting-color`],[`markerEnd`,`marker-end`],[`markerMid`,`marker-mid`],[`markerStart`,`marker-start`],[`overlinePosition`,`overline-position`],[`overlineThickness`,`overline-thickness`],[`paintOrder`,`paint-order`],[`panose-1`,`panose-1`],[`pointerEvents`,`pointer-events`],[`renderingIntent`,`rendering-intent`],[`shapeRendering`,`shape-rendering`],[`stopColor`,`stop-color`],[`stopOpacity`,`stop-opacity`],[`strikethroughPosition`,`strikethrough-position`],[`strikethroughThickness`,`strikethrough-thickness`],[`strokeDasharray`,`stroke-dasharray`],[`strokeDashoffset`,`stroke-dashoffset`],[`strokeLinecap`,`stroke-linecap`],[`strokeLinejoin`,`stroke-linejoin`],[`strokeMiterlimit`,`stroke-miterlimit`],[`strokeOpacity`,`stroke-opacity`],[`strokeWidth`,`stroke-width`],[`textAnchor`,`text-anchor`],[`textDecoration`,`text-decoration`],[`textRendering`,`text-rendering`],[`transformOrigin`,`transform-origin`],[`underlinePosition`,`underline-position`],[`underlineThickness`,`underline-thickness`],[`unicodeBidi`,`unicode-bidi`],[`unicodeRange`,`unicode-range`],[`unitsPerEm`,`units-per-em`],[`vAlphabetic`,`v-alphabetic`],[`vHanging`,`v-hanging`],[`vIdeographic`,`v-ideographic`],[`vMathematical`,`v-mathematical`],[`vectorEffect`,`vector-effect`],[`vertAdvY`,`vert-adv-y`],[`vertOriginX`,`vert-origin-x`],[`vertOriginY`,`vert-origin-y`],[`wordSpacing`,`word-spacing`],[`writingMode`,`writing-mode`],[`xmlnsXlink`,`xmlns:xlink`],[`xHeight`,`x-height`]]),Yt=/^[\u0000-\u001F ]*j[\r\n\t]*a[\r\n\t]*v[\r\n\t]*a[\r\n\t]*s[\r\n\t]*c[\r\n\t]*r[\r\n\t]*i[\r\n\t]*p[\r\n\t]*t[\r\n\t]*:/i;function Xt(e){return Yt.test(``+e)?`javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')`:e}function Zt(){}var Qt=null;function $t(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var en=null,tn=null;function nn(e){var t=gt(e);if(t&&(e=t.stateNode)){var n=e[st]||null;a:switch(e=t.stateNode,t.type){case`input`:if(Rt(e,n.value,n.defaultValue,n.defaultValue,n.checked,n.defaultChecked,n.type,n.name),t=n.name,n.type===`radio`&&t!=null){for(n=e;n.parentNode;)n=n.parentNode;for(n=n.querySelectorAll(`input[name="`+L(``+t)+`"][type="radio"]`),t=0;t<n.length;t++){var r=n[t];if(r!==e&&r.form===e.form){var a=r[st]||null;if(!a)throw Error(i(90));Rt(r,a.value,a.defaultValue,a.defaultValue,a.checked,a.defaultChecked,a.type,a.name)}}for(t=0;t<n.length;t++)r=n[t],r.form===e.form&&Ft(r)}break a;case`textarea`:Ht(e,n.value,n.defaultValue);break a;case`select`:t=n.value,t!=null&&Vt(e,!!n.multiple,t,!1)}}}var rn=!1;function an(e,t,n){if(rn)return e(t,n);rn=!0;try{return e(t)}finally{if(rn=!1,(en!==null||tn!==null)&&(vu(),en&&(t=en,e=tn,tn=en=null,nn(t),e)))for(t=0;t<e.length;t++)nn(e[t])}}function on(e,t){var n=e.stateNode;if(n===null)return null;var r=n[st]||null;if(r===null)return null;n=r[t];a:switch(t){case`onClick`:case`onClickCapture`:case`onDoubleClick`:case`onDoubleClickCapture`:case`onMouseDown`:case`onMouseDownCapture`:case`onMouseMove`:case`onMouseMoveCapture`:case`onMouseUp`:case`onMouseUpCapture`:case`onMouseEnter`:(r=!r.disabled)||(e=e.type,r=e!==`button`&&e!==`input`&&e!==`select`&&e!==`textarea`),e=!r;break a;default:e=!1}if(e)return null;if(n&&typeof n!=`function`)throw Error(i(231,t,typeof n));return n}var sn=typeof window<`u`&&window.document!==void 0&&window.document.createElement!==void 0,cn=!1;if(sn)try{var ln={};Object.defineProperty(ln,"passive",{get:function(){cn=!0}}),window.addEventListener(`test`,ln,ln),window.removeEventListener(`test`,ln,ln)}catch{cn=!1}var B=null,un=null,dn=null;function fn(){if(dn)return dn;var e,t=un,n=t.length,r,i=`value`in B?B.value:B.textContent,a=i.length;for(e=0;e<n&&t[e]===i[e];e++);var o=n-e;for(r=1;r<=o&&t[n-r]===i[a-r];r++);return dn=i.slice(e,1<r?1-r:void 0)}function pn(e){var t=e.keyCode;return`charCode`in e?(e=e.charCode,e===0&&t===13&&(e=13)):e=t,e===10&&(e=13),32<=e||e===13?e:0}function mn(){return!0}function hn(){return!1}function gn(e){function t(t,n,r,i,a){for(var o in this._reactName=t,this._targetInst=r,this.type=n,this.nativeEvent=i,this.target=a,this.currentTarget=null,e)e.hasOwnProperty(o)&&(t=e[o],this[o]=t?t(i):i[o]);return this.isDefaultPrevented=(i.defaultPrevented==null?!1===i.returnValue:i.defaultPrevented)?mn:hn,this.isPropagationStopped=hn,this}return f(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var e=this.nativeEvent;e&&(e.preventDefault?e.preventDefault():typeof e.returnValue!=`unknown`&&(e.returnValue=!1),this.isDefaultPrevented=mn)},stopPropagation:function(){var e=this.nativeEvent;e&&(e.stopPropagation?e.stopPropagation():typeof e.cancelBubble!=`unknown`&&(e.cancelBubble=!0),this.isPropagationStopped=mn)},persist:function(){},isPersistent:mn}),t}var _n={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},vn=gn(_n),yn=f({},_n,{view:0,detail:0}),bn=gn(yn),V,xn,Sn,Cn=f({},yn,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Pn,button:0,buttons:0,relatedTarget:function(e){return e.relatedTarget===void 0?e.fromElement===e.srcElement?e.toElement:e.fromElement:e.relatedTarget},movementX:function(e){return`movementX`in e?e.movementX:(e!==Sn&&(Sn&&e.type===`mousemove`?(V=e.screenX-Sn.screenX,xn=e.screenY-Sn.screenY):xn=V=0,Sn=e),V)},movementY:function(e){return`movementY`in e?e.movementY:xn}}),wn=gn(Cn),Tn=gn(f({},Cn,{dataTransfer:0})),En=gn(f({},yn,{relatedTarget:0})),Dn=gn(f({},_n,{animationName:0,elapsedTime:0,pseudoElement:0})),On=gn(f({},_n,{clipboardData:function(e){return`clipboardData`in e?e.clipboardData:window.clipboardData}})),kn=gn(f({},_n,{data:0})),An={Esc:`Escape`,Spacebar:` `,Left:`ArrowLeft`,Up:`ArrowUp`,Right:`ArrowRight`,Down:`ArrowDown`,Del:`Delete`,Win:`OS`,Menu:`ContextMenu`,Apps:`ContextMenu`,Scroll:`ScrollLock`,MozPrintableKey:`Unidentified`},jn={8:`Backspace`,9:`Tab`,12:`Clear`,13:`Enter`,16:`Shift`,17:`Control`,18:`Alt`,19:`Pause`,20:`CapsLock`,27:`Escape`,32:` `,33:`PageUp`,34:`PageDown`,35:`End`,36:`Home`,37:`ArrowLeft`,38:`ArrowUp`,39:`ArrowRight`,40:`ArrowDown`,45:`Insert`,46:`Delete`,112:`F1`,113:`F2`,114:`F3`,115:`F4`,116:`F5`,117:`F6`,118:`F7`,119:`F8`,120:`F9`,121:`F10`,122:`F11`,123:`F12`,144:`NumLock`,145:`ScrollLock`,224:`Meta`},Mn={Alt:`altKey`,Control:`ctrlKey`,Meta:`metaKey`,Shift:`shiftKey`};function Nn(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=Mn[e])?!!t[e]:!1}function Pn(){return Nn}var Fn=gn(f({},yn,{key:function(e){if(e.key){var t=An[e.key]||e.key;if(t!==`Unidentified`)return t}return e.type===`keypress`?(e=pn(e),e===13?`Enter`:String.fromCharCode(e)):e.type===`keydown`||e.type===`keyup`?jn[e.keyCode]||`Unidentified`:``},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Pn,charCode:function(e){return e.type===`keypress`?pn(e):0},keyCode:function(e){return e.type===`keydown`||e.type===`keyup`?e.keyCode:0},which:function(e){return e.type===`keypress`?pn(e):e.type===`keydown`||e.type===`keyup`?e.keyCode:0}})),In=gn(f({},Cn,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0})),Ln=gn(f({},yn,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Pn})),Rn=gn(f({},_n,{propertyName:0,elapsedTime:0,pseudoElement:0})),zn=gn(f({},Cn,{deltaX:function(e){return`deltaX`in e?e.deltaX:`wheelDeltaX`in e?-e.wheelDeltaX:0},deltaY:function(e){return`deltaY`in e?e.deltaY:`wheelDeltaY`in e?-e.wheelDeltaY:`wheelDelta`in e?-e.wheelDelta:0},deltaZ:0,deltaMode:0})),H=gn(f({},_n,{newState:0,oldState:0})),Bn=[9,13,27,32],Vn=sn&&`CompositionEvent`in window,Hn=null;sn&&`documentMode`in document&&(Hn=document.documentMode);var Un=sn&&`TextEvent`in window&&!Hn,Wn=sn&&(!Vn||Hn&&8<Hn&&11>=Hn),Gn=` `,Kn=!1;function qn(e,t){switch(e){case`keyup`:return Bn.indexOf(t.keyCode)!==-1;case`keydown`:return t.keyCode!==229;case`keypress`:case`mousedown`:case`focusout`:return!0;default:return!1}}function Jn(e){return e=e.detail,typeof e==`object`&&`data`in e?e.data:null}var Yn=!1;function Xn(e,t){switch(e){case`compositionend`:return Jn(t);case`keypress`:return t.which===32?(Kn=!0,Gn):null;case`textInput`:return e=t.data,e===Gn&&Kn?null:e;default:return null}}function Zn(e,t){if(Yn)return e===`compositionend`||!Vn&&qn(e,t)?(e=fn(),dn=un=B=null,Yn=!1,e):null;switch(e){case`paste`:return null;case`keypress`:if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1<t.char.length)return t.char;if(t.which)return String.fromCharCode(t.which)}return null;case`compositionend`:return Wn&&t.locale!==`ko`?null:t.data;default:return null}}var Qn={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};function $n(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t===`input`?!!Qn[e.type]:t===`textarea`}function er(e,t,n,r){en?tn?tn.push(r):tn=[r]:en=r,t=Td(t,`onChange`),0<t.length&&(n=new vn(`onChange`,`change`,null,n,r),e.push({event:n,listeners:t}))}var tr=null,nr=null;function rr(e){vd(e,0)}function ir(e){if(Ft(_t(e)))return e}function ar(e,t){if(e===`change`)return t}var or=!1;if(sn){var sr;if(sn){var cr=`oninput`in document;if(!cr){var lr=document.createElement(`div`);lr.setAttribute(`oninput`,`return;`),cr=typeof lr.oninput==`function`}sr=cr}else sr=!1;or=sr&&(!document.documentMode||9<document.documentMode)}function ur(){tr&&(tr.detachEvent(`onpropertychange`,dr),nr=tr=null)}function dr(e){if(e.propertyName===`value`&&ir(nr)){var t=[];er(t,nr,e,$t(e)),an(rr,t)}}function fr(e,t,n){e===`focusin`?(ur(),tr=t,nr=n,tr.attachEvent(`onpropertychange`,dr)):e===`focusout`&&ur()}function pr(e){if(e===`selectionchange`||e===`keyup`||e===`keydown`)return ir(nr)}function mr(e,t){if(e===`click`)return ir(t)}function hr(e,t){if(e===`input`||e===`change`)return ir(t)}function gr(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var _r=typeof Object.is==`function`?Object.is:gr;function U(e,t){if(_r(e,t))return!0;if(typeof e!=`object`||!e||typeof t!=`object`||!t)return!1;var n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(r=0;r<n.length;r++){var i=n[r];if(!be.call(t,i)||!_r(e[i],t[i]))return!1}return!0}function vr(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function yr(e,t){var n=vr(e);e=0;for(var r;n;){if(n.nodeType===3){if(r=e+n.textContent.length,e<=t&&r>=t)return{node:n,offset:t-e};e=r}a:{for(;n;){if(n.nextSibling){n=n.nextSibling;break a}n=n.parentNode}n=void 0}n=vr(n)}}function br(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?br(e,t.parentNode):`contains`in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function xr(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=It(e.document);t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href==`string`}catch{n=!1}if(n)e=t.contentWindow;else break;t=It(e.document)}return t}function Sr(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t===`input`&&(e.type===`text`||e.type===`search`||e.type===`tel`||e.type===`url`||e.type===`password`)||t===`textarea`||e.contentEditable===`true`)}var Cr=sn&&`documentMode`in document&&11>=document.documentMode,wr=null,Tr=null,Er=null,Dr=!1;function Or(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;Dr||wr==null||wr!==It(r)||(r=wr,`selectionStart`in r&&Sr(r)?r={start:r.selectionStart,end:r.selectionEnd}:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection(),r={anchorNode:r.anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset}),Er&&U(Er,r)||(Er=r,r=Td(Tr,`onSelect`),0<r.length&&(t=new vn(`onSelect`,`select`,null,t,n),e.push({event:t,listeners:r}),t.target=wr)))}function kr(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n[`Webkit`+e]=`webkit`+t,n[`Moz`+e]=`moz`+t,n}var Ar={animationend:kr(`Animation`,`AnimationEnd`),animationiteration:kr(`Animation`,`AnimationIteration`),animationstart:kr(`Animation`,`AnimationStart`),transitionrun:kr(`Transition`,`TransitionRun`),transitionstart:kr(`Transition`,`TransitionStart`),transitioncancel:kr(`Transition`,`TransitionCancel`),transitionend:kr(`Transition`,`TransitionEnd`)},jr={},Mr={};sn&&(Mr=document.createElement(`div`).style,`AnimationEvent`in window||(delete Ar.animationend.animation,delete Ar.animationiteration.animation,delete Ar.animationstart.animation),`TransitionEvent`in window||delete Ar.transitionend.transition);function Nr(e){if(jr[e])return jr[e];if(!Ar[e])return e;var t=Ar[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in Mr)return jr[e]=t[n];return e}var Pr=Nr(`animationend`),Fr=Nr(`animationiteration`),Ir=Nr(`animationstart`),Lr=Nr(`transitionrun`),Rr=Nr(`transitionstart`),zr=Nr(`transitioncancel`),Br=Nr(`transitionend`),Vr=new Map,Hr=`abort auxClick beforeToggle cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel`.split(` `);Hr.push(`scrollEnd`);function Ur(e,t){Vr.set(e,t),St(t,[e])}var Wr=typeof reportError==`function`?reportError:function(e){if(typeof window==`object`&&typeof window.ErrorEvent==`function`){var t=new window.ErrorEvent(`error`,{bubbles:!0,cancelable:!0,message:typeof e==`object`&&e&&typeof e.message==`string`?String(e.message):String(e),error:e});if(!window.dispatchEvent(t))return}else if(typeof process==`object`&&typeof process.emit==`function`){process.emit(`uncaughtException`,e);return}console.error(e)},W=[],Gr=0,Kr=0;function qr(){for(var e=Gr,t=Kr=Gr=0;t<e;){var n=W[t];W[t++]=null;var r=W[t];W[t++]=null;var i=W[t];W[t++]=null;var a=W[t];if(W[t++]=null,r!==null&&i!==null){var o=r.pending;o===null?i.next=i:(i.next=o.next,o.next=i),r.pending=i}a!==0&&Zr(n,i,a)}}function Jr(e,t,n,r){W[Gr++]=e,W[Gr++]=t,W[Gr++]=n,W[Gr++]=r,Kr|=r,e.lanes|=r,e=e.alternate,e!==null&&(e.lanes|=r)}function Yr(e,t,n,r){return Jr(e,t,n,r),Qr(e)}function Xr(e,t){return Jr(e,null,null,t),Qr(e)}function Zr(e,t,n){e.lanes|=n;var r=e.alternate;r!==null&&(r.lanes|=n);for(var i=!1,a=e.return;a!==null;)a.childLanes|=n,r=a.alternate,r!==null&&(r.childLanes|=n),a.tag===22&&(e=a.stateNode,e===null||e._visibility&1||(i=!0)),e=a,a=a.return;return e.tag===3?(a=e.stateNode,i&&t!==null&&(i=31-Le(n),e=a.hiddenUpdates,r=e[i],r===null?e[i]=[t]:r.push(t),t.lane=n|536870912),a):null}function Qr(e){if(50<lu)throw lu=0,uu=null,Error(i(185));for(var t=e.return;t!==null;)e=t,t=e.return;return e.tag===3?e.stateNode:null}var $r={};function ei(e,t,n,r){this.tag=e,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function ti(e,t,n,r){return new ei(e,t,n,r)}function ni(e){return e=e.prototype,!(!e||!e.isReactComponent)}function ri(e,t){var n=e.alternate;return n===null?(n=ti(e.tag,t,e.key,e.mode),n.elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.type=e.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=e.flags&65011712,n.childLanes=e.childLanes,n.lanes=e.lanes,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n.refCleanup=e.refCleanup,n}function ii(e,t){e.flags&=65011714;var n=e.alternate;return n===null?(e.childLanes=0,e.lanes=t,e.child=null,e.subtreeFlags=0,e.memoizedProps=null,e.memoizedState=null,e.updateQueue=null,e.dependencies=null,e.stateNode=null):(e.childLanes=n.childLanes,e.lanes=n.lanes,e.child=n.child,e.subtreeFlags=0,e.deletions=null,e.memoizedProps=n.memoizedProps,e.memoizedState=n.memoizedState,e.updateQueue=n.updateQueue,e.type=n.type,t=n.dependencies,e.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext}),e}function ai(e,t,n,r,a,o){var s=0;if(r=e,typeof e==`function`)ni(e)&&(s=1);else if(typeof e==`string`)s=Uf(e,n,se.current)?26:e===`html`||e===`head`||e===`body`?27:5;else a:switch(e){case D:return e=ti(31,n,t,a),e.elementType=D,e.lanes=o,e;case g:return oi(n.children,a,o,t);case v:s=8,a|=24;break;case y:return e=ti(12,n,t,a|2),e.elementType=y,e.lanes=o,e;case C:return e=ti(13,n,t,a),e.elementType=C,e.lanes=o,e;case w:return e=ti(19,n,t,a),e.elementType=w,e.lanes=o,e;default:if(typeof e==`object`&&e)switch(e.$$typeof){case x:s=10;break a;case b:s=9;break a;case S:s=11;break a;case T:s=14;break a;case E:s=16,r=null;break a}s=29,n=Error(i(130,e===null?`null`:typeof e,``)),r=null}return t=ti(s,n,t,a),t.elementType=e,t.type=r,t.lanes=o,t}function oi(e,t,n,r){return e=ti(7,e,r,t),e.lanes=n,e}function si(e,t,n){return e=ti(6,e,null,t),e.lanes=n,e}function ci(e){var t=ti(18,null,null,0);return t.stateNode=e,t}function li(e,t,n){return t=ti(4,e.children===null?[]:e.children,e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}var ui=new WeakMap;function di(e,t){if(typeof e==`object`&&e){var n=ui.get(e);return n===void 0?(t={value:e,source:t,stack:I(t)},ui.set(e,t),t):n}return{value:e,source:t,stack:I(t)}}var fi=[],pi=0,mi=null,hi=0,gi=[],_i=0,vi=null,yi=1,bi=``;function xi(e,t){fi[pi++]=hi,fi[pi++]=mi,mi=e,hi=t}function Si(e,t,n){gi[_i++]=yi,gi[_i++]=bi,gi[_i++]=vi,vi=e;var r=yi;e=bi;var i=32-Le(r)-1;r&=~(1<<i),n+=1;var a=32-Le(t)+i;if(30<a){var o=i-i%5;a=(r&(1<<o)-1).toString(32),r>>=o,i-=o,yi=1<<32-Le(t)+i|n<<i|r,bi=a+e}else yi=1<<a|n<<i|r,bi=e}function Ci(e){e.return!==null&&(xi(e,1),Si(e,1,0))}function G(e){for(;e===mi;)mi=fi[--pi],fi[pi]=null,hi=fi[--pi],fi[pi]=null;for(;e===vi;)vi=gi[--_i],gi[_i]=null,bi=gi[--_i],gi[_i]=null,yi=gi[--_i],gi[_i]=null}function wi(e,t){gi[_i++]=yi,gi[_i++]=bi,gi[_i++]=vi,yi=t.id,bi=t.overflow,vi=e}var Ti=null,Ei=null,Di=!1,K=null,Oi=!1,ki=Error(i(519));function Ai(e){throw Ii(di(Error(i(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?`text`:`HTML`,``)),e)),ki}function ji(e){var t=e.stateNode,n=e.type,r=e.memoizedProps;switch(t[ot]=e,t[st]=r,n){case`dialog`:$(`cancel`,t),$(`close`,t);break;case`iframe`:case`object`:case`embed`:$(`load`,t);break;case`video`:case`audio`:for(n=0;n<gd.length;n++)$(gd[n],t);break;case`source`:$(`error`,t);break;case`img`:case`image`:case`link`:$(`error`,t),$(`load`,t);break;case`details`:$(`toggle`,t);break;case`input`:$(`invalid`,t),zt(t,r.value,r.defaultValue,r.checked,r.defaultChecked,r.type,r.name,!0);break;case`select`:$(`invalid`,t);break;case`textarea`:$(`invalid`,t),Ut(t,r.value,r.defaultValue,r.children)}n=r.children,typeof n!=`string`&&typeof n!=`number`&&typeof n!=`bigint`||t.textContent===``+n||!0===r.suppressHydrationWarning||jd(t.textContent,n)?(r.popover!=null&&($(`beforetoggle`,t),$(`toggle`,t)),r.onScroll!=null&&$(`scroll`,t),r.onScrollEnd!=null&&$(`scrollend`,t),r.onClick!=null&&(t.onclick=Zt),t=!0):t=!1,t||Ai(e,!0)}function Mi(e){for(Ti=e.return;Ti;)switch(Ti.tag){case 5:case 31:case 13:Oi=!1;return;case 27:case 3:Oi=!0;return;default:Ti=Ti.return}}function Ni(e){if(e!==Ti)return!1;if(!Di)return Mi(e),Di=!0,!1;var t=e.tag,n;if((n=t!==3&&t!==27)&&((n=t===5)&&(n=e.type,n=n===`form`||n===`button`||Ud(e.type,e.memoizedProps)),n=!n),n&&Ei&&Ai(e),Mi(e),t===13){if(e=e.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(i(317));Ei=uf(e)}else if(t===31){if(e=e.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(i(317));Ei=uf(e)}else t===27?(t=Ei,Zd(e.type)?(e=lf,lf=null,Ei=e):Ei=t):Ei=Ti?cf(e.stateNode.nextSibling):null;return!0}function Pi(){Ei=Ti=null,Di=!1}function Fi(){var e=K;return e!==null&&(Yl===null?Yl=e:Yl.push.apply(Yl,e),K=null),e}function Ii(e){K===null?K=[e]:K.push(e)}var Li=ae(null),Ri=null,zi=null;function Bi(e,t,n){P(Li,t._currentValue),t._currentValue=n}function Vi(e){e._currentValue=Li.current,oe(Li)}function Hi(e,t,n){for(;e!==null;){var r=e.alternate;if((e.childLanes&t)===t?r!==null&&(r.childLanes&t)!==t&&(r.childLanes|=t):(e.childLanes|=t,r!==null&&(r.childLanes|=t)),e===n)break;e=e.return}}function Ui(e,t,n,r){var a=e.child;for(a!==null&&(a.return=e);a!==null;){var o=a.dependencies;if(o!==null){var s=a.child;o=o.firstContext;a:for(;o!==null;){var c=o;o=a;for(var l=0;l<t.length;l++)if(c.context===t[l]){o.lanes|=n,c=o.alternate,c!==null&&(c.lanes|=n),Hi(o.return,n,e),r||(s=null);break a}o=c.next}}else if(a.tag===18){if(s=a.return,s===null)throw Error(i(341));s.lanes|=n,o=s.alternate,o!==null&&(o.lanes|=n),Hi(s,n,e),s=null}else s=a.child;if(s!==null)s.return=a;else for(s=a;s!==null;){if(s===e){s=null;break}if(a=s.sibling,a!==null){a.return=s.return,s=a;break}s=s.return}a=s}}function Wi(e,t,n,r){e=null;for(var a=t,o=!1;a!==null;){if(!o){if(a.flags&524288)o=!0;else if(a.flags&262144)break}if(a.tag===10){var s=a.alternate;if(s===null)throw Error(i(387));if(s=s.memoizedProps,s!==null){var c=a.type;_r(a.pendingProps.value,s.value)||(e===null?e=[c]:e.push(c))}}else if(a===F.current){if(s=a.alternate,s===null)throw Error(i(387));s.memoizedState.memoizedState!==a.memoizedState.memoizedState&&(e===null?e=[Qf]:e.push(Qf))}a=a.return}e!==null&&Ui(t,e,n,r),t.flags|=262144}function Gi(e){for(e=e.firstContext;e!==null;){if(!_r(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function Ki(e){Ri=e,zi=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function qi(e){return Yi(Ri,e)}function Ji(e,t){return Ri===null&&Ki(e),Yi(e,t)}function Yi(e,t){var n=t._currentValue;if(t={context:t,memoizedValue:n,next:null},zi===null){if(e===null)throw Error(i(308));zi=t,e.dependencies={lanes:0,firstContext:t},e.flags|=524288}else zi=zi.next=t;return n}var Xi=typeof AbortController<`u`?AbortController:function(){var e=[],t=this.signal={aborted:!1,addEventListener:function(t,n){e.push(n)}};this.abort=function(){t.aborted=!0,e.forEach(function(e){return e()})}},Zi=t.unstable_scheduleCallback,Qi=t.unstable_NormalPriority,$i={$$typeof:x,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function ea(){return{controller:new Xi,data:new Map,refCount:0}}function ta(e){e.refCount--,e.refCount===0&&Zi(Qi,function(){e.controller.abort()})}var na=null,ia=0,aa=0,q=null;function oa(e,t){if(na===null){var n=na=[];ia=0,aa=ud(),q={status:`pending`,value:void 0,then:function(e){n.push(e)}}}return ia++,t.then(J,J),t}function J(){if(--ia===0&&na!==null){q!==null&&(q.status=`fulfilled`);var e=na;na=null,aa=0,q=null;for(var t=0;t<e.length;t++)(0,e[t])()}}function sa(e,t){var n=[],r={status:`pending`,value:null,reason:null,then:function(e){n.push(e)}};return e.then(function(){r.status=`fulfilled`,r.value=t;for(var e=0;e<n.length;e++)(0,n[e])(t)},function(e){for(r.status=`rejected`,r.reason=e,e=0;e<n.length;e++)(0,n[e])(void 0)}),r}var ca=j.S;j.S=function(e,t){Ql=Te(),typeof t==`object`&&t&&typeof t.then==`function`&&oa(e,t),ca!==null&&ca(e,t)};var la=ae(null);function ua(){var e=la.current;return e===null?Nl.pooledCache:e}function da(e,t){t===null?P(la,la.current):P(la,t.pool)}function fa(){var e=ua();return e===null?null:{parent:$i._currentValue,pool:e}}var pa=Error(i(460)),ma=Error(i(474)),ha=Error(i(542)),ga={then:function(){}};function _a(e){return e=e.status,e===`fulfilled`||e===`rejected`}function va(e,t,n){switch(n=e[n],n===void 0?e.push(t):n!==t&&(t.then(Zt,Zt),t=n),t.status){case`fulfilled`:return t.value;case`rejected`:throw e=t.reason,Sa(e),e;default:if(typeof t.status==`string`)t.then(Zt,Zt);else{if(e=Nl,e!==null&&100<e.shellSuspendCounter)throw Error(i(482));e=t,e.status=`pending`,e.then(function(e){if(t.status===`pending`){var n=t;n.status=`fulfilled`,n.value=e}},function(e){if(t.status===`pending`){var n=t;n.status=`rejected`,n.reason=e}})}switch(t.status){case`fulfilled`:return t.value;case`rejected`:throw e=t.reason,Sa(e),e}throw ba=t,pa}}function ya(e){try{var t=e._init;return t(e._payload)}catch(e){throw typeof e==`object`&&e&&typeof e.then==`function`?(ba=e,pa):e}}var ba=null;function xa(){if(ba===null)throw Error(i(459));var e=ba;return ba=null,e}function Sa(e){if(e===pa||e===ha)throw Error(i(483))}var Ca=null,wa=0;function Ta(e){var t=wa;return wa+=1,Ca===null&&(Ca=[]),va(Ca,e,t)}function Ea(e,t){t=t.props.ref,e.ref=t===void 0?null:t}function Da(e,t){throw t.$$typeof===p?Error(i(525)):(e=Object.prototype.toString.call(t),Error(i(31,e===`[object Object]`?`object with keys {`+Object.keys(t).join(`, `)+`}`:e)))}function Oa(e){function t(t,n){if(e){var r=t.deletions;r===null?(t.deletions=[n],t.flags|=16):r.push(n)}}function n(n,r){if(!e)return null;for(;r!==null;)t(n,r),r=r.sibling;return null}function r(e){for(var t=new Map;e!==null;)e.key===null?t.set(e.index,e):t.set(e.key,e),e=e.sibling;return t}function a(e,t){return e=ri(e,t),e.index=0,e.sibling=null,e}function o(t,n,r){return t.index=r,e?(r=t.alternate,r===null?(t.flags|=67108866,n):(r=r.index,r<n?(t.flags|=67108866,n):r)):(t.flags|=1048576,n)}function s(t){return e&&t.alternate===null&&(t.flags|=67108866),t}function c(e,t,n,r){return t===null||t.tag!==6?(t=si(n,e.mode,r),t.return=e,t):(t=a(t,n),t.return=e,t)}function l(e,t,n,r){var i=n.type;return i===g?d(e,t,n.props.children,r,n.key):t!==null&&(t.elementType===i||typeof i==`object`&&i&&i.$$typeof===E&&ya(i)===t.type)?(t=a(t,n.props),Ea(t,n),t.return=e,t):(t=ai(n.type,n.key,n.props,null,e.mode,r),Ea(t,n),t.return=e,t)}function u(e,t,n,r){return t===null||t.tag!==4||t.stateNode.containerInfo!==n.containerInfo||t.stateNode.implementation!==n.implementation?(t=li(n,e.mode,r),t.return=e,t):(t=a(t,n.children||[]),t.return=e,t)}function d(e,t,n,r,i){return t===null||t.tag!==7?(t=oi(n,e.mode,r,i),t.return=e,t):(t=a(t,n),t.return=e,t)}function f(e,t,n){if(typeof t==`string`&&t!==``||typeof t==`number`||typeof t==`bigint`)return t=si(``+t,e.mode,n),t.return=e,t;if(typeof t==`object`&&t){switch(t.$$typeof){case m:return n=ai(t.type,t.key,t.props,null,e.mode,n),Ea(n,t),n.return=e,n;case h:return t=li(t,e.mode,n),t.return=e,t;case E:return t=ya(t),f(e,t,n)}if(A(t)||te(t))return t=oi(t,e.mode,n,null),t.return=e,t;if(typeof t.then==`function`)return f(e,Ta(t),n);if(t.$$typeof===x)return f(e,Ji(e,t),n);Da(e,t)}return null}function p(e,t,n,r){var i=t===null?null:t.key;if(typeof n==`string`&&n!==``||typeof n==`number`||typeof n==`bigint`)return i===null?c(e,t,``+n,r):null;if(typeof n==`object`&&n){switch(n.$$typeof){case m:return n.key===i?l(e,t,n,r):null;case h:return n.key===i?u(e,t,n,r):null;case E:return n=ya(n),p(e,t,n,r)}if(A(n)||te(n))return i===null?d(e,t,n,r,null):null;if(typeof n.then==`function`)return p(e,t,Ta(n),r);if(n.$$typeof===x)return p(e,t,Ji(e,n),r);Da(e,n)}return null}function _(e,t,n,r,i){if(typeof r==`string`&&r!==``||typeof r==`number`||typeof r==`bigint`)return e=e.get(n)||null,c(t,e,``+r,i);if(typeof r==`object`&&r){switch(r.$$typeof){case m:return e=e.get(r.key===null?n:r.key)||null,l(t,e,r,i);case h:return e=e.get(r.key===null?n:r.key)||null,u(t,e,r,i);case E:return r=ya(r),_(e,t,n,r,i)}if(A(r)||te(r))return e=e.get(n)||null,d(t,e,r,i,null);if(typeof r.then==`function`)return _(e,t,n,Ta(r),i);if(r.$$typeof===x)return _(e,t,n,Ji(t,r),i);Da(t,r)}return null}function v(i,a,s,c){for(var l=null,u=null,d=a,m=a=0,h=null;d!==null&&m<s.length;m++){d.index>m?(h=d,d=null):h=d.sibling;var g=p(i,d,s[m],c);if(g===null){d===null&&(d=h);break}e&&d&&g.alternate===null&&t(i,d),a=o(g,a,m),u===null?l=g:u.sibling=g,u=g,d=h}if(m===s.length)return n(i,d),Di&&xi(i,m),l;if(d===null){for(;m<s.length;m++)d=f(i,s[m],c),d!==null&&(a=o(d,a,m),u===null?l=d:u.sibling=d,u=d);return Di&&xi(i,m),l}for(d=r(d);m<s.length;m++)h=_(d,i,m,s[m],c),h!==null&&(e&&h.alternate!==null&&d.delete(h.key===null?m:h.key),a=o(h,a,m),u===null?l=h:u.sibling=h,u=h);return e&&d.forEach(function(e){return t(i,e)}),Di&&xi(i,m),l}function y(a,s,c,l){if(c==null)throw Error(i(151));for(var u=null,d=null,m=s,h=s=0,g=null,v=c.next();m!==null&&!v.done;h++,v=c.next()){m.index>h?(g=m,m=null):g=m.sibling;var y=p(a,m,v.value,l);if(y===null){m===null&&(m=g);break}e&&m&&y.alternate===null&&t(a,m),s=o(y,s,h),d===null?u=y:d.sibling=y,d=y,m=g}if(v.done)return n(a,m),Di&&xi(a,h),u;if(m===null){for(;!v.done;h++,v=c.next())v=f(a,v.value,l),v!==null&&(s=o(v,s,h),d===null?u=v:d.sibling=v,d=v);return Di&&xi(a,h),u}for(m=r(m);!v.done;h++,v=c.next())v=_(m,a,h,v.value,l),v!==null&&(e&&v.alternate!==null&&m.delete(v.key===null?h:v.key),s=o(v,s,h),d===null?u=v:d.sibling=v,d=v);return e&&m.forEach(function(e){return t(a,e)}),Di&&xi(a,h),u}function b(e,r,o,c){if(typeof o==`object`&&o&&o.type===g&&o.key===null&&(o=o.props.children),typeof o==`object`&&o){switch(o.$$typeof){case m:a:{for(var l=o.key;r!==null;){if(r.key===l){if(l=o.type,l===g){if(r.tag===7){n(e,r.sibling),c=a(r,o.props.children),c.return=e,e=c;break a}}else if(r.elementType===l||typeof l==`object`&&l&&l.$$typeof===E&&ya(l)===r.type){n(e,r.sibling),c=a(r,o.props),Ea(c,o),c.return=e,e=c;break a}n(e,r);break}t(e,r),r=r.sibling}o.type===g?(c=oi(o.props.children,e.mode,c,o.key),c.return=e,e=c):(c=ai(o.type,o.key,o.props,null,e.mode,c),Ea(c,o),c.return=e,e=c)}return s(e);case h:a:{for(l=o.key;r!==null;){if(r.key===l){if(r.tag===4&&r.stateNode.containerInfo===o.containerInfo&&r.stateNode.implementation===o.implementation){n(e,r.sibling),c=a(r,o.children||[]),c.return=e,e=c;break a}n(e,r);break}t(e,r),r=r.sibling}c=li(o,e.mode,c),c.return=e,e=c}return s(e);case E:return o=ya(o),b(e,r,o,c)}if(A(o))return v(e,r,o,c);if(te(o)){if(l=te(o),typeof l!=`function`)throw Error(i(150));return o=l.call(o),y(e,r,o,c)}if(typeof o.then==`function`)return b(e,r,Ta(o),c);if(o.$$typeof===x)return b(e,r,Ji(e,o),c);Da(e,o)}return typeof o==`string`&&o!==``||typeof o==`number`||typeof o==`bigint`?(o=``+o,r!==null&&r.tag===6?(n(e,r.sibling),c=a(r,o),c.return=e,e=c):(n(e,r),c=si(o,e.mode,c),c.return=e,e=c),s(e)):n(e,r)}return function(e,t,n,r){try{wa=0;var i=b(e,t,n,r);return Ca=null,i}catch(t){if(t===pa||t===ha)throw t;var a=ti(29,t,null,e.mode);return a.lanes=r,a.return=e,a}}}var ka=Oa(!0),Aa=Oa(!1),ja=!1;function Ma(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Na(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,callbacks:null})}function Pa(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function Fa(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,Ml&2){var i=r.pending;return i===null?t.next=t:(t.next=i.next,i.next=t),r.pending=t,t=Qr(e),Zr(e,null,n),t}return Jr(e,r,t,n),Qr(e)}function Ia(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,n&4194048)){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,$e(e,n)}}function La(e,t){var n=e.updateQueue,r=e.alternate;if(r!==null&&(r=r.updateQueue,n===r)){var i=null,a=null;if(n=n.firstBaseUpdate,n!==null){do{var o={lane:n.lane,tag:n.tag,payload:n.payload,callback:null,next:null};a===null?i=a=o:a=a.next=o,n=n.next}while(n!==null);a===null?i=a=t:a=a.next=t}else i=a=t;n={baseState:r.baseState,firstBaseUpdate:i,lastBaseUpdate:a,shared:r.shared,callbacks:r.callbacks},e.updateQueue=n}else e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}var Ra=!1;function za(){if(Ra){var e=q;if(e!==null)throw e}}function Ba(e,t,n,r){Ra=!1;var i=e.updateQueue;ja=!1;var a=i.firstBaseUpdate,o=i.lastBaseUpdate,s=i.shared.pending;if(s!==null){i.shared.pending=null;var c=s,l=c.next;c.next=null,o===null?a=l:o.next=l,o=c;var u=e.alternate;u!==null&&(u=u.updateQueue,s=u.lastBaseUpdate,s!==o&&(s===null?u.firstBaseUpdate=l:s.next=l,u.lastBaseUpdate=c))}if(a!==null){var d=i.baseState;o=0,u=l=c=null,s=a;do{var p=s.lane&-536870913,m=p!==s.lane;if(m?(Fl&p)===p:(r&p)===p){p!==0&&p===aa&&(Ra=!0),u!==null&&(u=u.next={lane:0,tag:s.tag,payload:s.payload,callback:null,next:null});a:{var h=e,g=s;p=t;var _=n;switch(g.tag){case 1:if(h=g.payload,typeof h==`function`){d=h.call(_,d,p);break a}d=h;break a;case 3:h.flags=h.flags&-65537|128;case 0:if(h=g.payload,p=typeof h==`function`?h.call(_,d,p):h,p==null)break a;d=f({},d,p);break a;case 2:ja=!0}}p=s.callback,p!==null&&(e.flags|=64,m&&(e.flags|=8192),m=i.callbacks,m===null?i.callbacks=[p]:m.push(p))}else m={lane:p,tag:s.tag,payload:s.payload,callback:s.callback,next:null},u===null?(l=u=m,c=d):u=u.next=m,o|=p;if(s=s.next,s===null){if(s=i.shared.pending,s===null)break;m=s,s=m.next,m.next=null,i.lastBaseUpdate=m,i.shared.pending=null}}while(1);u===null&&(c=d),i.baseState=c,i.firstBaseUpdate=l,i.lastBaseUpdate=u,a===null&&(i.shared.lanes=0),Ul|=o,e.lanes=o,e.memoizedState=d}}function Va(e,t){if(typeof e!=`function`)throw Error(i(191,e));e.call(t)}function Ha(e,t){var n=e.callbacks;if(n!==null)for(e.callbacks=null,e=0;e<n.length;e++)Va(n[e],t)}var Ua=ae(null),Wa=ae(0);function Ga(e,t){e=Vl,P(Wa,e),P(Ua,t),Vl=e|t.baseLanes}function Ka(){P(Wa,Vl),P(Ua,Ua.current)}function qa(){Vl=Wa.current,oe(Ua),oe(Wa)}var Ja=ae(null),Ya=null;function Xa(e){var t=e.alternate;P(to,to.current&1),P(Ja,e),Ya===null&&(t===null||Ua.current!==null||t.memoizedState!==null)&&(Ya=e)}function Za(e){P(to,to.current),P(Ja,e),Ya===null&&(Ya=e)}function Qa(e){e.tag===22?(P(to,to.current),P(Ja,e),Ya===null&&(Ya=e)):$a(e)}function $a(){P(to,to.current),P(Ja,Ja.current)}function eo(e){oe(Ja),Ya===e&&(Ya=null),oe(to)}var to=ae(0);function no(e){for(var t=e;t!==null;){if(t.tag===13){var n=t.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||af(n)||of(n)))return t}else if(t.tag===19&&(t.memoizedProps.revealOrder===`forwards`||t.memoizedProps.revealOrder===`backwards`||t.memoizedProps.revealOrder===`unstable_legacy-backwards`||t.memoizedProps.revealOrder===`together`)){if(t.flags&128)return t}else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var ro=0,Y=null,io=null,ao=null,oo=!1,so=!1,co=!1,lo=0,uo=0,fo=null,po=0;function mo(){throw Error(i(321))}function ho(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!_r(e[n],t[n]))return!1;return!0}function go(e,t,n,r,i,a){return ro=a,Y=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,j.H=e===null||e.memoizedState===null?Ns:Ps,co=!1,a=n(r,i),co=!1,so&&(a=vo(t,n,r,i)),_o(e),a}function _o(e){j.H=Ms;var t=io!==null&&io.next!==null;if(ro=0,ao=io=Y=null,oo=!1,uo=0,fo=null,t)throw Error(i(300));e===null||Zs||(e=e.dependencies,e!==null&&Gi(e)&&(Zs=!0))}function vo(e,t,n,r){Y=e;var a=0;do{if(so&&(fo=null),uo=0,so=!1,25<=a)throw Error(i(301));if(a+=1,ao=io=null,e.updateQueue!=null){var o=e.updateQueue;o.lastEffect=null,o.events=null,o.stores=null,o.memoCache!=null&&(o.memoCache.index=0)}j.H=Fs,o=t(n,r)}while(so);return o}function yo(){var e=j.H,t=e.useState()[0];return t=typeof t.then==`function`?Eo(t):t,e=e.useState()[0],(io===null?null:io.memoizedState)!==e&&(Y.flags|=1024),t}function bo(){var e=lo!==0;return lo=0,e}function xo(e,t,n){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~n}function So(e){if(oo){for(e=e.memoizedState;e!==null;){var t=e.queue;t!==null&&(t.pending=null),e=e.next}oo=!1}ro=0,ao=io=Y=null,so=!1,uo=lo=0,fo=null}function Co(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return ao===null?Y.memoizedState=ao=e:ao=ao.next=e,ao}function wo(){if(io===null){var e=Y.alternate;e=e===null?null:e.memoizedState}else e=io.next;var t=ao===null?Y.memoizedState:ao.next;if(t!==null)ao=t,io=e;else{if(e===null)throw Y.alternate===null?Error(i(467)):Error(i(310));io=e,e={memoizedState:io.memoizedState,baseState:io.baseState,baseQueue:io.baseQueue,queue:io.queue,next:null},ao===null?Y.memoizedState=ao=e:ao=ao.next=e}return ao}function To(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function Eo(e){var t=uo;return uo+=1,fo===null&&(fo=[]),e=va(fo,e,t),t=Y,(ao===null?t.memoizedState:ao.next)===null&&(t=t.alternate,j.H=t===null||t.memoizedState===null?Ns:Ps),e}function Do(e){if(typeof e==`object`&&e){if(typeof e.then==`function`)return Eo(e);if(e.$$typeof===x)return qi(e)}throw Error(i(438,String(e)))}function Oo(e){var t=null,n=Y.updateQueue;if(n!==null&&(t=n.memoCache),t==null){var r=Y.alternate;r!==null&&(r=r.updateQueue,r!==null&&(r=r.memoCache,r!=null&&(t={data:r.data.map(function(e){return e.slice()}),index:0})))}if(t??={data:[],index:0},n===null&&(n=To(),Y.updateQueue=n),n.memoCache=t,n=t.data[t.index],n===void 0)for(n=t.data[t.index]=Array(e),r=0;r<e;r++)n[r]=O;return t.index++,n}function ko(e,t){return typeof t==`function`?t(e):t}function Ao(e){return jo(wo(),io,e)}function jo(e,t,n){var r=e.queue;if(r===null)throw Error(i(311));r.lastRenderedReducer=n;var a=e.baseQueue,o=r.pending;if(o!==null){if(a!==null){var s=a.next;a.next=o.next,o.next=s}t.baseQueue=a=o,r.pending=null}if(o=e.baseState,a===null)e.memoizedState=o;else{t=a.next;var c=s=null,l=null,u=t,d=!1;do{var f=u.lane&-536870913;if(f===u.lane?(ro&f)===f:(Fl&f)===f){var p=u.revertLane;if(p===0)l!==null&&(l=l.next={lane:0,revertLane:0,gesture:null,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null}),f===aa&&(d=!0);else if((ro&p)===p){u=u.next,p===aa&&(d=!0);continue}else f={lane:0,revertLane:u.revertLane,gesture:null,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null},l===null?(c=l=f,s=o):l=l.next=f,Y.lanes|=p,Ul|=p;f=u.action,co&&n(o,f),o=u.hasEagerState?u.eagerState:n(o,f)}else p={lane:f,revertLane:u.revertLane,gesture:u.gesture,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null},l===null?(c=l=p,s=o):l=l.next=p,Y.lanes|=f,Ul|=f;u=u.next}while(u!==null&&u!==t);if(l===null?s=o:l.next=c,!_r(o,e.memoizedState)&&(Zs=!0,d&&(n=q,n!==null)))throw n;e.memoizedState=o,e.baseState=s,e.baseQueue=l,r.lastRenderedState=o}return a===null&&(r.lanes=0),[e.memoizedState,r.dispatch]}function Mo(e){var t=wo(),n=t.queue;if(n===null)throw Error(i(311));n.lastRenderedReducer=e;var r=n.dispatch,a=n.pending,o=t.memoizedState;if(a!==null){n.pending=null;var s=a=a.next;do o=e(o,s.action),s=s.next;while(s!==a);_r(o,t.memoizedState)||(Zs=!0),t.memoizedState=o,t.baseQueue===null&&(t.baseState=o),n.lastRenderedState=o}return[o,r]}function No(e,t,n){var r=Y,a=wo(),o=Di;if(o){if(n===void 0)throw Error(i(407));n=n()}else n=t();var s=!_r((io||a).memoizedState,n);if(s&&(a.memoizedState=n,Zs=!0),a=a.queue,is(Io.bind(null,r,a,e),[e]),a.getSnapshot!==t||s||ao!==null&&ao.memoizedState.tag&1){if(r.flags|=2048,$o(9,{destroy:void 0},Fo.bind(null,r,a,n,t),null),Nl===null)throw Error(i(349));o||ro&127||Po(r,t,n)}return n}function Po(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=Y.updateQueue,t===null?(t=To(),Y.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function Fo(e,t,n,r){t.value=n,t.getSnapshot=r,Lo(t)&&Ro(e)}function Io(e,t,n){return n(function(){Lo(t)&&Ro(e)})}function Lo(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!_r(e,n)}catch{return!0}}function Ro(e){var t=Xr(e,2);t!==null&&pu(t,e,2)}function zo(e){var t=Co();if(typeof e==`function`){var n=e;if(e=n(),co){Ie(!0);try{n()}finally{Ie(!1)}}}return t.memoizedState=t.baseState=e,t.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:ko,lastRenderedState:e},t}function Bo(e,t,n,r){return e.baseState=n,jo(e,io,typeof r==`function`?r:ko)}function Vo(e,t,n,r,a){if(ks(e))throw Error(i(485));if(e=t.action,e!==null){var o={payload:a,action:e,next:null,isTransition:!0,status:`pending`,value:null,reason:null,listeners:[],then:function(e){o.listeners.push(e)}};j.T===null?o.isTransition=!1:n(!0),r(o),n=t.pending,n===null?(o.next=t.pending=o,Ho(t,o)):(o.next=n.next,t.pending=n.next=o)}}function Ho(e,t){var n=t.action,r=t.payload,i=e.state;if(t.isTransition){var a=j.T,o={};j.T=o;try{var s=n(i,r),c=j.S;c!==null&&c(o,s),Uo(e,t,s)}catch(n){Go(e,t,n)}finally{a!==null&&o.types!==null&&(a.types=o.types),j.T=a}}else try{a=n(i,r),Uo(e,t,a)}catch(n){Go(e,t,n)}}function Uo(e,t,n){typeof n==`object`&&n&&typeof n.then==`function`?n.then(function(n){Wo(e,t,n)},function(n){return Go(e,t,n)}):Wo(e,t,n)}function Wo(e,t,n){t.status=`fulfilled`,t.value=n,Ko(t),e.state=n,t=e.pending,t!==null&&(n=t.next,n===t?e.pending=null:(n=n.next,t.next=n,Ho(e,n)))}function Go(e,t,n){var r=e.pending;if(e.pending=null,r!==null){r=r.next;do t.status=`rejected`,t.reason=n,Ko(t),t=t.next;while(t!==r)}e.action=null}function Ko(e){e=e.listeners;for(var t=0;t<e.length;t++)(0,e[t])()}function qo(e,t){return t}function Jo(e,t){if(Di){var n=Nl.formState;if(n!==null){a:{var r=Y;if(Di){if(Ei){b:{for(var i=Ei,a=Oi;i.nodeType!==8;)if(!a||(i=cf(i.nextSibling),i===null)){i=null;break b}a=i.data,i=a===`F!`||a===`F`?i:null}if(i){Ei=cf(i.nextSibling),r=i.data===`F!`;break a}}Ai(r)}r=!1}r&&(t=n[0])}}return n=Co(),n.memoizedState=n.baseState=t,r={pending:null,lanes:0,dispatch:null,lastRenderedReducer:qo,lastRenderedState:t},n.queue=r,n=Es.bind(null,Y,r),r.dispatch=n,r=zo(!1),a=Os.bind(null,Y,!1,r.queue),r=Co(),i={state:t,dispatch:null,action:e,pending:null},r.queue=i,n=Vo.bind(null,Y,i,a,n),i.dispatch=n,r.memoizedState=e,[t,n,!1]}function Yo(e){return Xo(wo(),io,e)}function Xo(e,t,n){if(t=jo(e,t,qo)[0],e=Ao(ko)[0],typeof t==`object`&&t&&typeof t.then==`function`)try{var r=Eo(t)}catch(e){throw e===pa?ha:e}else r=t;t=wo();var i=t.queue,a=i.dispatch;return n!==t.memoizedState&&(Y.flags|=2048,$o(9,{destroy:void 0},Zo.bind(null,i,n),null)),[r,a,e]}function Zo(e,t){e.action=t}function Qo(e){var t=wo(),n=io;if(n!==null)return Xo(t,n,e);wo(),t=t.memoizedState,n=wo();var r=n.queue.dispatch;return n.memoizedState=e,[t,r,!1]}function $o(e,t,n,r){return e={tag:e,create:n,deps:r,inst:t,next:null},t=Y.updateQueue,t===null&&(t=To(),Y.updateQueue=t),n=t.lastEffect,n===null?t.lastEffect=e.next=e:(r=n.next,n.next=e,e.next=r,t.lastEffect=e),e}function es(){return wo().memoizedState}function ts(e,t,n,r){var i=Co();Y.flags|=e,i.memoizedState=$o(1|t,{destroy:void 0},n,r===void 0?null:r)}function ns(e,t,n,r){var i=wo();r=r===void 0?null:r;var a=i.memoizedState.inst;io!==null&&r!==null&&ho(r,io.memoizedState.deps)?i.memoizedState=$o(t,a,n,r):(Y.flags|=e,i.memoizedState=$o(1|t,a,n,r))}function rs(e,t){ts(8390656,8,e,t)}function is(e,t){ns(2048,8,e,t)}function as(e){Y.flags|=4;var t=Y.updateQueue;if(t===null)t=To(),Y.updateQueue=t,t.events=[e];else{var n=t.events;n===null?t.events=[e]:n.push(e)}}function os(e){var t=wo().memoizedState;return as({ref:t,nextImpl:e}),function(){if(Ml&2)throw Error(i(440));return t.impl.apply(void 0,arguments)}}function ss(e,t){return ns(4,2,e,t)}function cs(e,t){return ns(4,4,e,t)}function ls(e,t){if(typeof t==`function`){e=e();var n=t(e);return function(){typeof n==`function`?n():t(null)}}if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function us(e,t,n){n=n==null?null:n.concat([e]),ns(4,4,ls.bind(null,t,e),n)}function ds(){}function fs(e,t){var n=wo();t=t===void 0?null:t;var r=n.memoizedState;return t!==null&&ho(t,r[1])?r[0]:(n.memoizedState=[e,t],e)}function ps(e,t){var n=wo();t=t===void 0?null:t;var r=n.memoizedState;if(t!==null&&ho(t,r[1]))return r[0];if(r=e(),co){Ie(!0);try{e()}finally{Ie(!1)}}return n.memoizedState=[r,t],r}function ms(e,t,n){return n===void 0||ro&1073741824&&!(Fl&261930)?e.memoizedState=t:(e.memoizedState=n,e=fu(),Y.lanes|=e,Ul|=e,n)}function hs(e,t,n,r){return _r(n,t)?n:Ua.current===null?!(ro&42)||ro&1073741824&&!(Fl&261930)?(Zs=!0,e.memoizedState=n):(e=fu(),Y.lanes|=e,Ul|=e,t):(e=ms(e,n,r),_r(e,t)||(Zs=!0),e)}function gs(e,t,n,r,i){var a=M.p;M.p=a!==0&&8>a?a:8;var o=j.T,s={};j.T=s,Os(e,!1,t,n);try{var c=i(),l=j.S;l!==null&&l(s,c),typeof c==`object`&&c&&typeof c.then==`function`?Ds(e,t,sa(c,r),du(e)):Ds(e,t,r,du(e))}catch(n){Ds(e,t,{then:function(){},status:`rejected`,reason:n},du())}finally{M.p=a,o!==null&&s.types!==null&&(o.types=s.types),j.T=o}}function _s(){}function vs(e,t,n,r){if(e.tag!==5)throw Error(i(476));var a=ys(e).queue;gs(e,a,t,re,n===null?_s:function(){return bs(e),n(r)})}function ys(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:re,baseState:re,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:ko,lastRenderedState:re},next:null};var n={};return t.next={memoizedState:n,baseState:n,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:ko,lastRenderedState:n},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function bs(e){var t=ys(e);t.next===null&&(t=e.alternate.memoizedState),Ds(e,t.next.queue,{},du())}function xs(){return qi(Qf)}function Ss(){return wo().memoizedState}function Cs(){return wo().memoizedState}function ws(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var n=du();e=Pa(n);var r=Fa(t,e,n);r!==null&&(pu(r,t,n),Ia(r,t,n)),t={cache:ea()},e.payload=t;return}t=t.return}}function Ts(e,t,n){var r=du();n={lane:r,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null},ks(e)?As(t,n):(n=Yr(e,t,n,r),n!==null&&(pu(n,e,r),js(n,t,r)))}function Es(e,t,n){Ds(e,t,n,du())}function Ds(e,t,n,r){var i={lane:r,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null};if(ks(e))As(t,i);else{var a=e.alternate;if(e.lanes===0&&(a===null||a.lanes===0)&&(a=t.lastRenderedReducer,a!==null))try{var o=t.lastRenderedState,s=a(o,n);if(i.hasEagerState=!0,i.eagerState=s,_r(s,o))return Jr(e,t,i,0),Nl===null&&qr(),!1}catch{}if(n=Yr(e,t,i,r),n!==null)return pu(n,e,r),js(n,t,r),!0}return!1}function Os(e,t,n,r){if(r={lane:2,revertLane:ud(),gesture:null,action:r,hasEagerState:!1,eagerState:null,next:null},ks(e)){if(t)throw Error(i(479))}else t=Yr(e,n,r,2),t!==null&&pu(t,e,2)}function ks(e){var t=e.alternate;return e===Y||t!==null&&t===Y}function As(e,t){so=oo=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function js(e,t,n){if(n&4194048){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,$e(e,n)}}var Ms={readContext:qi,use:Do,useCallback:mo,useContext:mo,useEffect:mo,useImperativeHandle:mo,useLayoutEffect:mo,useInsertionEffect:mo,useMemo:mo,useReducer:mo,useRef:mo,useState:mo,useDebugValue:mo,useDeferredValue:mo,useTransition:mo,useSyncExternalStore:mo,useId:mo,useHostTransitionStatus:mo,useFormState:mo,useActionState:mo,useOptimistic:mo,useMemoCache:mo,useCacheRefresh:mo};Ms.useEffectEvent=mo;var Ns={readContext:qi,use:Do,useCallback:function(e,t){return Co().memoizedState=[e,t===void 0?null:t],e},useContext:qi,useEffect:rs,useImperativeHandle:function(e,t,n){n=n==null?null:n.concat([e]),ts(4194308,4,ls.bind(null,t,e),n)},useLayoutEffect:function(e,t){return ts(4194308,4,e,t)},useInsertionEffect:function(e,t){ts(4,2,e,t)},useMemo:function(e,t){var n=Co();t=t===void 0?null:t;var r=e();if(co){Ie(!0);try{e()}finally{Ie(!1)}}return n.memoizedState=[r,t],r},useReducer:function(e,t,n){var r=Co();if(n!==void 0){var i=n(t);if(co){Ie(!0);try{n(t)}finally{Ie(!1)}}}else i=t;return r.memoizedState=r.baseState=i,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:i},r.queue=e,e=e.dispatch=Ts.bind(null,Y,e),[r.memoizedState,e]},useRef:function(e){var t=Co();return e={current:e},t.memoizedState=e},useState:function(e){e=zo(e);var t=e.queue,n=Es.bind(null,Y,t);return t.dispatch=n,[e.memoizedState,n]},useDebugValue:ds,useDeferredValue:function(e,t){return ms(Co(),e,t)},useTransition:function(){var e=zo(!1);return e=gs.bind(null,Y,e.queue,!0,!1),Co().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,n){var r=Y,a=Co();if(Di){if(n===void 0)throw Error(i(407));n=n()}else{if(n=t(),Nl===null)throw Error(i(349));Fl&127||Po(r,t,n)}a.memoizedState=n;var o={value:n,getSnapshot:t};return a.queue=o,rs(Io.bind(null,r,o,e),[e]),r.flags|=2048,$o(9,{destroy:void 0},Fo.bind(null,r,o,n,t),null),n},useId:function(){var e=Co(),t=Nl.identifierPrefix;if(Di){var n=bi,r=yi;n=(r&~(1<<32-Le(r)-1)).toString(32)+n,t=`_`+t+`R_`+n,n=lo++,0<n&&(t+=`H`+n.toString(32)),t+=`_`}else n=po++,t=`_`+t+`r_`+n.toString(32)+`_`;return e.memoizedState=t},useHostTransitionStatus:xs,useFormState:Jo,useActionState:Jo,useOptimistic:function(e){var t=Co();t.memoizedState=t.baseState=e;var n={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return t.queue=n,t=Os.bind(null,Y,!0,n),n.dispatch=t,[e,t]},useMemoCache:Oo,useCacheRefresh:function(){return Co().memoizedState=ws.bind(null,Y)},useEffectEvent:function(e){var t=Co(),n={impl:e};return t.memoizedState=n,function(){if(Ml&2)throw Error(i(440));return n.impl.apply(void 0,arguments)}}},Ps={readContext:qi,use:Do,useCallback:fs,useContext:qi,useEffect:is,useImperativeHandle:us,useInsertionEffect:ss,useLayoutEffect:cs,useMemo:ps,useReducer:Ao,useRef:es,useState:function(){return Ao(ko)},useDebugValue:ds,useDeferredValue:function(e,t){return hs(wo(),io.memoizedState,e,t)},useTransition:function(){var e=Ao(ko)[0],t=wo().memoizedState;return[typeof e==`boolean`?e:Eo(e),t]},useSyncExternalStore:No,useId:Ss,useHostTransitionStatus:xs,useFormState:Yo,useActionState:Yo,useOptimistic:function(e,t){return Bo(wo(),io,e,t)},useMemoCache:Oo,useCacheRefresh:Cs};Ps.useEffectEvent=os;var Fs={readContext:qi,use:Do,useCallback:fs,useContext:qi,useEffect:is,useImperativeHandle:us,useInsertionEffect:ss,useLayoutEffect:cs,useMemo:ps,useReducer:Mo,useRef:es,useState:function(){return Mo(ko)},useDebugValue:ds,useDeferredValue:function(e,t){var n=wo();return io===null?ms(n,e,t):hs(n,io.memoizedState,e,t)},useTransition:function(){var e=Mo(ko)[0],t=wo().memoizedState;return[typeof e==`boolean`?e:Eo(e),t]},useSyncExternalStore:No,useId:Ss,useHostTransitionStatus:xs,useFormState:Qo,useActionState:Qo,useOptimistic:function(e,t){var n=wo();return io===null?(n.baseState=e,[e,n.queue.dispatch]):Bo(n,io,e,t)},useMemoCache:Oo,useCacheRefresh:Cs};Fs.useEffectEvent=os;function Is(e,t,n,r){t=e.memoizedState,n=n(r,t),n=n==null?t:f({},t,n),e.memoizedState=n,e.lanes===0&&(e.updateQueue.baseState=n)}var Ls={enqueueSetState:function(e,t,n){e=e._reactInternals;var r=du(),i=Pa(r);i.payload=t,n!=null&&(i.callback=n),t=Fa(e,i,r),t!==null&&(pu(t,e,r),Ia(t,e,r))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var r=du(),i=Pa(r);i.tag=1,i.payload=t,n!=null&&(i.callback=n),t=Fa(e,i,r),t!==null&&(pu(t,e,r),Ia(t,e,r))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=du(),r=Pa(n);r.tag=2,t!=null&&(r.callback=t),t=Fa(e,r,n),t!==null&&(pu(t,e,n),Ia(t,e,n))}};function Rs(e,t,n,r,i,a,o){return e=e.stateNode,typeof e.shouldComponentUpdate==`function`?e.shouldComponentUpdate(r,a,o):t.prototype&&t.prototype.isPureReactComponent?!U(n,r)||!U(i,a):!0}function zs(e,t,n,r){e=t.state,typeof t.componentWillReceiveProps==`function`&&t.componentWillReceiveProps(n,r),typeof t.UNSAFE_componentWillReceiveProps==`function`&&t.UNSAFE_componentWillReceiveProps(n,r),t.state!==e&&Ls.enqueueReplaceState(t,t.state,null)}function Bs(e,t){var n=t;if(`ref`in t)for(var r in n={},t)r!==`ref`&&(n[r]=t[r]);if(e=e.defaultProps)for(var i in n===t&&(n=f({},n)),e)n[i]===void 0&&(n[i]=e[i]);return n}function Vs(e){Wr(e)}function Hs(e){console.error(e)}function Us(e){Wr(e)}function Ws(e,t){try{var n=e.onUncaughtError;n(t.value,{componentStack:t.stack})}catch(e){setTimeout(function(){throw e})}}function Gs(e,t,n){try{var r=e.onCaughtError;r(n.value,{componentStack:n.stack,errorBoundary:t.tag===1?t.stateNode:null})}catch(e){setTimeout(function(){throw e})}}function Ks(e,t,n){return n=Pa(n),n.tag=3,n.payload={element:null},n.callback=function(){Ws(e,t)},n}function qs(e){return e=Pa(e),e.tag=3,e}function Js(e,t,n,r){var i=n.type.getDerivedStateFromError;if(typeof i==`function`){var a=r.value;e.payload=function(){return i(a)},e.callback=function(){Gs(t,n,r)}}var o=n.stateNode;o!==null&&typeof o.componentDidCatch==`function`&&(e.callback=function(){Gs(t,n,r),typeof i!=`function`&&(tu===null?tu=new Set([this]):tu.add(this));var e=r.stack;this.componentDidCatch(r.value,{componentStack:e===null?``:e})})}function Ys(e,t,n,r,a){if(n.flags|=32768,typeof r==`object`&&r&&typeof r.then==`function`){if(t=n.alternate,t!==null&&Wi(t,n,a,!0),n=Ja.current,n!==null){switch(n.tag){case 31:case 13:return Ya===null?Tu():n.alternate===null&&Hl===0&&(Hl=3),n.flags&=-257,n.flags|=65536,n.lanes=a,r===ga?n.flags|=16384:(t=n.updateQueue,t===null?n.updateQueue=new Set([r]):t.add(r),Wu(e,r,a)),!1;case 22:return n.flags|=65536,r===ga?n.flags|=16384:(t=n.updateQueue,t===null?(t={transitions:null,markerInstances:null,retryQueue:new Set([r])},n.updateQueue=t):(n=t.retryQueue,n===null?t.retryQueue=new Set([r]):n.add(r)),Wu(e,r,a)),!1}throw Error(i(435,n.tag))}return Wu(e,r,a),Tu(),!1}if(Di)return t=Ja.current,t===null?(r!==ki&&(t=Error(i(423),{cause:r}),Ii(di(t,n))),e=e.current.alternate,e.flags|=65536,a&=-a,e.lanes|=a,r=di(r,n),a=Ks(e.stateNode,r,a),La(e,a),Hl!==4&&(Hl=2)):(!(t.flags&65536)&&(t.flags|=256),t.flags|=65536,t.lanes=a,r!==ki&&(e=Error(i(422),{cause:r}),Ii(di(e,n)))),!1;var o=Error(i(520),{cause:r});if(o=di(o,n),Jl===null?Jl=[o]:Jl.push(o),Hl!==4&&(Hl=2),t===null)return!0;r=di(r,n),n=t;do{switch(n.tag){case 3:return n.flags|=65536,e=a&-a,n.lanes|=e,e=Ks(n.stateNode,r,e),La(n,e),!1;case 1:if(t=n.type,o=n.stateNode,!(n.flags&128)&&(typeof t.getDerivedStateFromError==`function`||o!==null&&typeof o.componentDidCatch==`function`&&(tu===null||!tu.has(o))))return n.flags|=65536,a&=-a,n.lanes|=a,a=qs(a),Js(a,e,n,r),La(n,a),!1}n=n.return}while(n!==null);return!1}var Xs=Error(i(461)),Zs=!1;function Qs(e,t,n,r){t.child=e===null?Aa(t,null,n,r):ka(t,e.child,n,r)}function $s(e,t,n,r,i){n=n.render;var a=t.ref;if(`ref`in r){var o={};for(var s in r)s!==`ref`&&(o[s]=r[s])}else o=r;return Ki(t),r=go(e,t,n,o,a,i),s=bo(),e!==null&&!Zs?(xo(e,t,i),Cc(e,t,i)):(Di&&s&&Ci(t),t.flags|=1,Qs(e,t,r,i),t.child)}function ec(e,t,n,r,i){if(e===null){var a=n.type;return typeof a==`function`&&!ni(a)&&a.defaultProps===void 0&&n.compare===null?(t.tag=15,t.type=a,tc(e,t,a,r,i)):(e=ai(n.type,null,r,t,t.mode,i),e.ref=t.ref,e.return=t,t.child=e)}if(a=e.child,!wc(e,i)){var o=a.memoizedProps;if(n=n.compare,n=n===null?U:n,n(o,r)&&e.ref===t.ref)return Cc(e,t,i)}return t.flags|=1,e=ri(a,r),e.ref=t.ref,e.return=t,t.child=e}function tc(e,t,n,r,i){if(e!==null){var a=e.memoizedProps;if(U(a,r)&&e.ref===t.ref){if(Zs=!1,t.pendingProps=r=a,wc(e,i))e.flags&131072&&(Zs=!0);else return t.lanes=e.lanes,Cc(e,t,i)}}return lc(e,t,n,r,i)}function nc(e,t,n,r){var i=r.children,a=e===null?null:e.memoizedState;if(e===null&&t.stateNode===null&&(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),r.mode===`hidden`){if(t.flags&128){if(a=a===null?n:a.baseLanes|n,e!==null){for(r=t.child=e.child,i=0;r!==null;)i=i|r.lanes|r.childLanes,r=r.sibling;r=i&~a}else r=0,t.child=null;return ic(e,t,a,n,r)}if(n&536870912)t.memoizedState={baseLanes:0,cachePool:null},e!==null&&da(t,a===null?null:a.cachePool),a===null?Ka():Ga(t,a),Qa(t);else return r=t.lanes=536870912,ic(e,t,a===null?n:a.baseLanes|n,n,r)}else a===null?(e!==null&&da(t,null),Ka(),$a(t)):(da(t,a.cachePool),Ga(t,a),$a(t),t.memoizedState=null);return Qs(e,t,i,n),t.child}function rc(e,t){return e!==null&&e.tag===22||t.stateNode!==null||(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),t.sibling}function ic(e,t,n,r,i){var a=ua();return a=a===null?null:{parent:$i._currentValue,pool:a},t.memoizedState={baseLanes:n,cachePool:a},e!==null&&da(t,null),Ka(),Qa(t),e!==null&&Wi(e,t,r,!0),t.childLanes=i,null}function ac(e,t){return t=vc({mode:t.mode,children:t.children},e.mode),t.ref=e.ref,e.child=t,t.return=e,t}function oc(e,t,n){return ka(t,e.child,null,n),e=ac(t,t.pendingProps),e.flags|=2,eo(t),t.memoizedState=null,e}function sc(e,t,n){var r=t.pendingProps,a=!!(t.flags&128);if(t.flags&=-129,e===null){if(Di){if(r.mode===`hidden`)return e=ac(t,r),t.lanes=536870912,rc(null,e);if(Za(t),(e=Ei)?(e=rf(e,Oi),e=e!==null&&e.data===`&`?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:vi===null?null:{id:yi,overflow:bi},retryLane:536870912,hydrationErrors:null},n=ci(e),n.return=t,t.child=n,Ti=t,Ei=null)):e=null,e===null)throw Ai(t);return t.lanes=536870912,null}return ac(t,r)}var o=e.memoizedState;if(o!==null){var s=o.dehydrated;if(Za(t),a){if(t.flags&256)t.flags&=-257,t=oc(e,t,n);else if(t.memoizedState!==null)t.child=e.child,t.flags|=128,t=null;else throw Error(i(558))}else if(Zs||Wi(e,t,n,!1),a=(n&e.childLanes)!==0,Zs||a){if(r=Nl,r!==null&&(s=et(r,n),s!==0&&s!==o.retryLane))throw o.retryLane=s,Xr(e,s),pu(r,e,s),Xs;Tu(),t=oc(e,t,n)}else e=o.treeContext,Ei=cf(s.nextSibling),Ti=t,Di=!0,K=null,Oi=!1,e!==null&&wi(t,e),t=ac(t,r),t.flags|=4096;return t}return e=ri(e.child,{mode:r.mode,children:r.children}),e.ref=t.ref,t.child=e,e.return=t,e}function cc(e,t){var n=t.ref;if(n===null)e!==null&&e.ref!==null&&(t.flags|=4194816);else{if(typeof n!=`function`&&typeof n!=`object`)throw Error(i(284));(e===null||e.ref!==n)&&(t.flags|=4194816)}}function lc(e,t,n,r,i){return Ki(t),n=go(e,t,n,r,void 0,i),r=bo(),e!==null&&!Zs?(xo(e,t,i),Cc(e,t,i)):(Di&&r&&Ci(t),t.flags|=1,Qs(e,t,n,i),t.child)}function uc(e,t,n,r,i,a){return Ki(t),t.updateQueue=null,n=vo(t,r,n,i),_o(e),r=bo(),e!==null&&!Zs?(xo(e,t,a),Cc(e,t,a)):(Di&&r&&Ci(t),t.flags|=1,Qs(e,t,n,a),t.child)}function dc(e,t,n,r,i){if(Ki(t),t.stateNode===null){var a=$r,o=n.contextType;typeof o==`object`&&o&&(a=qi(o)),a=new n(r,a),t.memoizedState=a.state!==null&&a.state!==void 0?a.state:null,a.updater=Ls,t.stateNode=a,a._reactInternals=t,a=t.stateNode,a.props=r,a.state=t.memoizedState,a.refs={},Ma(t),o=n.contextType,a.context=typeof o==`object`&&o?qi(o):$r,a.state=t.memoizedState,o=n.getDerivedStateFromProps,typeof o==`function`&&(Is(t,n,o,r),a.state=t.memoizedState),typeof n.getDerivedStateFromProps==`function`||typeof a.getSnapshotBeforeUpdate==`function`||typeof a.UNSAFE_componentWillMount!=`function`&&typeof a.componentWillMount!=`function`||(o=a.state,typeof a.componentWillMount==`function`&&a.componentWillMount(),typeof a.UNSAFE_componentWillMount==`function`&&a.UNSAFE_componentWillMount(),o!==a.state&&Ls.enqueueReplaceState(a,a.state,null),Ba(t,r,a,i),za(),a.state=t.memoizedState),typeof a.componentDidMount==`function`&&(t.flags|=4194308),r=!0}else if(e===null){a=t.stateNode;var s=t.memoizedProps,c=Bs(n,s);a.props=c;var l=a.context,u=n.contextType;o=$r,typeof u==`object`&&u&&(o=qi(u));var d=n.getDerivedStateFromProps;u=typeof d==`function`||typeof a.getSnapshotBeforeUpdate==`function`,s=t.pendingProps!==s,u||typeof a.UNSAFE_componentWillReceiveProps!=`function`&&typeof a.componentWillReceiveProps!=`function`||(s||l!==o)&&zs(t,a,r,o),ja=!1;var f=t.memoizedState;a.state=f,Ba(t,r,a,i),za(),l=t.memoizedState,s||f!==l||ja?(typeof d==`function`&&(Is(t,n,d,r),l=t.memoizedState),(c=ja||Rs(t,n,c,r,f,l,o))?(u||typeof a.UNSAFE_componentWillMount!=`function`&&typeof a.componentWillMount!=`function`||(typeof a.componentWillMount==`function`&&a.componentWillMount(),typeof a.UNSAFE_componentWillMount==`function`&&a.UNSAFE_componentWillMount()),typeof a.componentDidMount==`function`&&(t.flags|=4194308)):(typeof a.componentDidMount==`function`&&(t.flags|=4194308),t.memoizedProps=r,t.memoizedState=l),a.props=r,a.state=l,a.context=o,r=c):(typeof a.componentDidMount==`function`&&(t.flags|=4194308),r=!1)}else{a=t.stateNode,Na(e,t),o=t.memoizedProps,u=Bs(n,o),a.props=u,d=t.pendingProps,f=a.context,l=n.contextType,c=$r,typeof l==`object`&&l&&(c=qi(l)),s=n.getDerivedStateFromProps,(l=typeof s==`function`||typeof a.getSnapshotBeforeUpdate==`function`)||typeof a.UNSAFE_componentWillReceiveProps!=`function`&&typeof a.componentWillReceiveProps!=`function`||(o!==d||f!==c)&&zs(t,a,r,c),ja=!1,f=t.memoizedState,a.state=f,Ba(t,r,a,i),za();var p=t.memoizedState;o!==d||f!==p||ja||e!==null&&e.dependencies!==null&&Gi(e.dependencies)?(typeof s==`function`&&(Is(t,n,s,r),p=t.memoizedState),(u=ja||Rs(t,n,u,r,f,p,c)||e!==null&&e.dependencies!==null&&Gi(e.dependencies))?(l||typeof a.UNSAFE_componentWillUpdate!=`function`&&typeof a.componentWillUpdate!=`function`||(typeof a.componentWillUpdate==`function`&&a.componentWillUpdate(r,p,c),typeof a.UNSAFE_componentWillUpdate==`function`&&a.UNSAFE_componentWillUpdate(r,p,c)),typeof a.componentDidUpdate==`function`&&(t.flags|=4),typeof a.getSnapshotBeforeUpdate==`function`&&(t.flags|=1024)):(typeof a.componentDidUpdate!=`function`||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),typeof a.getSnapshotBeforeUpdate!=`function`||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=1024),t.memoizedProps=r,t.memoizedState=p),a.props=r,a.state=p,a.context=c,r=u):(typeof a.componentDidUpdate!=`function`||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),typeof a.getSnapshotBeforeUpdate!=`function`||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=1024),r=!1)}return a=r,cc(e,t),r=!!(t.flags&128),a||r?(a=t.stateNode,n=r&&typeof n.getDerivedStateFromError!=`function`?null:a.render(),t.flags|=1,e!==null&&r?(t.child=ka(t,e.child,null,i),t.child=ka(t,null,n,i)):Qs(e,t,n,i),t.memoizedState=a.state,e=t.child):e=Cc(e,t,i),e}function fc(e,t,n,r){return Pi(),t.flags|=256,Qs(e,t,n,r),t.child}var pc={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function mc(e){return{baseLanes:e,cachePool:fa()}}function hc(e,t,n){return e=e===null?0:e.childLanes&~n,t&&(e|=Kl),e}function gc(e,t,n){var r=t.pendingProps,a=!1,o=!!(t.flags&128),s;if((s=o)||(s=e!==null&&e.memoizedState===null?!1:!!(to.current&2)),s&&(a=!0,t.flags&=-129),s=!!(t.flags&32),t.flags&=-33,e===null){if(Di){if(a?Xa(t):$a(t),(e=Ei)?(e=rf(e,Oi),e=e!==null&&e.data!==`&`?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:vi===null?null:{id:yi,overflow:bi},retryLane:536870912,hydrationErrors:null},n=ci(e),n.return=t,t.child=n,Ti=t,Ei=null)):e=null,e===null)throw Ai(t);return of(e)?t.lanes=32:t.lanes=536870912,null}var c=r.children;return r=r.fallback,a?($a(t),a=t.mode,c=vc({mode:`hidden`,children:c},a),r=oi(r,a,n,null),c.return=t,r.return=t,c.sibling=r,t.child=c,r=t.child,r.memoizedState=mc(n),r.childLanes=hc(e,s,n),t.memoizedState=pc,rc(null,r)):(Xa(t),_c(t,c))}var l=e.memoizedState;if(l!==null&&(c=l.dehydrated,c!==null)){if(o)t.flags&256?(Xa(t),t.flags&=-257,t=yc(e,t,n)):t.memoizedState===null?($a(t),c=r.fallback,a=t.mode,r=vc({mode:`visible`,children:r.children},a),c=oi(c,a,n,null),c.flags|=2,r.return=t,c.return=t,r.sibling=c,t.child=r,ka(t,e.child,null,n),r=t.child,r.memoizedState=mc(n),r.childLanes=hc(e,s,n),t.memoizedState=pc,t=rc(null,r)):($a(t),t.child=e.child,t.flags|=128,t=null);else if(Xa(t),of(c)){if(s=c.nextSibling&&c.nextSibling.dataset,s)var u=s.dgst;s=u,r=Error(i(419)),r.stack=``,r.digest=s,Ii({value:r,source:null,stack:null}),t=yc(e,t,n)}else if(Zs||Wi(e,t,n,!1),s=(n&e.childLanes)!==0,Zs||s){if(s=Nl,s!==null&&(r=et(s,n),r!==0&&r!==l.retryLane))throw l.retryLane=r,Xr(e,r),pu(s,e,r),Xs;af(c)||Tu(),t=yc(e,t,n)}else af(c)?(t.flags|=192,t.child=e.child,t=null):(e=l.treeContext,Ei=cf(c.nextSibling),Ti=t,Di=!0,K=null,Oi=!1,e!==null&&wi(t,e),t=_c(t,r.children),t.flags|=4096);return t}return a?($a(t),c=r.fallback,a=t.mode,l=e.child,u=l.sibling,r=ri(l,{mode:`hidden`,children:r.children}),r.subtreeFlags=l.subtreeFlags&65011712,u===null?(c=oi(c,a,n,null),c.flags|=2):c=ri(u,c),c.return=t,r.return=t,r.sibling=c,t.child=r,rc(null,r),r=t.child,c=e.child.memoizedState,c===null?c=mc(n):(a=c.cachePool,a===null?a=fa():(l=$i._currentValue,a=a.parent===l?a:{parent:l,pool:l}),c={baseLanes:c.baseLanes|n,cachePool:a}),r.memoizedState=c,r.childLanes=hc(e,s,n),t.memoizedState=pc,rc(e.child,r)):(Xa(t),n=e.child,e=n.sibling,n=ri(n,{mode:`visible`,children:r.children}),n.return=t,n.sibling=null,e!==null&&(s=t.deletions,s===null?(t.deletions=[e],t.flags|=16):s.push(e)),t.child=n,t.memoizedState=null,n)}function _c(e,t){return t=vc({mode:`visible`,children:t},e.mode),t.return=e,e.child=t}function vc(e,t){return e=ti(22,e,null,t),e.lanes=0,e}function yc(e,t,n){return ka(t,e.child,null,n),e=_c(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function bc(e,t,n){e.lanes|=t;var r=e.alternate;r!==null&&(r.lanes|=t),Hi(e.return,t,n)}function xc(e,t,n,r,i,a){var o=e.memoizedState;o===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:r,tail:n,tailMode:i,treeForkCount:a}:(o.isBackwards=t,o.rendering=null,o.renderingStartTime=0,o.last=r,o.tail=n,o.tailMode=i,o.treeForkCount=a)}function Sc(e,t,n){var r=t.pendingProps,i=r.revealOrder,a=r.tail;r=r.children;var o=to.current,s=!!(o&2);if(s?(o=o&1|2,t.flags|=128):o&=1,P(to,o),Qs(e,t,r,n),r=Di?hi:0,!s&&e!==null&&e.flags&128)a:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&bc(e,n,t);else if(e.tag===19)bc(e,n,t);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break a;for(;e.sibling===null;){if(e.return===null||e.return===t)break a;e=e.return}e.sibling.return=e.return,e=e.sibling}switch(i){case`forwards`:for(n=t.child,i=null;n!==null;)e=n.alternate,e!==null&&no(e)===null&&(i=n),n=n.sibling;n=i,n===null?(i=t.child,t.child=null):(i=n.sibling,n.sibling=null),xc(t,!1,i,n,a,r);break;case`backwards`:case`unstable_legacy-backwards`:for(n=null,i=t.child,t.child=null;i!==null;){if(e=i.alternate,e!==null&&no(e)===null){t.child=i;break}e=i.sibling,i.sibling=n,n=i,i=e}xc(t,!0,n,null,a,r);break;case`together`:xc(t,!1,null,null,void 0,r);break;default:t.memoizedState=null}return t.child}function Cc(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),Ul|=t.lanes,(n&t.childLanes)===0){if(e!==null){if(Wi(e,t,n,!1),(n&t.childLanes)===0)return null}else return null}if(e!==null&&t.child!==e.child)throw Error(i(153));if(t.child!==null){for(e=t.child,n=ri(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=ri(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function wc(e,t){return(e.lanes&t)!==0||(e=e.dependencies,!!(e!==null&&Gi(e)))}function Tc(e,t,n){switch(t.tag){case 3:ue(t,t.stateNode.containerInfo),Bi(t,$i,e.memoizedState.cache),Pi();break;case 27:case 5:fe(t);break;case 4:ue(t,t.stateNode.containerInfo);break;case 10:Bi(t,t.type,t.memoizedProps.value);break;case 31:if(t.memoizedState!==null)return t.flags|=128,Za(t),null;break;case 13:var r=t.memoizedState;if(r!==null)return r.dehydrated===null?(n&t.child.childLanes)===0?(Xa(t),e=Cc(e,t,n),e===null?null:e.sibling):gc(e,t,n):(Xa(t),t.flags|=128,null);Xa(t);break;case 19:var i=!!(e.flags&128);if(r=(n&t.childLanes)!==0,r||=(Wi(e,t,n,!1),(n&t.childLanes)!==0),i){if(r)return Sc(e,t,n);t.flags|=128}if(i=t.memoizedState,i!==null&&(i.rendering=null,i.tail=null,i.lastEffect=null),P(to,to.current),r)break;return null;case 22:return t.lanes=0,nc(e,t,n,t.pendingProps);case 24:Bi(t,$i,e.memoizedState.cache)}return Cc(e,t,n)}function Ec(e,t,n){if(e!==null){if(e.memoizedProps!==t.pendingProps)Zs=!0;else{if(!wc(e,n)&&!(t.flags&128))return Zs=!1,Tc(e,t,n);Zs=!!(e.flags&131072)}}else Zs=!1,Di&&t.flags&1048576&&Si(t,hi,t.index);switch(t.lanes=0,t.tag){case 16:a:{var r=t.pendingProps;if(e=ya(t.elementType),t.type=e,typeof e==`function`)ni(e)?(r=Bs(e,r),t.tag=1,t=dc(null,t,e,r,n)):(t.tag=0,t=lc(null,t,e,r,n));else{if(e!=null){var a=e.$$typeof;if(a===S){t.tag=11,t=$s(null,t,e,r,n);break a}if(a===T){t.tag=14,t=ec(null,t,e,r,n);break a}}throw t=k(e)||e,Error(i(306,t,``))}}return t;case 0:return lc(e,t,t.type,t.pendingProps,n);case 1:return r=t.type,a=Bs(r,t.pendingProps),dc(e,t,r,a,n);case 3:a:{if(ue(t,t.stateNode.containerInfo),e===null)throw Error(i(387));r=t.pendingProps;var o=t.memoizedState;a=o.element,Na(e,t),Ba(t,r,null,n);var s=t.memoizedState;if(r=s.cache,Bi(t,$i,r),r!==o.cache&&Ui(t,[$i],n,!0),za(),r=s.element,o.isDehydrated){if(o={element:r,isDehydrated:!1,cache:s.cache},t.updateQueue.baseState=o,t.memoizedState=o,t.flags&256){t=fc(e,t,r,n);break a}if(r!==a){a=di(Error(i(424)),t),Ii(a),t=fc(e,t,r,n);break a}switch(e=t.stateNode.containerInfo,e.nodeType){case 9:e=e.body;break;default:e=e.nodeName===`HTML`?e.ownerDocument.body:e}for(Ei=cf(e.firstChild),Ti=t,Di=!0,K=null,Oi=!0,n=Aa(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling}else{if(Pi(),r===a){t=Cc(e,t,n);break a}Qs(e,t,r,n)}t=t.child}return t;case 26:return cc(e,t),e===null?(n=kf(t.type,null,t.pendingProps,null))?t.memoizedState=n:Di||(n=t.type,e=t.pendingProps,r=Bd(le.current).createElement(n),r[ot]=t,r[st]=e,Pd(r,n,e),yt(r),t.stateNode=r):t.memoizedState=kf(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return fe(t),e===null&&Di&&(r=t.stateNode=ff(t.type,t.pendingProps,le.current),Ti=t,Oi=!0,a=Ei,Zd(t.type)?(lf=a,Ei=cf(r.firstChild)):Ei=a),Qs(e,t,t.pendingProps.children,n),cc(e,t),e===null&&(t.flags|=4194304),t.child;case 5:return e===null&&Di&&((a=r=Ei)&&(r=tf(r,t.type,t.pendingProps,Oi),r===null?a=!1:(t.stateNode=r,Ti=t,Ei=cf(r.firstChild),Oi=!1,a=!0)),a||Ai(t)),fe(t),a=t.type,o=t.pendingProps,s=e===null?null:e.memoizedProps,r=o.children,Ud(a,o)?r=null:s!==null&&Ud(a,s)&&(t.flags|=32),t.memoizedState!==null&&(a=go(e,t,yo,null,null,n),Qf._currentValue=a),cc(e,t),Qs(e,t,r,n),t.child;case 6:return e===null&&Di&&((e=n=Ei)&&(n=nf(n,t.pendingProps,Oi),n===null?e=!1:(t.stateNode=n,Ti=t,Ei=null,e=!0)),e||Ai(t)),null;case 13:return gc(e,t,n);case 4:return ue(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=ka(t,null,r,n):Qs(e,t,r,n),t.child;case 11:return $s(e,t,t.type,t.pendingProps,n);case 7:return Qs(e,t,t.pendingProps,n),t.child;case 8:return Qs(e,t,t.pendingProps.children,n),t.child;case 12:return Qs(e,t,t.pendingProps.children,n),t.child;case 10:return r=t.pendingProps,Bi(t,t.type,r.value),Qs(e,t,r.children,n),t.child;case 9:return a=t.type._context,r=t.pendingProps.children,Ki(t),a=qi(a),r=r(a),t.flags|=1,Qs(e,t,r,n),t.child;case 14:return ec(e,t,t.type,t.pendingProps,n);case 15:return tc(e,t,t.type,t.pendingProps,n);case 19:return Sc(e,t,n);case 31:return sc(e,t,n);case 22:return nc(e,t,n,t.pendingProps);case 24:return Ki(t),r=qi($i),e===null?(a=ua(),a===null&&(a=Nl,o=ea(),a.pooledCache=o,o.refCount++,o!==null&&(a.pooledCacheLanes|=n),a=o),t.memoizedState={parent:r,cache:a},Ma(t),Bi(t,$i,a)):((e.lanes&n)!==0&&(Na(e,t),Ba(t,null,null,n),za()),a=e.memoizedState,o=t.memoizedState,a.parent===r?(r=o.cache,Bi(t,$i,r),r!==a.cache&&Ui(t,[$i],n,!0)):(a={parent:r,cache:r},t.memoizedState=a,t.lanes===0&&(t.memoizedState=t.updateQueue.baseState=a),Bi(t,$i,r))),Qs(e,t,t.pendingProps.children,n),t.child;case 29:throw t.pendingProps}throw Error(i(156,t.tag))}function Dc(e){e.flags|=4}function Oc(e,t,n,r,i){if((t=!!(e.mode&32))&&(t=!1),t){if(e.flags|=16777216,(i&335544128)===i){if(e.stateNode.complete)e.flags|=8192;else if(Su())e.flags|=8192;else throw ba=ga,ma}}else e.flags&=-16777217}function kc(e,t){if(t.type!==`stylesheet`||t.state.loading&4)e.flags&=-16777217;else if(e.flags|=16777216,!Wf(t)){if(Su())e.flags|=8192;else throw ba=ga,ma}}function Ac(e,t){t!==null&&(e.flags|=4),e.flags&16384&&(t=e.tag===22?536870912:Je(),e.lanes|=t,ql|=t)}function jc(e,t){if(!Di)switch(e.tailMode){case`hidden`:t=e.tail;for(var n=null;t!==null;)t.alternate!==null&&(n=t),t=t.sibling;n===null?e.tail=null:n.sibling=null;break;case`collapsed`:n=e.tail;for(var r=null;n!==null;)n.alternate!==null&&(r=n),n=n.sibling;r===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:r.sibling=null}}function Mc(e){var t=e.alternate!==null&&e.alternate.child===e.child,n=0,r=0;if(t)for(var i=e.child;i!==null;)n|=i.lanes|i.childLanes,r|=i.subtreeFlags&65011712,r|=i.flags&65011712,i.return=e,i=i.sibling;else for(i=e.child;i!==null;)n|=i.lanes|i.childLanes,r|=i.subtreeFlags,r|=i.flags,i.return=e,i=i.sibling;return e.subtreeFlags|=r,e.childLanes=n,t}function Nc(e,t,n){var r=t.pendingProps;switch(G(t),t.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Mc(t),null;case 1:return Mc(t),null;case 3:return n=t.stateNode,r=null,e!==null&&(r=e.memoizedState.cache),t.memoizedState.cache!==r&&(t.flags|=2048),Vi($i),de(),n.pendingContext&&(n.context=n.pendingContext,n.pendingContext=null),(e===null||e.child===null)&&(Ni(t)?Dc(t):e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,Fi())),Mc(t),null;case 26:var a=t.type,o=t.memoizedState;return e===null?(Dc(t),o===null?(Mc(t),Oc(t,a,null,r,n)):(Mc(t),kc(t,o))):o?o===e.memoizedState?(Mc(t),t.flags&=-16777217):(Dc(t),Mc(t),kc(t,o)):(e=e.memoizedProps,e!==r&&Dc(t),Mc(t),Oc(t,a,e,r,n)),null;case 27:if(pe(t),n=le.current,a=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==r&&Dc(t);else{if(!r){if(t.stateNode===null)throw Error(i(166));return Mc(t),null}e=se.current,Ni(t)?ji(t,e):(e=ff(a,r,n),t.stateNode=e,Dc(t))}return Mc(t),null;case 5:if(pe(t),a=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==r&&Dc(t);else{if(!r){if(t.stateNode===null)throw Error(i(166));return Mc(t),null}if(o=se.current,Ni(t))ji(t,o);else{var s=Bd(le.current);switch(o){case 1:o=s.createElementNS(`http://www.w3.org/2000/svg`,a);break;case 2:o=s.createElementNS(`http://www.w3.org/1998/Math/MathML`,a);break;default:switch(a){case`svg`:o=s.createElementNS(`http://www.w3.org/2000/svg`,a);break;case`math`:o=s.createElementNS(`http://www.w3.org/1998/Math/MathML`,a);break;case`script`:o=s.createElement(`div`),o.innerHTML=`<script><\/script>`,o=o.removeChild(o.firstChild);break;case`select`:o=typeof r.is==`string`?s.createElement(`select`,{is:r.is}):s.createElement(`select`),r.multiple?o.multiple=!0:r.size&&(o.size=r.size);break;default:o=typeof r.is==`string`?s.createElement(a,{is:r.is}):s.createElement(a)}}o[ot]=t,o[st]=r;a:for(s=t.child;s!==null;){if(s.tag===5||s.tag===6)o.appendChild(s.stateNode);else if(s.tag!==4&&s.tag!==27&&s.child!==null){s.child.return=s,s=s.child;continue}if(s===t)break a;for(;s.sibling===null;){if(s.return===null||s.return===t)break a;s=s.return}s.sibling.return=s.return,s=s.sibling}t.stateNode=o;a:switch(Pd(o,a,r),a){case`button`:case`input`:case`select`:case`textarea`:r=!!r.autoFocus;break a;case`img`:r=!0;break a;default:r=!1}r&&Dc(t)}}return Mc(t),Oc(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,n),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==r&&Dc(t);else{if(typeof r!=`string`&&t.stateNode===null)throw Error(i(166));if(e=le.current,Ni(t)){if(e=t.stateNode,n=t.memoizedProps,r=null,a=Ti,a!==null)switch(a.tag){case 27:case 5:r=a.memoizedProps}e[ot]=t,e=!!(e.nodeValue===n||r!==null&&!0===r.suppressHydrationWarning||jd(e.nodeValue,n)),e||Ai(t,!0)}else e=Bd(e).createTextNode(r),e[ot]=t,t.stateNode=e}return Mc(t),null;case 31:if(n=t.memoizedState,e===null||e.memoizedState!==null){if(r=Ni(t),n!==null){if(e===null){if(!r)throw Error(i(318));if(e=t.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(i(557));e[ot]=t}else Pi(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;Mc(t),e=!1}else n=Fi(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=n),e=!0;if(!e)return t.flags&256?(eo(t),t):(eo(t),null);if(t.flags&128)throw Error(i(558))}return Mc(t),null;case 13:if(r=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(a=Ni(t),r!==null&&r.dehydrated!==null){if(e===null){if(!a)throw Error(i(318));if(a=t.memoizedState,a=a===null?null:a.dehydrated,!a)throw Error(i(317));a[ot]=t}else Pi(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;Mc(t),a=!1}else a=Fi(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=a),a=!0;if(!a)return t.flags&256?(eo(t),t):(eo(t),null)}return eo(t),t.flags&128?(t.lanes=n,t):(n=r!==null,e=e!==null&&e.memoizedState!==null,n&&(r=t.child,a=null,r.alternate!==null&&r.alternate.memoizedState!==null&&r.alternate.memoizedState.cachePool!==null&&(a=r.alternate.memoizedState.cachePool.pool),o=null,r.memoizedState!==null&&r.memoizedState.cachePool!==null&&(o=r.memoizedState.cachePool.pool),o!==a&&(r.flags|=2048)),n!==e&&n&&(t.child.flags|=8192),Ac(t,t.updateQueue),Mc(t),null);case 4:return de(),e===null&&xd(t.stateNode.containerInfo),Mc(t),null;case 10:return Vi(t.type),Mc(t),null;case 19:if(oe(to),r=t.memoizedState,r===null)return Mc(t),null;if(a=!!(t.flags&128),o=r.rendering,o===null){if(a)jc(r,!1);else{if(Hl!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(o=no(e),o!==null){for(t.flags|=128,jc(r,!1),e=o.updateQueue,t.updateQueue=e,Ac(t,e),t.subtreeFlags=0,e=n,n=t.child;n!==null;)ii(n,e),n=n.sibling;return P(to,to.current&1|2),Di&&xi(t,r.treeForkCount),t.child}e=e.sibling}r.tail!==null&&Te()>$l&&(t.flags|=128,a=!0,jc(r,!1),t.lanes=4194304)}}else{if(!a){if(e=no(o),e!==null){if(t.flags|=128,a=!0,e=e.updateQueue,t.updateQueue=e,Ac(t,e),jc(r,!0),r.tail===null&&r.tailMode===`hidden`&&!o.alternate&&!Di)return Mc(t),null}else 2*Te()-r.renderingStartTime>$l&&n!==536870912&&(t.flags|=128,a=!0,jc(r,!1),t.lanes=4194304)}r.isBackwards?(o.sibling=t.child,t.child=o):(e=r.last,e===null?t.child=o:e.sibling=o,r.last=o)}return r.tail===null?(Mc(t),null):(e=r.tail,r.rendering=e,r.tail=e.sibling,r.renderingStartTime=Te(),e.sibling=null,n=to.current,P(to,a?n&1|2:n&1),Di&&xi(t,r.treeForkCount),e);case 22:case 23:return eo(t),qa(),r=t.memoizedState!==null,e===null?r&&(t.flags|=8192):e.memoizedState!==null!==r&&(t.flags|=8192),r?n&536870912&&!(t.flags&128)&&(Mc(t),t.subtreeFlags&6&&(t.flags|=8192)):Mc(t),n=t.updateQueue,n!==null&&Ac(t,n.retryQueue),n=null,e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(n=e.memoizedState.cachePool.pool),r=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(r=t.memoizedState.cachePool.pool),r!==n&&(t.flags|=2048),e!==null&&oe(la),null;case 24:return n=null,e!==null&&(n=e.memoizedState.cache),t.memoizedState.cache!==n&&(t.flags|=2048),Vi($i),Mc(t),null;case 25:return null;case 30:return null}throw Error(i(156,t.tag))}function Pc(e,t){switch(G(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Vi($i),de(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return pe(t),null;case 31:if(t.memoizedState!==null){if(eo(t),t.alternate===null)throw Error(i(340));Pi()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(eo(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(i(340));Pi()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return oe(to),null;case 4:return de(),null;case 10:return Vi(t.type),null;case 22:case 23:return eo(t),qa(),e!==null&&oe(la),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return Vi($i),null;case 25:return null;default:return null}}function Fc(e,t){switch(G(t),t.tag){case 3:Vi($i),de();break;case 26:case 27:case 5:pe(t);break;case 4:de();break;case 31:t.memoizedState!==null&&eo(t);break;case 13:eo(t);break;case 19:oe(to);break;case 10:Vi(t.type);break;case 22:case 23:eo(t),qa(),e!==null&&oe(la);break;case 24:Vi($i)}}function Ic(e,t){try{var n=t.updateQueue,r=n===null?null:n.lastEffect;if(r!==null){var i=r.next;n=i;do{if((n.tag&e)===e){r=void 0;var a=n.create,o=n.inst;r=a(),o.destroy=r}n=n.next}while(n!==i)}}catch(e){Uu(t,t.return,e)}}function Lc(e,t,n){try{var r=t.updateQueue,i=r===null?null:r.lastEffect;if(i!==null){var a=i.next;r=a;do{if((r.tag&e)===e){var o=r.inst,s=o.destroy;if(s!==void 0){o.destroy=void 0,i=t;var c=n,l=s;try{l()}catch(e){Uu(i,c,e)}}}r=r.next}while(r!==a)}}catch(e){Uu(t,t.return,e)}}function Rc(e){var t=e.updateQueue;if(t!==null){var n=e.stateNode;try{Ha(t,n)}catch(t){Uu(e,e.return,t)}}}function zc(e,t,n){n.props=Bs(e.type,e.memoizedProps),n.state=e.memoizedState;try{n.componentWillUnmount()}catch(n){Uu(e,t,n)}}function Bc(e,t){try{var n=e.ref;if(n!==null){switch(e.tag){case 26:case 27:case 5:var r=e.stateNode;break;case 30:r=e.stateNode;break;default:r=e.stateNode}typeof n==`function`?e.refCleanup=n(r):n.current=r}}catch(n){Uu(e,t,n)}}function Vc(e,t){var n=e.ref,r=e.refCleanup;if(n!==null){if(typeof r==`function`)try{r()}catch(n){Uu(e,t,n)}finally{e.refCleanup=null,e=e.alternate,e!=null&&(e.refCleanup=null)}else if(typeof n==`function`)try{n(null)}catch(n){Uu(e,t,n)}else n.current=null}}function Hc(e){var t=e.type,n=e.memoizedProps,r=e.stateNode;try{a:switch(t){case`button`:case`input`:case`select`:case`textarea`:n.autoFocus&&r.focus();break a;case`img`:n.src?r.src=n.src:n.srcSet&&(r.srcset=n.srcSet)}}catch(t){Uu(e,e.return,t)}}function Uc(e,t,n){try{var r=e.stateNode;Fd(r,e.type,n,t),r[st]=t}catch(t){Uu(e,e.return,t)}}function Wc(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&Zd(e.type)||e.tag===4}function Gc(e){a:for(;;){for(;e.sibling===null;){if(e.return===null||Wc(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.tag===27&&Zd(e.type)||e.flags&2||e.child===null||e.tag===4)continue a;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function Kc(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?(n.nodeType===9?n.body:n.nodeName===`HTML`?n.ownerDocument.body:n).insertBefore(e,t):(t=n.nodeType===9?n.body:n.nodeName===`HTML`?n.ownerDocument.body:n,t.appendChild(e),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=Zt));else if(r!==4&&(r===27&&Zd(e.type)&&(n=e.stateNode,t=null),e=e.child,e!==null))for(Kc(e,t,n),e=e.sibling;e!==null;)Kc(e,t,n),e=e.sibling}function qc(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(r!==4&&(r===27&&Zd(e.type)&&(n=e.stateNode),e=e.child,e!==null))for(qc(e,t,n),e=e.sibling;e!==null;)qc(e,t,n),e=e.sibling}function Jc(e){var t=e.stateNode,n=e.memoizedProps;try{for(var r=e.type,i=t.attributes;i.length;)t.removeAttributeNode(i[0]);Pd(t,r,n),t[ot]=e,t[st]=n}catch(t){Uu(e,e.return,t)}}var Yc=!1,X=!1,Xc=!1,Zc=typeof WeakSet==`function`?WeakSet:Set,Z=null;function Qc(e,t){if(e=e.containerInfo,Rd=sp,e=xr(e),Sr(e)){if(`selectionStart`in e)var n={start:e.selectionStart,end:e.selectionEnd};else a:{n=(n=e.ownerDocument)&&n.defaultView||window;var r=n.getSelection&&n.getSelection();if(r&&r.rangeCount!==0){n=r.anchorNode;var a=r.anchorOffset,o=r.focusNode;r=r.focusOffset;try{n.nodeType,o.nodeType}catch{n=null;break a}var s=0,c=-1,l=-1,u=0,d=0,f=e,p=null;b:for(;;){for(var m;f!==n||a!==0&&f.nodeType!==3||(c=s+a),f!==o||r!==0&&f.nodeType!==3||(l=s+r),f.nodeType===3&&(s+=f.nodeValue.length),(m=f.firstChild)!==null;)p=f,f=m;for(;;){if(f===e)break b;if(p===n&&++u===a&&(c=s),p===o&&++d===r&&(l=s),(m=f.nextSibling)!==null)break;f=p,p=f.parentNode}f=m}n=c===-1||l===-1?null:{start:c,end:l}}else n=null}n||={start:0,end:0}}else n=null;for(zd={focusedElem:e,selectionRange:n},sp=!1,Z=t;Z!==null;)if(t=Z,e=t.child,t.subtreeFlags&1028&&e!==null)e.return=t,Z=e;else for(;Z!==null;){switch(t=Z,o=t.alternate,e=t.flags,t.tag){case 0:if(e&4&&(e=t.updateQueue,e=e===null?null:e.events,e!==null))for(n=0;n<e.length;n++)a=e[n],a.ref.impl=a.nextImpl;break;case 11:case 15:break;case 1:if(e&1024&&o!==null){e=void 0,n=t,a=o.memoizedProps,o=o.memoizedState,r=n.stateNode;try{var h=Bs(n.type,a);e=r.getSnapshotBeforeUpdate(h,o),r.__reactInternalSnapshotBeforeUpdate=e}catch(e){Uu(n,n.return,e)}}break;case 3:if(e&1024){if(e=t.stateNode.containerInfo,n=e.nodeType,n===9)ef(e);else if(n===1)switch(e.nodeName){case`HEAD`:case`HTML`:case`BODY`:ef(e);break;default:e.textContent=``}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if(e&1024)throw Error(i(163))}if(e=t.sibling,e!==null){e.return=t.return,Z=e;break}Z=t.return}}function $c(e,t,n){var r=n.flags;switch(n.tag){case 0:case 11:case 15:ml(e,n),r&4&&Ic(5,n);break;case 1:if(ml(e,n),r&4){if(e=n.stateNode,t===null)try{e.componentDidMount()}catch(e){Uu(n,n.return,e)}else{var i=Bs(n.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(i,t,e.__reactInternalSnapshotBeforeUpdate)}catch(e){Uu(n,n.return,e)}}}r&64&&Rc(n),r&512&&Bc(n,n.return);break;case 3:if(ml(e,n),r&64&&(e=n.updateQueue,e!==null)){if(t=null,n.child!==null)switch(n.child.tag){case 27:case 5:t=n.child.stateNode;break;case 1:t=n.child.stateNode}try{Ha(e,t)}catch(e){Uu(n,n.return,e)}}break;case 27:t===null&&r&4&&Jc(n);case 26:case 5:ml(e,n),t===null&&r&4&&Hc(n),r&512&&Bc(n,n.return);break;case 12:ml(e,n);break;case 31:ml(e,n),r&4&&al(e,n);break;case 13:ml(e,n),r&4&&ol(e,n),r&64&&(e=n.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(n=qu.bind(null,n),sf(e,n))));break;case 22:if(r=n.memoizedState!==null||Yc,!r){t=t!==null&&t.memoizedState!==null||X,i=Yc;var a=X;Yc=r,(X=t)&&!a?gl(e,n,!!(n.subtreeFlags&8772)):ml(e,n),Yc=i,X=a}break;case 30:break;default:ml(e,n)}}function el(e){var t=e.alternate;t!==null&&(e.alternate=null,el(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&mt(t)),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}var tl=null,nl=!1;function rl(e,t,n){for(n=n.child;n!==null;)il(e,t,n),n=n.sibling}function il(e,t,n){if(Fe&&typeof Fe.onCommitFiberUnmount==`function`)try{Fe.onCommitFiberUnmount(Pe,n)}catch{}switch(n.tag){case 26:X||Vc(n,t),rl(e,t,n),n.memoizedState?n.memoizedState.count--:n.stateNode&&(n=n.stateNode,n.parentNode.removeChild(n));break;case 27:X||Vc(n,t);var r=tl,i=nl;Zd(n.type)&&(tl=n.stateNode,nl=!1),rl(e,t,n),pf(n.stateNode),tl=r,nl=i;break;case 5:X||Vc(n,t);case 6:if(r=tl,i=nl,tl=null,rl(e,t,n),tl=r,nl=i,tl!==null){if(nl)try{(tl.nodeType===9?tl.body:tl.nodeName===`HTML`?tl.ownerDocument.body:tl).removeChild(n.stateNode)}catch(e){Uu(n,t,e)}else try{tl.removeChild(n.stateNode)}catch(e){Uu(n,t,e)}}break;case 18:tl!==null&&(nl?(e=tl,Qd(e.nodeType===9?e.body:e.nodeName===`HTML`?e.ownerDocument.body:e,n.stateNode),Np(e)):Qd(tl,n.stateNode));break;case 4:r=tl,i=nl,tl=n.stateNode.containerInfo,nl=!0,rl(e,t,n),tl=r,nl=i;break;case 0:case 11:case 14:case 15:Lc(2,n,t),X||Lc(4,n,t),rl(e,t,n);break;case 1:X||(Vc(n,t),r=n.stateNode,typeof r.componentWillUnmount==`function`&&zc(n,t,r)),rl(e,t,n);break;case 21:rl(e,t,n);break;case 22:X=(r=X)||n.memoizedState!==null,rl(e,t,n),X=r;break;default:rl(e,t,n)}}function al(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{Np(e)}catch(e){Uu(t,t.return,e)}}}function ol(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{Np(e)}catch(e){Uu(t,t.return,e)}}function sl(e){switch(e.tag){case 31:case 13:case 19:var t=e.stateNode;return t===null&&(t=e.stateNode=new Zc),t;case 22:return e=e.stateNode,t=e._retryCache,t===null&&(t=e._retryCache=new Zc),t;default:throw Error(i(435,e.tag))}}function cl(e,t){var n=sl(e);t.forEach(function(t){if(!n.has(t)){n.add(t);var r=Ju.bind(null,e,t);t.then(r,r)}})}function ll(e,t){var n=t.deletions;if(n!==null)for(var r=0;r<n.length;r++){var a=n[r],o=e,s=t,c=s;a:for(;c!==null;){switch(c.tag){case 27:if(Zd(c.type)){tl=c.stateNode,nl=!1;break a}break;case 5:tl=c.stateNode,nl=!1;break a;case 3:case 4:tl=c.stateNode.containerInfo,nl=!0;break a}c=c.return}if(tl===null)throw Error(i(160));il(o,s,a),tl=null,nl=!1,o=a.alternate,o!==null&&(o.return=null),a.return=null}if(t.subtreeFlags&13886)for(t=t.child;t!==null;)dl(t,e),t=t.sibling}var ul=null;function dl(e,t){var n=e.alternate,r=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:ll(t,e),fl(e),r&4&&(Lc(3,e,e.return),Ic(3,e),Lc(5,e,e.return));break;case 1:ll(t,e),fl(e),r&512&&(X||n===null||Vc(n,n.return)),r&64&&Yc&&(e=e.updateQueue,e!==null&&(r=e.callbacks,r!==null&&(n=e.shared.hiddenCallbacks,e.shared.hiddenCallbacks=n===null?r:n.concat(r))));break;case 26:var a=ul;if(ll(t,e),fl(e),r&512&&(X||n===null||Vc(n,n.return)),r&4){var o=n===null?null:n.memoizedState;if(r=e.memoizedState,n===null){if(r===null){if(e.stateNode===null){a:{r=e.type,n=e.memoizedProps,a=a.ownerDocument||a;b:switch(r){case`title`:o=a.getElementsByTagName(`title`)[0],(!o||o[pt]||o[ot]||o.namespaceURI===`http://www.w3.org/2000/svg`||o.hasAttribute(`itemprop`))&&(o=a.createElement(r),a.head.insertBefore(o,a.querySelector(`head > title`))),Pd(o,r,n),o[ot]=e,yt(o),r=o;break a;case`link`:var s=Vf(`link`,`href`,a).get(r+(n.href||``));if(s){for(var c=0;c<s.length;c++)if(o=s[c],o.getAttribute(`href`)===(n.href==null||n.href===``?null:n.href)&&o.getAttribute(`rel`)===(n.rel==null?null:n.rel)&&o.getAttribute(`title`)===(n.title==null?null:n.title)&&o.getAttribute(`crossorigin`)===(n.crossOrigin==null?null:n.crossOrigin)){s.splice(c,1);break b}}o=a.createElement(r),Pd(o,r,n),a.head.appendChild(o);break;case`meta`:if(s=Vf(`meta`,`content`,a).get(r+(n.content||``))){for(c=0;c<s.length;c++)if(o=s[c],o.getAttribute(`content`)===(n.content==null?null:``+n.content)&&o.getAttribute(`name`)===(n.name==null?null:n.name)&&o.getAttribute(`property`)===(n.property==null?null:n.property)&&o.getAttribute(`http-equiv`)===(n.httpEquiv==null?null:n.httpEquiv)&&o.getAttribute(`charset`)===(n.charSet==null?null:n.charSet)){s.splice(c,1);break b}}o=a.createElement(r),Pd(o,r,n),a.head.appendChild(o);break;default:throw Error(i(468,r))}o[ot]=e,yt(o),r=o}e.stateNode=r}else Hf(a,e.type,e.stateNode)}else e.stateNode=If(a,r,e.memoizedProps)}else o===r?r===null&&e.stateNode!==null&&Uc(e,e.memoizedProps,n.memoizedProps):(o===null?n.stateNode!==null&&(n=n.stateNode,n.parentNode.removeChild(n)):o.count--,r===null?Hf(a,e.type,e.stateNode):If(a,r,e.memoizedProps))}break;case 27:ll(t,e),fl(e),r&512&&(X||n===null||Vc(n,n.return)),n!==null&&r&4&&Uc(e,e.memoizedProps,n.memoizedProps);break;case 5:if(ll(t,e),fl(e),r&512&&(X||n===null||Vc(n,n.return)),e.flags&32){a=e.stateNode;try{R(a,``)}catch(t){Uu(e,e.return,t)}}r&4&&e.stateNode!=null&&(a=e.memoizedProps,Uc(e,a,n===null?a:n.memoizedProps)),r&1024&&(Xc=!0);break;case 6:if(ll(t,e),fl(e),r&4){if(e.stateNode===null)throw Error(i(162));r=e.memoizedProps,n=e.stateNode;try{n.nodeValue=r}catch(t){Uu(e,e.return,t)}}break;case 3:if(Bf=null,a=ul,ul=gf(t.containerInfo),ll(t,e),ul=a,fl(e),r&4&&n!==null&&n.memoizedState.isDehydrated)try{Np(t.containerInfo)}catch(t){Uu(e,e.return,t)}Xc&&(Xc=!1,pl(e));break;case 4:r=ul,ul=gf(e.stateNode.containerInfo),ll(t,e),fl(e),ul=r;break;case 12:ll(t,e),fl(e);break;case 31:ll(t,e),fl(e),r&4&&(r=e.updateQueue,r!==null&&(e.updateQueue=null,cl(e,r)));break;case 13:ll(t,e),fl(e),e.child.flags&8192&&e.memoizedState!==null!=(n!==null&&n.memoizedState!==null)&&(Zl=Te()),r&4&&(r=e.updateQueue,r!==null&&(e.updateQueue=null,cl(e,r)));break;case 22:a=e.memoizedState!==null;var l=n!==null&&n.memoizedState!==null,u=Yc,d=X;if(Yc=u||a,X=d||l,ll(t,e),X=d,Yc=u,fl(e),r&8192)a:for(t=e.stateNode,t._visibility=a?t._visibility&-2:t._visibility|1,a&&(n===null||l||Yc||X||hl(e)),n=null,t=e;;){if(t.tag===5||t.tag===26){if(n===null){l=n=t;try{if(o=l.stateNode,a)s=o.style,typeof s.setProperty==`function`?s.setProperty(`display`,`none`,`important`):s.display=`none`;else{c=l.stateNode;var f=l.memoizedProps.style,p=f!=null&&f.hasOwnProperty(`display`)?f.display:null;c.style.display=p==null||typeof p==`boolean`?``:(``+p).trim()}}catch(e){Uu(l,l.return,e)}}}else if(t.tag===6){if(n===null){l=t;try{l.stateNode.nodeValue=a?``:l.memoizedProps}catch(e){Uu(l,l.return,e)}}}else if(t.tag===18){if(n===null){l=t;try{var m=l.stateNode;a?$d(m,!0):$d(l.stateNode,!1)}catch(e){Uu(l,l.return,e)}}}else if((t.tag!==22&&t.tag!==23||t.memoizedState===null||t===e)&&t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break a;for(;t.sibling===null;){if(t.return===null||t.return===e)break a;n===t&&(n=null),t=t.return}n===t&&(n=null),t.sibling.return=t.return,t=t.sibling}r&4&&(r=e.updateQueue,r!==null&&(n=r.retryQueue,n!==null&&(r.retryQueue=null,cl(e,n))));break;case 19:ll(t,e),fl(e),r&4&&(r=e.updateQueue,r!==null&&(e.updateQueue=null,cl(e,r)));break;case 30:break;case 21:break;default:ll(t,e),fl(e)}}function fl(e){var t=e.flags;if(t&2){try{for(var n,r=e.return;r!==null;){if(Wc(r)){n=r;break}r=r.return}if(n==null)throw Error(i(160));switch(n.tag){case 27:var a=n.stateNode;qc(e,Gc(e),a);break;case 5:var o=n.stateNode;n.flags&32&&(R(o,``),n.flags&=-33),qc(e,Gc(e),o);break;case 3:case 4:var s=n.stateNode.containerInfo;Kc(e,Gc(e),s);break;default:throw Error(i(161))}}catch(t){Uu(e,e.return,t)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function pl(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var t=e;pl(t),t.tag===5&&t.flags&1024&&t.stateNode.reset(),e=e.sibling}}function ml(e,t){if(t.subtreeFlags&8772)for(t=t.child;t!==null;)$c(e,t.alternate,t),t=t.sibling}function hl(e){for(e=e.child;e!==null;){var t=e;switch(t.tag){case 0:case 11:case 14:case 15:Lc(4,t,t.return),hl(t);break;case 1:Vc(t,t.return);var n=t.stateNode;typeof n.componentWillUnmount==`function`&&zc(t,t.return,n),hl(t);break;case 27:pf(t.stateNode);case 26:case 5:Vc(t,t.return),hl(t);break;case 22:t.memoizedState===null&&hl(t);break;case 30:hl(t);break;default:hl(t)}e=e.sibling}}function gl(e,t,n){for(n&&=!!(t.subtreeFlags&8772),t=t.child;t!==null;){var r=t.alternate,i=e,a=t,o=a.flags;switch(a.tag){case 0:case 11:case 15:gl(i,a,n),Ic(4,a);break;case 1:if(gl(i,a,n),r=a,i=r.stateNode,typeof i.componentDidMount==`function`)try{i.componentDidMount()}catch(e){Uu(r,r.return,e)}if(r=a,i=r.updateQueue,i!==null){var s=r.stateNode;try{var c=i.shared.hiddenCallbacks;if(c!==null)for(i.shared.hiddenCallbacks=null,i=0;i<c.length;i++)Va(c[i],s)}catch(e){Uu(r,r.return,e)}}n&&o&64&&Rc(a),Bc(a,a.return);break;case 27:Jc(a);case 26:case 5:gl(i,a,n),n&&r===null&&o&4&&Hc(a),Bc(a,a.return);break;case 12:gl(i,a,n);break;case 31:gl(i,a,n),n&&o&4&&al(i,a);break;case 13:gl(i,a,n),n&&o&4&&ol(i,a);break;case 22:a.memoizedState===null&&gl(i,a,n),Bc(a,a.return);break;case 30:break;default:gl(i,a,n)}t=t.sibling}}function _l(e,t){var n=null;e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(n=e.memoizedState.cachePool.pool),e=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(e=t.memoizedState.cachePool.pool),e!==n&&(e!=null&&e.refCount++,n!=null&&ta(n))}function vl(e,t){e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&ta(e))}function yl(e,t,n,r){if(t.subtreeFlags&10256)for(t=t.child;t!==null;)bl(e,t,n,r),t=t.sibling}function bl(e,t,n,r){var i=t.flags;switch(t.tag){case 0:case 11:case 15:yl(e,t,n,r),i&2048&&Ic(9,t);break;case 1:yl(e,t,n,r);break;case 3:yl(e,t,n,r),i&2048&&(e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&ta(e)));break;case 12:if(i&2048){yl(e,t,n,r),e=t.stateNode;try{var a=t.memoizedProps,o=a.id,s=a.onPostCommit;typeof s==`function`&&s(o,t.alternate===null?`mount`:`update`,e.passiveEffectDuration,-0)}catch(e){Uu(t,t.return,e)}}else yl(e,t,n,r);break;case 31:yl(e,t,n,r);break;case 13:yl(e,t,n,r);break;case 23:break;case 22:a=t.stateNode,o=t.alternate,t.memoizedState===null?a._visibility&2?yl(e,t,n,r):(a._visibility|=2,Q(e,t,n,r,!!(t.subtreeFlags&10256)||!1)):a._visibility&2?yl(e,t,n,r):xl(e,t),i&2048&&_l(o,t);break;case 24:yl(e,t,n,r),i&2048&&vl(t.alternate,t);break;default:yl(e,t,n,r)}}function Q(e,t,n,r,i){for(i&&=!!(t.subtreeFlags&10256)||!1,t=t.child;t!==null;){var a=e,o=t,s=n,c=r,l=o.flags;switch(o.tag){case 0:case 11:case 15:Q(a,o,s,c,i),Ic(8,o);break;case 23:break;case 22:var u=o.stateNode;o.memoizedState===null?(u._visibility|=2,Q(a,o,s,c,i)):u._visibility&2?Q(a,o,s,c,i):xl(a,o),i&&l&2048&&_l(o.alternate,o);break;case 24:Q(a,o,s,c,i),i&&l&2048&&vl(o.alternate,o);break;default:Q(a,o,s,c,i)}t=t.sibling}}function xl(e,t){if(t.subtreeFlags&10256)for(t=t.child;t!==null;){var n=e,r=t,i=r.flags;switch(r.tag){case 22:xl(n,r),i&2048&&_l(r.alternate,r);break;case 24:xl(n,r),i&2048&&vl(r.alternate,r);break;default:xl(n,r)}t=t.sibling}}var Sl=8192;function Cl(e,t,n){if(e.subtreeFlags&Sl)for(e=e.child;e!==null;)wl(e,t,n),e=e.sibling}function wl(e,t,n){switch(e.tag){case 26:Cl(e,t,n),e.flags&Sl&&e.memoizedState!==null&&Gf(n,ul,e.memoizedState,e.memoizedProps);break;case 5:Cl(e,t,n);break;case 3:case 4:var r=ul;ul=gf(e.stateNode.containerInfo),Cl(e,t,n),ul=r;break;case 22:e.memoizedState===null&&(r=e.alternate,r!==null&&r.memoizedState!==null?(r=Sl,Sl=16777216,Cl(e,t,n),Sl=r):Cl(e,t,n));break;default:Cl(e,t,n)}}function Tl(e){var t=e.alternate;if(t!==null&&(e=t.child,e!==null)){t.child=null;do t=e.sibling,e.sibling=null,e=t;while(e!==null)}}function El(e){var t=e.deletions;if(e.flags&16){if(t!==null)for(var n=0;n<t.length;n++){var r=t[n];Z=r,kl(r,e)}Tl(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)Dl(e),e=e.sibling}function Dl(e){switch(e.tag){case 0:case 11:case 15:El(e),e.flags&2048&&Lc(9,e,e.return);break;case 3:El(e);break;case 12:El(e);break;case 22:var t=e.stateNode;e.memoizedState!==null&&t._visibility&2&&(e.return===null||e.return.tag!==13)?(t._visibility&=-3,Ol(e)):El(e);break;default:El(e)}}function Ol(e){var t=e.deletions;if(e.flags&16){if(t!==null)for(var n=0;n<t.length;n++){var r=t[n];Z=r,kl(r,e)}Tl(e)}for(e=e.child;e!==null;){switch(t=e,t.tag){case 0:case 11:case 15:Lc(8,t,t.return),Ol(t);break;case 22:n=t.stateNode,n._visibility&2&&(n._visibility&=-3,Ol(t));break;default:Ol(t)}e=e.sibling}}function kl(e,t){for(;Z!==null;){var n=Z;switch(n.tag){case 0:case 11:case 15:Lc(8,n,t);break;case 23:case 22:if(n.memoizedState!==null&&n.memoizedState.cachePool!==null){var r=n.memoizedState.cachePool.pool;r!=null&&r.refCount++}break;case 24:ta(n.memoizedState.cache)}if(r=n.child,r!==null)r.return=n,Z=r;else a:for(n=e;Z!==null;){r=Z;var i=r.sibling,a=r.return;if(el(r),r===n){Z=null;break a}if(i!==null){i.return=a,Z=i;break a}Z=a}}}var Al={getCacheForType:function(e){var t=qi($i),n=t.data.get(e);return n===void 0&&(n=e(),t.data.set(e,n)),n},cacheSignal:function(){return qi($i).controller.signal}},jl=typeof WeakMap==`function`?WeakMap:Map,Ml=0,Nl=null,Pl=null,Fl=0,Il=0,Ll=null,Rl=!1,zl=!1,Bl=!1,Vl=0,Hl=0,Ul=0,Wl=0,Gl=0,Kl=0,ql=0,Jl=null,Yl=null,Xl=!1,Zl=0,Ql=0,$l=1/0,eu=null,tu=null,nu=0,ru=null,iu=null,au=0,ou=0,su=null,cu=null,lu=0,uu=null;function du(){return Ml&2&&Fl!==0?Fl&-Fl:j.T===null?rt():ud()}function fu(){if(Kl===0){if(!(Fl&536870912)||Di){var e=He;He<<=1,!(He&3932160)&&(He=262144),Kl=e}else Kl=536870912}return e=Ja.current,e!==null&&(e.flags|=32),Kl}function pu(e,t,n){(e===Nl&&(Il===2||Il===9)||e.cancelPendingCommit!==null)&&(bu(e,0),_u(e,Fl,Kl,!1)),Xe(e,n),Ml&2&&e===Nl||(e===Nl&&(!(Ml&2)&&(Wl|=n),Hl===4&&_u(e,Fl,Kl,!1)),nd(e))}function mu(e,t,n){if(Ml&6)throw Error(i(327));var r=!n&&!(t&127)&&(t&e.expiredLanes)===0||Ke(e,t),a=r?Ou(e,t):Eu(e,t,!0),o=r;do{if(a===0){zl&&!r&&_u(e,t,0,!1);break}if(n=e.current.alternate,o&&!gu(n))a=Eu(e,t,!1),o=!1;else{if(a===2){if(o=t,e.errorRecoveryDisabledLanes&o)var s=0;else s=e.pendingLanes&-536870913,s=s===0?s&536870912?536870912:0:s;if(s!==0){t=s;a:{var c=e;a=Jl;var l=c.current.memoizedState.isDehydrated;if(l&&(bu(c,s).flags|=256),s=Eu(c,s,!1),s!==2){if(Bl&&!l){c.errorRecoveryDisabledLanes|=o,Wl|=o,a=4;break a}o=Yl,Yl=a,o!==null&&(Yl===null?Yl=o:Yl.push.apply(Yl,o))}a=s}if(o=!1,a!==2)continue}}if(a===1){bu(e,0),_u(e,t,0,!0);break}a:{switch(r=e,o=a,o){case 0:case 1:throw Error(i(345));case 4:if((t&4194048)!==t)break;case 6:_u(r,t,Kl,!Rl);break a;case 2:Yl=null;break;case 3:case 5:break;default:throw Error(i(329))}if((t&62914560)===t&&(a=Zl+300-Te(),10<a)){if(_u(r,t,Kl,!Rl),Ge(r,0,!0)!==0)break a;au=t,r.timeoutHandle=Kd(hu.bind(null,r,n,Yl,eu,Xl,t,Kl,Wl,ql,Rl,o,`Throttled`,-0,0),a);break a}hu(r,n,Yl,eu,Xl,t,Kl,Wl,ql,Rl,o,null,-0,0)}break}}while(1);nd(e)}function hu(e,t,n,r,i,a,o,s,c,l,u,d,f,p){if(e.timeoutHandle=-1,d=t.subtreeFlags,d&8192||(d&16785408)==16785408){d={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:Zt},wl(t,a,d);var m=(a&62914560)===a?Zl-Te():(a&4194048)===a?Ql-Te():0;if(m=qf(d,m),m!==null){au=a,e.cancelPendingCommit=m(Fu.bind(null,e,t,a,n,r,i,o,s,c,u,d,null,f,p)),_u(e,a,o,!l);return}}Fu(e,t,a,n,r,i,o,s,c)}function gu(e){for(var t=e;;){var n=t.tag;if((n===0||n===11||n===15)&&t.flags&16384&&(n=t.updateQueue,n!==null&&(n=n.stores,n!==null)))for(var r=0;r<n.length;r++){var i=n[r],a=i.getSnapshot;i=i.value;try{if(!_r(a(),i))return!1}catch{return!1}}if(n=t.child,t.subtreeFlags&16384&&n!==null)n.return=t,t=n;else{if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return!0;t=t.return}t.sibling.return=t.return,t=t.sibling}}return!0}function _u(e,t,n,r){t&=~Gl,t&=~Wl,e.suspendedLanes|=t,e.pingedLanes&=~t,r&&(e.warmLanes|=t),r=e.expirationTimes;for(var i=t;0<i;){var a=31-Le(i),o=1<<a;r[a]=-1,i&=~o}n!==0&&Qe(e,n,t)}function vu(){return Ml&6?!0:(rd(0,!1),!1)}function yu(){if(Pl!==null){if(Il===0)var e=Pl.return;else e=Pl,zi=Ri=null,So(e),Ca=null,wa=0,e=Pl;for(;e!==null;)Fc(e.alternate,e),e=e.return;Pl=null}}function bu(e,t){var n=e.timeoutHandle;n!==-1&&(e.timeoutHandle=-1,qd(n)),n=e.cancelPendingCommit,n!==null&&(e.cancelPendingCommit=null,n()),au=0,yu(),Nl=e,Pl=n=ri(e.current,null),Fl=t,Il=0,Ll=null,Rl=!1,zl=Ke(e,t),Bl=!1,ql=Kl=Gl=Wl=Ul=Hl=0,Yl=Jl=null,Xl=!1,t&8&&(t|=t&32);var r=e.entangledLanes;if(r!==0)for(e=e.entanglements,r&=t;0<r;){var i=31-Le(r),a=1<<i;t|=e[i],r&=~a}return Vl=t,qr(),n}function xu(e,t){Y=null,j.H=Ms,t===pa||t===ha?(t=xa(),Il=3):t===ma?(t=xa(),Il=4):Il=t===Xs?8:typeof t==`object`&&t&&typeof t.then==`function`?6:1,Ll=t,Pl===null&&(Hl=1,Ws(e,di(t,e.current)))}function Su(){var e=Ja.current;return e===null?!0:(Fl&4194048)===Fl?Ya===null:(Fl&62914560)===Fl||Fl&536870912?e===Ya:!1}function Cu(){var e=j.H;return j.H=Ms,e===null?Ms:e}function wu(){var e=j.A;return j.A=Al,e}function Tu(){Hl=4,Rl||(Fl&4194048)!==Fl&&Ja.current!==null||(zl=!0),!(Ul&134217727)&&!(Wl&134217727)||Nl===null||_u(Nl,Fl,Kl,!1)}function Eu(e,t,n){var r=Ml;Ml|=2;var i=Cu(),a=wu();(Nl!==e||Fl!==t)&&(eu=null,bu(e,t)),t=!1;var o=Hl;a:do try{if(Il!==0&&Pl!==null){var s=Pl,c=Ll;switch(Il){case 8:yu(),o=6;break a;case 3:case 2:case 9:case 6:Ja.current===null&&(t=!0);var l=Il;if(Il=0,Ll=null,Mu(e,s,c,l),n&&zl){o=0;break a}break;default:l=Il,Il=0,Ll=null,Mu(e,s,c,l)}}Du(),o=Hl;break}catch(t){xu(e,t)}while(1);return t&&e.shellSuspendCounter++,zi=Ri=null,Ml=r,j.H=i,j.A=a,Pl===null&&(Nl=null,Fl=0,qr()),o}function Du(){for(;Pl!==null;)Au(Pl)}function Ou(e,t){var n=Ml;Ml|=2;var r=Cu(),a=wu();Nl!==e||Fl!==t?(eu=null,$l=Te()+500,bu(e,t)):zl=Ke(e,t);a:do try{if(Il!==0&&Pl!==null){t=Pl;var o=Ll;b:switch(Il){case 1:Il=0,Ll=null,Mu(e,t,o,1);break;case 2:case 9:if(_a(o)){Il=0,Ll=null,ju(t);break}t=function(){Il!==2&&Il!==9||Nl!==e||(Il=7),nd(e)},o.then(t,t);break a;case 3:Il=7;break a;case 4:Il=5;break a;case 7:_a(o)?(Il=0,Ll=null,ju(t)):(Il=0,Ll=null,Mu(e,t,o,7));break;case 5:var s=null;switch(Pl.tag){case 26:s=Pl.memoizedState;case 5:case 27:var c=Pl;if(s?Wf(s):c.stateNode.complete){Il=0,Ll=null;var l=c.sibling;if(l!==null)Pl=l;else{var u=c.return;u===null?Pl=null:(Pl=u,Nu(u))}break b}}Il=0,Ll=null,Mu(e,t,o,5);break;case 6:Il=0,Ll=null,Mu(e,t,o,6);break;case 8:yu(),Hl=6;break a;default:throw Error(i(462))}}ku();break}catch(t){xu(e,t)}while(1);return zi=Ri=null,j.H=r,j.A=a,Ml=n,Pl===null?(Nl=null,Fl=0,qr(),Hl):0}function ku(){for(;Pl!==null&&!Ce();)Au(Pl)}function Au(e){var t=Ec(e.alternate,e,Vl);e.memoizedProps=e.pendingProps,t===null?Nu(e):Pl=t}function ju(e){var t=e,n=t.alternate;switch(t.tag){case 15:case 0:t=uc(n,t,t.pendingProps,t.type,void 0,Fl);break;case 11:t=uc(n,t,t.pendingProps,t.type.render,t.ref,Fl);break;case 5:So(t);default:Fc(n,t),t=Pl=ii(t,Vl),t=Ec(n,t,Vl)}e.memoizedProps=e.pendingProps,t===null?Nu(e):Pl=t}function Mu(e,t,n,r){zi=Ri=null,So(t),Ca=null,wa=0;var i=t.return;try{if(Ys(e,i,t,n,Fl)){Hl=1,Ws(e,di(n,e.current)),Pl=null;return}}catch(t){if(i!==null)throw Pl=i,t;Hl=1,Ws(e,di(n,e.current)),Pl=null;return}t.flags&32768?(Di||r===1?e=!0:zl||Fl&536870912?e=!1:(Rl=e=!0,(r===2||r===9||r===3||r===6)&&(r=Ja.current,r!==null&&r.tag===13&&(r.flags|=16384))),Pu(t,e)):Nu(t)}function Nu(e){var t=e;do{if(t.flags&32768){Pu(t,Rl);return}e=t.return;var n=Nc(t.alternate,t,Vl);if(n!==null){Pl=n;return}if(t=t.sibling,t!==null){Pl=t;return}Pl=t=e}while(t!==null);Hl===0&&(Hl=5)}function Pu(e,t){do{var n=Pc(e.alternate,e);if(n!==null){n.flags&=32767,Pl=n;return}if(n=e.return,n!==null&&(n.flags|=32768,n.subtreeFlags=0,n.deletions=null),!t&&(e=e.sibling,e!==null)){Pl=e;return}Pl=e=n}while(e!==null);Hl=6,Pl=null}function Fu(e,t,n,r,a,o,s,c,l){e.cancelPendingCommit=null;do Bu();while(nu!==0);if(Ml&6)throw Error(i(327));if(t!==null){if(t===e.current)throw Error(i(177));if(o=t.lanes|t.childLanes,o|=Kr,Ze(e,n,o,s,c,l),e===Nl&&(Pl=Nl=null,Fl=0),iu=t,ru=e,au=n,ou=o,su=a,cu=r,t.subtreeFlags&10256||t.flags&10256?(e.callbackNode=null,e.callbackPriority=0,Yu(ke,function(){return Vu(),null})):(e.callbackNode=null,e.callbackPriority=0),r=!!(t.flags&13878),t.subtreeFlags&13878||r){r=j.T,j.T=null,a=M.p,M.p=2,s=Ml,Ml|=4;try{Qc(e,t,n)}finally{Ml=s,M.p=a,j.T=r}}nu=1,Iu(),Lu(),Ru()}}function Iu(){if(nu===1){nu=0;var e=ru,t=iu,n=!!(t.flags&13878);if(t.subtreeFlags&13878||n){n=j.T,j.T=null;var r=M.p;M.p=2;var i=Ml;Ml|=4;try{dl(t,e);var a=zd,o=xr(e.containerInfo),s=a.focusedElem,c=a.selectionRange;if(o!==s&&s&&s.ownerDocument&&br(s.ownerDocument.documentElement,s)){if(c!==null&&Sr(s)){var l=c.start,u=c.end;if(u===void 0&&(u=l),`selectionStart`in s)s.selectionStart=l,s.selectionEnd=Math.min(u,s.value.length);else{var d=s.ownerDocument||document,f=d&&d.defaultView||window;if(f.getSelection){var p=f.getSelection(),m=s.textContent.length,h=Math.min(c.start,m),g=c.end===void 0?h:Math.min(c.end,m);!p.extend&&h>g&&(o=g,g=h,h=o);var _=yr(s,h),v=yr(s,g);if(_&&v&&(p.rangeCount!==1||p.anchorNode!==_.node||p.anchorOffset!==_.offset||p.focusNode!==v.node||p.focusOffset!==v.offset)){var y=d.createRange();y.setStart(_.node,_.offset),p.removeAllRanges(),h>g?(p.addRange(y),p.extend(v.node,v.offset)):(y.setEnd(v.node,v.offset),p.addRange(y))}}}}for(d=[],p=s;p=p.parentNode;)p.nodeType===1&&d.push({element:p,left:p.scrollLeft,top:p.scrollTop});for(typeof s.focus==`function`&&s.focus(),s=0;s<d.length;s++){var b=d[s];b.element.scrollLeft=b.left,b.element.scrollTop=b.top}}sp=!!Rd,zd=Rd=null}finally{Ml=i,M.p=r,j.T=n}}e.current=t,nu=2}}function Lu(){if(nu===2){nu=0;var e=ru,t=iu,n=!!(t.flags&8772);if(t.subtreeFlags&8772||n){n=j.T,j.T=null;var r=M.p;M.p=2;var i=Ml;Ml|=4;try{$c(e,t.alternate,t)}finally{Ml=i,M.p=r,j.T=n}}nu=3}}function Ru(){if(nu===4||nu===3){nu=0,we();var e=ru,t=iu,n=au,r=cu;t.subtreeFlags&10256||t.flags&10256?nu=5:(nu=0,iu=ru=null,zu(e,e.pendingLanes));var i=e.pendingLanes;if(i===0&&(tu=null),nt(n),t=t.stateNode,Fe&&typeof Fe.onCommitFiberRoot==`function`)try{Fe.onCommitFiberRoot(Pe,t,void 0,(t.current.flags&128)==128)}catch{}if(r!==null){t=j.T,i=M.p,M.p=2,j.T=null;try{for(var a=e.onRecoverableError,o=0;o<r.length;o++){var s=r[o];a(s.value,{componentStack:s.stack})}}finally{j.T=t,M.p=i}}au&3&&Bu(),nd(e),i=e.pendingLanes,n&261930&&i&42?e===uu?lu++:(lu=0,uu=e):lu=0,rd(0,!1)}}function zu(e,t){(e.pooledCacheLanes&=t)===0&&(t=e.pooledCache,t!=null&&(e.pooledCache=null,ta(t)))}function Bu(){return Iu(),Lu(),Ru(),Vu()}function Vu(){if(nu!==5)return!1;var e=ru,t=ou;ou=0;var n=nt(au),r=j.T,a=M.p;try{M.p=32>n?32:n,j.T=null,n=su,su=null;var o=ru,s=au;if(nu=0,iu=ru=null,au=0,Ml&6)throw Error(i(331));var c=Ml;if(Ml|=4,Dl(o.current),bl(o,o.current,s,n),Ml=c,rd(0,!1),Fe&&typeof Fe.onPostCommitFiberRoot==`function`)try{Fe.onPostCommitFiberRoot(Pe,o)}catch{}return!0}finally{M.p=a,j.T=r,zu(e,t)}}function Hu(e,t,n){t=di(n,t),t=Ks(e.stateNode,t,2),e=Fa(e,t,2),e!==null&&(Xe(e,2),nd(e))}function Uu(e,t,n){if(e.tag===3)Hu(e,e,n);else for(;t!==null;){if(t.tag===3){Hu(t,e,n);break}if(t.tag===1){var r=t.stateNode;if(typeof t.type.getDerivedStateFromError==`function`||typeof r.componentDidCatch==`function`&&(tu===null||!tu.has(r))){e=di(n,e),n=qs(2),r=Fa(t,n,2),r!==null&&(Js(n,r,t,e),Xe(r,2),nd(r));break}}t=t.return}}function Wu(e,t,n){var r=e.pingCache;if(r===null){r=e.pingCache=new jl;var i=new Set;r.set(t,i)}else i=r.get(t),i===void 0&&(i=new Set,r.set(t,i));i.has(n)||(Bl=!0,i.add(n),e=Gu.bind(null,e,t,n),t.then(e,e))}function Gu(e,t,n){var r=e.pingCache;r!==null&&r.delete(t),e.pingedLanes|=e.suspendedLanes&n,e.warmLanes&=~n,Nl===e&&(Fl&n)===n&&(Hl===4||Hl===3&&(Fl&62914560)===Fl&&300>Te()-Zl?!(Ml&2)&&bu(e,0):Gl|=n,ql===Fl&&(ql=0)),nd(e)}function Ku(e,t){t===0&&(t=Je()),e=Xr(e,t),e!==null&&(Xe(e,t),nd(e))}function qu(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),Ku(e,n)}function Ju(e,t){var n=0;switch(e.tag){case 31:case 13:var r=e.stateNode,a=e.memoizedState;a!==null&&(n=a.retryLane);break;case 19:r=e.stateNode;break;case 22:r=e.stateNode._retryCache;break;default:throw Error(i(314))}r!==null&&r.delete(t),Ku(e,n)}function Yu(e,t){return xe(e,t)}var Xu=null,Zu=null,Qu=!1,$u=!1,ed=!1,td=0;function nd(e){e!==Zu&&e.next===null&&(Zu===null?Xu=Zu=e:Zu=Zu.next=e),$u=!0,Qu||(Qu=!0,ld())}function rd(e,t){if(!ed&&$u){ed=!0;do for(var n=!1,r=Xu;r!==null;){if(!t){if(e!==0){var i=r.pendingLanes;if(i===0)var a=0;else{var o=r.suspendedLanes,s=r.pingedLanes;a=(1<<31-Le(42|e)+1)-1,a&=i&~(o&~s),a=a&201326741?a&201326741|1:a?a|2:0}a!==0&&(n=!0,cd(r,a))}else a=Fl,a=Ge(r,r===Nl?a:0,r.cancelPendingCommit!==null||r.timeoutHandle!==-1),!(a&3)||Ke(r,a)||(n=!0,cd(r,a))}r=r.next}while(n);ed=!1}}function id(){ad()}function ad(){$u=Qu=!1;var e=0;td!==0&&Gd()&&(e=td);for(var t=Te(),n=null,r=Xu;r!==null;){var i=r.next,a=od(r,t);a===0?(r.next=null,n===null?Xu=i:n.next=i,i===null&&(Zu=n)):(n=r,(e!==0||a&3)&&($u=!0)),r=i}nu!==0&&nu!==5||rd(e,!1),td!==0&&(td=0)}function od(e,t){for(var n=e.suspendedLanes,r=e.pingedLanes,i=e.expirationTimes,a=e.pendingLanes&-62914561;0<a;){var o=31-Le(a),s=1<<o,c=i[o];c===-1?((s&n)===0||(s&r)!==0)&&(i[o]=qe(s,t)):c<=t&&(e.expiredLanes|=s),a&=~s}if(t=Nl,n=Fl,n=Ge(e,e===t?n:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),r=e.callbackNode,n===0||e===t&&(Il===2||Il===9)||e.cancelPendingCommit!==null)return r!==null&&r!==null&&Se(r),e.callbackNode=null,e.callbackPriority=0;if(!(n&3)||Ke(e,n)){if(t=n&-n,t===e.callbackPriority)return t;switch(r!==null&&Se(r),nt(n)){case 2:case 8:n=Oe;break;case 32:n=ke;break;case 268435456:n=je;break;default:n=ke}return r=sd.bind(null,e),n=xe(n,r),e.callbackPriority=t,e.callbackNode=n,t}return r!==null&&r!==null&&Se(r),e.callbackPriority=2,e.callbackNode=null,2}function sd(e,t){if(nu!==0&&nu!==5)return e.callbackNode=null,e.callbackPriority=0,null;var n=e.callbackNode;if(Bu()&&e.callbackNode!==n)return null;var r=Fl;return r=Ge(e,e===Nl?r:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),r===0?null:(mu(e,r,t),od(e,Te()),e.callbackNode!=null&&e.callbackNode===n?sd.bind(null,e):null)}function cd(e,t){if(Bu())return null;mu(e,t,!0)}function ld(){Yd(function(){Ml&6?xe(De,id):ad()})}function ud(){if(td===0){var e=aa;e===0&&(e=Ve,Ve<<=1,!(Ve&261888)&&(Ve=256)),td=e}return td}function dd(e){return e==null||typeof e==`symbol`||typeof e==`boolean`?null:typeof e==`function`?e:Xt(``+e)}function fd(e,t){var n=t.ownerDocument.createElement(`input`);return n.name=t.name,n.value=t.value,e.id&&n.setAttribute(`form`,e.id),t.parentNode.insertBefore(n,t),e=new FormData(e),n.parentNode.removeChild(n),e}function pd(e,t,n,r,i){if(t===`submit`&&n&&n.stateNode===i){var a=dd((i[st]||null).action),o=r.submitter;o&&(t=(t=o[st]||null)?dd(t.formAction):o.getAttribute(`formAction`),t!==null&&(a=t,o=null));var s=new vn(`action`,`action`,null,r,i);e.push({event:s,listeners:[{instance:null,listener:function(){if(r.defaultPrevented){if(td!==0){var e=o?fd(i,o):new FormData(i);vs(n,{pending:!0,data:e,method:i.method,action:a},null,e)}}else typeof a==`function`&&(s.preventDefault(),e=o?fd(i,o):new FormData(i),vs(n,{pending:!0,data:e,method:i.method,action:a},a,e))},currentTarget:i}]})}}for(var md=0;md<Hr.length;md++){var hd=Hr[md];Ur(hd.toLowerCase(),`on`+(hd[0].toUpperCase()+hd.slice(1)))}Ur(Pr,`onAnimationEnd`),Ur(Fr,`onAnimationIteration`),Ur(Ir,`onAnimationStart`),Ur(`dblclick`,`onDoubleClick`),Ur(`focusin`,`onFocus`),Ur(`focusout`,`onBlur`),Ur(Lr,`onTransitionRun`),Ur(Rr,`onTransitionStart`),Ur(zr,`onTransitionCancel`),Ur(Br,`onTransitionEnd`),Ct(`onMouseEnter`,[`mouseout`,`mouseover`]),Ct(`onMouseLeave`,[`mouseout`,`mouseover`]),Ct(`onPointerEnter`,[`pointerout`,`pointerover`]),Ct(`onPointerLeave`,[`pointerout`,`pointerover`]),St(`onChange`,`change click focusin focusout input keydown keyup selectionchange`.split(` `)),St(`onSelect`,`focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange`.split(` `)),St(`onBeforeInput`,[`compositionend`,`keypress`,`textInput`,`paste`]),St(`onCompositionEnd`,`compositionend focusout keydown keypress keyup mousedown`.split(` `)),St(`onCompositionStart`,`compositionstart focusout keydown keypress keyup mousedown`.split(` `)),St(`onCompositionUpdate`,`compositionupdate focusout keydown keypress keyup mousedown`.split(` `));var gd=`abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange resize seeked seeking stalled suspend timeupdate volumechange waiting`.split(` `),_d=new Set(`beforetoggle cancel close invalid load scroll scrollend toggle`.split(` `).concat(gd));function vd(e,t){t=!!(t&4);for(var n=0;n<e.length;n++){var r=e[n],i=r.event;r=r.listeners;a:{var a=void 0;if(t)for(var o=r.length-1;0<=o;o--){var s=r[o],c=s.instance,l=s.currentTarget;if(s=s.listener,c!==a&&i.isPropagationStopped())break a;a=s,i.currentTarget=l;try{a(i)}catch(e){Wr(e)}i.currentTarget=null,a=c}else for(o=0;o<r.length;o++){if(s=r[o],c=s.instance,l=s.currentTarget,s=s.listener,c!==a&&i.isPropagationStopped())break a;a=s,i.currentTarget=l;try{a(i)}catch(e){Wr(e)}i.currentTarget=null,a=c}}}}function $(e,t){var n=t[lt];n===void 0&&(n=t[lt]=new Set);var r=e+`__bubble`;n.has(r)||(Sd(t,e,2,!1),n.add(r))}function yd(e,t,n){var r=0;t&&(r|=4),Sd(n,e,r,t)}var bd=`_reactListening`+Math.random().toString(36).slice(2);function xd(e){if(!e[bd]){e[bd]=!0,bt.forEach(function(t){t!==`selectionchange`&&(_d.has(t)||yd(t,!1,e),yd(t,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[bd]||(t[bd]=!0,yd(`selectionchange`,!1,t))}}function Sd(e,t,n,r){switch(mp(t)){case 2:var i=cp;break;case 8:i=lp;break;default:i=up}n=i.bind(null,t,n,e),i=void 0,!cn||t!==`touchstart`&&t!==`touchmove`&&t!==`wheel`||(i=!0),r?i===void 0?e.addEventListener(t,n,!0):e.addEventListener(t,n,{capture:!0,passive:i}):i===void 0?e.addEventListener(t,n,!1):e.addEventListener(t,n,{passive:i})}function Cd(e,t,n,r,i){var a=r;if(!(t&1)&&!(t&2)&&r!==null)a:for(;;){if(r===null)return;var s=r.tag;if(s===3||s===4){var c=r.stateNode.containerInfo;if(c===i)break;if(s===4)for(s=r.return;s!==null;){var l=s.tag;if((l===3||l===4)&&s.stateNode.containerInfo===i)return;s=s.return}for(;c!==null;){if(s=ht(c),s===null)return;if(l=s.tag,l===5||l===6||l===26||l===27){r=a=s;continue a}c=c.parentNode}}r=r.return}an(function(){var r=a,i=$t(n),s=[];a:{var c=Vr.get(e);if(c!==void 0){var l=vn,u=e;switch(e){case`keypress`:if(pn(n)===0)break a;case`keydown`:case`keyup`:l=Fn;break;case`focusin`:u=`focus`,l=En;break;case`focusout`:u=`blur`,l=En;break;case`beforeblur`:case`afterblur`:l=En;break;case`click`:if(n.button===2)break a;case`auxclick`:case`dblclick`:case`mousedown`:case`mousemove`:case`mouseup`:case`mouseout`:case`mouseover`:case`contextmenu`:l=wn;break;case`drag`:case`dragend`:case`dragenter`:case`dragexit`:case`dragleave`:case`dragover`:case`dragstart`:case`drop`:l=Tn;break;case`touchcancel`:case`touchend`:case`touchmove`:case`touchstart`:l=Ln;break;case Pr:case Fr:case Ir:l=Dn;break;case Br:l=Rn;break;case`scroll`:case`scrollend`:l=bn;break;case`wheel`:l=zn;break;case`copy`:case`cut`:case`paste`:l=On;break;case`gotpointercapture`:case`lostpointercapture`:case`pointercancel`:case`pointerdown`:case`pointermove`:case`pointerout`:case`pointerover`:case`pointerup`:l=In;break;case`toggle`:case`beforetoggle`:l=H}var d=!!(t&4),f=!d&&(e===`scroll`||e===`scrollend`),p=d?c===null?null:c+`Capture`:c;d=[];for(var m=r,h;m!==null;){var g=m;if(h=g.stateNode,g=g.tag,g!==5&&g!==26&&g!==27||h===null||p===null||(g=on(m,p),g!=null&&d.push(wd(m,g,h))),f)break;m=m.return}0<d.length&&(c=new l(c,u,null,n,i),s.push({event:c,listeners:d}))}}if(!(t&7)){a:{if(c=e===`mouseover`||e===`pointerover`,l=e===`mouseout`||e===`pointerout`,c&&n!==Qt&&(u=n.relatedTarget||n.fromElement)&&(ht(u)||u[ct]))break a;if((l||c)&&(c=i.window===i?i:(c=i.ownerDocument)?c.defaultView||c.parentWindow:window,l?(u=n.relatedTarget||n.toElement,l=r,u=u?ht(u):null,u!==null&&(f=o(u),d=u.tag,u!==f||d!==5&&d!==27&&d!==6)&&(u=null)):(l=null,u=r),l!==u)){if(d=wn,g=`onMouseLeave`,p=`onMouseEnter`,m=`mouse`,(e===`pointerout`||e===`pointerover`)&&(d=In,g=`onPointerLeave`,p=`onPointerEnter`,m=`pointer`),f=l==null?c:_t(l),h=u==null?c:_t(u),c=new d(g,m+`leave`,l,n,i),c.target=f,c.relatedTarget=h,g=null,ht(i)===r&&(d=new d(p,m+`enter`,u,n,i),d.target=h,d.relatedTarget=f,g=d),f=g,l&&u)b:{for(d=Ed,p=l,m=u,h=0,g=p;g;g=d(g))h++;g=0;for(var _=m;_;_=d(_))g++;for(;0<h-g;)p=d(p),h--;for(;0<g-h;)m=d(m),g--;for(;h--;){if(p===m||m!==null&&p===m.alternate){d=p;break b}p=d(p),m=d(m)}d=null}else d=null;l!==null&&Dd(s,c,l,d,!1),u!==null&&f!==null&&Dd(s,f,u,d,!0)}}a:{if(c=r?_t(r):window,l=c.nodeName&&c.nodeName.toLowerCase(),l===`select`||l===`input`&&c.type===`file`)var v=ar;else if($n(c)){if(or)v=hr;else{v=pr;var y=fr}}else l=c.nodeName,!l||l.toLowerCase()!==`input`||c.type!==`checkbox`&&c.type!==`radio`?r&&Kt(r.elementType)&&(v=ar):v=mr;if(v&&=v(e,r)){er(s,v,n,i);break a}y&&y(e,c,r),e===`focusout`&&r&&c.type===`number`&&r.memoizedProps.value!=null&&Bt(c,`number`,c.value)}switch(y=r?_t(r):window,e){case`focusin`:($n(y)||y.contentEditable===`true`)&&(wr=y,Tr=r,Er=null);break;case`focusout`:Er=Tr=wr=null;break;case`mousedown`:Dr=!0;break;case`contextmenu`:case`mouseup`:case`dragend`:Dr=!1,Or(s,n,i);break;case`selectionchange`:if(Cr)break;case`keydown`:case`keyup`:Or(s,n,i)}var b;if(Vn)b:{switch(e){case`compositionstart`:var x=`onCompositionStart`;break b;case`compositionend`:x=`onCompositionEnd`;break b;case`compositionupdate`:x=`onCompositionUpdate`;break b}x=void 0}else Yn?qn(e,n)&&(x=`onCompositionEnd`):e===`keydown`&&n.keyCode===229&&(x=`onCompositionStart`);x&&(Wn&&n.locale!==`ko`&&(Yn||x!==`onCompositionStart`?x===`onCompositionEnd`&&Yn&&(b=fn()):(B=i,un=`value`in B?B.value:B.textContent,Yn=!0)),y=Td(r,x),0<y.length&&(x=new kn(x,e,null,n,i),s.push({event:x,listeners:y}),b?x.data=b:(b=Jn(n),b!==null&&(x.data=b)))),(b=Un?Xn(e,n):Zn(e,n))&&(x=Td(r,`onBeforeInput`),0<x.length&&(y=new kn(`onBeforeInput`,`beforeinput`,null,n,i),s.push({event:y,listeners:x}),y.data=b)),pd(s,e,r,n,i)}vd(s,t)})}function wd(e,t,n){return{instance:e,listener:t,currentTarget:n}}function Td(e,t){for(var n=t+`Capture`,r=[];e!==null;){var i=e,a=i.stateNode;if(i=i.tag,i!==5&&i!==26&&i!==27||a===null||(i=on(e,n),i!=null&&r.unshift(wd(e,i,a)),i=on(e,t),i!=null&&r.push(wd(e,i,a))),e.tag===3)return r;e=e.return}return[]}function Ed(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function Dd(e,t,n,r,i){for(var a=t._reactName,o=[];n!==null&&n!==r;){var s=n,c=s.alternate,l=s.stateNode;if(s=s.tag,c!==null&&c===r)break;s!==5&&s!==26&&s!==27||l===null||(c=l,i?(l=on(n,a),l!=null&&o.unshift(wd(n,l,c))):i||(l=on(n,a),l!=null&&o.push(wd(n,l,c)))),n=n.return}o.length!==0&&e.push({event:t,listeners:o})}var Od=/\r\n?/g,kd=/\u0000|\uFFFD/g;function Ad(e){return(typeof e==`string`?e:``+e).replace(Od,`
10
- `).replace(kd,``)}function jd(e,t){return t=Ad(t),Ad(e)===t}function Md(e,t,n,r,a,o){switch(n){case`children`:typeof r==`string`?t===`body`||t===`textarea`&&r===``||R(e,r):(typeof r==`number`||typeof r==`bigint`)&&t!==`body`&&R(e,``+r);break;case`className`:kt(e,`class`,r);break;case`tabIndex`:kt(e,`tabindex`,r);break;case`dir`:case`role`:case`viewBox`:case`width`:case`height`:kt(e,n,r);break;case`style`:Gt(e,r,o);break;case`data`:if(t!==`object`){kt(e,`data`,r);break}case`src`:case`href`:if(r===``&&(t!==`a`||n!==`href`)||r==null||typeof r==`function`||typeof r==`symbol`||typeof r==`boolean`){e.removeAttribute(n);break}r=Xt(``+r),e.setAttribute(n,r);break;case`action`:case`formAction`:if(typeof r==`function`){e.setAttribute(n,`javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')`);break}if(typeof o==`function`&&(n===`formAction`?(t!==`input`&&Md(e,t,`name`,a.name,a,null),Md(e,t,`formEncType`,a.formEncType,a,null),Md(e,t,`formMethod`,a.formMethod,a,null),Md(e,t,`formTarget`,a.formTarget,a,null)):(Md(e,t,`encType`,a.encType,a,null),Md(e,t,`method`,a.method,a,null),Md(e,t,`target`,a.target,a,null))),r==null||typeof r==`symbol`||typeof r==`boolean`){e.removeAttribute(n);break}r=Xt(``+r),e.setAttribute(n,r);break;case`onClick`:r!=null&&(e.onclick=Zt);break;case`onScroll`:r!=null&&$(`scroll`,e);break;case`onScrollEnd`:r!=null&&$(`scrollend`,e);break;case`dangerouslySetInnerHTML`:if(r!=null){if(typeof r!=`object`||!(`__html`in r))throw Error(i(61));if(n=r.__html,n!=null){if(a.children!=null)throw Error(i(60));e.innerHTML=n}}break;case`multiple`:e.multiple=r&&typeof r!=`function`&&typeof r!=`symbol`;break;case`muted`:e.muted=r&&typeof r!=`function`&&typeof r!=`symbol`;break;case`suppressContentEditableWarning`:case`suppressHydrationWarning`:case`defaultValue`:case`defaultChecked`:case`innerHTML`:case`ref`:break;case`autoFocus`:break;case`xlinkHref`:if(r==null||typeof r==`function`||typeof r==`boolean`||typeof r==`symbol`){e.removeAttribute(`xlink:href`);break}n=Xt(``+r),e.setAttributeNS(`http://www.w3.org/1999/xlink`,`xlink:href`,n);break;case`contentEditable`:case`spellCheck`:case`draggable`:case`value`:case`autoReverse`:case`externalResourcesRequired`:case`focusable`:case`preserveAlpha`:r!=null&&typeof r!=`function`&&typeof r!=`symbol`?e.setAttribute(n,``+r):e.removeAttribute(n);break;case`inert`:case`allowFullScreen`:case`async`:case`autoPlay`:case`controls`:case`default`:case`defer`:case`disabled`:case`disablePictureInPicture`:case`disableRemotePlayback`:case`formNoValidate`:case`hidden`:case`loop`:case`noModule`:case`noValidate`:case`open`:case`playsInline`:case`readOnly`:case`required`:case`reversed`:case`scoped`:case`seamless`:case`itemScope`:r&&typeof r!=`function`&&typeof r!=`symbol`?e.setAttribute(n,``):e.removeAttribute(n);break;case`capture`:case`download`:!0===r?e.setAttribute(n,``):!1!==r&&r!=null&&typeof r!=`function`&&typeof r!=`symbol`?e.setAttribute(n,r):e.removeAttribute(n);break;case`cols`:case`rows`:case`size`:case`span`:r!=null&&typeof r!=`function`&&typeof r!=`symbol`&&!isNaN(r)&&1<=r?e.setAttribute(n,r):e.removeAttribute(n);break;case`rowSpan`:case`start`:r==null||typeof r==`function`||typeof r==`symbol`||isNaN(r)?e.removeAttribute(n):e.setAttribute(n,r);break;case`popover`:$(`beforetoggle`,e),$(`toggle`,e),Ot(e,`popover`,r);break;case`xlinkActuate`:At(e,`http://www.w3.org/1999/xlink`,`xlink:actuate`,r);break;case`xlinkArcrole`:At(e,`http://www.w3.org/1999/xlink`,`xlink:arcrole`,r);break;case`xlinkRole`:At(e,`http://www.w3.org/1999/xlink`,`xlink:role`,r);break;case`xlinkShow`:At(e,`http://www.w3.org/1999/xlink`,`xlink:show`,r);break;case`xlinkTitle`:At(e,`http://www.w3.org/1999/xlink`,`xlink:title`,r);break;case`xlinkType`:At(e,`http://www.w3.org/1999/xlink`,`xlink:type`,r);break;case`xmlBase`:At(e,`http://www.w3.org/XML/1998/namespace`,`xml:base`,r);break;case`xmlLang`:At(e,`http://www.w3.org/XML/1998/namespace`,`xml:lang`,r);break;case`xmlSpace`:At(e,`http://www.w3.org/XML/1998/namespace`,`xml:space`,r);break;case`is`:Ot(e,`is`,r);break;case`innerText`:case`textContent`:break;default:(!(2<n.length)||n[0]!==`o`&&n[0]!==`O`||n[1]!==`n`&&n[1]!==`N`)&&(n=qt.get(n)||n,Ot(e,n,r))}}function Nd(e,t,n,r,a,o){switch(n){case`style`:Gt(e,r,o);break;case`dangerouslySetInnerHTML`:if(r!=null){if(typeof r!=`object`||!(`__html`in r))throw Error(i(61));if(n=r.__html,n!=null){if(a.children!=null)throw Error(i(60));e.innerHTML=n}}break;case`children`:typeof r==`string`?R(e,r):(typeof r==`number`||typeof r==`bigint`)&&R(e,``+r);break;case`onScroll`:r!=null&&$(`scroll`,e);break;case`onScrollEnd`:r!=null&&$(`scrollend`,e);break;case`onClick`:r!=null&&(e.onclick=Zt);break;case`suppressContentEditableWarning`:case`suppressHydrationWarning`:case`innerHTML`:case`ref`:break;case`innerText`:case`textContent`:break;default:if(!xt.hasOwnProperty(n))a:{if(n[0]===`o`&&n[1]===`n`&&(a=n.endsWith(`Capture`),t=n.slice(2,a?n.length-7:void 0),o=e[st]||null,o=o==null?null:o[n],typeof o==`function`&&e.removeEventListener(t,o,a),typeof r==`function`)){typeof o!=`function`&&o!==null&&(n in e?e[n]=null:e.hasAttribute(n)&&e.removeAttribute(n)),e.addEventListener(t,r,a);break a}n in e?e[n]=r:!0===r?e.setAttribute(n,``):Ot(e,n,r)}}}function Pd(e,t,n){switch(t){case`div`:case`span`:case`svg`:case`path`:case`a`:case`g`:case`p`:case`li`:break;case`img`:$(`error`,e),$(`load`,e);var r=!1,a=!1,o;for(o in n)if(n.hasOwnProperty(o)){var s=n[o];if(s!=null)switch(o){case`src`:r=!0;break;case`srcSet`:a=!0;break;case`children`:case`dangerouslySetInnerHTML`:throw Error(i(137,t));default:Md(e,t,o,s,n,null)}}a&&Md(e,t,`srcSet`,n.srcSet,n,null),r&&Md(e,t,`src`,n.src,n,null);return;case`input`:$(`invalid`,e);var c=o=s=a=null,l=null,u=null;for(r in n)if(n.hasOwnProperty(r)){var d=n[r];if(d!=null)switch(r){case`name`:a=d;break;case`type`:s=d;break;case`checked`:l=d;break;case`defaultChecked`:u=d;break;case`value`:o=d;break;case`defaultValue`:c=d;break;case`children`:case`dangerouslySetInnerHTML`:if(d!=null)throw Error(i(137,t));break;default:Md(e,t,r,d,n,null)}}zt(e,o,c,l,u,s,a,!1);return;case`select`:for(a in $(`invalid`,e),r=s=o=null,n)if(n.hasOwnProperty(a)&&(c=n[a],c!=null))switch(a){case`value`:o=c;break;case`defaultValue`:s=c;break;case`multiple`:r=c;default:Md(e,t,a,c,n,null)}t=o,n=s,e.multiple=!!r,t==null?n!=null&&Vt(e,!!r,n,!0):Vt(e,!!r,t,!1);return;case`textarea`:for(s in $(`invalid`,e),o=a=r=null,n)if(n.hasOwnProperty(s)&&(c=n[s],c!=null))switch(s){case`value`:r=c;break;case`defaultValue`:a=c;break;case`children`:o=c;break;case`dangerouslySetInnerHTML`:if(c!=null)throw Error(i(91));break;default:Md(e,t,s,c,n,null)}Ut(e,r,a,o);return;case`option`:for(l in n)if(n.hasOwnProperty(l)&&(r=n[l],r!=null))switch(l){case`selected`:e.selected=r&&typeof r!=`function`&&typeof r!=`symbol`;break;default:Md(e,t,l,r,n,null)}return;case`dialog`:$(`beforetoggle`,e),$(`toggle`,e),$(`cancel`,e),$(`close`,e);break;case`iframe`:case`object`:$(`load`,e);break;case`video`:case`audio`:for(r=0;r<gd.length;r++)$(gd[r],e);break;case`image`:$(`error`,e),$(`load`,e);break;case`details`:$(`toggle`,e);break;case`embed`:case`source`:case`link`:$(`error`,e),$(`load`,e);case`area`:case`base`:case`br`:case`col`:case`hr`:case`keygen`:case`meta`:case`param`:case`track`:case`wbr`:case`menuitem`:for(u in n)if(n.hasOwnProperty(u)&&(r=n[u],r!=null))switch(u){case`children`:case`dangerouslySetInnerHTML`:throw Error(i(137,t));default:Md(e,t,u,r,n,null)}return;default:if(Kt(t)){for(d in n)n.hasOwnProperty(d)&&(r=n[d],r!==void 0&&Nd(e,t,d,r,n,void 0));return}}for(c in n)n.hasOwnProperty(c)&&(r=n[c],r!=null&&Md(e,t,c,r,n,null))}function Fd(e,t,n,r){switch(t){case`div`:case`span`:case`svg`:case`path`:case`a`:case`g`:case`p`:case`li`:break;case`input`:var a=null,o=null,s=null,c=null,l=null,u=null,d=null;for(m in n){var f=n[m];if(n.hasOwnProperty(m)&&f!=null)switch(m){case`checked`:break;case`value`:break;case`defaultValue`:l=f;default:r.hasOwnProperty(m)||Md(e,t,m,null,r,f)}}for(var p in r){var m=r[p];if(f=n[p],r.hasOwnProperty(p)&&(m!=null||f!=null))switch(p){case`type`:o=m;break;case`name`:a=m;break;case`checked`:u=m;break;case`defaultChecked`:d=m;break;case`value`:s=m;break;case`defaultValue`:c=m;break;case`children`:case`dangerouslySetInnerHTML`:if(m!=null)throw Error(i(137,t));break;default:m!==f&&Md(e,t,p,m,r,f)}}Rt(e,s,c,l,u,d,o,a);return;case`select`:for(o in m=s=c=p=null,n)if(l=n[o],n.hasOwnProperty(o)&&l!=null)switch(o){case`value`:break;case`multiple`:m=l;default:r.hasOwnProperty(o)||Md(e,t,o,null,r,l)}for(a in r)if(o=r[a],l=n[a],r.hasOwnProperty(a)&&(o!=null||l!=null))switch(a){case`value`:p=o;break;case`defaultValue`:c=o;break;case`multiple`:s=o;default:o!==l&&Md(e,t,a,o,r,l)}t=c,n=s,r=m,p==null?!!r!=!!n&&(t==null?Vt(e,!!n,n?[]:``,!1):Vt(e,!!n,t,!0)):Vt(e,!!n,p,!1);return;case`textarea`:for(c in m=p=null,n)if(a=n[c],n.hasOwnProperty(c)&&a!=null&&!r.hasOwnProperty(c))switch(c){case`value`:break;case`children`:break;default:Md(e,t,c,null,r,a)}for(s in r)if(a=r[s],o=n[s],r.hasOwnProperty(s)&&(a!=null||o!=null))switch(s){case`value`:p=a;break;case`defaultValue`:m=a;break;case`children`:break;case`dangerouslySetInnerHTML`:if(a!=null)throw Error(i(91));break;default:a!==o&&Md(e,t,s,a,r,o)}Ht(e,p,m);return;case`option`:for(var h in n)if(p=n[h],n.hasOwnProperty(h)&&p!=null&&!r.hasOwnProperty(h))switch(h){case`selected`:e.selected=!1;break;default:Md(e,t,h,null,r,p)}for(l in r)if(p=r[l],m=n[l],r.hasOwnProperty(l)&&p!==m&&(p!=null||m!=null))switch(l){case`selected`:e.selected=p&&typeof p!=`function`&&typeof p!=`symbol`;break;default:Md(e,t,l,p,r,m)}return;case`img`:case`link`:case`area`:case`base`:case`br`:case`col`:case`embed`:case`hr`:case`keygen`:case`meta`:case`param`:case`source`:case`track`:case`wbr`:case`menuitem`:for(var g in n)p=n[g],n.hasOwnProperty(g)&&p!=null&&!r.hasOwnProperty(g)&&Md(e,t,g,null,r,p);for(u in r)if(p=r[u],m=n[u],r.hasOwnProperty(u)&&p!==m&&(p!=null||m!=null))switch(u){case`children`:case`dangerouslySetInnerHTML`:if(p!=null)throw Error(i(137,t));break;default:Md(e,t,u,p,r,m)}return;default:if(Kt(t)){for(var _ in n)p=n[_],n.hasOwnProperty(_)&&p!==void 0&&!r.hasOwnProperty(_)&&Nd(e,t,_,void 0,r,p);for(d in r)p=r[d],m=n[d],!r.hasOwnProperty(d)||p===m||p===void 0&&m===void 0||Nd(e,t,d,p,r,m);return}}for(var v in n)p=n[v],n.hasOwnProperty(v)&&p!=null&&!r.hasOwnProperty(v)&&Md(e,t,v,null,r,p);for(f in r)p=r[f],m=n[f],!r.hasOwnProperty(f)||p===m||p==null&&m==null||Md(e,t,f,p,r,m)}function Id(e){switch(e){case`css`:case`script`:case`font`:case`img`:case`image`:case`input`:case`link`:return!0;default:return!1}}function Ld(){if(typeof performance.getEntriesByType==`function`){for(var e=0,t=0,n=performance.getEntriesByType(`resource`),r=0;r<n.length;r++){var i=n[r],a=i.transferSize,o=i.initiatorType,s=i.duration;if(a&&s&&Id(o)){for(o=0,s=i.responseEnd,r+=1;r<n.length;r++){var c=n[r],l=c.startTime;if(l>s)break;var u=c.transferSize,d=c.initiatorType;u&&Id(d)&&(c=c.responseEnd,o+=u*(c<s?1:(s-l)/(c-l)))}if(--r,t+=8*(a+o)/(i.duration/1e3),e++,10<e)break}}if(0<e)return t/e/1e6}return navigator.connection&&(e=navigator.connection.downlink,typeof e==`number`)?e:5}var Rd=null,zd=null;function Bd(e){return e.nodeType===9?e:e.ownerDocument}function Vd(e){switch(e){case`http://www.w3.org/2000/svg`:return 1;case`http://www.w3.org/1998/Math/MathML`:return 2;default:return 0}}function Hd(e,t){if(e===0)switch(t){case`svg`:return 1;case`math`:return 2;default:return 0}return e===1&&t===`foreignObject`?0:e}function Ud(e,t){return e===`textarea`||e===`noscript`||typeof t.children==`string`||typeof t.children==`number`||typeof t.children==`bigint`||typeof t.dangerouslySetInnerHTML==`object`&&t.dangerouslySetInnerHTML!==null&&t.dangerouslySetInnerHTML.__html!=null}var Wd=null;function Gd(){var e=window.event;return e&&e.type===`popstate`?e!==Wd&&(Wd=e,!0):(Wd=null,!1)}var Kd=typeof setTimeout==`function`?setTimeout:void 0,qd=typeof clearTimeout==`function`?clearTimeout:void 0,Jd=typeof Promise==`function`?Promise:void 0,Yd=typeof queueMicrotask==`function`?queueMicrotask:Jd===void 0?Kd:function(e){return Jd.resolve(null).then(e).catch(Xd)};function Xd(e){setTimeout(function(){throw e})}function Zd(e){return e===`head`}function Qd(e,t){var n=t,r=0;do{var i=n.nextSibling;if(e.removeChild(n),i&&i.nodeType===8){if(n=i.data,n===`/$`||n===`/&`){if(r===0){e.removeChild(i),Np(t);return}r--}else if(n===`$`||n===`$?`||n===`$~`||n===`$!`||n===`&`)r++;else if(n===`html`)pf(e.ownerDocument.documentElement);else if(n===`head`){n=e.ownerDocument.head,pf(n);for(var a=n.firstChild;a;){var o=a.nextSibling,s=a.nodeName;a[pt]||s===`SCRIPT`||s===`STYLE`||s===`LINK`&&a.rel.toLowerCase()===`stylesheet`||n.removeChild(a),a=o}}else n===`body`&&pf(e.ownerDocument.body)}n=i}while(n);Np(t)}function $d(e,t){var n=e;e=0;do{var r=n.nextSibling;if(n.nodeType===1?t?(n._stashedDisplay=n.style.display,n.style.display=`none`):(n.style.display=n._stashedDisplay||``,n.getAttribute(`style`)===``&&n.removeAttribute(`style`)):n.nodeType===3&&(t?(n._stashedText=n.nodeValue,n.nodeValue=``):n.nodeValue=n._stashedText||``),r&&r.nodeType===8){if(n=r.data,n===`/$`){if(e===0)break;e--}else n!==`$`&&n!==`$?`&&n!==`$~`&&n!==`$!`||e++}n=r}while(n)}function ef(e){var t=e.firstChild;for(t&&t.nodeType===10&&(t=t.nextSibling);t;){var n=t;switch(t=t.nextSibling,n.nodeName){case`HTML`:case`HEAD`:case`BODY`:ef(n),mt(n);continue;case`SCRIPT`:case`STYLE`:continue;case`LINK`:if(n.rel.toLowerCase()===`stylesheet`)continue}e.removeChild(n)}}function tf(e,t,n,r){for(;e.nodeType===1;){var i=n;if(e.nodeName.toLowerCase()!==t.toLowerCase()){if(!r&&(e.nodeName!==`INPUT`||e.type!==`hidden`))break}else if(!r){if(t===`input`&&e.type===`hidden`){var a=i.name==null?null:``+i.name;if(i.type===`hidden`&&e.getAttribute(`name`)===a)return e}else return e}else if(!e[pt])switch(t){case`meta`:if(!e.hasAttribute(`itemprop`))break;return e;case`link`:if(a=e.getAttribute(`rel`),a===`stylesheet`&&e.hasAttribute(`data-precedence`)||a!==i.rel||e.getAttribute(`href`)!==(i.href==null||i.href===``?null:i.href)||e.getAttribute(`crossorigin`)!==(i.crossOrigin==null?null:i.crossOrigin)||e.getAttribute(`title`)!==(i.title==null?null:i.title))break;return e;case`style`:if(e.hasAttribute(`data-precedence`))break;return e;case`script`:if(a=e.getAttribute(`src`),(a!==(i.src==null?null:i.src)||e.getAttribute(`type`)!==(i.type==null?null:i.type)||e.getAttribute(`crossorigin`)!==(i.crossOrigin==null?null:i.crossOrigin))&&a&&e.hasAttribute(`async`)&&!e.hasAttribute(`itemprop`))break;return e;default:return e}if(e=cf(e.nextSibling),e===null)break}return null}function nf(e,t,n){if(t===``)return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!==`INPUT`||e.type!==`hidden`)&&!n||(e=cf(e.nextSibling),e===null))return null;return e}function rf(e,t){for(;e.nodeType!==8;)if((e.nodeType!==1||e.nodeName!==`INPUT`||e.type!==`hidden`)&&!t||(e=cf(e.nextSibling),e===null))return null;return e}function af(e){return e.data===`$?`||e.data===`$~`}function of(e){return e.data===`$!`||e.data===`$?`&&e.ownerDocument.readyState!==`loading`}function sf(e,t){var n=e.ownerDocument;if(e.data===`$~`)e._reactRetry=t;else if(e.data!==`$?`||n.readyState!==`loading`)t();else{var r=function(){t(),n.removeEventListener(`DOMContentLoaded`,r)};n.addEventListener(`DOMContentLoaded`,r),e._reactRetry=r}}function cf(e){for(;e!=null;e=e.nextSibling){var t=e.nodeType;if(t===1||t===3)break;if(t===8){if(t=e.data,t===`$`||t===`$!`||t===`$?`||t===`$~`||t===`&`||t===`F!`||t===`F`)break;if(t===`/$`||t===`/&`)return null}}return e}var lf=null;function uf(e){e=e.nextSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n===`/$`||n===`/&`){if(t===0)return cf(e.nextSibling);t--}else n!==`$`&&n!==`$!`&&n!==`$?`&&n!==`$~`&&n!==`&`||t++}e=e.nextSibling}return null}function df(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n===`$`||n===`$!`||n===`$?`||n===`$~`||n===`&`){if(t===0)return e;t--}else n!==`/$`&&n!==`/&`||t++}e=e.previousSibling}return null}function ff(e,t,n){switch(t=Bd(n),e){case`html`:if(e=t.documentElement,!e)throw Error(i(452));return e;case`head`:if(e=t.head,!e)throw Error(i(453));return e;case`body`:if(e=t.body,!e)throw Error(i(454));return e;default:throw Error(i(451))}}function pf(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);mt(e)}var mf=new Map,hf=new Set;function gf(e){return typeof e.getRootNode==`function`?e.getRootNode():e.nodeType===9?e:e.ownerDocument}var _f=M.d;M.d={f:vf,r:yf,D:Sf,C:Cf,L:wf,m:Tf,X:Df,S:Ef,M:Of};function vf(){var e=_f.f(),t=vu();return e||t}function yf(e){var t=gt(e);t!==null&&t.tag===5&&t.type===`form`?bs(t):_f.r(e)}var bf=typeof document>`u`?null:document;function xf(e,t,n){var r=bf;if(r&&typeof t==`string`&&t){var i=L(t);i=`link[rel="`+e+`"][href="`+i+`"]`,typeof n==`string`&&(i+=`[crossorigin="`+n+`"]`),hf.has(i)||(hf.add(i),e={rel:e,crossOrigin:n,href:t},r.querySelector(i)===null&&(t=r.createElement(`link`),Pd(t,`link`,e),yt(t),r.head.appendChild(t)))}}function Sf(e){_f.D(e),xf(`dns-prefetch`,e,null)}function Cf(e,t){_f.C(e,t),xf(`preconnect`,e,t)}function wf(e,t,n){_f.L(e,t,n);var r=bf;if(r&&e&&t){var i=`link[rel="preload"][as="`+L(t)+`"]`;t===`image`&&n&&n.imageSrcSet?(i+=`[imagesrcset="`+L(n.imageSrcSet)+`"]`,typeof n.imageSizes==`string`&&(i+=`[imagesizes="`+L(n.imageSizes)+`"]`)):i+=`[href="`+L(e)+`"]`;var a=i;switch(t){case`style`:a=Af(e);break;case`script`:a=Pf(e)}mf.has(a)||(e=f({rel:`preload`,href:t===`image`&&n&&n.imageSrcSet?void 0:e,as:t},n),mf.set(a,e),r.querySelector(i)!==null||t===`style`&&r.querySelector(jf(a))||t===`script`&&r.querySelector(Ff(a))||(t=r.createElement(`link`),Pd(t,`link`,e),yt(t),r.head.appendChild(t)))}}function Tf(e,t){_f.m(e,t);var n=bf;if(n&&e){var r=t&&typeof t.as==`string`?t.as:`script`,i=`link[rel="modulepreload"][as="`+L(r)+`"][href="`+L(e)+`"]`,a=i;switch(r){case`audioworklet`:case`paintworklet`:case`serviceworker`:case`sharedworker`:case`worker`:case`script`:a=Pf(e)}if(!mf.has(a)&&(e=f({rel:`modulepreload`,href:e},t),mf.set(a,e),n.querySelector(i)===null)){switch(r){case`audioworklet`:case`paintworklet`:case`serviceworker`:case`sharedworker`:case`worker`:case`script`:if(n.querySelector(Ff(a)))return}r=n.createElement(`link`),Pd(r,`link`,e),yt(r),n.head.appendChild(r)}}}function Ef(e,t,n){_f.S(e,t,n);var r=bf;if(r&&e){var i=vt(r).hoistableStyles,a=Af(e);t||=`default`;var o=i.get(a);if(!o){var s={loading:0,preload:null};if(o=r.querySelector(jf(a)))s.loading=5;else{e=f({rel:`stylesheet`,href:e,"data-precedence":t},n),(n=mf.get(a))&&Rf(e,n);var c=o=r.createElement(`link`);yt(c),Pd(c,`link`,e),c._p=new Promise(function(e,t){c.onload=e,c.onerror=t}),c.addEventListener(`load`,function(){s.loading|=1}),c.addEventListener(`error`,function(){s.loading|=2}),s.loading|=4,Lf(o,t,r)}o={type:`stylesheet`,instance:o,count:1,state:s},i.set(a,o)}}}function Df(e,t){_f.X(e,t);var n=bf;if(n&&e){var r=vt(n).hoistableScripts,i=Pf(e),a=r.get(i);a||(a=n.querySelector(Ff(i)),a||(e=f({src:e,async:!0},t),(t=mf.get(i))&&zf(e,t),a=n.createElement(`script`),yt(a),Pd(a,`link`,e),n.head.appendChild(a)),a={type:`script`,instance:a,count:1,state:null},r.set(i,a))}}function Of(e,t){_f.M(e,t);var n=bf;if(n&&e){var r=vt(n).hoistableScripts,i=Pf(e),a=r.get(i);a||(a=n.querySelector(Ff(i)),a||(e=f({src:e,async:!0,type:`module`},t),(t=mf.get(i))&&zf(e,t),a=n.createElement(`script`),yt(a),Pd(a,`link`,e),n.head.appendChild(a)),a={type:`script`,instance:a,count:1,state:null},r.set(i,a))}}function kf(e,t,n,r){var a=(a=le.current)?gf(a):null;if(!a)throw Error(i(446));switch(e){case`meta`:case`title`:return null;case`style`:return typeof n.precedence==`string`&&typeof n.href==`string`?(t=Af(n.href),n=vt(a).hoistableStyles,r=n.get(t),r||(r={type:`style`,instance:null,count:0,state:null},n.set(t,r)),r):{type:`void`,instance:null,count:0,state:null};case`link`:if(n.rel===`stylesheet`&&typeof n.href==`string`&&typeof n.precedence==`string`){e=Af(n.href);var o=vt(a).hoistableStyles,s=o.get(e);if(s||(a=a.ownerDocument||a,s={type:`stylesheet`,instance:null,count:0,state:{loading:0,preload:null}},o.set(e,s),(o=a.querySelector(jf(e)))&&!o._p&&(s.instance=o,s.state.loading=5),mf.has(e)||(n={rel:`preload`,as:`style`,href:n.href,crossOrigin:n.crossOrigin,integrity:n.integrity,media:n.media,hrefLang:n.hrefLang,referrerPolicy:n.referrerPolicy},mf.set(e,n),o||Nf(a,e,n,s.state))),t&&r===null)throw Error(i(528,``));return s}if(t&&r!==null)throw Error(i(529,``));return null;case`script`:return t=n.async,n=n.src,typeof n==`string`&&t&&typeof t!=`function`&&typeof t!=`symbol`?(t=Pf(n),n=vt(a).hoistableScripts,r=n.get(t),r||(r={type:`script`,instance:null,count:0,state:null},n.set(t,r)),r):{type:`void`,instance:null,count:0,state:null};default:throw Error(i(444,e))}}function Af(e){return`href="`+L(e)+`"`}function jf(e){return`link[rel="stylesheet"][`+e+`]`}function Mf(e){return f({},e,{"data-precedence":e.precedence,precedence:null})}function Nf(e,t,n,r){e.querySelector(`link[rel="preload"][as="style"][`+t+`]`)?r.loading=1:(t=e.createElement(`link`),r.preload=t,t.addEventListener(`load`,function(){return r.loading|=1}),t.addEventListener(`error`,function(){return r.loading|=2}),Pd(t,`link`,n),yt(t),e.head.appendChild(t))}function Pf(e){return`[src="`+L(e)+`"]`}function Ff(e){return`script[async]`+e}function If(e,t,n){if(t.count++,t.instance===null)switch(t.type){case`style`:var r=e.querySelector(`style[data-href~="`+L(n.href)+`"]`);if(r)return t.instance=r,yt(r),r;var a=f({},n,{"data-href":n.href,"data-precedence":n.precedence,href:null,precedence:null});return r=(e.ownerDocument||e).createElement(`style`),yt(r),Pd(r,`style`,a),Lf(r,n.precedence,e),t.instance=r;case`stylesheet`:a=Af(n.href);var o=e.querySelector(jf(a));if(o)return t.state.loading|=4,t.instance=o,yt(o),o;r=Mf(n),(a=mf.get(a))&&Rf(r,a),o=(e.ownerDocument||e).createElement(`link`),yt(o);var s=o;return s._p=new Promise(function(e,t){s.onload=e,s.onerror=t}),Pd(o,`link`,r),t.state.loading|=4,Lf(o,n.precedence,e),t.instance=o;case`script`:return o=Pf(n.src),(a=e.querySelector(Ff(o)))?(t.instance=a,yt(a),a):(r=n,(a=mf.get(o))&&(r=f({},n),zf(r,a)),e=e.ownerDocument||e,a=e.createElement(`script`),yt(a),Pd(a,`link`,r),e.head.appendChild(a),t.instance=a);case`void`:return null;default:throw Error(i(443,t.type))}else t.type===`stylesheet`&&!(t.state.loading&4)&&(r=t.instance,t.state.loading|=4,Lf(r,n.precedence,e));return t.instance}function Lf(e,t,n){for(var r=n.querySelectorAll(`link[rel="stylesheet"][data-precedence],style[data-precedence]`),i=r.length?r[r.length-1]:null,a=i,o=0;o<r.length;o++){var s=r[o];if(s.dataset.precedence===t)a=s;else if(a!==i)break}a?a.parentNode.insertBefore(e,a.nextSibling):(t=n.nodeType===9?n.head:n,t.insertBefore(e,t.firstChild))}function Rf(e,t){e.crossOrigin??=t.crossOrigin,e.referrerPolicy??=t.referrerPolicy,e.title??=t.title}function zf(e,t){e.crossOrigin??=t.crossOrigin,e.referrerPolicy??=t.referrerPolicy,e.integrity??=t.integrity}var Bf=null;function Vf(e,t,n){if(Bf===null){var r=new Map,i=Bf=new Map;i.set(n,r)}else i=Bf,r=i.get(n),r||(r=new Map,i.set(n,r));if(r.has(e))return r;for(r.set(e,null),n=n.getElementsByTagName(e),i=0;i<n.length;i++){var a=n[i];if(!(a[pt]||a[ot]||e===`link`&&a.getAttribute(`rel`)===`stylesheet`)&&a.namespaceURI!==`http://www.w3.org/2000/svg`){var o=a.getAttribute(t)||``;o=e+o;var s=r.get(o);s?s.push(a):r.set(o,[a])}}return r}function Hf(e,t,n){e=e.ownerDocument||e,e.head.insertBefore(n,t===`title`?e.querySelector(`head > title`):null)}function Uf(e,t,n){if(n===1||t.itemProp!=null)return!1;switch(e){case`meta`:case`title`:return!0;case`style`:if(typeof t.precedence!=`string`||typeof t.href!=`string`||t.href===``)break;return!0;case`link`:if(typeof t.rel!=`string`||typeof t.href!=`string`||t.href===``||t.onLoad||t.onError)break;switch(t.rel){case`stylesheet`:return e=t.disabled,typeof t.precedence==`string`&&e==null;default:return!0}case`script`:if(t.async&&typeof t.async!=`function`&&typeof t.async!=`symbol`&&!t.onLoad&&!t.onError&&t.src&&typeof t.src==`string`)return!0}return!1}function Wf(e){return!(e.type===`stylesheet`&&!(e.state.loading&3))}function Gf(e,t,n,r){if(n.type===`stylesheet`&&(typeof r.media!=`string`||!1!==matchMedia(r.media).matches)&&!(n.state.loading&4)){if(n.instance===null){var i=Af(r.href),a=t.querySelector(jf(i));if(a){t=a._p,typeof t==`object`&&t&&typeof t.then==`function`&&(e.count++,e=Jf.bind(e),t.then(e,e)),n.state.loading|=4,n.instance=a,yt(a);return}a=t.ownerDocument||t,r=Mf(r),(i=mf.get(i))&&Rf(r,i),a=a.createElement(`link`),yt(a);var o=a;o._p=new Promise(function(e,t){o.onload=e,o.onerror=t}),Pd(a,`link`,r),n.instance=a}e.stylesheets===null&&(e.stylesheets=new Map),e.stylesheets.set(n,t),(t=n.state.preload)&&!(n.state.loading&3)&&(e.count++,n=Jf.bind(e),t.addEventListener(`load`,n),t.addEventListener(`error`,n))}}var Kf=0;function qf(e,t){return e.stylesheets&&e.count===0&&Xf(e,e.stylesheets),0<e.count||0<e.imgCount?function(n){var r=setTimeout(function(){if(e.stylesheets&&Xf(e,e.stylesheets),e.unsuspend){var t=e.unsuspend;e.unsuspend=null,t()}},6e4+t);0<e.imgBytes&&Kf===0&&(Kf=62500*Ld());var i=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&Xf(e,e.stylesheets),e.unsuspend)){var t=e.unsuspend;e.unsuspend=null,t()}},(e.imgBytes>Kf?50:800)+t);return e.unsuspend=n,function(){e.unsuspend=null,clearTimeout(r),clearTimeout(i)}}:null}function Jf(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)Xf(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var Yf=null;function Xf(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,Yf=new Map,t.forEach(Zf,e),Yf=null,Jf.call(e))}function Zf(e,t){if(!(t.state.loading&4)){var n=Yf.get(e);if(n)var r=n.get(null);else{n=new Map,Yf.set(e,n);for(var i=e.querySelectorAll(`link[data-precedence],style[data-precedence]`),a=0;a<i.length;a++){var o=i[a];(o.nodeName===`LINK`||o.getAttribute(`media`)!==`not all`)&&(n.set(o.dataset.precedence,o),r=o)}r&&n.set(null,r)}i=t.instance,o=i.getAttribute(`data-precedence`),a=n.get(o)||r,a===r&&n.set(null,i),n.set(o,i),this.count++,r=Jf.bind(this),i.addEventListener(`load`,r),i.addEventListener(`error`,r),a?a.parentNode.insertBefore(i,a.nextSibling):(e=e.nodeType===9?e.head:e,e.insertBefore(i,e.firstChild)),t.state.loading|=4}}var Qf={$$typeof:x,Provider:null,Consumer:null,_currentValue:re,_currentValue2:re,_threadCount:0};function $f(e,t,n,r,i,a,o,s,c){this.tag=1,this.containerInfo=e,this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=Ye(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Ye(0),this.hiddenUpdates=Ye(null),this.identifierPrefix=r,this.onUncaughtError=i,this.onCaughtError=a,this.onRecoverableError=o,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=c,this.incompleteTransitions=new Map}function ep(e,t,n,r,i,a,o,s,c,l,u,d){return e=new $f(e,t,n,o,c,l,u,d,s),t=1,!0===a&&(t|=24),a=ti(3,null,null,t),e.current=a,a.stateNode=e,t=ea(),t.refCount++,e.pooledCache=t,t.refCount++,a.memoizedState={element:r,isDehydrated:n,cache:t},Ma(a),e}function tp(e){return e?(e=$r,e):$r}function np(e,t,n,r,i,a){i=tp(i),r.context===null?r.context=i:r.pendingContext=i,r=Pa(t),r.payload={element:n},a=a===void 0?null:a,a!==null&&(r.callback=a),n=Fa(e,r,t),n!==null&&(pu(n,e,t),Ia(n,e,t))}function rp(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function ip(e,t){rp(e,t),(e=e.alternate)&&rp(e,t)}function ap(e){if(e.tag===13||e.tag===31){var t=Xr(e,67108864);t!==null&&pu(t,e,67108864),ip(e,67108864)}}function op(e){if(e.tag===13||e.tag===31){var t=du();t=tt(t);var n=Xr(e,t);n!==null&&pu(n,e,t),ip(e,t)}}var sp=!0;function cp(e,t,n,r){var i=j.T;j.T=null;var a=M.p;try{M.p=2,up(e,t,n,r)}finally{M.p=a,j.T=i}}function lp(e,t,n,r){var i=j.T;j.T=null;var a=M.p;try{M.p=8,up(e,t,n,r)}finally{M.p=a,j.T=i}}function up(e,t,n,r){if(sp){var i=dp(r);if(i===null)Cd(e,t,r,fp,n),Cp(e,r);else if(Tp(i,e,t,n,r))r.stopPropagation();else if(Cp(e,r),t&4&&-1<Sp.indexOf(e)){for(;i!==null;){var a=gt(i);if(a!==null)switch(a.tag){case 3:if(a=a.stateNode,a.current.memoizedState.isDehydrated){var o=We(a.pendingLanes);if(o!==0){var s=a;for(s.pendingLanes|=2,s.entangledLanes|=2;o;){var c=1<<31-Le(o);s.entanglements[1]|=c,o&=~c}nd(a),!(Ml&6)&&($l=Te()+500,rd(0,!1))}}break;case 31:case 13:s=Xr(a,2),s!==null&&pu(s,a,2),vu(),ip(a,2)}if(a=dp(r),a===null&&Cd(e,t,r,fp,n),a===i)break;i=a}i!==null&&r.stopPropagation()}else Cd(e,t,r,null,n)}}function dp(e){return e=$t(e),pp(e)}var fp=null;function pp(e){if(fp=null,e=ht(e),e!==null){var t=o(e);if(t===null)e=null;else{var n=t.tag;if(n===13){if(e=s(t),e!==null)return e;e=null}else if(n===31){if(e=c(t),e!==null)return e;e=null}else if(n===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null)}}return fp=e,null}function mp(e){switch(e){case`beforetoggle`:case`cancel`:case`click`:case`close`:case`contextmenu`:case`copy`:case`cut`:case`auxclick`:case`dblclick`:case`dragend`:case`dragstart`:case`drop`:case`focusin`:case`focusout`:case`input`:case`invalid`:case`keydown`:case`keypress`:case`keyup`:case`mousedown`:case`mouseup`:case`paste`:case`pause`:case`play`:case`pointercancel`:case`pointerdown`:case`pointerup`:case`ratechange`:case`reset`:case`resize`:case`seeked`:case`submit`:case`toggle`:case`touchcancel`:case`touchend`:case`touchstart`:case`volumechange`:case`change`:case`selectionchange`:case`textInput`:case`compositionstart`:case`compositionend`:case`compositionupdate`:case`beforeblur`:case`afterblur`:case`beforeinput`:case`blur`:case`fullscreenchange`:case`focus`:case`hashchange`:case`popstate`:case`select`:case`selectstart`:return 2;case`drag`:case`dragenter`:case`dragexit`:case`dragleave`:case`dragover`:case`mousemove`:case`mouseout`:case`mouseover`:case`pointermove`:case`pointerout`:case`pointerover`:case`scroll`:case`touchmove`:case`wheel`:case`mouseenter`:case`mouseleave`:case`pointerenter`:case`pointerleave`:return 8;case`message`:switch(Ee()){case De:return 2;case Oe:return 8;case ke:case Ae:return 32;case je:return 268435456;default:return 32}default:return 32}}var hp=!1,gp=null,_p=null,vp=null,yp=new Map,bp=new Map,xp=[],Sp=`mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset`.split(` `);function Cp(e,t){switch(e){case`focusin`:case`focusout`:gp=null;break;case`dragenter`:case`dragleave`:_p=null;break;case`mouseover`:case`mouseout`:vp=null;break;case`pointerover`:case`pointerout`:yp.delete(t.pointerId);break;case`gotpointercapture`:case`lostpointercapture`:bp.delete(t.pointerId)}}function wp(e,t,n,r,i,a){return e===null||e.nativeEvent!==a?(e={blockedOn:t,domEventName:n,eventSystemFlags:r,nativeEvent:a,targetContainers:[i]},t!==null&&(t=gt(t),t!==null&&ap(t)),e):(e.eventSystemFlags|=r,t=e.targetContainers,i!==null&&t.indexOf(i)===-1&&t.push(i),e)}function Tp(e,t,n,r,i){switch(t){case`focusin`:return gp=wp(gp,e,t,n,r,i),!0;case`dragenter`:return _p=wp(_p,e,t,n,r,i),!0;case`mouseover`:return vp=wp(vp,e,t,n,r,i),!0;case`pointerover`:var a=i.pointerId;return yp.set(a,wp(yp.get(a)||null,e,t,n,r,i)),!0;case`gotpointercapture`:return a=i.pointerId,bp.set(a,wp(bp.get(a)||null,e,t,n,r,i)),!0}return!1}function Ep(e){var t=ht(e.target);if(t!==null){var n=o(t);if(n!==null){if(t=n.tag,t===13){if(t=s(n),t!==null){e.blockedOn=t,it(e.priority,function(){op(n)});return}}else if(t===31){if(t=c(n),t!==null){e.blockedOn=t,it(e.priority,function(){op(n)});return}}else if(t===3&&n.stateNode.current.memoizedState.isDehydrated){e.blockedOn=n.tag===3?n.stateNode.containerInfo:null;return}}}e.blockedOn=null}function Dp(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=dp(e.nativeEvent);if(n===null){n=e.nativeEvent;var r=new n.constructor(n.type,n);Qt=r,n.target.dispatchEvent(r),Qt=null}else return t=gt(n),t!==null&&ap(t),e.blockedOn=n,!1;t.shift()}return!0}function Op(e,t,n){Dp(e)&&n.delete(t)}function kp(){hp=!1,gp!==null&&Dp(gp)&&(gp=null),_p!==null&&Dp(_p)&&(_p=null),vp!==null&&Dp(vp)&&(vp=null),yp.forEach(Op),bp.forEach(Op)}function Ap(e,n){e.blockedOn===n&&(e.blockedOn=null,hp||(hp=!0,t.unstable_scheduleCallback(t.unstable_NormalPriority,kp)))}var jp=null;function Mp(e){jp!==e&&(jp=e,t.unstable_scheduleCallback(t.unstable_NormalPriority,function(){jp===e&&(jp=null);for(var t=0;t<e.length;t+=3){var n=e[t],r=e[t+1],i=e[t+2];if(typeof r!=`function`){if(pp(r||n)===null)continue;break}var a=gt(n);a!==null&&(e.splice(t,3),t-=3,vs(a,{pending:!0,data:i,method:n.method,action:r},r,i))}}))}function Np(e){function t(t){return Ap(t,e)}gp!==null&&Ap(gp,e),_p!==null&&Ap(_p,e),vp!==null&&Ap(vp,e),yp.forEach(t),bp.forEach(t);for(var n=0;n<xp.length;n++){var r=xp[n];r.blockedOn===e&&(r.blockedOn=null)}for(;0<xp.length&&(n=xp[0],n.blockedOn===null);)Ep(n),n.blockedOn===null&&xp.shift();if(n=(e.ownerDocument||e).$$reactFormReplay,n!=null)for(r=0;r<n.length;r+=3){var i=n[r],a=n[r+1],o=i[st]||null;if(typeof a==`function`)o||Mp(n);else if(o){var s=null;if(a&&a.hasAttribute(`formAction`)){if(i=a,o=a[st]||null)s=o.formAction;else if(pp(i)!==null)continue}else s=o.action;typeof s==`function`?n[r+1]=s:(n.splice(r,3),r-=3),Mp(n)}}}function Pp(){function e(e){e.canIntercept&&e.info===`react-transition`&&e.intercept({handler:function(){return new Promise(function(e){return i=e})},focusReset:`manual`,scroll:`manual`})}function t(){i!==null&&(i(),i=null),r||setTimeout(n,20)}function n(){if(!r&&!navigation.transition){var e=navigation.currentEntry;e&&e.url!=null&&navigation.navigate(e.url,{state:e.getState(),info:`react-transition`,history:`replace`})}}if(typeof navigation==`object`){var r=!1,i=null;return navigation.addEventListener(`navigate`,e),navigation.addEventListener(`navigatesuccess`,t),navigation.addEventListener(`navigateerror`,t),setTimeout(n,100),function(){r=!0,navigation.removeEventListener(`navigate`,e),navigation.removeEventListener(`navigatesuccess`,t),navigation.removeEventListener(`navigateerror`,t),i!==null&&(i(),i=null)}}}function Fp(e){this._internalRoot=e}Ip.prototype.render=Fp.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(i(409));var n=t.current;np(n,du(),e,t,null,null)},Ip.prototype.unmount=Fp.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;np(e.current,2,null,e,null,null),vu(),t[ct]=null}};function Ip(e){this._internalRoot=e}Ip.prototype.unstable_scheduleHydration=function(e){if(e){var t=rt();e={blockedOn:null,target:e,priority:t};for(var n=0;n<xp.length&&t!==0&&t<xp[n].priority;n++);xp.splice(n,0,e),n===0&&Ep(e)}};var Lp=n.version;if(Lp!==`19.2.7`)throw Error(i(527,Lp,`19.2.7`));M.findDOMNode=function(e){var t=e._reactInternals;if(t===void 0)throw typeof e.render==`function`?Error(i(188)):(e=Object.keys(e).join(`,`),Error(i(268,e)));return e=u(t),e=e===null?null:d(e),e=e===null?null:e.stateNode,e};var Rp={bundleType:0,version:`19.2.7`,rendererPackageName:`react-dom`,currentDispatcherRef:j,reconcilerVersion:`19.2.7`};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<`u`){var zp=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!zp.isDisabled&&zp.supportsFiber)try{Pe=zp.inject(Rp),Fe=zp}catch{}}e.createRoot=function(e,t){if(!a(e))throw Error(i(299));var n=!1,r=``,o=Vs,s=Hs,c=Us;return t!=null&&(!0===t.unstable_strictMode&&(n=!0),t.identifierPrefix!==void 0&&(r=t.identifierPrefix),t.onUncaughtError!==void 0&&(o=t.onUncaughtError),t.onCaughtError!==void 0&&(s=t.onCaughtError),t.onRecoverableError!==void 0&&(c=t.onRecoverableError)),t=ep(e,1,!1,null,null,n,r,null,o,s,c,Pp),e[ct]=t.current,xd(e),new Fp(t)}})),aa=E(((e,t)=>{function n(){if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<`u`&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE==`function`)try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(e){console.error(e)}}n(),t.exports=ia()}))(),q=vt(_(),1),oa=vt(Jt(),1),J=xt(),sa=`data-tip`,ca=400,la=300,ua=8,da=8;function fa(e){let t=e instanceof Element?e.closest(`[${sa}]`):null;return t&&t.getAttribute(`data-tip`)?.trim()?t:null}var pa=`data-tip-side`,ma=e=>e===`right`||e===`left`?e:`up`;function ha(e,t,n,r,i,a=`up`){let o=(e,t,n)=>Math.min(Math.max(da,e),Math.max(da,n-da-t)),s=o(e.top+e.height/2-n/2,n,i);if(a===`right`&&e.left+e.width+ua+t<=r-da)return{top:s,left:e.left+e.width+ua,side:`right`};if(a===`left`&&e.left-ua-t>=da)return{top:s,left:e.left-ua-t,side:`left`};let c=e.top-ua-n>=da,l=e.bottom+ua+n<=i-da,u=c||!l?`up`:`down`;return{top:u===`up`?Math.max(da,e.top-ua-n):e.bottom+ua,left:o(e.left+e.width/2-t/2,t,r),side:u}}function ga(e,t,n){let r=e.trim();return r===(t??``).trim()||r===(n??``).trim()}function _a({id:e,text:t,style:n,ref:r}){return(0,J.jsx)(`div`,{ref:r,id:e,role:`tooltip`,"data-keep-name":``,style:n,className:`fade-in pointer-events-none fixed z-50 w-max max-w-[320px] max-h-[calc(var(--screen)-16px)] overflow-hidden rounded-[10px] border border-line-soft bg-surface-muted px-4 py-2 text-[13px] leading-snug text-ink shadow-composer [overflow-wrap:anywhere]`,children:Dr(t)})}function va(e){try{return e.matches(`:focus-visible`)}catch{return!0}}var ya=e=>e.matches(`:disabled`),ba=(e,t,n)=>{let r=e.getBoundingClientRect();return t>=r.left&&t<=r.right&&n>=r.top&&n<=r.bottom};function xa(e,t,n){if(!(e instanceof Element))return null;for(let r of e.querySelectorAll(`:disabled[${sa}]`))if(r.getAttribute(`data-tip`)?.trim()&&ba(r,t,n))return r;return null}function Sa(){let e=(0,q.useId)(),[t,n]=(0,q.useState)(null),[r,i]=(0,q.useState)({visibility:`hidden`,top:0,left:0}),a=(0,q.useRef)(null),o=(0,q.useRef)(null),s=(0,q.useRef)(null),c=(0,q.useRef)(void 0),l=(0,q.useRef)(0);(0,q.useEffect)(()=>{let e=()=>{clearTimeout(c.current),s.current=null},t=(t,r=t)=>{e(),o.current=t,n({el:t,owner:r,text:Dr(t.getAttribute(`data-tip`)??``)})},r=()=>{e(),o.current&&(l.current=Date.now()),o.current=null,n(null)},i=n=>{if(n!==o.current&&n!==s.current){if(e(),o.current!==null||Date.now()-l.current<la)return t(n);s.current=n,c.current=setTimeout(()=>n.isConnected?t(n):e(),ca)}},a=e=>{if(e.pointerType===`touch`)return;let t=fa(e.target);t&&i(t)},u=t=>{let n=fa(t.target);!n||t.relatedTarget instanceof Node&&n.contains(t.relatedTarget)||(n===s.current&&e(),n===o.current&&r())},d=t=>{if(t.pointerType===`touch`)return;let n=o.current??s.current;if(n&&ya(n)&&!ba(n,t.clientX,t.clientY)&&(n===s.current&&e(),n===o.current&&r()),fa(t.target))return;let a=xa(t.target,t.clientX,t.clientY);a&&i(a)},f=e=>{let n=fa(e.target);n&&e.target instanceof Element&&va(e.target)?t(n,e.target):o.current&&r()},p=e=>{let t=o.current;t&&e.target instanceof Node&&t.contains(e.target)&&(e.relatedTarget instanceof Node&&t.contains(e.relatedTarget)||r())},m=e=>{e.key===`Escape`&&o.current&&(e.preventDefault(),e.stopPropagation(),r())},h={capture:!0,passive:!0},g={capture:!0};return document.addEventListener(`pointerover`,a,h),document.addEventListener(`pointerout`,u,h),document.addEventListener(`pointermove`,d,h),document.addEventListener(`pointerdown`,r,h),document.addEventListener(`focusin`,f,h),document.addEventListener(`focusout`,p,h),document.addEventListener(`keydown`,m,g),window.addEventListener(`scroll`,r,h),window.addEventListener(`resize`,r,h),window.addEventListener(`blur`,r),()=>{e(),document.removeEventListener(`pointerover`,a,h),document.removeEventListener(`pointerout`,u,h),document.removeEventListener(`pointermove`,d,h),document.removeEventListener(`pointerdown`,r,h),document.removeEventListener(`focusin`,f,h),document.removeEventListener(`focusout`,p,h),document.removeEventListener(`keydown`,m,g),window.removeEventListener(`scroll`,r,h),window.removeEventListener(`resize`,r,h),window.removeEventListener(`blur`,r)}},[]),(0,q.useEffect)(()=>{if(!t)return;let e=new MutationObserver(()=>{let e=t.el.getAttribute(sa)?.trim();if(!t.el.isConnected||!e){o.current=null,n(null);return}let r=Dr(e);r!==t.text&&n({...t,text:r})});return e.observe(t.el,{attributes:!0,attributeFilter:[sa]}),e.observe(document.body,{childList:!0,subtree:!0}),()=>e.disconnect()},[t]),(0,q.useEffect)(()=>{if(!t||ga(t.text,t.owner.getAttribute(`aria-label`),t.owner.textContent))return;let n=t.owner,r=n.getAttribute(`aria-describedby`);return n.setAttribute(`aria-describedby`,r?`${r} ${e}`:e),()=>{let t=(n.getAttribute(`aria-describedby`)??``).split(/\s+/).filter(t=>t&&t!==e);t.length?n.setAttribute(`aria-describedby`,t.join(` `)):n.removeAttribute(`aria-describedby`)}},[t,e]);let u=t?t.el.closest(`dialog[open]`)??document.body:null;return(0,q.useLayoutEffect)(()=>{if(!t||!a.current||!u){i({visibility:`hidden`,top:0,left:0});return}let e=!1,n=()=>{if(e||!a.current)return;let n=a.current.getBoundingClientRect(),r=ha(t.el.getBoundingClientRect(),n.width,n.height,window.innerWidth,window.innerHeight,ma(t.el.getAttribute(pa)));i({top:r.top,left:r.left})},r=u instanceof HTMLElement&&u!==document.body?u.getAnimations():[];return r.length?(i({visibility:`hidden`,top:0,left:0}),Promise.allSettled(r.map(e=>e.finished)).then(n)):n(),()=>{e=!0}},[t,u]),!t||!u?null:(0,oa.createPortal)((0,J.jsx)(_a,{ref:a,id:e,text:t.text,style:r}),u)}function Ca(e,t){if(!(!Number.isFinite(e)||e<=0||!Number.isFinite(t)||t<.25||t>4))return Math.round(e/t*100)/100}function wa(e){let t=e.createElement(`div`);t.setAttribute(`aria-hidden`,`true`),t.style.cssText=`position:absolute;top:0;left:0;width:1px;height:1000px;visibility:hidden;pointer-events:none`,e.body.appendChild(t);let n=t.getBoundingClientRect().height;return t.remove(),n/1e3}function Ta(e=window){let t=e.document,n=()=>{let n=Ca(e.innerHeight,wa(t));n===void 0?t.documentElement.style.removeProperty(`--screen`):t.documentElement.style.setProperty(`--screen`,`${n}px`)};return n(),e.addEventListener(`resize`,n),()=>e.removeEventListener(`resize`,n)}function Ea(e,t=900){let n=new Map,r=r=>{let i=r.target===e?e.documentElement:r.target;if(!i||!(i instanceof e.defaultView.Element))return;let a=n.get(i);a?clearTimeout(a):i.setAttribute(`data-scrolling`,``),n.set(i,setTimeout(()=>{n.delete(i),i.removeAttribute(`data-scrolling`)},t))};return e.addEventListener(`scroll`,r,{capture:!0,passive:!0}),()=>{e.removeEventListener(`scroll`,r,{capture:!0});for(let[e,t]of n)clearTimeout(t),e.removeAttribute(`data-scrolling`);n.clear()}}var Da=5e3,Oa=e=>new Date(e).toLocaleTimeString([],{hour:`2-digit`,minute:`2-digit`});function ka({onReload:e}){let[t,n]=(0,q.useState)(null);return(0,q.useEffect)(()=>{let e=!0,t=()=>void Gt.status().then(t=>e&&n(t),()=>{}),r=()=>{document.visibilityState===`visible`&&Gt.status().catch(()=>{})},i=setInterval(r,Da);return window.addEventListener(zt,t),document.addEventListener(`visibilitychange`,r),()=>{e=!1,clearInterval(i),window.removeEventListener(zt,t),document.removeEventListener(`visibilitychange`,r)}},[]),t?t.error?(0,J.jsxs)(`div`,{role:`alert`,className:`mx-4 mt-4 flex flex-col gap-1 rounded-[12px] bg-warn-soft px-4 py-2 text-sm text-warn [overflow-wrap:anywhere]`,children:[(0,J.jsxs)(`span`,{className:`font-medium`,children:[`The settings files have a problem: `,t.error]}),(0,J.jsxs)(`span`,{className:`text-ink-2`,children:[t.loadedAt?`Pages show the settings as they were at ${Oa(t.loadedAt)}`:`Pages cannot show the settings`,`; nothing can be started until it is fixed. Fix it in Settings or in the file: no restart is needed.`]})]}):(0,J.jsxs)(`div`,{role:`status`,className:`mx-4 mt-4 flex flex-wrap items-center gap-2 rounded-[12px] border border-accent-line bg-accent-soft px-4 py-2 text-sm`,children:[(0,J.jsx)(`span`,{className:`min-w-0 flex-1`,children:`The settings changed on disk. They are in use already; show this page with them?`}),(0,J.jsxs)(V,{size:`sm`,variant:`primary`,onClick:()=>{n(null),e()},"data-tip":`Show this page with the new settings`,children:[(0,J.jsx)(f,{"aria-hidden":`true`}),`Reload`]}),(0,J.jsxs)(V,{size:`sm`,variant:`ghost`,onClick:()=>n(null),children:[(0,J.jsx)(A,{"aria-hidden":`true`}),`Later`]})]}):null}var Aa=`[your objective: the story, feature or page to test]`,ja=[{label:`Generate functional test cases`,Icon:ot,text:[`Role: A test analyst who writes functional test cases from requirements`,`Objective: Write functional test cases for ${Aa}`,`Steps:
11
- 1. Read the story or requirement, its acceptance criteria and the pages it changes.
12
- 2. Write test cases for each acceptance criterion: the main path, other valid paths, invalid input and edge cases.
13
- 3. Compare them with the existing test cases, and reuse or extend a case where the steps are the same.
14
- 4. Save the new test cases, linked to the story.`,`Rules:
15
- - Each step has one action and one expected result.
16
- - Do not run tests and do not change code.`,`Output format: A table for each test case: id, title, preconditions, steps, expected results, and the acceptance criterion it covers.`,`Summary: Write and save functional test cases for the objective above.`].join(`
17
-
18
- `)},{label:`Generate test cases and automation scripts`,Icon:ge,text:[`Role: A test automation engineer who writes test cases and automates them in the test repository`,`Objective: Write functional test cases for ${Aa}, and automate them`,`Steps:
19
- 1. Read the story or requirement, its acceptance criteria and the pages it changes.
20
- 2. Write test cases for each acceptance criterion: the main path, other valid paths, invalid input and edge cases.
21
- 3. Compare them with the existing test cases, and save the new ones, linked to the story.
22
- 4. Run each test case in the browser on the selected test environment.
23
- 5. Turn each passed run into an automated test in the test repository, written in its framework, page objects and helpers.`,`Rules:
24
- - Each step has one action and one expected result.
25
- - Do not automate a test case that failed: report it with the reason.`,`Output format: A table of the test cases (id, title, acceptance criterion, run result), then each automation script's file and the command that runs it.`,`Summary: Write, run and automate test cases for the objective above.`].join(`
26
-
27
- `)},{label:`Generate test cases, scripts and regression`,Icon:g,text:[`Role: A test automation engineer who writes test cases, automates them and keeps the regression pack current`,`Objective: Write functional test cases for ${Aa}, automate them, and add them to the regression pack`,`Steps:
28
- 1. Read the story or requirement, its acceptance criteria and the pages it changes.
29
- 2. Write test cases for each acceptance criterion: the main path, other valid paths, invalid input and edge cases.
30
- 3. Compare them with the existing test cases, and save the new ones, linked to the story.
31
- 4. Run each test case in the browser on the selected test environment.
32
- 5. Turn each passed run into an automated test in the test repository, written in its framework, page objects and helpers.
33
- 6. Add the automated tests to the regression pack, then run the regression pack.`,`Rules:
34
- - Each step has one action and one expected result.
35
- - Do not automate a test case that failed: report it with the reason.
36
- - Do not remove a test from the regression pack.`,`Output format: A table of the test cases (id, title, acceptance criterion, run result), each automation script's file and command, and the regression pack's result with every failure and its reason.`,`Summary: Write, automate and add to regression the test cases for the objective above.`].join(`
37
-
38
- `)}];function Ma(e){let t=e.indexOf(Aa);return t<0?null:[t,t+52]}var Na=`forgeqe.regression.handoff`,Pa=`forgeqe.home.handoff`,Fa=[`thinking`,`searching`,`reading`,`working`,`writing`,`browsing`,`handing`],Ia=2600;function La(e=Math.random){let t=[...Fa];for(let n=t.length-1;n>0;n--){let r=Math.floor(e()*(n+1));[t[n],t[r]]=[t[r],t[n]]}return t}function Ra(e,t=Math.random){let n=e.length?[...e]:La(t);return{move:n.pop(),left:n}}function za(e,t=Ia){let n=[];function r(){let t=Ra(n);n=t.left,e(t.move)}r();let i=setInterval(r,t);return()=>{clearInterval(i),e(`idle`)}}function Ba(e){let[t,n]=(0,q.useState)(`idle`);return(0,q.useEffect)(()=>{if(!(e||Xn()))return za(n)},[e]),e?`idle`:t}var Va=[{state:`thinking`},{state:`idle`,activity:`searching`},{state:`idle`,activity:`browsing`},{state:`idle`,activity:`reading`},{state:`idle`,activity:`writing`},{state:`idle`,activity:`working`},{state:`idle`,activity:`handing`},{state:`speaking`},{state:`waiting`},{state:`idle`,mood:`joy`},{state:`idle`,mood:`content`},{state:`idle`,mood:`surprised`},{state:`idle`,mood:`concern`},{state:`idle`,mood:`frustrated`},{state:`idle`,mood:`angry`}],Ha=[`angry`,`frustrated`];function Ua(e){let t=e=>Number.isFinite(e)&&e>0?Math.floor(e):0,n=t(e.failed)+t(e.jobsFailed);return n>=3?{state:`idle`,mood:`angry`}:n>0?{state:`idle`,mood:`frustrated`}:t(e.waiting)?{state:`idle`,mood:`surprised`}:t(e.running)?{state:`idle`,activity:`working`}:{state:`idle`,mood:`joy`}}function Wa(e=null,t=Math.random){let n=e?.mood&&Ha.includes(e.mood)?e.mood:null,r=Va.map(e=>n&&(e.mood===`joy`||e.mood===`content`)?{state:`idle`,mood:n}:e);for(let e=r.length-1;e>0;e--){let n=Math.floor(t()*(e+1));[r[e],r[n]]=[r[n],r[e]]}return r}function Ga(e,t=Ia){let n=[],r=null,i=0,a=null,o=(t,n)=>{let r={state:t.state};t.mood&&(r.mood={kind:t.mood,at:++i,secs:n/1e3}),t.activity&&(r.activity=t.activity),e(r),a&&clearTimeout(a),a=setTimeout(s,n)};function s(){n.length||(n=Wa(r)),o(n.pop(),t)}return s(),{stop(){a&&clearTimeout(a),a=null,e({state:`idle`})},react(e){r=e,n=[],o(e,t*2)},attend(){o({state:`waiting`},t)}}}function Ka(e,t,n){let[r,i]=(0,q.useState)({state:`idle`}),a=(0,q.useRef)(null);(0,q.useEffect)(()=>{if(e||Xn())return;let t=Ga(i);return a.current=t,()=>{a.current=null,t.stop()}},[e]);let o=t?`${t.state}/${t.mood??``}/${t.activity??``}`:``;(0,q.useEffect)(()=>{t&&a.current?.react(t)},[o,e]);let s=(0,q.useRef)(!0);return(0,q.useEffect)(()=>{if(s.current)return void(s.current=!1);n&&a.current?.attend()},[n]),e?{state:`idle`}:r}function qa({href:e,label:t,className:n}){return(0,J.jsxs)(`a`,{href:e,className:L(`inline-flex min-h-9 w-fit items-center gap-2 self-start text-sm`,n),children:[(0,J.jsx)(Se,{size:16,"aria-hidden":`true`}),t]})}var Ja=()=>location.hash.replace(/^#\/?/,``).split(`/`).filter(Boolean);function Ya(){let[e,t]=(0,q.useState)(Ja);return(0,q.useEffect)(()=>{let e=()=>t(Ja());return window.addEventListener(`hashchange`,e),()=>window.removeEventListener(`hashchange`,e)},[]),e}function Xa({className:e}){let t=er(Ya());return t?(0,J.jsx)(qa,{href:t.href,label:t.label,className:e}):null}var Za={$comment:`ForgeQE's release notes, newest first: the web app's What's new and each GitHub Release. See RELEASING.md.`,releases:[{version:`3.1.0`,date:`2026-11-19`,summary:`Live mobile recording you can actually work in, steps that find their controls the way a replay will, fewer agent cards with each agent's crew on its page, and an API agent that reuses the calls you already have.`,changes:[{kind:`new`,title:`Record a mobile app live`,detail:`Record shows the steps on the left, the device's screen in the centre and the device and what the recorder says on the right; a foldable or a tablet on its side spans the page. Typing opens over the bottom of the screen, a tap says it is working until the device answers, and Check, Long-press and Wait for go back to Tap after one use. Recordings run on this computer, BrowserStack or TestMu AI.`,to:[`record`]},{kind:`improved`,title:`Mobile steps that replay on any screen`,detail:`Each mobile step keeps the locators a replay will use, best first: the app's id or accessibility label, then what the control is and says, and only ones that match that control alone. Scrolling to a control becomes one step that works on any screen size, checkboxes and switches are set rather than tapped, drop-downs and iOS picker wheels are chosen by value, and a tap on a chart or canvas is kept as a spot within it. Pages inside the app (a sign-in or payment) are read as web pages when the build allows it.`,to:[`record`]},{kind:`new`,title:`Magic links from the login's mailbox`,detail:`For a login whose codes come by email, Open magic link reads the newest message from that mailbox and opens its link on the device, as tapping it in a mail would. Only an https link to one of the login's sites is taken, and the link is never shown, logged or kept.`,to:[`record`]},{kind:`improved`,title:`See how each step finds its control`,detail:`Every recorded step, web, desktop or mobile, shows the locator a replay will use to find its control.`,to:[`record`]},{kind:`improved`,title:`Fewer agents, each with its crew`,detail:`The All agents page lists only agents with work of their own; helpers that plan, review or assist are shown as that agent's crew on its page, with what each does on hover. Quill opens the Record page, Link the API tests page (with Planner), Librarian the Knowledge page (notes under its Notes tab) and Mender the Regression page. Old addresses, starred agents and kept chats move to the agent they joined.`,to:[`agents`]},{kind:`fixed`,title:`The API agent reuses the calls you have`,detail:`The API agent now looks up the project's APIs and calls before adding any, reuses an API of the same name or address or asks you, and never adds a call the API already has. A chat picked up again still knows the page's APIs.`,to:[`api-tests`]},{kind:`improved`,title:`Docs and the architecture map in the app's look`,detail:`The docs pages and the architecture map inside forgeqe web now use the web app's design, fonts and icons, in light and dark, and the map shows today's agents and everything ForgeQE remembers for a project. About ForgeQE has one Docs entry.`,to:[`about`]},{kind:`fixed`,title:`Localization checks run again, and sturdier reading`,detail:`A broken page script had stopped every localization check (and the visual capture after it) from running; they run again. Tosca exports, JMeter files and other outside text can no longer slow a reader down with crafted input, and one-time codes and certificate downloads use TLS 1.2 or newer.`,to:[`quality`]}]},{version:`3.0.9`,date:`2026-11-18`,summary:`Test management finds your repository's own tests, links them to cases and runs them through their own frameworks, with gaps read live from your tracker's stories and a sync on a schedule.`,changes:[{kind:`new`,title:`Your repository's tests, found and linked`,detail:`Test management's new Automated tab lists the repository's tests as a test explorer does, found through each framework (pytest, Jest, Vitest, Mocha, Playwright, .NET, Robot and Gherkin). Each keeps its id when renamed or moved. Tests are linked to cases by the id they carry, a person's link or Matchmaker, the mapping agent, whose uncertain picks are only proposals. Pick a case's main test on its page.`,to:[`test-management`]},{kind:`improved`,title:`Run every linked test, Gherkin scenarios too`,detail:`Running a case now runs all its linked tests, not only the first. Gherkin scenarios run through their project's own runner: Cucumber.js, Behave, Cucumber JVM with Maven or Gradle, SpecFlow, Reqnroll or pytest-bdd.`,to:[`test-management`]},{kind:`improved`,title:`Gaps from your tracker's stories`,detail:`Gaps reads a release's stories live from Azure DevOps, Jira or qTest for the sprint, version, epic or ids you give, and lists stories with no test case and acceptance criteria not covered. Pick stories and hand them to the Gap agent to draft cases.`,to:[`test-management`]},{kind:`improved`,title:`Sync on a schedule, and more from every tracker`,detail:`Sync test plans hourly or daily, and optionally discover tests too after seeing the exact commands. Xray, TestRail, Zephyr Scale and qTest cases now show priority, state, automation, suite and last outcome. Take ForgeQE's tags off in the trackers, and keep suites as Xray Server Test Sets. forgeqe web now starts the jobs service again after a restart, so schedules no longer wait silently.`,to:[`test-management`]},{kind:`improved`,title:`Pages that hold still`,detail:`Every page has the same back link above its title and the same tab bars and choices. Titles and tabs no longer shift when a tab shows a wide view or the agent panel.`,to:[`product`]}]},{version:`3.0.8`,date:`2026-11-17`,summary:`BASAL replaces Watchdog for business testing, a Neo4j graph store for product knowledge, migration from any stack including JMeter, and one consistent shape for every agent's page.`,changes:[{kind:`new`,title:`BASAL, business testing from a question`,detail:`Ask a business question and BASAL works through seven steps: it understands the question from your files, work items and product knowledge, plans a test strategy, casts a persona for each stakeholder, rehearses their reactions, then acts through ForgeQE's agents on a test environment and judges the outcomes by code. Nothing runs until you approve the plan by typing the test's id, and steps that change data run only after you agree to them. BASAL replaces Watchdog; old Business assurance data is not carried over.`,to:[`agents`,`basal`]},{kind:`new`,title:`A graph store for product knowledge`,detail:`ForgeQE can keep the product knowledge graph in Neo4j, for search by meaning as well as by words. Set it up from Settings › Evidence or forgeqe graph setup: it asks first, then runs Neo4j on this computer in Docker or without it, or uses your team's own server. Knowledge builds keep it in step, and without it ForgeQE uses the graph file as before.`,to:[`settings`]},{kind:`new`,title:`Migrate from any stack, and from JMeter`,detail:`On the Migration page, choose Other and name your test files' types to migrate from a stack ForgeQE does not know. JMeter test plans (.jmx) are read for their requests, assertions, captures and data sets, and the values they expect are used to prove the migrated tests really check something.`,to:[`migration`]},{kind:`improved`,title:`One shape for every agent's page`,detail:`Each agent with screens of its own opens on one page: its Agent tab first, its work tabs beside the title. Data and Miner are now one page, Exploratory, Desktop apps, Migration and Tosca gain an Agent tab, and every page is titled by its sidebar name. Pages share one width, and tables share search and paging.`,to:[`data`]},{kind:`improved`,title:`See the commands an agent runs`,detail:`In a chat, each command an agent runs is its own step, with what it prints as it runs and how it ended. The right panel's new Commands section lists the open chat's commands, running ones first, with who ran them and for how long.`,to:[`chats`]}]},{version:`3.0.7`,date:`2026-11-17`,summary:`Talk, rebuilt: speak to Atlas from any page and hear it answer as it works. Talk over it, tell it to wait, and hear when work elsewhere finishes. Atlas can also search the web.`,changes:[{kind:`new`,title:`Talk, rebuilt`,detail:`Talk sits at the foot of the right panel on every page. Speak to Atlas, ForgeQE's own agent, and hear its answer as it writes it. Talk over it any time: it stops at once and takes in what you say. Speech stays on this computer, so the only cost is the model's tokens. Set it up once in Settings › Voice.`,to:[`settings`,`voice`]},{kind:`new`,title:`Web search`,detail:`Atlas can search the web for you, without opening a browser. The results show in the chat, and Atlas says which site each fact came from.`,to:[`chats`]},{kind:`improved`,title:`Talk keeps you posted`,detail:`While Atlas works, Talk says what it is doing, and on a long step that it is still on it. It tells you when other work in ForgeQE finishes or needs your answer, and reads out the first few items of a list.`,to:[`settings`,`voice`]},{kind:`improved`,title:`Wait, go on, and corrections`,detail:`Say "wait" or "hold on" and the work pauses before its next step; "go on" carries on. A "yeah" or "right" while Atlas talks lets it carry on. A correction you make as it finishes is still taken in, and only your own words show in the chat.`,to:[`settings`,`voice`]},{kind:`improved`,title:`Tokenomics counts every kind of work`,detail:`What used the most now lists chats, custom agents, test runs and test writing, not only reports, and marks what was done by voice.`,to:[`settings`,`tokenomics`]},{kind:`improved`,title:`One voice download, English only`,detail:`Talk speaks English only for now: Hindi was heard too poorly to use. Onboarding offers voice as one download, the same on every computer.`}]},{version:`3.0.6`,date:`2026-11-17`,summary:`A Test management hub over your trackers' plans, chats that no longer end in silence, saved passwords that replay again, and agent pages that keep their place.`,changes:[{kind:`new`,title:`Test management`,detail:`A new Test management page brings the test plans you name in Settings › Integrations together with your automated tests, runs, suites and tags. See coverage and its trend on the dashboard, filter and run test cases, find ranked gaps, build suites with the Suite agent and run them. Mark cases automated, write tags or keep a suite in Azure DevOps or Xray: each write is shown first and done only when you confirm.`,to:[`test-management`]},{kind:`improved`,title:`Workbench calls to another app`,detail:`In the API workbench, a call can be sent to an app of the environment by writing {{app.NAME}} as its address. ForgeQE looks the app up in the chosen environment of env.yaml and does not send the call when that environment has no such app.`,to:[`api-tests`]},{kind:`fixed`,title:`Chats that finish what they start`,detail:`A chat on a GitHub Copilot seat no longer ends turns with no reply or rewrites the same plan over and over: an empty answer is asked again, a step that says nothing is told to carry on, and what still fails is reported as failed. Asking only to run test cases no longer starts writing tests. A brief connection blip no longer drops the chat: the page reconnects quietly, and a chat you stop says Stopped by a person.`,to:[`chats`]},{kind:`fixed`,title:`Saved passwords replay again`,detail:`A password in env.yaml with an unseen character pasted after its variable's name was typed as text, so the sign-in could not be replayed. Such a value is now reported and never shown, and a run that types a password without a saved secret says so every time. Settings › Report a problem now lists known troubles of a session first.`,to:[`settings`]},{kind:`improved`,title:`Agent pages keep their place`,detail:`An agent's page leads back to the sidebar section that lists it, and its Recent runs are now Conversations, its chats with that agent. A chat started from an agent's page stays with that agent and keeps the sidebar where it was, and Continue working on a section's page shows only that section's runs.`,to:[`agents`]},{kind:`fixed`,title:`Steadier browser and recordings`,detail:`The browser's step bar no longer blinks while the agent takes screenshots. When recording, the browser's Back is recorded as Back, and a short recording of a still page keeps its video.`,to:[`record`]}]},{version:`3.0.5`,date:`2026-11-16`,summary:`A guided first run in the web app, Update and Restart that work on Windows and for pip installs, and a mascot that reacts to your day.`,changes:[{kind:`new`,title:`A guided first run`,detail:`The first time you open forgeqe web, a short tour walks you through the Settings screens you need: choose or create the project folder, connect its repository (keep it, clone into an empty folder, or start one), set ForgeQE up and pick the features this computer needs, then the model, product knowledge and appearance. Each feature says what it downloads, about how big and where, and is installed only once you confirm. Every step but Set up can be skipped, the tour appears only once, and Settings › Set up starts it again.`,to:[`setup`,`settings`]},{kind:`fixed`,title:`Update and Restart work on Windows and for pip installs`,detail:`On Windows, Settings › About's Update no longer waits forever: Restart closes forgeqe web, installs the new version and starts it again in its own window, which opens in a new tab. When ForgeQE was installed with pip, the page now shows the version you updated to, and Restart starts that one.`,to:[`settings`]},{kind:`improved`,title:`A mascot that reacts to your day`,detail:`On Home, the mascot now reacts to what needs a look: failures frustrate or anger it, an approval startles it, a run in progress makes it think, a clean day makes it glad, and it listens while you type. Both looks gain angry and frustrated faces.`,to:[`appearance`]}]},{version:`3.0.4`,date:`2026-11-16`,summary:`Re-record a recording to heal the controls that moved, Talk drives a recording by voice, every agent has a plain name of its own, and the report is five views instead of twenty-two pages.`,changes:[{kind:`new`,title:`Re-record heals what moved`,detail:`On the Record page, Re-record plays a recording's own steps against the app as it is now. When a control moved and another of the locators recorded for it still finds exactly that one control, the step goes through it and the swap is shown to you. Accept the ones you want and they become the recording's locators, kept as a new version of the review. If the recording already has a test, ForgeQE then heals that test instead of writing a new one.`,to:[`record`]},{kind:`new`,title:`Drive a recording by voice`,detail:`While a recording is going, tell Talk to pause, carry on, stop, undo the last step, add a check or add a note. Each goes to the recorder as its own command, and Talk asks before it stops a recording or removes a step. Its answers are always spoken, since you're in the app being recorded.`,to:[`voice`,`record`]},{kind:`new`,title:`Narrated videos`,detail:`With browser.narrate_video on, a replay's video, and a recording's own video once it stops, says what each step did and how its checks went. It's spoken on this computer by Talk's own voice, so nothing is sent anywhere, and secrets are never read out.`,to:[`record`,`settings`]},{kind:`improved`,title:`Every agent has a name of its own`,detail:`Each agent now has one plain name, the same in the terminal and the web app, that says what it does: Quill writes tests, Checker reviews them, Link writes API tests, Rover explores user journeys, Watchdog runs business assurance, and so on. Before, one agent could have two names and some had none. Config, logs and llm.agents keep working, and agent.names still renames any agent.`,to:[`agents`]},{kind:`improved`,title:`The right model for each kind of work`,detail:`With routing on, the agent that plans and hands out work gets the most capable model, and the other areas weigh rating against price instead of always taking the cheapest model that is good enough. Choose this in Settings › Routing with llm.strategy: balanced (the default), capability or cost.`,to:[`models`,`settings`]},{kind:`new`,title:`See what routing cost, by area of work`,detail:`Every model call now records the area of work it was for and why its model was chosen, so the report and Cost page show spend per area and what routing saved or cost. The spend figures show which way the bill moved, against a target, with a plain verdict.`,to:[`tokenomics`]},{kind:`improved`,title:`The report in five views`,detail:`The report's menu is now five questions, Overview, Tests, Quality, Cost and Trends, with the old pages as tabs inside them, instead of a list of twenty-two pages. Nothing was removed. The report also uses the web app's look, its Overview opens with the verdict, and the run timeline is a line with milestones.`,to:[`runs`]},{kind:`improved`,title:`A run's Summary uses the width`,detail:`A run's Summary opens with its numbers (outcome, time, cases, files changed, tokens) and lays its sections out as tiles that fill the window, with the files it worked on and the checker's findings in view. Details is tiles too.`,to:[`runs`]},{kind:`improved`,title:`Browse shows where to pick up`,detail:`Each landing page has Continue working, your last three runs and how they went, instead of repeating the sidebar's pinned and recent pages. Each work area leads to its own landing page, and agents after the seventh sit behind a button. The sidebar's Environment section starts collapsed.`,to:[`browse`]},{kind:`improved`,title:`API tests go to Link`,detail:`The Orchestrator no longer writes an API suite itself: API tests, their helpers and feature files go to Link, the API agent. The Runs page now credits Link and the Planner for their work, so their own pages list those runs.`,to:[`api-tests`,`runs`]},{kind:`improved`,title:`Tidier API workbench`,detail:`Each API in the Workbench sidebar opens and closes on its own, and an API, its calls and its flows can be renamed in place.`,to:[`api-tests`]},{kind:`improved`,title:`Locators that survive page changes`,detail:`A recording now keeps a relative XPath anchored on what the page says, not an absolute path that breaks when anything above the element moves. Rows and cards anchor on what names them, like an invoice number or a heading, rather than on a status or amount that changes.`,to:[`record`]},{kind:`new`,title:`Playwright for Python, Java and .NET`,detail:`Scribe has a skill for Playwright projects in Python, Java and .NET, including how to use a recording's locators. It's the one Playwright skill now.`,to:[`skills`]},{kind:`improved`,title:`Custom agents show their mascot`,detail:`A custom agent with no icon is drawn as its own mascot, and the icon picker has a No icon choice. If an agent names an icon ForgeQE doesn't have, the picker says so instead of failing the save silently. Small mascots are drawn without a tile.`,to:[`agents`]},{kind:`improved`,title:`Accent colours stay in the family`,detail:`With a custom colour in Appearance, the buttons' hover, soft backgrounds, lines and links now come from that colour's own family and keep readable contrast in light and dark mode.`,to:[`appearance`]},{kind:`fixed`,title:`Renaming a model no longer blocks saving`,detail:`Renaming or removing a model on Settings › Models now updates forgeqe.yaml too, so settings that named the old model no longer refuse every save.`,to:[`models`,`settings`]},{kind:`fixed`,title:`A smoother orb`,detail:`The orb's moves now run into each other instead of stopping at idle between them.`,to:[`appearance`]}]},{version:`3.0.3`,date:`2026-11-15`,summary:`Talk answers at once and sounds more natural, and the API page shows who does the work.`,changes:[{kind:`improved`,title:`Talk answers at once`,detail:`Plain commands like opening a page, going back, starting a new chat, opening the last run, switching light or dark, the browser window, the environment or Talk's voice now happen as soon as you stop speaking, without waiting for the model and at no cost. When Talk does need to think, it says “Sure.” right away instead of staying silent, and work it hands to ForgeQE is answered “On it. I'll tell you what it finds.”`,to:[`voice`]},{kind:`improved`,title:`Talk sounds more natural`,detail:`Talk reads whole sentences in Kokoro's full-quality voice, not pieces cut at commas, and a decimal or a version number no longer ends a sentence. It speaks like a colleague, in complete sentences with specifics, and does what you ask instead of offering to. Your project's own app and environment names are heard more reliably.`,to:[`voice`]},{kind:`improved`,title:`The API page shows who does the work`,detail:`The Agent tab on the API tests page now shows the Orchestrator, whose chat it is, and says that writing API tests and planning flows go to the API agents. In the chat, that work shows as a handoff to the API agent or the API planner, with its steps underneath, and ForgeQE's own API tools get clear labels.`,to:[`api-tests`,`chats`]},{kind:`fixed`,title:`A quieter terminal start screen`,detail:`The terminal app's start screen no longer redraws itself every 8 seconds for nothing.`,to:[`setup`]}]},{version:`3.0.2`,date:`2026-11-15`,summary:`Talk tells what's said to it from the room's own talk, can listen to your voice only, and changes settings as you say them. Plus a livelier orb and a smoother "+" menu.`,changes:[{kind:`improved`,title:`Talk knows when you're talking to it`,detail:`After the wake word, Talk acts only on what's said to it: an order or a request. A phone call, a greeting to a colleague or a story told across the room is dropped, nothing shown or kept. A sentence cut off midway waits for the rest instead of being acted on in half. Send when I pause now needs the wake word, and turns it on.`,to:[`voice`]},{kind:`new`,title:`Only my voice`,detail:`Turn on Only my voice in Settings › Voice and Talk acts only on the voice that said the wake word. Another voice in the room goes into the message box instead, for you to look at. Nothing about your voice is saved to a file.`,to:[`voice`,`settings`]},{kind:`improved`,title:`Settings change as you say them`,detail:`The browser window, desktop replays, mobile emulators, the model and the test environment now change at once, like light or dark, with no question first. Settings opens the section, marks the row and says “Changed by voice”, so a misheard change is easy to spot and put back. Production and models outside your profiles are still never picked. Starting work (tests again, a pack, a recording, writing a test) still waits for your yes.`,to:[`voice`,`settings`]},{kind:`fixed`,title:`Talk answers aloud on Home and in a chat`,detail:`Where there's a message box, Talk's own answers, questions and refusals are now spoken, not only written. “The browser settings” opens Settings › Browser, not WebPilot, and names run together (“FlakyTests”) still find their page.`,to:[`voice`]},{kind:`improved`,title:`Talk starts from the message box`,detail:`The Talk buttons in the sidebar are gone: start Talk from the message box, whose button shows whether speech is set up and lights while it listens. New chat has a plain pen icon instead of Atlas's.`,to:[`voice`,`appearance`]},{kind:`improved`,title:`The orb plays while you wait`,detail:`On Home and in the agent builder, the orb above the greeting acts out the kinds of work ForgeQE does in a gentle loop, and shows the waiting orb while a chat or the builder starts. With reduced motion it stays still.`,to:[`appearance`,`agents`]},{kind:`improved`,title:`A smoother "+" menu`,detail:`Moving between the "+" menu's levels (Environment, Tools, Back) now slides the pane and resizes the box smoothly instead of jumping.`,to:[`chats`]}]},{version:`3.0.1`,date:`2026-11-15`,summary:`Talk does several things in one request, changes a few settings, starts work after a yes and answers ForgeQE's questions. Plus emulators without a window, and a coding agent that follows your instructions.`,changes:[{kind:`new`,title:`Several things in one request`,detail:`Ask Talk for more than one thing at once (“switch to dark mode, open the runs page and ask ForgeQE why the last run failed”) and it does them in order. Ask “what's on this page?” or “why did this run fail?” for a sentence or two about what you're looking at, “how many runs failed this week?” for the counts, and “show only the failed runs” to filter Runs.`,to:[`voice`]},{kind:`new`,title:`Start work and change settings by voice, after a yes`,detail:`Talk can run a run's failed tests again, run a regression pack (here or on TestMu), record an app your settings list, or write a test from the open recording, each only after you say yes. It changes light or dark and its own language, voice and wake word at once, and after a yes the browser window, desktop replays headed or headless, mobile emulators shown or hidden, the model in use and the test environment, saved and audited as Settings saves them. Never a production model or environment; other settings stay in Settings.`,to:[`voice`,`settings`]},{kind:`new`,title:`Answer ForgeQE's questions by voice`,detail:`Turn on Answer questions by voice in Settings › Voice and Talk reads ForgeQE's question and its options aloud. Say one, then yes to send it; a yes on its own never picks an option. A question about production, and a pause that waits for you, still need a click. It's off until you turn it on, and only a click turns it on.`,to:[`voice`,`chats`]},{kind:`new`,title:`Emulators without a window`,detail:`A device in Settings › Mobile can name an Android emulator (Emulator to start) for Appium to start for the run, and Emulators without a window starts emulators and iOS simulators with no window. Real devices and cloud devices are never affected.`,to:[`settings`]},{kind:`improved`,title:`Talk is the mascot in the corner`,detail:`On a page with no message box, Talk is the mascot of the agent you're talking to, in the bottom-right corner, listening, thinking or speaking. Where there is a box, the box is the conversation and nothing floats over it.`,to:[`voice`,`appearance`]},{kind:`improved`,title:`Talk speaks without pauses`,detail:`Talk starts speaking sooner and no longer pauses between sentences. It now says one short piece while it prepares the next. App names are heard the way you say them (“key pass” finds KeePass), and Talk no longer asks you twice before starting something.`,to:[`voice`]},{kind:`improved`,title:`The coding agent follows your instructions`,detail:`What you ask for when a test is written (“tag it @regression”, “follow CONTRIBUTING.md”) now reaches the coding agent, and it reads the repository's own contributing rules. A test the reviewer rejected is no longer kept as passed, and ForgeQE's agent leaves the coding agent's test to the coding agent and its reviewer instead of rewriting it.`,to:[`code`]},{kind:`fixed`,title:`API runs, run logs and token counts`,detail:`“Run GET /categories only” now runs just that call. A no to calls that change data is taken as your answer instead of being asked again. Two chats started in the same second no longer share one log, Atlas is listed on every run it worked on, and browser agent tokens and the coding agent's work in forgeqe run --direct, record and code are counted on the Runs and Cost pages.`,to:[`api-tests`,`chats`]}]},{version:`3.0.0`,date:`2026-11-15`,summary:`Robot Framework as a migration target, your own migration targets without waiting for a release, and Talk gets a wake word, Hindi and a tidier chat box.`,changes:[{kind:`new`,title:`Migrate to Robot Framework`,detail:`Robot Framework with the Browser library is now a migration target, and a framework the coding agent writes: a case whose Framework line says Robot Framework gets a .robot suite with shared keywords in resources/, and its runs keep videos, screenshots and Robot's own log as evidence. ForgeQE also installs what a Python test project needs, with uv, Poetry, Pipenv or pip, from the project's own requirements file.`,to:[`migration`]},{kind:`new`,title:`Add your own migration targets`,detail:`A framework ForgeQE was never taught can be a target: describe it in .forgeqe/migrate-targets/<id>.yaml (its language, the command that runs one test, what counts as evidence) and approve it at a terminal with forgeqe migrate target approve. Migrations and Tosca conversions can both use it; forgeqe migrate targets and forgeqe tosca targets list them with their approval state.`,to:[`migration`]},{kind:`improved`,title:`A migrated test must prove it checks something`,detail:`Before a migrated test is kept, ForgeQE runs a copy of it with the values its source expected made wrong. That run has to fail: a test that passes either way is not migrated, whatever its framework. The migration report shows this as Checks proved.`,to:[`migration`]},{kind:`new`,title:`Talk: a wake word, and Hindi`,detail:`Switch on the wake word and Talk acts only on what starts with “Hey ForgeQE” (or your app's name), then listens for follow-ups until 20 seconds of quiet. Talk also listens and answers in Hindi. It keeps hearing you while ForgeQE works, so “stop” stops it, and once the work is done it says a short summary instead of reading the whole reply back.`,to:[`chats`]},{kind:`improved`,title:`A tidier chat box, and Settings › Voice`,detail:`The box's toolbar is now the “+”, Refine, Talk, the model and Send; attach, environment and tools are rows of the “+” menu. Talk's language, voice, “Send when I pause” and the one-time speech setup moved to Settings › Voice, and Talk stays greyed out until speech is set up.`,to:[`settings`,`voice`]},{kind:`improved`,title:`Agent cards open where the agent works`,detail:`The Tosca and Migration cards on the Agents page, in the command palette and in Browse open their own pages, and each page has an “Ask the … agent” link back to its chat. Bridge goes by one name everywhere, in the terminal too.`},{kind:`fixed`,title:`Talk from an npm install, and on ARM64 Windows`,detail:`Talk's voice agent stopped as it started after an npm install, and the data engine could not load; both now ship in the package. Speech setup on ARM64 Windows failed for want of a native wheel; it now uses an x64 Python there.`}]},{version:`2.10.5`,date:`2026-11-14`,summary:`Record a phone app by hand, with Appium set up for you; talk to ForgeQE out loud; agents come alive as mascots; and API tests learn from your runs and recordings.`,changes:[{kind:`new`,title:`Record a mobile app by hand`,detail:`Record › Mobile app shows your phone's or emulator's screen on the page, here or on TestMu AI or BrowserStack. Tap, type, swipe and check on it: each action is done on the device and saved as a step that replays with no model. Passwords are typed from your saved secrets by name, a dropdown choice is one step, and the recording opens in a review where you add checks by clicking the app's picture and replay it.`,to:[`record`]},{kind:`new`,title:`Appium is set up for you`,detail:`For an emulator or phone on this computer, forgeqe mobile setup (or Settings › Set up › Install what's missing) installs Appium and its drivers, and every run starts Appium by itself when it is needed and stops it after. ForgeQE finds the Android SDK and Java on its own. Devices on TestMu AI or BrowserStack need none of this.`,to:[`settings`,`setup`]},{kind:`new`,title:`Talk to ForgeQE`,detail:`Talk (under Search, and in every chat box) is a voice assistant of ForgeQE's own. Say “open the model settings”, “where are my failed runs? open it” or “search for TestMu”: it moves around the app at once, with no chat, and asks when it is not sure. Ask for real work, such as “get me the ACs for 256 from ADO”, and ForgeQE does it and reads the answer aloud as it arrives; say “stop” to stop it. In a chat, what you say goes into the box to change or Refine first. Speech runs on this computer; Settings › Models picks Talk's model.`,to:[`chats`]},{kind:`new`,title:`Agents as living mascots`,detail:`Agents in the chat, on Home and on the Agents pages are drawn as small animated mascots, a robot or a character in its job's outfit, each in its own colour. Click one and it reacts; it rests when idle and sleeps when unused. Settings › Appearance switches between robots, characters and the old icons.`,to:[`settings`,`appearance`]},{kind:`new`,title:`A theme from one colour`,detail:`Settings › Appearance › From one colour turns a single colour into a family of matching shades and, if you want, sets the sidebar, buttons and page from it, keeping text readable.`,to:[`settings`,`appearance`]},{kind:`new`,title:`API tests learn from your runs and recordings`,detail:`ForgeQE compares several runs of the same flow to tell which parts of a call you choose (an id, a search word) and makes them inputs. A recording made by hand now keeps the app's API calls in full, with credentials removed, so API tests can be made from it. A contract the app outgrew can be healed, and nothing changes until you agree.`,to:[`api-tests`]},{kind:`improved`,title:`Personas and files in any message`,detail:`@files and /persona commands are shaded in every chat box, and several personas can be named anywhere in a message (check @steps.json as /sam and /priya). Refine keeps them. Replies now type out smoothly as they arrive.`,to:[`chats`]},{kind:`improved`,title:`Long replies are easier to read`,detail:`A long answer now reads as sections: clear heading sizes, a line between sections, and lines that stop at a comfortable width. Code and tables still use the full width.`,to:[`chats`]},{kind:`improved`,title:`Sources tucked away`,detail:`The line an answer ends with naming its sources (work items, run folders, reports) now folds under Sources at the end of the reply, one click away, and Talk never reads it or file paths aloud.`,to:[`chats`]},{kind:`improved`,title:`A calmer, more consistent look`,detail:`The web app's spacing, text sizes and shadows now follow one scale, so pages feel roomier and headings stand out by size alone. Body and chat text are a little larger.`},{kind:`improved`,title:`Chats start faster`,detail:`Azure DevOps, GitHub and your other connected systems no longer all start when a chat opens: each starts only when the chat first needs it, so nothing signs in that is not used.`},{kind:`improved`,title:`Searches use the site's own filters`,detail:`When you ask for results under a price or the cheapest few, the browser agent now uses the site's filter or sort instead of reading every page, and a request to generate a script hands the test to the coding agent and its reviewer.`},{kind:`fixed`,title:`Your team's own work item states`,detail:`Release readiness, duplicate bug checks and test case reuse now follow the states your Azure DevOps or Jira project really uses (In Test, Verified, Shipped…), so finished work no longer counts as open and a bug is not filed twice.`},{kind:`fixed`,title:`GitHub Copilot sessions`,detail:`An agent's reply is no longer cut short in the chat, an agent can no longer loop asking for tools it already has, and a test job whose browser cannot start stops with how to fix it instead of spending tokens.`}]},{version:`2.10.4`,date:`2026-11-13`,summary:`Your pinned pages stay pinned after you restart ForgeQE, dropdowns are readable in dark mode, and the recording window fits your screen.`,changes:[{kind:`fixed`,title:`Pins stay after a restart`,detail:`Pinned pages, recent pages and starred agents were cleared each time you started forgeqe web again. ForgeQE now keeps them for you, so they are there in every new session. Pins you already have are kept from your next session on.`},{kind:`fixed`,title:`Dropdowns in dark mode`,detail:`In dark mode, the open list of a dropdown, such as the new recording's Start on, showed most options as light text on white on Windows. The list now uses the dark theme's colours.`,to:[`appearance`]},{kind:`fixed`,title:`The recording window fits your screen`,detail:`On a Windows display set to a larger scale (125% or more), the recording window was bigger than the screen, so its bottom and scroll bar were out of sight. It now opens maximised.`,to:[`record`]}]},{version:`2.10.3`,date:`2026-11-13`,summary:`Checks added in a recording's review now hold on every step and every run, re-runs no longer click into the middle of a page, and the review warns when a locator or a checked value will not hold next time.`,changes:[{kind:`fixed`,title:`Checks of a text inside a longer text`,detail:`A text you pick to check in the review, such as "(user and pass: admin)" next to a link, is found wherever it shows on the page. Before, it had to be an element's whole text, so the check failed on a re-run although the page showed it.`,to:[`record`]},{kind:`fixed`,title:`Every step has its picture in the review`,detail:`Steps 8, 9, 18, 19 and so on showed no picture in the review, and no check could be added after them ("Step 10 has no screenshot to check against"). Recordings made before this fix show their pictures too.`,to:[`record`]},{kind:`fixed`,title:`Re-runs no longer jump to another page`,detail:`A click on the page itself, such as the one the browser sends after you choose from a dropdown, is no longer a step. A click on the empty space of a section is replayed where you clicked, not in the middle of the section, where a link may be.`,to:[`record`]},{kind:`improved`,title:`Values that change on every visit`,detail:`ForgeQE notices a text that is different each time the same page loads, such as a random label or one message of a few, and checks that a message shows rather than which one. The review says why.`,to:[`record`]},{kind:`improved`,title:`The review says when a locator will not hold`,detail:`A step found by an id a framework made up, or by a name that holds data like a price, says so in the review, and you can pick another of its locators. The test written from the recording prefers a steady locator.`,to:[`record`]},{kind:`fixed`,title:`Location in replays`,detail:`A recording that used your location replays with a fixed test location, the same on every run, never your own. The test written from it is told which browser permissions the site needs.`}]},{version:`2.10.2`,date:`2026-11-13`,summary:`Recording now captures the hard parts of real pages, from frames, shadow DOM and new windows to hover menus, gestures and keyboard-driven widgets, and their replays run on Windows.`,changes:[{kind:`improved`,title:`Recordings that replay on tricky pages`,detail:`Recordings now replay on pages built with hover menus (including menus inside menus), web components, framesets, lazy content that loads as you scroll, and buttons whose label or icon comes from CSS. A Close, Delete or OK button that appears more than once is found through the toast, row or card it belongs to. Tested on every example page of the-internet.herokuapp.com on Windows.`,to:[`record`]},{kind:`new`,title:`New windows, gestures and keyboard widgets`,detail:`Steps in a window a link opens are recorded there. A press and hold, a swipe, several choices in a multiple-select list, and arrow keys or typing on custom dropdowns, sliders and canvases are now steps. Moving the pointer off the top of the page, which some sites answer with an offer, is a step too.`,to:[`record`]},{kind:`improved`,title:`Back, scrolling and suggestions replay as you did them`,detail:`Going back right after a click, or back from a form's result page, is kept. A replay scrolls to where you stopped scrolling, and waits for a search box's suggestions before choosing one.`,to:[`record`]},{kind:`improved`,title:`Sign-ins and one-time codes`,detail:`A password you type is matched to the right saved login, or read from the site's own variable when it is none of them; the password itself is never recorded. A one-time code the page shows, kept as a variable, is typed from that variable. Permissions you allowed while recording, such as your location, are allowed in the replay.`,to:[`record`]},{kind:`fixed`,title:`Downloads and hovers in Edge replays`,detail:`Replays in Edge no longer get stuck on Edge's own downloads page after a download, and a menu opened by a hover stays open for the next step.`,to:[`record`]},{kind:`new`,title:`Unpin a page from the sidebar`,detail:`Hover a page in the sidebar's Pinned list and click its star to unpin it.`}]},{version:`2.10.1`,date:`2026-11-12`,summary:`Attach Word, Excel and PowerPoint files to a chat, and recordings now capture downloads, right-clicks, scrolls, tooltips and sites behind a browser sign-in, with more kinds of checks.`,changes:[{kind:`new`,title:`Attach Word, Excel and PowerPoint files`,detail:`Drop a .docx, .xlsx or .pptx file (up to 5 MB) into a chat and the agent reads its text. ForgeQE keeps a plain-text copy beside the file, without running any macro or formula. Older .doc, .xls and .ppt files are refused, with the format to save them as.`,to:[`chats`]},{kind:`new`,title:`Downloads are recorded and checked`,detail:`Clicking Export or Download while recording adds a download step with the file's name and size, matched by a pattern when part of the name changes, like a date. The replay waits for the file and fails if it does not arrive or is empty.`,to:[`record`]},{kind:`new`,title:`Right-clicks, scrolls and tooltips`,detail:`Recordings now capture a right-click on the page's own menu, and scrolling of the page or of a list that loads more at its end. To check a tooltip or hover card, press the leader key and then H: the hover is kept, and you can pick the tooltip's text as a check in the review.`,to:[`record`]},{kind:`new`,title:`More kinds of checks`,detail:`In a recording's review, a check on an element can now say it is enabled, it is disabled, how many elements match (as a number), or what an attribute's value is. Changing what a check looks at resets how it compares, so what you see is what is saved.`,to:[`record`]},{kind:`new`,title:`Sites behind the browser's own sign-in`,detail:`A staging site that shows the browser's sign-in box (basic auth) now replays instead of stopping at a 401. The replay signs in with the saved login for that site. If there is none, the recording tells you to save one.`,to:[`record`]},{kind:`fixed`,title:`Steadier replays`,detail:`Replays wait for spinners inside frames too, such as in a payment form, and no longer wait forever for a spinner the page had hidden. On Windows, Stop now closes the recording's browser window.`,to:[`record`]}]},{version:`2.10.0`,date:`2026-11-12`,summary:`Recordings capture drag and drop and browser dialogs and replay them the same way, Stop closes the browser at once, and dropdowns and hover menus replay reliably.`,changes:[{kind:`new`,title:`Drag and drop is recorded`,detail:`Dragging a card, moving a list item or map pin, or sliding a slider becomes one step in your recording. The replay drags with the mouse just as you did, so lists and maps that only start dragging once the pointer moves work too. Selecting text or sweeping over the page is not mistaken for a drag.`,to:[`record`]},{kind:`new`,title:`Browser dialogs are recorded`,detail:`Alerts, confirms and prompts now appear while you record, and your answer (OK, Cancel or the text you typed) becomes a step. The replay gives the same answer, checks the page showed the dialog, and dismisses any dialog the recording did not have.`,to:[`record`]},{kind:`fixed`,title:`Stop closes the browser at once`,detail:`Pressing Stop closes the recording's browser straight away, and ForgeQE saves the recording afterwards. Before, the window stayed open for several seconds while it saved, so Stop looked broken. A recording's video is no longer empty when a site moves the tab to its own process on the first page load.`,to:[`record`]},{kind:`fixed`,title:`Dropdowns and hover menus replay reliably`,detail:`A menu or time list that opens after a click is no longer recorded as a hover that is gone on replay. Locators leave out classes that change with the pointer, such as active or selected, so a picked item is found again on replay.`,to:[`record`]}]},{version:`2.9.9`,date:`2026-11-12`,summary:`Business assurance tests what people could make your business lose, maps draw as architecture diagrams, recordings explain every step, and personas open in a side panel with skills and knowledge of their own.`,changes:[{kind:`new`,title:`Business assurance`,detail:`A new agent tests your software the way customers, staff and opportunists would use it: over-refunds, coupons redeemed twice, rules bypassed on another journey, self-approval. It reads your product's rules, ranks the risks, and runs investigations on a test environment, saying what the business intended and whether it held. Findings are written for leaders, product, risk and engineering.`,to:[`agents`,`business`]},{kind:`new`,title:`Simulate a whole population`,detail:`Business assurance can build a population from your personas (mostly honest customers, some opportunists, a few insiders) and let it trade on a test environment over simulated days. Checks name who broke a rule, so a loss hidden in the totals shows up, for example 7 of 67 refunds paying back more than was paid. Ask why lets you question one person about what they did. The same seed always gives the same people.`,to:[`agents`,`business`]},{kind:`improved`,title:`Maps drawn as architecture diagrams`,detail:`The Code map, the Impact map and the Product page's links share one graph. Code map shows all your repositories as the product, with the data stores and systems they share, and opens a repository arranged by layer: front end, API, services, data access, with tests and shared code at the sides. The Impact map puts the changed files at the top and each step away below them.`,to:[`product`,`code`]},{kind:`improved`,title:`Recordings explain every step`,detail:`A recording's review shows what each step recorded: the element, the best locator and the others with whether each was unique, its frames, and what was typed (a password only by its variable). A recording started from the web app has a Stop button on the page. Every recording and re-run keeps a log. Checks picked from a step's picture now reach text inside web components and frames.`,to:[`record`]},{kind:`new`,title:`Personas with their own skills and knowledge`,detail:`A persona opens in a side panel, with Edit (or Copy to edit for a built-in one). It shows the skills and documents the persona uses, with suggestions to add. ForgeQE can write skills and knowledge just for that persona, when you save it or with Generate, used only when someone works as that persona. New persona is a side panel too, and the Persona pages are linked at the top right.`,to:[`agents`,`persona`]},{kind:`improved`,title:`A calmer, more consistent web app`,detail:`Pages change smoothly: the old page stays until the new one has its data, then fades over. The icon colour you choose in Appearance now reaches every icon, button, link and the entry you are on, without turning the page pale. Recent chats have icons, and Needs a look marks a failure with a clear bar in its colour.`,to:[`settings`,`appearance`]},{kind:`fixed`,title:`Token totals add up`,detail:`A chat's All agents total now stays the sum of its agents, instead of showing only Atlas's use at the end of a turn. Each agent says the tokens it used and how full its context is, and every page words token breakdowns the same way.`}]},{version:`2.9.8`,date:`2026-11-12`,summary:`ForgeQE installs a test project's packages before running its tests, Cypress cases get Cypress tests, and agents ask you before they install, run or change anything they may not.`,changes:[{kind:`fixed`,title:`Cypress cases get Cypress tests`,detail:`A test case whose Framework line says Cypress is now written as a Cypress test, in the folder where your Cypress suite lives. A test in another framework is never run, kept or linked to the case, so a Playwright test no longer passes for a Cypress case.`},{kind:`improved`,title:`Packages installed before tests run`,detail:`When a test project's packages are missing, ForgeQE installs them with the project's own lockfile before the test runs. If a run says Cypress, a Playwright browser or a package is missing, it installs that once and runs again. A failed install stops the job with the reason in plain words and the command to run yourself.`},{kind:`new`,title:`Agents ask before they install, run or change`,detail:`Quill, the healing agent and Link no longer change your packages themselves. When they need a package, a command their shell refuses, or a change to package.json, requirements.txt or pyproject.toml, ForgeQE shows you exactly what it would do and acts only on a yes. A no, or a run nobody watches, changes nothing and the test is reported as blocked. A shell, a git push, .npmrc and lockfile edits are always refused.`,to:[`settings`,`code`]},{kind:`new`,title:`Choose how agent requests are answered`,detail:`Settings › Code › Help it gets › When an agent asks for more (code.requests): ask a person each time (the default), allow after ForgeQE's checks without asking, or refuse every request.`,to:[`settings`]},{kind:`improved`,title:`A simpler Mask page`,detail:`Mask's page has one message box. Its own Agent chat is gone, because you use a persona from any agent's chat (/priya …). Personas is the first screen, and its tabs sit beside the persona count.`,to:[`persona`]}]},{version:`2.9.7`,date:`2026-11-11`,summary:`A suite no longer stops after its first case writes a test, and env.yaml variables that point to a .env secret are typed as that secret instead of its name.`,changes:[{kind:`fixed`,title:`A suite no longer stops after its first case writes a test`,detail:`Running test cases against an environment could hang once a passing case started writing its test, and every later case showed Not run: the suite was stopped. The suite now carries on through every case.`},{kind:`fixed`,title:`env.yaml variables that point to a .env secret`,detail:"A variable like TestPassword: password, ${NAME} or env:NAME was typed literally, so the browser agent typed the word password. It is now a secret: the value comes from that .env variable, is typed only on the environment's own sites and never appears in a brief or log. A literal password in env.yaml stays reported and is never copied into a converted env.yaml."}]},{version:`2.9.6`,date:`2026-11-11`,summary:`Search your documents and past chats without a vector database, a Librarian you can correct, a recorder that handles frames, shadow DOM, uploads and CAPTCHAs, replays that wait for the page, and ServiceNow test cases.`,changes:[{kind:`new`,title:`Search your documents without a vector database`,detail:`ForgeQE splits your knowledge notes, documents and docs folders into sections and finds the ones that answer a question, with no embeddings or database to set up. Turn on Skimmer to let the model pick sections. Use forgeqe knowledge docs index, search and outline, or Ask the documents on the Knowledge page. PDF, Word and Excel are indexed when you ask.`},{kind:`improved`,title:`Agents read only the sections they need`,detail:`Skills and knowledge notes now reach an agent as the sections that fit its task, not whole files: 55 to 80% less text on the built-in skills. The same question to Skimmer is answered from its cache, with no model call.`},{kind:`new`,title:`Search what was said in every chat`,detail:`Typing three or more letters in All chats also searches what was said in every kept chat, the terminal's included, and opens a web chat at that turn. Terminal chats are now kept, with secrets taken out. In this chat lists the document sections the agent used.`,to:[`chats`]},{kind:`improved`,title:`Long chats carry over what matters`,detail:`A long chat reopened or moved to another model now sends its last four turns and the earlier turns about your new message in full, and every other turn as one line, instead of only the last 20 turns.`},{kind:`new`,title:`Librarian: see what ForgeQE understood and correct it`,detail:`Ask Librarian what ForgeQE knows about your product, then correct it. Each change to a knowledge note, project skill, team prompt or product rule is shown as a diff and written only when you approve it. Where sources disagree, it asks which is right. Available from forgeqe knowledge chat, the chat and the Knowledge hub.`},{kind:`improved`,title:`Recorder handles frames, web components and canvases`,detail:`Steps inside frames, including another site's frame within a frame, are recorded and replayed. Menus inside web components no longer record as a click on the whole component, closed shadow roots are recorded too, and a canvas click keeps where it landed.`,to:[`record`]},{kind:`improved`,title:`Locators for buttons that repeat`,detail:`When the same button appears on every row or card (Remove, Book now), the recorder anchors it on the row or card by text only that one has, so a replay picks the right one even after the list is reordered.`,to:[`record`]},{kind:`improved`,title:`Uploads from anywhere`,detail:`A file picked from outside the project, such as Downloads, is copied into the recording. Browse buttons and files dropped on a drop zone are recorded and replayed. Hidden files, files named like credentials and files over 25 MB are still refused.`,to:[`record`]},{kind:`new`,title:`CAPTCHAs become one step a person solves`,detail:`A reCAPTCHA, hCaptcha, Turnstile, Arkose or GeeTest is recorded as one step, not its clicks. A replay with a visible browser waits up to 3 minutes for a person to solve it. The written test runs where the CAPTCHA is turned off and never tries to get round it.`,to:[`record`]},{kind:`improved`,title:`Replays wait for the page`,detail:`After every replayed step, the page gets up to 10 seconds to finish loading, finish its own background calls and clear any spinner the step brought up. Pages that only work once their data has loaded now pass. In the review you can add a wait after a step: until the page loads, until a text shows or goes, or a pause.`,to:[`record`]},{kind:`new`,title:`Checks that compare`,detail:`Change a check in the review to compare by is exactly, starts with, ends with, does not contain, matches a pattern, or a number that is equal, above, below or between two values, with case optionally ignored.`,to:[`record`]},{kind:`improved`,title:`Re-run history and step pictures`,detail:`Each re-run keeps a picture of the page after every step, and a failed step's opens by itself. The Runs tab lists the latest 30 re-runs, even after forgeqe web restarts, and the History tab is now called Versions. Videos open in a new tab.`,to:[`record`]},{kind:`new`,title:`ServiceNow test cases`,detail:`Read tests and their steps from ServiceNow Test Management by number, sys_id or query (read only). Set it up on Settings' ServiceNow card.`,to:[`settings`]},{kind:`improved`,title:`Test case ids found in the right system`,detail:`A test case id is looked up in the system it belongs to, from its prefix, a link or sources.id_routes. When more than one system could hold it, ForgeQE asks which instead of guessing.`},{kind:`fixed`,title:`Run one case from a Markdown file`,detail:`A Markdown file with common steps and a heading per case (5458-02, TC-3) can now run a single case, with the common steps included. A precondition is taken as met by the test data and no longer stops a run or fails one that reached the expected result. A typed password or one-time code is no longer shown in a step's line.`}]},{version:`2.9.5`,date:`2026-11-11`,summary:`Writing a test from a recording uses far fewer tokens: the coding agent no longer loops on re-reads and repeated edits, and a stopped job carries on fresh. Accessibility checks keep their zoom and no longer pass when nothing ran.`,changes:[{kind:`improved`,title:`The coding agent stops going round in circles`,detail:`When the coding agent re-reads files that have not changed or keeps editing the same files without running the test, ForgeQE stops it and asks for its test. code.repeat_after (default 6) and code.edit_after (default 8) set when, also in Settings. The planner keeps to 15 steps and no longer looks up the same thing twice.`,to:[`settings`]},{kind:`improved`,title:`A stopped or extended job carries on fresh`,detail:`Running a stopped job again, or raising its token budget, now starts a short new session from the job's brief, the agreed plan and the files already written, instead of re-sending the whole earlier conversation on every call.`},{kind:`improved`,title:`Live browser when the replay cannot get through`,detail:`When ForgeQE's replay of a recording cannot reach its last page, the coding agent gets the live browser from the start instead of patching steps blind.`},{kind:`fixed`,title:`Unattended writing no longer asks Carry on?`,detail:`A test written with nobody watching stops at code.max_tokens instead of asking. When a person is asked, Carry on? now says whether the test has been run yet and how many model calls the job made.`},{kind:`fixed`,title:`A stopped job says truthfully what it left`,detail:`A stopped job now lists the files it changed and whether the test ever ran. It no longer says Test run 1 failed or Test written when no test ran.`},{kind:`improved`,title:`See why GitHub Copilot calls cache so little`,detail:`With a Copilot model profile, each call logs a line with its input and cached tokens (never the prompt's text), and the low-cache notice points to it.`},{kind:`fixed`,title:`Accessibility checks keep their zoom and report honestly`,detail:`The low-vision persona's 200% zoom is kept after the page changes. A persona whose run broke (no model, no browser) is now Not tested and fails the check, and forgeqe a11y exits 1 instead of showing a pass. A stopped session lists the personas it never ran, and every persona run includes the axe-core rule checks.`}]},{version:`2.9.4`,date:`2026-11-11`,summary:`Business personas any agent can act as (/priya, /sam and more), BDD skills for Gherkin feature files, Dynamics 365 know-how for the browser agent and Quill, and project logos that fit the sidebar by themselves.`,changes:[{kind:`new`,title:`Mask: test as the business would`,detail:`A business persona is someone who accepts the software the way the business does: a payments expert, an end user, a compliance specialist or an operations manager, each with what they check before they accept it. Five are built in, and Mask drafts your own from a description.`,to:[`agents`,`persona`]},{kind:`new`,title:`/priya, /sam and other persona commands`,detail:`Start a message with a persona's command (/priya, /sam, /dana, /lee, /alex, or your own) in the terminal, forgeqe run or any web chat, and the agent works as that persona. The chat box suggests them after /.`,to:[`agents`,`persona`]},{kind:`new`,title:`Persona page`,detail:`Mask's page has an Agent tab to describe a person and save the persona it drafts, a list of personas with what each checks, and Run as this persona. Each saved persona also gets a readable Markdown profile.`,to:[`agents`,`persona`]},{kind:`new`,title:`Share personas between projects`,detail:`Export personas as a file and import them in another project, from the page or with forgeqe persona export and import. An import adds only new personas, never replaces one, and is refused whole if anything in it is not a persona.`},{kind:`new`,title:`BDD feature files`,detail:`Tests can be written as Gherkin feature files for Reqnroll/SpecFlow, cucumber-js, playwright-bdd, Cucumber-JVM, behave or pytest-bdd. Before writing one, the agent asks whether you want a Scenario Outline with Examples, a Background and Rule blocks, and it writes scenarios from the acceptance criteria.`},{kind:`new`,title:`Dynamics 365 know-how`,detail:`The browser agent knows Dynamics 365's own names for its controls (site map, Quick Create, Quick Find, subgrids, lookups, business process flow and more), and tests written for D365 use reliable locators and wait for the page to settle.`},{kind:`improved`,title:`Project logos fit the sidebar by themselves`,detail:`Settings › Appearance › Logo size has Fit automatically, now the default: the logo is sized from its shape so it is seen and its words can be read. A logo with no project name fills the brand area, and a logo with its own background gets rounded corners instead of a second plate.`,to:[`settings`,`appearance`]}]},{version:`2.9.3`,date:`2026-11-11`,summary:`A redesigned Record page that follows each recording to its test, desktop recordings you can review and edit, video of recordings and replays, ForgeQE working on every Windows, and a hosted mode for forgeqe web.`,changes:[{kind:`improved`,title:`Record page redesigned`,detail:`Record now opens on headline numbers, the New recording form beside a short How it works, and a table of recordings with search and filters. Each row shows its test case, browser, duration and what it produced, with a menu to open, write the test, open the chat, read the steps or delete.`,to:[`record`]},{kind:`new`,title:`See the test written from each recording`,detail:`Every web recording says whether it has a test: No test yet, Writing the test, Test written with its file, Test out of date, Test not passing or Writing failed. Writing again updates that test instead of adding a second one.`,to:[`record`]},{kind:`improved`,title:`Writing a test carries on without you`,detail:`Writing a test from a recording keeps going when you leave the page, and the chat and the recording link to each other. It says why a writing failed, and Stop writing ends one. If the model cannot be reached, ForgeQE checks every 30 seconds for up to 15 minutes and carries on where it stopped.`,to:[`record`]},{kind:`new`,title:`Stop a recording's Re-run`,detail:`A re-run of a web recording now has Stop, so you no longer wait for every step to time out. The steps already done are kept and the result is marked stopped, not failed.`,to:[`record`]},{kind:`new`,title:`Review desktop recordings like web ones`,detail:`A desktop workflow opens in a review with Steps, Test data and Last run tabs. See how each step went on the last replay, add a check, wait or keys after a step, change or drop a step with a preview, and turn a typed value into test data or a secret.`,to:[`desktop`]},{kind:`new`,title:`A picture of each desktop step, and click it to add a check`,detail:`Desktop recordings and replays keep a picture of the app after each step. Click a control in the picture to add a check that it shows its text, or that it is there. A password field's text is never kept.`,to:[`desktop`]},{kind:`new`,title:`Video of recordings, replays and desktop runs`,detail:`Recordings by hand, re-runs and desktop runs now keep a video, and the review plays it. browser.video and desktop.video turn it off. Making a typed value a secret removes that recording's videos.`},{kind:`improved`,title:`Change or remove desktop apps, with arguments`,detail:`Desktop apps' list has Change (path, arguments, description) and Remove, which says first which workflows name the app. Adding an app now takes arguments too, typed as on a command line and never run through a shell.`,to:[`desktop`]},{kind:`new`,title:`Hosted mode for forgeqe web`,detail:`forgeqe web --port 8080 --public-url https://NAME serves a demo or security test through a TLS proxy that limits who gets in. It still listens only on 127.0.0.1 and needs its token. Anyone who gets through the proxy with the link can use ForgeQE and its credentials, so give that server test credentials only.`},{kind:`improved`,title:`Home starts from better requests`,detail:`Home's starters are now three requests written out in full (test cases; test cases and scripts; test cases, scripts and regression): type only your objective. What needs a look is a clear list of rows saying what each one opens.`},{kind:`improved`,title:`Tidier Tosca conversion header`,detail:`A conversion's header keeps Start again, Run and Report as buttons, with Re-import, CI, Pull request and Delete under More.`,to:[`tosca`]},{kind:`improved`,title:`Context and tokens shows the 30-day total`,detail:`The panel's This project section now opens with the project's 30-day token total, which leads to Settings › Tokenomics, and each row has its own icon.`},{kind:`fixed`,title:`ForgeQE works on every Windows`,detail:`Fixes for Windows x64 and ARM64: Tosca exports that could not be read, API tests losing their address, test commands built for the wrong shell, the Azure CLI not starting, short user folder names, and Edge's own new tab appearing at the start of a run. Every change is now tested on Windows too.`},{kind:`fixed`,title:`Git hooks stay off on Windows, and protected folders stay protected`,detail:`On Windows, a git hook in a folder any user could create could run during ForgeQE's own checkouts; it no longer can. The coding agent could also write to ForgeQE's run folder when it was on another drive; that is now refused.`}]},{version:`2.9.2`,date:`2026-11-10`,summary:`A Desktop apps page and a DeskPilot that replays, explores and accepts heals from the web app or chat, recording any desktop app by its path, Copy to edit for built-in skills, and safer project .env files and tool downloads.`,changes:[{kind:`new`,title:`Desktop apps page`,detail:`Quality Engineering › Automation › Desktop apps does what forgeqe desktop does: Workflows, Runs, and Machine and apps tabs, with Replay (variables, data rows, heal, new baselines), Explore and Set up in sheets. Accept a passed replay's heals from its run. Fix with the agent and Why did it fail open a chat.`,to:[`desktop`]},{kind:`new`,title:`DeskPilot in chat`,detail:`DeskPilot has its own agent page, and in chat it can list workflows and runs, validate a workflow, replay with data rows, accept a passed replay's heals and set up the engine (asking first for anything that changes something).`},{kind:`new`,title:`Record any desktop app`,detail:`Record's app list ends with Another app…: type the program's path or pick it with Browse, name it, and ForgeQE adds it to the environment's apps and records it. Machine and apps has Add an app too. Only a real program file is accepted, never a .bat, .cmd or script.`,to:[`record`]},{kind:`new`,title:`Copy to edit a built-in skill`,detail:`A built-in skill's panel offers Copy to edit: save the project's own copy under the same name, with its reference files, and it replaces the built-in one in this project.`,to:[`skills`]},{kind:`fixed`,title:`Scheduled custom agents keep their request`,detail:`A schedule ran agent run <id> --unattended with no request, because the request was read as the switch's value. It now runs with the request it was given.`,to:[`agents`]},{kind:`fixed`,title:`Sidebar foot stays in view on laptops`,detail:`On laptop-sized windows in some browsers the sidebar ran past the window and hid Settings, Help and Dark/Light. It now fits in every browser.`},{kind:`fixed`,title:`A malformed address no longer blanks the web app`,detail:`An address like #/regression/%E0 left a blank app. Pages now read it safely, and a page that fails to draw shows a short note in its place instead of taking the app down. Errors in ForgeQE's own code now answer 500, not 400.`},{kind:`improved`,title:`A project's .env cannot run other code`,detail:`A cloned repository's .env can no longer set NODE_OPTIONS=--require, LD_PRELOAD, PYTHONSTARTUP, GIT_SSH_COMMAND and similar names that make every program ForgeQE starts load other code. Keys, proxies and CA files load as before; the shell and ForgeQE's own .env are unchanged.`},{kind:`improved`,title:`Downloaded tools need a matching checksum`,detail:`The agent runtime and uv install only when their SHA-256 matches one pinned in ForgeQE. A download whose checksum cannot be checked (a rate limit, a proxy) is refused instead of installed unchecked.`}]},{version:`2.9.1`,date:`2026-11-10`,summary:`Tosca migration grows up: an assistant that sets it up in chat, API, desktop, mobile and database steps converted, batches, CI pipelines and pull requests. Settings › Secrets keeps every secret and pulls from Azure, Google and AWS vaults.`,changes:[{kind:`new`,title:`Guide`,detail:`The Tosca page opens on an Agent tab. Say what to migrate in your own words; the assistant asks only what it still needs (exports, framework, language, where the tests start, the app or database the cases use, the secret behind each test variable) and opens the wizard on Review with every stage filled in. It can clone exports from a git repository, and conversations survive a restart.`,to:[`tosca`]},{kind:`new`,title:`Tosca converts API, desktop, mobile, database and file steps`,detail:`API test cases become API tests. Desktop and mobile test cases become ForgeQE workflows, written by code with no model, with their test data in a .data.csv and secrets typed from variables; inside a web test they are replayed at their step. Read-only database queries become checks with the target's own client (values bound as parameters), and file and Excel reads become checks. Mixed test cases convert their web and API steps and mark the rest for a person; anything that writes stays for a person.`,to:[`tosca`]},{kind:`new`,title:`Know what can be migrated before you start`,detail:`Every test case of an export is sorted by kind with what becomes of it (also as a CSV), Ready to run checks what the run needs before Start, and Review estimates the conversion's tokens and cost.`,to:[`tosca`]},{kind:`new`,title:`Several exports, batches and re-import`,detail:`A plan can read many .tsu files or a folder of them (duplicates converted once). Convert in batches (--batch N) checks each batch before the next. Read exports again (forgeqe tosca reimport) brings in what changed, and tosca-map.json traces each Tosca test case by its id to its test and last outcome.`,to:[`tosca`]},{kind:`new`,title:`Tosca test data from a data file`,detail:`Name Tosca's Export to Excel of a test sheet, or any CSV, Excel or JSON file, on Review (or forgeqe tosca data) and {XL[...]} values are filled from it instead of left for a person.`,to:[`tosca`]},{kind:`new`,title:`CI pipelines and pull requests for a conversion`,detail:`forgeqe tosca ci (or the CI pipeline sheet) writes a GitHub Actions or Azure Pipelines file with one job per execution list, plus replay jobs for desktop and mobile workflows. Pull request on a finished conversion (or forgeqe tosca pr) commits the target folder on ForgeQE's own branch without touching your checkout.`,to:[`tosca`]},{kind:`improved`,title:`Tosca report built for thousands of test cases`,detail:`One compact summary on top, test cases grouped as Failed, Needs attention, Passed, Not run and Left out, searchable, 50 at a time. Every test run keeps a failure screenshot and a video by default. Download the HTML report as a zip with every video. Activity groups its log by unit, with search and filters. A stopped or failed conversion can be started again from its page.`,to:[`tosca`]},{kind:`new`,title:`Settings › Secrets and vaults`,detail:`Every saved secret by name in one place: add, replace or remove; a value is never shown again. Connect Azure Key Vault, Google Secret Manager or AWS Secrets Manager (browser sign-in recommended), browse names and pull a value straight into the credential store. Export vault connections, without values, for teammates to import. Repository tokens are a filter here, and the suggested token name is now REPO_TOKEN.`,to:[`settings`,`secrets`]},{kind:`fixed`,title:`Desktop replay on Windows`,detail:`Replay brings the app forward and refuses to click or type while another program's window is in front, types text as keys (Save dialogs), and no longer stops when healing is off or its model cannot be used. A heal is remembered only from a replay that passed. Recording by hand catches the OK that closes a dialog.`},{kind:`fixed`,title:`Sidebar and browser detection fixes`,detail:`A shell starting a browser is no longer counted as a browser, and the sidebar no longer falls back to tiles because its icons were mis-measured.`}]},{version:`2.9.0`,date:`2026-11-10`,summary:`Browsers start on locked-down PCs (through Playwright, or attached to one you opened), forgeqe doctor browser explains a failed start, the sidebar keeps your recent chats and pages, and one 30-day token figure across the app.`,changes:[{kind:`new`,title:`Start the browser through Playwright, or attach to your own`,detail:`browser.launch in forgeqe.yaml (and Settings › Browser) is auto, direct, playwright or attach. Auto starts the browser directly and, once this computer stops that, through ForgeQE's own Playwright; what worked is remembered. Attach connects to a browser you started with --remote-debugging-port (browser.attach_port, this computer only) and never closes it. A browser started through Playwright now looks to a site like one started directly.`,to:[`settings`,`browser`]},{kind:`new`,title:`forgeqe doctor browser`,detail:`Tries each way of starting the browser and writes .forgeqe/reports/browser-check-<time>.md with each start's log, the browser policies that block automation, security software, and (on Windows) AppLocker and code integrity events about browsers. Send it when a browser will not start on a managed PC.`},{kind:`fixed`,title:`No browsers left running after a failed start`,detail:`Browsers a failed start leaves behind (relaunched by a launcher, or by a stopped Playwright) are closed right away and checked again over the next minute. A browser on any other profile, yours included, is never touched. A slow first start also gets one more try.`},{kind:`fixed`,title:`Windows update no longer loops`,detail:`On 2.8.x, forgeqe update on Windows could open and close command windows forever without updating. The update now runs once, waits up to 5 minutes for ForgeQE to exit, and clears the stuck scripts an earlier update left behind.`},{kind:`fixed`,title:`Recordings no longer stall when a step leaves the page`,detail:`A click that submitted a form or followed a link could crash Chrome's page renderer about one time in ten, leaving the recording waiting until it timed out. It no longer does.`},{kind:`new`,title:`Recent chats and pages in the sidebar`,detail:`The sidebar lists your recent chats below the main options at every level, and inside a chat shows its last chats under Chat history. Every landing page and category shows its pinned pages and the ones you opened lately. Agents › Chat lists as many chats as fit, a page at a time, with search.`,to:[`browse`]},{kind:`new`,title:`Search Administration`,detail:`A search box on Administration finds its pages and any setting by name or forgeqe.yaml key, and opens its section.`},{kind:`improved`,title:`One token figure across the app`,detail:`The workspace panel, Tokenomics and Cost now share one 30-day window and one total, so chats are counted on Tokenomics too (they showed 0 before). Test-run figures sit below under Test runs, and Cost shows the amount charged at the time beside today's price.`,to:[`settings`,`tokenomics`]},{kind:`improved`,title:`Settings as text`,detail:`Settings › Files is now Settings as text: forgeqe.yaml, llms.json and env.yaml as they are on disk, laid out with the page, with Save always at the foot of the window.`,to:[`settings`]},{kind:`improved`,title:`Shorter buttons, one icon per action`,detail:`Buttons across the web app and the HTML report have short labels and one icon for each kind of action, icon-only where space is short. Checkboxes are animated, and scrollbars are thin and appear only while an area scrolls.`},{kind:`fixed`,title:`Terminal replies no longer flicker blank`,detail:`On a busy machine a reply in the terminal could show empty for a moment while it was highlighted. The words now appear at once and the highlighting follows.`}]},{version:`2.8.9`,date:`2026-11-09`,summary:`Pick the local browser in Settings, wait out a browser launcher handover, and hold every custom-agent sub-agent to the agent's limits.`,changes:[{kind:`new`,title:`Pick the local browser in Settings`,detail:`browser.local_browser in forgeqe.yaml (and Settings › Browser) chooses Automatic (Chrome, then Edge, then Playwright's Chromium), or Chrome, Edge or Chromium alone. It applies to runs, recordings and forgeqe login. A path in BROWSER_USE_EXECUTABLE_PATH still wins.`,to:[`settings`,`browser`]},{kind:`fixed`,title:`Wait when a launcher starts the real browser`,detail:`On some managed Windows PCs the process ForgeQE starts exits after opening another browser on the same DevTools port. ForgeQE now waits for that browser (up to 90s) instead of failing when the launcher exits, and logs each step of the start.`},{kind:`improved`,title:`Every sub-agent a tool starts respects the agent's limits`,detail:`Custom agents' "agents it may start" now covers tools that start a sub-agent without listing it before (Miner, test planning, product knowledge, defect analysis). The editor offers those agents and warns when a capability needs one the draft does not allow.`,to:[`agents`]},{kind:`fixed`,title:`Safer custom agent pack import`,detail:`Importing a zip refuses oversized or hostile entries, linked paths out of the project, and overwriting another agent's notes. Knowledge and skills are written only inside the project.`,to:[`agents`]}]},{version:`2.8.8`,date:`2026-11-09`,summary:`Fall back when Chrome will not start, category landing pages with what needs a look, and a unique icon for every agent.`,changes:[{kind:`fixed`,title:`Try Edge or Chromium when Chrome will not start`,detail:`Runs, recordings and forgeqe login fall back to Microsoft Edge, then Playwright's Chromium, when installed Chrome closes before it can be driven or does not answer. The report names the browser used. Pin one with BROWSER_USE_EXECUTABLE_PATH, or set BROWSER_USE_FALLBACK=0 to keep that browser only.`},{kind:`improved`,title:`Landing pages show what needs a look`,detail:`Each category's landing page lists what needs attention there and the built-in agents that work in it. Everything shows every category's. Home's suggestions come from more of ForgeQE, and Sign-ins, Environments and Set up no longer say the agents only test.`,to:[`browse`]},{kind:`improved`,title:`Own icons for Agents, Quality Engineering and AI Assurance`,detail:`The three sidebar categories each have a ForgeQE-drawn icon, matching the rest of the nav.`,to:[`browse`]},{kind:`improved`,title:`A unique icon for every agent`,detail:`No two agents on Agents or Settings › Routing share an icon. Chat-only agents (builder, bug report, Evidence and others) have their own faces instead of the Helper. Tooltips keep your agent.app_name when the page is renamed.`,to:[`agents`]}]},{version:`2.8.7`,date:`2026-11-09`,summary:`Delete a custom agent from Details, and a shorter Versions history.`,changes:[{kind:`new`,title:`Delete a custom agent`,detail:`Details opens Delete under Versions. Type the agent id to confirm. It removes the manifest, approved versions, runs, waiting approvals and its schedule job. Knowledge files and skills it named stay. forgeqe agent delete does the same at the terminal.`,to:[`agents`]},{kind:`improved`,title:`Shorter Versions history`,detail:`The current version shows a Running pill. Who approved it uses your git name when set, and long GitHub noreply emails shorten to the username with · web when done in the app.`,to:[`agents`]}]},{version:`2.8.6`,date:`2026-11-08`,summary:`A custom agent's page uses the same ask box and layout as ForgeQE's own agents.`,changes:[{kind:`improved`,title:`Custom agent page like Link`,detail:`One large icon, name and description, then the shared chat composer (environment, tools, Refine, model). Starter pills and what it needs sit below. Export, Details and Edit stay as icon buttons; Details opens a right-side panel for reach, versions and runs.`,to:[`agents`]}]},{version:`2.8.5`,date:`2026-11-08`,summary:`Custom agent page matches Jobs, searchable Phosphor and Lucide icons, and chat no longer shows the model price mismatch note.`,changes:[{kind:`improved`,title:`Custom agent page like Jobs`,detail:`An agent's page centres on try and ask, with icon-only Export, Details and Edit. Details opens a right-side panel for reach, versions, runs and approve or disable.`,to:[`agents`]},{kind:`improved`,title:`Search Phosphor and Lucide for agent icons`,detail:`The icon picker searches ForgeQE's faces plus Phosphor and Lucide by name, shows the top ten matches, and offers Show more. Manifests keep only safe ph: and lucide: ids.`,to:[`agents`]},{kind:`fixed`,title:`No price mismatch note when chat starts`,detail:`Opening forgeqe chat no longer prints the Note about llms.json prices not matching the provider. Other commands still show it when the catalog is off.`}]},{version:`2.8.4`,date:`2026-11-08`,summary:`Custom agents: share a zip across projects, and pick an icon from ForgeQE's set.`,changes:[{kind:`new`,title:`Export and import a custom agent`,detail:`Export to share packs agent.json with its knowledge files and skills into a zip. Import agent (or forgeqe agent import) always creates a draft to edit, try and approve. Environments and systems stay in the target project. Same-repo teams still commit .forgeqe/agents.`,to:[`agents`]},{kind:`new`,title:`Icon for each custom agent`,detail:`The builder and editor let you pick one of ForgeQE's agent icons. The Agents list and the agent's page show it; a manifest without an icon uses the Helper face.`,to:[`agents`]}]},{version:`2.8.3`,date:`2026-11-08`,summary:`Tosca report: searchable test list, structured LLM usage, and the failed stage only — no progress bar on a finished conversion.`,changes:[{kind:`improved`,title:`Report scales to many test cases`,detail:`The conversion report lists test cases in a searchable, filterable table (all, needs attention, converted) with paging. Pick a row for Tosca steps, output, and failure screenshots or video instead of scrolling one card per case.`,to:[`tosca`]},{kind:`improved`,title:`LLM usage as labeled figures`,detail:`The report sidebar shows model, tokens (read, cached, written), and cost as rows — not the long CLI usage line with pricing footnotes.`,to:[`tosca`]},{kind:`improved`,title:`Failed stage instead of a progress bar`,detail:`A finished report no longer repeats the Prepare–Review stage row. If a stage failed, one line names that stage and its note.`,to:[`tosca`]}]},{version:`2.8.2`,date:`2026-11-08`,summary:`Tosca: a full-page conversion report with total time, LLM usage and cost, per-test fidelity, and failure screenshots or video.`,changes:[{kind:`new`,title:`Full-page Tosca conversion report`,detail:`Report opens a dedicated page for the conversion instead of a Markdown sheet. It shows total time, model and token cost, every test case with fidelity and output, environment variables to set, and steps a person still has to finish.`,to:[`tosca`]},{kind:`new`,title:`Failure screenshots and video on the report`,detail:`When a converted Playwright test fails, ForgeQE keeps its screenshot and short video under the plan and shows them on the report. New conversions ask Playwright for only-on-failure screenshots and retain-on-failure video.`,to:[`tosca`]},{kind:`improved`,title:`tosca.md includes time and LLM cost`,detail:`The Markdown report written for the CLI and downloads now lists total time, the model, and a readable token and cost line alongside the test table.`}]},{version:`2.8.1`,date:`2026-11-07`,summary:`Tosca: confirming Start opens the running overview at once, and conversion progress stays within 100%.`,changes:[{kind:`fixed`,title:`Confirming Start opens the overview`,detail:`After you type the plan id and start a Tosca conversion, the page leaves the confirm sheet and shows the running overview instead of staying on the plan. A running result is written as soon as the job starts so the list and progress update immediately.`,to:[`tosca`]},{kind:`fixed`,title:`Conversion progress never exceeds 100%`,detail:`The Tosca list and overview counted finished files against the number of test cases only, so exports with many page objects could show 133% or more. Progress now uses every planned unit and stays at most 99% while running.`,to:[`tosca`]},{kind:`improved`,title:`Tooltips use a grey surface`,detail:`Tooltips and the Reports day tip use the muted surface colour so they read clearly on both light and dark themes.`}]},{version:`2.8.0`,date:`2026-11-07`,summary:`Tosca and Migration: Stop ends a stuck run, delete old plans from the page, Cloud exports keep their locators, and __pycache__ no longer looks like an outside edit.`,changes:[{kind:`fixed`,title:`Stop ends a Tosca or Migration run`,detail:`Stop sends SIGTERM the conversion handles, and settles a result left as Running after the process is already gone, so the page does not keep offering Stop with nothing to stop.`,to:[`tosca`]},{kind:`new`,title:`Delete an old Migration or Tosca plan`,detail:`On a plan's page, Delete removes it from the list after you type its id. Converted tests in the target folder stay; a running job must be stopped first.`,to:[`migration`]},{kind:`fixed`,title:`Tosca Cloud exports keep their locators`,detail:`Cloud .tsu files that omit the reverse XParam link no longer convert with empty page objects. ForgeQE fills ExtendableObject the same way it already fills missing TestStep links.`,to:[`tosca`]},{kind:`fixed`,title:`Bytecode caches are not outside edits`,detail:`Python __pycache__ and similar junk are ignored when ForgeQE checks that the agent wrote only inside the target folder, so conversions are not blocked by false Put them back messages. The Tosca export itself is protected the same way.`,to:[`tosca`]}]},{version:`2.7.9`,date:`2026-11-07`,summary:`Tosca conversion reads Tosca Cloud exports and opens browser tests that use OpenUrl and CloseBrowser, so web cases can start instead of showing Mixed or Not supported.`,changes:[{kind:`fixed`,title:`Tosca Cloud exports read their steps`,detail:`Some Tosca Cloud .tsu files list step values only on the step, without the reverse link Commander exports. ForgeQE fills that link before reading, so those exports show real actions, checks and page objects instead of empty Web cases.`,to:[`tosca`]},{kind:`fixed`,title:`OpenUrl and CloseBrowser stay on the web route`,detail:`Tosca's Framework OpenUrl and CloseBrowser modules no longer mark an otherwise Html test as Mixed or Not supported. They become navigate and close steps; TBox Wait becomes a wait. Json and Xml engines show as API (later), not Not supported.`,to:[`tosca`]},{kind:`improved`,title:`Web cases with a few non-web notes can start`,detail:`A test that is mostly web, with only unsupported extras such as mail or screenshots left as marked comments, can be picked and started. Pure API, desktop and other non-web routes still wait for a later version.`,to:[`tosca`]}]},{version:`2.7.8`,date:`2026-11-07`,summary:`Change impact gains Product and Internal views, readiness and pull-request links, and forgeqe web answers on a .localhost name without picking a port.`,changes:[{kind:`improved`,title:`Change impact: Product and Internal`,detail:`Browse a change in two views: Product for how it spreads through the business, and Internal for the whole repository as Graph and Code. Each change sits beside how it spreads, with counts and areas by severity and priority.`,to:[`impact`]},{kind:`improved`,title:`Change impact: readiness and pull requests`,detail:`See readiness, history, effort and confidence on the page, with pull requests, missing tests and links. ForgeQE reads what a change does before it traces impact, and forgeqe impact runs the same analysis from the terminal.`,to:[`impact`]},{kind:`improved`,title:`Change impact layout`,detail:`Compact cards in one row, areas, changes and the files map as tabs, a labelled view toggle, and keyboard focus on an opened area. Regression areas read as plain sentences.`,to:[`impact`]},{kind:`new`,title:`forgeqe web behind a local proxy`,detail:`Serve the app at a .localhost name (for example through portless) without choosing a port yourself. Host and Origin checks still bind to this computer only.`},{kind:`fixed`,title:`Change impact review fixes`,detail:`Security and UI consistency fixes from review on the Change impact pages.`}]},{version:`2.7.7`,date:`2026-11-07`,summary:`Ten new quality pages (flaky tests, release readiness, cost and more), data-driven tests and MFA sign-ins, wider API and cloud testing, desktop replay on macOS and Linux, and a far more reliable mobile agent.`,changes:[{kind:`new`,title:`Flaky tests and run diff`,detail:`Runs › Flaky tests scores each test by how often it flips, passes only on retry or varies in run time, names the likely cause, and quarantines or heals it. Runs › Run diff lines up two runs step by step and shows the first difference that matters.`,to:[`flaky`]},{kind:`new`,title:`Release readiness`,detail:`One verdict for a release from the regression pack, untested changes, the tracker, flaky tests, quality, security and Evidence, with a sign-off record. The agent can work out the verdict; signing off stays with a person.`,to:[`readiness`]},{kind:`new`,title:`Test debt`,detail:`Untested code and business rules, tests that never fail or test nothing that exists any more, near-duplicate tests, and cases not yet automated, in one place.`,to:[`test-debt`]},{kind:`new`,title:`Feature-flag matrix`,detail:`Read your flags from env.yaml, LaunchDarkly or Unleash (read only) and run the regression pack for each combination, all of them or pairwise.`,to:[`flags`]},{kind:`new`,title:`Production signals`,detail:`Errors from Sentry, Datadog and Application Insights, with which of them no test covers. Record a repro of one straight from the list.`,to:[`production`]},{kind:`new`,title:`Security smoke checks and localization`,detail:`Quality › Security checks headers, CSP, cookie flags, mixed content, open redirects, CORS and keys in answers, passively. Quality › Localization finds keys shown as text, English left in other languages and cut-off text, with pseudo-localized and right-to-left stress runs.`,to:[`quality`,`security`]},{kind:`new`,title:`Exploratory sessions and cost`,detail:`Test › Exploratory runs a session with a goal, a cap on charters and a time limit. Results › Cost shows spend by agent, job, model and day, the router's picks, and what each pack run cost.`,to:[`explore`]},{kind:`new`,title:`Data-driven tests`,detail:`A test case runs once per row of a CSV, Excel or JSON file, a read-only query or a kept Miner request, with values as {{row.column}}. Each row is its own run; the case fails if any row fails. Written tests read every row from one parameterised test, and Try it on the Record page plays up to 20 rows.`,to:[`test-cases`]},{kind:`new`,title:`MFA sign-ins`,detail:`Saved logins handle authenticator codes, codes sent by email, text or a test address, security keys and passkeys, and push approvals (the run waits for a person). A login column gives each row its own user. Codes are never shown to the model.`},{kind:`new`,title:`API testing: streams, OAuth2, mTLS, load and security`,detail:`gRPC streaming, GraphQL subscriptions, WebSocket and SSE contracts. OAuth2 client credentials and client certificates. forgeqe api load reports latency and error rate for read-only calls (never production); forgeqe api security checks an API you own against the OWASP API Top 10. The mock adds rules, stateful CRUD and faults, and Pact contracts import.`,to:[`api-tests`]},{kind:`new`,title:`Cloud testing for Azure, AWS and Google Cloud`,detail:`Agents know each cloud's SDK and its emulators. An env.yaml environment names its subscription, account or project (cloud:), editable in Settings › Environments. AWS and Google Cloud MCP servers read resources, and the cloud-verifier agent template checks a run's effects in the cloud without changing anything.`,to:[`settings`,`environments`]},{kind:`new`,title:`Desktop replay on macOS and Linux`,detail:`Desktop workflows replay through agent-desktop on macOS, Linux and headless Windows, with the same healing, memory and reports. desktop.driver: auto picks it outside Windows. Apps can be a macOS .app or a Linux program; explore and recording stay on Windows.`,to:[`settings`,`desktop`]},{kind:`new`,title:`Mobile: drag and drop, and real iPhones`,detail:`The mobile agent drags one control onto another (a puzzle piece onto its slot), saved as a drag step and replayed on Appium. iOS runs on TestMu's real iPhones and simulators: a permission prompt is closed when it shows and never fails a device where it doesn't.`,to:[`settings`,`mobile`]},{kind:`improved`,title:`A far more reliable mobile agent`,detail:`Swipes and scrolls move React Native carousels and pages that ignored them. An explore stops after a few actions that change nothing instead of spending its budget, records checks before a dialog closes, and keeps only checks a replay can see. iOS sees only controls on screen and keeps app alerts open for checks.`,to:[`settings`,`mobile`]},{kind:`improved`,title:`Mobile runs on several devices`,detail:`Each step line names its device, each failed device says which step failed, and a device TestMu reports unavailable is skipped for the rest of a suite instead of costing ten minutes per workflow. mobile doctor checks TestMu's hub and sign-in when every device is in the cloud.`,to:[`settings`,`mobile`]},{kind:`improved`,title:`Settings changes without a restart`,detail:`forgeqe web keeps working while you edit forgeqe.yaml, llms.json, env.yaml or .env: a half-saved file keeps the last good settings, the page offers to show the changes, open chats can switch to them, and .env values reload. After forgeqe update, Settings › About restarts the server on the same port.`,to:[`settings`,`about`]},{kind:`improved`,title:`Large logos are shrunk`,detail:`Settings › Appearance makes a PNG, JPEG or WebP logo up to 20 MB smaller in the browser instead of refusing anything over 512 KB.`,to:[`settings`,`appearance`]},{kind:`improved`,title:`Data page tabs and database chips`,detail:`The Data page's tabs wrap on a phone and take the arrow keys. A read-only database shows green with a tick, a writable one in amber with a pencil.`,to:[`data`]},{kind:`fixed`,title:`Two runs started at once no longer share a folder`,detail:`Mobile and desktop runs started in the same second each get their own report folder; one no longer overwrote the other's workflow.`},{kind:`fixed`,title:`A missing secret stops a mobile replay at once`,detail:`A replay that types a secret which is not set, or not listed, stops in seconds with what to set, before a cloud device is taken.`},{kind:`fixed`,title:`Agent tabs keep the message box at the bottom`,detail:`Before the first message, the Agent tabs of Jobs, Regression, API tests, Accessibility, Performance and Visual showed the message box in the middle of the window. API tests now lines up with the other pages.`}]},{version:`2.7.6`,date:`2026-11-06`,summary:`Runs check the users, logins and values they need before the browser opens. Test cases use env.yaml values, recordings can be deleted, and the app fits laptop screens.`,changes:[{kind:`new`,title:`A check before every run`,detail:`Before a run or a set of test cases starts, ForgeQE checks that the test users, saved logins, apps and values they name exist in env.yaml and forgeqe.yaml. Anything missing is listed with how to fix it, by name only, never a value, and you choose to stop and add it or run anyway.`,to:[`runs`]},{kind:`new`,title:`env.yaml values in test cases`,detail:`Write {{var.NAME}} or {{app.NAME}} in a test case's title, steps or expected results, and the run fills in the environment's variable or the app's address. A case that names an app starts there. Secrets are never put into a case.`,to:[`test-cases`]},{kind:`new`,title:`Delete recordings`,detail:`Record › Recordings has a checkbox on each row and Delete selected. One confirmation lists what goes; tests already written from a recording stay.`,to:[`record`]},{kind:`improved`,title:`Edits to forgeqe.yaml and env.yaml apply mid-chat`,detail:`A chat, in the web app or the terminal, reads forgeqe.yaml and env.yaml again when either changes and carries the conversation on. An edit that no longer loads keeps the old settings and says why.`,to:[`chats`]},{kind:`improved`,title:`env.yaml says what it did not read`,detail:`Apps are found even in a file copied from the example with leftovers, an app's kind is worked out from what it has, and names match in any case. Anything ForgeQE could not read is listed by forgeqe apps and the agent instead of being dropped silently. Values written beside apps: are read as variables; a password there is reported and never used.`},{kind:`improved`,title:`Fits 13 and 14 inch laptops`,detail:`On laptop-sized windows the app draws slightly smaller, so Home, the sidebar and the agent tabs fit without scrolling. The sidebar's foot is one row: Settings, Help and Dark/Light. What's ready and What's new are now in Settings › Advanced.`,to:[`settings`]},{kind:`improved`,title:`ForgeQE's own engine and runtime`,detail:`Setup, forgeqe doctor and Settings name ForgeQE's browser engine and agent runtime, and the runtime keeps its data in ForgeQE's own folder. An earlier download is moved, not downloaded again. Agent sessions from before this update start fresh when resumed.`},{kind:`fixed`,title:`Open the web app in new tabs`,detail:`Links, bookmarks and typed addresses open in a new tab without signing in again: open tabs share the sign-in. A tab with nothing to sign in from now says so, instead of saying ForgeQE was restarted.`},{kind:`fixed`,title:`Re-running a chat's test keeps the right test`,detail:`Turning a run into code reuses an existing test only when most of the run's steps are found in it, so an unrelated test is no longer picked from one matching locator. A captcha's answer is worked out in the test, never copied from the run.`,to:[`chats`]},{kind:`fixed`,title:`A sign-in never types a secret's name`,detail:`When a login's values are missing, or the sign-in page is on a site the login does not list, the browser stops and says why instead of typing the placeholder into the page.`},{kind:`fixed`,title:`Mobile runs on TestMu and longer mobile flows`,detail:`Native app sessions on TestMu (LambdaTest) and other device clouds no longer fail because a browser name was sent with the app. A mobile explore run that is still making progress carries on past its step limit, as browser runs do, so a full sign-in flow finishes.`}]},{version:`2.7.5`,date:`2026-11-06`,summary:`Report a problem with ForgeQE from Settings, drafted from the session that went wrong. Browsers close after every run, and Windows works like macOS and Linux.`,changes:[{kind:`new`,title:`Report a problem`,detail:`Settings › Report a problem picks the recent session that went wrong and shows what ForgeQE found in its log: what was asked, ForgeQE's own errors and its failing checks. Draft the bug fills in the title, steps, expected and actual result, and asks only what the log can't show. You check the attachments (the log with secrets removed, ForgeQE's checks, screenshots) before anything is sent, and you don't need an Azure DevOps account. Copy as text works anywhere.`,to:[`settings`]},{kind:`fixed`,title:`No terminal windows during an update on Windows`,detail:`forgeqe update on Windows no longer opens extra terminal windows that had to be closed before the update could finish. It runs in one minimised window.`},{kind:`fixed`,title:`Browsers close after every run`,detail:`A finished, stopped or failed run closes the browser it opened, and the recorder's and sign-in browsers do too. On Windows, stopping a run, test or job now ends everything it started, not only its first process. A browser ForgeQE only connected to is never closed.`},{kind:`fixed`,title:`Windows works like macOS and Linux`,detail:`Links open safely on Windows, including links with & in them. Tools such as npx, az and gh start reliably, copying keeps non-English text, and the guides show PowerShell lines beside the macOS and Linux ones. The Requirement Agent installs and starts on Windows without reinstalling its packages every time.`},{kind:`fixed`,title:`Setup repairs a broken engine`,detail:`If an interrupted setup left the browser engine's environment broken, forgeqe setup rebuilds it instead of failing with "externally managed". The engine also uses a Python version it is tested on (3.13 on Windows) rather than the newest one installed.`}]},{version:`2.7.4`,date:`2026-11-06`,summary:`Change impact: see the features, journeys and tests a branch or commit range affects, on a map of the whole code in red, amber and green. Also a shorter sidebar with Ctrl+K search.`,changes:[{kind:`new`,title:`Change impact`,detail:`Test › Change impact compares two branches, tags or commits of a product repository and says what the change affects: each feature with its risk and the reasons for it, the journeys and business rules it touches, the tests to run and why, and what no test covers. Read from the product graph; nothing is run.`,to:[`impact`]},{kind:`new`,title:`Impact map`,detail:`The change drawn over the whole repository, file by file in its folders: red what it changed, amber what it affects (files that use it, and the services a front end's change calls), green the tests that reach it. Switch to Whole product to see every repository, or colour the files by how often they change in git. Click a file for the chain back to the change and the features it serves.`,to:[`impact`]},{kind:`improved`,title:`A shorter sidebar and Ctrl+K search`,detail:`Pages that showed the same work share one entry, so the sidebar goes from 28 entries to 19; pages of one entry link to each other beside their titles. Press Ctrl+K (or Search in the sidebar) to go to any page, agent, Settings section or setting by its name or its forgeqe.yaml key.`,to:[`settings`]},{kind:`improved`,title:`Know what stops a chat before you send it`,detail:`Home and the agents' pages say when a chat cannot start (the browser engine or agent runtime not installed, or the model without its key) and link to the Settings section that fixes it.`,to:[`chats`,`agents`]},{kind:`improved`,title:`Clearer pages`,detail:`Home links to runs that failed today, approvals waiting, failed jobs and runs going now. Empty pages offer the one action that fills them. Settings keeps the common sections in view and folds the rest under More settings. The agent groups are Advisers, Builders and Operators, and API tests gather the agent's actions under one Ask the agent menu.`,to:[`agents`,`runs`,`settings`]},{kind:`improved`,title:`Forget one flow or page`,detail:`Memory can forget a single flow or a single page, not only a whole site, and flows with no site can be cleared on their own. Each asks first and is written to the audit log.`,to:[`memory`]}]},{version:`2.7.3`,date:`2026-11-06`,summary:`A Code map of your product's files with seven views and a blast radius, product knowledge read by Graphify, Build and Refresh on the Product page, each agent run's prompt and output in Evidence, and icons in a colour of your choice.`,changes:[{kind:`new`,title:`Code map`,detail:`Product › Engineering › Code map shows every file of your repositories in seven views: Graph, Treemap, Matrix, Tree, Flow, Bundle and Cluster. The graph moves live: drag files, pan, and zoom with the wheel. Pick one repository to see its files grouped by folder. Click a file to see what uses it, what it uses, and every file a change to it would reach.`,to:[`product`,`code`]},{kind:`new`,title:`Product knowledge read by Graphify`,detail:`Building product knowledge now reads the code with Graphify, in about 40 languages: classes, functions, and who calls and imports whom. It also reads a repository's database schema, PDF, Word and Excel documents, and the comments that say why code exists. A service's page shows its modules and the parts most depended on.`,to:[`product`]},{kind:`new`,title:`Build and Refresh on the Product page`,detail:`Start or refresh the product's knowledge from the Product page and follow it on a progress bar, step by step and repository by repository. A running build also shows under Background tasks, with a Stop button.`,to:[`product`]},{kind:`new`,title:`Prompt and output of each agent run`,detail:`An agent run's page in Evidence shows what the agent was told (its system prompt), what it was asked, its final answer and what it said on the way, with each model call's model and tokens. Runs recorded from Langfuse and OpenTelemetry now keep the system prompt, with secrets cut out, and the token counts.`,to:[`evidence-runs`]},{kind:`new`,title:`Evidence demo in your project`,detail:`forgeqe evidence demo --project fills an empty Evidence section with a demo shop's made-up AI agents, so every Evidence page has something to show next to your product. It writes only while the project has no runs or contracts of its own.`,to:[`evidence`]},{kind:`new`,title:`Find missing packages`,detail:`Settings › Set up lists every package ForgeQE installs, with the version needed, the one installed and the command that fixes it. The same report is forgeqe doctor --packages.`,to:[`settings`,`setup`]},{kind:`new`,title:`Icon colour and Lucide icons`,detail:`Settings › Appearance › Icon colour draws the icons in black (white in dark mode), the buttons' colour, or a colour of your own; two-tone icons keep their shape with a pale second tone. Lucide joins the icon sets. Attaching in the chat box is now a plus.`,to:[`settings`,`appearance`]},{kind:`improved`,title:`How it is built, Journeys and Records`,detail:`The capability and record diagrams can be dragged and zoomed, and a large map opens on one capability at a time. A journey reads as a summary and numbered steps. A record shows its fields, with personal data marked, and what writes, reads and shares it.`,to:[`product`,`business`]},{kind:`improved`,title:`Clearer product maps`,detail:`The Landscape and Services maps put front ends, gateways, services, data and test suites in their own bands. A gateway shows its routes, and workers and test suites say what they are.`},{kind:`improved`,title:`Package updates`,detail:`The agent runtime, browser engine, Playwright, Copilot, the data engine's drivers and the desktop packages are updated to their latest versions.`},{kind:`fixed`,title:`Re-run on the Record page`,detail:`A recording made without Google Chrome, or in Docker, now re-runs: ForgeQE tries the run's own browser, then Chrome, Edge and an installed Chromium, instead of failing to start a browser.`,to:[`record`]},{kind:`fixed`,title:`More calls linked between repositories`,detail:`The product graph matches a call to the endpoint it reaches by the route's shape, reads request options written over several lines, and recognises database upserts and .NET message consumers.`}]},{version:`2.7.2`,date:`2026-11-05`,summary:`Convert Tricentis Tosca test cases with the new Bridge and page, past chats kept and carried on after forgeqe web restarts, and one flat icon style across the app.`,changes:[{kind:`new`,title:`Convert Tosca test cases`,detail:`Bridge reads a Tosca .tsu export and, once you confirm its plan, writes one page object per Tosca module and one test per web test case, each Tosca step marked in the test so nothing is lost. Tests go under their Tosca folders and are tagged with the execution lists that run them. forgeqe tosca verify runs the converted tests again without a model.`,to:[`tosca`]},{kind:`new`,title:`Tosca page`,detail:`Under Test, after Migration: start a conversion in four steps (export and test cases, framework and language, instructions, review), follow each test's Tosca steps beside the converted code, and run the tests again, all of them or one suite at a time, with each test's output.`,to:[`tosca`]},{kind:`new`,title:`Past chats are kept`,detail:`Chats are saved in the project and are still listed after forgeqe web restarts, so a link to an earlier chat opens it. Send a message to an ended chat and it carries on with its earlier turns.`,to:[`chats`]},{kind:`improved`,title:`One icon style`,detail:`Pages, agents, buttons and menus use Phosphor icons, drawn in the text's colour so they read on any sidebar. Appearance also offers Solar Bold Duotone, or ForgeQE's 3D icons as before.`,to:[`settings`,`appearance`]},{kind:`fixed`,title:`Azure DevOps sign-in in Evidence`,detail:`An Azure DevOps address on dev.azure.com or visualstudio.com is treated as the cloud, so the Azure CLI sign-in is offered. A sign-in question already answered no longer comes back, and an answer cannot be sent twice.`,to:[`settings`,`evidence`]},{kind:`fixed`,title:`API calls in the product graph`,detail:`A call whose method comes from options built by a helper or held in a variable is read with its real method, such as POST, instead of GET.`}]},{version:`2.7.1`,date:`2026-11-05`,summary:`Set up Evidence in five steps, with repositories picked from your GitHub, Azure DevOps, GitLab or Bitbucket account, and forgeqe update now finds an older copy still running.`,changes:[{kind:`new`,title:`Repositories from your account`,detail:`In Settings, Evidence, add a GitHub, Azure DevOps, GitLab or Bitbucket account (Cloud or Data Center), sign in in the browser or with a personal access token, and pick its repositories from a list. Local clones and links can still be added by hand.`,to:[`settings`,`evidence`]},{kind:`new`,title:`Search through an MCP server`,detail:`The search service can be a service at an address, a tool of one of your MCP servers, or a command, with a search to try on the page.`,to:[`settings`,`evidence`]},{kind:`new`,title:`Add documents from the page`,detail:`Add Markdown and text documents in Settings, Evidence, and the product knowledge build reads them beside your folders, links, Confluence spaces and web apps.`,to:[`settings`,`evidence`]},{kind:`improved`,title:`Evidence set up in five steps`,detail:`Settings, Evidence walks through repositories, search, documents, the product and its knowledge, and building the graph, in that order. The search and knowledge folder settings move here from Agents.`,to:[`settings`,`evidence`]},{kind:`fixed`,title:`forgeqe update finds an older running copy`,detail:`When the ForgeQE you are running is older than the installs it finds, forgeqe update names it and the command that fixes it, instead of saying everything is up to date. On Windows, a pip install whose Python comes from the Microsoft Store is found and updated too.`}]},{version:`2.7.0`,date:`2026-11-05`,summary:`TestMu AI's tools for the agent with a browser sign-in, real logos for more systems in Settings, and quicker moves between Settings sections.`,changes:[{kind:`new`,title:`TestMu AI's tools`,detail:`Turn on TestMu AI's MCP server to give ForgeQE's agent HyperExecute, failure triage, SmartUI, accessibility and Test Manager. Sign in once in the browser; no key is needed. forgeqe auth login testmu offers the browser sign-in or the grid's user name and access key.`,to:[`settings`]},{kind:`improved`,title:`Real logos in Settings`,detail:`GitLab, Postman, Sentry, Xray, TestMu AI, Dataverse and Zephyr Scale show their own logos instead of plain icons.`,to:[`settings`]},{kind:`improved`,title:`Quicker moves in Settings`,detail:`Moving between Settings sections changes at once, without the whole page fading out and back in.`,to:[`settings`]}]},{version:`2.6.9`,date:`2026-11-05`,summary:`A fix for setup on 64-bit Windows, a model picker that holds any number of models, a separate Evidence section in Settings, and a more consistent look on every page.`,changes:[{kind:`improved`,title:`Pick any number of models per area`,detail:`In Settings, Routing, each area of work picks its models from a searchable list instead of a row of chips. Each agent shows its icon and what it does, and the order that decides which model a call gets is a numbered list.`,to:[`settings`]},{kind:`improved`,title:`Evidence has its own Settings page`,detail:`The product, its knowledge graph, repositories, documents and links, and the team's knowledge move from Agents to a new Evidence page in Settings. Agents keeps instructions, custom agents, capabilities and agent names.`,to:[`settings`]},{kind:`improved`,title:`Colours from a website`,detail:`Appearance reads more of a website's colours, up to 16 of them. A site that shows a bot check instead of its page is reported as turned away, rather than offering the check page's colours as the site's.`,to:[`settings`,`appearance`]},{kind:`improved`,title:`The same look on every page`,detail:`Every page uses one style for empty states, tabs and headings. Grey labels are easier to read, and long agent names wrap onto a second line instead of being cut off.`},{kind:`fixed`,title:`Setup on 64-bit Windows`,detail:`forgeqe setup no longer fails on 64-bit Windows when a 32-bit Python is installed: it uses a 64-bit Python instead.`}]},{version:`2.6.8`,date:`2026-11-05`,summary:`A tidier Settings, one standard for buttons and fields across the app, a page background colour, and an easier Runs page.`,changes:[{kind:`new`,title:`A page background colour`,detail:`Set a light background colour for the app in Appearance, or read one from your website or design file. Text and lines adjust so they stay readable.`,to:[`settings`,`appearance`]},{kind:`improved`,title:`A tidier Settings`,detail:`Every setting's control sits in the same column, so fields line up on every section. MCP servers are under AI, and Browser and Replays under Testing. Routing shows which model a call gets, and lists each area of work with its agents under it.`,to:[`settings`]},{kind:`improved`,title:`One standard for buttons and fields`,detail:`Buttons, text fields, dropdowns, search boxes, checkboxes and radios look and size the same across the app. Each view has at most one main button, and secondary buttons have an outline so they no longer look switched off.`},{kind:`improved`,title:`An easier Runs page`,detail:`Runs share the app's search, filters and pages. A run's next steps are clear buttons, and the open tab is kept in the address, so a link or a reload opens it again.`,to:[`runs`]},{kind:`improved`,title:`Easier to read`,detail:`Explanations use darker text, Home's animation settles after a few seconds, the side panel's Environment section has more room, and on a phone the workspace button no longer covers the page heading.`},{kind:`improved`,title:`Reading your website's look`,detail:`When a website turns ForgeQE's reader away, Appearance says so once and what to do instead.`}]},{version:`2.6.7`,date:`2026-11-04`,summary:`A lighter look without boxes, run pages that read cleanly, token counts for every agent in a chat, and a clearer view of how a test was written and reviewed.`,changes:[{kind:`improved`,title:`A lighter look across the app`,detail:`Pages, chat replies and run pages drop their boxes: each section is its heading and content, set apart by space and a thin line. A question still waiting for you keeps its highlight, so it stands out.`},{kind:`improved`,title:`Run pages that read cleanly`,detail:`A run's summary shows its final message once, each test as one result with its full command to copy, and the files the run wrote. The activity is a timeline with each event's time, and Details counts the tokens of every agent that worked on the run.`,to:[`runs`]},{kind:`improved`,title:`Tokens for every agent in a chat`,detail:`Context and tokens counts every agent that works in a chat, such as Quill and Checker, as each model call comes back. Today and Last 30 days count all of the project's chats, runs and agents.`},{kind:`improved`,title:`How a test was written and reviewed`,detail:`A chat shows ForgeQE handing a test to Quill, with its work, test runs and reviews below. The reviewer, now called Checker, shows its verdict and each issue next to the attempt it judged. Step icons show how a step went by their colour.`},{kind:`improved`,title:`Custom agent runs linked to their session`,detail:`A custom agent's recent runs link to the session they ran in on the Runs page.`,to:[`runs`]},{kind:`fixed`,title:`Times in the activity log`,detail:`Each line shows the time it happened, instead of the same +0:00 for every line.`},{kind:`fixed`,title:`Tooltips in chat`,detail:`Copy buttons, a test's full name and the model picker's reason use the app's own tooltip.`}]},{version:`2.6.6`,date:`2026-11-04`,summary:`Change a chat's model without starting over, and reports with your project's logo and a cleaner look.`,changes:[{kind:`new`,title:`Change the model mid-chat`,detail:`Pick another model from the chat's composer between messages, and the chat carries on with its conversation, tools and files. In the terminal, /profile does the same.`,to:[`settings`,`models`]},{kind:`improved`,title:`Your logo in reports`,detail:`Reports show the logo and name set in Settings, Appearance, in their sidebar and as the tab's icon, in place of ForgeQE's.`,to:[`settings`,`appearance`]},{kind:`improved`,title:`A cleaner report`,detail:`Reports drop the cards inside cards: each block is its heading and content on a white page, as in the web app's chat and Settings. Tooltips are styled, show on keyboard focus, and never grow taller than the window.`}]},{version:`2.6.4`,date:`2026-11-04`,summary:`Test cases reused instead of duplicated in every test case system, a product knowledge graph, an Evidence section for checking agents, and new integrations.`,changes:[{kind:`new`,title:`Reuse existing test cases`,detail:`Before saving, ForgeQE compares new cases with the story's linked cases and its scope, and asks before it links to or extends an existing one instead of adding a copy. Optionally it also compares with the other stories under the same feature or epic. Cases older than their story's last change are flagged.`},{kind:`new`,title:`Test cases in Xray, TestRail and Zephyr Scale`,detail:`Save, update and link test cases there as in Azure DevOps, and record which cases are automated. New Azure DevOps cases join the scope's suite with priority, tags, state, shared steps and parameters. Cases can also be saved with no story, under an area path or a project.`},{kind:`new`,title:`Product knowledge`,detail:`ForgeQE reads your repositories, documents and deployment files into one graph of the product's systems and how they talk, with the evidence for each link. The agents use it, the Product page shows it in the business's words, and the Engineering view draws the landscape. It can be built once in a pipeline and shared with the team.`,to:[`product`]},{kind:`new`,title:`Evidence`,detail:`A section for checking AI agents, ForgeQE's own or any other: their runs from OpenTelemetry, Langfuse or LangSmith, contracts and behaviour checks, a scenario suite and a release gate, and monitoring for drift. forgeqe evidence demo fills every page with a demo project.`,to:[`evidence`]},{kind:`new`,title:`More integrations`,detail:`GitLab, BrowserStack, Postman, Azure, Dataverse and Sentry, added from the catalog in the MCP view. MCP servers that need a browser sign-in get one, and every system's sign-in is in Settings.`,to:[`settings`]},{kind:`improved`,title:`Mobile and desktop settings`,detail:`Separate settings for each, devices described by what they are, cloud devices for BrowserStack and TestMu edited in Settings, and mobile tests run on several devices at once.`,to:[`settings`]},{kind:`improved`,title:`A model and a name for each agent`,detail:`Choose a default model for each agent, and call each agent what your team calls it.`,to:[`settings`]},{kind:`improved`,title:`Release readiness for Jira`,detail:`Release readiness works on Jira scopes, as it does on Azure DevOps.`},{kind:`improved`,title:`Carry on, or stop`,detail:`Healing, the Regression page, forgeqe suite and a browser run that makes no progress ask before they stop at a limit.`},{kind:`fixed`,title:`Links and proxies`,detail:`Links in chat are fetched only after ForgeQE's own checks, and web fetches work behind a company proxy.`},{kind:`fixed`,title:`Migration`,detail:`The source framework is found from the project's packages and code, not a word in a comment, and a remote grid is named only when the code starts one.`}]},{version:`2.6.3`,date:`2026-11-03`,summary:`A migration agent for old test suites, a Miner that finds test data for every agent, and the same chat box on every agent's page.`,changes:[{kind:`new`,title:`Mover`,detail:`Move a test suite to another framework with forgeqe migrate or the Migration page. Bring the tests from git, a folder, an upload or a paste; ForgeQE migrates them, runs them, fixes what fails, and shows the old and new side by side in Compare.`,to:[`migration`]},{kind:`new`,title:`Miner`,detail:`Every agent asks Miner for test data before it runs. Its page under Agents shows your databases, their schema as a diagram, and an Ask box.`,to:[`agents`]},{kind:`new`,title:`Test data page`,detail:`Every request for test data is logged, with what was asked and what came back.`,to:[`test-data`]},{kind:`improved`,title:`Data page`,detail:`Redesigned around Miner, with paged lists and one clear main action.`,to:[`data`]},{kind:`improved`,title:`The same chat box everywhere`,detail:`Every Agent tab has attachments, @ files, Refine, the environment, tools and the model. Nothing is sent until ForgeQE is set up, and Home's Set up card says what is missing.`},{kind:`improved`,title:`A page for every agent`,detail:`Each agent's page has its own tools, requests and runs below its chat.`,to:[`agents`]},{kind:`improved`,title:`Headline numbers`,detail:`Shown as one stat panel with a trend for each number.`}]},{version:`2.6.2`,date:`2026-11-02`,summary:`Custom agents, a page for every agent, Accessibility, Performance and Visual pages, and pictures in chat.`,changes:[{kind:`new`,title:`Custom agents`,detail:`Build your own agent with the agent builder. It runs only an approved version, held to its limits on every tool call, and can run on a schedule with a person approving what it may not do alone.`,to:[`agents`]},{kind:`new`,title:`Accessibility, Performance and Visual pages`,detail:`Each has its own page and agent. Accessibility tests a goal as personas (blind, keyboard-only, low vision…) and keeps every session in a Results tab.`,to:[`accessibility`]},{kind:`new`,title:`Agents page`,detail:`Every agent in four columns by category, with what each can do and whether it is ready. Mark favourites to keep them close.`,to:[`agents`]},{kind:`new`,title:`Pictures and files in chat`,detail:`Attach files with @ or drop them on the composer. Images of any format are shrunk and stripped of their metadata before the model sees them; /paste works in the terminal.`},{kind:`new`,title:`GitHub Copilot models`,detail:`Pick a Copilot model in Settings, count and budget premium requests, and sign in with GitHub Enterprise Cloud.`,to:[`settings`,`models`]},{kind:`new`,title:`Jobs agent`,detail:`Make a job by asking for it in the Agent tab; jobs show as a table.`,to:[`jobs`]},{kind:`improved`,title:`At a limit, carry on`,detail:`When a run reaches its budget, ForgeQE asks whether to carry on instead of ending the work.`},{kind:`improved`,title:`Tables everywhere`,detail:`Memory, Knowledge, Skills, Guardrails and Prompts are tables that look and page the same, each with a search box.`},{kind:`improved`,title:`What's ready`,detail:`One box per area, one line per feature, and the details in a side sheet.`,to:[`features`]},{kind:`improved`,title:`Dark and light in the sidebar`,detail:`Switch the theme from the sidebar; the sidebar itself is dark.`},{kind:`fixed`,title:`Copilot errors`,detail:`Rate limits, cut-off replies and Windows' reason for not loading Copilot's runtime are now reported clearly.`}]},{version:`2.4.0`,date:`2026-10-28`,summary:`Each agent gets only the tools it needs.`,changes:[{kind:`new`,title:`Scoped MCP tools`,detail:`An agent's tool server offers only the tools its work needs, so it chooses among fewer and calls fewer by mistake.`}]}]},Qa=[`new`,`improved`,`fixed`],$a=/^[a-z0-9][a-z0-9-]*$/,eo=/^[0-9]+\.[0-9]+\.[0-9]+([a-zA-Z0-9.-]*)?$/,to={summary:240,title:80,detail:600},no=e=>typeof e==`object`&&!!e&&!Array.isArray(e);function ro(e,t){if(typeof e!=`string`)return;let n=e.trim();if(!(!n||n.length>t||/[\u0000-\u001f\u007f\u2028\u2029]/.test(n)))return n}function Y(e){if(typeof e!=`string`||!/^\d{4}-\d{2}-\d{2}$/.test(e))return;let t=new Date(`${e}T00:00:00Z`);return!Number.isNaN(t.getTime())&&t.toISOString().slice(0,10)===e?e:void 0}function io(e){let t=/^([0-9]+)\.([0-9]+)\.([0-9]+)(.*)$/.exec(e);return t?[Number(t[1]),Number(t[2]),Number(t[3]),+!t[4],t[4]??``]:[0,0,0,0,e]}function ao(e,t){let n=io(e),r=io(t);for(let e=0;e<4;e++)if(n[e]!==r[e])return n[e]-r[e];return n[4]<r[4]?-1:+(n[4]>r[4])}function oo(e,t,n){if(!no(e))return void n.push(`${t}: not an object`);let r=Object.keys(e).filter(e=>![`kind`,`title`,`detail`,`to`].includes(e));if(r.length)return void n.push(`${t}: unknown key ${r.join(`, `)}`);let i=Qa.find(t=>t===e.kind);if(!i)return void n.push(`${t}: kind must be one of ${Qa.join(`, `)}`);let a=ro(e.title,to.title);if(!a)return void n.push(`${t}: title must be one line of at most ${to.title} characters`);let o=ro(e.detail,to.detail);return o?e.to===void 0?{kind:i,title:a,detail:o}:!Array.isArray(e.to)||!e.to.length||e.to.length>4||!e.to.every(e=>typeof e==`string`&&$a.test(e))?void n.push(`${t}: to must be 1 to 4 route parts of the web app, like ["settings", "models"]`):{kind:i,title:a,detail:o,to:[...e.to]}:void n.push(`${t}: detail must be one line of at most ${to.detail} characters`)}function so(e,t,n){if(!no(e))return void n.push(`${t}: not an object`);let r=Object.keys(e).filter(e=>![`version`,`date`,`summary`,`changes`].includes(e));if(r.length)return void n.push(`${t}: unknown key ${r.join(`, `)}`);let i=typeof e.version==`string`&&eo.test(e.version)?e.version:void 0;if(!i)return void n.push(`${t}: version must be like 2.6.2`);let a=`${t} (${i})`,o=Y(e.date);if(!o)return void n.push(`${a}: date must be a real day, like 2026-11-02`);let s=ro(e.summary,to.summary);if(!s)return void n.push(`${a}: summary must be one line of at most ${to.summary} characters`);if(!Array.isArray(e.changes)||!e.changes.length)return void n.push(`${a}: changes must list at least one change`);let c=n.length,l=e.changes.map((e,t)=>oo(e,`${a} change ${t+1}`,n)).filter(e=>!!e);if(!(n.length>c))return{version:i,date:o,summary:s,changes:l}}function co(e){let t=[];if(!no(e)||!Array.isArray(e.releases))return{releases:[],problems:[`the file must be an object with a "releases" list`]};let n=Object.keys(e).filter(e=>e!==`releases`&&e!==`$comment`);n.length&&t.push(`unknown key ${n.join(`, `)}`);let r=[];return e.releases.forEach((e,n)=>{let i=so(e,`release ${n+1}`,t);if(!i)return;let a=r[r.length-1];if(r.some(e=>e.version===i.version))return void t.push(`release ${n+1}: version ${i.version} is listed twice`);if(a&&(ao(i.version,a.version)>=0||i.date>a.date))return void t.push(`release ${n+1}: ${i.version} must come after ${a.version} (newest first, by version and date)`);r.push(i)}),{releases:r,problems:t}}var lo=co(Za).releases,uo=lo[0],fo=e=>e.to?.length&&e.to.every(e=>$a.test(e))?B(...e.to):void 0,po=e=>new Date(`${e}T00:00:00`),mo=e=>po(e).toLocaleDateString(void 0,{day:`numeric`,month:`short`,year:`numeric`}),ho=e=>po(e).toLocaleDateString(void 0,{month:`long`,year:`numeric`});function go(e=lo){let t=[];for(let n of e){let e=ho(n.date),r=t[t.length-1];r?.month===e?r.releases.push(n):t.push({month:e,releases:[n]})}return t}var _o=`forgeqe-whats-new-seen`,vo=()=>{try{return localStorage.getItem(_o)===uo?.version}catch{return!1}},yo=()=>{try{uo&&localStorage.setItem(_o,uo.version)}catch{}};function bo(e,t){setTimeout(()=>{let n=document.getElementById(e);if(!n)return;n.focus();let r=Ma(t);r&&n.setSelectionRange(r[0],r[1])},0)}function xo({onRead:e}={}){let[t,n]=(0,q.useState)(null),[r,i]=(0,q.useState)(null),[a,o]=(0,q.useState)(null);return(0,q.useEffect)(()=>{xn.list().then(e=>n(e.runs),()=>n([])),cn.list().then(e=>i(e.approvals),()=>i([])),Et.list().then(e=>o(e.jobs),()=>o([]))},[]),(0,q.useEffect)(()=>{t&&r&&a&&e?.(Gi(t,r,a))},[t,r,a]),!t||!r||!a?null:(0,J.jsx)(Wi,{items:Ki(t,r,a),title:`Needs a look today`,id:`needs-look-today`})}function So(){let[e,t]=(0,q.useState)(()=>!!uo&&!vo());if(!e||!uo)return null;let n=uo.changes.filter(e=>e.kind===`new`).slice(0,3);return(0,J.jsxs)(`section`,{"aria-labelledby":`whats-new-title`,className:`flex w-full items-start gap-x-4 border-y border-line py-4`,children:[(0,J.jsx)(Zt,{icon:je,size:20,className:`mt-1 flex-none text-accent-fg`}),(0,J.jsxs)(`div`,{className:`flex min-w-0 flex-1 flex-wrap items-center gap-x-4 gap-y-4`,children:[(0,J.jsxs)(`span`,{className:`flex min-w-0 flex-[1_1_280px] flex-col gap-1`,children:[(0,J.jsxs)(`span`,{id:`whats-new-title`,className:`font-medium`,children:[`What's new in ForgeQE `,uo.version]}),(0,J.jsx)(`span`,{className:`text-sm text-muted [overflow-wrap:anywhere]`,children:n.length?n.map(e=>e.title).join(` · `):uo.summary})]}),(0,J.jsxs)(`a`,{className:Ct({variant:`outline`}),href:B(`settings`,`whats-new`),"data-tip":`See all changes`,children:[(0,J.jsx)(Xe,{"aria-hidden":`true`}),`Changes`]})]}),(0,J.jsx)(V,{variant:`icon`,size:`icon`,"aria-label":`Close until the next release`,"data-tip":`Close until the next release`,onClick:()=>{yo(),t(!1)},className:`-my-2 -mr-2 size-8 flex-none`,children:(0,J.jsx)(A,{size:16,"aria-hidden":`true`})})]})}function Co({id:e}){let t=bi(e);return(0,J.jsx)(qa,{href:t.href,label:t.label})}function wo({agent:e,tabs:t}){return(0,J.jsxs)(`header`,{style:t?{viewTransitionName:`agent-tabs`}:void 0,className:`flex flex-wrap items-center gap-1 px-6 py-4 short:py-2`,children:[(0,J.jsx)(Ar,{}),e&&(0,J.jsx)(Co,{id:e.id}),t&&(0,J.jsxs)(J.Fragment,{children:[(0,J.jsx)(`span`,{className:`flex-1`}),t]})]})}function To({agent:e,title:t,tabs:n,end:r}){let i=Ln(e.agent);return(0,J.jsxs)(J.Fragment,{children:[(0,J.jsx)(`span`,{className:`w-fit`,children:(0,J.jsx)(Co,{id:e.id})}),(0,J.jsxs)(`div`,{className:`flex flex-wrap items-center gap-x-4 gap-y-2`,children:[(0,J.jsx)(Vn,{agent:e.agent,px:40,decorative:!0}),(0,J.jsx)(`h1`,{className:`m-0 text-[25px] font-semibold tracking-[-0.01em]`,children:t??(i?i.name:e.id)}),n,r&&(0,J.jsxs)(J.Fragment,{children:[(0,J.jsx)(`span`,{className:`flex-auto`}),r]})]})]})}function Eo({agent:e,title:t,below:n,tabs:r,end:i}={}){let a=e&&Ln(e.agent),o=e?e.starters:ja,[s,c]=(0,q.useState)(``),[l,u]=(0,q.useState)(``);(0,q.useEffect)(()=>{if(!e)try{let e=sessionStorage.getItem(Pa);sessionStorage.removeItem(Pa),e&&e.trim()&&(c(e.slice(0,2e4)),setTimeout(()=>Ii(`msg`),0))}catch{}},[]);let[d,f]=(0,q.useState)(!1),p=zi(),m=Li(),h=Or(Tr().theme)!==`icons`,g=Ba(!!e||h||d),[_,v]=(0,q.useState)(null),y=Ka(!!e||!h||d,_,s),{setup:b}=p,x=Bi(s,e=>{c(e),u(``)},`msg`,{code:p.tools.code}),S=Ui(`home`,e=>{c(e),Ii(`msg`)}),C=async(t=s)=>{let n=a&&e?.agent!==`forgeqe`&&t.trim()?`${a.name}: ${t.trim()}`:t.trim();if(d||!n.trim()&&!x.hasFiles)return!1;f(!0),u(``);try{let t=await x.wrap(n);if(!t.trim())return f(!1),!1;let{id:r}=await mn.start(t,p.choice,e?.id??`orchestrator`);return x.reset({keep:!0}),location.hash=B(`chats`,r),!0}catch(e){return u(e.message),f(!1),!1}};return(0,J.jsxs)(`div`,{className:`flex min-h-(--screen) flex-col`,children:[e?(0,J.jsxs)(J.Fragment,{children:[(0,J.jsx)(ii,{}),(0,J.jsx)(`div`,{className:L(hi,`@container gap-4 pb-0 short:pb-0`),children:(0,J.jsx)(To,{agent:e,...t?{title:t}:{},tabs:r,end:i})})]}):(0,J.jsx)(wo,{}),(0,J.jsx)(`main`,{className:L(`flex flex-auto flex-col items-center px-6`,e?`pt-8 pb-16 short:pt-6 short:pb-8`:`justify-center pt-6 pb-30 short:pt-0 short:pb-8`),children:(0,J.jsxs)(`div`,{className:L(`flex w-full flex-col items-center gap-10 short:gap-6`,e?`max-w-[880px]`:`max-w-[780px]`),children:[(0,J.jsxs)(`div`,{className:`flex flex-col items-center gap-4 text-center short:gap-2`,children:[e?(0,J.jsx)(Vn,{agent:e.agent,px:m?64:96,decorative:!0,working:d,className:`mb-1`}):h?(0,J.jsx)(Vn,{agent:nr,px:m?72:112,state:d?`thinking`:y.state,mood:d?void 0:y.mood,activity:d?void 0:y.activity,className:`mb-1`}):(0,J.jsx)($t,{state:d?`waiting`:g,px:m?72:112,label:d?`Starting the chat`:`ForgeQE is ready`,className:`mb-1`}),e&&a&&t&&t!==a.name&&(0,J.jsx)(`h2`,{className:`m-0 text-[20px] font-semibold`,children:a.name}),!e&&(0,J.jsx)(`h1`,{className:`m-0 text-[31px] leading-tight font-semibold short:text-[25px] tracking-[-0.015em] text-ink`,children:`What are we assuring today?`}),e?(0,J.jsx)(`p`,{className:`m-0 text-[16px] leading-relaxed text-ink-2`,children:e.about}):(0,J.jsx)(`p`,{className:`m-0 max-w-[46ch] text-[16px] leading-relaxed text-ink-2`,children:`ForgeQE assures every release: it uses your app as your customers do, shows what broke and why, and keeps the proof.`}),e?.crew?.length?(0,J.jsx)(ji,{crew:e.crew}):null]}),b&&!b.ready&&(0,J.jsx)(Mi,{project:b.project}),b?.ready&&(0,J.jsx)(Fi,{c:p}),(0,J.jsx)(Pi,{id:`msg`,label:a?`Message ${vr(a.name)}`:`Message ForgeQE`,value:s,onChange:e=>{c(e),u(``)},onSend:()=>void C(),disabled:d||!!b&&!b.ready||S.running,canSend:!!s.trim()||x.hasFiles,onEdit:x.onEdit,onKey:x.onKeyDown,onFiles:x.onFiles,dropping:x.dropping,drop:x.drop,mentions:x.mentions,combo:x.combo,placeholder:a?`Ask ${vr(a.name)} to…`:`Ask ForgeQE to test something…`,top:(0,J.jsxs)(J.Fragment,{children:[x.chips,S.state&&(0,J.jsx)(Ni,{state:S.state,onStop:()=>void S.stop(),onUndo:S.undo,onClose:S.close}),(0,J.jsx)(dr,{chat:null})]}),left:(0,J.jsxs)(J.Fragment,{children:[x.fileInput,(0,J.jsx)(Hi,{attach:{pick:x.pick},choice:p}),(0,J.jsx)(Vi,{running:S.running,disabled:!s.trim()||d||!!b&&!b.ready,onClick:()=>void S.start(s)}),(0,J.jsx)(Ei,{chat:null,disabled:d||S.running||!!b&&!b.ready})]}),right:(0,J.jsx)(Ri,{c:p})}),(0,J.jsx)(`p`,{role:`status`,"aria-live":`polite`,className:L(`-mt-6 m-0 text-center short:-mt-4 text-sm text-ink-2`,!(l||x.error)&&`sr-only`),children:(0,J.jsx)(`span`,{className:x.error&&!l?`text-fail`:``,children:l||x.error||``})}),(0,J.jsx)(`div`,{className:`flex flex-wrap justify-center gap-4`,children:o.map(({label:e,Icon:t,text:n})=>(0,J.jsxs)(V,{onClick:()=>{c(n),u(``),bo(`msg`,n)},children:[t&&(0,J.jsx)(t,{"aria-hidden":`true`}),e]},e))}),!e&&b?.ready&&(0,J.jsx)(xo,{onRead:e=>v(Ua(e))}),!e&&(0,J.jsx)(So,{}),n]})})]})}function Do({groups:e,edit:t,continued:n}){return(0,J.jsx)(J.Fragment,{children:e.map((e,r)=>(0,J.jsxs)(`div`,{children:[(0,J.jsx)(U,{help:e.help,first:r===0&&!n,children:e.title}),(0,J.jsx)(Dn,{defs:e.fields,edit:t,base:e.base})]},e.title))})}function Oo(e,t,n,r){return t.map(t=>{let r=e[t]??n.find(e=>e.key===t)?.default;return typeof r==`string`?r:``}).filter(e=>e&&!r(e))}var ko=[{key:`url`,label:`Sign-in page`,type:`url`,placeholder:`https://staging.shop.example/login`},{key:`domains`,label:`Or sites`,help:`Comma separated; * matches a subdomain.`,type:`list`,placeholder:`https://staging.shop.example, https://*.shop.example`},{key:`app`,label:`Or desktop app`,help:`A desktop app of desktop.apps this login signs in to, instead of a site.`,type:`text`,placeholder:`billing`},{key:`username_env`,label:`User name variable`,type:`var`,placeholder:`SHOP_USER`},{key:`password_env`,label:`Password variable`,type:`var`,placeholder:`SHOP_PASSWORD`},{key:`totp_env`,label:`Authenticator secret variable`,help:`Optional: a base32 secret for two-factor codes.`,type:`var`,placeholder:`SHOP_TOTP_SECRET`},{key:`save_session`,label:`Keep the session`,help:`The next run starts signed in (.forgeqe/sessions). Off signs in every run.`,type:`switch`,default:!0},{key:`code`,label:`Codes sent by`,help:`A one-time code the site sends another way than an authenticator app: ForgeQE reads it where it arrives and types it.`,type:`select`,options:[{value:`email`,label:`Email (a test mailbox, IMAP)`},{value:`sms`,label:`Text message (Twilio)`},{value:`http`,label:`The test environment's address`}],emptyLabel:`None`},{key:`code_host`,label:`Mailbox server`,help:`The IMAP server, on port 993.`,type:`text`,placeholder:`imap.mail.example`,when:e=>e.code===`email`},{key:`code_user_env`,label:`Mailbox user or Twilio SID variable`,help:`Email: the mailbox user. Text message: the Twilio account SID.`,type:`var`,placeholder:`QA_MAIL_USER`,when:e=>e.code===`email`||e.code===`sms`},{key:`code_secret_env`,label:`Mailbox password or token variable`,help:`Email: the mailbox password. Text message: the Twilio auth token. Address: its token (optional).`,type:`var`,placeholder:`QA_MAIL_PASSWORD`,when:e=>!!e.code},{key:`code_to`,label:`Sent to`,help:`Email: the address the code goes to (optional). Text message: the number, +15550100.`,type:`text`,placeholder:`+15550100 or qa1@mail.example`,when:e=>e.code===`email`||e.code===`sms`},{key:`code_sender`,label:`Sent from`,help:`Optional: only messages from this address or number.`,type:`text`,placeholder:`no-reply@shop.example`,when:e=>e.code===`email`||e.code===`sms`},{key:`code_folder`,label:`Mailbox folder`,type:`text`,default:`INBOX`,when:e=>e.code===`email`},{key:`code_url`,label:`Address with the latest code`,help:`https (http only on this computer); answers with the code as text or JSON.`,type:`url`,placeholder:`https://qa-api.shop.example/otp/latest?user=qa1`,when:e=>e.code===`http`},{key:`code_header`,label:`Token header`,help:`Optional: the header the token goes in (Authorization: Bearer otherwise).`,type:`text`,placeholder:`X-Api-Key`,when:e=>e.code===`http`},{key:`code_pattern`,label:`Code pattern`,help:`Optional: a regular expression whose group is the code (4 to 8 digits otherwise).`,type:`text`,placeholder:`Your code is ([0-9]{6})`,when:e=>!!e.code},{key:`code_wait`,label:`Wait for it (seconds)`,type:`number`,default:90,when:e=>!!e.code},{key:`passkey_env`,label:`Security key variable`,help:`Holds a security key or passkey registered once; runs present it as a virtual key.`,type:`var`,placeholder:`SHOP_PASSKEY`},{key:`push_wait`,label:`Wait for a push approval (seconds)`,help:`A push to a phone needs a person: the run waits this long and tells the notification channels that ask for sign-in approvals.`,type:`number`,placeholder:`120`}],Ao=/^[A-Za-z0-9][A-Za-z0-9_.-]{0,62}$/;function jo(e,t,n){return e?Ao.test(e)?e!==t&&n.includes(e)?`There is already a sign-in named ${e}.`:``:`Letters, digits, . _ and -.`:`Needs a name.`}function Mo(e){let t=e.toUpperCase().replace(/[^A-Z0-9]/g,`_`);return{username_env:`${t}_USER`,password_env:`${t}_PASSWORD`}}function No({edit:e}){let[t,n]=(0,q.useState)(null),r=Cr(),i=W(e.value.logins),a=Object.keys(i);return(0,J.jsxs)(J.Fragment,{children:[(0,J.jsxs)(`div`,{className:`mb-4 flex flex-wrap items-center justify-between gap-4`,children:[(0,J.jsx)(`span`,{className:`text-sm text-muted`,children:`One for each app the agent signs in to.`}),(0,J.jsxs)(V,{size:`sm`,"data-tip":`Add a sign-in`,onClick:()=>{let e=ti(i,`shop`);n({mode:`add`,from:``,name:e,login:Mo(e)})},children:[(0,J.jsx)(k,{"aria-hidden":`true`}),`Add`]})]}),a.length===0&&(0,J.jsx)(`p`,{className:`m-0 border-t border-line-soft py-6 text-sm text-muted`,children:`None yet.`}),Object.entries(i).map(([t,i])=>{let a=W(i),o=Oo(a,[`username_env`,`password_env`],ko,e=>ci(r,e)),s=a.username_env||a.password_env;return(0,J.jsx)(or,{expandable:!1,open:!1,onToggle:()=>{},lead:(0,J.jsx)(Pr,{icon:m}),title:t,meta:String(a.url||(Array.isArray(a.domains)?a.domains.join(`, `):``)||`No site yet`),state:s?o.length?(0,J.jsx)(`span`,{className:`text-sm text-warn`,"data-tip":o.join(`, `),children:o.length===1?`Needs ${o[0]}`:`Needs ${o.length} variables`}):(0,J.jsx)(`span`,{className:`text-sm text-pass`,children:`Ready`}):(0,J.jsx)(`span`,{className:`text-sm text-muted`,children:`Not set up`}),actions:(0,J.jsxs)(J.Fragment,{children:[(0,J.jsx)(V,{variant:`icon`,size:`icon-sm`,"aria-label":`Edit ${t}`,"data-tip":`Edit ${t}`,onClick:()=>n({mode:`edit`,from:t,name:t,login:{...a}}),children:(0,J.jsx)(re,{"aria-hidden":`true`})}),(0,J.jsx)(V,{variant:`icon`,size:`icon-sm`,"aria-label":`Remove ${t}`,"data-tip":`Remove ${t}`,onClick:()=>e.set(K(e.value,[`logins`,t],void 0)),children:(0,J.jsx)(Ie,{"aria-hidden":`true`})})]}),children:null},t)}),(0,J.jsx)(Po,{panel:t,setPanel:n,taken:a,vars:e.vars,onApply:t=>{t.mode===`add`?e.set(K(e.value,[`logins`,t.name],t.login)):e.set(K(e.value,[`logins`],{...kr(i,t.from,t.name),[t.name]:t.login}))}})]})}function Po({panel:e,setPanel:t,taken:n,vars:r,onApply:i}){let a={value:e?W(e.login):{},set:n=>e&&t({...e,login:n}),vars:r},o=e?jo(e.name,e.from,n):``,s=()=>t(null);return(0,J.jsx)(yr,{open:!!e,onClose:s,title:e?.mode===`add`?`Add a sign-in`:`Edit ${e?.from}`,description:(0,J.jsxs)(J.Fragment,{children:[`The page and variables for one app login. Changes apply when you press the button below; a secret's value goes to your credential store as you type it.`,e?.name&&Ao.test(e.name)?(0,J.jsxs)(J.Fragment,{children:[` `,`Sign in by hand with `,(0,J.jsxs)(`code`,{className:`font-mono text-[13px]`,children:[`forgeqe login `,e.name]}),`.`]}):null]}),footer:(0,J.jsxs)(J.Fragment,{children:[o&&(0,J.jsx)(`span`,{className:`mr-auto self-center text-sm text-muted`,children:`Needs a valid name`}),(0,J.jsxs)(V,{onClick:s,children:[(0,J.jsx)(A,{"aria-hidden":`true`}),`Cancel`]}),(0,J.jsxs)(V,{variant:`primary`,disabled:!!o,onClick:()=>{i(e),s()},children:[e?.mode===`add`?(0,J.jsx)(k,{"aria-hidden":`true`}):(0,J.jsx)(dt,{"aria-hidden":`true`}),e?.mode===`add`?`Add`:`Done`]})]}),children:e&&(0,J.jsxs)(J.Fragment,{children:[(0,J.jsx)(H,{label:`Name`,help:o?(0,J.jsx)(`span`,{className:`text-fail`,children:o}):`How environments and forgeqe login name it.`,htmlFor:`login-name`,className:`mt-4`,stacked:!0,children:(0,J.jsx)(R,{id:`login-name`,value:e.name,spellCheck:!1,placeholder:`shop-qa`,"aria-invalid":!!o,onChange:n=>t({...e,name:n.target.value.trim()}),className:`font-mono`})}),(0,J.jsx)(Dn,{defs:ko,edit:a,base:[],stacked:!0})]})})}function Fo({rules:e,others:t,onChange:n}){let[r,i]=(0,q.useState)(``),[a,o]=(0,q.useState)(``),s=r.trim().length>0;return(0,J.jsxs)(J.Fragment,{children:[(0,J.jsxs)(`form`,{onSubmit:a=>{a.preventDefault();let s=r.replace(/^\s*[-*+]\s+/,``).trim();if(s){if(s.length>300)return o(`A rule is at most 300 characters: make it shorter.`);if([...e,...t.map(e=>e.text)].some(e=>e.toLowerCase()===s.toLowerCase()))return o(`That rule is already in force.`);o(``),n([...e,s]),i(``)}},className:`mb-4 flex items-center gap-2 rounded-[10px] border border-line py-2 pr-2 pl-6 has-[input:focus-visible]:outline-2 has-[input:focus-visible]:outline-offset-2 has-[input:focus-visible]:outline-accent`,children:[(0,J.jsx)(`label`,{htmlFor:`rule`,className:`sr-only`,children:`New rule`}),(0,J.jsx)(`input`,{id:`rule`,value:r,maxLength:300,onChange:e=>{i(e.target.value),o(``)},placeholder:`Add a rule every agent must follow`,className:`min-h-10 min-w-0 flex-auto border-0 bg-transparent text-[16px] outline-none focus-visible:outline-none`}),(0,J.jsxs)(`button`,{type:`submit`,disabled:!s,"data-tip":`Add the rule`,className:L(`inline-flex min-h-10 cursor-pointer items-center gap-2 rounded-[7px] border-0 px-4 text-sm font-medium disabled:cursor-not-allowed [&>svg]:size-4`,s?`bg-accent text-accent-ink hover:bg-accent-hover`:`bg-surface-strong text-muted`),children:[(0,J.jsx)(k,{"aria-hidden":`true`}),`Add`]})]}),a&&(0,J.jsx)(`p`,{role:`alert`,className:`mt-0 mb-4 text-sm text-fail`,children:a}),e.length===0&&t.length===0?(0,J.jsx)(`p`,{className:`m-0 py-6 text-sm text-muted`,children:`No rules yet. Add the first one above.`}):(0,J.jsx)(`div`,{className:`@container`,children:(0,J.jsx)(Sr,{label:`Rules`,placeholder:`Find a rule`,empty:`No rule matches.`,head:(0,J.jsxs)(J.Fragment,{children:[(0,J.jsx)(`th`,{className:Sn,children:`Rule`}),(0,J.jsx)(`th`,{className:L(Sn,`hidden @xl:table-cell`),children:`Set in`}),(0,J.jsx)(`th`,{className:Sn,children:(0,J.jsx)(`span`,{className:`sr-only`,children:`Remove`})})]}),children:[...e.map((t,r)=>(0,J.jsxs)(`tr`,{className:_i,children:[(0,J.jsx)(`td`,{className:L(Er,`leading-normal`),children:t}),(0,J.jsx)(`td`,{className:L(Er,`hidden w-[1%] whitespace-nowrap @xl:table-cell`),children:(0,J.jsx)(`span`,{className:`rounded-full bg-pass-soft px-2 py-px text-[13px] font-medium text-pass`,children:`This project`})}),(0,J.jsx)(`td`,{className:L(Er,`w-[1%] py-2 text-right`),children:(0,J.jsx)(V,{variant:`icon`,size:`icon-sm`,"aria-label":`Remove rule: ${t}`,"data-tip":`Remove rule: ${t}`,onClick:()=>n(e.filter((e,t)=>t!==r)),children:(0,J.jsx)(Ie,{"aria-hidden":`true`})})})]},`own-${r}`)),...t.map(e=>(0,J.jsxs)(`tr`,{className:_i,children:[(0,J.jsx)(`td`,{className:L(Er,`leading-normal`),children:e.text}),(0,J.jsxs)(`td`,{className:L(Er,`hidden w-[1%] whitespace-nowrap @xl:table-cell`),children:[(0,J.jsx)(`span`,{className:`font-mono text-[13px] text-muted`,children:e.source}),e.agents?.length?(0,J.jsxs)(`span`,{className:`block text-[13px] text-muted`,children:[`For `,e.agents.length>2?`${e.agents.length} agents`:e.agents.map(e=>Ln(e).name).join(` and `)]}):null]}),(0,J.jsx)(`td`,{className:L(Er,`w-[1%] text-right text-[13px] whitespace-nowrap text-muted`),children:`Read only`})]},`other-${e.source}-${e.text}`))]})})]})}function Io(e){let t=e=>e.split(/[\\/]/).pop()||e,n=e.paths.environments;return[{id:`config`,label:t(e.paths.config),file:`config`,path:e.paths.config,text:e.raw.config},{id:`models`,label:t(e.paths.models),file:`models`,path:e.paths.models,text:e.raw.models},...e.raw.environments.map(e=>({id:`env:${e.name}`,label:t(e.path),file:`environments`,env:n.layout===`dir`?e.name:void 0,path:e.path,text:e.text}))]}var Lo=`m-0 px-4 py-4 font-mono text-[13px] leading-[1.7] whitespace-pre-wrap [overflow-wrap:anywhere] [tab-size:2]`;function Ro({id:e,value:t,lang:n,onChange:r,plain:i=!1}){let a=(0,q.useMemo)(()=>$i(t,n),[t,n]);return(0,J.jsx)(`div`,{className:L(`outline-accent has-[:focus-visible]:outline-2 has-[:focus-visible]:outline-offset-2`,i?`rounded-[4px] [&_pre]:px-0 [&_textarea]:px-0`:`max-h-[calc(var(--screen)-300px)] min-h-[360px] overflow-auto rounded-[8px] border border-line bg-field hover:border-line-strong focus-within:border-accent focus-within:bg-bg`),children:(0,J.jsxs)(`div`,{className:`grid`,children:[(0,J.jsxs)(`pre`,{"aria-hidden":`true`,className:L(Lo,`pointer-events-none text-ink [grid-area:1/1]`),children:[a,`
39
- `]}),(0,J.jsx)(`textarea`,{id:e,spellCheck:!1,autoCapitalize:`off`,autoCorrect:`off`,value:t,onChange:e=>r(e.target.value),className:L(Lo,`resize-none overflow-hidden border-0 !bg-transparent text-transparent caret-ink outline-none selection:bg-accent-soft [grid-area:1/1]`)})]})})}function zo({snap:e,dirty:t,onSave:n}){let r=Io(e),[i,a]=(0,q.useState)(`config`),[o,s]=(0,q.useState)({}),[c,l]=(0,q.useState)(!1),u=r.find(e=>e.id===i)||r[0],d=o[u.id]??u.text,f=d!==u.text;return(0,J.jsxs)(J.Fragment,{children:[(0,J.jsx)(Ir,{prefix:`file`,label:`Settings files`,className:`mb-4`,current:u.id,onPick:a,tabs:r.map(e=>({id:e.id,label:e.label,mono:!0}))}),(0,J.jsxs)(`div`,{id:`file-panel-${u.id}`,role:`tabpanel`,"aria-labelledby":`file-${u.id}`,className:`flex flex-col gap-4`,children:[(0,J.jsx)(`p`,{className:`m-0 font-mono text-[13px] break-all text-muted`,children:u.path}),e.errors[u.file]&&(0,J.jsxs)(`p`,{role:`alert`,className:`m-0 rounded-[10px] bg-fail-soft px-4 py-2 text-sm text-fail`,children:[`Does not parse: `,e.errors[u.file]]}),(0,J.jsx)(`label`,{htmlFor:`file-text`,className:`sr-only`,children:u.label}),(0,J.jsx)(Ro,{id:`file-text`,plain:!0,value:d,lang:u.label.endsWith(`.json`)?`json`:`yaml`,onChange:e=>s({...o,[u.id]:e})}),(0,J.jsxs)(`div`,{className:`sticky bottom-0 z-[1] -mx-1 flex flex-wrap items-center gap-4 border-t border-line-soft bg-bg px-1 py-4`,children:[(0,J.jsxs)(V,{size:`sm`,variant:`primary`,"data-tip":`Save file`,disabled:!f||c||t[u.file],onClick:async()=>{l(!0);try{if(await n(u.file,d,u.env)){let e={...o};delete e[u.id],s(e)}}finally{l(!1)}},children:[(0,J.jsx)(dt,{"aria-hidden":`true`}),c?`Saving…`:`Save`]}),f&&(0,J.jsxs)(V,{size:`sm`,onClick:()=>{let e={...o};delete e[u.id],s(e)},disabled:c,"data-tip":`Discard your changes`,children:[(0,J.jsx)(Ee,{"aria-hidden":`true`}),`Discard`]}),t[u.file]&&(0,J.jsx)(`span`,{className:`text-sm text-muted`,children:`Save or discard the form's changes to this file first.`})]})]})]})}var Bo=/^[A-Za-z0-9][A-Za-z0-9_-]{0,62}$/;function Vo({edit:e,base:t,defs:n,noun:r,meta:i,start:a={},placeholder:o}){let s=W(Kr(e.value,t)),[c,l]=(0,q.useState)(null),[u,d]=(0,q.useState)(``),f=u&&!Bo.test(u)?`Letters, digits, - and _.`:u in s?`There is a ${r} named ${u}.`:``,p=()=>{u&&!f&&(e.set(K(e.value,[...t,u],{...a})),l(u),d(``))};return(0,J.jsxs)(J.Fragment,{children:[Object.keys(s).length===0&&(0,J.jsx)(`p`,{className:`m-0 border-t border-line-soft py-4 text-sm text-muted`,children:`None yet.`}),Object.entries(s).map(([r,a])=>(0,J.jsx)(or,{title:r,meta:i(W(a))||void 0,open:c===r,onToggle:()=>l(c===r?null:r),actions:(0,J.jsx)(V,{variant:`icon`,size:`icon-sm`,"aria-label":`Remove ${r}`,"data-tip":`Remove ${r}`,onClick:()=>e.set(K(e.value,[...t,r],void 0)),children:(0,J.jsx)(Ie,{"aria-hidden":`true`})}),children:(0,J.jsx)(Dn,{defs:n,edit:e,base:[...t,r]})},r)),(0,J.jsx)(H,{label:`Add a ${r}`,help:f?(0,J.jsx)(`span`,{className:`text-fail`,children:f}):`A short name: letters, digits, - and _.`,htmlFor:`add-${t.join(`-`)}`,children:(0,J.jsxs)(`div`,{className:`flex w-full items-center gap-2`,children:[(0,J.jsx)(R,{id:`add-${t.join(`-`)}`,value:u,spellCheck:!1,placeholder:`Name, such as ${o}`,"aria-invalid":!!f,onChange:e=>d(e.target.value.trim()),onKeyDown:e=>e.key===`Enter`&&p(),className:`min-w-0 flex-1`}),(0,J.jsxs)(V,{size:`sm`,disabled:!u||!!f,"data-tip":`Add a ${r}`,onClick:p,children:[(0,J.jsx)(k,{"aria-hidden":`true`}),`Add`]})]})})]})}function Ho(e){return e.waiting||e.state===`ready`&&e.outcome===`needs_input`?`waiting`:e.state===`busy`||e.state===`starting`?`working`:e.state===`closed`||e.state===`failed`?`ended`:`done`}var Uo={working:{label:`Working`,tone:`running`},waiting:{label:`Needs you`,tone:`warn`},done:{label:`Your turn`,tone:`pass`},ended:{label:`Ended`,tone:`neutral`}};function Wo(e){let t=e=>Date.parse(e.lastAt||e.started)||0;return[...e].sort((e,n)=>t(n)-t(e))}function Go(e,t){let n=t.toLowerCase().split(/\s+/).filter(Boolean),r=`${e.title} ${e.lastReply||``} ${e.profile||``}`.toLowerCase();return n.every(e=>r.includes(e))}function Ko(e,t,n=3,r=50){return!Number.isFinite(e)||!Number.isFinite(t)||t<=0?n:Math.min(r,Math.max(n,Math.floor(e/t)))}function qo({c:e}){let n=Ho(e),r=Uo[n];return(0,J.jsxs)(`a`,{href:B(`chats`,e.id),className:`group grid min-h-14 grid-cols-[minmax(0,1fr)_auto] items-center gap-x-4 rounded-[10px] px-4 py-2 text-ink no-underline hover:bg-surface-muted hover:text-ink @3xl:grid-cols-[minmax(0,1fr)_120px_90px_150px_96px]`,children:[(0,J.jsxs)(`span`,{className:`flex min-w-0 flex-col`,children:[(0,J.jsxs)(`span`,{className:`flex min-w-0 items-center gap-2`,children:[n===`waiting`&&(0,J.jsx)(`span`,{"aria-hidden":`true`,className:`size-2 flex-none rounded-full bg-warn`}),(0,J.jsx)(`span`,{className:`truncate text-[13px] font-medium`,children:e.title})]}),(0,J.jsx)(`span`,{className:L(`truncate text-[13px]`,e.lastReply?`text-muted`:`text-muted italic`),children:e.lastReply||(n===`working`?`Working on the first answer…`:`No answer yet`)})]}),(0,J.jsx)(`span`,{className:`justify-self-end @3xl:justify-self-start`,children:(0,J.jsx)(z,{tone:r.tone,orb:e.state===`starting`?`waiting`:`working`,children:r.label})}),(0,J.jsx)(`span`,{className:`hidden text-[13px] text-muted tabular-nums @3xl:block`,children:e.turns?kt(e.turns,`message`):`—`}),(0,J.jsx)(`span`,{className:`hidden min-w-0 items-center gap-1 truncate text-[13px] text-muted @3xl:flex`,children:e.profile?(0,J.jsxs)(J.Fragment,{children:[(0,J.jsx)(Zt,{icon:t,size:11,className:`flex-none text-accent-fg`}),(0,J.jsx)(`span`,{className:`truncate`,children:e.profile})]}):`Default model`}),(0,J.jsx)(`span`,{className:`hidden text-right text-[13px] text-muted tabular-nums @3xl:block`,children:ta(e.lastAt||e.started)})]})}var Jo=Object.defineProperty,Yo=(e,t)=>Jo(e,`name`,{value:t,configurable:!0});function Xo(e,t){if(typeof e==`function`)return e(t);e!=null&&(e.current=t)}Yo(Xo,`setRef`);function Zo(...e){return t=>{let n=!1,r=e.map(e=>{let r=Xo(e,t);return!n&&typeof r==`function`&&(n=!0),r});if(n)return()=>{for(let t=0;t<r.length;t++){let n=r[t];typeof n==`function`?n():Xo(e[t],null)}}}}Yo(Zo,`composeRefs`);function Qo(...e){return q.useCallback(Zo(...e),e)}Yo(Qo,`useComposedRefs`);var $o=Object.defineProperty,es=(e,t)=>$o(e,`name`,{value:t,configurable:!0});function ts(e,t){let n=q.createContext(t);n.displayName=e+`Context`;let r=es(e=>{let{children:t,...r}=e,i=q.useMemo(()=>r,Object.values(r));return(0,J.jsx)(n.Provider,{value:i,children:t})},`Provider`);r.displayName=e+`Provider`;function i(r,i={}){let{optional:a=!1}=i,o=q.useContext(n);if(o)return o;if(t!==void 0)return t;if(!a)throw Error(`\`${r}\` must be used within \`${e}\``)}return es(i,`useContext`),[r,i]}es(ts,`createContext`);function ns(e,t=[]){let n=[];function r(t,r){let i=q.createContext(r);i.displayName=t+`Context`;let a=n.length;n=[...n,r];let o=es(t=>{let{scope:n,children:r,...o}=t,s=n?.[e]?.[a]||i,c=q.useMemo(()=>o,Object.values(o));return(0,J.jsx)(s.Provider,{value:c,children:r})},`Provider`);o.displayName=t+`Provider`;function s(n,o,s={}){let{optional:c=!1}=s,l=o?.[e]?.[a]||i,u=q.useContext(l);if(u)return u;if(r!==void 0)return r;if(!c)throw Error(`\`${n}\` must be used within \`${t}\``)}return es(s,`useContext`),[o,s]}es(r,`createContext`);let i=es(()=>{let t=n.map(e=>q.createContext(e));return es(function(n){let r=n?.[e]||t;return q.useMemo(()=>({[`__scope${e}`]:{...n,[e]:r}}),[n,r])},`useScope`)},`createScope`);return i.scopeName=e,[r,rs(i,...t)]}es(ns,`createContextScope`);function rs(...e){let t=e[0];if(e.length===1)return t;let n=es(()=>{let n=e.map(e=>({useScope:e(),scopeName:e.scopeName}));return es(function(e){let r=n.reduce((t,{useScope:n,scopeName:r})=>{let i=n(e)[`__scope${r}`];return{...t,...i}},{});return q.useMemo(()=>({[`__scope${t.scopeName}`]:r}),[r])},`useComposedScopes`)},`createScope`);return n.scopeName=t.scopeName,n}es(rs,`composeContextScopes`);var is=Object.defineProperty,as=(e,t)=>is(e,`name`,{value:t,configurable:!0}),os=!!(typeof window<`u`&&window.document&&window.document.createElement);function ss(e,t,{checkForDefaultPrevented:n=!0}={}){return as(function(r){if(e?.(r),n===!1||!r||!r.defaultPrevented)return t?.(r)},`handleEvent`)}as(ss,`composeEventHandlers`);function cs(e){if(!os)throw Error(`Cannot access window outside of the DOM`);return e?.ownerDocument?.defaultView??window}as(cs,`getOwnerWindow`);function ls(e){if(!os)throw Error(`Cannot access document outside of the DOM`);return e?.ownerDocument??document}as(ls,`getOwnerDocument`);function us(e,t=!1){let{activeElement:n}=ls(e);if(!n?.nodeName)return null;if(ds(n)&&n.contentDocument)return us(n.contentDocument.body,t);if(t){let e=n.getAttribute(`aria-activedescendant`);if(e){let t=ls(n).getElementById(e);if(t)return t}}return n}as(us,`getActiveElement`);function ds(e){return e.tagName===`IFRAME`}as(ds,`isFrame`);var fs=globalThis?.document?q.useLayoutEffect:()=>{},ps=Object.defineProperty,ms=(e,t)=>ps(e,`name`,{value:t,configurable:!0}),hs=q.useEffectEvent,gs=q.useInsertionEffect;function _s(e){if(typeof hs==`function`)return hs(e);let t=q.useRef(()=>{throw Error(`Cannot call an event handler while rendering.`)});return typeof gs==`function`?gs(()=>{t.current=e}):fs(()=>{t.current=e}),q.useMemo(()=>((...e)=>t.current?.(...e)),[])}ms(_s,`useEffectEvent`);var vs=Object.defineProperty,ys=(e,t)=>vs(e,`name`,{value:t,configurable:!0}),bs=q.useInsertionEffect||fs;function xs({prop:e,defaultProp:t,onChange:n=ys(()=>{},`onChange`),caller:r}){let[i,a,o]=Ss({defaultProp:t,onChange:n}),s=e!==void 0;return[s?e:i,q.useCallback(t=>{if(s){let n=Cs(t)?t(e):t;n!==e&&o.current?.(n)}else a(t)},[s,e,a,o])]}ys(xs,`useControllableState`);function Ss({defaultProp:e,onChange:t}){let[n,r]=q.useState(e),i=q.useRef(n),a=q.useRef(t);return bs(()=>{a.current=t},[t]),q.useEffect(()=>{i.current!==n&&(a.current?.(n),i.current=n)},[n,i]),[n,r,a]}ys(Ss,`useUncontrolledState`);function Cs(e){return typeof e==`function`}ys(Cs,`isFunction`);var ws=Symbol(`RADIX:SYNC_STATE`);function Ts(e,t,n,r){let{prop:i,defaultProp:a,onChange:o,caller:s}=t,c=i!==void 0,l=_s(o),u=[{...n,state:a}];r&&u.push(r);let[d,f]=q.useReducer((t,n)=>{if(n.type===ws)return{...t,state:n.state};let r=e(t,n);return c&&!Object.is(r.state,t.state)&&l(r.state),r},...u),p=d.state,m=q.useRef(p);q.useEffect(()=>{m.current!==p&&(m.current=p,c||l(p))},[p,m,c]);let h=q.useMemo(()=>i===void 0?d:{...d,state:i},[d,i]);return q.useEffect(()=>{c&&!Object.is(i,d.state)&&f({type:ws,state:i})},[i,d.state,c]),[h,f]}ys(Ts,`useControllableStateReducer`);var Es=Object.defineProperty,Ds=(e,t)=>Es(e,`name`,{value:t,configurable:!0});function Os(e){let[t,n]=q.useState(void 0);return fs(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});let t=0,r=new ResizeObserver(r=>{if(!Array.isArray(r)||!r.length)return;let i=r[0];window.cancelAnimationFrame(t),t=window.requestAnimationFrame(()=>{let t,r;if(`borderBoxSize`in i){let e=i.borderBoxSize,n=Array.isArray(e)?e[0]:e;t=n.inlineSize,r=n.blockSize}else t=e.offsetWidth,r=e.offsetHeight;n({width:t,height:r})})});return r.observe(e,{box:`border-box`}),()=>{window.cancelAnimationFrame(t),r.unobserve(e)}}n(void 0)},[e]),t}Ds(Os,`useSize`);var ks=Object.defineProperty,As=(e,t)=>ks(e,`name`,{value:t,configurable:!0});function js(e){let t=q.forwardRef((t,n)=>{let{children:r,...i}=t,a=null,o=!1,s=[];r=Vs(r),q.Children.forEach(r,e=>{if(Ls(e)){o=!0;let t=e,n=`child`in t.props?t.props.child:t.props.children;for(;zs(n)&&typeof Gs==`function`;)n=Gs(n._payload);a=Ps(t,n),s.push(a?.props?.children)}else s.push(e)}),a?a=q.cloneElement(a,void 0,s):!o&&q.Children.count(r)===1&&q.isValidElement(r)&&(a=r);let c=a?Is(a):void 0,l=Qo(n,c);if(!a){if(r||r===0)throw Error(o?Ws(e):Us(e));return r}let u=Fs(i,a.props??{});return a.type!==q.Fragment&&(u.ref=n?l:c),q.cloneElement(a,u)});return t.displayName=`${e}.Slot`,t}As(js,`createSlot`);var Ms=Symbol.for(`radix.slottable`);function Ns(e){let t=As(e=>`child`in e?e.children(e.child):e.children,`Slottable`);return t.displayName=`${e}.Slottable`,t.__radixId=Ms,t}As(Ns,`createSlottable`);var Ps=As((e,t)=>`child`in e.props?q.isValidElement(t)?q.cloneElement(t,void 0,e.props.children(t.props.children)):null:q.isValidElement(t)?t:null,`getSlottableElementFromSlottable`);function Fs(e,t){let n={...t};for(let r in t){let i=e[r],a=t[r];/^on[A-Z]/.test(r)?i&&a?n[r]=(...e)=>{let t=a(...e);return i(...e),t}:i&&(n[r]=i):r===`style`?n[r]={...i,...a}:r===`className`?n[r]=[i,a].filter(Boolean).join(` `):r===`aria-describedby`&&(n[r]=Hs(a,i))}return{...e,...n}}As(Fs,`mergeProps`);function Is(e){let t=Object.getOwnPropertyDescriptor(e.props,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}As(Is,`getElementRef`);function Ls(e){return q.isValidElement(e)&&typeof e.type==`function`&&`__radixId`in e.type&&e.type.__radixId===Ms}As(Ls,`isSlottable`);var Rs=Symbol.for(`react.lazy`);function zs(e){return typeof e==`object`&&!!e&&`$$typeof`in e&&e.$$typeof===Rs&&`_payload`in e&&Bs(e._payload)}As(zs,`isLazyComponent`);function Bs(e){return typeof e==`object`&&!!e&&`then`in e}As(Bs,`isPromiseLike`);function Vs(e){let t=e;for(;zs(t)&&typeof Gs==`function`;)t=Gs(t._payload);return t}As(Vs,`useUnwrappedLazy`);function Hs(...e){let t=new Set;for(let n of e)if(typeof n==`string`)for(let e of String(n).trim().split(/\s+/))e&&t.add(e);return t.size>0?Array.from(t).join(` `):void 0}As(Hs,`concatAriaDescribedby`);var Us=As(e=>`${e} failed to slot onto its children. Expected a single React element child or \`Slottable\`.`,`createSlotError`),Ws=As(e=>`${e} failed to slot onto its \`Slottable\`. Expected \`Slottable\` to receive a single React element child.`,`createSlottableError`),Gs=q.use,Ks=Object.defineProperty,qs=(e,t)=>Ks(e,`name`,{value:t,configurable:!0}),Js=[`a`,`button`,`div`,`form`,`h2`,`h3`,`img`,`input`,`label`,`li`,`nav`,`ol`,`p`,`select`,`span`,`svg`,`ul`].reduce((e,t)=>{let n=js(`Primitive.${t}`),r=q.forwardRef((e,r)=>{let{asChild:i,...a}=e,o=i?n:t;return typeof window<`u`&&(window[Symbol.for(`radix-ui`)]=!0),(0,J.jsx)(o,{...a,ref:r})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function Ys(e,t){e&&oa.flushSync(()=>e.dispatchEvent(t))}qs(Ys,`dispatchDiscreteCustomEvent`);var Xs=Object.defineProperty,Zs=(e,t)=>Xs(e,`name`,{value:t,configurable:!0}),Qs=`Checkbox`,[$s,ec]=ns(Qs),[tc,nc]=$s(Qs);function rc(e){let{__scopeCheckbox:t,checked:n,children:r,defaultChecked:i,disabled:a,form:o,name:s,onCheckedChange:c,required:l,value:u=`on`,internal_do_not_use_render:d}=e,[f,p]=xs({prop:n,defaultProp:i??!1,onChange:c,caller:Qs}),[m,h]=q.useState(null),[g,_]=q.useState(null),[v,y]=q.useState(null),b=!m||!!o||!!m.closest(`form`),x={checked:f,disabled:a,setChecked:p,control:m,setControl:h,name:s,form:o,value:u,userClick:v,onUserClick:y,required:l,defaultChecked:!uc(i)&&i,isFormControl:b,bubbleInput:g,setBubbleInput:_};return(0,J.jsx)(tc,{scope:t,...x,children:lc(d)?d(x):r})}Zs(rc,`CheckboxProvider`);var ic=`CheckboxTrigger`,ac=q.forwardRef(Zs(function({__scopeCheckbox:e,onKeyDown:t,onClick:n,...r},i){let{control:a,value:o,disabled:s,checked:c,required:l,setControl:u,setChecked:d,onUserClick:f,isFormControl:p,bubbleInput:m}=nc(ic,e),h=Qo(i,u),g=q.useRef(c);return q.useEffect(()=>{let e=a?.form;if(e){let t=Zs(()=>d(g.current),`reset`);return e.addEventListener(`reset`,t),()=>e.removeEventListener(`reset`,t)}},[a,d]),(0,J.jsx)(Js.button,{type:`button`,role:`checkbox`,"aria-checked":uc(c)?`mixed`:c,"aria-required":l,"data-state":dc(c),"data-disabled":s?``:void 0,disabled:s,value:o,...r,ref:h,onKeyDown:ss(t,e=>{e.key===`Enter`&&e.preventDefault()}),onClick:ss(n,e=>{let t=e.isPropagationStopped();f({requestedChecked:uc(c)?!0:!c,hasConsumerStoppedPropagation:t}),d(e=>uc(e)?!0:!e),m&&p&&(t||e.stopPropagation())})})},`CheckboxTrigger`)),oc=q.forwardRef(Zs(function(e,t){let{__scopeCheckbox:n,name:r,checked:i,defaultChecked:a,required:o,disabled:s,value:c,onCheckedChange:l,form:u,...d}=e;return(0,J.jsx)(rc,{__scopeCheckbox:n,checked:i,defaultChecked:a,disabled:s,required:o,onCheckedChange:l,name:r,form:u,value:c,internal_do_not_use_render:({isFormControl:e})=>(0,J.jsxs)(J.Fragment,{children:[(0,J.jsx)(ac,{...d,ref:t,__scopeCheckbox:n}),e&&(0,J.jsx)(cc,{__scopeCheckbox:n})]})})},`Checkbox`)),sc=`CheckboxBubbleInput`,cc=q.forwardRef(Zs(function({__scopeCheckbox:e,onClick:t,...n},r){let{control:i,userClick:a,checked:o,defaultChecked:s,required:c,disabled:l,name:u,value:d,form:f,bubbleInput:p,setBubbleInput:m}=nc(sc,e),h=Qo(r,m),g=Os(i),_=q.useRef(!1),v=q.useRef(o),y=q.useRef(a),b=q.useRef(null);q.useEffect(()=>{let e=p;if(!e)return;let t=window.HTMLInputElement.prototype,n=Object.getOwnPropertyDescriptor(t,`checked`).set;if(!n)return;let r=v.current!==o;v.current=o;let i=a!==null&&a!==y.current;if(y.current=a,i)b.current=r?null:a,r&&(e.indeterminate=uc(o),n.call(e,!uc(o)&&o)),e.dispatchEvent(new Event(`click`,{bubbles:!a.hasConsumerStoppedPropagation}));else if(r){let t=b.current;b.current=null;let r=t?.requestedChecked===o;_.current=!0,e.indeterminate=uc(o),n.call(e,!uc(o)&&o),e.dispatchEvent(new Event(`click`,{bubbles:!(r&&t.hasConsumerStoppedPropagation)})),_.current=!1}},[p,o,a]);let x=q.useRef(!uc(o)&&o);return(0,J.jsx)(Js.input,{type:`checkbox`,"aria-hidden":!0,defaultChecked:s??x.current,required:c,disabled:l,name:u,value:d,form:f,...n,tabIndex:-1,ref:h,onClick:ss(t,e=>{_.current&&e.stopPropagation()}),style:{...n.style,...g,position:`absolute`,pointerEvents:`none`,opacity:0,margin:0,transform:`translateX(-100%)`}})},`CheckboxBubbleInput`));function lc(e){return typeof e==`function`}Zs(lc,`isFunction`);function uc(e){return e===`indeterminate`}Zs(uc,`isIndeterminate`);function dc(e){return uc(e)?`indeterminate`:e?`checked`:`unchecked`}Zs(dc,`getState`);var fc=(0,q.createContext)({});function pc(e){let t=(0,q.useRef)(null);return t.current===null&&(t.current=e()),t.current}var mc=typeof window<`u`?q.useLayoutEffect:q.useEffect,hc=(0,q.createContext)(null);function gc(e,t){e.indexOf(t)===-1&&e.push(t)}function _c(e,t){let n=e.indexOf(t);n>-1&&e.splice(n,1)}var vc=(e,t,n)=>n>t?t:n<e?e:n,yc={},bc=e=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(e),xc=e=>typeof e==`object`&&!!e,Sc=e=>/^0[^.\s]+$/u.test(e);function Cc(e){let t;return()=>(t===void 0&&(t=e()),t)}var wc=e=>e,Tc=(...e)=>e.reduce((e,t)=>n=>t(e(n))),Ec=(e,t,n)=>{let r=t-e;return r?(n-e)/r:1},Dc=class{constructor(){this.subscriptions=[]}add(e){return gc(this.subscriptions,e),()=>this.remove(e)}remove(e){_c(this.subscriptions,e)}notify(e,t,n){let r=this.subscriptions.length;if(r){if(r===1)this.subscriptions[0](e,t,n);else for(let i=0;i<r;i++){let r=this.subscriptions[i];r&&r(e,t,n)}}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}},Oc=e=>e*1e3,kc=e=>e/1e3,Ac=(e,t)=>t?1e3/t*e:0,jc=(e,t,n)=>e*(3*(1-e)*((1-e)*t+e*n)+e*e);function Mc(e,t,n,r){return e===t&&n===r?wc:i=>{let a=0,o=1,s=i;for(let t=0;;t++){s>=a&&s<=o||(s=(a+o)/2);let r=jc(s,e,n)-i;if(r*r<1e-28||t===40)break;r>0?o=s:a=s,s-=r*1e-7/(jc(s+1e-7,e,n)-i-r)}return jc(s,t,r)}}var Nc=e=>t=>t<=.5?e(2*t)/2:(2-e(2*(1-t)))/2,Pc=e=>t=>1-e(1-t),Fc=Mc(.33,1.53,.69,.99),Ic=Pc(Fc),Lc=Nc(Ic),Rc=e=>e>=1?1:(e*=2)<1?.5*Ic(e):.5*(2-2**(-10*(e-1))),zc=e=>1-Math.sin(Math.acos(e)),Bc=Pc(zc),Vc=Nc(zc),Hc=Mc(.42,0,1,1),Uc=Mc(0,0,.58,1),Wc=Mc(.42,0,.58,1),Gc=e=>Array.isArray(e)&&typeof e[0]!=`number`,Kc=e=>Array.isArray(e)&&typeof e[0]==`number`,qc={linear:wc,easeIn:Hc,easeInOut:Wc,easeOut:Uc,circIn:zc,circInOut:Vc,circOut:Bc,backIn:Ic,backInOut:Lc,backOut:Fc,anticipate:Rc},Jc=e=>typeof e==`string`,Yc=e=>{if(Kc(e)){e.length;let[t,n,r,i]=e;return Mc(t,n,r,i)}return Jc(e)?(qc[e],`${e}`,qc[e]):e},X={delta:0,timestamp:0,isProcessing:!1},Xc;function Zc(){Xc=void 0}var Z={now:()=>(Xc===void 0&&Z.set(X.isProcessing||yc.useManualTiming?X.timestamp:performance.now()),Xc),set:e=>{Xc=e,queueMicrotask(Zc)}},Qc=e=>Math.round(e*1e5)/1e5,$c=e=>t=>typeof t==`string`&&t.startsWith(e),el=$c(`--`),tl=$c(`var(--`),nl=e=>tl(e)?rl.test(e.split(`/*`)[0].trim()):!1,rl=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu;function il(e){return typeof e==`string`&&e.split(`/*`)[0].includes(`var(--`)}var al={test:e=>typeof e==`number`,parse:parseFloat,transform:e=>e},ol={...al,transform:e=>vc(0,1,e)},sl={...al,default:1},cl=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;function ll(e){return e==null}var ul=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,dl=(e,t)=>n=>!!(typeof n==`string`&&ul.test(n)&&n.startsWith(e)||t&&!ll(n)&&Object.prototype.hasOwnProperty.call(n,t)),fl=(e,t,n)=>r=>{if(typeof r!=`string`)return r;let[i,a,o,s]=r.match(cl);return{[e]:parseFloat(i),[t]:parseFloat(a),[n]:parseFloat(o),alpha:s===void 0?1:parseFloat(s)}},pl=e=>vc(0,255,e),ml={...al,transform:e=>Math.round(pl(e))},hl={test:dl(`rgb`,`red`),parse:fl(`red`,`green`,`blue`),transform:({red:e,green:t,blue:n,alpha:r=1})=>`rgba(`+ml.transform(e)+`, `+ml.transform(t)+`, `+ml.transform(n)+`, `+Qc(ol.transform(r))+`)`};function gl(e){let t=``,n=``,r=``,i=``;return e.length>5?(t=e.substring(1,3),n=e.substring(3,5),r=e.substring(5,7),i=e.substring(7,9)):(t=e.substring(1,2),n=e.substring(2,3),r=e.substring(3,4),i=e.substring(4,5),t+=t,n+=n,r+=r,i+=i),{red:parseInt(t,16),green:parseInt(n,16),blue:parseInt(r,16),alpha:i?parseInt(i,16)/255:1}}var _l={test:dl(`#`),parse:gl,transform:hl.transform},vl=e=>({test:t=>typeof t==`string`&&t.endsWith(e)&&t.split(` `).length===1,parse:parseFloat,transform:t=>`${t}${e}`}),yl=vl(`deg`),bl=vl(`%`),Q=vl(`px`),xl=vl(`vh`),Sl=vl(`vw`),Cl={...bl,parse:e=>bl.parse(e)/100,transform:e=>bl.transform(e*100)},wl={test:dl(`hsl`,`hue`),parse:fl(`hue`,`saturation`,`lightness`),transform:({hue:e,saturation:t,lightness:n,alpha:r=1})=>`hsla(`+Math.round(e)+`, `+bl.transform(Qc(t))+`, `+bl.transform(Qc(n))+`, `+Qc(ol.transform(r))+`)`},Tl={test:e=>hl.test(e)||_l.test(e)||wl.test(e),parse:e=>hl.test(e)?hl.parse(e):wl.test(e)?wl.parse(e):_l.parse(e),transform:e=>typeof e==`string`?e:e.hasOwnProperty(`red`)?hl.transform(e):wl.transform(e),getAnimatableNone:e=>{let t=Tl.parse(e);return t.alpha=0,Tl.transform(t)}},El=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu,Dl=new RegExp(cl.source),Ol=new RegExp(El.source,`i`);function kl(e){return isNaN(e)&&typeof e==`string`&&(Dl.test(e)||Ol.test(e))}var Al=`number`,jl=`color`,Ml=`var`,Nl=`var(`,Pl="${}",Fl=/var\s*\(\s*--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)|#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\)|-?(?:\d+(?:\.\d+)?|\.\d+)(?![a-z]*\()/giu;function Il(e){let t=e.toString();return Dl.test(t)||Ol.test(t)}function Ll(e){let t=e.toString(),n=[],r={color:[],number:[],var:[]},i=[],a=0;return{values:n,split:t.replace(Fl,e=>(Tl.test(e)?(r.color.push(a),i.push(jl),n.push(Tl.parse(e))):e.startsWith(Nl)?(r.var.push(a),i.push(Ml),n.push(e)):(r.number.push(a),i.push(Al),n.push(parseFloat(e))),++a,Pl)).split(Pl),indexes:r,types:i}}function Rl(e){return Ll(e).values}function zl({split:e,types:t}){let n=e.length;return r=>{let i=``;for(let a=0;a<n;a++)if(i+=e[a],r[a]!==void 0){let e=t[a];i+=e===Al?Qc(r[a]):e===jl?Tl.transform(r[a]):r[a]}return i}}function Bl(e){return zl(Ll(e))}var Vl=e=>typeof e==`number`?0:Tl.test(e)?Tl.getAnimatableNone(e):e,Hl=(e,t)=>typeof e==`number`?t?.trim().endsWith(`/`)?e:0:Vl(e);function Ul(e){let t=Ll(e);return zl(t)(t.values.map((e,n)=>Hl(e,t.split[n])))}var Wl={test:kl,parse:Rl,createTransformer:Bl,getAnimatableNone:Ul};function Gl(e,t,n){return n<0&&(n+=1),n>1&&--n,n<1/6?e+(t-e)*6*n:n<1/2?t:n<2/3?e+(t-e)*(2/3-n)*6:e}function Kl({hue:e,saturation:t,lightness:n,alpha:r}){e/=360,t/=100,n/=100;let i=0,a=0,o=0;if(!t)i=a=o=n;else{let r=n<.5?n*(1+t):n+t-n*t,s=2*n-r;i=Gl(s,r,e+1/3),a=Gl(s,r,e),o=Gl(s,r,e-1/3)}return{red:Math.round(i*255),green:Math.round(a*255),blue:Math.round(o*255),alpha:r}}function ql(e,t){return n=>n>0?t:e}var Jl=(e,t,n)=>e+(t-e)*n,Yl=(e,t,n)=>{let r=e*e,i=n*(t*t-r)+r;return i<0?0:Math.sqrt(i)},Xl=[_l,hl,wl],Zl=e=>Xl.find(t=>t.test(e));function Ql(e){let t=Zl(e);if(!t)return`${e}`,!1;let n=t.parse(e);return t===wl&&(n=Kl(n)),n}var $l=(e,t)=>{let n=Ql(e),r=Ql(t);if(!n||!r)return ql(e,t);let i={...n};return e=>(i.red=Yl(n.red,r.red,e),i.green=Yl(n.green,r.green,e),i.blue=Yl(n.blue,r.blue,e),i.alpha=Jl(n.alpha,r.alpha,e),hl.transform(i))},eu=new Set([`none`,`hidden`]);function tu(e,t){return eu.has(e)?n=>n<=0?e:t:n=>n>=1?t:e}function nu(e,t){return n=>Jl(e,t,n)}function ru(e){return typeof e==`number`?nu:typeof e==`string`?nl(e)?ql:Tl.test(e)?$l:su:Array.isArray(e)?iu:typeof e==`object`?Tl.test(e)?$l:au:ql}function iu(e,t){let n=[...e],r=n.length,i=e.map((e,n)=>ru(e)(e,t[n]));return e=>{for(let t=0;t<r;t++)n[t]=i[t](e);return n}}function au(e,t){let n={...e,...t},r={};for(let i in n)e[i]!==void 0&&t[i]!==void 0&&(r[i]=ru(e[i])(e[i],t[i]));return e=>{for(let t in r)n[t]=r[t](e);return n}}function ou(e,t){let n=[],r={color:0,var:0,number:0};for(let i=0;i<t.values.length;i++){let a=t.types[i],o=e.indexes[a][r[a]],s=e.values[o]??0;n[i]=s,r[a]++}return n}var su=(e,t)=>{let n=Wl.createTransformer(t),r=Ll(e),i=Ll(t);return r.indexes.var.length===i.indexes.var.length&&r.indexes.color.length===i.indexes.color.length&&r.indexes.number.length>=i.indexes.number.length?eu.has(e)&&!i.values.length||eu.has(t)&&!r.values.length?tu(e,t):Tc(iu(ou(r,i),i.values),n):(`${e}${t}`,ql(e,t))},cu=/^(-?(?:\d+(?:\.\d*)?|\.\d+))([a-z%]*)$/iu;function lu(e,t){let n=cu.exec(e);if(!n)return;let r=cu.exec(t);if(!r||n[2]!==r[2])return;let i=n[2],a=parseFloat(n[1]),o=parseFloat(r[1]);return e=>Qc(Jl(a,o,e))+i}function uu(e,t,n){if(typeof e==`number`&&typeof t==`number`&&typeof n==`number`)return Jl(e,t,n);if(typeof e==`string`&&typeof t==`string`){let n=lu(e,t);if(n)return n}return ru(e)(e,t)}var du=[`setup`,`read`,`resolveKeyframes`,`preUpdate`,`update`,`preRender`,`render`,`postRender`];function fu(e){let t=new Set,n=new Set,r=!1,i=!1,a,o=new Set,s={delta:0,timestamp:0,isProcessing:!1};function c(t){o.has(t)&&(n.add(t),e()),(a=t)(s)}let l={schedule:(e,i=!1,s=!1)=>{let c=s&&r,l=c?t:n;return i&&o.add(e),c&&e!==a&&l.delete(e),l.add(e),e},cancel:e=>{n.delete(e),o.delete(e)},process:e=>{if(s=e,r){i=!0;return}r=!0;let o=t;t=n,n=o,t.forEach(c),t.clear(),a=void 0,r=!1,i&&(i=!1,l.process(e))}};return l}var pu=40;function mu(e,t,n={delta:0,timestamp:0,isProcessing:!1}){let r=!1,i=!0,a=()=>r=!0,o=du.reduce((e,t)=>(e[t]=fu(a),e),{}),{setup:s,read:c,resolveKeyframes:l,preUpdate:u,update:d,preRender:f,render:p,postRender:m}=o,h=()=>{let a=yc.useManualTiming,o=a?n.timestamp:performance.now();r=!1,a||(n.delta=i?1e3/60:Math.max(Math.min(o-n.timestamp,pu),1)),n.timestamp=o,n.isProcessing=!0,s.process(n),c.process(n),l.process(n),u.process(n),d.process(n),f.process(n),p.process(n),m.process(n),n.isProcessing=!1,r&&t&&(i=!1,e(h))},g=()=>{r=!0,i=!0,n.isProcessing||e(h)};return{schedule:du.reduce((e,t)=>{let n=o[t];return e[t]=(e,t=!1,i=!1)=>(r||g(),n.schedule(e,t,i)),e},{}),cancel:e=>{for(let t=0;t<du.length;t++)o[du[t]].cancel(e)},state:n,steps:o}}var{schedule:hu,cancel:gu,steps:_u}=mu(typeof requestAnimationFrame<`u`?requestAnimationFrame:wc,!0,X),vu=e=>{let t=({timestamp:t})=>e(t);return{start:(e=!0)=>hu.update(t,e),stop:()=>gu(t),now:()=>X.isProcessing?X.timestamp:Z.now()}},yu=(e,t,n=10)=>{let r=``,i=Math.max(Math.round(t/n),2);for(let t=0;t<i;t++)r+=Math.round(e(t/(i-1))*1e4)/1e4+`, `;return`linear(${r.substring(0,r.length-2)})`},bu=2e4;function xu(e,t=50,n=bu,r){let i=0,a=e.next(i);for(r?.push(a.value);!a.done&&i<n;)i+=t,a=e.next(i),r?.push(a.value);return i>=n?1/0:i}function Su(e,t=100,n){let{keyframes:r,velocity:i}=e,a=r&&r[r.length-1]-r[0],o=n({...e,velocity:i&&a?i*t/a:i,keyframes:[0,t]}),s=Math.min(xu(o),bu);return{type:`keyframes`,ease:e=>o.next(s*e).value/t,duration:kc(s)}}var Cu={stiffness:100,damping:10,mass:1,duration:800,bounce:.3,visualDuration:.3,restSpeed:{granular:.01,default:2},restDelta:{granular:.005,default:.5},minDuration:.01,maxDuration:10,minDamping:.05},wu=e=>e<0?1/Math.max(1+e,Cu.minDamping):Math.max(1-e,Cu.minDamping);function Tu(e,t){if(!(e>1))return 1;let n=Math.sqrt(e*e-1),r=e-n,i=e+n,a=2*n*Math.exp(-t)*(1+t);return Ou(e=>i*Math.exp(-r*e)-r*Math.exp(-i*e)-a,e=>Math.exp(-i*e)-Math.exp(-r*e),t)/t}function Eu(e,t){return e*Math.sqrt(1-t*t)}var Du=12;function Ou(e,t,n){let r=n;for(let n=1;n<Du;n++)r-=e(r)/t(r);return r}var ku=.001;function Au({duration:e=Cu.duration,bounce:t=Cu.bounce}){let n,r;Cu.maxDuration;let i=wu(t);e=vc(Cu.minDuration,Cu.maxDuration,kc(e)),i<1?(n=t=>{let n=t*i,r=n*e,a=Eu(t,i),o=Math.exp(-r);return ku-n/a*o},r=t=>{let r=t*i*e,a=i*i*t*t*e,o=Math.exp(-r),s=Eu(t*t,i);return(-n(t)+ku>0?-1:1)*-a*o/s}):(n=t=>-.001+Math.exp(-t*e)*(t*e+1),r=t=>Math.exp(-t*e)*(-t*(e*e)));let a=5/e,o=Ou(n,r,a),s=o*Tu(i,o*e),c=s*s;return{stiffness:c,damping:i*2*Math.sqrt(c),duration:Oc(e)}}var ju=(e,t)=>(t?e>=0:e>0)&&e<1/0;function Mu(e,t){if(ju(e,t))return e}function Nu(e){let t=Mu(e.stiffness),n=Mu(e.damping,!0),r=Mu(e.mass),i={...e,stiffness:t??Cu.stiffness,damping:n??Cu.damping,mass:r??Cu.mass,isResolvedFromDuration:!1,isTimeDefined:(t??n??r)===void 0&&(e.duration!==void 0||e.bounce!==void 0)};if(i.isTimeDefined){if(e.visualDuration){let t=wu(e.bounce||0),n=2*Math.PI/(e.visualDuration*1.2)*Tu(t,2*Math.PI/1.2);i.stiffness=n*n,i.damping=2*t*Math.sqrt(i.stiffness)}else Object.assign(i,Au(i)),i.isResolvedFromDuration=!0;ju(i.stiffness)&&ju(i.damping,!0)||(i.stiffness=Cu.stiffness,i.damping=Cu.damping)}return i}function Pu(e=Cu.visualDuration,t=Cu.bounce){let n=typeof e==`object`?e:{visualDuration:e,keyframes:[0,1],bounce:t},r=n.keyframes[0],i=n.keyframes[n.keyframes.length-1],a={done:!1,value:r},{stiffness:o,damping:s,mass:c,duration:l,isResolvedFromDuration:u,isTimeDefined:d}=Nu({...n}),f=e=>d?0:-kc(e),p=s/(2*Math.sqrt(o*c)),m=kc(Math.sqrt(o/c)),h=p*m,g={target:i,delta:i-r,velocity:f(n.velocity||0)||0,restSpeed:0,restDelta:0},_=()=>{let e=Math.abs(g.delta)<5;g.restSpeed=n.restSpeed||(e?Cu.restSpeed.granular:Cu.restSpeed.default),g.restDelta=n.restDelta||(e?Cu.restDelta.granular:Cu.restDelta.default)};_();let v,y,b;if(p<1){let e=Eu(m,p),t={A:0,sinC:0,cosC:0,t:-1,env:0,sin:0,cos:0};b=()=>{t.A=(g.velocity+h*g.delta)/e,t.sinC=h*t.A+g.delta*e,t.cosC=h*g.delta-t.A*e};let n=n=>{n!==t.t&&(t.t=n,t.env=Math.exp(-h*n),t.sin=Math.sin(e*n),t.cos=Math.cos(e*n))};v=e=>(n(e),g.target-t.env*(t.A*t.sin+g.delta*t.cos)),y=e=>(n(e),t.env*(t.sinC*t.sin+t.cosC*t.cos))}else if(p===1){v=e=>g.target-Math.exp(-m*e)*(g.delta+(g.velocity+m*g.delta)*e);let e={C:0};b=()=>{e.C=g.velocity+m*g.delta},y=t=>Math.exp(-m*t)*(m*e.C*t-g.velocity)}else{let e=m*Math.sqrt(p*p-1),t=h-e,n=h+e,r=d?1/0:300/e,i=(e,t)=>Math.exp(t>r?-e*r-h*(t-r):-e*t),a={S:0,F:0};b=()=>{let t=(g.velocity+h*g.delta)/e;a.S=(g.delta+t)/2,a.F=(g.delta-t)/2},v=e=>g.target-a.S*i(t,e)-a.F*i(n,e),y=e=>t*a.S*i(t,e)+n*a.F*i(n,e)}b();let x=u&&l||null,S={calculatedDuration:x,retarget:(e,t)=>{g.target=e[e.length-1],g.delta=g.target-e[0],g.velocity=f(t),n.restSpeed&&n.restDelta||_(),S.calculatedDuration=x,a.done=!1,b()},velocity:e=>Oc(y(e)),next:e=>{let t=v(e);if(u)a.done=e>=l;else{let n=Oc(y(e));a.done=Math.abs(n)<=g.restSpeed&&Math.abs(g.target-t)<=g.restDelta}return a.value=a.done?g.target:t,a},toString:()=>{let e=Math.min(xu(S),bu),t=yu(t=>S.next(e*t).value,e,30);return e+`ms `+t},toTransition:()=>{}};return S}var Fu=Object.assign(Pu,{applyToOptions:e=>{let t=Su(e,100,Pu);return e.ease=t.ease,e.duration=Oc(t.duration),e.type=`keyframes`,e}});function Iu({keyframes:e,velocity:t=0,power:n=.8,timeConstant:r=325,bounceDamping:i=10,bounceStiffness:a=500,modifyTarget:o,min:s,max:c,restDelta:l=.5,restSpeed:u}){let d=e[0],f={done:!1,value:d},p=e=>e<s||e>c,m=e=>s===void 0?c:c===void 0||Math.abs(s-e)<Math.abs(c-e)?s:c,h=n*t,g=d+h,_=o===void 0?g:o(g);_!==g&&(h=_-d);let v=e=>-h*Math.exp(-e/r),y=e=>{let t=v(e);f.done=Math.abs(t)<=l,f.value=f.done?_:_+t},b,x,S=e=>{p(f.value)&&(b=e,x=Fu({keyframes:[f.value,m(f.value)],velocity:-v(e)/r*1e3,damping:i,stiffness:a,restDelta:l,restSpeed:u}))};return S(0),{calculatedDuration:null,next:e=>{let t=!1;return!x&&b===void 0&&(t=!0,y(e),S(e)),b!==void 0&&e>=b?x.next(e-b):(!t&&y(e),f)}}}function Lu(e,t,n){let r=[],i=n||yc.mix||uu,a=e.length-1;for(let n=0;n<a;n++){let a=i(e[n],e[n+1]);t&&(a=Tc(Array.isArray(t)?t[n]||wc:t,a)),r.push(a)}return r}function Ru(e,t,{clamp:n=!0,ease:r,mixer:i}={}){let a=e.length;if(t.length,a===1)return()=>t[0];if(a===2&&t[0]===t[1])return()=>t[1];let o=e[0]===e[1];e[0]>e[a-1]&&(e=[...e].reverse(),t=[...t].reverse());let s=Lu(t,r,i),c=s.length,l=n=>{if(o&&n<e[0])return t[0];let r=0;if(c>1)for(;r<e.length-2&&!(n<e[r+1]);r++);let i=Ec(e[r],e[r+1],n);return s[r](i)};return n?t=>l(vc(e[0],e[a-1],t)):l}function zu(e,t){let n=e[e.length-1];for(let r=1;r<=t;r++){let i=Ec(0,t,r);e.push(Jl(n,1,i))}}function Bu(e){let t=[0];return zu(t,e.length-1),t}function Vu(e,t){return e.map(e=>e*t)}function Hu(e,t){return e.map(()=>t||Wc).splice(0,e.length-1)}function Uu({duration:e=300,keyframes:t,times:n,ease:r=`easeInOut`}){let i=Gc(r)?r.map(Yc):Yc(r)||Wc,a={done:!1,value:t[0]};if(t.length===2&&!Array.isArray(i)&&(!n||n.length!==2||n[0]===0&&n[1]===1)){let[n,r]=t,o=n===r?void 0:(yc.mix||uu)(n,r);return{calculatedDuration:e,next:t=>(a.value=o?o(i(e>0?vc(0,1,t/e):1)):r,a.done=t>=e,a)}}let o=Ru(Vu(n&&n.length===t.length?n:Bu(t),e),t,{ease:Array.isArray(i)?i:Hu(t,i)});return{calculatedDuration:e,next:t=>(a.value=o(t),a.done=t>=e,a)}}var Wu=5;function Gu(e,t,n){let r=Math.max(t-Wu,0);return Ac(n-e(r),t-r)}function Ku(e,t,n=0){return t<=0?n:e.velocity?e.velocity(t):Gu(t=>e.next(t).value,t,e.next(t).value)}var qu=e=>e!==null;function Ju(e,{repeat:t,repeatType:n=`loop`},r,i=1){let a=e.filter(qu),o=i<0||t&&n!==`loop`&&t%2==1?0:a.length-1;return!o||r===void 0?a[o]:r}var Yu={decay:Iu,inertia:Iu,tween:Uu,keyframes:Uu,spring:Fu};function Xu(e){typeof e.type==`string`&&(e.type=Yu[e.type])}var Zu=40,Qu=(e,t)=>t-e>Zu&&!yc.useManualTiming?t:e;function $u(e,t){return{kind:e,animation:t,timestamp:Z.now(),frameTimestamp:X.timestamp,frameIsProcessing:X.isProcessing}}function ed(e,t,n){let r=globalThis.__MOTION_INSPECT__;if(r)try{r({...$u(`animation-start`,e),options:n?{...t,...n}:t})}catch{}}function td(e,t){let n=globalThis.__MOTION_INSPECT__;if(n)try{n({...$u(`layout-animation-start`,e),node:t})}catch{}}var nd=class{constructor(){this.isResolved=!1}get finished(){return this._finished||=this.isResolved?Promise.resolve():new Promise(e=>{this._resolve=e}),this._finished}updateFinished(){this._finished=this._resolve=void 0,this.isResolved=!1}notifyFinished(){this.isResolved=!0,this._resolve?.()}then(e,t){return this.finished.then(e,t)}},rd=e=>e/100,id=e=>Math.round(e*1e4)/1e4,ad=class extends nd{constructor(e){super(),this.state=`idle`,this.startTime=null,this.isStopped=!1,this.currentTime=0,this.holdTime=null,this.playbackSpeed=1,this.delayState={done:!1,value:void 0},this.stop=()=>{let{motionValue:e}=this.options;e&&e.updatedAt!==Z.now()&&this.tick(Z.now()),this.isStopped=!0,this.state!==`idle`&&(this.teardown(),this.options.onStop?.())},this.options=e,this.initAnimation(),this.play(),e.autoplay===!1&&this.pause(),ed(this,this.options)}initAnimation(){let{options:e}=this;Xu(e);let{type:t=Uu,repeat:n=0,repeatDelay:r=0,repeatType:i,velocity:a=0}=e,{keyframes:o}=e,s=t||Uu;s!==Uu&&typeof o[0]!=`number`&&(this.mixKeyframes=Tc(rd,uu(o[0],o[1])),o=[0,100]);let c=s(o===e.keyframes?e:{...e,keyframes:o});i===`mirror`&&(this.mirroredGenerator=s({...e,keyframes:[...o].reverse(),velocity:-a})),c.calculatedDuration===null&&(c.calculatedDuration=xu(c));let{calculatedDuration:l}=c;this.calculatedDuration=l,this.resolvedDuration=l+r,this.totalDuration=this.resolvedDuration*(n+1)-r,this.generator=c}updateTime(e){let t=Math.round(e-this.startTime)*this.playbackSpeed;this.currentTime=this.holdTime===null?t:this.holdTime}tick(e,t=!1){let{generator:n,totalDuration:r,calculatedDuration:i}=this;if(this.startTime===null)return n.next(0);let{delay:a=0,keyframes:o,type:s,onUpdate:c,finalKeyframe:l}=this.options;this.startTime===this.pendingStartTime&&(this.startTime=Qu(this.startTime,e)),this.pendingStartTime=void 0,this.speed>0?this.startTime=Math.min(this.startTime,e):this.speed<0&&(this.startTime=Math.min(e-r/this.speed,this.startTime)),t?this.currentTime=e:this.updateTime(e);let u=this.currentTime-a*(this.playbackSpeed>=0?1:-1),d=this.playbackSpeed>=0?u<0:u>r;this.currentTime=Math.max(u,0),this.state===`finished`&&this.holdTime===null&&(this.currentTime=r);let f=this.generate(this.currentTime,d),{done:p}=f;!d&&i!==null&&(p=this.playbackSpeed>=0?this.currentTime>=r:this.currentTime<=0);let m=this.holdTime===null&&(this.state===`finished`||this.state===`running`&&p);return m&&s!==Iu&&(f.value=Ju(o,this.options,l,this.speed)),c&&c(f.value),m&&this.finish(),f}at(e){return this.holdTime??id((e-this.startTime)*this.playbackSpeed)}sampleAt(e,t){let{options:n,totalDuration:r}=this,i=this.at(e)-(n.delay||0);return i>=r&&n.type!==Iu?Ju(n.keyframes,n,t?void 0:n.finalKeyframe):this.generate(Math.max(i,0),i<0).value}generate(e,t){let{generator:n,totalDuration:r,mixKeyframes:i,mirroredGenerator:a,resolvedDuration:o}=this,{keyframes:s,repeat:c,repeatType:l,repeatDelay:u}=this.options,d=e,f=n;if(c){let t=Math.min(e,r)/o,n=Math.floor(t),i=t%1;!i&&t>=1&&(i=1),i===1&&n--,n=Math.min(n,c+1),n%2&&(l===`reverse`?(i=1-i,u&&(i-=u/o)):l===`mirror`&&(f=a)),d=vc(0,1,i)*o}let p;return t?(this.delayState.value=s[0],p=this.delayState):p=f.next(d),i&&!t&&(p.value=i(p.value)),p}then(e,t){return this.finished.then(e,t)}get duration(){return kc(this.calculatedDuration)}get iterationDuration(){let{delay:e=0}=this.options||{};return this.duration+kc(e)}get time(){return kc(this.currentTime)}set time(e){e=Oc(e),this.currentTime=e,this.startTime===null||this.holdTime!==null||this.playbackSpeed===0?this.holdTime=e:this.driver&&(this.startTime=this.driver.now()-e/this.playbackSpeed),this.driver?this.driver.start(!1):(this.startTime=0,this.state=`paused`,this.holdTime=e,this.tick(e))}getGeneratorVelocity(){return Ku(this.generator,this.currentTime,this.options.velocity)}get speed(){return this.playbackSpeed}set speed(e){let t=this.playbackSpeed!==e;t&&this.driver&&this.updateTime(Z.now()),this.playbackSpeed=e,t&&this.driver&&(this.time=kc(this.currentTime))}play(){if(this.isStopped)return;let{driver:e=vu,startTime:t}=this.options;this.driver||=e(e=>this.tick(e)),this.options.onPlay?.();let n=this.driver.now();this.state===`finished`?(this.updateFinished(),this.startTime=n):this.holdTime===null?this.startTime||=t??(this.pendingStartTime=n):this.startTime=n-this.holdTime/(this.playbackSpeed||1),this.state===`finished`&&this.speed<0&&(this.startTime+=this.calculatedDuration),this.holdTime=null,this.state=`running`,this.driver.start()}pause(){this.state=`paused`,this.updateTime(Z.now()),this.holdTime=this.currentTime}complete(){this.state!==`running`&&this.play(),this.state=`finished`,this.holdTime=null}finish(){this.notifyFinished(),this.teardown(),this.state=`finished`,this.options.onComplete?.()}cancel(){this.holdTime=null,this.startTime=0,this.tick(0),this.teardown(),this.options.onCancel?.()}teardown(){this.state=`idle`,this.stopDriver(),this.startTime=this.holdTime=null}stopDriver(){this.driver&&=(this.driver.stop(),void 0)}sample(e){return this.startTime=0,this.tick(e,!0)}attachTimeline(e){return this.options.allowFlatten&&(this.options.type=`keyframes`,this.options.ease=`linear`,this.initAnimation()),this.driver?.stop(),e.observe(this)}},od=new Set([`brightness`,`contrast`,`saturate`,`opacity`]);function sd(e){let[t,n]=e.slice(0,-1).split(`(`);if(t===`drop-shadow`)return e;let[r]=n.match(cl)||[];if(!r)return e;let i=n.replace(r,``),a=+!!od.has(t);return r!==n&&(a*=100),t+`(`+a+i+`)`}var cd=/\b([a-z-]*)\(.*?\)/gu,ld={...Wl,getAnimatableNone:e=>{let t=e.match(cd);return t?t.map(sd).join(` `):e}},ud={...Wl,getAnimatableNone:e=>{let t=Wl.parse(e);return Wl.createTransformer(e)(t.map(e=>typeof e==`number`?0:typeof e==`object`?{...e,alpha:1}:e))}},dd={...al,transform:Math.round},fd={borderWidth:Q,borderTopWidth:Q,borderRightWidth:Q,borderBottomWidth:Q,borderLeftWidth:Q,borderRadius:Q,borderTopLeftRadius:Q,borderTopRightRadius:Q,borderBottomRightRadius:Q,borderBottomLeftRadius:Q,width:Q,maxWidth:Q,height:Q,maxHeight:Q,top:Q,right:Q,bottom:Q,left:Q,inset:Q,insetBlock:Q,insetBlockStart:Q,insetBlockEnd:Q,insetInline:Q,insetInlineStart:Q,insetInlineEnd:Q,padding:Q,paddingTop:Q,paddingRight:Q,paddingBottom:Q,paddingLeft:Q,paddingBlock:Q,paddingBlockStart:Q,paddingBlockEnd:Q,paddingInline:Q,paddingInlineStart:Q,paddingInlineEnd:Q,margin:Q,marginTop:Q,marginRight:Q,marginBottom:Q,marginLeft:Q,marginBlock:Q,marginBlockStart:Q,marginBlockEnd:Q,marginInline:Q,marginInlineStart:Q,marginInlineEnd:Q,fontSize:Q,backgroundPositionX:Q,backgroundPositionY:Q,rotate:yl,pathRotation:yl,rotateX:yl,rotateY:yl,rotateZ:yl,scale:sl,scaleX:sl,scaleY:sl,scaleZ:sl,skew:yl,skewX:yl,skewY:yl,distance:Q,translateX:Q,translateY:Q,translateZ:Q,x:Q,y:Q,z:Q,perspective:Q,transformPerspective:Q,opacity:ol,originX:Cl,originY:Cl,originZ:Q,zIndex:dd,fillOpacity:ol,strokeOpacity:ol,numOctaves:dd},pd={...fd,color:Tl,backgroundColor:Tl,outlineColor:Tl,fill:Tl,stroke:Tl,borderColor:Tl,borderTopColor:Tl,borderRightColor:Tl,borderBottomColor:Tl,borderLeftColor:Tl,filter:ld,WebkitFilter:ld,mask:ud,WebkitMask:ud},md=e=>pd[e],hd=new Set([ld,ud]);function gd(e,t){let n=md(e);return hd.has(n)||(n=Wl),n.getAnimatableNone?n.getAnimatableNone(t):void 0}function _d(e){for(let t=1;t<e.length;t++)e[t]??(e[t]=e[t-1])}var vd=e=>e*180/Math.PI,$=e=>bd(vd(Math.atan2(e[1],e[0]))),yd={x:4,y:5,translateX:4,translateY:5,scaleX:0,scaleY:3,scaleZ:()=>1,scale:e=>(Math.abs(e[0])+Math.abs(e[3]))/2,rotate:$,rotateZ:$,skewX:e=>vd(Math.atan(e[1])),skewY:e=>vd(Math.atan(e[2])),skew:e=>(Math.abs(e[1])+Math.abs(e[2]))/2},bd=e=>(e%=360,e<0&&(e+=360),e),xd=$,Sd=e=>Math.hypot(e[0],e[1]),Cd=e=>Math.hypot(e[4],e[5]),wd={x:12,y:13,z:14,translateX:12,translateY:13,translateZ:14,scaleX:Sd,scaleY:Cd,scaleZ:e=>Math.hypot(e[8],e[9],e[10]),scale:e=>(Sd(e)+Cd(e))/2,rotateX:e=>bd(vd(Math.atan2(e[6],e[5]))),rotateY:e=>bd(vd(Math.atan2(-e[2],e[0]))),rotateZ:xd,rotate:xd,skewX:e=>vd(Math.atan(e[4])),skewY:e=>vd(Math.atan(e[1])),skew:e=>(Math.abs(e[1])+Math.abs(e[4]))/2};function Td(e){return+!!e.includes(`scale`)}function Ed(e,t){if(!e||e===`none`)return Td(t);let n=e.match(/^matrix3d\(([-\d.e\s,]+)\)$/u),r,i;if(n)r=wd,i=n;else{let t=e.match(/^matrix\(([-\d.e\s,]+)\)$/u);r=yd,i=t}if(!i)return Td(t);let a=r[t],o=i[1].split(`,`).map(Od);return typeof a==`function`?a(o):o[a]}var Dd=(e,t)=>{let{transform:n=`none`}=getComputedStyle(e);return Ed(n,t)};function Od(e){return parseFloat(e.trim())}var kd=[`transformPerspective`,`x`,`y`,`z`,`translateX`,`translateY`,`translateZ`,`scale`,`scaleX`,`scaleY`,`scaleZ`,`rotate`,`rotateX`,`rotateY`,`rotateZ`,`skew`,`skewX`,`skewY`],Ad=new Set([...kd,`pathRotation`]),jd=e=>e===al||e===Q,Md=new Set([`x`,`y`,`z`]),Nd=kd.filter(e=>!Md.has(e));function Pd(e){let t=[];return Nd.forEach(n=>{let r=e.getValue(n);if(r!==void 0){let e=r.get(),i=+!!n.startsWith(`scale`);if(e===i)return;t.push([n,e]),r.set(i)}}),t}var Fd=new Set([`bottom`,`right`]);function Id(e,t,n,r,i,a){let o=parseFloat(e);if(!isNaN(o))return o;let{min:s,max:c}=t()[n],l=c-s;return a===`border-box`?l:l-parseFloat(r)-parseFloat(i)}var Ld=({transform:e})=>Ed(e,`x`),Rd=({transform:e})=>Ed(e,`y`),zd={width:({width:e,paddingLeft:t=`0`,paddingRight:n=`0`,boxSizing:r},i)=>Id(e,i,`x`,t,n,r),height:({height:e,paddingTop:t=`0`,paddingBottom:n=`0`,boxSizing:r},i)=>Id(e,i,`y`,t,n,r),top:({top:e})=>parseFloat(e),left:({left:e})=>parseFloat(e),bottom:({top:e},t)=>{let{y:n}=t();return parseFloat(e)+(n.max-n.min)},right:({left:e},t)=>{let{x:n}=t();return parseFloat(e)+(n.max-n.min)},x:Ld,y:Rd,translateX:Ld,translateY:Rd},Bd=new Set,Vd=!1,Hd=!1,Ud=!1;function Wd(){if(Hd){let e=[],t=new Set,n=new Set;Bd.forEach(r=>{r.needsMeasurement&&(e.push(r),t.add(r.element),Fd.has(r.name)&&n.add(r.element))});let r=new Map;n.forEach(e=>{let t=Pd(e);t.length&&(r.set(e,t),e.render())}),e.forEach(e=>e.measureInitialState()),t.forEach(e=>{e.render();let t=r.get(e);t&&t.forEach(([t,n])=>{e.getValue(t)?.set(n)})}),e.forEach(e=>e.measureEndState()),e.forEach(e=>{e.suspendedScrollY!==void 0&&window.scrollTo(0,e.suspendedScrollY)})}Hd=!1,Vd=!1,Bd.forEach(e=>e.complete(Ud)),Bd.clear()}function Gd(){Bd.forEach(e=>{e.readKeyframes(),e.needsMeasurement&&(Hd=!0)})}function Kd(){Ud=!0,Gd(),Wd(),Ud=!1}function qd(e,t,n){if(typeof e==`string`){if(bc(e)||Sc(e))return parseFloat(e);if(!Wl.test(e)&&Wl.test(n))return gd(t,n)}return e??void 0}var Jd=class{constructor(e,t,n,r,i,a=!1){this.state=`pending`,this.isAsync=!1,this.needsMeasurement=!1,this.unresolvedKeyframes=[...e],this.onComplete=t,this.name=n,this.motionValue=r,this.element=i,this.isAsync=a}scheduleResolve(){this.state=`scheduled`,this.isAsync?(Bd.add(this),Vd||(Vd=!0,hu.read(Gd),hu.resolveKeyframes(Wd))):(this.readKeyframes(),this.complete())}readKeyframes(){let{unresolvedKeyframes:e,name:t,element:n,motionValue:r}=this;if(e[0]===null){let i=r?.get(),a=e[e.length-1];if(i!==void 0)e[0]=i;else if(n&&t){let r=qd(n.readValue(t,a),t,a);r!==void 0&&(e[0]=r)}e[0]===void 0&&(e[0]=a),r&&i===void 0&&r.set(e[0])}_d(e)}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(e=!1){this.state=`complete`,this.onComplete(this.unresolvedKeyframes,this.finalKeyframe,e),Bd.delete(this)}cancel(){this.state===`scheduled`&&(Bd.delete(this),this.state=`pending`)}resume(){this.state===`pending`&&this.scheduleResolve()}},Yd=e=>e.startsWith(`--`);function Xd(e,t,n){Yd(t)?e.style.setProperty(t,n):e.style[t]=n}var Zd={};function Qd(e,t){let n=Cc(e);return()=>Zd[t]??n()}var $d=Qd(()=>window.ScrollTimeline!==void 0,`scrollTimeline`),ef=Qd(()=>{try{document.createElement(`div`).animate({opacity:0},{easing:`linear(0, 1)`})}catch{return!1}return!0},`linearEasing`),tf=([e,t,n,r])=>`cubic-bezier(${e}, ${t}, ${n}, ${r})`,nf={linear:`linear`,ease:`ease`,easeIn:`ease-in`,easeOut:`ease-out`,easeInOut:`ease-in-out`,circIn:tf([0,.65,.55,1]),circOut:tf([.55,0,1,.45]),backIn:tf([.31,.01,.66,-.59]),backOut:tf([.33,1.53,.69,.99])};function rf(e,t){if(e)return typeof e==`function`?ef()?yu(e,t):`ease-out`:Kc(e)?tf(e):Array.isArray(e)?e.map(e=>rf(e,t)||nf.easeOut):nf[e]}function af(e,t,n,{delay:r=0,duration:i=300,repeat:a=0,repeatType:o=`loop`,ease:s=`easeOut`,times:c}={},l=void 0){let u={[t]:n};c&&(u.offset=c);let d=rf(s,i);Array.isArray(d)&&(u.easing=d);let f={delay:r,duration:i,easing:Array.isArray(d)?`linear`:d,fill:`both`,iterations:a+1,direction:o===`reverse`?`alternate`:`normal`};return l&&(f.pseudoElement=l),e.animate(u,f)}function of(e){return typeof e==`function`&&`applyToOptions`in e}function sf({type:e,...t}){return of(e)&&ef()?e.applyToOptions(t):(t.duration??=300,t.ease??=`easeOut`,t)}var cf=class extends nd{constructor(e){if(super(),this.finishedTime=null,this.isStopped=!1,this.manualStartTime=null,!e)return;let{element:t,name:n,keyframes:r,pseudoElement:i,allowFlatten:a=!1,finalKeyframe:o,onComplete:s}=e;this.isPseudoElement=!!i,this.allowFlatten=a,this.options=e,e.type;let c=sf(e);this.animation=af(t,n,r,c,i),c.autoplay===!1&&this.animation.pause(),this.animation.onfinish=()=>{if(this.finishedTime=this.time,!i){let e=Ju(r,this.options,o,this.speed);this.updateMotionValue&&this.updateMotionValue(e),Xd(t,n,e),this.animation.cancel()}s?.(),this.notifyFinished()},ed(this,e,c)}play(){this.isStopped||(this.manualStartTime=null,this.animation.play(),this.state===`finished`&&this.updateFinished())}pause(){this.animation.pause()}complete(){this.animation.finish?.()}cancel(){try{this.animation.cancel()}catch{}}stop(){this.isStopped||(this.isStopped=!0,this.state!==`idle`&&this.finishedTime===null&&(this.updateMotionValue?this.updateMotionValue():this.commitStyles(),this.isPseudoElement||(this.animation.onfinish=null,this.cancel())))}commitStyles(){let e=this.options?.element;!this.isPseudoElement&&e?.isConnected&&this.animation.commitStyles?.()}get duration(){let e=this.animation.effect?.getComputedTiming?.().duration||0;return kc(Number(e))}get iterationDuration(){let{delay:e=0}=this.options||{};return this.duration+kc(e)}get time(){return kc(Number(this.animation.currentTime)||0)}set time(e){let t=this.finishedTime!==null;this.manualStartTime=null,this.finishedTime=null,this.animation.currentTime=Oc(e),t&&this.animation.pause()}get speed(){return this.animation.playbackRate}set speed(e){e<0&&(this.finishedTime=null),this.animation.playbackRate=e}get state(){return this.finishedTime===null?this.animation.playState:`finished`}get startTime(){return this.manualStartTime??Number(this.animation.startTime)}set startTime(e){this.manualStartTime=this.animation.startTime=e}attachTimeline({timeline:e,onAttach:t,observe:n}){return this.allowFlatten&&this.animation.effect?.updateTiming({easing:`linear`}),this.animation.onfinish=null,e&&$d()?(this.animation.timeline=e,t?.(this.animation),wc):n(this)}},lf={anticipate:Rc,backInOut:Lc,circInOut:Vc};function uf(e){return e in lf}function df(e){typeof e.ease==`string`&&uf(e.ease)&&(e.ease=lf[e.ease])}var ff=class extends cf{constructor(e){df(e),Xu(e),super(e),e.startTime!==void 0&&e.autoplay!==!1&&(this.startTime=e.startTime),this.options=e}elapsed(){return this.state===`running`?(Z.now()-this.startTime)*this.speed:this.time*1e3}sample(e){if(!this.sampler){let{motionValue:e,onUpdate:t,onComplete:n,onPlay:r,onStop:i,element:a,...o}=this.options;this.sampler=new ad({...o,autoplay:!1}),this.sampler.stop()}return this.sampler.sample(Math.max(0,e)).value}liveValue(){let{state:e}=this;if(e===`running`||e===`paused`)return this.sample(this.elapsed())}updateMotionValue(e){let{motionValue:t,element:n,name:r}=this.options;if(!t)return;if(e!==void 0){t.set(e);return}let{speed:i}=this,a=this.elapsed(),o=this.state===`running`&&i?vc(0,10,a):0,s=this.sample(a);n&&r&&Xd(n,r,s),t.setWithVelocity(this.sample(a-o*Math.sign(i)),s,o/Math.abs(i||1))}},pf=(e,t)=>t!==`zIndex`&&!!(typeof e==`number`||Array.isArray(e)||typeof e==`string`&&(Wl.test(e)||e===`0`)&&!e.startsWith(`url(`));function mf(e){let t=e[0];if(e.length===1)return!0;for(let n=0;n<e.length;n++)if(e[n]!==t)return!0}function hf(e,t,n,r){let i=e[0];if(i===null)return!1;if(t===`display`||t===`visibility`)return!0;let a=e[e.length-1],o=pf(i,t),s=pf(a,t);return!o||!s?(o!==s&&`${t}${i}${a}${o?a:i}`,!1):mf(e)||(n===`spring`||of(n))&&r}function gf(e){e.duration=0,e.type=`keyframes`}var _f=new Set([`opacity`,`clipPath`,`filter`,`transform`,`backgroundColor`]),vf=/^(?:oklch|oklab|lab|lch|color|color-mix|light-dark)\(/;function yf(e){for(let t=0;t<e.length;t++)if(typeof e[t]==`string`&&vf.test(e[t]))return!0;return!1}var bf=new Set([`color`,`backgroundColor`,`outlineColor`,`fill`,`stroke`,`borderColor`,`borderTopColor`,`borderRightColor`,`borderBottomColor`,`borderLeftColor`]),xf=()=>!yc.useManualTiming&&Object.hasOwnProperty.call(Element.prototype,`animate`);function Sf(e){let{motionValue:t,name:n,repeatDelay:r,repeatType:i,damping:a,type:o,keyframes:s}=e;if(!n||!(_f.has(n)||bf.has(n)))return!1;let c=t?.owner?.current;if(!(c instanceof HTMLElement)&&!(c instanceof SVGElement))return!1;let{onUpdate:l,transformTemplate:u}=t.owner.getProps();return xf()&&(_f.has(n)||bf.has(n)&&yf(s))&&(n!==`transform`||!u)&&!l&&!r&&i!==`mirror`&&a!==0&&o!==`inertia`}var Cf=(e,t)=>t&&typeof e==`number`?t.transform(e):e,wf={x:`translateX`,y:`translateY`,z:`translateZ`,transformPerspective:`perspective`},Tf=kd.length;function Ef(e,t,n){let r=``,i=!0;for(let a=0;a<Tf;a++){let o=kd[a],s=e[o];if(s===void 0)continue;let c=!0;if(typeof s==`number`)c=s===+!!o.startsWith(`scale`);else{let e=parseFloat(s);c=o.startsWith(`scale`)?e===1:e===0}if(!c||n){let e=Cf(s,fd[o]);if(!c){i=!1;let t=wf[o]||o;r+=`${t}(${e}) `}n&&(t[o]=e)}}let a=e.pathRotation;return a&&(i=!1,r+=`rotate(${Cf(a,fd.pathRotation)}) `),r=r.trim(),n?r=n(t,i?``:r):i&&(r=`none`),r}var Df=new WeakMap,Of=200,kf=.001,Af=.1,jf=.001,Mf=100,Nf=e=>/^(linear|ease(In|Out|InOut))$/.test(e),Pf=(e,t)=>e-t,Ff=(e,t,n)=>{let r=[];for(let i=0;i<=n;i++)r.push(Jl(e,t,i/n));return r},If=e=>e.motionValue.owner,Lf=e=>Df.get(e),Rf=(e,t)=>e.latestValues?e.latestValues[t]:e.getValue(t)?.get(),zf=({name:e,motionValue:t})=>e&&kd.includes(e)&&t?.owner?.current instanceof HTMLElement&&xf()&&ef();function Bf(e){let t=If(e),{onUpdate:n,transformTemplate:r}=t.getProps();return!e.isHandoff&&!n&&!e.hasOnUpdate&&!r&&e.type!==`inertia`&&(Rf(t,`transform`)||`none`)===`none`&&!Rf(t,`pathRotation`)&&!t.projection?.isProjecting()}var Vf=class extends ad{constructor(e){let t=If(e).current,{driver:n=vu}=e,r,i=Bf(e);e.driver=e=>{let i=n(e);return{js:i,now:i.now,start:(e=!0)=>{let n=Lf(t);!n||n.isJS?i.start(e):n.schedule(!1,!e)},stop:()=>{i.stop();let e=Lf(t);e&&!e.isFinishing&&e.release(r)}}},super(e),r=this,this.canAccelerate=i;let{stop:a}=this;this.stop=()=>{this.isAccelerated()&&this.sync(),a()}}get group(){return Lf(If(this.options).current)}get js(){return this.driver?.js}get name(){return this.options.name}timing(){let{startTime:e,speed:t,totalDuration:n}=this,{delay:r=0,repeatType:i}=this.options;return this.holdTime===null?n===1/0?[e+r/t,this.resolvedDuration*(i===`loop`?1:2)/t||1]:[e+(r+n)/t,0]:[1/0,0]}isAccelerated(){let{group:e,state:t}=this;return e?.tracks.has(this)&&!e.isJS&&this.canAccelerate&&(t===`running`||t===`paused`)}liveValue(){return this.isAccelerated()?this.sampleAt(Z.now()):void 0}tween(){let{keyframes:e,type:t,ease:n,times:r,repeat:i,delay:a=0}=this.options,o=Kc(n)?tf(n):Nf(n)&&nf[n];if(o&&!i&&!r&&e.length===2&&t===Uu&&this.holdTime===null){let e=this.startTime+a/this.speed;return[e,e+this.resolvedDuration/this.speed,o]}}boundaries(e,t){let{startTime:n,speed:r,resolvedDuration:i,options:a}=this,{delay:o=0,repeat:s=0,repeatDelay:c=0,repeatType:l,times:u,keyframes:d,type:f}=a,p=(f||Uu)===Uu?u||Bu(d):[0,1],m=n+o/r,h=[];if(this.holdTime!==null||!(i>0))return h;for(let n=Math.max(0,Math.floor((e-m)*r/i));n<=s;n++){let a=m+n*i/r;if(a>t)break;for(let o of p){let s=a+(n%2&&l&&l!==`loop`?1-o:o)*(i-c)/r;s>e&&s<t&&h.push(s)}}return h}numberAt(e){return parseFloat(this.sampleAt(e,!0))}sync(){let e=Z.now();this.options.motionValue.setWithVelocity(this.sampleAt(e-10,!0),this.sampleAt(e,!0),10)}play(){this.isStopped||((this.group||Hf(If(this.options))).tracks.add(this),super.play())}pause(){super.pause(),this.isAccelerated()&&(this.sync(),this.group.schedule(!1))}complete(){super.complete();let{group:e}=this;e&&!e.isJS&&this.canAccelerate&&this.tick(Z.now())}get time(){return this.isAccelerated()?kc(vc(0,this.totalDuration,this.at(Z.now())-(this.options.delay||0))):super.time}set time(e){super.time=e,this.isAccelerated()&&this.sync()}attachTimeline(e){return this.canAccelerate=!1,this.group?.demote(!0),super.attachTimeline(e)}};function Hf(e){let t=e.current,n=new Set,r=new Map,i={},a=[],o=new Map,s=[],c=!1,l=!1,u=!1,d=!1,f=-1/0,p=e=>{for(let t of n)if(t.name===e)return!0},m=(t,n)=>{let o={};for(let s of t===void 0?kd:a){let a=r.get(s),c=t===void 0?Rf(e,s):a?a.sampleAt(n>t&&!a.timing()[1]?n:t):i[s];c!==void 0&&(o[s]=c)}return o},h=(e,t)=>{let n=``,r=m(e,t);for(let e in r)n+=(wf[e]||e)+`(`+Cf(r[e],fd[e])+`) `;return n||`none`},g=(e=m())=>{t.style.transform=Ef(e,{})},_=(e=!0)=>{e&&g(),s.forEach(({animation:e})=>e.cancel()),s=[]},v=(e,t,n=1/0)=>{let r={animation:e,offset:t,end:n};e.startTime=Z.now()+t,n<1/0&&(e.onfinish=()=>{r.isDone=!0,s.some(e=>e.end===1/0)&&(e.cancel(),s=s.filter(e=>e!==r)),O.schedule(!1)}),e.oncancel=()=>s.includes(r)&&O.demote(),s.push(r)},y=(e,t,n)=>{let r=(t,n)=>Math.abs(e(n)-e(t)),i=r(t,n);for(;n-t>.01;){let e=(t+n)/2;r(t,e)>r(e,n)?n=e:t=e}return r(t,n)>i/2?[t,n]:[]},b=(e,t,n,r)=>{let i=Math.min(Of,Math.max(2,Math.ceil((n-t)/10)));if(r.length*4>i)return;let a=Ff(t,n,i).concat(r).sort(Pf),o=e=>Ec(t,n,e),s,c;for(let t of e){let e=a.map(e=>t.numberAt(e)),[n]=e,r=e.map(e=>e-n),i=r[r.length-1],o=r.some(e=>Math.abs(e)*kf>Math.abs(i))?0:i,l=r.map(e=>o?e/o:e);if(!o){if(l.some(e=>!(Math.abs(e)<=kf)))return}else if(!s)s=l,c=e=>(t.numberAt(e)-n)/o;else if(l.some((e,t)=>!(Math.abs(e-s[t])<=kf)))return}if(!s||s.every((e,t)=>Math.abs(e-o(a[t]))<=kf))return`linear`;let l=[],u=(e,t=c(e))=>l.push(id(t)+` `+id(o(e)*100)+`%`);return s.forEach((e,t)=>{t&&Math.abs(e-s[t-1])>.2&&y(c,a[t-1],a[t]).forEach(e=>u(e)),u(a[t],e)}),`linear(`+l+`)`},x=(e,t,n,r)=>{let i=[t],a=(t,n)=>e.every(e=>!(Math.abs(e.numberAt((t+n)/2)-(e.numberAt(t)+e.numberAt(n))/2)>(e.name.startsWith(`scale`)?jf:Af))),o=(t,n,r)=>{if(n-t<1||a(t,n))i.push(n);else if(r<4)o(t,(t+n)/2,r+1),o((t+n)/2,n,r+1);else{for(let r of e)i.push(...y(e=>r.numberAt(e),t,n));i.push(n)}},s=Ff(t,n,Math.ceil((n-t)/100));for(let e of r)s.push(e,Math.min(e+.01,n));let c=t;for(let e of s.sort(Pf))e>c&&o(c,e,0),c=e;return i.sort(Pf)},S=e=>{let t;for(let n of e){let e=n.tween();if(!e||t?.some((t,n)=>n<2?Math.abs(e[n]-t)>1:e[n]!==t))return;t=e}return t},C=(e,n,r,i={fill:`both`},a,o)=>{let s=e.flatMap(e=>e.boundaries(n,r)),c=o||b(e,n,r,s),l=c?[n,r]:x(e,n,r,s),u=l.map(e=>h(e,a)),d={transform:u};return c||(d.offset=l.map(e=>Ec(n,r,e))),u.every(e=>e===u[0])&&(g(m(n,a)),d=null),t.animate(d,{...i,duration:r-n,easing:c||`linear`})},w=c=>{let l=c,u=0,d=0,f=[],p=[],m=new Set;r.clear(),o=new Map;for(let e of n){r.set(e.name,e);let[t,n]=e.timing(),i=t===1/0;if(o.set(e,[e.at(c),e.speed,i]),i)e.sync();else{if(e.speed<0)return;if(n){if(u){let e=(t-d)/n;if(Math.abs(n-u)>1||Math.abs(e-Math.round(e))*u>1)return}else u=n,d=t;p.push(e)}else m.add(t);f.push(e),l=Math.max(l,t)}}i={},a=kd.filter(t=>{if(r.has(t))return!0;let n=i[t]=Rf(e,t);return n!==void 0&&parseFloat(n)!==+!!t.startsWith(`scale`)}),_(!1);let h=!u&&S(f);try{if(h&&h[1]>c){let[e,t,n]=h;v(C(f,e,t,void 0,void 0,n),e-c,t-e)}else l>c&&(v(C(f,c,l),0,l-c),m.forEach(e=>e<l-1&&v(t.animate(null,{duration:e-c}),0,e-c)));if(u){let e=d+Math.floor((l-d)/u)*u;v(C(p,e,e+u,{iterations:1/0,iterationStart:(l-e)/u,fill:`forwards`},l),l-c)}}catch{return}return s.length||_(),!0},T=e=>{let t,r=0;for(let i of n){let n=o.get(i);if(!n)return!1;let[a,s,c]=n,l=i.at(e),u=i.timing()[0]===1/0;if(c){if(u&&l===a)continue;return!1}let d=(l-a)/s,f=u?0:i.speed/s;if(t===void 0)t=d,r=f;else if(Math.abs(d-t)>1||f!==r)return!1}if(t===void 0)return!0;if(!s.length)return!1;for(let{offset:e,end:n,isDone:r}of s){let i=t-e;if(n<1/0&&(r?i<n-1:i<0||i>=n))return!1}for(let{animation:n,offset:i,isDone:a}of s){if(a)continue;let o=t-i;r?(n.playbackRate=r,n.startTime=e-o/r):(n.pause(),n.currentTime=o)}return!0},E=()=>!n.size&&(u=!0,Lf(t)===O&&Df.delete(t),O.isJS||_(),!0),D=()=>{let t=Z.now();if(O.isJS||(O.isFinishing=!0,n.forEach(n=>{let[r,a]=n.timing();n.state===`running`&&n.speed>0&&!a&&r<=t+1&&(n.complete(),i[n.name]=Rf(e,n.name),o.has(n)||(c=!0))}),O.isFinishing=!1),l=!1,u||(n.forEach(({state:e},t)=>{(e===`idle`||e===`finished`)&&n.delete(t)}),E()))return;for(let e of n)if(!e.canAccelerate)return O.demote(!0);O.isJS&&(O.isJS=!1,c=!0,n.forEach(e=>e.js?.stop()));let r=c,a=d;if(c=d=!1,r||!T(t)){if(a){if(t-f<Mf)return O.demote();f=t}if(!w(t))return O.demote()}},O={tracks:n,isJS:!1,isFinishing:!1,schedule(e,t){u||(c||=e,d||=!!t,l||(l=!0,X.isProcessing?hu.render(D,!1,!0):queueMicrotask(D)))},release(e){let{state:t}=e;(t===`idle`||t===`finished`)&&n.delete(e),E()||O.schedule(!0)},check(){if(!O.isJS){for(let t in i)if(Rf(e,t)!==i[t]&&!p(t))return O.schedule(!0,!0)}},demote(e){O.isJS||u||(n.forEach(t=>{t.isAccelerated()&&t.sync(),e||(t.canAccelerate=!1)}),O.isJS=!0,o=new Map,_(),n.forEach(e=>e.state===`running`&&e.js?.start()))}};return Df.set(t,O),O}var Uf=class extends nd{constructor(e){super(),this.stop=()=>{this._animation&&(this._animation.stop(),this.stopTimeline?.()),this.keyframeResolver?.cancel()},this.createdAt=Z.now();let{keyframes:t,name:n,motionValue:r,element:i}=e,a=e;a.autoplay??=!0,a.delay??=0,a.type??=`keyframes`,a.repeat??=0,a.repeatDelay??=0,a.repeatType??=`loop`;let o=i?.KeyframeResolver||Jd;this.keyframeResolver=new o(t,(e,t,n)=>this.onKeyframesResolved(e,t,a,!n),n,r,i),this.keyframeResolver?.scheduleResolve()}onKeyframesResolved(e,t,n,r){this.keyframeResolver=void 0;let{name:i,type:a,velocity:o,delay:s,isHandoff:c,onUpdate:l}=n;this.resolvedAt=Z.now();let u=!0;hf(e,i,a,o)||(u=!1,(yc.instantAnimations||!s)&&l?.(Ju(e,n,t)),e[0]=e[e.length-1],gf(n),n.repeat=0);let{onComplete:d}=n;n.finalKeyframe=t,n.keyframes=e,n.onComplete=()=>{d?.(),this.notifyFinished()};let f=u&&!c&&Sf(n),p=!f&&zf(n);r&&(f||p||this.resolvedAt!==this.createdAt)&&(n.startTime??=Qu(this.createdAt,this.resolvedAt));let m;if(f){n.element=n.motionValue?.owner?.current;try{m=new ff(n)}catch{m=new ad(n)}}else m=p?new Vf(n):new ad(n);this.pendingTimeline&&=(this.stopTimeline=m.attachTimeline(this.pendingTimeline),void 0),this._animation=m}get finished(){return this._animation?this._animation.finished:super.finished}then(e,t){return this.finished.finally(e).then(()=>{})}liveValue(){return this._animation?.liveValue?.()}get animation(){return this._animation||(this.keyframeResolver?.resume(),Kd()),this._animation}get duration(){return this.animation.duration}get iterationDuration(){return this.animation.iterationDuration}get time(){return this.animation.time}set time(e){this.animation.time=e}get speed(){return this.animation.speed}get state(){return this.animation.state}set speed(e){this.animation.speed=e}get startTime(){return this.animation.startTime}attachTimeline(e){return this._animation?this.stopTimeline=this.animation.attachTimeline(e):this.pendingTimeline=e,()=>this.stop()}play(){this.animation.play()}pause(){this.animation.pause()}complete(){this.animation.complete()}cancel(){this._animation&&this.animation.cancel(),this.keyframeResolver?.cancel()}};function Wf(e,t,n,r=0,i=1){let a=Array.from(e).sort((e,t)=>e.sortNodePosition(t)).indexOf(t),o=e.size,s=(o-1)*r;return typeof n==`function`?n(a,o):i===1?a*r:s-a*r}var Gf=30,Kf=e=>!isNaN(parseFloat(e)),qf={current:void 0},Jf=class{constructor(e,t={}){this.canTrackVelocity=null,this.events={},this.updateAndNotify=e=>{let t=Z.now();if(this.updatedAt!==t&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(e),this.current!==this.prev&&(this.notifyChange(),this.dependents))for(let e of this.dependents)e.dirty()},this.hasAnimated=!1,this.setCurrent(e),this.owner=t.owner}setCurrent(e){this.current=e,this.updatedAt=Z.now(),this.canTrackVelocity===null&&e!==void 0&&(this.canTrackVelocity=Kf(this.current))}setPrevFrameValue(e=this.current){this.prevFrameValue=e,this.prevUpdatedAt=this.updatedAt}onChange(e){return this.on(`change`,e)}on(e,t){var n;return e===`change`?this.onChangeSubscribe(t):((n=this.events)[e]||(n[e]=new Dc)).add(t)}onChangeSubscribe(e){let{events:t}=this;return!t.change&&!this.changeSubscriber?this.changeSubscriber=e:(t.change||(t.change=new Dc,t.change.add(this.changeSubscriber),this.changeSubscriber=void 0),t.change.add(e)),()=>{this.changeSubscriber===e?this.changeSubscriber=void 0:t.change?.remove(e),this.stopIfUnobserved()}}stopIfUnobserved(){hu.read(()=>{!this.changeSubscriber&&!this.events.change?.getSize()&&this.stop()})}clearListeners(){this.changeSubscriber=void 0;for(let e in this.events)this.events[e].clear()}attach(e,t){this.passiveEffect=e,this.stopPassiveEffect=t}set(e){this.passiveEffect?this.passiveEffect(e,this.updateAndNotify):this.updateAndNotify(e)}setWithVelocity(e,t,n){this.set(t),this.prev=void 0,this.prevFrameValue=e,this.prevUpdatedAt=this.updatedAt-n}jump(e,t=!0){this.updateAndNotify(e),this.prev=e,this.prevUpdatedAt=this.prevFrameValue=void 0,t&&this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}dirty(){this.notifyChange()}notifyChange(){let{current:e,changeSubscriber:t}=this;t?t(e):this.events.change?.notify(e)}addDependent(e){this.dependents||=new Set,this.dependents.add(e)}removeDependent(e){this.dependents&&this.dependents.delete(e)}get(){qf.current&&qf.current.push(this);let e=this.animation?.liveValue?.();return e===void 0?this.current:e}getCurrent(){return this.current}getPrevious(){return this.prev}getVelocity(){let e=Z.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||e-this.updatedAt>Gf)return 0;let t=Math.min(this.updatedAt-this.prevUpdatedAt,Gf);return Ac(parseFloat(this.current)-parseFloat(this.prevFrameValue),t)}start(e){return this.stop(),new Promise(t=>{this.hasAnimated=!0;let n=!1,r;r=e(()=>{n=!0,this.events.animationComplete?.notify(),this.animation===r&&this.clearAnimation(),t()}),n||(this.animation=r),this.events.animationStart?.notify()})}stop(){this.animation&&(this.animation.stop(),this.events.animationCancel&&this.events.animationCancel.notify()),this.clearAnimation()}isAnimating(){return!!this.animation}clearAnimation(){this.animation=void 0}destroy(){this.dependents?.clear(),this.events.destroy?.notify(),this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}};function Yf(e,t){return new Jf(e,t)}function Xf(e,t){if(e?.inherit&&t){let{inherit:n,...r}=e;return{...t,...r}}return e}function Zf(e,t){let n=e?.[t]??e?.default??e;return n===e?n:Xf(n,e)}var Qf={type:`spring`,stiffness:500,damping:25,restSpeed:10},$f=e=>({type:`spring`,stiffness:550,damping:e===0?2*Math.sqrt(550):30,restSpeed:10}),ep={type:`keyframes`,duration:.8},tp={type:`keyframes`,ease:[.25,.1,.35,1],duration:.3},np=(e,{keyframes:t})=>t.length>2?ep:Ad.has(e)?e.startsWith(`scale`)?$f(t[1]):Qf:tp,rp=new Set([`when`,`delay`,`delayChildren`,`staggerChildren`,`staggerDirection`,`repeat`,`repeatType`,`repeatDelay`,`from`,`elapsed`]);function ip(e){for(let t in e)if(!rp.has(t))return!0;return!1}var ap=(e,t,n,r={},i,a)=>o=>{let s=Zf(r,e)||{},c=s.delay||r.delay||0,{elapsed:l=0}=r;l-=Oc(c);let u={keyframes:Array.isArray(n)?n:[null,n],ease:`easeOut`,velocity:t.getVelocity(),...s,delay:-l,onUpdate:e=>{t.set(e),s.onUpdate&&s.onUpdate(e)},onComplete:()=>{o(),s.onComplete&&s.onComplete()},name:e,motionValue:t,element:a?void 0:i,hasOnUpdate:!!s.onUpdate};ip(s)||Object.assign(u,np(e,u)),u.duration&&=Oc(u.duration),u.repeatDelay&&=Oc(u.repeatDelay),u.from!==void 0&&(u.keyframes[0]=u.from);let d=!1;if((u.type===!1||u.duration===0&&!u.repeatDelay)&&(gf(u),u.delay===0&&(d=!0)),(yc.instantAnimations||yc.skipAnimations||i?.shouldSkipAnimations||s.skipAnimations)&&(d=!0,gf(u),u.delay=0),u.allowFlatten=!s.type&&!s.ease,d&&!a&&t.get()!==void 0){let e=Ju(u.keyframes,s);if(e!==void 0){hu.update(()=>{u.onUpdate(e),u.onComplete()});return}}return s.isSync?new ad(u):new Uf(u)},op=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function sp(e){let t=op.exec(e);if(!t)return[,];let[,n,r,i]=t;return[`--${n??r}`,i]}function cp(e,t,n=1){`${e}`;let[r,i]=sp(e);if(!r)return;let a=window.getComputedStyle(t).getPropertyValue(r);if(a){let e=a.trim();return bc(e)?parseFloat(e):e}return nl(i)?cp(i,t,n+1):i}function lp(e){let t=[{},{}];return e?.values.forEach((e,n)=>{t[0][n]=e.get(),t[1][n]=e.getVelocity()}),t}function up(e,t,n,r){let i=t=>typeof t==`function`?t(n===void 0?e.custom:n,...lp(r)):t;return t=i(t),typeof t==`string`&&(t=e.variants&&e.variants[t]),i(t)}function dp(e,t,n){return up(e.getProps(),t,n,e)}var fp=(e,t)=>t===`exit`?e.presenceContext?.custom:void 0,pp=new Set([`width`,`height`,`top`,`left`,`right`,`bottom`,...kd]),mp=e=>Array.isArray(e);function hp(e,t,n){e.hasValue(t)?e.getValue(t).set(n):e.addValue(t,Yf(n))}function gp(e){return mp(e)?e[e.length-1]||0:e}function _p(e,t){let{transitionEnd:n={},transition:r={},...i}=dp(e,t)||{};i={...i,...n};for(let t in i)hp(e,t,gp(i[t]))}var vp=e=>!!(e&&e.getVelocity);function yp(e){return!!(vp(e)&&e.add)}function bp(e,t){let n=e.getValue(`willChange`);if(yp(n))return n.add(t);if(!n&&yc.WillChange){let n=new yc.WillChange(`auto`);e.addValue(`willChange`,n),n.add(t)}}var xp=`data-framer-appear-id`;function Sp(e){return e.props[xp]}var Cp=typeof window<`u`;function wp({protectedKeys:e,needsAnimating:t},n){let r=n in e&&!t[n];return t[n]=!1,r}function Tp(e,t,{delay:n=0,transitionOverride:r,type:i}={}){let{transition:a,transitionEnd:o,...s}=t,c=e.getDefaultTransition();a=a?Xf(a,c):c;let l=a?.reduceMotion,u=a?.skipAnimations;r&&(a=r);let d=[],f=i&&e.animationState?.getState()[i],p=a?.path;p&&(p.animateValues?p.animateValues(t=>e.getValue(t,e.latestValues[t]??0),s,a,n,d):p.animateVisualElement?.(e,s,a,n,d));for(let t in s){let r=e.getValue(t,e.latestValues[t]??null),i=s[t];if(i===void 0||f&&wp(f,t))continue;let o={delay:n,...Zf(a||{},t)};u&&(o.skipAnimations=!0);let c=r.get();if(c!==void 0&&!r.isAnimating()&&!Array.isArray(i)&&i===c&&!o.velocity){hu.update(()=>r.set(i));continue}let p=!1;if(Cp&&window.MotionHandoffAnimation){let n=Sp(e);if(n){let e=window.MotionHandoffAnimation(n,t,hu);e!==null&&(o.startTime=e,p=!0)}}bp(e,t);let m=l??e.shouldReduceMotion;r.start(ap(t,r,i,m&&pp.has(t)?{type:!1}:o,e,p));let h=r.animation;h&&d.push(h)}if(o){let t=()=>hu.update(()=>{o&&_p(e,o)});d.length?Promise.all(d).then(t):t()}return d}function Ep(e,t,n={}){let r=dp(e,t,fp(e,n.type)),i=n.transitionOverride||(r?.transition??(e.getDefaultTransition()||{})),a=()=>Promise.all(r?Tp(e,r,n):[]),o=(r=0)=>{let{variantChildren:a}=e,{delayChildren:o=0,staggerChildren:s,staggerDirection:c}=i,l=[];return a?.forEach(e=>{e.notify(`AnimationStart`,t),l.push(Ep(e,t,{...n,delay:r+(typeof o==`function`?0:o)+Wf(a,e,o,s,c)}).then(()=>e.notify(`AnimationComplete`,t)))}),Promise.all(l)},{when:s}=i;return s?s===`beforeChildren`?a().then(()=>o()):o().then(a):Promise.all([a(),o(n.delay)])}function Dp(e,t,n={}){return e.notify(`AnimationStart`,t),(Array.isArray(t)?Promise.all(t.map(t=>Ep(e,t,n))):typeof t==`string`?Ep(e,t,n):Promise.all(Tp(e,dp(e,t,n.custom),n))).then(()=>{e.notify(`AnimationComplete`,t)})}var Op={test:e=>e===`auto`,parse:e=>e},kp=e=>t=>t.test(e),Ap=[al,Q,bl,yl,Sl,xl,Op],jp=e=>Ap.find(kp(e));function Mp(e){return typeof e==`number`?e===0:e===null||e===`none`||e===`0`||Sc(e)}var Np=new Set([`auto`,`none`,`0`]);function Pp(e,t,n){let r=0,i;for(;r<e.length&&!i;){let t=e[r];typeof t==`string`&&!Np.has(t)&&Il(t)&&(i=e[r]),r++}if(i&&n)for(let r of t)e[r]!==i&&(e[r]=gd(n,i))}var Fp=class extends Jd{constructor(e,t,n,r,i){super(e,t,n,r,i,!0)}scheduleResolve(){if(this.canReadNow()&&(this.readKeyframes(),!this.needsMeasurement))return this.complete();super.scheduleResolve()}canReadNow(){let{unresolvedKeyframes:e,element:t,motionValue:n}=this,r=e[0]??n?.get();if(!t?.current||r===void 0)return!1;for(let t=0;t<e.length;t++)if(il(t?e[t]:r))return!1;return!0}readKeyframes(){let{unresolvedKeyframes:e,element:t,name:n}=this;if(!t||!t.current)return;super.readKeyframes();for(let n=0;n<e.length;n++){let r=e[n];if(typeof r==`string`&&(r=r.trim(),nl(r))){let i=cp(r,t.current);i!==void 0&&(e[n]=i),n===e.length-1&&(this.finalKeyframe=r)}}if(this.resolveNoneKeyframes(),!pp.has(n)||e.length!==2)return;let[r,i]=e;if(typeof r==`number`&&typeof i==`number`)return;let a=jp(r),o=jp(i);if(il(r)!==il(i)&&zd[n])this.needsMeasurement=!0;else if(a!==o){if(jd(a)&&jd(o))for(let t=0;t<e.length;t++){let n=e[t];typeof n==`string`&&(e[t]=parseFloat(n))}else zd[n]&&(this.needsMeasurement=!0)}}resolveNoneKeyframes(){let{unresolvedKeyframes:e,name:t}=this,n=[];for(let t=0;t<e.length;t++)(e[t]===null||Mp(e[t]))&&n.push(t);n.length&&Pp(e,n,t)}measure(){let{element:e,name:t}=this;return zd[t](window.getComputedStyle(e.current),()=>e.measureViewportBox())}measureInitialState(){let{element:e,unresolvedKeyframes:t,name:n}=this;if(!e||!e.current)return;n===`height`&&(this.suspendedScrollY=window.pageYOffset),this.measuredOrigin=this.measure(),t[0]=this.measuredOrigin;let r=t[t.length-1];r!==void 0&&this.motionValue?.jump(r,!1)}measureEndState(){let{element:e,unresolvedKeyframes:t}=this;if(!e||!e.current)return;this.motionValue?.jump(this.measuredOrigin,!1);let n=t.length-1,r=t[n];t[n]=this.measure(),r!==null&&this.finalKeyframe===void 0&&(this.finalKeyframe=r),this.removedTransforms?.length&&this.removedTransforms.forEach(([t,n])=>{e.getValue(t).set(n)}),this.resolveNoneKeyframes()}},Ip=[`borderTopLeftRadius`,`borderTopRightRadius`,`borderBottomRightRadius`,`borderBottomLeftRadius`];function Lp(e){return xc(e)&&`offsetHeight`in e&&!(`ownerSVGElement`in e)}function Rp(e){return xc(e)&&`ownerSVGElement`in e}var zp={};function Bp(e){return zp.current?.add(e),e}var Vp=e=>zp.current?zp.current.bind(e):e;function Hp(e,t,n){if(e==null)return[];if(e instanceof EventTarget)return[e];if(typeof e==`string`){let r=t?t.current:zp.current?.root||document,i=n?.[e]??r.querySelectorAll(e);return i?Array.from(i):[]}return Array.from(e).filter(e=>e!=null)}function Up(e){return e.replace(/([A-Z])/g,e=>`-${e.toLowerCase()}`)}function Wp(e,t,n){let{style:r,vars:i,transformOrigin:a}=e,o=!1,s=!1;for(let e in t){let n=t[e];if(Ad.has(e))o=!0;else if(el(e))i[e]=n;else{let t=Cf(n,fd[e]);e.startsWith(`origin`)?(s=!0,a[e]=t):r[e]=t}}if(t.transform||(o||n?r.transform=Ef(t,e.transform,n):r.transform&&=`none`),s){let{originX:e=`50%`,originY:t=`50%`,originZ:n=0}=a;r.transformOrigin=`${e} ${t} ${n}`}}var Gp={offset:`stroke-dashoffset`,array:`stroke-dasharray`},Kp={offset:`strokeDashoffset`,array:`strokeDasharray`};function qp(e,t,n=1,r=0,i=!0){e.pathLength=1;let a=i?Gp:Kp;e[a.offset]=`${-r}`,e[a.array]=`${t} ${n}`}var Jp=[`transform`,`opacity`,`clipPath`,`filter`,`offsetDistance`,`offsetPath`,`offsetRotate`,`offsetAnchor`];function Yp(e,{attrX:t,attrY:n,attrScale:r,pathLength:i,pathSpacing:a=1,pathOffset:o=0,...s},c,l,u){if(Wp(e,s,l),c){e.style.viewBox&&(e.attrs.viewBox=e.style.viewBox);return}e.attrs=e.style,e.style={};let{attrs:d,style:f}=e;for(let e of Jp)d[e]!==void 0&&(f[e]=d[e],delete d[e]);(f.transform||d.transformOrigin)&&(f.transformOrigin=d.transformOrigin??`50% 50%`,delete d.transformOrigin),f.transform&&(f.transformBox=u?.transformBox??`fill-box`,delete d.transformBox),t!==void 0&&(d.x=t),n!==void 0&&(d.y=n),r!==void 0&&(d.scale=r),i!==void 0&&qp(d,i,a,o,!1)}function Xp({top:e,left:t,right:n,bottom:r}){return{x:{min:t,max:n},y:{min:e,max:r}}}function Zp({x:e,y:t}){return{top:t.min,right:e.max,bottom:t.max,left:e.min}}function Qp(e,t){if(!t)return e;let n=t({x:e.left,y:e.top}),r=t({x:e.right,y:e.bottom});return{top:n.y,left:n.x,bottom:r.y,right:r.x}}function $p(e){return e===void 0||e===1}function em({scale:e,scaleX:t,scaleY:n}){return!$p(e)||!$p(t)||!$p(n)}function tm(e){return em(e)||nm(e)||e.z||e.rotate||e.rotateX||e.rotateY||e.rotateZ||e.skewX||e.skewY}function nm(e){return rm(e.x)||rm(e.y)}function rm(e){return e&&e!==`0%`}function im(e,t,n){return n+t*(e-n)}function am(e,t,n,r,i){return i!==void 0&&(e=im(e,i,r)),im(e,n,r)+t}function om(e,t=0,n=1,r,i){e.min=am(e.min,t,n,r,i),e.max=am(e.max,t,n,r,i)}function sm(e,{x:t,y:n}){om(e.x,t.translate,t.scale,t.originPoint),om(e.y,n.translate,n.scale,n.originPoint)}var cm=.999999999999,lm=1.0000000000001;function um(e,t,n,r=!1){let i=n.length;if(!i)return;t.x=t.y=1;let a,o;for(let s=0;s<i;s++){a=n[s],o=a.projectionDelta;let{visualElement:i}=a.options;i&&i.props.style&&i.props.style.display===`contents`||(r&&a.options.layoutScroll&&a.scroll&&a!==a.root&&(dm(e.x,-a.scroll.offset.x),dm(e.y,-a.scroll.offset.y)),o&&(t.x*=o.x.scale,t.y*=o.y.scale,sm(e,o)),r&&tm(a.latestValues)&&mm(e,a.latestValues,a.layout?.layoutBox))}t.x<lm&&t.x>cm&&(t.x=1),t.y<lm&&t.y>cm&&(t.y=1)}function dm(e,t){e.min+=t,e.max+=t}function fm(e,t,n,r,i=.5){om(e,t,n,Jl(e.min,e.max,i),r)}function pm(e,t){return typeof e==`string`?parseFloat(e)/100*(t.max-t.min):e}function mm(e,t,n){let r=n??e;fm(e.x,pm(t.x,r.x),t.scaleX,t.scale,t.originX),fm(e.y,pm(t.y,r.y),t.scaleY,t.scale,t.originY)}function hm(e,t){return Xp(Qp(e.getBoundingClientRect(),t))}function gm(e,t,n){let r=hm(e,n),{scroll:i}=t;return i&&(dm(r.x,i.offset.x),dm(r.y,i.offset.y)),r}var{schedule:_m,cancel:vm}=mu(queueMicrotask,!1);function ym(e,t,n){let r=vp(e)?e:Yf(e);return r.start(ap(``,r,t,n)),r.animation}var bm={},xm={value:null,addProjectionMetrics:null};function Sm(e,t){let n=Z.now();e=Vp(e);let r=({timestamp:i})=>{let a=i-n;a>=t&&(gu(r),e(a-t))};return hu.setup(r,!0),Bp(()=>gu(r))}function Cm(e){return Rp(e)&&e.tagName===`svg`}function wm(e){return vp(e)?e.get():e}var Tm=e=>typeof e==`number`?e:parseFloat(e),Em=Ip.length,Dm=[`rotate`,`rotateX`,`rotateY`,`rotateZ`,`skewX`,`skewY`],Om=Dm.length,km=e=>typeof e==`number`||Q.test(e);function Am(e,t,n,r,i,a){i?(e.opacity=Jl(0,n.opacity??1,Mm(r)),e.opacityExit=Jl(t.opacity??1,0,Nm(r))):a&&(e.opacity=Jl(t.opacity??1,n.opacity??1,r));for(let i=0;i<Em;i++){let a=Ip[i],o=jm(t,a),s=jm(n,a);(o!==void 0||s!==void 0)&&(o||=0,s||=0,o===0||s===0||km(o)===km(s)?(e[a]=Math.max(Jl(Tm(o),Tm(s),r),0),(bl.test(s)||bl.test(o))&&(e[a]+=`%`)):e[a]=s)}for(let i=0;i<Om;i++){let a=Dm[i];(t[a]||n[a])&&(e[a]=Jl(t[a]||0,n[a]||0,r))}}function jm(e,t){return e[t]===void 0?e.borderRadius:e[t]}var Mm=Pm(0,.5,Bc),Nm=Pm(.5,.95,wc);function Pm(e,t,n){return r=>r<e?0:r>t?1:n(Ec(e,t,r))}function Fm(e,t){e.min=t.min,e.max=t.max}function Im(e,t){Fm(e.x,t.x),Fm(e.y,t.y)}function Lm(e,t){e.translate=t.translate,e.scale=t.scale,e.originPoint=t.originPoint,e.origin=t.origin}var Rm=.9999,zm=1.0001,Bm=-.01,Vm=.01;function Hm(e){return e.max-e.min}function Um(e,t,n){return Math.abs(e-t)<=n}function Wm(e,t,n,r=.5){e.origin=r,e.originPoint=Jl(t.min,t.max,e.origin),e.scale=Hm(n)/Hm(t),e.translate=Jl(n.min,n.max,e.origin)-e.originPoint,(e.scale>=Rm&&e.scale<=zm||isNaN(e.scale))&&(e.scale=1),(e.translate>=Bm&&e.translate<=Vm||isNaN(e.translate))&&(e.translate=0)}function Gm(e,t,n,r){Wm(e.x,t.x,n.x,r?r.originX:void 0),Wm(e.y,t.y,n.y,r?r.originY:void 0)}function Km(e,t,n,r=0){e.min=(r?Jl(n.min,n.max,r):n.min)+t.min,e.max=e.min+Hm(t)}function qm(e,t,n,r){Km(e.x,t.x,n.x,r?.x),Km(e.y,t.y,n.y,r?.y)}function Jm(e,t,n,r=0){let i=r?Jl(n.min,n.max,r):n.min;e.min=t.min-i,e.max=e.min+Hm(t)}function Ym(e,t,n,r){Jm(e.x,t.x,n.x,r?.x),Jm(e.y,t.y,n.y,r?.y)}function Xm(e,t,n,r,i){return e-=t,e=im(e,1/n,r),i!==void 0&&(e=im(e,1/i,r)),e}function Zm(e,t=0,n=1,r=.5,i,a=e,o=e){if(bl.test(t)&&(t=parseFloat(t),t=Jl(o.min,o.max,t/100)-o.min),typeof t!=`number`)return;let s=Jl(a.min,a.max,r);e===a&&(s-=t),e.min=Xm(e.min,t,n,s,i),e.max=Xm(e.max,t,n,s,i)}function Qm(e,t,[n,r,i],a,o){Zm(e,t[n],t[r],t[i],t.scale,a,o)}var $m=[`x`,`scaleX`,`originX`],eh=[`y`,`scaleY`,`originY`];function th(e,t,n,r){Qm(e.x,t,$m,n?n.x:void 0,r?r.x:void 0),Qm(e.y,t,eh,n?n.y:void 0,r?r.y:void 0)}var nh=()=>({translate:0,scale:1,origin:0,originPoint:0}),rh=()=>({x:nh(),y:nh()}),ih=()=>({min:0,max:0}),ah=()=>({x:ih(),y:ih()});function oh(e){return e.translate===0&&e.scale===1}function sh(e){return oh(e.x)&&oh(e.y)}function ch(e,t){return e.min===t.min&&e.max===t.max}function lh(e,t){return ch(e.x,t.x)&&ch(e.y,t.y)}function uh(e,t){return Math.round(e.min)===Math.round(t.min)&&Math.round(e.max)===Math.round(t.max)}function dh(e,t){return uh(e.x,t.x)&&uh(e.y,t.y)}function fh(e){return Hm(e.x)/Hm(e.y)}function ph(e,t){return e.translate===t.translate&&e.scale===t.scale&&e.originPoint===t.originPoint}var mh=class{constructor(){this.members=[]}add(e){gc(this.members,e);for(let t=this.members.length-1;t>=0;t--){let n=this.members[t];if(n===e||n===this.lead||n===this.prevLead)continue;let r=n.instance;r&&r.isConnected!==!1||n.snapshot||(_c(this.members,n),n.unmount())}e.scheduleRender()}remove(e){if(_c(this.members,e),e===this.prevLead&&(this.prevLead=void 0),e===this.lead){let e=this.members[this.members.length-1];e&&this.promote(e)}}relegate(e){for(let t=this.members.indexOf(e)-1;t>=0;t--){let e=this.members[t];if(e.isPresent!==!1&&e.instance?.isConnected!==!1)return this.promote(e),!0}return!1}promote(e,t){let n=this.lead;if(e!==n&&(this.prevLead=n,this.lead=e,e.show(),n)){n.updateSnapshot(),e.scheduleRender();let{layoutDependency:r}=n.options,{layoutDependency:i}=e.options;(r===void 0||r!==i)&&(e.resumeFrom=n,t&&(n.preserveOpacity=!0),n.snapshot&&(e.snapshot=n.snapshot,e.snapshot.latestValues=n.animationValues||n.latestValues),e.root?.isUpdating&&(e.isLayoutDirty=!0)),e.options.crossfade===!1&&n.hide()}}exitAnimationComplete(){this.members.forEach(e=>{e.options.onExitComplete?.(),e.resumingFrom?.options.onExitComplete?.()})}scheduleRender(){this.members.forEach(e=>e.instance&&e.scheduleRender(!1))}removeLeadSnapshot(){this.lead?.snapshot&&(this.lead.snapshot=void 0)}};function hh(e,t){return t.max===t.min?0:e/(t.max-t.min)*100}var gh={correct:(e,t)=>{if(!t.target)return e;if(typeof e==`string`){if(Q.test(e))e=parseFloat(e);else return e}return`${hh(e,t.target.x)}% ${hh(e,t.target.y)}%`}},_h={borderRadius:Object.assign({},gh,{applyTo:Ip.slice()}),borderTopLeftRadius:gh,borderTopRightRadius:gh,borderBottomLeftRadius:gh,borderBottomRightRadius:gh,boxShadow:{correct:(e,{treeScale:t,projectionDelta:n})=>{let r=e,i=Wl.parse(e);if(i.length>5)return r;let a=Wl.createTransformer(e),o=typeof i[0]==`number`?0:1,s=n.x.scale*t.x,c=n.y.scale*t.y;i[0+o]/=s,i[1+o]/=c;let l=Jl(s,c,.5);return typeof i[2+o]==`number`&&(i[2+o]/=l),typeof i[3+o]==`number`&&(i[3+o]/=l),a(i)}}};function vh(e,t,n){let r=``,i=e.x.translate/t.x,a=e.y.translate/t.y,o=n?.z||0;if((i||a||o)&&(r=`translate3d(${i}px, ${a}px, ${o}px) `),(t.x!==1||t.y!==1)&&(r+=`scale(${1/t.x}, ${1/t.y}) `),n){let{transformPerspective:e,rotate:t,pathRotation:i,rotateX:a,rotateY:o,rotateZ:s,skewX:c,skewY:l}=n;e&&(r=`perspective(${e}px) ${r}`),t&&(r+=`rotate(${t}deg) `),i&&(r+=`rotate(${i}deg) `),a&&(r+=`rotateX(${a}deg) `),o&&(r+=`rotateY(${o}deg) `),s&&(r+=`rotateZ(${s}deg) `),c&&(r+=`skewX(${c}deg) `),l&&(r+=`skewY(${l}deg) `)}let s=e.x.scale*t.x,c=e.y.scale*t.y;return(s!==1||c!==1)&&(r+=`scale(${s}, ${c})`),r||`none`}function yh(e){return[e(`x`),e(`y`)]}var bh=(e,t)=>e.depth-t.depth,xh=class{constructor(){this.children=[],this.isDirty=!1}add(e){gc(this.children,e),this.isDirty=!0}remove(e){_c(this.children,e),this.isDirty=!0}forEach(e){this.isDirty&&this.children.sort(bh),this.isDirty=!1,this.children.forEach(e)}},Sh={hasAnimatedSinceResize:!0,hasEverUpdated:!1},Ch={nodes:0,calculatedTargetDeltas:0,calculatedProjections:0},wh=[``,`X`,`Y`,`Z`],Th=1e3,Eh=0;function Dh(e,t,n,r){let{latestValues:i}=t;i[e]&&(n[e]=i[e],t.setStaticValue(e,0),r&&(r[e]=0))}var Oh=({instance:e})=>e&&Df.get(e)?.demote();function kh(e){if(e.hasCheckedOptimisedAppear=!0,e.root===e)return;let{visualElement:t}=e.options;if(!t)return;let n=Sp(t);if(window.MotionHasOptimisedAnimation(n,`transform`)){let{layout:t,layoutId:r}=e.options;window.MotionCancelOptimisedAnimation(n,`transform`,hu,!(t||r))}let{parent:r}=e;r&&!r.hasCheckedOptimisedAppear&&kh(r)}function Ah({attachResizeListener:e,defaultParent:t,measureScroll:n,checkIsScrollRoot:r,resetTransform:i}){return Object.assign(bm,{..._h,...bm}),class{constructor(e={},n=t?.()){this.id=Eh++,this.animationId=0,this.animationCommitId=0,this.children=new Set,this.options={},this.isTreeAnimating=!1,this.isAnimationBlocked=!1,this.isLayoutDirty=!1,this.isProjectionDirty=!1,this.isSharedProjectionDirty=!1,this.isTransformDirty=!1,this.updateManuallyBlocked=!1,this.updateBlockedByResize=!1,this.isUpdating=!1,this.isSVG=!1,this.needsReset=!1,this.shouldResetTransform=!1,this.hasCheckedOptimisedAppear=!1,this.treeScale={x:1,y:1},this.eventHandlers=new Map,this.hasTreeAnimated=!1,this.updateScheduled=!1,this.scheduleUpdate=()=>this.update(),this.projectionUpdateScheduled=!1,this.checkUpdateFailed=()=>{this.isUpdating&&(this.isUpdating=!1,this.clearAllSnapshots())},this.updateProjection=()=>{this.projectionUpdateScheduled=!1,xm.value&&(Ch.nodes=Ch.calculatedTargetDeltas=Ch.calculatedProjections=0),this.nodes.forEach(Nh),this.nodes.forEach(Wh),this.nodes.forEach(Gh),this.nodes.forEach(Ph),xm.addProjectionMetrics&&xm.addProjectionMetrics(Ch)},this.resolvedRelativeTargetAt=0,this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=e,this.root=n?n.root||n:this,this.path=n?[...n.path,n]:[],this.parent=n,this.depth=n?n.depth+1:0;for(let e=0;e<this.path.length;e++)this.path[e].shouldResetTransform=!0;this.root===this&&(this.nodes=new xh)}addEventListener(e,t){return this.eventHandlers.has(e)||this.eventHandlers.set(e,new Dc),this.eventHandlers.get(e).add(t)}notifyListeners(e,...t){let n=this.eventHandlers.get(e);n&&n.notify(...t)}hasListeners(e){return this.eventHandlers.has(e)}mount(t){if(this.instance)return;this.isSVG=Rp(t)&&!Cm(t),this.instance=t;let{layoutId:n,layout:r,visualElement:i}=this.options;if(i&&!i.current&&i.mount(t),this.root.nodes.add(this),this.parent&&this.parent.children.add(this),this.root.hasTreeAnimated&&(r||n)&&(this.isLayoutDirty=!0),e){let n,r=0,i=()=>this.root.updateBlockedByResize=!1;hu.read(()=>{r=window.innerWidth}),e(t,()=>{let e=window.innerWidth;e!==r&&(r=e,this.root.updateBlockedByResize=!0,n&&n(),n=Sm(i,250),Sh.hasAnimatedSinceResize&&(Sh.hasAnimatedSinceResize=!1,this.nodes.forEach(Uh)))})}n&&this.root.registerSharedNode(n,this),this.addLayoutListener()}addLayoutListener(){let{layoutId:e,layout:t,visualElement:n,animate:r}=this.options;this.instance&&!this.hasLayoutListener&&r!==!1&&n&&(e||t)&&(this.hasLayoutListener=!0,this.addEventListener(`didUpdate`,({delta:e,hasLayoutChanged:t,hasRelativeLayoutChanged:r,layout:i})=>{if(this.isAnimationBlocked){this.target=void 0,this.relativeTarget=void 0;return}let a=this.options.transition||n.getDefaultTransition()||Zh,{onLayoutAnimationStart:o,onLayoutAnimationComplete:s}=n.getProps(),c=!this.targetLayout||!dh(this.targetLayout,i),l=!t&&r;if(this.options.layoutRoot||this.resumeFrom||l||t&&(c||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0);let t={...Zf(a,`layout`),onPlay:o,onComplete:s};(n.shouldReduceMotion||this.options.layoutRoot)&&(t.delay=0,t.type=!1),this.startAnimation(t),this.setAnimationOrigin(e,l,t.path)}else t||Uh(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=i}))}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);let e=this.getStack();e&&e.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,this.eventHandlers.clear(),this.hasLayoutListener=!1,gu(this.updateProjection)}blockUpdate(){this.updateManuallyBlocked=!0}unblockUpdate(){this.updateManuallyBlocked=!1}isUpdateBlocked(){return this.updateManuallyBlocked||this.updateBlockedByResize}startUpdate(){this.isUpdateBlocked()||(this.isUpdating=!0,this.nodes&&this.nodes.forEach(Kh),this.animationId++)}getTransformTemplate(){let{visualElement:e}=this.options;return e&&e.getProps().transformTemplate}willUpdate(e=!0){if(this.root.hasTreeAnimated=!0,this.root.isUpdateBlocked()){this.options.onExitComplete&&this.options.onExitComplete();return}if(window.MotionCancelOptimisedAnimation&&!this.hasCheckedOptimisedAppear&&kh(this),!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;Oh(this),this.isLayoutDirty=!0;for(let e=0;e<this.path.length;e++){let t=this.path[e];t.shouldResetTransform=!0,Oh(t),(typeof t.latestValues.x==`string`||typeof t.latestValues.y==`string`)&&(t.isLayoutDirty=!0),t.updateScroll(`snapshot`),t.options.layoutRoot&&t.willUpdate(!1),t.isAnimationBlocked&&(t.dragSnapshot||=t.measure(),this.dragAncestor=t)}let{layoutId:t,layout:n}=this.options;if(t===void 0&&!n)return;let r=this.getTransformTemplate();this.prevTransformTemplateValue=r?r(this.latestValues,``):void 0,this.updateSnapshot(),e&&this.notifyListeners(`willUpdate`)}update(){if(this.updateScheduled=!1,this.isUpdateBlocked()){let e=this.updateBlockedByResize;this.unblockUpdate(),this.updateBlockedByResize=!1,this.clearAllSnapshots(),e&&this.nodes.forEach(Lh),this.nodes.forEach(Ih);return}if(this.animationId<=this.animationCommitId){this.nodes.forEach(Rh);return}this.animationCommitId=this.animationId,this.isUpdating?(this.isUpdating=!1,this.nodes.forEach(Bh),this.nodes.forEach(Vh),this.nodes.forEach(Hh),this.nodes.forEach(jh),this.nodes.forEach(Mh)):this.nodes.forEach(Rh),this.clearAllSnapshots();let e=Z.now();X.delta=vc(0,1e3/60,e-X.timestamp),X.timestamp=e,X.isProcessing=!0,_u.update.process(X),_u.preRender.process(X),_u.render.process(X),X.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,_m.read(this.scheduleUpdate))}clearAllSnapshots(){this.nodes.forEach(Fh),this.sharedNodes.forEach((e,t)=>e.members.length?e.removeLeadSnapshot():this.sharedNodes.delete(t))}scheduleUpdateProjection(){this.projectionUpdateScheduled||(this.projectionUpdateScheduled=!0,hu.preRender(this.updateProjection,!1,!0))}scheduleCheckAfterUnmount(){hu.postRender(()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){!this.snapshot&&this.instance&&(this.snapshot=this.measure(),this.snapshot&&!Hm(this.snapshot.measuredBox.x)&&!Hm(this.snapshot.measuredBox.y)&&(this.snapshot=void 0))}updateLayout(){if(!this.instance||(this.updateScroll(),!(this.options.alwaysMeasureLayout&&this.isLead())&&!this.isLayoutDirty))return;if(this.resumeFrom&&!this.resumeFrom.instance)for(let e=0;e<this.path.length;e++)this.path[e].updateScroll();let e=this.layout;this.layout=this.measure(!1),this.layoutCorrected||=ah(),this.isLayoutDirty=!1,this.projectionDelta=void 0,this.notifyListeners(`measure`,this.layout.layoutBox);let{visualElement:t}=this.options;t&&t.notify(`LayoutMeasure`,this.layout.layoutBox,e?e.layoutBox:void 0)}updateScroll(e=`measure`){let t=!!(this.options.layoutScroll&&this.instance);if(this.scroll&&this.scroll.animationId===this.root.animationId&&this.scroll.phase===e&&(t=!1),t&&this.instance){let t=r(this.instance);this.scroll={animationId:this.root.animationId,phase:e,isRoot:t,offset:n(this.instance),wasRoot:this.scroll?this.scroll.isRoot:t}}}resetTransform(){if(!i)return;let e=this.isLayoutDirty||this.shouldResetTransform||this.options.alwaysMeasureLayout;e&&Oh(this);let t=this.projectionDelta&&!sh(this.projectionDelta),n=this.getTransformTemplate(),r=n?n(this.latestValues,``):void 0,a=r!==this.prevTransformTemplateValue;e&&this.instance&&(t||tm(this.latestValues)||a)&&(i(this.instance,r),this.shouldResetTransform=!1,this.scheduleRender())}measure(e=!0){let t=this.measurePageBox(),n=this.removeElementScroll(t);return e&&(n=this.removeTransform(n)),tg(n),{animationId:this.root.animationId,measuredBox:t,layoutBox:n,latestValues:{},source:this.id}}measurePageBox(){let{visualElement:e}=this.options;if(!e)return ah();let t=e.measureViewportBox();if(!(this.scroll?.wasRoot||this.path.some(rg))){let{scroll:e}=this.root;e&&(dm(t.x,e.offset.x),dm(t.y,e.offset.y))}return t}removeElementScroll(e){let t=ah();if(Im(t,e),this.scroll?.wasRoot)return t;for(let n=0;n<this.path.length;n++){let r=this.path[n],{scroll:i,options:a}=r;r!==this.root&&i&&a.layoutScroll&&(i.wasRoot&&Im(t,e),dm(t.x,i.offset.x),dm(t.y,i.offset.y))}return t}applyTransform(e,t=!1,n,r){let i=n||ah();Im(i,e);for(let e=0;e<this.path.length;e++){let n=this.path[e];!t&&n.options.layoutScroll&&n.scroll&&n!==n.root&&(dm(i.x,-n.scroll.offset.x),dm(i.y,-n.scroll.offset.y)),tm(n.latestValues)&&mm(i,n.latestValues,n.layout?.layoutBox)}return!r&&tm(this.latestValues)&&mm(i,this.latestValues,this.layout?.layoutBox),i}removeTransform(e){let t=ah();Im(t,e);for(let e=0;e<this.path.length;e++){let n=this.path[e];if(!tm(n.latestValues))continue;let r;n.instance&&(em(n.latestValues)&&n.updateSnapshot(),r=ah(),Im(r,n.measurePageBox())),th(t,n.latestValues,n.snapshot?.layoutBox,r)}return tm(this.latestValues)&&th(t,this.latestValues),t}setTargetDelta(e){this.targetDelta=e,this.root.scheduleUpdateProjection(),this.isProjectionDirty=!0}setOptions(e){this.options={...this.options,...e,crossfade:e.crossfade===void 0||e.crossfade},this.addLayoutListener()}clearMeasurements(){this.scroll=void 0,this.layout=void 0,this.snapshot=void 0,this.prevTransformTemplateValue=void 0,this.targetDelta=void 0,this.target=void 0,this.isLayoutDirty=!1}forceRelativeParentToResolveTarget(){this.relativeParent&&this.relativeParent.resolvedRelativeTargetAt!==X.timestamp&&this.relativeParent.resolveTargetDelta(!0)}resolveTargetDelta(e=!1){let t=this.getLead();this.isProjectionDirty||=t.isProjectionDirty,this.isTransformDirty||=t.isTransformDirty,this.isSharedProjectionDirty||=t.isSharedProjectionDirty;let n=!!this.resumingFrom||this!==t;if(!(e||n&&this.isSharedProjectionDirty||this.isProjectionDirty||this.parent?.isProjectionDirty||this.attemptToResolveRelativeTarget||this.root.updateBlockedByResize))return;let{layout:r,layoutId:i}=this.options;if(!this.layout||!(r||i))return;this.resolvedRelativeTargetAt=X.timestamp;let a=this.getClosestProjectingParent();!this.targetDelta&&!this.relativeTarget&&(this.options.layoutAnchor!==!1&&a&&a.layout?this.createRelativeTarget(a,this.layout.layoutBox,a.layout.layoutBox):this.removeRelativeTarget()),(this.relativeTarget||this.targetDelta)&&(this.target||(this.target=ah(),this.targetWithTransforms=ah()),this.relativeTarget&&this.relativeTargetOrigin&&this.relativeParent&&this.relativeParent.target?(this.forceRelativeParentToResolveTarget(),qm(this.target,this.relativeTarget,this.relativeParent.target,this.options.layoutAnchor||void 0)):this.targetDelta?(this.resumingFrom?this.applyTransform(this.layout.layoutBox,!1,this.target,!0):Im(this.target,this.layout.layoutBox),sm(this.target,this.targetDelta)):Im(this.target,this.layout.layoutBox),this.attemptToResolveRelativeTarget&&(this.attemptToResolveRelativeTarget=!1,this.options.layoutAnchor!==!1&&a&&!!a.resumingFrom==!!this.resumingFrom&&!a.options.layoutScroll&&a.target&&this.animationProgress!==1?this.createRelativeTarget(a,this.target,a.target):this.relativeParent=this.relativeTarget=void 0),xm.value&&Ch.calculatedTargetDeltas++)}getClosestProjectingParent(){if(!(!this.parent||em(this.parent.latestValues)||nm(this.parent.latestValues)))return this.parent.isProjecting()?this.parent:this.parent.getClosestProjectingParent()}isProjecting(){return!!((this.relativeTarget||this.targetDelta||this.options.layoutRoot)&&this.layout)}createRelativeTarget(e,t,n){this.relativeParent=e,this.forceRelativeParentToResolveTarget(),this.relativeTarget=ah(),this.relativeTargetOrigin=ah(),Ym(this.relativeTargetOrigin,t,n,this.options.layoutAnchor||void 0),Im(this.relativeTarget,this.relativeTargetOrigin)}removeRelativeTarget(){this.relativeParent=this.relativeTarget=void 0}calcProjection(){let e=this.getLead(),t=!!this.resumingFrom||this!==e,n=!0;if((this.isProjectionDirty||this.parent?.isProjectionDirty)&&(n=!1),t&&(this.isSharedProjectionDirty||this.isTransformDirty)&&(n=!1),this.resolvedRelativeTargetAt===X.timestamp&&(n=!1),n)return;let{layout:r,layoutId:i}=this.options;if(this.isTreeAnimating=!!(this.parent&&this.parent.isTreeAnimating||this.currentAnimation||this.pendingAnimation),this.isTreeAnimating||(this.targetDelta=this.relativeTarget=void 0),!this.layout||!(r||i))return;Im(this.layoutCorrected,this.layout.layoutBox);let a=this.treeScale.x,o=this.treeScale.y;um(this.layoutCorrected,this.treeScale,this.path,t),e.layout&&!e.target&&(this.treeScale.x!==1||this.treeScale.y!==1)&&(e.target=e.layout.layoutBox,e.targetWithTransforms=ah());let{target:s}=e;s?(!this.projectionDelta||!this.prevProjectionDelta?this.createProjectionDeltas():(Lm(this.prevProjectionDelta.x,this.projectionDelta.x),Lm(this.prevProjectionDelta.y,this.projectionDelta.y)),Gm(this.projectionDelta,this.layoutCorrected,s,this.latestValues),this.treeScale.x===a&&this.treeScale.y===o&&ph(this.projectionDelta.x,this.prevProjectionDelta.x)&&ph(this.projectionDelta.y,this.prevProjectionDelta.y)||(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners(`projectionUpdate`,s)),xm.value&&Ch.calculatedProjections++):this.prevProjectionDelta&&(this.createProjectionDeltas(),this.scheduleRender())}hide(){this.isVisible=!1}show(){this.isVisible=!0}scheduleRender(e=!0){if(this.options.visualElement?.scheduleRender(),e){let e=this.getStack();e&&e.scheduleRender()}this.resumingFrom&&!this.resumingFrom.instance&&(this.resumingFrom=void 0)}createProjectionDeltas(){this.prevProjectionDelta=rh(),this.projectionDelta=rh(),this.projectionDeltaWithTransform=rh()}setAnimationOrigin(e,t=!1,n){let r=this.snapshot,i=r?r.latestValues:{},a={...this.latestValues},o=rh();this.relativeParent&&this.relativeParent.options.layoutRoot||(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!t;let s=ah(),c=(r?r.source:void 0)!==(this.layout?this.layout.source:void 0),l=this.getStack(),u=!l||l.members.length<=1,d=!(!c||u||this.options.crossfade!==!0||this.path.some(Xh));this.animationProgress=0;let f,p=n?.interpolateProjection(e);this.mixTargetDelta=t=>{let n=t/1e3,r=p?.(n);r?(o.x.translate=r.x,o.x.scale=Jl(e.x.scale,1,n),o.x.origin=e.x.origin,o.x.originPoint=e.x.originPoint,o.y.translate=r.y,o.y.scale=Jl(e.y.scale,1,n),o.y.origin=e.y.origin,o.y.originPoint=e.y.originPoint):(qh(o.x,e.x,n),qh(o.y,e.y,n)),this.setTargetDelta(o),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(Ym(s,this.layout.layoutBox,this.relativeParent.layout.layoutBox,this.options.layoutAnchor||void 0),Yh(this.relativeTarget,this.relativeTargetOrigin,s,n),f&&lh(this.relativeTarget,f)&&(this.isProjectionDirty=!1),f||=ah(),Im(f,this.relativeTarget)),c&&(this.animationValues=a,Am(a,i,this.latestValues,n,d,u)),r&&r.rotate!==void 0&&(this.animationValues||=a,this.animationValues.pathRotation=r.rotate),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=n},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(e){this.notifyListeners(`animationStart`),this.currentAnimation?.stop(),this.resumingFrom?.currentAnimation?.stop(),this.pendingAnimation&&=(gu(this.pendingAnimation),void 0),this.pendingAnimation=hu.update(()=>{Sh.hasAnimatedSinceResize=!0,this.motionValue||=Yf(0),this.motionValue.jump(0,!1),this.currentAnimation=ym(this.motionValue,[0,1e3],{...e,velocity:0,isSync:!0,onUpdate:t=>{this.mixTargetDelta(t),e.onUpdate&&e.onUpdate(t)},onComplete:()=>{e.onComplete&&e.onComplete(),this.completeAnimation()}}),td(this.currentAnimation,this),this.resumingFrom&&(this.resumingFrom.currentAnimation=this.currentAnimation),this.pendingAnimation=void 0})}completeAnimation(){this.resumingFrom&&(this.resumingFrom.currentAnimation=void 0,this.resumingFrom.preserveOpacity=void 0);let e=this.getStack();e&&e.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners(`animationComplete`)}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta&&this.mixTargetDelta(Th),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){let e=this.getLead(),{targetWithTransforms:t,layout:n,latestValues:r}=e,{target:i}=e;if(t&&i&&n){if(this!==e&&this.layout&&n&&ng(this.options.animationType,this.layout.layoutBox,n.layoutBox)){i=this.target||ah();let t=Hm(this.layout.layoutBox.x);i.x.min=e.target.x.min,i.x.max=i.x.min+t;let n=Hm(this.layout.layoutBox.y);i.y.min=e.target.y.min,i.y.max=i.y.min+n}Im(t,i),mm(t,r),Gm(this.projectionDeltaWithTransform,this.layoutCorrected,t,r)}}registerSharedNode(e,t){this.sharedNodes.has(e)||this.sharedNodes.set(e,new mh),this.sharedNodes.get(e).add(t);let n=t.options.initialPromotionConfig;t.promote({transition:n?n.transition:void 0,preserveFollowOpacity:n&&n.shouldPreserveFollowOpacity?n.shouldPreserveFollowOpacity(t):void 0})}isLead(){let e=this.getStack();return!e||e.lead===this}getLead(){let{layoutId:e}=this.options;return e&&this.getStack()?.lead||this}getPrevLead(){let{layoutId:e}=this.options;return e?this.getStack()?.prevLead:void 0}getStack(){let{layoutId:e}=this.options;if(e)return this.root.sharedNodes.get(e)}promote({needsReset:e,transition:t,preserveFollowOpacity:n}={}){let r=this.getStack();r&&r.promote(this,n),e&&(this.projectionDelta=void 0,this.needsReset=!0),t&&this.setOptions({transition:t})}relegate(){let e=this.getStack();return e?e.relegate(this):!1}resetSkewAndRotation(){let{visualElement:e}=this.options;if(!e)return;let t=!1,{latestValues:n}=e;if((n.z||n.rotate||n.rotateX||n.rotateY||n.rotateZ||n.skewX||n.skewY)&&(t=!0),!t)return;let r={};n.z&&Dh(`z`,e,r,this.animationValues);for(let t=0;t<wh.length;t++)Dh(`rotate${wh[t]}`,e,r,this.animationValues),Dh(`skew${wh[t]}`,e,r,this.animationValues);e.render();for(let t in r)e.setStaticValue(t,r[t]),this.animationValues&&(this.animationValues[t]=r[t]);e.scheduleRender()}applyProjectionStyles(e,t){if(!this.instance||this.isSVG)return;if(!this.isVisible){e.visibility=`hidden`;return}let n=this.getTransformTemplate();if(this.needsReset){this.needsReset=!1,e.visibility=``,e.opacity=``,e.pointerEvents=wm(t?.pointerEvents)||``,e.transform=n?n(this.latestValues,``):`none`;return}let r=this.getLead();if(!this.projectionDelta||!this.layout||!r.target){this.options.layoutId&&(e.opacity=this.latestValues.opacity===void 0?1:this.latestValues.opacity,e.pointerEvents=wm(t?.pointerEvents)||``),this.hasProjected&&!tm(this.latestValues)&&(e.transform=n?n({},``):`none`,this.hasProjected=!1);return}e.visibility=``;let i=r.animationValues||r.latestValues;this.applyTransformsToTarget();let a=vh(this.projectionDeltaWithTransform,this.treeScale,i);n&&(a=n(i,a)),e.transform=a;let{x:o,y:s}=this.projectionDelta;e.transformOrigin=`${o.origin*100}% ${s.origin*100}% 0`,e.opacity=r.animationValues?r===this?i.opacity??this.latestValues.opacity??1:this.preserveOpacity?this.latestValues.opacity:i.opacityExit:r===this?i.opacity===void 0?``:i.opacity:i.opacityExit===void 0?0:i.opacityExit;for(let t in bm){if(i[t]===void 0)continue;let{correct:n,applyTo:o,isCSSVariable:s}=bm[t],c=a===`none`?i[t]:n(i[t],r);if(o){let t=o.length;for(let n=0;n<t;n++)e[o[n]]=c}else s?this.options.visualElement.renderState.vars[t]=c:e[t]=c}this.options.layoutId&&(e.pointerEvents=r===this?wm(t?.pointerEvents)||``:`none`)}clearSnapshot(){this.resumeFrom=this.snapshot=this.dragSnapshot=this.dragAncestor=void 0}resetTree(){this.root.nodes.forEach(e=>e.currentAnimation?.stop()),this.root.nodes.forEach(Ih),this.root.sharedNodes.clear()}}}function jh(e){e.updateLayout(),zh(e)}function Mh(e){let t=e.resumeFrom?.snapshot||e.snapshot;if(e.isLead()&&e.layout&&t&&e.hasListeners(`didUpdate`)){let{layoutBox:n,measuredBox:r}=e.layout,{animationType:i}=e.options,a=t.source!==e.layout.source;if(i===`size`)yh(e=>{let r=a?t.measuredBox[e]:t.layoutBox[e],i=Hm(r);r.min=n[e].min,r.max=r.min+i});else if(i===`x`||i===`y`){let e=i===`x`?`y`:`x`;Fm(a?t.measuredBox[e]:t.layoutBox[e],n[e])}else ng(i,t.layoutBox,n)&&yh(r=>{let i=a?t.measuredBox[r]:t.layoutBox[r],o=Hm(n[r]);i.max=i.min+o,e.relativeTarget&&!e.currentAnimation&&(e.isProjectionDirty=!0,e.relativeTarget[r].max=e.relativeTarget[r].min+o)});let o=rh();Gm(o,n,t.layoutBox);let s=rh();a?Gm(s,e.applyTransform(r,!0),t.measuredBox):Gm(s,n,t.layoutBox);let c=!sh(o),l=!1;if(!e.resumeFrom){let r=e.getClosestProjectingParent();if(r&&!r.resumeFrom){let{snapshot:i,layout:a}=r;if(i&&a){let o=e.options.layoutAnchor||void 0,s=ah();Ym(s,t.layoutBox,i.layoutBox,o);let c=ah();Ym(c,n,a.layoutBox,o),dh(s,c)||(l=!0),r.options.layoutRoot&&(e.relativeTarget=c,e.relativeTargetOrigin=s,e.relativeParent=r)}}}e.notifyListeners(`didUpdate`,{layout:n,snapshot:t,delta:s,layoutDelta:o,hasLayoutChanged:c,hasRelativeLayoutChanged:l})}else if(e.isLead()){let{onExitComplete:t}=e.options;t&&t()}e.options.transition=void 0}function Nh(e){xm.value&&Ch.nodes++,e.parent&&(e.isProjecting()||(e.isProjectionDirty=e.parent.isProjectionDirty),e.isSharedProjectionDirty||=!!(e.isProjectionDirty||e.parent.isProjectionDirty||e.parent.isSharedProjectionDirty),e.isTransformDirty||=e.parent.isTransformDirty)}function Ph(e){e.isProjectionDirty=e.isSharedProjectionDirty=e.isTransformDirty=!1}function Fh(e){e.clearSnapshot()}function Ih(e){e.clearMeasurements()}function Lh(e){e.isLayoutDirty=!0,e.updateLayout()}function Rh(e){e.isLayoutDirty=!1}function zh(e){let{snapshot:t,dragAncestor:n}=e,r=n?.isAnimationBlocked&&n.layout;if(!t||!r||e.resumeFrom||e.isAnimationBlocked)return;let i=n.dragSnapshot;yh(e=>dm(t.layoutBox[e],r.layoutBox[e].min-i.layoutBox[e].min))}function Bh(e){e.isAnimationBlocked&&e.layout&&!e.isLayoutDirty&&(e.snapshot=e.dragSnapshot||e.layout,e.isLayoutDirty=!0)}function Vh(e){e.relativeTarget&&e.relativeParent?.isLayoutDirty&&(e.currentAnimation?e.isLayoutDirty=!0:(e.targetDelta=void 0,e.removeRelativeTarget()))}function Hh(e){let{visualElement:t}=e.options;t&&t.getProps().onBeforeLayoutMeasure&&t.notify(`BeforeLayoutMeasure`),e.resetTransform()}function Uh(e){e.finishAnimation(),e.targetDelta=e.relativeTarget=e.target=void 0,e.isProjectionDirty=!0}function Wh(e){e.resolveTargetDelta()}function Gh(e){e.calcProjection()}function Kh(e){e.resetSkewAndRotation()}function qh(e,t,n){e.translate=Jl(t.translate,0,n),e.scale=Jl(t.scale,1,n),e.origin=t.origin,e.originPoint=t.originPoint}function Jh(e,t,n,r){e.min=Jl(t.min,n.min,r),e.max=Jl(t.max,n.max,r)}function Yh(e,t,n,r){Jh(e.x,t.x,n.x,r),Jh(e.y,t.y,n.y,r)}function Xh(e){return e.animationValues&&e.animationValues.opacityExit!==void 0}var Zh={duration:.45,ease:[.4,0,.1,1]},Qh=e=>typeof navigator<`u`&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(e),$h=Qh(`applewebkit/`)&&!Qh(`chrome/`)?Math.round:wc;function eg(e){e.min=$h(e.min),e.max=$h(e.max)}function tg(e){eg(e.x),eg(e.y)}function ng(e,t,n){return e===`position`||e===`preserve-aspect`&&!Um(fh(t),fh(n),.2)}function rg(e){return e!==e.root&&e.scroll?.wasRoot}function ig(e,t,n,r={passive:!0}){return e.addEventListener(t,n,r),()=>e.removeEventListener(t,n,r)}var ag=Ah({attachResizeListener:(e,t)=>ig(e,`resize`,t),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body?.scrollLeft||0,y:document.documentElement.scrollTop||document.body?.scrollTop||0}),checkIsScrollRoot:()=>!0}),og={current:void 0},sg=Ah({measureScroll:e=>({x:e.scrollLeft,y:e.scrollTop}),defaultParent:()=>{if(!og.current){let e=new ag({});e.mount(window),e.setOptions({layoutScroll:!0}),og.current=e}return og.current},resetTransform:(e,t)=>{e.style.transform=t===void 0?`none`:t},checkIsScrollRoot:e=>window.getComputedStyle(e).position===`fixed`}),cg=new WeakMap;function lg(e){return typeof e==`object`&&!!e&&typeof e.start==`function`}function ug(e){return typeof e==`string`||Array.isArray(e)}var dg=[`animate`,`whileInView`,`whileFocus`,`whileHover`,`whileTap`,`whileDrag`,`exit`],fg=[`initial`].concat(dg);function pg(e){if(lg(e.animate))return!0;for(let t=0;t<fg.length;t++)if(ug(e[fg[t]]))return!0;return!1}function mg(e){return!!(pg(e)||e.variants)}function hg(e,t,n){for(let r in t){let i=t[r],a=n[r];if(vp(i))e.addValue(r,i);else if(vp(a))e.addValue(r,Yf(i,{owner:e}));else if(a!==i){if(e.hasValue(r)){let t=e.getValue(r);t.liveStyle===!0?t.jump(i):t.hasAnimated||t.set(i)}else{let t=e.getStaticValue(r);e.addValue(r,Yf(t===void 0?i:t,{owner:e}))}}}for(let r in n)t[r]===void 0&&e.removeValue(r);return t}var gg={current:null},_g={current:!1},vg=typeof window<`u`;function yg(){if(_g.current=!0,vg){if(window.matchMedia){let e=window.matchMedia(`(prefers-reduced-motion)`),t=()=>gg.current=e.matches;e.addEventListener(`change`,t),t()}else gg.current=!1}}var bg=[`AnimationStart`,`AnimationComplete`,`Update`,`BeforeLayoutMeasure`,`LayoutMeasure`,`LayoutAnimationStart`,`LayoutAnimationComplete`],xg={};function Sg(e){xg=e}function Cg(){return xg}var wg=class{scrapeMotionValuesFromProps(e,t,n){return{}}constructor({parent:e,props:t,presenceContext:n,reducedMotionConfig:r,skipAnimations:i,blockInitialAnimation:a,visualState:o},s={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.shouldSkipAnimations=!1,this.values=new Map,this.KeyframeResolver=Jd,this.features={},this.valueSubscriptions=new Map,this.prevMotionValues={},this.hasBeenMounted=!1,this.events={},this.propEventSubscriptions={},this.notifyUpdate=()=>this.notify(`Update`,this.latestValues),this.render=()=>{this.current&&(this.triggerBuild(),this.renderInstance(this.current,this.renderState,this.props.style,this.projection))},this.renderScheduledAt=0,this.scheduleRender=()=>{let e=Z.now();this.renderScheduledAt<e&&(this.renderScheduledAt=e,hu.render(this.render,!1,!0))};let{latestValues:c,renderState:l}=o;this.latestValues=c,this.baseTarget={...c},this.initialValues=t.initial?{...c}:{},this.renderState=l,this.parent=e,this.props=t,this.presenceContext=n,this.depth=e?e.depth+1:0,this.reducedMotionConfig=r,this.skipAnimationsConfig=i,this.options=s,this.blockInitialAnimation=!!a,this.isControllingVariants=pg(t),this.isVariantNode=mg(t),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=!!(e&&e.current);let{willChange:u,...d}=this.scrapeMotionValuesFromProps(t,{},this);for(let e in d){let t=d[e];c[e]!==void 0&&vp(t)&&t.set(c[e])}}mount(e){if(this.hasBeenMounted)for(let e in this.initialValues)this.values.get(e)?.jump(this.initialValues[e]),this.latestValues[e]=this.initialValues[e];if(this.current=e,cg.set(e,this),this.projection&&!this.projection.instance&&this.projection.mount(e),this.isVariantNode&&!this.isControllingVariants){let e=this;do e=e.props.inherit!==!1&&e.parent;while(e&&!e.isVariantNode);if(e){let{variantChildren:t}=e;t.add(this),this.removeFromVariantTree=()=>t.delete(this)}}this.values.forEach((e,t)=>this.bindToMotionValue(t,e)),this.reducedMotionConfig===`never`?this.shouldReduceMotion=!1:this.reducedMotionConfig===`always`?this.shouldReduceMotion=!0:(_g.current||yg(),this.shouldReduceMotion=gg.current),this.shouldSkipAnimations=this.skipAnimationsConfig??!1,this.parent?.addChild(this),this.update(this.props,this.presenceContext),this.hasBeenMounted=!0}unmount(){this.projection&&this.projection.unmount(),gu(this.notifyUpdate),gu(this.render),this.valueSubscriptions.forEach(e=>e()),this.valueSubscriptions.clear(),this.removeFromVariantTree&&this.removeFromVariantTree(),this.parent?.removeChild(this);for(let e in this.events)this.events[e].clear();for(let e in this.features){let t=this.features[e];t&&(t.unmount(),t.isMounted=!1)}this.current=null}addChild(e){this.children.add(e),this.enteringChildren??=new Set,this.enteringChildren.add(e)}removeChild(e){this.children.delete(e),this.enteringChildren&&this.enteringChildren.delete(e)}bindToMotionValue(e,t){if(this.valueSubscriptions.has(e)&&this.valueSubscriptions.get(e)(),t.accelerate&&_f.has(e)&&this.current instanceof HTMLElement){let{factory:n,keyframes:r,times:i,ease:a,duration:o}=t.accelerate,s=new cf({element:this.current,name:e,keyframes:r,times:i,ease:a,duration:Oc(o)}),c=n(s);this.valueSubscriptions.set(e,()=>{c(),s.cancel()});return}let n=Ad.has(e);n&&this.onBindTransform&&this.onBindTransform();let r=t.on(`change`,t=>{this.latestValues[e]=t,this.props.onUpdate&&hu.preRender(this.notifyUpdate),n&&(this.projection&&(this.projection.isTransformDirty=!0),Df.get(this.current)?.check()),this.scheduleRender()}),i;typeof window<`u`&&window.MotionCheckAppearSync&&(i=window.MotionCheckAppearSync(this,e,t)),this.valueSubscriptions.set(e,()=>{r(),i&&i()})}sortNodePosition(e){return!this.current||!e.current||!this.sortInstanceNodePosition||this.type!==e.type?0:this.sortInstanceNodePosition(this.current,e.current)}updateFeatures(){let e=`animation`;for(e in xg){let t=xg[e];if(!t)continue;let{isEnabled:n,Feature:r}=t;if(!this.features[e]&&r&&n(this.props)&&(this.features[e]=new r(this)),this.features[e]){let t=this.features[e];t.isMounted?t.update():(t.mount(),t.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):ah()}getStaticValue(e){return this.latestValues[e]}setStaticValue(e,t){this.latestValues[e]=t}update(e,t){let{transformTemplate:n,onUpdate:r}=this.props;(e.transformTemplate||n)&&this.scheduleRender(),(e.transformTemplate&&!n||e.onUpdate&&!r)&&Df.get(this.current)?.demote(),this.prevProps=this.props,this.props=e,this.prevPresenceContext=this.presenceContext,this.presenceContext=t;for(let t=0;t<bg.length;t++){let n=bg[t];this.propEventSubscriptions[n]&&(this.propEventSubscriptions[n](),delete this.propEventSubscriptions[n]);let r=e[`on`+n];r&&(this.propEventSubscriptions[n]=this.on(n,r))}this.prevMotionValues=hg(this,this.scrapeMotionValuesFromProps(e,this.prevProps||{},this),this.prevMotionValues),this.handleChildMotionValue&&this.handleChildMotionValue()}getProps(){return this.props}getVariant(e){return this.props.variants?this.props.variants[e]:void 0}getDefaultTransition(){return this.props.transition}getTransformPagePoint(){return this.props.transformPagePoint}addValue(e,t){let n=this.values.get(e);if(t!==n){n&&this.removeValue(e),this.bindToMotionValue(e,t),this.values.set(e,t);let r=t.get();r!==void 0&&(this.latestValues[e]=r)}}removeValue(e){this.values.delete(e);let t=this.valueSubscriptions.get(e);t&&(t(),this.valueSubscriptions.delete(e)),delete this.latestValues[e],this.removeValueFromRenderState(e,this.renderState)}hasValue(e){return this.values.has(e)}getValue(e,t){if(this.props.values&&this.props.values[e])return this.props.values[e];let n=this.values.get(e);return n===void 0&&t!==void 0&&(n=Yf(t??this.getDefaultValue?.(e),{owner:this}),this.addValue(e,n)),n}readValue(e,t){let n=this.latestValues[e]!==void 0||!this.current?this.latestValues[e]:this.getBaseTargetFromProps(this.props,e)??this.readValueFromInstance(this.current,e,this.options);return n!=null&&(typeof n==`string`&&(bc(n)||Sc(n))?n=parseFloat(n):typeof n!=`number`&&!Wl.test(n)&&Wl.test(t)&&(n=gd(e,t)),this.setBaseTarget(e,vp(n)?n.get():n)),vp(n)?n.get():n}setBaseTarget(e,t){this.baseTarget[e]=t}on(e,t){return this.events[e]||(this.events[e]=new Dc),this.events[e].add(t)}notify(e,...t){this.events[e]&&this.events[e].notify(...t)}scheduleRenderMicrotask(){_m.render(this.render)}},Tg=class extends wg{constructor(){super(...arguments),this.KeyframeResolver=Fp}sortInstanceNodePosition(e,t){return e.compareDocumentPosition(t)&2?1:-1}getBaseTargetFromProps(e,t){let n=e.style;return n?n[t]:void 0}removeValueFromRenderState(e,{vars:t,style:n}){delete t[e],delete n[e]}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);let{children:e}=this.props;vp(e)&&(this.childSubscription=e.on(`change`,e=>{this.current&&(this.current.textContent=`${e}`)}))}};function Eg(e,{style:t,vars:n},r,i){let a=e.style,o;for(o in t)a[o]=t[o];for(o in i?.applyProjectionStyles(a,r),n)a.setProperty(o,n[o])}function Dg(e,{layout:t,layoutId:n}){return Ad.has(e)||e.startsWith(`origin`)||(t||n!==void 0)&&(!!bm[e]||e===`opacity`)}function Og(e,t,n){let r=e.style,i=t?.style,a={};if(!r)return a;for(let t in r)(vp(r[t])||i&&vp(i[t])||Dg(t,e)||n?.getValue(t)?.liveStyle!==void 0)&&(a[t]=r[t]);return a}function kg(e){return window.getComputedStyle(e)}var Ag=class extends Tg{constructor(){super(...arguments),this.type=`html`,this.renderInstance=Eg}mount(e){e.style,super.mount(e)}readValueFromInstance(e,t){if(Ad.has(t))return this.projection?.isProjecting?Td(t):Dd(e,t);{let n=kg(e),r=(el(t)?n.getPropertyValue(t):n[t])||0;return typeof r==`string`?r.trim():r}}measureInstanceViewportBox(e,{transformPagePoint:t}){return hm(e,t)}build(e,t,n){Wp(e,t,n.transformTemplate)}scrapeMotionValuesFromProps(e,t,n){return Og(e,t,n)}},jg=e=>e.pointerType===`mouse`?typeof e.button!=`number`||e.button<=0:e.isPrimary!==!1;function Mg(e){return{point:{x:e.pageX,y:e.pageY}}}var Ng=e=>t=>jg(t)&&e(t,Mg(t));function Pg(e,t,n,r){return ig(e,t,Ng(n),r)}var Fg=new WeakMap,Ig,Lg=(e,t,n)=>(r,i)=>i&&i[0]?i[0][e+`Size`]:Rp(r)&&`getBBox`in r?r.getBBox()[t]:r[n],Rg=Lg(`inline`,`width`,`offsetWidth`),zg=Lg(`block`,`height`,`offsetHeight`);function Bg({target:e,borderBoxSize:t}){Fg.get(e)?.forEach(n=>{n(e,{get width(){return Rg(e,t)},get height(){return zg(e,t)}})})}function Vg(e){e.forEach(Bg)}function Hg(){typeof ResizeObserver<`u`&&(Ig=new ResizeObserver(Vg))}function Ug(e,t){Ig||Hg();let n=Hp(e);return n.forEach(e=>{let n=Fg.get(e);n||(n=new Set,Fg.set(e,n)),n.add(t),Ig?.observe(e)}),()=>{n.forEach(e=>{let n=Fg.get(e);n?.delete(t),n?.size||Ig?.unobserve(e)})}}var Wg=new Set,Gg;function Kg(){Gg=()=>{let e={get width(){return window.innerWidth},get height(){return window.innerHeight}};Wg.forEach(t=>t(e))},window.addEventListener(`resize`,Gg)}function qg(e){return Wg.add(e),Gg||Kg(),()=>{Wg.delete(e),!Wg.size&&typeof Gg==`function`&&(window.removeEventListener(`resize`,Gg),Gg=void 0)}}function Jg(e,t){return Bp(typeof e==`function`?qg(e):Ug(e,t))}var Yg=(e,t)=>Math.abs(e-t);function Xg(e,t){let n=Yg(e.x,t.x),r=Yg(e.y,t.y);return Math.sqrt(n**2+r**2)}var Zg=new Set([`auto`,`scroll`]),Qg=class{constructor(e,t,{transformPagePoint:n,contextWindow:r=window,dragSnapToOrigin:i=!1,distanceThreshold:a=3,element:o}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.lastRawMoveEventInfo=null,this.handlers={},this.contextWindow=window,this.scrollPositions=new Map,this.removeScrollListeners=null,this.onElementScroll=e=>{this.handleScroll(e.target)},this.onWindowScroll=()=>{this.handleScroll(window)},this.updatePoint=()=>{if(!(this.lastMoveEvent&&this.lastMoveEventInfo))return;this.hasPendingMove=!1,this.lastRawMoveEventInfo&&(this.lastMoveEventInfo=$g(this.lastRawMoveEventInfo,this.transformPagePoint));let e=t_(this.lastMoveEventInfo,this.history),t=this.startEvent!==null,n=Xg(e.offset,{x:0,y:0})>=this.distanceThreshold;if(!t&&!n)return;let{point:r}=e;this.history.push({...r,timestamp:Z.now()});let{onStart:i,onMove:a}=this.handlers;t||(i&&i(this.lastMoveEvent,e),this.startEvent=this.lastMoveEvent),a&&a(this.lastMoveEvent,e)},this.handlePointerMove=(e,t)=>{this.handleScroll(window),this.lastMoveEvent=e,this.lastRawMoveEventInfo=t,this.lastMoveEventInfo=$g(t,this.transformPagePoint),this.hasPendingMove=!0,hu.update(this.updatePoint,!0)},this.handlePointerUp=(e,t)=>{this.hasPendingMove&&this.updatePoint(),this.end();let{onEnd:n,onSessionEnd:r,resumeAnimation:i}=this.handlers;if((this.dragSnapToOrigin||!this.startEvent)&&i&&i(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;let a=t_(e.type===`pointercancel`?this.lastMoveEventInfo:$g(t,this.transformPagePoint),this.history);this.startEvent&&n&&n(e,a),r&&r(e,a)},!jg(e))return;this.dragSnapToOrigin=i,this.handlers=t,this.transformPagePoint=n,this.distanceThreshold=a,this.contextWindow=r||window;let s=$g(Mg(e),this.transformPagePoint),{point:c}=s,{timestamp:l}=X;this.history=[{...c,timestamp:l}];let{onSessionStart:u}=t;u&&u(e,t_(s,this.history));let d={passive:!0,capture:!0};this.removeListeners=Tc(Pg(this.contextWindow,`pointermove`,this.handlePointerMove,d),Pg(this.contextWindow,`pointerup`,this.handlePointerUp,d),Pg(this.contextWindow,`pointercancel`,this.handlePointerUp,d)),o&&this.startScrollTracking(o)}startScrollTracking(e){let t=e.parentElement;for(;t;){let e=getComputedStyle(t);(Zg.has(e.overflowX)||Zg.has(e.overflowY))&&this.scrollPositions.set(t,{x:t.scrollLeft,y:t.scrollTop}),t=t.parentElement}this.scrollPositions.set(window,{x:window.scrollX,y:window.scrollY}),window.addEventListener(`scroll`,this.onElementScroll,{capture:!0}),window.addEventListener(`scroll`,this.onWindowScroll),this.removeScrollListeners=()=>{window.removeEventListener(`scroll`,this.onElementScroll,{capture:!0}),window.removeEventListener(`scroll`,this.onWindowScroll)}}handleScroll(e){let t=this.scrollPositions.get(e);if(!t)return;let n=e===window,r=n?{x:window.scrollX,y:window.scrollY}:{x:e.scrollLeft,y:e.scrollTop},i={x:r.x-t.x,y:r.y-t.y};(i.x!==0||i.y!==0)&&(n?this.lastMoveEventInfo&&(this.lastMoveEventInfo.point.x+=i.x,this.lastMoveEventInfo.point.y+=i.y):this.history.length>0&&(this.history[0].x-=i.x,this.history[0].y-=i.y),this.scrollPositions.set(e,r),hu.update(this.updatePoint,!0))}updateHandlers(e){this.handlers=e}end(){this.removeListeners&&this.removeListeners(),this.removeScrollListeners&&this.removeScrollListeners(),this.scrollPositions.clear(),gu(this.updatePoint)}};function $g(e,t){return t?{point:t(e.point)}:e}function e_(e,t){return{x:e.x-t.x,y:e.y-t.y}}function t_({point:e},t){return{point:e,delta:e_(e,r_(t)),offset:e_(e,n_(t)),velocity:i_(t,.1)}}function n_(e){return e[0]}function r_(e){return e[e.length-1]}function i_(e,t){if(e.length<2)return{x:0,y:0};let n=e.length-1,r=null,i=r_(e);for(;n>=0&&(r=e[n],!(i.timestamp-r.timestamp>Oc(t)));)n--;if(!r)return{x:0,y:0};r===e[0]&&e.length>2&&i.timestamp-r.timestamp>Oc(t)*2&&(r=e[1]);let a=kc(i.timestamp-r.timestamp);if(a===0)return{x:0,y:0};let o={x:(i.x-r.x)/a,y:(i.y-r.y)/a};return o.x===1/0&&(o.x=0),o.y===1/0&&(o.y=0),o}var a_=new Set([`BUTTON`,`INPUT`,`SELECT`,`TEXTAREA`,`A`]);function o_(e){return a_.has(e.tagName)||e.isContentEditable===!0}var s_=new Set([`INPUT`,`SELECT`,`TEXTAREA`]);function c_(e){return s_.has(e.tagName)||e.isContentEditable===!0}var l_={x:!1,y:!1};function u_(){return l_.x||l_.y}function d_(e){return e===`x`||e===`y`?l_[e]?null:(l_[e]=!0,()=>{l_[e]=!1}):l_.x||l_.y?null:(l_.x=l_.y=!0,()=>{l_.x=l_.y=!1})}function f_(e,{min:t,max:n},r){return t!==void 0&&e<t?e=r?Jl(t,e,r.min):Math.max(e,t):n!==void 0&&e>n&&(e=r?Jl(n,e,r.max):Math.min(e,n)),e}function p_(e,t,n){return{min:t===void 0?void 0:e.min+t,max:n===void 0?void 0:e.max+n-(e.max-e.min)}}function m_(e,{top:t,left:n,bottom:r,right:i}){return{x:p_(e.x,n,i),y:p_(e.y,t,r)}}function h_(e,t){let n=t.min-e.min,r=t.max-e.max;return t.max-t.min<e.max-e.min&&([n,r]=[r,n]),{min:n,max:r}}function g_(e,t){return{x:h_(e.x,t.x),y:h_(e.y,t.y)}}function __(e,t){let n=.5,r=Hm(e),i=Hm(t);return i>r?n=Ec(t.min,t.max-r,e.min):r>i&&(n=Ec(e.min,e.max-i,t.min)),vc(0,1,n)}function v_(e,t){let n={};return t.min!==void 0&&(n.min=t.min-e.min),t.max!==void 0&&(n.max=t.max-e.min),n}var y_=.35;function b_(e=y_){return e===!1?e=0:e===!0&&(e=y_),{x:x_(e,`left`,`right`),y:x_(e,`top`,`bottom`)}}function x_(e,t,n){return{min:S_(e,t),max:S_(e,n)}}function S_(e,t){return typeof e==`number`?e:e[t]||0}var C_=new WeakMap,w_=class{constructor(e,t=()=>e.getProps()){this.openDragLock=null,this.isDragging=!1,this.currentDirection=null,this.originPoint={x:0,y:0},this.constraints=!1,this.hasMutatedConstraints=!1,this.elastic=ah(),this.latestPointerEvent=null,this.latestPanInfo=null,this.visualElement=e,this.readProps=t}start(e,{snapToCursor:t=!1,distanceThreshold:n}={}){let{presenceContext:r}=this.visualElement;if(r&&r.isPresent===!1)return;let i=e=>{t&&this.snapToCursor(e),this.stopAnimation()},a=(e,t)=>{let{drag:n,dragPropagation:r,onDragStart:i}=this.getProps();if(n&&!r&&(this.openDragLock&&this.openDragLock(),this.openDragLock=d_(n),!this.openDragLock))return;this.latestPointerEvent=e,this.latestPanInfo=t,this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),yh(e=>{let t=this.getAxisMotionValue(e).get()||0;if(nl(t)&&(t=cp(t,this.visualElement.current)||0),Q.test(t))t=parseFloat(t);else if(bl.test(t)){let{projection:n}=this.visualElement;if(n&&n.layout){let r=n.layout.layoutBox[e];r&&(t=Hm(r)*(parseFloat(t)/100))}}this.originPoint[e]=t}),i&&hu.update(()=>i(e,t),!1,!0),bp(this.visualElement,`transform`);let{animationState:a}=this.visualElement;a&&a.setActive(`whileDrag`,!0)},o=(e,t)=>{this.latestPointerEvent=e,this.latestPanInfo=t;let{dragPropagation:n,dragDirectionLock:r,onDirectionLock:i,onDrag:a}=this.getProps();if(!n&&!this.openDragLock)return;let{offset:o}=t;if(r&&this.currentDirection===null){if(this.currentDirection=A_(o),this.currentDirection===null)return;i&&i(this.currentDirection)}this.updateAxis(`x`,t.point,o),this.updateAxis(`y`,t.point,o),this.visualElement.render(),a&&hu.update(()=>a(e,t),!1,!0)},s=(e,t)=>{this.latestPointerEvent=e,this.latestPanInfo=t,this.stop(e,t),this.latestPointerEvent=null,this.latestPanInfo=null},c=()=>{let{dragSnapToOrigin:e}=this.getProps();(e||this.constraints)&&this.startAnimation({x:0,y:0})},{dragSnapToOrigin:l}=this.getProps();this.panSession=new Qg(e,{onSessionStart:i,onStart:a,onMove:o,onSessionEnd:s,resumeAnimation:c},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:l,distanceThreshold:n,contextWindow:this.visualElement.current?.ownerDocument.defaultView,element:this.visualElement.current})}stop(e,t,n){let r=e||this.latestPointerEvent,i=t||this.latestPanInfo,a=this.isDragging;if(this.cancel(),!a||!i||!r)return;let{velocity:o}=i;this.startAnimation(o,n);let{onDragEnd:s}=this.getProps();s&&hu.postRender(()=>s(r,i))}cancel(){this.isDragging=!1;let{projection:e,animationState:t}=this.visualElement;e&&(e.isAnimationBlocked=!1),this.endPanSession();let{dragPropagation:n}=this.getProps();!n&&this.openDragLock&&(this.openDragLock(),this.openDragLock=null),t&&t.setActive(`whileDrag`,!1)}endPanSession(){this.panSession&&this.panSession.end(),this.panSession=void 0}updateAxis(e,t,n){let{drag:r}=this.getProps();if(!n||!k_(e,r,this.currentDirection))return;let i=this.getAxisMotionValue(e),a=this.originPoint[e]+n[e];this.constraints&&this.constraints[e]&&(a=f_(a,this.constraints[e],this.elastic[e])),i.set(a)}resolveConstraints(){let{dragConstraints:e,dragElastic:t}=this.getProps(),n=this.visualElement.projection&&!this.visualElement.projection.layout?this.visualElement.projection.measure(!1):this.visualElement.projection?.layout,r=this.constraints;T_(e)?this.constraints||=this.resolveRefConstraints():this.constraints=e&&n?m_(n.layoutBox,e):!1,this.elastic=b_(t),r!==this.constraints&&!T_(e)&&n&&this.constraints&&!this.hasMutatedConstraints&&yh(e=>{this.constraints!==!1&&this.getAxisMotionValue(e)&&(this.constraints[e]=v_(n.layoutBox[e],this.constraints[e]))})}resolveRefConstraints(){let{dragConstraints:e,onMeasureDragConstraints:t}=this.getProps();if(!T_(e))return!1;let n=E_(e),{projection:r}=this.visualElement;if(!r||!r.layout)return!1;r.root&&(r.root.scroll=void 0,r.root.updateScroll());let i=gm(n,r.root,this.visualElement.getTransformPagePoint()),a=g_(r.layout.layoutBox,i);if(t){let e=t(Zp(a));this.hasMutatedConstraints=!!e,e&&(a=Xp(e))}return a}startAnimation(e,t){let{drag:n,dragMomentum:r,dragElastic:i,dragTransition:a,dragSnapToOrigin:o,onDragTransitionEnd:s}=this.getProps(),c=this.constraints||{},l=yh(s=>{if(!k_(s,t||n,this.currentDirection))return;let l=c&&c[s]||{};(o===!0||o===s)&&(l={min:0,max:0});let u=i?200:1e6,d=i?40:1e7,f={type:`inertia`,velocity:r?e[s]:0,bounceStiffness:u,bounceDamping:d,timeConstant:750,restDelta:1,restSpeed:10,...a,...l};return this.startAxisValueAnimation(s,f)});return Promise.all(l).then(s)}startAxisValueAnimation(e,t){let n=this.getAxisMotionValue(e);return bp(this.visualElement,e),n.start(ap(e,n,0,t,this.visualElement,!1))}stopAnimation(){yh(e=>this.getAxisMotionValue(e).stop())}getAxisMotionValue(e){let t=`_drag${e.toUpperCase()}`;return this.readProps()[t]||this.visualElement.getValue(e,this.visualElement.latestValues[e]??0)}snapToCursor({clientX:e,clientY:t}){let{drag:n}=this.getProps(),r={x:e,y:t},i=this.visualElement.getTransformPagePoint()?.(r)||r,a=this.visualElement.measureViewportBox();yh(e=>{if(!k_(e,n,this.currentDirection))return;let t=this.getAxisMotionValue(e),{min:r,max:o}=a[e];t.set((t.get()||0)+i[e]-Jl(r,o,.5))})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;let{drag:e,dragConstraints:t}=this.getProps(),{projection:n}=this.visualElement;if(!T_(t)||!n||!this.constraints)return;this.stopAnimation();let r=this.constraints,i={x:0,y:0};yh(e=>{let t=this.getAxisMotionValue(e).get();i[e]=__({min:t,max:t},r[e])});let{transformTemplate:a}=this.visualElement.getProps();this.visualElement.current.style.transform=a?a({},``):`none`,n.root&&n.root.updateScroll(),n.updateLayout(),this.constraints=!1,this.resolveConstraints(),yh(t=>{let n=this.getAxisMotionValue(t);if(!k_(t,e,null)||!n.get())return;let{min:r,max:a}=this.constraints[t];n.set(Jl(r,a,i[t]))}),this.visualElement.render()}addListeners(){if(!this.visualElement.current)return;C_.set(this.visualElement,this);let e=this.visualElement.current,t=Pg(e,`pointerdown`,t=>{let{drag:n,dragListener:r=!0}=this.getProps(),i=t.target,a=i!==e&&c_(i);n&&r&&!a&&this.start(t)}),n,r=()=>{let{dragConstraints:t}=this.getProps(),r=T_(t)&&E_(t);r&&(this.constraints=this.resolveRefConstraints(),n||=O_(e,r,()=>this.scalePositionWithinConstraints()))},{projection:i}=this.visualElement,a=i.addEventListener(`measure`,r);i&&!i.layout&&(i.root&&i.root.updateScroll(),i.updateLayout()),hu.read(r);let o=ig(window,`resize`,()=>this.scalePositionWithinConstraints()),s=i.addEventListener(`didUpdate`,(({delta:e,hasLayoutChanged:t})=>{this.isDragging&&t&&(yh(t=>{if(!k_(t,this.getProps().drag,this.currentDirection))return;let n=this.getAxisMotionValue(t);this.originPoint[t]+=e[t].translate,n.set(n.get()+e[t].translate)}),this.visualElement.render())}));return()=>{o(),t(),a(),s&&s(),n&&n()}}getProps(){let e=this.readProps(),{drag:t=!1,dragDirectionLock:n=!1,dragPropagation:r=!1,dragConstraints:i=!1,dragElastic:a=y_,dragMomentum:o=!0}=e;return{...e,drag:t,dragDirectionLock:n,dragPropagation:r,dragConstraints:i,dragElastic:a,dragMomentum:o}}};function T_(e){return!!e&&typeof e==`object`&&(`current`in e||`nodeType`in e)}var E_=e=>`current`in e?e.current:e;function D_(e){let t=!0;return()=>{t?t=!1:e()}}function O_(e,t,n){let r=Jg(e,D_(n)),i=Jg(t,D_(n));return()=>{r(),i()}}function k_(e,t,n){return(t===!0||t===e)&&(n===null||n===e)}function A_(e,t=10){let n=null;return Math.abs(e.y)>t?n=`y`:Math.abs(e.x)>t&&(n=`x`),n}function j_(e,t){let n=Hp(e),r=new AbortController;return[n,{passive:!0,...t,signal:r.signal},Bp(()=>r.abort())]}function M_(e){return!(e.pointerType===`touch`||u_())}function N_(e,t,n={}){t=Vp(t);let[r,i,a]=j_(e,n);return r.forEach(e=>{let n=!1,r=!1,a,o=()=>{e.removeEventListener(`pointerleave`,u)},s=e=>{a&&=(a(e),void 0),o()},c=e=>{n=!1,window.removeEventListener(`pointerup`,c),window.removeEventListener(`pointercancel`,c),r&&(r=!1,s(e))},l=()=>{n=!0,window.addEventListener(`pointerup`,c,i),window.addEventListener(`pointercancel`,c,i)},u=e=>{e.pointerType!==`touch`&&(n?r=!0:s(e))};e.addEventListener(`pointerenter`,n=>{if(!M_(n))return;r=!1;let o=t(e,n);typeof o==`function`&&(a=o,e.addEventListener(`pointerleave`,u,i))},i),e.addEventListener(`pointerdown`,l,i)}),a}var P_=(e,t)=>t?e===t||P_(e,t.parentElement):!1,F_=new WeakSet;function I_(e){return t=>{t.key===`Enter`&&e(t)}}function L_(e,t){e.dispatchEvent(new PointerEvent(`pointer`+t,{isPrimary:!0,bubbles:!0}))}var R_=(e,t)=>{let n=!1,r=I_(()=>{F_.has(e)||(n=!0,L_(e,`down`))}),i=I_(()=>{n&&(n=!1,L_(e,`up`))});e.addEventListener(`keydown`,r,t),e.addEventListener(`keyup`,i,t),e.addEventListener(`blur`,()=>{e.removeEventListener(`keydown`,r),e.removeEventListener(`keyup`,i),n&&L_(e,`cancel`)},{...t,once:!0})};function z_(e){return jg(e)&&!u_()}var B_=new WeakSet;function V_(e,t,n={}){t=Vp(t);let[r,i,a]=j_(e,n),o=e=>{let r=e.currentTarget;if(!z_(e)||B_.has(e))return;F_.add(r),n.stopPropagation&&B_.add(e);let a=t(r,e),o={...i,capture:!0},s=(e,t)=>{window.removeEventListener(`pointerup`,c,o),window.removeEventListener(`pointercancel`,l,o),F_.has(r)&&F_.delete(r),z_(e)&&typeof a==`function`&&a(e,{success:t})},c=e=>{s(e,r===window||r===document||n.useGlobalTarget||P_(r,e.target))},l=e=>{s(e,!1)};window.addEventListener(`pointerup`,c,o),window.addEventListener(`pointercancel`,l,o)};return r.forEach(e=>{(n.useGlobalTarget?window:e).addEventListener(`pointerdown`,o,i),Lp(e)&&(e.addEventListener(`focus`,()=>R_(e,i),i),!o_(e)&&!e.hasAttribute(`tabindex`)&&(e.tabIndex=0))}),a}var H_=class{constructor(e){this.isMounted=!1,this.node=e}update(){}},U_=new Set([`baseFrequency`,`diffuseConstant`,`kernelMatrix`,`kernelUnitLength`,`keySplines`,`keyTimes`,`limitingConeAngle`,`markerHeight`,`markerWidth`,`numOctaves`,`targetX`,`targetY`,`surfaceScale`,`specularConstant`,`specularExponent`,`stdDeviation`,`tableValues`,`viewBox`,`gradientTransform`,`pathLength`,`startOffset`,`textLength`,`lengthAdjust`]),W_=e=>typeof e==`string`&&e.toLowerCase()===`svg`;function G_(e,t,n,r){Eg(e,t,void 0,r);for(let n in t.attrs)e.setAttribute(U_.has(n)?n:Up(n),t.attrs[n])}function K_(e,t,n){let r=Og(e,t,n);for(let n in e)if(n!==`children`&&(vp(e[n])||vp(t[n]))){let t=kd.indexOf(n)===-1?n:`attr`+n.charAt(0).toUpperCase()+n.substring(1);r[t]=e[n]}return r}var q_=class extends Tg{constructor(){super(...arguments),this.type=`svg`,this.isSVGTag=!1,this.measureInstanceViewportBox=ah}getBaseTargetFromProps(e,t){return Ad.has(t)?super.getBaseTargetFromProps(e,t)??Td(t):e[t]}getDefaultValue(e){return Ad.has(e)?this.latestValues[e]??Td(e):void 0}readValueFromInstance(e,t){if(Ad.has(t)){let e=md(t);return e&&e.default||0}if(Jp.includes(t)){let n=getComputedStyle(e)[t];if(typeof n==`string`&&n)return n.trim()}return t=U_.has(t)?t:Up(t),e.getAttribute(t)}scrapeMotionValuesFromProps(e,t,n){return K_(e,t,n)}build(e,t,n){Yp(e,t,this.isSVGTag,n.transformTemplate,n.style)}renderInstance(e,t,n,r){G_(e,t,n,r)}mount(e){this.isSVGTag=W_(e.tagName),super.mount(e)}};function J_(e,t){if(!Array.isArray(t))return!1;let n=t.length;if(n!==e.length)return!1;for(let r=0;r<n;r++)if(t[r]!==e[r])return!1;return!0}var Y_=[...dg].reverse();function X_(e){let t=t=>Promise.all(t.map(({animation:t,options:n})=>Dp(e,t,n))),n=Q_(),r=!0,i=!1;function a(a){let{props:o,parent:s,manuallyAnimateOnMount:c}=e,l=r||i,u=[],d=new Set,f={},p=1/0,m=e;do m=m.props.inherit!==!1&&m.parent;while(m&&!m.isControllingVariants);if(Y_.forEach((t,r)=>{let i=n[t],h=o[t],g=m&&m.props[t],_=h===void 0?ug(g)||g===!1?g:void 0:h,v=ug(_),y=t===a?i.isActive:null;y===!1&&(p=r);let b=v&&h===void 0&&!(l&&c);if(i.protectedKeys={...f},!i.isActive&&y===null||!_&&!i.prevProp||lg(_)||typeof _==`boolean`)return;if(t===`exit`&&i.isActive&&y!==!0){f={...f,...i.prevResolvedValues};return}let x=Z_(i.prevProp,_),S=x||v&&(y&&!b||r>p),C=!1,w=Array.isArray(_)?_:[_],T={};if(y!==!1)for(let n of w){let{transition:r,transitionEnd:i,...a}=dp(e,n,fp(e,t))||{};T={...T,...a,...i}}let{prevResolvedValues:E}=i;for(let t in{...E,...T}){if(t in f)continue;let n=T[t],r=E[t],a=Array.isArray(n)&&Array.isArray(r)?!J_(n,r)||x:n!==r;if(a&&n==null)d.add(t);else if(a||n!==void 0&&d.has(t)){S=!0,d.delete(t)&&(C=!0),i.needsAnimating[t]=!0;let n=e.getValue(t);n&&(n.liveStyle=!1)}else i.protectedKeys[t]=!0}if(i.prevProp=_,i.prevResolvedValues=T,i.isActive&&(f={...f,...T}),S&&(!(b&&x)||C))for(let n of w){let r={type:t};if(typeof n==`string`&&l&&c&&s?.enteringChildren){let t=dp(s,n)?.transition?.delayChildren;r.delay=Wf(s.enteringChildren,e,t)}u.push({animation:n,options:r})}}),d.size){let{initial:t}=o,n={},r=typeof t!=`boolean`&&dp(e,Array.isArray(t)?t[0]:t,e.presenceContext?.custom);r&&r.transition&&(n.transition=r.transition),d.forEach(i=>{let a=e.getValue(i);a&&(a.liveStyle=!0);let s=r&&!Array.isArray(t)?r[i]:void 0,c=e.getBaseTargetFromProps(o,i);n[i]=(s===void 0?c!==void 0&&!vp(c)?c:e.initialValues[i]===void 0?e.baseTarget[i]:void 0:s)??null}),u.push({animation:n})}let h=l&&e.blockInitialAnimation||r&&!c&&(o.initial===!1||o.initial===o.animate);return r=i=!1,!h&&u.length?t(u):Promise.resolve()}function o(t,r){if(n[t].isActive===r)return Promise.resolve();e.variantChildren?.forEach(e=>e.animationState?.setActive(t,r)),n[t].isActive=r;let i=a(t);for(let e in n)n[e].protectedKeys={};return i}return{animateChanges:a,setActive:o,setAnimateFunction:n=>{t=n(e)},getState:()=>n,reset:()=>{n=Q_(),i=!0}}}function Z_(e,t){return typeof t==`string`?t!==e:Array.isArray(t)?!J_(t,e):!1}function Q_(){let e={};for(let t of dg)e[t]={isActive:t===`animate`,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}};return e}var $_=(0,q.createContext)({transformPagePoint:e=>e,isStatic:!1,reducedMotion:`never`});function ev(e=!0){let t=(0,q.useContext)(hc);if(t===null)return[!0,null];let{isPresent:n,onExitComplete:r,register:i}=t,a=(0,q.useId)();(0,q.useEffect)(()=>{if(e)return i(a)},[e]);let o=(0,q.useCallback)(()=>e&&r&&r(a),[a,r,e]);return!n&&r?[!1,o]:[!0]}var tv=(0,q.createContext)({strict:!1}),nv={animation:[`animate`,`variants`,`whileHover`,`whileTap`,`exit`,`whileInView`,`whileFocus`,`whileDrag`],exit:[`exit`],drag:[`drag`,`dragControls`],focus:[`whileFocus`],hover:[`whileHover`,`onHoverStart`,`onHoverEnd`],tap:[`whileTap`,`onTap`,`onTapStart`,`onTapCancel`],pan:[`onPan`,`onPanStart`,`onPanSessionStart`,`onPanEnd`],inView:[`whileInView`,`onViewportEnter`,`onViewportLeave`],layout:[`layout`,`layoutId`]},rv=!1;function iv(){if(rv)return;let e={};for(let t in nv)e[t]={isEnabled:e=>nv[t].some(t=>!!e[t])};Sg(e),rv=!0}function av(){return iv(),Cg()}function ov(e){let t=av();for(let n in e)t[n]={...t[n],...e[n]};Sg(t)}var sv=(0,q.createContext)({});function cv(e,t){if(pg(e)){let{initial:t,animate:n}=e;return{initial:t===!1||ug(t)?t:void 0,animate:ug(n)?n:void 0}}return e.inherit===!1?{}:t}function lv(e){let{initial:t,animate:n}=cv(e,(0,q.useContext)(sv));return(0,q.useMemo)(()=>({initial:t,animate:n}),[uv(t),uv(n)])}function uv(e){return Array.isArray(e)?e.join(` `):e}var dv=()=>({style:{},transform:{},transformOrigin:{},vars:{}});function fv(e,t,n){for(let r in t)!vp(t[r])&&!Dg(r,n)&&(e[r]=t[r])}function pv({transformTemplate:e},t){return(0,q.useMemo)(()=>{let n=dv();return Wp(n,t,e),Object.assign({},n.vars,n.style)},[t])}function mv(e,t){let n=e.style||{},r={};return fv(r,n,e),Object.assign(r,pv(e,t)),r}function hv(e,t){let n={},r=mv(e,t);return e.drag&&e.dragListener!==!1&&(n.draggable=!1,r.userSelect=r.WebkitUserSelect=r.WebkitTouchCallout=`none`,r.touchAction=e.drag===!0?`none`:`pan-${e.drag===`x`?`y`:`x`}`),e.tabIndex===void 0&&(e.onTap||e.onTapStart||e.whileTap)&&(n.tabIndex=0),n.style=r,n}var gv=()=>({...dv(),attrs:{}});function _v(e,t,n,r){let i=(0,q.useMemo)(()=>{let n=gv();return Yp(n,t,W_(r),e.transformTemplate,e.style),{...n.attrs,style:{...n.style}}},[t]);if(e.style){let t={};return fv(t,e.style,e),{...i,style:{...t,...i.style}}}return i}var vv=new Set(`animate.exit.variants.initial.style.values.transition.transformTemplate.custom.inherit.onBeforeLayoutMeasure.onAnimationStart.onAnimationComplete.onUpdate.onDragStart.onDrag.onDragEnd.onMeasureDragConstraints.onDirectionLock.onDragTransitionEnd._dragX._dragY.onHoverStart.onHoverEnd.onViewportEnter.onViewportLeave.globalTapTarget.propagate.ignoreStrict.viewport`.split(`.`));function yv(e){return e.startsWith(`while`)||e.startsWith(`drag`)&&e!==`draggable`||e.startsWith(`layout`)||e.startsWith(`onTap`)||e.startsWith(`onPan`)||e.startsWith(`onLayout`)||vv.has(e)}function bv(e,t){return e.startsWith(`on`)?!yv(e):t?.(e)??!yv(e)}function xv(e,t,n,r){let i={};for(let a in e)a===`values`&&typeof e.values==`object`||vp(e[a])||(bv(a,r)||n===!0&&yv(a)||!t&&!yv(a)||e.draggable&&a.startsWith(`onDrag`))&&(i[a]=e[a]);return i}var Sv=[`animate`,`circle`,`defs`,`desc`,`ellipse`,`g`,`image`,`line`,`filter`,`marker`,`mask`,`metadata`,`path`,`pattern`,`polygon`,`polyline`,`rect`,`stop`,`switch`,`symbol`,`svg`,`text`,`tspan`,`use`,`view`];function Cv(e){return typeof e!=`string`||e.includes(`-`)?!1:!!(Sv.indexOf(e)>-1||/[A-Z]/u.test(e))}function wv(e,t,n,{latestValues:r},i,a=!1,o,s){let c=(o??Cv(e)?_v:hv)(t,r,i,e),l=xv(t,typeof e==`string`,a,s),u=e===q.Fragment?{}:{...l,...c,ref:n},{children:d}=t,f=(0,q.useMemo)(()=>vp(d)?d.get():d,[d]);return(0,q.createElement)(e,{...u,children:f})}function Tv({scrapeMotionValuesFromProps:e,createRenderState:t},n,r,i){return{latestValues:Ev(n,r,i,e),renderState:t()}}function Ev(e,t,n,r){let i={},a=r(e,{});for(let e in a)i[e]=wm(a[e]);let{initial:o,animate:s}=e,c=pg(e),l=mg(e);t&&l&&!c&&e.inherit!==!1&&(o===void 0&&(o=t.initial),s===void 0&&(s=t.animate));let u=n?n.initial===!1:!1;u||=o===!1;let d=u?s:o;if(d&&typeof d!=`boolean`&&!lg(d)){let t=Array.isArray(d)?d:[d];for(let n=0;n<t.length;n++){let r=up(e,t[n]);if(r){let{transitionEnd:e,transition:t,...n}=r;for(let e in n){let t=n[e];if(Array.isArray(t)){let e=u?t.length-1:0;t=t[e]}t!==null&&(i[e]=t)}for(let t in e)i[t]=e[t]}}}return i}var Dv=e=>(t,n)=>{let r=(0,q.useContext)(sv),i=(0,q.useContext)(hc),a=()=>Tv(e,t,r,i);return n?a():pc(a)},Ov=Dv({scrapeMotionValuesFromProps:Og,createRenderState:dv}),kv=Dv({scrapeMotionValuesFromProps:K_,createRenderState:gv}),Av=Symbol.for(`motionComponentSymbol`);function jv(e,t,n){let r=(0,q.useRef)(n);(0,q.useInsertionEffect)(()=>{r.current=n});let i=(0,q.useRef)(null);return(0,q.useCallback)(n=>{n&&e.onMount?.(n),t&&(n?t.mount(n):t.unmount());let a=r.current;if(typeof a==`function`){if(n){let e=a(n);typeof e==`function`&&(i.current=e)}else i.current?(i.current(),i.current=null):a(n)}else a&&(a.current=n)},[t])}var Mv=(0,q.createContext)({});function Nv(e){return e&&typeof e==`object`&&Object.prototype.hasOwnProperty.call(e,`current`)}function Pv(e,t,n,r,i,a){let{visualElement:o}=(0,q.useContext)(sv),s=(0,q.useContext)(tv),c=(0,q.useContext)(hc),l=(0,q.useContext)($_),u=l.reducedMotion,d=l.skipAnimations,f=(0,q.useRef)(null),p=(0,q.useRef)(!1);r||=s.renderer,!f.current&&r&&(f.current=r(e,{visualState:t,parent:o,props:n,presenceContext:c,blockInitialAnimation:c?c.initial===!1:!1,reducedMotionConfig:u,skipAnimations:d,isSVG:a}),p.current&&f.current&&(f.current.manuallyAnimateOnMount=!0));let m=f.current,h=(0,q.useContext)(Mv);m&&!m.projection&&i&&(m.type===`html`||m.type===`svg`)&&Fv(f.current,n,i,h),(0,q.useInsertionEffect)(()=>{m&&m.props!==n&&m.update(n,c)});let g=n[xp],_=(0,q.useRef)(!!g&&typeof window<`u`&&!window.MotionHandoffIsComplete?.(g)&&window.MotionHasOptimisedAnimation?.(g));return mc(()=>{p.current&&m&&(m.animationState?.animateChanges(),m.enteringChildren=void 0)},[]),mc(()=>{p.current=!0,m&&(window.MotionIsMounted=!0,m.updateFeatures(),m.scheduleRenderMicrotask(),_.current&&m.animationState&&m.animationState.animateChanges())}),(0,q.useEffect)(()=>{m&&(!_.current&&m.animationState&&m.animationState.animateChanges(),_.current&&=(queueMicrotask(()=>{window.MotionHandoffMarkAsComplete?.(g)}),!1),m.enteringChildren=void 0)}),m}function Fv(e,t,n,r){let{layoutId:i,layout:a,drag:o,dragConstraints:s,layoutScroll:c,layoutRoot:l,layoutAnchor:u,layoutCrossfade:d}=t,f=e.projection=new n(e.latestValues,t[`data-framer-portal-id`]?void 0:Iv(e.parent));f.setOptions({layoutId:i,layout:a,alwaysMeasureLayout:!!o||s&&Nv(s),visualElement:e,animationType:typeof a==`string`?a:`both`,initialPromotionConfig:r,crossfade:d,layoutScroll:c,layoutRoot:l,layoutAnchor:u});let p=f.getStack()?.lead;p&&!f.root.isUpdateBlocked()&&(p.willUpdate(),p.scheduleCheckAfterUnmount())}function Iv(e){if(e)return e.options.allowProjection===!1?Iv(e.parent):e.projection}function Lv(e,{forwardMotionProps:t=!1,type:n}={},r,i){r&&ov(r);let a=n?n===`svg`:Cv(e),o=a?kv:Ov;function s(n,s){let c,l=Rv(n);pc(()=>!!og.current?.sharedNodes.get(l)?.lead&&n.initial)&&(n={...n,initial:!1});let u={...(0,q.useContext)($_),...n,layoutId:l},{isStatic:d,isValidProp:f}=u,p=lv(n),m=o(n,d);if(!d&&typeof window<`u`){zv(u,r);let t=Bv(u);c=t.MeasureLayout,p.visualElement=Pv(e,m,u,i,t.ProjectionNode,a)}return(0,J.jsxs)(sv.Provider,{value:p,children:[c&&p.visualElement?(0,J.jsx)(c,{visualElement:p.visualElement,...u}):null,wv(e,n,jv(m,p.visualElement,s),m,d,t,a,f)]})}s.displayName=`motion.${typeof e==`string`?e:`create(${e.displayName??e.name??``})`}`;let c=(0,q.forwardRef)(s);return c[Av]=e,c}function Rv({layoutId:e}){let t=(0,q.useContext)(fc).id;return t&&e!==void 0?t+`-`+e:e}function zv(e,t){(0,q.useContext)(tv).strict}function Bv(e){let{drag:t,layout:n}=av();if(!t&&!n)return{};let r={...t,...n};return{MeasureLayout:t?.isEnabled(e)||n?.isEnabled(e)?r.MeasureLayout:void 0,ProjectionNode:r.ProjectionNode}}function Vv(e,t){if(typeof Proxy>`u`)return Lv;let n=new Map,r=(n,r)=>Lv(n,r,e,t);return new Proxy((e,t)=>r(e,t),{get:(i,a)=>a===`create`?r:(n.has(a)||n.set(a,Lv(a,void 0,e,t)),n.get(a))})}var Hv=(e,t)=>t.isSVG??Cv(e)?new q_(t):new Ag(t,{allowProjection:e!==q.Fragment}),Uv=class extends H_{constructor(e){super(e),e.animationState||=X_(e)}updateAnimationControlsSubscription(){let{animate:e}=this.node.getProps();lg(e)&&(this.unmountControls=e.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){let{animate:e}=this.node.getProps(),{animate:t}=this.node.prevProps||{};e!==t&&this.updateAnimationControlsSubscription()}unmount(){this.node.animationState.reset(),this.unmountControls?.()}},Wv=0,Gv={animation:{Feature:Uv},exit:{Feature:class extends H_{constructor(){super(...arguments),this.id=Wv++}update(){let{presenceContext:e,prevPresenceContext:t,animationState:n}=this.node;if(!e||!n)return;let{isPresent:r,onExitComplete:i}=e,a=t?.isPresent;if(r===a)return;if(r&&a===!1){if(this.exit===!0){let{initial:e}=this.node.getProps();if(e&&!Array.isArray(e)){let{transition:t,transitionEnd:n,...r}=dp(this.node,e)||{};for(let e in r)this.node.getValue(e)?.jump(r[e])}this.node.blockInitialAnimation=!1,n.reset(),n.animateChanges()}else n.setActive(`exit`,!1);this.exit=void 0;return}let o=this.exit=n.setActive(`exit`,!r);i&&!r&&o.then(()=>{this.exit===o&&(this.exit=!0,i(this.id))})}mount(){let{register:e,onExitComplete:t}=this.node.presenceContext||{};t&&t(this.id),e&&(this.unmount=e(this.id,this.node))}unmount(){}}}},Kv=class extends H_{constructor(e){super(e),this.removeGroupControls=wc,this.removeListeners=wc,this.controls=new w_(e)}mount(){let{dragControls:e}=this.node.getProps();e&&(this.removeGroupControls=e.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||wc}update(){let{dragControls:e,drag:t}=this.node.getProps(),{dragControls:n,drag:r}=this.node.prevProps||{};e!==n&&(this.removeGroupControls(),e&&(this.removeGroupControls=e.subscribe(this.controls))),r&&!t&&this.controls.stop(void 0,void 0,r)}unmount(){this.removeGroupControls(),this.removeListeners(),this.controls.isDragging||this.controls.endPanSession()}},qv=({current:e})=>e?e.ownerDocument.defaultView:null,Jv=e=>(t,n)=>{e&&hu.update(()=>e(t,n),!1,!0)},Yv=class extends H_{constructor(){super(...arguments),this.removePointerDownListener=wc}onPointerDown(e){this.session=new Qg(e,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:qv(this.node)})}createPanHandlers(){let{onPanSessionStart:e,onPanStart:t,onPan:n,onPanEnd:r}=this.node.getProps();return{onSessionStart:Jv(e),onStart:Jv(t),onMove:Jv(n),onEnd:(e,t)=>{delete this.session,r&&hu.postRender(()=>r(e,t))}}}mount(){this.removePointerDownListener=Pg(this.node.current,`pointerdown`,e=>this.onPointerDown(e))}update(){this.session&&this.session.updateHandlers(this.createPanHandlers())}unmount(){this.removePointerDownListener(),this.session&&this.session.end()}},Xv=!1,Zv=({layout:e,layoutDependency:t})=>({layout:e,layoutDependency:t,animationType:typeof e==`string`?e:`both`}),Qv=class extends q.Component{componentDidMount(){let{visualElement:e,layoutGroup:t,switchLayoutGroup:n,layoutId:r}=this.props,{projection:i}=e;i&&(t.group&&t.group.add(i),n&&n.register&&r&&n.register(i),Xv&&i.root.didUpdate(),i.addEventListener(`animationComplete`,()=>{this.safeToRemove()}),i.setOptions({...i.options,...Zv(this.props),onExitComplete:()=>this.safeToRemove()})),Sh.hasEverUpdated=!0}getSnapshotBeforeUpdate(e){let{layout:t,layoutDependency:n,visualElement:r,drag:i,isPresent:a}=this.props,{projection:o}=r;return o&&(o.isPresent=a,(e.layoutDependency!==n||e.layout!==t)&&o.setOptions({...o.options,...Zv(this.props)}),Xv=!0,i||e.layoutDependency!==n||n===void 0||e.isPresent!==a?o.willUpdate():this.safeToRemove(),e.isPresent!==a&&(a?o.promote():o.relegate()||hu.postRender(()=>{let e=o.getStack();e&&e.members.length||this.safeToRemove()}))),null}componentDidUpdate(){let{visualElement:e,layoutAnchor:t}=this.props,{projection:n}=e;n&&(n.options.layoutAnchor=t,n.root.didUpdate(),_m.postRender(()=>{!n.currentAnimation&&n.isLead()&&this.safeToRemove()}))}componentWillUnmount(){let{visualElement:e,layoutGroup:t,switchLayoutGroup:n}=this.props,{projection:r}=e;Xv=!0,r&&(r.scheduleCheckAfterUnmount(),t&&t.group&&t.group.remove(r),n&&n.deregister&&n.deregister(r))}safeToRemove(){let{safeToRemove:e}=this.props;e&&e()}render(){return null}};function $v(e){let[t,n]=ev(),r=(0,q.useContext)(fc);return(0,J.jsx)(Qv,{...e,layoutGroup:r,switchLayoutGroup:(0,q.useContext)(Mv),isPresent:t,safeToRemove:n})}var ey={pan:{Feature:Yv},drag:{Feature:Kv,ProjectionNode:sg,MeasureLayout:$v}};function ty(e,t,n){let{props:r}=e;e.animationState&&r.whileHover&&e.animationState.setActive(`whileHover`,n===`Start`);let i=r[`onHover`+n];i&&hu.postRender(()=>i(t,Mg(t)))}var ny=class extends H_{mount(){let{current:e}=this.node;e&&(this.unmount=N_(e,(e,t)=>(ty(this.node,t,`Start`),e=>ty(this.node,e,`End`))))}unmount(){}},ry=class extends H_{constructor(){super(...arguments),this.isActive=!1}onFocus(){let e=!1;try{e=this.node.current.matches(`:focus-visible`)}catch{e=!0}e&&this.node.animationState&&(this.node.animationState.setActive(`whileFocus`,!0),this.isActive=!0)}onBlur(){this.isActive&&this.node.animationState&&(this.node.animationState.setActive(`whileFocus`,!1),this.isActive=!1)}mount(){this.unmount=Tc(ig(this.node.current,`focus`,()=>this.onFocus()),ig(this.node.current,`blur`,()=>this.onBlur()))}unmount(){}};function iy(e,t,n){let{props:r}=e;if(e.current instanceof HTMLButtonElement&&e.current.disabled)return;e.animationState&&r.whileTap&&e.animationState.setActive(`whileTap`,n===`Start`);let i=r[`onTap`+(n===`End`?``:n)];i&&hu.postRender(()=>i(t,Mg(t)))}var ay=class extends H_{mount(){let{current:e}=this.node;if(!e)return;let{globalTapTarget:t,propagate:n}=this.node.props;this.unmount=V_(e,(e,t)=>(iy(this.node,t,`Start`),(e,{success:t})=>iy(this.node,e,t?`End`:`Cancel`)),{useGlobalTarget:t,stopPropagation:n?.tap===!1})}unmount(){}},oy=new WeakMap,sy=new WeakMap,cy=e=>{let t=oy.get(e.target);t&&t(e)},ly=e=>{e.forEach(cy)};function uy({root:e,...t}){let n=e||document;sy.has(n)||sy.set(n,{});let r=sy.get(n),i=JSON.stringify(t);return r[i]||(r[i]=new IntersectionObserver(ly,{root:e,...t})),r[i]}function dy(e,t,n){let r=uy(t);return oy.set(e,n),r.observe(e),()=>{oy.delete(e),r.unobserve(e)}}var fy={some:0,all:1},py=class extends H_{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){this.stopObserver?.();let{viewport:e={}}=this.node.getProps(),{root:t,margin:n,amount:r=`some`,once:i}=e,a={root:t?t.current:void 0,rootMargin:n,threshold:typeof r==`number`?r:fy[r]},o=e=>{let{isIntersecting:t}=e;if(this.isInView===t||(this.isInView=t,i&&!t&&this.hasEnteredView))return;t&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive(`whileInView`,t);let{onViewportEnter:n,onViewportLeave:r}=this.node.getProps(),a=t?n:r;a&&a(e)};this.stopObserver=dy(this.node.current,a,o)}mount(){this.startObserver()}update(){if(typeof IntersectionObserver>`u`)return;let{props:e,prevProps:t}=this.node;[`amount`,`margin`,`root`].some(my(e,t))&&this.startObserver()}unmount(){this.stopObserver?.(),this.hasEnteredView=!1,this.isInView=!1}};function my({viewport:e={}},{viewport:t={}}={}){return n=>e[n]!==t[n]}var hy=Vv(Object.assign({},Gv,{inView:{Feature:py},tap:{Feature:ay},focus:{Feature:ry},hover:{Feature:ny}},ey,{layout:{ProjectionNode:sg,MeasureLayout:$v}}),Hv);function gy(){!_g.current&&yg();let[e]=(0,q.useState)(gg.current);return e}var _y=hy;function vy({className:e,checked:t,onCheckedChange:n,disabled:r,defaultChecked:i,...a}){let[o,s]=q.useState(i??!1),c=t??o,l=gy()??!1,u=e=>{t===void 0&&s(e),n?.(e)},d=!r&&!l;return(0,J.jsx)(_y.div,{className:`inline-flex flex-none`,whileTap:d?{scale:.95}:void 0,whileHover:d?{scale:1.05}:void 0,transition:{type:`spring`,stiffness:400,damping:25},children:(0,J.jsx)(oc,{checked:c,onCheckedChange:e=>u(e===!0),disabled:r,className:L(`flex size-[16px] shrink-0 cursor-pointer items-center justify-center rounded-[4px] border-[1.5px] border-muted bg-bg p-0 text-accent-ink transition-colors duration-200 outline-none hover:border-accent`,`data-[state=checked]:border-accent data-[state=checked]:bg-accent`,`focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-accent`,`disabled:cursor-not-allowed disabled:opacity-50 disabled:hover:border-muted`,e),...a,children:(0,J.jsx)(`svg`,{className:`size-full`,viewBox:`0 0 12 12`,fill:`none`,"aria-hidden":`true`,children:(0,J.jsx)(_y.path,{d:`M2.5 6L4.5 8L9.5 3`,stroke:`currentColor`,strokeWidth:`1.5`,strokeLinecap:`round`,strokeLinejoin:`round`,fill:`none`,initial:!1,animate:c?`checked`:`unchecked`,variants:{checked:{pathLength:1,opacity:1,transition:l?{duration:0}:{pathLength:{duration:.2,ease:`easeInOut`,delay:.1},opacity:{duration:.1,ease:`easeInOut`}}},unchecked:{pathLength:0,opacity:0,transition:l?{duration:0}:{pathLength:{duration:.2,ease:`easeInOut`},opacity:{duration:.2,ease:`easeInOut`,delay:.05}}}}})})})})}var yy=`forgeqe-agent-favourites`,by=`forgeqe-agent-favourites`;function xy(){let e=()=>{try{return ki(localStorage.getItem(yy))}catch{return[]}},[t,n]=(0,q.useState)(e);return(0,q.useEffect)(()=>{let t=()=>n(e());return window.addEventListener(by,t),window.addEventListener(`storage`,t),()=>{window.removeEventListener(by,t),window.removeEventListener(`storage`,t)}},[]),{favs:t,toggle:e=>{let r=t.includes(e)?t.filter(t=>t!==e):[...t,e];n(r);try{localStorage.setItem(yy,JSON.stringify(r)),window.dispatchEvent(new Event(by))}catch{}cr(`favourites`)}}}var Sy={attention:{label:`Needs attention`,tone:`fail`},partial:{label:`Partly set up`,tone:`warn`},ready:{label:`Ready`,tone:`pass`},unavailable:{label:`Unavailable`,tone:`neutral`}},Cy={pass:`bg-pass`,warn:`bg-warn`,fail:`bg-fail`,neutral:`bg-line-strong`,running:`bg-accent`},wy=(e,t)=>{let n=$n(e),r=t?.[n.agent];return{fav:n.id,href:Kt(n),name:Ln(n.agent).name,about:n.about,short:n.short,icon:(0,J.jsx)(_r,{agent:n.agent,px:44,iconPx:24,frame:ky}),tags:r?.tags??[],...r?{status:r.status}:{},note:r?.note??``}},Ty={active:{label:`Active`,tone:`pass`},changed:{label:`Change waiting`,tone:`warn`},draft:{label:`Draft`,tone:`neutral`},invalid:{label:`Needs fixing`,tone:`fail`},broken:{label:`Cannot run`,tone:`fail`},disabled:{label:`Disabled`,tone:`neutral`}},Ey={active:`ready`,changed:`partial`,draft:`partial`,invalid:`attention`,broken:`attention`,disabled:`unavailable`},Dy=e=>({fav:ir(e.id),href:B(`agents`,`custom`,e.id),name:e.name,about:e.description||`No description yet.`,short:e.description||Ty[e.state].label,icon:(0,J.jsx)(_r,{agent:e.id,icon:e.icon,px:44,iconPx:24,frame:ky}),status:Ey[e.state],note:Ty[e.state].label,tags:[...e.state===`active`?[]:[Ty[e.state].label],...e.approvedVersion?[`v${e.approvedVersion}`]:[],...e.problems?[`${e.problems} problem${e.problems===1?``:`s`}`]:[]]});function Oy({cards:e}){let t=Object.values(e||{});if(!t.length||t.some(e=>e.status!==`unavailable`))return null;let n=[...new Set(t.map(e=>(e.note||``).replace(/:\s*Set up\.?$/,``).trim()).filter(Boolean))],r=n.length>0&&n.every(e=>/^No model/i.test(e));return(0,J.jsxs)(`div`,{role:`status`,className:`flex w-full flex-wrap items-center gap-x-4 gap-y-4 border-y border-line py-4`,children:[(0,J.jsx)(Zt,{icon:T,size:20,className:`flex-none text-accent-fg`}),(0,J.jsxs)(`span`,{className:`flex min-w-0 flex-[1_1_280px] flex-col gap-1`,children:[(0,J.jsx)(`span`,{className:`font-medium`,children:`No agent can run yet`}),(0,J.jsx)(`span`,{className:`text-sm text-muted [overflow-wrap:anywhere]`,children:n.length?n.join(` · `):`ForgeQE is not set up on this computer.`})]}),(0,J.jsxs)(`a`,{className:Ct({variant:`primary`}),href:r?B(`settings`,`models`):B(`settings`,`setup`),"data-tip":r?`Add a model key`:`Install what's missing`,children:[(0,J.jsx)(b,{"aria-hidden":`true`}),`Set up`]})]})}var ky=`flex size-10 flex-none items-center justify-center rounded-[10px] @min-[260px]/col:size-11 bg-surface-strong`;function Ay({item:e,favs:t}){let n=t.favs.includes(e.fav),r=e.status?Sy[e.status]:void 0,i=[e.about,r&&`${r.label}${e.note?`: ${e.note}`:``}`,e.tags.length?e.tags.join(`, `):``].filter(Boolean).join(`
40
- `);return(0,J.jsxs)(`li`,{className:`relative`,children:[(0,J.jsxs)(`a`,{href:e.href,"data-tip":i,className:`flex min-h-[68px] items-center gap-2 rounded-[12px] py-2 pr-8 pl-2 @min-[260px]/col:gap-4 @min-[260px]/col:pl-2 @min-[260px]/col:pr-10 text-ink no-underline hover:bg-surface-strong hover:text-ink`,children:[e.icon,(0,J.jsxs)(`span`,{className:`flex min-w-0 flex-col gap-1`,children:[(0,J.jsxs)(`span`,{className:`flex min-w-0 items-center gap-2`,children:[(0,J.jsx)(`span`,{className:`line-clamp-2 text-[13px] leading-tight font-semibold @min-[260px]/col:text-[16px]`,children:e.name}),r&&(0,J.jsx)(`span`,{className:L(`size-[7px] flex-none rounded-full`,Cy[r.tone]),"aria-hidden":`true`})]}),(0,J.jsx)(`span`,{className:`truncate text-[13px] text-muted`,children:e.short}),(0,J.jsxs)(`span`,{className:`sr-only`,children:[r?`${r.label}${e.note?`: ${e.note}`:``}. `:``,e.about,e.tags.length?` ${e.tags.join(`, `)}.`:``]})]})]}),(0,J.jsx)(V,{variant:`icon`,size:`icon`,"aria-pressed":n,"aria-label":n?`Remove ${vr(e.name)} from favourites`:`Add ${vr(e.name)} to favourites`,"data-tip":n?`Remove from favourites`:`Add to favourites`,onClick:()=>t.toggle(e.fav),className:L(`absolute top-1/2 right-0 size-8 -translate-y-1/2`,n?`text-ink`:`text-muted`),children:(0,J.jsx)(at,{size:14,strokeWidth:1.8,fill:n?`currentColor`:`none`,"aria-hidden":`true`})})]})}function jy({level:e}){return(0,J.jsx)(`span`,{role:`img`,"aria-label":`Autonomy ${e} of 3`,"data-tip":[``,`Helps you decide`,`Makes the work itself`,`Acts on its own`][e],className:`ml-auto flex items-end gap-1`,children:[1,2,3].map(t=>(0,J.jsx)(`span`,{className:L(`w-[4px] rounded-[1px]`,t<=e?`bg-accent`:`bg-line`),style:{height:4+t*4}},t))})}var My={assisted:1,native:2,agentic:3};function Ny({id:e,title:t,short:n,about:r,items:i,empty:a,favs:o,footer:s}){return(0,J.jsxs)(`section`,{"aria-labelledby":`agents-${e}`,className:`@container/col flex min-w-0 flex-col`,children:[(0,J.jsxs)(`div`,{className:`flex flex-col gap-1 border-b border-line px-2 pt-1 pb-4 mb-2`,children:[(0,J.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,J.jsxs)(`h2`,{id:`agents-${e}`,"data-tip":r,className:`m-0 text-[16px] font-semibold`,children:[t,(0,J.jsx)(`span`,{className:`ml-2 text-[13px] font-normal text-muted tabular-nums`,children:i.length})]}),My[e]!==void 0&&(0,J.jsx)(jy,{level:My[e]})]}),(0,J.jsx)(`p`,{className:`m-0 text-[13px] text-muted`,children:n}),r&&(0,J.jsx)(`p`,{className:`sr-only`,children:r})]}),i.length?(0,J.jsx)(`ul`,{className:`m-0 flex list-none flex-col gap-1 p-0`,children:i.map(e=>(0,J.jsx)(Ay,{item:e,favs:o},e.fav))}):(0,J.jsx)(nn,{center:!0,className:`py-10`,action:s,children:a}),s&&i.length>0&&(0,J.jsx)(`div`,{className:`pt-2`,children:s})]})}function Py({items:e,value:t,onChange:n}){return(0,J.jsx)(`div`,{role:`group`,"aria-label":`Show`,className:`flex flex-wrap gap-2`,children:e.map(e=>{let r=t===e.id;return(0,J.jsxs)(`button`,{type:`button`,"aria-pressed":r,onClick:()=>n(e.id),className:L(`inline-flex h-9 cursor-pointer items-center gap-2 rounded-[8px] border px-4 text-[13px] font-medium`,r?`border-accent bg-accent-soft text-ink`:`border-transparent bg-surface-strong text-ink hover:bg-line`),children:[e.tone&&(0,J.jsx)(`span`,{className:L(`size-2 rounded-[2px]`,Cy[e.tone]),"aria-hidden":`true`}),e.label,e.n!==void 0&&(0,J.jsx)(`span`,{className:L(`tabular-nums`,r?`opacity-70`:`text-muted`),children:e.n})]},e.id)})})}var Fy=`favourites`;function Iy(){return(0,J.jsxs)(`a`,{href:B(`agents`,`custom`,`new`),className:L(Ct({variant:`primary`}),`no-underline`),"data-tip":`New agent`,children:[(0,J.jsx)(k,{"aria-hidden":`true`}),`New`]})}function Ly({onDone:e}){let[t,n]=(0,q.useState)(!1),[r,i]=(0,q.useState)(null),[a,o]=(0,q.useState)(``),[s,c]=(0,q.useState)(``),[l,u]=(0,q.useState)(null),[d,f]=(0,q.useState)(!1),[p,m]=(0,q.useState)(!1),[h,g]=(0,q.useState)(``),_=(0,q.useRef)(null),v=()=>{i(null),o(``),c(``),u(null),f(!1),g(``)},y=e=>new Promise((t,n)=>{let r=new FileReader;r.onload=()=>{let e=String(r.result||``),n=e.indexOf(`,`);t(n>=0?e.slice(n+1):e)},r.onerror=()=>n(r.error||Error(`Could not read the package.`)),r.readAsDataURL(e)}),b=async e=>{if(g(``),u(null),e.size>4194304)g(`The package is larger than 4 MB.`);else try{let t=await y(e);i(t),o(e.name);let n=await _n.importPreview(t);u(n),c(n.id||``)}catch(e){i(null),g(e.message||`That file is not a valid package.`)}},x=async e=>{if(r){m(!0),g(``);try{let t=await _n.importPreview(r,e.trim()||void 0);u(t)}catch(e){g(e.message)}finally{m(!1)}}},S=async()=>{if(r&&l){m(!0),g(``);try{let t=await _n.importPack(r,{id:s.trim()||void 0,overwriteKnowledge:d});n(!1),v(),e(t.id)}catch(e){g(e.message)}finally{m(!1)}}},C=l?[...l.missing.environments.map(e=>`environment ${e}`),...l.missing.systems.map(e=>`system ${e}`),...l.missing.capabilities.map(e=>`capability ${e}`),...l.missing.skills.map(e=>`skill ${e}`),...l.missing.knowledge.map(e=>`knowledge ${e}`)]:[],w=!(!l||l.problems.length||l.idTaken);return(0,J.jsxs)(J.Fragment,{children:[(0,J.jsxs)(V,{size:`sm`,variant:`ghost`,onClick:()=>(n(!0),v()),"data-tip":`Import agent`,children:[(0,J.jsx)(mt,{"aria-hidden":`true`}),`Import`]}),(0,J.jsx)(yr,{open:t,onClose:()=>(n(!1),v()),title:`Import a custom agent`,description:`A .forgeqe-agent.zip from Export to share (agent.json plus knowledge and skill files). It becomes a draft here: you edit, try and approve it. Environments and systems of this project must already exist.`,footer:(0,J.jsxs)(J.Fragment,{children:[(0,J.jsxs)(V,{variant:`ghost`,onClick:()=>(n(!1),v()),children:[(0,J.jsx)(A,{"aria-hidden":`true`}),`Cancel`]}),(0,J.jsxs)(V,{variant:`primary`,disabled:p||!w||l?.warnings.some(e=>e.includes(`already exists here`)&&e.startsWith(`knowledge`))&&!d,onClick:()=>void S(),"data-tip":`Import as draft`,children:[(0,J.jsx)(mt,{"aria-hidden":`true`}),`Import`]})]}),children:(0,J.jsxs)(`div`,{className:`flex flex-col gap-4 text-sm`,children:[(0,J.jsx)(`input`,{ref:_,type:`file`,accept:`.zip,application/zip`,className:`sr-only`,onChange:e=>{let t=e.target.files?.[0];e.target.value=``,t&&b(t)}}),(0,J.jsxs)(V,{size:`sm`,className:`self-start`,onClick:()=>_.current?.click(),"data-tip":a?`Choose another file`:`Choose .zip package`,children:[(0,J.jsx)(ut,{"aria-hidden":`true`}),`Choose`]}),a&&(0,J.jsx)(`span`,{className:`text-muted`,children:a}),l&&(0,J.jsxs)(J.Fragment,{children:[(0,J.jsxs)(`label`,{className:`flex flex-col gap-2`,children:[(0,J.jsx)(`span`,{className:`font-medium`,children:`Id`}),(0,J.jsx)(R,{value:s,maxLength:40,spellCheck:!1,onChange:e=>c(e.target.value.toLowerCase()),onBlur:()=>void x(s)}),l.idTaken&&(0,J.jsx)(`span`,{className:`text-[13px] text-warn`,children:`That id is taken here. Choose another before importing.`})]}),l.knowledge.length>0&&(0,J.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,J.jsx)(`span`,{className:`font-medium`,children:`Knowledge it brings`}),(0,J.jsx)(`ul`,{className:`m-0 list-disc pl-6 text-ink-2`,children:l.knowledge.map(e=>(0,J.jsx)(`li`,{children:e.path},e.path))})]}),l.skills.length>0&&(0,J.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,J.jsx)(`span`,{className:`font-medium`,children:`Skills it brings`}),(0,J.jsx)(`ul`,{className:`m-0 list-disc pl-6 text-ink-2`,children:l.skills.map(e=>(0,J.jsx)(`li`,{children:e.name},e.name))})]}),C.length>0&&(0,J.jsxs)(`div`,{className:`flex flex-col gap-1 rounded-[12px] bg-warn-soft px-4 py-2 text-warn`,children:[(0,J.jsx)(`span`,{className:`font-medium`,children:`This project still needs`}),(0,J.jsx)(`ul`,{className:`m-0 list-disc pl-6`,children:C.map(e=>(0,J.jsx)(`li`,{children:e},e))})]}),l.warnings.some(e=>e.startsWith(`knowledge file `)&&e.endsWith(` already exists here`))&&(0,J.jsxs)(`label`,{className:`flex items-center gap-2`,children:[(0,J.jsx)(vy,{checked:d,onCheckedChange:f}),`Replace existing knowledge files of the same path`]}),l.problems.length>0&&(0,J.jsx)(`ul`,{className:`m-0 list-disc pl-6 text-fail`,children:l.problems.map((e,t)=>(0,J.jsx)(`li`,{children:e},t))})]}),h&&(0,J.jsx)(`p`,{className:`m-0 text-fail`,children:h})]})})]})}function Ry(){let[e,t]=(0,q.useState)(null),[n,r]=(0,q.useState)(``),[i,a]=(0,q.useState)(``);return(0,q.useEffect)(()=>{let e=!1;return _n.list().then(n=>{e||(On(n.agents,`replace`),t(n.agents),a(n.off||``))},n=>{e||(t([]),r(n.message))}),()=>{e=!0}},[]),{rows:e,error:n,off:i,setRows:t}}function zy(){return(0,J.jsxs)(`p`,{role:`status`,className:`m-0 flex flex-wrap items-center gap-x-2 rounded-[12px] bg-surface-muted px-4 py-4 text-sm text-ink-2`,children:[`Custom agents are turned off for this project: none runs, from here, the terminal, Atlas or a schedule.`,(0,J.jsx)(`a`,{href:B(`settings`),children:`Turn them on in Settings, Custom agents`})]})}function By({rows:e,onDone:t}){let[n,r]=(0,q.useState)(!1),[i,a]=(0,q.useState)([]),[o,s]=(0,q.useState)(null),[c,l]=(0,q.useState)(``),[u,d]=(0,q.useState)(!1),[f,p]=(0,q.useState)(``),m=e.filter(e=>e.approvedVersion);if(!m.length)return null;let h=m.filter(e=>i.includes(e.id)),g=async()=>{if(o){d(!0);try{let e=await _n.bulk(o,i,c);t(e.agents),p(`${o===`disable`?`Disabled`:`Enabled`} ${e.done.length}${e.skipped.length?`; skipped ${e.skipped.map(e=>e.id).join(`, `)} (already ${o}d)`:``}.`),s(null),a([]),r(!1)}catch(e){p(e.message)}finally{d(!1),l(``)}}};return(0,J.jsxs)(`section`,{"aria-labelledby":`custom-bulk`,className:`flex flex-col gap-2`,children:[(0,J.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,J.jsx)(`h2`,{id:`custom-bulk`,className:`m-0 flex-1 text-[13px] font-semibold text-muted`,children:`Disable or enable several`}),(0,J.jsxs)(V,{size:`sm`,variant:`ghost`,onClick:()=>(r(!n),a([]),p(``)),"data-tip":n?void 0:`Select agents`,children:[n?(0,J.jsx)(A,{"aria-hidden":`true`}):(0,J.jsx)(ot,{"aria-hidden":`true`}),n?`Cancel`:`Select`]})]}),n&&(0,J.jsxs)(`div`,{className:`flex flex-col gap-2 rounded-[12px] card border p-4`,children:[(0,J.jsxs)(`label`,{className:`flex items-center gap-2 text-sm font-medium`,children:[(0,J.jsx)(vy,{checked:i.length===m.length,onCheckedChange:e=>a(e?m.map(e=>e.id):[])}),`All `,m.length,` approved agents`]}),(0,J.jsx)(`ul`,{className:`m-0 grid list-none grid-cols-1 gap-2 p-0 sm:grid-cols-2`,children:m.map(e=>(0,J.jsx)(`li`,{children:(0,J.jsxs)(`label`,{className:`flex items-center gap-2 text-sm`,children:[(0,J.jsx)(vy,{checked:i.includes(e.id),onCheckedChange:t=>a(t?[...i,e.id]:i.filter(t=>t!==e.id))}),(0,J.jsx)(`span`,{className:`min-w-0 truncate`,children:e.name}),(0,J.jsx)(z,{tone:Ty[e.state].tone,icon:!1,children:Ty[e.state].label})]})},e.id))}),(0,J.jsxs)(`div`,{className:`flex flex-wrap gap-2`,children:[(0,J.jsxs)(V,{size:`sm`,disabled:!i.length,onClick:()=>s(`disable`),children:[(0,J.jsx)(w,{"aria-hidden":`true`}),i.length?`Disable (${i.length})`:`Disable`]}),(0,J.jsxs)(V,{size:`sm`,variant:`ghost`,disabled:!i.length,onClick:()=>s(`enable`),children:[(0,J.jsx)(O,{"aria-hidden":`true`}),i.length?`Enable (${i.length})`:`Enable`]})]})]}),f&&(0,J.jsx)(`p`,{role:`status`,className:`m-0 text-[13px] text-muted`,children:f}),o&&(0,J.jsx)(yr,{open:!0,onClose:()=>(s(null),l(``)),title:`${o===`disable`?`Disable`:`Enable`} ${h.length} agent${h.length===1?``:`s`}`,description:o===`disable`?`None of them runs (not you, your team, Atlas or their schedules) until a person enables it again. Their versions and history are kept.`:`Their approved versions run again, and their schedules come back.`,footer:(0,J.jsxs)(J.Fragment,{children:[(0,J.jsxs)(V,{variant:`ghost`,onClick:()=>(s(null),l(``)),children:[(0,J.jsx)(A,{"aria-hidden":`true`}),`Cancel`]}),(0,J.jsxs)(V,{variant:`primary`,disabled:u||c!==String(h.length),onClick:()=>void g(),children:[o===`disable`?(0,J.jsx)(w,{"aria-hidden":`true`}):(0,J.jsx)(O,{"aria-hidden":`true`}),o===`disable`?`Disable`:`Enable`]})]}),children:(0,J.jsxs)(`div`,{className:`flex flex-col gap-4 text-sm`,children:[(0,J.jsx)(`span`,{className:`text-ink-2`,children:h.map(e=>e.name).join(`, `)}),(0,J.jsxs)(`label`,{className:`flex flex-col gap-2`,children:[(0,J.jsxs)(`span`,{children:[`Type `,h.length,` to confirm`]}),(0,J.jsx)(R,{value:c,onChange:e=>l(e.target.value),autoComplete:`off`,inputMode:`numeric`})]})]})})]})}function Vy({only:e}){let t=xy(),n=Ry(),[r,i]=(0,q.useState)(null);(0,q.useEffect)(()=>{bt.directory().then(e=>i(e.agents),()=>i({}))},[]);let[a,o]=(0,q.useState)([]);(0,q.useEffect)(()=>{cn.list().then(e=>o(e.approvals.filter(e=>e.state===`waiting`)),()=>{})},[]);let[s,c]=(0,q.useState)(``),[l,u]=(0,q.useState)(`all`),d=e?In.find(t=>t.id===e):void 0,f=(0,q.useMemo)(()=>Un(s,d?.id),[s,d]),p=(0,q.useMemo)(()=>!d||d.id===`custom`?Zn(n.rows||[],s):[],[n.rows,s,d]),m=e=>e===`custom`?p.map(Dy):f.filter(t=>t.category===e).map(e=>wy(e.id,r)),h=e=>[...e.filter(e=>t.favs.includes(e.fav)),...e.filter(e=>!t.favs.includes(e.fav))],g=(d?[d]:In).map(e=>({c:e,all:h(m(e.id))})),_=g.flatMap(e=>e.all),v=e=>l===`all`||(l===Fy?t.favs.includes(e.fav):e.status===l),y=e=>_.filter(t=>t.status===e).length,b=[{id:`all`,label:`All`,n:_.length},...[`attention`,`partial`,`ready`,`unavailable`].filter(e=>y(e)>0||e!==`unavailable`).map(e=>({id:e,label:Sy[e].label,n:y(e),tone:Sy[e].tone})),{id:Fy,label:`Favourites`,n:_.filter(e=>t.favs.includes(e.fav)).length}],x=l!==`all`||!!s.trim(),S=(e,t)=>x?`None here.`:e===`custom`?n.rows===null?`Reading your custom agents…`:n.error?`Your custom agents cannot be read: ${n.error}`:(0,J.jsxs)(`span`,{className:`flex flex-col items-center gap-2`,children:[(0,J.jsx)(vn,{name:Nr.agents,px:22}),(0,J.jsx)(`span`,{className:`text-[16px] font-medium text-ink`,children:`No custom agents yet`}),(0,J.jsx)(`span`,{children:`Make one for a job your team repeats.`})]}):`No ${t.toLowerCase()} yet.`;return(0,J.jsxs)(`div`,{className:`flex min-h-(--screen) flex-col`,children:[(0,J.jsx)(ii,{}),(0,J.jsxs)(`main`,{className:L(hi,`max-w-[1400px] flex-auto gap-4`),children:[d?(0,J.jsx)(qa,{href:B(`agents`),label:`All agents`}):(0,J.jsx)(Xa,{}),(0,J.jsxs)(`div`,{className:`flex flex-wrap items-start gap-x-6 gap-y-4`,children:[(0,J.jsxs)(`div`,{className:`flex min-w-0 flex-[1_1_480px] flex-col gap-2`,children:[(0,J.jsxs)(`div`,{className:`flex items-center gap-4`,children:[(0,J.jsx)(Pr,{pixel:Nr.agents,size:`lg`}),(0,J.jsx)(`h1`,{className:`m-0 text-[25px] font-semibold tracking-[-0.01em]`,children:d?d.label:`Agents`})]}),(0,J.jsx)(`p`,{className:`m-0 text-[13px] leading-relaxed text-ink-2`,children:d?d.about:`Open an agent to work with it and see what it can do.`})]}),(!d||d.id===`custom`)&&!n.off&&(0,J.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2 self-center`,children:[(0,J.jsx)(Ly,{onDone:e=>{_n.list().then(e=>{On(e.agents,`replace`),n.setRows(e.agents)},()=>{}),location.hash=B(`agents`,`custom`,e)}}),(0,J.jsx)(Iy,{})]})]}),(0,J.jsx)(Oy,{cards:r}),a.length>0&&(0,J.jsx)(`div`,{role:`status`,className:`self-start`,children:(0,J.jsx)(`a`,{href:B(`agents`,`custom`,a[0].agent),className:`flex items-center gap-2 rounded-[12px] bg-warn-soft px-4 py-2 text-sm font-medium text-warn no-underline hover:text-warn`,children:a.length===1?`${a[0].agent} is waiting for your approval`:`${a.length} requests from your agents are waiting for your approval`})}),(0,J.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,J.jsx)(en,{id:`agents-search`,label:d?`Find an agent in ${d.label}`:`Find an agent`,value:s,onChange:c}),(0,J.jsx)(`span`,{className:`mx-2 hidden h-6 w-px bg-line sm:block`,"aria-hidden":`true`}),(0,J.jsx)(Py,{items:b,value:l,onChange:u})]}),n.off&&(!d||d.id===`custom`)&&(0,J.jsx)(zy,{}),d?.id===`custom`&&n.rows&&(0,J.jsx)(By,{rows:n.rows,onDone:n.setRows}),(0,J.jsx)(`div`,{className:`@container`,children:(0,J.jsx)(`div`,{className:L(`grid items-start gap-x-6 gap-y-8`,d?`max-w-[720px] grid-cols-1`:`grid-cols-1 @2xl:grid-cols-2 @5xl:grid-cols-4`),children:g.map(({c:e,all:r})=>(0,J.jsx)(Ny,{id:e.id,title:e.label,short:e.short,about:e.id===`custom`?`Agents your team makes for its own work, held to the environments and actions you choose.`:e.about,items:r.filter(v),empty:S(e.id,e.label),favs:t,footer:e.id===`custom`&&!n.off&&!x?(0,J.jsxs)(`a`,{href:B(`agents`,`custom`,`new`),className:L(Ct({variant:`outline`,size:`sm`}),`justify-center gap-2 no-underline`,(n.rows?.length??0)>0&&`w-full`),"data-tip":`Make a custom agent`,children:[(0,J.jsx)(k,{"aria-hidden":`true`}),`New`]}):void 0},e.id))})})]})]})}function Hy({value:e,onChange:t,id:n}){let r=zn(e),i=typeof e==`string`?e.trim().replace(/\s+/g,` `):``,a=!r&&i?i.slice(0,60):``,o=zn(e)?e:a?null:``,{theme:s}=Tr(),c=Or(s)===`icons`?`No icon: the Helper's face`:`No icon: its mascot`,[u,d]=(0,q.useState)(``),[f,p]=(0,q.useState)(10),[m,h]=(0,q.useState)(()=>!!(Ti(`ph:robot`)||Ti(`lucide:bot`)));(0,q.useEffect)(()=>{ur().then(()=>h(!0))},[]),(0,q.useEffect)(()=>{p(10)},[u]);let g=!!u.trim(),{hits:_,total:v}=(0,q.useMemo)(()=>g?jn(u,f,0):jn(``,f,Bn.length),[u,f,g]),y=pr.length,b=g?v>f:f<y,x=g?Math.max(0,v-f):Math.max(0,y-f);return(0,J.jsxs)(`div`,{id:n,className:`flex flex-col gap-4`,children:[(0,J.jsxs)(`label`,{className:`relative block`,children:[(0,J.jsx)(_e,{"aria-hidden":`true`,className:`pointer-events-none absolute left-3 top-1/2 size-4 -translate-y-1/2 text-muted`}),(0,J.jsx)(R,{value:u,onChange:e=>d(e.target.value),placeholder:`Search Phosphor and Lucide icons…`,"aria-label":`Search icons`,className:`pl-10`,spellCheck:!1})]}),a&&(0,J.jsxs)(`p`,{className:`text-[13px] text-warn`,children:[`This agent names an icon ForgeQE does not have: `,(0,J.jsx)(`span`,{className:`font-mono`,children:a}),`. Pick one below, or No icon.`]}),!g&&(0,J.jsxs)(`div`,{children:[(0,J.jsx)(`p`,{className:`mb-2 text-[13px] text-muted`,children:`No icon`}),(0,J.jsx)(`div`,{role:`listbox`,"aria-label":`No icon`,className:`flex flex-wrap gap-2`,children:(0,J.jsx)(`button`,{type:`button`,role:`option`,"aria-selected":o===``,"aria-label":`No icon`,"data-tip":c,className:Uy(o===``),onClick:()=>t(``),children:(0,J.jsx)(Vn,{agent:`custom`,px:28,decorative:!0})})})]}),!g&&(0,J.jsxs)(`div`,{children:[(0,J.jsx)(`p`,{className:`mb-2 text-[13px] text-muted`,children:`ForgeQE faces`}),(0,J.jsx)(`div`,{role:`listbox`,"aria-label":`ForgeQE faces`,className:`flex flex-wrap gap-2`,children:Bn.map(e=>(0,J.jsx)(Wy,{icon:e,label:gr(e),selected:e===o,ready:!0,onPick:t},e))})]}),(0,J.jsxs)(`div`,{children:[(0,J.jsx)(`p`,{className:`mb-2 text-[13px] text-muted`,children:g?`Top matches (${v})`:`Library icons (Phosphor and Lucide)`}),(0,J.jsxs)(`div`,{role:`listbox`,"aria-label":g?`Icon search results`:`Library icons`,className:`flex flex-wrap gap-2`,children:[_.map(e=>(0,J.jsx)(Wy,{icon:e.id,label:e.label,selected:e.id===o,ready:m||e.kind===`face`,onPick:t},e.id)),_.length===0&&(0,J.jsx)(`p`,{className:`text-[13px] text-muted`,children:`No icons match that search.`})]}),b&&(0,J.jsxs)(`button`,{type:`button`,className:`mt-4 inline-flex items-center gap-1 text-[13px] font-medium text-accent underline-offset-4 hover:underline`,"data-tip":`Show ${Math.min(10,x)} of ${x} more`,onClick:()=>p(e=>e+10),children:[(0,J.jsx)(l,{size:14,"aria-hidden":`true`}),`More (`,x,`)`]})]}),o&&Yn(o)&&(0,J.jsxs)(`p`,{className:`text-[13px] text-muted`,children:[`Selected `,(0,J.jsx)(`span`,{className:`font-mono text-fg`,children:o})]})]})}var Uy=e=>L(`inline-flex size-11 cursor-pointer items-center justify-center rounded-[10px] border bg-bg text-fg transition-colors disabled:cursor-wait disabled:opacity-50`,e?`border-accent ring-2 ring-accent/30`:`border-line-soft hover:border-line`);function Wy({icon:e,label:t,selected:n,ready:r,onPick:i}){return(0,J.jsx)(`button`,{type:`button`,role:`option`,"aria-selected":n,"aria-label":t,"data-tip":t,disabled:!r&&!!Yn(e),className:Uy(n),onClick:()=>i(e),children:xr(e)?(0,J.jsx)(vn,{name:e,px:28}):(0,J.jsx)(Vn,{agent:`custom`,icon:e,px:28,decorative:!0})})}var Gy=[{label:`Defect retest`,about:`Each morning, retests the defects resolved since yesterday and says which are really fixed.`,text:`Every morning, find the defects resolved in our tracker since yesterday, retest each one on QA by rerunning its test or following its steps in a real browser, and tell me which are really fixed and which still fail, with screenshots. Add the result as a comment on each defect.`},{label:`Nightly smoke`,about:`Each night, runs the critical flows on QA and tells the team what broke and why.`,text:`Every night, run our critical flows (sign-in, search, checkout) on QA in a real browser, and tell the team in our channel what broke, with screenshots and the likely cause.`},{label:`Pull request test check`,about:`Reviews a pull request's tests, runs the ones it touches, and says what is missing or risky.`,text:`When I give it a pull request, review its tests and changes, run the automated tests it touches, and tell me what is missing or risky before I merge.`},{label:`Release readiness`,about:`Runs a release's regression pack and says whether it is ready to ship and what blocks it.`,text:`For a release I name, run its regression pack on QA, look at its test cases' results and its open defects, and tell me if it is ready to ship and what blocks it.`},{label:`API contracts`,about:`Checks an API against its contracts after each deploy and explains any break.`,text:`Check our order API against its contracts after each deploy and explain any break`},{label:`Test case quality`,about:`Reviews a story's test cases and says what is missing or vague.`,text:`Review a story's test cases and tell me what is missing or vague`}];function Ky(){let[e,t]=(0,q.useState)(``),[n,r]=(0,q.useState)(!1),[i,a]=(0,q.useState)(``),[o,s]=(0,q.useState)([]),[c,l]=(0,q.useState)([]),u=Ba(n);(0,q.useEffect)(()=>{Wt.list().then(e=>s(e.sessions.filter(e=>!e.saved)),()=>{}),_n.templates().then(e=>l(e.templates),()=>{})},[]);let d=async()=>{if(e.trim()){r(!0),a(``);try{let t=await Wt.start(e.trim());location.hash=B(`agents`,`custom`,`build`,t.sid)}catch(e){a(e.message),r(!1)}}};return(0,J.jsxs)(`div`,{className:`flex min-h-(--screen) flex-col`,children:[(0,J.jsxs)(`header`,{className:`flex items-center gap-1 px-6 py-4`,children:[(0,J.jsx)(Ar,{}),(0,J.jsxs)(`a`,{href:B(`agents`,`category`,`custom`),className:`inline-flex min-h-9 items-center gap-2 text-sm`,children:[(0,J.jsx)(Se,{size:16,"aria-hidden":`true`}),`Custom agents`]})]}),(0,J.jsx)(`main`,{className:`flex flex-auto flex-col items-center justify-center px-6 pt-6 pb-30`,children:(0,J.jsxs)(`div`,{className:`flex w-full max-w-[780px] flex-col items-center gap-10`,children:[(0,J.jsxs)(`div`,{className:`flex flex-col items-center gap-4 text-center`,children:[(0,J.jsx)($t,{state:n?`waiting`:u,px:112,label:n?`Starting the builder`:`ForgeQE is ready to build an agent`,className:`mb-1`}),(0,J.jsx)(`h1`,{className:`m-0 text-[31px] leading-tight font-semibold tracking-[-0.015em] text-ink`,children:`What should your agent do?`}),(0,J.jsx)(`p`,{className:`m-0 text-[16px] leading-relaxed text-ink-2`,children:`Say it in your own words. ForgeQE works out what it needs from what your project has, asks only what it cannot decide, and builds it with you step by step.`})]}),(0,J.jsx)(Pi,{id:`build-goal`,label:`What your agent should do`,value:e,onChange:e=>{t(e),a(``)},onSend:()=>void d(),busy:n,disabled:n,placeholder:`An agent that checks the checkout on QA and tells me what broke…`}),i&&(0,J.jsx)(`p`,{role:`alert`,className:`m-0 -mt-6 text-sm text-fail`,children:i}),(0,J.jsxs)(`section`,{"aria-labelledby":`build-starters`,className:`flex w-full flex-col gap-2`,children:[(0,J.jsx)(`h2`,{id:`build-starters`,className:`m-0 text-[13px] font-semibold text-muted`,children:`Or start from one of these, and change it to fit`}),(0,J.jsx)(`ul`,{className:`m-0 grid list-none grid-cols-1 gap-2 p-0 sm:grid-cols-2`,children:Gy.map(n=>(0,J.jsx)(`li`,{children:(0,J.jsxs)(`button`,{type:`button`,"aria-pressed":e===n.text,onClick:()=>{t(n.text),a(``),document.getElementById(`build-goal`)?.focus()},className:L(`flex h-full w-full cursor-pointer flex-col items-start gap-1 rounded-[12px] border px-4 py-2 text-left hover:bg-surface-muted`,e===n.text?`border-accent bg-accent-soft`:`border-line-soft bg-transparent`),children:[(0,J.jsx)(`span`,{className:`text-[13px] font-medium text-ink`,children:n.label}),(0,J.jsx)(`span`,{className:`text-[13px] text-muted`,children:n.about})]})},n.label))})]}),o.length>0&&(0,J.jsxs)(`section`,{"aria-labelledby":`build-resume`,className:`flex w-full flex-col gap-2`,children:[(0,J.jsx)(`h2`,{id:`build-resume`,className:`m-0 text-[13px] font-semibold text-muted`,children:`Pick up where you left off`}),(0,J.jsx)(`ul`,{className:`m-0 flex list-none flex-col rounded-[12px] card border p-2`,children:o.slice(0,5).map(e=>(0,J.jsx)(`li`,{children:(0,J.jsxs)(`a`,{href:B(`agents`,`custom`,`build`,e.sid),className:`flex min-h-11 items-center gap-4 rounded-[8px] px-4 py-2 text-ink no-underline hover:bg-surface-muted hover:text-ink`,children:[(0,J.jsx)(`span`,{className:`min-w-0 flex-1 truncate text-[13px]`,children:e.goal}),(0,J.jsxs)(`span`,{className:`flex-none text-[13px] text-muted`,children:[qy[e.step].label,` · `,ta(e.updatedAt)]})]})},e.sid))})]}),c.length>0&&(0,J.jsxs)(`section`,{"aria-labelledby":`build-templates`,className:`flex w-full flex-col gap-2`,children:[(0,J.jsx)(`h2`,{id:`build-templates`,className:`m-0 text-[13px] font-semibold text-muted`,children:`Or start from a template, and review it before you save`}),(0,J.jsx)(`ul`,{className:`m-0 flex list-none flex-col rounded-[12px] card border p-2`,children:c.map(e=>(0,J.jsx)(`li`,{children:(0,J.jsxs)(`a`,{href:B(`agents`,`custom`,`new`,`template`,e.id),className:`flex min-h-11 items-center gap-4 rounded-[8px] px-4 py-2 text-ink no-underline hover:bg-surface-muted hover:text-ink`,children:[(0,J.jsx)(`span`,{className:`flex-none text-[13px]`,children:e.title}),(0,J.jsx)(`span`,{className:`min-w-0 flex-1 text-[13px] text-muted`,children:e.why||e.about})]})},e.id))})]}),(0,J.jsxs)(`a`,{href:B(`agents`,`custom`,`new`,`form`),className:`inline-flex items-center gap-2 text-[13px]`,children:[(0,J.jsx)(b,{size:14,"aria-hidden":`true`}),`Or set every option yourself`]})]})})]})}var qy={understand:{label:`Understand`,title:`Let's understand your requirements`,next:`Make the plan`,working:`Working out the plan…`,thinking:`Reading what you want, and what your project has…`},plan:{label:`Plan`,title:`Here's how your agent will work`,next:`Set its boundaries`,working:`Working out what it may do…`,thinking:`Planning how your agent will do it, step by step…`},boundaries:{label:`Boundaries`,title:`Where it works and what it may do`,next:`Choose what it knows`,working:`Looking for what it should know…`,thinking:``},knowledge:{label:`Knowledge`,title:`What it should know`,next:`Review it`,working:`Putting it together…`,thinking:``},review:{label:`Review`,title:`Your agent`,next:`Save it as a draft`,working:`Saving it…`,thinking:`Naming it, and writing its instructions…`},try:{label:`Try`,title:`Try it, then approve it`,next:``,working:``,thinking:``}};function Jy({sid:e}){let[t,n]=(0,q.useState)(null),[r,i]=(0,q.useState)(``),[a,o]=(0,q.useState)(null),[s,c]=(0,q.useState)(!1);if((0,q.useEffect)(()=>{Wt.view(e).then(e=>{n(e),o(Math.min(e.reached,e.steps.length-1))},e=>i(e.message))},[e]),(0,q.useEffect)(()=>{if(!t?.working)return;let r=setTimeout(()=>{Wt.view(e).then(n,()=>{})},1500);return()=>clearTimeout(r)},[t,e]),r&&!t)return(0,J.jsx)(Yy,{children:(0,J.jsxs)(`p`,{role:`alert`,className:`m-0 rounded-[12px] bg-fail-soft px-4 py-2 text-sm text-fail`,children:[r,` `,(0,J.jsx)(`a`,{href:B(`agents`,`custom`,`new`),children:`Start again`})]})});if(!t||a===null)return(0,J.jsx)(Yy,{children:(0,J.jsx)(`p`,{role:`status`,className:`m-0 text-sm text-muted`,children:`Loading…`})});let l=t.steps[a].id,u=qy[l],d=s||t.working===l,f=async t=>{if(l!==`try`){c(!0),i(``);try{let r=await Wt.answer(e,l,t);n(r),o(Math.min(a+1,r.steps.length-1)),window.scrollTo({top:0})}catch(e){i(e.message)}finally{c(!1)}}};return(0,J.jsxs)(Yy,{children:[(0,J.jsxs)(`a`,{href:B(`agents`,`category`,`custom`),className:`inline-flex items-center gap-2 self-start text-sm`,children:[(0,J.jsx)(Se,{size:16,"aria-hidden":`true`}),`Custom agents`]}),(0,J.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,J.jsx)(`span`,{className:`text-[13px] text-muted`,children:`New agent`}),(0,J.jsxs)(`p`,{className:`m-0 text-[16px] text-ink-2 [overflow-wrap:anywhere]`,children:[`“`,t.goal,`”`]})]}),(0,J.jsx)(Xy,{v:t,at:a,onGo:e=>!s&&o(e)}),(0,J.jsxs)(`section`,{"aria-labelledby":`build-step`,className:`flex flex-col gap-6`,children:[(0,J.jsxs)(`div`,{className:`flex items-start gap-4`,children:[(0,J.jsx)($t,{state:d?`working`:`idle`,px:36,label:d?u.working:`ForgeQE`,className:`flex-none`}),(0,J.jsxs)(`div`,{className:`flex min-w-0 flex-col gap-1`,children:[(0,J.jsx)(`h1`,{id:`build-step`,className:`m-0 text-[20px] font-semibold tracking-[-0.01em]`,children:u.title}),(0,J.jsx)(`p`,{className:`m-0 text-[16px] leading-relaxed text-ink-2`,children:d?t.working===l?qy[l].thinking:u.working:t.says[l]}),!d&&t.source?.[l]&&(0,J.jsx)(`span`,{className:`text-[13px] text-muted`,children:t.source[l]===`model`?`Worked out by ForgeQE's model from what you said and what your project has.`:t.note||`Worked out by ForgeQE's rules: no model is set up.`})]})]}),r&&(0,J.jsx)(`p`,{role:`alert`,className:`m-0 rounded-[12px] bg-fail-soft px-4 py-2 text-sm text-fail [overflow-wrap:anywhere]`,children:r}),t.working===l?null:l===`understand`&&(0,J.jsx)($y,{v:t,busy:s,onNext:f,next:u.next},`u-${t.updatedAt}`),t.working!==l&&l===`plan`&&(0,J.jsx)(tb,{v:t,busy:s,onNext:f,onBack:()=>o(a-1),next:u.next},`p-${t.updatedAt}`),l===`boundaries`&&(0,J.jsx)(rb,{v:t,busy:s,onNext:f,onBack:()=>o(a-1),next:u.next},`b-${t.updatedAt}`),l===`knowledge`&&(0,J.jsx)(ib,{v:t,busy:s,onNext:f,onBack:()=>o(a-1),next:u.next},`k-${t.updatedAt}`),t.working!==l&&l===`review`&&(0,J.jsx)(ab,{v:t,busy:s,onNext:f,onBack:()=>o(a-1),next:u.next},`r-${t.updatedAt}`),l===`try`&&(0,J.jsx)(ob,{v:t})]})]})}function Yy({children:e}){return(0,J.jsxs)(`div`,{className:`flex min-h-(--screen) flex-col`,children:[(0,J.jsx)(ii,{}),(0,J.jsx)(`main`,{className:L(hi,`max-w-[920px] flex-auto gap-6`),children:e})]})}function Xy({v:e,at:t,onGo:n}){return(0,J.jsx)(`nav`,{"aria-label":`Steps`,children:(0,J.jsx)(`ol`,{className:`m-0 flex list-none flex-wrap gap-x-1 gap-y-2 p-0`,children:e.steps.map((r,i)=>{let a=i<=e.reached,o=i===t;return(0,J.jsxs)(`li`,{className:`flex items-center gap-1`,children:[(0,J.jsxs)(`button`,{type:`button`,disabled:!a,"aria-current":o?`step`:void 0,onClick:()=>n(i),className:L(`inline-flex min-h-9 items-center gap-2 rounded-[8px] border-0 px-2 text-[13px] font-medium`,o?`bg-accent-soft text-ink`:a?`cursor-pointer bg-transparent text-ink-2 hover:bg-surface-strong`:`bg-transparent text-muted`),children:[(0,J.jsx)(`span`,{"aria-hidden":`true`,className:L(`inline-flex size-5 items-center justify-center rounded-full text-[13px] tabular-nums`,r.done&&!o?`bg-pass-soft text-pass`:o?`bg-accent text-accent-ink`:`bg-surface-strong text-muted`),children:r.done&&!o?(0,J.jsx)(dt,{size:12,strokeWidth:3}):i+1}),qy[r.id].label]}),i<e.steps.length-1&&(0,J.jsx)(`span`,{"aria-hidden":`true`,className:`h-px w-4 bg-line`})]},r.id)})})})}function Zy({busy:e,onBack:t,next:n,onNext:r,disabled:i,aside:a}){let o=n.startsWith(`Save`);return(0,J.jsxs)(`div`,{className:`sticky bottom-0 flex flex-wrap items-center gap-4 border-t border-line-soft bg-bg py-4`,children:[(0,J.jsx)(`span`,{className:`min-w-0 flex-1 text-[13px]`,children:a}),t&&(0,J.jsxs)(V,{variant:`ghost`,disabled:e,onClick:t,children:[(0,J.jsx)(Se,{"aria-hidden":`true`}),`Back`]}),(0,J.jsxs)(V,{variant:`primary`,disabled:e||i,onClick:r,"data-tip":n,children:[o?(0,J.jsx)(dt,{"aria-hidden":`true`}):(0,J.jsx)(Xe,{"aria-hidden":`true`}),o?`Save`:`Next`]})]})}function Qy({on:e,label:t,why:n,recommended:r,onToggle:i}){return(0,J.jsxs)(`button`,{type:`button`,"aria-pressed":e,onClick:i,className:L(`flex min-h-11 w-full cursor-pointer items-start gap-4 rounded-[12px] border px-4 py-2 text-left`,e?`border-accent bg-accent-soft`:`border-line-soft bg-bg hover:bg-surface-muted`),children:[(0,J.jsx)(`span`,{"aria-hidden":`true`,className:L(`mt-1 inline-flex size-4 flex-none items-center justify-center rounded-[4px] border`,e?`border-accent bg-accent text-accent-ink`:`border-muted`),children:e&&(0,J.jsx)(dt,{size:12,strokeWidth:3})}),(0,J.jsxs)(`span`,{className:`flex min-w-0 flex-col gap-1`,children:[(0,J.jsxs)(`span`,{className:`flex flex-wrap items-center gap-2 text-[13px] font-medium text-ink`,children:[t,r&&(0,J.jsx)(z,{tone:`running`,icon:!1,children:`Recommended`})]}),n&&(0,J.jsx)(`span`,{className:`text-[13px] text-muted`,children:n})]})]})}function $y({v:e,busy:t,onNext:n,next:r}){let[i,a]=(0,q.useState)(()=>Object.fromEntries(e.questions.map(e=>[e.id,e.answer]))),[o,s]=(0,q.useState)([]),c=(e,t,n)=>a(r=>{let i=r[e]||[];return{...r,[e]:t===`one`?[n]:i.includes(n)?i.filter(e=>e!==n):[...i,n]}});return(0,J.jsxs)(J.Fragment,{children:[e.questions.map(e=>{let t=e.assumed&&!o.includes(e.id);return(0,J.jsxs)(`fieldset`,{className:`m-0 flex flex-col gap-2 rounded-[14px] card border p-4`,children:[(0,J.jsx)(`legend`,{className:`sr-only`,children:e.text}),(0,J.jsx)(`span`,{className:`text-[16px] font-semibold`,children:e.text}),t?(0,J.jsxs)(`span`,{className:`flex flex-wrap items-center gap-2 text-sm text-ink-2`,children:[(0,J.jsx)(Zt,{icon:O,size:16,className:`text-pass`}),e.assumed,!(i[e.id]||[]).every(t=>e.assumed?.includes(t))&&(0,J.jsxs)(`span`,{className:`text-muted`,children:[`(`,i[e.id]?.join(`, `),`)`]}),(0,J.jsx)(V,{size:`sm`,variant:`ghost`,onClick:()=>s([...o,e.id]),"aria-label":`Change the answer`,"data-tip":`Change the answer`,children:(0,J.jsx)(re,{"aria-hidden":`true`})})]}):(0,J.jsxs)(J.Fragment,{children:[(0,J.jsx)(`span`,{className:`text-[13px] text-muted`,children:e.why}),(0,J.jsx)(`div`,{className:`grid grid-cols-1 gap-2 sm:grid-cols-2`,children:e.options.map(t=>(0,J.jsx)(Qy,{on:(i[e.id]||[]).includes(t.id),label:t.label,why:t.why,recommended:t.recommended,onToggle:()=>c(e.id,e.kind,t.id)},t.id))})]})]},e.id)}),(0,J.jsx)(Zy,{busy:t,next:r,onNext:()=>n({answers:i}),disabled:e.questions.some(e=>e.id===`environment`&&!(i[e.id]||[]).length),aside:e.environments.length===0?(0,J.jsx)(`span`,{className:`text-fail`,children:`Add a test environment in Settings first: an agent needs one to work in.`}):void 0})]})}var eb={ready:{icon:O,label:`Ready`,tone:`text-pass`},partial:{icon:ne,label:`Partly set up`,tone:`text-warn`},needs_setup:{icon:w,label:`Not set up here yet`,tone:`text-muted`}};function tb({v:e,busy:t,onNext:n,onBack:r,next:i}){let[a,o]=(0,q.useState)(()=>e.plan.filter(e=>e.on).map(e=>e.capability)),[s,c]=(0,q.useState)(!1),l=a.map(t=>e.plan.find(e=>e.capability===t)).filter(Boolean),u=e.plan.filter(e=>!a.includes(e.capability));return(0,J.jsxs)(J.Fragment,{children:[e.planSteps&&e.planSteps.length>0&&(0,J.jsx)(`ol`,{"aria-label":`How it will work`,className:`m-0 flex list-none flex-col gap-0 rounded-[14px] card border p-0`,children:e.planSteps.map((t,n)=>(0,J.jsxs)(`li`,{className:L(`flex items-start gap-4 px-4 py-4`,n>0&&`border-t border-line-soft`),children:[(0,J.jsx)(`span`,{"aria-hidden":`true`,className:`inline-flex size-7 flex-none items-center justify-center rounded-full bg-accent-soft text-[13px] font-semibold text-accent-fg tabular-nums`,children:n+1}),(0,J.jsxs)(`span`,{className:`flex min-w-0 flex-col gap-1`,children:[(0,J.jsx)(`span`,{className:`text-[16px] font-semibold`,children:t.title}),(0,J.jsx)(`span`,{className:`text-[13px] text-ink-2`,children:t.why}),t.without&&(0,J.jsxs)(`span`,{className:`text-[13px] text-muted`,children:[`Without it: `,t.without]}),(0,J.jsx)(`span`,{className:`flex flex-wrap gap-2 pt-1`,children:t.uses.map(t=>{let n=e.plan.find(e=>e.capability===t);return(0,J.jsx)(`span`,{className:`rounded-[6px] bg-surface-strong px-2 py-1 text-[13px] text-ink-2`,children:n?.title||t},t)})})]})]},n))}),e.planSteps&&e.planSteps.length>0&&(0,J.jsx)(`h2`,{className:`m-0 mt-2 text-[13px] font-semibold text-muted`,children:`What it uses`}),(0,J.jsx)(`ol`,{className:`m-0 flex list-none flex-col gap-2 p-0`,children:l.map((e,t)=>{let n=eb[e.state];return(0,J.jsxs)(`li`,{className:`flex items-start gap-4 rounded-[14px] card border p-4`,children:[(0,J.jsx)(`span`,{"aria-hidden":`true`,className:`inline-flex size-7 flex-none items-center justify-center rounded-full bg-accent-soft text-[13px] font-semibold text-accent-fg tabular-nums`,children:t+1}),(0,J.jsxs)(`div`,{className:`flex min-w-0 flex-1 flex-col gap-1`,children:[(0,J.jsx)(`span`,{className:`text-[16px] font-semibold`,children:e.title}),e.why&&(0,J.jsx)(`span`,{className:`text-[13px] text-ink-2`,children:e.why}),(0,J.jsx)(`span`,{className:`line-clamp-2 text-[13px] text-muted`,children:e.summary}),(0,J.jsxs)(`span`,{className:L(`flex items-center gap-2 text-[13px]`,n.tone),children:[(0,J.jsx)(Zt,{icon:n.icon,size:14}),n.label,e.state!==`ready`&&e.gaps.length?`: ${e.gaps.join(`; `)}`:``]})]}),(0,J.jsx)(V,{variant:`icon`,size:`icon`,"aria-label":`Leave out ${e.title}`,"data-tip":`Leave out ${e.title}`,onClick:()=>o(a.filter(t=>t!==e.capability)),children:(0,J.jsx)(Ie,{"aria-hidden":`true`})})]},e.capability)})}),s?(0,J.jsxs)(`section`,{"aria-labelledby":`build-add`,className:`flex flex-col gap-2 rounded-[14px] card border p-4`,children:[(0,J.jsx)(`h2`,{id:`build-add`,className:`m-0 text-[13px] font-semibold`,children:`What else should it do?`}),(0,J.jsx)(`ul`,{className:`m-0 grid list-none grid-cols-1 gap-2 p-0 sm:grid-cols-2`,children:u.map(e=>(0,J.jsx)(`li`,{children:(0,J.jsxs)(`button`,{type:`button`,onClick:()=>o([...a,e.capability]),className:`flex h-full w-full cursor-pointer items-start gap-2 rounded-[10px] border border-line-soft bg-bg px-4 py-2 text-left hover:bg-surface-muted`,children:[(0,J.jsx)(k,{size:16,"aria-hidden":`true`,className:`mt-1 flex-none text-muted`}),(0,J.jsxs)(`span`,{className:`flex min-w-0 flex-col`,children:[(0,J.jsx)(`span`,{className:`text-[13px] font-medium`,children:e.title}),(0,J.jsx)(`span`,{className:`line-clamp-2 text-[13px] text-muted`,children:e.summary})]})]})},e.capability))})]}):(0,J.jsxs)(V,{size:`sm`,className:`self-start`,onClick:()=>c(!0),"data-tip":`Add something it should also do`,children:[(0,J.jsx)(k,{"aria-hidden":`true`}),`Add`]}),(0,J.jsx)(Zy,{busy:t,onBack:r,next:i,onNext:()=>n({capabilities:a}),disabled:!a.length})]})}function nb({text:e,help:t,on:n,onChange:r,locked:i}){return(0,J.jsxs)(`div`,{className:`flex items-start gap-4 border-t border-line-soft py-4 first:border-t-0`,children:[(0,J.jsxs)(`div`,{className:`flex min-w-0 flex-1 flex-col gap-1`,children:[(0,J.jsx)(`span`,{className:`text-[13px] text-ink`,children:e}),(t||i)&&(0,J.jsx)(`span`,{className:`text-[13px] text-muted`,children:i||t})]}),i?(0,J.jsx)(ye,{size:18,"aria-label":`Always`,className:`mt-1 flex-none text-muted`}):(0,J.jsx)(si,{checked:n,onChange:e=>r?.(e),label:e})]})}function rb({v:e,busy:t,onNext:n,onBack:r,next:i}){let a=e.boundaries,[o,s]=(0,q.useState)(a.environments),[c,l]=(0,q.useState)(a.actions),[u,d]=(0,q.useState)(a.approve),[f,p]=(0,q.useState)(a.shell),[m,h]=(0,q.useState)(a.repository),[g,_]=(0,q.useState)(a.unattended),[v,y]=(0,q.useState)(a.trust||[]),[b,x]=(0,q.useState)((a.production||[]).includes(`run`)),S=o.some(t=>e.production.includes(t)),C=(e,t)=>y(t?[...new Set([...v,e])]:v.filter(t=>t!==e)),w=e.plan.filter(e=>e.on&&e.capability.startsWith(`system:`)),T=(e,t)=>e.includes(t)?e.filter(e=>e!==t):[...e,t],E=e=>c.includes(e),D=(e,t)=>l(t?[...new Set([...c,e])]:c.filter(t=>t!==e)),O=(e,t)=>d(t?[...new Set([...u,e])]:u.filter(t=>t!==e)),ee=o.join(` and `)||`its environments`;return(0,J.jsxs)(J.Fragment,{children:[(0,J.jsxs)(`fieldset`,{className:`m-0 flex flex-col gap-2 rounded-[14px] card border p-4`,children:[(0,J.jsx)(`legend`,{className:`sr-only`,children:`Where it works`}),(0,J.jsx)(`span`,{className:`text-[16px] font-semibold`,children:`Where it works`}),(0,J.jsx)(`span`,{className:`text-[13px] text-muted`,children:`Every run, test and call goes only here. In production it reads without asking, and a person approves every change.`}),(0,J.jsx)(`div`,{className:`flex flex-wrap gap-2`,children:(0,J.jsx)(fn,{items:e.environments.map(t=>({id:t,label:t,...e.production.includes(t)&&!/prod/i.test(t)?{note:`production`,noteClass:`text-warn`}:{}})),value:o,onChange:s})}),S&&(0,J.jsx)(`span`,{className:`text-[13px] text-warn`,children:`In production, it reads without asking; a person approves every change there, on a schedule too (it waits, and the team is told). Before a step that could reach real customers, it asks you itself.`})]}),(0,J.jsxs)(`section`,{"aria-labelledby":`build-may`,className:`flex flex-col rounded-[14px] card border px-4 py-1`,children:[(0,J.jsx)(`h2`,{id:`build-may`,className:`sr-only`,children:`What it may do`}),(0,J.jsx)(nb,{text:`Read test cases, runs, reports and your systems' data`,on:!0,locked:`Always: it cannot work without it, and it changes nothing.`}),e.needs?.run&&(0,J.jsx)(nb,{text:`Run tests and apps in ${ee}`,help:`Browser runs, tests, API calls and database queries.`,on:E(`run`),onChange:e=>D(`run`,e)}),e.needs?.run&&E(`run`)&&(0,J.jsx)(nb,{text:`Ask me before each run`,help:`Recommended while it is new; turn it off once you trust it.`,on:u.includes(`run`),onChange:e=>O(`run`,e)}),e.needs?.run&&E(`run`)&&S&&(0,J.jsx)(nb,{text:`Ask me before each run in production`,help:`Off: browser runs, tests and API calls there go ahead without asking. Each question also offers to allow the rest of the run.`,on:!b,onChange:e=>x(!e)}),(0,J.jsx)(nb,{text:`Change test assets on this computer`,help:`Regression packs, API contracts, page memory, recordings. Off unless its job is to make them.`,on:E(`change`),onChange:e=>D(`change`,e)}),E(`change`)&&(0,J.jsx)(nb,{text:`Ask me before each change`,on:u.includes(`change`),onChange:e=>O(`change`,e)}),e.needs?.external&&(0,J.jsx)(nb,{text:`Change other systems as you asked`,help:`Work items or the team's channel, as you chose.`,on:E(`external`),onChange:e=>D(`external`,e)}),E(`external`)&&(0,J.jsx)(nb,{text:`Ask me before each change to another system`,help:`Recommended. Off: it comments, updates and attaches as its job says, without asking.`,on:!v.includes(`external`),onChange:e=>C(`external`,!e)}),e.needs?.repository&&(0,J.jsx)(nb,{text:`Change your repository to write or heal tests`,help:`A coding agent does it on this computer.`,on:m===`write`,onChange:e=>(h(e?`write`:`read`),e&&D(`change`,!0))}),e.needs?.repository&&m===`write`&&(0,J.jsx)(nb,{text:`Ask me before the coding agent works`,help:`Off: it writes and heals tests without asking. The tests it runs can reach any address, so ForgeQE first looks in your test project's config and env files, and asks you when they name an address outside its environments.`,on:!v.includes(`coding`),onChange:e=>C(`coding`,!e)}),(0,J.jsx)(nb,{text:`Use the shell`,help:`Commands on this computer, and fetching web pages. A person approves each one; ForgeQE's secrets stay out of reach.`,on:f,onChange:p})]}),e.schedule&&(0,J.jsxs)(`fieldset`,{className:`m-0 flex flex-col gap-2 rounded-[14px] card border p-4`,children:[(0,J.jsx)(`legend`,{className:`sr-only`,children:`What it may do alone`}),(0,J.jsxs)(`span`,{className:`text-[16px] font-semibold`,children:[`When it runs `,e.schedule.toLowerCase(),`, with nobody watching`]}),(0,J.jsx)(`span`,{className:`text-[13px] text-muted`,children:`What it may do without asking. Anything else waits for a person: the team is told, and no answer in four hours is a no. It may always ask a person itself.`}),(0,J.jsxs)(`div`,{className:`grid grid-cols-1 gap-2 sm:grid-cols-2`,children:[E(`run`)&&(0,J.jsx)(Qy,{on:g.includes(`run`),label:`Run tests and apps`,why:`Recommended: what it is there to do.`,recommended:!0,onToggle:()=>_(T(g,`run`))}),E(`change`)&&(0,J.jsx)(Qy,{on:g.includes(`change`),label:`Change test assets`,onToggle:()=>_(T(g,`change`))}),m===`write`&&v.includes(`coding`)&&(0,J.jsx)(Qy,{on:g.includes(`coding`),label:`Write or heal tests`,why:`The coding agent, when its test project names no address outside its environments.`,onToggle:()=>_(T(g,`coding`))}),w.map(e=>(0,J.jsx)(Qy,{on:g.includes(`${e.capability.slice(7)}_*`),label:`Change ${e.title.replace(/^Work with /,``)}`,why:`Comment, update states, attach evidence, without a person approving each.`,onToggle:()=>_(T(g,`${e.capability.slice(7)}_*`))},e.capability))]})]}),(0,J.jsx)(Zy,{busy:t,onBack:r,next:i,onNext:()=>n({environments:o,actions:c,approve:u,repository:m,shell:f,unattended:g,trust:v,production:b?[`run`]:[]}),disabled:!o.length})]})}function ib({v:e,busy:t,onNext:n,onBack:r,next:i}){let a=e.knowledge,[o,s]=(0,q.useState)(a.files.filter(e=>e.on).map(e=>e.file)),[c,l]=(0,q.useState)(a.skills.filter(e=>e.on).map(e=>e.name)),[u,d]=(0,q.useState)(a.notes),f=(e,t)=>e.includes(t)?e.filter(e=>e!==t):[...e,t],p=e=>[...e].sort((e,t)=>Number(!!t.why)-Number(!!e.why));return(0,J.jsxs)(J.Fragment,{children:[(a.files.length>0||a.skills.length>0)&&(0,J.jsxs)(`div`,{className:`grid grid-cols-1 gap-2 sm:grid-cols-2`,children:[p(a.files).map(e=>(0,J.jsx)(Qy,{on:o.includes(e.file),label:e.title,why:e.why||e.file,recommended:e.on,onToggle:()=>s(f(o,e.file))},e.file)),p(a.skills).map(e=>(0,J.jsx)(Qy,{on:c.includes(e.name),label:`Skill: ${e.name}`,why:e.why||e.about,recommended:e.on,onToggle:()=>l(f(c,e.name))},e.name))]}),(0,J.jsxs)(`label`,{className:`flex flex-col gap-2`,children:[(0,J.jsx)(`span`,{className:`text-[16px] font-semibold`,children:`Anything else it should know?`}),(0,J.jsx)(`span`,{className:`text-[13px] text-muted`,children:`Business rules, what “done” looks like, which test accounts to use (never passwords). It is kept as this agent's own knowledge.`}),(0,J.jsx)(pn,{rows:5,value:u,maxLength:2e4,onChange:e=>d(e.target.value),placeholder:`A declined card shows “Payment failed” and keeps the basket.`})]}),(0,J.jsx)(Zy,{busy:t,onBack:r,next:i,onNext:()=>n({files:o,skills:c,notes:u})})]})}function ab({v:e,busy:t,onNext:n,onBack:r,next:i}){let a=e.review,[o,s]=(0,q.useState)(a.name),[c,l]=(0,q.useState)(a.id),[u,d]=(0,q.useState)(a.description),[f,p]=(0,q.useState)(a.icon||``),[m,h]=(0,q.useState)(a.starters[0]?.text||e.goal),g=e.plan.filter(e=>e.on),_=e.boundaries,v=e.knowledge,y=[[`It works in`,_.environments.join(`, `)],[`It does`,g.map(e=>e.title).join(`; `)],[`It may`,[_.actions.includes(`run`)?`run tests and apps${_.approve.includes(`run`)?` (asking you first)`:``}`:``,_.actions.includes(`change`)?`change test assets`:``,_.actions.includes(`external`)?`change other systems${(_.trust||[]).includes(`external`)?` (without asking)`:` (asking you first)`}`:``,_.repository===`write`?`write or heal tests${(_.trust||[]).includes(`coding`)?` (without asking, unless its test project names an address outside its environments)`:` (asking you first)`}`:``].filter(Boolean).join(`; `)||`only read`],[`Runs by itself`,e.schedule?`${e.schedule.toLowerCase()}, with nobody watching${_.unattended.length?`; alone it may ${_.unattended.map(e=>e===`run`?`run tests and apps`:e===`change`?`change test assets`:e===`coding`?`write or heal tests`:`change ${e.replace(/_\*$/,``).replace(/_/g,` `)}`).join(`, `)}`:``}`:`no: you, your team or Atlas start it`],..._.shell?[[`Shell`,`yes, a person approves each command`]]:[],[`It knows`,[...v.files.filter(e=>e.on).map(e=>e.title),...v.skills.filter(e=>e.on).map(e=>e.name),...v.notes.trim()?[`your notes`]:[]].join(`, `)||`nothing extra`]];return(0,J.jsxs)(J.Fragment,{children:[(0,J.jsxs)(`div`,{className:`grid grid-cols-1 gap-4 sm:grid-cols-2`,children:[(0,J.jsxs)(`label`,{className:`flex flex-col gap-2 text-sm`,children:[(0,J.jsx)(`span`,{className:`font-medium`,children:`Name`}),(0,J.jsx)(R,{value:o,maxLength:60,onChange:e=>s(e.target.value)})]}),(0,J.jsxs)(`label`,{className:`flex flex-col gap-2 text-sm`,children:[(0,J.jsx)(`span`,{className:`font-medium`,children:`Id`}),(0,J.jsx)(R,{value:c,maxLength:40,spellCheck:!1,disabled:!!e.saved,onChange:e=>l(e.target.value.toLowerCase())})]})]}),(0,J.jsxs)(`label`,{className:`flex flex-col gap-2 text-sm`,children:[(0,J.jsx)(`span`,{className:`font-medium`,children:`What it is for`}),(0,J.jsx)(`span`,{className:`text-[13px] text-muted`,children:`One line. Atlas reads it to know when to hand it work.`}),(0,J.jsx)(R,{value:u,maxLength:300,onChange:e=>d(e.target.value)})]}),(0,J.jsxs)(`div`,{className:`flex flex-col gap-2 text-sm`,children:[(0,J.jsx)(`span`,{className:`font-medium`,children:`Icon`}),(0,J.jsx)(`span`,{className:`text-[13px] text-muted`,children:`What it wears on the Agents page: its mascot, or one of ForgeQE's agent icons.`}),(0,J.jsx)(Hy,{value:f,onChange:p})]}),(0,J.jsxs)(`label`,{className:`flex flex-col gap-2 text-sm`,children:[(0,J.jsx)(`span`,{className:`font-medium`,children:`Its first request`}),(0,J.jsx)(R,{value:m,maxLength:500,onChange:e=>h(e.target.value)})]}),(0,J.jsx)(`dl`,{className:`m-0 grid grid-cols-1 gap-x-6 gap-y-2 rounded-[14px] bg-surface-muted px-4 py-4 text-sm sm:grid-cols-[140px_1fr]`,children:y.map(([e,t])=>(0,J.jsxs)(`div`,{className:`contents`,children:[(0,J.jsx)(`dt`,{className:`text-muted`,children:e}),(0,J.jsx)(`dd`,{className:`m-0 text-ink [overflow-wrap:anywhere]`,children:t})]},e))}),e.advice.filter(e=>e.blocking).length>0&&(0,J.jsx)(`ul`,{className:`m-0 flex list-none flex-col gap-2 p-0`,children:e.advice.filter(e=>e.blocking).map((e,t)=>(0,J.jsxs)(`li`,{className:`flex flex-col gap-1 rounded-[12px] bg-warn-soft px-4 py-4 text-sm`,children:[(0,J.jsx)(`span`,{className:`font-medium text-warn`,children:e.about}),(0,J.jsx)(`span`,{className:`text-[13px] text-ink-2`,children:e.fix})]},t))}),(0,J.jsx)(Zy,{busy:t,onBack:r,next:e.saved?`Save the changes`:i,onNext:()=>n({name:o,id:c,description:u,icon:f,starters:[{label:`Run it now`,text:m}]}),disabled:!o.trim()||!c.trim(),aside:(0,J.jsxs)(`a`,{href:e.saved?B(`agents`,`custom`,e.saved,`edit`):B(`agents`,`custom`,`new`,`form`),className:`inline-flex items-center gap-2`,children:[(0,J.jsx)(b,{size:14,"aria-hidden":`true`}),`Advanced settings`]})})]})}function ob({v:e}){let t=e.saved,[n,i]=(0,q.useState)(e.review?.starters[0]?.text||e.goal),[a,o]=(0,q.useState)(``),[s,c]=(0,q.useState)(!1),[l,u]=(0,q.useState)(``),[d,f]=(0,q.useState)(!1),p=async()=>{c(!0);try{let{id:e}=await mn.start(n.trim(),{agent:t,try:!0});location.hash=B(`chats`,e)}catch(e){u(e.message),c(!1)}},m=async()=>{c(!0),u(``);try{await _n.act(t,`approve`,{confirm:a,note:`Made with the agent builder`}),f(!0)}catch(e){u(e.message)}finally{c(!1)}};return d?(0,J.jsxs)(`div`,{className:`flex flex-col items-start gap-4 rounded-[14px] bg-pass-soft px-4 py-4`,children:[(0,J.jsxs)(`span`,{className:`flex items-center gap-2 text-[16px] font-semibold text-pass`,children:[(0,J.jsx)(O,{size:18,"aria-hidden":`true`}),vr(e.review?.name||`agent`,!0),` is ready.`]}),(0,J.jsx)(`span`,{className:`text-sm text-ink-2`,children:`You, your team and Atlas can hand it work now.`}),(0,J.jsxs)(`a`,{href:B(`agents`,`custom`,t),className:L(Ct({variant:`primary`,size:`sm`}),`no-underline`),"data-tip":`Open the agent`,children:[(0,J.jsx)(Xe,{"aria-hidden":`true`}),`Open`]})]}):(0,J.jsxs)(J.Fragment,{children:[(0,J.jsxs)(`section`,{"aria-labelledby":`build-try`,className:`flex flex-col gap-2 rounded-[14px] card border p-4`,children:[(0,J.jsx)(`h2`,{id:`build-try`,className:`m-0 text-[16px] font-semibold`,children:`1. Try it on a real request`}),(0,J.jsx)(pn,{rows:2,"aria-label":`What to try`,value:n,onChange:e=>i(e.target.value)}),(0,J.jsxs)(V,{variant:`primary`,size:`sm`,className:`self-start`,disabled:s||!n.trim(),onClick:()=>void p(),"data-tip":`Try it in a chat`,children:[(0,J.jsx)(r,{"aria-hidden":`true`}),`Try`]}),(0,J.jsx)(`span`,{className:`text-[13px] text-muted`,children:`It opens as a chat. Come back here to approve it: Agents, Custom agents, then this agent.`})]}),(0,J.jsxs)(`section`,{"aria-labelledby":`build-approve`,className:`flex flex-col gap-2 rounded-[14px] card border p-4`,children:[(0,J.jsx)(`h2`,{id:`build-approve`,className:`m-0 text-[16px] font-semibold`,children:`2. Approve it`}),(0,J.jsxs)(`span`,{className:`text-[13px] text-muted`,children:[`Only an approved version runs. Type its id to confirm: `,t]}),(0,J.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,J.jsx)(R,{"aria-label":`Type ${t} to confirm`,className:`w-[260px]`,value:a,spellCheck:!1,autoComplete:`off`,onChange:e=>o(e.target.value),placeholder:t}),(0,J.jsxs)(V,{size:`sm`,disabled:s||a!==t,onClick:()=>void m(),children:[(0,J.jsx)(O,{"aria-hidden":`true`}),`Approve`]})]})]}),l&&(0,J.jsx)(`p`,{role:`alert`,className:`m-0 text-sm text-fail [overflow-wrap:anywhere]`,children:l}),(0,J.jsx)(`a`,{href:B(`agents`,`custom`,t),className:`self-start text-[13px]`,children:`Open its page`})]})}function sb({diff:e,className:t}){let n=0,r=0,i=e.split(`
41
- `).flatMap((e,t)=>{if(/^(diff |index |--- |\+\+\+ )/.test(e))return[];let i=/^@@ -(\d+)(?:,\d+)? \+(\d+)(?:,\d+)? @@/.exec(e);return i?(n=Number(i[1]),r=Number(i[2]),[{key:t,kind:`hunk`,text:e,a:``,b:``}]):e.startsWith(`+`)?[{key:t,kind:`add`,text:e.slice(1),a:``,b:String(r++)}]:e.startsWith(`-`)?[{key:t,kind:`del`,text:e.slice(1),a:String(n++),b:``}]:e.startsWith(`\\`)?[{key:t,kind:`hunk`,text:e,a:``,b:``}]:[{key:t,kind:`same`,text:e.startsWith(` `)?e.slice(1):e,a:String(n++),b:String(r++)}]});return(0,J.jsx)(`div`,{className:L(`max-h-[420px] overflow-auto rounded-[10px] border border-line-soft bg-bg font-mono text-[13px] leading-[1.6]`,t),children:(0,J.jsx)(`table`,{className:`w-full border-collapse`,children:(0,J.jsx)(`tbody`,{children:i.map(e=>(0,J.jsxs)(`tr`,{className:e.kind===`add`?`bg-pass-soft`:e.kind===`del`?`bg-fail-soft`:e.kind===`hunk`?`bg-surface-muted`:void 0,children:[(0,J.jsx)(`td`,{className:`w-10 px-2 text-right align-top text-muted tabular-nums select-none`,children:e.a}),(0,J.jsx)(`td`,{className:`w-10 px-2 text-right align-top text-muted tabular-nums select-none`,children:e.b}),(0,J.jsx)(`td`,{"aria-hidden":`true`,className:L(`w-4 align-top select-none`,e.kind===`add`?`text-pass`:e.kind===`del`?`text-fail`:`text-muted`),children:e.kind===`add`?`+`:e.kind===`del`?`−`:``}),(0,J.jsxs)(`td`,{className:L(`pr-4 align-top whitespace-pre`,e.kind===`hunk`?`text-muted`:`text-ink`),children:[(0,J.jsx)(`span`,{className:`sr-only`,children:e.kind===`add`?`added: `:e.kind===`del`?`removed: `:``}),e.text||` `]})]},e.key))})})})}function cb({id:e}){let[t,n]=(0,q.useState)(null),[r,i]=(0,q.useState)(``),[a,o]=(0,q.useState)(!1),s=(0,q.useCallback)(()=>{_n.view(e).then(e=>{On([{id:e.id,icon:e.icon}]),n(e),i(``)},e=>i(e.message))},[e]);(0,q.useEffect)(()=>s(),[s]);let[c,l]=(0,q.useState)(null);return Tn.test(e)?(0,J.jsxs)(`div`,{className:`flex min-h-(--screen) flex-col`,children:[t?(0,J.jsx)(db,{view:t,detailsOpen:a,onDetails:o}):(0,J.jsxs)(J.Fragment,{children:[(0,J.jsxs)(`header`,{className:`flex items-center gap-1 px-6 py-4 short:py-2`,children:[(0,J.jsx)(Ar,{}),(0,J.jsxs)(`a`,{href:B(`agents`,`category`,`custom`),className:`inline-flex min-h-9 items-center gap-2 text-sm`,children:[(0,J.jsx)(Se,{size:16,"aria-hidden":`true`}),`Custom agents`]})]}),(0,J.jsx)(`main`,{className:`flex flex-auto flex-col items-center justify-center px-6 py-10`,children:r?(0,J.jsx)(`p`,{role:`alert`,className:`m-0 rounded-[12px] bg-fail-soft px-4 py-2 text-sm text-fail [overflow-wrap:anywhere]`,children:r}):(0,J.jsx)(`p`,{role:`status`,className:`m-0 text-sm text-muted`,children:`Loading…`})})]}),t&&c&&(0,J.jsx)(Tb,{view:t,action:c.action,to:c.to,onClose:()=>l(null),onDone:e=>{`deleted`in e?(l(null),location.hash=B(`agents`,`category`,`custom`)):(n(e),l(null))}}),t&&(0,J.jsx)(_b,{view:t,open:a,onClose:()=>o(!1),onAct:l})]}):(0,J.jsx)(lb,{})}function lb(){return(0,J.jsxs)(`div`,{className:`flex min-h-(--screen) flex-col`,children:[(0,J.jsx)(`header`,{className:`flex items-center gap-1 px-6 py-4`,children:(0,J.jsx)(Ar,{})}),(0,J.jsxs)(`p`,{className:`m-0 px-6 py-10 text-sm text-muted`,children:[`There is no such agent. `,(0,J.jsx)(`a`,{href:B(`agents`),children:`See every agent`}),`.`]})]})}var ub=e=>e.length?e.join(`, `):`none`;function db({view:e,detailsOpen:t,onDetails:n}){let i=Li(),a=[...e.problems.working,...e.problems.active,...e.problems.other],o=e.state===`active`||e.state===`changed`,s=!!e.working,c=Ty[e.state],[l,d]=(0,q.useState)(e.starters[0]?.text||``),[f,p]=(0,q.useState)(``),[m,h]=(0,q.useState)(``),[g,_]=(0,q.useState)(!1),v=zi(),{setup:y}=v,b=`custom-agent-${e.id}`,x=Bi(l,e=>{d(e),p(``)},b,{code:v.tools.code}),S=Ui(`custom-${e.id}`,e=>{d(e),Ii(b)}),C=async()=>{h(``);try{let t=await _n.pack(e.id),n=URL.createObjectURL(t),r=document.createElement(`a`);r.href=n,r.download=`${e.id}.forgeqe-agent.zip`,r.click(),setTimeout(()=>URL.revokeObjectURL(n),1e3),h(`Zip downloaded. A teammate imports it as a draft, then edits and approves it.`)}catch(e){h(e.message)}},w=async(t,n=l)=>{if(!(g||!n.trim()&&!x.hasFiles)&&(t||o)&&(!t||s)){_(!0),p(``);try{let r=await x.wrap(n.trim());if(!r.trim()){_(!1);return}let{id:i}=await mn.start(r,{...v.choice,agent:e.id,...t||!o?{try:!0}:{}});x.reset({keep:!0}),location.hash=B(`chats`,i)}catch(e){p(e.message),_(!1)}}},T=!o&&!s;return(0,J.jsxs)(J.Fragment,{children:[(0,J.jsxs)(`header`,{className:`flex items-center gap-1 px-6 py-4 short:py-2`,children:[(0,J.jsx)(Ar,{}),(0,J.jsxs)(`a`,{href:B(`agents`,`category`,`custom`),className:`inline-flex min-h-9 items-center gap-2 text-sm`,children:[(0,J.jsx)(Se,{size:16,"aria-hidden":`true`}),`Custom agents`]}),(0,J.jsxs)(`span`,{className:`ml-auto flex items-center gap-1`,children:[(0,J.jsx)(z,{tone:c.tone,children:c.label}),(0,J.jsx)(V,{variant:`icon`,size:`icon`,onClick:()=>void C(),"aria-label":`Export to share`,"data-tip":`Export to share`,children:(0,J.jsx)(Ye,{size:18,"aria-hidden":`true`})}),(0,J.jsx)(V,{variant:`icon`,size:`icon`,onClick:()=>n(!t),"aria-label":`Details`,"aria-pressed":t,"data-tip":`Details`,children:(0,J.jsx)(u,{size:18,"aria-hidden":`true`})}),(0,J.jsx)(`a`,{href:B(`agents`,`custom`,e.id,`edit`),className:L(Ct({variant:`icon`,size:`icon`}),`no-underline`),"aria-label":`Edit`,"data-tip":`Edit`,children:(0,J.jsx)(re,{size:18,"aria-hidden":`true`})})]})]}),(0,J.jsx)(`main`,{className:`flex flex-auto flex-col items-center justify-center px-6 pt-6 pb-30 short:pt-0 short:pb-8`,children:(0,J.jsxs)(`div`,{className:`flex w-full max-w-[780px] flex-col items-center gap-10 short:gap-6`,children:[(0,J.jsxs)(`div`,{className:`flex flex-col items-center gap-4 text-center short:gap-2`,children:[(0,J.jsx)(Vn,{agent:e.id,icon:e.icon,px:i?64:96,decorative:!0,working:g,className:`mb-1`}),(0,J.jsx)(`h1`,{className:`m-0 text-[31px] leading-tight font-semibold tracking-[-0.015em] text-ink short:text-[25px] [overflow-wrap:anywhere]`,children:e.name}),(0,J.jsx)(`p`,{className:`m-0 text-[16px] leading-relaxed text-ink-2`,children:e.description||(o?`Ask ${vr(e.name)}. It runs version ${e.approvedVersion}, within its limits.`:s?`Try ${vr(e.name)}. It has no approved version yet: a try runs its manifest as it is.`:`Fix ${vr(e.name)}'s manifest before it can be tried or approved.`)})]}),m&&(0,J.jsx)(`p`,{role:`status`,className:L(`m-0 -mt-4 text-center text-[13px]`,/downloaded|Zip/.test(m)?`text-muted`:`text-fail`),children:m}),a.length>0&&(0,J.jsxs)(`div`,{role:`alert`,className:`flex w-full flex-col gap-1 rounded-[12px] bg-fail-soft px-4 py-4 text-left text-sm text-fail`,children:[(0,J.jsx)(`span`,{className:`font-medium`,children:e.state===`invalid`?`Its manifest needs fixing before it can be tried or approved:`:`It cannot run as it is:`}),(0,J.jsx)(`ul`,{className:`m-0 list-disc pl-6 [overflow-wrap:anywhere]`,children:a.map((e,t)=>(0,J.jsx)(`li`,{children:e},t))})]}),(0,J.jsx)(pb,{agent:e.id}),e.state===`changed`&&e.changes.length>0&&(0,J.jsxs)(`section`,{"aria-labelledby":`ca-changes`,className:`flex w-full flex-col gap-2 text-left`,children:[(0,J.jsxs)(`h2`,{id:`ca-changes`,className:`m-0 text-[13px] font-semibold text-muted`,children:[`Changed since `,e.approvedVersion,` was approved`]}),(0,J.jsx)(`p`,{className:`m-0 text-[13px] text-muted`,children:`The approved version keeps running until this change is approved.`}),(0,J.jsx)(sb,{diff:e.changes})]}),T?(0,J.jsx)(`p`,{className:`m-0 text-center text-sm text-muted`,children:`Open Details for what is wrong, or Edit the agent.`}):(0,J.jsxs)(J.Fragment,{children:[y&&!y.ready&&(0,J.jsx)(Mi,{project:y.project}),y?.ready&&(0,J.jsx)(Fi,{c:v}),(0,J.jsx)(Pi,{id:b,label:`Message ${vr(e.name)}`,value:l,onChange:e=>{d(e),p(``)},onSend:()=>void w(!o),disabled:g||!!y&&!y.ready||S.running,canSend:!!l.trim()||x.hasFiles,onEdit:x.onEdit,onKey:x.onKeyDown,onFiles:x.onFiles,dropping:x.dropping,drop:x.drop,mentions:x.mentions,combo:x.combo,placeholder:`Ask ${vr(e.name)} to…`,top:(0,J.jsxs)(J.Fragment,{children:[x.chips,S.state&&(0,J.jsx)(Ni,{state:S.state,onStop:()=>void S.stop(),onUndo:S.undo,onClose:S.close})]}),left:(0,J.jsxs)(J.Fragment,{children:[x.fileInput,(0,J.jsx)(Hi,{attach:{pick:x.pick},choice:v}),(0,J.jsx)(Vi,{running:S.running,disabled:!l.trim()||g||!!y&&!y.ready,onClick:()=>void S.start(l)})]}),right:(0,J.jsx)(Ri,{c:v})}),(0,J.jsx)(`p`,{role:`status`,"aria-live":`polite`,className:L(`-mt-6 m-0 text-center text-sm text-ink-2 short:-mt-4`,!(f||x.error)&&`sr-only`),children:(0,J.jsx)(`span`,{className:x.error&&!f?`text-fail`:``,children:f||x.error||``})}),(0,J.jsxs)(`div`,{className:`flex flex-wrap justify-center gap-4`,children:[e.starters.map(e=>(0,J.jsx)(V,{onClick:()=>{d(e.text),p(``),document.getElementById(b)?.focus()},children:e.label},e.label)),o&&s&&(0,J.jsxs)(V,{disabled:g||!l.trim(),onClick:()=>void w(!0),"data-tip":`Try the manifest`,children:[(0,J.jsx)(r,{"aria-hidden":`true`}),`Try`]})]})]}),(0,J.jsx)(fb,{view:e})]})})]})}function fb({view:e}){let t=e.capabilities;if(!t.length)return null;let n=t.some(e=>e.state===`needs_setup`)?`needs_setup`:t.some(e=>e.state===`partial`)?`partial`:`ready`,r=n===`ready`?`pass`:n===`partial`?`warn`:`neutral`,i=n===`ready`?`Ready`:n===`partial`?`Partly set up`:`Needs setup`,a=t.filter(e=>e.state!==`ready`);return(0,J.jsxs)(`div`,{className:`flex w-full flex-col gap-6 pt-2 text-left`,children:[a.length>0&&(0,J.jsxs)(`section`,{"aria-labelledby":`ca-needs`,className:`flex flex-col gap-2`,children:[(0,J.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,J.jsx)(`h2`,{id:`ca-needs`,className:`m-0 text-[13px] font-semibold text-muted`,children:`What it needs`}),(0,J.jsx)(z,{tone:r,children:i})]}),(0,J.jsx)(`p`,{className:`m-0 text-[13px] text-muted`,children:n===`needs_setup`?`${vr(e.name,!0)} cannot work until these are set up.`:`${vr(e.name,!0)} works, without the parts below.`}),(0,J.jsx)(`ul`,{"aria-label":`What ${vr(e.name)} needs`,className:`m-0 flex list-none flex-col rounded-[12px] card border p-0`,children:a.map((e,t)=>(0,J.jsxs)(`li`,{className:L(`flex items-center gap-4 px-4 py-2`,t>0&&`border-t border-line-soft`),children:[(0,J.jsx)(Zt,{icon:gb[e.state].icon,size:16,className:L(`flex-none`,gb[e.state].cls)}),(0,J.jsxs)(`span`,{className:`flex min-w-0 flex-1 flex-col`,children:[(0,J.jsx)(`span`,{className:`text-[13px] font-medium`,children:e.title}),(0,J.jsx)(`span`,{className:`text-[13px] text-muted [overflow-wrap:anywhere]`,children:e.gaps.join(`; `)||gb[e.state].label})]})]},e.id))})]}),(0,J.jsxs)(`section`,{"aria-labelledby":`ca-caps`,className:`flex flex-col gap-2`,children:[(0,J.jsx)(`h2`,{id:`ca-caps`,className:`m-0 text-[13px] font-semibold text-muted`,children:`What it can use`}),(0,J.jsx)(`ul`,{className:`m-0 flex list-none flex-col rounded-[12px] card border p-0`,children:t.map((e,t)=>{let n=gb[e.state];return(0,J.jsxs)(`li`,{className:L(`flex items-start gap-4 px-4 py-2`,t>0&&`border-t border-line-soft`),children:[(0,J.jsx)(Zt,{icon:n.icon,size:16,className:L(`mt-1 flex-none`,n.cls)}),(0,J.jsxs)(`span`,{className:`flex min-w-0 flex-1 flex-col`,children:[(0,J.jsx)(`span`,{className:`text-[13px] font-medium`,children:e.title}),(0,J.jsxs)(`span`,{className:`text-[13px] text-muted`,children:[n.label,e.gaps.length?`: ${e.gaps.join(`; `)}`:``]})]})]},e.id)})})]})]})}function pb({agent:e}){let[t,n]=(0,q.useState)([]),[r,i]=(0,q.useState)(``),[a,o]=(0,q.useState)(``),s=(0,q.useCallback)(()=>{cn.list().then(t=>n(t.approvals.filter(t=>t.agent===e&&t.state===`waiting`)),()=>{})},[e]);if((0,q.useEffect)(()=>{s();let e=setInterval(s,15e3);return()=>clearInterval(e)},[s]),!t.length)return null;let c=async(t,n)=>{i(t.id),o(``);try{await cn.answer(e,t.id,n),s()}catch(e){o(e.message)}finally{i(``)}};return(0,J.jsxs)(`section`,{"aria-labelledby":`ca-waiting`,className:`flex w-full flex-col gap-2 rounded-[14px] border border-warn bg-warn-soft p-4 text-left`,children:[(0,J.jsx)(`h2`,{id:`ca-waiting`,className:`m-0 text-base font-semibold text-warn`,children:`Waiting for you`}),(0,J.jsx)(`ul`,{className:`m-0 flex list-none flex-col gap-4 p-0`,children:t.map(e=>(0,J.jsxs)(`li`,{className:`flex flex-wrap items-start gap-4 rounded-[12px] bg-bg px-4 py-4`,children:[(0,J.jsxs)(`span`,{className:`flex min-w-0 flex-[1_1_320px] flex-col gap-1`,children:[(0,J.jsx)(`span`,{className:`text-[13px] font-medium [overflow-wrap:anywhere]`,children:e.title}),e.detail&&(0,J.jsx)(`span`,{className:`text-[13px] text-ink-2 [overflow-wrap:anywhere]`,children:e.detail}),(e.lines||[]).map((e,t)=>(0,J.jsx)(`span`,{className:`text-[13px] text-muted [overflow-wrap:anywhere]`,children:e},t)),(0,J.jsxs)(`span`,{className:`text-[13px] text-muted`,children:[`Asked `,ta(e.createdAt),`; no answer by `,e.until.slice(0,16).replace(`T`,` `),` UTC is a no.`]})]}),(0,J.jsxs)(`span`,{className:`flex gap-2`,children:[(0,J.jsxs)(V,{size:`sm`,variant:`primary`,disabled:!!r,onClick:()=>void c(e,`allow`),children:[(0,J.jsx)(dt,{"aria-hidden":`true`}),`Allow`]}),e.forRun&&(0,J.jsxs)(V,{size:`sm`,variant:`outline`,disabled:!!r,onClick:()=>void c(e,`allow_run`),"data-tip":`Allow for the rest of this run`,children:[(0,J.jsx)(dt,{"aria-hidden":`true`}),`Allow run`]}),(0,J.jsxs)(V,{size:`sm`,variant:`ghost`,disabled:!!r,onClick:()=>void c(e,`deny`),children:[(0,J.jsx)(w,{"aria-hidden":`true`}),`Deny`]})]})]},e.id))}),a&&(0,J.jsx)(`p`,{className:`m-0 text-[13px] text-fail`,children:a})]})}var mb={approved:`Approved`,disabled:`Disabled`,enabled:`Enabled`,"rolled-back":`Rolled back to`};function hb(e){let t=/\s*\(web\)$/i.test(e),n=e.replace(/\s*\(web\)$/i,``).trim(),r=/^(?:\d+\+)?([^@\s]+)@users\.noreply\.github\.com$/i.exec(n);return r?n=r[1]:n.includes(`@`)&&n.length>24&&(n=n.slice(0,n.indexOf(`@`))),t?`${n} · web`:n}var gb={ready:{icon:O,label:`Ready`,cls:`text-pass`},partial:{icon:ne,label:`Partly set up`,cls:`text-warn`},needs_setup:{icon:w,label:`Needs setup`,cls:`text-muted`}};function _b({view:e,open:t,onClose:n,onAct:r}){let i=e.active||e.working,a=!!e.working&&(e.state===`draft`||e.state===`changed`||e.state===`broken`&&e.working!==void 0);return(0,J.jsx)(yr,{open:t,onClose:n,wide:!0,title:`Details`,description:`${e.name} · ${e.id}`,footer:(0,J.jsxs)(V,{variant:`ghost`,onClick:n,children:[(0,J.jsx)(A,{"aria-hidden":`true`}),`Close`]}),children:(0,J.jsxs)(`div`,{className:`flex flex-col gap-6`,children:[i&&(0,J.jsx)(yb,{spec:i,view:e}),(0,J.jsx)(bb,{view:e,approvable:a,onAct:r}),(0,J.jsx)(Cb,{view:e})]})})}function vb({id:e,title:t,children:n,aside:r}){return(0,J.jsxs)(`section`,{"aria-labelledby":e,className:`flex flex-col gap-2`,children:[(0,J.jsxs)(`div`,{className:`flex items-baseline gap-2`,children:[(0,J.jsx)(`h2`,{id:e,className:`m-0 flex-1 text-[13px] font-semibold text-muted`,children:t}),r]}),n]})}function yb({spec:e,view:t}){let n=(t.active?t.describe?.active:t.describe?.working)||[],r=[...n.length?n.map(n=>[n.label,n.label===`Agents it may start`?ub(e.agents.map(e=>t.agentNames[e]||e)):n.text]):[[`Environments`,ub(e.environments)],[`Agents it may start`,ub(e.agents.map(e=>t.agentNames[e]||e))],[`It may`,ub(e.actions.map(e=>xb[e]||e))],[`A person approves first`,ub(e.approve.map(e=>xb[e]||e))],[`Repository`,e.repository===`write`?`may change files`:`read only`]],...n.some(e=>e.label===`Runs by itself`)?[]:[[`Runs by itself`,e.schedule?`${e.schedule.every?`every ${e.schedule.every}`:`at ${e.schedule.cron}`}: “${e.schedule.request}”`:`no: you, your team or Atlas start it`]],[`Skills`,ub(e.skills)],[`Knowledge`,ub(e.knowledge)]];return(0,J.jsxs)(vb,{id:`ca-reach`,title:t.active?`What version ${t.approvedVersion} may reach`:`What its manifest may reach`,children:[(0,J.jsx)(`dl`,{className:`m-0 grid grid-cols-1 gap-x-6 gap-y-2 rounded-[12px] card border px-4 py-4 text-sm sm:grid-cols-[160px_1fr]`,children:r.map(([e,t])=>(0,J.jsxs)(`div`,{className:`contents`,children:[(0,J.jsx)(`dt`,{className:`text-muted`,children:e}),(0,J.jsx)(`dd`,{className:`m-0 text-ink [overflow-wrap:anywhere]`,children:t})]},e))}),e.policies.length>0&&(0,J.jsxs)(`p`,{className:`m-0 text-[13px] text-muted`,children:[`Guidance it is given (not a limit): `,e.policies.join(`; `)]})]})}function bb({view:e,approvable:t,onAct:n}){return(0,J.jsxs)(vb,{id:`ca-versions`,title:`Versions`,aside:(0,J.jsxs)(`span`,{className:`flex flex-wrap gap-2`,children:[t&&(0,J.jsxs)(V,{size:`sm`,onClick:()=>n({action:`approve`}),"data-tip":`Approve ${e.manifestVersion}`,children:[(0,J.jsx)(O,{"aria-hidden":`true`}),`Approve`]}),e.approvedVersion&&(0,J.jsxs)(V,{size:`sm`,variant:`ghost`,onClick:()=>n({action:e.disabled?`enable`:`disable`}),children:[e.disabled?(0,J.jsx)(O,{"aria-hidden":`true`}):(0,J.jsx)(w,{"aria-hidden":`true`}),e.disabled?`Enable`:`Disable`]}),(0,J.jsxs)(V,{size:`sm`,variant:`danger`,onClick:()=>n({action:`delete`}),children:[(0,J.jsx)(Ie,{"aria-hidden":`true`}),`Delete`]})]}),children:[e.tried&&e.manifestVersion&&(0,J.jsxs)(`p`,{className:`m-0 text-[13px] text-muted`,children:[`Last try of manifest `,e.manifestVersion,`: `,e.tried.outcome,`.`]}),e.events.length===0?(0,J.jsx)(nn,{className:`py-4`,children:`No version has been approved yet. Try it, then approve it: only an approved version runs, for you, your team and Atlas.`}):(0,J.jsx)(`ul`,{className:`m-0 flex list-none flex-col rounded-[12px] card border p-2`,children:[...e.events].reverse().map((t,r)=>{let i=t.event===`approved`||t.event===`rolled-back`?t.version===e.approvedVersion:!1,a=t.event===`approved`&&t.version!==e.approvedVersion&&!e.events.slice(e.events.indexOf(t)+1).some(e=>e.event===`approved`&&e.version===t.version);return(0,J.jsxs)(`li`,{className:`flex min-h-11 flex-wrap items-center gap-4 rounded-[8px] px-4 py-2`,children:[(0,J.jsxs)(`span`,{className:`flex min-w-0 flex-1 flex-col gap-1`,children:[(0,J.jsxs)(`span`,{className:`flex flex-wrap items-center gap-2 text-[13px] font-medium`,children:[(0,J.jsxs)(`span`,{children:[mb[t.event],` `,t.version]}),i&&r===0?(0,J.jsx)(z,{tone:`pass`,children:`Running`}):null]}),(0,J.jsxs)(`span`,{className:`text-[13px] text-muted [overflow-wrap:anywhere]`,children:[hb(t.by),` · `,ta(t.at),t.note?` · ${t.note}`:``,t.tried?` · tried: ${t.tried.outcome}`:``]})]}),a&&(0,J.jsx)(V,{size:`sm`,variant:`ghost`,onClick:()=>n({action:`rollback`,to:t.version}),"aria-label":`Roll back to ${t.version}`,"data-tip":`Roll back to ${t.version}`,children:(0,J.jsx)(se,{"aria-hidden":`true`})})]},`${t.at}-${r}`)})})]})}var xb={read:`read`,run:`run tests and apps`,change:`change files`,external:`change other systems`,schedule:`schedule work`},Sb={run:`Asked`,try:`Tried`,orchestrator:`From Atlas`};function Cb({view:e}){let[t,n]=(0,q.useState)(``),r=async()=>{n(``);try{let t=await _n.audit(e.id),n=URL.createObjectURL(new Blob([t],{type:`application/x-ndjson;charset=utf-8`})),r=document.createElement(`a`);r.href=n,r.download=`${e.id}-audit.jsonl`,r.click(),setTimeout(()=>URL.revokeObjectURL(n),1e3)}catch(e){n(e.message)}};return(0,J.jsxs)(vb,{id:`ca-runs`,title:`Recent runs`,aside:(0,J.jsxs)(V,{size:`sm`,variant:`ghost`,onClick:()=>void r(),"data-tip":`Download its whole record, for audit`,children:[(0,J.jsx)(Ye,{"aria-hidden":`true`}),`Download`]}),children:[t&&(0,J.jsx)(`p`,{className:`m-0 text-[13px] text-fail`,children:t}),e.runs.length===0?(0,J.jsxs)(nn,{className:`py-4`,children:[vr(e.name,!0),` has not run yet.`]}):(0,J.jsx)(`ul`,{className:`m-0 flex list-none flex-col rounded-[12px] card border p-0`,children:e.runs.map((e,t)=>(0,J.jsx)(`li`,{className:L(t>0&&`border-t border-line-soft`),children:(0,J.jsxs)(`details`,{className:`group px-4 py-2`,children:[(0,J.jsxs)(`summary`,{className:`flex cursor-pointer list-none flex-wrap items-center gap-x-4 gap-y-1`,children:[(0,J.jsx)(z,{tone:e.outcome===`done`?`pass`:e.outcome===`running`?`running`:e.outcome===`stopped`||e.outcome===`needs_input`?`neutral`:`fail`,children:e.outcome.replace(`_`,` `)}),(0,J.jsx)(`span`,{className:`min-w-0 flex-1 truncate text-[13px] font-medium`,"data-tip":e.request,children:e.request}),(0,J.jsxs)(`span`,{className:`text-[13px] text-muted tabular-nums`,children:[Sb[e.trigger],` · `,e.version,` · `,e.calls,` `,e.calls===1?`call`:`calls`,e.refused?`, ${e.refused} refused`:``,` · `,ta(e.startedAt)]})]}),(0,J.jsxs)(`div`,{className:`mt-2 flex flex-col gap-2 pl-1 text-[13px]`,children:[(0,J.jsxs)(`span`,{className:`flex flex-wrap items-baseline gap-x-4 gap-y-1`,children:[(0,J.jsxs)(`span`,{className:`text-muted`,children:[`By `,e.by]}),e.session&&(0,J.jsxs)(`a`,{href:B(`runs`,encodeURIComponent(e.session)),className:`inline-flex items-center gap-1`,children:[`Open the run`,(0,J.jsx)(Xe,{size:14,"aria-hidden":`true`})]})]}),e.error&&(0,J.jsx)(`span`,{className:`text-fail [overflow-wrap:anywhere]`,children:e.error}),e.decisions.length>0&&(0,J.jsx)(`ul`,{className:`m-0 flex list-none flex-col gap-1 p-0`,children:e.decisions.map((e,t)=>(0,J.jsxs)(`li`,{className:`flex items-start gap-2`,children:[e.allowed?(0,J.jsx)(O,{size:14,"aria-label":`Allowed`,className:`mt-1 flex-none text-pass`}):(0,J.jsx)(_t,{size:14,"aria-label":`Refused`,className:`mt-1 flex-none text-fail`}),(0,J.jsxs)(`span`,{className:`min-w-0 [overflow-wrap:anywhere]`,children:[(0,J.jsx)(`span`,{className:`font-mono text-[13px]`,children:e.tool}),e.allowed?(0,J.jsxs)(`span`,{className:`text-muted`,children:[` · `,xb[e.action||``]||e.action,e.approved?`, approved by a person`:``]}):(0,J.jsxs)(`span`,{className:`text-fail`,children:[` · `,e.reason]})]})]},t))})]})]})},e.run))})]})}var wb={approve:{title:`Approve this version`,button:`Approve`,icon:O},disable:{title:`Disable this agent`,button:`Disable`,icon:w},enable:{title:`Enable this agent`,button:`Enable`,icon:O},rollback:{title:`Run an earlier version`,button:`Roll back`,icon:se},delete:{title:`Delete this agent`,button:`Delete`,icon:Ie}};function Tb({view:e,action:t,to:n,onClose:r,onDone:i}){let[a,o]=(0,q.useState)(``),[s,c]=(0,q.useState)(``),[l,u]=(0,q.useState)(!1),[d,f]=(0,q.useState)(``),p=wb[t],m=t===`approve`?`Version ${e.manifestVersion} becomes what runs, for you, your team and Atlas${e.approvedVersion?`, in place of ${e.approvedVersion}`:``}.${e.tried?` Its last try: ${e.tried.outcome}.`:` It was never tried.`} Commit .forgeqe/agents/.releases/${e.id} so your team has it.`:t===`disable`?`Nothing of it runs (not you, your team, Atlas or its schedule) until a person enables it again, here or with forgeqe agent enable.`:t===`enable`?`Version ${e.approvedVersion} runs again.`:t===`delete`?`${e.name} will be removed for good: its manifest, approved versions, runs and waiting approvals. Knowledge files and skills it named stay in the project.`:`Version ${n} runs from now on, in place of ${e.approvedVersion}.`,h=async()=>{u(!0),f(``);try{i(await _n.act(e.id,t,{confirm:a,...s.trim()?{note:s.trim()}:{},...n?{to:n}:{}}))}catch(e){f(e.message),u(!1)}};return(0,J.jsx)(yr,{open:!0,onClose:r,title:p.title,description:m,footer:(0,J.jsxs)(J.Fragment,{children:[(0,J.jsxs)(V,{variant:`ghost`,onClick:r,children:[(0,J.jsx)(A,{"aria-hidden":`true`}),`Cancel`]}),(0,J.jsxs)(V,{variant:t===`delete`?`destructive`:`primary`,disabled:l||a!==e.id,onClick:()=>void h(),children:[(0,J.jsx)(p.icon,{"aria-hidden":`true`}),p.button]})]}),children:(0,J.jsxs)(`div`,{className:`flex flex-col gap-4`,children:[(0,J.jsxs)(`label`,{className:`flex flex-col gap-2 text-sm`,children:[(0,J.jsxs)(`span`,{children:[`Type `,(0,J.jsx)(`span`,{className:`font-mono`,children:e.id}),` to confirm`]}),(0,J.jsx)(R,{value:a,onChange:e=>o(e.target.value),autoComplete:`off`,spellCheck:!1})]}),(0,J.jsxs)(`label`,{className:`flex flex-col gap-2 text-sm`,children:[(0,J.jsx)(`span`,{children:`Note (optional)`}),(0,J.jsx)(R,{value:s,maxLength:200,onChange:e=>c(e.target.value),placeholder:t===`rollback`?`Why it goes back`:`What changed, or why`})]}),d&&(0,J.jsx)(`p`,{role:`alert`,className:`m-0 text-sm text-fail [overflow-wrap:anywhere]`,children:d})]})})}var Eb=(e,t,n,r)=>r.map(([r,i,a])=>({file:`${n}/${r}`,url:`https://huggingface.co/${e}/resolve/${t}/${r}`,bytes:i,sha256:a}));Object.freeze(`anyio==4.15.1 ; sys_platform != 'emscripten',attrs==26.1.0,av==19.0.2,click==8.5.0,cloudpickle==3.1.2,colorama==0.4.6 ; sys_platform == 'win32',ctranslate2==4.8.4,dlinfo==2.0.0,espeakng-loader==0.2.4,faster-whisper==1.2.1,filelock==4.2.6,flatbuffers==25.12.19,fsspec==2026.9.0,h11==0.16.0 ; sys_platform != 'emscripten',hf-xet==1.8.0 ; platform_machine == 'AMD64' or platform_machine == 'ARM64' or platform_machine == 'aarch64' or platform_machine == 'amd64' or platform_machine == 'arm64' or platform_machine == 'x86_64',httpcore2==2.16.0 ; sys_platform != 'emscripten',httpx2==2.16.0,httpx2-jsfetch==1.0 ; sys_platform == 'emscripten',huggingface-hub==2.4.0,idna==3.20,joblib==1.6.0,kokoro-onnx==0.6.1,numpy==2.5.4,onnxruntime==1.31.1,packaging==26.3,phonemizer==3.4.0,protobuf==7.36.2,pyyaml==6.0.3,tokenizers==0.23.3,tqdm==4.70.1,truststore==0.10.5 ; sys_platform != 'emscripten',typing-extensions==4.16.0`.split(`,`));var Db=`https://github.com/thewh1teagle/kokoro-onnx/releases/download/model-files-v1.0`,Ob=Object.freeze([{file:`kokoro-onnx/kokoro-v1.0.onnx`,url:`${Db}/kokoro-v1.0.onnx`,bytes:325532387,sha256:`7d5df8ecf7d4b1878015a32686053fd0eebe2bc377234608764cc0ef3636a6c5`},{file:`kokoro-onnx/voices-v1.0.bin`,url:`${Db}/voices-v1.0.bin`,bytes:28214398,sha256:`bca610b8308e8d99f32e6fe4197e7ec01679264efed0cac9140fe9c29f1fbf7d`}]),kb=`https://huggingface.co/Systran/faster-whisper-base.en/resolve/3d3d5dee26484f91867d81cb899cfcf72b96be6c`,Ab=Object.freeze([{file:`whisper-base.en/config.json`,url:`${kb}/config.json`,bytes:2227,sha256:`f3bc3821e9fc76a27bae538e11ae5b677dcdd352b4600429ce7951d398569aeb`},{file:`whisper-base.en/tokenizer.json`,url:`${kb}/tokenizer.json`,bytes:2128466,sha256:`929c5252409436dce1b38a75d1abbcb5e132d170d8e324e4e04ed915fa2d22df`},{file:`whisper-base.en/vocabulary.txt`,url:`${kb}/vocabulary.txt`,bytes:422309,sha256:`ff77588746d3a2595d32ab5b69ffd7b95ce2441ac57533cb66fc3eb575a115cf`},{file:`whisper-base.en/model.bin`,url:`${kb}/model.bin`,bytes:145216508,sha256:`2a166925539a16005f14ff328359f9b9adb9dc4fb631bb3b227526862e93e2ef`}]),jb=Object.freeze(Eb(`onnx-community/silero-vad`,`e71cae966052b992a7eca6b17738916ce0eca4ec`,`silero-vad`,[[`onnx/model.onnx`,2243022,`a4a068cd6cf1ea8355b84327595838ca748ec29a25bc91fc82e6c299ccdc5808`]])),Mb=Object.freeze(Eb(`pipecat-ai/smart-turn-v3`,`f766f81d3cfdf7737ac64aad813d91bbfd56bf93`,`smart-turn-v3`,[[`smart-turn-v3.2-cpu.onnx`,8679182,`2bb026316b14a660486a75b1733cd3fbab8c2fd0314dc9af7be49f8cca967e4f`]])),Nb=Object.freeze([...jb,...Mb]);Object.freeze([...Ob,...Ab,...Nb]),Object.freeze({en:Object.freeze([`af_heart`,`am_michael`])}),Object.freeze({en:`af_heart`});var Pb=Object.freeze([`light`,`deep`]);Object.freeze({en:{light:`af_heart`,deep:`am_michael`}});var Fb={id:``,name:``,version:`1.0.0`,description:``,instructions:``,scope:{agents:[],capabilities:[],skills:[],knowledge:[],environments:[]},permissions:{repository:`read`,actions:[`read`],approve:[]},runtime:{maxDelegationDepth:1},policies:[],starters:[]};function Ib(e){return e.toLowerCase().replace(/[^a-z0-9]+/g,`-`).replace(/^[^a-z]+/,``).replace(/(?<!-)-+$/,``).slice(0,40).replace(/(?<!-)-+$/,``)}var Lb={read:{label:`Read`,help:`Test cases, runs, reports, the repository, systems' data. Changes nothing.`},run:{label:`Run`,help:`Browser runs, tests, API calls and database queries, in its environments only.`},change:{label:`Change files`,help:`Test assets on this computer: packs, contracts, page memory, recordings.`},external:{label:`Change other systems`,help:`Work items, pull requests, pipelines, channels.`}},Rb={ready:{icon:O,label:`Ready`,cls:`text-pass`},partial:{icon:ne,label:`Partly set up`,cls:`text-warn`},needs_setup:{icon:w,label:`Needs setup`,cls:`text-muted`}},zb=(e,t,n)=>n?[...new Set([...e,t])]:e.filter(e=>e!==t);function Bb({checked:e,onChange:t,disabled:n,children:r,help:i}){return(0,J.jsxs)(`label`,{className:L(`flex items-start gap-2 text-sm`,n?`cursor-not-allowed opacity-60`:`cursor-pointer`),children:[(0,J.jsx)(vy,{checked:e,disabled:n,onCheckedChange:t,className:`mt-1`}),(0,J.jsxs)(`span`,{className:`flex min-w-0 flex-col`,children:[(0,J.jsx)(`span`,{className:`text-ink`,children:r}),i&&(0,J.jsx)(`span`,{className:`text-[13px] text-muted`,children:i})]})]})}function Vb({id:e,template:t}){let n=!e,[r,i]=(0,q.useState)(n&&!t?Fb:null),[a,o]=(0,q.useState)(null),[s,c]=(0,q.useState)(null),[l,u]=(0,q.useState)(``),[d,f]=(0,q.useState)([]),[p,m]=(0,q.useState)([]),[h,g]=(0,q.useState)(!1),[_,v]=(0,q.useState)(!1),[y,b]=(0,q.useState)(!1);(0,q.useEffect)(()=>{_n.choices().then(c,e=>u(e.message)),t&&_n.template(t).then(e=>{o(e),i({...Fb,...e.fields,scope:{...Fb.scope,...e.fields.scope},permissions:{...Fb.permissions,...e.fields.permissions}}),b(!0)},e=>u(e.message)),e&&_n.view(e).then(t=>t.form?i({...Fb,...t.form,runtime:{maxDelegationDepth:t.form.runtime.maxDelegationDepth,...t.form.runtime.maxTokens?{maxTokens:t.form.runtime.maxTokens}:{}}}):u(`${e}'s manifest is not one the editor can read. Fix it in .forgeqe/agents/${e}.yaml.`),e=>u(e.message))},[e,t]);let x=(0,q.useRef)(0);(0,q.useEffect)(()=>{if(!r)return;let e=++x.current;g(!0);let t=setTimeout(()=>{_n.validate(r).then(t=>e===x.current&&(f(t.problems||[]),m(t.advice||[]),g(!1)),t=>e===x.current&&(f([t.message]),g(!1)))},350);return()=>clearTimeout(t)},[r]);let S=e=>i(t=>t&&{...t,...e}),C=e=>i(t=>t&&{...t,scope:{...t.scope,...e}}),w=e=>i(t=>t&&{...t,voice:e?{sound:e}:void 0}),T=e=>i(t=>t&&{...t,permissions:{...t.permissions,...e}}),E=(0,q.useMemo)(()=>{let e=new Map;for(let t of s?.capabilities||[])e.set(t.area,[...e.get(t.area)||[],t]);return[...e]},[s]),D=async()=>{if(r){v(!0),u(``);try{let t=await _n.save(r,n?{create:!0}:{id:e});location.hash=B(`agents`,`custom`,t.id)}catch(e){u(e.message),v(!1)}}},O=e?B(`agents`,`custom`,e):B(`agents`,`custom`,`new`);return(0,J.jsxs)(`div`,{className:`flex min-h-(--screen) flex-col`,children:[(0,J.jsx)(ii,{}),(0,J.jsxs)(`main`,{className:L(hi,`settings-fields flex-auto gap-2`),children:[(0,J.jsxs)(`a`,{href:O,className:`mb-2 inline-flex items-center gap-2 self-start text-sm`,children:[(0,J.jsx)(Se,{size:16,"aria-hidden":`true`}),e?`Back to the agent`:`Back to the builder`]}),(0,J.jsx)(`h1`,{className:`m-0 text-[25px] font-semibold tracking-[-0.01em]`,children:n?`New custom agent`:`Edit ${r?.name||e}`}),(0,J.jsx)(`p`,{className:`m-0 mb-2 text-sm leading-relaxed text-ink-2`,children:n?a?`ForgeQE's ${a.title} template, filled from this project. Read every setting and change what does not fit: it is saved as a draft, and runs once a person has tried and approved it.`:`An agent for one job your team repeats. It uses ForgeQE's own agents, tools, skills and knowledge, and is held to the environments and actions you pick here, on every call. It runs once a person has tried and approved it.`:`Saving changes its manifest only. The approved version keeps running until this change is approved on its page.`}),l&&(0,J.jsx)(`p`,{role:`alert`,className:`m-0 rounded-[12px] bg-fail-soft px-4 py-2 text-sm text-fail [overflow-wrap:anywhere]`,children:l}),a&&s&&(0,J.jsxs)(`section`,{"aria-labelledby":`ca-template`,className:`mb-2 flex flex-col gap-2`,children:[(0,J.jsxs)(`h2`,{id:`ca-template`,className:`m-0 text-base font-semibold`,children:[`From the `,a.title,` template`]}),(0,J.jsxs)(`ul`,{className:`m-0 flex list-none flex-col gap-2 p-0`,children:[a.systems.length>0&&(0,J.jsxs)(`li`,{className:`flex flex-col gap-1 rounded-[12px] bg-surface-muted px-4 py-4 text-sm`,children:[(0,J.jsxs)(`span`,{className:`font-medium text-ink`,children:[`It uses the tools of `,a.systems.map(e=>s?.systems.find(t=>t.name===e)?.label||e).join(`, `)]}),(0,J.jsx)(`span`,{className:`text-[13px] text-ink-2`,children:`Through ForgeQE, which checks every call against what this agent may do. The editor has no field for them yet: they are kept as the template set them.`})]}),a.notes.map(e=>(0,J.jsx)(`li`,{className:`flex flex-col gap-1 rounded-[12px] bg-surface-muted px-4 py-4 text-sm`,children:(0,J.jsx)(`span`,{className:`font-medium text-ink`,children:e})},e))]})]}),n&&!t&&(0,J.jsx)(`p`,{className:`m-0 mb-2 text-sm`,children:(0,J.jsx)(`a`,{href:B(`agents`,`custom`,`new`),children:`Or say what it should do, and let ForgeQE build it with you`})}),!r||!s?!l&&(0,J.jsx)(`p`,{role:`status`,className:`m-0 text-sm text-muted`,children:`Loading…`}):(0,J.jsxs)(J.Fragment,{children:[(0,J.jsx)(U,{first:!0,children:`What it is`}),(0,J.jsx)(H,{label:`Name`,help:`What it does, then “agent”: Checkout guard agent.`,htmlFor:`ca-name`,children:(0,J.jsx)(R,{id:`ca-name`,value:r.name,maxLength:60,onChange:e=>S({name:e.target.value,...n&&!y?{id:Ib(e.target.value)}:{}})})}),(0,J.jsx)(H,{label:`Id`,help:n?`Its file name and address: lower-case words and hyphens. It cannot change later.`:`It cannot change. Make a new agent for another id.`,htmlFor:`ca-id`,children:(0,J.jsx)(R,{id:`ca-id`,value:r.id,maxLength:40,disabled:!n,spellCheck:!1,onChange:e=>(b(!0),S({id:e.target.value.toLowerCase()}))})}),(0,J.jsx)(H,{label:`Version`,help:`Raise it for each change you approve: 1.0.0, then 1.1.0.`,htmlFor:`ca-version`,children:(0,J.jsx)(R,{id:`ca-version`,value:r.version,maxLength:14,onChange:e=>S({version:e.target.value})})}),(0,J.jsx)(H,{label:`Description`,help:`One line: what it is for. Atlas reads it to know when to hand it work.`,htmlFor:`ca-desc`,stacked:!0,children:(0,J.jsx)(R,{id:`ca-desc`,value:r.description,maxLength:300,onChange:e=>S({description:e.target.value})})}),(0,J.jsx)(H,{label:`Icon`,help:`What it wears on the Agents page and its own page: its mascot, or one of ForgeQE's agent icons.`,htmlFor:`ca-icon`,stacked:!0,children:(0,J.jsx)(Hy,{id:`ca-icon`,value:r.icon,onChange:e=>S({icon:e})})}),(0,J.jsx)(H,{label:`Voice`,help:`How it sounds when you talk with it. Default is ForgeQE's own voice; ForgeQE picks each from the speech set up on that computer.`,children:(0,J.jsx)(mi,{label:`Voice`,value:r.voice?.sound??``,onChange:e=>w(e),options:[{id:``,label:`Default`},...Pb.map(e=>({id:e,label:e[0].toUpperCase()+e.slice(1)}))]})}),(0,J.jsx)(H,{label:`Instructions`,help:`Its focus and how to work, in plain words. Guidance for the model: the limits below are what holds it.`,htmlFor:`ca-instr`,stacked:!0,children:(0,J.jsx)(pn,{id:`ca-instr`,rows:5,value:r.instructions,maxLength:8e3,onChange:e=>S({instructions:e.target.value})})}),(0,J.jsx)(U,{help:`Where its runs, tests and calls may go. In an environment named like production, reads go ahead, runs are asked unless you say otherwise, and every change is approved by a person.`,children:`Where it works`}),(0,J.jsxs)(`div`,{className:`flex flex-col gap-2 py-4`,children:[s.environments.length===0&&(0,J.jsx)(`p`,{className:`m-0 text-sm text-muted`,children:`No environments in env.yaml yet. Add them in Settings, Environments.`}),s.environments.map(e=>(0,J.jsx)(Bb,{checked:r.scope.environments.includes(e.name),onChange:t=>C({environments:zb(r.scope.environments,e.name,t)}),help:e.production?`Production: reads go ahead; a person approves every change there.`:void 0,children:e.name},e.name))]}),(0,J.jsx)(U,{help:`ForgeQE's capabilities it may use: their tools, and only theirs. Each says whether it is set up here.`,children:`What it can do`}),(0,J.jsx)(`div`,{className:`flex flex-col gap-4 py-4`,children:E.map(([e,t])=>{let n=t.filter(e=>r.scope.capabilities.includes(e.id)).length;return(0,J.jsxs)(`details`,{open:n>0||void 0,className:`group rounded-[12px] card border px-4 py-2`,children:[(0,J.jsxs)(`summary`,{className:`flex cursor-pointer list-none items-center gap-2 py-1 text-[13px] font-medium`,children:[(0,J.jsx)(M,{size:14,"aria-hidden":`true`,className:`flex-none text-muted transition-transform duration-200 group-open:rotate-90`}),(0,J.jsx)(`span`,{className:`flex-1`,children:e}),(0,J.jsx)(`span`,{className:`text-[13px] font-normal text-muted tabular-nums`,children:n?`${n} of ${t.length} picked`:`${t.length}`})]}),(0,J.jsx)(`div`,{className:`flex flex-col gap-2 pt-2 pb-1 pl-6`,children:t.map(e=>{let t=Rb[e.state];return(0,J.jsx)(Bb,{checked:r.scope.capabilities.includes(e.id),onChange:t=>C({capabilities:zb(r.scope.capabilities,e.id,t)}),help:(0,J.jsxs)(`span`,{className:`flex items-start gap-2`,children:[(0,J.jsx)(Zt,{icon:t.icon,size:13,className:L(`mt-1 flex-none`,t.cls)}),(0,J.jsxs)(`span`,{children:[t.label,e.gaps.length?`: ${e.gaps.join(`; `)}`:``]})]}),children:(0,J.jsx)(`span`,{"data-tip":e.summary,children:e.title})},e.id)})})]},e)})}),(0,J.jsx)(U,{help:`ForgeQE's agents it may start: a capability that needs one (a browser run needs WebPilot) is refused without it.`,children:`Agents it may use`}),(0,J.jsx)(`div`,{className:`flex flex-col gap-2 py-4`,children:s.agents.map(e=>(0,J.jsx)(Bb,{checked:r.scope.agents.includes(e.name),onChange:t=>C({agents:zb(r.scope.agents,e.name,t)}),help:(0,J.jsx)(`span`,{className:`font-mono text-[13px]`,children:e.name}),children:e.title},e.name))}),(0,J.jsx)(U,{help:`Only these are loaded for it.`,children:`Skills and knowledge`}),(0,J.jsxs)(`div`,{className:`grid grid-cols-1 gap-6 py-4 sm:grid-cols-2`,children:[(0,J.jsxs)(`fieldset`,{className:`m-0 flex flex-col gap-2 border-0 p-0`,children:[(0,J.jsx)(`legend`,{className:`mb-1 p-0 text-[13px] font-semibold text-muted`,children:`Skills`}),s.skills.length===0&&(0,J.jsx)(`p`,{className:`m-0 text-sm text-muted`,children:`None in this project yet.`}),s.skills.map(e=>(0,J.jsx)(Bb,{checked:r.scope.skills.includes(e.name),onChange:t=>C({skills:zb(r.scope.skills,e.name,t)}),help:e.about,children:e.name},e.name))]}),(0,J.jsxs)(`fieldset`,{className:`m-0 flex flex-col gap-2 border-0 p-0`,children:[(0,J.jsx)(`legend`,{className:`mb-1 p-0 text-[13px] font-semibold text-muted`,children:`Knowledge files`}),s.knowledge.length===0&&(0,J.jsx)(`p`,{className:`m-0 text-sm text-muted`,children:`None in .forgeqe/knowledge yet.`}),s.knowledge.map(e=>(0,J.jsx)(Bb,{checked:r.scope.knowledge.includes(e.file),onChange:t=>C({knowledge:zb(r.scope.knowledge,e.file,t)}),help:e.title===e.file?void 0:e.title,children:e.file},e.file))]})]}),(0,J.jsx)(U,{help:`Enforced on every call. Ask first: a person approves each such call in the chat. In production, every call is asked.`,children:`What it may do`}),(0,J.jsx)(`div`,{className:`flex flex-col gap-2 py-4`,children:s.actions.map(e=>(0,J.jsxs)(`div`,{className:`flex flex-wrap items-start gap-x-6 gap-y-1`,children:[(0,J.jsx)(`div`,{className:`min-w-0 flex-[1_1_320px]`,children:(0,J.jsx)(Bb,{checked:r.permissions.actions.includes(e),onChange:t=>T({actions:zb(r.permissions.actions,e,t)}),help:Lb[e]?.help,children:Lb[e]?.label||e})}),(0,J.jsx)(Bb,{checked:e===`external`?!(r.permissions.trust||[]).includes(`external`):r.permissions.approve.includes(e),disabled:!r.permissions.actions.includes(e),onChange:t=>T(e===`external`?{trust:zb(r.permissions.trust||[],`external`,!t)}:{approve:zb(r.permissions.approve,e,t)}),children:`Ask first`})]},e))}),(0,J.jsx)(H,{label:`Repository`,help:`Whether it may change files in the repository (with Change files).`,children:(0,J.jsx)(mi,{label:`Repository`,value:r.permissions.repository,onChange:e=>T({repository:e}),options:[{id:`read`,label:`Read only`},{id:`write`,label:`May change files`}]})}),r.scope.environments.some(e=>s.environments.some(t=>t.name===e&&t.production))&&r.permissions.actions.includes(`run`)&&(0,J.jsx)(H,{label:`Production`,help:`Reads there go ahead without asking; every change there is approved by a person.`,children:(0,J.jsx)(Bb,{checked:!(r.permissions.production||[]).includes(`run`),onChange:e=>T({production:e?[]:[`run`]}),children:`Ask before each run`})}),r.permissions.repository===`write`&&(()=>{let e=(s.coding||[]).filter(e=>s.capabilities.some(t=>r.scope.capabilities.includes(t.id)&&t.tools.includes(e)));if(!e.length)return null;let t=e.every(e=>(r.permissions.trust||[]).includes(e));return(0,J.jsx)(H,{label:`Quill`,help:`The tests it runs can reach any address. Without asking, ForgeQE first looks in the test project's config and env files, and asks when they name an address outside its environments.`,children:(0,J.jsx)(Bb,{checked:!t,onChange:t=>T({trust:t?(r.permissions.trust||[]).filter(t=>!e.includes(t)):[...new Set([...r.permissions.trust||[],...e])]}),children:`Ask first`})})})(),(0,J.jsx)(H,{label:`Hands work on`,help:`How many levels deep it may give part of a task to a helper.`,htmlFor:`ca-depth`,children:(0,J.jsxs)(ln,{id:`ca-depth`,value:String(r.runtime.maxDelegationDepth),onChange:e=>S({runtime:{...r.runtime,maxDelegationDepth:Number(e.target.value)}}),className:`w-[200px]`,children:[(0,J.jsx)(`option`,{value:`0`,children:`Never`}),(0,J.jsx)(`option`,{value:`1`,children:`1 level`}),(0,J.jsx)(`option`,{value:`2`,children:`2 levels`}),(0,J.jsx)(`option`,{value:`3`,children:`3 levels`})]})}),(0,J.jsx)(H,{label:`Budget per run`,help:`The most model tokens one run may use; it stops there. Empty: no limit.`,htmlFor:`ca-budget`,children:(0,J.jsx)(R,{id:`ca-budget`,type:`number`,min:1e3,step:1e3,className:`w-[200px]`,value:r.runtime.maxTokens??``,placeholder:`No limit`,onChange:e=>S({runtime:{maxDelegationDepth:r.runtime.maxDelegationDepth,...e.target.value?{maxTokens:Math.max(0,Math.round(Number(e.target.value)))}:{}}})})}),(0,J.jsx)(U,{help:`One per line: what it should keep in mind. Guidance for the model, never a limit.`,children:`Guidance`}),(0,J.jsx)(pn,{"aria-label":`Guidance, one per line`,rows:3,value:r.policies.join(`
42
- `),onChange:e=>S({policies:e.target.value.split(`
43
- `).map(e=>e.slice(0,300))})}),(0,J.jsx)(U,{help:`Requests its page offers to start from (at most 6).`,children:`Starters`}),(0,J.jsxs)(`div`,{className:`flex flex-col gap-2 py-2`,children:[r.starters.map((e,t)=>(0,J.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,J.jsx)(R,{"aria-label":`Starter ${t+1} label`,className:`w-[200px]`,maxLength:40,value:e.label,placeholder:`Label`,onChange:e=>S({starters:r.starters.map((n,r)=>r===t?{...n,label:e.target.value}:n)})}),(0,J.jsx)(R,{"aria-label":`Starter ${t+1} request`,className:`min-w-0 flex-[1_1_280px]`,maxLength:500,value:e.text,placeholder:`The request`,onChange:e=>S({starters:r.starters.map((n,r)=>r===t?{...n,text:e.target.value}:n)})}),(0,J.jsx)(V,{variant:`icon`,size:`icon`,"aria-label":`Remove starter ${t+1}`,"data-tip":`Remove starter ${t+1}`,onClick:()=>S({starters:r.starters.filter((e,n)=>n!==t)}),children:(0,J.jsx)(Ie,{"aria-hidden":`true`})})]},t)),r.starters.length<6&&(0,J.jsxs)(V,{size:`sm`,className:`self-start`,onClick:()=>S({starters:[...r.starters,{label:``,text:``}]}),"data-tip":`Add a starter`,children:[(0,J.jsx)(k,{"aria-hidden":`true`}),`Add`]})]}),p.length>0&&(0,J.jsxs)(`section`,{"aria-labelledby":`ca-advice`,className:`mt-6 flex flex-col gap-2`,children:[(0,J.jsx)(`h2`,{id:`ca-advice`,className:`m-0 text-base font-semibold`,children:`What it still needs`}),(0,J.jsx)(`ul`,{className:`m-0 flex list-none flex-col gap-2 p-0`,children:p.map((e,t)=>(0,J.jsxs)(`li`,{className:L(`flex flex-col gap-1 rounded-[12px] px-4 py-4 text-sm`,e.blocking?`bg-warn-soft`:`bg-surface-muted`),children:[(0,J.jsx)(`span`,{className:L(`font-medium`,e.blocking?`text-warn`:`text-ink`),children:e.about}),(0,J.jsx)(`span`,{className:`text-[13px] text-ink-2`,children:e.why}),(0,J.jsx)(`span`,{className:`text-[13px] text-muted`,children:e.fix})]},t))})]}),(0,J.jsxs)(`div`,{className:`sticky bottom-0 mt-4 flex flex-wrap items-center gap-4 border-t border-line-soft bg-bg py-4`,children:[(0,J.jsx)(`div`,{role:`status`,className:`min-w-0 flex-[1_1_320px] text-[13px]`,children:h?(0,J.jsx)(`span`,{className:`text-muted`,children:`Checking…`}):d.length?(0,J.jsxs)(`ul`,{className:`m-0 list-disc pl-6 text-fail [overflow-wrap:anywhere]`,children:[d.slice(0,4).map((e,t)=>(0,J.jsx)(`li`,{children:e},t)),d.length>4&&(0,J.jsxs)(`li`,{children:[`and `,d.length-4,` more`]})]}):(0,J.jsx)(`span`,{className:`text-pass`,children:`Ready to save. It can be tried once saved.`})}),(0,J.jsx)(`a`,{href:O,className:`text-sm`,children:`Cancel`}),(0,J.jsxs)(V,{variant:`primary`,disabled:_||!r.id||!r.name,onClick:()=>void D(),"data-tip":n?`Save the agent`:`Save changes`,children:[(0,J.jsx)(dt,{"aria-hidden":`true`}),`Save`]})]})]})]})]})}var Hb={legitimate:`Legitimate`,opportunistic:`Opportunistic`,adversarial:`Adversarial`},Ub={sme:`Subject matter expert`,end_user:`End user`,specialist:`Specialist`,business_user:`Business user`},Wb=[`personas`,`about`],Gb={personas:`Personas`,about:`Tools and conversations`};function Kb({current:e,count:t}){let[n,r]=(0,q.useState)(null);(0,q.useEffect)(()=>{t===void 0&&Pt.list().then(e=>r(e.personas.length),()=>r(null))},[t===void 0]);let i=t??n;return(0,J.jsx)(Mr,{label:`Mask's pages`,current:e,links:[{id:`agent`,label:`Agent`,href:B(`agents`,`persona`)},{id:`personas`,label:i===null?`Personas`:`Personas (${i})`,href:B(`agents`,`persona`,`personas`)},{id:`about`,label:`Tools and conversations`,href:B(`agents`,`persona`,`about`)}]})}var qb=/^[a-z0-9][a-z0-9-]{0,39}$/,Jb=/^[a-z][a-z0-9-]{1,39}$/,Yb=e=>B(`agents`,`persona`,`personas`,encodeURIComponent(e));function Xb({page:e,tab:t,sub:n}){let[r,i]=(0,q.useState)(null),[a,o]=(0,q.useState)([]),[s,c]=(0,q.useState)(``),l=t===`new`,u=Wb.includes(t)?t:`personas`,d=()=>Pt.list().then(e=>{i(e.personas),o(e.notLoaded),c(``)},e=>c(`The personas did not load: ${e.message}`));(0,q.useEffect)(()=>{d()},[]);let f=u===`personas`&&n?Xt(n):``;return(0,J.jsxs)(`div`,{className:`flex min-h-(--screen) flex-col`,children:[(0,J.jsx)(ii,{}),(0,J.jsxs)(`main`,{className:L(hi,`@container flex-auto gap-4`),children:[(0,J.jsx)(To,{agent:e,tabs:(0,J.jsx)(Kb,{current:u,...r?{count:r.length}:{}})}),(0,J.jsx)(`h2`,{className:`m-0 text-[20px] font-semibold`,children:Gb[u]}),s&&(0,J.jsx)(`p`,{role:`alert`,className:`m-0 rounded-[12px] bg-fail-soft px-4 py-2 text-sm text-fail [overflow-wrap:anywhere]`,children:s}),!r&&!s&&(0,J.jsx)(`p`,{role:`status`,className:`m-0 text-sm text-muted`,children:`Loading…`}),r&&(0,J.jsx)(J.Fragment,{children:(0,J.jsxs)(`div`,{children:[u===`personas`&&(0,J.jsxs)(J.Fragment,{children:[(0,J.jsx)(Zb,{personas:r,notLoaded:a,onChanged:e=>(i(e.personas),o(e.notLoaded))}),(0,J.jsx)(tx,{personas:r,opened:f,onChanged:e=>(i(e.personas),o(e.notLoaded))}),(0,J.jsx)(dx,{open:l,onClose:()=>location.hash=Qb,personas:r,onSaved:e=>{d().then(()=>(ix=e,location.hash=Yb(e)))}})]}),u===`about`&&(0,J.jsx)(aw,{page:e})]})})]})]})}function Zb({personas:e,notLoaded:t,onChanged:n}){let[r,i]=(0,q.useState)(`all`),[a,o]=(0,q.useState)(``),[s,c]=(0,q.useState)(``),[l,u]=(0,q.useState)(``),[d,f]=(0,q.useState)(!1),p=(0,q.useRef)(null),m=e.filter(e=>!e.builtIn).length,h=async()=>{c(``),u(``);try{let e=await Pt.exportFile(),t=URL.createObjectURL(new Blob([`${JSON.stringify(e,null,2)}\n`],{type:`application/json;charset=utf-8`})),n=document.createElement(`a`);n.href=t,n.download=`forgeqe-personas.json`,n.click(),setTimeout(()=>URL.revokeObjectURL(t),1e3),c(`Exported ${kt(m,`persona`)} of your own. Another project imports the file here.`)}catch(e){u(e.message)}},g=async e=>{let t=e?.[0];if(t){if(c(``),u(``),t.size>262144)return u(`${t.name} is over 256 KB.`);f(!0);try{let e=await Pt.importFile(await t.text());n(e),c(e.added.length?`Imported ${e.added.length===1?`the persona`:`${e.added.length} personas:`} ${e.added.join(`, `)}.`:`No new persona in the file.`),e.skipped.length&&u(`Not imported: ${e.skipped.map(e=>`${e.id} (${e.why})`).join(`; `)}`)}catch(e){u(e.message)}finally{f(!1)}}},_=a.toLowerCase().split(/\s+/).filter(Boolean),v=e.filter(e=>(r===`all`||e.kind===r)&&_.every(t=>`${e.name} ${e.role} ${e.domain} ${e.id} /${e.handle}`.toLowerCase().includes(t)));return(0,J.jsxs)(`div`,{className:`flex flex-col gap-4`,children:[(0,J.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,J.jsxs)(`p`,{className:`m-0 mr-auto flex flex-wrap items-center gap-x-1 text-sm text-ink-2 tabular-nums`,children:[(0,J.jsx)(Zt,{icon:ft,size:14,className:`text-muted`}),kt(e.length,`persona`),` · `,m,` of your own`,t.length?(0,J.jsxs)(J.Fragment,{children:[` · `,(0,J.jsxs)(`span`,{className:`text-fail`,children:[t.length,` not loaded`]})]}):null]}),(0,J.jsxs)(`span`,{className:`flex items-center gap-2`,children:[m>0&&(0,J.jsxs)(V,{size:`sm`,onClick:()=>void h(),"data-tip":`A file of your own personas, for another project to import`,children:[(0,J.jsx)(Ye,{"aria-hidden":`true`}),`Export`]}),(0,J.jsxs)(V,{size:`sm`,disabled:d,onClick:()=>p.current?.click(),"data-tip":`Personas another project exported`,children:[(0,J.jsx)(mt,{"aria-hidden":`true`}),d?`Importing…`:`Import`]}),(0,J.jsxs)(V,{size:`sm`,variant:`primary`,onClick:()=>location.hash=B(`agents`,`persona`,`new`),"data-tip":`Describe a person and Mask drafts the persona, or write it yourself`,children:[(0,J.jsx)(k,{"aria-hidden":`true`}),`New persona`]})]}),(0,J.jsx)(`input`,{ref:p,type:`file`,accept:`.json,application/json`,hidden:!0,onChange:e=>(g(e.target.files),e.target.value=``)})]}),s&&(0,J.jsx)(`p`,{role:`status`,className:`m-0 rounded-[12px] bg-surface-muted px-4 py-2 text-sm text-ink-2 [overflow-wrap:anywhere]`,children:s}),l&&(0,J.jsx)(`p`,{role:`alert`,className:`m-0 rounded-[12px] bg-fail-soft px-4 py-2 text-sm text-fail [overflow-wrap:anywhere]`,children:l}),(0,J.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,J.jsx)(en,{id:`persona-find`,label:`Find a persona`,value:a,onChange:o}),(0,J.jsx)(hn,{items:[{id:`all`,label:`All`,n:e.length},...un.map(t=>({id:t,label:Ub[t],n:e.filter(e=>e.kind===t).length}))],value:r,onChange:i})]}),v.length===0?(0,J.jsx)(nn,{className:`py-4`,children:e.length?`No persona matches.`:`There are no personas yet.`}):(0,J.jsx)(`ul`,{"aria-label":`Personas`,className:`m-0 flex list-none flex-col rounded-[12px] card border p-2`,children:v.map(e=>(0,J.jsx)(`li`,{children:(0,J.jsxs)(`a`,{href:Yb(e.id),className:`flex min-h-11 items-center gap-4 rounded-[8px] px-4 py-2 text-ink no-underline hover:bg-surface-muted hover:text-ink`,children:[(0,J.jsxs)(`span`,{className:`flex min-w-0 flex-1 flex-col`,children:[(0,J.jsxs)(`span`,{className:`truncate text-[13px] font-medium`,"data-tip":e.name,children:[e.name,!e.builtIn&&(0,J.jsx)(`span`,{className:`font-normal text-muted`,children:` · yours`})]}),(0,J.jsxs)(`span`,{className:`truncate text-[13px] text-muted`,children:[(0,J.jsxs)(`span`,{className:`font-mono`,children:[`/`,e.handle]}),` · `,Ub[e.kind],e.intent===`legitimate`?``:` · ${Hb[e.intent].toLowerCase()}`,` · `,e.role,e.domain?` · ${e.domain}`:``]})]}),(0,J.jsx)(`span`,{className:`flex-none text-[13px] text-muted tabular-nums`,children:kt(e.validates.length,`check`)})]})},e.id))}),t.length>0&&(0,J.jsxs)(`section`,{"aria-labelledby":`persona-not-loaded`,className:`flex flex-col gap-2`,children:[(0,J.jsx)(`h2`,{id:`persona-not-loaded`,className:`m-0 text-[13px] font-semibold text-muted`,children:`Not loaded`}),(0,J.jsx)(`ul`,{className:`m-0 flex list-none flex-col gap-1 p-0`,children:t.map(e=>(0,J.jsx)(`li`,{className:`text-[13px] text-fail [overflow-wrap:anywhere]`,children:e},e))})]}),(0,J.jsx)(`p`,{className:`m-0 text-[13px] text-muted`,children:`Your own personas are in .forgeqe/business-personas (each with its profile as a .md file), shared with everyone who uses the repository. Type a persona's command in any agent's chat, such as /priya and the task.`})]})}var Qb=B(`agents`,`persona`,`personas`),$b=e=>{let{builtIn:t,...n}=e;return n},ex=(e,t)=>{for(let n=1;n<100;n++){let r=n===1?`-copy`:`-copy-${n}`,i=`${e.slice(0,40-r.length)}${r}`;if(!t.has(i))return i}return``};function tx({personas:e,opened:t,onChanged:n}){let[r,i]=(0,q.useState)(null),[a,o]=(0,q.useState)(!1),[s,c]=(0,q.useState)(``),l=r?void 0:e.find(e=>e.id===t),u=!!t&&!r&&!l,d=()=>location.hash=Qb,f=(t,n)=>{let r=new Set(e.flatMap(e=>[e.id,e.handle])),a=n===`copy`?{...$b(t),id:ex(t.id,r),handle:``}:$b(t);c(``),i({mode:n,from:t,fields:a,listText:Object.fromEntries(lx.map(({key:e})=>[e,t[e].join(`
44
- `)]))})},p=(0,q.useMemo)(()=>new Set(e.filter(e=>r?.mode!==`edit`||e.id!==r.from.id).flatMap(e=>[e.id,e.handle])),[e,r]),m=r?fx(r.fields,r.listText,p,r.mode===`edit`):null,h=nx(!!t||!!r),g=async(e,t,r)=>{e[t].includes(r)||n(await Pt.update(e.id,{...$b(e),[t]:[...e[t],r]}))},_=async()=>{if(r&&m?.canSave){o(!0),c(``);try{let e={...r.fields,...Object.fromEntries(lx.map(({key:e})=>[e,ux(r.listText[e]||``)]))},t=r.mode===`edit`?await Pt.update(r.from.id,e):await Pt.save(e);n(t),i(null),r.mode===`copy`&&(ix=t.saved),location.hash=Yb(t.saved)}catch(e){c(e.message)}finally{o(!1)}}};return(0,J.jsxs)(J.Fragment,{children:[(0,J.jsx)(yr,{wide:!0,open:!!l||u,onClose:d,title:l?.name||`No such persona`,description:l?l.builtIn?`ForgeQE's persona: read only. Copy it to edit your own version for this project.`:`This project's own persona: you can edit it.`:void 0,footer:(0,J.jsxs)(J.Fragment,{children:[(0,J.jsxs)(V,{onClick:d,children:[(0,J.jsx)(A,{"aria-hidden":`true`}),`Close`]}),l&&!l.builtIn&&(0,J.jsxs)(V,{variant:`primary`,onClick:()=>f(l,`edit`),children:[(0,J.jsx)(re,{"aria-hidden":`true`}),`Edit`]}),l?.builtIn&&(0,J.jsxs)(V,{variant:`primary`,"data-tip":`Make your own persona from this one, under another id and command`,onClick:()=>f(l,`copy`),children:[(0,J.jsx)(I,{"aria-hidden":`true`}),`Copy to edit`]})]}),children:l?(0,J.jsx)(sx,{persona:l,resources:h,onAdd:l.builtIn?void 0:(e,t)=>g(l,e,t)}):(0,J.jsxs)(nn,{className:`py-6`,children:[`There is no persona "`,t,`" in this project.`]})}),(0,J.jsx)(yr,{wide:!0,open:!!r,onClose:()=>i(null),title:r?.mode===`edit`?`Edit ${r.from.name}`:`Copy ${r?.from.name||``}`,description:(0,J.jsxs)(J.Fragment,{children:[r?.mode===`copy`&&(0,J.jsx)(J.Fragment,{children:`A persona of your own, made from the built-in one, which stays as it is. `}),`Saved in `,(0,J.jsxs)(`span`,{className:`font-mono text-[13px]`,children:[`.forgeqe/business-personas/`,r?.fields.id||`<id>`,`.yaml`]}),`, shared with everyone who uses the repository.`]}),footer:(0,J.jsxs)(J.Fragment,{children:[s?(0,J.jsx)(`span`,{role:`alert`,className:`mr-auto self-center text-sm text-fail [overflow-wrap:anywhere]`,children:s}):r&&!m?.canSave&&(0,J.jsxs)(`span`,{className:`mr-auto self-center text-[13px] text-muted`,children:[`It needs a name, `,r.mode===`copy`?`an id, `:``,`a role, and what they check or want.`]}),(0,J.jsxs)(V,{onClick:()=>i(null),children:[(0,J.jsx)(A,{"aria-hidden":`true`}),`Cancel`]}),(0,J.jsxs)(V,{variant:`primary`,disabled:a||!m?.canSave,onClick:()=>void _(),children:[(0,J.jsx)(dt,{"aria-hidden":`true`}),a?`Saving…`:r?.mode===`copy`?`Save copy`:`Save`]})]}),children:r&&m&&(0,J.jsx)(`div`,{className:`pt-4`,children:(0,J.jsx)(px,{fields:r.fields,listText:r.listText,onFields:e=>i({...r,fields:e}),onListText:e=>i({...r,listText:e}),check:m,idLocked:r.mode===`edit`,resources:h})})})]})}function nx(e){let[t,n]=(0,q.useState)(null);return(0,q.useEffect)(()=>{e&&!t&&Pt.resources().then(n,e=>n({skills:[],documents:[],error:`The skills and documents did not load: ${e.message}`}))},[e,t]),t}function rx({persona:e,resources:t,onAdd:n}){let[r,i]=(0,q.useState)(null),a=t?.error?null:t,[o,s]=(0,q.useState)(``),[c,l]=(0,q.useState)(``),u=`${e.skills.join(`,`)}|${e.knowledge.join(`,`)}`;(0,q.useEffect)(()=>{i(null),Pt.suggest(e.id).then(i,e=>i({skills:[],documents:[],error:`The suggestions did not load: ${e.message}`}))},[e.id,u]);let d=e=>a?.skills.find(t=>t.name===e),f=e=>a?.documents.find(t=>t.ref===e),p=(0,J.jsx)(`span`,{className:`text-warn`,children:` · not in this project`}),m=async(e,t)=>{if(n){s(`${e}:${t}`),l(``);try{await n(e,t)}catch(e){l(e.message)}finally{s(``)}}},h=r?[...r.skills.map(e=>({key:`skills`,...e})),...r.documents.map(e=>({key:`knowledge`,...e}))]:[];return(0,J.jsxs)(J.Fragment,{children:[(0,J.jsxs)(`section`,{"aria-labelledby":`persona-uses`,className:`flex flex-col gap-2`,children:[(0,J.jsx)(`h3`,{id:`persona-uses`,className:`m-0 text-[13px] font-semibold text-muted`,children:`Shared skills and documents`}),e.skills.length+e.knowledge.length===0?(0,J.jsx)(`p`,{className:`m-0 text-sm text-muted`,children:n?`No skills or documents yet. Add a suggestion below, or pick them in Edit.`:`No skills or documents. Copy it to edit, then pick them.`}):(0,J.jsxs)(`ul`,{"aria-label":`Skills and documents`,className:`m-0 flex list-none flex-col p-0`,children:[e.skills.map(e=>(0,J.jsxs)(`li`,{className:`flex items-start gap-4 border-t border-line-soft py-2`,children:[(0,J.jsx)(Zt,{icon:je,size:16,className:`mt-1 text-muted`}),(0,J.jsxs)(`span`,{className:`flex min-w-0 flex-1 flex-col gap-1`,children:[(0,J.jsx)(`span`,{className:`font-mono text-[13px] [overflow-wrap:anywhere]`,children:e}),(0,J.jsxs)(`span`,{className:`text-[13px] text-muted [overflow-wrap:anywhere]`,children:[`Skill`,a&&!d(e)?p:d(e)?` · ${d(e).description}`:``]})]})]},`s:${e}`)),e.knowledge.map(e=>(0,J.jsxs)(`li`,{className:`flex items-start gap-4 border-t border-line-soft py-2`,children:[(0,J.jsx)(Zt,{icon:Ke,size:16,className:`mt-1 text-muted`}),(0,J.jsxs)(`span`,{className:`flex min-w-0 flex-1 flex-col gap-1`,children:[(0,J.jsx)(`span`,{className:`text-[13px] font-medium [overflow-wrap:anywhere]`,children:f(e)?.title||e}),(0,J.jsxs)(`span`,{className:`font-mono text-[13px] text-muted [overflow-wrap:anywhere]`,children:[e,a&&!f(e)?p:null]})]})]},`k:${e}`))]}),t?.error&&(0,J.jsx)(`p`,{role:`alert`,className:`m-0 rounded-[12px] bg-fail-soft px-4 py-2 text-sm text-fail [overflow-wrap:anywhere]`,children:t.error})]}),(0,J.jsxs)(`section`,{"aria-labelledby":`persona-suggested`,className:`flex flex-col gap-2`,children:[(0,J.jsx)(`h3`,{id:`persona-suggested`,className:`m-0 text-[13px] font-semibold text-muted`,children:`Suggested for them`}),r?r.error?(0,J.jsx)(`p`,{role:`alert`,className:`m-0 rounded-[12px] bg-fail-soft px-4 py-2 text-sm text-fail [overflow-wrap:anywhere]`,children:r.error}):h.length===0?(0,J.jsx)(`p`,{className:`m-0 text-sm text-muted`,children:`Nothing else matches their domain and checks. Add documents in Settings › Evidence, or knowledge notes, to see more.`}):(0,J.jsx)(`ul`,{"aria-label":`Suggested skills and documents`,className:`m-0 flex list-none flex-col p-0`,children:h.map(t=>(0,J.jsxs)(`li`,{className:`flex items-center gap-4 border-t border-line-soft py-2`,children:[(0,J.jsx)(Zt,{icon:t.key===`skills`?je:Ke,size:16,className:`text-muted`}),(0,J.jsxs)(`span`,{className:`flex min-w-0 flex-1 flex-col gap-1`,children:[(0,J.jsx)(`span`,{className:L(`text-[13px] [overflow-wrap:anywhere]`,t.key===`skills`?`font-mono`:`font-medium`),children:t.key===`knowledge`&&f(t.name)?.title||t.name}),(0,J.jsxs)(`span`,{className:`text-[13px] text-muted [overflow-wrap:anywhere]`,children:[t.key===`skills`?`Skill`:t.name,` · matched `,t.why]})]}),n&&(0,J.jsxs)(V,{size:`sm`,disabled:!!o,onClick:()=>void m(t.key,t.name),"data-tip":`Add to what ${e.name} uses`,children:[(0,J.jsx)(k,{"aria-hidden":`true`}),o===`${t.key}:${t.name}`?`Adding…`:`Add`]})]},`${t.key}:${t.name}`))}):(0,J.jsx)(`p`,{role:`status`,className:`m-0 text-sm text-muted`,children:`Looking for skills and documents that match…`}),c&&(0,J.jsx)(`p`,{role:`alert`,className:`m-0 rounded-[12px] bg-fail-soft px-4 py-2 text-sm text-fail [overflow-wrap:anywhere]`,children:c})]})]})}var ix=``,ax=e=>e.name.split(`,`)[0].trim()||e.name;function ox({persona:e}){let[t,n]=(0,q.useState)(null),[r,i]=(0,q.useState)(null),[a,o]=(0,q.useState)(``),[s,l]=(0,q.useState)(``),[u,d]=(0,q.useState)(``),f=ax(e),p=()=>Pt.own(e.id).then(n,e=>n({skills:[],knowledge:[],problems:[],error:`${f}'s own skills and notes did not load: ${e.message}`})),m=async()=>{o(`draft`),l(``);try{let[t,n]=await Promise.all([Pt.draftOwn(e.id),Pt.own(e.id)]),r=(e,t)=>n[e].some(e=>e.name===t);d(``),i({drafted:!0,items:[t.skill,t.knowledge].map(e=>({...e,replace:r(e.kind,e.name)}))})}catch(e){l(e.message)}finally{o(``)}};(0,q.useEffect)(()=>{n(null),p(),ix===e.id&&(ix=``,m())},[e.id]);let h=async()=>{if(r){o(`save`),d(``);try{let t=r.items.filter(e=>e.was&&e.was!==e.name),a=await Pt.saveOwn(e.id,r.items.map(({was:e,...n})=>({...n,replace:n.replace&&!t.some(e=>e.kind===n.kind&&e.name===n.name)})));i({...r,items:r.items.map(e=>({...e,replace:!0}))});for(let n of t)await Pt.removeOwn(e.id,n.kind,n.was);n(t.length?await Pt.own(e.id):a),i(null)}catch(e){d(e.message),p()}finally{o(``)}}},g=async t=>{o(`remove:${t.kind}/${t.name}`),d(``);try{n(await Pt.removeOwn(e.id,t.kind,t.name)),i(null)}catch(e){d(e.message)}finally{o(``)}},_=t?[...t.skills,...t.knowledge]:[],v=(e,t)=>r&&i({...r,items:r.items.map((n,r)=>r===e?{...n,...t}:n)}),y=!!r&&r.items.every(e=>/^[a-z0-9]+(-[a-z0-9]+)*$/.test(e.name)&&e.body.trim()&&(e.kind===`knowledge`||e.description.trim()));return(0,J.jsxs)(`section`,{"aria-labelledby":`persona-own`,className:`flex flex-col gap-2`,children:[(0,J.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-2`,children:[(0,J.jsxs)(`h3`,{id:`persona-own`,className:`m-0 text-[13px] font-semibold text-muted`,children:[f,`'s own skills and knowledge`]}),(0,J.jsxs)(V,{size:`sm`,disabled:!!a||!t,onClick:()=>void m(),"data-tip":`Mask drafts a skill and a knowledge note for ${f}; you review them before anything is saved`,children:[(0,J.jsx)(c,{"aria-hidden":`true`}),a===`draft`?`Generating…`:_.length?`Generate again`:`Generate skill and knowledge`]})]}),(0,J.jsxs)(`p`,{className:`m-0 text-[13px] text-muted`,children:[`Used only when someone works as `,f,`, never by other agents.`]}),a===`draft`&&(0,J.jsxs)(`p`,{role:`status`,className:`m-0 text-sm text-muted`,children:[`Mask is writing `,f,`'s skill and knowledge note…`]}),t?_.length===0?!t.error&&a!==`draft`&&(0,J.jsxs)(`p`,{className:`m-0 text-sm text-muted`,children:[`None yet. Generate a skill and a knowledge note from `,f,`'s checks, then change them as you need.`]}):(0,J.jsx)(`ul`,{"aria-label":`${f}'s own skills and knowledge`,className:`m-0 flex list-none flex-col p-0`,children:_.map(e=>(0,J.jsxs)(`li`,{className:`flex items-center gap-4 border-t border-line-soft py-2`,children:[(0,J.jsx)(Zt,{icon:e.kind===`skills`?je:Ke,size:16,className:`text-muted`}),(0,J.jsxs)(`span`,{className:`flex min-w-0 flex-1 flex-col gap-1`,children:[(0,J.jsx)(`span`,{className:`font-mono text-[13px] [overflow-wrap:anywhere]`,children:e.name}),(0,J.jsx)(`span`,{className:`line-clamp-2 text-[13px] text-muted [overflow-wrap:anywhere]`,children:e.kind===`skills`?`Skill · ${e.description}`:`Knowledge note`})]}),(0,J.jsxs)(V,{size:`sm`,disabled:!!a,onClick:()=>(d(``),i({drafted:!1,items:[{...e,replace:!0,was:e.name}]})),children:[(0,J.jsx)(re,{"aria-hidden":`true`}),`Edit`]})]},`${e.kind}:${e.name}`))}):(0,J.jsx)(`p`,{role:`status`,className:`m-0 text-sm text-muted`,children:`Loading…`}),t?.problems.length?(0,J.jsxs)(`p`,{className:`m-0 text-[13px] text-warn [overflow-wrap:anywhere]`,children:[`Not read: `,t.problems.join(`; `)]}):null,(s||t?.error)&&(0,J.jsx)(`p`,{role:`alert`,className:`m-0 rounded-[12px] bg-fail-soft px-4 py-2 text-sm text-fail [overflow-wrap:anywhere]`,children:s||t?.error}),(0,J.jsx)(yr,{wide:!0,open:!!r,onClose:()=>i(null),title:r?.drafted?`Review ${f}'s skill and knowledge`:`Edit ${r?.items[0]?.was||``}`,description:(0,J.jsxs)(J.Fragment,{children:[r?.drafted&&(0,J.jsx)(J.Fragment,{children:`Mask's draft: change anything, then save. `}),`Kept in `,(0,J.jsxs)(`span`,{className:`font-mono text-[13px]`,children:[`.forgeqe/business-personas/`,e.id,`/`]}),` and used only when someone works as `,f,`.`]}),footer:(0,J.jsxs)(J.Fragment,{children:[u?(0,J.jsx)(`span`,{role:`alert`,className:`mr-auto self-center text-sm text-fail [overflow-wrap:anywhere]`,children:u}):r&&!y&&(0,J.jsx)(`span`,{className:`mr-auto self-center text-[13px] text-muted`,children:`Each needs a name of lower-case words joined by dashes and its text; a skill also its "use when" line.`}),r&&!r.drafted&&r.items[0]?.was&&(0,J.jsxs)(V,{disabled:!!a,onClick:()=>void g({...r.items[0],name:r.items[0].was}),className:L(!u&&y&&`mr-auto`,`text-fail`),children:[(0,J.jsx)(Ie,{"aria-hidden":`true`}),a.startsWith(`remove:`)?`Deleting…`:`Delete`]}),(0,J.jsxs)(V,{onClick:()=>i(null),children:[(0,J.jsx)(A,{"aria-hidden":`true`}),`Cancel`]}),(0,J.jsxs)(V,{variant:`primary`,disabled:a===`save`||!y,onClick:()=>void h(),children:[(0,J.jsx)(dt,{"aria-hidden":`true`}),a===`save`?`Saving…`:r?.drafted?`Save both`:`Save`]})]}),children:r&&(0,J.jsx)(`div`,{className:`flex flex-col gap-6 pt-4`,children:r.items.map((e,t)=>(0,J.jsxs)(`section`,{"aria-labelledby":`own-item-${t}`,className:`flex flex-col gap-4`,children:[(0,J.jsxs)(`h3`,{id:`own-item-${t}`,className:`m-0 flex items-center gap-2 text-[13px] font-semibold text-muted`,children:[(0,J.jsx)(Zt,{icon:e.kind===`skills`?je:Ke,size:14}),e.kind===`skills`?`Skill`:`Knowledge note`,e.replace&&!e.was&&(0,J.jsx)(`span`,{className:`font-normal text-warn`,children:` · replaces the one of this name`})]}),(0,J.jsxs)(`label`,{className:`flex flex-col gap-2 text-sm`,children:[(0,J.jsx)(`span`,{className:`font-medium`,children:`Name`}),(0,J.jsx)(R,{value:e.name,maxLength:64,spellCheck:!1,autoComplete:`off`,className:`font-mono`,onChange:e=>v(t,{name:e.target.value.toLowerCase().replace(/[^a-z0-9-]+/g,`-`)})})]}),e.kind===`skills`&&(0,J.jsxs)(`label`,{className:`flex flex-col gap-2 text-sm`,children:[(0,J.jsx)(`span`,{className:`font-medium`,children:`Use when`}),(0,J.jsx)(R,{value:e.description,maxLength:400,onChange:e=>v(t,{description:e.target.value})})]}),(0,J.jsxs)(`div`,{className:`flex flex-col gap-2 text-sm`,children:[(0,J.jsx)(`label`,{htmlFor:`own-body-${t}`,className:`font-medium`,children:e.kind===`skills`?`Instructions`:`What it says`}),(0,J.jsx)(Ro,{id:`own-body-${t}`,value:e.body,lang:`markdown`,onChange:e=>v(t,{body:e})})]})]},t))})})]})}function sx({persona:e,resources:t,onAdd:n}){let r=[[`persona-validates`,`What they check before accepting the software`,e.validates],[`persona-goals`,`What they want to do`,e.goals],[`persona-knows`,`What they know`,e.knows],[`persona-frustrations`,`What puts them off`,e.frustrations],[`persona-scenarios`,`What they would try`,e.scenarios],[`persona-motivations`,`What drives them`,e.motivations],[`persona-permissions`,`What their role lets them do`,e.permissions],[`persona-constraints`,`What limits them`,e.constraints],[`persona-mistakes`,`Mistakes they make`,e.mistakes],[`persona-relationships`,`Who they deal with`,e.relationships]];return(0,J.jsxs)(`div`,{className:`flex flex-col gap-6 pt-4`,children:[(0,J.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,J.jsxs)(`p`,{className:`m-0 text-[13px] text-muted`,children:[(0,J.jsxs)(`span`,{className:`font-mono`,children:[`/`,e.handle]}),` · `,Ub[e.kind],` · `,e.role,e.domain?` · ${e.domain}`:``,` · `,e.expertise.charAt(0).toUpperCase()+e.expertise.slice(1),e.intent===`legitimate`?``:` · ${Hb[e.intent].toLowerCase()}, risk appetite ${e.risk_appetite}`,e.builtIn?``:` · version ${e.version}`]}),e.description&&(0,J.jsx)(`p`,{className:`m-0 text-sm leading-relaxed text-ink-2`,children:e.description})]}),(0,J.jsx)(ox,{persona:e}),(0,J.jsx)(rx,{persona:e,resources:t,...n?{onAdd:n}:{}}),r.filter(([,,e])=>e.length).map(([e,t,n])=>(0,J.jsxs)(`section`,{"aria-labelledby":e,className:`flex flex-col gap-2`,children:[(0,J.jsx)(`h3`,{id:e,className:`m-0 text-[13px] font-semibold text-muted`,children:t}),(0,J.jsx)(`ul`,{className:`m-0 flex list-disc flex-col gap-1 pl-6 text-sm text-ink-2`,children:n.map(e=>(0,J.jsx)(`li`,{className:`[overflow-wrap:anywhere]`,children:e},e))})]},e))]})}var cx={id:``,handle:``,name:``,kind:`business_user`,role:``,domain:``,expertise:`intermediate`,description:``,goals:[],knows:[],validates:[],frustrations:[],scenarios:[],intent:`legitimate`,risk_appetite:`low`,motivations:[],permissions:[],constraints:[],mistakes:[],relationships:[],version:1,skills:[],knowledge:[]},lx=[{key:`validates`,label:`What they check`,hint:`One rule a test can check per line, such as: a refund never exceeds the captured amount.`},{key:`goals`,label:`What they want to do`,hint:`One per line.`},{key:`knows`,label:`What they know`,hint:`Terms and rules of the domain, one per line.`},{key:`frustrations`,label:`What puts them off`,hint:`One per line.`},{key:`scenarios`,label:`What they would try`,hint:`Tasks in their words, one per line.`},{key:`motivations`,label:`What drives them`,hint:`One per line, such as: save money, hit the monthly target.`},{key:`permissions`,label:`What their role lets them do`,hint:`In the app, one per line, such as: issue refunds up to 500.`},{key:`constraints`,label:`What limits them`,hint:`Money, time or rules they work within, one per line.`},{key:`mistakes`,label:`Mistakes they make`,hint:`One per line, such as: double-clicks Pay when the page is slow.`},{key:`relationships`,label:`Who they deal with`,hint:`Other personas by id and how, one per line, such as: approves for insider-agent.`}],ux=e=>e.split(`
45
- `).map(e=>e.trim()).filter(Boolean);function dx({open:e,onClose:t,personas:n,onSaved:r}){let[i,a]=(0,q.useState)(``),[o,s]=(0,q.useState)(``),[l,u]=(0,q.useState)(``),[d,f]=(0,q.useState)(null),[p,m]=(0,q.useState)({}),[h,g]=(0,q.useState)(!1),[_,v]=(0,q.useState)(``),[y,b]=(0,q.useState)(``),x=(0,q.useMemo)(()=>new Set(n.flatMap(e=>[e.id,e.handle])),[n]),S=nx(!!d),C=(0,q.useRef)(0);(0,q.useEffect)(()=>{C.current+=1,e&&(a(``),s(``),u(``),f(null),m({}),g(!1),v(``),b(``))},[e]);let w=e=>{f(e),m(Object.fromEntries(lx.map(({key:t})=>[t,e[t].join(`
46
- `)])))},T=async()=>{let e=C.current;v(`draft`),b(``);try{let{persona:t}=await Pt.draft({request:i.trim(),...o?{kind:o}:{},...l.trim()?{domain:l.trim()}:{}});if(e!==C.current)return;let{builtIn:n,...r}=t;w(r),g(!0)}catch(t){e===C.current&&b(t.message)}finally{e===C.current&&v(``)}},E=async()=>{if(d){v(`save`),b(``);try{let e={...d,...Object.fromEntries(lx.map(({key:e})=>[e,ux(p[e]||``)]))};r((await Pt.save(e)).saved)}catch(e){b(e.message),v(``)}}},D=d?fx(d,p,x,!1):null,O=!!D?.canSave;return(0,J.jsx)(yr,{wide:!0,open:e,onClose:t,title:`New persona`,description:(0,J.jsxs)(J.Fragment,{children:[`Saved in `,(0,J.jsxs)(`span`,{className:`font-mono text-[13px]`,children:[`.forgeqe/business-personas/`,d?.id||`<id>`,`.yaml`]}),`, shared with the project.`]}),footer:(0,J.jsxs)(J.Fragment,{children:[y?(0,J.jsx)(`span`,{role:`alert`,className:`mr-auto self-center text-sm text-fail [overflow-wrap:anywhere]`,children:y}):d&&!O&&(0,J.jsx)(`span`,{className:`mr-auto self-center text-[13px] text-muted`,children:`It needs a name, an id, a role, and what they check or want.`}),(0,J.jsxs)(V,{onClick:t,children:[(0,J.jsx)(A,{"aria-hidden":`true`}),`Cancel`]}),(0,J.jsxs)(V,{variant:`primary`,disabled:!!_||!O,onClick:()=>void E(),children:[(0,J.jsx)(dt,{"aria-hidden":`true`}),_===`save`?`Saving…`:`Save`]})]}),children:(0,J.jsxs)(`div`,{className:`flex flex-col gap-6 pt-4`,children:[(0,J.jsxs)(`section`,{"aria-labelledby":`persona-ask`,className:`flex flex-col gap-4`,children:[(0,J.jsx)(`h3`,{id:`persona-ask`,className:`m-0 text-[13px] font-semibold text-muted`,children:`Who is the persona?`}),(0,J.jsxs)(`label`,{className:`flex flex-col gap-2 text-sm`,children:[(0,J.jsx)(`span`,{className:`font-medium`,children:`Describe them`}),(0,J.jsx)(`span`,{className:`text-[13px] text-muted`,children:`Their job, what they know and what they check. Mask drafts the rest.`}),(0,J.jsx)(pn,{rows:3,value:i,maxLength:2e3,onChange:e=>a(e.target.value),placeholder:`An SME in card payments who reconciles settlements every morning and signs off refunds`})]}),(0,J.jsxs)(`div`,{className:`grid grid-cols-1 gap-4 sm:grid-cols-2`,children:[(0,J.jsxs)(`label`,{className:`flex flex-col gap-2 text-sm`,children:[(0,J.jsx)(`span`,{className:`font-medium`,children:`Kind`}),(0,J.jsxs)(ln,{value:o,onChange:e=>s(e.target.value),children:[(0,J.jsx)(`option`,{value:``,children:`Let the agent choose`}),un.map(e=>(0,J.jsx)(`option`,{value:e,children:Ub[e]},e))]})]}),(0,J.jsxs)(`label`,{className:`flex flex-col gap-2 text-sm`,children:[(0,J.jsx)(`span`,{className:`font-medium`,children:`Domain`}),(0,J.jsx)(R,{value:l,maxLength:80,onChange:e=>u(e.target.value),placeholder:`payments`})]})]}),(0,J.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,J.jsxs)(V,{disabled:!!_||!i.trim(),onClick:()=>void T(),"data-tip":h?`Ask Mask for another draft`:`Ask Mask for a draft`,children:[(0,J.jsx)(c,{"aria-hidden":`true`}),h?`Draft again`:`Draft`]}),!d&&(0,J.jsxs)(V,{disabled:!!_,onClick:()=>w(cx),"data-tip":`Write every field yourself`,children:[(0,J.jsx)(Ce,{"aria-hidden":`true`}),`Write`]}),_===`draft`&&(0,J.jsx)(`span`,{role:`status`,className:`text-sm text-muted`,children:`Mask is drafting…`})]})]}),d&&D&&(0,J.jsxs)(`section`,{"aria-labelledby":`persona-fields`,className:`flex flex-col gap-4`,children:[(0,J.jsx)(`h3`,{id:`persona-fields`,className:`m-0 text-[13px] font-semibold text-muted`,children:`The persona`}),(0,J.jsx)(px,{fields:d,listText:p,onFields:f,onListText:m,check:D,idLocked:!1,resources:S})]})]})})}function fx(e,t,n,r){let i=r||e.id===``?``:qb.test(e.id)?n.has(e.id)?`A persona has this id: pick another.`:``:`Lower-case letters, digits and dashes, at most 40.`,a=e.handle||e.id,o=a===``?``:Jb.test(a)?e.handle&&e.handle!==e.id&&n.has(e.handle)?`A persona has this command: pick another.`:``:`A word of lower-case letters, digits and dashes that starts with a letter.`;return{idProblem:i,handleProblem:o,canSave:!!e.id&&!i&&!o&&!!e.name.trim()&&!!e.role.trim()&&(ux(t.validates||``).length>0||ux(t.goals||``).length>0)}}function px({fields:e,listText:t,onFields:n,onListText:r,check:i,idLocked:a,resources:o}){let s=(t,r)=>n({...e,[t]:r}),{idProblem:c,handleProblem:l}=i;return(0,J.jsxs)(`div`,{className:`flex flex-col gap-4`,children:[(0,J.jsxs)(`div`,{className:`grid grid-cols-1 gap-4 sm:grid-cols-2`,children:[(0,J.jsxs)(`label`,{className:`flex flex-col gap-2 text-sm`,children:[(0,J.jsx)(`span`,{className:`font-medium`,children:`Name`}),(0,J.jsx)(R,{value:e.name,maxLength:80,onChange:e=>s(`name`,e.target.value),placeholder:`Priya, payments SME`})]}),(0,J.jsxs)(`label`,{className:`flex flex-col gap-2 text-sm`,children:[(0,J.jsx)(`span`,{className:`font-medium`,children:`Id`}),(0,J.jsx)(R,{value:e.id,disabled:a,maxLength:40,spellCheck:!1,autoComplete:`off`,"aria-invalid":!!c,"aria-describedby":c?`persona-id-error`:void 0,onChange:e=>s(`id`,e.target.value.toLowerCase()),className:`font-mono`}),c&&(0,J.jsx)(`p`,{id:`persona-id-error`,role:`alert`,className:`m-0 text-[13px] text-fail`,children:c})]}),(0,J.jsxs)(`label`,{className:`flex flex-col gap-2 text-sm`,children:[(0,J.jsx)(`span`,{className:`font-medium`,children:`Command`}),(0,J.jsxs)(`span`,{className:`text-[13px] text-muted`,children:[`Type it in any agent's chat: /`,e.handle||e.id||`priya`,` Validate the payment change.`]}),(0,J.jsx)(R,{value:e.handle,maxLength:40,spellCheck:!1,autoComplete:`off`,"aria-invalid":!!l,"aria-describedby":l?`persona-handle-error`:void 0,onChange:e=>s(`handle`,e.target.value.toLowerCase().replace(/^\//,``)),className:`font-mono`,placeholder:e.id||`priya`}),l&&(0,J.jsx)(`p`,{id:`persona-handle-error`,role:`alert`,className:`m-0 text-[13px] text-fail`,children:l})]}),(0,J.jsxs)(`label`,{className:`flex flex-col gap-2 text-sm`,children:[(0,J.jsx)(`span`,{className:`font-medium`,children:`Kind`}),(0,J.jsx)(ln,{value:e.kind,onChange:e=>s(`kind`,e.target.value),children:un.map(e=>(0,J.jsx)(`option`,{value:e,children:Ub[e]},e))})]}),(0,J.jsxs)(`label`,{className:`flex flex-col gap-2 text-sm`,children:[(0,J.jsx)(`span`,{className:`font-medium`,children:`Expertise in the domain`}),(0,J.jsx)(ln,{value:e.expertise,onChange:e=>s(`expertise`,e.target.value),children:Dt.map(e=>(0,J.jsx)(`option`,{value:e,children:e.charAt(0).toUpperCase()+e.slice(1)},e))})]}),(0,J.jsxs)(`label`,{className:`flex flex-col gap-2 text-sm`,children:[(0,J.jsx)(`span`,{className:`font-medium`,children:`Intent`}),(0,J.jsx)(`span`,{className:`text-[13px] text-muted`,children:`Opportunistic takes any advantage the app gives; adversarial sets out to misuse it. Watchdog tests as them.`}),(0,J.jsx)(ln,{value:e.intent,onChange:e=>s(`intent`,e.target.value),children:Mt.map(e=>(0,J.jsx)(`option`,{value:e,children:Hb[e]},e))})]}),(0,J.jsxs)(`label`,{className:`flex flex-col gap-2 text-sm`,children:[(0,J.jsx)(`span`,{className:`font-medium`,children:`Risk appetite`}),(0,J.jsx)(ln,{value:e.risk_appetite,onChange:e=>s(`risk_appetite`,e.target.value),children:jt.map(e=>(0,J.jsx)(`option`,{value:e,children:e.charAt(0).toUpperCase()+e.slice(1)},e))})]}),(0,J.jsxs)(`label`,{className:`flex flex-col gap-2 text-sm`,children:[(0,J.jsx)(`span`,{className:`font-medium`,children:`Role`}),(0,J.jsx)(R,{value:e.role,maxLength:120,onChange:e=>s(`role`,e.target.value),placeholder:`Payments operations lead`})]}),(0,J.jsxs)(`label`,{className:`flex flex-col gap-2 text-sm`,children:[(0,J.jsx)(`span`,{className:`font-medium`,children:`Domain`}),(0,J.jsx)(R,{value:e.domain,maxLength:80,onChange:e=>s(`domain`,e.target.value)})]})]}),(0,J.jsxs)(`label`,{className:`flex flex-col gap-2 text-sm`,children:[(0,J.jsx)(`span`,{className:`font-medium`,children:`Who they are`}),(0,J.jsx)(pn,{rows:3,value:e.description,maxLength:1200,onChange:e=>s(`description`,e.target.value)})]}),lx.map(({key:e,label:n,hint:i})=>(0,J.jsxs)(`label`,{className:`flex flex-col gap-2 text-sm`,children:[(0,J.jsx)(`span`,{className:`font-medium`,children:n}),(0,J.jsx)(`span`,{className:`text-[13px] text-muted`,children:i}),(0,J.jsx)(pn,{rows:e===`validates`?5:3,value:t[e]||``,onChange:n=>r({...t,[e]:n.target.value})})]},e)),(0,J.jsx)(hx,{id:`persona-skills`,label:`Skills an agent loads as them`,hint:`The agent loads these with its skill tool whenever someone works as this persona.`,items:o?.skills.map(e=>({id:e.name,title:e.name,note:e.description,mono:!0}))??null,...o?.error?{error:o.error}:{},value:e.skills,onChange:e=>s(`skills`,e)}),(0,J.jsx)(hx,{id:`persona-knowledge`,label:`Documents they rely on`,hint:`Knowledge notes and the project's documents. The agent searches them for what the request needs.`,items:o?.documents.map(e=>({id:e.ref,title:e.title,note:e.ref}))??null,...o?.error?{error:o.error}:{},value:e.knowledge,onChange:e=>s(`knowledge`,e)})]})}var mx=12;function hx({id:e,label:t,hint:n,items:r,error:i,value:a,onChange:o}){let[s,c]=(0,q.useState)(``),l=s.toLowerCase().split(/\s+/).filter(Boolean),u=r?[...a.filter(e=>!r.some(t=>t.id===e)).map(e=>({id:e,title:e,note:`Not in this project`,mono:!0})),...r]:[],d=u.filter(e=>l.every(t=>`${e.title} ${e.note} ${e.id}`.toLowerCase().includes(t))).sort((e,t)=>Number(a.includes(t.id))-Number(a.includes(e.id))),f=a.length>=mx;return(0,J.jsxs)(`fieldset`,{className:`m-0 flex flex-col gap-2 border-0 p-0 text-sm`,children:[(0,J.jsxs)(`legend`,{className:`mb-2 p-0 font-medium`,children:[t,` `,(0,J.jsxs)(`span`,{className:`font-normal text-muted tabular-nums`,children:[`· `,a.length,` picked`]})]}),(0,J.jsx)(`span`,{className:`text-[13px] text-muted`,children:n}),i?(0,J.jsx)(`p`,{role:`alert`,className:`m-0 rounded-[12px] bg-fail-soft px-4 py-2 text-sm text-fail [overflow-wrap:anywhere]`,children:i}):r?u.length===0?(0,J.jsx)(`p`,{className:`m-0 text-sm text-muted`,children:`There are none in this project yet.`}):(0,J.jsxs)(J.Fragment,{children:[(0,J.jsx)(`div`,{className:`flex flex-wrap items-center gap-2`,children:(0,J.jsx)(en,{id:`${e}-find`,label:`Find in ${t.toLowerCase()}`,value:s,onChange:c})}),(0,J.jsxs)(`ul`,{"aria-label":t,className:`m-0 max-h-72 list-none overflow-y-auto rounded-[12px] card border px-4 py-0`,children:[d.length===0&&(0,J.jsx)(`li`,{className:`py-4 text-sm text-muted`,children:`Nothing matches.`}),d.map(e=>{let t=a.includes(e.id);return(0,J.jsx)(`li`,{className:`border-t border-line-soft first:border-t-0`,children:(0,J.jsxs)(`label`,{className:L(`flex min-h-12 items-center gap-4 py-2`,!t&&f?`cursor-not-allowed opacity-60`:`cursor-pointer`),children:[(0,J.jsx)(vy,{checked:t,disabled:!t&&f,onCheckedChange:t=>o(t?[...a,e.id]:a.filter(t=>t!==e.id))}),(0,J.jsxs)(`span`,{className:`flex min-w-0 flex-1 flex-col gap-1`,children:[(0,J.jsx)(`span`,{className:L(`text-[13px] [overflow-wrap:anywhere]`,e.mono?`font-mono`:`font-medium`),children:e.title}),(0,J.jsx)(`span`,{className:`line-clamp-2 text-[13px] text-muted [overflow-wrap:anywhere]`,"data-tip":e.note.length>120?e.note:void 0,children:e.note})]})]})},e.id)})]}),f&&(0,J.jsxs)(`span`,{className:`text-[13px] text-muted`,children:[`At most `,mx,`: take one off to pick another.`]})]}):(0,J.jsx)(`p`,{role:`status`,className:`m-0 text-sm text-muted`,children:`Loading…`})]})}var gx={test:[`Testing the connection`,`Tested the connection`,`waiting`],tables:[`Reading the tables`,`Read the tables`,`searching`],query:[`Running the query`,`Ran the query`,`working`],gen:[`Making a preview`,`Made a preview`,`writing`],files:[`Writing the files`,`Wrote the files`,`writing`],insert:[`Inserting test data`,`Inserted test data`,`working`],batches:[`Listing the batches`,`Listed the batches`,`searching`],clean:[`Removing a batch`,`Removed a batch`,`working`],request:[`Asking Miner for test data`,`Asked Miner for test data`,`thinking`],fetch:[`Fetching the request again`,`Fetched the request again`,`searching`],ask:[`Asking Miner`,`Asked Miner`,`thinking`],checks:[`Running the checks`,`Ran the checks`,`working`],map:[`Reading the schema`,`Read the schema`,`searching`],check:[`Checking the flows`,`Checked the flows`,`working`],trace:[`Following the record`,`Followed the record`,`searching`]};function _x(){let[e,t]=(0,q.useState)(null),[n,r]=(0,q.useState)(``),[i,a]=(0,q.useState)(!1),o=(0,q.useCallback)(()=>{qt.view().then(e=>{t(e),r(``)},e=>r(e.message))},[]);(0,q.useEffect)(o,[o]);let s=!!e?.job?.running;return(0,q.useEffect)(()=>{if(!s)return;let e=setInterval(o,1e3);return()=>clearInterval(e)},[s,o]),{view:e,error:n,busy:i||s,running:s,act:async(e,t)=>{a(!0),r(``);try{await qt.run(e,t),o()}catch(e){r(e.message)}finally{a(!1)}},stop:()=>void qt.stop().then(o),load:o,job:e?.job??null}}var vx=e=>e==null?`NULL`:typeof e==`object`?JSON.stringify(e):String(e);function yx({file:e,onNote:t}){return(0,J.jsx)(`button`,{type:`button`,"data-tip":e,onClick:async()=>t(await gn(e)),className:L(Ct({size:`sm`}),`font-mono text-[13px]`),children:e.split(/[\\/]/).pop()})}function bx({children:e,label:t}){return(0,J.jsx)(`pre`,{"aria-label":t,className:`m-0 max-h-[320px] overflow-auto rounded-[12px] bg-surface-muted p-4 font-mono text-[13px] leading-relaxed whitespace-pre text-ink-2`,children:e})}function xx({job:e,onStop:t,words:n}){let[r,i,a]=(n??gx)[e.kind]??[`Working`,`Done`,`working`],o=(0,q.useRef)(null);(0,q.useEffect)(()=>{o.current&&(o.current.scrollTop=o.current.scrollHeight)},[e.lines.length]);let s=e.exitCode===0,c=!s&&(e.kind===`check`||e.kind===`trace`)&&e.result!==void 0&&!e.result.error;return(0,J.jsxs)(`section`,{"aria-label":e.running?r:i,className:`flex flex-col gap-2 rounded-[14px] card border p-4`,children:[(0,J.jsxs)(`div`,{className:`flex flex-wrap items-center gap-4`,children:[(0,J.jsxs)(`span`,{className:`min-w-0 flex-1 font-medium [overflow-wrap:anywhere]`,children:[e.running?r:i,e.target?(0,J.jsxs)(`span`,{className:`font-normal text-muted`,children:[` · `,e.target]}):null]}),(0,J.jsx)(z,{tone:e.running?`running`:s?`pass`:e.exitCode===2||c?`warn`:`fail`,orb:a,children:e.running?`Working`:s?`Done`:c?`Some broken`:e.exitCode===2?`Not done`:`Failed`}),e.running&&(0,J.jsxs)(V,{variant:`danger`,onClick:t,children:[(0,J.jsx)(Je,{fill:`currentColor`,"aria-hidden":`true`}),`Stop`]})]}),(0,J.jsxs)(`details`,{open:e.running||!s&&!e.result,children:[(0,J.jsxs)(`summary`,{className:`cursor-pointer text-sm text-muted`,children:[`Output (`,kt(e.lines.length,`line`),`)`]}),(0,J.jsx)(`code`,{className:`mt-2 block font-mono text-[13px] text-muted [overflow-wrap:anywhere]`,children:e.command}),(0,J.jsx)(`pre`,{ref:o,className:`mt-2 max-h-[240px] overflow-auto rounded-[10px] bg-surface-muted p-4 font-mono text-[13px] leading-relaxed whitespace-pre-wrap text-ink-2`,children:e.lines.join(`
47
- `)||`Starting…`})]})]})}function Sx({text:e}){return(0,J.jsx)(`p`,{role:`alert`,className:`m-0 rounded-[12px] bg-fail-soft px-4 py-2 text-sm text-fail [overflow-wrap:anywhere]`,children:e})}function Cx({columns:e,rows:t}){let n=e.map((e,n)=>t.length>0&&t.every(e=>e[n]===null||e[n]===void 0||typeof e[n]==`number`)&&t.some(e=>typeof e[n]==`number`));return(0,J.jsx)(Sr,{label:`Rows`,resetKey:t,head:e.map((e,t)=>(0,J.jsx)(`th`,{className:n[t]?Br:Sn,children:e},e)),children:t.map((e,t)=>(0,J.jsx)(`tr`,{className:_i,children:e.map((e,t)=>(0,J.jsx)(`td`,{"data-tip":vx(e),className:L(`px-4 py-2 font-mono text-[13px]`,n[t]?`text-right whitespace-nowrap tabular-nums`:`max-w-[320px] truncate`,e==null&&`text-muted`),children:vx(e)},t))},t))})}function wx({r:e}){return(0,J.jsxs)(`div`,{className:`flex flex-col gap-4`,children:[(e.order||[]).map(t=>{let n=e.preview?.[t],r=n?.sample||[],i=r.length?Object.keys(r[0]):[];return(0,J.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,J.jsxs)(`span`,{className:`text-sm`,children:[(0,J.jsx)(`span`,{className:`font-medium`,children:t}),` · `,kt(e.rows?.[t]??0,`row`),n?.database_fills?.length?(0,J.jsxs)(`span`,{className:`text-muted`,children:[` · the database fills `,n.database_fills.join(`, `)]}):null,e.masked?.[t]?.length?(0,J.jsxs)(`span`,{className:`text-muted`,children:[` · masked `,e.masked[t].join(`, `)]}):null]}),i.length>0&&(0,J.jsx)(Cx,{columns:i,rows:r.slice(0,3).map(e=>i.map(t=>e[t]))})]},t)}),(e.warnings||[]).map((e,t)=>(0,J.jsx)(`p`,{className:`m-0 text-[13px] text-warn`,children:e},t))]})}var Tx={query:`Existing rows`,generate:`New rows`};function Ex({r:e,onNote:t}){let n=Object.entries(e.rows||{});return(0,J.jsxs)(`div`,{className:`flex flex-col gap-4`,children:[(0,J.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,J.jsx)(z,{tone:`pass`,children:Tx[e.kind||``]||`Answered`}),(0,J.jsxs)(`span`,{className:`min-w-0 text-sm text-ink-2 [overflow-wrap:anywhere]`,children:[e.database,e.why?` · ${e.why}`:``]})]}),n.map(([t,n])=>(0,J.jsx)(Dx,{title:t===`result`?`Rows found`:t,rows:n,total:e.row_counts?.[t]??n.length},t)),e.sql&&(0,J.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,J.jsx)(`span`,{className:`text-sm font-medium`,children:`The query, as the database checked it`}),(0,J.jsx)(bx,{label:`SQL`,children:e.sql})]}),e.script_preview&&e.script_preview.length>0&&(0,J.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,J.jsx)(`span`,{className:`text-sm font-medium`,children:`INSERT script for these rows, not run`}),(0,J.jsx)(bx,{label:`INSERT script`,children:e.script_preview.join(`
48
- `)})]}),e.files?.length?(0,J.jsxs)(`p`,{className:`m-0 flex flex-wrap items-center gap-2 text-sm`,children:[`Kept`,e.files.map(e=>(0,J.jsx)(yx,{file:e,onNote:t},e))]}):null,e.replay&&(0,J.jsxs)(`p`,{className:`m-0 text-[13px] text-muted`,children:[`Tests and pipelines get the same data with `,(0,J.jsx)(`code`,{className:`font-mono text-[13px] text-ink-2`,children:e.replay}),`, without a model.`]})]})}function Dx({title:e,rows:t,total:n}){let r=[...new Set(t.flatMap(e=>Object.keys(e)))];return(0,J.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,J.jsxs)(`span`,{className:`text-sm`,children:[(0,J.jsx)(`span`,{className:`font-medium`,children:e}),` · `,kt(n,`row`),n>t.length?(0,J.jsxs)(`span`,{className:`text-muted`,children:[` · `,t.length,` shown`]}):null]}),r.length>0?(0,J.jsx)(Cx,{columns:r,rows:t.map(e=>r.map(t=>e[t]))}):(0,J.jsx)(`p`,{className:`m-0 text-sm text-muted`,children:`No rows match.`})]})}function Ox({items:e,text:t,label:n,size:r=10,children:i}){let[a,o]=(0,q.useState)(``),[s,c]=(0,q.useState)(0),l=a.toLowerCase().split(/\s+/).filter(Boolean),u=l.length?e.filter(e=>l.every(n=>t(e).toLowerCase().includes(n))):e;(0,q.useEffect)(()=>c(0),[a,e.length]);let d=Math.min(s,Math.max(0,Math.ceil(u.length/r)-1));return(0,J.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[e.length>r&&(0,J.jsx)(en,{id:`find-${n.toLowerCase().replace(/\W+/g,`-`)}`,label:`Find in ${n.toLowerCase()}`,value:a,onChange:o,className:`flex-none`}),u.length?(0,J.jsx)(`ul`,{className:`m-0 flex list-none flex-col p-0`,children:u.slice(d*r,d*r+r).map(i)}):(0,J.jsx)(`p`,{className:`m-0 text-sm text-muted`,children:`Nothing matches.`}),u.length>r&&(0,J.jsx)(sn,{page:d,size:r,total:u.length,onPage:c,label:`Pages of ${n.toLowerCase()}`})]})}var kx=`agent`;function Ax({page:e,title:t,label:n,tabs:r,current:i,onPick:a,below:o,end:s,agentBody:c,keepAgent:l=!1,wide:u=!1,children:d}){let f=(0,J.jsx)(ai,{label:n,current:i,onPick:a,tabs:[{id:kx,label:`Agent`},...r],className:`mb-0`}),p=i===kx,m=(n,r)=>(0,J.jsxs)(`div`,{className:`@container flex min-h-(--screen) flex-col`,children:[(0,J.jsx)(ii,{}),(0,J.jsxs)(`main`,{className:L(hi,qr,`@container flex-auto gap-4`),children:[(0,J.jsx)(To,{agent:e,...t?{title:t}:{},tabs:f,end:s}),(0,J.jsx)(`div`,{role:`tabpanel`,id:`panel-${r}`,"aria-labelledby":`tab-${r}`,className:L(`flex min-w-0 flex-col gap-4`,u&&L(`@container [--wide-w:min(var(--wide-max,100000px),calc(var(--page-w)_-_48px))] md:[--wide-w:min(var(--wide-max,100000px),calc(var(--page-w)_-_96px))] w-(--wide-w) max-w-none self-start ml-[calc((100%_-_var(--wide-w))/2)]`,`[--wide-max:1384px]`)),children:n})]})]}),h=c===void 0?(0,J.jsx)(Eo,{agent:e,...t?{title:t}:{},tabs:f,below:o,end:s}):m(c,kx);return l?(0,J.jsxs)(J.Fragment,{children:[(0,J.jsx)(`div`,{hidden:!p,children:h}),!p&&m(d,i)]}):p?h:m(d,i)}function jx(e){let t=+this._x.call(null,e),n=+this._y.call(null,e);return Mx(this.cover(t,n),t,n,e)}function Mx(e,t,n,r){if(isNaN(t)||isNaN(n))return e;var i,a=e._root,o={data:r},s=e._x0,c=e._y0,l=e._x1,u=e._y1,d,f,p,m,h,g,_,v;if(!a)return e._root=o,e;for(;a.length;)if((h=t>=(d=(s+l)/2))?s=d:l=d,(g=n>=(f=(c+u)/2))?c=f:u=f,i=a,!(a=a[_=g<<1|h]))return i[_]=o,e;if(p=+e._x.call(null,a.data),m=+e._y.call(null,a.data),t===p&&n===m)return o.next=a,i?i[_]=o:e._root=o,e;do i=i?i[_]=[,,,,]:e._root=[,,,,],(h=t>=(d=(s+l)/2))?s=d:l=d,(g=n>=(f=(c+u)/2))?c=f:u=f;while((_=g<<1|h)==(v=(m>=f)<<1|p>=d));return i[v]=a,i[_]=o,e}function Nx(e){Array.isArray(e)||(e=Array.from(e));let t=e.length,n=new Float64Array(t),r=new Float64Array(t),i=1/0,a=i,o=-i,s=o;for(let c=0,l,u,d;c<t;++c)isNaN(u=+this._x.call(null,l=e[c]))||isNaN(d=+this._y.call(null,l))?n[c]=NaN:(n[c]=u,r[c]=d,u<i&&(i=u),u>o&&(o=u),d<a&&(a=d),d>s&&(s=d));if(i>o||a>s)return this;this.cover(i,a).cover(o,s);for(let i=0;i<t;++i)Mx(this,n[i],r[i],e[i]);return this}function Px(e,t){if(isNaN(e=+e)||isNaN(t=+t))return this;var n=this._x0,r=this._y0,i=this._x1,a=this._y1;if(isNaN(n))i=(n=Math.floor(e))+1,a=(r=Math.floor(t))+1;else{for(var o=i-n||1,s=this._root,c,l;n>e||e>=i||r>t||t>=a;)switch(l=(t<r)<<1|e<n,c=[,,,,],c[l]=s,s=c,o*=2,l){case 0:i=n+o,a=r+o;break;case 1:n=i-o,a=r+o;break;case 2:i=n+o,r=a-o;break;case 3:n=i-o,r=a-o}this._root&&this._root.length&&(this._root=s)}return this._x0=n,this._y0=r,this._x1=i,this._y1=a,this}function Fx(){var e=[];return this.visit(function(t){if(!t.length)do e.push(t.data);while(t=t.next)}),e}function Ix(e){return arguments.length?this.cover(+e[0][0],+e[0][1]).cover(+e[1][0],+e[1][1]):isNaN(this._x0)?void 0:[[this._x0,this._y0],[this._x1,this._y1]]}function Lx(e,t,n,r,i){this.node=e,this.x0=t,this.y0=n,this.x1=r,this.y1=i}function Rx(e,t,n){var r,i=this._x0,a=this._y0,o,s,c,l,u=this._x1,d=this._y1,f=[],p=this._root,m,h;for(p&&f.push(new Lx(p,i,a,u,d)),n==null?n=1/0:(i=e-n,a=t-n,u=e+n,d=t+n,n*=n);m=f.pop();)if(!(!(p=m.node)||(o=m.x0)>u||(s=m.y0)>d||(c=m.x1)<i||(l=m.y1)<a)){if(p.length){var g=(o+c)/2,_=(s+l)/2;f.push(new Lx(p[3],g,_,c,l),new Lx(p[2],o,_,g,l),new Lx(p[1],g,s,c,_),new Lx(p[0],o,s,g,_)),(h=(t>=_)<<1|e>=g)&&(m=f[f.length-1],f[f.length-1]=f[f.length-1-h],f[f.length-1-h]=m)}else{var v=e-+this._x.call(null,p.data),y=t-+this._y.call(null,p.data),b=v*v+y*y;if(b<n){var x=Math.sqrt(n=b);i=e-x,a=t-x,u=e+x,d=t+x,r=p.data}}}return r}function zx(e){if(isNaN(u=+this._x.call(null,e))||isNaN(d=+this._y.call(null,e)))return this;var t,n=this._root,r,i,a,o=this._x0,s=this._y0,c=this._x1,l=this._y1,u,d,f,p,m,h,g,_;if(!n)return this;if(n.length)for(;;){if((m=u>=(f=(o+c)/2))?o=f:c=f,(h=d>=(p=(s+l)/2))?s=p:l=p,t=n,!(n=n[g=h<<1|m]))return this;if(!n.length)break;(t[g+1&3]||t[g+2&3]||t[g+3&3])&&(r=t,_=g)}for(;n.data!==e;)if(i=n,!(n=n.next))return this;return(a=n.next)&&delete n.next,i?(a?i.next=a:delete i.next,this):t?(a?t[g]=a:delete t[g],(n=t[0]||t[1]||t[2]||t[3])&&n===(t[3]||t[2]||t[1]||t[0])&&!n.length&&(r?r[_]=n:this._root=n),this):(this._root=a,this)}function Bx(e){for(var t=0,n=e.length;t<n;++t)this.remove(e[t]);return this}function Vx(){return this._root}function Hx(){var e=0;return this.visit(function(t){if(!t.length)do++e;while(t=t.next)}),e}function Ux(e){var t=[],n,r=this._root,i,a,o,s,c;for(r&&t.push(new Lx(r,this._x0,this._y0,this._x1,this._y1));n=t.pop();)if(!e(r=n.node,a=n.x0,o=n.y0,s=n.x1,c=n.y1)&&r.length){var l=(a+s)/2,u=(o+c)/2;(i=r[3])&&t.push(new Lx(i,l,u,s,c)),(i=r[2])&&t.push(new Lx(i,a,u,l,c)),(i=r[1])&&t.push(new Lx(i,l,o,s,u)),(i=r[0])&&t.push(new Lx(i,a,o,l,u))}return this}function Wx(e){var t=[],n=[],r;for(this._root&&t.push(new Lx(this._root,this._x0,this._y0,this._x1,this._y1));r=t.pop();){var i=r.node;if(i.length){var a,o=r.x0,s=r.y0,c=r.x1,l=r.y1,u=(o+c)/2,d=(s+l)/2;(a=i[0])&&t.push(new Lx(a,o,s,u,d)),(a=i[1])&&t.push(new Lx(a,u,s,c,d)),(a=i[2])&&t.push(new Lx(a,o,d,u,l)),(a=i[3])&&t.push(new Lx(a,u,d,c,l))}n.push(r)}for(;r=n.pop();)e(r.node,r.x0,r.y0,r.x1,r.y1);return this}function Gx(e){return e[0]}function Kx(e){return arguments.length?(this._x=e,this):this._x}function qx(e){return e[1]}function Jx(e){return arguments.length?(this._y=e,this):this._y}function Yx(e,t,n){var r=new Xx(t??Gx,n??qx,NaN,NaN,NaN,NaN);return e==null?r:r.addAll(e)}function Xx(e,t,n,r,i,a){this._x=e,this._y=t,this._x0=n,this._y0=r,this._x1=i,this._y1=a,this._root=void 0}function Zx(e){for(var t={data:e.data},n=t;e=e.next;)n=n.next={data:e.data};return t}var Qx=Yx.prototype=Xx.prototype;Qx.copy=function(){var e=new Xx(this._x,this._y,this._x0,this._y0,this._x1,this._y1),t=this._root,n,r;if(!t)return e;if(!t.length)return e._root=Zx(t),e;for(n=[{source:t,target:e._root=[,,,,]}];t=n.pop();)for(var i=0;i<4;++i)(r=t.source[i])&&(r.length?n.push({source:r,target:t.target[i]=[,,,,]}):t.target[i]=Zx(r));return e},Qx.add=jx,Qx.addAll=Nx,Qx.cover=Px,Qx.data=Fx,Qx.extent=Ix,Qx.find=Rx,Qx.remove=zx,Qx.removeAll=Bx,Qx.root=Vx,Qx.size=Hx,Qx.visit=Ux,Qx.visitAfter=Wx,Qx.x=Kx,Qx.y=Jx;function $x(e){return function(){return e}}function eS(e){return(e()-.5)*1e-6}function tS(e){return e.x+e.vx}function nS(e){return e.y+e.vy}function rS(e){var t,n,r,i=1,a=1;typeof e!=`function`&&(e=$x(e==null?1:+e));function o(){for(var e,o=t.length,c,l,u,d,f,p,m=0;m<a;++m)for(c=Yx(t,tS,nS).visitAfter(s),e=0;e<o;++e)l=t[e],f=n[l.index],p=f*f,u=l.x+l.vx,d=l.y+l.vy,c.visit(h);function h(e,t,n,a,o){var s=e.data,c=e.r,m=f+c;if(s){if(s.index>l.index){var h=u-s.x-s.vx,g=d-s.y-s.vy,_=h*h+g*g;_<m*m&&(h===0&&(h=eS(r),_+=h*h),g===0&&(g=eS(r),_+=g*g),_=(m-(_=Math.sqrt(_)))/_*i,l.vx+=(h*=_)*(m=(c*=c)/(p+c)),l.vy+=(g*=_)*m,s.vx-=h*(m=1-m),s.vy-=g*m)}}else return t>u+m||a<u-m||n>d+m||o<d-m}}function s(e){if(e.data)return e.r=n[e.data.index];for(var t=e.r=0;t<4;++t)e[t]&&e[t].r>e.r&&(e.r=e[t].r)}function c(){if(t){var r,i=t.length,a;for(n=Array(i),r=0;r<i;++r)a=t[r],n[a.index]=+e(a,r,t)}}return o.initialize=function(e,n){t=e,r=n,c()},o.iterations=function(e){return arguments.length?(a=+e,o):a},o.strength=function(e){return arguments.length?(i=+e,o):i},o.radius=function(t){return arguments.length?(e=typeof t==`function`?t:$x(+t),c(),o):e},o}function iS(e){return e.index}function aS(e,t){var n=e.get(t);if(!n)throw Error(`node not found: `+t);return n}function oS(e){var t=iS,n=d,r,i=$x(30),a,o,s,c,l,u=1;e??=[];function d(e){return 1/Math.min(s[e.source.index],s[e.target.index])}function f(t){for(var n=0,i=e.length;n<u;++n)for(var o=0,s,d,f,p,m,h,g;o<i;++o)s=e[o],d=s.source,f=s.target,p=f.x+f.vx-d.x-d.vx||eS(l),m=f.y+f.vy-d.y-d.vy||eS(l),h=Math.sqrt(p*p+m*m),h=(h-a[o])/h*t*r[o],p*=h,m*=h,f.vx-=p*(g=c[o]),f.vy-=m*g,d.vx+=p*(g=1-g),d.vy+=m*g}function p(){if(o){var n,i=o.length,l=e.length,u=new Map(o.map((e,n)=>[t(e,n,o),e])),d;for(n=0,s=Array(i);n<l;++n)d=e[n],d.index=n,typeof d.source!=`object`&&(d.source=aS(u,d.source)),typeof d.target!=`object`&&(d.target=aS(u,d.target)),s[d.source.index]=(s[d.source.index]||0)+1,s[d.target.index]=(s[d.target.index]||0)+1;for(n=0,c=Array(l);n<l;++n)d=e[n],c[n]=s[d.source.index]/(s[d.source.index]+s[d.target.index]);r=Array(l),m(),a=Array(l),h()}}function m(){if(o)for(var t=0,i=e.length;t<i;++t)r[t]=+n(e[t],t,e)}function h(){if(o)for(var t=0,n=e.length;t<n;++t)a[t]=+i(e[t],t,e)}return f.initialize=function(e,t){o=e,l=t,p()},f.links=function(t){return arguments.length?(e=t,p(),f):e},f.id=function(e){return arguments.length?(t=e,f):t},f.iterations=function(e){return arguments.length?(u=+e,f):u},f.strength=function(e){return arguments.length?(n=typeof e==`function`?e:$x(+e),m(),f):n},f.distance=function(e){return arguments.length?(i=typeof e==`function`?e:$x(+e),h(),f):i},f}var sS={value:()=>{}};function cS(){for(var e=0,t=arguments.length,n={},r;e<t;++e){if(!(r=arguments[e]+``)||r in n||/[\s.]/.test(r))throw Error(`illegal type: `+r);n[r]=[]}return new lS(n)}function lS(e){this._=e}function uS(e,t){return e.trim().split(/^|\s+/).map(function(e){var n=``,r=e.indexOf(`.`);if(r>=0&&(n=e.slice(r+1),e=e.slice(0,r)),e&&!t.hasOwnProperty(e))throw Error(`unknown type: `+e);return{type:e,name:n}})}lS.prototype=cS.prototype={constructor:lS,on:function(e,t){var n=this._,r=uS(e+``,n),i,a=-1,o=r.length;if(arguments.length<2){for(;++a<o;)if((i=(e=r[a]).type)&&(i=dS(n[i],e.name)))return i}else{if(t!=null&&typeof t!=`function`)throw Error(`invalid callback: `+t);for(;++a<o;)if(i=(e=r[a]).type)n[i]=fS(n[i],e.name,t);else if(t==null)for(i in n)n[i]=fS(n[i],e.name,null);return this}},copy:function(){var e={},t=this._;for(var n in t)e[n]=t[n].slice();return new lS(e)},call:function(e,t){if((i=arguments.length-2)>0)for(var n=Array(i),r=0,i,a;r<i;++r)n[r]=arguments[r+2];if(!this._.hasOwnProperty(e))throw Error(`unknown type: `+e);for(a=this._[e],r=0,i=a.length;r<i;++r)a[r].value.apply(t,n)},apply:function(e,t,n){if(!this._.hasOwnProperty(e))throw Error(`unknown type: `+e);for(var r=this._[e],i=0,a=r.length;i<a;++i)r[i].value.apply(t,n)}};function dS(e,t){for(var n=0,r=e.length,i;n<r;++n)if((i=e[n]).name===t)return i.value}function fS(e,t,n){for(var r=0,i=e.length;r<i;++r)if(e[r].name===t){e[r]=sS,e=e.slice(0,r).concat(e.slice(r+1));break}return n!=null&&e.push({name:t,value:n}),e}var pS=0,mS=0,hS=0,gS=1e3,_S,vS,yS=0,bS=0,xS=0,SS=typeof performance==`object`&&performance.now?performance:Date,CS=typeof window==`object`&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(e){setTimeout(e,17)};function wS(){return bS||=(CS(TS),SS.now()+xS)}function TS(){bS=0}function ES(){this._call=this._time=this._next=null}ES.prototype=DS.prototype={constructor:ES,restart:function(e,t,n){if(typeof e!=`function`)throw TypeError(`callback is not a function`);n=(n==null?wS():+n)+(t==null?0:+t),!this._next&&vS!==this&&(vS?vS._next=this:_S=this,vS=this),this._call=e,this._time=n,MS()},stop:function(){this._call&&(this._call=null,this._time=1/0,MS())}};function DS(e,t,n){var r=new ES;return r.restart(e,t,n),r}function OS(){wS(),++pS;for(var e=_S,t;e;)(t=bS-e._time)>=0&&e._call.call(void 0,t),e=e._next;--pS}function kS(){bS=(yS=SS.now())+xS,pS=mS=0;try{OS()}finally{pS=0,jS(),bS=0}}function AS(){var e=SS.now(),t=e-yS;t>gS&&(xS-=t,yS=e)}function jS(){for(var e,t=_S,n,r=1/0;t;)t._call?(r>t._time&&(r=t._time),e=t,t=t._next):(n=t._next,t._next=null,t=e?e._next=n:_S=n);vS=e,MS(r)}function MS(e){pS||(mS&&=clearTimeout(mS),e-bS>24?(e<1/0&&(mS=setTimeout(kS,Math.ceil(e-SS.now()-xS)+1)),hS&&=clearInterval(hS)):(hS||=(yS=SS.now(),setInterval(AS,gS)),pS=1,CS(kS)))}function NS(e,t,n){var r=new ES;return t=t==null?0:+t,r.restart(n=>{r.stop(),e(n+t)},t,n),r}var PS=1664525,FS=1013904223,IS=4294967296;function LS(){let e=1;return()=>(e=(PS*e+FS)%IS)/IS}function RS(e){return e.x}function zS(e){return e.y}var BS=10,VS=Math.PI*(3-Math.sqrt(5));function HS(e){var t,n=1,r=.001,i=1-r**(1/300),a=0,o=.6,s=new Map,c=DS(d),l=cS(`tick`,`end`),u=LS();e??=[];function d(){f(),l.call(`tick`,t),n<r&&(c.stop(),l.call(`end`,t))}function f(r){var c,l=e.length,u;r===void 0&&(r=1);for(var d=0;d<r;++d)for(n+=(a-n)*i,s.forEach(function(e){e(n)}),c=0;c<l;++c)u=e[c],u.fx==null?u.x+=u.vx*=o:(u.x=u.fx,u.vx=0),u.fy==null?u.y+=u.vy*=o:(u.y=u.fy,u.vy=0);return t}function p(){for(var t=0,n=e.length,r;t<n;++t){if(r=e[t],r.index=t,r.fx!=null&&(r.x=r.fx),r.fy!=null&&(r.y=r.fy),isNaN(r.x)||isNaN(r.y)){var i=BS*Math.sqrt(.5+t),a=t*VS;r.x=i*Math.cos(a),r.y=i*Math.sin(a)}(isNaN(r.vx)||isNaN(r.vy))&&(r.vx=r.vy=0)}}function m(t){return t.initialize&&t.initialize(e,u),t}return p(),t={tick:f,restart:function(){return c.restart(d),t},stop:function(){return c.stop(),t},nodes:function(n){return arguments.length?(e=n,p(),s.forEach(m),t):e},alpha:function(e){return arguments.length?(n=+e,t):n},alphaMin:function(e){return arguments.length?(r=+e,t):r},alphaDecay:function(e){return arguments.length?(i=+e,t):+i},alphaTarget:function(e){return arguments.length?(a=+e,t):a},velocityDecay:function(e){return arguments.length?(o=1-e,t):1-o},randomSource:function(e){return arguments.length?(u=e,s.forEach(m),t):u},force:function(e,n){return arguments.length>1?(n==null?s.delete(e):s.set(e,m(n)),t):s.get(e)},find:function(t,n,r){var i=0,a=e.length,o,s,c,l,u;for(r==null?r=1/0:r*=r,i=0;i<a;++i)l=e[i],o=t-l.x,s=n-l.y,c=o*o+s*s,c<r&&(u=l,r=c);return u},on:function(e,n){return arguments.length>1?(l.on(e,n),t):l.on(e)}}}function US(){var e,t,n,r,i=$x(-30),a,o=1,s=1/0,c=.81;function l(n){var i,a=e.length,o=Yx(e,RS,zS).visitAfter(d);for(r=n,i=0;i<a;++i)t=e[i],o.visit(f)}function u(){if(e){var t,n=e.length,r;for(a=Array(n),t=0;t<n;++t)r=e[t],a[r.index]=+i(r,t,e)}}function d(e){var t=0,n,r,i=0,o,s,c;if(e.length){for(o=s=c=0;c<4;++c)(n=e[c])&&(r=Math.abs(n.value))&&(t+=n.value,i+=r,o+=r*n.x,s+=r*n.y);e.x=o/i,e.y=s/i}else{n=e,n.x=n.data.x,n.y=n.data.y;do t+=a[n.data.index];while(n=n.next)}e.value=t}function f(e,i,l,u){if(!e.value)return!0;var d=e.x-t.x,f=e.y-t.y,p=u-i,m=d*d+f*f;if(p*p/c<m)return m<s&&(d===0&&(d=eS(n),m+=d*d),f===0&&(f=eS(n),m+=f*f),m<o&&(m=Math.sqrt(o*m)),t.vx+=d*e.value*r/m,t.vy+=f*e.value*r/m),!0;if(!(e.length||m>=s)){(e.data!==t||e.next)&&(d===0&&(d=eS(n),m+=d*d),f===0&&(f=eS(n),m+=f*f),m<o&&(m=Math.sqrt(o*m)));do e.data!==t&&(p=a[e.data.index]*r/m,t.vx+=d*p,t.vy+=f*p);while(e=e.next)}}return l.initialize=function(t,r){e=t,n=r,u()},l.strength=function(e){return arguments.length?(i=typeof e==`function`?e:$x(+e),u(),l):i},l.distanceMin=function(e){return arguments.length?(o=e*e,l):Math.sqrt(o)},l.distanceMax=function(e){return arguments.length?(s=e*e,l):Math.sqrt(s)},l.theta=function(e){return arguments.length?(c=e*e,l):Math.sqrt(c)},l}function WS(e){var t=$x(.1),n,r,i;typeof e!=`function`&&(e=$x(e==null?0:+e));function a(e){for(var t=0,a=n.length,o;t<a;++t)o=n[t],o.vx+=(i[t]-o.x)*r[t]*e}function o(){if(n){var a,o=n.length;for(r=Array(o),i=Array(o),a=0;a<o;++a)r[a]=isNaN(i[a]=+e(n[a],a,n))?0:+t(n[a],a,n)}}return a.initialize=function(e){n=e,o()},a.strength=function(e){return arguments.length?(t=typeof e==`function`?e:$x(+e),o(),a):t},a.x=function(t){return arguments.length?(e=typeof t==`function`?t:$x(+t),o(),a):e},a}function GS(e){var t=$x(.1),n,r,i;typeof e!=`function`&&(e=$x(e==null?0:+e));function a(e){for(var t=0,a=n.length,o;t<a;++t)o=n[t],o.vy+=(i[t]-o.y)*r[t]*e}function o(){if(n){var a,o=n.length;for(r=Array(o),i=Array(o),a=0;a<o;++a)r[a]=isNaN(i[a]=+e(n[a],a,n))?0:+t(n[a],a,n)}}return a.initialize=function(e){n=e,o()},a.strength=function(e){return arguments.length?(t=typeof e==`function`?e:$x(+e),o(),a):t},a.y=function(t){return arguments.length?(e=typeof t==`function`?t:$x(+t),o(),a):e},a}function KS(e,t){let n=[];for(let r of e)for(let e=0;e<12;e++)n.push({x:r.x+Math.cos(e/12*2*Math.PI)*t,y:r.y+Math.sin(e/12*2*Math.PI)*t});if(n.length<3)return n;let r=[...n].sort((e,t)=>e.x-t.x||e.y-t.y),i=(e,t,n)=>(t.x-e.x)*(n.y-e.y)-(t.y-e.y)*(n.x-e.x),a=[];for(let e of r){for(;a.length>=2&&i(a[a.length-2],a[a.length-1],e)<=0;)a.pop();a.push(e)}let o=[];for(let e of[...r].reverse()){for(;o.length>=2&&i(o[o.length-2],o[o.length-1],e)<=0;)o.pop();o.push(e)}return[...a.slice(0,-1),...o.slice(0,-1)]}function qS(e,t,n=3){let r=new Map;for(let t of e)t.from!==t.to&&r.set(t.to,[...r.get(t.to)||[],t.from]);let i=new Map,a=[t];for(let e=1;e<=n&&a.length;e++){let n=[];for(let o of a)for(let a of r.get(o)||[])a===t||i.has(a)||(i.set(a,e),n.push(a));a=n}return i}var JS=e=>{let t=new Map;for(let n of e)n.from!==n.to&&(t.set(n.from,(t.get(n.from)||0)+1),t.set(n.to,(t.get(n.to)||0)+1));return t};function YS(e,t=[]){let n=[...new Set(e.map(e=>e.type))];return[...t.filter(e=>n.includes(e)),...n.filter(e=>!t.includes(e)).sort((e,t)=>e.localeCompare(t))]}function XS(e,t,n=[],r={},i=1.6){let a=r.left||[],o=r.right||[],s=YS(e,n),c=s.filter(e=>!a.includes(e)&&!o.includes(e)),l={left:s.filter(e=>a.includes(e)),right:s.filter(e=>o.includes(e))},u=t=>e.filter(e=>e.type===t).sort((e,t)=>e.id.localeCompare(t.id)),d=e=>u(e).every(e=>e.r<=3.5),f=e=>d(e)?26:130,p=e=>d(e)?26:92,m=(e,t)=>Math.max(1,Math.ceil(u(e).length/Math.max(2,Math.floor(t/f(e))))),h=e=>c.reduce((t,n)=>t+m(n,e)*p(n)+34+(d(n)?10:0),0),g=Math.max(0,...[...l.left,...l.right].map(e=>u(e).length*70+34)),_=Math.max(520,Math.max(...c.map(e=>Math.min(u(e).length,6)*f(e)),0));for(let e=0;e<3;e++)_=Math.max(520,Math.max(h(_),g)*i-(l.left.length?190:0)-(l.right.length?190:0));let v=Math.max(h(_),g,126),y=new Map;for(let e of t)e.from!==e.to&&(y.set(e.from,[...y.get(e.from)||[],e.to]),y.set(e.to,[...y.get(e.to)||[],e.from]));let b=new Map,x=[],S=[],C=-v/2;for(let e of c){let t=u(e),n=m(e,_),r=p(e),i=n*r+34+(d(e)?10:0);S.push({t:e,list:t,y0:C,lines:n,lineH:r}),x.push({type:e,x0:-_/2,x1:_/2,y0:C,y1:C+i-8}),C+=i}let w=e=>{let t=Math.ceil(e.list.length/e.lines);e.list.forEach((n,r)=>{let i=Math.floor(r/t),a=Math.min(t,e.list.length-i*t),o=r-i*t;b.set(n.id,{x:-_/2+(o+.5)*_/a,y:e.y0+34+(e.lineH<92?4:16)+i*e.lineH})})};S.forEach(w);let T={left:-_/2-24-95,right:_/2+24+95};for(let e of[`left`,`right`])l[e].forEach((t,n,r)=>{let i=u(t),a=v/r.length,o=-v/2+n*a;x.push({type:t,x0:T[e]-95,x1:T[e]+95,y0:o,y1:o+a-8,side:e}),i.forEach((t,n)=>b.set(t.id,{x:T[e],y:o+34+(n+.5)*(a-34-8)/i.length}))});for(let e=0;e<6;e++)for(let e of S){let t=new Set(e.list.map(e=>e.id)),n=e=>{let n=(y.get(e.id)||[]).filter(e=>!t.has(e)&&b.has(e));return n.length?n.reduce((e,t)=>e+b.get(t).x,0)/n.length:b.get(e.id).x},r=e.list.map(e=>({n:e,k:n(e)}));r.sort((e,t)=>e.k-t.k||e.n.id.localeCompare(t.n.id)),e.list=r.map(e=>e.n),w(e)}return{at:b,tiers:x,extent:{x0:l.left.length?T.left-95:-_/2,x1:l.right.length?T.right+95:_/2,y0:-v/2,y1:v/2}}}function ZS(e,t,n=[],r=1.6){let i=YS(e,n),a=JS(t),o=Math.max(3,...e.map(e=>e.r)),s=(2*o+7)*.58,c=i.map(t=>{let n=e.filter(e=>e.type===t).sort((e,t)=>(a.get(t.id)||0)-(a.get(e.id)||0)||e.id.localeCompare(t.id));return{type:t,spots:n.map((e,t)=>{let r=s*Math.sqrt(t+(n.length>1?.5:0)),i=t*2.39996323;return{id:e.id,x:Math.cos(i)*r,y:Math.sin(i)*r}}),r:(n.length>1?s*Math.sqrt(n.length-.5):0)+o+14}}),l=Math.max(1,Math.min(c.length,Math.round(Math.sqrt(c.length*r)))),u=[];for(let e=0;e<c.length;e+=l)u.push(c.slice(e,e+l));let d=u.map(e=>2*Math.max(...e.map(e=>e.r))+46),f=d.reduce((e,t)=>e+t,0),p=new Map,m=[],h=-f/2,g=0;u.forEach((e,t)=>{let n=e.reduce((e,t)=>e+2*t.r+46,0);g=Math.max(g,n);let r=-n/2,i=h+d[t]/2;for(let t of e){let e=r+t.r+23;m.push({type:t.type,x:e,y:i,r:t.r});for(let n of t.spots)p.set(n.id,{x:e+n.x,y:i+n.y});r+=2*t.r+46}h+=d[t]});let _=new Set(c.flatMap(e=>e.spots[0]?[e.spots[0].id]:[]));return{at:p,areas:m,extent:{x0:-g/2,x1:g/2,y0:-f/2-10,y1:f/2},hubs:_}}var QS={ArrowLeft:`left`,ArrowRight:`right`,ArrowUp:`up`,ArrowDown:`down`};function $S(e,t,n){let r=e.find(e=>e.id===t);if(!r)return e[0]?.id??t;let i=null;for(let a of e){if(a.id===t)continue;let e=a.x-r.x,o=a.y-r.y,s=n===`right`?e:n===`left`?-e:n===`down`?o:-o,c=Math.abs(n===`left`||n===`right`?o:e);if(s<=.5)continue;let l=s+2*c;(!i||l<i.score)&&(i={id:a.id,score:l})}return i?.id??t}function eC(e){if(!e.length)return null;let t=e.reduce((e,t)=>e+t.x,0)/e.length,n=e.reduce((e,t)=>e+t.y,0)/e.length;return e.reduce((e,r)=>Math.hypot(r.x-t,r.y-n)<Math.hypot(e.x-t,e.y-n)?r:e,e[0]).id}var tC=(e,t)=>e.filter(e=>e.from===t||e.to===t);function nC(e,t){let n=tC(e,t.node);if(!n.length)return{node:t.node};let r=n[(t.edge?n.findIndex(e=>e.id===t.edge):-1)+1];return r?{node:t.node,edge:r.id}:{node:t.node}}function rC(e,t){let n=e.find(e=>e.id===t.edge);return n?{node:n.from===t.node?n.to:n.from}:t}function iC(e,t,n,r=48){let i=e.x+t.x*e.k,a=e.y+t.y*e.k;return i>=r&&i<=n.w-r&&a>=r&&a<=n.h-r?e:{...e,x:n.w/2-t.x*e.k,y:n.h/2-t.y*e.k}}function aC(e,t,n){let r=Math.min(4,Math.max(.1,e.k*t)),i=n.w/2,a=n.h/2;return{k:r,x:i-(i-e.x)/e.k*r,y:a-(a-e.y)/e.k*r}}var oC=[`#ef6c35`,`#1f4e8c`,`#2b9b74`,`#e2447a`,`#7b8190`,`#f2a33a`,`#3f7fd8`,`#8e5bd6`,`#14a1b5`,`#b8456b`,`#5c8d3e`,`#c27c2c`],sC=`#e2447a`,cC=`var(--color-muted)`,lC=150,uC=14,dC=40;function fC({title:e,nodes:t,edges:n,colourOfType:r,types:i,typesTitle:a,picked:o,onPick:s,detail:c,onRefresh:l,refreshing:u,ringOf:d,groupByType:p,edgesPickable:m=!0,height:h,hint:g,bare:_,colourOf:v,legend:y,lit:b,onHover:x,namedOf:S,outlines:C,outlineColourOf:w,onGroupPick:T,spacing:E=1,layout:D=`force`,order:O,sides:ee,quietLines:te}){let ne=(0,q.useRef)(null),[,k]=(0,q.useState)(0),[j,M]=(0,q.useState)({x:0,y:0,k:1}),[re,N]=(0,q.useState)(!1),ie=(0,q.useRef)(!1),ae=(0,q.useRef)(!1),oe=(0,q.useRef)(()=>{}),P=(0,q.useRef)(null),se=(0,q.useRef)({}),[ce,le]=(0,q.useState)(null),[F,ue]=(0,q.useState)(null),[de,fe]=(0,q.useState)(!1),[pe,me]=(0,q.useState)(``),he=(0,q.useId)(),{nodes:ge,edges:_e}=(0,q.useMemo)(()=>{let e=t.map((e,t)=>({id:e.id,n:e,x:Math.cos(t*2.4)*(40+t*1.5),y:Math.sin(t*2.4)*(40+t*1.5)})),r=new Set(e.map(e=>e.id)),i=new Set;return{nodes:e,edges:n.filter(e=>r.has(e.from)&&r.has(e.to)&&!i.has(e.id)&&!!i.add(e.id)).map(e=>({id:e.id,source:e.from,target:e.to,from:e.from,to:e.to,label:e.label}))}},[t,n]);(0,q.useEffect)(()=>{if(D!==`force`){let e=ge.map(e=>({id:e.id,type:e.n.type,r:e.n.r??6})),t=_e.map(e=>({from:e.from,to:e.to})),n=ne.current,r=n&&n.clientHeight>260?n.clientWidth/(n.clientHeight-150):1.6,i=D===`tiers`?XS(e,t,O,ee,Math.min(3.2,Math.max(.8,r))):ZS(e,t,O);for(let e of ge){let t=i.at.get(e.id);t&&(e.x=t.x,e.y=t.y,e.vx=0,e.vy=0)}se.current={extent:i.extent,...`tiers`in i?{tiers:i.tiers}:{areas:i.areas,hubs:i.hubs}};let a=HS(ge).alpha(0).stop(),o=0;return a.on(`tick`,()=>{cancelAnimationFrame(o),o=requestAnimationFrame(()=>k(e=>e+1))}),P.current=a,ie.current=!1,k(e=>e+1),()=>{a.stop(),cancelAnimationFrame(o)}}se.current={};let e=[...new Set(ge.map(e=>e.n.type))],t=!!(p&&e.length>1),n=new Map,r=new Map,i=new Map;for(let e of ge)n.set(e.n.type,(n.get(e.n.type)||0)+1),r.set(e.n.type,(r.get(e.n.type)||0)+(e.n.r??6)),i.set(e.n.type,Math.max(i.get(e.n.type)||0,e.n.r??6));let a=e=>Math.sqrt(n.get(e)||1)*(2*((r.get(e)||6)/(n.get(e)||1))+14)+2*(i.get(e)||6)+(C?60:30),o=e.reduce((e,t)=>e+a(t),0),s=Math.max(140,o/(2*Math.PI)),c=0,l=new Map(e.map(e=>{let n=c+a(e)/2;c+=a(e);let r=n/o*2*Math.PI;return[e,t?{x:Math.cos(r)*s,y:Math.sin(r)*s}:{x:0,y:0}]})),u=t?C?.3:.12:.07,d=HS(ge).force(`link`,oS(_e).id(e=>e.id).distance(80*E).strength(e=>t&&e.source.n.type!==e.target.n.type?C?.01:.05:t?.12:.3)).force(`charge`,US().strength((ge.length>300?-60:-150)*E).distanceMax(360*E)).force(`collide`,rS(e=>(e.n.r??6)+10)).force(`x`,WS(e=>l.get(e.n.type).x).strength(u)).force(`y`,GS(e=>l.get(e.n.type).y).strength(u)).alphaDecay(.028);d.stop(),d.tick(260),ie.current=!1;let f=0;return d.on(`tick`,()=>{cancelAnimationFrame(f),f=requestAnimationFrame(()=>k(e=>e+1))}),d.on(`end`,()=>{ae.current||oe.current()}),d.alpha(.2).restart(),P.current=d,k(e=>e+1),()=>{d.stop(),cancelAnimationFrame(f)}},[ge,_e,p,C,E,D,O?.join(`\0`),JSON.stringify(ee??{}),D!==`force`&&re]);let ve=()=>{let e=ne.current;if(!e||!ge.length)return;let t=ge.map(e=>e.x??0),n=ge.map(e=>e.y??0),r=se.current.extent,[i,a,o,s]=r?[r.x0-30,r.x1+30,r.y0-30,r.y1+120]:[Math.min(...t)-40,Math.max(...t)+120,Math.min(...n)-60,Math.max(...n)+40],c=Math.max(r?.3:.75,Math.min(1.6,e.clientWidth/Math.max(1,a-i),e.clientHeight/Math.max(1,s-o)));M({k:c,x:e.clientWidth/2-(i+a)/2*c,y:e.clientHeight/2-(o+s)/2*c})};oe.current=ve,(0,q.useEffect)(()=>{!ie.current&&ge.length&&ne.current?.clientWidth&&(ie.current=!0,ve())}),(0,q.useEffect)(()=>{ie.current=!1},[re]),(0,q.useEffect)(()=>{let e=ne.current;if(!e)return;let t=t=>{ae.current=!0,t.preventDefault();let n=e.getBoundingClientRect(),r=t.clientX-n.left,i=t.clientY-n.top;M(e=>{let n=Math.min(4,Math.max(.1,e.k*Math.exp(-t.deltaY*(t.ctrlKey?.01:.0015))));return{k:n,x:r-(r-e.x)/e.k*n,y:i-(i-e.y)/e.k*n}})};return e.addEventListener(`wheel`,t,{passive:!1}),()=>e.removeEventListener(`wheel`,t)},[]);let ye=(0,q.useRef)(null),I=(e,t)=>{ae.current=!0,e.stopPropagation(),fe(!1),e.target.setPointerCapture?.(e.pointerId),ye.current={kind:t?`node`:`pan`,id:t,sx:e.clientX,sy:e.clientY,vx:j.x,vy:j.y,moved:!1}},be=e=>{let t=ye.current;if(!t)return;let n=e.clientX-t.sx,r=e.clientY-t.sy;if(Math.abs(n)+Math.abs(r)>3&&(t.moved=!0),t.kind===`pan`)M(e=>({...e,x:t.vx+n,y:t.vy+r}));else if(t.moved){let n=ge.find(e=>e.id===t.id),r=ne.current.getBoundingClientRect();n&&(n.fx=(e.clientX-r.left-j.x)/j.k,n.fy=(e.clientY-r.top-j.y)/j.k,P.current?.alphaTarget(.15).restart())}},xe=()=>{let e=ye.current;if(ye.current=null,e){if(e.kind===`node`){let t=ge.find(t=>t.id===e.id);t&&(t.fx=null,t.fy=null),P.current?.alphaTarget(0),e.moved||(s(o?.kind===`node`&&o.id===e.id?null:{kind:`node`,id:e.id}),le({node:e.id}))}else e.moved||s(null)}},Se=new Map(ge.map(e=>[e.id,e])),Ce=new Set,we=new Set,Te=b===void 0?o?.kind===`node`?o.id:!o&&F?F:null:null;if(b){for(let e of b)Ce.add(e);for(let e of _e)b.has(e.from)&&b.has(e.to)&&we.add(e.id)}else if(b!==null){if(Te){Ce.add(Te);for(let e of _e)(e.from===Te||e.to===Te)&&(we.add(e.id),Ce.add(e.from),Ce.add(e.to))}else if(o?.kind===`edge`){let e=_e.find(e=>e.id===o.id);e&&(we.add(e.id),Ce.add(e.from),Ce.add(e.to))}}let Ee=b===void 0?!!(Te||o):!!b,De=ge.length<=(D===`areas`?40:lC),Oe=_e.length<=dC,ke=e=>`M ${e.x-e.r} ${e.y} a ${e.r} ${e.r} 0 1 0 ${2*e.r} 0 a ${e.r} ${e.r} 0 1 0 ${-2*e.r} 0 Z`,Ae=C&&se.current.areas?se.current.areas.map(e=>({t:e.type,d:ke(e),top:{x:e.x,y:e.y-e.r-6/j.k},colour:w?.(e.type)??r(e.type)})):C?[...new Set(ge.map(e=>e.n.type))].map(e=>{let t=ge.filter(t=>t.n.type===e),n=Math.max(...t.map(e=>e.n.r??6))+12,i=KS(t.map(e=>({x:e.x??0,y:e.y??0})),n),a=i.reduce((e,t)=>t.y<e.y?t:e,i[0]??{x:0,y:0});return{t:e,d:i.length>2?`M ${i.map(e=>`${e.x.toFixed(1)} ${e.y.toFixed(1)}`).join(` L `)} Z`:``,top:{x:a.x,y:a.y-6/j.k},colour:w?.(e)??r(e)}}):[],je=new Map,Me=e=>{let t=Se.get(e.from),n=Se.get(e.to);if(!t||!n)return null;let r=[e.from,e.to].sort().join(`|`),i=je.get(r)??0;je.set(r,i+1);let[a,o,s,c]=[t.x??0,t.y??0,n.x??0,n.y??0];if(D===`tiers`){let e=i*12,t=Math.abs(s-a)>Math.abs(c-o)*1.4,[n,r,l,u]=Math.abs(c-o)<1?[a,o-46-e,s,c-46-e]:t?[(a+s)/2,o+e,(a+s)/2,c+e]:[a+e,(o+c)/2,s+e,(o+c)/2];return{d:`M${a},${o} C${n},${r} ${l},${u} ${s},${c}`,mx:.125*a+.375*n+.375*l+.125*s,my:.125*o+.375*r+.375*u+.125*c}}let l=s-a,u=c-o,d=Math.hypot(l,u)||1,f=((D===`areas`?.1:.18)+i*.14)*d,p=(a+s)/2-u/d*f,m=(o+c)/2+l/d*f;return{d:`M${a},${o} Q${p},${m} ${s},${c}`,mx:.25*a+.5*p+.25*s,my:.25*o+.5*m+.25*c}},Ne=e=>Se.get(e)?.n.name??e,Pe=e=>{if(!e)return me(``);let t=Se.get(e.node);if(!t)return me(``);let n=tC(_e,e.node),r=e.edge?n.find(t=>t.id===e.edge):void 0;if(r){let t=r.from===e.node?r.to:r.from;return me(`${r.label}: ${Ne(r.from)} to ${Ne(r.to)}, ${n.indexOf(r)+1} of ${n.length}. F goes to ${Ne(t)}.`)}me(`${t.n.name}, ${t.n.type}. ${n.length} relationship${n.length===1?``:`s`}.`)},Fe=()=>({w:ne.current?.clientWidth??0,h:ne.current?.clientHeight??0}),Ie=e=>{le(e),x?.(e?.node??null),Pe(e);let t=e&&Se.get(e.node);t&&M(e=>iC(e,{x:t.x??0,y:t.y??0},Fe()))},Le=()=>ge.map(e=>({id:e.id,x:e.x??0,y:e.y??0})),Re=e=>{if(e.target!==e.currentTarget||e.altKey||e.ctrlKey||e.metaKey)return;fe(!0);let t=ce&&Se.has(ce.node)?ce:null,n=QS[e.key],r=!0;if((n&&e.shiftKey||[`+`,`=`,`-`,`_`].includes(e.key))&&(ae.current=!0),n&&e.shiftKey)M(e=>({...e,x:e.x+(n===`left`?60:n===`right`?-60:0),y:e.y+(n===`up`?60:n===`down`?-60:0)}));else if(n){let e=t?.node??eC(Le());e&&Ie(t?{node:$S(Le(),e,n)}:{node:e})}else if(e.key===`Home`){let e=eC(Le());e&&Ie({node:e})}else if(e.key===`r`||e.key===`R`)t?Ie(nC(_e,t)):r=!1;else if(e.key===`f`||e.key===`F`)t?.edge?Ie(rC(_e,t)):r=!1;else if(e.key===`Enter`||e.key===` `){if(t){let e=t.edge?{kind:`edge`,id:t.edge}:{kind:`node`,id:t.node},n=o?.kind!==e.kind||o.id!==e.id;s(n?e:null),me(n?`Details of ${t.edge?`the relationship`:Ne(t.node)} are open beside the graph. Escape closes them.`:`Details closed.`)}else{let e=eC(Le());e&&Ie({node:e})}}else e.key===`Escape`?o?(s(null),me(`Details closed.`)):re?N(!1):r=!1:e.key===`+`||e.key===`=`?M(e=>aC(e,1.25,Fe())):e.key===`-`||e.key===`_`?M(e=>aC(e,.8,Fe())):e.key===`0`?ve():r=!1;r&&e.preventDefault()},ze=de&&ce&&Se.has(ce.node)?ce:null;return(0,J.jsxs)(`div`,{className:L(`flex flex-col overflow-hidden border border-line bg-bg`,re?`fixed inset-0 z-50`:_?`relative size-full border-0`:`relative rounded-[12px]`),style:re||_?void 0:{height:h??`max(600px, calc(var(--screen) - 280px))`},children:[(0,J.jsxs)(`div`,{className:`flex items-center gap-2 border-b border-line-soft px-4 py-2`,children:[(0,J.jsxs)(`div`,{className:`flex min-w-0 flex-1 flex-col`,children:[(0,J.jsx)(`h3`,{className:`m-0 text-[13px] font-semibold text-ink`,children:e}),g&&(0,J.jsx)(`p`,{className:`m-0 text-[13px] text-muted`,children:g})]}),l&&(0,J.jsxs)(V,{size:`sm`,disabled:u,onClick:l,"data-tip":`Read the population again`,children:[(0,J.jsx)(f,{"aria-hidden":`true`}),`Refresh`]}),(0,J.jsx)(V,{size:`icon-sm`,variant:`outline`,"aria-pressed":re,"aria-label":re?`Leave full screen`:`Full screen`,"data-tip":re?`Leave full screen`:`Full screen`,onClick:()=>N(e=>!e),children:(0,J.jsx)(Je,{"aria-hidden":`true`})})]}),(0,J.jsxs)(`div`,{ref:ne,tabIndex:0,role:`application`,"aria-roledescription":`graph`,"aria-label":`${e}: ${ge.length} nodes and ${_e.length} relationships`,"aria-describedby":he,className:`relative flex-1 touch-none overflow-hidden select-none focus-visible:outline-2 focus-visible:-outline-offset-2 focus-visible:outline-accent`,onKeyDown:Re,onBlur:e=>{e.target===e.currentTarget&&(fe(!1),x?.(null))},style:{backgroundImage:`radial-gradient(var(--color-line) 1px, transparent 1px)`,backgroundSize:`18px 18px`},onPointerDown:e=>I(e),onPointerMove:be,onPointerUp:xe,onPointerCancel:xe,children:[(0,J.jsx)(`svg`,{"aria-hidden":`true`,className:`absolute inset-0 size-full`,children:(0,J.jsxs)(`g`,{transform:`translate(${j.x},${j.y}) scale(${j.k})`,children:[(se.current.tiers||[]).map(e=>{let t=r(e.type);return(0,J.jsxs)(`g`,{className:`pointer-events-none`,opacity:Ee?.55:1,children:[(0,J.jsx)(`rect`,{x:e.x0,y:e.y0,width:e.x1-e.x0,height:e.y1-e.y0,rx:14,fill:t,fillOpacity:.05,stroke:t,strokeOpacity:.3,strokeWidth:1.2/j.k}),(0,J.jsx)(`text`,{x:e.x0+14,y:e.y0+20,fill:t,fontWeight:600,fontSize:11,style:{letterSpacing:`0.06em`,textTransform:`uppercase`},children:e.type})]},`tier:${e.type}`)}),Ae.map(e=>(0,J.jsxs)(`g`,{className:`pointer-events-none`,opacity:Ee?.4:1,children:[e.d&&(0,J.jsx)(`path`,{d:e.d,fill:e.colour,fillOpacity:.05,stroke:e.colour,strokeOpacity:.45,strokeWidth:1.2/j.k,strokeLinejoin:`round`}),(0,J.jsx)(`text`,{x:e.top.x,y:e.top.y,textAnchor:`middle`,fill:e.colour,fontWeight:600,fontSize:Math.max(10,12/j.k),className:T?`pointer-events-auto cursor-pointer hover:underline`:void 0,onPointerDown:T?e=>e.stopPropagation():void 0,onClick:T?()=>T(e.t):void 0,"data-tip":T?`Open ${e.t}`:void 0,style:{paintOrder:`stroke`,stroke:`var(--color-bg)`,strokeWidth:4/j.k},children:e.t})]},`hull:${e.t}`)),_e.map(e=>{let t=Me(e);if(!t)return null;let n=we.has(e.id);return(0,J.jsxs)(`g`,{opacity:Ee&&!n?.35:1,children:[(0,J.jsx)(`path`,{d:t.d,fill:`none`,stroke:n?sC:cC,strokeOpacity:n?1:te?.2:D===`areas`?_e.length>60?.12:.22:D===`tiers`&&_e.length>60?.14:.45,strokeWidth:n?2.2:1}),ze?.edge===e.id&&(0,J.jsx)(`path`,{d:t.d,fill:`none`,stroke:`var(--color-ink)`,strokeWidth:2.5,strokeDasharray:`4 3`}),m&&(0,J.jsx)(`path`,{d:t.d,fill:`none`,stroke:`transparent`,strokeWidth:10,className:`cursor-pointer`,onPointerDown:e=>e.stopPropagation(),onClick:t=>(t.stopPropagation(),s(o?.kind===`edge`&&o.id===e.id?null:{kind:`edge`,id:e.id}))}),(Oe&&D!==`areas`&&!te||n)&&e.label&&(0,J.jsx)(`text`,{x:t.mx,y:t.my,textAnchor:`middle`,fontSize:D===`tiers`?9.5:8,fill:n?sC:`var(--color-muted)`,className:`pointer-events-none`,style:{paintOrder:`stroke`,stroke:`var(--color-bg)`,strokeWidth:3},children:e.label})]},e.id)}),ge.map(e=>{let t=Ce.has(e.id),n=Ee&&!t,i=e.n.r??6,a=d?.(e.id),s=D===`areas`?t||j.k>=3||!!se.current.hubs?.has(e.id)||ze?.node===e.id||!!S?.(e.id):D===`tiers`?i>3.5&&De||t||j.k>=2||ze?.node===e.id||!!S?.(e.id):De||t||j.k>=1.3||i>=12||ze?.node===e.id||!!S?.(e.id);return(0,J.jsxs)(`g`,{transform:`translate(${e.x??0},${e.y??0})`,opacity:n?a?.75:.3:1,className:`cursor-pointer`,onPointerDown:t=>I(t,e.id),onPointerEnter:()=>(ue(e.id),x?.(e.id)),onPointerLeave:()=>(ue(t=>t===e.id?null:t),x?.(null)),children:[a&&(0,J.jsx)(`circle`,{r:i+3.5,fill:`none`,stroke:a,strokeWidth:2.5}),o?.kind===`node`&&o.id===e.id&&(0,J.jsx)(`circle`,{r:i+5,fill:`none`,stroke:sC,strokeWidth:2}),ze?.node===e.id&&(0,J.jsx)(`circle`,{r:i+9,fill:`none`,stroke:`var(--color-ink)`,strokeWidth:2,strokeDasharray:ze.edge?`2 3`:void 0}),(0,J.jsx)(`circle`,{r:i,fill:v?v(e.id):r(e.n.type),stroke:`var(--color-bg)`,strokeWidth:2}),s&&(0,J.jsx)(`text`,{x:D===`tiers`?0:i+4,y:D===`tiers`?i+15:3,textAnchor:D===`tiers`?`middle`:void 0,fontSize:D===`tiers`?12:9,fill:`var(--color-ink-2)`,style:{paintOrder:`stroke`,stroke:`var(--color-bg)`,strokeWidth:3},children:e.n.name})]},e.id)})]})}),c&&(0,J.jsxs)(`section`,{"aria-label":c.title,className:`absolute top-3 right-3 z-10 flex max-h-[calc(100%-24px)] w-[300px] max-w-[calc(100%-24px)] flex-col overflow-y-auto rounded-[12px] border border-line bg-bg shadow-lg`,onPointerDown:e=>e.stopPropagation(),children:[(0,J.jsxs)(`div`,{className:`flex items-center gap-2 border-b border-line-soft px-4 py-4`,children:[(0,J.jsx)(`h4`,{className:`m-0 flex-1 text-[13px] font-semibold text-ink`,children:c.title}),c.pill&&(0,J.jsx)(`span`,{className:`rounded-full px-2 py-1 text-[13px] font-medium text-white`,style:{background:c.pill.colour},children:c.pill.text}),(0,J.jsx)(V,{variant:`icon`,size:`icon-sm`,"aria-label":`Close the details`,"data-tip":`Close the details`,onClick:()=>s(null),children:(0,J.jsx)(A,{"aria-hidden":`true`})})]}),(0,J.jsx)(`div`,{className:`flex flex-col gap-4 px-4 py-4 text-[13px]`,children:c.body})]}),(0,J.jsxs)(`section`,{"aria-label":a,className:`absolute bottom-3 left-3 z-10 max-w-[calc(100%-24px)] rounded-[12px] border border-line bg-bg px-4 py-4 shadow-md`,onPointerDown:e=>e.stopPropagation(),children:[(0,J.jsx)(`h4`,{className:`m-0 mb-2 text-[13px] font-semibold tracking-[0.08em] text-[color:var(--color-warn)] uppercase`,children:a}),(0,J.jsxs)(`ul`,{className:`m-0 grid list-none grid-cols-1 gap-x-4 gap-y-2 p-0 text-[13px] text-ink-2 @md:grid-cols-2 @2xl:grid-cols-3`,children:[y?y.map(e=>(0,J.jsxs)(`li`,{className:`flex items-center gap-2`,children:[(0,J.jsx)(`span`,{"aria-hidden":`true`,className:L(`size-2.5 flex-none rounded-full`,e.ring&&`size-3 border-2`),style:e.ring?{borderColor:e.colour}:{background:e.colour}}),e.label,e.n!==void 0&&(0,J.jsx)(`span`,{className:`text-muted tabular-nums`,children:e.n})]},e.label)):i.slice(0,uC).map(e=>(0,J.jsxs)(`li`,{className:`flex items-center gap-2`,children:[(0,J.jsx)(`span`,{"aria-hidden":`true`,className:`size-2.5 flex-none rounded-full`,style:{background:r(e)}}),e]},e)),!y&&i.length>uC&&(0,J.jsxs)(`li`,{className:`text-muted`,children:[`and `,i.length-uC,` more`]})]})]}),(0,J.jsx)(`p`,{id:he,className:L(`absolute top-3 left-3 z-10 m-0 max-w-[calc(100%-340px)] rounded-[8px] border border-line bg-bg px-4 py-2 text-[13px] text-ink-2 shadow-md`,!de&&`sr-only`),children:`Arrows move to the nearest one · R its relationships · F follows one · Enter details · Escape closes · + − zoom · 0 fits · Shift+arrows pan`})]}),(0,J.jsx)(`p`,{"aria-live":`polite`,className:`sr-only`,children:pe})]})}function pC({label:e,children:t}){return(0,J.jsxs)(`div`,{className:`grid grid-cols-[96px_1fr] gap-2`,children:[(0,J.jsxs)(`span`,{className:`text-muted`,children:[e,`:`]}),(0,J.jsx)(`span`,{className:`min-w-0 text-ink [overflow-wrap:anywhere]`,children:t})]})}function mC({title:e,children:t}){return(0,J.jsxs)(`div`,{className:`flex flex-col gap-2 border-t border-line-soft pt-4`,children:[(0,J.jsxs)(`span`,{className:`font-semibold text-ink`,children:[e,`:`]}),t]})}var hC=({children:e})=>(0,J.jsx)(`span`,{className:`rounded-full border border-line px-2 py-1 text-[13px] text-ink-2`,children:e}),gC=[`agent`,`tests`,`personas`,`findings`],_C={agent:`Agent`,tests:`Tests`,personas:`Personas`,findings:`Findings`},vC={agent:`BASAL`,tests:`Business tests`,personas:`Personas`,findings:`Findings`},yC={agent:`Business testing that acts. Ask a business question; BASAL works it through the steps below, beside the product's knowledge graph, and ForgeQE's agents play each step as the people it affects.`,tests:`Every business test BASAL has worked: its question, how far through the eight steps it is, and its stage. Open one for its strategy, cast, handovers and verdicts. A new test starts from a business question on the Agent tab.`,personas:`The people each test was cast with: what they check before they accept the outcome, what they object to, and the mistakes they bring.`,findings:`Every scenario's latest verdict, the ones that need attention first. Each rests on what ForgeQE's agents observed, never on a model's opinion.`},bC=(e,t)=>e===`agent`?B(`agents`,`basal`):t?B(`agents`,`basal`,e,t):B(`agents`,`basal`,e),xC=[`ask`,`understand`,`strategy`,`cast`,`rehearse`,`approve`,`act`,`judge`],SC={ask:{name:`Ask`,about:`The business question, and what came with it.`},understand:{name:`Understand`,about:`The decision, its stakeholders, how success is measured, and the facts, read from the sources and the product graph. Observed: quoted as written. Inferred: worked out, to be confirmed.`},strategy:{name:`Strategy`,about:`Scenarios that decide the question, each step on the channel an agent can play, and the business expectations that judge it.`},cast:{name:`Cast`,about:`One persona for each stakeholder who acts: what they check, what they object to, and the mistakes they bring.`},rehearse:{name:`Rehearse`,about:`The cast react on a social feed: to the decision, to each other, and to what the agents really saw on the product. What they want to try next picks the scenarios to play. Opinions, never evidence.`},approve:{name:`Approve`,about:`Nothing runs until a person approves the strategy.`},act:{name:`Act`,about:`Each step handed to ForgeQE's agents as its persona, on the test environment. Steps that change data run only when you agree.`},judge:{name:`Judge`,about:`Code judges each scenario from what the agents observed. A step only a person can see waits for you.`}},CC={asked:1,understood:2,planned:3,cast:4,rehearsed:5,approved:6,acted:8},wC={understand:1,strategy:2,cast:3,rehearse:4,act:6},TC=e=>String(e).padStart(2,`0`),EC=[{channel:`browser`,title:`WebPilot · browser`},{channel:`api`,title:`API workbench`},{channel:`mobile`,title:`Mobile agent`},{channel:`desktop`,title:`Desktop agent`},{channel:`person`,title:`A person`}],DC={confirmed_failure:`fail`,policy_ambiguity:`warn`,potential_risk:`warn`,missing_evidence:`neutral`,expected_behaviour:`pass`},OC=[`confirmed_failure`,`policy_ambiguity`,`potential_risk`,`missing_evidence`,`expected_behaviour`];function kC({page:e,tab:t,sub:n}){let r=gC.includes(t)?t:`agent`,[i,a]=r===`tests`&&n?n.split(`/`):[],o=i?Xt(i):``,s=(e,t)=>(0,J.jsxs)(J.Fragment,{children:[(0,J.jsx)(`h2`,{className:`m-0 text-[20px] font-semibold`,children:vC[e]}),(0,J.jsx)(`p`,{className:`m-0 text-[13px] leading-relaxed text-ink-2`,children:yC[e]}),t]});return(0,J.jsx)(Ax,{page:e,title:Wn(`basal`),label:`BASAL`,current:r,onPick:e=>location.hash=bC(e),tabs:gC.filter(e=>e!==kx).map(e=>({id:e,label:_C[e]})),agentBody:(0,J.jsxs)(J.Fragment,{children:[(0,J.jsx)(`p`,{className:`m-0 text-[13px] leading-relaxed text-ink-2`,children:yC.agent}),(0,J.jsx)(PC,{})]}),children:o?(0,J.jsx)(IC,{id:o,step:xC.includes(a)?a:void 0},o):r===`tests`?s(`tests`,(0,J.jsx)(FC,{})):r===`personas`?s(`personas`,(0,J.jsx)(QC,{})):r===`findings`?s(`findings`,(0,J.jsx)($C,{})):null})}function AC(){let[e,t]=(0,q.useState)(null),[n,r]=(0,q.useState)(``),i=(0,q.useCallback)(()=>tn.home().then(t,e=>r(e.message)),[]);return(0,q.useEffect)(()=>void i(),[i]),{home:e,error:n,load:i}}function jC({g:e}){return(0,J.jsx)(`p`,{className:`m-0 text-[13px] text-muted tabular-nums`,children:e.connected?(0,J.jsxs)(J.Fragment,{children:[`Graph store: Neo4j · `,kt(e.product||0,`product node`),` · `,kt(e.scenario||0,`scenario node`),e.embedding?` · found by meaning with ${e.embedding}`:` · by words only (no embedding model)`]}):(0,J.jsxs)(J.Fragment,{children:[`Graph store: the product graph's file`,e.reason?` (${e.reason})`:``,`. forgeqe graph setup starts Neo4j.`]})})}function MC({home:e}){let[t,n]=(0,q.useState)(``),[i,a]=(0,q.useState)(!1),[o,s]=(0,q.useState)(``),c=async()=>{a(!0),s(``);try{let{id:e}=await tn.ask(t.trim());await tn.stage(e,`understand`),location.hash=bC(`tests`,`${e}/understand`)}catch(e){s(e.message)}finally{a(!1)}};return(0,J.jsxs)(`section`,{"aria-labelledby":`basal-new`,className:`flex flex-col gap-2 rounded-[14px] card border p-4`,children:[(0,J.jsx)(`h2`,{id:`basal-new`,className:`m-0 text-[13px] font-semibold text-muted`,children:`New business test`}),(0,J.jsxs)(`label`,{className:`flex flex-col gap-2 text-sm`,children:[(0,J.jsx)(`span`,{className:`font-medium`,children:`Your business question`}),(0,J.jsx)(pn,{id:`basal-request`,rows:3,value:t,onChange:e=>n(e.target.value),placeholder:`Should we launch saved cards with a fee? Test how merchants, shoppers and support would really be affected.`})]}),(0,J.jsx)(`span`,{className:`text-[13px] text-muted`,children:`Briefs and data files are added with forgeqe basal new --file; the product's knowledge graph and documents are read for every test.`}),o&&(0,J.jsx)(Sx,{text:o}),(0,J.jsx)(`div`,{children:(0,J.jsxs)(V,{variant:`primary`,disabled:i||t.trim().length<10||!e.model,onClick:()=>void c(),"data-tip":e.model?`Keeps the question and starts step 02, Understand`:`Set up a model in Settings › Models first`,children:[(0,J.jsx)(r,{"aria-hidden":`true`}),i?`Starting…`:`Start`]})})]})}function NC({tests:e,search:t=!0,tools:n}){return(0,J.jsx)(Sr,{label:`Business tests`,placeholder:`Find a business test`,empty:`No business test yet. Ask a business question on the Agent tab.`,search:t,...n?{tools:n}:{},head:(0,J.jsxs)(J.Fragment,{children:[(0,J.jsx)(`th`,{className:L(Sn,`w-[55%]`),children:`Business question`}),(0,J.jsx)(`th`,{className:L(Sn,`hidden @xl:table-cell`),children:`Asked`}),(0,J.jsx)(`th`,{className:L(Br,`hidden @2xl:table-cell`),children:`Steps done`}),(0,J.jsx)(`th`,{className:Sn,children:`Stage`})]}),children:e.map(e=>{let t=CC[e.stage];return(0,J.jsxs)(`tr`,{onClick:()=>location.hash=bC(`tests`,e.id),className:ri,children:[(0,J.jsxs)(`td`,{className:L(Er,`max-w-0`),children:[(0,J.jsx)(`a`,{href:bC(`tests`,e.id),onClick:e=>e.stopPropagation(),"data-tip":e.request,className:`block truncate font-medium text-ink no-underline hover:underline`,children:e.request}),(0,J.jsx)(`span`,{className:`block truncate font-mono text-muted`,children:e.id})]}),(0,J.jsx)(`td`,{className:L(Er,`hidden whitespace-nowrap text-muted @xl:table-cell`),children:e.created.slice(0,10)}),(0,J.jsx)(`td`,{className:L(ar,`hidden text-muted @2xl:table-cell`),children:t===void 0?`–`:`${t} of ${xC.length}`}),(0,J.jsx)(`td`,{className:L(Er,`whitespace-nowrap`),children:e.running?(0,J.jsx)(z,{tone:`running`,children:e.running}):(0,J.jsx)(z,{tone:`neutral`,children:e.stage})})]},e.id)})})}function PC(){let{home:e,error:t}=AC();return t?(0,J.jsx)(Sx,{text:t}):e?(0,J.jsxs)(`div`,{className:`flex flex-col gap-6`,children:[(0,J.jsx)(`ol`,{"aria-label":`BASAL's steps`,className:`m-0 grid list-none gap-2 p-0 @[640px]:grid-cols-4 @[1040px]:grid-cols-8`,children:xC.map((e,t)=>(0,J.jsxs)(`li`,{className:`flex flex-col gap-1 rounded-[12px] bg-surface-muted p-4`,children:[(0,J.jsxs)(`span`,{className:`font-mono text-[13px] text-muted`,children:[`STEP `,TC(t+1)]}),(0,J.jsx)(`span`,{className:`text-[13px] font-semibold`,children:SC[e].name})]},e))}),(0,J.jsx)(jC,{g:e.graph}),(0,J.jsx)(MC,{home:e}),e.tests.length>0&&(0,J.jsxs)(`section`,{"aria-labelledby":`basal-recent`,className:`flex flex-col gap-2`,children:[(0,J.jsxs)(`h2`,{id:`basal-recent`,className:`m-0 flex items-center justify-between text-[13px] font-semibold text-muted`,children:[`Recent tests`,(0,J.jsx)(`a`,{href:bC(`tests`),className:`text-[13px] font-normal`,children:`Every test`})]}),(0,J.jsx)(NC,{tests:e.tests.slice(0,5),search:!1})]})]}):(0,J.jsx)(`p`,{role:`status`,className:`m-0 text-sm text-muted`,children:`Loading…`})}function FC(){let{home:e,error:t,load:n}=AC();return t?(0,J.jsx)(Sx,{text:t}):e?(0,J.jsx)(NC,{tests:e.tests,tools:(0,J.jsxs)(V,{size:`sm`,variant:`ghost`,onClick:()=>void n(),className:`ml-auto`,"data-tip":`Read the tests again`,children:[(0,J.jsx)(f,{"aria-hidden":`true`}),`Refresh`]})}):(0,J.jsx)(`p`,{role:`status`,className:`m-0 text-sm text-muted`,children:`Loading…`})}function IC({id:e,step:t}){let[n,r]=(0,q.useState)(null),[i,a]=(0,q.useState)(null),[o,s]=(0,q.useState)(``),c=(0,q.useCallback)(()=>tn.test(e).then(r,e=>s(e.message)),[e]),l=(0,q.useCallback)(()=>tn.graph(e).then(a,e=>s(`The graph could not be read: ${e.message}`)),[e]);(0,q.useEffect)(()=>{c(),l()},[c,l]);let u=!(!n?.job||n.job.endedAt);if((0,q.useEffect)(()=>{if(!u)return;let e=setInterval(()=>{c(),l()},2500);return()=>{clearInterval(e),l()}},[u,c,l]),!n)return o?(0,J.jsx)(Sx,{text:o}):(0,J.jsx)(`p`,{role:`status`,className:`m-0 text-sm text-muted`,children:`Loading…`});let d=CC[n.stage],f=n.job&&!n.job.endedAt?wC[n.job.stage]:-1,p=t||xC[f>=0?f:Math.min(d,xC.length-1)],m=xC.indexOf(p),h=async(e,t)=>{s(``);try{await e(),await c(),t&&(location.hash=bC(`tests`,`${n.id}/${t}`))}catch(e){s(e.message)}},g=e=>e===f?{tone:`running`,word:`Working`}:e<d?{tone:`pass`,word:`Completed`}:e===d?{tone:`warn`,word:`Next`}:{tone:`neutral`,word:`Waiting`},_=g(m);return(0,J.jsxs)(`div`,{className:`flex flex-col gap-4`,children:[(0,J.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,J.jsxs)(`a`,{href:bC(`tests`),className:`inline-flex items-center gap-2 self-start text-sm`,children:[(0,J.jsx)(Se,{size:16,"aria-hidden":`true`}),`Every test`]}),(0,J.jsx)(`h2`,{className:`m-0 line-clamp-2 text-[20px] font-semibold text-balance`,"data-tip":n.scenario?.decision||n.request.request,children:n.scenario?.decision||n.request.request}),(0,J.jsxs)(`p`,{className:`m-0 text-[13px] text-muted`,children:[(0,J.jsx)(`span`,{className:`font-mono`,children:n.id}),` · asked `,n.request.created.slice(0,10),n.strategy?.environment?` · on ${n.strategy.environment}`:``,n.strategy?.approved?` · approved by ${n.strategy.approved.by}`:``]})]}),(0,J.jsx)(`nav`,{"aria-label":`BASAL's steps`,className:`overflow-x-auto`,children:(0,J.jsx)(`ol`,{className:`m-0 grid min-w-[800px] list-none grid-cols-8 gap-1 rounded-[12px] bg-surface-muted p-1`,children:xC.map((e,t)=>{let r=g(t),i=t<=d||t===f,a=(0,J.jsxs)(J.Fragment,{children:[(0,J.jsxs)(`span`,{className:`flex items-baseline gap-2`,children:[(0,J.jsx)(`span`,{className:`font-mono text-[13px] text-muted`,children:TC(t+1)}),(0,J.jsx)(`span`,{className:`text-[13px] font-medium`,children:SC[e].name})]}),(0,J.jsx)(z,{tone:r.tone,icon:r.tone===`running`,className:`self-start`,children:r.word})]});return(0,J.jsx)(`li`,{className:`min-w-0`,children:i?(0,J.jsx)(`a`,{href:bC(`tests`,`${n.id}/${e}`),"aria-current":e===p?`step`:void 0,className:L(`flex h-full flex-col gap-1 rounded-[8px] px-2 py-2 text-ink no-underline hover:text-ink`,e===p?`bg-bg`:`hover:bg-bg`),children:a}):(0,J.jsx)(`span`,{className:`flex h-full flex-col gap-1 rounded-[8px] px-2 py-2 opacity-60`,children:a})},e)})})}),o&&(0,J.jsx)(Sx,{text:o}),(0,J.jsxs)(`div`,{className:`grid items-start gap-4 @[960px]:grid-cols-[minmax(0,1fr)_minmax(0,1.15fr)]`,children:[(0,J.jsxs)(`div`,{className:`flex min-w-0 flex-col gap-2 @[960px]:sticky @[960px]:top-4`,children:[(0,J.jsx)(`p`,{className:`m-0 text-[13px] text-muted tabular-nums`,children:i?.connected?`${kt(i.nodes.length,`node`)} · ${kt(i.edges.length,`edge`)} · scenario over the product graph`:`Graph store not connected`}),(0,J.jsx)(UC,{graph:i,onRefresh:()=>void tn.regraph(e).then(l,e=>s(e.message))})]}),(0,J.jsxs)(`section`,{"aria-labelledby":`basal-step`,className:`flex min-w-0 flex-col gap-4 rounded-[14px] card border p-4`,children:[(0,J.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,J.jsxs)(`span`,{className:`rounded-[8px] bg-accent-soft px-2 py-1 font-mono text-[13px] font-medium text-accent-fg`,children:[`STEP `,TC(m+1)]}),(0,J.jsx)(`h3`,{id:`basal-step`,className:`m-0 text-[16px] font-semibold`,children:SC[p].name}),(0,J.jsx)(`span`,{className:`ml-auto`,children:(0,J.jsx)(z,{tone:_.tone,children:_.word})})]}),(0,J.jsx)(`p`,{className:`m-0 text-[13px] text-ink-2`,children:SC[p].about}),n.job&&wC[n.job.stage]===m&&(0,J.jsx)(HC,{t:n}),(0,J.jsx)(LC,{step:p,t:n,onRun:h})]})]})]})}function LC({step:e,t,onRun:n}){let r=!(!t.job||t.job.endedAt),i=(e,t,i,a)=>(0,J.jsx)(`div`,{className:`border-t border-line pt-4`,children:(0,J.jsxs)(V,{variant:`primary`,disabled:r,onClick:()=>void n(i,a),"data-tip":t,children:[(0,J.jsx)(Xe,{"aria-hidden":`true`}),e]})}),a=(e,n)=>(0,J.jsx)(`div`,{className:`border-t border-line pt-4`,children:(0,J.jsxs)(`a`,{href:bC(`tests`,`${t.id}/${n}`),className:Ct({variant:`primary`}),children:[(0,J.jsx)(Xe,{"aria-hidden":`true`}),e]})});return e===`ask`?(0,J.jsxs)(J.Fragment,{children:[(0,J.jsx)(`p`,{className:`m-0 rounded-[8px] bg-surface-strong px-4 py-2 text-[13px] text-ink [overflow-wrap:anywhere]`,children:t.request.request}),(0,J.jsx)(pC,{label:`Files`,children:t.request.files.length?t.request.files.join(`, `):`none`}),(0,J.jsx)(pC,{label:`Work items`,children:t.request.stories.length?t.request.stories.join(`, `):`none`}),(0,J.jsx)(pC,{label:`Environment`,children:t.request.environment||`the active test environment`}),t.stage===`asked`?i(`Understand the question`,`Reads the request, its files and the product graph into the scenario`,()=>tn.stage(t.id,`understand`),`understand`):a(`Next: Understand`,`understand`)]}):e===`understand`?t.scenario?(0,J.jsxs)(J.Fragment,{children:[(0,J.jsx)(ZC,{t}),t.stage===`understood`?i(`Plan the test strategy`,`Scenarios, the agent for each step, and the business expectations`,()=>tn.stage(t.id,`strategy`),`strategy`):a(`Next: Strategy`,`strategy`)]}):(0,J.jsx)(`p`,{className:`m-0 text-[13px] text-muted`,children:`BASAL is reading the sources.`}):e===`strategy`?t.strategy?(0,J.jsxs)(J.Fragment,{children:[(0,J.jsx)(YC,{t}),t.stage===`planned`?i(`Cast the personas`,`One persona for each stakeholder who acts in the strategy`,()=>tn.stage(t.id,`cast`),`cast`):a(`Next: Cast`,`cast`)]}):(0,J.jsx)(`p`,{className:`m-0 text-[13px] text-muted`,children:`Not planned yet.`}):e===`cast`?t.cast.length?(0,J.jsxs)(J.Fragment,{children:[(0,J.jsx)(XC,{t}),t.stage===`cast`?i(`Play round 1`,`The cast react to the decision on a feed; what they want to try picks the scenarios`,()=>tn.stage(t.id,`rehearse`),`rehearse`):a(`Next: Rehearse`,`rehearse`)]}):(0,J.jsx)(`p`,{className:`m-0 text-[13px] text-muted`,children:`Not cast yet.`}):e===`rehearse`?(0,J.jsx)(zC,{t,onRun:n}):e===`approve`?(0,J.jsx)(BC,{t,onRun:n}):e===`act`?(0,J.jsx)(VC,{t,onRun:n}):t.verdicts.length?(0,J.jsxs)(J.Fragment,{children:[(0,J.jsx)(GC,{t,onObserve:(e,r,i)=>void n(()=>tn.observe(t.id,{scenario:e,step:r,...i?{accepted:!0}:{refused:!0}}))}),t.cast.length>0&&i(`Next round: the cast react to these outcomes`,`Round `+(t.rounds.length+1)+`: what the agents saw goes back to the personas`,()=>tn.stage(t.id,`rehearse`),`rehearse`)]}):(0,J.jsx)(`p`,{className:`m-0 text-[13px] text-muted`,children:`No verdict yet: the strategy has not been played.`})}var RC={support:`pass`,oppose:`fail`,undecided:`neutral`};function zC({t:e,onRun:t}){let n=!(!e.job||e.job.endedAt),i=new Map(e.cast.map(e=>[e.id,e.name])),a=e.rounds.at(-1),o=e.rounds.flatMap(e=>e.posts),s=new Map(o.map(e=>[e.id,e]));if(!a)return(0,J.jsxs)(J.Fragment,{children:[(0,J.jsx)(`p`,{className:`m-0 text-[13px] text-muted`,children:`No round yet.`}),(0,J.jsx)(`div`,{className:`border-t border-line pt-4`,children:(0,J.jsxs)(V,{variant:`primary`,disabled:n||!e.cast.length,onClick:()=>void t(()=>tn.stage(e.id,`rehearse`)),children:[(0,J.jsx)(r,{"aria-hidden":`true`}),`Play round 1`]})})]});let c={support:0,oppose:0,undecided:0};for(let e of a.turns)c[e.stance]=(c[e.stance]||0)+1;return(0,J.jsxs)(J.Fragment,{children:[(0,J.jsxs)(`p`,{className:`m-0 text-[13px] text-muted tabular-nums`,children:[`Round `,a.n,` · `,kt(o.length,`post`),` on the feed · `,c.support,` support · `,c.oppose,` oppose · `,c.undecided,` undecided`,a.events.length?` · reacted to ${kt(a.events.length,`outcome`)} on the product`:``]}),(0,J.jsxs)(`section`,{"aria-label":`Feed`,className:`flex flex-col gap-2`,children:[(0,J.jsx)(`h3`,{className:`m-0 text-[13px] font-semibold text-muted`,children:`Feed`}),(0,J.jsx)(`ol`,{className:`m-0 flex max-h-[420px] list-none flex-col gap-2 overflow-y-auto p-0`,children:[...o].reverse().map(e=>(0,J.jsxs)(`li`,{className:`flex flex-col gap-1 rounded-[8px] border border-line bg-bg p-2 text-[13px]`,children:[(0,J.jsxs)(`span`,{className:`flex flex-wrap items-center gap-2`,children:[(0,J.jsx)(`span`,{className:`font-medium`,children:i.get(e.author)||e.author}),(0,J.jsxs)(`span`,{className:`text-muted`,children:[e.kind,e.target?` on ${i.get(s.get(e.target)?.author||``)||e.target}`:``,` · round `,e.round]})]}),(0,J.jsx)(`span`,{className:`text-ink-2 [overflow-wrap:anywhere]`,children:e.text})]},e.id))})]}),(0,J.jsxs)(`section`,{"aria-label":`Stances`,className:`flex flex-col gap-2`,children:[(0,J.jsxs)(`h3`,{className:`m-0 text-[13px] font-semibold text-muted`,children:[`Where the cast stand after round `,a.n]}),(0,J.jsx)(`ul`,{className:`m-0 flex list-none flex-col gap-1 p-0 text-[13px]`,children:a.turns.map(e=>(0,J.jsxs)(`li`,{className:`flex items-start justify-between gap-2`,children:[(0,J.jsxs)(`span`,{children:[(0,J.jsx)(`span`,{className:`font-medium`,children:i.get(e.id)||e.id}),` `,(0,J.jsxs)(`span`,{className:`text-ink-2`,children:[`— `,e.feeling]})]}),(0,J.jsx)(z,{tone:RC[e.stance]||`neutral`,icon:!1,children:e.stance})]},e.id))})]}),e.wanted.length>0&&(0,J.jsxs)(`section`,{"aria-label":`Wanted next`,className:`flex flex-col gap-1 text-[13px]`,children:[(0,J.jsx)(`h3`,{className:`m-0 text-[13px] font-semibold text-muted`,children:`What the cast want tried`}),e.wanted.map(e=>(0,J.jsxs)(`span`,{children:[(0,J.jsx)(`span`,{className:`font-mono`,children:e.scenario}),` `,(0,J.jsxs)(`span`,{className:`text-muted`,children:[`· `,e.by.map(e=>i.get(e)||e).join(`, `)]})]},e.scenario))]}),(0,J.jsxs)(`div`,{className:`flex flex-wrap gap-2 border-t border-line pt-4`,children:[(0,J.jsxs)(`a`,{href:bC(`tests`,`${e.id}/${e.strategy?.approved?`act`:`approve`}`),className:Ct({variant:`primary`}),children:[(0,J.jsx)(Xe,{"aria-hidden":`true`}),e.strategy?.approved?`Next: Act`:`Next: Approve`]}),(0,J.jsxs)(V,{variant:`outline`,disabled:n,onClick:()=>void t(()=>tn.stage(e.id,`rehearse`)),children:[(0,J.jsx)(r,{"aria-hidden":`true`}),`Play round `,a.n+1]})]})]})}function BC({t:e,onRun:t}){let[n,r]=(0,q.useState)(``);if(e.strategy?.approved)return(0,J.jsxs)(J.Fragment,{children:[(0,J.jsxs)(`p`,{className:`m-0 text-[13px] text-ink-2`,children:[`Approved by `,e.strategy.approved.by,` on `,e.strategy.approved.at.slice(0,16).replace(`T`,` `),`.`]}),(0,J.jsx)(`div`,{className:`border-t border-line pt-4`,children:(0,J.jsxs)(`a`,{href:bC(`tests`,`${e.id}/act`),className:Ct({variant:`primary`}),children:[(0,J.jsx)(Xe,{"aria-hidden":`true`}),`Next: Act`]})})]});let i=e.strategy;return(0,J.jsxs)(J.Fragment,{children:[i?(0,J.jsxs)(`ul`,{className:`m-0 flex flex-col gap-1 pl-6 text-[13px] text-ink-2`,children:[(0,J.jsxs)(`li`,{children:[kt(i.scenarios.length,`scenario`),` on `,i.environment||`no test environment`,`, `,kt(i.scenarios.reduce((e,t)=>e+t.steps.length,0),`step`)]}),(0,J.jsx)(`li`,{children:e.writes.length?`${kt(e.writes.length,`step`)} change data: Act lists them for your agreement before anything runs`:`No step changes data`}),(0,J.jsxs)(`li`,{children:[`Plays on:`,` `,[...new Set(i.scenarios.flatMap(e=>e.steps.map(e=>e.app?`${e.app} (${JC[e.channel]})`:JC[e.channel])))].join(`, `)]}),i.needs.length>0&&(0,J.jsxs)(`li`,{className:`text-warn`,children:[kt(i.needs.length,`thing`),` still needed: see Strategy`]})]}):null,(0,J.jsxs)(`label`,{className:`flex flex-col gap-2 text-sm`,children:[(0,J.jsx)(`span`,{className:`font-medium`,children:`Type the test's id to approve`}),(0,J.jsx)(R,{id:`basal-typed`,value:n,onChange:e=>r(e.target.value),placeholder:`Type the test's id`})]}),(0,J.jsx)(`span`,{className:`font-mono text-[13px] text-muted`,children:e.id}),(0,J.jsx)(`div`,{className:`border-t border-line pt-4`,children:(0,J.jsxs)(V,{variant:`primary`,disabled:n.trim()!==e.id||!i,onClick:()=>void t(()=>tn.approve(e.id,n.trim()),`act`),children:[(0,J.jsx)(dt,{"aria-hidden":`true`}),`Approve`]})})]})}function VC({t:e,onRun:t}){let[n,i]=(0,q.useState)(!1),[a,o]=(0,q.useState)(!0),s=!(!e.job||e.job.endedAt);if(!e.strategy?.approved)return(0,J.jsx)(`p`,{className:`m-0 text-[13px] text-muted`,children:`Approve the strategy first.`});let c=a&&e.wanted.length?e.wanted.map(e=>e.scenario):[];return(0,J.jsxs)(J.Fragment,{children:[e.handovers.length>0&&(0,J.jsx)(WC,{handovers:e.handovers}),!s&&(0,J.jsxs)(`div`,{className:`flex flex-col gap-2 border-t border-line pt-4`,children:[e.wanted.length>0&&(0,J.jsxs)(`label`,{className:`flex min-h-9 cursor-pointer items-center gap-2 text-[13px]`,children:[(0,J.jsx)(vy,{id:`basal-wanted`,checked:a,onCheckedChange:o}),`Only what the cast wants tried after round `,e.rounds.length,`: `,e.wanted.map(e=>e.scenario).join(`, `)]}),e.writes.length>0?(0,J.jsxs)(J.Fragment,{children:[(0,J.jsxs)(`p`,{className:`m-0 text-[13px] text-ink-2`,children:[`These steps change data on `,e.strategy.environment,`. Without your agreement they are skipped and the agents change nothing.`]}),(0,J.jsx)(`ul`,{className:`m-0 flex flex-col gap-1 pl-4 text-[13px] text-warn`,children:e.writes.map(e=>(0,J.jsx)(`li`,{className:`[overflow-wrap:anywhere]`,children:e},e))}),(0,J.jsxs)(`label`,{className:`flex min-h-9 cursor-pointer items-center gap-2 text-[13px]`,children:[(0,J.jsx)(vy,{id:`basal-writes`,checked:n,onCheckedChange:i}),`Let these steps change data`]})]}):(0,J.jsx)(`p`,{className:`m-0 text-[13px] text-ink-2`,children:`No step changes data.`}),(0,J.jsxs)(`div`,{className:`flex flex-wrap gap-2`,children:[(0,J.jsxs)(V,{variant:`primary`,onClick:()=>void t(()=>tn.act(e.id,n?e.writes:[],c)),"data-tip":`Hands each step to ForgeQE's agents as its persona`,children:[(0,J.jsx)(r,{"aria-hidden":`true`}),e.verdicts.length?`Play it again`:`Act`]}),e.verdicts.length>0&&(0,J.jsxs)(`a`,{href:bC(`tests`,`${e.id}/judge`),className:Ct({variant:`outline`}),children:[(0,J.jsx)(Xe,{"aria-hidden":`true`}),`Next: Judge`]})]})]})]})}function HC({t:e}){let t=e.job;return(0,J.jsxs)(`section`,{"aria-labelledby":`basal-feed`,className:`flex flex-col gap-2 rounded-[14px] card border p-4`,children:[(0,J.jsxs)(`h3`,{id:`basal-feed`,className:`m-0 flex items-center justify-between gap-2 text-[13px] font-semibold text-muted`,children:[(0,J.jsxs)(`span`,{children:[`Live · `,t.stage]}),t.endedAt?(0,J.jsx)(z,{tone:t.error?`fail`:`pass`,children:t.error?`stopped`:`finished`}):(0,J.jsx)(z,{tone:`running`,children:`working`})]}),(0,J.jsx)(`ol`,{"aria-live":`polite`,className:`m-0 flex max-h-64 list-none flex-col gap-1 overflow-y-auto p-0 text-[13px] text-ink-2`,children:t.lines.slice(-40).map((e,t)=>(0,J.jsx)(`li`,{className:`[overflow-wrap:anywhere]`,children:e},t))}),t.error&&(0,J.jsx)(Sx,{text:t.error})]})}function UC({graph:e,onRefresh:t}){let[n,r]=(0,q.useState)(null),{nodes:i,edges:o,types:s}=(0,q.useMemo)(()=>{let t=(e?.nodes||[]).map(e=>({id:e.id,name:e.type===`fact`?``:e.name.length>34?`${e.name.slice(0,32).trimEnd()}…`:e.name,type:e.layer===`product`?`product ${e.type}`:e.type}));return{nodes:t,edges:(e?.edges||[]).map((e,t)=>({id:`e${t}`,from:e.from,to:e.to,label:e.type})),types:[...new Set(t.map(e=>e.type))]}},[e]),c=e=>oC[Math.max(0,s.indexOf(e))%oC.length],l=null;if(n?.kind===`node`){let t=e?.nodes.find(e=>e.id===n.id);t&&(l={title:t.name,pill:{text:t.layer===`product`?`product ${t.type}`:t.type,colour:c(t.layer===`product`?`product ${t.type}`:t.type)},body:(0,J.jsxs)(J.Fragment,{children:[(0,J.jsx)(`p`,{className:`m-0 text-ink [overflow-wrap:anywhere]`,children:t.summary}),(0,J.jsx)(pC,{label:`Layer`,children:t.layer}),t.state&&(0,J.jsx)(pC,{label:`Evidence`,children:t.state})]})})}return e?.connected?i.length?(0,J.jsx)(fC,{title:`Live knowledge graph`,nodes:i,edges:o,colourOfType:c,types:s,typesTitle:`Node types`,picked:n,onPick:r,detail:l,onRefresh:t}):(0,J.jsx)(nn,{icon:a,title:`No scenario in the graph yet`,children:`It appears once BASAL has understood the question.`}):(0,J.jsx)(nn,{icon:a,title:`The graph store is not connected`,children:e?.reason||`Start Neo4j with forgeqe graph setup to see the scenario grow over the product graph.`})}function WC({handovers:e}){let t=new Map;for(let n of e)t.set(`${n.scenario}#${n.step}`,n);let n=[...t.values()],r=e=>e.state===`started`?`running`:e.state===`waiting`?`warn`:e.state===`skipped`?`neutral`:e.outcome===`accepted`?`pass`:e.outcome===`refused`?`fail`:`neutral`,i=e=>e.state===`started`?`in progress`:e.state===`waiting`?`waiting for you`:e.state===`skipped`?`skipped`:e.outcome||`done`;return(0,J.jsxs)(`section`,{"aria-labelledby":`basal-board`,className:`flex flex-col gap-2`,children:[(0,J.jsx)(`h3`,{id:`basal-board`,className:`m-0 text-[13px] font-semibold text-muted`,children:`Operations board`}),(0,J.jsx)(`p`,{className:`m-0 text-[13px] text-muted`,children:`Each card is a handover from BASAL to one of ForgeQE's agents, as one persona.`}),(0,J.jsx)(`div`,{className:`grid gap-2 @[1200px]:grid-cols-2`,children:EC.filter(e=>n.some(t=>t.channel===e.channel)).map(e=>{let t=n.filter(t=>t.channel===e.channel);return(0,J.jsxs)(`div`,{className:`flex min-w-0 flex-col gap-2 rounded-[12px] bg-surface-muted p-2`,children:[(0,J.jsxs)(`h4`,{className:`m-0 px-2 pt-1 text-[13px] font-semibold`,children:[e.title,` `,(0,J.jsxs)(`span`,{className:`font-normal text-muted`,children:[`· `,t.length]})]}),t.map(e=>(0,J.jsxs)(`div`,{className:`flex flex-col gap-1 rounded-[8px] border border-line bg-bg p-2 text-[13px]`,children:[(0,J.jsxs)(`span`,{className:`flex items-center justify-between gap-2`,children:[(0,J.jsx)(`span`,{className:`truncate font-medium`,children:e.actor}),(0,J.jsx)(z,{tone:r(e),children:i(e)})]}),(0,J.jsxs)(`span`,{className:`text-muted`,children:[(0,J.jsx)(`span`,{className:`font-mono`,children:e.scenario}),` · step `,e.step]}),e.note&&(0,J.jsx)(`span`,{className:`text-ink-2 [overflow-wrap:anywhere]`,children:e.note}),e.run&&(0,J.jsx)(`span`,{className:`font-mono text-muted`,children:e.run})]},`${e.scenario}#${e.step}`))]},e.channel)})})]})}function GC({t:e,onObserve:t}){let n=[...e.verdicts].sort((e,t)=>OC.indexOf(e.outcome)-OC.indexOf(t.outcome));return(0,J.jsx)(`section`,{"aria-label":`Verdicts`,className:`flex flex-col gap-2`,children:(0,J.jsx)(`ul`,{className:`m-0 flex list-none flex-col gap-2 p-0`,children:n.map(e=>(0,J.jsx)(KC,{v:e,onObserve:(n,r)=>t(e.scenario,n,r)},e.scenario))})})}function KC({v:e,onObserve:t}){return(0,J.jsxs)(`li`,{className:`flex flex-col gap-2 rounded-[12px] card border p-4`,children:[(0,J.jsxs)(`span`,{className:`flex flex-wrap items-center gap-2`,children:[(0,J.jsx)(z,{tone:DC[e.outcome],children:e.label}),(0,J.jsx)(`span`,{className:`text-[13px] font-medium`,children:e.title}),(0,J.jsxs)(`span`,{className:`text-[13px] text-muted`,children:[`· confidence `,e.confidence]})]}),(0,J.jsx)(`p`,{className:`m-0 text-[13px] text-ink-2 [overflow-wrap:anywhere]`,children:e.why}),e.results.length>0&&(0,J.jsx)(`ul`,{className:`m-0 flex flex-col gap-1 pl-4 text-[13px]`,children:e.results.map(e=>(0,J.jsxs)(`li`,{className:L(e.status===`violated`?`text-fail`:e.status===`held`?`text-ink`:`text-muted`),children:[e.status===`held`?`Held`:e.status===`violated`?`Broken`:`Not known`,`: `,e.says,e.detail?` — ${e.detail}`:``]},e.id))}),t&&e.pending.map(e=>(0,J.jsxs)(`span`,{className:`flex flex-wrap items-center gap-2 text-[13px] text-warn`,children:[`Step `,e,` waits for a person:`,(0,J.jsx)(V,{size:`sm`,variant:`outline`,onClick:()=>t(e,!0),children:`The app let them do it`}),(0,J.jsx)(V,{size:`sm`,variant:`outline`,onClick:()=>t(e,!1),children:`The app refused it`})]},e))]})}var qC=e=>e.map(e=>e.trim().replace(/(?<![.;])[.;]+$/,``)).join(`; `),JC={browser:`browser`,api:`API`,mobile:`mobile`,desktop:`desktop`,person:`a person`,opinion:`opinion`};function YC({t:e}){let t=e.strategy;return(0,J.jsxs)(`section`,{"aria-label":`Strategy`,className:`flex flex-col gap-2`,children:[(0,J.jsxs)(`p`,{className:`m-0 text-[13px] text-muted`,children:[kt(t.scenarios.length,`scenario`),` on `,t.environment||`no test environment`,` · `,kt(t.rounds,`round`)]}),t.needs.length>0&&(0,J.jsx)(`ul`,{"aria-label":`What the strategy still needs`,className:`m-0 flex flex-col gap-1 pl-6 text-[13px] text-warn`,children:t.needs.map(e=>(0,J.jsx)(`li`,{children:e},e))}),(0,J.jsx)(`ul`,{className:`m-0 flex list-none flex-col gap-2 p-0`,children:t.scenarios.map(e=>(0,J.jsxs)(`li`,{className:`flex flex-col gap-2 rounded-[12px] card border p-4`,children:[(0,J.jsxs)(`span`,{className:`flex flex-wrap items-center gap-2`,children:[(0,J.jsxs)(z,{tone:e.priority===1?`warn`:`neutral`,icon:!1,children:[`P`,e.priority,` · `,e.risk]}),(0,J.jsx)(`span`,{className:`text-[13px] font-medium`,children:e.title})]}),(0,J.jsx)(`p`,{className:`m-0 text-[13px] text-ink-2`,children:e.question}),(0,J.jsx)(`ol`,{className:`m-0 flex flex-col gap-1 pl-6 text-[13px]`,children:e.steps.map(e=>(0,J.jsxs)(`li`,{className:`[overflow-wrap:anywhere]`,children:[(0,J.jsx)(`span`,{className:`font-medium`,children:e.actor}),` `,(0,J.jsxs)(`span`,{className:`text-muted`,children:[`· `,JC[e.channel],e.app?` ${e.app}`:``,e.changes_data?` · changes data`:``]}),` — `,e.does]},e.n))}),e.oracles.length>0&&(0,J.jsx)(`ul`,{"aria-label":`Business expectations`,className:`m-0 flex flex-col gap-1 pl-4 text-[13px] text-ink-2`,children:e.oracles.map(e=>(0,J.jsxs)(`li`,{children:[e.says,` `,(0,J.jsxs)(`span`,{className:`text-muted`,children:[`(`,e.basis,`)`]})]},e.id))})]},e.id))})]})}function XC({t:e}){return(0,J.jsx)(`section`,{"aria-label":`Cast`,className:`flex flex-col gap-2`,children:(0,J.jsx)(`ul`,{className:`m-0 grid list-none gap-2 p-0 @[1100px]:grid-cols-2`,children:e.cast.map(e=>(0,J.jsxs)(`li`,{className:`flex flex-col gap-1 rounded-[12px] card border p-4 text-[13px]`,children:[(0,J.jsxs)(`span`,{className:`flex items-center justify-between gap-2`,children:[(0,J.jsx)(`span`,{className:`font-medium`,children:e.name}),(0,J.jsx)(z,{tone:e.intent===`legitimate`?`neutral`:`warn`,icon:!1,children:e.intent})]}),(0,J.jsx)(`span`,{className:`text-muted`,children:e.role}),e.validates.length>0&&(0,J.jsxs)(`span`,{className:`text-ink-2`,children:[`Checks: `,qC(e.validates)]}),e.frustrations.length>0&&(0,J.jsxs)(`span`,{className:`text-ink-2`,children:[`Objects to: `,qC(e.frustrations)]}),e.mistakes.length>0&&(0,J.jsxs)(`span`,{className:`text-ink-2`,children:[`Brings: `,qC(e.mistakes)]})]},e.id))})})}function ZC({t:e}){let t=e.scenario,n=e=>(0,J.jsx)(z,{tone:e===`observed`?`pass`:`neutral`,icon:!1,children:e});return(0,J.jsxs)(`section`,{"aria-label":`What BASAL understood`,className:`flex flex-col gap-2`,children:[(0,J.jsxs)(`div`,{className:`grid gap-2`,children:[(0,J.jsxs)(`div`,{className:`flex flex-col gap-1 rounded-[12px] card border p-4 text-[13px]`,children:[(0,J.jsx)(`h3`,{className:`m-0 text-[13px] font-semibold text-muted`,children:`Success criteria`}),t.criteria.map(e=>(0,J.jsxs)(`span`,{className:`flex items-start justify-between gap-2`,children:[(0,J.jsxs)(`span`,{children:[e.text,e.measure?(0,J.jsxs)(`span`,{className:`text-muted`,children:[` (`,e.measure,`)`]}):null]}),n(e.evidence)]},e.id))]}),(0,J.jsxs)(`div`,{className:`flex flex-col gap-1 rounded-[12px] card border p-4 text-[13px]`,children:[(0,J.jsx)(`h3`,{className:`m-0 text-[13px] font-semibold text-muted`,children:`Stakeholders`}),t.stakeholders.map(e=>(0,J.jsxs)(`span`,{className:`flex items-start justify-between gap-2`,children:[(0,J.jsxs)(`span`,{children:[(0,J.jsx)(`span`,{className:`font-medium`,children:e.name}),` `,(0,J.jsxs)(`span`,{className:`text-muted`,children:[`· `,e.kind]}),` — `,e.cares]}),n(e.evidence)]},e.id))]})]}),(0,J.jsxs)(`div`,{className:`flex flex-col gap-1 rounded-[12px] card border p-4 text-[13px]`,children:[(0,J.jsxs)(`h3`,{className:`m-0 text-[13px] font-semibold text-muted`,children:[`Facts (`,t.facts.length,`)`]}),t.facts.map(e=>(0,J.jsxs)(`span`,{className:`flex items-start justify-between gap-2`,children:[(0,J.jsxs)(`span`,{className:`[overflow-wrap:anywhere]`,children:[e.text,e.about.length?(0,J.jsxs)(`span`,{className:`text-muted`,children:[` → `,e.about.join(`, `)]}):null]}),n(e.evidence)]},e.id))]})]})}function QC(){let{home:e,error:t}=AC(),[n,r]=(0,q.useState)(null);return(0,q.useEffect)(()=>{e&&Promise.all(e.tests.slice(0,8).map(e=>tn.test(e.id).catch(()=>null))).then(e=>r(e.filter(e=>!!(e&&e.cast.length))))},[e]),t?(0,J.jsx)(Sx,{text:t}):n?n.length?(0,J.jsx)(`div`,{className:`flex flex-col gap-6`,children:n.map(e=>(0,J.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,J.jsx)(`a`,{href:bC(`tests`,e.id),className:`text-[13px] font-medium`,children:e.scenario?.decision||e.request.request}),(0,J.jsx)(XC,{t:e})]},e.id))}):(0,J.jsx)(nn,{icon:a,title:`No cast yet`,children:`A test is cast after its strategy is planned.`}):(0,J.jsx)(`p`,{role:`status`,className:`m-0 text-sm text-muted`,children:`Loading…`})}function $C(){let{home:e,error:t}=AC(),[n,r]=(0,q.useState)(null);return(0,q.useEffect)(()=>{e&&Promise.all(e.tests.slice(0,12).map(e=>tn.test(e.id).catch(()=>null))).then(e=>r(e.filter(e=>!!e).flatMap(e=>e.verdicts.map(t=>({t:e,v:t}))).sort((e,t)=>OC.indexOf(e.v.outcome)-OC.indexOf(t.v.outcome))))},[e]),t?(0,J.jsx)(Sx,{text:t}):n?n.length?(0,J.jsx)(`ul`,{className:`m-0 flex list-none flex-col gap-2 p-0`,children:n.map(({t:e,v:t})=>(0,J.jsx)(KC,{v:{...t,title:`${t.title} — ${e.scenario?.decision.slice(0,80)||e.id}`}},`${e.id}#${t.scenario}`))}):(0,J.jsx)(nn,{icon:a,title:`No verdict yet`,children:`A verdict appears when a test's strategy has been played.`}):(0,J.jsx)(`p`,{role:`status`,className:`m-0 text-sm text-muted`,children:`Loading…`})}var ew=ce({Agent:()=>rw,AgentDetails:()=>aw}),tw=5;function nw({to:e}){return(0,q.useEffect)(()=>location.replace(`#${e.replace(/^#/,``)}`),[e]),null}function rw({id:e}){if(!e)return(0,J.jsx)(Vy,{});let[t,n,r,...i]=e.split(`/`);if(t===`custom`&&n===`new`&&r===`template`&&i.length===1&&/^[a-z][a-z0-9-]{0,39}$/.test(i[0]))return(0,J.jsx)(Vb,{template:i[0]},i[0]);if(t===`custom`&&!i.length){if(n===`new`&&r===void 0)return(0,J.jsx)(Ky,{});if(n===`new`&&r===`form`)return(0,J.jsx)(Vb,{});if(n===`build`&&r&&/^[a-f0-9]{16}$/.test(r))return(0,J.jsx)(Jy,{sid:r},r);if(n&&Tn.test(n)&&r===void 0)return(0,J.jsx)(cb,{id:n},n);if(n&&Tn.test(n)&&r===`edit`)return(0,J.jsx)(Vb,{id:n},n)}let[a,o,...s]=(e||``).split(`/`);if(a===`business`)return(0,J.jsx)(nw,{to:B(`agents`,`basal`)});if(a&&Object.hasOwn(Xr,a))return(0,J.jsx)(nw,{to:B(`agents`,Xr[a])});let c=$n(a),l=o===`tools`||o===`conversations`;if(c?.id===`persona`&&o===void 0)return(0,J.jsx)(Eo,{agent:c,tabs:(0,J.jsx)(Kb,{current:`agent`})},c.id);if(c?.id===`persona`&&!l)return(0,J.jsx)(Xb,{page:c,tab:o,sub:s.join(`/`)},`${c.id}/${o}`);if(c?.opens&&!l)return(0,J.jsx)(iw,{to:B(...c.opens,...[o,...s].filter(e=>!!e))});if(c?.id===`basal`&&!l)return(0,J.jsx)(kC,{page:c,tab:o,sub:s.join(`/`)},c.id);let u=a===`category`&&!s.length?Qn(o):void 0;return u?(0,J.jsx)(Vy,{only:u.id},u.id):c&&o===`tools`&&!s.length?(0,J.jsx)(uw,{page:c},c.id):c&&o===`conversations`&&!s.length?(0,J.jsx)(pw,{page:c},c.id):!c||o!==void 0?(0,J.jsxs)(`div`,{className:`flex min-h-(--screen) flex-col`,children:[(0,J.jsx)(ii,{}),(0,J.jsxs)(`p`,{className:`m-0 px-6 py-10 text-sm text-muted`,children:[`There is no such agent. `,(0,J.jsx)(`a`,{href:B(`agents`),children:`See every agent`}),`, or `,(0,J.jsx)(`a`,{href:B(),children:`start a chat`}),` instead.`]})]}):(0,J.jsx)(Eo,{agent:c,below:(0,J.jsx)(aw,{page:c})},c.id)}function iw({to:e}){return(0,q.useEffect)(()=>{location.replace(e)},[e]),null}function aw({page:e}){let[t,n]=(0,q.useState)(null),[r,i]=(0,q.useState)([]),[a,o]=(0,q.useState)(null),[s,c]=(0,q.useState)(``),[l,u]=(0,q.useState)(null);(0,q.useEffect)(()=>{let t=!1;return bt.directory().then(n=>!t&&u(n.agents[e.agent]??null),()=>{}),bt.tools(e.agent).then(e=>!t&&o(e),e=>!t&&c(e.message)),mn.list().then(r=>!t&&n(Wo(Ur(e,r.chats))),()=>!t&&n([])),It.prompts().then(n=>!t&&i(n.agents.filter(t=>e.runs.includes(t.name))),()=>{}),()=>{t=!0}},[e]);let d=Ln(e.agent).name,f=[...new Set(r.map(e=>e.prompt))];return(0,J.jsxs)(`div`,{className:`flex w-full flex-col gap-6 pt-2`,children:[l&&l.status!==`ready`&&(0,J.jsx)(sw,{card:l,name:d}),(0,J.jsxs)(`section`,{"aria-labelledby":`agent-tools`,className:`flex flex-col gap-2`,children:[(0,J.jsx)(`h2`,{id:`agent-tools`,className:`m-0 text-[13px] font-semibold text-muted`,children:`Tools it can use`}),s?(0,J.jsx)(`p`,{className:`m-0 text-sm text-fail`,children:s}):a?(0,J.jsx)(dw,{view:a,limit:tw,more:B(`agents`,e.id,`tools`)}):(0,J.jsx)(`p`,{className:`m-0 text-sm text-muted`,children:`Reading its tools…`})]}),a&&a.connections.length>0&&(0,J.jsxs)(`section`,{"aria-labelledby":`agent-connected`,className:`flex flex-col gap-2`,children:[(0,J.jsx)(`h2`,{id:`agent-connected`,className:`m-0 text-[13px] font-semibold text-muted`,children:`Connected to`}),(0,J.jsx)(lw,{list:a.connections,limit:4,more:B(`agents`,e.id,`tools`)})]}),e.prompt!==!1&&(0,J.jsxs)(`section`,{"aria-labelledby":`agent-prompt`,className:`flex flex-col gap-2`,children:[(0,J.jsx)(`h2`,{id:`agent-prompt`,className:`m-0 text-[13px] font-semibold text-muted`,children:`Its instructions`}),(0,J.jsxs)(`a`,{href:B(`prompts`),className:`flex items-center gap-4 rounded-[12px] card border px-4 py-4 text-ink no-underline hover:bg-surface-muted hover:text-ink`,children:[(0,J.jsx)(Zt,{icon:xe,size:18,className:`flex-none text-muted`}),(0,J.jsxs)(`span`,{className:`flex min-w-0 flex-1 flex-col`,children:[(0,J.jsx)(`span`,{className:`text-[13px] font-medium`,children:f.length?f.map(e=>`${e}.md`).join(`, `):`The prompt it starts from`}),(0,J.jsxs)(`span`,{className:`text-[13px] text-muted`,children:[`What `,vr(d),` starts with, and your team's additions: change them in Prompts.`]})]}),(0,J.jsx)(Xe,{size:16,"aria-hidden":`true`,className:`flex-none text-muted`})]})]}),(0,J.jsxs)(`section`,{"aria-labelledby":`agent-conversations`,className:`flex flex-col gap-2`,children:[(0,J.jsxs)(`div`,{className:`flex items-baseline gap-2`,children:[(0,J.jsx)(`h2`,{id:`agent-conversations`,className:`m-0 flex-1 text-[13px] font-semibold text-muted`,children:`Conversations`}),t&&t.length>tw&&(0,J.jsxs)(`a`,{href:B(`agents`,e.id,`conversations`),className:`text-[13px]`,children:[`All `,t.length,` conversations`]})]}),t===null?(0,J.jsx)(`p`,{className:`m-0 text-sm text-muted`,children:`Reading the conversations…`}):t.length===0?(0,J.jsxs)(nn,{className:`py-4`,children:[`No conversations with `,vr(d),` yet. Ask it above to start one.`]}):(0,J.jsx)(fw,{name:d,chats:t.slice(0,tw)})]})]})}var ow={setup:{to:B(`settings`,`setup`),label:`Settings, Set up`},models:{to:B(`settings`,`models`),label:`Settings, Models`},tests:{to:B(`settings`,`tests`),label:`Settings, Code`},databases:{to:B(`settings`,`databases`),label:`Settings, Databases`},integrations:{to:B(`settings`,`integrations`),label:`Settings, Integrations`},features:{to:B(`settings`,`features`),label:`What's ready`}};function sw({card:e,name:t}){let n=Sy[e.status],r=e.needs??[];return(0,J.jsxs)(`section`,{"aria-labelledby":`agent-needs`,className:`flex flex-col gap-2`,children:[(0,J.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,J.jsx)(`h2`,{id:`agent-needs`,className:`m-0 text-[13px] font-semibold text-muted`,children:`What it needs`}),(0,J.jsx)(z,{tone:n.tone,children:n.label})]}),r.length===0?(0,J.jsx)(`p`,{className:`m-0 rounded-[12px] bg-surface-muted px-4 py-4 text-sm text-ink-2`,children:e.note}):(0,J.jsxs)(J.Fragment,{children:[(0,J.jsx)(`p`,{className:`m-0 text-[13px] text-muted`,children:r.some(e=>e.blocks)?`${vr(t,!0)} cannot work until the first ${r.filter(e=>e.blocks).length===1?`one is`:`ones are`} set up.`:`${vr(t,!0)} works, without the parts below.`}),(0,J.jsx)(`ul`,{"aria-label":`What ${vr(t)} needs`,className:`m-0 flex list-none flex-col rounded-[12px] card border p-0`,children:r.map((e,t)=>(0,J.jsxs)(`li`,{className:L(`flex items-center gap-4 px-4 py-2`,t>0&&`border-t border-line-soft`),children:[(0,J.jsx)(ze,{size:16,"aria-label":e.blocks?`Needed`:`Optional`,className:L(`flex-none`,e.blocks?`text-fail`:`text-warn`)}),(0,J.jsxs)(`span`,{className:`flex min-w-0 flex-1 flex-col`,children:[(0,J.jsx)(`span`,{className:`text-[13px] font-medium`,children:e.what}),(0,J.jsx)(`span`,{className:`text-[13px] text-muted [overflow-wrap:anywhere]`,children:e.why})]}),e.fix&&(0,J.jsxs)(`a`,{href:ow[e.fix].to,className:`flex flex-none items-center gap-1 text-[13px]`,children:[ow[e.fix].label,(0,J.jsx)(Xe,{size:14,"aria-hidden":`true`})]})]},`${e.what}:${t}`))})]})]})}var cw={repository:`branch`,database:`container`,environment:`web`,system:`plug`};function lw({list:e,limit:t,more:n}){let r=t?e.slice(0,t):e;return(0,J.jsxs)(J.Fragment,{children:[(0,J.jsx)(`ul`,{className:`m-0 grid list-none grid-cols-1 gap-2 p-0 sm:grid-cols-2`,children:r.map((e,t)=>(0,J.jsxs)(`li`,{className:L(`flex items-center gap-4 rounded-[12px] card border px-4 py-2`,!e.on&&`bg-surface-muted`),children:[(0,J.jsx)(vn,{name:cw[e.kind],px:22,className:L(!e.on&&`opacity-50 grayscale`)}),(0,J.jsxs)(`span`,{className:`flex min-w-0 flex-1 flex-col`,children:[(0,J.jsx)(`span`,{className:`truncate text-[13px] font-medium`,"data-tip":e.name,children:e.name}),(0,J.jsx)(`span`,{className:`truncate text-[13px] text-muted`,children:e.on?e.detail:`Not connected: ${e.why||`not set up`}`})]})]},`${e.kind}:${e.name}:${t}`))}),n&&r.length<e.length&&(0,J.jsxs)(`a`,{href:n,className:`self-start text-[13px]`,children:[`Show all `,e.length,` connections`]})]})}function uw({page:e}){let[t,n]=(0,q.useState)(null),[r,i]=(0,q.useState)(``);(0,q.useEffect)(()=>{let t=!1;return bt.tools(e.agent).then(e=>!t&&n(e),e=>!t&&i(e.message)),()=>{t=!0}},[e]);let a=Ln(e.agent).name;return(0,J.jsxs)(`div`,{className:`flex min-h-(--screen) flex-col`,children:[(0,J.jsx)(ii,{}),(0,J.jsxs)(`main`,{className:hi,children:[(0,J.jsxs)(`a`,{href:B(`agents`,e.id),className:`mb-4 inline-flex items-center gap-2 text-sm`,children:[(0,J.jsx)(Se,{size:16,"aria-hidden":`true`}),a]}),(0,J.jsxs)(`div`,{className:`mb-1 flex items-center gap-4`,children:[(0,J.jsx)(`span`,{"aria-hidden":`true`,className:`theme-side inline-flex size-10 border border-line-soft flex-none items-center justify-center rounded-[10px]`,children:(0,J.jsx)(Vn,{agent:e.agent,px:24,decorative:!0})}),(0,J.jsxs)(`h1`,{className:`m-0 text-[25px] font-semibold tracking-[-0.01em]`,children:[`What `,vr(a),` can use`]})]}),(0,J.jsxs)(`p`,{className:`mt-1 mb-6 text-sm leading-relaxed text-ink-2`,children:[t?`${t.title.replace(/\.$/,``)}.`:e.about,` Every tool it has, in the groups its session is given, and what it reaches from this project.`]}),r?(0,J.jsx)(`p`,{className:`m-0 text-sm text-fail`,children:r}):t?(0,J.jsxs)(`div`,{className:`flex flex-col gap-6`,children:[(0,J.jsxs)(`section`,{"aria-labelledby":`all-tools`,className:`flex flex-col gap-2`,children:[(0,J.jsx)(`h2`,{id:`all-tools`,className:`m-0 text-[13px] font-semibold text-muted`,children:`Tools it can use`}),(0,J.jsx)(dw,{view:t,openAll:!0})]}),t.connections.length>0&&(0,J.jsxs)(`section`,{"aria-labelledby":`all-connected`,className:`flex flex-col gap-2`,children:[(0,J.jsx)(`h2`,{id:`all-connected`,className:`m-0 text-[13px] font-semibold text-muted`,children:`Connected to`}),(0,J.jsx)(lw,{list:t.connections})]})]}):(0,J.jsx)(`p`,{className:`m-0 text-sm text-muted`,children:`Reading its tools…`})]})]})}function dw({view:e,limit:t,more:n,openAll:r}){let[i,a]=(0,q.useState)(()=>r?e.groups.map(e=>e.id):[]),o=t?e.groups.slice(0,t):e.groups,s=e.groups.reduce((e,t)=>e+t.tools.length,0),c=e.groups.filter(e=>e.on).length;return(0,J.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,J.jsxs)(`p`,{className:`m-0 text-[13px] text-muted`,children:[c,` of `,e.groups.length,` `,e.groups.length===1?`group`:`groups`,` usable here.`]}),(0,J.jsx)(`ul`,{className:`m-0 flex list-none flex-col rounded-[12px] card border p-0`,children:o.map((e,n)=>{let r=i.includes(e.id);return(0,J.jsxs)(`li`,{className:L(n>0&&`border-t border-line-soft`),children:[(0,J.jsxs)(`button`,{type:`button`,"aria-expanded":r,"aria-controls":`tools-${n}`,disabled:!e.tools.length,onClick:()=>a(r?i.filter(t=>t!==e.id):[...i,e.id]),className:`flex w-full cursor-pointer items-center gap-4 border-0 bg-transparent px-4 py-2 text-left text-ink disabled:cursor-default`,children:[e.on?(0,J.jsx)(O,{size:16,"aria-label":`Usable`,className:`flex-none text-pass`}):(0,J.jsx)(w,{size:16,"aria-label":`Not usable here`,className:`flex-none text-muted`}),(0,J.jsxs)(`span`,{className:`flex min-w-0 flex-1 flex-col`,children:[(0,J.jsxs)(`span`,{className:`text-[13px] font-medium`,children:[e.label,e.tools.length>0&&(0,J.jsxs)(`span`,{className:`font-normal text-muted`,children:[` · `,e.tools.length]})]}),(0,J.jsx)(`span`,{className:L(`text-[13px] text-muted`,t&&`truncate`),children:e.on?[e.about,e.limited].filter(Boolean).join(` · `):`Not here: ${e.why||`not set up`}`})]}),e.tools.length>0&&(0,J.jsx)(M,{size:16,"aria-hidden":`true`,className:L(`flex-none text-muted transition-transform duration-200`,r&&`rotate-90`)})]}),(0,J.jsx)(kn,{open:r,id:`tools-${n}`,children:(0,J.jsx)(`ul`,{className:`m-0 flex list-none flex-wrap gap-2 px-4 pb-4 pl-10`,children:e.tools.map(e=>(0,J.jsxs)(`li`,{"data-tip":e.what||void 0,className:`rounded-[6px] bg-surface-strong px-2 py-1 font-mono text-[13px] text-ink-2`,children:[e.name,e.what&&(0,J.jsx)(`span`,{className:`ml-2 font-sans text-muted`,children:e.what})]},e.name))})})]},e.id)})}),n&&(o.length<e.groups.length||s>0)&&(0,J.jsx)(`a`,{href:n,className:`self-start text-[13px]`,children:o.length<e.groups.length?`Show all ${e.groups.length} groups and ${s} tools`:`Show every tool (${s})`})]})}function fw({name:e,chats:t}){return(0,J.jsx)(`div`,{className:`@container rounded-[12px] card border`,children:(0,J.jsx)(`ul`,{"aria-label":`Conversations with ${vr(e)}`,className:`m-0 flex list-none flex-col p-2`,children:t.map(e=>(0,J.jsx)(`li`,{children:(0,J.jsx)(qo,{c:e})},e.id))})})}function pw({page:e}){let[t,n]=(0,q.useState)(null),[r,i]=(0,q.useState)(``);(0,q.useEffect)(()=>{let t=!1;return mn.list().then(r=>!t&&n(Wo(Ur(e,r.chats))),e=>!t&&i(e.message)),()=>{t=!0}},[e]);let a=Ln(e.agent).name;return(0,J.jsxs)(`div`,{className:`flex min-h-(--screen) flex-col`,children:[(0,J.jsx)(ii,{}),(0,J.jsxs)(`main`,{className:hi,children:[(0,J.jsxs)(`a`,{href:B(`agents`,e.id),className:`mb-4 inline-flex items-center gap-2 text-sm`,children:[(0,J.jsx)(Se,{size:16,"aria-hidden":`true`}),a]}),(0,J.jsxs)(`div`,{className:`mb-1 flex items-center gap-4`,children:[(0,J.jsx)(`span`,{"aria-hidden":`true`,className:`theme-side inline-flex size-10 border border-line-soft flex-none items-center justify-center rounded-[10px]`,children:(0,J.jsx)(Vn,{agent:e.agent,px:24,decorative:!0})}),(0,J.jsxs)(`h1`,{className:`m-0 text-[25px] font-semibold tracking-[-0.01em]`,children:[`Conversations with `,vr(a)]})]}),(0,J.jsxs)(`p`,{className:`mt-1 mb-6 text-sm leading-relaxed text-ink-2`,children:[`Every chat started from `,vr(a),`'s page, newest first. Open one to read it or carry it on.`]}),r?(0,J.jsx)(`p`,{className:`m-0 text-sm text-fail`,children:r}):t?t.length===0?(0,J.jsxs)(nn,{className:`py-4`,children:[`No conversations with `,vr(a),` yet. `,(0,J.jsx)(`a`,{href:B(`agents`,e.id),children:`Ask it`}),` to start one.`]}):(0,J.jsx)(fw,{name:a,chats:t}):(0,J.jsx)(`p`,{role:`status`,className:`m-0 text-sm text-muted`,children:`Loading…`})]})]})}function mw({text:e,onRetry:t}){return(0,J.jsxs)(`div`,{role:`alert`,className:`flex flex-col items-start gap-4 rounded-[14px] bg-fail-soft px-4 py-4 text-sm text-fail`,children:[(0,J.jsx)(`span`,{className:`[overflow-wrap:anywhere]`,children:e}),t&&(0,J.jsxs)(V,{onClick:t,"data-tip":`Try again`,children:[(0,J.jsx)(se,{"aria-hidden":`true`}),`Retry`]})]})}var hw=[`pl-0`,`pl-0`,`pl-4`,`pl-8`,`pl-12`,`pl-16`,`pl-20`];function gw(){let[e,t]=(0,q.useState)(``),[n,r]=(0,q.useState)(!1),[i,a]=(0,q.useState)(!1),[o,s]=(0,q.useState)(``),[c,l]=(0,q.useState)(null),u=async()=>{let t=e.trim();if(t){a(!0),s(``);try{l({query:t,...await Ft.searchDocs(t,{reasoning:n})})}catch(e){s(e.message)}finally{a(!1)}}},d=c?.reasoning===`used`?`The model picked these sections.`:c?.reasoning===`cached`?`The model's earlier answer to this question, at no cost.`:c?.reasoning===`failed`?`The model gave no answer, so these are found by their words.`:`Found by their words.`;return(0,J.jsxs)(`section`,{"aria-labelledby":`ask-docs-title`,className:`mb-6`,children:[(0,J.jsx)(`h2`,{id:`ask-docs-title`,className:`sr-only`,children:`Ask the documents`}),(0,J.jsxs)(`form`,{role:`search`,"aria-label":`Ask the documents`,className:`flex flex-wrap items-center gap-x-4 gap-y-2`,onSubmit:e=>{e.preventDefault(),u()},children:[(0,J.jsx)(en,{id:`ask-docs`,label:`Ask the documents`,value:e,onChange:t,placeholder:`refund limit for card payments`,className:`max-w-none flex-[1_1_320px]`}),(0,J.jsxs)(`span`,{className:`flex items-center gap-2 text-sm`,children:[(0,J.jsx)(si,{checked:n,onChange:r,label:`Let the model pick sections`}),`Let the model pick sections`]}),(0,J.jsxs)(V,{size:`sm`,type:`submit`,disabled:i||!e.trim(),children:[(0,J.jsx)(_e,{"aria-hidden":`true`}),i?`Searching…`:`Search`]})]}),o&&(0,J.jsx)(`div`,{className:`mt-4`,children:(0,J.jsx)(mw,{text:o,onRetry:()=>void u()})}),(0,J.jsx)(`div`,{"aria-live":`polite`,children:c&&!o&&(0,J.jsxs)(J.Fragment,{children:[(0,J.jsx)(`p`,{role:`status`,className:`mt-4 mb-0 text-sm text-muted`,children:c.documents?c.hits.length?`${c.hits.length} ${c.hits.length===1?`passage`:`passages`} from ${c.documents} ${c.documents===1?`document`:`documents`}. ${d}`:`Nothing in ${c.documents} ${c.documents===1?`document`:`documents`} answers "${c.query}".`:`No documents to search yet: add a knowledge file below, or documents in Settings, Evidence.`}),!!c.hits.length&&(0,J.jsx)(`ul`,{"aria-label":`Passages found`,className:`m-0 mt-2 list-none p-0`,children:c.hits.map((e,t)=>(0,J.jsxs)(`li`,{className:`border-t border-line-soft py-2 text-sm [overflow-wrap:anywhere]`,children:[(0,J.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,J.jsx)(`span`,{className:`font-medium text-ink`,children:e.where}),e.picked&&(0,J.jsx)(z,{tone:`pass`,children:`Picked by the model`})]}),(0,J.jsxs)(`span`,{className:`mt-1 block font-mono text-[13px] text-muted`,children:[e.source,`/`,e.file,`:`,e.line]}),(0,J.jsx)(ea,{text:e.text,className:`mt-2 text-sm`})]},`${e.source}/${e.file}:${e.line}:${t}`))})]})})]})}function _w({sub:e}){let t=$n(`knowledge-agent`),n=(e||``).split(`/`)[0]===`notes`?`notes`:kx,[r,i]=(0,q.useState)(null),[a,o]=(0,q.useState)(``),[s,c]=(0,q.useState)(null),[l,u]=(0,q.useState)(!1),[d,p]=(0,q.useState)(``),[m,h]=(0,q.useState)(``),[g,_]=(0,q.useState)(`read`),[v,y]=(0,q.useState)(null),[b,x]=(0,q.useState)(!1),[S,C]=(0,q.useState)(``),[w,T]=(0,q.useState)(null),E=()=>{p(``),_(`edit`),c({rel:``,text:`#
49
-
50
- ## Rules
51
-
52
- -
53
- `,was:``,isNew:!0})},D=(0,q.useCallback)(()=>{o(``),Ft.knowledge().then(i,e=>o(e.message)),Ft.docsStatus().then(y,()=>y(null))},[]),O=async()=>{x(!0),h(``),C(``);try{let e=await Ft.indexDocs();y(e),h(`Indexed ${e.documents} ${e.documents===1?`document`:`documents`}, ${e.sections.toLocaleString()} sections.${e.waiting?` ${e.waiting} PDF, Word or Excel ${e.waiting===1?`file has`:`files have`} no text that could be read.`:``}`)}catch(e){C(e.message)}finally{x(!1)}},ee=async e=>{if(_(`outline`),!(w?.rel===e&&w.outline)){T({rel:e});try{T({rel:e,outline:await Ft.docOutline(e)})}catch(t){T({rel:e,error:t.message})}}};(0,q.useEffect)(D,[D]);let te=async e=>{p(``);try{let t=await Ft.knowledgeFile(e);c({rel:e,text:t.text,was:t.text,isNew:!1}),_(`read`)}catch(e){o(e.message)}},ne=async()=>{if(s){u(!0),p(``);try{let e=s.rel.trim();await Ft.saveKnowledgeFile(e,s.text),c(null),h(`Saved ${e}. Agents read it from their next request.`),D()}catch(e){p(e.message)}finally{u(!1)}}},M=r?.files.filter(e=>e.used).length??0;return(0,J.jsxs)(Ax,{title:Wn(`knowledge`),page:t,label:`Knowledge`,current:n,onPick:e=>location.hash=e===`agent`?B(`knowledge`):B(`knowledge`,e),tabs:[{id:`notes`,label:r?`Notes (${r.files.length})`:`Notes`}],below:(0,J.jsx)(aw,{page:t}),children:[(0,J.jsxs)(`p`,{className:`m-0 text-sm leading-relaxed text-ink-2`,children:[`What the agents know about your product: its features, business rules and terms, as Markdown files in`,` `,(0,J.jsx)(`span`,{className:`font-mono text-[13px]`,children:r?.dir||`.forgeqe/knowledge`}),`. Each agent reads the parts that match its task. The industry and regulations are in`,` `,(0,J.jsx)(`a`,{href:B(`settings`,`evidence`),children:`Settings, Evidence`}),`, and the folders in `,(0,J.jsx)(`a`,{href:B(`settings`,`agents`),children:`Settings, Agents`}),`.`]}),a&&(0,J.jsx)(mw,{text:a,onRetry:D}),!r&&!a&&(0,J.jsx)(`p`,{role:`status`,className:`m-0 text-sm text-muted`,children:`Loading…`}),r&&(0,J.jsxs)(J.Fragment,{children:[(0,J.jsxs)(Yr,{label:`Knowledge files`,className:`mb-6`,children:[(0,J.jsx)(di,{icon:xe,label:`Files`,value:String(r.files.length)}),(0,J.jsx)(di,{icon:Te,label:`Read by agents`,value:String(M),note:M<r.files.length?`The others are templates still to fill in`:void 0}),(0,J.jsx)(di,{icon:j,label:`Per browser run`,value:r.maxChars?`${r.maxChars.toLocaleString()}`:`Off`,note:r.maxChars?`characters at most`:void 0}),(0,J.jsx)(di,{icon:_e,label:`Document sections`,value:v?v.sections.toLocaleString():`–`,note:v?`In ${v.documents} ${v.documents===1?`document`:`documents`}${v.waiting?`; ${v.waiting} PDF, Word or Excel ${v.waiting===1?`file is`:`files are`} not read yet`:``}`:void 0})]}),(0,J.jsx)(gw,{}),(0,J.jsx)(`div`,{"aria-live":`polite`,children:m&&(0,J.jsx)(`p`,{className:`mt-0 mb-4 rounded-[12px] bg-pass-soft px-4 py-2 text-sm text-pass`,children:m})}),S&&(0,J.jsx)(`div`,{className:`mb-4`,children:(0,J.jsx)(mw,{text:S,onRetry:()=>void O()})}),(0,J.jsxs)(`div`,{className:`mb-4 flex flex-wrap items-center gap-2`,children:[(0,J.jsx)(`span`,{className:`flex-1 text-sm text-muted`,children:`Open a file to read it; a template is a starting point for you to fill in.`}),v&&(0,J.jsxs)(V,{onClick:()=>void O(),disabled:b||v.indexing,"data-tip":`Reads the PDF, Word and Excel files of your documents so they can be searched. It can take a few minutes.`,children:[(0,J.jsx)(f,{"aria-hidden":`true`}),b||v.indexing?`Indexing…`:`Index PDFs, Word and Excel`]}),(0,J.jsxs)(V,{variant:`primary`,onClick:E,"data-tip":`Add a file`,children:[(0,J.jsx)(k,{"aria-hidden":`true`}),`Add`]})]}),(0,J.jsx)(Sr,{label:`Knowledge files`,placeholder:`Find a file`,empty:`No knowledge files yet. Add one for each product area: what it does, its rules, its words.`,head:(0,J.jsxs)(J.Fragment,{children:[(0,J.jsx)(`th`,{className:`px-4 py-2 text-left text-[13px] font-medium whitespace-nowrap text-muted`,children:`File`}),(0,J.jsx)(`th`,{className:L(`px-4 py-2 text-left text-[13px] font-medium whitespace-nowrap text-muted`,`text-right`),children:`Status`})]}),children:r.files.map(e=>(0,J.jsxs)(`tr`,{onClick:()=>void te(e.rel),className:`cursor-pointer border-t border-line-soft align-top hover:bg-surface-muted`,children:[(0,J.jsxs)(`td`,{className:`px-4 py-2`,children:[(0,J.jsxs)(`button`,{type:`button`,onClick:t=>(t.stopPropagation(),void te(e.rel)),className:`flex cursor-pointer items-center gap-2 border-0 bg-transparent p-0 text-left`,children:[(0,J.jsx)(Zt,{icon:xe,size:16,className:`flex-none text-muted`}),(0,J.jsx)(`span`,{className:`font-medium text-ink hover:underline [overflow-wrap:anywhere]`,children:e.title})]}),(0,J.jsx)(`span`,{className:`mt-1 block pl-6 font-mono text-[13px] text-muted [overflow-wrap:anywhere]`,children:e.rel})]}),(0,J.jsx)(`td`,{className:L(`px-4 py-2`,`w-[1%] text-right whitespace-nowrap`),children:(0,J.jsx)(z,{tone:e.used?`pass`:`neutral`,icon:!!e.used,children:e.used?e.state===`edited`?`Filled in`:`Read by agents`:`Template: fill it in`})})]},e.rel))})]}),(0,J.jsx)(yr,{wide:!0,open:!!s,onClose:()=>c(null),title:s?.isNew?`Add a knowledge file`:r?.files.find(e=>e.rel===s?.rel)?.title||s?.rel||``,description:s?.isNew?`Markdown. Headings split it into parts; an agent gets the parts that match its task. Never put passwords or keys here.`:s?.rel,footer:(0,J.jsxs)(J.Fragment,{children:[d&&(0,J.jsx)(`span`,{role:`alert`,className:`mr-auto self-center text-sm text-fail [overflow-wrap:anywhere]`,children:d}),(0,J.jsxs)(V,{onClick:()=>c(null),children:[(0,J.jsx)(A,{"aria-hidden":`true`}),`Cancel`]}),(0,J.jsxs)(V,{variant:`primary`,disabled:l||!s||!s.rel.trim()||!s.isNew&&s.text===s.was,onClick:()=>void ne(),children:[(0,J.jsx)(dt,{"aria-hidden":`true`}),l?`Saving…`:`Save`]})]}),children:s&&(0,J.jsxs)(`div`,{className:`flex flex-col gap-4 pt-4`,children:[s.isNew&&(0,J.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,J.jsx)(`label`,{htmlFor:`knowledge-name`,className:`font-medium`,children:`File name`}),(0,J.jsx)(R,{id:`knowledge-name`,value:s.rel,spellCheck:!1,placeholder:`products/checkout.md`,className:`font-mono`,onChange:e=>c({...s,rel:e.target.value})}),(0,J.jsx)(`span`,{className:`text-sm text-muted`,children:`In the knowledge folder; a folder before the name groups files.`})]}),!s.isNew&&(0,J.jsx)(mi,{label:`Show the file`,value:g,onChange:e=>e===`outline`?void ee(s.rel):_(e),options:[{id:`read`,label:`Read`},{id:`edit`,label:`Edit`},{id:`outline`,label:`Outline`}]}),g===`outline`&&!s.isNew?(0,J.jsxs)(`div`,{"aria-live":`polite`,children:[w?.error&&(0,J.jsx)(mw,{text:w.error,onRetry:()=>void ee(s.rel)}),!w?.outline&&!w?.error&&(0,J.jsx)(`p`,{role:`status`,className:`m-0 text-sm text-muted`,children:`Loading…`}),w?.outline&&(0,J.jsxs)(J.Fragment,{children:[(0,J.jsx)(`p`,{className:`mt-0 mb-2 text-sm text-muted`,children:`The parts an agent can be given on their own: each heading starts one.`}),(0,J.jsx)(`ul`,{"aria-label":`Sections`,className:`m-0 list-none p-0`,children:w.outline.sections.map(e=>(0,J.jsxs)(`li`,{className:L(`flex items-baseline gap-2 border-t border-line-soft py-2 text-sm`,hw[Math.min(6,e.depth)]),children:[(0,J.jsx)(`span`,{className:`text-ink [overflow-wrap:anywhere]`,children:e.title}),(0,J.jsxs)(`span`,{className:`font-mono text-[13px] text-muted`,children:[`line `,e.line]})]},`${e.line}:${e.title}`))})]})]}):g===`read`&&!s.isNew?(0,J.jsx)(ea,{text:s.text,className:`text-[16px]`}):(0,J.jsxs)(J.Fragment,{children:[(0,J.jsx)(`label`,{htmlFor:`knowledge-text`,className:`sr-only`,children:`Text`}),(0,J.jsx)(Ro,{id:`knowledge-text`,value:s.text,lang:`markdown`,onChange:e=>c({...s,text:e})}),(0,J.jsx)(`span`,{className:`text-[13px] text-muted`,children:`Markdown. Headings split it into parts; an agent gets the parts that match its task. Never put passwords or keys here.`})]})]})})]})}var vw=``;function yw(e){let t=e?Date.parse(e):NaN;if(Number.isNaN(t))return``;let n=(Date.now()-t)/1e3;return n<3600?`${Math.max(1,Math.floor(n/60))} min ago`:n<86400?`${Math.floor(n/3600)} h ago`:n<604800?`${Math.floor(n/86400)} d ago`:new Date(t).toLocaleDateString([],{day:`numeric`,month:`short`})}var bw=e=>!!e.lastStatus&&/pass|success|complete/i.test(e.lastStatus),xw=e=>e.successes===0?`never`:e.lastStatus&&!bw(e)?`failing`:e.replays>0?`replaying`:`ok`,Sw=e=>e||`Other`;function Cw({view:e}){let t=e.stats.areas.find(e=>e.area===`browser`),n=(t?.replayedSteps??0)+(t?.modelSteps??0),r=n?Math.round((t?.replayedSteps??0)/n*100):0,i=new Set([...e.flows.map(e=>Sw(e.host)),...e.pages.map(e=>Sw(e.host))]).size,a=e.flows.reduce((e,t)=>e+t.replays,0);return(0,J.jsxs)(Yr,{label:`Memory`,className:`mb-6`,children:[(0,J.jsx)(di,{icon:o,label:`Flows`,value:String(e.flows.length),note:`tasks it can replay`}),(0,J.jsx)(di,{icon:nt,label:`Pages`,value:String(e.pages.length),note:`with the elements found on them`}),(0,J.jsx)(di,{icon:j,label:`Sites`,value:String(i)}),(0,J.jsx)(di,{icon:g,label:`Steps from memory`,value:n?`${r}%`:`—`,note:n?`of recent runs, ${kt(a,`replay`)}`:`no run has used it yet`})]})}var ww={never:{label:`Never passed`,tone:`fail`},failing:{label:`Failed last time`,tone:`fail`},replaying:{label:`Replaying`,tone:`pass`},ok:{label:`Learned`,tone:`neutral`}},Tw=e=>e.replayedSteps+e.modelSteps?`${Math.round(e.replayedSteps/(e.replayedSteps+e.modelSteps)*100)}%`:`—`;function Ew({f:e,showSite:t,onOpen:n}){let r=ww[xw(e)];return(0,J.jsxs)(`tr`,{onClick:n,className:`cursor-pointer border-t border-line-soft align-top hover:bg-surface-muted`,children:[(0,J.jsxs)(`td`,{className:Er,children:[(0,J.jsx)(`button`,{type:`button`,onClick:e=>(e.stopPropagation(),n()),className:`cursor-pointer border-0 bg-transparent p-0 text-left text-[13px] text-ink hover:underline`,children:(0,J.jsx)(`span`,{className:`line-clamp-2`,children:e.goal})}),(0,J.jsxs)(`span`,{className:`mt-1 block text-[13px] text-muted`,children:[kt(e.steps,`step`),` · passed `,e.successes,` of `,e.runs]})]}),t&&(0,J.jsx)(`td`,{className:L(`px-4 py-2`,`hidden max-w-[200px] truncate text-[13px] text-muted @3xl:table-cell`),children:Sw(e.host)}),(0,J.jsx)(`td`,{className:L(Er,`w-[1%] whitespace-nowrap`),children:(0,J.jsx)(z,{tone:r.tone,icon:r.tone!==`neutral`,children:r.label})}),(0,J.jsx)(`td`,{className:L(ar,`hidden @2xl:table-cell`),children:Tw(e)}),(0,J.jsx)(`td`,{className:L(ar,`text-muted`),children:yw(e.lastRun)})]})}function Dw({p:e,showSite:t,forget:n}){return(0,J.jsxs)(`tr`,{className:_i,children:[(0,J.jsxs)(`td`,{className:Er,children:[(0,J.jsx)(`span`,{className:`block text-[13px] text-ink`,children:e.title||e.path}),(0,J.jsx)(`span`,{className:`block truncate font-mono text-[13px] text-muted`,"data-tip":`${e.host}${e.path}`,children:e.path})]}),t&&(0,J.jsx)(`td`,{className:L(`px-4 py-2`,`hidden max-w-[200px] truncate text-[13px] text-muted @3xl:table-cell`),children:Sw(e.host)}),(0,J.jsx)(`td`,{className:ar,children:e.elements}),(0,J.jsx)(`td`,{className:L(ar,`hidden @2xl:table-cell`),children:e.visits}),(0,J.jsx)(`td`,{className:L(ar,`text-muted`),children:yw(e.lastSeen)}),(0,J.jsx)(`td`,{className:L(Er,`w-[1%] text-right whitespace-nowrap`),children:n})]})}function Ow({view:e,target:t,files:n,label:r,question:i,done:a,icon:o,onCleared:s}){let[c,l]=(0,q.useState)(!1),[u,d]=(0,q.useState)(!1);if((0,q.useEffect)(()=>l(!1),[t?.name]),!n)return null;let f=async()=>{d(!0);try{let e=await Ft.clearMemory(t);s(e,`Removed ${kt(e.removed??0,`file`)} of memory${a}. The next runs learn it again.`)}catch(t){s(e,t.message)}finally{d(!1),l(!1)}};return c?(0,J.jsxs)(`span`,{role:`alertdialog`,"aria-label":r,className:L(`inline-flex flex-wrap items-center gap-2 rounded-[10px] border border-fail bg-fail-soft px-4 py-2 text-left text-[13px] text-ink`,o&&`w-[240px] whitespace-normal [overflow-wrap:anywhere]`),children:[i,(0,J.jsxs)(V,{variant:`destructive`,size:`sm`,disabled:u,onClick:()=>void f(),children:[(0,J.jsx)(Ie,{"aria-hidden":`true`}),t?.kind===`flow`||t?.kind===`page`?`Forget`:`Clear`]}),(0,J.jsxs)(V,{size:`sm`,onClick:()=>l(!1),children:[(0,J.jsx)(dt,{"aria-hidden":`true`}),`Keep`]})]}):o?(0,J.jsx)(V,{size:`icon`,variant:`icon`,"aria-label":r,"data-tip":r,onClick:()=>l(!0),className:`size-8`,children:(0,J.jsx)(Ie,{"aria-hidden":`true`})}):(0,J.jsxs)(V,{variant:`danger`,size:`sm`,onClick:()=>l(!0),"data-tip":r,children:[(0,J.jsx)(Ie,{"aria-hidden":`true`}),t?.kind===`flow`||t?.kind===`page`?`Forget`:`Clear`]})}function kw(){let[e,t]=(0,q.useState)(null),[n,i]=(0,q.useState)(``),[a,o]=(0,q.useState)(vw),[s,c]=(0,q.useState)(`flows`),[l,u]=(0,q.useState)(`all`),[d,f]=(0,q.useState)(``),[p,m]=(0,q.useState)(null),[h,g]=(0,q.useState)(``),_=(0,q.useCallback)(()=>{i(``),Ft.memory().then(t,e=>i(e.message))},[]);(0,q.useEffect)(_,[_]);let v=(0,q.useMemo)(()=>{let t=new Map,n=e=>t.get(Sw(e))??t.set(Sw(e),{flows:0,pages:0,failing:0}).get(Sw(e));for(let t of e?.flows||[]){let e=n(t.host);e.flows++,(xw(t)===`failing`||xw(t)===`never`)&&e.failing++}for(let t of e?.pages||[])n(t.host).pages++;for(let t of e?.targets||[])n(t.name);return[...t.entries()].map(([e,t])=>({name:e,...t})).sort((e,t)=>t.flows+t.pages-(e.flows+e.pages))},[e]),y=a?e?.targets.find(e=>e.name===a):void 0,x=(e,n)=>{t({...e}),g(n)},S=d.toLowerCase().split(/\s+/).filter(Boolean),C=(0,q.useMemo)(()=>(e?.flows||[]).filter(e=>(!a||Sw(e.host)===a)&&(l===`all`||xw(e)===l)&&S.every(t=>`${e.goal} ${e.host||``}`.toLowerCase().includes(t))).sort((e,t)=>(Date.parse(t.lastRun||``)||0)-(Date.parse(e.lastRun||``)||0)),[e,a,l,d]),w=(0,q.useMemo)(()=>(e?.pages||[]).filter(e=>(!a||Sw(e.host)===a)&&S.every(t=>`${e.title||``} ${e.path} ${e.host}`.toLowerCase().includes(t))).sort((e,t)=>(Date.parse(t.lastSeen||``)||0)-(Date.parse(e.lastSeen||``)||0)),[e,a,d]),T=(0,q.useMemo)(()=>{let t={all:0,replaying:0,failing:0,never:0};for(let n of e?.flows||[]){if(a&&Sw(n.host)!==a)continue;t.all++;let e=xw(n);e!==`ok`&&t[e]++}return t},[e,a]);return(0,J.jsxs)(`div`,{className:`flex min-h-(--screen) flex-col`,children:[(0,J.jsx)(ii,{}),(0,J.jsxs)(`main`,{className:L(hi,`@container`),children:[(0,J.jsx)(Xa,{className:`mb-2`}),(0,J.jsxs)(`div`,{className:`mb-1 flex flex-wrap items-center gap-4`,children:[(0,J.jsx)(Pr,{pixel:Nr.memory,size:`lg`}),(0,J.jsx)(`h1`,{className:`m-0 flex-1 text-[25px] font-semibold tracking-[-0.01em]`,children:`Memory`}),(0,J.jsxs)(`a`,{href:B(`settings`,`runs`),className:L(Ct({size:`sm`,variant:`ghost`}),`gap-2`),"data-tip":`Memory settings`,children:[(0,J.jsx)(b,{"aria-hidden":`true`}),`Settings`]})]}),(0,J.jsxs)(`p`,{className:`mt-1 mb-6 text-sm leading-relaxed text-ink-2`,children:[`What ForgeQE learned from runs that passed, so the next run of the same task is faster and cheaper. A `,(0,J.jsx)(`b`,{className:`font-medium text-ink-2`,children:`flow`}),` is a task's steps, replayed without the AI; a `,(0,J.jsx)(`b`,{className:`font-medium text-ink-2`,children:`page`}),` keeps the elements found on it.`]}),n&&(0,J.jsxs)(`div`,{role:`alert`,className:`flex flex-col items-start gap-4 rounded-[14px] bg-fail-soft px-4 py-4 text-sm text-fail`,children:[n,(0,J.jsxs)(V,{onClick:_,"data-tip":`Try again`,children:[(0,J.jsx)(se,{"aria-hidden":`true`}),`Retry`]})]}),!e&&!n&&(0,J.jsx)(`p`,{className:`m-0 text-sm text-muted`,children:`Loading…`}),e&&(0,J.jsxs)(J.Fragment,{children:[!e.enabled&&(0,J.jsxs)(`p`,{className:`mt-0 mb-4 rounded-[12px] bg-warn-soft px-4 py-4 text-sm text-warn`,children:[`Memory is off for this project: runs neither use nor add to it. Turn it on in `,(0,J.jsx)(`a`,{href:B(`settings`,`runs`),children:`Memory settings`}),`.`]}),(0,J.jsx)(Cw,{view:e}),h&&(0,J.jsx)(`p`,{role:`status`,className:`mt-0 mb-4 rounded-[10px] bg-surface-muted px-4 py-2 text-sm text-ink-2`,children:h}),e.flows.length+e.pages.length===0?(0,J.jsx)(nn,{icon:lt,title:`Nothing remembered yet`,action:(0,J.jsxs)(`a`,{className:Ct({size:`sm`}),href:B(),"data-tip":`Run something from Home`,children:[(0,J.jsx)(r,{"aria-hidden":`true`}),`Run`]}),children:`Each browser run that passes adds its pages and steps, and the next run of the same task replays them.`}):(0,J.jsxs)(`section`,{className:`flex min-w-0 flex-col gap-4`,children:[(0,J.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,J.jsx)(ai,{label:`What to show`,className:`mb-0`,current:s,onPick:c,tabs:[{id:`flows`,label:`Flows`,n:C.length},{id:`pages`,label:`Pages`,n:w.length}]}),(0,J.jsxs)(ln,{"aria-label":`Site`,value:a,onChange:e=>o(e.target.value),className:`w-auto max-w-[280px] min-w-[180px] flex-[0_1_240px]`,children:[(0,J.jsxs)(`option`,{value:vw,children:[`All sites (`,v.length,`)`]}),v.map(e=>(0,J.jsxs)(`option`,{value:e.name,children:[e.name,e.failing?` (${e.failing} failed)`:``]},e.name))]}),(0,J.jsx)(en,{id:`tab-flows-find-a-flow-fi`,label:s===`flows`?`Find a flow`:`Find a page`,value:d,onChange:f,placeholder:s===`flows`?`Find a flow by its task`:`Find a page by title or path`}),(0,J.jsx)(`span`,{className:`ml-auto`,children:(0,J.jsx)(Ow,{view:e,target:y,files:a?y?.files??0:e.files,label:a?`Clear this site`:`Clear everything`,question:`Remove ${kt(a?y?.files??0:e.files,`file`)} for ${a||`everything`}? Runs learn it again.`,done:y?` for ${y.name}`:``,onCleared:x})})]}),s===`flows`&&(0,J.jsx)(`div`,{className:`flex flex-wrap gap-2`,children:[[`all`,`All`],[`replaying`,`Replaying`],[`failing`,`Failed last time`],[`never`,`Never passed`]].map(([e,t])=>(0,J.jsxs)(`button`,{type:`button`,"aria-pressed":l===e,onClick:()=>u(e),className:L(`inline-flex min-h-7 cursor-pointer items-center gap-1 rounded-[8px] border px-2 text-[13px] font-medium`,l===e?`border-accent bg-accent-soft text-ink`:`border-transparent bg-surface-strong text-ink-2 hover:bg-line hover:text-ink`),children:[t,(0,J.jsx)(`span`,{className:L(`tabular-nums`,(e===`failing`||e===`never`)&&T[e]?`text-fail`:``),children:T[e]})]},e))}),(0,J.jsx)(`div`,{className:`@container`,children:s===`flows`?(0,J.jsx)(Sr,{label:`Flows`,search:!1,resetKey:`${a}|${l}|${d}`,empty:`Nothing matches.`,head:(0,J.jsxs)(J.Fragment,{children:[(0,J.jsx)(`th`,{className:`px-4 py-2 text-left text-[13px] font-medium whitespace-nowrap text-muted`,children:`Task`}),!a&&(0,J.jsx)(`th`,{className:L(`px-4 py-2 text-left text-[13px] font-medium whitespace-nowrap text-muted`,`hidden @3xl:table-cell`),children:`Site`}),(0,J.jsx)(`th`,{className:`px-4 py-2 text-left text-[13px] font-medium whitespace-nowrap text-muted`,children:`Status`}),(0,J.jsx)(`th`,{className:L(`px-4 py-2 text-right text-[13px] font-medium whitespace-nowrap text-muted`,`hidden @2xl:table-cell`),children:`Replayed`}),(0,J.jsx)(`th`,{className:`px-4 py-2 text-right text-[13px] font-medium whitespace-nowrap text-muted`,children:`Last run`})]}),children:C.map(e=>(0,J.jsx)(Ew,{f:e,showSite:!a,onOpen:()=>m(e)},e.id))}):(0,J.jsx)(Sr,{label:`Pages`,search:!1,resetKey:`${a}|${d}`,empty:`Nothing matches.`,head:(0,J.jsxs)(J.Fragment,{children:[(0,J.jsx)(`th`,{className:`px-4 py-2 text-left text-[13px] font-medium whitespace-nowrap text-muted`,children:`Page`}),!a&&(0,J.jsx)(`th`,{className:L(`px-4 py-2 text-left text-[13px] font-medium whitespace-nowrap text-muted`,`hidden @3xl:table-cell`),children:`Site`}),(0,J.jsx)(`th`,{className:`px-4 py-2 text-right text-[13px] font-medium whitespace-nowrap text-muted`,children:`Elements`}),(0,J.jsx)(`th`,{className:L(`px-4 py-2 text-right text-[13px] font-medium whitespace-nowrap text-muted`,`hidden @2xl:table-cell`),children:`Visits`}),(0,J.jsx)(`th`,{className:`px-4 py-2 text-right text-[13px] font-medium whitespace-nowrap text-muted`,children:`Last seen`}),(0,J.jsx)(`th`,{className:`px-4 py-2 text-left text-[13px] font-medium whitespace-nowrap text-muted`,children:(0,J.jsx)(`span`,{className:`sr-only`,children:`Forget`})})]}),children:w.map(t=>(0,J.jsx)(Dw,{p:t,showSite:!a,forget:(0,J.jsx)(Ow,{icon:!0,view:e,target:{name:t.id,kind:`page`},files:1,label:`Forget ${t.title||t.path}`,question:`Forget ${t.host}${t.path}? Runs find its elements again.`,done:` for ${t.host}${t.path}`,onCleared:x})},t.id))})})]})]})]}),(0,J.jsx)(yr,{open:!!p,onClose:()=>m(null),title:`Flow`,description:p?.host?`On ${p.host}`:`A task ForgeQE remembers`,footer:(0,J.jsxs)(V,{onClick:()=>m(null),children:[(0,J.jsx)(A,{"aria-hidden":`true`}),`Close`]}),children:p&&(0,J.jsxs)(`div`,{className:`flex flex-col gap-4 pt-4 text-sm`,children:[(0,J.jsx)(`p`,{className:`m-0 leading-relaxed whitespace-pre-wrap text-ink [overflow-wrap:anywhere]`,children:p.goal}),(0,J.jsxs)(`dl`,{className:`m-0 grid grid-cols-[auto_1fr] gap-x-4 gap-y-2`,children:[(0,J.jsx)(`dt`,{className:`text-muted`,children:`Steps`}),(0,J.jsx)(`dd`,{className:`m-0`,children:p.steps}),(0,J.jsx)(`dt`,{className:`text-muted`,children:`Runs`}),(0,J.jsxs)(`dd`,{className:`m-0`,children:[p.runs,`, `,p.successes,` passed, `,p.failures,` failed`]}),(0,J.jsx)(`dt`,{className:`text-muted`,children:`Replayed`}),(0,J.jsxs)(`dd`,{className:`m-0`,children:[kt(p.replays,`time`),`; `,p.replayedSteps,` of `,p.replayedSteps+p.modelSteps,` steps without a model`]}),(0,J.jsx)(`dt`,{className:`text-muted`,children:`Last run`}),(0,J.jsxs)(`dd`,{className:`m-0`,children:[p.lastRun?new Date(p.lastRun).toLocaleString([],{dateStyle:`medium`,timeStyle:`short`}):`—`,p.lastStatus?`, ${p.lastStatus}`:``]})]}),(0,J.jsx)(`p`,{className:`m-0 rounded-[10px] bg-surface-muted px-4 py-2 text-ink-2`,children:xw(p)===`never`?`It has not passed yet, so nothing replays: the next run of this task asks the model at each step.`:xw(p)===`failing`?`Its last run failed. The next run replays the steps that worked, then the agent takes over from where it went wrong.`:`The next run of this task replays its steps without a model, and the agent looks once to confirm the result.`}),e&&(0,J.jsx)(`div`,{className:`border-t border-line-soft pt-4`,children:(0,J.jsx)(Ow,{view:e,target:{name:p.id,kind:`flow`},files:1,label:`Forget this flow`,question:`Forget this flow? The next run of its task asks the model at each step and learns it again.`,done:` for this flow`,onCleared:(e,t)=>{x(e,t),e.flows.some(e=>e.id===p.id)||m(null)}})})]})})]})}var Aw=[];function jw({section:e}){return(0,J.jsxs)(`div`,{className:`flex min-h-(--screen) flex-col`,children:[(0,J.jsx)(ii,{}),(0,J.jsxs)(`main`,{className:L(hi,`gap-4`),children:[(0,J.jsx)(Xa,{}),(0,J.jsx)(`h1`,{className:`m-0 text-[25px] font-semibold tracking-[-0.01em]`,children:e.label}),(0,J.jsxs)(`p`,{className:`m-0 leading-relaxed text-ink-2`,children:[e.what,` are not in the web app yet. In a terminal in your project folder, run`,` `,(0,J.jsx)(`code`,{className:`rounded-md bg-surface-strong px-2 py-1 font-mono text-[13px]`,children:e.command}),`.`]})]})]})}function Mw({names:e,max:t=4}){let n=e.slice(0,t);return(0,J.jsxs)(`span`,{className:`flex min-w-0 flex-wrap items-center gap-x-2 gap-y-1`,children:[n.map(e=>(0,J.jsxs)(`span`,{className:`inline-flex items-center gap-1 text-[13px] text-ink-2`,"data-tip":Ln(e).name,children:[(0,J.jsx)(Vn,{agent:e,px:16,decorative:!0}),Ln(e).name]},e)),e.length>t&&(0,J.jsxs)(`span`,{className:`text-[13px] text-muted`,children:[`+`,e.length-t,` more`]}),!e.length&&(0,J.jsx)(`span`,{className:`text-[13px] text-muted`,children:`Not used by an agent`})]})}function Nw({p:e}){return(0,J.jsx)(`span`,{className:L(`rounded-full px-2 py-1 text-[13px] font-medium whitespace-nowrap`,e.outdated?`bg-warn-soft text-warn`:e.edited?`bg-accent-soft text-accent-fg`:`bg-surface-strong text-muted`),children:e.outdated?`Edited, older base`:e.edited?`Edited`:`ForgeQE's`})}function Pw(e){let t=/^---\r?\n[\s\S]*?\r?\n---[ \t]*(?:\r?\n|$)/.exec(e);return t?{head:t[0],body:e.slice(t[0].length)}:{head:``,body:e}}var Fw=e=>e.replace(/\{\{>\s*([\w-]+)\s*\}\}/g,`the shared part $1`);function Iw(e){return e.replace(/^[ \t]*\{\{>\s*([\w-]+)\s*\}\}[ \t]*$/gm,(e,t)=>`> Also includes ForgeQE's shared part: ${t}`)}function Lw({label:e,rows:t}){return(0,J.jsx)(`div`,{className:`@container`,children:(0,J.jsx)(Sr,{label:e,search:!1,empty:`No prompt matches.`,head:(0,J.jsxs)(J.Fragment,{children:[(0,J.jsx)(`th`,{className:Sn,children:`Prompt`}),(0,J.jsx)(`th`,{className:L(Sn,`hidden @2xl:table-cell`),children:`Used by`}),(0,J.jsx)(`th`,{className:L(Sn,`text-right`),children:`Status`})]}),children:t.map(e=>(0,J.jsxs)(`tr`,{onClick:e.onOpen,className:`cursor-pointer border-t border-line-soft align-top hover:bg-surface-muted`,children:[(0,J.jsxs)(`td`,{className:L(Er,`min-w-0`),children:[(0,J.jsxs)(`button`,{type:`button`,onClick:t=>(t.stopPropagation(),e.onOpen()),className:`flex cursor-pointer items-center gap-2 border-0 bg-transparent p-0 text-left`,children:[e.mark,(0,J.jsx)(`span`,{className:`font-mono text-[13px] font-medium text-ink hover:underline`,children:e.name})]}),(0,J.jsx)(`span`,{className:`mt-1 line-clamp-1 text-[13px] text-muted`,children:e.about})]}),(0,J.jsx)(`td`,{className:L(Er,`hidden w-[34%] @2xl:table-cell`),children:(0,J.jsx)(Mw,{names:e.agents,max:2})}),(0,J.jsx)(`td`,{className:L(Er,`w-[1%] text-right whitespace-nowrap`),children:e.state})]},e.key))})})}function Rw({p:e,onOpen:t,agents:n=!0}){return(0,J.jsxs)(`button`,{type:`button`,onClick:t,"aria-label":`Open ${e.name}`,className:`grid w-full cursor-pointer grid-cols-[auto_minmax(0,1fr)_auto] items-center gap-x-4 rounded-[10px] border-0 bg-transparent px-4 py-2 text-left hover:bg-surface-muted`,children:[(0,J.jsx)(Zt,{icon:xe,size:16,className:`text-muted`}),(0,J.jsxs)(`span`,{className:`flex min-w-0 flex-col gap-1`,children:[(0,J.jsx)(`span`,{className:`font-mono text-[13px] font-medium text-ink`,children:e.name}),(0,J.jsx)(`span`,{className:`truncate text-[13px] text-muted`,children:Fw(e.description||e.usedBy)}),n?(0,J.jsx)(Mw,{names:e.agents}):e.agents.length>1&&(0,J.jsxs)(`span`,{className:`text-[13px] text-muted`,children:[`Shared with `,kt(e.agents.length-1,`other agent`),`: editing it changes them too`]})]}),(0,J.jsx)(Nw,{p:e})]})}function zw({t:e,onOpen:t}){return(0,J.jsxs)(`button`,{type:`button`,onClick:t,"aria-label":`Edit ${e.name}`,className:`grid w-full cursor-pointer grid-cols-[auto_minmax(0,1fr)_auto] items-center gap-x-4 rounded-[10px] border-0 bg-transparent px-4 py-2 text-left hover:bg-surface-muted`,children:[(0,J.jsx)(F,{size:16,strokeWidth:1.8,"aria-hidden":`true`,className:`text-accent-fg`}),(0,J.jsxs)(`span`,{className:`flex min-w-0 flex-col gap-1`,children:[(0,J.jsx)(`span`,{className:`font-mono text-[13px] font-medium text-ink`,children:e.name}),(0,J.jsx)(`span`,{className:`truncate text-[13px] text-muted`,children:e.description||e.text.split(`
54
- `)[0]}),(0,J.jsx)(Mw,{names:e.agents})]}),(0,J.jsx)(`span`,{className:`rounded-full bg-pass-soft px-2 py-1 text-[13px] font-medium whitespace-nowrap text-pass`,children:`Yours`})]})}function Bw({onChanged:e}){let{data:t,error:n,reload:r}=Hn(It.prompts),[i,a]=(0,q.useState)(`all`),[o,s]=(0,q.useState)(``),[c,l]=(0,q.useState)(null),[u,d]=(0,q.useState)(``),[f,p]=(0,q.useState)(!1),[m,h]=(0,q.useState)(`read`),[g,_]=(0,q.useState)(null),[v,y]=(0,q.useState)(null),[b,x]=(0,q.useState)(!1),[S,C]=(0,q.useState)(``),w=o.toLowerCase().split(/\s+/).filter(Boolean),T=e=>w.every(t=>e.toLowerCase().includes(t)),E=(0,q.useMemo)(()=>(t?.prompts||[]).filter(e=>T(`${e.name} ${e.description} ${e.usedBy} ${e.agents.map(e=>Ln(e).name).join(` `)}`)),[t,o]),D=(0,q.useMemo)(()=>(t?.team||[]).filter(e=>T(`${e.name} ${e.description} ${e.text} ${e.agents.map(e=>Ln(e).name).join(` `)}`)),[t,o]),O=async t=>{C(``);try{let e=await It.prompt(t);l(e),d(e.text),p(!1),h(`read`)}catch(t){e(t.message)}},ee=async t=>{try{let e=await It.agentPrompt(t);y({agent:t,text:e.text})}catch(t){e(t.message)}},te=async(t,n,i)=>{x(!0),C(``);try{await t(),i(),r(),e(n)}catch(e){C(e.message)}finally{x(!1)}};if(!t)return(0,J.jsx)(fr,{error:n,reload:r});let ne=t.prompts.find(e=>e.name===c?.name),j=t.agents,M=[{id:`all`,label:`All prompts`,n:t.prompts.length},{id:`agents`,label:`By agent`,n:j.length},{id:`team`,label:`Your prompts`,n:t.team.length}];return(0,J.jsxs)(J.Fragment,{children:[(0,J.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2 pb-4`,children:[(0,J.jsx)(mi,{label:`Show`,value:i,onChange:a,options:M.map(e=>({id:e.id,label:e.label,n:e.n}))}),(0,J.jsx)(en,{id:`find-a-prompt`,label:`Find a prompt`,value:o,onChange:s,placeholder:`Find a prompt or agent`}),(0,J.jsxs)(V,{variant:`primary`,"data-tip":`Add a prompt`,onClick:()=>(C(``),_({name:``,description:``,agents:[],text:``})),children:[(0,J.jsx)(k,{"aria-hidden":`true`}),`Add`]})]}),i===`agents`&&(0,J.jsx)(`div`,{className:`flex flex-col gap-4`,children:j.filter(e=>E.some(t=>t.agents.includes(e.name))||D.some(t=>t.agents.includes(e.name))).map(e=>{let t=Ln(e.name),n=E.filter(t=>t.agents.includes(e.name)).sort((t,n)=>t.name===e.prompt?-1:n.name===e.prompt?1:t.name.localeCompare(n.name)),r=D.filter(t=>t.agents.includes(e.name));return(0,J.jsxs)(`section`,{"aria-labelledby":`agent-${e.name}`,className:`rounded-[14px] card border p-2`,children:[(0,J.jsxs)(`div`,{className:`flex flex-wrap items-center gap-4 px-4 py-2`,children:[(0,J.jsx)(Vn,{agent:e.name,px:28,decorative:!0}),(0,J.jsxs)(`span`,{className:`flex min-w-0 flex-1 flex-col`,children:[(0,J.jsx)(`h3`,{id:`agent-${e.name}`,className:`m-0 text-[16px] font-semibold`,style:{color:t.hue},children:t.name}),(0,J.jsx)(`span`,{className:`truncate text-[13px] text-muted`,children:e.title})]}),(0,J.jsxs)(`span`,{className:`text-[13px] text-muted`,children:[kt(n.length,`prompt`),r.length?` · ${r.length} yours`:``]}),(0,J.jsx)(V,{variant:`icon`,size:`icon-sm`,"aria-label":`Full prompt of ${t.name}`,"data-tip":`Full prompt of ${t.name}`,onClick:()=>ee(e.name),children:(0,J.jsx)(Qe,{"aria-hidden":`true`})})]}),(0,J.jsxs)(`div`,{className:`flex flex-col border-t border-line-soft pt-1`,children:[n.map(e=>(0,J.jsx)(Rw,{p:e,agents:!1,onOpen:()=>O(e.name)},e.name)),r.map(e=>(0,J.jsx)(zw,{t:e,onOpen:()=>(C(``),_({name:e.name,description:e.description,agents:e.agents,text:e.text,existing:e.name}))},e.name))]})]},e.name)})}),i===`all`&&(0,J.jsx)(Lw,{label:`All prompts`,rows:E.map(e=>({key:e.name,name:e.name,about:Fw(e.description||e.usedBy),agents:e.agents,state:(0,J.jsx)(Nw,{p:e}),onOpen:()=>O(e.name)}))}),i===`team`&&(t.team.length===0?(0,J.jsx)(nn,{icon:pe,title:`No prompts of your own yet`,action:(0,J.jsxs)(V,{size:`sm`,"data-tip":`Add a prompt`,onClick:()=>_({name:``,description:``,agents:[],text:``}),children:[(0,J.jsx)(k,{"aria-hidden":`true`}),`Add`]}),children:`Write instructions once for the agents that should follow them: "Tag every test with its Azure DevOps work item id" for Quill, or "Answer in British English" for Atlas. They are added at the end of those agents' instructions, saved in .forgeqe/prompts/team, and shared with the project.`}):(0,J.jsx)(Lw,{label:`Your prompts`,rows:D.map(e=>({key:e.name,name:e.name,about:e.description||e.text.split(`
55
- `)[0]||``,agents:e.agents,mark:(0,J.jsx)(F,{size:15,strokeWidth:1.8,"aria-hidden":`true`,className:`flex-none text-accent-fg`}),state:(0,J.jsx)(`span`,{className:`rounded-full bg-pass-soft px-2 py-1 text-[13px] font-medium whitespace-nowrap text-pass`,children:`Yours`}),onOpen:()=>(C(``),_({name:e.name,description:e.description,agents:e.agents,text:e.text,existing:e.name}))}))})),(0,J.jsx)(yr,{wide:!0,open:!!c,onClose:()=>l(null),title:c?.name||``,description:Fw(ne?.description||ne?.usedBy||``),footer:(0,J.jsxs)(J.Fragment,{children:[S&&(0,J.jsx)(`span`,{role:`alert`,className:`mr-auto self-center text-sm text-fail`,children:S}),ne?.edited&&ne.source===`project`&&(0,J.jsxs)(V,{disabled:b,onClick:()=>c&&te(()=>It.resetPrompt(c.name),`${c.name} is ForgeQE's own prompt again.`,()=>l(null)),className:`mr-auto`,"data-tip":`Reset to ForgeQE's own prompt`,children:[(0,J.jsx)(se,{"aria-hidden":`true`}),`Reset`]}),(0,J.jsxs)(V,{onClick:()=>l(null),children:[(0,J.jsx)(A,{"aria-hidden":`true`}),`Cancel`]}),(0,J.jsxs)(V,{variant:`primary`,disabled:b||!c||u===c.text,onClick:()=>c&&te(()=>It.savePrompt(c.name,u),`Saved your copy of ${c.name}.`,()=>l(null)),children:[(0,J.jsx)(dt,{"aria-hidden":`true`}),b?`Saving…`:`Save`]})]}),children:c&&(()=>{let{head:e,body:t}=Pw(u);return(0,J.jsxs)(`div`,{className:`flex flex-col gap-4 pt-4`,children:[(0,J.jsxs)(`dl`,{className:`m-0 grid grid-cols-[96px_minmax(0,1fr)] items-center gap-x-4 gap-y-2 text-sm`,children:[(0,J.jsx)(`dt`,{className:`text-muted`,children:`Used by`}),(0,J.jsx)(`dd`,{className:`m-0`,children:ne?(0,J.jsx)(Mw,{names:ne.agents,max:8}):null}),(0,J.jsx)(`dt`,{className:`text-muted`,children:`Status`}),(0,J.jsx)(`dd`,{className:`m-0`,children:ne?(0,J.jsx)(Nw,{p:ne}):null})]}),ne?.edited&&ne.source!==`project`&&(0,J.jsxs)(`p`,{className:`m-0 rounded-[10px] bg-surface-muted px-4 py-2 text-sm text-ink-2`,children:[`This prompt comes from a `,ne.source,` copy; saving here makes a project copy, which the shared folder still wins over.`]}),(0,J.jsxs)(`div`,{className:`flex flex-wrap items-center gap-4 border-t border-line-soft pt-4`,children:[(0,J.jsx)(mi,{label:`Show the prompt`,value:m,onChange:h,options:[{id:`read`,label:`Read`},{id:`edit`,label:`Edit`}]}),ne?.edited&&(0,J.jsxs)(`button`,{type:`button`,"aria-expanded":f,onClick:()=>p(!f),"data-tip":f?`Hide ForgeQE's original`:`Compare with ForgeQE's original`,className:`inline-flex min-h-10 cursor-pointer items-center gap-2 border-0 bg-transparent p-0 text-sm font-medium text-accent-fg hover:text-accent-fg-hover [&>svg]:size-4`,children:[f?(0,J.jsx)(Ue,{"aria-hidden":`true`}):(0,J.jsx)(et,{"aria-hidden":`true`}),f?`Hide`:`Compare`]})]}),(0,J.jsx)(kn,{open:f,children:(0,J.jsx)(`div`,{className:`max-h-[40vh] overflow-auto rounded-[12px] bg-surface-muted p-4`,children:(0,J.jsx)(ea,{text:Iw(Pw(c.builtin).body),className:`text-[13px]`})})}),m===`read`?(0,J.jsx)(ea,{text:Iw(t),className:`text-[16px]`}):(0,J.jsxs)(J.Fragment,{children:[(0,J.jsx)(`label`,{htmlFor:`prompt-text`,className:`sr-only`,children:`Prompt`}),(0,J.jsx)(Ro,{id:`prompt-text`,value:t,lang:`markdown`,onChange:t=>d(e+t)}),(0,J.jsxs)(`span`,{className:`text-[13px] text-muted`,children:[`Saved to `,(0,J.jsxs)(`span`,{className:`font-mono`,children:[`.forgeqe/prompts/`,c.name,`.md`]}),`; new chats and runs use it.`]})]})]})})()}),(0,J.jsx)(yr,{wide:!0,open:!!g,onClose:()=>_(null),title:g?.existing?`Edit ${g.existing}`:`Add a prompt`,description:(0,J.jsxs)(J.Fragment,{children:[`Added at the end of the chosen agents' instructions, from their next start. Saved in `,(0,J.jsxs)(`span`,{className:`font-mono text-[13px]`,children:[`.forgeqe/prompts/team/`,g?.name||`name`,`.md`]}),`, shared with the project.`]}),footer:(0,J.jsxs)(J.Fragment,{children:[S&&(0,J.jsx)(`span`,{role:`alert`,className:`mr-auto self-center text-sm text-fail [overflow-wrap:anywhere]`,children:S}),g?.existing&&(0,J.jsxs)(V,{disabled:b,onClick:()=>g.existing&&te(()=>It.deleteTeamPrompt(g.existing),`Removed ${g.existing}.`,()=>_(null)),className:`mr-auto text-fail`,children:[(0,J.jsx)(Ie,{"aria-hidden":`true`}),`Delete`]}),(0,J.jsxs)(V,{onClick:()=>_(null),children:[(0,J.jsx)(A,{"aria-hidden":`true`}),`Cancel`]}),(0,J.jsxs)(V,{variant:`primary`,disabled:b||!g?.name||!g.agents.length||!g.text.trim(),onClick:()=>g&&te(()=>g.existing?It.saveTeamPrompt(g.existing,g):It.addTeamPrompt(g),`${g.existing?`Saved`:`Added`} ${g.name}: ${g.agents.map(e=>Ln(e).name).join(`, `)} use it from their next start.`,()=>_(null)),children:[g?.existing?(0,J.jsx)(dt,{"aria-hidden":`true`}):(0,J.jsx)(k,{"aria-hidden":`true`}),b?`Saving…`:g?.existing?`Save`:`Add`]})]}),children:g&&(0,J.jsxs)(`div`,{className:`flex flex-col gap-4 pt-4`,children:[(0,J.jsxs)(`label`,{className:`flex flex-col gap-2`,children:[(0,J.jsx)(`span`,{className:`font-medium`,children:`Name`}),(0,J.jsx)(R,{value:g.name,disabled:!!g.existing,placeholder:`tag-tests-with-work-items`,onChange:e=>_({...g,name:e.target.value.toLowerCase().replace(/[^a-z0-9-]+/g,`-`).slice(0,48)}),className:`font-mono`}),(0,J.jsx)(`span`,{className:`text-[13px] text-muted`,children:`Lowercase letters, digits and dashes.`})]}),(0,J.jsxs)(`label`,{className:`flex flex-col gap-2`,children:[(0,J.jsx)(`span`,{className:`font-medium`,children:`What it is for`}),(0,J.jsx)(R,{value:g.description,maxLength:200,placeholder:`Tests carry the work item they cover`,onChange:e=>_({...g,description:e.target.value})})]}),(0,J.jsxs)(`fieldset`,{className:`m-0 flex flex-col gap-2 border-0 p-0`,children:[(0,J.jsx)(`legend`,{className:`mb-2 p-0 font-medium`,children:`Agents that follow it`}),(0,J.jsx)(`div`,{className:`flex flex-wrap gap-2`,children:j.map(e=>{let t=g.agents.includes(e.name);return(0,J.jsxs)(`button`,{type:`button`,role:`checkbox`,"aria-checked":t,"data-tip":e.title,onClick:()=>_({...g,agents:t?g.agents.filter(t=>t!==e.name):[...g.agents,e.name]}),className:L(`inline-flex min-h-9 cursor-pointer items-center gap-2 rounded-[8px] border px-4 text-[13px] font-medium`,t?`border-accent bg-accent-soft text-ink`:`border-transparent bg-surface-strong text-ink-2 hover:bg-line hover:text-ink`),children:[(0,J.jsx)(Vn,{agent:e.name,px:18,decorative:!0}),Ln(e.name).name]},e.name)})})]}),(0,J.jsxs)(`label`,{className:`flex flex-col gap-2`,children:[(0,J.jsx)(`span`,{className:`font-medium`,children:`Instructions`}),(0,J.jsx)(pn,{rows:14,spellCheck:!0,value:g.text,placeholder:`Tag every test with the Azure DevOps work item it covers, as [Property("WorkItem", "1234")].
56
- If the request names no work item, ask for it.`,onChange:e=>_({...g,text:e.target.value}),className:`leading-[1.6]`}),(0,J.jsx)(`span`,{className:`text-[13px] text-muted`,children:`Plain words, as you would tell a colleague. Use MUST for a rule the agent may never break.`})]})]})}),(0,J.jsx)(yr,{wide:!0,open:!!v,onClose:()=>y(null),title:v?`${Ln(v.agent).name}: full prompt`:``,description:`What the agent starts with now: ForgeQE's prompt (or your edited copy), with the included parts and your prompts for it.`,footer:(0,J.jsxs)(V,{onClick:()=>y(null),children:[(0,J.jsx)(A,{"aria-hidden":`true`}),`Close`]}),children:v&&(0,J.jsx)(ea,{text:Iw(Pw(v.text).body),className:`mt-4 text-[16px]`})})]})}var Vw={prebuilt:`ForgeQE's`,project:`This project`,user:`Yours`,external:`Claude / agent skill`,extra:`Shared folder`};function Hw({agents:e,max:t=6}){return(0,J.jsxs)(`span`,{className:`flex items-center -space-x-1`,children:[e.slice(0,t).map(e=>(0,J.jsx)(`span`,{role:`img`,"aria-label":Ln(e).name,"data-tip":Ln(e).name,className:`rounded-md bg-bg p-1 ring-1 ring-line-soft`,children:(0,J.jsx)(Vn,{agent:e,px:18,decorative:!0})},e)),e.length>t&&(0,J.jsxs)(`span`,{className:`pl-2 text-[13px] text-muted`,children:[`+`,e.length-t]})]})}function Uw({edit:e}){let{data:t,error:n,reload:r}=Hn(It.skills),i=Kr(e.value,[`skills`,`disable`])||[],a=t=>e.set(K(e.value,[`skills`,`disable`],t.length?t:void 0)),[o,s]=(0,q.useState)(`all`),[c,u]=(0,q.useState)(``),[d,f]=(0,q.useState)(!1),[p,m]=(0,q.useState)(null),[h,g]=(0,q.useState)([]),[_,v]=(0,q.useState)(null),[y,x]=(0,q.useState)(!1),[S,C]=(0,q.useState)(``),[w,T]=(0,q.useState)(``),E=c.toLowerCase().split(/\s+/).filter(Boolean),D=(0,q.useMemo)(()=>(t?.skills||[]).filter(e=>E.every(t=>`${e.name} ${e.description} ${e.users.map(e=>Ln(e).name).join(` `)}`.toLowerCase().includes(t))),[t,c]),O=async(e,t,n)=>{x(!0),C(``);try{await e(),n(),r(),T(t)}catch(e){C(e.message)}finally{x(!1)}},ee=async e=>{try{let t=await It.skill(e.name);m({name:e.name,text:t.text,editable:t.editable})}catch(e){T(e.message)}},te=(e,t)=>(g(t?[...h,t]:[]),ee(e)),ne=(e,t)=>{let n=t.replace(/^---\n[\s\S]*?\n---\n?/,``).trim();C(``),m(null),v({name:e.name,description:e.description,agents:e.agents,body:n,existing:e.name})},j=(e,t)=>{let n=t.replace(/^---\n[\s\S]*?\n---\n?/,``).trim();C(``),m(null),v({name:e.name,description:e.description,agents:e.agents,body:n,copyOf:e.name})},M=e=>t?.audiences.filter(t=>e.agents.includes(t.id)).map(e=>e.label).join(`, `)||``,N=e=>(0,J.jsx)(`span`,{className:L(`rounded-full px-2 py-px text-[13px] font-medium whitespace-nowrap`,e.source===`project`?`bg-pass-soft text-pass`:`bg-surface-strong text-muted`),children:Vw[e.source]||e.source}),ie=e=>{let t=!i.includes(e.name);return(0,J.jsx)(si,{checked:t,onChange:t=>a(t?i.filter(t=>t!==e.name):[...i,e.name]),label:`Use ${e.name}`})},ae=Kr(e.value,[`skills`,`enabled`])!==!1,oe=(e,n)=>{let r=!i.includes(e.name);return(0,J.jsxs)(`div`,{className:`grid grid-cols-[minmax(0,1fr)_auto] items-center gap-x-4 rounded-[10px] px-4 py-2 hover:bg-surface-muted`,children:[(0,J.jsxs)(`button`,{type:`button`,onClick:()=>te(e),"aria-label":`Read ${e.name}`,className:`flex min-w-0 cursor-pointer flex-col gap-1 border-0 bg-transparent p-0 text-left`,children:[(0,J.jsxs)(`span`,{className:`flex flex-wrap items-center gap-2`,children:[(0,J.jsx)(`span`,{className:L(`font-mono text-[13px] font-medium`,r?`text-ink`:`text-muted line-through`),children:e.name}),(0,J.jsx)(`span`,{className:L(`rounded-full px-2 py-px text-[13px] font-medium`,e.source===`project`?`bg-pass-soft text-pass`:`bg-surface-strong text-muted`),children:Vw[e.source]||e.source})]}),(0,J.jsx)(`span`,{className:`line-clamp-2 text-[13px] text-muted`,children:e.description}),n&&(0,J.jsxs)(`span`,{className:`flex flex-wrap items-center gap-2 pt-1`,children:[(0,J.jsx)(Hw,{agents:e.users}),(0,J.jsx)(`span`,{className:`text-[13px] text-muted`,children:t?.audiences.filter(t=>e.agents.includes(t.id)).map(e=>e.label).join(`, `)})]})]}),(0,J.jsx)(si,{checked:r,onChange:t=>a(t?i.filter(t=>t!==e.name):[...i,e.name]),label:`Use ${e.name}`})]},e.name)};return(0,J.jsxs)(J.Fragment,{children:[(0,J.jsxs)(`section`,{className:`mb-4 rounded-[14px] card border`,children:[(0,J.jsxs)(`button`,{type:`button`,"aria-expanded":d,onClick:()=>f(!d),className:`flex min-h-12 w-full cursor-pointer items-center gap-4 rounded-[14px] border-0 bg-transparent px-4 text-left hover:bg-surface-muted`,children:[(0,J.jsx)(b,{size:16,"aria-hidden":`true`,className:`text-muted`}),(0,J.jsx)(`span`,{className:`flex-1 text-sm font-medium`,children:`How skills are used`}),(0,J.jsxs)(`span`,{className:`text-[13px] text-muted`,children:[ae?`On`:`Off`,` · `,kt(i.length,`turned off`,`turned off`),` · `,String(Kr(e.value,[`skills`,`browser_max_chars`])??6e3),` characters a browser run`]}),(0,J.jsx)(l,{size:16,"aria-hidden":`true`,className:L(`text-muted transition-transform`,!d&&`-rotate-90`)})]}),(0,J.jsx)(kn,{open:d,children:(0,J.jsx)(`div`,{className:`border-t border-line-soft px-4 pb-2`,children:(0,J.jsx)(Dn,{defs:tr.fields,edit:e,base:tr.base})})})]}),t?(0,J.jsxs)(J.Fragment,{children:[(0,J.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2 pb-4`,children:[(0,J.jsx)(mi,{label:`Show`,value:o,onChange:s,options:[{id:`agents`,label:`By agent`,n:t.audiences.length},{id:`all`,label:`All skills`,n:t.skills.length}]}),(0,J.jsx)(en,{id:`find-a-skill`,label:`Find a skill`,value:c,onChange:u,placeholder:`Find a skill or agent`}),(0,J.jsxs)(V,{variant:`primary`,"data-tip":`Add a skill`,onClick:()=>(C(``),v({name:``,description:``,agents:[],body:``})),children:[(0,J.jsx)(k,{"aria-hidden":`true`}),`Add`]})]}),w&&(0,J.jsx)(`p`,{role:`status`,className:`m-0 mb-4 rounded-[10px] bg-surface-muted px-4 py-2 text-sm text-ink-2`,children:w}),t.skills.length===0&&(0,J.jsx)(Ci,{children:`No skills found. Add one for your framework, conventions or app.`}),o===`agents`&&t.audiences.map(e=>{let t=D.filter(t=>t.agents.includes(e.id));return!t.length&&E.length?null:(0,J.jsxs)(`section`,{"aria-labelledby":`aud-${e.id}`,className:`mb-4 rounded-[14px] card border p-2`,children:[(0,J.jsxs)(`div`,{className:`flex flex-wrap items-center gap-4 px-4 py-2`,children:[(0,J.jsx)(Hw,{agents:e.agents,max:8}),(0,J.jsxs)(`span`,{className:`flex min-w-0 flex-1 flex-col`,children:[(0,J.jsx)(`h3`,{id:`aud-${e.id}`,className:`m-0 text-[16px] font-semibold`,children:e.label}),(0,J.jsx)(`span`,{className:`truncate text-[13px] text-muted`,children:e.agents.map(e=>Ln(e).name).filter((e,t,n)=>n.indexOf(e)===t).join(`, `)})]}),(0,J.jsx)(`span`,{className:`text-[13px] text-muted`,children:kt(t.length,`skill`)})]}),(0,J.jsx)(`div`,{className:`flex flex-col border-t border-line-soft pt-1`,children:t.length?t.map(e=>oe(e,!1)):(0,J.jsx)(`p`,{className:`m-0 px-4 py-2 text-[13px] text-muted`,children:`No skills for them yet.`})})]},e.id)}),o===`all`&&t.skills.length>0&&(0,J.jsx)(`div`,{className:`@container`,children:(0,J.jsx)(Sr,{label:`All skills`,search:!1,empty:`No skill matches.`,head:(0,J.jsxs)(J.Fragment,{children:[(0,J.jsx)(`th`,{className:`px-4 py-2 text-left text-[13px] font-medium whitespace-nowrap text-muted`,children:`Skill`}),(0,J.jsx)(`th`,{className:L(`px-4 py-2 text-left text-[13px] font-medium whitespace-nowrap text-muted`,`hidden @2xl:table-cell`),children:`Who uses it`}),(0,J.jsx)(`th`,{className:L(`px-4 py-2 text-left text-[13px] font-medium whitespace-nowrap text-muted`,`hidden @xl:table-cell`),children:`From`}),(0,J.jsx)(`th`,{className:L(`px-4 py-2 text-left text-[13px] font-medium whitespace-nowrap text-muted`,`text-right`),children:`On`})]}),children:D.map(e=>{let t=!i.includes(e.name);return(0,J.jsxs)(`tr`,{onClick:()=>te(e),className:`cursor-pointer border-t border-line-soft align-top hover:bg-surface-muted`,children:[(0,J.jsxs)(`td`,{className:`px-4 py-2`,children:[(0,J.jsx)(`button`,{type:`button`,onClick:t=>(t.stopPropagation(),te(e)),className:L(`cursor-pointer border-0 bg-transparent p-0 text-left font-mono text-[13px] font-medium hover:underline`,t?`text-ink`:`text-muted line-through`),children:e.name}),(0,J.jsx)(`span`,{className:`mt-1 line-clamp-1 text-[13px] text-muted`,children:e.description})]}),(0,J.jsx)(`td`,{className:L(`px-4 py-2`,`hidden w-[30%] @2xl:table-cell`),children:(0,J.jsxs)(`span`,{className:`flex flex-wrap items-center gap-2`,children:[(0,J.jsx)(Hw,{agents:e.users,max:4}),(0,J.jsx)(`span`,{className:`text-[13px] text-muted`,children:M(e)})]})}),(0,J.jsx)(`td`,{className:L(`px-4 py-2`,`hidden w-[1%] @xl:table-cell`),children:N(e)}),(0,J.jsx)(`td`,{className:L(`px-4 py-2`,`w-[1%] text-right`),onClick:e=>e.stopPropagation(),children:ie(e)})]},e.name)})})}),t.problems.length?(0,J.jsx)(`div`,{role:`alert`,className:`mt-4 rounded-[12px] bg-warn-soft px-4 py-4 text-sm text-warn`,children:t.problems.map(e=>(0,J.jsx)(`p`,{className:`m-0`,children:e},e))}):null]}):(0,J.jsx)(fr,{error:n,reload:r}),(0,J.jsx)(yr,{wide:!0,open:!!p,onClose:()=>m(null),title:p?.name||``,description:p?.editable?`This project's own skill: you can edit it.`:`ForgeQE's skill: read only. Copy it to edit your own version for this project.`,footer:(0,J.jsxs)(J.Fragment,{children:[(0,J.jsxs)(V,{onClick:()=>m(null),children:[(0,J.jsx)(A,{"aria-hidden":`true`}),`Close`]}),p?.editable&&(0,J.jsxs)(V,{variant:`primary`,onClick:()=>p&&t&&ne(t.skills.find(e=>e.name===p.name),p.text),children:[(0,J.jsx)(re,{"aria-hidden":`true`}),`Edit`]}),p&&!p.editable&&(0,J.jsxs)(V,{variant:`primary`,"data-tip":`Your copy replaces this skill in this project`,onClick:()=>p&&t&&j(t.skills.find(e=>e.name===p.name),p.text),children:[(0,J.jsx)(I,{"aria-hidden":`true`}),`Copy to edit`]})]}),children:p&&t&&(()=>{let e=t.skills.find(e=>e.name===p.name),n=h[h.length-1],r=n?t.skills.find(e=>e.name===n):void 0;return(0,J.jsxs)(`div`,{className:`flex flex-col gap-4 pt-4`,children:[r&&(0,J.jsxs)(`button`,{type:`button`,onClick:()=>(g(h.slice(0,-1)),void ee(r)),"data-tip":`Back to ${r.name}`,className:`inline-flex min-h-8 cursor-pointer items-center gap-2 self-start border-0 bg-transparent p-0 text-sm font-medium text-accent-fg hover:text-accent-fg-hover [&>svg]:size-4`,children:[(0,J.jsx)(Se,{"aria-hidden":`true`}),`Back`]}),e&&(0,J.jsxs)(`dl`,{className:`m-0 grid grid-cols-[110px_minmax(0,1fr)] items-start gap-x-4 gap-y-2 text-sm`,children:[(0,J.jsx)(`dt`,{className:`text-muted`,children:`Use when`}),(0,J.jsx)(`dd`,{className:`m-0 text-ink-2`,children:e.description.replace(/^Use when\s+/i,``)}),(0,J.jsx)(`dt`,{className:`text-muted`,children:`Who uses it`}),(0,J.jsxs)(`dd`,{className:`m-0 flex flex-wrap items-center gap-2`,children:[(0,J.jsx)(Hw,{agents:e.users,max:8}),(0,J.jsx)(`span`,{className:`text-ink-2`,children:M(e)})]}),(0,J.jsx)(`dt`,{className:`text-muted`,children:`From`}),(0,J.jsx)(`dd`,{className:`m-0`,children:N(e)}),(0,J.jsx)(`dt`,{className:`self-center text-muted`,children:`On`}),(0,J.jsx)(`dd`,{className:`m-0`,children:ie(e)})]}),(0,J.jsx)(`div`,{className:`border-t border-line-soft pt-4`,children:(0,J.jsx)(ea,{text:Iw(Pw(p.text).body),className:`text-[16px]`,refs:{names:t.skills.map(e=>e.name).filter(e=>e!==p.name),open:e=>{let n=t.skills.find(t=>t.name===e);n&&te(n,p.name)}}})})]})})()}),(0,J.jsx)(yr,{wide:!0,open:!!_,onClose:()=>v(null),title:_?.existing?`Edit ${_.existing}`:_?.copyOf?`Copy ${_.copyOf}`:`Add a skill`,description:(0,J.jsxs)(J.Fragment,{children:[_?.copyOf&&_.name===_.copyOf&&(0,J.jsxs)(J.Fragment,{children:[`Replaces ForgeQE's `,_.copyOf,` in this project. `]}),`Saved in `,(0,J.jsxs)(`span`,{className:`font-mono text-[13px]`,children:[`.forgeqe/skills/`,_?.name||`name`,`/SKILL.md`]}),`, shared with the project. The agents read a skill when its "use when" matches the work.`]}),footer:(0,J.jsxs)(J.Fragment,{children:[S&&(0,J.jsx)(`span`,{role:`alert`,className:`mr-auto self-center text-sm text-fail [overflow-wrap:anywhere]`,children:S}),_?.existing&&(0,J.jsxs)(V,{disabled:y,onClick:()=>_.existing&&O(()=>It.removeSkill(_.existing),`Removed ${_.existing}.`,()=>v(null)),className:`mr-auto text-fail`,children:[(0,J.jsx)(Ie,{"aria-hidden":`true`}),`Delete`]}),(0,J.jsxs)(V,{onClick:()=>v(null),children:[(0,J.jsx)(A,{"aria-hidden":`true`}),`Cancel`]}),(0,J.jsxs)(V,{variant:`primary`,disabled:y||!_?.name||!_.description.trim()||!_.agents.length||!!_.existing&&!_.body.trim(),onClick:()=>_&&O(()=>_.existing?It.saveSkill(_.existing,_):It.addSkill(_),_.existing?`Saved ${_.name}.`:_.copyOf&&_.name===_.copyOf?`Copied ${_.name}: yours is used in this project.`:`Added ${_.name}.`,()=>v(null)),children:[_?.existing?(0,J.jsx)(dt,{"aria-hidden":`true`}):(0,J.jsx)(k,{"aria-hidden":`true`}),y?`Saving…`:_?.existing?`Save`:_?.copyOf&&_.name===_.copyOf?`Save copy`:`Add`]})]}),children:_&&t&&(0,J.jsxs)(`div`,{className:`flex flex-col gap-4 pt-4`,children:[(0,J.jsxs)(`label`,{className:`flex flex-col gap-2`,children:[(0,J.jsx)(`span`,{className:`font-medium`,children:`Name`}),(0,J.jsx)(R,{value:_.name,disabled:!!_.existing,placeholder:`sap-fiori`,onChange:e=>v({..._,name:e.target.value.toLowerCase().replace(/[^a-z0-9-]+/g,`-`).slice(0,64)}),className:`font-mono`})]}),(0,J.jsxs)(`label`,{className:`flex flex-col gap-2`,children:[(0,J.jsx)(`span`,{className:`font-medium`,children:`Use when`}),(0,J.jsx)(R,{value:_.description,placeholder:`Use when the site is SAP Fiori: tiles, smart tables, value help dialogs.`,onChange:e=>v({..._,description:e.target.value})}),(0,J.jsx)(`span`,{className:`text-[13px] text-muted`,children:`The agents choose skills by this line: say when it applies.`})]}),(0,J.jsxs)(`fieldset`,{className:`m-0 flex flex-col gap-2 border-0 p-0`,children:[(0,J.jsx)(`legend`,{className:`mb-2 p-0 font-medium`,children:`Who it is for`}),(0,J.jsx)(`div`,{className:`flex flex-wrap gap-2`,children:t.audiences.map(e=>{let t=_.agents.includes(e.id);return(0,J.jsxs)(`button`,{type:`button`,role:`checkbox`,"aria-checked":t,onClick:()=>v({..._,agents:t?_.agents.filter(t=>t!==e.id):[..._.agents,e.id]}),className:L(`inline-flex min-h-10 cursor-pointer items-center gap-2 rounded-[8px] border px-4 text-[13px] font-medium`,t?`border-accent bg-accent-soft text-ink`:`border-transparent bg-surface-strong text-ink-2 hover:bg-line hover:text-ink`),children:[(0,J.jsx)(Hw,{agents:e.agents,max:3}),e.label]},e.id)})})]}),(0,J.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,J.jsx)(`label`,{htmlFor:`skill-text`,className:`font-medium`,children:`Instructions`}),(0,J.jsx)(Ro,{id:`skill-text`,value:_.body,lang:`markdown`,onChange:e=>v({..._,body:e})}),(0,J.jsxs)(`span`,{className:`text-[13px] text-muted`,children:[_.existing?``:`Leave it empty to start from ForgeQE's outline for that agent. `,`Markdown; short rules the agent can follow step by step.`]})]})]})})]})}function Ww({checked:e,onSelect:t,label:n}){return(0,J.jsx)(`button`,{type:`button`,role:`radio`,"aria-checked":e,"aria-label":n,onClick:t,className:L(`relative inline-flex size-4 flex-none cursor-pointer items-center justify-center rounded-full border-[1.5px] bg-bg p-0 before:absolute before:-inset-2.5 before:content-['']`,e?`border-accent`:`border-muted`),children:(0,J.jsx)(`span`,{"aria-hidden":`true`,className:L(`size-2 rounded-full`,e?`bg-accent`:`bg-transparent`)})})}function Gw(e,t,n){return e?/^[A-Za-z0-9_-][A-Za-z0-9_.-]*$/.test(e)?e!==t&&n.includes(e)?`There is already an environment called ${e}.`:``:`Letters, digits, dots, dashes and underscores only.`:`Give it a name.`}var Kw=/^[A-Za-z_][A-Za-z0-9_]*$/,qw=/\.(csv|tsv|json|ya?ml|xlsx|xls|xml|sql|txt)$/i;function Jw(e){for(let[t,n]of Object.entries(e)){if(!Kw.test(t))return`${t||`A test data file`}: the name is letters, digits and _`;let e=String(n??``).trim();if(!e)return`${t}: pick its file`;if(!qw.test(e)||e.startsWith(`/`)||/^[A-Za-z]:/.test(e)||e.split(/[\\/]/).some(e=>e===`..`||e.startsWith(`.`)))return`${t}: a data file of the project (.csv, .json, .yaml, .xlsx…)`}return``}var Yw=e=>{if(!(`data`in e))return`data`;for(let t=2;;t++)if(!(`data_${t}`in e))return`data_${t}`},Xw=e=>(e.split(/[\\/]/).pop()||``).replace(/\.[^.]+$/,``).replace(/[^A-Za-z0-9_]+/g,`_`).replace(/^(?=\d)/,`_`)||`data`,Zw={azure:{subscription:[/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i,`a subscription id, a GUID`],tenant:[/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i,`a tenant id, a GUID`],resource_group:[/^[A-Za-z0-9_.()-]{0,89}[A-Za-z0-9_()-]$/,`a resource group's name`]},aws:{account:[/^\d{12}$/,`a 12-digit account id`],region:[/^[a-z]{2}(?:-[a-z]+){1,2}-\d{1,2}$/,`a region such as eu-west-1`],profile:[/^[A-Za-z0-9][A-Za-z0-9_.-]{0,63}$/,`a profile's name`]},gcp:{project:[/^[a-z][a-z0-9-]{4,28}[a-z0-9]$/,`a project id`],region:[/^[a-z]+-[a-z]+\d{1,2}$/,`a region such as europe-west1`]}},Qw={azure:[`subscription`,`Azure`,`subscription id`],aws:[`account`,`AWS`,`account id`],gcp:[`project`,`Google Cloud`,`project id`]};function $w(e){for(let[t,n]of Object.entries(e)){let e=Zw[t];if(!e||!n||typeof n!=`object`)continue;let r=n,[i,a,o]=Qw[t];if(Object.values(r).some(e=>String(e??``).trim())&&!String(r[i]??``).trim())return`${a}: give its ${o}`;for(let[t,n]of Object.entries(r)){let r=String(n??``).trim(),i=e[t];if(r&&i&&!i[0].test(r))return`${a}: ${i[1]}`}}return``}var eT=[[`web`,`Web`],[`api`,`API`],[`desktop`,`Windows desktop`],[`mobile`,`Mobile`]],tT={web:j,api:tt,desktop:Fe,mobile:oe};function nT(e){let t=String(e.kind||`web`),n=[{key:`kind`,label:`Kind`,type:`select`,default:`web`,options:eT.map(([e,t])=>({value:e,label:t}))}];return(t===`web`||t===`api`)&&n.push({key:`url`,label:`Address`,type:`url`,placeholder:t===`api`?`https://qa.api.example.com/v1`:`https://qa.shop.example.com`}),t===`desktop`&&n.push({key:`path`,label:`Program`,type:`path`,placeholder:`C:\\Program Files\\Contoso\\Billing\\Billing.exe`},{key:`args`,label:`Arguments`,help:`Comma separated.`,type:`list`,placeholder:`--server, qa-db01`}),t===`mobile`&&n.push({key:`platform`,label:`Platform`,type:`select`,options:[{value:`android`,label:`Android`},{value:`ios`,label:`iOS`}]},{key:`app_id`,label:`App id`,type:`path`,placeholder:`com.contoso.courier`},{key:`activity`,label:`Activity`,help:`Android: the activity to start.`,type:`path`,placeholder:`.MainActivity`},{key:`app`,label:`Build to install`,help:`An .apk or .ipa, an https address, or bs://…`,type:`path`}),n.push({key:`description`,label:`Description`,help:`The agent picks apps by this, so say what the app is for.`,type:`text`}),t===`web`&&n.push({key:`login`,label:`Sign-in`,help:`A sign-in from Sign-ins.`,type:`text`,placeholder:`shop-qa`}),n}function rT({value:e,onChange:t}){let n=Object.entries(e);return(0,J.jsxs)(`div`,{className:`flex flex-col gap-2 border-t border-surface-strong py-4`,children:[(0,J.jsx)(`span`,{className:`font-medium`,children:`Variables`}),(0,J.jsx)(`span`,{className:`text-sm text-muted`,children:`Plain values tests read as FORGEQE_VAR_NAME. No secrets here: list those under Secrets.`}),n.map(([n,r],i)=>(0,J.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,J.jsx)(R,{"aria-label":`Variable name`,value:n,spellCheck:!1,onChange:r=>t(kr(e,n,r.target.value)),className:`max-w-[200px] flex-[1_1_140px] font-mono`}),(0,J.jsx)(R,{"aria-label":`Value of ${n}`,value:String(r??``),onChange:r=>t({...e,[n]:r.target.value}),className:`flex-[2_1_200px]`}),(0,J.jsx)(V,{variant:`icon`,size:`icon-sm`,"aria-label":`Remove ${n}`,"data-tip":`Remove ${n}`,onClick:()=>{let r={...e};delete r[n],t(r)},children:(0,J.jsx)(Ie,{"aria-hidden":`true`})})]},i)),(0,J.jsx)(`div`,{children:(0,J.jsxs)(V,{size:`sm`,"data-tip":`Add a variable`,onClick:()=>t({...e,[ti(e,`name`)]:``}),children:[(0,J.jsx)(k,{"aria-hidden":`true`}),`Add`]})})]})}function iT({value:e,onChange:t}){let n=Array.isArray(e)?e.map(String):[],[r,i]=(0,q.useState)(``),a=/^[A-Za-z_][A-Za-z0-9_]*$/.test(r.trim());return(0,J.jsxs)(`div`,{className:`flex flex-col gap-2 border-t border-surface-strong py-4`,children:[(0,J.jsx)(`span`,{className:`font-medium`,children:`Secrets`}),(0,J.jsx)(`span`,{className:`text-sm text-muted`,children:`Passwords and keys this environment's tests and desktop flows read, by name. Their values are kept in your credential store.`}),n.map(e=>(0,J.jsxs)(`div`,{className:`flex flex-wrap items-center gap-x-4 gap-y-1 border-t border-line-soft pt-2`,children:[(0,J.jsx)(`code`,{className:`w-full font-mono text-[13px] sm:w-[200px]`,children:e}),(0,J.jsx)(`div`,{className:`min-w-0 flex-1`,children:(0,J.jsx)(br,{name:e,field:e,compact:!0})}),(0,J.jsx)(Rn,{name:e}),(0,J.jsx)(V,{variant:`icon`,size:`icon-sm`,"aria-label":`Stop using ${e} here`,"data-tip":`Stop using ${e} here`,onClick:()=>t(n.filter(t=>t!==e)),children:(0,J.jsx)(Ie,{"aria-hidden":`true`})})]},e)),(0,J.jsxs)(`form`,{className:`flex flex-wrap items-center gap-2`,onSubmit:e=>{e.preventDefault(),a&&!n.includes(r.trim())&&t([...n,r.trim()]),i(``)},children:[(0,J.jsx)(R,{"aria-label":`Secret's variable name`,value:r,placeholder:`BILLING_PASSWORD_QA`,spellCheck:!1,onChange:e=>i(e.target.value),className:`max-w-[280px] flex-[1_1_200px] font-mono`}),(0,J.jsxs)(V,{size:`sm`,type:`submit`,disabled:!a,"data-tip":`Add a secret`,children:[(0,J.jsx)(k,{"aria-hidden":`true`}),`Add`]})]})]})}var aT=(e,t)=>(t.startsWith(e)?t.slice(e.length).replace(/^[\\/]+/,``):t).replace(/\\/g,`/`);function oT({envs:e,layout:t,files:n,base:r,onSplit:i,splitBlocked:a,config:o}){let[s,c]=(0,q.useState)(null),l=t.layout===`dir`?aT(r,t.dir):``,u=e=>{let t=n.find(t=>t.name===e);return t?aT(r,t.path):`${l}/${e}.yaml`},d=W(e.value.environments),f=Object.keys(d),p=typeof e.value.default==`string`?e.value.default:f[0]||``;return(0,J.jsxs)(J.Fragment,{children:[o&&(0,J.jsx)(`div`,{className:`mb-6`,children:t.layout===`dir`?(0,J.jsx)(Oi,{def:{key:`dir`,label:`Environments folder`,help:`One YAML file per environment, named after it. Relative to forgeqe.yaml; read from there after you save.`,type:`path`,placeholder:`./environments`},edit:o,base:[`environments`]}):(0,J.jsx)(Oi,{def:{key:`file`,label:`Environments file`,help:`All environments in one YAML file. Relative to forgeqe.yaml; read from there after you save. --env NAME or FORGEQE_ENV picks one for a run.`,type:`path`,default:`./env.yaml`},edit:o,base:[`environments`]})}),t.layout===`file`?(0,J.jsxs)(`div`,{className:`mb-6 flex flex-wrap items-center gap-x-4 gap-y-4 rounded-[14px] bg-surface-muted px-6 py-4`,children:[(0,J.jsxs)(`p`,{className:`m-0 flex-[1_1_300px] text-sm leading-relaxed text-ink-2`,children:[`All environments are in one file, `,(0,J.jsx)(`span`,{className:`font-mono text-[13px]`,children:aT(r,t.file)}),`. One file per environment is easier to change and review: each goes into`,` `,(0,J.jsx)(`span`,{className:`font-mono text-[13px]`,children:`environments/`}),`, and the old file is left as it is.`,a&&(0,J.jsx)(`span`,{className:`mt-1 block text-muted`,children:a})]}),(0,J.jsxs)(V,{size:`sm`,onClick:i,disabled:!!a,"data-tip":`Split into one file each`,children:[(0,J.jsx)(re,{"aria-hidden":`true`}),`Split`]})]}):(0,J.jsxs)(`p`,{className:`mt-0 mb-4 text-sm leading-relaxed text-ink-2`,children:[`Each environment is its own file in `,(0,J.jsxs)(`span`,{className:`font-mono text-[13px]`,children:[l,`/`]}),`. The active one is set in forgeqe.yaml.`]}),(0,J.jsxs)(`div`,{className:`mb-4 flex flex-wrap items-center justify-between gap-4`,children:[(0,J.jsx)(`span`,{className:`text-sm text-muted`,children:`The active one is used when a run names none.`}),(0,J.jsxs)(V,{size:`sm`,"data-tip":`Add an environment`,onClick:()=>c({mode:`add`,from:``,name:ti(d,f.length?`new-environment`:`qa`),env:{description:``,apps:{}}}),children:[(0,J.jsx)(k,{"aria-hidden":`true`}),`Add`]})]}),(0,J.jsxs)(`div`,{role:`radiogroup`,"aria-label":`Active environment`,children:[f.length===0&&(0,J.jsx)(`p`,{className:`m-0 border-t border-line-soft py-6 text-sm text-muted`,children:`No environments yet. Add one with the apps your tests use.`}),f.map(r=>{let i=W(d[r]),a=W(i.apps);return(0,J.jsx)(or,{expandable:!1,open:!1,onToggle:()=>{},lead:(0,J.jsx)(Ww,{checked:p===r,onSelect:()=>e.set({...e.value,default:r}),label:`Use ${r}`}),title:r,meta:(0,J.jsxs)(J.Fragment,{children:[[i.description,typeof i.file==`string`?`reads ${i.file}`:`${Object.keys(a).length} app${Object.keys(a).length===1?``:`s`}`,Object.keys(W(i.data)).length?`${Object.keys(W(i.data)).length} test data file${Object.keys(W(i.data)).length===1?``:`s`}`:``].filter(Boolean).map(String).join(`, `),t.layout===`dir`&&(0,J.jsxs)(`span`,{className:`block font-mono text-[13px]`,children:[u(r),n.some(e=>e.name===r)?``:` (new)`]})]}),state:p===r?(0,J.jsx)(`span`,{className:`text-sm text-pass`,children:`Active`}):void 0,actions:(0,J.jsxs)(J.Fragment,{children:[(0,J.jsx)(V,{variant:`icon`,size:`icon-sm`,"aria-label":`Edit ${r}`,"data-tip":`Edit ${r}`,onClick:()=>c({mode:`edit`,from:r,name:r,env:i}),children:(0,J.jsx)(re,{"aria-hidden":`true`})}),(0,J.jsx)(V,{variant:`icon`,size:`icon-sm`,"aria-label":`Remove ${r}`,"data-tip":`Remove ${r}`,onClick:()=>{let t={...d};delete t[r];let n={...e.value,environments:t};p===r&&delete n.default,e.set(n)},children:(0,J.jsx)(Ie,{"aria-hidden":`true`})})]}),children:null},r)})]}),(0,J.jsx)(sT,{panel:s,setPanel:c,taken:f,vars:e.vars,dirLayout:t.layout===`dir`,onApply:t=>{t.mode===`add`?e.set({...e.value,...f.length?{}:{default:t.name},environments:{...d,[t.name]:t.env}}):e.set({...e.value,...p===t.from&&e.value.default!==void 0?{default:t.name}:{},environments:{...kr(d,t.from,t.name),[t.name]:t.env}})}})]})}function sT({panel:e,setPanel:t,taken:n,vars:r,dirLayout:i,onApply:a}){let[o,s]=(0,q.useState)(``),c=e?W(e.env):{},l=W(c.apps),u=n=>e&&t({...e,env:n}),d={value:c,set:u,vars:r},f=Object.entries(l).filter(([,e])=>(W(e).kind||`web`)===`web`),p=Object.entries(l).filter(([,e])=>W(e).kind===`api`),m=typeof c.file==`string`?String(c.file):``,h=W(c.data),g=e?Gw(e.name,e.from,n):``,_=W(c.cloud),v=Jw(h)||$w(_),[y,b]=(0,q.useState)([]),x=()=>{t(null),s(``),b([])},S=(e,t)=>{u({...e,...e.data?{}:Object.keys(h).length?{data:h}:{},...e.cloud?{}:Object.keys(_).length?{cloud:_}:{},...!e.description&&c.description?{description:c.description}:{}}),s(``),b(t.length?[`Secret values written in the YAML were left out (${t.join(`, `)}): put each in an environment variable and add its name under Secrets.`]:[])};return(0,J.jsx)(yr,{wide:!0,open:!!e,onClose:x,title:e?.mode===`add`?`Add an environment`:`Edit ${e?.from}`,description:`The apps, values and secrets tests use in one place, such as QA or staging. Changes apply when you press the button below; a secret's value goes to your credential store as you type it.`,footer:(0,J.jsxs)(J.Fragment,{children:[(g||v)&&(0,J.jsx)(`span`,{className:`mr-auto self-center text-sm text-muted`,children:g?`Needs a valid name`:v}),(0,J.jsxs)(V,{onClick:x,children:[(0,J.jsx)(A,{"aria-hidden":`true`}),`Cancel`]}),(0,J.jsxs)(V,{variant:`primary`,disabled:!!g||!!v,onClick:()=>{a(e),x()},children:[e?.mode===`add`?(0,J.jsx)(k,{"aria-hidden":`true`}):(0,J.jsx)(dt,{"aria-hidden":`true`}),e?.mode===`add`?`Add`:`Done`]})]}),children:e&&(0,J.jsxs)(J.Fragment,{children:[(0,J.jsx)(H,{label:`Name`,help:g?(0,J.jsx)(`span`,{className:`text-fail`,children:g}):i?`Also its file's name. Pick it with --env NAME or FORGEQE_ENV.`:`Pick it with --env NAME or FORGEQE_ENV.`,htmlFor:`env-name`,className:`mt-4`,stacked:!0,children:(0,J.jsx)(R,{id:`env-name`,value:e.name,spellCheck:!1,placeholder:`qa`,"aria-invalid":!!g,onChange:n=>t({...e,name:n.target.value.trim()}),className:`font-mono`})}),(0,J.jsx)(Dn,{defs:[{key:`description`,label:`Description`,type:`text`}],edit:d,base:[],stacked:!0}),(0,J.jsx)(cT,{name:e.name,linked:m,onFill:S,onLink:e=>u({file:e,...c.description?{description:c.description}:{},...Object.keys(h).length?{data:h}:{},...Object.keys(_).length?{cloud:_}:{}})}),y.map(e=>(0,J.jsxs)(`p`,{role:`status`,className:`mt-4 mb-0 flex items-start gap-2 text-sm leading-relaxed text-warn`,children:[(0,J.jsx)(Zt,{icon:_t,size:16,className:`mt-1 flex-none`}),e]},e)),m?(0,J.jsx)(lT,{file:m,name:e.name,onCopy:S}):(0,J.jsxs)(J.Fragment,{children:[f.length>1&&(0,J.jsx)(Oi,{def:{key:`start_app`,label:`Start app`,help:`Where browser runs start when no app or address is given.`,type:`select`,options:f.map(([e])=>({value:e,label:e}))},edit:d,base:[],stacked:!0}),p.length>1&&(0,J.jsx)(Oi,{def:{key:`api_app`,label:`API app`,help:`The API that API tests call.`,type:`select`,options:p.map(([e])=>({value:e,label:e}))},edit:d,base:[],stacked:!0}),(0,J.jsx)(U,{children:`Apps`}),Object.keys(l).length===0&&(0,J.jsx)(`p`,{className:`m-0 pb-2 text-sm text-muted`,children:`No apps yet: add the web pages, APIs and programs tests use here.`}),Object.entries(l).map(([e,t],n)=>{let i=W(t);return(0,J.jsxs)(or,{lead:(0,J.jsx)(Pr,{icon:tT[String(i.kind||`web`)]||j,logo:i.kind===`mobile`?Qi[String(i.platform)]:i.kind===`desktop`?Qi.windows:void 0}),title:e,meta:[eT.find(([e])=>e===(i.kind||`web`))?.[1],i.url||i.path||i.app_id].filter(Boolean).map(String).join(`, `),open:o===String(n),onToggle:()=>s(o===String(n)?``:String(n)),actions:(0,J.jsx)(V,{variant:`icon`,size:`icon-sm`,"aria-label":`Remove ${e}`,"data-tip":`Remove ${e}`,onClick:()=>{let t={...l};delete t[e],u({...c,apps:t})},children:(0,J.jsx)(Ie,{"aria-hidden":`true`})}),children:[(0,J.jsx)(H,{label:`Name`,htmlFor:`app-${n}`,stacked:!0,children:(0,J.jsx)(R,{id:`app-${n}`,defaultValue:e,spellCheck:!1,onBlur:t=>{let n=t.target.value.trim();n&&n!==e&&/^[A-Za-z0-9_.-]+$/.test(n)&&!(n in l)?u({...c,apps:kr(l,e,n)}):t.target.value=e},className:`font-mono`})}),(0,J.jsx)(Dn,{defs:nT(i),edit:{value:i,set:t=>u({...c,apps:{...l,[e]:t}}),vars:r},base:[],stacked:!0})]},n)}),(0,J.jsx)(`div`,{className:`border-t border-line-soft py-4`,children:(0,J.jsxs)(V,{size:`sm`,"data-tip":`Add an app`,onClick:()=>{u({...c,apps:{...l,[ti(l,`app`)]:{kind:`web`}}}),s(String(Object.keys(l).length))},children:[(0,J.jsx)(k,{"aria-hidden":`true`}),`Add`]})}),(0,J.jsx)(rT,{value:W(c.variables),onChange:e=>u(K(c,[`variables`],Object.keys(e).length?e:void 0))}),(0,J.jsx)(iT,{value:c.secrets,onChange:e=>u(K(c,[`secrets`],e.length?e:void 0))})]}),(0,J.jsx)(fT,{value:h,onChange:e=>u(K(c,[`data`],Object.keys(e).length?e:void 0))}),(0,J.jsx)(dT,{edit:d})]})})}function cT({name:e,linked:t,onFill:r,onLink:i}){let[a,o]=(0,q.useState)(``),[s,c]=(0,q.useState)(``),[l,u]=(0,q.useState)(!1),[d,f]=(0,q.useState)(``),[p,m]=(0,q.useState)(null),[h,g]=(0,q.useState)(``),[_,v]=(0,q.useState)(null),[y,b]=(0,q.useState)(``),x=(0,q.useRef)(null),S=(0,q.useId)(),C=(0,q.useId)();(0,q.useEffect)(()=>{a===`link`&&_===null&&on.files(`yaml`).then(e=>v(e.files)).catch(e=>f(e.message))},[a,_]);let w=(e,t)=>{r(W(e.environments[t]),e.literalByEnv[t]||[]),m(null),o(``),c(``)},T=async t=>{u(!0),f(``);try{let n=await on.convert(t,e),r=Object.keys(n.environments);r.length===1?w(n,r[0]):r.includes(e)?w(n,e):(m(n),g(n.default&&r.includes(n.default)?n.default:r[0]))}catch(e){f(e.message)}finally{u(!1)}};return(0,J.jsxs)(`div`,{className:`mt-6 flex flex-col gap-4 rounded-[12px] bg-surface-muted px-4 py-4`,children:[(0,J.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,J.jsxs)(`span`,{className:`flex items-center gap-2 text-[13px] font-medium text-ink`,children:[(0,J.jsx)(Zt,{icon:ct,size:16,className:`text-muted`}),t?`Read from your team's YAML`:`Start from your team's YAML`]}),(0,J.jsx)(`span`,{className:`text-[13px] leading-relaxed text-ink-2`,children:`Any layout works: ForgeQE finds the addresses, programs, values and secret names in it. Secret values are never copied.`})]}),(0,J.jsx)(`div`,{role:`group`,"aria-label":`How to bring the YAML in`,className:`flex flex-wrap gap-2`,children:(0,J.jsx)(hn,{items:[{id:`paste`,label:`Paste`,icon:me},{id:`import`,label:`Import a file`,icon:ut},{id:`link`,label:`Link a project file`,icon:Ae}],value:a,onChange:e=>{o(a===e?``:e),f(``),m(null)}})}),a===`paste`&&(0,J.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,J.jsx)(`label`,{htmlFor:S,className:`text-[13px] text-ink-2`,children:`The environment's YAML, or a file of several`}),(0,J.jsx)(pn,{id:S,rows:8,spellCheck:!1,value:s,placeholder:`base_url: https://qa.shop.example.com
57
- db_server: qa-db01
58
- admin_password: \${ADMIN_PASSWORD_QA}`,onChange:e=>c(e.target.value),className:`font-mono leading-[1.6]`}),(0,J.jsx)(`div`,{children:(0,J.jsxs)(V,{size:`sm`,variant:`primary`,disabled:!s.trim()||l,"data-tip":`Fill in the fields`,onClick:()=>T({text:s}),children:[(0,J.jsx)(dt,{"aria-hidden":`true`}),l?`Reading…`:`Fill in`]})})]}),a===`import`&&(0,J.jsxs)(`div`,{className:`flex flex-wrap items-center gap-4`,children:[(0,J.jsx)(`input`,{ref:x,type:`file`,accept:`.yaml,.yml,.json`,className:`sr-only`,tabIndex:-1,"aria-hidden":`true`,onChange:async e=>{let t=e.target.files?.[0];if(e.target.value=``,t){if(t.size>262144)return f(`${t.name} is over 256 KB.`);await T({text:await t.text()})}}}),(0,J.jsxs)(V,{size:`sm`,disabled:l,"data-tip":`Choose a YAML file`,onClick:()=>x.current?.click(),children:[(0,J.jsx)(ut,{"aria-hidden":`true`}),l?`Reading…`:`Choose`]}),(0,J.jsx)(`span`,{className:`text-[13px] text-muted`,children:`From anywhere on this computer; its fields are copied here.`})]}),a===`link`&&(0,J.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,J.jsx)(`label`,{htmlFor:C,className:`text-[13px] text-ink-2`,children:`A YAML file in the project. ForgeQE reads it every run, so the team keeps changing it there.`}),(0,J.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,J.jsxs)(ln,{id:C,value:y,onChange:e=>b(e.target.value),disabled:!_?.length,className:`min-w-0 flex-[1_1_280px] font-mono`,children:[(0,J.jsx)(`option`,{value:``,children:_===null?`Looking for YAML files…`:_.length?`Pick a file`:`No YAML files in the project`}),(_||[]).map(e=>(0,J.jsx)(`option`,{value:e,children:e},e))]}),(0,J.jsxs)(V,{size:`sm`,variant:`primary`,disabled:!y,onClick:()=>{i(y),o(``)},"data-tip":`Link a project file`,children:[(0,J.jsx)(n,{"aria-hidden":`true`}),`Link`]})]})]}),p&&(0,J.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,J.jsxs)(`span`,{className:`text-[13px] text-ink-2`,children:[`The YAML has `,Object.keys(p.environments).join(`, `),`. Fill in from`]}),(0,J.jsx)(ln,{"aria-label":`Which environment to fill in from`,value:h,onChange:e=>g(e.target.value),className:`max-w-[220px] flex-[0_1_200px]`,children:Object.keys(p.environments).map(e=>(0,J.jsx)(`option`,{value:e,children:e},e))}),(0,J.jsxs)(V,{size:`sm`,variant:`primary`,"data-tip":`Fill in from ${h}`,onClick:()=>w(p,h),children:[(0,J.jsx)(dt,{"aria-hidden":`true`}),`Fill in`]})]}),d&&(0,J.jsx)(`p`,{role:`alert`,className:`m-0 text-sm text-fail`,children:d})]})}function lT({file:e,name:t,onCopy:n}){let[r,i]=(0,q.useState)(null),[a,o]=(0,q.useState)(``);(0,q.useEffect)(()=>{let n=!0;return i(null),o(``),on.convert({file:e},t).then(e=>{let r=W(e.environments[t]??Object.values(e.environments)[0]);n&&i({env:r,literal:e.literalByEnv[t]??Object.values(e.literalByEnv)[0]??[]})}).catch(e=>n&&o(e.message)),()=>{n=!1}},[e,t]);let s=Object.entries(W(r?.env.apps)),c=Object.entries(W(r?.env.variables)),l=Array.isArray(r?.env.secrets)?r.env.secrets.map(String):[];return(0,J.jsxs)(J.Fragment,{children:[(0,J.jsx)(U,{help:(0,J.jsxs)(J.Fragment,{children:[`Read from `,(0,J.jsx)(`span`,{className:`font-mono text-[13px]`,children:e}),` every run; change them in that file.`]}),children:`What ForgeQE reads`}),a&&(0,J.jsx)(`p`,{role:`alert`,className:`m-0 text-sm text-fail`,children:a}),!r&&!a&&(0,J.jsxs)(`p`,{role:`status`,className:`m-0 text-sm text-muted`,children:[`Reading `,e,`…`]}),r&&(0,J.jsxs)(`dl`,{className:`m-0 flex flex-col`,children:[(0,J.jsx)(`dt`,{className:`border-t border-line-soft pt-4 text-[13px] font-medium text-muted`,children:`Apps`}),(0,J.jsxs)(`dd`,{className:`m-0 flex flex-col gap-2 pt-2 pb-4`,children:[s.length===0&&(0,J.jsx)(`span`,{className:`text-sm text-muted`,children:`None found`}),s.map(([e,t])=>{let n=W(t);return(0,J.jsxs)(`span`,{className:`flex items-center gap-4`,children:[(0,J.jsx)(Pr,{icon:tT[String(n.kind||`web`)]||j}),(0,J.jsxs)(`span`,{className:`flex min-w-0 flex-col`,children:[(0,J.jsx)(`span`,{className:`font-medium`,children:e}),(0,J.jsx)(`span`,{className:`text-sm break-all text-muted`,children:[eT.find(([e])=>e===(n.kind||`web`))?.[1],n.url||n.path||n.app_id].filter(Boolean).map(String).join(`, `)})]})]},e)})]}),(0,J.jsx)(`dt`,{className:`border-t border-line-soft pt-4 text-[13px] font-medium text-muted`,children:`Values`}),(0,J.jsx)(`dd`,{className:`m-0 pt-2 pb-4 text-sm`,children:c.length?(0,J.jsx)(`span`,{className:`flex flex-col gap-1`,children:c.map(([e,t])=>(0,J.jsxs)(`span`,{className:`break-all`,children:[(0,J.jsx)(`code`,{className:`font-mono text-[13px]`,children:e}),` `,(0,J.jsx)(`span`,{className:`text-muted`,children:`=`}),` `,String(t)]},e))}):(0,J.jsx)(`span`,{className:`text-muted`,children:`None`})}),(0,J.jsx)(`dt`,{className:`border-t border-line-soft pt-4 text-[13px] font-medium text-muted`,children:`Secrets, by name`}),(0,J.jsx)(`dd`,{className:`m-0 pt-2 pb-4 text-sm`,children:l.length?(0,J.jsx)(`code`,{className:`font-mono text-[13px]`,children:l.join(`, `)}):(0,J.jsx)(`span`,{className:`text-muted`,children:`None`})})]}),r?.literal.length?(0,J.jsxs)(`p`,{className:`m-0 flex items-start gap-2 text-sm leading-relaxed text-warn`,children:[(0,J.jsx)(Zt,{icon:_t,size:16,className:`mt-1 flex-none`}),`The file has secret values written in (`,r.literal.join(`, `),`). They are not used: move each to an environment variable.`]}):null,(0,J.jsx)(`div`,{className:`border-t border-line-soft py-4`,children:(0,J.jsxs)(V,{size:`sm`,disabled:!r,"data-tip":`Copy into fields instead`,onClick:()=>r&&n(r.env,r.literal),children:[(0,J.jsx)(I,{"aria-hidden":`true`}),`Copy`]})})]})}var uT=[{id:`azure`,title:`Azure`,note:`Tests read these as FORGEQE_CLOUD_AZURE_SUBSCRIPTION_ID, _TENANT_ID and _RESOURCE_GROUP.`,fields:[{key:`subscription`,label:`Subscription id`,type:`path`,placeholder:`00000000-0000-0000-0000-000000000000`},{key:`tenant`,label:`Tenant id`,type:`path`,placeholder:`00000000-0000-0000-0000-000000000000`},{key:`resource_group`,label:`Resource group`,type:`path`,placeholder:`rg-shop-qa`}]},{id:`aws`,title:`AWS`,note:`Tests read these as FORGEQE_CLOUD_AWS_ACCOUNT_ID, _REGION and _PROFILE.`,fields:[{key:`account`,label:`Account id`,help:`12 digits.`,type:`path`,placeholder:`123456789012`},{key:`region`,label:`Region`,type:`path`,placeholder:`eu-west-1`},{key:`profile`,label:`Profile`,help:`A profile in ~/.aws/config on the computers that run the tests.`,type:`path`,placeholder:`shop-qa`}]},{id:`gcp`,title:`Google Cloud`,note:`Tests read these as FORGEQE_CLOUD_GCP_PROJECT and _REGION.`,fields:[{key:`project`,label:`Project id`,type:`path`,placeholder:`shop-qa-123`},{key:`region`,label:`Region`,type:`path`,placeholder:`europe-west1`}]}];function dT({edit:e}){return(0,J.jsxs)(J.Fragment,{children:[(0,J.jsx)(U,{icon:h,help:`Where this environment's cloud resources are, so the agents look in the right account and tests read it instead of a fixed id. Identifiers only: sign-ins stay with each cloud's own tools.`,children:`Cloud accounts`}),uT.map(t=>{let n=$w({[t.id]:W(W(e.value.cloud)[t.id])});return(0,J.jsxs)(`div`,{className:`flex flex-col gap-2 border-t border-surface-strong py-4`,children:[(0,J.jsx)(`span`,{className:`font-medium`,children:t.title}),n?(0,J.jsx)(`span`,{className:`text-sm text-fail`,children:n}):(0,J.jsx)(`span`,{className:`text-sm text-muted`,children:t.note}),(0,J.jsx)(Dn,{defs:t.fields,edit:e,base:[`cloud`,t.id],stacked:!0})]},t.id)})]})}function fT({value:e,onChange:t}){let[n,r]=(0,q.useState)([]),i=(0,q.useId)();(0,q.useEffect)(()=>{on.files(`data`).then(e=>r(e.files)).catch(()=>r([]))},[]);let a=Object.entries(e);return(0,J.jsxs)(J.Fragment,{children:[(0,J.jsx)(U,{icon:Le,help:`Files of rows this environment's tests use, so one test reads QA's rows in QA and UAT's in UAT. Each file's path is in FORGEQE_DATA_<NAME>, from the folder of forgeqe.yaml.`,children:`Test data`}),(0,J.jsx)(`datalist`,{id:i,children:n.map(e=>(0,J.jsx)(`option`,{value:e},e))}),a.length===0&&(0,J.jsx)(`p`,{className:`m-0 border-t border-line-soft py-4 text-sm text-muted`,children:`No test data files yet.`}),a.map(([n,r],a)=>(0,J.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2 border-t border-line-soft py-4`,children:[(0,J.jsx)(R,{"aria-label":`Data name`,value:n,spellCheck:!1,"aria-invalid":!Kw.test(n),onChange:r=>t(kr(e,n,r.target.value)),className:`max-w-[180px] flex-[1_1_140px] font-mono`}),(0,J.jsx)(R,{"aria-label":`File of ${n}`,list:i,value:String(r??``),spellCheck:!1,placeholder:`test-data/qa/customers.csv`,onChange:r=>{let i=r.target.value,a=/^data(_\d+)?$/.test(n)&&i&&!(Xw(i)in e)?Xw(i):n;t({...kr(e,n,a),[a]:i})},className:`flex-[2_1_220px] font-mono`}),(0,J.jsx)(V,{variant:`icon`,size:`icon-sm`,"aria-label":`Remove ${n}`,"data-tip":`Remove ${n}`,onClick:()=>{let r={...e};delete r[n],t(r)},children:(0,J.jsx)(Ie,{"aria-hidden":`true`})})]},a)),(0,J.jsx)(`div`,{className:`border-t border-line-soft py-4`,children:(0,J.jsxs)(V,{size:`sm`,"data-tip":`Add a data file`,onClick:()=>t({...e,[Yw(e)]:``}),children:[(0,J.jsx)(k,{"aria-hidden":`true`}),`Add`]})})]})}var pT=[{name:`forgeqe`,label:`Atlas (shell, forgeqe run, forgeqe mcp)`,area:`agent`},{name:`engine`,label:`WebPilot (browser, desktop and mobile runs)`,area:`browser`},{name:`forgeqe-test`,label:`Quill: writes tests`,area:`coding`},{name:`forgeqe-heal`,label:`Mender: heals tests`,area:`coding`},{name:`forgeqe-migrate`,label:`Mover: migrates test suites`,area:`coding`},{name:`forgeqe-tosca`,label:`Bridge: converts Tosca test cases`,area:`coding`},{name:`forgeqe-tosca-assistant`,label:`Guide: sets up a Tosca conversion`,area:`planning`},{name:`forgeqe-api`,label:`Link: writes API and contract tests`,area:`coding`},{name:`forgeqe-review`,label:`Checker: reviews Quill's tests`,area:`review`},{name:`forgeqe-pr-review`,label:`Patch: reviews pull requests`,area:`review`},{name:`forgeqe-judge`,label:`Gavel: judges domain evaluations`,area:`review`},{name:`forgeqe-defect-rca`,label:`Sleuth: root cause of defects`,area:`analysis`},{name:`forgeqe-refine`,label:`Polish: refines requests`,area:`planning`},{name:`forgeqe-find`,label:`Hound: finds the tests a request means`,area:`planning`},{name:`forgeqe-test-plan`,label:`Pathfinder: plans tests recorded by hand`,area:`planning`},{name:`forgeqe-api-plan`,label:`Planner: plans API scenarios`,area:`planning`},{name:`forgeqe-explore-plan`,label:`Rover: plans exploratory charters`,area:`planning`},{name:`forgeqe-data`,label:`Miner: test data`,area:`planning`},{name:`forgeqe-persona`,label:`Mask: business personas`,area:`planning`},{name:`forgeqe-basal`,label:`BASAL: business tests from your question`,area:`planning`},{name:`forgeqe-knowledge-agent`,label:`Librarian: what ForgeQE understood, and corrections`,area:`planning`},{name:`forgeqe-doc-reader`,label:`Skimmer: picks the sections of documents that answer a question`,area:`analysis`},{name:`forgeqe-agent-builder`,label:`Smith: builds custom agents`,area:`planning`},{name:`forgeqe-suite-builder`,label:`Sorter: builds test suites`,area:`planning`},{name:`forgeqe-test-linker`,label:`Matchmaker: links test cases to automated tests`,area:`planning`},{name:`forgeqe-bug-report`,label:`Herald: drafts ForgeQE bug reports`,area:`planning`},{name:`forgeqe-knowledge`,label:`Mapper: reads the product into its knowledge graph`,area:`analysis`},{name:`forgeqe-investigate`,label:`Digger: investigates questions about the product`,area:`analysis`},{name:`forgeqe-evidence-acceptance`,label:`Clerk: reads a change against acceptance criteria`,area:`analysis`},{name:`forgeqe-impact-reader`,label:`Ripple: reads what a change does against its pull request`,area:`analysis`},{name:`forgeqe-evidence-content`,label:`Grader: judges an agent's answers`,area:`analysis`},{name:`forgeqe-evidence-scenarios`,label:`Drafter: drafts test scenarios`,area:`analysis`}];pT.map(e=>e.name);var mT={browser:`GitHub sign-in in the browser`,token:`a saved fine-grained token`,gh:`the GitHub CLI's sign-in`,environment:`a token in the environment ForgeQE started in`};function hT({onChanged:e}){let[t,n]=(0,q.useState)(null),[r,i]=(0,q.useState)(null),[a,o]=(0,q.useState)(``),[s,c]=(0,q.useState)(``),[l,u]=(0,q.useState)(!1),[d,f]=(0,q.useState)(``),p=(0,q.useCallback)(()=>{rn.get().then(t=>{n(t.status),i(n=>(n&&(n.state===`running`||n.state===`waiting`)&&t.signin?.state===`done`&&e?.(),t.signin))},e=>o(e.message))},[e]);(0,q.useEffect)(p,[p]);let h=r?.state===`running`||r?.state===`waiting`;(0,q.useEffect)(()=>{if(!h)return;let e=setInterval(p,1e3);return()=>clearInterval(e)},[h,p]);let g=async e=>{o(``),f(``);try{i((await rn.signIn(e)).signin)}catch(e){o(e.message)}},_=async e=>{if(r?.question){o(``);try{i((await rn.answer(r.question.id,e)).signin),c(``)}catch(e){o(e.message)}}},v=r?.question;return(0,J.jsxs)(`div`,{className:`flex flex-col gap-4 border-t border-line-soft py-4`,children:[(0,J.jsxs)(`div`,{className:`flex min-h-[44px] flex-wrap items-center gap-x-4 gap-y-2`,children:[(0,J.jsx)(Pr,{logo:Xi.github_copilot}),(0,J.jsxs)(`span`,{className:`flex min-w-0 flex-[1_1_260px] flex-col gap-1`,children:[(0,J.jsx)(`span`,{className:`font-medium`,children:`GitHub Copilot`}),(0,J.jsx)(`span`,{className:`text-sm text-muted`,children:t?t.signedIn?`Signed in${t.account?` as ${t.account}`:``}${t.host?` on ${t.host}`:``}, with ${mT[t.how]}.${t.model?` Model: ${t.model}.`:``}`:`Not signed in. The agents can run on your Copilot seat.`:`Reading the sign-in…`})]}),!h&&t&&(0,J.jsxs)(`span`,{className:`flex flex-wrap gap-2`,children:[(0,J.jsxs)(V,{size:`sm`,"data-tip":t.signedIn?`Sign in to GitHub again`:`Sign in with GitHub, in your browser`,onClick:()=>void g(`browser`),children:[(0,J.jsx)(m,{"aria-hidden":`true`}),`Sign in`]}),(0,J.jsxs)(V,{size:`sm`,"data-tip":`Sign in with your company's GitHub Enterprise`,onClick:()=>void g(`enterprise`),children:[(0,J.jsx)(we,{"aria-hidden":`true`}),`Enterprise`]}),(0,J.jsxs)(V,{size:`sm`,"data-tip":`Use a fine-grained GitHub token`,onClick:()=>void g(`token`),children:[(0,J.jsx)(m,{"aria-hidden":`true`}),`Token`]}),t.signedIn&&t.how!==`environment`&&(0,J.jsxs)(V,{size:`sm`,onClick:async()=>{let e=await rn.signOut();n(e.status),f(e.message),i(null)},children:[(0,J.jsx)(it,{"aria-hidden":`true`}),`Sign out`]})]})]}),r&&(r.lines.length>0||h||r.link)&&(0,J.jsxs)(`div`,{role:`status`,"aria-live":`polite`,className:`flex flex-col gap-4 rounded-[12px] card border p-4`,children:[(r.link||r.code)&&h&&(0,J.jsxs)(`div`,{className:`flex flex-wrap items-center gap-4`,children:[r.code&&(0,J.jsxs)(`span`,{className:`flex items-center gap-2`,children:[(0,J.jsx)(`span`,{className:`text-sm text-muted`,children:`Your code`}),(0,J.jsx)(`span`,{className:`rounded-[8px] border border-line bg-bg px-4 py-2 font-mono text-lg font-semibold tracking-[0.12em]`,children:r.code}),(0,J.jsxs)(V,{size:`sm`,"data-tip":`Copy the code`,onClick:()=>{navigator.clipboard?.writeText(r.code).then(()=>u(!0)),setTimeout(()=>u(!1),1500)},children:[(0,J.jsx)(I,{"aria-hidden":`true`}),l?`Copied`:`Copy`]})]}),r.link&&(0,J.jsxs)(`a`,{href:r.link,target:`_blank`,rel:`noreferrer noopener`,"data-tip":`Open GitHub`,className:Ct({variant:`primary`,size:`sm`}),children:[(0,J.jsx)(we,{"aria-hidden":`true`}),`Open`]})]}),(0,J.jsxs)(`ul`,{className:`m-0 flex list-none flex-col gap-1 p-0 text-sm`,children:[r.lines.slice(-6).map((e,t)=>(0,J.jsx)(`li`,{className:L(`[overflow-wrap:anywhere]`,e.kind===`err`?`text-fail`:e.kind===`ok`?`text-pass`:`text-ink-2`),children:e.text},t)),r.state===`running`&&(0,J.jsx)(`li`,{className:`text-muted`,children:`Waiting for GitHub…`})]}),v?.kind===`choose`&&(0,J.jsxs)(`fieldset`,{className:`m-0 flex flex-col gap-2 border-0 p-0`,children:[(0,J.jsx)(`legend`,{className:`mb-1 text-sm font-medium`,children:v.title}),v.detail&&(0,J.jsx)(`p`,{className:`m-0 text-sm text-muted`,children:v.detail}),(0,J.jsx)(`div`,{className:`flex flex-wrap gap-2`,children:v.options.map(e=>(0,J.jsx)(V,{size:`sm`,variant:e.id===`cancel`?`outline`:`primary`,onClick:()=>void _(e.id),children:e.label},e.id))})]}),v?.kind===`input`&&(0,J.jsxs)(`form`,{className:`flex flex-wrap items-end gap-2`,onSubmit:e=>{e.preventDefault(),s.trim()&&_(s)},children:[(0,J.jsxs)(`label`,{className:`flex min-w-0 flex-[1_1_320px] flex-col gap-1 text-sm font-medium`,children:[v.label,(0,J.jsx)(R,{type:v.secret?`password`:`text`,autoComplete:`off`,spellCheck:!1,value:s,onChange:e=>c(e.target.value)})]}),(0,J.jsxs)(V,{type:`submit`,size:`sm`,variant:`primary`,disabled:!s.trim(),children:[(0,J.jsx)(Xe,{"aria-hidden":`true`}),`Continue`]})]}),h&&(0,J.jsx)(`span`,{children:(0,J.jsxs)(V,{size:`sm`,onClick:async()=>i((await rn.cancel()).signin),children:[(0,J.jsx)(A,{"aria-hidden":`true`}),`Cancel`]})})]}),(a||d)&&(0,J.jsx)(`p`,{className:L(`m-0 text-sm`,a?`text-fail`:`text-ink-2`),children:a||d})]})}var gT=[[`openai`,`OpenAI`],[`azure`,`Azure OpenAI`],[`github_copilot`,`GitHub Copilot seat`],[`ollama`,`Ollama on this machine`],[`openai_compatible`,`OpenAI-compatible endpoint`]],_T=e=>gT.find(([t])=>t===e)?.[1]||String(e||`No provider`),vT={openai:{provider:`openai`,model:`gpt-4o`,api_key_env:`OPENAI_API_KEY`,temperature:.2},azure:{provider:`azure`,model:`gpt-4o`,deployment:`gpt-4o`,api_key_env:`WP_AZURE_API_KEY`,api_version:`2024-05-01-preview`,temperature:.2,deployment_type:`global`},github_copilot:{provider:`github_copilot`,model:`gpt-4.1`},ollama:{provider:`ollama`,model:`llama3.2`,endpoint:`http://127.0.0.1:11434/v1`,context:32768,temperature:.2},openai_compatible:{provider:`openai_compatible`,model:`gpt-4o`,api_key_env:`WP_API_KEY`,temperature:.2}};function yT(e){let t=e.multiplier===0?`included in your plan`:typeof e.multiplier==`number`?`${e.multiplier}x premium requests`:`premium requests`;return`${e.id} (${e.vision?`screenshots`:`no screenshots`}, ${t})`}function bT(e,t,n){let r=e.map(e=>({value:e.id,label:yT(e)}));if(typeof t==`string`&&t&&!e.some(e=>e.id===t)){let e=n.find(e=>e.id===t),i=e?e.policy&&e.policy!==`enabled`?`turned off on your seat`:`takes no screenshots`:`not on your seat`;r.push({value:t,label:`${t} (${i})`})}return r}function xT(e){return!e||!e.models&&!e.error?`Reading your seat's models…`:e.error?`Your seat's list could not be read (below); type a Copilot model id, or try again.`:`Your seat has no model turned on: turn one on in GitHub's Copilot settings, or type a Copilot model id.`}function ST(e,t){let n=String(e.provider||``),r=e.auth===`entra`,i=t?.models?.filter(e=>!e.policy||e.policy===`enabled`)||[];if(n===`github_copilot`&&i.length)return[{key:`model`,label:`Model`,help:`Your Copilot seat's models. ForgeQE's agent and Quill use it, and the browser engine too unless Engine model says otherwise.`,type:`select`,options:bT(i,e.model,t.models)},{key:`engine_model`,label:`Engine model`,help:`For the browser, desktop and mobile agents, which send screenshots.`,type:`select`,emptyLabel:`Same as the model`,options:bT(i.filter(e=>e.vision),e.engine_model,t.models)},{key:`description`,label:`Description`,help:`Shown in the model picker.`,type:`text`}];let a=[{key:`model`,label:`Model`,...n===`github_copilot`?{help:xT(t)}:{},type:`text`,placeholder:n===`ollama`?`llama3.2`:n===`github_copilot`?`gpt-4.1`:`gpt-4o`}];return n===`azure`&&(a.push({key:`endpoint`,label:`Endpoint`,type:`url`,placeholder:`https://YOUR_RESOURCE.openai.azure.com/`},{key:`deployment`,label:`Deployment`,type:`text`,placeholder:`gpt-4o`},{key:`auth`,label:`Sign-in`,help:`Entra ID uses a managed identity, workload identity or az login; no key.`,type:`select`,emptyLabel:`API key`,options:[{value:`entra`,label:`Microsoft Entra ID`}]}),r&&a.push({key:`managed_identity_client_id`,label:`Managed identity client id`,type:`text`})),(n===`ollama`||n===`openai_compatible`)&&a.push({key:`endpoint`,label:`Endpoint`,type:`url`,placeholder:n===`ollama`?`http://127.0.0.1:11434/v1`:`https://your-gateway.example/v1`}),n!==`github_copilot`&&!r&&a.push({key:`api_key_env`,label:`API key`,help:`Kept in your credential store, never in llms.json.`,type:`var`}),a.push({key:`description`,label:`Description`,help:`Shown in the model picker.`,type:`text`}),a}function CT(e){let t=String(e.provider||``),n=[];return t===`azure`&&n.push({key:`api_version`,label:`API version`,type:`text`,placeholder:`2024-05-01-preview`},{key:`deployment_type`,label:`Deployment type`,help:`For prices.`,type:`select`,options:[`global`,`data_zone`].map(e=>({value:e,label:e}))}),t===`ollama`&&n.push({key:`context`,label:`Context window`,help:`Tokens.`,type:`number`,default:32768}),t!==`github_copilot`&&n.push({key:`temperature`,label:`Temperature`,type:`number`,placeholder:`0.2`}),t===`github_copilot`&&n.push({key:`reasoning_effort`,label:`Reasoning effort`,help:`How hard a reasoning model thinks. Sent only to a model that takes it.`,type:`select`,emptyLabel:`The model's default`,options:[`low`,`medium`,`high`,`xhigh`,`max`].map(e=>({value:e,label:e}))}),n}var wT=/^[A-Za-z0-9_.-]+$/;function TT({panel:e,setPanel:t,taken:n,onApply:r,vars:i}){let[a,o]=(0,q.useState)(!1),s=e?.profile||{},c=s.provider===`github_copilot`,u=(0,q.useCallback)(()=>c?rn.models().then(e=>e.models):Promise.resolve(null),[c]),d=Hn(u),f={models:d.data,error:d.error},p=e?.name?wT.test(e.name)?e.name!==e.from&&n(e.name)?`Another model has this name.`:``:`Use letters, digits and _ . -`:``,m=String(s.provider||``),h=[...e&&!e.name?[[``,`a name`]]:[],[`model`,`a model`],...m===`azure`?[[`endpoint`,`an endpoint`],[`deployment`,`a deployment`]]:[],...m===`openai_compatible`?[[`endpoint`,`an endpoint`]]:[]].filter(([e])=>!e||!String(s[e]??``).trim()),g=!!e&&!p&&!h.length,_={value:s,set:n=>e&&t({...e,profile:n}),vars:i},v=()=>{t(null),o(!1)},y=CT(s);return(0,J.jsx)(yr,{open:!!e,onClose:v,title:e?.mode===`add`?`Add a model`:`Edit ${e?.from}`,description:`Saved to llms.json, and its key to ${Gn(Cr().store)}, as soon as you add it.`,footer:(0,J.jsxs)(J.Fragment,{children:[h.length>0&&(0,J.jsxs)(`span`,{className:`mr-auto self-center text-sm text-muted`,children:[`Needs `,h.map(([,e])=>e).join(` and `)]}),(0,J.jsxs)(V,{onClick:v,children:[(0,J.jsx)(A,{"aria-hidden":`true`}),`Cancel`]}),(0,J.jsxs)(V,{variant:`primary`,disabled:!g,onClick:()=>{r(e),v()},children:[e?.mode===`add`?(0,J.jsx)(k,{"aria-hidden":`true`}):(0,J.jsx)(dt,{"aria-hidden":`true`}),e?.mode===`add`?`Add`:`Done`]})]}),children:e&&(0,J.jsxs)(J.Fragment,{children:[(0,J.jsxs)(`fieldset`,{className:`m-0 border-0 p-0 pt-6`,children:[(0,J.jsx)(`legend`,{className:`mb-2 font-medium`,children:`Provider`}),(0,J.jsx)(`div`,{className:`flex flex-col gap-1`,children:gT.map(([n,r])=>(0,J.jsxs)(`label`,{className:`flex min-h-12 cursor-pointer items-center gap-4 rounded-[10px] px-4 hover:bg-surface-muted has-[:checked]:bg-surface-strong`,children:[(0,J.jsx)(`input`,{type:`radio`,name:`provider`,checked:s.provider===n,onChange:()=>t({...e,profile:e.mode===`add`?{...vT[n],...s.description?{description:s.description}:{}}:{...s,provider:n}})}),(0,J.jsx)(Pr,{icon:Be,logo:Xi[n]}),r]},n))})]}),(0,J.jsx)(H,{label:`Name`,help:p?(0,J.jsx)(`span`,{className:`text-fail`,children:p}):`How you pick it in chats and with --profile.`,htmlFor:`model-name`,className:`mt-4`,stacked:!0,children:(0,J.jsx)(R,{id:`model-name`,value:e.name,spellCheck:!1,placeholder:`openai-gpt4o`,"aria-invalid":!!p,onChange:n=>t({...e,name:n.target.value.trim()})})}),(0,J.jsx)(Dn,{defs:ST(s,f),edit:_,base:[],stacked:!0}),c&&d.error&&(0,J.jsx)(fr,{error:`Your Copilot seat's models could not be read: ${d.error}`,reload:d.reload}),y.length>0&&(0,J.jsxs)(J.Fragment,{children:[(0,J.jsxs)(`button`,{type:`button`,"aria-expanded":a,onClick:()=>o(!a),"data-tip":a?`Fewer settings`:`More settings`,className:`mt-2 inline-flex min-h-10 cursor-pointer items-center gap-2 border-0 bg-transparent p-0 text-sm font-medium text-accent-fg hover:text-accent-fg-hover [&>svg]:size-4`,children:[a?(0,J.jsx)(Ue,{"aria-hidden":`true`}):(0,J.jsx)(l,{"aria-hidden":`true`}),a?`Less`:`More`]}),(0,J.jsx)(kn,{open:a,children:(0,J.jsx)(Dn,{defs:y,edit:_,base:[],stacked:!0})})]})]})})}function ET({config:e,models:t,vars:n,onReload:r,onRename:i}){let[a,o]=(0,q.useState)(null),s=W(t.value.models),c=Object.keys(s),l=typeof t.value.default==`string`?t.value.default:``,u=String(Kr(e.value,[`llm`,`active`])??``);return(0,J.jsxs)(J.Fragment,{children:[(0,J.jsx)(U,{first:!0,children:`Models file`}),(0,J.jsx)(Oi,{def:{key:`models_file`,label:`Models file`,help:`Relative to forgeqe.yaml. Kept apart, so it can be shared.`,type:`path`,default:`./llms.json`},edit:e,base:[`llm`]}),(0,J.jsx)(H,{label:`Profile in use`,help:`Empty: the default below. --profile overrides it for one command.`,htmlFor:`llm-active`,yamlKey:e.file?`llm.active`:void 0,children:(0,J.jsxs)(ln,{id:`llm-active`,value:u,onChange:t=>e.set(K(e.value,[`llm`,`active`],t.target.value||void 0)),className:`w-full`,children:[(0,J.jsxs)(`option`,{value:``,children:[`The default (`,l||`none`,`)`]}),c.map(e=>(0,J.jsx)(`option`,{value:e,children:e},e)),u&&!c.includes(u)&&(0,J.jsxs)(`option`,{value:u,children:[u,` (not in the file)`]})]})}),(0,J.jsx)(U,{help:`Signing in adds the Copilot model and makes it the default.`,children:`Sign-ins`}),(0,J.jsx)(hT,{onChanged:r}),(0,J.jsx)(U,{children:`Default model`}),(0,J.jsxs)(`div`,{role:`radiogroup`,"aria-label":`Default model`,children:[c.length===0&&(0,J.jsx)(`p`,{className:`m-0 border-t border-line-soft py-6 text-sm text-muted`,children:`No models yet. Add one to start.`}),c.map(e=>{let r=W(s[e]),i=typeof r.api_key_env==`string`&&r.auth!==`entra`?r.api_key_env:``;return(0,J.jsxs)(`div`,{className:`flex min-h-[68px] flex-wrap items-center gap-x-4 gap-y-2 border-t border-line-soft py-4`,children:[(0,J.jsx)(Ww,{checked:l===e,onSelect:()=>t.set({...t.value,default:e}),label:`Make ${e} the default`}),(0,J.jsx)(Pr,{icon:Be,logo:Xi[String(r.provider)]}),(0,J.jsxs)(`span`,{className:`flex min-w-0 flex-[1_1_220px] flex-col gap-1`,children:[(0,J.jsx)(`span`,{className:`font-medium`,children:e}),(0,J.jsx)(`span`,{className:`text-sm text-muted`,children:[_T(r.provider),r.model].filter(Boolean).map(String).join(`, `)})]}),(0,J.jsxs)(`span`,{className:`flex items-center gap-4`,children:[i&&(0,J.jsx)(hr,{name:i,vars:n}),l===e&&(0,J.jsx)(`span`,{className:`text-[13px] text-muted`,children:`Default`})]}),(0,J.jsxs)(`span`,{className:`flex gap-2`,children:[(0,J.jsx)(V,{variant:`icon`,size:`icon-sm`,"aria-label":`Edit ${e}`,"data-tip":`Edit ${e}`,onClick:()=>o({mode:`edit`,from:e,name:e,profile:r}),children:(0,J.jsx)(re,{"aria-hidden":`true`})}),(0,J.jsx)(V,{variant:`icon`,size:`icon-sm`,"aria-label":`Remove ${e}`,"data-tip":`Remove ${e}`,onClick:()=>{let n={...s};delete n[e];let r=l===e?Object.keys(n)[0]||``:l,i={...t.value,models:n};r?i.default=r:delete i.default,t.set(i)},children:(0,J.jsx)(Ie,{"aria-hidden":`true`})})]})]},e)})]}),(0,J.jsx)(`div`,{className:`pt-4`,children:(0,J.jsxs)(V,{size:`sm`,"data-tip":`Add a model`,onClick:()=>o({mode:`add`,from:``,name:``,profile:{...vT.openai}}),children:[(0,J.jsx)(k,{"aria-hidden":`true`}),`Add`]})}),(0,J.jsx)(TT,{panel:a,setPanel:o,taken:e=>e in s,onApply:e=>{let n={...e.mode===`edit`&&e.name!==e.from?kr(s,e.from,e.name):s,[e.name]:e.profile},r=!l||e.mode===`edit`&&l===e.from?e.name:l;e.mode===`edit`&&e.name!==e.from&&i?.(e.from,e.name),t.set({...t.value,default:r,models:n})},vars:n})]})}var DT=[[`agent`,`Atlas`,`The shell, forgeqe run and forgeqe mcp.`],[`browser`,`Browser, desktop and mobile`,`Only models that take screenshots.`],[`coding`,`Writing and healing tests`,`Best model: a weaker one fails more.`],[`review`,`Reviews and judging`,``],[`analysis`,`Analysis and root cause`,`Best model.`],[`planning`,`Refining and planning`,``]],OT=[[`--profile`,`for one command`],[`The agent's own model`,`under its area below`],[`Its area's models`,`when Routing is Auto`],[`The profile in use`,`on Models`]];function kT({id:e,label:t,names:n,picked:r,onChange:i}){let[a,o]=(0,q.useState)(!1),[s,c]=(0,q.useState)(``),u=(0,q.useCallback)(()=>(o(!1),c(``)),[]),d=s.toLowerCase().split(/\s+/).filter(Boolean),f=n.filter(e=>d.every(t=>e.toLowerCase().includes(t))),p=r.length===0?`Auto: any model good enough`:r.length<=2?r.join(`, `):`${r.slice(0,2).join(`, `)} and ${r.length-2} more`;return(0,J.jsxs)(`div`,{className:`relative w-full`,children:[(0,J.jsxs)(`button`,{id:e,type:`button`,"aria-haspopup":`dialog`,"aria-expanded":a,onClick:()=>o(!a),className:`flex min-h-10 w-full cursor-pointer items-center gap-2 rounded-[8px] border border-line bg-bg px-4 text-left text-sm text-ink hover:border-line-strong`,children:[(0,J.jsx)(`span`,{className:`min-w-0 flex-1 truncate`,children:p}),(0,J.jsx)(l,{size:16,"aria-hidden":`true`,className:`flex-none text-muted`})]}),(0,J.jsxs)(qi,{open:a,onClose:u,label:`Models for ${t}`,role:`dialog`,side:`auto`,className:`right-0 left-0 max-h-[360px] min-w-0`,children:[n.length>6&&(0,J.jsxs)(`label`,{className:`relative mb-1 flex items-center`,children:[(0,J.jsx)(_e,{size:14,"aria-hidden":`true`,className:`pointer-events-none absolute left-2.5 text-muted`}),(0,J.jsx)(`span`,{className:`sr-only`,children:`Find a model`}),(0,J.jsx)(R,{value:s,placeholder:`Find a model`,onChange:e=>c(e.target.value),className:`h-9 pl-8 text-[13px]`,autoFocus:!0})]}),(0,J.jsxs)(`div`,{role:`group`,"aria-label":`Models for ${t}`,className:`flex flex-col`,children:[!s&&(0,J.jsx)(jT,{checked:!r.length,onSelect:()=>i([]),hint:`any model good enough for it`,children:`Auto`}),f.map(e=>(0,J.jsx)(jT,{checked:r.includes(e),onSelect:()=>i(r.includes(e)?r.filter(t=>t!==e):[...r,e]),children:e},e)),s&&!f.length&&(0,J.jsx)(`p`,{className:`m-0 px-4 py-2 text-[13px] text-muted`,children:`No model matches.`})]})]})]})}function AT(e,t){let n=e.toLowerCase().startsWith(`${t.toLowerCase()}:`)?e.slice(t.length+1).trim():e;return n.charAt(0).toUpperCase()+n.slice(1)}function jT({checked:e,onSelect:t,hint:n,children:r}){return(0,J.jsxs)(`button`,{type:`button`,role:`checkbox`,"aria-checked":e,onClick:t,className:`flex min-h-9 w-full cursor-pointer items-center gap-2 rounded-[8px] border-0 bg-transparent px-4 text-left text-[13px] text-ink hover:bg-surface-strong`,children:[(0,J.jsx)(`span`,{"aria-hidden":`true`,className:L(`flex size-4 flex-none items-center justify-center rounded-[4px] border text-[13px]`,e?`border-accent bg-accent text-accent-ink`:`border-line-strong bg-bg`),children:e?`✓`:``}),(0,J.jsx)(`span`,{className:`min-w-0 flex-1 truncate`,children:r}),n&&(0,J.jsx)(`span`,{className:`flex-none text-[13px] text-muted`,children:n})]})}function MT({config:e,models:t}){let n=Object.keys(W(t.value.models)),r=String(Kr(e.value,[`llm`,`routing`])??`off`),i=Kr(e.value,[`llm`,`fallback`])!==!1,a=String(Kr(e.value,[`llm`,`strategy`])??`balanced`),o=W(Kr(e.value,[`llm`,`routes`])),s=W(Kr(e.value,[`llm`,`agents`])),c=t=>e.file?`llm.${t}`:void 0,l=e=>typeof s[e]==`string`?String(s[e]):``,[u,d]=(0,q.useState)({}),f=e=>{let t=o[e];return t===void 0||t===`auto`?[]:(Array.isArray(t)?t:[t]).map(String)},p=(t,n)=>e.set(K(e.value,[`llm`,`routes`,t],n.length?n:void 0));return(0,J.jsxs)(J.Fragment,{children:[(0,J.jsx)(U,{first:!0,children:`Which model a call gets`}),(0,J.jsx)(`ol`,{"aria-label":`The first that applies wins`,className:`m-0 mb-4 flex list-none flex-col gap-2 p-0 text-[13px]`,children:OT.map(([e,t],n)=>(0,J.jsxs)(`li`,{className:`flex items-baseline gap-4`,children:[(0,J.jsx)(`span`,{className:`flex size-6 flex-none items-center justify-center self-center rounded-full bg-surface-strong text-[13px] font-semibold tabular-nums text-ink`,children:n+1}),(0,J.jsx)(`span`,{className:`font-medium text-ink`,children:e}),(0,J.jsx)(`span`,{className:`text-ink-2`,children:t})]},e))}),(0,J.jsx)(`p`,{className:`m-0 mb-2 text-[13px] text-muted`,children:`The first that applies wins. A model with no key or a refused sign-in falls back to one that works, when Fall back is on.`}),(0,J.jsx)(H,{label:`Routing`,help:`Auto: each area gets a model by the strategy below. Shadow: decides and logs only.`,htmlFor:`llm-routing`,yamlKey:c(`routing`),children:(0,J.jsxs)(ln,{id:`llm-routing`,value:r,onChange:t=>e.set(K(e.value,[`llm`,`routing`],t.target.value===`off`?void 0:t.target.value)),className:`w-full`,children:[(0,J.jsx)(`option`,{value:`off`,children:`Off: the profile in use`}),(0,J.jsx)(`option`,{value:`auto`,children:`Auto`}),(0,J.jsx)(`option`,{value:`shadow`,children:`Shadow (log only)`})]})}),(0,J.jsx)(H,{label:`Strategy`,help:`Atlas and the planners, which plan and hand out work, get the most capable model unless this is Cheapest.`,htmlFor:`llm-strategy`,yamlKey:c(`strategy`),children:(0,J.jsxs)(ln,{id:`llm-strategy`,value:a,onChange:t=>e.set(K(e.value,[`llm`,`strategy`],t.target.value===`balanced`?void 0:t.target.value)),className:`w-full`,children:[(0,J.jsx)(`option`,{value:`balanced`,children:`Balanced: capability weighed against price`}),(0,J.jsx)(`option`,{value:`capability`,children:`Most capable for every area`}),(0,J.jsx)(`option`,{value:`cost`,children:`Cheapest: good enough for each area`})]})}),(0,J.jsx)(H,{label:`Fall back`,help:`Use a working model when one has no key or its sign-in is refused, Copilot first.`,yamlKey:c(`fallback`),children:(0,J.jsx)(si,{checked:i,onChange:t=>e.set(K(e.value,[`llm`,`fallback`],t?void 0:!1)),label:`Fall back to a working model`})}),(0,J.jsx)(U,{help:r===`off`?`Routing is off: an area's models apply once it is Auto. An agent's own model applies always.`:`Auto: any model good enough. One model picked pins the area to it.`,children:`Areas of work`}),n.length===0&&(0,J.jsx)(`p`,{className:`m-0 border-t border-line-soft py-4 text-sm text-muted`,children:`Add models under Models first.`}),n.length>0&&DT.map(([t,r,i])=>{let a=f(t),o=a.filter(e=>!n.includes(e)),s=pT.filter(e=>e.area===t),m=s.filter(e=>l(e.name)).length,h=u[t]??m>0;return(0,J.jsxs)(`div`,{className:`border-t border-line-soft`,children:[(0,J.jsx)(H,{label:r,help:o.length?(0,J.jsxs)(`span`,{className:`text-fail`,children:[`Not in the models file: `,o.join(`, `)]}):i||void 0,yamlKey:c(`routes.${t}`),className:`border-t-0`,children:(0,J.jsx)(`div`,{className:`flex w-full flex-wrap items-center gap-2 sm:w-[340px] sm:flex-none sm:justify-end`,children:(0,J.jsx)(kT,{id:`llm-route-${t}`,label:r,names:n,picked:a,onChange:e=>p(t,e)})})}),(0,J.jsxs)(`button`,{type:`button`,"aria-expanded":h,onClick:()=>d({...u,[t]:!h}),className:`-mt-2 mb-2 inline-flex min-h-8 cursor-pointer items-center gap-2 rounded-[8px] border-0 bg-transparent px-2 text-[13px] text-ink-2 hover:bg-surface-muted hover:text-ink`,children:[(0,J.jsx)(M,{size:14,"aria-hidden":`true`,className:L(`transition-transform`,h&&`rotate-90`)}),(0,J.jsx)(`span`,{"aria-hidden":`true`,className:`flex items-center -space-x-1`,children:s.slice(0,5).map(e=>(0,J.jsx)(Vn,{agent:e.name,px:18,decorative:!0,className:`rounded-[5px] ring-2 ring-bg`},e.name))}),s.length,` `,s.length===1?`agent`:`agents`,m>0&&(0,J.jsxs)(`span`,{className:`text-muted`,children:[`· `,m,` with `,m===1?`its`:`their`,` own model`]})]}),(0,J.jsx)(kn,{open:h,children:(0,J.jsx)(`ul`,{className:`m-0 mb-4 flex list-none flex-col p-0 pl-6`,children:s.map(t=>{let r=l(t.name),i=`llm-agent-${t.name}`;return(0,J.jsxs)(`li`,{className:`flex flex-wrap items-center gap-x-10 gap-y-2 py-2`,children:[(0,J.jsxs)(`label`,{htmlFor:i,"data-tip":c(`agents.${t.name}`),className:`flex min-w-0 flex-[1_1_220px] items-start gap-2 text-[13px] text-ink`,children:[(0,J.jsx)(Vn,{agent:t.name,px:22,decorative:!0,className:`mt-1`}),(0,J.jsxs)(`span`,{className:`flex min-w-0 flex-col`,children:[(0,J.jsx)(`span`,{className:`font-medium`,children:Ln(t.name).name}),(0,J.jsx)(`span`,{className:`text-[13px] text-ink-2`,children:AT(t.label,Ln(t.name).name)}),r&&!n.includes(r)&&(0,J.jsxs)(`span`,{className:`block text-[13px] text-fail`,children:[`Not in the models file: `,r]})]})]}),(0,J.jsx)(`div`,{className:`flex w-full flex-wrap items-center gap-2 sm:w-[340px] sm:flex-none sm:justify-end`,children:(0,J.jsxs)(ln,{id:i,value:r,onChange:n=>e.set(K(e.value,[`llm`,`agents`,t.name],n.target.value||void 0)),className:`w-full`,children:[(0,J.jsx)(`option`,{value:``,children:`The area's model`}),n.map(e=>(0,J.jsx)(`option`,{value:e,children:e},e)),r&&!n.includes(r)&&(0,J.jsxs)(`option`,{value:r,children:[r,` (not in the file)`]})]})})]},t.name)})})})]},t)})]})}var NT=(...e)=>e.map(([e,t])=>({value:e,label:t})),PT=[{title:`Where runs happen`,base:[`browser`],fields:[{key:`provider`,label:`Browser`,help:`Where the browser agent runs. Remote grids need their sign-in under Integrations.`,type:`select`,default:`local`,options:NT([`local`,`Chrome on this machine`],[`docker`,`Chrome in Docker`],[`browserstack`,`BrowserStack`],[`testmu`,`TestMu AI (LambdaTest)`])},{key:`local_browser`,label:`Local browser`,help:`Automatic tries Chrome first, then Edge, then Playwright's Chromium, each when the one before does not start.`,type:`select`,default:`auto`,options:NT([`auto`,`Automatic`],[`chrome`,`Google Chrome`],[`edge`,`Microsoft Edge`],[`chromium`,`Playwright's Chromium`]),when:e=>!e.provider||e.provider===`local`},{key:`launch`,label:`How it starts`,help:`Automatic starts the browser directly, then through Playwright when this computer stops it, and remembers what worked.`,type:`select`,default:`auto`,options:NT([`auto`,`Automatic`],[`direct`,`Directly`],[`playwright`,`Through Playwright`],[`attach`,`Connect to a browser I started`]),when:e=>!e.provider||e.provider===`local`},{key:`attach_port`,label:`Port of your browser`,help:`Start it with --remote-debugging-port and this number. Only on this computer.`,type:`number`,placeholder:`9222`,when:e=>(!e.provider||e.provider===`local`)&&e.launch===`attach`},{key:`start_url`,label:`Start page`,help:`Leave empty to let the agent choose, or to start at the active environment's app.`,type:`url`,placeholder:`https://staging.example.com`},{key:`allowed_hosts`,label:`Allowed sites`,help:`Hosts the agent may open, comma separated. Empty: the environment's apps.`,type:`list`,placeholder:`staging.example.com, auth.example.com`}]},{title:`The browser window`,base:[`browser`],fields:[{key:`headless`,label:`Run without a window`,help:`Off shows the browser while the agent works.`,type:`switch`,default:!0},{key:`window`,label:`Visible window`,type:`select`,default:`maximized`,options:NT([`maximized`,`Maximized`],[`viewport`,`The size below`])},{key:`viewport.width`,label:`Page width`,type:`number`,default:1280},{key:`viewport.height`,label:`Page height`,type:`number`,default:800},{key:`overlay`,label:`Show what the agent does`,help:`In a visible browser: a bar with the current step, and your mouse and keyboard locked while it works.`,type:`switch`,default:!0}]},{title:`Limits and checks`,base:[`browser`],fields:[{key:`max_steps`,label:`Steps before a checkpoint`,help:`A run still making progress carries on, up to three times this.`,type:`number`,default:40},{key:`timeout_seconds`,label:`Time limit per run`,help:`In seconds.`,type:`number`,default:600},{key:`vision_detail`,label:`Screenshot detail`,help:`High reads small text better and costs more.`,type:`select`,default:`low`,options:NT([`low`,`Low`],[`high`,`High`])},{key:`video`,label:`Record a video`,type:`switch`,default:!0},{key:`judge`,label:`Second check of each result`,help:`Another model call checks each finished run against its goal, and can fail it.`,type:`switch`,default:!1},{key:`rulebook`,label:`Learn rules per site`,help:`One-line rules the agent keeps after it recovers from a failed action.`,type:`switch`,default:!0}]},{title:`Remote browser, set here`,help:`For BrowserStack or TestMu AI set inline in forgeqe.yaml. These win over the grid's own file under Integrations when both are set.`,base:[`browser`,`remote`],fields:[{key:`browser`,label:`Browser`,type:`text`,placeholder:`chrome`},{key:`browser_version`,label:`Browser version`,type:`text`,placeholder:`latest`},{key:`os`,label:`Operating system`,help:`BrowserStack: Windows or OS X.`,type:`text`,placeholder:`Windows`},{key:`os_version`,label:`Its version`,type:`text`,placeholder:`11, or Sequoia`},{key:`platform`,label:`Platform`,help:`TestMu AI; or set the two above and ForgeQE joins them.`,type:`text`,placeholder:`Windows 11`},{key:`username_env`,label:`User name`,type:`var`,placeholder:`BROWSERSTACK_USERNAME`},{key:`access_key_env`,label:`Access key`,type:`var`,placeholder:`BROWSERSTACK_ACCESS_KEY`},{key:`project`,label:`Project`,type:`text`,placeholder:`ForgeQE`},{key:`build`,label:`Build`,type:`text`,placeholder:`nightly`},{key:`name`,label:`Session name`,type:`text`,placeholder:`checkout smoke`},{key:`local`,label:`Through a tunnel`,help:`BrowserStack Local or the LambdaTest tunnel, for sites only your network reaches.`,type:`switch`,default:!1},{key:`extra`,label:`More capabilities`,help:`The provider's own, one per line.`,type:`kv`,placeholder:`browserstack.console = errors`}]}],FT=[{title:`Where tests go`,base:[`code`],fields:[{key:`repo`,label:`Repository`,help:`Where passed runs become tests. Empty: this folder.`,type:`path`,placeholder:`../my-app`},{key:`test_command`,label:`Test command`,help:`Empty: the agent finds it.`,type:`path`,placeholder:`npx playwright test`},{key:`model`,label:`Model`,help:`Empty: the default model.`,type:`text`,placeholder:`anthropic/claude-sonnet-4-5`},{key:`review_profile`,label:`Checker's model`,help:`A profile from Models. Checker only reads and judges, so a cheaper one is enough.`,type:`text`},{key:`runtime`,label:`Agent runtime`,help:`Empty: the runtime ForgeQE downloads.`,type:`path`,placeholder:`/path/to/agent-runtime`}]},{title:`How hard it tries`,base:[`code`],fields:[{key:`max_attempts`,label:`Attempts`,help:`Test runs before it gives up, and healing attempts.`,type:`number`,default:3},{key:`test_timeout_seconds`,label:`Time limit per test run`,help:`In seconds.`,type:`number`,default:600},{key:`confirm_runs`,label:`Passes in a row before a test counts`,help:`A new test is run again until it has passed this many times in a row, to catch a flaky test. 1 runs it once.`,type:`number`,default:3},{key:`stall_after`,label:`Stop after repeated failures`,help:`When one command has failed this many times.`,type:`number`,default:5},{key:`repeat_after`,label:`Stop after repeated look-ups`,help:`When the coding agent has re-read files or state it already saw, unchanged, this many times; it is then asked for its test.`,type:`number`,default:6},{key:`edit_after`,label:`Stop after repeated edits`,help:`When the coding agent has changed files it already changed this many times without handing its test over to be run.`,type:`number`,default:8},{key:`max_tokens`,label:`Token limit per job`,help:`Cached input counts at its share of the input price. 0 turns the limit off.`,type:`number`,default:15e5}]},{title:`Help it gets`,base:[`code`],fields:[{key:`replay`,label:`Replay the steps first`,help:`Runs the steps as a Playwright script and hands over what worked.`,type:`switch`,default:!0},{key:`live_browser`,label:`Look at the failing page`,help:`Once a step fails, the agent looks at that page in a browser.`,type:`switch`,default:!0},{key:`graph`,label:`Read the repository's code`,help:`Links the run's elements to the page objects that already locate them.`,type:`switch`,default:!0},{key:`duplicates`,label:`Check for copied code`,help:`Tells the reviewer which code a new test or a pull request copied from the repository (jscpd).`,type:`switch`,default:!0},{key:`header`,label:`Mark generated files`,help:`Files ForgeQE creates start with a “Generated with ForgeQE” line.`,type:`switch`,default:!0},{key:`rulebook`,label:`Learn from its own mistakes`,type:`switch`,default:!0},{key:`requests`,label:`When an agent asks for more`,help:`Packages, a command its shell refuses, or a change to package.json. Shells, pushes, .npmrc and lockfiles are refused whatever this says.`,type:`select`,default:`ask`,options:NT([`ask`,`Ask me each time`],[`allow`,`Allow without asking`],[`off`,`Always refuse`])}]}],IT=[{title:`Reports`,base:[],fields:[{key:`export.out_dir`,label:`Report folder`,help:`One folder per run.`,type:`path`,default:`./.forgeqe/reports`},{key:`export.format`,label:`Test format`,type:`select`,default:`playwright`,options:NT([`playwright`,`Playwright`])},{key:`report.screenshots`,label:`Screenshots in reports`,type:`select`,default:`all`,options:NT([`all`,`Every step`],[`failures`,`Failures only`],[`off`,`None`])},{key:`report.accessibility`,label:`Check accessibility of each page`,type:`switch`,default:!0},{key:`suite.out_dir`,label:`Suite report folder`,type:`path`,default:`./.forgeqe/reports/suites`}]},{title:`Memory and replays`,base:[],fields:[{key:`memory.enabled`,label:`Remember pages and flows`,type:`switch`,default:!0},{key:`memory.dir`,label:`Memory folder`,type:`path`,default:`./.forgeqe/memory`},{key:`memory.replay`,label:`Replays`,help:`Verify checks each recorded step; trust replays without a model.`,type:`select`,default:`verify`,options:NT([`verify`,`Verify`],[`trust`,`Trust`],[`off`,`Off`])},{key:`registry.mode`,label:`Replay passed runs for free`,help:`Running a passed test again repeats its saved steps without the AI; if the page changed, the AI takes over. Test mode only notes what it would have replayed.`,type:`select`,default:`on`,options:NT([`on`,`On`],[`shadow`,`Test mode: only note it`],[`off`,`Off`])}]},{title:`Suites`,base:[],fields:[{key:`suite.code`,label:`Write tests for passed cases`,help:`With a repository set under Code.`,type:`switch`,default:!0},{key:`suite.restore_sessions`,label:`Start each case signed in`,help:`Cases start from the saved logins' sessions. Off runs each case as its test starts, signed out.`,type:`switch`,default:!1},{key:`suite.case_check`,label:`Before a run, check the cases`,help:`Warn shows what the check found and runs every case; block leaves out the ones that cannot run as written.`,type:`select`,default:`warn`,options:NT([`warn`,`Warn`],[`block`,`Block`],[`off`,`Off`])}]},{title:`Flaky tests`,help:`A test that fails and then passes is flaky; quarantine keeps it running, but its failures stop failing the run and CI.`,base:[`flaky`],fields:[{key:`retries`,label:`Runs again in the same run`,help:`0 to 3.`,type:`number`,default:1},{key:`quarantine`,label:`Quarantine`,type:`select`,default:`suggest`,options:NT([`suggest`,`The agent asks first`],[`auto`,`ForgeQE does it`],[`off`,`Off: history only`])},{key:`flaky_after`,label:`Flaky from this score`,type:`number`,default:2}]},{title:`Release readiness`,help:`When a release reads GO, GO WITH RISKS or NO-GO.`,base:[`release`],fields:[{key:`max_critical`,label:`Open critical bugs allowed`,type:`number`,default:0},{key:`max_high`,label:`Open high bugs allowed`,type:`number`,default:0},{key:`min_pass_rate`,label:`Pass rate needed`,help:`Percent of executed test cases.`,type:`number`,default:95},{key:`require_tests`,label:`A story needs a test case`,help:`Without one it is a risk.`,type:`switch`,default:!0}]},{title:`Regression packs in a pipeline`,help:`Where Run in the pipeline sends a pack (forgeqe pack run --on pipeline).`,base:[`packs`,`pipeline`],fields:[{key:`default`,label:`Pipeline`,type:`select`,options:NT([`github`,`GitHub Actions`],[`azure_devops`,`Azure Pipelines`])},{key:`github.repo`,label:`GitHub repository`,type:`text`,placeholder:`acme/shop-tests`},{key:`github.workflow`,label:`Workflow file`,type:`text`,default:`forgeqe-pack.yml`},{key:`github.ref`,label:`Branch`,type:`text`,default:`main`},{key:`azure_devops.project`,label:`Azure DevOps project`,type:`text`,placeholder:`Shop`},{key:`azure_devops.pipeline_id`,label:`Pipeline id`,type:`number`,placeholder:`42`},{key:`azure_devops.ref`,label:`Branch`,type:`text`,default:`refs/heads/main`},{key:`timeout_minutes`,label:`Wait for it`,help:`In minutes.`,type:`number`,default:60}]},{title:`Defect analysis`,help:`For a failed case that is a defect: a repro, suspect commits in the product's repository, and a root-cause hypothesis.`,base:[`defects`],fields:[{key:`product_repo`,label:`Product repository`,help:`The application's code: suspect commits, and what the analysis reads.`,type:`path`,placeholder:`../shop`},{key:`reproduce`,label:`Run a new defect's case once more`,help:`To see whether it repeats.`,type:`switch`,default:!0},{key:`analyze`,label:`Write a root-cause hypothesis`,help:`One model session per new defect or regression.`,type:`switch`,default:!0},{key:`max_analyses`,label:`Analyses per suite`,type:`number`,default:3}]}],LT=[{title:`Accessibility`,base:[`quality`],fields:[{key:`accessibility.standard`,label:`Standard`,type:`select`,default:`wcag21aa`,options:NT([`wcag2a`,`WCAG 2.0 A`],[`wcag21aa`,`WCAG 2.1 AA`],[`wcag22aa`,`WCAG 2.2 AA`],[`wcag21aaa`,`WCAG 2.1 AAA`],[`section508`,`Section 508`],[`en301549`,`EN 301 549`],[`best-practice`,`Best practice`])},{key:`accessibility.ask_before_run`,label:`Ask before running a persona session`,help:`The Accessibility agent shows its plan and asks before it starts the browser runs, a few minutes and model tokens each. Off: it runs the plan straight away.`,type:`switch`,default:!0},{key:`budgets.accessibility.critical`,label:`Critical issues allowed`,help:`Empty: reported, never failed on.`,type:`number`},{key:`budgets.accessibility.serious`,label:`Serious issues allowed`,type:`number`},{key:`budgets.accessibility.ignore`,label:`Rules to ignore`,type:`list`,placeholder:`region`}]},{title:`Performance and visual changes`,base:[`quality`],fields:[{key:`budgets.performance`,label:`Performance budget`,help:`web-vitals uses Google's thresholds. Per-page budgets are edited in Settings as text.`,type:`select`,options:NT([`web-vitals`,`Core Web Vitals`])},{key:`budgets.visual`,label:`Visual change allowed`,help:`Percent of a page's pixels.`,type:`number`},{key:`visual.full_page`,label:`Compare whole pages`,type:`switch`,default:!1},{key:`visual.mask`,label:`Hide before comparing`,help:`CSS selectors, comma separated.`,type:`list`,placeholder:`.clock, #ad-slot`}]},{title:`API tests`,base:[`api`],fields:[{key:`capture`,label:`Record the app's API calls`,help:`In every browser run, with secrets redacted.`,type:`switch`,default:!0},{key:`base_url`,label:`API address`,type:`url`,placeholder:`https://staging.shop.example`},{key:`third_party`,label:`Keep calls to other sites`,type:`switch`,default:!1},{key:`browser_fallback`,label:`Send blocked calls from a browser page`,help:`When the site's bot protection answers a read-only call with a challenge or block page, the call is sent again from a page of a real browser on the API's site. Never a call that changes data.`,type:`switch`,default:!0},{key:`keep_headers`,label:`More headers to keep`,help:`On the API calls runs, recordings and re-runs capture, and in the calls made from them: a tenant or a correlation id, comma separated. Never one that carries a credential (Authorization, cookies, a token or key).`,type:`list`,placeholder:`X-Tenant, X-Correlation-Id`},{key:`timeout_seconds`,label:`Time limit per call`,help:`In seconds.`,type:`number`,default:30},{key:`headers`,label:`Headers on every call`,help:"Values are ${NAME} references to environment variables, never the values.",type:`kv`,placeholder:"Authorization = Bearer ${API_TOKEN}"}]},{title:`API sign-in with OAuth2`,base:[`api`,`oauth2`],fields:[{key:`token_url`,label:`Token address`,help:`https only. ForgeQE asks it for a token with the client-credentials grant and sends it as a bearer token.`,type:`url`,placeholder:`https://login.shop.example/oauth2/token`},{key:`client_id_env`,label:`Client id`,type:`var`,placeholder:`SHOP_API_CLIENT_ID`},{key:`client_secret_env`,label:`Client secret`,type:`var`,placeholder:`SHOP_API_CLIENT_SECRET`},{key:`scope`,label:`Scope`,help:`Space separated.`,type:`text`,placeholder:`orders.read orders.write`},{key:`audience`,label:`Audience`,help:`When the provider asks for one.`,type:`text`,placeholder:`https://api.shop.example`}]},{title:`API load testing`,base:[`api`,`load`],fields:[{key:`users`,label:`Virtual users`,help:`1 to 50.`,type:`number`,placeholder:`10`},{key:`duration_seconds`,label:`Duration`,help:`In seconds, up to 600.`,type:`number`,placeholder:`60`},{key:`limits.p95_ms`,label:`p95 latency limit`,help:`Milliseconds. Broken: the run fails.`,type:`number`,placeholder:`800`},{key:`limits.p99_ms`,label:`p99 latency limit`,help:`Milliseconds.`,type:`number`,placeholder:`1500`},{key:`limits.error_rate`,label:`Error rate limit`,help:`0 to 1.`,type:`number`,placeholder:`0.01`},{key:`limits.min_rps`,label:`Throughput floor`,help:`Calls per second.`,type:`number`,placeholder:`20`}]},{title:`API client certificate (mutual TLS)`,base:[`api`,`tls`],fields:[{key:`cert`,label:`Certificate`,help:`A PEM file.`,type:`path`,placeholder:`~/.certs/shop-client.pem`},{key:`key`,label:`Private key`,help:`A PEM file kept out of the repository.`,type:`path`,placeholder:`~/.certs/shop-client-key.pem`},{key:`ca`,label:`Authorities trusted`,help:`A PEM file, for an API with its own certificate authority.`,type:`path`,placeholder:`~/.certs/shop-ca.pem`},{key:`key_passphrase_env`,label:`Key passphrase`,type:`var`,placeholder:`SHOP_API_KEY_PASSPHRASE`}]}],RT=[{title:`Search service`,base:[`rag`],fields:[{key:`url`,label:`Address`,help:`ForgeQE sends POST {query, top_k} and reads the passages it answers.`,type:`url`,placeholder:`https://search.acme.example/search`},{key:`token_env`,label:`Token`,help:`Sent as a bearer token to that address only.`,type:`var`,placeholder:`RAG_TOKEN`},{key:`mcp.server`,label:`MCP server`,help:`Its name under MCP servers.`,type:`text`,placeholder:`docs`},{key:`mcp.tool`,label:`Its search tool`,type:`text`,placeholder:`search`},{key:`mcp.query_arg`,label:`The tool's query argument`,type:`text`,default:`query`},{key:`mcp.top_k_arg`,label:`The tool's argument for how many`,help:`Empty: the tool decides.`,type:`text`,placeholder:`limit`},{key:`command`,label:`Command`,help:`Gets {query, top_k} on stdin and prints passages. Comma separated.`,type:`list`,placeholder:`python, rag/search.py`},{key:`documents.folders`,label:`More folders`,help:`Folders inside the project, beside the knowledge folder, the documents below and product.docs. Comma separated.`,type:`list`,placeholder:`docs/requirements, docs/specs`},{key:`documents.reasoning`,label:`Let the model pick sections`,help:`Skimmer picks the sections that answer from their outline: one model call per search. Off: keywords only.`,type:`switch`},{key:`top_k`,label:`Passages per search`,type:`number`,default:5},{key:`timeout_seconds`,label:`Time limit`,help:`In seconds.`,type:`number`,default:20}]}],zT=[{title:`The product`,help:`Agents design and judge tests as an expert in this industry, and add the obligations of each regulation a feature touches.`,base:[],fields:[{key:`product.name`,label:`Product name`,type:`text`,placeholder:`Shop`},{key:`domain.industry`,label:`Industry`,type:`text`,placeholder:`retail banking`},{key:`domain.regulations`,label:`Regulations`,type:`list`,placeholder:`DORA, PSD2, GDPR`},{key:`domain.notes`,label:`Notes`,type:`textarea`,placeholder:`Payments to UK and EU accounts; customers are consumers and small businesses.`}]},{title:`Where the knowledge is kept`,help:`The product graph forgeqe knowledge build writes, and how much of it a browser run gets. Page memory is under Reports and memory.`,base:[`knowledge`],fields:[{key:`dir`,label:`Product knowledge folder`,type:`path`,default:`.forgeqe/knowledge`},{key:`browser_max_chars`,label:`Knowledge per browser run`,help:`Characters. 0: none.`,type:`number`,default:1500}]},{title:`The graph store`,help:`Neo4j keeps the product graph and BASAL's scenario graphs, so agents search them by meaning as well as words. forgeqe graph setup starts it after you agree: Docker first, else a native install, on this computer only. Without it, the graph's JSON file is used.`,base:[`graph`],fields:[{key:`store`,label:`Graph store`,type:`select`,default:`auto`,options:NT([`auto`,`Neo4j when it is running`],[`neo4j`,`Neo4j, required`],[`json`,`The JSON file only`])},{key:`neo4j.setup`,label:`Neo4j runs`,help:`Automatic uses Docker when it is installed, else downloads Neo4j and Java once.`,type:`select`,default:`auto`,options:NT([`auto`,`Automatic`],[`docker`,`In Docker`],[`native`,`Installed by ForgeQE`],[`server`,`On our own server`]),when:e=>e.store!==`json`},{key:`neo4j.url`,label:`Address`,help:`Another computer needs TLS: bolt+s:// or neo4j+s://.`,type:`text`,placeholder:`bolt://127.0.0.1:7688`,when:e=>e.store!==`json`},{key:`neo4j.user`,label:`User`,type:`text`,placeholder:`neo4j`,when:e=>e.store!==`json`},{key:`neo4j.password_env`,label:`Password variable`,help:`Its value is kept in Settings › Secrets. ForgeQE makes one for its own Neo4j.`,type:`text`,placeholder:`FORGEQE_NEO4J_PASSWORD`,when:e=>e.store!==`json`},{key:`embedding`,label:`Embedding model`,help:`A profile of llms.json that embeds, such as text-embedding-3-large. Empty: search by words only.`,type:`text`,placeholder:`azure-embed`,when:e=>e.store!==`json`},{key:`embedding_dimensions`,label:`Vector size`,type:`number`,default:1536,when:e=>e.store!==`json`&&!!e.embedding}]},{title:`The team's knowledge`,help:`Where the pipeline publishes the built product knowledge (forgeqe knowledge pipeline init). forgeqe knowledge pull brings it here: no repository needs to be cloned. One of a git branch, a link, or a file.`,base:[`product`,`shared`],fields:[{key:`git`,label:`Repository`,help:`The repository the pipeline publishes to.`,type:`text`,placeholder:`https://dev.azure.com/acme/Shop/_git/qa`},{key:`branch`,label:`Branch`,type:`text`,placeholder:`forgeqe-knowledge`},{key:`file`,label:`Pack in it`,type:`text`,placeholder:`shop.knowledge.forgeqe`},{key:`url`,label:`Or a link`,help:`https; a token goes to that host only.`,type:`url`,placeholder:`https://files.acme.local/shop.knowledge.forgeqe`},{key:`path`,label:`Or a file`,help:`On this computer or a shared folder.`,type:`path`,placeholder:`//share/qa/shop.knowledge.forgeqe`},{key:`token_env`,label:`Token`,help:`With the repository or the link. Empty: git's own sign-in.`,type:`var`,placeholder:`ADO_PAT`},{key:`user`,label:`User name for the token`,help:`Only when the server needs one.`,type:`text`}]}],BT=[{title:`Building the graph`,help:`forgeqe knowledge build reads the repositories and documents into one graph the agents search: services, endpoints, tables, tests, and how they connect.`,base:[`product`],fields:[{key:`exclude`,label:`Files to leave out`,help:`Glob patterns, comma separated, beside each repository's .gitignore and .forgeqeignore.`,type:`list`,placeholder:`**/generated/**`},{key:`model`,label:`Understand the code with the model`,help:`Off: structure only; nothing is sent to a model.`,type:`switch`,default:!0},{key:`max_model_files`,label:`Files the model reads per build`,help:`0: none. Only new and changed files are read again.`,type:`number`,default:400},{key:`max_investigation_steps`,label:`Steps per question`,help:`5 to 200. Most tool calls one question to the product makes; at the limit it answers with what it found.`,type:`number`,placeholder:`40`}]}],VT=[...RT,...zT,...BT],HT=[{key:`host`,label:`Host`,type:`select`,options:NT([`github`,`GitHub`],[`azure-devops`,`Azure DevOps`],[`gitlab`,`GitLab`],[`bitbucket-cloud`,`Bitbucket Cloud`],[`bitbucket-server`,`Bitbucket Data Center`])},{key:`url`,label:`Address`,help:`A server of your own (GitHub Enterprise, GitLab, Azure DevOps Server, Bitbucket Data Center). Empty: the host's cloud.`,type:`url`,placeholder:`https://git.acme.example`},{key:`org`,label:`Organization`,help:`Azure DevOps' organization; a Bitbucket Cloud workspace.`,type:`text`,placeholder:`acme`},{key:`auth`,label:`Sign in`,type:`select`,options:NT([`browser`,`In the browser`],[`token`,`With a token`])},{key:`token_env`,label:`Token`,type:`var`,placeholder:`GITHUB_TOKEN`},{key:`user`,label:`User name for the token`,help:`Bitbucket only, with an app password.`,type:`text`}],UT=[{title:`Instructions and knowledge`,base:[],fields:[{key:`prompts.step_instruction`,label:`Extra instruction for the browser agent`,type:`textarea`},{key:`prompts.dir`,label:`Shared prompts folder`,help:`Wins over .forgeqe/prompts.`,type:`path`,placeholder:`../shared-prompts`},{key:`guardrails.dir`,label:`Guardrails folder`,type:`path`,default:`.forgeqe/guardrails`},{key:`prompts.guiderails`,label:`Guardrails kept in forgeqe.yaml`,help:`The older way: one rule per line. Prefer Guardrails.`,type:`textarea`}]},{title:`Custom agents`,help:`The team's agents for one job each (Agents, Custom agents). Off: none of them runs, from the terminal, this app, Atlas or a schedule; their files and history are kept.`,base:[`custom_agents`],fields:[{key:`enabled`,label:`Custom agents on`,help:`Off: none runs, and their scheduled runs do not start.`,type:`switch`,default:!0}]},{title:`Capabilities`,help:`The agent gets the tools a request is about. Pin some on, or turn some off for this project (forgeqe features lists them).`,base:[`agent`,`capabilities`],fields:[{key:`always`,label:`Always given`,type:`list`,placeholder:`regression-packs`},{key:`off`,label:`Never given`,type:`list`,placeholder:`desktop-apps`}]}],WT=[{id:`jira`,icon:$e,name:`Jira`,note:`Test cases, results and bugs`,base:[`sources`,`jira`],vars:[`email_env`,`token_env`],fields:[{key:`url`,label:`Site`,type:`url`,placeholder:`https://acme.atlassian.net`},{key:`email_env`,label:`Email variable`,help:`Cloud only.`,type:`var`,default:`JIRA_EMAIL`},{key:`token_env`,label:`Token variable`,type:`var`,default:`JIRA_API_TOKEN`},{key:`mcp`,label:`MCP server`,type:`select`,default:`mcp-atlassian`,options:NT([`mcp-atlassian`,`mcp-atlassian (Cloud and Server)`],[`rovo`,`Rovo (Atlassian's, Cloud)`],[`false`,`None`])},{key:`test_cases`,label:`Where existing test cases are`,help:`One line per story project: the Jira project key (or * for the rest) = project=, label=, component=, type=, separated by ;. Saving cases reads only there (at most 300) to reuse or extend one.`,type:`kv`,placeholder:`SHOP = label=regression; component=Checkout
59
- * = project=QA`},{key:`sibling_cases`,label:`Also compare with the epic's other stories`,help:`The tests of the other stories under the story's epic (Jira Cloud parent; the first 30 stories).`,type:`switch`,default:!1},{key:`new_cases.priority`,label:`Priority of new test cases`,help:`A priority name. The agent may give a case its own.`,type:`text`,placeholder:`Medium`},{key:`new_cases.tags`,label:`Labels on new test cases`,help:`No spaces. Added to the case's own.`,type:`list`,placeholder:`forgeqe`},{key:`retire_label`,label:`Label of a retired test case`,help:`What retire_test_case adds; nothing is deleted.`,type:`text`,default:`obsolete`},{key:`done_statuses`,label:`Statuses that mean done`,help:`Only where the site categorises its own statuses wrongly; otherwise Jira's status category says, custom statuses included.`,type:`list`,placeholder:`Verified, Shipped`}]},{id:`azure_devops`,icon:Ve,name:`Azure DevOps`,note:`Test plans, work items and wiki`,base:[`sources`,`azure_devops`],vars:[`token_env`],fields:[{key:`test_plans`,label:`Test plans in Test management`,help:`plan=12, or plan=12/suite=34. Every case of these shows in Test management, synced from here.`,type:`list`,placeholder:`plan=12, plan=19/suite=204`},{key:`org_url`,label:`Organization`,type:`url`,placeholder:`https://dev.azure.com/acme`},{key:`project`,label:`Project`,help:`Empty: every project.`,type:`text`,placeholder:`Shop`},{key:`token_env`,label:`Token variable`,help:`A PAT with Test Management and Work Items, read and write.`,type:`var`,default:`ADO_PAT`},{key:`mcp`,label:`Use Microsoft's MCP server`,type:`switch`,default:!0},{key:`mcp_domains`,label:`MCP tool groups`,type:`list`,placeholder:`core, work, work-items, pipelines`},{key:`test_cases`,label:`Where existing test cases are`,help:`One line per story area path (or * for the rest) = plan=12, plan=12/suite=34, or area=<area path>. Saving cases reads only there (at most 300) to reuse or extend one.`,type:`kv`,placeholder:`Shop\\Checkout = plan=12/suite=34
60
- * = area=Shop\\Regression`},{key:`sibling_cases`,label:`Also compare with the feature's other stories`,help:`The cases of the other stories under the story's feature or epic (the first 30 stories).`,type:`switch`,default:!1},{key:`new_cases.priority`,label:`Priority of new test cases`,help:`1 (highest) to 4. The agent may give a case its own.`,type:`number`,placeholder:`2`},{key:`new_cases.tags`,label:`Tags on new test cases`,help:`Added to the case's own.`,type:`list`,placeholder:`forgeqe`},{key:`new_cases.state`,label:`State of new test cases`,help:`For example Design, so a person reviews a case before it is Ready.`,type:`text`,placeholder:`Design`},{key:`retire_state`,label:`State of a retired test case`,help:`What retire_test_case sets; nothing is deleted. Empty: a state the project itself calls done.`,type:`text`,placeholder:`Closed`},{key:`states.done`,label:`States that mean done`,help:`Only where the project categorises its own states wrongly; otherwise they are read from the project, custom ones included.`,type:`list`,placeholder:`Verified, Shipped`},{key:`states.removed`,label:`States that mean removed`,help:`States for an item taken out of the project.`,type:`list`,placeholder:`Dropped`},{key:`shared_steps`,label:`Shared steps to use`,help:`Shared Steps work item ids. New cases refer to them instead of copying their steps.`,type:`list`,placeholder:`345, 346`}]},{id:`xray`,icon:ht,name:`Xray`,note:`Test cases in Jira, through Xray Cloud`,base:[`sources`,`xray`],vars:[`client_id_env`,`client_secret_env`],fields:[{key:`test_plans`,label:`Test plans in Test management`,help:`A test plan's key: plan=SHOP-100. Every case of these shows in Test management, synced from here.`,type:`list`,placeholder:`plan=SHOP-100`},{key:`url`,label:`Address`,type:`url`,default:`https://xray.cloud.getxray.app`},{key:`client_id_env`,label:`Client id variable`,type:`var`,default:`XRAY_CLIENT_ID`},{key:`client_secret_env`,label:`Client secret variable`,type:`var`,default:`XRAY_CLIENT_SECRET`},{key:`save_steps`,label:`Save cases as Xray tests`,help:`Cases saved from a Jira story become Xray tests with their steps in Xray.`,type:`switch`,default:!1}]},{id:`confluence`,icon:Ke,name:`Confluence`,note:`Requirements pages`,base:[`sources`,`confluence`],vars:[`email_env`,`token_env`],fields:[{key:`url`,label:`Site`,help:`Empty: the Jira site, same account.`,type:`url`,placeholder:`https://acme.atlassian.net/wiki`},{key:`email_env`,label:`Email variable`,type:`var`,default:`CONFLUENCE_EMAIL`},{key:`token_env`,label:`Token variable`,type:`var`,default:`CONFLUENCE_TOKEN`},{key:`space`,label:`Space`,help:`Search this space only.`,type:`text`,placeholder:`QA`}]},{id:`testrail`,icon:ot,name:`TestRail`,note:`Test cases and results`,base:[`sources`,`testrail`],vars:[`email_env`,`token_env`],fields:[{key:`test_plans`,label:`Test plans in Test management`,help:`run=7, plan=3 or suite=5. Every case of these shows in Test management, synced from here.`,type:`list`,placeholder:`run=7`},{key:`url`,label:`Site`,type:`url`,placeholder:`https://acme.testrail.io`},{key:`email_env`,label:`Email variable`,type:`var`,default:`TESTRAIL_EMAIL`},{key:`token_env`,label:`API key variable`,type:`var`,default:`TESTRAIL_API_KEY`},{key:`project_id`,label:`Project id`,type:`number`},{key:`section_id`,label:`Section for new test cases`,help:`Where cases written from a story are saved, with the story in refs.`,type:`number`},{key:`template_id`,label:`Template of new test cases`,help:`2 is Test Case (Steps).`,type:`number`,default:2},{key:`retired_section_id`,label:`Section for retired test cases`,help:`Retiring a case moves it here; TestRail has no retired state.`,type:`number`},{key:`automation_field`,label:`Automation field`,help:`Your custom field a passing test marks, e.g. custom_automation_type.`,type:`text`,placeholder:`custom_automation_type`},{key:`automation_value`,label:`Automation value`,help:`What the field is set to.`,type:`text`,placeholder:`2`}]},{id:`zephyr`,icon:a,name:`Zephyr Scale`,note:`Test cases and results`,base:[`sources`,`zephyr`],vars:[`token_env`],fields:[{key:`test_plans`,label:`Test plans in Test management`,help:`cycle=SHOP-R12 or folder=34. Every case of these shows in Test management, synced from here.`,type:`list`,placeholder:`cycle=SHOP-R12`},{key:`token_env`,label:`Token variable`,type:`var`,default:`ZEPHYR_API_TOKEN`},{key:`project_key`,label:`Project key`,type:`text`,placeholder:`SHOP`},{key:`folder_id`,label:`Folder for new test cases`,help:`Where cases written from a story are saved, and where ForgeQE looks for ones to reuse.`,type:`number`},{key:`retire_status`,label:`Status of a retired test case`,help:`What retire_test_case sets.`,type:`text`,default:`Deprecated`}]},{id:`qtest`,icon:Re,name:`qTest`,note:`Test cases and results`,base:[`sources`,`qtest`],vars:[`token_env`],fields:[{key:`test_plans`,label:`Test plans in Test management`,help:`cycle=12 or suite=34. Every case of these shows in Test management, synced from here.`,type:`list`,placeholder:`cycle=12`},{key:`url`,label:`Site`,type:`url`,placeholder:`https://acme.qtestnet.com`},{key:`token_env`,label:`Token variable`,type:`var`,default:`QTEST_TOKEN`},{key:`project_id`,label:`Project id`,type:`number`},{key:`statuses`,label:`Status names`,help:`Your qTest's automation status for each result, one per line.`,type:`kv`,placeholder:`passed = PASS
61
- failed = FAIL
62
- error = BLOCKED`},{key:`module_id`,label:`Module for new test cases`,help:`Where cases written from a requirement are saved, linked to it.`,type:`number`}]},{id:`servicenow`,icon:a,name:`ServiceNow`,note:`Test Management tests, read only`,base:[`sources`,`servicenow`],vars:[`user_env`,`token_env`],fields:[{key:`url`,label:`Site`,help:`The instance's https address.`,type:`url`,placeholder:`https://acme.service-now.com`},{key:`user_env`,label:`User name variable`,help:`When it has no value, the password variable holds an OAuth access token.`,type:`var`,default:`SERVICENOW_USER`},{key:`token_env`,label:`Password or token variable`,type:`var`,default:`SERVICENOW_PASSWORD`},{key:`test_table`,label:`Test table`,help:`Table names differ by release: check them in your instance.`,type:`text`,default:`sn_test_management_test`},{key:`step_table`,label:`Step table`,type:`text`,default:`sn_test_management_step`},{key:`step_parent`,label:`Step's test field`,help:`The field of a step that names its test.`,type:`text`,default:`test`}]},{id:`github`,icon:We,name:`GitHub`,note:`Issues as test cases, bugs, pull requests`,base:[`sources`,`github`],vars:[`token_env`],fields:[{key:`repo`,label:`Repository`,type:`text`,placeholder:`acme/shop`},{key:`token_env`,label:`Token variable`,help:`Without it, the GitHub CLI's sign-in.`,type:`var`,default:`GITHUB_TOKEN`},{key:`toolsets`,label:`MCP tool groups`,type:`list`,placeholder:`repos, issues, pull_requests, actions`}]},{id:`gitlab`,icon:He,name:`GitLab`,note:`Issues, merge requests and pipelines`,group:`tools`,base:[`integrations`,`gitlab`],vars:[`token_env`],fields:[{key:`url`,label:`Address`,help:`GitLab.com or your own GitLab.`,type:`url`,default:`https://gitlab.com`},{key:`token_env`,label:`Token variable`,help:`A fine-grained personal access token with the MCP permission.`,type:`var`,default:`GITLAB_TOKEN`},{key:`toolsets`,label:`MCP tool groups`,help:`Empty: all of them.`,type:`list`,placeholder:`core, work_items`}]},{id:`browserstack_mcp`,icon:be,logo:`browserstack`,name:`BrowserStack tools`,note:`Sessions, accessibility and test management`,group:`tools`,base:[`integrations`,`browserstack`],vars:[`username_env`,`access_key_env`],fields:[{key:`username_env`,label:`User name variable`,type:`var`,default:`BROWSERSTACK_USERNAME`},{key:`access_key_env`,label:`Access key variable`,type:`var`,default:`BROWSERSTACK_ACCESS_KEY`}]},{id:`postman`,icon:C,name:`Postman`,note:`Collections, environments and mocks`,group:`tools`,base:[`integrations`,`postman`],vars:[`api_key_env`],fields:[{key:`api_key_env`,label:`API key variable`,type:`var`,default:`POSTMAN_API_KEY`},{key:`region`,label:`Region`,type:`select`,default:`us`,options:NT([`us`,`US`],[`eu`,`EU`])},{key:`tools`,label:`Tools`,type:`select`,default:`full`,options:NT([`full`,`Full`],[`minimal`,`Minimal`],[`code`,`Code`])}]},{id:`azure`,icon:h,name:`Azure`,note:`Azure resources, as az login's account`,untestable:!0,group:`tools`,base:[`integrations`,`azure`],vars:[],fields:[{key:`namespaces`,label:`MCP tool groups`,help:`Empty: all of them.`,type:`list`,placeholder:`storage, keyvault`},{key:`read_only`,label:`Read only`,help:`Off: its tools that change resources too.`,type:`switch`,default:!0}]},{id:`aws`,icon:h,name:`AWS`,note:`AWS resources, as this computer's AWS sign-in`,untestable:!0,group:`tools`,base:[`integrations`,`aws`],vars:[],fields:[{key:`read_only`,label:`Read only`,help:`Off: its tools that may change resources too.`,type:`switch`,default:!0},{key:`profile`,label:`Profile`,help:`Empty: the profile of the environment in use, else this computer's default AWS sign-in.`,type:`text`,placeholder:`shop-qa`},{key:`region`,label:`Region`,help:`Empty: the region of the environment in use.`,type:`text`,placeholder:`eu-west-1`},{key:`endpoint_region`,label:`Server region`,help:`The region of the AWS MCP Server's address.`,type:`text`,default:`us-east-1`}]},{id:`gcp`,icon:h,name:`Google Cloud`,note:`Google Cloud resources, as gcloud's account`,untestable:!0,group:`tools`,base:[`integrations`,`gcp`],vars:[],fields:[{key:`project`,label:`Project`,help:`Empty: the project of the environment in use.`,type:`text`,placeholder:`shop-qa-123`},{key:`allow`,label:`More commands`,help:`Whole gcloud commands it may run besides its read commands, comma separated.`,type:`list`,placeholder:`pubsub topics publish, run services update`}]},{id:`dataverse`,icon:e,name:`Dataverse`,note:`Tables and records`,untestable:!0,group:`tools`,base:[`integrations`,`dataverse`],vars:[],fields:[{key:`url`,label:`Environment`,help:`Sign in once: npx @microsoft/dataverse@1.0.82 auth create --environment <address>.`,type:`url`,placeholder:`https://acme.crm.dynamics.com`},{key:`preview`,label:`Preview endpoint`,type:`switch`,default:!1}]},{id:`sentry`,icon:gt,name:`Sentry`,note:`Errors, stack traces and releases`,group:`tools`,base:[`integrations`,`sentry`],vars:[`token_env`],fields:[{key:`url`,label:`Address`,help:`sentry.io or your own Sentry.`,type:`url`,default:`https://sentry.io`},{key:`token_env`,label:`Token variable`,help:`A user auth token.`,type:`var`,default:`SENTRY_ACCESS_TOKEN`},{key:`organization`,label:`Organization`,type:`text`,placeholder:`acme`}]},{id:`datadog`,icon:gt,name:`Datadog`,note:`Production errors, for Production signals`,untestable:!0,group:`tools`,base:[`integrations`,`datadog`],vars:[`api_key_env`,`app_key_env`],fields:[{key:`site`,label:`Site`,type:`select`,default:`us1`,options:NT([`us1`,`US1 (datadoghq.com)`],[`us3`,`US3`],[`us5`,`US5`],[`eu`,`EU (datadoghq.eu)`],[`ap1`,`AP1`],[`ap2`,`AP2`],[`gov`,`US1-FED`])},{key:`api_key_env`,label:`API key variable`,type:`var`,default:`DD_API_KEY`},{key:`app_key_env`,label:`Application key variable`,help:`With the error tracking and RUM read scopes.`,type:`var`,default:`DD_APP_KEY`},{key:`track`,label:`Errors from`,type:`select`,default:`rum`,options:NT([`rum`,`Real user monitoring (has the page)`],[`logs`,`Logs`],[`trace`,`Traces`])},{key:`query`,label:`Search`,help:`Optional, in Datadog's search syntax, such as service:shop env:prod.`,type:`text`,placeholder:`service:shop`}]},{id:`appinsights`,icon:gt,name:`Application Insights`,note:`Production exceptions, for Production signals`,untestable:!0,group:`tools`,base:[`integrations`,`appinsights`],vars:[`api_key_env`],fields:[{key:`app_id`,label:`Application ID`,help:`API Access in the Azure portal.`,type:`text`,placeholder:`00000000-0000-0000-0000-000000000000`},{key:`cloud`,label:`Cloud`,type:`select`,default:`public`,options:NT([`public`,`Azure`],[`china`,`Azure China`],[`usgov`,`Azure US Government`])},{key:`auth`,label:`Sign in with`,type:`select`,default:`azure-cli`,options:NT([`azure-cli`,`The Azure CLI (az login)`],[`api-key`,`An API key`])},{key:`api_key_env`,label:`API key variable`,help:`Only when signing in with an API key.`,type:`var`,default:`APPINSIGHTS_API_KEY`}]},{id:`testmu_mcp`,icon:h,logo:`testmu`,name:`TestMu AI tools`,note:`HyperExecute, failure triage, SmartUI, accessibility and Test Manager`,signinOnly:!0,group:`tools`,base:[`integrations`,`testmu`],vars:[],fields:[]}],GT={title:`Bugs`,help:`A bug for each defect a run finds; a comment on the open bug while it still fails.`,base:[`sources`,`bugs`],fields:[{key:`system`,label:`Where bugs go`,type:`select`,options:NT([`jira`,`Jira`],[`azure_devops`,`Azure DevOps`],[`github`,`GitHub`])},{key:`project`,label:`Project`,help:`Jira project key, or GitHub owner/repo.`,type:`text`,placeholder:`SHOP`},{key:`type`,label:`Issue type`,type:`text`,default:`Bug`},{key:`labels`,label:`Labels`,help:`Jira labels, or Azure DevOps tags.`,type:`list`,placeholder:`forgeqe`},{key:`area_path`,label:`Area path`,help:`Azure DevOps.`,type:`text`,placeholder:`Shop\\Web`},{key:`group_by`,label:`One bug per`,type:`select`,default:`defect`,options:NT([`defect`,`Defect (cases failing the same way share one)`],[`case`,`Case`])},{key:`on_error`,label:`Also for cases that could not run`,type:`switch`,default:!1}]},KT=[[`suite_failed`,`A suite failed`],[`suite_passed`,`A suite passed`],[`release`,`Release verdict`],[`eval_failed`,`An eval failed`],[`job_failed`,`A schedule failed`],[`job_recovered`,`A schedule recovered`],[`job_done`,`A schedule finished`],[`job_investigated`,`A failure was investigated`],[`agent_waiting`,`A custom agent waits for a person's approval`],[`evidence_drift`,`An agent under test drifted from its baseline (Evidence)`],[`sign_in_waiting`,`A run waits for a person to approve a sign-in (a push to a phone)`]],qT=[{title:`Project report`,help:`forgeqe bi builds a static site from ForgeQE's data and the datasets below, with no server (Reports, Build project report).`,base:[`bi`],fields:[{key:`title`,label:`Title`,type:`text`,default:`ForgeQE BI`},{key:`evidence_dir`,label:`Evidence project`,type:`path`,default:`./evidence`},{key:`data_dir`,label:`Data folder`,type:`path`,default:`./evidence/sources/forgeqe`},{key:`build_dir`,label:`Built site`,type:`path`,default:`./.forgeqe/reports/bi`},{key:`collect`,label:`Teammates' exports`,help:`Files or folders of forgeqe bi export, comma separated.`,type:`list`,placeholder:`//share/qa-reports`}]}],JT=[{key:`kind`,label:`From`,type:`select`,options:NT([`ado_wiql`,`Azure DevOps (WIQL)`],[`jira_jql`,`Jira (JQL)`])},{key:`title`,label:`Title`,type:`text`,placeholder:`Current sprint stories`},{key:`project`,label:`Azure DevOps project`,type:`text`,placeholder:`Shop`},{key:`wiql`,label:`WIQL`,type:`textarea`,placeholder:`SELECT [System.Id] FROM WorkItems WHERE ...`},{key:`jql`,label:`JQL`,type:`textarea`,placeholder:`project = SHOP AND issuetype = Bug`}],YT=[{title:`Running in parallel`,help:`More at once finishes sooner, and uses more of this machine (or of your grid's sessions) and more model calls at the same time.`,base:[],fields:[{key:`suite.parallel`,label:`Browsers at once in a suite`,help:`Test cases of one suite run side by side. Coding jobs always go one at a time.`,type:`number`,default:1},{key:`jobs.parallel`,label:`Scheduled runs at once`,help:`Over all jobs of the jobs service.`,type:`number`,default:2},{key:`monitor.parallel`,label:`Monitor checks at once`,help:`In each monitor round.`,type:`number`,default:1}]}],XT=[{title:`Driver`,help:`Appium runs workflows step by step and explores goals; Maestro replays them and runs your team's own flows. The apps themselves are in Environments (kind: mobile).`,base:[`mobile`],fields:[{key:`driver`,label:`Replays run on`,type:`select`,default:`appium`,options:NT([`appium`,`Appium`],[`maestro`,`Maestro`])},{key:`heal`,label:`Heal a replay that breaks`,help:`A step that no longer finds its element is found again from the screen.`,type:`switch`,default:!0},{key:`headless`,label:`Emulators without a window`,help:`Appium starts this computer's emulators (a device's Emulator to start) and iOS simulators without a window. Off: you see them.`,type:`switch`,default:!1},{key:`secrets`,label:`Secrets a flow may read`,help:`The only environment variables {{secret:…}} may read, comma separated.`,type:`list`,placeholder:`COURIER_PASSWORD`}]}],ZT=e=>e.runs_on===`browserstack`||e.runs_on===`testmu`,QT=[{key:`runs_on`,label:`Runs on`,help:`Devices on a cloud are kept in its own file, below.`,type:`select`,default:`local`,options:NT([`local`,`This computer`],[`browserstack`,`BrowserStack`],[`testmu`,`TestMu AI`]),when:e=>ZT(e)},{key:`type`,label:`Type`,type:`select`,emptyLabel:`Emulator here, real device on a cloud`,options:NT([`real`,`Real device`],[`virtual`,`Emulator or simulator`]),when:e=>e.runs_on!==`browserstack`},{key:`platform`,label:`Platform`,type:`select`,default:`android`,options:NT([`android`,`Android`],[`ios`,`iOS`])},{key:`model`,label:`Device model`,help:`An iOS simulator's name; else optional.`,type:`text`,placeholder:`iPhone 15`},{key:`os_version`,label:`OS version`,help:`Android or iOS version.`,type:`text`,placeholder:`14`},{key:`udid`,label:`Device id`,help:`From adb devices or xcrun simctl list. Empty: the one connected.`,type:`text`,placeholder:`emulator-5554`,when:e=>!ZT(e)},{key:`avd`,label:`Emulator to start`,help:`An Android emulator's name (emulator -list-avds): Appium starts it for the run. Empty: one already running.`,type:`text`,placeholder:`Pixel_8_API_35`,when:e=>!ZT(e)&&e.platform!==`ios`&&e.type!==`real`},{key:`enabled`,label:`Use in runs`,help:`Off: kept here, run only when a run names it.`,type:`switch`,default:!0}],$T=[{title:`Running in parallel`,help:`Each replay and each set of Maestro flows runs on every device in use. More at once finishes sooner, and uses more of this machine or of your device cloud's sessions.`,base:[`mobile`],fields:[{key:`parallel`,label:`Devices at once`,help:`Empty: all of them. 1: one after another. TestMu AI's too.`,type:`number`,placeholder:`All`}]},{title:`Appium on this computer`,help:`For devices that run on this computer.`,base:[`mobile`,`appium`],fields:[{key:`url`,label:`Appium server`,type:`url`,default:`http://127.0.0.1:4723`},{key:`capabilities`,label:`Extra capabilities`,help:`Rarely needed: ForgeQE builds them from the app and each device. Added to every session, one per line.`,type:`kv`,placeholder:`appium:newCommandTimeout = 300`}]},{title:`Maestro`,help:`Runs on this computer's devices, and on TestMu AI's through HyperExecute. Not on BrowserStack.`,base:[`mobile`],fields:[{key:`maestro.command`,label:`Maestro program`,help:`With its arguments, comma separated.`,type:`list`,placeholder:`maestro`},{key:`hyperexecute`,label:`hyperexecute program`,help:`TestMu AI's, for Maestro on its devices.`,type:`path`,placeholder:`hyperexecute`}]}],eE=[{title:`Desktop apps`,base:[`desktop`],fields:[{key:`heal`,label:`Heal a replay that breaks`,help:`The model re-finds a control that moved.`,type:`switch`,default:!0},{key:`screenshots`,label:`Screenshot each replayed step`,type:`switch`,default:!0},{key:`video`,label:`Record a video`,help:`Of the whole screen, while a workflow replays, explores or is recorded.`,type:`switch`,default:!0},{key:`driver`,label:`Replay on`,help:`agent-desktop replays on macOS, Linux and Windows without taking the mouse. Exploring and recording by hand need Windows.`,type:`select`,default:`auto`,options:NT([`auto`,`Automatic (pywinauto on Windows, agent-desktop elsewhere)`],[`pywinauto`,`pywinauto (Windows)`],[`agent-desktop`,`agent-desktop (macOS, Linux, Windows)`])},{key:`headed`,label:`Let agent-desktop use the mouse and keyboard`,help:`Only a double-click needs it; replay is headless otherwise.`,type:`switch`,default:!1},{key:`secrets`,label:`Secrets a workflow may read`,help:`The only environment variables {{secret:…}} may read, comma separated.`,type:`list`,placeholder:`BILLING_PASSWORD`}]}],tE=[{title:`Runtime`,help:`ForgeQE starts only what is declared here, with ports on 127.0.0.1 and read-only mounts inside the project. Images take an exact version or a digest, never latest.`,base:[`containers`],fields:[{key:`runtime`,label:`Runtime`,type:`select`,emptyLabel:`Docker, else Podman`,options:NT([`docker`,`Docker`],[`podman`,`Podman`])},{key:`compose`,label:`Compose files`,help:`Services from a compose file too, checked by the same rules.`,type:`list`,placeholder:`docker-compose.yml`},{key:`mock.image`,label:`Mocks' image`,type:`text`,placeholder:`wiremock/wiremock:3.9.1`}]},{title:`Tests in a container`,help:`run_tests runs the repository's tests in this image, its services started first and reachable by name.`,base:[`containers`,`tests`],fields:[{key:`image`,label:`Image`,type:`text`,placeholder:`mcr.microsoft.com/playwright:v1.48.2-jammy`},{key:`services`,label:`Services first`,type:`list`,placeholder:`db`},{key:`env`,label:`Environment`,type:`kv`,placeholder:`CI = true`},{key:`secrets`,label:`Secrets`,help:`Environment variable names.`,type:`list`,placeholder:`TEST_DB_PASSWORD`}]},{title:`The coding agents' workspace`,help:`Their shell commands, builds and test runs happen in this image, with the repository mounted; the agents and their keys stay on this machine.`,base:[`containers`,`workspace`],fields:[{key:`image`,label:`Image`,type:`text`,placeholder:`node:20.18.0`},{key:`services`,label:`Services first`,type:`list`,placeholder:`db`},{key:`env`,label:`Environment`,type:`kv`},{key:`secrets`,label:`Secrets`,type:`list`}]},{title:`Browser in a container`,help:`Used when Browser is set to Chrome in Docker.`,base:[`containers`,`browser`],fields:[{key:`image`,label:`Image`,type:`text`,placeholder:`the image ForgeQE ships`},{key:`headless`,label:`Without a window`,type:`switch`,default:!0}]}],nE=[{key:`path`,label:`Folder of documents`,help:`Markdown, text, or HTML. Relative to forgeqe.yaml.`,type:`path`,placeholder:`../shop-docs`},{key:`url`,label:`Or a link`,help:`A docs site or help centre, or an OpenAPI, Swagger, WSDL, or GraphQL description.`,type:`url`,placeholder:`https://help.shop.example/`},{key:`depth`,label:`Links to follow`,help:`How many links deep, on the same site only. 0 to 5; 0: the page alone.`,type:`number`,placeholder:`1`},{key:`max_pages`,label:`Most pages`,help:`A link: 1 to 2000, 100 if empty. Confluence: 1 to 25, 25 if empty.`,type:`number`,placeholder:`100`},{key:`token_env`,label:`Token for the link`,help:`Sent as a bearer token, to that site only.`,type:`var`,placeholder:`DOCS_TOKEN`},{key:`confluence`,label:`Or a Confluence space or page`,help:`A space key, or a page's link with the pages under it.`,type:`text`,placeholder:`SHOP`},{key:`app`,label:`Or a web app of env.yaml`,help:`The pages ForgeQE's runs and explorations remember of it.`,type:`text`,placeholder:`shop-web`}],rE=[{key:`path`,label:`Local clone`,help:`Relative to forgeqe.yaml.`,type:`path`,placeholder:`../shop-web`},{key:`git`,label:`Or its link`,help:`GitHub, Azure DevOps, GitLab, Bitbucket, or any git server, over https or ssh. ForgeQE fetches the branch's latest commit into its own cache, only when it moved.`,type:`text`,placeholder:`https://dev.azure.com/acme/Shop/_git/orders`},{key:`branch`,label:`Branch`,help:`With a link. The repository's default branch if empty.`,type:`text`,placeholder:`main`},{key:`token_env`,label:`Token`,help:`With an https link. Sent to that host only; empty: git's own sign-in.`,type:`var`,placeholder:`ADO_PAT`},{key:`user`,label:`User name for the token`,help:`Only when the server needs one, like a Bitbucket app password.`,type:`text`},{key:`auth`,label:`Browser sign-in`,help:`In place of a token: the GitHub CLI's or the Azure CLI's sign-in. Empty: the token, or git's own sign-in.`,type:`select`,options:NT([`github-cli`,`GitHub CLI`],[`azure-cli`,`Azure CLI`]),emptyLabel:`None`},{key:`account`,label:`Account`,help:`The account it was connected from (Repositories).`,type:`text`},{key:`system`,label:`System`,help:`The system it is part of, as your teams name it, for the Landscape on the Product page. Empty: grouped by its name.`,type:`text`,placeholder:`CRM`},{key:`database`,label:`Its database`,help:`A database of Databases, whose tables, keys and foreign keys are read into the graph. Only one that is not Writable.`,type:`text`,placeholder:`orders`}],iE=[{key:`image`,label:`Image`,help:`An exact version or a digest.`,type:`text`,placeholder:`postgres:16.4`},{key:`description`,label:`What it is`,type:`text`,placeholder:`Orders database`},{key:`ports`,label:`Ports`,help:`5432, or 15432:5432 (this machine:container). On 127.0.0.1 only.`,type:`list`,placeholder:`5432`},{key:`env`,label:`Environment`,type:`kv`,placeholder:`POSTGRES_DB = shop`},{key:`secrets`,label:`Secrets`,help:`Environment variable names (.env works).`,type:`list`,placeholder:`POSTGRES_PASSWORD`},{key:`volumes`,label:`Mounts`,help:`Read-only, inside the project: ./host:/container.`,type:`list`,placeholder:`./db/init:/docker-entrypoint-initdb.d`},{key:`command`,label:`Command`,help:`Its arguments, comma separated.`,type:`list`},{key:`depends_on`,label:`Starts after`,type:`list`,placeholder:`db`},{key:`ready.tcp`,label:`Ready when this port answers`,type:`number`,placeholder:`5432`},{key:`ready.http`,label:`Or when this path answers`,type:`text`,placeholder:`/health`},{key:`ready.port`,label:`On port`,type:`number`,placeholder:`8080`},{key:`timeout`,label:`Wait for it`,help:`In seconds.`,type:`number`,placeholder:`60`}],aE=[{key:`description`,label:`What it holds`,type:`text`,placeholder:`Orders written by the checkout app`},{key:`url_env`,label:`Connection string`,help:`A whole URI, JDBC or ADO.NET string. Or give the parts below.`,type:`var`,placeholder:`ORDERS_DB_URL`},{key:`engine`,label:`Engine`,type:`select`,options:NT([`postgres`,`PostgreSQL`],[`mysql`,`MySQL`],[`mariadb`,`MariaDB`],[`mssql`,`SQL Server`],[`oracle`,`Oracle`],[`snowflake`,`Snowflake`],[`redshift`,`Redshift`],[`cockroachdb`,`CockroachDB`],[`sqlite`,`SQLite`],[`duckdb`,`DuckDB`],[`mongodb`,`MongoDB`],[`kafka`,`Kafka`])},{key:`host`,label:`Host`,type:`text`,placeholder:`localhost`},{key:`port`,label:`Port`,type:`number`,placeholder:`5432`},{key:`database`,label:`Database`,type:`text`,placeholder:`test`},{key:`schema`,label:`Schema`,type:`text`},{key:`path`,label:`File`,help:`SQLite or DuckDB.`,type:`path`,placeholder:`./data/test.db`},{key:`user`,label:`User`,type:`text`,placeholder:`qa`},{key:`auth`,label:`Signs in with`,type:`select`,default:`password`,options:NT([`password`,`A password`],[`azure`,`Microsoft Entra`],[`aws_iam`,`AWS IAM`],[`none`,`Nothing`])},{key:`password_env`,label:`Password`,type:`var`,placeholder:`FIXTURES_DB_PASSWORD`},{key:`region`,label:`AWS region`,type:`text`,placeholder:`eu-west-1`},{key:`ssl`,label:`TLS`,type:`select`,emptyLabel:`The driver's default`,options:NT([`verify`,`Verify the certificate`],[`require`,`Require`],[`disable`,`Off`])},{key:`ssl_ca`,label:`CA certificate`,type:`path`,placeholder:`./certs/ca.pem`},{key:`writable`,label:`Writable`,help:`Allows confirmed INSERT, and UPDATE or DELETE with a WHERE clause. Each one is asked first.`,type:`switch`,default:!1},{key:`timeout_seconds`,label:`Query time limit`,help:`In seconds.`,type:`number`,placeholder:`30`},{key:`options`,label:`Driver options`,type:`kv`}];function oE(e,t){if(!e)return``;let n=e.account?` as ${e.account}`:``,r=[e.via===`azcli`?`Signed in with the Azure CLI${n}`:e.via===`gh`?`Signed in with the GitHub CLI${n}`:e.via===`dataverse`?`Signed in with the Dataverse CLI`:e.via===`token`?`Signed in with a saved key${n}`:e.via?`Signed in${n}`:``,e.browser?`${t}'s MCP server is signed in in the browser`:``].filter(Boolean).join(`; `);return r?`${r}.`:``}function sE({system:e,label:t,keyless:n,onChanged:r}){let[i,a]=(0,q.useState)(),[o,s]=(0,q.useState)(!1),[c,l]=(0,q.useState)(null),[u,d]=(0,q.useState)(``),[f,p]=(0,q.useState)(``),[h,g]=(0,q.useState)(``),[_,v]=(0,q.useState)(!1),[y,b]=(0,q.useState)(!1),x=(0,q.useRef)(0),S=(0,q.useCallback)(()=>{let t=x.current;Bt.get().then(n=>{t===x.current&&(a(n.saved[e]),s(!0),l(e=>(e&&(e.state===`running`||e.state===`waiting`)&&n.signin?.state===`done`&&r?.(),n.signin)))},e=>d(e.message))},[e,r]);(0,q.useEffect)(S,[S]);let C=c&&c.system===e?c:null,w=C?.state===`running`||C?.state===`waiting`,T=c&&c.system!==e&&(c.state===`running`||c.state===`waiting`);(0,q.useEffect)(()=>{if(!w)return;let e=setInterval(S,1e3);return()=>clearInterval(e)},[w,S]);let E=async()=>{d(``),p(``),x.current++;try{l((await Bt.start(e)).signin)}catch(e){d(e.message)}},D=async e=>{if(C?.question&&!y){d(``),b(!0),x.current++;try{let t=(await Bt.answer(C.question.id,e)).signin;x.current++,l(t),g(``)}catch(e){d(e.message),S()}finally{b(!1)}}},O=C?.question,ee=O?.kind===`input`&&!O.secret&&/\(empty to [^)]*\)$/.test(O.label),te=C?.link&&/^https:\/\//.test(C.link)?C.link:void 0;return(0,J.jsxs)(`div`,{className:`flex flex-col gap-4 border-t border-line-soft py-4`,children:[(0,J.jsxs)(`div`,{className:`flex min-h-[44px] flex-wrap items-center gap-x-4 gap-y-2`,children:[(0,J.jsxs)(`span`,{className:`flex min-w-0 flex-[1_1_260px] flex-col gap-1`,children:[(0,J.jsx)(`span`,{className:`font-medium`,children:`Sign-in`}),(0,J.jsx)(`span`,{className:`text-sm text-muted`,children:o?oE(i,t)||(n?`Not signed in here. Sign in with ${t}; it takes no key.`:`Not signed in here. Sign in with ${t}, or set its variables below.`):`Reading the sign-in…`})]}),!w&&o&&(0,J.jsxs)(`span`,{className:`flex flex-wrap gap-2`,children:[(0,J.jsxs)(V,{size:`sm`,variant:i?`outline`:`primary`,disabled:!!T,"data-tip":i?`Sign in to ${t} again`:`Sign in with ${t}`,onClick:()=>void E(),children:[(0,J.jsx)(m,{"aria-hidden":`true`}),`Sign in`]}),i&&(0,J.jsxs)(V,{size:`sm`,onClick:async()=>{try{let t=await Bt.signOut(e);a(t.saved[e]),p(t.message),l(null),r?.()}catch(e){d(e.message)}},children:[(0,J.jsx)(it,{"aria-hidden":`true`}),`Sign out`]})]})]}),T&&(0,J.jsx)(`p`,{className:`m-0 text-sm text-muted`,children:`Another sign-in is running. Finish or cancel it first.`}),C&&(C.lines.length>0||w||te)&&(0,J.jsxs)(`div`,{role:`status`,"aria-live":`polite`,className:`flex flex-col gap-4 rounded-[12px] card border p-4`,children:[(te||C.code)&&w&&(0,J.jsxs)(`div`,{className:`flex flex-wrap items-center gap-4`,children:[C.code&&(0,J.jsxs)(`span`,{className:`flex items-center gap-2`,children:[(0,J.jsx)(`span`,{className:`text-sm text-muted`,children:`Your code`}),(0,J.jsx)(`span`,{className:`rounded-[8px] border border-line bg-bg px-4 py-2 font-mono text-lg font-semibold tracking-[0.12em]`,children:C.code}),(0,J.jsxs)(V,{size:`sm`,"data-tip":`Copy the code`,onClick:()=>{navigator.clipboard?.writeText(C.code).then(()=>v(!0)),setTimeout(()=>v(!1),1500)},children:[(0,J.jsx)(I,{"aria-hidden":`true`}),_?`Copied`:`Copy`]})]}),te&&(0,J.jsxs)(`a`,{href:te,target:`_blank`,rel:`noreferrer noopener`,"data-tip":`Open ${new URL(te).host}`,className:Ct({variant:`primary`,size:`sm`}),children:[(0,J.jsx)(we,{"aria-hidden":`true`}),`Open`]})]}),(0,J.jsxs)(`ul`,{className:`m-0 flex list-none flex-col gap-1 p-0 text-sm`,children:[C.lines.slice(-6).map((e,t)=>(0,J.jsx)(`li`,{className:L(`[overflow-wrap:anywhere]`,e.kind===`err`?`text-fail`:e.kind===`ok`?`text-pass`:`text-ink-2`),children:e.text},t)),C.state===`running`&&(0,J.jsxs)(`li`,{className:`text-muted`,children:[`Waiting for `,t,`…`]})]}),O?.kind===`choose`&&(0,J.jsxs)(`fieldset`,{className:`m-0 flex flex-col gap-2 border-0 p-0`,children:[(0,J.jsx)(`legend`,{className:`mb-1 text-sm font-medium`,children:O.title}),O.detail&&(0,J.jsx)(`p`,{className:`m-0 text-sm text-muted`,children:O.detail}),(0,J.jsx)(`div`,{className:`flex flex-wrap gap-2`,children:O.options.map(e=>(0,J.jsx)(V,{size:`sm`,variant:e.id===`cancel`?`outline`:`primary`,disabled:y,onClick:()=>void D(e.id),children:e.label},e.id))})]}),O?.kind===`input`&&(0,J.jsxs)(`form`,{className:`flex flex-wrap items-end gap-2`,onSubmit:e=>{e.preventDefault(),(h.trim()||ee)&&D(h)},children:[(0,J.jsxs)(`label`,{className:`flex min-w-0 flex-[1_1_320px] flex-col gap-1 text-sm font-medium`,children:[O.label,(0,J.jsx)(R,{type:O.secret?`password`:`text`,autoComplete:`off`,spellCheck:!1,value:h,onChange:e=>g(e.target.value)})]}),(0,J.jsxs)(V,{type:`submit`,size:`sm`,variant:`primary`,disabled:y||!h.trim()&&!ee,children:[(0,J.jsx)(Xe,{"aria-hidden":`true`}),`Continue`]})]}),w&&(0,J.jsx)(`span`,{children:(0,J.jsxs)(V,{size:`sm`,onClick:async()=>{x.current++,l((await Bt.cancel()).signin)},"data-tip":`Cancel sign-in`,children:[(0,J.jsx)(A,{"aria-hidden":`true`}),`Cancel`]})})]}),(u||f)&&(0,J.jsx)(`p`,{className:L(`m-0 text-sm`,u?`text-fail`:`text-ink-2`),children:u||f})]})}var cE=[`Test cases and bugs`,`Browser grids`,`Notifications`,`Other tools`],lE=e=>e.group===`tools`?cE[3]:cE[0],uE={jira:`jira`,azure_devops:`azure_devops`,xray:`xray`,confluence:`confluence`,testrail:`testrail`,zephyr:`zephyr`,qtest:`qtest`,github:`github`,gitlab:`gitlab`,browserstack_mcp:`browserstack`,testmu_mcp:`testmu`,postman:`postman`,azure:`azure`,dataverse:`dataverse`,sentry:`sentry`,browserstack:`browserstack`,testmu:`testmu`},dE=[...WT.map(e=>({id:e.id,kind:`source`,group:lE(e),name:e.name,note:e.note,icon:e.icon,logo:Zi[e.logo||e.id]??Xi[e.logo||e.id]})),{id:`browserstack`,kind:`grid`,group:cE[1],name:`BrowserStack`,note:`Remote browsers and devices`,icon:h,logo:Zi.browserstack},{id:`testmu`,kind:`grid`,group:cE[1],name:`TestMu AI`,note:`Remote browsers (LambdaTest)`,icon:h,logo:Zi.testmu},{id:`teams`,kind:`teams`,group:cE[2],name:`Microsoft Teams`,note:`A channel's webhook, for suites, releases and schedules`,icon:De,logo:Yi,many:!0},{id:`email`,kind:`email`,group:cE[2],name:`Email`,note:`The same alerts by email`,icon:De,many:!0},{id:`mcp`,kind:`mcp`,group:cE[3],name:`MCP server`,note:`Any other system with an MCP server, as tools for ForgeQE's agent`,icon:Me,many:!0}],fE={browserstack:[{key:`username_env`,label:`User name variable`,type:`var`,default:`BROWSERSTACK_USERNAME`},{key:`access_key_env`,label:`Access key variable`,type:`var`,default:`BROWSERSTACK_ACCESS_KEY`},{key:`browser`,label:`Browser`,help:`ForgeQE drives the browser over CDP: Chrome or Edge.`,type:`select`,default:`chrome`,options:[{value:`chrome`,label:`Chrome`},{value:`edge`,label:`Edge`}]},{key:`browser_version`,label:`Browser version`,type:`text`,default:`latest`},{key:`os`,label:`Operating system`,type:`select`,default:`Windows`,options:[{value:`Windows`,label:`Windows`},{value:`OS X`,label:`macOS`}]},{key:`os_version`,label:`Its version`,type:`text`,placeholder:`11, or Sequoia`},{key:`project`,label:`Project`,type:`text`,placeholder:`ForgeQE`},{key:`build`,label:`Build`,type:`text`,placeholder:`nightly`},{key:`local`,label:`Through BrowserStack Local`,help:`For sites only your network reaches.`,type:`switch`,default:!1}],testmu:[{key:`username_env`,label:`User name variable`,type:`var`,default:`LT_USERNAME`},{key:`access_key_env`,label:`Access key variable`,type:`var`,default:`LT_ACCESS_KEY`},{key:`browser`,label:`Browser`,help:`TestMu AI's CDP endpoint serves Chrome.`,type:`select`,default:`Chrome`,options:[{value:`Chrome`,label:`Chrome`}]},{key:`browser_version`,label:`Browser version`,type:`text`,default:`latest`},{key:`platform`,label:`Platform`,type:`text`,default:`Windows 11`,placeholder:`Windows 11, or macOS Sequoia`},{key:`project`,label:`Project`,type:`text`,placeholder:`ForgeQE`},{key:`build`,label:`Build`,type:`text`,placeholder:`nightly`},{key:`local`,label:`Through the LambdaTest tunnel`,help:`For sites only your network reaches.`,type:`switch`,default:!1}]},pE={browserstack:fE.browserstack.filter(e=>[`browser`,`browser_version`,`os`,`os_version`].includes(e.key)),testmu:fE.testmu.filter(e=>[`browser`,`browser_version`,`platform`].includes(e.key))},mE={browserstack:{provider:`browserstack`,remote:{browser:`chrome`,browser_version:`latest`,os:`Windows`,os_version:`11`,username_env:`BROWSERSTACK_USERNAME`,access_key_env:`BROWSERSTACK_ACCESS_KEY`,project:`ForgeQE`,local:!1}},testmu:{provider:`testmu`,remote:{browser:`Chrome`,browser_version:`latest`,platform:`Windows 11`,username_env:`LT_USERNAME`,access_key_env:`LT_ACCESS_KEY`,project:`ForgeQE`,local:!1}}},hE=[{key:`host`,label:`Mail server`,type:`text`,placeholder:`smtp.office365.com`},{key:`port`,label:`Port`,help:`587 is STARTTLS; 465 is TLS from the start.`,type:`number`,default:587},{key:`username_env`,label:`User name variable`,type:`var`,placeholder:`SMTP_USERNAME`},{key:`password_env`,label:`Password variable`,type:`var`,placeholder:`SMTP_PASSWORD`},{key:`from`,label:`From`,help:`Empty: the user name.`,type:`text`,placeholder:`ForgeQE <qa-bot@example.com>`},{key:`to`,label:`To`,help:`Comma separated.`,type:`list`,placeholder:`qa-team@example.com`}],gE=/^[A-Za-z0-9_-][A-Za-z0-9_.-]*$/;function _E({entry:e,title:t,meta:n,state:r,onEdit:i,onRemove:a,setUp:o}){return(0,J.jsxs)(`div`,{className:`flex min-h-[68px] flex-wrap items-center gap-x-4 gap-y-2 border-t border-line-soft py-4`,children:[(0,J.jsx)(Pr,{icon:e.icon,logo:e.logo}),(0,J.jsxs)(`span`,{className:`flex min-w-0 flex-[1_1_220px] flex-col gap-1`,children:[(0,J.jsx)(`span`,{className:`font-medium`,children:t}),(0,J.jsx)(`span`,{className:`text-sm text-muted`,children:n}),r]}),(0,J.jsx)(`span`,{className:`flex gap-2`,children:o?(0,J.jsx)(V,{variant:`icon`,size:`icon-sm`,"aria-label":`Set up ${t}`,"data-tip":`Set up ${t}`,onClick:i,children:(0,J.jsx)(b,{"aria-hidden":`true`})}):(0,J.jsxs)(J.Fragment,{children:[(0,J.jsx)(V,{variant:`icon`,size:`icon-sm`,"aria-label":`Edit ${t}`,"data-tip":`Edit ${t}`,onClick:i,children:(0,J.jsx)(re,{"aria-hidden":`true`})}),(0,J.jsx)(V,{variant:`icon`,size:`icon-sm`,"aria-label":`Disconnect ${t}`,"data-tip":`Disconnect ${t}`,onClick:a,children:(0,J.jsx)(ee,{"aria-hidden":`true`})})]})})]})}var vE=(0,J.jsx)(`span`,{className:`text-[13px] text-muted`,children:`Not set up`}),yE=(0,J.jsx)(`span`,{className:`text-[13px] text-warn`,children:`Needs a sign-in: Edit to sign in`}),bE=(e,t=``)=>t?(0,J.jsx)(`span`,{className:`text-[13px] text-pass`,children:t}):e.length?(0,J.jsx)(`span`,{className:`text-[13px] text-warn`,children:e.length===1?`Needs its key or password: Edit to add it`:`Needs ${e.length} values: Edit to add them`}):(0,J.jsx)(`span`,{className:`text-[13px] text-pass`,children:`Connected`}),xE={integrations:[cE[0],cE[1]],notifications:[cE[2]],mcp:[cE[3]]};function SE({edit:e,grids:t,setGrids:n,gridPaths:r,view:i=`integrations`}){let[a,o]=(0,q.useState)(null),[s,c]=(0,q.useState)({}),l=(0,q.useCallback)(()=>{Bt.get().then(e=>c(e.saved),()=>{})},[]);(0,q.useEffect)(l,[l]);let u=e=>{let t=s[uE[e]||``];return t&&(t.via!==`token`||t.browser)&&oE(t,v(e).name)?`Signed in`:``},d=Cr(),f=e=>ci(d,e),p=e.value,m=e.vars,h=W(Kr(p,[`notify`,`channels`])),g=W(p.mcp),_=String(Kr(p,[`browser`,`provider`])??`local`),v=e=>dE.find(t=>t.id===e),y=e=>{let t=WT.find(t=>t.id===e),n=Kr(p,t.base);return n!==void 0&&n!==!1},b=e=>e.kind===`source`?y(e.id):e.kind===`grid`&&!!t[e.id],x=Object.fromEntries(cE.map(e=>[e,[]]));for(let t of WT){if(!y(t.id)){t.group===`tools`&&x[lE(t)].push((0,J.jsx)(_E,{entry:v(t.id),title:t.name,meta:t.note,state:vE,setUp:!0,onEdit:()=>C(v(t.id))},t.id));continue}let n=W(Kr(p,t.base));x[lE(t)].push((0,J.jsx)(_E,{entry:v(t.id),title:t.name,meta:String(n.url||n.org_url||n.repo||t.note),state:t.signinOnly&&!u(t.id)?yE:bE(Oo(n,t.vars,t.fields,f),u(t.id)),onEdit:()=>o({step:`form`,entry:v(t.id),mode:`edit`,name:t.id,from:t.id,value:n}),onRemove:()=>e.set(K(p,t.base,void 0))},t.id))}for(let e of[`browserstack`,`testmu`]){let n=t[e];if(!n)continue;let r=W(n.remote),i=v(e),a=[(e=>typeof e==`string`&&e?e[0].toUpperCase()+e.slice(1):e)(r.browser),r.os?`${r.os} ${r.os_version||``}`.trim():r.platform].filter(Boolean).join(`, `);x[cE[1]].push((0,J.jsx)(_E,{entry:i,title:i.name,meta:`${a}${_===e?`, used for browser runs`:``}`,state:bE(Oo(r,[`username_env`,`access_key_env`],fE[e],f),u(e)),onEdit:()=>o({step:`form`,entry:i,mode:`edit`,name:e,from:e,value:n,useGrid:_===e}),onRemove:()=>S(e)},e))}for(let[t,n]of Object.entries(h)){let r=W(n),i=v(r.teams?`teams`:`email`),a=Array.isArray(r.on)?r.on.length:0,s=[...r.teams?Oo(W(r.teams),[`webhook_env`],[],f):[],...r.email?Oo(W(r.email),[`username_env`,`password_env`],[],f):[]];x[cE[2]].push((0,J.jsx)(_E,{entry:i,title:t,meta:`${[r.teams&&`Teams`,r.email&&`Email`].filter(Boolean).join(` and `)||`No way to reach it yet`}, ${a} event${a===1?``:`s`}`,state:bE(s),onEdit:()=>o({step:`form`,entry:i,mode:`edit`,name:t,from:t,value:r}),onRemove:()=>e.set(K(p,[`notify`,`channels`,t],void 0))},`ch-${t}`))}for(let[t,n]of Object.entries(g)){let r=W(n);x[cE[3]].push((0,J.jsx)(_E,{entry:{...v(`mcp`),icon:tt},title:t,meta:String(r.url||r.command||`MCP server`),onEdit:()=>o({step:`form`,entry:v(`mcp`),mode:`edit`,name:t,from:t,value:r}),onRemove:()=>e.set(K(p,[`mcp`,t],void 0))},`mcp-${t}`))}function S(r){let i=K(p,[`browser`,`providers`,r],void 0);_===r&&(i=K(i,[`browser`,`provider`],`local`)),e.set(i),n({...t,[r]:null})}function C(e){if(e.kind===`source`){let t=WT.find(t=>t.id===e.id);o({step:`form`,entry:e,mode:`add`,name:e.id,from:e.id,value:Object.fromEntries(t.fields.filter(e=>e.type===`var`&&e.default).map(e=>[e.key,e.default]))})}else e.kind===`grid`?o({step:`form`,entry:e,mode:`add`,name:e.id,from:e.id,value:mE[e.id],useGrid:_===`local`}):e.kind===`teams`?o({step:`form`,entry:e,mode:`add`,name:``,from:``,value:{teams:{webhook_env:`TEAMS_WEBHOOK_URL`},on:[`suite_failed`,`job_failed`]}}):e.kind===`email`?o({step:`form`,entry:e,mode:`add`,name:``,from:``,value:{email:{port:587},on:[`suite_failed`,`job_failed`]}}):o({step:`form`,entry:e,mode:`add`,name:``,from:``,value:{url:``}})}function w(i){let a=i.entry.kind;if(a===`source`){let t=WT.find(e=>e.id===i.entry.id);e.set(K(p,t.base,t.signinOnly&&!Object.keys(W(i.value)).length?!0:i.value))}else if(a===`grid`){let a=i.entry.id,o=K(p,[`browser`,`providers`,a],r[a]);i.useGrid?o=K(o,[`browser`,`provider`],a):_===a&&(o=K(o,[`browser`,`provider`],`local`)),e.set(o),n({...t,[a]:i.value})}else{let t=a===`mcp`?[`mcp`]:[`notify`,`channels`],n=p;i.mode===`edit`&&i.from!==i.name&&(n=K(n,[...t,i.from],void 0)),e.set(K(n,[...t,i.name],i.value))}o(null)}let T=xE[i],E=T.filter(e=>x[e].length),D=i===`mcp`?`Add an MCP server`:i===`notifications`?`Add a channel`:`Add an integration`,O=i===`mcp`?`No other MCP servers yet. The test case systems' own MCP servers are set with each system under Integrations.`:i===`notifications`?`No channels yet: add a Teams channel or an email list, and pick the events it gets.`:`Nothing connected yet.`;return(0,J.jsxs)(J.Fragment,{children:[(0,J.jsxs)(`div`,{className:`mb-4 flex flex-wrap items-center justify-between gap-4`,children:[(0,J.jsx)(`p`,{className:`m-0 text-sm text-muted`,children:E.length?i===`mcp`?`Their tools show as <name>_<tool>. Sign in from Edit where a server offers it.`:i===`notifications`?`Each channel gets the events it picks.`:`Connected to ForgeQE.`:O}),(0,J.jsxs)(V,{size:`sm`,"data-tip":D,onClick:()=>i===`mcp`?C(v(`mcp`)):o({step:`catalog`}),children:[(0,J.jsx)(k,{"aria-hidden":`true`}),`Add`]})]}),E.map(e=>(0,J.jsxs)(`div`,{children:[T.length>1&&(0,J.jsx)(U,{children:e}),x[e]]},e)),i===`notifications`&&(0,J.jsxs)(J.Fragment,{children:[(0,J.jsx)(U,{children:`Links in alerts`}),(0,J.jsx)(Oi,{def:{key:`notify.report_url`,label:`Where reports are published`,help:`Teams and email alerts link each report there.`,type:`url`,placeholder:`https://reports.example.com/forgeqe`},edit:e,base:[]})]}),i===`integrations`&&(0,J.jsxs)(J.Fragment,{children:[(0,J.jsx)(U,{children:`Test case ids`}),(0,J.jsx)(Oi,{def:{key:`sources.id_routes`,label:`Which system an id is in`,help:`One line per id pattern: the start of an id and * (or * alone for a plain number) = azure_devops, jira, xray, testrail, zephyr, qtest, github or servicenow. Only needed when more than one system could hold an id; otherwise ForgeQE asks.`,type:`kv`,placeholder:`TA-* = jira
63
- TST* = servicenow
64
- * = azure_devops`},edit:e,base:[]}),(0,J.jsx)(U,{children:`Results and bugs`}),(0,J.jsx)(Oi,{def:{key:`sources.write_back`,label:`Post results back`,help:`To the system each test case came from.`,type:`switch`,default:!0},edit:e,base:[]}),(0,J.jsx)(U,{help:GT.help,children:(0,J.jsxs)(`span`,{className:`inline-flex items-center gap-2`,children:[(0,J.jsx)(Zt,{icon:gt,size:18}),GT.title]})}),(0,J.jsx)(Dn,{defs:GT.fields,edit:e,base:GT.base})]}),(0,J.jsx)(CE,{panel:a,setPanel:o,isOn:b,onPick:C,onApply:w,vars:m,taken:(e,t)=>t in(e===`mcp`?g:h),groups:T,title:D,onSigned:l})]})}function CE({panel:e,setPanel:t,isOn:n,onPick:i,onApply:a,vars:o,taken:s,groups:c,title:l,onSigned:u}){let d=Cr(),[f,p]=(0,q.useState)({busy:!1}),[m,h]=(0,q.useState)(null),g=e?.step===`form`?`${e.entry.id}/${e.from}`:e?.step||``;(0,q.useEffect)(()=>{p({busy:!1}),h(null)},[g]);let _=()=>{t(null),p({busy:!1}),h(null)};if(e?.step===`form`){let n=e,i=n.entry.kind,c=e=>t({...n,value:e}),l=i===`teams`||i===`email`||i===`mcp`,g=l&&n.name?gE.test(n.name)?n.name!==n.from&&s(i,n.name)?`Another one has this name.`:``:`Use letters, digits and _ . -`:``,v=i===`mcp`&&W(n.value).command===void 0,y=(!l||n.name&&!g)&&(i!==`mcp`||String(W(n.value)[v?`url`:`command`]||``).trim()),b=n.mode===`add`?`Connect ${n.entry.name}`:`Edit ${l?n.name:n.entry.name}`,x=!(i===`mcp`&&!v)&&!(i===`source`&&WT.find(e=>e.id===n.entry.id)?.untestable);return(0,J.jsxs)(yr,{open:!0,onClose:_,title:b,description:`Saved as soon as you connect it. Keys and passwords you type are kept in ${Gn(d.store)}, never in the settings files.`,footer:(0,J.jsxs)(J.Fragment,{children:[n.mode===`add`&&(0,J.jsxs)(V,{onClick:()=>t({step:`catalog`}),children:[(0,J.jsx)(Se,{"aria-hidden":`true`}),`Back`]}),x&&(0,J.jsxs)(V,{onClick:async()=>{p({busy:!0});let e=Object.fromEntries(Object.entries(d.pending).filter(e=>typeof e[1]==`string`));try{let t=await Yt.test(i,n.entry.id,n.value,e);p({busy:!1,ok:t.ok,message:t.message})}catch(e){p({busy:!1,ok:!1,message:e.message})}},disabled:f.busy,className:`mr-auto`,"data-tip":i===`teams`||i===`email`?`Send a test message`:`Test the connection`,children:[i===`teams`||i===`email`?(0,J.jsx)(C,{"aria-hidden":`true`}):(0,J.jsx)(Be,{"aria-hidden":`true`}),f.busy?`Testing…`:`Test`]}),!x&&(0,J.jsx)(`span`,{className:`mr-auto`}),(0,J.jsxs)(V,{onClick:_,children:[(0,J.jsx)(A,{"aria-hidden":`true`}),`Cancel`]}),(0,J.jsxs)(V,{variant:`primary`,disabled:!y,onClick:()=>a(n),children:[n.mode===`add`?(0,J.jsx)(Be,{"aria-hidden":`true`}):(0,J.jsx)(dt,{"aria-hidden":`true`}),n.mode===`add`?`Connect`:`Done`]})]}),children:[(0,J.jsxs)(`div`,{className:`flex items-center gap-4 pt-6 pb-2`,children:[(0,J.jsx)(Pr,{icon:n.entry.icon,logo:n.entry.logo,size:`lg`}),(0,J.jsx)(`span`,{className:`text-sm text-muted`,children:n.entry.note})]}),(0,J.jsx)(`div`,{"aria-live":`polite`,children:f.message&&(0,J.jsxs)(`p`,{role:f.ok?`status`:`alert`,className:L(`mt-2 mb-1 flex items-start gap-2 rounded-[12px] px-4 py-2 text-sm`,f.ok?`bg-pass-soft text-pass`:`bg-fail-soft text-fail`),children:[f.ok?(0,J.jsx)(O,{size:18,"aria-hidden":`true`,className:`mt-1 flex-none`}):(0,J.jsx)(P,{size:18,"aria-hidden":`true`,className:`mt-1 flex-none`}),(0,J.jsx)(`span`,{className:`[overflow-wrap:anywhere]`,children:f.message})]})}),l&&(0,J.jsx)(H,{label:`Name`,help:g?(0,J.jsx)(`span`,{className:`text-fail`,children:g}):i===`mcp`?`Its tools show as <name>_<tool> to ForgeQE's agent.`:`A short name for the channel, such as qa or release.`,htmlFor:`int-name`,stacked:!0,children:(0,J.jsx)(R,{id:`int-name`,value:n.name,spellCheck:!1,"aria-invalid":!!g,placeholder:i===`mcp`?`xray`:`qa`,onChange:e=>t({...n,name:e.target.value.trim()})})}),(i===`source`||i===`grid`)&&uE[n.entry.id]&&(n.mode===`edit`?(0,J.jsx)(sE,{system:uE[n.entry.id],label:n.entry.name.replace(/ tools$/,``),keyless:i===`source`&&!!WT.find(e=>e.id===n.entry.id)?.signinOnly,onChanged:u}):(0,J.jsxs)(`p`,{className:`m-0 border-t border-line-soft py-4 text-sm text-muted`,children:[`Connect it first; then sign in from Edit, in the browser where `,n.entry.name,` offers that.`]})),i===`source`&&(0,J.jsx)(Dn,{defs:WT.find(e=>e.id===n.entry.id).fields,edit:{value:n.value,set:c,vars:o},base:[],stacked:!0}),i===`source`&&n.mode===`edit`&&(n.entry.id===`azure_devops`||n.entry.id===`jira`)&&Object.values(W(W(n.value).test_cases)).some(e=>String(e??``).trim())&&(0,J.jsxs)(`div`,{className:`flex flex-col gap-2 border-t border-line-soft py-4`,children:[(0,J.jsx)(`span`,{className:`text-sm text-muted`,children:`Try where existing test cases are: how many cases each line, as typed, finds through the saved connection.`}),(0,J.jsx)(`div`,{className:`flex flex-wrap gap-2`,children:Object.entries(W(W(n.value).test_cases)).filter(([,e])=>String(e??``).trim()).map(([e,t])=>(0,J.jsxs)(V,{size:`sm`,disabled:m?.busy,onClick:async()=>{h({key:e,busy:!0});try{let r=await Nt.tryMapping(n.entry.id,e,String(t??``));h({key:e,busy:!1,ok:!0,message:`${e}: ${r.cases} case${r.cases===1?``:`s`}${r.sample.length?`, such as ${r.sample.join(`; `)}`:``}`})}catch(t){h({key:e,busy:!1,ok:!1,message:`${e}: ${t.message}`})}},children:[(0,J.jsx)(r,{"aria-hidden":`true`}),m?.busy&&m.key===e?`Trying…`:`Try ${e}`]},e))}),(0,J.jsx)(`div`,{"aria-live":`polite`,children:m?.message&&(0,J.jsxs)(`p`,{role:m.ok?`status`:`alert`,className:L(`m-0 flex items-start gap-2 rounded-[12px] px-4 py-2 text-sm`,m.ok?`bg-pass-soft text-pass`:`bg-fail-soft text-fail`),children:[m.ok?(0,J.jsx)(O,{size:18,"aria-hidden":`true`,className:`mt-1 flex-none`}):(0,J.jsx)(P,{size:18,"aria-hidden":`true`,className:`mt-1 flex-none`}),(0,J.jsx)(`span`,{className:`[overflow-wrap:anywhere]`,children:m.message})]})})]}),i===`grid`&&(0,J.jsxs)(J.Fragment,{children:[(0,J.jsx)(Dn,{defs:fE[n.entry.id],edit:{value:n.value,set:c,vars:o},base:[`remote`],stacked:!0}),(0,J.jsxs)(`label`,{className:`mt-2 flex min-h-11 cursor-pointer items-center gap-4 text-sm`,children:[(0,J.jsx)(vy,{checked:!!n.useGrid,onCheckedChange:e=>t({...n,useGrid:e})}),`Run browser tests here by default`]}),(0,J.jsx)(U,{help:(0,J.jsxs)(J.Fragment,{children:[`Each one the browser settings above with its own on top. Run on several at once with `,(0,J.jsx)(`code`,{className:`font-mono text-[13px]`,children:`--devices`}),`.`]}),children:`Browser devices`}),(0,J.jsx)(Vo,{edit:{value:n.value,set:c,vars:o},base:[`devices`],defs:pE[n.entry.id],noun:`browser device`,placeholder:`win11-chrome`,meta:e=>[e.browser,e.browser_version,e.platform||[e.os,e.os_version].filter(Boolean).join(` `)].filter(Boolean).map(String).join(`, `)}),(0,J.jsxs)(`p`,{className:`m-0 border-t border-line-soft py-4 text-sm text-muted`,children:[`Its phones and tablets are in this file too: `,(0,J.jsx)(`a`,{href:B(`settings`,`mobile`),children:`Settings → Mobile`}),`.`]})]}),(i===`teams`||i===`email`)&&(0,J.jsxs)(J.Fragment,{children:[(0,J.jsx)(wE,{value:n.value,set:c}),i===`teams`||W(n.value).teams?(0,J.jsx)(Oi,{def:{key:`teams.webhook_env`,label:`Webhook variable`,help:`The address of a Teams Workflows webhook (post to a channel when a webhook request is received). It is a secret, so it is kept in your credential store.`,type:`var`,placeholder:`TEAMS_WEBHOOK_URL`},edit:{value:n.value,set:c,vars:o},base:[],stacked:!0}):null,i===`email`||W(n.value).email?(0,J.jsx)(Dn,{defs:hE,edit:{value:n.value,set:c,vars:o},base:[`email`],stacked:!0}):null]}),i===`mcp`&&(0,J.jsxs)(J.Fragment,{children:[(0,J.jsxs)(`fieldset`,{className:`m-0 border-0 p-0 py-4`,children:[(0,J.jsx)(`legend`,{className:`mb-2 font-medium`,children:`Where it runs`}),[[!0,`A server at an address`],[!1,`A command on this machine`]].map(([e,t])=>(0,J.jsxs)(`label`,{className:`flex min-h-10 cursor-pointer items-center gap-4 text-sm`,children:[(0,J.jsx)(`input`,{type:`radio`,name:`mcp-kind`,checked:v===e,onChange:()=>c(e?{url:``}:{command:``})}),t]},String(e)))]}),v?(0,J.jsxs)(J.Fragment,{children:[(0,J.jsx)(Oi,{def:{key:`url`,label:`Address`,type:`url`,placeholder:`https://api.githubcopilot.com/mcp/`},edit:{value:n.value,set:c,vars:o},base:[],stacked:!0}),(0,J.jsx)(TE,{value:n.value,set:c,vars:o})]}):(0,J.jsx)(Oi,{def:{key:`command`,label:`Command`,help:`Started by ForgeQE's agent runtime. Name secrets as {env:NAME}, never their values.`,type:`path`,placeholder:`npx -y @triparc/xray-mcp`},edit:{value:n.value,set:c,vars:o},base:[],stacked:!0})]})]})}return(0,J.jsx)(yr,{open:e?.step===`catalog`,onClose:_,title:l,description:`Pick a service to connect.`,footer:(0,J.jsxs)(V,{onClick:_,children:[(0,J.jsx)(A,{"aria-hidden":`true`}),`Close`]}),children:c.map(e=>(0,J.jsxs)(`div`,{className:`pt-4`,children:[(0,J.jsx)(`h3`,{className:`m-0 mb-1 text-sm font-medium text-muted`,children:e}),dE.filter(t=>t.group===e).map(e=>{let t=!e.many&&n(e);return(0,J.jsxs)(`button`,{type:`button`,disabled:t,onClick:()=>i(e),className:L(`flex min-h-14 w-full items-center gap-4 rounded-[12px] border-0 bg-transparent px-2 py-2 text-left text-ink`,t?`cursor-default`:`cursor-pointer hover:bg-surface-muted`),children:[(0,J.jsx)(Pr,{icon:e.icon,logo:e.logo}),(0,J.jsxs)(`span`,{className:`flex min-w-0 flex-1 flex-col gap-1`,children:[(0,J.jsx)(`span`,{className:`font-medium`,children:e.name}),(0,J.jsx)(`span`,{className:`text-sm text-muted`,children:e.note})]}),(0,J.jsx)(`span`,{className:L(`text-[13px]`,t?`text-pass`:`text-accent-fg`),children:t?`Connected`:e.many?`Add`:`Connect`})]},e.id)})]},e))})}function wE({value:e,set:t}){let n=Array.isArray(e.on)?e.on.map(String):[];return(0,J.jsxs)(`fieldset`,{className:`m-0 border-0 p-0 py-4`,children:[(0,J.jsx)(`legend`,{className:`mb-2 font-medium`,children:`Tell it when`}),(0,J.jsx)(`div`,{className:`grid grid-cols-1 gap-x-4 sm:grid-cols-2`,children:KT.map(([r,i])=>(0,J.jsxs)(`label`,{className:`flex min-h-10 cursor-pointer items-center gap-2 text-sm`,children:[(0,J.jsx)(vy,{checked:n.includes(r),onCheckedChange:i=>t({...e,on:i?[...n,r]:n.filter(e=>e!==r)})}),i]},r))})]})}function TE({value:e,set:t,vars:n}){let r=String(W(e.headers).Authorization||``),i=/\{env:([A-Za-z_][A-Za-z0-9_]*)\}/.exec(r)?.[1]||``;return(0,J.jsx)(Oi,{def:{key:`token`,label:`Token`,help:`Sent as a bearer token. Leave it empty for none.`,type:`var`,placeholder:`MCP_TOKEN`},edit:{value:{token:i},set:n=>{let r=String(n.token||``),i={...W(e.headers)};r?i.Authorization=`Bearer {env:${r}}`:delete i.Authorization,t(Object.keys(i).length?{...e,headers:i}:(({headers:e,...t})=>t)(e))},vars:n},base:[],stacked:!0})}var EE=[{key:`checks`,label:`Checks`,help:`Test case sources, comma separated: files or folders, jira:…, ado:…, testrail:…`,type:`list`,placeholder:`checks/smoke.yaml, jira:SHOP-12`},{key:`every`,label:`How often`,help:`30s, 15m, 1h or 1h30m; at least 10s.`,type:`text`,default:`15m`},{key:`replay`,label:`Checking a recorded run`,help:`Verify: one model call per check confirms the result. Trust: none.`,type:`select`,default:`verify`,options:[{value:`verify`,label:`Verify`},{value:`trust`,label:`Trust`}]},{key:`parallel`,label:`Checks at once`,type:`number`,default:1},{key:`write_back`,label:`Post each round's results`,help:`To the system each check came from.`,type:`switch`,default:!1}],DE=[{key:`fail_after`,label:`Failing rounds before the first alert`,help:`2 or more rides out a flaky run.`,type:`number`,default:1},{key:`remind_every`,label:`Remind while it keeps failing`,help:`Every 2h, for example. Empty: never.`,type:`text`,placeholder:`2h`},{key:`report_url`,label:`Where rounds are published`,help:`Alerts link each round's report there.`,type:`url`,placeholder:`https://reports.example.com/monitor`},{key:`keep`,label:`Rounds kept`,help:`Older round folders are deleted.`,type:`number`,default:100},{key:`out_dir`,label:`Round folder`,help:`Rounds and state.json: which checks are failing, and since when.`,type:`path`,default:`./.forgeqe/reports/monitor`}];function OE({kind:e,settings:t}){let n=Cr(),[r,i]=(0,q.useState)({busy:!1});return(0,J.jsxs)(`div`,{className:`flex flex-col gap-2 py-2`,children:[(0,J.jsxs)(V,{size:`sm`,className:`self-start`,"data-tip":`Send a test message`,disabled:r.busy,onClick:async()=>{i({busy:!0});let r=Object.fromEntries(Object.entries(n.pending).filter(e=>typeof e[1]==`string`));try{let n=await Yt.test(e,e,t,r);i({busy:!1,ok:n.ok,message:n.message})}catch(e){i({busy:!1,ok:!1,message:e.message})}},children:[(0,J.jsx)(C,{"aria-hidden":`true`}),r.busy?`Sending…`:`Test`]}),(0,J.jsx)(`div`,{"aria-live":`polite`,children:r.message&&(0,J.jsxs)(`p`,{role:r.ok?`status`:`alert`,className:L(`m-0 flex items-start gap-2 rounded-[12px] px-4 py-2 text-sm`,r.ok?`bg-pass-soft text-pass`:`bg-fail-soft text-fail`),children:[r.ok?(0,J.jsx)(O,{size:18,"aria-hidden":`true`,className:`mt-1 flex-none`}):(0,J.jsx)(P,{size:18,"aria-hidden":`true`,className:`mt-1 flex-none`}),(0,J.jsx)(`span`,{className:`[overflow-wrap:anywhere]`,children:r.message})]})})]})}function kE({edit:e}){let t=W(Kr(e.value,[`monitor`,`alerts`])),n=(t,n)=>e.set(K(e.value,[`monitor`,`alerts`,t],n));return(0,J.jsxs)(J.Fragment,{children:[(0,J.jsxs)(`p`,{className:`mt-0 mb-2 text-sm text-muted`,children:[`Start it with `,(0,J.jsx)(`code`,{className:`rounded-md bg-surface-strong px-2 py-1 font-mono text-[13px]`,children:`forgeqe monitor`}),`, or as a schedule.`]}),(0,J.jsx)(U,{first:!0,children:`What runs`}),(0,J.jsx)(Dn,{defs:EE,edit:e,base:[`monitor`]}),(0,J.jsx)(U,{children:`When to alert`}),(0,J.jsx)(Dn,{defs:DE,edit:e,base:[`monitor`]}),(0,J.jsx)(U,{help:`The monitor's own alerts: when a check starts failing, keeps failing, or recovers.`,children:`Alerts`}),(0,J.jsx)(H,{label:`Microsoft Teams`,help:`A channel's Workflows webhook.`,children:(0,J.jsx)(si,{checked:!!t.teams,onChange:e=>n(`teams`,e?{webhook_env:`TEAMS_MONITOR_WEBHOOK_URL`}:void 0),label:`Alert in Microsoft Teams`})}),!!t.teams&&(0,J.jsxs)(`div`,{className:`rounded-[14px] bg-surface-muted px-4 pb-2`,children:[(0,J.jsx)(Oi,{def:{key:`teams.webhook_env`,label:`Webhook address`,help:`Kept in your credential store.`,type:`var`,placeholder:`TEAMS_MONITOR_WEBHOOK_URL`},edit:e,base:[`monitor`,`alerts`],stacked:!0}),(0,J.jsx)(OE,{kind:`teams`,settings:{teams:W(t.teams)}})]}),(0,J.jsx)(H,{label:`Email`,help:`The same alerts by email.`,children:(0,J.jsx)(si,{checked:!!t.email,onChange:e=>n(`email`,e?{port:587}:void 0),label:`Alert by email`})}),!!t.email&&(0,J.jsxs)(`div`,{className:`rounded-[14px] bg-surface-muted px-4 pb-2`,children:[(0,J.jsx)(Dn,{defs:hE,edit:e,base:[`monitor`,`alerts`,`email`],stacked:!0}),(0,J.jsx)(OE,{kind:`email`,settings:{email:W(t.email)}})]})]})}function AE(e){return Pw(e).body.replace(/<!--[\s\S]*?(-->|$)/g,``).split(/\r?\n/).filter(e=>/^\s*(?:[-*+]|\d+[.)])\s+\S/.test(e)).length}var jE=65536;function ME({rules:e,others:t,onChange:n,onChanged:r}){let{data:i,error:a,reload:o}=Hn(Tt.files),[s,c]=(0,q.useState)(`rules`),[l,u]=(0,q.useState)(``),[d,f]=(0,q.useState)(null),[p,m]=(0,q.useState)(!1),[h,g]=(0,q.useState)(``),[_,v]=(0,q.useState)(``),y=(0,q.useRef)(null),b=l.toLowerCase().split(/\s+/).filter(Boolean),x=(0,q.useMemo)(()=>(i?.files||[]).filter(e=>b.every(t=>`${e.name} ${e.description} ${e.text} ${(e.agents||[]).map(e=>Ln(e).name).join(` `)}`.toLowerCase().includes(t))),[i,l]),S=e=>(g(``),v(``),f(e)),C=()=>({name:``,description:``,every:!0,agents:[],text:``}),w=async(e,t)=>{m(!0),g(``);try{await e(),f(null),o(),r(t)}catch(e){g(e.message)}finally{m(!1)}};if(!i)return(0,J.jsx)(fr,{error:a,reload:o});let T=i.agents,E=[{id:`rules`,label:`All rules`,n:e.length+t.length},{id:`files`,label:`Guardrail files`,n:i.files.length}],D=e=>e?.length?(0,J.jsx)(Mw,{names:e,max:2}):(0,J.jsx)(`span`,{className:`text-[13px] text-ink-2`,children:`Every agent`}),O=d?AE(d.text):0,ee=d&&!d.every?d.agents:[],te=d?{name:d.name,description:d.description,agents:ee,text:d.text}:null;return(0,J.jsxs)(J.Fragment,{children:[(0,J.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2 pb-4`,children:[(0,J.jsx)(mi,{label:`Show`,value:s,onChange:c,options:E.map(e=>({id:e.id,label:e.label,n:e.n}))}),s===`files`&&(0,J.jsx)(en,{id:`find-guardrails`,label:`Find guardrails`,value:l,onChange:u,placeholder:`Find guardrails or an agent`}),(0,J.jsxs)(V,{variant:`primary`,"data-tip":`Add guardrails`,onClick:()=>S(C()),children:[(0,J.jsx)(k,{"aria-hidden":`true`}),`Add`]})]}),s===`rules`&&(0,J.jsx)(Fo,{rules:e,others:t,onChange:n}),s===`files`&&(i.files.length===0?(0,J.jsxs)(nn,{icon:ye,title:`No guardrail files yet`,action:(0,J.jsxs)(V,{size:`sm`,"data-tip":`Add guardrails`,onClick:()=>S(C()),children:[(0,J.jsx)(k,{"aria-hidden":`true`}),`Add`]}),children:[`Paste or upload a Markdown file of rules, one "- rule" line each: "- Never open a production URL" for every agent, or "- Use only the test cards in knowledge/test-data.md" for WebPilot and Quill. Saved in `,i.dir,`, shared with the project.`]}):(0,J.jsx)(`div`,{className:`@container`,children:(0,J.jsx)(Sr,{label:`Guardrail files`,search:!1,empty:`No guardrails match.`,head:(0,J.jsxs)(J.Fragment,{children:[(0,J.jsx)(`th`,{className:`px-4 py-2 text-left text-[13px] font-medium whitespace-nowrap text-muted`,children:`Guardrails`}),(0,J.jsx)(`th`,{className:L(`px-4 py-2 text-left text-[13px] font-medium whitespace-nowrap text-muted`,`hidden @2xl:table-cell`),children:`Applies to`}),(0,J.jsx)(`th`,{className:L(`px-4 py-2 text-left text-[13px] font-medium whitespace-nowrap text-muted`,`text-right`),children:`Rules`})]}),children:x.map(e=>{let t=()=>S({name:e.name,description:e.description,every:!e.agents,agents:e.agents||[],text:e.text,existing:e.name});return(0,J.jsxs)(`tr`,{onClick:t,className:`cursor-pointer border-t border-line-soft align-top hover:bg-surface-muted`,children:[(0,J.jsxs)(`td`,{className:L(`px-4 py-2`,`min-w-0`),children:[(0,J.jsxs)(`button`,{type:`button`,onClick:e=>(e.stopPropagation(),t()),className:`flex cursor-pointer items-center gap-2 border-0 bg-transparent p-0 text-left`,children:[(0,J.jsx)(ye,{size:15,strokeWidth:1.8,"aria-hidden":`true`,className:`flex-none text-accent-fg`}),(0,J.jsx)(`span`,{className:`font-mono text-[13px] font-medium text-ink hover:underline`,children:e.name})]}),(0,J.jsx)(`span`,{className:`mt-1 line-clamp-1 text-[13px] text-muted`,children:e.description||e.text.split(`
65
- `).find(e=>e.trim())||``})]}),(0,J.jsx)(`td`,{className:L(`px-4 py-2`,`hidden w-[34%] @2xl:table-cell`),children:D(e.agents)}),(0,J.jsx)(`td`,{className:L(`px-4 py-2`,`w-[1%] text-right whitespace-nowrap`),children:(0,J.jsx)(`span`,{className:`rounded-full bg-surface-strong px-2 py-1 text-[13px] font-medium whitespace-nowrap text-muted tabular-nums`,children:kt(e.rules,`rule`)})})]},e.name)})})})),(0,J.jsx)(yr,{wide:!0,open:!!d,onClose:()=>f(null),title:d?.existing?`Edit ${d.existing}`:`Add guardrails`,description:(0,J.jsxs)(J.Fragment,{children:[`Rules the chosen agents must follow, from their next start. Saved in `,(0,J.jsxs)(`span`,{className:`font-mono text-[13px]`,children:[i.dir,`/`,d?.name||`name`,`.md`]}),`, shared with the project.`]}),footer:(0,J.jsxs)(J.Fragment,{children:[h&&(0,J.jsx)(`span`,{role:`alert`,className:`mr-auto self-center text-sm text-fail [overflow-wrap:anywhere]`,children:h}),d?.existing&&(0,J.jsxs)(V,{disabled:p,onClick:()=>d.existing&&w(()=>Tt.remove(d.existing),`Removed ${d.existing}.`),className:`mr-auto text-fail`,children:[(0,J.jsx)(Ie,{"aria-hidden":`true`}),`Delete`]}),(0,J.jsxs)(V,{onClick:()=>f(null),children:[(0,J.jsx)(A,{"aria-hidden":`true`}),`Cancel`]}),(0,J.jsxs)(V,{variant:`primary`,disabled:p||!d?.name||!d.every&&!d.agents.length||!O,onClick:()=>d&&te&&w(()=>d.existing?Tt.save(d.existing,te):Tt.add(te),`${d.existing?`Saved`:`Added`} ${d.name}: ${kt(O,`rule`)} for ${d.every?`every agent`:d.agents.map(e=>Ln(e).name).join(`, `)}, from their next start.`),children:[d?.existing?(0,J.jsx)(dt,{"aria-hidden":`true`}):(0,J.jsx)(k,{"aria-hidden":`true`}),p?`Saving…`:d?.existing?`Save`:`Add`]})]}),children:d&&(0,J.jsxs)(`div`,{className:`flex flex-col gap-4 pt-4`,children:[(0,J.jsxs)(`label`,{className:`flex flex-col gap-2`,children:[(0,J.jsx)(`span`,{className:`font-medium`,children:`Name`}),(0,J.jsx)(R,{value:d.name,disabled:!!d.existing,placeholder:`payments-rules`,onChange:e=>f({...d,name:e.target.value.toLowerCase().replace(/[^a-z0-9-]+/g,`-`).slice(0,48)}),className:`font-mono`}),(0,J.jsx)(`span`,{className:`text-[13px] text-muted`,children:`Lowercase letters, digits and dashes.`})]}),(0,J.jsxs)(`label`,{className:`flex flex-col gap-2`,children:[(0,J.jsx)(`span`,{className:`font-medium`,children:`What it is for`}),(0,J.jsx)(R,{value:d.description,maxLength:200,placeholder:`Keep runs off real cards and accounts`,onChange:e=>f({...d,description:e.target.value})})]}),(0,J.jsxs)(`fieldset`,{className:`m-0 flex flex-col gap-2 border-0 p-0`,children:[(0,J.jsx)(`legend`,{className:`mb-2 p-0 font-medium`,children:`Agents that follow it`}),(0,J.jsx)(mi,{label:`Agents that follow it`,value:d.every?`every`:`chosen`,onChange:e=>f({...d,every:e===`every`}),options:[{id:`every`,label:`Every agent`},{id:`chosen`,label:`Chosen agents`}]}),!d.every&&(0,J.jsx)(`div`,{className:`flex flex-wrap gap-2`,children:T.map(e=>{let t=d.agents.includes(e.name);return(0,J.jsxs)(`button`,{type:`button`,role:`checkbox`,"aria-checked":t,"data-tip":e.title,onClick:()=>f({...d,agents:t?d.agents.filter(t=>t!==e.name):[...d.agents,e.name]}),className:L(`inline-flex min-h-9 cursor-pointer items-center gap-2 rounded-[8px] border px-4 text-[13px] font-medium`,t?`border-accent bg-accent-soft text-ink`:`border-transparent bg-surface-strong text-ink-2 hover:bg-line hover:text-ink`),children:[(0,J.jsx)(Vn,{agent:e.name,px:18,decorative:!0}),Ln(e.name).name]},e.name)})}),(0,J.jsx)(`span`,{className:`text-[13px] text-muted`,children:d.every?`Every agent ForgeQE runs, and your custom agents, follow these rules.`:d.agents.length?`${d.agents.length===1?`Only this agent follows`:`Only these ${d.agents.length} agents follow`} these rules. Custom agents follow every guardrail.`:`Pick at least one agent.`})]}),(0,J.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,J.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-2`,children:[(0,J.jsx)(`label`,{htmlFor:`guardrails-text`,className:`font-medium`,children:`Rules`}),(0,J.jsx)(`input`,{ref:y,type:`file`,accept:`.md,.markdown,.txt`,className:`sr-only`,tabIndex:-1,"aria-hidden":`true`,onChange:async e=>{let t=e.target.files?.[0];if(e.target.value=``,!t)return;if(g(``),t.size>jE)return g(`${t.name} is over 64 KB.`);let{head:n,body:r}=Pw((await t.text()).replace(/\r\n/g,`
66
- `)),i=r.trim(),a=e=>RegExp(`^${e}:\\s*(.*?)\\s*$`,`m`).exec(n)?.[1]||``,o=a(`for`).split(/[,\s]+/).filter(e=>T.some(t=>t.name===e)),s=a(`description`).replace(/^"(.*)"$/,`$1`),c=d.name||t.name.replace(/\.[^.]+$/,``).toLowerCase().replace(/[^a-z0-9-]+/g,`-`).replace(/^-+|(?<!-)-+$/g,``).slice(0,48);f({...d,name:d.existing?d.name:c,text:i,description:d.description||s,...o.length?{every:!1,agents:o}:{}}),v(`From ${t.name}: ${kt(AE(i),`rule`)}${o.length?`, for ${o.map(e=>Ln(e).name).join(`, `)}`:``}.`)}}),(0,J.jsxs)(V,{size:`sm`,"data-tip":`Upload a .md file`,onClick:()=>y.current?.click(),children:[(0,J.jsx)(mt,{"aria-hidden":`true`}),`Upload`]})]}),(0,J.jsx)(pn,{id:`guardrails-text`,rows:14,spellCheck:!0,value:d.text,placeholder:`# Payments
67
-
68
- - Never open a production URL.
69
- - Use only the test cards in knowledge/test-data.md.`,onChange:e=>(v(``),f({...d,text:e.target.value})),className:`leading-[1.6]`}),(0,J.jsx)(`span`,{role:`status`,className:L(`text-[13px]`,d.text.trim()&&!O?`text-warn`:`text-muted`),children:_||(d.text.trim()&&!O?`No rules yet: start each rule on a line of its own with "- ".`:`${kt(O,`rule`)}. Paste Markdown or upload a .md file: each "- " line is a rule; headings and other lines explain them and are not sent.`)})]})]})})]})}var NE=ce({SETTINGS_INDEX:()=>LE}),PE=[`theme.logo`,`theme.logo_mark`,`theme.logo_frame`,`theme.logo_size`,`theme.icon_style`,`theme.icon_set`,`theme.icon_colour`,`theme.mascot`,`theme.mascot_colours`,`theme.name`,`theme.primary`,`theme.gradient`,`theme.secondary`,`theme.background`,`agent.names.*`,`agent.app_name`,`llm.models_file`,`llm.active`,`llm.routing`,`llm.strategy`,`llm.fallback`,`llm.routes.*`,`llm.agents.*`,`environments.file`,`environments.dir`,`environments.default`,`logins.*.url`,`logins.*.domains`,`logins.*.username_env`,`logins.*.password_env`,`logins.*.totp_env`,`logins.*.save_session`,`logins.*.app`,`logins.*.code`,`logins.*.code_host`,`logins.*.code_user_env`,`logins.*.code_secret_env`,`logins.*.code_to`,`logins.*.code_sender`,`logins.*.code_folder`,`logins.*.code_url`,`logins.*.code_header`,`logins.*.code_pattern`,`logins.*.code_wait`,`logins.*.passkey_env`,`logins.*.push_wait`,`browser.providers.browserstack`,`browser.providers.testmu`,`notify.report_url`,`notify.channels.*.teams`,`notify.channels.*.email`,`notify.channels.*.on`,`mcp.*.url`,`mcp.*.headers`,`mcp.*.command`,`mcp.*.env`,...[`checks`,`every`,`replay`,`parallel`,`write_back`,`fail_after`,`remind_every`,`report_url`,`keep`,`out_dir`,`alerts.teams.webhook_env`,`alerts.email.host`,`alerts.email.port`,`alerts.email.username_env`,`alerts.email.password_env`,`alerts.email.from`,`alerts.email.to`].map(e=>`monitor.${e}`),...[`enabled`,`external`,`dirs`,`browser_max_chars`,`disable`].map(e=>`skills.${e}`),...[`run`,`day`,`month`,`currency`].map(e=>`budget.${e}`),...[`run`,`day`,`month`].map(e=>`budget.premium_requests.${e}`),`export.format`];[...(e=>e.flatMap(e=>e.fields.map(t=>[...e.base,t.key].join(`.`))))([...PT,...FT,...IT,...YT,...LT,...VT,...UT,...XT,...$T,...eE,...tE,...qT,GT]),...WT.flatMap(e=>e.fields.length?e.fields.map(t=>[...e.base,t.key].join(`.`)):[e.base.join(`.`)]),...iE.map(e=>`containers.services.*.${e.key}`),...rE.map(e=>`product.repos.*.${e.key}`),...HT.map(e=>`product.accounts.*.${e.key}`),...nE.map(e=>`product.docs.*.${e.key}`),...aE.map(e=>`databases.*.${e.key}`),...JT.map(e=>`bi.datasets.*.${e.key}`),...QT.map(e=>`mobile.devices.*.${e.key}`),...PE];var FE=(e,t)=>t.flatMap(t=>t.fields.map(n=>({section:e,label:n.label,key:[...t.base,n.key].join(`.`)}))),IE=(e,t,n)=>n.map(n=>({section:e,label:n.label,key:`${t}.*.${n.key}`})),LE=[...FE(`browser`,PT),...FE(`tests`,FT),...FE(`runs`,[...IT,...qT]),...IE(`runs`,`bi.datasets`,JT),...FE(`parallel`,YT),...FE(`quality`,LT),...FE(`evidence`,VT),...IE(`evidence`,`product.accounts`,HT),...IE(`evidence`,`product.repos`,rE),...IE(`evidence`,`product.docs`,nE),...FE(`agents`,UT),...FE(`mobile`,[...XT,...$T]),...IE(`mobile`,`mobile.devices`,QT),...FE(`desktop`,eE),...FE(`containers`,tE),...IE(`containers`,`containers.services`,iE),...IE(`databases`,`databases`,aE),...FE(`integrations`,[GT]),...WT.flatMap(e=>e.fields.map(t=>({section:e.group===`tools`?`mcp`:`integrations`,label:`${e.name}: ${t.label}`,key:[...e.base,t.key].join(`.`)}))),{section:`integrations`,label:`Post results back`,key:`sources.write_back`},{section:`integrations`,label:`Which system an id is in`,key:`sources.id_routes`},{section:`integrations`,label:`Remote browser grids`,key:`browser.providers`},{section:`models`,label:`Models file`,key:`llm.models_file`},{section:`models`,label:`Profile in use`,key:`llm.active`},{section:`routing`,label:`Routing`,key:`llm.routing`},{section:`routing`,label:`Routing strategy`,key:`llm.strategy`},{section:`routing`,label:`Fall back to a working model`,key:`llm.fallback`},{section:`routing`,label:`An agent's own model`,key:`llm.agents`},{section:`routing`,label:`Areas of work`,key:`llm.routes`},{section:`environments`,label:`Environments file`,key:`environments.file`},{section:`environments`,label:`Environments folder`,key:`environments.dir`},{section:`environments`,label:`Active environment`,key:`environments.default`},{section:`signins`,label:`Sign-ins`,key:`logins`},{section:`notifications`,label:`Teams and email channels`,key:`notify.channels`},{section:`notifications`,label:`Where reports are published`,key:`notify.report_url`},{section:`appearance`,label:`Logo`,key:`theme.logo`},{section:`appearance`,label:`Small logo`,key:`theme.logo_mark`},{section:`appearance`,label:`Logo frame`,key:`theme.logo_frame`},{section:`appearance`,label:`Logo size`,key:`theme.logo_size`},{section:`appearance`,label:`Icon style`,key:`theme.icon_style`},{section:`appearance`,label:`Icons (3D, Phosphor, Solar or Lucide)`,key:`theme.icon_set`},{section:`appearance`,label:`Icon colour`,key:`theme.icon_colour`},{section:`appearance`,label:`Agents (robots, characters or icons)`,key:`theme.mascot`},{section:`appearance`,label:`Agent colours`,key:`theme.mascot_colours`},{section:`appearance`,label:`Name beside the logo`,key:`theme.name`},{section:`appearance`,label:`Sidebar colour (primary)`,key:`theme.primary`},{section:`appearance`,label:`Sidebar gradient`,key:`theme.gradient`},{section:`appearance`,label:`Buttons and highlights colour (secondary)`,key:`theme.secondary`},{section:`appearance`,label:`Page background`,key:`theme.background`},{section:`mcp`,label:`MCP servers`,key:`mcp`},{section:`monitor`,label:`Monitor checks, schedule and alerts`,key:`monitor`},{section:`monitor`,label:`Monitor alerts by Teams or email`,key:`monitor.alerts`},{section:`skills`,label:`Skills`,key:`skills`},{section:`tokenomics`,label:`Spending budgets`,key:`budget`},{section:`about`,label:`Version and updates`,key:`forgeqe update`},{section:`about`,label:`Guides: docs, architecture`,key:`forgeqe docs`},{section:`report`,label:`Report a problem in ForgeQE (raise a bug)`,key:`forgeqe bug report`},{section:`notifications`,label:`Send a test notification`,key:`forgeqe notify test`},{section:`agents`,label:`Agent names`,key:`agent.names`},{section:`agents`,label:`ForgeQE's name (rename the app)`,key:`agent.app_name`},{section:`evidence`,label:`Check the agent's domain knowledge`,key:`forgeqe eval domain`},{section:`generated`,label:`Generated code still in the repository`,key:`forgeqe generated`}],RE=[{step:`setup`,target:`project-folder`,title:`Your project folder`,body:`The folder of the app or tests ForgeQE works on. Browse to use one you have, or make a new one: its settings, reports and logs are kept there.`},{step:`setup`,target:`repository`,title:`Connect a repository`,body:`A folder with a repository goes on as it is. An empty one can take a clone of a repository you have, or start a new one. Skip it if you don't use git.`},{step:`setup`,target:`forgeqe-in-this-folder`,title:`Set ForgeQE up here`,body:`Writes forgeqe.yaml and its friends into the folder, keeping anything already there. Required: everything else builds on it.`,needs:`init`},{step:`setup`,target:`this-computer`,title:`What this computer needs`,body:`The browser engine and the agent runtime the agents work with. Install downloads a few hundred MB, once. Required.`,needs:`core`},{step:`setup`,target:`features-to-download`,title:`Pick your features`,body:`Talk, mobile, desktop and the knowledge graph each say what they download and how big it is. Tick what you need; nothing downloads until you agree.`},{step:`models`,target:`section`,title:`Choose a model`,body:`The model your agents think with. Pick a provider and add its key, or sign in with GitHub Copilot. Keys go to your credential store, never to a file.`},{step:`evidence`,target:`section`,title:`Teach it your product`,body:`Your product's repositories, where its requirements live and its documents. The agents read them to test what your product is meant to do.`},{step:`appearance`,target:`logo-and-name`,title:`Your logo`,body:`Upload your logo and a small one for the narrow sidebar, and give the app your team's name.`},{step:`appearance`,target:`colours`,title:`Colours and agents`,body:`The sidebar, buttons and page colours, how the agents are drawn (robots, characters or icons), or colours taken from your website.`}],zE=10,BE=()=>Number.parseFloat(getComputedStyle(document.documentElement).zoom||`1`)||1,VE=()=>({vw:window.innerWidth/BE(),vh:window.innerHeight/BE()});function HE(e){let t=document.querySelector(`[data-tour="${e}"]`);if(!t)return[];if(e===`section`)return[...t.children];let n=[t];if(t.hasAttribute(`data-group-title`))for(let e=t.nextElementSibling;e&&!e.hasAttribute(`data-group-title`);e=e.nextElementSibling)n.push(e);return n}function UE(e){if(!e.length)return null;let t=1/0,n=1/0,r=-1/0,i=-1/0;for(let a of e){if(getComputedStyle(a).position===`fixed`)continue;let e=a.getBoundingClientRect();e.width&&e.height&&(t=Math.min(t,e.top),n=Math.min(n,e.left),r=Math.max(r,e.right),i=Math.max(i,e.bottom))}if(t===1/0)return null;let a=BE();return{top:t/a-zE,left:n/a-zE,width:(r-n)/a+20,height:(i-t)/a+20}}function WE(e,t){let[n,r]=(0,q.useState)(null);return(0,q.useLayoutEffect)(()=>{let t=document.documentElement;if(!e)return t.classList.remove(`tour-on`),r(null);t.classList.add(`tour-on`);let n=new Set,i=e=>{let t=new Set(e);for(let e of n)t.has(e)||e.classList.remove(`tour-lit`);for(let e of t)e.classList.contains(`tour-lit`)||e.classList.add(`tour-lit`);n=t},a=0,o=()=>{cancelAnimationFrame(a),a=requestAnimationFrame(()=>{let t=HE(e);i(t);let n=UE(t);r(e=>n&&e&&Math.abs(n.top-e.top)<.5&&Math.abs(n.left-e.left)<.5&&Math.abs(n.height-e.height)<.5&&Math.abs(n.width-e.width)<.5?e:n)})},s=0,c=()=>{let t=document.querySelector(`[data-tour="${e}"]`);if(!t&&s++<40)return void(l=setTimeout(c,150));t?.scrollIntoView({behavior:window.matchMedia(`(prefers-reduced-motion: reduce)`).matches?`auto`:`smooth`,block:`start`}),o()},l=setTimeout(c,60),u=new ResizeObserver(o);u.observe(document.body);let d=new MutationObserver(o);return d.observe(document.body,{childList:!0,subtree:!0}),window.addEventListener(`scroll`,o,!0),window.addEventListener(`resize`,o),()=>{for(let e of n)e.classList.remove(`tour-lit`);t.classList.remove(`tour-on`),clearTimeout(l),cancelAnimationFrame(a),u.disconnect(),d.disconnect(),window.removeEventListener(`scroll`,o,!0),window.removeEventListener(`resize`,o)}},[e,t]),n}function GE({box:e}){return e?(0,J.jsx)(`div`,{className:`tour-ring`,style:{top:e.top,left:e.left,width:e.width,height:e.height}}):null}var KE=360;function qE(e,t){let{vw:n,vh:r}=VE(),i=Math.min(KE,n-32);return e?e.left+e.width+24+i<n?{top:(e=>Math.min(Math.max(16,e),r-t-16))(e.top),left:e.left+e.width+24,width:i}:e.top+e.height+16+t<r?{top:e.top+e.height+16,left:Math.min(Math.max(16,e.left),n-i-16),width:i}:e.top-16-t>0?{top:e.top-16-t,left:Math.min(Math.max(16,e.left),n-i-16),width:i}:{top:r-t-16,left:n-i-16,width:i}:{top:Math.max(16,(r-t)/2),left:(n-i)/2,width:i}}var JE=`forgeqe-tour-welcome`,YE=()=>{try{sessionStorage.setItem(JE,`1`)}catch{}},XE=()=>{try{return sessionStorage.getItem(JE)===`1`}catch{return!1}},ZE=()=>{try{sessionStorage.removeItem(JE)}catch{}},QE=!1;function $E({step:e,ready:t,coreReady:n,onGo:r,onSkipAll:i,onFinish:a,note:o,welcome:s,onStart:c}){let l=RE.map((e,t)=>({...e,i:t})).filter(t=>t.step===e),[u,d]=(0,q.useState)(()=>QE?l.length-1:0),[f,p]=(0,q.useState)(()=>s&&e===`setup`&&!QE?`welcome`:`tour`),[m,h]=(0,q.useState)(!1);(0,q.useEffect)(()=>{QE=!1},[]);let g=l[Math.min(u,l.length-1)],_=WE(f===`tour`&&!m?g.target:void 0,g.i),v=(0,q.useRef)(null),[y,b]=(0,q.useState)(220);(0,q.useLayoutEffect)(()=>{v.current&&b(v.current.offsetHeight)});let x=g.needs===`init`?!t:g.needs===`core`&&!n,S=RE.length,C=(0,q.useCallback)(()=>{if(u<l.length-1)return d(u+1);let t=[`setup`,`models`,`evidence`,`appearance`],n=t.indexOf(e);if(n===t.length-1)return p(`finish`);r(t[n+1])},[u,l.length,e,r]);return(0,q.useEffect)(()=>{let e=e=>{f!==`tour`||m||e.target?.closest?.(`input, textarea, select, [contenteditable]`)||(e.key===`ArrowRight`&&!x&&C(),e.key===`Escape`&&h(!0))};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[f,m,x,C]),m?(0,oa.createPortal)((0,J.jsxs)(`button`,{type:`button`,onClick:()=>h(!1),className:`tour-card fixed right-6 bottom-6 z-[62] inline-flex min-h-11 cursor-pointer items-center gap-2 rounded-full border-0 bg-accent px-6 text-sm font-medium text-accent-ink shadow-composer`,children:[(0,J.jsx)(je,{size:16,"aria-hidden":`true`}),`Resume the tour · `,g.i+1,` of `,S]}),document.body):f===`welcome`?(0,oa.createPortal)((0,J.jsxs)(eD,{children:[(0,J.jsx)(`div`,{className:`flex size-14 items-center justify-center rounded-[16px] bg-accent-soft text-accent`,children:(0,J.jsx)(T,{size:28,"aria-hidden":`true`})}),(0,J.jsx)(`h2`,{id:`tour-title`,className:`m-0 text-[25px] leading-tight font-semibold tracking-[-0.01em]`,children:`Welcome to ForgeQE`}),(0,J.jsx)(`p`,{className:`m-0 text-[16px] leading-relaxed text-ink-2`,children:`A few minutes to get you started. We'll light up each part of the app as we go, and you set it up right there.`}),(0,J.jsx)(`ol`,{className:`m-0 flex list-none flex-col gap-2 p-0`,children:[[`Set up`,`your folder, repository and what to download`,!0],[`Models`,`the AI your agents think with`,!1],[`Product knowledge`,`what your product does`,!1],[`Appearance`,`your logo, colours and agents`,!1]].map(([e,t,n],r)=>(0,J.jsxs)(`li`,{className:`flex items-center gap-4 rounded-[12px] bg-surface-muted px-4 py-2`,style:{animation:`tour-pop 0.4s ${.08*r+.1}s cubic-bezier(0.22,1,0.36,1) both`},children:[(0,J.jsx)(`span`,{className:`inline-flex size-6 flex-none items-center justify-center rounded-full bg-accent text-[13px] font-semibold text-accent-ink tabular-nums`,children:r+1}),(0,J.jsxs)(`span`,{className:`min-w-0 flex-1 text-sm`,children:[(0,J.jsx)(`span`,{className:`font-medium text-ink`,children:e}),` `,(0,J.jsxs)(`span`,{className:`text-ink-2`,children:[`· `,t]})]}),n?(0,J.jsx)(`span`,{className:`text-[13px] font-medium text-muted`,children:`Required`}):null]},String(e)))}),(0,J.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2 pt-2`,children:[(0,J.jsx)(V,{variant:`ghost`,onClick:()=>(n&&t||p(`tour`),i()),"data-tip":`Skip onboarding: everything but Set up can be done later in Settings`,children:`Skip onboarding`}),(0,J.jsx)(`span`,{className:`flex-1`}),(0,J.jsxs)(V,{variant:`primary`,size:`lg`,onClick:()=>{c(),p(`tour`)},autoFocus:!0,children:[`Let's go`,(0,J.jsx)(Xe,{"aria-hidden":`true`})]})]})]}),document.body):f===`finish`?(0,oa.createPortal)((0,J.jsxs)(eD,{children:[(0,J.jsx)(nD,{}),(0,J.jsx)(`div`,{className:`flex size-14 items-center justify-center rounded-[16px] bg-pass-soft text-pass`,children:(0,J.jsx)(dt,{size:28,strokeWidth:2.5,"aria-hidden":`true`})}),(0,J.jsx)(`h2`,{id:`tour-title`,className:`m-0 text-[25px] leading-tight font-semibold tracking-[-0.01em]`,children:`You're all set`}),(0,J.jsx)(`p`,{className:`m-0 text-[16px] leading-relaxed text-ink-2`,children:`ForgeQE is ready to work. Anything you skipped is in Settings whenever you want it, and Settings › Set up can run this tour again.`}),(0,J.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2 pt-2`,children:[(0,J.jsxs)(V,{variant:`ghost`,onClick:()=>p(`tour`),children:[(0,J.jsx)(Se,{"aria-hidden":`true`}),`Back`]}),(0,J.jsx)(`span`,{className:`flex-1`}),(0,J.jsxs)(V,{variant:`primary`,size:`lg`,onClick:a,autoFocus:!0,children:[(0,J.jsx)(T,{"aria-hidden":`true`}),`Open ForgeQE`]})]})]}),document.body):(0,oa.createPortal)((0,J.jsxs)(J.Fragment,{children:[(0,J.jsx)(GE,{box:_}),(0,J.jsxs)(`div`,{ref:v,role:`dialog`,"aria-modal":`false`,"aria-labelledby":`tour-card-title`,className:`tour-card fixed z-[62] flex flex-col gap-4 rounded-[16px] border border-line bg-bg p-6 shadow-composer`,style:qE(_,y),children:[(0,J.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,J.jsxs)(`span`,{className:`text-[13px] font-medium tracking-wide text-accent uppercase`,children:[`Step `,g.i+1,` of `,S]}),g.needs&&(0,J.jsx)(`span`,{className:`rounded-full bg-surface-strong px-2 text-[13px] font-medium text-ink-2`,children:`Required`}),(0,J.jsx)(`span`,{className:`flex-1`}),(0,J.jsx)(`button`,{type:`button`,"aria-label":`Hide the tour`,"data-tip":`Hide the tour (Esc)`,onClick:()=>h(!0),className:`inline-flex size-8 cursor-pointer items-center justify-center rounded-[8px] border-0 bg-transparent text-muted hover:bg-surface-strong hover:text-ink`,children:(0,J.jsx)(A,{size:16,"aria-hidden":`true`})})]}),(0,J.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,J.jsx)(`h2`,{id:`tour-card-title`,className:`m-0 text-lg leading-snug font-semibold`,children:g.title}),(0,J.jsx)(`p`,{className:`m-0 text-sm leading-relaxed text-ink-2`,children:g.body})]}),o&&(0,J.jsx)(`p`,{role:`alert`,className:`m-0 rounded-[10px] bg-fail-soft px-4 py-2 text-[13px] leading-relaxed text-fail`,children:o}),x&&(0,J.jsxs)(`p`,{role:`status`,className:`m-0 flex items-start gap-2 rounded-[10px] bg-warn-soft px-4 py-2 text-[13px] leading-relaxed text-warn`,children:[(0,J.jsx)(Ze,{size:14,"aria-hidden":`true`,className:`mt-1 flex-none`}),g.needs===`init`?`Press Set up in the lit area first: Next opens once it is done.`:`Press Install in the lit area: Next opens once the browser engine and agent runtime are ready.`]}),(0,J.jsx)(`div`,{"aria-hidden":`true`,className:`flex gap-1`,children:RE.map((e,t)=>(0,J.jsx)(`span`,{className:L(`h-1 flex-1 rounded-full transition-colors duration-300`,t<g.i?`bg-accent/50`:t===g.i?`bg-accent`:`bg-surface-strong`)},t))}),(0,J.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,J.jsxs)(V,{size:`sm`,variant:`ghost`,onClick:()=>{if(u>0)return d(u-1);let t=[`setup`,`models`,`evidence`,`appearance`],n=t.indexOf(e);n>0?(QE=!0,r(t[n-1])):p(`welcome`)},children:[(0,J.jsx)(Se,{"aria-hidden":`true`}),`Back`]}),(0,J.jsx)(`span`,{className:`flex-1`}),e!==`setup`&&(0,J.jsx)(V,{size:`sm`,onClick:()=>{let t=[`setup`,`models`,`evidence`,`appearance`],n=t.indexOf(e);if(n===t.length-1)return p(`finish`);r(t[n+1],e)},"data-tip":`Skip this step: set it later in Settings`,children:`Skip`}),(0,J.jsxs)(V,{size:`sm`,variant:`primary`,disabled:x,onClick:C,autoFocus:!0,children:[g.i===S-1?`Finish`:`Next`,(0,J.jsx)(Xe,{"aria-hidden":`true`})]})]}),e===`setup`&&(0,J.jsx)(`button`,{type:`button`,onClick:i,className:`-mt-2 cursor-pointer self-start border-0 bg-transparent p-0 text-[13px] text-muted hover:text-ink`,children:`Skip onboarding`})]},g.i)]}),document.body)}function eD({children:e}){return(0,J.jsxs)(J.Fragment,{children:[(0,J.jsx)(`div`,{className:`tour-pane`,style:{inset:0}}),(0,J.jsx)(`div`,{className:`fixed inset-0 z-[62] flex items-center justify-center overflow-y-auto p-4`,children:(0,J.jsx)(`div`,{role:`dialog`,"aria-modal":`true`,"aria-labelledby":`tour-title`,className:`tour-card relative flex w-full max-w-[480px] flex-col gap-4 overflow-hidden rounded-[20px] border border-line bg-bg p-8 shadow-composer`,children:e})})]})}var tD=[`var(--color-accent)`,`var(--color-pass)`,`var(--color-warn)`,`#ec4899`,`#8b5cf6`,`#06b6d4`];function nD(){return(0,J.jsx)(`span`,{"aria-hidden":`true`,className:`pointer-events-none absolute inset-x-0 top-0 h-0`,children:Array.from({length:28},(e,t)=>(0,J.jsx)(`span`,{className:`tour-confetti`,style:{left:`${t*37%100}%`,background:tD[t%tD.length],animationDelay:`${t%7*.08}s`}},t))})}var rD=`font-mono text-[13px] [overflow-wrap:anywhere]`;function iD({ok:e,children:t}){return(0,J.jsxs)(`p`,{role:e?`status`:`alert`,className:L(`m-0 flex items-start gap-2 rounded-[12px] px-4 py-2 text-sm leading-relaxed`,e?`bg-pass-soft text-pass`:`bg-fail-soft text-fail`),children:[e?(0,J.jsx)(O,{size:18,"aria-hidden":`true`,className:`mt-1 flex-none`}):(0,J.jsx)(ze,{size:18,"aria-hidden":`true`,className:`mt-1 flex-none`}),(0,J.jsx)(`span`,{className:`[overflow-wrap:anywhere]`,children:t})]})}function aD({open:e,start:t,onClose:n,onPick:r}){let[i,a]=(0,q.useState)(null),[o,c]=(0,q.useState)(``),[l,u]=(0,q.useState)(``),[d,f]=(0,q.useState)(null),[p,m]=(0,q.useState)(!1),h=(0,q.useCallback)(async e=>{u(``);try{let t=await Rt.folders(e);a(t),c(t.path)}catch(e){u(e.message)}},[]);(0,q.useEffect)(()=>{e?h(t||void 0):(f(null),u(``))},[e,t,h]);let g=async()=>{if(i&&d!==null){u(``);try{let e=await Rt.newFolder(i.path,d);a(e),c(e.path),f(null)}catch(e){u(e.message)}}};return(0,J.jsxs)(yr,{open:e,onClose:n,wide:!0,title:`Choose the project folder`,description:`The folder of the app or test repository ForgeQE works on. Its settings, reports and logs are kept in it.`,footer:(0,J.jsxs)(J.Fragment,{children:[i?.project&&(0,J.jsx)(`span`,{className:`mr-auto self-center text-sm text-pass`,children:`ForgeQE is set up here`}),(0,J.jsxs)(V,{onClick:n,children:[(0,J.jsx)(A,{"aria-hidden":`true`}),`Cancel`]}),(0,J.jsxs)(V,{variant:`primary`,disabled:!i||p,onClick:async()=>{m(!0);try{await r(i.path)}catch(e){u(e.message)}finally{m(!1)}},"data-tip":`Use this folder`,children:[(0,J.jsx)(dt,{"aria-hidden":`true`}),`Use`]})]}),children:[(0,J.jsxs)(`form`,{className:`flex gap-2 pt-6`,onSubmit:e=>{e.preventDefault(),h(o.trim())},children:[(0,J.jsx)(`label`,{htmlFor:`folder-path`,className:`sr-only`,children:`Folder path`}),(0,J.jsx)(R,{id:`folder-path`,value:o,spellCheck:!1,onChange:e=>c(e.target.value),className:`font-mono`,placeholder:`/Users/you/shop`}),(0,J.jsxs)(V,{size:`sm`,type:`submit`,children:[(0,J.jsx)(Xe,{"aria-hidden":`true`}),`Go`]})]}),(0,J.jsxs)(`div`,{className:`flex flex-wrap gap-2 pt-4`,children:[(0,J.jsxs)(V,{size:`sm`,disabled:!i?.parent,onClick:()=>i?.parent&&void h(i.parent),children:[(0,J.jsx)(rt,{"aria-hidden":`true`}),`Up`]}),(0,J.jsxs)(V,{size:`sm`,onClick:()=>void h(i?.home),children:[(0,J.jsx)(yt,{"aria-hidden":`true`}),`Home`]}),(0,J.jsxs)(V,{size:`sm`,disabled:!i,"data-tip":`New folder`,onClick:()=>f(``),children:[(0,J.jsx)(k,{"aria-hidden":`true`}),`New`]})]}),d!==null&&(0,J.jsxs)(`form`,{className:`flex flex-wrap gap-2 pt-4`,onSubmit:e=>{e.preventDefault(),g()},children:[(0,J.jsx)(`label`,{htmlFor:`new-folder`,className:`sr-only`,children:`New folder's name`}),(0,J.jsx)(R,{id:`new-folder`,autoFocus:!0,value:d,placeholder:`my-shop-tests`,onChange:e=>f(e.target.value),className:`flex-[1_1_200px]`}),(0,J.jsxs)(V,{size:`sm`,type:`submit`,variant:`primary`,disabled:!d.trim(),"data-tip":`Make the folder`,children:[(0,J.jsx)(k,{"aria-hidden":`true`}),`Create`]}),(0,J.jsxs)(V,{size:`sm`,onClick:()=>f(null),children:[(0,J.jsx)(A,{"aria-hidden":`true`}),`Cancel`]})]}),(0,J.jsx)(`div`,{"aria-live":`polite`,className:`pt-4`,children:l&&(0,J.jsx)(iD,{ok:!1,children:l})}),i&&(0,J.jsxs)(`ul`,{"aria-label":`Folders in ${i.path}`,className:`m-0 mt-2 flex list-none flex-col p-0`,children:[i.folders.length===0&&(0,J.jsx)(`li`,{className:`border-t border-line-soft py-4 text-sm text-muted`,children:`No folders in here.`}),i.folders.map(e=>(0,J.jsx)(`li`,{className:`border-t border-line-soft`,children:(0,J.jsxs)(`button`,{type:`button`,onClick:()=>void h(e.path),className:`flex min-h-12 w-full cursor-pointer items-center gap-4 border-0 bg-transparent px-2 text-left text-ink hover:bg-surface-muted`,children:[e.project?(0,J.jsx)(s,{size:18,"aria-hidden":`true`,className:`flex-none text-pass`}):(0,J.jsx)(Zt,{icon:ue,size:18,className:`flex-none text-muted`}),(0,J.jsx)(`span`,{className:`min-w-0 flex-1 [overflow-wrap:anywhere]`,children:e.name}),e.project&&(0,J.jsx)(z,{tone:`pass`,children:`ForgeQE`})]})},e.path))]})]})}function oD({report:e}){let t=[...new Set(e.rows.map(e=>e.group))];return(0,J.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,J.jsx)(iD,{ok:!e.missing&&!e.outdated,children:e.missing||e.outdated?`${e.missing} missing and ${e.outdated} out of date. Install what's missing puts back the browser engine, the agent runtime and, for a device on this computer, Appium; the others say what installs them.`:`Every package ForgeQE needs now is installed.`}),t.map(t=>(0,J.jsxs)(`ul`,{"aria-label":t,className:`m-0 flex list-none flex-col p-0`,children:[(0,J.jsx)(`li`,{className:`pt-4 pb-1 text-sm font-medium text-ink-2`,children:t}),e.rows.filter(e=>e.group===t).map(e=>(0,J.jsxs)(`li`,{className:`flex min-h-[48px] flex-wrap items-center gap-x-4 gap-y-1 border-t border-line-soft py-2`,children:[(0,J.jsx)(`span`,{className:L(`min-w-0 flex-[1_1_180px]`,rD),children:e.name}),(0,J.jsxs)(`span`,{className:`min-w-0 flex-[2_1_240px] text-sm text-muted [overflow-wrap:anywhere]`,children:[e.status===`ok`?e.installed||`Installed`:e.status===`missing`?`Needs ${e.wanted}`:`${e.installed} installed, needs ${e.wanted}`,e.status!==`ok`&&(0,J.jsxs)(J.Fragment,{children:[` · Fix: `,/^forgeqe /.test(e.fix)?(0,J.jsx)(`code`,{className:`font-mono text-[13px]`,children:e.fix}):e.fix]})]}),(0,J.jsx)(z,{tone:e.status===`ok`?`pass`:e.later?`neutral`:`warn`,children:e.status===`ok`?`Installed`:e.later?`When first used`:e.status===`missing`?`Missing`:`Out of date`})]},e.name))]},t))]})}function sD({state:e,onState:t,guide:n=!1}){let[r,i]=(0,q.useState)(!1),[a,o]=(0,q.useState)({busy:!1}),[c,l]=(0,q.useState)(null),[u,f]=(0,q.useState)(``),[p,m]=(0,q.useState)(!1),[h,g]=(0,q.useState)({busy:!1}),_=async()=>{g({busy:!0});try{g({busy:!1,report:await Rt.packages()})}catch(e){g({busy:!1,error:e.message})}},v=(0,q.useCallback)(()=>{f(``),Rt.machine().then(l,e=>f(e.message))},[]);(0,q.useEffect)(v,[v,e.project,e.ready]);let y=!!c?.job?.running;(0,q.useEffect)(()=>{if(!y)return;let e=setInterval(v,1500);return()=>clearInterval(e)},[y,v]),(0,q.useEffect)(()=>{!y&&h.report&&_()},[y]);let x=async e=>{let n=await Rt.open(e);o({busy:!1}),t(n),i(!1)},S=c?.job,C=c?.checks.filter(e=>!/^(Models?\b|Copilot sign-in)/.test(e.name))||[],w=C.filter(e=>!e.ok&&/forgeqe setup/.test(e.fix||``));return(0,J.jsxs)(J.Fragment,{children:[(0,J.jsx)(U,{first:!0,help:`The folder of the project ForgeQE works on: an app, its tests, or both. ForgeQE keeps its settings, reports and logs there.`,children:`1. Project folder`}),(0,J.jsxs)(`div`,{className:`flex min-h-[68px] flex-wrap items-center gap-x-4 gap-y-2 border-t border-line-soft py-4`,children:[(0,J.jsx)(Pr,{icon:e.ready?s:ue}),(0,J.jsxs)(`span`,{className:`flex min-w-0 flex-[1_1_260px] flex-col gap-1`,children:[(0,J.jsx)(`span`,{className:L(`font-medium`,rD),children:e.project}),(0,J.jsx)(`span`,{className:`text-sm text-muted`,children:e.ready?`ForgeQE is set up here (${e.config}).`:`ForgeQE is not set up in this folder yet.`})]}),(0,J.jsxs)(V,{size:`sm`,"data-tip":e.ready?`Open another folder`:`Choose a folder`,onClick:()=>i(!0),children:[(0,J.jsx)(d,{"aria-hidden":`true`}),`Browse`]})]}),e.recent.length>0&&(0,J.jsx)(`ul`,{"aria-label":`Recent projects`,className:`m-0 flex list-none flex-col p-0`,children:e.recent.map(e=>(0,J.jsxs)(`li`,{className:`flex min-h-[56px] flex-wrap items-center gap-x-4 gap-y-2 border-t border-line-soft py-2 pl-14`,children:[(0,J.jsx)(`span`,{className:L(`min-w-0 flex-[1_1_260px] text-ink-2`,rD),children:e}),(0,J.jsx)(V,{variant:`icon`,size:`icon-sm`,"aria-label":`Open ${e}`,"data-tip":`Open ${e}`,onClick:()=>void x(e).catch(e=>f(e.message)),children:(0,J.jsx)(Xe,{"aria-hidden":`true`})})]},e))}),(0,J.jsx)(cD,{project:e.project}),(0,J.jsx)(U,{help:`forgeqe.yaml, llms.json, env.yaml and a .forgeqe folder with prompts, skills and guardrails to change. Files already there are kept.`,children:`3. ForgeQE in this folder`}),(0,J.jsx)(H,{label:e.ready?`Set up`:`Not set up yet`,help:e.ready?`${e.config} is in this folder, so every section of Settings is open.`:`Until it is, the other sections of Settings stay locked: there is nothing for them to change.`,children:e.ready?(0,J.jsx)(z,{tone:`pass`,children:`Done`}):(0,J.jsxs)(V,{size:`sm`,variant:`primary`,"data-tip":`Set up this folder`,disabled:a.busy,onClick:async()=>{o({busy:!0});try{let e=await Rt.init();o({busy:!1,result:e}),t(e.setup)}catch(e){o({busy:!1,error:e.message})}},children:[(0,J.jsx)(b,{"aria-hidden":`true`}),a.busy?`Setting up…`:`Set up`]})}),(0,J.jsxs)(`div`,{"aria-live":`polite`,className:`flex flex-col gap-2`,children:[a.error&&(0,J.jsx)(iD,{ok:!1,children:a.error}),a.result&&(0,J.jsxs)(iD,{ok:!a.result.failed.length,children:[a.result.created.length?`Made ${a.result.created.join(`, `)}.`:`Nothing new was needed.`,a.result.failed.length>0&&` Could not write: ${a.result.failed.join(`; `)}.`]})]}),(0,J.jsx)(U,{help:`What ForgeQE runs with: its browser engine and the agent runtime. Installing them needs no admin rights${c?`. ForgeQE ${c.version}`:``}.`,children:`4. This computer`}),u&&(0,J.jsx)(iD,{ok:!1,children:u}),!c&&!u&&(0,J.jsx)(`p`,{role:`status`,className:`m-0 border-t border-line-soft py-6 text-sm text-muted`,children:`Checking this computer…`}),c&&(0,J.jsx)(`ul`,{"aria-label":`What this computer has`,className:`m-0 flex list-none flex-col p-0`,children:C.map(e=>(0,J.jsxs)(`li`,{className:`flex min-h-[56px] items-start gap-4 border-t border-line-soft py-4`,children:[e.ok?(0,J.jsx)(O,{size:18,"aria-label":`Ready`,className:`mt-1 flex-none text-pass`}):(0,J.jsx)(ze,{size:18,"aria-label":`Missing`,className:`mt-1 flex-none text-warn`}),(0,J.jsxs)(`span`,{className:`flex min-w-0 flex-1 flex-col gap-1`,children:[(0,J.jsx)(`span`,{className:`font-medium`,children:e.name}),(0,J.jsxs)(`span`,{className:`text-sm text-muted [overflow-wrap:anywhere]`,children:[e.detail,!e.ok&&e.fix&&(0,J.jsxs)(J.Fragment,{children:[`. `,/forgeqe setup/.test(e.fix)?`Install, below, sets it up.`:e.fix]})]})]})]},e.name))}),c&&(0,J.jsxs)(`div`,{className:`flex flex-wrap items-center gap-4 border-t border-line-soft py-4`,children:[(0,J.jsx)(V,{size:`sm`,variant:w.length?`primary`:`outline`,"data-tip":w.length?`Install what's missing`:`Check and repair`,disabled:y||p,onClick:async()=>{m(!0);try{await Rt.run(),v()}catch(e){f(e.message)}finally{m(!1)}},children:y?(0,J.jsxs)(J.Fragment,{children:[(0,J.jsx)($t,{state:`handing`,px:16}),`Installing…`]}):w.length?(0,J.jsxs)(J.Fragment,{children:[(0,J.jsx)(Ye,{"aria-hidden":`true`}),`Install`]}):(0,J.jsxs)(J.Fragment,{children:[(0,J.jsx)(te,{"aria-hidden":`true`}),`Repair`]})}),(0,J.jsxs)(V,{size:`sm`,disabled:h.busy,onClick:()=>void _(),"data-tip":`Find missing packages: lists every package ForgeQE installs here, with the version it needs and the one installed`,children:[(0,J.jsx)(_e,{"aria-hidden":`true`}),h.busy?`Finding…`:`Find`]}),(0,J.jsx)(`span`,{className:`text-sm text-muted`,children:`Install runs forgeqe setup. The first time it downloads a few hundred MB and takes a few minutes.`})]}),(0,J.jsxs)(`div`,{"aria-live":`polite`,className:`flex flex-col gap-2`,children:[h.error&&(0,J.jsx)(iD,{ok:!1,children:h.error}),h.report&&(0,J.jsx)(oD,{report:h.report})]}),S&&(0,J.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[!S.running&&(0,J.jsx)(iD,{ok:!!S.ok,children:S.ok?`forgeqe setup finished.`:`forgeqe setup stopped with a problem. The last lines below say what.`}),(0,J.jsx)(`pre`,{"aria-label":`forgeqe setup output`,"aria-live":`polite`,className:`m-0 max-h-[280px] overflow-auto rounded-[12px] bg-surface-muted px-4 py-4 font-mono text-[13px] leading-relaxed whitespace-pre-wrap text-ink-2 [overflow-wrap:anywhere]`,children:S.lines.length?S.lines.join(`
70
- `):`Starting…`})]}),(0,J.jsx)(fD,{coreReady:!!c?.engine&&!!c?.runtime,onDone:v}),(0,J.jsx)(U,{help:`At least one model with its key or sign-in, for the agents to think with.`,children:`6. A model`}),(0,J.jsx)(H,{label:c?.model.ready?`Ready`:`Not yet`,help:c?.model.detail||``,children:e.ready?(0,J.jsxs)(`a`,{className:Ct({variant:c?.model.ready?`outline`:`primary`}),href:B(`settings`,`models`),"data-tip":c?.model.ready?`Open Models`:`Add a model`,children:[c?.model.ready?(0,J.jsx)(Xe,{"aria-hidden":`true`}):(0,J.jsx)(k,{"aria-hidden":`true`}),c?.model.ready?`Models`:`Add`]}):(0,J.jsx)(`span`,{className:`text-sm text-muted`,children:`After step 3`})}),e.ready&&(0,J.jsx)(hT,{}),!n&&(0,J.jsxs)(J.Fragment,{children:[(0,J.jsx)(U,{help:`Set up, the model, your product's knowledge and how the app looks, one section after another.`,children:`Onboarding`}),(0,J.jsx)(H,{label:`Walk through onboarding`,help:`Starts again from this section, whatever was skipped before.`,children:(0,J.jsxs)(V,{size:`sm`,"data-tip":`Walk through onboarding`,onClick:async()=>{try{await St.save({redo:!0})}finally{YE(),location.hash=B(`welcome`,`setup`)}},children:[(0,J.jsx)(T,{"aria-hidden":`true`}),`Start`]})})]}),(0,J.jsx)(aD,{open:r,start:e.project,onClose:()=>i(!1),onPick:x})]})}function cD({project:e}){let[t,n]=(0,q.useState)(null),[r,a]=(0,q.useState)(``),[o,s]=(0,q.useState)(null),c=(0,q.useCallback)(()=>{St.repo().then(n,e=>a(e.message))},[]);(0,q.useEffect)(c,[c,e]);let l=()=>{s(null),c()};return(0,J.jsxs)(J.Fragment,{children:[(0,J.jsx)(U,{help:`The git repository your tests live in. A folder that has one goes on as it is; an empty one can take a clone of one you have.`,children:`2. Repository`}),r&&(0,J.jsx)(iD,{ok:!1,children:r}),!t&&!r&&(0,J.jsx)(`p`,{role:`status`,className:`m-0 border-t border-line-soft py-6 text-sm text-muted`,children:`Reading the folder…`}),t?.git&&(0,J.jsx)(H,{label:t.remote?(0,J.jsx)(`span`,{className:rD,children:t.remote}):`A repository with no remote`,help:[t.branch&&`On ${t.branch}`,t.commit&&`at ${t.commit}`,t.root&&`inside the repository at ${t.root}`].filter(Boolean).join(` `)||`Add a remote with git when you want to share it; ForgeQE works either way.`,children:(0,J.jsx)(z,{tone:`pass`,children:`Connected`})}),t&&!t.git&&(0,J.jsxs)(J.Fragment,{children:[(0,J.jsx)(H,{label:`Clone a repository`,help:t.empty?`Copy a repository you have (GitHub, Azure DevOps, GitLab…) into this empty folder.`:`This folder has ${t.entries} ${t.entries===1?`item`:`items`} in it: a clone needs an empty folder. Choose or make one above.`,children:(0,J.jsxs)(V,{size:`sm`,variant:t.empty?`primary`:`outline`,disabled:!t.empty,onClick:()=>s(`clone`),"data-tip":`Clone a repository into this folder`,children:[(0,J.jsx)(i,{"aria-hidden":`true`}),`Clone`]})}),(0,J.jsx)(H,{label:`Start a new repository`,help:`git init in this folder, with your remote's address if you have one. Nothing is pushed.`,children:(0,J.jsxs)(V,{size:`sm`,onClick:()=>s(`new`),"data-tip":`Start a repository here`,children:[(0,J.jsx)(k,{"aria-hidden":`true`}),`Start`]})})]}),(0,J.jsx)(lD,{open:o===`clone`,onClose:()=>s(null),onDone:l}),(0,J.jsx)(uD,{open:o===`new`,onClose:()=>s(null),onDone:l})]})}function lD({open:e,onClose:t,onDone:n}){let[r,i]=(0,q.useState)(``),[a,o]=(0,q.useState)(``),[s,c]=(0,q.useState)([]),[l,u]=(0,q.useState)(null),[d,f]=(0,q.useState)(``),[p,m]=(0,q.useState)(``),[h,g]=(0,q.useState)(``);(0,q.useEffect)(()=>{e&&(g(``),St.tokens().then(e=>c(e.tokens),()=>{}))},[e]);let _=async e=>{m(e),g(``);try{if(e===`test`){let e=await St.branches(r.trim(),a||void 0);u(e.branches),f(e.head??e.branches[0]??``)}else await St.clone(r.trim(),d||void 0,a||void 0),n()}catch(e){g(e.message)}finally{m(``)}};return(0,J.jsxs)(yr,{open:e,onClose:t,title:`Clone a repository`,description:`Into the project folder. Test first: it checks the repository answers and lists its branches.`,footer:(0,J.jsxs)(J.Fragment,{children:[(0,J.jsxs)(V,{onClick:t,children:[(0,J.jsx)(A,{"aria-hidden":`true`}),`Cancel`]}),(0,J.jsxs)(V,{disabled:!r.trim()||!!p,onClick:()=>void _(`test`),"data-tip":`Check the repository answers`,children:[p===`test`?(0,J.jsx)($t,{state:`working`,px:14}):(0,J.jsx)(We,{"aria-hidden":`true`}),p===`test`?`Testing…`:`Test`]}),(0,J.jsxs)(V,{variant:`primary`,disabled:!l||!!p,onClick:()=>void _(`clone`),"data-tip":`Clone into this folder`,children:[p===`clone`?(0,J.jsx)($t,{state:`working`,px:14}):(0,J.jsx)(Ye,{"aria-hidden":`true`}),p===`clone`?`Cloning…`:`Clone`]})]}),children:[(0,J.jsx)(H,{label:`Address`,help:`https:// or git@. Leave any user name or token out of it.`,htmlFor:`clone-url`,stacked:!0,children:(0,J.jsx)(R,{id:`clone-url`,value:r,spellCheck:!1,placeholder:`https://github.com/org/tests.git`,onChange:e=>(i(e.target.value),u(null)),className:`font-mono`})}),(0,J.jsx)(H,{label:`Token`,help:(0,J.jsxs)(J.Fragment,{children:[`For a private repository: a token saved in `,(0,J.jsx)(`a`,{href:B(`settings`,`secrets`),children:`Secrets`}),`, by its name. Used for this clone only, never written into the folder.`]}),htmlFor:`clone-token`,stacked:!0,children:(0,J.jsxs)(ln,{id:`clone-token`,value:a,onChange:e=>(o(e.target.value),u(null)),children:[(0,J.jsx)(`option`,{value:``,children:`None (public, or ssh)`}),s.map(e=>(0,J.jsx)(`option`,{value:e,children:e},e))]})}),l&&(0,J.jsx)(H,{label:`Branch`,htmlFor:`clone-branch`,stacked:!0,children:(0,J.jsx)(ln,{id:`clone-branch`,value:d,onChange:e=>f(e.target.value),children:l.map(e=>(0,J.jsx)(`option`,{value:e,children:e},e))})}),(0,J.jsx)(`div`,{"aria-live":`polite`,children:h&&(0,J.jsx)(iD,{ok:!1,children:h})})]})}function uD({open:e,onClose:t,onDone:n}){let[r,i]=(0,q.useState)(``),[a,o]=(0,q.useState)(!1),[s,c]=(0,q.useState)(``);return(0,J.jsxs)(yr,{open:e,onClose:t,title:`Start a new repository`,description:`git init in the project folder. Nothing is pushed.`,footer:(0,J.jsxs)(J.Fragment,{children:[(0,J.jsxs)(V,{onClick:t,children:[(0,J.jsx)(A,{"aria-hidden":`true`}),`Cancel`]}),(0,J.jsxs)(V,{variant:`primary`,disabled:a,onClick:async()=>{o(!0),c(``);try{await St.startRepo(r.trim()||void 0),n()}catch(e){c(e.message)}finally{o(!1)}},children:[a?(0,J.jsx)($t,{state:`working`,px:14}):(0,J.jsx)(k,{"aria-hidden":`true`}),`Start`]})]}),children:[(0,J.jsx)(H,{label:`Remote address`,help:`Optional: an empty repository you made on GitHub, Azure DevOps or GitLab, to push to later.`,htmlFor:`new-remote`,stacked:!0,children:(0,J.jsx)(R,{id:`new-remote`,value:r,spellCheck:!1,placeholder:`https://github.com/org/new-tests.git`,onChange:e=>i(e.target.value),className:`font-mono`})}),(0,J.jsx)(`div`,{"aria-live":`polite`,children:s&&(0,J.jsx)(iD,{ok:!1,children:s})})]})}var dD=e=>e>=1024?`${(e/1024).toFixed(1)} GB`:`${e} MB`;function fD({coreReady:e,onDone:t}){let[n,r]=(0,q.useState)(null),[i,a]=(0,q.useState)([]),[o,s]=(0,q.useState)(!1),[c,l]=(0,q.useState)(``),u=(0,q.useCallback)(()=>{St.features().then(r,e=>l(e.message))},[]);(0,q.useEffect)(u,[u]);let d=!!n?.job?.running;(0,q.useEffect)(()=>{if(!d)return;let e=setInterval(u,1500);return()=>clearInterval(e)},[d,u]);let[f,p]=(0,q.useState)(!1);(0,q.useEffect)(()=>{f&&!d&&t(),p(d)},[d]);let m=n?.features??[],h=m.filter(e=>!e.required),g=e=>m.find(t=>t.id===e),_=(e,t)=>a(n=>t?[...new Set([...n,e.id,...e.needs&&!g(e.needs).ready?[e.needs]:[]])]:n.filter(t=>t!==e.id&&g(t).needs!==e.id)),v=m.filter(e=>(i.includes(e.id)||e.required&&i.length>0)&&!e.ready&&e.available),y=v.reduce((e,t)=>e+t.mb,0),b=n?.freeMb??null,x=b!==null&&y>b,S=n?.job;return(0,J.jsxs)(J.Fragment,{children:[(0,J.jsx)(U,{help:`Pick what you'll use ForgeQE for. Each says what it downloads, about how much and where; nothing downloads until you agree.`,children:`5. Features to download`}),c&&(0,J.jsx)(iD,{ok:!1,children:c}),!n&&!c&&(0,J.jsx)(`p`,{role:`status`,className:`m-0 border-t border-line-soft py-6 text-sm text-muted`,children:`Checking this computer…`}),h.map(e=>{let t=S?.failed.find(t=>t.id===e.id);return(0,J.jsx)(H,{label:e.name,htmlFor:`feature-${e.id}`,help:(0,J.jsxs)(`span`,{className:`flex flex-col gap-1`,children:[(0,J.jsx)(`span`,{children:e.gives}),!e.ready&&e.available&&(0,J.jsxs)(`span`,{className:`text-muted`,children:[`Downloads `,e.downloads,`: about `,dD(e.mb),`, in `,(0,J.jsx)(`span`,{className:`font-mono`,children:e.where}),`.`,e.needs?` Needs ${g(e.needs).name}.`:``]}),e.note&&(0,J.jsx)(`span`,{className:e.available?`text-warn`:`text-muted`,children:e.note}),t&&(0,J.jsx)(`span`,{className:`text-fail [overflow-wrap:anywhere]`,children:t.error})]}),children:S?.current===e.id?(0,J.jsx)(z,{tone:`running`,children:`Installing`}):e.ready?(0,J.jsx)(z,{tone:`pass`,children:`Ready`}):e.available?(0,J.jsx)(vy,{id:`feature-${e.id}`,checked:i.includes(e.id),disabled:d,onCheckedChange:t=>_(e,t)}):(0,J.jsx)(z,{tone:`neutral`,children:`Not offered here`})},e.id)}),n&&(0,J.jsx)(H,{label:v.length?`${v.length} to set up, about ${dD(y)}`:`Nothing picked`,help:(0,J.jsxs)(J.Fragment,{children:[v.length>0&&(0,J.jsxs)(J.Fragment,{children:[v.map(e=>e.name).join(`, `),`. `]}),!e&&v.length>0&&`The browser engine comes first: every feature builds on it. `,b!==null&&(0,J.jsxs)(J.Fragment,{children:[`This computer has `,dD(b),` free.`]}),x&&(0,J.jsx)(`span`,{className:`text-fail`,children:` Not enough free space: free some up, or pick fewer.`})]}),children:o?(0,J.jsxs)(`span`,{className:`flex flex-wrap items-center gap-2`,children:[(0,J.jsxs)(V,{size:`sm`,variant:`primary`,disabled:d,onClick:async()=>{s(!1),l(``);try{r(await St.install(i)),a([])}catch(e){l(e.message)}},"data-tip":`Download about ${dD(y)} and set these up`,children:[(0,J.jsx)(dt,{"aria-hidden":`true`}),`Download `,dD(y)]}),(0,J.jsx)(V,{size:`sm`,variant:`ghost`,onClick:()=>s(!1),children:`Cancel`})]}):(0,J.jsxs)(V,{size:`sm`,disabled:!v.length||d||x,onClick:()=>s(!0),"data-tip":`Set up the features picked`,children:[d?(0,J.jsx)($t,{state:`handing`,px:16}):(0,J.jsx)(Ye,{"aria-hidden":`true`}),d?`Installing…`:`Set up`]})}),S&&(0,J.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[!S.running&&(0,J.jsx)(iD,{ok:!S.failed.length,children:S.failed.length?`${S.done.length} of ${S.picked.length} set up; ${S.failed.length} did not.`:`${S.done.length} of ${S.picked.length} set up.`}),(0,J.jsx)(`pre`,{"aria-label":`Feature set-up output`,"aria-live":`polite`,className:`m-0 max-h-[280px] overflow-auto rounded-[12px] bg-surface-muted px-4 py-4 font-mono text-[13px] leading-relaxed whitespace-pre-wrap text-ink-2 [overflow-wrap:anywhere]`,children:S.lines.length?S.lines.join(`
71
- `):`Starting…`})]})]})}var pD={"notify-test":[`Sending a test card`,`Sent a test card`,`working`],"update-check":[`Looking for a new version`,`Looked for a new version`,`searching`],update:[`Updating ForgeQE`,`Updated ForgeQE`,`working`],"eval-domain":[`Checking the agent's domain knowledge`,`Checked the agent's domain knowledge`,`thinking`]};function mD(){let[e,t]=(0,q.useState)(null),[n,r]=(0,q.useState)(``),i=(0,q.useCallback)(()=>Ht.view().then(t,e=>r(e.message)),[]);(0,q.useEffect)(()=>void i(),[i]);let a=!!e?.job?.running;return(0,q.useEffect)(()=>{if(!a)return;let e=setInterval(i,1e3);return()=>clearInterval(e)},[a,i]),{view:e,error:n,run:async(e,t={})=>{r(``);try{await Ht.run(e,t),i()}catch(e){r(e.message)}},running:a,load:i}}function hD({job:e,kinds:t,onStop:n}){let r=(0,q.useRef)(null);if((0,q.useEffect)(()=>{r.current&&(r.current.scrollTop=r.current.scrollHeight)},[e?.lines.length]),!e||!t.includes(e.kind))return null;let[i,a,o]=pD[e.kind];return(0,J.jsxs)(`div`,{className:`mt-4 flex flex-col gap-2 rounded-[12px] card border p-4`,children:[(0,J.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,J.jsx)(`span`,{className:`flex-1 text-sm font-medium`,children:e.running?i:a}),(0,J.jsx)(z,{tone:e.running?`running`:e.exitCode===0?`pass`:`fail`,orb:o,children:e.running?`Working`:e.exitCode===0?`Done`:`Did not finish`}),e.running&&(0,J.jsxs)(V,{size:`sm`,variant:`danger`,onClick:n,children:[(0,J.jsx)(Je,{fill:`currentColor`,"aria-hidden":`true`}),`Stop`]})]}),(0,J.jsx)(`pre`,{ref:r,className:`m-0 max-h-[260px] overflow-auto rounded-[10px] bg-surface-muted p-4 font-mono text-[13px] leading-relaxed whitespace-pre-wrap text-ink-2`,children:e.lines.join(`
72
- `)||`Starting…`})]})}function gD({text:e,note:t,yes:n,icon:r,onYes:i,onNo:a}){return(0,J.jsxs)(`div`,{role:`alertdialog`,"aria-label":e,className:`mt-4 flex flex-col gap-2 rounded-[12px] border border-warn bg-warn-soft p-4`,children:[(0,J.jsx)(`span`,{className:`text-sm font-medium`,children:e}),(0,J.jsx)(`span`,{className:`text-[13px] text-ink-2`,children:t}),(0,J.jsxs)(`div`,{className:`flex flex-wrap gap-2`,children:[(0,J.jsxs)(V,{size:`sm`,variant:`primary`,onClick:i,children:[(0,J.jsx)(r,{"aria-hidden":`true`}),n]}),(0,J.jsxs)(V,{size:`sm`,"data-tip":`Not now`,onClick:a,children:[(0,J.jsx)(A,{"aria-hidden":`true`}),`Later`]})]})]})}var _D=6e4;function vD({view:e,onError:t}){let[n,r]=(0,q.useState)(!1),[i,a]=(0,q.useState)(!1);if(e.pending)return(0,J.jsx)(yD,{view:e,version:e.pending,onError:t});if(!e.running||!e.version||e.running===e.version)return null;let o=async()=>{r(!1);try{await Ht.restart()}catch(e){t(e.message);return}a(!0);let n=Date.now()+_D;for(;Date.now()<n;){await new Promise(e=>setTimeout(e,1e3));try{if((await Ht.view()).running!==e.running)return location.reload()}catch{}}a(!1),t(`forgeqe web did not come back. Start it again in its terminal; this page reconnects with the address it prints.`)};return(0,J.jsxs)(J.Fragment,{children:[(0,J.jsx)(H,{label:`Installed`,help:e.restart?`This page runs ${e.running}. Restart forgeqe web to use ${e.version}.`:`This page runs ${e.running}. Start forgeqe web again in its terminal to use ${e.version}.`,children:(0,J.jsxs)(`span`,{className:`flex flex-wrap items-center gap-2`,children:[(0,J.jsx)(`span`,{className:`font-mono text-[16px]`,children:e.version}),e.restart&&(0,J.jsxs)(V,{size:`sm`,variant:`primary`,disabled:i,"data-tip":`Restart forgeqe web`,onClick:()=>r(!0),children:[(0,J.jsx)(f,{"aria-hidden":`true`}),i?`Restarting…`:`Restart`]})]})}),n&&(0,J.jsx)(gD,{text:`Restart forgeqe web with ${e.version}?`,note:`Open chats close; a message carries each one on. It waits for nothing at work: stop it first. This page reconnects by itself.`,yes:`Restart`,icon:f,onYes:()=>void o(),onNo:()=>r(!1)})]})}function yD({view:e,version:t,onError:n}){let[r,i]=(0,q.useState)(!1),[a,o]=(0,q.useState)(null),s=async()=>{i(!1);try{let e=await Ht.restart();o({log:e.log})}catch(e){n(e.message)}};return(0,J.jsxs)(J.Fragment,{children:[(0,J.jsx)(H,{label:`Ready`,help:e.restart?`This page runs ${e.running}. Restart forgeqe web to install ${t}.`:`This page runs ${e.running}. Close forgeqe web, run forgeqe update in a terminal, then start it again.`,children:(0,J.jsxs)(`span`,{className:`flex flex-wrap items-center gap-2`,children:[(0,J.jsx)(`span`,{className:`font-mono text-[16px]`,children:t}),e.restart&&(0,J.jsxs)(V,{size:`sm`,variant:`primary`,disabled:!!a,"data-tip":`Restart forgeqe web and install ${t}`,onClick:()=>i(!0),children:[(0,J.jsx)(f,{"aria-hidden":`true`}),a?`Installing…`:`Restart`]})]})}),a&&(0,J.jsxs)(`p`,{role:`status`,className:`mt-2 mb-1 flex items-start gap-2 rounded-[12px] bg-pass-soft px-4 py-2 text-sm text-pass`,children:[(0,J.jsx)(O,{size:18,"aria-hidden":`true`,className:`mt-1 flex-none`}),(0,J.jsxs)(`span`,{className:`[overflow-wrap:anywhere]`,children:[`forgeqe web is closing to install `,t,`. When it is done it starts again in a new window and opens a new tab; you can close this one.`,a.log?` What the update does is written to ${a.log}.`:``]})]}),r&&(0,J.jsx)(gD,{text:`Restart forgeqe web and install ${t}?`,note:`forgeqe web closes, ForgeQE is updated, and forgeqe web starts again in a new window with a new tab. Open chats close; a message carries each one on. It waits for nothing at work: stop it first.`,yes:`Restart`,icon:f,onYes:()=>void s(),onNo:()=>i(!1)})]})}function bD(){let{view:e,error:t,run:n,running:r}=mD(),[i,a]=(0,q.useState)(``),[o,s]=(0,q.useState)(!1),c=e?.job,l=c?.kind===`update-check`&&!c.running?c.lines.join(`
73
- `):``,u=/installs (\d[\w.-]*)/.exec(l)?.[1];return(0,J.jsxs)(J.Fragment,{children:[(t||i)&&(0,J.jsx)(`p`,{className:`m-0 mb-4 rounded-[12px] bg-fail-soft px-4 py-2 text-sm text-fail`,children:t||i}),(0,J.jsx)(H,{label:`Version`,help:u?`${u} is out.`:l&&/latest/.test(l)?`This is the latest.`:`forgeqe update installs a new one for every forgeqe on this computer (bun, npm, pip).`,className:`border-t-0 pt-0`,children:(0,J.jsxs)(`span`,{className:`flex flex-wrap items-center gap-2`,children:[(0,J.jsx)(`span`,{className:`font-mono text-[16px]`,children:e?e.running||e.version:`…`}),(0,J.jsxs)(V,{size:`sm`,disabled:r,"data-tip":`Check for updates`,onClick:()=>void n(`update-check`),children:[(0,J.jsx)(ot,{"aria-hidden":`true`}),`Check`]}),(0,J.jsxs)(V,{size:`sm`,variant:u?`primary`:`outline`,disabled:r,"data-tip":u?`Update to ${u}`:`Update to the latest version`,onClick:()=>s(!0),children:[(0,J.jsx)(f,{"aria-hidden":`true`}),`Update`]})]})}),o&&(0,J.jsx)(gD,{text:`Update ForgeQE${u?` to ${u}`:` to the latest version`} on this computer?`,note:`It replaces every forgeqe on PATH. When it is done, restart forgeqe web from here; on Windows it is installed when you restart forgeqe web.`,yes:`Update`,icon:f,onYes:()=>{s(!1),n(`update`,{confirmed:!0})},onNo:()=>s(!1)}),(0,J.jsx)(hD,{job:c,kinds:[`update-check`,`update`],onStop:()=>void Ht.stop()}),e&&(0,J.jsx)(vD,{view:e,onError:a}),(0,J.jsx)(U,{children:`Guides`}),[[`Docs`,`Every feature with examples, setup, settings and commands, with search.`,e?.help.guide],[`Architecture`,`How ForgeQE is built: its agents, the engine and where data goes.`,e?.help.architecture]].map(([e,t,n])=>(0,J.jsx)(H,{label:e,help:t,children:n?(0,J.jsxs)(`a`,{href:n,target:`_blank`,rel:`noreferrer noopener`,className:Ct({size:`sm`}),children:[(0,J.jsx)(Ke,{"aria-hidden":`true`}),`Open`]}):(0,J.jsxs)(V,{size:`sm`,disabled:!0,children:[(0,J.jsx)(Ke,{"aria-hidden":`true`}),`Open`]})},e))]})}function xD(){let{view:e,error:t,run:n,running:r}=mD(),[i,a]=(0,q.useState)(``);return e?.channels.length?(0,J.jsxs)(J.Fragment,{children:[(0,J.jsx)(U,{help:`A card says it is a test and which events each channel gets; nothing else is sent.`,children:`Send a test`}),(0,J.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,J.jsxs)(ln,{"aria-label":`Channel`,value:i,onChange:e=>a(e.target.value),className:`w-[220px]`,children:[(0,J.jsx)(`option`,{value:``,children:`Every channel`}),e.channels.map(e=>(0,J.jsx)(`option`,{children:e},e))]}),(0,J.jsxs)(V,{size:`sm`,disabled:r,"data-tip":`Send a test`,onClick:()=>void n(`notify-test`,i?{channel:i}:{}),children:[(0,J.jsx)(C,{"aria-hidden":`true`}),`Test`]})]}),t&&(0,J.jsx)(`p`,{className:`m-0 mt-2 text-sm text-fail`,children:t}),(0,J.jsx)(hD,{job:e.job,kinds:[`notify-test`],onStop:()=>void Ht.stop()})]}):null}function SD(){let{view:e,error:t,run:n,running:i}=mD(),[a,o]=(0,q.useState)(``),[s,c]=(0,q.useState)(!1);return e?.evalCases.length?(0,J.jsxs)(J.Fragment,{children:[(0,J.jsx)(U,{help:`Runs stories from ForgeQE's evaluation cases (banking, insurance, lending, privacy) with the domain declared and without, and scores how many domain and regulation expectations the agent's test design meets. It makes model calls for each case.`,children:`Check the agent's domain knowledge`}),(0,J.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,J.jsxs)(ln,{"aria-label":`Cases`,value:a,onChange:e=>o(e.target.value),className:`w-[320px] max-w-full`,children:[(0,J.jsxs)(`option`,{value:``,children:[`All `,e.evalCases.length,` cases`]}),e.evalCases.map(e=>(0,J.jsx)(`option`,{value:e.id,children:e.title},e.id))]}),(0,J.jsxs)(V,{size:`sm`,disabled:i,"data-tip":`Run the domain check`,onClick:()=>c(!0),children:[(0,J.jsx)(r,{"aria-hidden":`true`}),`Run`]})]}),s&&(0,J.jsx)(gD,{text:`Run ${a?`one case`:`all ${e.evalCases.length} cases`} of the domain check?`,note:`Each case is a model session with the domain and one without, plus a judge; it takes a few minutes and costs tokens.`,yes:`Run`,icon:r,onYes:()=>{c(!1),n(`eval-domain`,{confirmed:!0,...a?{only:[a]}:{}})},onNo:()=>c(!1)}),t&&(0,J.jsx)(`p`,{className:`m-0 mt-2 text-sm text-fail`,children:t}),(0,J.jsx)(hD,{job:e.job,kinds:[`eval-domain`],onStop:()=>void Ht.stop()})]}):null}function CD(){let[e,t]=(0,q.useState)(null),[n,r]=(0,q.useState)(``);if((0,q.useEffect)(()=>{Ht.generated().then(t,e=>r(e.message))},[]),n)return(0,J.jsx)(`p`,{className:`m-0 rounded-[12px] bg-fail-soft px-4 py-2 text-sm text-fail`,children:n});if(!e)return(0,J.jsx)(`p`,{className:`m-0 text-sm text-muted`,children:`Loading…`});let i=(e,t)=>t?`${Math.round(e/t*100)}%`:`–`;return e.runs?(0,J.jsxs)(J.Fragment,{children:[(0,J.jsxs)(`p`,{className:`mt-0 mb-4 text-sm text-muted`,children:[`In `,(0,J.jsx)(`span`,{className:`font-mono text-[13px]`,children:e.repo}),`, from .forgeqe/generated.jsonl: every line ForgeQE added, checked against the files as they are now.`]}),(0,J.jsxs)(Yr,{label:`Generated code`,children:[(0,J.jsx)(di,{label:`Lines written`,value:e.written.toLocaleString(),note:`${kt(e.files,`file`)}: ${e.created} created, ${e.edited} edited`}),(0,J.jsx)(di,{label:`Still in the code`,value:i(e.present,e.written),note:`${e.present.toLocaleString()} lines`}),(0,J.jsx)(di,{label:`Share of those files`,value:i(e.present,e.totalLines),note:`of ${e.totalLines.toLocaleString()} lines`}),(0,J.jsx)(di,{label:`Files it created`,value:String(e.headers.unchanged),note:`as written; ${e.headers.changed} changed, ${e.headers.removed} gone`})]}),(0,J.jsx)(U,{children:`By run, newest first`}),(0,J.jsx)(Zr,{label:`Runs that wrote code`,head:[`Run`,`Files`,`Lines still there`],children:e.byRun.map(e=>(0,J.jsx)(An,{cells:[(0,J.jsxs)(`span`,{className:`flex flex-col gap-1`,children:[(0,J.jsx)(`span`,{className:`font-mono text-[13px]`,children:e.fq}),(0,J.jsxs)(`span`,{className:`text-[13px] text-muted [overflow-wrap:anywhere]`,children:[e.run,e.test?` · ${e.test}`:``]})]},`r`),e.files,`${e.present} of ${e.written}`]},e.fq))}),e.missing.length>0&&(0,J.jsxs)(`p`,{className:`m-0 mt-4 text-[13px] text-muted [overflow-wrap:anywhere]`,children:[`Not found now: `,e.missing.slice(0,10).join(`, `)]})]}):(0,J.jsxs)(`p`,{className:`m-0 flex items-center gap-2 text-sm text-muted`,children:[(0,J.jsx)(Zt,{icon:ke,size:16}),`ForgeQE has not written code in `,!e.repo||e.repo===`.`?`this repository`:(0,J.jsx)(`span`,{className:`font-mono text-[13px]`,children:e.repo}),` yet.`]})}var wD={critical:`Critical: ForgeQE cannot start, or loses or exposes data`,high:`High: a main feature does not work`,medium:`Medium: there is a workaround`,low:`Low: small or cosmetic`},TD=3,ED={done:`finished`,failed:`failed`,stopped:`stopped`,running:`running`};function DD(e){let[t,n]=(0,q.useState)(null),[r,i]=(0,q.useState)(``),a=(0,q.useCallback)(()=>yn.view(e).then(n,e=>i(e.message)),[e]);(0,q.useEffect)(()=>void a(),[a]);let o=!!t?.job?.running;return(0,q.useEffect)(()=>{if(!o)return;let e=setInterval(a,1e3);return()=>clearInterval(e)},[o,a]),{view:t,error:r,setError:i,load:a,running:o}}function OD({draft:e,areas:t,severities:n,onChange:r}){let i=(0,q.useId)(),a=(t,n)=>r({...e,[t]:n});return(0,J.jsxs)(J.Fragment,{children:[(0,J.jsx)(H,{label:`Title`,htmlFor:`${i}-title`,stacked:!0,className:`border-t-0 pt-0`,children:(0,J.jsx)(R,{id:`${i}-title`,value:e.title,maxLength:200,onChange:e=>a(`title`,e.target.value)})}),(0,J.jsx)(H,{label:`What happened`,htmlFor:`${i}-summary`,stacked:!0,children:(0,J.jsx)(pn,{id:`${i}-summary`,rows:4,value:e.summary,maxLength:4e3,onChange:e=>a(`summary`,e.target.value)})}),(0,J.jsx)(H,{label:`Steps to reproduce`,help:`One step on each line.`,htmlFor:`${i}-steps`,stacked:!0,children:(0,J.jsx)(pn,{id:`${i}-steps`,rows:4,value:e.steps.join(`
74
- `),onChange:e=>a(`steps`,e.target.value.split(`
75
- `))})}),(0,J.jsx)(H,{label:`Expected result`,htmlFor:`${i}-expected`,stacked:!0,children:(0,J.jsx)(pn,{id:`${i}-expected`,rows:2,value:e.expected,maxLength:2e3,onChange:e=>a(`expected`,e.target.value)})}),(0,J.jsx)(H,{label:`Actual result`,help:`Copy an error message exactly.`,htmlFor:`${i}-actual`,stacked:!0,children:(0,J.jsx)(pn,{id:`${i}-actual`,rows:2,value:e.actual,maxLength:2e3,onChange:e=>a(`actual`,e.target.value)})}),(0,J.jsx)(H,{label:`Severity`,htmlFor:`${i}-severity`,children:(0,J.jsx)(ln,{id:`${i}-severity`,value:e.severity,onChange:e=>a(`severity`,e.target.value),children:n.map(e=>(0,J.jsx)(`option`,{value:e,children:wD[e]??e},e))})}),(0,J.jsx)(H,{label:`Area`,htmlFor:`${i}-area`,children:(0,J.jsx)(ln,{id:`${i}-area`,value:e.area,onChange:e=>a(`area`,e.target.value),children:t.map(e=>(0,J.jsx)(`option`,{value:e,children:e[0].toUpperCase()+e.slice(1)},e))})})]})}var kD=e=>e<1024?`${e} bytes`:`${Math.round(e/1024)} KB`;function AD(){let[e,t]=(0,q.useState)(null),{view:n,error:r,setError:i,load:a,running:o}=DD(e),s=(0,q.useId)(),[c,l]=(0,q.useState)(``),[u,d]=(0,q.useState)(null),[p,m]=(0,q.useState)([]),[h,g]=(0,q.useState)({}),[_,v]=(0,q.useState)(null),[y,b]=(0,q.useState)([]),[x,S]=(0,q.useState)(``),[w,T]=(0,q.useState)(!1),[E,D]=(0,q.useState)(``),[O,ee]=(0,q.useState)(null),te=(0,q.useRef)(null),ne=(0,q.useRef)(null),j=n?.job;(0,q.useEffect)(()=>{j&&!j.running&&ne.current!==j&&(ne.current=j,j.error?i(j.error):j.kind===`draft`&&j.result?(d(j.result.draft),m(j.result.questions),g({})):j.kind===`send`&&j.result&&ee(j.result))},[j,i]);let M=n?.attachments??[],re=n?.session??void 0,N=_??new Set(M.filter(e=>e.picked).map(e=>e.id)),ie=e=>{t(e),v(null)},ae=(e,t)=>{let n=new Set(N);t?n.add(e):n.delete(e),v(n)},oe=async e=>{i(``);try{await yn.draft(e),a()}catch(e){i(e.message)}},P=()=>void oe({session:re,description:c,current:u??void 0,answers:p.map(e=>({question:e,answer:h[e]??``}))}),se=async e=>{i(``);for(let t of Array.from(e??[]).slice(0,TD-y.length))try{let e=await Ji(t);if(e.type!==`image/png`&&e.type!==`image/jpeg`)throw Error(`${t.name}: use a PNG or JPEG picture.`);b(t=>[...t,{name:e.name,url:`data:${e.type};base64,${e.data}`}])}catch(e){i(e.message)}},ce=async()=>{if(u){T(!1),i(``);try{await yn.send({session:re,draft:u,attach:[...N],images:y.map(e=>e.url),contact:x.trim()||void 0,confirmed:!0}),a()}catch(e){i(e.message)}}},le=async()=>{if(u){i(``);try{let{text:e}=await yn.text(u);await navigator.clipboard.writeText(e),D(`Copied. Paste it into an email or a Teams message to the ForgeQE team.`)}catch(e){i(e.message)}}},F=()=>{l(``),t(null),d(null),m([]),g({}),b([]),v(null),ee(null),D(``)};if(!n)return r?(0,J.jsx)(`p`,{role:`alert`,className:`m-0 rounded-[12px] bg-fail-soft px-4 py-2 text-sm text-fail [overflow-wrap:anywhere]`,children:r}):(0,J.jsx)(`p`,{className:`m-0 text-sm text-muted`,children:`Loading…`});let ue=n.intake.url&&(n.intake.key||n.intake.entra),de=O?.url&&/^https:\/\/dev\.azure\.com\/[^\s"<>]+$/.test(O.url)?O.url:null;return O?(0,J.jsxs)(`div`,{"aria-live":`polite`,className:`flex flex-col gap-4`,children:[(0,J.jsxs)(`p`,{className:`m-0 text-sm text-ink-2`,children:[O.existing?`This problem was already reported, so your report was added to bug `:`Thank you. The ForgeQE team has your report as bug `,de?(0,J.jsxs)(`a`,{href:de,target:`_blank`,rel:`noreferrer noopener`,className:`font-medium text-ink no-underline hover:underline`,children:[`#`,O.id]}):(0,J.jsxs)(`span`,{className:`font-medium`,children:[`#`,O.id]}),` `,`in `,n.target,`.`]}),(0,J.jsx)(`div`,{children:(0,J.jsxs)(V,{size:`sm`,"data-tip":`Report another problem`,onClick:F,children:[(0,J.jsx)(k,{"aria-hidden":`true`}),`New`]})})]}):(0,J.jsxs)(J.Fragment,{children:[r&&(0,J.jsx)(`p`,{role:`alert`,className:`m-0 mb-4 rounded-[12px] bg-fail-soft px-4 py-2 text-sm text-fail [overflow-wrap:anywhere]`,children:r}),(0,J.jsx)(U,{first:!0,help:n.sessions.length?`ForgeQE looked at your recent sessions and picked the one that went wrong. Pick another if that is not the one.`:`ForgeQE has no session on this computer to look at. Say what went wrong in your own words.`,children:`What went wrong`}),n.sessions.length>0&&(0,J.jsx)(`div`,{role:`radiogroup`,"aria-label":`Session to report`,children:n.sessions.map(e=>(0,J.jsxs)(`div`,{className:`flex min-h-[68px] flex-wrap items-center gap-x-4 gap-y-2 border-t border-line-soft py-4 first:border-t-0`,children:[(0,J.jsx)(Ww,{checked:n.session===e.name,onSelect:()=>ie(e.name),label:`Report ${e.title}`}),(0,J.jsxs)(`span`,{className:`flex min-w-0 flex-[1_1_260px] flex-col gap-1`,children:[(0,J.jsx)(`span`,{className:`font-medium [overflow-wrap:anywhere]`,children:e.title}),(0,J.jsx)(`span`,{className:`text-sm text-muted`,children:[`forgeqe ${e.command}`,ta(e.startedAt),ED[e.status]].join(` · `)}),e.error&&(0,J.jsx)(`span`,{className:`text-sm text-fail [overflow-wrap:anywhere]`,children:e.error})]}),e.problem&&(0,J.jsx)(z,{tone:`fail`,children:`Went wrong`})]},e.name))}),n.findings&&(0,J.jsxs)(J.Fragment,{children:[(0,J.jsx)(U,{help:`From the session's log, with secrets removed. The bug is drafted from this. Test cases that failed are your app's results, so they are only counted.`,children:`What ForgeQE found`}),(0,J.jsxs)(`dl`,{className:`m-0 flex flex-col gap-4 text-sm`,children:[(0,J.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,J.jsx)(`dt`,{className:`font-medium text-ink`,children:`What was asked or run`}),(0,J.jsx)(`dd`,{className:`m-0 font-mono text-[13px] text-ink-2 [overflow-wrap:anywhere]`,children:n.findings.request})]}),(0,J.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,J.jsx)(`dt`,{className:`font-medium text-ink`,children:`ForgeQE's errors`}),(0,J.jsx)(`dd`,{className:`m-0`,children:n.findings.errors.length?(0,J.jsx)(`ul`,{className:`m-0 flex list-none flex-col gap-1 p-0`,children:n.findings.errors.map(e=>(0,J.jsx)(`li`,{className:`rounded-[10px] bg-surface-muted px-4 py-2 font-mono text-[13px] leading-relaxed text-ink-2 [overflow-wrap:anywhere]`,children:e},e))}):(0,J.jsx)(`span`,{className:`text-ink-2`,children:`None logged. Say below what went wrong.`})})]}),n.findings.facts.length>0&&(0,J.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,J.jsx)(`dt`,{className:`font-medium text-ink`,children:`Also`}),(0,J.jsx)(`dd`,{className:`m-0`,children:(0,J.jsx)(`ul`,{className:`m-0 flex list-disc flex-col gap-1 pl-6 text-ink-2`,children:n.findings.facts.map(e=>(0,J.jsx)(`li`,{className:`[overflow-wrap:anywhere]`,children:e},e))})})]})]})]}),(0,J.jsx)(H,{label:n.findings?`Anything to add`:`Describe the problem`,help:n.findings?`Optional: what you were trying to do, or what you expected.`:void 0,htmlFor:`${s}-description`,stacked:!0,className:n.findings?void 0:`border-t-0 pt-0`,children:(0,J.jsx)(pn,{id:`${s}-description`,rows:n.findings?3:5,value:c,maxLength:8e3,placeholder:n.findings?`For example: I expected the run to open the login page.`:`For example: I clicked Run on a test case in the web app and nothing happened for ten minutes.`,onChange:e=>l(e.target.value)})}),(0,J.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2 pt-2`,children:[(0,J.jsxs)(V,{size:`sm`,variant:u?`outline`:`primary`,disabled:o||!re&&c.trim().length<10,"data-tip":u?`Draft again`:`Draft the bug`,onClick:()=>void oe({session:re,description:c}),children:[(0,J.jsx)(Ce,{"aria-hidden":`true`}),`Draft`]}),o&&j?.kind===`draft`&&(0,J.jsx)(z,{tone:`running`,orb:`thinking`,children:`Drafting`})]}),p.length>0&&(0,J.jsxs)(J.Fragment,{children:[(0,J.jsx)(U,{help:`Answer what you can, then update the draft. You can leave a question empty.`,children:`Questions`}),p.map((e,t)=>(0,J.jsx)(H,{label:e,htmlFor:`${s}-q${t}`,stacked:!0,className:t===0?`border-t-0 pt-0`:void 0,children:(0,J.jsx)(pn,{id:`${s}-q${t}`,rows:2,value:h[e]??``,maxLength:2e3,onChange:t=>g(n=>({...n,[e]:t.target.value}))})},e)),(0,J.jsx)(`div`,{className:`pt-2`,children:(0,J.jsxs)(V,{size:`sm`,disabled:o||!Object.values(h).some(e=>e.trim()),"data-tip":`Update the draft`,onClick:P,children:[(0,J.jsx)(f,{"aria-hidden":`true`}),`Update`]})})]}),u&&(0,J.jsxs)(J.Fragment,{children:[(0,J.jsx)(U,{help:`Check each field and change what is not right. This is what the ForgeQE team reads.`,children:`The bug`}),(0,J.jsx)(OD,{draft:u,areas:n.areas,severities:n.severities,onChange:d}),(0,J.jsx)(U,{help:`Secrets ForgeQE knows are replaced in every file. Open a log first if you are not sure what is in it: it can show addresses and test data of your project.`,children:`What is attached`}),(0,J.jsxs)(`ul`,{"aria-label":`Attachments`,className:`m-0 list-none p-0`,children:[M.map(e=>(0,J.jsx)(`li`,{className:`border-t border-line-soft`,children:(0,J.jsxs)(`label`,{className:`flex min-h-12 cursor-pointer items-center gap-4 py-2`,children:[(0,J.jsx)(vy,{checked:N.has(e.id),onCheckedChange:t=>ae(e.id,t)}),(0,J.jsxs)(`span`,{className:`flex min-w-0 flex-1 flex-col gap-1`,children:[(0,J.jsx)(`span`,{className:`font-mono text-[13px] [overflow-wrap:anywhere]`,children:e.name}),(0,J.jsxs)(`span`,{className:`text-sm text-muted [overflow-wrap:anywhere]`,children:[e.note,` · `,kD(e.bytes)]})]})]})},e.id)),y.map((e,t)=>(0,J.jsxs)(`li`,{className:`flex min-h-12 items-center gap-4 border-t border-line-soft py-2`,children:[(0,J.jsx)(`img`,{src:e.url,alt:`Screenshot ${t+1}`,className:`h-10 w-16 rounded-[8px] border border-line-soft bg-surface-muted object-cover`}),(0,J.jsx)(`span`,{className:`flex-1 font-mono text-[13px] [overflow-wrap:anywhere]`,children:e.name}),(0,J.jsx)(V,{variant:`icon`,size:`icon-sm`,"aria-label":`Remove ${e.name}`,"data-tip":`Remove ${e.name}`,onClick:()=>b(t=>t.filter(t=>t!==e)),children:(0,J.jsx)(Ie,{"aria-hidden":`true`})})]},e.url))]}),(0,J.jsxs)(`div`,{className:`pt-2`,children:[(0,J.jsx)(`input`,{ref:te,type:`file`,accept:`image/png,image/jpeg`,multiple:!0,hidden:!0,onChange:e=>void se(e.target.files).then(()=>e.target.value=``)}),(0,J.jsxs)(V,{size:`sm`,disabled:y.length>=TD,"data-tip":`Add a screenshot`,onClick:()=>te.current?.click(),children:[(0,J.jsx)(k,{"aria-hidden":`true`}),`Add`]})]}),(0,J.jsx)(U,{children:`Send`}),(0,J.jsx)(H,{label:`Your contact`,help:`Optional: an email or a Teams name, so the team can ask you about it.`,htmlFor:`${s}-contact`,className:`border-t-0 pt-0`,children:(0,J.jsx)(R,{id:`${s}-contact`,value:x,maxLength:200,onChange:e=>S(e.target.value)})}),n.intake.url?!ue&&(0,J.jsx)(H,{label:`Intake key`,help:`Sign in to your organization with the Azure CLI (az login), or save the key the ForgeQE team gave you. It is kept in your credential store when you save.`,htmlFor:`${s}-key`,children:(0,J.jsx)(br,{id:`${s}-key`,name:n.keyEnv,field:`Intake key`})}):(0,J.jsx)(H,{label:`Not set up yet`,help:`ForgeQE's defect intake is not set up on this computer. Copy the report and send it to the ForgeQE team.`}),(0,J.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2 pt-2`,children:[(0,J.jsxs)(V,{size:`sm`,variant:`primary`,disabled:o||!ue||!u.title.trim()||!u.summary.trim(),"data-tip":`Send to the ForgeQE team`,onClick:()=>T(!0),children:[(0,J.jsx)(C,{"aria-hidden":`true`}),`Send`]}),(0,J.jsxs)(V,{size:`sm`,disabled:!u.title.trim()||!u.summary.trim(),"data-tip":`Copy as text`,onClick:()=>void le(),children:[(0,J.jsx)(I,{"aria-hidden":`true`}),`Copy`]}),o&&j?.kind===`send`&&(0,J.jsx)(z,{tone:`running`,children:`Sending`})]}),(0,J.jsx)(`div`,{"aria-live":`polite`,children:E&&(0,J.jsx)(`p`,{className:`m-0 mt-2 text-sm text-ink-2`,children:E})}),w&&(0,J.jsxs)(`div`,{role:`alertdialog`,"aria-label":`Send this bug?`,className:`mt-4 flex flex-col gap-2 rounded-[12px] border border-warn bg-warn-soft p-4`,children:[(0,J.jsx)(`span`,{className:`text-sm font-medium`,children:`Send this bug to the ForgeQE team?`}),(0,J.jsxs)(`span`,{className:`text-[13px] text-ink-2`,children:[`It is filed in `,n.target,` with the fields above`,N.size+y.length?`, and ${N.size+y.length} attached file${N.size+y.length===1?``:`s`}: ${[...M.filter(e=>N.has(e.id)).map(e=>e.name),...y.map(e=>e.name)].join(`, `)}`:`, with nothing attached`,`.`]}),(0,J.jsxs)(`div`,{className:`flex flex-wrap gap-2`,children:[(0,J.jsxs)(V,{size:`sm`,variant:`primary`,onClick:()=>void ce(),children:[(0,J.jsx)(C,{"aria-hidden":`true`}),`Send`]}),(0,J.jsxs)(V,{size:`sm`,"data-tip":`Not now`,onClick:()=>T(!1),children:[(0,J.jsx)(A,{"aria-hidden":`true`}),`Later`]})]})]})]})]})}function jD({config:e}){let{saved:t,preview:n,reload:r}=Tr(),i=W(Kr(e.value,[`agent`,`names`])),a=wr(i),o=Kr(e.value,[`agent`,`app_name`]),s=typeof o==`string`?o:``,c=Kn(s),l=JSON.stringify([a,c]);return(0,q.useEffect)(()=>n({...t,agentNames:a,appName:c}),[l,t]),(0,q.useEffect)(()=>()=>{n(null),r()},[n,r]),(0,J.jsxs)(J.Fragment,{children:[(0,J.jsx)(U,{icon:nt,help:(0,J.jsx)(`span`,{"data-keep-name":!0,children:`What the web app calls ForgeQE itself: in every page, message and tab title, and in the reports and documents it writes. Commands, files and settings keep forgeqe. Empty keeps ForgeQE.`}),children:(0,J.jsx)(`span`,{"data-keep-name":!0,children:`ForgeQE's name`})}),(0,J.jsx)(H,{label:(0,J.jsx)(`span`,{"data-keep-name":!0,children:`App name`}),help:(0,J.jsx)(`span`,{"data-keep-name":!0,children:`Instead of ForgeQE, for everyone who opens this project.`}),htmlFor:`agent-app-name`,yamlKey:`agent.app_name`,children:(0,J.jsx)(R,{id:`agent-app-name`,"data-keep-name":!0,value:s,maxLength:40,placeholder:`ForgeQE`,onChange:t=>e.set(K(e.value,[`agent`,`app_name`],t.target.value.replace(/[\u0000-\u001f\u007f-\u009f\u2028\u2029]/g,``)||void 0)),className:`w-full`})}),(0,J.jsx)(U,{icon:F,help:`Call each agent what your team calls it: the name shows in chats, on the Agents page and in the terminal, for everyone who opens this project. What it does and may do stay the same. Empty keeps ForgeQE's name.`,children:`Agent names`}),li.map(t=>{let n=sr(t).name,r=`agent-name-${t}`,a=typeof i[t]==`string`?i[t]:``;return(0,J.jsx)(H,{label:(0,J.jsxs)(`span`,{className:`flex items-center gap-2`,children:[(0,J.jsx)(Vn,{agent:t,px:22,decorative:!0}),n]}),help:t,htmlFor:r,yamlKey:`agent.names.${t}`,children:(0,J.jsx)(R,{id:r,value:a,maxLength:40,placeholder:n,onChange:n=>e.set(K(e.value,[`agent`,`names`,t],n.target.value.replace(/[\u0000-\u001f\u007f-\u009f\u2028\u2029]/g,``)||void 0)),className:`w-full`})},t)})]})}var MD=524288,ND=[`image/png`,`image/jpeg`,`image/webp`,`image/svg+xml`];async function PD(e){let t=new Uint8Array(await e.arrayBuffer()),n=``;for(let e=0;e<t.length;e+=32768)n+=String.fromCharCode(...t.subarray(e,e+32768));return btoa(n)}function FD({children:e,className:t}){return(0,J.jsx)(`div`,{className:L(`flex w-full flex-wrap items-center gap-2 sm:justify-end`,t),children:e})}function ID({colour:e,label:t}){return(0,J.jsxs)(`span`,{className:`inline-flex items-center gap-2 text-sm text-ink-2`,children:[(0,J.jsx)(`span`,{"aria-hidden":`true`,className:`size-4 flex-none rounded-[4px] border border-line`,style:{background:e}}),t&&(0,J.jsx)(`span`,{className:`text-muted`,children:t}),(0,J.jsx)(`code`,{className:`font-mono text-[13px]`,children:e})]})}function LD({onUse:e}){let t=(0,q.useId)(),[n,r]=(0,q.useState)(``),[i,a]=(0,q.useState)(!1),[o,s]=(0,q.useState)(``),[c,l]=(0,q.useState)(null),[u,d]=(0,q.useState)(!1);return(0,J.jsx)(H,{label:`From a website`,help:`Suggests its sidebar, button and page colours. Nothing changes until you use them.`,htmlFor:t,children:(0,J.jsxs)(FD,{children:[(0,J.jsxs)(`form`,{className:`flex w-full items-center gap-2`,onSubmit:async e=>{e.preventDefault(),a(!0),s(``),l(null),d(!1);try{l(await dn.fromUrl(n.trim()))}catch(e){s(e.message)}finally{a(!1)}},children:[(0,J.jsx)(R,{id:t,type:`url`,value:n,placeholder:`https://www.example.com`,spellCheck:!1,onChange:e=>r(e.target.value),className:`min-w-0 flex-1`}),(0,J.jsxs)(V,{size:`sm`,type:`submit`,disabled:!n.trim()||i,"data-tip":`Read the site's colours`,children:[(0,J.jsx)(mt,{"aria-hidden":`true`}),i?`Importing…`:`Import`]})]}),o&&(0,J.jsx)(`p`,{role:`alert`,className:`m-0 w-full text-[13px] text-fail sm:text-right`,children:o}),c&&(0,J.jsxs)(`div`,{role:`status`,className:`flex w-full flex-col gap-2 sm:items-end`,children:[(0,J.jsxs)(`span`,{className:`text-[13px] text-muted`,children:[`From `,new URL(c.url).host]}),(0,J.jsxs)(`div`,{className:`flex flex-wrap items-center gap-x-4 gap-y-2 sm:justify-end`,children:[c.primary&&(0,J.jsx)(ID,{colour:c.primary,label:`Sidebar`}),c.gradient&&(0,J.jsx)(ID,{colour:c.gradient,label:`Gradient`}),c.secondary&&(0,J.jsx)(ID,{colour:c.secondary,label:`Buttons`}),c.background&&(0,J.jsx)(ID,{colour:c.background,label:`Page`})]}),(0,J.jsxs)(V,{size:`sm`,variant:`primary`,onClick:()=>{e(c),d(!0)},"data-tip":`Use these colours`,children:[(0,J.jsx)(dt,{"aria-hidden":`true`}),u?`Used`:`Use`]}),c.palette.length>0&&(0,J.jsxs)(`div`,{className:`flex flex-wrap items-center gap-x-4 gap-y-1 sm:justify-end`,children:[(0,J.jsx)(`span`,{className:`text-[13px] text-muted`,children:`Others:`}),c.palette.map(e=>(0,J.jsx)(ID,{colour:e},e))]})]})]})})}var RD={deep:`Deep sidebar, white text`,light:`Pale sidebar, dark text`};function zD({start:e,onUse:t}){let n=(0,q.useId)(),[r,i]=(0,q.useState)(e),[a,o]=(0,q.useState)(`deep`),[s,c]=(0,q.useState)(!1),l=Rr(r),u=xi(l),d=yi(l,a),f=r.trim()!==``&&!l?`Write a colour as #rrggbb, for example #0e7490.`:``,p=e=>(i(e),c(!1));return(0,J.jsx)(H,{label:`From one colour`,help:f?(0,J.jsx)(`span`,{className:`text-fail`,children:f}):`Makes a family of shades of one colour for the sidebar, buttons and page, so they belong together. Nothing changes until you use them.`,htmlFor:n,children:(0,J.jsxs)(FD,{children:[(0,J.jsxs)(`span`,{className:`flex w-full flex-nowrap items-center gap-2`,children:[(0,J.jsx)(`input`,{type:`color`,"aria-label":`From one colour: pick a colour`,value:l||zr,onChange:e=>p(e.target.value),className:`size-10 flex-none cursor-pointer rounded-[8px] border border-line bg-bg p-1`}),(0,J.jsx)(R,{id:n,value:r,spellCheck:!1,placeholder:`#0e7490`,"aria-invalid":!!f,onChange:e=>p(e.target.value),className:`min-w-0 flex-1 font-mono`})]}),(0,J.jsx)(ln,{"aria-label":`Where the sidebar sits in the family`,value:a,onChange:e=>(o(e.target.value),c(!1)),className:`w-full`,children:gi.map(e=>(0,J.jsx)(`option`,{value:e,children:RD[e]},e))}),u&&d&&(0,J.jsxs)(`div`,{className:`flex w-full flex-col gap-2 sm:items-end`,children:[(0,J.jsx)(`span`,{"aria-label":`Shades 50 to 950 of ${l}`,className:`flex w-full overflow-hidden rounded-[8px] border border-line`,children:pi.map(e=>(0,J.jsx)(`span`,{"data-tip":`${e} ${u[e]}`,className:`h-6 min-w-0 flex-1`,style:{background:u[e]}},e))}),(0,J.jsxs)(`div`,{className:`flex flex-wrap items-center gap-x-4 gap-y-2 sm:justify-end`,children:[(0,J.jsx)(ID,{colour:d.primary,label:`Sidebar`}),(0,J.jsx)(ID,{colour:d.gradient,label:`Gradient`}),(0,J.jsx)(ID,{colour:d.secondary,label:`Buttons`}),(0,J.jsx)(ID,{colour:d.background,label:`Page`})]}),(0,J.jsxs)(V,{size:`sm`,variant:`primary`,onClick:()=>{t(d),c(!0)},"data-tip":`Use these colours`,children:[(0,J.jsx)(dt,{"aria-hidden":`true`}),s?`Used`:`Use`]})]})]})})}function BD({label:e,help:t,yamlKey:n,value:r,fallback:i,check:a,onChange:o}){let s=(0,q.useId)(),[c,l]=(0,q.useState)(r);(0,q.useEffect)(()=>l(r),[r]);let u=Rr(c),d=c.trim()!==``&&!u?`Write a colour as #rrggbb, for example #0b1f3a.`:u&&a?a(u):``;return(0,J.jsx)(H,{label:e,help:d?(0,J.jsx)(`span`,{className:`text-fail`,children:d}):t,htmlFor:s,yamlKey:n,children:(0,J.jsxs)(FD,{className:`flex-nowrap`,children:[(0,J.jsx)(`input`,{type:`color`,"aria-label":`${e}: pick a colour`,value:Rr(r)||i||`#ffffff`,onChange:e=>o(a?.(e.target.value)?``:e.target.value),className:`size-10 flex-none cursor-pointer rounded-[8px] border border-line bg-bg p-1`}),(0,J.jsx)(R,{id:s,value:c,spellCheck:!1,placeholder:i?`${i} (default)`:`None`,"aria-invalid":!!d,onChange:e=>{l(e.target.value);let t=Rr(e.target.value);(t&&!a?.(t)||!e.target.value.trim())&&o(t||``)},className:`min-w-0 flex-1 font-mono`})]})})}function VD({which:e,label:t,yamlKey:n,value:r,url:i,savedError:a,onChange:o}){let[s,c]=(0,q.useState)(``),[l,u]=(0,q.useState)(!1),d=(0,q.useRef)(null),f=e===`mark`?`small logo`:`logo`;return(0,J.jsx)(H,{label:t,help:s||r&&!i&&a?(0,J.jsx)(`span`,{className:`text-fail`,children:s||a}):e===`mark`?`For the narrow sidebar. Square or round works best.`:`In the sidebar, reports and documents. PNG, JPEG or WebP (a large one is made smaller), or SVG up to 512 KB; an empty margin round it is cut off.`,yamlKey:n,children:(0,J.jsxs)(FD,{children:[i&&(0,J.jsx)(`span`,{className:L(`theme-side flex h-12 items-center justify-center rounded-[8px] border border-line`,e===`mark`?`w-12`:`min-w-16 px-4`),children:(0,J.jsx)(`img`,{src:i,alt:`The ${f}`,className:L(`block object-contain`,e===`mark`?`max-h-9 max-w-9`:`max-h-8 max-w-[140px]`)})}),(0,J.jsx)(`input`,{ref:d,type:`file`,accept:`.png,.jpg,.jpeg,.webp,.svg`,className:`sr-only`,tabIndex:-1,"aria-hidden":`true`,onChange:async t=>{let n=t.target.files?.[0];if(t.target.value=``,n){if(c(``),!ND.includes(n.type))return c(`A ${f} is a PNG, JPEG, WebP or SVG image.`);if(n.type===`image/svg+xml`&&n.size>MD)return c(`${n.name} is over 512 KB.`);if(n.size>20971520)return c(`${n.name} is over ${Lr/1024/1024} MB: save a smaller copy and upload that.`);u(!0);try{let t=await Vr(n,MD),r=await dn.uploadLogo(await PD(t),t.type,e);o(r.file,(e===`mark`?r.view.logoMark:r.view.logo)||``)}catch(e){c(e.message)}finally{u(!1)}}}}),(0,J.jsxs)(V,{size:`sm`,disabled:l,"data-tip":i?`Change the ${f}`:`Upload a ${f}`,onClick:()=>d.current?.click(),children:[i?(0,J.jsx)(re,{"aria-hidden":`true`}):(0,J.jsx)(mt,{"aria-hidden":`true`}),l?`Uploading…`:i?`Change`:`Upload`]}),r&&(0,J.jsx)(V,{variant:`icon`,size:`icon-sm`,"aria-label":`Remove the ${f}`,"data-tip":`Remove the ${f}`,onClick:()=>o(``),children:(0,J.jsx)(Ie,{"aria-hidden":`true`})})]})})}var HD={auto:`Auto (recommended)`,plain:`Plain`,tiles:`On tiles`,outline:`Outlined`,mono:`One colour`};function UD(e){for(let{item:t}of En)if(t.icon===e||Nr[t.id]===e)return t.label;for(let t of Pn)if(Ln(t.agent).icon===e)return Ln(t.agent).name;return e}function WD({draft:e,value:t,onChange:n}){let{mode:r}=Tr(),i=ei(e,void 0,r),a=Gr(e)!==`3d`,o=!a&&t!==`mono`&&t!==`outline`&&i.lowest<2,s=o?`${i.faint.length||`Some`} ${i.faint.length===1?`icon is`:`icons are`} hard to see on this colour${i.faint.length?` (${i.faint.slice(0,2).map(e=>UD(e.icon)).join(`, `)}${i.faint.length>2?`, …`:``})`:``}. Try Auto or On tiles.`:!a&&t===`auto`&&i.style!==`plain`?`Auto put them on tiles: this colour hides some of them.`:``;return(0,J.jsx)(H,{label:`Sidebar icons`,help:a?`For the 3D icons. Flat icons take the Icon colour above.`:`Auto puts them on tiles when the sidebar's colour hides any.`,htmlFor:`theme-icons`,yamlKey:`theme.icon_style`,children:(0,J.jsxs)(FD,{children:[(0,J.jsx)(ln,{id:`theme-icons`,value:t,disabled:a,onChange:e=>n(e.target.value),className:`w-full`,children:ui.map(e=>(0,J.jsx)(`option`,{value:e,children:HD[e]},e))}),!a&&(0,J.jsx)(GD,{}),s&&(0,J.jsx)(`span`,{className:L(`w-full text-[13px] sm:text-right`,o?`text-warn`:`text-muted`),children:s})]})})}function GD(){let e=[`record`,`data`,`jobs`,`guardrails`].map(e=>Nr[e]).concat([`orchestrator`,`healer`,`browser-agent`]);return(0,J.jsx)(`span`,{"aria-label":`How the sidebar's icons look`,className:`theme-side flex w-full items-center justify-between rounded-[10px] border border-line-soft px-4 py-2`,children:e.map(e=>(0,J.jsx)(vn,{name:e,px:18},e))})}var KD={phosphor:`Phosphor Duotone (default)`,solar:`Solar Bold Duotone`,lucide:`Lucide (buttons and menus too)`,"3d":`3D (ForgeQE's pixel icons)`};function qD({value:e,onChange:t}){return(0,J.jsx)(H,{label:`Icons`,help:`Flat icons are black, or the Icon colour below, so they show on any sidebar.`,htmlFor:`theme-icon-set`,yamlKey:`theme.icon_set`,children:(0,J.jsxs)(FD,{children:[(0,J.jsx)(ln,{id:`theme-icon-set`,value:e,onChange:e=>t(e.target.value),className:`w-full`,children:ni.map(e=>(0,J.jsx)(`option`,{value:e,children:KD[e]},e))}),(0,J.jsx)(GD,{})]})})}function JD(){return(0,J.jsx)(`span`,{className:`flex flex-wrap items-center gap-2`,"aria-hidden":`true`,children:[`forgeqe`,`engine`,`forgeqe-test`,`forgeqe-heal`,`forgeqe-pr-review`,`forgeqe-data`].map(e=>(0,J.jsx)(Vn,{agent:e,px:40,decorative:!0},e))})}var YD={visor:`Robots (default)`,classic:`Characters`,icons:`Icons`},XD={soft:`Soft pastel (default)`,original:`Each agent's own`};function ZD({value:e,colours:t,onChange:n,onColours:r}){return(0,J.jsxs)(J.Fragment,{children:[(0,J.jsx)(H,{label:`Agents`,help:`Robots and characters follow your cursor, show what they are doing and react to how it went. Sidebars and lists keep the icons.`,htmlFor:`theme-mascot`,yamlKey:`theme.mascot`,children:(0,J.jsxs)(FD,{children:[(0,J.jsx)(ln,{id:`theme-mascot`,value:e,onChange:e=>n(e.target.value),className:`w-full`,children:Jr.map(e=>(0,J.jsx)(`option`,{value:e,children:YD[e]},e))}),(0,J.jsx)(JD,{})]})}),(0,J.jsx)(H,{label:`Agent colours`,help:e===`icons`?`For robots and characters.`:`Pastels from one family, or each agent's colour as the rest of the app shows it.`,htmlFor:`theme-mascot-colours`,yamlKey:`theme.mascot_colours`,children:(0,J.jsx)(FD,{children:(0,J.jsx)(ln,{id:`theme-mascot-colours`,value:t,disabled:e===`icons`,onChange:e=>r(e.target.value),className:`w-full`,children:jr.map(e=>(0,J.jsx)(`option`,{value:e,children:XD[e]},e))})})})]})}var QD={text:`Black, white in dark mode (default)`,accent:`The buttons' colour`,custom:`A colour of their own`};function $D({draft:e,value:t,onChange:n}){let{mode:r}=Tr(),i=Hr({iconColour:t}),a=Gr(e)!==`3d`,[o,s]=(0,q.useState)(i===`custom`?t:``);(0,q.useEffect)(()=>s(i===`custom`?t:``),[t,i]);let c=i===`custom`&&o.trim()!==``&&!Rr(o)?`Write a colour as #rrggbb, for example #7c3aed.`:``,l=a?oi(e,r).moved:[],u=l.length?`Made ${r===`dark`?`lighter`:`darker`} on the ${l.join(` and the `)} so the icons show.`:``;return(0,J.jsx)(H,{label:`Icon colour`,help:c?(0,J.jsx)(`span`,{className:`text-fail`,children:c}):a?`For the flat icons of the pages and agents: their lines take the colour, and their second tone its palest shade.`:`For the flat icons. The 3D icons keep their own colours.`,htmlFor:`theme-icon-colour`,yamlKey:`theme.icon_colour`,children:(0,J.jsxs)(FD,{children:[(0,J.jsx)(ln,{id:`theme-icon-colour`,value:i,disabled:!a,onChange:t=>{let r=t.target.value;n(r===`accent`?`accent`:r===`custom`?Rr(e.secondary)||zr:``)},className:`w-full`,children:Object.keys(QD).map(e=>(0,J.jsx)(`option`,{value:e,children:QD[e]},e))}),a&&i===`custom`&&(0,J.jsxs)(`span`,{className:`flex w-full flex-nowrap items-center gap-2`,children:[(0,J.jsx)(`input`,{type:`color`,"aria-label":`Icon colour: pick a colour`,value:Rr(t)||zr,onChange:e=>n(e.target.value),className:`size-10 flex-none cursor-pointer rounded-[8px] border border-line bg-bg p-1`}),(0,J.jsx)(R,{id:`theme-icon-colour-hex`,"aria-label":`Icon colour`,value:o,spellCheck:!1,placeholder:`#7c3aed`,"aria-invalid":!!c,onChange:e=>{s(e.target.value);let t=Rr(e.target.value);(t||!e.target.value.trim())&&n(t||``)},className:`min-w-0 flex-1 font-mono`})]}),u&&(0,J.jsx)(`span`,{className:`w-full text-[13px] text-warn sm:text-right`,children:u})]})})}function eO(){let{choice:e,setChoice:t}=Tr();return(0,J.jsx)(H,{label:`Colour mode`,help:`Only for you, in this browser.`,children:(0,J.jsx)(FD,{children:(0,J.jsx)(mi,{label:`Colour mode`,value:e,onChange:t,options:[{id:`system`,label:`System`},{id:`light`,label:`Light`},{id:`dark`,label:`Dark`}].map(e=>({id:e.id,label:e.label}))})})})}var tO=[`primary`,`gradient`,`secondary`,`background`,`icon_style`,`icon_set`,`icon_colour`,`mascot`,`mascot_colours`];function nO({theme:e,value:t,onReset:n}){let{choice:r,setChoice:i}=Tr(),a=tO.some(t=>e[t]!==void 0)||r!==`system`;return(0,J.jsxs)(V,{size:`sm`,disabled:!a,"data-tip":`Reset colours: ForgeQE's own colours and icons, and System mode. The logo and name stay.`,onClick:()=>{let e=t;for(let t of tO)e=K(e,[`theme`,t],void 0);n(e),i(`system`)},children:[(0,J.jsx)(se,{"aria-hidden":`true`}),`Reset`]})}var rO=e=>Wr(e)<.75?`Choose a light colour: dark mode gives the dark page.`:``;function iO({config:e}){let{saved:t,preview:n,reload:r}=Tr(),i=W(e.value.theme),a=e=>typeof i[e]==`string`?i[e]:``,o=(t,n)=>e.set(K(e.value,[`theme`,t],n||void 0)),[s,c]=(0,q.useState)(null),[l,u]=(0,q.useState)(null),[d,f]=(0,q.useState)(``),[p,m]=(0,q.useState)(!1),h=(0,q.useRef)(null),g=s&&s.file===a(`logo`)?s.url:t.logoFile===a(`logo`)?t.logo:void 0,_=l&&l.file===a(`logo_mark`)?l.url:t.logoMarkFile===a(`logo_mark`)?t.logoMark:void 0,v=[`plain`,`rounded`,`circle`,`tile`].find(e=>e===a(`logo_frame`)),y=a(`logo_size`)===`large`||a(`logo_size`)===`standard`?a(`logo_size`):void 0,b=ui.find(e=>e===a(`icon_style`)),x=ni.find(e=>e===a(`icon_set`)),S=Jr.find(e=>e===a(`mascot`)),C=jr.find(e=>e===a(`mascot_colours`)),w=wr(Kr(e.value,[`agent`,`names`])),T={...Object.keys(w).length?{agentNames:w}:{},logoSize:y,name:a(`name`)||void 0,primary:Rr(a(`primary`)),gradient:Rr(a(`gradient`)),secondary:Rr(a(`secondary`)),background:Rr(a(`background`)),logo:a(`logo`)?g:void 0,logoMark:a(`logo_mark`)?_:void 0,logoFrame:v,iconStyle:b,iconSet:x,mascot:S,mascotColours:C,iconColour:a(`icon_colour`)===`accent`?`accent`:Rr(a(`icon_colour`))},E=JSON.stringify(T);(0,q.useEffect)(()=>n(T),[E]),(0,q.useEffect)(()=>()=>{n(null),r()},[n,r]);let D=Di(T).filter(e=>!e.ok);return(0,J.jsxs)(J.Fragment,{children:[(0,J.jsx)(U,{icon:he,first:!0,children:`Logo and name`}),(0,J.jsx)(VD,{which:`logo`,label:`Logo`,yamlKey:`theme.logo`,value:a(`logo`),url:g,savedError:t.logoError,onChange:(e,t)=>(c(t?{file:e,url:t}:null),o(`logo`,e))}),(0,J.jsx)(VD,{which:`mark`,label:`Small logo`,yamlKey:`theme.logo_mark`,value:a(`logo_mark`),url:_,savedError:t.logoMarkError,onChange:(e,t)=>(u(t?{file:e,url:t}:null),o(`logo_mark`,e))}),(0,J.jsx)(H,{label:`Logo frame`,help:`A circle suits a square logo; a white tile, a dark logo on a dark sidebar.`,htmlFor:`theme-frame`,yamlKey:`theme.logo_frame`,children:(0,J.jsx)(FD,{children:(0,J.jsxs)(ln,{id:`theme-frame`,value:v||`plain`,onChange:e=>o(`logo_frame`,e.target.value===`plain`?``:e.target.value),className:`w-full`,children:[(0,J.jsx)(`option`,{value:`plain`,children:`As it is`}),(0,J.jsx)(`option`,{value:`rounded`,children:`Rounded corners`}),(0,J.jsx)(`option`,{value:`circle`,children:`Circle`}),(0,J.jsx)(`option`,{value:`tile`,children:`On a white tile`})]})})}),(0,J.jsx)(H,{label:`Logo size`,help:`Fit automatically sizes the logo from its shape, so its words can be read. Large spreads a wide logo across the top of the sidebar.`,htmlFor:`theme-size`,yamlKey:`theme.logo_size`,children:(0,J.jsx)(FD,{children:(0,J.jsxs)(ln,{id:`theme-size`,value:y||`auto`,onChange:e=>o(`logo_size`,e.target.value===`large`||e.target.value===`standard`?e.target.value:``),className:`w-full`,children:[(0,J.jsx)(`option`,{value:`auto`,children:`Fit automatically`}),(0,J.jsx)(`option`,{value:`standard`,children:`Standard`}),(0,J.jsx)(`option`,{value:`large`,children:`Large`})]})})}),(0,J.jsx)(H,{label:`Name`,help:`Beside a square logo, or instead of one. Screen readers say it.`,htmlFor:`theme-name`,yamlKey:`theme.name`,children:(0,J.jsx)(FD,{children:(0,J.jsx)(R,{id:`theme-name`,value:a(`name`),maxLength:40,placeholder:`ForgeQE`,onChange:e=>o(`name`,e.target.value),className:`w-full`})})}),(0,J.jsx)(H,{label:`Preview`,help:p?(0,J.jsx)(`span`,{className:`text-warn`,children:`The logo is close to the sidebar's colour, so it sits on a plate. A different sidebar colour sets it off without one.`}):`The sidebar's top, wide and narrow.`,children:(0,J.jsxs)(FD,{className:`flex-nowrap`,children:[(0,J.jsx)(`span`,{"aria-label":`How the sidebar's top looks`,className:`theme-side flex min-h-14 min-w-0 flex-1 items-center rounded-[10px] border border-line-soft px-4 text-base font-semibold`,children:(0,J.jsx)(Qr,{theme:T,onPlate:m})}),(0,J.jsx)(`span`,{"aria-label":`How the narrow sidebar's top looks`,className:`theme-side flex size-14 flex-none items-center justify-center rounded-[10px] border border-line-soft`,children:(0,J.jsx)(vi,{theme:T})})]})}),(0,J.jsx)(U,{icon:le,help:`Leave a colour empty to keep ForgeQE's own.`,children:`Colours`}),(0,J.jsx)(eO,{}),(0,J.jsx)(BD,{label:`Sidebar`,help:`Light mode. Its text turns white on a dark colour.`,yamlKey:`theme.primary`,value:a(`primary`),fallback:Cn,onChange:e=>o(`primary`,e)}),(0,J.jsx)(BD,{label:`Sidebar gradient`,help:`The sidebar fades into it, top to bottom.`,yamlKey:`theme.gradient`,value:a(`gradient`),onChange:e=>o(`gradient`,e)}),(0,J.jsx)(BD,{label:`Buttons and links`,help:`Also selected tabs and filters and the sidebar entry you are on, with shades made from it. Left empty, it is the icon colour when that is a colour of its own, so the app has one brand colour.`,yamlKey:`theme.secondary`,value:a(`secondary`),fallback:Fr({...T,secondary:void 0})||zr,onChange:e=>o(`secondary`,e)}),(0,J.jsx)(BD,{label:`Page background`,help:`Light mode, a light colour. Dark mode keeps its dark page.`,yamlKey:`theme.background`,value:a(`background`),fallback:`#ffffff`,check:rO,onChange:e=>o(`background`,e)}),(0,J.jsx)(qD,{value:x||`phosphor`,onChange:e=>o(`icon_set`,e===`phosphor`?``:e)}),(0,J.jsx)($D,{draft:T,value:a(`icon_colour`),onChange:e=>o(`icon_colour`,e)}),(0,J.jsx)(WD,{draft:T,value:b||`auto`,onChange:e=>o(`icon_style`,e===`auto`?``:e)}),(0,J.jsx)(ZD,{value:S||`visor`,colours:C||`soft`,onChange:e=>o(`mascot`,e===`visor`?``:e),onColours:e=>o(`mascot_colours`,e===`soft`?``:e)}),(0,J.jsx)(H,{label:`Preview`,help:D.length?(0,J.jsx)(`span`,{className:`flex flex-col gap-1 text-warn`,children:D.map(e=>(0,J.jsxs)(`span`,{className:`flex items-start gap-2`,children:[(0,J.jsx)(ze,{size:14,"aria-hidden":`true`,className:`mt-1 flex-none`}),e.label,` is hard to read (`,e.ratio,`:1, 4.5:1 needed).`]},e.label))}):`Every text reads on these colours.`,children:(0,J.jsxs)(FD,{children:[(0,J.jsxs)(`span`,{className:`flex w-full items-center justify-end gap-4 rounded-[10px] border border-line-soft bg-bg p-4`,children:[(0,J.jsx)(`a`,{href:`#appearance-preview`,onClick:e=>e.preventDefault(),className:`text-sm`,children:`A link`}),(0,J.jsx)(V,{variant:`primary`,size:`sm`,tabIndex:-1,"aria-hidden":`true`,className:`pointer-events-none`,children:`A button`})]}),(0,J.jsx)(nO,{theme:i,onReset:t=>e.set(t),value:e.value})]})}),(0,J.jsx)(U,{icon:j,children:`Import colours`}),(0,J.jsx)(zD,{start:Rr(a(`secondary`))||Rr(a(`primary`))||``,onUse:t=>{let n=e.value;for(let e of[`primary`,`gradient`,`secondary`,`background`])n=K(n,[`theme`,e],t[e]);e.set(n)}}),(0,J.jsx)(LD,{onUse:t=>{let n=e.value;for(let e of[`primary`,`gradient`,`secondary`,`background`])n=K(n,[`theme`,e],t[e]||void 0);e.set(n)}}),(0,J.jsx)(H,{label:`From a DESIGN.md`,help:d?(0,J.jsx)(`span`,{role:`status`,className:`text-ink-2`,children:d}):`Reads the lines that name primary, secondary, gradient and background.`,children:(0,J.jsxs)(FD,{children:[(0,J.jsx)(`input`,{ref:h,type:`file`,accept:`.md,.markdown,.txt,.css`,className:`sr-only`,tabIndex:-1,"aria-hidden":`true`,onChange:async t=>{let n=t.target.files?.[0];if(t.target.value=``,!n)return;if(n.size>262144)return f(`${n.name} is over 256 KB.`);let r=$r(await n.text()),i=Object.entries(r).map(([e,t])=>`${e} ${t}`);if(!i.length)return f(`No primary, secondary, gradient or background colour in ${n.name}.`);let a=e.value;for(let[e,t]of Object.entries(r))a=K(a,[`theme`,e],t);e.set(a),f(`From ${n.name}: ${i.join(`, `)}.`)}}),(0,J.jsxs)(V,{size:`sm`,"data-tip":`Choose a DESIGN.md`,onClick:()=>h.current?.click(),children:[(0,J.jsx)(ut,{"aria-hidden":`true`}),`Choose`]})]})}),(0,J.jsx)(H,{label:`Reset all`,help:`The logo, name and colours back to ForgeQE's own.`,children:(0,J.jsx)(FD,{children:(0,J.jsxs)(V,{size:`sm`,disabled:!Object.keys(i).length,"data-tip":`The logo, name and colours back to ForgeQE's own`,onClick:()=>e.set(K(e.value,[`theme`],void 0)),children:[(0,J.jsx)(se,{"aria-hidden":`true`}),`Reset all`]})})})]})}function aO({ok:e,children:t}){return(0,J.jsxs)(`p`,{role:e?`status`:`alert`,className:L(`m-0 flex items-start gap-2 rounded-[12px] px-4 py-2 text-sm leading-relaxed`,e?`bg-pass-soft text-pass`:`bg-fail-soft text-fail`),children:[e?(0,J.jsx)(O,{size:18,"aria-hidden":`true`,className:`mt-1 flex-none`}):(0,J.jsx)(ze,{size:18,"aria-hidden":`true`,className:`mt-1 flex-none`}),(0,J.jsx)(`span`,{className:`[overflow-wrap:anywhere]`,children:t})]})}function oO({label:e,value:t,options:n,onPick:r}){return(0,J.jsx)(`div`,{className:`flex w-full flex-wrap items-center gap-2 sm:justify-end`,children:(0,J.jsx)(mi,{label:e,value:t,onChange:r,options:n.map(e=>({id:e.id,label:e.label}))})})}var sO=[{id:`eager`,label:`Briefly`},{id:`normal`,label:`A moment`},{id:`patient`,label:`Longer`}],cO=e=>e>=1e9?`${(e/1e9).toFixed(1)} GB`:`${Math.max(1,Math.round(e/1e6))} MB`;function lO(){let[e,t]=(0,q.useState)(null),[n,r]=(0,q.useState)(``),[i,a]=(0,q.useState)(wi()),[o,s]=(0,q.useState)(!1),[c,l]=(0,q.useState)(!1);(0,q.useEffect)(()=>{let n=!0,i=()=>mr(!0).then(e=>n&&t(e)).catch(e=>n&&r(e.message));i();let a=setInterval(()=>e?.setup.running&&void i(),1500);return()=>{n=!1,clearInterval(a)}},[e?.setup.running]);let u=async()=>{r(``),s(!0),l(!0);try{t(await Vt.setup())}catch(e){r(e.message)}finally{l(!1)}},d=e,f=!!d?.setup.running;return(0,J.jsxs)(J.Fragment,{children:[(0,J.jsx)(U,{first:!0,help:`Listening and speaking run on this computer. Only the words go to your model, as typed words do.`,children:`Speech on this computer`}),(0,J.jsx)(H,{label:d?d.ready?`Set up`:f?`Setting up`:`Not set up yet`:`Speech`,help:d?.ready?`Talk, in the sidebar under Search, opens a conversation with Atlas. Talk over it any time: it stops and listens.`:`A one-time download of open speech models${d?`, about ${cO(d.setup.bytes)}`:``}, into ForgeQE's folder.`,children:d?d.ready?(0,J.jsx)(z,{tone:`pass`,children:`Ready`}):f?(0,J.jsx)(z,{tone:`running`,children:`Setting up`}):(0,J.jsxs)(V,{size:`sm`,variant:`primary`,disabled:c,onClick:()=>void u(),"data-tip":`Download the speech models once: nothing is sent anywhere`,children:[c?(0,J.jsx)($t,{state:`handing`,px:16}):(0,J.jsx)(Ye,{"aria-hidden":`true`}),c?`Starting…`:`Install (${cO(d.setup.bytes)})`]}):(0,J.jsx)(`span`,{className:`text-sm text-muted`,children:`Reading…`})}),(f||o&&d&&d.setup.lines.length>0)&&(0,J.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[!f&&d&&(0,J.jsx)(aO,{ok:d.ready,children:d.ready?`Speech is set up.`:d.setup.error||`The setup stopped with a problem. The last lines below say what.`}),(0,J.jsx)(`pre`,{"aria-label":`Speech setup output`,"aria-live":`polite`,className:`m-0 max-h-[280px] overflow-auto rounded-[12px] bg-surface-muted px-4 py-4 font-mono text-[13px] leading-relaxed whitespace-pre-wrap text-ink-2 [overflow-wrap:anywhere]`,children:d?.setup.lines.length?d.setup.lines.join(`
76
- `):`Starting…`})]}),n&&(0,J.jsx)(aO,{ok:!1,children:n}),d?.ready&&(0,J.jsxs)(J.Fragment,{children:[(0,J.jsx)(H,{label:`Voice`,help:`An open voice that runs on this computer.`,children:(0,J.jsx)(`span`,{className:`text-sm text-ink-2`,children:`Kokoro`})}),(0,J.jsx)(H,{label:`Listening`,help:`Writes down what you say, on this computer.`,children:(0,J.jsx)(`span`,{className:`text-sm text-ink-2`,children:d.hearing?.model??`None`})})]}),(0,J.jsx)(U,{help:`How Talk takes turns with you. Yours alone: kept in this browser.`,children:`Conversation`}),(0,J.jsx)(H,{label:`It waits for you`,help:i===`eager`?`Answers soon after you pause: quick, but it may cut in.`:i===`patient`?`Waits longer when you pause mid-thought.`:`Waits a moment when you sound unfinished.`,children:(0,J.jsx)(oO,{label:`How long it waits for you`,value:i,options:sO,onPick:e=>(a(e),Mn(e))})})]})}var uO=[{id:`github`,name:`GitHub`,note:`github.com, or GitHub Enterprise at your own address.`,logo:Zi.github,tokenEnv:`GITHUB_TOKEN`,cloud:!0,cli:{system:`github`,label:`GitHub`}},{id:`azure-devops`,name:`Azure DevOps`,note:`An organization on dev.azure.com, or Azure DevOps Server.`,logo:Zi.azure_devops,tokenEnv:`ADO_PAT`,cloud:!0,org:`Organization`,cli:{system:`azure_devops`,label:`Azure DevOps`}},{id:`gitlab`,name:`GitLab`,note:`gitlab.com, or GitLab at your own address.`,logo:Zi.gitlab,tokenEnv:`GITLAB_TOKEN`,cloud:!0},{id:`bitbucket-cloud`,name:`Bitbucket Cloud`,note:`bitbucket.org: a workspace's repositories, or every one you can read.`,logo:Zi.bitbucket,tokenEnv:`BITBUCKET_TOKEN`,cloud:!0,org:`Workspace`},{id:`bitbucket-server`,name:`Bitbucket Data Center`,note:`Bitbucket Server or Data Center at your own address.`,logo:Zi.bitbucket,tokenEnv:`BITBUCKET_TOKEN`,cloud:!1}],dO=e=>uO.find(t=>t.id===e),fO=/^[A-Za-z0-9][A-Za-z0-9_-]{0,62}$/;function pO(e,t){let n=!t.url||mO(e?.id,String(t.url)).cloud;return e?.id===`github`?n?`cli`:`gh-host`:e?.id===`azure-devops`&&n?`cli`:`git`}function mO(e,t){let n;try{n=new URL(t.trim())}catch{return{cloud:!1}}let r=n.hostname.toLowerCase(),i=Xt(n.pathname).split(`/`).filter(Boolean)[0],a=i&&/^[A-Za-z0-9][A-Za-z0-9 ._-]{0,99}$/.test(i)?i:void 0;if(e===`azure-devops`){if(r===`dev.azure.com`)return{cloud:!0,org:a};let e=/^([a-z0-9][a-z0-9-]{0,62})\.visualstudio\.com$/.exec(r);return e?{cloud:!0,org:e[1]}:{cloud:!1}}return e===`bitbucket-cloud`?r===`bitbucket.org`?{cloud:!0,org:a}:{cloud:!1}:e===`github`?{cloud:r===`github.com`}:e===`gitlab`?{cloud:r===`gitlab.com`}:{cloud:!1}}function hO({logo:e,icon:t,title:n,meta:r,state:i,actions:a}){return(0,J.jsxs)(`div`,{className:`flex min-h-[68px] flex-wrap items-center gap-x-4 gap-y-2 border-t border-line-soft py-4`,children:[(0,J.jsx)(Pr,{icon:t,logo:e}),(0,J.jsxs)(`span`,{className:`flex min-w-0 flex-[1_1_220px] flex-col gap-1`,children:[(0,J.jsx)(`span`,{className:`font-medium [overflow-wrap:anywhere]`,children:n}),(0,J.jsx)(`span`,{className:`text-sm text-muted [overflow-wrap:anywhere]`,children:r}),i]}),(0,J.jsx)(`span`,{className:`flex gap-2`,children:a})]})}function gO({ok:e,message:t}){return(0,J.jsxs)(`p`,{role:e?`status`:`alert`,className:L(`mt-2 mb-1 flex items-start gap-2 rounded-[12px] px-4 py-2 text-sm`,e?`bg-pass-soft text-pass`:`bg-fail-soft text-fail`),children:[e?(0,J.jsx)(O,{size:18,"aria-hidden":`true`,className:`mt-1 flex-none`}):(0,J.jsx)(P,{size:18,"aria-hidden":`true`,className:`mt-1 flex-none`}),(0,J.jsx)(`span`,{className:`[overflow-wrap:anywhere]`,children:t})]})}function _O({title:e,help:t}){return(0,J.jsxs)(`div`,{className:`mt-8 mb-2 flex flex-col gap-1`,children:[(0,J.jsx)(`h4`,{className:`m-0 text-[13px] font-semibold text-ink`,children:e}),t&&(0,J.jsx)(`p`,{className:`m-0 text-[13px] leading-relaxed text-ink-2`,children:t})]})}var vO=({children:e})=>(0,J.jsx)(`p`,{role:`status`,className:`m-0 border-t border-line-soft py-6 text-sm text-muted`,children:e}),yO=e=>Object.fromEntries(Object.entries(e).filter(e=>typeof e[1]==`string`));function bO(e,t,n){let r=W(Kr(e,[`product`,`repos`])),i=e;for(let[e,a]of Object.entries(r))W(a).account===t&&(i=K(i,[`product`,`repos`,e,`account`],n));return i}function xO({edit:e}){let t=e.value,n=W(Kr(t,[`product`,`accounts`])),r=W(Kr(t,[`product`,`repos`])),[i,a]=(0,q.useState)(null),[o,s]=(0,q.useState)(null),[c,l]=(0,q.useState)({}),u=(0,q.useCallback)(()=>{Bt.get().then(e=>l(e.saved),()=>{})},[]);(0,q.useEffect)(u,[u]);let f=Cr(),p=e=>Object.values(r).filter(t=>W(t).account===e).length,m=(e,t)=>{let n=dO(t.host),r=p(e),i=`${r} ${r===1?`repository`:`repositories`} connected`;if(t.auth===`token`)return ci(f,String(t.token_env||``))?(0,J.jsx)(`span`,{className:`text-[13px] text-pass`,children:`Connected with a token, ${i}`}):(0,J.jsx)(`span`,{className:`text-[13px] text-warn`,children:`Needs its token: Edit to add it`});let a=pO(n,t),o=c[n.cli.system];return a===`cli`?o&&(o.via!==`token`||o.browser)&&oE(o,n.name)?(0,J.jsx)(`span`,{className:`text-[13px] text-pass`,children:`Signed in, ${i}`}):(0,J.jsx)(`span`,{className:`text-[13px] text-warn`,children:`Needs a sign-in: Edit to sign in`}):(0,J.jsx)(`span`,{className:`text-[13px] text-muted`,children:`${a===`gh-host`?`The GitHub CLI's`:`Git Credential Manager's`} sign-in, ${i}`})};return(0,J.jsxs)(J.Fragment,{children:[(0,J.jsx)(U,{first:!0,help:`Sign in to where your code is, then pick the repositories ForgeQE reads into the product graph.`,children:`1. Repositories`}),(0,J.jsxs)(`div`,{className:`mb-4 flex flex-wrap items-center justify-between gap-4`,children:[(0,J.jsx)(`p`,{className:`m-0 text-sm text-muted`,children:Object.keys(n).length?`Your accounts. Pick more repositories from one with Repositories.`:`No account yet: add GitHub, Azure DevOps, GitLab or Bitbucket.`}),(0,J.jsxs)(V,{size:`sm`,"data-tip":`Add an account`,onClick:()=>a({step:`catalog`}),children:[(0,J.jsx)(k,{"aria-hidden":`true`}),`Add`]})]}),Object.entries(n).map(([n,r])=>{let i=W(r),o=dO(i.host);return(0,J.jsx)(hO,{logo:o?.logo,icon:de,title:n,meta:[o?.name||`Unknown host`,i.org,i.url].filter(Boolean).map(String).join(`, `),state:m(n,i),actions:(0,J.jsxs)(J.Fragment,{children:[(0,J.jsx)(V,{variant:`icon`,size:`icon-sm`,"aria-label":`Repositories of ${n}`,"data-tip":`Repositories of ${n}`,disabled:!o,onClick:()=>s(n),children:(0,J.jsx)(d,{"aria-hidden":`true`})}),o&&(0,J.jsx)(V,{variant:`icon`,size:`icon-sm`,"aria-label":`Edit ${n}`,"data-tip":`Edit ${n}`,onClick:()=>a({step:`form`,host:o,mode:`edit`,name:n,from:n,value:i}),children:(0,J.jsx)(re,{"aria-hidden":`true`})}),(0,J.jsx)(V,{variant:`icon`,size:`icon-sm`,"aria-label":`Disconnect ${n}`,"data-tip":`Disconnect ${n}`,onClick:()=>e.set(bO(K(t,[`product`,`accounts`,n],void 0),n,void 0)),children:(0,J.jsx)(ee,{"aria-hidden":`true`})})]})},n)}),(0,J.jsx)(_O,{title:`Connected repositories`,help:`Each one a repository the graph reads: connected from an account, or a local clone or a link added by hand.`}),(0,J.jsx)(Vo,{edit:e,base:[`product`,`repos`],defs:rE,noun:`repository by hand`,placeholder:`web`,meta:e=>typeof e.git==`string`&&e.git?`${e.git}${typeof e.branch==`string`&&e.branch?` (${e.branch})`:``}${typeof e.account==`string`?`, from ${e.account}`:``}`:typeof e.path==`string`?e.path:``}),(0,J.jsx)(DO,{edit:e}),(0,J.jsx)(AO,{edit:e}),(0,J.jsx)(U,{help:zT[0].help,children:`4. The product and its knowledge`}),(0,J.jsx)(Dn,{defs:zT[0].fields,edit:e,base:zT[0].base}),zT.slice(1).map(t=>(0,J.jsxs)(`div`,{children:[(0,J.jsx)(_O,{title:t.title,help:t.help}),(0,J.jsx)(Dn,{defs:t.fields,edit:e,base:t.base})]},t.title)),(0,J.jsx)(U,{help:BT[0].help,children:`5. ${BT[0].title}`}),(0,J.jsx)(Dn,{defs:BT[0].fields,edit:e,base:BT[0].base}),(0,J.jsx)(SO,{sheet:i,setSheet:a,taken:e=>e in n,onSigned:u,onApply:n=>{let r=t;n.mode===`edit`&&n.from!==n.name&&(r=bO(K(r,[`product`,`accounts`,n.from],void 0),n.from,n.name)),e.set(K(r,[`product`,`accounts`,n.name],n.value)),a(null),n.mode===`add`&&s(n.name)}}),(0,J.jsx)(CO,{id:o,account:o?W(n[o]):{},repos:r,onClose:()=>s(null),onConnect:n=>e.set(K(t,[`product`,`repos`],{...r,...n}))})]})}function SO({sheet:e,setSheet:t,taken:n,onApply:r,onSigned:i}){let a=Cr(),[o,s]=(0,q.useState)({busy:!1}),c=e?.step===`form`?`${e.host.id}/${e.from}`:e?.step||``;(0,q.useEffect)(()=>s({busy:!1}),[c]);let l=()=>t(null);if(e?.step===`form`){let c=e,u=c.value,d=e=>t({...c,value:e}),f=c.name?fO.test(c.name)?c.name!==c.from&&n(c.name)?`Another account has this name.`:``:`Letters, digits, - and _.`:``,p=!u.url||mO(c.host.id,String(u.url)).cloud,h=c.host.id===`azure-devops`&&p&&!(u.url&&mO(c.host.id,String(u.url)).org),g=(()=>{let e=String(u.url||``).trim();if(!e)return``;try{let t=new URL(e);return t.protocol===`https:`?t.username||t.password?`No user name or password in the address: the token goes in its own field.`:``:`The address is https.`}catch{return`That is not an address.`}})(),_=!!c.name&&!f&&!g&&(c.host.cloud||!!String(u.url||``).trim())&&(!h||!!String(u.org||``).trim())&&(u.auth!==`token`||!!String(u.token_env||``).trim()),v=pO(c.host,u),y=async e=>{s({busy:!0});try{if(e===`signin`){let e=await Qt.signIn(c.name||`account`,u);s({busy:!1,ok:e.ok,message:e.message})}else{let e=await Qt.repos(c.name||`account`,u,yO(a.pending),[]);s({busy:!1,ok:e.ok,message:e.ok?`Signed in: ${e.repos.length} ${e.repos.length===1?`repository`:`repositories`} to pick from${e.truncated?` (the first ones)`:``}.`:e.message})}}catch(e){s({busy:!1,ok:!1,message:e.message})}};return(0,J.jsxs)(yr,{open:!0,onClose:l,title:c.mode===`add`?`Connect ${c.host.name}`:`Edit ${c.name}`,description:`Then pick its repositories. A token you type is kept in ${Gn(a.store)}, never in the settings files.`,footer:(0,J.jsxs)(J.Fragment,{children:[c.mode===`add`&&(0,J.jsxs)(V,{onClick:()=>t({step:`catalog`}),children:[(0,J.jsx)(Se,{"aria-hidden":`true`}),`Back`]}),(0,J.jsxs)(V,{onClick:()=>y(`list`),disabled:o.busy||!_,className:`mr-auto`,"data-tip":`Test the connection`,children:[(0,J.jsx)(Be,{"aria-hidden":`true`}),o.busy?`Testing…`:`Test`]}),(0,J.jsxs)(V,{onClick:l,children:[(0,J.jsx)(A,{"aria-hidden":`true`}),`Cancel`]}),(0,J.jsxs)(V,{variant:`primary`,disabled:!_,onClick:()=>r(c),children:[c.mode===`add`?(0,J.jsx)(Be,{"aria-hidden":`true`}):(0,J.jsx)(dt,{"aria-hidden":`true`}),c.mode===`add`?`Connect`:`Done`]})]}),children:[(0,J.jsxs)(`div`,{className:`flex items-center gap-4 pt-6 pb-2`,children:[(0,J.jsx)(Pr,{logo:c.host.logo,icon:de,size:`lg`}),(0,J.jsx)(`span`,{className:`text-sm text-muted`,children:c.host.note})]}),(0,J.jsx)(`div`,{"aria-live":`polite`,children:o.message&&(0,J.jsx)(gO,{ok:!!o.ok,message:o.message})}),(0,J.jsx)(H,{label:`Name`,help:f?(0,J.jsx)(`span`,{className:`text-fail`,children:f}):`A short name for the account, such as work.`,htmlFor:`acct-name`,stacked:!0,children:(0,J.jsx)(R,{id:`acct-name`,value:c.name,spellCheck:!1,"aria-invalid":!!f,placeholder:`work`,onChange:e=>t({...c,name:e.target.value.trim()})})}),(0,J.jsx)(H,{label:c.host.cloud?`Address of your own server`:`Address`,help:g?(0,J.jsx)(`span`,{className:`text-fail`,children:g}):c.host.cloud?`Empty: ${c.host.name}'s cloud.`:`https, the server's address.`,htmlFor:`acct-url`,stacked:!0,children:(0,J.jsx)(R,{id:`acct-url`,"aria-invalid":!!g,value:String(u.url||``),spellCheck:!1,placeholder:c.host.cloud?``:`https://bitbucket.acme.example`,onChange:e=>d(K(u,[`url`],e.target.value.trim()||void 0))})}),c.host.org&&(0,J.jsx)(H,{label:c.host.org,help:h?`Its name, as in dev.azure.com/<organization>.`:`Empty: every repository you can read.`,htmlFor:`acct-org`,stacked:!0,children:(0,J.jsx)(R,{id:`acct-org`,value:String(u.org||``),spellCheck:!1,placeholder:`acme`,onChange:e=>d(K(u,[`org`],e.target.value.trim()||void 0))})}),(0,J.jsxs)(`fieldset`,{className:`m-0 border-0 p-0 py-4`,children:[(0,J.jsx)(`legend`,{className:`mb-2 font-medium`,children:`Sign in`}),[[`browser`,v===`git`?`In the browser, with Git Credential Manager`:c.host.id===`github`?`In the browser, with the GitHub CLI`:`In the browser, with Microsoft (the Azure CLI)`],[`token`,`With a personal access token`]].map(([e,t])=>(0,J.jsxs)(`label`,{className:`flex min-h-10 cursor-pointer items-center gap-4 text-sm`,children:[(0,J.jsx)(`input`,{type:`radio`,name:`acct-auth`,checked:u.auth===`token`==(e===`token`),onChange:()=>d(e===`token`?{...u,auth:`token`,token_env:u.token_env||c.host.tokenEnv}:{...u,auth:`browser`,token_env:void 0,user:void 0})}),t]},e))]}),u.auth===`token`?(0,J.jsxs)(J.Fragment,{children:[(0,J.jsx)(H,{label:`Token`,help:`Read access to the repositories (code: read).`,stacked:!0,children:(0,J.jsx)(br,{name:String(u.token_env||c.host.tokenEnv),field:`token`,onRename:e=>d({...u,token_env:e})})}),(c.host.id===`bitbucket-cloud`||c.host.id===`bitbucket-server`)&&(0,J.jsx)(H,{label:`User name for the token`,help:`With a Bitbucket app password. Empty: an access token.`,htmlFor:`acct-user`,stacked:!0,children:(0,J.jsx)(R,{id:`acct-user`,value:String(u.user||``),spellCheck:!1,onChange:e=>d(K(u,[`user`],e.target.value.trim()||void 0))})})]}):v===`cli`?(0,J.jsx)(sE,{system:c.host.cli.system,label:c.host.cli.label,keyless:!0,onChanged:i}):v===`gh-host`?(0,J.jsx)(H,{label:`Sign in with the GitHub CLI`,help:`In a terminal: gh auth login --web --hostname ${(()=>{try{return new URL(String(u.url)).hostname}catch{return`<your server>`}})()}. Then Test.`,stacked:!0}):(0,J.jsx)(H,{label:`Sign in with the browser`,help:`Git Credential Manager opens the sign-in on this computer and keeps it for git, which fetches the repositories with it.`,stacked:!0,children:(0,J.jsxs)(V,{onClick:()=>y(`signin`),disabled:o.busy||!_,"data-tip":`Sign in with the browser`,children:[(0,J.jsx)(m,{"aria-hidden":`true`}),o.busy?`Signing in…`:`Sign in`]})})]})}return(0,J.jsx)(yr,{open:e?.step===`catalog`,onClose:l,title:`Add an account`,description:`Pick where your code is.`,footer:(0,J.jsxs)(V,{onClick:l,children:[(0,J.jsx)(A,{"aria-hidden":`true`}),`Close`]}),children:(0,J.jsx)(`div`,{className:`pt-4`,children:uO.map(e=>(0,J.jsxs)(`button`,{type:`button`,onClick:()=>t({step:`form`,host:e,mode:`add`,name:``,from:``,value:{host:e.id,auth:`browser`}}),className:`flex min-h-14 w-full cursor-pointer items-center gap-4 rounded-[12px] border-0 bg-transparent px-2 py-2 text-left text-ink hover:bg-surface-muted`,children:[(0,J.jsx)(Pr,{logo:e.logo,icon:de}),(0,J.jsxs)(`span`,{className:`flex min-w-0 flex-1 flex-col gap-1`,children:[(0,J.jsx)(`span`,{className:`font-medium`,children:e.name}),(0,J.jsx)(`span`,{className:`text-sm text-muted`,children:e.note})]}),(0,J.jsx)(`span`,{className:`text-[13px] text-accent-fg`,children:`Add`})]},e.id))})})}function CO({id:e,account:t,repos:n,onClose:r,onConnect:i}){let a=Cr(),[o,s]=(0,q.useState)({busy:!1}),[c,l]=(0,q.useState)(new Set),[u,d]=(0,q.useState)(``),f=(0,q.useMemo)(()=>new Set(Object.values(n).map(e=>String(W(e).git||``))),[n]);(0,q.useEffect)(()=>{e&&(l(new Set),d(``),s({busy:!0}),Qt.repos(e,t,yO(a.pending),Object.keys(n)).then(e=>s(e.ok?{busy:!1,repos:e.repos,truncated:e.truncated,skipped:e.skipped}:{busy:!1,message:e.message}),e=>s({busy:!1,message:e.message})))},[e]);let p=(o.repos||[]).filter(e=>!u||e.fullName.toLowerCase().includes(u.toLowerCase()));return(0,J.jsxs)(yr,{open:!!e,onClose:r,wide:!0,title:`Repositories of ${e||``}`,description:`Pick the ones ForgeQE reads into the product graph. They are fetched into ForgeQE's own cache, never your workspace.`,footer:(0,J.jsxs)(J.Fragment,{children:[(0,J.jsx)(`span`,{className:`mr-auto text-sm text-muted`,children:c.size?`${c.size} picked`:``}),(0,J.jsxs)(V,{onClick:r,children:[(0,J.jsx)(A,{"aria-hidden":`true`}),`Cancel`]}),(0,J.jsxs)(V,{variant:`primary`,disabled:!c.size,onClick:()=>{let e={};for(let t of o.repos||[])c.has(t.git)&&(e[t.key]=t.entry);i(e),r()},"data-tip":c.size>1?`Connect ${c.size} repositories`:void 0,children:[(0,J.jsx)(Be,{"aria-hidden":`true`}),c.size>1?`Connect (${c.size})`:`Connect`]})]}),children:[(0,J.jsxs)(`div`,{"aria-live":`polite`,children:[o.busy&&(0,J.jsx)(vO,{children:`Reading the account's repositories…`}),o.message&&(0,J.jsx)(gO,{ok:!1,message:o.message})]}),o.repos&&(0,J.jsxs)(J.Fragment,{children:[(0,J.jsx)(H,{label:`Find`,htmlFor:`repo-find`,stacked:!0,children:(0,J.jsx)(R,{id:`repo-find`,value:u,placeholder:`shop`,onChange:e=>d(e.target.value)})}),!p.length&&(0,J.jsx)(`p`,{className:`m-0 border-t border-line-soft py-6 text-sm text-muted`,children:o.repos.length?`None matches.`:`None yet: the account can read no repository.`}),(0,J.jsx)(`ul`,{"aria-label":`Repositories`,className:`m-0 list-none p-0`,children:p.map(e=>{let t=f.has(e.git);return(0,J.jsx)(`li`,{className:`border-t border-line-soft`,children:(0,J.jsxs)(`label`,{className:L(`flex min-h-12 items-center gap-4 py-2`,t?`cursor-default`:`cursor-pointer`),children:[(0,J.jsx)(vy,{disabled:t,checked:t||c.has(e.git),onCheckedChange:t=>l(n=>{let r=new Set(n);return t?r.add(e.git):r.delete(e.git),r})}),(0,J.jsxs)(`span`,{className:`flex min-w-0 flex-1 flex-col gap-1`,children:[(0,J.jsx)(`span`,{className:`font-medium [overflow-wrap:anywhere]`,children:e.fullName}),(0,J.jsx)(`span`,{className:`text-sm text-muted [overflow-wrap:anywhere]`,children:[e.branch,e.private?`private`:e.private===!1?`public`:``,e.description].filter(Boolean).join(` · `)})]}),t&&(0,J.jsx)(`span`,{className:`text-[13px] text-pass`,children:`Connected`})]})},e.git)})}),(o.truncated||!!o.skipped)&&(0,J.jsx)(`p`,{className:`m-0 border-t border-line-soft pt-4 text-[13px] text-muted`,children:[o.truncated?`The first 2,000 are listed: find narrows them.`:``,o.skipped?`${o.skipped} left out: their links are not of this host, or not https.`:``].filter(Boolean).join(` `)})]})]})}var wO=e=>e.url?`url`:e.mcp?`mcp`:e.command?`command`:e.documents?`documents`:`none`,TO=RT[0].fields,EO=e=>e.map(e=>TO.find(t=>t.key===e));function DO({edit:e}){let t=Cr(),n=W(e.value.rag),r=wO(n),[i,a]=(0,q.useState)(r),[o,s]=(0,q.useState)(``),[c,l]=(0,q.useState)({busy:!1});(0,q.useEffect)(()=>a(r),[r]);let u=t=>{a(t),l({busy:!1});let r={top_k:n.top_k,timeout_seconds:n.timeout_seconds},i=t===`none`?{}:Object.fromEntries(Object.entries({...r,...t===`url`?{url:n.url,token_env:n.token_env}:t===`mcp`?{mcp:n.mcp}:t===`documents`?{documents:n.documents&&typeof n.documents==`object`?n.documents:{reasoning:!1}}:{command:n.command}}).filter(([,e])=>e!==void 0));e.set(K(e.value,[`rag`],Object.keys(i).length?i:void 0))},d=Object.keys(W(e.value.mcp)),f=async()=>{l({busy:!0});try{let r=await Qt.testSearch(n,W(e.value.mcp),o,yO(t.pending));l({busy:!1,...r})}catch(e){l({busy:!1,ok:!1,message:e.message})}};return(0,J.jsxs)(J.Fragment,{children:[(0,J.jsx)(U,{help:`Where your requirements, specs and wiki are searched (a RAG index): checking a test case or a story adds the passages it finds.`,children:`2. Search service`}),(0,J.jsxs)(`fieldset`,{className:`m-0 border-0 p-0 pb-2`,children:[(0,J.jsx)(`legend`,{className:`mb-2 font-medium`,children:`The search service is`}),[[`none`,`None`],[`documents`,`This project's documents (built in, no vectors)`],[`url`,`A service at an address`],[`mcp`,`A tool of one of your MCP servers`],[`command`,`A command on this machine`]].map(([e,t])=>(0,J.jsxs)(`label`,{className:`flex min-h-10 cursor-pointer items-center gap-4 text-sm`,children:[(0,J.jsx)(`input`,{type:`radio`,name:`rag-kind`,checked:i===e,onChange:()=>u(e)}),t]},e))]}),i===`url`&&(0,J.jsx)(Dn,{defs:EO([`url`,`token_env`,`top_k`,`timeout_seconds`]),edit:e,base:[`rag`]}),i===`mcp`&&(0,J.jsxs)(J.Fragment,{children:[(0,J.jsx)(Dn,{defs:EO([`mcp.server`,`mcp.tool`,`mcp.query_arg`,`mcp.top_k_arg`,`top_k`,`timeout_seconds`]),edit:e,base:[`rag`]}),(0,J.jsx)(`p`,{className:`m-0 border-t border-line-soft py-4 text-[13px] text-muted`,children:d.length?`MCP servers set up: ${d.join(`, `)}.`:`No MCP server is set up yet: add one under MCP servers, then name it here.`})]}),i===`command`&&(0,J.jsx)(Dn,{defs:EO([`command`,`top_k`,`timeout_seconds`]),edit:e,base:[`rag`]}),i===`documents`&&(0,J.jsx)(Dn,{defs:EO([`documents.folders`,`documents.reasoning`,`top_k`]),edit:e,base:[`rag`]}),i!==`none`&&(0,J.jsx)(H,{label:`Try a search`,help:i===`command`?`A command runs on the next real search, not from this page.`:i===`documents`?`Searched by keywords only on this page; the model is asked on a real search. Nothing is saved.`:`What a test case would search for. Nothing is saved.`,htmlFor:`rag-query`,children:(0,J.jsxs)(`div`,{className:`flex w-full items-center gap-2`,children:[(0,J.jsx)(R,{id:`rag-query`,value:o,placeholder:`refunds over 500 EUR`,onChange:e=>s(e.target.value),onKeyDown:e=>e.key===`Enter`&&o.trim()&&f(),className:`min-w-0 flex-1`}),(0,J.jsxs)(V,{size:`sm`,disabled:c.busy||!o.trim(),onClick:f,children:[(0,J.jsx)(_e,{"aria-hidden":`true`}),c.busy?`Searching…`:`Search`]})]})}),(0,J.jsxs)(`div`,{"aria-live":`polite`,children:[c.message&&(0,J.jsx)(gO,{ok:!!c.ok,message:c.message}),!!c.passages?.length&&(0,J.jsx)(`ul`,{"aria-label":`Passages found`,className:`m-0 list-none p-0`,children:c.passages.map((e,t)=>(0,J.jsxs)(`li`,{className:`border-t border-line-soft py-2 text-sm [overflow-wrap:anywhere]`,children:[e.source&&(0,J.jsxs)(`span`,{className:`font-medium`,children:[e.source,`: `]}),(0,J.jsx)(`span`,{className:`text-ink-2`,children:e.text})]},t))})]})]})}var OO=/^[A-Za-z0-9][A-Za-z0-9 _.()-]{0,99}\.(md|markdown|txt)$/i,kO=e=>e<1024?`${e} bytes`:e<1048576?`${Math.round(e/1024)} KB`:`${(e/1024/1024).toFixed(1)} MB`;function AO({edit:e}){let[t,n]=(0,q.useState)(null),[r,i]=(0,q.useState)(null),[a,o]=(0,q.useState)(!1),s=(0,q.useRef)(null);(0,q.useEffect)(()=>{Qt.documents().then(e=>n(e.documents),e=>i({ok:!1,message:e.message}))},[]);let c=async e=>{if(!e?.length)return;o(!0),i(null);let r=[];try{for(let i of Array.from(e)){if(!OO.test(i.name))throw Error(`${i.name}: only a .md, .markdown or .txt file with a plain name.`);if(i.size>1e6)throw Error(`${i.name} is over 1 MB.`);let e=t?.some(e=>e.name===i.name)??!1,a=await Qt.addDocument(i.name,await i.text(),e);n(a.documents),r.push(i.name)}i({ok:!0,message:`Added ${r.join(`, `)}. forgeqe knowledge build reads them with the other documents.`})}catch(e){i({ok:!1,message:e.message})}finally{o(!1),s.current&&(s.current.value=``)}},l=async e=>{try{n((await Qt.removeDocument(e)).documents)}catch(e){i({ok:!1,message:e.message})}};return(0,J.jsxs)(J.Fragment,{children:[(0,J.jsx)(U,{help:`What the graph reads beside the code: Markdown files you add here, folders on this computer, links, Confluence spaces, and the pages ForgeQE remembers of a web app.`,children:`3. Documents`}),(0,J.jsxs)(`div`,{className:`mb-4 flex flex-wrap items-center justify-between gap-4`,children:[(0,J.jsx)(`p`,{className:`m-0 text-sm text-muted`,children:`Added here: kept in .forgeqe/documents, read as the source uploaded.`}),(0,J.jsxs)(V,{size:`sm`,disabled:a,"data-tip":`Add Markdown files`,onClick:()=>s.current?.click(),children:[(0,J.jsx)(mt,{"aria-hidden":`true`}),a?`Uploading…`:`Upload`]}),(0,J.jsx)(`input`,{ref:s,type:`file`,accept:`.md,.markdown,.txt,text/markdown,text/plain`,multiple:!0,hidden:!0,onChange:e=>c(e.target.files)})]}),(0,J.jsx)(`div`,{"aria-live":`polite`,children:r&&(0,J.jsx)(gO,{ok:r.ok,message:r.message})}),!t&&!r&&(0,J.jsx)(vO,{children:`Reading the documents…`}),t&&!t.length&&(0,J.jsx)(`p`,{className:`m-0 border-t border-line-soft py-6 text-sm text-muted`,children:`None yet.`}),t?.map(e=>(0,J.jsx)(hO,{icon:xe,title:e.title,meta:`${e.name}, ${kO(e.bytes)}`,actions:(0,J.jsx)(V,{variant:`icon`,size:`icon-sm`,"aria-label":`Remove ${e.name}`,"data-tip":`Remove ${e.name}`,onClick:()=>l(e.name),children:(0,J.jsx)(Ie,{"aria-hidden":`true`})})},e.name)),(0,J.jsx)(_O,{title:`Documents and links`,help:`Each one a folder of documents, a link, a Confluence space, or a web app whose pages ForgeQE remembers, by a name no repository has.`}),(0,J.jsx)(Vo,{edit:e,base:[`product`,`docs`],defs:nE,noun:`source`,placeholder:`help`,meta:e=>String(e.path||e.url||(e.confluence?`Confluence ${e.confluence}`:e.app?`app ${e.app}`:``))})]})}var jO=/^[A-Z][A-Z0-9_]{1,63}$/,MO=/^(PATH|PATHEXT|HOME|SHELL|USER|USERNAME|LOGNAME|PWD|TMPDIR|TEMP|TMP|LANG|LC_\w+|TERM|COMSPEC|SYSTEMROOT|WINDIR|APPDATA|LOCALAPPDATA|USERPROFILE|NODE_\w+|BUN_\w+|NPM_\w+|PYTHON\w*|VIRTUAL_ENV|UV_\w+|LD_\w+|DYLD_\w+|SSL_CERT_\w+|REQUESTS_CA_BUNDLE|CURL_CA_BUNDLE|(HTTPS?|ALL|NO)_PROXY|GIT_\w+|SSH_\w+|GNUPGHOME|EDITOR|VISUAL|PAGER|FORGEQE_\w+|WEBPILOT_\w+|WP_CONFIG|WP_LLMS_JSON|WP_LLM_PROFILE)$/i,NO=/(TOKEN|PAT)$/,PO=(e,t=`SHOP_PASSWORD`)=>jO.test(e)?MO.test(e)?`${e} changes how programs start: pick another name.`:``:`Capital letters, digits and _, such as ${t}.`,FO=[{id:`azure`,label:`Azure Key Vault`,where:`Key vault`,whereHelp:`Its name, as in https://<name>.vault.azure.net.`,placeholder:`shop-qa-kv`,cli:`Microsoft, in the browser (az login)`},{id:`gcp`,label:`Google Secret Manager`,where:`Project`,whereHelp:`The Google Cloud project's id.`,placeholder:`shop-qa-123456`,cli:`Google, in the browser (gcloud auth login)`},{id:`aws`,label:`AWS Secrets Manager`,where:`Region`,whereHelp:`Where its secrets are, such as eu-west-1.`,placeholder:`eu-west-1`,cli:`AWS SSO, in the browser (aws sso login)`}],IO={tenant:`Tenant id`,clientId:`Client id`,clientSecret:`Client secret`,serviceAccount:`Service account key (JSON)`,accessKeyId:`Access key id`,secretAccessKey:`Secret access key`,sessionToken:`Session token (optional)`},LO=e=>e?.length?`Used by ${e.slice(0,2).join(`, `)}${e.length>2?` and ${e.length-2} more`:``}`:``,RO=()=>wt.list();function zO({show:e}){let{data:t,error:n,reload:r}=Hn(RO),[i,a]=(0,q.useState)(null),[o,s]=(0,q.useState)(`sec-saved`),[c,l]=(0,q.useState)(e||`all`);(0,q.useEffect)(()=>{e&&s(`sec-saved`),l(e||`all`)},[e]);let[u,d]=(0,q.useState)(``),[p,g]=(0,q.useState)(``),[_,v]=(0,q.useState)(null),[y,b]=(0,q.useState)(null),[x,S]=(0,q.useState)(null),[C,w]=(0,q.useState)(!1),T=(0,q.useRef)(null),[E,D]=(0,q.useState)(!1),[O,ee]=(0,q.useState)(``),[te,ne]=(0,q.useState)(null),[A,j]=(0,q.useState)({}),M=i??t,re=(M?.vaults||[]).filter(e=>e.auth===`cli`).map(e=>e.id).join(`,`),N=e=>{j(t=>({...t,[e]:`checking`})),wt.check(e).then(t=>j(n=>({...n,[e]:t})),t=>j(n=>({...n,[e]:{signedIn:!1,problem:t.message}})))};(0,q.useEffect)(()=>{if(o===`sec-vaults`)for(let e of re.split(`,`).filter(Boolean))A[e]||N(e)},[o,re]),(0,q.useEffect)(()=>{if(te?.state!==`running`)return;let e=setTimeout(()=>{wt.signinState().then(e=>{ne(e.signin),e.signin&&e.signin.state!==`running`&&N(e.signin.vault)},()=>{})},1e3);return()=>clearTimeout(e)},[te]);let ie=async e=>{d(``),g(``);try{ne(await wt.signIn(e))}catch(e){g(e.message)}},ae=async(e,t,n)=>{w(!0),ee(``);try{a(await e()),n(),d(t)}catch(e){ee(e.message)}finally{w(!1)}},oe=e=>{ee(``),d(``),e()};if(!M)return(0,J.jsx)(fr,{error:n,reload:r});let P=M.secrets.filter(e=>e.from===`vault`&&!e.pending).length,se=async()=>{d(``),g(``);try{let e=await wt.exportVaults(),t=URL.createObjectURL(new Blob([`${JSON.stringify(e,null,2)}\n`],{type:`application/json;charset=utf-8`})),n=document.createElement(`a`);n.href=t,n.download=`forgeqe-vaults.json`,n.click(),setTimeout(()=>URL.revokeObjectURL(t),1e3),d(`Exported the vault connections: no value is in the file. A teammate imports it here and pulls with their own sign-in.`)}catch(e){g(e.message)}},ce=async e=>{let t=e?.[0];if(t){if(d(``),g(``),t.size>262144)return g(`${t.name} is over 256 KB.`);w(!0),D(!0);try{let e=await wt.importVaults(await t.text());a(e.view);let n=[e.added.length?`Added ${e.added.length===1?`the vault`:`${e.added.length} vaults:`} ${e.added.join(`, `)}.`:`No new vault.`,e.toPull.length?`${e.toPull.length===1?`1 secret is`:`${e.toPull.length} secrets are`} ready to pull on Saved: sign in, then Pull.`:``];d(n.filter(Boolean).join(` `)),e.skipped.length&&g(`Not imported: ${e.skipped.map(e=>`${e.id} (${e.why})`).join(`; `)}`)}catch(e){g(e.message)}finally{w(!1),D(!1)}}},le=M.secrets.filter(e=>e.token),F=c===`tokens`?le:M.secrets,ue=(e=M.suggestedTokens[0]||`REPO_TOKEN`)=>oe(()=>v({mode:`add`,name:e,value:``,token:!0})),de=async e=>{w(!0),d(``),g(``);try{let t=await wt.pullAgain(e);a(t.view),t.failed.length?g(`Not pulled: ${t.failed.map(e=>`${e.name} (${e.error})`).join(`; `)}`):d(`Pulled ${e}.`)}catch(e){g(e.message)}finally{w(!1)}},fe=async()=>{w(!0),d(``),g(``);try{let e=await wt.pullAgain();a(e.view),d(`Pulled ${e.pulled.length} again from their vaults.`),g(e.failed.length?`Not pulled: ${e.failed.map(e=>`${e.name} (${e.error})`).join(`; `)}`:``)}catch(e){g(e.message)}finally{w(!1)}};return(0,J.jsxs)(J.Fragment,{children:[(0,J.jsx)(Ir,{label:`Secrets`,current:o,onPick:e=>{s(e),d(``),g(``)},tabs:[{id:`sec-saved`,label:`Saved (${M.secrets.length})`},{id:`sec-vaults`,label:`Vaults (${M.vaults.length})`}]}),u&&(0,J.jsx)(`p`,{role:`status`,className:`m-0 mb-4 rounded-[10px] bg-surface-muted px-4 py-2 text-sm text-ink-2 [overflow-wrap:anywhere]`,children:u}),p&&(0,J.jsx)(`p`,{role:`alert`,className:`m-0 mb-4 rounded-[10px] bg-fail-soft px-4 py-2 text-sm text-fail [overflow-wrap:anywhere]`,children:p}),o===`sec-saved`?(0,J.jsxs)(`div`,{role:`tabpanel`,id:`panel-sec-saved`,"aria-labelledby":`tab-sec-saved`,children:[(0,J.jsxs)(`div`,{className:`mb-4 flex flex-wrap items-center justify-between gap-4`,children:[(0,J.jsx)(`div`,{className:`flex flex-wrap gap-2`,role:`group`,"aria-label":`Show`,children:(0,J.jsx)(hn,{value:c,onChange:e=>{l(e),d(``)},items:[{id:`all`,label:`All`,n:M.secrets.length},{id:`tokens`,label:`Repository tokens`,n:le.length+M.neededTokens.length}]})}),(0,J.jsxs)(`span`,{className:`flex flex-wrap gap-2`,children:[P>0&&(0,J.jsxs)(V,{size:`sm`,disabled:C,onClick:()=>void fe(),children:[(0,J.jsx)(f,{"aria-hidden":`true`}),C?`Pulling…`:`Pull all again`]}),c===`tokens`?(0,J.jsxs)(V,{size:`sm`,onClick:()=>ue(),children:[(0,J.jsx)(k,{"aria-hidden":`true`}),`Add a token`]}):(0,J.jsxs)(V,{size:`sm`,onClick:()=>oe(()=>v({mode:`add`,name:``,value:``})),children:[(0,J.jsx)(k,{"aria-hidden":`true`}),`Add a secret`]})]})]}),(0,J.jsx)(`p`,{className:`m-0 mb-4 text-sm text-muted`,children:c===`tokens`?`The tokens ForgeQE clones and reads git repositories with: one for each git host or account. A clone picks one by its name.`:`Agents and tests use a secret by its name: in a sign-in, an environment's secrets, or a test's variables.`}),M.neededTokens.map(e=>(0,J.jsx)(or,{expandable:!1,open:!1,onToggle:()=>{},lead:(0,J.jsx)(Pr,{icon:We}),title:(0,J.jsx)(`span`,{className:`font-mono`,children:e.name}),meta:`${LO(e.usedBy)}. It has no value here yet.`,state:(0,J.jsx)(`span`,{className:`text-[13px] text-muted`,children:`Not set`}),actions:(0,J.jsx)(V,{size:`sm`,"aria-label":`Add ${e.name}`,onClick:()=>ue(e.name),children:`Add`}),children:null},`needed-${e.name}`)),F.length===0&&!M.neededTokens.length&&(0,J.jsx)(`p`,{className:`m-0 border-t border-line-soft py-6 text-sm text-muted`,children:c===`tokens`?`No repository tokens yet. Add one for each git host or account.`:`None yet. Add one, or pull one from a vault.`}),F.map(e=>(0,J.jsx)(or,{expandable:!1,open:!1,onToggle:()=>{},lead:(0,J.jsx)(Pr,{icon:e.from===`vault`?h:e.from===`sign-in`?m:e.token?We:Ze}),title:(0,J.jsx)(`span`,{className:`font-mono`,children:e.name}),meta:[e.from===`vault`&&e.vault?`From ${e.vault.provider} ${e.vault.id}: ${e.vault.secret}${e.vault.key?` › ${e.vault.key}`:``} · ${e.pending?`not pulled yet`:`pulled ${ta(e.vault.at)}`}`:e.from===`sign-in`?`From the ${e.system} sign-in: sign out of it to remove it.`:e.from===`shell`?`Set in your shell: change or remove it there.`:`Saved in Settings`,e.token?LO(e.usedBy)||`Not used yet`:``].filter(Boolean).join(` · `),state:e.from===`shell`?(0,J.jsx)(`span`,{className:`text-[13px] text-pass`,children:`Set in the environment`}):e.set?(0,J.jsx)(`span`,{className:`text-[13px] text-pass`,children:`Saved`}):(0,J.jsx)(`span`,{className:`text-[13px] text-muted`,children:`Not set`}),actions:e.pending?(0,J.jsx)(V,{size:`sm`,"aria-label":`Pull ${e.name}`,disabled:C,onClick:()=>void de(e.name),children:`Pull`}):e.from===`sign-in`||e.from===`shell`?void 0:(0,J.jsx)(V,{size:`sm`,"aria-label":`Edit ${e.name}`,onClick:()=>oe(()=>v({mode:`edit`,name:e.name,value:``,row:e,...e.token?{token:!0}:{}})),children:`Edit`}),children:null},e.name)),(0,J.jsxs)(`p`,{className:`m-0 mt-4 text-[13px] text-muted`,children:[`Kept in `,Gn(M.store),`. ForgeQE never shows a value again, and the agents see only names.`,c===`tokens`?` Give each token read access to the repositories it clones, nothing more.`:``]})]}):(0,J.jsxs)(`div`,{role:`tabpanel`,id:`panel-sec-vaults`,"aria-labelledby":`tab-sec-vaults`,children:[(0,J.jsxs)(`div`,{className:`mb-4 flex flex-wrap items-center justify-end gap-2`,children:[M.vaults.length>0&&(0,J.jsxs)(V,{size:`sm`,onClick:()=>void se(),"data-tip":`A file of the connections, without values, for a teammate to import`,children:[(0,J.jsx)(Ye,{"aria-hidden":`true`}),`Export`]}),(0,J.jsxs)(V,{size:`sm`,disabled:C,onClick:()=>T.current?.click(),"data-tip":`Connections a teammate exported`,children:[(0,J.jsx)(mt,{"aria-hidden":`true`}),E?`Importing…`:`Import`]}),(0,J.jsx)(`input`,{ref:T,type:`file`,accept:`.json,application/json`,hidden:!0,onChange:e=>(ce(e.target.files),e.target.value=``)}),(0,J.jsxs)(V,{size:`sm`,onClick:()=>oe(()=>b({mode:`add`,v:{id:``,provider:`azure`,where:``,auth:`cli`}})),children:[(0,J.jsx)(k,{"aria-hidden":`true`}),`Add a vault`]})]}),(0,J.jsx)(`p`,{className:`m-0 mb-4 text-sm text-muted`,children:`Where ForgeQE pulls secrets from. It reads a value only when you pull that secret.`}),te&&(0,J.jsx)(UO,{s:te,onCancel:()=>void wt.cancelSignin().then(e=>ne(e.signin),()=>{}),onClose:()=>ne(null)}),M.vaults.length===0&&(0,J.jsx)(`p`,{className:`m-0 border-t border-line-soft py-6 text-sm text-muted`,children:`None yet. Add Azure Key Vault, Google Secret Manager or AWS Secrets Manager.`}),M.vaults.map(e=>(0,J.jsx)(or,{expandable:!1,open:!1,onToggle:()=>{},lead:(0,J.jsx)(Pr,{icon:h}),title:e.id,meta:`${e.providerLabel} · ${e.where} · ${e.auth===`cli`?`signs in with your browser${e.profile?`, profile ${e.profile}`:``}`:`signs in with saved keys`}${e.pulled?` · ${e.pulled} pulled`:``}${e.missing.length?` · not saved yet: ${e.missing.join(`, `)}`:``}`,state:e.auth===`cli`?A[e.id]===`checking`||!A[e.id]?(0,J.jsx)(`span`,{className:`text-[13px] text-muted`,children:`Checking the sign-in…`}):A[e.id].signedIn?(0,J.jsx)(`span`,{className:`text-[13px] text-pass`,children:`Signed in`}):(0,J.jsx)(`span`,{className:`text-[13px] text-warn`,"data-tip":A[e.id].problem,children:`Not signed in`}):e.missing.length?(0,J.jsx)(`span`,{className:`text-[13px] text-warn`,"data-tip":e.missing.join(`, `),children:e.missing.length===1?`Needs ${e.missing[0]}`:`Needs ${e.missing.length} variables`}):(0,J.jsx)(`span`,{className:`text-[13px] text-muted`,children:e.pulled===1?`1 secret pulled`:`${e.pulled} secrets pulled`}),actions:(0,J.jsxs)(J.Fragment,{children:[e.auth===`cli`&&A[e.id]!==`checking`&&A[e.id]&&!A[e.id].signedIn?(0,J.jsxs)(V,{size:`sm`,variant:`primary`,"aria-label":`Sign in to ${e.id}`,disabled:te?.state===`running`,onClick:()=>void ie(e.id),children:[(0,J.jsx)(m,{"aria-hidden":`true`}),`Sign in`]}):(0,J.jsx)(V,{size:`sm`,"aria-label":`Browse ${e.id}`,disabled:e.missing.length>0||e.auth===`cli`&&A[e.id]===`checking`,onClick:()=>oe(()=>S(e)),children:`Browse`}),(0,J.jsx)(V,{size:`sm`,"aria-label":`Edit ${e.id}`,onClick:()=>oe(()=>b({mode:`edit`,v:{id:e.id,provider:e.provider,where:e.where,auth:e.auth,...e.profile?{profile:e.profile}:{},...e.keys?{keys:e.keys}:{}}})),children:`Edit`})]}),children:null},e.id)),(0,J.jsx)(`p`,{className:`m-0 mt-4 text-[13px] text-muted`,children:`Vaults are kept on this computer for this project, never in the repository: share them with Export and Import, which carry no value. Give ForgeQE's sign-in read access to the secrets it needs, nothing more.`})]}),(0,J.jsx)(BO,{panel:_,setPanel:v,busy:C,error:O,onSave:e=>void ae(()=>wt.save(e.name,e.value),`${e.mode===`add`?`Added`:`Saved`} ${e.name}.`,()=>v(null)),onRemove:e=>void ae(()=>wt.remove(e),`Removed ${e}.`,()=>v(null)),onPull:e=>void ae(async()=>{let t=await wt.pullAgain(e);if(t.failed.length)throw Error(t.failed[0].error);return t.view},`Pulled ${e} again.`,()=>v(null)),taken:new Set(M.secrets.map(e=>e.name))}),(0,J.jsx)(VO,{panel:y,setPanel:b,busy:C,error:O,roles:M.keyRoles,taken:new Set(M.vaults.map(e=>e.id)),missing:M.vaults.find(e=>e.id===y?.v.id)?.missing,onSave:e=>void ae(()=>wt.saveVault(e.v,e.mode===`edit`),`${e.mode===`add`?`Added`:`Saved`} the vault ${e.v.id}.${e.v.auth===`cli`?` Sign in on its row if it says Not signed in.`:``}`,()=>{b(null),j(t=>{let{[e.v.id]:n,...r}=t;return r})}),onRemove:e=>void ae(()=>wt.removeVault(e),`Removed the vault ${e}. The secrets pulled from it stay saved.`,()=>b(null))}),(0,J.jsx)(HO,{vault:x,onClose:()=>S(null),taken:new Set(M.secrets.map(e=>e.name)),onPulled:(e,t,n)=>{a(e),S(null),s(`sec-saved`),d(`Pulled ${n} as ${t}. Agents and tests can use it by that name.`)}})]})}function BO({panel:e,setPanel:t,busy:n,error:r,onSave:i,onRemove:a,onPull:o,taken:s}){let c=e?.mode===`add`?PO(e.name,e.token?`GITHUB_TOKEN`:void 0)||(s.has(e.name)?`${e.name} is already in the list: edit it there.`:``)||(e.token&&!NO.test(e.name)?`A token's name ends in TOKEN or PAT, such as GITHUB_TOKEN.`:``):``,l=e?.row?.from===`vault`,[u,d]=(0,q.useState)(!1);return(0,q.useEffect)(()=>d(!1),[!!e]),(0,J.jsx)(yr,{open:!!e,onClose:()=>t(null),title:e?.mode===`edit`?`Edit ${e.name}`:e?.token?`Add a repository token`:`Add a secret`,description:`The value goes to your credential store when you press the button below. ForgeQE never shows it again, and the agents see only its name.`,footer:(0,J.jsxs)(J.Fragment,{children:[r?(0,J.jsx)(`span`,{role:`alert`,className:`mr-auto self-center text-sm text-fail [overflow-wrap:anywhere]`,children:r}):c?(0,J.jsx)(`span`,{className:`mr-auto self-center text-sm text-muted`,children:`Needs a valid name`}):null,e?.mode===`edit`&&(0,J.jsx)(V,{disabled:n,onClick:()=>a(e.name),className:`mr-auto text-fail`,children:`Remove`}),(0,J.jsx)(V,{onClick:()=>t(null),children:`Cancel`}),(0,J.jsx)(V,{variant:`primary`,disabled:n||!!c||!e?.value.trim(),onClick:()=>e&&i(e),children:n?`Saving…`:e?.mode===`add`?e.token?`Add token`:`Add secret`:e?.token?`Save token`:`Save secret`})]}),children:e&&(0,J.jsxs)(J.Fragment,{children:[e.mode===`add`&&(0,J.jsx)(H,{label:`Name`,help:c?(0,J.jsx)(`span`,{className:`text-fail`,children:c}):e.token?`The variable a clone signs in with: one per host or account.`:`The variable agents and tests read it by.`,htmlFor:`sh-name`,className:`mt-4`,stacked:!0,children:(0,J.jsx)(R,{id:`sh-name`,value:e.name,spellCheck:!1,maxLength:64,placeholder:e.token?`GITHUB_TOKEN`:`SHOP_PASSWORD`,"aria-invalid":!!c,onChange:n=>t({...e,name:n.target.value.toUpperCase().replace(/[^A-Z0-9_]/g,`_`)}),className:`font-mono`})}),l&&e.row?.vault&&(0,J.jsx)(H,{label:`From a vault`,help:`${e.row.vault.provider} ${e.row.vault.id}: ${e.row.vault.secret}${e.row.vault.key?` › ${e.row.vault.key}`:``}, pulled ${ta(e.row.vault.at)}. Pull it again for the vault's newest value; a value typed below replaces it and is no longer the vault's.`,className:`mt-4`,stacked:!0,children:(0,J.jsxs)(V,{size:`sm`,disabled:n,onClick:()=>o(e.name),children:[(0,J.jsx)(f,{"aria-hidden":`true`}),`Pull again`]})}),(0,J.jsx)(H,{label:e.mode===`edit`?`New value`:e.token?`Token`:`Value`,help:e.token?`A personal access token with read access to the repositories (GitHub: Contents read; Azure DevOps: Code read; GitLab: read_repository).`:(0,J.jsxs)(J.Fragment,{children:[`At most 16 KB.`,` `,(0,J.jsx)(`button`,{type:`button`,onClick:()=>d(!u),className:`cursor-pointer border-0 bg-transparent p-0 text-[13px] text-accent-fg underline`,children:u?`One line, hidden`:`Several lines (shown as you type), such as a JSON key`})]}),htmlFor:`sh-value`,className:e.mode===`edit`&&!l?`mt-4`:void 0,stacked:!0,children:u&&!e.token?(0,J.jsx)(pn,{id:`sh-value`,rows:6,autoComplete:`off`,spellCheck:!1,value:e.value,onChange:n=>t({...e,value:n.target.value}),className:`font-mono`}):(0,J.jsx)(R,{id:`sh-value`,type:`password`,autoComplete:`off`,value:e.value,onChange:n=>t({...e,value:n.target.value})})})]})})}function VO({panel:e,setPanel:t,busy:n,error:r,roles:i,taken:a,missing:o,onSave:s,onRemove:c}){let l=e?.v,u=FO.find(e=>e.id===l?.provider)??FO[0],d=n=>e&&t({...e,v:{...e.v,...n}}),f=l?.auth===`keys`?Object.entries(i[l.provider]).map(([e,t])=>[e,PO(l.keys?.[e]??t)]).filter(([,e])=>e):[],p=e?.mode===`add`?/^[a-z][a-z0-9-]{0,39}$/.test(l?.id||``)?a.has(l.id)?`A vault is already named ${l.id}.`:``:`Lower case letters, digits and -, such as qa-kv.`:``;return(0,J.jsx)(yr,{open:!!e,onClose:()=>t(null),title:e?.mode===`edit`?`Edit ${l?.id}`:`Add a vault`,description:`Where ForgeQE pulls secrets from, and how it signs in. Kept on this computer for this project. Nothing is read until you pull a secret.`,footer:(0,J.jsxs)(J.Fragment,{children:[r?(0,J.jsx)(`span`,{role:`alert`,className:`mr-auto self-center text-sm text-fail [overflow-wrap:anywhere]`,children:r}):p||f.length?(0,J.jsx)(`span`,{className:`mr-auto self-center text-sm text-muted`,children:`Needs a valid name`}):null,e?.mode===`edit`&&(0,J.jsx)(V,{disabled:n,onClick:()=>c(l.id),className:`mr-auto text-fail`,children:`Remove`}),(0,J.jsx)(V,{onClick:()=>t(null),children:`Cancel`}),(0,J.jsx)(V,{variant:`primary`,disabled:n||!!p||f.length>0||!l?.where.trim(),onClick:()=>e&&s(e),children:n?`Saving…`:e?.mode===`add`?`Add vault`:`Save vault`})]}),children:e&&l&&(0,J.jsxs)(J.Fragment,{children:[(0,J.jsx)(H,{label:`Provider`,htmlFor:`vt-provider`,className:`mt-4`,stacked:!0,children:(0,J.jsx)(ln,{id:`vt-provider`,value:l.provider,disabled:e.mode===`edit`,onChange:e=>d({provider:e.target.value,where:``,keys:void 0,profile:void 0}),children:FO.map(e=>(0,J.jsx)(`option`,{value:e.id,children:e.label},e.id))})}),e.mode===`add`&&(0,J.jsx)(H,{label:`Name`,help:p?(0,J.jsx)(`span`,{className:`text-fail`,children:p}):`What this project calls it.`,htmlFor:`vt-id`,stacked:!0,children:(0,J.jsx)(R,{id:`vt-id`,value:l.id,spellCheck:!1,maxLength:40,placeholder:`qa-kv`,"aria-invalid":!!p,onChange:e=>d({id:e.target.value.toLowerCase().replace(/[^a-z0-9-]/g,`-`)}),className:`font-mono`})}),(0,J.jsx)(H,{label:u.where,help:u.whereHelp,htmlFor:`vt-where`,stacked:!0,children:(0,J.jsx)(R,{id:`vt-where`,value:l.where,spellCheck:!1,maxLength:64,placeholder:u.placeholder,onChange:e=>d({where:e.target.value.trim()}),className:`font-mono`})}),(0,J.jsx)(H,{label:`Sign in with`,help:l.auth===`cli`?`Your own account, in your browser: Sign in on the vault's row after you add it. The cloud's CLI keeps the sign-in and renews it; ForgeQE saves nothing.`:`For a computer with nobody to sign in, such as a build agent.`,htmlFor:`vt-auth`,stacked:!0,children:(0,J.jsxs)(ln,{id:`vt-auth`,value:l.auth,onChange:e=>d({auth:e.target.value,keys:e.target.value===`keys`?{...i[l.provider]}:void 0}),children:[(0,J.jsxs)(`option`,{value:`cli`,children:[u.cli,` (recommended)`]}),(0,J.jsx)(`option`,{value:`keys`,children:l.provider===`azure`?`A service principal's keys, saved as secrets (no browser)`:l.provider===`gcp`?`A service account's key, saved as a secret (no browser)`:`Access keys, saved as secrets (no browser)`})]})}),l.provider===`aws`&&l.auth===`cli`&&(0,J.jsx)(H,{label:`Profile (optional)`,help:`An SSO profile of ~/.aws/config (set one up once with aws configure sso). Empty: the default.`,htmlFor:`vt-profile`,stacked:!0,children:(0,J.jsx)(R,{id:`vt-profile`,value:l.profile||``,spellCheck:!1,maxLength:64,placeholder:`qa`,onChange:e=>d({profile:e.target.value.trim()||void 0}),className:`font-mono`})}),l.auth===`keys`&&Object.entries(i[l.provider]).map(([e,t])=>(0,J.jsx)(H,{label:IO[e]||e,help:(()=>{let n=l.keys?.[e]??t,r=PO(n);return r?(0,J.jsx)(`span`,{className:`text-fail`,children:r}):o?.includes(n)?(0,J.jsx)(`span`,{className:`text-warn`,children:`Not saved yet: add ${n} on the Saved tab.`}):`The secret that holds it, saved on the Saved tab as ${n}.`})(),htmlFor:`vt-${e}`,stacked:!0,children:(0,J.jsx)(R,{id:`vt-${e}`,"aria-invalid":!!PO(l.keys?.[e]??t),value:l.keys?.[e]??t,spellCheck:!1,maxLength:64,onChange:t=>d({keys:{...l.keys||i[l.provider],[e]:t.target.value.toUpperCase().replace(/[^A-Z0-9_]/g,`_`)}}),className:`font-mono`})},e))]})})}function HO({vault:e,onClose:t,taken:n,onPulled:r}){let[i,a]=(0,q.useState)(null),[o,s]=(0,q.useState)(``),[c,l]=(0,q.useState)(``),[u,d]=(0,q.useState)(null),[f,p]=(0,q.useState)(!1),[m,h]=(0,q.useState)(``),g=()=>{e&&(a(null),s(``),wt.names(e.id).then(a,e=>s(e.message)))};(0,q.useEffect)(()=>{d(null),l(``),h(``),g()},[e?.id]);let _=(i?.names||[]).filter(e=>e.toLowerCase().includes(c.trim().toLowerCase())),v=_.slice(0,200),y=u?PO(u.name):``,b=async()=>{if(e&&u){p(!0),h(``);try{r(await wt.pull({vault:e.id,secret:u.secret,name:u.name,...u.key.trim()?{key:u.key.trim()}:{}}),u.name,u.secret)}catch(e){h(e.message)}finally{p(!1)}}};return(0,J.jsxs)(yr,{open:!!e,onClose:t,wide:!0,title:e?`Secrets of ${e.id}`:`Secrets`,description:e?`The names in ${e.providerLabel} ${e.where}. Pick one to pull its value into your credential store under a variable's name; ForgeQE never shows the value.`:void 0,footer:(0,J.jsxs)(J.Fragment,{children:[m?(0,J.jsx)(`span`,{role:`alert`,className:`mr-auto self-center text-sm text-fail [overflow-wrap:anywhere]`,children:m}):(0,J.jsx)(`span`,{className:`mr-auto self-center text-sm text-muted`,children:u?y?`Needs a valid name`:`${u.secret} as ${u.name}`:``}),(0,J.jsx)(V,{onClick:t,children:`Cancel`}),(0,J.jsx)(V,{variant:`primary`,disabled:f||!u||!!y,onClick:()=>void b(),children:f?`Pulling…`:`Pull secret`})]}),children:[(0,J.jsxs)(`div`,{"aria-live":`polite`,children:[!i&&!o&&(0,J.jsx)(`p`,{role:`status`,className:`m-0 border-t border-line-soft py-6 text-sm text-muted`,children:`Reading the vault's names…`}),o&&(0,J.jsx)(`div`,{className:`mt-4`,children:(0,J.jsx)(fr,{error:o,reload:g})})]}),i&&(0,J.jsxs)(J.Fragment,{children:[(0,J.jsx)(H,{label:`Find`,htmlFor:`br-find`,className:`mt-4`,stacked:!0,children:(0,J.jsx)(R,{id:`br-find`,value:c,placeholder:`password`,onChange:e=>l(e.target.value)})}),!_.length&&(0,J.jsx)(`p`,{className:`m-0 border-t border-line-soft py-6 text-sm text-muted`,children:i.total?`None matches.`:`None yet: ForgeQE's sign-in can see no secret in this vault.`}),(0,J.jsx)(`ul`,{"aria-label":`Secrets in the vault`,className:`m-0 list-none p-0`,children:v.map(e=>{let t=u?.secret===e;return(0,J.jsxs)(`li`,{className:`border-t border-line-soft`,children:[(0,J.jsxs)(`label`,{className:`flex min-h-12 cursor-pointer items-center gap-4 py-2`,children:[(0,J.jsx)(`input`,{type:`radio`,name:`br-secret`,checked:t,onChange:()=>d({secret:e,name:e.toUpperCase().replace(/[^A-Z0-9_]/g,`_`).replace(/^([^A-Z])/,`S_$1`).slice(0,64),key:``})}),(0,J.jsx)(`span`,{className:`min-w-0 flex-1 font-mono text-[13px] [overflow-wrap:anywhere]`,children:e})]}),t&&u&&(0,J.jsxs)(`div`,{className:`mb-4 ml-8 flex flex-col gap-4 rounded-[12px] bg-surface-muted p-4`,children:[(0,J.jsx)(H,{label:`Save as`,help:y?(0,J.jsx)(`span`,{className:`text-fail`,children:y}):n.has(u.name)?`${u.name} is saved already: pulling replaces its value.`:`The variable agents and tests read it by.`,htmlFor:`br-name`,stacked:!0,className:`py-0`,children:(0,J.jsx)(R,{id:`br-name`,value:u.name,spellCheck:!1,maxLength:64,"aria-invalid":!!y,onChange:e=>d({...u,name:e.target.value.toUpperCase().replace(/[^A-Z0-9_]/g,`_`)}),className:`font-mono`})}),(0,J.jsx)(H,{label:`JSON field (optional)`,help:`When the secret holds JSON, the one field to keep, such as password.`,htmlFor:`br-key`,stacked:!0,className:`py-0`,children:(0,J.jsx)(R,{id:`br-key`,value:u.key,spellCheck:!1,maxLength:128,placeholder:`password`,onChange:e=>d({...u,key:e.target.value}),className:`font-mono`})})]})]},e)})}),(_.length>v.length||i.total>i.names.length)&&(0,J.jsx)(`p`,{className:`m-0 border-t border-line-soft pt-4 text-[13px] text-muted`,children:[_.length>v.length?`The first ${v.length} of ${_.length} are shown: find narrows them.`:``,i.total>i.names.length?`The first ${i.names.length.toLocaleString()} of the vault's names are listed.`:``].filter(Boolean).join(` `)})]})]})}function UO({s:e,onCancel:t,onClose:n}){let[r,i]=(0,q.useState)(!1),a=e.state===`running`,o=e.link&&/^https:\/\//.test(e.link)?e.link:void 0;return(0,J.jsxs)(`div`,{role:`status`,"aria-live":`polite`,className:`mb-4 flex flex-col gap-4 rounded-[12px] card border p-4`,children:[(0,J.jsxs)(`span`,{className:`text-sm font-medium`,children:[`Signing in to `,e.vault]}),(o||e.code)&&a&&(0,J.jsxs)(`div`,{className:`flex flex-wrap items-center gap-4`,children:[e.code&&(0,J.jsxs)(`span`,{className:`flex items-center gap-2`,children:[(0,J.jsx)(`span`,{className:`text-sm text-muted`,children:`Your code`}),(0,J.jsx)(`span`,{className:`rounded-[8px] border border-line bg-bg px-4 py-2 font-mono text-lg font-semibold tracking-[0.12em]`,children:e.code}),(0,J.jsxs)(V,{size:`sm`,"aria-label":`Copy the code`,onClick:()=>{navigator.clipboard?.writeText(e.code).then(()=>i(!0)),setTimeout(()=>i(!1),1500)},children:[(0,J.jsx)(I,{"aria-hidden":`true`}),r?`Copied`:`Copy`]})]}),o&&(0,J.jsxs)(`a`,{href:o,target:`_blank`,rel:`noreferrer noopener`,className:Ct({variant:`primary`,size:`sm`}),children:[(0,J.jsx)(we,{"aria-hidden":`true`}),`Open `,new URL(o).host]})]}),(0,J.jsxs)(`ul`,{className:`m-0 flex list-none flex-col gap-1 p-0 text-sm`,children:[e.lines.slice(-6).map((t,n)=>(0,J.jsx)(`li`,{className:L(`[overflow-wrap:anywhere]`,n===e.lines.slice(-6).length-1&&e.state===`done`?`text-pass`:n===e.lines.slice(-6).length-1&&e.state===`failed`?`text-fail`:`text-ink-2`),children:t},n)),a&&(0,J.jsx)(`li`,{className:`text-muted`,children:`Waiting for you to finish in the browser…`})]}),(0,J.jsx)(`div`,{children:a?(0,J.jsx)(V,{size:`sm`,onClick:t,children:`Cancel`}):(0,J.jsx)(V,{size:`sm`,onClick:n,children:`Close`})})]})}var WO={testmu:`TestMu AI`,browserstack:`BrowserStack`},GO={testmu:{provider:`testmu`,remote:{username_env:`LT_USERNAME`,access_key_env:`LT_ACCESS_KEY`}},browserstack:{provider:`browserstack`,remote:{username_env:`BROWSERSTACK_USERNAME`,access_key_env:`BROWSERSTACK_ACCESS_KEY`}}},KO=(...e)=>e.map(([e,t])=>({value:e,label:t})),qO={testmu:[{key:`type`,label:`Type`,type:`select`,default:`real`,options:KO([`real`,`Real device`],[`virtual`,`Emulator or simulator`])},{key:`platform`,label:`Platform`,type:`select`,default:`android`,options:KO([`android`,`Android`],[`ios`,`iOS`])},{key:`model`,label:`Device model`,help:`As TestMu AI names it.`,type:`text`,placeholder:`Galaxy S23`},{key:`os_version`,label:`OS version`,type:`text`,placeholder:`13`},{key:`enabled`,label:`Use in runs`,help:`Off: kept here, run only when a run names it.`,type:`switch`,default:!0}],browserstack:[{key:`platform`,label:`Platform`,type:`select`,default:`android`,options:KO([`android`,`Android`],[`ios`,`iOS`])},{key:`model`,label:`Device model`,help:`As BrowserStack names it. Real devices only.`,type:`text`,placeholder:`Google Pixel 7`},{key:`os_version`,label:`OS version`,type:`text`,placeholder:`13.0`},{key:`enabled`,label:`Use in runs`,help:`Off: kept here, run only when a run names it.`,type:`switch`,default:!0}]},JO=`Kept in your credential store; the file has only the variable's name. The same sign-in as its browsers.`,YO={testmu:[{key:`remote.username_env`,label:`TestMu AI user`,help:JO,type:`var`,default:`LT_USERNAME`},{key:`remote.access_key_env`,label:`TestMu AI key`,help:JO,type:`var`,default:`LT_ACCESS_KEY`},{key:`mobile.region`,label:`Region for devices`,type:`text`,placeholder:`us`}],browserstack:[{key:`remote.username_env`,label:`BrowserStack user`,help:JO,type:`var`,default:`BROWSERSTACK_USERNAME`},{key:`remote.access_key_env`,label:`BrowserStack key`,help:JO,type:`var`,default:`BROWSERSTACK_ACCESS_KEY`}]};function XO(e){return[e.type===`virtual`?e.platform===`ios`?`simulator`:`emulator`:`real device`,`${e.platform===`ios`?`iOS`:`Android`}${e.os_version?` ${String(e.os_version)}`:``}`,e.model,e.enabled===!1?`not in use`:``].filter(Boolean).map(String).join(` · `)}function ZO({grids:e,setGrids:t,paths:n,vars:r}){return(0,J.jsx)(J.Fragment,{children:[`testmu`,`browserstack`].map(i=>{let a=WO[i],o={value:e[i]??GO[i],set:n=>t({...e,[i]:n}),vars:r,file:n[i]};return(0,J.jsxs)(`div`,{children:[(0,J.jsx)(U,{help:(0,J.jsxs)(J.Fragment,{children:[`Kept in `,(0,J.jsx)(`code`,{className:`font-mono text-[13px]`,children:n[i]}),`, `,a,`'s own file`,e[i]?``:`, made when you add a device`,`. Its browsers and their devices are in the same file:`,` `,(0,J.jsxs)(`a`,{href:B(`settings`,`integrations`),children:[`Integrations → `,a]}),`.`]}),children:`${a} devices`}),(0,J.jsx)(Vo,{edit:o,base:[`mobile`,`devices`],defs:qO[i],noun:`${a} device`,placeholder:i===`testmu`?`galaxy-s23`:`pixel7`,start:i===`testmu`?{type:`real`,platform:`android`}:{platform:`android`},meta:XO}),(0,J.jsx)(Dn,{defs:YO[i],edit:o,base:[]})]},i)})})}var QO=(0,q.lazy)(()=>G(()=>import(`./Features-CIBbw6PG.js`).then(e=>({default:()=>(0,J.jsx)(e.Features,{embedded:!0})})),__vite__mapDeps([0,1,2,3,4]))),$O=(0,q.lazy)(()=>G(()=>import(`./WhatsNew-CwnRbDnd.js`).then(e=>({default:()=>(0,J.jsx)(e.WhatsNew,{embedded:!0})})),__vite__mapDeps([5,1,2,3]))),ek=[{id:`setup`,group:`Start`,icon:pt,label:`Set up`,file:``,intro:`The project folder ForgeQE works on, ForgeQE in it, and what this computer needs to run it.`},{id:`environments`,group:`General`,icon:x,label:`Environments`,file:``,intro:`Where the agents work, and the apps in each place. The active one is used unless a request names another.`},{id:`signins`,group:`General`,icon:m,label:`Sign-ins`,file:`forgeqe.yaml`,intro:`Logins for the apps the agents sign in to. Passwords go to your credential store; the model sees only a placeholder.`},{id:`secrets`,group:`General`,icon:Ze,label:`Secrets`,file:``,intro:`Every password, key and token ForgeQE keeps, by name, and the vaults it pulls them from: Azure Key Vault, Google Secret Manager and AWS Secrets Manager. Values go to your credential store; the agents see only the names.`},{id:`integrations`,group:`General`,icon:Be,label:`Integrations`,file:`forgeqe.yaml`,intro:`Test case systems and bugs (sources:), and remote browser grids (browser.providers).`},{id:`notifications`,group:`General`,icon:st,label:`Notifications`,file:`forgeqe.yaml`,intro:`Teams channels and email lists, and the events each one gets (notify:). Monitor alerts are set under Monitor.`},{id:`appearance`,group:`General`,icon:le,label:`Appearance`,file:`forgeqe.yaml`,intro:`The project's logo, name and colours in this web app, for everyone who opens it (theme:).`},{id:`voice`,group:`General`,icon:qe,label:`Voice`,file:``,intro:`Talk to ForgeQE's agents: speech set up on this computer, and the language you talk in. Speech never leaves this computer.`},{id:`models`,group:`AI`,icon:je,label:`Models`,file:`llms.json and forgeqe.yaml`,intro:`The models the agents use (llm:). Keys you type go to your credential store, never to a file.`},{id:`routing`,group:`AI`,icon:o,label:`Routing`,file:`forgeqe.yaml`,intro:`Which model each area of work and each agent gets (llm.routing, llm.routes, llm.agents).`},{id:`skills`,group:`AI`,icon:ae,label:`Skills`,file:`forgeqe.yaml`,intro:`What the agents know how to do: your test conventions, frameworks and apps, as folders with a SKILL.md, grouped by the agents that use them. Add your own for this project.`},{id:`prompts`,group:`AI`,icon:Ne,label:`Prompts`,file:``,intro:`The instructions each agent starts from, with the agents that use each. Edit one to change how that agent works in this project, or add your own prompt for the agents you choose.`},{id:`guardrails`,group:`AI`,icon:ye,label:`Guardrails`,file:`.forgeqe/guardrails`,intro:`Rules your agents follow in every chat and schedule: for every agent, or only the ones you choose.`},{id:`agents`,group:`AI`,icon:Te,label:`Agents`,file:`forgeqe.yaml`,intro:`What you call the agents, their instructions, where their knowledge and guardrails are, custom agents, and the tools they get.`},{id:`evidence`,group:`AI`,icon:ht,label:`Evidence`,file:`forgeqe.yaml`,intro:`What Evidence and the agents know about your product, in five steps: its repositories, where its requirements are searched, its documents, the product and its knowledge, and how the graph is built.`},{id:`mcp`,group:`AI`,icon:tt,label:`MCP servers`,file:`forgeqe.yaml`,intro:`More MCP servers whose tools ForgeQE's agent gets (mcp:). Each test case system's own server is set with it under Integrations.`},{id:`tests`,group:`Testing`,icon:fe,label:`Code`,file:`forgeqe.yaml`,intro:`Writing tests (code:): where passed runs become tests, how hard the coding agent tries, its time limits, and the help it gets.`},{id:`runs`,group:`Testing`,icon:Oe,label:`Reports and memory`,file:`forgeqe.yaml`,intro:`Where reports are exported (export:, report:), page memory and replays (memory:, registry:), suites, flaky tests, release readiness, defect analysis, and the project report (bi:).`},{id:`registry`,group:`Testing`,icon:g,label:`Replays`,file:`forgeqe.yaml`,intro:`Run a passed test again for free: ForgeQE repeats its saved steps without the AI.`},{id:`parallel`,group:`Testing`,icon:S,label:`Parallel execution`,file:`forgeqe.yaml`,intro:`How many browsers, scheduled runs and monitor checks go at once. Mobile devices at once are set under Mobile.`},{id:`browser`,group:`Testing`,icon:nt,label:`Browser`,file:`forgeqe.yaml`,intro:`How the browser agent runs: where, how it looks, and how long it may take.`},{id:`monitor`,group:`Testing`,icon:v,label:`Monitor`,file:`forgeqe.yaml`,intro:`Checks that run on a schedule, and the alerts when one starts failing, keeps failing, or recovers.`},{id:`mobile`,group:`Testing`,icon:oe,label:`Mobile`,file:`forgeqe.yaml and the clouds' files`,intro:`How Android and iOS apps run (mobile:): Appium or Maestro, on several devices at once, on this machine or a device cloud such as TestMu AI. The apps themselves are in Environments.`},{id:`desktop`,group:`Testing`,icon:Fe,label:`Desktop`,file:`forgeqe.yaml`,intro:`How Windows desktop apps replay (desktop:). The apps themselves are in Environments.`},{id:`containers`,group:`Testing`,icon:y,label:`Containers`,file:`forgeqe.yaml`,intro:`Services for test runs in Docker or Podman (containers:): databases, queues, the API under test, mocks, and the images tests and agents run in.`},{id:`databases`,group:`Testing`,icon:e,label:`Databases`,file:`forgeqe.yaml`,intro:`Databases the agent may read, and write to after you confirm (databases:), for questions, test data and data flows. An environment can add its own.`},{id:`quality`,group:`Testing`,icon:ie,label:`Quality`,file:`forgeqe.yaml`,intro:`Accessibility, performance, visual and API checks on every page a run visits.`},{id:`logs`,group:`Activity`,icon:pe,label:`Logs`,file:``,intro:`A log of each chat, run and suite on this machine, for finding out what happened.`},{id:`audit`,group:`Activity`,icon:D,label:`Audit`,file:``,intro:`What ForgeQE did and what went wrong: sessions, tool and model calls, runs and errors, and who changed which setting.`},{id:`tokenomics`,group:`Activity`,icon:p,label:`Tokenomics`,file:`forgeqe.yaml`,intro:`Where the tokens and money went, from this project's reports, and the budgets that warn before they run out.`},{id:`generated`,group:`Activity`,icon:N,label:`Generated code`,file:``,intro:`How much of the code ForgeQE wrote in the repository is still there, by run (forgeqe generated).`},{id:`files`,group:`Advanced`,icon:Pe,label:`Settings as text`,file:``,intro:`forgeqe.yaml, llms.json and env.yaml as they are on disk, for anything the form does not have.`},{id:`report`,group:`Advanced`,icon:gt,label:`Report a problem`,file:``,intro:`Tell the ForgeQE team about a problem in ForgeQE. It drafts the bug with you, shows everything it will send, and files it in their Azure DevOps.`},{id:`features`,group:`Advanced`,icon:Ge,label:`What's ready`,file:``,intro:`What ForgeQE can do here. Pick one to see what it needs.`},{id:`whats-new`,group:`Advanced`,icon:T,label:`What's new`,file:``,intro:`What each release of ForgeQE added, improved and fixed. Pick a change to read more.`},{id:`about`,group:`Advanced`,icon:ve,label:`About ForgeQE`,file:``,intro:`The version of ForgeQE on this computer, updating it, and its guides.`}],tk=[`guardrails`,`skills`,`prompts`],nk=ek.filter(e=>!tk.includes(e.id)),rk=[...new Set(nk.map(e=>e.group))],ik=[`setup`,`environments`,`signins`,`secrets`,`integrations`,`notifications`,`appearance`,`voice`,`models`,`databases`,`features`,`whats-new`,`report`,`about`],ak=`forgeqe-settings-more`,ok={config:`forgeqe.yaml`,models:`llms.json`,environments:`the environment files`,guardrails:`guardrails.md`,grids:`the browser grid files`,secrets:`keys and passwords`};function sk(e,t){let n=e.paths.base.replace(/(?<![\\/])[\\/]+$/,``);return t.startsWith(`${n}/`)||t.startsWith(`${n}\\`)?`./${t.slice(n.length+1).replace(/\\/g,`/`)}`:t}function ck(e){return{config:e.config,models:e.models,environments:e.environments,guardrails:e.guardrails.filter(e=>e.editable).map(e=>e.text),grids:{browserstack:e.grids.browserstack.linked?e.grids.browserstack.value:null,testmu:e.grids.testmu.linked?e.grids.testmu.value:null},secrets:{}}}var lk={local:`This computer`,browserstack:`BrowserStack`,testmu:`TestMu AI`};function uk(e){let t=lk[String(e.runs_on??`local`)]??String(e.runs_on),n=e.type===`real`||e.type===void 0&&e.runs_on!==void 0&&e.runs_on!==`local`?`real device`:e.platform===`ios`?`simulator`:`emulator`,r=`${e.platform===`ios`?`iOS`:`Android`}${e.os_version?` ${String(e.os_version)}`:``}`;return[`${t}, ${n}`,r,e.model||e.udid,e.enabled===!1?`not in use`:``].filter(Boolean).map(String).join(` · `)}var dk=[{id:`setup`,label:`Set up`},{id:`models`,label:`Models`},{id:`evidence`,label:`Product knowledge`},{id:`appearance`,label:`Appearance`}],fk=e=>dk.find(t=>t.id===e)?.id??`setup`;function pk({section:e,only:t,guide:n}){let r=n===void 0?void 0:fk(n),i=r??t??e,[a,o]=(0,q.useState)(null),[s,c]=(0,q.useState)(null),[l,u]=(0,q.useState)(``),[d,p]=(0,q.useState)(``),[m,h]=(0,q.useState)(``),[g,_]=(0,q.useState)(!1),[v,y]=(0,q.useState)(!1),[b,x]=(0,q.useState)(null),S=(0,q.useCallback)(()=>{u(``),Yt.settings().then(e=>{o(e),c(ck(e))},e=>u(e.message))},[]),C=(0,q.useCallback)(()=>{u(``),Rt.state().then(e=>{x(e),e.ready&&S()},e=>u(e.message))},[S]);(0,q.useEffect)(C,[C]);let w=e=>{e.project===b?.project&&e.ready||(o(null),c(null)),x(e),e.ready&&S()},T=!!b?.ready,[E,D]=(0,q.useState)(null),[O,ee]=(0,q.useState)(!1),[te,ne]=(0,q.useState)(!1),[k,A]=(0,q.useState)(``),j=(0,q.useCallback)(async()=>{if(!(await Rt.state()).ready)return!1;let e=await Rt.machine();return e.engine&&e.runtime},[]);(0,q.useEffect)(()=>{r!==void 0&&St.status().then(e=>{D(e.state),ee(!0)},()=>ee(!0))},[r]),(0,q.useEffect)(()=>{r!==void 0&&j().then(ne,()=>ne(!1))},[r,b,j]),(0,q.useEffect)(()=>A(``),[r]),(0,q.useEffect)(()=>{if(r!==`setup`||te)return;let e=setInterval(()=>void j().then(ne,()=>{}),2500);return()=>clearInterval(e)},[r,te,j]);let M=async(e,t)=>{A(``);try{if(e===`done`){await St.save({done:!0,step:`done`,...t?{skip:t}:{}}),location.hash=B();return}let n=await St.save({step:e,...t?{skip:t}:{}});D(n.state),location.hash=B(`welcome`,e)}catch(e){A(e.message)}},re=async()=>{if(await j().catch(()=>!1))return M(`done`);r!==`setup`&&(location.hash=B(`welcome`,`setup`)),A(`Set up is the one step that cannot be skipped: ForgeQE needs it to run. Once it is done, you can leave onboarding.`)};(0,q.useEffect)(()=>{r===void 0?b&&!T&&i!==`setup`?location.replace(B(`settings`,`setup`)):!t&&i&&tk.includes(i)&&location.replace(B(i)):r!==`setup`&&b&&!T&&location.replace(B(`welcome`,`setup`))},[b,T,i]);let N=(b&&!T?ek[0]:ek.find(e=>e.id===(i===`repo-tokens`?`secrets`:i)))||ek.find(e=>e.id===`models`),[ie,ae]=(0,q.useState)(()=>{try{return localStorage.getItem(ak)===`open`}catch{return!1}}),oe=e=>{ae(e);try{localStorage.setItem(ak,e?`open`:`closed`)}catch{}};(0,q.useEffect)(()=>{h(``),p(``),y(!1)},[N.id]);let P=a?ck(a):null,ce=e=>!!s&&!!P&&!Si(s[e],P[e]),le=Object.keys(ok).filter(ce);(0,q.useEffect)(()=>{if(!le.length)return;let e=e=>e.preventDefault();return window.addEventListener(`beforeunload`,e),()=>window.removeEventListener(`beforeunload`,e)},[le.length]);let F=e=>({value:s[e],set:t=>{h(``),c(n=>({...n,[e]:t}))},vars:a.variables,...e===`config`?{file:`forgeqe.yaml`}:{}}),ue=(0,q.useRef)(s);ue.current=s;let de=(0,q.useRef)(a);de.current=a;let[fe,pe]=(0,q.useState)(``),me=(0,q.useRef)({}),he=(0,q.useCallback)((e,t)=>{let n=me.current,r=Object.keys(n).find(t=>n[t]===e)??e;r===t?delete n[r]:n[r]=t},[]),ge=(0,q.useCallback)(async()=>{let e=ue.current,t=de.current;if(!e||!t)return;let n=ck(t),r=Object.keys(ok).filter(t=>!Si(e[t],n[t]));if(!r.length)return;_(!0),p(``),y(!1);let i=t,a=(t,n)=>c(r=>{if(!r)return r;let i=ck(t),a={...r};for(let t of Object.keys(ok))if(t===`secrets`){if(!n)continue;a.secrets=Object.fromEntries(Object.entries(r.secrets).filter(([t,n])=>e.secrets[t]!==n))}else(n?Si(r[t],e[t]):Si(r[t],i[t]))&&(a[t]=i[t]);return a});try{for(let a of r)if(a===`secrets`)i=await Yt.saveSecrets(e.secrets);else if(a===`grids`)for(let[r,a]of Object.entries(e.grids))a&&!Si(a,n.grids[r])&&(i=await Yt.saveGrid(r,a,t.versions[`grid:${r}`]));else if(a===`models`){let r=n.models.models,o=e.models.models,s=Object.fromEntries(Object.entries(me.current).filter(([e,t])=>r&&o&&e in r&&!(e in o)&&t in o));i=await Yt.save(a,e[a],t.versions[a],s),me.current={}}else i=a===`guardrails`?await Yt.saveGuardrails(e.guardrails,t.versions.guardrails):await Yt.save(a,e[a],t.versions[a]);o(i),a(i,!0),pe(``),h(`Saved`)}catch(n){p(n.message),y(n instanceof Lt&&n.status===409),pe(JSON.stringify(e)),i!==t&&(o(i),a(i,!1))}finally{_(!1)}},[]);(0,q.useEffect)(()=>{if(!m)return;let e=setTimeout(()=>h(``),4e3);return()=>clearTimeout(e)},[m]);let _e=s?JSON.stringify(s):``;(0,q.useEffect)(()=>{if(!le.length||g||v||fe&&fe===_e)return;let e=le.every(e=>e===`secrets`),t=setTimeout(ge,e?2e3:1e3);return()=>clearTimeout(t)},[_e,g,v,fe]);let ve=async()=>{p(``);try{let e=await Yt.splitEnvironments();o(e),c(ck(e)),h(`Each environment is now its own file in environments/. The old file is left as it is; ForgeQE no longer reads it.`)}catch(e){p(e.message)}},ye=async(e,t,n)=>{p(``);try{let r=await Yt.saveText(e,t,n,a?.versions[e]);return o(r),c(ck(r)),h(`Saved ${ok[e]}.`),!0}catch(e){return p(e.message),!1}},I=null;if(N.id===`setup`)I=b&&(0,J.jsx)(sD,{state:b,onState:w,guide:r!==void 0});else if(a&&s){let e=(N.id===`models`||N.id===`routing`?[`models`,`config`]:N.id===`environments`?[`environments`,`config`]:[`files`,`guardrails`,`prompts`,`logs`,`audit`,`generated`,`about`,`report`,`features`,`whats-new`].includes(N.id)?[]:[`config`]).find(e=>a.errors[e]);switch(N.id){case`models`:I=(0,J.jsx)(ET,{config:F(`config`),models:F(`models`),vars:a.variables,onReload:S,onRename:he});break;case`environments`:I=(0,J.jsx)(oT,{envs:F(`environments`),layout:a.paths.environments,files:a.raw.environments,base:a.paths.base,onSplit:ve,config:F(`config`),splitBlocked:ce(`environments`)||ce(`config`)?`Save or discard your changes to the environments and forgeqe.yaml first.`:``});break;case`browser`:I=(0,J.jsx)(Do,{groups:PT,edit:F(`config`)});break;case`appearance`:I=(0,J.jsx)(iO,{config:F(`config`)});break;case`voice`:I=(0,J.jsx)(lO,{});break;case`routing`:I=(0,J.jsx)(MT,{config:F(`config`),models:F(`models`)});break;case`generated`:I=(0,J.jsx)(CD,{});break;case`about`:I=(0,J.jsx)(bD,{});break;case`features`:case`whats-new`:I=(0,J.jsx)(q.Suspense,{fallback:(0,J.jsx)(`p`,{className:`m-0 text-sm text-muted`,children:`Opening…`}),children:N.id===`features`?(0,J.jsx)(QO,{}):(0,J.jsx)($O,{})});break;case`report`:I=(0,J.jsx)(AD,{});break;case`notifications`:case`mcp`:I=(0,J.jsxs)(J.Fragment,{children:[(0,J.jsx)(SE,{view:N.id,edit:F(`config`),grids:s.grids,setGrids:e=>c(t=>({...t,grids:e})),gridPaths:{browserstack:sk(a,a.grids.browserstack.file),testmu:sk(a,a.grids.testmu.file)}}),N.id===`notifications`&&(0,J.jsx)(xD,{})]});break;case`parallel`:I=(0,J.jsx)(Do,{groups:YT,edit:F(`config`)});break;case`mobile`:I=(0,J.jsxs)(J.Fragment,{children:[(0,J.jsx)(Do,{groups:XT,edit:F(`config`)}),(0,J.jsx)(U,{help:`Phones, tablets, emulators and simulators connected to this computer. Every device in use, here and on the clouds below, runs each replay and set of Maestro flows; ForgeQE sets up Appium, Maestro and the cloud for each.`,children:`Devices on this computer`}),(0,J.jsx)(Vo,{edit:F(`config`),base:[`mobile`,`devices`],defs:QT,noun:`device`,placeholder:`pixel8`,start:{type:`virtual`,platform:`android`},meta:uk}),(0,J.jsx)(ZO,{grids:s.grids,setGrids:e=>{h(``),c(t=>({...t,grids:e}))},paths:{browserstack:sk(a,a.grids.browserstack.file),testmu:sk(a,a.grids.testmu.file)},vars:a.variables}),(0,J.jsx)(Do,{groups:$T,edit:F(`config`),continued:!0})]});break;case`desktop`:I=(0,J.jsx)(Do,{groups:eE,edit:F(`config`)});break;case`containers`:I=(0,J.jsxs)(J.Fragment,{children:[(0,J.jsx)(Do,{groups:tE.slice(0,1),edit:F(`config`)}),(0,J.jsx)(U,{help:`Each one ForgeQE may start, stop and read: a database, a queue, the API under test.`,children:`Services`}),(0,J.jsx)(Vo,{edit:F(`config`),base:[`containers`,`services`],defs:iE,noun:`service`,placeholder:`db`,meta:e=>[e.image,Array.isArray(e.ports)?`ports ${e.ports.join(`, `)}`:``].filter(Boolean).map(String).join(`, `)}),(0,J.jsx)(Do,{groups:tE.slice(1),edit:F(`config`),continued:!0})]});break;case`databases`:I=(0,J.jsx)(Vo,{edit:F(`config`),base:[`databases`],defs:aE,noun:`database`,placeholder:`orders`,meta:e=>[e.description,e.engine,e.url_env?`from ${e.url_env}`:e.host,e.writable?`writable`:`read only`].filter(Boolean).map(String).join(`, `)});break;case`signins`:I=(0,J.jsx)(No,{edit:F(`config`)});break;case`secrets`:I=(0,J.jsx)(zO,{show:i===`repo-tokens`?`tokens`:void 0});break;case`integrations`:I=(0,J.jsx)(SE,{edit:F(`config`),grids:s.grids,setGrids:e=>{h(``),c(t=>({...t,grids:e}))},gridPaths:{browserstack:sk(a,a.grids.browserstack.file),testmu:sk(a,a.grids.testmu.file)}});break;case`tests`:I=(0,J.jsx)(Do,{groups:FT,edit:F(`config`)});break;case`runs`:I=(0,J.jsxs)(J.Fragment,{children:[(0,J.jsx)(Do,{groups:IT,edit:F(`config`)}),(0,J.jsx)(Do,{groups:qT,edit:F(`config`),continued:!0}),(0,J.jsx)(U,{help:`Each one a table of the project report: forgeqe.<name>.`,children:`Report datasets`}),(0,J.jsx)(Vo,{edit:F(`config`),base:[`bi`,`datasets`],defs:JT,noun:`dataset`,placeholder:`open_bugs`,meta:e=>[e.title,e.kind===`jira_jql`?`Jira`:e.kind===`ado_wiql`?`Azure DevOps`:``].filter(Boolean).map(String).join(`, `)})]});break;case`quality`:I=(0,J.jsx)(Do,{groups:LT,edit:F(`config`)});break;case`evidence`:I=(0,J.jsxs)(J.Fragment,{children:[(0,J.jsx)(xO,{edit:F(`config`)}),(0,J.jsx)(SD,{})]});break;case`agents`:I=(0,J.jsxs)(J.Fragment,{children:[(0,J.jsx)(Do,{groups:UT,edit:F(`config`)}),(0,J.jsx)(jD,{config:F(`config`)})]});break;case`guardrails`:I=(0,J.jsx)(ME,{rules:s.guardrails,others:a.guardrails.filter(e=>!e.editable),onChange:e=>c({...s,guardrails:e}),onChanged:e=>(h(e),Yt.settings().then(o,()=>{}))});break;case`monitor`:I=(0,J.jsx)(kE,{edit:F(`config`)});break;case`skills`:I=(0,J.jsx)(Uw,{edit:F(`config`)});break;case`prompts`:I=(0,J.jsx)(Bw,{onChanged:h});break;case`registry`:I=(0,J.jsx)(Nn,{edit:F(`config`)});break;case`logs`:I=(0,J.jsx)(Fn,{});break;case`audit`:I=(0,J.jsx)(lr,{});break;case`tokenomics`:I=(0,J.jsx)(wn,{edit:F(`config`)});break;case`files`:I=(0,J.jsx)(zo,{snap:a,dirty:{config:ce(`config`),models:ce(`models`),environments:ce(`environments`)},onSave:ye})}e&&(I=(0,J.jsxs)(`p`,{role:`alert`,className:`m-0 rounded-[12px] bg-fail-soft px-4 py-4 text-sm leading-relaxed text-fail`,children:[e===`environments`?`An environment file`:ok[e],` does not parse, so the form cannot show it: `,a.errors[e],`. Fix it in `,(0,J.jsx)(`a`,{href:B(`settings`,`files`),children:`Settings as text`}),`.`]}))}let be=d?(0,J.jsxs)(`div`,{role:`alert`,className:`flex w-full flex-wrap items-center gap-4 rounded-[14px] border border-fail-soft bg-fail-soft px-4 py-4 text-sm leading-relaxed text-fail shadow-composer`,children:[(0,J.jsx)(`span`,{className:`flex-[1_1_260px] [overflow-wrap:anywhere]`,children:d}),v?(0,J.jsxs)(V,{size:`sm`,onClick:()=>{y(!1),p(``),pe(``),C()},"data-tip":`Reload, and lose my unsaved changes`,children:[(0,J.jsx)(f,{"aria-hidden":`true`}),`Reload`]}):(0,J.jsxs)(`span`,{className:`flex gap-2`,children:[le.length>0&&(0,J.jsxs)(V,{size:`sm`,onClick:()=>{c(P),me.current={},p(``),pe(``)},"data-tip":`Undo my change`,children:[(0,J.jsx)(Ee,{"aria-hidden":`true`}),`Undo`]}),(0,J.jsxs)(V,{size:`sm`,onClick:()=>{p(``),pe(``),ge()},children:[(0,J.jsx)(se,{"aria-hidden":`true`}),`Retry`]})]})]}):null,xe={pending:s?.secrets||{},set:(e,t)=>{h(``),c(n=>{let r={...n.secrets};return t===void 0?delete r[e]:r[e]=t,{...n,secrets:r}})},saved:new Set(a?.saved||[]),vars:a?.variables||{},store:a?.store||`the credential store`};return(0,J.jsx)(Jn.Provider,{value:xe,children:(0,J.jsxs)(`div`,{className:`settings-fields flex min-h-(--screen) flex-col`,children:[(0,J.jsx)(ii,{}),(0,J.jsxs)(`main`,{className:L(`box-border flex w-full flex-auto flex-col items-stretch sm:flex-row sm:items-start`,t&&`mx-auto box-border flex w-full max-w-[1320px] flex-col px-6 pt-8 pb-10 md:px-12 short:pt-6 short:pb-6`),children:[(0,J.jsx)(`div`,{className:L(`theme-side theme-side--wide w-full flex-col gap-4 border-line px-4 pt-6 pb-4 sm:sticky sm:top-0 sm:h-(--screen) sm:w-[248px] sm:flex-none sm:overflow-y-auto sm:border-r sm:bg-surface-muted`,t?`hidden`:`flex`),children:r===void 0?(0,J.jsxs)(J.Fragment,{children:[(0,J.jsxs)(`a`,{href:B(),className:`inline-flex min-h-9 items-center gap-2 self-start rounded-[8px] px-2 text-[13px] font-medium text-ink-2 no-underline hover:bg-surface-strong hover:text-ink`,children:[(0,J.jsx)(Se,{size:16,"aria-hidden":`true`}),`Back`]}),(0,J.jsx)(`p`,{className:`m-0 px-2 pt-1 text-[16px] font-semibold`,children:`Settings`}),(0,J.jsx)(vk,{ready:T}),(0,J.jsx)(`label`,{htmlFor:`section-pick`,className:`sr-only`,children:`Section`}),(0,J.jsx)(ln,{id:`section-pick`,value:N.id,onChange:e=>location.hash=B(`settings`,e.target.value),className:`sm:hidden`,children:rk.map(e=>(0,J.jsx)(`optgroup`,{label:e,children:nk.filter(t=>t.group===e).map(e=>(0,J.jsx)(`option`,{value:e.id,disabled:!T&&e.id!==`setup`,children:e.label},e.id))},e))}),(0,J.jsxs)(`nav`,{"aria-label":`Settings sections`,className:`hidden flex-col gap-4 sm:flex`,children:[(0,J.jsx)(gk,{sections:nk.filter(e=>ik.includes(e.id)),current:N.id,locked:!!b&&!T}),(0,J.jsx)(_k,{open:ie||!ik.includes(N.id),onToggle:()=>oe(!ie),children:(0,J.jsx)(gk,{sections:nk.filter(e=>!ik.includes(e.id)),current:N.id,locked:!!b&&!T})})]})]}):(0,J.jsx)(hk,{step:r,skipped:E?.skipped??[],open:te,onSkip:()=>void re()})}),(0,J.jsxs)(`section`,{"aria-labelledby":`sec-h`,className:L(`flex min-w-0 flex-1 flex-col`,!t&&`mx-auto box-border flex w-full max-w-[1320px] flex-col px-6 pt-8 pb-10 md:px-12 short:pt-6 short:pb-6`),children:[t?(0,J.jsxs)(`div`,{className:`mb-1 flex items-center gap-4`,children:[(0,J.jsx)(Pr,{icon:N.icon,pixel:Nr[N.id],size:`lg`}),(0,J.jsx)(`h1`,{id:`sec-h`,className:`m-0 text-[25px] font-semibold tracking-[-0.01em]`,children:N.label})]}):(0,J.jsxs)(`h1`,{id:`sec-h`,className:`m-0 mb-2 flex items-center gap-4 text-[25px] leading-tight font-semibold tracking-[-0.01em]`,children:[(0,J.jsx)(Zt,{icon:N.icon,size:22,className:`flex-none text-muted`}),N.label]}),(0,J.jsxs)(`p`,{className:`mt-0 mb-10 text-[13px] leading-relaxed text-ink-2`,children:[N.intro,N.file&&a&&(0,J.jsxs)(J.Fragment,{children:[` `,`Saved in `,(0,J.jsx)(`span`,{className:`font-mono text-[13px]`,children:N.file}),`.`]})]}),l&&(0,J.jsxs)(`div`,{role:`alert`,className:`flex flex-col items-start gap-4 border-t border-line pt-6`,children:[(0,J.jsx)(`p`,{className:`m-0 leading-relaxed text-ink-2`,children:l}),(0,J.jsxs)(V,{size:`sm`,onClick:C,children:[(0,J.jsx)(se,{"aria-hidden":`true`}),`Retry`]})]}),b&&!T&&(0,J.jsxs)(`p`,{className:`mt-0 mb-6 flex items-start gap-2 rounded-[12px] bg-surface-muted px-4 py-4 text-sm leading-relaxed text-ink-2`,children:[(0,J.jsx)(Ze,{size:16,"aria-hidden":`true`,className:`mt-1 flex-none`}),`The other sections open once ForgeQE is set up in a project folder: choose the folder, then Set up.`]}),!l&&(!b||N.id!==`setup`&&!a)&&(0,J.jsx)(`p`,{role:`status`,className:`m-0 text-sm text-muted`,children:`Loading settings…`}),(0,J.jsx)(`div`,{"data-tour":`section`,className:`flex flex-col`,children:I}),r!==void 0&&b&&O&&(0,J.jsx)($E,{welcome:E===null||XE(),onStart:mk,step:r,ready:T,coreReady:te,onGo:(e,t)=>void M(e,t),onSkipAll:()=>void re(),onFinish:()=>void M(`done`),note:k},r),(0,J.jsxs)(`div`,{className:`sticky bottom-4 z-10 mt-8 flex flex-col items-end gap-2`,children:[be,(0,J.jsx)(`div`,{"aria-live":`polite`,className:`contents`,children:!d&&(le.length>0||g||m)&&(0,J.jsx)(`span`,{className:L(`inline-flex min-h-9 items-center gap-2 rounded-full border border-line bg-bg px-4 text-[13px] shadow-composer`,le.length||g?`text-ink-2`:`text-pass`),children:le.length||g?(0,J.jsxs)(J.Fragment,{children:[(0,J.jsx)($t,{state:`working`,px:16}),`Saving…`]}):(0,J.jsxs)(J.Fragment,{children:[(0,J.jsx)(dt,{size:14,"aria-hidden":`true`}),m]})})})]})]})]})]})})}var mk=()=>{ZE(),St.save({step:`setup`}).catch(()=>{})};function hk({step:e,skipped:t,open:n,onSkip:r}){let i=dk.findIndex(t=>t.id===e);return(0,J.jsxs)(J.Fragment,{children:[(0,J.jsx)(`p`,{className:`m-0 px-2 pt-1 text-[16px] font-semibold`,children:`Getting started`}),(0,J.jsx)(`p`,{className:`m-0 px-2 text-[13px] leading-relaxed text-ink-2`,children:`A few steps to start. Everything but Set up can be skipped and changed later in Settings.`}),(0,J.jsx)(`nav`,{"aria-label":`Onboarding steps`,children:(0,J.jsx)(`ol`,{className:`m-0 flex list-none flex-col gap-px p-0`,children:dk.map((r,a)=>{let o=ek.find(e=>e.id===r.id),s=a>0&&!n,c=r.id===e,l=a<i&&!t.includes(r.id);return(0,J.jsx)(`li`,{children:s?(0,J.jsxs)(`span`,{"aria-disabled":`true`,"data-tip":`After Set up`,className:`flex min-h-8 cursor-not-allowed items-center gap-2 rounded-[7px] px-2 text-[13px] text-muted opacity-60`,children:[(0,J.jsx)(Zt,{icon:o.icon,size:16,className:`flex-none`}),(0,J.jsx)(`span`,{className:`flex-1`,children:r.label}),(0,J.jsx)(Ze,{size:13,"aria-label":`Locked`,className:`flex-none`})]}):(0,J.jsxs)(`a`,{href:B(`welcome`,r.id),"aria-current":c?`step`:void 0,className:L(`group flex min-h-8 items-center gap-2 rounded-[7px] px-2 text-[13px] no-underline`,c?`bg-surface-strong font-medium text-ink hover:text-ink`:`text-ink-2 hover:bg-surface-strong hover:text-ink`),children:[(0,J.jsx)(Zt,{icon:o.icon,size:16,className:L(`flex-none`,c?`text-ink`:`text-muted group-hover:text-ink`)}),(0,J.jsx)(`span`,{className:`flex-1`,children:r.label}),l&&(0,J.jsx)(dt,{size:13,"aria-label":`Done`,className:`flex-none text-pass`}),t.includes(r.id)&&!c&&(0,J.jsx)(`span`,{className:`text-[13px] text-muted`,children:`Skipped`})]})},r.id)})})}),(0,J.jsxs)(`button`,{type:`button`,onClick:r,className:`inline-flex min-h-8 cursor-pointer items-center gap-2 self-start rounded-[7px] border-0 bg-transparent px-2 text-[13px] text-ink-2 hover:bg-surface-strong hover:text-ink`,children:[(0,J.jsx)(A,{size:14,"aria-hidden":`true`}),`Skip onboarding`]})]})}function gk({sections:e,current:t,locked:n}){let r=[...new Set(e.map(e=>e.group))];return(0,J.jsx)(J.Fragment,{children:r.map(r=>{let i=`group-${r}-${e[0]?.id}`;return(0,J.jsxs)(`div`,{role:`group`,"aria-labelledby":i,className:`flex flex-col gap-px`,children:[(0,J.jsx)(`span`,{id:i,className:`px-2 pt-1 pb-1 text-[13px] font-medium text-muted`,children:r}),e.filter(e=>e.group===r).map(e=>n&&e.id!==`setup`?(0,J.jsxs)(`span`,{"aria-disabled":`true`,"data-tip":`Set up ForgeQE in a project folder first`,className:`flex min-h-8 cursor-not-allowed items-center gap-2 rounded-[7px] px-2 text-[13px] text-muted opacity-60`,children:[(0,J.jsx)(Zt,{icon:e.icon,size:16,className:`flex-none`}),(0,J.jsx)(`span`,{className:`flex-1`,children:e.label}),(0,J.jsx)(Ze,{size:13,"aria-label":`Locked`,className:`flex-none`})]},e.id):(0,J.jsxs)(`a`,{href:B(`settings`,e.id),"aria-current":t===e.id?`page`:void 0,className:L(`group flex min-h-8 items-center gap-2 rounded-[7px] px-2 text-[13px] no-underline`,t===e.id?`bg-surface-strong font-medium text-ink hover:text-ink`:`text-ink-2 hover:bg-surface-strong hover:text-ink`),children:[(0,J.jsx)(Zt,{icon:e.icon,size:16,className:L(`flex-none`,t===e.id?`text-ink`:`text-muted group-hover:text-ink`)}),e.label]},e.id))]},r)})})}function _k({open:e,onToggle:t,children:n}){return(0,J.jsxs)(`div`,{className:`flex flex-col gap-4 border-t border-line-soft pt-2`,children:[(0,J.jsxs)(`button`,{type:`button`,"aria-expanded":e,"aria-controls":`settings-more`,onClick:t,className:`flex h-7 cursor-pointer items-center gap-1 rounded-[6px] border-0 bg-transparent px-2 text-left text-[13px] font-medium text-muted hover:text-ink`,children:[(0,J.jsx)(`span`,{className:`flex-1`,children:`More settings`}),(0,J.jsx)(M,{size:14,strokeWidth:2,"aria-hidden":`true`,className:L(`flex-none transition-transform duration-200`,e&&`rotate-90`)})]}),(0,J.jsx)(kn,{open:e,id:`settings-more`,children:(0,J.jsx)(`div`,{className:`flex flex-col gap-4`,children:n})})]})}function vk({ready:e}){let[t,n]=(0,q.useState)(``),r=t.toLowerCase().split(/\s+/).filter(Boolean),i=e=>ek.find(t=>t.id===e)?.label||e,a=r.length?LE.filter(e=>r.every(t=>`${e.label} ${e.key} ${i(e.section)}`.toLowerCase().includes(t))).slice(0,12):[];return(0,J.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,J.jsx)(`label`,{htmlFor:`find-setting`,className:`sr-only`,children:`Find a setting`}),(0,J.jsx)(R,{size:`sm`,id:`find-setting`,type:`search`,value:t,disabled:!e,placeholder:`Search settings`,className:`bg-bg`,"data-tip":`By its name or its forgeqe.yaml key: max attempts, memory.dir`,onChange:e=>n(e.target.value)}),r.length>0&&(0,J.jsxs)(`ul`,{"aria-label":`Settings found`,className:`m-0 flex list-none flex-col p-0`,children:[a.length===0&&(0,J.jsx)(`li`,{className:`px-2 py-2 text-[13px] text-muted`,children:`Nothing called that. Every key can also be edited in Settings as text.`}),a.map(e=>(0,J.jsx)(`li`,{children:(0,J.jsxs)(`a`,{href:B(`settings`,e.section),onClick:()=>n(``),className:`flex flex-col rounded-[10px] px-2 py-2 text-ink no-underline hover:bg-surface-muted hover:text-ink`,children:[(0,J.jsx)(`span`,{className:`text-sm`,children:e.label}),(0,J.jsxs)(`span`,{className:`text-[13px] text-muted`,children:[i(e.section),` · `,(0,J.jsx)(`code`,{className:`font-mono text-[13px]`,children:e.key})]})]})},`${e.section}:${e.key}`))]})]})}var yk=class extends q.Component{state={failed:!1,at:this.props.at};static getDerivedStateFromError(){return{failed:!0}}static getDerivedStateFromProps(e,t){return e.at===t.at?null:{failed:!1,at:e.at}}componentDidCatch(e){console.error(`This page could not be shown:`,e)}render(){return this.state.failed?(0,J.jsxs)(`div`,{role:`alert`,className:`m-0 px-6 py-10 text-sm text-muted`,children:[(0,J.jsx)(`p`,{className:`m-0`,children:`This page could not be shown. Check the address, or go back and try again.`}),(0,J.jsx)(`p`,{className:`m-0 mt-2`,children:(0,J.jsx)(`a`,{href:B(),className:`underline`,children:`Go to Home`})})]}):this.props.children}};function bk(e,t){let n,r,i=()=>r??=e().then(e=>n=t(e),e=>{throw r=void 0,e}),a=(0,q.lazy)(()=>i().then(()=>({default:n})));return Object.assign(e=>(0,q.createElement)(n||a,e),{preload:i})}var xk=()=>G(()=>import(`./Chat-Bt6jZI68.js`),__vite__mapDeps([6,1,2,3,7,8,9,10,11,4,12,13,14])),Sk=bk(xk,e=>e.Chat),Ck=bk(xk,e=>e.Chats),wk=bk(()=>G(()=>import(`./Reports-ClcY7M0Q.js`),__vite__mapDeps([15,1,2,3,4,10,16])),e=>e.Reports),Tk=bk(()=>G(()=>Promise.resolve().then(()=>ew),void 0),e=>e.Agent),Ek=bk(()=>G(()=>import(`./Runs-CFvmdULI.js`),__vite__mapDeps([17,1,2,3,4,10,11,12,16])),e=>e.Runs),Dk=bk(()=>G(()=>import(`./Record-Dnlkimjb.js`),__vite__mapDeps([18,1,2,3,8,9,4,10,14,19,20])),e=>e.Record),Ok=bk(()=>G(()=>import(`./Desktop-BofKeLVf.js`),__vite__mapDeps([21,1,2,3,4,10,19,8,9])),e=>e.Desktop),kk=bk(()=>G(()=>import(`./Regression-D2DDTwzs.js`),__vite__mapDeps([22,1,2,3,8,9,23,24,7,11,4,12,13])),e=>e.Regression),Ak=bk(()=>G(()=>import(`./Impact-jOSl5Q0k.js`),__vite__mapDeps([25,1,2,3,26])),e=>e.Impact),jk=bk(()=>G(()=>import(`./ApiTests-BLnl7JGO.js`),__vite__mapDeps([27,1,2,3,8,9,4,10,23,24,7,11,12,13])),e=>e.ApiTests),Mk=bk(()=>G(()=>import(`./Migration-BBgv7xXo.js`),__vite__mapDeps([28,1,2,3,4,10,12,16,29,9,30])),e=>e.Migration),Nk=bk(()=>G(()=>import(`./Tosca-C5YaMLS0.js`),__vite__mapDeps([31,1,2,3,7,8,9,4,10,12,16,29,30,32])),e=>e.Tosca),Pk=bk(()=>G(()=>import(`./Compare-YfFYHwfK.js`),__vite__mapDeps([33,1,2,29,9,32,4,30])),e=>e.ToscaCompare),Fk=bk(()=>G(()=>import(`./Quality-Dxh-60A8.js`),__vite__mapDeps([34,1,2,3,4,10,35])),e=>e.Quality),Ik=bk(()=>G(()=>import(`./Flaky-Cut1kZw6.js`),__vite__mapDeps([36,1,2,3,16,35,4,10])),e=>e.Flaky),Lk=bk(()=>G(()=>import(`./RunDiff-CNImaEdz.js`),__vite__mapDeps([37,1,2,3,10,16,35,4])),e=>e.RunDiff),Rk=bk(()=>G(()=>import(`./TestDebt-tXPoexMF.js`),__vite__mapDeps([38,1,2,3,10,35,4])),e=>e.TestDebt),zk=bk(()=>G(()=>import(`./TestManagement-wjGaoZzI.js`),__vite__mapDeps([39,1,2,3,10,35,4,20])),e=>e.TestManagement),Bk=bk(()=>G(()=>import(`./Flags-B62v4uWR.js`),__vite__mapDeps([40,1,2,3,10,35,4])),e=>e.Flags),Vk=bk(()=>G(()=>import(`./Production-CCVtFNGQ.js`),__vite__mapDeps([41,1,2,3,4,10,35])),e=>e.Production),Hk=bk(()=>G(()=>import(`./Cost-ClaDz0YR.js`),__vite__mapDeps([42,1,2,3,10,35,4])),e=>e.Cost),Uk=bk(()=>G(()=>import(`./Explore-BdFvqgF4.js`),__vite__mapDeps([43,1,2,3,10,35,4])),e=>e.Explore),Wk=bk(()=>G(()=>import(`./Readiness-DyJvSOLN.js`),__vite__mapDeps([44,1,2,3,10,35,4])),e=>e.Readiness),Gk=bk(()=>G(()=>import(`./TestCases-CrQEUtfD.js`),__vite__mapDeps([45,1,2,3,4,10])),e=>e.TestCases),Kk=bk(()=>G(()=>import(`./KindPage-BbQWH5wa.js`),__vite__mapDeps([46,1,2,3,7,8,9,4,10,23,24,11,12,13,35])),e=>e.Accessibility),qk=bk(()=>G(()=>import(`./KindPage-BbQWH5wa.js`),__vite__mapDeps([46,1,2,3,7,8,9,4,10,23,24,11,12,13,35])),e=>e.Performance),Jk=bk(()=>G(()=>import(`./KindPage-BbQWH5wa.js`),__vite__mapDeps([46,1,2,3,7,8,9,4,10,23,24,11,12,13,35])),e=>e.Visual),Yk=bk(()=>G(()=>import(`./Data-jSFgAfej.js`),__vite__mapDeps([47,1,2,3,4,10,23,24,7,8,9,11,12,13,48])),e=>e.Data),Xk=bk(()=>G(()=>import(`./TestData-e3IX0xwG.js`),__vite__mapDeps([48,1,2,3,10])),e=>e.TestData),Zk=bk(()=>G(()=>import(`./Features-CIBbw6PG.js`),__vite__mapDeps([0,1,2,3,4])),e=>e.Features),Qk=bk(()=>G(()=>import(`./Jobs-DMJGgWtQ.js`),__vite__mapDeps([49,1,2,3,4,23,24,7,8,9,11,12,13])),e=>e.Jobs),$k=bk(()=>G(()=>import(`./Product-BrXH81Ns.js`),__vite__mapDeps([50,1,2,3,10,51,26,30,52])),e=>e.Product),eA=bk(()=>G(()=>import(`./Evidence-CJNzSQpY.js`),__vite__mapDeps([53,1,2,3,4,10,16,51])),e=>e.Evidence),tA=bk(()=>G(()=>import(`./WhatsNew-CwnRbDnd.js`),__vite__mapDeps([5,1,2,3])),e=>e.WhatsNew),nA=bk(()=>G(()=>import(`./Browse-C-Enjpmd.js`),__vite__mapDeps([54,1,2,3,55,10,17,4,11,12,16])),e=>e.Browse),rA={chats:Ck,reports:wk,agents:Tk,runs:Ek,record:Dk,desktop:Ok,regression:kk,impact:Ak,"api-tests":jk,migration:Mk,tosca:Nk,quality:Fk,flaky:Ik,"run-diff":Lk,"test-debt":Rk,"test-management":zk,flags:Bk,production:Vk,cost:Hk,explore:Uk,readiness:Wk,"test-cases":Gk,accessibility:Kk,performance:qk,visual:Jk,data:Yk,"test-data":Xk,features:Zk,jobs:Qk,schedules:Qk,product:$k,evidence:eA,"evidence-runs":eA,"evidence-contracts":eA,"evidence-review":eA,"evidence-releases":eA,"evidence-learn":eA,"evidence-monitor":eA,"whats-new":tA,browse:nA},iA=e=>rA[e[0]||``]?.preload();function aA(){let e=an(iA),[t=``,n,...r]=e;Tr();let[,i]=(0,q.useState)(0),[a,o]=(0,q.useState)(0);return(0,q.useEffect)(()=>{let e=()=>Object.values(rA).forEach(e=>void e.preload().catch(()=>{}));if(typeof requestIdleCallback==`function`){let t=requestIdleCallback(e,{timeout:3e3});return()=>cancelIdleCallback(t)}let t=setTimeout(e,1500);return()=>clearTimeout(t)},[]),(0,q.useEffect)(()=>{bn.get().then(e=>{rr(e),i(e=>e+1)},()=>{})},[]),(0,q.useEffect)(()=>{St.status().then(e=>{let t=location.hash.replace(/^#\/?/,``).split(`/`)[0];!e.ready&&e.state===null&&t!==`welcome`&&t!==`settings`&&location.replace(`#/welcome/setup`)},()=>{})},[]),t===`tosca`&&n&&r[0]===`compare`?(0,J.jsx)(yk,{at:e.join(`/`),children:(0,J.jsx)(q.Suspense,{fallback:(0,J.jsx)(`p`,{className:`m-0 px-6 py-10 text-sm text-muted`,children:`Opening…`}),children:(0,J.jsx)(Pk,{id:n,caseId:r[1]?Xt(r[1]):void 0})})}):(0,J.jsxs)(fi,{current:t,route:e,children:[(0,J.jsx)(ka,{onReload:()=>o(e=>e+1)}),(0,J.jsx)(q.Fragment,{children:(0,J.jsx)(yk,{at:e.join(`/`),children:(0,J.jsx)(oA,{page:t,sub:(t===`data`||t===`product`||t===`agents`||t===`runs`||t===`evidence`||t===`evidence-runs`||t===`accessibility`||t===`test-cases`||t===`test-management`||t===`quality`||t===`record`||t===`tosca`||t===`browse`||t===`knowledge`)&&n?[n,...r].join(`/`):n})})},a)]})}function oA({page:e,sub:t}){if(e===`settings`)return(0,J.jsx)(pk,{section:t});if(e===`welcome`)return(0,J.jsx)(pk,{guide:t??``},`welcome`);if(e===`chats`)return(0,J.jsx)(q.Suspense,{fallback:(0,J.jsx)(`p`,{className:`m-0 px-6 py-10 text-sm text-muted`,children:`Opening…`}),children:t?(0,J.jsx)(Sk,{id:t}):(0,J.jsx)(Ck,{})});if(e===`reports`)return(0,J.jsx)(q.Suspense,{fallback:(0,J.jsx)(`p`,{className:`m-0 px-6 py-10 text-sm text-muted`,children:`Opening…`}),children:(0,J.jsx)(wk,{sub:t})});if(e===`jobs`||e===`schedules`)return(0,J.jsx)(q.Suspense,{fallback:(0,J.jsx)(`p`,{className:`m-0 px-6 py-10 text-sm text-muted`,children:`Opening…`}),children:(0,J.jsx)(Qk,{sub:e===`jobs`?t:void 0})});if(e===`impact`)return(0,J.jsx)(q.Suspense,{fallback:(0,J.jsx)(`p`,{className:`m-0 px-6 py-10 text-sm text-muted`,children:`Opening…`}),children:(0,J.jsx)(Ak,{})});if(e===`regression`)return(0,J.jsx)(q.Suspense,{fallback:(0,J.jsx)(`p`,{className:`m-0 px-6 py-10 text-sm text-muted`,children:`Opening…`}),children:(0,J.jsx)(kk,{sub:t})});if(e===`api-tests`)return(0,J.jsx)(q.Suspense,{fallback:(0,J.jsx)(`p`,{className:`m-0 px-6 py-10 text-sm text-muted`,children:`Opening…`}),children:(0,J.jsx)(jk,{sub:t})});if(e===`migration`)return(0,J.jsx)(q.Suspense,{fallback:(0,J.jsx)(`p`,{className:`m-0 px-6 py-10 text-sm text-muted`,children:`Opening…`}),children:(0,J.jsx)(Mk,{sub:t})});if(e===`tosca`)return(0,J.jsx)(q.Suspense,{fallback:(0,J.jsx)(`p`,{className:`m-0 px-6 py-10 text-sm text-muted`,children:`Opening…`}),children:(0,J.jsx)(Nk,{sub:t})});if(e===`quality`)return(0,J.jsx)(q.Suspense,{fallback:(0,J.jsx)(`p`,{className:`m-0 px-6 py-10 text-sm text-muted`,children:`Opening…`}),children:(0,J.jsx)(Fk,{sub:t})});if(e===`readiness`)return(0,J.jsx)(q.Suspense,{fallback:(0,J.jsx)(`p`,{className:`m-0 px-6 py-10 text-sm text-muted`,children:`Opening…`}),children:(0,J.jsx)(Wk,{})});if(e===`explore`)return(0,J.jsx)(q.Suspense,{fallback:(0,J.jsx)(`p`,{className:`m-0 px-6 py-10 text-sm text-muted`,children:`Opening…`}),children:(0,J.jsx)(Uk,{sub:t})});if(e===`cost`)return(0,J.jsx)(q.Suspense,{fallback:(0,J.jsx)(`p`,{className:`m-0 px-6 py-10 text-sm text-muted`,children:`Opening…`}),children:(0,J.jsx)(Hk,{})});if(e===`production`)return(0,J.jsx)(q.Suspense,{fallback:(0,J.jsx)(`p`,{className:`m-0 px-6 py-10 text-sm text-muted`,children:`Opening…`}),children:(0,J.jsx)(Vk,{})});if(e===`flags`)return(0,J.jsx)(q.Suspense,{fallback:(0,J.jsx)(`p`,{className:`m-0 px-6 py-10 text-sm text-muted`,children:`Opening…`}),children:(0,J.jsx)(Bk,{})});if(e===`test-management`)return(0,J.jsx)(q.Suspense,{fallback:(0,J.jsx)(`p`,{className:`m-0 px-6 py-10 text-sm text-muted`,children:`Opening…`}),children:(0,J.jsx)(zk,{sub:t})});if(e===`test-debt`)return(0,J.jsx)(q.Suspense,{fallback:(0,J.jsx)(`p`,{className:`m-0 px-6 py-10 text-sm text-muted`,children:`Opening…`}),children:(0,J.jsx)(Rk,{sub:t})});if(e===`run-diff`)return(0,J.jsx)(q.Suspense,{fallback:(0,J.jsx)(`p`,{className:`m-0 px-6 py-10 text-sm text-muted`,children:`Opening…`}),children:(0,J.jsx)(Lk,{sub:t})});if(e===`flaky`)return(0,J.jsx)(q.Suspense,{fallback:(0,J.jsx)(`p`,{className:`m-0 px-6 py-10 text-sm text-muted`,children:`Opening…`}),children:(0,J.jsx)(Ik,{})});if(e===`test-cases`)return(0,J.jsx)(q.Suspense,{fallback:(0,J.jsx)(`p`,{className:`m-0 px-6 py-10 text-sm text-muted`,children:`Opening…`}),children:(0,J.jsx)(Gk,{sub:t})});if(e===`accessibility`||e===`performance`||e===`visual`)return(0,J.jsx)(q.Suspense,{fallback:(0,J.jsx)(`p`,{className:`m-0 px-6 py-10 text-sm text-muted`,children:`Opening…`}),children:(0,J.jsx)(e===`accessibility`?Kk:e===`performance`?qk:Jk,{sub:t},e)});if(e===`data`)return(0,J.jsx)(q.Suspense,{fallback:(0,J.jsx)(`p`,{className:`m-0 px-6 py-10 text-sm text-muted`,children:`Opening…`}),children:(0,J.jsx)(Yk,{sub:t})});if(e===`test-data`)return(0,J.jsx)(q.Suspense,{fallback:(0,J.jsx)(`p`,{className:`m-0 px-6 py-10 text-sm text-muted`,children:`Opening…`}),children:(0,J.jsx)(Xk,{sub:t})});if(e===`features`)return(0,J.jsx)(q.Suspense,{fallback:(0,J.jsx)(`p`,{className:`m-0 px-6 py-10 text-sm text-muted`,children:`Opening…`}),children:(0,J.jsx)(Zk,{})});if(e===`whats-new`)return(0,J.jsx)(q.Suspense,{fallback:(0,J.jsx)(`p`,{className:`m-0 px-6 py-10 text-sm text-muted`,children:`Opening…`}),children:(0,J.jsx)(tA,{})});if(e===`record`)return(0,J.jsx)(q.Suspense,{fallback:(0,J.jsx)(`p`,{className:`m-0 px-6 py-10 text-sm text-muted`,children:`Opening…`}),children:(0,J.jsx)(Dk,{sub:t})});if(e===`desktop`)return(0,J.jsx)(q.Suspense,{fallback:(0,J.jsx)(`p`,{className:`m-0 px-6 py-10 text-sm text-muted`,children:`Opening…`}),children:(0,J.jsx)(Ok,{sub:t})});if(e===`agents`)return(0,J.jsx)(q.Suspense,{fallback:(0,J.jsx)(`p`,{className:`m-0 px-6 py-10 text-sm text-muted`,children:`Opening…`}),children:(0,J.jsx)(Tk,{id:t})});if(e===`runs`)return(0,J.jsx)(q.Suspense,{fallback:(0,J.jsx)(`p`,{className:`m-0 px-6 py-10 text-sm text-muted`,children:`Opening…`}),children:(0,J.jsx)(Ek,{sub:t})});if(e===`product`)return(0,J.jsx)(q.Suspense,{fallback:(0,J.jsx)(`p`,{className:`m-0 px-6 py-10 text-sm text-muted`,children:`Opening…`}),children:(0,J.jsx)($k,{sub:t})});if(e===`evidence`||e===`evidence-runs`||e===`evidence-contracts`||e===`evidence-review`||e===`evidence-releases`||e===`evidence-learn`||e===`evidence-monitor`)return(0,J.jsx)(q.Suspense,{fallback:(0,J.jsx)(`p`,{className:`m-0 px-6 py-10 text-sm text-muted`,children:`Opening…`}),children:(0,J.jsx)(eA,{page:e,sub:t})});if(e===`browse`)return(0,J.jsx)(q.Suspense,{fallback:(0,J.jsx)(`p`,{className:`m-0 px-6 py-10 text-sm text-muted`,children:`Opening…`}),children:(0,J.jsx)(nA,{sub:t})});if(e===`knowledge`)return(0,J.jsx)(_w,{sub:t});if(e===`memory`)return(0,J.jsx)(kw,{});if(tk.includes(e))return(0,J.jsx)(pk,{only:e},e);let n=Aw.find(t=>t.id===e);return n?(0,J.jsx)(jw,{section:n}):(0,J.jsx)(Eo,{})}Ot(),Ut(),At(),Ai(),Ea(document),Ta(),(0,aa.createRoot)(document.getElementById(`root`)).render((0,J.jsx)(q.StrictMode,{children:(0,J.jsxs)(qn,{children:[(0,J.jsx)(aA,{}),(0,J.jsx)(Sa,{})]})}));export{sb as A,yo as B,Tx as C,Dx as D,Cx as E,Wo as F,Na as G,qa as H,Ko as I,uo as L,qo as M,Go as N,vx as O,Ho as P,go as R,xx as S,Sx as T,Xa as U,mo as V,Pa as W,Ax as _,aw as a,yx as b,mC as c,qS as d,wS as f,kx as g,cS as h,NE as i,vy as j,_x as k,fC as l,DS as m,tk as n,hC as o,NS as p,LE as r,pC as s,ek as t,oC as u,Ex as v,Ox as w,wx as x,bx as y,fo as z};